From ce93dd9046fb477e2b53d3ca1f77799abf4b3607 Mon Sep 17 00:00:00 2001 From: Owl Bot Date: Wed, 25 Mar 2026 21:20:03 +0000 Subject: [PATCH 1/2] feat: publish client batch config schema feat: publish new error reasons docs: fix documentation formatting docs: update various comments docs: update license year PiperOrigin-RevId: 889289393 Source-Link: https://github.com/googleapis/googleapis/commit/94bc991b3f1df58bc841801631715894a7ac5e28 Source-Link: https://github.com/googleapis/googleapis-gen/commit/db7143a338a7c75839b4698cb3ea6f1013b4c3c7 Copy-Tag: eyJwIjoiZ29vZ2xlLWNsb3VkLXJlZGlzLWNsdXN0ZXItdjFiZXRhMS8uT3dsQm90LnlhbWwiLCJoIjoiZGI3MTQzYTMzOGE3Yzc1ODM5YjQ2OThjYjNlYTZmMTAxM2I0YzNjNyJ9 Copy-Tag: eyJwIjoiZ29vZ2xlLWNsb3VkLXJlZGlzLXYxLy5Pd2xCb3QueWFtbCIsImgiOiJkYjcxNDNhMzM4YTdjNzU4MzliNDY5OGNiM2VhNmYxMDEzYjRjM2M3In0= Copy-Tag: eyJwIjoiZ29vZ2xlLWNsb3VkLXJlZGlzLXYxYmV0YTEvLk93bEJvdC55YW1sIiwiaCI6ImRiNzE0M2EzMzhhN2M3NTgzOWI0Njk4Y2IzZWE2ZjEwMTNiNGMzYzcifQ== Copy-Tag: eyJwIjoiZ29vZ2xlLWNsb3VkLXJlc291cmNlX21hbmFnZXItdjMvLk93bEJvdC55YW1sIiwiaCI6ImRiNzE0M2EzMzhhN2M3NTgzOWI0Njk4Y2IzZWE2ZjEwMTNiNGMzYzcifQ== Copy-Tag: eyJwIjoiZ29vZ2xlLWNsb3VkLXJldGFpbC12Mi8uT3dsQm90LnlhbWwiLCJoIjoiZGI3MTQzYTMzOGE3Yzc1ODM5YjQ2OThjYjNlYTZmMTAxM2I0YzNjNyJ9 Copy-Tag: eyJwIjoiZ29vZ2xlLWNsb3VkLXNhYXNfcGxhdGZvcm0tc2Fhc19zZXJ2aWNlX21nbXQtdjFiZXRhMS8uT3dsQm90LnlhbWwiLCJoIjoiZGI3MTQzYTMzOGE3Yzc1ODM5YjQ2OThjYjNlYTZmMTAxM2I0YzNjNyJ9 Copy-Tag: eyJwIjoiZ29vZ2xlLWNsb3VkLXNjaGVkdWxlci12MS8uT3dsQm90LnlhbWwiLCJoIjoiZGI3MTQzYTMzOGE3Yzc1ODM5YjQ2OThjYjNlYTZmMTAxM2I0YzNjNyJ9 Copy-Tag: eyJwIjoiZ29vZ2xlLWNsb3VkLXNjaGVkdWxlci12MWJldGExLy5Pd2xCb3QueWFtbCIsImgiOiJkYjcxNDNhMzM4YTdjNzU4MzliNDY5OGNiM2VhNmYxMDEzYjRjM2M3In0= Copy-Tag: eyJwIjoiZ29vZ2xlLWNsb3VkLXNlY3JldF9tYW5hZ2VyLXYxLy5Pd2xCb3QueWFtbCIsImgiOiJkYjcxNDNhMzM4YTdjNzU4MzliNDY5OGNiM2VhNmYxMDEzYjRjM2M3In0= Copy-Tag: eyJwIjoiZ29vZ2xlLWNsb3VkLXNlY3JldF9tYW5hZ2VyLXYxYmV0YTEvLk93bEJvdC55YW1sIiwiaCI6ImRiNzE0M2EzMzhhN2M3NTgzOWI0Njk4Y2IzZWE2ZjEwMTNiNGMzYzcifQ== Copy-Tag: eyJwIjoiZ29vZ2xlLWNsb3VkLXNlY3JldF9tYW5hZ2VyLXYxYmV0YTIvLk93bEJvdC55YW1sIiwiaCI6ImRiNzE0M2EzMzhhN2M3NTgzOWI0Njk4Y2IzZWE2ZjEwMTNiNGMzYzcifQ== Copy-Tag: eyJwIjoiZ29vZ2xlLWNsb3VkLXNlY3VyZV9zb3VyY2VfbWFuYWdlci12MS8uT3dsQm90LnlhbWwiLCJoIjoiZGI3MTQzYTMzOGE3Yzc1ODM5YjQ2OThjYjNlYTZmMTAxM2I0YzNjNyJ9 Copy-Tag: eyJwIjoiZ29vZ2xlLWNsb3VkLXNlY3VyaXR5LXByaXZhdGVfY2EtdjEvLk93bEJvdC55YW1sIiwiaCI6ImRiNzE0M2EzMzhhN2M3NTgzOWI0Njk4Y2IzZWE2ZjEwMTNiNGMzYzcifQ== Copy-Tag: eyJwIjoiZ29vZ2xlLWNsb3VkLXNlY3VyaXR5LXByaXZhdGVfY2EtdjFiZXRhMS8uT3dsQm90LnlhbWwiLCJoIjoiZGI3MTQzYTMzOGE3Yzc1ODM5YjQ2OThjYjNlYTZmMTAxM2I0YzNjNyJ9 Copy-Tag: eyJwIjoiZ29vZ2xlLWNsb3VkLXNlY3VyaXR5LXB1YmxpY19jYS12MS8uT3dsQm90LnlhbWwiLCJoIjoiZGI3MTQzYTMzOGE3Yzc1ODM5YjQ2OThjYjNlYTZmMTAxM2I0YzNjNyJ9 Copy-Tag: eyJwIjoiZ29vZ2xlLWNsb3VkLXNlY3VyaXR5LXB1YmxpY19jYS12MWJldGExLy5Pd2xCb3QueWFtbCIsImgiOiJkYjcxNDNhMzM4YTdjNzU4MzliNDY5OGNiM2VhNmYxMDEzYjRjM2M3In0= Copy-Tag: eyJwIjoiZ29vZ2xlLWNsb3VkLXNlY3VyaXR5X2NlbnRlci12MS8uT3dsQm90LnlhbWwiLCJoIjoiZGI3MTQzYTMzOGE3Yzc1ODM5YjQ2OThjYjNlYTZmMTAxM2I0YzNjNyJ9 Copy-Tag: eyJwIjoiZ29vZ2xlLWNsb3VkLXNlY3VyaXR5X2NlbnRlci12MXAxYmV0YTEvLk93bEJvdC55YW1sIiwiaCI6ImRiNzE0M2EzMzhhN2M3NTgzOWI0Njk4Y2IzZWE2ZjEwMTNiNGMzYzcifQ== Copy-Tag: eyJwIjoiZ29vZ2xlLWNsb3VkLXNlY3VyaXR5X2NlbnRlci12Mi8uT3dsQm90LnlhbWwiLCJoIjoiZGI3MTQzYTMzOGE3Yzc1ODM5YjQ2OThjYjNlYTZmMTAxM2I0YzNjNyJ9 Copy-Tag: eyJwIjoiZ29vZ2xlLWNsb3VkLXNlY3VyaXR5X2NlbnRlcl9tYW5hZ2VtZW50LXYxLy5Pd2xCb3QueWFtbCIsImgiOiJkYjcxNDNhMzM4YTdjNzU4MzliNDY5OGNiM2VhNmYxMDEzYjRjM2M3In0= --- .../.gitignore | 22 + .../.repo-metadata.json | 17 + .../.rubocop.yml | 33 + .../.toys.rb | 28 + .../.yardopts | 12 + .../AUTHENTICATION.md | 122 + .../CHANGELOG.md | 2 + .../Gemfile | 14 + .../LICENSE.md | 201 + .../README.md | 153 + .../Rakefile | 169 + .../gapic_metadata.json | 88 + ...google-cloud-redis-cluster-v1beta1.gemspec | 29 + .../lib/google-cloud-redis-cluster-v1beta1.rb | 21 + .../lib/google/cloud/redis/cluster/v1beta1.rb | 47 + .../cluster/v1beta1/bindings_override.rb | 77 + .../cluster/v1beta1/cloud_redis_cluster.rb | 72 + .../v1beta1/cloud_redis_cluster/client.rb | 1958 +++++ .../cloud_redis_cluster/credentials.rb | 49 + .../v1beta1/cloud_redis_cluster/operations.rb | 843 ++ .../v1beta1/cloud_redis_cluster/paths.rb | 229 + .../v1beta1/cloud_redis_cluster/rest.rb | 70 + .../cloud_redis_cluster/rest/client.rb | 1825 ++++ .../cloud_redis_cluster/rest/operations.rb | 926 ++ .../cloud_redis_cluster/rest/service_stub.rb | 942 +++ .../cluster/v1beta1/cloud_redis_cluster_pb.rb | 102 + .../cloud_redis_cluster_services_pb.rb | 122 + .../cloud/redis/cluster/v1beta1/rest.rb | 40 + .../cloud/redis/cluster/v1beta1/version.rb | 30 + .../proto_docs/README.md | 4 + .../proto_docs/google/api/client.rb | 589 ++ .../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 + .../cluster/v1beta1/cloud_redis_cluster.rb | 1301 +++ .../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/dayofweek.rb | 49 + .../proto_docs/google/type/timeofday.rb | 45 + .../snippets/Gemfile | 32 + .../cloud_redis_cluster/backup_cluster.rb | 54 + .../cloud_redis_cluster/create_cluster.rb | 54 + .../cloud_redis_cluster/delete_backup.rb | 54 + .../cloud_redis_cluster/delete_cluster.rb | 54 + .../cloud_redis_cluster/export_backup.rb | 54 + .../cloud_redis_cluster/get_backup.rb | 47 + .../get_backup_collection.rb | 47 + .../cloud_redis_cluster/get_cluster.rb | 47 + .../get_cluster_certificate_authority.rb | 47 + .../list_backup_collections.rb | 51 + .../cloud_redis_cluster/list_backups.rb | 51 + .../cloud_redis_cluster/list_clusters.rb | 51 + .../reschedule_cluster_maintenance.rb | 54 + .../cloud_redis_cluster/update_cluster.rb | 54 + ...ta_google.cloud.redis.cluster.v1beta1.json | 575 ++ .../cloud_redis_cluster_operations_test.rb | 400 + .../v1beta1/cloud_redis_cluster_paths_test.rb | 163 + .../v1beta1/cloud_redis_cluster_rest_test.rb | 873 ++ .../v1beta1/cloud_redis_cluster_test.rb | 1018 +++ .../test/helper.rb | 26 + .../google-cloud-redis-v1/.gitignore | 22 + .../google-cloud-redis-v1/.repo-metadata.json | 18 + .../google-cloud-redis-v1/.rubocop.yml | 33 + .../google-cloud-redis-v1/.toys.rb | 28 + .../google-cloud-redis-v1/.yardopts | 12 + .../google-cloud-redis-v1/AUTHENTICATION.md | 122 + .../google-cloud-redis-v1/CHANGELOG.md | 2 + owl-bot-staging/google-cloud-redis-v1/Gemfile | 14 + .../google-cloud-redis-v1/LICENSE.md | 201 + .../google-cloud-redis-v1/README.md | 153 + .../google-cloud-redis-v1/Rakefile | 169 + .../google-cloud-redis-v1/gapic_metadata.json | 73 + .../google-cloud-redis-v1.gemspec | 29 + .../lib/google-cloud-redis-v1.rb | 21 + .../lib/google/cloud/redis/v1.rb | 45 + .../cloud/redis/v1/bindings_override.rb | 75 + .../lib/google/cloud/redis/v1/cloud_redis.rb | 70 + .../cloud/redis/v1/cloud_redis/client.rb | 1649 ++++ .../cloud/redis/v1/cloud_redis/credentials.rb | 51 + .../cloud/redis/v1/cloud_redis/operations.rb | 841 ++ .../cloud/redis/v1/cloud_redis/paths.rb | 69 + .../google/cloud/redis/v1/cloud_redis/rest.rb | 68 + .../cloud/redis/v1/cloud_redis/rest/client.rb | 1537 ++++ .../redis/v1/cloud_redis/rest/operations.rb | 924 ++ .../redis/v1/cloud_redis/rest/service_stub.rb | 759 ++ .../google/cloud/redis/v1/cloud_redis_pb.rb | 69 + .../cloud/redis/v1/cloud_redis_services_pb.rb | 120 + .../lib/google/cloud/redis/v1/rest.rb | 38 + .../lib/google/cloud/redis/v1/version.rb | 28 + .../proto_docs/README.md | 4 + .../proto_docs/google/api/client.rb | 589 ++ .../proto_docs/google/api/field_behavior.rb | 85 + .../proto_docs/google/api/launch_stage.rb | 71 + .../proto_docs/google/api/resource.rb | 227 + .../google/cloud/redis/v1/cloud_redis.rb | 836 ++ .../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/dayofweek.rb | 49 + .../proto_docs/google/type/timeofday.rb | 45 + .../google-cloud-redis-v1/snippets/Gemfile | 32 + .../snippets/cloud_redis/create_instance.rb | 54 + .../snippets/cloud_redis/delete_instance.rb | 54 + .../snippets/cloud_redis/export_instance.rb | 54 + .../snippets/cloud_redis/failover_instance.rb | 54 + .../snippets/cloud_redis/get_instance.rb | 47 + .../cloud_redis/get_instance_auth_string.rb | 47 + .../snippets/cloud_redis/import_instance.rb | 54 + .../snippets/cloud_redis/list_instances.rb | 51 + .../cloud_redis/reschedule_maintenance.rb | 54 + .../snippets/cloud_redis/update_instance.rb | 54 + .../snippets/cloud_redis/upgrade_instance.rb | 54 + ...nippet_metadata_google.cloud.redis.v1.json | 455 + .../redis/v1/cloud_redis_operations_test.rb | 400 + .../cloud/redis/v1/cloud_redis_paths_test.rb | 67 + .../cloud/redis/v1/cloud_redis_rest_test.rb | 704 ++ .../google/cloud/redis/v1/cloud_redis_test.rb | 823 ++ .../google-cloud-redis-v1/test/helper.rb | 26 + .../google-cloud-redis-v1beta1/.gitignore | 22 + .../.repo-metadata.json | 18 + .../google-cloud-redis-v1beta1/.rubocop.yml | 33 + .../google-cloud-redis-v1beta1/.toys.rb | 28 + .../google-cloud-redis-v1beta1/.yardopts | 12 + .../AUTHENTICATION.md | 122 + .../google-cloud-redis-v1beta1/CHANGELOG.md | 2 + .../google-cloud-redis-v1beta1/Gemfile | 14 + .../google-cloud-redis-v1beta1/LICENSE.md | 201 + .../google-cloud-redis-v1beta1/README.md | 153 + .../google-cloud-redis-v1beta1/Rakefile | 169 + .../gapic_metadata.json | 73 + .../google-cloud-redis-v1beta1.gemspec | 28 + .../lib/google-cloud-redis-v1beta1.rb | 21 + .../lib/google/cloud/redis/v1beta1.rb | 45 + .../google/cloud/redis/v1beta1/cloud_redis.rb | 70 + .../cloud/redis/v1beta1/cloud_redis/client.rb | 1629 ++++ .../redis/v1beta1/cloud_redis/credentials.rb | 51 + .../redis/v1beta1/cloud_redis/operations.rb | 841 ++ .../cloud/redis/v1beta1/cloud_redis/paths.rb | 69 + .../cloud/redis/v1beta1/cloud_redis/rest.rb | 67 + .../redis/v1beta1/cloud_redis/rest/client.rb | 1509 ++++ .../v1beta1/cloud_redis/rest/operations.rb | 924 ++ .../v1beta1/cloud_redis/rest/service_stub.rb | 759 ++ .../cloud/redis/v1beta1/cloud_redis_pb.rb | 66 + .../redis/v1beta1/cloud_redis_services_pb.rb | 120 + .../lib/google/cloud/redis/v1beta1/rest.rb | 37 + .../lib/google/cloud/redis/v1beta1/version.rb | 28 + .../proto_docs/README.md | 4 + .../proto_docs/google/api/client.rb | 589 ++ .../proto_docs/google/api/field_behavior.rb | 85 + .../proto_docs/google/api/launch_stage.rb | 71 + .../proto_docs/google/api/resource.rb | 227 + .../google/cloud/redis/v1beta1/cloud_redis.rb | 771 ++ .../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/dayofweek.rb | 49 + .../proto_docs/google/type/timeofday.rb | 45 + .../snippets/Gemfile | 32 + .../snippets/cloud_redis/create_instance.rb | 54 + .../snippets/cloud_redis/delete_instance.rb | 54 + .../snippets/cloud_redis/export_instance.rb | 54 + .../snippets/cloud_redis/failover_instance.rb | 54 + .../snippets/cloud_redis/get_instance.rb | 47 + .../cloud_redis/get_instance_auth_string.rb | 47 + .../snippets/cloud_redis/import_instance.rb | 54 + .../snippets/cloud_redis/list_instances.rb | 51 + .../cloud_redis/reschedule_maintenance.rb | 54 + .../snippets/cloud_redis/update_instance.rb | 54 + .../snippets/cloud_redis/upgrade_instance.rb | 54 + ...t_metadata_google.cloud.redis.v1beta1.json | 455 + .../v1beta1/cloud_redis_operations_test.rb | 400 + .../redis/v1beta1/cloud_redis_paths_test.rb | 67 + .../redis/v1beta1/cloud_redis_rest_test.rb | 704 ++ .../cloud/redis/v1beta1/cloud_redis_test.rb | 823 ++ .../google-cloud-redis-v1beta1/test/helper.rb | 26 + .../.gitignore | 22 + .../.repo-metadata.json | 18 + .../.rubocop.yml | 33 + .../google-cloud-resource_manager-v3/.toys.rb | 28 + .../.yardopts | 12 + .../AUTHENTICATION.md | 122 + .../CHANGELOG.md | 2 + .../google-cloud-resource_manager-v3/Gemfile | 14 + .../LICENSE.md | 201 + .../README.md | 154 + .../google-cloud-resource_manager-v3/Rakefile | 169 + .../gapic_metadata.json | 332 + .../google-cloud-resource_manager-v3.gemspec | 29 + .../lib/google-cloud-resource_manager-v3.rb | 21 + .../lib/google/cloud/resource_manager/v3.rb | 51 + .../cloud/resource_manager/v3/folders.rb | 58 + .../resource_manager/v3/folders/client.rb | 1668 ++++ .../v3/folders/credentials.rb | 52 + .../resource_manager/v3/folders/operations.rb | 841 ++ .../resource_manager/v3/folders/paths.rb | 47 + .../cloud/resource_manager/v3/folders/rest.rb | 55 + .../v3/folders/rest/client.rb | 1572 ++++ .../v3/folders/rest/operations.rb | 925 ++ .../v3/folders/rest/service_stub.rb | 753 ++ .../resource_manager/v3/organizations.rb | 55 + .../v3/organizations/client.rb | 923 ++ .../v3/organizations/credentials.rb | 52 + .../v3/organizations/paths.rb | 47 + .../resource_manager/v3/organizations/rest.rb | 52 + .../v3/organizations/rest/client.rb | 853 ++ .../v3/organizations/rest/service_stub.rb | 387 + .../cloud/resource_manager/v3/projects.rb | 56 + .../resource_manager/v3/projects/client.rb | 1685 ++++ .../v3/projects/credentials.rb | 52 + .../v3/projects/operations.rb | 841 ++ .../resource_manager/v3/projects/paths.rb | 47 + .../resource_manager/v3/projects/rest.rb | 53 + .../v3/projects/rest/client.rb | 1589 ++++ .../v3/projects/rest/operations.rb | 925 ++ .../v3/projects/rest/service_stub.rb | 753 ++ .../google/cloud/resource_manager/v3/rest.rb | 43 + .../cloud/resource_manager/v3/tag_bindings.rb | 57 + .../v3/tag_bindings/client.rb | 808 ++ .../v3/tag_bindings/credentials.rb | 52 + .../v3/tag_bindings/operations.rb | 841 ++ .../resource_manager/v3/tag_bindings/paths.rb | 47 + .../resource_manager/v3/tag_bindings/rest.rb | 54 + .../v3/tag_bindings/rest/client.rb | 761 ++ .../v3/tag_bindings/rest/operations.rb | 925 ++ .../v3/tag_bindings/rest/service_stub.rb | 320 + .../cloud/resource_manager/v3/tag_holds.rb | 60 + .../resource_manager/v3/tag_holds/client.rb | 731 ++ .../v3/tag_holds/credentials.rb | 52 + .../v3/tag_holds/operations.rb | 841 ++ .../resource_manager/v3/tag_holds/paths.rb | 64 + .../resource_manager/v3/tag_holds/rest.rb | 57 + .../v3/tag_holds/rest/client.rb | 667 ++ .../v3/tag_holds/rest/operations.rb | 925 ++ .../v3/tag_holds/rest/service_stub.rb | 265 + .../cloud/resource_manager/v3/tag_keys.rb | 56 + .../resource_manager/v3/tag_keys/client.rb | 1333 +++ .../v3/tag_keys/credentials.rb | 52 + .../v3/tag_keys/operations.rb | 841 ++ .../resource_manager/v3/tag_keys/paths.rb | 47 + .../resource_manager/v3/tag_keys/rest.rb | 53 + .../v3/tag_keys/rest/client.rb | 1251 +++ .../v3/tag_keys/rest/operations.rb | 925 ++ .../v3/tag_keys/rest/service_stub.rb | 629 ++ .../cloud/resource_manager/v3/tag_values.rb | 56 + .../resource_manager/v3/tag_values/client.rb | 1333 +++ .../v3/tag_values/credentials.rb | 52 + .../v3/tag_values/operations.rb | 841 ++ .../resource_manager/v3/tag_values/paths.rb | 47 + .../resource_manager/v3/tag_values/rest.rb | 53 + .../v3/tag_values/rest/client.rb | 1251 +++ .../v3/tag_values/rest/operations.rb | 925 ++ .../v3/tag_values/rest/service_stub.rb | 629 ++ .../cloud/resource_manager/v3/version.rb | 28 + .../cloud/resourcemanager/v3/folders_pb.rb | 47 + .../resourcemanager/v3/folders_services_pb.rb | 172 + .../resourcemanager/v3/organizations_pb.rb | 35 + .../v3/organizations_services_pb.rb | 73 + .../cloud/resourcemanager/v3/projects_pb.rb | 47 + .../v3/projects_services_pb.rb | 190 + .../resourcemanager/v3/tag_bindings_pb.rb | 37 + .../v3/tag_bindings_services_pb.rb | 57 + .../cloud/resourcemanager/v3/tag_holds_pb.rb | 35 + .../v3/tag_holds_services_pb.rb | 54 + .../cloud/resourcemanager/v3/tag_keys_pb.rb | 42 + .../v3/tag_keys_services_pb.rb | 81 + .../cloud/resourcemanager/v3/tag_values_pb.rb | 41 + .../v3/tag_values_services_pb.rb | 81 + .../proto_docs/README.md | 4 + .../proto_docs/google/api/client.rb | 589 ++ .../proto_docs/google/api/field_behavior.rb | 85 + .../proto_docs/google/api/launch_stage.rb | 71 + .../proto_docs/google/api/resource.rb | 227 + .../cloud/resourcemanager/v3/folders.rb | 315 + .../cloud/resourcemanager/v3/organizations.rb | 155 + .../cloud/resourcemanager/v3/projects.rb | 395 + .../cloud/resourcemanager/v3/tag_bindings.rb | 216 + .../cloud/resourcemanager/v3/tag_holds.rb | 161 + .../cloud/resourcemanager/v3/tag_keys.rb | 247 + .../cloud/resourcemanager/v3/tag_values.rb | 202 + .../proto_docs/google/iam/v1/iam_policy.rb | 87 + .../proto_docs/google/iam/v1/options.rb | 50 + .../proto_docs/google/iam/v1/policy.rb | 426 + .../google/longrunning/operations.rb | 191 + .../proto_docs/google/protobuf/any.rb | 145 + .../proto_docs/google/protobuf/duration.rb | 98 + .../proto_docs/google/protobuf/empty.rb | 34 + .../proto_docs/google/protobuf/field_mask.rb | 229 + .../proto_docs/google/protobuf/timestamp.rb | 127 + .../proto_docs/google/rpc/status.rb | 48 + .../proto_docs/google/type/expr.rb | 75 + .../snippets/Gemfile | 32 + .../snippets/folders/create_folder.rb | 54 + .../snippets/folders/delete_folder.rb | 54 + .../snippets/folders/get_folder.rb | 47 + .../snippets/folders/get_iam_policy.rb | 47 + .../snippets/folders/list_folders.rb | 51 + .../snippets/folders/move_folder.rb | 54 + .../snippets/folders/search_folders.rb | 51 + .../snippets/folders/set_iam_policy.rb | 47 + .../snippets/folders/test_iam_permissions.rb | 47 + .../snippets/folders/undelete_folder.rb | 54 + .../snippets/folders/update_folder.rb | 54 + .../snippets/organizations/get_iam_policy.rb | 47 + .../organizations/get_organization.rb | 47 + .../organizations/search_organizations.rb | 51 + .../snippets/organizations/set_iam_policy.rb | 47 + .../organizations/test_iam_permissions.rb | 47 + .../snippets/projects/create_project.rb | 54 + .../snippets/projects/delete_project.rb | 54 + .../snippets/projects/get_iam_policy.rb | 47 + .../snippets/projects/get_project.rb | 47 + .../snippets/projects/list_projects.rb | 51 + .../snippets/projects/move_project.rb | 54 + .../snippets/projects/search_projects.rb | 51 + .../snippets/projects/set_iam_policy.rb | 47 + .../snippets/projects/test_iam_permissions.rb | 47 + .../snippets/projects/undelete_project.rb | 54 + .../snippets/projects/update_project.rb | 54 + ...adata_google.cloud.resourcemanager.v3.json | 2095 +++++ .../tag_bindings/create_tag_binding.rb | 54 + .../tag_bindings/delete_tag_binding.rb | 54 + .../tag_bindings/list_effective_tags.rb | 51 + .../tag_bindings/list_tag_bindings.rb | 51 + .../snippets/tag_holds/create_tag_hold.rb | 54 + .../snippets/tag_holds/delete_tag_hold.rb | 54 + .../snippets/tag_holds/list_tag_holds.rb | 51 + .../snippets/tag_keys/create_tag_key.rb | 54 + .../snippets/tag_keys/delete_tag_key.rb | 54 + .../snippets/tag_keys/get_iam_policy.rb | 47 + .../tag_keys/get_namespaced_tag_key.rb | 47 + .../snippets/tag_keys/get_tag_key.rb | 47 + .../snippets/tag_keys/list_tag_keys.rb | 51 + .../snippets/tag_keys/set_iam_policy.rb | 47 + .../snippets/tag_keys/test_iam_permissions.rb | 47 + .../snippets/tag_keys/update_tag_key.rb | 54 + .../snippets/tag_values/create_tag_value.rb | 54 + .../snippets/tag_values/delete_tag_value.rb | 54 + .../snippets/tag_values/get_iam_policy.rb | 47 + .../tag_values/get_namespaced_tag_value.rb | 47 + .../snippets/tag_values/get_tag_value.rb | 47 + .../snippets/tag_values/list_tag_values.rb | 51 + .../snippets/tag_values/set_iam_policy.rb | 47 + .../tag_values/test_iam_permissions.rb | 47 + .../snippets/tag_values/update_tag_value.rb | 54 + .../v3/folders_operations_test.rb | 400 + .../resource_manager/v3/folders_paths_test.rb | 55 + .../resource_manager/v3/folders_rest_test.rb | 704 ++ .../cloud/resource_manager/v3/folders_test.rb | 813 ++ .../v3/organizations_paths_test.rb | 55 + .../v3/organizations_rest_test.rb | 375 + .../resource_manager/v3/organizations_test.rb | 411 + .../v3/projects_operations_test.rb | 400 + .../v3/projects_paths_test.rb | 55 + .../resource_manager/v3/projects_rest_test.rb | 704 ++ .../resource_manager/v3/projects_test.rb | 813 ++ .../v3/tag_bindings_operations_test.rb | 400 + .../v3/tag_bindings_paths_test.rb | 55 + .../v3/tag_bindings_rest_test.rb | 320 + .../resource_manager/v3/tag_bindings_test.rb | 380 + .../v3/tag_holds_operations_test.rb | 400 + .../v3/tag_holds_paths_test.rb | 67 + .../v3/tag_holds_rest_test.rb | 267 + .../resource_manager/v3/tag_holds_test.rb | 319 + .../v3/tag_keys_operations_test.rb | 400 + .../v3/tag_keys_paths_test.rb | 55 + .../resource_manager/v3/tag_keys_rest_test.rb | 596 ++ .../resource_manager/v3/tag_keys_test.rb | 682 ++ .../v3/tag_values_operations_test.rb | 400 + .../v3/tag_values_paths_test.rb | 55 + .../v3/tag_values_rest_test.rb | 596 ++ .../resource_manager/v3/tag_values_test.rb | 682 ++ .../test/helper.rb | 26 + .../google-cloud-retail-v2/.gitignore | 22 + .../.repo-metadata.json | 18 + .../google-cloud-retail-v2/.rubocop.yml | 33 + .../google-cloud-retail-v2/.toys.rb | 28 + .../google-cloud-retail-v2/.yardopts | 12 + .../google-cloud-retail-v2/AUTHENTICATION.md | 122 + .../google-cloud-retail-v2/CHANGELOG.md | 2 + .../google-cloud-retail-v2/Gemfile | 14 + .../google-cloud-retail-v2/LICENSE.md | 201 + .../google-cloud-retail-v2/README.md | 154 + .../google-cloud-retail-v2/Rakefile | 169 + .../gapic_metadata.json | 412 + .../google-cloud-retail-v2.gemspec | 29 + .../lib/google-cloud-retail-v2.rb | 21 + .../lib/google/cloud/retail/v2.rb | 56 + .../cloud/retail/v2/analytics_service.rb | 56 + .../retail/v2/analytics_service/client.rb | 541 ++ .../v2/analytics_service/credentials.rb | 51 + .../retail/v2/analytics_service/operations.rb | 841 ++ .../cloud/retail/v2/analytics_service/rest.rb | 53 + .../v2/analytics_service/rest/client.rb | 491 ++ .../v2/analytics_service/rest/operations.rb | 960 +++ .../v2/analytics_service/rest/service_stub.rb | 143 + .../cloud/retail/v2/analytics_service_pb.rb | 27 + .../v2/analytics_service_services_pb.rb | 49 + .../lib/google/cloud/retail/v2/catalog_pb.rb | 42 + .../google/cloud/retail/v2/catalog_service.rb | 55 + .../cloud/retail/v2/catalog_service/client.rb | 1588 ++++ .../retail/v2/catalog_service/credentials.rb | 51 + .../cloud/retail/v2/catalog_service/paths.rb | 128 + .../cloud/retail/v2/catalog_service/rest.rb | 52 + .../retail/v2/catalog_service/rest/client.rb | 1468 ++++ .../v2/catalog_service/rest/service_stub.rb | 759 ++ .../cloud/retail/v2/catalog_service_pb.rb | 42 + .../retail/v2/catalog_service_services_pb.rb | 125 + .../lib/google/cloud/retail/v2/common_pb.rb | 58 + .../cloud/retail/v2/completion_service.rb | 59 + .../retail/v2/completion_service/client.rb | 714 ++ .../v2/completion_service/credentials.rb | 51 + .../v2/completion_service/operations.rb | 841 ++ .../retail/v2/completion_service/paths.rb | 52 + .../retail/v2/completion_service/rest.rb | 56 + .../v2/completion_service/rest/client.rb | 657 ++ .../v2/completion_service/rest/operations.rb | 960 +++ .../completion_service/rest/service_stub.rb | 204 + .../cloud/retail/v2/completion_service_pb.rb | 33 + .../v2/completion_service_services_pb.rb | 61 + .../lib/google/cloud/retail/v2/control_pb.rb | 25 + .../google/cloud/retail/v2/control_service.rb | 55 + .../cloud/retail/v2/control_service/client.rb | 909 ++ .../retail/v2/control_service/credentials.rb | 51 + .../cloud/retail/v2/control_service/paths.rb | 73 + .../cloud/retail/v2/control_service/rest.rb | 52 + .../retail/v2/control_service/rest/client.rb | 831 ++ .../v2/control_service/rest/service_stub.rb | 388 + .../cloud/retail/v2/control_service_pb.rb | 34 + .../retail/v2/control_service_services_pb.rb | 65 + .../v2/conversational_search_service.rb | 59 + .../conversational_search_service/client.rb | 574 ++ .../credentials.rb | 51 + .../v2/conversational_search_service/paths.rb | 54 + .../v2/conversational_search_service/rest.rb | 56 + .../rest/client.rb | 526 ++ .../rest/service_stub.rb | 145 + .../v2/conversational_search_service_pb.rb | 41 + ...nversational_search_service_services_pb.rb | 52 + .../cloud/retail/v2/export_config_pb.rb | 35 + .../cloud/retail/v2/generative_question_pb.rb | 24 + .../retail/v2/generative_question_service.rb | 55 + .../v2/generative_question_service/client.rb | 877 ++ .../credentials.rb | 51 + .../v2/generative_question_service/paths.rb | 52 + .../v2/generative_question_service/rest.rb | 52 + .../rest/client.rb | 799 ++ .../rest/service_stub.rb | 389 + .../v2/generative_question_service_pb.rb | 34 + ...generative_question_service_services_pb.rb | 55 + .../cloud/retail/v2/import_config_pb.rb | 46 + .../lib/google/cloud/retail/v2/model_pb.rb | 34 + .../google/cloud/retail/v2/model_service.rb | 67 + .../cloud/retail/v2/model_service/client.rb | 1219 +++ .../retail/v2/model_service/credentials.rb | 51 + .../retail/v2/model_service/operations.rb | 841 ++ .../cloud/retail/v2/model_service/paths.rb | 73 + .../cloud/retail/v2/model_service/rest.rb | 64 + .../retail/v2/model_service/rest/client.rb | 1120 +++ .../v2/model_service/rest/operations.rb | 960 +++ .../v2/model_service/rest/service_stub.rb | 574 ++ .../cloud/retail/v2/model_service_pb.rb | 41 + .../retail/v2/model_service_services_pb.rb | 73 + .../cloud/retail/v2/prediction_service.rb | 55 + .../retail/v2/prediction_service/client.rb | 621 ++ .../v2/prediction_service/credentials.rb | 51 + .../retail/v2/prediction_service/paths.rb | 56 + .../retail/v2/prediction_service/rest.rb | 52 + .../v2/prediction_service/rest/client.rb | 571 ++ .../prediction_service/rest/service_stub.rb | 151 + .../cloud/retail/v2/prediction_service_pb.rb | 30 + .../v2/prediction_service_services_pb.rb | 45 + .../lib/google/cloud/retail/v2/product_pb.rb | 32 + .../google/cloud/retail/v2/product_service.rb | 57 + .../cloud/retail/v2/product_service/client.rb | 2237 +++++ .../retail/v2/product_service/credentials.rb | 51 + .../retail/v2/product_service/operations.rb | 841 ++ .../cloud/retail/v2/product_service/paths.rb | 77 + .../cloud/retail/v2/product_service/rest.rb | 54 + .../retail/v2/product_service/rest/client.rb | 2110 +++++ .../v2/product_service/rest/operations.rb | 960 +++ .../v2/product_service/rest/service_stub.rb | 822 ++ .../cloud/retail/v2/product_service_pb.rb | 54 + .../retail/v2/product_service_services_pb.rb | 248 + .../google/cloud/retail/v2/promotion_pb.rb | 21 + .../google/cloud/retail/v2/purge_config_pb.rb | 30 + .../lib/google/cloud/retail/v2/rest.rb | 48 + .../lib/google/cloud/retail/v2/safety_pb.rb | 26 + .../google/cloud/retail/v2/search_service.rb | 58 + .../cloud/retail/v2/search_service/client.rb | 787 ++ .../retail/v2/search_service/credentials.rb | 51 + .../cloud/retail/v2/search_service/paths.rb | 54 + .../cloud/retail/v2/search_service/rest.rb | 55 + .../retail/v2/search_service/rest/client.rb | 737 ++ .../v2/search_service/rest/service_stub.rb | 151 + .../cloud/retail/v2/search_service_pb.rb | 61 + .../retail/v2/search_service_services_pb.rb | 51 + .../cloud/retail/v2/serving_config_pb.rb | 27 + .../cloud/retail/v2/serving_config_service.rb | 55 + .../v2/serving_config_service/client.rb | 1100 +++ .../v2/serving_config_service/credentials.rb | 51 + .../retail/v2/serving_config_service/paths.rb | 73 + .../retail/v2/serving_config_service/rest.rb | 52 + .../v2/serving_config_service/rest/client.rb | 1008 +++ .../rest/service_stub.rb | 512 ++ .../retail/v2/serving_config_service_pb.rb | 36 + .../v2/serving_config_service_services_pb.rb | 74 + .../google/cloud/retail/v2/user_event_pb.rb | 30 + .../cloud/retail/v2/user_event_service.rb | 56 + .../retail/v2/user_event_service/client.rb | 1006 +++ .../v2/user_event_service/credentials.rb | 51 + .../v2/user_event_service/operations.rb | 841 ++ .../retail/v2/user_event_service/paths.rb | 75 + .../retail/v2/user_event_service/rest.rb | 53 + .../v2/user_event_service/rest/client.rb | 928 ++ .../v2/user_event_service/rest/operations.rb | 960 +++ .../user_event_service/rest/service_stub.rb | 398 + .../cloud/retail/v2/user_event_service_pb.rb | 36 + .../v2/user_event_service_services_pb.rb | 75 + .../lib/google/cloud/retail/v2/version.rb | 28 + .../proto_docs/README.md | 4 + .../proto_docs/google/api/client.rb | 589 ++ .../proto_docs/google/api/field_behavior.rb | 85 + .../proto_docs/google/api/httpbody.rb | 80 + .../proto_docs/google/api/launch_stage.rb | 71 + .../proto_docs/google/api/resource.rb | 227 + .../google/cloud/retail/v2/catalog.rb | 516 ++ .../google/cloud/retail/v2/catalog_service.rb | 297 + .../google/cloud/retail/v2/common.rb | 1085 +++ .../cloud/retail/v2/completion_service.rb | 230 + .../google/cloud/retail/v2/control.rb | 75 + .../google/cloud/retail/v2/control_service.rb | 122 + .../v2/conversational_search_service.rb | 358 + .../google/cloud/retail/v2/export_config.rb | 184 + .../cloud/retail/v2/generative_question.rb | 75 + .../retail/v2/generative_question_service.rb | 109 + .../google/cloud/retail/v2/import_config.rb | 404 + .../google/cloud/retail/v2/model.rb | 267 + .../google/cloud/retail/v2/model_service.rb | 172 + .../cloud/retail/v2/prediction_service.rb | 237 + .../google/cloud/retail/v2/product.rb | 588 ++ .../google/cloud/retail/v2/product_service.rb | 653 ++ .../google/cloud/retail/v2/promotion.rb | 43 + .../google/cloud/retail/v2/purge_config.rb | 178 + .../google/cloud/retail/v2/safety.rb | 96 + .../google/cloud/retail/v2/search_service.rb | 1301 +++ .../google/cloud/retail/v2/serving_config.rb | 259 + .../cloud/retail/v2/serving_config_service.rb | 143 + .../google/cloud/retail/v2/user_event.rb | 364 + .../cloud/retail/v2/user_event_service.rb | 130 + .../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/struct.rb | 108 + .../proto_docs/google/protobuf/timestamp.rb | 127 + .../proto_docs/google/protobuf/wrappers.rb | 148 + .../proto_docs/google/rpc/status.rb | 48 + .../proto_docs/google/type/date.rb | 53 + .../google-cloud-retail-v2/snippets/Gemfile | 32 + .../export_analytics_metrics.rb | 54 + .../catalog_service/add_catalog_attribute.rb | 47 + .../catalog_service/get_attributes_config.rb | 47 + .../catalog_service/get_completion_config.rb | 47 + .../catalog_service/get_default_branch.rb | 47 + .../snippets/catalog_service/list_catalogs.rb | 51 + .../remove_catalog_attribute.rb | 47 + .../replace_catalog_attribute.rb | 47 + .../catalog_service/set_default_branch.rb | 47 + .../update_attributes_config.rb | 47 + .../catalog_service/update_catalog.rb | 47 + .../update_completion_config.rb | 47 + .../completion_service/complete_query.rb | 47 + .../import_completion_data.rb | 54 + .../control_service/create_control.rb | 47 + .../control_service/delete_control.rb | 47 + .../snippets/control_service/get_control.rb | 47 + .../snippets/control_service/list_controls.rb | 51 + .../control_service/update_control.rb | 47 + .../conversational_search.rb | 50 + ...atch_update_generative_question_configs.rb | 47 + ...get_generative_questions_feature_config.rb | 47 + .../list_generative_question_configs.rb | 47 + .../update_generative_question_config.rb | 47 + ...ate_generative_questions_feature_config.rb | 47 + .../snippets/model_service/create_model.rb | 54 + .../snippets/model_service/delete_model.rb | 47 + .../snippets/model_service/get_model.rb | 47 + .../snippets/model_service/list_models.rb | 51 + .../snippets/model_service/pause_model.rb | 47 + .../snippets/model_service/resume_model.rb | 47 + .../snippets/model_service/tune_model.rb | 54 + .../snippets/model_service/update_model.rb | 47 + .../snippets/prediction_service/predict.rb | 47 + .../product_service/add_fulfillment_places.rb | 54 + .../product_service/add_local_inventories.rb | 54 + .../product_service/create_product.rb | 47 + .../product_service/delete_product.rb | 47 + .../snippets/product_service/get_product.rb | 47 + .../product_service/import_products.rb | 54 + .../snippets/product_service/list_products.rb | 51 + .../product_service/purge_products.rb | 54 + .../remove_fulfillment_places.rb | 54 + .../remove_local_inventories.rb | 54 + .../snippets/product_service/set_inventory.rb | 54 + .../product_service/update_product.rb | 47 + .../snippets/search_service/search.rb | 51 + .../serving_config_service/add_control.rb | 47 + .../create_serving_config.rb | 47 + .../delete_serving_config.rb | 47 + .../get_serving_config.rb | 47 + .../list_serving_configs.rb | 51 + .../serving_config_service/remove_control.rb | 47 + .../update_serving_config.rb | 47 + ...ippet_metadata_google.cloud.retail.v2.json | 2375 ++++++ .../user_event_service/collect_user_event.rb | 47 + .../user_event_service/import_user_events.rb | 54 + .../user_event_service/purge_user_events.rb | 54 + .../user_event_service/rejoin_user_events.rb | 54 + .../user_event_service/write_user_event.rb | 47 + .../v2/analytics_service_operations_test.rb | 400 + .../retail/v2/analytics_service_rest_test.rb | 155 + .../cloud/retail/v2/analytics_service_test.rb | 185 + .../retail/v2/catalog_service_paths_test.rb | 103 + .../retail/v2/catalog_service_rest_test.rb | 705 ++ .../cloud/retail/v2/catalog_service_test.rb | 771 ++ .../v2/completion_service_operations_test.rb | 400 + .../v2/completion_service_paths_test.rb | 55 + .../retail/v2/completion_service_rest_test.rb | 217 + .../retail/v2/completion_service_test.rb | 259 + .../retail/v2/control_service_paths_test.rb | 67 + .../retail/v2/control_service_rest_test.rb | 375 + .../cloud/retail/v2/control_service_test.rb | 411 + ...onversational_search_service_paths_test.rb | 55 + ...conversational_search_service_rest_test.rb | 163 + .../v2/conversational_search_service_test.rb | 197 + .../generative_question_service_paths_test.rb | 55 + .../generative_question_service_rest_test.rb | 372 + .../v2/generative_question_service_test.rb | 400 + .../v2/model_service_operations_test.rb | 400 + .../retail/v2/model_service_paths_test.rb | 67 + .../retail/v2/model_service_rest_test.rb | 536 ++ .../cloud/retail/v2/model_service_test.rb | 607 ++ .../v2/prediction_service_paths_test.rb | 55 + .../retail/v2/prediction_service_rest_test.rb | 160 + .../retail/v2/prediction_service_test.rb | 176 + .../v2/product_service_operations_test.rb | 400 + .../retail/v2/product_service_paths_test.rb | 67 + .../retail/v2/product_service_rest_test.rb | 781 ++ .../cloud/retail/v2/product_service_test.rb | 922 ++ .../retail/v2/search_service_paths_test.rb | 55 + .../retail/v2/search_service_rest_test.rb | 180 + .../cloud/retail/v2/search_service_test.rb | 222 + .../v2/serving_config_service_paths_test.rb | 67 + .../v2/serving_config_service_rest_test.rb | 484 ++ .../retail/v2/serving_config_service_test.rb | 529 ++ .../v2/user_event_service_operations_test.rb | 400 + .../v2/user_event_service_paths_test.rb | 67 + .../retail/v2/user_event_service_rest_test.rb | 381 + .../retail/v2/user_event_service_test.rb | 448 + .../google-cloud-retail-v2/test/helper.rb | 26 + .../.gitignore | 22 + .../.repo-metadata.json | 17 + .../.rubocop.yml | 33 + .../.toys.rb | 28 + .../.yardopts | 12 + .../AUTHENTICATION.md | 122 + .../CHANGELOG.md | 2 + .../Gemfile | 14 + .../LICENSE.md | 201 + .../README.md | 154 + .../Rakefile | 169 + .../gapic_metadata.json | 227 + ...platform-saas_service_mgmt-v1beta1.gemspec | 29 + ...saas_platform-saas_service_mgmt-v1beta1.rb | 21 + .../saas_service_mgmt/v1beta1.rb | 48 + .../v1beta1/bindings_override.rb | 77 + .../saas_service_mgmt/v1beta1/rest.rb | 41 + .../v1beta1/saas_deployments.rb | 57 + .../v1beta1/saas_deployments/client.rb | 3802 +++++++++ .../v1beta1/saas_deployments/credentials.rb | 49 + .../v1beta1/saas_deployments/paths.rb | 185 + .../v1beta1/saas_deployments/rest.rb | 55 + .../v1beta1/saas_deployments/rest/client.rb | 3557 ++++++++ .../saas_deployments/rest/service_stub.rb | 1925 +++++ .../v1beta1/saas_rollouts.rb | 57 + .../v1beta1/saas_rollouts/client.rb | 1534 ++++ .../v1beta1/saas_rollouts/credentials.rb | 49 + .../v1beta1/saas_rollouts/paths.rb | 128 + .../v1beta1/saas_rollouts/rest.rb | 55 + .../v1beta1/saas_rollouts/rest/client.rb | 1429 ++++ .../saas_rollouts/rest/service_stub.rb | 697 ++ .../saas_service_mgmt/v1beta1/version.rb | 30 + .../saasservicemgmt/v1beta1/common_pb.rb | 36 + .../v1beta1/deployments_resources_pb.rb | 50 + .../v1beta1/deployments_service_pb.rb | 66 + .../deployments_service_services_pb.rb | 105 + .../v1beta1/rollouts_resources_pb.rb | 37 + .../v1beta1/rollouts_service_pb.rb | 42 + .../v1beta1/rollouts_service_services_pb.rb | 65 + .../proto_docs/README.md | 4 + .../proto_docs/google/api/client.rb | 589 ++ .../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 + .../saasservicemgmt/v1beta1/common.rb | 237 + .../v1beta1/deployments_resources.rb | 837 ++ .../v1beta1/deployments_service.rb | 976 +++ .../v1beta1/rollouts_resources.rb | 389 + .../v1beta1/rollouts_service.rb | 344 + .../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 + .../snippets/Gemfile | 32 + .../saas_deployments/create_release.rb | 47 + .../snippets/saas_deployments/create_saas.rb | 47 + .../saas_deployments/create_tenant.rb | 47 + .../snippets/saas_deployments/create_unit.rb | 47 + .../saas_deployments/create_unit_kind.rb | 47 + .../saas_deployments/create_unit_operation.rb | 47 + .../saas_deployments/delete_release.rb | 47 + .../snippets/saas_deployments/delete_saas.rb | 47 + .../saas_deployments/delete_tenant.rb | 47 + .../snippets/saas_deployments/delete_unit.rb | 47 + .../saas_deployments/delete_unit_kind.rb | 47 + .../saas_deployments/delete_unit_operation.rb | 47 + .../snippets/saas_deployments/get_release.rb | 47 + .../snippets/saas_deployments/get_saas.rb | 47 + .../snippets/saas_deployments/get_tenant.rb | 47 + .../snippets/saas_deployments/get_unit.rb | 47 + .../saas_deployments/get_unit_kind.rb | 47 + .../saas_deployments/get_unit_operation.rb | 47 + .../saas_deployments/list_releases.rb | 51 + .../snippets/saas_deployments/list_saas.rb | 51 + .../snippets/saas_deployments/list_tenants.rb | 51 + .../saas_deployments/list_unit_kinds.rb | 51 + .../saas_deployments/list_unit_operations.rb | 51 + .../snippets/saas_deployments/list_units.rb | 51 + .../saas_deployments/update_release.rb | 47 + .../snippets/saas_deployments/update_saas.rb | 47 + .../saas_deployments/update_tenant.rb | 47 + .../snippets/saas_deployments/update_unit.rb | 47 + .../saas_deployments/update_unit_kind.rb | 47 + .../saas_deployments/update_unit_operation.rb | 47 + .../snippets/saas_rollouts/create_rollout.rb | 47 + .../saas_rollouts/create_rollout_kind.rb | 47 + .../snippets/saas_rollouts/delete_rollout.rb | 47 + .../saas_rollouts/delete_rollout_kind.rb | 47 + .../snippets/saas_rollouts/get_rollout.rb | 47 + .../saas_rollouts/get_rollout_kind.rb | 47 + .../saas_rollouts/list_rollout_kinds.rb | 51 + .../snippets/saas_rollouts/list_rollouts.rb | 51 + .../snippets/saas_rollouts/update_rollout.rb | 47 + .../saas_rollouts/update_rollout_kind.rb | 47 + ....saasplatform.saasservicemgmt.v1beta1.json | 1615 ++++ .../v1beta1/saas_deployments_paths_test.rb | 139 + .../v1beta1/saas_deployments_rest_test.rb | 1803 ++++ .../v1beta1/saas_deployments_test.rb | 2042 +++++ .../v1beta1/saas_rollouts_paths_test.rb | 103 + .../v1beta1/saas_rollouts_rest_test.rb | 667 ++ .../v1beta1/saas_rollouts_test.rb | 750 ++ .../test/helper.rb | 26 + .../google-cloud-scheduler-v1/.gitignore | 22 + .../.repo-metadata.json | 18 + .../google-cloud-scheduler-v1/.rubocop.yml | 33 + .../google-cloud-scheduler-v1/.toys.rb | 28 + .../google-cloud-scheduler-v1/.yardopts | 12 + .../AUTHENTICATION.md | 122 + .../google-cloud-scheduler-v1/CHANGELOG.md | 2 + .../google-cloud-scheduler-v1/Gemfile | 14 + .../google-cloud-scheduler-v1/LICENSE.md | 201 + .../google-cloud-scheduler-v1/README.md | 154 + .../google-cloud-scheduler-v1/Rakefile | 169 + .../gapic_metadata.json | 58 + .../google-cloud-scheduler-v1.gemspec | 29 + .../lib/google-cloud-scheduler-v1.rb | 21 + .../lib/google/cloud/scheduler/v1.rb | 45 + .../cloud/scheduler/v1/bindings_override.rb | 75 + .../cloud/scheduler/v1/cloud_scheduler.rb | 56 + .../scheduler/v1/cloud_scheduler/client.rb | 1229 +++ .../v1/cloud_scheduler/credentials.rb | 51 + .../scheduler/v1/cloud_scheduler/paths.rb | 86 + .../scheduler/v1/cloud_scheduler/rest.rb | 54 + .../v1/cloud_scheduler/rest/client.rb | 1138 +++ .../v1/cloud_scheduler/rest/service_stub.rb | 574 ++ .../cloud/scheduler/v1/cloudscheduler_pb.rb | 37 + .../v1/cloudscheduler_services_pb.rb | 89 + .../lib/google/cloud/scheduler/v1/job_pb.rb | 30 + .../lib/google/cloud/scheduler/v1/rest.rb | 38 + .../google/cloud/scheduler/v1/target_pb.rb | 29 + .../lib/google/cloud/scheduler/v1/version.rb | 28 + .../proto_docs/README.md | 4 + .../proto_docs/google/api/client.rb | 589 ++ .../proto_docs/google/api/field_behavior.rb | 85 + .../proto_docs/google/api/launch_stage.rb | 71 + .../proto_docs/google/api/resource.rb | 227 + .../cloud/scheduler/v1/cloudscheduler.rb | 164 + .../google/cloud/scheduler/v1/job.rb | 264 + .../google/cloud/scheduler/v1/target.rb | 420 + .../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 + .../snippets/Gemfile | 32 + .../snippets/cloud_scheduler/create_job.rb | 47 + .../snippets/cloud_scheduler/delete_job.rb | 47 + .../snippets/cloud_scheduler/get_job.rb | 47 + .../snippets/cloud_scheduler/list_jobs.rb | 51 + .../snippets/cloud_scheduler/pause_job.rb | 47 + .../snippets/cloud_scheduler/resume_job.rb | 47 + .../snippets/cloud_scheduler/run_job.rb | 47 + .../snippets/cloud_scheduler/update_job.rb | 47 + ...et_metadata_google.cloud.scheduler.v1.json | 335 + .../v1/cloud_scheduler_paths_test.rb | 79 + .../scheduler/v1/cloud_scheduler_rest_test.rb | 535 ++ .../scheduler/v1/cloud_scheduler_test.rb | 581 ++ .../google-cloud-scheduler-v1/test/helper.rb | 26 + .../google-cloud-scheduler-v1beta1/.gitignore | 22 + .../.repo-metadata.json | 18 + .../.rubocop.yml | 33 + .../google-cloud-scheduler-v1beta1/.toys.rb | 28 + .../google-cloud-scheduler-v1beta1/.yardopts | 12 + .../AUTHENTICATION.md | 122 + .../CHANGELOG.md | 2 + .../google-cloud-scheduler-v1beta1/Gemfile | 14 + .../google-cloud-scheduler-v1beta1/LICENSE.md | 201 + .../google-cloud-scheduler-v1beta1/README.md | 154 + .../google-cloud-scheduler-v1beta1/Rakefile | 169 + .../gapic_metadata.json | 58 + .../google-cloud-scheduler-v1beta1.gemspec | 29 + .../lib/google-cloud-scheduler-v1beta1.rb | 21 + .../lib/google/cloud/scheduler/v1beta1.rb | 45 + .../scheduler/v1beta1/bindings_override.rb | 75 + .../scheduler/v1beta1/cloud_scheduler.rb | 56 + .../v1beta1/cloud_scheduler/client.rb | 1263 +++ .../v1beta1/cloud_scheduler/credentials.rb | 51 + .../v1beta1/cloud_scheduler/paths.rb | 86 + .../scheduler/v1beta1/cloud_scheduler/rest.rb | 54 + .../v1beta1/cloud_scheduler/rest/client.rb | 1172 +++ .../cloud_scheduler/rest/service_stub.rb | 574 ++ .../scheduler/v1beta1/cloudscheduler_pb.rb | 37 + .../v1beta1/cloudscheduler_services_pb.rb | 92 + .../google/cloud/scheduler/v1beta1/job_pb.rb | 30 + .../google/cloud/scheduler/v1beta1/rest.rb | 38 + .../cloud/scheduler/v1beta1/target_pb.rb | 29 + .../google/cloud/scheduler/v1beta1/version.rb | 28 + .../proto_docs/README.md | 4 + .../proto_docs/google/api/client.rb | 589 ++ .../proto_docs/google/api/field_behavior.rb | 85 + .../proto_docs/google/api/launch_stage.rb | 71 + .../proto_docs/google/api/resource.rb | 227 + .../cloud/scheduler/v1beta1/cloudscheduler.rb | 193 + .../google/cloud/scheduler/v1beta1/job.rb | 267 + .../google/cloud/scheduler/v1beta1/target.rb | 409 + .../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 + .../snippets/Gemfile | 32 + .../snippets/cloud_scheduler/create_job.rb | 47 + .../snippets/cloud_scheduler/delete_job.rb | 47 + .../snippets/cloud_scheduler/get_job.rb | 47 + .../snippets/cloud_scheduler/list_jobs.rb | 51 + .../snippets/cloud_scheduler/pause_job.rb | 47 + .../snippets/cloud_scheduler/resume_job.rb | 47 + .../snippets/cloud_scheduler/run_job.rb | 47 + .../snippets/cloud_scheduler/update_job.rb | 47 + ...tadata_google.cloud.scheduler.v1beta1.json | 335 + .../v1beta1/cloud_scheduler_paths_test.rb | 79 + .../v1beta1/cloud_scheduler_rest_test.rb | 539 ++ .../scheduler/v1beta1/cloud_scheduler_test.rb | 589 ++ .../test/helper.rb | 26 + .../google-cloud-secret_manager-v1/.gitignore | 22 + .../.repo-metadata.json | 18 + .../.rubocop.yml | 33 + .../google-cloud-secret_manager-v1/.toys.rb | 28 + .../google-cloud-secret_manager-v1/.yardopts | 12 + .../AUTHENTICATION.md | 122 + .../CHANGELOG.md | 2 + .../google-cloud-secret_manager-v1/Gemfile | 14 + .../google-cloud-secret_manager-v1/LICENSE.md | 201 + .../google-cloud-secret_manager-v1/README.md | 154 + .../google-cloud-secret_manager-v1/Rakefile | 169 + .../gapic_metadata.json | 93 + .../google-cloud-secret_manager-v1.gemspec | 30 + .../lib/google-cloud-secret_manager-v1.rb | 21 + .../lib/google/cloud/secret_manager/v1.rb | 45 + .../secret_manager/v1/bindings_override.rb | 75 + .../google/cloud/secret_manager/v1/rest.rb | 38 + .../v1/secret_manager_service.rb | 61 + .../v1/secret_manager_service/client.rb | 1989 +++++ .../v1/secret_manager_service/credentials.rb | 51 + .../v1/secret_manager_service/paths.rb | 167 + .../v1/secret_manager_service/rest.rb | 59 + .../v1/secret_manager_service/rest/client.rb | 1849 ++++ .../rest/service_stub.rb | 1117 +++ .../google/cloud/secret_manager/v1/version.rb | 28 + .../cloud/secretmanager/v1/resources_pb.rb | 41 + .../cloud/secretmanager/v1/service_pb.rb | 45 + .../secretmanager/v1/service_services_pb.rb | 118 + .../proto_docs/README.md | 4 + .../proto_docs/google/api/client.rb | 589 ++ .../proto_docs/google/api/field_behavior.rb | 85 + .../proto_docs/google/api/launch_stage.rb | 71 + .../proto_docs/google/api/resource.rb | 227 + .../cloud/secretmanager/v1/resources.rb | 526 ++ .../google/cloud/secretmanager/v1/service.rb | 320 + .../proto_docs/google/iam/v1/iam_policy.rb | 87 + .../proto_docs/google/iam/v1/options.rb | 50 + .../proto_docs/google/iam/v1/policy.rb | 426 + .../proto_docs/google/protobuf/duration.rb | 98 + .../proto_docs/google/protobuf/empty.rb | 34 + .../proto_docs/google/protobuf/field_mask.rb | 229 + .../proto_docs/google/protobuf/timestamp.rb | 127 + .../proto_docs/google/type/expr.rb | 75 + .../snippets/Gemfile | 32 + .../access_secret_version.rb | 47 + .../add_secret_version.rb | 47 + .../secret_manager_service/create_secret.rb | 47 + .../secret_manager_service/delete_secret.rb | 47 + .../destroy_secret_version.rb | 47 + .../disable_secret_version.rb | 47 + .../enable_secret_version.rb | 47 + .../secret_manager_service/get_iam_policy.rb | 47 + .../secret_manager_service/get_secret.rb | 47 + .../get_secret_version.rb | 47 + .../list_secret_versions.rb | 51 + .../secret_manager_service/list_secrets.rb | 51 + .../secret_manager_service/set_iam_policy.rb | 47 + .../test_iam_permissions.rb | 47 + .../secret_manager_service/update_secret.rb | 47 + ...etadata_google.cloud.secretmanager.v1.json | 615 ++ .../v1/secret_manager_service_paths_test.rb | 109 + .../v1/secret_manager_service_rest_test.rb | 927 ++ .../v1/secret_manager_service_test.rb | 1020 +++ .../test/helper.rb | 26 + .../.gitignore | 22 + .../.repo-metadata.json | 18 + .../.rubocop.yml | 33 + .../.toys.rb | 28 + .../.yardopts | 12 + .../AUTHENTICATION.md | 122 + .../CHANGELOG.md | 2 + .../Gemfile | 14 + .../LICENSE.md | 201 + .../README.md | 154 + .../Rakefile | 169 + .../gapic_metadata.json | 93 + ...oogle-cloud-secret_manager-v1beta1.gemspec | 30 + .../google-cloud-secret_manager-v1beta1.rb | 21 + .../google/cloud/secret_manager/v1beta1.rb | 45 + .../v1beta1/bindings_override.rb | 75 + .../cloud/secret_manager/v1beta1/rest.rb | 38 + .../v1beta1/secret_manager_service.rb | 61 + .../v1beta1/secret_manager_service/client.rb | 1942 +++++ .../secret_manager_service/credentials.rb | 51 + .../v1beta1/secret_manager_service/paths.rb | 83 + .../v1beta1/secret_manager_service/rest.rb | 59 + .../secret_manager_service/rest/client.rb | 1802 ++++ .../rest/service_stub.rb | 1004 +++ .../cloud/secret_manager/v1beta1/version.rb | 28 + .../cloud/secrets/v1beta1/resources_pb.rb | 32 + .../cloud/secrets/v1beta1/service_pb.rb | 45 + .../secrets/v1beta1/service_services_pb.rb | 117 + .../proto_docs/README.md | 4 + .../proto_docs/google/api/client.rb | 589 ++ .../proto_docs/google/api/field_behavior.rb | 85 + .../proto_docs/google/api/launch_stage.rb | 71 + .../proto_docs/google/api/resource.rb | 227 + .../google/cloud/secrets/v1beta1/resources.rb | 189 + .../google/cloud/secrets/v1beta1/service.rb | 261 + .../proto_docs/google/iam/v1/iam_policy.rb | 87 + .../proto_docs/google/iam/v1/options.rb | 50 + .../proto_docs/google/iam/v1/policy.rb | 426 + .../proto_docs/google/protobuf/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/type/expr.rb | 75 + .../snippets/Gemfile | 32 + .../access_secret_version.rb | 47 + .../add_secret_version.rb | 47 + .../secret_manager_service/create_secret.rb | 47 + .../secret_manager_service/delete_secret.rb | 47 + .../destroy_secret_version.rb | 47 + .../disable_secret_version.rb | 47 + .../enable_secret_version.rb | 47 + .../secret_manager_service/get_iam_policy.rb | 47 + .../secret_manager_service/get_secret.rb | 47 + .../get_secret_version.rb | 47 + .../list_secret_versions.rb | 51 + .../secret_manager_service/list_secrets.rb | 51 + .../secret_manager_service/set_iam_policy.rb | 47 + .../test_iam_permissions.rb | 47 + .../secret_manager_service/update_secret.rb | 47 + ...metadata_google.cloud.secrets.v1beta1.json | 615 ++ .../secret_manager_service_paths_test.rb | 79 + .../secret_manager_service_rest_test.rb | 921 ++ .../v1beta1/secret_manager_service_test.rb | 1008 +++ .../test/helper.rb | 26 + .../.gitignore | 22 + .../.repo-metadata.json | 18 + .../.rubocop.yml | 33 + .../.toys.rb | 28 + .../.yardopts | 12 + .../AUTHENTICATION.md | 122 + .../CHANGELOG.md | 2 + .../Gemfile | 14 + .../LICENSE.md | 201 + .../README.md | 154 + .../Rakefile | 169 + .../gapic_metadata.json | 93 + ...oogle-cloud-secret_manager-v1beta2.gemspec | 30 + .../google-cloud-secret_manager-v1beta2.rb | 21 + .../google/cloud/secret_manager/v1beta2.rb | 45 + .../v1beta2/bindings_override.rb | 75 + .../cloud/secret_manager/v1beta2/rest.rb | 38 + .../v1beta2/secret_manager_service.rb | 61 + .../v1beta2/secret_manager_service/client.rb | 1996 +++++ .../secret_manager_service/credentials.rb | 51 + .../v1beta2/secret_manager_service/paths.rb | 167 + .../v1beta2/secret_manager_service/rest.rb | 59 + .../secret_manager_service/rest/client.rb | 1856 ++++ .../rest/service_stub.rb | 1117 +++ .../cloud/secret_manager/v1beta2/version.rb | 28 + .../secretmanager/v1beta2/resources_pb.rb | 41 + .../cloud/secretmanager/v1beta2/service_pb.rb | 45 + .../v1beta2/service_services_pb.rb | 125 + .../proto_docs/README.md | 4 + .../proto_docs/google/api/client.rb | 589 ++ .../proto_docs/google/api/field_behavior.rb | 85 + .../proto_docs/google/api/launch_stage.rb | 71 + .../proto_docs/google/api/resource.rb | 227 + .../cloud/secretmanager/v1beta2/resources.rb | 512 ++ .../cloud/secretmanager/v1beta2/service.rb | 321 + .../proto_docs/google/iam/v1/iam_policy.rb | 87 + .../proto_docs/google/iam/v1/options.rb | 50 + .../proto_docs/google/iam/v1/policy.rb | 426 + .../proto_docs/google/protobuf/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/type/expr.rb | 75 + .../snippets/Gemfile | 32 + .../access_secret_version.rb | 47 + .../add_secret_version.rb | 47 + .../secret_manager_service/create_secret.rb | 47 + .../secret_manager_service/delete_secret.rb | 47 + .../destroy_secret_version.rb | 47 + .../disable_secret_version.rb | 47 + .../enable_secret_version.rb | 47 + .../secret_manager_service/get_iam_policy.rb | 47 + .../secret_manager_service/get_secret.rb | 47 + .../get_secret_version.rb | 47 + .../list_secret_versions.rb | 51 + .../secret_manager_service/list_secrets.rb | 51 + .../secret_manager_service/set_iam_policy.rb | 47 + .../test_iam_permissions.rb | 47 + .../secret_manager_service/update_secret.rb | 47 + ...ta_google.cloud.secretmanager.v1beta2.json | 615 ++ .../secret_manager_service_paths_test.rb | 109 + .../secret_manager_service_rest_test.rb | 927 ++ .../v1beta2/secret_manager_service_test.rb | 1020 +++ .../test/helper.rb | 26 + .../.gitignore | 22 + .../.repo-metadata.json | 17 + .../.rubocop.yml | 33 + .../.toys.rb | 28 + .../.yardopts | 12 + .../AUTHENTICATION.md | 122 + .../CHANGELOG.md | 2 + .../Gemfile | 14 + .../LICENSE.md | 201 + .../README.md | 154 + .../Rakefile | 169 + .../gapic_metadata.json | 278 + ...gle-cloud-secure_source_manager-v1.gemspec | 30 + .../google-cloud-secure_source_manager-v1.rb | 21 + .../google/cloud/secure_source_manager/v1.rb | 45 + .../v1/bindings_override.rb | 108 + .../cloud/secure_source_manager/v1/rest.rb | 38 + .../v1/secure_source_manager.rb | 58 + .../v1/secure_source_manager/client.rb | 5877 +++++++++++++ .../v1/secure_source_manager/credentials.rb | 47 + .../v1/secure_source_manager/operations.rb | 841 ++ .../v1/secure_source_manager/paths.rb | 277 + .../v1/secure_source_manager/rest.rb | 56 + .../v1/secure_source_manager/rest/client.rb | 5479 ++++++++++++ .../secure_source_manager/rest/operations.rb | 925 ++ .../rest/service_stub.rb | 3278 ++++++++ .../cloud/secure_source_manager/v1/version.rb | 28 + .../v1/secure_source_manager_pb.rb | 125 + .../v1/secure_source_manager_services_pb.rb | 170 + .../proto_docs/README.md | 4 + .../proto_docs/google/api/client.rb | 589 ++ .../proto_docs/google/api/field_behavior.rb | 85 + .../proto_docs/google/api/launch_stage.rb | 71 + .../proto_docs/google/api/resource.rb | 227 + .../v1/secure_source_manager.rb | 1792 ++++ .../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 + .../snippets/Gemfile | 32 + .../batch_create_pull_request_comments.rb | 54 + .../secure_source_manager/close_issue.rb | 54 + .../close_pull_request.rb | 54 + .../create_branch_rule.rb | 54 + .../secure_source_manager/create_hook.rb | 54 + .../secure_source_manager/create_instance.rb | 54 + .../secure_source_manager/create_issue.rb | 54 + .../create_issue_comment.rb | 54 + .../create_pull_request.rb | 54 + .../create_pull_request_comment.rb | 54 + .../create_repository.rb | 54 + .../delete_branch_rule.rb | 54 + .../secure_source_manager/delete_hook.rb | 54 + .../secure_source_manager/delete_instance.rb | 54 + .../secure_source_manager/delete_issue.rb | 54 + .../delete_issue_comment.rb | 54 + .../delete_pull_request_comment.rb | 54 + .../delete_repository.rb | 54 + .../secure_source_manager/fetch_blob.rb | 47 + .../secure_source_manager/fetch_tree.rb | 51 + .../secure_source_manager/get_branch_rule.rb | 47 + .../secure_source_manager/get_hook.rb | 47 + .../get_iam_policy_repo.rb | 47 + .../secure_source_manager/get_instance.rb | 47 + .../secure_source_manager/get_issue.rb | 47 + .../get_issue_comment.rb | 47 + .../secure_source_manager/get_pull_request.rb | 47 + .../get_pull_request_comment.rb | 47 + .../secure_source_manager/get_repository.rb | 47 + .../list_branch_rules.rb | 51 + .../secure_source_manager/list_hooks.rb | 51 + .../secure_source_manager/list_instances.rb | 51 + .../list_issue_comments.rb | 51 + .../secure_source_manager/list_issues.rb | 51 + .../list_pull_request_comments.rb | 51 + .../list_pull_request_file_diffs.rb | 51 + .../list_pull_requests.rb | 51 + .../list_repositories.rb | 51 + .../merge_pull_request.rb | 54 + .../secure_source_manager/open_issue.rb | 54 + .../open_pull_request.rb | 54 + .../resolve_pull_request_comments.rb | 54 + .../set_iam_policy_repo.rb | 47 + .../test_iam_permissions_repo.rb | 47 + .../unresolve_pull_request_comments.rb | 54 + .../update_branch_rule.rb | 54 + .../secure_source_manager/update_hook.rb | 54 + .../secure_source_manager/update_issue.rb | 54 + .../update_issue_comment.rb | 54 + .../update_pull_request.rb | 54 + .../update_pull_request_comment.rb | 54 + .../update_repository.rb | 54 + ...a_google.cloud.securesourcemanager.v1.json | 2095 +++++ .../secure_source_manager_operations_test.rb | 400 + .../v1/secure_source_manager_paths_test.rb | 187 + .../v1/secure_source_manager_rest_test.rb | 2972 +++++++ .../v1/secure_source_manager_test.rb | 3464 ++++++++ .../test/helper.rb | 26 + .../.gitignore | 22 + .../.repo-metadata.json | 18 + .../.rubocop.yml | 33 + .../.toys.rb | 28 + .../.yardopts | 12 + .../AUTHENTICATION.md | 122 + .../CHANGELOG.md | 2 + .../Gemfile | 14 + .../LICENSE.md | 201 + .../README.md | 154 + .../Rakefile | 169 + .../gapic_metadata.json | 163 + ...oogle-cloud-security-private_ca-v1.gemspec | 30 + .../google-cloud-security-private_ca-v1.rb | 21 + .../google/cloud/security/private_ca/v1.rb | 47 + .../private_ca/v1/bindings_override.rb | 158 + .../v1/certificate_authority_service.rb | 60 + .../certificate_authority_service/client.rb | 3804 +++++++++ .../credentials.rb | 53 + .../operations.rb | 843 ++ .../v1/certificate_authority_service/paths.rb | 155 + .../v1/certificate_authority_service/rest.rb | 58 + .../rest/client.rb | 3567 ++++++++ .../rest/operations.rb | 927 ++ .../rest/service_stub.rb | 1867 +++++ .../cloud/security/private_ca/v1/rest.rb | 40 + .../cloud/security/private_ca/v1/version.rb | 30 + .../security/privateca/v1/resources_pb.rb | 80 + .../cloud/security/privateca/v1/service_pb.rb | 71 + .../privateca/v1/service_services_pb.rb | 150 + .../proto_docs/README.md | 4 + .../proto_docs/google/api/client.rb | 589 ++ .../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 + .../cloud/security/privateca/v1/resources.rb | 1676 ++++ .../cloud/security/privateca/v1/service.rb | 1032 +++ .../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 + .../snippets/Gemfile | 32 + .../activate_certificate_authority.rb | 54 + .../create_ca_pool.rb | 54 + .../create_certificate.rb | 47 + .../create_certificate_authority.rb | 54 + .../create_certificate_template.rb | 54 + .../delete_ca_pool.rb | 54 + .../delete_certificate_authority.rb | 54 + .../delete_certificate_template.rb | 54 + .../disable_certificate_authority.rb | 54 + .../enable_certificate_authority.rb | 54 + .../fetch_ca_certs.rb | 47 + .../fetch_certificate_authority_csr.rb | 47 + .../get_ca_pool.rb | 47 + .../get_certificate.rb | 47 + .../get_certificate_authority.rb | 47 + .../get_certificate_revocation_list.rb | 47 + .../get_certificate_template.rb | 47 + .../list_ca_pools.rb | 51 + .../list_certificate_authorities.rb | 51 + .../list_certificate_revocation_lists.rb | 51 + .../list_certificate_templates.rb | 51 + .../list_certificates.rb | 51 + .../revoke_certificate.rb | 47 + .../undelete_certificate_authority.rb | 54 + .../update_ca_pool.rb | 54 + .../update_certificate.rb | 47 + .../update_certificate_authority.rb | 54 + .../update_certificate_revocation_list.rb | 54 + .../update_certificate_template.rb | 54 + ...ta_google.cloud.security.privateca.v1.json | 1175 +++ ...icate_authority_service_operations_test.rb | 400 + ...ertificate_authority_service_paths_test.rb | 115 + ...certificate_authority_service_rest_test.rb | 1726 ++++ .../v1/certificate_authority_service_test.rb | 2017 +++++ .../test/helper.rb | 26 + .../.gitignore | 22 + .../.repo-metadata.json | 18 + .../.rubocop.yml | 33 + .../.toys.rb | 28 + .../.yardopts | 12 + .../AUTHENTICATION.md | 122 + .../CHANGELOG.md | 2 + .../Gemfile | 14 + .../LICENSE.md | 201 + .../README.md | 154 + .../Rakefile | 169 + .../gapic_metadata.json | 118 + ...-cloud-security-private_ca-v1beta1.gemspec | 28 + ...oogle-cloud-security-private_ca-v1beta1.rb | 21 + .../cloud/security/private_ca/v1beta1.rb | 47 + .../v1beta1/certificate_authority_service.rb | 59 + .../certificate_authority_service/client.rb | 2614 ++++++ .../credentials.rb | 53 + .../operations.rb | 843 ++ .../certificate_authority_service/paths.rb | 132 + .../certificate_authority_service/rest.rb | 56 + .../rest/client.rb | 2431 ++++++ .../rest/operations.rb | 927 ++ .../rest/service_stub.rb | 1314 +++ .../cloud/security/private_ca/v1beta1/rest.rb | 39 + .../security/private_ca/v1beta1/version.rb | 30 + .../privateca/v1beta1/resources_pb.rb | 67 + .../security/privateca/v1beta1/service_pb.rb | 57 + .../privateca/v1beta1/service_services_pb.rb | 99 + .../proto_docs/README.md | 4 + .../proto_docs/google/api/client.rb | 589 ++ .../proto_docs/google/api/field_behavior.rb | 85 + .../proto_docs/google/api/launch_stage.rb | 71 + .../proto_docs/google/api/resource.rb | 227 + .../security/privateca/v1beta1/resources.rb | 1001 +++ .../security/privateca/v1beta1/service.rb | 633 ++ .../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/protobuf/wrappers.rb | 148 + .../proto_docs/google/rpc/status.rb | 48 + .../snippets/Gemfile | 32 + .../activate_certificate_authority.rb | 54 + .../create_certificate.rb | 47 + .../create_certificate_authority.rb | 54 + .../disable_certificate_authority.rb | 54 + .../enable_certificate_authority.rb | 54 + .../fetch_certificate_authority_csr.rb | 47 + .../get_certificate.rb | 47 + .../get_certificate_authority.rb | 47 + .../get_certificate_revocation_list.rb | 47 + .../get_reusable_config.rb | 47 + .../list_certificate_authorities.rb | 51 + .../list_certificate_revocation_lists.rb | 51 + .../list_certificates.rb | 51 + .../list_reusable_configs.rb | 51 + .../restore_certificate_authority.rb | 54 + .../revoke_certificate.rb | 47 + .../schedule_delete_certificate_authority.rb | 54 + .../update_certificate.rb | 47 + .../update_certificate_authority.rb | 54 + .../update_certificate_revocation_list.rb | 54 + ...ogle.cloud.security.privateca.v1beta1.json | 815 ++ ...icate_authority_service_operations_test.rb | 400 + ...ertificate_authority_service_paths_test.rb | 103 + ...certificate_authority_service_rest_test.rb | 1216 +++ .../certificate_authority_service_test.rb | 1412 ++++ .../test/helper.rb | 26 + .../.gitignore | 22 + .../.repo-metadata.json | 17 + .../.rubocop.yml | 33 + .../.toys.rb | 28 + .../.yardopts | 12 + .../AUTHENTICATION.md | 122 + .../CHANGELOG.md | 2 + .../Gemfile | 14 + .../LICENSE.md | 201 + .../README.md | 154 + .../Rakefile | 169 + .../gapic_metadata.json | 23 + ...google-cloud-security-public_ca-v1.gemspec | 28 + .../lib/google-cloud-security-public_ca-v1.rb | 21 + .../lib/google/cloud/security/public_ca/v1.rb | 47 + .../public_certificate_authority_service.rb | 59 + .../client.rb | 492 ++ .../credentials.rb | 49 + .../paths.rb | 71 + .../rest.rb | 56 + .../rest/client.rb | 442 + .../rest/service_stub.rb | 145 + .../cloud/security/public_ca/v1/rest.rb | 39 + .../cloud/security/public_ca/v1/version.rb | 30 + .../security/publicca/v1/resources_pb.rb | 26 + .../cloud/security/publicca/v1/service_pb.rb | 29 + .../publicca/v1/service_services_pb.rb | 51 + .../proto_docs/README.md | 4 + .../proto_docs/google/api/client.rb | 589 ++ .../proto_docs/google/api/field_behavior.rb | 85 + .../proto_docs/google/api/launch_stage.rb | 71 + .../proto_docs/google/api/resource.rb | 227 + .../cloud/security/publicca/v1/resources.rb | 49 + .../cloud/security/publicca/v1/service.rb | 47 + .../proto_docs/google/protobuf/duration.rb | 98 + .../snippets/Gemfile | 32 + .../create_external_account_key.rb | 47 + ...ata_google.cloud.security.publicca.v1.json | 55 + ...ertificate_authority_service_paths_test.rb | 67 + ...certificate_authority_service_rest_test.rb | 154 + ...blic_certificate_authority_service_test.rb | 164 + .../test/helper.rb | 26 + .../.gitignore | 22 + .../.repo-metadata.json | 17 + .../.rubocop.yml | 33 + .../.toys.rb | 28 + .../.yardopts | 12 + .../AUTHENTICATION.md | 122 + .../CHANGELOG.md | 2 + .../Gemfile | 14 + .../LICENSE.md | 201 + .../README.md | 154 + .../Rakefile | 169 + .../gapic_metadata.json | 23 + ...e-cloud-security-public_ca-v1beta1.gemspec | 28 + ...google-cloud-security-public_ca-v1beta1.rb | 21 + .../cloud/security/public_ca/v1beta1.rb | 47 + .../public_certificate_authority_service.rb | 59 + .../client.rb | 492 ++ .../credentials.rb | 49 + .../paths.rb | 71 + .../rest.rb | 56 + .../rest/client.rb | 442 + .../rest/service_stub.rb | 145 + .../cloud/security/public_ca/v1beta1/rest.rb | 39 + .../security/public_ca/v1beta1/version.rb | 30 + .../security/publicca/v1beta1/resources_pb.rb | 26 + .../security/publicca/v1beta1/service_pb.rb | 29 + .../publicca/v1beta1/service_services_pb.rb | 51 + .../proto_docs/README.md | 4 + .../proto_docs/google/api/client.rb | 589 ++ .../proto_docs/google/api/field_behavior.rb | 85 + .../proto_docs/google/api/launch_stage.rb | 71 + .../proto_docs/google/api/resource.rb | 227 + .../security/publicca/v1beta1/resources.rb | 49 + .../security/publicca/v1beta1/service.rb | 47 + .../proto_docs/google/protobuf/duration.rb | 98 + .../snippets/Gemfile | 32 + .../create_external_account_key.rb | 47 + ...oogle.cloud.security.publicca.v1beta1.json | 55 + ...ertificate_authority_service_paths_test.rb | 67 + ...certificate_authority_service_rest_test.rb | 154 + ...blic_certificate_authority_service_test.rb | 164 + .../test/helper.rb | 26 + .../.gitignore | 22 + .../.repo-metadata.json | 18 + .../.rubocop.yml | 33 + .../google-cloud-security_center-v1/.toys.rb | 28 + .../google-cloud-security_center-v1/.yardopts | 12 + .../AUTHENTICATION.md | 122 + .../CHANGELOG.md | 2 + .../google-cloud-security_center-v1/Gemfile | 14 + .../LICENSE.md | 201 + .../google-cloud-security_center-v1/README.md | 153 + .../google-cloud-security_center-v1/Rakefile | 169 + .../gapic_metadata.json | 333 + .../google-cloud-security_center-v1.gemspec | 29 + .../lib/google-cloud-security_center-v1.rb | 21 + .../lib/google/cloud/security_center/v1.rb | 45 + .../google/cloud/security_center/v1/rest.rb | 37 + .../security_center/v1/security_center.rb | 56 + .../v1/security_center/client.rb | 7458 +++++++++++++++++ .../v1/security_center/credentials.rb | 51 + .../v1/security_center/operations.rb | 841 ++ .../v1/security_center/paths.rb | 1127 +++ .../v1/security_center/rest.rb | 53 + .../v1/security_center/rest/client.rb | 6968 +++++++++++++++ .../v1/security_center/rest/operations.rb | 924 ++ .../v1/security_center/rest/service_stub.rb | 4766 +++++++++++ .../cloud/security_center/v1/version.rb | 28 + .../cloud/securitycenter/v1/access_pb.rb | 23 + .../cloud/securitycenter/v1/application_pb.rb | 21 + .../cloud/securitycenter/v1/asset_pb.rb | 29 + .../securitycenter/v1/attack_exposure_pb.rb | 24 + .../cloud/securitycenter/v1/attack_path_pb.rb | 28 + .../v1/backup_disaster_recovery_pb.rb | 23 + .../securitycenter/v1/bigquery_export_pb.rb | 25 + .../cloud/securitycenter/v1/chokepoint_pb.rb | 21 + .../cloud/securitycenter/v1/cloud_armor_pb.rb | 27 + .../v1/cloud_dlp_data_profile_pb.rb | 27 + .../v1/cloud_dlp_inspection_pb.rb | 23 + .../cloud/securitycenter/v1/compliance_pb.rb | 21 + .../cloud/securitycenter/v1/connection_pb.rb | 22 + .../securitycenter/v1/contact_details_pb.rb | 22 + .../cloud/securitycenter/v1/container_pb.rb | 24 + .../cloud/securitycenter/v1/database_pb.rb | 21 + ...event_threat_detection_custom_module_pb.rb | 26 + ...urity_health_analytics_custom_module_pb.rb | 26 + ...event_threat_detection_custom_module_pb.rb | 27 + ...tion_custom_module_validation_errors_pb.rb | 23 + .../securitycenter/v1/exfiltration_pb.rb | 22 + .../securitycenter/v1/external_exposure_pb.rb | 23 + .../securitycenter/v1/external_system_pb.rb | 25 + .../google/cloud/securitycenter/v1/file_pb.rb | 22 + .../cloud/securitycenter/v1/finding_pb.rb | 65 + .../cloud/securitycenter/v1/folder_pb.rb | 21 + .../securitycenter/v1/group_membership_pb.rb | 22 + .../cloud/securitycenter/v1/iam_binding_pb.rb | 22 + .../cloud/securitycenter/v1/indicator_pb.rb | 26 + .../securitycenter/v1/kernel_rootkit_pb.rb | 21 + .../cloud/securitycenter/v1/kubernetes_pb.rb | 34 + .../cloud/securitycenter/v1/label_pb.rb | 21 + .../securitycenter/v1/load_balancer_pb.rb | 21 + .../cloud/securitycenter/v1/log_entry_pb.rb | 24 + .../securitycenter/v1/mitre_attack_pb.rb | 23 + .../cloud/securitycenter/v1/mute_config_pb.rb | 26 + .../cloud/securitycenter/v1/notebook_pb.rb | 23 + .../v1/notification_config_pb.rb | 25 + .../v1/notification_message_pb.rb | 24 + .../cloud/securitycenter/v1/org_policy_pb.rb | 23 + .../v1/organization_settings_pb.rb | 25 + .../cloud/securitycenter/v1/process_pb.rb | 24 + .../cloud/securitycenter/v1/resource_pb.rb | 36 + .../v1/resource_value_config_pb.rb | 28 + .../v1/run_asset_discovery_response_pb.rb | 24 + ...urity_health_analytics_custom_config_pb.rb | 27 + ...urity_health_analytics_custom_module_pb.rb | 27 + .../securitycenter/v1/security_marks_pb.rb | 23 + .../securitycenter/v1/security_posture_pb.rb | 22 + .../v1/securitycenter_service_pb.rb | 147 + .../v1/securitycenter_service_services_pb.rb | 226 + .../cloud/securitycenter/v1/simulation_pb.rb | 27 + .../cloud/securitycenter/v1/source_pb.rb | 23 + .../securitycenter/v1/toxic_combination_pb.rb | 21 + .../securitycenter/v1/valued_resource_pb.rb | 25 + .../securitycenter/v1/vulnerability_pb.rb | 36 + .../proto_docs/README.md | 4 + .../proto_docs/google/api/client.rb | 589 ++ .../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/cloud/securitycenter/v1/access.rb | 120 + .../cloud/securitycenter/v1/application.rb | 40 + .../google/cloud/securitycenter/v1/asset.rb | 141 + .../securitycenter/v1/attack_exposure.rb | 73 + .../cloud/securitycenter/v1/attack_path.rb | 147 + .../v1/backup_disaster_recovery.rb | 90 + .../securitycenter/v1/bigquery_export.rb | 92 + .../cloud/securitycenter/v1/chokepoint.rb | 39 + .../cloud/securitycenter/v1/cloud_armor.rb | 128 + .../v1/cloud_dlp_data_profile.rb | 114 + .../securitycenter/v1/cloud_dlp_inspection.rb | 50 + .../cloud/securitycenter/v1/compliance.rb | 43 + .../cloud/securitycenter/v1/connection.rb | 70 + .../securitycenter/v1/contact_details.rb | 44 + .../cloud/securitycenter/v1/container.rb | 49 + .../cloud/securitycenter/v1/database.rb | 67 + ...ve_event_threat_detection_custom_module.rb | 77 + ...security_health_analytics_custom_module.rb | 73 + .../event_threat_detection_custom_module.rb | 88 + ...tection_custom_module_validation_errors.rb | 69 + .../cloud/securitycenter/v1/exfiltration.rb | 64 + .../securitycenter/v1/external_exposure.rb | 77 + .../securitycenter/v1/external_system.rb | 98 + .../google/cloud/securitycenter/v1/file.rb | 72 + .../google/cloud/securitycenter/v1/finding.rb | 477 ++ .../google/cloud/securitycenter/v1/folder.rb | 40 + .../securitycenter/v1/group_membership.rb | 51 + .../cloud/securitycenter/v1/iam_binding.rb | 56 + .../cloud/securitycenter/v1/indicator.rb | 116 + .../cloud/securitycenter/v1/kernel_rootkit.rb | 66 + .../cloud/securitycenter/v1/kubernetes.rb | 241 + .../google/cloud/securitycenter/v1/label.rb | 41 + .../cloud/securitycenter/v1/load_balancer.rb | 36 + .../cloud/securitycenter/v1/log_entry.rb | 58 + .../cloud/securitycenter/v1/mitre_attack.rb | 303 + .../cloud/securitycenter/v1/mute_config.rb | 116 + .../cloud/securitycenter/v1/notebook.rb | 46 + .../securitycenter/v1/notification_config.rb | 87 + .../securitycenter/v1/notification_message.rb | 42 + .../cloud/securitycenter/v1/org_policy.rb | 37 + .../v1/organization_settings.rb | 86 + .../google/cloud/securitycenter/v1/process.rb | 79 + .../cloud/securitycenter/v1/resource.rb | 286 + .../v1/resource_value_config.rb | 125 + .../v1/run_asset_discovery_response.rb | 54 + ...security_health_analytics_custom_config.rb | 112 + ...security_health_analytics_custom_module.rb | 90 + .../cloud/securitycenter/v1/security_marks.rb | 71 + .../securitycenter/v1/security_posture.rb | 83 + .../v1/securitycenter_service.rb | 2146 +++++ .../cloud/securitycenter/v1/simulation.rb | 46 + .../google/cloud/securitycenter/v1/source.rb | 65 + .../securitycenter/v1/toxic_combination.rb | 45 + .../securitycenter/v1/valued_resource.rb | 86 + .../cloud/securitycenter/v1/vulnerability.rb | 336 + .../proto_docs/google/iam/v1/iam_policy.rb | 87 + .../proto_docs/google/iam/v1/options.rb | 50 + .../proto_docs/google/iam/v1/policy.rb | 426 + .../google/longrunning/operations.rb | 191 + .../proto_docs/google/protobuf/any.rb | 145 + .../proto_docs/google/protobuf/duration.rb | 98 + .../proto_docs/google/protobuf/empty.rb | 34 + .../proto_docs/google/protobuf/field_mask.rb | 229 + .../proto_docs/google/protobuf/struct.rb | 108 + .../proto_docs/google/protobuf/timestamp.rb | 127 + .../proto_docs/google/rpc/status.rb | 48 + .../proto_docs/google/type/expr.rb | 75 + .../snippets/Gemfile | 32 + .../batch_create_resource_value_configs.rb | 47 + .../security_center/bulk_mute_findings.rb | 54 + .../create_big_query_export.rb | 47 + ...te_event_threat_detection_custom_module.rb | 47 + .../security_center/create_finding.rb | 47 + .../security_center/create_mute_config.rb | 47 + .../create_notification_config.rb | 47 + ...security_health_analytics_custom_module.rb | 47 + .../snippets/security_center/create_source.rb | 47 + .../delete_big_query_export.rb | 47 + ...te_event_threat_detection_custom_module.rb | 47 + .../security_center/delete_mute_config.rb | 47 + .../delete_notification_config.rb | 47 + .../delete_resource_value_config.rb | 47 + ...security_health_analytics_custom_module.rb | 47 + .../security_center/get_big_query_export.rb | 47 + ...ve_event_threat_detection_custom_module.rb | 47 + ...security_health_analytics_custom_module.rb | 47 + ...et_event_threat_detection_custom_module.rb | 47 + .../security_center/get_iam_policy.rb | 47 + .../security_center/get_mute_config.rb | 47 + .../get_notification_config.rb | 47 + .../get_organization_settings.rb | 47 + .../get_resource_value_config.rb | 47 + ...security_health_analytics_custom_module.rb | 47 + .../security_center/get_simulation.rb | 47 + .../snippets/security_center/get_source.rb | 47 + .../security_center/get_valued_resource.rb | 47 + .../snippets/security_center/group_assets.rb | 51 + .../security_center/group_findings.rb | 51 + .../snippets/security_center/list_assets.rb | 51 + .../security_center/list_attack_paths.rb | 51 + .../security_center/list_big_query_exports.rb | 51 + ...t_event_threat_detection_custom_modules.rb | 51 + ...ecurity_health_analytics_custom_modules.rb | 51 + ...e_event_threat_detection_custom_modules.rb | 51 + ...ecurity_health_analytics_custom_modules.rb | 51 + ...t_event_threat_detection_custom_modules.rb | 51 + .../snippets/security_center/list_findings.rb | 51 + .../security_center/list_mute_configs.rb | 51 + .../list_notification_configs.rb | 51 + .../list_resource_value_configs.rb | 51 + ...ecurity_health_analytics_custom_modules.rb | 51 + .../snippets/security_center/list_sources.rb | 51 + .../security_center/list_valued_resources.rb | 51 + .../security_center/run_asset_discovery.rb | 54 + .../security_center/set_finding_state.rb | 47 + .../security_center/set_iam_policy.rb | 47 + .../snippets/security_center/set_mute.rb | 47 + ...security_health_analytics_custom_module.rb | 47 + .../security_center/test_iam_permissions.rb | 47 + .../update_big_query_export.rb | 47 + ...te_event_threat_detection_custom_module.rb | 47 + .../security_center/update_external_system.rb | 47 + .../security_center/update_finding.rb | 47 + .../security_center/update_mute_config.rb | 47 + .../update_notification_config.rb | 47 + .../update_organization_settings.rb | 47 + .../update_resource_value_config.rb | 47 + ...security_health_analytics_custom_module.rb | 47 + .../security_center/update_security_marks.rb | 47 + .../snippets/security_center/update_source.rb | 47 + ...te_event_threat_detection_custom_module.rb | 47 + ...tadata_google.cloud.securitycenter.v1.json | 2535 ++++++ .../v1/security_center_operations_test.rb | 400 + .../v1/security_center_paths_test.rb | 487 ++ .../v1/security_center_rest_test.rb | 3594 ++++++++ .../v1/security_center_test.rb | 4053 +++++++++ .../test/helper.rb | 26 + .../.gitignore | 22 + .../.repo-metadata.json | 18 + .../.rubocop.yml | 33 + .../.toys.rb | 28 + .../.yardopts | 12 + .../AUTHENTICATION.md | 122 + .../CHANGELOG.md | 2 + .../Gemfile | 14 + .../LICENSE.md | 201 + .../README.md | 153 + .../Rakefile | 169 + .../gapic_metadata.json | 133 + ...le-cloud-security_center-v1p1beta1.gemspec | 29 + .../google-cloud-security_center-v1p1beta1.rb | 21 + .../google/cloud/security_center/v1p1beta1.rb | 45 + .../cloud/security_center/v1p1beta1/rest.rb | 37 + .../v1p1beta1/security_center.rb | 56 + .../v1p1beta1/security_center/client.rb | 3250 +++++++ .../v1p1beta1/security_center/credentials.rb | 51 + .../v1p1beta1/security_center/operations.rb | 841 ++ .../v1p1beta1/security_center/paths.rb | 330 + .../v1p1beta1/security_center/rest.rb | 53 + .../v1p1beta1/security_center/rest/client.rb | 3046 +++++++ .../security_center/rest/operations.rb | 925 ++ .../security_center/rest/service_stub.rb | 1645 ++++ .../security_center/v1p1beta1/version.rb | 28 + .../securitycenter/v1p1beta1/asset_pb.rb | 29 + .../securitycenter/v1p1beta1/finding_pb.rb | 29 + .../securitycenter/v1p1beta1/folder_pb.rb | 21 + .../v1p1beta1/notification_config_pb.rb | 26 + .../v1p1beta1/notification_message_pb.rb | 24 + .../v1p1beta1/organization_settings_pb.rb | 25 + .../securitycenter/v1p1beta1/resource_pb.rb | 24 + .../run_asset_discovery_response_pb.rb | 24 + .../v1p1beta1/security_marks_pb.rb | 23 + .../v1p1beta1/securitycenter_service_pb.rb | 74 + .../securitycenter_service_services_pb.rb | 107 + .../securitycenter/v1p1beta1/source_pb.rb | 23 + .../proto_docs/README.md | 4 + .../proto_docs/google/api/client.rb | 589 ++ .../proto_docs/google/api/field_behavior.rb | 85 + .../proto_docs/google/api/launch_stage.rb | 71 + .../proto_docs/google/api/resource.rb | 227 + .../cloud/securitycenter/v1p1beta1/asset.rb | 141 + .../cloud/securitycenter/v1p1beta1/finding.rb | 146 + .../cloud/securitycenter/v1p1beta1/folder.rb | 40 + .../v1p1beta1/notification_config.rb | 98 + .../v1p1beta1/notification_message.rb | 42 + .../v1p1beta1/organization_settings.rb | 86 + .../securitycenter/v1p1beta1/resource.rb | 53 + .../v1p1beta1/run_asset_discovery_response.rb | 54 + .../v1p1beta1/security_marks.rb | 71 + .../v1p1beta1/securitycenter_service.rb | 1053 +++ .../cloud/securitycenter/v1p1beta1/source.rb | 64 + .../proto_docs/google/iam/v1/iam_policy.rb | 87 + .../proto_docs/google/iam/v1/options.rb | 50 + .../proto_docs/google/iam/v1/policy.rb | 426 + .../google/longrunning/operations.rb | 191 + .../proto_docs/google/protobuf/any.rb | 145 + .../proto_docs/google/protobuf/duration.rb | 98 + .../proto_docs/google/protobuf/empty.rb | 34 + .../proto_docs/google/protobuf/field_mask.rb | 229 + .../proto_docs/google/protobuf/struct.rb | 108 + .../proto_docs/google/protobuf/timestamp.rb | 127 + .../proto_docs/google/rpc/status.rb | 48 + .../proto_docs/google/type/expr.rb | 75 + .../snippets/Gemfile | 32 + .../security_center/create_finding.rb | 47 + .../create_notification_config.rb | 47 + .../snippets/security_center/create_source.rb | 47 + .../delete_notification_config.rb | 47 + .../security_center/get_iam_policy.rb | 47 + .../get_notification_config.rb | 47 + .../get_organization_settings.rb | 47 + .../snippets/security_center/get_source.rb | 47 + .../snippets/security_center/group_assets.rb | 51 + .../security_center/group_findings.rb | 51 + .../snippets/security_center/list_assets.rb | 51 + .../snippets/security_center/list_findings.rb | 51 + .../list_notification_configs.rb | 51 + .../snippets/security_center/list_sources.rb | 51 + .../security_center/run_asset_discovery.rb | 54 + .../security_center/set_finding_state.rb | 47 + .../security_center/set_iam_policy.rb | 47 + .../security_center/test_iam_permissions.rb | 47 + .../security_center/update_finding.rb | 47 + .../update_notification_config.rb | 47 + .../update_organization_settings.rb | 47 + .../security_center/update_security_marks.rb | 47 + .../snippets/security_center/update_source.rb | 47 + ...google.cloud.securitycenter.v1p1beta1.json | 935 +++ .../security_center_operations_test.rb | 400 + .../v1p1beta1/security_center_paths_test.rb | 178 + .../v1p1beta1/security_center_rest_test.rb | 1388 +++ .../v1p1beta1/security_center_test.rb | 1581 ++++ .../test/helper.rb | 26 + .../.gitignore | 22 + .../.repo-metadata.json | 18 + .../.rubocop.yml | 33 + .../google-cloud-security_center-v2/.toys.rb | 28 + .../google-cloud-security_center-v2/.yardopts | 12 + .../AUTHENTICATION.md | 122 + .../CHANGELOG.md | 2 + .../google-cloud-security_center-v2/Gemfile | 14 + .../LICENSE.md | 201 + .../google-cloud-security_center-v2/README.md | 154 + .../google-cloud-security_center-v2/Rakefile | 169 + .../gapic_metadata.json | 218 + .../google-cloud-security_center-v2.gemspec | 29 + .../lib/google-cloud-security_center-v2.rb | 21 + .../lib/google/cloud/security_center/v2.rb | 45 + .../google/cloud/security_center/v2/rest.rb | 37 + .../security_center/v2/security_center.rb | 56 + .../v2/security_center/client.rb | 4791 +++++++++++ .../v2/security_center/credentials.rb | 51 + .../v2/security_center/operations.rb | 841 ++ .../v2/security_center/paths.rb | 1068 +++ .../v2/security_center/rest.rb | 53 + .../v2/security_center/rest/client.rb | 4393 ++++++++++ .../v2/security_center/rest/operations.rb | 924 ++ .../v2/security_center/rest/service_stub.rb | 3336 ++++++++ .../cloud/security_center/v2/version.rb | 28 + .../cloud/securitycenter/v2/access_pb.rb | 23 + .../v2/affected_resources_pb.rb | 21 + .../cloud/securitycenter/v2/ai_model_pb.rb | 22 + .../cloud/securitycenter/v2/application_pb.rb | 21 + .../securitycenter/v2/attack_exposure_pb.rb | 25 + .../cloud/securitycenter/v2/attack_path_pb.rb | 28 + .../v2/backup_disaster_recovery_pb.rb | 23 + .../securitycenter/v2/bigquery_export_pb.rb | 25 + .../cloud/securitycenter/v2/chokepoint_pb.rb | 21 + .../cloud/securitycenter/v2/cloud_armor_pb.rb | 27 + .../v2/cloud_dlp_data_profile_pb.rb | 24 + .../v2/cloud_dlp_inspection_pb.rb | 23 + .../cloud/securitycenter/v2/compliance_pb.rb | 21 + .../cloud/securitycenter/v2/connection_pb.rb | 22 + .../securitycenter/v2/contact_details_pb.rb | 22 + .../cloud/securitycenter/v2/container_pb.rb | 24 + .../securitycenter/v2/data_access_event_pb.rb | 24 + .../securitycenter/v2/data_flow_event_pb.rb | 24 + .../v2/data_retention_deletion_event_pb.rb | 25 + .../cloud/securitycenter/v2/database_pb.rb | 21 + .../google/cloud/securitycenter/v2/disk_pb.rb | 21 + .../securitycenter/v2/exfiltration_pb.rb | 22 + .../securitycenter/v2/external_system_pb.rb | 25 + .../google/cloud/securitycenter/v2/file_pb.rb | 24 + .../cloud/securitycenter/v2/finding_pb.rb | 74 + .../cloud/securitycenter/v2/folder_pb.rb | 21 + .../securitycenter/v2/group_membership_pb.rb | 22 + .../cloud/securitycenter/v2/iam_binding_pb.rb | 22 + .../cloud/securitycenter/v2/indicator_pb.rb | 26 + .../cloud/securitycenter/v2/ip_rules_pb.rb | 28 + .../google/cloud/securitycenter/v2/job_pb.rb | 24 + .../securitycenter/v2/kernel_rootkit_pb.rb | 21 + .../cloud/securitycenter/v2/kubernetes_pb.rb | 34 + .../cloud/securitycenter/v2/label_pb.rb | 21 + .../securitycenter/v2/load_balancer_pb.rb | 21 + .../cloud/securitycenter/v2/log_entry_pb.rb | 24 + .../securitycenter/v2/mitre_attack_pb.rb | 23 + .../cloud/securitycenter/v2/mute_config_pb.rb | 26 + .../cloud/securitycenter/v2/network_pb.rb | 21 + .../cloud/securitycenter/v2/notebook_pb.rb | 23 + .../v2/notification_config_pb.rb | 26 + .../v2/notification_message_pb.rb | 24 + .../cloud/securitycenter/v2/org_policy_pb.rb | 24 + .../cloud/securitycenter/v2/process_pb.rb | 24 + .../cloud/securitycenter/v2/resource_pb.rb | 39 + .../v2/resource_value_config_pb.rb | 28 + .../securitycenter/v2/security_marks_pb.rb | 23 + .../securitycenter/v2/security_posture_pb.rb | 22 + .../v2/securitycenter_service_pb.rb | 101 + .../v2/securitycenter_service_services_pb.rb | 167 + .../cloud/securitycenter/v2/simulation_pb.rb | 27 + .../cloud/securitycenter/v2/source_pb.rb | 23 + .../securitycenter/v2/toxic_combination_pb.rb | 21 + .../securitycenter/v2/valued_resource_pb.rb | 25 + .../cloud/securitycenter/v2/vertex_ai_pb.rb | 23 + .../securitycenter/v2/vulnerability_pb.rb | 37 + .../proto_docs/README.md | 4 + .../proto_docs/google/api/client.rb | 589 ++ .../proto_docs/google/api/field_behavior.rb | 85 + .../proto_docs/google/api/launch_stage.rb | 71 + .../proto_docs/google/api/resource.rb | 227 + .../proto_docs/google/api/routing.rb | 463 + .../google/cloud/securitycenter/v2/access.rb | 120 + .../securitycenter/v2/affected_resources.rb | 35 + .../cloud/securitycenter/v2/ai_model.rb | 71 + .../cloud/securitycenter/v2/application.rb | 40 + .../securitycenter/v2/attack_exposure.rb | 73 + .../cloud/securitycenter/v2/attack_path.rb | 147 + .../v2/backup_disaster_recovery.rb | 90 + .../securitycenter/v2/bigquery_export.rb | 96 + .../cloud/securitycenter/v2/chokepoint.rb | 39 + .../cloud/securitycenter/v2/cloud_armor.rb | 138 + .../v2/cloud_dlp_data_profile.rb | 52 + .../securitycenter/v2/cloud_dlp_inspection.rb | 50 + .../cloud/securitycenter/v2/compliance.rb | 43 + .../cloud/securitycenter/v2/connection.rb | 70 + .../securitycenter/v2/contact_details.rb | 44 + .../cloud/securitycenter/v2/container.rb | 49 + .../securitycenter/v2/data_access_event.rb | 61 + .../securitycenter/v2/data_flow_event.rb | 65 + .../v2/data_retention_deletion_event.rb | 69 + .../cloud/securitycenter/v2/database.rb | 67 + .../google/cloud/securitycenter/v2/disk.rb | 36 + .../cloud/securitycenter/v2/exfiltration.rb | 64 + .../securitycenter/v2/external_system.rb | 106 + .../google/cloud/securitycenter/v2/file.rb | 105 + .../google/cloud/securitycenter/v2/finding.rb | 524 ++ .../google/cloud/securitycenter/v2/folder.rb | 40 + .../securitycenter/v2/group_membership.rb | 51 + .../cloud/securitycenter/v2/iam_binding.rb | 56 + .../cloud/securitycenter/v2/indicator.rb | 116 + .../cloud/securitycenter/v2/ip_rules.rb | 122 + .../google/cloud/securitycenter/v2/job.rb | 65 + .../cloud/securitycenter/v2/kernel_rootkit.rb | 66 + .../cloud/securitycenter/v2/kubernetes.rb | 241 + .../google/cloud/securitycenter/v2/label.rb | 41 + .../cloud/securitycenter/v2/load_balancer.rb | 36 + .../cloud/securitycenter/v2/log_entry.rb | 58 + .../cloud/securitycenter/v2/mitre_attack.rb | 521 ++ .../cloud/securitycenter/v2/mute_config.rb | 113 + .../google/cloud/securitycenter/v2/network.rb | 36 + .../cloud/securitycenter/v2/notebook.rb | 46 + .../securitycenter/v2/notification_config.rb | 94 + .../securitycenter/v2/notification_message.rb | 42 + .../cloud/securitycenter/v2/org_policy.rb | 37 + .../google/cloud/securitycenter/v2/process.rb | 83 + .../cloud/securitycenter/v2/resource.rb | 314 + .../v2/resource_value_config.rb | 127 + .../cloud/securitycenter/v2/security_marks.rb | 84 + .../securitycenter/v2/security_posture.rb | 83 + .../v2/securitycenter_service.rb | 1216 +++ .../cloud/securitycenter/v2/simulation.rb | 46 + .../google/cloud/securitycenter/v2/source.rb | 65 + .../securitycenter/v2/toxic_combination.rb | 46 + .../securitycenter/v2/valued_resource.rb | 86 + .../cloud/securitycenter/v2/vertex_ai.rb | 68 + .../cloud/securitycenter/v2/vulnerability.rb | 365 + .../proto_docs/google/iam/v1/iam_policy.rb | 87 + .../proto_docs/google/iam/v1/options.rb | 50 + .../proto_docs/google/iam/v1/policy.rb | 426 + .../google/longrunning/operations.rb | 191 + .../proto_docs/google/protobuf/any.rb | 145 + .../proto_docs/google/protobuf/duration.rb | 98 + .../proto_docs/google/protobuf/empty.rb | 34 + .../proto_docs/google/protobuf/field_mask.rb | 229 + .../proto_docs/google/protobuf/struct.rb | 108 + .../proto_docs/google/protobuf/timestamp.rb | 127 + .../proto_docs/google/rpc/status.rb | 48 + .../proto_docs/google/type/expr.rb | 75 + .../snippets/Gemfile | 32 + .../batch_create_resource_value_configs.rb | 47 + .../security_center/bulk_mute_findings.rb | 54 + .../create_big_query_export.rb | 47 + .../security_center/create_finding.rb | 47 + .../security_center/create_mute_config.rb | 47 + .../create_notification_config.rb | 47 + .../snippets/security_center/create_source.rb | 47 + .../delete_big_query_export.rb | 47 + .../security_center/delete_mute_config.rb | 47 + .../delete_notification_config.rb | 47 + .../delete_resource_value_config.rb | 47 + .../security_center/get_big_query_export.rb | 47 + .../security_center/get_iam_policy.rb | 47 + .../security_center/get_mute_config.rb | 47 + .../get_notification_config.rb | 47 + .../get_resource_value_config.rb | 47 + .../security_center/get_simulation.rb | 47 + .../snippets/security_center/get_source.rb | 47 + .../security_center/get_valued_resource.rb | 47 + .../security_center/group_findings.rb | 51 + .../security_center/list_attack_paths.rb | 51 + .../security_center/list_big_query_exports.rb | 51 + .../snippets/security_center/list_findings.rb | 51 + .../security_center/list_mute_configs.rb | 51 + .../list_notification_configs.rb | 51 + .../list_resource_value_configs.rb | 51 + .../snippets/security_center/list_sources.rb | 51 + .../security_center/list_valued_resources.rb | 51 + .../security_center/set_finding_state.rb | 47 + .../security_center/set_iam_policy.rb | 47 + .../snippets/security_center/set_mute.rb | 47 + .../security_center/test_iam_permissions.rb | 47 + .../update_big_query_export.rb | 47 + .../security_center/update_external_system.rb | 47 + .../security_center/update_finding.rb | 47 + .../security_center/update_mute_config.rb | 47 + .../update_notification_config.rb | 47 + .../update_resource_value_config.rb | 47 + .../security_center/update_security_marks.rb | 47 + .../snippets/security_center/update_source.rb | 47 + ...tadata_google.cloud.securitycenter.v2.json | 1615 ++++ .../v2/security_center_operations_test.rb | 400 + .../v2/security_center_paths_test.rb | 403 + .../v2/security_center_rest_test.rb | 2311 +++++ .../v2/security_center_test.rb | 2592 ++++++ .../test/helper.rb | 26 + .../.gitignore | 22 + .../.repo-metadata.json | 17 + .../.rubocop.yml | 33 + .../.toys.rb | 28 + .../.yardopts | 12 + .../AUTHENTICATION.md | 122 + .../CHANGELOG.md | 2 + .../Gemfile | 14 + .../LICENSE.md | 201 + .../README.md | 154 + .../Rakefile | 169 + .../gapic_metadata.json | 123 + ...loud-security_center_management-v1.gemspec | 30 + ...gle-cloud-security_center_management-v1.rb | 21 + .../cloud/security_center_management/v1.rb | 45 + .../v1/bindings_override.rb | 75 + .../security_center_management/v1/rest.rb | 38 + .../v1/security_center_management.rb | 55 + .../v1/security_center_management/client.rb | 2790 ++++++ .../security_center_management/credentials.rb | 47 + .../v1/security_center_management/paths.rb | 374 + .../v1/security_center_management/rest.rb | 53 + .../security_center_management/rest/client.rb | 2608 ++++++ .../rest/service_stub.rb | 1677 ++++ .../security_center_management/v1/version.rb | 28 + .../v1/security_center_management_pb.rb | 86 + .../security_center_management_services_pb.rb | 141 + .../proto_docs/README.md | 4 + .../proto_docs/google/api/client.rb | 589 ++ .../proto_docs/google/api/field_behavior.rb | 85 + .../proto_docs/google/api/launch_stage.rb | 71 + .../proto_docs/google/api/resource.rb | 227 + .../v1/security_center_management.rb | 1334 +++ .../proto_docs/google/iam/v1/policy.rb | 426 + .../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/struct.rb | 108 + .../proto_docs/google/protobuf/timestamp.rb | 127 + .../proto_docs/google/rpc/status.rb | 48 + .../proto_docs/google/type/expr.rb | 75 + .../snippets/Gemfile | 32 + ...te_event_threat_detection_custom_module.rb | 47 + ...security_health_analytics_custom_module.rb | 47 + ...te_event_threat_detection_custom_module.rb | 47 + ...security_health_analytics_custom_module.rb | 47 + ...ve_event_threat_detection_custom_module.rb | 47 + ...security_health_analytics_custom_module.rb | 47 + ...et_event_threat_detection_custom_module.rb | 47 + .../get_security_center_service.rb | 47 + ...security_health_analytics_custom_module.rb | 47 + ...t_event_threat_detection_custom_modules.rb | 51 + ...ecurity_health_analytics_custom_modules.rb | 51 + ...e_event_threat_detection_custom_modules.rb | 51 + ...ecurity_health_analytics_custom_modules.rb | 51 + ...t_event_threat_detection_custom_modules.rb | 51 + .../list_security_center_services.rb | 51 + ...ecurity_health_analytics_custom_modules.rb | 51 + ...security_health_analytics_custom_module.rb | 47 + ...te_event_threat_detection_custom_module.rb | 47 + .../update_security_center_service.rb | 47 + ...security_health_analytics_custom_module.rb | 47 + ...te_event_threat_detection_custom_module.rb | 47 + ...gle.cloud.securitycentermanagement.v1.json | 855 ++ .../security_center_management_paths_test.rb | 169 + .../security_center_management_rest_test.rb | 1265 +++ .../v1/security_center_management_test.rb | 1421 ++++ .../test/helper.rb | 26 + 2018 files changed, 462525 insertions(+) create mode 100644 owl-bot-staging/google-cloud-redis-cluster-v1beta1/.gitignore create mode 100644 owl-bot-staging/google-cloud-redis-cluster-v1beta1/.repo-metadata.json create mode 100644 owl-bot-staging/google-cloud-redis-cluster-v1beta1/.rubocop.yml create mode 100644 owl-bot-staging/google-cloud-redis-cluster-v1beta1/.toys.rb create mode 100644 owl-bot-staging/google-cloud-redis-cluster-v1beta1/.yardopts create mode 100644 owl-bot-staging/google-cloud-redis-cluster-v1beta1/AUTHENTICATION.md create mode 100644 owl-bot-staging/google-cloud-redis-cluster-v1beta1/CHANGELOG.md create mode 100644 owl-bot-staging/google-cloud-redis-cluster-v1beta1/Gemfile create mode 100644 owl-bot-staging/google-cloud-redis-cluster-v1beta1/LICENSE.md create mode 100644 owl-bot-staging/google-cloud-redis-cluster-v1beta1/README.md create mode 100644 owl-bot-staging/google-cloud-redis-cluster-v1beta1/Rakefile create mode 100644 owl-bot-staging/google-cloud-redis-cluster-v1beta1/gapic_metadata.json create mode 100644 owl-bot-staging/google-cloud-redis-cluster-v1beta1/google-cloud-redis-cluster-v1beta1.gemspec create mode 100644 owl-bot-staging/google-cloud-redis-cluster-v1beta1/lib/google-cloud-redis-cluster-v1beta1.rb create mode 100644 owl-bot-staging/google-cloud-redis-cluster-v1beta1/lib/google/cloud/redis/cluster/v1beta1.rb create mode 100644 owl-bot-staging/google-cloud-redis-cluster-v1beta1/lib/google/cloud/redis/cluster/v1beta1/bindings_override.rb create mode 100644 owl-bot-staging/google-cloud-redis-cluster-v1beta1/lib/google/cloud/redis/cluster/v1beta1/cloud_redis_cluster.rb create mode 100644 owl-bot-staging/google-cloud-redis-cluster-v1beta1/lib/google/cloud/redis/cluster/v1beta1/cloud_redis_cluster/client.rb create mode 100644 owl-bot-staging/google-cloud-redis-cluster-v1beta1/lib/google/cloud/redis/cluster/v1beta1/cloud_redis_cluster/credentials.rb create mode 100644 owl-bot-staging/google-cloud-redis-cluster-v1beta1/lib/google/cloud/redis/cluster/v1beta1/cloud_redis_cluster/operations.rb create mode 100644 owl-bot-staging/google-cloud-redis-cluster-v1beta1/lib/google/cloud/redis/cluster/v1beta1/cloud_redis_cluster/paths.rb create mode 100644 owl-bot-staging/google-cloud-redis-cluster-v1beta1/lib/google/cloud/redis/cluster/v1beta1/cloud_redis_cluster/rest.rb create mode 100644 owl-bot-staging/google-cloud-redis-cluster-v1beta1/lib/google/cloud/redis/cluster/v1beta1/cloud_redis_cluster/rest/client.rb create mode 100644 owl-bot-staging/google-cloud-redis-cluster-v1beta1/lib/google/cloud/redis/cluster/v1beta1/cloud_redis_cluster/rest/operations.rb create mode 100644 owl-bot-staging/google-cloud-redis-cluster-v1beta1/lib/google/cloud/redis/cluster/v1beta1/cloud_redis_cluster/rest/service_stub.rb create mode 100644 owl-bot-staging/google-cloud-redis-cluster-v1beta1/lib/google/cloud/redis/cluster/v1beta1/cloud_redis_cluster_pb.rb create mode 100644 owl-bot-staging/google-cloud-redis-cluster-v1beta1/lib/google/cloud/redis/cluster/v1beta1/cloud_redis_cluster_services_pb.rb create mode 100644 owl-bot-staging/google-cloud-redis-cluster-v1beta1/lib/google/cloud/redis/cluster/v1beta1/rest.rb create mode 100644 owl-bot-staging/google-cloud-redis-cluster-v1beta1/lib/google/cloud/redis/cluster/v1beta1/version.rb create mode 100644 owl-bot-staging/google-cloud-redis-cluster-v1beta1/proto_docs/README.md create mode 100644 owl-bot-staging/google-cloud-redis-cluster-v1beta1/proto_docs/google/api/client.rb create mode 100644 owl-bot-staging/google-cloud-redis-cluster-v1beta1/proto_docs/google/api/field_behavior.rb create mode 100644 owl-bot-staging/google-cloud-redis-cluster-v1beta1/proto_docs/google/api/field_info.rb create mode 100644 owl-bot-staging/google-cloud-redis-cluster-v1beta1/proto_docs/google/api/launch_stage.rb create mode 100644 owl-bot-staging/google-cloud-redis-cluster-v1beta1/proto_docs/google/api/resource.rb create mode 100644 owl-bot-staging/google-cloud-redis-cluster-v1beta1/proto_docs/google/cloud/redis/cluster/v1beta1/cloud_redis_cluster.rb create mode 100644 owl-bot-staging/google-cloud-redis-cluster-v1beta1/proto_docs/google/longrunning/operations.rb create mode 100644 owl-bot-staging/google-cloud-redis-cluster-v1beta1/proto_docs/google/protobuf/any.rb create mode 100644 owl-bot-staging/google-cloud-redis-cluster-v1beta1/proto_docs/google/protobuf/duration.rb create mode 100644 owl-bot-staging/google-cloud-redis-cluster-v1beta1/proto_docs/google/protobuf/empty.rb create mode 100644 owl-bot-staging/google-cloud-redis-cluster-v1beta1/proto_docs/google/protobuf/field_mask.rb create mode 100644 owl-bot-staging/google-cloud-redis-cluster-v1beta1/proto_docs/google/protobuf/timestamp.rb create mode 100644 owl-bot-staging/google-cloud-redis-cluster-v1beta1/proto_docs/google/rpc/status.rb create mode 100644 owl-bot-staging/google-cloud-redis-cluster-v1beta1/proto_docs/google/type/dayofweek.rb create mode 100644 owl-bot-staging/google-cloud-redis-cluster-v1beta1/proto_docs/google/type/timeofday.rb create mode 100644 owl-bot-staging/google-cloud-redis-cluster-v1beta1/snippets/Gemfile create mode 100644 owl-bot-staging/google-cloud-redis-cluster-v1beta1/snippets/cloud_redis_cluster/backup_cluster.rb create mode 100644 owl-bot-staging/google-cloud-redis-cluster-v1beta1/snippets/cloud_redis_cluster/create_cluster.rb create mode 100644 owl-bot-staging/google-cloud-redis-cluster-v1beta1/snippets/cloud_redis_cluster/delete_backup.rb create mode 100644 owl-bot-staging/google-cloud-redis-cluster-v1beta1/snippets/cloud_redis_cluster/delete_cluster.rb create mode 100644 owl-bot-staging/google-cloud-redis-cluster-v1beta1/snippets/cloud_redis_cluster/export_backup.rb create mode 100644 owl-bot-staging/google-cloud-redis-cluster-v1beta1/snippets/cloud_redis_cluster/get_backup.rb create mode 100644 owl-bot-staging/google-cloud-redis-cluster-v1beta1/snippets/cloud_redis_cluster/get_backup_collection.rb create mode 100644 owl-bot-staging/google-cloud-redis-cluster-v1beta1/snippets/cloud_redis_cluster/get_cluster.rb create mode 100644 owl-bot-staging/google-cloud-redis-cluster-v1beta1/snippets/cloud_redis_cluster/get_cluster_certificate_authority.rb create mode 100644 owl-bot-staging/google-cloud-redis-cluster-v1beta1/snippets/cloud_redis_cluster/list_backup_collections.rb create mode 100644 owl-bot-staging/google-cloud-redis-cluster-v1beta1/snippets/cloud_redis_cluster/list_backups.rb create mode 100644 owl-bot-staging/google-cloud-redis-cluster-v1beta1/snippets/cloud_redis_cluster/list_clusters.rb create mode 100644 owl-bot-staging/google-cloud-redis-cluster-v1beta1/snippets/cloud_redis_cluster/reschedule_cluster_maintenance.rb create mode 100644 owl-bot-staging/google-cloud-redis-cluster-v1beta1/snippets/cloud_redis_cluster/update_cluster.rb create mode 100644 owl-bot-staging/google-cloud-redis-cluster-v1beta1/snippets/snippet_metadata_google.cloud.redis.cluster.v1beta1.json create mode 100644 owl-bot-staging/google-cloud-redis-cluster-v1beta1/test/google/cloud/redis/cluster/v1beta1/cloud_redis_cluster_operations_test.rb create mode 100644 owl-bot-staging/google-cloud-redis-cluster-v1beta1/test/google/cloud/redis/cluster/v1beta1/cloud_redis_cluster_paths_test.rb create mode 100644 owl-bot-staging/google-cloud-redis-cluster-v1beta1/test/google/cloud/redis/cluster/v1beta1/cloud_redis_cluster_rest_test.rb create mode 100644 owl-bot-staging/google-cloud-redis-cluster-v1beta1/test/google/cloud/redis/cluster/v1beta1/cloud_redis_cluster_test.rb create mode 100644 owl-bot-staging/google-cloud-redis-cluster-v1beta1/test/helper.rb create mode 100644 owl-bot-staging/google-cloud-redis-v1/.gitignore create mode 100644 owl-bot-staging/google-cloud-redis-v1/.repo-metadata.json create mode 100644 owl-bot-staging/google-cloud-redis-v1/.rubocop.yml create mode 100644 owl-bot-staging/google-cloud-redis-v1/.toys.rb create mode 100644 owl-bot-staging/google-cloud-redis-v1/.yardopts create mode 100644 owl-bot-staging/google-cloud-redis-v1/AUTHENTICATION.md create mode 100644 owl-bot-staging/google-cloud-redis-v1/CHANGELOG.md create mode 100644 owl-bot-staging/google-cloud-redis-v1/Gemfile create mode 100644 owl-bot-staging/google-cloud-redis-v1/LICENSE.md create mode 100644 owl-bot-staging/google-cloud-redis-v1/README.md create mode 100644 owl-bot-staging/google-cloud-redis-v1/Rakefile create mode 100644 owl-bot-staging/google-cloud-redis-v1/gapic_metadata.json create mode 100644 owl-bot-staging/google-cloud-redis-v1/google-cloud-redis-v1.gemspec create mode 100644 owl-bot-staging/google-cloud-redis-v1/lib/google-cloud-redis-v1.rb create mode 100644 owl-bot-staging/google-cloud-redis-v1/lib/google/cloud/redis/v1.rb create mode 100644 owl-bot-staging/google-cloud-redis-v1/lib/google/cloud/redis/v1/bindings_override.rb create mode 100644 owl-bot-staging/google-cloud-redis-v1/lib/google/cloud/redis/v1/cloud_redis.rb create mode 100644 owl-bot-staging/google-cloud-redis-v1/lib/google/cloud/redis/v1/cloud_redis/client.rb create mode 100644 owl-bot-staging/google-cloud-redis-v1/lib/google/cloud/redis/v1/cloud_redis/credentials.rb create mode 100644 owl-bot-staging/google-cloud-redis-v1/lib/google/cloud/redis/v1/cloud_redis/operations.rb create mode 100644 owl-bot-staging/google-cloud-redis-v1/lib/google/cloud/redis/v1/cloud_redis/paths.rb create mode 100644 owl-bot-staging/google-cloud-redis-v1/lib/google/cloud/redis/v1/cloud_redis/rest.rb create mode 100644 owl-bot-staging/google-cloud-redis-v1/lib/google/cloud/redis/v1/cloud_redis/rest/client.rb create mode 100644 owl-bot-staging/google-cloud-redis-v1/lib/google/cloud/redis/v1/cloud_redis/rest/operations.rb create mode 100644 owl-bot-staging/google-cloud-redis-v1/lib/google/cloud/redis/v1/cloud_redis/rest/service_stub.rb create mode 100644 owl-bot-staging/google-cloud-redis-v1/lib/google/cloud/redis/v1/cloud_redis_pb.rb create mode 100644 owl-bot-staging/google-cloud-redis-v1/lib/google/cloud/redis/v1/cloud_redis_services_pb.rb create mode 100644 owl-bot-staging/google-cloud-redis-v1/lib/google/cloud/redis/v1/rest.rb create mode 100644 owl-bot-staging/google-cloud-redis-v1/lib/google/cloud/redis/v1/version.rb create mode 100644 owl-bot-staging/google-cloud-redis-v1/proto_docs/README.md create mode 100644 owl-bot-staging/google-cloud-redis-v1/proto_docs/google/api/client.rb create mode 100644 owl-bot-staging/google-cloud-redis-v1/proto_docs/google/api/field_behavior.rb create mode 100644 owl-bot-staging/google-cloud-redis-v1/proto_docs/google/api/launch_stage.rb create mode 100644 owl-bot-staging/google-cloud-redis-v1/proto_docs/google/api/resource.rb create mode 100644 owl-bot-staging/google-cloud-redis-v1/proto_docs/google/cloud/redis/v1/cloud_redis.rb create mode 100644 owl-bot-staging/google-cloud-redis-v1/proto_docs/google/longrunning/operations.rb create mode 100644 owl-bot-staging/google-cloud-redis-v1/proto_docs/google/protobuf/any.rb create mode 100644 owl-bot-staging/google-cloud-redis-v1/proto_docs/google/protobuf/duration.rb create mode 100644 owl-bot-staging/google-cloud-redis-v1/proto_docs/google/protobuf/empty.rb create mode 100644 owl-bot-staging/google-cloud-redis-v1/proto_docs/google/protobuf/field_mask.rb create mode 100644 owl-bot-staging/google-cloud-redis-v1/proto_docs/google/protobuf/timestamp.rb create mode 100644 owl-bot-staging/google-cloud-redis-v1/proto_docs/google/rpc/status.rb create mode 100644 owl-bot-staging/google-cloud-redis-v1/proto_docs/google/type/dayofweek.rb create mode 100644 owl-bot-staging/google-cloud-redis-v1/proto_docs/google/type/timeofday.rb create mode 100644 owl-bot-staging/google-cloud-redis-v1/snippets/Gemfile create mode 100644 owl-bot-staging/google-cloud-redis-v1/snippets/cloud_redis/create_instance.rb create mode 100644 owl-bot-staging/google-cloud-redis-v1/snippets/cloud_redis/delete_instance.rb create mode 100644 owl-bot-staging/google-cloud-redis-v1/snippets/cloud_redis/export_instance.rb create mode 100644 owl-bot-staging/google-cloud-redis-v1/snippets/cloud_redis/failover_instance.rb create mode 100644 owl-bot-staging/google-cloud-redis-v1/snippets/cloud_redis/get_instance.rb create mode 100644 owl-bot-staging/google-cloud-redis-v1/snippets/cloud_redis/get_instance_auth_string.rb create mode 100644 owl-bot-staging/google-cloud-redis-v1/snippets/cloud_redis/import_instance.rb create mode 100644 owl-bot-staging/google-cloud-redis-v1/snippets/cloud_redis/list_instances.rb create mode 100644 owl-bot-staging/google-cloud-redis-v1/snippets/cloud_redis/reschedule_maintenance.rb create mode 100644 owl-bot-staging/google-cloud-redis-v1/snippets/cloud_redis/update_instance.rb create mode 100644 owl-bot-staging/google-cloud-redis-v1/snippets/cloud_redis/upgrade_instance.rb create mode 100644 owl-bot-staging/google-cloud-redis-v1/snippets/snippet_metadata_google.cloud.redis.v1.json create mode 100644 owl-bot-staging/google-cloud-redis-v1/test/google/cloud/redis/v1/cloud_redis_operations_test.rb create mode 100644 owl-bot-staging/google-cloud-redis-v1/test/google/cloud/redis/v1/cloud_redis_paths_test.rb create mode 100644 owl-bot-staging/google-cloud-redis-v1/test/google/cloud/redis/v1/cloud_redis_rest_test.rb create mode 100644 owl-bot-staging/google-cloud-redis-v1/test/google/cloud/redis/v1/cloud_redis_test.rb create mode 100644 owl-bot-staging/google-cloud-redis-v1/test/helper.rb create mode 100644 owl-bot-staging/google-cloud-redis-v1beta1/.gitignore create mode 100644 owl-bot-staging/google-cloud-redis-v1beta1/.repo-metadata.json create mode 100644 owl-bot-staging/google-cloud-redis-v1beta1/.rubocop.yml create mode 100644 owl-bot-staging/google-cloud-redis-v1beta1/.toys.rb create mode 100644 owl-bot-staging/google-cloud-redis-v1beta1/.yardopts create mode 100644 owl-bot-staging/google-cloud-redis-v1beta1/AUTHENTICATION.md create mode 100644 owl-bot-staging/google-cloud-redis-v1beta1/CHANGELOG.md create mode 100644 owl-bot-staging/google-cloud-redis-v1beta1/Gemfile create mode 100644 owl-bot-staging/google-cloud-redis-v1beta1/LICENSE.md create mode 100644 owl-bot-staging/google-cloud-redis-v1beta1/README.md create mode 100644 owl-bot-staging/google-cloud-redis-v1beta1/Rakefile create mode 100644 owl-bot-staging/google-cloud-redis-v1beta1/gapic_metadata.json create mode 100644 owl-bot-staging/google-cloud-redis-v1beta1/google-cloud-redis-v1beta1.gemspec create mode 100644 owl-bot-staging/google-cloud-redis-v1beta1/lib/google-cloud-redis-v1beta1.rb create mode 100644 owl-bot-staging/google-cloud-redis-v1beta1/lib/google/cloud/redis/v1beta1.rb create mode 100644 owl-bot-staging/google-cloud-redis-v1beta1/lib/google/cloud/redis/v1beta1/cloud_redis.rb create mode 100644 owl-bot-staging/google-cloud-redis-v1beta1/lib/google/cloud/redis/v1beta1/cloud_redis/client.rb create mode 100644 owl-bot-staging/google-cloud-redis-v1beta1/lib/google/cloud/redis/v1beta1/cloud_redis/credentials.rb create mode 100644 owl-bot-staging/google-cloud-redis-v1beta1/lib/google/cloud/redis/v1beta1/cloud_redis/operations.rb create mode 100644 owl-bot-staging/google-cloud-redis-v1beta1/lib/google/cloud/redis/v1beta1/cloud_redis/paths.rb create mode 100644 owl-bot-staging/google-cloud-redis-v1beta1/lib/google/cloud/redis/v1beta1/cloud_redis/rest.rb create mode 100644 owl-bot-staging/google-cloud-redis-v1beta1/lib/google/cloud/redis/v1beta1/cloud_redis/rest/client.rb create mode 100644 owl-bot-staging/google-cloud-redis-v1beta1/lib/google/cloud/redis/v1beta1/cloud_redis/rest/operations.rb create mode 100644 owl-bot-staging/google-cloud-redis-v1beta1/lib/google/cloud/redis/v1beta1/cloud_redis/rest/service_stub.rb create mode 100644 owl-bot-staging/google-cloud-redis-v1beta1/lib/google/cloud/redis/v1beta1/cloud_redis_pb.rb create mode 100644 owl-bot-staging/google-cloud-redis-v1beta1/lib/google/cloud/redis/v1beta1/cloud_redis_services_pb.rb create mode 100644 owl-bot-staging/google-cloud-redis-v1beta1/lib/google/cloud/redis/v1beta1/rest.rb create mode 100644 owl-bot-staging/google-cloud-redis-v1beta1/lib/google/cloud/redis/v1beta1/version.rb create mode 100644 owl-bot-staging/google-cloud-redis-v1beta1/proto_docs/README.md create mode 100644 owl-bot-staging/google-cloud-redis-v1beta1/proto_docs/google/api/client.rb create mode 100644 owl-bot-staging/google-cloud-redis-v1beta1/proto_docs/google/api/field_behavior.rb create mode 100644 owl-bot-staging/google-cloud-redis-v1beta1/proto_docs/google/api/launch_stage.rb create mode 100644 owl-bot-staging/google-cloud-redis-v1beta1/proto_docs/google/api/resource.rb create mode 100644 owl-bot-staging/google-cloud-redis-v1beta1/proto_docs/google/cloud/redis/v1beta1/cloud_redis.rb create mode 100644 owl-bot-staging/google-cloud-redis-v1beta1/proto_docs/google/longrunning/operations.rb create mode 100644 owl-bot-staging/google-cloud-redis-v1beta1/proto_docs/google/protobuf/any.rb create mode 100644 owl-bot-staging/google-cloud-redis-v1beta1/proto_docs/google/protobuf/duration.rb create mode 100644 owl-bot-staging/google-cloud-redis-v1beta1/proto_docs/google/protobuf/empty.rb create mode 100644 owl-bot-staging/google-cloud-redis-v1beta1/proto_docs/google/protobuf/field_mask.rb create mode 100644 owl-bot-staging/google-cloud-redis-v1beta1/proto_docs/google/protobuf/timestamp.rb create mode 100644 owl-bot-staging/google-cloud-redis-v1beta1/proto_docs/google/rpc/status.rb create mode 100644 owl-bot-staging/google-cloud-redis-v1beta1/proto_docs/google/type/dayofweek.rb create mode 100644 owl-bot-staging/google-cloud-redis-v1beta1/proto_docs/google/type/timeofday.rb create mode 100644 owl-bot-staging/google-cloud-redis-v1beta1/snippets/Gemfile create mode 100644 owl-bot-staging/google-cloud-redis-v1beta1/snippets/cloud_redis/create_instance.rb create mode 100644 owl-bot-staging/google-cloud-redis-v1beta1/snippets/cloud_redis/delete_instance.rb create mode 100644 owl-bot-staging/google-cloud-redis-v1beta1/snippets/cloud_redis/export_instance.rb create mode 100644 owl-bot-staging/google-cloud-redis-v1beta1/snippets/cloud_redis/failover_instance.rb create mode 100644 owl-bot-staging/google-cloud-redis-v1beta1/snippets/cloud_redis/get_instance.rb create mode 100644 owl-bot-staging/google-cloud-redis-v1beta1/snippets/cloud_redis/get_instance_auth_string.rb create mode 100644 owl-bot-staging/google-cloud-redis-v1beta1/snippets/cloud_redis/import_instance.rb create mode 100644 owl-bot-staging/google-cloud-redis-v1beta1/snippets/cloud_redis/list_instances.rb create mode 100644 owl-bot-staging/google-cloud-redis-v1beta1/snippets/cloud_redis/reschedule_maintenance.rb create mode 100644 owl-bot-staging/google-cloud-redis-v1beta1/snippets/cloud_redis/update_instance.rb create mode 100644 owl-bot-staging/google-cloud-redis-v1beta1/snippets/cloud_redis/upgrade_instance.rb create mode 100644 owl-bot-staging/google-cloud-redis-v1beta1/snippets/snippet_metadata_google.cloud.redis.v1beta1.json create mode 100644 owl-bot-staging/google-cloud-redis-v1beta1/test/google/cloud/redis/v1beta1/cloud_redis_operations_test.rb create mode 100644 owl-bot-staging/google-cloud-redis-v1beta1/test/google/cloud/redis/v1beta1/cloud_redis_paths_test.rb create mode 100644 owl-bot-staging/google-cloud-redis-v1beta1/test/google/cloud/redis/v1beta1/cloud_redis_rest_test.rb create mode 100644 owl-bot-staging/google-cloud-redis-v1beta1/test/google/cloud/redis/v1beta1/cloud_redis_test.rb create mode 100644 owl-bot-staging/google-cloud-redis-v1beta1/test/helper.rb create mode 100644 owl-bot-staging/google-cloud-resource_manager-v3/.gitignore create mode 100644 owl-bot-staging/google-cloud-resource_manager-v3/.repo-metadata.json create mode 100644 owl-bot-staging/google-cloud-resource_manager-v3/.rubocop.yml create mode 100644 owl-bot-staging/google-cloud-resource_manager-v3/.toys.rb create mode 100644 owl-bot-staging/google-cloud-resource_manager-v3/.yardopts create mode 100644 owl-bot-staging/google-cloud-resource_manager-v3/AUTHENTICATION.md create mode 100644 owl-bot-staging/google-cloud-resource_manager-v3/CHANGELOG.md create mode 100644 owl-bot-staging/google-cloud-resource_manager-v3/Gemfile create mode 100644 owl-bot-staging/google-cloud-resource_manager-v3/LICENSE.md create mode 100644 owl-bot-staging/google-cloud-resource_manager-v3/README.md create mode 100644 owl-bot-staging/google-cloud-resource_manager-v3/Rakefile create mode 100644 owl-bot-staging/google-cloud-resource_manager-v3/gapic_metadata.json create mode 100644 owl-bot-staging/google-cloud-resource_manager-v3/google-cloud-resource_manager-v3.gemspec create mode 100644 owl-bot-staging/google-cloud-resource_manager-v3/lib/google-cloud-resource_manager-v3.rb create mode 100644 owl-bot-staging/google-cloud-resource_manager-v3/lib/google/cloud/resource_manager/v3.rb create mode 100644 owl-bot-staging/google-cloud-resource_manager-v3/lib/google/cloud/resource_manager/v3/folders.rb create mode 100644 owl-bot-staging/google-cloud-resource_manager-v3/lib/google/cloud/resource_manager/v3/folders/client.rb create mode 100644 owl-bot-staging/google-cloud-resource_manager-v3/lib/google/cloud/resource_manager/v3/folders/credentials.rb create mode 100644 owl-bot-staging/google-cloud-resource_manager-v3/lib/google/cloud/resource_manager/v3/folders/operations.rb create mode 100644 owl-bot-staging/google-cloud-resource_manager-v3/lib/google/cloud/resource_manager/v3/folders/paths.rb create mode 100644 owl-bot-staging/google-cloud-resource_manager-v3/lib/google/cloud/resource_manager/v3/folders/rest.rb create mode 100644 owl-bot-staging/google-cloud-resource_manager-v3/lib/google/cloud/resource_manager/v3/folders/rest/client.rb create mode 100644 owl-bot-staging/google-cloud-resource_manager-v3/lib/google/cloud/resource_manager/v3/folders/rest/operations.rb create mode 100644 owl-bot-staging/google-cloud-resource_manager-v3/lib/google/cloud/resource_manager/v3/folders/rest/service_stub.rb create mode 100644 owl-bot-staging/google-cloud-resource_manager-v3/lib/google/cloud/resource_manager/v3/organizations.rb create mode 100644 owl-bot-staging/google-cloud-resource_manager-v3/lib/google/cloud/resource_manager/v3/organizations/client.rb create mode 100644 owl-bot-staging/google-cloud-resource_manager-v3/lib/google/cloud/resource_manager/v3/organizations/credentials.rb create mode 100644 owl-bot-staging/google-cloud-resource_manager-v3/lib/google/cloud/resource_manager/v3/organizations/paths.rb create mode 100644 owl-bot-staging/google-cloud-resource_manager-v3/lib/google/cloud/resource_manager/v3/organizations/rest.rb create mode 100644 owl-bot-staging/google-cloud-resource_manager-v3/lib/google/cloud/resource_manager/v3/organizations/rest/client.rb create mode 100644 owl-bot-staging/google-cloud-resource_manager-v3/lib/google/cloud/resource_manager/v3/organizations/rest/service_stub.rb create mode 100644 owl-bot-staging/google-cloud-resource_manager-v3/lib/google/cloud/resource_manager/v3/projects.rb create mode 100644 owl-bot-staging/google-cloud-resource_manager-v3/lib/google/cloud/resource_manager/v3/projects/client.rb create mode 100644 owl-bot-staging/google-cloud-resource_manager-v3/lib/google/cloud/resource_manager/v3/projects/credentials.rb create mode 100644 owl-bot-staging/google-cloud-resource_manager-v3/lib/google/cloud/resource_manager/v3/projects/operations.rb create mode 100644 owl-bot-staging/google-cloud-resource_manager-v3/lib/google/cloud/resource_manager/v3/projects/paths.rb create mode 100644 owl-bot-staging/google-cloud-resource_manager-v3/lib/google/cloud/resource_manager/v3/projects/rest.rb create mode 100644 owl-bot-staging/google-cloud-resource_manager-v3/lib/google/cloud/resource_manager/v3/projects/rest/client.rb create mode 100644 owl-bot-staging/google-cloud-resource_manager-v3/lib/google/cloud/resource_manager/v3/projects/rest/operations.rb create mode 100644 owl-bot-staging/google-cloud-resource_manager-v3/lib/google/cloud/resource_manager/v3/projects/rest/service_stub.rb create mode 100644 owl-bot-staging/google-cloud-resource_manager-v3/lib/google/cloud/resource_manager/v3/rest.rb create mode 100644 owl-bot-staging/google-cloud-resource_manager-v3/lib/google/cloud/resource_manager/v3/tag_bindings.rb create mode 100644 owl-bot-staging/google-cloud-resource_manager-v3/lib/google/cloud/resource_manager/v3/tag_bindings/client.rb create mode 100644 owl-bot-staging/google-cloud-resource_manager-v3/lib/google/cloud/resource_manager/v3/tag_bindings/credentials.rb create mode 100644 owl-bot-staging/google-cloud-resource_manager-v3/lib/google/cloud/resource_manager/v3/tag_bindings/operations.rb create mode 100644 owl-bot-staging/google-cloud-resource_manager-v3/lib/google/cloud/resource_manager/v3/tag_bindings/paths.rb create mode 100644 owl-bot-staging/google-cloud-resource_manager-v3/lib/google/cloud/resource_manager/v3/tag_bindings/rest.rb create mode 100644 owl-bot-staging/google-cloud-resource_manager-v3/lib/google/cloud/resource_manager/v3/tag_bindings/rest/client.rb create mode 100644 owl-bot-staging/google-cloud-resource_manager-v3/lib/google/cloud/resource_manager/v3/tag_bindings/rest/operations.rb create mode 100644 owl-bot-staging/google-cloud-resource_manager-v3/lib/google/cloud/resource_manager/v3/tag_bindings/rest/service_stub.rb create mode 100644 owl-bot-staging/google-cloud-resource_manager-v3/lib/google/cloud/resource_manager/v3/tag_holds.rb create mode 100644 owl-bot-staging/google-cloud-resource_manager-v3/lib/google/cloud/resource_manager/v3/tag_holds/client.rb create mode 100644 owl-bot-staging/google-cloud-resource_manager-v3/lib/google/cloud/resource_manager/v3/tag_holds/credentials.rb create mode 100644 owl-bot-staging/google-cloud-resource_manager-v3/lib/google/cloud/resource_manager/v3/tag_holds/operations.rb create mode 100644 owl-bot-staging/google-cloud-resource_manager-v3/lib/google/cloud/resource_manager/v3/tag_holds/paths.rb create mode 100644 owl-bot-staging/google-cloud-resource_manager-v3/lib/google/cloud/resource_manager/v3/tag_holds/rest.rb create mode 100644 owl-bot-staging/google-cloud-resource_manager-v3/lib/google/cloud/resource_manager/v3/tag_holds/rest/client.rb create mode 100644 owl-bot-staging/google-cloud-resource_manager-v3/lib/google/cloud/resource_manager/v3/tag_holds/rest/operations.rb create mode 100644 owl-bot-staging/google-cloud-resource_manager-v3/lib/google/cloud/resource_manager/v3/tag_holds/rest/service_stub.rb create mode 100644 owl-bot-staging/google-cloud-resource_manager-v3/lib/google/cloud/resource_manager/v3/tag_keys.rb create mode 100644 owl-bot-staging/google-cloud-resource_manager-v3/lib/google/cloud/resource_manager/v3/tag_keys/client.rb create mode 100644 owl-bot-staging/google-cloud-resource_manager-v3/lib/google/cloud/resource_manager/v3/tag_keys/credentials.rb create mode 100644 owl-bot-staging/google-cloud-resource_manager-v3/lib/google/cloud/resource_manager/v3/tag_keys/operations.rb create mode 100644 owl-bot-staging/google-cloud-resource_manager-v3/lib/google/cloud/resource_manager/v3/tag_keys/paths.rb create mode 100644 owl-bot-staging/google-cloud-resource_manager-v3/lib/google/cloud/resource_manager/v3/tag_keys/rest.rb create mode 100644 owl-bot-staging/google-cloud-resource_manager-v3/lib/google/cloud/resource_manager/v3/tag_keys/rest/client.rb create mode 100644 owl-bot-staging/google-cloud-resource_manager-v3/lib/google/cloud/resource_manager/v3/tag_keys/rest/operations.rb create mode 100644 owl-bot-staging/google-cloud-resource_manager-v3/lib/google/cloud/resource_manager/v3/tag_keys/rest/service_stub.rb create mode 100644 owl-bot-staging/google-cloud-resource_manager-v3/lib/google/cloud/resource_manager/v3/tag_values.rb create mode 100644 owl-bot-staging/google-cloud-resource_manager-v3/lib/google/cloud/resource_manager/v3/tag_values/client.rb create mode 100644 owl-bot-staging/google-cloud-resource_manager-v3/lib/google/cloud/resource_manager/v3/tag_values/credentials.rb create mode 100644 owl-bot-staging/google-cloud-resource_manager-v3/lib/google/cloud/resource_manager/v3/tag_values/operations.rb create mode 100644 owl-bot-staging/google-cloud-resource_manager-v3/lib/google/cloud/resource_manager/v3/tag_values/paths.rb create mode 100644 owl-bot-staging/google-cloud-resource_manager-v3/lib/google/cloud/resource_manager/v3/tag_values/rest.rb create mode 100644 owl-bot-staging/google-cloud-resource_manager-v3/lib/google/cloud/resource_manager/v3/tag_values/rest/client.rb create mode 100644 owl-bot-staging/google-cloud-resource_manager-v3/lib/google/cloud/resource_manager/v3/tag_values/rest/operations.rb create mode 100644 owl-bot-staging/google-cloud-resource_manager-v3/lib/google/cloud/resource_manager/v3/tag_values/rest/service_stub.rb create mode 100644 owl-bot-staging/google-cloud-resource_manager-v3/lib/google/cloud/resource_manager/v3/version.rb create mode 100644 owl-bot-staging/google-cloud-resource_manager-v3/lib/google/cloud/resourcemanager/v3/folders_pb.rb create mode 100644 owl-bot-staging/google-cloud-resource_manager-v3/lib/google/cloud/resourcemanager/v3/folders_services_pb.rb create mode 100644 owl-bot-staging/google-cloud-resource_manager-v3/lib/google/cloud/resourcemanager/v3/organizations_pb.rb create mode 100644 owl-bot-staging/google-cloud-resource_manager-v3/lib/google/cloud/resourcemanager/v3/organizations_services_pb.rb create mode 100644 owl-bot-staging/google-cloud-resource_manager-v3/lib/google/cloud/resourcemanager/v3/projects_pb.rb create mode 100644 owl-bot-staging/google-cloud-resource_manager-v3/lib/google/cloud/resourcemanager/v3/projects_services_pb.rb create mode 100644 owl-bot-staging/google-cloud-resource_manager-v3/lib/google/cloud/resourcemanager/v3/tag_bindings_pb.rb create mode 100644 owl-bot-staging/google-cloud-resource_manager-v3/lib/google/cloud/resourcemanager/v3/tag_bindings_services_pb.rb create mode 100644 owl-bot-staging/google-cloud-resource_manager-v3/lib/google/cloud/resourcemanager/v3/tag_holds_pb.rb create mode 100644 owl-bot-staging/google-cloud-resource_manager-v3/lib/google/cloud/resourcemanager/v3/tag_holds_services_pb.rb create mode 100644 owl-bot-staging/google-cloud-resource_manager-v3/lib/google/cloud/resourcemanager/v3/tag_keys_pb.rb create mode 100644 owl-bot-staging/google-cloud-resource_manager-v3/lib/google/cloud/resourcemanager/v3/tag_keys_services_pb.rb create mode 100644 owl-bot-staging/google-cloud-resource_manager-v3/lib/google/cloud/resourcemanager/v3/tag_values_pb.rb create mode 100644 owl-bot-staging/google-cloud-resource_manager-v3/lib/google/cloud/resourcemanager/v3/tag_values_services_pb.rb create mode 100644 owl-bot-staging/google-cloud-resource_manager-v3/proto_docs/README.md create mode 100644 owl-bot-staging/google-cloud-resource_manager-v3/proto_docs/google/api/client.rb create mode 100644 owl-bot-staging/google-cloud-resource_manager-v3/proto_docs/google/api/field_behavior.rb create mode 100644 owl-bot-staging/google-cloud-resource_manager-v3/proto_docs/google/api/launch_stage.rb create mode 100644 owl-bot-staging/google-cloud-resource_manager-v3/proto_docs/google/api/resource.rb create mode 100644 owl-bot-staging/google-cloud-resource_manager-v3/proto_docs/google/cloud/resourcemanager/v3/folders.rb create mode 100644 owl-bot-staging/google-cloud-resource_manager-v3/proto_docs/google/cloud/resourcemanager/v3/organizations.rb create mode 100644 owl-bot-staging/google-cloud-resource_manager-v3/proto_docs/google/cloud/resourcemanager/v3/projects.rb create mode 100644 owl-bot-staging/google-cloud-resource_manager-v3/proto_docs/google/cloud/resourcemanager/v3/tag_bindings.rb create mode 100644 owl-bot-staging/google-cloud-resource_manager-v3/proto_docs/google/cloud/resourcemanager/v3/tag_holds.rb create mode 100644 owl-bot-staging/google-cloud-resource_manager-v3/proto_docs/google/cloud/resourcemanager/v3/tag_keys.rb create mode 100644 owl-bot-staging/google-cloud-resource_manager-v3/proto_docs/google/cloud/resourcemanager/v3/tag_values.rb create mode 100644 owl-bot-staging/google-cloud-resource_manager-v3/proto_docs/google/iam/v1/iam_policy.rb create mode 100644 owl-bot-staging/google-cloud-resource_manager-v3/proto_docs/google/iam/v1/options.rb create mode 100644 owl-bot-staging/google-cloud-resource_manager-v3/proto_docs/google/iam/v1/policy.rb create mode 100644 owl-bot-staging/google-cloud-resource_manager-v3/proto_docs/google/longrunning/operations.rb create mode 100644 owl-bot-staging/google-cloud-resource_manager-v3/proto_docs/google/protobuf/any.rb create mode 100644 owl-bot-staging/google-cloud-resource_manager-v3/proto_docs/google/protobuf/duration.rb create mode 100644 owl-bot-staging/google-cloud-resource_manager-v3/proto_docs/google/protobuf/empty.rb create mode 100644 owl-bot-staging/google-cloud-resource_manager-v3/proto_docs/google/protobuf/field_mask.rb create mode 100644 owl-bot-staging/google-cloud-resource_manager-v3/proto_docs/google/protobuf/timestamp.rb create mode 100644 owl-bot-staging/google-cloud-resource_manager-v3/proto_docs/google/rpc/status.rb create mode 100644 owl-bot-staging/google-cloud-resource_manager-v3/proto_docs/google/type/expr.rb create mode 100644 owl-bot-staging/google-cloud-resource_manager-v3/snippets/Gemfile create mode 100644 owl-bot-staging/google-cloud-resource_manager-v3/snippets/folders/create_folder.rb create mode 100644 owl-bot-staging/google-cloud-resource_manager-v3/snippets/folders/delete_folder.rb create mode 100644 owl-bot-staging/google-cloud-resource_manager-v3/snippets/folders/get_folder.rb create mode 100644 owl-bot-staging/google-cloud-resource_manager-v3/snippets/folders/get_iam_policy.rb create mode 100644 owl-bot-staging/google-cloud-resource_manager-v3/snippets/folders/list_folders.rb create mode 100644 owl-bot-staging/google-cloud-resource_manager-v3/snippets/folders/move_folder.rb create mode 100644 owl-bot-staging/google-cloud-resource_manager-v3/snippets/folders/search_folders.rb create mode 100644 owl-bot-staging/google-cloud-resource_manager-v3/snippets/folders/set_iam_policy.rb create mode 100644 owl-bot-staging/google-cloud-resource_manager-v3/snippets/folders/test_iam_permissions.rb create mode 100644 owl-bot-staging/google-cloud-resource_manager-v3/snippets/folders/undelete_folder.rb create mode 100644 owl-bot-staging/google-cloud-resource_manager-v3/snippets/folders/update_folder.rb create mode 100644 owl-bot-staging/google-cloud-resource_manager-v3/snippets/organizations/get_iam_policy.rb create mode 100644 owl-bot-staging/google-cloud-resource_manager-v3/snippets/organizations/get_organization.rb create mode 100644 owl-bot-staging/google-cloud-resource_manager-v3/snippets/organizations/search_organizations.rb create mode 100644 owl-bot-staging/google-cloud-resource_manager-v3/snippets/organizations/set_iam_policy.rb create mode 100644 owl-bot-staging/google-cloud-resource_manager-v3/snippets/organizations/test_iam_permissions.rb create mode 100644 owl-bot-staging/google-cloud-resource_manager-v3/snippets/projects/create_project.rb create mode 100644 owl-bot-staging/google-cloud-resource_manager-v3/snippets/projects/delete_project.rb create mode 100644 owl-bot-staging/google-cloud-resource_manager-v3/snippets/projects/get_iam_policy.rb create mode 100644 owl-bot-staging/google-cloud-resource_manager-v3/snippets/projects/get_project.rb create mode 100644 owl-bot-staging/google-cloud-resource_manager-v3/snippets/projects/list_projects.rb create mode 100644 owl-bot-staging/google-cloud-resource_manager-v3/snippets/projects/move_project.rb create mode 100644 owl-bot-staging/google-cloud-resource_manager-v3/snippets/projects/search_projects.rb create mode 100644 owl-bot-staging/google-cloud-resource_manager-v3/snippets/projects/set_iam_policy.rb create mode 100644 owl-bot-staging/google-cloud-resource_manager-v3/snippets/projects/test_iam_permissions.rb create mode 100644 owl-bot-staging/google-cloud-resource_manager-v3/snippets/projects/undelete_project.rb create mode 100644 owl-bot-staging/google-cloud-resource_manager-v3/snippets/projects/update_project.rb create mode 100644 owl-bot-staging/google-cloud-resource_manager-v3/snippets/snippet_metadata_google.cloud.resourcemanager.v3.json create mode 100644 owl-bot-staging/google-cloud-resource_manager-v3/snippets/tag_bindings/create_tag_binding.rb create mode 100644 owl-bot-staging/google-cloud-resource_manager-v3/snippets/tag_bindings/delete_tag_binding.rb create mode 100644 owl-bot-staging/google-cloud-resource_manager-v3/snippets/tag_bindings/list_effective_tags.rb create mode 100644 owl-bot-staging/google-cloud-resource_manager-v3/snippets/tag_bindings/list_tag_bindings.rb create mode 100644 owl-bot-staging/google-cloud-resource_manager-v3/snippets/tag_holds/create_tag_hold.rb create mode 100644 owl-bot-staging/google-cloud-resource_manager-v3/snippets/tag_holds/delete_tag_hold.rb create mode 100644 owl-bot-staging/google-cloud-resource_manager-v3/snippets/tag_holds/list_tag_holds.rb create mode 100644 owl-bot-staging/google-cloud-resource_manager-v3/snippets/tag_keys/create_tag_key.rb create mode 100644 owl-bot-staging/google-cloud-resource_manager-v3/snippets/tag_keys/delete_tag_key.rb create mode 100644 owl-bot-staging/google-cloud-resource_manager-v3/snippets/tag_keys/get_iam_policy.rb create mode 100644 owl-bot-staging/google-cloud-resource_manager-v3/snippets/tag_keys/get_namespaced_tag_key.rb create mode 100644 owl-bot-staging/google-cloud-resource_manager-v3/snippets/tag_keys/get_tag_key.rb create mode 100644 owl-bot-staging/google-cloud-resource_manager-v3/snippets/tag_keys/list_tag_keys.rb create mode 100644 owl-bot-staging/google-cloud-resource_manager-v3/snippets/tag_keys/set_iam_policy.rb create mode 100644 owl-bot-staging/google-cloud-resource_manager-v3/snippets/tag_keys/test_iam_permissions.rb create mode 100644 owl-bot-staging/google-cloud-resource_manager-v3/snippets/tag_keys/update_tag_key.rb create mode 100644 owl-bot-staging/google-cloud-resource_manager-v3/snippets/tag_values/create_tag_value.rb create mode 100644 owl-bot-staging/google-cloud-resource_manager-v3/snippets/tag_values/delete_tag_value.rb create mode 100644 owl-bot-staging/google-cloud-resource_manager-v3/snippets/tag_values/get_iam_policy.rb create mode 100644 owl-bot-staging/google-cloud-resource_manager-v3/snippets/tag_values/get_namespaced_tag_value.rb create mode 100644 owl-bot-staging/google-cloud-resource_manager-v3/snippets/tag_values/get_tag_value.rb create mode 100644 owl-bot-staging/google-cloud-resource_manager-v3/snippets/tag_values/list_tag_values.rb create mode 100644 owl-bot-staging/google-cloud-resource_manager-v3/snippets/tag_values/set_iam_policy.rb create mode 100644 owl-bot-staging/google-cloud-resource_manager-v3/snippets/tag_values/test_iam_permissions.rb create mode 100644 owl-bot-staging/google-cloud-resource_manager-v3/snippets/tag_values/update_tag_value.rb create mode 100644 owl-bot-staging/google-cloud-resource_manager-v3/test/google/cloud/resource_manager/v3/folders_operations_test.rb create mode 100644 owl-bot-staging/google-cloud-resource_manager-v3/test/google/cloud/resource_manager/v3/folders_paths_test.rb create mode 100644 owl-bot-staging/google-cloud-resource_manager-v3/test/google/cloud/resource_manager/v3/folders_rest_test.rb create mode 100644 owl-bot-staging/google-cloud-resource_manager-v3/test/google/cloud/resource_manager/v3/folders_test.rb create mode 100644 owl-bot-staging/google-cloud-resource_manager-v3/test/google/cloud/resource_manager/v3/organizations_paths_test.rb create mode 100644 owl-bot-staging/google-cloud-resource_manager-v3/test/google/cloud/resource_manager/v3/organizations_rest_test.rb create mode 100644 owl-bot-staging/google-cloud-resource_manager-v3/test/google/cloud/resource_manager/v3/organizations_test.rb create mode 100644 owl-bot-staging/google-cloud-resource_manager-v3/test/google/cloud/resource_manager/v3/projects_operations_test.rb create mode 100644 owl-bot-staging/google-cloud-resource_manager-v3/test/google/cloud/resource_manager/v3/projects_paths_test.rb create mode 100644 owl-bot-staging/google-cloud-resource_manager-v3/test/google/cloud/resource_manager/v3/projects_rest_test.rb create mode 100644 owl-bot-staging/google-cloud-resource_manager-v3/test/google/cloud/resource_manager/v3/projects_test.rb create mode 100644 owl-bot-staging/google-cloud-resource_manager-v3/test/google/cloud/resource_manager/v3/tag_bindings_operations_test.rb create mode 100644 owl-bot-staging/google-cloud-resource_manager-v3/test/google/cloud/resource_manager/v3/tag_bindings_paths_test.rb create mode 100644 owl-bot-staging/google-cloud-resource_manager-v3/test/google/cloud/resource_manager/v3/tag_bindings_rest_test.rb create mode 100644 owl-bot-staging/google-cloud-resource_manager-v3/test/google/cloud/resource_manager/v3/tag_bindings_test.rb create mode 100644 owl-bot-staging/google-cloud-resource_manager-v3/test/google/cloud/resource_manager/v3/tag_holds_operations_test.rb create mode 100644 owl-bot-staging/google-cloud-resource_manager-v3/test/google/cloud/resource_manager/v3/tag_holds_paths_test.rb create mode 100644 owl-bot-staging/google-cloud-resource_manager-v3/test/google/cloud/resource_manager/v3/tag_holds_rest_test.rb create mode 100644 owl-bot-staging/google-cloud-resource_manager-v3/test/google/cloud/resource_manager/v3/tag_holds_test.rb create mode 100644 owl-bot-staging/google-cloud-resource_manager-v3/test/google/cloud/resource_manager/v3/tag_keys_operations_test.rb create mode 100644 owl-bot-staging/google-cloud-resource_manager-v3/test/google/cloud/resource_manager/v3/tag_keys_paths_test.rb create mode 100644 owl-bot-staging/google-cloud-resource_manager-v3/test/google/cloud/resource_manager/v3/tag_keys_rest_test.rb create mode 100644 owl-bot-staging/google-cloud-resource_manager-v3/test/google/cloud/resource_manager/v3/tag_keys_test.rb create mode 100644 owl-bot-staging/google-cloud-resource_manager-v3/test/google/cloud/resource_manager/v3/tag_values_operations_test.rb create mode 100644 owl-bot-staging/google-cloud-resource_manager-v3/test/google/cloud/resource_manager/v3/tag_values_paths_test.rb create mode 100644 owl-bot-staging/google-cloud-resource_manager-v3/test/google/cloud/resource_manager/v3/tag_values_rest_test.rb create mode 100644 owl-bot-staging/google-cloud-resource_manager-v3/test/google/cloud/resource_manager/v3/tag_values_test.rb create mode 100644 owl-bot-staging/google-cloud-resource_manager-v3/test/helper.rb create mode 100644 owl-bot-staging/google-cloud-retail-v2/.gitignore create mode 100644 owl-bot-staging/google-cloud-retail-v2/.repo-metadata.json create mode 100644 owl-bot-staging/google-cloud-retail-v2/.rubocop.yml create mode 100644 owl-bot-staging/google-cloud-retail-v2/.toys.rb create mode 100644 owl-bot-staging/google-cloud-retail-v2/.yardopts create mode 100644 owl-bot-staging/google-cloud-retail-v2/AUTHENTICATION.md create mode 100644 owl-bot-staging/google-cloud-retail-v2/CHANGELOG.md create mode 100644 owl-bot-staging/google-cloud-retail-v2/Gemfile create mode 100644 owl-bot-staging/google-cloud-retail-v2/LICENSE.md create mode 100644 owl-bot-staging/google-cloud-retail-v2/README.md create mode 100644 owl-bot-staging/google-cloud-retail-v2/Rakefile create mode 100644 owl-bot-staging/google-cloud-retail-v2/gapic_metadata.json create mode 100644 owl-bot-staging/google-cloud-retail-v2/google-cloud-retail-v2.gemspec create mode 100644 owl-bot-staging/google-cloud-retail-v2/lib/google-cloud-retail-v2.rb create mode 100644 owl-bot-staging/google-cloud-retail-v2/lib/google/cloud/retail/v2.rb create mode 100644 owl-bot-staging/google-cloud-retail-v2/lib/google/cloud/retail/v2/analytics_service.rb create mode 100644 owl-bot-staging/google-cloud-retail-v2/lib/google/cloud/retail/v2/analytics_service/client.rb create mode 100644 owl-bot-staging/google-cloud-retail-v2/lib/google/cloud/retail/v2/analytics_service/credentials.rb create mode 100644 owl-bot-staging/google-cloud-retail-v2/lib/google/cloud/retail/v2/analytics_service/operations.rb create mode 100644 owl-bot-staging/google-cloud-retail-v2/lib/google/cloud/retail/v2/analytics_service/rest.rb create mode 100644 owl-bot-staging/google-cloud-retail-v2/lib/google/cloud/retail/v2/analytics_service/rest/client.rb create mode 100644 owl-bot-staging/google-cloud-retail-v2/lib/google/cloud/retail/v2/analytics_service/rest/operations.rb create mode 100644 owl-bot-staging/google-cloud-retail-v2/lib/google/cloud/retail/v2/analytics_service/rest/service_stub.rb create mode 100644 owl-bot-staging/google-cloud-retail-v2/lib/google/cloud/retail/v2/analytics_service_pb.rb create mode 100644 owl-bot-staging/google-cloud-retail-v2/lib/google/cloud/retail/v2/analytics_service_services_pb.rb create mode 100644 owl-bot-staging/google-cloud-retail-v2/lib/google/cloud/retail/v2/catalog_pb.rb create mode 100644 owl-bot-staging/google-cloud-retail-v2/lib/google/cloud/retail/v2/catalog_service.rb create mode 100644 owl-bot-staging/google-cloud-retail-v2/lib/google/cloud/retail/v2/catalog_service/client.rb create mode 100644 owl-bot-staging/google-cloud-retail-v2/lib/google/cloud/retail/v2/catalog_service/credentials.rb create mode 100644 owl-bot-staging/google-cloud-retail-v2/lib/google/cloud/retail/v2/catalog_service/paths.rb create mode 100644 owl-bot-staging/google-cloud-retail-v2/lib/google/cloud/retail/v2/catalog_service/rest.rb create mode 100644 owl-bot-staging/google-cloud-retail-v2/lib/google/cloud/retail/v2/catalog_service/rest/client.rb create mode 100644 owl-bot-staging/google-cloud-retail-v2/lib/google/cloud/retail/v2/catalog_service/rest/service_stub.rb create mode 100644 owl-bot-staging/google-cloud-retail-v2/lib/google/cloud/retail/v2/catalog_service_pb.rb create mode 100644 owl-bot-staging/google-cloud-retail-v2/lib/google/cloud/retail/v2/catalog_service_services_pb.rb create mode 100644 owl-bot-staging/google-cloud-retail-v2/lib/google/cloud/retail/v2/common_pb.rb create mode 100644 owl-bot-staging/google-cloud-retail-v2/lib/google/cloud/retail/v2/completion_service.rb create mode 100644 owl-bot-staging/google-cloud-retail-v2/lib/google/cloud/retail/v2/completion_service/client.rb create mode 100644 owl-bot-staging/google-cloud-retail-v2/lib/google/cloud/retail/v2/completion_service/credentials.rb create mode 100644 owl-bot-staging/google-cloud-retail-v2/lib/google/cloud/retail/v2/completion_service/operations.rb create mode 100644 owl-bot-staging/google-cloud-retail-v2/lib/google/cloud/retail/v2/completion_service/paths.rb create mode 100644 owl-bot-staging/google-cloud-retail-v2/lib/google/cloud/retail/v2/completion_service/rest.rb create mode 100644 owl-bot-staging/google-cloud-retail-v2/lib/google/cloud/retail/v2/completion_service/rest/client.rb create mode 100644 owl-bot-staging/google-cloud-retail-v2/lib/google/cloud/retail/v2/completion_service/rest/operations.rb create mode 100644 owl-bot-staging/google-cloud-retail-v2/lib/google/cloud/retail/v2/completion_service/rest/service_stub.rb create mode 100644 owl-bot-staging/google-cloud-retail-v2/lib/google/cloud/retail/v2/completion_service_pb.rb create mode 100644 owl-bot-staging/google-cloud-retail-v2/lib/google/cloud/retail/v2/completion_service_services_pb.rb create mode 100644 owl-bot-staging/google-cloud-retail-v2/lib/google/cloud/retail/v2/control_pb.rb create mode 100644 owl-bot-staging/google-cloud-retail-v2/lib/google/cloud/retail/v2/control_service.rb create mode 100644 owl-bot-staging/google-cloud-retail-v2/lib/google/cloud/retail/v2/control_service/client.rb create mode 100644 owl-bot-staging/google-cloud-retail-v2/lib/google/cloud/retail/v2/control_service/credentials.rb create mode 100644 owl-bot-staging/google-cloud-retail-v2/lib/google/cloud/retail/v2/control_service/paths.rb create mode 100644 owl-bot-staging/google-cloud-retail-v2/lib/google/cloud/retail/v2/control_service/rest.rb create mode 100644 owl-bot-staging/google-cloud-retail-v2/lib/google/cloud/retail/v2/control_service/rest/client.rb create mode 100644 owl-bot-staging/google-cloud-retail-v2/lib/google/cloud/retail/v2/control_service/rest/service_stub.rb create mode 100644 owl-bot-staging/google-cloud-retail-v2/lib/google/cloud/retail/v2/control_service_pb.rb create mode 100644 owl-bot-staging/google-cloud-retail-v2/lib/google/cloud/retail/v2/control_service_services_pb.rb create mode 100644 owl-bot-staging/google-cloud-retail-v2/lib/google/cloud/retail/v2/conversational_search_service.rb create mode 100644 owl-bot-staging/google-cloud-retail-v2/lib/google/cloud/retail/v2/conversational_search_service/client.rb create mode 100644 owl-bot-staging/google-cloud-retail-v2/lib/google/cloud/retail/v2/conversational_search_service/credentials.rb create mode 100644 owl-bot-staging/google-cloud-retail-v2/lib/google/cloud/retail/v2/conversational_search_service/paths.rb create mode 100644 owl-bot-staging/google-cloud-retail-v2/lib/google/cloud/retail/v2/conversational_search_service/rest.rb create mode 100644 owl-bot-staging/google-cloud-retail-v2/lib/google/cloud/retail/v2/conversational_search_service/rest/client.rb create mode 100644 owl-bot-staging/google-cloud-retail-v2/lib/google/cloud/retail/v2/conversational_search_service/rest/service_stub.rb create mode 100644 owl-bot-staging/google-cloud-retail-v2/lib/google/cloud/retail/v2/conversational_search_service_pb.rb create mode 100644 owl-bot-staging/google-cloud-retail-v2/lib/google/cloud/retail/v2/conversational_search_service_services_pb.rb create mode 100644 owl-bot-staging/google-cloud-retail-v2/lib/google/cloud/retail/v2/export_config_pb.rb create mode 100644 owl-bot-staging/google-cloud-retail-v2/lib/google/cloud/retail/v2/generative_question_pb.rb create mode 100644 owl-bot-staging/google-cloud-retail-v2/lib/google/cloud/retail/v2/generative_question_service.rb create mode 100644 owl-bot-staging/google-cloud-retail-v2/lib/google/cloud/retail/v2/generative_question_service/client.rb create mode 100644 owl-bot-staging/google-cloud-retail-v2/lib/google/cloud/retail/v2/generative_question_service/credentials.rb create mode 100644 owl-bot-staging/google-cloud-retail-v2/lib/google/cloud/retail/v2/generative_question_service/paths.rb create mode 100644 owl-bot-staging/google-cloud-retail-v2/lib/google/cloud/retail/v2/generative_question_service/rest.rb create mode 100644 owl-bot-staging/google-cloud-retail-v2/lib/google/cloud/retail/v2/generative_question_service/rest/client.rb create mode 100644 owl-bot-staging/google-cloud-retail-v2/lib/google/cloud/retail/v2/generative_question_service/rest/service_stub.rb create mode 100644 owl-bot-staging/google-cloud-retail-v2/lib/google/cloud/retail/v2/generative_question_service_pb.rb create mode 100644 owl-bot-staging/google-cloud-retail-v2/lib/google/cloud/retail/v2/generative_question_service_services_pb.rb create mode 100644 owl-bot-staging/google-cloud-retail-v2/lib/google/cloud/retail/v2/import_config_pb.rb create mode 100644 owl-bot-staging/google-cloud-retail-v2/lib/google/cloud/retail/v2/model_pb.rb create mode 100644 owl-bot-staging/google-cloud-retail-v2/lib/google/cloud/retail/v2/model_service.rb create mode 100644 owl-bot-staging/google-cloud-retail-v2/lib/google/cloud/retail/v2/model_service/client.rb create mode 100644 owl-bot-staging/google-cloud-retail-v2/lib/google/cloud/retail/v2/model_service/credentials.rb create mode 100644 owl-bot-staging/google-cloud-retail-v2/lib/google/cloud/retail/v2/model_service/operations.rb create mode 100644 owl-bot-staging/google-cloud-retail-v2/lib/google/cloud/retail/v2/model_service/paths.rb create mode 100644 owl-bot-staging/google-cloud-retail-v2/lib/google/cloud/retail/v2/model_service/rest.rb create mode 100644 owl-bot-staging/google-cloud-retail-v2/lib/google/cloud/retail/v2/model_service/rest/client.rb create mode 100644 owl-bot-staging/google-cloud-retail-v2/lib/google/cloud/retail/v2/model_service/rest/operations.rb create mode 100644 owl-bot-staging/google-cloud-retail-v2/lib/google/cloud/retail/v2/model_service/rest/service_stub.rb create mode 100644 owl-bot-staging/google-cloud-retail-v2/lib/google/cloud/retail/v2/model_service_pb.rb create mode 100644 owl-bot-staging/google-cloud-retail-v2/lib/google/cloud/retail/v2/model_service_services_pb.rb create mode 100644 owl-bot-staging/google-cloud-retail-v2/lib/google/cloud/retail/v2/prediction_service.rb create mode 100644 owl-bot-staging/google-cloud-retail-v2/lib/google/cloud/retail/v2/prediction_service/client.rb create mode 100644 owl-bot-staging/google-cloud-retail-v2/lib/google/cloud/retail/v2/prediction_service/credentials.rb create mode 100644 owl-bot-staging/google-cloud-retail-v2/lib/google/cloud/retail/v2/prediction_service/paths.rb create mode 100644 owl-bot-staging/google-cloud-retail-v2/lib/google/cloud/retail/v2/prediction_service/rest.rb create mode 100644 owl-bot-staging/google-cloud-retail-v2/lib/google/cloud/retail/v2/prediction_service/rest/client.rb create mode 100644 owl-bot-staging/google-cloud-retail-v2/lib/google/cloud/retail/v2/prediction_service/rest/service_stub.rb create mode 100644 owl-bot-staging/google-cloud-retail-v2/lib/google/cloud/retail/v2/prediction_service_pb.rb create mode 100644 owl-bot-staging/google-cloud-retail-v2/lib/google/cloud/retail/v2/prediction_service_services_pb.rb create mode 100644 owl-bot-staging/google-cloud-retail-v2/lib/google/cloud/retail/v2/product_pb.rb create mode 100644 owl-bot-staging/google-cloud-retail-v2/lib/google/cloud/retail/v2/product_service.rb create mode 100644 owl-bot-staging/google-cloud-retail-v2/lib/google/cloud/retail/v2/product_service/client.rb create mode 100644 owl-bot-staging/google-cloud-retail-v2/lib/google/cloud/retail/v2/product_service/credentials.rb create mode 100644 owl-bot-staging/google-cloud-retail-v2/lib/google/cloud/retail/v2/product_service/operations.rb create mode 100644 owl-bot-staging/google-cloud-retail-v2/lib/google/cloud/retail/v2/product_service/paths.rb create mode 100644 owl-bot-staging/google-cloud-retail-v2/lib/google/cloud/retail/v2/product_service/rest.rb create mode 100644 owl-bot-staging/google-cloud-retail-v2/lib/google/cloud/retail/v2/product_service/rest/client.rb create mode 100644 owl-bot-staging/google-cloud-retail-v2/lib/google/cloud/retail/v2/product_service/rest/operations.rb create mode 100644 owl-bot-staging/google-cloud-retail-v2/lib/google/cloud/retail/v2/product_service/rest/service_stub.rb create mode 100644 owl-bot-staging/google-cloud-retail-v2/lib/google/cloud/retail/v2/product_service_pb.rb create mode 100644 owl-bot-staging/google-cloud-retail-v2/lib/google/cloud/retail/v2/product_service_services_pb.rb create mode 100644 owl-bot-staging/google-cloud-retail-v2/lib/google/cloud/retail/v2/promotion_pb.rb create mode 100644 owl-bot-staging/google-cloud-retail-v2/lib/google/cloud/retail/v2/purge_config_pb.rb create mode 100644 owl-bot-staging/google-cloud-retail-v2/lib/google/cloud/retail/v2/rest.rb create mode 100644 owl-bot-staging/google-cloud-retail-v2/lib/google/cloud/retail/v2/safety_pb.rb create mode 100644 owl-bot-staging/google-cloud-retail-v2/lib/google/cloud/retail/v2/search_service.rb create mode 100644 owl-bot-staging/google-cloud-retail-v2/lib/google/cloud/retail/v2/search_service/client.rb create mode 100644 owl-bot-staging/google-cloud-retail-v2/lib/google/cloud/retail/v2/search_service/credentials.rb create mode 100644 owl-bot-staging/google-cloud-retail-v2/lib/google/cloud/retail/v2/search_service/paths.rb create mode 100644 owl-bot-staging/google-cloud-retail-v2/lib/google/cloud/retail/v2/search_service/rest.rb create mode 100644 owl-bot-staging/google-cloud-retail-v2/lib/google/cloud/retail/v2/search_service/rest/client.rb create mode 100644 owl-bot-staging/google-cloud-retail-v2/lib/google/cloud/retail/v2/search_service/rest/service_stub.rb create mode 100644 owl-bot-staging/google-cloud-retail-v2/lib/google/cloud/retail/v2/search_service_pb.rb create mode 100644 owl-bot-staging/google-cloud-retail-v2/lib/google/cloud/retail/v2/search_service_services_pb.rb create mode 100644 owl-bot-staging/google-cloud-retail-v2/lib/google/cloud/retail/v2/serving_config_pb.rb create mode 100644 owl-bot-staging/google-cloud-retail-v2/lib/google/cloud/retail/v2/serving_config_service.rb create mode 100644 owl-bot-staging/google-cloud-retail-v2/lib/google/cloud/retail/v2/serving_config_service/client.rb create mode 100644 owl-bot-staging/google-cloud-retail-v2/lib/google/cloud/retail/v2/serving_config_service/credentials.rb create mode 100644 owl-bot-staging/google-cloud-retail-v2/lib/google/cloud/retail/v2/serving_config_service/paths.rb create mode 100644 owl-bot-staging/google-cloud-retail-v2/lib/google/cloud/retail/v2/serving_config_service/rest.rb create mode 100644 owl-bot-staging/google-cloud-retail-v2/lib/google/cloud/retail/v2/serving_config_service/rest/client.rb create mode 100644 owl-bot-staging/google-cloud-retail-v2/lib/google/cloud/retail/v2/serving_config_service/rest/service_stub.rb create mode 100644 owl-bot-staging/google-cloud-retail-v2/lib/google/cloud/retail/v2/serving_config_service_pb.rb create mode 100644 owl-bot-staging/google-cloud-retail-v2/lib/google/cloud/retail/v2/serving_config_service_services_pb.rb create mode 100644 owl-bot-staging/google-cloud-retail-v2/lib/google/cloud/retail/v2/user_event_pb.rb create mode 100644 owl-bot-staging/google-cloud-retail-v2/lib/google/cloud/retail/v2/user_event_service.rb create mode 100644 owl-bot-staging/google-cloud-retail-v2/lib/google/cloud/retail/v2/user_event_service/client.rb create mode 100644 owl-bot-staging/google-cloud-retail-v2/lib/google/cloud/retail/v2/user_event_service/credentials.rb create mode 100644 owl-bot-staging/google-cloud-retail-v2/lib/google/cloud/retail/v2/user_event_service/operations.rb create mode 100644 owl-bot-staging/google-cloud-retail-v2/lib/google/cloud/retail/v2/user_event_service/paths.rb create mode 100644 owl-bot-staging/google-cloud-retail-v2/lib/google/cloud/retail/v2/user_event_service/rest.rb create mode 100644 owl-bot-staging/google-cloud-retail-v2/lib/google/cloud/retail/v2/user_event_service/rest/client.rb create mode 100644 owl-bot-staging/google-cloud-retail-v2/lib/google/cloud/retail/v2/user_event_service/rest/operations.rb create mode 100644 owl-bot-staging/google-cloud-retail-v2/lib/google/cloud/retail/v2/user_event_service/rest/service_stub.rb create mode 100644 owl-bot-staging/google-cloud-retail-v2/lib/google/cloud/retail/v2/user_event_service_pb.rb create mode 100644 owl-bot-staging/google-cloud-retail-v2/lib/google/cloud/retail/v2/user_event_service_services_pb.rb create mode 100644 owl-bot-staging/google-cloud-retail-v2/lib/google/cloud/retail/v2/version.rb create mode 100644 owl-bot-staging/google-cloud-retail-v2/proto_docs/README.md create mode 100644 owl-bot-staging/google-cloud-retail-v2/proto_docs/google/api/client.rb create mode 100644 owl-bot-staging/google-cloud-retail-v2/proto_docs/google/api/field_behavior.rb create mode 100644 owl-bot-staging/google-cloud-retail-v2/proto_docs/google/api/httpbody.rb create mode 100644 owl-bot-staging/google-cloud-retail-v2/proto_docs/google/api/launch_stage.rb create mode 100644 owl-bot-staging/google-cloud-retail-v2/proto_docs/google/api/resource.rb create mode 100644 owl-bot-staging/google-cloud-retail-v2/proto_docs/google/cloud/retail/v2/catalog.rb create mode 100644 owl-bot-staging/google-cloud-retail-v2/proto_docs/google/cloud/retail/v2/catalog_service.rb create mode 100644 owl-bot-staging/google-cloud-retail-v2/proto_docs/google/cloud/retail/v2/common.rb create mode 100644 owl-bot-staging/google-cloud-retail-v2/proto_docs/google/cloud/retail/v2/completion_service.rb create mode 100644 owl-bot-staging/google-cloud-retail-v2/proto_docs/google/cloud/retail/v2/control.rb create mode 100644 owl-bot-staging/google-cloud-retail-v2/proto_docs/google/cloud/retail/v2/control_service.rb create mode 100644 owl-bot-staging/google-cloud-retail-v2/proto_docs/google/cloud/retail/v2/conversational_search_service.rb create mode 100644 owl-bot-staging/google-cloud-retail-v2/proto_docs/google/cloud/retail/v2/export_config.rb create mode 100644 owl-bot-staging/google-cloud-retail-v2/proto_docs/google/cloud/retail/v2/generative_question.rb create mode 100644 owl-bot-staging/google-cloud-retail-v2/proto_docs/google/cloud/retail/v2/generative_question_service.rb create mode 100644 owl-bot-staging/google-cloud-retail-v2/proto_docs/google/cloud/retail/v2/import_config.rb create mode 100644 owl-bot-staging/google-cloud-retail-v2/proto_docs/google/cloud/retail/v2/model.rb create mode 100644 owl-bot-staging/google-cloud-retail-v2/proto_docs/google/cloud/retail/v2/model_service.rb create mode 100644 owl-bot-staging/google-cloud-retail-v2/proto_docs/google/cloud/retail/v2/prediction_service.rb create mode 100644 owl-bot-staging/google-cloud-retail-v2/proto_docs/google/cloud/retail/v2/product.rb create mode 100644 owl-bot-staging/google-cloud-retail-v2/proto_docs/google/cloud/retail/v2/product_service.rb create mode 100644 owl-bot-staging/google-cloud-retail-v2/proto_docs/google/cloud/retail/v2/promotion.rb create mode 100644 owl-bot-staging/google-cloud-retail-v2/proto_docs/google/cloud/retail/v2/purge_config.rb create mode 100644 owl-bot-staging/google-cloud-retail-v2/proto_docs/google/cloud/retail/v2/safety.rb create mode 100644 owl-bot-staging/google-cloud-retail-v2/proto_docs/google/cloud/retail/v2/search_service.rb create mode 100644 owl-bot-staging/google-cloud-retail-v2/proto_docs/google/cloud/retail/v2/serving_config.rb create mode 100644 owl-bot-staging/google-cloud-retail-v2/proto_docs/google/cloud/retail/v2/serving_config_service.rb create mode 100644 owl-bot-staging/google-cloud-retail-v2/proto_docs/google/cloud/retail/v2/user_event.rb create mode 100644 owl-bot-staging/google-cloud-retail-v2/proto_docs/google/cloud/retail/v2/user_event_service.rb create mode 100644 owl-bot-staging/google-cloud-retail-v2/proto_docs/google/longrunning/operations.rb create mode 100644 owl-bot-staging/google-cloud-retail-v2/proto_docs/google/protobuf/any.rb create mode 100644 owl-bot-staging/google-cloud-retail-v2/proto_docs/google/protobuf/duration.rb create mode 100644 owl-bot-staging/google-cloud-retail-v2/proto_docs/google/protobuf/empty.rb create mode 100644 owl-bot-staging/google-cloud-retail-v2/proto_docs/google/protobuf/field_mask.rb create mode 100644 owl-bot-staging/google-cloud-retail-v2/proto_docs/google/protobuf/struct.rb create mode 100644 owl-bot-staging/google-cloud-retail-v2/proto_docs/google/protobuf/timestamp.rb create mode 100644 owl-bot-staging/google-cloud-retail-v2/proto_docs/google/protobuf/wrappers.rb create mode 100644 owl-bot-staging/google-cloud-retail-v2/proto_docs/google/rpc/status.rb create mode 100644 owl-bot-staging/google-cloud-retail-v2/proto_docs/google/type/date.rb create mode 100644 owl-bot-staging/google-cloud-retail-v2/snippets/Gemfile create mode 100644 owl-bot-staging/google-cloud-retail-v2/snippets/analytics_service/export_analytics_metrics.rb create mode 100644 owl-bot-staging/google-cloud-retail-v2/snippets/catalog_service/add_catalog_attribute.rb create mode 100644 owl-bot-staging/google-cloud-retail-v2/snippets/catalog_service/get_attributes_config.rb create mode 100644 owl-bot-staging/google-cloud-retail-v2/snippets/catalog_service/get_completion_config.rb create mode 100644 owl-bot-staging/google-cloud-retail-v2/snippets/catalog_service/get_default_branch.rb create mode 100644 owl-bot-staging/google-cloud-retail-v2/snippets/catalog_service/list_catalogs.rb create mode 100644 owl-bot-staging/google-cloud-retail-v2/snippets/catalog_service/remove_catalog_attribute.rb create mode 100644 owl-bot-staging/google-cloud-retail-v2/snippets/catalog_service/replace_catalog_attribute.rb create mode 100644 owl-bot-staging/google-cloud-retail-v2/snippets/catalog_service/set_default_branch.rb create mode 100644 owl-bot-staging/google-cloud-retail-v2/snippets/catalog_service/update_attributes_config.rb create mode 100644 owl-bot-staging/google-cloud-retail-v2/snippets/catalog_service/update_catalog.rb create mode 100644 owl-bot-staging/google-cloud-retail-v2/snippets/catalog_service/update_completion_config.rb create mode 100644 owl-bot-staging/google-cloud-retail-v2/snippets/completion_service/complete_query.rb create mode 100644 owl-bot-staging/google-cloud-retail-v2/snippets/completion_service/import_completion_data.rb create mode 100644 owl-bot-staging/google-cloud-retail-v2/snippets/control_service/create_control.rb create mode 100644 owl-bot-staging/google-cloud-retail-v2/snippets/control_service/delete_control.rb create mode 100644 owl-bot-staging/google-cloud-retail-v2/snippets/control_service/get_control.rb create mode 100644 owl-bot-staging/google-cloud-retail-v2/snippets/control_service/list_controls.rb create mode 100644 owl-bot-staging/google-cloud-retail-v2/snippets/control_service/update_control.rb create mode 100644 owl-bot-staging/google-cloud-retail-v2/snippets/conversational_search_service/conversational_search.rb create mode 100644 owl-bot-staging/google-cloud-retail-v2/snippets/generative_question_service/batch_update_generative_question_configs.rb create mode 100644 owl-bot-staging/google-cloud-retail-v2/snippets/generative_question_service/get_generative_questions_feature_config.rb create mode 100644 owl-bot-staging/google-cloud-retail-v2/snippets/generative_question_service/list_generative_question_configs.rb create mode 100644 owl-bot-staging/google-cloud-retail-v2/snippets/generative_question_service/update_generative_question_config.rb create mode 100644 owl-bot-staging/google-cloud-retail-v2/snippets/generative_question_service/update_generative_questions_feature_config.rb create mode 100644 owl-bot-staging/google-cloud-retail-v2/snippets/model_service/create_model.rb create mode 100644 owl-bot-staging/google-cloud-retail-v2/snippets/model_service/delete_model.rb create mode 100644 owl-bot-staging/google-cloud-retail-v2/snippets/model_service/get_model.rb create mode 100644 owl-bot-staging/google-cloud-retail-v2/snippets/model_service/list_models.rb create mode 100644 owl-bot-staging/google-cloud-retail-v2/snippets/model_service/pause_model.rb create mode 100644 owl-bot-staging/google-cloud-retail-v2/snippets/model_service/resume_model.rb create mode 100644 owl-bot-staging/google-cloud-retail-v2/snippets/model_service/tune_model.rb create mode 100644 owl-bot-staging/google-cloud-retail-v2/snippets/model_service/update_model.rb create mode 100644 owl-bot-staging/google-cloud-retail-v2/snippets/prediction_service/predict.rb create mode 100644 owl-bot-staging/google-cloud-retail-v2/snippets/product_service/add_fulfillment_places.rb create mode 100644 owl-bot-staging/google-cloud-retail-v2/snippets/product_service/add_local_inventories.rb create mode 100644 owl-bot-staging/google-cloud-retail-v2/snippets/product_service/create_product.rb create mode 100644 owl-bot-staging/google-cloud-retail-v2/snippets/product_service/delete_product.rb create mode 100644 owl-bot-staging/google-cloud-retail-v2/snippets/product_service/get_product.rb create mode 100644 owl-bot-staging/google-cloud-retail-v2/snippets/product_service/import_products.rb create mode 100644 owl-bot-staging/google-cloud-retail-v2/snippets/product_service/list_products.rb create mode 100644 owl-bot-staging/google-cloud-retail-v2/snippets/product_service/purge_products.rb create mode 100644 owl-bot-staging/google-cloud-retail-v2/snippets/product_service/remove_fulfillment_places.rb create mode 100644 owl-bot-staging/google-cloud-retail-v2/snippets/product_service/remove_local_inventories.rb create mode 100644 owl-bot-staging/google-cloud-retail-v2/snippets/product_service/set_inventory.rb create mode 100644 owl-bot-staging/google-cloud-retail-v2/snippets/product_service/update_product.rb create mode 100644 owl-bot-staging/google-cloud-retail-v2/snippets/search_service/search.rb create mode 100644 owl-bot-staging/google-cloud-retail-v2/snippets/serving_config_service/add_control.rb create mode 100644 owl-bot-staging/google-cloud-retail-v2/snippets/serving_config_service/create_serving_config.rb create mode 100644 owl-bot-staging/google-cloud-retail-v2/snippets/serving_config_service/delete_serving_config.rb create mode 100644 owl-bot-staging/google-cloud-retail-v2/snippets/serving_config_service/get_serving_config.rb create mode 100644 owl-bot-staging/google-cloud-retail-v2/snippets/serving_config_service/list_serving_configs.rb create mode 100644 owl-bot-staging/google-cloud-retail-v2/snippets/serving_config_service/remove_control.rb create mode 100644 owl-bot-staging/google-cloud-retail-v2/snippets/serving_config_service/update_serving_config.rb create mode 100644 owl-bot-staging/google-cloud-retail-v2/snippets/snippet_metadata_google.cloud.retail.v2.json create mode 100644 owl-bot-staging/google-cloud-retail-v2/snippets/user_event_service/collect_user_event.rb create mode 100644 owl-bot-staging/google-cloud-retail-v2/snippets/user_event_service/import_user_events.rb create mode 100644 owl-bot-staging/google-cloud-retail-v2/snippets/user_event_service/purge_user_events.rb create mode 100644 owl-bot-staging/google-cloud-retail-v2/snippets/user_event_service/rejoin_user_events.rb create mode 100644 owl-bot-staging/google-cloud-retail-v2/snippets/user_event_service/write_user_event.rb create mode 100644 owl-bot-staging/google-cloud-retail-v2/test/google/cloud/retail/v2/analytics_service_operations_test.rb create mode 100644 owl-bot-staging/google-cloud-retail-v2/test/google/cloud/retail/v2/analytics_service_rest_test.rb create mode 100644 owl-bot-staging/google-cloud-retail-v2/test/google/cloud/retail/v2/analytics_service_test.rb create mode 100644 owl-bot-staging/google-cloud-retail-v2/test/google/cloud/retail/v2/catalog_service_paths_test.rb create mode 100644 owl-bot-staging/google-cloud-retail-v2/test/google/cloud/retail/v2/catalog_service_rest_test.rb create mode 100644 owl-bot-staging/google-cloud-retail-v2/test/google/cloud/retail/v2/catalog_service_test.rb create mode 100644 owl-bot-staging/google-cloud-retail-v2/test/google/cloud/retail/v2/completion_service_operations_test.rb create mode 100644 owl-bot-staging/google-cloud-retail-v2/test/google/cloud/retail/v2/completion_service_paths_test.rb create mode 100644 owl-bot-staging/google-cloud-retail-v2/test/google/cloud/retail/v2/completion_service_rest_test.rb create mode 100644 owl-bot-staging/google-cloud-retail-v2/test/google/cloud/retail/v2/completion_service_test.rb create mode 100644 owl-bot-staging/google-cloud-retail-v2/test/google/cloud/retail/v2/control_service_paths_test.rb create mode 100644 owl-bot-staging/google-cloud-retail-v2/test/google/cloud/retail/v2/control_service_rest_test.rb create mode 100644 owl-bot-staging/google-cloud-retail-v2/test/google/cloud/retail/v2/control_service_test.rb create mode 100644 owl-bot-staging/google-cloud-retail-v2/test/google/cloud/retail/v2/conversational_search_service_paths_test.rb create mode 100644 owl-bot-staging/google-cloud-retail-v2/test/google/cloud/retail/v2/conversational_search_service_rest_test.rb create mode 100644 owl-bot-staging/google-cloud-retail-v2/test/google/cloud/retail/v2/conversational_search_service_test.rb create mode 100644 owl-bot-staging/google-cloud-retail-v2/test/google/cloud/retail/v2/generative_question_service_paths_test.rb create mode 100644 owl-bot-staging/google-cloud-retail-v2/test/google/cloud/retail/v2/generative_question_service_rest_test.rb create mode 100644 owl-bot-staging/google-cloud-retail-v2/test/google/cloud/retail/v2/generative_question_service_test.rb create mode 100644 owl-bot-staging/google-cloud-retail-v2/test/google/cloud/retail/v2/model_service_operations_test.rb create mode 100644 owl-bot-staging/google-cloud-retail-v2/test/google/cloud/retail/v2/model_service_paths_test.rb create mode 100644 owl-bot-staging/google-cloud-retail-v2/test/google/cloud/retail/v2/model_service_rest_test.rb create mode 100644 owl-bot-staging/google-cloud-retail-v2/test/google/cloud/retail/v2/model_service_test.rb create mode 100644 owl-bot-staging/google-cloud-retail-v2/test/google/cloud/retail/v2/prediction_service_paths_test.rb create mode 100644 owl-bot-staging/google-cloud-retail-v2/test/google/cloud/retail/v2/prediction_service_rest_test.rb create mode 100644 owl-bot-staging/google-cloud-retail-v2/test/google/cloud/retail/v2/prediction_service_test.rb create mode 100644 owl-bot-staging/google-cloud-retail-v2/test/google/cloud/retail/v2/product_service_operations_test.rb create mode 100644 owl-bot-staging/google-cloud-retail-v2/test/google/cloud/retail/v2/product_service_paths_test.rb create mode 100644 owl-bot-staging/google-cloud-retail-v2/test/google/cloud/retail/v2/product_service_rest_test.rb create mode 100644 owl-bot-staging/google-cloud-retail-v2/test/google/cloud/retail/v2/product_service_test.rb create mode 100644 owl-bot-staging/google-cloud-retail-v2/test/google/cloud/retail/v2/search_service_paths_test.rb create mode 100644 owl-bot-staging/google-cloud-retail-v2/test/google/cloud/retail/v2/search_service_rest_test.rb create mode 100644 owl-bot-staging/google-cloud-retail-v2/test/google/cloud/retail/v2/search_service_test.rb create mode 100644 owl-bot-staging/google-cloud-retail-v2/test/google/cloud/retail/v2/serving_config_service_paths_test.rb create mode 100644 owl-bot-staging/google-cloud-retail-v2/test/google/cloud/retail/v2/serving_config_service_rest_test.rb create mode 100644 owl-bot-staging/google-cloud-retail-v2/test/google/cloud/retail/v2/serving_config_service_test.rb create mode 100644 owl-bot-staging/google-cloud-retail-v2/test/google/cloud/retail/v2/user_event_service_operations_test.rb create mode 100644 owl-bot-staging/google-cloud-retail-v2/test/google/cloud/retail/v2/user_event_service_paths_test.rb create mode 100644 owl-bot-staging/google-cloud-retail-v2/test/google/cloud/retail/v2/user_event_service_rest_test.rb create mode 100644 owl-bot-staging/google-cloud-retail-v2/test/google/cloud/retail/v2/user_event_service_test.rb create mode 100644 owl-bot-staging/google-cloud-retail-v2/test/helper.rb create mode 100644 owl-bot-staging/google-cloud-saas_platform-saas_service_mgmt-v1beta1/.gitignore create mode 100644 owl-bot-staging/google-cloud-saas_platform-saas_service_mgmt-v1beta1/.repo-metadata.json create mode 100644 owl-bot-staging/google-cloud-saas_platform-saas_service_mgmt-v1beta1/.rubocop.yml create mode 100644 owl-bot-staging/google-cloud-saas_platform-saas_service_mgmt-v1beta1/.toys.rb create mode 100644 owl-bot-staging/google-cloud-saas_platform-saas_service_mgmt-v1beta1/.yardopts create mode 100644 owl-bot-staging/google-cloud-saas_platform-saas_service_mgmt-v1beta1/AUTHENTICATION.md create mode 100644 owl-bot-staging/google-cloud-saas_platform-saas_service_mgmt-v1beta1/CHANGELOG.md create mode 100644 owl-bot-staging/google-cloud-saas_platform-saas_service_mgmt-v1beta1/Gemfile create mode 100644 owl-bot-staging/google-cloud-saas_platform-saas_service_mgmt-v1beta1/LICENSE.md create mode 100644 owl-bot-staging/google-cloud-saas_platform-saas_service_mgmt-v1beta1/README.md create mode 100644 owl-bot-staging/google-cloud-saas_platform-saas_service_mgmt-v1beta1/Rakefile create mode 100644 owl-bot-staging/google-cloud-saas_platform-saas_service_mgmt-v1beta1/gapic_metadata.json create mode 100644 owl-bot-staging/google-cloud-saas_platform-saas_service_mgmt-v1beta1/google-cloud-saas_platform-saas_service_mgmt-v1beta1.gemspec create mode 100644 owl-bot-staging/google-cloud-saas_platform-saas_service_mgmt-v1beta1/lib/google-cloud-saas_platform-saas_service_mgmt-v1beta1.rb create mode 100644 owl-bot-staging/google-cloud-saas_platform-saas_service_mgmt-v1beta1/lib/google/cloud/saas_platform/saas_service_mgmt/v1beta1.rb create mode 100644 owl-bot-staging/google-cloud-saas_platform-saas_service_mgmt-v1beta1/lib/google/cloud/saas_platform/saas_service_mgmt/v1beta1/bindings_override.rb create mode 100644 owl-bot-staging/google-cloud-saas_platform-saas_service_mgmt-v1beta1/lib/google/cloud/saas_platform/saas_service_mgmt/v1beta1/rest.rb create mode 100644 owl-bot-staging/google-cloud-saas_platform-saas_service_mgmt-v1beta1/lib/google/cloud/saas_platform/saas_service_mgmt/v1beta1/saas_deployments.rb create mode 100644 owl-bot-staging/google-cloud-saas_platform-saas_service_mgmt-v1beta1/lib/google/cloud/saas_platform/saas_service_mgmt/v1beta1/saas_deployments/client.rb create mode 100644 owl-bot-staging/google-cloud-saas_platform-saas_service_mgmt-v1beta1/lib/google/cloud/saas_platform/saas_service_mgmt/v1beta1/saas_deployments/credentials.rb create mode 100644 owl-bot-staging/google-cloud-saas_platform-saas_service_mgmt-v1beta1/lib/google/cloud/saas_platform/saas_service_mgmt/v1beta1/saas_deployments/paths.rb create mode 100644 owl-bot-staging/google-cloud-saas_platform-saas_service_mgmt-v1beta1/lib/google/cloud/saas_platform/saas_service_mgmt/v1beta1/saas_deployments/rest.rb create mode 100644 owl-bot-staging/google-cloud-saas_platform-saas_service_mgmt-v1beta1/lib/google/cloud/saas_platform/saas_service_mgmt/v1beta1/saas_deployments/rest/client.rb create mode 100644 owl-bot-staging/google-cloud-saas_platform-saas_service_mgmt-v1beta1/lib/google/cloud/saas_platform/saas_service_mgmt/v1beta1/saas_deployments/rest/service_stub.rb create mode 100644 owl-bot-staging/google-cloud-saas_platform-saas_service_mgmt-v1beta1/lib/google/cloud/saas_platform/saas_service_mgmt/v1beta1/saas_rollouts.rb create mode 100644 owl-bot-staging/google-cloud-saas_platform-saas_service_mgmt-v1beta1/lib/google/cloud/saas_platform/saas_service_mgmt/v1beta1/saas_rollouts/client.rb create mode 100644 owl-bot-staging/google-cloud-saas_platform-saas_service_mgmt-v1beta1/lib/google/cloud/saas_platform/saas_service_mgmt/v1beta1/saas_rollouts/credentials.rb create mode 100644 owl-bot-staging/google-cloud-saas_platform-saas_service_mgmt-v1beta1/lib/google/cloud/saas_platform/saas_service_mgmt/v1beta1/saas_rollouts/paths.rb create mode 100644 owl-bot-staging/google-cloud-saas_platform-saas_service_mgmt-v1beta1/lib/google/cloud/saas_platform/saas_service_mgmt/v1beta1/saas_rollouts/rest.rb create mode 100644 owl-bot-staging/google-cloud-saas_platform-saas_service_mgmt-v1beta1/lib/google/cloud/saas_platform/saas_service_mgmt/v1beta1/saas_rollouts/rest/client.rb create mode 100644 owl-bot-staging/google-cloud-saas_platform-saas_service_mgmt-v1beta1/lib/google/cloud/saas_platform/saas_service_mgmt/v1beta1/saas_rollouts/rest/service_stub.rb create mode 100644 owl-bot-staging/google-cloud-saas_platform-saas_service_mgmt-v1beta1/lib/google/cloud/saas_platform/saas_service_mgmt/v1beta1/version.rb create mode 100644 owl-bot-staging/google-cloud-saas_platform-saas_service_mgmt-v1beta1/lib/google/cloud/saasplatform/saasservicemgmt/v1beta1/common_pb.rb create mode 100644 owl-bot-staging/google-cloud-saas_platform-saas_service_mgmt-v1beta1/lib/google/cloud/saasplatform/saasservicemgmt/v1beta1/deployments_resources_pb.rb create mode 100644 owl-bot-staging/google-cloud-saas_platform-saas_service_mgmt-v1beta1/lib/google/cloud/saasplatform/saasservicemgmt/v1beta1/deployments_service_pb.rb create mode 100644 owl-bot-staging/google-cloud-saas_platform-saas_service_mgmt-v1beta1/lib/google/cloud/saasplatform/saasservicemgmt/v1beta1/deployments_service_services_pb.rb create mode 100644 owl-bot-staging/google-cloud-saas_platform-saas_service_mgmt-v1beta1/lib/google/cloud/saasplatform/saasservicemgmt/v1beta1/rollouts_resources_pb.rb create mode 100644 owl-bot-staging/google-cloud-saas_platform-saas_service_mgmt-v1beta1/lib/google/cloud/saasplatform/saasservicemgmt/v1beta1/rollouts_service_pb.rb create mode 100644 owl-bot-staging/google-cloud-saas_platform-saas_service_mgmt-v1beta1/lib/google/cloud/saasplatform/saasservicemgmt/v1beta1/rollouts_service_services_pb.rb create mode 100644 owl-bot-staging/google-cloud-saas_platform-saas_service_mgmt-v1beta1/proto_docs/README.md create mode 100644 owl-bot-staging/google-cloud-saas_platform-saas_service_mgmt-v1beta1/proto_docs/google/api/client.rb create mode 100644 owl-bot-staging/google-cloud-saas_platform-saas_service_mgmt-v1beta1/proto_docs/google/api/field_behavior.rb create mode 100644 owl-bot-staging/google-cloud-saas_platform-saas_service_mgmt-v1beta1/proto_docs/google/api/field_info.rb create mode 100644 owl-bot-staging/google-cloud-saas_platform-saas_service_mgmt-v1beta1/proto_docs/google/api/launch_stage.rb create mode 100644 owl-bot-staging/google-cloud-saas_platform-saas_service_mgmt-v1beta1/proto_docs/google/api/resource.rb create mode 100644 owl-bot-staging/google-cloud-saas_platform-saas_service_mgmt-v1beta1/proto_docs/google/cloud/saasplatform/saasservicemgmt/v1beta1/common.rb create mode 100644 owl-bot-staging/google-cloud-saas_platform-saas_service_mgmt-v1beta1/proto_docs/google/cloud/saasplatform/saasservicemgmt/v1beta1/deployments_resources.rb create mode 100644 owl-bot-staging/google-cloud-saas_platform-saas_service_mgmt-v1beta1/proto_docs/google/cloud/saasplatform/saasservicemgmt/v1beta1/deployments_service.rb create mode 100644 owl-bot-staging/google-cloud-saas_platform-saas_service_mgmt-v1beta1/proto_docs/google/cloud/saasplatform/saasservicemgmt/v1beta1/rollouts_resources.rb create mode 100644 owl-bot-staging/google-cloud-saas_platform-saas_service_mgmt-v1beta1/proto_docs/google/cloud/saasplatform/saasservicemgmt/v1beta1/rollouts_service.rb create mode 100644 owl-bot-staging/google-cloud-saas_platform-saas_service_mgmt-v1beta1/proto_docs/google/protobuf/any.rb create mode 100644 owl-bot-staging/google-cloud-saas_platform-saas_service_mgmt-v1beta1/proto_docs/google/protobuf/duration.rb create mode 100644 owl-bot-staging/google-cloud-saas_platform-saas_service_mgmt-v1beta1/proto_docs/google/protobuf/empty.rb create mode 100644 owl-bot-staging/google-cloud-saas_platform-saas_service_mgmt-v1beta1/proto_docs/google/protobuf/field_mask.rb create mode 100644 owl-bot-staging/google-cloud-saas_platform-saas_service_mgmt-v1beta1/proto_docs/google/protobuf/timestamp.rb create mode 100644 owl-bot-staging/google-cloud-saas_platform-saas_service_mgmt-v1beta1/snippets/Gemfile create mode 100644 owl-bot-staging/google-cloud-saas_platform-saas_service_mgmt-v1beta1/snippets/saas_deployments/create_release.rb create mode 100644 owl-bot-staging/google-cloud-saas_platform-saas_service_mgmt-v1beta1/snippets/saas_deployments/create_saas.rb create mode 100644 owl-bot-staging/google-cloud-saas_platform-saas_service_mgmt-v1beta1/snippets/saas_deployments/create_tenant.rb create mode 100644 owl-bot-staging/google-cloud-saas_platform-saas_service_mgmt-v1beta1/snippets/saas_deployments/create_unit.rb create mode 100644 owl-bot-staging/google-cloud-saas_platform-saas_service_mgmt-v1beta1/snippets/saas_deployments/create_unit_kind.rb create mode 100644 owl-bot-staging/google-cloud-saas_platform-saas_service_mgmt-v1beta1/snippets/saas_deployments/create_unit_operation.rb create mode 100644 owl-bot-staging/google-cloud-saas_platform-saas_service_mgmt-v1beta1/snippets/saas_deployments/delete_release.rb create mode 100644 owl-bot-staging/google-cloud-saas_platform-saas_service_mgmt-v1beta1/snippets/saas_deployments/delete_saas.rb create mode 100644 owl-bot-staging/google-cloud-saas_platform-saas_service_mgmt-v1beta1/snippets/saas_deployments/delete_tenant.rb create mode 100644 owl-bot-staging/google-cloud-saas_platform-saas_service_mgmt-v1beta1/snippets/saas_deployments/delete_unit.rb create mode 100644 owl-bot-staging/google-cloud-saas_platform-saas_service_mgmt-v1beta1/snippets/saas_deployments/delete_unit_kind.rb create mode 100644 owl-bot-staging/google-cloud-saas_platform-saas_service_mgmt-v1beta1/snippets/saas_deployments/delete_unit_operation.rb create mode 100644 owl-bot-staging/google-cloud-saas_platform-saas_service_mgmt-v1beta1/snippets/saas_deployments/get_release.rb create mode 100644 owl-bot-staging/google-cloud-saas_platform-saas_service_mgmt-v1beta1/snippets/saas_deployments/get_saas.rb create mode 100644 owl-bot-staging/google-cloud-saas_platform-saas_service_mgmt-v1beta1/snippets/saas_deployments/get_tenant.rb create mode 100644 owl-bot-staging/google-cloud-saas_platform-saas_service_mgmt-v1beta1/snippets/saas_deployments/get_unit.rb create mode 100644 owl-bot-staging/google-cloud-saas_platform-saas_service_mgmt-v1beta1/snippets/saas_deployments/get_unit_kind.rb create mode 100644 owl-bot-staging/google-cloud-saas_platform-saas_service_mgmt-v1beta1/snippets/saas_deployments/get_unit_operation.rb create mode 100644 owl-bot-staging/google-cloud-saas_platform-saas_service_mgmt-v1beta1/snippets/saas_deployments/list_releases.rb create mode 100644 owl-bot-staging/google-cloud-saas_platform-saas_service_mgmt-v1beta1/snippets/saas_deployments/list_saas.rb create mode 100644 owl-bot-staging/google-cloud-saas_platform-saas_service_mgmt-v1beta1/snippets/saas_deployments/list_tenants.rb create mode 100644 owl-bot-staging/google-cloud-saas_platform-saas_service_mgmt-v1beta1/snippets/saas_deployments/list_unit_kinds.rb create mode 100644 owl-bot-staging/google-cloud-saas_platform-saas_service_mgmt-v1beta1/snippets/saas_deployments/list_unit_operations.rb create mode 100644 owl-bot-staging/google-cloud-saas_platform-saas_service_mgmt-v1beta1/snippets/saas_deployments/list_units.rb create mode 100644 owl-bot-staging/google-cloud-saas_platform-saas_service_mgmt-v1beta1/snippets/saas_deployments/update_release.rb create mode 100644 owl-bot-staging/google-cloud-saas_platform-saas_service_mgmt-v1beta1/snippets/saas_deployments/update_saas.rb create mode 100644 owl-bot-staging/google-cloud-saas_platform-saas_service_mgmt-v1beta1/snippets/saas_deployments/update_tenant.rb create mode 100644 owl-bot-staging/google-cloud-saas_platform-saas_service_mgmt-v1beta1/snippets/saas_deployments/update_unit.rb create mode 100644 owl-bot-staging/google-cloud-saas_platform-saas_service_mgmt-v1beta1/snippets/saas_deployments/update_unit_kind.rb create mode 100644 owl-bot-staging/google-cloud-saas_platform-saas_service_mgmt-v1beta1/snippets/saas_deployments/update_unit_operation.rb create mode 100644 owl-bot-staging/google-cloud-saas_platform-saas_service_mgmt-v1beta1/snippets/saas_rollouts/create_rollout.rb create mode 100644 owl-bot-staging/google-cloud-saas_platform-saas_service_mgmt-v1beta1/snippets/saas_rollouts/create_rollout_kind.rb create mode 100644 owl-bot-staging/google-cloud-saas_platform-saas_service_mgmt-v1beta1/snippets/saas_rollouts/delete_rollout.rb create mode 100644 owl-bot-staging/google-cloud-saas_platform-saas_service_mgmt-v1beta1/snippets/saas_rollouts/delete_rollout_kind.rb create mode 100644 owl-bot-staging/google-cloud-saas_platform-saas_service_mgmt-v1beta1/snippets/saas_rollouts/get_rollout.rb create mode 100644 owl-bot-staging/google-cloud-saas_platform-saas_service_mgmt-v1beta1/snippets/saas_rollouts/get_rollout_kind.rb create mode 100644 owl-bot-staging/google-cloud-saas_platform-saas_service_mgmt-v1beta1/snippets/saas_rollouts/list_rollout_kinds.rb create mode 100644 owl-bot-staging/google-cloud-saas_platform-saas_service_mgmt-v1beta1/snippets/saas_rollouts/list_rollouts.rb create mode 100644 owl-bot-staging/google-cloud-saas_platform-saas_service_mgmt-v1beta1/snippets/saas_rollouts/update_rollout.rb create mode 100644 owl-bot-staging/google-cloud-saas_platform-saas_service_mgmt-v1beta1/snippets/saas_rollouts/update_rollout_kind.rb create mode 100644 owl-bot-staging/google-cloud-saas_platform-saas_service_mgmt-v1beta1/snippets/snippet_metadata_google.cloud.saasplatform.saasservicemgmt.v1beta1.json create mode 100644 owl-bot-staging/google-cloud-saas_platform-saas_service_mgmt-v1beta1/test/google/cloud/saas_platform/saas_service_mgmt/v1beta1/saas_deployments_paths_test.rb create mode 100644 owl-bot-staging/google-cloud-saas_platform-saas_service_mgmt-v1beta1/test/google/cloud/saas_platform/saas_service_mgmt/v1beta1/saas_deployments_rest_test.rb create mode 100644 owl-bot-staging/google-cloud-saas_platform-saas_service_mgmt-v1beta1/test/google/cloud/saas_platform/saas_service_mgmt/v1beta1/saas_deployments_test.rb create mode 100644 owl-bot-staging/google-cloud-saas_platform-saas_service_mgmt-v1beta1/test/google/cloud/saas_platform/saas_service_mgmt/v1beta1/saas_rollouts_paths_test.rb create mode 100644 owl-bot-staging/google-cloud-saas_platform-saas_service_mgmt-v1beta1/test/google/cloud/saas_platform/saas_service_mgmt/v1beta1/saas_rollouts_rest_test.rb create mode 100644 owl-bot-staging/google-cloud-saas_platform-saas_service_mgmt-v1beta1/test/google/cloud/saas_platform/saas_service_mgmt/v1beta1/saas_rollouts_test.rb create mode 100644 owl-bot-staging/google-cloud-saas_platform-saas_service_mgmt-v1beta1/test/helper.rb create mode 100644 owl-bot-staging/google-cloud-scheduler-v1/.gitignore create mode 100644 owl-bot-staging/google-cloud-scheduler-v1/.repo-metadata.json create mode 100644 owl-bot-staging/google-cloud-scheduler-v1/.rubocop.yml create mode 100644 owl-bot-staging/google-cloud-scheduler-v1/.toys.rb create mode 100644 owl-bot-staging/google-cloud-scheduler-v1/.yardopts create mode 100644 owl-bot-staging/google-cloud-scheduler-v1/AUTHENTICATION.md create mode 100644 owl-bot-staging/google-cloud-scheduler-v1/CHANGELOG.md create mode 100644 owl-bot-staging/google-cloud-scheduler-v1/Gemfile create mode 100644 owl-bot-staging/google-cloud-scheduler-v1/LICENSE.md create mode 100644 owl-bot-staging/google-cloud-scheduler-v1/README.md create mode 100644 owl-bot-staging/google-cloud-scheduler-v1/Rakefile create mode 100644 owl-bot-staging/google-cloud-scheduler-v1/gapic_metadata.json create mode 100644 owl-bot-staging/google-cloud-scheduler-v1/google-cloud-scheduler-v1.gemspec create mode 100644 owl-bot-staging/google-cloud-scheduler-v1/lib/google-cloud-scheduler-v1.rb create mode 100644 owl-bot-staging/google-cloud-scheduler-v1/lib/google/cloud/scheduler/v1.rb create mode 100644 owl-bot-staging/google-cloud-scheduler-v1/lib/google/cloud/scheduler/v1/bindings_override.rb create mode 100644 owl-bot-staging/google-cloud-scheduler-v1/lib/google/cloud/scheduler/v1/cloud_scheduler.rb create mode 100644 owl-bot-staging/google-cloud-scheduler-v1/lib/google/cloud/scheduler/v1/cloud_scheduler/client.rb create mode 100644 owl-bot-staging/google-cloud-scheduler-v1/lib/google/cloud/scheduler/v1/cloud_scheduler/credentials.rb create mode 100644 owl-bot-staging/google-cloud-scheduler-v1/lib/google/cloud/scheduler/v1/cloud_scheduler/paths.rb create mode 100644 owl-bot-staging/google-cloud-scheduler-v1/lib/google/cloud/scheduler/v1/cloud_scheduler/rest.rb create mode 100644 owl-bot-staging/google-cloud-scheduler-v1/lib/google/cloud/scheduler/v1/cloud_scheduler/rest/client.rb create mode 100644 owl-bot-staging/google-cloud-scheduler-v1/lib/google/cloud/scheduler/v1/cloud_scheduler/rest/service_stub.rb create mode 100644 owl-bot-staging/google-cloud-scheduler-v1/lib/google/cloud/scheduler/v1/cloudscheduler_pb.rb create mode 100644 owl-bot-staging/google-cloud-scheduler-v1/lib/google/cloud/scheduler/v1/cloudscheduler_services_pb.rb create mode 100644 owl-bot-staging/google-cloud-scheduler-v1/lib/google/cloud/scheduler/v1/job_pb.rb create mode 100644 owl-bot-staging/google-cloud-scheduler-v1/lib/google/cloud/scheduler/v1/rest.rb create mode 100644 owl-bot-staging/google-cloud-scheduler-v1/lib/google/cloud/scheduler/v1/target_pb.rb create mode 100644 owl-bot-staging/google-cloud-scheduler-v1/lib/google/cloud/scheduler/v1/version.rb create mode 100644 owl-bot-staging/google-cloud-scheduler-v1/proto_docs/README.md create mode 100644 owl-bot-staging/google-cloud-scheduler-v1/proto_docs/google/api/client.rb create mode 100644 owl-bot-staging/google-cloud-scheduler-v1/proto_docs/google/api/field_behavior.rb create mode 100644 owl-bot-staging/google-cloud-scheduler-v1/proto_docs/google/api/launch_stage.rb create mode 100644 owl-bot-staging/google-cloud-scheduler-v1/proto_docs/google/api/resource.rb create mode 100644 owl-bot-staging/google-cloud-scheduler-v1/proto_docs/google/cloud/scheduler/v1/cloudscheduler.rb create mode 100644 owl-bot-staging/google-cloud-scheduler-v1/proto_docs/google/cloud/scheduler/v1/job.rb create mode 100644 owl-bot-staging/google-cloud-scheduler-v1/proto_docs/google/cloud/scheduler/v1/target.rb create mode 100644 owl-bot-staging/google-cloud-scheduler-v1/proto_docs/google/protobuf/any.rb create mode 100644 owl-bot-staging/google-cloud-scheduler-v1/proto_docs/google/protobuf/duration.rb create mode 100644 owl-bot-staging/google-cloud-scheduler-v1/proto_docs/google/protobuf/empty.rb create mode 100644 owl-bot-staging/google-cloud-scheduler-v1/proto_docs/google/protobuf/field_mask.rb create mode 100644 owl-bot-staging/google-cloud-scheduler-v1/proto_docs/google/protobuf/timestamp.rb create mode 100644 owl-bot-staging/google-cloud-scheduler-v1/proto_docs/google/rpc/status.rb create mode 100644 owl-bot-staging/google-cloud-scheduler-v1/snippets/Gemfile create mode 100644 owl-bot-staging/google-cloud-scheduler-v1/snippets/cloud_scheduler/create_job.rb create mode 100644 owl-bot-staging/google-cloud-scheduler-v1/snippets/cloud_scheduler/delete_job.rb create mode 100644 owl-bot-staging/google-cloud-scheduler-v1/snippets/cloud_scheduler/get_job.rb create mode 100644 owl-bot-staging/google-cloud-scheduler-v1/snippets/cloud_scheduler/list_jobs.rb create mode 100644 owl-bot-staging/google-cloud-scheduler-v1/snippets/cloud_scheduler/pause_job.rb create mode 100644 owl-bot-staging/google-cloud-scheduler-v1/snippets/cloud_scheduler/resume_job.rb create mode 100644 owl-bot-staging/google-cloud-scheduler-v1/snippets/cloud_scheduler/run_job.rb create mode 100644 owl-bot-staging/google-cloud-scheduler-v1/snippets/cloud_scheduler/update_job.rb create mode 100644 owl-bot-staging/google-cloud-scheduler-v1/snippets/snippet_metadata_google.cloud.scheduler.v1.json create mode 100644 owl-bot-staging/google-cloud-scheduler-v1/test/google/cloud/scheduler/v1/cloud_scheduler_paths_test.rb create mode 100644 owl-bot-staging/google-cloud-scheduler-v1/test/google/cloud/scheduler/v1/cloud_scheduler_rest_test.rb create mode 100644 owl-bot-staging/google-cloud-scheduler-v1/test/google/cloud/scheduler/v1/cloud_scheduler_test.rb create mode 100644 owl-bot-staging/google-cloud-scheduler-v1/test/helper.rb create mode 100644 owl-bot-staging/google-cloud-scheduler-v1beta1/.gitignore create mode 100644 owl-bot-staging/google-cloud-scheduler-v1beta1/.repo-metadata.json create mode 100644 owl-bot-staging/google-cloud-scheduler-v1beta1/.rubocop.yml create mode 100644 owl-bot-staging/google-cloud-scheduler-v1beta1/.toys.rb create mode 100644 owl-bot-staging/google-cloud-scheduler-v1beta1/.yardopts create mode 100644 owl-bot-staging/google-cloud-scheduler-v1beta1/AUTHENTICATION.md create mode 100644 owl-bot-staging/google-cloud-scheduler-v1beta1/CHANGELOG.md create mode 100644 owl-bot-staging/google-cloud-scheduler-v1beta1/Gemfile create mode 100644 owl-bot-staging/google-cloud-scheduler-v1beta1/LICENSE.md create mode 100644 owl-bot-staging/google-cloud-scheduler-v1beta1/README.md create mode 100644 owl-bot-staging/google-cloud-scheduler-v1beta1/Rakefile create mode 100644 owl-bot-staging/google-cloud-scheduler-v1beta1/gapic_metadata.json create mode 100644 owl-bot-staging/google-cloud-scheduler-v1beta1/google-cloud-scheduler-v1beta1.gemspec create mode 100644 owl-bot-staging/google-cloud-scheduler-v1beta1/lib/google-cloud-scheduler-v1beta1.rb create mode 100644 owl-bot-staging/google-cloud-scheduler-v1beta1/lib/google/cloud/scheduler/v1beta1.rb create mode 100644 owl-bot-staging/google-cloud-scheduler-v1beta1/lib/google/cloud/scheduler/v1beta1/bindings_override.rb create mode 100644 owl-bot-staging/google-cloud-scheduler-v1beta1/lib/google/cloud/scheduler/v1beta1/cloud_scheduler.rb create mode 100644 owl-bot-staging/google-cloud-scheduler-v1beta1/lib/google/cloud/scheduler/v1beta1/cloud_scheduler/client.rb create mode 100644 owl-bot-staging/google-cloud-scheduler-v1beta1/lib/google/cloud/scheduler/v1beta1/cloud_scheduler/credentials.rb create mode 100644 owl-bot-staging/google-cloud-scheduler-v1beta1/lib/google/cloud/scheduler/v1beta1/cloud_scheduler/paths.rb create mode 100644 owl-bot-staging/google-cloud-scheduler-v1beta1/lib/google/cloud/scheduler/v1beta1/cloud_scheduler/rest.rb create mode 100644 owl-bot-staging/google-cloud-scheduler-v1beta1/lib/google/cloud/scheduler/v1beta1/cloud_scheduler/rest/client.rb create mode 100644 owl-bot-staging/google-cloud-scheduler-v1beta1/lib/google/cloud/scheduler/v1beta1/cloud_scheduler/rest/service_stub.rb create mode 100644 owl-bot-staging/google-cloud-scheduler-v1beta1/lib/google/cloud/scheduler/v1beta1/cloudscheduler_pb.rb create mode 100644 owl-bot-staging/google-cloud-scheduler-v1beta1/lib/google/cloud/scheduler/v1beta1/cloudscheduler_services_pb.rb create mode 100644 owl-bot-staging/google-cloud-scheduler-v1beta1/lib/google/cloud/scheduler/v1beta1/job_pb.rb create mode 100644 owl-bot-staging/google-cloud-scheduler-v1beta1/lib/google/cloud/scheduler/v1beta1/rest.rb create mode 100644 owl-bot-staging/google-cloud-scheduler-v1beta1/lib/google/cloud/scheduler/v1beta1/target_pb.rb create mode 100644 owl-bot-staging/google-cloud-scheduler-v1beta1/lib/google/cloud/scheduler/v1beta1/version.rb create mode 100644 owl-bot-staging/google-cloud-scheduler-v1beta1/proto_docs/README.md create mode 100644 owl-bot-staging/google-cloud-scheduler-v1beta1/proto_docs/google/api/client.rb create mode 100644 owl-bot-staging/google-cloud-scheduler-v1beta1/proto_docs/google/api/field_behavior.rb create mode 100644 owl-bot-staging/google-cloud-scheduler-v1beta1/proto_docs/google/api/launch_stage.rb create mode 100644 owl-bot-staging/google-cloud-scheduler-v1beta1/proto_docs/google/api/resource.rb create mode 100644 owl-bot-staging/google-cloud-scheduler-v1beta1/proto_docs/google/cloud/scheduler/v1beta1/cloudscheduler.rb create mode 100644 owl-bot-staging/google-cloud-scheduler-v1beta1/proto_docs/google/cloud/scheduler/v1beta1/job.rb create mode 100644 owl-bot-staging/google-cloud-scheduler-v1beta1/proto_docs/google/cloud/scheduler/v1beta1/target.rb create mode 100644 owl-bot-staging/google-cloud-scheduler-v1beta1/proto_docs/google/protobuf/any.rb create mode 100644 owl-bot-staging/google-cloud-scheduler-v1beta1/proto_docs/google/protobuf/duration.rb create mode 100644 owl-bot-staging/google-cloud-scheduler-v1beta1/proto_docs/google/protobuf/empty.rb create mode 100644 owl-bot-staging/google-cloud-scheduler-v1beta1/proto_docs/google/protobuf/field_mask.rb create mode 100644 owl-bot-staging/google-cloud-scheduler-v1beta1/proto_docs/google/protobuf/timestamp.rb create mode 100644 owl-bot-staging/google-cloud-scheduler-v1beta1/proto_docs/google/rpc/status.rb create mode 100644 owl-bot-staging/google-cloud-scheduler-v1beta1/snippets/Gemfile create mode 100644 owl-bot-staging/google-cloud-scheduler-v1beta1/snippets/cloud_scheduler/create_job.rb create mode 100644 owl-bot-staging/google-cloud-scheduler-v1beta1/snippets/cloud_scheduler/delete_job.rb create mode 100644 owl-bot-staging/google-cloud-scheduler-v1beta1/snippets/cloud_scheduler/get_job.rb create mode 100644 owl-bot-staging/google-cloud-scheduler-v1beta1/snippets/cloud_scheduler/list_jobs.rb create mode 100644 owl-bot-staging/google-cloud-scheduler-v1beta1/snippets/cloud_scheduler/pause_job.rb create mode 100644 owl-bot-staging/google-cloud-scheduler-v1beta1/snippets/cloud_scheduler/resume_job.rb create mode 100644 owl-bot-staging/google-cloud-scheduler-v1beta1/snippets/cloud_scheduler/run_job.rb create mode 100644 owl-bot-staging/google-cloud-scheduler-v1beta1/snippets/cloud_scheduler/update_job.rb create mode 100644 owl-bot-staging/google-cloud-scheduler-v1beta1/snippets/snippet_metadata_google.cloud.scheduler.v1beta1.json create mode 100644 owl-bot-staging/google-cloud-scheduler-v1beta1/test/google/cloud/scheduler/v1beta1/cloud_scheduler_paths_test.rb create mode 100644 owl-bot-staging/google-cloud-scheduler-v1beta1/test/google/cloud/scheduler/v1beta1/cloud_scheduler_rest_test.rb create mode 100644 owl-bot-staging/google-cloud-scheduler-v1beta1/test/google/cloud/scheduler/v1beta1/cloud_scheduler_test.rb create mode 100644 owl-bot-staging/google-cloud-scheduler-v1beta1/test/helper.rb create mode 100644 owl-bot-staging/google-cloud-secret_manager-v1/.gitignore create mode 100644 owl-bot-staging/google-cloud-secret_manager-v1/.repo-metadata.json create mode 100644 owl-bot-staging/google-cloud-secret_manager-v1/.rubocop.yml create mode 100644 owl-bot-staging/google-cloud-secret_manager-v1/.toys.rb create mode 100644 owl-bot-staging/google-cloud-secret_manager-v1/.yardopts create mode 100644 owl-bot-staging/google-cloud-secret_manager-v1/AUTHENTICATION.md create mode 100644 owl-bot-staging/google-cloud-secret_manager-v1/CHANGELOG.md create mode 100644 owl-bot-staging/google-cloud-secret_manager-v1/Gemfile create mode 100644 owl-bot-staging/google-cloud-secret_manager-v1/LICENSE.md create mode 100644 owl-bot-staging/google-cloud-secret_manager-v1/README.md create mode 100644 owl-bot-staging/google-cloud-secret_manager-v1/Rakefile create mode 100644 owl-bot-staging/google-cloud-secret_manager-v1/gapic_metadata.json create mode 100644 owl-bot-staging/google-cloud-secret_manager-v1/google-cloud-secret_manager-v1.gemspec create mode 100644 owl-bot-staging/google-cloud-secret_manager-v1/lib/google-cloud-secret_manager-v1.rb create mode 100644 owl-bot-staging/google-cloud-secret_manager-v1/lib/google/cloud/secret_manager/v1.rb create mode 100644 owl-bot-staging/google-cloud-secret_manager-v1/lib/google/cloud/secret_manager/v1/bindings_override.rb create mode 100644 owl-bot-staging/google-cloud-secret_manager-v1/lib/google/cloud/secret_manager/v1/rest.rb create mode 100644 owl-bot-staging/google-cloud-secret_manager-v1/lib/google/cloud/secret_manager/v1/secret_manager_service.rb create mode 100644 owl-bot-staging/google-cloud-secret_manager-v1/lib/google/cloud/secret_manager/v1/secret_manager_service/client.rb create mode 100644 owl-bot-staging/google-cloud-secret_manager-v1/lib/google/cloud/secret_manager/v1/secret_manager_service/credentials.rb create mode 100644 owl-bot-staging/google-cloud-secret_manager-v1/lib/google/cloud/secret_manager/v1/secret_manager_service/paths.rb create mode 100644 owl-bot-staging/google-cloud-secret_manager-v1/lib/google/cloud/secret_manager/v1/secret_manager_service/rest.rb create mode 100644 owl-bot-staging/google-cloud-secret_manager-v1/lib/google/cloud/secret_manager/v1/secret_manager_service/rest/client.rb create mode 100644 owl-bot-staging/google-cloud-secret_manager-v1/lib/google/cloud/secret_manager/v1/secret_manager_service/rest/service_stub.rb create mode 100644 owl-bot-staging/google-cloud-secret_manager-v1/lib/google/cloud/secret_manager/v1/version.rb create mode 100644 owl-bot-staging/google-cloud-secret_manager-v1/lib/google/cloud/secretmanager/v1/resources_pb.rb create mode 100644 owl-bot-staging/google-cloud-secret_manager-v1/lib/google/cloud/secretmanager/v1/service_pb.rb create mode 100644 owl-bot-staging/google-cloud-secret_manager-v1/lib/google/cloud/secretmanager/v1/service_services_pb.rb create mode 100644 owl-bot-staging/google-cloud-secret_manager-v1/proto_docs/README.md create mode 100644 owl-bot-staging/google-cloud-secret_manager-v1/proto_docs/google/api/client.rb create mode 100644 owl-bot-staging/google-cloud-secret_manager-v1/proto_docs/google/api/field_behavior.rb create mode 100644 owl-bot-staging/google-cloud-secret_manager-v1/proto_docs/google/api/launch_stage.rb create mode 100644 owl-bot-staging/google-cloud-secret_manager-v1/proto_docs/google/api/resource.rb create mode 100644 owl-bot-staging/google-cloud-secret_manager-v1/proto_docs/google/cloud/secretmanager/v1/resources.rb create mode 100644 owl-bot-staging/google-cloud-secret_manager-v1/proto_docs/google/cloud/secretmanager/v1/service.rb create mode 100644 owl-bot-staging/google-cloud-secret_manager-v1/proto_docs/google/iam/v1/iam_policy.rb create mode 100644 owl-bot-staging/google-cloud-secret_manager-v1/proto_docs/google/iam/v1/options.rb create mode 100644 owl-bot-staging/google-cloud-secret_manager-v1/proto_docs/google/iam/v1/policy.rb create mode 100644 owl-bot-staging/google-cloud-secret_manager-v1/proto_docs/google/protobuf/duration.rb create mode 100644 owl-bot-staging/google-cloud-secret_manager-v1/proto_docs/google/protobuf/empty.rb create mode 100644 owl-bot-staging/google-cloud-secret_manager-v1/proto_docs/google/protobuf/field_mask.rb create mode 100644 owl-bot-staging/google-cloud-secret_manager-v1/proto_docs/google/protobuf/timestamp.rb create mode 100644 owl-bot-staging/google-cloud-secret_manager-v1/proto_docs/google/type/expr.rb create mode 100644 owl-bot-staging/google-cloud-secret_manager-v1/snippets/Gemfile create mode 100644 owl-bot-staging/google-cloud-secret_manager-v1/snippets/secret_manager_service/access_secret_version.rb create mode 100644 owl-bot-staging/google-cloud-secret_manager-v1/snippets/secret_manager_service/add_secret_version.rb create mode 100644 owl-bot-staging/google-cloud-secret_manager-v1/snippets/secret_manager_service/create_secret.rb create mode 100644 owl-bot-staging/google-cloud-secret_manager-v1/snippets/secret_manager_service/delete_secret.rb create mode 100644 owl-bot-staging/google-cloud-secret_manager-v1/snippets/secret_manager_service/destroy_secret_version.rb create mode 100644 owl-bot-staging/google-cloud-secret_manager-v1/snippets/secret_manager_service/disable_secret_version.rb create mode 100644 owl-bot-staging/google-cloud-secret_manager-v1/snippets/secret_manager_service/enable_secret_version.rb create mode 100644 owl-bot-staging/google-cloud-secret_manager-v1/snippets/secret_manager_service/get_iam_policy.rb create mode 100644 owl-bot-staging/google-cloud-secret_manager-v1/snippets/secret_manager_service/get_secret.rb create mode 100644 owl-bot-staging/google-cloud-secret_manager-v1/snippets/secret_manager_service/get_secret_version.rb create mode 100644 owl-bot-staging/google-cloud-secret_manager-v1/snippets/secret_manager_service/list_secret_versions.rb create mode 100644 owl-bot-staging/google-cloud-secret_manager-v1/snippets/secret_manager_service/list_secrets.rb create mode 100644 owl-bot-staging/google-cloud-secret_manager-v1/snippets/secret_manager_service/set_iam_policy.rb create mode 100644 owl-bot-staging/google-cloud-secret_manager-v1/snippets/secret_manager_service/test_iam_permissions.rb create mode 100644 owl-bot-staging/google-cloud-secret_manager-v1/snippets/secret_manager_service/update_secret.rb create mode 100644 owl-bot-staging/google-cloud-secret_manager-v1/snippets/snippet_metadata_google.cloud.secretmanager.v1.json create mode 100644 owl-bot-staging/google-cloud-secret_manager-v1/test/google/cloud/secret_manager/v1/secret_manager_service_paths_test.rb create mode 100644 owl-bot-staging/google-cloud-secret_manager-v1/test/google/cloud/secret_manager/v1/secret_manager_service_rest_test.rb create mode 100644 owl-bot-staging/google-cloud-secret_manager-v1/test/google/cloud/secret_manager/v1/secret_manager_service_test.rb create mode 100644 owl-bot-staging/google-cloud-secret_manager-v1/test/helper.rb create mode 100644 owl-bot-staging/google-cloud-secret_manager-v1beta1/.gitignore create mode 100644 owl-bot-staging/google-cloud-secret_manager-v1beta1/.repo-metadata.json create mode 100644 owl-bot-staging/google-cloud-secret_manager-v1beta1/.rubocop.yml create mode 100644 owl-bot-staging/google-cloud-secret_manager-v1beta1/.toys.rb create mode 100644 owl-bot-staging/google-cloud-secret_manager-v1beta1/.yardopts create mode 100644 owl-bot-staging/google-cloud-secret_manager-v1beta1/AUTHENTICATION.md create mode 100644 owl-bot-staging/google-cloud-secret_manager-v1beta1/CHANGELOG.md create mode 100644 owl-bot-staging/google-cloud-secret_manager-v1beta1/Gemfile create mode 100644 owl-bot-staging/google-cloud-secret_manager-v1beta1/LICENSE.md create mode 100644 owl-bot-staging/google-cloud-secret_manager-v1beta1/README.md create mode 100644 owl-bot-staging/google-cloud-secret_manager-v1beta1/Rakefile create mode 100644 owl-bot-staging/google-cloud-secret_manager-v1beta1/gapic_metadata.json create mode 100644 owl-bot-staging/google-cloud-secret_manager-v1beta1/google-cloud-secret_manager-v1beta1.gemspec create mode 100644 owl-bot-staging/google-cloud-secret_manager-v1beta1/lib/google-cloud-secret_manager-v1beta1.rb create mode 100644 owl-bot-staging/google-cloud-secret_manager-v1beta1/lib/google/cloud/secret_manager/v1beta1.rb create mode 100644 owl-bot-staging/google-cloud-secret_manager-v1beta1/lib/google/cloud/secret_manager/v1beta1/bindings_override.rb create mode 100644 owl-bot-staging/google-cloud-secret_manager-v1beta1/lib/google/cloud/secret_manager/v1beta1/rest.rb create mode 100644 owl-bot-staging/google-cloud-secret_manager-v1beta1/lib/google/cloud/secret_manager/v1beta1/secret_manager_service.rb create mode 100644 owl-bot-staging/google-cloud-secret_manager-v1beta1/lib/google/cloud/secret_manager/v1beta1/secret_manager_service/client.rb create mode 100644 owl-bot-staging/google-cloud-secret_manager-v1beta1/lib/google/cloud/secret_manager/v1beta1/secret_manager_service/credentials.rb create mode 100644 owl-bot-staging/google-cloud-secret_manager-v1beta1/lib/google/cloud/secret_manager/v1beta1/secret_manager_service/paths.rb create mode 100644 owl-bot-staging/google-cloud-secret_manager-v1beta1/lib/google/cloud/secret_manager/v1beta1/secret_manager_service/rest.rb create mode 100644 owl-bot-staging/google-cloud-secret_manager-v1beta1/lib/google/cloud/secret_manager/v1beta1/secret_manager_service/rest/client.rb create mode 100644 owl-bot-staging/google-cloud-secret_manager-v1beta1/lib/google/cloud/secret_manager/v1beta1/secret_manager_service/rest/service_stub.rb create mode 100644 owl-bot-staging/google-cloud-secret_manager-v1beta1/lib/google/cloud/secret_manager/v1beta1/version.rb create mode 100644 owl-bot-staging/google-cloud-secret_manager-v1beta1/lib/google/cloud/secrets/v1beta1/resources_pb.rb create mode 100644 owl-bot-staging/google-cloud-secret_manager-v1beta1/lib/google/cloud/secrets/v1beta1/service_pb.rb create mode 100644 owl-bot-staging/google-cloud-secret_manager-v1beta1/lib/google/cloud/secrets/v1beta1/service_services_pb.rb create mode 100644 owl-bot-staging/google-cloud-secret_manager-v1beta1/proto_docs/README.md create mode 100644 owl-bot-staging/google-cloud-secret_manager-v1beta1/proto_docs/google/api/client.rb create mode 100644 owl-bot-staging/google-cloud-secret_manager-v1beta1/proto_docs/google/api/field_behavior.rb create mode 100644 owl-bot-staging/google-cloud-secret_manager-v1beta1/proto_docs/google/api/launch_stage.rb create mode 100644 owl-bot-staging/google-cloud-secret_manager-v1beta1/proto_docs/google/api/resource.rb create mode 100644 owl-bot-staging/google-cloud-secret_manager-v1beta1/proto_docs/google/cloud/secrets/v1beta1/resources.rb create mode 100644 owl-bot-staging/google-cloud-secret_manager-v1beta1/proto_docs/google/cloud/secrets/v1beta1/service.rb create mode 100644 owl-bot-staging/google-cloud-secret_manager-v1beta1/proto_docs/google/iam/v1/iam_policy.rb create mode 100644 owl-bot-staging/google-cloud-secret_manager-v1beta1/proto_docs/google/iam/v1/options.rb create mode 100644 owl-bot-staging/google-cloud-secret_manager-v1beta1/proto_docs/google/iam/v1/policy.rb create mode 100644 owl-bot-staging/google-cloud-secret_manager-v1beta1/proto_docs/google/protobuf/any.rb create mode 100644 owl-bot-staging/google-cloud-secret_manager-v1beta1/proto_docs/google/protobuf/duration.rb create mode 100644 owl-bot-staging/google-cloud-secret_manager-v1beta1/proto_docs/google/protobuf/empty.rb create mode 100644 owl-bot-staging/google-cloud-secret_manager-v1beta1/proto_docs/google/protobuf/field_mask.rb create mode 100644 owl-bot-staging/google-cloud-secret_manager-v1beta1/proto_docs/google/protobuf/timestamp.rb create mode 100644 owl-bot-staging/google-cloud-secret_manager-v1beta1/proto_docs/google/type/expr.rb create mode 100644 owl-bot-staging/google-cloud-secret_manager-v1beta1/snippets/Gemfile create mode 100644 owl-bot-staging/google-cloud-secret_manager-v1beta1/snippets/secret_manager_service/access_secret_version.rb create mode 100644 owl-bot-staging/google-cloud-secret_manager-v1beta1/snippets/secret_manager_service/add_secret_version.rb create mode 100644 owl-bot-staging/google-cloud-secret_manager-v1beta1/snippets/secret_manager_service/create_secret.rb create mode 100644 owl-bot-staging/google-cloud-secret_manager-v1beta1/snippets/secret_manager_service/delete_secret.rb create mode 100644 owl-bot-staging/google-cloud-secret_manager-v1beta1/snippets/secret_manager_service/destroy_secret_version.rb create mode 100644 owl-bot-staging/google-cloud-secret_manager-v1beta1/snippets/secret_manager_service/disable_secret_version.rb create mode 100644 owl-bot-staging/google-cloud-secret_manager-v1beta1/snippets/secret_manager_service/enable_secret_version.rb create mode 100644 owl-bot-staging/google-cloud-secret_manager-v1beta1/snippets/secret_manager_service/get_iam_policy.rb create mode 100644 owl-bot-staging/google-cloud-secret_manager-v1beta1/snippets/secret_manager_service/get_secret.rb create mode 100644 owl-bot-staging/google-cloud-secret_manager-v1beta1/snippets/secret_manager_service/get_secret_version.rb create mode 100644 owl-bot-staging/google-cloud-secret_manager-v1beta1/snippets/secret_manager_service/list_secret_versions.rb create mode 100644 owl-bot-staging/google-cloud-secret_manager-v1beta1/snippets/secret_manager_service/list_secrets.rb create mode 100644 owl-bot-staging/google-cloud-secret_manager-v1beta1/snippets/secret_manager_service/set_iam_policy.rb create mode 100644 owl-bot-staging/google-cloud-secret_manager-v1beta1/snippets/secret_manager_service/test_iam_permissions.rb create mode 100644 owl-bot-staging/google-cloud-secret_manager-v1beta1/snippets/secret_manager_service/update_secret.rb create mode 100644 owl-bot-staging/google-cloud-secret_manager-v1beta1/snippets/snippet_metadata_google.cloud.secrets.v1beta1.json create mode 100644 owl-bot-staging/google-cloud-secret_manager-v1beta1/test/google/cloud/secret_manager/v1beta1/secret_manager_service_paths_test.rb create mode 100644 owl-bot-staging/google-cloud-secret_manager-v1beta1/test/google/cloud/secret_manager/v1beta1/secret_manager_service_rest_test.rb create mode 100644 owl-bot-staging/google-cloud-secret_manager-v1beta1/test/google/cloud/secret_manager/v1beta1/secret_manager_service_test.rb create mode 100644 owl-bot-staging/google-cloud-secret_manager-v1beta1/test/helper.rb create mode 100644 owl-bot-staging/google-cloud-secret_manager-v1beta2/.gitignore create mode 100644 owl-bot-staging/google-cloud-secret_manager-v1beta2/.repo-metadata.json create mode 100644 owl-bot-staging/google-cloud-secret_manager-v1beta2/.rubocop.yml create mode 100644 owl-bot-staging/google-cloud-secret_manager-v1beta2/.toys.rb create mode 100644 owl-bot-staging/google-cloud-secret_manager-v1beta2/.yardopts create mode 100644 owl-bot-staging/google-cloud-secret_manager-v1beta2/AUTHENTICATION.md create mode 100644 owl-bot-staging/google-cloud-secret_manager-v1beta2/CHANGELOG.md create mode 100644 owl-bot-staging/google-cloud-secret_manager-v1beta2/Gemfile create mode 100644 owl-bot-staging/google-cloud-secret_manager-v1beta2/LICENSE.md create mode 100644 owl-bot-staging/google-cloud-secret_manager-v1beta2/README.md create mode 100644 owl-bot-staging/google-cloud-secret_manager-v1beta2/Rakefile create mode 100644 owl-bot-staging/google-cloud-secret_manager-v1beta2/gapic_metadata.json create mode 100644 owl-bot-staging/google-cloud-secret_manager-v1beta2/google-cloud-secret_manager-v1beta2.gemspec create mode 100644 owl-bot-staging/google-cloud-secret_manager-v1beta2/lib/google-cloud-secret_manager-v1beta2.rb create mode 100644 owl-bot-staging/google-cloud-secret_manager-v1beta2/lib/google/cloud/secret_manager/v1beta2.rb create mode 100644 owl-bot-staging/google-cloud-secret_manager-v1beta2/lib/google/cloud/secret_manager/v1beta2/bindings_override.rb create mode 100644 owl-bot-staging/google-cloud-secret_manager-v1beta2/lib/google/cloud/secret_manager/v1beta2/rest.rb create mode 100644 owl-bot-staging/google-cloud-secret_manager-v1beta2/lib/google/cloud/secret_manager/v1beta2/secret_manager_service.rb create mode 100644 owl-bot-staging/google-cloud-secret_manager-v1beta2/lib/google/cloud/secret_manager/v1beta2/secret_manager_service/client.rb create mode 100644 owl-bot-staging/google-cloud-secret_manager-v1beta2/lib/google/cloud/secret_manager/v1beta2/secret_manager_service/credentials.rb create mode 100644 owl-bot-staging/google-cloud-secret_manager-v1beta2/lib/google/cloud/secret_manager/v1beta2/secret_manager_service/paths.rb create mode 100644 owl-bot-staging/google-cloud-secret_manager-v1beta2/lib/google/cloud/secret_manager/v1beta2/secret_manager_service/rest.rb create mode 100644 owl-bot-staging/google-cloud-secret_manager-v1beta2/lib/google/cloud/secret_manager/v1beta2/secret_manager_service/rest/client.rb create mode 100644 owl-bot-staging/google-cloud-secret_manager-v1beta2/lib/google/cloud/secret_manager/v1beta2/secret_manager_service/rest/service_stub.rb create mode 100644 owl-bot-staging/google-cloud-secret_manager-v1beta2/lib/google/cloud/secret_manager/v1beta2/version.rb create mode 100644 owl-bot-staging/google-cloud-secret_manager-v1beta2/lib/google/cloud/secretmanager/v1beta2/resources_pb.rb create mode 100644 owl-bot-staging/google-cloud-secret_manager-v1beta2/lib/google/cloud/secretmanager/v1beta2/service_pb.rb create mode 100644 owl-bot-staging/google-cloud-secret_manager-v1beta2/lib/google/cloud/secretmanager/v1beta2/service_services_pb.rb create mode 100644 owl-bot-staging/google-cloud-secret_manager-v1beta2/proto_docs/README.md create mode 100644 owl-bot-staging/google-cloud-secret_manager-v1beta2/proto_docs/google/api/client.rb create mode 100644 owl-bot-staging/google-cloud-secret_manager-v1beta2/proto_docs/google/api/field_behavior.rb create mode 100644 owl-bot-staging/google-cloud-secret_manager-v1beta2/proto_docs/google/api/launch_stage.rb create mode 100644 owl-bot-staging/google-cloud-secret_manager-v1beta2/proto_docs/google/api/resource.rb create mode 100644 owl-bot-staging/google-cloud-secret_manager-v1beta2/proto_docs/google/cloud/secretmanager/v1beta2/resources.rb create mode 100644 owl-bot-staging/google-cloud-secret_manager-v1beta2/proto_docs/google/cloud/secretmanager/v1beta2/service.rb create mode 100644 owl-bot-staging/google-cloud-secret_manager-v1beta2/proto_docs/google/iam/v1/iam_policy.rb create mode 100644 owl-bot-staging/google-cloud-secret_manager-v1beta2/proto_docs/google/iam/v1/options.rb create mode 100644 owl-bot-staging/google-cloud-secret_manager-v1beta2/proto_docs/google/iam/v1/policy.rb create mode 100644 owl-bot-staging/google-cloud-secret_manager-v1beta2/proto_docs/google/protobuf/any.rb create mode 100644 owl-bot-staging/google-cloud-secret_manager-v1beta2/proto_docs/google/protobuf/duration.rb create mode 100644 owl-bot-staging/google-cloud-secret_manager-v1beta2/proto_docs/google/protobuf/empty.rb create mode 100644 owl-bot-staging/google-cloud-secret_manager-v1beta2/proto_docs/google/protobuf/field_mask.rb create mode 100644 owl-bot-staging/google-cloud-secret_manager-v1beta2/proto_docs/google/protobuf/timestamp.rb create mode 100644 owl-bot-staging/google-cloud-secret_manager-v1beta2/proto_docs/google/type/expr.rb create mode 100644 owl-bot-staging/google-cloud-secret_manager-v1beta2/snippets/Gemfile create mode 100644 owl-bot-staging/google-cloud-secret_manager-v1beta2/snippets/secret_manager_service/access_secret_version.rb create mode 100644 owl-bot-staging/google-cloud-secret_manager-v1beta2/snippets/secret_manager_service/add_secret_version.rb create mode 100644 owl-bot-staging/google-cloud-secret_manager-v1beta2/snippets/secret_manager_service/create_secret.rb create mode 100644 owl-bot-staging/google-cloud-secret_manager-v1beta2/snippets/secret_manager_service/delete_secret.rb create mode 100644 owl-bot-staging/google-cloud-secret_manager-v1beta2/snippets/secret_manager_service/destroy_secret_version.rb create mode 100644 owl-bot-staging/google-cloud-secret_manager-v1beta2/snippets/secret_manager_service/disable_secret_version.rb create mode 100644 owl-bot-staging/google-cloud-secret_manager-v1beta2/snippets/secret_manager_service/enable_secret_version.rb create mode 100644 owl-bot-staging/google-cloud-secret_manager-v1beta2/snippets/secret_manager_service/get_iam_policy.rb create mode 100644 owl-bot-staging/google-cloud-secret_manager-v1beta2/snippets/secret_manager_service/get_secret.rb create mode 100644 owl-bot-staging/google-cloud-secret_manager-v1beta2/snippets/secret_manager_service/get_secret_version.rb create mode 100644 owl-bot-staging/google-cloud-secret_manager-v1beta2/snippets/secret_manager_service/list_secret_versions.rb create mode 100644 owl-bot-staging/google-cloud-secret_manager-v1beta2/snippets/secret_manager_service/list_secrets.rb create mode 100644 owl-bot-staging/google-cloud-secret_manager-v1beta2/snippets/secret_manager_service/set_iam_policy.rb create mode 100644 owl-bot-staging/google-cloud-secret_manager-v1beta2/snippets/secret_manager_service/test_iam_permissions.rb create mode 100644 owl-bot-staging/google-cloud-secret_manager-v1beta2/snippets/secret_manager_service/update_secret.rb create mode 100644 owl-bot-staging/google-cloud-secret_manager-v1beta2/snippets/snippet_metadata_google.cloud.secretmanager.v1beta2.json create mode 100644 owl-bot-staging/google-cloud-secret_manager-v1beta2/test/google/cloud/secret_manager/v1beta2/secret_manager_service_paths_test.rb create mode 100644 owl-bot-staging/google-cloud-secret_manager-v1beta2/test/google/cloud/secret_manager/v1beta2/secret_manager_service_rest_test.rb create mode 100644 owl-bot-staging/google-cloud-secret_manager-v1beta2/test/google/cloud/secret_manager/v1beta2/secret_manager_service_test.rb create mode 100644 owl-bot-staging/google-cloud-secret_manager-v1beta2/test/helper.rb create mode 100644 owl-bot-staging/google-cloud-secure_source_manager-v1/.gitignore create mode 100644 owl-bot-staging/google-cloud-secure_source_manager-v1/.repo-metadata.json create mode 100644 owl-bot-staging/google-cloud-secure_source_manager-v1/.rubocop.yml create mode 100644 owl-bot-staging/google-cloud-secure_source_manager-v1/.toys.rb create mode 100644 owl-bot-staging/google-cloud-secure_source_manager-v1/.yardopts create mode 100644 owl-bot-staging/google-cloud-secure_source_manager-v1/AUTHENTICATION.md create mode 100644 owl-bot-staging/google-cloud-secure_source_manager-v1/CHANGELOG.md create mode 100644 owl-bot-staging/google-cloud-secure_source_manager-v1/Gemfile create mode 100644 owl-bot-staging/google-cloud-secure_source_manager-v1/LICENSE.md create mode 100644 owl-bot-staging/google-cloud-secure_source_manager-v1/README.md create mode 100644 owl-bot-staging/google-cloud-secure_source_manager-v1/Rakefile create mode 100644 owl-bot-staging/google-cloud-secure_source_manager-v1/gapic_metadata.json create mode 100644 owl-bot-staging/google-cloud-secure_source_manager-v1/google-cloud-secure_source_manager-v1.gemspec create mode 100644 owl-bot-staging/google-cloud-secure_source_manager-v1/lib/google-cloud-secure_source_manager-v1.rb create mode 100644 owl-bot-staging/google-cloud-secure_source_manager-v1/lib/google/cloud/secure_source_manager/v1.rb create mode 100644 owl-bot-staging/google-cloud-secure_source_manager-v1/lib/google/cloud/secure_source_manager/v1/bindings_override.rb create mode 100644 owl-bot-staging/google-cloud-secure_source_manager-v1/lib/google/cloud/secure_source_manager/v1/rest.rb create mode 100644 owl-bot-staging/google-cloud-secure_source_manager-v1/lib/google/cloud/secure_source_manager/v1/secure_source_manager.rb create mode 100644 owl-bot-staging/google-cloud-secure_source_manager-v1/lib/google/cloud/secure_source_manager/v1/secure_source_manager/client.rb create mode 100644 owl-bot-staging/google-cloud-secure_source_manager-v1/lib/google/cloud/secure_source_manager/v1/secure_source_manager/credentials.rb create mode 100644 owl-bot-staging/google-cloud-secure_source_manager-v1/lib/google/cloud/secure_source_manager/v1/secure_source_manager/operations.rb create mode 100644 owl-bot-staging/google-cloud-secure_source_manager-v1/lib/google/cloud/secure_source_manager/v1/secure_source_manager/paths.rb create mode 100644 owl-bot-staging/google-cloud-secure_source_manager-v1/lib/google/cloud/secure_source_manager/v1/secure_source_manager/rest.rb create mode 100644 owl-bot-staging/google-cloud-secure_source_manager-v1/lib/google/cloud/secure_source_manager/v1/secure_source_manager/rest/client.rb create mode 100644 owl-bot-staging/google-cloud-secure_source_manager-v1/lib/google/cloud/secure_source_manager/v1/secure_source_manager/rest/operations.rb create mode 100644 owl-bot-staging/google-cloud-secure_source_manager-v1/lib/google/cloud/secure_source_manager/v1/secure_source_manager/rest/service_stub.rb create mode 100644 owl-bot-staging/google-cloud-secure_source_manager-v1/lib/google/cloud/secure_source_manager/v1/version.rb create mode 100644 owl-bot-staging/google-cloud-secure_source_manager-v1/lib/google/cloud/securesourcemanager/v1/secure_source_manager_pb.rb create mode 100644 owl-bot-staging/google-cloud-secure_source_manager-v1/lib/google/cloud/securesourcemanager/v1/secure_source_manager_services_pb.rb create mode 100644 owl-bot-staging/google-cloud-secure_source_manager-v1/proto_docs/README.md create mode 100644 owl-bot-staging/google-cloud-secure_source_manager-v1/proto_docs/google/api/client.rb create mode 100644 owl-bot-staging/google-cloud-secure_source_manager-v1/proto_docs/google/api/field_behavior.rb create mode 100644 owl-bot-staging/google-cloud-secure_source_manager-v1/proto_docs/google/api/launch_stage.rb create mode 100644 owl-bot-staging/google-cloud-secure_source_manager-v1/proto_docs/google/api/resource.rb create mode 100644 owl-bot-staging/google-cloud-secure_source_manager-v1/proto_docs/google/cloud/securesourcemanager/v1/secure_source_manager.rb create mode 100644 owl-bot-staging/google-cloud-secure_source_manager-v1/proto_docs/google/longrunning/operations.rb create mode 100644 owl-bot-staging/google-cloud-secure_source_manager-v1/proto_docs/google/protobuf/any.rb create mode 100644 owl-bot-staging/google-cloud-secure_source_manager-v1/proto_docs/google/protobuf/duration.rb create mode 100644 owl-bot-staging/google-cloud-secure_source_manager-v1/proto_docs/google/protobuf/empty.rb create mode 100644 owl-bot-staging/google-cloud-secure_source_manager-v1/proto_docs/google/protobuf/field_mask.rb create mode 100644 owl-bot-staging/google-cloud-secure_source_manager-v1/proto_docs/google/protobuf/timestamp.rb create mode 100644 owl-bot-staging/google-cloud-secure_source_manager-v1/proto_docs/google/rpc/status.rb create mode 100644 owl-bot-staging/google-cloud-secure_source_manager-v1/proto_docs/google/type/expr.rb create mode 100644 owl-bot-staging/google-cloud-secure_source_manager-v1/snippets/Gemfile create mode 100644 owl-bot-staging/google-cloud-secure_source_manager-v1/snippets/secure_source_manager/batch_create_pull_request_comments.rb create mode 100644 owl-bot-staging/google-cloud-secure_source_manager-v1/snippets/secure_source_manager/close_issue.rb create mode 100644 owl-bot-staging/google-cloud-secure_source_manager-v1/snippets/secure_source_manager/close_pull_request.rb create mode 100644 owl-bot-staging/google-cloud-secure_source_manager-v1/snippets/secure_source_manager/create_branch_rule.rb create mode 100644 owl-bot-staging/google-cloud-secure_source_manager-v1/snippets/secure_source_manager/create_hook.rb create mode 100644 owl-bot-staging/google-cloud-secure_source_manager-v1/snippets/secure_source_manager/create_instance.rb create mode 100644 owl-bot-staging/google-cloud-secure_source_manager-v1/snippets/secure_source_manager/create_issue.rb create mode 100644 owl-bot-staging/google-cloud-secure_source_manager-v1/snippets/secure_source_manager/create_issue_comment.rb create mode 100644 owl-bot-staging/google-cloud-secure_source_manager-v1/snippets/secure_source_manager/create_pull_request.rb create mode 100644 owl-bot-staging/google-cloud-secure_source_manager-v1/snippets/secure_source_manager/create_pull_request_comment.rb create mode 100644 owl-bot-staging/google-cloud-secure_source_manager-v1/snippets/secure_source_manager/create_repository.rb create mode 100644 owl-bot-staging/google-cloud-secure_source_manager-v1/snippets/secure_source_manager/delete_branch_rule.rb create mode 100644 owl-bot-staging/google-cloud-secure_source_manager-v1/snippets/secure_source_manager/delete_hook.rb create mode 100644 owl-bot-staging/google-cloud-secure_source_manager-v1/snippets/secure_source_manager/delete_instance.rb create mode 100644 owl-bot-staging/google-cloud-secure_source_manager-v1/snippets/secure_source_manager/delete_issue.rb create mode 100644 owl-bot-staging/google-cloud-secure_source_manager-v1/snippets/secure_source_manager/delete_issue_comment.rb create mode 100644 owl-bot-staging/google-cloud-secure_source_manager-v1/snippets/secure_source_manager/delete_pull_request_comment.rb create mode 100644 owl-bot-staging/google-cloud-secure_source_manager-v1/snippets/secure_source_manager/delete_repository.rb create mode 100644 owl-bot-staging/google-cloud-secure_source_manager-v1/snippets/secure_source_manager/fetch_blob.rb create mode 100644 owl-bot-staging/google-cloud-secure_source_manager-v1/snippets/secure_source_manager/fetch_tree.rb create mode 100644 owl-bot-staging/google-cloud-secure_source_manager-v1/snippets/secure_source_manager/get_branch_rule.rb create mode 100644 owl-bot-staging/google-cloud-secure_source_manager-v1/snippets/secure_source_manager/get_hook.rb create mode 100644 owl-bot-staging/google-cloud-secure_source_manager-v1/snippets/secure_source_manager/get_iam_policy_repo.rb create mode 100644 owl-bot-staging/google-cloud-secure_source_manager-v1/snippets/secure_source_manager/get_instance.rb create mode 100644 owl-bot-staging/google-cloud-secure_source_manager-v1/snippets/secure_source_manager/get_issue.rb create mode 100644 owl-bot-staging/google-cloud-secure_source_manager-v1/snippets/secure_source_manager/get_issue_comment.rb create mode 100644 owl-bot-staging/google-cloud-secure_source_manager-v1/snippets/secure_source_manager/get_pull_request.rb create mode 100644 owl-bot-staging/google-cloud-secure_source_manager-v1/snippets/secure_source_manager/get_pull_request_comment.rb create mode 100644 owl-bot-staging/google-cloud-secure_source_manager-v1/snippets/secure_source_manager/get_repository.rb create mode 100644 owl-bot-staging/google-cloud-secure_source_manager-v1/snippets/secure_source_manager/list_branch_rules.rb create mode 100644 owl-bot-staging/google-cloud-secure_source_manager-v1/snippets/secure_source_manager/list_hooks.rb create mode 100644 owl-bot-staging/google-cloud-secure_source_manager-v1/snippets/secure_source_manager/list_instances.rb create mode 100644 owl-bot-staging/google-cloud-secure_source_manager-v1/snippets/secure_source_manager/list_issue_comments.rb create mode 100644 owl-bot-staging/google-cloud-secure_source_manager-v1/snippets/secure_source_manager/list_issues.rb create mode 100644 owl-bot-staging/google-cloud-secure_source_manager-v1/snippets/secure_source_manager/list_pull_request_comments.rb create mode 100644 owl-bot-staging/google-cloud-secure_source_manager-v1/snippets/secure_source_manager/list_pull_request_file_diffs.rb create mode 100644 owl-bot-staging/google-cloud-secure_source_manager-v1/snippets/secure_source_manager/list_pull_requests.rb create mode 100644 owl-bot-staging/google-cloud-secure_source_manager-v1/snippets/secure_source_manager/list_repositories.rb create mode 100644 owl-bot-staging/google-cloud-secure_source_manager-v1/snippets/secure_source_manager/merge_pull_request.rb create mode 100644 owl-bot-staging/google-cloud-secure_source_manager-v1/snippets/secure_source_manager/open_issue.rb create mode 100644 owl-bot-staging/google-cloud-secure_source_manager-v1/snippets/secure_source_manager/open_pull_request.rb create mode 100644 owl-bot-staging/google-cloud-secure_source_manager-v1/snippets/secure_source_manager/resolve_pull_request_comments.rb create mode 100644 owl-bot-staging/google-cloud-secure_source_manager-v1/snippets/secure_source_manager/set_iam_policy_repo.rb create mode 100644 owl-bot-staging/google-cloud-secure_source_manager-v1/snippets/secure_source_manager/test_iam_permissions_repo.rb create mode 100644 owl-bot-staging/google-cloud-secure_source_manager-v1/snippets/secure_source_manager/unresolve_pull_request_comments.rb create mode 100644 owl-bot-staging/google-cloud-secure_source_manager-v1/snippets/secure_source_manager/update_branch_rule.rb create mode 100644 owl-bot-staging/google-cloud-secure_source_manager-v1/snippets/secure_source_manager/update_hook.rb create mode 100644 owl-bot-staging/google-cloud-secure_source_manager-v1/snippets/secure_source_manager/update_issue.rb create mode 100644 owl-bot-staging/google-cloud-secure_source_manager-v1/snippets/secure_source_manager/update_issue_comment.rb create mode 100644 owl-bot-staging/google-cloud-secure_source_manager-v1/snippets/secure_source_manager/update_pull_request.rb create mode 100644 owl-bot-staging/google-cloud-secure_source_manager-v1/snippets/secure_source_manager/update_pull_request_comment.rb create mode 100644 owl-bot-staging/google-cloud-secure_source_manager-v1/snippets/secure_source_manager/update_repository.rb create mode 100644 owl-bot-staging/google-cloud-secure_source_manager-v1/snippets/snippet_metadata_google.cloud.securesourcemanager.v1.json create mode 100644 owl-bot-staging/google-cloud-secure_source_manager-v1/test/google/cloud/secure_source_manager/v1/secure_source_manager_operations_test.rb create mode 100644 owl-bot-staging/google-cloud-secure_source_manager-v1/test/google/cloud/secure_source_manager/v1/secure_source_manager_paths_test.rb create mode 100644 owl-bot-staging/google-cloud-secure_source_manager-v1/test/google/cloud/secure_source_manager/v1/secure_source_manager_rest_test.rb create mode 100644 owl-bot-staging/google-cloud-secure_source_manager-v1/test/google/cloud/secure_source_manager/v1/secure_source_manager_test.rb create mode 100644 owl-bot-staging/google-cloud-secure_source_manager-v1/test/helper.rb create mode 100644 owl-bot-staging/google-cloud-security-private_ca-v1/.gitignore create mode 100644 owl-bot-staging/google-cloud-security-private_ca-v1/.repo-metadata.json create mode 100644 owl-bot-staging/google-cloud-security-private_ca-v1/.rubocop.yml create mode 100644 owl-bot-staging/google-cloud-security-private_ca-v1/.toys.rb create mode 100644 owl-bot-staging/google-cloud-security-private_ca-v1/.yardopts create mode 100644 owl-bot-staging/google-cloud-security-private_ca-v1/AUTHENTICATION.md create mode 100644 owl-bot-staging/google-cloud-security-private_ca-v1/CHANGELOG.md create mode 100644 owl-bot-staging/google-cloud-security-private_ca-v1/Gemfile create mode 100644 owl-bot-staging/google-cloud-security-private_ca-v1/LICENSE.md create mode 100644 owl-bot-staging/google-cloud-security-private_ca-v1/README.md create mode 100644 owl-bot-staging/google-cloud-security-private_ca-v1/Rakefile create mode 100644 owl-bot-staging/google-cloud-security-private_ca-v1/gapic_metadata.json create mode 100644 owl-bot-staging/google-cloud-security-private_ca-v1/google-cloud-security-private_ca-v1.gemspec create mode 100644 owl-bot-staging/google-cloud-security-private_ca-v1/lib/google-cloud-security-private_ca-v1.rb create mode 100644 owl-bot-staging/google-cloud-security-private_ca-v1/lib/google/cloud/security/private_ca/v1.rb create mode 100644 owl-bot-staging/google-cloud-security-private_ca-v1/lib/google/cloud/security/private_ca/v1/bindings_override.rb create mode 100644 owl-bot-staging/google-cloud-security-private_ca-v1/lib/google/cloud/security/private_ca/v1/certificate_authority_service.rb create mode 100644 owl-bot-staging/google-cloud-security-private_ca-v1/lib/google/cloud/security/private_ca/v1/certificate_authority_service/client.rb create mode 100644 owl-bot-staging/google-cloud-security-private_ca-v1/lib/google/cloud/security/private_ca/v1/certificate_authority_service/credentials.rb create mode 100644 owl-bot-staging/google-cloud-security-private_ca-v1/lib/google/cloud/security/private_ca/v1/certificate_authority_service/operations.rb create mode 100644 owl-bot-staging/google-cloud-security-private_ca-v1/lib/google/cloud/security/private_ca/v1/certificate_authority_service/paths.rb create mode 100644 owl-bot-staging/google-cloud-security-private_ca-v1/lib/google/cloud/security/private_ca/v1/certificate_authority_service/rest.rb create mode 100644 owl-bot-staging/google-cloud-security-private_ca-v1/lib/google/cloud/security/private_ca/v1/certificate_authority_service/rest/client.rb create mode 100644 owl-bot-staging/google-cloud-security-private_ca-v1/lib/google/cloud/security/private_ca/v1/certificate_authority_service/rest/operations.rb create mode 100644 owl-bot-staging/google-cloud-security-private_ca-v1/lib/google/cloud/security/private_ca/v1/certificate_authority_service/rest/service_stub.rb create mode 100644 owl-bot-staging/google-cloud-security-private_ca-v1/lib/google/cloud/security/private_ca/v1/rest.rb create mode 100644 owl-bot-staging/google-cloud-security-private_ca-v1/lib/google/cloud/security/private_ca/v1/version.rb create mode 100644 owl-bot-staging/google-cloud-security-private_ca-v1/lib/google/cloud/security/privateca/v1/resources_pb.rb create mode 100644 owl-bot-staging/google-cloud-security-private_ca-v1/lib/google/cloud/security/privateca/v1/service_pb.rb create mode 100644 owl-bot-staging/google-cloud-security-private_ca-v1/lib/google/cloud/security/privateca/v1/service_services_pb.rb create mode 100644 owl-bot-staging/google-cloud-security-private_ca-v1/proto_docs/README.md create mode 100644 owl-bot-staging/google-cloud-security-private_ca-v1/proto_docs/google/api/client.rb create mode 100644 owl-bot-staging/google-cloud-security-private_ca-v1/proto_docs/google/api/field_behavior.rb create mode 100644 owl-bot-staging/google-cloud-security-private_ca-v1/proto_docs/google/api/field_info.rb create mode 100644 owl-bot-staging/google-cloud-security-private_ca-v1/proto_docs/google/api/launch_stage.rb create mode 100644 owl-bot-staging/google-cloud-security-private_ca-v1/proto_docs/google/api/resource.rb create mode 100644 owl-bot-staging/google-cloud-security-private_ca-v1/proto_docs/google/cloud/security/privateca/v1/resources.rb create mode 100644 owl-bot-staging/google-cloud-security-private_ca-v1/proto_docs/google/cloud/security/privateca/v1/service.rb create mode 100644 owl-bot-staging/google-cloud-security-private_ca-v1/proto_docs/google/longrunning/operations.rb create mode 100644 owl-bot-staging/google-cloud-security-private_ca-v1/proto_docs/google/protobuf/any.rb create mode 100644 owl-bot-staging/google-cloud-security-private_ca-v1/proto_docs/google/protobuf/duration.rb create mode 100644 owl-bot-staging/google-cloud-security-private_ca-v1/proto_docs/google/protobuf/empty.rb create mode 100644 owl-bot-staging/google-cloud-security-private_ca-v1/proto_docs/google/protobuf/field_mask.rb create mode 100644 owl-bot-staging/google-cloud-security-private_ca-v1/proto_docs/google/protobuf/timestamp.rb create mode 100644 owl-bot-staging/google-cloud-security-private_ca-v1/proto_docs/google/rpc/status.rb create mode 100644 owl-bot-staging/google-cloud-security-private_ca-v1/proto_docs/google/type/expr.rb create mode 100644 owl-bot-staging/google-cloud-security-private_ca-v1/snippets/Gemfile create mode 100644 owl-bot-staging/google-cloud-security-private_ca-v1/snippets/certificate_authority_service/activate_certificate_authority.rb create mode 100644 owl-bot-staging/google-cloud-security-private_ca-v1/snippets/certificate_authority_service/create_ca_pool.rb create mode 100644 owl-bot-staging/google-cloud-security-private_ca-v1/snippets/certificate_authority_service/create_certificate.rb create mode 100644 owl-bot-staging/google-cloud-security-private_ca-v1/snippets/certificate_authority_service/create_certificate_authority.rb create mode 100644 owl-bot-staging/google-cloud-security-private_ca-v1/snippets/certificate_authority_service/create_certificate_template.rb create mode 100644 owl-bot-staging/google-cloud-security-private_ca-v1/snippets/certificate_authority_service/delete_ca_pool.rb create mode 100644 owl-bot-staging/google-cloud-security-private_ca-v1/snippets/certificate_authority_service/delete_certificate_authority.rb create mode 100644 owl-bot-staging/google-cloud-security-private_ca-v1/snippets/certificate_authority_service/delete_certificate_template.rb create mode 100644 owl-bot-staging/google-cloud-security-private_ca-v1/snippets/certificate_authority_service/disable_certificate_authority.rb create mode 100644 owl-bot-staging/google-cloud-security-private_ca-v1/snippets/certificate_authority_service/enable_certificate_authority.rb create mode 100644 owl-bot-staging/google-cloud-security-private_ca-v1/snippets/certificate_authority_service/fetch_ca_certs.rb create mode 100644 owl-bot-staging/google-cloud-security-private_ca-v1/snippets/certificate_authority_service/fetch_certificate_authority_csr.rb create mode 100644 owl-bot-staging/google-cloud-security-private_ca-v1/snippets/certificate_authority_service/get_ca_pool.rb create mode 100644 owl-bot-staging/google-cloud-security-private_ca-v1/snippets/certificate_authority_service/get_certificate.rb create mode 100644 owl-bot-staging/google-cloud-security-private_ca-v1/snippets/certificate_authority_service/get_certificate_authority.rb create mode 100644 owl-bot-staging/google-cloud-security-private_ca-v1/snippets/certificate_authority_service/get_certificate_revocation_list.rb create mode 100644 owl-bot-staging/google-cloud-security-private_ca-v1/snippets/certificate_authority_service/get_certificate_template.rb create mode 100644 owl-bot-staging/google-cloud-security-private_ca-v1/snippets/certificate_authority_service/list_ca_pools.rb create mode 100644 owl-bot-staging/google-cloud-security-private_ca-v1/snippets/certificate_authority_service/list_certificate_authorities.rb create mode 100644 owl-bot-staging/google-cloud-security-private_ca-v1/snippets/certificate_authority_service/list_certificate_revocation_lists.rb create mode 100644 owl-bot-staging/google-cloud-security-private_ca-v1/snippets/certificate_authority_service/list_certificate_templates.rb create mode 100644 owl-bot-staging/google-cloud-security-private_ca-v1/snippets/certificate_authority_service/list_certificates.rb create mode 100644 owl-bot-staging/google-cloud-security-private_ca-v1/snippets/certificate_authority_service/revoke_certificate.rb create mode 100644 owl-bot-staging/google-cloud-security-private_ca-v1/snippets/certificate_authority_service/undelete_certificate_authority.rb create mode 100644 owl-bot-staging/google-cloud-security-private_ca-v1/snippets/certificate_authority_service/update_ca_pool.rb create mode 100644 owl-bot-staging/google-cloud-security-private_ca-v1/snippets/certificate_authority_service/update_certificate.rb create mode 100644 owl-bot-staging/google-cloud-security-private_ca-v1/snippets/certificate_authority_service/update_certificate_authority.rb create mode 100644 owl-bot-staging/google-cloud-security-private_ca-v1/snippets/certificate_authority_service/update_certificate_revocation_list.rb create mode 100644 owl-bot-staging/google-cloud-security-private_ca-v1/snippets/certificate_authority_service/update_certificate_template.rb create mode 100644 owl-bot-staging/google-cloud-security-private_ca-v1/snippets/snippet_metadata_google.cloud.security.privateca.v1.json create mode 100644 owl-bot-staging/google-cloud-security-private_ca-v1/test/google/cloud/security/private_ca/v1/certificate_authority_service_operations_test.rb create mode 100644 owl-bot-staging/google-cloud-security-private_ca-v1/test/google/cloud/security/private_ca/v1/certificate_authority_service_paths_test.rb create mode 100644 owl-bot-staging/google-cloud-security-private_ca-v1/test/google/cloud/security/private_ca/v1/certificate_authority_service_rest_test.rb create mode 100644 owl-bot-staging/google-cloud-security-private_ca-v1/test/google/cloud/security/private_ca/v1/certificate_authority_service_test.rb create mode 100644 owl-bot-staging/google-cloud-security-private_ca-v1/test/helper.rb create mode 100644 owl-bot-staging/google-cloud-security-private_ca-v1beta1/.gitignore create mode 100644 owl-bot-staging/google-cloud-security-private_ca-v1beta1/.repo-metadata.json create mode 100644 owl-bot-staging/google-cloud-security-private_ca-v1beta1/.rubocop.yml create mode 100644 owl-bot-staging/google-cloud-security-private_ca-v1beta1/.toys.rb create mode 100644 owl-bot-staging/google-cloud-security-private_ca-v1beta1/.yardopts create mode 100644 owl-bot-staging/google-cloud-security-private_ca-v1beta1/AUTHENTICATION.md create mode 100644 owl-bot-staging/google-cloud-security-private_ca-v1beta1/CHANGELOG.md create mode 100644 owl-bot-staging/google-cloud-security-private_ca-v1beta1/Gemfile create mode 100644 owl-bot-staging/google-cloud-security-private_ca-v1beta1/LICENSE.md create mode 100644 owl-bot-staging/google-cloud-security-private_ca-v1beta1/README.md create mode 100644 owl-bot-staging/google-cloud-security-private_ca-v1beta1/Rakefile create mode 100644 owl-bot-staging/google-cloud-security-private_ca-v1beta1/gapic_metadata.json create mode 100644 owl-bot-staging/google-cloud-security-private_ca-v1beta1/google-cloud-security-private_ca-v1beta1.gemspec create mode 100644 owl-bot-staging/google-cloud-security-private_ca-v1beta1/lib/google-cloud-security-private_ca-v1beta1.rb create mode 100644 owl-bot-staging/google-cloud-security-private_ca-v1beta1/lib/google/cloud/security/private_ca/v1beta1.rb create mode 100644 owl-bot-staging/google-cloud-security-private_ca-v1beta1/lib/google/cloud/security/private_ca/v1beta1/certificate_authority_service.rb create mode 100644 owl-bot-staging/google-cloud-security-private_ca-v1beta1/lib/google/cloud/security/private_ca/v1beta1/certificate_authority_service/client.rb create mode 100644 owl-bot-staging/google-cloud-security-private_ca-v1beta1/lib/google/cloud/security/private_ca/v1beta1/certificate_authority_service/credentials.rb create mode 100644 owl-bot-staging/google-cloud-security-private_ca-v1beta1/lib/google/cloud/security/private_ca/v1beta1/certificate_authority_service/operations.rb create mode 100644 owl-bot-staging/google-cloud-security-private_ca-v1beta1/lib/google/cloud/security/private_ca/v1beta1/certificate_authority_service/paths.rb create mode 100644 owl-bot-staging/google-cloud-security-private_ca-v1beta1/lib/google/cloud/security/private_ca/v1beta1/certificate_authority_service/rest.rb create mode 100644 owl-bot-staging/google-cloud-security-private_ca-v1beta1/lib/google/cloud/security/private_ca/v1beta1/certificate_authority_service/rest/client.rb create mode 100644 owl-bot-staging/google-cloud-security-private_ca-v1beta1/lib/google/cloud/security/private_ca/v1beta1/certificate_authority_service/rest/operations.rb create mode 100644 owl-bot-staging/google-cloud-security-private_ca-v1beta1/lib/google/cloud/security/private_ca/v1beta1/certificate_authority_service/rest/service_stub.rb create mode 100644 owl-bot-staging/google-cloud-security-private_ca-v1beta1/lib/google/cloud/security/private_ca/v1beta1/rest.rb create mode 100644 owl-bot-staging/google-cloud-security-private_ca-v1beta1/lib/google/cloud/security/private_ca/v1beta1/version.rb create mode 100644 owl-bot-staging/google-cloud-security-private_ca-v1beta1/lib/google/cloud/security/privateca/v1beta1/resources_pb.rb create mode 100644 owl-bot-staging/google-cloud-security-private_ca-v1beta1/lib/google/cloud/security/privateca/v1beta1/service_pb.rb create mode 100644 owl-bot-staging/google-cloud-security-private_ca-v1beta1/lib/google/cloud/security/privateca/v1beta1/service_services_pb.rb create mode 100644 owl-bot-staging/google-cloud-security-private_ca-v1beta1/proto_docs/README.md create mode 100644 owl-bot-staging/google-cloud-security-private_ca-v1beta1/proto_docs/google/api/client.rb create mode 100644 owl-bot-staging/google-cloud-security-private_ca-v1beta1/proto_docs/google/api/field_behavior.rb create mode 100644 owl-bot-staging/google-cloud-security-private_ca-v1beta1/proto_docs/google/api/launch_stage.rb create mode 100644 owl-bot-staging/google-cloud-security-private_ca-v1beta1/proto_docs/google/api/resource.rb create mode 100644 owl-bot-staging/google-cloud-security-private_ca-v1beta1/proto_docs/google/cloud/security/privateca/v1beta1/resources.rb create mode 100644 owl-bot-staging/google-cloud-security-private_ca-v1beta1/proto_docs/google/cloud/security/privateca/v1beta1/service.rb create mode 100644 owl-bot-staging/google-cloud-security-private_ca-v1beta1/proto_docs/google/longrunning/operations.rb create mode 100644 owl-bot-staging/google-cloud-security-private_ca-v1beta1/proto_docs/google/protobuf/any.rb create mode 100644 owl-bot-staging/google-cloud-security-private_ca-v1beta1/proto_docs/google/protobuf/duration.rb create mode 100644 owl-bot-staging/google-cloud-security-private_ca-v1beta1/proto_docs/google/protobuf/empty.rb create mode 100644 owl-bot-staging/google-cloud-security-private_ca-v1beta1/proto_docs/google/protobuf/field_mask.rb create mode 100644 owl-bot-staging/google-cloud-security-private_ca-v1beta1/proto_docs/google/protobuf/timestamp.rb create mode 100644 owl-bot-staging/google-cloud-security-private_ca-v1beta1/proto_docs/google/protobuf/wrappers.rb create mode 100644 owl-bot-staging/google-cloud-security-private_ca-v1beta1/proto_docs/google/rpc/status.rb create mode 100644 owl-bot-staging/google-cloud-security-private_ca-v1beta1/snippets/Gemfile create mode 100644 owl-bot-staging/google-cloud-security-private_ca-v1beta1/snippets/certificate_authority_service/activate_certificate_authority.rb create mode 100644 owl-bot-staging/google-cloud-security-private_ca-v1beta1/snippets/certificate_authority_service/create_certificate.rb create mode 100644 owl-bot-staging/google-cloud-security-private_ca-v1beta1/snippets/certificate_authority_service/create_certificate_authority.rb create mode 100644 owl-bot-staging/google-cloud-security-private_ca-v1beta1/snippets/certificate_authority_service/disable_certificate_authority.rb create mode 100644 owl-bot-staging/google-cloud-security-private_ca-v1beta1/snippets/certificate_authority_service/enable_certificate_authority.rb create mode 100644 owl-bot-staging/google-cloud-security-private_ca-v1beta1/snippets/certificate_authority_service/fetch_certificate_authority_csr.rb create mode 100644 owl-bot-staging/google-cloud-security-private_ca-v1beta1/snippets/certificate_authority_service/get_certificate.rb create mode 100644 owl-bot-staging/google-cloud-security-private_ca-v1beta1/snippets/certificate_authority_service/get_certificate_authority.rb create mode 100644 owl-bot-staging/google-cloud-security-private_ca-v1beta1/snippets/certificate_authority_service/get_certificate_revocation_list.rb create mode 100644 owl-bot-staging/google-cloud-security-private_ca-v1beta1/snippets/certificate_authority_service/get_reusable_config.rb create mode 100644 owl-bot-staging/google-cloud-security-private_ca-v1beta1/snippets/certificate_authority_service/list_certificate_authorities.rb create mode 100644 owl-bot-staging/google-cloud-security-private_ca-v1beta1/snippets/certificate_authority_service/list_certificate_revocation_lists.rb create mode 100644 owl-bot-staging/google-cloud-security-private_ca-v1beta1/snippets/certificate_authority_service/list_certificates.rb create mode 100644 owl-bot-staging/google-cloud-security-private_ca-v1beta1/snippets/certificate_authority_service/list_reusable_configs.rb create mode 100644 owl-bot-staging/google-cloud-security-private_ca-v1beta1/snippets/certificate_authority_service/restore_certificate_authority.rb create mode 100644 owl-bot-staging/google-cloud-security-private_ca-v1beta1/snippets/certificate_authority_service/revoke_certificate.rb create mode 100644 owl-bot-staging/google-cloud-security-private_ca-v1beta1/snippets/certificate_authority_service/schedule_delete_certificate_authority.rb create mode 100644 owl-bot-staging/google-cloud-security-private_ca-v1beta1/snippets/certificate_authority_service/update_certificate.rb create mode 100644 owl-bot-staging/google-cloud-security-private_ca-v1beta1/snippets/certificate_authority_service/update_certificate_authority.rb create mode 100644 owl-bot-staging/google-cloud-security-private_ca-v1beta1/snippets/certificate_authority_service/update_certificate_revocation_list.rb create mode 100644 owl-bot-staging/google-cloud-security-private_ca-v1beta1/snippets/snippet_metadata_google.cloud.security.privateca.v1beta1.json create mode 100644 owl-bot-staging/google-cloud-security-private_ca-v1beta1/test/google/cloud/security/private_ca/v1beta1/certificate_authority_service_operations_test.rb create mode 100644 owl-bot-staging/google-cloud-security-private_ca-v1beta1/test/google/cloud/security/private_ca/v1beta1/certificate_authority_service_paths_test.rb create mode 100644 owl-bot-staging/google-cloud-security-private_ca-v1beta1/test/google/cloud/security/private_ca/v1beta1/certificate_authority_service_rest_test.rb create mode 100644 owl-bot-staging/google-cloud-security-private_ca-v1beta1/test/google/cloud/security/private_ca/v1beta1/certificate_authority_service_test.rb create mode 100644 owl-bot-staging/google-cloud-security-private_ca-v1beta1/test/helper.rb create mode 100644 owl-bot-staging/google-cloud-security-public_ca-v1/.gitignore create mode 100644 owl-bot-staging/google-cloud-security-public_ca-v1/.repo-metadata.json create mode 100644 owl-bot-staging/google-cloud-security-public_ca-v1/.rubocop.yml create mode 100644 owl-bot-staging/google-cloud-security-public_ca-v1/.toys.rb create mode 100644 owl-bot-staging/google-cloud-security-public_ca-v1/.yardopts create mode 100644 owl-bot-staging/google-cloud-security-public_ca-v1/AUTHENTICATION.md create mode 100644 owl-bot-staging/google-cloud-security-public_ca-v1/CHANGELOG.md create mode 100644 owl-bot-staging/google-cloud-security-public_ca-v1/Gemfile create mode 100644 owl-bot-staging/google-cloud-security-public_ca-v1/LICENSE.md create mode 100644 owl-bot-staging/google-cloud-security-public_ca-v1/README.md create mode 100644 owl-bot-staging/google-cloud-security-public_ca-v1/Rakefile create mode 100644 owl-bot-staging/google-cloud-security-public_ca-v1/gapic_metadata.json create mode 100644 owl-bot-staging/google-cloud-security-public_ca-v1/google-cloud-security-public_ca-v1.gemspec create mode 100644 owl-bot-staging/google-cloud-security-public_ca-v1/lib/google-cloud-security-public_ca-v1.rb create mode 100644 owl-bot-staging/google-cloud-security-public_ca-v1/lib/google/cloud/security/public_ca/v1.rb create mode 100644 owl-bot-staging/google-cloud-security-public_ca-v1/lib/google/cloud/security/public_ca/v1/public_certificate_authority_service.rb create mode 100644 owl-bot-staging/google-cloud-security-public_ca-v1/lib/google/cloud/security/public_ca/v1/public_certificate_authority_service/client.rb create mode 100644 owl-bot-staging/google-cloud-security-public_ca-v1/lib/google/cloud/security/public_ca/v1/public_certificate_authority_service/credentials.rb create mode 100644 owl-bot-staging/google-cloud-security-public_ca-v1/lib/google/cloud/security/public_ca/v1/public_certificate_authority_service/paths.rb create mode 100644 owl-bot-staging/google-cloud-security-public_ca-v1/lib/google/cloud/security/public_ca/v1/public_certificate_authority_service/rest.rb create mode 100644 owl-bot-staging/google-cloud-security-public_ca-v1/lib/google/cloud/security/public_ca/v1/public_certificate_authority_service/rest/client.rb create mode 100644 owl-bot-staging/google-cloud-security-public_ca-v1/lib/google/cloud/security/public_ca/v1/public_certificate_authority_service/rest/service_stub.rb create mode 100644 owl-bot-staging/google-cloud-security-public_ca-v1/lib/google/cloud/security/public_ca/v1/rest.rb create mode 100644 owl-bot-staging/google-cloud-security-public_ca-v1/lib/google/cloud/security/public_ca/v1/version.rb create mode 100644 owl-bot-staging/google-cloud-security-public_ca-v1/lib/google/cloud/security/publicca/v1/resources_pb.rb create mode 100644 owl-bot-staging/google-cloud-security-public_ca-v1/lib/google/cloud/security/publicca/v1/service_pb.rb create mode 100644 owl-bot-staging/google-cloud-security-public_ca-v1/lib/google/cloud/security/publicca/v1/service_services_pb.rb create mode 100644 owl-bot-staging/google-cloud-security-public_ca-v1/proto_docs/README.md create mode 100644 owl-bot-staging/google-cloud-security-public_ca-v1/proto_docs/google/api/client.rb create mode 100644 owl-bot-staging/google-cloud-security-public_ca-v1/proto_docs/google/api/field_behavior.rb create mode 100644 owl-bot-staging/google-cloud-security-public_ca-v1/proto_docs/google/api/launch_stage.rb create mode 100644 owl-bot-staging/google-cloud-security-public_ca-v1/proto_docs/google/api/resource.rb create mode 100644 owl-bot-staging/google-cloud-security-public_ca-v1/proto_docs/google/cloud/security/publicca/v1/resources.rb create mode 100644 owl-bot-staging/google-cloud-security-public_ca-v1/proto_docs/google/cloud/security/publicca/v1/service.rb create mode 100644 owl-bot-staging/google-cloud-security-public_ca-v1/proto_docs/google/protobuf/duration.rb create mode 100644 owl-bot-staging/google-cloud-security-public_ca-v1/snippets/Gemfile create mode 100644 owl-bot-staging/google-cloud-security-public_ca-v1/snippets/public_certificate_authority_service/create_external_account_key.rb create mode 100644 owl-bot-staging/google-cloud-security-public_ca-v1/snippets/snippet_metadata_google.cloud.security.publicca.v1.json create mode 100644 owl-bot-staging/google-cloud-security-public_ca-v1/test/google/cloud/security/public_ca/v1/public_certificate_authority_service_paths_test.rb create mode 100644 owl-bot-staging/google-cloud-security-public_ca-v1/test/google/cloud/security/public_ca/v1/public_certificate_authority_service_rest_test.rb create mode 100644 owl-bot-staging/google-cloud-security-public_ca-v1/test/google/cloud/security/public_ca/v1/public_certificate_authority_service_test.rb create mode 100644 owl-bot-staging/google-cloud-security-public_ca-v1/test/helper.rb create mode 100644 owl-bot-staging/google-cloud-security-public_ca-v1beta1/.gitignore create mode 100644 owl-bot-staging/google-cloud-security-public_ca-v1beta1/.repo-metadata.json create mode 100644 owl-bot-staging/google-cloud-security-public_ca-v1beta1/.rubocop.yml create mode 100644 owl-bot-staging/google-cloud-security-public_ca-v1beta1/.toys.rb create mode 100644 owl-bot-staging/google-cloud-security-public_ca-v1beta1/.yardopts create mode 100644 owl-bot-staging/google-cloud-security-public_ca-v1beta1/AUTHENTICATION.md create mode 100644 owl-bot-staging/google-cloud-security-public_ca-v1beta1/CHANGELOG.md create mode 100644 owl-bot-staging/google-cloud-security-public_ca-v1beta1/Gemfile create mode 100644 owl-bot-staging/google-cloud-security-public_ca-v1beta1/LICENSE.md create mode 100644 owl-bot-staging/google-cloud-security-public_ca-v1beta1/README.md create mode 100644 owl-bot-staging/google-cloud-security-public_ca-v1beta1/Rakefile create mode 100644 owl-bot-staging/google-cloud-security-public_ca-v1beta1/gapic_metadata.json create mode 100644 owl-bot-staging/google-cloud-security-public_ca-v1beta1/google-cloud-security-public_ca-v1beta1.gemspec create mode 100644 owl-bot-staging/google-cloud-security-public_ca-v1beta1/lib/google-cloud-security-public_ca-v1beta1.rb create mode 100644 owl-bot-staging/google-cloud-security-public_ca-v1beta1/lib/google/cloud/security/public_ca/v1beta1.rb create mode 100644 owl-bot-staging/google-cloud-security-public_ca-v1beta1/lib/google/cloud/security/public_ca/v1beta1/public_certificate_authority_service.rb create mode 100644 owl-bot-staging/google-cloud-security-public_ca-v1beta1/lib/google/cloud/security/public_ca/v1beta1/public_certificate_authority_service/client.rb create mode 100644 owl-bot-staging/google-cloud-security-public_ca-v1beta1/lib/google/cloud/security/public_ca/v1beta1/public_certificate_authority_service/credentials.rb create mode 100644 owl-bot-staging/google-cloud-security-public_ca-v1beta1/lib/google/cloud/security/public_ca/v1beta1/public_certificate_authority_service/paths.rb create mode 100644 owl-bot-staging/google-cloud-security-public_ca-v1beta1/lib/google/cloud/security/public_ca/v1beta1/public_certificate_authority_service/rest.rb create mode 100644 owl-bot-staging/google-cloud-security-public_ca-v1beta1/lib/google/cloud/security/public_ca/v1beta1/public_certificate_authority_service/rest/client.rb create mode 100644 owl-bot-staging/google-cloud-security-public_ca-v1beta1/lib/google/cloud/security/public_ca/v1beta1/public_certificate_authority_service/rest/service_stub.rb create mode 100644 owl-bot-staging/google-cloud-security-public_ca-v1beta1/lib/google/cloud/security/public_ca/v1beta1/rest.rb create mode 100644 owl-bot-staging/google-cloud-security-public_ca-v1beta1/lib/google/cloud/security/public_ca/v1beta1/version.rb create mode 100644 owl-bot-staging/google-cloud-security-public_ca-v1beta1/lib/google/cloud/security/publicca/v1beta1/resources_pb.rb create mode 100644 owl-bot-staging/google-cloud-security-public_ca-v1beta1/lib/google/cloud/security/publicca/v1beta1/service_pb.rb create mode 100644 owl-bot-staging/google-cloud-security-public_ca-v1beta1/lib/google/cloud/security/publicca/v1beta1/service_services_pb.rb create mode 100644 owl-bot-staging/google-cloud-security-public_ca-v1beta1/proto_docs/README.md create mode 100644 owl-bot-staging/google-cloud-security-public_ca-v1beta1/proto_docs/google/api/client.rb create mode 100644 owl-bot-staging/google-cloud-security-public_ca-v1beta1/proto_docs/google/api/field_behavior.rb create mode 100644 owl-bot-staging/google-cloud-security-public_ca-v1beta1/proto_docs/google/api/launch_stage.rb create mode 100644 owl-bot-staging/google-cloud-security-public_ca-v1beta1/proto_docs/google/api/resource.rb create mode 100644 owl-bot-staging/google-cloud-security-public_ca-v1beta1/proto_docs/google/cloud/security/publicca/v1beta1/resources.rb create mode 100644 owl-bot-staging/google-cloud-security-public_ca-v1beta1/proto_docs/google/cloud/security/publicca/v1beta1/service.rb create mode 100644 owl-bot-staging/google-cloud-security-public_ca-v1beta1/proto_docs/google/protobuf/duration.rb create mode 100644 owl-bot-staging/google-cloud-security-public_ca-v1beta1/snippets/Gemfile create mode 100644 owl-bot-staging/google-cloud-security-public_ca-v1beta1/snippets/public_certificate_authority_service/create_external_account_key.rb create mode 100644 owl-bot-staging/google-cloud-security-public_ca-v1beta1/snippets/snippet_metadata_google.cloud.security.publicca.v1beta1.json create mode 100644 owl-bot-staging/google-cloud-security-public_ca-v1beta1/test/google/cloud/security/public_ca/v1beta1/public_certificate_authority_service_paths_test.rb create mode 100644 owl-bot-staging/google-cloud-security-public_ca-v1beta1/test/google/cloud/security/public_ca/v1beta1/public_certificate_authority_service_rest_test.rb create mode 100644 owl-bot-staging/google-cloud-security-public_ca-v1beta1/test/google/cloud/security/public_ca/v1beta1/public_certificate_authority_service_test.rb create mode 100644 owl-bot-staging/google-cloud-security-public_ca-v1beta1/test/helper.rb create mode 100644 owl-bot-staging/google-cloud-security_center-v1/.gitignore create mode 100644 owl-bot-staging/google-cloud-security_center-v1/.repo-metadata.json create mode 100644 owl-bot-staging/google-cloud-security_center-v1/.rubocop.yml create mode 100644 owl-bot-staging/google-cloud-security_center-v1/.toys.rb create mode 100644 owl-bot-staging/google-cloud-security_center-v1/.yardopts create mode 100644 owl-bot-staging/google-cloud-security_center-v1/AUTHENTICATION.md create mode 100644 owl-bot-staging/google-cloud-security_center-v1/CHANGELOG.md create mode 100644 owl-bot-staging/google-cloud-security_center-v1/Gemfile create mode 100644 owl-bot-staging/google-cloud-security_center-v1/LICENSE.md create mode 100644 owl-bot-staging/google-cloud-security_center-v1/README.md create mode 100644 owl-bot-staging/google-cloud-security_center-v1/Rakefile create mode 100644 owl-bot-staging/google-cloud-security_center-v1/gapic_metadata.json create mode 100644 owl-bot-staging/google-cloud-security_center-v1/google-cloud-security_center-v1.gemspec create mode 100644 owl-bot-staging/google-cloud-security_center-v1/lib/google-cloud-security_center-v1.rb create mode 100644 owl-bot-staging/google-cloud-security_center-v1/lib/google/cloud/security_center/v1.rb create mode 100644 owl-bot-staging/google-cloud-security_center-v1/lib/google/cloud/security_center/v1/rest.rb create mode 100644 owl-bot-staging/google-cloud-security_center-v1/lib/google/cloud/security_center/v1/security_center.rb create mode 100644 owl-bot-staging/google-cloud-security_center-v1/lib/google/cloud/security_center/v1/security_center/client.rb create mode 100644 owl-bot-staging/google-cloud-security_center-v1/lib/google/cloud/security_center/v1/security_center/credentials.rb create mode 100644 owl-bot-staging/google-cloud-security_center-v1/lib/google/cloud/security_center/v1/security_center/operations.rb create mode 100644 owl-bot-staging/google-cloud-security_center-v1/lib/google/cloud/security_center/v1/security_center/paths.rb create mode 100644 owl-bot-staging/google-cloud-security_center-v1/lib/google/cloud/security_center/v1/security_center/rest.rb create mode 100644 owl-bot-staging/google-cloud-security_center-v1/lib/google/cloud/security_center/v1/security_center/rest/client.rb create mode 100644 owl-bot-staging/google-cloud-security_center-v1/lib/google/cloud/security_center/v1/security_center/rest/operations.rb create mode 100644 owl-bot-staging/google-cloud-security_center-v1/lib/google/cloud/security_center/v1/security_center/rest/service_stub.rb create mode 100644 owl-bot-staging/google-cloud-security_center-v1/lib/google/cloud/security_center/v1/version.rb create mode 100644 owl-bot-staging/google-cloud-security_center-v1/lib/google/cloud/securitycenter/v1/access_pb.rb create mode 100644 owl-bot-staging/google-cloud-security_center-v1/lib/google/cloud/securitycenter/v1/application_pb.rb create mode 100644 owl-bot-staging/google-cloud-security_center-v1/lib/google/cloud/securitycenter/v1/asset_pb.rb create mode 100644 owl-bot-staging/google-cloud-security_center-v1/lib/google/cloud/securitycenter/v1/attack_exposure_pb.rb create mode 100644 owl-bot-staging/google-cloud-security_center-v1/lib/google/cloud/securitycenter/v1/attack_path_pb.rb create mode 100644 owl-bot-staging/google-cloud-security_center-v1/lib/google/cloud/securitycenter/v1/backup_disaster_recovery_pb.rb create mode 100644 owl-bot-staging/google-cloud-security_center-v1/lib/google/cloud/securitycenter/v1/bigquery_export_pb.rb create mode 100644 owl-bot-staging/google-cloud-security_center-v1/lib/google/cloud/securitycenter/v1/chokepoint_pb.rb create mode 100644 owl-bot-staging/google-cloud-security_center-v1/lib/google/cloud/securitycenter/v1/cloud_armor_pb.rb create mode 100644 owl-bot-staging/google-cloud-security_center-v1/lib/google/cloud/securitycenter/v1/cloud_dlp_data_profile_pb.rb create mode 100644 owl-bot-staging/google-cloud-security_center-v1/lib/google/cloud/securitycenter/v1/cloud_dlp_inspection_pb.rb create mode 100644 owl-bot-staging/google-cloud-security_center-v1/lib/google/cloud/securitycenter/v1/compliance_pb.rb create mode 100644 owl-bot-staging/google-cloud-security_center-v1/lib/google/cloud/securitycenter/v1/connection_pb.rb create mode 100644 owl-bot-staging/google-cloud-security_center-v1/lib/google/cloud/securitycenter/v1/contact_details_pb.rb create mode 100644 owl-bot-staging/google-cloud-security_center-v1/lib/google/cloud/securitycenter/v1/container_pb.rb create mode 100644 owl-bot-staging/google-cloud-security_center-v1/lib/google/cloud/securitycenter/v1/database_pb.rb create mode 100644 owl-bot-staging/google-cloud-security_center-v1/lib/google/cloud/securitycenter/v1/effective_event_threat_detection_custom_module_pb.rb create mode 100644 owl-bot-staging/google-cloud-security_center-v1/lib/google/cloud/securitycenter/v1/effective_security_health_analytics_custom_module_pb.rb create mode 100644 owl-bot-staging/google-cloud-security_center-v1/lib/google/cloud/securitycenter/v1/event_threat_detection_custom_module_pb.rb create mode 100644 owl-bot-staging/google-cloud-security_center-v1/lib/google/cloud/securitycenter/v1/event_threat_detection_custom_module_validation_errors_pb.rb create mode 100644 owl-bot-staging/google-cloud-security_center-v1/lib/google/cloud/securitycenter/v1/exfiltration_pb.rb create mode 100644 owl-bot-staging/google-cloud-security_center-v1/lib/google/cloud/securitycenter/v1/external_exposure_pb.rb create mode 100644 owl-bot-staging/google-cloud-security_center-v1/lib/google/cloud/securitycenter/v1/external_system_pb.rb create mode 100644 owl-bot-staging/google-cloud-security_center-v1/lib/google/cloud/securitycenter/v1/file_pb.rb create mode 100644 owl-bot-staging/google-cloud-security_center-v1/lib/google/cloud/securitycenter/v1/finding_pb.rb create mode 100644 owl-bot-staging/google-cloud-security_center-v1/lib/google/cloud/securitycenter/v1/folder_pb.rb create mode 100644 owl-bot-staging/google-cloud-security_center-v1/lib/google/cloud/securitycenter/v1/group_membership_pb.rb create mode 100644 owl-bot-staging/google-cloud-security_center-v1/lib/google/cloud/securitycenter/v1/iam_binding_pb.rb create mode 100644 owl-bot-staging/google-cloud-security_center-v1/lib/google/cloud/securitycenter/v1/indicator_pb.rb create mode 100644 owl-bot-staging/google-cloud-security_center-v1/lib/google/cloud/securitycenter/v1/kernel_rootkit_pb.rb create mode 100644 owl-bot-staging/google-cloud-security_center-v1/lib/google/cloud/securitycenter/v1/kubernetes_pb.rb create mode 100644 owl-bot-staging/google-cloud-security_center-v1/lib/google/cloud/securitycenter/v1/label_pb.rb create mode 100644 owl-bot-staging/google-cloud-security_center-v1/lib/google/cloud/securitycenter/v1/load_balancer_pb.rb create mode 100644 owl-bot-staging/google-cloud-security_center-v1/lib/google/cloud/securitycenter/v1/log_entry_pb.rb create mode 100644 owl-bot-staging/google-cloud-security_center-v1/lib/google/cloud/securitycenter/v1/mitre_attack_pb.rb create mode 100644 owl-bot-staging/google-cloud-security_center-v1/lib/google/cloud/securitycenter/v1/mute_config_pb.rb create mode 100644 owl-bot-staging/google-cloud-security_center-v1/lib/google/cloud/securitycenter/v1/notebook_pb.rb create mode 100644 owl-bot-staging/google-cloud-security_center-v1/lib/google/cloud/securitycenter/v1/notification_config_pb.rb create mode 100644 owl-bot-staging/google-cloud-security_center-v1/lib/google/cloud/securitycenter/v1/notification_message_pb.rb create mode 100644 owl-bot-staging/google-cloud-security_center-v1/lib/google/cloud/securitycenter/v1/org_policy_pb.rb create mode 100644 owl-bot-staging/google-cloud-security_center-v1/lib/google/cloud/securitycenter/v1/organization_settings_pb.rb create mode 100644 owl-bot-staging/google-cloud-security_center-v1/lib/google/cloud/securitycenter/v1/process_pb.rb create mode 100644 owl-bot-staging/google-cloud-security_center-v1/lib/google/cloud/securitycenter/v1/resource_pb.rb create mode 100644 owl-bot-staging/google-cloud-security_center-v1/lib/google/cloud/securitycenter/v1/resource_value_config_pb.rb create mode 100644 owl-bot-staging/google-cloud-security_center-v1/lib/google/cloud/securitycenter/v1/run_asset_discovery_response_pb.rb create mode 100644 owl-bot-staging/google-cloud-security_center-v1/lib/google/cloud/securitycenter/v1/security_health_analytics_custom_config_pb.rb create mode 100644 owl-bot-staging/google-cloud-security_center-v1/lib/google/cloud/securitycenter/v1/security_health_analytics_custom_module_pb.rb create mode 100644 owl-bot-staging/google-cloud-security_center-v1/lib/google/cloud/securitycenter/v1/security_marks_pb.rb create mode 100644 owl-bot-staging/google-cloud-security_center-v1/lib/google/cloud/securitycenter/v1/security_posture_pb.rb create mode 100644 owl-bot-staging/google-cloud-security_center-v1/lib/google/cloud/securitycenter/v1/securitycenter_service_pb.rb create mode 100644 owl-bot-staging/google-cloud-security_center-v1/lib/google/cloud/securitycenter/v1/securitycenter_service_services_pb.rb create mode 100644 owl-bot-staging/google-cloud-security_center-v1/lib/google/cloud/securitycenter/v1/simulation_pb.rb create mode 100644 owl-bot-staging/google-cloud-security_center-v1/lib/google/cloud/securitycenter/v1/source_pb.rb create mode 100644 owl-bot-staging/google-cloud-security_center-v1/lib/google/cloud/securitycenter/v1/toxic_combination_pb.rb create mode 100644 owl-bot-staging/google-cloud-security_center-v1/lib/google/cloud/securitycenter/v1/valued_resource_pb.rb create mode 100644 owl-bot-staging/google-cloud-security_center-v1/lib/google/cloud/securitycenter/v1/vulnerability_pb.rb create mode 100644 owl-bot-staging/google-cloud-security_center-v1/proto_docs/README.md create mode 100644 owl-bot-staging/google-cloud-security_center-v1/proto_docs/google/api/client.rb create mode 100644 owl-bot-staging/google-cloud-security_center-v1/proto_docs/google/api/field_behavior.rb create mode 100644 owl-bot-staging/google-cloud-security_center-v1/proto_docs/google/api/field_info.rb create mode 100644 owl-bot-staging/google-cloud-security_center-v1/proto_docs/google/api/launch_stage.rb create mode 100644 owl-bot-staging/google-cloud-security_center-v1/proto_docs/google/api/resource.rb create mode 100644 owl-bot-staging/google-cloud-security_center-v1/proto_docs/google/cloud/securitycenter/v1/access.rb create mode 100644 owl-bot-staging/google-cloud-security_center-v1/proto_docs/google/cloud/securitycenter/v1/application.rb create mode 100644 owl-bot-staging/google-cloud-security_center-v1/proto_docs/google/cloud/securitycenter/v1/asset.rb create mode 100644 owl-bot-staging/google-cloud-security_center-v1/proto_docs/google/cloud/securitycenter/v1/attack_exposure.rb create mode 100644 owl-bot-staging/google-cloud-security_center-v1/proto_docs/google/cloud/securitycenter/v1/attack_path.rb create mode 100644 owl-bot-staging/google-cloud-security_center-v1/proto_docs/google/cloud/securitycenter/v1/backup_disaster_recovery.rb create mode 100644 owl-bot-staging/google-cloud-security_center-v1/proto_docs/google/cloud/securitycenter/v1/bigquery_export.rb create mode 100644 owl-bot-staging/google-cloud-security_center-v1/proto_docs/google/cloud/securitycenter/v1/chokepoint.rb create mode 100644 owl-bot-staging/google-cloud-security_center-v1/proto_docs/google/cloud/securitycenter/v1/cloud_armor.rb create mode 100644 owl-bot-staging/google-cloud-security_center-v1/proto_docs/google/cloud/securitycenter/v1/cloud_dlp_data_profile.rb create mode 100644 owl-bot-staging/google-cloud-security_center-v1/proto_docs/google/cloud/securitycenter/v1/cloud_dlp_inspection.rb create mode 100644 owl-bot-staging/google-cloud-security_center-v1/proto_docs/google/cloud/securitycenter/v1/compliance.rb create mode 100644 owl-bot-staging/google-cloud-security_center-v1/proto_docs/google/cloud/securitycenter/v1/connection.rb create mode 100644 owl-bot-staging/google-cloud-security_center-v1/proto_docs/google/cloud/securitycenter/v1/contact_details.rb create mode 100644 owl-bot-staging/google-cloud-security_center-v1/proto_docs/google/cloud/securitycenter/v1/container.rb create mode 100644 owl-bot-staging/google-cloud-security_center-v1/proto_docs/google/cloud/securitycenter/v1/database.rb create mode 100644 owl-bot-staging/google-cloud-security_center-v1/proto_docs/google/cloud/securitycenter/v1/effective_event_threat_detection_custom_module.rb create mode 100644 owl-bot-staging/google-cloud-security_center-v1/proto_docs/google/cloud/securitycenter/v1/effective_security_health_analytics_custom_module.rb create mode 100644 owl-bot-staging/google-cloud-security_center-v1/proto_docs/google/cloud/securitycenter/v1/event_threat_detection_custom_module.rb create mode 100644 owl-bot-staging/google-cloud-security_center-v1/proto_docs/google/cloud/securitycenter/v1/event_threat_detection_custom_module_validation_errors.rb create mode 100644 owl-bot-staging/google-cloud-security_center-v1/proto_docs/google/cloud/securitycenter/v1/exfiltration.rb create mode 100644 owl-bot-staging/google-cloud-security_center-v1/proto_docs/google/cloud/securitycenter/v1/external_exposure.rb create mode 100644 owl-bot-staging/google-cloud-security_center-v1/proto_docs/google/cloud/securitycenter/v1/external_system.rb create mode 100644 owl-bot-staging/google-cloud-security_center-v1/proto_docs/google/cloud/securitycenter/v1/file.rb create mode 100644 owl-bot-staging/google-cloud-security_center-v1/proto_docs/google/cloud/securitycenter/v1/finding.rb create mode 100644 owl-bot-staging/google-cloud-security_center-v1/proto_docs/google/cloud/securitycenter/v1/folder.rb create mode 100644 owl-bot-staging/google-cloud-security_center-v1/proto_docs/google/cloud/securitycenter/v1/group_membership.rb create mode 100644 owl-bot-staging/google-cloud-security_center-v1/proto_docs/google/cloud/securitycenter/v1/iam_binding.rb create mode 100644 owl-bot-staging/google-cloud-security_center-v1/proto_docs/google/cloud/securitycenter/v1/indicator.rb create mode 100644 owl-bot-staging/google-cloud-security_center-v1/proto_docs/google/cloud/securitycenter/v1/kernel_rootkit.rb create mode 100644 owl-bot-staging/google-cloud-security_center-v1/proto_docs/google/cloud/securitycenter/v1/kubernetes.rb create mode 100644 owl-bot-staging/google-cloud-security_center-v1/proto_docs/google/cloud/securitycenter/v1/label.rb create mode 100644 owl-bot-staging/google-cloud-security_center-v1/proto_docs/google/cloud/securitycenter/v1/load_balancer.rb create mode 100644 owl-bot-staging/google-cloud-security_center-v1/proto_docs/google/cloud/securitycenter/v1/log_entry.rb create mode 100644 owl-bot-staging/google-cloud-security_center-v1/proto_docs/google/cloud/securitycenter/v1/mitre_attack.rb create mode 100644 owl-bot-staging/google-cloud-security_center-v1/proto_docs/google/cloud/securitycenter/v1/mute_config.rb create mode 100644 owl-bot-staging/google-cloud-security_center-v1/proto_docs/google/cloud/securitycenter/v1/notebook.rb create mode 100644 owl-bot-staging/google-cloud-security_center-v1/proto_docs/google/cloud/securitycenter/v1/notification_config.rb create mode 100644 owl-bot-staging/google-cloud-security_center-v1/proto_docs/google/cloud/securitycenter/v1/notification_message.rb create mode 100644 owl-bot-staging/google-cloud-security_center-v1/proto_docs/google/cloud/securitycenter/v1/org_policy.rb create mode 100644 owl-bot-staging/google-cloud-security_center-v1/proto_docs/google/cloud/securitycenter/v1/organization_settings.rb create mode 100644 owl-bot-staging/google-cloud-security_center-v1/proto_docs/google/cloud/securitycenter/v1/process.rb create mode 100644 owl-bot-staging/google-cloud-security_center-v1/proto_docs/google/cloud/securitycenter/v1/resource.rb create mode 100644 owl-bot-staging/google-cloud-security_center-v1/proto_docs/google/cloud/securitycenter/v1/resource_value_config.rb create mode 100644 owl-bot-staging/google-cloud-security_center-v1/proto_docs/google/cloud/securitycenter/v1/run_asset_discovery_response.rb create mode 100644 owl-bot-staging/google-cloud-security_center-v1/proto_docs/google/cloud/securitycenter/v1/security_health_analytics_custom_config.rb create mode 100644 owl-bot-staging/google-cloud-security_center-v1/proto_docs/google/cloud/securitycenter/v1/security_health_analytics_custom_module.rb create mode 100644 owl-bot-staging/google-cloud-security_center-v1/proto_docs/google/cloud/securitycenter/v1/security_marks.rb create mode 100644 owl-bot-staging/google-cloud-security_center-v1/proto_docs/google/cloud/securitycenter/v1/security_posture.rb create mode 100644 owl-bot-staging/google-cloud-security_center-v1/proto_docs/google/cloud/securitycenter/v1/securitycenter_service.rb create mode 100644 owl-bot-staging/google-cloud-security_center-v1/proto_docs/google/cloud/securitycenter/v1/simulation.rb create mode 100644 owl-bot-staging/google-cloud-security_center-v1/proto_docs/google/cloud/securitycenter/v1/source.rb create mode 100644 owl-bot-staging/google-cloud-security_center-v1/proto_docs/google/cloud/securitycenter/v1/toxic_combination.rb create mode 100644 owl-bot-staging/google-cloud-security_center-v1/proto_docs/google/cloud/securitycenter/v1/valued_resource.rb create mode 100644 owl-bot-staging/google-cloud-security_center-v1/proto_docs/google/cloud/securitycenter/v1/vulnerability.rb create mode 100644 owl-bot-staging/google-cloud-security_center-v1/proto_docs/google/iam/v1/iam_policy.rb create mode 100644 owl-bot-staging/google-cloud-security_center-v1/proto_docs/google/iam/v1/options.rb create mode 100644 owl-bot-staging/google-cloud-security_center-v1/proto_docs/google/iam/v1/policy.rb create mode 100644 owl-bot-staging/google-cloud-security_center-v1/proto_docs/google/longrunning/operations.rb create mode 100644 owl-bot-staging/google-cloud-security_center-v1/proto_docs/google/protobuf/any.rb create mode 100644 owl-bot-staging/google-cloud-security_center-v1/proto_docs/google/protobuf/duration.rb create mode 100644 owl-bot-staging/google-cloud-security_center-v1/proto_docs/google/protobuf/empty.rb create mode 100644 owl-bot-staging/google-cloud-security_center-v1/proto_docs/google/protobuf/field_mask.rb create mode 100644 owl-bot-staging/google-cloud-security_center-v1/proto_docs/google/protobuf/struct.rb create mode 100644 owl-bot-staging/google-cloud-security_center-v1/proto_docs/google/protobuf/timestamp.rb create mode 100644 owl-bot-staging/google-cloud-security_center-v1/proto_docs/google/rpc/status.rb create mode 100644 owl-bot-staging/google-cloud-security_center-v1/proto_docs/google/type/expr.rb create mode 100644 owl-bot-staging/google-cloud-security_center-v1/snippets/Gemfile create mode 100644 owl-bot-staging/google-cloud-security_center-v1/snippets/security_center/batch_create_resource_value_configs.rb create mode 100644 owl-bot-staging/google-cloud-security_center-v1/snippets/security_center/bulk_mute_findings.rb create mode 100644 owl-bot-staging/google-cloud-security_center-v1/snippets/security_center/create_big_query_export.rb create mode 100644 owl-bot-staging/google-cloud-security_center-v1/snippets/security_center/create_event_threat_detection_custom_module.rb create mode 100644 owl-bot-staging/google-cloud-security_center-v1/snippets/security_center/create_finding.rb create mode 100644 owl-bot-staging/google-cloud-security_center-v1/snippets/security_center/create_mute_config.rb create mode 100644 owl-bot-staging/google-cloud-security_center-v1/snippets/security_center/create_notification_config.rb create mode 100644 owl-bot-staging/google-cloud-security_center-v1/snippets/security_center/create_security_health_analytics_custom_module.rb create mode 100644 owl-bot-staging/google-cloud-security_center-v1/snippets/security_center/create_source.rb create mode 100644 owl-bot-staging/google-cloud-security_center-v1/snippets/security_center/delete_big_query_export.rb create mode 100644 owl-bot-staging/google-cloud-security_center-v1/snippets/security_center/delete_event_threat_detection_custom_module.rb create mode 100644 owl-bot-staging/google-cloud-security_center-v1/snippets/security_center/delete_mute_config.rb create mode 100644 owl-bot-staging/google-cloud-security_center-v1/snippets/security_center/delete_notification_config.rb create mode 100644 owl-bot-staging/google-cloud-security_center-v1/snippets/security_center/delete_resource_value_config.rb create mode 100644 owl-bot-staging/google-cloud-security_center-v1/snippets/security_center/delete_security_health_analytics_custom_module.rb create mode 100644 owl-bot-staging/google-cloud-security_center-v1/snippets/security_center/get_big_query_export.rb create mode 100644 owl-bot-staging/google-cloud-security_center-v1/snippets/security_center/get_effective_event_threat_detection_custom_module.rb create mode 100644 owl-bot-staging/google-cloud-security_center-v1/snippets/security_center/get_effective_security_health_analytics_custom_module.rb create mode 100644 owl-bot-staging/google-cloud-security_center-v1/snippets/security_center/get_event_threat_detection_custom_module.rb create mode 100644 owl-bot-staging/google-cloud-security_center-v1/snippets/security_center/get_iam_policy.rb create mode 100644 owl-bot-staging/google-cloud-security_center-v1/snippets/security_center/get_mute_config.rb create mode 100644 owl-bot-staging/google-cloud-security_center-v1/snippets/security_center/get_notification_config.rb create mode 100644 owl-bot-staging/google-cloud-security_center-v1/snippets/security_center/get_organization_settings.rb create mode 100644 owl-bot-staging/google-cloud-security_center-v1/snippets/security_center/get_resource_value_config.rb create mode 100644 owl-bot-staging/google-cloud-security_center-v1/snippets/security_center/get_security_health_analytics_custom_module.rb create mode 100644 owl-bot-staging/google-cloud-security_center-v1/snippets/security_center/get_simulation.rb create mode 100644 owl-bot-staging/google-cloud-security_center-v1/snippets/security_center/get_source.rb create mode 100644 owl-bot-staging/google-cloud-security_center-v1/snippets/security_center/get_valued_resource.rb create mode 100644 owl-bot-staging/google-cloud-security_center-v1/snippets/security_center/group_assets.rb create mode 100644 owl-bot-staging/google-cloud-security_center-v1/snippets/security_center/group_findings.rb create mode 100644 owl-bot-staging/google-cloud-security_center-v1/snippets/security_center/list_assets.rb create mode 100644 owl-bot-staging/google-cloud-security_center-v1/snippets/security_center/list_attack_paths.rb create mode 100644 owl-bot-staging/google-cloud-security_center-v1/snippets/security_center/list_big_query_exports.rb create mode 100644 owl-bot-staging/google-cloud-security_center-v1/snippets/security_center/list_descendant_event_threat_detection_custom_modules.rb create mode 100644 owl-bot-staging/google-cloud-security_center-v1/snippets/security_center/list_descendant_security_health_analytics_custom_modules.rb create mode 100644 owl-bot-staging/google-cloud-security_center-v1/snippets/security_center/list_effective_event_threat_detection_custom_modules.rb create mode 100644 owl-bot-staging/google-cloud-security_center-v1/snippets/security_center/list_effective_security_health_analytics_custom_modules.rb create mode 100644 owl-bot-staging/google-cloud-security_center-v1/snippets/security_center/list_event_threat_detection_custom_modules.rb create mode 100644 owl-bot-staging/google-cloud-security_center-v1/snippets/security_center/list_findings.rb create mode 100644 owl-bot-staging/google-cloud-security_center-v1/snippets/security_center/list_mute_configs.rb create mode 100644 owl-bot-staging/google-cloud-security_center-v1/snippets/security_center/list_notification_configs.rb create mode 100644 owl-bot-staging/google-cloud-security_center-v1/snippets/security_center/list_resource_value_configs.rb create mode 100644 owl-bot-staging/google-cloud-security_center-v1/snippets/security_center/list_security_health_analytics_custom_modules.rb create mode 100644 owl-bot-staging/google-cloud-security_center-v1/snippets/security_center/list_sources.rb create mode 100644 owl-bot-staging/google-cloud-security_center-v1/snippets/security_center/list_valued_resources.rb create mode 100644 owl-bot-staging/google-cloud-security_center-v1/snippets/security_center/run_asset_discovery.rb create mode 100644 owl-bot-staging/google-cloud-security_center-v1/snippets/security_center/set_finding_state.rb create mode 100644 owl-bot-staging/google-cloud-security_center-v1/snippets/security_center/set_iam_policy.rb create mode 100644 owl-bot-staging/google-cloud-security_center-v1/snippets/security_center/set_mute.rb create mode 100644 owl-bot-staging/google-cloud-security_center-v1/snippets/security_center/simulate_security_health_analytics_custom_module.rb create mode 100644 owl-bot-staging/google-cloud-security_center-v1/snippets/security_center/test_iam_permissions.rb create mode 100644 owl-bot-staging/google-cloud-security_center-v1/snippets/security_center/update_big_query_export.rb create mode 100644 owl-bot-staging/google-cloud-security_center-v1/snippets/security_center/update_event_threat_detection_custom_module.rb create mode 100644 owl-bot-staging/google-cloud-security_center-v1/snippets/security_center/update_external_system.rb create mode 100644 owl-bot-staging/google-cloud-security_center-v1/snippets/security_center/update_finding.rb create mode 100644 owl-bot-staging/google-cloud-security_center-v1/snippets/security_center/update_mute_config.rb create mode 100644 owl-bot-staging/google-cloud-security_center-v1/snippets/security_center/update_notification_config.rb create mode 100644 owl-bot-staging/google-cloud-security_center-v1/snippets/security_center/update_organization_settings.rb create mode 100644 owl-bot-staging/google-cloud-security_center-v1/snippets/security_center/update_resource_value_config.rb create mode 100644 owl-bot-staging/google-cloud-security_center-v1/snippets/security_center/update_security_health_analytics_custom_module.rb create mode 100644 owl-bot-staging/google-cloud-security_center-v1/snippets/security_center/update_security_marks.rb create mode 100644 owl-bot-staging/google-cloud-security_center-v1/snippets/security_center/update_source.rb create mode 100644 owl-bot-staging/google-cloud-security_center-v1/snippets/security_center/validate_event_threat_detection_custom_module.rb create mode 100644 owl-bot-staging/google-cloud-security_center-v1/snippets/snippet_metadata_google.cloud.securitycenter.v1.json create mode 100644 owl-bot-staging/google-cloud-security_center-v1/test/google/cloud/security_center/v1/security_center_operations_test.rb create mode 100644 owl-bot-staging/google-cloud-security_center-v1/test/google/cloud/security_center/v1/security_center_paths_test.rb create mode 100644 owl-bot-staging/google-cloud-security_center-v1/test/google/cloud/security_center/v1/security_center_rest_test.rb create mode 100644 owl-bot-staging/google-cloud-security_center-v1/test/google/cloud/security_center/v1/security_center_test.rb create mode 100644 owl-bot-staging/google-cloud-security_center-v1/test/helper.rb create mode 100644 owl-bot-staging/google-cloud-security_center-v1p1beta1/.gitignore create mode 100644 owl-bot-staging/google-cloud-security_center-v1p1beta1/.repo-metadata.json create mode 100644 owl-bot-staging/google-cloud-security_center-v1p1beta1/.rubocop.yml create mode 100644 owl-bot-staging/google-cloud-security_center-v1p1beta1/.toys.rb create mode 100644 owl-bot-staging/google-cloud-security_center-v1p1beta1/.yardopts create mode 100644 owl-bot-staging/google-cloud-security_center-v1p1beta1/AUTHENTICATION.md create mode 100644 owl-bot-staging/google-cloud-security_center-v1p1beta1/CHANGELOG.md create mode 100644 owl-bot-staging/google-cloud-security_center-v1p1beta1/Gemfile create mode 100644 owl-bot-staging/google-cloud-security_center-v1p1beta1/LICENSE.md create mode 100644 owl-bot-staging/google-cloud-security_center-v1p1beta1/README.md create mode 100644 owl-bot-staging/google-cloud-security_center-v1p1beta1/Rakefile create mode 100644 owl-bot-staging/google-cloud-security_center-v1p1beta1/gapic_metadata.json create mode 100644 owl-bot-staging/google-cloud-security_center-v1p1beta1/google-cloud-security_center-v1p1beta1.gemspec create mode 100644 owl-bot-staging/google-cloud-security_center-v1p1beta1/lib/google-cloud-security_center-v1p1beta1.rb create mode 100644 owl-bot-staging/google-cloud-security_center-v1p1beta1/lib/google/cloud/security_center/v1p1beta1.rb create mode 100644 owl-bot-staging/google-cloud-security_center-v1p1beta1/lib/google/cloud/security_center/v1p1beta1/rest.rb create mode 100644 owl-bot-staging/google-cloud-security_center-v1p1beta1/lib/google/cloud/security_center/v1p1beta1/security_center.rb create mode 100644 owl-bot-staging/google-cloud-security_center-v1p1beta1/lib/google/cloud/security_center/v1p1beta1/security_center/client.rb create mode 100644 owl-bot-staging/google-cloud-security_center-v1p1beta1/lib/google/cloud/security_center/v1p1beta1/security_center/credentials.rb create mode 100644 owl-bot-staging/google-cloud-security_center-v1p1beta1/lib/google/cloud/security_center/v1p1beta1/security_center/operations.rb create mode 100644 owl-bot-staging/google-cloud-security_center-v1p1beta1/lib/google/cloud/security_center/v1p1beta1/security_center/paths.rb create mode 100644 owl-bot-staging/google-cloud-security_center-v1p1beta1/lib/google/cloud/security_center/v1p1beta1/security_center/rest.rb create mode 100644 owl-bot-staging/google-cloud-security_center-v1p1beta1/lib/google/cloud/security_center/v1p1beta1/security_center/rest/client.rb create mode 100644 owl-bot-staging/google-cloud-security_center-v1p1beta1/lib/google/cloud/security_center/v1p1beta1/security_center/rest/operations.rb create mode 100644 owl-bot-staging/google-cloud-security_center-v1p1beta1/lib/google/cloud/security_center/v1p1beta1/security_center/rest/service_stub.rb create mode 100644 owl-bot-staging/google-cloud-security_center-v1p1beta1/lib/google/cloud/security_center/v1p1beta1/version.rb create mode 100644 owl-bot-staging/google-cloud-security_center-v1p1beta1/lib/google/cloud/securitycenter/v1p1beta1/asset_pb.rb create mode 100644 owl-bot-staging/google-cloud-security_center-v1p1beta1/lib/google/cloud/securitycenter/v1p1beta1/finding_pb.rb create mode 100644 owl-bot-staging/google-cloud-security_center-v1p1beta1/lib/google/cloud/securitycenter/v1p1beta1/folder_pb.rb create mode 100644 owl-bot-staging/google-cloud-security_center-v1p1beta1/lib/google/cloud/securitycenter/v1p1beta1/notification_config_pb.rb create mode 100644 owl-bot-staging/google-cloud-security_center-v1p1beta1/lib/google/cloud/securitycenter/v1p1beta1/notification_message_pb.rb create mode 100644 owl-bot-staging/google-cloud-security_center-v1p1beta1/lib/google/cloud/securitycenter/v1p1beta1/organization_settings_pb.rb create mode 100644 owl-bot-staging/google-cloud-security_center-v1p1beta1/lib/google/cloud/securitycenter/v1p1beta1/resource_pb.rb create mode 100644 owl-bot-staging/google-cloud-security_center-v1p1beta1/lib/google/cloud/securitycenter/v1p1beta1/run_asset_discovery_response_pb.rb create mode 100644 owl-bot-staging/google-cloud-security_center-v1p1beta1/lib/google/cloud/securitycenter/v1p1beta1/security_marks_pb.rb create mode 100644 owl-bot-staging/google-cloud-security_center-v1p1beta1/lib/google/cloud/securitycenter/v1p1beta1/securitycenter_service_pb.rb create mode 100644 owl-bot-staging/google-cloud-security_center-v1p1beta1/lib/google/cloud/securitycenter/v1p1beta1/securitycenter_service_services_pb.rb create mode 100644 owl-bot-staging/google-cloud-security_center-v1p1beta1/lib/google/cloud/securitycenter/v1p1beta1/source_pb.rb create mode 100644 owl-bot-staging/google-cloud-security_center-v1p1beta1/proto_docs/README.md create mode 100644 owl-bot-staging/google-cloud-security_center-v1p1beta1/proto_docs/google/api/client.rb create mode 100644 owl-bot-staging/google-cloud-security_center-v1p1beta1/proto_docs/google/api/field_behavior.rb create mode 100644 owl-bot-staging/google-cloud-security_center-v1p1beta1/proto_docs/google/api/launch_stage.rb create mode 100644 owl-bot-staging/google-cloud-security_center-v1p1beta1/proto_docs/google/api/resource.rb create mode 100644 owl-bot-staging/google-cloud-security_center-v1p1beta1/proto_docs/google/cloud/securitycenter/v1p1beta1/asset.rb create mode 100644 owl-bot-staging/google-cloud-security_center-v1p1beta1/proto_docs/google/cloud/securitycenter/v1p1beta1/finding.rb create mode 100644 owl-bot-staging/google-cloud-security_center-v1p1beta1/proto_docs/google/cloud/securitycenter/v1p1beta1/folder.rb create mode 100644 owl-bot-staging/google-cloud-security_center-v1p1beta1/proto_docs/google/cloud/securitycenter/v1p1beta1/notification_config.rb create mode 100644 owl-bot-staging/google-cloud-security_center-v1p1beta1/proto_docs/google/cloud/securitycenter/v1p1beta1/notification_message.rb create mode 100644 owl-bot-staging/google-cloud-security_center-v1p1beta1/proto_docs/google/cloud/securitycenter/v1p1beta1/organization_settings.rb create mode 100644 owl-bot-staging/google-cloud-security_center-v1p1beta1/proto_docs/google/cloud/securitycenter/v1p1beta1/resource.rb create mode 100644 owl-bot-staging/google-cloud-security_center-v1p1beta1/proto_docs/google/cloud/securitycenter/v1p1beta1/run_asset_discovery_response.rb create mode 100644 owl-bot-staging/google-cloud-security_center-v1p1beta1/proto_docs/google/cloud/securitycenter/v1p1beta1/security_marks.rb create mode 100644 owl-bot-staging/google-cloud-security_center-v1p1beta1/proto_docs/google/cloud/securitycenter/v1p1beta1/securitycenter_service.rb create mode 100644 owl-bot-staging/google-cloud-security_center-v1p1beta1/proto_docs/google/cloud/securitycenter/v1p1beta1/source.rb create mode 100644 owl-bot-staging/google-cloud-security_center-v1p1beta1/proto_docs/google/iam/v1/iam_policy.rb create mode 100644 owl-bot-staging/google-cloud-security_center-v1p1beta1/proto_docs/google/iam/v1/options.rb create mode 100644 owl-bot-staging/google-cloud-security_center-v1p1beta1/proto_docs/google/iam/v1/policy.rb create mode 100644 owl-bot-staging/google-cloud-security_center-v1p1beta1/proto_docs/google/longrunning/operations.rb create mode 100644 owl-bot-staging/google-cloud-security_center-v1p1beta1/proto_docs/google/protobuf/any.rb create mode 100644 owl-bot-staging/google-cloud-security_center-v1p1beta1/proto_docs/google/protobuf/duration.rb create mode 100644 owl-bot-staging/google-cloud-security_center-v1p1beta1/proto_docs/google/protobuf/empty.rb create mode 100644 owl-bot-staging/google-cloud-security_center-v1p1beta1/proto_docs/google/protobuf/field_mask.rb create mode 100644 owl-bot-staging/google-cloud-security_center-v1p1beta1/proto_docs/google/protobuf/struct.rb create mode 100644 owl-bot-staging/google-cloud-security_center-v1p1beta1/proto_docs/google/protobuf/timestamp.rb create mode 100644 owl-bot-staging/google-cloud-security_center-v1p1beta1/proto_docs/google/rpc/status.rb create mode 100644 owl-bot-staging/google-cloud-security_center-v1p1beta1/proto_docs/google/type/expr.rb create mode 100644 owl-bot-staging/google-cloud-security_center-v1p1beta1/snippets/Gemfile create mode 100644 owl-bot-staging/google-cloud-security_center-v1p1beta1/snippets/security_center/create_finding.rb create mode 100644 owl-bot-staging/google-cloud-security_center-v1p1beta1/snippets/security_center/create_notification_config.rb create mode 100644 owl-bot-staging/google-cloud-security_center-v1p1beta1/snippets/security_center/create_source.rb create mode 100644 owl-bot-staging/google-cloud-security_center-v1p1beta1/snippets/security_center/delete_notification_config.rb create mode 100644 owl-bot-staging/google-cloud-security_center-v1p1beta1/snippets/security_center/get_iam_policy.rb create mode 100644 owl-bot-staging/google-cloud-security_center-v1p1beta1/snippets/security_center/get_notification_config.rb create mode 100644 owl-bot-staging/google-cloud-security_center-v1p1beta1/snippets/security_center/get_organization_settings.rb create mode 100644 owl-bot-staging/google-cloud-security_center-v1p1beta1/snippets/security_center/get_source.rb create mode 100644 owl-bot-staging/google-cloud-security_center-v1p1beta1/snippets/security_center/group_assets.rb create mode 100644 owl-bot-staging/google-cloud-security_center-v1p1beta1/snippets/security_center/group_findings.rb create mode 100644 owl-bot-staging/google-cloud-security_center-v1p1beta1/snippets/security_center/list_assets.rb create mode 100644 owl-bot-staging/google-cloud-security_center-v1p1beta1/snippets/security_center/list_findings.rb create mode 100644 owl-bot-staging/google-cloud-security_center-v1p1beta1/snippets/security_center/list_notification_configs.rb create mode 100644 owl-bot-staging/google-cloud-security_center-v1p1beta1/snippets/security_center/list_sources.rb create mode 100644 owl-bot-staging/google-cloud-security_center-v1p1beta1/snippets/security_center/run_asset_discovery.rb create mode 100644 owl-bot-staging/google-cloud-security_center-v1p1beta1/snippets/security_center/set_finding_state.rb create mode 100644 owl-bot-staging/google-cloud-security_center-v1p1beta1/snippets/security_center/set_iam_policy.rb create mode 100644 owl-bot-staging/google-cloud-security_center-v1p1beta1/snippets/security_center/test_iam_permissions.rb create mode 100644 owl-bot-staging/google-cloud-security_center-v1p1beta1/snippets/security_center/update_finding.rb create mode 100644 owl-bot-staging/google-cloud-security_center-v1p1beta1/snippets/security_center/update_notification_config.rb create mode 100644 owl-bot-staging/google-cloud-security_center-v1p1beta1/snippets/security_center/update_organization_settings.rb create mode 100644 owl-bot-staging/google-cloud-security_center-v1p1beta1/snippets/security_center/update_security_marks.rb create mode 100644 owl-bot-staging/google-cloud-security_center-v1p1beta1/snippets/security_center/update_source.rb create mode 100644 owl-bot-staging/google-cloud-security_center-v1p1beta1/snippets/snippet_metadata_google.cloud.securitycenter.v1p1beta1.json create mode 100644 owl-bot-staging/google-cloud-security_center-v1p1beta1/test/google/cloud/security_center/v1p1beta1/security_center_operations_test.rb create mode 100644 owl-bot-staging/google-cloud-security_center-v1p1beta1/test/google/cloud/security_center/v1p1beta1/security_center_paths_test.rb create mode 100644 owl-bot-staging/google-cloud-security_center-v1p1beta1/test/google/cloud/security_center/v1p1beta1/security_center_rest_test.rb create mode 100644 owl-bot-staging/google-cloud-security_center-v1p1beta1/test/google/cloud/security_center/v1p1beta1/security_center_test.rb create mode 100644 owl-bot-staging/google-cloud-security_center-v1p1beta1/test/helper.rb create mode 100644 owl-bot-staging/google-cloud-security_center-v2/.gitignore create mode 100644 owl-bot-staging/google-cloud-security_center-v2/.repo-metadata.json create mode 100644 owl-bot-staging/google-cloud-security_center-v2/.rubocop.yml create mode 100644 owl-bot-staging/google-cloud-security_center-v2/.toys.rb create mode 100644 owl-bot-staging/google-cloud-security_center-v2/.yardopts create mode 100644 owl-bot-staging/google-cloud-security_center-v2/AUTHENTICATION.md create mode 100644 owl-bot-staging/google-cloud-security_center-v2/CHANGELOG.md create mode 100644 owl-bot-staging/google-cloud-security_center-v2/Gemfile create mode 100644 owl-bot-staging/google-cloud-security_center-v2/LICENSE.md create mode 100644 owl-bot-staging/google-cloud-security_center-v2/README.md create mode 100644 owl-bot-staging/google-cloud-security_center-v2/Rakefile create mode 100644 owl-bot-staging/google-cloud-security_center-v2/gapic_metadata.json create mode 100644 owl-bot-staging/google-cloud-security_center-v2/google-cloud-security_center-v2.gemspec create mode 100644 owl-bot-staging/google-cloud-security_center-v2/lib/google-cloud-security_center-v2.rb create mode 100644 owl-bot-staging/google-cloud-security_center-v2/lib/google/cloud/security_center/v2.rb create mode 100644 owl-bot-staging/google-cloud-security_center-v2/lib/google/cloud/security_center/v2/rest.rb create mode 100644 owl-bot-staging/google-cloud-security_center-v2/lib/google/cloud/security_center/v2/security_center.rb create mode 100644 owl-bot-staging/google-cloud-security_center-v2/lib/google/cloud/security_center/v2/security_center/client.rb create mode 100644 owl-bot-staging/google-cloud-security_center-v2/lib/google/cloud/security_center/v2/security_center/credentials.rb create mode 100644 owl-bot-staging/google-cloud-security_center-v2/lib/google/cloud/security_center/v2/security_center/operations.rb create mode 100644 owl-bot-staging/google-cloud-security_center-v2/lib/google/cloud/security_center/v2/security_center/paths.rb create mode 100644 owl-bot-staging/google-cloud-security_center-v2/lib/google/cloud/security_center/v2/security_center/rest.rb create mode 100644 owl-bot-staging/google-cloud-security_center-v2/lib/google/cloud/security_center/v2/security_center/rest/client.rb create mode 100644 owl-bot-staging/google-cloud-security_center-v2/lib/google/cloud/security_center/v2/security_center/rest/operations.rb create mode 100644 owl-bot-staging/google-cloud-security_center-v2/lib/google/cloud/security_center/v2/security_center/rest/service_stub.rb create mode 100644 owl-bot-staging/google-cloud-security_center-v2/lib/google/cloud/security_center/v2/version.rb create mode 100644 owl-bot-staging/google-cloud-security_center-v2/lib/google/cloud/securitycenter/v2/access_pb.rb create mode 100644 owl-bot-staging/google-cloud-security_center-v2/lib/google/cloud/securitycenter/v2/affected_resources_pb.rb create mode 100644 owl-bot-staging/google-cloud-security_center-v2/lib/google/cloud/securitycenter/v2/ai_model_pb.rb create mode 100644 owl-bot-staging/google-cloud-security_center-v2/lib/google/cloud/securitycenter/v2/application_pb.rb create mode 100644 owl-bot-staging/google-cloud-security_center-v2/lib/google/cloud/securitycenter/v2/attack_exposure_pb.rb create mode 100644 owl-bot-staging/google-cloud-security_center-v2/lib/google/cloud/securitycenter/v2/attack_path_pb.rb create mode 100644 owl-bot-staging/google-cloud-security_center-v2/lib/google/cloud/securitycenter/v2/backup_disaster_recovery_pb.rb create mode 100644 owl-bot-staging/google-cloud-security_center-v2/lib/google/cloud/securitycenter/v2/bigquery_export_pb.rb create mode 100644 owl-bot-staging/google-cloud-security_center-v2/lib/google/cloud/securitycenter/v2/chokepoint_pb.rb create mode 100644 owl-bot-staging/google-cloud-security_center-v2/lib/google/cloud/securitycenter/v2/cloud_armor_pb.rb create mode 100644 owl-bot-staging/google-cloud-security_center-v2/lib/google/cloud/securitycenter/v2/cloud_dlp_data_profile_pb.rb create mode 100644 owl-bot-staging/google-cloud-security_center-v2/lib/google/cloud/securitycenter/v2/cloud_dlp_inspection_pb.rb create mode 100644 owl-bot-staging/google-cloud-security_center-v2/lib/google/cloud/securitycenter/v2/compliance_pb.rb create mode 100644 owl-bot-staging/google-cloud-security_center-v2/lib/google/cloud/securitycenter/v2/connection_pb.rb create mode 100644 owl-bot-staging/google-cloud-security_center-v2/lib/google/cloud/securitycenter/v2/contact_details_pb.rb create mode 100644 owl-bot-staging/google-cloud-security_center-v2/lib/google/cloud/securitycenter/v2/container_pb.rb create mode 100644 owl-bot-staging/google-cloud-security_center-v2/lib/google/cloud/securitycenter/v2/data_access_event_pb.rb create mode 100644 owl-bot-staging/google-cloud-security_center-v2/lib/google/cloud/securitycenter/v2/data_flow_event_pb.rb create mode 100644 owl-bot-staging/google-cloud-security_center-v2/lib/google/cloud/securitycenter/v2/data_retention_deletion_event_pb.rb create mode 100644 owl-bot-staging/google-cloud-security_center-v2/lib/google/cloud/securitycenter/v2/database_pb.rb create mode 100644 owl-bot-staging/google-cloud-security_center-v2/lib/google/cloud/securitycenter/v2/disk_pb.rb create mode 100644 owl-bot-staging/google-cloud-security_center-v2/lib/google/cloud/securitycenter/v2/exfiltration_pb.rb create mode 100644 owl-bot-staging/google-cloud-security_center-v2/lib/google/cloud/securitycenter/v2/external_system_pb.rb create mode 100644 owl-bot-staging/google-cloud-security_center-v2/lib/google/cloud/securitycenter/v2/file_pb.rb create mode 100644 owl-bot-staging/google-cloud-security_center-v2/lib/google/cloud/securitycenter/v2/finding_pb.rb create mode 100644 owl-bot-staging/google-cloud-security_center-v2/lib/google/cloud/securitycenter/v2/folder_pb.rb create mode 100644 owl-bot-staging/google-cloud-security_center-v2/lib/google/cloud/securitycenter/v2/group_membership_pb.rb create mode 100644 owl-bot-staging/google-cloud-security_center-v2/lib/google/cloud/securitycenter/v2/iam_binding_pb.rb create mode 100644 owl-bot-staging/google-cloud-security_center-v2/lib/google/cloud/securitycenter/v2/indicator_pb.rb create mode 100644 owl-bot-staging/google-cloud-security_center-v2/lib/google/cloud/securitycenter/v2/ip_rules_pb.rb create mode 100644 owl-bot-staging/google-cloud-security_center-v2/lib/google/cloud/securitycenter/v2/job_pb.rb create mode 100644 owl-bot-staging/google-cloud-security_center-v2/lib/google/cloud/securitycenter/v2/kernel_rootkit_pb.rb create mode 100644 owl-bot-staging/google-cloud-security_center-v2/lib/google/cloud/securitycenter/v2/kubernetes_pb.rb create mode 100644 owl-bot-staging/google-cloud-security_center-v2/lib/google/cloud/securitycenter/v2/label_pb.rb create mode 100644 owl-bot-staging/google-cloud-security_center-v2/lib/google/cloud/securitycenter/v2/load_balancer_pb.rb create mode 100644 owl-bot-staging/google-cloud-security_center-v2/lib/google/cloud/securitycenter/v2/log_entry_pb.rb create mode 100644 owl-bot-staging/google-cloud-security_center-v2/lib/google/cloud/securitycenter/v2/mitre_attack_pb.rb create mode 100644 owl-bot-staging/google-cloud-security_center-v2/lib/google/cloud/securitycenter/v2/mute_config_pb.rb create mode 100644 owl-bot-staging/google-cloud-security_center-v2/lib/google/cloud/securitycenter/v2/network_pb.rb create mode 100644 owl-bot-staging/google-cloud-security_center-v2/lib/google/cloud/securitycenter/v2/notebook_pb.rb create mode 100644 owl-bot-staging/google-cloud-security_center-v2/lib/google/cloud/securitycenter/v2/notification_config_pb.rb create mode 100644 owl-bot-staging/google-cloud-security_center-v2/lib/google/cloud/securitycenter/v2/notification_message_pb.rb create mode 100644 owl-bot-staging/google-cloud-security_center-v2/lib/google/cloud/securitycenter/v2/org_policy_pb.rb create mode 100644 owl-bot-staging/google-cloud-security_center-v2/lib/google/cloud/securitycenter/v2/process_pb.rb create mode 100644 owl-bot-staging/google-cloud-security_center-v2/lib/google/cloud/securitycenter/v2/resource_pb.rb create mode 100644 owl-bot-staging/google-cloud-security_center-v2/lib/google/cloud/securitycenter/v2/resource_value_config_pb.rb create mode 100644 owl-bot-staging/google-cloud-security_center-v2/lib/google/cloud/securitycenter/v2/security_marks_pb.rb create mode 100644 owl-bot-staging/google-cloud-security_center-v2/lib/google/cloud/securitycenter/v2/security_posture_pb.rb create mode 100644 owl-bot-staging/google-cloud-security_center-v2/lib/google/cloud/securitycenter/v2/securitycenter_service_pb.rb create mode 100644 owl-bot-staging/google-cloud-security_center-v2/lib/google/cloud/securitycenter/v2/securitycenter_service_services_pb.rb create mode 100644 owl-bot-staging/google-cloud-security_center-v2/lib/google/cloud/securitycenter/v2/simulation_pb.rb create mode 100644 owl-bot-staging/google-cloud-security_center-v2/lib/google/cloud/securitycenter/v2/source_pb.rb create mode 100644 owl-bot-staging/google-cloud-security_center-v2/lib/google/cloud/securitycenter/v2/toxic_combination_pb.rb create mode 100644 owl-bot-staging/google-cloud-security_center-v2/lib/google/cloud/securitycenter/v2/valued_resource_pb.rb create mode 100644 owl-bot-staging/google-cloud-security_center-v2/lib/google/cloud/securitycenter/v2/vertex_ai_pb.rb create mode 100644 owl-bot-staging/google-cloud-security_center-v2/lib/google/cloud/securitycenter/v2/vulnerability_pb.rb create mode 100644 owl-bot-staging/google-cloud-security_center-v2/proto_docs/README.md create mode 100644 owl-bot-staging/google-cloud-security_center-v2/proto_docs/google/api/client.rb create mode 100644 owl-bot-staging/google-cloud-security_center-v2/proto_docs/google/api/field_behavior.rb create mode 100644 owl-bot-staging/google-cloud-security_center-v2/proto_docs/google/api/launch_stage.rb create mode 100644 owl-bot-staging/google-cloud-security_center-v2/proto_docs/google/api/resource.rb create mode 100644 owl-bot-staging/google-cloud-security_center-v2/proto_docs/google/api/routing.rb create mode 100644 owl-bot-staging/google-cloud-security_center-v2/proto_docs/google/cloud/securitycenter/v2/access.rb create mode 100644 owl-bot-staging/google-cloud-security_center-v2/proto_docs/google/cloud/securitycenter/v2/affected_resources.rb create mode 100644 owl-bot-staging/google-cloud-security_center-v2/proto_docs/google/cloud/securitycenter/v2/ai_model.rb create mode 100644 owl-bot-staging/google-cloud-security_center-v2/proto_docs/google/cloud/securitycenter/v2/application.rb create mode 100644 owl-bot-staging/google-cloud-security_center-v2/proto_docs/google/cloud/securitycenter/v2/attack_exposure.rb create mode 100644 owl-bot-staging/google-cloud-security_center-v2/proto_docs/google/cloud/securitycenter/v2/attack_path.rb create mode 100644 owl-bot-staging/google-cloud-security_center-v2/proto_docs/google/cloud/securitycenter/v2/backup_disaster_recovery.rb create mode 100644 owl-bot-staging/google-cloud-security_center-v2/proto_docs/google/cloud/securitycenter/v2/bigquery_export.rb create mode 100644 owl-bot-staging/google-cloud-security_center-v2/proto_docs/google/cloud/securitycenter/v2/chokepoint.rb create mode 100644 owl-bot-staging/google-cloud-security_center-v2/proto_docs/google/cloud/securitycenter/v2/cloud_armor.rb create mode 100644 owl-bot-staging/google-cloud-security_center-v2/proto_docs/google/cloud/securitycenter/v2/cloud_dlp_data_profile.rb create mode 100644 owl-bot-staging/google-cloud-security_center-v2/proto_docs/google/cloud/securitycenter/v2/cloud_dlp_inspection.rb create mode 100644 owl-bot-staging/google-cloud-security_center-v2/proto_docs/google/cloud/securitycenter/v2/compliance.rb create mode 100644 owl-bot-staging/google-cloud-security_center-v2/proto_docs/google/cloud/securitycenter/v2/connection.rb create mode 100644 owl-bot-staging/google-cloud-security_center-v2/proto_docs/google/cloud/securitycenter/v2/contact_details.rb create mode 100644 owl-bot-staging/google-cloud-security_center-v2/proto_docs/google/cloud/securitycenter/v2/container.rb create mode 100644 owl-bot-staging/google-cloud-security_center-v2/proto_docs/google/cloud/securitycenter/v2/data_access_event.rb create mode 100644 owl-bot-staging/google-cloud-security_center-v2/proto_docs/google/cloud/securitycenter/v2/data_flow_event.rb create mode 100644 owl-bot-staging/google-cloud-security_center-v2/proto_docs/google/cloud/securitycenter/v2/data_retention_deletion_event.rb create mode 100644 owl-bot-staging/google-cloud-security_center-v2/proto_docs/google/cloud/securitycenter/v2/database.rb create mode 100644 owl-bot-staging/google-cloud-security_center-v2/proto_docs/google/cloud/securitycenter/v2/disk.rb create mode 100644 owl-bot-staging/google-cloud-security_center-v2/proto_docs/google/cloud/securitycenter/v2/exfiltration.rb create mode 100644 owl-bot-staging/google-cloud-security_center-v2/proto_docs/google/cloud/securitycenter/v2/external_system.rb create mode 100644 owl-bot-staging/google-cloud-security_center-v2/proto_docs/google/cloud/securitycenter/v2/file.rb create mode 100644 owl-bot-staging/google-cloud-security_center-v2/proto_docs/google/cloud/securitycenter/v2/finding.rb create mode 100644 owl-bot-staging/google-cloud-security_center-v2/proto_docs/google/cloud/securitycenter/v2/folder.rb create mode 100644 owl-bot-staging/google-cloud-security_center-v2/proto_docs/google/cloud/securitycenter/v2/group_membership.rb create mode 100644 owl-bot-staging/google-cloud-security_center-v2/proto_docs/google/cloud/securitycenter/v2/iam_binding.rb create mode 100644 owl-bot-staging/google-cloud-security_center-v2/proto_docs/google/cloud/securitycenter/v2/indicator.rb create mode 100644 owl-bot-staging/google-cloud-security_center-v2/proto_docs/google/cloud/securitycenter/v2/ip_rules.rb create mode 100644 owl-bot-staging/google-cloud-security_center-v2/proto_docs/google/cloud/securitycenter/v2/job.rb create mode 100644 owl-bot-staging/google-cloud-security_center-v2/proto_docs/google/cloud/securitycenter/v2/kernel_rootkit.rb create mode 100644 owl-bot-staging/google-cloud-security_center-v2/proto_docs/google/cloud/securitycenter/v2/kubernetes.rb create mode 100644 owl-bot-staging/google-cloud-security_center-v2/proto_docs/google/cloud/securitycenter/v2/label.rb create mode 100644 owl-bot-staging/google-cloud-security_center-v2/proto_docs/google/cloud/securitycenter/v2/load_balancer.rb create mode 100644 owl-bot-staging/google-cloud-security_center-v2/proto_docs/google/cloud/securitycenter/v2/log_entry.rb create mode 100644 owl-bot-staging/google-cloud-security_center-v2/proto_docs/google/cloud/securitycenter/v2/mitre_attack.rb create mode 100644 owl-bot-staging/google-cloud-security_center-v2/proto_docs/google/cloud/securitycenter/v2/mute_config.rb create mode 100644 owl-bot-staging/google-cloud-security_center-v2/proto_docs/google/cloud/securitycenter/v2/network.rb create mode 100644 owl-bot-staging/google-cloud-security_center-v2/proto_docs/google/cloud/securitycenter/v2/notebook.rb create mode 100644 owl-bot-staging/google-cloud-security_center-v2/proto_docs/google/cloud/securitycenter/v2/notification_config.rb create mode 100644 owl-bot-staging/google-cloud-security_center-v2/proto_docs/google/cloud/securitycenter/v2/notification_message.rb create mode 100644 owl-bot-staging/google-cloud-security_center-v2/proto_docs/google/cloud/securitycenter/v2/org_policy.rb create mode 100644 owl-bot-staging/google-cloud-security_center-v2/proto_docs/google/cloud/securitycenter/v2/process.rb create mode 100644 owl-bot-staging/google-cloud-security_center-v2/proto_docs/google/cloud/securitycenter/v2/resource.rb create mode 100644 owl-bot-staging/google-cloud-security_center-v2/proto_docs/google/cloud/securitycenter/v2/resource_value_config.rb create mode 100644 owl-bot-staging/google-cloud-security_center-v2/proto_docs/google/cloud/securitycenter/v2/security_marks.rb create mode 100644 owl-bot-staging/google-cloud-security_center-v2/proto_docs/google/cloud/securitycenter/v2/security_posture.rb create mode 100644 owl-bot-staging/google-cloud-security_center-v2/proto_docs/google/cloud/securitycenter/v2/securitycenter_service.rb create mode 100644 owl-bot-staging/google-cloud-security_center-v2/proto_docs/google/cloud/securitycenter/v2/simulation.rb create mode 100644 owl-bot-staging/google-cloud-security_center-v2/proto_docs/google/cloud/securitycenter/v2/source.rb create mode 100644 owl-bot-staging/google-cloud-security_center-v2/proto_docs/google/cloud/securitycenter/v2/toxic_combination.rb create mode 100644 owl-bot-staging/google-cloud-security_center-v2/proto_docs/google/cloud/securitycenter/v2/valued_resource.rb create mode 100644 owl-bot-staging/google-cloud-security_center-v2/proto_docs/google/cloud/securitycenter/v2/vertex_ai.rb create mode 100644 owl-bot-staging/google-cloud-security_center-v2/proto_docs/google/cloud/securitycenter/v2/vulnerability.rb create mode 100644 owl-bot-staging/google-cloud-security_center-v2/proto_docs/google/iam/v1/iam_policy.rb create mode 100644 owl-bot-staging/google-cloud-security_center-v2/proto_docs/google/iam/v1/options.rb create mode 100644 owl-bot-staging/google-cloud-security_center-v2/proto_docs/google/iam/v1/policy.rb create mode 100644 owl-bot-staging/google-cloud-security_center-v2/proto_docs/google/longrunning/operations.rb create mode 100644 owl-bot-staging/google-cloud-security_center-v2/proto_docs/google/protobuf/any.rb create mode 100644 owl-bot-staging/google-cloud-security_center-v2/proto_docs/google/protobuf/duration.rb create mode 100644 owl-bot-staging/google-cloud-security_center-v2/proto_docs/google/protobuf/empty.rb create mode 100644 owl-bot-staging/google-cloud-security_center-v2/proto_docs/google/protobuf/field_mask.rb create mode 100644 owl-bot-staging/google-cloud-security_center-v2/proto_docs/google/protobuf/struct.rb create mode 100644 owl-bot-staging/google-cloud-security_center-v2/proto_docs/google/protobuf/timestamp.rb create mode 100644 owl-bot-staging/google-cloud-security_center-v2/proto_docs/google/rpc/status.rb create mode 100644 owl-bot-staging/google-cloud-security_center-v2/proto_docs/google/type/expr.rb create mode 100644 owl-bot-staging/google-cloud-security_center-v2/snippets/Gemfile create mode 100644 owl-bot-staging/google-cloud-security_center-v2/snippets/security_center/batch_create_resource_value_configs.rb create mode 100644 owl-bot-staging/google-cloud-security_center-v2/snippets/security_center/bulk_mute_findings.rb create mode 100644 owl-bot-staging/google-cloud-security_center-v2/snippets/security_center/create_big_query_export.rb create mode 100644 owl-bot-staging/google-cloud-security_center-v2/snippets/security_center/create_finding.rb create mode 100644 owl-bot-staging/google-cloud-security_center-v2/snippets/security_center/create_mute_config.rb create mode 100644 owl-bot-staging/google-cloud-security_center-v2/snippets/security_center/create_notification_config.rb create mode 100644 owl-bot-staging/google-cloud-security_center-v2/snippets/security_center/create_source.rb create mode 100644 owl-bot-staging/google-cloud-security_center-v2/snippets/security_center/delete_big_query_export.rb create mode 100644 owl-bot-staging/google-cloud-security_center-v2/snippets/security_center/delete_mute_config.rb create mode 100644 owl-bot-staging/google-cloud-security_center-v2/snippets/security_center/delete_notification_config.rb create mode 100644 owl-bot-staging/google-cloud-security_center-v2/snippets/security_center/delete_resource_value_config.rb create mode 100644 owl-bot-staging/google-cloud-security_center-v2/snippets/security_center/get_big_query_export.rb create mode 100644 owl-bot-staging/google-cloud-security_center-v2/snippets/security_center/get_iam_policy.rb create mode 100644 owl-bot-staging/google-cloud-security_center-v2/snippets/security_center/get_mute_config.rb create mode 100644 owl-bot-staging/google-cloud-security_center-v2/snippets/security_center/get_notification_config.rb create mode 100644 owl-bot-staging/google-cloud-security_center-v2/snippets/security_center/get_resource_value_config.rb create mode 100644 owl-bot-staging/google-cloud-security_center-v2/snippets/security_center/get_simulation.rb create mode 100644 owl-bot-staging/google-cloud-security_center-v2/snippets/security_center/get_source.rb create mode 100644 owl-bot-staging/google-cloud-security_center-v2/snippets/security_center/get_valued_resource.rb create mode 100644 owl-bot-staging/google-cloud-security_center-v2/snippets/security_center/group_findings.rb create mode 100644 owl-bot-staging/google-cloud-security_center-v2/snippets/security_center/list_attack_paths.rb create mode 100644 owl-bot-staging/google-cloud-security_center-v2/snippets/security_center/list_big_query_exports.rb create mode 100644 owl-bot-staging/google-cloud-security_center-v2/snippets/security_center/list_findings.rb create mode 100644 owl-bot-staging/google-cloud-security_center-v2/snippets/security_center/list_mute_configs.rb create mode 100644 owl-bot-staging/google-cloud-security_center-v2/snippets/security_center/list_notification_configs.rb create mode 100644 owl-bot-staging/google-cloud-security_center-v2/snippets/security_center/list_resource_value_configs.rb create mode 100644 owl-bot-staging/google-cloud-security_center-v2/snippets/security_center/list_sources.rb create mode 100644 owl-bot-staging/google-cloud-security_center-v2/snippets/security_center/list_valued_resources.rb create mode 100644 owl-bot-staging/google-cloud-security_center-v2/snippets/security_center/set_finding_state.rb create mode 100644 owl-bot-staging/google-cloud-security_center-v2/snippets/security_center/set_iam_policy.rb create mode 100644 owl-bot-staging/google-cloud-security_center-v2/snippets/security_center/set_mute.rb create mode 100644 owl-bot-staging/google-cloud-security_center-v2/snippets/security_center/test_iam_permissions.rb create mode 100644 owl-bot-staging/google-cloud-security_center-v2/snippets/security_center/update_big_query_export.rb create mode 100644 owl-bot-staging/google-cloud-security_center-v2/snippets/security_center/update_external_system.rb create mode 100644 owl-bot-staging/google-cloud-security_center-v2/snippets/security_center/update_finding.rb create mode 100644 owl-bot-staging/google-cloud-security_center-v2/snippets/security_center/update_mute_config.rb create mode 100644 owl-bot-staging/google-cloud-security_center-v2/snippets/security_center/update_notification_config.rb create mode 100644 owl-bot-staging/google-cloud-security_center-v2/snippets/security_center/update_resource_value_config.rb create mode 100644 owl-bot-staging/google-cloud-security_center-v2/snippets/security_center/update_security_marks.rb create mode 100644 owl-bot-staging/google-cloud-security_center-v2/snippets/security_center/update_source.rb create mode 100644 owl-bot-staging/google-cloud-security_center-v2/snippets/snippet_metadata_google.cloud.securitycenter.v2.json create mode 100644 owl-bot-staging/google-cloud-security_center-v2/test/google/cloud/security_center/v2/security_center_operations_test.rb create mode 100644 owl-bot-staging/google-cloud-security_center-v2/test/google/cloud/security_center/v2/security_center_paths_test.rb create mode 100644 owl-bot-staging/google-cloud-security_center-v2/test/google/cloud/security_center/v2/security_center_rest_test.rb create mode 100644 owl-bot-staging/google-cloud-security_center-v2/test/google/cloud/security_center/v2/security_center_test.rb create mode 100644 owl-bot-staging/google-cloud-security_center-v2/test/helper.rb create mode 100644 owl-bot-staging/google-cloud-security_center_management-v1/.gitignore create mode 100644 owl-bot-staging/google-cloud-security_center_management-v1/.repo-metadata.json create mode 100644 owl-bot-staging/google-cloud-security_center_management-v1/.rubocop.yml create mode 100644 owl-bot-staging/google-cloud-security_center_management-v1/.toys.rb create mode 100644 owl-bot-staging/google-cloud-security_center_management-v1/.yardopts create mode 100644 owl-bot-staging/google-cloud-security_center_management-v1/AUTHENTICATION.md create mode 100644 owl-bot-staging/google-cloud-security_center_management-v1/CHANGELOG.md create mode 100644 owl-bot-staging/google-cloud-security_center_management-v1/Gemfile create mode 100644 owl-bot-staging/google-cloud-security_center_management-v1/LICENSE.md create mode 100644 owl-bot-staging/google-cloud-security_center_management-v1/README.md create mode 100644 owl-bot-staging/google-cloud-security_center_management-v1/Rakefile create mode 100644 owl-bot-staging/google-cloud-security_center_management-v1/gapic_metadata.json create mode 100644 owl-bot-staging/google-cloud-security_center_management-v1/google-cloud-security_center_management-v1.gemspec create mode 100644 owl-bot-staging/google-cloud-security_center_management-v1/lib/google-cloud-security_center_management-v1.rb create mode 100644 owl-bot-staging/google-cloud-security_center_management-v1/lib/google/cloud/security_center_management/v1.rb create mode 100644 owl-bot-staging/google-cloud-security_center_management-v1/lib/google/cloud/security_center_management/v1/bindings_override.rb create mode 100644 owl-bot-staging/google-cloud-security_center_management-v1/lib/google/cloud/security_center_management/v1/rest.rb create mode 100644 owl-bot-staging/google-cloud-security_center_management-v1/lib/google/cloud/security_center_management/v1/security_center_management.rb create mode 100644 owl-bot-staging/google-cloud-security_center_management-v1/lib/google/cloud/security_center_management/v1/security_center_management/client.rb create mode 100644 owl-bot-staging/google-cloud-security_center_management-v1/lib/google/cloud/security_center_management/v1/security_center_management/credentials.rb create mode 100644 owl-bot-staging/google-cloud-security_center_management-v1/lib/google/cloud/security_center_management/v1/security_center_management/paths.rb create mode 100644 owl-bot-staging/google-cloud-security_center_management-v1/lib/google/cloud/security_center_management/v1/security_center_management/rest.rb create mode 100644 owl-bot-staging/google-cloud-security_center_management-v1/lib/google/cloud/security_center_management/v1/security_center_management/rest/client.rb create mode 100644 owl-bot-staging/google-cloud-security_center_management-v1/lib/google/cloud/security_center_management/v1/security_center_management/rest/service_stub.rb create mode 100644 owl-bot-staging/google-cloud-security_center_management-v1/lib/google/cloud/security_center_management/v1/version.rb create mode 100644 owl-bot-staging/google-cloud-security_center_management-v1/lib/google/cloud/securitycentermanagement/v1/security_center_management_pb.rb create mode 100644 owl-bot-staging/google-cloud-security_center_management-v1/lib/google/cloud/securitycentermanagement/v1/security_center_management_services_pb.rb create mode 100644 owl-bot-staging/google-cloud-security_center_management-v1/proto_docs/README.md create mode 100644 owl-bot-staging/google-cloud-security_center_management-v1/proto_docs/google/api/client.rb create mode 100644 owl-bot-staging/google-cloud-security_center_management-v1/proto_docs/google/api/field_behavior.rb create mode 100644 owl-bot-staging/google-cloud-security_center_management-v1/proto_docs/google/api/launch_stage.rb create mode 100644 owl-bot-staging/google-cloud-security_center_management-v1/proto_docs/google/api/resource.rb create mode 100644 owl-bot-staging/google-cloud-security_center_management-v1/proto_docs/google/cloud/securitycentermanagement/v1/security_center_management.rb create mode 100644 owl-bot-staging/google-cloud-security_center_management-v1/proto_docs/google/iam/v1/policy.rb create mode 100644 owl-bot-staging/google-cloud-security_center_management-v1/proto_docs/google/protobuf/any.rb create mode 100644 owl-bot-staging/google-cloud-security_center_management-v1/proto_docs/google/protobuf/duration.rb create mode 100644 owl-bot-staging/google-cloud-security_center_management-v1/proto_docs/google/protobuf/empty.rb create mode 100644 owl-bot-staging/google-cloud-security_center_management-v1/proto_docs/google/protobuf/field_mask.rb create mode 100644 owl-bot-staging/google-cloud-security_center_management-v1/proto_docs/google/protobuf/struct.rb create mode 100644 owl-bot-staging/google-cloud-security_center_management-v1/proto_docs/google/protobuf/timestamp.rb create mode 100644 owl-bot-staging/google-cloud-security_center_management-v1/proto_docs/google/rpc/status.rb create mode 100644 owl-bot-staging/google-cloud-security_center_management-v1/proto_docs/google/type/expr.rb create mode 100644 owl-bot-staging/google-cloud-security_center_management-v1/snippets/Gemfile create mode 100644 owl-bot-staging/google-cloud-security_center_management-v1/snippets/security_center_management/create_event_threat_detection_custom_module.rb create mode 100644 owl-bot-staging/google-cloud-security_center_management-v1/snippets/security_center_management/create_security_health_analytics_custom_module.rb create mode 100644 owl-bot-staging/google-cloud-security_center_management-v1/snippets/security_center_management/delete_event_threat_detection_custom_module.rb create mode 100644 owl-bot-staging/google-cloud-security_center_management-v1/snippets/security_center_management/delete_security_health_analytics_custom_module.rb create mode 100644 owl-bot-staging/google-cloud-security_center_management-v1/snippets/security_center_management/get_effective_event_threat_detection_custom_module.rb create mode 100644 owl-bot-staging/google-cloud-security_center_management-v1/snippets/security_center_management/get_effective_security_health_analytics_custom_module.rb create mode 100644 owl-bot-staging/google-cloud-security_center_management-v1/snippets/security_center_management/get_event_threat_detection_custom_module.rb create mode 100644 owl-bot-staging/google-cloud-security_center_management-v1/snippets/security_center_management/get_security_center_service.rb create mode 100644 owl-bot-staging/google-cloud-security_center_management-v1/snippets/security_center_management/get_security_health_analytics_custom_module.rb create mode 100644 owl-bot-staging/google-cloud-security_center_management-v1/snippets/security_center_management/list_descendant_event_threat_detection_custom_modules.rb create mode 100644 owl-bot-staging/google-cloud-security_center_management-v1/snippets/security_center_management/list_descendant_security_health_analytics_custom_modules.rb create mode 100644 owl-bot-staging/google-cloud-security_center_management-v1/snippets/security_center_management/list_effective_event_threat_detection_custom_modules.rb create mode 100644 owl-bot-staging/google-cloud-security_center_management-v1/snippets/security_center_management/list_effective_security_health_analytics_custom_modules.rb create mode 100644 owl-bot-staging/google-cloud-security_center_management-v1/snippets/security_center_management/list_event_threat_detection_custom_modules.rb create mode 100644 owl-bot-staging/google-cloud-security_center_management-v1/snippets/security_center_management/list_security_center_services.rb create mode 100644 owl-bot-staging/google-cloud-security_center_management-v1/snippets/security_center_management/list_security_health_analytics_custom_modules.rb create mode 100644 owl-bot-staging/google-cloud-security_center_management-v1/snippets/security_center_management/simulate_security_health_analytics_custom_module.rb create mode 100644 owl-bot-staging/google-cloud-security_center_management-v1/snippets/security_center_management/update_event_threat_detection_custom_module.rb create mode 100644 owl-bot-staging/google-cloud-security_center_management-v1/snippets/security_center_management/update_security_center_service.rb create mode 100644 owl-bot-staging/google-cloud-security_center_management-v1/snippets/security_center_management/update_security_health_analytics_custom_module.rb create mode 100644 owl-bot-staging/google-cloud-security_center_management-v1/snippets/security_center_management/validate_event_threat_detection_custom_module.rb create mode 100644 owl-bot-staging/google-cloud-security_center_management-v1/snippets/snippet_metadata_google.cloud.securitycentermanagement.v1.json create mode 100644 owl-bot-staging/google-cloud-security_center_management-v1/test/google/cloud/security_center_management/v1/security_center_management_paths_test.rb create mode 100644 owl-bot-staging/google-cloud-security_center_management-v1/test/google/cloud/security_center_management/v1/security_center_management_rest_test.rb create mode 100644 owl-bot-staging/google-cloud-security_center_management-v1/test/google/cloud/security_center_management/v1/security_center_management_test.rb create mode 100644 owl-bot-staging/google-cloud-security_center_management-v1/test/helper.rb diff --git a/owl-bot-staging/google-cloud-redis-cluster-v1beta1/.gitignore b/owl-bot-staging/google-cloud-redis-cluster-v1beta1/.gitignore new file mode 100644 index 000000000000..0135b6bc6cfc --- /dev/null +++ b/owl-bot-staging/google-cloud-redis-cluster-v1beta1/.gitignore @@ -0,0 +1,22 @@ +# Ignore bundler lockfiles +Gemfile.lock +gems.locked + +# Ignore documentation output +doc/* +.yardoc/* + +# Ignore test output +coverage/* + +# Ignore build artifacts +pkg/* + +# Ignore files commonly present in certain dev environments +.vagrant +.DS_STORE +.idea +*.iml + +# Ignore synth output +__pycache__ diff --git a/owl-bot-staging/google-cloud-redis-cluster-v1beta1/.repo-metadata.json b/owl-bot-staging/google-cloud-redis-cluster-v1beta1/.repo-metadata.json new file mode 100644 index 000000000000..2ab1d03bbe46 --- /dev/null +++ b/owl-bot-staging/google-cloud-redis-cluster-v1beta1/.repo-metadata.json @@ -0,0 +1,17 @@ +{ + "api_id": "redis.googleapis.com", + "api_shortname": "redis", + "client_documentation": "https://cloud.google.com/ruby/docs/reference/google-cloud-redis-cluster-v1beta1/latest", + "distribution_name": "google-cloud-redis-cluster-v1beta1", + "is_cloud": true, + "language": "ruby", + "name": "redis", + "name_pretty": "Google Cloud Memorystore for Redis V1BETA1 API", + "product_documentation": "https://cloud.google.com/memorystore/docs/cluster", + "release_level": "unreleased", + "repo": "googleapis/google-cloud-ruby", + "requires_billing": true, + "ruby-cloud-description": "Creates and manages Redis instances on the Google Cloud Platform. Note that google-cloud-redis-cluster-v1beta1 is a version-specific client library. For most uses, we recommend installing the main client library google-cloud-redis-cluster instead. See the readme for more details.", + "ruby-cloud-product-url": "https://cloud.google.com/memorystore/docs/cluster", + "library_type": "GAPIC_AUTO" +} diff --git a/owl-bot-staging/google-cloud-redis-cluster-v1beta1/.rubocop.yml b/owl-bot-staging/google-cloud-redis-cluster-v1beta1/.rubocop.yml new file mode 100644 index 000000000000..fc0606d1c085 --- /dev/null +++ b/owl-bot-staging/google-cloud-redis-cluster-v1beta1/.rubocop.yml @@ -0,0 +1,33 @@ +inherit_gem: + google-style: google-style.yml + +AllCops: + Exclude: + - "google-cloud-redis-cluster-v1beta1.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-redis-cluster-v1beta1.rb" diff --git a/owl-bot-staging/google-cloud-redis-cluster-v1beta1/.toys.rb b/owl-bot-staging/google-cloud-redis-cluster-v1beta1/.toys.rb new file mode 100644 index 000000000000..177e22456e8a --- /dev/null +++ b/owl-bot-staging/google-cloud-redis-cluster-v1beta1/.toys.rb @@ -0,0 +1,28 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +toys_version! ">= 0.15.3" + +if ENV["RUBY_COMMON_TOOLS"] + common_tools_dir = File.expand_path ENV["RUBY_COMMON_TOOLS"] + load File.join(common_tools_dir, "toys", "gapic") +else + load_git remote: "https://github.com/googleapis/ruby-common-tools.git", + path: "toys/gapic", + update: true +end diff --git a/owl-bot-staging/google-cloud-redis-cluster-v1beta1/.yardopts b/owl-bot-staging/google-cloud-redis-cluster-v1beta1/.yardopts new file mode 100644 index 000000000000..599cfbea4d19 --- /dev/null +++ b/owl-bot-staging/google-cloud-redis-cluster-v1beta1/.yardopts @@ -0,0 +1,12 @@ +--no-private +--title="Google Cloud Memorystore for Redis V1BETA1 API" +--exclude _pb\.rb$ +--markup markdown +--markup-provider redcarpet + +./lib/**/*.rb +./proto_docs/**/*.rb +- +README.md +LICENSE.md +AUTHENTICATION.md diff --git a/owl-bot-staging/google-cloud-redis-cluster-v1beta1/AUTHENTICATION.md b/owl-bot-staging/google-cloud-redis-cluster-v1beta1/AUTHENTICATION.md new file mode 100644 index 000000000000..9972a8b1c9f5 --- /dev/null +++ b/owl-bot-staging/google-cloud-redis-cluster-v1beta1/AUTHENTICATION.md @@ -0,0 +1,122 @@ +# Authentication + +The recommended way to authenticate to the google-cloud-redis-cluster-v1beta1 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-redis-cluster-v1beta1 library provides several mechanisms to configure your system. +Generally, using Application Default Credentials to facilitate automatic +credentials discovery is the easist method. But if you need to explicitly specify +credentials, there are several methods available to you. + +Credentials are accepted in the following ways, in the following order or precedence: + +1. Credentials specified in method arguments +2. Credentials specified in configuration +3. Credentials pointed to or included in environment variables +4. Credentials found in local ADC file +5. Credentials returned by the metadata server for the attached service account (GCP) + +### Configuration + +You can configure a path to a JSON credentials file, either for an individual client object or +globally, for all client objects. The JSON file can contain credentials created for +[workload identity federation](https://cloud.google.com/iam/docs/workload-identity-federation), +[workforce identity federation](https://cloud.google.com/iam/docs/workforce-identity-federation), or a +[service account key](https://cloud.google.com/docs/authentication/provide-credentials-adc#local-key). + +Note: Service account keys are a security risk if not managed correctly. You should +[choose a more secure alternative to service account keys](https://cloud.google.com/docs/authentication#auth-decision-tree) +whenever possible. + +To configure a credentials file for an individual client initialization: + +```ruby +require "google/cloud/redis/cluster/v1beta1" + +client = ::Google::Cloud::Redis::Cluster::V1beta1::CloudRedisCluster::Client.new do |config| + config.credentials = "path/to/credentialfile.json" +end +``` + +To configure a credentials file globally for all clients: + +```ruby +require "google/cloud/redis/cluster/v1beta1" + +::Google::Cloud::Redis::Cluster::V1beta1::CloudRedisCluster::Client.configure do |config| + config.credentials = "path/to/credentialfile.json" +end + +client = ::Google::Cloud::Redis::Cluster::V1beta1::CloudRedisCluster::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-redis-cluster-v1beta1 +checks for credentials are: + +* `GOOGLE_CLOUD_CREDENTIALS` - Path to JSON file, or JSON contents +* `GOOGLE_APPLICATION_CREDENTIALS` - Path to JSON file + +```ruby +require "google/cloud/redis/cluster/v1beta1" + +ENV["GOOGLE_APPLICATION_CREDENTIALS"] = "path/to/credentialfile.json" + +client = ::Google::Cloud::Redis::Cluster::V1beta1::CloudRedisCluster::Client.new +``` + +### Local ADC file + +You can set up a local ADC file with your user credentials for authentication during +development. If credentials are not provided in code or in environment variables, +then the local ADC credentials are discovered. + +Follow the steps in [Quickstart](#quickstart) to set up a local ADC file. + +### Google Cloud Platform environments + +When running on Google Cloud Platform (GCP), including Google Compute Engine +(GCE), Google Kubernetes Engine (GKE), Google App Engine (GAE), Google Cloud +Functions (GCF) and Cloud Run, credentials are retrieved from the attached +service account automatically. Code should be written as if already authenticated. + +For more information, see +[Set up ADC for Google Cloud services](https://cloud.google.com/docs/authentication/provide-credentials-adc#attached-sa). diff --git a/owl-bot-staging/google-cloud-redis-cluster-v1beta1/CHANGELOG.md b/owl-bot-staging/google-cloud-redis-cluster-v1beta1/CHANGELOG.md new file mode 100644 index 000000000000..f88957a62ba2 --- /dev/null +++ b/owl-bot-staging/google-cloud-redis-cluster-v1beta1/CHANGELOG.md @@ -0,0 +1,2 @@ +# Release History + diff --git a/owl-bot-staging/google-cloud-redis-cluster-v1beta1/Gemfile b/owl-bot-staging/google-cloud-redis-cluster-v1beta1/Gemfile new file mode 100644 index 000000000000..1d08558908d8 --- /dev/null +++ b/owl-bot-staging/google-cloud-redis-cluster-v1beta1/Gemfile @@ -0,0 +1,14 @@ +source "https://rubygems.org" + +gemspec + +gem "google-style", "~> 1.32.0" +gem "irb", "~> 1.17" +gem "minitest", "~> 6.0.2" +gem "minitest-focus", "~> 1.4" +gem "minitest-mock", "~> 5.27" +gem "minitest-rg", "~> 5.3" +gem "ostruct", "~> 0.5.5" +gem "rake", ">= 13.0" +gem "redcarpet", "~> 3.6" +gem "yard", "~> 0.9" diff --git a/owl-bot-staging/google-cloud-redis-cluster-v1beta1/LICENSE.md b/owl-bot-staging/google-cloud-redis-cluster-v1beta1/LICENSE.md new file mode 100644 index 000000000000..c261857ba6ad --- /dev/null +++ b/owl-bot-staging/google-cloud-redis-cluster-v1beta1/LICENSE.md @@ -0,0 +1,201 @@ + Apache License + Version 2.0, January 2004 + http://www.apache.org/licenses/ + + TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION + + 1. Definitions. + + "License" shall mean the terms and conditions for use, reproduction, + and distribution as defined by Sections 1 through 9 of this document. + + "Licensor" shall mean the copyright owner or entity authorized by + the copyright owner that is granting the License. + + "Legal Entity" shall mean the union of the acting entity and all + other entities that control, are controlled by, or are under common + control with that entity. For the purposes of this definition, + "control" means (i) the power, direct or indirect, to cause the + direction or management of such entity, whether by contract or + otherwise, or (ii) ownership of fifty percent (50%) or more of the + outstanding shares, or (iii) beneficial ownership of such entity. + + "You" (or "Your") shall mean an individual or Legal Entity + exercising permissions granted by this License. + + "Source" form shall mean the preferred form for making modifications, + including but not limited to software source code, documentation + source, and configuration files. + + "Object" form shall mean any form resulting from mechanical + transformation or translation of a Source form, including but + not limited to compiled object code, generated documentation, + and conversions to other media types. + + "Work" shall mean the work of authorship, whether in Source or + Object form, made available under the License, as indicated by a + copyright notice that is included in or attached to the work + (an example is provided in the Appendix below). + + "Derivative Works" shall mean any work, whether in Source or Object + form, that is based on (or derived from) the Work and for which the + editorial revisions, annotations, elaborations, or other modifications + represent, as a whole, an original work of authorship. For the purposes + of this License, Derivative Works shall not include works that remain + separable from, or merely link (or bind by name) to the interfaces of, + the Work and Derivative Works thereof. + + "Contribution" shall mean any work of authorship, including + the original version of the Work and any modifications or additions + to that Work or Derivative Works thereof, that is intentionally + submitted to Licensor for inclusion in the Work by the copyright owner + or by an individual or Legal Entity authorized to submit on behalf of + the copyright owner. For the purposes of this definition, "submitted" + means any form of electronic, verbal, or written communication sent + to the Licensor or its representatives, including but not limited to + communication on electronic mailing lists, source code control systems, + and issue tracking systems that are managed by, or on behalf of, the + Licensor for the purpose of discussing and improving the Work, but + excluding communication that is conspicuously marked or otherwise + designated in writing by the copyright owner as "Not a Contribution." + + "Contributor" shall mean Licensor and any individual or Legal Entity + on behalf of whom a Contribution has been received by Licensor and + subsequently incorporated within the Work. + + 2. Grant of Copyright License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + copyright license to reproduce, prepare Derivative Works of, + publicly display, publicly perform, sublicense, and distribute the + Work and such Derivative Works in Source or Object form. + + 3. Grant of Patent License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + (except as stated in this section) patent license to make, have made, + use, offer to sell, sell, import, and otherwise transfer the Work, + where such license applies only to those patent claims licensable + by such Contributor that are necessarily infringed by their + Contribution(s) alone or by combination of their Contribution(s) + with the Work to which such Contribution(s) was submitted. If You + institute patent litigation against any entity (including a + cross-claim or counterclaim in a lawsuit) alleging that the Work + or a Contribution incorporated within the Work constitutes direct + or contributory patent infringement, then any patent licenses + granted to You under this License for that Work shall terminate + as of the date such litigation is filed. + + 4. Redistribution. You may reproduce and distribute copies of the + Work or Derivative Works thereof in any medium, with or without + modifications, and in Source or Object form, provided that You + meet the following conditions: + + (a) You must give any other recipients of the Work or + Derivative Works a copy of this License; and + + (b) You must cause any modified files to carry prominent notices + stating that You changed the files; and + + (c) You must retain, in the Source form of any Derivative Works + that You distribute, all copyright, patent, trademark, and + attribution notices from the Source form of the Work, + excluding those notices that do not pertain to any part of + the Derivative Works; and + + (d) If the Work includes a "NOTICE" text file as part of its + distribution, then any Derivative Works that You distribute must + include a readable copy of the attribution notices contained + within such NOTICE file, excluding those notices that do not + pertain to any part of the Derivative Works, in at least one + of the following places: within a NOTICE text file distributed + as part of the Derivative Works; within the Source form or + documentation, if provided along with the Derivative Works; or, + within a display generated by the Derivative Works, if and + wherever such third-party notices normally appear. The contents + of the NOTICE file are for informational purposes only and + do not modify the License. You may add Your own attribution + notices within Derivative Works that You distribute, alongside + or as an addendum to the NOTICE text from the Work, provided + that such additional attribution notices cannot be construed + as modifying the License. + + You may add Your own copyright statement to Your modifications and + may provide additional or different license terms and conditions + for use, reproduction, or distribution of Your modifications, or + for any such Derivative Works as a whole, provided Your use, + reproduction, and distribution of the Work otherwise complies with + the conditions stated in this License. + + 5. Submission of Contributions. Unless You explicitly state otherwise, + any Contribution intentionally submitted for inclusion in the Work + by You to the Licensor shall be under the terms and conditions of + this License, without any additional terms or conditions. + Notwithstanding the above, nothing herein shall supersede or modify + the terms of any separate license agreement you may have executed + with Licensor regarding such Contributions. + + 6. Trademarks. This License does not grant permission to use the trade + names, trademarks, service marks, or product names of the Licensor, + except as required for reasonable and customary use in describing the + origin of the Work and reproducing the content of the NOTICE file. + + 7. Disclaimer of Warranty. Unless required by applicable law or + agreed to in writing, Licensor provides the Work (and each + Contributor provides its Contributions) on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or + implied, including, without limitation, any warranties or conditions + of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A + PARTICULAR PURPOSE. You are solely responsible for determining the + appropriateness of using or redistributing the Work and assume any + risks associated with Your exercise of permissions under this License. + + 8. Limitation of Liability. In no event and under no legal theory, + whether in tort (including negligence), contract, or otherwise, + unless required by applicable law (such as deliberate and grossly + negligent acts) or agreed to in writing, shall any Contributor be + liable to You for damages, including any direct, indirect, special, + incidental, or consequential damages of any character arising as a + result of this License or out of the use or inability to use the + Work (including but not limited to damages for loss of goodwill, + work stoppage, computer failure or malfunction, or any and all + other commercial damages or losses), even if such Contributor + has been advised of the possibility of such damages. + + 9. Accepting Warranty or Additional Liability. While redistributing + the Work or Derivative Works thereof, You may choose to offer, + and charge a fee for, acceptance of support, warranty, indemnity, + or other liability obligations and/or rights consistent with this + License. However, in accepting such obligations, You may act only + on Your own behalf and on Your sole responsibility, not on behalf + of any other Contributor, and only if You agree to indemnify, + defend, and hold each Contributor harmless for any liability + incurred by, or claims asserted against, such Contributor by reason + of your accepting any such warranty or additional liability. + + END OF TERMS AND CONDITIONS + + APPENDIX: How to apply the Apache License to your work. + + To apply the Apache License to your work, attach the following + boilerplate notice, with the fields enclosed by brackets "[]" + replaced with your own identifying information. (Don't include + the brackets!) The text should be enclosed in the appropriate + comment syntax for the file format. We also recommend that a + file or class name and description of purpose be included on the + same "printed page" as the copyright notice for easier + identification within third-party archives. + + Copyright [yyyy] [name of copyright owner] + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. diff --git a/owl-bot-staging/google-cloud-redis-cluster-v1beta1/README.md b/owl-bot-staging/google-cloud-redis-cluster-v1beta1/README.md new file mode 100644 index 000000000000..51dd0050463a --- /dev/null +++ b/owl-bot-staging/google-cloud-redis-cluster-v1beta1/README.md @@ -0,0 +1,153 @@ +# Ruby Client for the Google Cloud Memorystore for Redis V1BETA1 API + +Creates and manages Redis instances on the Google Cloud Platform. + + +https://github.com/googleapis/google-cloud-ruby + +This gem is a _versioned_ client. It provides basic client classes for a +specific version of the Google Cloud Memorystore for Redis V1BETA1 API. Most users should consider using +the main client gem, +[google-cloud-redis-cluster](https://rubygems.org/gems/google-cloud-redis-cluster). +See the section below titled *Which client should I use?* for more information. + +## Installation + +``` +$ gem install google-cloud-redis-cluster-v1beta1 +``` + +## 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/redis.googleapis.com) +1. [Set up authentication.](AUTHENTICATION.md) + +## Quick Start + +```ruby +require "google/cloud/redis/cluster/v1beta1" + +client = ::Google::Cloud::Redis::Cluster::V1beta1::CloudRedisCluster::Client.new +request = ::Google::Cloud::Redis::Cluster::V1beta1::ListClustersRequest.new # (request fields as keyword arguments...) +response = client.list_clusters request +``` + +View the [Client Library Documentation](https://cloud.google.com/ruby/docs/reference/google-cloud-redis-cluster-v1beta1/latest) +for class and method documentation. + +See also the [Product Documentation](https://cloud.google.com/memorystore/docs/cluster) +for general usage information. + +## Debug Logging + +This library comes with opt-in Debug Logging that can help you troubleshoot +your application's integration with the API. When logging is activated, key +events such as requests and responses, along with data payloads and metadata +such as headers and client configuration, are logged to the standard error +stream. + +**WARNING:** Client Library Debug Logging includes your data payloads in +plaintext, which could include sensitive data such as PII for yourself or your +customers, private keys, or other security data that could be compromising if +leaked. Always practice good data hygiene with your application logs, and follow +the principle of least access. Google also recommends that Client Library Debug +Logging be enabled only temporarily during active debugging, and not used +permanently in production. + +To enable logging, set the environment variable `GOOGLE_SDK_RUBY_LOGGING_GEMS` +to the value `all`. Alternatively, you can set the value to a comma-delimited +list of client library gem names. This will select the default logging behavior, +which writes logs to the standard error stream. On a local workstation, this may +result in logs appearing on the console. When running on a Google Cloud hosting +service such as [Google Cloud Run](https://cloud.google.com/run), this generally +results in logs appearing alongside your application logs in the +[Google Cloud Logging](https://cloud.google.com/logging/) service. + +You can customize logging by modifying the `logger` configuration when +constructing a client object. For example: + +```ruby +require "google/cloud/redis/cluster/v1beta1" +require "logger" + +client = ::Google::Cloud::Redis::Cluster::V1beta1::CloudRedisCluster::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-redis-cluster`, +and lower-level _versioned_ client libraries with names such as +`google-cloud-redis-cluster-v1beta1`. +_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-redis-cluster`. +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-redis-cluster-v1beta1`. + +### What about the google-apis- clients? + +Client library gems with names that begin with `google-apis-` are based on an +older code generation technology. They talk to a REST/JSON backend (whereas +most modern clients talk to a [gRPC](https://grpc.io/) backend) and they may +not offer the same performance, features, and ease of use provided by more +modern clients. + +The `google-apis-` clients have wide coverage across Google services, so you +might need to use one if there is no modern client available for the service. +However, if a modern client is available, we generally recommend it over the +older `google-apis-` clients. diff --git a/owl-bot-staging/google-cloud-redis-cluster-v1beta1/Rakefile b/owl-bot-staging/google-cloud-redis-cluster-v1beta1/Rakefile new file mode 100644 index 000000000000..ad063dcffe89 --- /dev/null +++ b/owl-bot-staging/google-cloud-redis-cluster-v1beta1/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-redis-cluster-v1beta1 acceptance tests." +task :acceptance, :project, :keyfile do |t, args| + project = args[:project] + project ||= + ENV["GOOGLE_CLOUD_TEST_PROJECT"] || + ENV["GCLOUD_TEST_PROJECT"] + keyfile = args[:keyfile] + keyfile ||= + ENV["GOOGLE_CLOUD_TEST_KEYFILE"] || + ENV["GCLOUD_TEST_KEYFILE"] + if keyfile + keyfile = File.read keyfile + else + keyfile ||= + ENV["GOOGLE_CLOUD_TEST_KEYFILE_JSON"] || + ENV["GCLOUD_TEST_KEYFILE_JSON"] + end + if project.nil? || keyfile.nil? + fail "You must provide a project and keyfile. e.g. rake acceptance[test123, /path/to/keyfile.json] or GOOGLE_CLOUD_TEST_PROJECT=test123 GOOGLE_CLOUD_TEST_KEYFILE=/path/to/keyfile.json rake acceptance" + end + require "google/cloud/redis/cluster/v1beta1/cloud_redis_cluster/credentials" + ::Google::Cloud::Redis::Cluster::V1beta1::CloudRedisCluster::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-redis-cluster-v1beta1 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-redis-cluster-v1beta1 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-redis-cluster-v1beta1 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-redis-cluster-v1beta1 gem does not have doctest tests." +end + +desc "Run the CI build" +task :ci do + header "BUILDING google-cloud-redis-cluster-v1beta1" + header "google-cloud-redis-cluster-v1beta1 rubocop", "*" + Rake::Task[:rubocop].invoke + header "google-cloud-redis-cluster-v1beta1 yard", "*" + Rake::Task[:yard].invoke + header "google-cloud-redis-cluster-v1beta1 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-redis-cluster-v1beta1 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-redis-cluster-v1beta1 acceptance", "*" + Rake::Task[:acceptance].invoke + end + task :a do + # This is a handy shortcut to save typing + Rake::Task["ci:acceptance"].invoke + end +end + +task default: :test + +def header str, token = "#" + line_length = str.length + 8 + puts "" + puts token * line_length + puts "#{token * 3} #{str} #{token * 3}" + puts token * line_length + puts "" +end diff --git a/owl-bot-staging/google-cloud-redis-cluster-v1beta1/gapic_metadata.json b/owl-bot-staging/google-cloud-redis-cluster-v1beta1/gapic_metadata.json new file mode 100644 index 000000000000..1ecbc8224ac2 --- /dev/null +++ b/owl-bot-staging/google-cloud-redis-cluster-v1beta1/gapic_metadata.json @@ -0,0 +1,88 @@ +{ + "schema": "1.0", + "comment": "This file maps proto services/RPCs to the corresponding library clients/methods", + "language": "ruby", + "protoPackage": "google.cloud.redis.cluster.v1beta1", + "libraryPackage": "::Google::Cloud::Redis::Cluster::V1beta1", + "services": { + "CloudRedisCluster": { + "clients": { + "grpc": { + "libraryClient": "::Google::Cloud::Redis::Cluster::V1beta1::CloudRedisCluster::Client", + "rpcs": { + "ListClusters": { + "methods": [ + "list_clusters" + ] + }, + "GetCluster": { + "methods": [ + "get_cluster" + ] + }, + "UpdateCluster": { + "methods": [ + "update_cluster" + ] + }, + "DeleteCluster": { + "methods": [ + "delete_cluster" + ] + }, + "CreateCluster": { + "methods": [ + "create_cluster" + ] + }, + "GetClusterCertificateAuthority": { + "methods": [ + "get_cluster_certificate_authority" + ] + }, + "RescheduleClusterMaintenance": { + "methods": [ + "reschedule_cluster_maintenance" + ] + }, + "ListBackupCollections": { + "methods": [ + "list_backup_collections" + ] + }, + "GetBackupCollection": { + "methods": [ + "get_backup_collection" + ] + }, + "ListBackups": { + "methods": [ + "list_backups" + ] + }, + "GetBackup": { + "methods": [ + "get_backup" + ] + }, + "DeleteBackup": { + "methods": [ + "delete_backup" + ] + }, + "ExportBackup": { + "methods": [ + "export_backup" + ] + }, + "BackupCluster": { + "methods": [ + "backup_cluster" + ] + } + } + } + } + } + } +} diff --git a/owl-bot-staging/google-cloud-redis-cluster-v1beta1/google-cloud-redis-cluster-v1beta1.gemspec b/owl-bot-staging/google-cloud-redis-cluster-v1beta1/google-cloud-redis-cluster-v1beta1.gemspec new file mode 100644 index 000000000000..65b7fef74d81 --- /dev/null +++ b/owl-bot-staging/google-cloud-redis-cluster-v1beta1/google-cloud-redis-cluster-v1beta1.gemspec @@ -0,0 +1,29 @@ +# -*- ruby -*- +# encoding: utf-8 + +require File.expand_path("lib/google/cloud/redis/cluster/v1beta1/version", __dir__) + +Gem::Specification.new do |gem| + gem.name = "google-cloud-redis-cluster-v1beta1" + gem.version = Google::Cloud::Redis::Cluster::V1beta1::VERSION + + gem.authors = ["Google LLC"] + gem.email = "googleapis-packages@google.com" + gem.description = "Creates and manages Redis instances on the Google Cloud Platform. Note that google-cloud-redis-cluster-v1beta1 is a version-specific client library. For most uses, we recommend installing the main client library google-cloud-redis-cluster instead. See the readme for more details." + gem.summary = "Creates and manages Redis instances on the Google Cloud Platform." + gem.homepage = "https://github.com/googleapis/google-cloud-ruby" + gem.license = "Apache-2.0" + + gem.platform = Gem::Platform::RUBY + + gem.files = `git ls-files -- lib/*`.split("\n") + + `git ls-files -- proto_docs/*`.split("\n") + + ["README.md", "LICENSE.md", "AUTHENTICATION.md", ".yardopts"] + gem.require_paths = ["lib"] + + gem.required_ruby_version = ">= 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-cloud-redis-cluster-v1beta1/lib/google-cloud-redis-cluster-v1beta1.rb b/owl-bot-staging/google-cloud-redis-cluster-v1beta1/lib/google-cloud-redis-cluster-v1beta1.rb new file mode 100644 index 000000000000..d6ebeaed939f --- /dev/null +++ b/owl-bot-staging/google-cloud-redis-cluster-v1beta1/lib/google-cloud-redis-cluster-v1beta1.rb @@ -0,0 +1,21 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +# This gem does not autoload during Bundler.require. To load this gem, +# issue explicit require statements for the packages desired, e.g.: +# require "google/cloud/redis/cluster/v1beta1" diff --git a/owl-bot-staging/google-cloud-redis-cluster-v1beta1/lib/google/cloud/redis/cluster/v1beta1.rb b/owl-bot-staging/google-cloud-redis-cluster-v1beta1/lib/google/cloud/redis/cluster/v1beta1.rb new file mode 100644 index 000000000000..9a8dca3ac28b --- /dev/null +++ b/owl-bot-staging/google-cloud-redis-cluster-v1beta1/lib/google/cloud/redis/cluster/v1beta1.rb @@ -0,0 +1,47 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +require "google/cloud/redis/cluster/v1beta1/cloud_redis_cluster" +require "google/cloud/redis/cluster/v1beta1/version" + +module Google + module Cloud + module Redis + module Cluster + ## + # API client module. + # + # @example Load this package, including all its services, and instantiate a gRPC client + # + # require "google/cloud/redis/cluster/v1beta1" + # client = ::Google::Cloud::Redis::Cluster::V1beta1::CloudRedisCluster::Client.new + # + # @example Load this package, including all its services, and instantiate a REST client + # + # require "google/cloud/redis/cluster/v1beta1" + # client = ::Google::Cloud::Redis::Cluster::V1beta1::CloudRedisCluster::Rest::Client.new + # + module V1beta1 + end + end + end + end +end + +helper_path = ::File.join __dir__, "v1beta1", "_helpers.rb" +require "google/cloud/redis/cluster/v1beta1/_helpers" if ::File.file? helper_path diff --git a/owl-bot-staging/google-cloud-redis-cluster-v1beta1/lib/google/cloud/redis/cluster/v1beta1/bindings_override.rb b/owl-bot-staging/google-cloud-redis-cluster-v1beta1/lib/google/cloud/redis/cluster/v1beta1/bindings_override.rb new file mode 100644 index 000000000000..e71d4e449670 --- /dev/null +++ b/owl-bot-staging/google-cloud-redis-cluster-v1beta1/lib/google/cloud/redis/cluster/v1beta1/bindings_override.rb @@ -0,0 +1,77 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +require "gapic/rest" + +module Google + module Cloud + module Redis + module Cluster + ## + # @example Loading just the REST part of this package, including all its services, and instantiating a REST client + # + # require "google/cloud/redis/cluster/v1beta1/rest" + # client = ::Google::Cloud::Redis::Cluster::V1beta1::CloudRedisCluster::Rest::Client.new + # + module V1beta1 + ## + # @private + # Initialize the mixin bindings configuration + # + def self.configure + @configure ||= begin + namespace = ["Google", "Cloud", "Redis", "Cluster"] + parent_config = while namespace.any? + parent_name = namespace.join "::" + parent_const = const_get parent_name + break parent_const.configure if parent_const.respond_to? :configure + namespace.pop + end + + default_config = ::Gapic::Rest::HttpBindingOverrideConfiguration.new parent_config + default_config.bindings_override["google.cloud.location.Locations.GetLocation"] = [ + Gapic::Rest::GrpcTranscoder::HttpBinding.create_with_validation( + uri_method: :get, + uri_template: "/v1beta1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/?$}, false] + ], + body: nil + ) + ] + default_config.bindings_override["google.cloud.location.Locations.ListLocations"] = [ + + Gapic::Rest::GrpcTranscoder::HttpBinding.create_with_validation( + uri_method: :get, + uri_template: "/v1beta1/{name}/locations", + matches: [ + ["name", %r{^projects/[^/]+/?$}, false] + ], + body: nil + ) + ] + default_config + end + yield @configure if block_given? + @configure + end + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-redis-cluster-v1beta1/lib/google/cloud/redis/cluster/v1beta1/cloud_redis_cluster.rb b/owl-bot-staging/google-cloud-redis-cluster-v1beta1/lib/google/cloud/redis/cluster/v1beta1/cloud_redis_cluster.rb new file mode 100644 index 000000000000..23fc244f3f90 --- /dev/null +++ b/owl-bot-staging/google-cloud-redis-cluster-v1beta1/lib/google/cloud/redis/cluster/v1beta1/cloud_redis_cluster.rb @@ -0,0 +1,72 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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/redis/cluster/v1beta1/version" + +require "google/cloud/redis/cluster/v1beta1/cloud_redis_cluster/credentials" +require "google/cloud/redis/cluster/v1beta1/cloud_redis_cluster/paths" +require "google/cloud/redis/cluster/v1beta1/cloud_redis_cluster/operations" +require "google/cloud/redis/cluster/v1beta1/cloud_redis_cluster/client" +require "google/cloud/redis/cluster/v1beta1/cloud_redis_cluster/rest" + +module Google + module Cloud + module Redis + module Cluster + module V1beta1 + ## + # Configures and manages Cloud Memorystore for Redis clusters + # + # Google Cloud Memorystore for Redis Cluster + # + # The `redis.googleapis.com` service implements the Google Cloud Memorystore + # for Redis API and defines the following resource model for managing Redis + # clusters: + # * The service works with a collection of cloud projects, named: `/projects/*` + # * Each project has a collection of available locations, named: `/locations/*` + # * Each location has a collection of Redis clusters, named: `/clusters/*` + # * As such, Redis clusters are resources of the form: + # `/projects/{project_id}/locations/{location_id}/clusters/{instance_id}` + # + # Note that location_id must be a GCP `region`; for example: + # * `projects/redpepper-1290/locations/us-central1/clusters/my-redis` + # + # @example Load this service and instantiate a gRPC client + # + # require "google/cloud/redis/cluster/v1beta1/cloud_redis_cluster" + # client = ::Google::Cloud::Redis::Cluster::V1beta1::CloudRedisCluster::Client.new + # + # @example Load this service and instantiate a REST client + # + # require "google/cloud/redis/cluster/v1beta1/cloud_redis_cluster/rest" + # client = ::Google::Cloud::Redis::Cluster::V1beta1::CloudRedisCluster::Rest::Client.new + # + module CloudRedisCluster + end + end + end + end + end +end + +helper_path = ::File.join __dir__, "cloud_redis_cluster", "helpers.rb" +require "google/cloud/redis/cluster/v1beta1/cloud_redis_cluster/helpers" if ::File.file? helper_path diff --git a/owl-bot-staging/google-cloud-redis-cluster-v1beta1/lib/google/cloud/redis/cluster/v1beta1/cloud_redis_cluster/client.rb b/owl-bot-staging/google-cloud-redis-cluster-v1beta1/lib/google/cloud/redis/cluster/v1beta1/cloud_redis_cluster/client.rb new file mode 100644 index 000000000000..2c3aeac42e98 --- /dev/null +++ b/owl-bot-staging/google-cloud-redis-cluster-v1beta1/lib/google/cloud/redis/cluster/v1beta1/cloud_redis_cluster/client.rb @@ -0,0 +1,1958 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +require "google/cloud/errors" +require "google/cloud/redis/cluster/v1beta1/cloud_redis_cluster_pb" +require "google/cloud/location" + +module Google + module Cloud + module Redis + module Cluster + module V1beta1 + module CloudRedisCluster + ## + # Client for the CloudRedisCluster service. + # + # Configures and manages Cloud Memorystore for Redis clusters + # + # Google Cloud Memorystore for Redis Cluster + # + # The `redis.googleapis.com` service implements the Google Cloud Memorystore + # for Redis API and defines the following resource model for managing Redis + # clusters: + # * The service works with a collection of cloud projects, named: `/projects/*` + # * Each project has a collection of available locations, named: `/locations/*` + # * Each location has a collection of Redis clusters, named: `/clusters/*` + # * As such, Redis clusters are resources of the form: + # `/projects/{project_id}/locations/{location_id}/clusters/{instance_id}` + # + # Note that location_id must be a GCP `region`; for example: + # * `projects/redpepper-1290/locations/us-central1/clusters/my-redis` + # + class Client + # @private + API_VERSION = "" + + # @private + DEFAULT_ENDPOINT_TEMPLATE = "redis.$UNIVERSE_DOMAIN$" + + include Paths + + # @private + attr_reader :cloud_redis_cluster_stub + + ## + # Configure the CloudRedisCluster Client class. + # + # See {::Google::Cloud::Redis::Cluster::V1beta1::CloudRedisCluster::Client::Configuration} + # for a description of the configuration fields. + # + # @example + # + # # Modify the configuration for all CloudRedisCluster clients + # ::Google::Cloud::Redis::Cluster::V1beta1::CloudRedisCluster::Client.configure do |config| + # config.timeout = 10.0 + # end + # + # @yield [config] Configure the Client client. + # @yieldparam config [Client::Configuration] + # + # @return [Client::Configuration] + # + def self.configure + @configure ||= begin + namespace = ["Google", "Cloud", "Redis", "Cluster", "V1beta1"] + parent_config = while namespace.any? + parent_name = namespace.join "::" + parent_const = const_get parent_name + break parent_const.configure if parent_const.respond_to? :configure + namespace.pop + end + default_config = Client::Configuration.new parent_config + + default_config.rpcs.list_clusters.timeout = 600.0 + + default_config.rpcs.get_cluster.timeout = 600.0 + + default_config.rpcs.update_cluster.timeout = 600.0 + + default_config.rpcs.delete_cluster.timeout = 600.0 + + default_config.rpcs.create_cluster.timeout = 600.0 + + default_config.rpcs.get_cluster_certificate_authority.timeout = 600.0 + + default_config.rpcs.reschedule_cluster_maintenance.timeout = 600.0 + + default_config.rpcs.list_backup_collections.timeout = 600.0 + + default_config.rpcs.get_backup_collection.timeout = 600.0 + + default_config.rpcs.list_backups.timeout = 600.0 + + default_config.rpcs.get_backup.timeout = 600.0 + + default_config.rpcs.delete_backup.timeout = 600.0 + + default_config.rpcs.export_backup.timeout = 600.0 + + default_config.rpcs.backup_cluster.timeout = 600.0 + + default_config + end + yield @configure if block_given? + @configure + end + + ## + # Configure the CloudRedisCluster Client instance. + # + # The configuration is set to the derived mode, meaning that values can be changed, + # but structural changes (adding new fields, etc.) are not allowed. Structural changes + # should be made on {Client.configure}. + # + # See {::Google::Cloud::Redis::Cluster::V1beta1::CloudRedisCluster::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 + @cloud_redis_cluster_stub.universe_domain + end + + ## + # Create a new CloudRedisCluster client object. + # + # @example + # + # # Create a client using the default configuration + # client = ::Google::Cloud::Redis::Cluster::V1beta1::CloudRedisCluster::Client.new + # + # # Create a client using a custom configuration + # client = ::Google::Cloud::Redis::Cluster::V1beta1::CloudRedisCluster::Client.new do |config| + # config.timeout = 10.0 + # end + # + # @yield [config] Configure the CloudRedisCluster client. + # @yieldparam config [Client::Configuration] + # + def initialize + # These require statements are intentionally placed here to initialize + # the gRPC module only when it's required. + # See https://github.com/googleapis/toolkit/issues/446 + require "gapic/grpc" + require "google/cloud/redis/cluster/v1beta1/cloud_redis_cluster_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 + + @cloud_redis_cluster_stub = ::Gapic::ServiceStub.new( + ::Google::Cloud::Redis::Cluster::V1beta1::CloudRedisCluster::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 + ) + + @cloud_redis_cluster_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 = @cloud_redis_cluster_stub.endpoint + config.universe_domain = @cloud_redis_cluster_stub.universe_domain + config.logger = @cloud_redis_cluster_stub.logger if config.respond_to? :logger= + end + end + + ## + # Get the associated client for long-running operations. + # + # @return [::Google::Cloud::Redis::Cluster::V1beta1::CloudRedisCluster::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 + @cloud_redis_cluster_stub.logger + end + + # Service calls + + ## + # Lists all Redis clusters owned by a project in either the specified + # location (region) or all locations. + # + # The location should have the following format: + # + # * `projects/{project_id}/locations/{location_id}` + # + # If `location_id` is specified as `-` (wildcard), then all regions + # available to the project are queried, and the results are aggregated. + # + # @overload list_clusters(request, options = nil) + # Pass arguments to `list_clusters` via a request object, either of type + # {::Google::Cloud::Redis::Cluster::V1beta1::ListClustersRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Redis::Cluster::V1beta1::ListClustersRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_clusters(parent: nil, page_size: nil, page_token: nil) + # Pass arguments to `list_clusters` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param parent [::String] + # Required. The resource name of the cluster location using the form: + # `projects/{project_id}/locations/{location_id}` + # where `location_id` refers to a GCP region. + # @param page_size [::Integer] + # The maximum number of items to return. + # + # If not specified, a default value of 1000 will be used by the service. + # Regardless of the page_size value, the response may include a partial list + # and a caller should only rely on response's + # {::Google::Cloud::Redis::Cluster::V1beta1::ListClustersResponse#next_page_token `next_page_token`} + # to determine if there are more clusters left to be queried. + # @param page_token [::String] + # The `next_page_token` value returned from a previous + # [ListClusters][CloudRedis.ListClusters] request, if any. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Gapic::PagedEnumerable<::Google::Cloud::Redis::Cluster::V1beta1::Cluster>] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Gapic::PagedEnumerable<::Google::Cloud::Redis::Cluster::V1beta1::Cluster>] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/redis/cluster/v1beta1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Redis::Cluster::V1beta1::CloudRedisCluster::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Redis::Cluster::V1beta1::ListClustersRequest.new + # + # # Call the list_clusters method. + # result = client.list_clusters request + # + # # The returned object is of type Gapic::PagedEnumerable. You can iterate + # # over elements, and API calls will be issued to fetch pages as needed. + # result.each do |item| + # # Each element is of type ::Google::Cloud::Redis::Cluster::V1beta1::Cluster. + # p item + # end + # + def list_clusters request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Redis::Cluster::V1beta1::ListClustersRequest + + # Converts hash 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_clusters.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::Redis::Cluster::V1beta1::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_clusters.timeout, + metadata: metadata, + retry_policy: @config.rpcs.list_clusters.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @cloud_redis_cluster_stub.call_rpc :list_clusters, request, options: options do |response, operation| + response = ::Gapic::PagedEnumerable.new @cloud_redis_cluster_stub, :list_clusters, request, response, operation, options + yield response, operation if block_given? + throw :response, response + end + rescue ::GRPC::BadStatus => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Gets the details of a specific Redis cluster. + # + # @overload get_cluster(request, options = nil) + # Pass arguments to `get_cluster` via a request object, either of type + # {::Google::Cloud::Redis::Cluster::V1beta1::GetClusterRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Redis::Cluster::V1beta1::GetClusterRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_cluster(name: nil) + # Pass arguments to `get_cluster` via keyword arguments. Note that at + # least one keyword argument is 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. Redis cluster resource name using the form: + # `projects/{project_id}/locations/{location_id}/clusters/{cluster_id}` + # where `location_id` refers to a GCP region. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Google::Cloud::Redis::Cluster::V1beta1::Cluster] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Google::Cloud::Redis::Cluster::V1beta1::Cluster] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/redis/cluster/v1beta1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Redis::Cluster::V1beta1::CloudRedisCluster::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Redis::Cluster::V1beta1::GetClusterRequest.new + # + # # Call the get_cluster method. + # result = client.get_cluster request + # + # # The returned object is of type Google::Cloud::Redis::Cluster::V1beta1::Cluster. + # p result + # + def get_cluster request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Redis::Cluster::V1beta1::GetClusterRequest + + # Converts hash 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_cluster.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::Redis::Cluster::V1beta1::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_cluster.timeout, + metadata: metadata, + retry_policy: @config.rpcs.get_cluster.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @cloud_redis_cluster_stub.call_rpc :get_cluster, request, options: options do |response, operation| + yield response, operation if block_given? + end + rescue ::GRPC::BadStatus => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Updates the metadata and configuration of a specific Redis cluster. + # + # Completed longrunning.Operation will contain the new cluster object + # in the response field. The returned operation is automatically deleted + # after a few hours, so there is no need to call DeleteOperation. + # + # @overload update_cluster(request, options = nil) + # Pass arguments to `update_cluster` via a request object, either of type + # {::Google::Cloud::Redis::Cluster::V1beta1::UpdateClusterRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Redis::Cluster::V1beta1::UpdateClusterRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_cluster(update_mask: nil, cluster: nil, request_id: nil) + # Pass arguments to `update_cluster` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param update_mask [::Google::Protobuf::FieldMask, ::Hash] + # Required. Mask of fields to update. At least one path must be supplied in + # this field. The elements of the repeated paths field may only include these + # fields from {::Google::Cloud::Redis::Cluster::V1beta1::Cluster Cluster}: + # + # * `size_gb` + # * `replica_count` + # @param cluster [::Google::Cloud::Redis::Cluster::V1beta1::Cluster, ::Hash] + # Required. Update description. + # Only fields specified in update_mask are updated. + # @param request_id [::String] + # Idempotent request UUID. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Gapic::Operation] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Gapic::Operation] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/redis/cluster/v1beta1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Redis::Cluster::V1beta1::CloudRedisCluster::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Redis::Cluster::V1beta1::UpdateClusterRequest.new + # + # # Call the update_cluster method. + # result = client.update_cluster 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_cluster request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Redis::Cluster::V1beta1::UpdateClusterRequest + + # Converts hash 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_cluster.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::Redis::Cluster::V1beta1::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.cluster&.name + header_params["cluster.name"] = request.cluster.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_cluster.timeout, + metadata: metadata, + retry_policy: @config.rpcs.update_cluster.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @cloud_redis_cluster_stub.call_rpc :update_cluster, 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 specific Redis cluster. Cluster stops serving and data is + # deleted. + # + # @overload delete_cluster(request, options = nil) + # Pass arguments to `delete_cluster` via a request object, either of type + # {::Google::Cloud::Redis::Cluster::V1beta1::DeleteClusterRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Redis::Cluster::V1beta1::DeleteClusterRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_cluster(name: nil, request_id: nil) + # Pass arguments to `delete_cluster` via keyword arguments. Note that at + # least one keyword argument is 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. Redis cluster resource name using the form: + # `projects/{project_id}/locations/{location_id}/clusters/{cluster_id}` + # where `location_id` refers to a GCP region. + # @param request_id [::String] + # Idempotent request UUID. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Gapic::Operation] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Gapic::Operation] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/redis/cluster/v1beta1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Redis::Cluster::V1beta1::CloudRedisCluster::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Redis::Cluster::V1beta1::DeleteClusterRequest.new + # + # # Call the delete_cluster method. + # result = client.delete_cluster 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_cluster request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Redis::Cluster::V1beta1::DeleteClusterRequest + + # Converts hash 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_cluster.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::Redis::Cluster::V1beta1::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_cluster.timeout, + metadata: metadata, + retry_policy: @config.rpcs.delete_cluster.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @cloud_redis_cluster_stub.call_rpc :delete_cluster, 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 + + ## + # Creates a Redis cluster based on the specified properties. + # The creation is executed asynchronously and callers may check the returned + # operation to track its progress. Once the operation is completed the Redis + # cluster will be fully functional. The completed longrunning.Operation will + # contain the new cluster object in the response field. + # + # The returned operation is automatically deleted after a few hours, so there + # is no need to call DeleteOperation. + # + # @overload create_cluster(request, options = nil) + # Pass arguments to `create_cluster` via a request object, either of type + # {::Google::Cloud::Redis::Cluster::V1beta1::CreateClusterRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Redis::Cluster::V1beta1::CreateClusterRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_cluster(parent: nil, cluster_id: nil, cluster: nil, request_id: nil) + # Pass arguments to `create_cluster` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param parent [::String] + # Required. The resource name of the cluster location using the form: + # `projects/{project_id}/locations/{location_id}` + # where `location_id` refers to a GCP region. + # @param cluster_id [::String] + # Required. The logical name of the Redis cluster in the customer project + # with the following restrictions: + # + # * Must contain only lowercase letters, numbers, and hyphens. + # * Must start with a letter. + # * Must be between 1-63 characters. + # * Must end with a number or a letter. + # * Must be unique within the customer project / location + # @param cluster [::Google::Cloud::Redis::Cluster::V1beta1::Cluster, ::Hash] + # Required. The cluster that is to be created. + # @param request_id [::String] + # Idempotent request UUID. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Gapic::Operation] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Gapic::Operation] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/redis/cluster/v1beta1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Redis::Cluster::V1beta1::CloudRedisCluster::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Redis::Cluster::V1beta1::CreateClusterRequest.new + # + # # Call the create_cluster method. + # result = client.create_cluster 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_cluster request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Redis::Cluster::V1beta1::CreateClusterRequest + + # Converts hash 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_cluster.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::Redis::Cluster::V1beta1::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_cluster.timeout, + metadata: metadata, + retry_policy: @config.rpcs.create_cluster.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @cloud_redis_cluster_stub.call_rpc :create_cluster, 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 the details of certificate authority information for Redis cluster. + # + # @overload get_cluster_certificate_authority(request, options = nil) + # Pass arguments to `get_cluster_certificate_authority` via a request object, either of type + # {::Google::Cloud::Redis::Cluster::V1beta1::GetClusterCertificateAuthorityRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Redis::Cluster::V1beta1::GetClusterCertificateAuthorityRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_cluster_certificate_authority(name: nil) + # Pass arguments to `get_cluster_certificate_authority` via keyword arguments. Note that at + # least one keyword argument is 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. Redis cluster certificate authority resource name using the form: + # `projects/{project_id}/locations/{location_id}/clusters/{cluster_id}/certificateAuthority` + # where `location_id` refers to a GCP region. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Google::Cloud::Redis::Cluster::V1beta1::CertificateAuthority] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Google::Cloud::Redis::Cluster::V1beta1::CertificateAuthority] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/redis/cluster/v1beta1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Redis::Cluster::V1beta1::CloudRedisCluster::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Redis::Cluster::V1beta1::GetClusterCertificateAuthorityRequest.new + # + # # Call the get_cluster_certificate_authority method. + # result = client.get_cluster_certificate_authority request + # + # # The returned object is of type Google::Cloud::Redis::Cluster::V1beta1::CertificateAuthority. + # p result + # + def get_cluster_certificate_authority request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Redis::Cluster::V1beta1::GetClusterCertificateAuthorityRequest + + # Converts hash 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_cluster_certificate_authority.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::Redis::Cluster::V1beta1::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_cluster_certificate_authority.timeout, + metadata: metadata, + retry_policy: @config.rpcs.get_cluster_certificate_authority.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @cloud_redis_cluster_stub.call_rpc :get_cluster_certificate_authority, 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 + + ## + # Reschedules upcoming maintenance event. + # + # @overload reschedule_cluster_maintenance(request, options = nil) + # Pass arguments to `reschedule_cluster_maintenance` via a request object, either of type + # {::Google::Cloud::Redis::Cluster::V1beta1::RescheduleClusterMaintenanceRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Redis::Cluster::V1beta1::RescheduleClusterMaintenanceRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. + # + # @overload reschedule_cluster_maintenance(name: nil, reschedule_type: nil, schedule_time: nil) + # Pass arguments to `reschedule_cluster_maintenance` via keyword arguments. Note that at + # least one keyword argument is 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. Redis Cluster instance resource name using the form: + # `projects/{project_id}/locations/{location_id}/clusters/{cluster_id}` + # where `location_id` refers to a GCP region. + # @param reschedule_type [::Google::Cloud::Redis::Cluster::V1beta1::RescheduleClusterMaintenanceRequest::RescheduleType] + # Required. If reschedule type is SPECIFIC_TIME, must set up schedule_time as + # well. + # @param schedule_time [::Google::Protobuf::Timestamp, ::Hash] + # Optional. Timestamp when the maintenance shall be rescheduled to if + # reschedule_type=SPECIFIC_TIME, in RFC 3339 format, for + # example `2012-11-15T16:19:00.094Z`. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Gapic::Operation] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Gapic::Operation] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/redis/cluster/v1beta1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Redis::Cluster::V1beta1::CloudRedisCluster::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Redis::Cluster::V1beta1::RescheduleClusterMaintenanceRequest.new + # + # # Call the reschedule_cluster_maintenance method. + # result = client.reschedule_cluster_maintenance 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 reschedule_cluster_maintenance request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Redis::Cluster::V1beta1::RescheduleClusterMaintenanceRequest + + # Converts hash 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.reschedule_cluster_maintenance.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::Redis::Cluster::V1beta1::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.reschedule_cluster_maintenance.timeout, + metadata: metadata, + retry_policy: @config.rpcs.reschedule_cluster_maintenance.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @cloud_redis_cluster_stub.call_rpc :reschedule_cluster_maintenance, 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 all backup collections owned by a consumer project in either the + # specified location (region) or all locations. + # + # If `location_id` is specified as `-` (wildcard), then all regions + # available to the project are queried, and the results are aggregated. + # + # @overload list_backup_collections(request, options = nil) + # Pass arguments to `list_backup_collections` via a request object, either of type + # {::Google::Cloud::Redis::Cluster::V1beta1::ListBackupCollectionsRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Redis::Cluster::V1beta1::ListBackupCollectionsRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_backup_collections(parent: nil, page_size: nil, page_token: nil) + # Pass arguments to `list_backup_collections` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param parent [::String] + # Required. The resource name of the backupCollection location using the + # form: + # `projects/{project_id}/locations/{location_id}` + # where `location_id` refers to a GCP region. + # @param page_size [::Integer] + # Optional. The maximum number of items to return. + # + # If not specified, a default value of 1000 will be used by the service. + # Regardless of the page_size value, the response may include a partial list + # and a caller should only rely on response's + # {::Google::Cloud::Redis::Cluster::V1beta1::ListBackupCollectionsResponse#next_page_token `next_page_token`} + # to determine if there are more clusters left to be queried. + # @param page_token [::String] + # Optional. The `next_page_token` value returned from a previous + # [ListBackupCollections] request, if any. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Gapic::PagedEnumerable<::Google::Cloud::Redis::Cluster::V1beta1::BackupCollection>] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Gapic::PagedEnumerable<::Google::Cloud::Redis::Cluster::V1beta1::BackupCollection>] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/redis/cluster/v1beta1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Redis::Cluster::V1beta1::CloudRedisCluster::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Redis::Cluster::V1beta1::ListBackupCollectionsRequest.new + # + # # Call the list_backup_collections method. + # result = client.list_backup_collections request + # + # # The returned object is of type Gapic::PagedEnumerable. You can iterate + # # over elements, and API calls will be issued to fetch pages as needed. + # result.each do |item| + # # Each element is of type ::Google::Cloud::Redis::Cluster::V1beta1::BackupCollection. + # p item + # end + # + def list_backup_collections request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Redis::Cluster::V1beta1::ListBackupCollectionsRequest + + # Converts hash 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_backup_collections.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::Redis::Cluster::V1beta1::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_backup_collections.timeout, + metadata: metadata, + retry_policy: @config.rpcs.list_backup_collections.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @cloud_redis_cluster_stub.call_rpc :list_backup_collections, request, options: options do |response, operation| + response = ::Gapic::PagedEnumerable.new @cloud_redis_cluster_stub, :list_backup_collections, 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 + + ## + # Get a backup collection. + # + # @overload get_backup_collection(request, options = nil) + # Pass arguments to `get_backup_collection` via a request object, either of type + # {::Google::Cloud::Redis::Cluster::V1beta1::GetBackupCollectionRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Redis::Cluster::V1beta1::GetBackupCollectionRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_backup_collection(name: nil) + # Pass arguments to `get_backup_collection` via keyword arguments. Note that at + # least one keyword argument is 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. Redis backupCollection resource name using the form: + # `projects/{project_id}/locations/{location_id}/backupCollections/{backup_collection_id}` + # where `location_id` refers to a GCP region. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Google::Cloud::Redis::Cluster::V1beta1::BackupCollection] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Google::Cloud::Redis::Cluster::V1beta1::BackupCollection] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/redis/cluster/v1beta1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Redis::Cluster::V1beta1::CloudRedisCluster::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Redis::Cluster::V1beta1::GetBackupCollectionRequest.new + # + # # Call the get_backup_collection method. + # result = client.get_backup_collection request + # + # # The returned object is of type Google::Cloud::Redis::Cluster::V1beta1::BackupCollection. + # p result + # + def get_backup_collection request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Redis::Cluster::V1beta1::GetBackupCollectionRequest + + # Converts hash 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_backup_collection.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::Redis::Cluster::V1beta1::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_backup_collection.timeout, + metadata: metadata, + retry_policy: @config.rpcs.get_backup_collection.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @cloud_redis_cluster_stub.call_rpc :get_backup_collection, request, options: options do |response, operation| + yield response, operation if block_given? + end + rescue ::GRPC::BadStatus => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Lists all backups owned by a backup collection. + # + # @overload list_backups(request, options = nil) + # Pass arguments to `list_backups` via a request object, either of type + # {::Google::Cloud::Redis::Cluster::V1beta1::ListBackupsRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Redis::Cluster::V1beta1::ListBackupsRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_backups(parent: nil, page_size: nil, page_token: nil) + # Pass arguments to `list_backups` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param parent [::String] + # Required. The resource name of the backupCollection using the form: + # `projects/{project_id}/locations/{location_id}/backupCollections/{backup_collection_id}` + # @param page_size [::Integer] + # Optional. The maximum number of items to return. + # + # If not specified, a default value of 1000 will be used by the service. + # Regardless of the page_size value, the response may include a partial list + # and a caller should only rely on response's + # {::Google::Cloud::Redis::Cluster::V1beta1::ListBackupsResponse#next_page_token `next_page_token`} + # to determine if there are more clusters left to be queried. + # @param page_token [::String] + # Optional. The `next_page_token` value returned from a previous + # [ListBackupCollections] request, if any. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Gapic::PagedEnumerable<::Google::Cloud::Redis::Cluster::V1beta1::Backup>] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Gapic::PagedEnumerable<::Google::Cloud::Redis::Cluster::V1beta1::Backup>] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/redis/cluster/v1beta1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Redis::Cluster::V1beta1::CloudRedisCluster::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Redis::Cluster::V1beta1::ListBackupsRequest.new + # + # # Call the list_backups method. + # result = client.list_backups request + # + # # The returned object is of type Gapic::PagedEnumerable. You can iterate + # # over elements, and API calls will be issued to fetch pages as needed. + # result.each do |item| + # # Each element is of type ::Google::Cloud::Redis::Cluster::V1beta1::Backup. + # p item + # end + # + def list_backups request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Redis::Cluster::V1beta1::ListBackupsRequest + + # Converts hash 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_backups.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::Redis::Cluster::V1beta1::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_backups.timeout, + metadata: metadata, + retry_policy: @config.rpcs.list_backups.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @cloud_redis_cluster_stub.call_rpc :list_backups, request, options: options do |response, operation| + response = ::Gapic::PagedEnumerable.new @cloud_redis_cluster_stub, :list_backups, request, response, operation, options + yield response, operation if block_given? + throw :response, response + end + rescue ::GRPC::BadStatus => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Gets the details of a specific backup. + # + # @overload get_backup(request, options = nil) + # Pass arguments to `get_backup` via a request object, either of type + # {::Google::Cloud::Redis::Cluster::V1beta1::GetBackupRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Redis::Cluster::V1beta1::GetBackupRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_backup(name: nil) + # Pass arguments to `get_backup` via keyword arguments. Note that at + # least one keyword argument is 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. Redis backup resource name using the form: + # `projects/{project_id}/locations/{location_id}/backupCollections/{backup_collection_id}/backups/{backup_id}` + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Google::Cloud::Redis::Cluster::V1beta1::Backup] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Google::Cloud::Redis::Cluster::V1beta1::Backup] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/redis/cluster/v1beta1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Redis::Cluster::V1beta1::CloudRedisCluster::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Redis::Cluster::V1beta1::GetBackupRequest.new + # + # # Call the get_backup method. + # result = client.get_backup request + # + # # The returned object is of type Google::Cloud::Redis::Cluster::V1beta1::Backup. + # p result + # + def get_backup request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Redis::Cluster::V1beta1::GetBackupRequest + + # Converts hash 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_backup.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::Redis::Cluster::V1beta1::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_backup.timeout, + metadata: metadata, + retry_policy: @config.rpcs.get_backup.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @cloud_redis_cluster_stub.call_rpc :get_backup, request, options: options do |response, operation| + yield response, operation if block_given? + end + rescue ::GRPC::BadStatus => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Deletes a specific backup. + # + # @overload delete_backup(request, options = nil) + # Pass arguments to `delete_backup` via a request object, either of type + # {::Google::Cloud::Redis::Cluster::V1beta1::DeleteBackupRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Redis::Cluster::V1beta1::DeleteBackupRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_backup(name: nil, request_id: nil) + # Pass arguments to `delete_backup` via keyword arguments. Note that at + # least one keyword argument is 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. Redis backup resource name using the form: + # `projects/{project_id}/locations/{location_id}/backupCollections/{backup_collection_id}/backups/{backup_id}` + # @param request_id [::String] + # Optional. Idempotent request UUID. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Gapic::Operation] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Gapic::Operation] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/redis/cluster/v1beta1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Redis::Cluster::V1beta1::CloudRedisCluster::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Redis::Cluster::V1beta1::DeleteBackupRequest.new + # + # # Call the delete_backup method. + # result = client.delete_backup 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_backup request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Redis::Cluster::V1beta1::DeleteBackupRequest + + # Converts hash 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_backup.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::Redis::Cluster::V1beta1::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_backup.timeout, + metadata: metadata, + retry_policy: @config.rpcs.delete_backup.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @cloud_redis_cluster_stub.call_rpc :delete_backup, 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 + + ## + # Exports a specific backup to a customer target Cloud Storage URI. + # + # @overload export_backup(request, options = nil) + # Pass arguments to `export_backup` via a request object, either of type + # {::Google::Cloud::Redis::Cluster::V1beta1::ExportBackupRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Redis::Cluster::V1beta1::ExportBackupRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. + # + # @overload export_backup(gcs_bucket: nil, name: nil) + # Pass arguments to `export_backup` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param gcs_bucket [::String] + # Google Cloud Storage bucket, like "my-bucket". + # @param name [::String] + # Required. Redis backup resource name using the form: + # `projects/{project_id}/locations/{location_id}/backupCollections/{backup_collection_id}/backups/{backup_id}` + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Gapic::Operation] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Gapic::Operation] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/redis/cluster/v1beta1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Redis::Cluster::V1beta1::CloudRedisCluster::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Redis::Cluster::V1beta1::ExportBackupRequest.new + # + # # Call the export_backup method. + # result = client.export_backup 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 export_backup request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Redis::Cluster::V1beta1::ExportBackupRequest + + # Converts hash 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.export_backup.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::Redis::Cluster::V1beta1::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.export_backup.timeout, + metadata: metadata, + retry_policy: @config.rpcs.export_backup.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @cloud_redis_cluster_stub.call_rpc :export_backup, 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 + + ## + # Backup Redis Cluster. + # If this is the first time a backup is being created, a backup collection + # will be created at the backend, and this backup belongs to this collection. + # Both collection and backup will have a resource name. Backup will be + # executed for each shard. A replica (primary if nonHA) will be selected to + # perform the execution. Backup call will be rejected if there is an ongoing + # backup or update operation. Be aware that during preview, if the cluster's + # internal software version is too old, critical update will be performed + # before actual backup. Once the internal software version is updated to the + # minimum version required by the backup feature, subsequent backups will not + # require critical update. After preview, there will be no critical update + # needed for backup. + # + # @overload backup_cluster(request, options = nil) + # Pass arguments to `backup_cluster` via a request object, either of type + # {::Google::Cloud::Redis::Cluster::V1beta1::BackupClusterRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Redis::Cluster::V1beta1::BackupClusterRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. + # + # @overload backup_cluster(name: nil, ttl: nil, backup_id: nil) + # Pass arguments to `backup_cluster` via keyword arguments. Note that at + # least one keyword argument is 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. Redis cluster resource name using the form: + # `projects/{project_id}/locations/{location_id}/clusters/{cluster_id}` + # where `location_id` refers to a GCP region. + # @param ttl [::Google::Protobuf::Duration, ::Hash] + # Optional. TTL for the backup to expire. Value range is 1 day to 100 years. + # If not specified, the default value is 100 years. + # @param backup_id [::String] + # Optional. The id of the backup to be created. If not specified, the + # default value ([YYYYMMDDHHMMSS]_[Shortened Cluster UID] is 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/cloud/redis/cluster/v1beta1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Redis::Cluster::V1beta1::CloudRedisCluster::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Redis::Cluster::V1beta1::BackupClusterRequest.new + # + # # Call the backup_cluster method. + # result = client.backup_cluster 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 backup_cluster request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Redis::Cluster::V1beta1::BackupClusterRequest + + # Converts hash 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.backup_cluster.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::Redis::Cluster::V1beta1::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.backup_cluster.timeout, + metadata: metadata, + retry_policy: @config.rpcs.backup_cluster.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @cloud_redis_cluster_stub.call_rpc :backup_cluster, 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 CloudRedisCluster API. + # + # This class represents the configuration for CloudRedisCluster, + # providing control over timeouts, retry behavior, logging, transport + # parameters, and other low-level controls. Certain parameters can also be + # applied individually to specific RPCs. See + # {::Google::Cloud::Redis::Cluster::V1beta1::CloudRedisCluster::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_clusters to 20 seconds, + # # and all remaining timeouts to 10 seconds. + # ::Google::Cloud::Redis::Cluster::V1beta1::CloudRedisCluster::Client.configure do |config| + # config.timeout = 10.0 + # config.rpcs.list_clusters.timeout = 20.0 + # end + # + # # Apply the above configuration only to a new client. + # client = ::Google::Cloud::Redis::Cluster::V1beta1::CloudRedisCluster::Client.new do |config| + # config.timeout = 10.0 + # config.rpcs.list_clusters.timeout = 20.0 + # end + # + # @!attribute [rw] endpoint + # A custom service endpoint, as a hostname or hostname:port. The default is + # nil, indicating to use the default endpoint in the current universe domain. + # @return [::String,nil] + # @!attribute [rw] credentials + # Credentials to send with calls. You may provide any of the following types: + # * (`Google::Auth::Credentials`) A googleauth credentials object + # (see the [googleauth docs](https://rubydoc.info/gems/googleauth/Google/Auth/Credentials)) + # * (`Signet::OAuth2::Client`) A signet oauth2 client object + # (see the [signet docs](https://rubydoc.info/gems/signet/Signet/OAuth2/Client)) + # * (`GRPC::Core::Channel`) a gRPC channel with included credentials + # * (`GRPC::Core::ChannelCredentials`) a gRPC credentails object + # * (`nil`) indicating no credentials + # + # @note Warning: Passing a `String` to a keyfile path or a `Hash` of credentials + # is deprecated. Providing an unvalidated credential configuration to + # Google APIs can compromise the security of your systems and data. + # + # @example + # + # # The recommended way to provide credentials is to use the `make_creds` method + # # on the appropriate credentials class for your environment. + # + # require "googleauth" + # + # credentials = ::Google::Auth::ServiceAccountCredentials.make_creds( + # json_key_io: ::File.open("/path/to/keyfile.json") + # ) + # + # client = ::Google::Cloud::Redis::Cluster::V1beta1::CloudRedisCluster::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 = "redis.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 CloudRedisCluster 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_clusters` + # @return [::Gapic::Config::Method] + # + attr_reader :list_clusters + ## + # RPC-specific configuration for `get_cluster` + # @return [::Gapic::Config::Method] + # + attr_reader :get_cluster + ## + # RPC-specific configuration for `update_cluster` + # @return [::Gapic::Config::Method] + # + attr_reader :update_cluster + ## + # RPC-specific configuration for `delete_cluster` + # @return [::Gapic::Config::Method] + # + attr_reader :delete_cluster + ## + # RPC-specific configuration for `create_cluster` + # @return [::Gapic::Config::Method] + # + attr_reader :create_cluster + ## + # RPC-specific configuration for `get_cluster_certificate_authority` + # @return [::Gapic::Config::Method] + # + attr_reader :get_cluster_certificate_authority + ## + # RPC-specific configuration for `reschedule_cluster_maintenance` + # @return [::Gapic::Config::Method] + # + attr_reader :reschedule_cluster_maintenance + ## + # RPC-specific configuration for `list_backup_collections` + # @return [::Gapic::Config::Method] + # + attr_reader :list_backup_collections + ## + # RPC-specific configuration for `get_backup_collection` + # @return [::Gapic::Config::Method] + # + attr_reader :get_backup_collection + ## + # RPC-specific configuration for `list_backups` + # @return [::Gapic::Config::Method] + # + attr_reader :list_backups + ## + # RPC-specific configuration for `get_backup` + # @return [::Gapic::Config::Method] + # + attr_reader :get_backup + ## + # RPC-specific configuration for `delete_backup` + # @return [::Gapic::Config::Method] + # + attr_reader :delete_backup + ## + # RPC-specific configuration for `export_backup` + # @return [::Gapic::Config::Method] + # + attr_reader :export_backup + ## + # RPC-specific configuration for `backup_cluster` + # @return [::Gapic::Config::Method] + # + attr_reader :backup_cluster + + # @private + def initialize parent_rpcs = nil + list_clusters_config = parent_rpcs.list_clusters if parent_rpcs.respond_to? :list_clusters + @list_clusters = ::Gapic::Config::Method.new list_clusters_config + get_cluster_config = parent_rpcs.get_cluster if parent_rpcs.respond_to? :get_cluster + @get_cluster = ::Gapic::Config::Method.new get_cluster_config + update_cluster_config = parent_rpcs.update_cluster if parent_rpcs.respond_to? :update_cluster + @update_cluster = ::Gapic::Config::Method.new update_cluster_config + delete_cluster_config = parent_rpcs.delete_cluster if parent_rpcs.respond_to? :delete_cluster + @delete_cluster = ::Gapic::Config::Method.new delete_cluster_config + create_cluster_config = parent_rpcs.create_cluster if parent_rpcs.respond_to? :create_cluster + @create_cluster = ::Gapic::Config::Method.new create_cluster_config + get_cluster_certificate_authority_config = parent_rpcs.get_cluster_certificate_authority if parent_rpcs.respond_to? :get_cluster_certificate_authority + @get_cluster_certificate_authority = ::Gapic::Config::Method.new get_cluster_certificate_authority_config + reschedule_cluster_maintenance_config = parent_rpcs.reschedule_cluster_maintenance if parent_rpcs.respond_to? :reschedule_cluster_maintenance + @reschedule_cluster_maintenance = ::Gapic::Config::Method.new reschedule_cluster_maintenance_config + list_backup_collections_config = parent_rpcs.list_backup_collections if parent_rpcs.respond_to? :list_backup_collections + @list_backup_collections = ::Gapic::Config::Method.new list_backup_collections_config + get_backup_collection_config = parent_rpcs.get_backup_collection if parent_rpcs.respond_to? :get_backup_collection + @get_backup_collection = ::Gapic::Config::Method.new get_backup_collection_config + list_backups_config = parent_rpcs.list_backups if parent_rpcs.respond_to? :list_backups + @list_backups = ::Gapic::Config::Method.new list_backups_config + get_backup_config = parent_rpcs.get_backup if parent_rpcs.respond_to? :get_backup + @get_backup = ::Gapic::Config::Method.new get_backup_config + delete_backup_config = parent_rpcs.delete_backup if parent_rpcs.respond_to? :delete_backup + @delete_backup = ::Gapic::Config::Method.new delete_backup_config + export_backup_config = parent_rpcs.export_backup if parent_rpcs.respond_to? :export_backup + @export_backup = ::Gapic::Config::Method.new export_backup_config + backup_cluster_config = parent_rpcs.backup_cluster if parent_rpcs.respond_to? :backup_cluster + @backup_cluster = ::Gapic::Config::Method.new backup_cluster_config + + yield self if block_given? + end + end + end + end + end + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-redis-cluster-v1beta1/lib/google/cloud/redis/cluster/v1beta1/cloud_redis_cluster/credentials.rb b/owl-bot-staging/google-cloud-redis-cluster-v1beta1/lib/google/cloud/redis/cluster/v1beta1/cloud_redis_cluster/credentials.rb new file mode 100644 index 000000000000..95358ab0cf8d --- /dev/null +++ b/owl-bot-staging/google-cloud-redis-cluster-v1beta1/lib/google/cloud/redis/cluster/v1beta1/cloud_redis_cluster/credentials.rb @@ -0,0 +1,49 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +require "googleauth" + +module Google + module Cloud + module Redis + module Cluster + module V1beta1 + module CloudRedisCluster + # Credentials for the CloudRedisCluster API. + class Credentials < ::Google::Auth::Credentials + self.scope = [ + "https://www.googleapis.com/auth/cloud-platform" + ] + self.env_vars = [ + "GOOGLE_CLOUD_CREDENTIALS", + "GOOGLE_CLOUD_KEYFILE", + "GCLOUD_KEYFILE", + "GOOGLE_CLOUD_CREDENTIALS_JSON", + "GOOGLE_CLOUD_KEYFILE_JSON", + "GCLOUD_KEYFILE_JSON" + ] + self.paths = [ + "~/.config/google_cloud/application_default_credentials.json" + ] + end + end + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-redis-cluster-v1beta1/lib/google/cloud/redis/cluster/v1beta1/cloud_redis_cluster/operations.rb b/owl-bot-staging/google-cloud-redis-cluster-v1beta1/lib/google/cloud/redis/cluster/v1beta1/cloud_redis_cluster/operations.rb new file mode 100644 index 000000000000..cef09e76cbb7 --- /dev/null +++ b/owl-bot-staging/google-cloud-redis-cluster-v1beta1/lib/google/cloud/redis/cluster/v1beta1/cloud_redis_cluster/operations.rb @@ -0,0 +1,843 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +require "gapic/operation" +require "google/longrunning/operations_pb" + +module Google + module Cloud + module Redis + module Cluster + module V1beta1 + module CloudRedisCluster + # Service that implements Longrunning Operations API. + class Operations + # @private + API_VERSION = "" + + # @private + DEFAULT_ENDPOINT_TEMPLATE = "redis.$UNIVERSE_DOMAIN$" + + # @private + attr_reader :operations_stub + + ## + # Configuration for the CloudRedisCluster 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 CloudRedisCluster 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::Redis::Cluster::V1beta1::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::Redis::Cluster::V1beta1::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::Redis::Cluster::V1beta1::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::Redis::Cluster::V1beta1::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::Redis::Cluster::V1beta1::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 = "redis.googleapis.com" + + config_attr :endpoint, nil, ::String, nil + config_attr :credentials, nil do |value| + allowed = [::String, ::Hash, ::Proc, ::Symbol, ::Google::Auth::Credentials, ::Google::Auth::BaseClient, ::Signet::OAuth2::Client, nil] + allowed += [::GRPC::Core::Channel, ::GRPC::Core::ChannelCredentials] if defined? ::GRPC::Core::Channel + allowed.any? { |klass| klass === value } + end + config_attr :scope, nil, ::String, ::Array, nil + config_attr :lib_name, nil, ::String, nil + config_attr :lib_version, nil, ::String, nil + config_attr(:channel_args, { "grpc.service_config_disable_resolution" => 1 }, ::Hash, nil) + config_attr :interceptors, nil, ::Array, nil + config_attr :timeout, nil, ::Numeric, nil + config_attr :metadata, nil, ::Hash, nil + config_attr :retry_policy, nil, ::Hash, ::Proc, nil + config_attr :quota_project, nil, ::String, nil + config_attr :universe_domain, nil, ::String, nil + config_attr :logger, :default, ::Logger, nil, :default + + # @private + def initialize parent_config = nil + @parent_config = parent_config unless parent_config.nil? + + yield self if block_given? + end + + ## + # Configurations for individual RPCs + # @return [Rpcs] + # + def rpcs + @rpcs ||= begin + parent_rpcs = nil + parent_rpcs = @parent_config.rpcs if defined?(@parent_config) && @parent_config.respond_to?(:rpcs) + Rpcs.new parent_rpcs + end + end + + ## + # Configuration for the channel pool + # @return [::Gapic::ServiceStub::ChannelPool::Configuration] + # + def channel_pool + @channel_pool ||= ::Gapic::ServiceStub::ChannelPool::Configuration.new + end + + ## + # Configuration RPC class for the Operations API. + # + # Includes fields providing the configuration for each RPC in this service. + # Each configuration object is of type `Gapic::Config::Method` and includes + # the following configuration fields: + # + # * `timeout` (*type:* `Numeric`) - The call timeout in seconds + # * `metadata` (*type:* `Hash{Symbol=>String}`) - Additional gRPC headers + # * `retry_policy (*type:* `Hash`) - The retry policy. The policy fields + # include the following keys: + # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds. + # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds. + # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier. + # * `:retry_codes` (*type:* `Array`) - The error codes that should + # trigger a retry. + # + class Rpcs + ## + # RPC-specific configuration for `list_operations` + # @return [::Gapic::Config::Method] + # + attr_reader :list_operations + ## + # RPC-specific configuration for `get_operation` + # @return [::Gapic::Config::Method] + # + attr_reader :get_operation + ## + # RPC-specific configuration for `delete_operation` + # @return [::Gapic::Config::Method] + # + attr_reader :delete_operation + ## + # RPC-specific configuration for `cancel_operation` + # @return [::Gapic::Config::Method] + # + attr_reader :cancel_operation + ## + # RPC-specific configuration for `wait_operation` + # @return [::Gapic::Config::Method] + # + attr_reader :wait_operation + + # @private + def initialize parent_rpcs = nil + list_operations_config = parent_rpcs.list_operations if parent_rpcs.respond_to? :list_operations + @list_operations = ::Gapic::Config::Method.new list_operations_config + get_operation_config = parent_rpcs.get_operation if parent_rpcs.respond_to? :get_operation + @get_operation = ::Gapic::Config::Method.new get_operation_config + delete_operation_config = parent_rpcs.delete_operation if parent_rpcs.respond_to? :delete_operation + @delete_operation = ::Gapic::Config::Method.new delete_operation_config + cancel_operation_config = parent_rpcs.cancel_operation if parent_rpcs.respond_to? :cancel_operation + @cancel_operation = ::Gapic::Config::Method.new cancel_operation_config + wait_operation_config = parent_rpcs.wait_operation if parent_rpcs.respond_to? :wait_operation + @wait_operation = ::Gapic::Config::Method.new wait_operation_config + + yield self if block_given? + end + end + end + end + end + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-redis-cluster-v1beta1/lib/google/cloud/redis/cluster/v1beta1/cloud_redis_cluster/paths.rb b/owl-bot-staging/google-cloud-redis-cluster-v1beta1/lib/google/cloud/redis/cluster/v1beta1/cloud_redis_cluster/paths.rb new file mode 100644 index 000000000000..4e928f81d245 --- /dev/null +++ b/owl-bot-staging/google-cloud-redis-cluster-v1beta1/lib/google/cloud/redis/cluster/v1beta1/cloud_redis_cluster/paths.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 Cloud + module Redis + module Cluster + module V1beta1 + module CloudRedisCluster + # Path helper methods for the CloudRedisCluster API. + module Paths + ## + # Create a fully-qualified Backup resource string. + # + # The resource will be in the following format: + # + # `projects/{project}/locations/{location}/backupCollections/{backup_collection}/backups/{backup}` + # + # @param project [String] + # @param location [String] + # @param backup_collection [String] + # @param backup [String] + # + # @return [::String] + def backup_path project:, location:, backup_collection:, backup: + raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" + raise ::ArgumentError, "location cannot contain /" if location.to_s.include? "/" + raise ::ArgumentError, "backup_collection cannot contain /" if backup_collection.to_s.include? "/" + + "projects/#{project}/locations/#{location}/backupCollections/#{backup_collection}/backups/#{backup}" + end + + ## + # Create a fully-qualified BackupCollection resource string. + # + # The resource will be in the following format: + # + # `projects/{project}/locations/{location}/backupCollections/{backup_collection}` + # + # @param project [String] + # @param location [String] + # @param backup_collection [String] + # + # @return [::String] + def backup_collection_path project:, location:, backup_collection: + raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" + raise ::ArgumentError, "location cannot contain /" if location.to_s.include? "/" + + "projects/#{project}/locations/#{location}/backupCollections/#{backup_collection}" + end + + ## + # Create a fully-qualified CertificateAuthority resource string. + # + # The resource will be in the following format: + # + # `projects/{project}/locations/{location}/clusters/{cluster}/certificateAuthority` + # + # @param project [String] + # @param location [String] + # @param cluster [String] + # + # @return [::String] + def certificate_authority_path project:, location:, cluster: + raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" + raise ::ArgumentError, "location cannot contain /" if location.to_s.include? "/" + + "projects/#{project}/locations/#{location}/clusters/#{cluster}/certificateAuthority" + end + + ## + # Create a fully-qualified Cluster resource string. + # + # The resource will be in the following format: + # + # `projects/{project}/locations/{location}/clusters/{cluster}` + # + # @param project [String] + # @param location [String] + # @param cluster [String] + # + # @return [::String] + def cluster_path project:, location:, cluster: + raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" + raise ::ArgumentError, "location cannot contain /" if location.to_s.include? "/" + + "projects/#{project}/locations/#{location}/clusters/#{cluster}" + end + + ## + # Create a fully-qualified CryptoKey resource string. + # + # The resource will be in the following format: + # + # `projects/{project}/locations/{location}/keyRings/{key_ring}/cryptoKeys/{crypto_key}` + # + # @param project [String] + # @param location [String] + # @param key_ring [String] + # @param crypto_key [String] + # + # @return [::String] + def crypto_key_path project:, location:, key_ring:, crypto_key: + raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" + raise ::ArgumentError, "location cannot contain /" if location.to_s.include? "/" + raise ::ArgumentError, "key_ring cannot contain /" if key_ring.to_s.include? "/" + + "projects/#{project}/locations/#{location}/keyRings/#{key_ring}/cryptoKeys/#{crypto_key}" + end + + ## + # Create a fully-qualified CryptoKeyVersion resource string. + # + # The resource will be in the following format: + # + # `projects/{project}/locations/{location}/keyRings/{key_ring}/cryptoKeys/{crypto_key}/cryptoKeyVersions/{crypto_key_version}` + # + # @param project [String] + # @param location [String] + # @param key_ring [String] + # @param crypto_key [String] + # @param crypto_key_version [String] + # + # @return [::String] + def crypto_key_version_path project:, location:, key_ring:, crypto_key:, crypto_key_version: + raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" + raise ::ArgumentError, "location cannot contain /" if location.to_s.include? "/" + raise ::ArgumentError, "key_ring cannot contain /" if key_ring.to_s.include? "/" + raise ::ArgumentError, "crypto_key cannot contain /" if crypto_key.to_s.include? "/" + + "projects/#{project}/locations/#{location}/keyRings/#{key_ring}/cryptoKeys/#{crypto_key}/cryptoKeyVersions/#{crypto_key_version}" + end + + ## + # Create a fully-qualified ForwardingRule resource string. + # + # The resource will be in the following format: + # + # `projects/{project}/regions/{region}/forwardingRules/{forwarding_rule}` + # + # @param project [String] + # @param region [String] + # @param forwarding_rule [String] + # + # @return [::String] + def forwarding_rule_path project:, region:, forwarding_rule: + raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" + raise ::ArgumentError, "region cannot contain /" if region.to_s.include? "/" + + "projects/#{project}/regions/#{region}/forwardingRules/#{forwarding_rule}" + 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 Network resource string. + # + # The resource will be in the following format: + # + # `projects/{project}/global/networks/{network}` + # + # @param project [String] + # @param network [String] + # + # @return [::String] + def network_path project:, network: + raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" + + "projects/#{project}/global/networks/#{network}" + end + + ## + # Create a fully-qualified ServiceAttachment resource string. + # + # The resource will be in the following format: + # + # `projects/{project}/regions/{region}/serviceAttachments/{service_attachment}` + # + # @param project [String] + # @param region [String] + # @param service_attachment [String] + # + # @return [::String] + def service_attachment_path project:, region:, service_attachment: + raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" + raise ::ArgumentError, "region cannot contain /" if region.to_s.include? "/" + + "projects/#{project}/regions/#{region}/serviceAttachments/#{service_attachment}" + end + + extend self + end + end + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-redis-cluster-v1beta1/lib/google/cloud/redis/cluster/v1beta1/cloud_redis_cluster/rest.rb b/owl-bot-staging/google-cloud-redis-cluster-v1beta1/lib/google/cloud/redis/cluster/v1beta1/cloud_redis_cluster/rest.rb new file mode 100644 index 000000000000..9dcf91ae8976 --- /dev/null +++ b/owl-bot-staging/google-cloud-redis-cluster-v1beta1/lib/google/cloud/redis/cluster/v1beta1/cloud_redis_cluster/rest.rb @@ -0,0 +1,70 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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/redis/cluster/v1beta1/version" +require "google/cloud/redis/cluster/v1beta1/bindings_override" + +require "google/cloud/redis/cluster/v1beta1/cloud_redis_cluster/credentials" +require "google/cloud/redis/cluster/v1beta1/cloud_redis_cluster/paths" +require "google/cloud/redis/cluster/v1beta1/cloud_redis_cluster/rest/operations" +require "google/cloud/redis/cluster/v1beta1/cloud_redis_cluster/rest/client" + +module Google + module Cloud + module Redis + module Cluster + module V1beta1 + ## + # Configures and manages Cloud Memorystore for Redis clusters + # + # Google Cloud Memorystore for Redis Cluster + # + # The `redis.googleapis.com` service implements the Google Cloud Memorystore + # for Redis API and defines the following resource model for managing Redis + # clusters: + # * The service works with a collection of cloud projects, named: `/projects/*` + # * Each project has a collection of available locations, named: `/locations/*` + # * Each location has a collection of Redis clusters, named: `/clusters/*` + # * As such, Redis clusters are resources of the form: + # `/projects/{project_id}/locations/{location_id}/clusters/{instance_id}` + # + # Note that location_id must be a GCP `region`; for example: + # * `projects/redpepper-1290/locations/us-central1/clusters/my-redis` + # + # To load this service and instantiate a REST client: + # + # require "google/cloud/redis/cluster/v1beta1/cloud_redis_cluster/rest" + # client = ::Google::Cloud::Redis::Cluster::V1beta1::CloudRedisCluster::Rest::Client.new + # + module CloudRedisCluster + # Client for the REST transport + module Rest + end + end + end + end + end + end +end + +helper_path = ::File.join __dir__, "rest", "helpers.rb" +require "google/cloud/redis/cluster/v1beta1/cloud_redis_cluster/rest/helpers" if ::File.file? helper_path diff --git a/owl-bot-staging/google-cloud-redis-cluster-v1beta1/lib/google/cloud/redis/cluster/v1beta1/cloud_redis_cluster/rest/client.rb b/owl-bot-staging/google-cloud-redis-cluster-v1beta1/lib/google/cloud/redis/cluster/v1beta1/cloud_redis_cluster/rest/client.rb new file mode 100644 index 000000000000..7506c3777984 --- /dev/null +++ b/owl-bot-staging/google-cloud-redis-cluster-v1beta1/lib/google/cloud/redis/cluster/v1beta1/cloud_redis_cluster/rest/client.rb @@ -0,0 +1,1825 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +require "google/cloud/errors" +require "google/cloud/redis/cluster/v1beta1/cloud_redis_cluster_pb" +require "google/cloud/redis/cluster/v1beta1/cloud_redis_cluster/rest/service_stub" +require "google/cloud/location/rest" + +module Google + module Cloud + module Redis + module Cluster + module V1beta1 + module CloudRedisCluster + module Rest + ## + # REST client for the CloudRedisCluster service. + # + # Configures and manages Cloud Memorystore for Redis clusters + # + # Google Cloud Memorystore for Redis Cluster + # + # The `redis.googleapis.com` service implements the Google Cloud Memorystore + # for Redis API and defines the following resource model for managing Redis + # clusters: + # * The service works with a collection of cloud projects, named: `/projects/*` + # * Each project has a collection of available locations, named: `/locations/*` + # * Each location has a collection of Redis clusters, named: `/clusters/*` + # * As such, Redis clusters are resources of the form: + # `/projects/{project_id}/locations/{location_id}/clusters/{instance_id}` + # + # Note that location_id must be a GCP `region`; for example: + # * `projects/redpepper-1290/locations/us-central1/clusters/my-redis` + # + class Client + # @private + API_VERSION = "" + + # @private + DEFAULT_ENDPOINT_TEMPLATE = "redis.$UNIVERSE_DOMAIN$" + + include Paths + + # @private + attr_reader :cloud_redis_cluster_stub + + ## + # Configure the CloudRedisCluster Client class. + # + # See {::Google::Cloud::Redis::Cluster::V1beta1::CloudRedisCluster::Rest::Client::Configuration} + # for a description of the configuration fields. + # + # @example + # + # # Modify the configuration for all CloudRedisCluster clients + # ::Google::Cloud::Redis::Cluster::V1beta1::CloudRedisCluster::Rest::Client.configure do |config| + # config.timeout = 10.0 + # end + # + # @yield [config] Configure the Client client. + # @yieldparam config [Client::Configuration] + # + # @return [Client::Configuration] + # + def self.configure + @configure ||= begin + namespace = ["Google", "Cloud", "Redis", "Cluster", "V1beta1"] + parent_config = while namespace.any? + parent_name = namespace.join "::" + parent_const = const_get parent_name + break parent_const.configure if parent_const.respond_to? :configure + namespace.pop + end + default_config = Client::Configuration.new parent_config + + default_config.rpcs.list_clusters.timeout = 600.0 + + default_config.rpcs.get_cluster.timeout = 600.0 + + default_config.rpcs.update_cluster.timeout = 600.0 + + default_config.rpcs.delete_cluster.timeout = 600.0 + + default_config.rpcs.create_cluster.timeout = 600.0 + + default_config.rpcs.get_cluster_certificate_authority.timeout = 600.0 + + default_config.rpcs.reschedule_cluster_maintenance.timeout = 600.0 + + default_config.rpcs.list_backup_collections.timeout = 600.0 + + default_config.rpcs.get_backup_collection.timeout = 600.0 + + default_config.rpcs.list_backups.timeout = 600.0 + + default_config.rpcs.get_backup.timeout = 600.0 + + default_config.rpcs.delete_backup.timeout = 600.0 + + default_config.rpcs.export_backup.timeout = 600.0 + + default_config.rpcs.backup_cluster.timeout = 600.0 + + default_config + end + yield @configure if block_given? + @configure + end + + ## + # Configure the CloudRedisCluster Client instance. + # + # The configuration is set to the derived mode, meaning that values can be changed, + # but structural changes (adding new fields, etc.) are not allowed. Structural changes + # should be made on {Client.configure}. + # + # See {::Google::Cloud::Redis::Cluster::V1beta1::CloudRedisCluster::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 + @cloud_redis_cluster_stub.universe_domain + end + + ## + # Create a new CloudRedisCluster REST client object. + # + # @example + # + # # Create a client using the default configuration + # client = ::Google::Cloud::Redis::Cluster::V1beta1::CloudRedisCluster::Rest::Client.new + # + # # Create a client using a custom configuration + # client = ::Google::Cloud::Redis::Cluster::V1beta1::CloudRedisCluster::Rest::Client.new do |config| + # config.timeout = 10.0 + # end + # + # @yield [config] Configure the CloudRedisCluster client. + # @yieldparam config [Client::Configuration] + # + def initialize + # Create the configuration object + @config = Configuration.new Client.configure + + # Yield the configuration if needed + yield @config if block_given? + + # Create credentials + credentials = @config.credentials + # Use self-signed JWT if the endpoint is unchanged from default, + # but only if the default endpoint does not have a region prefix. + enable_self_signed_jwt = @config.endpoint.nil? || + (@config.endpoint == Configuration::DEFAULT_ENDPOINT && + !@config.endpoint.split(".").first.include?("-")) + credentials ||= Credentials.default scope: @config.scope, + enable_self_signed_jwt: enable_self_signed_jwt + if credentials.is_a?(::String) || credentials.is_a?(::Hash) + credentials = Credentials.new credentials, scope: @config.scope + end + + @quota_project_id = @config.quota_project + @quota_project_id ||= credentials.quota_project_id if credentials.respond_to? :quota_project_id + + @operations_client = ::Google::Cloud::Redis::Cluster::V1beta1::CloudRedisCluster::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 + + @cloud_redis_cluster_stub = ::Google::Cloud::Redis::Cluster::V1beta1::CloudRedisCluster::Rest::ServiceStub.new( + endpoint: @config.endpoint, + endpoint_template: DEFAULT_ENDPOINT_TEMPLATE, + universe_domain: @config.universe_domain, + credentials: credentials, + logger: @config.logger + ) + + @cloud_redis_cluster_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 = @cloud_redis_cluster_stub.endpoint + config.universe_domain = @cloud_redis_cluster_stub.universe_domain + config.bindings_override = @config.bindings_override + config.logger = @cloud_redis_cluster_stub.logger if config.respond_to? :logger= + end + end + + ## + # Get the associated client for long-running operations. + # + # @return [::Google::Cloud::Redis::Cluster::V1beta1::CloudRedisCluster::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 + @cloud_redis_cluster_stub.logger + end + + # Service calls + + ## + # Lists all Redis clusters owned by a project in either the specified + # location (region) or all locations. + # + # The location should have the following format: + # + # * `projects/{project_id}/locations/{location_id}` + # + # If `location_id` is specified as `-` (wildcard), then all regions + # available to the project are queried, and the results are aggregated. + # + # @overload list_clusters(request, options = nil) + # Pass arguments to `list_clusters` via a request object, either of type + # {::Google::Cloud::Redis::Cluster::V1beta1::ListClustersRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Redis::Cluster::V1beta1::ListClustersRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_clusters(parent: nil, page_size: nil, page_token: nil) + # Pass arguments to `list_clusters` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param parent [::String] + # Required. The resource name of the cluster location using the form: + # `projects/{project_id}/locations/{location_id}` + # where `location_id` refers to a GCP region. + # @param page_size [::Integer] + # The maximum number of items to return. + # + # If not specified, a default value of 1000 will be used by the service. + # Regardless of the page_size value, the response may include a partial list + # and a caller should only rely on response's + # {::Google::Cloud::Redis::Cluster::V1beta1::ListClustersResponse#next_page_token `next_page_token`} + # to determine if there are more clusters left to be queried. + # @param page_token [::String] + # The `next_page_token` value returned from a previous + # [ListClusters][CloudRedis.ListClusters] request, if any. + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Gapic::Rest::PagedEnumerable<::Google::Cloud::Redis::Cluster::V1beta1::Cluster>] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Gapic::Rest::PagedEnumerable<::Google::Cloud::Redis::Cluster::V1beta1::Cluster>] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/redis/cluster/v1beta1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Redis::Cluster::V1beta1::CloudRedisCluster::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Redis::Cluster::V1beta1::ListClustersRequest.new + # + # # Call the list_clusters method. + # result = client.list_clusters request + # + # # The returned object is of type Gapic::PagedEnumerable. You can iterate + # # over elements, and API calls will be issued to fetch pages as needed. + # result.each do |item| + # # Each element is of type ::Google::Cloud::Redis::Cluster::V1beta1::Cluster. + # p item + # end + # + def list_clusters request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Redis::Cluster::V1beta1::ListClustersRequest + + # Converts hash 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_clusters.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::Redis::Cluster::V1beta1::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_clusters.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.list_clusters.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @cloud_redis_cluster_stub.list_clusters request, options do |result, operation| + result = ::Gapic::Rest::PagedEnumerable.new @cloud_redis_cluster_stub, :list_clusters, "clusters", 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 details of a specific Redis cluster. + # + # @overload get_cluster(request, options = nil) + # Pass arguments to `get_cluster` via a request object, either of type + # {::Google::Cloud::Redis::Cluster::V1beta1::GetClusterRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Redis::Cluster::V1beta1::GetClusterRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_cluster(name: nil) + # Pass arguments to `get_cluster` via keyword arguments. Note that at + # least one keyword argument is 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. Redis cluster resource name using the form: + # `projects/{project_id}/locations/{location_id}/clusters/{cluster_id}` + # where `location_id` refers to a GCP region. + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Cloud::Redis::Cluster::V1beta1::Cluster] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::Redis::Cluster::V1beta1::Cluster] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/redis/cluster/v1beta1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Redis::Cluster::V1beta1::CloudRedisCluster::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Redis::Cluster::V1beta1::GetClusterRequest.new + # + # # Call the get_cluster method. + # result = client.get_cluster request + # + # # The returned object is of type Google::Cloud::Redis::Cluster::V1beta1::Cluster. + # p result + # + def get_cluster request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Redis::Cluster::V1beta1::GetClusterRequest + + # Converts hash 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_cluster.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::Redis::Cluster::V1beta1::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_cluster.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.get_cluster.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @cloud_redis_cluster_stub.get_cluster request, options do |result, operation| + yield result, operation if block_given? + end + rescue ::Gapic::Rest::Error => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Updates the metadata and configuration of a specific Redis cluster. + # + # Completed longrunning.Operation will contain the new cluster object + # in the response field. The returned operation is automatically deleted + # after a few hours, so there is no need to call DeleteOperation. + # + # @overload update_cluster(request, options = nil) + # Pass arguments to `update_cluster` via a request object, either of type + # {::Google::Cloud::Redis::Cluster::V1beta1::UpdateClusterRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Redis::Cluster::V1beta1::UpdateClusterRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_cluster(update_mask: nil, cluster: nil, request_id: nil) + # Pass arguments to `update_cluster` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param update_mask [::Google::Protobuf::FieldMask, ::Hash] + # Required. Mask of fields to update. At least one path must be supplied in + # this field. The elements of the repeated paths field may only include these + # fields from {::Google::Cloud::Redis::Cluster::V1beta1::Cluster Cluster}: + # + # * `size_gb` + # * `replica_count` + # @param cluster [::Google::Cloud::Redis::Cluster::V1beta1::Cluster, ::Hash] + # Required. Update description. + # Only fields specified in update_mask are updated. + # @param request_id [::String] + # Idempotent request UUID. + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Gapic::Operation] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Gapic::Operation] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/redis/cluster/v1beta1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Redis::Cluster::V1beta1::CloudRedisCluster::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Redis::Cluster::V1beta1::UpdateClusterRequest.new + # + # # Call the update_cluster method. + # result = client.update_cluster 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_cluster request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Redis::Cluster::V1beta1::UpdateClusterRequest + + # Converts hash 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_cluster.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::Redis::Cluster::V1beta1::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_cluster.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.update_cluster.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @cloud_redis_cluster_stub.update_cluster 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 specific Redis cluster. Cluster stops serving and data is + # deleted. + # + # @overload delete_cluster(request, options = nil) + # Pass arguments to `delete_cluster` via a request object, either of type + # {::Google::Cloud::Redis::Cluster::V1beta1::DeleteClusterRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Redis::Cluster::V1beta1::DeleteClusterRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_cluster(name: nil, request_id: nil) + # Pass arguments to `delete_cluster` via keyword arguments. Note that at + # least one keyword argument is 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. Redis cluster resource name using the form: + # `projects/{project_id}/locations/{location_id}/clusters/{cluster_id}` + # where `location_id` refers to a GCP region. + # @param request_id [::String] + # Idempotent request UUID. + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Gapic::Operation] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Gapic::Operation] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/redis/cluster/v1beta1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Redis::Cluster::V1beta1::CloudRedisCluster::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Redis::Cluster::V1beta1::DeleteClusterRequest.new + # + # # Call the delete_cluster method. + # result = client.delete_cluster 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_cluster request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Redis::Cluster::V1beta1::DeleteClusterRequest + + # Converts hash 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_cluster.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::Redis::Cluster::V1beta1::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_cluster.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.delete_cluster.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @cloud_redis_cluster_stub.delete_cluster 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 + + ## + # Creates a Redis cluster based on the specified properties. + # The creation is executed asynchronously and callers may check the returned + # operation to track its progress. Once the operation is completed the Redis + # cluster will be fully functional. The completed longrunning.Operation will + # contain the new cluster object in the response field. + # + # The returned operation is automatically deleted after a few hours, so there + # is no need to call DeleteOperation. + # + # @overload create_cluster(request, options = nil) + # Pass arguments to `create_cluster` via a request object, either of type + # {::Google::Cloud::Redis::Cluster::V1beta1::CreateClusterRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Redis::Cluster::V1beta1::CreateClusterRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_cluster(parent: nil, cluster_id: nil, cluster: nil, request_id: nil) + # Pass arguments to `create_cluster` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param parent [::String] + # Required. The resource name of the cluster location using the form: + # `projects/{project_id}/locations/{location_id}` + # where `location_id` refers to a GCP region. + # @param cluster_id [::String] + # Required. The logical name of the Redis cluster in the customer project + # with the following restrictions: + # + # * Must contain only lowercase letters, numbers, and hyphens. + # * Must start with a letter. + # * Must be between 1-63 characters. + # * Must end with a number or a letter. + # * Must be unique within the customer project / location + # @param cluster [::Google::Cloud::Redis::Cluster::V1beta1::Cluster, ::Hash] + # Required. The cluster that is to be created. + # @param request_id [::String] + # Idempotent request UUID. + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Gapic::Operation] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Gapic::Operation] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/redis/cluster/v1beta1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Redis::Cluster::V1beta1::CloudRedisCluster::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Redis::Cluster::V1beta1::CreateClusterRequest.new + # + # # Call the create_cluster method. + # result = client.create_cluster 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_cluster request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Redis::Cluster::V1beta1::CreateClusterRequest + + # Converts hash 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_cluster.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::Redis::Cluster::V1beta1::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_cluster.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.create_cluster.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @cloud_redis_cluster_stub.create_cluster 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 the details of certificate authority information for Redis cluster. + # + # @overload get_cluster_certificate_authority(request, options = nil) + # Pass arguments to `get_cluster_certificate_authority` via a request object, either of type + # {::Google::Cloud::Redis::Cluster::V1beta1::GetClusterCertificateAuthorityRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Redis::Cluster::V1beta1::GetClusterCertificateAuthorityRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_cluster_certificate_authority(name: nil) + # Pass arguments to `get_cluster_certificate_authority` via keyword arguments. Note that at + # least one keyword argument is 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. Redis cluster certificate authority resource name using the form: + # `projects/{project_id}/locations/{location_id}/clusters/{cluster_id}/certificateAuthority` + # where `location_id` refers to a GCP region. + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Cloud::Redis::Cluster::V1beta1::CertificateAuthority] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::Redis::Cluster::V1beta1::CertificateAuthority] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/redis/cluster/v1beta1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Redis::Cluster::V1beta1::CloudRedisCluster::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Redis::Cluster::V1beta1::GetClusterCertificateAuthorityRequest.new + # + # # Call the get_cluster_certificate_authority method. + # result = client.get_cluster_certificate_authority request + # + # # The returned object is of type Google::Cloud::Redis::Cluster::V1beta1::CertificateAuthority. + # p result + # + def get_cluster_certificate_authority request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Redis::Cluster::V1beta1::GetClusterCertificateAuthorityRequest + + # Converts hash 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_cluster_certificate_authority.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::Redis::Cluster::V1beta1::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_cluster_certificate_authority.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.get_cluster_certificate_authority.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @cloud_redis_cluster_stub.get_cluster_certificate_authority 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 + + ## + # Reschedules upcoming maintenance event. + # + # @overload reschedule_cluster_maintenance(request, options = nil) + # Pass arguments to `reschedule_cluster_maintenance` via a request object, either of type + # {::Google::Cloud::Redis::Cluster::V1beta1::RescheduleClusterMaintenanceRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Redis::Cluster::V1beta1::RescheduleClusterMaintenanceRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @overload reschedule_cluster_maintenance(name: nil, reschedule_type: nil, schedule_time: nil) + # Pass arguments to `reschedule_cluster_maintenance` via keyword arguments. Note that at + # least one keyword argument is 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. Redis Cluster instance resource name using the form: + # `projects/{project_id}/locations/{location_id}/clusters/{cluster_id}` + # where `location_id` refers to a GCP region. + # @param reschedule_type [::Google::Cloud::Redis::Cluster::V1beta1::RescheduleClusterMaintenanceRequest::RescheduleType] + # Required. If reschedule type is SPECIFIC_TIME, must set up schedule_time as + # well. + # @param schedule_time [::Google::Protobuf::Timestamp, ::Hash] + # Optional. Timestamp when the maintenance shall be rescheduled to if + # reschedule_type=SPECIFIC_TIME, in RFC 3339 format, for + # example `2012-11-15T16:19:00.094Z`. + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Gapic::Operation] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Gapic::Operation] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/redis/cluster/v1beta1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Redis::Cluster::V1beta1::CloudRedisCluster::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Redis::Cluster::V1beta1::RescheduleClusterMaintenanceRequest.new + # + # # Call the reschedule_cluster_maintenance method. + # result = client.reschedule_cluster_maintenance 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 reschedule_cluster_maintenance request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Redis::Cluster::V1beta1::RescheduleClusterMaintenanceRequest + + # Converts hash 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.reschedule_cluster_maintenance.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::Redis::Cluster::V1beta1::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.reschedule_cluster_maintenance.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.reschedule_cluster_maintenance.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @cloud_redis_cluster_stub.reschedule_cluster_maintenance 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 all backup collections owned by a consumer project in either the + # specified location (region) or all locations. + # + # If `location_id` is specified as `-` (wildcard), then all regions + # available to the project are queried, and the results are aggregated. + # + # @overload list_backup_collections(request, options = nil) + # Pass arguments to `list_backup_collections` via a request object, either of type + # {::Google::Cloud::Redis::Cluster::V1beta1::ListBackupCollectionsRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Redis::Cluster::V1beta1::ListBackupCollectionsRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_backup_collections(parent: nil, page_size: nil, page_token: nil) + # Pass arguments to `list_backup_collections` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param parent [::String] + # Required. The resource name of the backupCollection location using the + # form: + # `projects/{project_id}/locations/{location_id}` + # where `location_id` refers to a GCP region. + # @param page_size [::Integer] + # Optional. The maximum number of items to return. + # + # If not specified, a default value of 1000 will be used by the service. + # Regardless of the page_size value, the response may include a partial list + # and a caller should only rely on response's + # {::Google::Cloud::Redis::Cluster::V1beta1::ListBackupCollectionsResponse#next_page_token `next_page_token`} + # to determine if there are more clusters left to be queried. + # @param page_token [::String] + # Optional. The `next_page_token` value returned from a previous + # [ListBackupCollections] request, if any. + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Gapic::Rest::PagedEnumerable<::Google::Cloud::Redis::Cluster::V1beta1::BackupCollection>] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Gapic::Rest::PagedEnumerable<::Google::Cloud::Redis::Cluster::V1beta1::BackupCollection>] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/redis/cluster/v1beta1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Redis::Cluster::V1beta1::CloudRedisCluster::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Redis::Cluster::V1beta1::ListBackupCollectionsRequest.new + # + # # Call the list_backup_collections method. + # result = client.list_backup_collections request + # + # # The returned object is of type Gapic::PagedEnumerable. You can iterate + # # over elements, and API calls will be issued to fetch pages as needed. + # result.each do |item| + # # Each element is of type ::Google::Cloud::Redis::Cluster::V1beta1::BackupCollection. + # p item + # end + # + def list_backup_collections request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Redis::Cluster::V1beta1::ListBackupCollectionsRequest + + # Converts hash 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_backup_collections.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::Redis::Cluster::V1beta1::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_backup_collections.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.list_backup_collections.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @cloud_redis_cluster_stub.list_backup_collections request, options do |result, operation| + result = ::Gapic::Rest::PagedEnumerable.new @cloud_redis_cluster_stub, :list_backup_collections, "backup_collections", 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 + + ## + # Get a backup collection. + # + # @overload get_backup_collection(request, options = nil) + # Pass arguments to `get_backup_collection` via a request object, either of type + # {::Google::Cloud::Redis::Cluster::V1beta1::GetBackupCollectionRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Redis::Cluster::V1beta1::GetBackupCollectionRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_backup_collection(name: nil) + # Pass arguments to `get_backup_collection` via keyword arguments. Note that at + # least one keyword argument is 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. Redis backupCollection resource name using the form: + # `projects/{project_id}/locations/{location_id}/backupCollections/{backup_collection_id}` + # where `location_id` refers to a GCP region. + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Cloud::Redis::Cluster::V1beta1::BackupCollection] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::Redis::Cluster::V1beta1::BackupCollection] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/redis/cluster/v1beta1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Redis::Cluster::V1beta1::CloudRedisCluster::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Redis::Cluster::V1beta1::GetBackupCollectionRequest.new + # + # # Call the get_backup_collection method. + # result = client.get_backup_collection request + # + # # The returned object is of type Google::Cloud::Redis::Cluster::V1beta1::BackupCollection. + # p result + # + def get_backup_collection request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Redis::Cluster::V1beta1::GetBackupCollectionRequest + + # Converts hash 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_backup_collection.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::Redis::Cluster::V1beta1::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_backup_collection.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.get_backup_collection.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @cloud_redis_cluster_stub.get_backup_collection request, options do |result, operation| + yield result, operation if block_given? + end + rescue ::Gapic::Rest::Error => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Lists all backups owned by a backup collection. + # + # @overload list_backups(request, options = nil) + # Pass arguments to `list_backups` via a request object, either of type + # {::Google::Cloud::Redis::Cluster::V1beta1::ListBackupsRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Redis::Cluster::V1beta1::ListBackupsRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_backups(parent: nil, page_size: nil, page_token: nil) + # Pass arguments to `list_backups` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param parent [::String] + # Required. The resource name of the backupCollection using the form: + # `projects/{project_id}/locations/{location_id}/backupCollections/{backup_collection_id}` + # @param page_size [::Integer] + # Optional. The maximum number of items to return. + # + # If not specified, a default value of 1000 will be used by the service. + # Regardless of the page_size value, the response may include a partial list + # and a caller should only rely on response's + # {::Google::Cloud::Redis::Cluster::V1beta1::ListBackupsResponse#next_page_token `next_page_token`} + # to determine if there are more clusters left to be queried. + # @param page_token [::String] + # Optional. The `next_page_token` value returned from a previous + # [ListBackupCollections] request, if any. + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Gapic::Rest::PagedEnumerable<::Google::Cloud::Redis::Cluster::V1beta1::Backup>] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Gapic::Rest::PagedEnumerable<::Google::Cloud::Redis::Cluster::V1beta1::Backup>] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/redis/cluster/v1beta1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Redis::Cluster::V1beta1::CloudRedisCluster::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Redis::Cluster::V1beta1::ListBackupsRequest.new + # + # # Call the list_backups method. + # result = client.list_backups request + # + # # The returned object is of type Gapic::PagedEnumerable. You can iterate + # # over elements, and API calls will be issued to fetch pages as needed. + # result.each do |item| + # # Each element is of type ::Google::Cloud::Redis::Cluster::V1beta1::Backup. + # p item + # end + # + def list_backups request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Redis::Cluster::V1beta1::ListBackupsRequest + + # Converts hash 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_backups.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::Redis::Cluster::V1beta1::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_backups.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.list_backups.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @cloud_redis_cluster_stub.list_backups request, options do |result, operation| + result = ::Gapic::Rest::PagedEnumerable.new @cloud_redis_cluster_stub, :list_backups, "backups", 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 details of a specific backup. + # + # @overload get_backup(request, options = nil) + # Pass arguments to `get_backup` via a request object, either of type + # {::Google::Cloud::Redis::Cluster::V1beta1::GetBackupRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Redis::Cluster::V1beta1::GetBackupRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_backup(name: nil) + # Pass arguments to `get_backup` via keyword arguments. Note that at + # least one keyword argument is 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. Redis backup resource name using the form: + # `projects/{project_id}/locations/{location_id}/backupCollections/{backup_collection_id}/backups/{backup_id}` + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Cloud::Redis::Cluster::V1beta1::Backup] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::Redis::Cluster::V1beta1::Backup] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/redis/cluster/v1beta1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Redis::Cluster::V1beta1::CloudRedisCluster::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Redis::Cluster::V1beta1::GetBackupRequest.new + # + # # Call the get_backup method. + # result = client.get_backup request + # + # # The returned object is of type Google::Cloud::Redis::Cluster::V1beta1::Backup. + # p result + # + def get_backup request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Redis::Cluster::V1beta1::GetBackupRequest + + # Converts hash 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_backup.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::Redis::Cluster::V1beta1::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_backup.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.get_backup.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @cloud_redis_cluster_stub.get_backup request, options do |result, operation| + yield result, operation if block_given? + end + rescue ::Gapic::Rest::Error => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Deletes a specific backup. + # + # @overload delete_backup(request, options = nil) + # Pass arguments to `delete_backup` via a request object, either of type + # {::Google::Cloud::Redis::Cluster::V1beta1::DeleteBackupRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Redis::Cluster::V1beta1::DeleteBackupRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_backup(name: nil, request_id: nil) + # Pass arguments to `delete_backup` via keyword arguments. Note that at + # least one keyword argument is 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. Redis backup resource name using the form: + # `projects/{project_id}/locations/{location_id}/backupCollections/{backup_collection_id}/backups/{backup_id}` + # @param request_id [::String] + # Optional. Idempotent request UUID. + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Gapic::Operation] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Gapic::Operation] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/redis/cluster/v1beta1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Redis::Cluster::V1beta1::CloudRedisCluster::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Redis::Cluster::V1beta1::DeleteBackupRequest.new + # + # # Call the delete_backup method. + # result = client.delete_backup 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_backup request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Redis::Cluster::V1beta1::DeleteBackupRequest + + # Converts hash 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_backup.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::Redis::Cluster::V1beta1::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_backup.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.delete_backup.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @cloud_redis_cluster_stub.delete_backup 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 + + ## + # Exports a specific backup to a customer target Cloud Storage URI. + # + # @overload export_backup(request, options = nil) + # Pass arguments to `export_backup` via a request object, either of type + # {::Google::Cloud::Redis::Cluster::V1beta1::ExportBackupRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Redis::Cluster::V1beta1::ExportBackupRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @overload export_backup(gcs_bucket: nil, name: nil) + # Pass arguments to `export_backup` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param gcs_bucket [::String] + # Google Cloud Storage bucket, like "my-bucket". + # @param name [::String] + # Required. Redis backup resource name using the form: + # `projects/{project_id}/locations/{location_id}/backupCollections/{backup_collection_id}/backups/{backup_id}` + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Gapic::Operation] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Gapic::Operation] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/redis/cluster/v1beta1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Redis::Cluster::V1beta1::CloudRedisCluster::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Redis::Cluster::V1beta1::ExportBackupRequest.new + # + # # Call the export_backup method. + # result = client.export_backup 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 export_backup request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Redis::Cluster::V1beta1::ExportBackupRequest + + # Converts hash 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.export_backup.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::Redis::Cluster::V1beta1::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.export_backup.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.export_backup.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @cloud_redis_cluster_stub.export_backup 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 + + ## + # Backup Redis Cluster. + # If this is the first time a backup is being created, a backup collection + # will be created at the backend, and this backup belongs to this collection. + # Both collection and backup will have a resource name. Backup will be + # executed for each shard. A replica (primary if nonHA) will be selected to + # perform the execution. Backup call will be rejected if there is an ongoing + # backup or update operation. Be aware that during preview, if the cluster's + # internal software version is too old, critical update will be performed + # before actual backup. Once the internal software version is updated to the + # minimum version required by the backup feature, subsequent backups will not + # require critical update. After preview, there will be no critical update + # needed for backup. + # + # @overload backup_cluster(request, options = nil) + # Pass arguments to `backup_cluster` via a request object, either of type + # {::Google::Cloud::Redis::Cluster::V1beta1::BackupClusterRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Redis::Cluster::V1beta1::BackupClusterRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @overload backup_cluster(name: nil, ttl: nil, backup_id: nil) + # Pass arguments to `backup_cluster` via keyword arguments. Note that at + # least one keyword argument is 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. Redis cluster resource name using the form: + # `projects/{project_id}/locations/{location_id}/clusters/{cluster_id}` + # where `location_id` refers to a GCP region. + # @param ttl [::Google::Protobuf::Duration, ::Hash] + # Optional. TTL for the backup to expire. Value range is 1 day to 100 years. + # If not specified, the default value is 100 years. + # @param backup_id [::String] + # Optional. The id of the backup to be created. If not specified, the + # default value ([YYYYMMDDHHMMSS]_[Shortened Cluster UID] is used. + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Gapic::Operation] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Gapic::Operation] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/redis/cluster/v1beta1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Redis::Cluster::V1beta1::CloudRedisCluster::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Redis::Cluster::V1beta1::BackupClusterRequest.new + # + # # Call the backup_cluster method. + # result = client.backup_cluster 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 backup_cluster request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Redis::Cluster::V1beta1::BackupClusterRequest + + # Converts hash 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.backup_cluster.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::Redis::Cluster::V1beta1::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.backup_cluster.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.backup_cluster.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @cloud_redis_cluster_stub.backup_cluster 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 + + ## + # Configuration class for the CloudRedisCluster REST API. + # + # This class represents the configuration for CloudRedisCluster REST, + # providing control over timeouts, retry behavior, logging, transport + # parameters, and other low-level controls. Certain parameters can also be + # applied individually to specific RPCs. See + # {::Google::Cloud::Redis::Cluster::V1beta1::CloudRedisCluster::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_clusters to 20 seconds, + # # and all remaining timeouts to 10 seconds. + # ::Google::Cloud::Redis::Cluster::V1beta1::CloudRedisCluster::Rest::Client.configure do |config| + # config.timeout = 10.0 + # config.rpcs.list_clusters.timeout = 20.0 + # end + # + # # Apply the above configuration only to a new client. + # client = ::Google::Cloud::Redis::Cluster::V1beta1::CloudRedisCluster::Rest::Client.new do |config| + # config.timeout = 10.0 + # config.rpcs.list_clusters.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 = "redis.googleapis.com" + + config_attr :endpoint, nil, ::String, nil + config_attr :credentials, nil do |value| + allowed = [::String, ::Hash, ::Proc, ::Symbol, ::Google::Auth::Credentials, ::Google::Auth::BaseClient, ::Signet::OAuth2::Client, nil] + allowed.any? { |klass| klass === value } + end + config_attr :scope, nil, ::String, ::Array, nil + config_attr :lib_name, nil, ::String, nil + config_attr :lib_version, nil, ::String, nil + config_attr :timeout, nil, ::Numeric, nil + config_attr :metadata, nil, ::Hash, nil + config_attr :retry_policy, nil, ::Hash, ::Proc, nil + config_attr :quota_project, nil, ::String, nil + config_attr :universe_domain, nil, ::String, nil + + # @private + # Overrides for http bindings for the RPCs of this service + # are only used when this service is used as mixin, and only + # by the host service. + # @return [::Hash{::Symbol=>::Array<::Gapic::Rest::GrpcTranscoder::HttpBinding>}] + config_attr :bindings_override, {}, ::Hash, nil + config_attr :logger, :default, ::Logger, nil, :default + + # @private + def initialize parent_config = nil + @parent_config = parent_config unless parent_config.nil? + + yield self if block_given? + end + + ## + # Configurations for individual RPCs + # @return [Rpcs] + # + def rpcs + @rpcs ||= begin + parent_rpcs = nil + parent_rpcs = @parent_config.rpcs if defined?(@parent_config) && @parent_config.respond_to?(:rpcs) + Rpcs.new parent_rpcs + end + end + + ## + # Configuration RPC class for the CloudRedisCluster 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_clusters` + # @return [::Gapic::Config::Method] + # + attr_reader :list_clusters + ## + # RPC-specific configuration for `get_cluster` + # @return [::Gapic::Config::Method] + # + attr_reader :get_cluster + ## + # RPC-specific configuration for `update_cluster` + # @return [::Gapic::Config::Method] + # + attr_reader :update_cluster + ## + # RPC-specific configuration for `delete_cluster` + # @return [::Gapic::Config::Method] + # + attr_reader :delete_cluster + ## + # RPC-specific configuration for `create_cluster` + # @return [::Gapic::Config::Method] + # + attr_reader :create_cluster + ## + # RPC-specific configuration for `get_cluster_certificate_authority` + # @return [::Gapic::Config::Method] + # + attr_reader :get_cluster_certificate_authority + ## + # RPC-specific configuration for `reschedule_cluster_maintenance` + # @return [::Gapic::Config::Method] + # + attr_reader :reschedule_cluster_maintenance + ## + # RPC-specific configuration for `list_backup_collections` + # @return [::Gapic::Config::Method] + # + attr_reader :list_backup_collections + ## + # RPC-specific configuration for `get_backup_collection` + # @return [::Gapic::Config::Method] + # + attr_reader :get_backup_collection + ## + # RPC-specific configuration for `list_backups` + # @return [::Gapic::Config::Method] + # + attr_reader :list_backups + ## + # RPC-specific configuration for `get_backup` + # @return [::Gapic::Config::Method] + # + attr_reader :get_backup + ## + # RPC-specific configuration for `delete_backup` + # @return [::Gapic::Config::Method] + # + attr_reader :delete_backup + ## + # RPC-specific configuration for `export_backup` + # @return [::Gapic::Config::Method] + # + attr_reader :export_backup + ## + # RPC-specific configuration for `backup_cluster` + # @return [::Gapic::Config::Method] + # + attr_reader :backup_cluster + + # @private + def initialize parent_rpcs = nil + list_clusters_config = parent_rpcs.list_clusters if parent_rpcs.respond_to? :list_clusters + @list_clusters = ::Gapic::Config::Method.new list_clusters_config + get_cluster_config = parent_rpcs.get_cluster if parent_rpcs.respond_to? :get_cluster + @get_cluster = ::Gapic::Config::Method.new get_cluster_config + update_cluster_config = parent_rpcs.update_cluster if parent_rpcs.respond_to? :update_cluster + @update_cluster = ::Gapic::Config::Method.new update_cluster_config + delete_cluster_config = parent_rpcs.delete_cluster if parent_rpcs.respond_to? :delete_cluster + @delete_cluster = ::Gapic::Config::Method.new delete_cluster_config + create_cluster_config = parent_rpcs.create_cluster if parent_rpcs.respond_to? :create_cluster + @create_cluster = ::Gapic::Config::Method.new create_cluster_config + get_cluster_certificate_authority_config = parent_rpcs.get_cluster_certificate_authority if parent_rpcs.respond_to? :get_cluster_certificate_authority + @get_cluster_certificate_authority = ::Gapic::Config::Method.new get_cluster_certificate_authority_config + reschedule_cluster_maintenance_config = parent_rpcs.reschedule_cluster_maintenance if parent_rpcs.respond_to? :reschedule_cluster_maintenance + @reschedule_cluster_maintenance = ::Gapic::Config::Method.new reschedule_cluster_maintenance_config + list_backup_collections_config = parent_rpcs.list_backup_collections if parent_rpcs.respond_to? :list_backup_collections + @list_backup_collections = ::Gapic::Config::Method.new list_backup_collections_config + get_backup_collection_config = parent_rpcs.get_backup_collection if parent_rpcs.respond_to? :get_backup_collection + @get_backup_collection = ::Gapic::Config::Method.new get_backup_collection_config + list_backups_config = parent_rpcs.list_backups if parent_rpcs.respond_to? :list_backups + @list_backups = ::Gapic::Config::Method.new list_backups_config + get_backup_config = parent_rpcs.get_backup if parent_rpcs.respond_to? :get_backup + @get_backup = ::Gapic::Config::Method.new get_backup_config + delete_backup_config = parent_rpcs.delete_backup if parent_rpcs.respond_to? :delete_backup + @delete_backup = ::Gapic::Config::Method.new delete_backup_config + export_backup_config = parent_rpcs.export_backup if parent_rpcs.respond_to? :export_backup + @export_backup = ::Gapic::Config::Method.new export_backup_config + backup_cluster_config = parent_rpcs.backup_cluster if parent_rpcs.respond_to? :backup_cluster + @backup_cluster = ::Gapic::Config::Method.new backup_cluster_config + + yield self if block_given? + end + end + end + end + end + end + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-redis-cluster-v1beta1/lib/google/cloud/redis/cluster/v1beta1/cloud_redis_cluster/rest/operations.rb b/owl-bot-staging/google-cloud-redis-cluster-v1beta1/lib/google/cloud/redis/cluster/v1beta1/cloud_redis_cluster/rest/operations.rb new file mode 100644 index 000000000000..fb3b4d97dfa2 --- /dev/null +++ b/owl-bot-staging/google-cloud-redis-cluster-v1beta1/lib/google/cloud/redis/cluster/v1beta1/cloud_redis_cluster/rest/operations.rb @@ -0,0 +1,926 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +require "gapic/operation" + +module Google + module Cloud + module Redis + module Cluster + module V1beta1 + module CloudRedisCluster + module Rest + # Service that implements Longrunning Operations API. + class Operations + # @private + API_VERSION = "" + + # @private + DEFAULT_ENDPOINT_TEMPLATE = "redis.$UNIVERSE_DOMAIN$" + + # @private + attr_reader :operations_stub + + ## + # Configuration for the CloudRedisCluster 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 CloudRedisCluster 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::Redis::Cluster::V1beta1::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::Redis::Cluster::V1beta1::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::Redis::Cluster::V1beta1::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::Redis::Cluster::V1beta1::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 = "redis.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: "/v1beta1/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the get_operation REST call + # + # @param request_pb [::Google::Longrunning::GetOperationRequest] + # A request object representing the call parameters. Required. + # @return [Array(String, [String, nil], Hash{String => String})] + # Uri, Body, Query string parameters + def self.transcode_get_operation_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :get, + uri_template: "/v1beta1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/operations/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the delete_operation REST call + # + # @param request_pb [::Google::Longrunning::DeleteOperationRequest] + # A request object representing the call parameters. Required. + # @return [Array(String, [String, nil], Hash{String => String})] + # Uri, Body, Query string parameters + def self.transcode_delete_operation_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :delete, + uri_template: "/v1beta1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/operations/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the cancel_operation REST call + # + # @param request_pb [::Google::Longrunning::CancelOperationRequest] + # A request object representing the call parameters. Required. + # @return [Array(String, [String, nil], Hash{String => String})] + # Uri, Body, Query string parameters + def self.transcode_cancel_operation_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :post, + uri_template: "/v1beta1/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/operations/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + end + end + end + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-redis-cluster-v1beta1/lib/google/cloud/redis/cluster/v1beta1/cloud_redis_cluster/rest/service_stub.rb b/owl-bot-staging/google-cloud-redis-cluster-v1beta1/lib/google/cloud/redis/cluster/v1beta1/cloud_redis_cluster/rest/service_stub.rb new file mode 100644 index 000000000000..0b4291c4ede3 --- /dev/null +++ b/owl-bot-staging/google-cloud-redis-cluster-v1beta1/lib/google/cloud/redis/cluster/v1beta1/cloud_redis_cluster/rest/service_stub.rb @@ -0,0 +1,942 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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/redis/cluster/v1beta1/cloud_redis_cluster_pb" + +module Google + module Cloud + module Redis + module Cluster + module V1beta1 + module CloudRedisCluster + module Rest + ## + # REST service stub for the CloudRedisCluster service. + # Service stub contains baseline method implementations + # including transcoding, making the REST call, and deserialing the response. + # + class ServiceStub + # @private + def initialize endpoint:, endpoint_template:, universe_domain:, credentials:, logger: + # These require statements are intentionally placed here to initialize + # the REST modules only when it's required. + require "gapic/rest" + + @client_stub = ::Gapic::Rest::ClientStub.new endpoint: endpoint, + endpoint_template: endpoint_template, + universe_domain: universe_domain, + credentials: credentials, + numeric_enums: true, + service_name: self.class, + raise_faraday_errors: false, + logger: logger + end + + ## + # The effective universe domain + # + # @return [String] + # + def universe_domain + @client_stub.universe_domain + end + + ## + # The effective endpoint + # + # @return [String] + # + def endpoint + @client_stub.endpoint + end + + ## + # The logger used for request/response debug logging. + # + # @return [Logger] + # + def logger stub: false + stub ? @client_stub.stub_logger : @client_stub.logger + end + + ## + # Baseline implementation for the list_clusters REST call + # + # @param request_pb [::Google::Cloud::Redis::Cluster::V1beta1::ListClustersRequest] + # A request object representing the call parameters. Required. + # @param options [::Gapic::CallOptions] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Cloud::Redis::Cluster::V1beta1::ListClustersResponse] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::Redis::Cluster::V1beta1::ListClustersResponse] + # A result object deserialized from the server's reply + def list_clusters request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_list_clusters_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_clusters", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Cloud::Redis::Cluster::V1beta1::ListClustersResponse.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_cluster REST call + # + # @param request_pb [::Google::Cloud::Redis::Cluster::V1beta1::GetClusterRequest] + # A request object representing the call parameters. Required. + # @param options [::Gapic::CallOptions] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Cloud::Redis::Cluster::V1beta1::Cluster] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::Redis::Cluster::V1beta1::Cluster] + # A result object deserialized from the server's reply + def get_cluster request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_get_cluster_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_cluster", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Cloud::Redis::Cluster::V1beta1::Cluster.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_cluster REST call + # + # @param request_pb [::Google::Cloud::Redis::Cluster::V1beta1::UpdateClusterRequest] + # 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_cluster request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_update_cluster_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_cluster", + 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_cluster REST call + # + # @param request_pb [::Google::Cloud::Redis::Cluster::V1beta1::DeleteClusterRequest] + # 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_cluster request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_delete_cluster_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_cluster", + 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 create_cluster REST call + # + # @param request_pb [::Google::Cloud::Redis::Cluster::V1beta1::CreateClusterRequest] + # 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_cluster request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_create_cluster_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_cluster", + 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_cluster_certificate_authority REST call + # + # @param request_pb [::Google::Cloud::Redis::Cluster::V1beta1::GetClusterCertificateAuthorityRequest] + # A request object representing the call parameters. Required. + # @param options [::Gapic::CallOptions] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Cloud::Redis::Cluster::V1beta1::CertificateAuthority] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::Redis::Cluster::V1beta1::CertificateAuthority] + # A result object deserialized from the server's reply + def get_cluster_certificate_authority request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_get_cluster_certificate_authority_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_cluster_certificate_authority", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Cloud::Redis::Cluster::V1beta1::CertificateAuthority.decode_json response.body, ignore_unknown_fields: true + catch :response do + yield result, operation if block_given? + result + end + end + + ## + # Baseline implementation for the reschedule_cluster_maintenance REST call + # + # @param request_pb [::Google::Cloud::Redis::Cluster::V1beta1::RescheduleClusterMaintenanceRequest] + # 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 reschedule_cluster_maintenance request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_reschedule_cluster_maintenance_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: "reschedule_cluster_maintenance", + 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_backup_collections REST call + # + # @param request_pb [::Google::Cloud::Redis::Cluster::V1beta1::ListBackupCollectionsRequest] + # A request object representing the call parameters. Required. + # @param options [::Gapic::CallOptions] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Cloud::Redis::Cluster::V1beta1::ListBackupCollectionsResponse] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::Redis::Cluster::V1beta1::ListBackupCollectionsResponse] + # A result object deserialized from the server's reply + def list_backup_collections request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_list_backup_collections_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_backup_collections", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Cloud::Redis::Cluster::V1beta1::ListBackupCollectionsResponse.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_backup_collection REST call + # + # @param request_pb [::Google::Cloud::Redis::Cluster::V1beta1::GetBackupCollectionRequest] + # A request object representing the call parameters. Required. + # @param options [::Gapic::CallOptions] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Cloud::Redis::Cluster::V1beta1::BackupCollection] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::Redis::Cluster::V1beta1::BackupCollection] + # A result object deserialized from the server's reply + def get_backup_collection request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_get_backup_collection_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_backup_collection", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Cloud::Redis::Cluster::V1beta1::BackupCollection.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_backups REST call + # + # @param request_pb [::Google::Cloud::Redis::Cluster::V1beta1::ListBackupsRequest] + # A request object representing the call parameters. Required. + # @param options [::Gapic::CallOptions] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Cloud::Redis::Cluster::V1beta1::ListBackupsResponse] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::Redis::Cluster::V1beta1::ListBackupsResponse] + # A result object deserialized from the server's reply + def list_backups request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_list_backups_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_backups", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Cloud::Redis::Cluster::V1beta1::ListBackupsResponse.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_backup REST call + # + # @param request_pb [::Google::Cloud::Redis::Cluster::V1beta1::GetBackupRequest] + # A request object representing the call parameters. Required. + # @param options [::Gapic::CallOptions] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Cloud::Redis::Cluster::V1beta1::Backup] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::Redis::Cluster::V1beta1::Backup] + # A result object deserialized from the server's reply + def get_backup request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_get_backup_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_backup", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Cloud::Redis::Cluster::V1beta1::Backup.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_backup REST call + # + # @param request_pb [::Google::Cloud::Redis::Cluster::V1beta1::DeleteBackupRequest] + # 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_backup request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_delete_backup_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_backup", + 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 export_backup REST call + # + # @param request_pb [::Google::Cloud::Redis::Cluster::V1beta1::ExportBackupRequest] + # 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 export_backup request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_export_backup_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: "export_backup", + 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 backup_cluster REST call + # + # @param request_pb [::Google::Cloud::Redis::Cluster::V1beta1::BackupClusterRequest] + # 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 backup_cluster request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_backup_cluster_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: "backup_cluster", + 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 + + ## + # @private + # + # GRPC transcoding helper method for the list_clusters REST call + # + # @param request_pb [::Google::Cloud::Redis::Cluster::V1beta1::ListClustersRequest] + # 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_clusters_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :get, + uri_template: "/v1beta1/{parent}/clusters", + matches: [ + ["parent", %r{^projects/[^/]+/locations/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the get_cluster REST call + # + # @param request_pb [::Google::Cloud::Redis::Cluster::V1beta1::GetClusterRequest] + # 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_cluster_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :get, + uri_template: "/v1beta1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/clusters/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the update_cluster REST call + # + # @param request_pb [::Google::Cloud::Redis::Cluster::V1beta1::UpdateClusterRequest] + # 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_cluster_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :patch, + uri_template: "/v1beta1/{cluster.name}", + body: "cluster", + matches: [ + ["cluster.name", %r{^projects/[^/]+/locations/[^/]+/clusters/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the delete_cluster REST call + # + # @param request_pb [::Google::Cloud::Redis::Cluster::V1beta1::DeleteClusterRequest] + # 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_cluster_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :delete, + uri_template: "/v1beta1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/clusters/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the create_cluster REST call + # + # @param request_pb [::Google::Cloud::Redis::Cluster::V1beta1::CreateClusterRequest] + # 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_cluster_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :post, + uri_template: "/v1beta1/{parent}/clusters", + body: "cluster", + matches: [ + ["parent", %r{^projects/[^/]+/locations/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the get_cluster_certificate_authority REST call + # + # @param request_pb [::Google::Cloud::Redis::Cluster::V1beta1::GetClusterCertificateAuthorityRequest] + # 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_cluster_certificate_authority_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :get, + uri_template: "/v1beta1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/clusters/[^/]+/certificateAuthority/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the reschedule_cluster_maintenance REST call + # + # @param request_pb [::Google::Cloud::Redis::Cluster::V1beta1::RescheduleClusterMaintenanceRequest] + # A request object representing the call parameters. Required. + # @return [Array(String, [String, nil], Hash{String => String})] + # Uri, Body, Query string parameters + def self.transcode_reschedule_cluster_maintenance_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :post, + uri_template: "/v1beta1/{name}:rescheduleClusterMaintenance", + body: "*", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/clusters/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the list_backup_collections REST call + # + # @param request_pb [::Google::Cloud::Redis::Cluster::V1beta1::ListBackupCollectionsRequest] + # 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_backup_collections_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :get, + uri_template: "/v1beta1/{parent}/backupCollections", + matches: [ + ["parent", %r{^projects/[^/]+/locations/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the get_backup_collection REST call + # + # @param request_pb [::Google::Cloud::Redis::Cluster::V1beta1::GetBackupCollectionRequest] + # 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_backup_collection_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :get, + uri_template: "/v1beta1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/backupCollections/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the list_backups REST call + # + # @param request_pb [::Google::Cloud::Redis::Cluster::V1beta1::ListBackupsRequest] + # 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_backups_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :get, + uri_template: "/v1beta1/{parent}/backups", + matches: [ + ["parent", %r{^projects/[^/]+/locations/[^/]+/backupCollections/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the get_backup REST call + # + # @param request_pb [::Google::Cloud::Redis::Cluster::V1beta1::GetBackupRequest] + # 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_backup_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :get, + uri_template: "/v1beta1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/backupCollections/[^/]+/backups/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the delete_backup REST call + # + # @param request_pb [::Google::Cloud::Redis::Cluster::V1beta1::DeleteBackupRequest] + # 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_backup_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :delete, + uri_template: "/v1beta1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/backupCollections/[^/]+/backups/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the export_backup REST call + # + # @param request_pb [::Google::Cloud::Redis::Cluster::V1beta1::ExportBackupRequest] + # A request object representing the call parameters. Required. + # @return [Array(String, [String, nil], Hash{String => String})] + # Uri, Body, Query string parameters + def self.transcode_export_backup_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :post, + uri_template: "/v1beta1/{name}:export", + body: "*", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/backupCollections/[^/]+/backups/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the backup_cluster REST call + # + # @param request_pb [::Google::Cloud::Redis::Cluster::V1beta1::BackupClusterRequest] + # A request object representing the call parameters. Required. + # @return [Array(String, [String, nil], Hash{String => String})] + # Uri, Body, Query string parameters + def self.transcode_backup_cluster_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :post, + uri_template: "/v1beta1/{name}:backup", + body: "*", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/clusters/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + end + end + end + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-redis-cluster-v1beta1/lib/google/cloud/redis/cluster/v1beta1/cloud_redis_cluster_pb.rb b/owl-bot-staging/google-cloud-redis-cluster-v1beta1/lib/google/cloud/redis/cluster/v1beta1/cloud_redis_cluster_pb.rb new file mode 100644 index 000000000000..9074ebc40e65 --- /dev/null +++ b/owl-bot-staging/google-cloud-redis-cluster-v1beta1/lib/google/cloud/redis/cluster/v1beta1/cloud_redis_cluster_pb.rb @@ -0,0 +1,102 @@ +# frozen_string_literal: true +# Generated by the protocol buffer compiler. DO NOT EDIT! +# source: google/cloud/redis/cluster/v1beta1/cloud_redis_cluster.proto + +require 'google/protobuf' + +require 'google/api/annotations_pb' +require 'google/api/client_pb' +require 'google/api/field_behavior_pb' +require 'google/api/field_info_pb' +require 'google/api/resource_pb' +require 'google/longrunning/operations_pb' +require 'google/protobuf/any_pb' +require 'google/protobuf/duration_pb' +require 'google/protobuf/empty_pb' +require 'google/protobuf/field_mask_pb' +require 'google/protobuf/timestamp_pb' +require 'google/type/dayofweek_pb' +require 'google/type/timeofday_pb' + + +descriptor_data = "\n.google.cloud.redis.cluster.v1beta1.ClusterMaintenanceScheduleB\x03\xe0\x41\x03H\x07\x88\x01\x01\x12^\n\x17psc_service_attachments\x18\x1e \x03(\x0b\x32\x38.google.cloud.redis.cluster.v1beta1.PscServiceAttachmentB\x03\xe0\x41\x03\x12S\n\x11\x63luster_endpoints\x18$ \x03(\x0b\x32\x33.google.cloud.redis.cluster.v1beta1.ClusterEndpointB\x03\xe0\x41\x01\x12P\n\x11\x62\x61\x63kup_collection\x18\' \x01(\tB0\xe0\x41\x01\xe0\x41\x03\xfa\x41\'\n%redis.googleapis.com/BackupCollectionH\x08\x88\x01\x01\x12?\n\x07kms_key\x18( \x01(\tB)\xe0\x41\x01\xfa\x41#\n!cloudkms.googleapis.com/CryptoKeyH\t\x88\x01\x01\x12_\n\x17\x61utomated_backup_config\x18* \x01(\x0b\x32\x39.google.cloud.redis.cluster.v1beta1.AutomatedBackupConfigB\x03\xe0\x41\x01\x12P\n\x0f\x65ncryption_info\x18+ \x01(\x0b\x32\x32.google.cloud.redis.cluster.v1beta1.EncryptionInfoB\x03\xe0\x41\x03\x1a\xef\x01\n\tStateInfo\x12W\n\x0bupdate_info\x18\x01 \x01(\x0b\x32@.google.cloud.redis.cluster.v1beta1.Cluster.StateInfo.UpdateInfoH\x00\x1a\x80\x01\n\nUpdateInfo\x12\x1f\n\x12target_shard_count\x18\x01 \x01(\x05H\x00\x88\x01\x01\x12!\n\x14target_replica_count\x18\x02 \x01(\x05H\x01\x88\x01\x01\x42\x15\n\x13_target_shard_countB\x17\n\x15_target_replica_countB\x06\n\x04info\x1a$\n\x0fGcsBackupSource\x12\x11\n\x04uris\x18\x01 \x03(\tB\x03\xe0\x41\x01\x1a*\n\x13ManagedBackupSource\x12\x13\n\x06\x62\x61\x63kup\x18\x01 \x01(\tB\x03\xe0\x41\x01\x1a\x33\n\x11RedisConfigsEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12\r\n\x05value\x18\x02 \x01(\t:\x02\x38\x01\"T\n\x05State\x12\x15\n\x11STATE_UNSPECIFIED\x10\x00\x12\x0c\n\x08\x43REATING\x10\x01\x12\n\n\x06\x41\x43TIVE\x10\x02\x12\x0c\n\x08UPDATING\x10\x03\x12\x0c\n\x08\x44\x45LETING\x10\x04:p\xea\x41m\n\x1credis.googleapis.com/Cluster\x12:projects/{project}/locations/{location}/clusters/{cluster}*\x08\x63lusters2\x07\x63lusterB\x10\n\x0eimport_sourcesB\x10\n\x0e_replica_countB\n\n\x08_size_gbB\x0e\n\x0c_shard_countB\x12\n\x10_precise_size_gbB\x1e\n\x1c_deletion_protection_enabledB\x15\n\x13_maintenance_policyB\x17\n\x15_maintenance_scheduleB\x14\n\x12_backup_collectionB\n\n\x08_kms_key\"\x8f\x04\n\x15\x41utomatedBackupConfig\x12y\n\x18\x66ixed_frequency_schedule\x18\x02 \x01(\x0b\x32P.google.cloud.redis.cluster.v1beta1.AutomatedBackupConfig.FixedFrequencyScheduleB\x03\xe0\x41\x01H\x00\x12q\n\x15\x61utomated_backup_mode\x18\x01 \x01(\x0e\x32M.google.cloud.redis.cluster.v1beta1.AutomatedBackupConfig.AutomatedBackupModeB\x03\xe0\x41\x01\x12\x36\n\tretention\x18\x03 \x01(\x0b\x32\x19.google.protobuf.DurationB\x03\xe0\x41\x01H\x01\x88\x01\x01\x1a]\n\x16\x46ixedFrequencySchedule\x12\x34\n\nstart_time\x18\x02 \x01(\x0b\x32\x16.google.type.TimeOfDayB\x03\xe0\x41\x02H\x00\x88\x01\x01\x42\r\n\x0b_start_time\"W\n\x13\x41utomatedBackupMode\x12%\n!AUTOMATED_BACKUP_MODE_UNSPECIFIED\x10\x00\x12\x0c\n\x08\x44ISABLED\x10\x01\x12\x0b\n\x07\x45NABLED\x10\x02\x42\n\n\x08scheduleB\x0c\n\n_retention\"\xf6\x02\n\x10\x42\x61\x63kupCollection\x12\x11\n\x04name\x18\x01 \x01(\tB\x03\xe0\x41\x08\x12 \n\x0b\x63luster_uid\x18\x03 \x01(\tB\x0b\xe0\x41\x03\xe2\x8c\xcf\xd7\x08\x02\x08\x01\x12\x35\n\x07\x63luster\x18\x04 \x01(\tB$\xe0\x41\x03\xfa\x41\x1e\n\x1credis.googleapis.com/Cluster\x12:\n\x07kms_key\x18\x05 \x01(\tB)\xe0\x41\x03\xfa\x41#\n!cloudkms.googleapis.com/CryptoKey\x12\x18\n\x03uid\x18\x06 \x01(\tB\x0b\xe0\x41\x03\xe2\x8c\xcf\xd7\x08\x02\x08\x01:\x9f\x01\xea\x41\x9b\x01\n%redis.googleapis.com/BackupCollection\x12Mprojects/{project}/locations/{location}/backupCollections/{backup_collection}*\x11\x62\x61\x63kupCollections2\x10\x62\x61\x63kupCollection\"\x9b\x08\n\x06\x42\x61\x63kup\x12\x11\n\x04name\x18\x01 \x01(\tB\x03\xe0\x41\x08\x12\x34\n\x0b\x63reate_time\x18\x02 \x01(\x0b\x32\x1a.google.protobuf.TimestampB\x03\xe0\x41\x03\x12\x35\n\x07\x63luster\x18\x03 \x01(\tB$\xe0\x41\x03\xfa\x41\x1e\n\x1credis.googleapis.com/Cluster\x12 \n\x0b\x63luster_uid\x18\x04 \x01(\tB\x0b\xe0\x41\x03\xe2\x8c\xcf\xd7\x08\x02\x08\x01\x12\x1d\n\x10total_size_bytes\x18\x05 \x01(\x03\x42\x03\xe0\x41\x03\x12\x34\n\x0b\x65xpire_time\x18\x06 \x01(\x0b\x32\x1a.google.protobuf.TimestampB\x03\xe0\x41\x03\x12\x1b\n\x0e\x65ngine_version\x18\x07 \x01(\tB\x03\xe0\x41\x03\x12I\n\x0c\x62\x61\x63kup_files\x18\x08 \x03(\x0b\x32..google.cloud.redis.cluster.v1beta1.BackupFileB\x03\xe0\x41\x03\x12\x44\n\tnode_type\x18\t \x01(\x0e\x32,.google.cloud.redis.cluster.v1beta1.NodeTypeB\x03\xe0\x41\x03\x12\x1a\n\rreplica_count\x18\n \x01(\x05\x42\x03\xe0\x41\x03\x12\x18\n\x0bshard_count\x18\x0b \x01(\x05\x42\x03\xe0\x41\x03\x12O\n\x0b\x62\x61\x63kup_type\x18\x0c \x01(\x0e\x32\x35.google.cloud.redis.cluster.v1beta1.Backup.BackupTypeB\x03\xe0\x41\x03\x12\x44\n\x05state\x18\r \x01(\x0e\x32\x30.google.cloud.redis.cluster.v1beta1.Backup.StateB\x03\xe0\x41\x03\x12P\n\x0f\x65ncryption_info\x18\x0e \x01(\x0b\x32\x32.google.cloud.redis.cluster.v1beta1.EncryptionInfoB\x03\xe0\x41\x03\x12\x18\n\x03uid\x18\x0f \x01(\tB\x0b\xe0\x41\x03\xe2\x8c\xcf\xd7\x08\x02\x08\x01\"G\n\nBackupType\x12\x1b\n\x17\x42\x41\x43KUP_TYPE_UNSPECIFIED\x10\x00\x12\r\n\tON_DEMAND\x10\x01\x12\r\n\tAUTOMATED\x10\x02\"U\n\x05State\x12\x15\n\x11STATE_UNSPECIFIED\x10\x00\x12\x0c\n\x08\x43REATING\x10\x01\x12\n\n\x06\x41\x43TIVE\x10\x02\x12\x0c\n\x08\x44\x45LETING\x10\x03\x12\r\n\tSUSPENDED\x10\x04:\x92\x01\xea\x41\x8e\x01\n\x1bredis.googleapis.com/Backup\x12^projects/{project}/locations/{location}/backupCollections/{backup_collection}/backups/{backup}*\x07\x62\x61\x63kups2\x06\x62\x61\x63kup\"s\n\nBackupFile\x12\x16\n\tfile_name\x18\x01 \x01(\tB\x03\xe0\x41\x03\x12\x17\n\nsize_bytes\x18\x02 \x01(\x03\x42\x03\xe0\x41\x03\x12\x34\n\x0b\x63reate_time\x18\x03 \x01(\x0b\x32\x1a.google.protobuf.TimestampB\x03\xe0\x41\x03\"\x89\x01\n\x14PscServiceAttachment\x12\x1f\n\x12service_attachment\x18\x01 \x01(\tB\x03\xe0\x41\x03\x12P\n\x0f\x63onnection_type\x18\x03 \x01(\x0e\x32\x32.google.cloud.redis.cluster.v1beta1.ConnectionTypeB\x03\xe0\x41\x03\"\x92\x07\n\x1d\x43rossClusterReplicationConfig\x12\x63\n\x0c\x63luster_role\x18\x01 \x01(\x0e\x32M.google.cloud.redis.cluster.v1beta1.CrossClusterReplicationConfig.ClusterRole\x12h\n\x0fprimary_cluster\x18\x02 \x01(\x0b\x32O.google.cloud.redis.cluster.v1beta1.CrossClusterReplicationConfig.RemoteCluster\x12k\n\x12secondary_clusters\x18\x03 \x03(\x0b\x32O.google.cloud.redis.cluster.v1beta1.CrossClusterReplicationConfig.RemoteCluster\x12\x34\n\x0bupdate_time\x18\x04 \x01(\x0b\x32\x1a.google.protobuf.TimestampB\x03\xe0\x41\x03\x12\x65\n\nmembership\x18\x05 \x01(\x0b\x32L.google.cloud.redis.cluster.v1beta1.CrossClusterReplicationConfig.MembershipB\x03\xe0\x41\x03\x1aU\n\rRemoteCluster\x12\x32\n\x07\x63luster\x18\x01 \x01(\tB!\xfa\x41\x1e\n\x1credis.googleapis.com/Cluster\x12\x10\n\x03uid\x18\x02 \x01(\tB\x03\xe0\x41\x03\x1a\xed\x01\n\nMembership\x12m\n\x0fprimary_cluster\x18\x01 \x01(\x0b\x32O.google.cloud.redis.cluster.v1beta1.CrossClusterReplicationConfig.RemoteClusterB\x03\xe0\x41\x03\x12p\n\x12secondary_clusters\x18\x02 \x03(\x0b\x32O.google.cloud.redis.cluster.v1beta1.CrossClusterReplicationConfig.RemoteClusterB\x03\xe0\x41\x03\"Q\n\x0b\x43lusterRole\x12\x1c\n\x18\x43LUSTER_ROLE_UNSPECIFIED\x10\x00\x12\x08\n\x04NONE\x10\x01\x12\x0b\n\x07PRIMARY\x10\x02\x12\r\n\tSECONDARY\x10\x03\"\xed\x01\n\x18\x43lusterMaintenancePolicy\x12\x34\n\x0b\x63reate_time\x18\x01 \x01(\x0b\x32\x1a.google.protobuf.TimestampB\x03\xe0\x41\x03\x12\x34\n\x0bupdate_time\x18\x02 \x01(\x0b\x32\x1a.google.protobuf.TimestampB\x03\xe0\x41\x03\x12\x65\n\x19weekly_maintenance_window\x18\x03 \x03(\x0b\x32\x42.google.cloud.redis.cluster.v1beta1.ClusterWeeklyMaintenanceWindow\"q\n\x1e\x43lusterWeeklyMaintenanceWindow\x12#\n\x03\x64\x61y\x18\x01 \x01(\x0e\x32\x16.google.type.DayOfWeek\x12*\n\nstart_time\x18\x02 \x01(\x0b\x32\x16.google.type.TimeOfDay\"\x84\x01\n\x1a\x43lusterMaintenanceSchedule\x12\x33\n\nstart_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\"!\n\tPscConfig\x12\x14\n\x07network\x18\x02 \x01(\tB\x03\xe0\x41\x02\"\x84\x01\n\x11\x44iscoveryEndpoint\x12\x14\n\x07\x61\x64\x64ress\x18\x01 \x01(\tB\x03\xe0\x41\x03\x12\x11\n\x04port\x18\x02 \x01(\x05\x42\x03\xe0\x41\x03\x12\x46\n\npsc_config\x18\x03 \x01(\x0b\x32-.google.cloud.redis.cluster.v1beta1.PscConfigB\x03\xe0\x41\x03\"\xe4\x03\n\rPscConnection\x12\x1e\n\x11psc_connection_id\x18\x01 \x01(\tB\x03\xe0\x41\x02\x12\x1c\n\x07\x61\x64\x64ress\x18\x02 \x01(\tB\x0b\xe0\x41\x02\xe2\x8c\xcf\xd7\x08\x02\x08\x02\x12\x46\n\x0f\x66orwarding_rule\x18\x03 \x01(\tB-\xe0\x41\x02\xfa\x41\'\n%compute.googleapis.com/ForwardingRule\x12\x17\n\nproject_id\x18\x04 \x01(\tB\x03\xe0\x41\x01\x12\x37\n\x07network\x18\x05 \x01(\tB&\xe0\x41\x02\xfa\x41 \n\x1e\x63ompute.googleapis.com/Network\x12L\n\x12service_attachment\x18\x06 \x01(\tB0\xe0\x41\x02\xfa\x41*\n(compute.googleapis.com/ServiceAttachment\x12[\n\x15psc_connection_status\x18\x08 \x01(\x0e\x32\x37.google.cloud.redis.cluster.v1beta1.PscConnectionStatusB\x03\xe0\x41\x03\x12P\n\x0f\x63onnection_type\x18\n \x01(\x0e\x32\x32.google.cloud.redis.cluster.v1beta1.ConnectionTypeB\x03\xe0\x41\x03\"\\\n\x0f\x43lusterEndpoint\x12I\n\x0b\x63onnections\x18\x01 \x03(\x0b\x32\x34.google.cloud.redis.cluster.v1beta1.ConnectionDetail\"\xc3\x01\n\x10\x43onnectionDetail\x12T\n\x13psc_auto_connection\x18\x01 \x01(\x0b\x32\x35.google.cloud.redis.cluster.v1beta1.PscAutoConnectionH\x00\x12K\n\x0epsc_connection\x18\x02 \x01(\x0b\x32\x31.google.cloud.redis.cluster.v1beta1.PscConnectionH\x00\x42\x0c\n\nconnection\"\xe8\x03\n\x11PscAutoConnection\x12\x1e\n\x11psc_connection_id\x18\x01 \x01(\tB\x03\xe0\x41\x03\x12\x1c\n\x07\x61\x64\x64ress\x18\x02 \x01(\tB\x0b\xe0\x41\x03\xe2\x8c\xcf\xd7\x08\x02\x08\x02\x12\x46\n\x0f\x66orwarding_rule\x18\x03 \x01(\tB-\xe0\x41\x03\xfa\x41\'\n%compute.googleapis.com/ForwardingRule\x12\x17\n\nproject_id\x18\x04 \x01(\tB\x03\xe0\x41\x02\x12\x37\n\x07network\x18\x05 \x01(\tB&\xe0\x41\x02\xfa\x41 \n\x1e\x63ompute.googleapis.com/Network\x12L\n\x12service_attachment\x18\x06 \x01(\tB0\xe0\x41\x03\xfa\x41*\n(compute.googleapis.com/ServiceAttachment\x12[\n\x15psc_connection_status\x18\x08 \x01(\x0e\x32\x37.google.cloud.redis.cluster.v1beta1.PscConnectionStatusB\x03\xe0\x41\x03\x12P\n\x0f\x63onnection_type\x18\t \x01(\x0e\x32\x32.google.cloud.redis.cluster.v1beta1.ConnectionTypeB\x03\xe0\x41\x03\"\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\"\x8f\x04\n\x14\x43\x65rtificateAuthority\x12q\n\x11managed_server_ca\x18\x01 \x01(\x0b\x32T.google.cloud.redis.cluster.v1beta1.CertificateAuthority.ManagedCertificateAuthorityH\x00\x12\x11\n\x04name\x18\x02 \x01(\tB\x03\xe0\x41\x08\x1a\xb2\x01\n\x1bManagedCertificateAuthority\x12p\n\x08\x63\x61_certs\x18\x01 \x03(\x0b\x32^.google.cloud.redis.cluster.v1beta1.CertificateAuthority.ManagedCertificateAuthority.CertChain\x1a!\n\tCertChain\x12\x14\n\x0c\x63\x65rtificates\x18\x01 \x03(\t:\xae\x01\xea\x41\xaa\x01\n)redis.googleapis.com/CertificateAuthority\x12Oprojects/{project}/locations/{location}/clusters/{cluster}/certificateAuthority*\x16\x63\x65rtificateAuthorities2\x14\x63\x65rtificateAuthorityB\x0b\n\tserver_ca\"\xa0\x07\n\x18\x43lusterPersistenceConfig\x12_\n\x04mode\x18\x01 \x01(\x0e\x32L.google.cloud.redis.cluster.v1beta1.ClusterPersistenceConfig.PersistenceModeB\x03\xe0\x41\x01\x12_\n\nrdb_config\x18\x02 \x01(\x0b\x32\x46.google.cloud.redis.cluster.v1beta1.ClusterPersistenceConfig.RDBConfigB\x03\xe0\x41\x01\x12_\n\naof_config\x18\x03 \x01(\x0b\x32\x46.google.cloud.redis.cluster.v1beta1.ClusterPersistenceConfig.AOFConfigB\x03\xe0\x41\x01\x1a\xbf\x02\n\tRDBConfig\x12w\n\x13rdb_snapshot_period\x18\x01 \x01(\x0e\x32U.google.cloud.redis.cluster.v1beta1.ClusterPersistenceConfig.RDBConfig.SnapshotPeriodB\x03\xe0\x41\x01\x12@\n\x17rdb_snapshot_start_time\x18\x02 \x01(\x0b\x32\x1a.google.protobuf.TimestampB\x03\xe0\x41\x01\"w\n\x0eSnapshotPeriod\x12\x1f\n\x1bSNAPSHOT_PERIOD_UNSPECIFIED\x10\x00\x12\x0c\n\x08ONE_HOUR\x10\x01\x12\r\n\tSIX_HOURS\x10\x02\x12\x10\n\x0cTWELVE_HOURS\x10\x03\x12\x15\n\x11TWENTY_FOUR_HOURS\x10\x04\x1a\xc9\x01\n\tAOFConfig\x12m\n\x0c\x61ppend_fsync\x18\x01 \x01(\x0e\x32R.google.cloud.redis.cluster.v1beta1.ClusterPersistenceConfig.AOFConfig.AppendFsyncB\x03\xe0\x41\x01\"M\n\x0b\x41ppendFsync\x12\x1c\n\x18\x41PPEND_FSYNC_UNSPECIFIED\x10\x00\x12\x06\n\x02NO\x10\x01\x12\x0c\n\x08\x45VERYSEC\x10\x02\x12\n\n\x06\x41LWAYS\x10\x03\"S\n\x0fPersistenceMode\x12 \n\x1cPERSISTENCE_MODE_UNSPECIFIED\x10\x00\x12\x0c\n\x08\x44ISABLED\x10\x01\x12\x07\n\x03RDB\x10\x02\x12\x07\n\x03\x41OF\x10\x03\"\xf0\x01\n\x16ZoneDistributionConfig\x12\x62\n\x04mode\x18\x01 \x01(\x0e\x32O.google.cloud.redis.cluster.v1beta1.ZoneDistributionConfig.ZoneDistributionModeB\x03\xe0\x41\x01\x12\x11\n\x04zone\x18\x02 \x01(\tB\x03\xe0\x41\x01\"_\n\x14ZoneDistributionMode\x12&\n\"ZONE_DISTRIBUTION_MODE_UNSPECIFIED\x10\x00\x12\x0e\n\nMULTI_ZONE\x10\x01\x12\x0f\n\x0bSINGLE_ZONE\x10\x02\"\xdc\x02\n#RescheduleClusterMaintenanceRequest\x12\x32\n\x04name\x18\x01 \x01(\tB$\xe0\x41\x02\xfa\x41\x1e\n\x1credis.googleapis.com/Cluster\x12t\n\x0freschedule_type\x18\x02 \x01(\x0e\x32V.google.cloud.redis.cluster.v1beta1.RescheduleClusterMaintenanceRequest.RescheduleTypeB\x03\xe0\x41\x02\x12\x36\n\rschedule_time\x18\x03 \x01(\x0b\x32\x1a.google.protobuf.TimestampB\x03\xe0\x41\x01\"S\n\x0eRescheduleType\x12\x1f\n\x1bRESCHEDULE_TYPE_UNSPECIFIED\x10\x00\x12\r\n\tIMMEDIATE\x10\x01\x12\x11\n\rSPECIFIC_TIME\x10\x03\"\x84\x05\n\x0e\x45ncryptionInfo\x12U\n\x0f\x65ncryption_type\x18\x01 \x01(\x0e\x32\x37.google.cloud.redis.cluster.v1beta1.EncryptionInfo.TypeB\x03\xe0\x41\x03\x12J\n\x10kms_key_versions\x18\x02 \x03(\tB0\xe0\x41\x03\xfa\x41*\n(cloudkms.googleapis.com/CryptoKeyVersion\x12\x62\n\x15kms_key_primary_state\x18\x03 \x01(\x0e\x32>.google.cloud.redis.cluster.v1beta1.EncryptionInfo.KmsKeyStateB\x03\xe0\x41\x03\x12\x39\n\x10last_update_time\x18\x04 \x01(\x0b\x32\x1a.google.protobuf.TimestampB\x03\xe0\x41\x03\"\\\n\x04Type\x12\x14\n\x10TYPE_UNSPECIFIED\x10\x00\x12\x1d\n\x19GOOGLE_DEFAULT_ENCRYPTION\x10\x01\x12\x1f\n\x1b\x43USTOMER_MANAGED_ENCRYPTION\x10\x02\"\xd1\x01\n\x0bKmsKeyState\x12\x1d\n\x19KMS_KEY_STATE_UNSPECIFIED\x10\x00\x12\x0b\n\x07\x45NABLED\x10\x01\x12\x15\n\x11PERMISSION_DENIED\x10\x02\x12\x0c\n\x08\x44ISABLED\x10\x03\x12\r\n\tDESTROYED\x10\x04\x12\x15\n\x11\x44\x45STROY_SCHEDULED\x10\x05\x12 \n\x1c\x45KM_KEY_UNREACHABLE_DETECTED\x10\x06\x12\x14\n\x10\x42ILLING_DISABLED\x10\x07\x12\x13\n\x0fUNKNOWN_FAILURE\x10\x08*\x83\x01\n\x13PscConnectionStatus\x12%\n!PSC_CONNECTION_STATUS_UNSPECIFIED\x10\x00\x12 \n\x1cPSC_CONNECTION_STATUS_ACTIVE\x10\x01\x12#\n\x1fPSC_CONNECTION_STATUS_NOT_FOUND\x10\x02*^\n\x11\x41uthorizationMode\x12\x19\n\x15\x41UTH_MODE_UNSPECIFIED\x10\x00\x12\x16\n\x12\x41UTH_MODE_IAM_AUTH\x10\x01\x12\x16\n\x12\x41UTH_MODE_DISABLED\x10\x02*\x8f\x01\n\x08NodeType\x12\x19\n\x15NODE_TYPE_UNSPECIFIED\x10\x00\x12\x1a\n\x16REDIS_SHARED_CORE_NANO\x10\x01\x12\x18\n\x14REDIS_HIGHMEM_MEDIUM\x10\x02\x12\x18\n\x14REDIS_HIGHMEM_XLARGE\x10\x03\x12\x18\n\x14REDIS_STANDARD_SMALL\x10\x04*\x99\x01\n\x15TransitEncryptionMode\x12\'\n#TRANSIT_ENCRYPTION_MODE_UNSPECIFIED\x10\x00\x12$\n TRANSIT_ENCRYPTION_MODE_DISABLED\x10\x01\x12\x31\n-TRANSIT_ENCRYPTION_MODE_SERVER_AUTHENTICATION\x10\x02*\x89\x01\n\x0e\x43onnectionType\x12\x1f\n\x1b\x43ONNECTION_TYPE_UNSPECIFIED\x10\x00\x12\x1d\n\x19\x43ONNECTION_TYPE_DISCOVERY\x10\x01\x12\x1b\n\x17\x43ONNECTION_TYPE_PRIMARY\x10\x02\x12\x1a\n\x16\x43ONNECTION_TYPE_READER\x10\x03\x32\xc4\x19\n\x11\x43loudRedisCluster\x12\xc5\x01\n\x0cListClusters\x12\x37.google.cloud.redis.cluster.v1beta1.ListClustersRequest\x1a\x38.google.cloud.redis.cluster.v1beta1.ListClustersResponse\"B\xda\x41\x06parent\x82\xd3\xe4\x93\x02\x33\x12\x31/v1beta1/{parent=projects/*/locations/*}/clusters\x12\xb2\x01\n\nGetCluster\x12\x35.google.cloud.redis.cluster.v1beta1.GetClusterRequest\x1a+.google.cloud.redis.cluster.v1beta1.Cluster\"@\xda\x41\x04name\x82\xd3\xe4\x93\x02\x33\x12\x31/v1beta1/{name=projects/*/locations/*/clusters/*}\x12\xec\x01\n\rUpdateCluster\x12\x38.google.cloud.redis.cluster.v1beta1.UpdateClusterRequest\x1a\x1d.google.longrunning.Operation\"\x81\x01\xca\x41\x1e\n\x07\x43luster\x12\x13google.protobuf.Any\xda\x41\x13\x63luster,update_mask\x82\xd3\xe4\x93\x02\x44\x32\x39/v1beta1/{cluster.name=projects/*/locations/*/clusters/*}:\x07\x63luster\x12\xd9\x01\n\rDeleteCluster\x12\x38.google.cloud.redis.cluster.v1beta1.DeleteClusterRequest\x1a\x1d.google.longrunning.Operation\"o\xca\x41,\n\x15google.protobuf.Empty\x12\x13google.protobuf.Any\xda\x41\x04name\x82\xd3\xe4\x93\x02\x33*1/v1beta1/{name=projects/*/locations/*/clusters/*}\x12\xe9\x01\n\rCreateCluster\x12\x38.google.cloud.redis.cluster.v1beta1.CreateClusterRequest\x1a\x1d.google.longrunning.Operation\"\x7f\xca\x41\x1e\n\x07\x43luster\x12\x13google.protobuf.Any\xda\x41\x19parent,cluster,cluster_id\x82\xd3\xe4\x93\x02<\"1/v1beta1/{parent=projects/*/locations/*}/clusters:\x07\x63luster\x12\xfc\x01\n\x1eGetClusterCertificateAuthority\x12I.google.cloud.redis.cluster.v1beta1.GetClusterCertificateAuthorityRequest\x1a\x38.google.cloud.redis.cluster.v1beta1.CertificateAuthority\"U\xda\x41\x04name\x82\xd3\xe4\x93\x02H\x12\x46/v1beta1/{name=projects/*/locations/*/clusters/*/certificateAuthority}\x12\xa8\x02\n\x1cRescheduleClusterMaintenance\x12G.google.cloud.redis.cluster.v1beta1.RescheduleClusterMaintenanceRequest\x1a\x1d.google.longrunning.Operation\"\x9f\x01\xca\x41\x1e\n\x07\x43luster\x12\x13google.protobuf.Any\xda\x41\"name,reschedule_type,schedule_time\x82\xd3\xe4\x93\x02S\"N/v1beta1/{name=projects/*/locations/*/clusters/*}:rescheduleClusterMaintenance:\x01*\x12\xe9\x01\n\x15ListBackupCollections\x12@.google.cloud.redis.cluster.v1beta1.ListBackupCollectionsRequest\x1a\x41.google.cloud.redis.cluster.v1beta1.ListBackupCollectionsResponse\"K\xda\x41\x06parent\x82\xd3\xe4\x93\x02<\x12:/v1beta1/{parent=projects/*/locations/*}/backupCollections\x12\xd6\x01\n\x13GetBackupCollection\x12>.google.cloud.redis.cluster.v1beta1.GetBackupCollectionRequest\x1a\x34.google.cloud.redis.cluster.v1beta1.BackupCollection\"I\xda\x41\x04name\x82\xd3\xe4\x93\x02<\x12:/v1beta1/{name=projects/*/locations/*/backupCollections/*}\x12\xd5\x01\n\x0bListBackups\x12\x36.google.cloud.redis.cluster.v1beta1.ListBackupsRequest\x1a\x37.google.cloud.redis.cluster.v1beta1.ListBackupsResponse\"U\xda\x41\x06parent\x82\xd3\xe4\x93\x02\x46\x12\x44/v1beta1/{parent=projects/*/locations/*/backupCollections/*}/backups\x12\xc2\x01\n\tGetBackup\x12\x34.google.cloud.redis.cluster.v1beta1.GetBackupRequest\x1a*.google.cloud.redis.cluster.v1beta1.Backup\"S\xda\x41\x04name\x82\xd3\xe4\x93\x02\x46\x12\x44/v1beta1/{name=projects/*/locations/*/backupCollections/*/backups/*}\x12\xeb\x01\n\x0c\x44\x65leteBackup\x12\x37.google.cloud.redis.cluster.v1beta1.DeleteBackupRequest\x1a\x1d.google.longrunning.Operation\"\x82\x01\xca\x41,\n\x15google.protobuf.Empty\x12\x13google.protobuf.Any\xda\x41\x04name\x82\xd3\xe4\x93\x02\x46*D/v1beta1/{name=projects/*/locations/*/backupCollections/*/backups/*}\x12\xde\x01\n\x0c\x45xportBackup\x12\x37.google.cloud.redis.cluster.v1beta1.ExportBackupRequest\x1a\x1d.google.longrunning.Operation\"v\xca\x41\x1d\n\x06\x42\x61\x63kup\x12\x13google.protobuf.Any\x82\xd3\xe4\x93\x02P\"K/v1beta1/{name=projects/*/locations/*/backupCollections/*/backups/*}:export:\x01*\x12\xd5\x01\n\rBackupCluster\x12\x38.google.cloud.redis.cluster.v1beta1.BackupClusterRequest\x1a\x1d.google.longrunning.Operation\"k\xca\x41\x1e\n\x07\x43luster\x12\x13google.protobuf.Any\xda\x41\x04name\x82\xd3\xe4\x93\x02=\"8/v1beta1/{name=projects/*/locations/*/clusters/*}:backup:\x01*\x1aH\xca\x41\x14redis.googleapis.com\xd2\x41.https://www.googleapis.com/auth/cloud-platformB\x8e\x06\n&com.google.cloud.redis.cluster.v1beta1B\x16\x43loudRedisClusterProtoP\x01Z@cloud.google.com/go/redis/cluster/apiv1beta1/clusterpb;clusterpb\xea\x02&Google::Cloud::Redis::Cluster::V1beta1\xea\x41n\n%compute.googleapis.com/ForwardingRule\x12\x45projects/{project}/regions/{region}/forwardingRules/{forwarding_rule}\xea\x41N\n\x1e\x63ompute.googleapis.com/Network\x12,projects/{project}/global/networks/{network}\xea\x41w\n(compute.googleapis.com/ServiceAttachment\x12Kprojects/{project}/regions/{region}/serviceAttachments/{service_attachment}\xea\x41x\n!cloudkms.googleapis.com/CryptoKey\x12Sprojects/{project}/locations/{location}/keyRings/{key_ring}/cryptoKeys/{crypto_key}\xea\x41\xa6\x01\n(cloudkms.googleapis.com/CryptoKeyVersion\x12zprojects/{project}/locations/{location}/keyRings/{key_ring}/cryptoKeys/{crypto_key}/cryptoKeyVersions/{crypto_key_version}b\x06proto3" + +pool = ::Google::Protobuf::DescriptorPool.generated_pool +pool.add_serialized_file(descriptor_data) + +module Google + module Cloud + module Redis + module Cluster + module V1beta1 + CreateClusterRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.redis.cluster.v1beta1.CreateClusterRequest").msgclass + ListClustersRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.redis.cluster.v1beta1.ListClustersRequest").msgclass + ListClustersResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.redis.cluster.v1beta1.ListClustersResponse").msgclass + UpdateClusterRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.redis.cluster.v1beta1.UpdateClusterRequest").msgclass + GetClusterRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.redis.cluster.v1beta1.GetClusterRequest").msgclass + DeleteClusterRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.redis.cluster.v1beta1.DeleteClusterRequest").msgclass + GetClusterCertificateAuthorityRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.redis.cluster.v1beta1.GetClusterCertificateAuthorityRequest").msgclass + ListBackupCollectionsRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.redis.cluster.v1beta1.ListBackupCollectionsRequest").msgclass + ListBackupCollectionsResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.redis.cluster.v1beta1.ListBackupCollectionsResponse").msgclass + GetBackupCollectionRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.redis.cluster.v1beta1.GetBackupCollectionRequest").msgclass + ListBackupsRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.redis.cluster.v1beta1.ListBackupsRequest").msgclass + ListBackupsResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.redis.cluster.v1beta1.ListBackupsResponse").msgclass + GetBackupRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.redis.cluster.v1beta1.GetBackupRequest").msgclass + DeleteBackupRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.redis.cluster.v1beta1.DeleteBackupRequest").msgclass + ExportBackupRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.redis.cluster.v1beta1.ExportBackupRequest").msgclass + BackupClusterRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.redis.cluster.v1beta1.BackupClusterRequest").msgclass + Cluster = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.redis.cluster.v1beta1.Cluster").msgclass + Cluster::StateInfo = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.redis.cluster.v1beta1.Cluster.StateInfo").msgclass + Cluster::StateInfo::UpdateInfo = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.redis.cluster.v1beta1.Cluster.StateInfo.UpdateInfo").msgclass + Cluster::GcsBackupSource = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.redis.cluster.v1beta1.Cluster.GcsBackupSource").msgclass + Cluster::ManagedBackupSource = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.redis.cluster.v1beta1.Cluster.ManagedBackupSource").msgclass + Cluster::State = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.redis.cluster.v1beta1.Cluster.State").enummodule + AutomatedBackupConfig = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.redis.cluster.v1beta1.AutomatedBackupConfig").msgclass + AutomatedBackupConfig::FixedFrequencySchedule = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.redis.cluster.v1beta1.AutomatedBackupConfig.FixedFrequencySchedule").msgclass + AutomatedBackupConfig::AutomatedBackupMode = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.redis.cluster.v1beta1.AutomatedBackupConfig.AutomatedBackupMode").enummodule + BackupCollection = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.redis.cluster.v1beta1.BackupCollection").msgclass + Backup = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.redis.cluster.v1beta1.Backup").msgclass + Backup::BackupType = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.redis.cluster.v1beta1.Backup.BackupType").enummodule + Backup::State = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.redis.cluster.v1beta1.Backup.State").enummodule + BackupFile = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.redis.cluster.v1beta1.BackupFile").msgclass + PscServiceAttachment = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.redis.cluster.v1beta1.PscServiceAttachment").msgclass + CrossClusterReplicationConfig = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.redis.cluster.v1beta1.CrossClusterReplicationConfig").msgclass + CrossClusterReplicationConfig::RemoteCluster = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.redis.cluster.v1beta1.CrossClusterReplicationConfig.RemoteCluster").msgclass + CrossClusterReplicationConfig::Membership = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.redis.cluster.v1beta1.CrossClusterReplicationConfig.Membership").msgclass + CrossClusterReplicationConfig::ClusterRole = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.redis.cluster.v1beta1.CrossClusterReplicationConfig.ClusterRole").enummodule + ClusterMaintenancePolicy = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.redis.cluster.v1beta1.ClusterMaintenancePolicy").msgclass + ClusterWeeklyMaintenanceWindow = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.redis.cluster.v1beta1.ClusterWeeklyMaintenanceWindow").msgclass + ClusterMaintenanceSchedule = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.redis.cluster.v1beta1.ClusterMaintenanceSchedule").msgclass + PscConfig = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.redis.cluster.v1beta1.PscConfig").msgclass + DiscoveryEndpoint = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.redis.cluster.v1beta1.DiscoveryEndpoint").msgclass + PscConnection = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.redis.cluster.v1beta1.PscConnection").msgclass + ClusterEndpoint = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.redis.cluster.v1beta1.ClusterEndpoint").msgclass + ConnectionDetail = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.redis.cluster.v1beta1.ConnectionDetail").msgclass + PscAutoConnection = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.redis.cluster.v1beta1.PscAutoConnection").msgclass + OperationMetadata = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.redis.cluster.v1beta1.OperationMetadata").msgclass + CertificateAuthority = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.redis.cluster.v1beta1.CertificateAuthority").msgclass + CertificateAuthority::ManagedCertificateAuthority = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.redis.cluster.v1beta1.CertificateAuthority.ManagedCertificateAuthority").msgclass + CertificateAuthority::ManagedCertificateAuthority::CertChain = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.redis.cluster.v1beta1.CertificateAuthority.ManagedCertificateAuthority.CertChain").msgclass + ClusterPersistenceConfig = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.redis.cluster.v1beta1.ClusterPersistenceConfig").msgclass + ClusterPersistenceConfig::RDBConfig = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.redis.cluster.v1beta1.ClusterPersistenceConfig.RDBConfig").msgclass + ClusterPersistenceConfig::RDBConfig::SnapshotPeriod = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.redis.cluster.v1beta1.ClusterPersistenceConfig.RDBConfig.SnapshotPeriod").enummodule + ClusterPersistenceConfig::AOFConfig = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.redis.cluster.v1beta1.ClusterPersistenceConfig.AOFConfig").msgclass + ClusterPersistenceConfig::AOFConfig::AppendFsync = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.redis.cluster.v1beta1.ClusterPersistenceConfig.AOFConfig.AppendFsync").enummodule + ClusterPersistenceConfig::PersistenceMode = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.redis.cluster.v1beta1.ClusterPersistenceConfig.PersistenceMode").enummodule + ZoneDistributionConfig = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.redis.cluster.v1beta1.ZoneDistributionConfig").msgclass + ZoneDistributionConfig::ZoneDistributionMode = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.redis.cluster.v1beta1.ZoneDistributionConfig.ZoneDistributionMode").enummodule + RescheduleClusterMaintenanceRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.redis.cluster.v1beta1.RescheduleClusterMaintenanceRequest").msgclass + RescheduleClusterMaintenanceRequest::RescheduleType = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.redis.cluster.v1beta1.RescheduleClusterMaintenanceRequest.RescheduleType").enummodule + EncryptionInfo = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.redis.cluster.v1beta1.EncryptionInfo").msgclass + EncryptionInfo::Type = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.redis.cluster.v1beta1.EncryptionInfo.Type").enummodule + EncryptionInfo::KmsKeyState = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.redis.cluster.v1beta1.EncryptionInfo.KmsKeyState").enummodule + PscConnectionStatus = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.redis.cluster.v1beta1.PscConnectionStatus").enummodule + AuthorizationMode = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.redis.cluster.v1beta1.AuthorizationMode").enummodule + NodeType = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.redis.cluster.v1beta1.NodeType").enummodule + TransitEncryptionMode = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.redis.cluster.v1beta1.TransitEncryptionMode").enummodule + ConnectionType = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.redis.cluster.v1beta1.ConnectionType").enummodule + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-redis-cluster-v1beta1/lib/google/cloud/redis/cluster/v1beta1/cloud_redis_cluster_services_pb.rb b/owl-bot-staging/google-cloud-redis-cluster-v1beta1/lib/google/cloud/redis/cluster/v1beta1/cloud_redis_cluster_services_pb.rb new file mode 100644 index 000000000000..1c3cba0b9031 --- /dev/null +++ b/owl-bot-staging/google-cloud-redis-cluster-v1beta1/lib/google/cloud/redis/cluster/v1beta1/cloud_redis_cluster_services_pb.rb @@ -0,0 +1,122 @@ +# Generated by the protocol buffer compiler. DO NOT EDIT! +# Source: google/cloud/redis/cluster/v1beta1/cloud_redis_cluster.proto for package 'Google.Cloud.Redis.Cluster.V1beta1' +# Original file comments: +# 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 +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# + +require 'grpc' +require 'google/cloud/redis/cluster/v1beta1/cloud_redis_cluster_pb' + +module Google + module Cloud + module Redis + module Cluster + module V1beta1 + module CloudRedisCluster + # Configures and manages Cloud Memorystore for Redis clusters + # + # Google Cloud Memorystore for Redis Cluster + # + # The `redis.googleapis.com` service implements the Google Cloud Memorystore + # for Redis API and defines the following resource model for managing Redis + # clusters: + # * The service works with a collection of cloud projects, named: `/projects/*` + # * Each project has a collection of available locations, named: `/locations/*` + # * Each location has a collection of Redis clusters, named: `/clusters/*` + # * As such, Redis clusters are resources of the form: + # `/projects/{project_id}/locations/{location_id}/clusters/{instance_id}` + # + # Note that location_id must be a GCP `region`; for example: + # * `projects/redpepper-1290/locations/us-central1/clusters/my-redis` + class Service + + include ::GRPC::GenericService + + self.marshal_class_method = :encode + self.unmarshal_class_method = :decode + self.service_name = 'google.cloud.redis.cluster.v1beta1.CloudRedisCluster' + + # Lists all Redis clusters owned by a project in either the specified + # location (region) or all locations. + # + # The location should have the following format: + # + # * `projects/{project_id}/locations/{location_id}` + # + # If `location_id` is specified as `-` (wildcard), then all regions + # available to the project are queried, and the results are aggregated. + rpc :ListClusters, ::Google::Cloud::Redis::Cluster::V1beta1::ListClustersRequest, ::Google::Cloud::Redis::Cluster::V1beta1::ListClustersResponse + # Gets the details of a specific Redis cluster. + rpc :GetCluster, ::Google::Cloud::Redis::Cluster::V1beta1::GetClusterRequest, ::Google::Cloud::Redis::Cluster::V1beta1::Cluster + # Updates the metadata and configuration of a specific Redis cluster. + # + # Completed longrunning.Operation will contain the new cluster object + # in the response field. The returned operation is automatically deleted + # after a few hours, so there is no need to call DeleteOperation. + rpc :UpdateCluster, ::Google::Cloud::Redis::Cluster::V1beta1::UpdateClusterRequest, ::Google::Longrunning::Operation + # Deletes a specific Redis cluster. Cluster stops serving and data is + # deleted. + rpc :DeleteCluster, ::Google::Cloud::Redis::Cluster::V1beta1::DeleteClusterRequest, ::Google::Longrunning::Operation + # Creates a Redis cluster based on the specified properties. + # The creation is executed asynchronously and callers may check the returned + # operation to track its progress. Once the operation is completed the Redis + # cluster will be fully functional. The completed longrunning.Operation will + # contain the new cluster object in the response field. + # + # The returned operation is automatically deleted after a few hours, so there + # is no need to call DeleteOperation. + rpc :CreateCluster, ::Google::Cloud::Redis::Cluster::V1beta1::CreateClusterRequest, ::Google::Longrunning::Operation + # Gets the details of certificate authority information for Redis cluster. + rpc :GetClusterCertificateAuthority, ::Google::Cloud::Redis::Cluster::V1beta1::GetClusterCertificateAuthorityRequest, ::Google::Cloud::Redis::Cluster::V1beta1::CertificateAuthority + # Reschedules upcoming maintenance event. + rpc :RescheduleClusterMaintenance, ::Google::Cloud::Redis::Cluster::V1beta1::RescheduleClusterMaintenanceRequest, ::Google::Longrunning::Operation + # Lists all backup collections owned by a consumer project in either the + # specified location (region) or all locations. + # + # If `location_id` is specified as `-` (wildcard), then all regions + # available to the project are queried, and the results are aggregated. + rpc :ListBackupCollections, ::Google::Cloud::Redis::Cluster::V1beta1::ListBackupCollectionsRequest, ::Google::Cloud::Redis::Cluster::V1beta1::ListBackupCollectionsResponse + # Get a backup collection. + rpc :GetBackupCollection, ::Google::Cloud::Redis::Cluster::V1beta1::GetBackupCollectionRequest, ::Google::Cloud::Redis::Cluster::V1beta1::BackupCollection + # Lists all backups owned by a backup collection. + rpc :ListBackups, ::Google::Cloud::Redis::Cluster::V1beta1::ListBackupsRequest, ::Google::Cloud::Redis::Cluster::V1beta1::ListBackupsResponse + # Gets the details of a specific backup. + rpc :GetBackup, ::Google::Cloud::Redis::Cluster::V1beta1::GetBackupRequest, ::Google::Cloud::Redis::Cluster::V1beta1::Backup + # Deletes a specific backup. + rpc :DeleteBackup, ::Google::Cloud::Redis::Cluster::V1beta1::DeleteBackupRequest, ::Google::Longrunning::Operation + # Exports a specific backup to a customer target Cloud Storage URI. + rpc :ExportBackup, ::Google::Cloud::Redis::Cluster::V1beta1::ExportBackupRequest, ::Google::Longrunning::Operation + # Backup Redis Cluster. + # If this is the first time a backup is being created, a backup collection + # will be created at the backend, and this backup belongs to this collection. + # Both collection and backup will have a resource name. Backup will be + # executed for each shard. A replica (primary if nonHA) will be selected to + # perform the execution. Backup call will be rejected if there is an ongoing + # backup or update operation. Be aware that during preview, if the cluster's + # internal software version is too old, critical update will be performed + # before actual backup. Once the internal software version is updated to the + # minimum version required by the backup feature, subsequent backups will not + # require critical update. After preview, there will be no critical update + # needed for backup. + rpc :BackupCluster, ::Google::Cloud::Redis::Cluster::V1beta1::BackupClusterRequest, ::Google::Longrunning::Operation + end + + Stub = Service.rpc_stub_class + end + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-redis-cluster-v1beta1/lib/google/cloud/redis/cluster/v1beta1/rest.rb b/owl-bot-staging/google-cloud-redis-cluster-v1beta1/lib/google/cloud/redis/cluster/v1beta1/rest.rb new file mode 100644 index 000000000000..8c0c0259da61 --- /dev/null +++ b/owl-bot-staging/google-cloud-redis-cluster-v1beta1/lib/google/cloud/redis/cluster/v1beta1/rest.rb @@ -0,0 +1,40 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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/redis/cluster/v1beta1/cloud_redis_cluster/rest" +require "google/cloud/redis/cluster/v1beta1/bindings_override" +require "google/cloud/redis/cluster/v1beta1/version" + +module Google + module Cloud + module Redis + module Cluster + ## + # To load just the REST part of this package, including all its services, and instantiate a REST client: + # + # @example + # + # require "google/cloud/redis/cluster/v1beta1/rest" + # client = ::Google::Cloud::Redis::Cluster::V1beta1::CloudRedisCluster::Rest::Client.new + # + module V1beta1 + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-redis-cluster-v1beta1/lib/google/cloud/redis/cluster/v1beta1/version.rb b/owl-bot-staging/google-cloud-redis-cluster-v1beta1/lib/google/cloud/redis/cluster/v1beta1/version.rb new file mode 100644 index 000000000000..5aa210ce32bc --- /dev/null +++ b/owl-bot-staging/google-cloud-redis-cluster-v1beta1/lib/google/cloud/redis/cluster/v1beta1/version.rb @@ -0,0 +1,30 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + + +module Google + module Cloud + module Redis + module Cluster + module V1beta1 + VERSION = "0.0.1" + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-redis-cluster-v1beta1/proto_docs/README.md b/owl-bot-staging/google-cloud-redis-cluster-v1beta1/proto_docs/README.md new file mode 100644 index 000000000000..fdace2b045a6 --- /dev/null +++ b/owl-bot-staging/google-cloud-redis-cluster-v1beta1/proto_docs/README.md @@ -0,0 +1,4 @@ +# Google Cloud Memorystore for Redis V1BETA1 Protocol Buffer Documentation + +These files are for the YARD documentation of the generated protobuf files. +They are not intended to be required or loaded at runtime. diff --git a/owl-bot-staging/google-cloud-redis-cluster-v1beta1/proto_docs/google/api/client.rb b/owl-bot-staging/google-cloud-redis-cluster-v1beta1/proto_docs/google/api/client.rb new file mode 100644 index 000000000000..5089551e9ea4 --- /dev/null +++ b/owl-bot-staging/google-cloud-redis-cluster-v1beta1/proto_docs/google/api/client.rb @@ -0,0 +1,589 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + + +module Google + module Api + # Required information for every language. + # @!attribute [rw] reference_docs_uri + # @deprecated This field is deprecated and may be removed in the next major version update. + # @return [::String] + # Link to automatically generated reference documentation. Example: + # https://cloud.google.com/nodejs/docs/reference/asset/latest + # @!attribute [rw] destinations + # @return [::Array<::Google::Api::ClientLibraryDestination>] + # The destination where API teams want this client library to be published. + # @!attribute [rw] selective_gapic_generation + # @return [::Google::Api::SelectiveGapicGeneration] + # Configuration for which RPCs should be generated in the GAPIC client. + class CommonLanguageSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Details about how and where to publish client libraries. + # @!attribute [rw] version + # @return [::String] + # Version of the API to apply these settings to. This is the full protobuf + # package for the API, ending in the version element. + # Examples: "google.cloud.speech.v1" and "google.spanner.admin.database.v1". + # @!attribute [rw] launch_stage + # @return [::Google::Api::LaunchStage] + # Launch stage of this version of the API. + # @!attribute [rw] rest_numeric_enums + # @return [::Boolean] + # When using transport=rest, the client request will encode enums as + # numbers rather than strings. + # @!attribute [rw] java_settings + # @return [::Google::Api::JavaSettings] + # Settings for legacy Java features, supported in the Service YAML. + # @!attribute [rw] cpp_settings + # @return [::Google::Api::CppSettings] + # Settings for C++ client libraries. + # @!attribute [rw] php_settings + # @return [::Google::Api::PhpSettings] + # Settings for PHP client libraries. + # @!attribute [rw] python_settings + # @return [::Google::Api::PythonSettings] + # Settings for Python client libraries. + # @!attribute [rw] node_settings + # @return [::Google::Api::NodeSettings] + # Settings for Node client libraries. + # @!attribute [rw] dotnet_settings + # @return [::Google::Api::DotnetSettings] + # Settings for .NET client libraries. + # @!attribute [rw] ruby_settings + # @return [::Google::Api::RubySettings] + # Settings for Ruby client libraries. + # @!attribute [rw] go_settings + # @return [::Google::Api::GoSettings] + # Settings for Go client libraries. + class ClientLibrarySettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # This message configures the settings for publishing [Google Cloud Client + # libraries](https://cloud.google.com/apis/docs/cloud-client-libraries) + # generated from the service config. + # @!attribute [rw] method_settings + # @return [::Array<::Google::Api::MethodSettings>] + # A list of API method settings, e.g. the behavior for methods that use the + # long-running operation pattern. + # @!attribute [rw] new_issue_uri + # @return [::String] + # Link to a *public* URI where users can report issues. Example: + # https://issuetracker.google.com/issues/new?component=190865&template=1161103 + # @!attribute [rw] documentation_uri + # @return [::String] + # Link to product home page. Example: + # https://cloud.google.com/asset-inventory/docs/overview + # @!attribute [rw] api_short_name + # @return [::String] + # Used as a tracking tag when collecting data about the APIs developer + # relations artifacts like docs, packages delivered to package managers, + # etc. Example: "speech". + # @!attribute [rw] github_label + # @return [::String] + # GitHub label to apply to issues and pull requests opened for this API. + # @!attribute [rw] codeowner_github_teams + # @return [::Array<::String>] + # GitHub teams to be added to CODEOWNERS in the directory in GitHub + # containing source code for the client libraries for this API. + # @!attribute [rw] doc_tag_prefix + # @return [::String] + # A prefix used in sample code when demarking regions to be included in + # documentation. + # @!attribute [rw] organization + # @return [::Google::Api::ClientLibraryOrganization] + # For whom the client library is being published. + # @!attribute [rw] library_settings + # @return [::Array<::Google::Api::ClientLibrarySettings>] + # Client library settings. If the same version string appears multiple + # times in this list, then the last one wins. Settings from earlier + # settings with the same version string are discarded. + # @!attribute [rw] proto_reference_documentation_uri + # @return [::String] + # Optional link to proto reference documentation. Example: + # https://cloud.google.com/pubsub/lite/docs/reference/rpc + # @!attribute [rw] rest_reference_documentation_uri + # @return [::String] + # Optional link to REST reference documentation. Example: + # https://cloud.google.com/pubsub/lite/docs/reference/rest + class Publishing + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Settings for Java client libraries. + # @!attribute [rw] library_package + # @return [::String] + # The package name to use in Java. Clobbers the java_package option + # set in the protobuf. This should be used **only** by APIs + # who have already set the language_settings.java.package_name" field + # in gapic.yaml. API teams should use the protobuf java_package option + # where possible. + # + # Example of a YAML configuration:: + # + # publishing: + # 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. + # @!attribute [rw] methods + # @return [::Array<::String>] + # An allowlist of the fully qualified names of RPCs that should be included + # on public client surfaces. + # @!attribute [rw] generate_omitted_as_internal + # @return [::Boolean] + # Setting this to true indicates to the client generators that methods + # that would be excluded from the generation should instead be generated + # in a way that indicates these methods should not be consumed by + # end users. How this is expressed is up to individual language + # implementations to decide. Some examples may be: added annotations, + # obfuscated identifiers, or other language idiomatic patterns. + class SelectiveGapicGeneration + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # `BatchingConfigProto` defines the batching configuration for an API method. + # @!attribute [rw] thresholds + # @return [::Google::Api::BatchingSettingsProto] + # The thresholds which trigger a batched request to be sent. + # @!attribute [rw] batch_descriptor + # @return [::Google::Api::BatchingDescriptorProto] + # The request and response fields used in batching. + class BatchingConfigProto + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # `BatchingSettingsProto` specifies a set of batching thresholds, each of + # which acts as a trigger to send a batch of messages as a request. At least + # one threshold must be positive nonzero. + # @!attribute [rw] element_count_threshold + # @return [::Integer] + # The number of elements of a field collected into a batch which, if + # exceeded, causes the batch to be sent. + # @!attribute [rw] request_byte_threshold + # @return [::Integer] + # The aggregated size of the batched field which, if exceeded, causes the + # batch to be sent. This size is computed by aggregating the sizes of the + # request field to be batched, not of the entire request message. + # @!attribute [rw] delay_threshold + # @return [::Google::Protobuf::Duration] + # The duration after which a batch should be sent, starting from the addition + # of the first message to that batch. + # @!attribute [rw] element_count_limit + # @return [::Integer] + # The maximum number of elements collected in a batch that could be accepted + # by server. + # @!attribute [rw] request_byte_limit + # @return [::Integer] + # The maximum size of the request that could be accepted by server. + # @!attribute [rw] flow_control_element_limit + # @return [::Integer] + # The maximum number of elements allowed by flow control. + # @!attribute [rw] flow_control_byte_limit + # @return [::Integer] + # The maximum size of data allowed by flow control. + # @!attribute [rw] flow_control_limit_exceeded_behavior + # @return [::Google::Api::FlowControlLimitExceededBehaviorProto] + # The behavior to take when the flow control limit is exceeded. + class BatchingSettingsProto + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # `BatchingDescriptorProto` specifies the fields of the request message to be + # used for batching, and, optionally, the fields of the response message to be + # used for demultiplexing. + # @!attribute [rw] batched_field + # @return [::String] + # The repeated field in the request message to be aggregated by batching. + # @!attribute [rw] discriminator_fields + # @return [::Array<::String>] + # A list of the fields in the request message. Two requests will be batched + # together only if the values of every field specified in + # `request_discriminator_fields` is equal between the two requests. + # @!attribute [rw] subresponse_field + # @return [::String] + # Optional. When present, indicates the field in the response message to be + # used to demultiplex the response into multiple response messages, in + # correspondence with the multiple request messages originally batched + # together. + class BatchingDescriptorProto + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # The organization for which the client libraries are being published. + # Affects the url where generated docs are published, etc. + module ClientLibraryOrganization + # Not useful. + CLIENT_LIBRARY_ORGANIZATION_UNSPECIFIED = 0 + + # Google Cloud Platform Org. + CLOUD = 1 + + # Ads (Advertising) Org. + ADS = 2 + + # Photos Org. + PHOTOS = 3 + + # Street View Org. + STREET_VIEW = 4 + + # Shopping Org. + SHOPPING = 5 + + # Geo Org. + GEO = 6 + + # Generative AI - https://developers.generativeai.google + GENERATIVE_AI = 7 + end + + # To where should client libraries be published? + module ClientLibraryDestination + # Client libraries will neither be generated nor published to package + # managers. + CLIENT_LIBRARY_DESTINATION_UNSPECIFIED = 0 + + # Generate the client library in a repo under github.com/googleapis, + # but don't publish it to package managers. + GITHUB = 10 + + # Publish the library to package managers like nuget.org and npmjs.com. + PACKAGE_MANAGER = 20 + end + + # The behavior to take when the flow control limit is exceeded. + module FlowControlLimitExceededBehaviorProto + # Default behavior, system-defined. + UNSET_BEHAVIOR = 0 + + # Stop operation, raise error. + THROW_EXCEPTION = 1 + + # Pause operation until limit clears. + BLOCK = 2 + + # Continue operation, disregard limit. + IGNORE = 3 + end + end +end diff --git a/owl-bot-staging/google-cloud-redis-cluster-v1beta1/proto_docs/google/api/field_behavior.rb b/owl-bot-staging/google-cloud-redis-cluster-v1beta1/proto_docs/google/api/field_behavior.rb new file mode 100644 index 000000000000..582be187d115 --- /dev/null +++ b/owl-bot-staging/google-cloud-redis-cluster-v1beta1/proto_docs/google/api/field_behavior.rb @@ -0,0 +1,85 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + + +module Google + module Api + # An indicator of the behavior of a given field (for example, that a field + # is required in requests, or given as output but ignored as input). + # This **does not** change the behavior in protocol buffers itself; it only + # denotes the behavior and may affect how API tooling handles the field. + # + # Note: This enum **may** receive new values in the future. + module FieldBehavior + # Conventional default for enums. Do not use this. + FIELD_BEHAVIOR_UNSPECIFIED = 0 + + # Specifically denotes a field as optional. + # While all fields in protocol buffers are optional, this may be specified + # for emphasis if appropriate. + OPTIONAL = 1 + + # Denotes a field as required. + # This indicates that the field **must** be provided as part of the request, + # and failure to do so will cause an error (usually `INVALID_ARGUMENT`). + REQUIRED = 2 + + # Denotes a field as output only. + # This indicates that the field is provided in responses, but including the + # field in a request does nothing (the server *must* ignore it and + # *must not* throw an error as a result of the field's presence). + OUTPUT_ONLY = 3 + + # Denotes a field as input only. + # This indicates that the field is provided in requests, and the + # corresponding field is not included in output. + INPUT_ONLY = 4 + + # Denotes a field as immutable. + # This indicates that the field may be set once in a request to create a + # resource, but may not be changed thereafter. + IMMUTABLE = 5 + + # Denotes that a (repeated) field is an unordered list. + # This indicates that the service may provide the elements of the list + # in any arbitrary order, rather than the order the user originally + # provided. Additionally, the list's order may or may not be stable. + UNORDERED_LIST = 6 + + # Denotes that this field returns a non-empty default value if not set. + # This indicates that if the user provides the empty value in a request, + # a non-empty value will be returned. The user will not be aware of what + # non-empty value to expect. + NON_EMPTY_DEFAULT = 7 + + # Denotes that the field in a resource (a message annotated with + # google.api.resource) is used in the resource name to uniquely identify the + # resource. For AIP-compliant APIs, this should only be applied to the + # `name` field on the resource. + # + # This behavior should not be applied to references to other resources within + # the message. + # + # The identifier field of resources often have different field behavior + # depending on the request it is embedded in (e.g. for Create methods name + # is optional and unused, while for Update methods it is required). Instead + # of method-specific annotations, only `IDENTIFIER` is required. + IDENTIFIER = 8 + end + end +end diff --git a/owl-bot-staging/google-cloud-redis-cluster-v1beta1/proto_docs/google/api/field_info.rb b/owl-bot-staging/google-cloud-redis-cluster-v1beta1/proto_docs/google/api/field_info.rb new file mode 100644 index 000000000000..0f5acf0a5538 --- /dev/null +++ b/owl-bot-staging/google-cloud-redis-cluster-v1beta1/proto_docs/google/api/field_info.rb @@ -0,0 +1,88 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + + +module Google + module Api + # Rich semantic information of an API field beyond basic typing. + # @!attribute [rw] format + # @return [::Google::Api::FieldInfo::Format] + # The standard format of a field value. This does not explicitly configure + # any API consumer, just documents the API's format for the field it is + # applied to. + # @!attribute [rw] referenced_types + # @return [::Array<::Google::Api::TypeReference>] + # The type(s) that the annotated, generic field may represent. + # + # Currently, this must only be used on fields of type `google.protobuf.Any`. + # Supporting other generic types may be considered in the future. + class FieldInfo + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # The standard format of a field value. The supported formats are all backed + # by either an RFC defined by the IETF or a Google-defined AIP. + module Format + # Default, unspecified value. + FORMAT_UNSPECIFIED = 0 + + # Universally Unique Identifier, version 4, value as defined by + # https://datatracker.ietf.org/doc/html/rfc4122. The value may be + # normalized to entirely lowercase letters. For example, the value + # `F47AC10B-58CC-0372-8567-0E02B2C3D479` would be normalized to + # `f47ac10b-58cc-0372-8567-0e02b2c3d479`. + UUID4 = 1 + + # Internet Protocol v4 value as defined by [RFC + # 791](https://datatracker.ietf.org/doc/html/rfc791). The value may be + # condensed, with leading zeros in each octet stripped. For example, + # `001.022.233.040` would be condensed to `1.22.233.40`. + IPV4 = 2 + + # Internet Protocol v6 value as defined by [RFC + # 2460](https://datatracker.ietf.org/doc/html/rfc2460). The value may be + # normalized to entirely lowercase letters with zeros compressed, following + # [RFC 5952](https://datatracker.ietf.org/doc/html/rfc5952). For example, + # the value `2001:0DB8:0::0` would be normalized to `2001:db8::`. + IPV6 = 3 + + # An IP address in either v4 or v6 format as described by the individual + # values defined herein. See the comments on the IPV4 and IPV6 types for + # allowed normalizations of each. + IPV4_OR_IPV6 = 4 + end + end + + # A reference to a message type, for use in {::Google::Api::FieldInfo FieldInfo}. + # @!attribute [rw] type_name + # @return [::String] + # The name of the type that the annotated, generic field may represent. + # If the type is in the same protobuf package, the value can be the simple + # message name e.g., `"MyMessage"`. Otherwise, the value must be the + # fully-qualified message name e.g., `"google.library.v1.Book"`. + # + # If the type(s) are unknown to the service (e.g. the field accepts generic + # user input), use the wildcard `"*"` to denote this behavior. + # + # See [AIP-202](https://google.aip.dev/202#type-references) for more details. + class TypeReference + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end +end diff --git a/owl-bot-staging/google-cloud-redis-cluster-v1beta1/proto_docs/google/api/launch_stage.rb b/owl-bot-staging/google-cloud-redis-cluster-v1beta1/proto_docs/google/api/launch_stage.rb new file mode 100644 index 000000000000..9392a413fb1b --- /dev/null +++ b/owl-bot-staging/google-cloud-redis-cluster-v1beta1/proto_docs/google/api/launch_stage.rb @@ -0,0 +1,71 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + + +module Google + module Api + # The launch stage as defined by [Google Cloud Platform + # Launch Stages](https://cloud.google.com/terms/launch-stages). + module LaunchStage + # Do not use this default value. + LAUNCH_STAGE_UNSPECIFIED = 0 + + # The feature is not yet implemented. Users can not use it. + UNIMPLEMENTED = 6 + + # Prelaunch features are hidden from users and are only visible internally. + PRELAUNCH = 7 + + # Early Access features are limited to a closed group of testers. To use + # these features, you must sign up in advance and sign a Trusted Tester + # agreement (which includes confidentiality provisions). These features may + # be unstable, changed in backward-incompatible ways, and are not + # guaranteed to be released. + EARLY_ACCESS = 1 + + # Alpha is a limited availability test for releases before they are cleared + # for widespread use. By Alpha, all significant design issues are resolved + # and we are in the process of verifying functionality. Alpha customers + # need to apply for access, agree to applicable terms, and have their + # projects allowlisted. Alpha releases don't have to be feature complete, + # no SLAs are provided, and there are no technical support obligations, but + # they will be far enough along that customers can actually use them in + # test environments or for limited-use tests -- just like they would in + # normal production cases. + ALPHA = 2 + + # Beta is the point at which we are ready to open a release for any + # customer to use. There are no SLA or technical support obligations in a + # Beta release. Products will be complete from a feature perspective, but + # may have some open outstanding issues. Beta releases are suitable for + # limited production use cases. + BETA = 3 + + # GA features are open to all developers and are considered stable and + # fully qualified for production use. + GA = 4 + + # Deprecated features are scheduled to be shut down and removed. For more + # information, see the "Deprecation Policy" section of our [Terms of + # Service](https://cloud.google.com/terms/) + # and the [Google Cloud Platform Subject to the Deprecation + # Policy](https://cloud.google.com/terms/deprecation) documentation. + DEPRECATED = 5 + end + end +end diff --git a/owl-bot-staging/google-cloud-redis-cluster-v1beta1/proto_docs/google/api/resource.rb b/owl-bot-staging/google-cloud-redis-cluster-v1beta1/proto_docs/google/api/resource.rb new file mode 100644 index 000000000000..25dec4847ac1 --- /dev/null +++ b/owl-bot-staging/google-cloud-redis-cluster-v1beta1/proto_docs/google/api/resource.rb @@ -0,0 +1,227 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + + +module Google + module Api + # A simple descriptor of a resource type. + # + # ResourceDescriptor annotates a resource message (either by means of a + # protobuf annotation or use in the service config), and associates the + # resource's schema, the resource type, and the pattern of the resource name. + # + # Example: + # + # message Topic { + # // Indicates this message defines a resource schema. + # // Declares the resource type in the format of {service}/{kind}. + # // For Kubernetes resources, the format is {api group}/{kind}. + # option (google.api.resource) = { + # type: "pubsub.googleapis.com/Topic" + # pattern: "projects/{project}/topics/{topic}" + # }; + # } + # + # The ResourceDescriptor Yaml config will look like: + # + # resources: + # - type: "pubsub.googleapis.com/Topic" + # pattern: "projects/{project}/topics/{topic}" + # + # Sometimes, resources have multiple patterns, typically because they can + # live under multiple parents. + # + # Example: + # + # message LogEntry { + # option (google.api.resource) = { + # type: "logging.googleapis.com/LogEntry" + # pattern: "projects/{project}/logs/{log}" + # pattern: "folders/{folder}/logs/{log}" + # pattern: "organizations/{organization}/logs/{log}" + # pattern: "billingAccounts/{billing_account}/logs/{log}" + # }; + # } + # + # The ResourceDescriptor Yaml config will look like: + # + # resources: + # - type: 'logging.googleapis.com/LogEntry' + # pattern: "projects/{project}/logs/{log}" + # pattern: "folders/{folder}/logs/{log}" + # pattern: "organizations/{organization}/logs/{log}" + # pattern: "billingAccounts/{billing_account}/logs/{log}" + # @!attribute [rw] type + # @return [::String] + # The resource type. It must be in the format of + # \\{service_name}/\\{resource_type_kind}. The `resource_type_kind` must be + # singular and must not include version numbers. + # + # Example: `storage.googleapis.com/Bucket` + # + # The value of the resource_type_kind must follow the regular expression + # /[A-Za-z][a-zA-Z0-9]+/. It should start with an upper case character and + # should use PascalCase (UpperCamelCase). The maximum number of + # characters allowed for the `resource_type_kind` is 100. + # @!attribute [rw] pattern + # @return [::Array<::String>] + # Optional. The relative resource name pattern associated with this resource + # type. The DNS prefix of the full resource name shouldn't be specified here. + # + # The path pattern must follow the syntax, which aligns with HTTP binding + # syntax: + # + # Template = Segment { "/" Segment } ; + # Segment = LITERAL | Variable ; + # Variable = "{" LITERAL "}" ; + # + # Examples: + # + # - "projects/\\{project}/topics/\\{topic}" + # - "projects/\\{project}/knowledgeBases/\\{knowledge_base}" + # + # The components in braces correspond to the IDs for each resource in the + # hierarchy. It is expected that, if multiple patterns are provided, + # the same component name (e.g. "project") refers to IDs of the same + # type of resource. + # @!attribute [rw] name_field + # @return [::String] + # Optional. The field on the resource that designates the resource name + # field. If omitted, this is assumed to be "name". + # @!attribute [rw] history + # @return [::Google::Api::ResourceDescriptor::History] + # Optional. The historical or future-looking state of the resource pattern. + # + # Example: + # + # // The InspectTemplate message originally only supported resource + # // names with organization, and project was added later. + # message InspectTemplate { + # option (google.api.resource) = { + # type: "dlp.googleapis.com/InspectTemplate" + # pattern: + # "organizations/{organization}/inspectTemplates/{inspect_template}" + # pattern: "projects/{project}/inspectTemplates/{inspect_template}" + # history: ORIGINALLY_SINGLE_PATTERN + # }; + # } + # @!attribute [rw] plural + # @return [::String] + # The plural name used in the resource name and permission names, such as + # 'projects' for the resource name of 'projects/\\{project}' and the permission + # name of 'cloudresourcemanager.googleapis.com/projects.get'. One exception + # to this is for Nested Collections that have stuttering names, as defined + # in [AIP-122](https://google.aip.dev/122#nested-collections), where the + # collection ID in the resource name pattern does not necessarily directly + # match the `plural` value. + # + # It is the same concept of the `plural` field in k8s CRD spec + # https://kubernetes.io/docs/tasks/access-kubernetes-api/custom-resources/custom-resource-definitions/ + # + # Note: The plural form is required even for singleton resources. See + # https://aip.dev/156 + # @!attribute [rw] singular + # @return [::String] + # The same concept of the `singular` field in k8s CRD spec + # https://kubernetes.io/docs/tasks/access-kubernetes-api/custom-resources/custom-resource-definitions/ + # Such as "project" for the `resourcemanager.googleapis.com/Project` type. + # @!attribute [rw] style + # @return [::Array<::Google::Api::ResourceDescriptor::Style>] + # Style flag(s) for this resource. + # These indicate that a resource is expected to conform to a given + # style. See the specific style flags for additional information. + class ResourceDescriptor + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # A description of the historical or future-looking state of the + # resource pattern. + module History + # The "unset" value. + HISTORY_UNSPECIFIED = 0 + + # The resource originally had one pattern and launched as such, and + # additional patterns were added later. + ORIGINALLY_SINGLE_PATTERN = 1 + + # The resource has one pattern, but the API owner expects to add more + # later. (This is the inverse of ORIGINALLY_SINGLE_PATTERN, and prevents + # that from being necessary once there are multiple patterns.) + FUTURE_MULTI_PATTERN = 2 + end + + # A flag representing a specific style that a resource claims to conform to. + module Style + # The unspecified value. Do not use. + STYLE_UNSPECIFIED = 0 + + # This resource is intended to be "declarative-friendly". + # + # Declarative-friendly resources must be more strictly consistent, and + # setting this to true communicates to tools that this resource should + # adhere to declarative-friendly expectations. + # + # Note: This is used by the API linter (linter.aip.dev) to enable + # additional checks. + DECLARATIVE_FRIENDLY = 1 + end + end + + # Defines a proto annotation that describes a string field that refers to + # an API resource. + # @!attribute [rw] type + # @return [::String] + # The resource type that the annotated field references. + # + # Example: + # + # message Subscription { + # string topic = 2 [(google.api.resource_reference) = { + # type: "pubsub.googleapis.com/Topic" + # }]; + # } + # + # Occasionally, a field may reference an arbitrary resource. In this case, + # APIs use the special value * in their resource reference. + # + # Example: + # + # message GetIamPolicyRequest { + # string resource = 2 [(google.api.resource_reference) = { + # type: "*" + # }]; + # } + # @!attribute [rw] child_type + # @return [::String] + # The resource type of a child collection that the annotated field + # references. This is useful for annotating the `parent` field that + # doesn't have a fixed resource type. + # + # Example: + # + # message ListLogEntriesRequest { + # string parent = 1 [(google.api.resource_reference) = { + # child_type: "logging.googleapis.com/LogEntry" + # }; + # } + class ResourceReference + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end +end diff --git a/owl-bot-staging/google-cloud-redis-cluster-v1beta1/proto_docs/google/cloud/redis/cluster/v1beta1/cloud_redis_cluster.rb b/owl-bot-staging/google-cloud-redis-cluster-v1beta1/proto_docs/google/cloud/redis/cluster/v1beta1/cloud_redis_cluster.rb new file mode 100644 index 000000000000..1a25774de845 --- /dev/null +++ b/owl-bot-staging/google-cloud-redis-cluster-v1beta1/proto_docs/google/cloud/redis/cluster/v1beta1/cloud_redis_cluster.rb @@ -0,0 +1,1301 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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 Redis + module Cluster + module V1beta1 + # Request for [CreateCluster][CloudRedis.CreateCluster]. + # @!attribute [rw] parent + # @return [::String] + # Required. The resource name of the cluster location using the form: + # `projects/{project_id}/locations/{location_id}` + # where `location_id` refers to a GCP region. + # @!attribute [rw] cluster_id + # @return [::String] + # Required. The logical name of the Redis cluster in the customer project + # with the following restrictions: + # + # * Must contain only lowercase letters, numbers, and hyphens. + # * Must start with a letter. + # * Must be between 1-63 characters. + # * Must end with a number or a letter. + # * Must be unique within the customer project / location + # @!attribute [rw] cluster + # @return [::Google::Cloud::Redis::Cluster::V1beta1::Cluster] + # Required. The cluster that is to be created. + # @!attribute [rw] request_id + # @return [::String] + # Idempotent request UUID. + class CreateClusterRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Request for [ListClusters][CloudRedis.ListClusters]. + # @!attribute [rw] parent + # @return [::String] + # Required. The resource name of the cluster location using the form: + # `projects/{project_id}/locations/{location_id}` + # where `location_id` refers to a GCP region. + # @!attribute [rw] page_size + # @return [::Integer] + # The maximum number of items to return. + # + # If not specified, a default value of 1000 will be used by the service. + # Regardless of the page_size value, the response may include a partial list + # and a caller should only rely on response's + # {::Google::Cloud::Redis::Cluster::V1beta1::ListClustersResponse#next_page_token `next_page_token`} + # to determine if there are more clusters left to be queried. + # @!attribute [rw] page_token + # @return [::String] + # The `next_page_token` value returned from a previous + # [ListClusters][CloudRedis.ListClusters] request, if any. + class ListClustersRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Response for [ListClusters][CloudRedis.ListClusters]. + # @!attribute [rw] clusters + # @return [::Array<::Google::Cloud::Redis::Cluster::V1beta1::Cluster>] + # A list of Redis clusters in the project in the specified location, + # or across all locations. + # + # If the `location_id` in the parent field of the request is "-", all regions + # available to the project are queried, and the results aggregated. + # If in such an aggregated query a location is unavailable, a placeholder + # Redis entry is included in the response with the `name` field set to a + # value of the form + # `projects/{project_id}/locations/{location_id}/clusters/`- and the + # `status` field set to ERROR and `status_message` field set to "location not + # available for ListClusters". + # @!attribute [rw] next_page_token + # @return [::String] + # Token to retrieve the next page of results, or empty if there are no more + # results in the list. + # @!attribute [rw] unreachable + # @return [::Array<::String>] + # Locations that could not be reached. + class ListClustersResponse + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Request for [UpdateCluster][CloudRedis.UpdateCluster]. + # @!attribute [rw] update_mask + # @return [::Google::Protobuf::FieldMask] + # Required. Mask of fields to update. At least one path must be supplied in + # this field. The elements of the repeated paths field may only include these + # fields from {::Google::Cloud::Redis::Cluster::V1beta1::Cluster Cluster}: + # + # * `size_gb` + # * `replica_count` + # @!attribute [rw] cluster + # @return [::Google::Cloud::Redis::Cluster::V1beta1::Cluster] + # Required. Update description. + # Only fields specified in update_mask are updated. + # @!attribute [rw] request_id + # @return [::String] + # Idempotent request UUID. + class UpdateClusterRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Request for [GetCluster][CloudRedis.GetCluster]. + # @!attribute [rw] name + # @return [::String] + # Required. Redis cluster resource name using the form: + # `projects/{project_id}/locations/{location_id}/clusters/{cluster_id}` + # where `location_id` refers to a GCP region. + class GetClusterRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Request for [DeleteCluster][CloudRedis.DeleteCluster]. + # @!attribute [rw] name + # @return [::String] + # Required. Redis cluster resource name using the form: + # `projects/{project_id}/locations/{location_id}/clusters/{cluster_id}` + # where `location_id` refers to a GCP region. + # @!attribute [rw] request_id + # @return [::String] + # Idempotent request UUID. + class DeleteClusterRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Request for + # [GetClusterCertificateAuthorityRequest][CloudRedis.GetClusterCertificateAuthorityRequest]. + # @!attribute [rw] name + # @return [::String] + # Required. Redis cluster certificate authority resource name using the form: + # `projects/{project_id}/locations/{location_id}/clusters/{cluster_id}/certificateAuthority` + # where `location_id` refers to a GCP region. + class GetClusterCertificateAuthorityRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Request for [ListBackupCollections] + # @!attribute [rw] parent + # @return [::String] + # Required. The resource name of the backupCollection location using the + # form: + # `projects/{project_id}/locations/{location_id}` + # where `location_id` refers to a GCP region. + # @!attribute [rw] page_size + # @return [::Integer] + # Optional. The maximum number of items to return. + # + # If not specified, a default value of 1000 will be used by the service. + # Regardless of the page_size value, the response may include a partial list + # and a caller should only rely on response's + # {::Google::Cloud::Redis::Cluster::V1beta1::ListBackupCollectionsResponse#next_page_token `next_page_token`} + # to determine if there are more clusters left to be queried. + # @!attribute [rw] page_token + # @return [::String] + # Optional. The `next_page_token` value returned from a previous + # [ListBackupCollections] request, if any. + class ListBackupCollectionsRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Response for [ListBackupCollections]. + # @!attribute [rw] backup_collections + # @return [::Array<::Google::Cloud::Redis::Cluster::V1beta1::BackupCollection>] + # A list of backupCollections in the project. + # + # If the `location_id` in the parent field of the request is "-", all regions + # available to the project are queried, and the results aggregated. + # If in such an aggregated query a location is unavailable, a placeholder + # backupCollection entry is included in the response with the `name` field + # set to a value of the form + # `projects/{project_id}/locations/{location_id}/backupCollections/`- and the + # `status` field set to ERROR and `status_message` field set to "location not + # available for ListBackupCollections". + # @!attribute [rw] next_page_token + # @return [::String] + # Token to retrieve the next page of results, or empty if there are no more + # results in the list. + # @!attribute [rw] unreachable + # @return [::Array<::String>] + # Locations that could not be reached. + class ListBackupCollectionsResponse + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Request for [GetBackupCollection]. + # @!attribute [rw] name + # @return [::String] + # Required. Redis backupCollection resource name using the form: + # `projects/{project_id}/locations/{location_id}/backupCollections/{backup_collection_id}` + # where `location_id` refers to a GCP region. + class GetBackupCollectionRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Request for [ListBackups]. + # @!attribute [rw] parent + # @return [::String] + # Required. The resource name of the backupCollection using the form: + # `projects/{project_id}/locations/{location_id}/backupCollections/{backup_collection_id}` + # @!attribute [rw] page_size + # @return [::Integer] + # Optional. The maximum number of items to return. + # + # If not specified, a default value of 1000 will be used by the service. + # Regardless of the page_size value, the response may include a partial list + # and a caller should only rely on response's + # {::Google::Cloud::Redis::Cluster::V1beta1::ListBackupsResponse#next_page_token `next_page_token`} + # to determine if there are more clusters left to be queried. + # @!attribute [rw] page_token + # @return [::String] + # Optional. The `next_page_token` value returned from a previous + # [ListBackupCollections] request, if any. + class ListBackupsRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Response for [ListBackups]. + # @!attribute [rw] backups + # @return [::Array<::Google::Cloud::Redis::Cluster::V1beta1::Backup>] + # A list of backups in the project. + # @!attribute [rw] next_page_token + # @return [::String] + # Token to retrieve the next page of results, or empty if there are no more + # results in the list. + # @!attribute [rw] unreachable + # @return [::Array<::String>] + # Backups that could not be reached. + class ListBackupsResponse + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Request for [GetBackup]. + # @!attribute [rw] name + # @return [::String] + # Required. Redis backup resource name using the form: + # `projects/{project_id}/locations/{location_id}/backupCollections/{backup_collection_id}/backups/{backup_id}` + class GetBackupRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Request for [DeleteBackup]. + # @!attribute [rw] name + # @return [::String] + # Required. Redis backup resource name using the form: + # `projects/{project_id}/locations/{location_id}/backupCollections/{backup_collection_id}/backups/{backup_id}` + # @!attribute [rw] request_id + # @return [::String] + # Optional. Idempotent request UUID. + class DeleteBackupRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Request for [ExportBackup]. + # @!attribute [rw] gcs_bucket + # @return [::String] + # Google Cloud Storage bucket, like "my-bucket". + # @!attribute [rw] name + # @return [::String] + # Required. Redis backup resource name using the form: + # `projects/{project_id}/locations/{location_id}/backupCollections/{backup_collection_id}/backups/{backup_id}` + class ExportBackupRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Request for [BackupCluster]. + # @!attribute [rw] name + # @return [::String] + # Required. Redis cluster resource name using the form: + # `projects/{project_id}/locations/{location_id}/clusters/{cluster_id}` + # where `location_id` refers to a GCP region. + # @!attribute [rw] ttl + # @return [::Google::Protobuf::Duration] + # Optional. TTL for the backup to expire. Value range is 1 day to 100 years. + # If not specified, the default value is 100 years. + # @!attribute [rw] backup_id + # @return [::String] + # Optional. The id of the backup to be created. If not specified, the + # default value ([YYYYMMDDHHMMSS]_[Shortened Cluster UID] is used. + class BackupClusterRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # A cluster instance. + # @!attribute [rw] gcs_source + # @return [::Google::Cloud::Redis::Cluster::V1beta1::Cluster::GcsBackupSource] + # Optional. Backups stored in Cloud Storage buckets. + # The Cloud Storage buckets need to be the same region as the clusters. + # Read permission is required to import from the provided Cloud Storage + # objects. + # + # Note: The following fields are mutually exclusive: `gcs_source`, `managed_backup_source`. If a field in that set is populated, all other fields in the set will automatically be cleared. + # @!attribute [rw] managed_backup_source + # @return [::Google::Cloud::Redis::Cluster::V1beta1::Cluster::ManagedBackupSource] + # Optional. Backups generated and managed by memorystore service. + # + # Note: The following fields are mutually exclusive: `managed_backup_source`, `gcs_source`. If a field in that set is populated, all other fields in the set will automatically be cleared. + # @!attribute [rw] name + # @return [::String] + # Required. Identifier. Unique name of the resource in this scope including + # project and location using the form: + # `projects/{project_id}/locations/{location_id}/clusters/{cluster_id}` + # @!attribute [r] create_time + # @return [::Google::Protobuf::Timestamp] + # Output only. The timestamp associated with the cluster creation request. + # @!attribute [r] state + # @return [::Google::Cloud::Redis::Cluster::V1beta1::Cluster::State] + # Output only. The current state of this cluster. + # Can be CREATING, READY, UPDATING, DELETING and SUSPENDED + # @!attribute [r] uid + # @return [::String] + # Output only. System assigned, unique identifier for the cluster. + # @!attribute [rw] replica_count + # @return [::Integer] + # Optional. The number of replica nodes per shard. + # @!attribute [rw] authorization_mode + # @return [::Google::Cloud::Redis::Cluster::V1beta1::AuthorizationMode] + # Optional. The authorization mode of the Redis cluster. + # If not provided, auth feature is disabled for the cluster. + # @!attribute [rw] transit_encryption_mode + # @return [::Google::Cloud::Redis::Cluster::V1beta1::TransitEncryptionMode] + # Optional. The in-transit encryption for the Redis cluster. + # If not provided, encryption is disabled for the cluster. + # @!attribute [r] size_gb + # @return [::Integer] + # Output only. Redis memory size in GB for the entire cluster rounded up to + # the next integer. + # @!attribute [rw] shard_count + # @return [::Integer] + # Optional. Number of shards for the Redis cluster. + # @!attribute [rw] psc_configs + # @return [::Array<::Google::Cloud::Redis::Cluster::V1beta1::PscConfig>] + # Optional. Each PscConfig configures the consumer network where IPs will + # be designated to the cluster for client access through Private Service + # Connect Automation. Currently, only one PscConfig is supported. + # @!attribute [r] discovery_endpoints + # @return [::Array<::Google::Cloud::Redis::Cluster::V1beta1::DiscoveryEndpoint>] + # Output only. Endpoints created on each given network, for Redis clients to + # connect to the cluster. Currently only one discovery endpoint is supported. + # @!attribute [r] psc_connections + # @return [::Array<::Google::Cloud::Redis::Cluster::V1beta1::PscConnection>] + # Output only. The list of PSC connections that are auto-created through + # service connectivity automation. + # @!attribute [r] state_info + # @return [::Google::Cloud::Redis::Cluster::V1beta1::Cluster::StateInfo] + # Output only. Additional information about the current state of the cluster. + # @!attribute [rw] node_type + # @return [::Google::Cloud::Redis::Cluster::V1beta1::NodeType] + # Optional. The type of a redis node in the cluster. NodeType determines the + # underlying machine-type of a redis node. + # @!attribute [rw] persistence_config + # @return [::Google::Cloud::Redis::Cluster::V1beta1::ClusterPersistenceConfig] + # Optional. Persistence config (RDB, AOF) for the cluster. + # @!attribute [rw] redis_configs + # @return [::Google::Protobuf::Map{::String => ::String}] + # Optional. Key/Value pairs of customer overrides for mutable Redis Configs + # @!attribute [r] precise_size_gb + # @return [::Float] + # Output only. Precise value of redis memory size in GB for the entire + # cluster. + # @!attribute [rw] zone_distribution_config + # @return [::Google::Cloud::Redis::Cluster::V1beta1::ZoneDistributionConfig] + # Optional. This config will be used to determine how the customer wants us + # to distribute cluster resources within the region. + # @!attribute [rw] cross_cluster_replication_config + # @return [::Google::Cloud::Redis::Cluster::V1beta1::CrossClusterReplicationConfig] + # Optional. Cross cluster replication config. + # @!attribute [rw] deletion_protection_enabled + # @return [::Boolean] + # Optional. The delete operation will fail when the value is set to true. + # @!attribute [rw] maintenance_policy + # @return [::Google::Cloud::Redis::Cluster::V1beta1::ClusterMaintenancePolicy] + # Optional. ClusterMaintenancePolicy determines when to allow or deny + # updates. + # @!attribute [r] maintenance_schedule + # @return [::Google::Cloud::Redis::Cluster::V1beta1::ClusterMaintenanceSchedule] + # Output only. ClusterMaintenanceSchedule Output only Published maintenance + # schedule. + # @!attribute [r] psc_service_attachments + # @return [::Array<::Google::Cloud::Redis::Cluster::V1beta1::PscServiceAttachment>] + # Output only. Service attachment details to configure Psc connections + # @!attribute [rw] cluster_endpoints + # @return [::Array<::Google::Cloud::Redis::Cluster::V1beta1::ClusterEndpoint>] + # Optional. A list of cluster enpoints. + # @!attribute [r] backup_collection + # @return [::String] + # Optional. Output only. The backup collection full resource name. Example: + # projects/\\{project}/locations/\\{location}/backupCollections/\\{collection} + # @!attribute [rw] kms_key + # @return [::String] + # Optional. The KMS key used to encrypt the at-rest data of the cluster. + # @!attribute [rw] automated_backup_config + # @return [::Google::Cloud::Redis::Cluster::V1beta1::AutomatedBackupConfig] + # Optional. The automated backup config for the cluster. + # @!attribute [r] encryption_info + # @return [::Google::Cloud::Redis::Cluster::V1beta1::EncryptionInfo] + # Output only. Encryption information of the data at rest of the cluster. + class Cluster + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # Represents additional information about the state of the cluster. + # @!attribute [rw] update_info + # @return [::Google::Cloud::Redis::Cluster::V1beta1::Cluster::StateInfo::UpdateInfo] + # Describes ongoing update on the cluster when cluster state is UPDATING. + class StateInfo + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # Represents information about an updating cluster. + # @!attribute [rw] target_shard_count + # @return [::Integer] + # Target number of shards for redis cluster + # @!attribute [rw] target_replica_count + # @return [::Integer] + # Target number of replica nodes per shard. + class UpdateInfo + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end + + # Backups stored in Cloud Storage buckets. + # The Cloud Storage buckets need to be the same region as the clusters. + # @!attribute [rw] uris + # @return [::Array<::String>] + # Optional. URIs of the GCS objects to import. + # Example: gs://bucket1/object1, gs://bucket2/folder2/object2 + class GcsBackupSource + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Backups that generated and managed by memorystore. + # @!attribute [rw] backup + # @return [::String] + # Optional. Example: + # //redis.googleapis.com/projects/\\{project}/locations/\\{location}/backupCollections/\\{collection}/backups/\\{backup} + # A shorter version (without the prefix) of the backup name is also + # supported, like + # projects/\\{project}/locations/\\{location}/backupCollections/\\{collection}/backups/\\{backup_id} + # In this case, it assumes the backup is under redis.googleapis.com. + class ManagedBackupSource + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # @!attribute [rw] key + # @return [::String] + # @!attribute [rw] value + # @return [::String] + class RedisConfigsEntry + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Represents the different states of a Redis cluster. + module State + # Not set. + STATE_UNSPECIFIED = 0 + + # Redis cluster is being created. + CREATING = 1 + + # Redis cluster has been created and is fully usable. + ACTIVE = 2 + + # Redis cluster configuration is being updated. + UPDATING = 3 + + # Redis cluster is being deleted. + DELETING = 4 + end + end + + # The automated backup config for a cluster. + # @!attribute [rw] fixed_frequency_schedule + # @return [::Google::Cloud::Redis::Cluster::V1beta1::AutomatedBackupConfig::FixedFrequencySchedule] + # Optional. Trigger automated backups at a fixed frequency. + # @!attribute [rw] automated_backup_mode + # @return [::Google::Cloud::Redis::Cluster::V1beta1::AutomatedBackupConfig::AutomatedBackupMode] + # Optional. The automated backup mode. If the mode is disabled, the other + # fields will be ignored. + # @!attribute [rw] retention + # @return [::Google::Protobuf::Duration] + # Optional. How long to keep automated backups before the backups are + # deleted. The value should be between 1 day and 365 days. If not specified, + # the default value is 35 days. + class AutomatedBackupConfig + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # This schedule allows the backup to be triggered at a fixed frequency + # (currently only daily is supported). + # @!attribute [rw] start_time + # @return [::Google::Type::TimeOfDay] + # Required. The start time of every automated backup in UTC. It must be set + # to the start of an hour. This field is required. + class FixedFrequencySchedule + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # The automated backup mode. + module AutomatedBackupMode + # Default value. Automated backup config is not specified. + AUTOMATED_BACKUP_MODE_UNSPECIFIED = 0 + + # Automated backup config disabled. + DISABLED = 1 + + # Automated backup config enabled. + ENABLED = 2 + end + end + + # BackupCollection of a cluster. + # @!attribute [rw] name + # @return [::String] + # Identifier. Full resource path of the backup collection. + # @!attribute [r] cluster_uid + # @return [::String] + # Output only. The cluster uid of the backup collection. + # @!attribute [r] cluster + # @return [::String] + # Output only. The full resource path of the cluster the backup collection + # belongs to. Example: + # projects/\\{project}/locations/\\{location}/clusters/\\{cluster} + # @!attribute [r] kms_key + # @return [::String] + # Output only. The KMS key used to encrypt the backups under this backup + # collection. + # @!attribute [r] uid + # @return [::String] + # Output only. System assigned unique identifier of the backup collection. + class BackupCollection + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Backup of a cluster. + # @!attribute [rw] name + # @return [::String] + # Identifier. Full resource path of the backup. the last part of the name is + # the backup id with the following format: [YYYYMMDDHHMMSS]_[Shorted Cluster + # UID] OR customer specified while backup cluster. Example: + # 20240515123000_1234 + # @!attribute [r] create_time + # @return [::Google::Protobuf::Timestamp] + # Output only. The time when the backup was created. + # @!attribute [r] cluster + # @return [::String] + # Output only. Cluster resource path of this backup. + # @!attribute [r] cluster_uid + # @return [::String] + # Output only. Cluster uid of this backup. + # @!attribute [r] total_size_bytes + # @return [::Integer] + # Output only. Total size of the backup in bytes. + # @!attribute [r] expire_time + # @return [::Google::Protobuf::Timestamp] + # Output only. The time when the backup will expire. + # @!attribute [r] engine_version + # @return [::String] + # Output only. redis-7.2, valkey-7.5 + # @!attribute [r] backup_files + # @return [::Array<::Google::Cloud::Redis::Cluster::V1beta1::BackupFile>] + # Output only. List of backup files of the backup. + # @!attribute [r] node_type + # @return [::Google::Cloud::Redis::Cluster::V1beta1::NodeType] + # Output only. Node type of the cluster. + # @!attribute [r] replica_count + # @return [::Integer] + # Output only. Number of replicas for the cluster. + # @!attribute [r] shard_count + # @return [::Integer] + # Output only. Number of shards for the cluster. + # @!attribute [r] backup_type + # @return [::Google::Cloud::Redis::Cluster::V1beta1::Backup::BackupType] + # Output only. Type of the backup. + # @!attribute [r] state + # @return [::Google::Cloud::Redis::Cluster::V1beta1::Backup::State] + # Output only. State of the backup. + # @!attribute [r] encryption_info + # @return [::Google::Cloud::Redis::Cluster::V1beta1::EncryptionInfo] + # Output only. Encryption information of the backup. + # @!attribute [r] uid + # @return [::String] + # Output only. System assigned unique identifier of the backup. + class Backup + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # Type of the backup. + module BackupType + # The default value, not set. + BACKUP_TYPE_UNSPECIFIED = 0 + + # On-demand backup. + ON_DEMAND = 1 + + # Automated backup. + AUTOMATED = 2 + end + + # State of the backup. + module State + # The default value, not set. + STATE_UNSPECIFIED = 0 + + # The backup is being created. + CREATING = 1 + + # The backup is active to be used. + ACTIVE = 2 + + # The backup is being deleted. + DELETING = 3 + + # The backup is currently suspended due to reasons like project deletion, + # billing account closure, etc. + SUSPENDED = 4 + end + end + + # Backup is consisted of multiple backup files. + # @!attribute [r] file_name + # @return [::String] + # Output only. e.g: .rdb + # @!attribute [r] size_bytes + # @return [::Integer] + # Output only. Size of the backup file in bytes. + # @!attribute [r] create_time + # @return [::Google::Protobuf::Timestamp] + # Output only. The time when the backup file was created. + class BackupFile + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Configuration of a service attachment of the cluster, for creating PSC + # connections. + # @!attribute [r] service_attachment + # @return [::String] + # Output only. Service attachment URI which your self-created PscConnection + # should use as target + # @!attribute [r] connection_type + # @return [::Google::Cloud::Redis::Cluster::V1beta1::ConnectionType] + # Output only. Type of a PSC connection targeting this service attachment. + class PscServiceAttachment + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Cross cluster replication config. + # @!attribute [rw] cluster_role + # @return [::Google::Cloud::Redis::Cluster::V1beta1::CrossClusterReplicationConfig::ClusterRole] + # The role of the cluster in cross cluster replication. + # @!attribute [rw] primary_cluster + # @return [::Google::Cloud::Redis::Cluster::V1beta1::CrossClusterReplicationConfig::RemoteCluster] + # Details of the primary cluster that is used as the replication source for + # this secondary cluster. + # + # This field is only set for a secondary cluster. + # @!attribute [rw] secondary_clusters + # @return [::Array<::Google::Cloud::Redis::Cluster::V1beta1::CrossClusterReplicationConfig::RemoteCluster>] + # List of secondary clusters that are replicating from this primary cluster. + # + # This field is only set for a primary cluster. + # @!attribute [r] update_time + # @return [::Google::Protobuf::Timestamp] + # Output only. The last time cross cluster replication config was updated. + # @!attribute [r] membership + # @return [::Google::Cloud::Redis::Cluster::V1beta1::CrossClusterReplicationConfig::Membership] + # Output only. An output only view of all the member clusters participating + # in the cross cluster replication. This view will be provided by every + # member cluster irrespective of its cluster role(primary or secondary). + # + # A primary cluster can provide information about all the secondary clusters + # replicating from it. However, a secondary cluster only knows about the + # primary cluster from which it is replicating. However, for scenarios, where + # the primary cluster is unavailable(e.g. regional outage), a GetCluster + # request can be sent to any other member cluster and this field will list + # all the member clusters participating in cross cluster replication. + class CrossClusterReplicationConfig + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # Details of the remote cluster associated with this cluster in a cross + # cluster replication setup. + # @!attribute [rw] cluster + # @return [::String] + # The full resource path of the remote cluster in + # the format: projects//locations//clusters/ + # @!attribute [r] uid + # @return [::String] + # Output only. The unique identifier of the remote cluster. + class RemoteCluster + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # An output only view of all the member clusters participating in the cross + # cluster replication. + # @!attribute [r] primary_cluster + # @return [::Google::Cloud::Redis::Cluster::V1beta1::CrossClusterReplicationConfig::RemoteCluster] + # Output only. The primary cluster that acts as the source of replication + # for the secondary clusters. + # @!attribute [r] secondary_clusters + # @return [::Array<::Google::Cloud::Redis::Cluster::V1beta1::CrossClusterReplicationConfig::RemoteCluster>] + # Output only. The list of secondary clusters replicating from the primary + # cluster. + class Membership + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # The role of the cluster in cross cluster replication. + module ClusterRole + # Cluster role is not set. + # The behavior is equivalent to NONE. + CLUSTER_ROLE_UNSPECIFIED = 0 + + # This cluster does not participate in cross cluster replication. It is an + # independent cluster and does not replicate to or from any other clusters. + NONE = 1 + + # A cluster that allows both reads and writes. Any data written to this + # cluster is also replicated to the attached secondary clusters. + PRIMARY = 2 + + # A cluster that allows only reads and replicates data from a primary + # cluster. + SECONDARY = 3 + end + end + + # Maintenance policy per cluster. + # @!attribute [r] create_time + # @return [::Google::Protobuf::Timestamp] + # Output only. The time when the policy was created i.e. Maintenance Window + # or Deny Period was assigned. + # @!attribute [r] update_time + # @return [::Google::Protobuf::Timestamp] + # Output only. The time when the policy was updated i.e. Maintenance Window + # or Deny Period was updated. + # @!attribute [rw] weekly_maintenance_window + # @return [::Array<::Google::Cloud::Redis::Cluster::V1beta1::ClusterWeeklyMaintenanceWindow>] + # Optional. Maintenance window that is applied to resources covered by this + # policy. Minimum 1. For the current version, the maximum number of + # weekly_maintenance_window is expected to be one. + class ClusterMaintenancePolicy + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Time window specified for weekly operations. + # @!attribute [rw] day + # @return [::Google::Type::DayOfWeek] + # Allows to define schedule that runs specified day of the week. + # @!attribute [rw] start_time + # @return [::Google::Type::TimeOfDay] + # Start time of the window in UTC. + class ClusterWeeklyMaintenanceWindow + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Upcoming maitenance schedule. + # @!attribute [r] start_time + # @return [::Google::Protobuf::Timestamp] + # Output only. The start time of any upcoming scheduled maintenance for this + # instance. + # @!attribute [r] end_time + # @return [::Google::Protobuf::Timestamp] + # Output only. The end time of any upcoming scheduled maintenance for this + # instance. + class ClusterMaintenanceSchedule + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # @!attribute [rw] network + # @return [::String] + # Required. The network where the IP address of the discovery endpoint will + # be reserved, in the form of + # projects/\\{network_project}/global/networks/\\{network_id}. + class PscConfig + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Endpoints on each network, for Redis clients to connect to the cluster. + # @!attribute [r] address + # @return [::String] + # Output only. Address of the exposed Redis endpoint used by clients to + # connect to the service. The address could be either IP or hostname. + # @!attribute [r] port + # @return [::Integer] + # Output only. The port number of the exposed Redis endpoint. + # @!attribute [r] psc_config + # @return [::Google::Cloud::Redis::Cluster::V1beta1::PscConfig] + # Output only. Customer configuration for where the endpoint is created and + # accessed from. + class DiscoveryEndpoint + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Details of consumer resources in a PSC connection. + # @!attribute [rw] psc_connection_id + # @return [::String] + # Required. The PSC connection id of the forwarding rule connected to the + # service attachment. + # @!attribute [rw] address + # @return [::String] + # Required. The IP allocated on the consumer network for the PSC forwarding + # rule. + # @!attribute [rw] forwarding_rule + # @return [::String] + # Required. The URI of the consumer side forwarding rule. + # Example: + # projects/\\{projectNumOrId}/regions/us-east1/forwardingRules/\\{resourceId}. + # @!attribute [rw] project_id + # @return [::String] + # Optional. Project ID of the consumer project where the forwarding rule is + # created in. + # @!attribute [rw] network + # @return [::String] + # Required. The consumer network where the IP address resides, in the form of + # projects/\\{project_id}/global/networks/\\{network_id}. + # @!attribute [rw] service_attachment + # @return [::String] + # Required. The service attachment which is the target of the PSC connection, + # in the form of + # projects/\\{project-id}/regions/\\{region}/serviceAttachments/\\{service-attachment-id}. + # @!attribute [r] psc_connection_status + # @return [::Google::Cloud::Redis::Cluster::V1beta1::PscConnectionStatus] + # Output only. The status of the PSC connection. + # Please note that this value is updated periodically. + # To get the latest status of a PSC connection, follow + # https://cloud.google.com/vpc/docs/configure-private-service-connect-services#endpoint-details. + # @!attribute [r] connection_type + # @return [::Google::Cloud::Redis::Cluster::V1beta1::ConnectionType] + # Output only. Type of the PSC connection. + class PscConnection + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # ClusterEndpoint consists of PSC connections that are created + # as a group in each VPC network for accessing the cluster. In each group, + # there shall be one connection for each service attachment in the cluster. + # @!attribute [rw] connections + # @return [::Array<::Google::Cloud::Redis::Cluster::V1beta1::ConnectionDetail>] + # A group of PSC connections. They are created in the same VPC network, one + # for each service attachment in the cluster. + class ClusterEndpoint + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Detailed information of each PSC connection. + # @!attribute [rw] psc_auto_connection + # @return [::Google::Cloud::Redis::Cluster::V1beta1::PscAutoConnection] + # Detailed information of a PSC connection that is created through + # service connectivity automation. + # + # Note: The following fields are mutually exclusive: `psc_auto_connection`, `psc_connection`. If a field in that set is populated, all other fields in the set will automatically be cleared. + # @!attribute [rw] psc_connection + # @return [::Google::Cloud::Redis::Cluster::V1beta1::PscConnection] + # Detailed information of a PSC connection that is created by the customer + # who owns the cluster. + # + # Note: The following fields are mutually exclusive: `psc_connection`, `psc_auto_connection`. If a field in that set is populated, all other fields in the set will automatically be cleared. + class ConnectionDetail + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Details of consumer resources in a PSC connection that is created through + # Service Connectivity Automation. + # @!attribute [r] psc_connection_id + # @return [::String] + # Output only. The PSC connection id of the forwarding rule connected to the + # service attachment. + # @!attribute [r] address + # @return [::String] + # Output only. The IP allocated on the consumer network for the PSC + # forwarding rule. + # @!attribute [r] forwarding_rule + # @return [::String] + # Output only. The URI of the consumer side forwarding rule. + # Example: + # projects/\\{projectNumOrId}/regions/us-east1/forwardingRules/\\{resourceId}. + # @!attribute [rw] project_id + # @return [::String] + # Required. The consumer project_id where the forwarding rule is created + # from. + # @!attribute [rw] network + # @return [::String] + # Required. The consumer network where the IP address resides, in the form of + # projects/\\{project_id}/global/networks/\\{network_id}. + # @!attribute [r] service_attachment + # @return [::String] + # Output only. The service attachment which is the target of the PSC + # connection, in the form of + # projects/\\{project-id}/regions/\\{region}/serviceAttachments/\\{service-attachment-id}. + # @!attribute [r] psc_connection_status + # @return [::Google::Cloud::Redis::Cluster::V1beta1::PscConnectionStatus] + # Output only. The status of the PSC connection. + # Please note that this value is updated periodically. + # Please use Private Service Connect APIs for the latest status. + # @!attribute [r] connection_type + # @return [::Google::Cloud::Redis::Cluster::V1beta1::ConnectionType] + # Output only. Type of the PSC connection. + class PscAutoConnection + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Pre-defined metadata fields. + # @!attribute [r] create_time + # @return [::Google::Protobuf::Timestamp] + # Output only. The time the operation was created. + # @!attribute [r] end_time + # @return [::Google::Protobuf::Timestamp] + # Output only. The time the operation finished running. + # @!attribute [r] target + # @return [::String] + # Output only. Server-defined resource path for the target of the operation. + # @!attribute [r] verb + # @return [::String] + # Output only. Name of the verb executed by the operation. + # @!attribute [r] status_message + # @return [::String] + # Output only. Human-readable status of the operation, if any. + # @!attribute [r] requested_cancellation + # @return [::Boolean] + # Output only. Identifies whether the user has requested cancellation + # of the operation. Operations that have successfully been cancelled + # have [Operation.error][] value with a + # {::Google::Rpc::Status#code google.rpc.Status.code} of 1, corresponding to + # `Code.CANCELLED`. + # @!attribute [r] api_version + # @return [::String] + # Output only. API version used to start the operation. + class OperationMetadata + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Redis cluster certificate authority + # @!attribute [rw] managed_server_ca + # @return [::Google::Cloud::Redis::Cluster::V1beta1::CertificateAuthority::ManagedCertificateAuthority] + # @!attribute [rw] name + # @return [::String] + # Identifier. Unique name of the resource in this scope including project, + # location and cluster using the form: + # `projects/{project}/locations/{location}/clusters/{cluster}/certificateAuthority` + class CertificateAuthority + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # @!attribute [rw] ca_certs + # @return [::Array<::Google::Cloud::Redis::Cluster::V1beta1::CertificateAuthority::ManagedCertificateAuthority::CertChain>] + # The PEM encoded CA certificate chains for redis managed + # server authentication + class ManagedCertificateAuthority + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # @!attribute [rw] certificates + # @return [::Array<::String>] + # The certificates that form the CA chain, from leaf to root order. + class CertChain + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end + end + + # Configuration of the persistence functionality. + # @!attribute [rw] mode + # @return [::Google::Cloud::Redis::Cluster::V1beta1::ClusterPersistenceConfig::PersistenceMode] + # Optional. The mode of persistence. + # @!attribute [rw] rdb_config + # @return [::Google::Cloud::Redis::Cluster::V1beta1::ClusterPersistenceConfig::RDBConfig] + # Optional. RDB configuration. This field will be ignored if mode is not RDB. + # @!attribute [rw] aof_config + # @return [::Google::Cloud::Redis::Cluster::V1beta1::ClusterPersistenceConfig::AOFConfig] + # Optional. AOF configuration. This field will be ignored if mode is not AOF. + class ClusterPersistenceConfig + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # Configuration of the RDB based persistence. + # @!attribute [rw] rdb_snapshot_period + # @return [::Google::Cloud::Redis::Cluster::V1beta1::ClusterPersistenceConfig::RDBConfig::SnapshotPeriod] + # Optional. Period between RDB snapshots. + # @!attribute [rw] rdb_snapshot_start_time + # @return [::Google::Protobuf::Timestamp] + # Optional. The time that the first snapshot was/will be attempted, and to + # which future snapshots will be aligned. If not provided, the current time + # will be used. + class RDBConfig + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # Available snapshot periods. + module SnapshotPeriod + # Not set. + SNAPSHOT_PERIOD_UNSPECIFIED = 0 + + # One hour. + ONE_HOUR = 1 + + # Six hours. + SIX_HOURS = 2 + + # Twelve hours. + TWELVE_HOURS = 3 + + # Twenty four hours. + TWENTY_FOUR_HOURS = 4 + end + end + + # Configuration of the AOF based persistence. + # @!attribute [rw] append_fsync + # @return [::Google::Cloud::Redis::Cluster::V1beta1::ClusterPersistenceConfig::AOFConfig::AppendFsync] + # Optional. fsync configuration. + class AOFConfig + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # Available fsync modes. + module AppendFsync + # Not set. Default: EVERYSEC + APPEND_FSYNC_UNSPECIFIED = 0 + + # Never fsync. Normally Linux will flush data every 30 seconds with this + # configuration, but it's up to the kernel's exact tuning. + NO = 1 + + # fsync every second. Fast enough, and you may lose 1 second of data if + # there is a disaster + EVERYSEC = 2 + + # fsync every time new write commands are appended to the AOF. It has the + # best data loss protection at the cost of performance + ALWAYS = 3 + end + end + + # Available persistence modes. + module PersistenceMode + # Not set. + PERSISTENCE_MODE_UNSPECIFIED = 0 + + # Persistence is disabled, and any snapshot data is deleted. + DISABLED = 1 + + # RDB based persistence is enabled. + RDB = 2 + + # AOF based persistence is enabled. + AOF = 3 + end + end + + # Zone distribution config for allocation of cluster resources. + # @!attribute [rw] mode + # @return [::Google::Cloud::Redis::Cluster::V1beta1::ZoneDistributionConfig::ZoneDistributionMode] + # Optional. The mode of zone distribution. Defaults to MULTI_ZONE, when not + # specified. + # @!attribute [rw] zone + # @return [::String] + # Optional. When SINGLE ZONE distribution is selected, zone field would be + # used to allocate all resources in that zone. This is not applicable to + # MULTI_ZONE, and would be ignored for MULTI_ZONE clusters. + class ZoneDistributionConfig + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # Defines various modes of zone distribution. + module ZoneDistributionMode + # Not Set. Default: MULTI_ZONE + ZONE_DISTRIBUTION_MODE_UNSPECIFIED = 0 + + # Distribute all resources across 3 zones picked at random, within the + # region. + MULTI_ZONE = 1 + + # Distribute all resources in a single zone. The zone field must be + # specified, when this mode is selected. + SINGLE_ZONE = 2 + end + end + + # Request for rescheduling a cluster maintenance. + # @!attribute [rw] name + # @return [::String] + # Required. Redis Cluster instance resource name using the form: + # `projects/{project_id}/locations/{location_id}/clusters/{cluster_id}` + # where `location_id` refers to a GCP region. + # @!attribute [rw] reschedule_type + # @return [::Google::Cloud::Redis::Cluster::V1beta1::RescheduleClusterMaintenanceRequest::RescheduleType] + # Required. If reschedule type is SPECIFIC_TIME, must set up schedule_time as + # well. + # @!attribute [rw] schedule_time + # @return [::Google::Protobuf::Timestamp] + # Optional. Timestamp when the maintenance shall be rescheduled to if + # reschedule_type=SPECIFIC_TIME, in RFC 3339 format, for + # example `2012-11-15T16:19:00.094Z`. + class RescheduleClusterMaintenanceRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # Reschedule options. + module RescheduleType + # Not set. + RESCHEDULE_TYPE_UNSPECIFIED = 0 + + # If the user wants to schedule the maintenance to happen now. + IMMEDIATE = 1 + + # If the user wants to reschedule the maintenance to a specific time. + SPECIFIC_TIME = 3 + end + end + + # EncryptionInfo describes the encryption information of a cluster or a backup. + # @!attribute [r] encryption_type + # @return [::Google::Cloud::Redis::Cluster::V1beta1::EncryptionInfo::Type] + # Output only. Type of encryption. + # @!attribute [r] kms_key_versions + # @return [::Array<::String>] + # Output only. KMS key versions that are being used to protect the data + # at-rest. + # @!attribute [r] kms_key_primary_state + # @return [::Google::Cloud::Redis::Cluster::V1beta1::EncryptionInfo::KmsKeyState] + # Output only. The state of the primary version of the KMS key perceived by + # the system. This field is not populated in backups. + # @!attribute [r] last_update_time + # @return [::Google::Protobuf::Timestamp] + # Output only. The most recent time when the encryption info was updated. + class EncryptionInfo + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # Possible encryption types. + module Type + # Encryption type not specified. Defaults to GOOGLE_DEFAULT_ENCRYPTION. + TYPE_UNSPECIFIED = 0 + + # The data is encrypted at rest with a key that is fully managed by Google. + # No key version will be populated. This is the default state. + GOOGLE_DEFAULT_ENCRYPTION = 1 + + # The data is encrypted at rest with a key that is managed by the customer. + # KMS key versions will be populated. + CUSTOMER_MANAGED_ENCRYPTION = 2 + end + + # The state of the KMS key perceived by the system. Refer to the public + # documentation for the impact of each state. + module KmsKeyState + # The default value. This value is unused. + KMS_KEY_STATE_UNSPECIFIED = 0 + + # The KMS key is enabled and correctly configured. + ENABLED = 1 + + # Permission denied on the KMS key. + PERMISSION_DENIED = 2 + + # The KMS key is disabled. + DISABLED = 3 + + # The KMS key is destroyed. + DESTROYED = 4 + + # The KMS key is scheduled to be destroyed. + DESTROY_SCHEDULED = 5 + + # The EKM key is unreachable. + EKM_KEY_UNREACHABLE_DETECTED = 6 + + # Billing is disabled for the project. + BILLING_DISABLED = 7 + + # All other unknown failures. + UNKNOWN_FAILURE = 8 + end + end + + # Status of the PSC connection. + module PscConnectionStatus + # PSC connection status is not specified. + PSC_CONNECTION_STATUS_UNSPECIFIED = 0 + + # The connection is active + PSC_CONNECTION_STATUS_ACTIVE = 1 + + # Connection not found + PSC_CONNECTION_STATUS_NOT_FOUND = 2 + end + + # Available authorization mode of a Redis cluster. + module AuthorizationMode + # Not set. + AUTH_MODE_UNSPECIFIED = 0 + + # IAM basic authorization mode + AUTH_MODE_IAM_AUTH = 1 + + # Authorization disabled mode + AUTH_MODE_DISABLED = 2 + end + + # NodeType of a redis cluster node, + module NodeType + # Node type unspecified + NODE_TYPE_UNSPECIFIED = 0 + + # Redis shared core nano node_type. + REDIS_SHARED_CORE_NANO = 1 + + # Redis highmem medium node_type. + REDIS_HIGHMEM_MEDIUM = 2 + + # Redis highmem xlarge node_type. + REDIS_HIGHMEM_XLARGE = 3 + + # Redis standard small node_type. + REDIS_STANDARD_SMALL = 4 + end + + # Available mode of in-transit encryption. + module TransitEncryptionMode + # In-transit encryption not set. + TRANSIT_ENCRYPTION_MODE_UNSPECIFIED = 0 + + # In-transit encryption disabled. + TRANSIT_ENCRYPTION_MODE_DISABLED = 1 + + # Use server managed encryption for in-transit encryption. + TRANSIT_ENCRYPTION_MODE_SERVER_AUTHENTICATION = 2 + end + + # Type of a PSC connection, for cluster access purpose. + module ConnectionType + # Cluster endpoint Type is not set + CONNECTION_TYPE_UNSPECIFIED = 0 + + # Cluster endpoint that will be used as for cluster topology discovery. + CONNECTION_TYPE_DISCOVERY = 1 + + # Cluster endpoint that will be used as primary endpoint to access primary. + CONNECTION_TYPE_PRIMARY = 2 + + # Cluster endpoint that will be used as reader endpoint to access replicas. + CONNECTION_TYPE_READER = 3 + end + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-redis-cluster-v1beta1/proto_docs/google/longrunning/operations.rb b/owl-bot-staging/google-cloud-redis-cluster-v1beta1/proto_docs/google/longrunning/operations.rb new file mode 100644 index 000000000000..7a757f512165 --- /dev/null +++ b/owl-bot-staging/google-cloud-redis-cluster-v1beta1/proto_docs/google/longrunning/operations.rb @@ -0,0 +1,191 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + + +module Google + module Longrunning + # This resource represents a long-running operation that is the result of a + # network API call. + # @!attribute [rw] name + # @return [::String] + # The server-assigned name, which is only unique within the same service that + # originally returns it. If you use the default HTTP mapping, the + # `name` should be a resource name ending with `operations/{unique_id}`. + # @!attribute [rw] metadata + # @return [::Google::Protobuf::Any] + # Service-specific metadata associated with the operation. It typically + # contains progress information and common metadata such as create time. + # Some services might not provide such metadata. Any method that returns a + # long-running operation should document the metadata type, if any. + # @!attribute [rw] done + # @return [::Boolean] + # If the value is `false`, it means the operation is still in progress. + # If `true`, the operation is completed, and either `error` or `response` is + # available. + # @!attribute [rw] error + # @return [::Google::Rpc::Status] + # The error result of the operation in case of failure or cancellation. + # + # Note: The following fields are mutually exclusive: `error`, `response`. If a field in that set is populated, all other fields in the set will automatically be cleared. + # @!attribute [rw] response + # @return [::Google::Protobuf::Any] + # The normal, successful response of the operation. If the original + # method returns no data on success, such as `Delete`, the response is + # `google.protobuf.Empty`. If the original method is standard + # `Get`/`Create`/`Update`, the response should be the resource. For other + # methods, the response should have the type `XxxResponse`, where `Xxx` + # is the original method name. For example, if the original method name + # is `TakeSnapshot()`, the inferred response type is + # `TakeSnapshotResponse`. + # + # Note: The following fields are mutually exclusive: `response`, `error`. If a field in that set is populated, all other fields in the set will automatically be cleared. + class Operation + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # The request message for + # Operations.GetOperation. + # @!attribute [rw] name + # @return [::String] + # The name of the operation resource. + class GetOperationRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # The request message for + # Operations.ListOperations. + # @!attribute [rw] name + # @return [::String] + # The name of the operation's parent resource. + # @!attribute [rw] filter + # @return [::String] + # The standard list filter. + # @!attribute [rw] page_size + # @return [::Integer] + # The standard list page size. + # @!attribute [rw] page_token + # @return [::String] + # The standard list page token. + # @!attribute [rw] return_partial_success + # @return [::Boolean] + # When set to `true`, operations that are reachable are returned as normal, + # and those that are unreachable are returned in the + # [ListOperationsResponse.unreachable] field. + # + # This can only be `true` when reading across collections e.g. when `parent` + # is set to `"projects/example/locations/-"`. + # + # This field is not by default supported and will result in an + # `UNIMPLEMENTED` error if set unless explicitly documented otherwise in + # service or product specific documentation. + class ListOperationsRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # The response message for + # Operations.ListOperations. + # @!attribute [rw] operations + # @return [::Array<::Google::Longrunning::Operation>] + # A list of operations that matches the specified filter in the request. + # @!attribute [rw] next_page_token + # @return [::String] + # The standard List next-page token. + # @!attribute [rw] unreachable + # @return [::Array<::String>] + # Unordered list. Unreachable resources. Populated when the request sets + # `ListOperationsRequest.return_partial_success` and reads across + # collections e.g. when attempting to list all resources across all supported + # locations. + class ListOperationsResponse + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # The request message for + # Operations.CancelOperation. + # @!attribute [rw] name + # @return [::String] + # The name of the operation resource to be cancelled. + class CancelOperationRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # The request message for + # Operations.DeleteOperation. + # @!attribute [rw] name + # @return [::String] + # The name of the operation resource to be deleted. + class DeleteOperationRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # The request message for + # Operations.WaitOperation. + # @!attribute [rw] name + # @return [::String] + # The name of the operation resource to wait on. + # @!attribute [rw] timeout + # @return [::Google::Protobuf::Duration] + # The maximum duration to wait before timing out. If left blank, the wait + # will be at most the time permitted by the underlying HTTP/RPC protocol. + # If RPC context deadline is also specified, the shorter one will be used. + class WaitOperationRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # A message representing the message types used by a long-running operation. + # + # Example: + # + # rpc Export(ExportRequest) returns (google.longrunning.Operation) { + # option (google.longrunning.operation_info) = { + # response_type: "ExportResponse" + # metadata_type: "ExportMetadata" + # }; + # } + # @!attribute [rw] response_type + # @return [::String] + # Required. The message name of the primary return type for this + # long-running operation. + # This type will be used to deserialize the LRO's response. + # + # If the response is in a different package from the rpc, a fully-qualified + # message name must be used (e.g. `google.protobuf.Struct`). + # + # Note: Altering this value constitutes a breaking change. + # @!attribute [rw] metadata_type + # @return [::String] + # Required. The message name of the metadata type for this long-running + # operation. + # + # If the response is in a different package from the rpc, a fully-qualified + # message name must be used (e.g. `google.protobuf.Struct`). + # + # Note: Altering this value constitutes a breaking change. + class OperationInfo + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end +end diff --git a/owl-bot-staging/google-cloud-redis-cluster-v1beta1/proto_docs/google/protobuf/any.rb b/owl-bot-staging/google-cloud-redis-cluster-v1beta1/proto_docs/google/protobuf/any.rb new file mode 100644 index 000000000000..58691995f02e --- /dev/null +++ b/owl-bot-staging/google-cloud-redis-cluster-v1beta1/proto_docs/google/protobuf/any.rb @@ -0,0 +1,145 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + + +module Google + module Protobuf + # `Any` contains an arbitrary serialized protocol buffer message along with a + # URL that describes the type of the serialized message. + # + # Protobuf library provides support to pack/unpack Any values in the form + # of utility functions or additional generated methods of the Any type. + # + # Example 1: Pack and unpack a message in C++. + # + # Foo foo = ...; + # Any any; + # any.PackFrom(foo); + # ... + # if (any.UnpackTo(&foo)) { + # ... + # } + # + # Example 2: Pack and unpack a message in Java. + # + # Foo foo = ...; + # Any any = Any.pack(foo); + # ... + # if (any.is(Foo.class)) { + # foo = any.unpack(Foo.class); + # } + # // or ... + # if (any.isSameTypeAs(Foo.getDefaultInstance())) { + # foo = any.unpack(Foo.getDefaultInstance()); + # } + # + # Example 3: Pack and unpack a message in Python. + # + # foo = Foo(...) + # any = Any() + # any.Pack(foo) + # ... + # if any.Is(Foo.DESCRIPTOR): + # any.Unpack(foo) + # ... + # + # Example 4: Pack and unpack a message in Go + # + # foo := &pb.Foo{...} + # any, err := anypb.New(foo) + # if err != nil { + # ... + # } + # ... + # foo := &pb.Foo{} + # if err := any.UnmarshalTo(foo); err != nil { + # ... + # } + # + # The pack methods provided by protobuf library will by default use + # 'type.googleapis.com/full.type.name' as the type URL and the unpack + # methods only use the fully qualified type name after the last '/' + # in the type URL, for example "foo.bar.com/x/y.z" will yield type + # name "y.z". + # + # JSON + # ==== + # The JSON representation of an `Any` value uses the regular + # representation of the deserialized, embedded message, with an + # additional field `@type` which contains the type URL. Example: + # + # package google.profile; + # message Person { + # string first_name = 1; + # string last_name = 2; + # } + # + # { + # "@type": "type.googleapis.com/google.profile.Person", + # "firstName": , + # "lastName": + # } + # + # If the embedded message type is well-known and has a custom JSON + # representation, that representation will be embedded adding a field + # `value` which holds the custom JSON in addition to the `@type` + # field. Example (for message [google.protobuf.Duration][]): + # + # { + # "@type": "type.googleapis.com/google.protobuf.Duration", + # "value": "1.212s" + # } + # @!attribute [rw] type_url + # @return [::String] + # A URL/resource name that uniquely identifies the type of the serialized + # protocol buffer message. This string must contain at least + # one "/" character. The last segment of the URL's path must represent + # the fully qualified name of the type (as in + # `path/google.protobuf.Duration`). The name should be in a canonical form + # (e.g., leading "." is not accepted). + # + # In practice, teams usually precompile into the binary all types that they + # expect it to use in the context of Any. However, for URLs which use the + # scheme `http`, `https`, or no scheme, one can optionally set up a type + # server that maps type URLs to message definitions as follows: + # + # * If no scheme is provided, `https` is assumed. + # * An HTTP GET on the URL must yield a [google.protobuf.Type][] + # value in binary format, or produce an error. + # * Applications are allowed to cache lookup results based on the + # URL, or have them precompiled into a binary to avoid any + # lookup. Therefore, binary compatibility needs to be preserved + # on changes to types. (Use versioned type names to manage + # breaking changes.) + # + # Note: this functionality is not currently available in the official + # protobuf release, and it is not used for type URLs beginning with + # type.googleapis.com. As of May 2023, there are no widely used type server + # implementations and no plans to implement one. + # + # Schemes other than `http`, `https` (or the empty scheme) might be + # used with implementation specific semantics. + # @!attribute [rw] value + # @return [::String] + # Must be a valid serialized protocol buffer of the above specified type. + class Any + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end +end diff --git a/owl-bot-staging/google-cloud-redis-cluster-v1beta1/proto_docs/google/protobuf/duration.rb b/owl-bot-staging/google-cloud-redis-cluster-v1beta1/proto_docs/google/protobuf/duration.rb new file mode 100644 index 000000000000..ea59f1f91daf --- /dev/null +++ b/owl-bot-staging/google-cloud-redis-cluster-v1beta1/proto_docs/google/protobuf/duration.rb @@ -0,0 +1,98 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + + +module Google + module Protobuf + # A Duration represents a signed, fixed-length span of time represented + # as a count of seconds and fractions of seconds at nanosecond + # resolution. It is independent of any calendar and concepts like "day" + # or "month". It is related to Timestamp in that the difference between + # two Timestamp values is a Duration and it can be added or subtracted + # from a Timestamp. Range is approximately +-10,000 years. + # + # # Examples + # + # Example 1: Compute Duration from two Timestamps in pseudo code. + # + # Timestamp start = ...; + # Timestamp end = ...; + # Duration duration = ...; + # + # duration.seconds = end.seconds - start.seconds; + # duration.nanos = end.nanos - start.nanos; + # + # if (duration.seconds < 0 && duration.nanos > 0) { + # duration.seconds += 1; + # duration.nanos -= 1000000000; + # } else if (duration.seconds > 0 && duration.nanos < 0) { + # duration.seconds -= 1; + # duration.nanos += 1000000000; + # } + # + # Example 2: Compute Timestamp from Timestamp + Duration in pseudo code. + # + # Timestamp start = ...; + # Duration duration = ...; + # Timestamp end = ...; + # + # end.seconds = start.seconds + duration.seconds; + # end.nanos = start.nanos + duration.nanos; + # + # if (end.nanos < 0) { + # end.seconds -= 1; + # end.nanos += 1000000000; + # } else if (end.nanos >= 1000000000) { + # end.seconds += 1; + # end.nanos -= 1000000000; + # } + # + # Example 3: Compute Duration from datetime.timedelta in Python. + # + # td = datetime.timedelta(days=3, minutes=10) + # duration = Duration() + # duration.FromTimedelta(td) + # + # # JSON Mapping + # + # In JSON format, the Duration type is encoded as a string rather than an + # object, where the string ends in the suffix "s" (indicating seconds) and + # is preceded by the number of seconds, with nanoseconds expressed as + # fractional seconds. For example, 3 seconds with 0 nanoseconds should be + # encoded in JSON format as "3s", while 3 seconds and 1 nanosecond should + # be expressed in JSON format as "3.000000001s", and 3 seconds and 1 + # microsecond should be expressed in JSON format as "3.000001s". + # @!attribute [rw] seconds + # @return [::Integer] + # Signed seconds of the span of time. Must be from -315,576,000,000 + # to +315,576,000,000 inclusive. Note: these bounds are computed from: + # 60 sec/min * 60 min/hr * 24 hr/day * 365.25 days/year * 10000 years + # @!attribute [rw] nanos + # @return [::Integer] + # Signed fractions of a second at nanosecond resolution of the span + # of time. Durations less than one second are represented with a 0 + # `seconds` field and a positive or negative `nanos` field. For durations + # of one second or more, a non-zero value for the `nanos` field must be + # of the same sign as the `seconds` field. Must be from -999,999,999 + # to +999,999,999 inclusive. + class Duration + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end +end diff --git a/owl-bot-staging/google-cloud-redis-cluster-v1beta1/proto_docs/google/protobuf/empty.rb b/owl-bot-staging/google-cloud-redis-cluster-v1beta1/proto_docs/google/protobuf/empty.rb new file mode 100644 index 000000000000..83e4481834a6 --- /dev/null +++ b/owl-bot-staging/google-cloud-redis-cluster-v1beta1/proto_docs/google/protobuf/empty.rb @@ -0,0 +1,34 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + + +module Google + module Protobuf + # A generic empty message that you can re-use to avoid defining duplicated + # empty messages in your APIs. A typical example is to use it as the request + # or the response type of an API method. For instance: + # + # service Foo { + # rpc Bar(google.protobuf.Empty) returns (google.protobuf.Empty); + # } + class Empty + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end +end diff --git a/owl-bot-staging/google-cloud-redis-cluster-v1beta1/proto_docs/google/protobuf/field_mask.rb b/owl-bot-staging/google-cloud-redis-cluster-v1beta1/proto_docs/google/protobuf/field_mask.rb new file mode 100644 index 000000000000..7f3ffc78601a --- /dev/null +++ b/owl-bot-staging/google-cloud-redis-cluster-v1beta1/proto_docs/google/protobuf/field_mask.rb @@ -0,0 +1,229 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + + +module Google + module Protobuf + # `FieldMask` represents a set of symbolic field paths, for example: + # + # paths: "f.a" + # paths: "f.b.d" + # + # Here `f` represents a field in some root message, `a` and `b` + # fields in the message found in `f`, and `d` a field found in the + # message in `f.b`. + # + # Field masks are used to specify a subset of fields that should be + # returned by a get operation or modified by an update operation. + # Field masks also have a custom JSON encoding (see below). + # + # # Field Masks in Projections + # + # When used in the context of a projection, a response message or + # sub-message is filtered by the API to only contain those fields as + # specified in the mask. For example, if the mask in the previous + # example is applied to a response message as follows: + # + # f { + # a : 22 + # b { + # d : 1 + # x : 2 + # } + # y : 13 + # } + # z: 8 + # + # The result will not contain specific values for fields x,y and z + # (their value will be set to the default, and omitted in proto text + # output): + # + # + # f { + # a : 22 + # b { + # d : 1 + # } + # } + # + # A repeated field is not allowed except at the last position of a + # paths string. + # + # If a FieldMask object is not present in a get operation, the + # operation applies to all fields (as if a FieldMask of all fields + # had been specified). + # + # Note that a field mask does not necessarily apply to the + # top-level response message. In case of a REST get operation, the + # field mask applies directly to the response, but in case of a REST + # list operation, the mask instead applies to each individual message + # in the returned resource list. In case of a REST custom method, + # other definitions may be used. Where the mask applies will be + # clearly documented together with its declaration in the API. In + # any case, the effect on the returned resource/resources is required + # behavior for APIs. + # + # # Field Masks in Update Operations + # + # A field mask in update operations specifies which fields of the + # targeted resource are going to be updated. The API is required + # to only change the values of the fields as specified in the mask + # and leave the others untouched. If a resource is passed in to + # describe the updated values, the API ignores the values of all + # fields not covered by the mask. + # + # If a repeated field is specified for an update operation, new values will + # be appended to the existing repeated field in the target resource. Note that + # a repeated field is only allowed in the last position of a `paths` string. + # + # If a sub-message is specified in the last position of the field mask for an + # update operation, then new value will be merged into the existing sub-message + # in the target resource. + # + # For example, given the target message: + # + # f { + # b { + # d: 1 + # x: 2 + # } + # c: [1] + # } + # + # And an update message: + # + # f { + # b { + # d: 10 + # } + # c: [2] + # } + # + # then if the field mask is: + # + # paths: ["f.b", "f.c"] + # + # then the result will be: + # + # f { + # b { + # d: 10 + # x: 2 + # } + # c: [1, 2] + # } + # + # An implementation may provide options to override this default behavior for + # repeated and message fields. + # + # In order to reset a field's value to the default, the field must + # be in the mask and set to the default value in the provided resource. + # Hence, in order to reset all fields of a resource, provide a default + # instance of the resource and set all fields in the mask, or do + # not provide a mask as described below. + # + # If a field mask is not present on update, the operation applies to + # all fields (as if a field mask of all fields has been specified). + # Note that in the presence of schema evolution, this may mean that + # fields the client does not know and has therefore not filled into + # the request will be reset to their default. If this is unwanted + # behavior, a specific service may require a client to always specify + # a field mask, producing an error if not. + # + # As with get operations, the location of the resource which + # describes the updated values in the request message depends on the + # operation kind. In any case, the effect of the field mask is + # required to be honored by the API. + # + # ## Considerations for HTTP REST + # + # The HTTP kind of an update operation which uses a field mask must + # be set to PATCH instead of PUT in order to satisfy HTTP semantics + # (PUT must only be used for full updates). + # + # # JSON Encoding of Field Masks + # + # In JSON, a field mask is encoded as a single string where paths are + # separated by a comma. Fields name in each path are converted + # to/from lower-camel naming conventions. + # + # As an example, consider the following message declarations: + # + # message Profile { + # User user = 1; + # Photo photo = 2; + # } + # message User { + # string display_name = 1; + # string address = 2; + # } + # + # In proto a field mask for `Profile` may look as such: + # + # mask { + # paths: "user.display_name" + # paths: "photo" + # } + # + # In JSON, the same mask is represented as below: + # + # { + # mask: "user.displayName,photo" + # } + # + # # Field Masks and Oneof Fields + # + # Field masks treat fields in oneofs just as regular fields. Consider the + # following message: + # + # message SampleMessage { + # oneof test_oneof { + # string name = 4; + # SubMessage sub_message = 9; + # } + # } + # + # The field mask can be: + # + # mask { + # paths: "name" + # } + # + # Or: + # + # mask { + # paths: "sub_message" + # } + # + # Note that oneof type names ("test_oneof" in this case) cannot be used in + # paths. + # + # ## Field Mask Verification + # + # The implementation of any API method which has a FieldMask type field in the + # request should verify the included field paths, and return an + # `INVALID_ARGUMENT` error if any path is unmappable. + # @!attribute [rw] paths + # @return [::Array<::String>] + # The set of field mask paths. + class FieldMask + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end +end diff --git a/owl-bot-staging/google-cloud-redis-cluster-v1beta1/proto_docs/google/protobuf/timestamp.rb b/owl-bot-staging/google-cloud-redis-cluster-v1beta1/proto_docs/google/protobuf/timestamp.rb new file mode 100644 index 000000000000..74352be9c58c --- /dev/null +++ b/owl-bot-staging/google-cloud-redis-cluster-v1beta1/proto_docs/google/protobuf/timestamp.rb @@ -0,0 +1,127 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + + +module Google + module Protobuf + # A Timestamp represents a point in time independent of any time zone or local + # calendar, encoded as a count of seconds and fractions of seconds at + # nanosecond resolution. The count is relative to an epoch at UTC midnight on + # January 1, 1970, in the proleptic Gregorian calendar which extends the + # Gregorian calendar backwards to year one. + # + # All minutes are 60 seconds long. Leap seconds are "smeared" so that no leap + # second table is needed for interpretation, using a [24-hour linear + # smear](https://developers.google.com/time/smear). + # + # The range is from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59.999999999Z. By + # restricting to that range, we ensure that we can convert to and from [RFC + # 3339](https://www.ietf.org/rfc/rfc3339.txt) date strings. + # + # # Examples + # + # Example 1: Compute Timestamp from POSIX `time()`. + # + # Timestamp timestamp; + # timestamp.set_seconds(time(NULL)); + # timestamp.set_nanos(0); + # + # Example 2: Compute Timestamp from POSIX `gettimeofday()`. + # + # struct timeval tv; + # gettimeofday(&tv, NULL); + # + # Timestamp timestamp; + # timestamp.set_seconds(tv.tv_sec); + # timestamp.set_nanos(tv.tv_usec * 1000); + # + # Example 3: Compute Timestamp from Win32 `GetSystemTimeAsFileTime()`. + # + # FILETIME ft; + # GetSystemTimeAsFileTime(&ft); + # UINT64 ticks = (((UINT64)ft.dwHighDateTime) << 32) | ft.dwLowDateTime; + # + # // A Windows tick is 100 nanoseconds. Windows epoch 1601-01-01T00:00:00Z + # // is 11644473600 seconds before Unix epoch 1970-01-01T00:00:00Z. + # Timestamp timestamp; + # timestamp.set_seconds((INT64) ((ticks / 10000000) - 11644473600LL)); + # timestamp.set_nanos((INT32) ((ticks % 10000000) * 100)); + # + # Example 4: Compute Timestamp from Java `System.currentTimeMillis()`. + # + # long millis = System.currentTimeMillis(); + # + # Timestamp timestamp = Timestamp.newBuilder().setSeconds(millis / 1000) + # .setNanos((int) ((millis % 1000) * 1000000)).build(); + # + # Example 5: Compute Timestamp from Java `Instant.now()`. + # + # Instant now = Instant.now(); + # + # Timestamp timestamp = + # Timestamp.newBuilder().setSeconds(now.getEpochSecond()) + # .setNanos(now.getNano()).build(); + # + # Example 6: Compute Timestamp from current time in Python. + # + # timestamp = Timestamp() + # timestamp.GetCurrentTime() + # + # # JSON Mapping + # + # In JSON format, the Timestamp type is encoded as a string in the + # [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format. That is, the + # format is "\\{year}-\\{month}-\\{day}T\\{hour}:\\{min}:\\{sec}[.\\{frac_sec}]Z" + # where \\{year} is always expressed using four digits while \\{month}, \\{day}, + # \\{hour}, \\{min}, and \\{sec} are zero-padded to two digits each. The fractional + # seconds, which can go up to 9 digits (i.e. up to 1 nanosecond resolution), + # are optional. The "Z" suffix indicates the timezone ("UTC"); the timezone + # is required. A proto3 JSON serializer should always use UTC (as indicated by + # "Z") when printing the Timestamp type and a proto3 JSON parser should be + # able to accept both UTC and other timezones (as indicated by an offset). + # + # For example, "2017-01-15T01:30:15.01Z" encodes 15.01 seconds past + # 01:30 UTC on January 15, 2017. + # + # In JavaScript, one can convert a Date object to this format using the + # standard + # [toISOString()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toISOString) + # method. In Python, a standard `datetime.datetime` object can be converted + # to this format using + # [`strftime`](https://docs.python.org/2/library/time.html#time.strftime) with + # the time format spec '%Y-%m-%dT%H:%M:%S.%fZ'. Likewise, in Java, one can use + # the Joda Time's [`ISODateTimeFormat.dateTime()`]( + # http://joda-time.sourceforge.net/apidocs/org/joda/time/format/ISODateTimeFormat.html#dateTime() + # ) to obtain a formatter capable of generating timestamps in this format. + # @!attribute [rw] seconds + # @return [::Integer] + # Represents seconds of UTC time since Unix epoch + # 1970-01-01T00:00:00Z. Must be from 0001-01-01T00:00:00Z to + # 9999-12-31T23:59:59Z inclusive. + # @!attribute [rw] nanos + # @return [::Integer] + # Non-negative fractions of a second at nanosecond resolution. Negative + # second values with fractions must still have non-negative nanos values + # that count forward in time. Must be from 0 to 999,999,999 + # inclusive. + class Timestamp + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end +end diff --git a/owl-bot-staging/google-cloud-redis-cluster-v1beta1/proto_docs/google/rpc/status.rb b/owl-bot-staging/google-cloud-redis-cluster-v1beta1/proto_docs/google/rpc/status.rb new file mode 100644 index 000000000000..c1a1c07eb2db --- /dev/null +++ b/owl-bot-staging/google-cloud-redis-cluster-v1beta1/proto_docs/google/rpc/status.rb @@ -0,0 +1,48 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + + +module Google + module Rpc + # The `Status` type defines a logical error model that is suitable for + # different programming environments, including REST APIs and RPC APIs. It is + # used by [gRPC](https://github.com/grpc). Each `Status` message contains + # three pieces of data: error code, error message, and error details. + # + # You can find out more about this error model and how to work with it in the + # [API Design Guide](https://cloud.google.com/apis/design/errors). + # @!attribute [rw] code + # @return [::Integer] + # The status code, which should be an enum value of + # [google.rpc.Code][google.rpc.Code]. + # @!attribute [rw] message + # @return [::String] + # A developer-facing error message, which should be in English. Any + # user-facing error message should be localized and sent in the + # {::Google::Rpc::Status#details google.rpc.Status.details} field, or localized + # by the client. + # @!attribute [rw] details + # @return [::Array<::Google::Protobuf::Any>] + # A list of messages that carry the error details. There is a common set of + # message types for APIs to use. + class Status + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end +end diff --git a/owl-bot-staging/google-cloud-redis-cluster-v1beta1/proto_docs/google/type/dayofweek.rb b/owl-bot-staging/google-cloud-redis-cluster-v1beta1/proto_docs/google/type/dayofweek.rb new file mode 100644 index 000000000000..973211b9ffe7 --- /dev/null +++ b/owl-bot-staging/google-cloud-redis-cluster-v1beta1/proto_docs/google/type/dayofweek.rb @@ -0,0 +1,49 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + + +module Google + module Type + # Represents a day of the week. + module DayOfWeek + # The day of the week is unspecified. + DAY_OF_WEEK_UNSPECIFIED = 0 + + # Monday + MONDAY = 1 + + # Tuesday + TUESDAY = 2 + + # Wednesday + WEDNESDAY = 3 + + # Thursday + THURSDAY = 4 + + # Friday + FRIDAY = 5 + + # Saturday + SATURDAY = 6 + + # Sunday + SUNDAY = 7 + end + end +end diff --git a/owl-bot-staging/google-cloud-redis-cluster-v1beta1/proto_docs/google/type/timeofday.rb b/owl-bot-staging/google-cloud-redis-cluster-v1beta1/proto_docs/google/type/timeofday.rb new file mode 100644 index 000000000000..8372dad8beb8 --- /dev/null +++ b/owl-bot-staging/google-cloud-redis-cluster-v1beta1/proto_docs/google/type/timeofday.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! + + +module Google + module Type + # Represents a time of day. The date and time zone are either not significant + # or are specified elsewhere. An API may choose to allow leap seconds. Related + # types are [google.type.Date][google.type.Date] and + # `google.protobuf.Timestamp`. + # @!attribute [rw] hours + # @return [::Integer] + # Hours of day in 24 hour format. Should be from 0 to 23. An API may choose + # to allow the value "24:00:00" for scenarios like business closing time. + # @!attribute [rw] minutes + # @return [::Integer] + # Minutes of hour of day. Must be from 0 to 59. + # @!attribute [rw] seconds + # @return [::Integer] + # Seconds of minutes of the time. Must normally be from 0 to 59. An API may + # allow the value 60 if it allows leap-seconds. + # @!attribute [rw] nanos + # @return [::Integer] + # Fractions of seconds in nanoseconds. Must be from 0 to 999,999,999. + class TimeOfDay + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end +end diff --git a/owl-bot-staging/google-cloud-redis-cluster-v1beta1/snippets/Gemfile b/owl-bot-staging/google-cloud-redis-cluster-v1beta1/snippets/Gemfile new file mode 100644 index 000000000000..df35534a4e02 --- /dev/null +++ b/owl-bot-staging/google-cloud-redis-cluster-v1beta1/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-redis-cluster-v1beta1", path: "../" +else + gem "google-cloud-redis-cluster-v1beta1" +end + +group :test do + gem "google-style", "~> 1.26.1" + gem "minitest", "~> 5.16" + gem "minitest-focus", "~> 1.1" + gem "minitest-hooks", "~> 1.5" +end diff --git a/owl-bot-staging/google-cloud-redis-cluster-v1beta1/snippets/cloud_redis_cluster/backup_cluster.rb b/owl-bot-staging/google-cloud-redis-cluster-v1beta1/snippets/cloud_redis_cluster/backup_cluster.rb new file mode 100644 index 000000000000..bf5ebfcda30d --- /dev/null +++ b/owl-bot-staging/google-cloud-redis-cluster-v1beta1/snippets/cloud_redis_cluster/backup_cluster.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 redis_v1beta1_generated_CloudRedisCluster_BackupCluster_sync] +require "google/cloud/redis/cluster/v1beta1" + +## +# Snippet for the backup_cluster call in the CloudRedisCluster service +# +# This snippet has been automatically generated and should be regarded as a code +# template only. It will require modifications to work: +# - It may require correct/in-range values for request initialization. +# - It may require specifying regional endpoints when creating the service +# client as shown in https://cloud.google.com/ruby/docs/reference. +# +# This is an auto-generated example demonstrating basic usage of +# Google::Cloud::Redis::Cluster::V1beta1::CloudRedisCluster::Client#backup_cluster. +# +def backup_cluster + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Redis::Cluster::V1beta1::CloudRedisCluster::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Redis::Cluster::V1beta1::BackupClusterRequest.new + + # Call the backup_cluster method. + result = client.backup_cluster 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 redis_v1beta1_generated_CloudRedisCluster_BackupCluster_sync] diff --git a/owl-bot-staging/google-cloud-redis-cluster-v1beta1/snippets/cloud_redis_cluster/create_cluster.rb b/owl-bot-staging/google-cloud-redis-cluster-v1beta1/snippets/cloud_redis_cluster/create_cluster.rb new file mode 100644 index 000000000000..7638244dba94 --- /dev/null +++ b/owl-bot-staging/google-cloud-redis-cluster-v1beta1/snippets/cloud_redis_cluster/create_cluster.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 redis_v1beta1_generated_CloudRedisCluster_CreateCluster_sync] +require "google/cloud/redis/cluster/v1beta1" + +## +# Snippet for the create_cluster call in the CloudRedisCluster service +# +# This snippet has been automatically generated and should be regarded as a code +# template only. It will require modifications to work: +# - It may require correct/in-range values for request initialization. +# - It may require specifying regional endpoints when creating the service +# client as shown in https://cloud.google.com/ruby/docs/reference. +# +# This is an auto-generated example demonstrating basic usage of +# Google::Cloud::Redis::Cluster::V1beta1::CloudRedisCluster::Client#create_cluster. +# +def create_cluster + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Redis::Cluster::V1beta1::CloudRedisCluster::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Redis::Cluster::V1beta1::CreateClusterRequest.new + + # Call the create_cluster method. + result = client.create_cluster 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 redis_v1beta1_generated_CloudRedisCluster_CreateCluster_sync] diff --git a/owl-bot-staging/google-cloud-redis-cluster-v1beta1/snippets/cloud_redis_cluster/delete_backup.rb b/owl-bot-staging/google-cloud-redis-cluster-v1beta1/snippets/cloud_redis_cluster/delete_backup.rb new file mode 100644 index 000000000000..19917b30490c --- /dev/null +++ b/owl-bot-staging/google-cloud-redis-cluster-v1beta1/snippets/cloud_redis_cluster/delete_backup.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 redis_v1beta1_generated_CloudRedisCluster_DeleteBackup_sync] +require "google/cloud/redis/cluster/v1beta1" + +## +# Snippet for the delete_backup call in the CloudRedisCluster service +# +# This snippet has been automatically generated and should be regarded as a code +# template only. It will require modifications to work: +# - It may require correct/in-range values for request initialization. +# - It may require specifying regional endpoints when creating the service +# client as shown in https://cloud.google.com/ruby/docs/reference. +# +# This is an auto-generated example demonstrating basic usage of +# Google::Cloud::Redis::Cluster::V1beta1::CloudRedisCluster::Client#delete_backup. +# +def delete_backup + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Redis::Cluster::V1beta1::CloudRedisCluster::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Redis::Cluster::V1beta1::DeleteBackupRequest.new + + # Call the delete_backup method. + result = client.delete_backup 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 redis_v1beta1_generated_CloudRedisCluster_DeleteBackup_sync] diff --git a/owl-bot-staging/google-cloud-redis-cluster-v1beta1/snippets/cloud_redis_cluster/delete_cluster.rb b/owl-bot-staging/google-cloud-redis-cluster-v1beta1/snippets/cloud_redis_cluster/delete_cluster.rb new file mode 100644 index 000000000000..fbc95553d4b7 --- /dev/null +++ b/owl-bot-staging/google-cloud-redis-cluster-v1beta1/snippets/cloud_redis_cluster/delete_cluster.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 redis_v1beta1_generated_CloudRedisCluster_DeleteCluster_sync] +require "google/cloud/redis/cluster/v1beta1" + +## +# Snippet for the delete_cluster call in the CloudRedisCluster service +# +# This snippet has been automatically generated and should be regarded as a code +# template only. It will require modifications to work: +# - It may require correct/in-range values for request initialization. +# - It may require specifying regional endpoints when creating the service +# client as shown in https://cloud.google.com/ruby/docs/reference. +# +# This is an auto-generated example demonstrating basic usage of +# Google::Cloud::Redis::Cluster::V1beta1::CloudRedisCluster::Client#delete_cluster. +# +def delete_cluster + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Redis::Cluster::V1beta1::CloudRedisCluster::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Redis::Cluster::V1beta1::DeleteClusterRequest.new + + # Call the delete_cluster method. + result = client.delete_cluster 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 redis_v1beta1_generated_CloudRedisCluster_DeleteCluster_sync] diff --git a/owl-bot-staging/google-cloud-redis-cluster-v1beta1/snippets/cloud_redis_cluster/export_backup.rb b/owl-bot-staging/google-cloud-redis-cluster-v1beta1/snippets/cloud_redis_cluster/export_backup.rb new file mode 100644 index 000000000000..5ab68f801603 --- /dev/null +++ b/owl-bot-staging/google-cloud-redis-cluster-v1beta1/snippets/cloud_redis_cluster/export_backup.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 redis_v1beta1_generated_CloudRedisCluster_ExportBackup_sync] +require "google/cloud/redis/cluster/v1beta1" + +## +# Snippet for the export_backup call in the CloudRedisCluster service +# +# This snippet has been automatically generated and should be regarded as a code +# template only. It will require modifications to work: +# - It may require correct/in-range values for request initialization. +# - It may require specifying regional endpoints when creating the service +# client as shown in https://cloud.google.com/ruby/docs/reference. +# +# This is an auto-generated example demonstrating basic usage of +# Google::Cloud::Redis::Cluster::V1beta1::CloudRedisCluster::Client#export_backup. +# +def export_backup + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Redis::Cluster::V1beta1::CloudRedisCluster::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Redis::Cluster::V1beta1::ExportBackupRequest.new + + # Call the export_backup method. + result = client.export_backup 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 redis_v1beta1_generated_CloudRedisCluster_ExportBackup_sync] diff --git a/owl-bot-staging/google-cloud-redis-cluster-v1beta1/snippets/cloud_redis_cluster/get_backup.rb b/owl-bot-staging/google-cloud-redis-cluster-v1beta1/snippets/cloud_redis_cluster/get_backup.rb new file mode 100644 index 000000000000..7db2d5eecb49 --- /dev/null +++ b/owl-bot-staging/google-cloud-redis-cluster-v1beta1/snippets/cloud_redis_cluster/get_backup.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 redis_v1beta1_generated_CloudRedisCluster_GetBackup_sync] +require "google/cloud/redis/cluster/v1beta1" + +## +# Snippet for the get_backup call in the CloudRedisCluster service +# +# This snippet has been automatically generated and should be regarded as a code +# template only. It will require modifications to work: +# - It may require correct/in-range values for request initialization. +# - It may require specifying regional endpoints when creating the service +# client as shown in https://cloud.google.com/ruby/docs/reference. +# +# This is an auto-generated example demonstrating basic usage of +# Google::Cloud::Redis::Cluster::V1beta1::CloudRedisCluster::Client#get_backup. +# +def get_backup + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Redis::Cluster::V1beta1::CloudRedisCluster::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Redis::Cluster::V1beta1::GetBackupRequest.new + + # Call the get_backup method. + result = client.get_backup request + + # The returned object is of type Google::Cloud::Redis::Cluster::V1beta1::Backup. + p result +end +# [END redis_v1beta1_generated_CloudRedisCluster_GetBackup_sync] diff --git a/owl-bot-staging/google-cloud-redis-cluster-v1beta1/snippets/cloud_redis_cluster/get_backup_collection.rb b/owl-bot-staging/google-cloud-redis-cluster-v1beta1/snippets/cloud_redis_cluster/get_backup_collection.rb new file mode 100644 index 000000000000..766299664331 --- /dev/null +++ b/owl-bot-staging/google-cloud-redis-cluster-v1beta1/snippets/cloud_redis_cluster/get_backup_collection.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 redis_v1beta1_generated_CloudRedisCluster_GetBackupCollection_sync] +require "google/cloud/redis/cluster/v1beta1" + +## +# Snippet for the get_backup_collection call in the CloudRedisCluster service +# +# This snippet has been automatically generated and should be regarded as a code +# template only. It will require modifications to work: +# - It may require correct/in-range values for request initialization. +# - It may require specifying regional endpoints when creating the service +# client as shown in https://cloud.google.com/ruby/docs/reference. +# +# This is an auto-generated example demonstrating basic usage of +# Google::Cloud::Redis::Cluster::V1beta1::CloudRedisCluster::Client#get_backup_collection. +# +def get_backup_collection + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Redis::Cluster::V1beta1::CloudRedisCluster::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Redis::Cluster::V1beta1::GetBackupCollectionRequest.new + + # Call the get_backup_collection method. + result = client.get_backup_collection request + + # The returned object is of type Google::Cloud::Redis::Cluster::V1beta1::BackupCollection. + p result +end +# [END redis_v1beta1_generated_CloudRedisCluster_GetBackupCollection_sync] diff --git a/owl-bot-staging/google-cloud-redis-cluster-v1beta1/snippets/cloud_redis_cluster/get_cluster.rb b/owl-bot-staging/google-cloud-redis-cluster-v1beta1/snippets/cloud_redis_cluster/get_cluster.rb new file mode 100644 index 000000000000..77e8fff246f1 --- /dev/null +++ b/owl-bot-staging/google-cloud-redis-cluster-v1beta1/snippets/cloud_redis_cluster/get_cluster.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 redis_v1beta1_generated_CloudRedisCluster_GetCluster_sync] +require "google/cloud/redis/cluster/v1beta1" + +## +# Snippet for the get_cluster call in the CloudRedisCluster service +# +# This snippet has been automatically generated and should be regarded as a code +# template only. It will require modifications to work: +# - It may require correct/in-range values for request initialization. +# - It may require specifying regional endpoints when creating the service +# client as shown in https://cloud.google.com/ruby/docs/reference. +# +# This is an auto-generated example demonstrating basic usage of +# Google::Cloud::Redis::Cluster::V1beta1::CloudRedisCluster::Client#get_cluster. +# +def get_cluster + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Redis::Cluster::V1beta1::CloudRedisCluster::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Redis::Cluster::V1beta1::GetClusterRequest.new + + # Call the get_cluster method. + result = client.get_cluster request + + # The returned object is of type Google::Cloud::Redis::Cluster::V1beta1::Cluster. + p result +end +# [END redis_v1beta1_generated_CloudRedisCluster_GetCluster_sync] diff --git a/owl-bot-staging/google-cloud-redis-cluster-v1beta1/snippets/cloud_redis_cluster/get_cluster_certificate_authority.rb b/owl-bot-staging/google-cloud-redis-cluster-v1beta1/snippets/cloud_redis_cluster/get_cluster_certificate_authority.rb new file mode 100644 index 000000000000..e5b88a2ead35 --- /dev/null +++ b/owl-bot-staging/google-cloud-redis-cluster-v1beta1/snippets/cloud_redis_cluster/get_cluster_certificate_authority.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 redis_v1beta1_generated_CloudRedisCluster_GetClusterCertificateAuthority_sync] +require "google/cloud/redis/cluster/v1beta1" + +## +# Snippet for the get_cluster_certificate_authority call in the CloudRedisCluster service +# +# This snippet has been automatically generated and should be regarded as a code +# template only. It will require modifications to work: +# - It may require correct/in-range values for request initialization. +# - It may require specifying regional endpoints when creating the service +# client as shown in https://cloud.google.com/ruby/docs/reference. +# +# This is an auto-generated example demonstrating basic usage of +# Google::Cloud::Redis::Cluster::V1beta1::CloudRedisCluster::Client#get_cluster_certificate_authority. +# +def get_cluster_certificate_authority + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Redis::Cluster::V1beta1::CloudRedisCluster::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Redis::Cluster::V1beta1::GetClusterCertificateAuthorityRequest.new + + # Call the get_cluster_certificate_authority method. + result = client.get_cluster_certificate_authority request + + # The returned object is of type Google::Cloud::Redis::Cluster::V1beta1::CertificateAuthority. + p result +end +# [END redis_v1beta1_generated_CloudRedisCluster_GetClusterCertificateAuthority_sync] diff --git a/owl-bot-staging/google-cloud-redis-cluster-v1beta1/snippets/cloud_redis_cluster/list_backup_collections.rb b/owl-bot-staging/google-cloud-redis-cluster-v1beta1/snippets/cloud_redis_cluster/list_backup_collections.rb new file mode 100644 index 000000000000..ad3986e233a3 --- /dev/null +++ b/owl-bot-staging/google-cloud-redis-cluster-v1beta1/snippets/cloud_redis_cluster/list_backup_collections.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 redis_v1beta1_generated_CloudRedisCluster_ListBackupCollections_sync] +require "google/cloud/redis/cluster/v1beta1" + +## +# Snippet for the list_backup_collections call in the CloudRedisCluster service +# +# This snippet has been automatically generated and should be regarded as a code +# template only. It will require modifications to work: +# - It may require correct/in-range values for request initialization. +# - It may require specifying regional endpoints when creating the service +# client as shown in https://cloud.google.com/ruby/docs/reference. +# +# This is an auto-generated example demonstrating basic usage of +# Google::Cloud::Redis::Cluster::V1beta1::CloudRedisCluster::Client#list_backup_collections. +# +def list_backup_collections + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Redis::Cluster::V1beta1::CloudRedisCluster::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Redis::Cluster::V1beta1::ListBackupCollectionsRequest.new + + # Call the list_backup_collections method. + result = client.list_backup_collections request + + # The returned object is of type Gapic::PagedEnumerable. You can iterate + # over elements, and API calls will be issued to fetch pages as needed. + result.each do |item| + # Each element is of type ::Google::Cloud::Redis::Cluster::V1beta1::BackupCollection. + p item + end +end +# [END redis_v1beta1_generated_CloudRedisCluster_ListBackupCollections_sync] diff --git a/owl-bot-staging/google-cloud-redis-cluster-v1beta1/snippets/cloud_redis_cluster/list_backups.rb b/owl-bot-staging/google-cloud-redis-cluster-v1beta1/snippets/cloud_redis_cluster/list_backups.rb new file mode 100644 index 000000000000..cd01f47c1522 --- /dev/null +++ b/owl-bot-staging/google-cloud-redis-cluster-v1beta1/snippets/cloud_redis_cluster/list_backups.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 redis_v1beta1_generated_CloudRedisCluster_ListBackups_sync] +require "google/cloud/redis/cluster/v1beta1" + +## +# Snippet for the list_backups call in the CloudRedisCluster service +# +# This snippet has been automatically generated and should be regarded as a code +# template only. It will require modifications to work: +# - It may require correct/in-range values for request initialization. +# - It may require specifying regional endpoints when creating the service +# client as shown in https://cloud.google.com/ruby/docs/reference. +# +# This is an auto-generated example demonstrating basic usage of +# Google::Cloud::Redis::Cluster::V1beta1::CloudRedisCluster::Client#list_backups. +# +def list_backups + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Redis::Cluster::V1beta1::CloudRedisCluster::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Redis::Cluster::V1beta1::ListBackupsRequest.new + + # Call the list_backups method. + result = client.list_backups request + + # The returned object is of type Gapic::PagedEnumerable. You can iterate + # over elements, and API calls will be issued to fetch pages as needed. + result.each do |item| + # Each element is of type ::Google::Cloud::Redis::Cluster::V1beta1::Backup. + p item + end +end +# [END redis_v1beta1_generated_CloudRedisCluster_ListBackups_sync] diff --git a/owl-bot-staging/google-cloud-redis-cluster-v1beta1/snippets/cloud_redis_cluster/list_clusters.rb b/owl-bot-staging/google-cloud-redis-cluster-v1beta1/snippets/cloud_redis_cluster/list_clusters.rb new file mode 100644 index 000000000000..eecf60935fcf --- /dev/null +++ b/owl-bot-staging/google-cloud-redis-cluster-v1beta1/snippets/cloud_redis_cluster/list_clusters.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 redis_v1beta1_generated_CloudRedisCluster_ListClusters_sync] +require "google/cloud/redis/cluster/v1beta1" + +## +# Snippet for the list_clusters call in the CloudRedisCluster service +# +# This snippet has been automatically generated and should be regarded as a code +# template only. It will require modifications to work: +# - It may require correct/in-range values for request initialization. +# - It may require specifying regional endpoints when creating the service +# client as shown in https://cloud.google.com/ruby/docs/reference. +# +# This is an auto-generated example demonstrating basic usage of +# Google::Cloud::Redis::Cluster::V1beta1::CloudRedisCluster::Client#list_clusters. +# +def list_clusters + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Redis::Cluster::V1beta1::CloudRedisCluster::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Redis::Cluster::V1beta1::ListClustersRequest.new + + # Call the list_clusters method. + result = client.list_clusters request + + # The returned object is of type Gapic::PagedEnumerable. You can iterate + # over elements, and API calls will be issued to fetch pages as needed. + result.each do |item| + # Each element is of type ::Google::Cloud::Redis::Cluster::V1beta1::Cluster. + p item + end +end +# [END redis_v1beta1_generated_CloudRedisCluster_ListClusters_sync] diff --git a/owl-bot-staging/google-cloud-redis-cluster-v1beta1/snippets/cloud_redis_cluster/reschedule_cluster_maintenance.rb b/owl-bot-staging/google-cloud-redis-cluster-v1beta1/snippets/cloud_redis_cluster/reschedule_cluster_maintenance.rb new file mode 100644 index 000000000000..0f6991ad3882 --- /dev/null +++ b/owl-bot-staging/google-cloud-redis-cluster-v1beta1/snippets/cloud_redis_cluster/reschedule_cluster_maintenance.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 redis_v1beta1_generated_CloudRedisCluster_RescheduleClusterMaintenance_sync] +require "google/cloud/redis/cluster/v1beta1" + +## +# Snippet for the reschedule_cluster_maintenance call in the CloudRedisCluster service +# +# This snippet has been automatically generated and should be regarded as a code +# template only. It will require modifications to work: +# - It may require correct/in-range values for request initialization. +# - It may require specifying regional endpoints when creating the service +# client as shown in https://cloud.google.com/ruby/docs/reference. +# +# This is an auto-generated example demonstrating basic usage of +# Google::Cloud::Redis::Cluster::V1beta1::CloudRedisCluster::Client#reschedule_cluster_maintenance. +# +def reschedule_cluster_maintenance + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Redis::Cluster::V1beta1::CloudRedisCluster::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Redis::Cluster::V1beta1::RescheduleClusterMaintenanceRequest.new + + # Call the reschedule_cluster_maintenance method. + result = client.reschedule_cluster_maintenance 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 redis_v1beta1_generated_CloudRedisCluster_RescheduleClusterMaintenance_sync] diff --git a/owl-bot-staging/google-cloud-redis-cluster-v1beta1/snippets/cloud_redis_cluster/update_cluster.rb b/owl-bot-staging/google-cloud-redis-cluster-v1beta1/snippets/cloud_redis_cluster/update_cluster.rb new file mode 100644 index 000000000000..d626b00ee718 --- /dev/null +++ b/owl-bot-staging/google-cloud-redis-cluster-v1beta1/snippets/cloud_redis_cluster/update_cluster.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 redis_v1beta1_generated_CloudRedisCluster_UpdateCluster_sync] +require "google/cloud/redis/cluster/v1beta1" + +## +# Snippet for the update_cluster call in the CloudRedisCluster service +# +# This snippet has been automatically generated and should be regarded as a code +# template only. It will require modifications to work: +# - It may require correct/in-range values for request initialization. +# - It may require specifying regional endpoints when creating the service +# client as shown in https://cloud.google.com/ruby/docs/reference. +# +# This is an auto-generated example demonstrating basic usage of +# Google::Cloud::Redis::Cluster::V1beta1::CloudRedisCluster::Client#update_cluster. +# +def update_cluster + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Redis::Cluster::V1beta1::CloudRedisCluster::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Redis::Cluster::V1beta1::UpdateClusterRequest.new + + # Call the update_cluster method. + result = client.update_cluster 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 redis_v1beta1_generated_CloudRedisCluster_UpdateCluster_sync] diff --git a/owl-bot-staging/google-cloud-redis-cluster-v1beta1/snippets/snippet_metadata_google.cloud.redis.cluster.v1beta1.json b/owl-bot-staging/google-cloud-redis-cluster-v1beta1/snippets/snippet_metadata_google.cloud.redis.cluster.v1beta1.json new file mode 100644 index 000000000000..7e3369688058 --- /dev/null +++ b/owl-bot-staging/google-cloud-redis-cluster-v1beta1/snippets/snippet_metadata_google.cloud.redis.cluster.v1beta1.json @@ -0,0 +1,575 @@ +{ + "client_library": { + "name": "google-cloud-redis-cluster-v1beta1", + "version": "", + "language": "RUBY", + "apis": [ + { + "id": "google.cloud.redis.cluster.v1beta1", + "version": "v1beta1" + } + ] + }, + "snippets": [ + { + "region_tag": "redis_v1beta1_generated_CloudRedisCluster_ListClusters_sync", + "title": "Snippet for the list_clusters call in the CloudRedisCluster service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Redis::Cluster::V1beta1::CloudRedisCluster::Client#list_clusters.", + "file": "cloud_redis_cluster/list_clusters.rb", + "language": "RUBY", + "client_method": { + "short_name": "list_clusters", + "full_name": "::Google::Cloud::Redis::Cluster::V1beta1::CloudRedisCluster::Client#list_clusters", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::Redis::Cluster::V1beta1::ListClustersRequest", + "name": "request" + } + ], + "result_type": "::Google::Cloud::Redis::Cluster::V1beta1::ListClustersResponse", + "client": { + "short_name": "CloudRedisCluster::Client", + "full_name": "::Google::Cloud::Redis::Cluster::V1beta1::CloudRedisCluster::Client" + }, + "method": { + "short_name": "ListClusters", + "full_name": "google.cloud.redis.cluster.v1beta1.CloudRedisCluster.ListClusters", + "service": { + "short_name": "CloudRedisCluster", + "full_name": "google.cloud.redis.cluster.v1beta1.CloudRedisCluster" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 50, + "type": "FULL" + } + ] + }, + { + "region_tag": "redis_v1beta1_generated_CloudRedisCluster_GetCluster_sync", + "title": "Snippet for the get_cluster call in the CloudRedisCluster service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Redis::Cluster::V1beta1::CloudRedisCluster::Client#get_cluster.", + "file": "cloud_redis_cluster/get_cluster.rb", + "language": "RUBY", + "client_method": { + "short_name": "get_cluster", + "full_name": "::Google::Cloud::Redis::Cluster::V1beta1::CloudRedisCluster::Client#get_cluster", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::Redis::Cluster::V1beta1::GetClusterRequest", + "name": "request" + } + ], + "result_type": "::Google::Cloud::Redis::Cluster::V1beta1::Cluster", + "client": { + "short_name": "CloudRedisCluster::Client", + "full_name": "::Google::Cloud::Redis::Cluster::V1beta1::CloudRedisCluster::Client" + }, + "method": { + "short_name": "GetCluster", + "full_name": "google.cloud.redis.cluster.v1beta1.CloudRedisCluster.GetCluster", + "service": { + "short_name": "CloudRedisCluster", + "full_name": "google.cloud.redis.cluster.v1beta1.CloudRedisCluster" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 46, + "type": "FULL" + } + ] + }, + { + "region_tag": "redis_v1beta1_generated_CloudRedisCluster_UpdateCluster_sync", + "title": "Snippet for the update_cluster call in the CloudRedisCluster service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Redis::Cluster::V1beta1::CloudRedisCluster::Client#update_cluster.", + "file": "cloud_redis_cluster/update_cluster.rb", + "language": "RUBY", + "client_method": { + "short_name": "update_cluster", + "full_name": "::Google::Cloud::Redis::Cluster::V1beta1::CloudRedisCluster::Client#update_cluster", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::Redis::Cluster::V1beta1::UpdateClusterRequest", + "name": "request" + } + ], + "result_type": "::Google::Longrunning::Operation", + "client": { + "short_name": "CloudRedisCluster::Client", + "full_name": "::Google::Cloud::Redis::Cluster::V1beta1::CloudRedisCluster::Client" + }, + "method": { + "short_name": "UpdateCluster", + "full_name": "google.cloud.redis.cluster.v1beta1.CloudRedisCluster.UpdateCluster", + "service": { + "short_name": "CloudRedisCluster", + "full_name": "google.cloud.redis.cluster.v1beta1.CloudRedisCluster" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 53, + "type": "FULL" + } + ] + }, + { + "region_tag": "redis_v1beta1_generated_CloudRedisCluster_DeleteCluster_sync", + "title": "Snippet for the delete_cluster call in the CloudRedisCluster service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Redis::Cluster::V1beta1::CloudRedisCluster::Client#delete_cluster.", + "file": "cloud_redis_cluster/delete_cluster.rb", + "language": "RUBY", + "client_method": { + "short_name": "delete_cluster", + "full_name": "::Google::Cloud::Redis::Cluster::V1beta1::CloudRedisCluster::Client#delete_cluster", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::Redis::Cluster::V1beta1::DeleteClusterRequest", + "name": "request" + } + ], + "result_type": "::Google::Longrunning::Operation", + "client": { + "short_name": "CloudRedisCluster::Client", + "full_name": "::Google::Cloud::Redis::Cluster::V1beta1::CloudRedisCluster::Client" + }, + "method": { + "short_name": "DeleteCluster", + "full_name": "google.cloud.redis.cluster.v1beta1.CloudRedisCluster.DeleteCluster", + "service": { + "short_name": "CloudRedisCluster", + "full_name": "google.cloud.redis.cluster.v1beta1.CloudRedisCluster" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 53, + "type": "FULL" + } + ] + }, + { + "region_tag": "redis_v1beta1_generated_CloudRedisCluster_CreateCluster_sync", + "title": "Snippet for the create_cluster call in the CloudRedisCluster service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Redis::Cluster::V1beta1::CloudRedisCluster::Client#create_cluster.", + "file": "cloud_redis_cluster/create_cluster.rb", + "language": "RUBY", + "client_method": { + "short_name": "create_cluster", + "full_name": "::Google::Cloud::Redis::Cluster::V1beta1::CloudRedisCluster::Client#create_cluster", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::Redis::Cluster::V1beta1::CreateClusterRequest", + "name": "request" + } + ], + "result_type": "::Google::Longrunning::Operation", + "client": { + "short_name": "CloudRedisCluster::Client", + "full_name": "::Google::Cloud::Redis::Cluster::V1beta1::CloudRedisCluster::Client" + }, + "method": { + "short_name": "CreateCluster", + "full_name": "google.cloud.redis.cluster.v1beta1.CloudRedisCluster.CreateCluster", + "service": { + "short_name": "CloudRedisCluster", + "full_name": "google.cloud.redis.cluster.v1beta1.CloudRedisCluster" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 53, + "type": "FULL" + } + ] + }, + { + "region_tag": "redis_v1beta1_generated_CloudRedisCluster_GetClusterCertificateAuthority_sync", + "title": "Snippet for the get_cluster_certificate_authority call in the CloudRedisCluster service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Redis::Cluster::V1beta1::CloudRedisCluster::Client#get_cluster_certificate_authority.", + "file": "cloud_redis_cluster/get_cluster_certificate_authority.rb", + "language": "RUBY", + "client_method": { + "short_name": "get_cluster_certificate_authority", + "full_name": "::Google::Cloud::Redis::Cluster::V1beta1::CloudRedisCluster::Client#get_cluster_certificate_authority", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::Redis::Cluster::V1beta1::GetClusterCertificateAuthorityRequest", + "name": "request" + } + ], + "result_type": "::Google::Cloud::Redis::Cluster::V1beta1::CertificateAuthority", + "client": { + "short_name": "CloudRedisCluster::Client", + "full_name": "::Google::Cloud::Redis::Cluster::V1beta1::CloudRedisCluster::Client" + }, + "method": { + "short_name": "GetClusterCertificateAuthority", + "full_name": "google.cloud.redis.cluster.v1beta1.CloudRedisCluster.GetClusterCertificateAuthority", + "service": { + "short_name": "CloudRedisCluster", + "full_name": "google.cloud.redis.cluster.v1beta1.CloudRedisCluster" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 46, + "type": "FULL" + } + ] + }, + { + "region_tag": "redis_v1beta1_generated_CloudRedisCluster_RescheduleClusterMaintenance_sync", + "title": "Snippet for the reschedule_cluster_maintenance call in the CloudRedisCluster service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Redis::Cluster::V1beta1::CloudRedisCluster::Client#reschedule_cluster_maintenance.", + "file": "cloud_redis_cluster/reschedule_cluster_maintenance.rb", + "language": "RUBY", + "client_method": { + "short_name": "reschedule_cluster_maintenance", + "full_name": "::Google::Cloud::Redis::Cluster::V1beta1::CloudRedisCluster::Client#reschedule_cluster_maintenance", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::Redis::Cluster::V1beta1::RescheduleClusterMaintenanceRequest", + "name": "request" + } + ], + "result_type": "::Google::Longrunning::Operation", + "client": { + "short_name": "CloudRedisCluster::Client", + "full_name": "::Google::Cloud::Redis::Cluster::V1beta1::CloudRedisCluster::Client" + }, + "method": { + "short_name": "RescheduleClusterMaintenance", + "full_name": "google.cloud.redis.cluster.v1beta1.CloudRedisCluster.RescheduleClusterMaintenance", + "service": { + "short_name": "CloudRedisCluster", + "full_name": "google.cloud.redis.cluster.v1beta1.CloudRedisCluster" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 53, + "type": "FULL" + } + ] + }, + { + "region_tag": "redis_v1beta1_generated_CloudRedisCluster_ListBackupCollections_sync", + "title": "Snippet for the list_backup_collections call in the CloudRedisCluster service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Redis::Cluster::V1beta1::CloudRedisCluster::Client#list_backup_collections.", + "file": "cloud_redis_cluster/list_backup_collections.rb", + "language": "RUBY", + "client_method": { + "short_name": "list_backup_collections", + "full_name": "::Google::Cloud::Redis::Cluster::V1beta1::CloudRedisCluster::Client#list_backup_collections", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::Redis::Cluster::V1beta1::ListBackupCollectionsRequest", + "name": "request" + } + ], + "result_type": "::Google::Cloud::Redis::Cluster::V1beta1::ListBackupCollectionsResponse", + "client": { + "short_name": "CloudRedisCluster::Client", + "full_name": "::Google::Cloud::Redis::Cluster::V1beta1::CloudRedisCluster::Client" + }, + "method": { + "short_name": "ListBackupCollections", + "full_name": "google.cloud.redis.cluster.v1beta1.CloudRedisCluster.ListBackupCollections", + "service": { + "short_name": "CloudRedisCluster", + "full_name": "google.cloud.redis.cluster.v1beta1.CloudRedisCluster" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 50, + "type": "FULL" + } + ] + }, + { + "region_tag": "redis_v1beta1_generated_CloudRedisCluster_GetBackupCollection_sync", + "title": "Snippet for the get_backup_collection call in the CloudRedisCluster service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Redis::Cluster::V1beta1::CloudRedisCluster::Client#get_backup_collection.", + "file": "cloud_redis_cluster/get_backup_collection.rb", + "language": "RUBY", + "client_method": { + "short_name": "get_backup_collection", + "full_name": "::Google::Cloud::Redis::Cluster::V1beta1::CloudRedisCluster::Client#get_backup_collection", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::Redis::Cluster::V1beta1::GetBackupCollectionRequest", + "name": "request" + } + ], + "result_type": "::Google::Cloud::Redis::Cluster::V1beta1::BackupCollection", + "client": { + "short_name": "CloudRedisCluster::Client", + "full_name": "::Google::Cloud::Redis::Cluster::V1beta1::CloudRedisCluster::Client" + }, + "method": { + "short_name": "GetBackupCollection", + "full_name": "google.cloud.redis.cluster.v1beta1.CloudRedisCluster.GetBackupCollection", + "service": { + "short_name": "CloudRedisCluster", + "full_name": "google.cloud.redis.cluster.v1beta1.CloudRedisCluster" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 46, + "type": "FULL" + } + ] + }, + { + "region_tag": "redis_v1beta1_generated_CloudRedisCluster_ListBackups_sync", + "title": "Snippet for the list_backups call in the CloudRedisCluster service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Redis::Cluster::V1beta1::CloudRedisCluster::Client#list_backups.", + "file": "cloud_redis_cluster/list_backups.rb", + "language": "RUBY", + "client_method": { + "short_name": "list_backups", + "full_name": "::Google::Cloud::Redis::Cluster::V1beta1::CloudRedisCluster::Client#list_backups", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::Redis::Cluster::V1beta1::ListBackupsRequest", + "name": "request" + } + ], + "result_type": "::Google::Cloud::Redis::Cluster::V1beta1::ListBackupsResponse", + "client": { + "short_name": "CloudRedisCluster::Client", + "full_name": "::Google::Cloud::Redis::Cluster::V1beta1::CloudRedisCluster::Client" + }, + "method": { + "short_name": "ListBackups", + "full_name": "google.cloud.redis.cluster.v1beta1.CloudRedisCluster.ListBackups", + "service": { + "short_name": "CloudRedisCluster", + "full_name": "google.cloud.redis.cluster.v1beta1.CloudRedisCluster" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 50, + "type": "FULL" + } + ] + }, + { + "region_tag": "redis_v1beta1_generated_CloudRedisCluster_GetBackup_sync", + "title": "Snippet for the get_backup call in the CloudRedisCluster service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Redis::Cluster::V1beta1::CloudRedisCluster::Client#get_backup.", + "file": "cloud_redis_cluster/get_backup.rb", + "language": "RUBY", + "client_method": { + "short_name": "get_backup", + "full_name": "::Google::Cloud::Redis::Cluster::V1beta1::CloudRedisCluster::Client#get_backup", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::Redis::Cluster::V1beta1::GetBackupRequest", + "name": "request" + } + ], + "result_type": "::Google::Cloud::Redis::Cluster::V1beta1::Backup", + "client": { + "short_name": "CloudRedisCluster::Client", + "full_name": "::Google::Cloud::Redis::Cluster::V1beta1::CloudRedisCluster::Client" + }, + "method": { + "short_name": "GetBackup", + "full_name": "google.cloud.redis.cluster.v1beta1.CloudRedisCluster.GetBackup", + "service": { + "short_name": "CloudRedisCluster", + "full_name": "google.cloud.redis.cluster.v1beta1.CloudRedisCluster" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 46, + "type": "FULL" + } + ] + }, + { + "region_tag": "redis_v1beta1_generated_CloudRedisCluster_DeleteBackup_sync", + "title": "Snippet for the delete_backup call in the CloudRedisCluster service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Redis::Cluster::V1beta1::CloudRedisCluster::Client#delete_backup.", + "file": "cloud_redis_cluster/delete_backup.rb", + "language": "RUBY", + "client_method": { + "short_name": "delete_backup", + "full_name": "::Google::Cloud::Redis::Cluster::V1beta1::CloudRedisCluster::Client#delete_backup", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::Redis::Cluster::V1beta1::DeleteBackupRequest", + "name": "request" + } + ], + "result_type": "::Google::Longrunning::Operation", + "client": { + "short_name": "CloudRedisCluster::Client", + "full_name": "::Google::Cloud::Redis::Cluster::V1beta1::CloudRedisCluster::Client" + }, + "method": { + "short_name": "DeleteBackup", + "full_name": "google.cloud.redis.cluster.v1beta1.CloudRedisCluster.DeleteBackup", + "service": { + "short_name": "CloudRedisCluster", + "full_name": "google.cloud.redis.cluster.v1beta1.CloudRedisCluster" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 53, + "type": "FULL" + } + ] + }, + { + "region_tag": "redis_v1beta1_generated_CloudRedisCluster_ExportBackup_sync", + "title": "Snippet for the export_backup call in the CloudRedisCluster service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Redis::Cluster::V1beta1::CloudRedisCluster::Client#export_backup.", + "file": "cloud_redis_cluster/export_backup.rb", + "language": "RUBY", + "client_method": { + "short_name": "export_backup", + "full_name": "::Google::Cloud::Redis::Cluster::V1beta1::CloudRedisCluster::Client#export_backup", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::Redis::Cluster::V1beta1::ExportBackupRequest", + "name": "request" + } + ], + "result_type": "::Google::Longrunning::Operation", + "client": { + "short_name": "CloudRedisCluster::Client", + "full_name": "::Google::Cloud::Redis::Cluster::V1beta1::CloudRedisCluster::Client" + }, + "method": { + "short_name": "ExportBackup", + "full_name": "google.cloud.redis.cluster.v1beta1.CloudRedisCluster.ExportBackup", + "service": { + "short_name": "CloudRedisCluster", + "full_name": "google.cloud.redis.cluster.v1beta1.CloudRedisCluster" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 53, + "type": "FULL" + } + ] + }, + { + "region_tag": "redis_v1beta1_generated_CloudRedisCluster_BackupCluster_sync", + "title": "Snippet for the backup_cluster call in the CloudRedisCluster service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Redis::Cluster::V1beta1::CloudRedisCluster::Client#backup_cluster.", + "file": "cloud_redis_cluster/backup_cluster.rb", + "language": "RUBY", + "client_method": { + "short_name": "backup_cluster", + "full_name": "::Google::Cloud::Redis::Cluster::V1beta1::CloudRedisCluster::Client#backup_cluster", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::Redis::Cluster::V1beta1::BackupClusterRequest", + "name": "request" + } + ], + "result_type": "::Google::Longrunning::Operation", + "client": { + "short_name": "CloudRedisCluster::Client", + "full_name": "::Google::Cloud::Redis::Cluster::V1beta1::CloudRedisCluster::Client" + }, + "method": { + "short_name": "BackupCluster", + "full_name": "google.cloud.redis.cluster.v1beta1.CloudRedisCluster.BackupCluster", + "service": { + "short_name": "CloudRedisCluster", + "full_name": "google.cloud.redis.cluster.v1beta1.CloudRedisCluster" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 53, + "type": "FULL" + } + ] + } + ] +} \ No newline at end of file diff --git a/owl-bot-staging/google-cloud-redis-cluster-v1beta1/test/google/cloud/redis/cluster/v1beta1/cloud_redis_cluster_operations_test.rb b/owl-bot-staging/google-cloud-redis-cluster-v1beta1/test/google/cloud/redis/cluster/v1beta1/cloud_redis_cluster_operations_test.rb new file mode 100644 index 000000000000..7d3baf4c1ca7 --- /dev/null +++ b/owl-bot-staging/google-cloud-redis-cluster-v1beta1/test/google/cloud/redis/cluster/v1beta1/cloud_redis_cluster_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/cloud/redis/cluster/v1beta1/cloud_redis_cluster_pb" +require "google/cloud/redis/cluster/v1beta1/cloud_redis_cluster_services_pb" +require "google/cloud/redis/cluster/v1beta1/cloud_redis_cluster" + +class ::Google::Cloud::Redis::Cluster::V1beta1::CloudRedisCluster::OperationsTest < Minitest::Test + class ClientStub + attr_accessor :call_rpc_count, :requests + + def initialize response, operation, &block + @response = response + @operation = operation + @block = block + @call_rpc_count = 0 + @requests = [] + end + + def call_rpc *args, **kwargs + @call_rpc_count += 1 + + @requests << @block&.call(*args, **kwargs) + + catch :response do + yield @response, @operation if block_given? + @response + end + end + + def endpoint + "endpoint.example.com" + end + + def universe_domain + "example.com" + end + + def stub_logger + nil + end + + def logger + nil + end + end + + def test_list_operations + # Create GRPC objects. + grpc_response = ::Google::Longrunning::ListOperationsResponse.new + grpc_operation = GRPC::ActiveCall::Operation.new nil + grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + grpc_options = {} + + # Create request parameters for a unary method. + name = "hello world" + filter = "hello world" + page_size = 42 + page_token = "hello world" + return_partial_success = true + + list_operations_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :list_operations, name + assert_kind_of ::Google::Longrunning::ListOperationsRequest, request + assert_equal "hello world", request["name"] + assert_equal "hello world", request["filter"] + assert_equal 42, request["page_size"] + assert_equal "hello world", request["page_token"] + assert_equal true, request["return_partial_success"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, list_operations_client_stub do + # Create client + client = ::Google::Cloud::Redis::Cluster::V1beta1::CloudRedisCluster::Operations.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.list_operations({ name: name, filter: filter, page_size: page_size, page_token: page_token, return_partial_success: return_partial_success }) do |response, operation| + assert_kind_of Gapic::PagedEnumerable, response + assert_equal grpc_response, response.response + assert_equal grpc_operation, operation + end + + # Use named arguments + client.list_operations name: name, filter: filter, page_size: page_size, page_token: page_token, return_partial_success: return_partial_success do |response, operation| + assert_kind_of Gapic::PagedEnumerable, response + assert_equal grpc_response, response.response + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.list_operations ::Google::Longrunning::ListOperationsRequest.new(name: name, filter: filter, page_size: page_size, page_token: page_token, return_partial_success: return_partial_success) do |response, operation| + assert_kind_of Gapic::PagedEnumerable, response + assert_equal grpc_response, response.response + assert_equal grpc_operation, operation + end + + # Use hash object with options + client.list_operations({ name: name, filter: filter, page_size: page_size, page_token: page_token, return_partial_success: return_partial_success }, grpc_options) do |response, operation| + assert_kind_of Gapic::PagedEnumerable, response + assert_equal grpc_response, response.response + assert_equal grpc_operation, operation + end + + # Use protobuf object with options + client.list_operations(::Google::Longrunning::ListOperationsRequest.new(name: name, filter: filter, page_size: page_size, page_token: page_token, return_partial_success: return_partial_success), grpc_options) do |response, operation| + assert_kind_of Gapic::PagedEnumerable, response + assert_equal grpc_response, response.response + assert_equal grpc_operation, operation + end + + # Verify method calls + assert_equal 5, list_operations_client_stub.call_rpc_count + end + end + + def test_get_operation + # Create GRPC objects. + grpc_response = ::Google::Longrunning::Operation.new + grpc_operation = GRPC::ActiveCall::Operation.new nil + grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + grpc_options = {} + + # Create request parameters for a unary method. + name = "hello world" + + get_operation_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :get_operation, name + assert_kind_of ::Google::Longrunning::GetOperationRequest, request + assert_equal "hello world", request["name"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, get_operation_client_stub do + # Create client + client = ::Google::Cloud::Redis::Cluster::V1beta1::CloudRedisCluster::Operations.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.get_operation({ name: name }) do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Use named arguments + client.get_operation name: name do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.get_operation ::Google::Longrunning::GetOperationRequest.new(name: name) do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Use hash object with options + client.get_operation({ name: name }, grpc_options) do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Use protobuf object with options + client.get_operation(::Google::Longrunning::GetOperationRequest.new(name: name), grpc_options) do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Verify method calls + assert_equal 5, get_operation_client_stub.call_rpc_count + end + end + + def test_delete_operation + # Create GRPC objects. + grpc_response = ::Google::Protobuf::Empty.new + grpc_operation = GRPC::ActiveCall::Operation.new nil + grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + grpc_options = {} + + # Create request parameters for a unary method. + name = "hello world" + + delete_operation_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :delete_operation, name + assert_kind_of ::Google::Longrunning::DeleteOperationRequest, request + assert_equal "hello world", request["name"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, delete_operation_client_stub do + # Create client + client = ::Google::Cloud::Redis::Cluster::V1beta1::CloudRedisCluster::Operations.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.delete_operation({ name: name }) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use named arguments + client.delete_operation name: name do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.delete_operation ::Google::Longrunning::DeleteOperationRequest.new(name: name) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use hash object with options + client.delete_operation({ name: name }, grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object with options + client.delete_operation(::Google::Longrunning::DeleteOperationRequest.new(name: name), grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Verify method calls + assert_equal 5, delete_operation_client_stub.call_rpc_count + end + end + + def test_cancel_operation + # Create GRPC objects. + grpc_response = ::Google::Protobuf::Empty.new + grpc_operation = GRPC::ActiveCall::Operation.new nil + grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + grpc_options = {} + + # Create request parameters for a unary method. + name = "hello world" + + cancel_operation_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :cancel_operation, name + assert_kind_of ::Google::Longrunning::CancelOperationRequest, request + assert_equal "hello world", request["name"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, cancel_operation_client_stub do + # Create client + client = ::Google::Cloud::Redis::Cluster::V1beta1::CloudRedisCluster::Operations.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.cancel_operation({ name: name }) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use named arguments + client.cancel_operation name: name do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.cancel_operation ::Google::Longrunning::CancelOperationRequest.new(name: name) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use hash object with options + client.cancel_operation({ name: name }, grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object with options + client.cancel_operation(::Google::Longrunning::CancelOperationRequest.new(name: name), grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Verify method calls + assert_equal 5, cancel_operation_client_stub.call_rpc_count + end + end + + def test_wait_operation + # Create GRPC objects. + grpc_response = ::Google::Longrunning::Operation.new + grpc_operation = GRPC::ActiveCall::Operation.new nil + grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + grpc_options = {} + + # Create request parameters for a unary method. + name = "hello world" + timeout = {} + + wait_operation_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :wait_operation, name + assert_kind_of ::Google::Longrunning::WaitOperationRequest, request + assert_equal "hello world", request["name"] + assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Protobuf::Duration), request["timeout"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, wait_operation_client_stub do + # Create client + client = ::Google::Cloud::Redis::Cluster::V1beta1::CloudRedisCluster::Operations.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.wait_operation({ name: name, timeout: timeout }) do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Use named arguments + client.wait_operation name: name, timeout: timeout do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.wait_operation ::Google::Longrunning::WaitOperationRequest.new(name: name, timeout: timeout) do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Use hash object with options + client.wait_operation({ name: name, timeout: timeout }, grpc_options) do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Use protobuf object with options + client.wait_operation(::Google::Longrunning::WaitOperationRequest.new(name: name, timeout: timeout), grpc_options) do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Verify method calls + assert_equal 5, wait_operation_client_stub.call_rpc_count + end + end + + def test_configure + grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + + client = block_config = config = nil + dummy_stub = ClientStub.new nil, nil + Gapic::ServiceStub.stub :new, dummy_stub do + client = ::Google::Cloud::Redis::Cluster::V1beta1::CloudRedisCluster::Operations.new do |config| + config.credentials = grpc_channel + end + end + + config = client.configure do |c| + block_config = c + end + + assert_same block_config, config + assert_kind_of ::Google::Cloud::Redis::Cluster::V1beta1::CloudRedisCluster::Operations::Configuration, config + end +end diff --git a/owl-bot-staging/google-cloud-redis-cluster-v1beta1/test/google/cloud/redis/cluster/v1beta1/cloud_redis_cluster_paths_test.rb b/owl-bot-staging/google-cloud-redis-cluster-v1beta1/test/google/cloud/redis/cluster/v1beta1/cloud_redis_cluster_paths_test.rb new file mode 100644 index 000000000000..26bfd76d5d1c --- /dev/null +++ b/owl-bot-staging/google-cloud-redis-cluster-v1beta1/test/google/cloud/redis/cluster/v1beta1/cloud_redis_cluster_paths_test.rb @@ -0,0 +1,163 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +require "helper" + +require "gapic/grpc/service_stub" + +require "google/cloud/redis/cluster/v1beta1/cloud_redis_cluster" + +class ::Google::Cloud::Redis::Cluster::V1beta1::CloudRedisCluster::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_backup_path + grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + ::Gapic::ServiceStub.stub :new, DummyStub.new do + client = ::Google::Cloud::Redis::Cluster::V1beta1::CloudRedisCluster::Client.new do |config| + config.credentials = grpc_channel + end + + path = client.backup_path project: "value0", location: "value1", backup_collection: "value2", backup: "value3" + assert_equal "projects/value0/locations/value1/backupCollections/value2/backups/value3", path + end + end + + def test_backup_collection_path + grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + ::Gapic::ServiceStub.stub :new, DummyStub.new do + client = ::Google::Cloud::Redis::Cluster::V1beta1::CloudRedisCluster::Client.new do |config| + config.credentials = grpc_channel + end + + path = client.backup_collection_path project: "value0", location: "value1", backup_collection: "value2" + assert_equal "projects/value0/locations/value1/backupCollections/value2", path + end + end + + def test_certificate_authority_path + grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + ::Gapic::ServiceStub.stub :new, DummyStub.new do + client = ::Google::Cloud::Redis::Cluster::V1beta1::CloudRedisCluster::Client.new do |config| + config.credentials = grpc_channel + end + + path = client.certificate_authority_path project: "value0", location: "value1", cluster: "value2" + assert_equal "projects/value0/locations/value1/clusters/value2/certificateAuthority", path + end + end + + def test_cluster_path + grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + ::Gapic::ServiceStub.stub :new, DummyStub.new do + client = ::Google::Cloud::Redis::Cluster::V1beta1::CloudRedisCluster::Client.new do |config| + config.credentials = grpc_channel + end + + path = client.cluster_path project: "value0", location: "value1", cluster: "value2" + assert_equal "projects/value0/locations/value1/clusters/value2", path + end + end + + def test_crypto_key_path + grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + ::Gapic::ServiceStub.stub :new, DummyStub.new do + client = ::Google::Cloud::Redis::Cluster::V1beta1::CloudRedisCluster::Client.new do |config| + config.credentials = grpc_channel + end + + path = client.crypto_key_path project: "value0", location: "value1", key_ring: "value2", crypto_key: "value3" + assert_equal "projects/value0/locations/value1/keyRings/value2/cryptoKeys/value3", path + end + end + + def test_crypto_key_version_path + grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + ::Gapic::ServiceStub.stub :new, DummyStub.new do + client = ::Google::Cloud::Redis::Cluster::V1beta1::CloudRedisCluster::Client.new do |config| + config.credentials = grpc_channel + end + + path = client.crypto_key_version_path project: "value0", location: "value1", key_ring: "value2", crypto_key: "value3", crypto_key_version: "value4" + assert_equal "projects/value0/locations/value1/keyRings/value2/cryptoKeys/value3/cryptoKeyVersions/value4", path + end + end + + def test_forwarding_rule_path + grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + ::Gapic::ServiceStub.stub :new, DummyStub.new do + client = ::Google::Cloud::Redis::Cluster::V1beta1::CloudRedisCluster::Client.new do |config| + config.credentials = grpc_channel + end + + path = client.forwarding_rule_path project: "value0", region: "value1", forwarding_rule: "value2" + assert_equal "projects/value0/regions/value1/forwardingRules/value2", path + end + end + + def test_location_path + grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + ::Gapic::ServiceStub.stub :new, DummyStub.new do + client = ::Google::Cloud::Redis::Cluster::V1beta1::CloudRedisCluster::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_network_path + grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + ::Gapic::ServiceStub.stub :new, DummyStub.new do + client = ::Google::Cloud::Redis::Cluster::V1beta1::CloudRedisCluster::Client.new do |config| + config.credentials = grpc_channel + end + + path = client.network_path project: "value0", network: "value1" + assert_equal "projects/value0/global/networks/value1", path + end + end + + def test_service_attachment_path + grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + ::Gapic::ServiceStub.stub :new, DummyStub.new do + client = ::Google::Cloud::Redis::Cluster::V1beta1::CloudRedisCluster::Client.new do |config| + config.credentials = grpc_channel + end + + path = client.service_attachment_path project: "value0", region: "value1", service_attachment: "value2" + assert_equal "projects/value0/regions/value1/serviceAttachments/value2", path + end + end +end diff --git a/owl-bot-staging/google-cloud-redis-cluster-v1beta1/test/google/cloud/redis/cluster/v1beta1/cloud_redis_cluster_rest_test.rb b/owl-bot-staging/google-cloud-redis-cluster-v1beta1/test/google/cloud/redis/cluster/v1beta1/cloud_redis_cluster_rest_test.rb new file mode 100644 index 000000000000..906ca29bdc78 --- /dev/null +++ b/owl-bot-staging/google-cloud-redis-cluster-v1beta1/test/google/cloud/redis/cluster/v1beta1/cloud_redis_cluster_rest_test.rb @@ -0,0 +1,873 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +require "helper" +require "gapic/rest" +require "google/cloud/redis/cluster/v1beta1/cloud_redis_cluster_pb" +require "google/cloud/redis/cluster/v1beta1/cloud_redis_cluster/rest" + + +class ::Google::Cloud::Redis::Cluster::V1beta1::CloudRedisCluster::Rest::ClientTest < Minitest::Test + class ClientStub + attr_accessor :call_count, :requests + + def initialize response, &block + @response = response + @block = block + @call_count = 0 + @requests = [] + end + + def make_get_request uri:, params: {}, options: {}, method_name: nil + make_http_request :get, uri: uri, body: nil, params: params, options: options, method_name: method_name + end + + def make_delete_request uri:, params: {}, options: {}, method_name: nil + make_http_request :delete, uri: uri, body: nil, params: params, options: options, method_name: method_name + end + + def make_post_request uri:, body: nil, params: {}, options: {}, method_name: nil + make_http_request :post, uri: uri, body: body, params: params, options: options, method_name: method_name + end + + def make_patch_request uri:, body:, params: {}, options: {}, method_name: nil + make_http_request :patch, uri: uri, body: body, params: params, options: options, method_name: method_name + end + + def make_put_request uri:, body:, params: {}, options: {}, method_name: nil + make_http_request :put, uri: uri, body: body, params: params, options: options, method_name: method_name + end + + def make_http_request *args, **kwargs + @call_count += 1 + + @requests << @block&.call(*args, **kwargs) + + @response + end + + def endpoint + "endpoint.example.com" + end + + def universe_domain + "example.com" + end + + def stub_logger + nil + end + + def logger + nil + end + end + + def test_list_clusters + # Create test objects. + client_result = ::Google::Cloud::Redis::Cluster::V1beta1::ListClustersResponse.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_clusters_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| + assert options.metadata.key? :"x-goog-api-client" + assert options.metadata[:"x-goog-api-client"].include? "rest" + refute options.metadata[:"x-goog-api-client"].include? "grpc" + end + + ::Google::Cloud::Redis::Cluster::V1beta1::CloudRedisCluster::Rest::ServiceStub.stub :transcode_list_clusters_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, list_clusters_client_stub do + # Create client + client = ::Google::Cloud::Redis::Cluster::V1beta1::CloudRedisCluster::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.list_clusters({ 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_clusters 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_clusters ::Google::Cloud::Redis::Cluster::V1beta1::ListClustersRequest.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_clusters({ 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_clusters(::Google::Cloud::Redis::Cluster::V1beta1::ListClustersRequest.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_clusters_client_stub.call_count + end + end + end + + def test_get_cluster + # Create test objects. + client_result = ::Google::Cloud::Redis::Cluster::V1beta1::Cluster.new + http_response = OpenStruct.new body: client_result.to_json + + call_options = {} + + # Create request parameters for a unary method. + name = "hello world" + + get_cluster_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| + assert options.metadata.key? :"x-goog-api-client" + assert options.metadata[:"x-goog-api-client"].include? "rest" + refute options.metadata[:"x-goog-api-client"].include? "grpc" + end + + ::Google::Cloud::Redis::Cluster::V1beta1::CloudRedisCluster::Rest::ServiceStub.stub :transcode_get_cluster_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, get_cluster_client_stub do + # Create client + client = ::Google::Cloud::Redis::Cluster::V1beta1::CloudRedisCluster::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.get_cluster({ name: name }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.get_cluster name: name do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.get_cluster ::Google::Cloud::Redis::Cluster::V1beta1::GetClusterRequest.new(name: name) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + client.get_cluster({ name: name }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + client.get_cluster(::Google::Cloud::Redis::Cluster::V1beta1::GetClusterRequest.new(name: name), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, get_cluster_client_stub.call_count + end + end + end + + def test_update_cluster + # 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. + update_mask = {} + cluster = {} + request_id = "hello world" + + update_cluster_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| + assert options.metadata.key? :"x-goog-api-client" + assert options.metadata[:"x-goog-api-client"].include? "rest" + refute options.metadata[:"x-goog-api-client"].include? "grpc" + end + + ::Google::Cloud::Redis::Cluster::V1beta1::CloudRedisCluster::Rest::ServiceStub.stub :transcode_update_cluster_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, update_cluster_client_stub do + # Create client + client = ::Google::Cloud::Redis::Cluster::V1beta1::CloudRedisCluster::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.update_cluster({ update_mask: update_mask, cluster: cluster, request_id: request_id }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.update_cluster update_mask: update_mask, cluster: cluster, request_id: request_id do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.update_cluster ::Google::Cloud::Redis::Cluster::V1beta1::UpdateClusterRequest.new(update_mask: update_mask, cluster: cluster, request_id: request_id) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + client.update_cluster({ update_mask: update_mask, cluster: cluster, request_id: request_id }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + client.update_cluster(::Google::Cloud::Redis::Cluster::V1beta1::UpdateClusterRequest.new(update_mask: update_mask, cluster: cluster, request_id: request_id), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, update_cluster_client_stub.call_count + end + end + end + + def test_delete_cluster + # 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" + request_id = "hello world" + + delete_cluster_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| + assert options.metadata.key? :"x-goog-api-client" + assert options.metadata[:"x-goog-api-client"].include? "rest" + refute options.metadata[:"x-goog-api-client"].include? "grpc" + end + + ::Google::Cloud::Redis::Cluster::V1beta1::CloudRedisCluster::Rest::ServiceStub.stub :transcode_delete_cluster_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, delete_cluster_client_stub do + # Create client + client = ::Google::Cloud::Redis::Cluster::V1beta1::CloudRedisCluster::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.delete_cluster({ name: name, request_id: request_id }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.delete_cluster name: name, request_id: request_id do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.delete_cluster ::Google::Cloud::Redis::Cluster::V1beta1::DeleteClusterRequest.new(name: name, request_id: request_id) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + client.delete_cluster({ name: name, request_id: request_id }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + client.delete_cluster(::Google::Cloud::Redis::Cluster::V1beta1::DeleteClusterRequest.new(name: name, request_id: request_id), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, delete_cluster_client_stub.call_count + end + end + end + + def test_create_cluster + # 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" + cluster_id = "hello world" + cluster = {} + request_id = "hello world" + + create_cluster_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| + assert options.metadata.key? :"x-goog-api-client" + assert options.metadata[:"x-goog-api-client"].include? "rest" + refute options.metadata[:"x-goog-api-client"].include? "grpc" + end + + ::Google::Cloud::Redis::Cluster::V1beta1::CloudRedisCluster::Rest::ServiceStub.stub :transcode_create_cluster_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, create_cluster_client_stub do + # Create client + client = ::Google::Cloud::Redis::Cluster::V1beta1::CloudRedisCluster::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.create_cluster({ parent: parent, cluster_id: cluster_id, cluster: cluster, request_id: request_id }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.create_cluster parent: parent, cluster_id: cluster_id, cluster: cluster, request_id: request_id do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.create_cluster ::Google::Cloud::Redis::Cluster::V1beta1::CreateClusterRequest.new(parent: parent, cluster_id: cluster_id, cluster: cluster, request_id: request_id) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + client.create_cluster({ parent: parent, cluster_id: cluster_id, cluster: cluster, request_id: request_id }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + client.create_cluster(::Google::Cloud::Redis::Cluster::V1beta1::CreateClusterRequest.new(parent: parent, cluster_id: cluster_id, cluster: cluster, request_id: request_id), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, create_cluster_client_stub.call_count + end + end + end + + def test_get_cluster_certificate_authority + # Create test objects. + client_result = ::Google::Cloud::Redis::Cluster::V1beta1::CertificateAuthority.new + http_response = OpenStruct.new body: client_result.to_json + + call_options = {} + + # Create request parameters for a unary method. + name = "hello world" + + get_cluster_certificate_authority_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| + assert options.metadata.key? :"x-goog-api-client" + assert options.metadata[:"x-goog-api-client"].include? "rest" + refute options.metadata[:"x-goog-api-client"].include? "grpc" + end + + ::Google::Cloud::Redis::Cluster::V1beta1::CloudRedisCluster::Rest::ServiceStub.stub :transcode_get_cluster_certificate_authority_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, get_cluster_certificate_authority_client_stub do + # Create client + client = ::Google::Cloud::Redis::Cluster::V1beta1::CloudRedisCluster::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.get_cluster_certificate_authority({ name: name }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.get_cluster_certificate_authority name: name do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.get_cluster_certificate_authority ::Google::Cloud::Redis::Cluster::V1beta1::GetClusterCertificateAuthorityRequest.new(name: name) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + client.get_cluster_certificate_authority({ name: name }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + client.get_cluster_certificate_authority(::Google::Cloud::Redis::Cluster::V1beta1::GetClusterCertificateAuthorityRequest.new(name: name), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, get_cluster_certificate_authority_client_stub.call_count + end + end + end + + def test_reschedule_cluster_maintenance + # 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" + reschedule_type = :RESCHEDULE_TYPE_UNSPECIFIED + schedule_time = {} + + reschedule_cluster_maintenance_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| + assert options.metadata.key? :"x-goog-api-client" + assert options.metadata[:"x-goog-api-client"].include? "rest" + refute options.metadata[:"x-goog-api-client"].include? "grpc" + end + + ::Google::Cloud::Redis::Cluster::V1beta1::CloudRedisCluster::Rest::ServiceStub.stub :transcode_reschedule_cluster_maintenance_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, reschedule_cluster_maintenance_client_stub do + # Create client + client = ::Google::Cloud::Redis::Cluster::V1beta1::CloudRedisCluster::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.reschedule_cluster_maintenance({ name: name, reschedule_type: reschedule_type, schedule_time: schedule_time }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.reschedule_cluster_maintenance name: name, reschedule_type: reschedule_type, schedule_time: schedule_time do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.reschedule_cluster_maintenance ::Google::Cloud::Redis::Cluster::V1beta1::RescheduleClusterMaintenanceRequest.new(name: name, reschedule_type: reschedule_type, schedule_time: schedule_time) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + client.reschedule_cluster_maintenance({ name: name, reschedule_type: reschedule_type, schedule_time: schedule_time }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + client.reschedule_cluster_maintenance(::Google::Cloud::Redis::Cluster::V1beta1::RescheduleClusterMaintenanceRequest.new(name: name, reschedule_type: reschedule_type, schedule_time: schedule_time), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, reschedule_cluster_maintenance_client_stub.call_count + end + end + end + + def test_list_backup_collections + # Create test objects. + client_result = ::Google::Cloud::Redis::Cluster::V1beta1::ListBackupCollectionsResponse.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_backup_collections_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| + assert options.metadata.key? :"x-goog-api-client" + assert options.metadata[:"x-goog-api-client"].include? "rest" + refute options.metadata[:"x-goog-api-client"].include? "grpc" + end + + ::Google::Cloud::Redis::Cluster::V1beta1::CloudRedisCluster::Rest::ServiceStub.stub :transcode_list_backup_collections_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, list_backup_collections_client_stub do + # Create client + client = ::Google::Cloud::Redis::Cluster::V1beta1::CloudRedisCluster::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.list_backup_collections({ 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_backup_collections 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_backup_collections ::Google::Cloud::Redis::Cluster::V1beta1::ListBackupCollectionsRequest.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_backup_collections({ 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_backup_collections(::Google::Cloud::Redis::Cluster::V1beta1::ListBackupCollectionsRequest.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_backup_collections_client_stub.call_count + end + end + end + + def test_get_backup_collection + # Create test objects. + client_result = ::Google::Cloud::Redis::Cluster::V1beta1::BackupCollection.new + http_response = OpenStruct.new body: client_result.to_json + + call_options = {} + + # Create request parameters for a unary method. + name = "hello world" + + get_backup_collection_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| + assert options.metadata.key? :"x-goog-api-client" + assert options.metadata[:"x-goog-api-client"].include? "rest" + refute options.metadata[:"x-goog-api-client"].include? "grpc" + end + + ::Google::Cloud::Redis::Cluster::V1beta1::CloudRedisCluster::Rest::ServiceStub.stub :transcode_get_backup_collection_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, get_backup_collection_client_stub do + # Create client + client = ::Google::Cloud::Redis::Cluster::V1beta1::CloudRedisCluster::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.get_backup_collection({ name: name }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.get_backup_collection name: name do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.get_backup_collection ::Google::Cloud::Redis::Cluster::V1beta1::GetBackupCollectionRequest.new(name: name) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + client.get_backup_collection({ name: name }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + client.get_backup_collection(::Google::Cloud::Redis::Cluster::V1beta1::GetBackupCollectionRequest.new(name: name), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, get_backup_collection_client_stub.call_count + end + end + end + + def test_list_backups + # Create test objects. + client_result = ::Google::Cloud::Redis::Cluster::V1beta1::ListBackupsResponse.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_backups_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| + assert options.metadata.key? :"x-goog-api-client" + assert options.metadata[:"x-goog-api-client"].include? "rest" + refute options.metadata[:"x-goog-api-client"].include? "grpc" + end + + ::Google::Cloud::Redis::Cluster::V1beta1::CloudRedisCluster::Rest::ServiceStub.stub :transcode_list_backups_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, list_backups_client_stub do + # Create client + client = ::Google::Cloud::Redis::Cluster::V1beta1::CloudRedisCluster::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.list_backups({ 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_backups 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_backups ::Google::Cloud::Redis::Cluster::V1beta1::ListBackupsRequest.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_backups({ 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_backups(::Google::Cloud::Redis::Cluster::V1beta1::ListBackupsRequest.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_backups_client_stub.call_count + end + end + end + + def test_get_backup + # Create test objects. + client_result = ::Google::Cloud::Redis::Cluster::V1beta1::Backup.new + http_response = OpenStruct.new body: client_result.to_json + + call_options = {} + + # Create request parameters for a unary method. + name = "hello world" + + get_backup_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| + assert options.metadata.key? :"x-goog-api-client" + assert options.metadata[:"x-goog-api-client"].include? "rest" + refute options.metadata[:"x-goog-api-client"].include? "grpc" + end + + ::Google::Cloud::Redis::Cluster::V1beta1::CloudRedisCluster::Rest::ServiceStub.stub :transcode_get_backup_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, get_backup_client_stub do + # Create client + client = ::Google::Cloud::Redis::Cluster::V1beta1::CloudRedisCluster::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.get_backup({ name: name }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.get_backup name: name do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.get_backup ::Google::Cloud::Redis::Cluster::V1beta1::GetBackupRequest.new(name: name) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + client.get_backup({ name: name }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + client.get_backup(::Google::Cloud::Redis::Cluster::V1beta1::GetBackupRequest.new(name: name), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, get_backup_client_stub.call_count + end + end + end + + def test_delete_backup + # 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" + request_id = "hello world" + + delete_backup_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| + assert options.metadata.key? :"x-goog-api-client" + assert options.metadata[:"x-goog-api-client"].include? "rest" + refute options.metadata[:"x-goog-api-client"].include? "grpc" + end + + ::Google::Cloud::Redis::Cluster::V1beta1::CloudRedisCluster::Rest::ServiceStub.stub :transcode_delete_backup_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, delete_backup_client_stub do + # Create client + client = ::Google::Cloud::Redis::Cluster::V1beta1::CloudRedisCluster::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.delete_backup({ name: name, request_id: request_id }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.delete_backup name: name, request_id: request_id do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.delete_backup ::Google::Cloud::Redis::Cluster::V1beta1::DeleteBackupRequest.new(name: name, request_id: request_id) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + client.delete_backup({ name: name, request_id: request_id }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + client.delete_backup(::Google::Cloud::Redis::Cluster::V1beta1::DeleteBackupRequest.new(name: name, request_id: request_id), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, delete_backup_client_stub.call_count + end + end + end + + def test_export_backup + # 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. + gcs_bucket = "hello world" + name = "hello world" + + export_backup_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| + assert options.metadata.key? :"x-goog-api-client" + assert options.metadata[:"x-goog-api-client"].include? "rest" + refute options.metadata[:"x-goog-api-client"].include? "grpc" + end + + ::Google::Cloud::Redis::Cluster::V1beta1::CloudRedisCluster::Rest::ServiceStub.stub :transcode_export_backup_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, export_backup_client_stub do + # Create client + client = ::Google::Cloud::Redis::Cluster::V1beta1::CloudRedisCluster::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.export_backup({ gcs_bucket: gcs_bucket, name: name }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.export_backup gcs_bucket: gcs_bucket, name: name do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.export_backup ::Google::Cloud::Redis::Cluster::V1beta1::ExportBackupRequest.new(gcs_bucket: gcs_bucket, name: name) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + client.export_backup({ gcs_bucket: gcs_bucket, name: name }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + client.export_backup(::Google::Cloud::Redis::Cluster::V1beta1::ExportBackupRequest.new(gcs_bucket: gcs_bucket, name: name), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, export_backup_client_stub.call_count + end + end + end + + def test_backup_cluster + # 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" + ttl = {} + backup_id = "hello world" + + backup_cluster_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| + assert options.metadata.key? :"x-goog-api-client" + assert options.metadata[:"x-goog-api-client"].include? "rest" + refute options.metadata[:"x-goog-api-client"].include? "grpc" + end + + ::Google::Cloud::Redis::Cluster::V1beta1::CloudRedisCluster::Rest::ServiceStub.stub :transcode_backup_cluster_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, backup_cluster_client_stub do + # Create client + client = ::Google::Cloud::Redis::Cluster::V1beta1::CloudRedisCluster::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.backup_cluster({ name: name, ttl: ttl, backup_id: backup_id }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.backup_cluster name: name, ttl: ttl, backup_id: backup_id do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.backup_cluster ::Google::Cloud::Redis::Cluster::V1beta1::BackupClusterRequest.new(name: name, ttl: ttl, backup_id: backup_id) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + client.backup_cluster({ name: name, ttl: ttl, backup_id: backup_id }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + client.backup_cluster(::Google::Cloud::Redis::Cluster::V1beta1::BackupClusterRequest.new(name: name, ttl: ttl, backup_id: backup_id), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, backup_cluster_client_stub.call_count + end + end + end + + def test_configure + credentials_token = :dummy_value + + client = block_config = config = nil + dummy_stub = ClientStub.new nil + Gapic::Rest::ClientStub.stub :new, dummy_stub do + client = ::Google::Cloud::Redis::Cluster::V1beta1::CloudRedisCluster::Rest::Client.new do |config| + config.credentials = credentials_token + end + end + + config = client.configure do |c| + block_config = c + end + + assert_same block_config, config + assert_kind_of ::Google::Cloud::Redis::Cluster::V1beta1::CloudRedisCluster::Rest::Client::Configuration, config + end +end diff --git a/owl-bot-staging/google-cloud-redis-cluster-v1beta1/test/google/cloud/redis/cluster/v1beta1/cloud_redis_cluster_test.rb b/owl-bot-staging/google-cloud-redis-cluster-v1beta1/test/google/cloud/redis/cluster/v1beta1/cloud_redis_cluster_test.rb new file mode 100644 index 000000000000..5699b33b9472 --- /dev/null +++ b/owl-bot-staging/google-cloud-redis-cluster-v1beta1/test/google/cloud/redis/cluster/v1beta1/cloud_redis_cluster_test.rb @@ -0,0 +1,1018 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +require "helper" + +require "gapic/grpc/service_stub" + +require "google/cloud/redis/cluster/v1beta1/cloud_redis_cluster_pb" +require "google/cloud/redis/cluster/v1beta1/cloud_redis_cluster" + +class ::Google::Cloud::Redis::Cluster::V1beta1::CloudRedisCluster::ClientTest < Minitest::Test + class ClientStub + attr_accessor :call_rpc_count, :requests + + def initialize response, operation, &block + @response = response + @operation = operation + @block = block + @call_rpc_count = 0 + @requests = [] + end + + def call_rpc *args, **kwargs + @call_rpc_count += 1 + + @requests << @block&.call(*args, **kwargs) + + catch :response do + yield @response, @operation if block_given? + @response + end + end + + def endpoint + "endpoint.example.com" + end + + def universe_domain + "example.com" + end + + def stub_logger + nil + end + + def logger + nil + end + end + + def test_list_clusters + # Create GRPC objects. + grpc_response = ::Google::Cloud::Redis::Cluster::V1beta1::ListClustersResponse.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_clusters_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :list_clusters, name + assert_kind_of ::Google::Cloud::Redis::Cluster::V1beta1::ListClustersRequest, 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_clusters_client_stub do + # Create client + client = ::Google::Cloud::Redis::Cluster::V1beta1::CloudRedisCluster::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.list_clusters({ 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_clusters 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_clusters ::Google::Cloud::Redis::Cluster::V1beta1::ListClustersRequest.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_clusters({ 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_clusters(::Google::Cloud::Redis::Cluster::V1beta1::ListClustersRequest.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_clusters_client_stub.call_rpc_count + end + end + + def test_get_cluster + # Create GRPC objects. + grpc_response = ::Google::Cloud::Redis::Cluster::V1beta1::Cluster.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_cluster_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :get_cluster, name + assert_kind_of ::Google::Cloud::Redis::Cluster::V1beta1::GetClusterRequest, request + assert_equal "hello world", request["name"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, get_cluster_client_stub do + # Create client + client = ::Google::Cloud::Redis::Cluster::V1beta1::CloudRedisCluster::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.get_cluster({ name: name }) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use named arguments + client.get_cluster name: name do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.get_cluster ::Google::Cloud::Redis::Cluster::V1beta1::GetClusterRequest.new(name: name) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use hash object with options + client.get_cluster({ 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_cluster(::Google::Cloud::Redis::Cluster::V1beta1::GetClusterRequest.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_cluster_client_stub.call_rpc_count + end + end + + def test_update_cluster + # 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. + update_mask = {} + cluster = {} + request_id = "hello world" + + update_cluster_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :update_cluster, name + assert_kind_of ::Google::Cloud::Redis::Cluster::V1beta1::UpdateClusterRequest, request + assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Protobuf::FieldMask), request["update_mask"] + assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::Redis::Cluster::V1beta1::Cluster), request["cluster"] + assert_equal "hello world", request["request_id"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, update_cluster_client_stub do + # Create client + client = ::Google::Cloud::Redis::Cluster::V1beta1::CloudRedisCluster::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.update_cluster({ update_mask: update_mask, cluster: cluster, request_id: request_id }) do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Use named arguments + client.update_cluster update_mask: update_mask, cluster: cluster, request_id: request_id do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.update_cluster ::Google::Cloud::Redis::Cluster::V1beta1::UpdateClusterRequest.new(update_mask: update_mask, cluster: cluster, request_id: request_id) do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Use hash object with options + client.update_cluster({ update_mask: update_mask, cluster: cluster, request_id: request_id }, grpc_options) do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Use protobuf object with options + client.update_cluster(::Google::Cloud::Redis::Cluster::V1beta1::UpdateClusterRequest.new(update_mask: update_mask, cluster: cluster, request_id: request_id), grpc_options) do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Verify method calls + assert_equal 5, update_cluster_client_stub.call_rpc_count + end + end + + def test_delete_cluster + # 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" + request_id = "hello world" + + delete_cluster_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :delete_cluster, name + assert_kind_of ::Google::Cloud::Redis::Cluster::V1beta1::DeleteClusterRequest, request + assert_equal "hello world", request["name"] + assert_equal "hello world", request["request_id"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, delete_cluster_client_stub do + # Create client + client = ::Google::Cloud::Redis::Cluster::V1beta1::CloudRedisCluster::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.delete_cluster({ name: name, request_id: request_id }) do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Use named arguments + client.delete_cluster name: name, request_id: request_id do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.delete_cluster ::Google::Cloud::Redis::Cluster::V1beta1::DeleteClusterRequest.new(name: name, request_id: request_id) do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Use hash object with options + client.delete_cluster({ name: name, request_id: request_id }, grpc_options) do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Use protobuf object with options + client.delete_cluster(::Google::Cloud::Redis::Cluster::V1beta1::DeleteClusterRequest.new(name: name, request_id: request_id), grpc_options) do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Verify method calls + assert_equal 5, delete_cluster_client_stub.call_rpc_count + end + end + + def test_create_cluster + # 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" + cluster_id = "hello world" + cluster = {} + request_id = "hello world" + + create_cluster_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :create_cluster, name + assert_kind_of ::Google::Cloud::Redis::Cluster::V1beta1::CreateClusterRequest, request + assert_equal "hello world", request["parent"] + assert_equal "hello world", request["cluster_id"] + assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::Redis::Cluster::V1beta1::Cluster), request["cluster"] + assert_equal "hello world", request["request_id"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, create_cluster_client_stub do + # Create client + client = ::Google::Cloud::Redis::Cluster::V1beta1::CloudRedisCluster::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.create_cluster({ parent: parent, cluster_id: cluster_id, cluster: cluster, request_id: request_id }) do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Use named arguments + client.create_cluster parent: parent, cluster_id: cluster_id, cluster: cluster, request_id: request_id do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.create_cluster ::Google::Cloud::Redis::Cluster::V1beta1::CreateClusterRequest.new(parent: parent, cluster_id: cluster_id, cluster: cluster, request_id: request_id) do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Use hash object with options + client.create_cluster({ parent: parent, cluster_id: cluster_id, cluster: cluster, request_id: request_id }, grpc_options) do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Use protobuf object with options + client.create_cluster(::Google::Cloud::Redis::Cluster::V1beta1::CreateClusterRequest.new(parent: parent, cluster_id: cluster_id, cluster: cluster, request_id: request_id), grpc_options) do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Verify method calls + assert_equal 5, create_cluster_client_stub.call_rpc_count + end + end + + def test_get_cluster_certificate_authority + # Create GRPC objects. + grpc_response = ::Google::Cloud::Redis::Cluster::V1beta1::CertificateAuthority.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_cluster_certificate_authority_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :get_cluster_certificate_authority, name + assert_kind_of ::Google::Cloud::Redis::Cluster::V1beta1::GetClusterCertificateAuthorityRequest, request + assert_equal "hello world", request["name"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, get_cluster_certificate_authority_client_stub do + # Create client + client = ::Google::Cloud::Redis::Cluster::V1beta1::CloudRedisCluster::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.get_cluster_certificate_authority({ name: name }) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use named arguments + client.get_cluster_certificate_authority name: name do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.get_cluster_certificate_authority ::Google::Cloud::Redis::Cluster::V1beta1::GetClusterCertificateAuthorityRequest.new(name: name) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use hash object with options + client.get_cluster_certificate_authority({ 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_cluster_certificate_authority(::Google::Cloud::Redis::Cluster::V1beta1::GetClusterCertificateAuthorityRequest.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_cluster_certificate_authority_client_stub.call_rpc_count + end + end + + def test_reschedule_cluster_maintenance + # 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" + reschedule_type = :RESCHEDULE_TYPE_UNSPECIFIED + schedule_time = {} + + reschedule_cluster_maintenance_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :reschedule_cluster_maintenance, name + assert_kind_of ::Google::Cloud::Redis::Cluster::V1beta1::RescheduleClusterMaintenanceRequest, request + assert_equal "hello world", request["name"] + assert_equal :RESCHEDULE_TYPE_UNSPECIFIED, request["reschedule_type"] + assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Protobuf::Timestamp), request["schedule_time"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, reschedule_cluster_maintenance_client_stub do + # Create client + client = ::Google::Cloud::Redis::Cluster::V1beta1::CloudRedisCluster::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.reschedule_cluster_maintenance({ name: name, reschedule_type: reschedule_type, schedule_time: schedule_time }) 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.reschedule_cluster_maintenance name: name, reschedule_type: reschedule_type, schedule_time: schedule_time 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.reschedule_cluster_maintenance ::Google::Cloud::Redis::Cluster::V1beta1::RescheduleClusterMaintenanceRequest.new(name: name, reschedule_type: reschedule_type, schedule_time: schedule_time) 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.reschedule_cluster_maintenance({ name: name, reschedule_type: reschedule_type, schedule_time: schedule_time }, 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.reschedule_cluster_maintenance(::Google::Cloud::Redis::Cluster::V1beta1::RescheduleClusterMaintenanceRequest.new(name: name, reschedule_type: reschedule_type, schedule_time: schedule_time), 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, reschedule_cluster_maintenance_client_stub.call_rpc_count + end + end + + def test_list_backup_collections + # Create GRPC objects. + grpc_response = ::Google::Cloud::Redis::Cluster::V1beta1::ListBackupCollectionsResponse.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_backup_collections_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :list_backup_collections, name + assert_kind_of ::Google::Cloud::Redis::Cluster::V1beta1::ListBackupCollectionsRequest, 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_backup_collections_client_stub do + # Create client + client = ::Google::Cloud::Redis::Cluster::V1beta1::CloudRedisCluster::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.list_backup_collections({ 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_backup_collections 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_backup_collections ::Google::Cloud::Redis::Cluster::V1beta1::ListBackupCollectionsRequest.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_backup_collections({ 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_backup_collections(::Google::Cloud::Redis::Cluster::V1beta1::ListBackupCollectionsRequest.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_backup_collections_client_stub.call_rpc_count + end + end + + def test_get_backup_collection + # Create GRPC objects. + grpc_response = ::Google::Cloud::Redis::Cluster::V1beta1::BackupCollection.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_backup_collection_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :get_backup_collection, name + assert_kind_of ::Google::Cloud::Redis::Cluster::V1beta1::GetBackupCollectionRequest, request + assert_equal "hello world", request["name"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, get_backup_collection_client_stub do + # Create client + client = ::Google::Cloud::Redis::Cluster::V1beta1::CloudRedisCluster::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.get_backup_collection({ name: name }) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use named arguments + client.get_backup_collection name: name do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.get_backup_collection ::Google::Cloud::Redis::Cluster::V1beta1::GetBackupCollectionRequest.new(name: name) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use hash object with options + client.get_backup_collection({ 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_backup_collection(::Google::Cloud::Redis::Cluster::V1beta1::GetBackupCollectionRequest.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_backup_collection_client_stub.call_rpc_count + end + end + + def test_list_backups + # Create GRPC objects. + grpc_response = ::Google::Cloud::Redis::Cluster::V1beta1::ListBackupsResponse.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_backups_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :list_backups, name + assert_kind_of ::Google::Cloud::Redis::Cluster::V1beta1::ListBackupsRequest, 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_backups_client_stub do + # Create client + client = ::Google::Cloud::Redis::Cluster::V1beta1::CloudRedisCluster::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.list_backups({ 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_backups 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_backups ::Google::Cloud::Redis::Cluster::V1beta1::ListBackupsRequest.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_backups({ 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_backups(::Google::Cloud::Redis::Cluster::V1beta1::ListBackupsRequest.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_backups_client_stub.call_rpc_count + end + end + + def test_get_backup + # Create GRPC objects. + grpc_response = ::Google::Cloud::Redis::Cluster::V1beta1::Backup.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_backup_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :get_backup, name + assert_kind_of ::Google::Cloud::Redis::Cluster::V1beta1::GetBackupRequest, request + assert_equal "hello world", request["name"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, get_backup_client_stub do + # Create client + client = ::Google::Cloud::Redis::Cluster::V1beta1::CloudRedisCluster::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.get_backup({ name: name }) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use named arguments + client.get_backup name: name do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.get_backup ::Google::Cloud::Redis::Cluster::V1beta1::GetBackupRequest.new(name: name) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use hash object with options + client.get_backup({ 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_backup(::Google::Cloud::Redis::Cluster::V1beta1::GetBackupRequest.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_backup_client_stub.call_rpc_count + end + end + + def test_delete_backup + # 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" + request_id = "hello world" + + delete_backup_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :delete_backup, name + assert_kind_of ::Google::Cloud::Redis::Cluster::V1beta1::DeleteBackupRequest, request + assert_equal "hello world", request["name"] + assert_equal "hello world", request["request_id"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, delete_backup_client_stub do + # Create client + client = ::Google::Cloud::Redis::Cluster::V1beta1::CloudRedisCluster::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.delete_backup({ name: name, request_id: request_id }) do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Use named arguments + client.delete_backup name: name, request_id: request_id do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.delete_backup ::Google::Cloud::Redis::Cluster::V1beta1::DeleteBackupRequest.new(name: name, request_id: request_id) do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Use hash object with options + client.delete_backup({ name: name, request_id: request_id }, grpc_options) do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Use protobuf object with options + client.delete_backup(::Google::Cloud::Redis::Cluster::V1beta1::DeleteBackupRequest.new(name: name, request_id: request_id), grpc_options) do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Verify method calls + assert_equal 5, delete_backup_client_stub.call_rpc_count + end + end + + def test_export_backup + # 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. + gcs_bucket = "hello world" + name = "hello world" + + export_backup_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :export_backup, name + assert_kind_of ::Google::Cloud::Redis::Cluster::V1beta1::ExportBackupRequest, request + assert_equal "hello world", request["gcs_bucket"] + assert_equal :gcs_bucket, request.destination + assert_equal "hello world", request["name"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, export_backup_client_stub do + # Create client + client = ::Google::Cloud::Redis::Cluster::V1beta1::CloudRedisCluster::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.export_backup({ gcs_bucket: gcs_bucket, 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.export_backup gcs_bucket: gcs_bucket, 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.export_backup ::Google::Cloud::Redis::Cluster::V1beta1::ExportBackupRequest.new(gcs_bucket: gcs_bucket, 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.export_backup({ gcs_bucket: gcs_bucket, 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.export_backup(::Google::Cloud::Redis::Cluster::V1beta1::ExportBackupRequest.new(gcs_bucket: gcs_bucket, 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, export_backup_client_stub.call_rpc_count + end + end + + def test_backup_cluster + # 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" + ttl = {} + backup_id = "hello world" + + backup_cluster_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :backup_cluster, name + assert_kind_of ::Google::Cloud::Redis::Cluster::V1beta1::BackupClusterRequest, request + assert_equal "hello world", request["name"] + assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Protobuf::Duration), request["ttl"] + assert_equal "hello world", request["backup_id"] + assert request.has_backup_id? + refute_nil options + end + + Gapic::ServiceStub.stub :new, backup_cluster_client_stub do + # Create client + client = ::Google::Cloud::Redis::Cluster::V1beta1::CloudRedisCluster::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.backup_cluster({ name: name, ttl: ttl, backup_id: backup_id }) do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Use named arguments + client.backup_cluster name: name, ttl: ttl, backup_id: backup_id do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.backup_cluster ::Google::Cloud::Redis::Cluster::V1beta1::BackupClusterRequest.new(name: name, ttl: ttl, backup_id: backup_id) do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Use hash object with options + client.backup_cluster({ name: name, ttl: ttl, backup_id: backup_id }, grpc_options) do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Use protobuf object with options + client.backup_cluster(::Google::Cloud::Redis::Cluster::V1beta1::BackupClusterRequest.new(name: name, ttl: ttl, backup_id: backup_id), grpc_options) do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Verify method calls + assert_equal 5, backup_cluster_client_stub.call_rpc_count + end + end + + def test_configure + grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + + client = block_config = config = nil + dummy_stub = ClientStub.new nil, nil + Gapic::ServiceStub.stub :new, dummy_stub do + client = ::Google::Cloud::Redis::Cluster::V1beta1::CloudRedisCluster::Client.new do |config| + config.credentials = grpc_channel + end + end + + config = client.configure do |c| + block_config = c + end + + assert_same block_config, config + assert_kind_of ::Google::Cloud::Redis::Cluster::V1beta1::CloudRedisCluster::Client::Configuration, config + end + + def test_credentials + key = OpenSSL::PKey::RSA.new 2048 + cred_json = { + "private_key" => key.to_pem, + "client_email" => "app@developer.gserviceaccount.com", + "type" => "service_account" + } + key_file = StringIO.new cred_json.to_json + creds = Google::Auth::ServiceAccountCredentials.make_creds({ json_key_io: key_file }) + + dummy_stub = ClientStub.new nil, nil + Gapic::ServiceStub.stub :new, dummy_stub do + client = ::Google::Cloud::Redis::Cluster::V1beta1::CloudRedisCluster::Client.new do |config| + config.credentials = creds + end + assert_kind_of ::Google::Cloud::Redis::Cluster::V1beta1::CloudRedisCluster::Client, client + assert_equal creds, client.configure.credentials + end + end + + def test_operations_client + grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + + client = nil + dummy_stub = ClientStub.new nil, nil + Gapic::ServiceStub.stub :new, dummy_stub do + client = ::Google::Cloud::Redis::Cluster::V1beta1::CloudRedisCluster::Client.new do |config| + config.credentials = grpc_channel + end + end + + assert_kind_of ::Google::Cloud::Redis::Cluster::V1beta1::CloudRedisCluster::Operations, client.operations_client + end +end diff --git a/owl-bot-staging/google-cloud-redis-cluster-v1beta1/test/helper.rb b/owl-bot-staging/google-cloud-redis-cluster-v1beta1/test/helper.rb new file mode 100644 index 000000000000..672b337030e7 --- /dev/null +++ b/owl-bot-staging/google-cloud-redis-cluster-v1beta1/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" diff --git a/owl-bot-staging/google-cloud-redis-v1/.gitignore b/owl-bot-staging/google-cloud-redis-v1/.gitignore new file mode 100644 index 000000000000..0135b6bc6cfc --- /dev/null +++ b/owl-bot-staging/google-cloud-redis-v1/.gitignore @@ -0,0 +1,22 @@ +# Ignore bundler lockfiles +Gemfile.lock +gems.locked + +# Ignore documentation output +doc/* +.yardoc/* + +# Ignore test output +coverage/* + +# Ignore build artifacts +pkg/* + +# Ignore files commonly present in certain dev environments +.vagrant +.DS_STORE +.idea +*.iml + +# Ignore synth output +__pycache__ diff --git a/owl-bot-staging/google-cloud-redis-v1/.repo-metadata.json b/owl-bot-staging/google-cloud-redis-v1/.repo-metadata.json new file mode 100644 index 000000000000..2a5bec164822 --- /dev/null +++ b/owl-bot-staging/google-cloud-redis-v1/.repo-metadata.json @@ -0,0 +1,18 @@ +{ + "api_id": "redis.googleapis.com", + "api_shortname": "redis", + "client_documentation": "https://cloud.google.com/ruby/docs/reference/google-cloud-redis-v1/latest", + "distribution_name": "google-cloud-redis-v1", + "is_cloud": true, + "language": "ruby", + "name": "redis", + "name_pretty": "Google Cloud Memorystore for Redis V1 API", + "product_documentation": "https://cloud.google.com/memorystore/docs/redis", + "release_level": "unreleased", + "repo": "googleapis/google-cloud-ruby", + "requires_billing": true, + "ruby-cloud-description": "Creates and manages Redis instances on the Google Cloud Platform. Note that google-cloud-redis-v1 is a version-specific client library. For most uses, we recommend installing the main client library google-cloud-redis instead. See the readme for more details.", + "ruby-cloud-env-prefix": "REDIS", + "ruby-cloud-product-url": "https://cloud.google.com/memorystore/docs/redis", + "library_type": "GAPIC_AUTO" +} diff --git a/owl-bot-staging/google-cloud-redis-v1/.rubocop.yml b/owl-bot-staging/google-cloud-redis-v1/.rubocop.yml new file mode 100644 index 000000000000..b21553825e68 --- /dev/null +++ b/owl-bot-staging/google-cloud-redis-v1/.rubocop.yml @@ -0,0 +1,33 @@ +inherit_gem: + google-style: google-style.yml + +AllCops: + Exclude: + - "google-cloud-redis-v1.gemspec" + - "lib/**/*_pb.rb" + - "proto_docs/**/*" + - "test/**/*" + - "acceptance/**/*" + - "samples/acceptance/**/*" + - "Rakefile" + +Layout/LineLength: + Enabled: false +Metrics/AbcSize: + Enabled: false +Metrics/ClassLength: + Enabled: false +Metrics/CyclomaticComplexity: + Enabled: false +Metrics/MethodLength: + Enabled: false +Metrics/ModuleLength: + Enabled: false +Metrics/PerceivedComplexity: + Enabled: false +Naming/AccessorMethodName: + Exclude: + - "snippets/**/*.rb" +Naming/FileName: + Exclude: + - "lib/google-cloud-redis-v1.rb" diff --git a/owl-bot-staging/google-cloud-redis-v1/.toys.rb b/owl-bot-staging/google-cloud-redis-v1/.toys.rb new file mode 100644 index 000000000000..177e22456e8a --- /dev/null +++ b/owl-bot-staging/google-cloud-redis-v1/.toys.rb @@ -0,0 +1,28 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +toys_version! ">= 0.15.3" + +if ENV["RUBY_COMMON_TOOLS"] + common_tools_dir = File.expand_path ENV["RUBY_COMMON_TOOLS"] + load File.join(common_tools_dir, "toys", "gapic") +else + load_git remote: "https://github.com/googleapis/ruby-common-tools.git", + path: "toys/gapic", + update: true +end diff --git a/owl-bot-staging/google-cloud-redis-v1/.yardopts b/owl-bot-staging/google-cloud-redis-v1/.yardopts new file mode 100644 index 000000000000..6b73bdb64053 --- /dev/null +++ b/owl-bot-staging/google-cloud-redis-v1/.yardopts @@ -0,0 +1,12 @@ +--no-private +--title="Google Cloud Memorystore for Redis V1 API" +--exclude _pb\.rb$ +--markup markdown +--markup-provider redcarpet + +./lib/**/*.rb +./proto_docs/**/*.rb +- +README.md +LICENSE.md +AUTHENTICATION.md diff --git a/owl-bot-staging/google-cloud-redis-v1/AUTHENTICATION.md b/owl-bot-staging/google-cloud-redis-v1/AUTHENTICATION.md new file mode 100644 index 000000000000..b7e2faf35a8e --- /dev/null +++ b/owl-bot-staging/google-cloud-redis-v1/AUTHENTICATION.md @@ -0,0 +1,122 @@ +# Authentication + +The recommended way to authenticate to the google-cloud-redis-v1 library is to use +[Application Default Credentials (ADC)](https://cloud.google.com/docs/authentication/application-default-credentials). +To review all of your authentication options, see [Credentials lookup](#credential-lookup). + +## Quickstart + +The following example shows how to set up authentication for a local development +environment with your user credentials. + +**NOTE:** This method is _not_ recommended for running in production. User credentials +should be used only during development. + +1. [Download and install the Google Cloud CLI](https://cloud.google.com/sdk). +2. Set up a local ADC file with your user credentials: + +```sh +gcloud auth application-default login +``` + +3. Write code as if already authenticated. + +For more information about setting up authentication for a local development environment, see +[Set up Application Default Credentials](https://cloud.google.com/docs/authentication/provide-credentials-adc#local-dev). + +## Credential Lookup + +The google-cloud-redis-v1 library provides several mechanisms to configure your system. +Generally, using Application Default Credentials to facilitate automatic +credentials discovery is the easist method. But if you need to explicitly specify +credentials, there are several methods available to you. + +Credentials are accepted in the following ways, in the following order or precedence: + +1. Credentials specified in method arguments +2. Credentials specified in configuration +3. Credentials pointed to or included in environment variables +4. Credentials found in local ADC file +5. Credentials returned by the metadata server for the attached service account (GCP) + +### Configuration + +You can configure a path to a JSON credentials file, either for an individual client object or +globally, for all client objects. The JSON file can contain credentials created for +[workload identity federation](https://cloud.google.com/iam/docs/workload-identity-federation), +[workforce identity federation](https://cloud.google.com/iam/docs/workforce-identity-federation), or a +[service account key](https://cloud.google.com/docs/authentication/provide-credentials-adc#local-key). + +Note: Service account keys are a security risk if not managed correctly. You should +[choose a more secure alternative to service account keys](https://cloud.google.com/docs/authentication#auth-decision-tree) +whenever possible. + +To configure a credentials file for an individual client initialization: + +```ruby +require "google/cloud/redis/v1" + +client = ::Google::Cloud::Redis::V1::CloudRedis::Client.new do |config| + config.credentials = "path/to/credentialfile.json" +end +``` + +To configure a credentials file globally for all clients: + +```ruby +require "google/cloud/redis/v1" + +::Google::Cloud::Redis::V1::CloudRedis::Client.configure do |config| + config.credentials = "path/to/credentialfile.json" +end + +client = ::Google::Cloud::Redis::V1::CloudRedis::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-redis-v1 +checks for credentials are: + +* `GOOGLE_CLOUD_CREDENTIALS` - Path to JSON file, or JSON contents +* `GOOGLE_APPLICATION_CREDENTIALS` - Path to JSON file + +```ruby +require "google/cloud/redis/v1" + +ENV["GOOGLE_APPLICATION_CREDENTIALS"] = "path/to/credentialfile.json" + +client = ::Google::Cloud::Redis::V1::CloudRedis::Client.new +``` + +### Local ADC file + +You can set up a local ADC file with your user credentials for authentication during +development. If credentials are not provided in code or in environment variables, +then the local ADC credentials are discovered. + +Follow the steps in [Quickstart](#quickstart) to set up a local ADC file. + +### Google Cloud Platform environments + +When running on Google Cloud Platform (GCP), including Google Compute Engine +(GCE), Google Kubernetes Engine (GKE), Google App Engine (GAE), Google Cloud +Functions (GCF) and Cloud Run, credentials are retrieved from the attached +service account automatically. Code should be written as if already authenticated. + +For more information, see +[Set up ADC for Google Cloud services](https://cloud.google.com/docs/authentication/provide-credentials-adc#attached-sa). diff --git a/owl-bot-staging/google-cloud-redis-v1/CHANGELOG.md b/owl-bot-staging/google-cloud-redis-v1/CHANGELOG.md new file mode 100644 index 000000000000..f88957a62ba2 --- /dev/null +++ b/owl-bot-staging/google-cloud-redis-v1/CHANGELOG.md @@ -0,0 +1,2 @@ +# Release History + diff --git a/owl-bot-staging/google-cloud-redis-v1/Gemfile b/owl-bot-staging/google-cloud-redis-v1/Gemfile new file mode 100644 index 000000000000..1d08558908d8 --- /dev/null +++ b/owl-bot-staging/google-cloud-redis-v1/Gemfile @@ -0,0 +1,14 @@ +source "https://rubygems.org" + +gemspec + +gem "google-style", "~> 1.32.0" +gem "irb", "~> 1.17" +gem "minitest", "~> 6.0.2" +gem "minitest-focus", "~> 1.4" +gem "minitest-mock", "~> 5.27" +gem "minitest-rg", "~> 5.3" +gem "ostruct", "~> 0.5.5" +gem "rake", ">= 13.0" +gem "redcarpet", "~> 3.6" +gem "yard", "~> 0.9" diff --git a/owl-bot-staging/google-cloud-redis-v1/LICENSE.md b/owl-bot-staging/google-cloud-redis-v1/LICENSE.md new file mode 100644 index 000000000000..c261857ba6ad --- /dev/null +++ b/owl-bot-staging/google-cloud-redis-v1/LICENSE.md @@ -0,0 +1,201 @@ + Apache License + Version 2.0, January 2004 + http://www.apache.org/licenses/ + + TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION + + 1. Definitions. + + "License" shall mean the terms and conditions for use, reproduction, + and distribution as defined by Sections 1 through 9 of this document. + + "Licensor" shall mean the copyright owner or entity authorized by + the copyright owner that is granting the License. + + "Legal Entity" shall mean the union of the acting entity and all + other entities that control, are controlled by, or are under common + control with that entity. For the purposes of this definition, + "control" means (i) the power, direct or indirect, to cause the + direction or management of such entity, whether by contract or + otherwise, or (ii) ownership of fifty percent (50%) or more of the + outstanding shares, or (iii) beneficial ownership of such entity. + + "You" (or "Your") shall mean an individual or Legal Entity + exercising permissions granted by this License. + + "Source" form shall mean the preferred form for making modifications, + including but not limited to software source code, documentation + source, and configuration files. + + "Object" form shall mean any form resulting from mechanical + transformation or translation of a Source form, including but + not limited to compiled object code, generated documentation, + and conversions to other media types. + + "Work" shall mean the work of authorship, whether in Source or + Object form, made available under the License, as indicated by a + copyright notice that is included in or attached to the work + (an example is provided in the Appendix below). + + "Derivative Works" shall mean any work, whether in Source or Object + form, that is based on (or derived from) the Work and for which the + editorial revisions, annotations, elaborations, or other modifications + represent, as a whole, an original work of authorship. For the purposes + of this License, Derivative Works shall not include works that remain + separable from, or merely link (or bind by name) to the interfaces of, + the Work and Derivative Works thereof. + + "Contribution" shall mean any work of authorship, including + the original version of the Work and any modifications or additions + to that Work or Derivative Works thereof, that is intentionally + submitted to Licensor for inclusion in the Work by the copyright owner + or by an individual or Legal Entity authorized to submit on behalf of + the copyright owner. For the purposes of this definition, "submitted" + means any form of electronic, verbal, or written communication sent + to the Licensor or its representatives, including but not limited to + communication on electronic mailing lists, source code control systems, + and issue tracking systems that are managed by, or on behalf of, the + Licensor for the purpose of discussing and improving the Work, but + excluding communication that is conspicuously marked or otherwise + designated in writing by the copyright owner as "Not a Contribution." + + "Contributor" shall mean Licensor and any individual or Legal Entity + on behalf of whom a Contribution has been received by Licensor and + subsequently incorporated within the Work. + + 2. Grant of Copyright License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + copyright license to reproduce, prepare Derivative Works of, + publicly display, publicly perform, sublicense, and distribute the + Work and such Derivative Works in Source or Object form. + + 3. Grant of Patent License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + (except as stated in this section) patent license to make, have made, + use, offer to sell, sell, import, and otherwise transfer the Work, + where such license applies only to those patent claims licensable + by such Contributor that are necessarily infringed by their + Contribution(s) alone or by combination of their Contribution(s) + with the Work to which such Contribution(s) was submitted. If You + institute patent litigation against any entity (including a + cross-claim or counterclaim in a lawsuit) alleging that the Work + or a Contribution incorporated within the Work constitutes direct + or contributory patent infringement, then any patent licenses + granted to You under this License for that Work shall terminate + as of the date such litigation is filed. + + 4. Redistribution. You may reproduce and distribute copies of the + Work or Derivative Works thereof in any medium, with or without + modifications, and in Source or Object form, provided that You + meet the following conditions: + + (a) You must give any other recipients of the Work or + Derivative Works a copy of this License; and + + (b) You must cause any modified files to carry prominent notices + stating that You changed the files; and + + (c) You must retain, in the Source form of any Derivative Works + that You distribute, all copyright, patent, trademark, and + attribution notices from the Source form of the Work, + excluding those notices that do not pertain to any part of + the Derivative Works; and + + (d) If the Work includes a "NOTICE" text file as part of its + distribution, then any Derivative Works that You distribute must + include a readable copy of the attribution notices contained + within such NOTICE file, excluding those notices that do not + pertain to any part of the Derivative Works, in at least one + of the following places: within a NOTICE text file distributed + as part of the Derivative Works; within the Source form or + documentation, if provided along with the Derivative Works; or, + within a display generated by the Derivative Works, if and + wherever such third-party notices normally appear. The contents + of the NOTICE file are for informational purposes only and + do not modify the License. You may add Your own attribution + notices within Derivative Works that You distribute, alongside + or as an addendum to the NOTICE text from the Work, provided + that such additional attribution notices cannot be construed + as modifying the License. + + You may add Your own copyright statement to Your modifications and + may provide additional or different license terms and conditions + for use, reproduction, or distribution of Your modifications, or + for any such Derivative Works as a whole, provided Your use, + reproduction, and distribution of the Work otherwise complies with + the conditions stated in this License. + + 5. Submission of Contributions. Unless You explicitly state otherwise, + any Contribution intentionally submitted for inclusion in the Work + by You to the Licensor shall be under the terms and conditions of + this License, without any additional terms or conditions. + Notwithstanding the above, nothing herein shall supersede or modify + the terms of any separate license agreement you may have executed + with Licensor regarding such Contributions. + + 6. Trademarks. This License does not grant permission to use the trade + names, trademarks, service marks, or product names of the Licensor, + except as required for reasonable and customary use in describing the + origin of the Work and reproducing the content of the NOTICE file. + + 7. Disclaimer of Warranty. Unless required by applicable law or + agreed to in writing, Licensor provides the Work (and each + Contributor provides its Contributions) on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or + implied, including, without limitation, any warranties or conditions + of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A + PARTICULAR PURPOSE. You are solely responsible for determining the + appropriateness of using or redistributing the Work and assume any + risks associated with Your exercise of permissions under this License. + + 8. Limitation of Liability. In no event and under no legal theory, + whether in tort (including negligence), contract, or otherwise, + unless required by applicable law (such as deliberate and grossly + negligent acts) or agreed to in writing, shall any Contributor be + liable to You for damages, including any direct, indirect, special, + incidental, or consequential damages of any character arising as a + result of this License or out of the use or inability to use the + Work (including but not limited to damages for loss of goodwill, + work stoppage, computer failure or malfunction, or any and all + other commercial damages or losses), even if such Contributor + has been advised of the possibility of such damages. + + 9. Accepting Warranty or Additional Liability. While redistributing + the Work or Derivative Works thereof, You may choose to offer, + and charge a fee for, acceptance of support, warranty, indemnity, + or other liability obligations and/or rights consistent with this + License. However, in accepting such obligations, You may act only + on Your own behalf and on Your sole responsibility, not on behalf + of any other Contributor, and only if You agree to indemnify, + defend, and hold each Contributor harmless for any liability + incurred by, or claims asserted against, such Contributor by reason + of your accepting any such warranty or additional liability. + + END OF TERMS AND CONDITIONS + + APPENDIX: How to apply the Apache License to your work. + + To apply the Apache License to your work, attach the following + boilerplate notice, with the fields enclosed by brackets "[]" + replaced with your own identifying information. (Don't include + the brackets!) The text should be enclosed in the appropriate + comment syntax for the file format. We also recommend that a + file or class name and description of purpose be included on the + same "printed page" as the copyright notice for easier + identification within third-party archives. + + Copyright [yyyy] [name of copyright owner] + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. diff --git a/owl-bot-staging/google-cloud-redis-v1/README.md b/owl-bot-staging/google-cloud-redis-v1/README.md new file mode 100644 index 000000000000..bd08efb1a196 --- /dev/null +++ b/owl-bot-staging/google-cloud-redis-v1/README.md @@ -0,0 +1,153 @@ +# Ruby Client for the Google Cloud Memorystore for Redis V1 API + +Creates and manages Redis instances on the Google Cloud Platform. + + +https://github.com/googleapis/google-cloud-ruby + +This gem is a _versioned_ client. It provides basic client classes for a +specific version of the Google Cloud Memorystore for Redis V1 API. Most users should consider using +the main client gem, +[google-cloud-redis](https://rubygems.org/gems/google-cloud-redis). +See the section below titled *Which client should I use?* for more information. + +## Installation + +``` +$ gem install google-cloud-redis-v1 +``` + +## Before You Begin + +In order to use this library, you first need to go through the following steps: + +1. [Select or create a Cloud Platform project.](https://console.cloud.google.com/project) +1. [Enable billing for your project.](https://cloud.google.com/billing/docs/how-to/modify-project#enable_billing_for_a_project) +1. [Enable the API.](https://console.cloud.google.com/apis/library/redis.googleapis.com) +1. [Set up authentication.](AUTHENTICATION.md) + +## Quick Start + +```ruby +require "google/cloud/redis/v1" + +client = ::Google::Cloud::Redis::V1::CloudRedis::Client.new +request = ::Google::Cloud::Redis::V1::ListInstancesRequest.new # (request fields as keyword arguments...) +response = client.list_instances request +``` + +View the [Client Library Documentation](https://cloud.google.com/ruby/docs/reference/google-cloud-redis-v1/latest) +for class and method documentation. + +See also the [Product Documentation](https://cloud.google.com/memorystore/docs/redis) +for general usage information. + +## Debug Logging + +This library comes with opt-in Debug Logging that can help you troubleshoot +your application's integration with the API. When logging is activated, key +events such as requests and responses, along with data payloads and metadata +such as headers and client configuration, are logged to the standard error +stream. + +**WARNING:** Client Library Debug Logging includes your data payloads in +plaintext, which could include sensitive data such as PII for yourself or your +customers, private keys, or other security data that could be compromising if +leaked. Always practice good data hygiene with your application logs, and follow +the principle of least access. Google also recommends that Client Library Debug +Logging be enabled only temporarily during active debugging, and not used +permanently in production. + +To enable logging, set the environment variable `GOOGLE_SDK_RUBY_LOGGING_GEMS` +to the value `all`. Alternatively, you can set the value to a comma-delimited +list of client library gem names. This will select the default logging behavior, +which writes logs to the standard error stream. On a local workstation, this may +result in logs appearing on the console. When running on a Google Cloud hosting +service such as [Google Cloud Run](https://cloud.google.com/run), this generally +results in logs appearing alongside your application logs in the +[Google Cloud Logging](https://cloud.google.com/logging/) service. + +You can customize logging by modifying the `logger` configuration when +constructing a client object. For example: + +```ruby +require "google/cloud/redis/v1" +require "logger" + +client = ::Google::Cloud::Redis::V1::CloudRedis::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-redis`, +and lower-level _versioned_ client libraries with names such as +`google-cloud-redis-v1`. +_In most cases, you should install the main client._ + +### What's the difference between the main client and a versioned client? + +A _versioned client_ provides a basic set of data types and client classes for +a _single version_ of a specific service. (That is, for a service with multiple +versions, there might be a separate versioned client for each service version.) +Most versioned clients are written and maintained by a code generator. + +The _main client_ is designed to provide you with the _recommended_ client +interfaces for the service. There will be only one main client for any given +service, even a service with multiple versions. The main client includes +factory methods for constructing the client objects we recommend for most +users. In some cases, those will be classes provided by an underlying versioned +client; in other cases, they will be handwritten higher-level client objects +with additional capabilities, convenience methods, or best practices built in. +Generally, the main client will default to a recommended service version, +although in some cases you can override this if you need to talk to a specific +service version. + +### Why would I want to use the main client? + +We recommend that most users install the main client gem for a service. You can +identify this gem as the one _without_ a version in its name, e.g. +`google-cloud-redis`. +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-redis-v1`. + +### What about the google-apis- clients? + +Client library gems with names that begin with `google-apis-` are based on an +older code generation technology. They talk to a REST/JSON backend (whereas +most modern clients talk to a [gRPC](https://grpc.io/) backend) and they may +not offer the same performance, features, and ease of use provided by more +modern clients. + +The `google-apis-` clients have wide coverage across Google services, so you +might need to use one if there is no modern client available for the service. +However, if a modern client is available, we generally recommend it over the +older `google-apis-` clients. diff --git a/owl-bot-staging/google-cloud-redis-v1/Rakefile b/owl-bot-staging/google-cloud-redis-v1/Rakefile new file mode 100644 index 000000000000..99b84180ee78 --- /dev/null +++ b/owl-bot-staging/google-cloud-redis-v1/Rakefile @@ -0,0 +1,169 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +require "bundler/setup" +require "bundler/gem_tasks" + +require "rubocop/rake_task" +RuboCop::RakeTask.new + +require "rake/testtask" +desc "Run tests." +Rake::TestTask.new do |t| + t.libs << "test" + t.test_files = FileList["test/**/*_test.rb"] + t.warning = false +end + +desc "Runs the smoke tests." +Rake::TestTask.new :smoke_test do |t| + t.test_files = FileList["acceptance/**/*smoke_test.rb"] + t.warning = false +end + +# Acceptance tests +desc "Run the google-cloud-redis-v1 acceptance tests." +task :acceptance, :project, :keyfile do |t, args| + project = args[:project] + project ||= + ENV["REDIS_TEST_PROJECT"] || + ENV["GCLOUD_TEST_PROJECT"] + keyfile = args[:keyfile] + keyfile ||= + ENV["REDIS_TEST_KEYFILE"] || + ENV["GCLOUD_TEST_KEYFILE"] + if keyfile + keyfile = File.read keyfile + else + keyfile ||= + ENV["REDIS_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 REDIS_TEST_PROJECT=test123 REDIS_TEST_KEYFILE=/path/to/keyfile.json rake acceptance" + end + require "google/cloud/redis/v1/cloud_redis/credentials" + ::Google::Cloud::Redis::V1::CloudRedis::Credentials.env_vars.each do |path| + ENV[path] = nil + end + ENV["REDIS_PROJECT"] = project + ENV["REDIS_TEST_PROJECT"] = project + ENV["REDIS_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-redis-v1 gem has no acceptance tests." + end + end + + desc "Run acceptance cleanup." + task :cleanup do + end +end + +task :samples do + Rake::Task["samples:latest"].invoke +end + +namespace :samples do + task :latest do + if File.directory? "samples" + Dir.chdir "samples" do + Bundler.with_clean_env do + ENV["GOOGLE_CLOUD_SAMPLES_TEST"] = "not_master" + sh "bundle update" + sh "bundle exec rake test" + end + end + else + puts "The google-cloud-redis-v1 gem has no samples to test." + end + end + + task :master do + if File.directory? "samples" + Dir.chdir "samples" do + Bundler.with_clean_env do + ENV["GOOGLE_CLOUD_SAMPLES_TEST"] = "master" + sh "bundle update" + sh "bundle exec rake test" + end + end + else + puts "The google-cloud-redis-v1 gem has no samples to test." + end + end +end + +require "yard" +require "yard/rake/yardoc_task" +YARD::Rake::YardocTask.new do |y| + y.options << "--fail-on-warning" +end + +desc "Run yard-doctest example tests." +task :doctest do + puts "The google-cloud-redis-v1 gem does not have doctest tests." +end + +desc "Run the CI build" +task :ci do + header "BUILDING google-cloud-redis-v1" + header "google-cloud-redis-v1 rubocop", "*" + Rake::Task[:rubocop].invoke + header "google-cloud-redis-v1 yard", "*" + Rake::Task[:yard].invoke + header "google-cloud-redis-v1 test", "*" + Rake::Task[:test].invoke +end + +namespace :ci do + desc "Run the CI build, with smoke tests." + task :smoke_test do + Rake::Task[:ci].invoke + header "google-cloud-redis-v1 smoke_test", "*" + Rake::Task[:smoke_test].invoke + end + desc "Run the CI build, with acceptance tests." + task :acceptance do + Rake::Task[:ci].invoke + header "google-cloud-redis-v1 acceptance", "*" + Rake::Task[:acceptance].invoke + end + task :a do + # This is a handy shortcut to save typing + Rake::Task["ci:acceptance"].invoke + end +end + +task default: :test + +def header str, token = "#" + line_length = str.length + 8 + puts "" + puts token * line_length + puts "#{token * 3} #{str} #{token * 3}" + puts token * line_length + puts "" +end diff --git a/owl-bot-staging/google-cloud-redis-v1/gapic_metadata.json b/owl-bot-staging/google-cloud-redis-v1/gapic_metadata.json new file mode 100644 index 000000000000..8cebdc986221 --- /dev/null +++ b/owl-bot-staging/google-cloud-redis-v1/gapic_metadata.json @@ -0,0 +1,73 @@ +{ + "schema": "1.0", + "comment": "This file maps proto services/RPCs to the corresponding library clients/methods", + "language": "ruby", + "protoPackage": "google.cloud.redis.v1", + "libraryPackage": "::Google::Cloud::Redis::V1", + "services": { + "CloudRedis": { + "clients": { + "grpc": { + "libraryClient": "::Google::Cloud::Redis::V1::CloudRedis::Client", + "rpcs": { + "ListInstances": { + "methods": [ + "list_instances" + ] + }, + "GetInstance": { + "methods": [ + "get_instance" + ] + }, + "GetInstanceAuthString": { + "methods": [ + "get_instance_auth_string" + ] + }, + "CreateInstance": { + "methods": [ + "create_instance" + ] + }, + "UpdateInstance": { + "methods": [ + "update_instance" + ] + }, + "UpgradeInstance": { + "methods": [ + "upgrade_instance" + ] + }, + "ImportInstance": { + "methods": [ + "import_instance" + ] + }, + "ExportInstance": { + "methods": [ + "export_instance" + ] + }, + "FailoverInstance": { + "methods": [ + "failover_instance" + ] + }, + "DeleteInstance": { + "methods": [ + "delete_instance" + ] + }, + "RescheduleMaintenance": { + "methods": [ + "reschedule_maintenance" + ] + } + } + } + } + } + } +} diff --git a/owl-bot-staging/google-cloud-redis-v1/google-cloud-redis-v1.gemspec b/owl-bot-staging/google-cloud-redis-v1/google-cloud-redis-v1.gemspec new file mode 100644 index 000000000000..ca174a28ce5d --- /dev/null +++ b/owl-bot-staging/google-cloud-redis-v1/google-cloud-redis-v1.gemspec @@ -0,0 +1,29 @@ +# -*- ruby -*- +# encoding: utf-8 + +require File.expand_path("lib/google/cloud/redis/v1/version", __dir__) + +Gem::Specification.new do |gem| + gem.name = "google-cloud-redis-v1" + gem.version = Google::Cloud::Redis::V1::VERSION + + gem.authors = ["Google LLC"] + gem.email = "googleapis-packages@google.com" + gem.description = "Creates and manages Redis instances on the Google Cloud Platform. Note that google-cloud-redis-v1 is a version-specific client library. For most uses, we recommend installing the main client library google-cloud-redis instead. See the readme for more details." + gem.summary = "Creates and manages Redis instances on the Google Cloud Platform." + gem.homepage = "https://github.com/googleapis/google-cloud-ruby" + gem.license = "Apache-2.0" + + gem.platform = Gem::Platform::RUBY + + gem.files = `git ls-files -- lib/*`.split("\n") + + `git ls-files -- proto_docs/*`.split("\n") + + ["README.md", "LICENSE.md", "AUTHENTICATION.md", ".yardopts"] + gem.require_paths = ["lib"] + + gem.required_ruby_version = ">= 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-cloud-redis-v1/lib/google-cloud-redis-v1.rb b/owl-bot-staging/google-cloud-redis-v1/lib/google-cloud-redis-v1.rb new file mode 100644 index 000000000000..ba3315e36853 --- /dev/null +++ b/owl-bot-staging/google-cloud-redis-v1/lib/google-cloud-redis-v1.rb @@ -0,0 +1,21 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +# This gem does not autoload during Bundler.require. To load this gem, +# issue explicit require statements for the packages desired, e.g.: +# require "google/cloud/redis/v1" diff --git a/owl-bot-staging/google-cloud-redis-v1/lib/google/cloud/redis/v1.rb b/owl-bot-staging/google-cloud-redis-v1/lib/google/cloud/redis/v1.rb new file mode 100644 index 000000000000..1f021367abe9 --- /dev/null +++ b/owl-bot-staging/google-cloud-redis-v1/lib/google/cloud/redis/v1.rb @@ -0,0 +1,45 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +require "google/cloud/redis/v1/cloud_redis" +require "google/cloud/redis/v1/version" + +module Google + module Cloud + module Redis + ## + # API client module. + # + # @example Load this package, including all its services, and instantiate a gRPC client + # + # require "google/cloud/redis/v1" + # client = ::Google::Cloud::Redis::V1::CloudRedis::Client.new + # + # @example Load this package, including all its services, and instantiate a REST client + # + # require "google/cloud/redis/v1" + # client = ::Google::Cloud::Redis::V1::CloudRedis::Rest::Client.new + # + module V1 + end + end + end +end + +helper_path = ::File.join __dir__, "v1", "_helpers.rb" +require "google/cloud/redis/v1/_helpers" if ::File.file? helper_path diff --git a/owl-bot-staging/google-cloud-redis-v1/lib/google/cloud/redis/v1/bindings_override.rb b/owl-bot-staging/google-cloud-redis-v1/lib/google/cloud/redis/v1/bindings_override.rb new file mode 100644 index 000000000000..ed4ac2ac4cb7 --- /dev/null +++ b/owl-bot-staging/google-cloud-redis-v1/lib/google/cloud/redis/v1/bindings_override.rb @@ -0,0 +1,75 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +require "gapic/rest" + +module Google + module Cloud + module Redis + ## + # @example Loading just the REST part of this package, including all its services, and instantiating a REST client + # + # require "google/cloud/redis/v1/rest" + # client = ::Google::Cloud::Redis::V1::CloudRedis::Rest::Client.new + # + module V1 + ## + # @private + # Initialize the mixin bindings configuration + # + def self.configure + @configure ||= begin + namespace = ["Google", "Cloud", "Redis"] + parent_config = while namespace.any? + parent_name = namespace.join "::" + parent_const = const_get parent_name + break parent_const.configure if parent_const.respond_to? :configure + namespace.pop + end + + default_config = ::Gapic::Rest::HttpBindingOverrideConfiguration.new parent_config + default_config.bindings_override["google.cloud.location.Locations.GetLocation"] = [ + Gapic::Rest::GrpcTranscoder::HttpBinding.create_with_validation( + uri_method: :get, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/?$}, false] + ], + body: nil + ) + ] + default_config.bindings_override["google.cloud.location.Locations.ListLocations"] = [ + + Gapic::Rest::GrpcTranscoder::HttpBinding.create_with_validation( + uri_method: :get, + uri_template: "/v1/{name}/locations", + matches: [ + ["name", %r{^projects/[^/]+/?$}, false] + ], + body: nil + ) + ] + default_config + end + yield @configure if block_given? + @configure + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-redis-v1/lib/google/cloud/redis/v1/cloud_redis.rb b/owl-bot-staging/google-cloud-redis-v1/lib/google/cloud/redis/v1/cloud_redis.rb new file mode 100644 index 000000000000..f1210eb66f2c --- /dev/null +++ b/owl-bot-staging/google-cloud-redis-v1/lib/google/cloud/redis/v1/cloud_redis.rb @@ -0,0 +1,70 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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/redis/v1/version" + +require "google/cloud/redis/v1/cloud_redis/credentials" +require "google/cloud/redis/v1/cloud_redis/paths" +require "google/cloud/redis/v1/cloud_redis/operations" +require "google/cloud/redis/v1/cloud_redis/client" +require "google/cloud/redis/v1/cloud_redis/rest" + +module Google + module Cloud + module Redis + module V1 + ## + # Configures and manages Cloud Memorystore for Redis instances + # + # Google Cloud Memorystore for Redis v1 + # + # The `redis.googleapis.com` service implements the Google Cloud Memorystore + # for Redis API and defines the following resource model for managing Redis + # instances: + # * The service works with a collection of cloud projects, named: `/projects/*` + # * Each project has a collection of available locations, named: `/locations/*` + # * Each location has a collection of Redis instances, named: `/instances/*` + # * As such, Redis instances are resources of the form: + # `/projects/{project_id}/locations/{location_id}/instances/{instance_id}` + # + # Note that location_id must be referring to a GCP `region`; for example: + # * `projects/redpepper-1290/locations/us-central1/instances/my-redis` + # + # @example Load this service and instantiate a gRPC client + # + # require "google/cloud/redis/v1/cloud_redis" + # client = ::Google::Cloud::Redis::V1::CloudRedis::Client.new + # + # @example Load this service and instantiate a REST client + # + # require "google/cloud/redis/v1/cloud_redis/rest" + # client = ::Google::Cloud::Redis::V1::CloudRedis::Rest::Client.new + # + module CloudRedis + end + end + end + end +end + +helper_path = ::File.join __dir__, "cloud_redis", "helpers.rb" +require "google/cloud/redis/v1/cloud_redis/helpers" if ::File.file? helper_path diff --git a/owl-bot-staging/google-cloud-redis-v1/lib/google/cloud/redis/v1/cloud_redis/client.rb b/owl-bot-staging/google-cloud-redis-v1/lib/google/cloud/redis/v1/cloud_redis/client.rb new file mode 100644 index 000000000000..879d5ccc933f --- /dev/null +++ b/owl-bot-staging/google-cloud-redis-v1/lib/google/cloud/redis/v1/cloud_redis/client.rb @@ -0,0 +1,1649 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +require "google/cloud/errors" +require "google/cloud/redis/v1/cloud_redis_pb" +require "google/cloud/location" + +module Google + module Cloud + module Redis + module V1 + module CloudRedis + ## + # Client for the CloudRedis service. + # + # Configures and manages Cloud Memorystore for Redis instances + # + # Google Cloud Memorystore for Redis v1 + # + # The `redis.googleapis.com` service implements the Google Cloud Memorystore + # for Redis API and defines the following resource model for managing Redis + # instances: + # * The service works with a collection of cloud projects, named: `/projects/*` + # * Each project has a collection of available locations, named: `/locations/*` + # * Each location has a collection of Redis instances, named: `/instances/*` + # * As such, Redis instances are resources of the form: + # `/projects/{project_id}/locations/{location_id}/instances/{instance_id}` + # + # Note that location_id must be referring to a GCP `region`; for example: + # * `projects/redpepper-1290/locations/us-central1/instances/my-redis` + # + class Client + # @private + API_VERSION = "" + + # @private + DEFAULT_ENDPOINT_TEMPLATE = "redis.$UNIVERSE_DOMAIN$" + + include Paths + + # @private + attr_reader :cloud_redis_stub + + ## + # Configure the CloudRedis Client class. + # + # See {::Google::Cloud::Redis::V1::CloudRedis::Client::Configuration} + # for a description of the configuration fields. + # + # @example + # + # # Modify the configuration for all CloudRedis clients + # ::Google::Cloud::Redis::V1::CloudRedis::Client.configure do |config| + # config.timeout = 10.0 + # end + # + # @yield [config] Configure the Client client. + # @yieldparam config [Client::Configuration] + # + # @return [Client::Configuration] + # + def self.configure + @configure ||= begin + namespace = ["Google", "Cloud", "Redis", "V1"] + parent_config = while namespace.any? + parent_name = namespace.join "::" + parent_const = const_get parent_name + break parent_const.configure if parent_const.respond_to? :configure + namespace.pop + end + default_config = Client::Configuration.new parent_config + + default_config.rpcs.list_instances.timeout = 600.0 + + default_config.rpcs.get_instance.timeout = 600.0 + + default_config.rpcs.get_instance_auth_string.timeout = 600.0 + + default_config.rpcs.create_instance.timeout = 600.0 + + default_config.rpcs.update_instance.timeout = 600.0 + + default_config.rpcs.upgrade_instance.timeout = 600.0 + + default_config.rpcs.import_instance.timeout = 600.0 + + default_config.rpcs.export_instance.timeout = 600.0 + + default_config.rpcs.failover_instance.timeout = 600.0 + + default_config.rpcs.delete_instance.timeout = 600.0 + + default_config.rpcs.reschedule_maintenance.timeout = 600.0 + + default_config + end + yield @configure if block_given? + @configure + end + + ## + # Configure the CloudRedis Client instance. + # + # The configuration is set to the derived mode, meaning that values can be changed, + # but structural changes (adding new fields, etc.) are not allowed. Structural changes + # should be made on {Client.configure}. + # + # See {::Google::Cloud::Redis::V1::CloudRedis::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 + @cloud_redis_stub.universe_domain + end + + ## + # Create a new CloudRedis client object. + # + # @example + # + # # Create a client using the default configuration + # client = ::Google::Cloud::Redis::V1::CloudRedis::Client.new + # + # # Create a client using a custom configuration + # client = ::Google::Cloud::Redis::V1::CloudRedis::Client.new do |config| + # config.timeout = 10.0 + # end + # + # @yield [config] Configure the CloudRedis client. + # @yieldparam config [Client::Configuration] + # + def initialize + # These require statements are intentionally placed here to initialize + # the gRPC module only when it's required. + # See https://github.com/googleapis/toolkit/issues/446 + require "gapic/grpc" + require "google/cloud/redis/v1/cloud_redis_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 + + @cloud_redis_stub = ::Gapic::ServiceStub.new( + ::Google::Cloud::Redis::V1::CloudRedis::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 + ) + + @cloud_redis_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 = @cloud_redis_stub.endpoint + config.universe_domain = @cloud_redis_stub.universe_domain + config.logger = @cloud_redis_stub.logger if config.respond_to? :logger= + end + end + + ## + # Get the associated client for long-running operations. + # + # @return [::Google::Cloud::Redis::V1::CloudRedis::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 + @cloud_redis_stub.logger + end + + # Service calls + + ## + # Lists all Redis instances owned by a project in either the specified + # location (region) or all locations. + # + # The location should have the following format: + # + # * `projects/{project_id}/locations/{location_id}` + # + # If `location_id` is specified as `-` (wildcard), then all regions + # available to the project are queried, and the results are aggregated. + # + # @overload list_instances(request, options = nil) + # Pass arguments to `list_instances` via a request object, either of type + # {::Google::Cloud::Redis::V1::ListInstancesRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Redis::V1::ListInstancesRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_instances(parent: nil, page_size: nil, page_token: nil) + # Pass arguments to `list_instances` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param parent [::String] + # Required. The resource name of the instance location using the form: + # `projects/{project_id}/locations/{location_id}` + # where `location_id` refers to a GCP region. + # @param page_size [::Integer] + # The maximum number of items to return. + # + # If not specified, a default value of 1000 will be used by the service. + # Regardless of the page_size value, the response may include a partial list + # and a caller should only rely on response's + # {::Google::Cloud::Redis::V1::ListInstancesResponse#next_page_token `next_page_token`} + # to determine if there are more instances left to be queried. + # @param page_token [::String] + # The `next_page_token` value returned from a previous + # {::Google::Cloud::Redis::V1::CloudRedis::Client#list_instances ListInstances} request, if + # any. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Gapic::PagedEnumerable<::Google::Cloud::Redis::V1::Instance>] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Gapic::PagedEnumerable<::Google::Cloud::Redis::V1::Instance>] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/redis/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Redis::V1::CloudRedis::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Redis::V1::ListInstancesRequest.new + # + # # Call the list_instances method. + # result = client.list_instances request + # + # # The returned object is of type Gapic::PagedEnumerable. You can iterate + # # over elements, and API calls will be issued to fetch pages as needed. + # result.each do |item| + # # Each element is of type ::Google::Cloud::Redis::V1::Instance. + # p item + # end + # + def list_instances request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Redis::V1::ListInstancesRequest + + # Converts hash 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_instances.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::Redis::V1::VERSION + metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.parent + header_params["parent"] = request.parent + end + + request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") + metadata[:"x-goog-request-params"] ||= request_params_header + + options.apply_defaults timeout: @config.rpcs.list_instances.timeout, + metadata: metadata, + retry_policy: @config.rpcs.list_instances.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @cloud_redis_stub.call_rpc :list_instances, request, options: options do |response, operation| + response = ::Gapic::PagedEnumerable.new @cloud_redis_stub, :list_instances, request, response, operation, options + yield response, operation if block_given? + throw :response, response + end + rescue ::GRPC::BadStatus => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Gets the details of a specific Redis instance. + # + # @overload get_instance(request, options = nil) + # Pass arguments to `get_instance` via a request object, either of type + # {::Google::Cloud::Redis::V1::GetInstanceRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Redis::V1::GetInstanceRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_instance(name: nil) + # Pass arguments to `get_instance` via keyword arguments. Note that at + # least one keyword argument is 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. Redis instance resource name using the form: + # `projects/{project_id}/locations/{location_id}/instances/{instance_id}` + # where `location_id` refers to a GCP region. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Google::Cloud::Redis::V1::Instance] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Google::Cloud::Redis::V1::Instance] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/redis/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Redis::V1::CloudRedis::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Redis::V1::GetInstanceRequest.new + # + # # Call the get_instance method. + # result = client.get_instance request + # + # # The returned object is of type Google::Cloud::Redis::V1::Instance. + # p result + # + def get_instance request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Redis::V1::GetInstanceRequest + + # Converts hash 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_instance.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::Redis::V1::VERSION + metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.name + header_params["name"] = request.name + end + + request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") + metadata[:"x-goog-request-params"] ||= request_params_header + + options.apply_defaults timeout: @config.rpcs.get_instance.timeout, + metadata: metadata, + retry_policy: @config.rpcs.get_instance.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @cloud_redis_stub.call_rpc :get_instance, request, options: options do |response, operation| + yield response, operation if block_given? + end + rescue ::GRPC::BadStatus => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Gets the AUTH string for a Redis instance. If AUTH is not enabled for the + # instance the response will be empty. This information is not included in + # the details returned to GetInstance. + # + # @overload get_instance_auth_string(request, options = nil) + # Pass arguments to `get_instance_auth_string` via a request object, either of type + # {::Google::Cloud::Redis::V1::GetInstanceAuthStringRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Redis::V1::GetInstanceAuthStringRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_instance_auth_string(name: nil) + # Pass arguments to `get_instance_auth_string` via keyword arguments. Note that at + # least one keyword argument is 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. Redis instance resource name using the form: + # `projects/{project_id}/locations/{location_id}/instances/{instance_id}` + # where `location_id` refers to a GCP region. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Google::Cloud::Redis::V1::InstanceAuthString] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Google::Cloud::Redis::V1::InstanceAuthString] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/redis/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Redis::V1::CloudRedis::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Redis::V1::GetInstanceAuthStringRequest.new + # + # # Call the get_instance_auth_string method. + # result = client.get_instance_auth_string request + # + # # The returned object is of type Google::Cloud::Redis::V1::InstanceAuthString. + # p result + # + def get_instance_auth_string request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Redis::V1::GetInstanceAuthStringRequest + + # Converts hash 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_instance_auth_string.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::Redis::V1::VERSION + metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.name + header_params["name"] = request.name + end + + request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") + metadata[:"x-goog-request-params"] ||= request_params_header + + options.apply_defaults timeout: @config.rpcs.get_instance_auth_string.timeout, + metadata: metadata, + retry_policy: @config.rpcs.get_instance_auth_string.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @cloud_redis_stub.call_rpc :get_instance_auth_string, request, options: options do |response, operation| + yield response, operation if block_given? + end + rescue ::GRPC::BadStatus => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Creates a Redis instance based on the specified tier and memory size. + # + # By default, the instance is accessible from the project's + # [default network](https://cloud.google.com/vpc/docs/vpc). + # + # The creation is executed asynchronously and callers may check the returned + # operation to track its progress. Once the operation is completed the Redis + # instance will be fully functional. Completed longrunning.Operation will + # contain the new instance object in the response field. + # + # The returned operation is automatically deleted after a few hours, so there + # is no need to call DeleteOperation. + # + # @overload create_instance(request, options = nil) + # Pass arguments to `create_instance` via a request object, either of type + # {::Google::Cloud::Redis::V1::CreateInstanceRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Redis::V1::CreateInstanceRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_instance(parent: nil, instance_id: nil, instance: nil) + # Pass arguments to `create_instance` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param parent [::String] + # Required. The resource name of the instance location using the form: + # `projects/{project_id}/locations/{location_id}` + # where `location_id` refers to a GCP region. + # @param instance_id [::String] + # Required. The logical name of the Redis instance in the customer project + # with the following restrictions: + # + # * Must contain only lowercase letters, numbers, and hyphens. + # * Must start with a letter. + # * Must be between 1-40 characters. + # * Must end with a number or a letter. + # * Must be unique within the customer project / location + # @param instance [::Google::Cloud::Redis::V1::Instance, ::Hash] + # Required. A Redis [Instance] 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/cloud/redis/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Redis::V1::CloudRedis::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Redis::V1::CreateInstanceRequest.new + # + # # Call the create_instance method. + # result = client.create_instance 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_instance request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Redis::V1::CreateInstanceRequest + + # Converts hash 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_instance.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::Redis::V1::VERSION + metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.parent + header_params["parent"] = request.parent + end + + request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") + metadata[:"x-goog-request-params"] ||= request_params_header + + options.apply_defaults timeout: @config.rpcs.create_instance.timeout, + metadata: metadata, + retry_policy: @config.rpcs.create_instance.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @cloud_redis_stub.call_rpc :create_instance, request, options: options do |response, operation| + response = ::Gapic::Operation.new response, @operations_client, options: options + yield response, operation if block_given? + throw :response, response + end + rescue ::GRPC::BadStatus => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Updates the metadata and configuration of a specific Redis instance. + # + # Completed longrunning.Operation will contain the new instance object + # in the response field. The returned operation is automatically deleted + # after a few hours, so there is no need to call DeleteOperation. + # + # @overload update_instance(request, options = nil) + # Pass arguments to `update_instance` via a request object, either of type + # {::Google::Cloud::Redis::V1::UpdateInstanceRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Redis::V1::UpdateInstanceRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_instance(update_mask: nil, instance: nil) + # Pass arguments to `update_instance` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param update_mask [::Google::Protobuf::FieldMask, ::Hash] + # Required. Mask of fields to update. At least one path must be supplied in + # this field. The elements of the repeated paths field may only include these + # fields from {::Google::Cloud::Redis::V1::Instance Instance}: + # + # * `displayName` + # * `labels` + # * `memorySizeGb` + # * `redisConfig` + # * `replica_count` + # @param instance [::Google::Cloud::Redis::V1::Instance, ::Hash] + # Required. Update description. + # Only fields specified in update_mask are updated. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Gapic::Operation] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Gapic::Operation] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/redis/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Redis::V1::CloudRedis::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Redis::V1::UpdateInstanceRequest.new + # + # # Call the update_instance method. + # result = client.update_instance 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_instance request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Redis::V1::UpdateInstanceRequest + + # Converts hash 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_instance.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::Redis::V1::VERSION + metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.instance&.name + header_params["instance.name"] = request.instance.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_instance.timeout, + metadata: metadata, + retry_policy: @config.rpcs.update_instance.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @cloud_redis_stub.call_rpc :update_instance, 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 + + ## + # Upgrades Redis instance to the newer Redis version specified in the + # request. + # + # @overload upgrade_instance(request, options = nil) + # Pass arguments to `upgrade_instance` via a request object, either of type + # {::Google::Cloud::Redis::V1::UpgradeInstanceRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Redis::V1::UpgradeInstanceRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. + # + # @overload upgrade_instance(name: nil, redis_version: nil) + # Pass arguments to `upgrade_instance` via keyword arguments. Note that at + # least one keyword argument is 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. Redis instance resource name using the form: + # `projects/{project_id}/locations/{location_id}/instances/{instance_id}` + # where `location_id` refers to a GCP region. + # @param redis_version [::String] + # Required. Specifies the target version of Redis software to upgrade to. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Gapic::Operation] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Gapic::Operation] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/redis/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Redis::V1::CloudRedis::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Redis::V1::UpgradeInstanceRequest.new + # + # # Call the upgrade_instance method. + # result = client.upgrade_instance 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 upgrade_instance request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Redis::V1::UpgradeInstanceRequest + + # Converts hash 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.upgrade_instance.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::Redis::V1::VERSION + metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.name + header_params["name"] = request.name + end + + request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") + metadata[:"x-goog-request-params"] ||= request_params_header + + options.apply_defaults timeout: @config.rpcs.upgrade_instance.timeout, + metadata: metadata, + retry_policy: @config.rpcs.upgrade_instance.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @cloud_redis_stub.call_rpc :upgrade_instance, 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 + + ## + # Import a Redis RDB snapshot file from Cloud Storage into a Redis instance. + # + # Redis may stop serving during this operation. Instance state will be + # IMPORTING for entire operation. When complete, the instance will contain + # only data from the imported file. + # + # The returned operation is automatically deleted after a few hours, so + # there is no need to call DeleteOperation. + # + # @overload import_instance(request, options = nil) + # Pass arguments to `import_instance` via a request object, either of type + # {::Google::Cloud::Redis::V1::ImportInstanceRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Redis::V1::ImportInstanceRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. + # + # @overload import_instance(name: nil, input_config: nil) + # Pass arguments to `import_instance` via keyword arguments. Note that at + # least one keyword argument is 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. Redis instance resource name using the form: + # `projects/{project_id}/locations/{location_id}/instances/{instance_id}` + # where `location_id` refers to a GCP region. + # @param input_config [::Google::Cloud::Redis::V1::InputConfig, ::Hash] + # Required. Specify data to be imported. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Gapic::Operation] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Gapic::Operation] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/redis/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Redis::V1::CloudRedis::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Redis::V1::ImportInstanceRequest.new + # + # # Call the import_instance method. + # result = client.import_instance 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 import_instance request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Redis::V1::ImportInstanceRequest + + # Converts hash 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.import_instance.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::Redis::V1::VERSION + metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.name + header_params["name"] = request.name + end + + request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") + metadata[:"x-goog-request-params"] ||= request_params_header + + options.apply_defaults timeout: @config.rpcs.import_instance.timeout, + metadata: metadata, + retry_policy: @config.rpcs.import_instance.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @cloud_redis_stub.call_rpc :import_instance, 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 + + ## + # Export Redis instance data into a Redis RDB format file in Cloud Storage. + # + # Redis will continue serving during this operation. + # + # The returned operation is automatically deleted after a few hours, so + # there is no need to call DeleteOperation. + # + # @overload export_instance(request, options = nil) + # Pass arguments to `export_instance` via a request object, either of type + # {::Google::Cloud::Redis::V1::ExportInstanceRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Redis::V1::ExportInstanceRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. + # + # @overload export_instance(name: nil, output_config: nil) + # Pass arguments to `export_instance` via keyword arguments. Note that at + # least one keyword argument is 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. Redis instance resource name using the form: + # `projects/{project_id}/locations/{location_id}/instances/{instance_id}` + # where `location_id` refers to a GCP region. + # @param output_config [::Google::Cloud::Redis::V1::OutputConfig, ::Hash] + # Required. Specify data to be exported. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Gapic::Operation] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Gapic::Operation] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/redis/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Redis::V1::CloudRedis::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Redis::V1::ExportInstanceRequest.new + # + # # Call the export_instance method. + # result = client.export_instance 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 export_instance request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Redis::V1::ExportInstanceRequest + + # Converts hash 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.export_instance.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::Redis::V1::VERSION + metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.name + header_params["name"] = request.name + end + + request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") + metadata[:"x-goog-request-params"] ||= request_params_header + + options.apply_defaults timeout: @config.rpcs.export_instance.timeout, + metadata: metadata, + retry_policy: @config.rpcs.export_instance.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @cloud_redis_stub.call_rpc :export_instance, 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 + + ## + # Initiates a failover of the primary node to current replica node for a + # specific STANDARD tier Cloud Memorystore for Redis instance. + # + # @overload failover_instance(request, options = nil) + # Pass arguments to `failover_instance` via a request object, either of type + # {::Google::Cloud::Redis::V1::FailoverInstanceRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Redis::V1::FailoverInstanceRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. + # + # @overload failover_instance(name: nil, data_protection_mode: nil) + # Pass arguments to `failover_instance` via keyword arguments. Note that at + # least one keyword argument is 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. Redis instance resource name using the form: + # `projects/{project_id}/locations/{location_id}/instances/{instance_id}` + # where `location_id` refers to a GCP region. + # @param data_protection_mode [::Google::Cloud::Redis::V1::FailoverInstanceRequest::DataProtectionMode] + # Optional. Available data protection modes that the user can choose. If it's + # unspecified, data protection mode will be LIMITED_DATA_LOSS by default. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Gapic::Operation] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Gapic::Operation] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/redis/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Redis::V1::CloudRedis::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Redis::V1::FailoverInstanceRequest.new + # + # # Call the failover_instance method. + # result = client.failover_instance 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 failover_instance request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Redis::V1::FailoverInstanceRequest + + # Converts hash 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.failover_instance.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::Redis::V1::VERSION + metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.name + header_params["name"] = request.name + end + + request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") + metadata[:"x-goog-request-params"] ||= request_params_header + + options.apply_defaults timeout: @config.rpcs.failover_instance.timeout, + metadata: metadata, + retry_policy: @config.rpcs.failover_instance.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @cloud_redis_stub.call_rpc :failover_instance, 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 specific Redis instance. Instance stops serving and data is + # deleted. + # + # @overload delete_instance(request, options = nil) + # Pass arguments to `delete_instance` via a request object, either of type + # {::Google::Cloud::Redis::V1::DeleteInstanceRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Redis::V1::DeleteInstanceRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_instance(name: nil) + # Pass arguments to `delete_instance` via keyword arguments. Note that at + # least one keyword argument is 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. Redis instance resource name using the form: + # `projects/{project_id}/locations/{location_id}/instances/{instance_id}` + # where `location_id` refers to a GCP region. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Gapic::Operation] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Gapic::Operation] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/redis/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Redis::V1::CloudRedis::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Redis::V1::DeleteInstanceRequest.new + # + # # Call the delete_instance method. + # result = client.delete_instance 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_instance request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Redis::V1::DeleteInstanceRequest + + # Converts hash 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_instance.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::Redis::V1::VERSION + metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.name + header_params["name"] = request.name + end + + request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") + metadata[:"x-goog-request-params"] ||= request_params_header + + options.apply_defaults timeout: @config.rpcs.delete_instance.timeout, + metadata: metadata, + retry_policy: @config.rpcs.delete_instance.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @cloud_redis_stub.call_rpc :delete_instance, 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 + + ## + # Reschedule maintenance for a given instance in a given project and + # location. + # + # @overload reschedule_maintenance(request, options = nil) + # Pass arguments to `reschedule_maintenance` via a request object, either of type + # {::Google::Cloud::Redis::V1::RescheduleMaintenanceRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Redis::V1::RescheduleMaintenanceRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. + # + # @overload reschedule_maintenance(name: nil, reschedule_type: nil, schedule_time: nil) + # Pass arguments to `reschedule_maintenance` via keyword arguments. Note that at + # least one keyword argument is 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. Redis instance resource name using the form: + # `projects/{project_id}/locations/{location_id}/instances/{instance_id}` + # where `location_id` refers to a GCP region. + # @param reschedule_type [::Google::Cloud::Redis::V1::RescheduleMaintenanceRequest::RescheduleType] + # Required. If reschedule type is SPECIFIC_TIME, must set up schedule_time as + # well. + # @param schedule_time [::Google::Protobuf::Timestamp, ::Hash] + # Optional. Timestamp when the maintenance shall be rescheduled to if + # reschedule_type=SPECIFIC_TIME, in RFC 3339 format, for + # example `2012-11-15T16:19:00.094Z`. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Gapic::Operation] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Gapic::Operation] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/redis/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Redis::V1::CloudRedis::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Redis::V1::RescheduleMaintenanceRequest.new + # + # # Call the reschedule_maintenance method. + # result = client.reschedule_maintenance 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 reschedule_maintenance request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Redis::V1::RescheduleMaintenanceRequest + + # Converts hash 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.reschedule_maintenance.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::Redis::V1::VERSION + metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.name + header_params["name"] = request.name + end + + request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") + metadata[:"x-goog-request-params"] ||= request_params_header + + options.apply_defaults timeout: @config.rpcs.reschedule_maintenance.timeout, + metadata: metadata, + retry_policy: @config.rpcs.reschedule_maintenance.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @cloud_redis_stub.call_rpc :reschedule_maintenance, 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 CloudRedis API. + # + # This class represents the configuration for CloudRedis, + # providing control over timeouts, retry behavior, logging, transport + # parameters, and other low-level controls. Certain parameters can also be + # applied individually to specific RPCs. See + # {::Google::Cloud::Redis::V1::CloudRedis::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_instances to 20 seconds, + # # and all remaining timeouts to 10 seconds. + # ::Google::Cloud::Redis::V1::CloudRedis::Client.configure do |config| + # config.timeout = 10.0 + # config.rpcs.list_instances.timeout = 20.0 + # end + # + # # Apply the above configuration only to a new client. + # client = ::Google::Cloud::Redis::V1::CloudRedis::Client.new do |config| + # config.timeout = 10.0 + # config.rpcs.list_instances.timeout = 20.0 + # end + # + # @!attribute [rw] endpoint + # A custom service endpoint, as a hostname or hostname:port. The default is + # nil, indicating to use the default endpoint in the current universe domain. + # @return [::String,nil] + # @!attribute [rw] credentials + # Credentials to send with calls. You may provide any of the following types: + # * (`Google::Auth::Credentials`) A googleauth credentials object + # (see the [googleauth docs](https://rubydoc.info/gems/googleauth/Google/Auth/Credentials)) + # * (`Signet::OAuth2::Client`) A signet oauth2 client object + # (see the [signet docs](https://rubydoc.info/gems/signet/Signet/OAuth2/Client)) + # * (`GRPC::Core::Channel`) a gRPC channel with included credentials + # * (`GRPC::Core::ChannelCredentials`) a gRPC credentails object + # * (`nil`) indicating no credentials + # + # @note Warning: Passing a `String` to a keyfile path or a `Hash` of credentials + # is deprecated. Providing an unvalidated credential configuration to + # Google APIs can compromise the security of your systems and data. + # + # @example + # + # # The recommended way to provide credentials is to use the `make_creds` method + # # on the appropriate credentials class for your environment. + # + # require "googleauth" + # + # credentials = ::Google::Auth::ServiceAccountCredentials.make_creds( + # json_key_io: ::File.open("/path/to/keyfile.json") + # ) + # + # client = ::Google::Cloud::Redis::V1::CloudRedis::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 = "redis.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 CloudRedis 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_instances` + # @return [::Gapic::Config::Method] + # + attr_reader :list_instances + ## + # RPC-specific configuration for `get_instance` + # @return [::Gapic::Config::Method] + # + attr_reader :get_instance + ## + # RPC-specific configuration for `get_instance_auth_string` + # @return [::Gapic::Config::Method] + # + attr_reader :get_instance_auth_string + ## + # RPC-specific configuration for `create_instance` + # @return [::Gapic::Config::Method] + # + attr_reader :create_instance + ## + # RPC-specific configuration for `update_instance` + # @return [::Gapic::Config::Method] + # + attr_reader :update_instance + ## + # RPC-specific configuration for `upgrade_instance` + # @return [::Gapic::Config::Method] + # + attr_reader :upgrade_instance + ## + # RPC-specific configuration for `import_instance` + # @return [::Gapic::Config::Method] + # + attr_reader :import_instance + ## + # RPC-specific configuration for `export_instance` + # @return [::Gapic::Config::Method] + # + attr_reader :export_instance + ## + # RPC-specific configuration for `failover_instance` + # @return [::Gapic::Config::Method] + # + attr_reader :failover_instance + ## + # RPC-specific configuration for `delete_instance` + # @return [::Gapic::Config::Method] + # + attr_reader :delete_instance + ## + # RPC-specific configuration for `reschedule_maintenance` + # @return [::Gapic::Config::Method] + # + attr_reader :reschedule_maintenance + + # @private + def initialize parent_rpcs = nil + list_instances_config = parent_rpcs.list_instances if parent_rpcs.respond_to? :list_instances + @list_instances = ::Gapic::Config::Method.new list_instances_config + get_instance_config = parent_rpcs.get_instance if parent_rpcs.respond_to? :get_instance + @get_instance = ::Gapic::Config::Method.new get_instance_config + get_instance_auth_string_config = parent_rpcs.get_instance_auth_string if parent_rpcs.respond_to? :get_instance_auth_string + @get_instance_auth_string = ::Gapic::Config::Method.new get_instance_auth_string_config + create_instance_config = parent_rpcs.create_instance if parent_rpcs.respond_to? :create_instance + @create_instance = ::Gapic::Config::Method.new create_instance_config + update_instance_config = parent_rpcs.update_instance if parent_rpcs.respond_to? :update_instance + @update_instance = ::Gapic::Config::Method.new update_instance_config + upgrade_instance_config = parent_rpcs.upgrade_instance if parent_rpcs.respond_to? :upgrade_instance + @upgrade_instance = ::Gapic::Config::Method.new upgrade_instance_config + import_instance_config = parent_rpcs.import_instance if parent_rpcs.respond_to? :import_instance + @import_instance = ::Gapic::Config::Method.new import_instance_config + export_instance_config = parent_rpcs.export_instance if parent_rpcs.respond_to? :export_instance + @export_instance = ::Gapic::Config::Method.new export_instance_config + failover_instance_config = parent_rpcs.failover_instance if parent_rpcs.respond_to? :failover_instance + @failover_instance = ::Gapic::Config::Method.new failover_instance_config + delete_instance_config = parent_rpcs.delete_instance if parent_rpcs.respond_to? :delete_instance + @delete_instance = ::Gapic::Config::Method.new delete_instance_config + reschedule_maintenance_config = parent_rpcs.reschedule_maintenance if parent_rpcs.respond_to? :reschedule_maintenance + @reschedule_maintenance = ::Gapic::Config::Method.new reschedule_maintenance_config + + yield self if block_given? + end + end + end + end + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-redis-v1/lib/google/cloud/redis/v1/cloud_redis/credentials.rb b/owl-bot-staging/google-cloud-redis-v1/lib/google/cloud/redis/v1/cloud_redis/credentials.rb new file mode 100644 index 000000000000..5cbeef4d938c --- /dev/null +++ b/owl-bot-staging/google-cloud-redis-v1/lib/google/cloud/redis/v1/cloud_redis/credentials.rb @@ -0,0 +1,51 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +require "googleauth" + +module Google + module Cloud + module Redis + module V1 + module CloudRedis + # Credentials for the CloudRedis API. + class Credentials < ::Google::Auth::Credentials + self.scope = [ + "https://www.googleapis.com/auth/cloud-platform" + ] + self.env_vars = [ + "REDIS_CREDENTIALS", + "REDIS_KEYFILE", + "GOOGLE_CLOUD_CREDENTIALS", + "GOOGLE_CLOUD_KEYFILE", + "GCLOUD_KEYFILE", + "REDIS_CREDENTIALS_JSON", + "REDIS_KEYFILE_JSON", + "GOOGLE_CLOUD_CREDENTIALS_JSON", + "GOOGLE_CLOUD_KEYFILE_JSON", + "GCLOUD_KEYFILE_JSON" + ] + self.paths = [ + "~/.config/google_cloud/application_default_credentials.json" + ] + end + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-redis-v1/lib/google/cloud/redis/v1/cloud_redis/operations.rb b/owl-bot-staging/google-cloud-redis-v1/lib/google/cloud/redis/v1/cloud_redis/operations.rb new file mode 100644 index 000000000000..c0b8de973715 --- /dev/null +++ b/owl-bot-staging/google-cloud-redis-v1/lib/google/cloud/redis/v1/cloud_redis/operations.rb @@ -0,0 +1,841 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +require "gapic/operation" +require "google/longrunning/operations_pb" + +module Google + module Cloud + module Redis + module V1 + module CloudRedis + # Service that implements Longrunning Operations API. + class Operations + # @private + API_VERSION = "" + + # @private + DEFAULT_ENDPOINT_TEMPLATE = "redis.$UNIVERSE_DOMAIN$" + + # @private + attr_reader :operations_stub + + ## + # Configuration for the CloudRedis 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 CloudRedis 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::Redis::V1::VERSION + metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.name + header_params["name"] = request.name + end + + request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") + metadata[:"x-goog-request-params"] ||= request_params_header + + options.apply_defaults timeout: @config.rpcs.list_operations.timeout, + metadata: metadata, + retry_policy: @config.rpcs.list_operations.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @operations_stub.call_rpc :list_operations, request, options: options do |response, operation| + wrap_lro_operation = ->(op_response) { ::Gapic::Operation.new op_response, @operations_client } + response = ::Gapic::PagedEnumerable.new @operations_stub, :list_operations, request, response, operation, options, format_resource: wrap_lro_operation + yield response, operation if block_given? + 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::Redis::V1::VERSION + metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.name + header_params["name"] = request.name + end + + request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") + metadata[:"x-goog-request-params"] ||= request_params_header + + options.apply_defaults timeout: @config.rpcs.get_operation.timeout, + metadata: metadata, + retry_policy: @config.rpcs.get_operation.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @operations_stub.call_rpc :get_operation, request, options: options do |response, operation| + response = ::Gapic::Operation.new response, @operations_client, options: options + yield response, operation if block_given? + 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::Redis::V1::VERSION + metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.name + header_params["name"] = request.name + end + + request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") + metadata[:"x-goog-request-params"] ||= request_params_header + + options.apply_defaults timeout: @config.rpcs.delete_operation.timeout, + metadata: metadata, + retry_policy: @config.rpcs.delete_operation.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @operations_stub.call_rpc :delete_operation, request, options: options do |response, operation| + yield response, operation if block_given? + 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::Redis::V1::VERSION + metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.name + header_params["name"] = request.name + end + + request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") + metadata[:"x-goog-request-params"] ||= request_params_header + + options.apply_defaults timeout: @config.rpcs.cancel_operation.timeout, + metadata: metadata, + retry_policy: @config.rpcs.cancel_operation.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @operations_stub.call_rpc :cancel_operation, request, options: options do |response, operation| + yield response, operation if block_given? + 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::Redis::V1::VERSION + metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + options.apply_defaults timeout: @config.rpcs.wait_operation.timeout, + metadata: metadata, + retry_policy: @config.rpcs.wait_operation.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @operations_stub.call_rpc :wait_operation, request, options: options do |response, operation| + response = ::Gapic::Operation.new response, @operations_client, options: options + yield response, operation if block_given? + 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 = "redis.googleapis.com" + + config_attr :endpoint, nil, ::String, nil + config_attr :credentials, nil do |value| + allowed = [::String, ::Hash, ::Proc, ::Symbol, ::Google::Auth::Credentials, ::Google::Auth::BaseClient, ::Signet::OAuth2::Client, nil] + allowed += [::GRPC::Core::Channel, ::GRPC::Core::ChannelCredentials] if defined? ::GRPC::Core::Channel + allowed.any? { |klass| klass === value } + end + config_attr :scope, nil, ::String, ::Array, nil + config_attr :lib_name, nil, ::String, nil + config_attr :lib_version, nil, ::String, nil + config_attr(:channel_args, { "grpc.service_config_disable_resolution" => 1 }, ::Hash, nil) + config_attr :interceptors, nil, ::Array, nil + config_attr :timeout, nil, ::Numeric, nil + config_attr :metadata, nil, ::Hash, nil + config_attr :retry_policy, nil, ::Hash, ::Proc, nil + config_attr :quota_project, nil, ::String, nil + config_attr :universe_domain, nil, ::String, nil + config_attr :logger, :default, ::Logger, nil, :default + + # @private + def initialize parent_config = nil + @parent_config = parent_config unless parent_config.nil? + + yield self if block_given? + end + + ## + # Configurations for individual RPCs + # @return [Rpcs] + # + def rpcs + @rpcs ||= begin + parent_rpcs = nil + parent_rpcs = @parent_config.rpcs if defined?(@parent_config) && @parent_config.respond_to?(:rpcs) + Rpcs.new parent_rpcs + end + end + + ## + # Configuration for the channel pool + # @return [::Gapic::ServiceStub::ChannelPool::Configuration] + # + def channel_pool + @channel_pool ||= ::Gapic::ServiceStub::ChannelPool::Configuration.new + end + + ## + # Configuration RPC class for the Operations API. + # + # Includes fields providing the configuration for each RPC in this service. + # Each configuration object is of type `Gapic::Config::Method` and includes + # the following configuration fields: + # + # * `timeout` (*type:* `Numeric`) - The call timeout in seconds + # * `metadata` (*type:* `Hash{Symbol=>String}`) - Additional gRPC headers + # * `retry_policy (*type:* `Hash`) - The retry policy. The policy fields + # include the following keys: + # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds. + # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds. + # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier. + # * `:retry_codes` (*type:* `Array`) - The error codes that should + # trigger a retry. + # + class Rpcs + ## + # RPC-specific configuration for `list_operations` + # @return [::Gapic::Config::Method] + # + attr_reader :list_operations + ## + # RPC-specific configuration for `get_operation` + # @return [::Gapic::Config::Method] + # + attr_reader :get_operation + ## + # RPC-specific configuration for `delete_operation` + # @return [::Gapic::Config::Method] + # + attr_reader :delete_operation + ## + # RPC-specific configuration for `cancel_operation` + # @return [::Gapic::Config::Method] + # + attr_reader :cancel_operation + ## + # RPC-specific configuration for `wait_operation` + # @return [::Gapic::Config::Method] + # + attr_reader :wait_operation + + # @private + def initialize parent_rpcs = nil + list_operations_config = parent_rpcs.list_operations if parent_rpcs.respond_to? :list_operations + @list_operations = ::Gapic::Config::Method.new list_operations_config + get_operation_config = parent_rpcs.get_operation if parent_rpcs.respond_to? :get_operation + @get_operation = ::Gapic::Config::Method.new get_operation_config + delete_operation_config = parent_rpcs.delete_operation if parent_rpcs.respond_to? :delete_operation + @delete_operation = ::Gapic::Config::Method.new delete_operation_config + cancel_operation_config = parent_rpcs.cancel_operation if parent_rpcs.respond_to? :cancel_operation + @cancel_operation = ::Gapic::Config::Method.new cancel_operation_config + wait_operation_config = parent_rpcs.wait_operation if parent_rpcs.respond_to? :wait_operation + @wait_operation = ::Gapic::Config::Method.new wait_operation_config + + yield self if block_given? + end + end + end + end + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-redis-v1/lib/google/cloud/redis/v1/cloud_redis/paths.rb b/owl-bot-staging/google-cloud-redis-v1/lib/google/cloud/redis/v1/cloud_redis/paths.rb new file mode 100644 index 000000000000..1077a0084cf3 --- /dev/null +++ b/owl-bot-staging/google-cloud-redis-v1/lib/google/cloud/redis/v1/cloud_redis/paths.rb @@ -0,0 +1,69 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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 Redis + module V1 + module CloudRedis + # Path helper methods for the CloudRedis API. + module Paths + ## + # Create a fully-qualified Instance resource string. + # + # The resource will be in the following format: + # + # `projects/{project}/locations/{location}/instances/{instance}` + # + # @param project [String] + # @param location [String] + # @param instance [String] + # + # @return [::String] + def instance_path project:, location:, instance: + raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" + raise ::ArgumentError, "location cannot contain /" if location.to_s.include? "/" + + "projects/#{project}/locations/#{location}/instances/#{instance}" + 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 + + extend self + end + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-redis-v1/lib/google/cloud/redis/v1/cloud_redis/rest.rb b/owl-bot-staging/google-cloud-redis-v1/lib/google/cloud/redis/v1/cloud_redis/rest.rb new file mode 100644 index 000000000000..d3cb458ddfd3 --- /dev/null +++ b/owl-bot-staging/google-cloud-redis-v1/lib/google/cloud/redis/v1/cloud_redis/rest.rb @@ -0,0 +1,68 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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/redis/v1/version" +require "google/cloud/redis/v1/bindings_override" + +require "google/cloud/redis/v1/cloud_redis/credentials" +require "google/cloud/redis/v1/cloud_redis/paths" +require "google/cloud/redis/v1/cloud_redis/rest/operations" +require "google/cloud/redis/v1/cloud_redis/rest/client" + +module Google + module Cloud + module Redis + module V1 + ## + # Configures and manages Cloud Memorystore for Redis instances + # + # Google Cloud Memorystore for Redis v1 + # + # The `redis.googleapis.com` service implements the Google Cloud Memorystore + # for Redis API and defines the following resource model for managing Redis + # instances: + # * The service works with a collection of cloud projects, named: `/projects/*` + # * Each project has a collection of available locations, named: `/locations/*` + # * Each location has a collection of Redis instances, named: `/instances/*` + # * As such, Redis instances are resources of the form: + # `/projects/{project_id}/locations/{location_id}/instances/{instance_id}` + # + # Note that location_id must be referring to a GCP `region`; for example: + # * `projects/redpepper-1290/locations/us-central1/instances/my-redis` + # + # To load this service and instantiate a REST client: + # + # require "google/cloud/redis/v1/cloud_redis/rest" + # client = ::Google::Cloud::Redis::V1::CloudRedis::Rest::Client.new + # + module CloudRedis + # Client for the REST transport + module Rest + end + end + end + end + end +end + +helper_path = ::File.join __dir__, "rest", "helpers.rb" +require "google/cloud/redis/v1/cloud_redis/rest/helpers" if ::File.file? helper_path diff --git a/owl-bot-staging/google-cloud-redis-v1/lib/google/cloud/redis/v1/cloud_redis/rest/client.rb b/owl-bot-staging/google-cloud-redis-v1/lib/google/cloud/redis/v1/cloud_redis/rest/client.rb new file mode 100644 index 000000000000..2d6c409f24aa --- /dev/null +++ b/owl-bot-staging/google-cloud-redis-v1/lib/google/cloud/redis/v1/cloud_redis/rest/client.rb @@ -0,0 +1,1537 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +require "google/cloud/errors" +require "google/cloud/redis/v1/cloud_redis_pb" +require "google/cloud/redis/v1/cloud_redis/rest/service_stub" +require "google/cloud/location/rest" + +module Google + module Cloud + module Redis + module V1 + module CloudRedis + module Rest + ## + # REST client for the CloudRedis service. + # + # Configures and manages Cloud Memorystore for Redis instances + # + # Google Cloud Memorystore for Redis v1 + # + # The `redis.googleapis.com` service implements the Google Cloud Memorystore + # for Redis API and defines the following resource model for managing Redis + # instances: + # * The service works with a collection of cloud projects, named: `/projects/*` + # * Each project has a collection of available locations, named: `/locations/*` + # * Each location has a collection of Redis instances, named: `/instances/*` + # * As such, Redis instances are resources of the form: + # `/projects/{project_id}/locations/{location_id}/instances/{instance_id}` + # + # Note that location_id must be referring to a GCP `region`; for example: + # * `projects/redpepper-1290/locations/us-central1/instances/my-redis` + # + class Client + # @private + API_VERSION = "" + + # @private + DEFAULT_ENDPOINT_TEMPLATE = "redis.$UNIVERSE_DOMAIN$" + + include Paths + + # @private + attr_reader :cloud_redis_stub + + ## + # Configure the CloudRedis Client class. + # + # See {::Google::Cloud::Redis::V1::CloudRedis::Rest::Client::Configuration} + # for a description of the configuration fields. + # + # @example + # + # # Modify the configuration for all CloudRedis clients + # ::Google::Cloud::Redis::V1::CloudRedis::Rest::Client.configure do |config| + # config.timeout = 10.0 + # end + # + # @yield [config] Configure the Client client. + # @yieldparam config [Client::Configuration] + # + # @return [Client::Configuration] + # + def self.configure + @configure ||= begin + namespace = ["Google", "Cloud", "Redis", "V1"] + parent_config = while namespace.any? + parent_name = namespace.join "::" + parent_const = const_get parent_name + break parent_const.configure if parent_const.respond_to? :configure + namespace.pop + end + default_config = Client::Configuration.new parent_config + + default_config.rpcs.list_instances.timeout = 600.0 + + default_config.rpcs.get_instance.timeout = 600.0 + + default_config.rpcs.get_instance_auth_string.timeout = 600.0 + + default_config.rpcs.create_instance.timeout = 600.0 + + default_config.rpcs.update_instance.timeout = 600.0 + + default_config.rpcs.upgrade_instance.timeout = 600.0 + + default_config.rpcs.import_instance.timeout = 600.0 + + default_config.rpcs.export_instance.timeout = 600.0 + + default_config.rpcs.failover_instance.timeout = 600.0 + + default_config.rpcs.delete_instance.timeout = 600.0 + + default_config.rpcs.reschedule_maintenance.timeout = 600.0 + + default_config + end + yield @configure if block_given? + @configure + end + + ## + # Configure the CloudRedis Client instance. + # + # The configuration is set to the derived mode, meaning that values can be changed, + # but structural changes (adding new fields, etc.) are not allowed. Structural changes + # should be made on {Client.configure}. + # + # See {::Google::Cloud::Redis::V1::CloudRedis::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 + @cloud_redis_stub.universe_domain + end + + ## + # Create a new CloudRedis REST client object. + # + # @example + # + # # Create a client using the default configuration + # client = ::Google::Cloud::Redis::V1::CloudRedis::Rest::Client.new + # + # # Create a client using a custom configuration + # client = ::Google::Cloud::Redis::V1::CloudRedis::Rest::Client.new do |config| + # config.timeout = 10.0 + # end + # + # @yield [config] Configure the CloudRedis client. + # @yieldparam config [Client::Configuration] + # + def initialize + # Create the configuration object + @config = Configuration.new Client.configure + + # Yield the configuration if needed + yield @config if block_given? + + # Create credentials + credentials = @config.credentials + # Use self-signed JWT if the endpoint is unchanged from default, + # but only if the default endpoint does not have a region prefix. + enable_self_signed_jwt = @config.endpoint.nil? || + (@config.endpoint == Configuration::DEFAULT_ENDPOINT && + !@config.endpoint.split(".").first.include?("-")) + credentials ||= Credentials.default scope: @config.scope, + enable_self_signed_jwt: enable_self_signed_jwt + if credentials.is_a?(::String) || credentials.is_a?(::Hash) + credentials = Credentials.new credentials, scope: @config.scope + end + + @quota_project_id = @config.quota_project + @quota_project_id ||= credentials.quota_project_id if credentials.respond_to? :quota_project_id + + @operations_client = ::Google::Cloud::Redis::V1::CloudRedis::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 + + @cloud_redis_stub = ::Google::Cloud::Redis::V1::CloudRedis::Rest::ServiceStub.new( + endpoint: @config.endpoint, + endpoint_template: DEFAULT_ENDPOINT_TEMPLATE, + universe_domain: @config.universe_domain, + credentials: credentials, + logger: @config.logger + ) + + @cloud_redis_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 = @cloud_redis_stub.endpoint + config.universe_domain = @cloud_redis_stub.universe_domain + config.bindings_override = @config.bindings_override + config.logger = @cloud_redis_stub.logger if config.respond_to? :logger= + end + end + + ## + # Get the associated client for long-running operations. + # + # @return [::Google::Cloud::Redis::V1::CloudRedis::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 + @cloud_redis_stub.logger + end + + # Service calls + + ## + # Lists all Redis instances owned by a project in either the specified + # location (region) or all locations. + # + # The location should have the following format: + # + # * `projects/{project_id}/locations/{location_id}` + # + # If `location_id` is specified as `-` (wildcard), then all regions + # available to the project are queried, and the results are aggregated. + # + # @overload list_instances(request, options = nil) + # Pass arguments to `list_instances` via a request object, either of type + # {::Google::Cloud::Redis::V1::ListInstancesRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Redis::V1::ListInstancesRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_instances(parent: nil, page_size: nil, page_token: nil) + # Pass arguments to `list_instances` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param parent [::String] + # Required. The resource name of the instance location using the form: + # `projects/{project_id}/locations/{location_id}` + # where `location_id` refers to a GCP region. + # @param page_size [::Integer] + # The maximum number of items to return. + # + # If not specified, a default value of 1000 will be used by the service. + # Regardless of the page_size value, the response may include a partial list + # and a caller should only rely on response's + # {::Google::Cloud::Redis::V1::ListInstancesResponse#next_page_token `next_page_token`} + # to determine if there are more instances left to be queried. + # @param page_token [::String] + # The `next_page_token` value returned from a previous + # {::Google::Cloud::Redis::V1::CloudRedis::Rest::Client#list_instances ListInstances} request, if + # any. + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Gapic::Rest::PagedEnumerable<::Google::Cloud::Redis::V1::Instance>] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Gapic::Rest::PagedEnumerable<::Google::Cloud::Redis::V1::Instance>] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/redis/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Redis::V1::CloudRedis::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Redis::V1::ListInstancesRequest.new + # + # # Call the list_instances method. + # result = client.list_instances request + # + # # The returned object is of type Gapic::PagedEnumerable. You can iterate + # # over elements, and API calls will be issued to fetch pages as needed. + # result.each do |item| + # # Each element is of type ::Google::Cloud::Redis::V1::Instance. + # p item + # end + # + def list_instances request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Redis::V1::ListInstancesRequest + + # Converts hash 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_instances.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::Redis::V1::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + options.apply_defaults timeout: @config.rpcs.list_instances.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.list_instances.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @cloud_redis_stub.list_instances request, options do |result, operation| + result = ::Gapic::Rest::PagedEnumerable.new @cloud_redis_stub, :list_instances, "instances", 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 details of a specific Redis instance. + # + # @overload get_instance(request, options = nil) + # Pass arguments to `get_instance` via a request object, either of type + # {::Google::Cloud::Redis::V1::GetInstanceRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Redis::V1::GetInstanceRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_instance(name: nil) + # Pass arguments to `get_instance` via keyword arguments. Note that at + # least one keyword argument is 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. Redis instance resource name using the form: + # `projects/{project_id}/locations/{location_id}/instances/{instance_id}` + # where `location_id` refers to a GCP region. + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Cloud::Redis::V1::Instance] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::Redis::V1::Instance] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/redis/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Redis::V1::CloudRedis::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Redis::V1::GetInstanceRequest.new + # + # # Call the get_instance method. + # result = client.get_instance request + # + # # The returned object is of type Google::Cloud::Redis::V1::Instance. + # p result + # + def get_instance request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Redis::V1::GetInstanceRequest + + # Converts hash 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_instance.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::Redis::V1::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + options.apply_defaults timeout: @config.rpcs.get_instance.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.get_instance.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @cloud_redis_stub.get_instance request, options do |result, operation| + yield result, operation if block_given? + end + rescue ::Gapic::Rest::Error => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Gets the AUTH string for a Redis instance. If AUTH is not enabled for the + # instance the response will be empty. This information is not included in + # the details returned to GetInstance. + # + # @overload get_instance_auth_string(request, options = nil) + # Pass arguments to `get_instance_auth_string` via a request object, either of type + # {::Google::Cloud::Redis::V1::GetInstanceAuthStringRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Redis::V1::GetInstanceAuthStringRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_instance_auth_string(name: nil) + # Pass arguments to `get_instance_auth_string` via keyword arguments. Note that at + # least one keyword argument is 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. Redis instance resource name using the form: + # `projects/{project_id}/locations/{location_id}/instances/{instance_id}` + # where `location_id` refers to a GCP region. + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Cloud::Redis::V1::InstanceAuthString] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::Redis::V1::InstanceAuthString] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/redis/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Redis::V1::CloudRedis::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Redis::V1::GetInstanceAuthStringRequest.new + # + # # Call the get_instance_auth_string method. + # result = client.get_instance_auth_string request + # + # # The returned object is of type Google::Cloud::Redis::V1::InstanceAuthString. + # p result + # + def get_instance_auth_string request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Redis::V1::GetInstanceAuthStringRequest + + # Converts hash 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_instance_auth_string.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::Redis::V1::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + options.apply_defaults timeout: @config.rpcs.get_instance_auth_string.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.get_instance_auth_string.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @cloud_redis_stub.get_instance_auth_string request, options do |result, operation| + yield result, operation if block_given? + end + rescue ::Gapic::Rest::Error => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Creates a Redis instance based on the specified tier and memory size. + # + # By default, the instance is accessible from the project's + # [default network](https://cloud.google.com/vpc/docs/vpc). + # + # The creation is executed asynchronously and callers may check the returned + # operation to track its progress. Once the operation is completed the Redis + # instance will be fully functional. Completed longrunning.Operation will + # contain the new instance object in the response field. + # + # The returned operation is automatically deleted after a few hours, so there + # is no need to call DeleteOperation. + # + # @overload create_instance(request, options = nil) + # Pass arguments to `create_instance` via a request object, either of type + # {::Google::Cloud::Redis::V1::CreateInstanceRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Redis::V1::CreateInstanceRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_instance(parent: nil, instance_id: nil, instance: nil) + # Pass arguments to `create_instance` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param parent [::String] + # Required. The resource name of the instance location using the form: + # `projects/{project_id}/locations/{location_id}` + # where `location_id` refers to a GCP region. + # @param instance_id [::String] + # Required. The logical name of the Redis instance in the customer project + # with the following restrictions: + # + # * Must contain only lowercase letters, numbers, and hyphens. + # * Must start with a letter. + # * Must be between 1-40 characters. + # * Must end with a number or a letter. + # * Must be unique within the customer project / location + # @param instance [::Google::Cloud::Redis::V1::Instance, ::Hash] + # Required. A Redis [Instance] 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/cloud/redis/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Redis::V1::CloudRedis::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Redis::V1::CreateInstanceRequest.new + # + # # Call the create_instance method. + # result = client.create_instance 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_instance request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Redis::V1::CreateInstanceRequest + + # Converts hash 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_instance.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::Redis::V1::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + options.apply_defaults timeout: @config.rpcs.create_instance.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.create_instance.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @cloud_redis_stub.create_instance 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 + + ## + # Updates the metadata and configuration of a specific Redis instance. + # + # Completed longrunning.Operation will contain the new instance object + # in the response field. The returned operation is automatically deleted + # after a few hours, so there is no need to call DeleteOperation. + # + # @overload update_instance(request, options = nil) + # Pass arguments to `update_instance` via a request object, either of type + # {::Google::Cloud::Redis::V1::UpdateInstanceRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Redis::V1::UpdateInstanceRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_instance(update_mask: nil, instance: nil) + # Pass arguments to `update_instance` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param update_mask [::Google::Protobuf::FieldMask, ::Hash] + # Required. Mask of fields to update. At least one path must be supplied in + # this field. The elements of the repeated paths field may only include these + # fields from {::Google::Cloud::Redis::V1::Instance Instance}: + # + # * `displayName` + # * `labels` + # * `memorySizeGb` + # * `redisConfig` + # * `replica_count` + # @param instance [::Google::Cloud::Redis::V1::Instance, ::Hash] + # Required. Update description. + # Only fields specified in update_mask are updated. + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Gapic::Operation] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Gapic::Operation] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/redis/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Redis::V1::CloudRedis::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Redis::V1::UpdateInstanceRequest.new + # + # # Call the update_instance method. + # result = client.update_instance 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_instance request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Redis::V1::UpdateInstanceRequest + + # Converts hash 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_instance.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::Redis::V1::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + options.apply_defaults timeout: @config.rpcs.update_instance.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.update_instance.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @cloud_redis_stub.update_instance 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 + + ## + # Upgrades Redis instance to the newer Redis version specified in the + # request. + # + # @overload upgrade_instance(request, options = nil) + # Pass arguments to `upgrade_instance` via a request object, either of type + # {::Google::Cloud::Redis::V1::UpgradeInstanceRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Redis::V1::UpgradeInstanceRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @overload upgrade_instance(name: nil, redis_version: nil) + # Pass arguments to `upgrade_instance` via keyword arguments. Note that at + # least one keyword argument is 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. Redis instance resource name using the form: + # `projects/{project_id}/locations/{location_id}/instances/{instance_id}` + # where `location_id` refers to a GCP region. + # @param redis_version [::String] + # Required. Specifies the target version of Redis software to upgrade to. + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Gapic::Operation] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Gapic::Operation] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/redis/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Redis::V1::CloudRedis::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Redis::V1::UpgradeInstanceRequest.new + # + # # Call the upgrade_instance method. + # result = client.upgrade_instance 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 upgrade_instance request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Redis::V1::UpgradeInstanceRequest + + # Converts hash 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.upgrade_instance.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::Redis::V1::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + options.apply_defaults timeout: @config.rpcs.upgrade_instance.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.upgrade_instance.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @cloud_redis_stub.upgrade_instance 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 + + ## + # Import a Redis RDB snapshot file from Cloud Storage into a Redis instance. + # + # Redis may stop serving during this operation. Instance state will be + # IMPORTING for entire operation. When complete, the instance will contain + # only data from the imported file. + # + # The returned operation is automatically deleted after a few hours, so + # there is no need to call DeleteOperation. + # + # @overload import_instance(request, options = nil) + # Pass arguments to `import_instance` via a request object, either of type + # {::Google::Cloud::Redis::V1::ImportInstanceRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Redis::V1::ImportInstanceRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @overload import_instance(name: nil, input_config: nil) + # Pass arguments to `import_instance` via keyword arguments. Note that at + # least one keyword argument is 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. Redis instance resource name using the form: + # `projects/{project_id}/locations/{location_id}/instances/{instance_id}` + # where `location_id` refers to a GCP region. + # @param input_config [::Google::Cloud::Redis::V1::InputConfig, ::Hash] + # Required. Specify data to be imported. + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Gapic::Operation] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Gapic::Operation] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/redis/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Redis::V1::CloudRedis::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Redis::V1::ImportInstanceRequest.new + # + # # Call the import_instance method. + # result = client.import_instance 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 import_instance request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Redis::V1::ImportInstanceRequest + + # Converts hash 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.import_instance.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::Redis::V1::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + options.apply_defaults timeout: @config.rpcs.import_instance.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.import_instance.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @cloud_redis_stub.import_instance 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 + + ## + # Export Redis instance data into a Redis RDB format file in Cloud Storage. + # + # Redis will continue serving during this operation. + # + # The returned operation is automatically deleted after a few hours, so + # there is no need to call DeleteOperation. + # + # @overload export_instance(request, options = nil) + # Pass arguments to `export_instance` via a request object, either of type + # {::Google::Cloud::Redis::V1::ExportInstanceRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Redis::V1::ExportInstanceRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @overload export_instance(name: nil, output_config: nil) + # Pass arguments to `export_instance` via keyword arguments. Note that at + # least one keyword argument is 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. Redis instance resource name using the form: + # `projects/{project_id}/locations/{location_id}/instances/{instance_id}` + # where `location_id` refers to a GCP region. + # @param output_config [::Google::Cloud::Redis::V1::OutputConfig, ::Hash] + # Required. Specify data to be exported. + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Gapic::Operation] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Gapic::Operation] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/redis/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Redis::V1::CloudRedis::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Redis::V1::ExportInstanceRequest.new + # + # # Call the export_instance method. + # result = client.export_instance 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 export_instance request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Redis::V1::ExportInstanceRequest + + # Converts hash 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.export_instance.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::Redis::V1::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + options.apply_defaults timeout: @config.rpcs.export_instance.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.export_instance.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @cloud_redis_stub.export_instance 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 + + ## + # Initiates a failover of the primary node to current replica node for a + # specific STANDARD tier Cloud Memorystore for Redis instance. + # + # @overload failover_instance(request, options = nil) + # Pass arguments to `failover_instance` via a request object, either of type + # {::Google::Cloud::Redis::V1::FailoverInstanceRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Redis::V1::FailoverInstanceRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @overload failover_instance(name: nil, data_protection_mode: nil) + # Pass arguments to `failover_instance` via keyword arguments. Note that at + # least one keyword argument is 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. Redis instance resource name using the form: + # `projects/{project_id}/locations/{location_id}/instances/{instance_id}` + # where `location_id` refers to a GCP region. + # @param data_protection_mode [::Google::Cloud::Redis::V1::FailoverInstanceRequest::DataProtectionMode] + # Optional. Available data protection modes that the user can choose. If it's + # unspecified, data protection mode will be LIMITED_DATA_LOSS by default. + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Gapic::Operation] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Gapic::Operation] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/redis/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Redis::V1::CloudRedis::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Redis::V1::FailoverInstanceRequest.new + # + # # Call the failover_instance method. + # result = client.failover_instance 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 failover_instance request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Redis::V1::FailoverInstanceRequest + + # Converts hash 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.failover_instance.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::Redis::V1::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + options.apply_defaults timeout: @config.rpcs.failover_instance.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.failover_instance.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @cloud_redis_stub.failover_instance 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 specific Redis instance. Instance stops serving and data is + # deleted. + # + # @overload delete_instance(request, options = nil) + # Pass arguments to `delete_instance` via a request object, either of type + # {::Google::Cloud::Redis::V1::DeleteInstanceRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Redis::V1::DeleteInstanceRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_instance(name: nil) + # Pass arguments to `delete_instance` via keyword arguments. Note that at + # least one keyword argument is 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. Redis instance resource name using the form: + # `projects/{project_id}/locations/{location_id}/instances/{instance_id}` + # where `location_id` refers to a GCP region. + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Gapic::Operation] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Gapic::Operation] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/redis/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Redis::V1::CloudRedis::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Redis::V1::DeleteInstanceRequest.new + # + # # Call the delete_instance method. + # result = client.delete_instance 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_instance request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Redis::V1::DeleteInstanceRequest + + # Converts hash 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_instance.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::Redis::V1::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + options.apply_defaults timeout: @config.rpcs.delete_instance.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.delete_instance.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @cloud_redis_stub.delete_instance 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 + + ## + # Reschedule maintenance for a given instance in a given project and + # location. + # + # @overload reschedule_maintenance(request, options = nil) + # Pass arguments to `reschedule_maintenance` via a request object, either of type + # {::Google::Cloud::Redis::V1::RescheduleMaintenanceRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Redis::V1::RescheduleMaintenanceRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @overload reschedule_maintenance(name: nil, reschedule_type: nil, schedule_time: nil) + # Pass arguments to `reschedule_maintenance` via keyword arguments. Note that at + # least one keyword argument is 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. Redis instance resource name using the form: + # `projects/{project_id}/locations/{location_id}/instances/{instance_id}` + # where `location_id` refers to a GCP region. + # @param reschedule_type [::Google::Cloud::Redis::V1::RescheduleMaintenanceRequest::RescheduleType] + # Required. If reschedule type is SPECIFIC_TIME, must set up schedule_time as + # well. + # @param schedule_time [::Google::Protobuf::Timestamp, ::Hash] + # Optional. Timestamp when the maintenance shall be rescheduled to if + # reschedule_type=SPECIFIC_TIME, in RFC 3339 format, for + # example `2012-11-15T16:19:00.094Z`. + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Gapic::Operation] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Gapic::Operation] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/redis/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Redis::V1::CloudRedis::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Redis::V1::RescheduleMaintenanceRequest.new + # + # # Call the reschedule_maintenance method. + # result = client.reschedule_maintenance 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 reschedule_maintenance request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Redis::V1::RescheduleMaintenanceRequest + + # Converts hash 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.reschedule_maintenance.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::Redis::V1::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + options.apply_defaults timeout: @config.rpcs.reschedule_maintenance.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.reschedule_maintenance.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @cloud_redis_stub.reschedule_maintenance 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 + + ## + # Configuration class for the CloudRedis REST API. + # + # This class represents the configuration for CloudRedis REST, + # providing control over timeouts, retry behavior, logging, transport + # parameters, and other low-level controls. Certain parameters can also be + # applied individually to specific RPCs. See + # {::Google::Cloud::Redis::V1::CloudRedis::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_instances to 20 seconds, + # # and all remaining timeouts to 10 seconds. + # ::Google::Cloud::Redis::V1::CloudRedis::Rest::Client.configure do |config| + # config.timeout = 10.0 + # config.rpcs.list_instances.timeout = 20.0 + # end + # + # # Apply the above configuration only to a new client. + # client = ::Google::Cloud::Redis::V1::CloudRedis::Rest::Client.new do |config| + # config.timeout = 10.0 + # config.rpcs.list_instances.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 = "redis.googleapis.com" + + config_attr :endpoint, nil, ::String, nil + config_attr :credentials, nil do |value| + allowed = [::String, ::Hash, ::Proc, ::Symbol, ::Google::Auth::Credentials, ::Google::Auth::BaseClient, ::Signet::OAuth2::Client, nil] + allowed.any? { |klass| klass === value } + end + config_attr :scope, nil, ::String, ::Array, nil + config_attr :lib_name, nil, ::String, nil + config_attr :lib_version, nil, ::String, nil + config_attr :timeout, nil, ::Numeric, nil + config_attr :metadata, nil, ::Hash, nil + config_attr :retry_policy, nil, ::Hash, ::Proc, nil + config_attr :quota_project, nil, ::String, nil + config_attr :universe_domain, nil, ::String, nil + + # @private + # Overrides for http bindings for the RPCs of this service + # are only used when this service is used as mixin, and only + # by the host service. + # @return [::Hash{::Symbol=>::Array<::Gapic::Rest::GrpcTranscoder::HttpBinding>}] + config_attr :bindings_override, {}, ::Hash, nil + config_attr :logger, :default, ::Logger, nil, :default + + # @private + def initialize parent_config = nil + @parent_config = parent_config unless parent_config.nil? + + yield self if block_given? + end + + ## + # Configurations for individual RPCs + # @return [Rpcs] + # + def rpcs + @rpcs ||= begin + parent_rpcs = nil + parent_rpcs = @parent_config.rpcs if defined?(@parent_config) && @parent_config.respond_to?(:rpcs) + Rpcs.new parent_rpcs + end + end + + ## + # Configuration RPC class for the CloudRedis 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_instances` + # @return [::Gapic::Config::Method] + # + attr_reader :list_instances + ## + # RPC-specific configuration for `get_instance` + # @return [::Gapic::Config::Method] + # + attr_reader :get_instance + ## + # RPC-specific configuration for `get_instance_auth_string` + # @return [::Gapic::Config::Method] + # + attr_reader :get_instance_auth_string + ## + # RPC-specific configuration for `create_instance` + # @return [::Gapic::Config::Method] + # + attr_reader :create_instance + ## + # RPC-specific configuration for `update_instance` + # @return [::Gapic::Config::Method] + # + attr_reader :update_instance + ## + # RPC-specific configuration for `upgrade_instance` + # @return [::Gapic::Config::Method] + # + attr_reader :upgrade_instance + ## + # RPC-specific configuration for `import_instance` + # @return [::Gapic::Config::Method] + # + attr_reader :import_instance + ## + # RPC-specific configuration for `export_instance` + # @return [::Gapic::Config::Method] + # + attr_reader :export_instance + ## + # RPC-specific configuration for `failover_instance` + # @return [::Gapic::Config::Method] + # + attr_reader :failover_instance + ## + # RPC-specific configuration for `delete_instance` + # @return [::Gapic::Config::Method] + # + attr_reader :delete_instance + ## + # RPC-specific configuration for `reschedule_maintenance` + # @return [::Gapic::Config::Method] + # + attr_reader :reschedule_maintenance + + # @private + def initialize parent_rpcs = nil + list_instances_config = parent_rpcs.list_instances if parent_rpcs.respond_to? :list_instances + @list_instances = ::Gapic::Config::Method.new list_instances_config + get_instance_config = parent_rpcs.get_instance if parent_rpcs.respond_to? :get_instance + @get_instance = ::Gapic::Config::Method.new get_instance_config + get_instance_auth_string_config = parent_rpcs.get_instance_auth_string if parent_rpcs.respond_to? :get_instance_auth_string + @get_instance_auth_string = ::Gapic::Config::Method.new get_instance_auth_string_config + create_instance_config = parent_rpcs.create_instance if parent_rpcs.respond_to? :create_instance + @create_instance = ::Gapic::Config::Method.new create_instance_config + update_instance_config = parent_rpcs.update_instance if parent_rpcs.respond_to? :update_instance + @update_instance = ::Gapic::Config::Method.new update_instance_config + upgrade_instance_config = parent_rpcs.upgrade_instance if parent_rpcs.respond_to? :upgrade_instance + @upgrade_instance = ::Gapic::Config::Method.new upgrade_instance_config + import_instance_config = parent_rpcs.import_instance if parent_rpcs.respond_to? :import_instance + @import_instance = ::Gapic::Config::Method.new import_instance_config + export_instance_config = parent_rpcs.export_instance if parent_rpcs.respond_to? :export_instance + @export_instance = ::Gapic::Config::Method.new export_instance_config + failover_instance_config = parent_rpcs.failover_instance if parent_rpcs.respond_to? :failover_instance + @failover_instance = ::Gapic::Config::Method.new failover_instance_config + delete_instance_config = parent_rpcs.delete_instance if parent_rpcs.respond_to? :delete_instance + @delete_instance = ::Gapic::Config::Method.new delete_instance_config + reschedule_maintenance_config = parent_rpcs.reschedule_maintenance if parent_rpcs.respond_to? :reschedule_maintenance + @reschedule_maintenance = ::Gapic::Config::Method.new reschedule_maintenance_config + + yield self if block_given? + end + end + end + end + end + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-redis-v1/lib/google/cloud/redis/v1/cloud_redis/rest/operations.rb b/owl-bot-staging/google-cloud-redis-v1/lib/google/cloud/redis/v1/cloud_redis/rest/operations.rb new file mode 100644 index 000000000000..79e5ab9ba956 --- /dev/null +++ b/owl-bot-staging/google-cloud-redis-v1/lib/google/cloud/redis/v1/cloud_redis/rest/operations.rb @@ -0,0 +1,924 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +require "gapic/operation" + +module Google + module Cloud + module Redis + module V1 + module CloudRedis + module Rest + # Service that implements Longrunning Operations API. + class Operations + # @private + API_VERSION = "" + + # @private + DEFAULT_ENDPOINT_TEMPLATE = "redis.$UNIVERSE_DOMAIN$" + + # @private + attr_reader :operations_stub + + ## + # Configuration for the CloudRedis 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 CloudRedis 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::Redis::V1::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + options.apply_defaults timeout: @config.rpcs.list_operations.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.list_operations.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @operations_stub.list_operations request, options do |result, operation| + result = ::Gapic::Rest::PagedEnumerable.new @operations_stub, :list_operations, "operations", request, result, options + yield result, operation if block_given? + 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::Redis::V1::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + options.apply_defaults timeout: @config.rpcs.get_operation.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.get_operation.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @operations_stub.get_operation request, options do |result, operation| + result = ::Gapic::Operation.new result, @operations_client, options: options + yield result, operation if block_given? + 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::Redis::V1::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + options.apply_defaults timeout: @config.rpcs.delete_operation.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.delete_operation.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @operations_stub.delete_operation request, options do |result, operation| + yield result, operation if block_given? + 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::Redis::V1::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + options.apply_defaults timeout: @config.rpcs.cancel_operation.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.cancel_operation.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @operations_stub.cancel_operation request, options do |result, operation| + yield result, operation if block_given? + 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 = "redis.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}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the get_operation REST call + # + # @param request_pb [::Google::Longrunning::GetOperationRequest] + # A request object representing the call parameters. Required. + # @return [Array(String, [String, nil], Hash{String => String})] + # Uri, Body, Query string parameters + def self.transcode_get_operation_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/operations/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the delete_operation REST call + # + # @param request_pb [::Google::Longrunning::DeleteOperationRequest] + # A request object representing the call parameters. Required. + # @return [Array(String, [String, nil], Hash{String => String})] + # Uri, Body, Query string parameters + def self.transcode_delete_operation_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :delete, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/operations/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the cancel_operation REST call + # + # @param request_pb [::Google::Longrunning::CancelOperationRequest] + # A request object representing the call parameters. Required. + # @return [Array(String, [String, nil], Hash{String => String})] + # Uri, Body, Query string parameters + def self.transcode_cancel_operation_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/operations/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + end + end + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-redis-v1/lib/google/cloud/redis/v1/cloud_redis/rest/service_stub.rb b/owl-bot-staging/google-cloud-redis-v1/lib/google/cloud/redis/v1/cloud_redis/rest/service_stub.rb new file mode 100644 index 000000000000..c768dbf9d049 --- /dev/null +++ b/owl-bot-staging/google-cloud-redis-v1/lib/google/cloud/redis/v1/cloud_redis/rest/service_stub.rb @@ -0,0 +1,759 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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/redis/v1/cloud_redis_pb" + +module Google + module Cloud + module Redis + module V1 + module CloudRedis + module Rest + ## + # REST service stub for the CloudRedis service. + # Service stub contains baseline method implementations + # including transcoding, making the REST call, and deserialing the response. + # + class ServiceStub + # @private + def initialize endpoint:, endpoint_template:, universe_domain:, credentials:, logger: + # These require statements are intentionally placed here to initialize + # the REST modules only when it's required. + require "gapic/rest" + + @client_stub = ::Gapic::Rest::ClientStub.new endpoint: endpoint, + endpoint_template: endpoint_template, + universe_domain: universe_domain, + credentials: credentials, + numeric_enums: true, + service_name: self.class, + raise_faraday_errors: false, + logger: logger + end + + ## + # The effective universe domain + # + # @return [String] + # + def universe_domain + @client_stub.universe_domain + end + + ## + # The effective endpoint + # + # @return [String] + # + def endpoint + @client_stub.endpoint + end + + ## + # The logger used for request/response debug logging. + # + # @return [Logger] + # + def logger stub: false + stub ? @client_stub.stub_logger : @client_stub.logger + end + + ## + # Baseline implementation for the list_instances REST call + # + # @param request_pb [::Google::Cloud::Redis::V1::ListInstancesRequest] + # A request object representing the call parameters. Required. + # @param options [::Gapic::CallOptions] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Cloud::Redis::V1::ListInstancesResponse] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::Redis::V1::ListInstancesResponse] + # A result object deserialized from the server's reply + def list_instances request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_list_instances_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_instances", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Cloud::Redis::V1::ListInstancesResponse.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_instance REST call + # + # @param request_pb [::Google::Cloud::Redis::V1::GetInstanceRequest] + # A request object representing the call parameters. Required. + # @param options [::Gapic::CallOptions] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Cloud::Redis::V1::Instance] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::Redis::V1::Instance] + # A result object deserialized from the server's reply + def get_instance request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_get_instance_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_instance", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Cloud::Redis::V1::Instance.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_instance_auth_string REST call + # + # @param request_pb [::Google::Cloud::Redis::V1::GetInstanceAuthStringRequest] + # A request object representing the call parameters. Required. + # @param options [::Gapic::CallOptions] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Cloud::Redis::V1::InstanceAuthString] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::Redis::V1::InstanceAuthString] + # A result object deserialized from the server's reply + def get_instance_auth_string request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_get_instance_auth_string_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_instance_auth_string", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Cloud::Redis::V1::InstanceAuthString.decode_json response.body, ignore_unknown_fields: true + catch :response do + yield result, operation if block_given? + result + end + end + + ## + # Baseline implementation for the create_instance REST call + # + # @param request_pb [::Google::Cloud::Redis::V1::CreateInstanceRequest] + # 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_instance request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_create_instance_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_instance", + 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 update_instance REST call + # + # @param request_pb [::Google::Cloud::Redis::V1::UpdateInstanceRequest] + # 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_instance request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_update_instance_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_instance", + 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 upgrade_instance REST call + # + # @param request_pb [::Google::Cloud::Redis::V1::UpgradeInstanceRequest] + # 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 upgrade_instance request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_upgrade_instance_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: "upgrade_instance", + 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 import_instance REST call + # + # @param request_pb [::Google::Cloud::Redis::V1::ImportInstanceRequest] + # 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 import_instance request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_import_instance_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: "import_instance", + 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 export_instance REST call + # + # @param request_pb [::Google::Cloud::Redis::V1::ExportInstanceRequest] + # 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 export_instance request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_export_instance_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: "export_instance", + 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 failover_instance REST call + # + # @param request_pb [::Google::Cloud::Redis::V1::FailoverInstanceRequest] + # 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 failover_instance request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_failover_instance_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: "failover_instance", + 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_instance REST call + # + # @param request_pb [::Google::Cloud::Redis::V1::DeleteInstanceRequest] + # 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_instance request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_delete_instance_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_instance", + 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 reschedule_maintenance REST call + # + # @param request_pb [::Google::Cloud::Redis::V1::RescheduleMaintenanceRequest] + # 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 reschedule_maintenance request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_reschedule_maintenance_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: "reschedule_maintenance", + 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 + + ## + # @private + # + # GRPC transcoding helper method for the list_instances REST call + # + # @param request_pb [::Google::Cloud::Redis::V1::ListInstancesRequest] + # 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_instances_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :get, + uri_template: "/v1/{parent}/instances", + matches: [ + ["parent", %r{^projects/[^/]+/locations/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the get_instance REST call + # + # @param request_pb [::Google::Cloud::Redis::V1::GetInstanceRequest] + # 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_instance_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/instances/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the get_instance_auth_string REST call + # + # @param request_pb [::Google::Cloud::Redis::V1::GetInstanceAuthStringRequest] + # 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_instance_auth_string_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}/authString", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/instances/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the create_instance REST call + # + # @param request_pb [::Google::Cloud::Redis::V1::CreateInstanceRequest] + # 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_instance_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :post, + uri_template: "/v1/{parent}/instances", + body: "instance", + matches: [ + ["parent", %r{^projects/[^/]+/locations/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the update_instance REST call + # + # @param request_pb [::Google::Cloud::Redis::V1::UpdateInstanceRequest] + # 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_instance_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :patch, + uri_template: "/v1/{instance.name}", + body: "instance", + matches: [ + ["instance.name", %r{^projects/[^/]+/locations/[^/]+/instances/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the upgrade_instance REST call + # + # @param request_pb [::Google::Cloud::Redis::V1::UpgradeInstanceRequest] + # A request object representing the call parameters. Required. + # @return [Array(String, [String, nil], Hash{String => String})] + # Uri, Body, Query string parameters + def self.transcode_upgrade_instance_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:upgrade", + body: "*", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/instances/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the import_instance REST call + # + # @param request_pb [::Google::Cloud::Redis::V1::ImportInstanceRequest] + # A request object representing the call parameters. Required. + # @return [Array(String, [String, nil], Hash{String => String})] + # Uri, Body, Query string parameters + def self.transcode_import_instance_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:import", + body: "*", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/instances/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the export_instance REST call + # + # @param request_pb [::Google::Cloud::Redis::V1::ExportInstanceRequest] + # A request object representing the call parameters. Required. + # @return [Array(String, [String, nil], Hash{String => String})] + # Uri, Body, Query string parameters + def self.transcode_export_instance_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:export", + body: "*", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/instances/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the failover_instance REST call + # + # @param request_pb [::Google::Cloud::Redis::V1::FailoverInstanceRequest] + # A request object representing the call parameters. Required. + # @return [Array(String, [String, nil], Hash{String => String})] + # Uri, Body, Query string parameters + def self.transcode_failover_instance_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:failover", + body: "*", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/instances/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the delete_instance REST call + # + # @param request_pb [::Google::Cloud::Redis::V1::DeleteInstanceRequest] + # 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_instance_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :delete, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/instances/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the reschedule_maintenance REST call + # + # @param request_pb [::Google::Cloud::Redis::V1::RescheduleMaintenanceRequest] + # A request object representing the call parameters. Required. + # @return [Array(String, [String, nil], Hash{String => String})] + # Uri, Body, Query string parameters + def self.transcode_reschedule_maintenance_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:rescheduleMaintenance", + body: "*", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/instances/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + end + end + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-redis-v1/lib/google/cloud/redis/v1/cloud_redis_pb.rb b/owl-bot-staging/google-cloud-redis-v1/lib/google/cloud/redis/v1/cloud_redis_pb.rb new file mode 100644 index 000000000000..6df342725ce7 --- /dev/null +++ b/owl-bot-staging/google-cloud-redis-v1/lib/google/cloud/redis/v1/cloud_redis_pb.rb @@ -0,0 +1,69 @@ +# frozen_string_literal: true +# Generated by the protocol buffer compiler. DO NOT EDIT! +# source: google/cloud/redis/v1/cloud_redis.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/longrunning/operations_pb' +require 'google/protobuf/duration_pb' +require 'google/protobuf/empty_pb' +require 'google/protobuf/field_mask_pb' +require 'google/protobuf/timestamp_pb' +require 'google/type/dayofweek_pb' +require 'google/type/timeofday_pb' + + +descriptor_data = "\n\'google/cloud/redis/v1/cloud_redis.proto\x12\x15google.cloud.redis.v1\x1a\x1cgoogle/api/annotations.proto\x1a\x17google/api/client.proto\x1a\x1fgoogle/api/field_behavior.proto\x1a\x19google/api/resource.proto\x1a#google/longrunning/operations.proto\x1a\x1egoogle/protobuf/duration.proto\x1a\x1bgoogle/protobuf/empty.proto\x1a google/protobuf/field_mask.proto\x1a\x1fgoogle/protobuf/timestamp.proto\x1a\x1bgoogle/type/dayofweek.proto\x1a\x1bgoogle/type/timeofday.proto\".\n\x08NodeInfo\x12\x0f\n\x02id\x18\x01 \x01(\tB\x03\xe0\x41\x03\x12\x11\n\x04zone\x18\x02 \x01(\tB\x03\xe0\x41\x03\"\x85\x13\n\x08Instance\x12\x11\n\x04name\x18\x01 \x01(\tB\x03\xe0\x41\x02\x12\x14\n\x0c\x64isplay_name\x18\x02 \x01(\t\x12;\n\x06labels\x18\x03 \x03(\x0b\x32+.google.cloud.redis.v1.Instance.LabelsEntry\x12\x18\n\x0blocation_id\x18\x04 \x01(\tB\x03\xe0\x41\x01\x12$\n\x17\x61lternative_location_id\x18\x05 \x01(\tB\x03\xe0\x41\x01\x12\x1a\n\rredis_version\x18\x07 \x01(\tB\x03\xe0\x41\x01\x12\x1e\n\x11reserved_ip_range\x18\t \x01(\tB\x03\xe0\x41\x01\x12\x1f\n\x12secondary_ip_range\x18\x1e \x01(\tB\x03\xe0\x41\x01\x12\x11\n\x04host\x18\n \x01(\tB\x03\xe0\x41\x03\x12\x11\n\x04port\x18\x0b \x01(\x05\x42\x03\xe0\x41\x03\x12 \n\x13\x63urrent_location_id\x18\x0c \x01(\tB\x03\xe0\x41\x03\x12\x34\n\x0b\x63reate_time\x18\r \x01(\x0b\x32\x1a.google.protobuf.TimestampB\x03\xe0\x41\x03\x12\x39\n\x05state\x18\x0e \x01(\x0e\x32%.google.cloud.redis.v1.Instance.StateB\x03\xe0\x41\x03\x12\x1b\n\x0estatus_message\x18\x0f \x01(\tB\x03\xe0\x41\x03\x12M\n\rredis_configs\x18\x10 \x03(\x0b\x32\x31.google.cloud.redis.v1.Instance.RedisConfigsEntryB\x03\xe0\x41\x01\x12\x37\n\x04tier\x18\x11 \x01(\x0e\x32$.google.cloud.redis.v1.Instance.TierB\x03\xe0\x41\x02\x12\x1b\n\x0ememory_size_gb\x18\x12 \x01(\x05\x42\x03\xe0\x41\x02\x12\x1f\n\x12\x61uthorized_network\x18\x14 \x01(\tB\x03\xe0\x41\x01\x12%\n\x18persistence_iam_identity\x18\x15 \x01(\tB\x03\xe0\x41\x03\x12\x46\n\x0c\x63onnect_mode\x18\x16 \x01(\x0e\x32+.google.cloud.redis.v1.Instance.ConnectModeB\x03\xe0\x41\x01\x12\x19\n\x0c\x61uth_enabled\x18\x17 \x01(\x08\x42\x03\xe0\x41\x01\x12\x43\n\x0fserver_ca_certs\x18\x19 \x03(\x0b\x32%.google.cloud.redis.v1.TlsCertificateB\x03\xe0\x41\x03\x12[\n\x17transit_encryption_mode\x18\x1a \x01(\x0e\x32\x35.google.cloud.redis.v1.Instance.TransitEncryptionModeB\x03\xe0\x41\x01\x12I\n\x12maintenance_policy\x18\x1b \x01(\x0b\x32(.google.cloud.redis.v1.MaintenancePolicyB\x03\xe0\x41\x01\x12M\n\x14maintenance_schedule\x18\x1c \x01(\x0b\x32*.google.cloud.redis.v1.MaintenanceScheduleB\x03\xe0\x41\x03\x12\x1a\n\rreplica_count\x18\x1f \x01(\x05\x42\x03\xe0\x41\x01\x12\x33\n\x05nodes\x18 \x03(\x0b\x32\x1f.google.cloud.redis.v1.NodeInfoB\x03\xe0\x41\x03\x12\x1a\n\rread_endpoint\x18! \x01(\tB\x03\xe0\x41\x03\x12\x1f\n\x12read_endpoint_port\x18\" \x01(\x05\x42\x03\xe0\x41\x03\x12Q\n\x12read_replicas_mode\x18# \x01(\x0e\x32\x30.google.cloud.redis.v1.Instance.ReadReplicasModeB\x03\xe0\x41\x01\x12!\n\x14\x63ustomer_managed_key\x18$ \x01(\tB\x03\xe0\x41\x01\x12I\n\x12persistence_config\x18% \x01(\x0b\x32(.google.cloud.redis.v1.PersistenceConfigB\x03\xe0\x41\x01\x12Q\n\x12suspension_reasons\x18& \x03(\x0e\x32\x30.google.cloud.redis.v1.Instance.SuspensionReasonB\x03\xe0\x41\x01\x12 \n\x13maintenance_version\x18\' \x01(\tB\x03\xe0\x41\x01\x12+\n\x1e\x61vailable_maintenance_versions\x18( \x03(\tB\x03\xe0\x41\x01\x1a-\n\x0bLabelsEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12\r\n\x05value\x18\x02 \x01(\t:\x02\x38\x01\x1a\x33\n\x11RedisConfigsEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12\r\n\x05value\x18\x02 \x01(\t:\x02\x38\x01\"\x94\x01\n\x05State\x12\x15\n\x11STATE_UNSPECIFIED\x10\x00\x12\x0c\n\x08\x43REATING\x10\x01\x12\t\n\x05READY\x10\x02\x12\x0c\n\x08UPDATING\x10\x03\x12\x0c\n\x08\x44\x45LETING\x10\x04\x12\r\n\tREPAIRING\x10\x05\x12\x0f\n\x0bMAINTENANCE\x10\x06\x12\r\n\tIMPORTING\x10\x08\x12\x10\n\x0c\x46\x41ILING_OVER\x10\t\"8\n\x04Tier\x12\x14\n\x10TIER_UNSPECIFIED\x10\x00\x12\t\n\x05\x42\x41SIC\x10\x01\x12\x0f\n\x0bSTANDARD_HA\x10\x03\"[\n\x0b\x43onnectMode\x12\x1c\n\x18\x43ONNECT_MODE_UNSPECIFIED\x10\x00\x12\x12\n\x0e\x44IRECT_PEERING\x10\x01\x12\x1a\n\x16PRIVATE_SERVICE_ACCESS\x10\x02\"i\n\x15TransitEncryptionMode\x12\'\n#TRANSIT_ENCRYPTION_MODE_UNSPECIFIED\x10\x00\x12\x19\n\x15SERVER_AUTHENTICATION\x10\x01\x12\x0c\n\x08\x44ISABLED\x10\x02\"m\n\x10ReadReplicasMode\x12\"\n\x1eREAD_REPLICAS_MODE_UNSPECIFIED\x10\x00\x12\x1a\n\x16READ_REPLICAS_DISABLED\x10\x01\x12\x19\n\x15READ_REPLICAS_ENABLED\x10\x02\"U\n\x10SuspensionReason\x12!\n\x1dSUSPENSION_REASON_UNSPECIFIED\x10\x00\x12\x1e\n\x1a\x43USTOMER_MANAGED_KEY_ISSUE\x10\x01:`\xea\x41]\n\x1dredis.googleapis.com/Instance\x12\xda\x41\x06parent\x82\xd3\xe4\x93\x02/\x12-/v1/{parent=projects/*/locations/*}/instances\x12\x97\x01\n\x0bGetInstance\x12).google.cloud.redis.v1.GetInstanceRequest\x1a\x1f.google.cloud.redis.v1.Instance\"<\xda\x41\x04name\x82\xd3\xe4\x93\x02/\x12-/v1/{name=projects/*/locations/*/instances/*}\x12\xc0\x01\n\x15GetInstanceAuthString\x12\x33.google.cloud.redis.v1.GetInstanceAuthStringRequest\x1a).google.cloud.redis.v1.InstanceAuthString\"G\xda\x41\x04name\x82\xd3\xe4\x93\x02:\x12\x38/v1/{name=projects/*/locations/*/instances/*}/authString\x12\x89\x02\n\x0e\x43reateInstance\x12,.google.cloud.redis.v1.CreateInstanceRequest\x1a\x1d.google.longrunning.Operation\"\xa9\x01\xca\x41I\n\x1egoogle.cloud.redis.v1.Instance\x12\'google.cloud.redis.v1.OperationMetadata\xda\x41\x1bparent,instance_id,instance\x82\xd3\xe4\x93\x02\x39\"-/v1/{parent=projects/*/locations/*}/instances:\x08instance\x12\x8b\x02\n\x0eUpdateInstance\x12,.google.cloud.redis.v1.UpdateInstanceRequest\x1a\x1d.google.longrunning.Operation\"\xab\x01\xca\x41I\n\x1egoogle.cloud.redis.v1.Instance\x12\'google.cloud.redis.v1.OperationMetadata\xda\x41\x14update_mask,instance\x82\xd3\xe4\x93\x02\x42\x32\x36/v1/{instance.name=projects/*/locations/*/instances/*}:\x08instance\x12\x83\x02\n\x0fUpgradeInstance\x12-.google.cloud.redis.v1.UpgradeInstanceRequest\x1a\x1d.google.longrunning.Operation\"\xa1\x01\xca\x41I\n\x1egoogle.cloud.redis.v1.Instance\x12\'google.cloud.redis.v1.OperationMetadata\xda\x41\x12name,redis_version\x82\xd3\xe4\x93\x02:\"5/v1/{name=projects/*/locations/*/instances/*}:upgrade:\x01*\x12\xff\x01\n\x0eImportInstance\x12,.google.cloud.redis.v1.ImportInstanceRequest\x1a\x1d.google.longrunning.Operation\"\x9f\x01\xca\x41I\n\x1egoogle.cloud.redis.v1.Instance\x12\'google.cloud.redis.v1.OperationMetadata\xda\x41\x11name,input_config\x82\xd3\xe4\x93\x02\x39\"4/v1/{name=projects/*/locations/*/instances/*}:import:\x01*\x12\x80\x02\n\x0e\x45xportInstance\x12,.google.cloud.redis.v1.ExportInstanceRequest\x1a\x1d.google.longrunning.Operation\"\xa0\x01\xca\x41I\n\x1egoogle.cloud.redis.v1.Instance\x12\'google.cloud.redis.v1.OperationMetadata\xda\x41\x12name,output_config\x82\xd3\xe4\x93\x02\x39\"4/v1/{name=projects/*/locations/*/instances/*}:export:\x01*\x12\x8d\x02\n\x10\x46\x61iloverInstance\x12..google.cloud.redis.v1.FailoverInstanceRequest\x1a\x1d.google.longrunning.Operation\"\xa9\x01\xca\x41I\n\x1egoogle.cloud.redis.v1.Instance\x12\'google.cloud.redis.v1.OperationMetadata\xda\x41\x19name,data_protection_mode\x82\xd3\xe4\x93\x02;\"6/v1/{name=projects/*/locations/*/instances/*}:failover:\x01*\x12\xde\x01\n\x0e\x44\x65leteInstance\x12,.google.cloud.redis.v1.DeleteInstanceRequest\x1a\x1d.google.longrunning.Operation\"\x7f\xca\x41@\n\x15google.protobuf.Empty\x12\'google.cloud.redis.v1.OperationMetadata\xda\x41\x04name\x82\xd3\xe4\x93\x02/*-/v1/{name=projects/*/locations/*/instances/*}\x12\xaf\x02\n\x15RescheduleMaintenance\x12\x33.google.cloud.redis.v1.RescheduleMaintenanceRequest\x1a\x1d.google.longrunning.Operation\"\xc1\x01\xca\x41I\n\x1egoogle.cloud.redis.v1.Instance\x12\'google.cloud.redis.v1.OperationMetadata\xda\x41$name, reschedule_type, schedule_time\x82\xd3\xe4\x93\x02H\"C/v1/{name=projects/*/locations/*/instances/*}:rescheduleMaintenance:\x01*\x1aH\xca\x41\x14redis.googleapis.com\xd2\x41.https://www.googleapis.com/auth/cloud-platformBh\n\x19\x63om.google.cloud.redis.v1B\x18\x43loudRedisServiceV1ProtoP\x01Z/cloud.google.com/go/redis/apiv1/redispb;redispbb\x06proto3" + +pool = ::Google::Protobuf::DescriptorPool.generated_pool +pool.add_serialized_file(descriptor_data) + +module Google + module Cloud + module Redis + module V1 + NodeInfo = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.redis.v1.NodeInfo").msgclass + Instance = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.redis.v1.Instance").msgclass + Instance::State = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.redis.v1.Instance.State").enummodule + Instance::Tier = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.redis.v1.Instance.Tier").enummodule + Instance::ConnectMode = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.redis.v1.Instance.ConnectMode").enummodule + Instance::TransitEncryptionMode = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.redis.v1.Instance.TransitEncryptionMode").enummodule + Instance::ReadReplicasMode = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.redis.v1.Instance.ReadReplicasMode").enummodule + Instance::SuspensionReason = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.redis.v1.Instance.SuspensionReason").enummodule + PersistenceConfig = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.redis.v1.PersistenceConfig").msgclass + PersistenceConfig::PersistenceMode = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.redis.v1.PersistenceConfig.PersistenceMode").enummodule + PersistenceConfig::SnapshotPeriod = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.redis.v1.PersistenceConfig.SnapshotPeriod").enummodule + RescheduleMaintenanceRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.redis.v1.RescheduleMaintenanceRequest").msgclass + RescheduleMaintenanceRequest::RescheduleType = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.redis.v1.RescheduleMaintenanceRequest.RescheduleType").enummodule + MaintenancePolicy = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.redis.v1.MaintenancePolicy").msgclass + WeeklyMaintenanceWindow = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.redis.v1.WeeklyMaintenanceWindow").msgclass + MaintenanceSchedule = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.redis.v1.MaintenanceSchedule").msgclass + ListInstancesRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.redis.v1.ListInstancesRequest").msgclass + ListInstancesResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.redis.v1.ListInstancesResponse").msgclass + GetInstanceRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.redis.v1.GetInstanceRequest").msgclass + GetInstanceAuthStringRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.redis.v1.GetInstanceAuthStringRequest").msgclass + InstanceAuthString = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.redis.v1.InstanceAuthString").msgclass + CreateInstanceRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.redis.v1.CreateInstanceRequest").msgclass + UpdateInstanceRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.redis.v1.UpdateInstanceRequest").msgclass + UpgradeInstanceRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.redis.v1.UpgradeInstanceRequest").msgclass + DeleteInstanceRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.redis.v1.DeleteInstanceRequest").msgclass + GcsSource = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.redis.v1.GcsSource").msgclass + InputConfig = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.redis.v1.InputConfig").msgclass + ImportInstanceRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.redis.v1.ImportInstanceRequest").msgclass + GcsDestination = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.redis.v1.GcsDestination").msgclass + OutputConfig = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.redis.v1.OutputConfig").msgclass + ExportInstanceRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.redis.v1.ExportInstanceRequest").msgclass + FailoverInstanceRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.redis.v1.FailoverInstanceRequest").msgclass + FailoverInstanceRequest::DataProtectionMode = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.redis.v1.FailoverInstanceRequest.DataProtectionMode").enummodule + OperationMetadata = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.redis.v1.OperationMetadata").msgclass + LocationMetadata = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.redis.v1.LocationMetadata").msgclass + ZoneMetadata = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.redis.v1.ZoneMetadata").msgclass + TlsCertificate = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.redis.v1.TlsCertificate").msgclass + end + end + end +end diff --git a/owl-bot-staging/google-cloud-redis-v1/lib/google/cloud/redis/v1/cloud_redis_services_pb.rb b/owl-bot-staging/google-cloud-redis-v1/lib/google/cloud/redis/v1/cloud_redis_services_pb.rb new file mode 100644 index 000000000000..46495700f5c3 --- /dev/null +++ b/owl-bot-staging/google-cloud-redis-v1/lib/google/cloud/redis/v1/cloud_redis_services_pb.rb @@ -0,0 +1,120 @@ +# Generated by the protocol buffer compiler. DO NOT EDIT! +# Source: google/cloud/redis/v1/cloud_redis.proto for package 'google.cloud.redis.v1' +# Original file comments: +# 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 +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# + +require 'grpc' +require 'google/cloud/redis/v1/cloud_redis_pb' + +module Google + module Cloud + module Redis + module V1 + module CloudRedis + # Configures and manages Cloud Memorystore for Redis instances + # + # Google Cloud Memorystore for Redis v1 + # + # The `redis.googleapis.com` service implements the Google Cloud Memorystore + # for Redis API and defines the following resource model for managing Redis + # instances: + # * The service works with a collection of cloud projects, named: `/projects/*` + # * Each project has a collection of available locations, named: `/locations/*` + # * Each location has a collection of Redis instances, named: `/instances/*` + # * As such, Redis instances are resources of the form: + # `/projects/{project_id}/locations/{location_id}/instances/{instance_id}` + # + # Note that location_id must be referring to a GCP `region`; for example: + # * `projects/redpepper-1290/locations/us-central1/instances/my-redis` + class Service + + include ::GRPC::GenericService + + self.marshal_class_method = :encode + self.unmarshal_class_method = :decode + self.service_name = 'google.cloud.redis.v1.CloudRedis' + + # Lists all Redis instances owned by a project in either the specified + # location (region) or all locations. + # + # The location should have the following format: + # + # * `projects/{project_id}/locations/{location_id}` + # + # If `location_id` is specified as `-` (wildcard), then all regions + # available to the project are queried, and the results are aggregated. + rpc :ListInstances, ::Google::Cloud::Redis::V1::ListInstancesRequest, ::Google::Cloud::Redis::V1::ListInstancesResponse + # Gets the details of a specific Redis instance. + rpc :GetInstance, ::Google::Cloud::Redis::V1::GetInstanceRequest, ::Google::Cloud::Redis::V1::Instance + # Gets the AUTH string for a Redis instance. If AUTH is not enabled for the + # instance the response will be empty. This information is not included in + # the details returned to GetInstance. + rpc :GetInstanceAuthString, ::Google::Cloud::Redis::V1::GetInstanceAuthStringRequest, ::Google::Cloud::Redis::V1::InstanceAuthString + # Creates a Redis instance based on the specified tier and memory size. + # + # By default, the instance is accessible from the project's + # [default network](https://cloud.google.com/vpc/docs/vpc). + # + # The creation is executed asynchronously and callers may check the returned + # operation to track its progress. Once the operation is completed the Redis + # instance will be fully functional. Completed longrunning.Operation will + # contain the new instance object in the response field. + # + # The returned operation is automatically deleted after a few hours, so there + # is no need to call DeleteOperation. + rpc :CreateInstance, ::Google::Cloud::Redis::V1::CreateInstanceRequest, ::Google::Longrunning::Operation + # Updates the metadata and configuration of a specific Redis instance. + # + # Completed longrunning.Operation will contain the new instance object + # in the response field. The returned operation is automatically deleted + # after a few hours, so there is no need to call DeleteOperation. + rpc :UpdateInstance, ::Google::Cloud::Redis::V1::UpdateInstanceRequest, ::Google::Longrunning::Operation + # Upgrades Redis instance to the newer Redis version specified in the + # request. + rpc :UpgradeInstance, ::Google::Cloud::Redis::V1::UpgradeInstanceRequest, ::Google::Longrunning::Operation + # Import a Redis RDB snapshot file from Cloud Storage into a Redis instance. + # + # Redis may stop serving during this operation. Instance state will be + # IMPORTING for entire operation. When complete, the instance will contain + # only data from the imported file. + # + # The returned operation is automatically deleted after a few hours, so + # there is no need to call DeleteOperation. + rpc :ImportInstance, ::Google::Cloud::Redis::V1::ImportInstanceRequest, ::Google::Longrunning::Operation + # Export Redis instance data into a Redis RDB format file in Cloud Storage. + # + # Redis will continue serving during this operation. + # + # The returned operation is automatically deleted after a few hours, so + # there is no need to call DeleteOperation. + rpc :ExportInstance, ::Google::Cloud::Redis::V1::ExportInstanceRequest, ::Google::Longrunning::Operation + # Initiates a failover of the primary node to current replica node for a + # specific STANDARD tier Cloud Memorystore for Redis instance. + rpc :FailoverInstance, ::Google::Cloud::Redis::V1::FailoverInstanceRequest, ::Google::Longrunning::Operation + # Deletes a specific Redis instance. Instance stops serving and data is + # deleted. + rpc :DeleteInstance, ::Google::Cloud::Redis::V1::DeleteInstanceRequest, ::Google::Longrunning::Operation + # Reschedule maintenance for a given instance in a given project and + # location. + rpc :RescheduleMaintenance, ::Google::Cloud::Redis::V1::RescheduleMaintenanceRequest, ::Google::Longrunning::Operation + end + + Stub = Service.rpc_stub_class + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-redis-v1/lib/google/cloud/redis/v1/rest.rb b/owl-bot-staging/google-cloud-redis-v1/lib/google/cloud/redis/v1/rest.rb new file mode 100644 index 000000000000..08522168e06e --- /dev/null +++ b/owl-bot-staging/google-cloud-redis-v1/lib/google/cloud/redis/v1/rest.rb @@ -0,0 +1,38 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +require "google/cloud/redis/v1/cloud_redis/rest" +require "google/cloud/redis/v1/bindings_override" +require "google/cloud/redis/v1/version" + +module Google + module Cloud + module Redis + ## + # To load just the REST part of this package, including all its services, and instantiate a REST client: + # + # @example + # + # require "google/cloud/redis/v1/rest" + # client = ::Google::Cloud::Redis::V1::CloudRedis::Rest::Client.new + # + module V1 + end + end + end +end diff --git a/owl-bot-staging/google-cloud-redis-v1/lib/google/cloud/redis/v1/version.rb b/owl-bot-staging/google-cloud-redis-v1/lib/google/cloud/redis/v1/version.rb new file mode 100644 index 000000000000..b98699b8e42a --- /dev/null +++ b/owl-bot-staging/google-cloud-redis-v1/lib/google/cloud/redis/v1/version.rb @@ -0,0 +1,28 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + + +module Google + module Cloud + module Redis + module V1 + VERSION = "0.0.1" + end + end + end +end diff --git a/owl-bot-staging/google-cloud-redis-v1/proto_docs/README.md b/owl-bot-staging/google-cloud-redis-v1/proto_docs/README.md new file mode 100644 index 000000000000..49fbb528a7ef --- /dev/null +++ b/owl-bot-staging/google-cloud-redis-v1/proto_docs/README.md @@ -0,0 +1,4 @@ +# Google Cloud Memorystore for Redis V1 Protocol Buffer Documentation + +These files are for the YARD documentation of the generated protobuf files. +They are not intended to be required or loaded at runtime. diff --git a/owl-bot-staging/google-cloud-redis-v1/proto_docs/google/api/client.rb b/owl-bot-staging/google-cloud-redis-v1/proto_docs/google/api/client.rb new file mode 100644 index 000000000000..5089551e9ea4 --- /dev/null +++ b/owl-bot-staging/google-cloud-redis-v1/proto_docs/google/api/client.rb @@ -0,0 +1,589 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + + +module Google + module Api + # Required information for every language. + # @!attribute [rw] reference_docs_uri + # @deprecated This field is deprecated and may be removed in the next major version update. + # @return [::String] + # Link to automatically generated reference documentation. Example: + # https://cloud.google.com/nodejs/docs/reference/asset/latest + # @!attribute [rw] destinations + # @return [::Array<::Google::Api::ClientLibraryDestination>] + # The destination where API teams want this client library to be published. + # @!attribute [rw] selective_gapic_generation + # @return [::Google::Api::SelectiveGapicGeneration] + # Configuration for which RPCs should be generated in the GAPIC client. + class CommonLanguageSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Details about how and where to publish client libraries. + # @!attribute [rw] version + # @return [::String] + # Version of the API to apply these settings to. This is the full protobuf + # package for the API, ending in the version element. + # Examples: "google.cloud.speech.v1" and "google.spanner.admin.database.v1". + # @!attribute [rw] launch_stage + # @return [::Google::Api::LaunchStage] + # Launch stage of this version of the API. + # @!attribute [rw] rest_numeric_enums + # @return [::Boolean] + # When using transport=rest, the client request will encode enums as + # numbers rather than strings. + # @!attribute [rw] java_settings + # @return [::Google::Api::JavaSettings] + # Settings for legacy Java features, supported in the Service YAML. + # @!attribute [rw] cpp_settings + # @return [::Google::Api::CppSettings] + # Settings for C++ client libraries. + # @!attribute [rw] php_settings + # @return [::Google::Api::PhpSettings] + # Settings for PHP client libraries. + # @!attribute [rw] python_settings + # @return [::Google::Api::PythonSettings] + # Settings for Python client libraries. + # @!attribute [rw] node_settings + # @return [::Google::Api::NodeSettings] + # Settings for Node client libraries. + # @!attribute [rw] dotnet_settings + # @return [::Google::Api::DotnetSettings] + # Settings for .NET client libraries. + # @!attribute [rw] ruby_settings + # @return [::Google::Api::RubySettings] + # Settings for Ruby client libraries. + # @!attribute [rw] go_settings + # @return [::Google::Api::GoSettings] + # Settings for Go client libraries. + class ClientLibrarySettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # This message configures the settings for publishing [Google Cloud Client + # libraries](https://cloud.google.com/apis/docs/cloud-client-libraries) + # generated from the service config. + # @!attribute [rw] method_settings + # @return [::Array<::Google::Api::MethodSettings>] + # A list of API method settings, e.g. the behavior for methods that use the + # long-running operation pattern. + # @!attribute [rw] new_issue_uri + # @return [::String] + # Link to a *public* URI where users can report issues. Example: + # https://issuetracker.google.com/issues/new?component=190865&template=1161103 + # @!attribute [rw] documentation_uri + # @return [::String] + # Link to product home page. Example: + # https://cloud.google.com/asset-inventory/docs/overview + # @!attribute [rw] api_short_name + # @return [::String] + # Used as a tracking tag when collecting data about the APIs developer + # relations artifacts like docs, packages delivered to package managers, + # etc. Example: "speech". + # @!attribute [rw] github_label + # @return [::String] + # GitHub label to apply to issues and pull requests opened for this API. + # @!attribute [rw] codeowner_github_teams + # @return [::Array<::String>] + # GitHub teams to be added to CODEOWNERS in the directory in GitHub + # containing source code for the client libraries for this API. + # @!attribute [rw] doc_tag_prefix + # @return [::String] + # A prefix used in sample code when demarking regions to be included in + # documentation. + # @!attribute [rw] organization + # @return [::Google::Api::ClientLibraryOrganization] + # For whom the client library is being published. + # @!attribute [rw] library_settings + # @return [::Array<::Google::Api::ClientLibrarySettings>] + # Client library settings. If the same version string appears multiple + # times in this list, then the last one wins. Settings from earlier + # settings with the same version string are discarded. + # @!attribute [rw] proto_reference_documentation_uri + # @return [::String] + # Optional link to proto reference documentation. Example: + # https://cloud.google.com/pubsub/lite/docs/reference/rpc + # @!attribute [rw] rest_reference_documentation_uri + # @return [::String] + # Optional link to REST reference documentation. Example: + # https://cloud.google.com/pubsub/lite/docs/reference/rest + class Publishing + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Settings for Java client libraries. + # @!attribute [rw] library_package + # @return [::String] + # The package name to use in Java. Clobbers the java_package option + # set in the protobuf. This should be used **only** by APIs + # who have already set the language_settings.java.package_name" field + # in gapic.yaml. API teams should use the protobuf java_package option + # where possible. + # + # Example of a YAML configuration:: + # + # publishing: + # 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. + # @!attribute [rw] methods + # @return [::Array<::String>] + # An allowlist of the fully qualified names of RPCs that should be included + # on public client surfaces. + # @!attribute [rw] generate_omitted_as_internal + # @return [::Boolean] + # Setting this to true indicates to the client generators that methods + # that would be excluded from the generation should instead be generated + # in a way that indicates these methods should not be consumed by + # end users. How this is expressed is up to individual language + # implementations to decide. Some examples may be: added annotations, + # obfuscated identifiers, or other language idiomatic patterns. + class SelectiveGapicGeneration + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # `BatchingConfigProto` defines the batching configuration for an API method. + # @!attribute [rw] thresholds + # @return [::Google::Api::BatchingSettingsProto] + # The thresholds which trigger a batched request to be sent. + # @!attribute [rw] batch_descriptor + # @return [::Google::Api::BatchingDescriptorProto] + # The request and response fields used in batching. + class BatchingConfigProto + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # `BatchingSettingsProto` specifies a set of batching thresholds, each of + # which acts as a trigger to send a batch of messages as a request. At least + # one threshold must be positive nonzero. + # @!attribute [rw] element_count_threshold + # @return [::Integer] + # The number of elements of a field collected into a batch which, if + # exceeded, causes the batch to be sent. + # @!attribute [rw] request_byte_threshold + # @return [::Integer] + # The aggregated size of the batched field which, if exceeded, causes the + # batch to be sent. This size is computed by aggregating the sizes of the + # request field to be batched, not of the entire request message. + # @!attribute [rw] delay_threshold + # @return [::Google::Protobuf::Duration] + # The duration after which a batch should be sent, starting from the addition + # of the first message to that batch. + # @!attribute [rw] element_count_limit + # @return [::Integer] + # The maximum number of elements collected in a batch that could be accepted + # by server. + # @!attribute [rw] request_byte_limit + # @return [::Integer] + # The maximum size of the request that could be accepted by server. + # @!attribute [rw] flow_control_element_limit + # @return [::Integer] + # The maximum number of elements allowed by flow control. + # @!attribute [rw] flow_control_byte_limit + # @return [::Integer] + # The maximum size of data allowed by flow control. + # @!attribute [rw] flow_control_limit_exceeded_behavior + # @return [::Google::Api::FlowControlLimitExceededBehaviorProto] + # The behavior to take when the flow control limit is exceeded. + class BatchingSettingsProto + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # `BatchingDescriptorProto` specifies the fields of the request message to be + # used for batching, and, optionally, the fields of the response message to be + # used for demultiplexing. + # @!attribute [rw] batched_field + # @return [::String] + # The repeated field in the request message to be aggregated by batching. + # @!attribute [rw] discriminator_fields + # @return [::Array<::String>] + # A list of the fields in the request message. Two requests will be batched + # together only if the values of every field specified in + # `request_discriminator_fields` is equal between the two requests. + # @!attribute [rw] subresponse_field + # @return [::String] + # Optional. When present, indicates the field in the response message to be + # used to demultiplex the response into multiple response messages, in + # correspondence with the multiple request messages originally batched + # together. + class BatchingDescriptorProto + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # The organization for which the client libraries are being published. + # Affects the url where generated docs are published, etc. + module ClientLibraryOrganization + # Not useful. + CLIENT_LIBRARY_ORGANIZATION_UNSPECIFIED = 0 + + # Google Cloud Platform Org. + CLOUD = 1 + + # Ads (Advertising) Org. + ADS = 2 + + # Photos Org. + PHOTOS = 3 + + # Street View Org. + STREET_VIEW = 4 + + # Shopping Org. + SHOPPING = 5 + + # Geo Org. + GEO = 6 + + # Generative AI - https://developers.generativeai.google + GENERATIVE_AI = 7 + end + + # To where should client libraries be published? + module ClientLibraryDestination + # Client libraries will neither be generated nor published to package + # managers. + CLIENT_LIBRARY_DESTINATION_UNSPECIFIED = 0 + + # Generate the client library in a repo under github.com/googleapis, + # but don't publish it to package managers. + GITHUB = 10 + + # Publish the library to package managers like nuget.org and npmjs.com. + PACKAGE_MANAGER = 20 + end + + # The behavior to take when the flow control limit is exceeded. + module FlowControlLimitExceededBehaviorProto + # Default behavior, system-defined. + UNSET_BEHAVIOR = 0 + + # Stop operation, raise error. + THROW_EXCEPTION = 1 + + # Pause operation until limit clears. + BLOCK = 2 + + # Continue operation, disregard limit. + IGNORE = 3 + end + end +end diff --git a/owl-bot-staging/google-cloud-redis-v1/proto_docs/google/api/field_behavior.rb b/owl-bot-staging/google-cloud-redis-v1/proto_docs/google/api/field_behavior.rb new file mode 100644 index 000000000000..582be187d115 --- /dev/null +++ b/owl-bot-staging/google-cloud-redis-v1/proto_docs/google/api/field_behavior.rb @@ -0,0 +1,85 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + + +module Google + module Api + # An indicator of the behavior of a given field (for example, that a field + # is required in requests, or given as output but ignored as input). + # This **does not** change the behavior in protocol buffers itself; it only + # denotes the behavior and may affect how API tooling handles the field. + # + # Note: This enum **may** receive new values in the future. + module FieldBehavior + # Conventional default for enums. Do not use this. + FIELD_BEHAVIOR_UNSPECIFIED = 0 + + # Specifically denotes a field as optional. + # While all fields in protocol buffers are optional, this may be specified + # for emphasis if appropriate. + OPTIONAL = 1 + + # Denotes a field as required. + # This indicates that the field **must** be provided as part of the request, + # and failure to do so will cause an error (usually `INVALID_ARGUMENT`). + REQUIRED = 2 + + # Denotes a field as output only. + # This indicates that the field is provided in responses, but including the + # field in a request does nothing (the server *must* ignore it and + # *must not* throw an error as a result of the field's presence). + OUTPUT_ONLY = 3 + + # Denotes a field as input only. + # This indicates that the field is provided in requests, and the + # corresponding field is not included in output. + INPUT_ONLY = 4 + + # Denotes a field as immutable. + # This indicates that the field may be set once in a request to create a + # resource, but may not be changed thereafter. + IMMUTABLE = 5 + + # Denotes that a (repeated) field is an unordered list. + # This indicates that the service may provide the elements of the list + # in any arbitrary order, rather than the order the user originally + # provided. Additionally, the list's order may or may not be stable. + UNORDERED_LIST = 6 + + # Denotes that this field returns a non-empty default value if not set. + # This indicates that if the user provides the empty value in a request, + # a non-empty value will be returned. The user will not be aware of what + # non-empty value to expect. + NON_EMPTY_DEFAULT = 7 + + # Denotes that the field in a resource (a message annotated with + # google.api.resource) is used in the resource name to uniquely identify the + # resource. For AIP-compliant APIs, this should only be applied to the + # `name` field on the resource. + # + # This behavior should not be applied to references to other resources within + # the message. + # + # The identifier field of resources often have different field behavior + # depending on the request it is embedded in (e.g. for Create methods name + # is optional and unused, while for Update methods it is required). Instead + # of method-specific annotations, only `IDENTIFIER` is required. + IDENTIFIER = 8 + end + end +end diff --git a/owl-bot-staging/google-cloud-redis-v1/proto_docs/google/api/launch_stage.rb b/owl-bot-staging/google-cloud-redis-v1/proto_docs/google/api/launch_stage.rb new file mode 100644 index 000000000000..9392a413fb1b --- /dev/null +++ b/owl-bot-staging/google-cloud-redis-v1/proto_docs/google/api/launch_stage.rb @@ -0,0 +1,71 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + + +module Google + module Api + # The launch stage as defined by [Google Cloud Platform + # Launch Stages](https://cloud.google.com/terms/launch-stages). + module LaunchStage + # Do not use this default value. + LAUNCH_STAGE_UNSPECIFIED = 0 + + # The feature is not yet implemented. Users can not use it. + UNIMPLEMENTED = 6 + + # Prelaunch features are hidden from users and are only visible internally. + PRELAUNCH = 7 + + # Early Access features are limited to a closed group of testers. To use + # these features, you must sign up in advance and sign a Trusted Tester + # agreement (which includes confidentiality provisions). These features may + # be unstable, changed in backward-incompatible ways, and are not + # guaranteed to be released. + EARLY_ACCESS = 1 + + # Alpha is a limited availability test for releases before they are cleared + # for widespread use. By Alpha, all significant design issues are resolved + # and we are in the process of verifying functionality. Alpha customers + # need to apply for access, agree to applicable terms, and have their + # projects allowlisted. Alpha releases don't have to be feature complete, + # no SLAs are provided, and there are no technical support obligations, but + # they will be far enough along that customers can actually use them in + # test environments or for limited-use tests -- just like they would in + # normal production cases. + ALPHA = 2 + + # Beta is the point at which we are ready to open a release for any + # customer to use. There are no SLA or technical support obligations in a + # Beta release. Products will be complete from a feature perspective, but + # may have some open outstanding issues. Beta releases are suitable for + # limited production use cases. + BETA = 3 + + # GA features are open to all developers and are considered stable and + # fully qualified for production use. + GA = 4 + + # Deprecated features are scheduled to be shut down and removed. For more + # information, see the "Deprecation Policy" section of our [Terms of + # Service](https://cloud.google.com/terms/) + # and the [Google Cloud Platform Subject to the Deprecation + # Policy](https://cloud.google.com/terms/deprecation) documentation. + DEPRECATED = 5 + end + end +end diff --git a/owl-bot-staging/google-cloud-redis-v1/proto_docs/google/api/resource.rb b/owl-bot-staging/google-cloud-redis-v1/proto_docs/google/api/resource.rb new file mode 100644 index 000000000000..25dec4847ac1 --- /dev/null +++ b/owl-bot-staging/google-cloud-redis-v1/proto_docs/google/api/resource.rb @@ -0,0 +1,227 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + + +module Google + module Api + # A simple descriptor of a resource type. + # + # ResourceDescriptor annotates a resource message (either by means of a + # protobuf annotation or use in the service config), and associates the + # resource's schema, the resource type, and the pattern of the resource name. + # + # Example: + # + # message Topic { + # // Indicates this message defines a resource schema. + # // Declares the resource type in the format of {service}/{kind}. + # // For Kubernetes resources, the format is {api group}/{kind}. + # option (google.api.resource) = { + # type: "pubsub.googleapis.com/Topic" + # pattern: "projects/{project}/topics/{topic}" + # }; + # } + # + # The ResourceDescriptor Yaml config will look like: + # + # resources: + # - type: "pubsub.googleapis.com/Topic" + # pattern: "projects/{project}/topics/{topic}" + # + # Sometimes, resources have multiple patterns, typically because they can + # live under multiple parents. + # + # Example: + # + # message LogEntry { + # option (google.api.resource) = { + # type: "logging.googleapis.com/LogEntry" + # pattern: "projects/{project}/logs/{log}" + # pattern: "folders/{folder}/logs/{log}" + # pattern: "organizations/{organization}/logs/{log}" + # pattern: "billingAccounts/{billing_account}/logs/{log}" + # }; + # } + # + # The ResourceDescriptor Yaml config will look like: + # + # resources: + # - type: 'logging.googleapis.com/LogEntry' + # pattern: "projects/{project}/logs/{log}" + # pattern: "folders/{folder}/logs/{log}" + # pattern: "organizations/{organization}/logs/{log}" + # pattern: "billingAccounts/{billing_account}/logs/{log}" + # @!attribute [rw] type + # @return [::String] + # The resource type. It must be in the format of + # \\{service_name}/\\{resource_type_kind}. The `resource_type_kind` must be + # singular and must not include version numbers. + # + # Example: `storage.googleapis.com/Bucket` + # + # The value of the resource_type_kind must follow the regular expression + # /[A-Za-z][a-zA-Z0-9]+/. It should start with an upper case character and + # should use PascalCase (UpperCamelCase). The maximum number of + # characters allowed for the `resource_type_kind` is 100. + # @!attribute [rw] pattern + # @return [::Array<::String>] + # Optional. The relative resource name pattern associated with this resource + # type. The DNS prefix of the full resource name shouldn't be specified here. + # + # The path pattern must follow the syntax, which aligns with HTTP binding + # syntax: + # + # Template = Segment { "/" Segment } ; + # Segment = LITERAL | Variable ; + # Variable = "{" LITERAL "}" ; + # + # Examples: + # + # - "projects/\\{project}/topics/\\{topic}" + # - "projects/\\{project}/knowledgeBases/\\{knowledge_base}" + # + # The components in braces correspond to the IDs for each resource in the + # hierarchy. It is expected that, if multiple patterns are provided, + # the same component name (e.g. "project") refers to IDs of the same + # type of resource. + # @!attribute [rw] name_field + # @return [::String] + # Optional. The field on the resource that designates the resource name + # field. If omitted, this is assumed to be "name". + # @!attribute [rw] history + # @return [::Google::Api::ResourceDescriptor::History] + # Optional. The historical or future-looking state of the resource pattern. + # + # Example: + # + # // The InspectTemplate message originally only supported resource + # // names with organization, and project was added later. + # message InspectTemplate { + # option (google.api.resource) = { + # type: "dlp.googleapis.com/InspectTemplate" + # pattern: + # "organizations/{organization}/inspectTemplates/{inspect_template}" + # pattern: "projects/{project}/inspectTemplates/{inspect_template}" + # history: ORIGINALLY_SINGLE_PATTERN + # }; + # } + # @!attribute [rw] plural + # @return [::String] + # The plural name used in the resource name and permission names, such as + # 'projects' for the resource name of 'projects/\\{project}' and the permission + # name of 'cloudresourcemanager.googleapis.com/projects.get'. One exception + # to this is for Nested Collections that have stuttering names, as defined + # in [AIP-122](https://google.aip.dev/122#nested-collections), where the + # collection ID in the resource name pattern does not necessarily directly + # match the `plural` value. + # + # It is the same concept of the `plural` field in k8s CRD spec + # https://kubernetes.io/docs/tasks/access-kubernetes-api/custom-resources/custom-resource-definitions/ + # + # Note: The plural form is required even for singleton resources. See + # https://aip.dev/156 + # @!attribute [rw] singular + # @return [::String] + # The same concept of the `singular` field in k8s CRD spec + # https://kubernetes.io/docs/tasks/access-kubernetes-api/custom-resources/custom-resource-definitions/ + # Such as "project" for the `resourcemanager.googleapis.com/Project` type. + # @!attribute [rw] style + # @return [::Array<::Google::Api::ResourceDescriptor::Style>] + # Style flag(s) for this resource. + # These indicate that a resource is expected to conform to a given + # style. See the specific style flags for additional information. + class ResourceDescriptor + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # A description of the historical or future-looking state of the + # resource pattern. + module History + # The "unset" value. + HISTORY_UNSPECIFIED = 0 + + # The resource originally had one pattern and launched as such, and + # additional patterns were added later. + ORIGINALLY_SINGLE_PATTERN = 1 + + # The resource has one pattern, but the API owner expects to add more + # later. (This is the inverse of ORIGINALLY_SINGLE_PATTERN, and prevents + # that from being necessary once there are multiple patterns.) + FUTURE_MULTI_PATTERN = 2 + end + + # A flag representing a specific style that a resource claims to conform to. + module Style + # The unspecified value. Do not use. + STYLE_UNSPECIFIED = 0 + + # This resource is intended to be "declarative-friendly". + # + # Declarative-friendly resources must be more strictly consistent, and + # setting this to true communicates to tools that this resource should + # adhere to declarative-friendly expectations. + # + # Note: This is used by the API linter (linter.aip.dev) to enable + # additional checks. + DECLARATIVE_FRIENDLY = 1 + end + end + + # Defines a proto annotation that describes a string field that refers to + # an API resource. + # @!attribute [rw] type + # @return [::String] + # The resource type that the annotated field references. + # + # Example: + # + # message Subscription { + # string topic = 2 [(google.api.resource_reference) = { + # type: "pubsub.googleapis.com/Topic" + # }]; + # } + # + # Occasionally, a field may reference an arbitrary resource. In this case, + # APIs use the special value * in their resource reference. + # + # Example: + # + # message GetIamPolicyRequest { + # string resource = 2 [(google.api.resource_reference) = { + # type: "*" + # }]; + # } + # @!attribute [rw] child_type + # @return [::String] + # The resource type of a child collection that the annotated field + # references. This is useful for annotating the `parent` field that + # doesn't have a fixed resource type. + # + # Example: + # + # message ListLogEntriesRequest { + # string parent = 1 [(google.api.resource_reference) = { + # child_type: "logging.googleapis.com/LogEntry" + # }; + # } + class ResourceReference + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end +end diff --git a/owl-bot-staging/google-cloud-redis-v1/proto_docs/google/cloud/redis/v1/cloud_redis.rb b/owl-bot-staging/google-cloud-redis-v1/proto_docs/google/cloud/redis/v1/cloud_redis.rb new file mode 100644 index 000000000000..db24af763a85 --- /dev/null +++ b/owl-bot-staging/google-cloud-redis-v1/proto_docs/google/cloud/redis/v1/cloud_redis.rb @@ -0,0 +1,836 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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 Redis + module V1 + # Node specific properties. + # @!attribute [r] id + # @return [::String] + # Output only. Node identifying string. e.g. 'node-0', 'node-1' + # @!attribute [r] zone + # @return [::String] + # Output only. Location of the node. + class NodeInfo + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # A Memorystore for Redis instance. + # @!attribute [rw] name + # @return [::String] + # Required. Unique name of the resource in this scope including project and + # location using the form: + # `projects/{project_id}/locations/{location_id}/instances/{instance_id}` + # + # Note: Redis instances are managed and addressed at regional level so + # location_id here refers to a GCP region; however, users may choose which + # specific zone (or collection of zones for cross-zone instances) an instance + # should be provisioned in. Refer to + # {::Google::Cloud::Redis::V1::Instance#location_id location_id} and + # {::Google::Cloud::Redis::V1::Instance#alternative_location_id alternative_location_id} + # fields for more details. + # @!attribute [rw] display_name + # @return [::String] + # An arbitrary and optional user-provided name for the instance. + # @!attribute [rw] labels + # @return [::Google::Protobuf::Map{::String => ::String}] + # Resource labels to represent user provided metadata + # @!attribute [rw] location_id + # @return [::String] + # Optional. The zone where the instance will be provisioned. If not provided, + # the service will choose a zone from the specified region for the instance. + # For standard tier, additional nodes will be added across multiple zones for + # protection against zonal failures. If specified, at least one node will be + # provisioned in this zone. + # @!attribute [rw] alternative_location_id + # @return [::String] + # Optional. If specified, at least one node will be provisioned in this zone + # in addition to the zone specified in location_id. Only applicable to + # standard tier. If provided, it must be a different zone from the one + # provided in [location_id]. Additional nodes beyond the first 2 will be + # placed in zones selected by the service. + # @!attribute [rw] redis_version + # @return [::String] + # Optional. The version of Redis software. + # If not provided, latest supported version will be used. Currently, the + # supported values are: + # + # * `REDIS_3_2` for Redis 3.2 compatibility + # * `REDIS_4_0` for Redis 4.0 compatibility (default) + # * `REDIS_5_0` for Redis 5.0 compatibility + # * `REDIS_6_X` for Redis 6.x compatibility + # @!attribute [rw] reserved_ip_range + # @return [::String] + # Optional. For DIRECT_PEERING mode, the CIDR range of internal addresses + # that are reserved for this instance. Range must + # be unique and non-overlapping with existing subnets in an authorized + # network. For PRIVATE_SERVICE_ACCESS mode, the name of one allocated IP + # address ranges associated with this private service access connection. + # If not provided, the service will choose an unused /29 block, for + # example, 10.0.0.0/29 or 192.168.0.0/29. For READ_REPLICAS_ENABLED + # the default block size is /28. + # @!attribute [rw] secondary_ip_range + # @return [::String] + # Optional. Additional IP range for node placement. Required when enabling + # read replicas on an existing instance. For DIRECT_PEERING mode value must + # be a CIDR range of size /28, or "auto". For PRIVATE_SERVICE_ACCESS mode + # value must be the name of an allocated address range associated with the + # private service access connection, or "auto". + # @!attribute [r] host + # @return [::String] + # Output only. Hostname or IP address of the exposed Redis endpoint used by + # clients to connect to the service. + # @!attribute [r] port + # @return [::Integer] + # Output only. The port number of the exposed Redis endpoint. + # @!attribute [r] current_location_id + # @return [::String] + # Output only. The current zone where the Redis primary node is located. In + # basic tier, this will always be the same as [location_id]. In + # standard tier, this can be the zone of any node in the instance. + # @!attribute [r] create_time + # @return [::Google::Protobuf::Timestamp] + # Output only. The time the instance was created. + # @!attribute [r] state + # @return [::Google::Cloud::Redis::V1::Instance::State] + # Output only. The current state of this instance. + # @!attribute [r] status_message + # @return [::String] + # Output only. Additional information about the current status of this + # instance, if available. + # @!attribute [rw] redis_configs + # @return [::Google::Protobuf::Map{::String => ::String}] + # Optional. Redis configuration parameters, according to + # http://redis.io/topics/config. Currently, the only supported parameters + # are: + # + # Redis version 3.2 and newer: + # + # * maxmemory-policy + # * notify-keyspace-events + # + # Redis version 4.0 and newer: + # + # * activedefrag + # * lfu-decay-time + # * lfu-log-factor + # * maxmemory-gb + # + # Redis version 5.0 and newer: + # + # * stream-node-max-bytes + # * stream-node-max-entries + # @!attribute [rw] tier + # @return [::Google::Cloud::Redis::V1::Instance::Tier] + # Required. The service tier of the instance. + # @!attribute [rw] memory_size_gb + # @return [::Integer] + # Required. Redis memory size in GiB. + # @!attribute [rw] authorized_network + # @return [::String] + # Optional. The full name of the Google Compute Engine + # [network](https://cloud.google.com/vpc/docs/vpc) to which the + # instance is connected. If left unspecified, the `default` network + # will be used. + # @!attribute [r] persistence_iam_identity + # @return [::String] + # Output only. Cloud IAM identity used by import / export operations to + # transfer data to/from Cloud Storage. Format is + # "serviceAccount:". The value may change over time + # for a given instance so should be checked before each import/export + # operation. + # @!attribute [rw] connect_mode + # @return [::Google::Cloud::Redis::V1::Instance::ConnectMode] + # Optional. The network connect mode of the Redis instance. + # If not provided, the connect mode defaults to DIRECT_PEERING. + # @!attribute [rw] auth_enabled + # @return [::Boolean] + # Optional. Indicates whether OSS Redis AUTH is enabled for the instance. If + # set to "true" AUTH is enabled on the instance. Default value is "false" + # meaning AUTH is disabled. + # @!attribute [r] server_ca_certs + # @return [::Array<::Google::Cloud::Redis::V1::TlsCertificate>] + # Output only. List of server CA certificates for the instance. + # @!attribute [rw] transit_encryption_mode + # @return [::Google::Cloud::Redis::V1::Instance::TransitEncryptionMode] + # Optional. The TLS mode of the Redis instance. + # If not provided, TLS is disabled for the instance. + # @!attribute [rw] maintenance_policy + # @return [::Google::Cloud::Redis::V1::MaintenancePolicy] + # Optional. The maintenance policy for the instance. If not provided, + # maintenance events can be performed at any time. + # @!attribute [r] maintenance_schedule + # @return [::Google::Cloud::Redis::V1::MaintenanceSchedule] + # Output only. Date and time of upcoming maintenance events which have been + # scheduled. + # @!attribute [rw] replica_count + # @return [::Integer] + # Optional. The number of replica nodes. The valid range for the Standard + # Tier with read replicas enabled is [1-5] and defaults to 2. If read + # replicas are not enabled for a Standard Tier instance, the only valid value + # is 1 and the default is 1. The valid value for basic tier is 0 and the + # default is also 0. + # @!attribute [r] nodes + # @return [::Array<::Google::Cloud::Redis::V1::NodeInfo>] + # Output only. Info per node. + # @!attribute [r] read_endpoint + # @return [::String] + # Output only. Hostname or IP address of the exposed readonly Redis + # endpoint. Standard tier only. Targets all healthy replica nodes in + # instance. Replication is asynchronous and replica nodes will exhibit some + # lag behind the primary. Write requests must target 'host'. + # @!attribute [r] read_endpoint_port + # @return [::Integer] + # Output only. The port number of the exposed readonly redis + # endpoint. Standard tier only. Write requests should target 'port'. + # @!attribute [rw] read_replicas_mode + # @return [::Google::Cloud::Redis::V1::Instance::ReadReplicasMode] + # Optional. Read replicas mode for the instance. Defaults to + # READ_REPLICAS_DISABLED. + # @!attribute [rw] customer_managed_key + # @return [::String] + # Optional. The KMS key reference that the customer provides when trying to + # create the instance. + # @!attribute [rw] persistence_config + # @return [::Google::Cloud::Redis::V1::PersistenceConfig] + # Optional. Persistence configuration parameters + # @!attribute [rw] suspension_reasons + # @return [::Array<::Google::Cloud::Redis::V1::Instance::SuspensionReason>] + # Optional. reasons that causes instance in "SUSPENDED" state. + # @!attribute [rw] maintenance_version + # @return [::String] + # Optional. The self service update maintenance version. + # The version is date based such as "20210712_00_00". + # @!attribute [rw] available_maintenance_versions + # @return [::Array<::String>] + # Optional. The available maintenance versions that an instance could update + # to. + class Instance + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # @!attribute [rw] key + # @return [::String] + # @!attribute [rw] value + # @return [::String] + class LabelsEntry + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # @!attribute [rw] key + # @return [::String] + # @!attribute [rw] value + # @return [::String] + class RedisConfigsEntry + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Represents the different states of a Redis instance. + module State + # Not set. + STATE_UNSPECIFIED = 0 + + # Redis instance is being created. + CREATING = 1 + + # Redis instance has been created and is fully usable. + READY = 2 + + # Redis instance configuration is being updated. Certain kinds of updates + # may cause the instance to become unusable while the update is in + # progress. + UPDATING = 3 + + # Redis instance is being deleted. + DELETING = 4 + + # Redis instance is being repaired and may be unusable. + REPAIRING = 5 + + # Maintenance is being performed on this Redis instance. + MAINTENANCE = 6 + + # Redis instance is importing data (availability may be affected). + IMPORTING = 8 + + # Redis instance is failing over (availability may be affected). + FAILING_OVER = 9 + end + + # Available service tiers to choose from + module Tier + # Not set. + TIER_UNSPECIFIED = 0 + + # BASIC tier: standalone instance + BASIC = 1 + + # STANDARD_HA tier: highly available primary/replica instances + STANDARD_HA = 3 + end + + # Available connection modes. + module ConnectMode + # Not set. + CONNECT_MODE_UNSPECIFIED = 0 + + # Connect via direct peering to the Memorystore for Redis hosted service. + DIRECT_PEERING = 1 + + # Connect your Memorystore for Redis instance using Private Service + # Access. Private services access provides an IP address range for multiple + # Google Cloud services, including Memorystore. + PRIVATE_SERVICE_ACCESS = 2 + end + + # Available TLS modes. + module TransitEncryptionMode + # Not set. + TRANSIT_ENCRYPTION_MODE_UNSPECIFIED = 0 + + # Client to Server traffic encryption enabled with server authentication. + SERVER_AUTHENTICATION = 1 + + # TLS is disabled for the instance. + DISABLED = 2 + end + + # Read replicas mode. + module ReadReplicasMode + # If not set, Memorystore Redis backend will default to + # READ_REPLICAS_DISABLED. + READ_REPLICAS_MODE_UNSPECIFIED = 0 + + # If disabled, read endpoint will not be provided and the instance cannot + # scale up or down the number of replicas. + READ_REPLICAS_DISABLED = 1 + + # If enabled, read endpoint will be provided and the instance can scale + # up and down the number of replicas. Not valid for basic tier. + READ_REPLICAS_ENABLED = 2 + end + + # Possible reasons for the instance to be in a "SUSPENDED" state. + module SuspensionReason + # Not set. + SUSPENSION_REASON_UNSPECIFIED = 0 + + # Something wrong with the CMEK key provided by customer. + CUSTOMER_MANAGED_KEY_ISSUE = 1 + end + end + + # Configuration of the persistence functionality. + # @!attribute [rw] persistence_mode + # @return [::Google::Cloud::Redis::V1::PersistenceConfig::PersistenceMode] + # Optional. Controls whether Persistence features are enabled. + # If not provided, the existing value will be used. + # @!attribute [rw] rdb_snapshot_period + # @return [::Google::Cloud::Redis::V1::PersistenceConfig::SnapshotPeriod] + # Optional. Period between RDB snapshots. Snapshots will be attempted every + # period starting from the provided snapshot start time. For example, a start + # time of 01/01/2033 06:45 and SIX_HOURS snapshot period will do nothing + # until 01/01/2033, and then trigger snapshots every day at 06:45, 12:45, + # 18:45, and 00:45 the next day, and so on. If not provided, + # TWENTY_FOUR_HOURS will be used as default. + # @!attribute [r] rdb_next_snapshot_time + # @return [::Google::Protobuf::Timestamp] + # Output only. The next time that a snapshot attempt is scheduled to occur. + # @!attribute [rw] rdb_snapshot_start_time + # @return [::Google::Protobuf::Timestamp] + # Optional. Date and time that the first snapshot was/will be attempted, and + # to which future snapshots will be aligned. If not provided, the current + # time will be used. + class PersistenceConfig + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # Available Persistence modes. + module PersistenceMode + # Not set. + PERSISTENCE_MODE_UNSPECIFIED = 0 + + # Persistence is disabled for the instance, + # and any existing snapshots are deleted. + DISABLED = 1 + + # RDB based Persistence is enabled. + RDB = 2 + end + + # Available snapshot periods for scheduling. + module SnapshotPeriod + # Not set. + SNAPSHOT_PERIOD_UNSPECIFIED = 0 + + # Snapshot every 1 hour. + ONE_HOUR = 3 + + # Snapshot every 6 hours. + SIX_HOURS = 4 + + # Snapshot every 12 hours. + TWELVE_HOURS = 5 + + # Snapshot every 24 hours. + TWENTY_FOUR_HOURS = 6 + end + end + + # Request for + # {::Google::Cloud::Redis::V1::CloudRedis::Client#reschedule_maintenance RescheduleMaintenance}. + # @!attribute [rw] name + # @return [::String] + # Required. Redis instance resource name using the form: + # `projects/{project_id}/locations/{location_id}/instances/{instance_id}` + # where `location_id` refers to a GCP region. + # @!attribute [rw] reschedule_type + # @return [::Google::Cloud::Redis::V1::RescheduleMaintenanceRequest::RescheduleType] + # Required. If reschedule type is SPECIFIC_TIME, must set up schedule_time as + # well. + # @!attribute [rw] schedule_time + # @return [::Google::Protobuf::Timestamp] + # Optional. Timestamp when the maintenance shall be rescheduled to if + # reschedule_type=SPECIFIC_TIME, in RFC 3339 format, for + # example `2012-11-15T16:19:00.094Z`. + class RescheduleMaintenanceRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # Reschedule options. + module RescheduleType + # Not set. + RESCHEDULE_TYPE_UNSPECIFIED = 0 + + # If the user wants to schedule the maintenance to happen now. + IMMEDIATE = 1 + + # If the user wants to use the existing maintenance policy to find the + # next available window. + NEXT_AVAILABLE_WINDOW = 2 + + # If the user wants to reschedule the maintenance to a specific time. + SPECIFIC_TIME = 3 + end + end + + # Maintenance policy for an instance. + # @!attribute [r] create_time + # @return [::Google::Protobuf::Timestamp] + # Output only. The time when the policy was created. + # @!attribute [r] update_time + # @return [::Google::Protobuf::Timestamp] + # Output only. The time when the policy was last updated. + # @!attribute [rw] description + # @return [::String] + # Optional. Description of what this policy is for. Create/Update methods + # return INVALID_ARGUMENT if the length is greater than 512. + # @!attribute [rw] weekly_maintenance_window + # @return [::Array<::Google::Cloud::Redis::V1::WeeklyMaintenanceWindow>] + # Optional. Maintenance window that is applied to resources covered by this + # policy. Minimum 1. For the current version, the maximum number of + # weekly_window is expected to be one. + class MaintenancePolicy + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Time window in which disruptive maintenance updates occur. Non-disruptive + # updates can occur inside or outside this window. + # @!attribute [rw] day + # @return [::Google::Type::DayOfWeek] + # Required. The day of week that maintenance updates occur. + # @!attribute [rw] start_time + # @return [::Google::Type::TimeOfDay] + # Required. Start time of the window in UTC time. + # @!attribute [r] duration + # @return [::Google::Protobuf::Duration] + # Output only. Duration of the maintenance window. The current window is + # fixed at 1 hour. + class WeeklyMaintenanceWindow + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Upcoming maintenance schedule. If no maintenance is scheduled, fields are not + # populated. + # @!attribute [r] start_time + # @return [::Google::Protobuf::Timestamp] + # Output only. The start time of any upcoming scheduled maintenance for this + # instance. + # @!attribute [r] end_time + # @return [::Google::Protobuf::Timestamp] + # Output only. The end time of any upcoming scheduled maintenance for this + # instance. + # @!attribute [rw] can_reschedule + # @deprecated This field is deprecated and may be removed in the next major version update. + # @return [::Boolean] + # If the scheduled maintenance can be rescheduled, default is true. + # @!attribute [r] schedule_deadline_time + # @return [::Google::Protobuf::Timestamp] + # Output only. The deadline that the maintenance schedule start time can not + # go beyond, including reschedule. + class MaintenanceSchedule + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Request for {::Google::Cloud::Redis::V1::CloudRedis::Client#list_instances ListInstances}. + # @!attribute [rw] parent + # @return [::String] + # Required. The resource name of the instance location using the form: + # `projects/{project_id}/locations/{location_id}` + # where `location_id` refers to a GCP region. + # @!attribute [rw] page_size + # @return [::Integer] + # The maximum number of items to return. + # + # If not specified, a default value of 1000 will be used by the service. + # Regardless of the page_size value, the response may include a partial list + # and a caller should only rely on response's + # {::Google::Cloud::Redis::V1::ListInstancesResponse#next_page_token `next_page_token`} + # to determine if there are more instances left to be queried. + # @!attribute [rw] page_token + # @return [::String] + # The `next_page_token` value returned from a previous + # {::Google::Cloud::Redis::V1::CloudRedis::Client#list_instances ListInstances} request, if + # any. + class ListInstancesRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Response for {::Google::Cloud::Redis::V1::CloudRedis::Client#list_instances ListInstances}. + # @!attribute [rw] instances + # @return [::Array<::Google::Cloud::Redis::V1::Instance>] + # A list of Redis instances in the project in the specified location, + # or across all locations. + # + # If the `location_id` in the parent field of the request is "-", all regions + # available to the project are queried, and the results aggregated. + # If in such an aggregated query a location is unavailable, a placeholder + # Redis entry is included in the response with the `name` field set to a + # value of the form + # `projects/{project_id}/locations/{location_id}/instances/`- and the + # `status` field set to ERROR and `status_message` field set to "location not + # available for ListInstances". + # @!attribute [rw] next_page_token + # @return [::String] + # Token to retrieve the next page of results, or empty if there are no more + # results in the list. + # @!attribute [rw] unreachable + # @return [::Array<::String>] + # Locations that could not be reached. + class ListInstancesResponse + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Request for {::Google::Cloud::Redis::V1::CloudRedis::Client#get_instance GetInstance}. + # @!attribute [rw] name + # @return [::String] + # Required. Redis instance resource name using the form: + # `projects/{project_id}/locations/{location_id}/instances/{instance_id}` + # where `location_id` refers to a GCP region. + class GetInstanceRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Request for + # {::Google::Cloud::Redis::V1::CloudRedis::Client#get_instance_auth_string GetInstanceAuthString}. + # @!attribute [rw] name + # @return [::String] + # Required. Redis instance resource name using the form: + # `projects/{project_id}/locations/{location_id}/instances/{instance_id}` + # where `location_id` refers to a GCP region. + class GetInstanceAuthStringRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Instance AUTH string details. + # @!attribute [rw] auth_string + # @return [::String] + # AUTH string set on the instance. + class InstanceAuthString + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Request for + # {::Google::Cloud::Redis::V1::CloudRedis::Client#create_instance CreateInstance}. + # @!attribute [rw] parent + # @return [::String] + # Required. The resource name of the instance location using the form: + # `projects/{project_id}/locations/{location_id}` + # where `location_id` refers to a GCP region. + # @!attribute [rw] instance_id + # @return [::String] + # Required. The logical name of the Redis instance in the customer project + # with the following restrictions: + # + # * Must contain only lowercase letters, numbers, and hyphens. + # * Must start with a letter. + # * Must be between 1-40 characters. + # * Must end with a number or a letter. + # * Must be unique within the customer project / location + # @!attribute [rw] instance + # @return [::Google::Cloud::Redis::V1::Instance] + # Required. A Redis [Instance] resource + class CreateInstanceRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Request for + # {::Google::Cloud::Redis::V1::CloudRedis::Client#update_instance UpdateInstance}. + # @!attribute [rw] update_mask + # @return [::Google::Protobuf::FieldMask] + # Required. Mask of fields to update. At least one path must be supplied in + # this field. The elements of the repeated paths field may only include these + # fields from {::Google::Cloud::Redis::V1::Instance Instance}: + # + # * `displayName` + # * `labels` + # * `memorySizeGb` + # * `redisConfig` + # * `replica_count` + # @!attribute [rw] instance + # @return [::Google::Cloud::Redis::V1::Instance] + # Required. Update description. + # Only fields specified in update_mask are updated. + class UpdateInstanceRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Request for + # {::Google::Cloud::Redis::V1::CloudRedis::Client#upgrade_instance UpgradeInstance}. + # @!attribute [rw] name + # @return [::String] + # Required. Redis instance resource name using the form: + # `projects/{project_id}/locations/{location_id}/instances/{instance_id}` + # where `location_id` refers to a GCP region. + # @!attribute [rw] redis_version + # @return [::String] + # Required. Specifies the target version of Redis software to upgrade to. + class UpgradeInstanceRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Request for + # {::Google::Cloud::Redis::V1::CloudRedis::Client#delete_instance DeleteInstance}. + # @!attribute [rw] name + # @return [::String] + # Required. Redis instance resource name using the form: + # `projects/{project_id}/locations/{location_id}/instances/{instance_id}` + # where `location_id` refers to a GCP region. + class DeleteInstanceRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # The Cloud Storage location for the input content + # @!attribute [rw] uri + # @return [::String] + # Required. Source data URI. (e.g. 'gs://my_bucket/my_object'). + class GcsSource + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # The input content + # @!attribute [rw] gcs_source + # @return [::Google::Cloud::Redis::V1::GcsSource] + # Google Cloud Storage location where input content is located. + class InputConfig + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Request for {::Google::Cloud::Redis::V1::CloudRedis::Client#import_instance Import}. + # @!attribute [rw] name + # @return [::String] + # Required. Redis instance resource name using the form: + # `projects/{project_id}/locations/{location_id}/instances/{instance_id}` + # where `location_id` refers to a GCP region. + # @!attribute [rw] input_config + # @return [::Google::Cloud::Redis::V1::InputConfig] + # Required. Specify data to be imported. + class ImportInstanceRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # The Cloud Storage location for the output content + # @!attribute [rw] uri + # @return [::String] + # Required. Data destination URI (e.g. + # 'gs://my_bucket/my_object'). Existing files will be overwritten. + class GcsDestination + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # The output content + # @!attribute [rw] gcs_destination + # @return [::Google::Cloud::Redis::V1::GcsDestination] + # Google Cloud Storage destination for output content. + class OutputConfig + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Request for {::Google::Cloud::Redis::V1::CloudRedis::Client#export_instance Export}. + # @!attribute [rw] name + # @return [::String] + # Required. Redis instance resource name using the form: + # `projects/{project_id}/locations/{location_id}/instances/{instance_id}` + # where `location_id` refers to a GCP region. + # @!attribute [rw] output_config + # @return [::Google::Cloud::Redis::V1::OutputConfig] + # Required. Specify data to be exported. + class ExportInstanceRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Request for {::Google::Cloud::Redis::V1::CloudRedis::Client#failover_instance Failover}. + # @!attribute [rw] name + # @return [::String] + # Required. Redis instance resource name using the form: + # `projects/{project_id}/locations/{location_id}/instances/{instance_id}` + # where `location_id` refers to a GCP region. + # @!attribute [rw] data_protection_mode + # @return [::Google::Cloud::Redis::V1::FailoverInstanceRequest::DataProtectionMode] + # Optional. Available data protection modes that the user can choose. If it's + # unspecified, data protection mode will be LIMITED_DATA_LOSS by default. + class FailoverInstanceRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # Specifies different modes of operation in relation to the data retention. + module DataProtectionMode + # Defaults to LIMITED_DATA_LOSS if a data protection mode is not + # specified. + DATA_PROTECTION_MODE_UNSPECIFIED = 0 + + # Instance failover will be protected with data loss control. More + # specifically, the failover will only be performed if the current + # replication offset diff between primary and replica is under a certain + # threshold. + LIMITED_DATA_LOSS = 1 + + # Instance failover will be performed without data loss control. + FORCE_DATA_LOSS = 2 + end + end + + # Represents the v1 metadata of the long-running operation. + # @!attribute [rw] create_time + # @return [::Google::Protobuf::Timestamp] + # Creation timestamp. + # @!attribute [rw] end_time + # @return [::Google::Protobuf::Timestamp] + # End timestamp. + # @!attribute [rw] target + # @return [::String] + # Operation target. + # @!attribute [rw] verb + # @return [::String] + # Operation verb. + # @!attribute [rw] status_detail + # @return [::String] + # Operation status details. + # @!attribute [rw] cancel_requested + # @return [::Boolean] + # Specifies if cancellation was requested for the operation. + # @!attribute [rw] api_version + # @return [::String] + # API version. + class OperationMetadata + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # This location metadata represents additional configuration options for a + # given location where a Redis instance may be created. All fields are output + # only. It is returned as content of the + # `google.cloud.location.Location.metadata` field. + # @!attribute [r] available_zones + # @return [::Google::Protobuf::Map{::String => ::Google::Cloud::Redis::V1::ZoneMetadata}] + # Output only. The set of available zones in the location. The map is keyed + # by the lowercase ID of each zone, as defined by GCE. These keys can be + # specified in `location_id` or `alternative_location_id` fields when + # creating a Redis instance. + class LocationMetadata + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # @!attribute [rw] key + # @return [::String] + # @!attribute [rw] value + # @return [::Google::Cloud::Redis::V1::ZoneMetadata] + class AvailableZonesEntry + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end + + # Defines specific information for a particular zone. Currently empty and + # reserved for future use only. + class ZoneMetadata + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # TlsCertificate Resource + # @!attribute [rw] serial_number + # @return [::String] + # Serial number, as extracted from the certificate. + # @!attribute [rw] cert + # @return [::String] + # PEM representation. + # @!attribute [r] create_time + # @return [::Google::Protobuf::Timestamp] + # Output only. The time when the certificate was created in [RFC + # 3339](https://tools.ietf.org/html/rfc3339) format, for example + # `2020-05-18T00:00:00.094Z`. + # @!attribute [r] expire_time + # @return [::Google::Protobuf::Timestamp] + # Output only. The time when the certificate expires in [RFC + # 3339](https://tools.ietf.org/html/rfc3339) format, for example + # `2020-05-18T00:00:00.094Z`. + # @!attribute [rw] sha1_fingerprint + # @return [::String] + # Sha1 Fingerprint of the certificate. + class TlsCertificate + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-redis-v1/proto_docs/google/longrunning/operations.rb b/owl-bot-staging/google-cloud-redis-v1/proto_docs/google/longrunning/operations.rb new file mode 100644 index 000000000000..7a757f512165 --- /dev/null +++ b/owl-bot-staging/google-cloud-redis-v1/proto_docs/google/longrunning/operations.rb @@ -0,0 +1,191 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + + +module Google + module Longrunning + # This resource represents a long-running operation that is the result of a + # network API call. + # @!attribute [rw] name + # @return [::String] + # The server-assigned name, which is only unique within the same service that + # originally returns it. If you use the default HTTP mapping, the + # `name` should be a resource name ending with `operations/{unique_id}`. + # @!attribute [rw] metadata + # @return [::Google::Protobuf::Any] + # Service-specific metadata associated with the operation. It typically + # contains progress information and common metadata such as create time. + # Some services might not provide such metadata. Any method that returns a + # long-running operation should document the metadata type, if any. + # @!attribute [rw] done + # @return [::Boolean] + # If the value is `false`, it means the operation is still in progress. + # If `true`, the operation is completed, and either `error` or `response` is + # available. + # @!attribute [rw] error + # @return [::Google::Rpc::Status] + # The error result of the operation in case of failure or cancellation. + # + # Note: The following fields are mutually exclusive: `error`, `response`. If a field in that set is populated, all other fields in the set will automatically be cleared. + # @!attribute [rw] response + # @return [::Google::Protobuf::Any] + # The normal, successful response of the operation. If the original + # method returns no data on success, such as `Delete`, the response is + # `google.protobuf.Empty`. If the original method is standard + # `Get`/`Create`/`Update`, the response should be the resource. For other + # methods, the response should have the type `XxxResponse`, where `Xxx` + # is the original method name. For example, if the original method name + # is `TakeSnapshot()`, the inferred response type is + # `TakeSnapshotResponse`. + # + # Note: The following fields are mutually exclusive: `response`, `error`. If a field in that set is populated, all other fields in the set will automatically be cleared. + class Operation + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # The request message for + # Operations.GetOperation. + # @!attribute [rw] name + # @return [::String] + # The name of the operation resource. + class GetOperationRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # The request message for + # Operations.ListOperations. + # @!attribute [rw] name + # @return [::String] + # The name of the operation's parent resource. + # @!attribute [rw] filter + # @return [::String] + # The standard list filter. + # @!attribute [rw] page_size + # @return [::Integer] + # The standard list page size. + # @!attribute [rw] page_token + # @return [::String] + # The standard list page token. + # @!attribute [rw] return_partial_success + # @return [::Boolean] + # When set to `true`, operations that are reachable are returned as normal, + # and those that are unreachable are returned in the + # [ListOperationsResponse.unreachable] field. + # + # This can only be `true` when reading across collections e.g. when `parent` + # is set to `"projects/example/locations/-"`. + # + # This field is not by default supported and will result in an + # `UNIMPLEMENTED` error if set unless explicitly documented otherwise in + # service or product specific documentation. + class ListOperationsRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # The response message for + # Operations.ListOperations. + # @!attribute [rw] operations + # @return [::Array<::Google::Longrunning::Operation>] + # A list of operations that matches the specified filter in the request. + # @!attribute [rw] next_page_token + # @return [::String] + # The standard List next-page token. + # @!attribute [rw] unreachable + # @return [::Array<::String>] + # Unordered list. Unreachable resources. Populated when the request sets + # `ListOperationsRequest.return_partial_success` and reads across + # collections e.g. when attempting to list all resources across all supported + # locations. + class ListOperationsResponse + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # The request message for + # Operations.CancelOperation. + # @!attribute [rw] name + # @return [::String] + # The name of the operation resource to be cancelled. + class CancelOperationRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # The request message for + # Operations.DeleteOperation. + # @!attribute [rw] name + # @return [::String] + # The name of the operation resource to be deleted. + class DeleteOperationRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # The request message for + # Operations.WaitOperation. + # @!attribute [rw] name + # @return [::String] + # The name of the operation resource to wait on. + # @!attribute [rw] timeout + # @return [::Google::Protobuf::Duration] + # The maximum duration to wait before timing out. If left blank, the wait + # will be at most the time permitted by the underlying HTTP/RPC protocol. + # If RPC context deadline is also specified, the shorter one will be used. + class WaitOperationRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # A message representing the message types used by a long-running operation. + # + # Example: + # + # rpc Export(ExportRequest) returns (google.longrunning.Operation) { + # option (google.longrunning.operation_info) = { + # response_type: "ExportResponse" + # metadata_type: "ExportMetadata" + # }; + # } + # @!attribute [rw] response_type + # @return [::String] + # Required. The message name of the primary return type for this + # long-running operation. + # This type will be used to deserialize the LRO's response. + # + # If the response is in a different package from the rpc, a fully-qualified + # message name must be used (e.g. `google.protobuf.Struct`). + # + # Note: Altering this value constitutes a breaking change. + # @!attribute [rw] metadata_type + # @return [::String] + # Required. The message name of the metadata type for this long-running + # operation. + # + # If the response is in a different package from the rpc, a fully-qualified + # message name must be used (e.g. `google.protobuf.Struct`). + # + # Note: Altering this value constitutes a breaking change. + class OperationInfo + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end +end diff --git a/owl-bot-staging/google-cloud-redis-v1/proto_docs/google/protobuf/any.rb b/owl-bot-staging/google-cloud-redis-v1/proto_docs/google/protobuf/any.rb new file mode 100644 index 000000000000..58691995f02e --- /dev/null +++ b/owl-bot-staging/google-cloud-redis-v1/proto_docs/google/protobuf/any.rb @@ -0,0 +1,145 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + + +module Google + module Protobuf + # `Any` contains an arbitrary serialized protocol buffer message along with a + # URL that describes the type of the serialized message. + # + # Protobuf library provides support to pack/unpack Any values in the form + # of utility functions or additional generated methods of the Any type. + # + # Example 1: Pack and unpack a message in C++. + # + # Foo foo = ...; + # Any any; + # any.PackFrom(foo); + # ... + # if (any.UnpackTo(&foo)) { + # ... + # } + # + # Example 2: Pack and unpack a message in Java. + # + # Foo foo = ...; + # Any any = Any.pack(foo); + # ... + # if (any.is(Foo.class)) { + # foo = any.unpack(Foo.class); + # } + # // or ... + # if (any.isSameTypeAs(Foo.getDefaultInstance())) { + # foo = any.unpack(Foo.getDefaultInstance()); + # } + # + # Example 3: Pack and unpack a message in Python. + # + # foo = Foo(...) + # any = Any() + # any.Pack(foo) + # ... + # if any.Is(Foo.DESCRIPTOR): + # any.Unpack(foo) + # ... + # + # Example 4: Pack and unpack a message in Go + # + # foo := &pb.Foo{...} + # any, err := anypb.New(foo) + # if err != nil { + # ... + # } + # ... + # foo := &pb.Foo{} + # if err := any.UnmarshalTo(foo); err != nil { + # ... + # } + # + # The pack methods provided by protobuf library will by default use + # 'type.googleapis.com/full.type.name' as the type URL and the unpack + # methods only use the fully qualified type name after the last '/' + # in the type URL, for example "foo.bar.com/x/y.z" will yield type + # name "y.z". + # + # JSON + # ==== + # The JSON representation of an `Any` value uses the regular + # representation of the deserialized, embedded message, with an + # additional field `@type` which contains the type URL. Example: + # + # package google.profile; + # message Person { + # string first_name = 1; + # string last_name = 2; + # } + # + # { + # "@type": "type.googleapis.com/google.profile.Person", + # "firstName": , + # "lastName": + # } + # + # If the embedded message type is well-known and has a custom JSON + # representation, that representation will be embedded adding a field + # `value` which holds the custom JSON in addition to the `@type` + # field. Example (for message [google.protobuf.Duration][]): + # + # { + # "@type": "type.googleapis.com/google.protobuf.Duration", + # "value": "1.212s" + # } + # @!attribute [rw] type_url + # @return [::String] + # A URL/resource name that uniquely identifies the type of the serialized + # protocol buffer message. This string must contain at least + # one "/" character. The last segment of the URL's path must represent + # the fully qualified name of the type (as in + # `path/google.protobuf.Duration`). The name should be in a canonical form + # (e.g., leading "." is not accepted). + # + # In practice, teams usually precompile into the binary all types that they + # expect it to use in the context of Any. However, for URLs which use the + # scheme `http`, `https`, or no scheme, one can optionally set up a type + # server that maps type URLs to message definitions as follows: + # + # * If no scheme is provided, `https` is assumed. + # * An HTTP GET on the URL must yield a [google.protobuf.Type][] + # value in binary format, or produce an error. + # * Applications are allowed to cache lookup results based on the + # URL, or have them precompiled into a binary to avoid any + # lookup. Therefore, binary compatibility needs to be preserved + # on changes to types. (Use versioned type names to manage + # breaking changes.) + # + # Note: this functionality is not currently available in the official + # protobuf release, and it is not used for type URLs beginning with + # type.googleapis.com. As of May 2023, there are no widely used type server + # implementations and no plans to implement one. + # + # Schemes other than `http`, `https` (or the empty scheme) might be + # used with implementation specific semantics. + # @!attribute [rw] value + # @return [::String] + # Must be a valid serialized protocol buffer of the above specified type. + class Any + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end +end diff --git a/owl-bot-staging/google-cloud-redis-v1/proto_docs/google/protobuf/duration.rb b/owl-bot-staging/google-cloud-redis-v1/proto_docs/google/protobuf/duration.rb new file mode 100644 index 000000000000..ea59f1f91daf --- /dev/null +++ b/owl-bot-staging/google-cloud-redis-v1/proto_docs/google/protobuf/duration.rb @@ -0,0 +1,98 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + + +module Google + module Protobuf + # A Duration represents a signed, fixed-length span of time represented + # as a count of seconds and fractions of seconds at nanosecond + # resolution. It is independent of any calendar and concepts like "day" + # or "month". It is related to Timestamp in that the difference between + # two Timestamp values is a Duration and it can be added or subtracted + # from a Timestamp. Range is approximately +-10,000 years. + # + # # Examples + # + # Example 1: Compute Duration from two Timestamps in pseudo code. + # + # Timestamp start = ...; + # Timestamp end = ...; + # Duration duration = ...; + # + # duration.seconds = end.seconds - start.seconds; + # duration.nanos = end.nanos - start.nanos; + # + # if (duration.seconds < 0 && duration.nanos > 0) { + # duration.seconds += 1; + # duration.nanos -= 1000000000; + # } else if (duration.seconds > 0 && duration.nanos < 0) { + # duration.seconds -= 1; + # duration.nanos += 1000000000; + # } + # + # Example 2: Compute Timestamp from Timestamp + Duration in pseudo code. + # + # Timestamp start = ...; + # Duration duration = ...; + # Timestamp end = ...; + # + # end.seconds = start.seconds + duration.seconds; + # end.nanos = start.nanos + duration.nanos; + # + # if (end.nanos < 0) { + # end.seconds -= 1; + # end.nanos += 1000000000; + # } else if (end.nanos >= 1000000000) { + # end.seconds += 1; + # end.nanos -= 1000000000; + # } + # + # Example 3: Compute Duration from datetime.timedelta in Python. + # + # td = datetime.timedelta(days=3, minutes=10) + # duration = Duration() + # duration.FromTimedelta(td) + # + # # JSON Mapping + # + # In JSON format, the Duration type is encoded as a string rather than an + # object, where the string ends in the suffix "s" (indicating seconds) and + # is preceded by the number of seconds, with nanoseconds expressed as + # fractional seconds. For example, 3 seconds with 0 nanoseconds should be + # encoded in JSON format as "3s", while 3 seconds and 1 nanosecond should + # be expressed in JSON format as "3.000000001s", and 3 seconds and 1 + # microsecond should be expressed in JSON format as "3.000001s". + # @!attribute [rw] seconds + # @return [::Integer] + # Signed seconds of the span of time. Must be from -315,576,000,000 + # to +315,576,000,000 inclusive. Note: these bounds are computed from: + # 60 sec/min * 60 min/hr * 24 hr/day * 365.25 days/year * 10000 years + # @!attribute [rw] nanos + # @return [::Integer] + # Signed fractions of a second at nanosecond resolution of the span + # of time. Durations less than one second are represented with a 0 + # `seconds` field and a positive or negative `nanos` field. For durations + # of one second or more, a non-zero value for the `nanos` field must be + # of the same sign as the `seconds` field. Must be from -999,999,999 + # to +999,999,999 inclusive. + class Duration + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end +end diff --git a/owl-bot-staging/google-cloud-redis-v1/proto_docs/google/protobuf/empty.rb b/owl-bot-staging/google-cloud-redis-v1/proto_docs/google/protobuf/empty.rb new file mode 100644 index 000000000000..83e4481834a6 --- /dev/null +++ b/owl-bot-staging/google-cloud-redis-v1/proto_docs/google/protobuf/empty.rb @@ -0,0 +1,34 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + + +module Google + module Protobuf + # A generic empty message that you can re-use to avoid defining duplicated + # empty messages in your APIs. A typical example is to use it as the request + # or the response type of an API method. For instance: + # + # service Foo { + # rpc Bar(google.protobuf.Empty) returns (google.protobuf.Empty); + # } + class Empty + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end +end diff --git a/owl-bot-staging/google-cloud-redis-v1/proto_docs/google/protobuf/field_mask.rb b/owl-bot-staging/google-cloud-redis-v1/proto_docs/google/protobuf/field_mask.rb new file mode 100644 index 000000000000..7f3ffc78601a --- /dev/null +++ b/owl-bot-staging/google-cloud-redis-v1/proto_docs/google/protobuf/field_mask.rb @@ -0,0 +1,229 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + + +module Google + module Protobuf + # `FieldMask` represents a set of symbolic field paths, for example: + # + # paths: "f.a" + # paths: "f.b.d" + # + # Here `f` represents a field in some root message, `a` and `b` + # fields in the message found in `f`, and `d` a field found in the + # message in `f.b`. + # + # Field masks are used to specify a subset of fields that should be + # returned by a get operation or modified by an update operation. + # Field masks also have a custom JSON encoding (see below). + # + # # Field Masks in Projections + # + # When used in the context of a projection, a response message or + # sub-message is filtered by the API to only contain those fields as + # specified in the mask. For example, if the mask in the previous + # example is applied to a response message as follows: + # + # f { + # a : 22 + # b { + # d : 1 + # x : 2 + # } + # y : 13 + # } + # z: 8 + # + # The result will not contain specific values for fields x,y and z + # (their value will be set to the default, and omitted in proto text + # output): + # + # + # f { + # a : 22 + # b { + # d : 1 + # } + # } + # + # A repeated field is not allowed except at the last position of a + # paths string. + # + # If a FieldMask object is not present in a get operation, the + # operation applies to all fields (as if a FieldMask of all fields + # had been specified). + # + # Note that a field mask does not necessarily apply to the + # top-level response message. In case of a REST get operation, the + # field mask applies directly to the response, but in case of a REST + # list operation, the mask instead applies to each individual message + # in the returned resource list. In case of a REST custom method, + # other definitions may be used. Where the mask applies will be + # clearly documented together with its declaration in the API. In + # any case, the effect on the returned resource/resources is required + # behavior for APIs. + # + # # Field Masks in Update Operations + # + # A field mask in update operations specifies which fields of the + # targeted resource are going to be updated. The API is required + # to only change the values of the fields as specified in the mask + # and leave the others untouched. If a resource is passed in to + # describe the updated values, the API ignores the values of all + # fields not covered by the mask. + # + # If a repeated field is specified for an update operation, new values will + # be appended to the existing repeated field in the target resource. Note that + # a repeated field is only allowed in the last position of a `paths` string. + # + # If a sub-message is specified in the last position of the field mask for an + # update operation, then new value will be merged into the existing sub-message + # in the target resource. + # + # For example, given the target message: + # + # f { + # b { + # d: 1 + # x: 2 + # } + # c: [1] + # } + # + # And an update message: + # + # f { + # b { + # d: 10 + # } + # c: [2] + # } + # + # then if the field mask is: + # + # paths: ["f.b", "f.c"] + # + # then the result will be: + # + # f { + # b { + # d: 10 + # x: 2 + # } + # c: [1, 2] + # } + # + # An implementation may provide options to override this default behavior for + # repeated and message fields. + # + # In order to reset a field's value to the default, the field must + # be in the mask and set to the default value in the provided resource. + # Hence, in order to reset all fields of a resource, provide a default + # instance of the resource and set all fields in the mask, or do + # not provide a mask as described below. + # + # If a field mask is not present on update, the operation applies to + # all fields (as if a field mask of all fields has been specified). + # Note that in the presence of schema evolution, this may mean that + # fields the client does not know and has therefore not filled into + # the request will be reset to their default. If this is unwanted + # behavior, a specific service may require a client to always specify + # a field mask, producing an error if not. + # + # As with get operations, the location of the resource which + # describes the updated values in the request message depends on the + # operation kind. In any case, the effect of the field mask is + # required to be honored by the API. + # + # ## Considerations for HTTP REST + # + # The HTTP kind of an update operation which uses a field mask must + # be set to PATCH instead of PUT in order to satisfy HTTP semantics + # (PUT must only be used for full updates). + # + # # JSON Encoding of Field Masks + # + # In JSON, a field mask is encoded as a single string where paths are + # separated by a comma. Fields name in each path are converted + # to/from lower-camel naming conventions. + # + # As an example, consider the following message declarations: + # + # message Profile { + # User user = 1; + # Photo photo = 2; + # } + # message User { + # string display_name = 1; + # string address = 2; + # } + # + # In proto a field mask for `Profile` may look as such: + # + # mask { + # paths: "user.display_name" + # paths: "photo" + # } + # + # In JSON, the same mask is represented as below: + # + # { + # mask: "user.displayName,photo" + # } + # + # # Field Masks and Oneof Fields + # + # Field masks treat fields in oneofs just as regular fields. Consider the + # following message: + # + # message SampleMessage { + # oneof test_oneof { + # string name = 4; + # SubMessage sub_message = 9; + # } + # } + # + # The field mask can be: + # + # mask { + # paths: "name" + # } + # + # Or: + # + # mask { + # paths: "sub_message" + # } + # + # Note that oneof type names ("test_oneof" in this case) cannot be used in + # paths. + # + # ## Field Mask Verification + # + # The implementation of any API method which has a FieldMask type field in the + # request should verify the included field paths, and return an + # `INVALID_ARGUMENT` error if any path is unmappable. + # @!attribute [rw] paths + # @return [::Array<::String>] + # The set of field mask paths. + class FieldMask + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end +end diff --git a/owl-bot-staging/google-cloud-redis-v1/proto_docs/google/protobuf/timestamp.rb b/owl-bot-staging/google-cloud-redis-v1/proto_docs/google/protobuf/timestamp.rb new file mode 100644 index 000000000000..74352be9c58c --- /dev/null +++ b/owl-bot-staging/google-cloud-redis-v1/proto_docs/google/protobuf/timestamp.rb @@ -0,0 +1,127 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + + +module Google + module Protobuf + # A Timestamp represents a point in time independent of any time zone or local + # calendar, encoded as a count of seconds and fractions of seconds at + # nanosecond resolution. The count is relative to an epoch at UTC midnight on + # January 1, 1970, in the proleptic Gregorian calendar which extends the + # Gregorian calendar backwards to year one. + # + # All minutes are 60 seconds long. Leap seconds are "smeared" so that no leap + # second table is needed for interpretation, using a [24-hour linear + # smear](https://developers.google.com/time/smear). + # + # The range is from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59.999999999Z. By + # restricting to that range, we ensure that we can convert to and from [RFC + # 3339](https://www.ietf.org/rfc/rfc3339.txt) date strings. + # + # # Examples + # + # Example 1: Compute Timestamp from POSIX `time()`. + # + # Timestamp timestamp; + # timestamp.set_seconds(time(NULL)); + # timestamp.set_nanos(0); + # + # Example 2: Compute Timestamp from POSIX `gettimeofday()`. + # + # struct timeval tv; + # gettimeofday(&tv, NULL); + # + # Timestamp timestamp; + # timestamp.set_seconds(tv.tv_sec); + # timestamp.set_nanos(tv.tv_usec * 1000); + # + # Example 3: Compute Timestamp from Win32 `GetSystemTimeAsFileTime()`. + # + # FILETIME ft; + # GetSystemTimeAsFileTime(&ft); + # UINT64 ticks = (((UINT64)ft.dwHighDateTime) << 32) | ft.dwLowDateTime; + # + # // A Windows tick is 100 nanoseconds. Windows epoch 1601-01-01T00:00:00Z + # // is 11644473600 seconds before Unix epoch 1970-01-01T00:00:00Z. + # Timestamp timestamp; + # timestamp.set_seconds((INT64) ((ticks / 10000000) - 11644473600LL)); + # timestamp.set_nanos((INT32) ((ticks % 10000000) * 100)); + # + # Example 4: Compute Timestamp from Java `System.currentTimeMillis()`. + # + # long millis = System.currentTimeMillis(); + # + # Timestamp timestamp = Timestamp.newBuilder().setSeconds(millis / 1000) + # .setNanos((int) ((millis % 1000) * 1000000)).build(); + # + # Example 5: Compute Timestamp from Java `Instant.now()`. + # + # Instant now = Instant.now(); + # + # Timestamp timestamp = + # Timestamp.newBuilder().setSeconds(now.getEpochSecond()) + # .setNanos(now.getNano()).build(); + # + # Example 6: Compute Timestamp from current time in Python. + # + # timestamp = Timestamp() + # timestamp.GetCurrentTime() + # + # # JSON Mapping + # + # In JSON format, the Timestamp type is encoded as a string in the + # [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format. That is, the + # format is "\\{year}-\\{month}-\\{day}T\\{hour}:\\{min}:\\{sec}[.\\{frac_sec}]Z" + # where \\{year} is always expressed using four digits while \\{month}, \\{day}, + # \\{hour}, \\{min}, and \\{sec} are zero-padded to two digits each. The fractional + # seconds, which can go up to 9 digits (i.e. up to 1 nanosecond resolution), + # are optional. The "Z" suffix indicates the timezone ("UTC"); the timezone + # is required. A proto3 JSON serializer should always use UTC (as indicated by + # "Z") when printing the Timestamp type and a proto3 JSON parser should be + # able to accept both UTC and other timezones (as indicated by an offset). + # + # For example, "2017-01-15T01:30:15.01Z" encodes 15.01 seconds past + # 01:30 UTC on January 15, 2017. + # + # In JavaScript, one can convert a Date object to this format using the + # standard + # [toISOString()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toISOString) + # method. In Python, a standard `datetime.datetime` object can be converted + # to this format using + # [`strftime`](https://docs.python.org/2/library/time.html#time.strftime) with + # the time format spec '%Y-%m-%dT%H:%M:%S.%fZ'. Likewise, in Java, one can use + # the Joda Time's [`ISODateTimeFormat.dateTime()`]( + # http://joda-time.sourceforge.net/apidocs/org/joda/time/format/ISODateTimeFormat.html#dateTime() + # ) to obtain a formatter capable of generating timestamps in this format. + # @!attribute [rw] seconds + # @return [::Integer] + # Represents seconds of UTC time since Unix epoch + # 1970-01-01T00:00:00Z. Must be from 0001-01-01T00:00:00Z to + # 9999-12-31T23:59:59Z inclusive. + # @!attribute [rw] nanos + # @return [::Integer] + # Non-negative fractions of a second at nanosecond resolution. Negative + # second values with fractions must still have non-negative nanos values + # that count forward in time. Must be from 0 to 999,999,999 + # inclusive. + class Timestamp + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end +end diff --git a/owl-bot-staging/google-cloud-redis-v1/proto_docs/google/rpc/status.rb b/owl-bot-staging/google-cloud-redis-v1/proto_docs/google/rpc/status.rb new file mode 100644 index 000000000000..c1a1c07eb2db --- /dev/null +++ b/owl-bot-staging/google-cloud-redis-v1/proto_docs/google/rpc/status.rb @@ -0,0 +1,48 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + + +module Google + module Rpc + # The `Status` type defines a logical error model that is suitable for + # different programming environments, including REST APIs and RPC APIs. It is + # used by [gRPC](https://github.com/grpc). Each `Status` message contains + # three pieces of data: error code, error message, and error details. + # + # You can find out more about this error model and how to work with it in the + # [API Design Guide](https://cloud.google.com/apis/design/errors). + # @!attribute [rw] code + # @return [::Integer] + # The status code, which should be an enum value of + # [google.rpc.Code][google.rpc.Code]. + # @!attribute [rw] message + # @return [::String] + # A developer-facing error message, which should be in English. Any + # user-facing error message should be localized and sent in the + # {::Google::Rpc::Status#details google.rpc.Status.details} field, or localized + # by the client. + # @!attribute [rw] details + # @return [::Array<::Google::Protobuf::Any>] + # A list of messages that carry the error details. There is a common set of + # message types for APIs to use. + class Status + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end +end diff --git a/owl-bot-staging/google-cloud-redis-v1/proto_docs/google/type/dayofweek.rb b/owl-bot-staging/google-cloud-redis-v1/proto_docs/google/type/dayofweek.rb new file mode 100644 index 000000000000..973211b9ffe7 --- /dev/null +++ b/owl-bot-staging/google-cloud-redis-v1/proto_docs/google/type/dayofweek.rb @@ -0,0 +1,49 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + + +module Google + module Type + # Represents a day of the week. + module DayOfWeek + # The day of the week is unspecified. + DAY_OF_WEEK_UNSPECIFIED = 0 + + # Monday + MONDAY = 1 + + # Tuesday + TUESDAY = 2 + + # Wednesday + WEDNESDAY = 3 + + # Thursday + THURSDAY = 4 + + # Friday + FRIDAY = 5 + + # Saturday + SATURDAY = 6 + + # Sunday + SUNDAY = 7 + end + end +end diff --git a/owl-bot-staging/google-cloud-redis-v1/proto_docs/google/type/timeofday.rb b/owl-bot-staging/google-cloud-redis-v1/proto_docs/google/type/timeofday.rb new file mode 100644 index 000000000000..8372dad8beb8 --- /dev/null +++ b/owl-bot-staging/google-cloud-redis-v1/proto_docs/google/type/timeofday.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! + + +module Google + module Type + # Represents a time of day. The date and time zone are either not significant + # or are specified elsewhere. An API may choose to allow leap seconds. Related + # types are [google.type.Date][google.type.Date] and + # `google.protobuf.Timestamp`. + # @!attribute [rw] hours + # @return [::Integer] + # Hours of day in 24 hour format. Should be from 0 to 23. An API may choose + # to allow the value "24:00:00" for scenarios like business closing time. + # @!attribute [rw] minutes + # @return [::Integer] + # Minutes of hour of day. Must be from 0 to 59. + # @!attribute [rw] seconds + # @return [::Integer] + # Seconds of minutes of the time. Must normally be from 0 to 59. An API may + # allow the value 60 if it allows leap-seconds. + # @!attribute [rw] nanos + # @return [::Integer] + # Fractions of seconds in nanoseconds. Must be from 0 to 999,999,999. + class TimeOfDay + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end +end diff --git a/owl-bot-staging/google-cloud-redis-v1/snippets/Gemfile b/owl-bot-staging/google-cloud-redis-v1/snippets/Gemfile new file mode 100644 index 000000000000..6003ed6bc6f4 --- /dev/null +++ b/owl-bot-staging/google-cloud-redis-v1/snippets/Gemfile @@ -0,0 +1,32 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +source "https://rubygems.org" + +if ENV["GOOGLE_CLOUD_SAMPLES_TEST"] == "master" + gem "google-cloud-redis-v1", path: "../" +else + gem "google-cloud-redis-v1" +end + +group :test do + gem "google-style", "~> 1.26.1" + gem "minitest", "~> 5.16" + gem "minitest-focus", "~> 1.1" + gem "minitest-hooks", "~> 1.5" +end diff --git a/owl-bot-staging/google-cloud-redis-v1/snippets/cloud_redis/create_instance.rb b/owl-bot-staging/google-cloud-redis-v1/snippets/cloud_redis/create_instance.rb new file mode 100644 index 000000000000..a85e187c7e83 --- /dev/null +++ b/owl-bot-staging/google-cloud-redis-v1/snippets/cloud_redis/create_instance.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 redis_v1_generated_CloudRedis_CreateInstance_sync] +require "google/cloud/redis/v1" + +## +# Snippet for the create_instance call in the CloudRedis service +# +# This snippet has been automatically generated and should be regarded as a code +# template only. It will require modifications to work: +# - It may require correct/in-range values for request initialization. +# - It may require specifying regional endpoints when creating the service +# client as shown in https://cloud.google.com/ruby/docs/reference. +# +# This is an auto-generated example demonstrating basic usage of +# Google::Cloud::Redis::V1::CloudRedis::Client#create_instance. +# +def create_instance + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Redis::V1::CloudRedis::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Redis::V1::CreateInstanceRequest.new + + # Call the create_instance method. + result = client.create_instance 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 redis_v1_generated_CloudRedis_CreateInstance_sync] diff --git a/owl-bot-staging/google-cloud-redis-v1/snippets/cloud_redis/delete_instance.rb b/owl-bot-staging/google-cloud-redis-v1/snippets/cloud_redis/delete_instance.rb new file mode 100644 index 000000000000..cbb66f6761f3 --- /dev/null +++ b/owl-bot-staging/google-cloud-redis-v1/snippets/cloud_redis/delete_instance.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 redis_v1_generated_CloudRedis_DeleteInstance_sync] +require "google/cloud/redis/v1" + +## +# Snippet for the delete_instance call in the CloudRedis service +# +# This snippet has been automatically generated and should be regarded as a code +# template only. It will require modifications to work: +# - It may require correct/in-range values for request initialization. +# - It may require specifying regional endpoints when creating the service +# client as shown in https://cloud.google.com/ruby/docs/reference. +# +# This is an auto-generated example demonstrating basic usage of +# Google::Cloud::Redis::V1::CloudRedis::Client#delete_instance. +# +def delete_instance + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Redis::V1::CloudRedis::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Redis::V1::DeleteInstanceRequest.new + + # Call the delete_instance method. + result = client.delete_instance 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 redis_v1_generated_CloudRedis_DeleteInstance_sync] diff --git a/owl-bot-staging/google-cloud-redis-v1/snippets/cloud_redis/export_instance.rb b/owl-bot-staging/google-cloud-redis-v1/snippets/cloud_redis/export_instance.rb new file mode 100644 index 000000000000..3cf89998196b --- /dev/null +++ b/owl-bot-staging/google-cloud-redis-v1/snippets/cloud_redis/export_instance.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 redis_v1_generated_CloudRedis_ExportInstance_sync] +require "google/cloud/redis/v1" + +## +# Snippet for the export_instance call in the CloudRedis service +# +# This snippet has been automatically generated and should be regarded as a code +# template only. It will require modifications to work: +# - It may require correct/in-range values for request initialization. +# - It may require specifying regional endpoints when creating the service +# client as shown in https://cloud.google.com/ruby/docs/reference. +# +# This is an auto-generated example demonstrating basic usage of +# Google::Cloud::Redis::V1::CloudRedis::Client#export_instance. +# +def export_instance + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Redis::V1::CloudRedis::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Redis::V1::ExportInstanceRequest.new + + # Call the export_instance method. + result = client.export_instance 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 redis_v1_generated_CloudRedis_ExportInstance_sync] diff --git a/owl-bot-staging/google-cloud-redis-v1/snippets/cloud_redis/failover_instance.rb b/owl-bot-staging/google-cloud-redis-v1/snippets/cloud_redis/failover_instance.rb new file mode 100644 index 000000000000..613c90fa070a --- /dev/null +++ b/owl-bot-staging/google-cloud-redis-v1/snippets/cloud_redis/failover_instance.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 redis_v1_generated_CloudRedis_FailoverInstance_sync] +require "google/cloud/redis/v1" + +## +# Snippet for the failover_instance call in the CloudRedis service +# +# This snippet has been automatically generated and should be regarded as a code +# template only. It will require modifications to work: +# - It may require correct/in-range values for request initialization. +# - It may require specifying regional endpoints when creating the service +# client as shown in https://cloud.google.com/ruby/docs/reference. +# +# This is an auto-generated example demonstrating basic usage of +# Google::Cloud::Redis::V1::CloudRedis::Client#failover_instance. +# +def failover_instance + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Redis::V1::CloudRedis::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Redis::V1::FailoverInstanceRequest.new + + # Call the failover_instance method. + result = client.failover_instance 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 redis_v1_generated_CloudRedis_FailoverInstance_sync] diff --git a/owl-bot-staging/google-cloud-redis-v1/snippets/cloud_redis/get_instance.rb b/owl-bot-staging/google-cloud-redis-v1/snippets/cloud_redis/get_instance.rb new file mode 100644 index 000000000000..522711995113 --- /dev/null +++ b/owl-bot-staging/google-cloud-redis-v1/snippets/cloud_redis/get_instance.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 redis_v1_generated_CloudRedis_GetInstance_sync] +require "google/cloud/redis/v1" + +## +# Snippet for the get_instance call in the CloudRedis service +# +# This snippet has been automatically generated and should be regarded as a code +# template only. It will require modifications to work: +# - It may require correct/in-range values for request initialization. +# - It may require specifying regional endpoints when creating the service +# client as shown in https://cloud.google.com/ruby/docs/reference. +# +# This is an auto-generated example demonstrating basic usage of +# Google::Cloud::Redis::V1::CloudRedis::Client#get_instance. +# +def get_instance + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Redis::V1::CloudRedis::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Redis::V1::GetInstanceRequest.new + + # Call the get_instance method. + result = client.get_instance request + + # The returned object is of type Google::Cloud::Redis::V1::Instance. + p result +end +# [END redis_v1_generated_CloudRedis_GetInstance_sync] diff --git a/owl-bot-staging/google-cloud-redis-v1/snippets/cloud_redis/get_instance_auth_string.rb b/owl-bot-staging/google-cloud-redis-v1/snippets/cloud_redis/get_instance_auth_string.rb new file mode 100644 index 000000000000..d583817635ac --- /dev/null +++ b/owl-bot-staging/google-cloud-redis-v1/snippets/cloud_redis/get_instance_auth_string.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 redis_v1_generated_CloudRedis_GetInstanceAuthString_sync] +require "google/cloud/redis/v1" + +## +# Snippet for the get_instance_auth_string call in the CloudRedis service +# +# This snippet has been automatically generated and should be regarded as a code +# template only. It will require modifications to work: +# - It may require correct/in-range values for request initialization. +# - It may require specifying regional endpoints when creating the service +# client as shown in https://cloud.google.com/ruby/docs/reference. +# +# This is an auto-generated example demonstrating basic usage of +# Google::Cloud::Redis::V1::CloudRedis::Client#get_instance_auth_string. +# +def get_instance_auth_string + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Redis::V1::CloudRedis::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Redis::V1::GetInstanceAuthStringRequest.new + + # Call the get_instance_auth_string method. + result = client.get_instance_auth_string request + + # The returned object is of type Google::Cloud::Redis::V1::InstanceAuthString. + p result +end +# [END redis_v1_generated_CloudRedis_GetInstanceAuthString_sync] diff --git a/owl-bot-staging/google-cloud-redis-v1/snippets/cloud_redis/import_instance.rb b/owl-bot-staging/google-cloud-redis-v1/snippets/cloud_redis/import_instance.rb new file mode 100644 index 000000000000..eb9497653ab5 --- /dev/null +++ b/owl-bot-staging/google-cloud-redis-v1/snippets/cloud_redis/import_instance.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 redis_v1_generated_CloudRedis_ImportInstance_sync] +require "google/cloud/redis/v1" + +## +# Snippet for the import_instance call in the CloudRedis service +# +# This snippet has been automatically generated and should be regarded as a code +# template only. It will require modifications to work: +# - It may require correct/in-range values for request initialization. +# - It may require specifying regional endpoints when creating the service +# client as shown in https://cloud.google.com/ruby/docs/reference. +# +# This is an auto-generated example demonstrating basic usage of +# Google::Cloud::Redis::V1::CloudRedis::Client#import_instance. +# +def import_instance + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Redis::V1::CloudRedis::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Redis::V1::ImportInstanceRequest.new + + # Call the import_instance method. + result = client.import_instance 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 redis_v1_generated_CloudRedis_ImportInstance_sync] diff --git a/owl-bot-staging/google-cloud-redis-v1/snippets/cloud_redis/list_instances.rb b/owl-bot-staging/google-cloud-redis-v1/snippets/cloud_redis/list_instances.rb new file mode 100644 index 000000000000..ace5184602b9 --- /dev/null +++ b/owl-bot-staging/google-cloud-redis-v1/snippets/cloud_redis/list_instances.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 redis_v1_generated_CloudRedis_ListInstances_sync] +require "google/cloud/redis/v1" + +## +# Snippet for the list_instances call in the CloudRedis service +# +# This snippet has been automatically generated and should be regarded as a code +# template only. It will require modifications to work: +# - It may require correct/in-range values for request initialization. +# - It may require specifying regional endpoints when creating the service +# client as shown in https://cloud.google.com/ruby/docs/reference. +# +# This is an auto-generated example demonstrating basic usage of +# Google::Cloud::Redis::V1::CloudRedis::Client#list_instances. +# +def list_instances + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Redis::V1::CloudRedis::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Redis::V1::ListInstancesRequest.new + + # Call the list_instances method. + result = client.list_instances request + + # The returned object is of type Gapic::PagedEnumerable. You can iterate + # over elements, and API calls will be issued to fetch pages as needed. + result.each do |item| + # Each element is of type ::Google::Cloud::Redis::V1::Instance. + p item + end +end +# [END redis_v1_generated_CloudRedis_ListInstances_sync] diff --git a/owl-bot-staging/google-cloud-redis-v1/snippets/cloud_redis/reschedule_maintenance.rb b/owl-bot-staging/google-cloud-redis-v1/snippets/cloud_redis/reschedule_maintenance.rb new file mode 100644 index 000000000000..c101bbea499b --- /dev/null +++ b/owl-bot-staging/google-cloud-redis-v1/snippets/cloud_redis/reschedule_maintenance.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 redis_v1_generated_CloudRedis_RescheduleMaintenance_sync] +require "google/cloud/redis/v1" + +## +# Snippet for the reschedule_maintenance call in the CloudRedis service +# +# This snippet has been automatically generated and should be regarded as a code +# template only. It will require modifications to work: +# - It may require correct/in-range values for request initialization. +# - It may require specifying regional endpoints when creating the service +# client as shown in https://cloud.google.com/ruby/docs/reference. +# +# This is an auto-generated example demonstrating basic usage of +# Google::Cloud::Redis::V1::CloudRedis::Client#reschedule_maintenance. +# +def reschedule_maintenance + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Redis::V1::CloudRedis::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Redis::V1::RescheduleMaintenanceRequest.new + + # Call the reschedule_maintenance method. + result = client.reschedule_maintenance 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 redis_v1_generated_CloudRedis_RescheduleMaintenance_sync] diff --git a/owl-bot-staging/google-cloud-redis-v1/snippets/cloud_redis/update_instance.rb b/owl-bot-staging/google-cloud-redis-v1/snippets/cloud_redis/update_instance.rb new file mode 100644 index 000000000000..6021230dbaca --- /dev/null +++ b/owl-bot-staging/google-cloud-redis-v1/snippets/cloud_redis/update_instance.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 redis_v1_generated_CloudRedis_UpdateInstance_sync] +require "google/cloud/redis/v1" + +## +# Snippet for the update_instance call in the CloudRedis service +# +# This snippet has been automatically generated and should be regarded as a code +# template only. It will require modifications to work: +# - It may require correct/in-range values for request initialization. +# - It may require specifying regional endpoints when creating the service +# client as shown in https://cloud.google.com/ruby/docs/reference. +# +# This is an auto-generated example demonstrating basic usage of +# Google::Cloud::Redis::V1::CloudRedis::Client#update_instance. +# +def update_instance + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Redis::V1::CloudRedis::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Redis::V1::UpdateInstanceRequest.new + + # Call the update_instance method. + result = client.update_instance 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 redis_v1_generated_CloudRedis_UpdateInstance_sync] diff --git a/owl-bot-staging/google-cloud-redis-v1/snippets/cloud_redis/upgrade_instance.rb b/owl-bot-staging/google-cloud-redis-v1/snippets/cloud_redis/upgrade_instance.rb new file mode 100644 index 000000000000..5bb70ad81b74 --- /dev/null +++ b/owl-bot-staging/google-cloud-redis-v1/snippets/cloud_redis/upgrade_instance.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 redis_v1_generated_CloudRedis_UpgradeInstance_sync] +require "google/cloud/redis/v1" + +## +# Snippet for the upgrade_instance call in the CloudRedis service +# +# This snippet has been automatically generated and should be regarded as a code +# template only. It will require modifications to work: +# - It may require correct/in-range values for request initialization. +# - It may require specifying regional endpoints when creating the service +# client as shown in https://cloud.google.com/ruby/docs/reference. +# +# This is an auto-generated example demonstrating basic usage of +# Google::Cloud::Redis::V1::CloudRedis::Client#upgrade_instance. +# +def upgrade_instance + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Redis::V1::CloudRedis::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Redis::V1::UpgradeInstanceRequest.new + + # Call the upgrade_instance method. + result = client.upgrade_instance 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 redis_v1_generated_CloudRedis_UpgradeInstance_sync] diff --git a/owl-bot-staging/google-cloud-redis-v1/snippets/snippet_metadata_google.cloud.redis.v1.json b/owl-bot-staging/google-cloud-redis-v1/snippets/snippet_metadata_google.cloud.redis.v1.json new file mode 100644 index 000000000000..a0fbd771f85f --- /dev/null +++ b/owl-bot-staging/google-cloud-redis-v1/snippets/snippet_metadata_google.cloud.redis.v1.json @@ -0,0 +1,455 @@ +{ + "client_library": { + "name": "google-cloud-redis-v1", + "version": "", + "language": "RUBY", + "apis": [ + { + "id": "google.cloud.redis.v1", + "version": "v1" + } + ] + }, + "snippets": [ + { + "region_tag": "redis_v1_generated_CloudRedis_ListInstances_sync", + "title": "Snippet for the list_instances call in the CloudRedis service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Redis::V1::CloudRedis::Client#list_instances.", + "file": "cloud_redis/list_instances.rb", + "language": "RUBY", + "client_method": { + "short_name": "list_instances", + "full_name": "::Google::Cloud::Redis::V1::CloudRedis::Client#list_instances", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::Redis::V1::ListInstancesRequest", + "name": "request" + } + ], + "result_type": "::Google::Cloud::Redis::V1::ListInstancesResponse", + "client": { + "short_name": "CloudRedis::Client", + "full_name": "::Google::Cloud::Redis::V1::CloudRedis::Client" + }, + "method": { + "short_name": "ListInstances", + "full_name": "google.cloud.redis.v1.CloudRedis.ListInstances", + "service": { + "short_name": "CloudRedis", + "full_name": "google.cloud.redis.v1.CloudRedis" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 50, + "type": "FULL" + } + ] + }, + { + "region_tag": "redis_v1_generated_CloudRedis_GetInstance_sync", + "title": "Snippet for the get_instance call in the CloudRedis service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Redis::V1::CloudRedis::Client#get_instance.", + "file": "cloud_redis/get_instance.rb", + "language": "RUBY", + "client_method": { + "short_name": "get_instance", + "full_name": "::Google::Cloud::Redis::V1::CloudRedis::Client#get_instance", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::Redis::V1::GetInstanceRequest", + "name": "request" + } + ], + "result_type": "::Google::Cloud::Redis::V1::Instance", + "client": { + "short_name": "CloudRedis::Client", + "full_name": "::Google::Cloud::Redis::V1::CloudRedis::Client" + }, + "method": { + "short_name": "GetInstance", + "full_name": "google.cloud.redis.v1.CloudRedis.GetInstance", + "service": { + "short_name": "CloudRedis", + "full_name": "google.cloud.redis.v1.CloudRedis" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 46, + "type": "FULL" + } + ] + }, + { + "region_tag": "redis_v1_generated_CloudRedis_GetInstanceAuthString_sync", + "title": "Snippet for the get_instance_auth_string call in the CloudRedis service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Redis::V1::CloudRedis::Client#get_instance_auth_string.", + "file": "cloud_redis/get_instance_auth_string.rb", + "language": "RUBY", + "client_method": { + "short_name": "get_instance_auth_string", + "full_name": "::Google::Cloud::Redis::V1::CloudRedis::Client#get_instance_auth_string", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::Redis::V1::GetInstanceAuthStringRequest", + "name": "request" + } + ], + "result_type": "::Google::Cloud::Redis::V1::InstanceAuthString", + "client": { + "short_name": "CloudRedis::Client", + "full_name": "::Google::Cloud::Redis::V1::CloudRedis::Client" + }, + "method": { + "short_name": "GetInstanceAuthString", + "full_name": "google.cloud.redis.v1.CloudRedis.GetInstanceAuthString", + "service": { + "short_name": "CloudRedis", + "full_name": "google.cloud.redis.v1.CloudRedis" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 46, + "type": "FULL" + } + ] + }, + { + "region_tag": "redis_v1_generated_CloudRedis_CreateInstance_sync", + "title": "Snippet for the create_instance call in the CloudRedis service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Redis::V1::CloudRedis::Client#create_instance.", + "file": "cloud_redis/create_instance.rb", + "language": "RUBY", + "client_method": { + "short_name": "create_instance", + "full_name": "::Google::Cloud::Redis::V1::CloudRedis::Client#create_instance", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::Redis::V1::CreateInstanceRequest", + "name": "request" + } + ], + "result_type": "::Google::Longrunning::Operation", + "client": { + "short_name": "CloudRedis::Client", + "full_name": "::Google::Cloud::Redis::V1::CloudRedis::Client" + }, + "method": { + "short_name": "CreateInstance", + "full_name": "google.cloud.redis.v1.CloudRedis.CreateInstance", + "service": { + "short_name": "CloudRedis", + "full_name": "google.cloud.redis.v1.CloudRedis" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 53, + "type": "FULL" + } + ] + }, + { + "region_tag": "redis_v1_generated_CloudRedis_UpdateInstance_sync", + "title": "Snippet for the update_instance call in the CloudRedis service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Redis::V1::CloudRedis::Client#update_instance.", + "file": "cloud_redis/update_instance.rb", + "language": "RUBY", + "client_method": { + "short_name": "update_instance", + "full_name": "::Google::Cloud::Redis::V1::CloudRedis::Client#update_instance", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::Redis::V1::UpdateInstanceRequest", + "name": "request" + } + ], + "result_type": "::Google::Longrunning::Operation", + "client": { + "short_name": "CloudRedis::Client", + "full_name": "::Google::Cloud::Redis::V1::CloudRedis::Client" + }, + "method": { + "short_name": "UpdateInstance", + "full_name": "google.cloud.redis.v1.CloudRedis.UpdateInstance", + "service": { + "short_name": "CloudRedis", + "full_name": "google.cloud.redis.v1.CloudRedis" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 53, + "type": "FULL" + } + ] + }, + { + "region_tag": "redis_v1_generated_CloudRedis_UpgradeInstance_sync", + "title": "Snippet for the upgrade_instance call in the CloudRedis service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Redis::V1::CloudRedis::Client#upgrade_instance.", + "file": "cloud_redis/upgrade_instance.rb", + "language": "RUBY", + "client_method": { + "short_name": "upgrade_instance", + "full_name": "::Google::Cloud::Redis::V1::CloudRedis::Client#upgrade_instance", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::Redis::V1::UpgradeInstanceRequest", + "name": "request" + } + ], + "result_type": "::Google::Longrunning::Operation", + "client": { + "short_name": "CloudRedis::Client", + "full_name": "::Google::Cloud::Redis::V1::CloudRedis::Client" + }, + "method": { + "short_name": "UpgradeInstance", + "full_name": "google.cloud.redis.v1.CloudRedis.UpgradeInstance", + "service": { + "short_name": "CloudRedis", + "full_name": "google.cloud.redis.v1.CloudRedis" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 53, + "type": "FULL" + } + ] + }, + { + "region_tag": "redis_v1_generated_CloudRedis_ImportInstance_sync", + "title": "Snippet for the import_instance call in the CloudRedis service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Redis::V1::CloudRedis::Client#import_instance.", + "file": "cloud_redis/import_instance.rb", + "language": "RUBY", + "client_method": { + "short_name": "import_instance", + "full_name": "::Google::Cloud::Redis::V1::CloudRedis::Client#import_instance", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::Redis::V1::ImportInstanceRequest", + "name": "request" + } + ], + "result_type": "::Google::Longrunning::Operation", + "client": { + "short_name": "CloudRedis::Client", + "full_name": "::Google::Cloud::Redis::V1::CloudRedis::Client" + }, + "method": { + "short_name": "ImportInstance", + "full_name": "google.cloud.redis.v1.CloudRedis.ImportInstance", + "service": { + "short_name": "CloudRedis", + "full_name": "google.cloud.redis.v1.CloudRedis" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 53, + "type": "FULL" + } + ] + }, + { + "region_tag": "redis_v1_generated_CloudRedis_ExportInstance_sync", + "title": "Snippet for the export_instance call in the CloudRedis service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Redis::V1::CloudRedis::Client#export_instance.", + "file": "cloud_redis/export_instance.rb", + "language": "RUBY", + "client_method": { + "short_name": "export_instance", + "full_name": "::Google::Cloud::Redis::V1::CloudRedis::Client#export_instance", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::Redis::V1::ExportInstanceRequest", + "name": "request" + } + ], + "result_type": "::Google::Longrunning::Operation", + "client": { + "short_name": "CloudRedis::Client", + "full_name": "::Google::Cloud::Redis::V1::CloudRedis::Client" + }, + "method": { + "short_name": "ExportInstance", + "full_name": "google.cloud.redis.v1.CloudRedis.ExportInstance", + "service": { + "short_name": "CloudRedis", + "full_name": "google.cloud.redis.v1.CloudRedis" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 53, + "type": "FULL" + } + ] + }, + { + "region_tag": "redis_v1_generated_CloudRedis_FailoverInstance_sync", + "title": "Snippet for the failover_instance call in the CloudRedis service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Redis::V1::CloudRedis::Client#failover_instance.", + "file": "cloud_redis/failover_instance.rb", + "language": "RUBY", + "client_method": { + "short_name": "failover_instance", + "full_name": "::Google::Cloud::Redis::V1::CloudRedis::Client#failover_instance", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::Redis::V1::FailoverInstanceRequest", + "name": "request" + } + ], + "result_type": "::Google::Longrunning::Operation", + "client": { + "short_name": "CloudRedis::Client", + "full_name": "::Google::Cloud::Redis::V1::CloudRedis::Client" + }, + "method": { + "short_name": "FailoverInstance", + "full_name": "google.cloud.redis.v1.CloudRedis.FailoverInstance", + "service": { + "short_name": "CloudRedis", + "full_name": "google.cloud.redis.v1.CloudRedis" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 53, + "type": "FULL" + } + ] + }, + { + "region_tag": "redis_v1_generated_CloudRedis_DeleteInstance_sync", + "title": "Snippet for the delete_instance call in the CloudRedis service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Redis::V1::CloudRedis::Client#delete_instance.", + "file": "cloud_redis/delete_instance.rb", + "language": "RUBY", + "client_method": { + "short_name": "delete_instance", + "full_name": "::Google::Cloud::Redis::V1::CloudRedis::Client#delete_instance", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::Redis::V1::DeleteInstanceRequest", + "name": "request" + } + ], + "result_type": "::Google::Longrunning::Operation", + "client": { + "short_name": "CloudRedis::Client", + "full_name": "::Google::Cloud::Redis::V1::CloudRedis::Client" + }, + "method": { + "short_name": "DeleteInstance", + "full_name": "google.cloud.redis.v1.CloudRedis.DeleteInstance", + "service": { + "short_name": "CloudRedis", + "full_name": "google.cloud.redis.v1.CloudRedis" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 53, + "type": "FULL" + } + ] + }, + { + "region_tag": "redis_v1_generated_CloudRedis_RescheduleMaintenance_sync", + "title": "Snippet for the reschedule_maintenance call in the CloudRedis service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Redis::V1::CloudRedis::Client#reschedule_maintenance.", + "file": "cloud_redis/reschedule_maintenance.rb", + "language": "RUBY", + "client_method": { + "short_name": "reschedule_maintenance", + "full_name": "::Google::Cloud::Redis::V1::CloudRedis::Client#reschedule_maintenance", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::Redis::V1::RescheduleMaintenanceRequest", + "name": "request" + } + ], + "result_type": "::Google::Longrunning::Operation", + "client": { + "short_name": "CloudRedis::Client", + "full_name": "::Google::Cloud::Redis::V1::CloudRedis::Client" + }, + "method": { + "short_name": "RescheduleMaintenance", + "full_name": "google.cloud.redis.v1.CloudRedis.RescheduleMaintenance", + "service": { + "short_name": "CloudRedis", + "full_name": "google.cloud.redis.v1.CloudRedis" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 53, + "type": "FULL" + } + ] + } + ] +} \ No newline at end of file diff --git a/owl-bot-staging/google-cloud-redis-v1/test/google/cloud/redis/v1/cloud_redis_operations_test.rb b/owl-bot-staging/google-cloud-redis-v1/test/google/cloud/redis/v1/cloud_redis_operations_test.rb new file mode 100644 index 000000000000..e74aacea7a72 --- /dev/null +++ b/owl-bot-staging/google-cloud-redis-v1/test/google/cloud/redis/v1/cloud_redis_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/cloud/redis/v1/cloud_redis_pb" +require "google/cloud/redis/v1/cloud_redis_services_pb" +require "google/cloud/redis/v1/cloud_redis" + +class ::Google::Cloud::Redis::V1::CloudRedis::OperationsTest < Minitest::Test + class ClientStub + attr_accessor :call_rpc_count, :requests + + def initialize response, operation, &block + @response = response + @operation = operation + @block = block + @call_rpc_count = 0 + @requests = [] + end + + def call_rpc *args, **kwargs + @call_rpc_count += 1 + + @requests << @block&.call(*args, **kwargs) + + catch :response do + yield @response, @operation if block_given? + @response + end + end + + def endpoint + "endpoint.example.com" + end + + def universe_domain + "example.com" + end + + def stub_logger + nil + end + + def logger + nil + end + end + + def test_list_operations + # Create GRPC objects. + grpc_response = ::Google::Longrunning::ListOperationsResponse.new + grpc_operation = GRPC::ActiveCall::Operation.new nil + grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + grpc_options = {} + + # Create request parameters for a unary method. + name = "hello world" + filter = "hello world" + page_size = 42 + page_token = "hello world" + return_partial_success = true + + list_operations_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :list_operations, name + assert_kind_of ::Google::Longrunning::ListOperationsRequest, request + assert_equal "hello world", request["name"] + assert_equal "hello world", request["filter"] + assert_equal 42, request["page_size"] + assert_equal "hello world", request["page_token"] + assert_equal true, request["return_partial_success"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, list_operations_client_stub do + # Create client + client = ::Google::Cloud::Redis::V1::CloudRedis::Operations.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.list_operations({ name: name, filter: filter, page_size: page_size, page_token: page_token, return_partial_success: return_partial_success }) do |response, operation| + assert_kind_of Gapic::PagedEnumerable, response + assert_equal grpc_response, response.response + assert_equal grpc_operation, operation + end + + # Use named arguments + client.list_operations name: name, filter: filter, page_size: page_size, page_token: page_token, return_partial_success: return_partial_success do |response, operation| + assert_kind_of Gapic::PagedEnumerable, response + assert_equal grpc_response, response.response + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.list_operations ::Google::Longrunning::ListOperationsRequest.new(name: name, filter: filter, page_size: page_size, page_token: page_token, return_partial_success: return_partial_success) do |response, operation| + assert_kind_of Gapic::PagedEnumerable, response + assert_equal grpc_response, response.response + assert_equal grpc_operation, operation + end + + # Use hash object with options + client.list_operations({ name: name, filter: filter, page_size: page_size, page_token: page_token, return_partial_success: return_partial_success }, grpc_options) do |response, operation| + assert_kind_of Gapic::PagedEnumerable, response + assert_equal grpc_response, response.response + assert_equal grpc_operation, operation + end + + # Use protobuf object with options + client.list_operations(::Google::Longrunning::ListOperationsRequest.new(name: name, filter: filter, page_size: page_size, page_token: page_token, return_partial_success: return_partial_success), grpc_options) do |response, operation| + assert_kind_of Gapic::PagedEnumerable, response + assert_equal grpc_response, response.response + assert_equal grpc_operation, operation + end + + # Verify method calls + assert_equal 5, list_operations_client_stub.call_rpc_count + end + end + + def test_get_operation + # Create GRPC objects. + grpc_response = ::Google::Longrunning::Operation.new + grpc_operation = GRPC::ActiveCall::Operation.new nil + grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + grpc_options = {} + + # Create request parameters for a unary method. + name = "hello world" + + get_operation_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :get_operation, name + assert_kind_of ::Google::Longrunning::GetOperationRequest, request + assert_equal "hello world", request["name"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, get_operation_client_stub do + # Create client + client = ::Google::Cloud::Redis::V1::CloudRedis::Operations.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.get_operation({ name: name }) do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Use named arguments + client.get_operation name: name do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.get_operation ::Google::Longrunning::GetOperationRequest.new(name: name) do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Use hash object with options + client.get_operation({ name: name }, grpc_options) do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Use protobuf object with options + client.get_operation(::Google::Longrunning::GetOperationRequest.new(name: name), grpc_options) do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Verify method calls + assert_equal 5, get_operation_client_stub.call_rpc_count + end + end + + def test_delete_operation + # Create GRPC objects. + grpc_response = ::Google::Protobuf::Empty.new + grpc_operation = GRPC::ActiveCall::Operation.new nil + grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + grpc_options = {} + + # Create request parameters for a unary method. + name = "hello world" + + delete_operation_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :delete_operation, name + assert_kind_of ::Google::Longrunning::DeleteOperationRequest, request + assert_equal "hello world", request["name"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, delete_operation_client_stub do + # Create client + client = ::Google::Cloud::Redis::V1::CloudRedis::Operations.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.delete_operation({ name: name }) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use named arguments + client.delete_operation name: name do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.delete_operation ::Google::Longrunning::DeleteOperationRequest.new(name: name) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use hash object with options + client.delete_operation({ name: name }, grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object with options + client.delete_operation(::Google::Longrunning::DeleteOperationRequest.new(name: name), grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Verify method calls + assert_equal 5, delete_operation_client_stub.call_rpc_count + end + end + + def test_cancel_operation + # Create GRPC objects. + grpc_response = ::Google::Protobuf::Empty.new + grpc_operation = GRPC::ActiveCall::Operation.new nil + grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + grpc_options = {} + + # Create request parameters for a unary method. + name = "hello world" + + cancel_operation_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :cancel_operation, name + assert_kind_of ::Google::Longrunning::CancelOperationRequest, request + assert_equal "hello world", request["name"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, cancel_operation_client_stub do + # Create client + client = ::Google::Cloud::Redis::V1::CloudRedis::Operations.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.cancel_operation({ name: name }) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use named arguments + client.cancel_operation name: name do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.cancel_operation ::Google::Longrunning::CancelOperationRequest.new(name: name) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use hash object with options + client.cancel_operation({ name: name }, grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object with options + client.cancel_operation(::Google::Longrunning::CancelOperationRequest.new(name: name), grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Verify method calls + assert_equal 5, cancel_operation_client_stub.call_rpc_count + end + end + + def test_wait_operation + # Create GRPC objects. + grpc_response = ::Google::Longrunning::Operation.new + grpc_operation = GRPC::ActiveCall::Operation.new nil + grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + grpc_options = {} + + # Create request parameters for a unary method. + name = "hello world" + timeout = {} + + wait_operation_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :wait_operation, name + assert_kind_of ::Google::Longrunning::WaitOperationRequest, request + assert_equal "hello world", request["name"] + assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Protobuf::Duration), request["timeout"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, wait_operation_client_stub do + # Create client + client = ::Google::Cloud::Redis::V1::CloudRedis::Operations.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.wait_operation({ name: name, timeout: timeout }) do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Use named arguments + client.wait_operation name: name, timeout: timeout do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.wait_operation ::Google::Longrunning::WaitOperationRequest.new(name: name, timeout: timeout) do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Use hash object with options + client.wait_operation({ name: name, timeout: timeout }, grpc_options) do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Use protobuf object with options + client.wait_operation(::Google::Longrunning::WaitOperationRequest.new(name: name, timeout: timeout), grpc_options) do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Verify method calls + assert_equal 5, wait_operation_client_stub.call_rpc_count + end + end + + def test_configure + grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + + client = block_config = config = nil + dummy_stub = ClientStub.new nil, nil + Gapic::ServiceStub.stub :new, dummy_stub do + client = ::Google::Cloud::Redis::V1::CloudRedis::Operations.new do |config| + config.credentials = grpc_channel + end + end + + config = client.configure do |c| + block_config = c + end + + assert_same block_config, config + assert_kind_of ::Google::Cloud::Redis::V1::CloudRedis::Operations::Configuration, config + end +end diff --git a/owl-bot-staging/google-cloud-redis-v1/test/google/cloud/redis/v1/cloud_redis_paths_test.rb b/owl-bot-staging/google-cloud-redis-v1/test/google/cloud/redis/v1/cloud_redis_paths_test.rb new file mode 100644 index 000000000000..51a4663345d8 --- /dev/null +++ b/owl-bot-staging/google-cloud-redis-v1/test/google/cloud/redis/v1/cloud_redis_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/cloud/redis/v1/cloud_redis" + +class ::Google::Cloud::Redis::V1::CloudRedis::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_instance_path + grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + ::Gapic::ServiceStub.stub :new, DummyStub.new do + client = ::Google::Cloud::Redis::V1::CloudRedis::Client.new do |config| + config.credentials = grpc_channel + end + + path = client.instance_path project: "value0", location: "value1", instance: "value2" + assert_equal "projects/value0/locations/value1/instances/value2", path + end + end + + def test_location_path + grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + ::Gapic::ServiceStub.stub :new, DummyStub.new do + client = ::Google::Cloud::Redis::V1::CloudRedis::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 +end diff --git a/owl-bot-staging/google-cloud-redis-v1/test/google/cloud/redis/v1/cloud_redis_rest_test.rb b/owl-bot-staging/google-cloud-redis-v1/test/google/cloud/redis/v1/cloud_redis_rest_test.rb new file mode 100644 index 000000000000..913e969243e5 --- /dev/null +++ b/owl-bot-staging/google-cloud-redis-v1/test/google/cloud/redis/v1/cloud_redis_rest_test.rb @@ -0,0 +1,704 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +require "helper" +require "gapic/rest" +require "google/cloud/redis/v1/cloud_redis_pb" +require "google/cloud/redis/v1/cloud_redis/rest" + + +class ::Google::Cloud::Redis::V1::CloudRedis::Rest::ClientTest < Minitest::Test + class ClientStub + attr_accessor :call_count, :requests + + def initialize response, &block + @response = response + @block = block + @call_count = 0 + @requests = [] + end + + def make_get_request uri:, params: {}, options: {}, method_name: nil + make_http_request :get, uri: uri, body: nil, params: params, options: options, method_name: method_name + end + + def make_delete_request uri:, params: {}, options: {}, method_name: nil + make_http_request :delete, uri: uri, body: nil, params: params, options: options, method_name: method_name + end + + def make_post_request uri:, body: nil, params: {}, options: {}, method_name: nil + make_http_request :post, uri: uri, body: body, params: params, options: options, method_name: method_name + end + + def make_patch_request uri:, body:, params: {}, options: {}, method_name: nil + make_http_request :patch, uri: uri, body: body, params: params, options: options, method_name: method_name + end + + def make_put_request uri:, body:, params: {}, options: {}, method_name: nil + make_http_request :put, uri: uri, body: body, params: params, options: options, method_name: method_name + end + + def make_http_request *args, **kwargs + @call_count += 1 + + @requests << @block&.call(*args, **kwargs) + + @response + end + + def endpoint + "endpoint.example.com" + end + + def universe_domain + "example.com" + end + + def stub_logger + nil + end + + def logger + nil + end + end + + def test_list_instances + # Create test objects. + client_result = ::Google::Cloud::Redis::V1::ListInstancesResponse.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_instances_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| + assert options.metadata.key? :"x-goog-api-client" + assert options.metadata[:"x-goog-api-client"].include? "rest" + refute options.metadata[:"x-goog-api-client"].include? "grpc" + end + + ::Google::Cloud::Redis::V1::CloudRedis::Rest::ServiceStub.stub :transcode_list_instances_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, list_instances_client_stub do + # Create client + client = ::Google::Cloud::Redis::V1::CloudRedis::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.list_instances({ 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_instances 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_instances ::Google::Cloud::Redis::V1::ListInstancesRequest.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_instances({ 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_instances(::Google::Cloud::Redis::V1::ListInstancesRequest.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_instances_client_stub.call_count + end + end + end + + def test_get_instance + # Create test objects. + client_result = ::Google::Cloud::Redis::V1::Instance.new + http_response = OpenStruct.new body: client_result.to_json + + call_options = {} + + # Create request parameters for a unary method. + name = "hello world" + + get_instance_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| + assert options.metadata.key? :"x-goog-api-client" + assert options.metadata[:"x-goog-api-client"].include? "rest" + refute options.metadata[:"x-goog-api-client"].include? "grpc" + end + + ::Google::Cloud::Redis::V1::CloudRedis::Rest::ServiceStub.stub :transcode_get_instance_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, get_instance_client_stub do + # Create client + client = ::Google::Cloud::Redis::V1::CloudRedis::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.get_instance({ name: name }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.get_instance name: name do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.get_instance ::Google::Cloud::Redis::V1::GetInstanceRequest.new(name: name) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + client.get_instance({ name: name }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + client.get_instance(::Google::Cloud::Redis::V1::GetInstanceRequest.new(name: name), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, get_instance_client_stub.call_count + end + end + end + + def test_get_instance_auth_string + # Create test objects. + client_result = ::Google::Cloud::Redis::V1::InstanceAuthString.new + http_response = OpenStruct.new body: client_result.to_json + + call_options = {} + + # Create request parameters for a unary method. + name = "hello world" + + get_instance_auth_string_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| + assert options.metadata.key? :"x-goog-api-client" + assert options.metadata[:"x-goog-api-client"].include? "rest" + refute options.metadata[:"x-goog-api-client"].include? "grpc" + end + + ::Google::Cloud::Redis::V1::CloudRedis::Rest::ServiceStub.stub :transcode_get_instance_auth_string_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, get_instance_auth_string_client_stub do + # Create client + client = ::Google::Cloud::Redis::V1::CloudRedis::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.get_instance_auth_string({ name: name }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.get_instance_auth_string name: name do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.get_instance_auth_string ::Google::Cloud::Redis::V1::GetInstanceAuthStringRequest.new(name: name) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + client.get_instance_auth_string({ name: name }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + client.get_instance_auth_string(::Google::Cloud::Redis::V1::GetInstanceAuthStringRequest.new(name: name), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, get_instance_auth_string_client_stub.call_count + end + end + end + + def test_create_instance + # 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" + instance_id = "hello world" + instance = {} + + create_instance_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| + assert options.metadata.key? :"x-goog-api-client" + assert options.metadata[:"x-goog-api-client"].include? "rest" + refute options.metadata[:"x-goog-api-client"].include? "grpc" + end + + ::Google::Cloud::Redis::V1::CloudRedis::Rest::ServiceStub.stub :transcode_create_instance_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, create_instance_client_stub do + # Create client + client = ::Google::Cloud::Redis::V1::CloudRedis::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.create_instance({ parent: parent, instance_id: instance_id, instance: instance }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.create_instance parent: parent, instance_id: instance_id, instance: instance do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.create_instance ::Google::Cloud::Redis::V1::CreateInstanceRequest.new(parent: parent, instance_id: instance_id, instance: instance) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + client.create_instance({ parent: parent, instance_id: instance_id, instance: instance }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + client.create_instance(::Google::Cloud::Redis::V1::CreateInstanceRequest.new(parent: parent, instance_id: instance_id, instance: instance), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, create_instance_client_stub.call_count + end + end + end + + def test_update_instance + # 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. + update_mask = {} + instance = {} + + update_instance_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| + assert options.metadata.key? :"x-goog-api-client" + assert options.metadata[:"x-goog-api-client"].include? "rest" + refute options.metadata[:"x-goog-api-client"].include? "grpc" + end + + ::Google::Cloud::Redis::V1::CloudRedis::Rest::ServiceStub.stub :transcode_update_instance_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, update_instance_client_stub do + # Create client + client = ::Google::Cloud::Redis::V1::CloudRedis::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.update_instance({ update_mask: update_mask, instance: instance }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.update_instance update_mask: update_mask, instance: instance do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.update_instance ::Google::Cloud::Redis::V1::UpdateInstanceRequest.new(update_mask: update_mask, instance: instance) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + client.update_instance({ update_mask: update_mask, instance: instance }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + client.update_instance(::Google::Cloud::Redis::V1::UpdateInstanceRequest.new(update_mask: update_mask, instance: instance), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, update_instance_client_stub.call_count + end + end + end + + def test_upgrade_instance + # 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" + redis_version = "hello world" + + upgrade_instance_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| + assert options.metadata.key? :"x-goog-api-client" + assert options.metadata[:"x-goog-api-client"].include? "rest" + refute options.metadata[:"x-goog-api-client"].include? "grpc" + end + + ::Google::Cloud::Redis::V1::CloudRedis::Rest::ServiceStub.stub :transcode_upgrade_instance_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, upgrade_instance_client_stub do + # Create client + client = ::Google::Cloud::Redis::V1::CloudRedis::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.upgrade_instance({ name: name, redis_version: redis_version }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.upgrade_instance name: name, redis_version: redis_version do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.upgrade_instance ::Google::Cloud::Redis::V1::UpgradeInstanceRequest.new(name: name, redis_version: redis_version) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + client.upgrade_instance({ name: name, redis_version: redis_version }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + client.upgrade_instance(::Google::Cloud::Redis::V1::UpgradeInstanceRequest.new(name: name, redis_version: redis_version), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, upgrade_instance_client_stub.call_count + end + end + end + + def test_import_instance + # 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" + input_config = {} + + import_instance_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| + assert options.metadata.key? :"x-goog-api-client" + assert options.metadata[:"x-goog-api-client"].include? "rest" + refute options.metadata[:"x-goog-api-client"].include? "grpc" + end + + ::Google::Cloud::Redis::V1::CloudRedis::Rest::ServiceStub.stub :transcode_import_instance_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, import_instance_client_stub do + # Create client + client = ::Google::Cloud::Redis::V1::CloudRedis::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.import_instance({ name: name, input_config: input_config }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.import_instance name: name, input_config: input_config do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.import_instance ::Google::Cloud::Redis::V1::ImportInstanceRequest.new(name: name, input_config: input_config) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + client.import_instance({ name: name, input_config: input_config }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + client.import_instance(::Google::Cloud::Redis::V1::ImportInstanceRequest.new(name: name, input_config: input_config), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, import_instance_client_stub.call_count + end + end + end + + def test_export_instance + # 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" + output_config = {} + + export_instance_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| + assert options.metadata.key? :"x-goog-api-client" + assert options.metadata[:"x-goog-api-client"].include? "rest" + refute options.metadata[:"x-goog-api-client"].include? "grpc" + end + + ::Google::Cloud::Redis::V1::CloudRedis::Rest::ServiceStub.stub :transcode_export_instance_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, export_instance_client_stub do + # Create client + client = ::Google::Cloud::Redis::V1::CloudRedis::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.export_instance({ name: name, output_config: output_config }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.export_instance name: name, output_config: output_config do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.export_instance ::Google::Cloud::Redis::V1::ExportInstanceRequest.new(name: name, output_config: output_config) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + client.export_instance({ name: name, output_config: output_config }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + client.export_instance(::Google::Cloud::Redis::V1::ExportInstanceRequest.new(name: name, output_config: output_config), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, export_instance_client_stub.call_count + end + end + end + + def test_failover_instance + # 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" + data_protection_mode = :DATA_PROTECTION_MODE_UNSPECIFIED + + failover_instance_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| + assert options.metadata.key? :"x-goog-api-client" + assert options.metadata[:"x-goog-api-client"].include? "rest" + refute options.metadata[:"x-goog-api-client"].include? "grpc" + end + + ::Google::Cloud::Redis::V1::CloudRedis::Rest::ServiceStub.stub :transcode_failover_instance_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, failover_instance_client_stub do + # Create client + client = ::Google::Cloud::Redis::V1::CloudRedis::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.failover_instance({ name: name, data_protection_mode: data_protection_mode }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.failover_instance name: name, data_protection_mode: data_protection_mode do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.failover_instance ::Google::Cloud::Redis::V1::FailoverInstanceRequest.new(name: name, data_protection_mode: data_protection_mode) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + client.failover_instance({ name: name, data_protection_mode: data_protection_mode }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + client.failover_instance(::Google::Cloud::Redis::V1::FailoverInstanceRequest.new(name: name, data_protection_mode: data_protection_mode), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, failover_instance_client_stub.call_count + end + end + end + + def test_delete_instance + # 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" + + delete_instance_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| + assert options.metadata.key? :"x-goog-api-client" + assert options.metadata[:"x-goog-api-client"].include? "rest" + refute options.metadata[:"x-goog-api-client"].include? "grpc" + end + + ::Google::Cloud::Redis::V1::CloudRedis::Rest::ServiceStub.stub :transcode_delete_instance_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, delete_instance_client_stub do + # Create client + client = ::Google::Cloud::Redis::V1::CloudRedis::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.delete_instance({ name: name }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.delete_instance name: name do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.delete_instance ::Google::Cloud::Redis::V1::DeleteInstanceRequest.new(name: name) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + client.delete_instance({ name: name }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + client.delete_instance(::Google::Cloud::Redis::V1::DeleteInstanceRequest.new(name: name), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, delete_instance_client_stub.call_count + end + end + end + + def test_reschedule_maintenance + # 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" + reschedule_type = :RESCHEDULE_TYPE_UNSPECIFIED + schedule_time = {} + + reschedule_maintenance_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| + assert options.metadata.key? :"x-goog-api-client" + assert options.metadata[:"x-goog-api-client"].include? "rest" + refute options.metadata[:"x-goog-api-client"].include? "grpc" + end + + ::Google::Cloud::Redis::V1::CloudRedis::Rest::ServiceStub.stub :transcode_reschedule_maintenance_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, reschedule_maintenance_client_stub do + # Create client + client = ::Google::Cloud::Redis::V1::CloudRedis::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.reschedule_maintenance({ name: name, reschedule_type: reschedule_type, schedule_time: schedule_time }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.reschedule_maintenance name: name, reschedule_type: reschedule_type, schedule_time: schedule_time do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.reschedule_maintenance ::Google::Cloud::Redis::V1::RescheduleMaintenanceRequest.new(name: name, reschedule_type: reschedule_type, schedule_time: schedule_time) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + client.reschedule_maintenance({ name: name, reschedule_type: reschedule_type, schedule_time: schedule_time }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + client.reschedule_maintenance(::Google::Cloud::Redis::V1::RescheduleMaintenanceRequest.new(name: name, reschedule_type: reschedule_type, schedule_time: schedule_time), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, reschedule_maintenance_client_stub.call_count + end + end + end + + def test_configure + credentials_token = :dummy_value + + client = block_config = config = nil + dummy_stub = ClientStub.new nil + Gapic::Rest::ClientStub.stub :new, dummy_stub do + client = ::Google::Cloud::Redis::V1::CloudRedis::Rest::Client.new do |config| + config.credentials = credentials_token + end + end + + config = client.configure do |c| + block_config = c + end + + assert_same block_config, config + assert_kind_of ::Google::Cloud::Redis::V1::CloudRedis::Rest::Client::Configuration, config + end +end diff --git a/owl-bot-staging/google-cloud-redis-v1/test/google/cloud/redis/v1/cloud_redis_test.rb b/owl-bot-staging/google-cloud-redis-v1/test/google/cloud/redis/v1/cloud_redis_test.rb new file mode 100644 index 000000000000..12ec537f4770 --- /dev/null +++ b/owl-bot-staging/google-cloud-redis-v1/test/google/cloud/redis/v1/cloud_redis_test.rb @@ -0,0 +1,823 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +require "helper" + +require "gapic/grpc/service_stub" + +require "google/cloud/redis/v1/cloud_redis_pb" +require "google/cloud/redis/v1/cloud_redis" + +class ::Google::Cloud::Redis::V1::CloudRedis::ClientTest < Minitest::Test + class ClientStub + attr_accessor :call_rpc_count, :requests + + def initialize response, operation, &block + @response = response + @operation = operation + @block = block + @call_rpc_count = 0 + @requests = [] + end + + def call_rpc *args, **kwargs + @call_rpc_count += 1 + + @requests << @block&.call(*args, **kwargs) + + catch :response do + yield @response, @operation if block_given? + @response + end + end + + def endpoint + "endpoint.example.com" + end + + def universe_domain + "example.com" + end + + def stub_logger + nil + end + + def logger + nil + end + end + + def test_list_instances + # Create GRPC objects. + grpc_response = ::Google::Cloud::Redis::V1::ListInstancesResponse.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_instances_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :list_instances, name + assert_kind_of ::Google::Cloud::Redis::V1::ListInstancesRequest, 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_instances_client_stub do + # Create client + client = ::Google::Cloud::Redis::V1::CloudRedis::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.list_instances({ 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_instances 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_instances ::Google::Cloud::Redis::V1::ListInstancesRequest.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_instances({ 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_instances(::Google::Cloud::Redis::V1::ListInstancesRequest.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_instances_client_stub.call_rpc_count + end + end + + def test_get_instance + # Create GRPC objects. + grpc_response = ::Google::Cloud::Redis::V1::Instance.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_instance_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :get_instance, name + assert_kind_of ::Google::Cloud::Redis::V1::GetInstanceRequest, request + assert_equal "hello world", request["name"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, get_instance_client_stub do + # Create client + client = ::Google::Cloud::Redis::V1::CloudRedis::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.get_instance({ name: name }) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use named arguments + client.get_instance name: name do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.get_instance ::Google::Cloud::Redis::V1::GetInstanceRequest.new(name: name) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use hash object with options + client.get_instance({ 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_instance(::Google::Cloud::Redis::V1::GetInstanceRequest.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_instance_client_stub.call_rpc_count + end + end + + def test_get_instance_auth_string + # Create GRPC objects. + grpc_response = ::Google::Cloud::Redis::V1::InstanceAuthString.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_instance_auth_string_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :get_instance_auth_string, name + assert_kind_of ::Google::Cloud::Redis::V1::GetInstanceAuthStringRequest, request + assert_equal "hello world", request["name"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, get_instance_auth_string_client_stub do + # Create client + client = ::Google::Cloud::Redis::V1::CloudRedis::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.get_instance_auth_string({ name: name }) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use named arguments + client.get_instance_auth_string name: name do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.get_instance_auth_string ::Google::Cloud::Redis::V1::GetInstanceAuthStringRequest.new(name: name) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use hash object with options + client.get_instance_auth_string({ 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_instance_auth_string(::Google::Cloud::Redis::V1::GetInstanceAuthStringRequest.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_instance_auth_string_client_stub.call_rpc_count + end + end + + def test_create_instance + # 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" + instance_id = "hello world" + instance = {} + + create_instance_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :create_instance, name + assert_kind_of ::Google::Cloud::Redis::V1::CreateInstanceRequest, request + assert_equal "hello world", request["parent"] + assert_equal "hello world", request["instance_id"] + assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::Redis::V1::Instance), request["instance"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, create_instance_client_stub do + # Create client + client = ::Google::Cloud::Redis::V1::CloudRedis::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.create_instance({ parent: parent, instance_id: instance_id, instance: instance }) 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_instance parent: parent, instance_id: instance_id, instance: instance 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_instance ::Google::Cloud::Redis::V1::CreateInstanceRequest.new(parent: parent, instance_id: instance_id, instance: instance) 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_instance({ parent: parent, instance_id: instance_id, instance: instance }, 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_instance(::Google::Cloud::Redis::V1::CreateInstanceRequest.new(parent: parent, instance_id: instance_id, instance: instance), 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_instance_client_stub.call_rpc_count + end + end + + def test_update_instance + # 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. + update_mask = {} + instance = {} + + update_instance_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :update_instance, name + assert_kind_of ::Google::Cloud::Redis::V1::UpdateInstanceRequest, request + assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Protobuf::FieldMask), request["update_mask"] + assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::Redis::V1::Instance), request["instance"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, update_instance_client_stub do + # Create client + client = ::Google::Cloud::Redis::V1::CloudRedis::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.update_instance({ update_mask: update_mask, instance: instance }) 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_instance update_mask: update_mask, instance: instance 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_instance ::Google::Cloud::Redis::V1::UpdateInstanceRequest.new(update_mask: update_mask, instance: instance) 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_instance({ update_mask: update_mask, instance: instance }, 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_instance(::Google::Cloud::Redis::V1::UpdateInstanceRequest.new(update_mask: update_mask, instance: instance), 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_instance_client_stub.call_rpc_count + end + end + + def test_upgrade_instance + # 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" + redis_version = "hello world" + + upgrade_instance_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :upgrade_instance, name + assert_kind_of ::Google::Cloud::Redis::V1::UpgradeInstanceRequest, request + assert_equal "hello world", request["name"] + assert_equal "hello world", request["redis_version"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, upgrade_instance_client_stub do + # Create client + client = ::Google::Cloud::Redis::V1::CloudRedis::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.upgrade_instance({ name: name, redis_version: redis_version }) 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.upgrade_instance name: name, redis_version: redis_version 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.upgrade_instance ::Google::Cloud::Redis::V1::UpgradeInstanceRequest.new(name: name, redis_version: redis_version) 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.upgrade_instance({ name: name, redis_version: redis_version }, 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.upgrade_instance(::Google::Cloud::Redis::V1::UpgradeInstanceRequest.new(name: name, redis_version: redis_version), 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, upgrade_instance_client_stub.call_rpc_count + end + end + + def test_import_instance + # 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" + input_config = {} + + import_instance_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :import_instance, name + assert_kind_of ::Google::Cloud::Redis::V1::ImportInstanceRequest, request + assert_equal "hello world", request["name"] + assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::Redis::V1::InputConfig), request["input_config"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, import_instance_client_stub do + # Create client + client = ::Google::Cloud::Redis::V1::CloudRedis::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.import_instance({ name: name, input_config: input_config }) 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.import_instance name: name, input_config: input_config 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.import_instance ::Google::Cloud::Redis::V1::ImportInstanceRequest.new(name: name, input_config: input_config) 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.import_instance({ name: name, input_config: input_config }, 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.import_instance(::Google::Cloud::Redis::V1::ImportInstanceRequest.new(name: name, input_config: input_config), 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, import_instance_client_stub.call_rpc_count + end + end + + def test_export_instance + # 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" + output_config = {} + + export_instance_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :export_instance, name + assert_kind_of ::Google::Cloud::Redis::V1::ExportInstanceRequest, request + assert_equal "hello world", request["name"] + assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::Redis::V1::OutputConfig), request["output_config"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, export_instance_client_stub do + # Create client + client = ::Google::Cloud::Redis::V1::CloudRedis::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.export_instance({ name: name, output_config: output_config }) 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.export_instance name: name, output_config: output_config 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.export_instance ::Google::Cloud::Redis::V1::ExportInstanceRequest.new(name: name, output_config: output_config) 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.export_instance({ name: name, output_config: output_config }, 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.export_instance(::Google::Cloud::Redis::V1::ExportInstanceRequest.new(name: name, output_config: output_config), 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, export_instance_client_stub.call_rpc_count + end + end + + def test_failover_instance + # 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" + data_protection_mode = :DATA_PROTECTION_MODE_UNSPECIFIED + + failover_instance_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :failover_instance, name + assert_kind_of ::Google::Cloud::Redis::V1::FailoverInstanceRequest, request + assert_equal "hello world", request["name"] + assert_equal :DATA_PROTECTION_MODE_UNSPECIFIED, request["data_protection_mode"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, failover_instance_client_stub do + # Create client + client = ::Google::Cloud::Redis::V1::CloudRedis::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.failover_instance({ name: name, data_protection_mode: data_protection_mode }) 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.failover_instance name: name, data_protection_mode: data_protection_mode 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.failover_instance ::Google::Cloud::Redis::V1::FailoverInstanceRequest.new(name: name, data_protection_mode: data_protection_mode) 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.failover_instance({ name: name, data_protection_mode: data_protection_mode }, 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.failover_instance(::Google::Cloud::Redis::V1::FailoverInstanceRequest.new(name: name, data_protection_mode: data_protection_mode), 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, failover_instance_client_stub.call_rpc_count + end + end + + def test_delete_instance + # 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" + + delete_instance_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :delete_instance, name + assert_kind_of ::Google::Cloud::Redis::V1::DeleteInstanceRequest, request + assert_equal "hello world", request["name"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, delete_instance_client_stub do + # Create client + client = ::Google::Cloud::Redis::V1::CloudRedis::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.delete_instance({ 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.delete_instance 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.delete_instance ::Google::Cloud::Redis::V1::DeleteInstanceRequest.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.delete_instance({ 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.delete_instance(::Google::Cloud::Redis::V1::DeleteInstanceRequest.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, delete_instance_client_stub.call_rpc_count + end + end + + def test_reschedule_maintenance + # 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" + reschedule_type = :RESCHEDULE_TYPE_UNSPECIFIED + schedule_time = {} + + reschedule_maintenance_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :reschedule_maintenance, name + assert_kind_of ::Google::Cloud::Redis::V1::RescheduleMaintenanceRequest, request + assert_equal "hello world", request["name"] + assert_equal :RESCHEDULE_TYPE_UNSPECIFIED, request["reschedule_type"] + assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Protobuf::Timestamp), request["schedule_time"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, reschedule_maintenance_client_stub do + # Create client + client = ::Google::Cloud::Redis::V1::CloudRedis::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.reschedule_maintenance({ name: name, reschedule_type: reschedule_type, schedule_time: schedule_time }) 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.reschedule_maintenance name: name, reschedule_type: reschedule_type, schedule_time: schedule_time 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.reschedule_maintenance ::Google::Cloud::Redis::V1::RescheduleMaintenanceRequest.new(name: name, reschedule_type: reschedule_type, schedule_time: schedule_time) 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.reschedule_maintenance({ name: name, reschedule_type: reschedule_type, schedule_time: schedule_time }, 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.reschedule_maintenance(::Google::Cloud::Redis::V1::RescheduleMaintenanceRequest.new(name: name, reschedule_type: reschedule_type, schedule_time: schedule_time), 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, reschedule_maintenance_client_stub.call_rpc_count + end + end + + def test_configure + grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + + client = block_config = config = nil + dummy_stub = ClientStub.new nil, nil + Gapic::ServiceStub.stub :new, dummy_stub do + client = ::Google::Cloud::Redis::V1::CloudRedis::Client.new do |config| + config.credentials = grpc_channel + end + end + + config = client.configure do |c| + block_config = c + end + + assert_same block_config, config + assert_kind_of ::Google::Cloud::Redis::V1::CloudRedis::Client::Configuration, config + end + + def test_credentials + key = OpenSSL::PKey::RSA.new 2048 + cred_json = { + "private_key" => key.to_pem, + "client_email" => "app@developer.gserviceaccount.com", + "type" => "service_account" + } + key_file = StringIO.new cred_json.to_json + creds = Google::Auth::ServiceAccountCredentials.make_creds({ json_key_io: key_file }) + + dummy_stub = ClientStub.new nil, nil + Gapic::ServiceStub.stub :new, dummy_stub do + client = ::Google::Cloud::Redis::V1::CloudRedis::Client.new do |config| + config.credentials = creds + end + assert_kind_of ::Google::Cloud::Redis::V1::CloudRedis::Client, client + assert_equal creds, client.configure.credentials + end + end + + def test_operations_client + grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + + client = nil + dummy_stub = ClientStub.new nil, nil + Gapic::ServiceStub.stub :new, dummy_stub do + client = ::Google::Cloud::Redis::V1::CloudRedis::Client.new do |config| + config.credentials = grpc_channel + end + end + + assert_kind_of ::Google::Cloud::Redis::V1::CloudRedis::Operations, client.operations_client + end +end diff --git a/owl-bot-staging/google-cloud-redis-v1/test/helper.rb b/owl-bot-staging/google-cloud-redis-v1/test/helper.rb new file mode 100644 index 000000000000..672b337030e7 --- /dev/null +++ b/owl-bot-staging/google-cloud-redis-v1/test/helper.rb @@ -0,0 +1,26 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +require "minitest/autorun" +require "minitest/focus" +require "minitest/mock" +require "minitest/rg" + +require "grpc" + +require "ostruct" diff --git a/owl-bot-staging/google-cloud-redis-v1beta1/.gitignore b/owl-bot-staging/google-cloud-redis-v1beta1/.gitignore new file mode 100644 index 000000000000..0135b6bc6cfc --- /dev/null +++ b/owl-bot-staging/google-cloud-redis-v1beta1/.gitignore @@ -0,0 +1,22 @@ +# Ignore bundler lockfiles +Gemfile.lock +gems.locked + +# Ignore documentation output +doc/* +.yardoc/* + +# Ignore test output +coverage/* + +# Ignore build artifacts +pkg/* + +# Ignore files commonly present in certain dev environments +.vagrant +.DS_STORE +.idea +*.iml + +# Ignore synth output +__pycache__ diff --git a/owl-bot-staging/google-cloud-redis-v1beta1/.repo-metadata.json b/owl-bot-staging/google-cloud-redis-v1beta1/.repo-metadata.json new file mode 100644 index 000000000000..748e58fe0e26 --- /dev/null +++ b/owl-bot-staging/google-cloud-redis-v1beta1/.repo-metadata.json @@ -0,0 +1,18 @@ +{ + "api_id": "redis.googleapis.com", + "api_shortname": "redis", + "client_documentation": "https://cloud.google.com/ruby/docs/reference/google-cloud-redis-v1beta1/latest", + "distribution_name": "google-cloud-redis-v1beta1", + "is_cloud": true, + "language": "ruby", + "name": "redis", + "name_pretty": "Google Cloud Memorystore for Redis V1beta1 API", + "product_documentation": "https://cloud.google.com/memorystore/docs/redis", + "release_level": "unreleased", + "repo": "googleapis/google-cloud-ruby", + "requires_billing": true, + "ruby-cloud-description": "Creates and manages Redis instances on the Google Cloud Platform. Note that google-cloud-redis-v1beta1 is a version-specific client library. For most uses, we recommend installing the main client library google-cloud-redis instead. See the readme for more details.", + "ruby-cloud-env-prefix": "REDIS", + "ruby-cloud-product-url": "https://cloud.google.com/memorystore/docs/redis", + "library_type": "GAPIC_AUTO" +} diff --git a/owl-bot-staging/google-cloud-redis-v1beta1/.rubocop.yml b/owl-bot-staging/google-cloud-redis-v1beta1/.rubocop.yml new file mode 100644 index 000000000000..a11ddc031cc8 --- /dev/null +++ b/owl-bot-staging/google-cloud-redis-v1beta1/.rubocop.yml @@ -0,0 +1,33 @@ +inherit_gem: + google-style: google-style.yml + +AllCops: + Exclude: + - "google-cloud-redis-v1beta1.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-redis-v1beta1.rb" diff --git a/owl-bot-staging/google-cloud-redis-v1beta1/.toys.rb b/owl-bot-staging/google-cloud-redis-v1beta1/.toys.rb new file mode 100644 index 000000000000..177e22456e8a --- /dev/null +++ b/owl-bot-staging/google-cloud-redis-v1beta1/.toys.rb @@ -0,0 +1,28 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +toys_version! ">= 0.15.3" + +if ENV["RUBY_COMMON_TOOLS"] + common_tools_dir = File.expand_path ENV["RUBY_COMMON_TOOLS"] + load File.join(common_tools_dir, "toys", "gapic") +else + load_git remote: "https://github.com/googleapis/ruby-common-tools.git", + path: "toys/gapic", + update: true +end diff --git a/owl-bot-staging/google-cloud-redis-v1beta1/.yardopts b/owl-bot-staging/google-cloud-redis-v1beta1/.yardopts new file mode 100644 index 000000000000..a0c18cb6bf60 --- /dev/null +++ b/owl-bot-staging/google-cloud-redis-v1beta1/.yardopts @@ -0,0 +1,12 @@ +--no-private +--title="Google Cloud Memorystore for Redis V1beta1 API" +--exclude _pb\.rb$ +--markup markdown +--markup-provider redcarpet + +./lib/**/*.rb +./proto_docs/**/*.rb +- +README.md +LICENSE.md +AUTHENTICATION.md diff --git a/owl-bot-staging/google-cloud-redis-v1beta1/AUTHENTICATION.md b/owl-bot-staging/google-cloud-redis-v1beta1/AUTHENTICATION.md new file mode 100644 index 000000000000..24935776f1eb --- /dev/null +++ b/owl-bot-staging/google-cloud-redis-v1beta1/AUTHENTICATION.md @@ -0,0 +1,122 @@ +# Authentication + +The recommended way to authenticate to the google-cloud-redis-v1beta1 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-redis-v1beta1 library provides several mechanisms to configure your system. +Generally, using Application Default Credentials to facilitate automatic +credentials discovery is the easist method. But if you need to explicitly specify +credentials, there are several methods available to you. + +Credentials are accepted in the following ways, in the following order or precedence: + +1. Credentials specified in method arguments +2. Credentials specified in configuration +3. Credentials pointed to or included in environment variables +4. Credentials found in local ADC file +5. Credentials returned by the metadata server for the attached service account (GCP) + +### Configuration + +You can configure a path to a JSON credentials file, either for an individual client object or +globally, for all client objects. The JSON file can contain credentials created for +[workload identity federation](https://cloud.google.com/iam/docs/workload-identity-federation), +[workforce identity federation](https://cloud.google.com/iam/docs/workforce-identity-federation), or a +[service account key](https://cloud.google.com/docs/authentication/provide-credentials-adc#local-key). + +Note: Service account keys are a security risk if not managed correctly. You should +[choose a more secure alternative to service account keys](https://cloud.google.com/docs/authentication#auth-decision-tree) +whenever possible. + +To configure a credentials file for an individual client initialization: + +```ruby +require "google/cloud/redis/v1beta1" + +client = ::Google::Cloud::Redis::V1beta1::CloudRedis::Client.new do |config| + config.credentials = "path/to/credentialfile.json" +end +``` + +To configure a credentials file globally for all clients: + +```ruby +require "google/cloud/redis/v1beta1" + +::Google::Cloud::Redis::V1beta1::CloudRedis::Client.configure do |config| + config.credentials = "path/to/credentialfile.json" +end + +client = ::Google::Cloud::Redis::V1beta1::CloudRedis::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-redis-v1beta1 +checks for credentials are: + +* `GOOGLE_CLOUD_CREDENTIALS` - Path to JSON file, or JSON contents +* `GOOGLE_APPLICATION_CREDENTIALS` - Path to JSON file + +```ruby +require "google/cloud/redis/v1beta1" + +ENV["GOOGLE_APPLICATION_CREDENTIALS"] = "path/to/credentialfile.json" + +client = ::Google::Cloud::Redis::V1beta1::CloudRedis::Client.new +``` + +### Local ADC file + +You can set up a local ADC file with your user credentials for authentication during +development. If credentials are not provided in code or in environment variables, +then the local ADC credentials are discovered. + +Follow the steps in [Quickstart](#quickstart) to set up a local ADC file. + +### Google Cloud Platform environments + +When running on Google Cloud Platform (GCP), including Google Compute Engine +(GCE), Google Kubernetes Engine (GKE), Google App Engine (GAE), Google Cloud +Functions (GCF) and Cloud Run, credentials are retrieved from the attached +service account automatically. Code should be written as if already authenticated. + +For more information, see +[Set up ADC for Google Cloud services](https://cloud.google.com/docs/authentication/provide-credentials-adc#attached-sa). diff --git a/owl-bot-staging/google-cloud-redis-v1beta1/CHANGELOG.md b/owl-bot-staging/google-cloud-redis-v1beta1/CHANGELOG.md new file mode 100644 index 000000000000..f88957a62ba2 --- /dev/null +++ b/owl-bot-staging/google-cloud-redis-v1beta1/CHANGELOG.md @@ -0,0 +1,2 @@ +# Release History + diff --git a/owl-bot-staging/google-cloud-redis-v1beta1/Gemfile b/owl-bot-staging/google-cloud-redis-v1beta1/Gemfile new file mode 100644 index 000000000000..1d08558908d8 --- /dev/null +++ b/owl-bot-staging/google-cloud-redis-v1beta1/Gemfile @@ -0,0 +1,14 @@ +source "https://rubygems.org" + +gemspec + +gem "google-style", "~> 1.32.0" +gem "irb", "~> 1.17" +gem "minitest", "~> 6.0.2" +gem "minitest-focus", "~> 1.4" +gem "minitest-mock", "~> 5.27" +gem "minitest-rg", "~> 5.3" +gem "ostruct", "~> 0.5.5" +gem "rake", ">= 13.0" +gem "redcarpet", "~> 3.6" +gem "yard", "~> 0.9" diff --git a/owl-bot-staging/google-cloud-redis-v1beta1/LICENSE.md b/owl-bot-staging/google-cloud-redis-v1beta1/LICENSE.md new file mode 100644 index 000000000000..c261857ba6ad --- /dev/null +++ b/owl-bot-staging/google-cloud-redis-v1beta1/LICENSE.md @@ -0,0 +1,201 @@ + Apache License + Version 2.0, January 2004 + http://www.apache.org/licenses/ + + TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION + + 1. Definitions. + + "License" shall mean the terms and conditions for use, reproduction, + and distribution as defined by Sections 1 through 9 of this document. + + "Licensor" shall mean the copyright owner or entity authorized by + the copyright owner that is granting the License. + + "Legal Entity" shall mean the union of the acting entity and all + other entities that control, are controlled by, or are under common + control with that entity. For the purposes of this definition, + "control" means (i) the power, direct or indirect, to cause the + direction or management of such entity, whether by contract or + otherwise, or (ii) ownership of fifty percent (50%) or more of the + outstanding shares, or (iii) beneficial ownership of such entity. + + "You" (or "Your") shall mean an individual or Legal Entity + exercising permissions granted by this License. + + "Source" form shall mean the preferred form for making modifications, + including but not limited to software source code, documentation + source, and configuration files. + + "Object" form shall mean any form resulting from mechanical + transformation or translation of a Source form, including but + not limited to compiled object code, generated documentation, + and conversions to other media types. + + "Work" shall mean the work of authorship, whether in Source or + Object form, made available under the License, as indicated by a + copyright notice that is included in or attached to the work + (an example is provided in the Appendix below). + + "Derivative Works" shall mean any work, whether in Source or Object + form, that is based on (or derived from) the Work and for which the + editorial revisions, annotations, elaborations, or other modifications + represent, as a whole, an original work of authorship. For the purposes + of this License, Derivative Works shall not include works that remain + separable from, or merely link (or bind by name) to the interfaces of, + the Work and Derivative Works thereof. + + "Contribution" shall mean any work of authorship, including + the original version of the Work and any modifications or additions + to that Work or Derivative Works thereof, that is intentionally + submitted to Licensor for inclusion in the Work by the copyright owner + or by an individual or Legal Entity authorized to submit on behalf of + the copyright owner. For the purposes of this definition, "submitted" + means any form of electronic, verbal, or written communication sent + to the Licensor or its representatives, including but not limited to + communication on electronic mailing lists, source code control systems, + and issue tracking systems that are managed by, or on behalf of, the + Licensor for the purpose of discussing and improving the Work, but + excluding communication that is conspicuously marked or otherwise + designated in writing by the copyright owner as "Not a Contribution." + + "Contributor" shall mean Licensor and any individual or Legal Entity + on behalf of whom a Contribution has been received by Licensor and + subsequently incorporated within the Work. + + 2. Grant of Copyright License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + copyright license to reproduce, prepare Derivative Works of, + publicly display, publicly perform, sublicense, and distribute the + Work and such Derivative Works in Source or Object form. + + 3. Grant of Patent License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + (except as stated in this section) patent license to make, have made, + use, offer to sell, sell, import, and otherwise transfer the Work, + where such license applies only to those patent claims licensable + by such Contributor that are necessarily infringed by their + Contribution(s) alone or by combination of their Contribution(s) + with the Work to which such Contribution(s) was submitted. If You + institute patent litigation against any entity (including a + cross-claim or counterclaim in a lawsuit) alleging that the Work + or a Contribution incorporated within the Work constitutes direct + or contributory patent infringement, then any patent licenses + granted to You under this License for that Work shall terminate + as of the date such litigation is filed. + + 4. Redistribution. You may reproduce and distribute copies of the + Work or Derivative Works thereof in any medium, with or without + modifications, and in Source or Object form, provided that You + meet the following conditions: + + (a) You must give any other recipients of the Work or + Derivative Works a copy of this License; and + + (b) You must cause any modified files to carry prominent notices + stating that You changed the files; and + + (c) You must retain, in the Source form of any Derivative Works + that You distribute, all copyright, patent, trademark, and + attribution notices from the Source form of the Work, + excluding those notices that do not pertain to any part of + the Derivative Works; and + + (d) If the Work includes a "NOTICE" text file as part of its + distribution, then any Derivative Works that You distribute must + include a readable copy of the attribution notices contained + within such NOTICE file, excluding those notices that do not + pertain to any part of the Derivative Works, in at least one + of the following places: within a NOTICE text file distributed + as part of the Derivative Works; within the Source form or + documentation, if provided along with the Derivative Works; or, + within a display generated by the Derivative Works, if and + wherever such third-party notices normally appear. The contents + of the NOTICE file are for informational purposes only and + do not modify the License. You may add Your own attribution + notices within Derivative Works that You distribute, alongside + or as an addendum to the NOTICE text from the Work, provided + that such additional attribution notices cannot be construed + as modifying the License. + + You may add Your own copyright statement to Your modifications and + may provide additional or different license terms and conditions + for use, reproduction, or distribution of Your modifications, or + for any such Derivative Works as a whole, provided Your use, + reproduction, and distribution of the Work otherwise complies with + the conditions stated in this License. + + 5. Submission of Contributions. Unless You explicitly state otherwise, + any Contribution intentionally submitted for inclusion in the Work + by You to the Licensor shall be under the terms and conditions of + this License, without any additional terms or conditions. + Notwithstanding the above, nothing herein shall supersede or modify + the terms of any separate license agreement you may have executed + with Licensor regarding such Contributions. + + 6. Trademarks. This License does not grant permission to use the trade + names, trademarks, service marks, or product names of the Licensor, + except as required for reasonable and customary use in describing the + origin of the Work and reproducing the content of the NOTICE file. + + 7. Disclaimer of Warranty. Unless required by applicable law or + agreed to in writing, Licensor provides the Work (and each + Contributor provides its Contributions) on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or + implied, including, without limitation, any warranties or conditions + of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A + PARTICULAR PURPOSE. You are solely responsible for determining the + appropriateness of using or redistributing the Work and assume any + risks associated with Your exercise of permissions under this License. + + 8. Limitation of Liability. In no event and under no legal theory, + whether in tort (including negligence), contract, or otherwise, + unless required by applicable law (such as deliberate and grossly + negligent acts) or agreed to in writing, shall any Contributor be + liable to You for damages, including any direct, indirect, special, + incidental, or consequential damages of any character arising as a + result of this License or out of the use or inability to use the + Work (including but not limited to damages for loss of goodwill, + work stoppage, computer failure or malfunction, or any and all + other commercial damages or losses), even if such Contributor + has been advised of the possibility of such damages. + + 9. Accepting Warranty or Additional Liability. While redistributing + the Work or Derivative Works thereof, You may choose to offer, + and charge a fee for, acceptance of support, warranty, indemnity, + or other liability obligations and/or rights consistent with this + License. However, in accepting such obligations, You may act only + on Your own behalf and on Your sole responsibility, not on behalf + of any other Contributor, and only if You agree to indemnify, + defend, and hold each Contributor harmless for any liability + incurred by, or claims asserted against, such Contributor by reason + of your accepting any such warranty or additional liability. + + END OF TERMS AND CONDITIONS + + APPENDIX: How to apply the Apache License to your work. + + To apply the Apache License to your work, attach the following + boilerplate notice, with the fields enclosed by brackets "[]" + replaced with your own identifying information. (Don't include + the brackets!) The text should be enclosed in the appropriate + comment syntax for the file format. We also recommend that a + file or class name and description of purpose be included on the + same "printed page" as the copyright notice for easier + identification within third-party archives. + + Copyright [yyyy] [name of copyright owner] + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. diff --git a/owl-bot-staging/google-cloud-redis-v1beta1/README.md b/owl-bot-staging/google-cloud-redis-v1beta1/README.md new file mode 100644 index 000000000000..f99e2871ca0c --- /dev/null +++ b/owl-bot-staging/google-cloud-redis-v1beta1/README.md @@ -0,0 +1,153 @@ +# Ruby Client for the Google Cloud Memorystore for Redis V1beta1 API + +Creates and manages Redis instances on the Google Cloud Platform. + + +https://github.com/googleapis/google-cloud-ruby + +This gem is a _versioned_ client. It provides basic client classes for a +specific version of the Google Cloud Memorystore for Redis V1beta1 API. Most users should consider using +the main client gem, +[google-cloud-redis](https://rubygems.org/gems/google-cloud-redis). +See the section below titled *Which client should I use?* for more information. + +## Installation + +``` +$ gem install google-cloud-redis-v1beta1 +``` + +## 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/redis.googleapis.com) +1. [Set up authentication.](AUTHENTICATION.md) + +## Quick Start + +```ruby +require "google/cloud/redis/v1beta1" + +client = ::Google::Cloud::Redis::V1beta1::CloudRedis::Client.new +request = ::Google::Cloud::Redis::V1beta1::ListInstancesRequest.new # (request fields as keyword arguments...) +response = client.list_instances request +``` + +View the [Client Library Documentation](https://cloud.google.com/ruby/docs/reference/google-cloud-redis-v1beta1/latest) +for class and method documentation. + +See also the [Product Documentation](https://cloud.google.com/memorystore/docs/redis) +for general usage information. + +## Debug Logging + +This library comes with opt-in Debug Logging that can help you troubleshoot +your application's integration with the API. When logging is activated, key +events such as requests and responses, along with data payloads and metadata +such as headers and client configuration, are logged to the standard error +stream. + +**WARNING:** Client Library Debug Logging includes your data payloads in +plaintext, which could include sensitive data such as PII for yourself or your +customers, private keys, or other security data that could be compromising if +leaked. Always practice good data hygiene with your application logs, and follow +the principle of least access. Google also recommends that Client Library Debug +Logging be enabled only temporarily during active debugging, and not used +permanently in production. + +To enable logging, set the environment variable `GOOGLE_SDK_RUBY_LOGGING_GEMS` +to the value `all`. Alternatively, you can set the value to a comma-delimited +list of client library gem names. This will select the default logging behavior, +which writes logs to the standard error stream. On a local workstation, this may +result in logs appearing on the console. When running on a Google Cloud hosting +service such as [Google Cloud Run](https://cloud.google.com/run), this generally +results in logs appearing alongside your application logs in the +[Google Cloud Logging](https://cloud.google.com/logging/) service. + +You can customize logging by modifying the `logger` configuration when +constructing a client object. For example: + +```ruby +require "google/cloud/redis/v1beta1" +require "logger" + +client = ::Google::Cloud::Redis::V1beta1::CloudRedis::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-redis`, +and lower-level _versioned_ client libraries with names such as +`google-cloud-redis-v1beta1`. +_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-redis`. +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-redis-v1beta1`. + +### What about the google-apis- clients? + +Client library gems with names that begin with `google-apis-` are based on an +older code generation technology. They talk to a REST/JSON backend (whereas +most modern clients talk to a [gRPC](https://grpc.io/) backend) and they may +not offer the same performance, features, and ease of use provided by more +modern clients. + +The `google-apis-` clients have wide coverage across Google services, so you +might need to use one if there is no modern client available for the service. +However, if a modern client is available, we generally recommend it over the +older `google-apis-` clients. diff --git a/owl-bot-staging/google-cloud-redis-v1beta1/Rakefile b/owl-bot-staging/google-cloud-redis-v1beta1/Rakefile new file mode 100644 index 000000000000..4ad30ddb21f5 --- /dev/null +++ b/owl-bot-staging/google-cloud-redis-v1beta1/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-redis-v1beta1 acceptance tests." +task :acceptance, :project, :keyfile do |t, args| + project = args[:project] + project ||= + ENV["REDIS_TEST_PROJECT"] || + ENV["GCLOUD_TEST_PROJECT"] + keyfile = args[:keyfile] + keyfile ||= + ENV["REDIS_TEST_KEYFILE"] || + ENV["GCLOUD_TEST_KEYFILE"] + if keyfile + keyfile = File.read keyfile + else + keyfile ||= + ENV["REDIS_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 REDIS_TEST_PROJECT=test123 REDIS_TEST_KEYFILE=/path/to/keyfile.json rake acceptance" + end + require "google/cloud/redis/v1beta1/cloud_redis/credentials" + ::Google::Cloud::Redis::V1beta1::CloudRedis::Credentials.env_vars.each do |path| + ENV[path] = nil + end + ENV["REDIS_PROJECT"] = project + ENV["REDIS_TEST_PROJECT"] = project + ENV["REDIS_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-redis-v1beta1 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-redis-v1beta1 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-redis-v1beta1 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-redis-v1beta1 gem does not have doctest tests." +end + +desc "Run the CI build" +task :ci do + header "BUILDING google-cloud-redis-v1beta1" + header "google-cloud-redis-v1beta1 rubocop", "*" + Rake::Task[:rubocop].invoke + header "google-cloud-redis-v1beta1 yard", "*" + Rake::Task[:yard].invoke + header "google-cloud-redis-v1beta1 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-redis-v1beta1 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-redis-v1beta1 acceptance", "*" + Rake::Task[:acceptance].invoke + end + task :a do + # This is a handy shortcut to save typing + Rake::Task["ci:acceptance"].invoke + end +end + +task default: :test + +def header str, token = "#" + line_length = str.length + 8 + puts "" + puts token * line_length + puts "#{token * 3} #{str} #{token * 3}" + puts token * line_length + puts "" +end diff --git a/owl-bot-staging/google-cloud-redis-v1beta1/gapic_metadata.json b/owl-bot-staging/google-cloud-redis-v1beta1/gapic_metadata.json new file mode 100644 index 000000000000..ef24a8f379ea --- /dev/null +++ b/owl-bot-staging/google-cloud-redis-v1beta1/gapic_metadata.json @@ -0,0 +1,73 @@ +{ + "schema": "1.0", + "comment": "This file maps proto services/RPCs to the corresponding library clients/methods", + "language": "ruby", + "protoPackage": "google.cloud.redis.v1beta1", + "libraryPackage": "::Google::Cloud::Redis::V1beta1", + "services": { + "CloudRedis": { + "clients": { + "grpc": { + "libraryClient": "::Google::Cloud::Redis::V1beta1::CloudRedis::Client", + "rpcs": { + "ListInstances": { + "methods": [ + "list_instances" + ] + }, + "GetInstance": { + "methods": [ + "get_instance" + ] + }, + "GetInstanceAuthString": { + "methods": [ + "get_instance_auth_string" + ] + }, + "CreateInstance": { + "methods": [ + "create_instance" + ] + }, + "UpdateInstance": { + "methods": [ + "update_instance" + ] + }, + "UpgradeInstance": { + "methods": [ + "upgrade_instance" + ] + }, + "ImportInstance": { + "methods": [ + "import_instance" + ] + }, + "ExportInstance": { + "methods": [ + "export_instance" + ] + }, + "FailoverInstance": { + "methods": [ + "failover_instance" + ] + }, + "DeleteInstance": { + "methods": [ + "delete_instance" + ] + }, + "RescheduleMaintenance": { + "methods": [ + "reschedule_maintenance" + ] + } + } + } + } + } + } +} diff --git a/owl-bot-staging/google-cloud-redis-v1beta1/google-cloud-redis-v1beta1.gemspec b/owl-bot-staging/google-cloud-redis-v1beta1/google-cloud-redis-v1beta1.gemspec new file mode 100644 index 000000000000..0e08c4300933 --- /dev/null +++ b/owl-bot-staging/google-cloud-redis-v1beta1/google-cloud-redis-v1beta1.gemspec @@ -0,0 +1,28 @@ +# -*- ruby -*- +# encoding: utf-8 + +require File.expand_path("lib/google/cloud/redis/v1beta1/version", __dir__) + +Gem::Specification.new do |gem| + gem.name = "google-cloud-redis-v1beta1" + gem.version = Google::Cloud::Redis::V1beta1::VERSION + + gem.authors = ["Google LLC"] + gem.email = "googleapis-packages@google.com" + gem.description = "Creates and manages Redis instances on the Google Cloud Platform. Note that google-cloud-redis-v1beta1 is a version-specific client library. For most uses, we recommend installing the main client library google-cloud-redis instead. See the readme for more details." + gem.summary = "Creates and manages Redis instances on the Google Cloud Platform." + gem.homepage = "https://github.com/googleapis/google-cloud-ruby" + gem.license = "Apache-2.0" + + gem.platform = Gem::Platform::RUBY + + gem.files = `git ls-files -- lib/*`.split("\n") + + `git ls-files -- proto_docs/*`.split("\n") + + ["README.md", "LICENSE.md", "AUTHENTICATION.md", ".yardopts"] + gem.require_paths = ["lib"] + + gem.required_ruby_version = ">= 3.2" + + gem.add_dependency "gapic-common", "~> 1.2" + gem.add_dependency "google-cloud-errors", "~> 1.0" +end diff --git a/owl-bot-staging/google-cloud-redis-v1beta1/lib/google-cloud-redis-v1beta1.rb b/owl-bot-staging/google-cloud-redis-v1beta1/lib/google-cloud-redis-v1beta1.rb new file mode 100644 index 000000000000..d3f5814eb8fa --- /dev/null +++ b/owl-bot-staging/google-cloud-redis-v1beta1/lib/google-cloud-redis-v1beta1.rb @@ -0,0 +1,21 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +# This gem does not autoload during Bundler.require. To load this gem, +# issue explicit require statements for the packages desired, e.g.: +# require "google/cloud/redis/v1beta1" diff --git a/owl-bot-staging/google-cloud-redis-v1beta1/lib/google/cloud/redis/v1beta1.rb b/owl-bot-staging/google-cloud-redis-v1beta1/lib/google/cloud/redis/v1beta1.rb new file mode 100644 index 000000000000..a5bbbbab1963 --- /dev/null +++ b/owl-bot-staging/google-cloud-redis-v1beta1/lib/google/cloud/redis/v1beta1.rb @@ -0,0 +1,45 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +require "google/cloud/redis/v1beta1/cloud_redis" +require "google/cloud/redis/v1beta1/version" + +module Google + module Cloud + module Redis + ## + # API client module. + # + # @example Load this package, including all its services, and instantiate a gRPC client + # + # require "google/cloud/redis/v1beta1" + # client = ::Google::Cloud::Redis::V1beta1::CloudRedis::Client.new + # + # @example Load this package, including all its services, and instantiate a REST client + # + # require "google/cloud/redis/v1beta1" + # client = ::Google::Cloud::Redis::V1beta1::CloudRedis::Rest::Client.new + # + module V1beta1 + end + end + end +end + +helper_path = ::File.join __dir__, "v1beta1", "_helpers.rb" +require "google/cloud/redis/v1beta1/_helpers" if ::File.file? helper_path diff --git a/owl-bot-staging/google-cloud-redis-v1beta1/lib/google/cloud/redis/v1beta1/cloud_redis.rb b/owl-bot-staging/google-cloud-redis-v1beta1/lib/google/cloud/redis/v1beta1/cloud_redis.rb new file mode 100644 index 000000000000..8ed5649f09b6 --- /dev/null +++ b/owl-bot-staging/google-cloud-redis-v1beta1/lib/google/cloud/redis/v1beta1/cloud_redis.rb @@ -0,0 +1,70 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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/redis/v1beta1/version" + +require "google/cloud/redis/v1beta1/cloud_redis/credentials" +require "google/cloud/redis/v1beta1/cloud_redis/paths" +require "google/cloud/redis/v1beta1/cloud_redis/operations" +require "google/cloud/redis/v1beta1/cloud_redis/client" +require "google/cloud/redis/v1beta1/cloud_redis/rest" + +module Google + module Cloud + module Redis + module V1beta1 + ## + # Configures and manages Cloud Memorystore for Redis instances + # + # Google Cloud Memorystore for Redis v1beta1 + # + # The `redis.googleapis.com` service implements the Google Cloud Memorystore + # for Redis API and defines the following resource model for managing Redis + # instances: + # * The service works with a collection of cloud projects, named: `/projects/*` + # * Each project has a collection of available locations, named: `/locations/*` + # * Each location has a collection of Redis instances, named: `/instances/*` + # * As such, Redis instances are resources of the form: + # `/projects/{project_id}/locations/{location_id}/instances/{instance_id}` + # + # Note that location_id must be referring to a GCP `region`; for example: + # * `projects/redpepper-1290/locations/us-central1/instances/my-redis` + # + # @example Load this service and instantiate a gRPC client + # + # require "google/cloud/redis/v1beta1/cloud_redis" + # client = ::Google::Cloud::Redis::V1beta1::CloudRedis::Client.new + # + # @example Load this service and instantiate a REST client + # + # require "google/cloud/redis/v1beta1/cloud_redis/rest" + # client = ::Google::Cloud::Redis::V1beta1::CloudRedis::Rest::Client.new + # + module CloudRedis + end + end + end + end +end + +helper_path = ::File.join __dir__, "cloud_redis", "helpers.rb" +require "google/cloud/redis/v1beta1/cloud_redis/helpers" if ::File.file? helper_path diff --git a/owl-bot-staging/google-cloud-redis-v1beta1/lib/google/cloud/redis/v1beta1/cloud_redis/client.rb b/owl-bot-staging/google-cloud-redis-v1beta1/lib/google/cloud/redis/v1beta1/cloud_redis/client.rb new file mode 100644 index 000000000000..540963a8d94c --- /dev/null +++ b/owl-bot-staging/google-cloud-redis-v1beta1/lib/google/cloud/redis/v1beta1/cloud_redis/client.rb @@ -0,0 +1,1629 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +require "google/cloud/errors" +require "google/cloud/redis/v1beta1/cloud_redis_pb" + +module Google + module Cloud + module Redis + module V1beta1 + module CloudRedis + ## + # Client for the CloudRedis service. + # + # Configures and manages Cloud Memorystore for Redis instances + # + # Google Cloud Memorystore for Redis v1beta1 + # + # The `redis.googleapis.com` service implements the Google Cloud Memorystore + # for Redis API and defines the following resource model for managing Redis + # instances: + # * The service works with a collection of cloud projects, named: `/projects/*` + # * Each project has a collection of available locations, named: `/locations/*` + # * Each location has a collection of Redis instances, named: `/instances/*` + # * As such, Redis instances are resources of the form: + # `/projects/{project_id}/locations/{location_id}/instances/{instance_id}` + # + # Note that location_id must be referring to a GCP `region`; for example: + # * `projects/redpepper-1290/locations/us-central1/instances/my-redis` + # + class Client + # @private + API_VERSION = "" + + # @private + DEFAULT_ENDPOINT_TEMPLATE = "redis.$UNIVERSE_DOMAIN$" + + include Paths + + # @private + attr_reader :cloud_redis_stub + + ## + # Configure the CloudRedis Client class. + # + # See {::Google::Cloud::Redis::V1beta1::CloudRedis::Client::Configuration} + # for a description of the configuration fields. + # + # @example + # + # # Modify the configuration for all CloudRedis clients + # ::Google::Cloud::Redis::V1beta1::CloudRedis::Client.configure do |config| + # config.timeout = 10.0 + # end + # + # @yield [config] Configure the Client client. + # @yieldparam config [Client::Configuration] + # + # @return [Client::Configuration] + # + def self.configure + @configure ||= begin + namespace = ["Google", "Cloud", "Redis", "V1beta1"] + parent_config = while namespace.any? + parent_name = namespace.join "::" + parent_const = const_get parent_name + break parent_const.configure if parent_const.respond_to? :configure + namespace.pop + end + default_config = Client::Configuration.new parent_config + + default_config.rpcs.list_instances.timeout = 600.0 + + default_config.rpcs.get_instance.timeout = 600.0 + + default_config.rpcs.get_instance_auth_string.timeout = 600.0 + + default_config.rpcs.create_instance.timeout = 600.0 + + default_config.rpcs.update_instance.timeout = 600.0 + + default_config.rpcs.upgrade_instance.timeout = 600.0 + + default_config.rpcs.import_instance.timeout = 600.0 + + default_config.rpcs.export_instance.timeout = 600.0 + + default_config.rpcs.failover_instance.timeout = 600.0 + + default_config.rpcs.delete_instance.timeout = 600.0 + + default_config + end + yield @configure if block_given? + @configure + end + + ## + # Configure the CloudRedis Client instance. + # + # The configuration is set to the derived mode, meaning that values can be changed, + # but structural changes (adding new fields, etc.) are not allowed. Structural changes + # should be made on {Client.configure}. + # + # See {::Google::Cloud::Redis::V1beta1::CloudRedis::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 + @cloud_redis_stub.universe_domain + end + + ## + # Create a new CloudRedis client object. + # + # @example + # + # # Create a client using the default configuration + # client = ::Google::Cloud::Redis::V1beta1::CloudRedis::Client.new + # + # # Create a client using a custom configuration + # client = ::Google::Cloud::Redis::V1beta1::CloudRedis::Client.new do |config| + # config.timeout = 10.0 + # end + # + # @yield [config] Configure the CloudRedis client. + # @yieldparam config [Client::Configuration] + # + def initialize + # These require statements are intentionally placed here to initialize + # the gRPC module only when it's required. + # See https://github.com/googleapis/toolkit/issues/446 + require "gapic/grpc" + require "google/cloud/redis/v1beta1/cloud_redis_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 + + @cloud_redis_stub = ::Gapic::ServiceStub.new( + ::Google::Cloud::Redis::V1beta1::CloudRedis::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 + ) + + @cloud_redis_stub.stub_logger&.info do |entry| + entry.set_system_name + entry.set_service + entry.message = "Created client for #{entry.service}" + entry.set_credentials_fields credentials + entry.set "customEndpoint", @config.endpoint if @config.endpoint + entry.set "defaultTimeout", @config.timeout if @config.timeout + entry.set "quotaProject", @quota_project_id if @quota_project_id + end + end + + ## + # Get the associated client for long-running operations. + # + # @return [::Google::Cloud::Redis::V1beta1::CloudRedis::Operations] + # + attr_reader :operations_client + + ## + # The logger used for request/response debug logging. + # + # @return [Logger] + # + def logger + @cloud_redis_stub.logger + end + + # Service calls + + ## + # Lists all Redis instances owned by a project in either the specified + # location (region) or all locations. + # + # The location should have the following format: + # + # * `projects/{project_id}/locations/{location_id}` + # + # If `location_id` is specified as `-` (wildcard), then all regions + # available to the project are queried, and the results are aggregated. + # + # @overload list_instances(request, options = nil) + # Pass arguments to `list_instances` via a request object, either of type + # {::Google::Cloud::Redis::V1beta1::ListInstancesRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Redis::V1beta1::ListInstancesRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_instances(parent: nil, page_size: nil, page_token: nil) + # Pass arguments to `list_instances` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param parent [::String] + # Required. The resource name of the instance location using the form: + # `projects/{project_id}/locations/{location_id}` + # where `location_id` refers to a GCP region. + # @param page_size [::Integer] + # The maximum number of items to return. + # + # If not specified, a default value of 1000 will be used by the service. + # Regardless of the page_size value, the response may include a partial list + # and a caller should only rely on response's + # {::Google::Cloud::Redis::V1beta1::ListInstancesResponse#next_page_token `next_page_token`} + # to determine if there are more instances left to be queried. + # @param page_token [::String] + # The `next_page_token` value returned from a previous + # {::Google::Cloud::Redis::V1beta1::CloudRedis::Client#list_instances ListInstances} request, if any. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Gapic::PagedEnumerable<::Google::Cloud::Redis::V1beta1::Instance>] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Gapic::PagedEnumerable<::Google::Cloud::Redis::V1beta1::Instance>] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/redis/v1beta1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Redis::V1beta1::CloudRedis::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Redis::V1beta1::ListInstancesRequest.new + # + # # Call the list_instances method. + # result = client.list_instances request + # + # # The returned object is of type Gapic::PagedEnumerable. You can iterate + # # over elements, and API calls will be issued to fetch pages as needed. + # result.each do |item| + # # Each element is of type ::Google::Cloud::Redis::V1beta1::Instance. + # p item + # end + # + def list_instances request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Redis::V1beta1::ListInstancesRequest + + # Converts hash 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_instances.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::Redis::V1beta1::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_instances.timeout, + metadata: metadata, + retry_policy: @config.rpcs.list_instances.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @cloud_redis_stub.call_rpc :list_instances, request, options: options do |response, operation| + response = ::Gapic::PagedEnumerable.new @cloud_redis_stub, :list_instances, request, response, operation, options + yield response, operation if block_given? + throw :response, response + end + rescue ::GRPC::BadStatus => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Gets the details of a specific Redis instance. + # + # @overload get_instance(request, options = nil) + # Pass arguments to `get_instance` via a request object, either of type + # {::Google::Cloud::Redis::V1beta1::GetInstanceRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Redis::V1beta1::GetInstanceRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_instance(name: nil) + # Pass arguments to `get_instance` via keyword arguments. Note that at + # least one keyword argument is 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. Redis instance resource name using the form: + # `projects/{project_id}/locations/{location_id}/instances/{instance_id}` + # where `location_id` refers to a GCP region. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Google::Cloud::Redis::V1beta1::Instance] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Google::Cloud::Redis::V1beta1::Instance] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/redis/v1beta1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Redis::V1beta1::CloudRedis::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Redis::V1beta1::GetInstanceRequest.new + # + # # Call the get_instance method. + # result = client.get_instance request + # + # # The returned object is of type Google::Cloud::Redis::V1beta1::Instance. + # p result + # + def get_instance request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Redis::V1beta1::GetInstanceRequest + + # Converts hash 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_instance.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::Redis::V1beta1::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_instance.timeout, + metadata: metadata, + retry_policy: @config.rpcs.get_instance.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @cloud_redis_stub.call_rpc :get_instance, request, options: options do |response, operation| + yield response, operation if block_given? + end + rescue ::GRPC::BadStatus => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Gets the AUTH string for a Redis instance. If AUTH is not enabled for the + # instance the response will be empty. This information is not included in + # the details returned to GetInstance. + # + # @overload get_instance_auth_string(request, options = nil) + # Pass arguments to `get_instance_auth_string` via a request object, either of type + # {::Google::Cloud::Redis::V1beta1::GetInstanceAuthStringRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Redis::V1beta1::GetInstanceAuthStringRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_instance_auth_string(name: nil) + # Pass arguments to `get_instance_auth_string` via keyword arguments. Note that at + # least one keyword argument is 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. Redis instance resource name using the form: + # `projects/{project_id}/locations/{location_id}/instances/{instance_id}` + # where `location_id` refers to a GCP region. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Google::Cloud::Redis::V1beta1::InstanceAuthString] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Google::Cloud::Redis::V1beta1::InstanceAuthString] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/redis/v1beta1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Redis::V1beta1::CloudRedis::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Redis::V1beta1::GetInstanceAuthStringRequest.new + # + # # Call the get_instance_auth_string method. + # result = client.get_instance_auth_string request + # + # # The returned object is of type Google::Cloud::Redis::V1beta1::InstanceAuthString. + # p result + # + def get_instance_auth_string request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Redis::V1beta1::GetInstanceAuthStringRequest + + # Converts hash 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_instance_auth_string.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::Redis::V1beta1::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_instance_auth_string.timeout, + metadata: metadata, + retry_policy: @config.rpcs.get_instance_auth_string.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @cloud_redis_stub.call_rpc :get_instance_auth_string, request, options: options do |response, operation| + yield response, operation if block_given? + end + rescue ::GRPC::BadStatus => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Creates a Redis instance based on the specified tier and memory size. + # + # By default, the instance is accessible from the project's + # [default network](https://cloud.google.com/vpc/docs/vpc). + # + # The creation is executed asynchronously and callers may check the returned + # operation to track its progress. Once the operation is completed the Redis + # instance will be fully functional. The completed longrunning.Operation will + # contain the new instance object in the response field. + # + # The returned operation is automatically deleted after a few hours, so there + # is no need to call DeleteOperation. + # + # @overload create_instance(request, options = nil) + # Pass arguments to `create_instance` via a request object, either of type + # {::Google::Cloud::Redis::V1beta1::CreateInstanceRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Redis::V1beta1::CreateInstanceRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_instance(parent: nil, instance_id: nil, instance: nil) + # Pass arguments to `create_instance` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param parent [::String] + # Required. The resource name of the instance location using the form: + # `projects/{project_id}/locations/{location_id}` + # where `location_id` refers to a GCP region. + # @param instance_id [::String] + # Required. The logical name of the Redis instance in the customer project + # with the following restrictions: + # + # * Must contain only lowercase letters, numbers, and hyphens. + # * Must start with a letter. + # * Must be between 1-40 characters. + # * Must end with a number or a letter. + # * Must be unique within the customer project / location + # @param instance [::Google::Cloud::Redis::V1beta1::Instance, ::Hash] + # Required. A Redis [Instance] 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/cloud/redis/v1beta1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Redis::V1beta1::CloudRedis::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Redis::V1beta1::CreateInstanceRequest.new + # + # # Call the create_instance method. + # result = client.create_instance 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_instance request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Redis::V1beta1::CreateInstanceRequest + + # Converts hash 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_instance.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::Redis::V1beta1::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_instance.timeout, + metadata: metadata, + retry_policy: @config.rpcs.create_instance.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @cloud_redis_stub.call_rpc :create_instance, request, options: options do |response, operation| + response = ::Gapic::Operation.new response, @operations_client, options: options + yield response, operation if block_given? + throw :response, response + end + rescue ::GRPC::BadStatus => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Updates the metadata and configuration of a specific Redis instance. + # + # Completed longrunning.Operation will contain the new instance object + # in the response field. The returned operation is automatically deleted + # after a few hours, so there is no need to call DeleteOperation. + # + # @overload update_instance(request, options = nil) + # Pass arguments to `update_instance` via a request object, either of type + # {::Google::Cloud::Redis::V1beta1::UpdateInstanceRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Redis::V1beta1::UpdateInstanceRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_instance(update_mask: nil, instance: nil) + # Pass arguments to `update_instance` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param update_mask [::Google::Protobuf::FieldMask, ::Hash] + # Required. Mask of fields to update. At least one path must be supplied in + # this field. The elements of the repeated paths field may only include these + # fields from {::Google::Cloud::Redis::V1beta1::Instance Instance}: + # + # * `displayName` + # * `labels` + # * `memorySizeGb` + # * `redisConfig` + # * `replica_count` + # @param instance [::Google::Cloud::Redis::V1beta1::Instance, ::Hash] + # Required. Update description. + # Only fields specified in update_mask are updated. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Gapic::Operation] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Gapic::Operation] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/redis/v1beta1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Redis::V1beta1::CloudRedis::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Redis::V1beta1::UpdateInstanceRequest.new + # + # # Call the update_instance method. + # result = client.update_instance 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_instance request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Redis::V1beta1::UpdateInstanceRequest + + # Converts hash 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_instance.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::Redis::V1beta1::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.instance&.name + header_params["instance.name"] = request.instance.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_instance.timeout, + metadata: metadata, + retry_policy: @config.rpcs.update_instance.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @cloud_redis_stub.call_rpc :update_instance, 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 + + ## + # Upgrades Redis instance to the newer Redis version specified in the + # request. + # + # @overload upgrade_instance(request, options = nil) + # Pass arguments to `upgrade_instance` via a request object, either of type + # {::Google::Cloud::Redis::V1beta1::UpgradeInstanceRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Redis::V1beta1::UpgradeInstanceRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. + # + # @overload upgrade_instance(name: nil, redis_version: nil) + # Pass arguments to `upgrade_instance` via keyword arguments. Note that at + # least one keyword argument is 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. Redis instance resource name using the form: + # `projects/{project_id}/locations/{location_id}/instances/{instance_id}` + # where `location_id` refers to a GCP region. + # @param redis_version [::String] + # Required. Specifies the target version of Redis software to upgrade to. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Gapic::Operation] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Gapic::Operation] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/redis/v1beta1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Redis::V1beta1::CloudRedis::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Redis::V1beta1::UpgradeInstanceRequest.new + # + # # Call the upgrade_instance method. + # result = client.upgrade_instance 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 upgrade_instance request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Redis::V1beta1::UpgradeInstanceRequest + + # Converts hash 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.upgrade_instance.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::Redis::V1beta1::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.upgrade_instance.timeout, + metadata: metadata, + retry_policy: @config.rpcs.upgrade_instance.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @cloud_redis_stub.call_rpc :upgrade_instance, 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 + + ## + # Import a Redis RDB snapshot file from Cloud Storage into a Redis instance. + # + # Redis may stop serving during this operation. Instance state will be + # IMPORTING for entire operation. When complete, the instance will contain + # only data from the imported file. + # + # The returned operation is automatically deleted after a few hours, so + # there is no need to call DeleteOperation. + # + # @overload import_instance(request, options = nil) + # Pass arguments to `import_instance` via a request object, either of type + # {::Google::Cloud::Redis::V1beta1::ImportInstanceRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Redis::V1beta1::ImportInstanceRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. + # + # @overload import_instance(name: nil, input_config: nil) + # Pass arguments to `import_instance` via keyword arguments. Note that at + # least one keyword argument is 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. Redis instance resource name using the form: + # `projects/{project_id}/locations/{location_id}/instances/{instance_id}` + # where `location_id` refers to a GCP region. + # @param input_config [::Google::Cloud::Redis::V1beta1::InputConfig, ::Hash] + # Required. Specify data to be imported. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Gapic::Operation] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Gapic::Operation] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/redis/v1beta1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Redis::V1beta1::CloudRedis::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Redis::V1beta1::ImportInstanceRequest.new + # + # # Call the import_instance method. + # result = client.import_instance 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 import_instance request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Redis::V1beta1::ImportInstanceRequest + + # Converts hash 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.import_instance.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::Redis::V1beta1::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.import_instance.timeout, + metadata: metadata, + retry_policy: @config.rpcs.import_instance.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @cloud_redis_stub.call_rpc :import_instance, 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 + + ## + # Export Redis instance data into a Redis RDB format file in Cloud Storage. + # + # Redis will continue serving during this operation. + # + # The returned operation is automatically deleted after a few hours, so + # there is no need to call DeleteOperation. + # + # @overload export_instance(request, options = nil) + # Pass arguments to `export_instance` via a request object, either of type + # {::Google::Cloud::Redis::V1beta1::ExportInstanceRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Redis::V1beta1::ExportInstanceRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. + # + # @overload export_instance(name: nil, output_config: nil) + # Pass arguments to `export_instance` via keyword arguments. Note that at + # least one keyword argument is 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. Redis instance resource name using the form: + # `projects/{project_id}/locations/{location_id}/instances/{instance_id}` + # where `location_id` refers to a GCP region. + # @param output_config [::Google::Cloud::Redis::V1beta1::OutputConfig, ::Hash] + # Required. Specify data to be exported. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Gapic::Operation] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Gapic::Operation] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/redis/v1beta1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Redis::V1beta1::CloudRedis::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Redis::V1beta1::ExportInstanceRequest.new + # + # # Call the export_instance method. + # result = client.export_instance 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 export_instance request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Redis::V1beta1::ExportInstanceRequest + + # Converts hash 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.export_instance.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::Redis::V1beta1::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.export_instance.timeout, + metadata: metadata, + retry_policy: @config.rpcs.export_instance.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @cloud_redis_stub.call_rpc :export_instance, 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 + + ## + # Initiates a failover of the primary node to current replica node for a + # specific STANDARD tier Cloud Memorystore for Redis instance. + # + # @overload failover_instance(request, options = nil) + # Pass arguments to `failover_instance` via a request object, either of type + # {::Google::Cloud::Redis::V1beta1::FailoverInstanceRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Redis::V1beta1::FailoverInstanceRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. + # + # @overload failover_instance(name: nil, data_protection_mode: nil) + # Pass arguments to `failover_instance` via keyword arguments. Note that at + # least one keyword argument is 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. Redis instance resource name using the form: + # `projects/{project_id}/locations/{location_id}/instances/{instance_id}` + # where `location_id` refers to a GCP region. + # @param data_protection_mode [::Google::Cloud::Redis::V1beta1::FailoverInstanceRequest::DataProtectionMode] + # Optional. Available data protection modes that the user can choose. If it's + # unspecified, data protection mode will be LIMITED_DATA_LOSS by default. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Gapic::Operation] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Gapic::Operation] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/redis/v1beta1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Redis::V1beta1::CloudRedis::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Redis::V1beta1::FailoverInstanceRequest.new + # + # # Call the failover_instance method. + # result = client.failover_instance 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 failover_instance request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Redis::V1beta1::FailoverInstanceRequest + + # Converts hash 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.failover_instance.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::Redis::V1beta1::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.failover_instance.timeout, + metadata: metadata, + retry_policy: @config.rpcs.failover_instance.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @cloud_redis_stub.call_rpc :failover_instance, 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 specific Redis instance. Instance stops serving and data is + # deleted. + # + # @overload delete_instance(request, options = nil) + # Pass arguments to `delete_instance` via a request object, either of type + # {::Google::Cloud::Redis::V1beta1::DeleteInstanceRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Redis::V1beta1::DeleteInstanceRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_instance(name: nil) + # Pass arguments to `delete_instance` via keyword arguments. Note that at + # least one keyword argument is 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. Redis instance resource name using the form: + # `projects/{project_id}/locations/{location_id}/instances/{instance_id}` + # where `location_id` refers to a GCP region. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Gapic::Operation] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Gapic::Operation] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/redis/v1beta1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Redis::V1beta1::CloudRedis::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Redis::V1beta1::DeleteInstanceRequest.new + # + # # Call the delete_instance method. + # result = client.delete_instance 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_instance request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Redis::V1beta1::DeleteInstanceRequest + + # Converts hash 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_instance.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::Redis::V1beta1::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_instance.timeout, + metadata: metadata, + retry_policy: @config.rpcs.delete_instance.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @cloud_redis_stub.call_rpc :delete_instance, 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 + + ## + # Reschedule maintenance for a given instance in a given project and + # location. + # + # @overload reschedule_maintenance(request, options = nil) + # Pass arguments to `reschedule_maintenance` via a request object, either of type + # {::Google::Cloud::Redis::V1beta1::RescheduleMaintenanceRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Redis::V1beta1::RescheduleMaintenanceRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. + # + # @overload reschedule_maintenance(name: nil, reschedule_type: nil, schedule_time: nil) + # Pass arguments to `reschedule_maintenance` via keyword arguments. Note that at + # least one keyword argument is 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. Redis instance resource name using the form: + # `projects/{project_id}/locations/{location_id}/instances/{instance_id}` + # where `location_id` refers to a GCP region. + # @param reschedule_type [::Google::Cloud::Redis::V1beta1::RescheduleMaintenanceRequest::RescheduleType] + # Required. If reschedule type is SPECIFIC_TIME, must set up schedule_time as well. + # @param schedule_time [::Google::Protobuf::Timestamp, ::Hash] + # Optional. Timestamp when the maintenance shall be rescheduled to if + # reschedule_type=SPECIFIC_TIME, in RFC 3339 format, for + # example `2012-11-15T16:19:00.094Z`. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Gapic::Operation] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Gapic::Operation] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/redis/v1beta1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Redis::V1beta1::CloudRedis::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Redis::V1beta1::RescheduleMaintenanceRequest.new + # + # # Call the reschedule_maintenance method. + # result = client.reschedule_maintenance 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 reschedule_maintenance request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Redis::V1beta1::RescheduleMaintenanceRequest + + # Converts hash 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.reschedule_maintenance.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::Redis::V1beta1::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.reschedule_maintenance.timeout, + metadata: metadata, + retry_policy: @config.rpcs.reschedule_maintenance.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @cloud_redis_stub.call_rpc :reschedule_maintenance, 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 CloudRedis API. + # + # This class represents the configuration for CloudRedis, + # providing control over timeouts, retry behavior, logging, transport + # parameters, and other low-level controls. Certain parameters can also be + # applied individually to specific RPCs. See + # {::Google::Cloud::Redis::V1beta1::CloudRedis::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_instances to 20 seconds, + # # and all remaining timeouts to 10 seconds. + # ::Google::Cloud::Redis::V1beta1::CloudRedis::Client.configure do |config| + # config.timeout = 10.0 + # config.rpcs.list_instances.timeout = 20.0 + # end + # + # # Apply the above configuration only to a new client. + # client = ::Google::Cloud::Redis::V1beta1::CloudRedis::Client.new do |config| + # config.timeout = 10.0 + # config.rpcs.list_instances.timeout = 20.0 + # end + # + # @!attribute [rw] endpoint + # A custom service endpoint, as a hostname or hostname:port. The default is + # nil, indicating to use the default endpoint in the current universe domain. + # @return [::String,nil] + # @!attribute [rw] credentials + # Credentials to send with calls. You may provide any of the following types: + # * (`Google::Auth::Credentials`) A googleauth credentials object + # (see the [googleauth docs](https://rubydoc.info/gems/googleauth/Google/Auth/Credentials)) + # * (`Signet::OAuth2::Client`) A signet oauth2 client object + # (see the [signet docs](https://rubydoc.info/gems/signet/Signet/OAuth2/Client)) + # * (`GRPC::Core::Channel`) a gRPC channel with included credentials + # * (`GRPC::Core::ChannelCredentials`) a gRPC credentails object + # * (`nil`) indicating no credentials + # + # @note Warning: Passing a `String` to a keyfile path or a `Hash` of credentials + # is deprecated. Providing an unvalidated credential configuration to + # Google APIs can compromise the security of your systems and data. + # + # @example + # + # # The recommended way to provide credentials is to use the `make_creds` method + # # on the appropriate credentials class for your environment. + # + # require "googleauth" + # + # credentials = ::Google::Auth::ServiceAccountCredentials.make_creds( + # json_key_io: ::File.open("/path/to/keyfile.json") + # ) + # + # client = ::Google::Cloud::Redis::V1beta1::CloudRedis::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 = "redis.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 CloudRedis 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_instances` + # @return [::Gapic::Config::Method] + # + attr_reader :list_instances + ## + # RPC-specific configuration for `get_instance` + # @return [::Gapic::Config::Method] + # + attr_reader :get_instance + ## + # RPC-specific configuration for `get_instance_auth_string` + # @return [::Gapic::Config::Method] + # + attr_reader :get_instance_auth_string + ## + # RPC-specific configuration for `create_instance` + # @return [::Gapic::Config::Method] + # + attr_reader :create_instance + ## + # RPC-specific configuration for `update_instance` + # @return [::Gapic::Config::Method] + # + attr_reader :update_instance + ## + # RPC-specific configuration for `upgrade_instance` + # @return [::Gapic::Config::Method] + # + attr_reader :upgrade_instance + ## + # RPC-specific configuration for `import_instance` + # @return [::Gapic::Config::Method] + # + attr_reader :import_instance + ## + # RPC-specific configuration for `export_instance` + # @return [::Gapic::Config::Method] + # + attr_reader :export_instance + ## + # RPC-specific configuration for `failover_instance` + # @return [::Gapic::Config::Method] + # + attr_reader :failover_instance + ## + # RPC-specific configuration for `delete_instance` + # @return [::Gapic::Config::Method] + # + attr_reader :delete_instance + ## + # RPC-specific configuration for `reschedule_maintenance` + # @return [::Gapic::Config::Method] + # + attr_reader :reschedule_maintenance + + # @private + def initialize parent_rpcs = nil + list_instances_config = parent_rpcs.list_instances if parent_rpcs.respond_to? :list_instances + @list_instances = ::Gapic::Config::Method.new list_instances_config + get_instance_config = parent_rpcs.get_instance if parent_rpcs.respond_to? :get_instance + @get_instance = ::Gapic::Config::Method.new get_instance_config + get_instance_auth_string_config = parent_rpcs.get_instance_auth_string if parent_rpcs.respond_to? :get_instance_auth_string + @get_instance_auth_string = ::Gapic::Config::Method.new get_instance_auth_string_config + create_instance_config = parent_rpcs.create_instance if parent_rpcs.respond_to? :create_instance + @create_instance = ::Gapic::Config::Method.new create_instance_config + update_instance_config = parent_rpcs.update_instance if parent_rpcs.respond_to? :update_instance + @update_instance = ::Gapic::Config::Method.new update_instance_config + upgrade_instance_config = parent_rpcs.upgrade_instance if parent_rpcs.respond_to? :upgrade_instance + @upgrade_instance = ::Gapic::Config::Method.new upgrade_instance_config + import_instance_config = parent_rpcs.import_instance if parent_rpcs.respond_to? :import_instance + @import_instance = ::Gapic::Config::Method.new import_instance_config + export_instance_config = parent_rpcs.export_instance if parent_rpcs.respond_to? :export_instance + @export_instance = ::Gapic::Config::Method.new export_instance_config + failover_instance_config = parent_rpcs.failover_instance if parent_rpcs.respond_to? :failover_instance + @failover_instance = ::Gapic::Config::Method.new failover_instance_config + delete_instance_config = parent_rpcs.delete_instance if parent_rpcs.respond_to? :delete_instance + @delete_instance = ::Gapic::Config::Method.new delete_instance_config + reschedule_maintenance_config = parent_rpcs.reschedule_maintenance if parent_rpcs.respond_to? :reschedule_maintenance + @reschedule_maintenance = ::Gapic::Config::Method.new reschedule_maintenance_config + + yield self if block_given? + end + end + end + end + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-redis-v1beta1/lib/google/cloud/redis/v1beta1/cloud_redis/credentials.rb b/owl-bot-staging/google-cloud-redis-v1beta1/lib/google/cloud/redis/v1beta1/cloud_redis/credentials.rb new file mode 100644 index 000000000000..149eca45d129 --- /dev/null +++ b/owl-bot-staging/google-cloud-redis-v1beta1/lib/google/cloud/redis/v1beta1/cloud_redis/credentials.rb @@ -0,0 +1,51 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +require "googleauth" + +module Google + module Cloud + module Redis + module V1beta1 + module CloudRedis + # Credentials for the CloudRedis API. + class Credentials < ::Google::Auth::Credentials + self.scope = [ + "https://www.googleapis.com/auth/cloud-platform" + ] + self.env_vars = [ + "REDIS_CREDENTIALS", + "REDIS_KEYFILE", + "GOOGLE_CLOUD_CREDENTIALS", + "GOOGLE_CLOUD_KEYFILE", + "GCLOUD_KEYFILE", + "REDIS_CREDENTIALS_JSON", + "REDIS_KEYFILE_JSON", + "GOOGLE_CLOUD_CREDENTIALS_JSON", + "GOOGLE_CLOUD_KEYFILE_JSON", + "GCLOUD_KEYFILE_JSON" + ] + self.paths = [ + "~/.config/google_cloud/application_default_credentials.json" + ] + end + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-redis-v1beta1/lib/google/cloud/redis/v1beta1/cloud_redis/operations.rb b/owl-bot-staging/google-cloud-redis-v1beta1/lib/google/cloud/redis/v1beta1/cloud_redis/operations.rb new file mode 100644 index 000000000000..5236a92741fc --- /dev/null +++ b/owl-bot-staging/google-cloud-redis-v1beta1/lib/google/cloud/redis/v1beta1/cloud_redis/operations.rb @@ -0,0 +1,841 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +require "gapic/operation" +require "google/longrunning/operations_pb" + +module Google + module Cloud + module Redis + module V1beta1 + module CloudRedis + # Service that implements Longrunning Operations API. + class Operations + # @private + API_VERSION = "" + + # @private + DEFAULT_ENDPOINT_TEMPLATE = "redis.$UNIVERSE_DOMAIN$" + + # @private + attr_reader :operations_stub + + ## + # Configuration for the CloudRedis 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 CloudRedis 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::Redis::V1beta1::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::Redis::V1beta1::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::Redis::V1beta1::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::Redis::V1beta1::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::Redis::V1beta1::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 = "redis.googleapis.com" + + config_attr :endpoint, nil, ::String, nil + config_attr :credentials, nil do |value| + allowed = [::String, ::Hash, ::Proc, ::Symbol, ::Google::Auth::Credentials, ::Google::Auth::BaseClient, ::Signet::OAuth2::Client, nil] + allowed += [::GRPC::Core::Channel, ::GRPC::Core::ChannelCredentials] if defined? ::GRPC::Core::Channel + allowed.any? { |klass| klass === value } + end + config_attr :scope, nil, ::String, ::Array, nil + config_attr :lib_name, nil, ::String, nil + config_attr :lib_version, nil, ::String, nil + config_attr(:channel_args, { "grpc.service_config_disable_resolution" => 1 }, ::Hash, nil) + config_attr :interceptors, nil, ::Array, nil + config_attr :timeout, nil, ::Numeric, nil + config_attr :metadata, nil, ::Hash, nil + config_attr :retry_policy, nil, ::Hash, ::Proc, nil + config_attr :quota_project, nil, ::String, nil + config_attr :universe_domain, nil, ::String, nil + config_attr :logger, :default, ::Logger, nil, :default + + # @private + def initialize parent_config = nil + @parent_config = parent_config unless parent_config.nil? + + yield self if block_given? + end + + ## + # Configurations for individual RPCs + # @return [Rpcs] + # + def rpcs + @rpcs ||= begin + parent_rpcs = nil + parent_rpcs = @parent_config.rpcs if defined?(@parent_config) && @parent_config.respond_to?(:rpcs) + Rpcs.new parent_rpcs + end + end + + ## + # Configuration for the channel pool + # @return [::Gapic::ServiceStub::ChannelPool::Configuration] + # + def channel_pool + @channel_pool ||= ::Gapic::ServiceStub::ChannelPool::Configuration.new + end + + ## + # Configuration RPC class for the Operations API. + # + # Includes fields providing the configuration for each RPC in this service. + # Each configuration object is of type `Gapic::Config::Method` and includes + # the following configuration fields: + # + # * `timeout` (*type:* `Numeric`) - The call timeout in seconds + # * `metadata` (*type:* `Hash{Symbol=>String}`) - Additional gRPC headers + # * `retry_policy (*type:* `Hash`) - The retry policy. The policy fields + # include the following keys: + # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds. + # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds. + # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier. + # * `:retry_codes` (*type:* `Array`) - The error codes that should + # trigger a retry. + # + class Rpcs + ## + # RPC-specific configuration for `list_operations` + # @return [::Gapic::Config::Method] + # + attr_reader :list_operations + ## + # RPC-specific configuration for `get_operation` + # @return [::Gapic::Config::Method] + # + attr_reader :get_operation + ## + # RPC-specific configuration for `delete_operation` + # @return [::Gapic::Config::Method] + # + attr_reader :delete_operation + ## + # RPC-specific configuration for `cancel_operation` + # @return [::Gapic::Config::Method] + # + attr_reader :cancel_operation + ## + # RPC-specific configuration for `wait_operation` + # @return [::Gapic::Config::Method] + # + attr_reader :wait_operation + + # @private + def initialize parent_rpcs = nil + list_operations_config = parent_rpcs.list_operations if parent_rpcs.respond_to? :list_operations + @list_operations = ::Gapic::Config::Method.new list_operations_config + get_operation_config = parent_rpcs.get_operation if parent_rpcs.respond_to? :get_operation + @get_operation = ::Gapic::Config::Method.new get_operation_config + delete_operation_config = parent_rpcs.delete_operation if parent_rpcs.respond_to? :delete_operation + @delete_operation = ::Gapic::Config::Method.new delete_operation_config + cancel_operation_config = parent_rpcs.cancel_operation if parent_rpcs.respond_to? :cancel_operation + @cancel_operation = ::Gapic::Config::Method.new cancel_operation_config + wait_operation_config = parent_rpcs.wait_operation if parent_rpcs.respond_to? :wait_operation + @wait_operation = ::Gapic::Config::Method.new wait_operation_config + + yield self if block_given? + end + end + end + end + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-redis-v1beta1/lib/google/cloud/redis/v1beta1/cloud_redis/paths.rb b/owl-bot-staging/google-cloud-redis-v1beta1/lib/google/cloud/redis/v1beta1/cloud_redis/paths.rb new file mode 100644 index 000000000000..ca975d23e644 --- /dev/null +++ b/owl-bot-staging/google-cloud-redis-v1beta1/lib/google/cloud/redis/v1beta1/cloud_redis/paths.rb @@ -0,0 +1,69 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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 Redis + module V1beta1 + module CloudRedis + # Path helper methods for the CloudRedis API. + module Paths + ## + # Create a fully-qualified Instance resource string. + # + # The resource will be in the following format: + # + # `projects/{project}/locations/{location}/instances/{instance}` + # + # @param project [String] + # @param location [String] + # @param instance [String] + # + # @return [::String] + def instance_path project:, location:, instance: + raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" + raise ::ArgumentError, "location cannot contain /" if location.to_s.include? "/" + + "projects/#{project}/locations/#{location}/instances/#{instance}" + 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 + + extend self + end + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-redis-v1beta1/lib/google/cloud/redis/v1beta1/cloud_redis/rest.rb b/owl-bot-staging/google-cloud-redis-v1beta1/lib/google/cloud/redis/v1beta1/cloud_redis/rest.rb new file mode 100644 index 000000000000..26f9e4025d6a --- /dev/null +++ b/owl-bot-staging/google-cloud-redis-v1beta1/lib/google/cloud/redis/v1beta1/cloud_redis/rest.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 "gapic/rest" +require "gapic/config" +require "gapic/config/method" + +require "google/cloud/redis/v1beta1/version" + +require "google/cloud/redis/v1beta1/cloud_redis/credentials" +require "google/cloud/redis/v1beta1/cloud_redis/paths" +require "google/cloud/redis/v1beta1/cloud_redis/rest/operations" +require "google/cloud/redis/v1beta1/cloud_redis/rest/client" + +module Google + module Cloud + module Redis + module V1beta1 + ## + # Configures and manages Cloud Memorystore for Redis instances + # + # Google Cloud Memorystore for Redis v1beta1 + # + # The `redis.googleapis.com` service implements the Google Cloud Memorystore + # for Redis API and defines the following resource model for managing Redis + # instances: + # * The service works with a collection of cloud projects, named: `/projects/*` + # * Each project has a collection of available locations, named: `/locations/*` + # * Each location has a collection of Redis instances, named: `/instances/*` + # * As such, Redis instances are resources of the form: + # `/projects/{project_id}/locations/{location_id}/instances/{instance_id}` + # + # Note that location_id must be referring to a GCP `region`; for example: + # * `projects/redpepper-1290/locations/us-central1/instances/my-redis` + # + # To load this service and instantiate a REST client: + # + # require "google/cloud/redis/v1beta1/cloud_redis/rest" + # client = ::Google::Cloud::Redis::V1beta1::CloudRedis::Rest::Client.new + # + module CloudRedis + # Client for the REST transport + module Rest + end + end + end + end + end +end + +helper_path = ::File.join __dir__, "rest", "helpers.rb" +require "google/cloud/redis/v1beta1/cloud_redis/rest/helpers" if ::File.file? helper_path diff --git a/owl-bot-staging/google-cloud-redis-v1beta1/lib/google/cloud/redis/v1beta1/cloud_redis/rest/client.rb b/owl-bot-staging/google-cloud-redis-v1beta1/lib/google/cloud/redis/v1beta1/cloud_redis/rest/client.rb new file mode 100644 index 000000000000..2b297cc75ede --- /dev/null +++ b/owl-bot-staging/google-cloud-redis-v1beta1/lib/google/cloud/redis/v1beta1/cloud_redis/rest/client.rb @@ -0,0 +1,1509 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +require "google/cloud/errors" +require "google/cloud/redis/v1beta1/cloud_redis_pb" +require "google/cloud/redis/v1beta1/cloud_redis/rest/service_stub" + +module Google + module Cloud + module Redis + module V1beta1 + module CloudRedis + module Rest + ## + # REST client for the CloudRedis service. + # + # Configures and manages Cloud Memorystore for Redis instances + # + # Google Cloud Memorystore for Redis v1beta1 + # + # The `redis.googleapis.com` service implements the Google Cloud Memorystore + # for Redis API and defines the following resource model for managing Redis + # instances: + # * The service works with a collection of cloud projects, named: `/projects/*` + # * Each project has a collection of available locations, named: `/locations/*` + # * Each location has a collection of Redis instances, named: `/instances/*` + # * As such, Redis instances are resources of the form: + # `/projects/{project_id}/locations/{location_id}/instances/{instance_id}` + # + # Note that location_id must be referring to a GCP `region`; for example: + # * `projects/redpepper-1290/locations/us-central1/instances/my-redis` + # + class Client + # @private + API_VERSION = "" + + # @private + DEFAULT_ENDPOINT_TEMPLATE = "redis.$UNIVERSE_DOMAIN$" + + include Paths + + # @private + attr_reader :cloud_redis_stub + + ## + # Configure the CloudRedis Client class. + # + # See {::Google::Cloud::Redis::V1beta1::CloudRedis::Rest::Client::Configuration} + # for a description of the configuration fields. + # + # @example + # + # # Modify the configuration for all CloudRedis clients + # ::Google::Cloud::Redis::V1beta1::CloudRedis::Rest::Client.configure do |config| + # config.timeout = 10.0 + # end + # + # @yield [config] Configure the Client client. + # @yieldparam config [Client::Configuration] + # + # @return [Client::Configuration] + # + def self.configure + @configure ||= begin + namespace = ["Google", "Cloud", "Redis", "V1beta1"] + parent_config = while namespace.any? + parent_name = namespace.join "::" + parent_const = const_get parent_name + break parent_const.configure if parent_const.respond_to? :configure + namespace.pop + end + default_config = Client::Configuration.new parent_config + + default_config.rpcs.list_instances.timeout = 600.0 + + default_config.rpcs.get_instance.timeout = 600.0 + + default_config.rpcs.get_instance_auth_string.timeout = 600.0 + + default_config.rpcs.create_instance.timeout = 600.0 + + default_config.rpcs.update_instance.timeout = 600.0 + + default_config.rpcs.upgrade_instance.timeout = 600.0 + + default_config.rpcs.import_instance.timeout = 600.0 + + default_config.rpcs.export_instance.timeout = 600.0 + + default_config.rpcs.failover_instance.timeout = 600.0 + + default_config.rpcs.delete_instance.timeout = 600.0 + + default_config + end + yield @configure if block_given? + @configure + end + + ## + # Configure the CloudRedis Client instance. + # + # The configuration is set to the derived mode, meaning that values can be changed, + # but structural changes (adding new fields, etc.) are not allowed. Structural changes + # should be made on {Client.configure}. + # + # See {::Google::Cloud::Redis::V1beta1::CloudRedis::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 + @cloud_redis_stub.universe_domain + end + + ## + # Create a new CloudRedis REST client object. + # + # @example + # + # # Create a client using the default configuration + # client = ::Google::Cloud::Redis::V1beta1::CloudRedis::Rest::Client.new + # + # # Create a client using a custom configuration + # client = ::Google::Cloud::Redis::V1beta1::CloudRedis::Rest::Client.new do |config| + # config.timeout = 10.0 + # end + # + # @yield [config] Configure the CloudRedis client. + # @yieldparam config [Client::Configuration] + # + def initialize + # Create the configuration object + @config = Configuration.new Client.configure + + # Yield the configuration if needed + yield @config if block_given? + + # Create credentials + credentials = @config.credentials + # Use self-signed JWT if the endpoint is unchanged from default, + # but only if the default endpoint does not have a region prefix. + enable_self_signed_jwt = @config.endpoint.nil? || + (@config.endpoint == Configuration::DEFAULT_ENDPOINT && + !@config.endpoint.split(".").first.include?("-")) + credentials ||= Credentials.default scope: @config.scope, + enable_self_signed_jwt: enable_self_signed_jwt + if credentials.is_a?(::String) || credentials.is_a?(::Hash) + credentials = Credentials.new credentials, scope: @config.scope + end + + @quota_project_id = @config.quota_project + @quota_project_id ||= credentials.quota_project_id if credentials.respond_to? :quota_project_id + + @operations_client = ::Google::Cloud::Redis::V1beta1::CloudRedis::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 + + @cloud_redis_stub = ::Google::Cloud::Redis::V1beta1::CloudRedis::Rest::ServiceStub.new( + endpoint: @config.endpoint, + endpoint_template: DEFAULT_ENDPOINT_TEMPLATE, + universe_domain: @config.universe_domain, + credentials: credentials, + logger: @config.logger + ) + + @cloud_redis_stub.logger(stub: true)&.info do |entry| + entry.set_system_name + entry.set_service + entry.message = "Created client for #{entry.service}" + entry.set_credentials_fields credentials + entry.set "customEndpoint", @config.endpoint if @config.endpoint + entry.set "defaultTimeout", @config.timeout if @config.timeout + entry.set "quotaProject", @quota_project_id if @quota_project_id + end + end + + ## + # Get the associated client for long-running operations. + # + # @return [::Google::Cloud::Redis::V1beta1::CloudRedis::Rest::Operations] + # + attr_reader :operations_client + + ## + # The logger used for request/response debug logging. + # + # @return [Logger] + # + def logger + @cloud_redis_stub.logger + end + + # Service calls + + ## + # Lists all Redis instances owned by a project in either the specified + # location (region) or all locations. + # + # The location should have the following format: + # + # * `projects/{project_id}/locations/{location_id}` + # + # If `location_id` is specified as `-` (wildcard), then all regions + # available to the project are queried, and the results are aggregated. + # + # @overload list_instances(request, options = nil) + # Pass arguments to `list_instances` via a request object, either of type + # {::Google::Cloud::Redis::V1beta1::ListInstancesRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Redis::V1beta1::ListInstancesRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_instances(parent: nil, page_size: nil, page_token: nil) + # Pass arguments to `list_instances` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param parent [::String] + # Required. The resource name of the instance location using the form: + # `projects/{project_id}/locations/{location_id}` + # where `location_id` refers to a GCP region. + # @param page_size [::Integer] + # The maximum number of items to return. + # + # If not specified, a default value of 1000 will be used by the service. + # Regardless of the page_size value, the response may include a partial list + # and a caller should only rely on response's + # {::Google::Cloud::Redis::V1beta1::ListInstancesResponse#next_page_token `next_page_token`} + # to determine if there are more instances left to be queried. + # @param page_token [::String] + # The `next_page_token` value returned from a previous + # {::Google::Cloud::Redis::V1beta1::CloudRedis::Rest::Client#list_instances ListInstances} request, if any. + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Gapic::Rest::PagedEnumerable<::Google::Cloud::Redis::V1beta1::Instance>] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Gapic::Rest::PagedEnumerable<::Google::Cloud::Redis::V1beta1::Instance>] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/redis/v1beta1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Redis::V1beta1::CloudRedis::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Redis::V1beta1::ListInstancesRequest.new + # + # # Call the list_instances method. + # result = client.list_instances request + # + # # The returned object is of type Gapic::PagedEnumerable. You can iterate + # # over elements, and API calls will be issued to fetch pages as needed. + # result.each do |item| + # # Each element is of type ::Google::Cloud::Redis::V1beta1::Instance. + # p item + # end + # + def list_instances request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Redis::V1beta1::ListInstancesRequest + + # Converts hash 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_instances.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::Redis::V1beta1::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_instances.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.list_instances.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @cloud_redis_stub.list_instances request, options do |result, operation| + result = ::Gapic::Rest::PagedEnumerable.new @cloud_redis_stub, :list_instances, "instances", 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 details of a specific Redis instance. + # + # @overload get_instance(request, options = nil) + # Pass arguments to `get_instance` via a request object, either of type + # {::Google::Cloud::Redis::V1beta1::GetInstanceRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Redis::V1beta1::GetInstanceRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_instance(name: nil) + # Pass arguments to `get_instance` via keyword arguments. Note that at + # least one keyword argument is 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. Redis instance resource name using the form: + # `projects/{project_id}/locations/{location_id}/instances/{instance_id}` + # where `location_id` refers to a GCP region. + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Cloud::Redis::V1beta1::Instance] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::Redis::V1beta1::Instance] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/redis/v1beta1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Redis::V1beta1::CloudRedis::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Redis::V1beta1::GetInstanceRequest.new + # + # # Call the get_instance method. + # result = client.get_instance request + # + # # The returned object is of type Google::Cloud::Redis::V1beta1::Instance. + # p result + # + def get_instance request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Redis::V1beta1::GetInstanceRequest + + # Converts hash 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_instance.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::Redis::V1beta1::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_instance.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.get_instance.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @cloud_redis_stub.get_instance request, options do |result, operation| + yield result, operation if block_given? + end + rescue ::Gapic::Rest::Error => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Gets the AUTH string for a Redis instance. If AUTH is not enabled for the + # instance the response will be empty. This information is not included in + # the details returned to GetInstance. + # + # @overload get_instance_auth_string(request, options = nil) + # Pass arguments to `get_instance_auth_string` via a request object, either of type + # {::Google::Cloud::Redis::V1beta1::GetInstanceAuthStringRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Redis::V1beta1::GetInstanceAuthStringRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_instance_auth_string(name: nil) + # Pass arguments to `get_instance_auth_string` via keyword arguments. Note that at + # least one keyword argument is 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. Redis instance resource name using the form: + # `projects/{project_id}/locations/{location_id}/instances/{instance_id}` + # where `location_id` refers to a GCP region. + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Cloud::Redis::V1beta1::InstanceAuthString] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::Redis::V1beta1::InstanceAuthString] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/redis/v1beta1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Redis::V1beta1::CloudRedis::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Redis::V1beta1::GetInstanceAuthStringRequest.new + # + # # Call the get_instance_auth_string method. + # result = client.get_instance_auth_string request + # + # # The returned object is of type Google::Cloud::Redis::V1beta1::InstanceAuthString. + # p result + # + def get_instance_auth_string request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Redis::V1beta1::GetInstanceAuthStringRequest + + # Converts hash 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_instance_auth_string.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::Redis::V1beta1::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_instance_auth_string.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.get_instance_auth_string.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @cloud_redis_stub.get_instance_auth_string request, options do |result, operation| + yield result, operation if block_given? + end + rescue ::Gapic::Rest::Error => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Creates a Redis instance based on the specified tier and memory size. + # + # By default, the instance is accessible from the project's + # [default network](https://cloud.google.com/vpc/docs/vpc). + # + # The creation is executed asynchronously and callers may check the returned + # operation to track its progress. Once the operation is completed the Redis + # instance will be fully functional. The completed longrunning.Operation will + # contain the new instance object in the response field. + # + # The returned operation is automatically deleted after a few hours, so there + # is no need to call DeleteOperation. + # + # @overload create_instance(request, options = nil) + # Pass arguments to `create_instance` via a request object, either of type + # {::Google::Cloud::Redis::V1beta1::CreateInstanceRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Redis::V1beta1::CreateInstanceRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_instance(parent: nil, instance_id: nil, instance: nil) + # Pass arguments to `create_instance` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param parent [::String] + # Required. The resource name of the instance location using the form: + # `projects/{project_id}/locations/{location_id}` + # where `location_id` refers to a GCP region. + # @param instance_id [::String] + # Required. The logical name of the Redis instance in the customer project + # with the following restrictions: + # + # * Must contain only lowercase letters, numbers, and hyphens. + # * Must start with a letter. + # * Must be between 1-40 characters. + # * Must end with a number or a letter. + # * Must be unique within the customer project / location + # @param instance [::Google::Cloud::Redis::V1beta1::Instance, ::Hash] + # Required. A Redis [Instance] 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/cloud/redis/v1beta1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Redis::V1beta1::CloudRedis::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Redis::V1beta1::CreateInstanceRequest.new + # + # # Call the create_instance method. + # result = client.create_instance 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_instance request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Redis::V1beta1::CreateInstanceRequest + + # Converts hash 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_instance.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::Redis::V1beta1::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_instance.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.create_instance.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @cloud_redis_stub.create_instance 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 + + ## + # Updates the metadata and configuration of a specific Redis instance. + # + # Completed longrunning.Operation will contain the new instance object + # in the response field. The returned operation is automatically deleted + # after a few hours, so there is no need to call DeleteOperation. + # + # @overload update_instance(request, options = nil) + # Pass arguments to `update_instance` via a request object, either of type + # {::Google::Cloud::Redis::V1beta1::UpdateInstanceRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Redis::V1beta1::UpdateInstanceRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_instance(update_mask: nil, instance: nil) + # Pass arguments to `update_instance` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param update_mask [::Google::Protobuf::FieldMask, ::Hash] + # Required. Mask of fields to update. At least one path must be supplied in + # this field. The elements of the repeated paths field may only include these + # fields from {::Google::Cloud::Redis::V1beta1::Instance Instance}: + # + # * `displayName` + # * `labels` + # * `memorySizeGb` + # * `redisConfig` + # * `replica_count` + # @param instance [::Google::Cloud::Redis::V1beta1::Instance, ::Hash] + # Required. Update description. + # Only fields specified in update_mask are updated. + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Gapic::Operation] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Gapic::Operation] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/redis/v1beta1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Redis::V1beta1::CloudRedis::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Redis::V1beta1::UpdateInstanceRequest.new + # + # # Call the update_instance method. + # result = client.update_instance 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_instance request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Redis::V1beta1::UpdateInstanceRequest + + # Converts hash 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_instance.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::Redis::V1beta1::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_instance.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.update_instance.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @cloud_redis_stub.update_instance 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 + + ## + # Upgrades Redis instance to the newer Redis version specified in the + # request. + # + # @overload upgrade_instance(request, options = nil) + # Pass arguments to `upgrade_instance` via a request object, either of type + # {::Google::Cloud::Redis::V1beta1::UpgradeInstanceRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Redis::V1beta1::UpgradeInstanceRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @overload upgrade_instance(name: nil, redis_version: nil) + # Pass arguments to `upgrade_instance` via keyword arguments. Note that at + # least one keyword argument is 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. Redis instance resource name using the form: + # `projects/{project_id}/locations/{location_id}/instances/{instance_id}` + # where `location_id` refers to a GCP region. + # @param redis_version [::String] + # Required. Specifies the target version of Redis software to upgrade to. + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Gapic::Operation] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Gapic::Operation] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/redis/v1beta1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Redis::V1beta1::CloudRedis::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Redis::V1beta1::UpgradeInstanceRequest.new + # + # # Call the upgrade_instance method. + # result = client.upgrade_instance 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 upgrade_instance request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Redis::V1beta1::UpgradeInstanceRequest + + # Converts hash 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.upgrade_instance.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::Redis::V1beta1::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.upgrade_instance.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.upgrade_instance.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @cloud_redis_stub.upgrade_instance 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 + + ## + # Import a Redis RDB snapshot file from Cloud Storage into a Redis instance. + # + # Redis may stop serving during this operation. Instance state will be + # IMPORTING for entire operation. When complete, the instance will contain + # only data from the imported file. + # + # The returned operation is automatically deleted after a few hours, so + # there is no need to call DeleteOperation. + # + # @overload import_instance(request, options = nil) + # Pass arguments to `import_instance` via a request object, either of type + # {::Google::Cloud::Redis::V1beta1::ImportInstanceRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Redis::V1beta1::ImportInstanceRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @overload import_instance(name: nil, input_config: nil) + # Pass arguments to `import_instance` via keyword arguments. Note that at + # least one keyword argument is 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. Redis instance resource name using the form: + # `projects/{project_id}/locations/{location_id}/instances/{instance_id}` + # where `location_id` refers to a GCP region. + # @param input_config [::Google::Cloud::Redis::V1beta1::InputConfig, ::Hash] + # Required. Specify data to be imported. + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Gapic::Operation] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Gapic::Operation] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/redis/v1beta1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Redis::V1beta1::CloudRedis::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Redis::V1beta1::ImportInstanceRequest.new + # + # # Call the import_instance method. + # result = client.import_instance 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 import_instance request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Redis::V1beta1::ImportInstanceRequest + + # Converts hash 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.import_instance.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::Redis::V1beta1::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.import_instance.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.import_instance.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @cloud_redis_stub.import_instance 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 + + ## + # Export Redis instance data into a Redis RDB format file in Cloud Storage. + # + # Redis will continue serving during this operation. + # + # The returned operation is automatically deleted after a few hours, so + # there is no need to call DeleteOperation. + # + # @overload export_instance(request, options = nil) + # Pass arguments to `export_instance` via a request object, either of type + # {::Google::Cloud::Redis::V1beta1::ExportInstanceRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Redis::V1beta1::ExportInstanceRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @overload export_instance(name: nil, output_config: nil) + # Pass arguments to `export_instance` via keyword arguments. Note that at + # least one keyword argument is 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. Redis instance resource name using the form: + # `projects/{project_id}/locations/{location_id}/instances/{instance_id}` + # where `location_id` refers to a GCP region. + # @param output_config [::Google::Cloud::Redis::V1beta1::OutputConfig, ::Hash] + # Required. Specify data to be exported. + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Gapic::Operation] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Gapic::Operation] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/redis/v1beta1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Redis::V1beta1::CloudRedis::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Redis::V1beta1::ExportInstanceRequest.new + # + # # Call the export_instance method. + # result = client.export_instance 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 export_instance request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Redis::V1beta1::ExportInstanceRequest + + # Converts hash 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.export_instance.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::Redis::V1beta1::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.export_instance.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.export_instance.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @cloud_redis_stub.export_instance 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 + + ## + # Initiates a failover of the primary node to current replica node for a + # specific STANDARD tier Cloud Memorystore for Redis instance. + # + # @overload failover_instance(request, options = nil) + # Pass arguments to `failover_instance` via a request object, either of type + # {::Google::Cloud::Redis::V1beta1::FailoverInstanceRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Redis::V1beta1::FailoverInstanceRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @overload failover_instance(name: nil, data_protection_mode: nil) + # Pass arguments to `failover_instance` via keyword arguments. Note that at + # least one keyword argument is 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. Redis instance resource name using the form: + # `projects/{project_id}/locations/{location_id}/instances/{instance_id}` + # where `location_id` refers to a GCP region. + # @param data_protection_mode [::Google::Cloud::Redis::V1beta1::FailoverInstanceRequest::DataProtectionMode] + # Optional. Available data protection modes that the user can choose. If it's + # unspecified, data protection mode will be LIMITED_DATA_LOSS by default. + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Gapic::Operation] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Gapic::Operation] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/redis/v1beta1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Redis::V1beta1::CloudRedis::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Redis::V1beta1::FailoverInstanceRequest.new + # + # # Call the failover_instance method. + # result = client.failover_instance 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 failover_instance request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Redis::V1beta1::FailoverInstanceRequest + + # Converts hash 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.failover_instance.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::Redis::V1beta1::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.failover_instance.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.failover_instance.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @cloud_redis_stub.failover_instance 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 specific Redis instance. Instance stops serving and data is + # deleted. + # + # @overload delete_instance(request, options = nil) + # Pass arguments to `delete_instance` via a request object, either of type + # {::Google::Cloud::Redis::V1beta1::DeleteInstanceRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Redis::V1beta1::DeleteInstanceRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_instance(name: nil) + # Pass arguments to `delete_instance` via keyword arguments. Note that at + # least one keyword argument is 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. Redis instance resource name using the form: + # `projects/{project_id}/locations/{location_id}/instances/{instance_id}` + # where `location_id` refers to a GCP region. + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Gapic::Operation] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Gapic::Operation] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/redis/v1beta1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Redis::V1beta1::CloudRedis::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Redis::V1beta1::DeleteInstanceRequest.new + # + # # Call the delete_instance method. + # result = client.delete_instance 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_instance request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Redis::V1beta1::DeleteInstanceRequest + + # Converts hash 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_instance.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::Redis::V1beta1::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_instance.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.delete_instance.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @cloud_redis_stub.delete_instance 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 + + ## + # Reschedule maintenance for a given instance in a given project and + # location. + # + # @overload reschedule_maintenance(request, options = nil) + # Pass arguments to `reschedule_maintenance` via a request object, either of type + # {::Google::Cloud::Redis::V1beta1::RescheduleMaintenanceRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Redis::V1beta1::RescheduleMaintenanceRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @overload reschedule_maintenance(name: nil, reschedule_type: nil, schedule_time: nil) + # Pass arguments to `reschedule_maintenance` via keyword arguments. Note that at + # least one keyword argument is 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. Redis instance resource name using the form: + # `projects/{project_id}/locations/{location_id}/instances/{instance_id}` + # where `location_id` refers to a GCP region. + # @param reschedule_type [::Google::Cloud::Redis::V1beta1::RescheduleMaintenanceRequest::RescheduleType] + # Required. If reschedule type is SPECIFIC_TIME, must set up schedule_time as well. + # @param schedule_time [::Google::Protobuf::Timestamp, ::Hash] + # Optional. Timestamp when the maintenance shall be rescheduled to if + # reschedule_type=SPECIFIC_TIME, in RFC 3339 format, for + # example `2012-11-15T16:19:00.094Z`. + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Gapic::Operation] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Gapic::Operation] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/redis/v1beta1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Redis::V1beta1::CloudRedis::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Redis::V1beta1::RescheduleMaintenanceRequest.new + # + # # Call the reschedule_maintenance method. + # result = client.reschedule_maintenance 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 reschedule_maintenance request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Redis::V1beta1::RescheduleMaintenanceRequest + + # Converts hash 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.reschedule_maintenance.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::Redis::V1beta1::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.reschedule_maintenance.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.reschedule_maintenance.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @cloud_redis_stub.reschedule_maintenance 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 + + ## + # Configuration class for the CloudRedis REST API. + # + # This class represents the configuration for CloudRedis REST, + # providing control over timeouts, retry behavior, logging, transport + # parameters, and other low-level controls. Certain parameters can also be + # applied individually to specific RPCs. See + # {::Google::Cloud::Redis::V1beta1::CloudRedis::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_instances to 20 seconds, + # # and all remaining timeouts to 10 seconds. + # ::Google::Cloud::Redis::V1beta1::CloudRedis::Rest::Client.configure do |config| + # config.timeout = 10.0 + # config.rpcs.list_instances.timeout = 20.0 + # end + # + # # Apply the above configuration only to a new client. + # client = ::Google::Cloud::Redis::V1beta1::CloudRedis::Rest::Client.new do |config| + # config.timeout = 10.0 + # config.rpcs.list_instances.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 = "redis.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 CloudRedis 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_instances` + # @return [::Gapic::Config::Method] + # + attr_reader :list_instances + ## + # RPC-specific configuration for `get_instance` + # @return [::Gapic::Config::Method] + # + attr_reader :get_instance + ## + # RPC-specific configuration for `get_instance_auth_string` + # @return [::Gapic::Config::Method] + # + attr_reader :get_instance_auth_string + ## + # RPC-specific configuration for `create_instance` + # @return [::Gapic::Config::Method] + # + attr_reader :create_instance + ## + # RPC-specific configuration for `update_instance` + # @return [::Gapic::Config::Method] + # + attr_reader :update_instance + ## + # RPC-specific configuration for `upgrade_instance` + # @return [::Gapic::Config::Method] + # + attr_reader :upgrade_instance + ## + # RPC-specific configuration for `import_instance` + # @return [::Gapic::Config::Method] + # + attr_reader :import_instance + ## + # RPC-specific configuration for `export_instance` + # @return [::Gapic::Config::Method] + # + attr_reader :export_instance + ## + # RPC-specific configuration for `failover_instance` + # @return [::Gapic::Config::Method] + # + attr_reader :failover_instance + ## + # RPC-specific configuration for `delete_instance` + # @return [::Gapic::Config::Method] + # + attr_reader :delete_instance + ## + # RPC-specific configuration for `reschedule_maintenance` + # @return [::Gapic::Config::Method] + # + attr_reader :reschedule_maintenance + + # @private + def initialize parent_rpcs = nil + list_instances_config = parent_rpcs.list_instances if parent_rpcs.respond_to? :list_instances + @list_instances = ::Gapic::Config::Method.new list_instances_config + get_instance_config = parent_rpcs.get_instance if parent_rpcs.respond_to? :get_instance + @get_instance = ::Gapic::Config::Method.new get_instance_config + get_instance_auth_string_config = parent_rpcs.get_instance_auth_string if parent_rpcs.respond_to? :get_instance_auth_string + @get_instance_auth_string = ::Gapic::Config::Method.new get_instance_auth_string_config + create_instance_config = parent_rpcs.create_instance if parent_rpcs.respond_to? :create_instance + @create_instance = ::Gapic::Config::Method.new create_instance_config + update_instance_config = parent_rpcs.update_instance if parent_rpcs.respond_to? :update_instance + @update_instance = ::Gapic::Config::Method.new update_instance_config + upgrade_instance_config = parent_rpcs.upgrade_instance if parent_rpcs.respond_to? :upgrade_instance + @upgrade_instance = ::Gapic::Config::Method.new upgrade_instance_config + import_instance_config = parent_rpcs.import_instance if parent_rpcs.respond_to? :import_instance + @import_instance = ::Gapic::Config::Method.new import_instance_config + export_instance_config = parent_rpcs.export_instance if parent_rpcs.respond_to? :export_instance + @export_instance = ::Gapic::Config::Method.new export_instance_config + failover_instance_config = parent_rpcs.failover_instance if parent_rpcs.respond_to? :failover_instance + @failover_instance = ::Gapic::Config::Method.new failover_instance_config + delete_instance_config = parent_rpcs.delete_instance if parent_rpcs.respond_to? :delete_instance + @delete_instance = ::Gapic::Config::Method.new delete_instance_config + reschedule_maintenance_config = parent_rpcs.reschedule_maintenance if parent_rpcs.respond_to? :reschedule_maintenance + @reschedule_maintenance = ::Gapic::Config::Method.new reschedule_maintenance_config + + yield self if block_given? + end + end + end + end + end + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-redis-v1beta1/lib/google/cloud/redis/v1beta1/cloud_redis/rest/operations.rb b/owl-bot-staging/google-cloud-redis-v1beta1/lib/google/cloud/redis/v1beta1/cloud_redis/rest/operations.rb new file mode 100644 index 000000000000..9a3cf4b317e2 --- /dev/null +++ b/owl-bot-staging/google-cloud-redis-v1beta1/lib/google/cloud/redis/v1beta1/cloud_redis/rest/operations.rb @@ -0,0 +1,924 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +require "gapic/operation" + +module Google + module Cloud + module Redis + module V1beta1 + module CloudRedis + module Rest + # Service that implements Longrunning Operations API. + class Operations + # @private + API_VERSION = "" + + # @private + DEFAULT_ENDPOINT_TEMPLATE = "redis.$UNIVERSE_DOMAIN$" + + # @private + attr_reader :operations_stub + + ## + # Configuration for the CloudRedis 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 CloudRedis 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::Redis::V1beta1::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::Redis::V1beta1::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::Redis::V1beta1::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::Redis::V1beta1::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 = "redis.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: "/v1beta1/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the get_operation REST call + # + # @param request_pb [::Google::Longrunning::GetOperationRequest] + # A request object representing the call parameters. Required. + # @return [Array(String, [String, nil], Hash{String => String})] + # Uri, Body, Query string parameters + def self.transcode_get_operation_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :get, + uri_template: "/v1beta1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/operations/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the delete_operation REST call + # + # @param request_pb [::Google::Longrunning::DeleteOperationRequest] + # A request object representing the call parameters. Required. + # @return [Array(String, [String, nil], Hash{String => String})] + # Uri, Body, Query string parameters + def self.transcode_delete_operation_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :delete, + uri_template: "/v1beta1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/operations/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the cancel_operation REST call + # + # @param request_pb [::Google::Longrunning::CancelOperationRequest] + # A request object representing the call parameters. Required. + # @return [Array(String, [String, nil], Hash{String => String})] + # Uri, Body, Query string parameters + def self.transcode_cancel_operation_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :post, + uri_template: "/v1beta1/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/operations/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + end + end + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-redis-v1beta1/lib/google/cloud/redis/v1beta1/cloud_redis/rest/service_stub.rb b/owl-bot-staging/google-cloud-redis-v1beta1/lib/google/cloud/redis/v1beta1/cloud_redis/rest/service_stub.rb new file mode 100644 index 000000000000..ff11c8a384e4 --- /dev/null +++ b/owl-bot-staging/google-cloud-redis-v1beta1/lib/google/cloud/redis/v1beta1/cloud_redis/rest/service_stub.rb @@ -0,0 +1,759 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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/redis/v1beta1/cloud_redis_pb" + +module Google + module Cloud + module Redis + module V1beta1 + module CloudRedis + module Rest + ## + # REST service stub for the CloudRedis service. + # Service stub contains baseline method implementations + # including transcoding, making the REST call, and deserialing the response. + # + class ServiceStub + # @private + def initialize endpoint:, endpoint_template:, universe_domain:, credentials:, logger: + # These require statements are intentionally placed here to initialize + # the REST modules only when it's required. + require "gapic/rest" + + @client_stub = ::Gapic::Rest::ClientStub.new endpoint: endpoint, + endpoint_template: endpoint_template, + universe_domain: universe_domain, + credentials: credentials, + numeric_enums: true, + service_name: self.class, + raise_faraday_errors: false, + logger: logger + end + + ## + # The effective universe domain + # + # @return [String] + # + def universe_domain + @client_stub.universe_domain + end + + ## + # The effective endpoint + # + # @return [String] + # + def endpoint + @client_stub.endpoint + end + + ## + # The logger used for request/response debug logging. + # + # @return [Logger] + # + def logger stub: false + stub ? @client_stub.stub_logger : @client_stub.logger + end + + ## + # Baseline implementation for the list_instances REST call + # + # @param request_pb [::Google::Cloud::Redis::V1beta1::ListInstancesRequest] + # A request object representing the call parameters. Required. + # @param options [::Gapic::CallOptions] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Cloud::Redis::V1beta1::ListInstancesResponse] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::Redis::V1beta1::ListInstancesResponse] + # A result object deserialized from the server's reply + def list_instances request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_list_instances_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_instances", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Cloud::Redis::V1beta1::ListInstancesResponse.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_instance REST call + # + # @param request_pb [::Google::Cloud::Redis::V1beta1::GetInstanceRequest] + # A request object representing the call parameters. Required. + # @param options [::Gapic::CallOptions] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Cloud::Redis::V1beta1::Instance] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::Redis::V1beta1::Instance] + # A result object deserialized from the server's reply + def get_instance request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_get_instance_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_instance", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Cloud::Redis::V1beta1::Instance.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_instance_auth_string REST call + # + # @param request_pb [::Google::Cloud::Redis::V1beta1::GetInstanceAuthStringRequest] + # A request object representing the call parameters. Required. + # @param options [::Gapic::CallOptions] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Cloud::Redis::V1beta1::InstanceAuthString] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::Redis::V1beta1::InstanceAuthString] + # A result object deserialized from the server's reply + def get_instance_auth_string request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_get_instance_auth_string_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_instance_auth_string", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Cloud::Redis::V1beta1::InstanceAuthString.decode_json response.body, ignore_unknown_fields: true + catch :response do + yield result, operation if block_given? + result + end + end + + ## + # Baseline implementation for the create_instance REST call + # + # @param request_pb [::Google::Cloud::Redis::V1beta1::CreateInstanceRequest] + # 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_instance request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_create_instance_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_instance", + 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 update_instance REST call + # + # @param request_pb [::Google::Cloud::Redis::V1beta1::UpdateInstanceRequest] + # 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_instance request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_update_instance_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_instance", + 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 upgrade_instance REST call + # + # @param request_pb [::Google::Cloud::Redis::V1beta1::UpgradeInstanceRequest] + # 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 upgrade_instance request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_upgrade_instance_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: "upgrade_instance", + 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 import_instance REST call + # + # @param request_pb [::Google::Cloud::Redis::V1beta1::ImportInstanceRequest] + # 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 import_instance request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_import_instance_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: "import_instance", + 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 export_instance REST call + # + # @param request_pb [::Google::Cloud::Redis::V1beta1::ExportInstanceRequest] + # 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 export_instance request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_export_instance_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: "export_instance", + 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 failover_instance REST call + # + # @param request_pb [::Google::Cloud::Redis::V1beta1::FailoverInstanceRequest] + # 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 failover_instance request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_failover_instance_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: "failover_instance", + 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_instance REST call + # + # @param request_pb [::Google::Cloud::Redis::V1beta1::DeleteInstanceRequest] + # 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_instance request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_delete_instance_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_instance", + 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 reschedule_maintenance REST call + # + # @param request_pb [::Google::Cloud::Redis::V1beta1::RescheduleMaintenanceRequest] + # 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 reschedule_maintenance request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_reschedule_maintenance_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: "reschedule_maintenance", + 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 + + ## + # @private + # + # GRPC transcoding helper method for the list_instances REST call + # + # @param request_pb [::Google::Cloud::Redis::V1beta1::ListInstancesRequest] + # 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_instances_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :get, + uri_template: "/v1beta1/{parent}/instances", + matches: [ + ["parent", %r{^projects/[^/]+/locations/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the get_instance REST call + # + # @param request_pb [::Google::Cloud::Redis::V1beta1::GetInstanceRequest] + # 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_instance_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :get, + uri_template: "/v1beta1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/instances/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the get_instance_auth_string REST call + # + # @param request_pb [::Google::Cloud::Redis::V1beta1::GetInstanceAuthStringRequest] + # 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_instance_auth_string_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :get, + uri_template: "/v1beta1/{name}/authString", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/instances/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the create_instance REST call + # + # @param request_pb [::Google::Cloud::Redis::V1beta1::CreateInstanceRequest] + # 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_instance_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :post, + uri_template: "/v1beta1/{parent}/instances", + body: "instance", + matches: [ + ["parent", %r{^projects/[^/]+/locations/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the update_instance REST call + # + # @param request_pb [::Google::Cloud::Redis::V1beta1::UpdateInstanceRequest] + # 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_instance_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :patch, + uri_template: "/v1beta1/{instance.name}", + body: "instance", + matches: [ + ["instance.name", %r{^projects/[^/]+/locations/[^/]+/instances/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the upgrade_instance REST call + # + # @param request_pb [::Google::Cloud::Redis::V1beta1::UpgradeInstanceRequest] + # A request object representing the call parameters. Required. + # @return [Array(String, [String, nil], Hash{String => String})] + # Uri, Body, Query string parameters + def self.transcode_upgrade_instance_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :post, + uri_template: "/v1beta1/{name}:upgrade", + body: "*", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/instances/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the import_instance REST call + # + # @param request_pb [::Google::Cloud::Redis::V1beta1::ImportInstanceRequest] + # A request object representing the call parameters. Required. + # @return [Array(String, [String, nil], Hash{String => String})] + # Uri, Body, Query string parameters + def self.transcode_import_instance_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :post, + uri_template: "/v1beta1/{name}:import", + body: "*", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/instances/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the export_instance REST call + # + # @param request_pb [::Google::Cloud::Redis::V1beta1::ExportInstanceRequest] + # A request object representing the call parameters. Required. + # @return [Array(String, [String, nil], Hash{String => String})] + # Uri, Body, Query string parameters + def self.transcode_export_instance_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :post, + uri_template: "/v1beta1/{name}:export", + body: "*", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/instances/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the failover_instance REST call + # + # @param request_pb [::Google::Cloud::Redis::V1beta1::FailoverInstanceRequest] + # A request object representing the call parameters. Required. + # @return [Array(String, [String, nil], Hash{String => String})] + # Uri, Body, Query string parameters + def self.transcode_failover_instance_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :post, + uri_template: "/v1beta1/{name}:failover", + body: "*", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/instances/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the delete_instance REST call + # + # @param request_pb [::Google::Cloud::Redis::V1beta1::DeleteInstanceRequest] + # 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_instance_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :delete, + uri_template: "/v1beta1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/instances/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the reschedule_maintenance REST call + # + # @param request_pb [::Google::Cloud::Redis::V1beta1::RescheduleMaintenanceRequest] + # A request object representing the call parameters. Required. + # @return [Array(String, [String, nil], Hash{String => String})] + # Uri, Body, Query string parameters + def self.transcode_reschedule_maintenance_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :post, + uri_template: "/v1beta1/{name}:rescheduleMaintenance", + body: "*", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/instances/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + end + end + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-redis-v1beta1/lib/google/cloud/redis/v1beta1/cloud_redis_pb.rb b/owl-bot-staging/google-cloud-redis-v1beta1/lib/google/cloud/redis/v1beta1/cloud_redis_pb.rb new file mode 100644 index 000000000000..bfd14c1a2dc4 --- /dev/null +++ b/owl-bot-staging/google-cloud-redis-v1beta1/lib/google/cloud/redis/v1beta1/cloud_redis_pb.rb @@ -0,0 +1,66 @@ +# frozen_string_literal: true +# Generated by the protocol buffer compiler. DO NOT EDIT! +# source: google/cloud/redis/v1beta1/cloud_redis.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/longrunning/operations_pb' +require 'google/protobuf/duration_pb' +require 'google/protobuf/field_mask_pb' +require 'google/protobuf/timestamp_pb' +require 'google/type/dayofweek_pb' +require 'google/type/timeofday_pb' + + +descriptor_data = "\n,google/cloud/redis/v1beta1/cloud_redis.proto\x12\x1agoogle.cloud.redis.v1beta1\x1a\x1cgoogle/api/annotations.proto\x1a\x17google/api/client.proto\x1a\x1fgoogle/api/field_behavior.proto\x1a\x19google/api/resource.proto\x1a#google/longrunning/operations.proto\x1a\x1egoogle/protobuf/duration.proto\x1a google/protobuf/field_mask.proto\x1a\x1fgoogle/protobuf/timestamp.proto\x1a\x1bgoogle/type/dayofweek.proto\x1a\x1bgoogle/type/timeofday.proto\".\n\x08NodeInfo\x12\x0f\n\x02id\x18\x01 \x01(\tB\x03\xe0\x41\x03\x12\x11\n\x04zone\x18\x02 \x01(\tB\x03\xe0\x41\x03\"\xa5\x11\n\x08Instance\x12\x11\n\x04name\x18\x01 \x01(\tB\x03\xe0\x41\x02\x12\x14\n\x0c\x64isplay_name\x18\x02 \x01(\t\x12@\n\x06labels\x18\x03 \x03(\x0b\x32\x30.google.cloud.redis.v1beta1.Instance.LabelsEntry\x12\x18\n\x0blocation_id\x18\x04 \x01(\tB\x03\xe0\x41\x01\x12$\n\x17\x61lternative_location_id\x18\x05 \x01(\tB\x03\xe0\x41\x01\x12\x1a\n\rredis_version\x18\x07 \x01(\tB\x03\xe0\x41\x01\x12\x1e\n\x11reserved_ip_range\x18\t \x01(\tB\x03\xe0\x41\x01\x12\x1f\n\x12secondary_ip_range\x18\x1e \x01(\tB\x03\xe0\x41\x01\x12\x11\n\x04host\x18\n \x01(\tB\x03\xe0\x41\x03\x12\x11\n\x04port\x18\x0b \x01(\x05\x42\x03\xe0\x41\x03\x12 \n\x13\x63urrent_location_id\x18\x0c \x01(\tB\x03\xe0\x41\x03\x12\x34\n\x0b\x63reate_time\x18\r \x01(\x0b\x32\x1a.google.protobuf.TimestampB\x03\xe0\x41\x03\x12>\n\x05state\x18\x0e \x01(\x0e\x32*.google.cloud.redis.v1beta1.Instance.StateB\x03\xe0\x41\x03\x12\x1b\n\x0estatus_message\x18\x0f \x01(\tB\x03\xe0\x41\x03\x12R\n\rredis_configs\x18\x10 \x03(\x0b\x32\x36.google.cloud.redis.v1beta1.Instance.RedisConfigsEntryB\x03\xe0\x41\x01\x12<\n\x04tier\x18\x11 \x01(\x0e\x32).google.cloud.redis.v1beta1.Instance.TierB\x03\xe0\x41\x02\x12\x1b\n\x0ememory_size_gb\x18\x12 \x01(\x05\x42\x03\xe0\x41\x02\x12\x1f\n\x12\x61uthorized_network\x18\x14 \x01(\tB\x03\xe0\x41\x01\x12%\n\x18persistence_iam_identity\x18\x15 \x01(\tB\x03\xe0\x41\x03\x12K\n\x0c\x63onnect_mode\x18\x16 \x01(\x0e\x32\x30.google.cloud.redis.v1beta1.Instance.ConnectModeB\x03\xe0\x41\x01\x12\x19\n\x0c\x61uth_enabled\x18\x17 \x01(\x08\x42\x03\xe0\x41\x01\x12H\n\x0fserver_ca_certs\x18\x19 \x03(\x0b\x32*.google.cloud.redis.v1beta1.TlsCertificateB\x03\xe0\x41\x03\x12`\n\x17transit_encryption_mode\x18\x1a \x01(\x0e\x32:.google.cloud.redis.v1beta1.Instance.TransitEncryptionModeB\x03\xe0\x41\x01\x12N\n\x12maintenance_policy\x18\x1b \x01(\x0b\x32-.google.cloud.redis.v1beta1.MaintenancePolicyB\x03\xe0\x41\x01\x12R\n\x14maintenance_schedule\x18\x1c \x01(\x0b\x32/.google.cloud.redis.v1beta1.MaintenanceScheduleB\x03\xe0\x41\x03\x12\x1a\n\rreplica_count\x18\x1f \x01(\x05\x42\x03\xe0\x41\x01\x12\x38\n\x05nodes\x18 \x03(\x0b\x32$.google.cloud.redis.v1beta1.NodeInfoB\x03\xe0\x41\x03\x12\x1a\n\rread_endpoint\x18! \x01(\tB\x03\xe0\x41\x03\x12\x1f\n\x12read_endpoint_port\x18\" \x01(\x05\x42\x03\xe0\x41\x03\x12V\n\x12read_replicas_mode\x18# \x01(\x0e\x32\x35.google.cloud.redis.v1beta1.Instance.ReadReplicasModeB\x03\xe0\x41\x01\x12N\n\x12persistence_config\x18% \x01(\x0b\x32-.google.cloud.redis.v1beta1.PersistenceConfigB\x03\xe0\x41\x01\x1a-\n\x0bLabelsEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12\r\n\x05value\x18\x02 \x01(\t:\x02\x38\x01\x1a\x33\n\x11RedisConfigsEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12\r\n\x05value\x18\x02 \x01(\t:\x02\x38\x01\"\x94\x01\n\x05State\x12\x15\n\x11STATE_UNSPECIFIED\x10\x00\x12\x0c\n\x08\x43REATING\x10\x01\x12\t\n\x05READY\x10\x02\x12\x0c\n\x08UPDATING\x10\x03\x12\x0c\n\x08\x44\x45LETING\x10\x04\x12\r\n\tREPAIRING\x10\x05\x12\x0f\n\x0bMAINTENANCE\x10\x06\x12\r\n\tIMPORTING\x10\x08\x12\x10\n\x0c\x46\x41ILING_OVER\x10\n\"8\n\x04Tier\x12\x14\n\x10TIER_UNSPECIFIED\x10\x00\x12\t\n\x05\x42\x41SIC\x10\x01\x12\x0f\n\x0bSTANDARD_HA\x10\x03\"[\n\x0b\x43onnectMode\x12\x1c\n\x18\x43ONNECT_MODE_UNSPECIFIED\x10\x00\x12\x12\n\x0e\x44IRECT_PEERING\x10\x01\x12\x1a\n\x16PRIVATE_SERVICE_ACCESS\x10\x02\"i\n\x15TransitEncryptionMode\x12\'\n#TRANSIT_ENCRYPTION_MODE_UNSPECIFIED\x10\x00\x12\x19\n\x15SERVER_AUTHENTICATION\x10\x01\x12\x0c\n\x08\x44ISABLED\x10\x02\"m\n\x10ReadReplicasMode\x12\"\n\x1eREAD_REPLICAS_MODE_UNSPECIFIED\x10\x00\x12\x1a\n\x16READ_REPLICAS_DISABLED\x10\x01\x12\x19\n\x15READ_REPLICAS_ENABLED\x10\x02:`\xea\x41]\n\x1dredis.googleapis.com/Instance\x12\"2/v1beta1/{parent=projects/*/locations/*}/instances:\x08instance\x12\x86\x02\n\x0eUpdateInstance\x12\x31.google.cloud.redis.v1beta1.UpdateInstanceRequest\x1a\x1d.google.longrunning.Operation\"\xa1\x01\xca\x41:\n#google.cloud.redis.v1beta1.Instance\x12\x13google.protobuf.Any\xda\x41\x14update_mask,instance\x82\xd3\xe4\x93\x02G2;/v1beta1/{instance.name=projects/*/locations/*/instances/*}:\x08instance\x12\xfe\x01\n\x0fUpgradeInstance\x12\x32.google.cloud.redis.v1beta1.UpgradeInstanceRequest\x1a\x1d.google.longrunning.Operation\"\x97\x01\xca\x41:\n#google.cloud.redis.v1beta1.Instance\x12\x13google.protobuf.Any\xda\x41\x12name,redis_version\x82\xd3\xe4\x93\x02?\":/v1beta1/{name=projects/*/locations/*/instances/*}:upgrade:\x01*\x12\xfa\x01\n\x0eImportInstance\x12\x31.google.cloud.redis.v1beta1.ImportInstanceRequest\x1a\x1d.google.longrunning.Operation\"\x95\x01\xca\x41:\n#google.cloud.redis.v1beta1.Instance\x12\x13google.protobuf.Any\xda\x41\x11name,input_config\x82\xd3\xe4\x93\x02>\"9/v1beta1/{name=projects/*/locations/*/instances/*}:import:\x01*\x12\xfb\x01\n\x0e\x45xportInstance\x12\x31.google.cloud.redis.v1beta1.ExportInstanceRequest\x1a\x1d.google.longrunning.Operation\"\x96\x01\xca\x41:\n#google.cloud.redis.v1beta1.Instance\x12\x13google.protobuf.Any\xda\x41\x12name,output_config\x82\xd3\xe4\x93\x02>\"9/v1beta1/{name=projects/*/locations/*/instances/*}:export:\x01*\x12\x88\x02\n\x10\x46\x61iloverInstance\x12\x33.google.cloud.redis.v1beta1.FailoverInstanceRequest\x1a\x1d.google.longrunning.Operation\"\x9f\x01\xca\x41:\n#google.cloud.redis.v1beta1.Instance\x12\x13google.protobuf.Any\xda\x41\x19name,data_protection_mode\x82\xd3\xe4\x93\x02@\";/v1beta1/{name=projects/*/locations/*/instances/*}:failover:\x01*\x12\xd4\x01\n\x0e\x44\x65leteInstance\x12\x31.google.cloud.redis.v1beta1.DeleteInstanceRequest\x1a\x1d.google.longrunning.Operation\"p\xca\x41,\n\x15google.protobuf.Empty\x12\x13google.protobuf.Any\xda\x41\x04name\x82\xd3\xe4\x93\x02\x34*2/v1beta1/{name=projects/*/locations/*/instances/*}\x12\xaa\x02\n\x15RescheduleMaintenance\x12\x38.google.cloud.redis.v1beta1.RescheduleMaintenanceRequest\x1a\x1d.google.longrunning.Operation\"\xb7\x01\xca\x41:\n#google.cloud.redis.v1beta1.Instance\x12\x13google.protobuf.Any\xda\x41$name, reschedule_type, schedule_time\x82\xd3\xe4\x93\x02M\"H/v1beta1/{name=projects/*/locations/*/instances/*}:rescheduleMaintenance:\x01*\x1aH\xca\x41\x14redis.googleapis.com\xd2\x41.https://www.googleapis.com/auth/cloud-platformBt\n\x1e\x63om.google.cloud.redis.v1beta1B\x1a\x43loudRedisServiceBetaProtoP\x01Z4cloud.google.com/go/redis/apiv1beta1/redispb;redispbb\x06proto3" + +pool = ::Google::Protobuf::DescriptorPool.generated_pool +pool.add_serialized_file(descriptor_data) + +module Google + module Cloud + module Redis + module V1beta1 + NodeInfo = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.redis.v1beta1.NodeInfo").msgclass + Instance = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.redis.v1beta1.Instance").msgclass + Instance::State = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.redis.v1beta1.Instance.State").enummodule + Instance::Tier = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.redis.v1beta1.Instance.Tier").enummodule + Instance::ConnectMode = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.redis.v1beta1.Instance.ConnectMode").enummodule + Instance::TransitEncryptionMode = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.redis.v1beta1.Instance.TransitEncryptionMode").enummodule + Instance::ReadReplicasMode = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.redis.v1beta1.Instance.ReadReplicasMode").enummodule + PersistenceConfig = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.redis.v1beta1.PersistenceConfig").msgclass + PersistenceConfig::PersistenceMode = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.redis.v1beta1.PersistenceConfig.PersistenceMode").enummodule + PersistenceConfig::SnapshotPeriod = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.redis.v1beta1.PersistenceConfig.SnapshotPeriod").enummodule + RescheduleMaintenanceRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.redis.v1beta1.RescheduleMaintenanceRequest").msgclass + RescheduleMaintenanceRequest::RescheduleType = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.redis.v1beta1.RescheduleMaintenanceRequest.RescheduleType").enummodule + MaintenancePolicy = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.redis.v1beta1.MaintenancePolicy").msgclass + WeeklyMaintenanceWindow = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.redis.v1beta1.WeeklyMaintenanceWindow").msgclass + MaintenanceSchedule = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.redis.v1beta1.MaintenanceSchedule").msgclass + ListInstancesRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.redis.v1beta1.ListInstancesRequest").msgclass + ListInstancesResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.redis.v1beta1.ListInstancesResponse").msgclass + GetInstanceRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.redis.v1beta1.GetInstanceRequest").msgclass + GetInstanceAuthStringRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.redis.v1beta1.GetInstanceAuthStringRequest").msgclass + InstanceAuthString = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.redis.v1beta1.InstanceAuthString").msgclass + CreateInstanceRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.redis.v1beta1.CreateInstanceRequest").msgclass + UpdateInstanceRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.redis.v1beta1.UpdateInstanceRequest").msgclass + UpgradeInstanceRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.redis.v1beta1.UpgradeInstanceRequest").msgclass + DeleteInstanceRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.redis.v1beta1.DeleteInstanceRequest").msgclass + GcsSource = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.redis.v1beta1.GcsSource").msgclass + InputConfig = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.redis.v1beta1.InputConfig").msgclass + ImportInstanceRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.redis.v1beta1.ImportInstanceRequest").msgclass + GcsDestination = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.redis.v1beta1.GcsDestination").msgclass + OutputConfig = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.redis.v1beta1.OutputConfig").msgclass + ExportInstanceRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.redis.v1beta1.ExportInstanceRequest").msgclass + FailoverInstanceRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.redis.v1beta1.FailoverInstanceRequest").msgclass + FailoverInstanceRequest::DataProtectionMode = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.redis.v1beta1.FailoverInstanceRequest.DataProtectionMode").enummodule + LocationMetadata = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.redis.v1beta1.LocationMetadata").msgclass + ZoneMetadata = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.redis.v1beta1.ZoneMetadata").msgclass + TlsCertificate = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.redis.v1beta1.TlsCertificate").msgclass + end + end + end +end diff --git a/owl-bot-staging/google-cloud-redis-v1beta1/lib/google/cloud/redis/v1beta1/cloud_redis_services_pb.rb b/owl-bot-staging/google-cloud-redis-v1beta1/lib/google/cloud/redis/v1beta1/cloud_redis_services_pb.rb new file mode 100644 index 000000000000..e52d7a5939b8 --- /dev/null +++ b/owl-bot-staging/google-cloud-redis-v1beta1/lib/google/cloud/redis/v1beta1/cloud_redis_services_pb.rb @@ -0,0 +1,120 @@ +# Generated by the protocol buffer compiler. DO NOT EDIT! +# Source: google/cloud/redis/v1beta1/cloud_redis.proto for package 'google.cloud.redis.v1beta1' +# Original file comments: +# 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 +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# + +require 'grpc' +require 'google/cloud/redis/v1beta1/cloud_redis_pb' + +module Google + module Cloud + module Redis + module V1beta1 + module CloudRedis + # Configures and manages Cloud Memorystore for Redis instances + # + # Google Cloud Memorystore for Redis v1beta1 + # + # The `redis.googleapis.com` service implements the Google Cloud Memorystore + # for Redis API and defines the following resource model for managing Redis + # instances: + # * The service works with a collection of cloud projects, named: `/projects/*` + # * Each project has a collection of available locations, named: `/locations/*` + # * Each location has a collection of Redis instances, named: `/instances/*` + # * As such, Redis instances are resources of the form: + # `/projects/{project_id}/locations/{location_id}/instances/{instance_id}` + # + # Note that location_id must be referring to a GCP `region`; for example: + # * `projects/redpepper-1290/locations/us-central1/instances/my-redis` + class Service + + include ::GRPC::GenericService + + self.marshal_class_method = :encode + self.unmarshal_class_method = :decode + self.service_name = 'google.cloud.redis.v1beta1.CloudRedis' + + # Lists all Redis instances owned by a project in either the specified + # location (region) or all locations. + # + # The location should have the following format: + # + # * `projects/{project_id}/locations/{location_id}` + # + # If `location_id` is specified as `-` (wildcard), then all regions + # available to the project are queried, and the results are aggregated. + rpc :ListInstances, ::Google::Cloud::Redis::V1beta1::ListInstancesRequest, ::Google::Cloud::Redis::V1beta1::ListInstancesResponse + # Gets the details of a specific Redis instance. + rpc :GetInstance, ::Google::Cloud::Redis::V1beta1::GetInstanceRequest, ::Google::Cloud::Redis::V1beta1::Instance + # Gets the AUTH string for a Redis instance. If AUTH is not enabled for the + # instance the response will be empty. This information is not included in + # the details returned to GetInstance. + rpc :GetInstanceAuthString, ::Google::Cloud::Redis::V1beta1::GetInstanceAuthStringRequest, ::Google::Cloud::Redis::V1beta1::InstanceAuthString + # Creates a Redis instance based on the specified tier and memory size. + # + # By default, the instance is accessible from the project's + # [default network](https://cloud.google.com/vpc/docs/vpc). + # + # The creation is executed asynchronously and callers may check the returned + # operation to track its progress. Once the operation is completed the Redis + # instance will be fully functional. The completed longrunning.Operation will + # contain the new instance object in the response field. + # + # The returned operation is automatically deleted after a few hours, so there + # is no need to call DeleteOperation. + rpc :CreateInstance, ::Google::Cloud::Redis::V1beta1::CreateInstanceRequest, ::Google::Longrunning::Operation + # Updates the metadata and configuration of a specific Redis instance. + # + # Completed longrunning.Operation will contain the new instance object + # in the response field. The returned operation is automatically deleted + # after a few hours, so there is no need to call DeleteOperation. + rpc :UpdateInstance, ::Google::Cloud::Redis::V1beta1::UpdateInstanceRequest, ::Google::Longrunning::Operation + # Upgrades Redis instance to the newer Redis version specified in the + # request. + rpc :UpgradeInstance, ::Google::Cloud::Redis::V1beta1::UpgradeInstanceRequest, ::Google::Longrunning::Operation + # Import a Redis RDB snapshot file from Cloud Storage into a Redis instance. + # + # Redis may stop serving during this operation. Instance state will be + # IMPORTING for entire operation. When complete, the instance will contain + # only data from the imported file. + # + # The returned operation is automatically deleted after a few hours, so + # there is no need to call DeleteOperation. + rpc :ImportInstance, ::Google::Cloud::Redis::V1beta1::ImportInstanceRequest, ::Google::Longrunning::Operation + # Export Redis instance data into a Redis RDB format file in Cloud Storage. + # + # Redis will continue serving during this operation. + # + # The returned operation is automatically deleted after a few hours, so + # there is no need to call DeleteOperation. + rpc :ExportInstance, ::Google::Cloud::Redis::V1beta1::ExportInstanceRequest, ::Google::Longrunning::Operation + # Initiates a failover of the primary node to current replica node for a + # specific STANDARD tier Cloud Memorystore for Redis instance. + rpc :FailoverInstance, ::Google::Cloud::Redis::V1beta1::FailoverInstanceRequest, ::Google::Longrunning::Operation + # Deletes a specific Redis instance. Instance stops serving and data is + # deleted. + rpc :DeleteInstance, ::Google::Cloud::Redis::V1beta1::DeleteInstanceRequest, ::Google::Longrunning::Operation + # Reschedule maintenance for a given instance in a given project and + # location. + rpc :RescheduleMaintenance, ::Google::Cloud::Redis::V1beta1::RescheduleMaintenanceRequest, ::Google::Longrunning::Operation + end + + Stub = Service.rpc_stub_class + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-redis-v1beta1/lib/google/cloud/redis/v1beta1/rest.rb b/owl-bot-staging/google-cloud-redis-v1beta1/lib/google/cloud/redis/v1beta1/rest.rb new file mode 100644 index 000000000000..9b35e0aedb1c --- /dev/null +++ b/owl-bot-staging/google-cloud-redis-v1beta1/lib/google/cloud/redis/v1beta1/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/cloud/redis/v1beta1/cloud_redis/rest" +require "google/cloud/redis/v1beta1/version" + +module Google + module Cloud + module Redis + ## + # To load just the REST part of this package, including all its services, and instantiate a REST client: + # + # @example + # + # require "google/cloud/redis/v1beta1/rest" + # client = ::Google::Cloud::Redis::V1beta1::CloudRedis::Rest::Client.new + # + module V1beta1 + end + end + end +end diff --git a/owl-bot-staging/google-cloud-redis-v1beta1/lib/google/cloud/redis/v1beta1/version.rb b/owl-bot-staging/google-cloud-redis-v1beta1/lib/google/cloud/redis/v1beta1/version.rb new file mode 100644 index 000000000000..9b449a992d22 --- /dev/null +++ b/owl-bot-staging/google-cloud-redis-v1beta1/lib/google/cloud/redis/v1beta1/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 Redis + module V1beta1 + VERSION = "0.0.1" + end + end + end +end diff --git a/owl-bot-staging/google-cloud-redis-v1beta1/proto_docs/README.md b/owl-bot-staging/google-cloud-redis-v1beta1/proto_docs/README.md new file mode 100644 index 000000000000..943c27706d6a --- /dev/null +++ b/owl-bot-staging/google-cloud-redis-v1beta1/proto_docs/README.md @@ -0,0 +1,4 @@ +# Google Cloud Memorystore for Redis V1beta1 Protocol Buffer Documentation + +These files are for the YARD documentation of the generated protobuf files. +They are not intended to be required or loaded at runtime. diff --git a/owl-bot-staging/google-cloud-redis-v1beta1/proto_docs/google/api/client.rb b/owl-bot-staging/google-cloud-redis-v1beta1/proto_docs/google/api/client.rb new file mode 100644 index 000000000000..5089551e9ea4 --- /dev/null +++ b/owl-bot-staging/google-cloud-redis-v1beta1/proto_docs/google/api/client.rb @@ -0,0 +1,589 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + + +module Google + module Api + # Required information for every language. + # @!attribute [rw] reference_docs_uri + # @deprecated This field is deprecated and may be removed in the next major version update. + # @return [::String] + # Link to automatically generated reference documentation. Example: + # https://cloud.google.com/nodejs/docs/reference/asset/latest + # @!attribute [rw] destinations + # @return [::Array<::Google::Api::ClientLibraryDestination>] + # The destination where API teams want this client library to be published. + # @!attribute [rw] selective_gapic_generation + # @return [::Google::Api::SelectiveGapicGeneration] + # Configuration for which RPCs should be generated in the GAPIC client. + class CommonLanguageSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Details about how and where to publish client libraries. + # @!attribute [rw] version + # @return [::String] + # Version of the API to apply these settings to. This is the full protobuf + # package for the API, ending in the version element. + # Examples: "google.cloud.speech.v1" and "google.spanner.admin.database.v1". + # @!attribute [rw] launch_stage + # @return [::Google::Api::LaunchStage] + # Launch stage of this version of the API. + # @!attribute [rw] rest_numeric_enums + # @return [::Boolean] + # When using transport=rest, the client request will encode enums as + # numbers rather than strings. + # @!attribute [rw] java_settings + # @return [::Google::Api::JavaSettings] + # Settings for legacy Java features, supported in the Service YAML. + # @!attribute [rw] cpp_settings + # @return [::Google::Api::CppSettings] + # Settings for C++ client libraries. + # @!attribute [rw] php_settings + # @return [::Google::Api::PhpSettings] + # Settings for PHP client libraries. + # @!attribute [rw] python_settings + # @return [::Google::Api::PythonSettings] + # Settings for Python client libraries. + # @!attribute [rw] node_settings + # @return [::Google::Api::NodeSettings] + # Settings for Node client libraries. + # @!attribute [rw] dotnet_settings + # @return [::Google::Api::DotnetSettings] + # Settings for .NET client libraries. + # @!attribute [rw] ruby_settings + # @return [::Google::Api::RubySettings] + # Settings for Ruby client libraries. + # @!attribute [rw] go_settings + # @return [::Google::Api::GoSettings] + # Settings for Go client libraries. + class ClientLibrarySettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # This message configures the settings for publishing [Google Cloud Client + # libraries](https://cloud.google.com/apis/docs/cloud-client-libraries) + # generated from the service config. + # @!attribute [rw] method_settings + # @return [::Array<::Google::Api::MethodSettings>] + # A list of API method settings, e.g. the behavior for methods that use the + # long-running operation pattern. + # @!attribute [rw] new_issue_uri + # @return [::String] + # Link to a *public* URI where users can report issues. Example: + # https://issuetracker.google.com/issues/new?component=190865&template=1161103 + # @!attribute [rw] documentation_uri + # @return [::String] + # Link to product home page. Example: + # https://cloud.google.com/asset-inventory/docs/overview + # @!attribute [rw] api_short_name + # @return [::String] + # Used as a tracking tag when collecting data about the APIs developer + # relations artifacts like docs, packages delivered to package managers, + # etc. Example: "speech". + # @!attribute [rw] github_label + # @return [::String] + # GitHub label to apply to issues and pull requests opened for this API. + # @!attribute [rw] codeowner_github_teams + # @return [::Array<::String>] + # GitHub teams to be added to CODEOWNERS in the directory in GitHub + # containing source code for the client libraries for this API. + # @!attribute [rw] doc_tag_prefix + # @return [::String] + # A prefix used in sample code when demarking regions to be included in + # documentation. + # @!attribute [rw] organization + # @return [::Google::Api::ClientLibraryOrganization] + # For whom the client library is being published. + # @!attribute [rw] library_settings + # @return [::Array<::Google::Api::ClientLibrarySettings>] + # Client library settings. If the same version string appears multiple + # times in this list, then the last one wins. Settings from earlier + # settings with the same version string are discarded. + # @!attribute [rw] proto_reference_documentation_uri + # @return [::String] + # Optional link to proto reference documentation. Example: + # https://cloud.google.com/pubsub/lite/docs/reference/rpc + # @!attribute [rw] rest_reference_documentation_uri + # @return [::String] + # Optional link to REST reference documentation. Example: + # https://cloud.google.com/pubsub/lite/docs/reference/rest + class Publishing + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Settings for Java client libraries. + # @!attribute [rw] library_package + # @return [::String] + # The package name to use in Java. Clobbers the java_package option + # set in the protobuf. This should be used **only** by APIs + # who have already set the language_settings.java.package_name" field + # in gapic.yaml. API teams should use the protobuf java_package option + # where possible. + # + # Example of a YAML configuration:: + # + # publishing: + # 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. + # @!attribute [rw] methods + # @return [::Array<::String>] + # An allowlist of the fully qualified names of RPCs that should be included + # on public client surfaces. + # @!attribute [rw] generate_omitted_as_internal + # @return [::Boolean] + # Setting this to true indicates to the client generators that methods + # that would be excluded from the generation should instead be generated + # in a way that indicates these methods should not be consumed by + # end users. How this is expressed is up to individual language + # implementations to decide. Some examples may be: added annotations, + # obfuscated identifiers, or other language idiomatic patterns. + class SelectiveGapicGeneration + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # `BatchingConfigProto` defines the batching configuration for an API method. + # @!attribute [rw] thresholds + # @return [::Google::Api::BatchingSettingsProto] + # The thresholds which trigger a batched request to be sent. + # @!attribute [rw] batch_descriptor + # @return [::Google::Api::BatchingDescriptorProto] + # The request and response fields used in batching. + class BatchingConfigProto + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # `BatchingSettingsProto` specifies a set of batching thresholds, each of + # which acts as a trigger to send a batch of messages as a request. At least + # one threshold must be positive nonzero. + # @!attribute [rw] element_count_threshold + # @return [::Integer] + # The number of elements of a field collected into a batch which, if + # exceeded, causes the batch to be sent. + # @!attribute [rw] request_byte_threshold + # @return [::Integer] + # The aggregated size of the batched field which, if exceeded, causes the + # batch to be sent. This size is computed by aggregating the sizes of the + # request field to be batched, not of the entire request message. + # @!attribute [rw] delay_threshold + # @return [::Google::Protobuf::Duration] + # The duration after which a batch should be sent, starting from the addition + # of the first message to that batch. + # @!attribute [rw] element_count_limit + # @return [::Integer] + # The maximum number of elements collected in a batch that could be accepted + # by server. + # @!attribute [rw] request_byte_limit + # @return [::Integer] + # The maximum size of the request that could be accepted by server. + # @!attribute [rw] flow_control_element_limit + # @return [::Integer] + # The maximum number of elements allowed by flow control. + # @!attribute [rw] flow_control_byte_limit + # @return [::Integer] + # The maximum size of data allowed by flow control. + # @!attribute [rw] flow_control_limit_exceeded_behavior + # @return [::Google::Api::FlowControlLimitExceededBehaviorProto] + # The behavior to take when the flow control limit is exceeded. + class BatchingSettingsProto + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # `BatchingDescriptorProto` specifies the fields of the request message to be + # used for batching, and, optionally, the fields of the response message to be + # used for demultiplexing. + # @!attribute [rw] batched_field + # @return [::String] + # The repeated field in the request message to be aggregated by batching. + # @!attribute [rw] discriminator_fields + # @return [::Array<::String>] + # A list of the fields in the request message. Two requests will be batched + # together only if the values of every field specified in + # `request_discriminator_fields` is equal between the two requests. + # @!attribute [rw] subresponse_field + # @return [::String] + # Optional. When present, indicates the field in the response message to be + # used to demultiplex the response into multiple response messages, in + # correspondence with the multiple request messages originally batched + # together. + class BatchingDescriptorProto + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # The organization for which the client libraries are being published. + # Affects the url where generated docs are published, etc. + module ClientLibraryOrganization + # Not useful. + CLIENT_LIBRARY_ORGANIZATION_UNSPECIFIED = 0 + + # Google Cloud Platform Org. + CLOUD = 1 + + # Ads (Advertising) Org. + ADS = 2 + + # Photos Org. + PHOTOS = 3 + + # Street View Org. + STREET_VIEW = 4 + + # Shopping Org. + SHOPPING = 5 + + # Geo Org. + GEO = 6 + + # Generative AI - https://developers.generativeai.google + GENERATIVE_AI = 7 + end + + # To where should client libraries be published? + module ClientLibraryDestination + # Client libraries will neither be generated nor published to package + # managers. + CLIENT_LIBRARY_DESTINATION_UNSPECIFIED = 0 + + # Generate the client library in a repo under github.com/googleapis, + # but don't publish it to package managers. + GITHUB = 10 + + # Publish the library to package managers like nuget.org and npmjs.com. + PACKAGE_MANAGER = 20 + end + + # The behavior to take when the flow control limit is exceeded. + module FlowControlLimitExceededBehaviorProto + # Default behavior, system-defined. + UNSET_BEHAVIOR = 0 + + # Stop operation, raise error. + THROW_EXCEPTION = 1 + + # Pause operation until limit clears. + BLOCK = 2 + + # Continue operation, disregard limit. + IGNORE = 3 + end + end +end diff --git a/owl-bot-staging/google-cloud-redis-v1beta1/proto_docs/google/api/field_behavior.rb b/owl-bot-staging/google-cloud-redis-v1beta1/proto_docs/google/api/field_behavior.rb new file mode 100644 index 000000000000..582be187d115 --- /dev/null +++ b/owl-bot-staging/google-cloud-redis-v1beta1/proto_docs/google/api/field_behavior.rb @@ -0,0 +1,85 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + + +module Google + module Api + # An indicator of the behavior of a given field (for example, that a field + # is required in requests, or given as output but ignored as input). + # This **does not** change the behavior in protocol buffers itself; it only + # denotes the behavior and may affect how API tooling handles the field. + # + # Note: This enum **may** receive new values in the future. + module FieldBehavior + # Conventional default for enums. Do not use this. + FIELD_BEHAVIOR_UNSPECIFIED = 0 + + # Specifically denotes a field as optional. + # While all fields in protocol buffers are optional, this may be specified + # for emphasis if appropriate. + OPTIONAL = 1 + + # Denotes a field as required. + # This indicates that the field **must** be provided as part of the request, + # and failure to do so will cause an error (usually `INVALID_ARGUMENT`). + REQUIRED = 2 + + # Denotes a field as output only. + # This indicates that the field is provided in responses, but including the + # field in a request does nothing (the server *must* ignore it and + # *must not* throw an error as a result of the field's presence). + OUTPUT_ONLY = 3 + + # Denotes a field as input only. + # This indicates that the field is provided in requests, and the + # corresponding field is not included in output. + INPUT_ONLY = 4 + + # Denotes a field as immutable. + # This indicates that the field may be set once in a request to create a + # resource, but may not be changed thereafter. + IMMUTABLE = 5 + + # Denotes that a (repeated) field is an unordered list. + # This indicates that the service may provide the elements of the list + # in any arbitrary order, rather than the order the user originally + # provided. Additionally, the list's order may or may not be stable. + UNORDERED_LIST = 6 + + # Denotes that this field returns a non-empty default value if not set. + # This indicates that if the user provides the empty value in a request, + # a non-empty value will be returned. The user will not be aware of what + # non-empty value to expect. + NON_EMPTY_DEFAULT = 7 + + # Denotes that the field in a resource (a message annotated with + # google.api.resource) is used in the resource name to uniquely identify the + # resource. For AIP-compliant APIs, this should only be applied to the + # `name` field on the resource. + # + # This behavior should not be applied to references to other resources within + # the message. + # + # The identifier field of resources often have different field behavior + # depending on the request it is embedded in (e.g. for Create methods name + # is optional and unused, while for Update methods it is required). Instead + # of method-specific annotations, only `IDENTIFIER` is required. + IDENTIFIER = 8 + end + end +end diff --git a/owl-bot-staging/google-cloud-redis-v1beta1/proto_docs/google/api/launch_stage.rb b/owl-bot-staging/google-cloud-redis-v1beta1/proto_docs/google/api/launch_stage.rb new file mode 100644 index 000000000000..9392a413fb1b --- /dev/null +++ b/owl-bot-staging/google-cloud-redis-v1beta1/proto_docs/google/api/launch_stage.rb @@ -0,0 +1,71 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + + +module Google + module Api + # The launch stage as defined by [Google Cloud Platform + # Launch Stages](https://cloud.google.com/terms/launch-stages). + module LaunchStage + # Do not use this default value. + LAUNCH_STAGE_UNSPECIFIED = 0 + + # The feature is not yet implemented. Users can not use it. + UNIMPLEMENTED = 6 + + # Prelaunch features are hidden from users and are only visible internally. + PRELAUNCH = 7 + + # Early Access features are limited to a closed group of testers. To use + # these features, you must sign up in advance and sign a Trusted Tester + # agreement (which includes confidentiality provisions). These features may + # be unstable, changed in backward-incompatible ways, and are not + # guaranteed to be released. + EARLY_ACCESS = 1 + + # Alpha is a limited availability test for releases before they are cleared + # for widespread use. By Alpha, all significant design issues are resolved + # and we are in the process of verifying functionality. Alpha customers + # need to apply for access, agree to applicable terms, and have their + # projects allowlisted. Alpha releases don't have to be feature complete, + # no SLAs are provided, and there are no technical support obligations, but + # they will be far enough along that customers can actually use them in + # test environments or for limited-use tests -- just like they would in + # normal production cases. + ALPHA = 2 + + # Beta is the point at which we are ready to open a release for any + # customer to use. There are no SLA or technical support obligations in a + # Beta release. Products will be complete from a feature perspective, but + # may have some open outstanding issues. Beta releases are suitable for + # limited production use cases. + BETA = 3 + + # GA features are open to all developers and are considered stable and + # fully qualified for production use. + GA = 4 + + # Deprecated features are scheduled to be shut down and removed. For more + # information, see the "Deprecation Policy" section of our [Terms of + # Service](https://cloud.google.com/terms/) + # and the [Google Cloud Platform Subject to the Deprecation + # Policy](https://cloud.google.com/terms/deprecation) documentation. + DEPRECATED = 5 + end + end +end diff --git a/owl-bot-staging/google-cloud-redis-v1beta1/proto_docs/google/api/resource.rb b/owl-bot-staging/google-cloud-redis-v1beta1/proto_docs/google/api/resource.rb new file mode 100644 index 000000000000..25dec4847ac1 --- /dev/null +++ b/owl-bot-staging/google-cloud-redis-v1beta1/proto_docs/google/api/resource.rb @@ -0,0 +1,227 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + + +module Google + module Api + # A simple descriptor of a resource type. + # + # ResourceDescriptor annotates a resource message (either by means of a + # protobuf annotation or use in the service config), and associates the + # resource's schema, the resource type, and the pattern of the resource name. + # + # Example: + # + # message Topic { + # // Indicates this message defines a resource schema. + # // Declares the resource type in the format of {service}/{kind}. + # // For Kubernetes resources, the format is {api group}/{kind}. + # option (google.api.resource) = { + # type: "pubsub.googleapis.com/Topic" + # pattern: "projects/{project}/topics/{topic}" + # }; + # } + # + # The ResourceDescriptor Yaml config will look like: + # + # resources: + # - type: "pubsub.googleapis.com/Topic" + # pattern: "projects/{project}/topics/{topic}" + # + # Sometimes, resources have multiple patterns, typically because they can + # live under multiple parents. + # + # Example: + # + # message LogEntry { + # option (google.api.resource) = { + # type: "logging.googleapis.com/LogEntry" + # pattern: "projects/{project}/logs/{log}" + # pattern: "folders/{folder}/logs/{log}" + # pattern: "organizations/{organization}/logs/{log}" + # pattern: "billingAccounts/{billing_account}/logs/{log}" + # }; + # } + # + # The ResourceDescriptor Yaml config will look like: + # + # resources: + # - type: 'logging.googleapis.com/LogEntry' + # pattern: "projects/{project}/logs/{log}" + # pattern: "folders/{folder}/logs/{log}" + # pattern: "organizations/{organization}/logs/{log}" + # pattern: "billingAccounts/{billing_account}/logs/{log}" + # @!attribute [rw] type + # @return [::String] + # The resource type. It must be in the format of + # \\{service_name}/\\{resource_type_kind}. The `resource_type_kind` must be + # singular and must not include version numbers. + # + # Example: `storage.googleapis.com/Bucket` + # + # The value of the resource_type_kind must follow the regular expression + # /[A-Za-z][a-zA-Z0-9]+/. It should start with an upper case character and + # should use PascalCase (UpperCamelCase). The maximum number of + # characters allowed for the `resource_type_kind` is 100. + # @!attribute [rw] pattern + # @return [::Array<::String>] + # Optional. The relative resource name pattern associated with this resource + # type. The DNS prefix of the full resource name shouldn't be specified here. + # + # The path pattern must follow the syntax, which aligns with HTTP binding + # syntax: + # + # Template = Segment { "/" Segment } ; + # Segment = LITERAL | Variable ; + # Variable = "{" LITERAL "}" ; + # + # Examples: + # + # - "projects/\\{project}/topics/\\{topic}" + # - "projects/\\{project}/knowledgeBases/\\{knowledge_base}" + # + # The components in braces correspond to the IDs for each resource in the + # hierarchy. It is expected that, if multiple patterns are provided, + # the same component name (e.g. "project") refers to IDs of the same + # type of resource. + # @!attribute [rw] name_field + # @return [::String] + # Optional. The field on the resource that designates the resource name + # field. If omitted, this is assumed to be "name". + # @!attribute [rw] history + # @return [::Google::Api::ResourceDescriptor::History] + # Optional. The historical or future-looking state of the resource pattern. + # + # Example: + # + # // The InspectTemplate message originally only supported resource + # // names with organization, and project was added later. + # message InspectTemplate { + # option (google.api.resource) = { + # type: "dlp.googleapis.com/InspectTemplate" + # pattern: + # "organizations/{organization}/inspectTemplates/{inspect_template}" + # pattern: "projects/{project}/inspectTemplates/{inspect_template}" + # history: ORIGINALLY_SINGLE_PATTERN + # }; + # } + # @!attribute [rw] plural + # @return [::String] + # The plural name used in the resource name and permission names, such as + # 'projects' for the resource name of 'projects/\\{project}' and the permission + # name of 'cloudresourcemanager.googleapis.com/projects.get'. One exception + # to this is for Nested Collections that have stuttering names, as defined + # in [AIP-122](https://google.aip.dev/122#nested-collections), where the + # collection ID in the resource name pattern does not necessarily directly + # match the `plural` value. + # + # It is the same concept of the `plural` field in k8s CRD spec + # https://kubernetes.io/docs/tasks/access-kubernetes-api/custom-resources/custom-resource-definitions/ + # + # Note: The plural form is required even for singleton resources. See + # https://aip.dev/156 + # @!attribute [rw] singular + # @return [::String] + # The same concept of the `singular` field in k8s CRD spec + # https://kubernetes.io/docs/tasks/access-kubernetes-api/custom-resources/custom-resource-definitions/ + # Such as "project" for the `resourcemanager.googleapis.com/Project` type. + # @!attribute [rw] style + # @return [::Array<::Google::Api::ResourceDescriptor::Style>] + # Style flag(s) for this resource. + # These indicate that a resource is expected to conform to a given + # style. See the specific style flags for additional information. + class ResourceDescriptor + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # A description of the historical or future-looking state of the + # resource pattern. + module History + # The "unset" value. + HISTORY_UNSPECIFIED = 0 + + # The resource originally had one pattern and launched as such, and + # additional patterns were added later. + ORIGINALLY_SINGLE_PATTERN = 1 + + # The resource has one pattern, but the API owner expects to add more + # later. (This is the inverse of ORIGINALLY_SINGLE_PATTERN, and prevents + # that from being necessary once there are multiple patterns.) + FUTURE_MULTI_PATTERN = 2 + end + + # A flag representing a specific style that a resource claims to conform to. + module Style + # The unspecified value. Do not use. + STYLE_UNSPECIFIED = 0 + + # This resource is intended to be "declarative-friendly". + # + # Declarative-friendly resources must be more strictly consistent, and + # setting this to true communicates to tools that this resource should + # adhere to declarative-friendly expectations. + # + # Note: This is used by the API linter (linter.aip.dev) to enable + # additional checks. + DECLARATIVE_FRIENDLY = 1 + end + end + + # Defines a proto annotation that describes a string field that refers to + # an API resource. + # @!attribute [rw] type + # @return [::String] + # The resource type that the annotated field references. + # + # Example: + # + # message Subscription { + # string topic = 2 [(google.api.resource_reference) = { + # type: "pubsub.googleapis.com/Topic" + # }]; + # } + # + # Occasionally, a field may reference an arbitrary resource. In this case, + # APIs use the special value * in their resource reference. + # + # Example: + # + # message GetIamPolicyRequest { + # string resource = 2 [(google.api.resource_reference) = { + # type: "*" + # }]; + # } + # @!attribute [rw] child_type + # @return [::String] + # The resource type of a child collection that the annotated field + # references. This is useful for annotating the `parent` field that + # doesn't have a fixed resource type. + # + # Example: + # + # message ListLogEntriesRequest { + # string parent = 1 [(google.api.resource_reference) = { + # child_type: "logging.googleapis.com/LogEntry" + # }; + # } + class ResourceReference + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end +end diff --git a/owl-bot-staging/google-cloud-redis-v1beta1/proto_docs/google/cloud/redis/v1beta1/cloud_redis.rb b/owl-bot-staging/google-cloud-redis-v1beta1/proto_docs/google/cloud/redis/v1beta1/cloud_redis.rb new file mode 100644 index 000000000000..148c8857d86c --- /dev/null +++ b/owl-bot-staging/google-cloud-redis-v1beta1/proto_docs/google/cloud/redis/v1beta1/cloud_redis.rb @@ -0,0 +1,771 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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 Redis + module V1beta1 + # Node specific properties. + # @!attribute [r] id + # @return [::String] + # Output only. Node identifying string. e.g. 'node-0', 'node-1' + # @!attribute [r] zone + # @return [::String] + # Output only. Location of the node. + class NodeInfo + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # A Memorystore for Redis instance. + # @!attribute [rw] name + # @return [::String] + # Required. Unique name of the resource in this scope including project and + # location using the form: + # `projects/{project_id}/locations/{location_id}/instances/{instance_id}` + # + # Note: Redis instances are managed and addressed at regional level so + # location_id here refers to a GCP region; however, users may choose which + # specific zone (or collection of zones for cross-zone instances) an instance + # should be provisioned in. Refer to {::Google::Cloud::Redis::V1beta1::Instance#location_id location_id} and + # {::Google::Cloud::Redis::V1beta1::Instance#alternative_location_id alternative_location_id} fields for more details. + # @!attribute [rw] display_name + # @return [::String] + # An arbitrary and optional user-provided name for the instance. + # @!attribute [rw] labels + # @return [::Google::Protobuf::Map{::String => ::String}] + # Resource labels to represent user provided metadata + # @!attribute [rw] location_id + # @return [::String] + # Optional. The zone where the instance will be provisioned. If not provided, + # the service will choose a zone from the specified region for the instance. + # For standard tier, additional nodes will be added across multiple zones for + # protection against zonal failures. If specified, at least one node will be + # provisioned in this zone. + # @!attribute [rw] alternative_location_id + # @return [::String] + # Optional. If specified, at least one node will be provisioned in this zone + # in addition to the zone specified in location_id. Only applicable to + # standard tier. If provided, it must be a different zone from the one + # provided in [location_id]. Additional nodes beyond the first 2 will be + # placed in zones selected by the service. + # @!attribute [rw] redis_version + # @return [::String] + # Optional. The version of Redis software. + # If not provided, latest supported version will be used. Currently, the + # supported values are: + # + # * `REDIS_3_2` for Redis 3.2 compatibility + # * `REDIS_4_0` for Redis 4.0 compatibility (default) + # * `REDIS_5_0` for Redis 5.0 compatibility + # * `REDIS_6_X` for Redis 6.x compatibility + # @!attribute [rw] reserved_ip_range + # @return [::String] + # Optional. For DIRECT_PEERING mode, the CIDR range of internal addresses + # that are reserved for this instance. Range must + # be unique and non-overlapping with existing subnets in an authorized + # network. For PRIVATE_SERVICE_ACCESS mode, the name of one allocated IP + # address ranges associated with this private service access connection. + # If not provided, the service will choose an unused /29 block, for + # example, 10.0.0.0/29 or 192.168.0.0/29. For READ_REPLICAS_ENABLED + # the default block size is /28. + # @!attribute [rw] secondary_ip_range + # @return [::String] + # Optional. Additional IP range for node placement. Required when enabling read + # replicas on an existing instance. For DIRECT_PEERING mode value must be a + # CIDR range of size /28, or "auto". For PRIVATE_SERVICE_ACCESS mode value + # must be the name of an allocated address range associated with the private + # service access connection, or "auto". + # @!attribute [r] host + # @return [::String] + # Output only. Hostname or IP address of the exposed Redis endpoint used by + # clients to connect to the service. + # @!attribute [r] port + # @return [::Integer] + # Output only. The port number of the exposed Redis endpoint. + # @!attribute [r] current_location_id + # @return [::String] + # Output only. The current zone where the Redis primary node is located. In + # basic tier, this will always be the same as [location_id]. In + # standard tier, this can be the zone of any node in the instance. + # @!attribute [r] create_time + # @return [::Google::Protobuf::Timestamp] + # Output only. The time the instance was created. + # @!attribute [r] state + # @return [::Google::Cloud::Redis::V1beta1::Instance::State] + # Output only. The current state of this instance. + # @!attribute [r] status_message + # @return [::String] + # Output only. Additional information about the current status of this + # instance, if available. + # @!attribute [rw] redis_configs + # @return [::Google::Protobuf::Map{::String => ::String}] + # Optional. Redis configuration parameters, according to + # http://redis.io/topics/config. Currently, the only supported parameters + # are: + # + # Redis version 3.2 and newer: + # + # * maxmemory-policy + # * notify-keyspace-events + # + # Redis version 4.0 and newer: + # + # * activedefrag + # * lfu-decay-time + # * lfu-log-factor + # * maxmemory-gb + # + # Redis version 5.0 and newer: + # + # * stream-node-max-bytes + # * stream-node-max-entries + # @!attribute [rw] tier + # @return [::Google::Cloud::Redis::V1beta1::Instance::Tier] + # Required. The service tier of the instance. + # @!attribute [rw] memory_size_gb + # @return [::Integer] + # Required. Redis memory size in GiB. + # @!attribute [rw] authorized_network + # @return [::String] + # Optional. The full name of the Google Compute Engine + # [network](https://cloud.google.com/vpc/docs/vpc) to which the + # instance is connected. If left unspecified, the `default` network + # will be used. + # @!attribute [r] persistence_iam_identity + # @return [::String] + # Output only. Cloud IAM identity used by import / export operations to + # transfer data to/from Cloud Storage. Format is + # "serviceAccount:". The value may change over time + # for a given instance so should be checked before each import/export + # operation. + # @!attribute [rw] connect_mode + # @return [::Google::Cloud::Redis::V1beta1::Instance::ConnectMode] + # Optional. The network connect mode of the Redis instance. + # If not provided, the connect mode defaults to DIRECT_PEERING. + # @!attribute [rw] auth_enabled + # @return [::Boolean] + # Optional. Indicates whether OSS Redis AUTH is enabled for the instance. If set to + # "true" AUTH is enabled on the instance. Default value is "false" meaning + # AUTH is disabled. + # @!attribute [r] server_ca_certs + # @return [::Array<::Google::Cloud::Redis::V1beta1::TlsCertificate>] + # Output only. List of server CA certificates for the instance. + # @!attribute [rw] transit_encryption_mode + # @return [::Google::Cloud::Redis::V1beta1::Instance::TransitEncryptionMode] + # Optional. The TLS mode of the Redis instance. + # If not provided, TLS is disabled for the instance. + # @!attribute [rw] maintenance_policy + # @return [::Google::Cloud::Redis::V1beta1::MaintenancePolicy] + # Optional. The maintenance policy for the instance. If not provided, + # maintenance events can be performed at any time. + # @!attribute [r] maintenance_schedule + # @return [::Google::Cloud::Redis::V1beta1::MaintenanceSchedule] + # Output only. Date and time of upcoming maintenance events which have been + # scheduled. + # @!attribute [rw] replica_count + # @return [::Integer] + # Optional. The number of replica nodes. The valid range for the Standard Tier with + # read replicas enabled is [1-5] and defaults to 2. If read replicas are not + # enabled for a Standard Tier instance, the only valid value is 1 and the + # default is 1. The valid value for basic tier is 0 and the default is also + # 0. + # @!attribute [r] nodes + # @return [::Array<::Google::Cloud::Redis::V1beta1::NodeInfo>] + # Output only. Info per node. + # @!attribute [r] read_endpoint + # @return [::String] + # Output only. Hostname or IP address of the exposed readonly Redis + # endpoint. Standard tier only. Targets all healthy replica nodes in + # instance. Replication is asynchronous and replica nodes will exhibit some + # lag behind the primary. Write requests must target 'host'. + # @!attribute [r] read_endpoint_port + # @return [::Integer] + # Output only. The port number of the exposed readonly redis + # endpoint. Standard tier only. Write requests should target 'port'. + # @!attribute [rw] read_replicas_mode + # @return [::Google::Cloud::Redis::V1beta1::Instance::ReadReplicasMode] + # Optional. Read replicas mode for the instance. Defaults to READ_REPLICAS_DISABLED. + # @!attribute [rw] persistence_config + # @return [::Google::Cloud::Redis::V1beta1::PersistenceConfig] + # Optional. Persistence configuration parameters + class Instance + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # @!attribute [rw] key + # @return [::String] + # @!attribute [rw] value + # @return [::String] + class LabelsEntry + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # @!attribute [rw] key + # @return [::String] + # @!attribute [rw] value + # @return [::String] + class RedisConfigsEntry + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Represents the different states of a Redis instance. + module State + # Not set. + STATE_UNSPECIFIED = 0 + + # Redis instance is being created. + CREATING = 1 + + # Redis instance has been created and is fully usable. + READY = 2 + + # Redis instance configuration is being updated. Certain kinds of updates + # may cause the instance to become unusable while the update is in + # progress. + UPDATING = 3 + + # Redis instance is being deleted. + DELETING = 4 + + # Redis instance is being repaired and may be unusable. + REPAIRING = 5 + + # Maintenance is being performed on this Redis instance. + MAINTENANCE = 6 + + # Redis instance is importing data (availability may be affected). + IMPORTING = 8 + + # Redis instance is failing over (availability may be affected). + FAILING_OVER = 10 + end + + # Available service tiers to choose from + module Tier + # Not set. + TIER_UNSPECIFIED = 0 + + # BASIC tier: standalone instance + BASIC = 1 + + # STANDARD_HA tier: highly available primary/replica instances + STANDARD_HA = 3 + end + + # Available connection modes. + module ConnectMode + # Not set. + CONNECT_MODE_UNSPECIFIED = 0 + + # Connect via direct peering to the Memorystore for Redis hosted service. + DIRECT_PEERING = 1 + + # Connect your Memorystore for Redis instance using Private Service + # Access. Private services access provides an IP address range for multiple + # Google Cloud services, including Memorystore. + PRIVATE_SERVICE_ACCESS = 2 + end + + # Available TLS modes. + module TransitEncryptionMode + # Not set. + TRANSIT_ENCRYPTION_MODE_UNSPECIFIED = 0 + + # Client to Server traffic encryption enabled with server authentication. + SERVER_AUTHENTICATION = 1 + + # TLS is disabled for the instance. + DISABLED = 2 + end + + # Read replicas mode. + module ReadReplicasMode + # If not set, Memorystore Redis backend will default to + # READ_REPLICAS_DISABLED. + READ_REPLICAS_MODE_UNSPECIFIED = 0 + + # If disabled, read endpoint will not be provided and the instance cannot + # scale up or down the number of replicas. + READ_REPLICAS_DISABLED = 1 + + # If enabled, read endpoint will be provided and the instance can scale + # up and down the number of replicas. Not valid for basic tier. + READ_REPLICAS_ENABLED = 2 + end + end + + # Configuration of the persistence functionality. + # @!attribute [rw] persistence_mode + # @return [::Google::Cloud::Redis::V1beta1::PersistenceConfig::PersistenceMode] + # Optional. Controls whether Persistence features are enabled. + # If not provided, the existing value will be used. + # @!attribute [rw] rdb_snapshot_period + # @return [::Google::Cloud::Redis::V1beta1::PersistenceConfig::SnapshotPeriod] + # Optional. Period between RDB snapshots. Snapshots will be attempted every period + # starting from the provided snapshot start time. For example, a start time + # of 01/01/2033 06:45 and SIX_HOURS snapshot period will do nothing until + # 01/01/2033, and then trigger snapshots every day at 06:45, 12:45, 18:45, + # and 00:45 the next day, and so on. + # If not provided, TWENTY_FOUR_HOURS will be used as default. + # @!attribute [r] rdb_next_snapshot_time + # @return [::Google::Protobuf::Timestamp] + # Output only. The next time that a snapshot attempt is scheduled to occur. + # @!attribute [rw] rdb_snapshot_start_time + # @return [::Google::Protobuf::Timestamp] + # Optional. Date and time that the first snapshot was/will be attempted, and to which + # future snapshots will be aligned. + # If not provided, the current time will be used. + class PersistenceConfig + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # Available Persistence modes. + module PersistenceMode + # Not set. + PERSISTENCE_MODE_UNSPECIFIED = 0 + + # Persistence is disabled for the instance, + # and any existing snapshots are deleted. + DISABLED = 1 + + # RDB based Persistence is enabled. + RDB = 2 + end + + # Available snapshot periods for scheduling. + module SnapshotPeriod + # Not set. + SNAPSHOT_PERIOD_UNSPECIFIED = 0 + + # Snapshot every 1 hour. + ONE_HOUR = 3 + + # Snapshot every 6 hours. + SIX_HOURS = 4 + + # Snapshot every 12 hours. + TWELVE_HOURS = 5 + + # Snapshot every 24 hours. + TWENTY_FOUR_HOURS = 6 + end + end + + # Request for {::Google::Cloud::Redis::V1beta1::CloudRedis::Client#reschedule_maintenance RescheduleMaintenance}. + # @!attribute [rw] name + # @return [::String] + # Required. Redis instance resource name using the form: + # `projects/{project_id}/locations/{location_id}/instances/{instance_id}` + # where `location_id` refers to a GCP region. + # @!attribute [rw] reschedule_type + # @return [::Google::Cloud::Redis::V1beta1::RescheduleMaintenanceRequest::RescheduleType] + # Required. If reschedule type is SPECIFIC_TIME, must set up schedule_time as well. + # @!attribute [rw] schedule_time + # @return [::Google::Protobuf::Timestamp] + # Optional. Timestamp when the maintenance shall be rescheduled to if + # reschedule_type=SPECIFIC_TIME, in RFC 3339 format, for + # example `2012-11-15T16:19:00.094Z`. + class RescheduleMaintenanceRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # Reschedule options. + module RescheduleType + # Not set. + RESCHEDULE_TYPE_UNSPECIFIED = 0 + + # If the user wants to schedule the maintenance to happen now. + IMMEDIATE = 1 + + # If the user wants to use the existing maintenance policy to find the + # next available window. + NEXT_AVAILABLE_WINDOW = 2 + + # If the user wants to reschedule the maintenance to a specific time. + SPECIFIC_TIME = 3 + end + end + + # Maintenance policy for an instance. + # @!attribute [r] create_time + # @return [::Google::Protobuf::Timestamp] + # Output only. The time when the policy was created. + # @!attribute [r] update_time + # @return [::Google::Protobuf::Timestamp] + # Output only. The time when the policy was last updated. + # @!attribute [rw] description + # @return [::String] + # Optional. Description of what this policy is for. Create/Update methods + # return INVALID_ARGUMENT if the length is greater than 512. + # @!attribute [rw] weekly_maintenance_window + # @return [::Array<::Google::Cloud::Redis::V1beta1::WeeklyMaintenanceWindow>] + # Optional. Maintenance window that is applied to resources covered by this + # policy. Minimum 1. For the current version, the maximum number of + # weekly_window is expected to be one. + class MaintenancePolicy + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Time window in which disruptive maintenance updates occur. Non-disruptive + # updates can occur inside or outside this window. + # @!attribute [rw] day + # @return [::Google::Type::DayOfWeek] + # Required. The day of week that maintenance updates occur. + # @!attribute [rw] start_time + # @return [::Google::Type::TimeOfDay] + # Required. Start time of the window in UTC time. + # @!attribute [r] duration + # @return [::Google::Protobuf::Duration] + # Output only. Duration of the maintenance window. The current window is fixed at 1 hour. + class WeeklyMaintenanceWindow + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Upcoming maintenance schedule. If no maintenance is scheduled, fields are not + # populated. + # @!attribute [r] start_time + # @return [::Google::Protobuf::Timestamp] + # Output only. The start time of any upcoming scheduled maintenance for this instance. + # @!attribute [r] end_time + # @return [::Google::Protobuf::Timestamp] + # Output only. The end time of any upcoming scheduled maintenance for this instance. + # @!attribute [rw] can_reschedule + # @deprecated This field is deprecated and may be removed in the next major version update. + # @return [::Boolean] + # If the scheduled maintenance can be rescheduled, default is true. + # @!attribute [r] schedule_deadline_time + # @return [::Google::Protobuf::Timestamp] + # Output only. The deadline that the maintenance schedule start time can not go beyond, + # including reschedule. + class MaintenanceSchedule + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Request for {::Google::Cloud::Redis::V1beta1::CloudRedis::Client#list_instances ListInstances}. + # @!attribute [rw] parent + # @return [::String] + # Required. The resource name of the instance location using the form: + # `projects/{project_id}/locations/{location_id}` + # where `location_id` refers to a GCP region. + # @!attribute [rw] page_size + # @return [::Integer] + # The maximum number of items to return. + # + # If not specified, a default value of 1000 will be used by the service. + # Regardless of the page_size value, the response may include a partial list + # and a caller should only rely on response's + # {::Google::Cloud::Redis::V1beta1::ListInstancesResponse#next_page_token `next_page_token`} + # to determine if there are more instances left to be queried. + # @!attribute [rw] page_token + # @return [::String] + # The `next_page_token` value returned from a previous + # {::Google::Cloud::Redis::V1beta1::CloudRedis::Client#list_instances ListInstances} request, if any. + class ListInstancesRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Response for {::Google::Cloud::Redis::V1beta1::CloudRedis::Client#list_instances ListInstances}. + # @!attribute [rw] instances + # @return [::Array<::Google::Cloud::Redis::V1beta1::Instance>] + # A list of Redis instances in the project in the specified location, + # or across all locations. + # + # If the `location_id` in the parent field of the request is "-", all regions + # available to the project are queried, and the results aggregated. + # If in such an aggregated query a location is unavailable, a placeholder + # Redis entry is included in the response with the `name` field set to a + # value of the form + # `projects/{project_id}/locations/{location_id}/instances/`- and the + # `status` field set to ERROR and `status_message` field set to "location not + # available for ListInstances". + # @!attribute [rw] next_page_token + # @return [::String] + # Token to retrieve the next page of results, or empty if there are no more + # results in the list. + # @!attribute [rw] unreachable + # @return [::Array<::String>] + # Locations that could not be reached. + class ListInstancesResponse + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Request for {::Google::Cloud::Redis::V1beta1::CloudRedis::Client#get_instance GetInstance}. + # @!attribute [rw] name + # @return [::String] + # Required. Redis instance resource name using the form: + # `projects/{project_id}/locations/{location_id}/instances/{instance_id}` + # where `location_id` refers to a GCP region. + class GetInstanceRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Request for {::Google::Cloud::Redis::V1beta1::CloudRedis::Client#get_instance_auth_string GetInstanceAuthString}. + # @!attribute [rw] name + # @return [::String] + # Required. Redis instance resource name using the form: + # `projects/{project_id}/locations/{location_id}/instances/{instance_id}` + # where `location_id` refers to a GCP region. + class GetInstanceAuthStringRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Instance AUTH string details. + # @!attribute [rw] auth_string + # @return [::String] + # AUTH string set on the instance. + class InstanceAuthString + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Request for {::Google::Cloud::Redis::V1beta1::CloudRedis::Client#create_instance CreateInstance}. + # @!attribute [rw] parent + # @return [::String] + # Required. The resource name of the instance location using the form: + # `projects/{project_id}/locations/{location_id}` + # where `location_id` refers to a GCP region. + # @!attribute [rw] instance_id + # @return [::String] + # Required. The logical name of the Redis instance in the customer project + # with the following restrictions: + # + # * Must contain only lowercase letters, numbers, and hyphens. + # * Must start with a letter. + # * Must be between 1-40 characters. + # * Must end with a number or a letter. + # * Must be unique within the customer project / location + # @!attribute [rw] instance + # @return [::Google::Cloud::Redis::V1beta1::Instance] + # Required. A Redis [Instance] resource + class CreateInstanceRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Request for {::Google::Cloud::Redis::V1beta1::CloudRedis::Client#update_instance UpdateInstance}. + # @!attribute [rw] update_mask + # @return [::Google::Protobuf::FieldMask] + # Required. Mask of fields to update. At least one path must be supplied in + # this field. The elements of the repeated paths field may only include these + # fields from {::Google::Cloud::Redis::V1beta1::Instance Instance}: + # + # * `displayName` + # * `labels` + # * `memorySizeGb` + # * `redisConfig` + # * `replica_count` + # @!attribute [rw] instance + # @return [::Google::Cloud::Redis::V1beta1::Instance] + # Required. Update description. + # Only fields specified in update_mask are updated. + class UpdateInstanceRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Request for {::Google::Cloud::Redis::V1beta1::CloudRedis::Client#upgrade_instance UpgradeInstance}. + # @!attribute [rw] name + # @return [::String] + # Required. Redis instance resource name using the form: + # `projects/{project_id}/locations/{location_id}/instances/{instance_id}` + # where `location_id` refers to a GCP region. + # @!attribute [rw] redis_version + # @return [::String] + # Required. Specifies the target version of Redis software to upgrade to. + class UpgradeInstanceRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Request for {::Google::Cloud::Redis::V1beta1::CloudRedis::Client#delete_instance DeleteInstance}. + # @!attribute [rw] name + # @return [::String] + # Required. Redis instance resource name using the form: + # `projects/{project_id}/locations/{location_id}/instances/{instance_id}` + # where `location_id` refers to a GCP region. + class DeleteInstanceRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # The Cloud Storage location for the input content + # @!attribute [rw] uri + # @return [::String] + # Required. Source data URI. (e.g. 'gs://my_bucket/my_object'). + class GcsSource + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # The input content + # @!attribute [rw] gcs_source + # @return [::Google::Cloud::Redis::V1beta1::GcsSource] + # Google Cloud Storage location where input content is located. + class InputConfig + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Request for {::Google::Cloud::Redis::V1beta1::CloudRedis::Client#import_instance Import}. + # @!attribute [rw] name + # @return [::String] + # Required. Redis instance resource name using the form: + # `projects/{project_id}/locations/{location_id}/instances/{instance_id}` + # where `location_id` refers to a GCP region. + # @!attribute [rw] input_config + # @return [::Google::Cloud::Redis::V1beta1::InputConfig] + # Required. Specify data to be imported. + class ImportInstanceRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # The Cloud Storage location for the output content + # @!attribute [rw] uri + # @return [::String] + # Required. Data destination URI (e.g. + # 'gs://my_bucket/my_object'). Existing files will be overwritten. + class GcsDestination + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # The output content + # @!attribute [rw] gcs_destination + # @return [::Google::Cloud::Redis::V1beta1::GcsDestination] + # Google Cloud Storage destination for output content. + class OutputConfig + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Request for {::Google::Cloud::Redis::V1beta1::CloudRedis::Client#export_instance Export}. + # @!attribute [rw] name + # @return [::String] + # Required. Redis instance resource name using the form: + # `projects/{project_id}/locations/{location_id}/instances/{instance_id}` + # where `location_id` refers to a GCP region. + # @!attribute [rw] output_config + # @return [::Google::Cloud::Redis::V1beta1::OutputConfig] + # Required. Specify data to be exported. + class ExportInstanceRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Request for {::Google::Cloud::Redis::V1beta1::CloudRedis::Client#failover_instance Failover}. + # @!attribute [rw] name + # @return [::String] + # Required. Redis instance resource name using the form: + # `projects/{project_id}/locations/{location_id}/instances/{instance_id}` + # where `location_id` refers to a GCP region. + # @!attribute [rw] data_protection_mode + # @return [::Google::Cloud::Redis::V1beta1::FailoverInstanceRequest::DataProtectionMode] + # Optional. Available data protection modes that the user can choose. If it's + # unspecified, data protection mode will be LIMITED_DATA_LOSS by default. + class FailoverInstanceRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # Specifies different modes of operation in relation to the data retention. + module DataProtectionMode + # Defaults to LIMITED_DATA_LOSS if a data protection mode is not + # specified. + DATA_PROTECTION_MODE_UNSPECIFIED = 0 + + # Instance failover will be protected with data loss control. More + # specifically, the failover will only be performed if the current + # replication offset diff between primary and replica is under a certain + # threshold. + LIMITED_DATA_LOSS = 1 + + # Instance failover will be performed without data loss control. + FORCE_DATA_LOSS = 2 + end + end + + # This location metadata represents additional configuration options for a + # given location where a Redis instance may be created. All fields are output + # only. It is returned as content of the + # `google.cloud.location.Location.metadata` field. + # @!attribute [r] available_zones + # @return [::Google::Protobuf::Map{::String => ::Google::Cloud::Redis::V1beta1::ZoneMetadata}] + # Output only. The set of available zones in the location. The map is keyed + # by the lowercase ID of each zone, as defined by GCE. These keys can be + # specified in `location_id` or `alternative_location_id` fields when + # creating a Redis instance. + class LocationMetadata + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # @!attribute [rw] key + # @return [::String] + # @!attribute [rw] value + # @return [::Google::Cloud::Redis::V1beta1::ZoneMetadata] + class AvailableZonesEntry + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end + + # Defines specific information for a particular zone. Currently empty and + # reserved for future use only. + class ZoneMetadata + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # TlsCertificate Resource + # @!attribute [rw] serial_number + # @return [::String] + # Serial number, as extracted from the certificate. + # @!attribute [rw] cert + # @return [::String] + # PEM representation. + # @!attribute [r] create_time + # @return [::Google::Protobuf::Timestamp] + # Output only. The time when the certificate was created in [RFC + # 3339](https://tools.ietf.org/html/rfc3339) format, for example + # `2020-05-18T00:00:00.094Z`. + # @!attribute [r] expire_time + # @return [::Google::Protobuf::Timestamp] + # Output only. The time when the certificate expires in [RFC + # 3339](https://tools.ietf.org/html/rfc3339) format, for example + # `2020-05-18T00:00:00.094Z`. + # @!attribute [rw] sha1_fingerprint + # @return [::String] + # Sha1 Fingerprint of the certificate. + class TlsCertificate + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-redis-v1beta1/proto_docs/google/longrunning/operations.rb b/owl-bot-staging/google-cloud-redis-v1beta1/proto_docs/google/longrunning/operations.rb new file mode 100644 index 000000000000..7a757f512165 --- /dev/null +++ b/owl-bot-staging/google-cloud-redis-v1beta1/proto_docs/google/longrunning/operations.rb @@ -0,0 +1,191 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + + +module Google + module Longrunning + # This resource represents a long-running operation that is the result of a + # network API call. + # @!attribute [rw] name + # @return [::String] + # The server-assigned name, which is only unique within the same service that + # originally returns it. If you use the default HTTP mapping, the + # `name` should be a resource name ending with `operations/{unique_id}`. + # @!attribute [rw] metadata + # @return [::Google::Protobuf::Any] + # Service-specific metadata associated with the operation. It typically + # contains progress information and common metadata such as create time. + # Some services might not provide such metadata. Any method that returns a + # long-running operation should document the metadata type, if any. + # @!attribute [rw] done + # @return [::Boolean] + # If the value is `false`, it means the operation is still in progress. + # If `true`, the operation is completed, and either `error` or `response` is + # available. + # @!attribute [rw] error + # @return [::Google::Rpc::Status] + # The error result of the operation in case of failure or cancellation. + # + # Note: The following fields are mutually exclusive: `error`, `response`. If a field in that set is populated, all other fields in the set will automatically be cleared. + # @!attribute [rw] response + # @return [::Google::Protobuf::Any] + # The normal, successful response of the operation. If the original + # method returns no data on success, such as `Delete`, the response is + # `google.protobuf.Empty`. If the original method is standard + # `Get`/`Create`/`Update`, the response should be the resource. For other + # methods, the response should have the type `XxxResponse`, where `Xxx` + # is the original method name. For example, if the original method name + # is `TakeSnapshot()`, the inferred response type is + # `TakeSnapshotResponse`. + # + # Note: The following fields are mutually exclusive: `response`, `error`. If a field in that set is populated, all other fields in the set will automatically be cleared. + class Operation + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # The request message for + # Operations.GetOperation. + # @!attribute [rw] name + # @return [::String] + # The name of the operation resource. + class GetOperationRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # The request message for + # Operations.ListOperations. + # @!attribute [rw] name + # @return [::String] + # The name of the operation's parent resource. + # @!attribute [rw] filter + # @return [::String] + # The standard list filter. + # @!attribute [rw] page_size + # @return [::Integer] + # The standard list page size. + # @!attribute [rw] page_token + # @return [::String] + # The standard list page token. + # @!attribute [rw] return_partial_success + # @return [::Boolean] + # When set to `true`, operations that are reachable are returned as normal, + # and those that are unreachable are returned in the + # [ListOperationsResponse.unreachable] field. + # + # This can only be `true` when reading across collections e.g. when `parent` + # is set to `"projects/example/locations/-"`. + # + # This field is not by default supported and will result in an + # `UNIMPLEMENTED` error if set unless explicitly documented otherwise in + # service or product specific documentation. + class ListOperationsRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # The response message for + # Operations.ListOperations. + # @!attribute [rw] operations + # @return [::Array<::Google::Longrunning::Operation>] + # A list of operations that matches the specified filter in the request. + # @!attribute [rw] next_page_token + # @return [::String] + # The standard List next-page token. + # @!attribute [rw] unreachable + # @return [::Array<::String>] + # Unordered list. Unreachable resources. Populated when the request sets + # `ListOperationsRequest.return_partial_success` and reads across + # collections e.g. when attempting to list all resources across all supported + # locations. + class ListOperationsResponse + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # The request message for + # Operations.CancelOperation. + # @!attribute [rw] name + # @return [::String] + # The name of the operation resource to be cancelled. + class CancelOperationRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # The request message for + # Operations.DeleteOperation. + # @!attribute [rw] name + # @return [::String] + # The name of the operation resource to be deleted. + class DeleteOperationRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # The request message for + # Operations.WaitOperation. + # @!attribute [rw] name + # @return [::String] + # The name of the operation resource to wait on. + # @!attribute [rw] timeout + # @return [::Google::Protobuf::Duration] + # The maximum duration to wait before timing out. If left blank, the wait + # will be at most the time permitted by the underlying HTTP/RPC protocol. + # If RPC context deadline is also specified, the shorter one will be used. + class WaitOperationRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # A message representing the message types used by a long-running operation. + # + # Example: + # + # rpc Export(ExportRequest) returns (google.longrunning.Operation) { + # option (google.longrunning.operation_info) = { + # response_type: "ExportResponse" + # metadata_type: "ExportMetadata" + # }; + # } + # @!attribute [rw] response_type + # @return [::String] + # Required. The message name of the primary return type for this + # long-running operation. + # This type will be used to deserialize the LRO's response. + # + # If the response is in a different package from the rpc, a fully-qualified + # message name must be used (e.g. `google.protobuf.Struct`). + # + # Note: Altering this value constitutes a breaking change. + # @!attribute [rw] metadata_type + # @return [::String] + # Required. The message name of the metadata type for this long-running + # operation. + # + # If the response is in a different package from the rpc, a fully-qualified + # message name must be used (e.g. `google.protobuf.Struct`). + # + # Note: Altering this value constitutes a breaking change. + class OperationInfo + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end +end diff --git a/owl-bot-staging/google-cloud-redis-v1beta1/proto_docs/google/protobuf/any.rb b/owl-bot-staging/google-cloud-redis-v1beta1/proto_docs/google/protobuf/any.rb new file mode 100644 index 000000000000..58691995f02e --- /dev/null +++ b/owl-bot-staging/google-cloud-redis-v1beta1/proto_docs/google/protobuf/any.rb @@ -0,0 +1,145 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + + +module Google + module Protobuf + # `Any` contains an arbitrary serialized protocol buffer message along with a + # URL that describes the type of the serialized message. + # + # Protobuf library provides support to pack/unpack Any values in the form + # of utility functions or additional generated methods of the Any type. + # + # Example 1: Pack and unpack a message in C++. + # + # Foo foo = ...; + # Any any; + # any.PackFrom(foo); + # ... + # if (any.UnpackTo(&foo)) { + # ... + # } + # + # Example 2: Pack and unpack a message in Java. + # + # Foo foo = ...; + # Any any = Any.pack(foo); + # ... + # if (any.is(Foo.class)) { + # foo = any.unpack(Foo.class); + # } + # // or ... + # if (any.isSameTypeAs(Foo.getDefaultInstance())) { + # foo = any.unpack(Foo.getDefaultInstance()); + # } + # + # Example 3: Pack and unpack a message in Python. + # + # foo = Foo(...) + # any = Any() + # any.Pack(foo) + # ... + # if any.Is(Foo.DESCRIPTOR): + # any.Unpack(foo) + # ... + # + # Example 4: Pack and unpack a message in Go + # + # foo := &pb.Foo{...} + # any, err := anypb.New(foo) + # if err != nil { + # ... + # } + # ... + # foo := &pb.Foo{} + # if err := any.UnmarshalTo(foo); err != nil { + # ... + # } + # + # The pack methods provided by protobuf library will by default use + # 'type.googleapis.com/full.type.name' as the type URL and the unpack + # methods only use the fully qualified type name after the last '/' + # in the type URL, for example "foo.bar.com/x/y.z" will yield type + # name "y.z". + # + # JSON + # ==== + # The JSON representation of an `Any` value uses the regular + # representation of the deserialized, embedded message, with an + # additional field `@type` which contains the type URL. Example: + # + # package google.profile; + # message Person { + # string first_name = 1; + # string last_name = 2; + # } + # + # { + # "@type": "type.googleapis.com/google.profile.Person", + # "firstName": , + # "lastName": + # } + # + # If the embedded message type is well-known and has a custom JSON + # representation, that representation will be embedded adding a field + # `value` which holds the custom JSON in addition to the `@type` + # field. Example (for message [google.protobuf.Duration][]): + # + # { + # "@type": "type.googleapis.com/google.protobuf.Duration", + # "value": "1.212s" + # } + # @!attribute [rw] type_url + # @return [::String] + # A URL/resource name that uniquely identifies the type of the serialized + # protocol buffer message. This string must contain at least + # one "/" character. The last segment of the URL's path must represent + # the fully qualified name of the type (as in + # `path/google.protobuf.Duration`). The name should be in a canonical form + # (e.g., leading "." is not accepted). + # + # In practice, teams usually precompile into the binary all types that they + # expect it to use in the context of Any. However, for URLs which use the + # scheme `http`, `https`, or no scheme, one can optionally set up a type + # server that maps type URLs to message definitions as follows: + # + # * If no scheme is provided, `https` is assumed. + # * An HTTP GET on the URL must yield a [google.protobuf.Type][] + # value in binary format, or produce an error. + # * Applications are allowed to cache lookup results based on the + # URL, or have them precompiled into a binary to avoid any + # lookup. Therefore, binary compatibility needs to be preserved + # on changes to types. (Use versioned type names to manage + # breaking changes.) + # + # Note: this functionality is not currently available in the official + # protobuf release, and it is not used for type URLs beginning with + # type.googleapis.com. As of May 2023, there are no widely used type server + # implementations and no plans to implement one. + # + # Schemes other than `http`, `https` (or the empty scheme) might be + # used with implementation specific semantics. + # @!attribute [rw] value + # @return [::String] + # Must be a valid serialized protocol buffer of the above specified type. + class Any + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end +end diff --git a/owl-bot-staging/google-cloud-redis-v1beta1/proto_docs/google/protobuf/duration.rb b/owl-bot-staging/google-cloud-redis-v1beta1/proto_docs/google/protobuf/duration.rb new file mode 100644 index 000000000000..ea59f1f91daf --- /dev/null +++ b/owl-bot-staging/google-cloud-redis-v1beta1/proto_docs/google/protobuf/duration.rb @@ -0,0 +1,98 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + + +module Google + module Protobuf + # A Duration represents a signed, fixed-length span of time represented + # as a count of seconds and fractions of seconds at nanosecond + # resolution. It is independent of any calendar and concepts like "day" + # or "month". It is related to Timestamp in that the difference between + # two Timestamp values is a Duration and it can be added or subtracted + # from a Timestamp. Range is approximately +-10,000 years. + # + # # Examples + # + # Example 1: Compute Duration from two Timestamps in pseudo code. + # + # Timestamp start = ...; + # Timestamp end = ...; + # Duration duration = ...; + # + # duration.seconds = end.seconds - start.seconds; + # duration.nanos = end.nanos - start.nanos; + # + # if (duration.seconds < 0 && duration.nanos > 0) { + # duration.seconds += 1; + # duration.nanos -= 1000000000; + # } else if (duration.seconds > 0 && duration.nanos < 0) { + # duration.seconds -= 1; + # duration.nanos += 1000000000; + # } + # + # Example 2: Compute Timestamp from Timestamp + Duration in pseudo code. + # + # Timestamp start = ...; + # Duration duration = ...; + # Timestamp end = ...; + # + # end.seconds = start.seconds + duration.seconds; + # end.nanos = start.nanos + duration.nanos; + # + # if (end.nanos < 0) { + # end.seconds -= 1; + # end.nanos += 1000000000; + # } else if (end.nanos >= 1000000000) { + # end.seconds += 1; + # end.nanos -= 1000000000; + # } + # + # Example 3: Compute Duration from datetime.timedelta in Python. + # + # td = datetime.timedelta(days=3, minutes=10) + # duration = Duration() + # duration.FromTimedelta(td) + # + # # JSON Mapping + # + # In JSON format, the Duration type is encoded as a string rather than an + # object, where the string ends in the suffix "s" (indicating seconds) and + # is preceded by the number of seconds, with nanoseconds expressed as + # fractional seconds. For example, 3 seconds with 0 nanoseconds should be + # encoded in JSON format as "3s", while 3 seconds and 1 nanosecond should + # be expressed in JSON format as "3.000000001s", and 3 seconds and 1 + # microsecond should be expressed in JSON format as "3.000001s". + # @!attribute [rw] seconds + # @return [::Integer] + # Signed seconds of the span of time. Must be from -315,576,000,000 + # to +315,576,000,000 inclusive. Note: these bounds are computed from: + # 60 sec/min * 60 min/hr * 24 hr/day * 365.25 days/year * 10000 years + # @!attribute [rw] nanos + # @return [::Integer] + # Signed fractions of a second at nanosecond resolution of the span + # of time. Durations less than one second are represented with a 0 + # `seconds` field and a positive or negative `nanos` field. For durations + # of one second or more, a non-zero value for the `nanos` field must be + # of the same sign as the `seconds` field. Must be from -999,999,999 + # to +999,999,999 inclusive. + class Duration + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end +end diff --git a/owl-bot-staging/google-cloud-redis-v1beta1/proto_docs/google/protobuf/empty.rb b/owl-bot-staging/google-cloud-redis-v1beta1/proto_docs/google/protobuf/empty.rb new file mode 100644 index 000000000000..83e4481834a6 --- /dev/null +++ b/owl-bot-staging/google-cloud-redis-v1beta1/proto_docs/google/protobuf/empty.rb @@ -0,0 +1,34 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + + +module Google + module Protobuf + # A generic empty message that you can re-use to avoid defining duplicated + # empty messages in your APIs. A typical example is to use it as the request + # or the response type of an API method. For instance: + # + # service Foo { + # rpc Bar(google.protobuf.Empty) returns (google.protobuf.Empty); + # } + class Empty + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end +end diff --git a/owl-bot-staging/google-cloud-redis-v1beta1/proto_docs/google/protobuf/field_mask.rb b/owl-bot-staging/google-cloud-redis-v1beta1/proto_docs/google/protobuf/field_mask.rb new file mode 100644 index 000000000000..7f3ffc78601a --- /dev/null +++ b/owl-bot-staging/google-cloud-redis-v1beta1/proto_docs/google/protobuf/field_mask.rb @@ -0,0 +1,229 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + + +module Google + module Protobuf + # `FieldMask` represents a set of symbolic field paths, for example: + # + # paths: "f.a" + # paths: "f.b.d" + # + # Here `f` represents a field in some root message, `a` and `b` + # fields in the message found in `f`, and `d` a field found in the + # message in `f.b`. + # + # Field masks are used to specify a subset of fields that should be + # returned by a get operation or modified by an update operation. + # Field masks also have a custom JSON encoding (see below). + # + # # Field Masks in Projections + # + # When used in the context of a projection, a response message or + # sub-message is filtered by the API to only contain those fields as + # specified in the mask. For example, if the mask in the previous + # example is applied to a response message as follows: + # + # f { + # a : 22 + # b { + # d : 1 + # x : 2 + # } + # y : 13 + # } + # z: 8 + # + # The result will not contain specific values for fields x,y and z + # (their value will be set to the default, and omitted in proto text + # output): + # + # + # f { + # a : 22 + # b { + # d : 1 + # } + # } + # + # A repeated field is not allowed except at the last position of a + # paths string. + # + # If a FieldMask object is not present in a get operation, the + # operation applies to all fields (as if a FieldMask of all fields + # had been specified). + # + # Note that a field mask does not necessarily apply to the + # top-level response message. In case of a REST get operation, the + # field mask applies directly to the response, but in case of a REST + # list operation, the mask instead applies to each individual message + # in the returned resource list. In case of a REST custom method, + # other definitions may be used. Where the mask applies will be + # clearly documented together with its declaration in the API. In + # any case, the effect on the returned resource/resources is required + # behavior for APIs. + # + # # Field Masks in Update Operations + # + # A field mask in update operations specifies which fields of the + # targeted resource are going to be updated. The API is required + # to only change the values of the fields as specified in the mask + # and leave the others untouched. If a resource is passed in to + # describe the updated values, the API ignores the values of all + # fields not covered by the mask. + # + # If a repeated field is specified for an update operation, new values will + # be appended to the existing repeated field in the target resource. Note that + # a repeated field is only allowed in the last position of a `paths` string. + # + # If a sub-message is specified in the last position of the field mask for an + # update operation, then new value will be merged into the existing sub-message + # in the target resource. + # + # For example, given the target message: + # + # f { + # b { + # d: 1 + # x: 2 + # } + # c: [1] + # } + # + # And an update message: + # + # f { + # b { + # d: 10 + # } + # c: [2] + # } + # + # then if the field mask is: + # + # paths: ["f.b", "f.c"] + # + # then the result will be: + # + # f { + # b { + # d: 10 + # x: 2 + # } + # c: [1, 2] + # } + # + # An implementation may provide options to override this default behavior for + # repeated and message fields. + # + # In order to reset a field's value to the default, the field must + # be in the mask and set to the default value in the provided resource. + # Hence, in order to reset all fields of a resource, provide a default + # instance of the resource and set all fields in the mask, or do + # not provide a mask as described below. + # + # If a field mask is not present on update, the operation applies to + # all fields (as if a field mask of all fields has been specified). + # Note that in the presence of schema evolution, this may mean that + # fields the client does not know and has therefore not filled into + # the request will be reset to their default. If this is unwanted + # behavior, a specific service may require a client to always specify + # a field mask, producing an error if not. + # + # As with get operations, the location of the resource which + # describes the updated values in the request message depends on the + # operation kind. In any case, the effect of the field mask is + # required to be honored by the API. + # + # ## Considerations for HTTP REST + # + # The HTTP kind of an update operation which uses a field mask must + # be set to PATCH instead of PUT in order to satisfy HTTP semantics + # (PUT must only be used for full updates). + # + # # JSON Encoding of Field Masks + # + # In JSON, a field mask is encoded as a single string where paths are + # separated by a comma. Fields name in each path are converted + # to/from lower-camel naming conventions. + # + # As an example, consider the following message declarations: + # + # message Profile { + # User user = 1; + # Photo photo = 2; + # } + # message User { + # string display_name = 1; + # string address = 2; + # } + # + # In proto a field mask for `Profile` may look as such: + # + # mask { + # paths: "user.display_name" + # paths: "photo" + # } + # + # In JSON, the same mask is represented as below: + # + # { + # mask: "user.displayName,photo" + # } + # + # # Field Masks and Oneof Fields + # + # Field masks treat fields in oneofs just as regular fields. Consider the + # following message: + # + # message SampleMessage { + # oneof test_oneof { + # string name = 4; + # SubMessage sub_message = 9; + # } + # } + # + # The field mask can be: + # + # mask { + # paths: "name" + # } + # + # Or: + # + # mask { + # paths: "sub_message" + # } + # + # Note that oneof type names ("test_oneof" in this case) cannot be used in + # paths. + # + # ## Field Mask Verification + # + # The implementation of any API method which has a FieldMask type field in the + # request should verify the included field paths, and return an + # `INVALID_ARGUMENT` error if any path is unmappable. + # @!attribute [rw] paths + # @return [::Array<::String>] + # The set of field mask paths. + class FieldMask + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end +end diff --git a/owl-bot-staging/google-cloud-redis-v1beta1/proto_docs/google/protobuf/timestamp.rb b/owl-bot-staging/google-cloud-redis-v1beta1/proto_docs/google/protobuf/timestamp.rb new file mode 100644 index 000000000000..74352be9c58c --- /dev/null +++ b/owl-bot-staging/google-cloud-redis-v1beta1/proto_docs/google/protobuf/timestamp.rb @@ -0,0 +1,127 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + + +module Google + module Protobuf + # A Timestamp represents a point in time independent of any time zone or local + # calendar, encoded as a count of seconds and fractions of seconds at + # nanosecond resolution. The count is relative to an epoch at UTC midnight on + # January 1, 1970, in the proleptic Gregorian calendar which extends the + # Gregorian calendar backwards to year one. + # + # All minutes are 60 seconds long. Leap seconds are "smeared" so that no leap + # second table is needed for interpretation, using a [24-hour linear + # smear](https://developers.google.com/time/smear). + # + # The range is from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59.999999999Z. By + # restricting to that range, we ensure that we can convert to and from [RFC + # 3339](https://www.ietf.org/rfc/rfc3339.txt) date strings. + # + # # Examples + # + # Example 1: Compute Timestamp from POSIX `time()`. + # + # Timestamp timestamp; + # timestamp.set_seconds(time(NULL)); + # timestamp.set_nanos(0); + # + # Example 2: Compute Timestamp from POSIX `gettimeofday()`. + # + # struct timeval tv; + # gettimeofday(&tv, NULL); + # + # Timestamp timestamp; + # timestamp.set_seconds(tv.tv_sec); + # timestamp.set_nanos(tv.tv_usec * 1000); + # + # Example 3: Compute Timestamp from Win32 `GetSystemTimeAsFileTime()`. + # + # FILETIME ft; + # GetSystemTimeAsFileTime(&ft); + # UINT64 ticks = (((UINT64)ft.dwHighDateTime) << 32) | ft.dwLowDateTime; + # + # // A Windows tick is 100 nanoseconds. Windows epoch 1601-01-01T00:00:00Z + # // is 11644473600 seconds before Unix epoch 1970-01-01T00:00:00Z. + # Timestamp timestamp; + # timestamp.set_seconds((INT64) ((ticks / 10000000) - 11644473600LL)); + # timestamp.set_nanos((INT32) ((ticks % 10000000) * 100)); + # + # Example 4: Compute Timestamp from Java `System.currentTimeMillis()`. + # + # long millis = System.currentTimeMillis(); + # + # Timestamp timestamp = Timestamp.newBuilder().setSeconds(millis / 1000) + # .setNanos((int) ((millis % 1000) * 1000000)).build(); + # + # Example 5: Compute Timestamp from Java `Instant.now()`. + # + # Instant now = Instant.now(); + # + # Timestamp timestamp = + # Timestamp.newBuilder().setSeconds(now.getEpochSecond()) + # .setNanos(now.getNano()).build(); + # + # Example 6: Compute Timestamp from current time in Python. + # + # timestamp = Timestamp() + # timestamp.GetCurrentTime() + # + # # JSON Mapping + # + # In JSON format, the Timestamp type is encoded as a string in the + # [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format. That is, the + # format is "\\{year}-\\{month}-\\{day}T\\{hour}:\\{min}:\\{sec}[.\\{frac_sec}]Z" + # where \\{year} is always expressed using four digits while \\{month}, \\{day}, + # \\{hour}, \\{min}, and \\{sec} are zero-padded to two digits each. The fractional + # seconds, which can go up to 9 digits (i.e. up to 1 nanosecond resolution), + # are optional. The "Z" suffix indicates the timezone ("UTC"); the timezone + # is required. A proto3 JSON serializer should always use UTC (as indicated by + # "Z") when printing the Timestamp type and a proto3 JSON parser should be + # able to accept both UTC and other timezones (as indicated by an offset). + # + # For example, "2017-01-15T01:30:15.01Z" encodes 15.01 seconds past + # 01:30 UTC on January 15, 2017. + # + # In JavaScript, one can convert a Date object to this format using the + # standard + # [toISOString()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toISOString) + # method. In Python, a standard `datetime.datetime` object can be converted + # to this format using + # [`strftime`](https://docs.python.org/2/library/time.html#time.strftime) with + # the time format spec '%Y-%m-%dT%H:%M:%S.%fZ'. Likewise, in Java, one can use + # the Joda Time's [`ISODateTimeFormat.dateTime()`]( + # http://joda-time.sourceforge.net/apidocs/org/joda/time/format/ISODateTimeFormat.html#dateTime() + # ) to obtain a formatter capable of generating timestamps in this format. + # @!attribute [rw] seconds + # @return [::Integer] + # Represents seconds of UTC time since Unix epoch + # 1970-01-01T00:00:00Z. Must be from 0001-01-01T00:00:00Z to + # 9999-12-31T23:59:59Z inclusive. + # @!attribute [rw] nanos + # @return [::Integer] + # Non-negative fractions of a second at nanosecond resolution. Negative + # second values with fractions must still have non-negative nanos values + # that count forward in time. Must be from 0 to 999,999,999 + # inclusive. + class Timestamp + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end +end diff --git a/owl-bot-staging/google-cloud-redis-v1beta1/proto_docs/google/rpc/status.rb b/owl-bot-staging/google-cloud-redis-v1beta1/proto_docs/google/rpc/status.rb new file mode 100644 index 000000000000..c1a1c07eb2db --- /dev/null +++ b/owl-bot-staging/google-cloud-redis-v1beta1/proto_docs/google/rpc/status.rb @@ -0,0 +1,48 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + + +module Google + module Rpc + # The `Status` type defines a logical error model that is suitable for + # different programming environments, including REST APIs and RPC APIs. It is + # used by [gRPC](https://github.com/grpc). Each `Status` message contains + # three pieces of data: error code, error message, and error details. + # + # You can find out more about this error model and how to work with it in the + # [API Design Guide](https://cloud.google.com/apis/design/errors). + # @!attribute [rw] code + # @return [::Integer] + # The status code, which should be an enum value of + # [google.rpc.Code][google.rpc.Code]. + # @!attribute [rw] message + # @return [::String] + # A developer-facing error message, which should be in English. Any + # user-facing error message should be localized and sent in the + # {::Google::Rpc::Status#details google.rpc.Status.details} field, or localized + # by the client. + # @!attribute [rw] details + # @return [::Array<::Google::Protobuf::Any>] + # A list of messages that carry the error details. There is a common set of + # message types for APIs to use. + class Status + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end +end diff --git a/owl-bot-staging/google-cloud-redis-v1beta1/proto_docs/google/type/dayofweek.rb b/owl-bot-staging/google-cloud-redis-v1beta1/proto_docs/google/type/dayofweek.rb new file mode 100644 index 000000000000..973211b9ffe7 --- /dev/null +++ b/owl-bot-staging/google-cloud-redis-v1beta1/proto_docs/google/type/dayofweek.rb @@ -0,0 +1,49 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + + +module Google + module Type + # Represents a day of the week. + module DayOfWeek + # The day of the week is unspecified. + DAY_OF_WEEK_UNSPECIFIED = 0 + + # Monday + MONDAY = 1 + + # Tuesday + TUESDAY = 2 + + # Wednesday + WEDNESDAY = 3 + + # Thursday + THURSDAY = 4 + + # Friday + FRIDAY = 5 + + # Saturday + SATURDAY = 6 + + # Sunday + SUNDAY = 7 + end + end +end diff --git a/owl-bot-staging/google-cloud-redis-v1beta1/proto_docs/google/type/timeofday.rb b/owl-bot-staging/google-cloud-redis-v1beta1/proto_docs/google/type/timeofday.rb new file mode 100644 index 000000000000..8372dad8beb8 --- /dev/null +++ b/owl-bot-staging/google-cloud-redis-v1beta1/proto_docs/google/type/timeofday.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! + + +module Google + module Type + # Represents a time of day. The date and time zone are either not significant + # or are specified elsewhere. An API may choose to allow leap seconds. Related + # types are [google.type.Date][google.type.Date] and + # `google.protobuf.Timestamp`. + # @!attribute [rw] hours + # @return [::Integer] + # Hours of day in 24 hour format. Should be from 0 to 23. An API may choose + # to allow the value "24:00:00" for scenarios like business closing time. + # @!attribute [rw] minutes + # @return [::Integer] + # Minutes of hour of day. Must be from 0 to 59. + # @!attribute [rw] seconds + # @return [::Integer] + # Seconds of minutes of the time. Must normally be from 0 to 59. An API may + # allow the value 60 if it allows leap-seconds. + # @!attribute [rw] nanos + # @return [::Integer] + # Fractions of seconds in nanoseconds. Must be from 0 to 999,999,999. + class TimeOfDay + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end +end diff --git a/owl-bot-staging/google-cloud-redis-v1beta1/snippets/Gemfile b/owl-bot-staging/google-cloud-redis-v1beta1/snippets/Gemfile new file mode 100644 index 000000000000..82019b5c9ffa --- /dev/null +++ b/owl-bot-staging/google-cloud-redis-v1beta1/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-redis-v1beta1", path: "../" +else + gem "google-cloud-redis-v1beta1" +end + +group :test do + gem "google-style", "~> 1.26.1" + gem "minitest", "~> 5.16" + gem "minitest-focus", "~> 1.1" + gem "minitest-hooks", "~> 1.5" +end diff --git a/owl-bot-staging/google-cloud-redis-v1beta1/snippets/cloud_redis/create_instance.rb b/owl-bot-staging/google-cloud-redis-v1beta1/snippets/cloud_redis/create_instance.rb new file mode 100644 index 000000000000..236366af61dd --- /dev/null +++ b/owl-bot-staging/google-cloud-redis-v1beta1/snippets/cloud_redis/create_instance.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 redis_v1beta1_generated_CloudRedis_CreateInstance_sync] +require "google/cloud/redis/v1beta1" + +## +# Snippet for the create_instance call in the CloudRedis service +# +# This snippet has been automatically generated and should be regarded as a code +# template only. It will require modifications to work: +# - It may require correct/in-range values for request initialization. +# - It may require specifying regional endpoints when creating the service +# client as shown in https://cloud.google.com/ruby/docs/reference. +# +# This is an auto-generated example demonstrating basic usage of +# Google::Cloud::Redis::V1beta1::CloudRedis::Client#create_instance. +# +def create_instance + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Redis::V1beta1::CloudRedis::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Redis::V1beta1::CreateInstanceRequest.new + + # Call the create_instance method. + result = client.create_instance 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 redis_v1beta1_generated_CloudRedis_CreateInstance_sync] diff --git a/owl-bot-staging/google-cloud-redis-v1beta1/snippets/cloud_redis/delete_instance.rb b/owl-bot-staging/google-cloud-redis-v1beta1/snippets/cloud_redis/delete_instance.rb new file mode 100644 index 000000000000..a27474bd8d1d --- /dev/null +++ b/owl-bot-staging/google-cloud-redis-v1beta1/snippets/cloud_redis/delete_instance.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 redis_v1beta1_generated_CloudRedis_DeleteInstance_sync] +require "google/cloud/redis/v1beta1" + +## +# Snippet for the delete_instance call in the CloudRedis service +# +# This snippet has been automatically generated and should be regarded as a code +# template only. It will require modifications to work: +# - It may require correct/in-range values for request initialization. +# - It may require specifying regional endpoints when creating the service +# client as shown in https://cloud.google.com/ruby/docs/reference. +# +# This is an auto-generated example demonstrating basic usage of +# Google::Cloud::Redis::V1beta1::CloudRedis::Client#delete_instance. +# +def delete_instance + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Redis::V1beta1::CloudRedis::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Redis::V1beta1::DeleteInstanceRequest.new + + # Call the delete_instance method. + result = client.delete_instance 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 redis_v1beta1_generated_CloudRedis_DeleteInstance_sync] diff --git a/owl-bot-staging/google-cloud-redis-v1beta1/snippets/cloud_redis/export_instance.rb b/owl-bot-staging/google-cloud-redis-v1beta1/snippets/cloud_redis/export_instance.rb new file mode 100644 index 000000000000..41baa222993d --- /dev/null +++ b/owl-bot-staging/google-cloud-redis-v1beta1/snippets/cloud_redis/export_instance.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 redis_v1beta1_generated_CloudRedis_ExportInstance_sync] +require "google/cloud/redis/v1beta1" + +## +# Snippet for the export_instance call in the CloudRedis service +# +# This snippet has been automatically generated and should be regarded as a code +# template only. It will require modifications to work: +# - It may require correct/in-range values for request initialization. +# - It may require specifying regional endpoints when creating the service +# client as shown in https://cloud.google.com/ruby/docs/reference. +# +# This is an auto-generated example demonstrating basic usage of +# Google::Cloud::Redis::V1beta1::CloudRedis::Client#export_instance. +# +def export_instance + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Redis::V1beta1::CloudRedis::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Redis::V1beta1::ExportInstanceRequest.new + + # Call the export_instance method. + result = client.export_instance 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 redis_v1beta1_generated_CloudRedis_ExportInstance_sync] diff --git a/owl-bot-staging/google-cloud-redis-v1beta1/snippets/cloud_redis/failover_instance.rb b/owl-bot-staging/google-cloud-redis-v1beta1/snippets/cloud_redis/failover_instance.rb new file mode 100644 index 000000000000..a3bf6763c961 --- /dev/null +++ b/owl-bot-staging/google-cloud-redis-v1beta1/snippets/cloud_redis/failover_instance.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 redis_v1beta1_generated_CloudRedis_FailoverInstance_sync] +require "google/cloud/redis/v1beta1" + +## +# Snippet for the failover_instance call in the CloudRedis service +# +# This snippet has been automatically generated and should be regarded as a code +# template only. It will require modifications to work: +# - It may require correct/in-range values for request initialization. +# - It may require specifying regional endpoints when creating the service +# client as shown in https://cloud.google.com/ruby/docs/reference. +# +# This is an auto-generated example demonstrating basic usage of +# Google::Cloud::Redis::V1beta1::CloudRedis::Client#failover_instance. +# +def failover_instance + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Redis::V1beta1::CloudRedis::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Redis::V1beta1::FailoverInstanceRequest.new + + # Call the failover_instance method. + result = client.failover_instance 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 redis_v1beta1_generated_CloudRedis_FailoverInstance_sync] diff --git a/owl-bot-staging/google-cloud-redis-v1beta1/snippets/cloud_redis/get_instance.rb b/owl-bot-staging/google-cloud-redis-v1beta1/snippets/cloud_redis/get_instance.rb new file mode 100644 index 000000000000..b9dc2590c821 --- /dev/null +++ b/owl-bot-staging/google-cloud-redis-v1beta1/snippets/cloud_redis/get_instance.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 redis_v1beta1_generated_CloudRedis_GetInstance_sync] +require "google/cloud/redis/v1beta1" + +## +# Snippet for the get_instance call in the CloudRedis service +# +# This snippet has been automatically generated and should be regarded as a code +# template only. It will require modifications to work: +# - It may require correct/in-range values for request initialization. +# - It may require specifying regional endpoints when creating the service +# client as shown in https://cloud.google.com/ruby/docs/reference. +# +# This is an auto-generated example demonstrating basic usage of +# Google::Cloud::Redis::V1beta1::CloudRedis::Client#get_instance. +# +def get_instance + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Redis::V1beta1::CloudRedis::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Redis::V1beta1::GetInstanceRequest.new + + # Call the get_instance method. + result = client.get_instance request + + # The returned object is of type Google::Cloud::Redis::V1beta1::Instance. + p result +end +# [END redis_v1beta1_generated_CloudRedis_GetInstance_sync] diff --git a/owl-bot-staging/google-cloud-redis-v1beta1/snippets/cloud_redis/get_instance_auth_string.rb b/owl-bot-staging/google-cloud-redis-v1beta1/snippets/cloud_redis/get_instance_auth_string.rb new file mode 100644 index 000000000000..6242f65c1a07 --- /dev/null +++ b/owl-bot-staging/google-cloud-redis-v1beta1/snippets/cloud_redis/get_instance_auth_string.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 redis_v1beta1_generated_CloudRedis_GetInstanceAuthString_sync] +require "google/cloud/redis/v1beta1" + +## +# Snippet for the get_instance_auth_string call in the CloudRedis service +# +# This snippet has been automatically generated and should be regarded as a code +# template only. It will require modifications to work: +# - It may require correct/in-range values for request initialization. +# - It may require specifying regional endpoints when creating the service +# client as shown in https://cloud.google.com/ruby/docs/reference. +# +# This is an auto-generated example demonstrating basic usage of +# Google::Cloud::Redis::V1beta1::CloudRedis::Client#get_instance_auth_string. +# +def get_instance_auth_string + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Redis::V1beta1::CloudRedis::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Redis::V1beta1::GetInstanceAuthStringRequest.new + + # Call the get_instance_auth_string method. + result = client.get_instance_auth_string request + + # The returned object is of type Google::Cloud::Redis::V1beta1::InstanceAuthString. + p result +end +# [END redis_v1beta1_generated_CloudRedis_GetInstanceAuthString_sync] diff --git a/owl-bot-staging/google-cloud-redis-v1beta1/snippets/cloud_redis/import_instance.rb b/owl-bot-staging/google-cloud-redis-v1beta1/snippets/cloud_redis/import_instance.rb new file mode 100644 index 000000000000..acd9211a720e --- /dev/null +++ b/owl-bot-staging/google-cloud-redis-v1beta1/snippets/cloud_redis/import_instance.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 redis_v1beta1_generated_CloudRedis_ImportInstance_sync] +require "google/cloud/redis/v1beta1" + +## +# Snippet for the import_instance call in the CloudRedis service +# +# This snippet has been automatically generated and should be regarded as a code +# template only. It will require modifications to work: +# - It may require correct/in-range values for request initialization. +# - It may require specifying regional endpoints when creating the service +# client as shown in https://cloud.google.com/ruby/docs/reference. +# +# This is an auto-generated example demonstrating basic usage of +# Google::Cloud::Redis::V1beta1::CloudRedis::Client#import_instance. +# +def import_instance + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Redis::V1beta1::CloudRedis::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Redis::V1beta1::ImportInstanceRequest.new + + # Call the import_instance method. + result = client.import_instance 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 redis_v1beta1_generated_CloudRedis_ImportInstance_sync] diff --git a/owl-bot-staging/google-cloud-redis-v1beta1/snippets/cloud_redis/list_instances.rb b/owl-bot-staging/google-cloud-redis-v1beta1/snippets/cloud_redis/list_instances.rb new file mode 100644 index 000000000000..00d2697f339f --- /dev/null +++ b/owl-bot-staging/google-cloud-redis-v1beta1/snippets/cloud_redis/list_instances.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 redis_v1beta1_generated_CloudRedis_ListInstances_sync] +require "google/cloud/redis/v1beta1" + +## +# Snippet for the list_instances call in the CloudRedis service +# +# This snippet has been automatically generated and should be regarded as a code +# template only. It will require modifications to work: +# - It may require correct/in-range values for request initialization. +# - It may require specifying regional endpoints when creating the service +# client as shown in https://cloud.google.com/ruby/docs/reference. +# +# This is an auto-generated example demonstrating basic usage of +# Google::Cloud::Redis::V1beta1::CloudRedis::Client#list_instances. +# +def list_instances + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Redis::V1beta1::CloudRedis::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Redis::V1beta1::ListInstancesRequest.new + + # Call the list_instances method. + result = client.list_instances request + + # The returned object is of type Gapic::PagedEnumerable. You can iterate + # over elements, and API calls will be issued to fetch pages as needed. + result.each do |item| + # Each element is of type ::Google::Cloud::Redis::V1beta1::Instance. + p item + end +end +# [END redis_v1beta1_generated_CloudRedis_ListInstances_sync] diff --git a/owl-bot-staging/google-cloud-redis-v1beta1/snippets/cloud_redis/reschedule_maintenance.rb b/owl-bot-staging/google-cloud-redis-v1beta1/snippets/cloud_redis/reschedule_maintenance.rb new file mode 100644 index 000000000000..bbca3882e73b --- /dev/null +++ b/owl-bot-staging/google-cloud-redis-v1beta1/snippets/cloud_redis/reschedule_maintenance.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 redis_v1beta1_generated_CloudRedis_RescheduleMaintenance_sync] +require "google/cloud/redis/v1beta1" + +## +# Snippet for the reschedule_maintenance call in the CloudRedis service +# +# This snippet has been automatically generated and should be regarded as a code +# template only. It will require modifications to work: +# - It may require correct/in-range values for request initialization. +# - It may require specifying regional endpoints when creating the service +# client as shown in https://cloud.google.com/ruby/docs/reference. +# +# This is an auto-generated example demonstrating basic usage of +# Google::Cloud::Redis::V1beta1::CloudRedis::Client#reschedule_maintenance. +# +def reschedule_maintenance + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Redis::V1beta1::CloudRedis::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Redis::V1beta1::RescheduleMaintenanceRequest.new + + # Call the reschedule_maintenance method. + result = client.reschedule_maintenance 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 redis_v1beta1_generated_CloudRedis_RescheduleMaintenance_sync] diff --git a/owl-bot-staging/google-cloud-redis-v1beta1/snippets/cloud_redis/update_instance.rb b/owl-bot-staging/google-cloud-redis-v1beta1/snippets/cloud_redis/update_instance.rb new file mode 100644 index 000000000000..3130d23543f9 --- /dev/null +++ b/owl-bot-staging/google-cloud-redis-v1beta1/snippets/cloud_redis/update_instance.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 redis_v1beta1_generated_CloudRedis_UpdateInstance_sync] +require "google/cloud/redis/v1beta1" + +## +# Snippet for the update_instance call in the CloudRedis service +# +# This snippet has been automatically generated and should be regarded as a code +# template only. It will require modifications to work: +# - It may require correct/in-range values for request initialization. +# - It may require specifying regional endpoints when creating the service +# client as shown in https://cloud.google.com/ruby/docs/reference. +# +# This is an auto-generated example demonstrating basic usage of +# Google::Cloud::Redis::V1beta1::CloudRedis::Client#update_instance. +# +def update_instance + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Redis::V1beta1::CloudRedis::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Redis::V1beta1::UpdateInstanceRequest.new + + # Call the update_instance method. + result = client.update_instance 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 redis_v1beta1_generated_CloudRedis_UpdateInstance_sync] diff --git a/owl-bot-staging/google-cloud-redis-v1beta1/snippets/cloud_redis/upgrade_instance.rb b/owl-bot-staging/google-cloud-redis-v1beta1/snippets/cloud_redis/upgrade_instance.rb new file mode 100644 index 000000000000..cb50f737f6c8 --- /dev/null +++ b/owl-bot-staging/google-cloud-redis-v1beta1/snippets/cloud_redis/upgrade_instance.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 redis_v1beta1_generated_CloudRedis_UpgradeInstance_sync] +require "google/cloud/redis/v1beta1" + +## +# Snippet for the upgrade_instance call in the CloudRedis service +# +# This snippet has been automatically generated and should be regarded as a code +# template only. It will require modifications to work: +# - It may require correct/in-range values for request initialization. +# - It may require specifying regional endpoints when creating the service +# client as shown in https://cloud.google.com/ruby/docs/reference. +# +# This is an auto-generated example demonstrating basic usage of +# Google::Cloud::Redis::V1beta1::CloudRedis::Client#upgrade_instance. +# +def upgrade_instance + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Redis::V1beta1::CloudRedis::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Redis::V1beta1::UpgradeInstanceRequest.new + + # Call the upgrade_instance method. + result = client.upgrade_instance 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 redis_v1beta1_generated_CloudRedis_UpgradeInstance_sync] diff --git a/owl-bot-staging/google-cloud-redis-v1beta1/snippets/snippet_metadata_google.cloud.redis.v1beta1.json b/owl-bot-staging/google-cloud-redis-v1beta1/snippets/snippet_metadata_google.cloud.redis.v1beta1.json new file mode 100644 index 000000000000..56cb2a2de1d8 --- /dev/null +++ b/owl-bot-staging/google-cloud-redis-v1beta1/snippets/snippet_metadata_google.cloud.redis.v1beta1.json @@ -0,0 +1,455 @@ +{ + "client_library": { + "name": "google-cloud-redis-v1beta1", + "version": "", + "language": "RUBY", + "apis": [ + { + "id": "google.cloud.redis.v1beta1", + "version": "v1beta1" + } + ] + }, + "snippets": [ + { + "region_tag": "redis_v1beta1_generated_CloudRedis_ListInstances_sync", + "title": "Snippet for the list_instances call in the CloudRedis service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Redis::V1beta1::CloudRedis::Client#list_instances.", + "file": "cloud_redis/list_instances.rb", + "language": "RUBY", + "client_method": { + "short_name": "list_instances", + "full_name": "::Google::Cloud::Redis::V1beta1::CloudRedis::Client#list_instances", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::Redis::V1beta1::ListInstancesRequest", + "name": "request" + } + ], + "result_type": "::Google::Cloud::Redis::V1beta1::ListInstancesResponse", + "client": { + "short_name": "CloudRedis::Client", + "full_name": "::Google::Cloud::Redis::V1beta1::CloudRedis::Client" + }, + "method": { + "short_name": "ListInstances", + "full_name": "google.cloud.redis.v1beta1.CloudRedis.ListInstances", + "service": { + "short_name": "CloudRedis", + "full_name": "google.cloud.redis.v1beta1.CloudRedis" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 50, + "type": "FULL" + } + ] + }, + { + "region_tag": "redis_v1beta1_generated_CloudRedis_GetInstance_sync", + "title": "Snippet for the get_instance call in the CloudRedis service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Redis::V1beta1::CloudRedis::Client#get_instance.", + "file": "cloud_redis/get_instance.rb", + "language": "RUBY", + "client_method": { + "short_name": "get_instance", + "full_name": "::Google::Cloud::Redis::V1beta1::CloudRedis::Client#get_instance", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::Redis::V1beta1::GetInstanceRequest", + "name": "request" + } + ], + "result_type": "::Google::Cloud::Redis::V1beta1::Instance", + "client": { + "short_name": "CloudRedis::Client", + "full_name": "::Google::Cloud::Redis::V1beta1::CloudRedis::Client" + }, + "method": { + "short_name": "GetInstance", + "full_name": "google.cloud.redis.v1beta1.CloudRedis.GetInstance", + "service": { + "short_name": "CloudRedis", + "full_name": "google.cloud.redis.v1beta1.CloudRedis" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 46, + "type": "FULL" + } + ] + }, + { + "region_tag": "redis_v1beta1_generated_CloudRedis_GetInstanceAuthString_sync", + "title": "Snippet for the get_instance_auth_string call in the CloudRedis service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Redis::V1beta1::CloudRedis::Client#get_instance_auth_string.", + "file": "cloud_redis/get_instance_auth_string.rb", + "language": "RUBY", + "client_method": { + "short_name": "get_instance_auth_string", + "full_name": "::Google::Cloud::Redis::V1beta1::CloudRedis::Client#get_instance_auth_string", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::Redis::V1beta1::GetInstanceAuthStringRequest", + "name": "request" + } + ], + "result_type": "::Google::Cloud::Redis::V1beta1::InstanceAuthString", + "client": { + "short_name": "CloudRedis::Client", + "full_name": "::Google::Cloud::Redis::V1beta1::CloudRedis::Client" + }, + "method": { + "short_name": "GetInstanceAuthString", + "full_name": "google.cloud.redis.v1beta1.CloudRedis.GetInstanceAuthString", + "service": { + "short_name": "CloudRedis", + "full_name": "google.cloud.redis.v1beta1.CloudRedis" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 46, + "type": "FULL" + } + ] + }, + { + "region_tag": "redis_v1beta1_generated_CloudRedis_CreateInstance_sync", + "title": "Snippet for the create_instance call in the CloudRedis service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Redis::V1beta1::CloudRedis::Client#create_instance.", + "file": "cloud_redis/create_instance.rb", + "language": "RUBY", + "client_method": { + "short_name": "create_instance", + "full_name": "::Google::Cloud::Redis::V1beta1::CloudRedis::Client#create_instance", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::Redis::V1beta1::CreateInstanceRequest", + "name": "request" + } + ], + "result_type": "::Google::Longrunning::Operation", + "client": { + "short_name": "CloudRedis::Client", + "full_name": "::Google::Cloud::Redis::V1beta1::CloudRedis::Client" + }, + "method": { + "short_name": "CreateInstance", + "full_name": "google.cloud.redis.v1beta1.CloudRedis.CreateInstance", + "service": { + "short_name": "CloudRedis", + "full_name": "google.cloud.redis.v1beta1.CloudRedis" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 53, + "type": "FULL" + } + ] + }, + { + "region_tag": "redis_v1beta1_generated_CloudRedis_UpdateInstance_sync", + "title": "Snippet for the update_instance call in the CloudRedis service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Redis::V1beta1::CloudRedis::Client#update_instance.", + "file": "cloud_redis/update_instance.rb", + "language": "RUBY", + "client_method": { + "short_name": "update_instance", + "full_name": "::Google::Cloud::Redis::V1beta1::CloudRedis::Client#update_instance", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::Redis::V1beta1::UpdateInstanceRequest", + "name": "request" + } + ], + "result_type": "::Google::Longrunning::Operation", + "client": { + "short_name": "CloudRedis::Client", + "full_name": "::Google::Cloud::Redis::V1beta1::CloudRedis::Client" + }, + "method": { + "short_name": "UpdateInstance", + "full_name": "google.cloud.redis.v1beta1.CloudRedis.UpdateInstance", + "service": { + "short_name": "CloudRedis", + "full_name": "google.cloud.redis.v1beta1.CloudRedis" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 53, + "type": "FULL" + } + ] + }, + { + "region_tag": "redis_v1beta1_generated_CloudRedis_UpgradeInstance_sync", + "title": "Snippet for the upgrade_instance call in the CloudRedis service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Redis::V1beta1::CloudRedis::Client#upgrade_instance.", + "file": "cloud_redis/upgrade_instance.rb", + "language": "RUBY", + "client_method": { + "short_name": "upgrade_instance", + "full_name": "::Google::Cloud::Redis::V1beta1::CloudRedis::Client#upgrade_instance", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::Redis::V1beta1::UpgradeInstanceRequest", + "name": "request" + } + ], + "result_type": "::Google::Longrunning::Operation", + "client": { + "short_name": "CloudRedis::Client", + "full_name": "::Google::Cloud::Redis::V1beta1::CloudRedis::Client" + }, + "method": { + "short_name": "UpgradeInstance", + "full_name": "google.cloud.redis.v1beta1.CloudRedis.UpgradeInstance", + "service": { + "short_name": "CloudRedis", + "full_name": "google.cloud.redis.v1beta1.CloudRedis" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 53, + "type": "FULL" + } + ] + }, + { + "region_tag": "redis_v1beta1_generated_CloudRedis_ImportInstance_sync", + "title": "Snippet for the import_instance call in the CloudRedis service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Redis::V1beta1::CloudRedis::Client#import_instance.", + "file": "cloud_redis/import_instance.rb", + "language": "RUBY", + "client_method": { + "short_name": "import_instance", + "full_name": "::Google::Cloud::Redis::V1beta1::CloudRedis::Client#import_instance", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::Redis::V1beta1::ImportInstanceRequest", + "name": "request" + } + ], + "result_type": "::Google::Longrunning::Operation", + "client": { + "short_name": "CloudRedis::Client", + "full_name": "::Google::Cloud::Redis::V1beta1::CloudRedis::Client" + }, + "method": { + "short_name": "ImportInstance", + "full_name": "google.cloud.redis.v1beta1.CloudRedis.ImportInstance", + "service": { + "short_name": "CloudRedis", + "full_name": "google.cloud.redis.v1beta1.CloudRedis" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 53, + "type": "FULL" + } + ] + }, + { + "region_tag": "redis_v1beta1_generated_CloudRedis_ExportInstance_sync", + "title": "Snippet for the export_instance call in the CloudRedis service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Redis::V1beta1::CloudRedis::Client#export_instance.", + "file": "cloud_redis/export_instance.rb", + "language": "RUBY", + "client_method": { + "short_name": "export_instance", + "full_name": "::Google::Cloud::Redis::V1beta1::CloudRedis::Client#export_instance", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::Redis::V1beta1::ExportInstanceRequest", + "name": "request" + } + ], + "result_type": "::Google::Longrunning::Operation", + "client": { + "short_name": "CloudRedis::Client", + "full_name": "::Google::Cloud::Redis::V1beta1::CloudRedis::Client" + }, + "method": { + "short_name": "ExportInstance", + "full_name": "google.cloud.redis.v1beta1.CloudRedis.ExportInstance", + "service": { + "short_name": "CloudRedis", + "full_name": "google.cloud.redis.v1beta1.CloudRedis" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 53, + "type": "FULL" + } + ] + }, + { + "region_tag": "redis_v1beta1_generated_CloudRedis_FailoverInstance_sync", + "title": "Snippet for the failover_instance call in the CloudRedis service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Redis::V1beta1::CloudRedis::Client#failover_instance.", + "file": "cloud_redis/failover_instance.rb", + "language": "RUBY", + "client_method": { + "short_name": "failover_instance", + "full_name": "::Google::Cloud::Redis::V1beta1::CloudRedis::Client#failover_instance", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::Redis::V1beta1::FailoverInstanceRequest", + "name": "request" + } + ], + "result_type": "::Google::Longrunning::Operation", + "client": { + "short_name": "CloudRedis::Client", + "full_name": "::Google::Cloud::Redis::V1beta1::CloudRedis::Client" + }, + "method": { + "short_name": "FailoverInstance", + "full_name": "google.cloud.redis.v1beta1.CloudRedis.FailoverInstance", + "service": { + "short_name": "CloudRedis", + "full_name": "google.cloud.redis.v1beta1.CloudRedis" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 53, + "type": "FULL" + } + ] + }, + { + "region_tag": "redis_v1beta1_generated_CloudRedis_DeleteInstance_sync", + "title": "Snippet for the delete_instance call in the CloudRedis service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Redis::V1beta1::CloudRedis::Client#delete_instance.", + "file": "cloud_redis/delete_instance.rb", + "language": "RUBY", + "client_method": { + "short_name": "delete_instance", + "full_name": "::Google::Cloud::Redis::V1beta1::CloudRedis::Client#delete_instance", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::Redis::V1beta1::DeleteInstanceRequest", + "name": "request" + } + ], + "result_type": "::Google::Longrunning::Operation", + "client": { + "short_name": "CloudRedis::Client", + "full_name": "::Google::Cloud::Redis::V1beta1::CloudRedis::Client" + }, + "method": { + "short_name": "DeleteInstance", + "full_name": "google.cloud.redis.v1beta1.CloudRedis.DeleteInstance", + "service": { + "short_name": "CloudRedis", + "full_name": "google.cloud.redis.v1beta1.CloudRedis" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 53, + "type": "FULL" + } + ] + }, + { + "region_tag": "redis_v1beta1_generated_CloudRedis_RescheduleMaintenance_sync", + "title": "Snippet for the reschedule_maintenance call in the CloudRedis service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Redis::V1beta1::CloudRedis::Client#reschedule_maintenance.", + "file": "cloud_redis/reschedule_maintenance.rb", + "language": "RUBY", + "client_method": { + "short_name": "reschedule_maintenance", + "full_name": "::Google::Cloud::Redis::V1beta1::CloudRedis::Client#reschedule_maintenance", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::Redis::V1beta1::RescheduleMaintenanceRequest", + "name": "request" + } + ], + "result_type": "::Google::Longrunning::Operation", + "client": { + "short_name": "CloudRedis::Client", + "full_name": "::Google::Cloud::Redis::V1beta1::CloudRedis::Client" + }, + "method": { + "short_name": "RescheduleMaintenance", + "full_name": "google.cloud.redis.v1beta1.CloudRedis.RescheduleMaintenance", + "service": { + "short_name": "CloudRedis", + "full_name": "google.cloud.redis.v1beta1.CloudRedis" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 53, + "type": "FULL" + } + ] + } + ] +} \ No newline at end of file diff --git a/owl-bot-staging/google-cloud-redis-v1beta1/test/google/cloud/redis/v1beta1/cloud_redis_operations_test.rb b/owl-bot-staging/google-cloud-redis-v1beta1/test/google/cloud/redis/v1beta1/cloud_redis_operations_test.rb new file mode 100644 index 000000000000..ede2f8416ae8 --- /dev/null +++ b/owl-bot-staging/google-cloud-redis-v1beta1/test/google/cloud/redis/v1beta1/cloud_redis_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/cloud/redis/v1beta1/cloud_redis_pb" +require "google/cloud/redis/v1beta1/cloud_redis_services_pb" +require "google/cloud/redis/v1beta1/cloud_redis" + +class ::Google::Cloud::Redis::V1beta1::CloudRedis::OperationsTest < Minitest::Test + class ClientStub + attr_accessor :call_rpc_count, :requests + + def initialize response, operation, &block + @response = response + @operation = operation + @block = block + @call_rpc_count = 0 + @requests = [] + end + + def call_rpc *args, **kwargs + @call_rpc_count += 1 + + @requests << @block&.call(*args, **kwargs) + + catch :response do + yield @response, @operation if block_given? + @response + end + end + + def endpoint + "endpoint.example.com" + end + + def universe_domain + "example.com" + end + + def stub_logger + nil + end + + def logger + nil + end + end + + def test_list_operations + # Create GRPC objects. + grpc_response = ::Google::Longrunning::ListOperationsResponse.new + grpc_operation = GRPC::ActiveCall::Operation.new nil + grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + grpc_options = {} + + # Create request parameters for a unary method. + name = "hello world" + filter = "hello world" + page_size = 42 + page_token = "hello world" + return_partial_success = true + + list_operations_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :list_operations, name + assert_kind_of ::Google::Longrunning::ListOperationsRequest, request + assert_equal "hello world", request["name"] + assert_equal "hello world", request["filter"] + assert_equal 42, request["page_size"] + assert_equal "hello world", request["page_token"] + assert_equal true, request["return_partial_success"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, list_operations_client_stub do + # Create client + client = ::Google::Cloud::Redis::V1beta1::CloudRedis::Operations.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.list_operations({ name: name, filter: filter, page_size: page_size, page_token: page_token, return_partial_success: return_partial_success }) do |response, operation| + assert_kind_of Gapic::PagedEnumerable, response + assert_equal grpc_response, response.response + assert_equal grpc_operation, operation + end + + # Use named arguments + client.list_operations name: name, filter: filter, page_size: page_size, page_token: page_token, return_partial_success: return_partial_success do |response, operation| + assert_kind_of Gapic::PagedEnumerable, response + assert_equal grpc_response, response.response + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.list_operations ::Google::Longrunning::ListOperationsRequest.new(name: name, filter: filter, page_size: page_size, page_token: page_token, return_partial_success: return_partial_success) do |response, operation| + assert_kind_of Gapic::PagedEnumerable, response + assert_equal grpc_response, response.response + assert_equal grpc_operation, operation + end + + # Use hash object with options + client.list_operations({ name: name, filter: filter, page_size: page_size, page_token: page_token, return_partial_success: return_partial_success }, grpc_options) do |response, operation| + assert_kind_of Gapic::PagedEnumerable, response + assert_equal grpc_response, response.response + assert_equal grpc_operation, operation + end + + # Use protobuf object with options + client.list_operations(::Google::Longrunning::ListOperationsRequest.new(name: name, filter: filter, page_size: page_size, page_token: page_token, return_partial_success: return_partial_success), grpc_options) do |response, operation| + assert_kind_of Gapic::PagedEnumerable, response + assert_equal grpc_response, response.response + assert_equal grpc_operation, operation + end + + # Verify method calls + assert_equal 5, list_operations_client_stub.call_rpc_count + end + end + + def test_get_operation + # Create GRPC objects. + grpc_response = ::Google::Longrunning::Operation.new + grpc_operation = GRPC::ActiveCall::Operation.new nil + grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + grpc_options = {} + + # Create request parameters for a unary method. + name = "hello world" + + get_operation_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :get_operation, name + assert_kind_of ::Google::Longrunning::GetOperationRequest, request + assert_equal "hello world", request["name"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, get_operation_client_stub do + # Create client + client = ::Google::Cloud::Redis::V1beta1::CloudRedis::Operations.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.get_operation({ name: name }) do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Use named arguments + client.get_operation name: name do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.get_operation ::Google::Longrunning::GetOperationRequest.new(name: name) do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Use hash object with options + client.get_operation({ name: name }, grpc_options) do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Use protobuf object with options + client.get_operation(::Google::Longrunning::GetOperationRequest.new(name: name), grpc_options) do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Verify method calls + assert_equal 5, get_operation_client_stub.call_rpc_count + end + end + + def test_delete_operation + # Create GRPC objects. + grpc_response = ::Google::Protobuf::Empty.new + grpc_operation = GRPC::ActiveCall::Operation.new nil + grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + grpc_options = {} + + # Create request parameters for a unary method. + name = "hello world" + + delete_operation_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :delete_operation, name + assert_kind_of ::Google::Longrunning::DeleteOperationRequest, request + assert_equal "hello world", request["name"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, delete_operation_client_stub do + # Create client + client = ::Google::Cloud::Redis::V1beta1::CloudRedis::Operations.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.delete_operation({ name: name }) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use named arguments + client.delete_operation name: name do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.delete_operation ::Google::Longrunning::DeleteOperationRequest.new(name: name) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use hash object with options + client.delete_operation({ name: name }, grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object with options + client.delete_operation(::Google::Longrunning::DeleteOperationRequest.new(name: name), grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Verify method calls + assert_equal 5, delete_operation_client_stub.call_rpc_count + end + end + + def test_cancel_operation + # Create GRPC objects. + grpc_response = ::Google::Protobuf::Empty.new + grpc_operation = GRPC::ActiveCall::Operation.new nil + grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + grpc_options = {} + + # Create request parameters for a unary method. + name = "hello world" + + cancel_operation_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :cancel_operation, name + assert_kind_of ::Google::Longrunning::CancelOperationRequest, request + assert_equal "hello world", request["name"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, cancel_operation_client_stub do + # Create client + client = ::Google::Cloud::Redis::V1beta1::CloudRedis::Operations.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.cancel_operation({ name: name }) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use named arguments + client.cancel_operation name: name do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.cancel_operation ::Google::Longrunning::CancelOperationRequest.new(name: name) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use hash object with options + client.cancel_operation({ name: name }, grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object with options + client.cancel_operation(::Google::Longrunning::CancelOperationRequest.new(name: name), grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Verify method calls + assert_equal 5, cancel_operation_client_stub.call_rpc_count + end + end + + def test_wait_operation + # Create GRPC objects. + grpc_response = ::Google::Longrunning::Operation.new + grpc_operation = GRPC::ActiveCall::Operation.new nil + grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + grpc_options = {} + + # Create request parameters for a unary method. + name = "hello world" + timeout = {} + + wait_operation_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :wait_operation, name + assert_kind_of ::Google::Longrunning::WaitOperationRequest, request + assert_equal "hello world", request["name"] + assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Protobuf::Duration), request["timeout"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, wait_operation_client_stub do + # Create client + client = ::Google::Cloud::Redis::V1beta1::CloudRedis::Operations.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.wait_operation({ name: name, timeout: timeout }) do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Use named arguments + client.wait_operation name: name, timeout: timeout do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.wait_operation ::Google::Longrunning::WaitOperationRequest.new(name: name, timeout: timeout) do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Use hash object with options + client.wait_operation({ name: name, timeout: timeout }, grpc_options) do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Use protobuf object with options + client.wait_operation(::Google::Longrunning::WaitOperationRequest.new(name: name, timeout: timeout), grpc_options) do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Verify method calls + assert_equal 5, wait_operation_client_stub.call_rpc_count + end + end + + def test_configure + grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + + client = block_config = config = nil + dummy_stub = ClientStub.new nil, nil + Gapic::ServiceStub.stub :new, dummy_stub do + client = ::Google::Cloud::Redis::V1beta1::CloudRedis::Operations.new do |config| + config.credentials = grpc_channel + end + end + + config = client.configure do |c| + block_config = c + end + + assert_same block_config, config + assert_kind_of ::Google::Cloud::Redis::V1beta1::CloudRedis::Operations::Configuration, config + end +end diff --git a/owl-bot-staging/google-cloud-redis-v1beta1/test/google/cloud/redis/v1beta1/cloud_redis_paths_test.rb b/owl-bot-staging/google-cloud-redis-v1beta1/test/google/cloud/redis/v1beta1/cloud_redis_paths_test.rb new file mode 100644 index 000000000000..c6bd60ae284f --- /dev/null +++ b/owl-bot-staging/google-cloud-redis-v1beta1/test/google/cloud/redis/v1beta1/cloud_redis_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/cloud/redis/v1beta1/cloud_redis" + +class ::Google::Cloud::Redis::V1beta1::CloudRedis::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_instance_path + grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + ::Gapic::ServiceStub.stub :new, DummyStub.new do + client = ::Google::Cloud::Redis::V1beta1::CloudRedis::Client.new do |config| + config.credentials = grpc_channel + end + + path = client.instance_path project: "value0", location: "value1", instance: "value2" + assert_equal "projects/value0/locations/value1/instances/value2", path + end + end + + def test_location_path + grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + ::Gapic::ServiceStub.stub :new, DummyStub.new do + client = ::Google::Cloud::Redis::V1beta1::CloudRedis::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 +end diff --git a/owl-bot-staging/google-cloud-redis-v1beta1/test/google/cloud/redis/v1beta1/cloud_redis_rest_test.rb b/owl-bot-staging/google-cloud-redis-v1beta1/test/google/cloud/redis/v1beta1/cloud_redis_rest_test.rb new file mode 100644 index 000000000000..235dd23bd8a6 --- /dev/null +++ b/owl-bot-staging/google-cloud-redis-v1beta1/test/google/cloud/redis/v1beta1/cloud_redis_rest_test.rb @@ -0,0 +1,704 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +require "helper" +require "gapic/rest" +require "google/cloud/redis/v1beta1/cloud_redis_pb" +require "google/cloud/redis/v1beta1/cloud_redis/rest" + + +class ::Google::Cloud::Redis::V1beta1::CloudRedis::Rest::ClientTest < Minitest::Test + class ClientStub + attr_accessor :call_count, :requests + + def initialize response, &block + @response = response + @block = block + @call_count = 0 + @requests = [] + end + + def make_get_request uri:, params: {}, options: {}, method_name: nil + make_http_request :get, uri: uri, body: nil, params: params, options: options, method_name: method_name + end + + def make_delete_request uri:, params: {}, options: {}, method_name: nil + make_http_request :delete, uri: uri, body: nil, params: params, options: options, method_name: method_name + end + + def make_post_request uri:, body: nil, params: {}, options: {}, method_name: nil + make_http_request :post, uri: uri, body: body, params: params, options: options, method_name: method_name + end + + def make_patch_request uri:, body:, params: {}, options: {}, method_name: nil + make_http_request :patch, uri: uri, body: body, params: params, options: options, method_name: method_name + end + + def make_put_request uri:, body:, params: {}, options: {}, method_name: nil + make_http_request :put, uri: uri, body: body, params: params, options: options, method_name: method_name + end + + def make_http_request *args, **kwargs + @call_count += 1 + + @requests << @block&.call(*args, **kwargs) + + @response + end + + def endpoint + "endpoint.example.com" + end + + def universe_domain + "example.com" + end + + def stub_logger + nil + end + + def logger + nil + end + end + + def test_list_instances + # Create test objects. + client_result = ::Google::Cloud::Redis::V1beta1::ListInstancesResponse.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_instances_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| + assert options.metadata.key? :"x-goog-api-client" + assert options.metadata[:"x-goog-api-client"].include? "rest" + refute options.metadata[:"x-goog-api-client"].include? "grpc" + end + + ::Google::Cloud::Redis::V1beta1::CloudRedis::Rest::ServiceStub.stub :transcode_list_instances_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, list_instances_client_stub do + # Create client + client = ::Google::Cloud::Redis::V1beta1::CloudRedis::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.list_instances({ 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_instances 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_instances ::Google::Cloud::Redis::V1beta1::ListInstancesRequest.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_instances({ 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_instances(::Google::Cloud::Redis::V1beta1::ListInstancesRequest.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_instances_client_stub.call_count + end + end + end + + def test_get_instance + # Create test objects. + client_result = ::Google::Cloud::Redis::V1beta1::Instance.new + http_response = OpenStruct.new body: client_result.to_json + + call_options = {} + + # Create request parameters for a unary method. + name = "hello world" + + get_instance_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| + assert options.metadata.key? :"x-goog-api-client" + assert options.metadata[:"x-goog-api-client"].include? "rest" + refute options.metadata[:"x-goog-api-client"].include? "grpc" + end + + ::Google::Cloud::Redis::V1beta1::CloudRedis::Rest::ServiceStub.stub :transcode_get_instance_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, get_instance_client_stub do + # Create client + client = ::Google::Cloud::Redis::V1beta1::CloudRedis::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.get_instance({ name: name }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.get_instance name: name do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.get_instance ::Google::Cloud::Redis::V1beta1::GetInstanceRequest.new(name: name) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + client.get_instance({ name: name }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + client.get_instance(::Google::Cloud::Redis::V1beta1::GetInstanceRequest.new(name: name), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, get_instance_client_stub.call_count + end + end + end + + def test_get_instance_auth_string + # Create test objects. + client_result = ::Google::Cloud::Redis::V1beta1::InstanceAuthString.new + http_response = OpenStruct.new body: client_result.to_json + + call_options = {} + + # Create request parameters for a unary method. + name = "hello world" + + get_instance_auth_string_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| + assert options.metadata.key? :"x-goog-api-client" + assert options.metadata[:"x-goog-api-client"].include? "rest" + refute options.metadata[:"x-goog-api-client"].include? "grpc" + end + + ::Google::Cloud::Redis::V1beta1::CloudRedis::Rest::ServiceStub.stub :transcode_get_instance_auth_string_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, get_instance_auth_string_client_stub do + # Create client + client = ::Google::Cloud::Redis::V1beta1::CloudRedis::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.get_instance_auth_string({ name: name }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.get_instance_auth_string name: name do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.get_instance_auth_string ::Google::Cloud::Redis::V1beta1::GetInstanceAuthStringRequest.new(name: name) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + client.get_instance_auth_string({ name: name }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + client.get_instance_auth_string(::Google::Cloud::Redis::V1beta1::GetInstanceAuthStringRequest.new(name: name), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, get_instance_auth_string_client_stub.call_count + end + end + end + + def test_create_instance + # 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" + instance_id = "hello world" + instance = {} + + create_instance_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| + assert options.metadata.key? :"x-goog-api-client" + assert options.metadata[:"x-goog-api-client"].include? "rest" + refute options.metadata[:"x-goog-api-client"].include? "grpc" + end + + ::Google::Cloud::Redis::V1beta1::CloudRedis::Rest::ServiceStub.stub :transcode_create_instance_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, create_instance_client_stub do + # Create client + client = ::Google::Cloud::Redis::V1beta1::CloudRedis::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.create_instance({ parent: parent, instance_id: instance_id, instance: instance }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.create_instance parent: parent, instance_id: instance_id, instance: instance do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.create_instance ::Google::Cloud::Redis::V1beta1::CreateInstanceRequest.new(parent: parent, instance_id: instance_id, instance: instance) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + client.create_instance({ parent: parent, instance_id: instance_id, instance: instance }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + client.create_instance(::Google::Cloud::Redis::V1beta1::CreateInstanceRequest.new(parent: parent, instance_id: instance_id, instance: instance), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, create_instance_client_stub.call_count + end + end + end + + def test_update_instance + # 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. + update_mask = {} + instance = {} + + update_instance_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| + assert options.metadata.key? :"x-goog-api-client" + assert options.metadata[:"x-goog-api-client"].include? "rest" + refute options.metadata[:"x-goog-api-client"].include? "grpc" + end + + ::Google::Cloud::Redis::V1beta1::CloudRedis::Rest::ServiceStub.stub :transcode_update_instance_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, update_instance_client_stub do + # Create client + client = ::Google::Cloud::Redis::V1beta1::CloudRedis::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.update_instance({ update_mask: update_mask, instance: instance }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.update_instance update_mask: update_mask, instance: instance do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.update_instance ::Google::Cloud::Redis::V1beta1::UpdateInstanceRequest.new(update_mask: update_mask, instance: instance) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + client.update_instance({ update_mask: update_mask, instance: instance }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + client.update_instance(::Google::Cloud::Redis::V1beta1::UpdateInstanceRequest.new(update_mask: update_mask, instance: instance), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, update_instance_client_stub.call_count + end + end + end + + def test_upgrade_instance + # 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" + redis_version = "hello world" + + upgrade_instance_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| + assert options.metadata.key? :"x-goog-api-client" + assert options.metadata[:"x-goog-api-client"].include? "rest" + refute options.metadata[:"x-goog-api-client"].include? "grpc" + end + + ::Google::Cloud::Redis::V1beta1::CloudRedis::Rest::ServiceStub.stub :transcode_upgrade_instance_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, upgrade_instance_client_stub do + # Create client + client = ::Google::Cloud::Redis::V1beta1::CloudRedis::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.upgrade_instance({ name: name, redis_version: redis_version }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.upgrade_instance name: name, redis_version: redis_version do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.upgrade_instance ::Google::Cloud::Redis::V1beta1::UpgradeInstanceRequest.new(name: name, redis_version: redis_version) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + client.upgrade_instance({ name: name, redis_version: redis_version }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + client.upgrade_instance(::Google::Cloud::Redis::V1beta1::UpgradeInstanceRequest.new(name: name, redis_version: redis_version), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, upgrade_instance_client_stub.call_count + end + end + end + + def test_import_instance + # 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" + input_config = {} + + import_instance_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| + assert options.metadata.key? :"x-goog-api-client" + assert options.metadata[:"x-goog-api-client"].include? "rest" + refute options.metadata[:"x-goog-api-client"].include? "grpc" + end + + ::Google::Cloud::Redis::V1beta1::CloudRedis::Rest::ServiceStub.stub :transcode_import_instance_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, import_instance_client_stub do + # Create client + client = ::Google::Cloud::Redis::V1beta1::CloudRedis::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.import_instance({ name: name, input_config: input_config }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.import_instance name: name, input_config: input_config do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.import_instance ::Google::Cloud::Redis::V1beta1::ImportInstanceRequest.new(name: name, input_config: input_config) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + client.import_instance({ name: name, input_config: input_config }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + client.import_instance(::Google::Cloud::Redis::V1beta1::ImportInstanceRequest.new(name: name, input_config: input_config), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, import_instance_client_stub.call_count + end + end + end + + def test_export_instance + # 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" + output_config = {} + + export_instance_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| + assert options.metadata.key? :"x-goog-api-client" + assert options.metadata[:"x-goog-api-client"].include? "rest" + refute options.metadata[:"x-goog-api-client"].include? "grpc" + end + + ::Google::Cloud::Redis::V1beta1::CloudRedis::Rest::ServiceStub.stub :transcode_export_instance_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, export_instance_client_stub do + # Create client + client = ::Google::Cloud::Redis::V1beta1::CloudRedis::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.export_instance({ name: name, output_config: output_config }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.export_instance name: name, output_config: output_config do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.export_instance ::Google::Cloud::Redis::V1beta1::ExportInstanceRequest.new(name: name, output_config: output_config) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + client.export_instance({ name: name, output_config: output_config }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + client.export_instance(::Google::Cloud::Redis::V1beta1::ExportInstanceRequest.new(name: name, output_config: output_config), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, export_instance_client_stub.call_count + end + end + end + + def test_failover_instance + # 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" + data_protection_mode = :DATA_PROTECTION_MODE_UNSPECIFIED + + failover_instance_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| + assert options.metadata.key? :"x-goog-api-client" + assert options.metadata[:"x-goog-api-client"].include? "rest" + refute options.metadata[:"x-goog-api-client"].include? "grpc" + end + + ::Google::Cloud::Redis::V1beta1::CloudRedis::Rest::ServiceStub.stub :transcode_failover_instance_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, failover_instance_client_stub do + # Create client + client = ::Google::Cloud::Redis::V1beta1::CloudRedis::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.failover_instance({ name: name, data_protection_mode: data_protection_mode }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.failover_instance name: name, data_protection_mode: data_protection_mode do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.failover_instance ::Google::Cloud::Redis::V1beta1::FailoverInstanceRequest.new(name: name, data_protection_mode: data_protection_mode) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + client.failover_instance({ name: name, data_protection_mode: data_protection_mode }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + client.failover_instance(::Google::Cloud::Redis::V1beta1::FailoverInstanceRequest.new(name: name, data_protection_mode: data_protection_mode), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, failover_instance_client_stub.call_count + end + end + end + + def test_delete_instance + # 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" + + delete_instance_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| + assert options.metadata.key? :"x-goog-api-client" + assert options.metadata[:"x-goog-api-client"].include? "rest" + refute options.metadata[:"x-goog-api-client"].include? "grpc" + end + + ::Google::Cloud::Redis::V1beta1::CloudRedis::Rest::ServiceStub.stub :transcode_delete_instance_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, delete_instance_client_stub do + # Create client + client = ::Google::Cloud::Redis::V1beta1::CloudRedis::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.delete_instance({ name: name }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.delete_instance name: name do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.delete_instance ::Google::Cloud::Redis::V1beta1::DeleteInstanceRequest.new(name: name) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + client.delete_instance({ name: name }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + client.delete_instance(::Google::Cloud::Redis::V1beta1::DeleteInstanceRequest.new(name: name), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, delete_instance_client_stub.call_count + end + end + end + + def test_reschedule_maintenance + # 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" + reschedule_type = :RESCHEDULE_TYPE_UNSPECIFIED + schedule_time = {} + + reschedule_maintenance_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| + assert options.metadata.key? :"x-goog-api-client" + assert options.metadata[:"x-goog-api-client"].include? "rest" + refute options.metadata[:"x-goog-api-client"].include? "grpc" + end + + ::Google::Cloud::Redis::V1beta1::CloudRedis::Rest::ServiceStub.stub :transcode_reschedule_maintenance_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, reschedule_maintenance_client_stub do + # Create client + client = ::Google::Cloud::Redis::V1beta1::CloudRedis::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.reschedule_maintenance({ name: name, reschedule_type: reschedule_type, schedule_time: schedule_time }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.reschedule_maintenance name: name, reschedule_type: reschedule_type, schedule_time: schedule_time do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.reschedule_maintenance ::Google::Cloud::Redis::V1beta1::RescheduleMaintenanceRequest.new(name: name, reschedule_type: reschedule_type, schedule_time: schedule_time) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + client.reschedule_maintenance({ name: name, reschedule_type: reschedule_type, schedule_time: schedule_time }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + client.reschedule_maintenance(::Google::Cloud::Redis::V1beta1::RescheduleMaintenanceRequest.new(name: name, reschedule_type: reschedule_type, schedule_time: schedule_time), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, reschedule_maintenance_client_stub.call_count + end + end + end + + def test_configure + credentials_token = :dummy_value + + client = block_config = config = nil + dummy_stub = ClientStub.new nil + Gapic::Rest::ClientStub.stub :new, dummy_stub do + client = ::Google::Cloud::Redis::V1beta1::CloudRedis::Rest::Client.new do |config| + config.credentials = credentials_token + end + end + + config = client.configure do |c| + block_config = c + end + + assert_same block_config, config + assert_kind_of ::Google::Cloud::Redis::V1beta1::CloudRedis::Rest::Client::Configuration, config + end +end diff --git a/owl-bot-staging/google-cloud-redis-v1beta1/test/google/cloud/redis/v1beta1/cloud_redis_test.rb b/owl-bot-staging/google-cloud-redis-v1beta1/test/google/cloud/redis/v1beta1/cloud_redis_test.rb new file mode 100644 index 000000000000..6e2eb3e6b755 --- /dev/null +++ b/owl-bot-staging/google-cloud-redis-v1beta1/test/google/cloud/redis/v1beta1/cloud_redis_test.rb @@ -0,0 +1,823 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +require "helper" + +require "gapic/grpc/service_stub" + +require "google/cloud/redis/v1beta1/cloud_redis_pb" +require "google/cloud/redis/v1beta1/cloud_redis" + +class ::Google::Cloud::Redis::V1beta1::CloudRedis::ClientTest < Minitest::Test + class ClientStub + attr_accessor :call_rpc_count, :requests + + def initialize response, operation, &block + @response = response + @operation = operation + @block = block + @call_rpc_count = 0 + @requests = [] + end + + def call_rpc *args, **kwargs + @call_rpc_count += 1 + + @requests << @block&.call(*args, **kwargs) + + catch :response do + yield @response, @operation if block_given? + @response + end + end + + def endpoint + "endpoint.example.com" + end + + def universe_domain + "example.com" + end + + def stub_logger + nil + end + + def logger + nil + end + end + + def test_list_instances + # Create GRPC objects. + grpc_response = ::Google::Cloud::Redis::V1beta1::ListInstancesResponse.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_instances_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :list_instances, name + assert_kind_of ::Google::Cloud::Redis::V1beta1::ListInstancesRequest, 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_instances_client_stub do + # Create client + client = ::Google::Cloud::Redis::V1beta1::CloudRedis::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.list_instances({ 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_instances 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_instances ::Google::Cloud::Redis::V1beta1::ListInstancesRequest.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_instances({ 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_instances(::Google::Cloud::Redis::V1beta1::ListInstancesRequest.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_instances_client_stub.call_rpc_count + end + end + + def test_get_instance + # Create GRPC objects. + grpc_response = ::Google::Cloud::Redis::V1beta1::Instance.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_instance_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :get_instance, name + assert_kind_of ::Google::Cloud::Redis::V1beta1::GetInstanceRequest, request + assert_equal "hello world", request["name"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, get_instance_client_stub do + # Create client + client = ::Google::Cloud::Redis::V1beta1::CloudRedis::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.get_instance({ name: name }) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use named arguments + client.get_instance name: name do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.get_instance ::Google::Cloud::Redis::V1beta1::GetInstanceRequest.new(name: name) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use hash object with options + client.get_instance({ 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_instance(::Google::Cloud::Redis::V1beta1::GetInstanceRequest.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_instance_client_stub.call_rpc_count + end + end + + def test_get_instance_auth_string + # Create GRPC objects. + grpc_response = ::Google::Cloud::Redis::V1beta1::InstanceAuthString.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_instance_auth_string_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :get_instance_auth_string, name + assert_kind_of ::Google::Cloud::Redis::V1beta1::GetInstanceAuthStringRequest, request + assert_equal "hello world", request["name"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, get_instance_auth_string_client_stub do + # Create client + client = ::Google::Cloud::Redis::V1beta1::CloudRedis::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.get_instance_auth_string({ name: name }) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use named arguments + client.get_instance_auth_string name: name do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.get_instance_auth_string ::Google::Cloud::Redis::V1beta1::GetInstanceAuthStringRequest.new(name: name) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use hash object with options + client.get_instance_auth_string({ 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_instance_auth_string(::Google::Cloud::Redis::V1beta1::GetInstanceAuthStringRequest.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_instance_auth_string_client_stub.call_rpc_count + end + end + + def test_create_instance + # 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" + instance_id = "hello world" + instance = {} + + create_instance_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :create_instance, name + assert_kind_of ::Google::Cloud::Redis::V1beta1::CreateInstanceRequest, request + assert_equal "hello world", request["parent"] + assert_equal "hello world", request["instance_id"] + assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::Redis::V1beta1::Instance), request["instance"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, create_instance_client_stub do + # Create client + client = ::Google::Cloud::Redis::V1beta1::CloudRedis::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.create_instance({ parent: parent, instance_id: instance_id, instance: instance }) 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_instance parent: parent, instance_id: instance_id, instance: instance 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_instance ::Google::Cloud::Redis::V1beta1::CreateInstanceRequest.new(parent: parent, instance_id: instance_id, instance: instance) 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_instance({ parent: parent, instance_id: instance_id, instance: instance }, 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_instance(::Google::Cloud::Redis::V1beta1::CreateInstanceRequest.new(parent: parent, instance_id: instance_id, instance: instance), 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_instance_client_stub.call_rpc_count + end + end + + def test_update_instance + # 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. + update_mask = {} + instance = {} + + update_instance_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :update_instance, name + assert_kind_of ::Google::Cloud::Redis::V1beta1::UpdateInstanceRequest, request + assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Protobuf::FieldMask), request["update_mask"] + assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::Redis::V1beta1::Instance), request["instance"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, update_instance_client_stub do + # Create client + client = ::Google::Cloud::Redis::V1beta1::CloudRedis::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.update_instance({ update_mask: update_mask, instance: instance }) 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_instance update_mask: update_mask, instance: instance 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_instance ::Google::Cloud::Redis::V1beta1::UpdateInstanceRequest.new(update_mask: update_mask, instance: instance) 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_instance({ update_mask: update_mask, instance: instance }, 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_instance(::Google::Cloud::Redis::V1beta1::UpdateInstanceRequest.new(update_mask: update_mask, instance: instance), 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_instance_client_stub.call_rpc_count + end + end + + def test_upgrade_instance + # 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" + redis_version = "hello world" + + upgrade_instance_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :upgrade_instance, name + assert_kind_of ::Google::Cloud::Redis::V1beta1::UpgradeInstanceRequest, request + assert_equal "hello world", request["name"] + assert_equal "hello world", request["redis_version"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, upgrade_instance_client_stub do + # Create client + client = ::Google::Cloud::Redis::V1beta1::CloudRedis::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.upgrade_instance({ name: name, redis_version: redis_version }) 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.upgrade_instance name: name, redis_version: redis_version 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.upgrade_instance ::Google::Cloud::Redis::V1beta1::UpgradeInstanceRequest.new(name: name, redis_version: redis_version) 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.upgrade_instance({ name: name, redis_version: redis_version }, 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.upgrade_instance(::Google::Cloud::Redis::V1beta1::UpgradeInstanceRequest.new(name: name, redis_version: redis_version), 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, upgrade_instance_client_stub.call_rpc_count + end + end + + def test_import_instance + # 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" + input_config = {} + + import_instance_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :import_instance, name + assert_kind_of ::Google::Cloud::Redis::V1beta1::ImportInstanceRequest, request + assert_equal "hello world", request["name"] + assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::Redis::V1beta1::InputConfig), request["input_config"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, import_instance_client_stub do + # Create client + client = ::Google::Cloud::Redis::V1beta1::CloudRedis::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.import_instance({ name: name, input_config: input_config }) 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.import_instance name: name, input_config: input_config 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.import_instance ::Google::Cloud::Redis::V1beta1::ImportInstanceRequest.new(name: name, input_config: input_config) 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.import_instance({ name: name, input_config: input_config }, 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.import_instance(::Google::Cloud::Redis::V1beta1::ImportInstanceRequest.new(name: name, input_config: input_config), 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, import_instance_client_stub.call_rpc_count + end + end + + def test_export_instance + # 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" + output_config = {} + + export_instance_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :export_instance, name + assert_kind_of ::Google::Cloud::Redis::V1beta1::ExportInstanceRequest, request + assert_equal "hello world", request["name"] + assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::Redis::V1beta1::OutputConfig), request["output_config"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, export_instance_client_stub do + # Create client + client = ::Google::Cloud::Redis::V1beta1::CloudRedis::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.export_instance({ name: name, output_config: output_config }) 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.export_instance name: name, output_config: output_config 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.export_instance ::Google::Cloud::Redis::V1beta1::ExportInstanceRequest.new(name: name, output_config: output_config) 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.export_instance({ name: name, output_config: output_config }, 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.export_instance(::Google::Cloud::Redis::V1beta1::ExportInstanceRequest.new(name: name, output_config: output_config), 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, export_instance_client_stub.call_rpc_count + end + end + + def test_failover_instance + # 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" + data_protection_mode = :DATA_PROTECTION_MODE_UNSPECIFIED + + failover_instance_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :failover_instance, name + assert_kind_of ::Google::Cloud::Redis::V1beta1::FailoverInstanceRequest, request + assert_equal "hello world", request["name"] + assert_equal :DATA_PROTECTION_MODE_UNSPECIFIED, request["data_protection_mode"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, failover_instance_client_stub do + # Create client + client = ::Google::Cloud::Redis::V1beta1::CloudRedis::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.failover_instance({ name: name, data_protection_mode: data_protection_mode }) 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.failover_instance name: name, data_protection_mode: data_protection_mode 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.failover_instance ::Google::Cloud::Redis::V1beta1::FailoverInstanceRequest.new(name: name, data_protection_mode: data_protection_mode) 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.failover_instance({ name: name, data_protection_mode: data_protection_mode }, 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.failover_instance(::Google::Cloud::Redis::V1beta1::FailoverInstanceRequest.new(name: name, data_protection_mode: data_protection_mode), 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, failover_instance_client_stub.call_rpc_count + end + end + + def test_delete_instance + # 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" + + delete_instance_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :delete_instance, name + assert_kind_of ::Google::Cloud::Redis::V1beta1::DeleteInstanceRequest, request + assert_equal "hello world", request["name"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, delete_instance_client_stub do + # Create client + client = ::Google::Cloud::Redis::V1beta1::CloudRedis::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.delete_instance({ 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.delete_instance 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.delete_instance ::Google::Cloud::Redis::V1beta1::DeleteInstanceRequest.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.delete_instance({ 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.delete_instance(::Google::Cloud::Redis::V1beta1::DeleteInstanceRequest.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, delete_instance_client_stub.call_rpc_count + end + end + + def test_reschedule_maintenance + # 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" + reschedule_type = :RESCHEDULE_TYPE_UNSPECIFIED + schedule_time = {} + + reschedule_maintenance_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :reschedule_maintenance, name + assert_kind_of ::Google::Cloud::Redis::V1beta1::RescheduleMaintenanceRequest, request + assert_equal "hello world", request["name"] + assert_equal :RESCHEDULE_TYPE_UNSPECIFIED, request["reschedule_type"] + assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Protobuf::Timestamp), request["schedule_time"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, reschedule_maintenance_client_stub do + # Create client + client = ::Google::Cloud::Redis::V1beta1::CloudRedis::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.reschedule_maintenance({ name: name, reschedule_type: reschedule_type, schedule_time: schedule_time }) 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.reschedule_maintenance name: name, reschedule_type: reschedule_type, schedule_time: schedule_time 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.reschedule_maintenance ::Google::Cloud::Redis::V1beta1::RescheduleMaintenanceRequest.new(name: name, reschedule_type: reschedule_type, schedule_time: schedule_time) 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.reschedule_maintenance({ name: name, reschedule_type: reschedule_type, schedule_time: schedule_time }, 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.reschedule_maintenance(::Google::Cloud::Redis::V1beta1::RescheduleMaintenanceRequest.new(name: name, reschedule_type: reschedule_type, schedule_time: schedule_time), 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, reschedule_maintenance_client_stub.call_rpc_count + end + end + + def test_configure + grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + + client = block_config = config = nil + dummy_stub = ClientStub.new nil, nil + Gapic::ServiceStub.stub :new, dummy_stub do + client = ::Google::Cloud::Redis::V1beta1::CloudRedis::Client.new do |config| + config.credentials = grpc_channel + end + end + + config = client.configure do |c| + block_config = c + end + + assert_same block_config, config + assert_kind_of ::Google::Cloud::Redis::V1beta1::CloudRedis::Client::Configuration, config + end + + def test_credentials + key = OpenSSL::PKey::RSA.new 2048 + cred_json = { + "private_key" => key.to_pem, + "client_email" => "app@developer.gserviceaccount.com", + "type" => "service_account" + } + key_file = StringIO.new cred_json.to_json + creds = Google::Auth::ServiceAccountCredentials.make_creds({ json_key_io: key_file }) + + dummy_stub = ClientStub.new nil, nil + Gapic::ServiceStub.stub :new, dummy_stub do + client = ::Google::Cloud::Redis::V1beta1::CloudRedis::Client.new do |config| + config.credentials = creds + end + assert_kind_of ::Google::Cloud::Redis::V1beta1::CloudRedis::Client, client + assert_equal creds, client.configure.credentials + end + end + + def test_operations_client + grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + + client = nil + dummy_stub = ClientStub.new nil, nil + Gapic::ServiceStub.stub :new, dummy_stub do + client = ::Google::Cloud::Redis::V1beta1::CloudRedis::Client.new do |config| + config.credentials = grpc_channel + end + end + + assert_kind_of ::Google::Cloud::Redis::V1beta1::CloudRedis::Operations, client.operations_client + end +end diff --git a/owl-bot-staging/google-cloud-redis-v1beta1/test/helper.rb b/owl-bot-staging/google-cloud-redis-v1beta1/test/helper.rb new file mode 100644 index 000000000000..672b337030e7 --- /dev/null +++ b/owl-bot-staging/google-cloud-redis-v1beta1/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" diff --git a/owl-bot-staging/google-cloud-resource_manager-v3/.gitignore b/owl-bot-staging/google-cloud-resource_manager-v3/.gitignore new file mode 100644 index 000000000000..0135b6bc6cfc --- /dev/null +++ b/owl-bot-staging/google-cloud-resource_manager-v3/.gitignore @@ -0,0 +1,22 @@ +# Ignore bundler lockfiles +Gemfile.lock +gems.locked + +# Ignore documentation output +doc/* +.yardoc/* + +# Ignore test output +coverage/* + +# Ignore build artifacts +pkg/* + +# Ignore files commonly present in certain dev environments +.vagrant +.DS_STORE +.idea +*.iml + +# Ignore synth output +__pycache__ diff --git a/owl-bot-staging/google-cloud-resource_manager-v3/.repo-metadata.json b/owl-bot-staging/google-cloud-resource_manager-v3/.repo-metadata.json new file mode 100644 index 000000000000..27f4a651eb95 --- /dev/null +++ b/owl-bot-staging/google-cloud-resource_manager-v3/.repo-metadata.json @@ -0,0 +1,18 @@ +{ + "api_id": "cloudresourcemanager.googleapis.com", + "api_shortname": "cloudresourcemanager", + "client_documentation": "https://cloud.google.com/ruby/docs/reference/google-cloud-resource_manager-v3/latest", + "distribution_name": "google-cloud-resource_manager-v3", + "is_cloud": true, + "language": "ruby", + "name": "cloudresourcemanager", + "name_pretty": "Resource Manager V3 API", + "product_documentation": "https://cloud.google.com/resource-manager/", + "release_level": "unreleased", + "repo": "googleapis/google-cloud-ruby", + "requires_billing": true, + "ruby-cloud-description": "Google Cloud provides container resources such as organizations and projects that allow you to group and hierarchically organize other Google Cloud resources. This hierarchical organization helps you manage common aspects of your resources, such as access control and configuration settings. The Resource Manager API enables you to programmatically manage these container resources. Note that google-cloud-resource_manager-v3 is a version-specific client library. For most uses, we recommend installing the main client library google-cloud-resource_manager instead. See the readme for more details.", + "ruby-cloud-env-prefix": "RESOURCE_MANAGER", + "ruby-cloud-product-url": "https://cloud.google.com/resource-manager/", + "library_type": "GAPIC_AUTO" +} diff --git a/owl-bot-staging/google-cloud-resource_manager-v3/.rubocop.yml b/owl-bot-staging/google-cloud-resource_manager-v3/.rubocop.yml new file mode 100644 index 000000000000..f8826ca0a722 --- /dev/null +++ b/owl-bot-staging/google-cloud-resource_manager-v3/.rubocop.yml @@ -0,0 +1,33 @@ +inherit_gem: + google-style: google-style.yml + +AllCops: + Exclude: + - "google-cloud-resource_manager-v3.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-resource_manager-v3.rb" diff --git a/owl-bot-staging/google-cloud-resource_manager-v3/.toys.rb b/owl-bot-staging/google-cloud-resource_manager-v3/.toys.rb new file mode 100644 index 000000000000..177e22456e8a --- /dev/null +++ b/owl-bot-staging/google-cloud-resource_manager-v3/.toys.rb @@ -0,0 +1,28 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +toys_version! ">= 0.15.3" + +if ENV["RUBY_COMMON_TOOLS"] + common_tools_dir = File.expand_path ENV["RUBY_COMMON_TOOLS"] + load File.join(common_tools_dir, "toys", "gapic") +else + load_git remote: "https://github.com/googleapis/ruby-common-tools.git", + path: "toys/gapic", + update: true +end diff --git a/owl-bot-staging/google-cloud-resource_manager-v3/.yardopts b/owl-bot-staging/google-cloud-resource_manager-v3/.yardopts new file mode 100644 index 000000000000..107c153c5692 --- /dev/null +++ b/owl-bot-staging/google-cloud-resource_manager-v3/.yardopts @@ -0,0 +1,12 @@ +--no-private +--title="Resource Manager V3 API" +--exclude _pb\.rb$ +--markup markdown +--markup-provider redcarpet + +./lib/**/*.rb +./proto_docs/**/*.rb +- +README.md +LICENSE.md +AUTHENTICATION.md diff --git a/owl-bot-staging/google-cloud-resource_manager-v3/AUTHENTICATION.md b/owl-bot-staging/google-cloud-resource_manager-v3/AUTHENTICATION.md new file mode 100644 index 000000000000..89e504497d87 --- /dev/null +++ b/owl-bot-staging/google-cloud-resource_manager-v3/AUTHENTICATION.md @@ -0,0 +1,122 @@ +# Authentication + +The recommended way to authenticate to the google-cloud-resource_manager-v3 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-resource_manager-v3 library provides several mechanisms to configure your system. +Generally, using Application Default Credentials to facilitate automatic +credentials discovery is the easist method. But if you need to explicitly specify +credentials, there are several methods available to you. + +Credentials are accepted in the following ways, in the following order or precedence: + +1. Credentials specified in method arguments +2. Credentials specified in configuration +3. Credentials pointed to or included in environment variables +4. Credentials found in local ADC file +5. Credentials returned by the metadata server for the attached service account (GCP) + +### Configuration + +You can configure a path to a JSON credentials file, either for an individual client object or +globally, for all client objects. The JSON file can contain credentials created for +[workload identity federation](https://cloud.google.com/iam/docs/workload-identity-federation), +[workforce identity federation](https://cloud.google.com/iam/docs/workforce-identity-federation), or a +[service account key](https://cloud.google.com/docs/authentication/provide-credentials-adc#local-key). + +Note: Service account keys are a security risk if not managed correctly. You should +[choose a more secure alternative to service account keys](https://cloud.google.com/docs/authentication#auth-decision-tree) +whenever possible. + +To configure a credentials file for an individual client initialization: + +```ruby +require "google/cloud/resource_manager/v3" + +client = ::Google::Cloud::ResourceManager::V3::Folders::Client.new do |config| + config.credentials = "path/to/credentialfile.json" +end +``` + +To configure a credentials file globally for all clients: + +```ruby +require "google/cloud/resource_manager/v3" + +::Google::Cloud::ResourceManager::V3::Folders::Client.configure do |config| + config.credentials = "path/to/credentialfile.json" +end + +client = ::Google::Cloud::ResourceManager::V3::Folders::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-resource_manager-v3 +checks for credentials are: + +* `GOOGLE_CLOUD_CREDENTIALS` - Path to JSON file, or JSON contents +* `GOOGLE_APPLICATION_CREDENTIALS` - Path to JSON file + +```ruby +require "google/cloud/resource_manager/v3" + +ENV["GOOGLE_APPLICATION_CREDENTIALS"] = "path/to/credentialfile.json" + +client = ::Google::Cloud::ResourceManager::V3::Folders::Client.new +``` + +### Local ADC file + +You can set up a local ADC file with your user credentials for authentication during +development. If credentials are not provided in code or in environment variables, +then the local ADC credentials are discovered. + +Follow the steps in [Quickstart](#quickstart) to set up a local ADC file. + +### Google Cloud Platform environments + +When running on Google Cloud Platform (GCP), including Google Compute Engine +(GCE), Google Kubernetes Engine (GKE), Google App Engine (GAE), Google Cloud +Functions (GCF) and Cloud Run, credentials are retrieved from the attached +service account automatically. Code should be written as if already authenticated. + +For more information, see +[Set up ADC for Google Cloud services](https://cloud.google.com/docs/authentication/provide-credentials-adc#attached-sa). diff --git a/owl-bot-staging/google-cloud-resource_manager-v3/CHANGELOG.md b/owl-bot-staging/google-cloud-resource_manager-v3/CHANGELOG.md new file mode 100644 index 000000000000..f88957a62ba2 --- /dev/null +++ b/owl-bot-staging/google-cloud-resource_manager-v3/CHANGELOG.md @@ -0,0 +1,2 @@ +# Release History + diff --git a/owl-bot-staging/google-cloud-resource_manager-v3/Gemfile b/owl-bot-staging/google-cloud-resource_manager-v3/Gemfile new file mode 100644 index 000000000000..1d08558908d8 --- /dev/null +++ b/owl-bot-staging/google-cloud-resource_manager-v3/Gemfile @@ -0,0 +1,14 @@ +source "https://rubygems.org" + +gemspec + +gem "google-style", "~> 1.32.0" +gem "irb", "~> 1.17" +gem "minitest", "~> 6.0.2" +gem "minitest-focus", "~> 1.4" +gem "minitest-mock", "~> 5.27" +gem "minitest-rg", "~> 5.3" +gem "ostruct", "~> 0.5.5" +gem "rake", ">= 13.0" +gem "redcarpet", "~> 3.6" +gem "yard", "~> 0.9" diff --git a/owl-bot-staging/google-cloud-resource_manager-v3/LICENSE.md b/owl-bot-staging/google-cloud-resource_manager-v3/LICENSE.md new file mode 100644 index 000000000000..c261857ba6ad --- /dev/null +++ b/owl-bot-staging/google-cloud-resource_manager-v3/LICENSE.md @@ -0,0 +1,201 @@ + Apache License + Version 2.0, January 2004 + http://www.apache.org/licenses/ + + TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION + + 1. Definitions. + + "License" shall mean the terms and conditions for use, reproduction, + and distribution as defined by Sections 1 through 9 of this document. + + "Licensor" shall mean the copyright owner or entity authorized by + the copyright owner that is granting the License. + + "Legal Entity" shall mean the union of the acting entity and all + other entities that control, are controlled by, or are under common + control with that entity. For the purposes of this definition, + "control" means (i) the power, direct or indirect, to cause the + direction or management of such entity, whether by contract or + otherwise, or (ii) ownership of fifty percent (50%) or more of the + outstanding shares, or (iii) beneficial ownership of such entity. + + "You" (or "Your") shall mean an individual or Legal Entity + exercising permissions granted by this License. + + "Source" form shall mean the preferred form for making modifications, + including but not limited to software source code, documentation + source, and configuration files. + + "Object" form shall mean any form resulting from mechanical + transformation or translation of a Source form, including but + not limited to compiled object code, generated documentation, + and conversions to other media types. + + "Work" shall mean the work of authorship, whether in Source or + Object form, made available under the License, as indicated by a + copyright notice that is included in or attached to the work + (an example is provided in the Appendix below). + + "Derivative Works" shall mean any work, whether in Source or Object + form, that is based on (or derived from) the Work and for which the + editorial revisions, annotations, elaborations, or other modifications + represent, as a whole, an original work of authorship. For the purposes + of this License, Derivative Works shall not include works that remain + separable from, or merely link (or bind by name) to the interfaces of, + the Work and Derivative Works thereof. + + "Contribution" shall mean any work of authorship, including + the original version of the Work and any modifications or additions + to that Work or Derivative Works thereof, that is intentionally + submitted to Licensor for inclusion in the Work by the copyright owner + or by an individual or Legal Entity authorized to submit on behalf of + the copyright owner. For the purposes of this definition, "submitted" + means any form of electronic, verbal, or written communication sent + to the Licensor or its representatives, including but not limited to + communication on electronic mailing lists, source code control systems, + and issue tracking systems that are managed by, or on behalf of, the + Licensor for the purpose of discussing and improving the Work, but + excluding communication that is conspicuously marked or otherwise + designated in writing by the copyright owner as "Not a Contribution." + + "Contributor" shall mean Licensor and any individual or Legal Entity + on behalf of whom a Contribution has been received by Licensor and + subsequently incorporated within the Work. + + 2. Grant of Copyright License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + copyright license to reproduce, prepare Derivative Works of, + publicly display, publicly perform, sublicense, and distribute the + Work and such Derivative Works in Source or Object form. + + 3. Grant of Patent License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + (except as stated in this section) patent license to make, have made, + use, offer to sell, sell, import, and otherwise transfer the Work, + where such license applies only to those patent claims licensable + by such Contributor that are necessarily infringed by their + Contribution(s) alone or by combination of their Contribution(s) + with the Work to which such Contribution(s) was submitted. If You + institute patent litigation against any entity (including a + cross-claim or counterclaim in a lawsuit) alleging that the Work + or a Contribution incorporated within the Work constitutes direct + or contributory patent infringement, then any patent licenses + granted to You under this License for that Work shall terminate + as of the date such litigation is filed. + + 4. Redistribution. You may reproduce and distribute copies of the + Work or Derivative Works thereof in any medium, with or without + modifications, and in Source or Object form, provided that You + meet the following conditions: + + (a) You must give any other recipients of the Work or + Derivative Works a copy of this License; and + + (b) You must cause any modified files to carry prominent notices + stating that You changed the files; and + + (c) You must retain, in the Source form of any Derivative Works + that You distribute, all copyright, patent, trademark, and + attribution notices from the Source form of the Work, + excluding those notices that do not pertain to any part of + the Derivative Works; and + + (d) If the Work includes a "NOTICE" text file as part of its + distribution, then any Derivative Works that You distribute must + include a readable copy of the attribution notices contained + within such NOTICE file, excluding those notices that do not + pertain to any part of the Derivative Works, in at least one + of the following places: within a NOTICE text file distributed + as part of the Derivative Works; within the Source form or + documentation, if provided along with the Derivative Works; or, + within a display generated by the Derivative Works, if and + wherever such third-party notices normally appear. The contents + of the NOTICE file are for informational purposes only and + do not modify the License. You may add Your own attribution + notices within Derivative Works that You distribute, alongside + or as an addendum to the NOTICE text from the Work, provided + that such additional attribution notices cannot be construed + as modifying the License. + + You may add Your own copyright statement to Your modifications and + may provide additional or different license terms and conditions + for use, reproduction, or distribution of Your modifications, or + for any such Derivative Works as a whole, provided Your use, + reproduction, and distribution of the Work otherwise complies with + the conditions stated in this License. + + 5. Submission of Contributions. Unless You explicitly state otherwise, + any Contribution intentionally submitted for inclusion in the Work + by You to the Licensor shall be under the terms and conditions of + this License, without any additional terms or conditions. + Notwithstanding the above, nothing herein shall supersede or modify + the terms of any separate license agreement you may have executed + with Licensor regarding such Contributions. + + 6. Trademarks. This License does not grant permission to use the trade + names, trademarks, service marks, or product names of the Licensor, + except as required for reasonable and customary use in describing the + origin of the Work and reproducing the content of the NOTICE file. + + 7. Disclaimer of Warranty. Unless required by applicable law or + agreed to in writing, Licensor provides the Work (and each + Contributor provides its Contributions) on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or + implied, including, without limitation, any warranties or conditions + of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A + PARTICULAR PURPOSE. You are solely responsible for determining the + appropriateness of using or redistributing the Work and assume any + risks associated with Your exercise of permissions under this License. + + 8. Limitation of Liability. In no event and under no legal theory, + whether in tort (including negligence), contract, or otherwise, + unless required by applicable law (such as deliberate and grossly + negligent acts) or agreed to in writing, shall any Contributor be + liable to You for damages, including any direct, indirect, special, + incidental, or consequential damages of any character arising as a + result of this License or out of the use or inability to use the + Work (including but not limited to damages for loss of goodwill, + work stoppage, computer failure or malfunction, or any and all + other commercial damages or losses), even if such Contributor + has been advised of the possibility of such damages. + + 9. Accepting Warranty or Additional Liability. While redistributing + the Work or Derivative Works thereof, You may choose to offer, + and charge a fee for, acceptance of support, warranty, indemnity, + or other liability obligations and/or rights consistent with this + License. However, in accepting such obligations, You may act only + on Your own behalf and on Your sole responsibility, not on behalf + of any other Contributor, and only if You agree to indemnify, + defend, and hold each Contributor harmless for any liability + incurred by, or claims asserted against, such Contributor by reason + of your accepting any such warranty or additional liability. + + END OF TERMS AND CONDITIONS + + APPENDIX: How to apply the Apache License to your work. + + To apply the Apache License to your work, attach the following + boilerplate notice, with the fields enclosed by brackets "[]" + replaced with your own identifying information. (Don't include + the brackets!) The text should be enclosed in the appropriate + comment syntax for the file format. We also recommend that a + file or class name and description of purpose be included on the + same "printed page" as the copyright notice for easier + identification within third-party archives. + + Copyright [yyyy] [name of copyright owner] + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. diff --git a/owl-bot-staging/google-cloud-resource_manager-v3/README.md b/owl-bot-staging/google-cloud-resource_manager-v3/README.md new file mode 100644 index 000000000000..f787cb2aa5d4 --- /dev/null +++ b/owl-bot-staging/google-cloud-resource_manager-v3/README.md @@ -0,0 +1,154 @@ +# Ruby Client for the Resource Manager V3 API + +Creates, reads, and updates metadata for Google Cloud Platform resource containers. + +Google Cloud provides container resources such as organizations and projects that allow you to group and hierarchically organize other Google Cloud resources. This hierarchical organization helps you manage common aspects of your resources, such as access control and configuration settings. The Resource Manager API enables you to programmatically manage these container resources. + +https://github.com/googleapis/google-cloud-ruby + +This gem is a _versioned_ client. It provides basic client classes for a +specific version of the Resource Manager V3 API. Most users should consider using +the main client gem, +[google-cloud-resource_manager](https://rubygems.org/gems/google-cloud-resource_manager). +See the section below titled *Which client should I use?* for more information. + +## Installation + +``` +$ gem install google-cloud-resource_manager-v3 +``` + +## 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/cloudresourcemanager.googleapis.com) +1. [Set up authentication.](AUTHENTICATION.md) + +## Quick Start + +```ruby +require "google/cloud/resource_manager/v3" + +client = ::Google::Cloud::ResourceManager::V3::Folders::Client.new +request = ::Google::Cloud::ResourceManager::V3::GetFolderRequest.new # (request fields as keyword arguments...) +response = client.get_folder request +``` + +View the [Client Library Documentation](https://cloud.google.com/ruby/docs/reference/google-cloud-resource_manager-v3/latest) +for class and method documentation. + +See also the [Product Documentation](https://cloud.google.com/resource-manager/) +for general usage information. + +## Debug Logging + +This library comes with opt-in Debug Logging that can help you troubleshoot +your application's integration with the API. When logging is activated, key +events such as requests and responses, along with data payloads and metadata +such as headers and client configuration, are logged to the standard error +stream. + +**WARNING:** Client Library Debug Logging includes your data payloads in +plaintext, which could include sensitive data such as PII for yourself or your +customers, private keys, or other security data that could be compromising if +leaked. Always practice good data hygiene with your application logs, and follow +the principle of least access. Google also recommends that Client Library Debug +Logging be enabled only temporarily during active debugging, and not used +permanently in production. + +To enable logging, set the environment variable `GOOGLE_SDK_RUBY_LOGGING_GEMS` +to the value `all`. Alternatively, you can set the value to a comma-delimited +list of client library gem names. This will select the default logging behavior, +which writes logs to the standard error stream. On a local workstation, this may +result in logs appearing on the console. When running on a Google Cloud hosting +service such as [Google Cloud Run](https://cloud.google.com/run), this generally +results in logs appearing alongside your application logs in the +[Google Cloud Logging](https://cloud.google.com/logging/) service. + +You can customize logging by modifying the `logger` configuration when +constructing a client object. For example: + +```ruby +require "google/cloud/resource_manager/v3" +require "logger" + +client = ::Google::Cloud::ResourceManager::V3::Folders::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-resource_manager`, +and lower-level _versioned_ client libraries with names such as +`google-cloud-resource_manager-v3`. +_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-resource_manager`. +The main client is recommended because it will embody the best practices for +accessing the service, and may also provide more convenient interfaces or +tighter integration into frameworks and third-party libraries. In addition, the +documentation and samples published by Google will generally demonstrate use of +the main client. + +### Why would I want to use a versioned client? + +You can use a versioned client if you are content with a possibly lower-level +class interface, you explicitly want to avoid features provided by the main +client, or you want to access a specific service version not be covered by the +main client. You can identify versioned client gems because the service version +is part of the name, e.g. `google-cloud-resource_manager-v3`. + +### What about the google-apis- clients? + +Client library gems with names that begin with `google-apis-` are based on an +older code generation technology. They talk to a REST/JSON backend (whereas +most modern clients talk to a [gRPC](https://grpc.io/) backend) and they may +not offer the same performance, features, and ease of use provided by more +modern clients. + +The `google-apis-` clients have wide coverage across Google services, so you +might need to use one if there is no modern client available for the service. +However, if a modern client is available, we generally recommend it over the +older `google-apis-` clients. diff --git a/owl-bot-staging/google-cloud-resource_manager-v3/Rakefile b/owl-bot-staging/google-cloud-resource_manager-v3/Rakefile new file mode 100644 index 000000000000..e5be77f3d0a1 --- /dev/null +++ b/owl-bot-staging/google-cloud-resource_manager-v3/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-resource_manager-v3 acceptance tests." +task :acceptance, :project, :keyfile do |t, args| + project = args[:project] + project ||= + ENV["RESOURCE_MANAGER_TEST_PROJECT"] || + ENV["GCLOUD_TEST_PROJECT"] + keyfile = args[:keyfile] + keyfile ||= + ENV["RESOURCE_MANAGER_TEST_KEYFILE"] || + ENV["GCLOUD_TEST_KEYFILE"] + if keyfile + keyfile = File.read keyfile + else + keyfile ||= + ENV["RESOURCE_MANAGER_TEST_KEYFILE_JSON"] || + ENV["GCLOUD_TEST_KEYFILE_JSON"] + end + if project.nil? || keyfile.nil? + fail "You must provide a project and keyfile. e.g. rake acceptance[test123, /path/to/keyfile.json] or RESOURCE_MANAGER_TEST_PROJECT=test123 RESOURCE_MANAGER_TEST_KEYFILE=/path/to/keyfile.json rake acceptance" + end + require "google/cloud/resource_manager/v3/folders/credentials" + ::Google::Cloud::ResourceManager::V3::Folders::Credentials.env_vars.each do |path| + ENV[path] = nil + end + ENV["RESOURCE_MANAGER_PROJECT"] = project + ENV["RESOURCE_MANAGER_TEST_PROJECT"] = project + ENV["RESOURCE_MANAGER_KEYFILE_JSON"] = keyfile + + Rake::Task["acceptance:run"].invoke +end + +namespace :acceptance do + task :run do + if File.directory? "acceptance" + Rake::Task[:smoke_test].invoke + else + puts "The google-cloud-resource_manager-v3 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-resource_manager-v3 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-resource_manager-v3 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-resource_manager-v3 gem does not have doctest tests." +end + +desc "Run the CI build" +task :ci do + header "BUILDING google-cloud-resource_manager-v3" + header "google-cloud-resource_manager-v3 rubocop", "*" + Rake::Task[:rubocop].invoke + header "google-cloud-resource_manager-v3 yard", "*" + Rake::Task[:yard].invoke + header "google-cloud-resource_manager-v3 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-resource_manager-v3 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-resource_manager-v3 acceptance", "*" + Rake::Task[:acceptance].invoke + end + task :a do + # This is a handy shortcut to save typing + Rake::Task["ci:acceptance"].invoke + end +end + +task default: :test + +def header str, token = "#" + line_length = str.length + 8 + puts "" + puts token * line_length + puts "#{token * 3} #{str} #{token * 3}" + puts token * line_length + puts "" +end diff --git a/owl-bot-staging/google-cloud-resource_manager-v3/gapic_metadata.json b/owl-bot-staging/google-cloud-resource_manager-v3/gapic_metadata.json new file mode 100644 index 000000000000..07aa5eb0d009 --- /dev/null +++ b/owl-bot-staging/google-cloud-resource_manager-v3/gapic_metadata.json @@ -0,0 +1,332 @@ +{ + "schema": "1.0", + "comment": "This file maps proto services/RPCs to the corresponding library clients/methods", + "language": "ruby", + "protoPackage": "google.cloud.resourcemanager.v3", + "libraryPackage": "::Google::Cloud::ResourceManager::V3", + "services": { + "Folders": { + "clients": { + "grpc": { + "libraryClient": "::Google::Cloud::ResourceManager::V3::Folders::Client", + "rpcs": { + "GetFolder": { + "methods": [ + "get_folder" + ] + }, + "ListFolders": { + "methods": [ + "list_folders" + ] + }, + "SearchFolders": { + "methods": [ + "search_folders" + ] + }, + "CreateFolder": { + "methods": [ + "create_folder" + ] + }, + "UpdateFolder": { + "methods": [ + "update_folder" + ] + }, + "MoveFolder": { + "methods": [ + "move_folder" + ] + }, + "DeleteFolder": { + "methods": [ + "delete_folder" + ] + }, + "UndeleteFolder": { + "methods": [ + "undelete_folder" + ] + }, + "GetIamPolicy": { + "methods": [ + "get_iam_policy" + ] + }, + "SetIamPolicy": { + "methods": [ + "set_iam_policy" + ] + }, + "TestIamPermissions": { + "methods": [ + "test_iam_permissions" + ] + } + } + } + } + }, + "Organizations": { + "clients": { + "grpc": { + "libraryClient": "::Google::Cloud::ResourceManager::V3::Organizations::Client", + "rpcs": { + "GetOrganization": { + "methods": [ + "get_organization" + ] + }, + "SearchOrganizations": { + "methods": [ + "search_organizations" + ] + }, + "GetIamPolicy": { + "methods": [ + "get_iam_policy" + ] + }, + "SetIamPolicy": { + "methods": [ + "set_iam_policy" + ] + }, + "TestIamPermissions": { + "methods": [ + "test_iam_permissions" + ] + } + } + } + } + }, + "Projects": { + "clients": { + "grpc": { + "libraryClient": "::Google::Cloud::ResourceManager::V3::Projects::Client", + "rpcs": { + "GetProject": { + "methods": [ + "get_project" + ] + }, + "ListProjects": { + "methods": [ + "list_projects" + ] + }, + "SearchProjects": { + "methods": [ + "search_projects" + ] + }, + "CreateProject": { + "methods": [ + "create_project" + ] + }, + "UpdateProject": { + "methods": [ + "update_project" + ] + }, + "MoveProject": { + "methods": [ + "move_project" + ] + }, + "DeleteProject": { + "methods": [ + "delete_project" + ] + }, + "UndeleteProject": { + "methods": [ + "undelete_project" + ] + }, + "GetIamPolicy": { + "methods": [ + "get_iam_policy" + ] + }, + "SetIamPolicy": { + "methods": [ + "set_iam_policy" + ] + }, + "TestIamPermissions": { + "methods": [ + "test_iam_permissions" + ] + } + } + } + } + }, + "TagBindings": { + "clients": { + "grpc": { + "libraryClient": "::Google::Cloud::ResourceManager::V3::TagBindings::Client", + "rpcs": { + "ListTagBindings": { + "methods": [ + "list_tag_bindings" + ] + }, + "CreateTagBinding": { + "methods": [ + "create_tag_binding" + ] + }, + "DeleteTagBinding": { + "methods": [ + "delete_tag_binding" + ] + }, + "ListEffectiveTags": { + "methods": [ + "list_effective_tags" + ] + } + } + } + } + }, + "TagHolds": { + "clients": { + "grpc": { + "libraryClient": "::Google::Cloud::ResourceManager::V3::TagHolds::Client", + "rpcs": { + "CreateTagHold": { + "methods": [ + "create_tag_hold" + ] + }, + "DeleteTagHold": { + "methods": [ + "delete_tag_hold" + ] + }, + "ListTagHolds": { + "methods": [ + "list_tag_holds" + ] + } + } + } + } + }, + "TagKeys": { + "clients": { + "grpc": { + "libraryClient": "::Google::Cloud::ResourceManager::V3::TagKeys::Client", + "rpcs": { + "ListTagKeys": { + "methods": [ + "list_tag_keys" + ] + }, + "GetTagKey": { + "methods": [ + "get_tag_key" + ] + }, + "GetNamespacedTagKey": { + "methods": [ + "get_namespaced_tag_key" + ] + }, + "CreateTagKey": { + "methods": [ + "create_tag_key" + ] + }, + "UpdateTagKey": { + "methods": [ + "update_tag_key" + ] + }, + "DeleteTagKey": { + "methods": [ + "delete_tag_key" + ] + }, + "GetIamPolicy": { + "methods": [ + "get_iam_policy" + ] + }, + "SetIamPolicy": { + "methods": [ + "set_iam_policy" + ] + }, + "TestIamPermissions": { + "methods": [ + "test_iam_permissions" + ] + } + } + } + } + }, + "TagValues": { + "clients": { + "grpc": { + "libraryClient": "::Google::Cloud::ResourceManager::V3::TagValues::Client", + "rpcs": { + "ListTagValues": { + "methods": [ + "list_tag_values" + ] + }, + "GetTagValue": { + "methods": [ + "get_tag_value" + ] + }, + "GetNamespacedTagValue": { + "methods": [ + "get_namespaced_tag_value" + ] + }, + "CreateTagValue": { + "methods": [ + "create_tag_value" + ] + }, + "UpdateTagValue": { + "methods": [ + "update_tag_value" + ] + }, + "DeleteTagValue": { + "methods": [ + "delete_tag_value" + ] + }, + "GetIamPolicy": { + "methods": [ + "get_iam_policy" + ] + }, + "SetIamPolicy": { + "methods": [ + "set_iam_policy" + ] + }, + "TestIamPermissions": { + "methods": [ + "test_iam_permissions" + ] + } + } + } + } + } + } +} diff --git a/owl-bot-staging/google-cloud-resource_manager-v3/google-cloud-resource_manager-v3.gemspec b/owl-bot-staging/google-cloud-resource_manager-v3/google-cloud-resource_manager-v3.gemspec new file mode 100644 index 000000000000..a332bcd8d0f1 --- /dev/null +++ b/owl-bot-staging/google-cloud-resource_manager-v3/google-cloud-resource_manager-v3.gemspec @@ -0,0 +1,29 @@ +# -*- ruby -*- +# encoding: utf-8 + +require File.expand_path("lib/google/cloud/resource_manager/v3/version", __dir__) + +Gem::Specification.new do |gem| + gem.name = "google-cloud-resource_manager-v3" + gem.version = Google::Cloud::ResourceManager::V3::VERSION + + gem.authors = ["Google LLC"] + gem.email = "googleapis-packages@google.com" + gem.description = "Google Cloud provides container resources such as organizations and projects that allow you to group and hierarchically organize other Google Cloud resources. This hierarchical organization helps you manage common aspects of your resources, such as access control and configuration settings. The Resource Manager API enables you to programmatically manage these container resources. Note that google-cloud-resource_manager-v3 is a version-specific client library. For most uses, we recommend installing the main client library google-cloud-resource_manager instead. See the readme for more details." + gem.summary = "Creates, reads, and updates metadata for Google Cloud Platform resource containers." + 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 "grpc-google-iam-v1", "~> 1.11" +end diff --git a/owl-bot-staging/google-cloud-resource_manager-v3/lib/google-cloud-resource_manager-v3.rb b/owl-bot-staging/google-cloud-resource_manager-v3/lib/google-cloud-resource_manager-v3.rb new file mode 100644 index 000000000000..6e07803d3eab --- /dev/null +++ b/owl-bot-staging/google-cloud-resource_manager-v3/lib/google-cloud-resource_manager-v3.rb @@ -0,0 +1,21 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +# This gem does not autoload during Bundler.require. To load this gem, +# issue explicit require statements for the packages desired, e.g.: +# require "google/cloud/resource_manager/v3" diff --git a/owl-bot-staging/google-cloud-resource_manager-v3/lib/google/cloud/resource_manager/v3.rb b/owl-bot-staging/google-cloud-resource_manager-v3/lib/google/cloud/resource_manager/v3.rb new file mode 100644 index 000000000000..709c813ae71a --- /dev/null +++ b/owl-bot-staging/google-cloud-resource_manager-v3/lib/google/cloud/resource_manager/v3.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 "google/cloud/resource_manager/v3/folders" +require "google/cloud/resource_manager/v3/organizations" +require "google/cloud/resource_manager/v3/projects" +require "google/cloud/resource_manager/v3/tag_bindings" +require "google/cloud/resource_manager/v3/tag_holds" +require "google/cloud/resource_manager/v3/tag_keys" +require "google/cloud/resource_manager/v3/tag_values" +require "google/cloud/resource_manager/v3/version" + +module Google + module Cloud + module ResourceManager + ## + # API client module. + # + # @example Load this package, including all its services, and instantiate a gRPC client + # + # require "google/cloud/resource_manager/v3" + # client = ::Google::Cloud::ResourceManager::V3::Folders::Client.new + # + # @example Load this package, including all its services, and instantiate a REST client + # + # require "google/cloud/resource_manager/v3" + # client = ::Google::Cloud::ResourceManager::V3::Folders::Rest::Client.new + # + module V3 + end + end + end +end + +helper_path = ::File.join __dir__, "v3", "_helpers.rb" +require "google/cloud/resource_manager/v3/_helpers" if ::File.file? helper_path diff --git a/owl-bot-staging/google-cloud-resource_manager-v3/lib/google/cloud/resource_manager/v3/folders.rb b/owl-bot-staging/google-cloud-resource_manager-v3/lib/google/cloud/resource_manager/v3/folders.rb new file mode 100644 index 000000000000..dd1e7845bd37 --- /dev/null +++ b/owl-bot-staging/google-cloud-resource_manager-v3/lib/google/cloud/resource_manager/v3/folders.rb @@ -0,0 +1,58 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +require "gapic/common" +require "gapic/config" +require "gapic/config/method" + +require "google/cloud/resource_manager/v3/version" + +require "google/cloud/resource_manager/v3/folders/credentials" +require "google/cloud/resource_manager/v3/folders/paths" +require "google/cloud/resource_manager/v3/folders/operations" +require "google/cloud/resource_manager/v3/folders/client" +require "google/cloud/resource_manager/v3/folders/rest" + +module Google + module Cloud + module ResourceManager + module V3 + ## + # Manages Cloud Platform folder resources. + # Folders can be used to organize the resources under an + # organization and to control the policies applied to groups of resources. + # + # @example Load this service and instantiate a gRPC client + # + # require "google/cloud/resource_manager/v3/folders" + # client = ::Google::Cloud::ResourceManager::V3::Folders::Client.new + # + # @example Load this service and instantiate a REST client + # + # require "google/cloud/resource_manager/v3/folders/rest" + # client = ::Google::Cloud::ResourceManager::V3::Folders::Rest::Client.new + # + module Folders + end + end + end + end +end + +helper_path = ::File.join __dir__, "folders", "helpers.rb" +require "google/cloud/resource_manager/v3/folders/helpers" if ::File.file? helper_path diff --git a/owl-bot-staging/google-cloud-resource_manager-v3/lib/google/cloud/resource_manager/v3/folders/client.rb b/owl-bot-staging/google-cloud-resource_manager-v3/lib/google/cloud/resource_manager/v3/folders/client.rb new file mode 100644 index 000000000000..b6cae8fe19c7 --- /dev/null +++ b/owl-bot-staging/google-cloud-resource_manager-v3/lib/google/cloud/resource_manager/v3/folders/client.rb @@ -0,0 +1,1668 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +require "google/cloud/errors" +require "google/cloud/resourcemanager/v3/folders_pb" + +module Google + module Cloud + module ResourceManager + module V3 + module Folders + ## + # Client for the Folders service. + # + # Manages Cloud Platform folder resources. + # Folders can be used to organize the resources under an + # organization and to control the policies applied to groups of resources. + # + class Client + # @private + API_VERSION = "" + + # @private + DEFAULT_ENDPOINT_TEMPLATE = "cloudresourcemanager.$UNIVERSE_DOMAIN$" + + include Paths + + # @private + attr_reader :folders_stub + + ## + # Configure the Folders Client class. + # + # See {::Google::Cloud::ResourceManager::V3::Folders::Client::Configuration} + # for a description of the configuration fields. + # + # @example + # + # # Modify the configuration for all Folders clients + # ::Google::Cloud::ResourceManager::V3::Folders::Client.configure do |config| + # config.timeout = 10.0 + # end + # + # @yield [config] Configure the Client client. + # @yieldparam config [Client::Configuration] + # + # @return [Client::Configuration] + # + def self.configure + @configure ||= begin + namespace = ["Google", "Cloud", "ResourceManager", "V3"] + 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.get_folder.timeout = 60.0 + default_config.rpcs.get_folder.retry_policy = { + initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [14] + } + + default_config.rpcs.list_folders.timeout = 60.0 + default_config.rpcs.list_folders.retry_policy = { + initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [14] + } + + default_config.rpcs.search_folders.timeout = 60.0 + + default_config.rpcs.create_folder.timeout = 60.0 + + default_config.rpcs.update_folder.timeout = 60.0 + + default_config.rpcs.move_folder.timeout = 60.0 + + default_config.rpcs.delete_folder.timeout = 60.0 + + default_config.rpcs.undelete_folder.timeout = 60.0 + + default_config.rpcs.get_iam_policy.timeout = 60.0 + default_config.rpcs.get_iam_policy.retry_policy = { + initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [14] + } + + default_config.rpcs.set_iam_policy.timeout = 60.0 + + default_config + end + yield @configure if block_given? + @configure + end + + ## + # Configure the Folders Client instance. + # + # The configuration is set to the derived mode, meaning that values can be changed, + # but structural changes (adding new fields, etc.) are not allowed. Structural changes + # should be made on {Client.configure}. + # + # See {::Google::Cloud::ResourceManager::V3::Folders::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 + @folders_stub.universe_domain + end + + ## + # Create a new Folders client object. + # + # @example + # + # # Create a client using the default configuration + # client = ::Google::Cloud::ResourceManager::V3::Folders::Client.new + # + # # Create a client using a custom configuration + # client = ::Google::Cloud::ResourceManager::V3::Folders::Client.new do |config| + # config.timeout = 10.0 + # end + # + # @yield [config] Configure the Folders client. + # @yieldparam config [Client::Configuration] + # + def initialize + # These require statements are intentionally placed here to initialize + # the gRPC module only when it's required. + # See https://github.com/googleapis/toolkit/issues/446 + require "gapic/grpc" + require "google/cloud/resourcemanager/v3/folders_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 + + @folders_stub = ::Gapic::ServiceStub.new( + ::Google::Cloud::ResourceManager::V3::Folders::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 + ) + + @folders_stub.stub_logger&.info do |entry| + entry.set_system_name + entry.set_service + entry.message = "Created client for #{entry.service}" + entry.set_credentials_fields credentials + entry.set "customEndpoint", @config.endpoint if @config.endpoint + entry.set "defaultTimeout", @config.timeout if @config.timeout + entry.set "quotaProject", @quota_project_id if @quota_project_id + end + end + + ## + # Get the associated client for long-running operations. + # + # @return [::Google::Cloud::ResourceManager::V3::Folders::Operations] + # + attr_reader :operations_client + + ## + # The logger used for request/response debug logging. + # + # @return [Logger] + # + def logger + @folders_stub.logger + end + + # Service calls + + ## + # Retrieves a folder identified by the supplied resource name. + # Valid folder resource names have the format `folders/{folder_id}` + # (for example, `folders/1234`). + # The caller must have `resourcemanager.folders.get` permission on the + # identified folder. + # + # @overload get_folder(request, options = nil) + # Pass arguments to `get_folder` via a request object, either of type + # {::Google::Cloud::ResourceManager::V3::GetFolderRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::ResourceManager::V3::GetFolderRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. + # + # @overload get_folder(name: nil) + # Pass arguments to `get_folder` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param name [::String] + # Required. The resource name of the folder to retrieve. + # Must be of the form `folders/{folder_id}`. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Google::Cloud::ResourceManager::V3::Folder] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Google::Cloud::ResourceManager::V3::Folder] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/resource_manager/v3" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::ResourceManager::V3::Folders::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::ResourceManager::V3::GetFolderRequest.new + # + # # Call the get_folder method. + # result = client.get_folder request + # + # # The returned object is of type Google::Cloud::ResourceManager::V3::Folder. + # p result + # + def get_folder request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::ResourceManager::V3::GetFolderRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + metadata = @config.rpcs.get_folder.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::ResourceManager::V3::VERSION + metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.name + header_params["name"] = request.name + end + + request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") + metadata[:"x-goog-request-params"] ||= request_params_header + + options.apply_defaults timeout: @config.rpcs.get_folder.timeout, + metadata: metadata, + retry_policy: @config.rpcs.get_folder.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @folders_stub.call_rpc :get_folder, request, options: options do |response, operation| + yield response, operation if block_given? + end + rescue ::GRPC::BadStatus => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Lists the folders that are direct descendants of supplied parent resource. + # `list()` provides a strongly consistent view of the folders underneath + # the specified parent resource. + # `list()` returns folders sorted based upon the (ascending) lexical ordering + # of their display_name. + # The caller must have `resourcemanager.folders.list` permission on the + # identified parent. + # + # @overload list_folders(request, options = nil) + # Pass arguments to `list_folders` via a request object, either of type + # {::Google::Cloud::ResourceManager::V3::ListFoldersRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::ResourceManager::V3::ListFoldersRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. + # + # @overload list_folders(parent: nil, page_size: nil, page_token: nil, show_deleted: nil) + # Pass arguments to `list_folders` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param parent [::String] + # Required. The name of the parent resource whose folders are being listed. + # Only children of this parent resource are listed; descendants are not + # listed. + # + # If the parent is a folder, use the value `folders/{folder_id}`. If the + # parent is an organization, use the value `organizations/{org_id}`. + # + # Access to this method is controlled by checking the + # `resourcemanager.folders.list` permission on the `parent`. + # @param page_size [::Integer] + # Optional. The maximum number of folders to return in the response. The + # server can return fewer folders than requested. If unspecified, server + # picks an appropriate default. + # @param page_token [::String] + # Optional. A pagination token returned from a previous call to `ListFolders` + # that indicates where this listing should continue from. + # @param show_deleted [::Boolean] + # Optional. Controls whether folders in the + # {::Google::Cloud::ResourceManager::V3::Folder::State::DELETE_REQUESTED DELETE_REQUESTED} + # state should be returned. Defaults to false. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Gapic::PagedEnumerable<::Google::Cloud::ResourceManager::V3::Folder>] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Gapic::PagedEnumerable<::Google::Cloud::ResourceManager::V3::Folder>] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/resource_manager/v3" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::ResourceManager::V3::Folders::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::ResourceManager::V3::ListFoldersRequest.new + # + # # Call the list_folders method. + # result = client.list_folders request + # + # # The returned object is of type Gapic::PagedEnumerable. You can iterate + # # over elements, and API calls will be issued to fetch pages as needed. + # result.each do |item| + # # Each element is of type ::Google::Cloud::ResourceManager::V3::Folder. + # p item + # end + # + def list_folders request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::ResourceManager::V3::ListFoldersRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + metadata = @config.rpcs.list_folders.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::ResourceManager::V3::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.list_folders.timeout, + metadata: metadata, + retry_policy: @config.rpcs.list_folders.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @folders_stub.call_rpc :list_folders, request, options: options do |response, operation| + response = ::Gapic::PagedEnumerable.new @folders_stub, :list_folders, request, response, operation, options + yield response, operation if block_given? + throw :response, response + end + rescue ::GRPC::BadStatus => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Search for folders that match specific filter criteria. + # `search()` provides an eventually consistent view of the folders a user has + # access to which meet the specified filter criteria. + # + # This will only return folders on which the caller has the + # permission `resourcemanager.folders.get`. + # + # @overload search_folders(request, options = nil) + # Pass arguments to `search_folders` via a request object, either of type + # {::Google::Cloud::ResourceManager::V3::SearchFoldersRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::ResourceManager::V3::SearchFoldersRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_folders(page_size: nil, page_token: nil, query: nil) + # Pass arguments to `search_folders` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param page_size [::Integer] + # Optional. The maximum number of folders to return in the response. The + # server can return fewer folders than requested. If unspecified, server + # picks an appropriate default. + # @param page_token [::String] + # Optional. A pagination token returned from a previous call to + # `SearchFolders` that indicates from where search should continue. + # @param query [::String] + # Optional. Search criteria used to select the folders to return. + # If no search criteria is specified then all accessible folders will be + # returned. + # + # Query expressions can be used to restrict results based upon displayName, + # state and parent, where the operators `=` (`:`) `NOT`, `AND` and `OR` + # can be used along with the suffix wildcard symbol `*`. + # + # The `displayName` field in a query expression should use escaped quotes + # for values that include whitespace to prevent unexpected behavior. + # + # ``` + # | Field | Description | + # |-------------------------|----------------------------------------| + # | displayName | Filters by displayName. | + # | parent | Filters by parent (for example: folders/123). | + # | state, lifecycleState | Filters by state. | + # ``` + # + # Some example queries are: + # + # * Query `displayName=Test*` returns Folder resources whose display name + # starts with "Test". + # * Query `state=ACTIVE` returns Folder resources with + # `state` set to `ACTIVE`. + # * Query `parent=folders/123` returns Folder resources that have + # `folders/123` as a parent resource. + # * Query `parent=folders/123 AND state=ACTIVE` returns active + # Folder resources that have `folders/123` as a parent resource. + # * Query `displayName=\\"Test String\\"` returns Folder resources with + # display names that include both "Test" and "String". + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Gapic::PagedEnumerable<::Google::Cloud::ResourceManager::V3::Folder>] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Gapic::PagedEnumerable<::Google::Cloud::ResourceManager::V3::Folder>] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/resource_manager/v3" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::ResourceManager::V3::Folders::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::ResourceManager::V3::SearchFoldersRequest.new + # + # # Call the search_folders method. + # result = client.search_folders request + # + # # The returned object is of type Gapic::PagedEnumerable. You can iterate + # # over elements, and API calls will be issued to fetch pages as needed. + # result.each do |item| + # # Each element is of type ::Google::Cloud::ResourceManager::V3::Folder. + # p item + # end + # + def search_folders request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::ResourceManager::V3::SearchFoldersRequest + + # Converts hash 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_folders.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::ResourceManager::V3::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.search_folders.timeout, + metadata: metadata, + retry_policy: @config.rpcs.search_folders.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @folders_stub.call_rpc :search_folders, request, options: options do |response, operation| + response = ::Gapic::PagedEnumerable.new @folders_stub, :search_folders, request, response, operation, options + yield response, operation if block_given? + throw :response, response + end + rescue ::GRPC::BadStatus => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Creates a folder in the resource hierarchy. + # Returns an `Operation` which can be used to track the progress of the + # folder creation workflow. + # Upon success, the `Operation.response` field will be populated with the + # created Folder. + # + # In order to succeed, the addition of this new folder must not violate + # the folder naming, height, or fanout constraints. + # + # + The folder's `display_name` must be distinct from all other folders that + # share its parent. + # + The addition of the folder must not cause the active folder hierarchy + # to exceed a height of 10. Note, the full active + deleted folder hierarchy + # is allowed to reach a height of 20; this provides additional headroom when + # moving folders that contain deleted folders. + # + The addition of the folder must not cause the total number of folders + # under its parent to exceed 300. + # + # If the operation fails due to a folder constraint violation, some errors + # may be returned by the `CreateFolder` request, with status code + # `FAILED_PRECONDITION` and an error description. Other folder constraint + # violations will be communicated in the `Operation`, with the specific + # `PreconditionFailure` returned in the details list in the `Operation.error` + # field. + # + # The caller must have `resourcemanager.folders.create` permission on the + # identified parent. + # + # @overload create_folder(request, options = nil) + # Pass arguments to `create_folder` via a request object, either of type + # {::Google::Cloud::ResourceManager::V3::CreateFolderRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::ResourceManager::V3::CreateFolderRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. + # + # @overload create_folder(folder: nil) + # Pass arguments to `create_folder` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param folder [::Google::Cloud::ResourceManager::V3::Folder, ::Hash] + # Required. The folder being created, only the display name and parent will + # be consulted. All other fields will be ignored. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Gapic::Operation] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Gapic::Operation] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/resource_manager/v3" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::ResourceManager::V3::Folders::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::ResourceManager::V3::CreateFolderRequest.new + # + # # Call the create_folder method. + # result = client.create_folder request + # + # # The returned object is of type Gapic::Operation. You can use it to + # # check the status of an operation, cancel it, or wait for results. + # # Here is how to wait for a response. + # result.wait_until_done! timeout: 60 + # if result.response? + # p result.response + # else + # puts "No response received." + # end + # + def create_folder request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::ResourceManager::V3::CreateFolderRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + metadata = @config.rpcs.create_folder.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::ResourceManager::V3::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.create_folder.timeout, + metadata: metadata, + retry_policy: @config.rpcs.create_folder.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @folders_stub.call_rpc :create_folder, request, options: options do |response, operation| + response = ::Gapic::Operation.new response, @operations_client, options: options + yield response, operation if block_given? + throw :response, response + end + rescue ::GRPC::BadStatus => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Updates a folder, changing its `display_name`. + # Changes to the folder `display_name` will be rejected if they violate + # either the `display_name` formatting rules or the naming constraints + # described in the + # {::Google::Cloud::ResourceManager::V3::Folders::Client#create_folder CreateFolder} + # documentation. + # + # The folder's `display_name` must start and end with a letter or digit, + # may contain letters, digits, spaces, hyphens and underscores and can be + # between 3 and 30 characters. This is captured by the regular expression: + # `[\p{L}\p{N}][\p{L}\p{N}_- ]{1,28}[\p{L}\p{N}]`. + # The caller must have `resourcemanager.folders.update` permission on the + # identified folder. + # + # If the update fails due to the unique name constraint then a + # `PreconditionFailure` explaining this violation will be returned + # in the Status.details field. + # + # @overload update_folder(request, options = nil) + # Pass arguments to `update_folder` via a request object, either of type + # {::Google::Cloud::ResourceManager::V3::UpdateFolderRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::ResourceManager::V3::UpdateFolderRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. + # + # @overload update_folder(folder: nil, update_mask: nil) + # Pass arguments to `update_folder` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param folder [::Google::Cloud::ResourceManager::V3::Folder, ::Hash] + # Required. The new definition of the Folder. It must include the `name` + # field, which cannot be changed. + # @param update_mask [::Google::Protobuf::FieldMask, ::Hash] + # Required. Fields to be updated. + # Only the `display_name` can be updated. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Gapic::Operation] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Gapic::Operation] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/resource_manager/v3" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::ResourceManager::V3::Folders::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::ResourceManager::V3::UpdateFolderRequest.new + # + # # Call the update_folder method. + # result = client.update_folder request + # + # # The returned object is of type Gapic::Operation. You can use it to + # # check the status of an operation, cancel it, or wait for results. + # # Here is how to wait for a response. + # result.wait_until_done! timeout: 60 + # if result.response? + # p result.response + # else + # puts "No response received." + # end + # + def update_folder request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::ResourceManager::V3::UpdateFolderRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + metadata = @config.rpcs.update_folder.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::ResourceManager::V3::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.folder&.name + header_params["folder.name"] = request.folder.name + end + + request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") + metadata[:"x-goog-request-params"] ||= request_params_header + + options.apply_defaults timeout: @config.rpcs.update_folder.timeout, + metadata: metadata, + retry_policy: @config.rpcs.update_folder.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @folders_stub.call_rpc :update_folder, request, options: options do |response, operation| + response = ::Gapic::Operation.new response, @operations_client, options: options + yield response, operation if block_given? + throw :response, response + end + rescue ::GRPC::BadStatus => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Moves a folder under a new resource parent. + # Returns an `Operation` which can be used to track the progress of the + # folder move workflow. + # Upon success, the `Operation.response` field will be populated with the + # moved folder. + # Upon failure, a `FolderOperationError` categorizing the failure cause will + # be returned - if the failure occurs synchronously then the + # `FolderOperationError` will be returned in the `Status.details` field. + # If it occurs asynchronously, then the FolderOperation will be returned + # in the `Operation.error` field. + # In addition, the `Operation.metadata` field will be populated with a + # `FolderOperation` message as an aid to stateless clients. + # Folder moves will be rejected if they violate either the naming, height, + # or fanout constraints described in the + # {::Google::Cloud::ResourceManager::V3::Folders::Client#create_folder CreateFolder} + # documentation. The caller must have `resourcemanager.folders.move` + # permission on the folder's current and proposed new parent. + # + # @overload move_folder(request, options = nil) + # Pass arguments to `move_folder` via a request object, either of type + # {::Google::Cloud::ResourceManager::V3::MoveFolderRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::ResourceManager::V3::MoveFolderRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. + # + # @overload move_folder(name: nil, destination_parent: nil) + # Pass arguments to `move_folder` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param name [::String] + # Required. The resource name of the Folder to move. + # Must be of the form folders/\\{folder_id} + # @param destination_parent [::String] + # Required. The resource name of the folder or organization which should be + # the folder's new parent. Must be of the form `folders/{folder_id}` or + # `organizations/{org_id}`. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Gapic::Operation] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Gapic::Operation] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/resource_manager/v3" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::ResourceManager::V3::Folders::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::ResourceManager::V3::MoveFolderRequest.new + # + # # Call the move_folder method. + # result = client.move_folder request + # + # # The returned object is of type Gapic::Operation. You can use it to + # # check the status of an operation, cancel it, or wait for results. + # # Here is how to wait for a response. + # result.wait_until_done! timeout: 60 + # if result.response? + # p result.response + # else + # puts "No response received." + # end + # + def move_folder request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::ResourceManager::V3::MoveFolderRequest + + # Converts hash 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.move_folder.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::ResourceManager::V3::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.move_folder.timeout, + metadata: metadata, + retry_policy: @config.rpcs.move_folder.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @folders_stub.call_rpc :move_folder, request, options: options do |response, operation| + response = ::Gapic::Operation.new response, @operations_client, options: options + yield response, operation if block_given? + throw :response, response + end + rescue ::GRPC::BadStatus => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Requests deletion of a folder. The folder is moved into the + # {::Google::Cloud::ResourceManager::V3::Folder::State::DELETE_REQUESTED DELETE_REQUESTED} + # state immediately, and is deleted approximately 30 days later. This method + # may only be called on an empty folder, where a folder is empty if it + # doesn't contain any folders or projects in the + # {::Google::Cloud::ResourceManager::V3::Folder::State::ACTIVE ACTIVE} state. If + # called on a folder in + # {::Google::Cloud::ResourceManager::V3::Folder::State::DELETE_REQUESTED DELETE_REQUESTED} + # state the operation will result in a no-op success. + # The caller must have `resourcemanager.folders.delete` permission on the + # identified folder. + # + # @overload delete_folder(request, options = nil) + # Pass arguments to `delete_folder` via a request object, either of type + # {::Google::Cloud::ResourceManager::V3::DeleteFolderRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::ResourceManager::V3::DeleteFolderRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. + # + # @overload delete_folder(name: nil) + # Pass arguments to `delete_folder` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param name [::String] + # Required. The resource name of the folder to be deleted. + # Must be of the form `folders/{folder_id}`. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Gapic::Operation] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Gapic::Operation] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/resource_manager/v3" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::ResourceManager::V3::Folders::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::ResourceManager::V3::DeleteFolderRequest.new + # + # # Call the delete_folder method. + # result = client.delete_folder request + # + # # The returned object is of type Gapic::Operation. You can use it to + # # check the status of an operation, cancel it, or wait for results. + # # Here is how to wait for a response. + # result.wait_until_done! timeout: 60 + # if result.response? + # p result.response + # else + # puts "No response received." + # end + # + def delete_folder request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::ResourceManager::V3::DeleteFolderRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + metadata = @config.rpcs.delete_folder.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::ResourceManager::V3::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_folder.timeout, + metadata: metadata, + retry_policy: @config.rpcs.delete_folder.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @folders_stub.call_rpc :delete_folder, request, options: options do |response, operation| + response = ::Gapic::Operation.new response, @operations_client, options: options + yield response, operation if block_given? + throw :response, response + end + rescue ::GRPC::BadStatus => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Cancels the deletion request for a folder. This method may be called on a + # folder in any state. If the folder is in the + # {::Google::Cloud::ResourceManager::V3::Folder::State::ACTIVE ACTIVE} state the + # result will be a no-op success. In order to succeed, the folder's parent + # must be in the + # {::Google::Cloud::ResourceManager::V3::Folder::State::ACTIVE ACTIVE} state. In + # addition, reintroducing the folder into the tree must not violate folder + # naming, height, and fanout constraints described in the + # {::Google::Cloud::ResourceManager::V3::Folders::Client#create_folder CreateFolder} + # documentation. The caller must have `resourcemanager.folders.undelete` + # permission on the identified folder. + # + # @overload undelete_folder(request, options = nil) + # Pass arguments to `undelete_folder` via a request object, either of type + # {::Google::Cloud::ResourceManager::V3::UndeleteFolderRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::ResourceManager::V3::UndeleteFolderRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. + # + # @overload undelete_folder(name: nil) + # Pass arguments to `undelete_folder` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param name [::String] + # Required. The resource name of the folder to undelete. + # Must be of the form `folders/{folder_id}`. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Gapic::Operation] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Gapic::Operation] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/resource_manager/v3" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::ResourceManager::V3::Folders::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::ResourceManager::V3::UndeleteFolderRequest.new + # + # # Call the undelete_folder method. + # result = client.undelete_folder request + # + # # The returned object is of type Gapic::Operation. You can use it to + # # check the status of an operation, cancel it, or wait for results. + # # Here is how to wait for a response. + # result.wait_until_done! timeout: 60 + # if result.response? + # p result.response + # else + # puts "No response received." + # end + # + def undelete_folder request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::ResourceManager::V3::UndeleteFolderRequest + + # Converts hash 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.undelete_folder.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::ResourceManager::V3::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.undelete_folder.timeout, + metadata: metadata, + retry_policy: @config.rpcs.undelete_folder.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @folders_stub.call_rpc :undelete_folder, request, options: options do |response, operation| + response = ::Gapic::Operation.new response, @operations_client, options: options + yield response, operation if block_given? + throw :response, response + end + rescue ::GRPC::BadStatus => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Gets the access control policy for a folder. The returned policy may be + # empty if no such policy or resource exists. The `resource` field should + # be the folder's resource name, for example: "folders/1234". + # The caller must have `resourcemanager.folders.getIamPolicy` permission + # on the identified folder. + # + # @overload get_iam_policy(request, options = nil) + # Pass arguments to `get_iam_policy` via a request object, either of type + # {::Google::Iam::V1::GetIamPolicyRequest} or an equivalent Hash. + # + # @param request [::Google::Iam::V1::GetIamPolicyRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. + # + # @overload get_iam_policy(resource: nil, options: nil) + # Pass arguments to `get_iam_policy` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param resource [::String] + # REQUIRED: The resource for which the policy is being requested. + # See the operation documentation for the appropriate value for this field. + # @param options [::Google::Iam::V1::GetPolicyOptions, ::Hash] + # OPTIONAL: A `GetPolicyOptions` object for specifying options to + # `GetIamPolicy`. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Google::Iam::V1::Policy] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Google::Iam::V1::Policy] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/resource_manager/v3" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::ResourceManager::V3::Folders::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Iam::V1::GetIamPolicyRequest.new + # + # # Call the get_iam_policy method. + # result = client.get_iam_policy request + # + # # The returned object is of type Google::Iam::V1::Policy. + # p result + # + def get_iam_policy request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Iam::V1::GetIamPolicyRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + metadata = @config.rpcs.get_iam_policy.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::ResourceManager::V3::VERSION + metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.resource + header_params["resource"] = request.resource + end + + request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") + metadata[:"x-goog-request-params"] ||= request_params_header + + options.apply_defaults timeout: @config.rpcs.get_iam_policy.timeout, + metadata: metadata, + retry_policy: @config.rpcs.get_iam_policy.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @folders_stub.call_rpc :get_iam_policy, request, options: options do |response, operation| + yield response, operation if block_given? + end + rescue ::GRPC::BadStatus => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Sets the access control policy on a folder, replacing any existing policy. + # The `resource` field should be the folder's resource name, for example: + # "folders/1234". + # The caller must have `resourcemanager.folders.setIamPolicy` permission + # on the identified folder. + # + # @overload set_iam_policy(request, options = nil) + # Pass arguments to `set_iam_policy` via a request object, either of type + # {::Google::Iam::V1::SetIamPolicyRequest} or an equivalent Hash. + # + # @param request [::Google::Iam::V1::SetIamPolicyRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. + # + # @overload set_iam_policy(resource: nil, policy: nil, update_mask: nil) + # Pass arguments to `set_iam_policy` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param resource [::String] + # REQUIRED: The resource for which the policy is being specified. + # See the operation documentation for the appropriate value for this field. + # @param policy [::Google::Iam::V1::Policy, ::Hash] + # REQUIRED: The complete policy to be applied to the `resource`. The size of + # the policy is limited to a few 10s of KB. An empty policy is a + # valid policy but certain Cloud Platform services (such as Projects) + # might reject them. + # @param update_mask [::Google::Protobuf::FieldMask, ::Hash] + # OPTIONAL: A FieldMask specifying which fields of the policy to modify. Only + # the fields in the mask will be modified. If no mask is provided, the + # following default mask is used: + # + # `paths: "bindings, etag"` + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Google::Iam::V1::Policy] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Google::Iam::V1::Policy] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/resource_manager/v3" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::ResourceManager::V3::Folders::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Iam::V1::SetIamPolicyRequest.new + # + # # Call the set_iam_policy method. + # result = client.set_iam_policy request + # + # # The returned object is of type Google::Iam::V1::Policy. + # p result + # + def set_iam_policy request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Iam::V1::SetIamPolicyRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + metadata = @config.rpcs.set_iam_policy.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::ResourceManager::V3::VERSION + metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.resource + header_params["resource"] = request.resource + end + + request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") + metadata[:"x-goog-request-params"] ||= request_params_header + + options.apply_defaults timeout: @config.rpcs.set_iam_policy.timeout, + metadata: metadata, + retry_policy: @config.rpcs.set_iam_policy.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @folders_stub.call_rpc :set_iam_policy, request, options: options do |response, operation| + yield response, operation if block_given? + end + rescue ::GRPC::BadStatus => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Returns permissions that a caller has on the specified folder. + # The `resource` field should be the folder's resource name, + # for example: "folders/1234". + # + # There are no permissions required for making this API call. + # + # @overload test_iam_permissions(request, options = nil) + # Pass arguments to `test_iam_permissions` via a request object, either of type + # {::Google::Iam::V1::TestIamPermissionsRequest} or an equivalent Hash. + # + # @param request [::Google::Iam::V1::TestIamPermissionsRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. + # + # @overload test_iam_permissions(resource: nil, permissions: nil) + # Pass arguments to `test_iam_permissions` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param resource [::String] + # REQUIRED: The resource for which the policy detail is being requested. + # See the operation documentation for the appropriate value for this field. + # @param permissions [::Array<::String>] + # The set of permissions to check for the `resource`. Permissions with + # wildcards (such as '*' or 'storage.*') are not allowed. For more + # information see + # [IAM Overview](https://cloud.google.com/iam/docs/overview#permissions). + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Google::Iam::V1::TestIamPermissionsResponse] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Google::Iam::V1::TestIamPermissionsResponse] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/resource_manager/v3" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::ResourceManager::V3::Folders::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Iam::V1::TestIamPermissionsRequest.new + # + # # Call the test_iam_permissions method. + # result = client.test_iam_permissions request + # + # # The returned object is of type Google::Iam::V1::TestIamPermissionsResponse. + # p result + # + def test_iam_permissions request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Iam::V1::TestIamPermissionsRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + metadata = @config.rpcs.test_iam_permissions.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::ResourceManager::V3::VERSION + metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.resource + header_params["resource"] = request.resource + end + + request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") + metadata[:"x-goog-request-params"] ||= request_params_header + + options.apply_defaults timeout: @config.rpcs.test_iam_permissions.timeout, + metadata: metadata, + retry_policy: @config.rpcs.test_iam_permissions.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @folders_stub.call_rpc :test_iam_permissions, request, options: options do |response, operation| + yield response, operation if block_given? + end + rescue ::GRPC::BadStatus => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Configuration class for the Folders API. + # + # This class represents the configuration for Folders, + # providing control over timeouts, retry behavior, logging, transport + # parameters, and other low-level controls. Certain parameters can also be + # applied individually to specific RPCs. See + # {::Google::Cloud::ResourceManager::V3::Folders::Client::Configuration::Rpcs} + # for a list of RPCs that can be configured independently. + # + # Configuration can be applied globally to all clients, or to a single client + # on construction. + # + # @example + # + # # Modify the global config, setting the timeout for + # # get_folder to 20 seconds, + # # and all remaining timeouts to 10 seconds. + # ::Google::Cloud::ResourceManager::V3::Folders::Client.configure do |config| + # config.timeout = 10.0 + # config.rpcs.get_folder.timeout = 20.0 + # end + # + # # Apply the above configuration only to a new client. + # client = ::Google::Cloud::ResourceManager::V3::Folders::Client.new do |config| + # config.timeout = 10.0 + # config.rpcs.get_folder.timeout = 20.0 + # end + # + # @!attribute [rw] endpoint + # A custom service endpoint, as a hostname or hostname:port. The default is + # nil, indicating to use the default endpoint in the current universe domain. + # @return [::String,nil] + # @!attribute [rw] credentials + # Credentials to send with calls. You may provide any of the following types: + # * (`Google::Auth::Credentials`) A googleauth credentials object + # (see the [googleauth docs](https://rubydoc.info/gems/googleauth/Google/Auth/Credentials)) + # * (`Signet::OAuth2::Client`) A signet oauth2 client object + # (see the [signet docs](https://rubydoc.info/gems/signet/Signet/OAuth2/Client)) + # * (`GRPC::Core::Channel`) a gRPC channel with included credentials + # * (`GRPC::Core::ChannelCredentials`) a gRPC credentails object + # * (`nil`) indicating no credentials + # + # @note Warning: Passing a `String` to a keyfile path or a `Hash` of credentials + # is deprecated. Providing an unvalidated credential configuration to + # Google APIs can compromise the security of your systems and data. + # + # @example + # + # # The recommended way to provide credentials is to use the `make_creds` method + # # on the appropriate credentials class for your environment. + # + # require "googleauth" + # + # credentials = ::Google::Auth::ServiceAccountCredentials.make_creds( + # json_key_io: ::File.open("/path/to/keyfile.json") + # ) + # + # client = ::Google::Cloud::ResourceManager::V3::Folders::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 = "cloudresourcemanager.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 Folders 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 `get_folder` + # @return [::Gapic::Config::Method] + # + attr_reader :get_folder + ## + # RPC-specific configuration for `list_folders` + # @return [::Gapic::Config::Method] + # + attr_reader :list_folders + ## + # RPC-specific configuration for `search_folders` + # @return [::Gapic::Config::Method] + # + attr_reader :search_folders + ## + # RPC-specific configuration for `create_folder` + # @return [::Gapic::Config::Method] + # + attr_reader :create_folder + ## + # RPC-specific configuration for `update_folder` + # @return [::Gapic::Config::Method] + # + attr_reader :update_folder + ## + # RPC-specific configuration for `move_folder` + # @return [::Gapic::Config::Method] + # + attr_reader :move_folder + ## + # RPC-specific configuration for `delete_folder` + # @return [::Gapic::Config::Method] + # + attr_reader :delete_folder + ## + # RPC-specific configuration for `undelete_folder` + # @return [::Gapic::Config::Method] + # + attr_reader :undelete_folder + ## + # RPC-specific configuration for `get_iam_policy` + # @return [::Gapic::Config::Method] + # + attr_reader :get_iam_policy + ## + # RPC-specific configuration for `set_iam_policy` + # @return [::Gapic::Config::Method] + # + attr_reader :set_iam_policy + ## + # RPC-specific configuration for `test_iam_permissions` + # @return [::Gapic::Config::Method] + # + attr_reader :test_iam_permissions + + # @private + def initialize parent_rpcs = nil + get_folder_config = parent_rpcs.get_folder if parent_rpcs.respond_to? :get_folder + @get_folder = ::Gapic::Config::Method.new get_folder_config + list_folders_config = parent_rpcs.list_folders if parent_rpcs.respond_to? :list_folders + @list_folders = ::Gapic::Config::Method.new list_folders_config + search_folders_config = parent_rpcs.search_folders if parent_rpcs.respond_to? :search_folders + @search_folders = ::Gapic::Config::Method.new search_folders_config + create_folder_config = parent_rpcs.create_folder if parent_rpcs.respond_to? :create_folder + @create_folder = ::Gapic::Config::Method.new create_folder_config + update_folder_config = parent_rpcs.update_folder if parent_rpcs.respond_to? :update_folder + @update_folder = ::Gapic::Config::Method.new update_folder_config + move_folder_config = parent_rpcs.move_folder if parent_rpcs.respond_to? :move_folder + @move_folder = ::Gapic::Config::Method.new move_folder_config + delete_folder_config = parent_rpcs.delete_folder if parent_rpcs.respond_to? :delete_folder + @delete_folder = ::Gapic::Config::Method.new delete_folder_config + undelete_folder_config = parent_rpcs.undelete_folder if parent_rpcs.respond_to? :undelete_folder + @undelete_folder = ::Gapic::Config::Method.new undelete_folder_config + get_iam_policy_config = parent_rpcs.get_iam_policy if parent_rpcs.respond_to? :get_iam_policy + @get_iam_policy = ::Gapic::Config::Method.new get_iam_policy_config + set_iam_policy_config = parent_rpcs.set_iam_policy if parent_rpcs.respond_to? :set_iam_policy + @set_iam_policy = ::Gapic::Config::Method.new set_iam_policy_config + test_iam_permissions_config = parent_rpcs.test_iam_permissions if parent_rpcs.respond_to? :test_iam_permissions + @test_iam_permissions = ::Gapic::Config::Method.new test_iam_permissions_config + + yield self if block_given? + end + end + end + end + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-resource_manager-v3/lib/google/cloud/resource_manager/v3/folders/credentials.rb b/owl-bot-staging/google-cloud-resource_manager-v3/lib/google/cloud/resource_manager/v3/folders/credentials.rb new file mode 100644 index 000000000000..93719366c1f6 --- /dev/null +++ b/owl-bot-staging/google-cloud-resource_manager-v3/lib/google/cloud/resource_manager/v3/folders/credentials.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 "googleauth" + +module Google + module Cloud + module ResourceManager + module V3 + module Folders + # Credentials for the Folders API. + class Credentials < ::Google::Auth::Credentials + self.scope = [ + "https://www.googleapis.com/auth/cloud-platform", + "https://www.googleapis.com/auth/cloud-platform.read-only" + ] + self.env_vars = [ + "RESOURCE_MANAGER_CREDENTIALS", + "RESOURCE_MANAGER_KEYFILE", + "GOOGLE_CLOUD_CREDENTIALS", + "GOOGLE_CLOUD_KEYFILE", + "GCLOUD_KEYFILE", + "RESOURCE_MANAGER_CREDENTIALS_JSON", + "RESOURCE_MANAGER_KEYFILE_JSON", + "GOOGLE_CLOUD_CREDENTIALS_JSON", + "GOOGLE_CLOUD_KEYFILE_JSON", + "GCLOUD_KEYFILE_JSON" + ] + self.paths = [ + "~/.config/google_cloud/application_default_credentials.json" + ] + end + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-resource_manager-v3/lib/google/cloud/resource_manager/v3/folders/operations.rb b/owl-bot-staging/google-cloud-resource_manager-v3/lib/google/cloud/resource_manager/v3/folders/operations.rb new file mode 100644 index 000000000000..3fb94354db23 --- /dev/null +++ b/owl-bot-staging/google-cloud-resource_manager-v3/lib/google/cloud/resource_manager/v3/folders/operations.rb @@ -0,0 +1,841 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +require "gapic/operation" +require "google/longrunning/operations_pb" + +module Google + module Cloud + module ResourceManager + module V3 + module Folders + # Service that implements Longrunning Operations API. + class Operations + # @private + API_VERSION = "" + + # @private + DEFAULT_ENDPOINT_TEMPLATE = "cloudresourcemanager.$UNIVERSE_DOMAIN$" + + # @private + attr_reader :operations_stub + + ## + # Configuration for the Folders 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 Folders 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::ResourceManager::V3::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::ResourceManager::V3::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::ResourceManager::V3::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::ResourceManager::V3::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::ResourceManager::V3::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 = "cloudresourcemanager.googleapis.com" + + config_attr :endpoint, nil, ::String, nil + config_attr :credentials, nil do |value| + allowed = [::String, ::Hash, ::Proc, ::Symbol, ::Google::Auth::Credentials, ::Google::Auth::BaseClient, ::Signet::OAuth2::Client, nil] + allowed += [::GRPC::Core::Channel, ::GRPC::Core::ChannelCredentials] if defined? ::GRPC::Core::Channel + allowed.any? { |klass| klass === value } + end + config_attr :scope, nil, ::String, ::Array, nil + config_attr :lib_name, nil, ::String, nil + config_attr :lib_version, nil, ::String, nil + config_attr(:channel_args, { "grpc.service_config_disable_resolution" => 1 }, ::Hash, nil) + config_attr :interceptors, nil, ::Array, nil + config_attr :timeout, nil, ::Numeric, nil + config_attr :metadata, nil, ::Hash, nil + config_attr :retry_policy, nil, ::Hash, ::Proc, nil + config_attr :quota_project, nil, ::String, nil + config_attr :universe_domain, nil, ::String, nil + config_attr :logger, :default, ::Logger, nil, :default + + # @private + def initialize parent_config = nil + @parent_config = parent_config unless parent_config.nil? + + yield self if block_given? + end + + ## + # Configurations for individual RPCs + # @return [Rpcs] + # + def rpcs + @rpcs ||= begin + parent_rpcs = nil + parent_rpcs = @parent_config.rpcs if defined?(@parent_config) && @parent_config.respond_to?(:rpcs) + Rpcs.new parent_rpcs + end + end + + ## + # Configuration for the channel pool + # @return [::Gapic::ServiceStub::ChannelPool::Configuration] + # + def channel_pool + @channel_pool ||= ::Gapic::ServiceStub::ChannelPool::Configuration.new + end + + ## + # Configuration RPC class for the Operations API. + # + # Includes fields providing the configuration for each RPC in this service. + # Each configuration object is of type `Gapic::Config::Method` and includes + # the following configuration fields: + # + # * `timeout` (*type:* `Numeric`) - The call timeout in seconds + # * `metadata` (*type:* `Hash{Symbol=>String}`) - Additional gRPC headers + # * `retry_policy (*type:* `Hash`) - The retry policy. The policy fields + # include the following keys: + # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds. + # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds. + # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier. + # * `:retry_codes` (*type:* `Array`) - The error codes that should + # trigger a retry. + # + class Rpcs + ## + # RPC-specific configuration for `list_operations` + # @return [::Gapic::Config::Method] + # + attr_reader :list_operations + ## + # RPC-specific configuration for `get_operation` + # @return [::Gapic::Config::Method] + # + attr_reader :get_operation + ## + # RPC-specific configuration for `delete_operation` + # @return [::Gapic::Config::Method] + # + attr_reader :delete_operation + ## + # RPC-specific configuration for `cancel_operation` + # @return [::Gapic::Config::Method] + # + attr_reader :cancel_operation + ## + # RPC-specific configuration for `wait_operation` + # @return [::Gapic::Config::Method] + # + attr_reader :wait_operation + + # @private + def initialize parent_rpcs = nil + list_operations_config = parent_rpcs.list_operations if parent_rpcs.respond_to? :list_operations + @list_operations = ::Gapic::Config::Method.new list_operations_config + get_operation_config = parent_rpcs.get_operation if parent_rpcs.respond_to? :get_operation + @get_operation = ::Gapic::Config::Method.new get_operation_config + delete_operation_config = parent_rpcs.delete_operation if parent_rpcs.respond_to? :delete_operation + @delete_operation = ::Gapic::Config::Method.new delete_operation_config + cancel_operation_config = parent_rpcs.cancel_operation if parent_rpcs.respond_to? :cancel_operation + @cancel_operation = ::Gapic::Config::Method.new cancel_operation_config + wait_operation_config = parent_rpcs.wait_operation if parent_rpcs.respond_to? :wait_operation + @wait_operation = ::Gapic::Config::Method.new wait_operation_config + + yield self if block_given? + end + end + end + end + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-resource_manager-v3/lib/google/cloud/resource_manager/v3/folders/paths.rb b/owl-bot-staging/google-cloud-resource_manager-v3/lib/google/cloud/resource_manager/v3/folders/paths.rb new file mode 100644 index 000000000000..30d27ba77546 --- /dev/null +++ b/owl-bot-staging/google-cloud-resource_manager-v3/lib/google/cloud/resource_manager/v3/folders/paths.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! + + +module Google + module Cloud + module ResourceManager + module V3 + module Folders + # Path helper methods for the Folders API. + module Paths + ## + # Create a fully-qualified Folder resource string. + # + # The resource will be in the following format: + # + # `folders/{folder}` + # + # @param folder [String] + # + # @return [::String] + def folder_path folder: + "folders/#{folder}" + end + + extend self + end + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-resource_manager-v3/lib/google/cloud/resource_manager/v3/folders/rest.rb b/owl-bot-staging/google-cloud-resource_manager-v3/lib/google/cloud/resource_manager/v3/folders/rest.rb new file mode 100644 index 000000000000..c7eec82bdb15 --- /dev/null +++ b/owl-bot-staging/google-cloud-resource_manager-v3/lib/google/cloud/resource_manager/v3/folders/rest.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/rest" +require "gapic/config" +require "gapic/config/method" + +require "google/cloud/resource_manager/v3/version" + +require "google/cloud/resource_manager/v3/folders/credentials" +require "google/cloud/resource_manager/v3/folders/paths" +require "google/cloud/resource_manager/v3/folders/rest/operations" +require "google/cloud/resource_manager/v3/folders/rest/client" + +module Google + module Cloud + module ResourceManager + module V3 + ## + # Manages Cloud Platform folder resources. + # Folders can be used to organize the resources under an + # organization and to control the policies applied to groups of resources. + # + # To load this service and instantiate a REST client: + # + # require "google/cloud/resource_manager/v3/folders/rest" + # client = ::Google::Cloud::ResourceManager::V3::Folders::Rest::Client.new + # + module Folders + # Client for the REST transport + module Rest + end + end + end + end + end +end + +helper_path = ::File.join __dir__, "rest", "helpers.rb" +require "google/cloud/resource_manager/v3/folders/rest/helpers" if ::File.file? helper_path diff --git a/owl-bot-staging/google-cloud-resource_manager-v3/lib/google/cloud/resource_manager/v3/folders/rest/client.rb b/owl-bot-staging/google-cloud-resource_manager-v3/lib/google/cloud/resource_manager/v3/folders/rest/client.rb new file mode 100644 index 000000000000..cadfcf7d1a79 --- /dev/null +++ b/owl-bot-staging/google-cloud-resource_manager-v3/lib/google/cloud/resource_manager/v3/folders/rest/client.rb @@ -0,0 +1,1572 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +require "google/cloud/errors" +require "google/cloud/resourcemanager/v3/folders_pb" +require "google/cloud/resource_manager/v3/folders/rest/service_stub" + +module Google + module Cloud + module ResourceManager + module V3 + module Folders + module Rest + ## + # REST client for the Folders service. + # + # Manages Cloud Platform folder resources. + # Folders can be used to organize the resources under an + # organization and to control the policies applied to groups of resources. + # + class Client + # @private + API_VERSION = "" + + # @private + DEFAULT_ENDPOINT_TEMPLATE = "cloudresourcemanager.$UNIVERSE_DOMAIN$" + + include Paths + + # @private + attr_reader :folders_stub + + ## + # Configure the Folders Client class. + # + # See {::Google::Cloud::ResourceManager::V3::Folders::Rest::Client::Configuration} + # for a description of the configuration fields. + # + # @example + # + # # Modify the configuration for all Folders clients + # ::Google::Cloud::ResourceManager::V3::Folders::Rest::Client.configure do |config| + # config.timeout = 10.0 + # end + # + # @yield [config] Configure the Client client. + # @yieldparam config [Client::Configuration] + # + # @return [Client::Configuration] + # + def self.configure + @configure ||= begin + namespace = ["Google", "Cloud", "ResourceManager", "V3"] + 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.get_folder.timeout = 60.0 + default_config.rpcs.get_folder.retry_policy = { + initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [14] + } + + default_config.rpcs.list_folders.timeout = 60.0 + default_config.rpcs.list_folders.retry_policy = { + initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [14] + } + + default_config.rpcs.search_folders.timeout = 60.0 + + default_config.rpcs.create_folder.timeout = 60.0 + + default_config.rpcs.update_folder.timeout = 60.0 + + default_config.rpcs.move_folder.timeout = 60.0 + + default_config.rpcs.delete_folder.timeout = 60.0 + + default_config.rpcs.undelete_folder.timeout = 60.0 + + default_config.rpcs.get_iam_policy.timeout = 60.0 + default_config.rpcs.get_iam_policy.retry_policy = { + initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [14] + } + + default_config.rpcs.set_iam_policy.timeout = 60.0 + + default_config + end + yield @configure if block_given? + @configure + end + + ## + # Configure the Folders Client instance. + # + # The configuration is set to the derived mode, meaning that values can be changed, + # but structural changes (adding new fields, etc.) are not allowed. Structural changes + # should be made on {Client.configure}. + # + # See {::Google::Cloud::ResourceManager::V3::Folders::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 + @folders_stub.universe_domain + end + + ## + # Create a new Folders REST client object. + # + # @example + # + # # Create a client using the default configuration + # client = ::Google::Cloud::ResourceManager::V3::Folders::Rest::Client.new + # + # # Create a client using a custom configuration + # client = ::Google::Cloud::ResourceManager::V3::Folders::Rest::Client.new do |config| + # config.timeout = 10.0 + # end + # + # @yield [config] Configure the Folders client. + # @yieldparam config [Client::Configuration] + # + def initialize + # Create the configuration object + @config = Configuration.new Client.configure + + # Yield the configuration if needed + yield @config if block_given? + + # Create credentials + credentials = @config.credentials + # Use self-signed JWT if the endpoint is unchanged from default, + # but only if the default endpoint does not have a region prefix. + enable_self_signed_jwt = @config.endpoint.nil? || + (@config.endpoint == Configuration::DEFAULT_ENDPOINT && + !@config.endpoint.split(".").first.include?("-")) + credentials ||= Credentials.default scope: @config.scope, + enable_self_signed_jwt: enable_self_signed_jwt + if credentials.is_a?(::String) || credentials.is_a?(::Hash) + credentials = Credentials.new credentials, scope: @config.scope + end + + @quota_project_id = @config.quota_project + @quota_project_id ||= credentials.quota_project_id if credentials.respond_to? :quota_project_id + + @operations_client = ::Google::Cloud::ResourceManager::V3::Folders::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 + + @folders_stub = ::Google::Cloud::ResourceManager::V3::Folders::Rest::ServiceStub.new( + endpoint: @config.endpoint, + endpoint_template: DEFAULT_ENDPOINT_TEMPLATE, + universe_domain: @config.universe_domain, + credentials: credentials, + logger: @config.logger + ) + + @folders_stub.logger(stub: true)&.info do |entry| + entry.set_system_name + entry.set_service + entry.message = "Created client for #{entry.service}" + entry.set_credentials_fields credentials + entry.set "customEndpoint", @config.endpoint if @config.endpoint + entry.set "defaultTimeout", @config.timeout if @config.timeout + entry.set "quotaProject", @quota_project_id if @quota_project_id + end + end + + ## + # Get the associated client for long-running operations. + # + # @return [::Google::Cloud::ResourceManager::V3::Folders::Rest::Operations] + # + attr_reader :operations_client + + ## + # The logger used for request/response debug logging. + # + # @return [Logger] + # + def logger + @folders_stub.logger + end + + # Service calls + + ## + # Retrieves a folder identified by the supplied resource name. + # Valid folder resource names have the format `folders/{folder_id}` + # (for example, `folders/1234`). + # The caller must have `resourcemanager.folders.get` permission on the + # identified folder. + # + # @overload get_folder(request, options = nil) + # Pass arguments to `get_folder` via a request object, either of type + # {::Google::Cloud::ResourceManager::V3::GetFolderRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::ResourceManager::V3::GetFolderRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @overload get_folder(name: nil) + # Pass arguments to `get_folder` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param name [::String] + # Required. The resource name of the folder to retrieve. + # Must be of the form `folders/{folder_id}`. + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Cloud::ResourceManager::V3::Folder] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::ResourceManager::V3::Folder] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/resource_manager/v3" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::ResourceManager::V3::Folders::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::ResourceManager::V3::GetFolderRequest.new + # + # # Call the get_folder method. + # result = client.get_folder request + # + # # The returned object is of type Google::Cloud::ResourceManager::V3::Folder. + # p result + # + def get_folder request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::ResourceManager::V3::GetFolderRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + call_metadata = @config.rpcs.get_folder.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::ResourceManager::V3::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + options.apply_defaults timeout: @config.rpcs.get_folder.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.get_folder.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @folders_stub.get_folder request, options do |result, operation| + yield result, operation if block_given? + end + rescue ::Gapic::Rest::Error => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Lists the folders that are direct descendants of supplied parent resource. + # `list()` provides a strongly consistent view of the folders underneath + # the specified parent resource. + # `list()` returns folders sorted based upon the (ascending) lexical ordering + # of their display_name. + # The caller must have `resourcemanager.folders.list` permission on the + # identified parent. + # + # @overload list_folders(request, options = nil) + # Pass arguments to `list_folders` via a request object, either of type + # {::Google::Cloud::ResourceManager::V3::ListFoldersRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::ResourceManager::V3::ListFoldersRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @overload list_folders(parent: nil, page_size: nil, page_token: nil, show_deleted: nil) + # Pass arguments to `list_folders` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param parent [::String] + # Required. The name of the parent resource whose folders are being listed. + # Only children of this parent resource are listed; descendants are not + # listed. + # + # If the parent is a folder, use the value `folders/{folder_id}`. If the + # parent is an organization, use the value `organizations/{org_id}`. + # + # Access to this method is controlled by checking the + # `resourcemanager.folders.list` permission on the `parent`. + # @param page_size [::Integer] + # Optional. The maximum number of folders to return in the response. The + # server can return fewer folders than requested. If unspecified, server + # picks an appropriate default. + # @param page_token [::String] + # Optional. A pagination token returned from a previous call to `ListFolders` + # that indicates where this listing should continue from. + # @param show_deleted [::Boolean] + # Optional. Controls whether folders in the + # {::Google::Cloud::ResourceManager::V3::Folder::State::DELETE_REQUESTED DELETE_REQUESTED} + # state should be returned. Defaults to false. + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Gapic::Rest::PagedEnumerable<::Google::Cloud::ResourceManager::V3::Folder>] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Gapic::Rest::PagedEnumerable<::Google::Cloud::ResourceManager::V3::Folder>] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/resource_manager/v3" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::ResourceManager::V3::Folders::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::ResourceManager::V3::ListFoldersRequest.new + # + # # Call the list_folders method. + # result = client.list_folders request + # + # # The returned object is of type Gapic::PagedEnumerable. You can iterate + # # over elements, and API calls will be issued to fetch pages as needed. + # result.each do |item| + # # Each element is of type ::Google::Cloud::ResourceManager::V3::Folder. + # p item + # end + # + def list_folders request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::ResourceManager::V3::ListFoldersRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + call_metadata = @config.rpcs.list_folders.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::ResourceManager::V3::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_folders.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.list_folders.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @folders_stub.list_folders request, options do |result, operation| + result = ::Gapic::Rest::PagedEnumerable.new @folders_stub, :list_folders, "folders", 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 for folders that match specific filter criteria. + # `search()` provides an eventually consistent view of the folders a user has + # access to which meet the specified filter criteria. + # + # This will only return folders on which the caller has the + # permission `resourcemanager.folders.get`. + # + # @overload search_folders(request, options = nil) + # Pass arguments to `search_folders` via a request object, either of type + # {::Google::Cloud::ResourceManager::V3::SearchFoldersRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::ResourceManager::V3::SearchFoldersRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_folders(page_size: nil, page_token: nil, query: nil) + # Pass arguments to `search_folders` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param page_size [::Integer] + # Optional. The maximum number of folders to return in the response. The + # server can return fewer folders than requested. If unspecified, server + # picks an appropriate default. + # @param page_token [::String] + # Optional. A pagination token returned from a previous call to + # `SearchFolders` that indicates from where search should continue. + # @param query [::String] + # Optional. Search criteria used to select the folders to return. + # If no search criteria is specified then all accessible folders will be + # returned. + # + # Query expressions can be used to restrict results based upon displayName, + # state and parent, where the operators `=` (`:`) `NOT`, `AND` and `OR` + # can be used along with the suffix wildcard symbol `*`. + # + # The `displayName` field in a query expression should use escaped quotes + # for values that include whitespace to prevent unexpected behavior. + # + # ``` + # | Field | Description | + # |-------------------------|----------------------------------------| + # | displayName | Filters by displayName. | + # | parent | Filters by parent (for example: folders/123). | + # | state, lifecycleState | Filters by state. | + # ``` + # + # Some example queries are: + # + # * Query `displayName=Test*` returns Folder resources whose display name + # starts with "Test". + # * Query `state=ACTIVE` returns Folder resources with + # `state` set to `ACTIVE`. + # * Query `parent=folders/123` returns Folder resources that have + # `folders/123` as a parent resource. + # * Query `parent=folders/123 AND state=ACTIVE` returns active + # Folder resources that have `folders/123` as a parent resource. + # * Query `displayName=\\"Test String\\"` returns Folder resources with + # display names that include both "Test" and "String". + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Gapic::Rest::PagedEnumerable<::Google::Cloud::ResourceManager::V3::Folder>] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Gapic::Rest::PagedEnumerable<::Google::Cloud::ResourceManager::V3::Folder>] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/resource_manager/v3" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::ResourceManager::V3::Folders::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::ResourceManager::V3::SearchFoldersRequest.new + # + # # Call the search_folders method. + # result = client.search_folders request + # + # # The returned object is of type Gapic::PagedEnumerable. You can iterate + # # over elements, and API calls will be issued to fetch pages as needed. + # result.each do |item| + # # Each element is of type ::Google::Cloud::ResourceManager::V3::Folder. + # p item + # end + # + def search_folders request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::ResourceManager::V3::SearchFoldersRequest + + # Converts hash 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_folders.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::ResourceManager::V3::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_folders.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.search_folders.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @folders_stub.search_folders request, options do |result, operation| + result = ::Gapic::Rest::PagedEnumerable.new @folders_stub, :search_folders, "folders", request, result, options + yield result, operation if block_given? + throw :response, result + end + rescue ::Gapic::Rest::Error => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Creates a folder in the resource hierarchy. + # Returns an `Operation` which can be used to track the progress of the + # folder creation workflow. + # Upon success, the `Operation.response` field will be populated with the + # created Folder. + # + # In order to succeed, the addition of this new folder must not violate + # the folder naming, height, or fanout constraints. + # + # + The folder's `display_name` must be distinct from all other folders that + # share its parent. + # + The addition of the folder must not cause the active folder hierarchy + # to exceed a height of 10. Note, the full active + deleted folder hierarchy + # is allowed to reach a height of 20; this provides additional headroom when + # moving folders that contain deleted folders. + # + The addition of the folder must not cause the total number of folders + # under its parent to exceed 300. + # + # If the operation fails due to a folder constraint violation, some errors + # may be returned by the `CreateFolder` request, with status code + # `FAILED_PRECONDITION` and an error description. Other folder constraint + # violations will be communicated in the `Operation`, with the specific + # `PreconditionFailure` returned in the details list in the `Operation.error` + # field. + # + # The caller must have `resourcemanager.folders.create` permission on the + # identified parent. + # + # @overload create_folder(request, options = nil) + # Pass arguments to `create_folder` via a request object, either of type + # {::Google::Cloud::ResourceManager::V3::CreateFolderRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::ResourceManager::V3::CreateFolderRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @overload create_folder(folder: nil) + # Pass arguments to `create_folder` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param folder [::Google::Cloud::ResourceManager::V3::Folder, ::Hash] + # Required. The folder being created, only the display name and parent will + # be consulted. All other fields will be ignored. + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Gapic::Operation] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Gapic::Operation] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/resource_manager/v3" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::ResourceManager::V3::Folders::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::ResourceManager::V3::CreateFolderRequest.new + # + # # Call the create_folder method. + # result = client.create_folder request + # + # # The returned object is of type Gapic::Operation. You can use it to + # # check the status of an operation, cancel it, or wait for results. + # # Here is how to wait for a response. + # result.wait_until_done! timeout: 60 + # if result.response? + # p result.response + # else + # puts "No response received." + # end + # + def create_folder request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::ResourceManager::V3::CreateFolderRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + call_metadata = @config.rpcs.create_folder.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::ResourceManager::V3::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_folder.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.create_folder.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @folders_stub.create_folder 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 + + ## + # Updates a folder, changing its `display_name`. + # Changes to the folder `display_name` will be rejected if they violate + # either the `display_name` formatting rules or the naming constraints + # described in the + # {::Google::Cloud::ResourceManager::V3::Folders::Rest::Client#create_folder CreateFolder} + # documentation. + # + # The folder's `display_name` must start and end with a letter or digit, + # may contain letters, digits, spaces, hyphens and underscores and can be + # between 3 and 30 characters. This is captured by the regular expression: + # `[\p{L}\p{N}][\p{L}\p{N}_- ]{1,28}[\p{L}\p{N}]`. + # The caller must have `resourcemanager.folders.update` permission on the + # identified folder. + # + # If the update fails due to the unique name constraint then a + # `PreconditionFailure` explaining this violation will be returned + # in the Status.details field. + # + # @overload update_folder(request, options = nil) + # Pass arguments to `update_folder` via a request object, either of type + # {::Google::Cloud::ResourceManager::V3::UpdateFolderRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::ResourceManager::V3::UpdateFolderRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @overload update_folder(folder: nil, update_mask: nil) + # Pass arguments to `update_folder` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param folder [::Google::Cloud::ResourceManager::V3::Folder, ::Hash] + # Required. The new definition of the Folder. It must include the `name` + # field, which cannot be changed. + # @param update_mask [::Google::Protobuf::FieldMask, ::Hash] + # Required. Fields to be updated. + # Only the `display_name` can be updated. + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Gapic::Operation] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Gapic::Operation] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/resource_manager/v3" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::ResourceManager::V3::Folders::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::ResourceManager::V3::UpdateFolderRequest.new + # + # # Call the update_folder method. + # result = client.update_folder request + # + # # The returned object is of type Gapic::Operation. You can use it to + # # check the status of an operation, cancel it, or wait for results. + # # Here is how to wait for a response. + # result.wait_until_done! timeout: 60 + # if result.response? + # p result.response + # else + # puts "No response received." + # end + # + def update_folder request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::ResourceManager::V3::UpdateFolderRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + call_metadata = @config.rpcs.update_folder.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::ResourceManager::V3::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + options.apply_defaults timeout: @config.rpcs.update_folder.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.update_folder.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @folders_stub.update_folder 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 + + ## + # Moves a folder under a new resource parent. + # Returns an `Operation` which can be used to track the progress of the + # folder move workflow. + # Upon success, the `Operation.response` field will be populated with the + # moved folder. + # Upon failure, a `FolderOperationError` categorizing the failure cause will + # be returned - if the failure occurs synchronously then the + # `FolderOperationError` will be returned in the `Status.details` field. + # If it occurs asynchronously, then the FolderOperation will be returned + # in the `Operation.error` field. + # In addition, the `Operation.metadata` field will be populated with a + # `FolderOperation` message as an aid to stateless clients. + # Folder moves will be rejected if they violate either the naming, height, + # or fanout constraints described in the + # {::Google::Cloud::ResourceManager::V3::Folders::Rest::Client#create_folder CreateFolder} + # documentation. The caller must have `resourcemanager.folders.move` + # permission on the folder's current and proposed new parent. + # + # @overload move_folder(request, options = nil) + # Pass arguments to `move_folder` via a request object, either of type + # {::Google::Cloud::ResourceManager::V3::MoveFolderRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::ResourceManager::V3::MoveFolderRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @overload move_folder(name: nil, destination_parent: nil) + # Pass arguments to `move_folder` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param name [::String] + # Required. The resource name of the Folder to move. + # Must be of the form folders/\\{folder_id} + # @param destination_parent [::String] + # Required. The resource name of the folder or organization which should be + # the folder's new parent. Must be of the form `folders/{folder_id}` or + # `organizations/{org_id}`. + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Gapic::Operation] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Gapic::Operation] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/resource_manager/v3" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::ResourceManager::V3::Folders::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::ResourceManager::V3::MoveFolderRequest.new + # + # # Call the move_folder method. + # result = client.move_folder request + # + # # The returned object is of type Gapic::Operation. You can use it to + # # check the status of an operation, cancel it, or wait for results. + # # Here is how to wait for a response. + # result.wait_until_done! timeout: 60 + # if result.response? + # p result.response + # else + # puts "No response received." + # end + # + def move_folder request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::ResourceManager::V3::MoveFolderRequest + + # Converts hash 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.move_folder.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::ResourceManager::V3::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.move_folder.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.move_folder.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @folders_stub.move_folder 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 + + ## + # Requests deletion of a folder. The folder is moved into the + # {::Google::Cloud::ResourceManager::V3::Folder::State::DELETE_REQUESTED DELETE_REQUESTED} + # state immediately, and is deleted approximately 30 days later. This method + # may only be called on an empty folder, where a folder is empty if it + # doesn't contain any folders or projects in the + # {::Google::Cloud::ResourceManager::V3::Folder::State::ACTIVE ACTIVE} state. If + # called on a folder in + # {::Google::Cloud::ResourceManager::V3::Folder::State::DELETE_REQUESTED DELETE_REQUESTED} + # state the operation will result in a no-op success. + # The caller must have `resourcemanager.folders.delete` permission on the + # identified folder. + # + # @overload delete_folder(request, options = nil) + # Pass arguments to `delete_folder` via a request object, either of type + # {::Google::Cloud::ResourceManager::V3::DeleteFolderRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::ResourceManager::V3::DeleteFolderRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @overload delete_folder(name: nil) + # Pass arguments to `delete_folder` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param name [::String] + # Required. The resource name of the folder to be deleted. + # Must be of the form `folders/{folder_id}`. + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Gapic::Operation] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Gapic::Operation] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/resource_manager/v3" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::ResourceManager::V3::Folders::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::ResourceManager::V3::DeleteFolderRequest.new + # + # # Call the delete_folder method. + # result = client.delete_folder request + # + # # The returned object is of type Gapic::Operation. You can use it to + # # check the status of an operation, cancel it, or wait for results. + # # Here is how to wait for a response. + # result.wait_until_done! timeout: 60 + # if result.response? + # p result.response + # else + # puts "No response received." + # end + # + def delete_folder request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::ResourceManager::V3::DeleteFolderRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + call_metadata = @config.rpcs.delete_folder.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::ResourceManager::V3::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_folder.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.delete_folder.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @folders_stub.delete_folder 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 + + ## + # Cancels the deletion request for a folder. This method may be called on a + # folder in any state. If the folder is in the + # {::Google::Cloud::ResourceManager::V3::Folder::State::ACTIVE ACTIVE} state the + # result will be a no-op success. In order to succeed, the folder's parent + # must be in the + # {::Google::Cloud::ResourceManager::V3::Folder::State::ACTIVE ACTIVE} state. In + # addition, reintroducing the folder into the tree must not violate folder + # naming, height, and fanout constraints described in the + # {::Google::Cloud::ResourceManager::V3::Folders::Rest::Client#create_folder CreateFolder} + # documentation. The caller must have `resourcemanager.folders.undelete` + # permission on the identified folder. + # + # @overload undelete_folder(request, options = nil) + # Pass arguments to `undelete_folder` via a request object, either of type + # {::Google::Cloud::ResourceManager::V3::UndeleteFolderRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::ResourceManager::V3::UndeleteFolderRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @overload undelete_folder(name: nil) + # Pass arguments to `undelete_folder` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param name [::String] + # Required. The resource name of the folder to undelete. + # Must be of the form `folders/{folder_id}`. + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Gapic::Operation] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Gapic::Operation] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/resource_manager/v3" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::ResourceManager::V3::Folders::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::ResourceManager::V3::UndeleteFolderRequest.new + # + # # Call the undelete_folder method. + # result = client.undelete_folder request + # + # # The returned object is of type Gapic::Operation. You can use it to + # # check the status of an operation, cancel it, or wait for results. + # # Here is how to wait for a response. + # result.wait_until_done! timeout: 60 + # if result.response? + # p result.response + # else + # puts "No response received." + # end + # + def undelete_folder request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::ResourceManager::V3::UndeleteFolderRequest + + # Converts hash 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.undelete_folder.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::ResourceManager::V3::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.undelete_folder.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.undelete_folder.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @folders_stub.undelete_folder 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 the access control policy for a folder. The returned policy may be + # empty if no such policy or resource exists. The `resource` field should + # be the folder's resource name, for example: "folders/1234". + # The caller must have `resourcemanager.folders.getIamPolicy` permission + # on the identified folder. + # + # @overload get_iam_policy(request, options = nil) + # Pass arguments to `get_iam_policy` via a request object, either of type + # {::Google::Iam::V1::GetIamPolicyRequest} or an equivalent Hash. + # + # @param request [::Google::Iam::V1::GetIamPolicyRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @overload get_iam_policy(resource: nil, options: nil) + # Pass arguments to `get_iam_policy` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param resource [::String] + # REQUIRED: The resource for which the policy is being requested. + # See the operation documentation for the appropriate value for this field. + # @param options [::Google::Iam::V1::GetPolicyOptions, ::Hash] + # OPTIONAL: A `GetPolicyOptions` object for specifying options to + # `GetIamPolicy`. + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Iam::V1::Policy] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Iam::V1::Policy] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/resource_manager/v3" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::ResourceManager::V3::Folders::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Iam::V1::GetIamPolicyRequest.new + # + # # Call the get_iam_policy method. + # result = client.get_iam_policy request + # + # # The returned object is of type Google::Iam::V1::Policy. + # p result + # + def get_iam_policy request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Iam::V1::GetIamPolicyRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + call_metadata = @config.rpcs.get_iam_policy.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::ResourceManager::V3::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + options.apply_defaults timeout: @config.rpcs.get_iam_policy.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.get_iam_policy.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @folders_stub.get_iam_policy request, options do |result, operation| + yield result, operation if block_given? + end + rescue ::Gapic::Rest::Error => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Sets the access control policy on a folder, replacing any existing policy. + # The `resource` field should be the folder's resource name, for example: + # "folders/1234". + # The caller must have `resourcemanager.folders.setIamPolicy` permission + # on the identified folder. + # + # @overload set_iam_policy(request, options = nil) + # Pass arguments to `set_iam_policy` via a request object, either of type + # {::Google::Iam::V1::SetIamPolicyRequest} or an equivalent Hash. + # + # @param request [::Google::Iam::V1::SetIamPolicyRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @overload set_iam_policy(resource: nil, policy: nil, update_mask: nil) + # Pass arguments to `set_iam_policy` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param resource [::String] + # REQUIRED: The resource for which the policy is being specified. + # See the operation documentation for the appropriate value for this field. + # @param policy [::Google::Iam::V1::Policy, ::Hash] + # REQUIRED: The complete policy to be applied to the `resource`. The size of + # the policy is limited to a few 10s of KB. An empty policy is a + # valid policy but certain Cloud Platform services (such as Projects) + # might reject them. + # @param update_mask [::Google::Protobuf::FieldMask, ::Hash] + # OPTIONAL: A FieldMask specifying which fields of the policy to modify. Only + # the fields in the mask will be modified. If no mask is provided, the + # following default mask is used: + # + # `paths: "bindings, etag"` + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Iam::V1::Policy] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Iam::V1::Policy] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/resource_manager/v3" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::ResourceManager::V3::Folders::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Iam::V1::SetIamPolicyRequest.new + # + # # Call the set_iam_policy method. + # result = client.set_iam_policy request + # + # # The returned object is of type Google::Iam::V1::Policy. + # p result + # + def set_iam_policy request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Iam::V1::SetIamPolicyRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + call_metadata = @config.rpcs.set_iam_policy.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::ResourceManager::V3::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + options.apply_defaults timeout: @config.rpcs.set_iam_policy.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.set_iam_policy.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @folders_stub.set_iam_policy request, options do |result, operation| + yield result, operation if block_given? + end + rescue ::Gapic::Rest::Error => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Returns permissions that a caller has on the specified folder. + # The `resource` field should be the folder's resource name, + # for example: "folders/1234". + # + # There are no permissions required for making this API call. + # + # @overload test_iam_permissions(request, options = nil) + # Pass arguments to `test_iam_permissions` via a request object, either of type + # {::Google::Iam::V1::TestIamPermissionsRequest} or an equivalent Hash. + # + # @param request [::Google::Iam::V1::TestIamPermissionsRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @overload test_iam_permissions(resource: nil, permissions: nil) + # Pass arguments to `test_iam_permissions` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param resource [::String] + # REQUIRED: The resource for which the policy detail is being requested. + # See the operation documentation for the appropriate value for this field. + # @param permissions [::Array<::String>] + # The set of permissions to check for the `resource`. Permissions with + # wildcards (such as '*' or 'storage.*') are not allowed. For more + # information see + # [IAM Overview](https://cloud.google.com/iam/docs/overview#permissions). + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Iam::V1::TestIamPermissionsResponse] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Iam::V1::TestIamPermissionsResponse] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/resource_manager/v3" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::ResourceManager::V3::Folders::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Iam::V1::TestIamPermissionsRequest.new + # + # # Call the test_iam_permissions method. + # result = client.test_iam_permissions request + # + # # The returned object is of type Google::Iam::V1::TestIamPermissionsResponse. + # p result + # + def test_iam_permissions request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Iam::V1::TestIamPermissionsRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + call_metadata = @config.rpcs.test_iam_permissions.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::ResourceManager::V3::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + options.apply_defaults timeout: @config.rpcs.test_iam_permissions.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.test_iam_permissions.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @folders_stub.test_iam_permissions request, options do |result, operation| + yield result, operation if block_given? + end + rescue ::Gapic::Rest::Error => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Configuration class for the Folders REST API. + # + # This class represents the configuration for Folders REST, + # providing control over timeouts, retry behavior, logging, transport + # parameters, and other low-level controls. Certain parameters can also be + # applied individually to specific RPCs. See + # {::Google::Cloud::ResourceManager::V3::Folders::Rest::Client::Configuration::Rpcs} + # for a list of RPCs that can be configured independently. + # + # Configuration can be applied globally to all clients, or to a single client + # on construction. + # + # @example + # + # # Modify the global config, setting the timeout for + # # get_folder to 20 seconds, + # # and all remaining timeouts to 10 seconds. + # ::Google::Cloud::ResourceManager::V3::Folders::Rest::Client.configure do |config| + # config.timeout = 10.0 + # config.rpcs.get_folder.timeout = 20.0 + # end + # + # # Apply the above configuration only to a new client. + # client = ::Google::Cloud::ResourceManager::V3::Folders::Rest::Client.new do |config| + # config.timeout = 10.0 + # config.rpcs.get_folder.timeout = 20.0 + # end + # + # @!attribute [rw] endpoint + # A custom service endpoint, as a hostname or hostname:port. The default is + # nil, indicating to use the default endpoint in the current universe domain. + # @return [::String,nil] + # @!attribute [rw] credentials + # Credentials to send with calls. You may provide any of the following types: + # * (`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 = "cloudresourcemanager.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 Folders API. + # + # Includes fields providing the configuration for each RPC in this service. + # Each configuration object is of type `Gapic::Config::Method` and includes + # the following configuration fields: + # + # * `timeout` (*type:* `Numeric`) - The call timeout in seconds + # * `metadata` (*type:* `Hash{Symbol=>String}`) - Additional headers + # * `retry_policy (*type:* `Hash`) - The retry policy. The policy fields + # include the following keys: + # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds. + # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds. + # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier. + # * `:retry_codes` (*type:* `Array`) - The error codes that should + # trigger a retry. + # + class Rpcs + ## + # RPC-specific configuration for `get_folder` + # @return [::Gapic::Config::Method] + # + attr_reader :get_folder + ## + # RPC-specific configuration for `list_folders` + # @return [::Gapic::Config::Method] + # + attr_reader :list_folders + ## + # RPC-specific configuration for `search_folders` + # @return [::Gapic::Config::Method] + # + attr_reader :search_folders + ## + # RPC-specific configuration for `create_folder` + # @return [::Gapic::Config::Method] + # + attr_reader :create_folder + ## + # RPC-specific configuration for `update_folder` + # @return [::Gapic::Config::Method] + # + attr_reader :update_folder + ## + # RPC-specific configuration for `move_folder` + # @return [::Gapic::Config::Method] + # + attr_reader :move_folder + ## + # RPC-specific configuration for `delete_folder` + # @return [::Gapic::Config::Method] + # + attr_reader :delete_folder + ## + # RPC-specific configuration for `undelete_folder` + # @return [::Gapic::Config::Method] + # + attr_reader :undelete_folder + ## + # RPC-specific configuration for `get_iam_policy` + # @return [::Gapic::Config::Method] + # + attr_reader :get_iam_policy + ## + # RPC-specific configuration for `set_iam_policy` + # @return [::Gapic::Config::Method] + # + attr_reader :set_iam_policy + ## + # RPC-specific configuration for `test_iam_permissions` + # @return [::Gapic::Config::Method] + # + attr_reader :test_iam_permissions + + # @private + def initialize parent_rpcs = nil + get_folder_config = parent_rpcs.get_folder if parent_rpcs.respond_to? :get_folder + @get_folder = ::Gapic::Config::Method.new get_folder_config + list_folders_config = parent_rpcs.list_folders if parent_rpcs.respond_to? :list_folders + @list_folders = ::Gapic::Config::Method.new list_folders_config + search_folders_config = parent_rpcs.search_folders if parent_rpcs.respond_to? :search_folders + @search_folders = ::Gapic::Config::Method.new search_folders_config + create_folder_config = parent_rpcs.create_folder if parent_rpcs.respond_to? :create_folder + @create_folder = ::Gapic::Config::Method.new create_folder_config + update_folder_config = parent_rpcs.update_folder if parent_rpcs.respond_to? :update_folder + @update_folder = ::Gapic::Config::Method.new update_folder_config + move_folder_config = parent_rpcs.move_folder if parent_rpcs.respond_to? :move_folder + @move_folder = ::Gapic::Config::Method.new move_folder_config + delete_folder_config = parent_rpcs.delete_folder if parent_rpcs.respond_to? :delete_folder + @delete_folder = ::Gapic::Config::Method.new delete_folder_config + undelete_folder_config = parent_rpcs.undelete_folder if parent_rpcs.respond_to? :undelete_folder + @undelete_folder = ::Gapic::Config::Method.new undelete_folder_config + get_iam_policy_config = parent_rpcs.get_iam_policy if parent_rpcs.respond_to? :get_iam_policy + @get_iam_policy = ::Gapic::Config::Method.new get_iam_policy_config + set_iam_policy_config = parent_rpcs.set_iam_policy if parent_rpcs.respond_to? :set_iam_policy + @set_iam_policy = ::Gapic::Config::Method.new set_iam_policy_config + test_iam_permissions_config = parent_rpcs.test_iam_permissions if parent_rpcs.respond_to? :test_iam_permissions + @test_iam_permissions = ::Gapic::Config::Method.new test_iam_permissions_config + + yield self if block_given? + end + end + end + end + end + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-resource_manager-v3/lib/google/cloud/resource_manager/v3/folders/rest/operations.rb b/owl-bot-staging/google-cloud-resource_manager-v3/lib/google/cloud/resource_manager/v3/folders/rest/operations.rb new file mode 100644 index 000000000000..29a56aadcc1b --- /dev/null +++ b/owl-bot-staging/google-cloud-resource_manager-v3/lib/google/cloud/resource_manager/v3/folders/rest/operations.rb @@ -0,0 +1,925 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +require "gapic/operation" + +module Google + module Cloud + module ResourceManager + module V3 + module Folders + module Rest + # Service that implements Longrunning Operations API. + class Operations + # @private + API_VERSION = "" + + # @private + DEFAULT_ENDPOINT_TEMPLATE = "cloudresourcemanager.$UNIVERSE_DOMAIN$" + + # @private + attr_reader :operations_stub + + ## + # Configuration for the Folders 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 Folders 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::ResourceManager::V3::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::ResourceManager::V3::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::ResourceManager::V3::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::ResourceManager::V3::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 = "cloudresourcemanager.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: "/v3/{name}", + matches: [ + ["name", %r{^operations(?:/.*)?$}, true] + ] + ) + 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 +end diff --git a/owl-bot-staging/google-cloud-resource_manager-v3/lib/google/cloud/resource_manager/v3/folders/rest/service_stub.rb b/owl-bot-staging/google-cloud-resource_manager-v3/lib/google/cloud/resource_manager/v3/folders/rest/service_stub.rb new file mode 100644 index 000000000000..4536767d72e1 --- /dev/null +++ b/owl-bot-staging/google-cloud-resource_manager-v3/lib/google/cloud/resource_manager/v3/folders/rest/service_stub.rb @@ -0,0 +1,753 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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/resourcemanager/v3/folders_pb" + +module Google + module Cloud + module ResourceManager + module V3 + module Folders + module Rest + ## + # REST service stub for the Folders service. + # Service stub contains baseline method implementations + # including transcoding, making the REST call, and deserialing the response. + # + class ServiceStub + # @private + def initialize endpoint:, endpoint_template:, universe_domain:, credentials:, logger: + # These require statements are intentionally placed here to initialize + # the REST modules only when it's required. + require "gapic/rest" + + @client_stub = ::Gapic::Rest::ClientStub.new endpoint: endpoint, + endpoint_template: endpoint_template, + universe_domain: universe_domain, + credentials: credentials, + numeric_enums: true, + service_name: self.class, + raise_faraday_errors: false, + logger: logger + end + + ## + # The effective universe domain + # + # @return [String] + # + def universe_domain + @client_stub.universe_domain + end + + ## + # The effective endpoint + # + # @return [String] + # + def endpoint + @client_stub.endpoint + end + + ## + # The logger used for request/response debug logging. + # + # @return [Logger] + # + def logger stub: false + stub ? @client_stub.stub_logger : @client_stub.logger + end + + ## + # Baseline implementation for the get_folder REST call + # + # @param request_pb [::Google::Cloud::ResourceManager::V3::GetFolderRequest] + # A request object representing the call parameters. Required. + # @param options [::Gapic::CallOptions] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Cloud::ResourceManager::V3::Folder] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::ResourceManager::V3::Folder] + # A result object deserialized from the server's reply + def get_folder request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_get_folder_request request_pb + query_string_params = if query_string_params.any? + query_string_params.to_h { |p| p.split "=", 2 } + else + {} + end + + response = @client_stub.make_http_request( + verb, + uri: uri, + body: body || "", + params: query_string_params, + method_name: "get_folder", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Cloud::ResourceManager::V3::Folder.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_folders REST call + # + # @param request_pb [::Google::Cloud::ResourceManager::V3::ListFoldersRequest] + # A request object representing the call parameters. Required. + # @param options [::Gapic::CallOptions] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Cloud::ResourceManager::V3::ListFoldersResponse] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::ResourceManager::V3::ListFoldersResponse] + # A result object deserialized from the server's reply + def list_folders request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_list_folders_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_folders", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Cloud::ResourceManager::V3::ListFoldersResponse.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_folders REST call + # + # @param request_pb [::Google::Cloud::ResourceManager::V3::SearchFoldersRequest] + # A request object representing the call parameters. Required. + # @param options [::Gapic::CallOptions] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Cloud::ResourceManager::V3::SearchFoldersResponse] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::ResourceManager::V3::SearchFoldersResponse] + # A result object deserialized from the server's reply + def search_folders request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_search_folders_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_folders", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Cloud::ResourceManager::V3::SearchFoldersResponse.decode_json response.body, ignore_unknown_fields: true + catch :response do + yield result, operation if block_given? + result + end + end + + ## + # Baseline implementation for the create_folder REST call + # + # @param request_pb [::Google::Cloud::ResourceManager::V3::CreateFolderRequest] + # 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_folder request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_create_folder_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_folder", + 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 update_folder REST call + # + # @param request_pb [::Google::Cloud::ResourceManager::V3::UpdateFolderRequest] + # 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_folder request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_update_folder_request request_pb + query_string_params = if query_string_params.any? + query_string_params.to_h { |p| p.split "=", 2 } + else + {} + end + + response = @client_stub.make_http_request( + verb, + uri: uri, + body: body || "", + params: query_string_params, + method_name: "update_folder", + 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 move_folder REST call + # + # @param request_pb [::Google::Cloud::ResourceManager::V3::MoveFolderRequest] + # 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 move_folder request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_move_folder_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: "move_folder", + 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_folder REST call + # + # @param request_pb [::Google::Cloud::ResourceManager::V3::DeleteFolderRequest] + # 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_folder request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_delete_folder_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_folder", + 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 undelete_folder REST call + # + # @param request_pb [::Google::Cloud::ResourceManager::V3::UndeleteFolderRequest] + # 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 undelete_folder request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_undelete_folder_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: "undelete_folder", + 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_iam_policy REST call + # + # @param request_pb [::Google::Iam::V1::GetIamPolicyRequest] + # A request object representing the call parameters. Required. + # @param options [::Gapic::CallOptions] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Iam::V1::Policy] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Iam::V1::Policy] + # A result object deserialized from the server's reply + def get_iam_policy request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_get_iam_policy_request request_pb + query_string_params = if query_string_params.any? + query_string_params.to_h { |p| p.split "=", 2 } + else + {} + end + + response = @client_stub.make_http_request( + verb, + uri: uri, + body: body || "", + params: query_string_params, + method_name: "get_iam_policy", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Iam::V1::Policy.decode_json response.body, ignore_unknown_fields: true + catch :response do + yield result, operation if block_given? + result + end + end + + ## + # Baseline implementation for the set_iam_policy REST call + # + # @param request_pb [::Google::Iam::V1::SetIamPolicyRequest] + # A request object representing the call parameters. Required. + # @param options [::Gapic::CallOptions] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Iam::V1::Policy] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Iam::V1::Policy] + # A result object deserialized from the server's reply + def set_iam_policy request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_set_iam_policy_request request_pb + query_string_params = if query_string_params.any? + query_string_params.to_h { |p| p.split "=", 2 } + else + {} + end + + response = @client_stub.make_http_request( + verb, + uri: uri, + body: body || "", + params: query_string_params, + method_name: "set_iam_policy", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Iam::V1::Policy.decode_json response.body, ignore_unknown_fields: true + catch :response do + yield result, operation if block_given? + result + end + end + + ## + # Baseline implementation for the test_iam_permissions REST call + # + # @param request_pb [::Google::Iam::V1::TestIamPermissionsRequest] + # A request object representing the call parameters. Required. + # @param options [::Gapic::CallOptions] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Iam::V1::TestIamPermissionsResponse] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Iam::V1::TestIamPermissionsResponse] + # A result object deserialized from the server's reply + def test_iam_permissions request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_test_iam_permissions_request request_pb + query_string_params = if query_string_params.any? + query_string_params.to_h { |p| p.split "=", 2 } + else + {} + end + + response = @client_stub.make_http_request( + verb, + uri: uri, + body: body || "", + params: query_string_params, + method_name: "test_iam_permissions", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Iam::V1::TestIamPermissionsResponse.decode_json response.body, ignore_unknown_fields: true + catch :response do + yield result, operation if block_given? + result + end + end + + ## + # @private + # + # GRPC transcoding helper method for the get_folder REST call + # + # @param request_pb [::Google::Cloud::ResourceManager::V3::GetFolderRequest] + # A request object representing the call parameters. Required. + # @return [Array(String, [String, nil], Hash{String => String})] + # Uri, Body, Query string parameters + def self.transcode_get_folder_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :get, + uri_template: "/v3/{name}", + matches: [ + ["name", %r{^folders/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the list_folders REST call + # + # @param request_pb [::Google::Cloud::ResourceManager::V3::ListFoldersRequest] + # 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_folders_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :get, + uri_template: "/v3/folders", + matches: [] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the search_folders REST call + # + # @param request_pb [::Google::Cloud::ResourceManager::V3::SearchFoldersRequest] + # 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_folders_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :get, + uri_template: "/v3/folders:search", + matches: [] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the create_folder REST call + # + # @param request_pb [::Google::Cloud::ResourceManager::V3::CreateFolderRequest] + # 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_folder_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :post, + uri_template: "/v3/folders", + body: "folder", + matches: [] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the update_folder REST call + # + # @param request_pb [::Google::Cloud::ResourceManager::V3::UpdateFolderRequest] + # A request object representing the call parameters. Required. + # @return [Array(String, [String, nil], Hash{String => String})] + # Uri, Body, Query string parameters + def self.transcode_update_folder_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :patch, + uri_template: "/v3/{folder.name}", + body: "folder", + matches: [ + ["folder.name", %r{^folders/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the move_folder REST call + # + # @param request_pb [::Google::Cloud::ResourceManager::V3::MoveFolderRequest] + # A request object representing the call parameters. Required. + # @return [Array(String, [String, nil], Hash{String => String})] + # Uri, Body, Query string parameters + def self.transcode_move_folder_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :post, + uri_template: "/v3/{name}:move", + body: "*", + matches: [ + ["name", %r{^folders/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the delete_folder REST call + # + # @param request_pb [::Google::Cloud::ResourceManager::V3::DeleteFolderRequest] + # 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_folder_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :delete, + uri_template: "/v3/{name}", + matches: [ + ["name", %r{^folders/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the undelete_folder REST call + # + # @param request_pb [::Google::Cloud::ResourceManager::V3::UndeleteFolderRequest] + # A request object representing the call parameters. Required. + # @return [Array(String, [String, nil], Hash{String => String})] + # Uri, Body, Query string parameters + def self.transcode_undelete_folder_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :post, + uri_template: "/v3/{name}:undelete", + body: "*", + matches: [ + ["name", %r{^folders/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the get_iam_policy REST call + # + # @param request_pb [::Google::Iam::V1::GetIamPolicyRequest] + # A request object representing the call parameters. Required. + # @return [Array(String, [String, nil], Hash{String => String})] + # Uri, Body, Query string parameters + def self.transcode_get_iam_policy_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :post, + uri_template: "/v3/{resource}:getIamPolicy", + body: "*", + matches: [ + ["resource", %r{^folders/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the set_iam_policy REST call + # + # @param request_pb [::Google::Iam::V1::SetIamPolicyRequest] + # A request object representing the call parameters. Required. + # @return [Array(String, [String, nil], Hash{String => String})] + # Uri, Body, Query string parameters + def self.transcode_set_iam_policy_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :post, + uri_template: "/v3/{resource}:setIamPolicy", + body: "*", + matches: [ + ["resource", %r{^folders/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the test_iam_permissions REST call + # + # @param request_pb [::Google::Iam::V1::TestIamPermissionsRequest] + # A request object representing the call parameters. Required. + # @return [Array(String, [String, nil], Hash{String => String})] + # Uri, Body, Query string parameters + def self.transcode_test_iam_permissions_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :post, + uri_template: "/v3/{resource}:testIamPermissions", + body: "*", + matches: [ + ["resource", %r{^folders/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + end + end + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-resource_manager-v3/lib/google/cloud/resource_manager/v3/organizations.rb b/owl-bot-staging/google-cloud-resource_manager-v3/lib/google/cloud/resource_manager/v3/organizations.rb new file mode 100644 index 000000000000..0c0988af5ffe --- /dev/null +++ b/owl-bot-staging/google-cloud-resource_manager-v3/lib/google/cloud/resource_manager/v3/organizations.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/resource_manager/v3/version" + +require "google/cloud/resource_manager/v3/organizations/credentials" +require "google/cloud/resource_manager/v3/organizations/paths" +require "google/cloud/resource_manager/v3/organizations/client" +require "google/cloud/resource_manager/v3/organizations/rest" + +module Google + module Cloud + module ResourceManager + module V3 + ## + # Allows users to manage their organization resources. + # + # @example Load this service and instantiate a gRPC client + # + # require "google/cloud/resource_manager/v3/organizations" + # client = ::Google::Cloud::ResourceManager::V3::Organizations::Client.new + # + # @example Load this service and instantiate a REST client + # + # require "google/cloud/resource_manager/v3/organizations/rest" + # client = ::Google::Cloud::ResourceManager::V3::Organizations::Rest::Client.new + # + module Organizations + end + end + end + end +end + +helper_path = ::File.join __dir__, "organizations", "helpers.rb" +require "google/cloud/resource_manager/v3/organizations/helpers" if ::File.file? helper_path diff --git a/owl-bot-staging/google-cloud-resource_manager-v3/lib/google/cloud/resource_manager/v3/organizations/client.rb b/owl-bot-staging/google-cloud-resource_manager-v3/lib/google/cloud/resource_manager/v3/organizations/client.rb new file mode 100644 index 000000000000..4ad34ad98f78 --- /dev/null +++ b/owl-bot-staging/google-cloud-resource_manager-v3/lib/google/cloud/resource_manager/v3/organizations/client.rb @@ -0,0 +1,923 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +require "google/cloud/errors" +require "google/cloud/resourcemanager/v3/organizations_pb" + +module Google + module Cloud + module ResourceManager + module V3 + module Organizations + ## + # Client for the Organizations service. + # + # Allows users to manage their organization resources. + # + class Client + # @private + API_VERSION = "" + + # @private + DEFAULT_ENDPOINT_TEMPLATE = "cloudresourcemanager.$UNIVERSE_DOMAIN$" + + include Paths + + # @private + attr_reader :organizations_stub + + ## + # Configure the Organizations Client class. + # + # See {::Google::Cloud::ResourceManager::V3::Organizations::Client::Configuration} + # for a description of the configuration fields. + # + # @example + # + # # Modify the configuration for all Organizations clients + # ::Google::Cloud::ResourceManager::V3::Organizations::Client.configure do |config| + # config.timeout = 10.0 + # end + # + # @yield [config] Configure the Client client. + # @yieldparam config [Client::Configuration] + # + # @return [Client::Configuration] + # + def self.configure + @configure ||= begin + namespace = ["Google", "Cloud", "ResourceManager", "V3"] + 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.get_organization.timeout = 60.0 + default_config.rpcs.get_organization.retry_policy = { + initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [14] + } + + default_config.rpcs.search_organizations.timeout = 60.0 + + default_config.rpcs.get_iam_policy.timeout = 60.0 + default_config.rpcs.get_iam_policy.retry_policy = { + initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [14] + } + + default_config.rpcs.set_iam_policy.timeout = 60.0 + + default_config + end + yield @configure if block_given? + @configure + end + + ## + # Configure the Organizations Client instance. + # + # The configuration is set to the derived mode, meaning that values can be changed, + # but structural changes (adding new fields, etc.) are not allowed. Structural changes + # should be made on {Client.configure}. + # + # See {::Google::Cloud::ResourceManager::V3::Organizations::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 + @organizations_stub.universe_domain + end + + ## + # Create a new Organizations client object. + # + # @example + # + # # Create a client using the default configuration + # client = ::Google::Cloud::ResourceManager::V3::Organizations::Client.new + # + # # Create a client using a custom configuration + # client = ::Google::Cloud::ResourceManager::V3::Organizations::Client.new do |config| + # config.timeout = 10.0 + # end + # + # @yield [config] Configure the Organizations client. + # @yieldparam config [Client::Configuration] + # + def initialize + # These require statements are intentionally placed here to initialize + # the gRPC module only when it's required. + # See https://github.com/googleapis/toolkit/issues/446 + require "gapic/grpc" + require "google/cloud/resourcemanager/v3/organizations_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 + + @organizations_stub = ::Gapic::ServiceStub.new( + ::Google::Cloud::ResourceManager::V3::Organizations::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 + ) + + @organizations_stub.stub_logger&.info do |entry| + entry.set_system_name + entry.set_service + entry.message = "Created client for #{entry.service}" + entry.set_credentials_fields credentials + entry.set "customEndpoint", @config.endpoint if @config.endpoint + entry.set "defaultTimeout", @config.timeout if @config.timeout + entry.set "quotaProject", @quota_project_id if @quota_project_id + end + end + + ## + # The logger used for request/response debug logging. + # + # @return [Logger] + # + def logger + @organizations_stub.logger + end + + # Service calls + + ## + # Fetches an organization resource identified by the specified resource name. + # + # @overload get_organization(request, options = nil) + # Pass arguments to `get_organization` via a request object, either of type + # {::Google::Cloud::ResourceManager::V3::GetOrganizationRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::ResourceManager::V3::GetOrganizationRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. + # + # @overload get_organization(name: nil) + # Pass arguments to `get_organization` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param name [::String] + # Required. The resource name of the Organization to fetch. This is the + # organization's relative path in the API, formatted as + # "organizations/[organizationId]". For example, "organizations/1234". + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Google::Cloud::ResourceManager::V3::Organization] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Google::Cloud::ResourceManager::V3::Organization] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/resource_manager/v3" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::ResourceManager::V3::Organizations::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::ResourceManager::V3::GetOrganizationRequest.new + # + # # Call the get_organization method. + # result = client.get_organization request + # + # # The returned object is of type Google::Cloud::ResourceManager::V3::Organization. + # p result + # + def get_organization request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::ResourceManager::V3::GetOrganizationRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + metadata = @config.rpcs.get_organization.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::ResourceManager::V3::VERSION + metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.name + header_params["name"] = request.name + end + + request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") + metadata[:"x-goog-request-params"] ||= request_params_header + + options.apply_defaults timeout: @config.rpcs.get_organization.timeout, + metadata: metadata, + retry_policy: @config.rpcs.get_organization.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @organizations_stub.call_rpc :get_organization, 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 + + ## + # Searches organization resources that are visible to the user and satisfy + # the specified filter. This method returns organizations in an unspecified + # order. New organizations do not necessarily appear at the end of the + # results, and may take a small amount of time to appear. + # + # Search will only return organizations on which the user has the permission + # `resourcemanager.organizations.get` + # + # @overload search_organizations(request, options = nil) + # Pass arguments to `search_organizations` via a request object, either of type + # {::Google::Cloud::ResourceManager::V3::SearchOrganizationsRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::ResourceManager::V3::SearchOrganizationsRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_organizations(page_size: nil, page_token: nil, query: nil) + # Pass arguments to `search_organizations` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param page_size [::Integer] + # Optional. The maximum number of organizations to return in the response. + # The server can return fewer organizations than requested. If unspecified, + # server picks an appropriate default. + # @param page_token [::String] + # Optional. A pagination token returned from a previous call to + # `SearchOrganizations` that indicates from where listing should continue. + # @param query [::String] + # Optional. An optional query string used to filter the Organizations to + # return in the response. Query rules are case-insensitive. + # + # + # ``` + # | Field | Description | + # |------------------|--------------------------------------------| + # | directoryCustomerId, owner.directoryCustomerId | Filters by directory + # customer id. | + # | domain | Filters by domain. | + # ``` + # + # Organizations may be queried by `directoryCustomerId` or by + # `domain`, where the domain is a G Suite domain, for example: + # + # * Query `directorycustomerid:123456789` returns Organization + # resources with `owner.directory_customer_id` equal to `123456789`. + # * Query `domain:google.com` returns Organization resources corresponding + # to the domain `google.com`. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Gapic::PagedEnumerable<::Google::Cloud::ResourceManager::V3::Organization>] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Gapic::PagedEnumerable<::Google::Cloud::ResourceManager::V3::Organization>] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/resource_manager/v3" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::ResourceManager::V3::Organizations::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::ResourceManager::V3::SearchOrganizationsRequest.new + # + # # Call the search_organizations method. + # result = client.search_organizations request + # + # # The returned object is of type Gapic::PagedEnumerable. You can iterate + # # over elements, and API calls will be issued to fetch pages as needed. + # result.each do |item| + # # Each element is of type ::Google::Cloud::ResourceManager::V3::Organization. + # p item + # end + # + def search_organizations request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::ResourceManager::V3::SearchOrganizationsRequest + + # Converts hash 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_organizations.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::ResourceManager::V3::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.search_organizations.timeout, + metadata: metadata, + retry_policy: @config.rpcs.search_organizations.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @organizations_stub.call_rpc :search_organizations, request, options: options do |response, operation| + response = ::Gapic::PagedEnumerable.new @organizations_stub, :search_organizations, request, response, operation, options + yield response, operation if block_given? + throw :response, response + end + rescue ::GRPC::BadStatus => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Gets the access control policy for an organization resource. The policy may + # be empty if no such policy or resource exists. The `resource` field should + # be the organization's resource name, for example: "organizations/123". + # + # Authorization requires the IAM permission + # `resourcemanager.organizations.getIamPolicy` on the specified organization. + # + # @overload get_iam_policy(request, options = nil) + # Pass arguments to `get_iam_policy` via a request object, either of type + # {::Google::Iam::V1::GetIamPolicyRequest} or an equivalent Hash. + # + # @param request [::Google::Iam::V1::GetIamPolicyRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. + # + # @overload get_iam_policy(resource: nil, options: nil) + # Pass arguments to `get_iam_policy` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param resource [::String] + # REQUIRED: The resource for which the policy is being requested. + # See the operation documentation for the appropriate value for this field. + # @param options [::Google::Iam::V1::GetPolicyOptions, ::Hash] + # OPTIONAL: A `GetPolicyOptions` object for specifying options to + # `GetIamPolicy`. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Google::Iam::V1::Policy] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Google::Iam::V1::Policy] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/resource_manager/v3" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::ResourceManager::V3::Organizations::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Iam::V1::GetIamPolicyRequest.new + # + # # Call the get_iam_policy method. + # result = client.get_iam_policy request + # + # # The returned object is of type Google::Iam::V1::Policy. + # p result + # + def get_iam_policy request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Iam::V1::GetIamPolicyRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + metadata = @config.rpcs.get_iam_policy.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::ResourceManager::V3::VERSION + metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.resource + header_params["resource"] = request.resource + end + + request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") + metadata[:"x-goog-request-params"] ||= request_params_header + + options.apply_defaults timeout: @config.rpcs.get_iam_policy.timeout, + metadata: metadata, + retry_policy: @config.rpcs.get_iam_policy.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @organizations_stub.call_rpc :get_iam_policy, request, options: options do |response, operation| + yield response, operation if block_given? + end + rescue ::GRPC::BadStatus => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Sets the access control policy on an organization resource. Replaces any + # existing policy. The `resource` field should be the organization's resource + # name, for example: "organizations/123". + # + # Authorization requires the IAM permission + # `resourcemanager.organizations.setIamPolicy` on the specified organization. + # + # @overload set_iam_policy(request, options = nil) + # Pass arguments to `set_iam_policy` via a request object, either of type + # {::Google::Iam::V1::SetIamPolicyRequest} or an equivalent Hash. + # + # @param request [::Google::Iam::V1::SetIamPolicyRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. + # + # @overload set_iam_policy(resource: nil, policy: nil, update_mask: nil) + # Pass arguments to `set_iam_policy` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param resource [::String] + # REQUIRED: The resource for which the policy is being specified. + # See the operation documentation for the appropriate value for this field. + # @param policy [::Google::Iam::V1::Policy, ::Hash] + # REQUIRED: The complete policy to be applied to the `resource`. The size of + # the policy is limited to a few 10s of KB. An empty policy is a + # valid policy but certain Cloud Platform services (such as Projects) + # might reject them. + # @param update_mask [::Google::Protobuf::FieldMask, ::Hash] + # OPTIONAL: A FieldMask specifying which fields of the policy to modify. Only + # the fields in the mask will be modified. If no mask is provided, the + # following default mask is used: + # + # `paths: "bindings, etag"` + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Google::Iam::V1::Policy] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Google::Iam::V1::Policy] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/resource_manager/v3" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::ResourceManager::V3::Organizations::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Iam::V1::SetIamPolicyRequest.new + # + # # Call the set_iam_policy method. + # result = client.set_iam_policy request + # + # # The returned object is of type Google::Iam::V1::Policy. + # p result + # + def set_iam_policy request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Iam::V1::SetIamPolicyRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + metadata = @config.rpcs.set_iam_policy.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::ResourceManager::V3::VERSION + metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.resource + header_params["resource"] = request.resource + end + + request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") + metadata[:"x-goog-request-params"] ||= request_params_header + + options.apply_defaults timeout: @config.rpcs.set_iam_policy.timeout, + metadata: metadata, + retry_policy: @config.rpcs.set_iam_policy.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @organizations_stub.call_rpc :set_iam_policy, request, options: options do |response, operation| + yield response, operation if block_given? + end + rescue ::GRPC::BadStatus => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Returns the permissions that a caller has on the specified organization. + # The `resource` field should be the organization's resource name, + # for example: "organizations/123". + # + # There are no permissions required for making this API call. + # + # @overload test_iam_permissions(request, options = nil) + # Pass arguments to `test_iam_permissions` via a request object, either of type + # {::Google::Iam::V1::TestIamPermissionsRequest} or an equivalent Hash. + # + # @param request [::Google::Iam::V1::TestIamPermissionsRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. + # + # @overload test_iam_permissions(resource: nil, permissions: nil) + # Pass arguments to `test_iam_permissions` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param resource [::String] + # REQUIRED: The resource for which the policy detail is being requested. + # See the operation documentation for the appropriate value for this field. + # @param permissions [::Array<::String>] + # The set of permissions to check for the `resource`. Permissions with + # wildcards (such as '*' or 'storage.*') are not allowed. For more + # information see + # [IAM Overview](https://cloud.google.com/iam/docs/overview#permissions). + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Google::Iam::V1::TestIamPermissionsResponse] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Google::Iam::V1::TestIamPermissionsResponse] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/resource_manager/v3" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::ResourceManager::V3::Organizations::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Iam::V1::TestIamPermissionsRequest.new + # + # # Call the test_iam_permissions method. + # result = client.test_iam_permissions request + # + # # The returned object is of type Google::Iam::V1::TestIamPermissionsResponse. + # p result + # + def test_iam_permissions request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Iam::V1::TestIamPermissionsRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + metadata = @config.rpcs.test_iam_permissions.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::ResourceManager::V3::VERSION + metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.resource + header_params["resource"] = request.resource + end + + request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") + metadata[:"x-goog-request-params"] ||= request_params_header + + options.apply_defaults timeout: @config.rpcs.test_iam_permissions.timeout, + metadata: metadata, + retry_policy: @config.rpcs.test_iam_permissions.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @organizations_stub.call_rpc :test_iam_permissions, request, options: options do |response, operation| + yield response, operation if block_given? + end + rescue ::GRPC::BadStatus => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Configuration class for the Organizations API. + # + # This class represents the configuration for Organizations, + # providing control over timeouts, retry behavior, logging, transport + # parameters, and other low-level controls. Certain parameters can also be + # applied individually to specific RPCs. See + # {::Google::Cloud::ResourceManager::V3::Organizations::Client::Configuration::Rpcs} + # for a list of RPCs that can be configured independently. + # + # Configuration can be applied globally to all clients, or to a single client + # on construction. + # + # @example + # + # # Modify the global config, setting the timeout for + # # get_organization to 20 seconds, + # # and all remaining timeouts to 10 seconds. + # ::Google::Cloud::ResourceManager::V3::Organizations::Client.configure do |config| + # config.timeout = 10.0 + # config.rpcs.get_organization.timeout = 20.0 + # end + # + # # Apply the above configuration only to a new client. + # client = ::Google::Cloud::ResourceManager::V3::Organizations::Client.new do |config| + # config.timeout = 10.0 + # config.rpcs.get_organization.timeout = 20.0 + # end + # + # @!attribute [rw] endpoint + # A custom service endpoint, as a hostname or hostname:port. The default is + # nil, indicating to use the default endpoint in the current universe domain. + # @return [::String,nil] + # @!attribute [rw] credentials + # Credentials to send with calls. You may provide any of the following types: + # * (`Google::Auth::Credentials`) A googleauth credentials object + # (see the [googleauth docs](https://rubydoc.info/gems/googleauth/Google/Auth/Credentials)) + # * (`Signet::OAuth2::Client`) A signet oauth2 client object + # (see the [signet docs](https://rubydoc.info/gems/signet/Signet/OAuth2/Client)) + # * (`GRPC::Core::Channel`) a gRPC channel with included credentials + # * (`GRPC::Core::ChannelCredentials`) a gRPC credentails object + # * (`nil`) indicating no credentials + # + # @note Warning: Passing a `String` to a keyfile path or a `Hash` of credentials + # is deprecated. Providing an unvalidated credential configuration to + # Google APIs can compromise the security of your systems and data. + # + # @example + # + # # The recommended way to provide credentials is to use the `make_creds` method + # # on the appropriate credentials class for your environment. + # + # require "googleauth" + # + # credentials = ::Google::Auth::ServiceAccountCredentials.make_creds( + # json_key_io: ::File.open("/path/to/keyfile.json") + # ) + # + # client = ::Google::Cloud::ResourceManager::V3::Organizations::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 = "cloudresourcemanager.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 Organizations 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 `get_organization` + # @return [::Gapic::Config::Method] + # + attr_reader :get_organization + ## + # RPC-specific configuration for `search_organizations` + # @return [::Gapic::Config::Method] + # + attr_reader :search_organizations + ## + # RPC-specific configuration for `get_iam_policy` + # @return [::Gapic::Config::Method] + # + attr_reader :get_iam_policy + ## + # RPC-specific configuration for `set_iam_policy` + # @return [::Gapic::Config::Method] + # + attr_reader :set_iam_policy + ## + # RPC-specific configuration for `test_iam_permissions` + # @return [::Gapic::Config::Method] + # + attr_reader :test_iam_permissions + + # @private + def initialize parent_rpcs = nil + get_organization_config = parent_rpcs.get_organization if parent_rpcs.respond_to? :get_organization + @get_organization = ::Gapic::Config::Method.new get_organization_config + search_organizations_config = parent_rpcs.search_organizations if parent_rpcs.respond_to? :search_organizations + @search_organizations = ::Gapic::Config::Method.new search_organizations_config + get_iam_policy_config = parent_rpcs.get_iam_policy if parent_rpcs.respond_to? :get_iam_policy + @get_iam_policy = ::Gapic::Config::Method.new get_iam_policy_config + set_iam_policy_config = parent_rpcs.set_iam_policy if parent_rpcs.respond_to? :set_iam_policy + @set_iam_policy = ::Gapic::Config::Method.new set_iam_policy_config + test_iam_permissions_config = parent_rpcs.test_iam_permissions if parent_rpcs.respond_to? :test_iam_permissions + @test_iam_permissions = ::Gapic::Config::Method.new test_iam_permissions_config + + yield self if block_given? + end + end + end + end + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-resource_manager-v3/lib/google/cloud/resource_manager/v3/organizations/credentials.rb b/owl-bot-staging/google-cloud-resource_manager-v3/lib/google/cloud/resource_manager/v3/organizations/credentials.rb new file mode 100644 index 000000000000..0d7777666a20 --- /dev/null +++ b/owl-bot-staging/google-cloud-resource_manager-v3/lib/google/cloud/resource_manager/v3/organizations/credentials.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 "googleauth" + +module Google + module Cloud + module ResourceManager + module V3 + module Organizations + # Credentials for the Organizations API. + class Credentials < ::Google::Auth::Credentials + self.scope = [ + "https://www.googleapis.com/auth/cloud-platform", + "https://www.googleapis.com/auth/cloud-platform.read-only" + ] + self.env_vars = [ + "RESOURCE_MANAGER_CREDENTIALS", + "RESOURCE_MANAGER_KEYFILE", + "GOOGLE_CLOUD_CREDENTIALS", + "GOOGLE_CLOUD_KEYFILE", + "GCLOUD_KEYFILE", + "RESOURCE_MANAGER_CREDENTIALS_JSON", + "RESOURCE_MANAGER_KEYFILE_JSON", + "GOOGLE_CLOUD_CREDENTIALS_JSON", + "GOOGLE_CLOUD_KEYFILE_JSON", + "GCLOUD_KEYFILE_JSON" + ] + self.paths = [ + "~/.config/google_cloud/application_default_credentials.json" + ] + end + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-resource_manager-v3/lib/google/cloud/resource_manager/v3/organizations/paths.rb b/owl-bot-staging/google-cloud-resource_manager-v3/lib/google/cloud/resource_manager/v3/organizations/paths.rb new file mode 100644 index 000000000000..48b0f4e9404a --- /dev/null +++ b/owl-bot-staging/google-cloud-resource_manager-v3/lib/google/cloud/resource_manager/v3/organizations/paths.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! + + +module Google + module Cloud + module ResourceManager + module V3 + module Organizations + # Path helper methods for the Organizations API. + module Paths + ## + # Create a fully-qualified Organization resource string. + # + # The resource will be in the following format: + # + # `organizations/{organization}` + # + # @param organization [String] + # + # @return [::String] + def organization_path organization: + "organizations/#{organization}" + end + + extend self + end + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-resource_manager-v3/lib/google/cloud/resource_manager/v3/organizations/rest.rb b/owl-bot-staging/google-cloud-resource_manager-v3/lib/google/cloud/resource_manager/v3/organizations/rest.rb new file mode 100644 index 000000000000..1cd4740e1925 --- /dev/null +++ b/owl-bot-staging/google-cloud-resource_manager-v3/lib/google/cloud/resource_manager/v3/organizations/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/resource_manager/v3/version" + +require "google/cloud/resource_manager/v3/organizations/credentials" +require "google/cloud/resource_manager/v3/organizations/paths" +require "google/cloud/resource_manager/v3/organizations/rest/client" + +module Google + module Cloud + module ResourceManager + module V3 + ## + # Allows users to manage their organization resources. + # + # To load this service and instantiate a REST client: + # + # require "google/cloud/resource_manager/v3/organizations/rest" + # client = ::Google::Cloud::ResourceManager::V3::Organizations::Rest::Client.new + # + module Organizations + # Client for the REST transport + module Rest + end + end + end + end + end +end + +helper_path = ::File.join __dir__, "rest", "helpers.rb" +require "google/cloud/resource_manager/v3/organizations/rest/helpers" if ::File.file? helper_path diff --git a/owl-bot-staging/google-cloud-resource_manager-v3/lib/google/cloud/resource_manager/v3/organizations/rest/client.rb b/owl-bot-staging/google-cloud-resource_manager-v3/lib/google/cloud/resource_manager/v3/organizations/rest/client.rb new file mode 100644 index 000000000000..5f466d357a28 --- /dev/null +++ b/owl-bot-staging/google-cloud-resource_manager-v3/lib/google/cloud/resource_manager/v3/organizations/rest/client.rb @@ -0,0 +1,853 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +require "google/cloud/errors" +require "google/cloud/resourcemanager/v3/organizations_pb" +require "google/cloud/resource_manager/v3/organizations/rest/service_stub" + +module Google + module Cloud + module ResourceManager + module V3 + module Organizations + module Rest + ## + # REST client for the Organizations service. + # + # Allows users to manage their organization resources. + # + class Client + # @private + API_VERSION = "" + + # @private + DEFAULT_ENDPOINT_TEMPLATE = "cloudresourcemanager.$UNIVERSE_DOMAIN$" + + include Paths + + # @private + attr_reader :organizations_stub + + ## + # Configure the Organizations Client class. + # + # See {::Google::Cloud::ResourceManager::V3::Organizations::Rest::Client::Configuration} + # for a description of the configuration fields. + # + # @example + # + # # Modify the configuration for all Organizations clients + # ::Google::Cloud::ResourceManager::V3::Organizations::Rest::Client.configure do |config| + # config.timeout = 10.0 + # end + # + # @yield [config] Configure the Client client. + # @yieldparam config [Client::Configuration] + # + # @return [Client::Configuration] + # + def self.configure + @configure ||= begin + namespace = ["Google", "Cloud", "ResourceManager", "V3"] + 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.get_organization.timeout = 60.0 + default_config.rpcs.get_organization.retry_policy = { + initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [14] + } + + default_config.rpcs.search_organizations.timeout = 60.0 + + default_config.rpcs.get_iam_policy.timeout = 60.0 + default_config.rpcs.get_iam_policy.retry_policy = { + initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [14] + } + + default_config.rpcs.set_iam_policy.timeout = 60.0 + + default_config + end + yield @configure if block_given? + @configure + end + + ## + # Configure the Organizations Client instance. + # + # The configuration is set to the derived mode, meaning that values can be changed, + # but structural changes (adding new fields, etc.) are not allowed. Structural changes + # should be made on {Client.configure}. + # + # See {::Google::Cloud::ResourceManager::V3::Organizations::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 + @organizations_stub.universe_domain + end + + ## + # Create a new Organizations REST client object. + # + # @example + # + # # Create a client using the default configuration + # client = ::Google::Cloud::ResourceManager::V3::Organizations::Rest::Client.new + # + # # Create a client using a custom configuration + # client = ::Google::Cloud::ResourceManager::V3::Organizations::Rest::Client.new do |config| + # config.timeout = 10.0 + # end + # + # @yield [config] Configure the Organizations 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 + + @organizations_stub = ::Google::Cloud::ResourceManager::V3::Organizations::Rest::ServiceStub.new( + endpoint: @config.endpoint, + endpoint_template: DEFAULT_ENDPOINT_TEMPLATE, + universe_domain: @config.universe_domain, + credentials: credentials, + logger: @config.logger + ) + + @organizations_stub.logger(stub: true)&.info do |entry| + entry.set_system_name + entry.set_service + entry.message = "Created client for #{entry.service}" + entry.set_credentials_fields credentials + entry.set "customEndpoint", @config.endpoint if @config.endpoint + entry.set "defaultTimeout", @config.timeout if @config.timeout + entry.set "quotaProject", @quota_project_id if @quota_project_id + end + end + + ## + # The logger used for request/response debug logging. + # + # @return [Logger] + # + def logger + @organizations_stub.logger + end + + # Service calls + + ## + # Fetches an organization resource identified by the specified resource name. + # + # @overload get_organization(request, options = nil) + # Pass arguments to `get_organization` via a request object, either of type + # {::Google::Cloud::ResourceManager::V3::GetOrganizationRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::ResourceManager::V3::GetOrganizationRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @overload get_organization(name: nil) + # Pass arguments to `get_organization` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param name [::String] + # Required. The resource name of the Organization to fetch. This is the + # organization's relative path in the API, formatted as + # "organizations/[organizationId]". For example, "organizations/1234". + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Cloud::ResourceManager::V3::Organization] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::ResourceManager::V3::Organization] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/resource_manager/v3" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::ResourceManager::V3::Organizations::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::ResourceManager::V3::GetOrganizationRequest.new + # + # # Call the get_organization method. + # result = client.get_organization request + # + # # The returned object is of type Google::Cloud::ResourceManager::V3::Organization. + # p result + # + def get_organization request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::ResourceManager::V3::GetOrganizationRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + call_metadata = @config.rpcs.get_organization.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::ResourceManager::V3::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + options.apply_defaults timeout: @config.rpcs.get_organization.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.get_organization.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @organizations_stub.get_organization 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 + + ## + # Searches organization resources that are visible to the user and satisfy + # the specified filter. This method returns organizations in an unspecified + # order. New organizations do not necessarily appear at the end of the + # results, and may take a small amount of time to appear. + # + # Search will only return organizations on which the user has the permission + # `resourcemanager.organizations.get` + # + # @overload search_organizations(request, options = nil) + # Pass arguments to `search_organizations` via a request object, either of type + # {::Google::Cloud::ResourceManager::V3::SearchOrganizationsRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::ResourceManager::V3::SearchOrganizationsRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_organizations(page_size: nil, page_token: nil, query: nil) + # Pass arguments to `search_organizations` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param page_size [::Integer] + # Optional. The maximum number of organizations to return in the response. + # The server can return fewer organizations than requested. If unspecified, + # server picks an appropriate default. + # @param page_token [::String] + # Optional. A pagination token returned from a previous call to + # `SearchOrganizations` that indicates from where listing should continue. + # @param query [::String] + # Optional. An optional query string used to filter the Organizations to + # return in the response. Query rules are case-insensitive. + # + # + # ``` + # | Field | Description | + # |------------------|--------------------------------------------| + # | directoryCustomerId, owner.directoryCustomerId | Filters by directory + # customer id. | + # | domain | Filters by domain. | + # ``` + # + # Organizations may be queried by `directoryCustomerId` or by + # `domain`, where the domain is a G Suite domain, for example: + # + # * Query `directorycustomerid:123456789` returns Organization + # resources with `owner.directory_customer_id` equal to `123456789`. + # * Query `domain:google.com` returns Organization resources corresponding + # to the domain `google.com`. + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Gapic::Rest::PagedEnumerable<::Google::Cloud::ResourceManager::V3::Organization>] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Gapic::Rest::PagedEnumerable<::Google::Cloud::ResourceManager::V3::Organization>] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/resource_manager/v3" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::ResourceManager::V3::Organizations::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::ResourceManager::V3::SearchOrganizationsRequest.new + # + # # Call the search_organizations method. + # result = client.search_organizations request + # + # # The returned object is of type Gapic::PagedEnumerable. You can iterate + # # over elements, and API calls will be issued to fetch pages as needed. + # result.each do |item| + # # Each element is of type ::Google::Cloud::ResourceManager::V3::Organization. + # p item + # end + # + def search_organizations request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::ResourceManager::V3::SearchOrganizationsRequest + + # Converts hash 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_organizations.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::ResourceManager::V3::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_organizations.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.search_organizations.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @organizations_stub.search_organizations request, options do |result, operation| + result = ::Gapic::Rest::PagedEnumerable.new @organizations_stub, :search_organizations, "organizations", 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 access control policy for an organization resource. The policy may + # be empty if no such policy or resource exists. The `resource` field should + # be the organization's resource name, for example: "organizations/123". + # + # Authorization requires the IAM permission + # `resourcemanager.organizations.getIamPolicy` on the specified organization. + # + # @overload get_iam_policy(request, options = nil) + # Pass arguments to `get_iam_policy` via a request object, either of type + # {::Google::Iam::V1::GetIamPolicyRequest} or an equivalent Hash. + # + # @param request [::Google::Iam::V1::GetIamPolicyRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @overload get_iam_policy(resource: nil, options: nil) + # Pass arguments to `get_iam_policy` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param resource [::String] + # REQUIRED: The resource for which the policy is being requested. + # See the operation documentation for the appropriate value for this field. + # @param options [::Google::Iam::V1::GetPolicyOptions, ::Hash] + # OPTIONAL: A `GetPolicyOptions` object for specifying options to + # `GetIamPolicy`. + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Iam::V1::Policy] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Iam::V1::Policy] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/resource_manager/v3" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::ResourceManager::V3::Organizations::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Iam::V1::GetIamPolicyRequest.new + # + # # Call the get_iam_policy method. + # result = client.get_iam_policy request + # + # # The returned object is of type Google::Iam::V1::Policy. + # p result + # + def get_iam_policy request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Iam::V1::GetIamPolicyRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + call_metadata = @config.rpcs.get_iam_policy.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::ResourceManager::V3::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + options.apply_defaults timeout: @config.rpcs.get_iam_policy.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.get_iam_policy.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @organizations_stub.get_iam_policy request, options do |result, operation| + yield result, operation if block_given? + end + rescue ::Gapic::Rest::Error => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Sets the access control policy on an organization resource. Replaces any + # existing policy. The `resource` field should be the organization's resource + # name, for example: "organizations/123". + # + # Authorization requires the IAM permission + # `resourcemanager.organizations.setIamPolicy` on the specified organization. + # + # @overload set_iam_policy(request, options = nil) + # Pass arguments to `set_iam_policy` via a request object, either of type + # {::Google::Iam::V1::SetIamPolicyRequest} or an equivalent Hash. + # + # @param request [::Google::Iam::V1::SetIamPolicyRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @overload set_iam_policy(resource: nil, policy: nil, update_mask: nil) + # Pass arguments to `set_iam_policy` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param resource [::String] + # REQUIRED: The resource for which the policy is being specified. + # See the operation documentation for the appropriate value for this field. + # @param policy [::Google::Iam::V1::Policy, ::Hash] + # REQUIRED: The complete policy to be applied to the `resource`. The size of + # the policy is limited to a few 10s of KB. An empty policy is a + # valid policy but certain Cloud Platform services (such as Projects) + # might reject them. + # @param update_mask [::Google::Protobuf::FieldMask, ::Hash] + # OPTIONAL: A FieldMask specifying which fields of the policy to modify. Only + # the fields in the mask will be modified. If no mask is provided, the + # following default mask is used: + # + # `paths: "bindings, etag"` + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Iam::V1::Policy] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Iam::V1::Policy] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/resource_manager/v3" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::ResourceManager::V3::Organizations::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Iam::V1::SetIamPolicyRequest.new + # + # # Call the set_iam_policy method. + # result = client.set_iam_policy request + # + # # The returned object is of type Google::Iam::V1::Policy. + # p result + # + def set_iam_policy request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Iam::V1::SetIamPolicyRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + call_metadata = @config.rpcs.set_iam_policy.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::ResourceManager::V3::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + options.apply_defaults timeout: @config.rpcs.set_iam_policy.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.set_iam_policy.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @organizations_stub.set_iam_policy request, options do |result, operation| + yield result, operation if block_given? + end + rescue ::Gapic::Rest::Error => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Returns the permissions that a caller has on the specified organization. + # The `resource` field should be the organization's resource name, + # for example: "organizations/123". + # + # There are no permissions required for making this API call. + # + # @overload test_iam_permissions(request, options = nil) + # Pass arguments to `test_iam_permissions` via a request object, either of type + # {::Google::Iam::V1::TestIamPermissionsRequest} or an equivalent Hash. + # + # @param request [::Google::Iam::V1::TestIamPermissionsRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @overload test_iam_permissions(resource: nil, permissions: nil) + # Pass arguments to `test_iam_permissions` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param resource [::String] + # REQUIRED: The resource for which the policy detail is being requested. + # See the operation documentation for the appropriate value for this field. + # @param permissions [::Array<::String>] + # The set of permissions to check for the `resource`. Permissions with + # wildcards (such as '*' or 'storage.*') are not allowed. For more + # information see + # [IAM Overview](https://cloud.google.com/iam/docs/overview#permissions). + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Iam::V1::TestIamPermissionsResponse] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Iam::V1::TestIamPermissionsResponse] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/resource_manager/v3" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::ResourceManager::V3::Organizations::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Iam::V1::TestIamPermissionsRequest.new + # + # # Call the test_iam_permissions method. + # result = client.test_iam_permissions request + # + # # The returned object is of type Google::Iam::V1::TestIamPermissionsResponse. + # p result + # + def test_iam_permissions request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Iam::V1::TestIamPermissionsRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + call_metadata = @config.rpcs.test_iam_permissions.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::ResourceManager::V3::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + options.apply_defaults timeout: @config.rpcs.test_iam_permissions.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.test_iam_permissions.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @organizations_stub.test_iam_permissions request, options do |result, operation| + yield result, operation if block_given? + end + rescue ::Gapic::Rest::Error => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Configuration class for the Organizations REST API. + # + # This class represents the configuration for Organizations REST, + # providing control over timeouts, retry behavior, logging, transport + # parameters, and other low-level controls. Certain parameters can also be + # applied individually to specific RPCs. See + # {::Google::Cloud::ResourceManager::V3::Organizations::Rest::Client::Configuration::Rpcs} + # for a list of RPCs that can be configured independently. + # + # Configuration can be applied globally to all clients, or to a single client + # on construction. + # + # @example + # + # # Modify the global config, setting the timeout for + # # get_organization to 20 seconds, + # # and all remaining timeouts to 10 seconds. + # ::Google::Cloud::ResourceManager::V3::Organizations::Rest::Client.configure do |config| + # config.timeout = 10.0 + # config.rpcs.get_organization.timeout = 20.0 + # end + # + # # Apply the above configuration only to a new client. + # client = ::Google::Cloud::ResourceManager::V3::Organizations::Rest::Client.new do |config| + # config.timeout = 10.0 + # config.rpcs.get_organization.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 = "cloudresourcemanager.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 Organizations API. + # + # Includes fields providing the configuration for each RPC in this service. + # Each configuration object is of type `Gapic::Config::Method` and includes + # the following configuration fields: + # + # * `timeout` (*type:* `Numeric`) - The call timeout in seconds + # * `metadata` (*type:* `Hash{Symbol=>String}`) - Additional headers + # * `retry_policy (*type:* `Hash`) - The retry policy. The policy fields + # include the following keys: + # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds. + # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds. + # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier. + # * `:retry_codes` (*type:* `Array`) - The error codes that should + # trigger a retry. + # + class Rpcs + ## + # RPC-specific configuration for `get_organization` + # @return [::Gapic::Config::Method] + # + attr_reader :get_organization + ## + # RPC-specific configuration for `search_organizations` + # @return [::Gapic::Config::Method] + # + attr_reader :search_organizations + ## + # RPC-specific configuration for `get_iam_policy` + # @return [::Gapic::Config::Method] + # + attr_reader :get_iam_policy + ## + # RPC-specific configuration for `set_iam_policy` + # @return [::Gapic::Config::Method] + # + attr_reader :set_iam_policy + ## + # RPC-specific configuration for `test_iam_permissions` + # @return [::Gapic::Config::Method] + # + attr_reader :test_iam_permissions + + # @private + def initialize parent_rpcs = nil + get_organization_config = parent_rpcs.get_organization if parent_rpcs.respond_to? :get_organization + @get_organization = ::Gapic::Config::Method.new get_organization_config + search_organizations_config = parent_rpcs.search_organizations if parent_rpcs.respond_to? :search_organizations + @search_organizations = ::Gapic::Config::Method.new search_organizations_config + get_iam_policy_config = parent_rpcs.get_iam_policy if parent_rpcs.respond_to? :get_iam_policy + @get_iam_policy = ::Gapic::Config::Method.new get_iam_policy_config + set_iam_policy_config = parent_rpcs.set_iam_policy if parent_rpcs.respond_to? :set_iam_policy + @set_iam_policy = ::Gapic::Config::Method.new set_iam_policy_config + test_iam_permissions_config = parent_rpcs.test_iam_permissions if parent_rpcs.respond_to? :test_iam_permissions + @test_iam_permissions = ::Gapic::Config::Method.new test_iam_permissions_config + + yield self if block_given? + end + end + end + end + end + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-resource_manager-v3/lib/google/cloud/resource_manager/v3/organizations/rest/service_stub.rb b/owl-bot-staging/google-cloud-resource_manager-v3/lib/google/cloud/resource_manager/v3/organizations/rest/service_stub.rb new file mode 100644 index 000000000000..75313856f8b5 --- /dev/null +++ b/owl-bot-staging/google-cloud-resource_manager-v3/lib/google/cloud/resource_manager/v3/organizations/rest/service_stub.rb @@ -0,0 +1,387 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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/resourcemanager/v3/organizations_pb" + +module Google + module Cloud + module ResourceManager + module V3 + module Organizations + module Rest + ## + # REST service stub for the Organizations service. + # Service stub contains baseline method implementations + # including transcoding, making the REST call, and deserialing the response. + # + class ServiceStub + # @private + def initialize endpoint:, endpoint_template:, universe_domain:, credentials:, logger: + # These require statements are intentionally placed here to initialize + # the REST modules only when it's required. + require "gapic/rest" + + @client_stub = ::Gapic::Rest::ClientStub.new endpoint: endpoint, + endpoint_template: endpoint_template, + universe_domain: universe_domain, + credentials: credentials, + numeric_enums: true, + service_name: self.class, + raise_faraday_errors: false, + logger: logger + end + + ## + # The effective universe domain + # + # @return [String] + # + def universe_domain + @client_stub.universe_domain + end + + ## + # The effective endpoint + # + # @return [String] + # + def endpoint + @client_stub.endpoint + end + + ## + # The logger used for request/response debug logging. + # + # @return [Logger] + # + def logger stub: false + stub ? @client_stub.stub_logger : @client_stub.logger + end + + ## + # Baseline implementation for the get_organization REST call + # + # @param request_pb [::Google::Cloud::ResourceManager::V3::GetOrganizationRequest] + # A request object representing the call parameters. Required. + # @param options [::Gapic::CallOptions] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Cloud::ResourceManager::V3::Organization] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::ResourceManager::V3::Organization] + # A result object deserialized from the server's reply + def get_organization request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_get_organization_request request_pb + query_string_params = if query_string_params.any? + query_string_params.to_h { |p| p.split "=", 2 } + else + {} + end + + response = @client_stub.make_http_request( + verb, + uri: uri, + body: body || "", + params: query_string_params, + method_name: "get_organization", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Cloud::ResourceManager::V3::Organization.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_organizations REST call + # + # @param request_pb [::Google::Cloud::ResourceManager::V3::SearchOrganizationsRequest] + # A request object representing the call parameters. Required. + # @param options [::Gapic::CallOptions] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Cloud::ResourceManager::V3::SearchOrganizationsResponse] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::ResourceManager::V3::SearchOrganizationsResponse] + # A result object deserialized from the server's reply + def search_organizations request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_search_organizations_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_organizations", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Cloud::ResourceManager::V3::SearchOrganizationsResponse.decode_json response.body, ignore_unknown_fields: true + catch :response do + yield result, operation if block_given? + result + end + end + + ## + # Baseline implementation for the get_iam_policy REST call + # + # @param request_pb [::Google::Iam::V1::GetIamPolicyRequest] + # A request object representing the call parameters. Required. + # @param options [::Gapic::CallOptions] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Iam::V1::Policy] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Iam::V1::Policy] + # A result object deserialized from the server's reply + def get_iam_policy request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_get_iam_policy_request request_pb + query_string_params = if query_string_params.any? + query_string_params.to_h { |p| p.split "=", 2 } + else + {} + end + + response = @client_stub.make_http_request( + verb, + uri: uri, + body: body || "", + params: query_string_params, + method_name: "get_iam_policy", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Iam::V1::Policy.decode_json response.body, ignore_unknown_fields: true + catch :response do + yield result, operation if block_given? + result + end + end + + ## + # Baseline implementation for the set_iam_policy REST call + # + # @param request_pb [::Google::Iam::V1::SetIamPolicyRequest] + # A request object representing the call parameters. Required. + # @param options [::Gapic::CallOptions] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Iam::V1::Policy] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Iam::V1::Policy] + # A result object deserialized from the server's reply + def set_iam_policy request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_set_iam_policy_request request_pb + query_string_params = if query_string_params.any? + query_string_params.to_h { |p| p.split "=", 2 } + else + {} + end + + response = @client_stub.make_http_request( + verb, + uri: uri, + body: body || "", + params: query_string_params, + method_name: "set_iam_policy", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Iam::V1::Policy.decode_json response.body, ignore_unknown_fields: true + catch :response do + yield result, operation if block_given? + result + end + end + + ## + # Baseline implementation for the test_iam_permissions REST call + # + # @param request_pb [::Google::Iam::V1::TestIamPermissionsRequest] + # A request object representing the call parameters. Required. + # @param options [::Gapic::CallOptions] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Iam::V1::TestIamPermissionsResponse] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Iam::V1::TestIamPermissionsResponse] + # A result object deserialized from the server's reply + def test_iam_permissions request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_test_iam_permissions_request request_pb + query_string_params = if query_string_params.any? + query_string_params.to_h { |p| p.split "=", 2 } + else + {} + end + + response = @client_stub.make_http_request( + verb, + uri: uri, + body: body || "", + params: query_string_params, + method_name: "test_iam_permissions", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Iam::V1::TestIamPermissionsResponse.decode_json response.body, ignore_unknown_fields: true + catch :response do + yield result, operation if block_given? + result + end + end + + ## + # @private + # + # GRPC transcoding helper method for the get_organization REST call + # + # @param request_pb [::Google::Cloud::ResourceManager::V3::GetOrganizationRequest] + # A request object representing the call parameters. Required. + # @return [Array(String, [String, nil], Hash{String => String})] + # Uri, Body, Query string parameters + def self.transcode_get_organization_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :get, + uri_template: "/v3/{name}", + matches: [ + ["name", %r{^organizations/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the search_organizations REST call + # + # @param request_pb [::Google::Cloud::ResourceManager::V3::SearchOrganizationsRequest] + # 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_organizations_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :get, + uri_template: "/v3/organizations:search", + matches: [] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the get_iam_policy REST call + # + # @param request_pb [::Google::Iam::V1::GetIamPolicyRequest] + # A request object representing the call parameters. Required. + # @return [Array(String, [String, nil], Hash{String => String})] + # Uri, Body, Query string parameters + def self.transcode_get_iam_policy_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :post, + uri_template: "/v3/{resource}:getIamPolicy", + body: "*", + matches: [ + ["resource", %r{^organizations/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the set_iam_policy REST call + # + # @param request_pb [::Google::Iam::V1::SetIamPolicyRequest] + # A request object representing the call parameters. Required. + # @return [Array(String, [String, nil], Hash{String => String})] + # Uri, Body, Query string parameters + def self.transcode_set_iam_policy_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :post, + uri_template: "/v3/{resource}:setIamPolicy", + body: "*", + matches: [ + ["resource", %r{^organizations/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the test_iam_permissions REST call + # + # @param request_pb [::Google::Iam::V1::TestIamPermissionsRequest] + # A request object representing the call parameters. Required. + # @return [Array(String, [String, nil], Hash{String => String})] + # Uri, Body, Query string parameters + def self.transcode_test_iam_permissions_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :post, + uri_template: "/v3/{resource}:testIamPermissions", + body: "*", + matches: [ + ["resource", %r{^organizations/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + end + end + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-resource_manager-v3/lib/google/cloud/resource_manager/v3/projects.rb b/owl-bot-staging/google-cloud-resource_manager-v3/lib/google/cloud/resource_manager/v3/projects.rb new file mode 100644 index 000000000000..ccf8f95fcd28 --- /dev/null +++ b/owl-bot-staging/google-cloud-resource_manager-v3/lib/google/cloud/resource_manager/v3/projects.rb @@ -0,0 +1,56 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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/resource_manager/v3/version" + +require "google/cloud/resource_manager/v3/projects/credentials" +require "google/cloud/resource_manager/v3/projects/paths" +require "google/cloud/resource_manager/v3/projects/operations" +require "google/cloud/resource_manager/v3/projects/client" +require "google/cloud/resource_manager/v3/projects/rest" + +module Google + module Cloud + module ResourceManager + module V3 + ## + # Manages Google Cloud Projects. + # + # @example Load this service and instantiate a gRPC client + # + # require "google/cloud/resource_manager/v3/projects" + # client = ::Google::Cloud::ResourceManager::V3::Projects::Client.new + # + # @example Load this service and instantiate a REST client + # + # require "google/cloud/resource_manager/v3/projects/rest" + # client = ::Google::Cloud::ResourceManager::V3::Projects::Rest::Client.new + # + module Projects + end + end + end + end +end + +helper_path = ::File.join __dir__, "projects", "helpers.rb" +require "google/cloud/resource_manager/v3/projects/helpers" if ::File.file? helper_path diff --git a/owl-bot-staging/google-cloud-resource_manager-v3/lib/google/cloud/resource_manager/v3/projects/client.rb b/owl-bot-staging/google-cloud-resource_manager-v3/lib/google/cloud/resource_manager/v3/projects/client.rb new file mode 100644 index 000000000000..edbf92f12e3a --- /dev/null +++ b/owl-bot-staging/google-cloud-resource_manager-v3/lib/google/cloud/resource_manager/v3/projects/client.rb @@ -0,0 +1,1685 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +require "google/cloud/errors" +require "google/cloud/resourcemanager/v3/projects_pb" + +module Google + module Cloud + module ResourceManager + module V3 + module Projects + ## + # Client for the Projects service. + # + # Manages Google Cloud Projects. + # + class Client + # @private + API_VERSION = "" + + # @private + DEFAULT_ENDPOINT_TEMPLATE = "cloudresourcemanager.$UNIVERSE_DOMAIN$" + + include Paths + + # @private + attr_reader :projects_stub + + ## + # Configure the Projects Client class. + # + # See {::Google::Cloud::ResourceManager::V3::Projects::Client::Configuration} + # for a description of the configuration fields. + # + # @example + # + # # Modify the configuration for all Projects clients + # ::Google::Cloud::ResourceManager::V3::Projects::Client.configure do |config| + # config.timeout = 10.0 + # end + # + # @yield [config] Configure the Client client. + # @yieldparam config [Client::Configuration] + # + # @return [Client::Configuration] + # + def self.configure + @configure ||= begin + namespace = ["Google", "Cloud", "ResourceManager", "V3"] + 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.get_project.timeout = 60.0 + default_config.rpcs.get_project.retry_policy = { + initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [14] + } + + default_config.rpcs.list_projects.timeout = 60.0 + default_config.rpcs.list_projects.retry_policy = { + initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [14] + } + + default_config.rpcs.search_projects.timeout = 60.0 + + default_config.rpcs.create_project.timeout = 60.0 + + default_config.rpcs.update_project.timeout = 60.0 + + default_config.rpcs.move_project.timeout = 60.0 + + default_config.rpcs.delete_project.timeout = 60.0 + + default_config.rpcs.undelete_project.timeout = 60.0 + + default_config.rpcs.get_iam_policy.timeout = 60.0 + default_config.rpcs.get_iam_policy.retry_policy = { + initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [14] + } + + default_config.rpcs.set_iam_policy.timeout = 60.0 + + default_config + end + yield @configure if block_given? + @configure + end + + ## + # Configure the Projects Client instance. + # + # The configuration is set to the derived mode, meaning that values can be changed, + # but structural changes (adding new fields, etc.) are not allowed. Structural changes + # should be made on {Client.configure}. + # + # See {::Google::Cloud::ResourceManager::V3::Projects::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 + @projects_stub.universe_domain + end + + ## + # Create a new Projects client object. + # + # @example + # + # # Create a client using the default configuration + # client = ::Google::Cloud::ResourceManager::V3::Projects::Client.new + # + # # Create a client using a custom configuration + # client = ::Google::Cloud::ResourceManager::V3::Projects::Client.new do |config| + # config.timeout = 10.0 + # end + # + # @yield [config] Configure the Projects client. + # @yieldparam config [Client::Configuration] + # + def initialize + # These require statements are intentionally placed here to initialize + # the gRPC module only when it's required. + # See https://github.com/googleapis/toolkit/issues/446 + require "gapic/grpc" + require "google/cloud/resourcemanager/v3/projects_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 + + @projects_stub = ::Gapic::ServiceStub.new( + ::Google::Cloud::ResourceManager::V3::Projects::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 + ) + + @projects_stub.stub_logger&.info do |entry| + entry.set_system_name + entry.set_service + entry.message = "Created client for #{entry.service}" + entry.set_credentials_fields credentials + entry.set "customEndpoint", @config.endpoint if @config.endpoint + entry.set "defaultTimeout", @config.timeout if @config.timeout + entry.set "quotaProject", @quota_project_id if @quota_project_id + end + end + + ## + # Get the associated client for long-running operations. + # + # @return [::Google::Cloud::ResourceManager::V3::Projects::Operations] + # + attr_reader :operations_client + + ## + # The logger used for request/response debug logging. + # + # @return [Logger] + # + def logger + @projects_stub.logger + end + + # Service calls + + ## + # Retrieves the project identified by the specified `name` (for example, + # `projects/415104041262`). + # + # The caller must have `resourcemanager.projects.get` permission + # for this project. + # + # @overload get_project(request, options = nil) + # Pass arguments to `get_project` via a request object, either of type + # {::Google::Cloud::ResourceManager::V3::GetProjectRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::ResourceManager::V3::GetProjectRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. + # + # @overload get_project(name: nil) + # Pass arguments to `get_project` via keyword arguments. Note that at + # least one keyword argument is 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 project (for example, `projects/415104041262`). + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Google::Cloud::ResourceManager::V3::Project] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Google::Cloud::ResourceManager::V3::Project] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/resource_manager/v3" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::ResourceManager::V3::Projects::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::ResourceManager::V3::GetProjectRequest.new + # + # # Call the get_project method. + # result = client.get_project request + # + # # The returned object is of type Google::Cloud::ResourceManager::V3::Project. + # p result + # + def get_project request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::ResourceManager::V3::GetProjectRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + metadata = @config.rpcs.get_project.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::ResourceManager::V3::VERSION + metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.name + header_params["name"] = request.name + end + + request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") + metadata[:"x-goog-request-params"] ||= request_params_header + + options.apply_defaults timeout: @config.rpcs.get_project.timeout, + metadata: metadata, + retry_policy: @config.rpcs.get_project.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @projects_stub.call_rpc :get_project, request, options: options do |response, operation| + yield response, operation if block_given? + end + rescue ::GRPC::BadStatus => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Lists projects that are direct children of the specified folder or + # organization resource. `list()` provides a strongly consistent view of the + # projects underneath the specified parent resource. `list()` returns + # projects sorted based upon the (ascending) lexical ordering of their + # `display_name`. The caller must have `resourcemanager.projects.list` + # permission on the identified parent. + # + # @overload list_projects(request, options = nil) + # Pass arguments to `list_projects` via a request object, either of type + # {::Google::Cloud::ResourceManager::V3::ListProjectsRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::ResourceManager::V3::ListProjectsRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_projects(parent: nil, page_token: nil, page_size: nil, show_deleted: nil) + # Pass arguments to `list_projects` via keyword arguments. Note that at + # least one keyword argument is 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 name of the parent resource whose projects are being listed. + # Only children of this parent resource are listed; descendants are not + # listed. + # + # If the parent is a folder, use the value `folders/{folder_id}`. If the + # parent is an organization, use the value `organizations/{org_id}`. + # @param page_token [::String] + # Optional. A pagination token returned from a previous call to + # [ListProjects] [google.cloud.resourcemanager.v3.Projects.ListProjects] that + # indicates from where listing should continue. + # @param page_size [::Integer] + # Optional. The maximum number of projects to return in the response. + # The server can return fewer projects than requested. + # If unspecified, server picks an appropriate default. + # @param show_deleted [::Boolean] + # Optional. Indicate that projects in the `DELETE_REQUESTED` state should + # also be returned. Normally only `ACTIVE` projects are returned. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Gapic::PagedEnumerable<::Google::Cloud::ResourceManager::V3::Project>] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Gapic::PagedEnumerable<::Google::Cloud::ResourceManager::V3::Project>] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/resource_manager/v3" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::ResourceManager::V3::Projects::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::ResourceManager::V3::ListProjectsRequest.new + # + # # Call the list_projects method. + # result = client.list_projects request + # + # # The returned object is of type Gapic::PagedEnumerable. You can iterate + # # over elements, and API calls will be issued to fetch pages as needed. + # result.each do |item| + # # Each element is of type ::Google::Cloud::ResourceManager::V3::Project. + # p item + # end + # + def list_projects request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::ResourceManager::V3::ListProjectsRequest + + # Converts hash 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_projects.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::ResourceManager::V3::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.list_projects.timeout, + metadata: metadata, + retry_policy: @config.rpcs.list_projects.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @projects_stub.call_rpc :list_projects, request, options: options do |response, operation| + response = ::Gapic::PagedEnumerable.new @projects_stub, :list_projects, 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 for projects that the caller has both `resourcemanager.projects.get` + # permission on, and also satisfy the specified query. + # + # This method returns projects in an unspecified order. + # + # This method is eventually consistent with project mutations; this means + # that a newly created project may not appear in the results or recent + # updates to an existing project may not be reflected in the results. To + # retrieve the latest state of a project, use the + # {::Google::Cloud::ResourceManager::V3::Projects::Client#get_project GetProject} method. + # + # @overload search_projects(request, options = nil) + # Pass arguments to `search_projects` via a request object, either of type + # {::Google::Cloud::ResourceManager::V3::SearchProjectsRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::ResourceManager::V3::SearchProjectsRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_projects(query: nil, page_token: nil, page_size: nil) + # Pass arguments to `search_projects` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param query [::String] + # Optional. A query string for searching for projects that the caller has + # `resourcemanager.projects.get` permission to. If multiple fields are + # included in the query, then it will return results that match any of the + # fields. Some eligible fields are: + # + # - **`displayName`, `name`**: Filters by displayName. + # - **`parent`**: Project's parent (for example: `folders/123`, + # `organizations/*`). Prefer `parent` field over `parent.type` and + # `parent.id`. + # - **`parent.type`**: Parent's type: `folder` or `organization`. + # - **`parent.id`**: Parent's id number (for example: `123`). + # - **`id`, `projectId`**: Filters by projectId. + # - **`state`, `lifecycleState`**: Filters by state. + # - **`labels`**: Filters by label name or value. + # - **`labels.` (where `` is the name of a label)**: Filters by label + # name. + # + # Search expressions are case insensitive. + # + # Some examples queries: + # + # + # - **`name:how*`**: The project's name starts with "how". + # - **`name:Howl`**: The project's name is `Howl` or `howl`. + # - **`name:HOWL`**: Equivalent to above. + # - **`NAME:howl`**: Equivalent to above. + # - **`labels.color:*`**: The project has the label `color`. + # - **`labels.color:red`**: The project's label `color` has the value `red`. + # - **`labels.color:red labels.size:big`**: The project's label `color` has + # the value `red` or its label `size` has the value `big`. + # + # If no query is specified, the call will return projects for which the user + # has the `resourcemanager.projects.get` permission. + # @param page_token [::String] + # Optional. A pagination token returned from a previous call to + # [ListProjects] [google.cloud.resourcemanager.v3.Projects.ListProjects] that + # indicates from where listing should continue. + # @param page_size [::Integer] + # Optional. The maximum number of projects to return in the response. + # The server can return fewer projects than requested. + # If unspecified, server picks an appropriate default. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Gapic::PagedEnumerable<::Google::Cloud::ResourceManager::V3::Project>] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Gapic::PagedEnumerable<::Google::Cloud::ResourceManager::V3::Project>] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/resource_manager/v3" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::ResourceManager::V3::Projects::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::ResourceManager::V3::SearchProjectsRequest.new + # + # # Call the search_projects method. + # result = client.search_projects request + # + # # The returned object is of type Gapic::PagedEnumerable. You can iterate + # # over elements, and API calls will be issued to fetch pages as needed. + # result.each do |item| + # # Each element is of type ::Google::Cloud::ResourceManager::V3::Project. + # p item + # end + # + def search_projects request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::ResourceManager::V3::SearchProjectsRequest + + # Converts hash 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_projects.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::ResourceManager::V3::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.search_projects.timeout, + metadata: metadata, + retry_policy: @config.rpcs.search_projects.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @projects_stub.call_rpc :search_projects, request, options: options do |response, operation| + response = ::Gapic::PagedEnumerable.new @projects_stub, :search_projects, 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 + + ## + # Request that a new project be created. The result is an `Operation` which + # can be used to track the creation process. This process usually takes a few + # seconds, but can sometimes take much longer. The tracking `Operation` is + # automatically deleted after a few hours, so there is no need to call + # `DeleteOperation`. + # + # @overload create_project(request, options = nil) + # Pass arguments to `create_project` via a request object, either of type + # {::Google::Cloud::ResourceManager::V3::CreateProjectRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::ResourceManager::V3::CreateProjectRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_project(project: nil) + # Pass arguments to `create_project` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param project [::Google::Cloud::ResourceManager::V3::Project, ::Hash] + # Required. The Project to create. + # + # Project ID is required. If the requested ID is unavailable, the request + # fails. + # + # If the `parent` field is set, the `resourcemanager.projects.create` + # permission is checked on the parent resource. If no parent is set and + # the authorization credentials belong to an Organization, the parent + # will be set to that Organization. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Gapic::Operation] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Gapic::Operation] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/resource_manager/v3" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::ResourceManager::V3::Projects::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::ResourceManager::V3::CreateProjectRequest.new + # + # # Call the create_project method. + # result = client.create_project 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_project request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::ResourceManager::V3::CreateProjectRequest + + # Converts hash 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_project.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::ResourceManager::V3::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.create_project.timeout, + metadata: metadata, + retry_policy: @config.rpcs.create_project.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @projects_stub.call_rpc :create_project, request, options: options do |response, operation| + response = ::Gapic::Operation.new response, @operations_client, options: options + yield response, operation if block_given? + throw :response, response + end + rescue ::GRPC::BadStatus => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Updates the `display_name` and labels of the project identified by the + # specified `name` (for example, `projects/415104041262`). Deleting all + # labels requires an update mask for labels field. + # + # The caller must have `resourcemanager.projects.update` permission for this + # project. + # + # @overload update_project(request, options = nil) + # Pass arguments to `update_project` via a request object, either of type + # {::Google::Cloud::ResourceManager::V3::UpdateProjectRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::ResourceManager::V3::UpdateProjectRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. + # + # @overload update_project(project: nil, update_mask: nil) + # Pass arguments to `update_project` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param project [::Google::Cloud::ResourceManager::V3::Project, ::Hash] + # Required. The new definition of the project. + # @param update_mask [::Google::Protobuf::FieldMask, ::Hash] + # Optional. An update mask to selectively update fields. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Gapic::Operation] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Gapic::Operation] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/resource_manager/v3" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::ResourceManager::V3::Projects::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::ResourceManager::V3::UpdateProjectRequest.new + # + # # Call the update_project method. + # result = client.update_project 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_project request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::ResourceManager::V3::UpdateProjectRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + metadata = @config.rpcs.update_project.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::ResourceManager::V3::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.project&.name + header_params["project.name"] = request.project.name + end + + request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") + metadata[:"x-goog-request-params"] ||= request_params_header + + options.apply_defaults timeout: @config.rpcs.update_project.timeout, + metadata: metadata, + retry_policy: @config.rpcs.update_project.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @projects_stub.call_rpc :update_project, 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 + + ## + # Move a project to another place in your resource hierarchy, under a new + # resource parent. + # + # Returns an operation which can be used to track the process of the project + # move workflow. + # Upon success, the `Operation.response` field will be populated with the + # moved project. + # + # The caller must have `resourcemanager.projects.move` permission on the + # project, on the project's current and proposed new parent. + # + # If project has no current parent, or it currently does not have an + # associated organization resource, you will also need the + # `resourcemanager.projects.setIamPolicy` permission in the project. + # + # @overload move_project(request, options = nil) + # Pass arguments to `move_project` via a request object, either of type + # {::Google::Cloud::ResourceManager::V3::MoveProjectRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::ResourceManager::V3::MoveProjectRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. + # + # @overload move_project(name: nil, destination_parent: nil) + # Pass arguments to `move_project` via keyword arguments. Note that at + # least one keyword argument is 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 project to move. + # @param destination_parent [::String] + # Required. The new parent to move the Project under. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Gapic::Operation] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Gapic::Operation] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/resource_manager/v3" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::ResourceManager::V3::Projects::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::ResourceManager::V3::MoveProjectRequest.new + # + # # Call the move_project method. + # result = client.move_project 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 move_project request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::ResourceManager::V3::MoveProjectRequest + + # Converts hash 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.move_project.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::ResourceManager::V3::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.move_project.timeout, + metadata: metadata, + retry_policy: @config.rpcs.move_project.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @projects_stub.call_rpc :move_project, 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 + + ## + # Marks the project identified by the specified + # `name` (for example, `projects/415104041262`) for deletion. + # + # This method will only affect the project if it has a lifecycle state of + # {::Google::Cloud::ResourceManager::V3::Project::State::ACTIVE ACTIVE}. + # + # This method changes the Project's lifecycle state from + # {::Google::Cloud::ResourceManager::V3::Project::State::ACTIVE ACTIVE} + # to + # {::Google::Cloud::ResourceManager::V3::Project::State::DELETE_REQUESTED DELETE_REQUESTED}. + # The deletion starts at an unspecified time, + # at which point the Project is no longer accessible. + # + # Until the deletion completes, you can check the lifecycle state + # checked by retrieving the project with [GetProject] + # [google.cloud.resourcemanager.v3.Projects.GetProject], + # and the project remains visible to [ListProjects] + # [google.cloud.resourcemanager.v3.Projects.ListProjects]. + # However, you cannot update the project. + # + # After the deletion completes, the project is not retrievable by + # the [GetProject] + # [google.cloud.resourcemanager.v3.Projects.GetProject], + # [ListProjects] + # [google.cloud.resourcemanager.v3.Projects.ListProjects], and + # {::Google::Cloud::ResourceManager::V3::Projects::Client#search_projects SearchProjects} + # methods. + # + # This method behaves idempotently, such that deleting a `DELETE_REQUESTED` + # project will not cause an error, but also won't do anything. + # + # The caller must have `resourcemanager.projects.delete` permissions for this + # project. + # + # @overload delete_project(request, options = nil) + # Pass arguments to `delete_project` via a request object, either of type + # {::Google::Cloud::ResourceManager::V3::DeleteProjectRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::ResourceManager::V3::DeleteProjectRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_project(name: nil) + # Pass arguments to `delete_project` via keyword arguments. Note that at + # least one keyword argument is 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 Project (for example, `projects/415104041262`). + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Gapic::Operation] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Gapic::Operation] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/resource_manager/v3" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::ResourceManager::V3::Projects::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::ResourceManager::V3::DeleteProjectRequest.new + # + # # Call the delete_project method. + # result = client.delete_project 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_project request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::ResourceManager::V3::DeleteProjectRequest + + # Converts hash 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_project.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::ResourceManager::V3::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_project.timeout, + metadata: metadata, + retry_policy: @config.rpcs.delete_project.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @projects_stub.call_rpc :delete_project, 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 + + ## + # Restores the project identified by the specified + # `name` (for example, `projects/415104041262`). + # You can only use this method for a project that has a lifecycle state of + # [DELETE_REQUESTED] + # [Projects.State.DELETE_REQUESTED]. + # After deletion starts, the project cannot be restored. + # + # The caller must have `resourcemanager.projects.undelete` permission for + # this project. + # + # @overload undelete_project(request, options = nil) + # Pass arguments to `undelete_project` via a request object, either of type + # {::Google::Cloud::ResourceManager::V3::UndeleteProjectRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::ResourceManager::V3::UndeleteProjectRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. + # + # @overload undelete_project(name: nil) + # Pass arguments to `undelete_project` via keyword arguments. Note that at + # least one keyword argument is 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 project (for example, `projects/415104041262`). + # + # Required. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Gapic::Operation] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Gapic::Operation] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/resource_manager/v3" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::ResourceManager::V3::Projects::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::ResourceManager::V3::UndeleteProjectRequest.new + # + # # Call the undelete_project method. + # result = client.undelete_project 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 undelete_project request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::ResourceManager::V3::UndeleteProjectRequest + + # Converts hash 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.undelete_project.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::ResourceManager::V3::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.undelete_project.timeout, + metadata: metadata, + retry_policy: @config.rpcs.undelete_project.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @projects_stub.call_rpc :undelete_project, request, options: options do |response, operation| + response = ::Gapic::Operation.new response, @operations_client, options: options + yield response, operation if block_given? + throw :response, response + end + rescue ::GRPC::BadStatus => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Returns the IAM access control policy for the specified project, in the + # format `projects/{ProjectIdOrNumber}` e.g. projects/123. + # Permission is denied if the policy or the resource do not exist. + # + # @overload get_iam_policy(request, options = nil) + # Pass arguments to `get_iam_policy` via a request object, either of type + # {::Google::Iam::V1::GetIamPolicyRequest} or an equivalent Hash. + # + # @param request [::Google::Iam::V1::GetIamPolicyRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. + # + # @overload get_iam_policy(resource: nil, options: nil) + # Pass arguments to `get_iam_policy` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param resource [::String] + # REQUIRED: The resource for which the policy is being requested. + # See the operation documentation for the appropriate value for this field. + # @param options [::Google::Iam::V1::GetPolicyOptions, ::Hash] + # OPTIONAL: A `GetPolicyOptions` object for specifying options to + # `GetIamPolicy`. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Google::Iam::V1::Policy] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Google::Iam::V1::Policy] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/resource_manager/v3" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::ResourceManager::V3::Projects::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Iam::V1::GetIamPolicyRequest.new + # + # # Call the get_iam_policy method. + # result = client.get_iam_policy request + # + # # The returned object is of type Google::Iam::V1::Policy. + # p result + # + def get_iam_policy request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Iam::V1::GetIamPolicyRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + metadata = @config.rpcs.get_iam_policy.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::ResourceManager::V3::VERSION + metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.resource + header_params["resource"] = request.resource + end + + request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") + metadata[:"x-goog-request-params"] ||= request_params_header + + options.apply_defaults timeout: @config.rpcs.get_iam_policy.timeout, + metadata: metadata, + retry_policy: @config.rpcs.get_iam_policy.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @projects_stub.call_rpc :get_iam_policy, request, options: options do |response, operation| + yield response, operation if block_given? + end + rescue ::GRPC::BadStatus => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Sets the IAM access control policy for the specified project, in the + # format `projects/{ProjectIdOrNumber}` e.g. projects/123. + # + # CAUTION: This method will replace the existing policy, and cannot be used + # to append additional IAM settings. + # + # Note: Removing service accounts from policies or changing their roles can + # render services completely inoperable. It is important to understand how + # the service account is being used before removing or updating its roles. + # + # The following constraints apply when using `setIamPolicy()`: + # + # + Project does not support `allUsers` and `allAuthenticatedUsers` as + # `members` in a `Binding` of a `Policy`. + # + # + The owner role can be granted to a `user`, `serviceAccount`, or a group + # that is part of an organization. For example, + # group@myownpersonaldomain.com could be added as an owner to a project in + # the myownpersonaldomain.com organization, but not the examplepetstore.com + # organization. + # + # + Service accounts can be made owners of a project directly + # without any restrictions. However, to be added as an owner, a user must be + # invited using the Cloud Platform console and must accept the invitation. + # + # + A user cannot be granted the owner role using `setIamPolicy()`. The user + # must be granted the owner role using the Cloud Platform Console and must + # explicitly accept the invitation. + # + # + Invitations to grant the owner role cannot be sent using + # `setIamPolicy()`; + # they must be sent only using the Cloud Platform Console. + # + # + If the project is not part of an organization, there must be at least + # one owner who has accepted the Terms of Service (ToS) agreement in the + # policy. Calling `setIamPolicy()` to remove the last ToS-accepted owner + # from the policy will fail. This restriction also applies to legacy + # projects that no longer have owners who have accepted the ToS. Edits to + # IAM policies will be rejected until the lack of a ToS-accepting owner is + # rectified. If the project is part of an organization, you can remove all + # owners, potentially making the organization inaccessible. + # + # @overload set_iam_policy(request, options = nil) + # Pass arguments to `set_iam_policy` via a request object, either of type + # {::Google::Iam::V1::SetIamPolicyRequest} or an equivalent Hash. + # + # @param request [::Google::Iam::V1::SetIamPolicyRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. + # + # @overload set_iam_policy(resource: nil, policy: nil, update_mask: nil) + # Pass arguments to `set_iam_policy` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param resource [::String] + # REQUIRED: The resource for which the policy is being specified. + # See the operation documentation for the appropriate value for this field. + # @param policy [::Google::Iam::V1::Policy, ::Hash] + # REQUIRED: The complete policy to be applied to the `resource`. The size of + # the policy is limited to a few 10s of KB. An empty policy is a + # valid policy but certain Cloud Platform services (such as Projects) + # might reject them. + # @param update_mask [::Google::Protobuf::FieldMask, ::Hash] + # OPTIONAL: A FieldMask specifying which fields of the policy to modify. Only + # the fields in the mask will be modified. If no mask is provided, the + # following default mask is used: + # + # `paths: "bindings, etag"` + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Google::Iam::V1::Policy] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Google::Iam::V1::Policy] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/resource_manager/v3" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::ResourceManager::V3::Projects::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Iam::V1::SetIamPolicyRequest.new + # + # # Call the set_iam_policy method. + # result = client.set_iam_policy request + # + # # The returned object is of type Google::Iam::V1::Policy. + # p result + # + def set_iam_policy request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Iam::V1::SetIamPolicyRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + metadata = @config.rpcs.set_iam_policy.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::ResourceManager::V3::VERSION + metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.resource + header_params["resource"] = request.resource + end + + request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") + metadata[:"x-goog-request-params"] ||= request_params_header + + options.apply_defaults timeout: @config.rpcs.set_iam_policy.timeout, + metadata: metadata, + retry_policy: @config.rpcs.set_iam_policy.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @projects_stub.call_rpc :set_iam_policy, request, options: options do |response, operation| + yield response, operation if block_given? + end + rescue ::GRPC::BadStatus => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Returns permissions that a caller has on the specified project, in the + # format `projects/{ProjectIdOrNumber}` e.g. projects/123.. + # + # @overload test_iam_permissions(request, options = nil) + # Pass arguments to `test_iam_permissions` via a request object, either of type + # {::Google::Iam::V1::TestIamPermissionsRequest} or an equivalent Hash. + # + # @param request [::Google::Iam::V1::TestIamPermissionsRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. + # + # @overload test_iam_permissions(resource: nil, permissions: nil) + # Pass arguments to `test_iam_permissions` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param resource [::String] + # REQUIRED: The resource for which the policy detail is being requested. + # See the operation documentation for the appropriate value for this field. + # @param permissions [::Array<::String>] + # The set of permissions to check for the `resource`. Permissions with + # wildcards (such as '*' or 'storage.*') are not allowed. For more + # information see + # [IAM Overview](https://cloud.google.com/iam/docs/overview#permissions). + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Google::Iam::V1::TestIamPermissionsResponse] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Google::Iam::V1::TestIamPermissionsResponse] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/resource_manager/v3" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::ResourceManager::V3::Projects::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Iam::V1::TestIamPermissionsRequest.new + # + # # Call the test_iam_permissions method. + # result = client.test_iam_permissions request + # + # # The returned object is of type Google::Iam::V1::TestIamPermissionsResponse. + # p result + # + def test_iam_permissions request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Iam::V1::TestIamPermissionsRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + metadata = @config.rpcs.test_iam_permissions.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::ResourceManager::V3::VERSION + metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.resource + header_params["resource"] = request.resource + end + + request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") + metadata[:"x-goog-request-params"] ||= request_params_header + + options.apply_defaults timeout: @config.rpcs.test_iam_permissions.timeout, + metadata: metadata, + retry_policy: @config.rpcs.test_iam_permissions.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @projects_stub.call_rpc :test_iam_permissions, request, options: options do |response, operation| + yield response, operation if block_given? + end + rescue ::GRPC::BadStatus => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Configuration class for the Projects API. + # + # This class represents the configuration for Projects, + # providing control over timeouts, retry behavior, logging, transport + # parameters, and other low-level controls. Certain parameters can also be + # applied individually to specific RPCs. See + # {::Google::Cloud::ResourceManager::V3::Projects::Client::Configuration::Rpcs} + # for a list of RPCs that can be configured independently. + # + # Configuration can be applied globally to all clients, or to a single client + # on construction. + # + # @example + # + # # Modify the global config, setting the timeout for + # # get_project to 20 seconds, + # # and all remaining timeouts to 10 seconds. + # ::Google::Cloud::ResourceManager::V3::Projects::Client.configure do |config| + # config.timeout = 10.0 + # config.rpcs.get_project.timeout = 20.0 + # end + # + # # Apply the above configuration only to a new client. + # client = ::Google::Cloud::ResourceManager::V3::Projects::Client.new do |config| + # config.timeout = 10.0 + # config.rpcs.get_project.timeout = 20.0 + # end + # + # @!attribute [rw] endpoint + # A custom service endpoint, as a hostname or hostname:port. The default is + # nil, indicating to use the default endpoint in the current universe domain. + # @return [::String,nil] + # @!attribute [rw] credentials + # Credentials to send with calls. You may provide any of the following types: + # * (`Google::Auth::Credentials`) A googleauth credentials object + # (see the [googleauth docs](https://rubydoc.info/gems/googleauth/Google/Auth/Credentials)) + # * (`Signet::OAuth2::Client`) A signet oauth2 client object + # (see the [signet docs](https://rubydoc.info/gems/signet/Signet/OAuth2/Client)) + # * (`GRPC::Core::Channel`) a gRPC channel with included credentials + # * (`GRPC::Core::ChannelCredentials`) a gRPC credentails object + # * (`nil`) indicating no credentials + # + # @note Warning: Passing a `String` to a keyfile path or a `Hash` of credentials + # is deprecated. Providing an unvalidated credential configuration to + # Google APIs can compromise the security of your systems and data. + # + # @example + # + # # The recommended way to provide credentials is to use the `make_creds` method + # # on the appropriate credentials class for your environment. + # + # require "googleauth" + # + # credentials = ::Google::Auth::ServiceAccountCredentials.make_creds( + # json_key_io: ::File.open("/path/to/keyfile.json") + # ) + # + # client = ::Google::Cloud::ResourceManager::V3::Projects::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 = "cloudresourcemanager.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 Projects 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 `get_project` + # @return [::Gapic::Config::Method] + # + attr_reader :get_project + ## + # RPC-specific configuration for `list_projects` + # @return [::Gapic::Config::Method] + # + attr_reader :list_projects + ## + # RPC-specific configuration for `search_projects` + # @return [::Gapic::Config::Method] + # + attr_reader :search_projects + ## + # RPC-specific configuration for `create_project` + # @return [::Gapic::Config::Method] + # + attr_reader :create_project + ## + # RPC-specific configuration for `update_project` + # @return [::Gapic::Config::Method] + # + attr_reader :update_project + ## + # RPC-specific configuration for `move_project` + # @return [::Gapic::Config::Method] + # + attr_reader :move_project + ## + # RPC-specific configuration for `delete_project` + # @return [::Gapic::Config::Method] + # + attr_reader :delete_project + ## + # RPC-specific configuration for `undelete_project` + # @return [::Gapic::Config::Method] + # + attr_reader :undelete_project + ## + # RPC-specific configuration for `get_iam_policy` + # @return [::Gapic::Config::Method] + # + attr_reader :get_iam_policy + ## + # RPC-specific configuration for `set_iam_policy` + # @return [::Gapic::Config::Method] + # + attr_reader :set_iam_policy + ## + # RPC-specific configuration for `test_iam_permissions` + # @return [::Gapic::Config::Method] + # + attr_reader :test_iam_permissions + + # @private + def initialize parent_rpcs = nil + get_project_config = parent_rpcs.get_project if parent_rpcs.respond_to? :get_project + @get_project = ::Gapic::Config::Method.new get_project_config + list_projects_config = parent_rpcs.list_projects if parent_rpcs.respond_to? :list_projects + @list_projects = ::Gapic::Config::Method.new list_projects_config + search_projects_config = parent_rpcs.search_projects if parent_rpcs.respond_to? :search_projects + @search_projects = ::Gapic::Config::Method.new search_projects_config + create_project_config = parent_rpcs.create_project if parent_rpcs.respond_to? :create_project + @create_project = ::Gapic::Config::Method.new create_project_config + update_project_config = parent_rpcs.update_project if parent_rpcs.respond_to? :update_project + @update_project = ::Gapic::Config::Method.new update_project_config + move_project_config = parent_rpcs.move_project if parent_rpcs.respond_to? :move_project + @move_project = ::Gapic::Config::Method.new move_project_config + delete_project_config = parent_rpcs.delete_project if parent_rpcs.respond_to? :delete_project + @delete_project = ::Gapic::Config::Method.new delete_project_config + undelete_project_config = parent_rpcs.undelete_project if parent_rpcs.respond_to? :undelete_project + @undelete_project = ::Gapic::Config::Method.new undelete_project_config + get_iam_policy_config = parent_rpcs.get_iam_policy if parent_rpcs.respond_to? :get_iam_policy + @get_iam_policy = ::Gapic::Config::Method.new get_iam_policy_config + set_iam_policy_config = parent_rpcs.set_iam_policy if parent_rpcs.respond_to? :set_iam_policy + @set_iam_policy = ::Gapic::Config::Method.new set_iam_policy_config + test_iam_permissions_config = parent_rpcs.test_iam_permissions if parent_rpcs.respond_to? :test_iam_permissions + @test_iam_permissions = ::Gapic::Config::Method.new test_iam_permissions_config + + yield self if block_given? + end + end + end + end + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-resource_manager-v3/lib/google/cloud/resource_manager/v3/projects/credentials.rb b/owl-bot-staging/google-cloud-resource_manager-v3/lib/google/cloud/resource_manager/v3/projects/credentials.rb new file mode 100644 index 000000000000..b6b0e69ef9fd --- /dev/null +++ b/owl-bot-staging/google-cloud-resource_manager-v3/lib/google/cloud/resource_manager/v3/projects/credentials.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 "googleauth" + +module Google + module Cloud + module ResourceManager + module V3 + module Projects + # Credentials for the Projects API. + class Credentials < ::Google::Auth::Credentials + self.scope = [ + "https://www.googleapis.com/auth/cloud-platform", + "https://www.googleapis.com/auth/cloud-platform.read-only" + ] + self.env_vars = [ + "RESOURCE_MANAGER_CREDENTIALS", + "RESOURCE_MANAGER_KEYFILE", + "GOOGLE_CLOUD_CREDENTIALS", + "GOOGLE_CLOUD_KEYFILE", + "GCLOUD_KEYFILE", + "RESOURCE_MANAGER_CREDENTIALS_JSON", + "RESOURCE_MANAGER_KEYFILE_JSON", + "GOOGLE_CLOUD_CREDENTIALS_JSON", + "GOOGLE_CLOUD_KEYFILE_JSON", + "GCLOUD_KEYFILE_JSON" + ] + self.paths = [ + "~/.config/google_cloud/application_default_credentials.json" + ] + end + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-resource_manager-v3/lib/google/cloud/resource_manager/v3/projects/operations.rb b/owl-bot-staging/google-cloud-resource_manager-v3/lib/google/cloud/resource_manager/v3/projects/operations.rb new file mode 100644 index 000000000000..2e803eae5742 --- /dev/null +++ b/owl-bot-staging/google-cloud-resource_manager-v3/lib/google/cloud/resource_manager/v3/projects/operations.rb @@ -0,0 +1,841 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +require "gapic/operation" +require "google/longrunning/operations_pb" + +module Google + module Cloud + module ResourceManager + module V3 + module Projects + # Service that implements Longrunning Operations API. + class Operations + # @private + API_VERSION = "" + + # @private + DEFAULT_ENDPOINT_TEMPLATE = "cloudresourcemanager.$UNIVERSE_DOMAIN$" + + # @private + attr_reader :operations_stub + + ## + # Configuration for the Projects 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 Projects 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::ResourceManager::V3::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::ResourceManager::V3::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::ResourceManager::V3::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::ResourceManager::V3::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::ResourceManager::V3::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 = "cloudresourcemanager.googleapis.com" + + config_attr :endpoint, nil, ::String, nil + config_attr :credentials, nil do |value| + allowed = [::String, ::Hash, ::Proc, ::Symbol, ::Google::Auth::Credentials, ::Google::Auth::BaseClient, ::Signet::OAuth2::Client, nil] + allowed += [::GRPC::Core::Channel, ::GRPC::Core::ChannelCredentials] if defined? ::GRPC::Core::Channel + allowed.any? { |klass| klass === value } + end + config_attr :scope, nil, ::String, ::Array, nil + config_attr :lib_name, nil, ::String, nil + config_attr :lib_version, nil, ::String, nil + config_attr(:channel_args, { "grpc.service_config_disable_resolution" => 1 }, ::Hash, nil) + config_attr :interceptors, nil, ::Array, nil + config_attr :timeout, nil, ::Numeric, nil + config_attr :metadata, nil, ::Hash, nil + config_attr :retry_policy, nil, ::Hash, ::Proc, nil + config_attr :quota_project, nil, ::String, nil + config_attr :universe_domain, nil, ::String, nil + config_attr :logger, :default, ::Logger, nil, :default + + # @private + def initialize parent_config = nil + @parent_config = parent_config unless parent_config.nil? + + yield self if block_given? + end + + ## + # Configurations for individual RPCs + # @return [Rpcs] + # + def rpcs + @rpcs ||= begin + parent_rpcs = nil + parent_rpcs = @parent_config.rpcs if defined?(@parent_config) && @parent_config.respond_to?(:rpcs) + Rpcs.new parent_rpcs + end + end + + ## + # Configuration for the channel pool + # @return [::Gapic::ServiceStub::ChannelPool::Configuration] + # + def channel_pool + @channel_pool ||= ::Gapic::ServiceStub::ChannelPool::Configuration.new + end + + ## + # Configuration RPC class for the Operations API. + # + # Includes fields providing the configuration for each RPC in this service. + # Each configuration object is of type `Gapic::Config::Method` and includes + # the following configuration fields: + # + # * `timeout` (*type:* `Numeric`) - The call timeout in seconds + # * `metadata` (*type:* `Hash{Symbol=>String}`) - Additional gRPC headers + # * `retry_policy (*type:* `Hash`) - The retry policy. The policy fields + # include the following keys: + # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds. + # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds. + # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier. + # * `:retry_codes` (*type:* `Array`) - The error codes that should + # trigger a retry. + # + class Rpcs + ## + # RPC-specific configuration for `list_operations` + # @return [::Gapic::Config::Method] + # + attr_reader :list_operations + ## + # RPC-specific configuration for `get_operation` + # @return [::Gapic::Config::Method] + # + attr_reader :get_operation + ## + # RPC-specific configuration for `delete_operation` + # @return [::Gapic::Config::Method] + # + attr_reader :delete_operation + ## + # RPC-specific configuration for `cancel_operation` + # @return [::Gapic::Config::Method] + # + attr_reader :cancel_operation + ## + # RPC-specific configuration for `wait_operation` + # @return [::Gapic::Config::Method] + # + attr_reader :wait_operation + + # @private + def initialize parent_rpcs = nil + list_operations_config = parent_rpcs.list_operations if parent_rpcs.respond_to? :list_operations + @list_operations = ::Gapic::Config::Method.new list_operations_config + get_operation_config = parent_rpcs.get_operation if parent_rpcs.respond_to? :get_operation + @get_operation = ::Gapic::Config::Method.new get_operation_config + delete_operation_config = parent_rpcs.delete_operation if parent_rpcs.respond_to? :delete_operation + @delete_operation = ::Gapic::Config::Method.new delete_operation_config + cancel_operation_config = parent_rpcs.cancel_operation if parent_rpcs.respond_to? :cancel_operation + @cancel_operation = ::Gapic::Config::Method.new cancel_operation_config + wait_operation_config = parent_rpcs.wait_operation if parent_rpcs.respond_to? :wait_operation + @wait_operation = ::Gapic::Config::Method.new wait_operation_config + + yield self if block_given? + end + end + end + end + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-resource_manager-v3/lib/google/cloud/resource_manager/v3/projects/paths.rb b/owl-bot-staging/google-cloud-resource_manager-v3/lib/google/cloud/resource_manager/v3/projects/paths.rb new file mode 100644 index 000000000000..d5bfba4cb1c3 --- /dev/null +++ b/owl-bot-staging/google-cloud-resource_manager-v3/lib/google/cloud/resource_manager/v3/projects/paths.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! + + +module Google + module Cloud + module ResourceManager + module V3 + module Projects + # Path helper methods for the Projects API. + module Paths + ## + # Create a fully-qualified Project resource string. + # + # The resource will be in the following format: + # + # `projects/{project}` + # + # @param project [String] + # + # @return [::String] + def project_path project: + "projects/#{project}" + end + + extend self + end + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-resource_manager-v3/lib/google/cloud/resource_manager/v3/projects/rest.rb b/owl-bot-staging/google-cloud-resource_manager-v3/lib/google/cloud/resource_manager/v3/projects/rest.rb new file mode 100644 index 000000000000..a3b1ccf2f322 --- /dev/null +++ b/owl-bot-staging/google-cloud-resource_manager-v3/lib/google/cloud/resource_manager/v3/projects/rest.rb @@ -0,0 +1,53 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +require "gapic/rest" +require "gapic/config" +require "gapic/config/method" + +require "google/cloud/resource_manager/v3/version" + +require "google/cloud/resource_manager/v3/projects/credentials" +require "google/cloud/resource_manager/v3/projects/paths" +require "google/cloud/resource_manager/v3/projects/rest/operations" +require "google/cloud/resource_manager/v3/projects/rest/client" + +module Google + module Cloud + module ResourceManager + module V3 + ## + # Manages Google Cloud Projects. + # + # To load this service and instantiate a REST client: + # + # require "google/cloud/resource_manager/v3/projects/rest" + # client = ::Google::Cloud::ResourceManager::V3::Projects::Rest::Client.new + # + module Projects + # Client for the REST transport + module Rest + end + end + end + end + end +end + +helper_path = ::File.join __dir__, "rest", "helpers.rb" +require "google/cloud/resource_manager/v3/projects/rest/helpers" if ::File.file? helper_path diff --git a/owl-bot-staging/google-cloud-resource_manager-v3/lib/google/cloud/resource_manager/v3/projects/rest/client.rb b/owl-bot-staging/google-cloud-resource_manager-v3/lib/google/cloud/resource_manager/v3/projects/rest/client.rb new file mode 100644 index 000000000000..6bda27ce384f --- /dev/null +++ b/owl-bot-staging/google-cloud-resource_manager-v3/lib/google/cloud/resource_manager/v3/projects/rest/client.rb @@ -0,0 +1,1589 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +require "google/cloud/errors" +require "google/cloud/resourcemanager/v3/projects_pb" +require "google/cloud/resource_manager/v3/projects/rest/service_stub" + +module Google + module Cloud + module ResourceManager + module V3 + module Projects + module Rest + ## + # REST client for the Projects service. + # + # Manages Google Cloud Projects. + # + class Client + # @private + API_VERSION = "" + + # @private + DEFAULT_ENDPOINT_TEMPLATE = "cloudresourcemanager.$UNIVERSE_DOMAIN$" + + include Paths + + # @private + attr_reader :projects_stub + + ## + # Configure the Projects Client class. + # + # See {::Google::Cloud::ResourceManager::V3::Projects::Rest::Client::Configuration} + # for a description of the configuration fields. + # + # @example + # + # # Modify the configuration for all Projects clients + # ::Google::Cloud::ResourceManager::V3::Projects::Rest::Client.configure do |config| + # config.timeout = 10.0 + # end + # + # @yield [config] Configure the Client client. + # @yieldparam config [Client::Configuration] + # + # @return [Client::Configuration] + # + def self.configure + @configure ||= begin + namespace = ["Google", "Cloud", "ResourceManager", "V3"] + 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.get_project.timeout = 60.0 + default_config.rpcs.get_project.retry_policy = { + initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [14] + } + + default_config.rpcs.list_projects.timeout = 60.0 + default_config.rpcs.list_projects.retry_policy = { + initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [14] + } + + default_config.rpcs.search_projects.timeout = 60.0 + + default_config.rpcs.create_project.timeout = 60.0 + + default_config.rpcs.update_project.timeout = 60.0 + + default_config.rpcs.move_project.timeout = 60.0 + + default_config.rpcs.delete_project.timeout = 60.0 + + default_config.rpcs.undelete_project.timeout = 60.0 + + default_config.rpcs.get_iam_policy.timeout = 60.0 + default_config.rpcs.get_iam_policy.retry_policy = { + initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [14] + } + + default_config.rpcs.set_iam_policy.timeout = 60.0 + + default_config + end + yield @configure if block_given? + @configure + end + + ## + # Configure the Projects Client instance. + # + # The configuration is set to the derived mode, meaning that values can be changed, + # but structural changes (adding new fields, etc.) are not allowed. Structural changes + # should be made on {Client.configure}. + # + # See {::Google::Cloud::ResourceManager::V3::Projects::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 + @projects_stub.universe_domain + end + + ## + # Create a new Projects REST client object. + # + # @example + # + # # Create a client using the default configuration + # client = ::Google::Cloud::ResourceManager::V3::Projects::Rest::Client.new + # + # # Create a client using a custom configuration + # client = ::Google::Cloud::ResourceManager::V3::Projects::Rest::Client.new do |config| + # config.timeout = 10.0 + # end + # + # @yield [config] Configure the Projects client. + # @yieldparam config [Client::Configuration] + # + def initialize + # Create the configuration object + @config = Configuration.new Client.configure + + # Yield the configuration if needed + yield @config if block_given? + + # Create credentials + credentials = @config.credentials + # Use self-signed JWT if the endpoint is unchanged from default, + # but only if the default endpoint does not have a region prefix. + enable_self_signed_jwt = @config.endpoint.nil? || + (@config.endpoint == Configuration::DEFAULT_ENDPOINT && + !@config.endpoint.split(".").first.include?("-")) + credentials ||= Credentials.default scope: @config.scope, + enable_self_signed_jwt: enable_self_signed_jwt + if credentials.is_a?(::String) || credentials.is_a?(::Hash) + credentials = Credentials.new credentials, scope: @config.scope + end + + @quota_project_id = @config.quota_project + @quota_project_id ||= credentials.quota_project_id if credentials.respond_to? :quota_project_id + + @operations_client = ::Google::Cloud::ResourceManager::V3::Projects::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 + + @projects_stub = ::Google::Cloud::ResourceManager::V3::Projects::Rest::ServiceStub.new( + endpoint: @config.endpoint, + endpoint_template: DEFAULT_ENDPOINT_TEMPLATE, + universe_domain: @config.universe_domain, + credentials: credentials, + logger: @config.logger + ) + + @projects_stub.logger(stub: true)&.info do |entry| + entry.set_system_name + entry.set_service + entry.message = "Created client for #{entry.service}" + entry.set_credentials_fields credentials + entry.set "customEndpoint", @config.endpoint if @config.endpoint + entry.set "defaultTimeout", @config.timeout if @config.timeout + entry.set "quotaProject", @quota_project_id if @quota_project_id + end + end + + ## + # Get the associated client for long-running operations. + # + # @return [::Google::Cloud::ResourceManager::V3::Projects::Rest::Operations] + # + attr_reader :operations_client + + ## + # The logger used for request/response debug logging. + # + # @return [Logger] + # + def logger + @projects_stub.logger + end + + # Service calls + + ## + # Retrieves the project identified by the specified `name` (for example, + # `projects/415104041262`). + # + # The caller must have `resourcemanager.projects.get` permission + # for this project. + # + # @overload get_project(request, options = nil) + # Pass arguments to `get_project` via a request object, either of type + # {::Google::Cloud::ResourceManager::V3::GetProjectRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::ResourceManager::V3::GetProjectRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @overload get_project(name: nil) + # Pass arguments to `get_project` via keyword arguments. Note that at + # least one keyword argument is 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 project (for example, `projects/415104041262`). + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Cloud::ResourceManager::V3::Project] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::ResourceManager::V3::Project] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/resource_manager/v3" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::ResourceManager::V3::Projects::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::ResourceManager::V3::GetProjectRequest.new + # + # # Call the get_project method. + # result = client.get_project request + # + # # The returned object is of type Google::Cloud::ResourceManager::V3::Project. + # p result + # + def get_project request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::ResourceManager::V3::GetProjectRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + call_metadata = @config.rpcs.get_project.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::ResourceManager::V3::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + options.apply_defaults timeout: @config.rpcs.get_project.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.get_project.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @projects_stub.get_project request, options do |result, operation| + yield result, operation if block_given? + end + rescue ::Gapic::Rest::Error => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Lists projects that are direct children of the specified folder or + # organization resource. `list()` provides a strongly consistent view of the + # projects underneath the specified parent resource. `list()` returns + # projects sorted based upon the (ascending) lexical ordering of their + # `display_name`. The caller must have `resourcemanager.projects.list` + # permission on the identified parent. + # + # @overload list_projects(request, options = nil) + # Pass arguments to `list_projects` via a request object, either of type + # {::Google::Cloud::ResourceManager::V3::ListProjectsRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::ResourceManager::V3::ListProjectsRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_projects(parent: nil, page_token: nil, page_size: nil, show_deleted: nil) + # Pass arguments to `list_projects` via keyword arguments. Note that at + # least one keyword argument is 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 name of the parent resource whose projects are being listed. + # Only children of this parent resource are listed; descendants are not + # listed. + # + # If the parent is a folder, use the value `folders/{folder_id}`. If the + # parent is an organization, use the value `organizations/{org_id}`. + # @param page_token [::String] + # Optional. A pagination token returned from a previous call to + # [ListProjects] [google.cloud.resourcemanager.v3.Projects.ListProjects] that + # indicates from where listing should continue. + # @param page_size [::Integer] + # Optional. The maximum number of projects to return in the response. + # The server can return fewer projects than requested. + # If unspecified, server picks an appropriate default. + # @param show_deleted [::Boolean] + # Optional. Indicate that projects in the `DELETE_REQUESTED` state should + # also be returned. Normally only `ACTIVE` projects are returned. + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Gapic::Rest::PagedEnumerable<::Google::Cloud::ResourceManager::V3::Project>] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Gapic::Rest::PagedEnumerable<::Google::Cloud::ResourceManager::V3::Project>] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/resource_manager/v3" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::ResourceManager::V3::Projects::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::ResourceManager::V3::ListProjectsRequest.new + # + # # Call the list_projects method. + # result = client.list_projects request + # + # # The returned object is of type Gapic::PagedEnumerable. You can iterate + # # over elements, and API calls will be issued to fetch pages as needed. + # result.each do |item| + # # Each element is of type ::Google::Cloud::ResourceManager::V3::Project. + # p item + # end + # + def list_projects request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::ResourceManager::V3::ListProjectsRequest + + # Converts hash 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_projects.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::ResourceManager::V3::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_projects.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.list_projects.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @projects_stub.list_projects request, options do |result, operation| + result = ::Gapic::Rest::PagedEnumerable.new @projects_stub, :list_projects, "projects", 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 for projects that the caller has both `resourcemanager.projects.get` + # permission on, and also satisfy the specified query. + # + # This method returns projects in an unspecified order. + # + # This method is eventually consistent with project mutations; this means + # that a newly created project may not appear in the results or recent + # updates to an existing project may not be reflected in the results. To + # retrieve the latest state of a project, use the + # {::Google::Cloud::ResourceManager::V3::Projects::Rest::Client#get_project GetProject} method. + # + # @overload search_projects(request, options = nil) + # Pass arguments to `search_projects` via a request object, either of type + # {::Google::Cloud::ResourceManager::V3::SearchProjectsRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::ResourceManager::V3::SearchProjectsRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_projects(query: nil, page_token: nil, page_size: nil) + # Pass arguments to `search_projects` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param query [::String] + # Optional. A query string for searching for projects that the caller has + # `resourcemanager.projects.get` permission to. If multiple fields are + # included in the query, then it will return results that match any of the + # fields. Some eligible fields are: + # + # - **`displayName`, `name`**: Filters by displayName. + # - **`parent`**: Project's parent (for example: `folders/123`, + # `organizations/*`). Prefer `parent` field over `parent.type` and + # `parent.id`. + # - **`parent.type`**: Parent's type: `folder` or `organization`. + # - **`parent.id`**: Parent's id number (for example: `123`). + # - **`id`, `projectId`**: Filters by projectId. + # - **`state`, `lifecycleState`**: Filters by state. + # - **`labels`**: Filters by label name or value. + # - **`labels.` (where `` is the name of a label)**: Filters by label + # name. + # + # Search expressions are case insensitive. + # + # Some examples queries: + # + # + # - **`name:how*`**: The project's name starts with "how". + # - **`name:Howl`**: The project's name is `Howl` or `howl`. + # - **`name:HOWL`**: Equivalent to above. + # - **`NAME:howl`**: Equivalent to above. + # - **`labels.color:*`**: The project has the label `color`. + # - **`labels.color:red`**: The project's label `color` has the value `red`. + # - **`labels.color:red labels.size:big`**: The project's label `color` has + # the value `red` or its label `size` has the value `big`. + # + # If no query is specified, the call will return projects for which the user + # has the `resourcemanager.projects.get` permission. + # @param page_token [::String] + # Optional. A pagination token returned from a previous call to + # [ListProjects] [google.cloud.resourcemanager.v3.Projects.ListProjects] that + # indicates from where listing should continue. + # @param page_size [::Integer] + # Optional. The maximum number of projects to return in the response. + # The server can return fewer projects than requested. + # If unspecified, server picks an appropriate default. + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Gapic::Rest::PagedEnumerable<::Google::Cloud::ResourceManager::V3::Project>] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Gapic::Rest::PagedEnumerable<::Google::Cloud::ResourceManager::V3::Project>] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/resource_manager/v3" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::ResourceManager::V3::Projects::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::ResourceManager::V3::SearchProjectsRequest.new + # + # # Call the search_projects method. + # result = client.search_projects request + # + # # The returned object is of type Gapic::PagedEnumerable. You can iterate + # # over elements, and API calls will be issued to fetch pages as needed. + # result.each do |item| + # # Each element is of type ::Google::Cloud::ResourceManager::V3::Project. + # p item + # end + # + def search_projects request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::ResourceManager::V3::SearchProjectsRequest + + # Converts hash 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_projects.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::ResourceManager::V3::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_projects.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.search_projects.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @projects_stub.search_projects request, options do |result, operation| + result = ::Gapic::Rest::PagedEnumerable.new @projects_stub, :search_projects, "projects", 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 + + ## + # Request that a new project be created. The result is an `Operation` which + # can be used to track the creation process. This process usually takes a few + # seconds, but can sometimes take much longer. The tracking `Operation` is + # automatically deleted after a few hours, so there is no need to call + # `DeleteOperation`. + # + # @overload create_project(request, options = nil) + # Pass arguments to `create_project` via a request object, either of type + # {::Google::Cloud::ResourceManager::V3::CreateProjectRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::ResourceManager::V3::CreateProjectRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_project(project: nil) + # Pass arguments to `create_project` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param project [::Google::Cloud::ResourceManager::V3::Project, ::Hash] + # Required. The Project to create. + # + # Project ID is required. If the requested ID is unavailable, the request + # fails. + # + # If the `parent` field is set, the `resourcemanager.projects.create` + # permission is checked on the parent resource. If no parent is set and + # the authorization credentials belong to an Organization, the parent + # will be set to that Organization. + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Gapic::Operation] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Gapic::Operation] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/resource_manager/v3" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::ResourceManager::V3::Projects::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::ResourceManager::V3::CreateProjectRequest.new + # + # # Call the create_project method. + # result = client.create_project 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_project request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::ResourceManager::V3::CreateProjectRequest + + # Converts hash 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_project.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::ResourceManager::V3::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_project.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.create_project.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @projects_stub.create_project 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 + + ## + # Updates the `display_name` and labels of the project identified by the + # specified `name` (for example, `projects/415104041262`). Deleting all + # labels requires an update mask for labels field. + # + # The caller must have `resourcemanager.projects.update` permission for this + # project. + # + # @overload update_project(request, options = nil) + # Pass arguments to `update_project` via a request object, either of type + # {::Google::Cloud::ResourceManager::V3::UpdateProjectRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::ResourceManager::V3::UpdateProjectRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @overload update_project(project: nil, update_mask: nil) + # Pass arguments to `update_project` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param project [::Google::Cloud::ResourceManager::V3::Project, ::Hash] + # Required. The new definition of the project. + # @param update_mask [::Google::Protobuf::FieldMask, ::Hash] + # Optional. An update mask to selectively update fields. + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Gapic::Operation] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Gapic::Operation] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/resource_manager/v3" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::ResourceManager::V3::Projects::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::ResourceManager::V3::UpdateProjectRequest.new + # + # # Call the update_project method. + # result = client.update_project 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_project request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::ResourceManager::V3::UpdateProjectRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + call_metadata = @config.rpcs.update_project.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::ResourceManager::V3::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + options.apply_defaults timeout: @config.rpcs.update_project.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.update_project.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @projects_stub.update_project 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 + + ## + # Move a project to another place in your resource hierarchy, under a new + # resource parent. + # + # Returns an operation which can be used to track the process of the project + # move workflow. + # Upon success, the `Operation.response` field will be populated with the + # moved project. + # + # The caller must have `resourcemanager.projects.move` permission on the + # project, on the project's current and proposed new parent. + # + # If project has no current parent, or it currently does not have an + # associated organization resource, you will also need the + # `resourcemanager.projects.setIamPolicy` permission in the project. + # + # @overload move_project(request, options = nil) + # Pass arguments to `move_project` via a request object, either of type + # {::Google::Cloud::ResourceManager::V3::MoveProjectRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::ResourceManager::V3::MoveProjectRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @overload move_project(name: nil, destination_parent: nil) + # Pass arguments to `move_project` via keyword arguments. Note that at + # least one keyword argument is 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 project to move. + # @param destination_parent [::String] + # Required. The new parent to move the Project under. + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Gapic::Operation] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Gapic::Operation] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/resource_manager/v3" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::ResourceManager::V3::Projects::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::ResourceManager::V3::MoveProjectRequest.new + # + # # Call the move_project method. + # result = client.move_project 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 move_project request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::ResourceManager::V3::MoveProjectRequest + + # Converts hash 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.move_project.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::ResourceManager::V3::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.move_project.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.move_project.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @projects_stub.move_project 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 + + ## + # Marks the project identified by the specified + # `name` (for example, `projects/415104041262`) for deletion. + # + # This method will only affect the project if it has a lifecycle state of + # {::Google::Cloud::ResourceManager::V3::Project::State::ACTIVE ACTIVE}. + # + # This method changes the Project's lifecycle state from + # {::Google::Cloud::ResourceManager::V3::Project::State::ACTIVE ACTIVE} + # to + # {::Google::Cloud::ResourceManager::V3::Project::State::DELETE_REQUESTED DELETE_REQUESTED}. + # The deletion starts at an unspecified time, + # at which point the Project is no longer accessible. + # + # Until the deletion completes, you can check the lifecycle state + # checked by retrieving the project with [GetProject] + # [google.cloud.resourcemanager.v3.Projects.GetProject], + # and the project remains visible to [ListProjects] + # [google.cloud.resourcemanager.v3.Projects.ListProjects]. + # However, you cannot update the project. + # + # After the deletion completes, the project is not retrievable by + # the [GetProject] + # [google.cloud.resourcemanager.v3.Projects.GetProject], + # [ListProjects] + # [google.cloud.resourcemanager.v3.Projects.ListProjects], and + # {::Google::Cloud::ResourceManager::V3::Projects::Rest::Client#search_projects SearchProjects} + # methods. + # + # This method behaves idempotently, such that deleting a `DELETE_REQUESTED` + # project will not cause an error, but also won't do anything. + # + # The caller must have `resourcemanager.projects.delete` permissions for this + # project. + # + # @overload delete_project(request, options = nil) + # Pass arguments to `delete_project` via a request object, either of type + # {::Google::Cloud::ResourceManager::V3::DeleteProjectRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::ResourceManager::V3::DeleteProjectRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_project(name: nil) + # Pass arguments to `delete_project` via keyword arguments. Note that at + # least one keyword argument is 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 Project (for example, `projects/415104041262`). + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Gapic::Operation] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Gapic::Operation] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/resource_manager/v3" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::ResourceManager::V3::Projects::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::ResourceManager::V3::DeleteProjectRequest.new + # + # # Call the delete_project method. + # result = client.delete_project 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_project request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::ResourceManager::V3::DeleteProjectRequest + + # Converts hash 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_project.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::ResourceManager::V3::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_project.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.delete_project.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @projects_stub.delete_project 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 + + ## + # Restores the project identified by the specified + # `name` (for example, `projects/415104041262`). + # You can only use this method for a project that has a lifecycle state of + # [DELETE_REQUESTED] + # [Projects.State.DELETE_REQUESTED]. + # After deletion starts, the project cannot be restored. + # + # The caller must have `resourcemanager.projects.undelete` permission for + # this project. + # + # @overload undelete_project(request, options = nil) + # Pass arguments to `undelete_project` via a request object, either of type + # {::Google::Cloud::ResourceManager::V3::UndeleteProjectRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::ResourceManager::V3::UndeleteProjectRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @overload undelete_project(name: nil) + # Pass arguments to `undelete_project` via keyword arguments. Note that at + # least one keyword argument is 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 project (for example, `projects/415104041262`). + # + # Required. + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Gapic::Operation] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Gapic::Operation] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/resource_manager/v3" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::ResourceManager::V3::Projects::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::ResourceManager::V3::UndeleteProjectRequest.new + # + # # Call the undelete_project method. + # result = client.undelete_project 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 undelete_project request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::ResourceManager::V3::UndeleteProjectRequest + + # Converts hash 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.undelete_project.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::ResourceManager::V3::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.undelete_project.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.undelete_project.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @projects_stub.undelete_project 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 + + ## + # Returns the IAM access control policy for the specified project, in the + # format `projects/{ProjectIdOrNumber}` e.g. projects/123. + # Permission is denied if the policy or the resource do not exist. + # + # @overload get_iam_policy(request, options = nil) + # Pass arguments to `get_iam_policy` via a request object, either of type + # {::Google::Iam::V1::GetIamPolicyRequest} or an equivalent Hash. + # + # @param request [::Google::Iam::V1::GetIamPolicyRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @overload get_iam_policy(resource: nil, options: nil) + # Pass arguments to `get_iam_policy` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param resource [::String] + # REQUIRED: The resource for which the policy is being requested. + # See the operation documentation for the appropriate value for this field. + # @param options [::Google::Iam::V1::GetPolicyOptions, ::Hash] + # OPTIONAL: A `GetPolicyOptions` object for specifying options to + # `GetIamPolicy`. + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Iam::V1::Policy] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Iam::V1::Policy] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/resource_manager/v3" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::ResourceManager::V3::Projects::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Iam::V1::GetIamPolicyRequest.new + # + # # Call the get_iam_policy method. + # result = client.get_iam_policy request + # + # # The returned object is of type Google::Iam::V1::Policy. + # p result + # + def get_iam_policy request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Iam::V1::GetIamPolicyRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + call_metadata = @config.rpcs.get_iam_policy.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::ResourceManager::V3::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + options.apply_defaults timeout: @config.rpcs.get_iam_policy.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.get_iam_policy.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @projects_stub.get_iam_policy request, options do |result, operation| + yield result, operation if block_given? + end + rescue ::Gapic::Rest::Error => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Sets the IAM access control policy for the specified project, in the + # format `projects/{ProjectIdOrNumber}` e.g. projects/123. + # + # CAUTION: This method will replace the existing policy, and cannot be used + # to append additional IAM settings. + # + # Note: Removing service accounts from policies or changing their roles can + # render services completely inoperable. It is important to understand how + # the service account is being used before removing or updating its roles. + # + # The following constraints apply when using `setIamPolicy()`: + # + # + Project does not support `allUsers` and `allAuthenticatedUsers` as + # `members` in a `Binding` of a `Policy`. + # + # + The owner role can be granted to a `user`, `serviceAccount`, or a group + # that is part of an organization. For example, + # group@myownpersonaldomain.com could be added as an owner to a project in + # the myownpersonaldomain.com organization, but not the examplepetstore.com + # organization. + # + # + Service accounts can be made owners of a project directly + # without any restrictions. However, to be added as an owner, a user must be + # invited using the Cloud Platform console and must accept the invitation. + # + # + A user cannot be granted the owner role using `setIamPolicy()`. The user + # must be granted the owner role using the Cloud Platform Console and must + # explicitly accept the invitation. + # + # + Invitations to grant the owner role cannot be sent using + # `setIamPolicy()`; + # they must be sent only using the Cloud Platform Console. + # + # + If the project is not part of an organization, there must be at least + # one owner who has accepted the Terms of Service (ToS) agreement in the + # policy. Calling `setIamPolicy()` to remove the last ToS-accepted owner + # from the policy will fail. This restriction also applies to legacy + # projects that no longer have owners who have accepted the ToS. Edits to + # IAM policies will be rejected until the lack of a ToS-accepting owner is + # rectified. If the project is part of an organization, you can remove all + # owners, potentially making the organization inaccessible. + # + # @overload set_iam_policy(request, options = nil) + # Pass arguments to `set_iam_policy` via a request object, either of type + # {::Google::Iam::V1::SetIamPolicyRequest} or an equivalent Hash. + # + # @param request [::Google::Iam::V1::SetIamPolicyRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @overload set_iam_policy(resource: nil, policy: nil, update_mask: nil) + # Pass arguments to `set_iam_policy` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param resource [::String] + # REQUIRED: The resource for which the policy is being specified. + # See the operation documentation for the appropriate value for this field. + # @param policy [::Google::Iam::V1::Policy, ::Hash] + # REQUIRED: The complete policy to be applied to the `resource`. The size of + # the policy is limited to a few 10s of KB. An empty policy is a + # valid policy but certain Cloud Platform services (such as Projects) + # might reject them. + # @param update_mask [::Google::Protobuf::FieldMask, ::Hash] + # OPTIONAL: A FieldMask specifying which fields of the policy to modify. Only + # the fields in the mask will be modified. If no mask is provided, the + # following default mask is used: + # + # `paths: "bindings, etag"` + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Iam::V1::Policy] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Iam::V1::Policy] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/resource_manager/v3" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::ResourceManager::V3::Projects::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Iam::V1::SetIamPolicyRequest.new + # + # # Call the set_iam_policy method. + # result = client.set_iam_policy request + # + # # The returned object is of type Google::Iam::V1::Policy. + # p result + # + def set_iam_policy request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Iam::V1::SetIamPolicyRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + call_metadata = @config.rpcs.set_iam_policy.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::ResourceManager::V3::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + options.apply_defaults timeout: @config.rpcs.set_iam_policy.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.set_iam_policy.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @projects_stub.set_iam_policy request, options do |result, operation| + yield result, operation if block_given? + end + rescue ::Gapic::Rest::Error => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Returns permissions that a caller has on the specified project, in the + # format `projects/{ProjectIdOrNumber}` e.g. projects/123.. + # + # @overload test_iam_permissions(request, options = nil) + # Pass arguments to `test_iam_permissions` via a request object, either of type + # {::Google::Iam::V1::TestIamPermissionsRequest} or an equivalent Hash. + # + # @param request [::Google::Iam::V1::TestIamPermissionsRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @overload test_iam_permissions(resource: nil, permissions: nil) + # Pass arguments to `test_iam_permissions` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param resource [::String] + # REQUIRED: The resource for which the policy detail is being requested. + # See the operation documentation for the appropriate value for this field. + # @param permissions [::Array<::String>] + # The set of permissions to check for the `resource`. Permissions with + # wildcards (such as '*' or 'storage.*') are not allowed. For more + # information see + # [IAM Overview](https://cloud.google.com/iam/docs/overview#permissions). + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Iam::V1::TestIamPermissionsResponse] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Iam::V1::TestIamPermissionsResponse] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/resource_manager/v3" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::ResourceManager::V3::Projects::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Iam::V1::TestIamPermissionsRequest.new + # + # # Call the test_iam_permissions method. + # result = client.test_iam_permissions request + # + # # The returned object is of type Google::Iam::V1::TestIamPermissionsResponse. + # p result + # + def test_iam_permissions request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Iam::V1::TestIamPermissionsRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + call_metadata = @config.rpcs.test_iam_permissions.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::ResourceManager::V3::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + options.apply_defaults timeout: @config.rpcs.test_iam_permissions.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.test_iam_permissions.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @projects_stub.test_iam_permissions request, options do |result, operation| + yield result, operation if block_given? + end + rescue ::Gapic::Rest::Error => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Configuration class for the Projects REST API. + # + # This class represents the configuration for Projects REST, + # providing control over timeouts, retry behavior, logging, transport + # parameters, and other low-level controls. Certain parameters can also be + # applied individually to specific RPCs. See + # {::Google::Cloud::ResourceManager::V3::Projects::Rest::Client::Configuration::Rpcs} + # for a list of RPCs that can be configured independently. + # + # Configuration can be applied globally to all clients, or to a single client + # on construction. + # + # @example + # + # # Modify the global config, setting the timeout for + # # get_project to 20 seconds, + # # and all remaining timeouts to 10 seconds. + # ::Google::Cloud::ResourceManager::V3::Projects::Rest::Client.configure do |config| + # config.timeout = 10.0 + # config.rpcs.get_project.timeout = 20.0 + # end + # + # # Apply the above configuration only to a new client. + # client = ::Google::Cloud::ResourceManager::V3::Projects::Rest::Client.new do |config| + # config.timeout = 10.0 + # config.rpcs.get_project.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 = "cloudresourcemanager.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 Projects API. + # + # Includes fields providing the configuration for each RPC in this service. + # Each configuration object is of type `Gapic::Config::Method` and includes + # the following configuration fields: + # + # * `timeout` (*type:* `Numeric`) - The call timeout in seconds + # * `metadata` (*type:* `Hash{Symbol=>String}`) - Additional headers + # * `retry_policy (*type:* `Hash`) - The retry policy. The policy fields + # include the following keys: + # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds. + # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds. + # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier. + # * `:retry_codes` (*type:* `Array`) - The error codes that should + # trigger a retry. + # + class Rpcs + ## + # RPC-specific configuration for `get_project` + # @return [::Gapic::Config::Method] + # + attr_reader :get_project + ## + # RPC-specific configuration for `list_projects` + # @return [::Gapic::Config::Method] + # + attr_reader :list_projects + ## + # RPC-specific configuration for `search_projects` + # @return [::Gapic::Config::Method] + # + attr_reader :search_projects + ## + # RPC-specific configuration for `create_project` + # @return [::Gapic::Config::Method] + # + attr_reader :create_project + ## + # RPC-specific configuration for `update_project` + # @return [::Gapic::Config::Method] + # + attr_reader :update_project + ## + # RPC-specific configuration for `move_project` + # @return [::Gapic::Config::Method] + # + attr_reader :move_project + ## + # RPC-specific configuration for `delete_project` + # @return [::Gapic::Config::Method] + # + attr_reader :delete_project + ## + # RPC-specific configuration for `undelete_project` + # @return [::Gapic::Config::Method] + # + attr_reader :undelete_project + ## + # RPC-specific configuration for `get_iam_policy` + # @return [::Gapic::Config::Method] + # + attr_reader :get_iam_policy + ## + # RPC-specific configuration for `set_iam_policy` + # @return [::Gapic::Config::Method] + # + attr_reader :set_iam_policy + ## + # RPC-specific configuration for `test_iam_permissions` + # @return [::Gapic::Config::Method] + # + attr_reader :test_iam_permissions + + # @private + def initialize parent_rpcs = nil + get_project_config = parent_rpcs.get_project if parent_rpcs.respond_to? :get_project + @get_project = ::Gapic::Config::Method.new get_project_config + list_projects_config = parent_rpcs.list_projects if parent_rpcs.respond_to? :list_projects + @list_projects = ::Gapic::Config::Method.new list_projects_config + search_projects_config = parent_rpcs.search_projects if parent_rpcs.respond_to? :search_projects + @search_projects = ::Gapic::Config::Method.new search_projects_config + create_project_config = parent_rpcs.create_project if parent_rpcs.respond_to? :create_project + @create_project = ::Gapic::Config::Method.new create_project_config + update_project_config = parent_rpcs.update_project if parent_rpcs.respond_to? :update_project + @update_project = ::Gapic::Config::Method.new update_project_config + move_project_config = parent_rpcs.move_project if parent_rpcs.respond_to? :move_project + @move_project = ::Gapic::Config::Method.new move_project_config + delete_project_config = parent_rpcs.delete_project if parent_rpcs.respond_to? :delete_project + @delete_project = ::Gapic::Config::Method.new delete_project_config + undelete_project_config = parent_rpcs.undelete_project if parent_rpcs.respond_to? :undelete_project + @undelete_project = ::Gapic::Config::Method.new undelete_project_config + get_iam_policy_config = parent_rpcs.get_iam_policy if parent_rpcs.respond_to? :get_iam_policy + @get_iam_policy = ::Gapic::Config::Method.new get_iam_policy_config + set_iam_policy_config = parent_rpcs.set_iam_policy if parent_rpcs.respond_to? :set_iam_policy + @set_iam_policy = ::Gapic::Config::Method.new set_iam_policy_config + test_iam_permissions_config = parent_rpcs.test_iam_permissions if parent_rpcs.respond_to? :test_iam_permissions + @test_iam_permissions = ::Gapic::Config::Method.new test_iam_permissions_config + + yield self if block_given? + end + end + end + end + end + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-resource_manager-v3/lib/google/cloud/resource_manager/v3/projects/rest/operations.rb b/owl-bot-staging/google-cloud-resource_manager-v3/lib/google/cloud/resource_manager/v3/projects/rest/operations.rb new file mode 100644 index 000000000000..ffba45494a07 --- /dev/null +++ b/owl-bot-staging/google-cloud-resource_manager-v3/lib/google/cloud/resource_manager/v3/projects/rest/operations.rb @@ -0,0 +1,925 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +require "gapic/operation" + +module Google + module Cloud + module ResourceManager + module V3 + module Projects + module Rest + # Service that implements Longrunning Operations API. + class Operations + # @private + API_VERSION = "" + + # @private + DEFAULT_ENDPOINT_TEMPLATE = "cloudresourcemanager.$UNIVERSE_DOMAIN$" + + # @private + attr_reader :operations_stub + + ## + # Configuration for the Projects 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 Projects 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::ResourceManager::V3::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::ResourceManager::V3::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::ResourceManager::V3::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::ResourceManager::V3::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 = "cloudresourcemanager.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: "/v3/{name}", + matches: [ + ["name", %r{^operations(?:/.*)?$}, true] + ] + ) + 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 +end diff --git a/owl-bot-staging/google-cloud-resource_manager-v3/lib/google/cloud/resource_manager/v3/projects/rest/service_stub.rb b/owl-bot-staging/google-cloud-resource_manager-v3/lib/google/cloud/resource_manager/v3/projects/rest/service_stub.rb new file mode 100644 index 000000000000..7a244012d0ff --- /dev/null +++ b/owl-bot-staging/google-cloud-resource_manager-v3/lib/google/cloud/resource_manager/v3/projects/rest/service_stub.rb @@ -0,0 +1,753 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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/resourcemanager/v3/projects_pb" + +module Google + module Cloud + module ResourceManager + module V3 + module Projects + module Rest + ## + # REST service stub for the Projects service. + # Service stub contains baseline method implementations + # including transcoding, making the REST call, and deserialing the response. + # + class ServiceStub + # @private + def initialize endpoint:, endpoint_template:, universe_domain:, credentials:, logger: + # These require statements are intentionally placed here to initialize + # the REST modules only when it's required. + require "gapic/rest" + + @client_stub = ::Gapic::Rest::ClientStub.new endpoint: endpoint, + endpoint_template: endpoint_template, + universe_domain: universe_domain, + credentials: credentials, + numeric_enums: true, + service_name: self.class, + raise_faraday_errors: false, + logger: logger + end + + ## + # The effective universe domain + # + # @return [String] + # + def universe_domain + @client_stub.universe_domain + end + + ## + # The effective endpoint + # + # @return [String] + # + def endpoint + @client_stub.endpoint + end + + ## + # The logger used for request/response debug logging. + # + # @return [Logger] + # + def logger stub: false + stub ? @client_stub.stub_logger : @client_stub.logger + end + + ## + # Baseline implementation for the get_project REST call + # + # @param request_pb [::Google::Cloud::ResourceManager::V3::GetProjectRequest] + # A request object representing the call parameters. Required. + # @param options [::Gapic::CallOptions] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Cloud::ResourceManager::V3::Project] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::ResourceManager::V3::Project] + # A result object deserialized from the server's reply + def get_project request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_get_project_request request_pb + query_string_params = if query_string_params.any? + query_string_params.to_h { |p| p.split "=", 2 } + else + {} + end + + response = @client_stub.make_http_request( + verb, + uri: uri, + body: body || "", + params: query_string_params, + method_name: "get_project", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Cloud::ResourceManager::V3::Project.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_projects REST call + # + # @param request_pb [::Google::Cloud::ResourceManager::V3::ListProjectsRequest] + # A request object representing the call parameters. Required. + # @param options [::Gapic::CallOptions] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Cloud::ResourceManager::V3::ListProjectsResponse] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::ResourceManager::V3::ListProjectsResponse] + # A result object deserialized from the server's reply + def list_projects request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_list_projects_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_projects", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Cloud::ResourceManager::V3::ListProjectsResponse.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_projects REST call + # + # @param request_pb [::Google::Cloud::ResourceManager::V3::SearchProjectsRequest] + # A request object representing the call parameters. Required. + # @param options [::Gapic::CallOptions] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Cloud::ResourceManager::V3::SearchProjectsResponse] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::ResourceManager::V3::SearchProjectsResponse] + # A result object deserialized from the server's reply + def search_projects request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_search_projects_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_projects", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Cloud::ResourceManager::V3::SearchProjectsResponse.decode_json response.body, ignore_unknown_fields: true + catch :response do + yield result, operation if block_given? + result + end + end + + ## + # Baseline implementation for the create_project REST call + # + # @param request_pb [::Google::Cloud::ResourceManager::V3::CreateProjectRequest] + # 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_project request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_create_project_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_project", + 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 update_project REST call + # + # @param request_pb [::Google::Cloud::ResourceManager::V3::UpdateProjectRequest] + # 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_project request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_update_project_request request_pb + query_string_params = if query_string_params.any? + query_string_params.to_h { |p| p.split "=", 2 } + else + {} + end + + response = @client_stub.make_http_request( + verb, + uri: uri, + body: body || "", + params: query_string_params, + method_name: "update_project", + 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 move_project REST call + # + # @param request_pb [::Google::Cloud::ResourceManager::V3::MoveProjectRequest] + # 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 move_project request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_move_project_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: "move_project", + 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_project REST call + # + # @param request_pb [::Google::Cloud::ResourceManager::V3::DeleteProjectRequest] + # 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_project request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_delete_project_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_project", + 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 undelete_project REST call + # + # @param request_pb [::Google::Cloud::ResourceManager::V3::UndeleteProjectRequest] + # 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 undelete_project request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_undelete_project_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: "undelete_project", + 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_iam_policy REST call + # + # @param request_pb [::Google::Iam::V1::GetIamPolicyRequest] + # A request object representing the call parameters. Required. + # @param options [::Gapic::CallOptions] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Iam::V1::Policy] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Iam::V1::Policy] + # A result object deserialized from the server's reply + def get_iam_policy request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_get_iam_policy_request request_pb + query_string_params = if query_string_params.any? + query_string_params.to_h { |p| p.split "=", 2 } + else + {} + end + + response = @client_stub.make_http_request( + verb, + uri: uri, + body: body || "", + params: query_string_params, + method_name: "get_iam_policy", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Iam::V1::Policy.decode_json response.body, ignore_unknown_fields: true + catch :response do + yield result, operation if block_given? + result + end + end + + ## + # Baseline implementation for the set_iam_policy REST call + # + # @param request_pb [::Google::Iam::V1::SetIamPolicyRequest] + # A request object representing the call parameters. Required. + # @param options [::Gapic::CallOptions] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Iam::V1::Policy] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Iam::V1::Policy] + # A result object deserialized from the server's reply + def set_iam_policy request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_set_iam_policy_request request_pb + query_string_params = if query_string_params.any? + query_string_params.to_h { |p| p.split "=", 2 } + else + {} + end + + response = @client_stub.make_http_request( + verb, + uri: uri, + body: body || "", + params: query_string_params, + method_name: "set_iam_policy", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Iam::V1::Policy.decode_json response.body, ignore_unknown_fields: true + catch :response do + yield result, operation if block_given? + result + end + end + + ## + # Baseline implementation for the test_iam_permissions REST call + # + # @param request_pb [::Google::Iam::V1::TestIamPermissionsRequest] + # A request object representing the call parameters. Required. + # @param options [::Gapic::CallOptions] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Iam::V1::TestIamPermissionsResponse] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Iam::V1::TestIamPermissionsResponse] + # A result object deserialized from the server's reply + def test_iam_permissions request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_test_iam_permissions_request request_pb + query_string_params = if query_string_params.any? + query_string_params.to_h { |p| p.split "=", 2 } + else + {} + end + + response = @client_stub.make_http_request( + verb, + uri: uri, + body: body || "", + params: query_string_params, + method_name: "test_iam_permissions", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Iam::V1::TestIamPermissionsResponse.decode_json response.body, ignore_unknown_fields: true + catch :response do + yield result, operation if block_given? + result + end + end + + ## + # @private + # + # GRPC transcoding helper method for the get_project REST call + # + # @param request_pb [::Google::Cloud::ResourceManager::V3::GetProjectRequest] + # A request object representing the call parameters. Required. + # @return [Array(String, [String, nil], Hash{String => String})] + # Uri, Body, Query string parameters + def self.transcode_get_project_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :get, + uri_template: "/v3/{name}", + matches: [ + ["name", %r{^projects/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the list_projects REST call + # + # @param request_pb [::Google::Cloud::ResourceManager::V3::ListProjectsRequest] + # 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_projects_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :get, + uri_template: "/v3/projects", + matches: [] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the search_projects REST call + # + # @param request_pb [::Google::Cloud::ResourceManager::V3::SearchProjectsRequest] + # 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_projects_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :get, + uri_template: "/v3/projects:search", + matches: [] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the create_project REST call + # + # @param request_pb [::Google::Cloud::ResourceManager::V3::CreateProjectRequest] + # 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_project_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :post, + uri_template: "/v3/projects", + body: "project", + matches: [] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the update_project REST call + # + # @param request_pb [::Google::Cloud::ResourceManager::V3::UpdateProjectRequest] + # A request object representing the call parameters. Required. + # @return [Array(String, [String, nil], Hash{String => String})] + # Uri, Body, Query string parameters + def self.transcode_update_project_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :patch, + uri_template: "/v3/{project.name}", + body: "project", + matches: [ + ["project.name", %r{^projects/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the move_project REST call + # + # @param request_pb [::Google::Cloud::ResourceManager::V3::MoveProjectRequest] + # A request object representing the call parameters. Required. + # @return [Array(String, [String, nil], Hash{String => String})] + # Uri, Body, Query string parameters + def self.transcode_move_project_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :post, + uri_template: "/v3/{name}:move", + body: "*", + matches: [ + ["name", %r{^projects/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the delete_project REST call + # + # @param request_pb [::Google::Cloud::ResourceManager::V3::DeleteProjectRequest] + # 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_project_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :delete, + uri_template: "/v3/{name}", + matches: [ + ["name", %r{^projects/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the undelete_project REST call + # + # @param request_pb [::Google::Cloud::ResourceManager::V3::UndeleteProjectRequest] + # A request object representing the call parameters. Required. + # @return [Array(String, [String, nil], Hash{String => String})] + # Uri, Body, Query string parameters + def self.transcode_undelete_project_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :post, + uri_template: "/v3/{name}:undelete", + body: "*", + matches: [ + ["name", %r{^projects/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the get_iam_policy REST call + # + # @param request_pb [::Google::Iam::V1::GetIamPolicyRequest] + # A request object representing the call parameters. Required. + # @return [Array(String, [String, nil], Hash{String => String})] + # Uri, Body, Query string parameters + def self.transcode_get_iam_policy_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :post, + uri_template: "/v3/{resource}:getIamPolicy", + body: "*", + matches: [ + ["resource", %r{^projects/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the set_iam_policy REST call + # + # @param request_pb [::Google::Iam::V1::SetIamPolicyRequest] + # A request object representing the call parameters. Required. + # @return [Array(String, [String, nil], Hash{String => String})] + # Uri, Body, Query string parameters + def self.transcode_set_iam_policy_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :post, + uri_template: "/v3/{resource}:setIamPolicy", + body: "*", + matches: [ + ["resource", %r{^projects/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the test_iam_permissions REST call + # + # @param request_pb [::Google::Iam::V1::TestIamPermissionsRequest] + # A request object representing the call parameters. Required. + # @return [Array(String, [String, nil], Hash{String => String})] + # Uri, Body, Query string parameters + def self.transcode_test_iam_permissions_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :post, + uri_template: "/v3/{resource}:testIamPermissions", + body: "*", + matches: [ + ["resource", %r{^projects/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + end + end + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-resource_manager-v3/lib/google/cloud/resource_manager/v3/rest.rb b/owl-bot-staging/google-cloud-resource_manager-v3/lib/google/cloud/resource_manager/v3/rest.rb new file mode 100644 index 000000000000..e260723626e9 --- /dev/null +++ b/owl-bot-staging/google-cloud-resource_manager-v3/lib/google/cloud/resource_manager/v3/rest.rb @@ -0,0 +1,43 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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/resource_manager/v3/folders/rest" +require "google/cloud/resource_manager/v3/organizations/rest" +require "google/cloud/resource_manager/v3/projects/rest" +require "google/cloud/resource_manager/v3/tag_bindings/rest" +require "google/cloud/resource_manager/v3/tag_holds/rest" +require "google/cloud/resource_manager/v3/tag_keys/rest" +require "google/cloud/resource_manager/v3/tag_values/rest" +require "google/cloud/resource_manager/v3/version" + +module Google + module Cloud + module ResourceManager + ## + # To load just the REST part of this package, including all its services, and instantiate a REST client: + # + # @example + # + # require "google/cloud/resource_manager/v3/rest" + # client = ::Google::Cloud::ResourceManager::V3::Folders::Rest::Client.new + # + module V3 + end + end + end +end diff --git a/owl-bot-staging/google-cloud-resource_manager-v3/lib/google/cloud/resource_manager/v3/tag_bindings.rb b/owl-bot-staging/google-cloud-resource_manager-v3/lib/google/cloud/resource_manager/v3/tag_bindings.rb new file mode 100644 index 000000000000..a5209f7ec2d8 --- /dev/null +++ b/owl-bot-staging/google-cloud-resource_manager-v3/lib/google/cloud/resource_manager/v3/tag_bindings.rb @@ -0,0 +1,57 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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/resource_manager/v3/version" + +require "google/cloud/resource_manager/v3/tag_bindings/credentials" +require "google/cloud/resource_manager/v3/tag_bindings/paths" +require "google/cloud/resource_manager/v3/tag_bindings/operations" +require "google/cloud/resource_manager/v3/tag_bindings/client" +require "google/cloud/resource_manager/v3/tag_bindings/rest" + +module Google + module Cloud + module ResourceManager + module V3 + ## + # Allow users to create and manage TagBindings between TagValues and + # different Google Cloud resources throughout the GCP resource hierarchy. + # + # @example Load this service and instantiate a gRPC client + # + # require "google/cloud/resource_manager/v3/tag_bindings" + # client = ::Google::Cloud::ResourceManager::V3::TagBindings::Client.new + # + # @example Load this service and instantiate a REST client + # + # require "google/cloud/resource_manager/v3/tag_bindings/rest" + # client = ::Google::Cloud::ResourceManager::V3::TagBindings::Rest::Client.new + # + module TagBindings + end + end + end + end +end + +helper_path = ::File.join __dir__, "tag_bindings", "helpers.rb" +require "google/cloud/resource_manager/v3/tag_bindings/helpers" if ::File.file? helper_path diff --git a/owl-bot-staging/google-cloud-resource_manager-v3/lib/google/cloud/resource_manager/v3/tag_bindings/client.rb b/owl-bot-staging/google-cloud-resource_manager-v3/lib/google/cloud/resource_manager/v3/tag_bindings/client.rb new file mode 100644 index 000000000000..ae5223c50ad7 --- /dev/null +++ b/owl-bot-staging/google-cloud-resource_manager-v3/lib/google/cloud/resource_manager/v3/tag_bindings/client.rb @@ -0,0 +1,808 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +require "google/cloud/errors" +require "google/cloud/resourcemanager/v3/tag_bindings_pb" + +module Google + module Cloud + module ResourceManager + module V3 + module TagBindings + ## + # Client for the TagBindings service. + # + # Allow users to create and manage TagBindings between TagValues and + # different Google Cloud resources throughout the GCP resource hierarchy. + # + class Client + # @private + API_VERSION = "" + + # @private + DEFAULT_ENDPOINT_TEMPLATE = "cloudresourcemanager.$UNIVERSE_DOMAIN$" + + include Paths + + # @private + attr_reader :tag_bindings_stub + + ## + # Configure the TagBindings Client class. + # + # See {::Google::Cloud::ResourceManager::V3::TagBindings::Client::Configuration} + # for a description of the configuration fields. + # + # @example + # + # # Modify the configuration for all TagBindings clients + # ::Google::Cloud::ResourceManager::V3::TagBindings::Client.configure do |config| + # config.timeout = 10.0 + # end + # + # @yield [config] Configure the Client client. + # @yieldparam config [Client::Configuration] + # + # @return [Client::Configuration] + # + def self.configure + @configure ||= begin + namespace = ["Google", "Cloud", "ResourceManager", "V3"] + parent_config = while namespace.any? + parent_name = namespace.join "::" + parent_const = const_get parent_name + break parent_const.configure if parent_const.respond_to? :configure + namespace.pop + end + default_config = Client::Configuration.new parent_config + + default_config.rpcs.list_tag_bindings.timeout = 60.0 + default_config.rpcs.list_tag_bindings.retry_policy = { + initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [14] + } + + default_config.rpcs.create_tag_binding.timeout = 60.0 + + default_config.rpcs.delete_tag_binding.timeout = 60.0 + + default_config + end + yield @configure if block_given? + @configure + end + + ## + # Configure the TagBindings Client instance. + # + # The configuration is set to the derived mode, meaning that values can be changed, + # but structural changes (adding new fields, etc.) are not allowed. Structural changes + # should be made on {Client.configure}. + # + # See {::Google::Cloud::ResourceManager::V3::TagBindings::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 + @tag_bindings_stub.universe_domain + end + + ## + # Create a new TagBindings client object. + # + # @example + # + # # Create a client using the default configuration + # client = ::Google::Cloud::ResourceManager::V3::TagBindings::Client.new + # + # # Create a client using a custom configuration + # client = ::Google::Cloud::ResourceManager::V3::TagBindings::Client.new do |config| + # config.timeout = 10.0 + # end + # + # @yield [config] Configure the TagBindings client. + # @yieldparam config [Client::Configuration] + # + def initialize + # These require statements are intentionally placed here to initialize + # the gRPC module only when it's required. + # See https://github.com/googleapis/toolkit/issues/446 + require "gapic/grpc" + require "google/cloud/resourcemanager/v3/tag_bindings_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 + + @tag_bindings_stub = ::Gapic::ServiceStub.new( + ::Google::Cloud::ResourceManager::V3::TagBindings::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 + ) + + @tag_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 + end + + ## + # Get the associated client for long-running operations. + # + # @return [::Google::Cloud::ResourceManager::V3::TagBindings::Operations] + # + attr_reader :operations_client + + ## + # The logger used for request/response debug logging. + # + # @return [Logger] + # + def logger + @tag_bindings_stub.logger + end + + # Service calls + + ## + # Lists the TagBindings for the given Google Cloud resource, as specified + # with `parent`. + # + # NOTE: The `parent` field is expected to be a full resource name: + # https://cloud.google.com/apis/design/resource_names#full_resource_name + # + # @overload list_tag_bindings(request, options = nil) + # Pass arguments to `list_tag_bindings` via a request object, either of type + # {::Google::Cloud::ResourceManager::V3::ListTagBindingsRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::ResourceManager::V3::ListTagBindingsRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_tag_bindings(parent: nil, page_size: nil, page_token: nil) + # Pass arguments to `list_tag_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 full resource name of a resource for which you want to list + # existing TagBindings. E.g. + # "//cloudresourcemanager.googleapis.com/projects/123" + # @param page_size [::Integer] + # Optional. The maximum number of TagBindings to return in the response. The + # server allows a maximum of 300 TagBindings to return. If unspecified, the + # server will use 100 as the default. + # @param page_token [::String] + # Optional. A pagination token returned from a previous call to + # `ListTagBindings` that indicates where this listing should continue from. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Gapic::PagedEnumerable<::Google::Cloud::ResourceManager::V3::TagBinding>] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Gapic::PagedEnumerable<::Google::Cloud::ResourceManager::V3::TagBinding>] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/resource_manager/v3" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::ResourceManager::V3::TagBindings::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::ResourceManager::V3::ListTagBindingsRequest.new + # + # # Call the list_tag_bindings method. + # result = client.list_tag_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::Cloud::ResourceManager::V3::TagBinding. + # p item + # end + # + def list_tag_bindings request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::ResourceManager::V3::ListTagBindingsRequest + + # Converts hash 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_tag_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::ResourceManager::V3::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.list_tag_bindings.timeout, + metadata: metadata, + retry_policy: @config.rpcs.list_tag_bindings.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @tag_bindings_stub.call_rpc :list_tag_bindings, request, options: options do |response, operation| + response = ::Gapic::PagedEnumerable.new @tag_bindings_stub, :list_tag_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 + + ## + # Creates a TagBinding between a TagValue and a Google Cloud resource. + # + # @overload create_tag_binding(request, options = nil) + # Pass arguments to `create_tag_binding` via a request object, either of type + # {::Google::Cloud::ResourceManager::V3::CreateTagBindingRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::ResourceManager::V3::CreateTagBindingRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_tag_binding(tag_binding: nil, validate_only: nil) + # Pass arguments to `create_tag_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 tag_binding [::Google::Cloud::ResourceManager::V3::TagBinding, ::Hash] + # Required. The TagBinding to be created. + # @param validate_only [::Boolean] + # Optional. Set to true to perform the validations necessary for creating the + # resource, but not actually perform the action. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Gapic::Operation] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Gapic::Operation] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/resource_manager/v3" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::ResourceManager::V3::TagBindings::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::ResourceManager::V3::CreateTagBindingRequest.new + # + # # Call the create_tag_binding method. + # result = client.create_tag_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_tag_binding request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::ResourceManager::V3::CreateTagBindingRequest + + # Converts hash 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_tag_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::ResourceManager::V3::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.create_tag_binding.timeout, + metadata: metadata, + retry_policy: @config.rpcs.create_tag_binding.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @tag_bindings_stub.call_rpc :create_tag_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 TagBinding. + # + # @overload delete_tag_binding(request, options = nil) + # Pass arguments to `delete_tag_binding` via a request object, either of type + # {::Google::Cloud::ResourceManager::V3::DeleteTagBindingRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::ResourceManager::V3::DeleteTagBindingRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_tag_binding(name: nil) + # Pass arguments to `delete_tag_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 TagBinding. This is a String of the form: + # `tagBindings/{id}` (e.g. + # `tagBindings/%2F%2Fcloudresourcemanager.googleapis.com%2Fprojects%2F123/tagValues/456`). + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Gapic::Operation] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Gapic::Operation] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/resource_manager/v3" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::ResourceManager::V3::TagBindings::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::ResourceManager::V3::DeleteTagBindingRequest.new + # + # # Call the delete_tag_binding method. + # result = client.delete_tag_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_tag_binding request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::ResourceManager::V3::DeleteTagBindingRequest + + # Converts hash 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_tag_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::ResourceManager::V3::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_tag_binding.timeout, + metadata: metadata, + retry_policy: @config.rpcs.delete_tag_binding.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @tag_bindings_stub.call_rpc :delete_tag_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 + + ## + # Return a list of effective tags for the given Google Cloud resource, as + # specified in `parent`. + # + # @overload list_effective_tags(request, options = nil) + # Pass arguments to `list_effective_tags` via a request object, either of type + # {::Google::Cloud::ResourceManager::V3::ListEffectiveTagsRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::ResourceManager::V3::ListEffectiveTagsRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_effective_tags(parent: nil, page_size: nil, page_token: nil) + # Pass arguments to `list_effective_tags` via keyword arguments. Note that at + # least one keyword argument is 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 full resource name of a resource for which you want to list + # the effective tags. E.g. + # "//cloudresourcemanager.googleapis.com/projects/123" + # @param page_size [::Integer] + # Optional. The maximum number of effective tags to return in the response. + # The server allows a maximum of 300 effective tags to return in a single + # page. If unspecified, the server will use 100 as the default. + # @param page_token [::String] + # Optional. A pagination token returned from a previous call to + # `ListEffectiveTags` that indicates from where this listing should continue. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Gapic::PagedEnumerable<::Google::Cloud::ResourceManager::V3::EffectiveTag>] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Gapic::PagedEnumerable<::Google::Cloud::ResourceManager::V3::EffectiveTag>] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/resource_manager/v3" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::ResourceManager::V3::TagBindings::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::ResourceManager::V3::ListEffectiveTagsRequest.new + # + # # Call the list_effective_tags method. + # result = client.list_effective_tags request + # + # # The returned object is of type Gapic::PagedEnumerable. You can iterate + # # over elements, and API calls will be issued to fetch pages as needed. + # result.each do |item| + # # Each element is of type ::Google::Cloud::ResourceManager::V3::EffectiveTag. + # p item + # end + # + def list_effective_tags request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::ResourceManager::V3::ListEffectiveTagsRequest + + # Converts hash 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_effective_tags.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::ResourceManager::V3::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.list_effective_tags.timeout, + metadata: metadata, + retry_policy: @config.rpcs.list_effective_tags.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @tag_bindings_stub.call_rpc :list_effective_tags, request, options: options do |response, operation| + response = ::Gapic::PagedEnumerable.new @tag_bindings_stub, :list_effective_tags, 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 TagBindings API. + # + # This class represents the configuration for TagBindings, + # providing control over timeouts, retry behavior, logging, transport + # parameters, and other low-level controls. Certain parameters can also be + # applied individually to specific RPCs. See + # {::Google::Cloud::ResourceManager::V3::TagBindings::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_tag_bindings to 20 seconds, + # # and all remaining timeouts to 10 seconds. + # ::Google::Cloud::ResourceManager::V3::TagBindings::Client.configure do |config| + # config.timeout = 10.0 + # config.rpcs.list_tag_bindings.timeout = 20.0 + # end + # + # # Apply the above configuration only to a new client. + # client = ::Google::Cloud::ResourceManager::V3::TagBindings::Client.new do |config| + # config.timeout = 10.0 + # config.rpcs.list_tag_bindings.timeout = 20.0 + # end + # + # @!attribute [rw] endpoint + # A custom service endpoint, as a hostname or hostname:port. The default is + # nil, indicating to use the default endpoint in the current universe domain. + # @return [::String,nil] + # @!attribute [rw] credentials + # Credentials to send with calls. You may provide any of the following types: + # * (`Google::Auth::Credentials`) A googleauth credentials object + # (see the [googleauth docs](https://rubydoc.info/gems/googleauth/Google/Auth/Credentials)) + # * (`Signet::OAuth2::Client`) A signet oauth2 client object + # (see the [signet docs](https://rubydoc.info/gems/signet/Signet/OAuth2/Client)) + # * (`GRPC::Core::Channel`) a gRPC channel with included credentials + # * (`GRPC::Core::ChannelCredentials`) a gRPC credentails object + # * (`nil`) indicating no credentials + # + # @note Warning: Passing a `String` to a keyfile path or a `Hash` of credentials + # is deprecated. Providing an unvalidated credential configuration to + # Google APIs can compromise the security of your systems and data. + # + # @example + # + # # The recommended way to provide credentials is to use the `make_creds` method + # # on the appropriate credentials class for your environment. + # + # require "googleauth" + # + # credentials = ::Google::Auth::ServiceAccountCredentials.make_creds( + # json_key_io: ::File.open("/path/to/keyfile.json") + # ) + # + # client = ::Google::Cloud::ResourceManager::V3::TagBindings::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 = "cloudresourcemanager.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 TagBindings 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_tag_bindings` + # @return [::Gapic::Config::Method] + # + attr_reader :list_tag_bindings + ## + # RPC-specific configuration for `create_tag_binding` + # @return [::Gapic::Config::Method] + # + attr_reader :create_tag_binding + ## + # RPC-specific configuration for `delete_tag_binding` + # @return [::Gapic::Config::Method] + # + attr_reader :delete_tag_binding + ## + # RPC-specific configuration for `list_effective_tags` + # @return [::Gapic::Config::Method] + # + attr_reader :list_effective_tags + + # @private + def initialize parent_rpcs = nil + list_tag_bindings_config = parent_rpcs.list_tag_bindings if parent_rpcs.respond_to? :list_tag_bindings + @list_tag_bindings = ::Gapic::Config::Method.new list_tag_bindings_config + create_tag_binding_config = parent_rpcs.create_tag_binding if parent_rpcs.respond_to? :create_tag_binding + @create_tag_binding = ::Gapic::Config::Method.new create_tag_binding_config + delete_tag_binding_config = parent_rpcs.delete_tag_binding if parent_rpcs.respond_to? :delete_tag_binding + @delete_tag_binding = ::Gapic::Config::Method.new delete_tag_binding_config + list_effective_tags_config = parent_rpcs.list_effective_tags if parent_rpcs.respond_to? :list_effective_tags + @list_effective_tags = ::Gapic::Config::Method.new list_effective_tags_config + + yield self if block_given? + end + end + end + end + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-resource_manager-v3/lib/google/cloud/resource_manager/v3/tag_bindings/credentials.rb b/owl-bot-staging/google-cloud-resource_manager-v3/lib/google/cloud/resource_manager/v3/tag_bindings/credentials.rb new file mode 100644 index 000000000000..55d4cd3c87d7 --- /dev/null +++ b/owl-bot-staging/google-cloud-resource_manager-v3/lib/google/cloud/resource_manager/v3/tag_bindings/credentials.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 "googleauth" + +module Google + module Cloud + module ResourceManager + module V3 + module TagBindings + # Credentials for the TagBindings API. + class Credentials < ::Google::Auth::Credentials + self.scope = [ + "https://www.googleapis.com/auth/cloud-platform", + "https://www.googleapis.com/auth/cloud-platform.read-only" + ] + self.env_vars = [ + "RESOURCE_MANAGER_CREDENTIALS", + "RESOURCE_MANAGER_KEYFILE", + "GOOGLE_CLOUD_CREDENTIALS", + "GOOGLE_CLOUD_KEYFILE", + "GCLOUD_KEYFILE", + "RESOURCE_MANAGER_CREDENTIALS_JSON", + "RESOURCE_MANAGER_KEYFILE_JSON", + "GOOGLE_CLOUD_CREDENTIALS_JSON", + "GOOGLE_CLOUD_KEYFILE_JSON", + "GCLOUD_KEYFILE_JSON" + ] + self.paths = [ + "~/.config/google_cloud/application_default_credentials.json" + ] + end + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-resource_manager-v3/lib/google/cloud/resource_manager/v3/tag_bindings/operations.rb b/owl-bot-staging/google-cloud-resource_manager-v3/lib/google/cloud/resource_manager/v3/tag_bindings/operations.rb new file mode 100644 index 000000000000..9d53849d8b57 --- /dev/null +++ b/owl-bot-staging/google-cloud-resource_manager-v3/lib/google/cloud/resource_manager/v3/tag_bindings/operations.rb @@ -0,0 +1,841 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +require "gapic/operation" +require "google/longrunning/operations_pb" + +module Google + module Cloud + module ResourceManager + module V3 + module TagBindings + # Service that implements Longrunning Operations API. + class Operations + # @private + API_VERSION = "" + + # @private + DEFAULT_ENDPOINT_TEMPLATE = "cloudresourcemanager.$UNIVERSE_DOMAIN$" + + # @private + attr_reader :operations_stub + + ## + # Configuration for the TagBindings 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 TagBindings 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::ResourceManager::V3::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::ResourceManager::V3::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::ResourceManager::V3::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::ResourceManager::V3::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::ResourceManager::V3::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 = "cloudresourcemanager.googleapis.com" + + config_attr :endpoint, nil, ::String, nil + config_attr :credentials, nil do |value| + allowed = [::String, ::Hash, ::Proc, ::Symbol, ::Google::Auth::Credentials, ::Google::Auth::BaseClient, ::Signet::OAuth2::Client, nil] + allowed += [::GRPC::Core::Channel, ::GRPC::Core::ChannelCredentials] if defined? ::GRPC::Core::Channel + allowed.any? { |klass| klass === value } + end + config_attr :scope, nil, ::String, ::Array, nil + config_attr :lib_name, nil, ::String, nil + config_attr :lib_version, nil, ::String, nil + config_attr(:channel_args, { "grpc.service_config_disable_resolution" => 1 }, ::Hash, nil) + config_attr :interceptors, nil, ::Array, nil + config_attr :timeout, nil, ::Numeric, nil + config_attr :metadata, nil, ::Hash, nil + config_attr :retry_policy, nil, ::Hash, ::Proc, nil + config_attr :quota_project, nil, ::String, nil + config_attr :universe_domain, nil, ::String, nil + config_attr :logger, :default, ::Logger, nil, :default + + # @private + def initialize parent_config = nil + @parent_config = parent_config unless parent_config.nil? + + yield self if block_given? + end + + ## + # Configurations for individual RPCs + # @return [Rpcs] + # + def rpcs + @rpcs ||= begin + parent_rpcs = nil + parent_rpcs = @parent_config.rpcs if defined?(@parent_config) && @parent_config.respond_to?(:rpcs) + Rpcs.new parent_rpcs + end + end + + ## + # Configuration for the channel pool + # @return [::Gapic::ServiceStub::ChannelPool::Configuration] + # + def channel_pool + @channel_pool ||= ::Gapic::ServiceStub::ChannelPool::Configuration.new + end + + ## + # Configuration RPC class for the Operations API. + # + # Includes fields providing the configuration for each RPC in this service. + # Each configuration object is of type `Gapic::Config::Method` and includes + # the following configuration fields: + # + # * `timeout` (*type:* `Numeric`) - The call timeout in seconds + # * `metadata` (*type:* `Hash{Symbol=>String}`) - Additional gRPC headers + # * `retry_policy (*type:* `Hash`) - The retry policy. The policy fields + # include the following keys: + # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds. + # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds. + # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier. + # * `:retry_codes` (*type:* `Array`) - The error codes that should + # trigger a retry. + # + class Rpcs + ## + # RPC-specific configuration for `list_operations` + # @return [::Gapic::Config::Method] + # + attr_reader :list_operations + ## + # RPC-specific configuration for `get_operation` + # @return [::Gapic::Config::Method] + # + attr_reader :get_operation + ## + # RPC-specific configuration for `delete_operation` + # @return [::Gapic::Config::Method] + # + attr_reader :delete_operation + ## + # RPC-specific configuration for `cancel_operation` + # @return [::Gapic::Config::Method] + # + attr_reader :cancel_operation + ## + # RPC-specific configuration for `wait_operation` + # @return [::Gapic::Config::Method] + # + attr_reader :wait_operation + + # @private + def initialize parent_rpcs = nil + list_operations_config = parent_rpcs.list_operations if parent_rpcs.respond_to? :list_operations + @list_operations = ::Gapic::Config::Method.new list_operations_config + get_operation_config = parent_rpcs.get_operation if parent_rpcs.respond_to? :get_operation + @get_operation = ::Gapic::Config::Method.new get_operation_config + delete_operation_config = parent_rpcs.delete_operation if parent_rpcs.respond_to? :delete_operation + @delete_operation = ::Gapic::Config::Method.new delete_operation_config + cancel_operation_config = parent_rpcs.cancel_operation if parent_rpcs.respond_to? :cancel_operation + @cancel_operation = ::Gapic::Config::Method.new cancel_operation_config + wait_operation_config = parent_rpcs.wait_operation if parent_rpcs.respond_to? :wait_operation + @wait_operation = ::Gapic::Config::Method.new wait_operation_config + + yield self if block_given? + end + end + end + end + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-resource_manager-v3/lib/google/cloud/resource_manager/v3/tag_bindings/paths.rb b/owl-bot-staging/google-cloud-resource_manager-v3/lib/google/cloud/resource_manager/v3/tag_bindings/paths.rb new file mode 100644 index 000000000000..ec819af412f6 --- /dev/null +++ b/owl-bot-staging/google-cloud-resource_manager-v3/lib/google/cloud/resource_manager/v3/tag_bindings/paths.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! + + +module Google + module Cloud + module ResourceManager + module V3 + module TagBindings + # Path helper methods for the TagBindings API. + module Paths + ## + # Create a fully-qualified TagBinding resource string. + # + # The resource will be in the following format: + # + # `tagBindings/{tag_binding}` + # + # @param tag_binding [String] + # + # @return [::String] + def tag_binding_path tag_binding: + "tagBindings/#{tag_binding}" + end + + extend self + end + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-resource_manager-v3/lib/google/cloud/resource_manager/v3/tag_bindings/rest.rb b/owl-bot-staging/google-cloud-resource_manager-v3/lib/google/cloud/resource_manager/v3/tag_bindings/rest.rb new file mode 100644 index 000000000000..632a9a2cfb93 --- /dev/null +++ b/owl-bot-staging/google-cloud-resource_manager-v3/lib/google/cloud/resource_manager/v3/tag_bindings/rest.rb @@ -0,0 +1,54 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +require "gapic/rest" +require "gapic/config" +require "gapic/config/method" + +require "google/cloud/resource_manager/v3/version" + +require "google/cloud/resource_manager/v3/tag_bindings/credentials" +require "google/cloud/resource_manager/v3/tag_bindings/paths" +require "google/cloud/resource_manager/v3/tag_bindings/rest/operations" +require "google/cloud/resource_manager/v3/tag_bindings/rest/client" + +module Google + module Cloud + module ResourceManager + module V3 + ## + # Allow users to create and manage TagBindings between TagValues and + # different Google Cloud resources throughout the GCP resource hierarchy. + # + # To load this service and instantiate a REST client: + # + # require "google/cloud/resource_manager/v3/tag_bindings/rest" + # client = ::Google::Cloud::ResourceManager::V3::TagBindings::Rest::Client.new + # + module TagBindings + # Client for the REST transport + module Rest + end + end + end + end + end +end + +helper_path = ::File.join __dir__, "rest", "helpers.rb" +require "google/cloud/resource_manager/v3/tag_bindings/rest/helpers" if ::File.file? helper_path diff --git a/owl-bot-staging/google-cloud-resource_manager-v3/lib/google/cloud/resource_manager/v3/tag_bindings/rest/client.rb b/owl-bot-staging/google-cloud-resource_manager-v3/lib/google/cloud/resource_manager/v3/tag_bindings/rest/client.rb new file mode 100644 index 000000000000..5d97e3b1840a --- /dev/null +++ b/owl-bot-staging/google-cloud-resource_manager-v3/lib/google/cloud/resource_manager/v3/tag_bindings/rest/client.rb @@ -0,0 +1,761 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +require "google/cloud/errors" +require "google/cloud/resourcemanager/v3/tag_bindings_pb" +require "google/cloud/resource_manager/v3/tag_bindings/rest/service_stub" + +module Google + module Cloud + module ResourceManager + module V3 + module TagBindings + module Rest + ## + # REST client for the TagBindings service. + # + # Allow users to create and manage TagBindings between TagValues and + # different Google Cloud resources throughout the GCP resource hierarchy. + # + class Client + # @private + API_VERSION = "" + + # @private + DEFAULT_ENDPOINT_TEMPLATE = "cloudresourcemanager.$UNIVERSE_DOMAIN$" + + include Paths + + # @private + attr_reader :tag_bindings_stub + + ## + # Configure the TagBindings Client class. + # + # See {::Google::Cloud::ResourceManager::V3::TagBindings::Rest::Client::Configuration} + # for a description of the configuration fields. + # + # @example + # + # # Modify the configuration for all TagBindings clients + # ::Google::Cloud::ResourceManager::V3::TagBindings::Rest::Client.configure do |config| + # config.timeout = 10.0 + # end + # + # @yield [config] Configure the Client client. + # @yieldparam config [Client::Configuration] + # + # @return [Client::Configuration] + # + def self.configure + @configure ||= begin + namespace = ["Google", "Cloud", "ResourceManager", "V3"] + parent_config = while namespace.any? + parent_name = namespace.join "::" + parent_const = const_get parent_name + break parent_const.configure if parent_const.respond_to? :configure + namespace.pop + end + default_config = Client::Configuration.new parent_config + + default_config.rpcs.list_tag_bindings.timeout = 60.0 + default_config.rpcs.list_tag_bindings.retry_policy = { + initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [14] + } + + default_config.rpcs.create_tag_binding.timeout = 60.0 + + default_config.rpcs.delete_tag_binding.timeout = 60.0 + + default_config + end + yield @configure if block_given? + @configure + end + + ## + # Configure the TagBindings Client instance. + # + # The configuration is set to the derived mode, meaning that values can be changed, + # but structural changes (adding new fields, etc.) are not allowed. Structural changes + # should be made on {Client.configure}. + # + # See {::Google::Cloud::ResourceManager::V3::TagBindings::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 + @tag_bindings_stub.universe_domain + end + + ## + # Create a new TagBindings REST client object. + # + # @example + # + # # Create a client using the default configuration + # client = ::Google::Cloud::ResourceManager::V3::TagBindings::Rest::Client.new + # + # # Create a client using a custom configuration + # client = ::Google::Cloud::ResourceManager::V3::TagBindings::Rest::Client.new do |config| + # config.timeout = 10.0 + # end + # + # @yield [config] Configure the TagBindings client. + # @yieldparam config [Client::Configuration] + # + def initialize + # Create the configuration object + @config = Configuration.new Client.configure + + # Yield the configuration if needed + yield @config if block_given? + + # Create credentials + credentials = @config.credentials + # Use self-signed JWT if the endpoint is unchanged from default, + # but only if the default endpoint does not have a region prefix. + enable_self_signed_jwt = @config.endpoint.nil? || + (@config.endpoint == Configuration::DEFAULT_ENDPOINT && + !@config.endpoint.split(".").first.include?("-")) + credentials ||= Credentials.default scope: @config.scope, + enable_self_signed_jwt: enable_self_signed_jwt + if credentials.is_a?(::String) || credentials.is_a?(::Hash) + credentials = Credentials.new credentials, scope: @config.scope + end + + @quota_project_id = @config.quota_project + @quota_project_id ||= credentials.quota_project_id if credentials.respond_to? :quota_project_id + + @operations_client = ::Google::Cloud::ResourceManager::V3::TagBindings::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 + + @tag_bindings_stub = ::Google::Cloud::ResourceManager::V3::TagBindings::Rest::ServiceStub.new( + endpoint: @config.endpoint, + endpoint_template: DEFAULT_ENDPOINT_TEMPLATE, + universe_domain: @config.universe_domain, + credentials: credentials, + logger: @config.logger + ) + + @tag_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 + end + + ## + # Get the associated client for long-running operations. + # + # @return [::Google::Cloud::ResourceManager::V3::TagBindings::Rest::Operations] + # + attr_reader :operations_client + + ## + # The logger used for request/response debug logging. + # + # @return [Logger] + # + def logger + @tag_bindings_stub.logger + end + + # Service calls + + ## + # Lists the TagBindings for the given Google Cloud resource, as specified + # with `parent`. + # + # NOTE: The `parent` field is expected to be a full resource name: + # https://cloud.google.com/apis/design/resource_names#full_resource_name + # + # @overload list_tag_bindings(request, options = nil) + # Pass arguments to `list_tag_bindings` via a request object, either of type + # {::Google::Cloud::ResourceManager::V3::ListTagBindingsRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::ResourceManager::V3::ListTagBindingsRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_tag_bindings(parent: nil, page_size: nil, page_token: nil) + # Pass arguments to `list_tag_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 full resource name of a resource for which you want to list + # existing TagBindings. E.g. + # "//cloudresourcemanager.googleapis.com/projects/123" + # @param page_size [::Integer] + # Optional. The maximum number of TagBindings to return in the response. The + # server allows a maximum of 300 TagBindings to return. If unspecified, the + # server will use 100 as the default. + # @param page_token [::String] + # Optional. A pagination token returned from a previous call to + # `ListTagBindings` that indicates where this listing should continue from. + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Gapic::Rest::PagedEnumerable<::Google::Cloud::ResourceManager::V3::TagBinding>] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Gapic::Rest::PagedEnumerable<::Google::Cloud::ResourceManager::V3::TagBinding>] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/resource_manager/v3" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::ResourceManager::V3::TagBindings::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::ResourceManager::V3::ListTagBindingsRequest.new + # + # # Call the list_tag_bindings method. + # result = client.list_tag_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::Cloud::ResourceManager::V3::TagBinding. + # p item + # end + # + def list_tag_bindings request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::ResourceManager::V3::ListTagBindingsRequest + + # Converts hash 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_tag_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::ResourceManager::V3::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_tag_bindings.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.list_tag_bindings.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @tag_bindings_stub.list_tag_bindings request, options do |result, operation| + result = ::Gapic::Rest::PagedEnumerable.new @tag_bindings_stub, :list_tag_bindings, "tag_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 + + ## + # Creates a TagBinding between a TagValue and a Google Cloud resource. + # + # @overload create_tag_binding(request, options = nil) + # Pass arguments to `create_tag_binding` via a request object, either of type + # {::Google::Cloud::ResourceManager::V3::CreateTagBindingRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::ResourceManager::V3::CreateTagBindingRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_tag_binding(tag_binding: nil, validate_only: nil) + # Pass arguments to `create_tag_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 tag_binding [::Google::Cloud::ResourceManager::V3::TagBinding, ::Hash] + # Required. The TagBinding to be created. + # @param validate_only [::Boolean] + # Optional. Set to true to perform the validations necessary for creating the + # resource, but not actually perform the action. + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Gapic::Operation] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Gapic::Operation] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/resource_manager/v3" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::ResourceManager::V3::TagBindings::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::ResourceManager::V3::CreateTagBindingRequest.new + # + # # Call the create_tag_binding method. + # result = client.create_tag_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_tag_binding request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::ResourceManager::V3::CreateTagBindingRequest + + # Converts hash 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_tag_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::ResourceManager::V3::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_tag_binding.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.create_tag_binding.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @tag_bindings_stub.create_tag_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 TagBinding. + # + # @overload delete_tag_binding(request, options = nil) + # Pass arguments to `delete_tag_binding` via a request object, either of type + # {::Google::Cloud::ResourceManager::V3::DeleteTagBindingRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::ResourceManager::V3::DeleteTagBindingRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_tag_binding(name: nil) + # Pass arguments to `delete_tag_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 TagBinding. This is a String of the form: + # `tagBindings/{id}` (e.g. + # `tagBindings/%2F%2Fcloudresourcemanager.googleapis.com%2Fprojects%2F123/tagValues/456`). + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Gapic::Operation] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Gapic::Operation] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/resource_manager/v3" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::ResourceManager::V3::TagBindings::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::ResourceManager::V3::DeleteTagBindingRequest.new + # + # # Call the delete_tag_binding method. + # result = client.delete_tag_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_tag_binding request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::ResourceManager::V3::DeleteTagBindingRequest + + # Converts hash 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_tag_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::ResourceManager::V3::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_tag_binding.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.delete_tag_binding.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @tag_bindings_stub.delete_tag_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 + + ## + # Return a list of effective tags for the given Google Cloud resource, as + # specified in `parent`. + # + # @overload list_effective_tags(request, options = nil) + # Pass arguments to `list_effective_tags` via a request object, either of type + # {::Google::Cloud::ResourceManager::V3::ListEffectiveTagsRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::ResourceManager::V3::ListEffectiveTagsRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_effective_tags(parent: nil, page_size: nil, page_token: nil) + # Pass arguments to `list_effective_tags` via keyword arguments. Note that at + # least one keyword argument is 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 full resource name of a resource for which you want to list + # the effective tags. E.g. + # "//cloudresourcemanager.googleapis.com/projects/123" + # @param page_size [::Integer] + # Optional. The maximum number of effective tags to return in the response. + # The server allows a maximum of 300 effective tags to return in a single + # page. If unspecified, the server will use 100 as the default. + # @param page_token [::String] + # Optional. A pagination token returned from a previous call to + # `ListEffectiveTags` that indicates from where this listing should continue. + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Gapic::Rest::PagedEnumerable<::Google::Cloud::ResourceManager::V3::EffectiveTag>] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Gapic::Rest::PagedEnumerable<::Google::Cloud::ResourceManager::V3::EffectiveTag>] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/resource_manager/v3" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::ResourceManager::V3::TagBindings::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::ResourceManager::V3::ListEffectiveTagsRequest.new + # + # # Call the list_effective_tags method. + # result = client.list_effective_tags request + # + # # The returned object is of type Gapic::PagedEnumerable. You can iterate + # # over elements, and API calls will be issued to fetch pages as needed. + # result.each do |item| + # # Each element is of type ::Google::Cloud::ResourceManager::V3::EffectiveTag. + # p item + # end + # + def list_effective_tags request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::ResourceManager::V3::ListEffectiveTagsRequest + + # Converts hash 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_effective_tags.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::ResourceManager::V3::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_effective_tags.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.list_effective_tags.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @tag_bindings_stub.list_effective_tags request, options do |result, operation| + result = ::Gapic::Rest::PagedEnumerable.new @tag_bindings_stub, :list_effective_tags, "effective_tags", 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 TagBindings REST API. + # + # This class represents the configuration for TagBindings REST, + # providing control over timeouts, retry behavior, logging, transport + # parameters, and other low-level controls. Certain parameters can also be + # applied individually to specific RPCs. See + # {::Google::Cloud::ResourceManager::V3::TagBindings::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_tag_bindings to 20 seconds, + # # and all remaining timeouts to 10 seconds. + # ::Google::Cloud::ResourceManager::V3::TagBindings::Rest::Client.configure do |config| + # config.timeout = 10.0 + # config.rpcs.list_tag_bindings.timeout = 20.0 + # end + # + # # Apply the above configuration only to a new client. + # client = ::Google::Cloud::ResourceManager::V3::TagBindings::Rest::Client.new do |config| + # config.timeout = 10.0 + # config.rpcs.list_tag_bindings.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 = "cloudresourcemanager.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 TagBindings 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_tag_bindings` + # @return [::Gapic::Config::Method] + # + attr_reader :list_tag_bindings + ## + # RPC-specific configuration for `create_tag_binding` + # @return [::Gapic::Config::Method] + # + attr_reader :create_tag_binding + ## + # RPC-specific configuration for `delete_tag_binding` + # @return [::Gapic::Config::Method] + # + attr_reader :delete_tag_binding + ## + # RPC-specific configuration for `list_effective_tags` + # @return [::Gapic::Config::Method] + # + attr_reader :list_effective_tags + + # @private + def initialize parent_rpcs = nil + list_tag_bindings_config = parent_rpcs.list_tag_bindings if parent_rpcs.respond_to? :list_tag_bindings + @list_tag_bindings = ::Gapic::Config::Method.new list_tag_bindings_config + create_tag_binding_config = parent_rpcs.create_tag_binding if parent_rpcs.respond_to? :create_tag_binding + @create_tag_binding = ::Gapic::Config::Method.new create_tag_binding_config + delete_tag_binding_config = parent_rpcs.delete_tag_binding if parent_rpcs.respond_to? :delete_tag_binding + @delete_tag_binding = ::Gapic::Config::Method.new delete_tag_binding_config + list_effective_tags_config = parent_rpcs.list_effective_tags if parent_rpcs.respond_to? :list_effective_tags + @list_effective_tags = ::Gapic::Config::Method.new list_effective_tags_config + + yield self if block_given? + end + end + end + end + end + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-resource_manager-v3/lib/google/cloud/resource_manager/v3/tag_bindings/rest/operations.rb b/owl-bot-staging/google-cloud-resource_manager-v3/lib/google/cloud/resource_manager/v3/tag_bindings/rest/operations.rb new file mode 100644 index 000000000000..24dca1e8fb88 --- /dev/null +++ b/owl-bot-staging/google-cloud-resource_manager-v3/lib/google/cloud/resource_manager/v3/tag_bindings/rest/operations.rb @@ -0,0 +1,925 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +require "gapic/operation" + +module Google + module Cloud + module ResourceManager + module V3 + module TagBindings + module Rest + # Service that implements Longrunning Operations API. + class Operations + # @private + API_VERSION = "" + + # @private + DEFAULT_ENDPOINT_TEMPLATE = "cloudresourcemanager.$UNIVERSE_DOMAIN$" + + # @private + attr_reader :operations_stub + + ## + # Configuration for the TagBindings 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 TagBindings 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::ResourceManager::V3::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::ResourceManager::V3::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::ResourceManager::V3::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::ResourceManager::V3::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 = "cloudresourcemanager.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: "/v3/{name}", + matches: [ + ["name", %r{^operations(?:/.*)?$}, true] + ] + ) + 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 +end diff --git a/owl-bot-staging/google-cloud-resource_manager-v3/lib/google/cloud/resource_manager/v3/tag_bindings/rest/service_stub.rb b/owl-bot-staging/google-cloud-resource_manager-v3/lib/google/cloud/resource_manager/v3/tag_bindings/rest/service_stub.rb new file mode 100644 index 000000000000..ce15bb219df9 --- /dev/null +++ b/owl-bot-staging/google-cloud-resource_manager-v3/lib/google/cloud/resource_manager/v3/tag_bindings/rest/service_stub.rb @@ -0,0 +1,320 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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/resourcemanager/v3/tag_bindings_pb" + +module Google + module Cloud + module ResourceManager + module V3 + module TagBindings + module Rest + ## + # REST service stub for the TagBindings service. + # Service stub contains baseline method implementations + # including transcoding, making the REST call, and deserialing the response. + # + class ServiceStub + # @private + def initialize endpoint:, endpoint_template:, universe_domain:, credentials:, logger: + # These require statements are intentionally placed here to initialize + # the REST modules only when it's required. + require "gapic/rest" + + @client_stub = ::Gapic::Rest::ClientStub.new endpoint: endpoint, + endpoint_template: endpoint_template, + universe_domain: universe_domain, + credentials: credentials, + numeric_enums: true, + service_name: self.class, + raise_faraday_errors: false, + logger: logger + end + + ## + # The effective universe domain + # + # @return [String] + # + def universe_domain + @client_stub.universe_domain + end + + ## + # The effective endpoint + # + # @return [String] + # + def endpoint + @client_stub.endpoint + end + + ## + # The logger used for request/response debug logging. + # + # @return [Logger] + # + def logger stub: false + stub ? @client_stub.stub_logger : @client_stub.logger + end + + ## + # Baseline implementation for the list_tag_bindings REST call + # + # @param request_pb [::Google::Cloud::ResourceManager::V3::ListTagBindingsRequest] + # A request object representing the call parameters. Required. + # @param options [::Gapic::CallOptions] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Cloud::ResourceManager::V3::ListTagBindingsResponse] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::ResourceManager::V3::ListTagBindingsResponse] + # A result object deserialized from the server's reply + def list_tag_bindings request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_list_tag_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_tag_bindings", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Cloud::ResourceManager::V3::ListTagBindingsResponse.decode_json response.body, ignore_unknown_fields: true + catch :response do + yield result, operation if block_given? + result + end + end + + ## + # Baseline implementation for the create_tag_binding REST call + # + # @param request_pb [::Google::Cloud::ResourceManager::V3::CreateTagBindingRequest] + # 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_tag_binding request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_create_tag_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_tag_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_tag_binding REST call + # + # @param request_pb [::Google::Cloud::ResourceManager::V3::DeleteTagBindingRequest] + # 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_tag_binding request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_delete_tag_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_tag_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_effective_tags REST call + # + # @param request_pb [::Google::Cloud::ResourceManager::V3::ListEffectiveTagsRequest] + # A request object representing the call parameters. Required. + # @param options [::Gapic::CallOptions] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Cloud::ResourceManager::V3::ListEffectiveTagsResponse] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::ResourceManager::V3::ListEffectiveTagsResponse] + # A result object deserialized from the server's reply + def list_effective_tags request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_list_effective_tags_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_effective_tags", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Cloud::ResourceManager::V3::ListEffectiveTagsResponse.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_tag_bindings REST call + # + # @param request_pb [::Google::Cloud::ResourceManager::V3::ListTagBindingsRequest] + # 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_tag_bindings_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :get, + uri_template: "/v3/tagBindings", + matches: [] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the create_tag_binding REST call + # + # @param request_pb [::Google::Cloud::ResourceManager::V3::CreateTagBindingRequest] + # 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_tag_binding_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :post, + uri_template: "/v3/tagBindings", + body: "tag_binding", + matches: [] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the delete_tag_binding REST call + # + # @param request_pb [::Google::Cloud::ResourceManager::V3::DeleteTagBindingRequest] + # 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_tag_binding_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :delete, + uri_template: "/v3/{name}", + matches: [ + ["name", %r{^tagBindings(?:/.*)?$}, true] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the list_effective_tags REST call + # + # @param request_pb [::Google::Cloud::ResourceManager::V3::ListEffectiveTagsRequest] + # 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_effective_tags_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :get, + uri_template: "/v3/effectiveTags", + matches: [] + ) + transcoder.transcode request_pb + end + end + end + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-resource_manager-v3/lib/google/cloud/resource_manager/v3/tag_holds.rb b/owl-bot-staging/google-cloud-resource_manager-v3/lib/google/cloud/resource_manager/v3/tag_holds.rb new file mode 100644 index 000000000000..eb3948031b20 --- /dev/null +++ b/owl-bot-staging/google-cloud-resource_manager-v3/lib/google/cloud/resource_manager/v3/tag_holds.rb @@ -0,0 +1,60 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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/resource_manager/v3/version" + +require "google/cloud/resource_manager/v3/tag_holds/credentials" +require "google/cloud/resource_manager/v3/tag_holds/paths" +require "google/cloud/resource_manager/v3/tag_holds/operations" +require "google/cloud/resource_manager/v3/tag_holds/client" +require "google/cloud/resource_manager/v3/tag_holds/rest" + +module Google + module Cloud + module ResourceManager + module V3 + ## + # Allow users to create and manage TagHolds for TagValues. TagHolds represent + # the use of a Tag Value that is not captured by TagBindings but + # should still block TagValue deletion (such as a reference in a policy + # condition). This service provides isolated failure domains by cloud location + # so that TagHolds can be managed in the same location as their usage. + # + # @example Load this service and instantiate a gRPC client + # + # require "google/cloud/resource_manager/v3/tag_holds" + # client = ::Google::Cloud::ResourceManager::V3::TagHolds::Client.new + # + # @example Load this service and instantiate a REST client + # + # require "google/cloud/resource_manager/v3/tag_holds/rest" + # client = ::Google::Cloud::ResourceManager::V3::TagHolds::Rest::Client.new + # + module TagHolds + end + end + end + end +end + +helper_path = ::File.join __dir__, "tag_holds", "helpers.rb" +require "google/cloud/resource_manager/v3/tag_holds/helpers" if ::File.file? helper_path diff --git a/owl-bot-staging/google-cloud-resource_manager-v3/lib/google/cloud/resource_manager/v3/tag_holds/client.rb b/owl-bot-staging/google-cloud-resource_manager-v3/lib/google/cloud/resource_manager/v3/tag_holds/client.rb new file mode 100644 index 000000000000..2c46a253724b --- /dev/null +++ b/owl-bot-staging/google-cloud-resource_manager-v3/lib/google/cloud/resource_manager/v3/tag_holds/client.rb @@ -0,0 +1,731 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +require "google/cloud/errors" +require "google/cloud/resourcemanager/v3/tag_holds_pb" + +module Google + module Cloud + module ResourceManager + module V3 + module TagHolds + ## + # Client for the TagHolds service. + # + # Allow users to create and manage TagHolds for TagValues. TagHolds represent + # the use of a Tag Value that is not captured by TagBindings but + # should still block TagValue deletion (such as a reference in a policy + # condition). This service provides isolated failure domains by cloud location + # so that TagHolds can be managed in the same location as their usage. + # + class Client + # @private + API_VERSION = "" + + # @private + DEFAULT_ENDPOINT_TEMPLATE = "cloudresourcemanager.$UNIVERSE_DOMAIN$" + + include Paths + + # @private + attr_reader :tag_holds_stub + + ## + # Configure the TagHolds Client class. + # + # See {::Google::Cloud::ResourceManager::V3::TagHolds::Client::Configuration} + # for a description of the configuration fields. + # + # @example + # + # # Modify the configuration for all TagHolds clients + # ::Google::Cloud::ResourceManager::V3::TagHolds::Client.configure do |config| + # config.timeout = 10.0 + # end + # + # @yield [config] Configure the Client client. + # @yieldparam config [Client::Configuration] + # + # @return [Client::Configuration] + # + def self.configure + @configure ||= begin + namespace = ["Google", "Cloud", "ResourceManager", "V3"] + parent_config = while namespace.any? + parent_name = namespace.join "::" + parent_const = const_get parent_name + break parent_const.configure if parent_const.respond_to? :configure + namespace.pop + end + default_config = Client::Configuration.new parent_config + + default_config + end + yield @configure if block_given? + @configure + end + + ## + # Configure the TagHolds Client instance. + # + # The configuration is set to the derived mode, meaning that values can be changed, + # but structural changes (adding new fields, etc.) are not allowed. Structural changes + # should be made on {Client.configure}. + # + # See {::Google::Cloud::ResourceManager::V3::TagHolds::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 + @tag_holds_stub.universe_domain + end + + ## + # Create a new TagHolds client object. + # + # @example + # + # # Create a client using the default configuration + # client = ::Google::Cloud::ResourceManager::V3::TagHolds::Client.new + # + # # Create a client using a custom configuration + # client = ::Google::Cloud::ResourceManager::V3::TagHolds::Client.new do |config| + # config.timeout = 10.0 + # end + # + # @yield [config] Configure the TagHolds client. + # @yieldparam config [Client::Configuration] + # + def initialize + # These require statements are intentionally placed here to initialize + # the gRPC module only when it's required. + # See https://github.com/googleapis/toolkit/issues/446 + require "gapic/grpc" + require "google/cloud/resourcemanager/v3/tag_holds_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 + + @tag_holds_stub = ::Gapic::ServiceStub.new( + ::Google::Cloud::ResourceManager::V3::TagHolds::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 + ) + + @tag_holds_stub.stub_logger&.info do |entry| + entry.set_system_name + entry.set_service + entry.message = "Created client for #{entry.service}" + entry.set_credentials_fields credentials + entry.set "customEndpoint", @config.endpoint if @config.endpoint + entry.set "defaultTimeout", @config.timeout if @config.timeout + entry.set "quotaProject", @quota_project_id if @quota_project_id + end + end + + ## + # Get the associated client for long-running operations. + # + # @return [::Google::Cloud::ResourceManager::V3::TagHolds::Operations] + # + attr_reader :operations_client + + ## + # The logger used for request/response debug logging. + # + # @return [Logger] + # + def logger + @tag_holds_stub.logger + end + + # Service calls + + ## + # Creates a TagHold. Returns ALREADY_EXISTS if a TagHold with the same + # resource and origin exists under the same TagValue. + # + # @overload create_tag_hold(request, options = nil) + # Pass arguments to `create_tag_hold` via a request object, either of type + # {::Google::Cloud::ResourceManager::V3::CreateTagHoldRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::ResourceManager::V3::CreateTagHoldRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_tag_hold(parent: nil, tag_hold: nil, validate_only: nil) + # Pass arguments to `create_tag_hold` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param parent [::String] + # Required. The resource name of the TagHold's parent TagValue. Must be of + # the form: `tagValues/{tag-value-id}`. + # @param tag_hold [::Google::Cloud::ResourceManager::V3::TagHold, ::Hash] + # Required. The TagHold to be created. + # @param validate_only [::Boolean] + # Optional. Set to true to perform the validations necessary for creating the + # resource, but not actually perform the action. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Gapic::Operation] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Gapic::Operation] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/resource_manager/v3" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::ResourceManager::V3::TagHolds::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::ResourceManager::V3::CreateTagHoldRequest.new + # + # # Call the create_tag_hold method. + # result = client.create_tag_hold 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_tag_hold request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::ResourceManager::V3::CreateTagHoldRequest + + # Converts hash 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_tag_hold.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::ResourceManager::V3::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_tag_hold.timeout, + metadata: metadata, + retry_policy: @config.rpcs.create_tag_hold.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @tag_holds_stub.call_rpc :create_tag_hold, 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 TagHold. + # + # @overload delete_tag_hold(request, options = nil) + # Pass arguments to `delete_tag_hold` via a request object, either of type + # {::Google::Cloud::ResourceManager::V3::DeleteTagHoldRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::ResourceManager::V3::DeleteTagHoldRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_tag_hold(name: nil, validate_only: nil) + # Pass arguments to `delete_tag_hold` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param name [::String] + # Required. The resource name of the TagHold to delete. Must be of the form: + # `tagValues/{tag-value-id}/tagHolds/{tag-hold-id}`. + # @param validate_only [::Boolean] + # Optional. Set to true to perform the validations necessary for deleting the + # resource, but not actually perform the action. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Gapic::Operation] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Gapic::Operation] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/resource_manager/v3" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::ResourceManager::V3::TagHolds::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::ResourceManager::V3::DeleteTagHoldRequest.new + # + # # Call the delete_tag_hold method. + # result = client.delete_tag_hold 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_tag_hold request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::ResourceManager::V3::DeleteTagHoldRequest + + # Converts hash 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_tag_hold.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::ResourceManager::V3::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_tag_hold.timeout, + metadata: metadata, + retry_policy: @config.rpcs.delete_tag_hold.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @tag_holds_stub.call_rpc :delete_tag_hold, 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 TagHolds under a TagValue. + # + # @overload list_tag_holds(request, options = nil) + # Pass arguments to `list_tag_holds` via a request object, either of type + # {::Google::Cloud::ResourceManager::V3::ListTagHoldsRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::ResourceManager::V3::ListTagHoldsRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_tag_holds(parent: nil, page_size: nil, page_token: nil, filter: nil) + # Pass arguments to `list_tag_holds` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param parent [::String] + # Required. The resource name of the parent TagValue. Must be of the form: + # `tagValues/{tag-value-id}`. + # @param page_size [::Integer] + # Optional. The maximum number of TagHolds to return in the response. The + # server allows a maximum of 300 TagHolds to return. If unspecified, the + # server will use 100 as the default. + # @param page_token [::String] + # Optional. A pagination token returned from a previous call to + # `ListTagHolds` that indicates where this listing should continue from. + # @param filter [::String] + # Optional. Criteria used to select a subset of TagHolds parented by the + # TagValue to return. This field follows the syntax defined by aip.dev/160; + # the `holder` and `origin` fields are supported for filtering. Currently + # only `AND` syntax is supported. Some example queries are: + # + # * `holder = + # //compute.googleapis.com/compute/projects/myproject/regions/us-east-1/instanceGroupManagers/instance-group` + # * `origin = 35678234` + # * `holder = + # //compute.googleapis.com/compute/projects/myproject/regions/us-east-1/instanceGroupManagers/instance-group + # AND origin = 35678234` + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Gapic::PagedEnumerable<::Google::Cloud::ResourceManager::V3::TagHold>] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Gapic::PagedEnumerable<::Google::Cloud::ResourceManager::V3::TagHold>] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/resource_manager/v3" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::ResourceManager::V3::TagHolds::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::ResourceManager::V3::ListTagHoldsRequest.new + # + # # Call the list_tag_holds method. + # result = client.list_tag_holds request + # + # # The returned object is of type Gapic::PagedEnumerable. You can iterate + # # over elements, and API calls will be issued to fetch pages as needed. + # result.each do |item| + # # Each element is of type ::Google::Cloud::ResourceManager::V3::TagHold. + # p item + # end + # + def list_tag_holds request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::ResourceManager::V3::ListTagHoldsRequest + + # Converts hash 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_tag_holds.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::ResourceManager::V3::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_tag_holds.timeout, + metadata: metadata, + retry_policy: @config.rpcs.list_tag_holds.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @tag_holds_stub.call_rpc :list_tag_holds, request, options: options do |response, operation| + response = ::Gapic::PagedEnumerable.new @tag_holds_stub, :list_tag_holds, 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 TagHolds API. + # + # This class represents the configuration for TagHolds, + # providing control over timeouts, retry behavior, logging, transport + # parameters, and other low-level controls. Certain parameters can also be + # applied individually to specific RPCs. See + # {::Google::Cloud::ResourceManager::V3::TagHolds::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_tag_hold to 20 seconds, + # # and all remaining timeouts to 10 seconds. + # ::Google::Cloud::ResourceManager::V3::TagHolds::Client.configure do |config| + # config.timeout = 10.0 + # config.rpcs.create_tag_hold.timeout = 20.0 + # end + # + # # Apply the above configuration only to a new client. + # client = ::Google::Cloud::ResourceManager::V3::TagHolds::Client.new do |config| + # config.timeout = 10.0 + # config.rpcs.create_tag_hold.timeout = 20.0 + # end + # + # @!attribute [rw] endpoint + # A custom service endpoint, as a hostname or hostname:port. The default is + # nil, indicating to use the default endpoint in the current universe domain. + # @return [::String,nil] + # @!attribute [rw] credentials + # Credentials to send with calls. You may provide any of the following types: + # * (`Google::Auth::Credentials`) A googleauth credentials object + # (see the [googleauth docs](https://rubydoc.info/gems/googleauth/Google/Auth/Credentials)) + # * (`Signet::OAuth2::Client`) A signet oauth2 client object + # (see the [signet docs](https://rubydoc.info/gems/signet/Signet/OAuth2/Client)) + # * (`GRPC::Core::Channel`) a gRPC channel with included credentials + # * (`GRPC::Core::ChannelCredentials`) a gRPC credentails object + # * (`nil`) indicating no credentials + # + # @note Warning: Passing a `String` to a keyfile path or a `Hash` of credentials + # is deprecated. Providing an unvalidated credential configuration to + # Google APIs can compromise the security of your systems and data. + # + # @example + # + # # The recommended way to provide credentials is to use the `make_creds` method + # # on the appropriate credentials class for your environment. + # + # require "googleauth" + # + # credentials = ::Google::Auth::ServiceAccountCredentials.make_creds( + # json_key_io: ::File.open("/path/to/keyfile.json") + # ) + # + # client = ::Google::Cloud::ResourceManager::V3::TagHolds::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 = "cloudresourcemanager.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 TagHolds 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_tag_hold` + # @return [::Gapic::Config::Method] + # + attr_reader :create_tag_hold + ## + # RPC-specific configuration for `delete_tag_hold` + # @return [::Gapic::Config::Method] + # + attr_reader :delete_tag_hold + ## + # RPC-specific configuration for `list_tag_holds` + # @return [::Gapic::Config::Method] + # + attr_reader :list_tag_holds + + # @private + def initialize parent_rpcs = nil + create_tag_hold_config = parent_rpcs.create_tag_hold if parent_rpcs.respond_to? :create_tag_hold + @create_tag_hold = ::Gapic::Config::Method.new create_tag_hold_config + delete_tag_hold_config = parent_rpcs.delete_tag_hold if parent_rpcs.respond_to? :delete_tag_hold + @delete_tag_hold = ::Gapic::Config::Method.new delete_tag_hold_config + list_tag_holds_config = parent_rpcs.list_tag_holds if parent_rpcs.respond_to? :list_tag_holds + @list_tag_holds = ::Gapic::Config::Method.new list_tag_holds_config + + yield self if block_given? + end + end + end + end + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-resource_manager-v3/lib/google/cloud/resource_manager/v3/tag_holds/credentials.rb b/owl-bot-staging/google-cloud-resource_manager-v3/lib/google/cloud/resource_manager/v3/tag_holds/credentials.rb new file mode 100644 index 000000000000..0df0322ec54e --- /dev/null +++ b/owl-bot-staging/google-cloud-resource_manager-v3/lib/google/cloud/resource_manager/v3/tag_holds/credentials.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 "googleauth" + +module Google + module Cloud + module ResourceManager + module V3 + module TagHolds + # Credentials for the TagHolds API. + class Credentials < ::Google::Auth::Credentials + self.scope = [ + "https://www.googleapis.com/auth/cloud-platform", + "https://www.googleapis.com/auth/cloud-platform.read-only" + ] + self.env_vars = [ + "RESOURCE_MANAGER_CREDENTIALS", + "RESOURCE_MANAGER_KEYFILE", + "GOOGLE_CLOUD_CREDENTIALS", + "GOOGLE_CLOUD_KEYFILE", + "GCLOUD_KEYFILE", + "RESOURCE_MANAGER_CREDENTIALS_JSON", + "RESOURCE_MANAGER_KEYFILE_JSON", + "GOOGLE_CLOUD_CREDENTIALS_JSON", + "GOOGLE_CLOUD_KEYFILE_JSON", + "GCLOUD_KEYFILE_JSON" + ] + self.paths = [ + "~/.config/google_cloud/application_default_credentials.json" + ] + end + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-resource_manager-v3/lib/google/cloud/resource_manager/v3/tag_holds/operations.rb b/owl-bot-staging/google-cloud-resource_manager-v3/lib/google/cloud/resource_manager/v3/tag_holds/operations.rb new file mode 100644 index 000000000000..297d89e18866 --- /dev/null +++ b/owl-bot-staging/google-cloud-resource_manager-v3/lib/google/cloud/resource_manager/v3/tag_holds/operations.rb @@ -0,0 +1,841 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +require "gapic/operation" +require "google/longrunning/operations_pb" + +module Google + module Cloud + module ResourceManager + module V3 + module TagHolds + # Service that implements Longrunning Operations API. + class Operations + # @private + API_VERSION = "" + + # @private + DEFAULT_ENDPOINT_TEMPLATE = "cloudresourcemanager.$UNIVERSE_DOMAIN$" + + # @private + attr_reader :operations_stub + + ## + # Configuration for the TagHolds 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 TagHolds 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::ResourceManager::V3::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::ResourceManager::V3::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::ResourceManager::V3::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::ResourceManager::V3::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::ResourceManager::V3::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 = "cloudresourcemanager.googleapis.com" + + config_attr :endpoint, nil, ::String, nil + config_attr :credentials, nil do |value| + allowed = [::String, ::Hash, ::Proc, ::Symbol, ::Google::Auth::Credentials, ::Google::Auth::BaseClient, ::Signet::OAuth2::Client, nil] + allowed += [::GRPC::Core::Channel, ::GRPC::Core::ChannelCredentials] if defined? ::GRPC::Core::Channel + allowed.any? { |klass| klass === value } + end + config_attr :scope, nil, ::String, ::Array, nil + config_attr :lib_name, nil, ::String, nil + config_attr :lib_version, nil, ::String, nil + config_attr(:channel_args, { "grpc.service_config_disable_resolution" => 1 }, ::Hash, nil) + config_attr :interceptors, nil, ::Array, nil + config_attr :timeout, nil, ::Numeric, nil + config_attr :metadata, nil, ::Hash, nil + config_attr :retry_policy, nil, ::Hash, ::Proc, nil + config_attr :quota_project, nil, ::String, nil + config_attr :universe_domain, nil, ::String, nil + config_attr :logger, :default, ::Logger, nil, :default + + # @private + def initialize parent_config = nil + @parent_config = parent_config unless parent_config.nil? + + yield self if block_given? + end + + ## + # Configurations for individual RPCs + # @return [Rpcs] + # + def rpcs + @rpcs ||= begin + parent_rpcs = nil + parent_rpcs = @parent_config.rpcs if defined?(@parent_config) && @parent_config.respond_to?(:rpcs) + Rpcs.new parent_rpcs + end + end + + ## + # Configuration for the channel pool + # @return [::Gapic::ServiceStub::ChannelPool::Configuration] + # + def channel_pool + @channel_pool ||= ::Gapic::ServiceStub::ChannelPool::Configuration.new + end + + ## + # Configuration RPC class for the Operations API. + # + # Includes fields providing the configuration for each RPC in this service. + # Each configuration object is of type `Gapic::Config::Method` and includes + # the following configuration fields: + # + # * `timeout` (*type:* `Numeric`) - The call timeout in seconds + # * `metadata` (*type:* `Hash{Symbol=>String}`) - Additional gRPC headers + # * `retry_policy (*type:* `Hash`) - The retry policy. The policy fields + # include the following keys: + # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds. + # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds. + # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier. + # * `:retry_codes` (*type:* `Array`) - The error codes that should + # trigger a retry. + # + class Rpcs + ## + # RPC-specific configuration for `list_operations` + # @return [::Gapic::Config::Method] + # + attr_reader :list_operations + ## + # RPC-specific configuration for `get_operation` + # @return [::Gapic::Config::Method] + # + attr_reader :get_operation + ## + # RPC-specific configuration for `delete_operation` + # @return [::Gapic::Config::Method] + # + attr_reader :delete_operation + ## + # RPC-specific configuration for `cancel_operation` + # @return [::Gapic::Config::Method] + # + attr_reader :cancel_operation + ## + # RPC-specific configuration for `wait_operation` + # @return [::Gapic::Config::Method] + # + attr_reader :wait_operation + + # @private + def initialize parent_rpcs = nil + list_operations_config = parent_rpcs.list_operations if parent_rpcs.respond_to? :list_operations + @list_operations = ::Gapic::Config::Method.new list_operations_config + get_operation_config = parent_rpcs.get_operation if parent_rpcs.respond_to? :get_operation + @get_operation = ::Gapic::Config::Method.new get_operation_config + delete_operation_config = parent_rpcs.delete_operation if parent_rpcs.respond_to? :delete_operation + @delete_operation = ::Gapic::Config::Method.new delete_operation_config + cancel_operation_config = parent_rpcs.cancel_operation if parent_rpcs.respond_to? :cancel_operation + @cancel_operation = ::Gapic::Config::Method.new cancel_operation_config + wait_operation_config = parent_rpcs.wait_operation if parent_rpcs.respond_to? :wait_operation + @wait_operation = ::Gapic::Config::Method.new wait_operation_config + + yield self if block_given? + end + end + end + end + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-resource_manager-v3/lib/google/cloud/resource_manager/v3/tag_holds/paths.rb b/owl-bot-staging/google-cloud-resource_manager-v3/lib/google/cloud/resource_manager/v3/tag_holds/paths.rb new file mode 100644 index 000000000000..ea7ad8358ce4 --- /dev/null +++ b/owl-bot-staging/google-cloud-resource_manager-v3/lib/google/cloud/resource_manager/v3/tag_holds/paths.rb @@ -0,0 +1,64 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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 ResourceManager + module V3 + module TagHolds + # Path helper methods for the TagHolds API. + module Paths + ## + # Create a fully-qualified TagHold resource string. + # + # The resource will be in the following format: + # + # `tagValues/{tag_value}/tagHolds/{tag_hold}` + # + # @param tag_value [String] + # @param tag_hold [String] + # + # @return [::String] + def tag_hold_path tag_value:, tag_hold: + raise ::ArgumentError, "tag_value cannot contain /" if tag_value.to_s.include? "/" + + "tagValues/#{tag_value}/tagHolds/#{tag_hold}" + end + + ## + # Create a fully-qualified TagValue resource string. + # + # The resource will be in the following format: + # + # `tagValues/{tag_value}` + # + # @param tag_value [String] + # + # @return [::String] + def tag_value_path tag_value: + "tagValues/#{tag_value}" + end + + extend self + end + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-resource_manager-v3/lib/google/cloud/resource_manager/v3/tag_holds/rest.rb b/owl-bot-staging/google-cloud-resource_manager-v3/lib/google/cloud/resource_manager/v3/tag_holds/rest.rb new file mode 100644 index 000000000000..47b03b2721f1 --- /dev/null +++ b/owl-bot-staging/google-cloud-resource_manager-v3/lib/google/cloud/resource_manager/v3/tag_holds/rest.rb @@ -0,0 +1,57 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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/resource_manager/v3/version" + +require "google/cloud/resource_manager/v3/tag_holds/credentials" +require "google/cloud/resource_manager/v3/tag_holds/paths" +require "google/cloud/resource_manager/v3/tag_holds/rest/operations" +require "google/cloud/resource_manager/v3/tag_holds/rest/client" + +module Google + module Cloud + module ResourceManager + module V3 + ## + # Allow users to create and manage TagHolds for TagValues. TagHolds represent + # the use of a Tag Value that is not captured by TagBindings but + # should still block TagValue deletion (such as a reference in a policy + # condition). This service provides isolated failure domains by cloud location + # so that TagHolds can be managed in the same location as their usage. + # + # To load this service and instantiate a REST client: + # + # require "google/cloud/resource_manager/v3/tag_holds/rest" + # client = ::Google::Cloud::ResourceManager::V3::TagHolds::Rest::Client.new + # + module TagHolds + # Client for the REST transport + module Rest + end + end + end + end + end +end + +helper_path = ::File.join __dir__, "rest", "helpers.rb" +require "google/cloud/resource_manager/v3/tag_holds/rest/helpers" if ::File.file? helper_path diff --git a/owl-bot-staging/google-cloud-resource_manager-v3/lib/google/cloud/resource_manager/v3/tag_holds/rest/client.rb b/owl-bot-staging/google-cloud-resource_manager-v3/lib/google/cloud/resource_manager/v3/tag_holds/rest/client.rb new file mode 100644 index 000000000000..a3741d8b8416 --- /dev/null +++ b/owl-bot-staging/google-cloud-resource_manager-v3/lib/google/cloud/resource_manager/v3/tag_holds/rest/client.rb @@ -0,0 +1,667 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +require "google/cloud/errors" +require "google/cloud/resourcemanager/v3/tag_holds_pb" +require "google/cloud/resource_manager/v3/tag_holds/rest/service_stub" + +module Google + module Cloud + module ResourceManager + module V3 + module TagHolds + module Rest + ## + # REST client for the TagHolds service. + # + # Allow users to create and manage TagHolds for TagValues. TagHolds represent + # the use of a Tag Value that is not captured by TagBindings but + # should still block TagValue deletion (such as a reference in a policy + # condition). This service provides isolated failure domains by cloud location + # so that TagHolds can be managed in the same location as their usage. + # + class Client + # @private + API_VERSION = "" + + # @private + DEFAULT_ENDPOINT_TEMPLATE = "cloudresourcemanager.$UNIVERSE_DOMAIN$" + + include Paths + + # @private + attr_reader :tag_holds_stub + + ## + # Configure the TagHolds Client class. + # + # See {::Google::Cloud::ResourceManager::V3::TagHolds::Rest::Client::Configuration} + # for a description of the configuration fields. + # + # @example + # + # # Modify the configuration for all TagHolds clients + # ::Google::Cloud::ResourceManager::V3::TagHolds::Rest::Client.configure do |config| + # config.timeout = 10.0 + # end + # + # @yield [config] Configure the Client client. + # @yieldparam config [Client::Configuration] + # + # @return [Client::Configuration] + # + def self.configure + @configure ||= begin + namespace = ["Google", "Cloud", "ResourceManager", "V3"] + parent_config = while namespace.any? + parent_name = namespace.join "::" + parent_const = const_get parent_name + break parent_const.configure if parent_const.respond_to? :configure + namespace.pop + end + default_config = Client::Configuration.new parent_config + + default_config + end + yield @configure if block_given? + @configure + end + + ## + # Configure the TagHolds Client instance. + # + # The configuration is set to the derived mode, meaning that values can be changed, + # but structural changes (adding new fields, etc.) are not allowed. Structural changes + # should be made on {Client.configure}. + # + # See {::Google::Cloud::ResourceManager::V3::TagHolds::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 + @tag_holds_stub.universe_domain + end + + ## + # Create a new TagHolds REST client object. + # + # @example + # + # # Create a client using the default configuration + # client = ::Google::Cloud::ResourceManager::V3::TagHolds::Rest::Client.new + # + # # Create a client using a custom configuration + # client = ::Google::Cloud::ResourceManager::V3::TagHolds::Rest::Client.new do |config| + # config.timeout = 10.0 + # end + # + # @yield [config] Configure the TagHolds client. + # @yieldparam config [Client::Configuration] + # + def initialize + # Create the configuration object + @config = Configuration.new Client.configure + + # Yield the configuration if needed + yield @config if block_given? + + # Create credentials + credentials = @config.credentials + # Use self-signed JWT if the endpoint is unchanged from default, + # but only if the default endpoint does not have a region prefix. + enable_self_signed_jwt = @config.endpoint.nil? || + (@config.endpoint == Configuration::DEFAULT_ENDPOINT && + !@config.endpoint.split(".").first.include?("-")) + credentials ||= Credentials.default scope: @config.scope, + enable_self_signed_jwt: enable_self_signed_jwt + if credentials.is_a?(::String) || credentials.is_a?(::Hash) + credentials = Credentials.new credentials, scope: @config.scope + end + + @quota_project_id = @config.quota_project + @quota_project_id ||= credentials.quota_project_id if credentials.respond_to? :quota_project_id + + @operations_client = ::Google::Cloud::ResourceManager::V3::TagHolds::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 + + @tag_holds_stub = ::Google::Cloud::ResourceManager::V3::TagHolds::Rest::ServiceStub.new( + endpoint: @config.endpoint, + endpoint_template: DEFAULT_ENDPOINT_TEMPLATE, + universe_domain: @config.universe_domain, + credentials: credentials, + logger: @config.logger + ) + + @tag_holds_stub.logger(stub: true)&.info do |entry| + entry.set_system_name + entry.set_service + entry.message = "Created client for #{entry.service}" + entry.set_credentials_fields credentials + entry.set "customEndpoint", @config.endpoint if @config.endpoint + entry.set "defaultTimeout", @config.timeout if @config.timeout + entry.set "quotaProject", @quota_project_id if @quota_project_id + end + end + + ## + # Get the associated client for long-running operations. + # + # @return [::Google::Cloud::ResourceManager::V3::TagHolds::Rest::Operations] + # + attr_reader :operations_client + + ## + # The logger used for request/response debug logging. + # + # @return [Logger] + # + def logger + @tag_holds_stub.logger + end + + # Service calls + + ## + # Creates a TagHold. Returns ALREADY_EXISTS if a TagHold with the same + # resource and origin exists under the same TagValue. + # + # @overload create_tag_hold(request, options = nil) + # Pass arguments to `create_tag_hold` via a request object, either of type + # {::Google::Cloud::ResourceManager::V3::CreateTagHoldRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::ResourceManager::V3::CreateTagHoldRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_tag_hold(parent: nil, tag_hold: nil, validate_only: nil) + # Pass arguments to `create_tag_hold` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param parent [::String] + # Required. The resource name of the TagHold's parent TagValue. Must be of + # the form: `tagValues/{tag-value-id}`. + # @param tag_hold [::Google::Cloud::ResourceManager::V3::TagHold, ::Hash] + # Required. The TagHold to be created. + # @param validate_only [::Boolean] + # Optional. Set to true to perform the validations necessary for creating the + # resource, but not actually perform the action. + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Gapic::Operation] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Gapic::Operation] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/resource_manager/v3" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::ResourceManager::V3::TagHolds::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::ResourceManager::V3::CreateTagHoldRequest.new + # + # # Call the create_tag_hold method. + # result = client.create_tag_hold 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_tag_hold request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::ResourceManager::V3::CreateTagHoldRequest + + # Converts hash 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_tag_hold.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::ResourceManager::V3::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_tag_hold.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.create_tag_hold.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @tag_holds_stub.create_tag_hold 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 TagHold. + # + # @overload delete_tag_hold(request, options = nil) + # Pass arguments to `delete_tag_hold` via a request object, either of type + # {::Google::Cloud::ResourceManager::V3::DeleteTagHoldRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::ResourceManager::V3::DeleteTagHoldRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_tag_hold(name: nil, validate_only: nil) + # Pass arguments to `delete_tag_hold` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param name [::String] + # Required. The resource name of the TagHold to delete. Must be of the form: + # `tagValues/{tag-value-id}/tagHolds/{tag-hold-id}`. + # @param validate_only [::Boolean] + # Optional. Set to true to perform the validations necessary for deleting the + # resource, but not actually perform the action. + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Gapic::Operation] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Gapic::Operation] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/resource_manager/v3" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::ResourceManager::V3::TagHolds::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::ResourceManager::V3::DeleteTagHoldRequest.new + # + # # Call the delete_tag_hold method. + # result = client.delete_tag_hold 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_tag_hold request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::ResourceManager::V3::DeleteTagHoldRequest + + # Converts hash 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_tag_hold.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::ResourceManager::V3::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_tag_hold.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.delete_tag_hold.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @tag_holds_stub.delete_tag_hold 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 TagHolds under a TagValue. + # + # @overload list_tag_holds(request, options = nil) + # Pass arguments to `list_tag_holds` via a request object, either of type + # {::Google::Cloud::ResourceManager::V3::ListTagHoldsRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::ResourceManager::V3::ListTagHoldsRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_tag_holds(parent: nil, page_size: nil, page_token: nil, filter: nil) + # Pass arguments to `list_tag_holds` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param parent [::String] + # Required. The resource name of the parent TagValue. Must be of the form: + # `tagValues/{tag-value-id}`. + # @param page_size [::Integer] + # Optional. The maximum number of TagHolds to return in the response. The + # server allows a maximum of 300 TagHolds to return. If unspecified, the + # server will use 100 as the default. + # @param page_token [::String] + # Optional. A pagination token returned from a previous call to + # `ListTagHolds` that indicates where this listing should continue from. + # @param filter [::String] + # Optional. Criteria used to select a subset of TagHolds parented by the + # TagValue to return. This field follows the syntax defined by aip.dev/160; + # the `holder` and `origin` fields are supported for filtering. Currently + # only `AND` syntax is supported. Some example queries are: + # + # * `holder = + # //compute.googleapis.com/compute/projects/myproject/regions/us-east-1/instanceGroupManagers/instance-group` + # * `origin = 35678234` + # * `holder = + # //compute.googleapis.com/compute/projects/myproject/regions/us-east-1/instanceGroupManagers/instance-group + # AND origin = 35678234` + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Gapic::Rest::PagedEnumerable<::Google::Cloud::ResourceManager::V3::TagHold>] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Gapic::Rest::PagedEnumerable<::Google::Cloud::ResourceManager::V3::TagHold>] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/resource_manager/v3" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::ResourceManager::V3::TagHolds::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::ResourceManager::V3::ListTagHoldsRequest.new + # + # # Call the list_tag_holds method. + # result = client.list_tag_holds request + # + # # The returned object is of type Gapic::PagedEnumerable. You can iterate + # # over elements, and API calls will be issued to fetch pages as needed. + # result.each do |item| + # # Each element is of type ::Google::Cloud::ResourceManager::V3::TagHold. + # p item + # end + # + def list_tag_holds request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::ResourceManager::V3::ListTagHoldsRequest + + # Converts hash 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_tag_holds.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::ResourceManager::V3::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_tag_holds.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.list_tag_holds.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @tag_holds_stub.list_tag_holds request, options do |result, operation| + result = ::Gapic::Rest::PagedEnumerable.new @tag_holds_stub, :list_tag_holds, "tag_holds", 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 TagHolds REST API. + # + # This class represents the configuration for TagHolds REST, + # providing control over timeouts, retry behavior, logging, transport + # parameters, and other low-level controls. Certain parameters can also be + # applied individually to specific RPCs. See + # {::Google::Cloud::ResourceManager::V3::TagHolds::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_tag_hold to 20 seconds, + # # and all remaining timeouts to 10 seconds. + # ::Google::Cloud::ResourceManager::V3::TagHolds::Rest::Client.configure do |config| + # config.timeout = 10.0 + # config.rpcs.create_tag_hold.timeout = 20.0 + # end + # + # # Apply the above configuration only to a new client. + # client = ::Google::Cloud::ResourceManager::V3::TagHolds::Rest::Client.new do |config| + # config.timeout = 10.0 + # config.rpcs.create_tag_hold.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 = "cloudresourcemanager.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 TagHolds 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_tag_hold` + # @return [::Gapic::Config::Method] + # + attr_reader :create_tag_hold + ## + # RPC-specific configuration for `delete_tag_hold` + # @return [::Gapic::Config::Method] + # + attr_reader :delete_tag_hold + ## + # RPC-specific configuration for `list_tag_holds` + # @return [::Gapic::Config::Method] + # + attr_reader :list_tag_holds + + # @private + def initialize parent_rpcs = nil + create_tag_hold_config = parent_rpcs.create_tag_hold if parent_rpcs.respond_to? :create_tag_hold + @create_tag_hold = ::Gapic::Config::Method.new create_tag_hold_config + delete_tag_hold_config = parent_rpcs.delete_tag_hold if parent_rpcs.respond_to? :delete_tag_hold + @delete_tag_hold = ::Gapic::Config::Method.new delete_tag_hold_config + list_tag_holds_config = parent_rpcs.list_tag_holds if parent_rpcs.respond_to? :list_tag_holds + @list_tag_holds = ::Gapic::Config::Method.new list_tag_holds_config + + yield self if block_given? + end + end + end + end + end + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-resource_manager-v3/lib/google/cloud/resource_manager/v3/tag_holds/rest/operations.rb b/owl-bot-staging/google-cloud-resource_manager-v3/lib/google/cloud/resource_manager/v3/tag_holds/rest/operations.rb new file mode 100644 index 000000000000..190a3bbfc666 --- /dev/null +++ b/owl-bot-staging/google-cloud-resource_manager-v3/lib/google/cloud/resource_manager/v3/tag_holds/rest/operations.rb @@ -0,0 +1,925 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +require "gapic/operation" + +module Google + module Cloud + module ResourceManager + module V3 + module TagHolds + module Rest + # Service that implements Longrunning Operations API. + class Operations + # @private + API_VERSION = "" + + # @private + DEFAULT_ENDPOINT_TEMPLATE = "cloudresourcemanager.$UNIVERSE_DOMAIN$" + + # @private + attr_reader :operations_stub + + ## + # Configuration for the TagHolds 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 TagHolds 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::ResourceManager::V3::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::ResourceManager::V3::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::ResourceManager::V3::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::ResourceManager::V3::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 = "cloudresourcemanager.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: "/v3/{name}", + matches: [ + ["name", %r{^operations(?:/.*)?$}, true] + ] + ) + 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 +end diff --git a/owl-bot-staging/google-cloud-resource_manager-v3/lib/google/cloud/resource_manager/v3/tag_holds/rest/service_stub.rb b/owl-bot-staging/google-cloud-resource_manager-v3/lib/google/cloud/resource_manager/v3/tag_holds/rest/service_stub.rb new file mode 100644 index 000000000000..c839e05338b9 --- /dev/null +++ b/owl-bot-staging/google-cloud-resource_manager-v3/lib/google/cloud/resource_manager/v3/tag_holds/rest/service_stub.rb @@ -0,0 +1,265 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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/resourcemanager/v3/tag_holds_pb" + +module Google + module Cloud + module ResourceManager + module V3 + module TagHolds + module Rest + ## + # REST service stub for the TagHolds 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_tag_hold REST call + # + # @param request_pb [::Google::Cloud::ResourceManager::V3::CreateTagHoldRequest] + # 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_tag_hold request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_create_tag_hold_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_tag_hold", + 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_tag_hold REST call + # + # @param request_pb [::Google::Cloud::ResourceManager::V3::DeleteTagHoldRequest] + # 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_tag_hold request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_delete_tag_hold_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_tag_hold", + 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_tag_holds REST call + # + # @param request_pb [::Google::Cloud::ResourceManager::V3::ListTagHoldsRequest] + # A request object representing the call parameters. Required. + # @param options [::Gapic::CallOptions] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Cloud::ResourceManager::V3::ListTagHoldsResponse] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::ResourceManager::V3::ListTagHoldsResponse] + # A result object deserialized from the server's reply + def list_tag_holds request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_list_tag_holds_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_tag_holds", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Cloud::ResourceManager::V3::ListTagHoldsResponse.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_tag_hold REST call + # + # @param request_pb [::Google::Cloud::ResourceManager::V3::CreateTagHoldRequest] + # 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_tag_hold_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :post, + uri_template: "/v3/{parent}/tagHolds", + body: "tag_hold", + matches: [ + ["parent", %r{^tagValues/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the delete_tag_hold REST call + # + # @param request_pb [::Google::Cloud::ResourceManager::V3::DeleteTagHoldRequest] + # 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_tag_hold_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :delete, + uri_template: "/v3/{name}", + matches: [ + ["name", %r{^tagValues/[^/]+/tagHolds/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the list_tag_holds REST call + # + # @param request_pb [::Google::Cloud::ResourceManager::V3::ListTagHoldsRequest] + # 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_tag_holds_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :get, + uri_template: "/v3/{parent}/tagHolds", + matches: [ + ["parent", %r{^tagValues/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + end + end + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-resource_manager-v3/lib/google/cloud/resource_manager/v3/tag_keys.rb b/owl-bot-staging/google-cloud-resource_manager-v3/lib/google/cloud/resource_manager/v3/tag_keys.rb new file mode 100644 index 000000000000..0829e8b4bf11 --- /dev/null +++ b/owl-bot-staging/google-cloud-resource_manager-v3/lib/google/cloud/resource_manager/v3/tag_keys.rb @@ -0,0 +1,56 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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/resource_manager/v3/version" + +require "google/cloud/resource_manager/v3/tag_keys/credentials" +require "google/cloud/resource_manager/v3/tag_keys/paths" +require "google/cloud/resource_manager/v3/tag_keys/operations" +require "google/cloud/resource_manager/v3/tag_keys/client" +require "google/cloud/resource_manager/v3/tag_keys/rest" + +module Google + module Cloud + module ResourceManager + module V3 + ## + # Allow users to create and manage tag keys. + # + # @example Load this service and instantiate a gRPC client + # + # require "google/cloud/resource_manager/v3/tag_keys" + # client = ::Google::Cloud::ResourceManager::V3::TagKeys::Client.new + # + # @example Load this service and instantiate a REST client + # + # require "google/cloud/resource_manager/v3/tag_keys/rest" + # client = ::Google::Cloud::ResourceManager::V3::TagKeys::Rest::Client.new + # + module TagKeys + end + end + end + end +end + +helper_path = ::File.join __dir__, "tag_keys", "helpers.rb" +require "google/cloud/resource_manager/v3/tag_keys/helpers" if ::File.file? helper_path diff --git a/owl-bot-staging/google-cloud-resource_manager-v3/lib/google/cloud/resource_manager/v3/tag_keys/client.rb b/owl-bot-staging/google-cloud-resource_manager-v3/lib/google/cloud/resource_manager/v3/tag_keys/client.rb new file mode 100644 index 000000000000..7e46ff3cd69f --- /dev/null +++ b/owl-bot-staging/google-cloud-resource_manager-v3/lib/google/cloud/resource_manager/v3/tag_keys/client.rb @@ -0,0 +1,1333 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +require "google/cloud/errors" +require "google/cloud/resourcemanager/v3/tag_keys_pb" + +module Google + module Cloud + module ResourceManager + module V3 + module TagKeys + ## + # Client for the TagKeys service. + # + # Allow users to create and manage tag keys. + # + class Client + # @private + API_VERSION = "" + + # @private + DEFAULT_ENDPOINT_TEMPLATE = "cloudresourcemanager.$UNIVERSE_DOMAIN$" + + include Paths + + # @private + attr_reader :tag_keys_stub + + ## + # Configure the TagKeys Client class. + # + # See {::Google::Cloud::ResourceManager::V3::TagKeys::Client::Configuration} + # for a description of the configuration fields. + # + # @example + # + # # Modify the configuration for all TagKeys clients + # ::Google::Cloud::ResourceManager::V3::TagKeys::Client.configure do |config| + # config.timeout = 10.0 + # end + # + # @yield [config] Configure the Client client. + # @yieldparam config [Client::Configuration] + # + # @return [Client::Configuration] + # + def self.configure + @configure ||= begin + namespace = ["Google", "Cloud", "ResourceManager", "V3"] + parent_config = while namespace.any? + parent_name = namespace.join "::" + parent_const = const_get parent_name + break parent_const.configure if parent_const.respond_to? :configure + namespace.pop + end + default_config = Client::Configuration.new parent_config + + default_config.rpcs.list_tag_keys.timeout = 60.0 + default_config.rpcs.list_tag_keys.retry_policy = { + initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [14] + } + + default_config.rpcs.get_tag_key.timeout = 60.0 + default_config.rpcs.get_tag_key.retry_policy = { + initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [14] + } + + default_config.rpcs.create_tag_key.timeout = 60.0 + + default_config.rpcs.update_tag_key.timeout = 60.0 + + default_config.rpcs.delete_tag_key.timeout = 60.0 + + default_config.rpcs.get_iam_policy.timeout = 60.0 + default_config.rpcs.get_iam_policy.retry_policy = { + initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [14] + } + + default_config.rpcs.set_iam_policy.timeout = 60.0 + + default_config + end + yield @configure if block_given? + @configure + end + + ## + # Configure the TagKeys Client instance. + # + # The configuration is set to the derived mode, meaning that values can be changed, + # but structural changes (adding new fields, etc.) are not allowed. Structural changes + # should be made on {Client.configure}. + # + # See {::Google::Cloud::ResourceManager::V3::TagKeys::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 + @tag_keys_stub.universe_domain + end + + ## + # Create a new TagKeys client object. + # + # @example + # + # # Create a client using the default configuration + # client = ::Google::Cloud::ResourceManager::V3::TagKeys::Client.new + # + # # Create a client using a custom configuration + # client = ::Google::Cloud::ResourceManager::V3::TagKeys::Client.new do |config| + # config.timeout = 10.0 + # end + # + # @yield [config] Configure the TagKeys client. + # @yieldparam config [Client::Configuration] + # + def initialize + # These require statements are intentionally placed here to initialize + # the gRPC module only when it's required. + # See https://github.com/googleapis/toolkit/issues/446 + require "gapic/grpc" + require "google/cloud/resourcemanager/v3/tag_keys_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 + + @tag_keys_stub = ::Gapic::ServiceStub.new( + ::Google::Cloud::ResourceManager::V3::TagKeys::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 + ) + + @tag_keys_stub.stub_logger&.info do |entry| + entry.set_system_name + entry.set_service + entry.message = "Created client for #{entry.service}" + entry.set_credentials_fields credentials + entry.set "customEndpoint", @config.endpoint if @config.endpoint + entry.set "defaultTimeout", @config.timeout if @config.timeout + entry.set "quotaProject", @quota_project_id if @quota_project_id + end + end + + ## + # Get the associated client for long-running operations. + # + # @return [::Google::Cloud::ResourceManager::V3::TagKeys::Operations] + # + attr_reader :operations_client + + ## + # The logger used for request/response debug logging. + # + # @return [Logger] + # + def logger + @tag_keys_stub.logger + end + + # Service calls + + ## + # Lists all TagKeys for a parent resource. + # + # @overload list_tag_keys(request, options = nil) + # Pass arguments to `list_tag_keys` via a request object, either of type + # {::Google::Cloud::ResourceManager::V3::ListTagKeysRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::ResourceManager::V3::ListTagKeysRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_tag_keys(parent: nil, page_size: nil, page_token: nil) + # Pass arguments to `list_tag_keys` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param parent [::String] + # Required. The resource name of the TagKey's parent. + # Must be of the form `organizations/{org_id}` or `projects/{project_id}` or + # `projects/{project_number}` + # @param page_size [::Integer] + # Optional. The maximum number of TagKeys to return in the response. The + # server allows a maximum of 300 TagKeys to return. If unspecified, the + # server will use 100 as the default. + # @param page_token [::String] + # Optional. A pagination token returned from a previous call to `ListTagKey` + # that indicates where this listing should continue from. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Gapic::PagedEnumerable<::Google::Cloud::ResourceManager::V3::TagKey>] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Gapic::PagedEnumerable<::Google::Cloud::ResourceManager::V3::TagKey>] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/resource_manager/v3" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::ResourceManager::V3::TagKeys::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::ResourceManager::V3::ListTagKeysRequest.new + # + # # Call the list_tag_keys method. + # result = client.list_tag_keys request + # + # # The returned object is of type Gapic::PagedEnumerable. You can iterate + # # over elements, and API calls will be issued to fetch pages as needed. + # result.each do |item| + # # Each element is of type ::Google::Cloud::ResourceManager::V3::TagKey. + # p item + # end + # + def list_tag_keys request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::ResourceManager::V3::ListTagKeysRequest + + # Converts hash 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_tag_keys.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::ResourceManager::V3::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.list_tag_keys.timeout, + metadata: metadata, + retry_policy: @config.rpcs.list_tag_keys.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @tag_keys_stub.call_rpc :list_tag_keys, request, options: options do |response, operation| + response = ::Gapic::PagedEnumerable.new @tag_keys_stub, :list_tag_keys, 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 + + ## + # Retrieves a TagKey. This method will return `PERMISSION_DENIED` if the + # key does not exist or the user does not have permission to view it. + # + # @overload get_tag_key(request, options = nil) + # Pass arguments to `get_tag_key` via a request object, either of type + # {::Google::Cloud::ResourceManager::V3::GetTagKeyRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::ResourceManager::V3::GetTagKeyRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_tag_key(name: nil) + # Pass arguments to `get_tag_key` via keyword arguments. Note that at + # least one keyword argument is 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. A resource name in the format `tagKeys/{id}`, such as + # `tagKeys/123`. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Google::Cloud::ResourceManager::V3::TagKey] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Google::Cloud::ResourceManager::V3::TagKey] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/resource_manager/v3" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::ResourceManager::V3::TagKeys::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::ResourceManager::V3::GetTagKeyRequest.new + # + # # Call the get_tag_key method. + # result = client.get_tag_key request + # + # # The returned object is of type Google::Cloud::ResourceManager::V3::TagKey. + # p result + # + def get_tag_key request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::ResourceManager::V3::GetTagKeyRequest + + # Converts hash 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_tag_key.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::ResourceManager::V3::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_tag_key.timeout, + metadata: metadata, + retry_policy: @config.rpcs.get_tag_key.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @tag_keys_stub.call_rpc :get_tag_key, request, options: options do |response, operation| + yield response, operation if block_given? + end + rescue ::GRPC::BadStatus => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Retrieves a TagKey by its namespaced name. + # This method will return `PERMISSION_DENIED` if the key does not exist + # or the user does not have permission to view it. + # + # @overload get_namespaced_tag_key(request, options = nil) + # Pass arguments to `get_namespaced_tag_key` via a request object, either of type + # {::Google::Cloud::ResourceManager::V3::GetNamespacedTagKeyRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::ResourceManager::V3::GetNamespacedTagKeyRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_namespaced_tag_key(name: nil) + # Pass arguments to `get_namespaced_tag_key` via keyword arguments. Note that at + # least one keyword argument is 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. A namespaced tag key name in the format + # `{parentId}/{tagKeyShort}`, such as `42/foo` for a key with short name + # "foo" under the organization with ID 42 or `r2-d2/bar` for a key with short + # name "bar" under the project `r2-d2`. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Google::Cloud::ResourceManager::V3::TagKey] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Google::Cloud::ResourceManager::V3::TagKey] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/resource_manager/v3" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::ResourceManager::V3::TagKeys::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::ResourceManager::V3::GetNamespacedTagKeyRequest.new + # + # # Call the get_namespaced_tag_key method. + # result = client.get_namespaced_tag_key request + # + # # The returned object is of type Google::Cloud::ResourceManager::V3::TagKey. + # p result + # + def get_namespaced_tag_key request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::ResourceManager::V3::GetNamespacedTagKeyRequest + + # Converts hash 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_namespaced_tag_key.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::ResourceManager::V3::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.get_namespaced_tag_key.timeout, + metadata: metadata, + retry_policy: @config.rpcs.get_namespaced_tag_key.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @tag_keys_stub.call_rpc :get_namespaced_tag_key, request, options: options do |response, operation| + yield response, operation if block_given? + end + rescue ::GRPC::BadStatus => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Creates a new TagKey. If another request with the same parameters is + # sent while the original request is in process, the second request + # will receive an error. A maximum of 1000 TagKeys can exist under a parent + # at any given time. + # + # @overload create_tag_key(request, options = nil) + # Pass arguments to `create_tag_key` via a request object, either of type + # {::Google::Cloud::ResourceManager::V3::CreateTagKeyRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::ResourceManager::V3::CreateTagKeyRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_tag_key(tag_key: nil, validate_only: nil) + # Pass arguments to `create_tag_key` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param tag_key [::Google::Cloud::ResourceManager::V3::TagKey, ::Hash] + # Required. The TagKey to be created. Only fields `short_name`, + # `description`, and `parent` are considered during the creation request. + # @param validate_only [::Boolean] + # Optional. Set to true to perform validations necessary for creating the + # resource, but not actually perform the action. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Gapic::Operation] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Gapic::Operation] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/resource_manager/v3" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::ResourceManager::V3::TagKeys::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::ResourceManager::V3::CreateTagKeyRequest.new + # + # # Call the create_tag_key method. + # result = client.create_tag_key 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_tag_key request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::ResourceManager::V3::CreateTagKeyRequest + + # Converts hash 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_tag_key.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::ResourceManager::V3::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.create_tag_key.timeout, + metadata: metadata, + retry_policy: @config.rpcs.create_tag_key.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @tag_keys_stub.call_rpc :create_tag_key, request, options: options do |response, operation| + response = ::Gapic::Operation.new response, @operations_client, options: options + yield response, operation if block_given? + throw :response, response + end + rescue ::GRPC::BadStatus => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Updates the attributes of the TagKey resource. + # + # @overload update_tag_key(request, options = nil) + # Pass arguments to `update_tag_key` via a request object, either of type + # {::Google::Cloud::ResourceManager::V3::UpdateTagKeyRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::ResourceManager::V3::UpdateTagKeyRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_tag_key(tag_key: nil, update_mask: nil, validate_only: nil) + # Pass arguments to `update_tag_key` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param tag_key [::Google::Cloud::ResourceManager::V3::TagKey, ::Hash] + # Required. The new definition of the TagKey. Only the `description` and + # `etag` fields can be updated by this request. If the `etag` field is not + # empty, it must match the `etag` field of the existing tag key. Otherwise, + # `ABORTED` will be returned. + # @param update_mask [::Google::Protobuf::FieldMask, ::Hash] + # Fields to be updated. The mask may only contain `description` or + # `etag`. If omitted entirely, both `description` and `etag` are assumed to + # be significant. + # @param validate_only [::Boolean] + # Set as true to perform validations necessary for updating the resource, but + # not actually perform the action. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Gapic::Operation] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Gapic::Operation] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/resource_manager/v3" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::ResourceManager::V3::TagKeys::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::ResourceManager::V3::UpdateTagKeyRequest.new + # + # # Call the update_tag_key method. + # result = client.update_tag_key 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_tag_key request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::ResourceManager::V3::UpdateTagKeyRequest + + # Converts hash 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_tag_key.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::ResourceManager::V3::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.tag_key&.name + header_params["tag_key.name"] = request.tag_key.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_tag_key.timeout, + metadata: metadata, + retry_policy: @config.rpcs.update_tag_key.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @tag_keys_stub.call_rpc :update_tag_key, 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 TagKey. The TagKey cannot be deleted if it has any child + # TagValues. + # + # @overload delete_tag_key(request, options = nil) + # Pass arguments to `delete_tag_key` via a request object, either of type + # {::Google::Cloud::ResourceManager::V3::DeleteTagKeyRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::ResourceManager::V3::DeleteTagKeyRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_tag_key(name: nil, validate_only: nil, etag: nil) + # Pass arguments to `delete_tag_key` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param name [::String] + # Required. The resource name of a TagKey to be deleted in the format + # `tagKeys/123`. The TagKey cannot be a parent of any existing TagValues or + # it will not be deleted successfully. + # @param validate_only [::Boolean] + # Optional. Set as true to perform validations necessary for deletion, but + # not actually perform the action. + # @param etag [::String] + # Optional. The etag known to the client for the expected state of the + # TagKey. This is to be used for optimistic concurrency. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Gapic::Operation] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Gapic::Operation] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/resource_manager/v3" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::ResourceManager::V3::TagKeys::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::ResourceManager::V3::DeleteTagKeyRequest.new + # + # # Call the delete_tag_key method. + # result = client.delete_tag_key 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_tag_key request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::ResourceManager::V3::DeleteTagKeyRequest + + # Converts hash 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_tag_key.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::ResourceManager::V3::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_tag_key.timeout, + metadata: metadata, + retry_policy: @config.rpcs.delete_tag_key.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @tag_keys_stub.call_rpc :delete_tag_key, 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 the access control policy for a TagKey. The returned policy may be + # empty if no such policy or resource exists. The `resource` field should + # be the TagKey's resource name. For example, "tagKeys/1234". + # The caller must have + # `cloudresourcemanager.googleapis.com/tagKeys.getIamPolicy` permission on + # the specified TagKey. + # + # @overload get_iam_policy(request, options = nil) + # Pass arguments to `get_iam_policy` via a request object, either of type + # {::Google::Iam::V1::GetIamPolicyRequest} or an equivalent Hash. + # + # @param request [::Google::Iam::V1::GetIamPolicyRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. + # + # @overload get_iam_policy(resource: nil, options: nil) + # Pass arguments to `get_iam_policy` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param resource [::String] + # REQUIRED: The resource for which the policy is being requested. + # See the operation documentation for the appropriate value for this field. + # @param options [::Google::Iam::V1::GetPolicyOptions, ::Hash] + # OPTIONAL: A `GetPolicyOptions` object for specifying options to + # `GetIamPolicy`. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Google::Iam::V1::Policy] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Google::Iam::V1::Policy] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/resource_manager/v3" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::ResourceManager::V3::TagKeys::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Iam::V1::GetIamPolicyRequest.new + # + # # Call the get_iam_policy method. + # result = client.get_iam_policy request + # + # # The returned object is of type Google::Iam::V1::Policy. + # p result + # + def get_iam_policy request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Iam::V1::GetIamPolicyRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + metadata = @config.rpcs.get_iam_policy.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::ResourceManager::V3::VERSION + metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.resource + header_params["resource"] = request.resource + end + + request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") + metadata[:"x-goog-request-params"] ||= request_params_header + + options.apply_defaults timeout: @config.rpcs.get_iam_policy.timeout, + metadata: metadata, + retry_policy: @config.rpcs.get_iam_policy.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @tag_keys_stub.call_rpc :get_iam_policy, request, options: options do |response, operation| + yield response, operation if block_given? + end + rescue ::GRPC::BadStatus => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Sets the access control policy on a TagKey, replacing any existing + # policy. The `resource` field should be the TagKey's resource name. + # For example, "tagKeys/1234". + # The caller must have `resourcemanager.tagKeys.setIamPolicy` permission + # on the identified tagValue. + # + # @overload set_iam_policy(request, options = nil) + # Pass arguments to `set_iam_policy` via a request object, either of type + # {::Google::Iam::V1::SetIamPolicyRequest} or an equivalent Hash. + # + # @param request [::Google::Iam::V1::SetIamPolicyRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. + # + # @overload set_iam_policy(resource: nil, policy: nil, update_mask: nil) + # Pass arguments to `set_iam_policy` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param resource [::String] + # REQUIRED: The resource for which the policy is being specified. + # See the operation documentation for the appropriate value for this field. + # @param policy [::Google::Iam::V1::Policy, ::Hash] + # REQUIRED: The complete policy to be applied to the `resource`. The size of + # the policy is limited to a few 10s of KB. An empty policy is a + # valid policy but certain Cloud Platform services (such as Projects) + # might reject them. + # @param update_mask [::Google::Protobuf::FieldMask, ::Hash] + # OPTIONAL: A FieldMask specifying which fields of the policy to modify. Only + # the fields in the mask will be modified. If no mask is provided, the + # following default mask is used: + # + # `paths: "bindings, etag"` + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Google::Iam::V1::Policy] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Google::Iam::V1::Policy] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/resource_manager/v3" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::ResourceManager::V3::TagKeys::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Iam::V1::SetIamPolicyRequest.new + # + # # Call the set_iam_policy method. + # result = client.set_iam_policy request + # + # # The returned object is of type Google::Iam::V1::Policy. + # p result + # + def set_iam_policy request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Iam::V1::SetIamPolicyRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + metadata = @config.rpcs.set_iam_policy.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::ResourceManager::V3::VERSION + metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.resource + header_params["resource"] = request.resource + end + + request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") + metadata[:"x-goog-request-params"] ||= request_params_header + + options.apply_defaults timeout: @config.rpcs.set_iam_policy.timeout, + metadata: metadata, + retry_policy: @config.rpcs.set_iam_policy.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @tag_keys_stub.call_rpc :set_iam_policy, request, options: options do |response, operation| + yield response, operation if block_given? + end + rescue ::GRPC::BadStatus => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Returns permissions that a caller has on the specified TagKey. + # The `resource` field should be the TagKey's resource name. + # For example, "tagKeys/1234". + # + # There are no permissions required for making this API call. + # + # @overload test_iam_permissions(request, options = nil) + # Pass arguments to `test_iam_permissions` via a request object, either of type + # {::Google::Iam::V1::TestIamPermissionsRequest} or an equivalent Hash. + # + # @param request [::Google::Iam::V1::TestIamPermissionsRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. + # + # @overload test_iam_permissions(resource: nil, permissions: nil) + # Pass arguments to `test_iam_permissions` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param resource [::String] + # REQUIRED: The resource for which the policy detail is being requested. + # See the operation documentation for the appropriate value for this field. + # @param permissions [::Array<::String>] + # The set of permissions to check for the `resource`. Permissions with + # wildcards (such as '*' or 'storage.*') are not allowed. For more + # information see + # [IAM Overview](https://cloud.google.com/iam/docs/overview#permissions). + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Google::Iam::V1::TestIamPermissionsResponse] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Google::Iam::V1::TestIamPermissionsResponse] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/resource_manager/v3" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::ResourceManager::V3::TagKeys::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Iam::V1::TestIamPermissionsRequest.new + # + # # Call the test_iam_permissions method. + # result = client.test_iam_permissions request + # + # # The returned object is of type Google::Iam::V1::TestIamPermissionsResponse. + # p result + # + def test_iam_permissions request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Iam::V1::TestIamPermissionsRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + metadata = @config.rpcs.test_iam_permissions.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::ResourceManager::V3::VERSION + metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.resource + header_params["resource"] = request.resource + end + + request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") + metadata[:"x-goog-request-params"] ||= request_params_header + + options.apply_defaults timeout: @config.rpcs.test_iam_permissions.timeout, + metadata: metadata, + retry_policy: @config.rpcs.test_iam_permissions.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @tag_keys_stub.call_rpc :test_iam_permissions, request, options: options do |response, operation| + yield response, operation if block_given? + end + rescue ::GRPC::BadStatus => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Configuration class for the TagKeys API. + # + # This class represents the configuration for TagKeys, + # providing control over timeouts, retry behavior, logging, transport + # parameters, and other low-level controls. Certain parameters can also be + # applied individually to specific RPCs. See + # {::Google::Cloud::ResourceManager::V3::TagKeys::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_tag_keys to 20 seconds, + # # and all remaining timeouts to 10 seconds. + # ::Google::Cloud::ResourceManager::V3::TagKeys::Client.configure do |config| + # config.timeout = 10.0 + # config.rpcs.list_tag_keys.timeout = 20.0 + # end + # + # # Apply the above configuration only to a new client. + # client = ::Google::Cloud::ResourceManager::V3::TagKeys::Client.new do |config| + # config.timeout = 10.0 + # config.rpcs.list_tag_keys.timeout = 20.0 + # end + # + # @!attribute [rw] endpoint + # A custom service endpoint, as a hostname or hostname:port. The default is + # nil, indicating to use the default endpoint in the current universe domain. + # @return [::String,nil] + # @!attribute [rw] credentials + # Credentials to send with calls. You may provide any of the following types: + # * (`Google::Auth::Credentials`) A googleauth credentials object + # (see the [googleauth docs](https://rubydoc.info/gems/googleauth/Google/Auth/Credentials)) + # * (`Signet::OAuth2::Client`) A signet oauth2 client object + # (see the [signet docs](https://rubydoc.info/gems/signet/Signet/OAuth2/Client)) + # * (`GRPC::Core::Channel`) a gRPC channel with included credentials + # * (`GRPC::Core::ChannelCredentials`) a gRPC credentails object + # * (`nil`) indicating no credentials + # + # @note Warning: Passing a `String` to a keyfile path or a `Hash` of credentials + # is deprecated. Providing an unvalidated credential configuration to + # Google APIs can compromise the security of your systems and data. + # + # @example + # + # # The recommended way to provide credentials is to use the `make_creds` method + # # on the appropriate credentials class for your environment. + # + # require "googleauth" + # + # credentials = ::Google::Auth::ServiceAccountCredentials.make_creds( + # json_key_io: ::File.open("/path/to/keyfile.json") + # ) + # + # client = ::Google::Cloud::ResourceManager::V3::TagKeys::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 = "cloudresourcemanager.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 TagKeys 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_tag_keys` + # @return [::Gapic::Config::Method] + # + attr_reader :list_tag_keys + ## + # RPC-specific configuration for `get_tag_key` + # @return [::Gapic::Config::Method] + # + attr_reader :get_tag_key + ## + # RPC-specific configuration for `get_namespaced_tag_key` + # @return [::Gapic::Config::Method] + # + attr_reader :get_namespaced_tag_key + ## + # RPC-specific configuration for `create_tag_key` + # @return [::Gapic::Config::Method] + # + attr_reader :create_tag_key + ## + # RPC-specific configuration for `update_tag_key` + # @return [::Gapic::Config::Method] + # + attr_reader :update_tag_key + ## + # RPC-specific configuration for `delete_tag_key` + # @return [::Gapic::Config::Method] + # + attr_reader :delete_tag_key + ## + # RPC-specific configuration for `get_iam_policy` + # @return [::Gapic::Config::Method] + # + attr_reader :get_iam_policy + ## + # RPC-specific configuration for `set_iam_policy` + # @return [::Gapic::Config::Method] + # + attr_reader :set_iam_policy + ## + # RPC-specific configuration for `test_iam_permissions` + # @return [::Gapic::Config::Method] + # + attr_reader :test_iam_permissions + + # @private + def initialize parent_rpcs = nil + list_tag_keys_config = parent_rpcs.list_tag_keys if parent_rpcs.respond_to? :list_tag_keys + @list_tag_keys = ::Gapic::Config::Method.new list_tag_keys_config + get_tag_key_config = parent_rpcs.get_tag_key if parent_rpcs.respond_to? :get_tag_key + @get_tag_key = ::Gapic::Config::Method.new get_tag_key_config + get_namespaced_tag_key_config = parent_rpcs.get_namespaced_tag_key if parent_rpcs.respond_to? :get_namespaced_tag_key + @get_namespaced_tag_key = ::Gapic::Config::Method.new get_namespaced_tag_key_config + create_tag_key_config = parent_rpcs.create_tag_key if parent_rpcs.respond_to? :create_tag_key + @create_tag_key = ::Gapic::Config::Method.new create_tag_key_config + update_tag_key_config = parent_rpcs.update_tag_key if parent_rpcs.respond_to? :update_tag_key + @update_tag_key = ::Gapic::Config::Method.new update_tag_key_config + delete_tag_key_config = parent_rpcs.delete_tag_key if parent_rpcs.respond_to? :delete_tag_key + @delete_tag_key = ::Gapic::Config::Method.new delete_tag_key_config + get_iam_policy_config = parent_rpcs.get_iam_policy if parent_rpcs.respond_to? :get_iam_policy + @get_iam_policy = ::Gapic::Config::Method.new get_iam_policy_config + set_iam_policy_config = parent_rpcs.set_iam_policy if parent_rpcs.respond_to? :set_iam_policy + @set_iam_policy = ::Gapic::Config::Method.new set_iam_policy_config + test_iam_permissions_config = parent_rpcs.test_iam_permissions if parent_rpcs.respond_to? :test_iam_permissions + @test_iam_permissions = ::Gapic::Config::Method.new test_iam_permissions_config + + yield self if block_given? + end + end + end + end + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-resource_manager-v3/lib/google/cloud/resource_manager/v3/tag_keys/credentials.rb b/owl-bot-staging/google-cloud-resource_manager-v3/lib/google/cloud/resource_manager/v3/tag_keys/credentials.rb new file mode 100644 index 000000000000..5236a2bf5c74 --- /dev/null +++ b/owl-bot-staging/google-cloud-resource_manager-v3/lib/google/cloud/resource_manager/v3/tag_keys/credentials.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 "googleauth" + +module Google + module Cloud + module ResourceManager + module V3 + module TagKeys + # Credentials for the TagKeys API. + class Credentials < ::Google::Auth::Credentials + self.scope = [ + "https://www.googleapis.com/auth/cloud-platform", + "https://www.googleapis.com/auth/cloud-platform.read-only" + ] + self.env_vars = [ + "RESOURCE_MANAGER_CREDENTIALS", + "RESOURCE_MANAGER_KEYFILE", + "GOOGLE_CLOUD_CREDENTIALS", + "GOOGLE_CLOUD_KEYFILE", + "GCLOUD_KEYFILE", + "RESOURCE_MANAGER_CREDENTIALS_JSON", + "RESOURCE_MANAGER_KEYFILE_JSON", + "GOOGLE_CLOUD_CREDENTIALS_JSON", + "GOOGLE_CLOUD_KEYFILE_JSON", + "GCLOUD_KEYFILE_JSON" + ] + self.paths = [ + "~/.config/google_cloud/application_default_credentials.json" + ] + end + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-resource_manager-v3/lib/google/cloud/resource_manager/v3/tag_keys/operations.rb b/owl-bot-staging/google-cloud-resource_manager-v3/lib/google/cloud/resource_manager/v3/tag_keys/operations.rb new file mode 100644 index 000000000000..411f5dd02ac3 --- /dev/null +++ b/owl-bot-staging/google-cloud-resource_manager-v3/lib/google/cloud/resource_manager/v3/tag_keys/operations.rb @@ -0,0 +1,841 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +require "gapic/operation" +require "google/longrunning/operations_pb" + +module Google + module Cloud + module ResourceManager + module V3 + module TagKeys + # Service that implements Longrunning Operations API. + class Operations + # @private + API_VERSION = "" + + # @private + DEFAULT_ENDPOINT_TEMPLATE = "cloudresourcemanager.$UNIVERSE_DOMAIN$" + + # @private + attr_reader :operations_stub + + ## + # Configuration for the TagKeys 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 TagKeys 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::ResourceManager::V3::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::ResourceManager::V3::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::ResourceManager::V3::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::ResourceManager::V3::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::ResourceManager::V3::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 = "cloudresourcemanager.googleapis.com" + + config_attr :endpoint, nil, ::String, nil + config_attr :credentials, nil do |value| + allowed = [::String, ::Hash, ::Proc, ::Symbol, ::Google::Auth::Credentials, ::Google::Auth::BaseClient, ::Signet::OAuth2::Client, nil] + allowed += [::GRPC::Core::Channel, ::GRPC::Core::ChannelCredentials] if defined? ::GRPC::Core::Channel + allowed.any? { |klass| klass === value } + end + config_attr :scope, nil, ::String, ::Array, nil + config_attr :lib_name, nil, ::String, nil + config_attr :lib_version, nil, ::String, nil + config_attr(:channel_args, { "grpc.service_config_disable_resolution" => 1 }, ::Hash, nil) + config_attr :interceptors, nil, ::Array, nil + config_attr :timeout, nil, ::Numeric, nil + config_attr :metadata, nil, ::Hash, nil + config_attr :retry_policy, nil, ::Hash, ::Proc, nil + config_attr :quota_project, nil, ::String, nil + config_attr :universe_domain, nil, ::String, nil + config_attr :logger, :default, ::Logger, nil, :default + + # @private + def initialize parent_config = nil + @parent_config = parent_config unless parent_config.nil? + + yield self if block_given? + end + + ## + # Configurations for individual RPCs + # @return [Rpcs] + # + def rpcs + @rpcs ||= begin + parent_rpcs = nil + parent_rpcs = @parent_config.rpcs if defined?(@parent_config) && @parent_config.respond_to?(:rpcs) + Rpcs.new parent_rpcs + end + end + + ## + # Configuration for the channel pool + # @return [::Gapic::ServiceStub::ChannelPool::Configuration] + # + def channel_pool + @channel_pool ||= ::Gapic::ServiceStub::ChannelPool::Configuration.new + end + + ## + # Configuration RPC class for the Operations API. + # + # Includes fields providing the configuration for each RPC in this service. + # Each configuration object is of type `Gapic::Config::Method` and includes + # the following configuration fields: + # + # * `timeout` (*type:* `Numeric`) - The call timeout in seconds + # * `metadata` (*type:* `Hash{Symbol=>String}`) - Additional gRPC headers + # * `retry_policy (*type:* `Hash`) - The retry policy. The policy fields + # include the following keys: + # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds. + # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds. + # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier. + # * `:retry_codes` (*type:* `Array`) - The error codes that should + # trigger a retry. + # + class Rpcs + ## + # RPC-specific configuration for `list_operations` + # @return [::Gapic::Config::Method] + # + attr_reader :list_operations + ## + # RPC-specific configuration for `get_operation` + # @return [::Gapic::Config::Method] + # + attr_reader :get_operation + ## + # RPC-specific configuration for `delete_operation` + # @return [::Gapic::Config::Method] + # + attr_reader :delete_operation + ## + # RPC-specific configuration for `cancel_operation` + # @return [::Gapic::Config::Method] + # + attr_reader :cancel_operation + ## + # RPC-specific configuration for `wait_operation` + # @return [::Gapic::Config::Method] + # + attr_reader :wait_operation + + # @private + def initialize parent_rpcs = nil + list_operations_config = parent_rpcs.list_operations if parent_rpcs.respond_to? :list_operations + @list_operations = ::Gapic::Config::Method.new list_operations_config + get_operation_config = parent_rpcs.get_operation if parent_rpcs.respond_to? :get_operation + @get_operation = ::Gapic::Config::Method.new get_operation_config + delete_operation_config = parent_rpcs.delete_operation if parent_rpcs.respond_to? :delete_operation + @delete_operation = ::Gapic::Config::Method.new delete_operation_config + cancel_operation_config = parent_rpcs.cancel_operation if parent_rpcs.respond_to? :cancel_operation + @cancel_operation = ::Gapic::Config::Method.new cancel_operation_config + wait_operation_config = parent_rpcs.wait_operation if parent_rpcs.respond_to? :wait_operation + @wait_operation = ::Gapic::Config::Method.new wait_operation_config + + yield self if block_given? + end + end + end + end + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-resource_manager-v3/lib/google/cloud/resource_manager/v3/tag_keys/paths.rb b/owl-bot-staging/google-cloud-resource_manager-v3/lib/google/cloud/resource_manager/v3/tag_keys/paths.rb new file mode 100644 index 000000000000..47fb1b73c8ba --- /dev/null +++ b/owl-bot-staging/google-cloud-resource_manager-v3/lib/google/cloud/resource_manager/v3/tag_keys/paths.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! + + +module Google + module Cloud + module ResourceManager + module V3 + module TagKeys + # Path helper methods for the TagKeys API. + module Paths + ## + # Create a fully-qualified TagKey resource string. + # + # The resource will be in the following format: + # + # `tagKeys/{tag_key}` + # + # @param tag_key [String] + # + # @return [::String] + def tag_key_path tag_key: + "tagKeys/#{tag_key}" + end + + extend self + end + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-resource_manager-v3/lib/google/cloud/resource_manager/v3/tag_keys/rest.rb b/owl-bot-staging/google-cloud-resource_manager-v3/lib/google/cloud/resource_manager/v3/tag_keys/rest.rb new file mode 100644 index 000000000000..f82f5c05233d --- /dev/null +++ b/owl-bot-staging/google-cloud-resource_manager-v3/lib/google/cloud/resource_manager/v3/tag_keys/rest.rb @@ -0,0 +1,53 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +require "gapic/rest" +require "gapic/config" +require "gapic/config/method" + +require "google/cloud/resource_manager/v3/version" + +require "google/cloud/resource_manager/v3/tag_keys/credentials" +require "google/cloud/resource_manager/v3/tag_keys/paths" +require "google/cloud/resource_manager/v3/tag_keys/rest/operations" +require "google/cloud/resource_manager/v3/tag_keys/rest/client" + +module Google + module Cloud + module ResourceManager + module V3 + ## + # Allow users to create and manage tag keys. + # + # To load this service and instantiate a REST client: + # + # require "google/cloud/resource_manager/v3/tag_keys/rest" + # client = ::Google::Cloud::ResourceManager::V3::TagKeys::Rest::Client.new + # + module TagKeys + # Client for the REST transport + module Rest + end + end + end + end + end +end + +helper_path = ::File.join __dir__, "rest", "helpers.rb" +require "google/cloud/resource_manager/v3/tag_keys/rest/helpers" if ::File.file? helper_path diff --git a/owl-bot-staging/google-cloud-resource_manager-v3/lib/google/cloud/resource_manager/v3/tag_keys/rest/client.rb b/owl-bot-staging/google-cloud-resource_manager-v3/lib/google/cloud/resource_manager/v3/tag_keys/rest/client.rb new file mode 100644 index 000000000000..89ae77b9bf88 --- /dev/null +++ b/owl-bot-staging/google-cloud-resource_manager-v3/lib/google/cloud/resource_manager/v3/tag_keys/rest/client.rb @@ -0,0 +1,1251 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +require "google/cloud/errors" +require "google/cloud/resourcemanager/v3/tag_keys_pb" +require "google/cloud/resource_manager/v3/tag_keys/rest/service_stub" + +module Google + module Cloud + module ResourceManager + module V3 + module TagKeys + module Rest + ## + # REST client for the TagKeys service. + # + # Allow users to create and manage tag keys. + # + class Client + # @private + API_VERSION = "" + + # @private + DEFAULT_ENDPOINT_TEMPLATE = "cloudresourcemanager.$UNIVERSE_DOMAIN$" + + include Paths + + # @private + attr_reader :tag_keys_stub + + ## + # Configure the TagKeys Client class. + # + # See {::Google::Cloud::ResourceManager::V3::TagKeys::Rest::Client::Configuration} + # for a description of the configuration fields. + # + # @example + # + # # Modify the configuration for all TagKeys clients + # ::Google::Cloud::ResourceManager::V3::TagKeys::Rest::Client.configure do |config| + # config.timeout = 10.0 + # end + # + # @yield [config] Configure the Client client. + # @yieldparam config [Client::Configuration] + # + # @return [Client::Configuration] + # + def self.configure + @configure ||= begin + namespace = ["Google", "Cloud", "ResourceManager", "V3"] + parent_config = while namespace.any? + parent_name = namespace.join "::" + parent_const = const_get parent_name + break parent_const.configure if parent_const.respond_to? :configure + namespace.pop + end + default_config = Client::Configuration.new parent_config + + default_config.rpcs.list_tag_keys.timeout = 60.0 + default_config.rpcs.list_tag_keys.retry_policy = { + initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [14] + } + + default_config.rpcs.get_tag_key.timeout = 60.0 + default_config.rpcs.get_tag_key.retry_policy = { + initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [14] + } + + default_config.rpcs.create_tag_key.timeout = 60.0 + + default_config.rpcs.update_tag_key.timeout = 60.0 + + default_config.rpcs.delete_tag_key.timeout = 60.0 + + default_config.rpcs.get_iam_policy.timeout = 60.0 + default_config.rpcs.get_iam_policy.retry_policy = { + initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [14] + } + + default_config.rpcs.set_iam_policy.timeout = 60.0 + + default_config + end + yield @configure if block_given? + @configure + end + + ## + # Configure the TagKeys Client instance. + # + # The configuration is set to the derived mode, meaning that values can be changed, + # but structural changes (adding new fields, etc.) are not allowed. Structural changes + # should be made on {Client.configure}. + # + # See {::Google::Cloud::ResourceManager::V3::TagKeys::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 + @tag_keys_stub.universe_domain + end + + ## + # Create a new TagKeys REST client object. + # + # @example + # + # # Create a client using the default configuration + # client = ::Google::Cloud::ResourceManager::V3::TagKeys::Rest::Client.new + # + # # Create a client using a custom configuration + # client = ::Google::Cloud::ResourceManager::V3::TagKeys::Rest::Client.new do |config| + # config.timeout = 10.0 + # end + # + # @yield [config] Configure the TagKeys client. + # @yieldparam config [Client::Configuration] + # + def initialize + # Create the configuration object + @config = Configuration.new Client.configure + + # Yield the configuration if needed + yield @config if block_given? + + # Create credentials + credentials = @config.credentials + # Use self-signed JWT if the endpoint is unchanged from default, + # but only if the default endpoint does not have a region prefix. + enable_self_signed_jwt = @config.endpoint.nil? || + (@config.endpoint == Configuration::DEFAULT_ENDPOINT && + !@config.endpoint.split(".").first.include?("-")) + credentials ||= Credentials.default scope: @config.scope, + enable_self_signed_jwt: enable_self_signed_jwt + if credentials.is_a?(::String) || credentials.is_a?(::Hash) + credentials = Credentials.new credentials, scope: @config.scope + end + + @quota_project_id = @config.quota_project + @quota_project_id ||= credentials.quota_project_id if credentials.respond_to? :quota_project_id + + @operations_client = ::Google::Cloud::ResourceManager::V3::TagKeys::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 + + @tag_keys_stub = ::Google::Cloud::ResourceManager::V3::TagKeys::Rest::ServiceStub.new( + endpoint: @config.endpoint, + endpoint_template: DEFAULT_ENDPOINT_TEMPLATE, + universe_domain: @config.universe_domain, + credentials: credentials, + logger: @config.logger + ) + + @tag_keys_stub.logger(stub: true)&.info do |entry| + entry.set_system_name + entry.set_service + entry.message = "Created client for #{entry.service}" + entry.set_credentials_fields credentials + entry.set "customEndpoint", @config.endpoint if @config.endpoint + entry.set "defaultTimeout", @config.timeout if @config.timeout + entry.set "quotaProject", @quota_project_id if @quota_project_id + end + end + + ## + # Get the associated client for long-running operations. + # + # @return [::Google::Cloud::ResourceManager::V3::TagKeys::Rest::Operations] + # + attr_reader :operations_client + + ## + # The logger used for request/response debug logging. + # + # @return [Logger] + # + def logger + @tag_keys_stub.logger + end + + # Service calls + + ## + # Lists all TagKeys for a parent resource. + # + # @overload list_tag_keys(request, options = nil) + # Pass arguments to `list_tag_keys` via a request object, either of type + # {::Google::Cloud::ResourceManager::V3::ListTagKeysRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::ResourceManager::V3::ListTagKeysRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_tag_keys(parent: nil, page_size: nil, page_token: nil) + # Pass arguments to `list_tag_keys` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param parent [::String] + # Required. The resource name of the TagKey's parent. + # Must be of the form `organizations/{org_id}` or `projects/{project_id}` or + # `projects/{project_number}` + # @param page_size [::Integer] + # Optional. The maximum number of TagKeys to return in the response. The + # server allows a maximum of 300 TagKeys to return. If unspecified, the + # server will use 100 as the default. + # @param page_token [::String] + # Optional. A pagination token returned from a previous call to `ListTagKey` + # that indicates where this listing should continue from. + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Gapic::Rest::PagedEnumerable<::Google::Cloud::ResourceManager::V3::TagKey>] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Gapic::Rest::PagedEnumerable<::Google::Cloud::ResourceManager::V3::TagKey>] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/resource_manager/v3" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::ResourceManager::V3::TagKeys::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::ResourceManager::V3::ListTagKeysRequest.new + # + # # Call the list_tag_keys method. + # result = client.list_tag_keys request + # + # # The returned object is of type Gapic::PagedEnumerable. You can iterate + # # over elements, and API calls will be issued to fetch pages as needed. + # result.each do |item| + # # Each element is of type ::Google::Cloud::ResourceManager::V3::TagKey. + # p item + # end + # + def list_tag_keys request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::ResourceManager::V3::ListTagKeysRequest + + # Converts hash 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_tag_keys.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::ResourceManager::V3::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_tag_keys.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.list_tag_keys.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @tag_keys_stub.list_tag_keys request, options do |result, operation| + result = ::Gapic::Rest::PagedEnumerable.new @tag_keys_stub, :list_tag_keys, "tag_keys", 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 + + ## + # Retrieves a TagKey. This method will return `PERMISSION_DENIED` if the + # key does not exist or the user does not have permission to view it. + # + # @overload get_tag_key(request, options = nil) + # Pass arguments to `get_tag_key` via a request object, either of type + # {::Google::Cloud::ResourceManager::V3::GetTagKeyRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::ResourceManager::V3::GetTagKeyRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_tag_key(name: nil) + # Pass arguments to `get_tag_key` via keyword arguments. Note that at + # least one keyword argument is 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. A resource name in the format `tagKeys/{id}`, such as + # `tagKeys/123`. + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Cloud::ResourceManager::V3::TagKey] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::ResourceManager::V3::TagKey] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/resource_manager/v3" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::ResourceManager::V3::TagKeys::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::ResourceManager::V3::GetTagKeyRequest.new + # + # # Call the get_tag_key method. + # result = client.get_tag_key request + # + # # The returned object is of type Google::Cloud::ResourceManager::V3::TagKey. + # p result + # + def get_tag_key request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::ResourceManager::V3::GetTagKeyRequest + + # Converts hash 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_tag_key.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::ResourceManager::V3::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_tag_key.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.get_tag_key.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @tag_keys_stub.get_tag_key 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 + + ## + # Retrieves a TagKey by its namespaced name. + # This method will return `PERMISSION_DENIED` if the key does not exist + # or the user does not have permission to view it. + # + # @overload get_namespaced_tag_key(request, options = nil) + # Pass arguments to `get_namespaced_tag_key` via a request object, either of type + # {::Google::Cloud::ResourceManager::V3::GetNamespacedTagKeyRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::ResourceManager::V3::GetNamespacedTagKeyRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_namespaced_tag_key(name: nil) + # Pass arguments to `get_namespaced_tag_key` via keyword arguments. Note that at + # least one keyword argument is 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. A namespaced tag key name in the format + # `{parentId}/{tagKeyShort}`, such as `42/foo` for a key with short name + # "foo" under the organization with ID 42 or `r2-d2/bar` for a key with short + # name "bar" under the project `r2-d2`. + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Cloud::ResourceManager::V3::TagKey] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::ResourceManager::V3::TagKey] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/resource_manager/v3" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::ResourceManager::V3::TagKeys::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::ResourceManager::V3::GetNamespacedTagKeyRequest.new + # + # # Call the get_namespaced_tag_key method. + # result = client.get_namespaced_tag_key request + # + # # The returned object is of type Google::Cloud::ResourceManager::V3::TagKey. + # p result + # + def get_namespaced_tag_key request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::ResourceManager::V3::GetNamespacedTagKeyRequest + + # Converts hash 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_namespaced_tag_key.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::ResourceManager::V3::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_namespaced_tag_key.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.get_namespaced_tag_key.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @tag_keys_stub.get_namespaced_tag_key request, options do |result, operation| + yield result, operation if block_given? + end + rescue ::Gapic::Rest::Error => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Creates a new TagKey. If another request with the same parameters is + # sent while the original request is in process, the second request + # will receive an error. A maximum of 1000 TagKeys can exist under a parent + # at any given time. + # + # @overload create_tag_key(request, options = nil) + # Pass arguments to `create_tag_key` via a request object, either of type + # {::Google::Cloud::ResourceManager::V3::CreateTagKeyRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::ResourceManager::V3::CreateTagKeyRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_tag_key(tag_key: nil, validate_only: nil) + # Pass arguments to `create_tag_key` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param tag_key [::Google::Cloud::ResourceManager::V3::TagKey, ::Hash] + # Required. The TagKey to be created. Only fields `short_name`, + # `description`, and `parent` are considered during the creation request. + # @param validate_only [::Boolean] + # Optional. Set to true to perform validations necessary for creating the + # resource, but not actually perform the action. + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Gapic::Operation] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Gapic::Operation] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/resource_manager/v3" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::ResourceManager::V3::TagKeys::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::ResourceManager::V3::CreateTagKeyRequest.new + # + # # Call the create_tag_key method. + # result = client.create_tag_key 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_tag_key request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::ResourceManager::V3::CreateTagKeyRequest + + # Converts hash 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_tag_key.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::ResourceManager::V3::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_tag_key.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.create_tag_key.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @tag_keys_stub.create_tag_key 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 + + ## + # Updates the attributes of the TagKey resource. + # + # @overload update_tag_key(request, options = nil) + # Pass arguments to `update_tag_key` via a request object, either of type + # {::Google::Cloud::ResourceManager::V3::UpdateTagKeyRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::ResourceManager::V3::UpdateTagKeyRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_tag_key(tag_key: nil, update_mask: nil, validate_only: nil) + # Pass arguments to `update_tag_key` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param tag_key [::Google::Cloud::ResourceManager::V3::TagKey, ::Hash] + # Required. The new definition of the TagKey. Only the `description` and + # `etag` fields can be updated by this request. If the `etag` field is not + # empty, it must match the `etag` field of the existing tag key. Otherwise, + # `ABORTED` will be returned. + # @param update_mask [::Google::Protobuf::FieldMask, ::Hash] + # Fields to be updated. The mask may only contain `description` or + # `etag`. If omitted entirely, both `description` and `etag` are assumed to + # be significant. + # @param validate_only [::Boolean] + # Set as true to perform validations necessary for updating the resource, but + # not actually perform the action. + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Gapic::Operation] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Gapic::Operation] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/resource_manager/v3" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::ResourceManager::V3::TagKeys::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::ResourceManager::V3::UpdateTagKeyRequest.new + # + # # Call the update_tag_key method. + # result = client.update_tag_key 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_tag_key request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::ResourceManager::V3::UpdateTagKeyRequest + + # Converts hash 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_tag_key.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::ResourceManager::V3::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_tag_key.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.update_tag_key.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @tag_keys_stub.update_tag_key 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 TagKey. The TagKey cannot be deleted if it has any child + # TagValues. + # + # @overload delete_tag_key(request, options = nil) + # Pass arguments to `delete_tag_key` via a request object, either of type + # {::Google::Cloud::ResourceManager::V3::DeleteTagKeyRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::ResourceManager::V3::DeleteTagKeyRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_tag_key(name: nil, validate_only: nil, etag: nil) + # Pass arguments to `delete_tag_key` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param name [::String] + # Required. The resource name of a TagKey to be deleted in the format + # `tagKeys/123`. The TagKey cannot be a parent of any existing TagValues or + # it will not be deleted successfully. + # @param validate_only [::Boolean] + # Optional. Set as true to perform validations necessary for deletion, but + # not actually perform the action. + # @param etag [::String] + # Optional. The etag known to the client for the expected state of the + # TagKey. This is to be used for optimistic concurrency. + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Gapic::Operation] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Gapic::Operation] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/resource_manager/v3" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::ResourceManager::V3::TagKeys::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::ResourceManager::V3::DeleteTagKeyRequest.new + # + # # Call the delete_tag_key method. + # result = client.delete_tag_key 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_tag_key request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::ResourceManager::V3::DeleteTagKeyRequest + + # Converts hash 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_tag_key.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::ResourceManager::V3::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_tag_key.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.delete_tag_key.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @tag_keys_stub.delete_tag_key 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 the access control policy for a TagKey. The returned policy may be + # empty if no such policy or resource exists. The `resource` field should + # be the TagKey's resource name. For example, "tagKeys/1234". + # The caller must have + # `cloudresourcemanager.googleapis.com/tagKeys.getIamPolicy` permission on + # the specified TagKey. + # + # @overload get_iam_policy(request, options = nil) + # Pass arguments to `get_iam_policy` via a request object, either of type + # {::Google::Iam::V1::GetIamPolicyRequest} or an equivalent Hash. + # + # @param request [::Google::Iam::V1::GetIamPolicyRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @overload get_iam_policy(resource: nil, options: nil) + # Pass arguments to `get_iam_policy` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param resource [::String] + # REQUIRED: The resource for which the policy is being requested. + # See the operation documentation for the appropriate value for this field. + # @param options [::Google::Iam::V1::GetPolicyOptions, ::Hash] + # OPTIONAL: A `GetPolicyOptions` object for specifying options to + # `GetIamPolicy`. + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Iam::V1::Policy] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Iam::V1::Policy] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/resource_manager/v3" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::ResourceManager::V3::TagKeys::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Iam::V1::GetIamPolicyRequest.new + # + # # Call the get_iam_policy method. + # result = client.get_iam_policy request + # + # # The returned object is of type Google::Iam::V1::Policy. + # p result + # + def get_iam_policy request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Iam::V1::GetIamPolicyRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + call_metadata = @config.rpcs.get_iam_policy.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::ResourceManager::V3::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + options.apply_defaults timeout: @config.rpcs.get_iam_policy.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.get_iam_policy.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @tag_keys_stub.get_iam_policy request, options do |result, operation| + yield result, operation if block_given? + end + rescue ::Gapic::Rest::Error => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Sets the access control policy on a TagKey, replacing any existing + # policy. The `resource` field should be the TagKey's resource name. + # For example, "tagKeys/1234". + # The caller must have `resourcemanager.tagKeys.setIamPolicy` permission + # on the identified tagValue. + # + # @overload set_iam_policy(request, options = nil) + # Pass arguments to `set_iam_policy` via a request object, either of type + # {::Google::Iam::V1::SetIamPolicyRequest} or an equivalent Hash. + # + # @param request [::Google::Iam::V1::SetIamPolicyRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @overload set_iam_policy(resource: nil, policy: nil, update_mask: nil) + # Pass arguments to `set_iam_policy` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param resource [::String] + # REQUIRED: The resource for which the policy is being specified. + # See the operation documentation for the appropriate value for this field. + # @param policy [::Google::Iam::V1::Policy, ::Hash] + # REQUIRED: The complete policy to be applied to the `resource`. The size of + # the policy is limited to a few 10s of KB. An empty policy is a + # valid policy but certain Cloud Platform services (such as Projects) + # might reject them. + # @param update_mask [::Google::Protobuf::FieldMask, ::Hash] + # OPTIONAL: A FieldMask specifying which fields of the policy to modify. Only + # the fields in the mask will be modified. If no mask is provided, the + # following default mask is used: + # + # `paths: "bindings, etag"` + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Iam::V1::Policy] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Iam::V1::Policy] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/resource_manager/v3" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::ResourceManager::V3::TagKeys::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Iam::V1::SetIamPolicyRequest.new + # + # # Call the set_iam_policy method. + # result = client.set_iam_policy request + # + # # The returned object is of type Google::Iam::V1::Policy. + # p result + # + def set_iam_policy request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Iam::V1::SetIamPolicyRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + call_metadata = @config.rpcs.set_iam_policy.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::ResourceManager::V3::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + options.apply_defaults timeout: @config.rpcs.set_iam_policy.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.set_iam_policy.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @tag_keys_stub.set_iam_policy request, options do |result, operation| + yield result, operation if block_given? + end + rescue ::Gapic::Rest::Error => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Returns permissions that a caller has on the specified TagKey. + # The `resource` field should be the TagKey's resource name. + # For example, "tagKeys/1234". + # + # There are no permissions required for making this API call. + # + # @overload test_iam_permissions(request, options = nil) + # Pass arguments to `test_iam_permissions` via a request object, either of type + # {::Google::Iam::V1::TestIamPermissionsRequest} or an equivalent Hash. + # + # @param request [::Google::Iam::V1::TestIamPermissionsRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @overload test_iam_permissions(resource: nil, permissions: nil) + # Pass arguments to `test_iam_permissions` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param resource [::String] + # REQUIRED: The resource for which the policy detail is being requested. + # See the operation documentation for the appropriate value for this field. + # @param permissions [::Array<::String>] + # The set of permissions to check for the `resource`. Permissions with + # wildcards (such as '*' or 'storage.*') are not allowed. For more + # information see + # [IAM Overview](https://cloud.google.com/iam/docs/overview#permissions). + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Iam::V1::TestIamPermissionsResponse] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Iam::V1::TestIamPermissionsResponse] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/resource_manager/v3" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::ResourceManager::V3::TagKeys::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Iam::V1::TestIamPermissionsRequest.new + # + # # Call the test_iam_permissions method. + # result = client.test_iam_permissions request + # + # # The returned object is of type Google::Iam::V1::TestIamPermissionsResponse. + # p result + # + def test_iam_permissions request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Iam::V1::TestIamPermissionsRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + call_metadata = @config.rpcs.test_iam_permissions.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::ResourceManager::V3::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + options.apply_defaults timeout: @config.rpcs.test_iam_permissions.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.test_iam_permissions.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @tag_keys_stub.test_iam_permissions request, options do |result, operation| + yield result, operation if block_given? + end + rescue ::Gapic::Rest::Error => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Configuration class for the TagKeys REST API. + # + # This class represents the configuration for TagKeys REST, + # providing control over timeouts, retry behavior, logging, transport + # parameters, and other low-level controls. Certain parameters can also be + # applied individually to specific RPCs. See + # {::Google::Cloud::ResourceManager::V3::TagKeys::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_tag_keys to 20 seconds, + # # and all remaining timeouts to 10 seconds. + # ::Google::Cloud::ResourceManager::V3::TagKeys::Rest::Client.configure do |config| + # config.timeout = 10.0 + # config.rpcs.list_tag_keys.timeout = 20.0 + # end + # + # # Apply the above configuration only to a new client. + # client = ::Google::Cloud::ResourceManager::V3::TagKeys::Rest::Client.new do |config| + # config.timeout = 10.0 + # config.rpcs.list_tag_keys.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 = "cloudresourcemanager.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 TagKeys 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_tag_keys` + # @return [::Gapic::Config::Method] + # + attr_reader :list_tag_keys + ## + # RPC-specific configuration for `get_tag_key` + # @return [::Gapic::Config::Method] + # + attr_reader :get_tag_key + ## + # RPC-specific configuration for `get_namespaced_tag_key` + # @return [::Gapic::Config::Method] + # + attr_reader :get_namespaced_tag_key + ## + # RPC-specific configuration for `create_tag_key` + # @return [::Gapic::Config::Method] + # + attr_reader :create_tag_key + ## + # RPC-specific configuration for `update_tag_key` + # @return [::Gapic::Config::Method] + # + attr_reader :update_tag_key + ## + # RPC-specific configuration for `delete_tag_key` + # @return [::Gapic::Config::Method] + # + attr_reader :delete_tag_key + ## + # RPC-specific configuration for `get_iam_policy` + # @return [::Gapic::Config::Method] + # + attr_reader :get_iam_policy + ## + # RPC-specific configuration for `set_iam_policy` + # @return [::Gapic::Config::Method] + # + attr_reader :set_iam_policy + ## + # RPC-specific configuration for `test_iam_permissions` + # @return [::Gapic::Config::Method] + # + attr_reader :test_iam_permissions + + # @private + def initialize parent_rpcs = nil + list_tag_keys_config = parent_rpcs.list_tag_keys if parent_rpcs.respond_to? :list_tag_keys + @list_tag_keys = ::Gapic::Config::Method.new list_tag_keys_config + get_tag_key_config = parent_rpcs.get_tag_key if parent_rpcs.respond_to? :get_tag_key + @get_tag_key = ::Gapic::Config::Method.new get_tag_key_config + get_namespaced_tag_key_config = parent_rpcs.get_namespaced_tag_key if parent_rpcs.respond_to? :get_namespaced_tag_key + @get_namespaced_tag_key = ::Gapic::Config::Method.new get_namespaced_tag_key_config + create_tag_key_config = parent_rpcs.create_tag_key if parent_rpcs.respond_to? :create_tag_key + @create_tag_key = ::Gapic::Config::Method.new create_tag_key_config + update_tag_key_config = parent_rpcs.update_tag_key if parent_rpcs.respond_to? :update_tag_key + @update_tag_key = ::Gapic::Config::Method.new update_tag_key_config + delete_tag_key_config = parent_rpcs.delete_tag_key if parent_rpcs.respond_to? :delete_tag_key + @delete_tag_key = ::Gapic::Config::Method.new delete_tag_key_config + get_iam_policy_config = parent_rpcs.get_iam_policy if parent_rpcs.respond_to? :get_iam_policy + @get_iam_policy = ::Gapic::Config::Method.new get_iam_policy_config + set_iam_policy_config = parent_rpcs.set_iam_policy if parent_rpcs.respond_to? :set_iam_policy + @set_iam_policy = ::Gapic::Config::Method.new set_iam_policy_config + test_iam_permissions_config = parent_rpcs.test_iam_permissions if parent_rpcs.respond_to? :test_iam_permissions + @test_iam_permissions = ::Gapic::Config::Method.new test_iam_permissions_config + + yield self if block_given? + end + end + end + end + end + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-resource_manager-v3/lib/google/cloud/resource_manager/v3/tag_keys/rest/operations.rb b/owl-bot-staging/google-cloud-resource_manager-v3/lib/google/cloud/resource_manager/v3/tag_keys/rest/operations.rb new file mode 100644 index 000000000000..69cb1d2bef7b --- /dev/null +++ b/owl-bot-staging/google-cloud-resource_manager-v3/lib/google/cloud/resource_manager/v3/tag_keys/rest/operations.rb @@ -0,0 +1,925 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +require "gapic/operation" + +module Google + module Cloud + module ResourceManager + module V3 + module TagKeys + module Rest + # Service that implements Longrunning Operations API. + class Operations + # @private + API_VERSION = "" + + # @private + DEFAULT_ENDPOINT_TEMPLATE = "cloudresourcemanager.$UNIVERSE_DOMAIN$" + + # @private + attr_reader :operations_stub + + ## + # Configuration for the TagKeys 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 TagKeys 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::ResourceManager::V3::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::ResourceManager::V3::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::ResourceManager::V3::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::ResourceManager::V3::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 = "cloudresourcemanager.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: "/v3/{name}", + matches: [ + ["name", %r{^operations(?:/.*)?$}, true] + ] + ) + 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 +end diff --git a/owl-bot-staging/google-cloud-resource_manager-v3/lib/google/cloud/resource_manager/v3/tag_keys/rest/service_stub.rb b/owl-bot-staging/google-cloud-resource_manager-v3/lib/google/cloud/resource_manager/v3/tag_keys/rest/service_stub.rb new file mode 100644 index 000000000000..f462be179ffc --- /dev/null +++ b/owl-bot-staging/google-cloud-resource_manager-v3/lib/google/cloud/resource_manager/v3/tag_keys/rest/service_stub.rb @@ -0,0 +1,629 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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/resourcemanager/v3/tag_keys_pb" + +module Google + module Cloud + module ResourceManager + module V3 + module TagKeys + module Rest + ## + # REST service stub for the TagKeys service. + # Service stub contains baseline method implementations + # including transcoding, making the REST call, and deserialing the response. + # + class ServiceStub + # @private + def initialize endpoint:, endpoint_template:, universe_domain:, credentials:, logger: + # These require statements are intentionally placed here to initialize + # the REST modules only when it's required. + require "gapic/rest" + + @client_stub = ::Gapic::Rest::ClientStub.new endpoint: endpoint, + endpoint_template: endpoint_template, + universe_domain: universe_domain, + credentials: credentials, + numeric_enums: true, + service_name: self.class, + raise_faraday_errors: false, + logger: logger + end + + ## + # The effective universe domain + # + # @return [String] + # + def universe_domain + @client_stub.universe_domain + end + + ## + # The effective endpoint + # + # @return [String] + # + def endpoint + @client_stub.endpoint + end + + ## + # The logger used for request/response debug logging. + # + # @return [Logger] + # + def logger stub: false + stub ? @client_stub.stub_logger : @client_stub.logger + end + + ## + # Baseline implementation for the list_tag_keys REST call + # + # @param request_pb [::Google::Cloud::ResourceManager::V3::ListTagKeysRequest] + # A request object representing the call parameters. Required. + # @param options [::Gapic::CallOptions] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Cloud::ResourceManager::V3::ListTagKeysResponse] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::ResourceManager::V3::ListTagKeysResponse] + # A result object deserialized from the server's reply + def list_tag_keys request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_list_tag_keys_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_tag_keys", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Cloud::ResourceManager::V3::ListTagKeysResponse.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_tag_key REST call + # + # @param request_pb [::Google::Cloud::ResourceManager::V3::GetTagKeyRequest] + # A request object representing the call parameters. Required. + # @param options [::Gapic::CallOptions] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Cloud::ResourceManager::V3::TagKey] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::ResourceManager::V3::TagKey] + # A result object deserialized from the server's reply + def get_tag_key request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_get_tag_key_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_tag_key", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Cloud::ResourceManager::V3::TagKey.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_namespaced_tag_key REST call + # + # @param request_pb [::Google::Cloud::ResourceManager::V3::GetNamespacedTagKeyRequest] + # A request object representing the call parameters. Required. + # @param options [::Gapic::CallOptions] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Cloud::ResourceManager::V3::TagKey] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::ResourceManager::V3::TagKey] + # A result object deserialized from the server's reply + def get_namespaced_tag_key request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_get_namespaced_tag_key_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_namespaced_tag_key", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Cloud::ResourceManager::V3::TagKey.decode_json response.body, ignore_unknown_fields: true + catch :response do + yield result, operation if block_given? + result + end + end + + ## + # Baseline implementation for the create_tag_key REST call + # + # @param request_pb [::Google::Cloud::ResourceManager::V3::CreateTagKeyRequest] + # 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_tag_key request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_create_tag_key_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_tag_key", + 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 update_tag_key REST call + # + # @param request_pb [::Google::Cloud::ResourceManager::V3::UpdateTagKeyRequest] + # 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_tag_key request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_update_tag_key_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_tag_key", + 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_tag_key REST call + # + # @param request_pb [::Google::Cloud::ResourceManager::V3::DeleteTagKeyRequest] + # 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_tag_key request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_delete_tag_key_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_tag_key", + 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_iam_policy REST call + # + # @param request_pb [::Google::Iam::V1::GetIamPolicyRequest] + # A request object representing the call parameters. Required. + # @param options [::Gapic::CallOptions] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Iam::V1::Policy] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Iam::V1::Policy] + # A result object deserialized from the server's reply + def get_iam_policy request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_get_iam_policy_request request_pb + query_string_params = if query_string_params.any? + query_string_params.to_h { |p| p.split "=", 2 } + else + {} + end + + response = @client_stub.make_http_request( + verb, + uri: uri, + body: body || "", + params: query_string_params, + method_name: "get_iam_policy", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Iam::V1::Policy.decode_json response.body, ignore_unknown_fields: true + catch :response do + yield result, operation if block_given? + result + end + end + + ## + # Baseline implementation for the set_iam_policy REST call + # + # @param request_pb [::Google::Iam::V1::SetIamPolicyRequest] + # A request object representing the call parameters. Required. + # @param options [::Gapic::CallOptions] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Iam::V1::Policy] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Iam::V1::Policy] + # A result object deserialized from the server's reply + def set_iam_policy request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_set_iam_policy_request request_pb + query_string_params = if query_string_params.any? + query_string_params.to_h { |p| p.split "=", 2 } + else + {} + end + + response = @client_stub.make_http_request( + verb, + uri: uri, + body: body || "", + params: query_string_params, + method_name: "set_iam_policy", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Iam::V1::Policy.decode_json response.body, ignore_unknown_fields: true + catch :response do + yield result, operation if block_given? + result + end + end + + ## + # Baseline implementation for the test_iam_permissions REST call + # + # @param request_pb [::Google::Iam::V1::TestIamPermissionsRequest] + # A request object representing the call parameters. Required. + # @param options [::Gapic::CallOptions] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Iam::V1::TestIamPermissionsResponse] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Iam::V1::TestIamPermissionsResponse] + # A result object deserialized from the server's reply + def test_iam_permissions request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_test_iam_permissions_request request_pb + query_string_params = if query_string_params.any? + query_string_params.to_h { |p| p.split "=", 2 } + else + {} + end + + response = @client_stub.make_http_request( + verb, + uri: uri, + body: body || "", + params: query_string_params, + method_name: "test_iam_permissions", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Iam::V1::TestIamPermissionsResponse.decode_json response.body, ignore_unknown_fields: true + catch :response do + yield result, operation if block_given? + result + end + end + + ## + # @private + # + # GRPC transcoding helper method for the list_tag_keys REST call + # + # @param request_pb [::Google::Cloud::ResourceManager::V3::ListTagKeysRequest] + # 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_tag_keys_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :get, + uri_template: "/v3/tagKeys", + matches: [] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the get_tag_key REST call + # + # @param request_pb [::Google::Cloud::ResourceManager::V3::GetTagKeyRequest] + # 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_tag_key_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :get, + uri_template: "/v3/{name}", + matches: [ + ["name", %r{^tagKeys/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the get_namespaced_tag_key REST call + # + # @param request_pb [::Google::Cloud::ResourceManager::V3::GetNamespacedTagKeyRequest] + # 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_namespaced_tag_key_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :get, + uri_template: "/v3/tagKeys/namespaced", + matches: [] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the create_tag_key REST call + # + # @param request_pb [::Google::Cloud::ResourceManager::V3::CreateTagKeyRequest] + # 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_tag_key_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :post, + uri_template: "/v3/tagKeys", + body: "tag_key", + matches: [] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the update_tag_key REST call + # + # @param request_pb [::Google::Cloud::ResourceManager::V3::UpdateTagKeyRequest] + # 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_tag_key_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :patch, + uri_template: "/v3/{tag_key.name}", + body: "tag_key", + matches: [ + ["tag_key.name", %r{^tagKeys/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the delete_tag_key REST call + # + # @param request_pb [::Google::Cloud::ResourceManager::V3::DeleteTagKeyRequest] + # 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_tag_key_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :delete, + uri_template: "/v3/{name}", + matches: [ + ["name", %r{^tagKeys/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the get_iam_policy REST call + # + # @param request_pb [::Google::Iam::V1::GetIamPolicyRequest] + # A request object representing the call parameters. Required. + # @return [Array(String, [String, nil], Hash{String => String})] + # Uri, Body, Query string parameters + def self.transcode_get_iam_policy_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :post, + uri_template: "/v3/{resource}:getIamPolicy", + body: "*", + matches: [ + ["resource", %r{^tagKeys/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the set_iam_policy REST call + # + # @param request_pb [::Google::Iam::V1::SetIamPolicyRequest] + # A request object representing the call parameters. Required. + # @return [Array(String, [String, nil], Hash{String => String})] + # Uri, Body, Query string parameters + def self.transcode_set_iam_policy_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :post, + uri_template: "/v3/{resource}:setIamPolicy", + body: "*", + matches: [ + ["resource", %r{^tagKeys/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the test_iam_permissions REST call + # + # @param request_pb [::Google::Iam::V1::TestIamPermissionsRequest] + # A request object representing the call parameters. Required. + # @return [Array(String, [String, nil], Hash{String => String})] + # Uri, Body, Query string parameters + def self.transcode_test_iam_permissions_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :post, + uri_template: "/v3/{resource}:testIamPermissions", + body: "*", + matches: [ + ["resource", %r{^tagKeys/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + end + end + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-resource_manager-v3/lib/google/cloud/resource_manager/v3/tag_values.rb b/owl-bot-staging/google-cloud-resource_manager-v3/lib/google/cloud/resource_manager/v3/tag_values.rb new file mode 100644 index 000000000000..3ad105b69960 --- /dev/null +++ b/owl-bot-staging/google-cloud-resource_manager-v3/lib/google/cloud/resource_manager/v3/tag_values.rb @@ -0,0 +1,56 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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/resource_manager/v3/version" + +require "google/cloud/resource_manager/v3/tag_values/credentials" +require "google/cloud/resource_manager/v3/tag_values/paths" +require "google/cloud/resource_manager/v3/tag_values/operations" +require "google/cloud/resource_manager/v3/tag_values/client" +require "google/cloud/resource_manager/v3/tag_values/rest" + +module Google + module Cloud + module ResourceManager + module V3 + ## + # Allow users to create and manage tag values. + # + # @example Load this service and instantiate a gRPC client + # + # require "google/cloud/resource_manager/v3/tag_values" + # client = ::Google::Cloud::ResourceManager::V3::TagValues::Client.new + # + # @example Load this service and instantiate a REST client + # + # require "google/cloud/resource_manager/v3/tag_values/rest" + # client = ::Google::Cloud::ResourceManager::V3::TagValues::Rest::Client.new + # + module TagValues + end + end + end + end +end + +helper_path = ::File.join __dir__, "tag_values", "helpers.rb" +require "google/cloud/resource_manager/v3/tag_values/helpers" if ::File.file? helper_path diff --git a/owl-bot-staging/google-cloud-resource_manager-v3/lib/google/cloud/resource_manager/v3/tag_values/client.rb b/owl-bot-staging/google-cloud-resource_manager-v3/lib/google/cloud/resource_manager/v3/tag_values/client.rb new file mode 100644 index 000000000000..20452134318b --- /dev/null +++ b/owl-bot-staging/google-cloud-resource_manager-v3/lib/google/cloud/resource_manager/v3/tag_values/client.rb @@ -0,0 +1,1333 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +require "google/cloud/errors" +require "google/cloud/resourcemanager/v3/tag_values_pb" + +module Google + module Cloud + module ResourceManager + module V3 + module TagValues + ## + # Client for the TagValues service. + # + # Allow users to create and manage tag values. + # + class Client + # @private + API_VERSION = "" + + # @private + DEFAULT_ENDPOINT_TEMPLATE = "cloudresourcemanager.$UNIVERSE_DOMAIN$" + + include Paths + + # @private + attr_reader :tag_values_stub + + ## + # Configure the TagValues Client class. + # + # See {::Google::Cloud::ResourceManager::V3::TagValues::Client::Configuration} + # for a description of the configuration fields. + # + # @example + # + # # Modify the configuration for all TagValues clients + # ::Google::Cloud::ResourceManager::V3::TagValues::Client.configure do |config| + # config.timeout = 10.0 + # end + # + # @yield [config] Configure the Client client. + # @yieldparam config [Client::Configuration] + # + # @return [Client::Configuration] + # + def self.configure + @configure ||= begin + namespace = ["Google", "Cloud", "ResourceManager", "V3"] + parent_config = while namespace.any? + parent_name = namespace.join "::" + parent_const = const_get parent_name + break parent_const.configure if parent_const.respond_to? :configure + namespace.pop + end + default_config = Client::Configuration.new parent_config + + default_config.rpcs.list_tag_values.timeout = 60.0 + default_config.rpcs.list_tag_values.retry_policy = { + initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [14] + } + + default_config.rpcs.get_tag_value.timeout = 60.0 + default_config.rpcs.get_tag_value.retry_policy = { + initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [14] + } + + default_config.rpcs.create_tag_value.timeout = 60.0 + + default_config.rpcs.update_tag_value.timeout = 60.0 + + default_config.rpcs.delete_tag_value.timeout = 60.0 + + default_config.rpcs.get_iam_policy.timeout = 60.0 + default_config.rpcs.get_iam_policy.retry_policy = { + initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [14] + } + + default_config.rpcs.set_iam_policy.timeout = 60.0 + + default_config + end + yield @configure if block_given? + @configure + end + + ## + # Configure the TagValues Client instance. + # + # The configuration is set to the derived mode, meaning that values can be changed, + # but structural changes (adding new fields, etc.) are not allowed. Structural changes + # should be made on {Client.configure}. + # + # See {::Google::Cloud::ResourceManager::V3::TagValues::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 + @tag_values_stub.universe_domain + end + + ## + # Create a new TagValues client object. + # + # @example + # + # # Create a client using the default configuration + # client = ::Google::Cloud::ResourceManager::V3::TagValues::Client.new + # + # # Create a client using a custom configuration + # client = ::Google::Cloud::ResourceManager::V3::TagValues::Client.new do |config| + # config.timeout = 10.0 + # end + # + # @yield [config] Configure the TagValues client. + # @yieldparam config [Client::Configuration] + # + def initialize + # These require statements are intentionally placed here to initialize + # the gRPC module only when it's required. + # See https://github.com/googleapis/toolkit/issues/446 + require "gapic/grpc" + require "google/cloud/resourcemanager/v3/tag_values_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 + + @tag_values_stub = ::Gapic::ServiceStub.new( + ::Google::Cloud::ResourceManager::V3::TagValues::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 + ) + + @tag_values_stub.stub_logger&.info do |entry| + entry.set_system_name + entry.set_service + entry.message = "Created client for #{entry.service}" + entry.set_credentials_fields credentials + entry.set "customEndpoint", @config.endpoint if @config.endpoint + entry.set "defaultTimeout", @config.timeout if @config.timeout + entry.set "quotaProject", @quota_project_id if @quota_project_id + end + end + + ## + # Get the associated client for long-running operations. + # + # @return [::Google::Cloud::ResourceManager::V3::TagValues::Operations] + # + attr_reader :operations_client + + ## + # The logger used for request/response debug logging. + # + # @return [Logger] + # + def logger + @tag_values_stub.logger + end + + # Service calls + + ## + # Lists all TagValues for a specific TagKey. + # + # @overload list_tag_values(request, options = nil) + # Pass arguments to `list_tag_values` via a request object, either of type + # {::Google::Cloud::ResourceManager::V3::ListTagValuesRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::ResourceManager::V3::ListTagValuesRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_tag_values(parent: nil, page_size: nil, page_token: nil) + # Pass arguments to `list_tag_values` via keyword arguments. Note that at + # least one keyword argument is 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. + # @param page_size [::Integer] + # Optional. The maximum number of TagValues to return in the response. The + # server allows a maximum of 300 TagValues to return. If unspecified, the + # server will use 100 as the default. + # @param page_token [::String] + # Optional. A pagination token returned from a previous call to + # `ListTagValues` that indicates where this listing should continue from. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Gapic::PagedEnumerable<::Google::Cloud::ResourceManager::V3::TagValue>] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Gapic::PagedEnumerable<::Google::Cloud::ResourceManager::V3::TagValue>] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/resource_manager/v3" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::ResourceManager::V3::TagValues::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::ResourceManager::V3::ListTagValuesRequest.new + # + # # Call the list_tag_values method. + # result = client.list_tag_values request + # + # # The returned object is of type Gapic::PagedEnumerable. You can iterate + # # over elements, and API calls will be issued to fetch pages as needed. + # result.each do |item| + # # Each element is of type ::Google::Cloud::ResourceManager::V3::TagValue. + # p item + # end + # + def list_tag_values request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::ResourceManager::V3::ListTagValuesRequest + + # Converts hash 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_tag_values.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::ResourceManager::V3::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.list_tag_values.timeout, + metadata: metadata, + retry_policy: @config.rpcs.list_tag_values.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @tag_values_stub.call_rpc :list_tag_values, request, options: options do |response, operation| + response = ::Gapic::PagedEnumerable.new @tag_values_stub, :list_tag_values, 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 + + ## + # Retrieves a TagValue. This method will return `PERMISSION_DENIED` if the + # value does not exist or the user does not have permission to view it. + # + # @overload get_tag_value(request, options = nil) + # Pass arguments to `get_tag_value` via a request object, either of type + # {::Google::Cloud::ResourceManager::V3::GetTagValueRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::ResourceManager::V3::GetTagValueRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_tag_value(name: nil) + # Pass arguments to `get_tag_value` via keyword arguments. Note that at + # least one keyword argument is 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. Resource name for TagValue to be fetched in the format + # `tagValues/456`. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Google::Cloud::ResourceManager::V3::TagValue] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Google::Cloud::ResourceManager::V3::TagValue] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/resource_manager/v3" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::ResourceManager::V3::TagValues::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::ResourceManager::V3::GetTagValueRequest.new + # + # # Call the get_tag_value method. + # result = client.get_tag_value request + # + # # The returned object is of type Google::Cloud::ResourceManager::V3::TagValue. + # p result + # + def get_tag_value request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::ResourceManager::V3::GetTagValueRequest + + # Converts hash 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_tag_value.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::ResourceManager::V3::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_tag_value.timeout, + metadata: metadata, + retry_policy: @config.rpcs.get_tag_value.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @tag_values_stub.call_rpc :get_tag_value, request, options: options do |response, operation| + yield response, operation if block_given? + end + rescue ::GRPC::BadStatus => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Retrieves a TagValue by its namespaced name. + # This method will return `PERMISSION_DENIED` if the value does not exist + # or the user does not have permission to view it. + # + # @overload get_namespaced_tag_value(request, options = nil) + # Pass arguments to `get_namespaced_tag_value` via a request object, either of type + # {::Google::Cloud::ResourceManager::V3::GetNamespacedTagValueRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::ResourceManager::V3::GetNamespacedTagValueRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_namespaced_tag_value(name: nil) + # Pass arguments to `get_namespaced_tag_value` via keyword arguments. Note that at + # least one keyword argument is 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. A namespaced tag value name in the following format: + # + # `{parentId}/{tagKeyShort}/{tagValueShort}` + # + # Examples: + # - `42/foo/abc` for a value with short name "abc" under the key with short + # name "foo" under the organization with ID 42 + # - `r2-d2/bar/xyz` for a value with short name "xyz" under the key with + # short name "bar" under the project with ID "r2-d2" + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Google::Cloud::ResourceManager::V3::TagValue] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Google::Cloud::ResourceManager::V3::TagValue] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/resource_manager/v3" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::ResourceManager::V3::TagValues::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::ResourceManager::V3::GetNamespacedTagValueRequest.new + # + # # Call the get_namespaced_tag_value method. + # result = client.get_namespaced_tag_value request + # + # # The returned object is of type Google::Cloud::ResourceManager::V3::TagValue. + # p result + # + def get_namespaced_tag_value request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::ResourceManager::V3::GetNamespacedTagValueRequest + + # Converts hash 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_namespaced_tag_value.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::ResourceManager::V3::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.get_namespaced_tag_value.timeout, + metadata: metadata, + retry_policy: @config.rpcs.get_namespaced_tag_value.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @tag_values_stub.call_rpc :get_namespaced_tag_value, request, options: options do |response, operation| + yield response, operation if block_given? + end + rescue ::GRPC::BadStatus => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Creates a TagValue as a child of the specified TagKey. If a another + # request with the same parameters is sent while the original request is in + # process the second request will receive an error. A maximum of 1000 + # TagValues can exist under a TagKey at any given time. + # + # @overload create_tag_value(request, options = nil) + # Pass arguments to `create_tag_value` via a request object, either of type + # {::Google::Cloud::ResourceManager::V3::CreateTagValueRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::ResourceManager::V3::CreateTagValueRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_tag_value(tag_value: nil, validate_only: nil) + # Pass arguments to `create_tag_value` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param tag_value [::Google::Cloud::ResourceManager::V3::TagValue, ::Hash] + # Required. The TagValue to be created. Only fields `short_name`, + # `description`, and `parent` are considered during the creation request. + # @param validate_only [::Boolean] + # Optional. Set as true to perform the validations necessary for creating the + # resource, but not actually perform the action. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Gapic::Operation] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Gapic::Operation] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/resource_manager/v3" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::ResourceManager::V3::TagValues::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::ResourceManager::V3::CreateTagValueRequest.new + # + # # Call the create_tag_value method. + # result = client.create_tag_value 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_tag_value request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::ResourceManager::V3::CreateTagValueRequest + + # Converts hash 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_tag_value.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::ResourceManager::V3::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.create_tag_value.timeout, + metadata: metadata, + retry_policy: @config.rpcs.create_tag_value.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @tag_values_stub.call_rpc :create_tag_value, request, options: options do |response, operation| + response = ::Gapic::Operation.new response, @operations_client, options: options + yield response, operation if block_given? + throw :response, response + end + rescue ::GRPC::BadStatus => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Updates the attributes of the TagValue resource. + # + # @overload update_tag_value(request, options = nil) + # Pass arguments to `update_tag_value` via a request object, either of type + # {::Google::Cloud::ResourceManager::V3::UpdateTagValueRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::ResourceManager::V3::UpdateTagValueRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_tag_value(tag_value: nil, update_mask: nil, validate_only: nil) + # Pass arguments to `update_tag_value` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param tag_value [::Google::Cloud::ResourceManager::V3::TagValue, ::Hash] + # Required. The new definition of the TagValue. Only fields `description` and + # `etag` fields can be updated by this request. If the `etag` field is + # nonempty, it must match the `etag` field of the existing ControlGroup. + # Otherwise, `ABORTED` will be returned. + # @param update_mask [::Google::Protobuf::FieldMask, ::Hash] + # Optional. Fields to be updated. + # @param validate_only [::Boolean] + # Optional. True to perform validations necessary for updating the resource, + # but not actually perform the action. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Gapic::Operation] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Gapic::Operation] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/resource_manager/v3" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::ResourceManager::V3::TagValues::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::ResourceManager::V3::UpdateTagValueRequest.new + # + # # Call the update_tag_value method. + # result = client.update_tag_value 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_tag_value request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::ResourceManager::V3::UpdateTagValueRequest + + # Converts hash 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_tag_value.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::ResourceManager::V3::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.tag_value&.name + header_params["tag_value.name"] = request.tag_value.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_tag_value.timeout, + metadata: metadata, + retry_policy: @config.rpcs.update_tag_value.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @tag_values_stub.call_rpc :update_tag_value, 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 TagValue. The TagValue cannot have any bindings when it is + # deleted. + # + # @overload delete_tag_value(request, options = nil) + # Pass arguments to `delete_tag_value` via a request object, either of type + # {::Google::Cloud::ResourceManager::V3::DeleteTagValueRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::ResourceManager::V3::DeleteTagValueRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_tag_value(name: nil, validate_only: nil, etag: nil) + # Pass arguments to `delete_tag_value` via keyword arguments. Note that at + # least one keyword argument is 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. Resource name for TagValue to be deleted in the format + # tagValues/456. + # @param validate_only [::Boolean] + # Optional. Set as true to perform the validations necessary for deletion, + # but not actually perform the action. + # @param etag [::String] + # Optional. The etag known to the client for the expected state of the + # TagValue. This is to be used for optimistic concurrency. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Gapic::Operation] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Gapic::Operation] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/resource_manager/v3" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::ResourceManager::V3::TagValues::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::ResourceManager::V3::DeleteTagValueRequest.new + # + # # Call the delete_tag_value method. + # result = client.delete_tag_value 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_tag_value request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::ResourceManager::V3::DeleteTagValueRequest + + # Converts hash 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_tag_value.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::ResourceManager::V3::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_tag_value.timeout, + metadata: metadata, + retry_policy: @config.rpcs.delete_tag_value.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @tag_values_stub.call_rpc :delete_tag_value, 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 the access control policy for a TagValue. The returned policy may be + # empty if no such policy or resource exists. The `resource` field should + # be the TagValue's resource name. For example: `tagValues/1234`. + # The caller must have the + # `cloudresourcemanager.googleapis.com/tagValues.getIamPolicy` permission on + # the identified TagValue to get the access control policy. + # + # @overload get_iam_policy(request, options = nil) + # Pass arguments to `get_iam_policy` via a request object, either of type + # {::Google::Iam::V1::GetIamPolicyRequest} or an equivalent Hash. + # + # @param request [::Google::Iam::V1::GetIamPolicyRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. + # + # @overload get_iam_policy(resource: nil, options: nil) + # Pass arguments to `get_iam_policy` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param resource [::String] + # REQUIRED: The resource for which the policy is being requested. + # See the operation documentation for the appropriate value for this field. + # @param options [::Google::Iam::V1::GetPolicyOptions, ::Hash] + # OPTIONAL: A `GetPolicyOptions` object for specifying options to + # `GetIamPolicy`. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Google::Iam::V1::Policy] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Google::Iam::V1::Policy] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/resource_manager/v3" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::ResourceManager::V3::TagValues::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Iam::V1::GetIamPolicyRequest.new + # + # # Call the get_iam_policy method. + # result = client.get_iam_policy request + # + # # The returned object is of type Google::Iam::V1::Policy. + # p result + # + def get_iam_policy request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Iam::V1::GetIamPolicyRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + metadata = @config.rpcs.get_iam_policy.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::ResourceManager::V3::VERSION + metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.resource + header_params["resource"] = request.resource + end + + request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") + metadata[:"x-goog-request-params"] ||= request_params_header + + options.apply_defaults timeout: @config.rpcs.get_iam_policy.timeout, + metadata: metadata, + retry_policy: @config.rpcs.get_iam_policy.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @tag_values_stub.call_rpc :get_iam_policy, request, options: options do |response, operation| + yield response, operation if block_given? + end + rescue ::GRPC::BadStatus => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Sets the access control policy on a TagValue, replacing any existing + # policy. The `resource` field should be the TagValue's resource name. + # For example: `tagValues/1234`. + # The caller must have `resourcemanager.tagValues.setIamPolicy` permission + # on the identified tagValue. + # + # @overload set_iam_policy(request, options = nil) + # Pass arguments to `set_iam_policy` via a request object, either of type + # {::Google::Iam::V1::SetIamPolicyRequest} or an equivalent Hash. + # + # @param request [::Google::Iam::V1::SetIamPolicyRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. + # + # @overload set_iam_policy(resource: nil, policy: nil, update_mask: nil) + # Pass arguments to `set_iam_policy` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param resource [::String] + # REQUIRED: The resource for which the policy is being specified. + # See the operation documentation for the appropriate value for this field. + # @param policy [::Google::Iam::V1::Policy, ::Hash] + # REQUIRED: The complete policy to be applied to the `resource`. The size of + # the policy is limited to a few 10s of KB. An empty policy is a + # valid policy but certain Cloud Platform services (such as Projects) + # might reject them. + # @param update_mask [::Google::Protobuf::FieldMask, ::Hash] + # OPTIONAL: A FieldMask specifying which fields of the policy to modify. Only + # the fields in the mask will be modified. If no mask is provided, the + # following default mask is used: + # + # `paths: "bindings, etag"` + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Google::Iam::V1::Policy] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Google::Iam::V1::Policy] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/resource_manager/v3" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::ResourceManager::V3::TagValues::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Iam::V1::SetIamPolicyRequest.new + # + # # Call the set_iam_policy method. + # result = client.set_iam_policy request + # + # # The returned object is of type Google::Iam::V1::Policy. + # p result + # + def set_iam_policy request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Iam::V1::SetIamPolicyRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + metadata = @config.rpcs.set_iam_policy.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::ResourceManager::V3::VERSION + metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.resource + header_params["resource"] = request.resource + end + + request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") + metadata[:"x-goog-request-params"] ||= request_params_header + + options.apply_defaults timeout: @config.rpcs.set_iam_policy.timeout, + metadata: metadata, + retry_policy: @config.rpcs.set_iam_policy.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @tag_values_stub.call_rpc :set_iam_policy, request, options: options do |response, operation| + yield response, operation if block_given? + end + rescue ::GRPC::BadStatus => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Returns permissions that a caller has on the specified TagValue. + # The `resource` field should be the TagValue's resource name. For example: + # `tagValues/1234`. + # + # There are no permissions required for making this API call. + # + # @overload test_iam_permissions(request, options = nil) + # Pass arguments to `test_iam_permissions` via a request object, either of type + # {::Google::Iam::V1::TestIamPermissionsRequest} or an equivalent Hash. + # + # @param request [::Google::Iam::V1::TestIamPermissionsRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. + # + # @overload test_iam_permissions(resource: nil, permissions: nil) + # Pass arguments to `test_iam_permissions` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param resource [::String] + # REQUIRED: The resource for which the policy detail is being requested. + # See the operation documentation for the appropriate value for this field. + # @param permissions [::Array<::String>] + # The set of permissions to check for the `resource`. Permissions with + # wildcards (such as '*' or 'storage.*') are not allowed. For more + # information see + # [IAM Overview](https://cloud.google.com/iam/docs/overview#permissions). + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Google::Iam::V1::TestIamPermissionsResponse] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Google::Iam::V1::TestIamPermissionsResponse] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/resource_manager/v3" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::ResourceManager::V3::TagValues::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Iam::V1::TestIamPermissionsRequest.new + # + # # Call the test_iam_permissions method. + # result = client.test_iam_permissions request + # + # # The returned object is of type Google::Iam::V1::TestIamPermissionsResponse. + # p result + # + def test_iam_permissions request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Iam::V1::TestIamPermissionsRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + metadata = @config.rpcs.test_iam_permissions.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::ResourceManager::V3::VERSION + metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.resource + header_params["resource"] = request.resource + end + + request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") + metadata[:"x-goog-request-params"] ||= request_params_header + + options.apply_defaults timeout: @config.rpcs.test_iam_permissions.timeout, + metadata: metadata, + retry_policy: @config.rpcs.test_iam_permissions.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @tag_values_stub.call_rpc :test_iam_permissions, request, options: options do |response, operation| + yield response, operation if block_given? + end + rescue ::GRPC::BadStatus => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Configuration class for the TagValues API. + # + # This class represents the configuration for TagValues, + # providing control over timeouts, retry behavior, logging, transport + # parameters, and other low-level controls. Certain parameters can also be + # applied individually to specific RPCs. See + # {::Google::Cloud::ResourceManager::V3::TagValues::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_tag_values to 20 seconds, + # # and all remaining timeouts to 10 seconds. + # ::Google::Cloud::ResourceManager::V3::TagValues::Client.configure do |config| + # config.timeout = 10.0 + # config.rpcs.list_tag_values.timeout = 20.0 + # end + # + # # Apply the above configuration only to a new client. + # client = ::Google::Cloud::ResourceManager::V3::TagValues::Client.new do |config| + # config.timeout = 10.0 + # config.rpcs.list_tag_values.timeout = 20.0 + # end + # + # @!attribute [rw] endpoint + # A custom service endpoint, as a hostname or hostname:port. The default is + # nil, indicating to use the default endpoint in the current universe domain. + # @return [::String,nil] + # @!attribute [rw] credentials + # Credentials to send with calls. You may provide any of the following types: + # * (`Google::Auth::Credentials`) A googleauth credentials object + # (see the [googleauth docs](https://rubydoc.info/gems/googleauth/Google/Auth/Credentials)) + # * (`Signet::OAuth2::Client`) A signet oauth2 client object + # (see the [signet docs](https://rubydoc.info/gems/signet/Signet/OAuth2/Client)) + # * (`GRPC::Core::Channel`) a gRPC channel with included credentials + # * (`GRPC::Core::ChannelCredentials`) a gRPC credentails object + # * (`nil`) indicating no credentials + # + # @note Warning: Passing a `String` to a keyfile path or a `Hash` of credentials + # is deprecated. Providing an unvalidated credential configuration to + # Google APIs can compromise the security of your systems and data. + # + # @example + # + # # The recommended way to provide credentials is to use the `make_creds` method + # # on the appropriate credentials class for your environment. + # + # require "googleauth" + # + # credentials = ::Google::Auth::ServiceAccountCredentials.make_creds( + # json_key_io: ::File.open("/path/to/keyfile.json") + # ) + # + # client = ::Google::Cloud::ResourceManager::V3::TagValues::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 = "cloudresourcemanager.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 TagValues 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_tag_values` + # @return [::Gapic::Config::Method] + # + attr_reader :list_tag_values + ## + # RPC-specific configuration for `get_tag_value` + # @return [::Gapic::Config::Method] + # + attr_reader :get_tag_value + ## + # RPC-specific configuration for `get_namespaced_tag_value` + # @return [::Gapic::Config::Method] + # + attr_reader :get_namespaced_tag_value + ## + # RPC-specific configuration for `create_tag_value` + # @return [::Gapic::Config::Method] + # + attr_reader :create_tag_value + ## + # RPC-specific configuration for `update_tag_value` + # @return [::Gapic::Config::Method] + # + attr_reader :update_tag_value + ## + # RPC-specific configuration for `delete_tag_value` + # @return [::Gapic::Config::Method] + # + attr_reader :delete_tag_value + ## + # RPC-specific configuration for `get_iam_policy` + # @return [::Gapic::Config::Method] + # + attr_reader :get_iam_policy + ## + # RPC-specific configuration for `set_iam_policy` + # @return [::Gapic::Config::Method] + # + attr_reader :set_iam_policy + ## + # RPC-specific configuration for `test_iam_permissions` + # @return [::Gapic::Config::Method] + # + attr_reader :test_iam_permissions + + # @private + def initialize parent_rpcs = nil + list_tag_values_config = parent_rpcs.list_tag_values if parent_rpcs.respond_to? :list_tag_values + @list_tag_values = ::Gapic::Config::Method.new list_tag_values_config + get_tag_value_config = parent_rpcs.get_tag_value if parent_rpcs.respond_to? :get_tag_value + @get_tag_value = ::Gapic::Config::Method.new get_tag_value_config + get_namespaced_tag_value_config = parent_rpcs.get_namespaced_tag_value if parent_rpcs.respond_to? :get_namespaced_tag_value + @get_namespaced_tag_value = ::Gapic::Config::Method.new get_namespaced_tag_value_config + create_tag_value_config = parent_rpcs.create_tag_value if parent_rpcs.respond_to? :create_tag_value + @create_tag_value = ::Gapic::Config::Method.new create_tag_value_config + update_tag_value_config = parent_rpcs.update_tag_value if parent_rpcs.respond_to? :update_tag_value + @update_tag_value = ::Gapic::Config::Method.new update_tag_value_config + delete_tag_value_config = parent_rpcs.delete_tag_value if parent_rpcs.respond_to? :delete_tag_value + @delete_tag_value = ::Gapic::Config::Method.new delete_tag_value_config + get_iam_policy_config = parent_rpcs.get_iam_policy if parent_rpcs.respond_to? :get_iam_policy + @get_iam_policy = ::Gapic::Config::Method.new get_iam_policy_config + set_iam_policy_config = parent_rpcs.set_iam_policy if parent_rpcs.respond_to? :set_iam_policy + @set_iam_policy = ::Gapic::Config::Method.new set_iam_policy_config + test_iam_permissions_config = parent_rpcs.test_iam_permissions if parent_rpcs.respond_to? :test_iam_permissions + @test_iam_permissions = ::Gapic::Config::Method.new test_iam_permissions_config + + yield self if block_given? + end + end + end + end + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-resource_manager-v3/lib/google/cloud/resource_manager/v3/tag_values/credentials.rb b/owl-bot-staging/google-cloud-resource_manager-v3/lib/google/cloud/resource_manager/v3/tag_values/credentials.rb new file mode 100644 index 000000000000..4eddb68dc221 --- /dev/null +++ b/owl-bot-staging/google-cloud-resource_manager-v3/lib/google/cloud/resource_manager/v3/tag_values/credentials.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 "googleauth" + +module Google + module Cloud + module ResourceManager + module V3 + module TagValues + # Credentials for the TagValues API. + class Credentials < ::Google::Auth::Credentials + self.scope = [ + "https://www.googleapis.com/auth/cloud-platform", + "https://www.googleapis.com/auth/cloud-platform.read-only" + ] + self.env_vars = [ + "RESOURCE_MANAGER_CREDENTIALS", + "RESOURCE_MANAGER_KEYFILE", + "GOOGLE_CLOUD_CREDENTIALS", + "GOOGLE_CLOUD_KEYFILE", + "GCLOUD_KEYFILE", + "RESOURCE_MANAGER_CREDENTIALS_JSON", + "RESOURCE_MANAGER_KEYFILE_JSON", + "GOOGLE_CLOUD_CREDENTIALS_JSON", + "GOOGLE_CLOUD_KEYFILE_JSON", + "GCLOUD_KEYFILE_JSON" + ] + self.paths = [ + "~/.config/google_cloud/application_default_credentials.json" + ] + end + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-resource_manager-v3/lib/google/cloud/resource_manager/v3/tag_values/operations.rb b/owl-bot-staging/google-cloud-resource_manager-v3/lib/google/cloud/resource_manager/v3/tag_values/operations.rb new file mode 100644 index 000000000000..64fb7719d479 --- /dev/null +++ b/owl-bot-staging/google-cloud-resource_manager-v3/lib/google/cloud/resource_manager/v3/tag_values/operations.rb @@ -0,0 +1,841 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +require "gapic/operation" +require "google/longrunning/operations_pb" + +module Google + module Cloud + module ResourceManager + module V3 + module TagValues + # Service that implements Longrunning Operations API. + class Operations + # @private + API_VERSION = "" + + # @private + DEFAULT_ENDPOINT_TEMPLATE = "cloudresourcemanager.$UNIVERSE_DOMAIN$" + + # @private + attr_reader :operations_stub + + ## + # Configuration for the TagValues 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 TagValues 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::ResourceManager::V3::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::ResourceManager::V3::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::ResourceManager::V3::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::ResourceManager::V3::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::ResourceManager::V3::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 = "cloudresourcemanager.googleapis.com" + + config_attr :endpoint, nil, ::String, nil + config_attr :credentials, nil do |value| + allowed = [::String, ::Hash, ::Proc, ::Symbol, ::Google::Auth::Credentials, ::Google::Auth::BaseClient, ::Signet::OAuth2::Client, nil] + allowed += [::GRPC::Core::Channel, ::GRPC::Core::ChannelCredentials] if defined? ::GRPC::Core::Channel + allowed.any? { |klass| klass === value } + end + config_attr :scope, nil, ::String, ::Array, nil + config_attr :lib_name, nil, ::String, nil + config_attr :lib_version, nil, ::String, nil + config_attr(:channel_args, { "grpc.service_config_disable_resolution" => 1 }, ::Hash, nil) + config_attr :interceptors, nil, ::Array, nil + config_attr :timeout, nil, ::Numeric, nil + config_attr :metadata, nil, ::Hash, nil + config_attr :retry_policy, nil, ::Hash, ::Proc, nil + config_attr :quota_project, nil, ::String, nil + config_attr :universe_domain, nil, ::String, nil + config_attr :logger, :default, ::Logger, nil, :default + + # @private + def initialize parent_config = nil + @parent_config = parent_config unless parent_config.nil? + + yield self if block_given? + end + + ## + # Configurations for individual RPCs + # @return [Rpcs] + # + def rpcs + @rpcs ||= begin + parent_rpcs = nil + parent_rpcs = @parent_config.rpcs if defined?(@parent_config) && @parent_config.respond_to?(:rpcs) + Rpcs.new parent_rpcs + end + end + + ## + # Configuration for the channel pool + # @return [::Gapic::ServiceStub::ChannelPool::Configuration] + # + def channel_pool + @channel_pool ||= ::Gapic::ServiceStub::ChannelPool::Configuration.new + end + + ## + # Configuration RPC class for the Operations API. + # + # Includes fields providing the configuration for each RPC in this service. + # Each configuration object is of type `Gapic::Config::Method` and includes + # the following configuration fields: + # + # * `timeout` (*type:* `Numeric`) - The call timeout in seconds + # * `metadata` (*type:* `Hash{Symbol=>String}`) - Additional gRPC headers + # * `retry_policy (*type:* `Hash`) - The retry policy. The policy fields + # include the following keys: + # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds. + # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds. + # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier. + # * `:retry_codes` (*type:* `Array`) - The error codes that should + # trigger a retry. + # + class Rpcs + ## + # RPC-specific configuration for `list_operations` + # @return [::Gapic::Config::Method] + # + attr_reader :list_operations + ## + # RPC-specific configuration for `get_operation` + # @return [::Gapic::Config::Method] + # + attr_reader :get_operation + ## + # RPC-specific configuration for `delete_operation` + # @return [::Gapic::Config::Method] + # + attr_reader :delete_operation + ## + # RPC-specific configuration for `cancel_operation` + # @return [::Gapic::Config::Method] + # + attr_reader :cancel_operation + ## + # RPC-specific configuration for `wait_operation` + # @return [::Gapic::Config::Method] + # + attr_reader :wait_operation + + # @private + def initialize parent_rpcs = nil + list_operations_config = parent_rpcs.list_operations if parent_rpcs.respond_to? :list_operations + @list_operations = ::Gapic::Config::Method.new list_operations_config + get_operation_config = parent_rpcs.get_operation if parent_rpcs.respond_to? :get_operation + @get_operation = ::Gapic::Config::Method.new get_operation_config + delete_operation_config = parent_rpcs.delete_operation if parent_rpcs.respond_to? :delete_operation + @delete_operation = ::Gapic::Config::Method.new delete_operation_config + cancel_operation_config = parent_rpcs.cancel_operation if parent_rpcs.respond_to? :cancel_operation + @cancel_operation = ::Gapic::Config::Method.new cancel_operation_config + wait_operation_config = parent_rpcs.wait_operation if parent_rpcs.respond_to? :wait_operation + @wait_operation = ::Gapic::Config::Method.new wait_operation_config + + yield self if block_given? + end + end + end + end + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-resource_manager-v3/lib/google/cloud/resource_manager/v3/tag_values/paths.rb b/owl-bot-staging/google-cloud-resource_manager-v3/lib/google/cloud/resource_manager/v3/tag_values/paths.rb new file mode 100644 index 000000000000..07f732d41df2 --- /dev/null +++ b/owl-bot-staging/google-cloud-resource_manager-v3/lib/google/cloud/resource_manager/v3/tag_values/paths.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! + + +module Google + module Cloud + module ResourceManager + module V3 + module TagValues + # Path helper methods for the TagValues API. + module Paths + ## + # Create a fully-qualified TagValue resource string. + # + # The resource will be in the following format: + # + # `tagValues/{tag_value}` + # + # @param tag_value [String] + # + # @return [::String] + def tag_value_path tag_value: + "tagValues/#{tag_value}" + end + + extend self + end + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-resource_manager-v3/lib/google/cloud/resource_manager/v3/tag_values/rest.rb b/owl-bot-staging/google-cloud-resource_manager-v3/lib/google/cloud/resource_manager/v3/tag_values/rest.rb new file mode 100644 index 000000000000..0bc46ddc107f --- /dev/null +++ b/owl-bot-staging/google-cloud-resource_manager-v3/lib/google/cloud/resource_manager/v3/tag_values/rest.rb @@ -0,0 +1,53 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +require "gapic/rest" +require "gapic/config" +require "gapic/config/method" + +require "google/cloud/resource_manager/v3/version" + +require "google/cloud/resource_manager/v3/tag_values/credentials" +require "google/cloud/resource_manager/v3/tag_values/paths" +require "google/cloud/resource_manager/v3/tag_values/rest/operations" +require "google/cloud/resource_manager/v3/tag_values/rest/client" + +module Google + module Cloud + module ResourceManager + module V3 + ## + # Allow users to create and manage tag values. + # + # To load this service and instantiate a REST client: + # + # require "google/cloud/resource_manager/v3/tag_values/rest" + # client = ::Google::Cloud::ResourceManager::V3::TagValues::Rest::Client.new + # + module TagValues + # Client for the REST transport + module Rest + end + end + end + end + end +end + +helper_path = ::File.join __dir__, "rest", "helpers.rb" +require "google/cloud/resource_manager/v3/tag_values/rest/helpers" if ::File.file? helper_path diff --git a/owl-bot-staging/google-cloud-resource_manager-v3/lib/google/cloud/resource_manager/v3/tag_values/rest/client.rb b/owl-bot-staging/google-cloud-resource_manager-v3/lib/google/cloud/resource_manager/v3/tag_values/rest/client.rb new file mode 100644 index 000000000000..dfe8b2265922 --- /dev/null +++ b/owl-bot-staging/google-cloud-resource_manager-v3/lib/google/cloud/resource_manager/v3/tag_values/rest/client.rb @@ -0,0 +1,1251 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +require "google/cloud/errors" +require "google/cloud/resourcemanager/v3/tag_values_pb" +require "google/cloud/resource_manager/v3/tag_values/rest/service_stub" + +module Google + module Cloud + module ResourceManager + module V3 + module TagValues + module Rest + ## + # REST client for the TagValues service. + # + # Allow users to create and manage tag values. + # + class Client + # @private + API_VERSION = "" + + # @private + DEFAULT_ENDPOINT_TEMPLATE = "cloudresourcemanager.$UNIVERSE_DOMAIN$" + + include Paths + + # @private + attr_reader :tag_values_stub + + ## + # Configure the TagValues Client class. + # + # See {::Google::Cloud::ResourceManager::V3::TagValues::Rest::Client::Configuration} + # for a description of the configuration fields. + # + # @example + # + # # Modify the configuration for all TagValues clients + # ::Google::Cloud::ResourceManager::V3::TagValues::Rest::Client.configure do |config| + # config.timeout = 10.0 + # end + # + # @yield [config] Configure the Client client. + # @yieldparam config [Client::Configuration] + # + # @return [Client::Configuration] + # + def self.configure + @configure ||= begin + namespace = ["Google", "Cloud", "ResourceManager", "V3"] + parent_config = while namespace.any? + parent_name = namespace.join "::" + parent_const = const_get parent_name + break parent_const.configure if parent_const.respond_to? :configure + namespace.pop + end + default_config = Client::Configuration.new parent_config + + default_config.rpcs.list_tag_values.timeout = 60.0 + default_config.rpcs.list_tag_values.retry_policy = { + initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [14] + } + + default_config.rpcs.get_tag_value.timeout = 60.0 + default_config.rpcs.get_tag_value.retry_policy = { + initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [14] + } + + default_config.rpcs.create_tag_value.timeout = 60.0 + + default_config.rpcs.update_tag_value.timeout = 60.0 + + default_config.rpcs.delete_tag_value.timeout = 60.0 + + default_config.rpcs.get_iam_policy.timeout = 60.0 + default_config.rpcs.get_iam_policy.retry_policy = { + initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [14] + } + + default_config.rpcs.set_iam_policy.timeout = 60.0 + + default_config + end + yield @configure if block_given? + @configure + end + + ## + # Configure the TagValues Client instance. + # + # The configuration is set to the derived mode, meaning that values can be changed, + # but structural changes (adding new fields, etc.) are not allowed. Structural changes + # should be made on {Client.configure}. + # + # See {::Google::Cloud::ResourceManager::V3::TagValues::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 + @tag_values_stub.universe_domain + end + + ## + # Create a new TagValues REST client object. + # + # @example + # + # # Create a client using the default configuration + # client = ::Google::Cloud::ResourceManager::V3::TagValues::Rest::Client.new + # + # # Create a client using a custom configuration + # client = ::Google::Cloud::ResourceManager::V3::TagValues::Rest::Client.new do |config| + # config.timeout = 10.0 + # end + # + # @yield [config] Configure the TagValues client. + # @yieldparam config [Client::Configuration] + # + def initialize + # Create the configuration object + @config = Configuration.new Client.configure + + # Yield the configuration if needed + yield @config if block_given? + + # Create credentials + credentials = @config.credentials + # Use self-signed JWT if the endpoint is unchanged from default, + # but only if the default endpoint does not have a region prefix. + enable_self_signed_jwt = @config.endpoint.nil? || + (@config.endpoint == Configuration::DEFAULT_ENDPOINT && + !@config.endpoint.split(".").first.include?("-")) + credentials ||= Credentials.default scope: @config.scope, + enable_self_signed_jwt: enable_self_signed_jwt + if credentials.is_a?(::String) || credentials.is_a?(::Hash) + credentials = Credentials.new credentials, scope: @config.scope + end + + @quota_project_id = @config.quota_project + @quota_project_id ||= credentials.quota_project_id if credentials.respond_to? :quota_project_id + + @operations_client = ::Google::Cloud::ResourceManager::V3::TagValues::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 + + @tag_values_stub = ::Google::Cloud::ResourceManager::V3::TagValues::Rest::ServiceStub.new( + endpoint: @config.endpoint, + endpoint_template: DEFAULT_ENDPOINT_TEMPLATE, + universe_domain: @config.universe_domain, + credentials: credentials, + logger: @config.logger + ) + + @tag_values_stub.logger(stub: true)&.info do |entry| + entry.set_system_name + entry.set_service + entry.message = "Created client for #{entry.service}" + entry.set_credentials_fields credentials + entry.set "customEndpoint", @config.endpoint if @config.endpoint + entry.set "defaultTimeout", @config.timeout if @config.timeout + entry.set "quotaProject", @quota_project_id if @quota_project_id + end + end + + ## + # Get the associated client for long-running operations. + # + # @return [::Google::Cloud::ResourceManager::V3::TagValues::Rest::Operations] + # + attr_reader :operations_client + + ## + # The logger used for request/response debug logging. + # + # @return [Logger] + # + def logger + @tag_values_stub.logger + end + + # Service calls + + ## + # Lists all TagValues for a specific TagKey. + # + # @overload list_tag_values(request, options = nil) + # Pass arguments to `list_tag_values` via a request object, either of type + # {::Google::Cloud::ResourceManager::V3::ListTagValuesRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::ResourceManager::V3::ListTagValuesRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_tag_values(parent: nil, page_size: nil, page_token: nil) + # Pass arguments to `list_tag_values` via keyword arguments. Note that at + # least one keyword argument is 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. + # @param page_size [::Integer] + # Optional. The maximum number of TagValues to return in the response. The + # server allows a maximum of 300 TagValues to return. If unspecified, the + # server will use 100 as the default. + # @param page_token [::String] + # Optional. A pagination token returned from a previous call to + # `ListTagValues` that indicates where this listing should continue from. + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Gapic::Rest::PagedEnumerable<::Google::Cloud::ResourceManager::V3::TagValue>] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Gapic::Rest::PagedEnumerable<::Google::Cloud::ResourceManager::V3::TagValue>] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/resource_manager/v3" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::ResourceManager::V3::TagValues::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::ResourceManager::V3::ListTagValuesRequest.new + # + # # Call the list_tag_values method. + # result = client.list_tag_values request + # + # # The returned object is of type Gapic::PagedEnumerable. You can iterate + # # over elements, and API calls will be issued to fetch pages as needed. + # result.each do |item| + # # Each element is of type ::Google::Cloud::ResourceManager::V3::TagValue. + # p item + # end + # + def list_tag_values request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::ResourceManager::V3::ListTagValuesRequest + + # Converts hash 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_tag_values.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::ResourceManager::V3::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_tag_values.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.list_tag_values.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @tag_values_stub.list_tag_values request, options do |result, operation| + result = ::Gapic::Rest::PagedEnumerable.new @tag_values_stub, :list_tag_values, "tag_values", 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 + + ## + # Retrieves a TagValue. This method will return `PERMISSION_DENIED` if the + # value does not exist or the user does not have permission to view it. + # + # @overload get_tag_value(request, options = nil) + # Pass arguments to `get_tag_value` via a request object, either of type + # {::Google::Cloud::ResourceManager::V3::GetTagValueRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::ResourceManager::V3::GetTagValueRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_tag_value(name: nil) + # Pass arguments to `get_tag_value` via keyword arguments. Note that at + # least one keyword argument is 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. Resource name for TagValue to be fetched in the format + # `tagValues/456`. + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Cloud::ResourceManager::V3::TagValue] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::ResourceManager::V3::TagValue] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/resource_manager/v3" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::ResourceManager::V3::TagValues::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::ResourceManager::V3::GetTagValueRequest.new + # + # # Call the get_tag_value method. + # result = client.get_tag_value request + # + # # The returned object is of type Google::Cloud::ResourceManager::V3::TagValue. + # p result + # + def get_tag_value request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::ResourceManager::V3::GetTagValueRequest + + # Converts hash 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_tag_value.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::ResourceManager::V3::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_tag_value.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.get_tag_value.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @tag_values_stub.get_tag_value 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 + + ## + # Retrieves a TagValue by its namespaced name. + # This method will return `PERMISSION_DENIED` if the value does not exist + # or the user does not have permission to view it. + # + # @overload get_namespaced_tag_value(request, options = nil) + # Pass arguments to `get_namespaced_tag_value` via a request object, either of type + # {::Google::Cloud::ResourceManager::V3::GetNamespacedTagValueRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::ResourceManager::V3::GetNamespacedTagValueRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_namespaced_tag_value(name: nil) + # Pass arguments to `get_namespaced_tag_value` via keyword arguments. Note that at + # least one keyword argument is 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. A namespaced tag value name in the following format: + # + # `{parentId}/{tagKeyShort}/{tagValueShort}` + # + # Examples: + # - `42/foo/abc` for a value with short name "abc" under the key with short + # name "foo" under the organization with ID 42 + # - `r2-d2/bar/xyz` for a value with short name "xyz" under the key with + # short name "bar" under the project with ID "r2-d2" + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Cloud::ResourceManager::V3::TagValue] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::ResourceManager::V3::TagValue] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/resource_manager/v3" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::ResourceManager::V3::TagValues::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::ResourceManager::V3::GetNamespacedTagValueRequest.new + # + # # Call the get_namespaced_tag_value method. + # result = client.get_namespaced_tag_value request + # + # # The returned object is of type Google::Cloud::ResourceManager::V3::TagValue. + # p result + # + def get_namespaced_tag_value request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::ResourceManager::V3::GetNamespacedTagValueRequest + + # Converts hash 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_namespaced_tag_value.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::ResourceManager::V3::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_namespaced_tag_value.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.get_namespaced_tag_value.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @tag_values_stub.get_namespaced_tag_value request, options do |result, operation| + yield result, operation if block_given? + end + rescue ::Gapic::Rest::Error => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Creates a TagValue as a child of the specified TagKey. If a another + # request with the same parameters is sent while the original request is in + # process the second request will receive an error. A maximum of 1000 + # TagValues can exist under a TagKey at any given time. + # + # @overload create_tag_value(request, options = nil) + # Pass arguments to `create_tag_value` via a request object, either of type + # {::Google::Cloud::ResourceManager::V3::CreateTagValueRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::ResourceManager::V3::CreateTagValueRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_tag_value(tag_value: nil, validate_only: nil) + # Pass arguments to `create_tag_value` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param tag_value [::Google::Cloud::ResourceManager::V3::TagValue, ::Hash] + # Required. The TagValue to be created. Only fields `short_name`, + # `description`, and `parent` are considered during the creation request. + # @param validate_only [::Boolean] + # Optional. Set as true to perform the validations necessary for creating the + # resource, but not actually perform the action. + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Gapic::Operation] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Gapic::Operation] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/resource_manager/v3" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::ResourceManager::V3::TagValues::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::ResourceManager::V3::CreateTagValueRequest.new + # + # # Call the create_tag_value method. + # result = client.create_tag_value 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_tag_value request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::ResourceManager::V3::CreateTagValueRequest + + # Converts hash 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_tag_value.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::ResourceManager::V3::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_tag_value.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.create_tag_value.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @tag_values_stub.create_tag_value 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 + + ## + # Updates the attributes of the TagValue resource. + # + # @overload update_tag_value(request, options = nil) + # Pass arguments to `update_tag_value` via a request object, either of type + # {::Google::Cloud::ResourceManager::V3::UpdateTagValueRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::ResourceManager::V3::UpdateTagValueRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_tag_value(tag_value: nil, update_mask: nil, validate_only: nil) + # Pass arguments to `update_tag_value` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param tag_value [::Google::Cloud::ResourceManager::V3::TagValue, ::Hash] + # Required. The new definition of the TagValue. Only fields `description` and + # `etag` fields can be updated by this request. If the `etag` field is + # nonempty, it must match the `etag` field of the existing ControlGroup. + # Otherwise, `ABORTED` will be returned. + # @param update_mask [::Google::Protobuf::FieldMask, ::Hash] + # Optional. Fields to be updated. + # @param validate_only [::Boolean] + # Optional. True to perform validations necessary for updating the resource, + # but not actually perform the action. + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Gapic::Operation] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Gapic::Operation] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/resource_manager/v3" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::ResourceManager::V3::TagValues::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::ResourceManager::V3::UpdateTagValueRequest.new + # + # # Call the update_tag_value method. + # result = client.update_tag_value 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_tag_value request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::ResourceManager::V3::UpdateTagValueRequest + + # Converts hash 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_tag_value.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::ResourceManager::V3::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_tag_value.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.update_tag_value.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @tag_values_stub.update_tag_value 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 TagValue. The TagValue cannot have any bindings when it is + # deleted. + # + # @overload delete_tag_value(request, options = nil) + # Pass arguments to `delete_tag_value` via a request object, either of type + # {::Google::Cloud::ResourceManager::V3::DeleteTagValueRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::ResourceManager::V3::DeleteTagValueRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_tag_value(name: nil, validate_only: nil, etag: nil) + # Pass arguments to `delete_tag_value` via keyword arguments. Note that at + # least one keyword argument is 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. Resource name for TagValue to be deleted in the format + # tagValues/456. + # @param validate_only [::Boolean] + # Optional. Set as true to perform the validations necessary for deletion, + # but not actually perform the action. + # @param etag [::String] + # Optional. The etag known to the client for the expected state of the + # TagValue. This is to be used for optimistic concurrency. + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Gapic::Operation] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Gapic::Operation] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/resource_manager/v3" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::ResourceManager::V3::TagValues::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::ResourceManager::V3::DeleteTagValueRequest.new + # + # # Call the delete_tag_value method. + # result = client.delete_tag_value 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_tag_value request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::ResourceManager::V3::DeleteTagValueRequest + + # Converts hash 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_tag_value.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::ResourceManager::V3::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_tag_value.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.delete_tag_value.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @tag_values_stub.delete_tag_value 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 the access control policy for a TagValue. The returned policy may be + # empty if no such policy or resource exists. The `resource` field should + # be the TagValue's resource name. For example: `tagValues/1234`. + # The caller must have the + # `cloudresourcemanager.googleapis.com/tagValues.getIamPolicy` permission on + # the identified TagValue to get the access control policy. + # + # @overload get_iam_policy(request, options = nil) + # Pass arguments to `get_iam_policy` via a request object, either of type + # {::Google::Iam::V1::GetIamPolicyRequest} or an equivalent Hash. + # + # @param request [::Google::Iam::V1::GetIamPolicyRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @overload get_iam_policy(resource: nil, options: nil) + # Pass arguments to `get_iam_policy` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param resource [::String] + # REQUIRED: The resource for which the policy is being requested. + # See the operation documentation for the appropriate value for this field. + # @param options [::Google::Iam::V1::GetPolicyOptions, ::Hash] + # OPTIONAL: A `GetPolicyOptions` object for specifying options to + # `GetIamPolicy`. + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Iam::V1::Policy] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Iam::V1::Policy] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/resource_manager/v3" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::ResourceManager::V3::TagValues::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Iam::V1::GetIamPolicyRequest.new + # + # # Call the get_iam_policy method. + # result = client.get_iam_policy request + # + # # The returned object is of type Google::Iam::V1::Policy. + # p result + # + def get_iam_policy request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Iam::V1::GetIamPolicyRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + call_metadata = @config.rpcs.get_iam_policy.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::ResourceManager::V3::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + options.apply_defaults timeout: @config.rpcs.get_iam_policy.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.get_iam_policy.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @tag_values_stub.get_iam_policy request, options do |result, operation| + yield result, operation if block_given? + end + rescue ::Gapic::Rest::Error => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Sets the access control policy on a TagValue, replacing any existing + # policy. The `resource` field should be the TagValue's resource name. + # For example: `tagValues/1234`. + # The caller must have `resourcemanager.tagValues.setIamPolicy` permission + # on the identified tagValue. + # + # @overload set_iam_policy(request, options = nil) + # Pass arguments to `set_iam_policy` via a request object, either of type + # {::Google::Iam::V1::SetIamPolicyRequest} or an equivalent Hash. + # + # @param request [::Google::Iam::V1::SetIamPolicyRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @overload set_iam_policy(resource: nil, policy: nil, update_mask: nil) + # Pass arguments to `set_iam_policy` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param resource [::String] + # REQUIRED: The resource for which the policy is being specified. + # See the operation documentation for the appropriate value for this field. + # @param policy [::Google::Iam::V1::Policy, ::Hash] + # REQUIRED: The complete policy to be applied to the `resource`. The size of + # the policy is limited to a few 10s of KB. An empty policy is a + # valid policy but certain Cloud Platform services (such as Projects) + # might reject them. + # @param update_mask [::Google::Protobuf::FieldMask, ::Hash] + # OPTIONAL: A FieldMask specifying which fields of the policy to modify. Only + # the fields in the mask will be modified. If no mask is provided, the + # following default mask is used: + # + # `paths: "bindings, etag"` + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Iam::V1::Policy] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Iam::V1::Policy] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/resource_manager/v3" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::ResourceManager::V3::TagValues::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Iam::V1::SetIamPolicyRequest.new + # + # # Call the set_iam_policy method. + # result = client.set_iam_policy request + # + # # The returned object is of type Google::Iam::V1::Policy. + # p result + # + def set_iam_policy request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Iam::V1::SetIamPolicyRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + call_metadata = @config.rpcs.set_iam_policy.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::ResourceManager::V3::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + options.apply_defaults timeout: @config.rpcs.set_iam_policy.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.set_iam_policy.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @tag_values_stub.set_iam_policy request, options do |result, operation| + yield result, operation if block_given? + end + rescue ::Gapic::Rest::Error => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Returns permissions that a caller has on the specified TagValue. + # The `resource` field should be the TagValue's resource name. For example: + # `tagValues/1234`. + # + # There are no permissions required for making this API call. + # + # @overload test_iam_permissions(request, options = nil) + # Pass arguments to `test_iam_permissions` via a request object, either of type + # {::Google::Iam::V1::TestIamPermissionsRequest} or an equivalent Hash. + # + # @param request [::Google::Iam::V1::TestIamPermissionsRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @overload test_iam_permissions(resource: nil, permissions: nil) + # Pass arguments to `test_iam_permissions` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param resource [::String] + # REQUIRED: The resource for which the policy detail is being requested. + # See the operation documentation for the appropriate value for this field. + # @param permissions [::Array<::String>] + # The set of permissions to check for the `resource`. Permissions with + # wildcards (such as '*' or 'storage.*') are not allowed. For more + # information see + # [IAM Overview](https://cloud.google.com/iam/docs/overview#permissions). + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Iam::V1::TestIamPermissionsResponse] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Iam::V1::TestIamPermissionsResponse] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/resource_manager/v3" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::ResourceManager::V3::TagValues::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Iam::V1::TestIamPermissionsRequest.new + # + # # Call the test_iam_permissions method. + # result = client.test_iam_permissions request + # + # # The returned object is of type Google::Iam::V1::TestIamPermissionsResponse. + # p result + # + def test_iam_permissions request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Iam::V1::TestIamPermissionsRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + call_metadata = @config.rpcs.test_iam_permissions.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::ResourceManager::V3::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + options.apply_defaults timeout: @config.rpcs.test_iam_permissions.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.test_iam_permissions.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @tag_values_stub.test_iam_permissions request, options do |result, operation| + yield result, operation if block_given? + end + rescue ::Gapic::Rest::Error => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Configuration class for the TagValues REST API. + # + # This class represents the configuration for TagValues REST, + # providing control over timeouts, retry behavior, logging, transport + # parameters, and other low-level controls. Certain parameters can also be + # applied individually to specific RPCs. See + # {::Google::Cloud::ResourceManager::V3::TagValues::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_tag_values to 20 seconds, + # # and all remaining timeouts to 10 seconds. + # ::Google::Cloud::ResourceManager::V3::TagValues::Rest::Client.configure do |config| + # config.timeout = 10.0 + # config.rpcs.list_tag_values.timeout = 20.0 + # end + # + # # Apply the above configuration only to a new client. + # client = ::Google::Cloud::ResourceManager::V3::TagValues::Rest::Client.new do |config| + # config.timeout = 10.0 + # config.rpcs.list_tag_values.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 = "cloudresourcemanager.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 TagValues 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_tag_values` + # @return [::Gapic::Config::Method] + # + attr_reader :list_tag_values + ## + # RPC-specific configuration for `get_tag_value` + # @return [::Gapic::Config::Method] + # + attr_reader :get_tag_value + ## + # RPC-specific configuration for `get_namespaced_tag_value` + # @return [::Gapic::Config::Method] + # + attr_reader :get_namespaced_tag_value + ## + # RPC-specific configuration for `create_tag_value` + # @return [::Gapic::Config::Method] + # + attr_reader :create_tag_value + ## + # RPC-specific configuration for `update_tag_value` + # @return [::Gapic::Config::Method] + # + attr_reader :update_tag_value + ## + # RPC-specific configuration for `delete_tag_value` + # @return [::Gapic::Config::Method] + # + attr_reader :delete_tag_value + ## + # RPC-specific configuration for `get_iam_policy` + # @return [::Gapic::Config::Method] + # + attr_reader :get_iam_policy + ## + # RPC-specific configuration for `set_iam_policy` + # @return [::Gapic::Config::Method] + # + attr_reader :set_iam_policy + ## + # RPC-specific configuration for `test_iam_permissions` + # @return [::Gapic::Config::Method] + # + attr_reader :test_iam_permissions + + # @private + def initialize parent_rpcs = nil + list_tag_values_config = parent_rpcs.list_tag_values if parent_rpcs.respond_to? :list_tag_values + @list_tag_values = ::Gapic::Config::Method.new list_tag_values_config + get_tag_value_config = parent_rpcs.get_tag_value if parent_rpcs.respond_to? :get_tag_value + @get_tag_value = ::Gapic::Config::Method.new get_tag_value_config + get_namespaced_tag_value_config = parent_rpcs.get_namespaced_tag_value if parent_rpcs.respond_to? :get_namespaced_tag_value + @get_namespaced_tag_value = ::Gapic::Config::Method.new get_namespaced_tag_value_config + create_tag_value_config = parent_rpcs.create_tag_value if parent_rpcs.respond_to? :create_tag_value + @create_tag_value = ::Gapic::Config::Method.new create_tag_value_config + update_tag_value_config = parent_rpcs.update_tag_value if parent_rpcs.respond_to? :update_tag_value + @update_tag_value = ::Gapic::Config::Method.new update_tag_value_config + delete_tag_value_config = parent_rpcs.delete_tag_value if parent_rpcs.respond_to? :delete_tag_value + @delete_tag_value = ::Gapic::Config::Method.new delete_tag_value_config + get_iam_policy_config = parent_rpcs.get_iam_policy if parent_rpcs.respond_to? :get_iam_policy + @get_iam_policy = ::Gapic::Config::Method.new get_iam_policy_config + set_iam_policy_config = parent_rpcs.set_iam_policy if parent_rpcs.respond_to? :set_iam_policy + @set_iam_policy = ::Gapic::Config::Method.new set_iam_policy_config + test_iam_permissions_config = parent_rpcs.test_iam_permissions if parent_rpcs.respond_to? :test_iam_permissions + @test_iam_permissions = ::Gapic::Config::Method.new test_iam_permissions_config + + yield self if block_given? + end + end + end + end + end + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-resource_manager-v3/lib/google/cloud/resource_manager/v3/tag_values/rest/operations.rb b/owl-bot-staging/google-cloud-resource_manager-v3/lib/google/cloud/resource_manager/v3/tag_values/rest/operations.rb new file mode 100644 index 000000000000..f27a3d939b2c --- /dev/null +++ b/owl-bot-staging/google-cloud-resource_manager-v3/lib/google/cloud/resource_manager/v3/tag_values/rest/operations.rb @@ -0,0 +1,925 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +require "gapic/operation" + +module Google + module Cloud + module ResourceManager + module V3 + module TagValues + module Rest + # Service that implements Longrunning Operations API. + class Operations + # @private + API_VERSION = "" + + # @private + DEFAULT_ENDPOINT_TEMPLATE = "cloudresourcemanager.$UNIVERSE_DOMAIN$" + + # @private + attr_reader :operations_stub + + ## + # Configuration for the TagValues 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 TagValues 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::ResourceManager::V3::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::ResourceManager::V3::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::ResourceManager::V3::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::ResourceManager::V3::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 = "cloudresourcemanager.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: "/v3/{name}", + matches: [ + ["name", %r{^operations(?:/.*)?$}, true] + ] + ) + 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 +end diff --git a/owl-bot-staging/google-cloud-resource_manager-v3/lib/google/cloud/resource_manager/v3/tag_values/rest/service_stub.rb b/owl-bot-staging/google-cloud-resource_manager-v3/lib/google/cloud/resource_manager/v3/tag_values/rest/service_stub.rb new file mode 100644 index 000000000000..85d0829d0e89 --- /dev/null +++ b/owl-bot-staging/google-cloud-resource_manager-v3/lib/google/cloud/resource_manager/v3/tag_values/rest/service_stub.rb @@ -0,0 +1,629 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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/resourcemanager/v3/tag_values_pb" + +module Google + module Cloud + module ResourceManager + module V3 + module TagValues + module Rest + ## + # REST service stub for the TagValues service. + # Service stub contains baseline method implementations + # including transcoding, making the REST call, and deserialing the response. + # + class ServiceStub + # @private + def initialize endpoint:, endpoint_template:, universe_domain:, credentials:, logger: + # These require statements are intentionally placed here to initialize + # the REST modules only when it's required. + require "gapic/rest" + + @client_stub = ::Gapic::Rest::ClientStub.new endpoint: endpoint, + endpoint_template: endpoint_template, + universe_domain: universe_domain, + credentials: credentials, + numeric_enums: true, + service_name: self.class, + raise_faraday_errors: false, + logger: logger + end + + ## + # The effective universe domain + # + # @return [String] + # + def universe_domain + @client_stub.universe_domain + end + + ## + # The effective endpoint + # + # @return [String] + # + def endpoint + @client_stub.endpoint + end + + ## + # The logger used for request/response debug logging. + # + # @return [Logger] + # + def logger stub: false + stub ? @client_stub.stub_logger : @client_stub.logger + end + + ## + # Baseline implementation for the list_tag_values REST call + # + # @param request_pb [::Google::Cloud::ResourceManager::V3::ListTagValuesRequest] + # A request object representing the call parameters. Required. + # @param options [::Gapic::CallOptions] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Cloud::ResourceManager::V3::ListTagValuesResponse] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::ResourceManager::V3::ListTagValuesResponse] + # A result object deserialized from the server's reply + def list_tag_values request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_list_tag_values_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_tag_values", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Cloud::ResourceManager::V3::ListTagValuesResponse.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_tag_value REST call + # + # @param request_pb [::Google::Cloud::ResourceManager::V3::GetTagValueRequest] + # A request object representing the call parameters. Required. + # @param options [::Gapic::CallOptions] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Cloud::ResourceManager::V3::TagValue] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::ResourceManager::V3::TagValue] + # A result object deserialized from the server's reply + def get_tag_value request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_get_tag_value_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_tag_value", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Cloud::ResourceManager::V3::TagValue.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_namespaced_tag_value REST call + # + # @param request_pb [::Google::Cloud::ResourceManager::V3::GetNamespacedTagValueRequest] + # A request object representing the call parameters. Required. + # @param options [::Gapic::CallOptions] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Cloud::ResourceManager::V3::TagValue] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::ResourceManager::V3::TagValue] + # A result object deserialized from the server's reply + def get_namespaced_tag_value request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_get_namespaced_tag_value_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_namespaced_tag_value", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Cloud::ResourceManager::V3::TagValue.decode_json response.body, ignore_unknown_fields: true + catch :response do + yield result, operation if block_given? + result + end + end + + ## + # Baseline implementation for the create_tag_value REST call + # + # @param request_pb [::Google::Cloud::ResourceManager::V3::CreateTagValueRequest] + # 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_tag_value request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_create_tag_value_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_tag_value", + 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 update_tag_value REST call + # + # @param request_pb [::Google::Cloud::ResourceManager::V3::UpdateTagValueRequest] + # 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_tag_value request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_update_tag_value_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_tag_value", + 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_tag_value REST call + # + # @param request_pb [::Google::Cloud::ResourceManager::V3::DeleteTagValueRequest] + # 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_tag_value request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_delete_tag_value_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_tag_value", + 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_iam_policy REST call + # + # @param request_pb [::Google::Iam::V1::GetIamPolicyRequest] + # A request object representing the call parameters. Required. + # @param options [::Gapic::CallOptions] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Iam::V1::Policy] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Iam::V1::Policy] + # A result object deserialized from the server's reply + def get_iam_policy request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_get_iam_policy_request request_pb + query_string_params = if query_string_params.any? + query_string_params.to_h { |p| p.split "=", 2 } + else + {} + end + + response = @client_stub.make_http_request( + verb, + uri: uri, + body: body || "", + params: query_string_params, + method_name: "get_iam_policy", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Iam::V1::Policy.decode_json response.body, ignore_unknown_fields: true + catch :response do + yield result, operation if block_given? + result + end + end + + ## + # Baseline implementation for the set_iam_policy REST call + # + # @param request_pb [::Google::Iam::V1::SetIamPolicyRequest] + # A request object representing the call parameters. Required. + # @param options [::Gapic::CallOptions] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Iam::V1::Policy] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Iam::V1::Policy] + # A result object deserialized from the server's reply + def set_iam_policy request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_set_iam_policy_request request_pb + query_string_params = if query_string_params.any? + query_string_params.to_h { |p| p.split "=", 2 } + else + {} + end + + response = @client_stub.make_http_request( + verb, + uri: uri, + body: body || "", + params: query_string_params, + method_name: "set_iam_policy", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Iam::V1::Policy.decode_json response.body, ignore_unknown_fields: true + catch :response do + yield result, operation if block_given? + result + end + end + + ## + # Baseline implementation for the test_iam_permissions REST call + # + # @param request_pb [::Google::Iam::V1::TestIamPermissionsRequest] + # A request object representing the call parameters. Required. + # @param options [::Gapic::CallOptions] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Iam::V1::TestIamPermissionsResponse] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Iam::V1::TestIamPermissionsResponse] + # A result object deserialized from the server's reply + def test_iam_permissions request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_test_iam_permissions_request request_pb + query_string_params = if query_string_params.any? + query_string_params.to_h { |p| p.split "=", 2 } + else + {} + end + + response = @client_stub.make_http_request( + verb, + uri: uri, + body: body || "", + params: query_string_params, + method_name: "test_iam_permissions", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Iam::V1::TestIamPermissionsResponse.decode_json response.body, ignore_unknown_fields: true + catch :response do + yield result, operation if block_given? + result + end + end + + ## + # @private + # + # GRPC transcoding helper method for the list_tag_values REST call + # + # @param request_pb [::Google::Cloud::ResourceManager::V3::ListTagValuesRequest] + # 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_tag_values_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :get, + uri_template: "/v3/tagValues", + matches: [] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the get_tag_value REST call + # + # @param request_pb [::Google::Cloud::ResourceManager::V3::GetTagValueRequest] + # 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_tag_value_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :get, + uri_template: "/v3/{name}", + matches: [ + ["name", %r{^tagValues/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the get_namespaced_tag_value REST call + # + # @param request_pb [::Google::Cloud::ResourceManager::V3::GetNamespacedTagValueRequest] + # 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_namespaced_tag_value_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :get, + uri_template: "/v3/tagValues/namespaced", + matches: [] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the create_tag_value REST call + # + # @param request_pb [::Google::Cloud::ResourceManager::V3::CreateTagValueRequest] + # 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_tag_value_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :post, + uri_template: "/v3/tagValues", + body: "tag_value", + matches: [] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the update_tag_value REST call + # + # @param request_pb [::Google::Cloud::ResourceManager::V3::UpdateTagValueRequest] + # 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_tag_value_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :patch, + uri_template: "/v3/{tag_value.name}", + body: "tag_value", + matches: [ + ["tag_value.name", %r{^tagValues/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the delete_tag_value REST call + # + # @param request_pb [::Google::Cloud::ResourceManager::V3::DeleteTagValueRequest] + # 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_tag_value_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :delete, + uri_template: "/v3/{name}", + matches: [ + ["name", %r{^tagValues/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the get_iam_policy REST call + # + # @param request_pb [::Google::Iam::V1::GetIamPolicyRequest] + # A request object representing the call parameters. Required. + # @return [Array(String, [String, nil], Hash{String => String})] + # Uri, Body, Query string parameters + def self.transcode_get_iam_policy_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :post, + uri_template: "/v3/{resource}:getIamPolicy", + body: "*", + matches: [ + ["resource", %r{^tagValues/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the set_iam_policy REST call + # + # @param request_pb [::Google::Iam::V1::SetIamPolicyRequest] + # A request object representing the call parameters. Required. + # @return [Array(String, [String, nil], Hash{String => String})] + # Uri, Body, Query string parameters + def self.transcode_set_iam_policy_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :post, + uri_template: "/v3/{resource}:setIamPolicy", + body: "*", + matches: [ + ["resource", %r{^tagValues/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the test_iam_permissions REST call + # + # @param request_pb [::Google::Iam::V1::TestIamPermissionsRequest] + # A request object representing the call parameters. Required. + # @return [Array(String, [String, nil], Hash{String => String})] + # Uri, Body, Query string parameters + def self.transcode_test_iam_permissions_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :post, + uri_template: "/v3/{resource}:testIamPermissions", + body: "*", + matches: [ + ["resource", %r{^tagValues/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + end + end + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-resource_manager-v3/lib/google/cloud/resource_manager/v3/version.rb b/owl-bot-staging/google-cloud-resource_manager-v3/lib/google/cloud/resource_manager/v3/version.rb new file mode 100644 index 000000000000..bf45ffb960b0 --- /dev/null +++ b/owl-bot-staging/google-cloud-resource_manager-v3/lib/google/cloud/resource_manager/v3/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 ResourceManager + module V3 + VERSION = "0.0.1" + end + end + end +end diff --git a/owl-bot-staging/google-cloud-resource_manager-v3/lib/google/cloud/resourcemanager/v3/folders_pb.rb b/owl-bot-staging/google-cloud-resource_manager-v3/lib/google/cloud/resourcemanager/v3/folders_pb.rb new file mode 100644 index 000000000000..b7e70d4e8069 --- /dev/null +++ b/owl-bot-staging/google-cloud-resource_manager-v3/lib/google/cloud/resourcemanager/v3/folders_pb.rb @@ -0,0 +1,47 @@ +# frozen_string_literal: true +# Generated by the protocol buffer compiler. DO NOT EDIT! +# source: google/cloud/resourcemanager/v3/folders.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/v1/iam_policy_pb' +require 'google/iam/v1/policy_pb' +require 'google/longrunning/operations_pb' +require 'google/protobuf/field_mask_pb' +require 'google/protobuf/timestamp_pb' + + +descriptor_data = "\n-google/cloud/resourcemanager/v3/folders.proto\x12\x1fgoogle.cloud.resourcemanager.v3\x1a\x1cgoogle/api/annotations.proto\x1a\x17google/api/client.proto\x1a\x1fgoogle/api/field_behavior.proto\x1a\x19google/api/resource.proto\x1a\x1egoogle/iam/v1/iam_policy.proto\x1a\x1agoogle/iam/v1/policy.proto\x1a#google/longrunning/operations.proto\x1a google/protobuf/field_mask.proto\x1a\x1fgoogle/protobuf/timestamp.proto\"\xc6\x03\n\x06\x46older\x12\x11\n\x04name\x18\x01 \x01(\tB\x03\xe0\x41\x03\x12\x13\n\x06parent\x18\x02 \x01(\tB\x03\xe0\x41\x02\x12\x14\n\x0c\x64isplay_name\x18\x03 \x01(\t\x12\x41\n\x05state\x18\x04 \x01(\x0e\x32-.google.cloud.resourcemanager.v3.Folder.StateB\x03\xe0\x41\x03\x12\x34\n\x0b\x63reate_time\x18\x05 \x01(\x0b\x32\x1a.google.protobuf.TimestampB\x03\xe0\x41\x03\x12\x34\n\x0bupdate_time\x18\x06 \x01(\x0b\x32\x1a.google.protobuf.TimestampB\x03\xe0\x41\x03\x12\x34\n\x0b\x64\x65lete_time\x18\x07 \x01(\x0b\x32\x1a.google.protobuf.TimestampB\x03\xe0\x41\x03\x12\x11\n\x04\x65tag\x18\x08 \x01(\tB\x03\xe0\x41\x03\"@\n\x05State\x12\x15\n\x11STATE_UNSPECIFIED\x10\x00\x12\n\n\x06\x41\x43TIVE\x10\x01\x12\x14\n\x10\x44\x45LETE_REQUESTED\x10\x02:D\xea\x41\x41\n*cloudresourcemanager.googleapis.com/Folder\x12\x10\x66olders/{folder}R\x01\x01\"T\n\x10GetFolderRequest\x12@\n\x04name\x18\x01 \x01(\tB2\xe0\x41\x02\xfa\x41,\n*cloudresourcemanager.googleapis.com/Folder\"{\n\x12ListFoldersRequest\x12\x19\n\x06parent\x18\x01 \x01(\tB\t\xe0\x41\x02\xfa\x41\x03\x12\x01*\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\x19\n\x0cshow_deleted\x18\x04 \x01(\x08\x42\x03\xe0\x41\x01\"h\n\x13ListFoldersResponse\x12\x38\n\x07\x66olders\x18\x01 \x03(\x0b\x32\'.google.cloud.resourcemanager.v3.Folder\x12\x17\n\x0fnext_page_token\x18\x02 \x01(\t\"[\n\x14SearchFoldersRequest\x12\x16\n\tpage_size\x18\x01 \x01(\x05\x42\x03\xe0\x41\x01\x12\x17\n\npage_token\x18\x02 \x01(\tB\x03\xe0\x41\x01\x12\x12\n\x05query\x18\x03 \x01(\tB\x03\xe0\x41\x01\"j\n\x15SearchFoldersResponse\x12\x38\n\x07\x66olders\x18\x01 \x03(\x0b\x32\'.google.cloud.resourcemanager.v3.Folder\x12\x17\n\x0fnext_page_token\x18\x02 \x01(\t\"S\n\x13\x43reateFolderRequest\x12<\n\x06\x66older\x18\x02 \x01(\x0b\x32\'.google.cloud.resourcemanager.v3.FolderB\x03\xe0\x41\x02\"<\n\x14\x43reateFolderMetadata\x12\x14\n\x0c\x64isplay_name\x18\x01 \x01(\t\x12\x0e\n\x06parent\x18\x02 \x01(\t\"\x89\x01\n\x13UpdateFolderRequest\x12<\n\x06\x66older\x18\x01 \x01(\x0b\x32\'.google.cloud.resourcemanager.v3.FolderB\x03\xe0\x41\x02\x12\x34\n\x0bupdate_mask\x18\x02 \x01(\x0b\x32\x1a.google.protobuf.FieldMaskB\x03\xe0\x41\x02\"\x16\n\x14UpdateFolderMetadata\"|\n\x11MoveFolderRequest\x12@\n\x04name\x18\x01 \x01(\tB2\xe0\x41\x02\xfa\x41,\n*cloudresourcemanager.googleapis.com/Folder\x12%\n\x12\x64\x65stination_parent\x18\x02 \x01(\tB\t\xe0\x41\x02\xfa\x41\x03\x12\x01*\"]\n\x12MoveFolderMetadata\x12\x14\n\x0c\x64isplay_name\x18\x01 \x01(\t\x12\x15\n\rsource_parent\x18\x02 \x01(\t\x12\x1a\n\x12\x64\x65stination_parent\x18\x03 \x01(\t\"W\n\x13\x44\x65leteFolderRequest\x12@\n\x04name\x18\x01 \x01(\tB2\xe0\x41\x02\xfa\x41,\n*cloudresourcemanager.googleapis.com/Folder\"\x16\n\x14\x44\x65leteFolderMetadata\"Y\n\x15UndeleteFolderRequest\x12@\n\x04name\x18\x01 \x01(\tB2\xe0\x41\x02\xfa\x41,\n*cloudresourcemanager.googleapis.com/Folder\"\x18\n\x16UndeleteFolderMetadata2\xde\x0f\n\x07\x46olders\x12\x8c\x01\n\tGetFolder\x12\x31.google.cloud.resourcemanager.v3.GetFolderRequest\x1a\'.google.cloud.resourcemanager.v3.Folder\"#\xda\x41\x04name\x82\xd3\xe4\x93\x02\x16\x12\x14/v3/{name=folders/*}\x12\x96\x01\n\x0bListFolders\x12\x33.google.cloud.resourcemanager.v3.ListFoldersRequest\x1a\x34.google.cloud.resourcemanager.v3.ListFoldersResponse\"\x1c\xda\x41\x06parent\x82\xd3\xe4\x93\x02\r\x12\x0b/v3/folders\x12\xa2\x01\n\rSearchFolders\x12\x35.google.cloud.resourcemanager.v3.SearchFoldersRequest\x1a\x36.google.cloud.resourcemanager.v3.SearchFoldersResponse\"\"\xda\x41\x05query\x82\xd3\xe4\x93\x02\x14\x12\x12/v3/folders:search\x12\xaa\x01\n\x0c\x43reateFolder\x12\x34.google.cloud.resourcemanager.v3.CreateFolderRequest\x1a\x1d.google.longrunning.Operation\"E\xca\x41\x1e\n\x06\x46older\x12\x14\x43reateFolderMetadata\xda\x41\x06\x66older\x82\xd3\xe4\x93\x02\x15\"\x0b/v3/folders:\x06\x66older\x12\xc6\x01\n\x0cUpdateFolder\x12\x34.google.cloud.resourcemanager.v3.UpdateFolderRequest\x1a\x1d.google.longrunning.Operation\"a\xca\x41\x1e\n\x06\x46older\x12\x14UpdateFolderMetadata\xda\x41\x12\x66older,update_mask\x82\xd3\xe4\x93\x02%2\x1b/v3/{folder.name=folders/*}:\x06\x66older\x12\xbe\x01\n\nMoveFolder\x12\x32.google.cloud.resourcemanager.v3.MoveFolderRequest\x1a\x1d.google.longrunning.Operation\"]\xca\x41\x1c\n\x06\x46older\x12\x12MoveFolderMetadata\xda\x41\x17name,destination_parent\x82\xd3\xe4\x93\x02\x1e\"\x19/v3/{name=folders/*}:move:\x01*\x12\xa9\x01\n\x0c\x44\x65leteFolder\x12\x34.google.cloud.resourcemanager.v3.DeleteFolderRequest\x1a\x1d.google.longrunning.Operation\"D\xca\x41\x1e\n\x06\x46older\x12\x14\x44\x65leteFolderMetadata\xda\x41\x04name\x82\xd3\xe4\x93\x02\x16*\x14/v3/{name=folders/*}\x12\xbb\x01\n\x0eUndeleteFolder\x12\x36.google.cloud.resourcemanager.v3.UndeleteFolderRequest\x1a\x1d.google.longrunning.Operation\"R\xca\x41 \n\x06\x46older\x12\x16UndeleteFolderMetadata\xda\x41\x04name\x82\xd3\xe4\x93\x02\"\"\x1d/v3/{name=folders/*}:undelete:\x01*\x12\x86\x01\n\x0cGetIamPolicy\x12\".google.iam.v1.GetIamPolicyRequest\x1a\x15.google.iam.v1.Policy\";\xda\x41\x08resource\x82\xd3\xe4\x93\x02*\"%/v3/{resource=folders/*}:getIamPolicy:\x01*\x12\x8d\x01\n\x0cSetIamPolicy\x12\".google.iam.v1.SetIamPolicyRequest\x1a\x15.google.iam.v1.Policy\"B\xda\x41\x0fresource,policy\x82\xd3\xe4\x93\x02*\"%/v3/{resource=folders/*}:setIamPolicy:\x01*\x12\xb8\x01\n\x12TestIamPermissions\x12(.google.iam.v1.TestIamPermissionsRequest\x1a).google.iam.v1.TestIamPermissionsResponse\"M\xda\x41\x14resource,permissions\x82\xd3\xe4\x93\x02\x30\"+/v3/{resource=folders/*}:testIamPermissions:\x01*\x1a\x90\x01\xca\x41#cloudresourcemanager.googleapis.com\xd2\x41ghttps://www.googleapis.com/auth/cloud-platform,https://www.googleapis.com/auth/cloud-platform.read-onlyB\xed\x01\n#com.google.cloud.resourcemanager.v3B\x0c\x46oldersProtoP\x01ZMcloud.google.com/go/resourcemanager/apiv3/resourcemanagerpb;resourcemanagerpb\xaa\x02\x1fGoogle.Cloud.ResourceManager.V3\xca\x02\x1fGoogle\\Cloud\\ResourceManager\\V3\xea\x02\"Google::Cloud::ResourceManager::V3b\x06proto3" + +pool = ::Google::Protobuf::DescriptorPool.generated_pool +pool.add_serialized_file(descriptor_data) + +module Google + module Cloud + module ResourceManager + module V3 + Folder = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.resourcemanager.v3.Folder").msgclass + Folder::State = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.resourcemanager.v3.Folder.State").enummodule + GetFolderRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.resourcemanager.v3.GetFolderRequest").msgclass + ListFoldersRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.resourcemanager.v3.ListFoldersRequest").msgclass + ListFoldersResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.resourcemanager.v3.ListFoldersResponse").msgclass + SearchFoldersRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.resourcemanager.v3.SearchFoldersRequest").msgclass + SearchFoldersResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.resourcemanager.v3.SearchFoldersResponse").msgclass + CreateFolderRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.resourcemanager.v3.CreateFolderRequest").msgclass + CreateFolderMetadata = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.resourcemanager.v3.CreateFolderMetadata").msgclass + UpdateFolderRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.resourcemanager.v3.UpdateFolderRequest").msgclass + UpdateFolderMetadata = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.resourcemanager.v3.UpdateFolderMetadata").msgclass + MoveFolderRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.resourcemanager.v3.MoveFolderRequest").msgclass + MoveFolderMetadata = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.resourcemanager.v3.MoveFolderMetadata").msgclass + DeleteFolderRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.resourcemanager.v3.DeleteFolderRequest").msgclass + DeleteFolderMetadata = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.resourcemanager.v3.DeleteFolderMetadata").msgclass + UndeleteFolderRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.resourcemanager.v3.UndeleteFolderRequest").msgclass + UndeleteFolderMetadata = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.resourcemanager.v3.UndeleteFolderMetadata").msgclass + end + end + end +end diff --git a/owl-bot-staging/google-cloud-resource_manager-v3/lib/google/cloud/resourcemanager/v3/folders_services_pb.rb b/owl-bot-staging/google-cloud-resource_manager-v3/lib/google/cloud/resourcemanager/v3/folders_services_pb.rb new file mode 100644 index 000000000000..fe0f94b58654 --- /dev/null +++ b/owl-bot-staging/google-cloud-resource_manager-v3/lib/google/cloud/resourcemanager/v3/folders_services_pb.rb @@ -0,0 +1,172 @@ +# Generated by the protocol buffer compiler. DO NOT EDIT! +# Source: google/cloud/resourcemanager/v3/folders.proto for package 'Google.Cloud.ResourceManager.V3' +# Original file comments: +# 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 +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# + +require 'grpc' +require 'google/cloud/resourcemanager/v3/folders_pb' + +module Google + module Cloud + module ResourceManager + module V3 + module Folders + # Manages Cloud Platform folder resources. + # Folders can be used to organize the resources under an + # organization and to control the policies applied to groups of resources. + class Service + + include ::GRPC::GenericService + + self.marshal_class_method = :encode + self.unmarshal_class_method = :decode + self.service_name = 'google.cloud.resourcemanager.v3.Folders' + + # Retrieves a folder identified by the supplied resource name. + # Valid folder resource names have the format `folders/{folder_id}` + # (for example, `folders/1234`). + # The caller must have `resourcemanager.folders.get` permission on the + # identified folder. + rpc :GetFolder, ::Google::Cloud::ResourceManager::V3::GetFolderRequest, ::Google::Cloud::ResourceManager::V3::Folder + # Lists the folders that are direct descendants of supplied parent resource. + # `list()` provides a strongly consistent view of the folders underneath + # the specified parent resource. + # `list()` returns folders sorted based upon the (ascending) lexical ordering + # of their display_name. + # The caller must have `resourcemanager.folders.list` permission on the + # identified parent. + rpc :ListFolders, ::Google::Cloud::ResourceManager::V3::ListFoldersRequest, ::Google::Cloud::ResourceManager::V3::ListFoldersResponse + # Search for folders that match specific filter criteria. + # `search()` provides an eventually consistent view of the folders a user has + # access to which meet the specified filter criteria. + # + # This will only return folders on which the caller has the + # permission `resourcemanager.folders.get`. + rpc :SearchFolders, ::Google::Cloud::ResourceManager::V3::SearchFoldersRequest, ::Google::Cloud::ResourceManager::V3::SearchFoldersResponse + # Creates a folder in the resource hierarchy. + # Returns an `Operation` which can be used to track the progress of the + # folder creation workflow. + # Upon success, the `Operation.response` field will be populated with the + # created Folder. + # + # In order to succeed, the addition of this new folder must not violate + # the folder naming, height, or fanout constraints. + # + # + The folder's `display_name` must be distinct from all other folders that + # share its parent. + # + The addition of the folder must not cause the active folder hierarchy + # to exceed a height of 10. Note, the full active + deleted folder hierarchy + # is allowed to reach a height of 20; this provides additional headroom when + # moving folders that contain deleted folders. + # + The addition of the folder must not cause the total number of folders + # under its parent to exceed 300. + # + # If the operation fails due to a folder constraint violation, some errors + # may be returned by the `CreateFolder` request, with status code + # `FAILED_PRECONDITION` and an error description. Other folder constraint + # violations will be communicated in the `Operation`, with the specific + # `PreconditionFailure` returned in the details list in the `Operation.error` + # field. + # + # The caller must have `resourcemanager.folders.create` permission on the + # identified parent. + rpc :CreateFolder, ::Google::Cloud::ResourceManager::V3::CreateFolderRequest, ::Google::Longrunning::Operation + # Updates a folder, changing its `display_name`. + # Changes to the folder `display_name` will be rejected if they violate + # either the `display_name` formatting rules or the naming constraints + # described in the + # [CreateFolder][google.cloud.resourcemanager.v3.Folders.CreateFolder] + # documentation. + # + # The folder's `display_name` must start and end with a letter or digit, + # may contain letters, digits, spaces, hyphens and underscores and can be + # between 3 and 30 characters. This is captured by the regular expression: + # `[\p{L}\p{N}][\p{L}\p{N}_- ]{1,28}[\p{L}\p{N}]`. + # The caller must have `resourcemanager.folders.update` permission on the + # identified folder. + # + # If the update fails due to the unique name constraint then a + # `PreconditionFailure` explaining this violation will be returned + # in the Status.details field. + rpc :UpdateFolder, ::Google::Cloud::ResourceManager::V3::UpdateFolderRequest, ::Google::Longrunning::Operation + # Moves a folder under a new resource parent. + # Returns an `Operation` which can be used to track the progress of the + # folder move workflow. + # Upon success, the `Operation.response` field will be populated with the + # moved folder. + # Upon failure, a `FolderOperationError` categorizing the failure cause will + # be returned - if the failure occurs synchronously then the + # `FolderOperationError` will be returned in the `Status.details` field. + # If it occurs asynchronously, then the FolderOperation will be returned + # in the `Operation.error` field. + # In addition, the `Operation.metadata` field will be populated with a + # `FolderOperation` message as an aid to stateless clients. + # Folder moves will be rejected if they violate either the naming, height, + # or fanout constraints described in the + # [CreateFolder][google.cloud.resourcemanager.v3.Folders.CreateFolder] + # documentation. The caller must have `resourcemanager.folders.move` + # permission on the folder's current and proposed new parent. + rpc :MoveFolder, ::Google::Cloud::ResourceManager::V3::MoveFolderRequest, ::Google::Longrunning::Operation + # Requests deletion of a folder. The folder is moved into the + # [DELETE_REQUESTED][google.cloud.resourcemanager.v3.Folder.State.DELETE_REQUESTED] + # state immediately, and is deleted approximately 30 days later. This method + # may only be called on an empty folder, where a folder is empty if it + # doesn't contain any folders or projects in the + # [ACTIVE][google.cloud.resourcemanager.v3.Folder.State.ACTIVE] state. If + # called on a folder in + # [DELETE_REQUESTED][google.cloud.resourcemanager.v3.Folder.State.DELETE_REQUESTED] + # state the operation will result in a no-op success. + # The caller must have `resourcemanager.folders.delete` permission on the + # identified folder. + rpc :DeleteFolder, ::Google::Cloud::ResourceManager::V3::DeleteFolderRequest, ::Google::Longrunning::Operation + # Cancels the deletion request for a folder. This method may be called on a + # folder in any state. If the folder is in the + # [ACTIVE][google.cloud.resourcemanager.v3.Folder.State.ACTIVE] state the + # result will be a no-op success. In order to succeed, the folder's parent + # must be in the + # [ACTIVE][google.cloud.resourcemanager.v3.Folder.State.ACTIVE] state. In + # addition, reintroducing the folder into the tree must not violate folder + # naming, height, and fanout constraints described in the + # [CreateFolder][google.cloud.resourcemanager.v3.Folders.CreateFolder] + # documentation. The caller must have `resourcemanager.folders.undelete` + # permission on the identified folder. + rpc :UndeleteFolder, ::Google::Cloud::ResourceManager::V3::UndeleteFolderRequest, ::Google::Longrunning::Operation + # Gets the access control policy for a folder. The returned policy may be + # empty if no such policy or resource exists. The `resource` field should + # be the folder's resource name, for example: "folders/1234". + # The caller must have `resourcemanager.folders.getIamPolicy` permission + # on the identified folder. + rpc :GetIamPolicy, ::Google::Iam::V1::GetIamPolicyRequest, ::Google::Iam::V1::Policy + # Sets the access control policy on a folder, replacing any existing policy. + # The `resource` field should be the folder's resource name, for example: + # "folders/1234". + # The caller must have `resourcemanager.folders.setIamPolicy` permission + # on the identified folder. + rpc :SetIamPolicy, ::Google::Iam::V1::SetIamPolicyRequest, ::Google::Iam::V1::Policy + # Returns permissions that a caller has on the specified folder. + # The `resource` field should be the folder's resource name, + # for example: "folders/1234". + # + # There are no permissions required for making this API call. + rpc :TestIamPermissions, ::Google::Iam::V1::TestIamPermissionsRequest, ::Google::Iam::V1::TestIamPermissionsResponse + end + + Stub = Service.rpc_stub_class + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-resource_manager-v3/lib/google/cloud/resourcemanager/v3/organizations_pb.rb b/owl-bot-staging/google-cloud-resource_manager-v3/lib/google/cloud/resourcemanager/v3/organizations_pb.rb new file mode 100644 index 000000000000..7c469455103e --- /dev/null +++ b/owl-bot-staging/google-cloud-resource_manager-v3/lib/google/cloud/resourcemanager/v3/organizations_pb.rb @@ -0,0 +1,35 @@ +# frozen_string_literal: true +# Generated by the protocol buffer compiler. DO NOT EDIT! +# source: google/cloud/resourcemanager/v3/organizations.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/v1/iam_policy_pb' +require 'google/iam/v1/policy_pb' +require 'google/protobuf/timestamp_pb' + + +descriptor_data = "\n3google/cloud/resourcemanager/v3/organizations.proto\x12\x1fgoogle.cloud.resourcemanager.v3\x1a\x1cgoogle/api/annotations.proto\x1a\x17google/api/client.proto\x1a\x1fgoogle/api/field_behavior.proto\x1a\x19google/api/resource.proto\x1a\x1egoogle/iam/v1/iam_policy.proto\x1a\x1agoogle/iam/v1/policy.proto\x1a\x1fgoogle/protobuf/timestamp.proto\"\x83\x04\n\x0cOrganization\x12\x11\n\x04name\x18\x01 \x01(\tB\x03\xe0\x41\x03\x12\x19\n\x0c\x64isplay_name\x18\x02 \x01(\tB\x03\xe0\x41\x03\x12$\n\x15\x64irectory_customer_id\x18\x03 \x01(\tB\x03\xe0\x41\x05H\x00\x12G\n\x05state\x18\x04 \x01(\x0e\x32\x33.google.cloud.resourcemanager.v3.Organization.StateB\x03\xe0\x41\x03\x12\x34\n\x0b\x63reate_time\x18\x05 \x01(\x0b\x32\x1a.google.protobuf.TimestampB\x03\xe0\x41\x03\x12\x34\n\x0bupdate_time\x18\x06 \x01(\x0b\x32\x1a.google.protobuf.TimestampB\x03\xe0\x41\x03\x12\x34\n\x0b\x64\x65lete_time\x18\x07 \x01(\x0b\x32\x1a.google.protobuf.TimestampB\x03\xe0\x41\x03\x12\x11\n\x04\x65tag\x18\x08 \x01(\tB\x03\xe0\x41\x03\"@\n\x05State\x12\x15\n\x11STATE_UNSPECIFIED\x10\x00\x12\n\n\x06\x41\x43TIVE\x10\x01\x12\x14\n\x10\x44\x45LETE_REQUESTED\x10\x02:V\xea\x41S\n0cloudresourcemanager.googleapis.com/Organization\x12\x1corganizations/{organization}R\x01\x01\x42\x07\n\x05owner\"`\n\x16GetOrganizationRequest\x12\x46\n\x04name\x18\x01 \x01(\tB8\xe0\x41\x02\xfa\x41\x32\n0cloudresourcemanager.googleapis.com/Organization\"a\n\x1aSearchOrganizationsRequest\x12\x16\n\tpage_size\x18\x01 \x01(\x05\x42\x03\xe0\x41\x01\x12\x17\n\npage_token\x18\x02 \x01(\tB\x03\xe0\x41\x01\x12\x12\n\x05query\x18\x03 \x01(\tB\x03\xe0\x41\x01\"|\n\x1bSearchOrganizationsResponse\x12\x44\n\rorganizations\x18\x01 \x03(\x0b\x32-.google.cloud.resourcemanager.v3.Organization\x12\x17\n\x0fnext_page_token\x18\x02 \x01(\t\"\x1c\n\x1a\x44\x65leteOrganizationMetadata\"\x1e\n\x1cUndeleteOrganizationMetadata2\xe5\x07\n\rOrganizations\x12\xa4\x01\n\x0fGetOrganization\x12\x37.google.cloud.resourcemanager.v3.GetOrganizationRequest\x1a-.google.cloud.resourcemanager.v3.Organization\")\xda\x41\x04name\x82\xd3\xe4\x93\x02\x1c\x12\x1a/v3/{name=organizations/*}\x12\xba\x01\n\x13SearchOrganizations\x12;.google.cloud.resourcemanager.v3.SearchOrganizationsRequest\x1a<.google.cloud.resourcemanager.v3.SearchOrganizationsResponse\"(\xda\x41\x05query\x82\xd3\xe4\x93\x02\x1a\x12\x18/v3/organizations:search\x12\x8c\x01\n\x0cGetIamPolicy\x12\".google.iam.v1.GetIamPolicyRequest\x1a\x15.google.iam.v1.Policy\"A\xda\x41\x08resource\x82\xd3\xe4\x93\x02\x30\"+/v3/{resource=organizations/*}:getIamPolicy:\x01*\x12\x8c\x01\n\x0cSetIamPolicy\x12\".google.iam.v1.SetIamPolicyRequest\x1a\x15.google.iam.v1.Policy\"A\xda\x41\x08resource\x82\xd3\xe4\x93\x02\x30\"+/v3/{resource=organizations/*}:setIamPolicy:\x01*\x12\xbe\x01\n\x12TestIamPermissions\x12(.google.iam.v1.TestIamPermissionsRequest\x1a).google.iam.v1.TestIamPermissionsResponse\"S\xda\x41\x14resource,permissions\x82\xd3\xe4\x93\x02\x36\"1/v3/{resource=organizations/*}:testIamPermissions:\x01*\x1a\x90\x01\xca\x41#cloudresourcemanager.googleapis.com\xd2\x41ghttps://www.googleapis.com/auth/cloud-platform,https://www.googleapis.com/auth/cloud-platform.read-onlyB\xf3\x01\n#com.google.cloud.resourcemanager.v3B\x12OrganizationsProtoP\x01ZMcloud.google.com/go/resourcemanager/apiv3/resourcemanagerpb;resourcemanagerpb\xaa\x02\x1fGoogle.Cloud.ResourceManager.V3\xca\x02\x1fGoogle\\Cloud\\ResourceManager\\V3\xea\x02\"Google::Cloud::ResourceManager::V3b\x06proto3" + +pool = ::Google::Protobuf::DescriptorPool.generated_pool +pool.add_serialized_file(descriptor_data) + +module Google + module Cloud + module ResourceManager + module V3 + Organization = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.resourcemanager.v3.Organization").msgclass + Organization::State = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.resourcemanager.v3.Organization.State").enummodule + GetOrganizationRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.resourcemanager.v3.GetOrganizationRequest").msgclass + SearchOrganizationsRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.resourcemanager.v3.SearchOrganizationsRequest").msgclass + SearchOrganizationsResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.resourcemanager.v3.SearchOrganizationsResponse").msgclass + DeleteOrganizationMetadata = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.resourcemanager.v3.DeleteOrganizationMetadata").msgclass + UndeleteOrganizationMetadata = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.resourcemanager.v3.UndeleteOrganizationMetadata").msgclass + end + end + end +end diff --git a/owl-bot-staging/google-cloud-resource_manager-v3/lib/google/cloud/resourcemanager/v3/organizations_services_pb.rb b/owl-bot-staging/google-cloud-resource_manager-v3/lib/google/cloud/resourcemanager/v3/organizations_services_pb.rb new file mode 100644 index 000000000000..815d51c587a5 --- /dev/null +++ b/owl-bot-staging/google-cloud-resource_manager-v3/lib/google/cloud/resourcemanager/v3/organizations_services_pb.rb @@ -0,0 +1,73 @@ +# Generated by the protocol buffer compiler. DO NOT EDIT! +# Source: google/cloud/resourcemanager/v3/organizations.proto for package 'Google.Cloud.ResourceManager.V3' +# Original file comments: +# 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 +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# + +require 'grpc' +require 'google/cloud/resourcemanager/v3/organizations_pb' + +module Google + module Cloud + module ResourceManager + module V3 + module Organizations + # Allows users to manage their organization resources. + class Service + + include ::GRPC::GenericService + + self.marshal_class_method = :encode + self.unmarshal_class_method = :decode + self.service_name = 'google.cloud.resourcemanager.v3.Organizations' + + # Fetches an organization resource identified by the specified resource name. + rpc :GetOrganization, ::Google::Cloud::ResourceManager::V3::GetOrganizationRequest, ::Google::Cloud::ResourceManager::V3::Organization + # Searches organization resources that are visible to the user and satisfy + # the specified filter. This method returns organizations in an unspecified + # order. New organizations do not necessarily appear at the end of the + # results, and may take a small amount of time to appear. + # + # Search will only return organizations on which the user has the permission + # `resourcemanager.organizations.get` + rpc :SearchOrganizations, ::Google::Cloud::ResourceManager::V3::SearchOrganizationsRequest, ::Google::Cloud::ResourceManager::V3::SearchOrganizationsResponse + # Gets the access control policy for an organization resource. The policy may + # be empty if no such policy or resource exists. The `resource` field should + # be the organization's resource name, for example: "organizations/123". + # + # Authorization requires the IAM permission + # `resourcemanager.organizations.getIamPolicy` on the specified organization. + rpc :GetIamPolicy, ::Google::Iam::V1::GetIamPolicyRequest, ::Google::Iam::V1::Policy + # Sets the access control policy on an organization resource. Replaces any + # existing policy. The `resource` field should be the organization's resource + # name, for example: "organizations/123". + # + # Authorization requires the IAM permission + # `resourcemanager.organizations.setIamPolicy` on the specified organization. + rpc :SetIamPolicy, ::Google::Iam::V1::SetIamPolicyRequest, ::Google::Iam::V1::Policy + # Returns the permissions that a caller has on the specified organization. + # The `resource` field should be the organization's resource name, + # for example: "organizations/123". + # + # There are no permissions required for making this API call. + rpc :TestIamPermissions, ::Google::Iam::V1::TestIamPermissionsRequest, ::Google::Iam::V1::TestIamPermissionsResponse + end + + Stub = Service.rpc_stub_class + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-resource_manager-v3/lib/google/cloud/resourcemanager/v3/projects_pb.rb b/owl-bot-staging/google-cloud-resource_manager-v3/lib/google/cloud/resourcemanager/v3/projects_pb.rb new file mode 100644 index 000000000000..beb22f43c8d7 --- /dev/null +++ b/owl-bot-staging/google-cloud-resource_manager-v3/lib/google/cloud/resourcemanager/v3/projects_pb.rb @@ -0,0 +1,47 @@ +# frozen_string_literal: true +# Generated by the protocol buffer compiler. DO NOT EDIT! +# source: google/cloud/resourcemanager/v3/projects.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/v1/iam_policy_pb' +require 'google/iam/v1/policy_pb' +require 'google/longrunning/operations_pb' +require 'google/protobuf/field_mask_pb' +require 'google/protobuf/timestamp_pb' + + +descriptor_data = "\n.google/cloud/resourcemanager/v3/projects.proto\x12\x1fgoogle.cloud.resourcemanager.v3\x1a\x1cgoogle/api/annotations.proto\x1a\x17google/api/client.proto\x1a\x1fgoogle/api/field_behavior.proto\x1a\x19google/api/resource.proto\x1a\x1egoogle/iam/v1/iam_policy.proto\x1a\x1agoogle/iam/v1/policy.proto\x1a#google/longrunning/operations.proto\x1a google/protobuf/field_mask.proto\x1a\x1fgoogle/protobuf/timestamp.proto\"\xe3\x04\n\x07Project\x12\x11\n\x04name\x18\x01 \x01(\tB\x03\xe0\x41\x03\x12\x13\n\x06parent\x18\x02 \x01(\tB\x03\xe0\x41\x01\x12\x17\n\nproject_id\x18\x03 \x01(\tB\x03\xe0\x41\x05\x12\x42\n\x05state\x18\x04 \x01(\x0e\x32..google.cloud.resourcemanager.v3.Project.StateB\x03\xe0\x41\x03\x12\x19\n\x0c\x64isplay_name\x18\x05 \x01(\tB\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\x34\n\x0b\x64\x65lete_time\x18\x08 \x01(\x0b\x32\x1a.google.protobuf.TimestampB\x03\xe0\x41\x03\x12\x11\n\x04\x65tag\x18\t \x01(\tB\x03\xe0\x41\x03\x12I\n\x06labels\x18\n \x03(\x0b\x32\x34.google.cloud.resourcemanager.v3.Project.LabelsEntryB\x03\xe0\x41\x01\x1a-\n\x0bLabelsEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12\r\n\x05value\x18\x02 \x01(\t:\x02\x38\x01\"@\n\x05State\x12\x15\n\x11STATE_UNSPECIFIED\x10\x00\x12\n\n\x06\x41\x43TIVE\x10\x01\x12\x14\n\x10\x44\x45LETE_REQUESTED\x10\x02:G\xea\x41\x44\n+cloudresourcemanager.googleapis.com/Project\x12\x12projects/{project}R\x01\x01\"V\n\x11GetProjectRequest\x12\x41\n\x04name\x18\x01 \x01(\tB3\xe0\x41\x02\xfa\x41-\n+cloudresourcemanager.googleapis.com/Project\"|\n\x13ListProjectsRequest\x12\x19\n\x06parent\x18\x01 \x01(\tB\t\xe0\x41\x02\xfa\x41\x03\x12\x01*\x12\x17\n\npage_token\x18\x02 \x01(\tB\x03\xe0\x41\x01\x12\x16\n\tpage_size\x18\x03 \x01(\x05\x42\x03\xe0\x41\x01\x12\x19\n\x0cshow_deleted\x18\x04 \x01(\x08\x42\x03\xe0\x41\x01\"k\n\x14ListProjectsResponse\x12:\n\x08projects\x18\x01 \x03(\x0b\x32(.google.cloud.resourcemanager.v3.Project\x12\x17\n\x0fnext_page_token\x18\x02 \x01(\t\"\\\n\x15SearchProjectsRequest\x12\x12\n\x05query\x18\x01 \x01(\tB\x03\xe0\x41\x01\x12\x17\n\npage_token\x18\x02 \x01(\tB\x03\xe0\x41\x01\x12\x16\n\tpage_size\x18\x03 \x01(\x05\x42\x03\xe0\x41\x01\"m\n\x16SearchProjectsResponse\x12:\n\x08projects\x18\x01 \x03(\x0b\x32(.google.cloud.resourcemanager.v3.Project\x12\x17\n\x0fnext_page_token\x18\x02 \x01(\t\"V\n\x14\x43reateProjectRequest\x12>\n\x07project\x18\x01 \x01(\x0b\x32(.google.cloud.resourcemanager.v3.ProjectB\x03\xe0\x41\x02\"i\n\x15\x43reateProjectMetadata\x12/\n\x0b\x63reate_time\x18\x01 \x01(\x0b\x32\x1a.google.protobuf.Timestamp\x12\x10\n\x08gettable\x18\x02 \x01(\x08\x12\r\n\x05ready\x18\x03 \x01(\x08\"\x8c\x01\n\x14UpdateProjectRequest\x12>\n\x07project\x18\x01 \x01(\x0b\x32(.google.cloud.resourcemanager.v3.ProjectB\x03\xe0\x41\x02\x12\x34\n\x0bupdate_mask\x18\x02 \x01(\x0b\x32\x1a.google.protobuf.FieldMaskB\x03\xe0\x41\x01\"\x17\n\x15UpdateProjectMetadata\"~\n\x12MoveProjectRequest\x12\x41\n\x04name\x18\x01 \x01(\tB3\xe0\x41\x02\xfa\x41-\n+cloudresourcemanager.googleapis.com/Project\x12%\n\x12\x64\x65stination_parent\x18\x02 \x01(\tB\t\xe0\x41\x02\xfa\x41\x03\x12\x01*\"\x15\n\x13MoveProjectMetadata\"Y\n\x14\x44\x65leteProjectRequest\x12\x41\n\x04name\x18\x01 \x01(\tB3\xe0\x41\x02\xfa\x41-\n+cloudresourcemanager.googleapis.com/Project\"\x17\n\x15\x44\x65leteProjectMetadata\"[\n\x16UndeleteProjectRequest\x12\x41\n\x04name\x18\x01 \x01(\tB3\xe0\x41\x02\xfa\x41-\n+cloudresourcemanager.googleapis.com/Project\"\x19\n\x17UndeleteProjectMetadata2\x8f\x10\n\x08Projects\x12\x90\x01\n\nGetProject\x12\x32.google.cloud.resourcemanager.v3.GetProjectRequest\x1a(.google.cloud.resourcemanager.v3.Project\"$\xda\x41\x04name\x82\xd3\xe4\x93\x02\x17\x12\x15/v3/{name=projects/*}\x12\x9a\x01\n\x0cListProjects\x12\x34.google.cloud.resourcemanager.v3.ListProjectsRequest\x1a\x35.google.cloud.resourcemanager.v3.ListProjectsResponse\"\x1d\xda\x41\x06parent\x82\xd3\xe4\x93\x02\x0e\x12\x0c/v3/projects\x12\xa6\x01\n\x0eSearchProjects\x12\x36.google.cloud.resourcemanager.v3.SearchProjectsRequest\x1a\x37.google.cloud.resourcemanager.v3.SearchProjectsResponse\"#\xda\x41\x05query\x82\xd3\xe4\x93\x02\x15\x12\x13/v3/projects:search\x12\xb1\x01\n\rCreateProject\x12\x35.google.cloud.resourcemanager.v3.CreateProjectRequest\x1a\x1d.google.longrunning.Operation\"J\xca\x41 \n\x07Project\x12\x15\x43reateProjectMetadata\xda\x41\x07project\x82\xd3\xe4\x93\x02\x17\"\x0c/v3/projects:\x07project\x12\xce\x01\n\rUpdateProject\x12\x35.google.cloud.resourcemanager.v3.UpdateProjectRequest\x1a\x1d.google.longrunning.Operation\"g\xca\x41 \n\x07Project\x12\x15UpdateProjectMetadata\xda\x41\x13project,update_mask\x82\xd3\xe4\x93\x02(2\x1d/v3/{project.name=projects/*}:\x07project\x12\xc4\x01\n\x0bMoveProject\x12\x33.google.cloud.resourcemanager.v3.MoveProjectRequest\x1a\x1d.google.longrunning.Operation\"a\xca\x41\x1e\n\x07Project\x12\x13MoveProjectMetadata\xda\x41\x18name, destination_parent\x82\xd3\xe4\x93\x02\x1f\"\x1a/v3/{name=projects/*}:move:\x01*\x12\xae\x01\n\rDeleteProject\x12\x35.google.cloud.resourcemanager.v3.DeleteProjectRequest\x1a\x1d.google.longrunning.Operation\"G\xca\x41 \n\x07Project\x12\x15\x44\x65leteProjectMetadata\xda\x41\x04name\x82\xd3\xe4\x93\x02\x17*\x15/v3/{name=projects/*}\x12\xc0\x01\n\x0fUndeleteProject\x12\x37.google.cloud.resourcemanager.v3.UndeleteProjectRequest\x1a\x1d.google.longrunning.Operation\"U\xca\x41\"\n\x07Project\x12\x17UndeleteProjectMetadata\xda\x41\x04name\x82\xd3\xe4\x93\x02#\"\x1e/v3/{name=projects/*}:undelete:\x01*\x12\x87\x01\n\x0cGetIamPolicy\x12\".google.iam.v1.GetIamPolicyRequest\x1a\x15.google.iam.v1.Policy\"<\xda\x41\x08resource\x82\xd3\xe4\x93\x02+\"&/v3/{resource=projects/*}:getIamPolicy:\x01*\x12\x8f\x01\n\x0cSetIamPolicy\x12\".google.iam.v1.SetIamPolicyRequest\x1a\x15.google.iam.v1.Policy\"D\xda\x41\x10resource, policy\x82\xd3\xe4\x93\x02+\"&/v3/{resource=projects/*}:setIamPolicy:\x01*\x12\xba\x01\n\x12TestIamPermissions\x12(.google.iam.v1.TestIamPermissionsRequest\x1a).google.iam.v1.TestIamPermissionsResponse\"O\xda\x41\x15resource, permissions\x82\xd3\xe4\x93\x02\x31\",/v3/{resource=projects/*}:testIamPermissions:\x01*\x1a\x90\x01\xca\x41#cloudresourcemanager.googleapis.com\xd2\x41ghttps://www.googleapis.com/auth/cloud-platform,https://www.googleapis.com/auth/cloud-platform.read-onlyB\xee\x01\n#com.google.cloud.resourcemanager.v3B\rProjectsProtoP\x01ZMcloud.google.com/go/resourcemanager/apiv3/resourcemanagerpb;resourcemanagerpb\xaa\x02\x1fGoogle.Cloud.ResourceManager.V3\xca\x02\x1fGoogle\\Cloud\\ResourceManager\\V3\xea\x02\"Google::Cloud::ResourceManager::V3b\x06proto3" + +pool = ::Google::Protobuf::DescriptorPool.generated_pool +pool.add_serialized_file(descriptor_data) + +module Google + module Cloud + module ResourceManager + module V3 + Project = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.resourcemanager.v3.Project").msgclass + Project::State = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.resourcemanager.v3.Project.State").enummodule + GetProjectRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.resourcemanager.v3.GetProjectRequest").msgclass + ListProjectsRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.resourcemanager.v3.ListProjectsRequest").msgclass + ListProjectsResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.resourcemanager.v3.ListProjectsResponse").msgclass + SearchProjectsRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.resourcemanager.v3.SearchProjectsRequest").msgclass + SearchProjectsResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.resourcemanager.v3.SearchProjectsResponse").msgclass + CreateProjectRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.resourcemanager.v3.CreateProjectRequest").msgclass + CreateProjectMetadata = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.resourcemanager.v3.CreateProjectMetadata").msgclass + UpdateProjectRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.resourcemanager.v3.UpdateProjectRequest").msgclass + UpdateProjectMetadata = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.resourcemanager.v3.UpdateProjectMetadata").msgclass + MoveProjectRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.resourcemanager.v3.MoveProjectRequest").msgclass + MoveProjectMetadata = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.resourcemanager.v3.MoveProjectMetadata").msgclass + DeleteProjectRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.resourcemanager.v3.DeleteProjectRequest").msgclass + DeleteProjectMetadata = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.resourcemanager.v3.DeleteProjectMetadata").msgclass + UndeleteProjectRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.resourcemanager.v3.UndeleteProjectRequest").msgclass + UndeleteProjectMetadata = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.resourcemanager.v3.UndeleteProjectMetadata").msgclass + end + end + end +end diff --git a/owl-bot-staging/google-cloud-resource_manager-v3/lib/google/cloud/resourcemanager/v3/projects_services_pb.rb b/owl-bot-staging/google-cloud-resource_manager-v3/lib/google/cloud/resourcemanager/v3/projects_services_pb.rb new file mode 100644 index 000000000000..afbf3b81b1da --- /dev/null +++ b/owl-bot-staging/google-cloud-resource_manager-v3/lib/google/cloud/resourcemanager/v3/projects_services_pb.rb @@ -0,0 +1,190 @@ +# Generated by the protocol buffer compiler. DO NOT EDIT! +# Source: google/cloud/resourcemanager/v3/projects.proto for package 'Google.Cloud.ResourceManager.V3' +# Original file comments: +# 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 +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# + +require 'grpc' +require 'google/cloud/resourcemanager/v3/projects_pb' + +module Google + module Cloud + module ResourceManager + module V3 + module Projects + # Manages Google Cloud Projects. + class Service + + include ::GRPC::GenericService + + self.marshal_class_method = :encode + self.unmarshal_class_method = :decode + self.service_name = 'google.cloud.resourcemanager.v3.Projects' + + # Retrieves the project identified by the specified `name` (for example, + # `projects/415104041262`). + # + # The caller must have `resourcemanager.projects.get` permission + # for this project. + rpc :GetProject, ::Google::Cloud::ResourceManager::V3::GetProjectRequest, ::Google::Cloud::ResourceManager::V3::Project + # Lists projects that are direct children of the specified folder or + # organization resource. `list()` provides a strongly consistent view of the + # projects underneath the specified parent resource. `list()` returns + # projects sorted based upon the (ascending) lexical ordering of their + # `display_name`. The caller must have `resourcemanager.projects.list` + # permission on the identified parent. + rpc :ListProjects, ::Google::Cloud::ResourceManager::V3::ListProjectsRequest, ::Google::Cloud::ResourceManager::V3::ListProjectsResponse + # Search for projects that the caller has both `resourcemanager.projects.get` + # permission on, and also satisfy the specified query. + # + # This method returns projects in an unspecified order. + # + # This method is eventually consistent with project mutations; this means + # that a newly created project may not appear in the results or recent + # updates to an existing project may not be reflected in the results. To + # retrieve the latest state of a project, use the + # [GetProject][google.cloud.resourcemanager.v3.Projects.GetProject] method. + rpc :SearchProjects, ::Google::Cloud::ResourceManager::V3::SearchProjectsRequest, ::Google::Cloud::ResourceManager::V3::SearchProjectsResponse + # Request that a new project be created. The result is an `Operation` which + # can be used to track the creation process. This process usually takes a few + # seconds, but can sometimes take much longer. The tracking `Operation` is + # automatically deleted after a few hours, so there is no need to call + # `DeleteOperation`. + rpc :CreateProject, ::Google::Cloud::ResourceManager::V3::CreateProjectRequest, ::Google::Longrunning::Operation + # Updates the `display_name` and labels of the project identified by the + # specified `name` (for example, `projects/415104041262`). Deleting all + # labels requires an update mask for labels field. + # + # The caller must have `resourcemanager.projects.update` permission for this + # project. + rpc :UpdateProject, ::Google::Cloud::ResourceManager::V3::UpdateProjectRequest, ::Google::Longrunning::Operation + # Move a project to another place in your resource hierarchy, under a new + # resource parent. + # + # Returns an operation which can be used to track the process of the project + # move workflow. + # Upon success, the `Operation.response` field will be populated with the + # moved project. + # + # The caller must have `resourcemanager.projects.move` permission on the + # project, on the project's current and proposed new parent. + # + # If project has no current parent, or it currently does not have an + # associated organization resource, you will also need the + # `resourcemanager.projects.setIamPolicy` permission in the project. + # + # + rpc :MoveProject, ::Google::Cloud::ResourceManager::V3::MoveProjectRequest, ::Google::Longrunning::Operation + # Marks the project identified by the specified + # `name` (for example, `projects/415104041262`) for deletion. + # + # This method will only affect the project if it has a lifecycle state of + # [ACTIVE][google.cloud.resourcemanager.v3.Project.State.ACTIVE]. + # + # This method changes the Project's lifecycle state from + # [ACTIVE][google.cloud.resourcemanager.v3.Project.State.ACTIVE] + # to + # [DELETE_REQUESTED][google.cloud.resourcemanager.v3.Project.State.DELETE_REQUESTED]. + # The deletion starts at an unspecified time, + # at which point the Project is no longer accessible. + # + # Until the deletion completes, you can check the lifecycle state + # checked by retrieving the project with [GetProject] + # [google.cloud.resourcemanager.v3.Projects.GetProject], + # and the project remains visible to [ListProjects] + # [google.cloud.resourcemanager.v3.Projects.ListProjects]. + # However, you cannot update the project. + # + # After the deletion completes, the project is not retrievable by + # the [GetProject] + # [google.cloud.resourcemanager.v3.Projects.GetProject], + # [ListProjects] + # [google.cloud.resourcemanager.v3.Projects.ListProjects], and + # [SearchProjects][google.cloud.resourcemanager.v3.Projects.SearchProjects] + # methods. + # + # This method behaves idempotently, such that deleting a `DELETE_REQUESTED` + # project will not cause an error, but also won't do anything. + # + # The caller must have `resourcemanager.projects.delete` permissions for this + # project. + rpc :DeleteProject, ::Google::Cloud::ResourceManager::V3::DeleteProjectRequest, ::Google::Longrunning::Operation + # Restores the project identified by the specified + # `name` (for example, `projects/415104041262`). + # You can only use this method for a project that has a lifecycle state of + # [DELETE_REQUESTED] + # [Projects.State.DELETE_REQUESTED]. + # After deletion starts, the project cannot be restored. + # + # The caller must have `resourcemanager.projects.undelete` permission for + # this project. + rpc :UndeleteProject, ::Google::Cloud::ResourceManager::V3::UndeleteProjectRequest, ::Google::Longrunning::Operation + # Returns the IAM access control policy for the specified project, in the + # format `projects/{ProjectIdOrNumber}` e.g. projects/123. + # Permission is denied if the policy or the resource do not exist. + rpc :GetIamPolicy, ::Google::Iam::V1::GetIamPolicyRequest, ::Google::Iam::V1::Policy + # Sets the IAM access control policy for the specified project, in the + # format `projects/{ProjectIdOrNumber}` e.g. projects/123. + # + # CAUTION: This method will replace the existing policy, and cannot be used + # to append additional IAM settings. + # + # Note: Removing service accounts from policies or changing their roles can + # render services completely inoperable. It is important to understand how + # the service account is being used before removing or updating its roles. + # + # The following constraints apply when using `setIamPolicy()`: + # + # + Project does not support `allUsers` and `allAuthenticatedUsers` as + # `members` in a `Binding` of a `Policy`. + # + # + The owner role can be granted to a `user`, `serviceAccount`, or a group + # that is part of an organization. For example, + # group@myownpersonaldomain.com could be added as an owner to a project in + # the myownpersonaldomain.com organization, but not the examplepetstore.com + # organization. + # + # + Service accounts can be made owners of a project directly + # without any restrictions. However, to be added as an owner, a user must be + # invited using the Cloud Platform console and must accept the invitation. + # + # + A user cannot be granted the owner role using `setIamPolicy()`. The user + # must be granted the owner role using the Cloud Platform Console and must + # explicitly accept the invitation. + # + # + Invitations to grant the owner role cannot be sent using + # `setIamPolicy()`; + # they must be sent only using the Cloud Platform Console. + # + # + If the project is not part of an organization, there must be at least + # one owner who has accepted the Terms of Service (ToS) agreement in the + # policy. Calling `setIamPolicy()` to remove the last ToS-accepted owner + # from the policy will fail. This restriction also applies to legacy + # projects that no longer have owners who have accepted the ToS. Edits to + # IAM policies will be rejected until the lack of a ToS-accepting owner is + # rectified. If the project is part of an organization, you can remove all + # owners, potentially making the organization inaccessible. + rpc :SetIamPolicy, ::Google::Iam::V1::SetIamPolicyRequest, ::Google::Iam::V1::Policy + # Returns permissions that a caller has on the specified project, in the + # format `projects/{ProjectIdOrNumber}` e.g. projects/123.. + rpc :TestIamPermissions, ::Google::Iam::V1::TestIamPermissionsRequest, ::Google::Iam::V1::TestIamPermissionsResponse + end + + Stub = Service.rpc_stub_class + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-resource_manager-v3/lib/google/cloud/resourcemanager/v3/tag_bindings_pb.rb b/owl-bot-staging/google-cloud-resource_manager-v3/lib/google/cloud/resourcemanager/v3/tag_bindings_pb.rb new file mode 100644 index 000000000000..72df2774a4b3 --- /dev/null +++ b/owl-bot-staging/google-cloud-resource_manager-v3/lib/google/cloud/resourcemanager/v3/tag_bindings_pb.rb @@ -0,0 +1,37 @@ +# frozen_string_literal: true +# Generated by the protocol buffer compiler. DO NOT EDIT! +# source: google/cloud/resourcemanager/v3/tag_bindings.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/longrunning/operations_pb' +require 'google/protobuf/empty_pb' + + +descriptor_data = "\n2google/cloud/resourcemanager/v3/tag_bindings.proto\x12\x1fgoogle.cloud.resourcemanager.v3\x1a\x1cgoogle/api/annotations.proto\x1a\x17google/api/client.proto\x1a\x1fgoogle/api/field_behavior.proto\x1a\x19google/api/resource.proto\x1a#google/longrunning/operations.proto\x1a\x1bgoogle/protobuf/empty.proto\"\xb5\x01\n\nTagBinding\x12\x11\n\x04name\x18\x01 \x01(\tB\x03\xe0\x41\x03\x12\x0e\n\x06parent\x18\x02 \x01(\t\x12\x11\n\ttag_value\x18\x03 \x01(\t\x12!\n\x19tag_value_namespaced_name\x18\x04 \x01(\t:N\xea\x41K\n.cloudresourcemanager.googleapis.com/TagBinding\x12\x19tagBindings/{tag_binding}\"\x1a\n\x18\x43reateTagBindingMetadata\"|\n\x17\x43reateTagBindingRequest\x12\x45\n\x0btag_binding\x18\x01 \x01(\x0b\x32+.google.cloud.resourcemanager.v3.TagBindingB\x03\xe0\x41\x02\x12\x1a\n\rvalidate_only\x18\x02 \x01(\x08\x42\x03\xe0\x41\x01\"\x1a\n\x18\x44\x65leteTagBindingMetadata\"_\n\x17\x44\x65leteTagBindingRequest\x12\x44\n\x04name\x18\x01 \x01(\tB6\xe0\x41\x02\xfa\x41\x30\n.cloudresourcemanager.googleapis.com/TagBinding\"d\n\x16ListTagBindingsRequest\x12\x19\n\x06parent\x18\x01 \x01(\tB\t\xe0\x41\x02\xfa\x41\x03\x12\x01*\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\"u\n\x17ListTagBindingsResponse\x12\x41\n\x0ctag_bindings\x18\x01 \x03(\x0b\x32+.google.cloud.resourcemanager.v3.TagBinding\x12\x17\n\x0fnext_page_token\x18\x02 \x01(\t\"`\n\x18ListEffectiveTagsRequest\x12\x13\n\x06parent\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\"{\n\x19ListEffectiveTagsResponse\x12\x45\n\x0e\x65\x66\x66\x65\x63tive_tags\x18\x01 \x03(\x0b\x32-.google.cloud.resourcemanager.v3.EffectiveTag\x12\x17\n\x0fnext_page_token\x18\x02 \x01(\t\"\x80\x02\n\x0c\x45\x66\x66\x65\x63tiveTag\x12\x44\n\ttag_value\x18\x01 \x01(\tB1\xfa\x41.\n,cloudresourcemanager.googleapis.com/TagValue\x12\x1c\n\x14namespaced_tag_value\x18\x02 \x01(\t\x12@\n\x07tag_key\x18\x03 \x01(\tB/\xfa\x41,\n*cloudresourcemanager.googleapis.com/TagKey\x12\x1a\n\x12namespaced_tag_key\x18\x04 \x01(\t\x12\x1b\n\x13tag_key_parent_name\x18\x06 \x01(\t\x12\x11\n\tinherited\x18\x05 \x01(\x08\x32\x91\x07\n\x0bTagBindings\x12\xa6\x01\n\x0fListTagBindings\x12\x37.google.cloud.resourcemanager.v3.ListTagBindingsRequest\x1a\x38.google.cloud.resourcemanager.v3.ListTagBindingsResponse\" \xda\x41\x06parent\x82\xd3\xe4\x93\x02\x11\x12\x0f/v3/tagBindings\x12\xc8\x01\n\x10\x43reateTagBinding\x12\x38.google.cloud.resourcemanager.v3.CreateTagBindingRequest\x1a\x1d.google.longrunning.Operation\"[\xca\x41&\n\nTagBinding\x12\x18\x43reateTagBindingMetadata\xda\x41\x0btag_binding\x82\xd3\xe4\x93\x02\x1e\"\x0f/v3/tagBindings:\x0btag_binding\x12\xc9\x01\n\x10\x44\x65leteTagBinding\x12\x38.google.cloud.resourcemanager.v3.DeleteTagBindingRequest\x1a\x1d.google.longrunning.Operation\"\\\xca\x41\x31\n\x15google.protobuf.Empty\x12\x18\x44\x65leteTagBindingMetadata\xda\x41\x04name\x82\xd3\xe4\x93\x02\x1b*\x19/v3/{name=tagBindings/**}\x12\xae\x01\n\x11ListEffectiveTags\x12\x39.google.cloud.resourcemanager.v3.ListEffectiveTagsRequest\x1a:.google.cloud.resourcemanager.v3.ListEffectiveTagsResponse\"\"\xda\x41\x06parent\x82\xd3\xe4\x93\x02\x13\x12\x11/v3/effectiveTags\x1a\x90\x01\xca\x41#cloudresourcemanager.googleapis.com\xd2\x41ghttps://www.googleapis.com/auth/cloud-platform,https://www.googleapis.com/auth/cloud-platform.read-onlyB\xf1\x01\n#com.google.cloud.resourcemanager.v3B\x10TagBindingsProtoP\x01ZMcloud.google.com/go/resourcemanager/apiv3/resourcemanagerpb;resourcemanagerpb\xaa\x02\x1fGoogle.Cloud.ResourceManager.V3\xca\x02\x1fGoogle\\Cloud\\ResourceManager\\V3\xea\x02\"Google::Cloud::ResourceManager::V3b\x06proto3" + +pool = ::Google::Protobuf::DescriptorPool.generated_pool +pool.add_serialized_file(descriptor_data) + +module Google + module Cloud + module ResourceManager + module V3 + TagBinding = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.resourcemanager.v3.TagBinding").msgclass + CreateTagBindingMetadata = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.resourcemanager.v3.CreateTagBindingMetadata").msgclass + CreateTagBindingRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.resourcemanager.v3.CreateTagBindingRequest").msgclass + DeleteTagBindingMetadata = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.resourcemanager.v3.DeleteTagBindingMetadata").msgclass + DeleteTagBindingRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.resourcemanager.v3.DeleteTagBindingRequest").msgclass + ListTagBindingsRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.resourcemanager.v3.ListTagBindingsRequest").msgclass + ListTagBindingsResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.resourcemanager.v3.ListTagBindingsResponse").msgclass + ListEffectiveTagsRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.resourcemanager.v3.ListEffectiveTagsRequest").msgclass + ListEffectiveTagsResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.resourcemanager.v3.ListEffectiveTagsResponse").msgclass + EffectiveTag = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.resourcemanager.v3.EffectiveTag").msgclass + end + end + end +end diff --git a/owl-bot-staging/google-cloud-resource_manager-v3/lib/google/cloud/resourcemanager/v3/tag_bindings_services_pb.rb b/owl-bot-staging/google-cloud-resource_manager-v3/lib/google/cloud/resourcemanager/v3/tag_bindings_services_pb.rb new file mode 100644 index 000000000000..146298d792c5 --- /dev/null +++ b/owl-bot-staging/google-cloud-resource_manager-v3/lib/google/cloud/resourcemanager/v3/tag_bindings_services_pb.rb @@ -0,0 +1,57 @@ +# Generated by the protocol buffer compiler. DO NOT EDIT! +# Source: google/cloud/resourcemanager/v3/tag_bindings.proto for package 'Google.Cloud.ResourceManager.V3' +# Original file comments: +# 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 +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# + +require 'grpc' +require 'google/cloud/resourcemanager/v3/tag_bindings_pb' + +module Google + module Cloud + module ResourceManager + module V3 + module TagBindings + # Allow users to create and manage TagBindings between TagValues and + # different Google Cloud resources throughout the GCP resource hierarchy. + class Service + + include ::GRPC::GenericService + + self.marshal_class_method = :encode + self.unmarshal_class_method = :decode + self.service_name = 'google.cloud.resourcemanager.v3.TagBindings' + + # Lists the TagBindings for the given Google Cloud resource, as specified + # with `parent`. + # + # NOTE: The `parent` field is expected to be a full resource name: + # https://cloud.google.com/apis/design/resource_names#full_resource_name + rpc :ListTagBindings, ::Google::Cloud::ResourceManager::V3::ListTagBindingsRequest, ::Google::Cloud::ResourceManager::V3::ListTagBindingsResponse + # Creates a TagBinding between a TagValue and a Google Cloud resource. + rpc :CreateTagBinding, ::Google::Cloud::ResourceManager::V3::CreateTagBindingRequest, ::Google::Longrunning::Operation + # Deletes a TagBinding. + rpc :DeleteTagBinding, ::Google::Cloud::ResourceManager::V3::DeleteTagBindingRequest, ::Google::Longrunning::Operation + # Return a list of effective tags for the given Google Cloud resource, as + # specified in `parent`. + rpc :ListEffectiveTags, ::Google::Cloud::ResourceManager::V3::ListEffectiveTagsRequest, ::Google::Cloud::ResourceManager::V3::ListEffectiveTagsResponse + end + + Stub = Service.rpc_stub_class + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-resource_manager-v3/lib/google/cloud/resourcemanager/v3/tag_holds_pb.rb b/owl-bot-staging/google-cloud-resource_manager-v3/lib/google/cloud/resourcemanager/v3/tag_holds_pb.rb new file mode 100644 index 000000000000..4ec85e2889d5 --- /dev/null +++ b/owl-bot-staging/google-cloud-resource_manager-v3/lib/google/cloud/resourcemanager/v3/tag_holds_pb.rb @@ -0,0 +1,35 @@ +# frozen_string_literal: true +# Generated by the protocol buffer compiler. DO NOT EDIT! +# source: google/cloud/resourcemanager/v3/tag_holds.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/longrunning/operations_pb' +require 'google/protobuf/empty_pb' +require 'google/protobuf/timestamp_pb' + + +descriptor_data = "\n/google/cloud/resourcemanager/v3/tag_holds.proto\x12\x1fgoogle.cloud.resourcemanager.v3\x1a\x1cgoogle/api/annotations.proto\x1a\x17google/api/client.proto\x1a\x1fgoogle/api/field_behavior.proto\x1a\x19google/api/resource.proto\x1a#google/longrunning/operations.proto\x1a\x1bgoogle/protobuf/empty.proto\x1a\x1fgoogle/protobuf/timestamp.proto\"\xf1\x01\n\x07TagHold\x12\x11\n\x04name\x18\x01 \x01(\tB\x03\xe0\x41\x03\x12\x13\n\x06holder\x18\x02 \x01(\tB\x03\xe0\x41\x02\x12\x13\n\x06origin\x18\x03 \x01(\tB\x03\xe0\x41\x01\x12\x16\n\thelp_link\x18\x04 \x01(\tB\x03\xe0\x41\x01\x12\x34\n\x0b\x63reate_time\x18\x05 \x01(\x0b\x32\x1a.google.protobuf.TimestampB\x03\xe0\x41\x03:[\xea\x41X\n+cloudresourcemanager.googleapis.com/TagHold\x12)tagValues/{tag_value}/tagHolds/{tag_hold}\"\xb8\x01\n\x14\x43reateTagHoldRequest\x12\x43\n\x06parent\x18\x01 \x01(\tB3\xe0\x41\x02\xfa\x41-\x12+cloudresourcemanager.googleapis.com/TagHold\x12?\n\x08tag_hold\x18\x02 \x01(\x0b\x32(.google.cloud.resourcemanager.v3.TagHoldB\x03\xe0\x41\x02\x12\x1a\n\rvalidate_only\x18\x03 \x01(\x08\x42\x03\xe0\x41\x01\"\x17\n\x15\x43reateTagHoldMetadata\"u\n\x14\x44\x65leteTagHoldRequest\x12\x41\n\x04name\x18\x01 \x01(\tB3\xe0\x41\x02\xfa\x41-\n+cloudresourcemanager.googleapis.com/TagHold\x12\x1a\n\rvalidate_only\x18\x02 \x01(\x08\x42\x03\xe0\x41\x01\"\x17\n\x15\x44\x65leteTagHoldMetadata\"\xa0\x01\n\x13ListTagHoldsRequest\x12\x43\n\x06parent\x18\x01 \x01(\tB3\xe0\x41\x02\xfa\x41-\x12+cloudresourcemanager.googleapis.com/TagHold\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\"l\n\x14ListTagHoldsResponse\x12;\n\ttag_holds\x18\x01 \x03(\x0b\x32(.google.cloud.resourcemanager.v3.TagHold\x12\x17\n\x0fnext_page_token\x18\x02 \x01(\t2\xec\x05\n\x08TagHolds\x12\xcf\x01\n\rCreateTagHold\x12\x35.google.cloud.resourcemanager.v3.CreateTagHoldRequest\x1a\x1d.google.longrunning.Operation\"h\xca\x41 \n\x07TagHold\x12\x15\x43reateTagHoldMetadata\xda\x41\x0fparent,tag_hold\x82\xd3\xe4\x93\x02-\"!/v3/{parent=tagValues/*}/tagHolds:\x08tag_hold\x12\xc8\x01\n\rDeleteTagHold\x12\x35.google.cloud.resourcemanager.v3.DeleteTagHoldRequest\x1a\x1d.google.longrunning.Operation\"a\xca\x41.\n\x15google.protobuf.Empty\x12\x15\x44\x65leteTagHoldMetadata\xda\x41\x04name\x82\xd3\xe4\x93\x02#*!/v3/{name=tagValues/*/tagHolds/*}\x12\xaf\x01\n\x0cListTagHolds\x12\x34.google.cloud.resourcemanager.v3.ListTagHoldsRequest\x1a\x35.google.cloud.resourcemanager.v3.ListTagHoldsResponse\"2\xda\x41\x06parent\x82\xd3\xe4\x93\x02#\x12!/v3/{parent=tagValues/*}/tagHolds\x1a\x90\x01\xca\x41#cloudresourcemanager.googleapis.com\xd2\x41ghttps://www.googleapis.com/auth/cloud-platform,https://www.googleapis.com/auth/cloud-platform.read-onlyB\xee\x01\n#com.google.cloud.resourcemanager.v3B\rTagHoldsProtoP\x01ZMcloud.google.com/go/resourcemanager/apiv3/resourcemanagerpb;resourcemanagerpb\xaa\x02\x1fGoogle.Cloud.ResourceManager.V3\xca\x02\x1fGoogle\\Cloud\\ResourceManager\\V3\xea\x02\"Google::Cloud::ResourceManager::V3b\x06proto3" + +pool = ::Google::Protobuf::DescriptorPool.generated_pool +pool.add_serialized_file(descriptor_data) + +module Google + module Cloud + module ResourceManager + module V3 + TagHold = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.resourcemanager.v3.TagHold").msgclass + CreateTagHoldRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.resourcemanager.v3.CreateTagHoldRequest").msgclass + CreateTagHoldMetadata = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.resourcemanager.v3.CreateTagHoldMetadata").msgclass + DeleteTagHoldRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.resourcemanager.v3.DeleteTagHoldRequest").msgclass + DeleteTagHoldMetadata = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.resourcemanager.v3.DeleteTagHoldMetadata").msgclass + ListTagHoldsRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.resourcemanager.v3.ListTagHoldsRequest").msgclass + ListTagHoldsResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.resourcemanager.v3.ListTagHoldsResponse").msgclass + end + end + end +end diff --git a/owl-bot-staging/google-cloud-resource_manager-v3/lib/google/cloud/resourcemanager/v3/tag_holds_services_pb.rb b/owl-bot-staging/google-cloud-resource_manager-v3/lib/google/cloud/resourcemanager/v3/tag_holds_services_pb.rb new file mode 100644 index 000000000000..16dcb5b0a2d7 --- /dev/null +++ b/owl-bot-staging/google-cloud-resource_manager-v3/lib/google/cloud/resourcemanager/v3/tag_holds_services_pb.rb @@ -0,0 +1,54 @@ +# Generated by the protocol buffer compiler. DO NOT EDIT! +# Source: google/cloud/resourcemanager/v3/tag_holds.proto for package 'Google.Cloud.ResourceManager.V3' +# Original file comments: +# 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 +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# + +require 'grpc' +require 'google/cloud/resourcemanager/v3/tag_holds_pb' + +module Google + module Cloud + module ResourceManager + module V3 + module TagHolds + # Allow users to create and manage TagHolds for TagValues. TagHolds represent + # the use of a Tag Value that is not captured by TagBindings but + # should still block TagValue deletion (such as a reference in a policy + # condition). This service provides isolated failure domains by cloud location + # so that TagHolds can be managed in the same location as their usage. + class Service + + include ::GRPC::GenericService + + self.marshal_class_method = :encode + self.unmarshal_class_method = :decode + self.service_name = 'google.cloud.resourcemanager.v3.TagHolds' + + # Creates a TagHold. Returns ALREADY_EXISTS if a TagHold with the same + # resource and origin exists under the same TagValue. + rpc :CreateTagHold, ::Google::Cloud::ResourceManager::V3::CreateTagHoldRequest, ::Google::Longrunning::Operation + # Deletes a TagHold. + rpc :DeleteTagHold, ::Google::Cloud::ResourceManager::V3::DeleteTagHoldRequest, ::Google::Longrunning::Operation + # Lists TagHolds under a TagValue. + rpc :ListTagHolds, ::Google::Cloud::ResourceManager::V3::ListTagHoldsRequest, ::Google::Cloud::ResourceManager::V3::ListTagHoldsResponse + end + + Stub = Service.rpc_stub_class + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-resource_manager-v3/lib/google/cloud/resourcemanager/v3/tag_keys_pb.rb b/owl-bot-staging/google-cloud-resource_manager-v3/lib/google/cloud/resourcemanager/v3/tag_keys_pb.rb new file mode 100644 index 000000000000..0c22c53a55b5 --- /dev/null +++ b/owl-bot-staging/google-cloud-resource_manager-v3/lib/google/cloud/resourcemanager/v3/tag_keys_pb.rb @@ -0,0 +1,42 @@ +# frozen_string_literal: true +# Generated by the protocol buffer compiler. DO NOT EDIT! +# source: google/cloud/resourcemanager/v3/tag_keys.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/v1/iam_policy_pb' +require 'google/iam/v1/policy_pb' +require 'google/longrunning/operations_pb' +require 'google/protobuf/field_mask_pb' +require 'google/protobuf/timestamp_pb' + + +descriptor_data = "\n.google/cloud/resourcemanager/v3/tag_keys.proto\x12\x1fgoogle.cloud.resourcemanager.v3\x1a\x1cgoogle/api/annotations.proto\x1a\x17google/api/client.proto\x1a\x1fgoogle/api/field_behavior.proto\x1a\x19google/api/resource.proto\x1a\x1egoogle/iam/v1/iam_policy.proto\x1a\x1agoogle/iam/v1/policy.proto\x1a#google/longrunning/operations.proto\x1a google/protobuf/field_mask.proto\x1a\x1fgoogle/protobuf/timestamp.proto\"\x96\x04\n\x06TagKey\x12\x11\n\x04name\x18\x01 \x01(\tB\x03\xe0\x41\x05\x12\x13\n\x06parent\x18\x02 \x01(\tB\x03\xe0\x41\x05\x12\x1a\n\nshort_name\x18\x03 \x01(\tB\x06\xe0\x41\x02\xe0\x41\x05\x12\x1f\n\x0fnamespaced_name\x18\x04 \x01(\tB\x06\xe0\x41\x03\xe0\x41\x05\x12\x18\n\x0b\x64\x65scription\x18\x05 \x01(\tB\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\x11\n\x04\x65tag\x18\x08 \x01(\tB\x03\xe0\x41\x01\x12>\n\x07purpose\x18\x0b \x01(\x0e\x32(.google.cloud.resourcemanager.v3.PurposeB\x03\xe0\x41\x01\x12S\n\x0cpurpose_data\x18\x0c \x03(\x0b\x32\x38.google.cloud.resourcemanager.v3.TagKey.PurposeDataEntryB\x03\xe0\x41\x01\x1a\x32\n\x10PurposeDataEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12\r\n\x05value\x18\x02 \x01(\t:\x02\x38\x01:E\xea\x41\x42\n*cloudresourcemanager.googleapis.com/TagKey\x12\x11tagKeys/{tag_key}R\x01\x01\"`\n\x12ListTagKeysRequest\x12\x19\n\x06parent\x18\x01 \x01(\tB\t\xe0\x41\x02\xfa\x41\x03\x12\x01*\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\"i\n\x13ListTagKeysResponse\x12\x39\n\x08tag_keys\x18\x01 \x03(\x0b\x32\'.google.cloud.resourcemanager.v3.TagKey\x12\x17\n\x0fnext_page_token\x18\x02 \x01(\t\"T\n\x10GetTagKeyRequest\x12@\n\x04name\x18\x01 \x01(\tB2\xe0\x41\x02\xfa\x41,\n*cloudresourcemanager.googleapis.com/TagKey\"^\n\x1aGetNamespacedTagKeyRequest\x12@\n\x04name\x18\x01 \x01(\tB2\xe0\x41\x02\xfa\x41,\n*cloudresourcemanager.googleapis.com/TagKey\"p\n\x13\x43reateTagKeyRequest\x12=\n\x07tag_key\x18\x01 \x01(\x0b\x32\'.google.cloud.resourcemanager.v3.TagKeyB\x03\xe0\x41\x02\x12\x1a\n\rvalidate_only\x18\x02 \x01(\x08\x42\x03\xe0\x41\x01\"\x16\n\x14\x43reateTagKeyMetadata\"\x9c\x01\n\x13UpdateTagKeyRequest\x12=\n\x07tag_key\x18\x01 \x01(\x0b\x32\'.google.cloud.resourcemanager.v3.TagKeyB\x03\xe0\x41\x02\x12/\n\x0bupdate_mask\x18\x02 \x01(\x0b\x32\x1a.google.protobuf.FieldMask\x12\x15\n\rvalidate_only\x18\x03 \x01(\x08\"\x16\n\x14UpdateTagKeyMetadata\"\x86\x01\n\x13\x44\x65leteTagKeyRequest\x12@\n\x04name\x18\x01 \x01(\tB2\xe0\x41\x02\xfa\x41,\n*cloudresourcemanager.googleapis.com/TagKey\x12\x1a\n\rvalidate_only\x18\x02 \x01(\x08\x42\x03\xe0\x41\x01\x12\x11\n\x04\x65tag\x18\x03 \x01(\tB\x03\xe0\x41\x01\"\x16\n\x14\x44\x65leteTagKeyMetadata*4\n\x07Purpose\x12\x17\n\x13PURPOSE_UNSPECIFIED\x10\x00\x12\x10\n\x0cGCE_FIREWALL\x10\x01\x32\xe4\x0c\n\x07TagKeys\x12\x96\x01\n\x0bListTagKeys\x12\x33.google.cloud.resourcemanager.v3.ListTagKeysRequest\x1a\x34.google.cloud.resourcemanager.v3.ListTagKeysResponse\"\x1c\xda\x41\x06parent\x82\xd3\xe4\x93\x02\r\x12\x0b/v3/tagKeys\x12\x8c\x01\n\tGetTagKey\x12\x31.google.cloud.resourcemanager.v3.GetTagKeyRequest\x1a\'.google.cloud.resourcemanager.v3.TagKey\"#\xda\x41\x04name\x82\xd3\xe4\x93\x02\x16\x12\x14/v3/{name=tagKeys/*}\x12\xa2\x01\n\x13GetNamespacedTagKey\x12;.google.cloud.resourcemanager.v3.GetNamespacedTagKeyRequest\x1a\'.google.cloud.resourcemanager.v3.TagKey\"%\xda\x41\x04name\x82\xd3\xe4\x93\x02\x18\x12\x16/v3/tagKeys/namespaced\x12\xac\x01\n\x0c\x43reateTagKey\x12\x34.google.cloud.resourcemanager.v3.CreateTagKeyRequest\x1a\x1d.google.longrunning.Operation\"G\xca\x41\x1e\n\x06TagKey\x12\x14\x43reateTagKeyMetadata\xda\x41\x07tag_key\x82\xd3\xe4\x93\x02\x16\"\x0b/v3/tagKeys:\x07tag_key\x12\xc9\x01\n\x0cUpdateTagKey\x12\x34.google.cloud.resourcemanager.v3.UpdateTagKeyRequest\x1a\x1d.google.longrunning.Operation\"d\xca\x41\x1e\n\x06TagKey\x12\x14UpdateTagKeyMetadata\xda\x41\x13tag_key,update_mask\x82\xd3\xe4\x93\x02\'2\x1c/v3/{tag_key.name=tagKeys/*}:\x07tag_key\x12\xa9\x01\n\x0c\x44\x65leteTagKey\x12\x34.google.cloud.resourcemanager.v3.DeleteTagKeyRequest\x1a\x1d.google.longrunning.Operation\"D\xca\x41\x1e\n\x06TagKey\x12\x14\x44\x65leteTagKeyMetadata\xda\x41\x04name\x82\xd3\xe4\x93\x02\x16*\x14/v3/{name=tagKeys/*}\x12\x86\x01\n\x0cGetIamPolicy\x12\".google.iam.v1.GetIamPolicyRequest\x1a\x15.google.iam.v1.Policy\";\xda\x41\x08resource\x82\xd3\xe4\x93\x02*\"%/v3/{resource=tagKeys/*}:getIamPolicy:\x01*\x12\x8d\x01\n\x0cSetIamPolicy\x12\".google.iam.v1.SetIamPolicyRequest\x1a\x15.google.iam.v1.Policy\"B\xda\x41\x0fresource,policy\x82\xd3\xe4\x93\x02*\"%/v3/{resource=tagKeys/*}:setIamPolicy:\x01*\x12\xb8\x01\n\x12TestIamPermissions\x12(.google.iam.v1.TestIamPermissionsRequest\x1a).google.iam.v1.TestIamPermissionsResponse\"M\xda\x41\x14resource,permissions\x82\xd3\xe4\x93\x02\x30\"+/v3/{resource=tagKeys/*}:testIamPermissions:\x01*\x1a\x90\x01\xca\x41#cloudresourcemanager.googleapis.com\xd2\x41ghttps://www.googleapis.com/auth/cloud-platform,https://www.googleapis.com/auth/cloud-platform.read-onlyB\xed\x01\n#com.google.cloud.resourcemanager.v3B\x0cTagKeysProtoP\x01ZMcloud.google.com/go/resourcemanager/apiv3/resourcemanagerpb;resourcemanagerpb\xaa\x02\x1fGoogle.Cloud.ResourceManager.V3\xca\x02\x1fGoogle\\Cloud\\ResourceManager\\V3\xea\x02\"Google::Cloud::ResourceManager::V3b\x06proto3" + +pool = ::Google::Protobuf::DescriptorPool.generated_pool +pool.add_serialized_file(descriptor_data) + +module Google + module Cloud + module ResourceManager + module V3 + TagKey = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.resourcemanager.v3.TagKey").msgclass + ListTagKeysRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.resourcemanager.v3.ListTagKeysRequest").msgclass + ListTagKeysResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.resourcemanager.v3.ListTagKeysResponse").msgclass + GetTagKeyRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.resourcemanager.v3.GetTagKeyRequest").msgclass + GetNamespacedTagKeyRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.resourcemanager.v3.GetNamespacedTagKeyRequest").msgclass + CreateTagKeyRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.resourcemanager.v3.CreateTagKeyRequest").msgclass + CreateTagKeyMetadata = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.resourcemanager.v3.CreateTagKeyMetadata").msgclass + UpdateTagKeyRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.resourcemanager.v3.UpdateTagKeyRequest").msgclass + UpdateTagKeyMetadata = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.resourcemanager.v3.UpdateTagKeyMetadata").msgclass + DeleteTagKeyRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.resourcemanager.v3.DeleteTagKeyRequest").msgclass + DeleteTagKeyMetadata = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.resourcemanager.v3.DeleteTagKeyMetadata").msgclass + Purpose = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.resourcemanager.v3.Purpose").enummodule + end + end + end +end diff --git a/owl-bot-staging/google-cloud-resource_manager-v3/lib/google/cloud/resourcemanager/v3/tag_keys_services_pb.rb b/owl-bot-staging/google-cloud-resource_manager-v3/lib/google/cloud/resourcemanager/v3/tag_keys_services_pb.rb new file mode 100644 index 000000000000..d737da48dbaa --- /dev/null +++ b/owl-bot-staging/google-cloud-resource_manager-v3/lib/google/cloud/resourcemanager/v3/tag_keys_services_pb.rb @@ -0,0 +1,81 @@ +# Generated by the protocol buffer compiler. DO NOT EDIT! +# Source: google/cloud/resourcemanager/v3/tag_keys.proto for package 'Google.Cloud.ResourceManager.V3' +# Original file comments: +# 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 +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# + +require 'grpc' +require 'google/cloud/resourcemanager/v3/tag_keys_pb' + +module Google + module Cloud + module ResourceManager + module V3 + module TagKeys + # Allow users to create and manage tag keys. + class Service + + include ::GRPC::GenericService + + self.marshal_class_method = :encode + self.unmarshal_class_method = :decode + self.service_name = 'google.cloud.resourcemanager.v3.TagKeys' + + # Lists all TagKeys for a parent resource. + rpc :ListTagKeys, ::Google::Cloud::ResourceManager::V3::ListTagKeysRequest, ::Google::Cloud::ResourceManager::V3::ListTagKeysResponse + # Retrieves a TagKey. This method will return `PERMISSION_DENIED` if the + # key does not exist or the user does not have permission to view it. + rpc :GetTagKey, ::Google::Cloud::ResourceManager::V3::GetTagKeyRequest, ::Google::Cloud::ResourceManager::V3::TagKey + # Retrieves a TagKey by its namespaced name. + # This method will return `PERMISSION_DENIED` if the key does not exist + # or the user does not have permission to view it. + rpc :GetNamespacedTagKey, ::Google::Cloud::ResourceManager::V3::GetNamespacedTagKeyRequest, ::Google::Cloud::ResourceManager::V3::TagKey + # Creates a new TagKey. If another request with the same parameters is + # sent while the original request is in process, the second request + # will receive an error. A maximum of 1000 TagKeys can exist under a parent + # at any given time. + rpc :CreateTagKey, ::Google::Cloud::ResourceManager::V3::CreateTagKeyRequest, ::Google::Longrunning::Operation + # Updates the attributes of the TagKey resource. + rpc :UpdateTagKey, ::Google::Cloud::ResourceManager::V3::UpdateTagKeyRequest, ::Google::Longrunning::Operation + # Deletes a TagKey. The TagKey cannot be deleted if it has any child + # TagValues. + rpc :DeleteTagKey, ::Google::Cloud::ResourceManager::V3::DeleteTagKeyRequest, ::Google::Longrunning::Operation + # Gets the access control policy for a TagKey. The returned policy may be + # empty if no such policy or resource exists. The `resource` field should + # be the TagKey's resource name. For example, "tagKeys/1234". + # The caller must have + # `cloudresourcemanager.googleapis.com/tagKeys.getIamPolicy` permission on + # the specified TagKey. + rpc :GetIamPolicy, ::Google::Iam::V1::GetIamPolicyRequest, ::Google::Iam::V1::Policy + # Sets the access control policy on a TagKey, replacing any existing + # policy. The `resource` field should be the TagKey's resource name. + # For example, "tagKeys/1234". + # The caller must have `resourcemanager.tagKeys.setIamPolicy` permission + # on the identified tagValue. + rpc :SetIamPolicy, ::Google::Iam::V1::SetIamPolicyRequest, ::Google::Iam::V1::Policy + # Returns permissions that a caller has on the specified TagKey. + # The `resource` field should be the TagKey's resource name. + # For example, "tagKeys/1234". + # + # There are no permissions required for making this API call. + rpc :TestIamPermissions, ::Google::Iam::V1::TestIamPermissionsRequest, ::Google::Iam::V1::TestIamPermissionsResponse + end + + Stub = Service.rpc_stub_class + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-resource_manager-v3/lib/google/cloud/resourcemanager/v3/tag_values_pb.rb b/owl-bot-staging/google-cloud-resource_manager-v3/lib/google/cloud/resourcemanager/v3/tag_values_pb.rb new file mode 100644 index 000000000000..95fd5f7ff020 --- /dev/null +++ b/owl-bot-staging/google-cloud-resource_manager-v3/lib/google/cloud/resourcemanager/v3/tag_values_pb.rb @@ -0,0 +1,41 @@ +# frozen_string_literal: true +# Generated by the protocol buffer compiler. DO NOT EDIT! +# source: google/cloud/resourcemanager/v3/tag_values.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/v1/iam_policy_pb' +require 'google/iam/v1/policy_pb' +require 'google/longrunning/operations_pb' +require 'google/protobuf/field_mask_pb' +require 'google/protobuf/timestamp_pb' + + +descriptor_data = "\n0google/cloud/resourcemanager/v3/tag_values.proto\x12\x1fgoogle.cloud.resourcemanager.v3\x1a\x1cgoogle/api/annotations.proto\x1a\x17google/api/client.proto\x1a\x1fgoogle/api/field_behavior.proto\x1a\x19google/api/resource.proto\x1a\x1egoogle/iam/v1/iam_policy.proto\x1a\x1agoogle/iam/v1/policy.proto\x1a#google/longrunning/operations.proto\x1a google/protobuf/field_mask.proto\x1a\x1fgoogle/protobuf/timestamp.proto\"\xd2\x02\n\x08TagValue\x12\x11\n\x04name\x18\x01 \x01(\tB\x03\xe0\x41\x05\x12\x13\n\x06parent\x18\x02 \x01(\tB\x03\xe0\x41\x05\x12\x1a\n\nshort_name\x18\x03 \x01(\tB\x06\xe0\x41\x02\xe0\x41\x05\x12\x1c\n\x0fnamespaced_name\x18\x04 \x01(\tB\x03\xe0\x41\x03\x12\x18\n\x0b\x64\x65scription\x18\x05 \x01(\tB\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\x11\n\x04\x65tag\x18\x08 \x01(\tB\x03\xe0\x41\x01:K\xea\x41H\n,cloudresourcemanager.googleapis.com/TagValue\x12\x15tagValues/{tag_value}R\x01\x01\"b\n\x14ListTagValuesRequest\x12\x19\n\x06parent\x18\x01 \x01(\tB\t\xe0\x41\x02\xfa\x41\x03\x12\x01*\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\"o\n\x15ListTagValuesResponse\x12=\n\ntag_values\x18\x01 \x03(\x0b\x32).google.cloud.resourcemanager.v3.TagValue\x12\x17\n\x0fnext_page_token\x18\x02 \x01(\t\"X\n\x12GetTagValueRequest\x12\x42\n\x04name\x18\x01 \x01(\tB4\xe0\x41\x02\xfa\x41.\n,cloudresourcemanager.googleapis.com/TagValue\"b\n\x1cGetNamespacedTagValueRequest\x12\x42\n\x04name\x18\x01 \x01(\tB4\xe0\x41\x02\xfa\x41.\n,cloudresourcemanager.googleapis.com/TagValue\"v\n\x15\x43reateTagValueRequest\x12\x41\n\ttag_value\x18\x01 \x01(\x0b\x32).google.cloud.resourcemanager.v3.TagValueB\x03\xe0\x41\x02\x12\x1a\n\rvalidate_only\x18\x02 \x01(\x08\x42\x03\xe0\x41\x01\"\x18\n\x16\x43reateTagValueMetadata\"\xac\x01\n\x15UpdateTagValueRequest\x12\x41\n\ttag_value\x18\x01 \x01(\x0b\x32).google.cloud.resourcemanager.v3.TagValueB\x03\xe0\x41\x02\x12\x34\n\x0bupdate_mask\x18\x02 \x01(\x0b\x32\x1a.google.protobuf.FieldMaskB\x03\xe0\x41\x01\x12\x1a\n\rvalidate_only\x18\x03 \x01(\x08\x42\x03\xe0\x41\x01\"\x18\n\x16UpdateTagValueMetadata\"\x8a\x01\n\x15\x44\x65leteTagValueRequest\x12\x42\n\x04name\x18\x01 \x01(\tB4\xe0\x41\x02\xfa\x41.\n,cloudresourcemanager.googleapis.com/TagValue\x12\x1a\n\rvalidate_only\x18\x02 \x01(\x08\x42\x03\xe0\x41\x01\x12\x11\n\x04\x65tag\x18\x03 \x01(\tB\x03\xe0\x41\x01\"\x18\n\x16\x44\x65leteTagValueMetadata2\xac\r\n\tTagValues\x12\x9e\x01\n\rListTagValues\x12\x35.google.cloud.resourcemanager.v3.ListTagValuesRequest\x1a\x36.google.cloud.resourcemanager.v3.ListTagValuesResponse\"\x1e\xda\x41\x06parent\x82\xd3\xe4\x93\x02\x0f\x12\r/v3/tagValues\x12\x94\x01\n\x0bGetTagValue\x12\x33.google.cloud.resourcemanager.v3.GetTagValueRequest\x1a).google.cloud.resourcemanager.v3.TagValue\"%\xda\x41\x04name\x82\xd3\xe4\x93\x02\x18\x12\x16/v3/{name=tagValues/*}\x12\xaa\x01\n\x15GetNamespacedTagValue\x12=.google.cloud.resourcemanager.v3.GetNamespacedTagValueRequest\x1a).google.cloud.resourcemanager.v3.TagValue\"\'\xda\x41\x04name\x82\xd3\xe4\x93\x02\x1a\x12\x18/v3/tagValues/namespaced\x12\xba\x01\n\x0e\x43reateTagValue\x12\x36.google.cloud.resourcemanager.v3.CreateTagValueRequest\x1a\x1d.google.longrunning.Operation\"Q\xca\x41\"\n\x08TagValue\x12\x16\x43reateTagValueMetadata\xda\x41\ttag_value\x82\xd3\xe4\x93\x02\x1a\"\r/v3/tagValues:\ttag_value\x12\xd9\x01\n\x0eUpdateTagValue\x12\x36.google.cloud.resourcemanager.v3.UpdateTagValueRequest\x1a\x1d.google.longrunning.Operation\"p\xca\x41\"\n\x08TagValue\x12\x16UpdateTagValueMetadata\xda\x41\x15tag_value,update_mask\x82\xd3\xe4\x93\x02-2 /v3/{tag_value.name=tagValues/*}:\ttag_value\x12\xb3\x01\n\x0e\x44\x65leteTagValue\x12\x36.google.cloud.resourcemanager.v3.DeleteTagValueRequest\x1a\x1d.google.longrunning.Operation\"J\xca\x41\"\n\x08TagValue\x12\x16\x44\x65leteTagValueMetadata\xda\x41\x04name\x82\xd3\xe4\x93\x02\x18*\x16/v3/{name=tagValues/*}\x12\x88\x01\n\x0cGetIamPolicy\x12\".google.iam.v1.GetIamPolicyRequest\x1a\x15.google.iam.v1.Policy\"=\xda\x41\x08resource\x82\xd3\xe4\x93\x02,\"\'/v3/{resource=tagValues/*}:getIamPolicy:\x01*\x12\x8f\x01\n\x0cSetIamPolicy\x12\".google.iam.v1.SetIamPolicyRequest\x1a\x15.google.iam.v1.Policy\"D\xda\x41\x0fresource,policy\x82\xd3\xe4\x93\x02,\"\'/v3/{resource=tagValues/*}:setIamPolicy:\x01*\x12\xba\x01\n\x12TestIamPermissions\x12(.google.iam.v1.TestIamPermissionsRequest\x1a).google.iam.v1.TestIamPermissionsResponse\"O\xda\x41\x14resource,permissions\x82\xd3\xe4\x93\x02\x32\"-/v3/{resource=tagValues/*}:testIamPermissions:\x01*\x1a\x90\x01\xca\x41#cloudresourcemanager.googleapis.com\xd2\x41ghttps://www.googleapis.com/auth/cloud-platform,https://www.googleapis.com/auth/cloud-platform.read-onlyB\xef\x01\n#com.google.cloud.resourcemanager.v3B\x0eTagValuesProtoP\x01ZMcloud.google.com/go/resourcemanager/apiv3/resourcemanagerpb;resourcemanagerpb\xaa\x02\x1fGoogle.Cloud.ResourceManager.V3\xca\x02\x1fGoogle\\Cloud\\ResourceManager\\V3\xea\x02\"Google::Cloud::ResourceManager::V3b\x06proto3" + +pool = ::Google::Protobuf::DescriptorPool.generated_pool +pool.add_serialized_file(descriptor_data) + +module Google + module Cloud + module ResourceManager + module V3 + TagValue = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.resourcemanager.v3.TagValue").msgclass + ListTagValuesRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.resourcemanager.v3.ListTagValuesRequest").msgclass + ListTagValuesResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.resourcemanager.v3.ListTagValuesResponse").msgclass + GetTagValueRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.resourcemanager.v3.GetTagValueRequest").msgclass + GetNamespacedTagValueRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.resourcemanager.v3.GetNamespacedTagValueRequest").msgclass + CreateTagValueRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.resourcemanager.v3.CreateTagValueRequest").msgclass + CreateTagValueMetadata = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.resourcemanager.v3.CreateTagValueMetadata").msgclass + UpdateTagValueRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.resourcemanager.v3.UpdateTagValueRequest").msgclass + UpdateTagValueMetadata = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.resourcemanager.v3.UpdateTagValueMetadata").msgclass + DeleteTagValueRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.resourcemanager.v3.DeleteTagValueRequest").msgclass + DeleteTagValueMetadata = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.resourcemanager.v3.DeleteTagValueMetadata").msgclass + end + end + end +end diff --git a/owl-bot-staging/google-cloud-resource_manager-v3/lib/google/cloud/resourcemanager/v3/tag_values_services_pb.rb b/owl-bot-staging/google-cloud-resource_manager-v3/lib/google/cloud/resourcemanager/v3/tag_values_services_pb.rb new file mode 100644 index 000000000000..b1abd0a6ebbd --- /dev/null +++ b/owl-bot-staging/google-cloud-resource_manager-v3/lib/google/cloud/resourcemanager/v3/tag_values_services_pb.rb @@ -0,0 +1,81 @@ +# Generated by the protocol buffer compiler. DO NOT EDIT! +# Source: google/cloud/resourcemanager/v3/tag_values.proto for package 'Google.Cloud.ResourceManager.V3' +# Original file comments: +# 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 +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# + +require 'grpc' +require 'google/cloud/resourcemanager/v3/tag_values_pb' + +module Google + module Cloud + module ResourceManager + module V3 + module TagValues + # Allow users to create and manage tag values. + class Service + + include ::GRPC::GenericService + + self.marshal_class_method = :encode + self.unmarshal_class_method = :decode + self.service_name = 'google.cloud.resourcemanager.v3.TagValues' + + # Lists all TagValues for a specific TagKey. + rpc :ListTagValues, ::Google::Cloud::ResourceManager::V3::ListTagValuesRequest, ::Google::Cloud::ResourceManager::V3::ListTagValuesResponse + # Retrieves a TagValue. This method will return `PERMISSION_DENIED` if the + # value does not exist or the user does not have permission to view it. + rpc :GetTagValue, ::Google::Cloud::ResourceManager::V3::GetTagValueRequest, ::Google::Cloud::ResourceManager::V3::TagValue + # Retrieves a TagValue by its namespaced name. + # This method will return `PERMISSION_DENIED` if the value does not exist + # or the user does not have permission to view it. + rpc :GetNamespacedTagValue, ::Google::Cloud::ResourceManager::V3::GetNamespacedTagValueRequest, ::Google::Cloud::ResourceManager::V3::TagValue + # Creates a TagValue as a child of the specified TagKey. If a another + # request with the same parameters is sent while the original request is in + # process the second request will receive an error. A maximum of 1000 + # TagValues can exist under a TagKey at any given time. + rpc :CreateTagValue, ::Google::Cloud::ResourceManager::V3::CreateTagValueRequest, ::Google::Longrunning::Operation + # Updates the attributes of the TagValue resource. + rpc :UpdateTagValue, ::Google::Cloud::ResourceManager::V3::UpdateTagValueRequest, ::Google::Longrunning::Operation + # Deletes a TagValue. The TagValue cannot have any bindings when it is + # deleted. + rpc :DeleteTagValue, ::Google::Cloud::ResourceManager::V3::DeleteTagValueRequest, ::Google::Longrunning::Operation + # Gets the access control policy for a TagValue. The returned policy may be + # empty if no such policy or resource exists. The `resource` field should + # be the TagValue's resource name. For example: `tagValues/1234`. + # The caller must have the + # `cloudresourcemanager.googleapis.com/tagValues.getIamPolicy` permission on + # the identified TagValue to get the access control policy. + rpc :GetIamPolicy, ::Google::Iam::V1::GetIamPolicyRequest, ::Google::Iam::V1::Policy + # Sets the access control policy on a TagValue, replacing any existing + # policy. The `resource` field should be the TagValue's resource name. + # For example: `tagValues/1234`. + # The caller must have `resourcemanager.tagValues.setIamPolicy` permission + # on the identified tagValue. + rpc :SetIamPolicy, ::Google::Iam::V1::SetIamPolicyRequest, ::Google::Iam::V1::Policy + # Returns permissions that a caller has on the specified TagValue. + # The `resource` field should be the TagValue's resource name. For example: + # `tagValues/1234`. + # + # There are no permissions required for making this API call. + rpc :TestIamPermissions, ::Google::Iam::V1::TestIamPermissionsRequest, ::Google::Iam::V1::TestIamPermissionsResponse + end + + Stub = Service.rpc_stub_class + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-resource_manager-v3/proto_docs/README.md b/owl-bot-staging/google-cloud-resource_manager-v3/proto_docs/README.md new file mode 100644 index 000000000000..0265d4e57b17 --- /dev/null +++ b/owl-bot-staging/google-cloud-resource_manager-v3/proto_docs/README.md @@ -0,0 +1,4 @@ +# Resource Manager V3 Protocol Buffer Documentation + +These files are for the YARD documentation of the generated protobuf files. +They are not intended to be required or loaded at runtime. diff --git a/owl-bot-staging/google-cloud-resource_manager-v3/proto_docs/google/api/client.rb b/owl-bot-staging/google-cloud-resource_manager-v3/proto_docs/google/api/client.rb new file mode 100644 index 000000000000..5089551e9ea4 --- /dev/null +++ b/owl-bot-staging/google-cloud-resource_manager-v3/proto_docs/google/api/client.rb @@ -0,0 +1,589 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + + +module Google + module Api + # Required information for every language. + # @!attribute [rw] reference_docs_uri + # @deprecated This field is deprecated and may be removed in the next major version update. + # @return [::String] + # Link to automatically generated reference documentation. Example: + # https://cloud.google.com/nodejs/docs/reference/asset/latest + # @!attribute [rw] destinations + # @return [::Array<::Google::Api::ClientLibraryDestination>] + # The destination where API teams want this client library to be published. + # @!attribute [rw] selective_gapic_generation + # @return [::Google::Api::SelectiveGapicGeneration] + # Configuration for which RPCs should be generated in the GAPIC client. + class CommonLanguageSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Details about how and where to publish client libraries. + # @!attribute [rw] version + # @return [::String] + # Version of the API to apply these settings to. This is the full protobuf + # package for the API, ending in the version element. + # Examples: "google.cloud.speech.v1" and "google.spanner.admin.database.v1". + # @!attribute [rw] launch_stage + # @return [::Google::Api::LaunchStage] + # Launch stage of this version of the API. + # @!attribute [rw] rest_numeric_enums + # @return [::Boolean] + # When using transport=rest, the client request will encode enums as + # numbers rather than strings. + # @!attribute [rw] java_settings + # @return [::Google::Api::JavaSettings] + # Settings for legacy Java features, supported in the Service YAML. + # @!attribute [rw] cpp_settings + # @return [::Google::Api::CppSettings] + # Settings for C++ client libraries. + # @!attribute [rw] php_settings + # @return [::Google::Api::PhpSettings] + # Settings for PHP client libraries. + # @!attribute [rw] python_settings + # @return [::Google::Api::PythonSettings] + # Settings for Python client libraries. + # @!attribute [rw] node_settings + # @return [::Google::Api::NodeSettings] + # Settings for Node client libraries. + # @!attribute [rw] dotnet_settings + # @return [::Google::Api::DotnetSettings] + # Settings for .NET client libraries. + # @!attribute [rw] ruby_settings + # @return [::Google::Api::RubySettings] + # Settings for Ruby client libraries. + # @!attribute [rw] go_settings + # @return [::Google::Api::GoSettings] + # Settings for Go client libraries. + class ClientLibrarySettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # This message configures the settings for publishing [Google Cloud Client + # libraries](https://cloud.google.com/apis/docs/cloud-client-libraries) + # generated from the service config. + # @!attribute [rw] method_settings + # @return [::Array<::Google::Api::MethodSettings>] + # A list of API method settings, e.g. the behavior for methods that use the + # long-running operation pattern. + # @!attribute [rw] new_issue_uri + # @return [::String] + # Link to a *public* URI where users can report issues. Example: + # https://issuetracker.google.com/issues/new?component=190865&template=1161103 + # @!attribute [rw] documentation_uri + # @return [::String] + # Link to product home page. Example: + # https://cloud.google.com/asset-inventory/docs/overview + # @!attribute [rw] api_short_name + # @return [::String] + # Used as a tracking tag when collecting data about the APIs developer + # relations artifacts like docs, packages delivered to package managers, + # etc. Example: "speech". + # @!attribute [rw] github_label + # @return [::String] + # GitHub label to apply to issues and pull requests opened for this API. + # @!attribute [rw] codeowner_github_teams + # @return [::Array<::String>] + # GitHub teams to be added to CODEOWNERS in the directory in GitHub + # containing source code for the client libraries for this API. + # @!attribute [rw] doc_tag_prefix + # @return [::String] + # A prefix used in sample code when demarking regions to be included in + # documentation. + # @!attribute [rw] organization + # @return [::Google::Api::ClientLibraryOrganization] + # For whom the client library is being published. + # @!attribute [rw] library_settings + # @return [::Array<::Google::Api::ClientLibrarySettings>] + # Client library settings. If the same version string appears multiple + # times in this list, then the last one wins. Settings from earlier + # settings with the same version string are discarded. + # @!attribute [rw] proto_reference_documentation_uri + # @return [::String] + # Optional link to proto reference documentation. Example: + # https://cloud.google.com/pubsub/lite/docs/reference/rpc + # @!attribute [rw] rest_reference_documentation_uri + # @return [::String] + # Optional link to REST reference documentation. Example: + # https://cloud.google.com/pubsub/lite/docs/reference/rest + class Publishing + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Settings for Java client libraries. + # @!attribute [rw] library_package + # @return [::String] + # The package name to use in Java. Clobbers the java_package option + # set in the protobuf. This should be used **only** by APIs + # who have already set the language_settings.java.package_name" field + # in gapic.yaml. API teams should use the protobuf java_package option + # where possible. + # + # Example of a YAML configuration:: + # + # publishing: + # 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. + # @!attribute [rw] methods + # @return [::Array<::String>] + # An allowlist of the fully qualified names of RPCs that should be included + # on public client surfaces. + # @!attribute [rw] generate_omitted_as_internal + # @return [::Boolean] + # Setting this to true indicates to the client generators that methods + # that would be excluded from the generation should instead be generated + # in a way that indicates these methods should not be consumed by + # end users. How this is expressed is up to individual language + # implementations to decide. Some examples may be: added annotations, + # obfuscated identifiers, or other language idiomatic patterns. + class SelectiveGapicGeneration + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # `BatchingConfigProto` defines the batching configuration for an API method. + # @!attribute [rw] thresholds + # @return [::Google::Api::BatchingSettingsProto] + # The thresholds which trigger a batched request to be sent. + # @!attribute [rw] batch_descriptor + # @return [::Google::Api::BatchingDescriptorProto] + # The request and response fields used in batching. + class BatchingConfigProto + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # `BatchingSettingsProto` specifies a set of batching thresholds, each of + # which acts as a trigger to send a batch of messages as a request. At least + # one threshold must be positive nonzero. + # @!attribute [rw] element_count_threshold + # @return [::Integer] + # The number of elements of a field collected into a batch which, if + # exceeded, causes the batch to be sent. + # @!attribute [rw] request_byte_threshold + # @return [::Integer] + # The aggregated size of the batched field which, if exceeded, causes the + # batch to be sent. This size is computed by aggregating the sizes of the + # request field to be batched, not of the entire request message. + # @!attribute [rw] delay_threshold + # @return [::Google::Protobuf::Duration] + # The duration after which a batch should be sent, starting from the addition + # of the first message to that batch. + # @!attribute [rw] element_count_limit + # @return [::Integer] + # The maximum number of elements collected in a batch that could be accepted + # by server. + # @!attribute [rw] request_byte_limit + # @return [::Integer] + # The maximum size of the request that could be accepted by server. + # @!attribute [rw] flow_control_element_limit + # @return [::Integer] + # The maximum number of elements allowed by flow control. + # @!attribute [rw] flow_control_byte_limit + # @return [::Integer] + # The maximum size of data allowed by flow control. + # @!attribute [rw] flow_control_limit_exceeded_behavior + # @return [::Google::Api::FlowControlLimitExceededBehaviorProto] + # The behavior to take when the flow control limit is exceeded. + class BatchingSettingsProto + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # `BatchingDescriptorProto` specifies the fields of the request message to be + # used for batching, and, optionally, the fields of the response message to be + # used for demultiplexing. + # @!attribute [rw] batched_field + # @return [::String] + # The repeated field in the request message to be aggregated by batching. + # @!attribute [rw] discriminator_fields + # @return [::Array<::String>] + # A list of the fields in the request message. Two requests will be batched + # together only if the values of every field specified in + # `request_discriminator_fields` is equal between the two requests. + # @!attribute [rw] subresponse_field + # @return [::String] + # Optional. When present, indicates the field in the response message to be + # used to demultiplex the response into multiple response messages, in + # correspondence with the multiple request messages originally batched + # together. + class BatchingDescriptorProto + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # The organization for which the client libraries are being published. + # Affects the url where generated docs are published, etc. + module ClientLibraryOrganization + # Not useful. + CLIENT_LIBRARY_ORGANIZATION_UNSPECIFIED = 0 + + # Google Cloud Platform Org. + CLOUD = 1 + + # Ads (Advertising) Org. + ADS = 2 + + # Photos Org. + PHOTOS = 3 + + # Street View Org. + STREET_VIEW = 4 + + # Shopping Org. + SHOPPING = 5 + + # Geo Org. + GEO = 6 + + # Generative AI - https://developers.generativeai.google + GENERATIVE_AI = 7 + end + + # To where should client libraries be published? + module ClientLibraryDestination + # Client libraries will neither be generated nor published to package + # managers. + CLIENT_LIBRARY_DESTINATION_UNSPECIFIED = 0 + + # Generate the client library in a repo under github.com/googleapis, + # but don't publish it to package managers. + GITHUB = 10 + + # Publish the library to package managers like nuget.org and npmjs.com. + PACKAGE_MANAGER = 20 + end + + # The behavior to take when the flow control limit is exceeded. + module FlowControlLimitExceededBehaviorProto + # Default behavior, system-defined. + UNSET_BEHAVIOR = 0 + + # Stop operation, raise error. + THROW_EXCEPTION = 1 + + # Pause operation until limit clears. + BLOCK = 2 + + # Continue operation, disregard limit. + IGNORE = 3 + end + end +end diff --git a/owl-bot-staging/google-cloud-resource_manager-v3/proto_docs/google/api/field_behavior.rb b/owl-bot-staging/google-cloud-resource_manager-v3/proto_docs/google/api/field_behavior.rb new file mode 100644 index 000000000000..582be187d115 --- /dev/null +++ b/owl-bot-staging/google-cloud-resource_manager-v3/proto_docs/google/api/field_behavior.rb @@ -0,0 +1,85 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + + +module Google + module Api + # An indicator of the behavior of a given field (for example, that a field + # is required in requests, or given as output but ignored as input). + # This **does not** change the behavior in protocol buffers itself; it only + # denotes the behavior and may affect how API tooling handles the field. + # + # Note: This enum **may** receive new values in the future. + module FieldBehavior + # Conventional default for enums. Do not use this. + FIELD_BEHAVIOR_UNSPECIFIED = 0 + + # Specifically denotes a field as optional. + # While all fields in protocol buffers are optional, this may be specified + # for emphasis if appropriate. + OPTIONAL = 1 + + # Denotes a field as required. + # This indicates that the field **must** be provided as part of the request, + # and failure to do so will cause an error (usually `INVALID_ARGUMENT`). + REQUIRED = 2 + + # Denotes a field as output only. + # This indicates that the field is provided in responses, but including the + # field in a request does nothing (the server *must* ignore it and + # *must not* throw an error as a result of the field's presence). + OUTPUT_ONLY = 3 + + # Denotes a field as input only. + # This indicates that the field is provided in requests, and the + # corresponding field is not included in output. + INPUT_ONLY = 4 + + # Denotes a field as immutable. + # This indicates that the field may be set once in a request to create a + # resource, but may not be changed thereafter. + IMMUTABLE = 5 + + # Denotes that a (repeated) field is an unordered list. + # This indicates that the service may provide the elements of the list + # in any arbitrary order, rather than the order the user originally + # provided. Additionally, the list's order may or may not be stable. + UNORDERED_LIST = 6 + + # Denotes that this field returns a non-empty default value if not set. + # This indicates that if the user provides the empty value in a request, + # a non-empty value will be returned. The user will not be aware of what + # non-empty value to expect. + NON_EMPTY_DEFAULT = 7 + + # Denotes that the field in a resource (a message annotated with + # google.api.resource) is used in the resource name to uniquely identify the + # resource. For AIP-compliant APIs, this should only be applied to the + # `name` field on the resource. + # + # This behavior should not be applied to references to other resources within + # the message. + # + # The identifier field of resources often have different field behavior + # depending on the request it is embedded in (e.g. for Create methods name + # is optional and unused, while for Update methods it is required). Instead + # of method-specific annotations, only `IDENTIFIER` is required. + IDENTIFIER = 8 + end + end +end diff --git a/owl-bot-staging/google-cloud-resource_manager-v3/proto_docs/google/api/launch_stage.rb b/owl-bot-staging/google-cloud-resource_manager-v3/proto_docs/google/api/launch_stage.rb new file mode 100644 index 000000000000..9392a413fb1b --- /dev/null +++ b/owl-bot-staging/google-cloud-resource_manager-v3/proto_docs/google/api/launch_stage.rb @@ -0,0 +1,71 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + + +module Google + module Api + # The launch stage as defined by [Google Cloud Platform + # Launch Stages](https://cloud.google.com/terms/launch-stages). + module LaunchStage + # Do not use this default value. + LAUNCH_STAGE_UNSPECIFIED = 0 + + # The feature is not yet implemented. Users can not use it. + UNIMPLEMENTED = 6 + + # Prelaunch features are hidden from users and are only visible internally. + PRELAUNCH = 7 + + # Early Access features are limited to a closed group of testers. To use + # these features, you must sign up in advance and sign a Trusted Tester + # agreement (which includes confidentiality provisions). These features may + # be unstable, changed in backward-incompatible ways, and are not + # guaranteed to be released. + EARLY_ACCESS = 1 + + # Alpha is a limited availability test for releases before they are cleared + # for widespread use. By Alpha, all significant design issues are resolved + # and we are in the process of verifying functionality. Alpha customers + # need to apply for access, agree to applicable terms, and have their + # projects allowlisted. Alpha releases don't have to be feature complete, + # no SLAs are provided, and there are no technical support obligations, but + # they will be far enough along that customers can actually use them in + # test environments or for limited-use tests -- just like they would in + # normal production cases. + ALPHA = 2 + + # Beta is the point at which we are ready to open a release for any + # customer to use. There are no SLA or technical support obligations in a + # Beta release. Products will be complete from a feature perspective, but + # may have some open outstanding issues. Beta releases are suitable for + # limited production use cases. + BETA = 3 + + # GA features are open to all developers and are considered stable and + # fully qualified for production use. + GA = 4 + + # Deprecated features are scheduled to be shut down and removed. For more + # information, see the "Deprecation Policy" section of our [Terms of + # Service](https://cloud.google.com/terms/) + # and the [Google Cloud Platform Subject to the Deprecation + # Policy](https://cloud.google.com/terms/deprecation) documentation. + DEPRECATED = 5 + end + end +end diff --git a/owl-bot-staging/google-cloud-resource_manager-v3/proto_docs/google/api/resource.rb b/owl-bot-staging/google-cloud-resource_manager-v3/proto_docs/google/api/resource.rb new file mode 100644 index 000000000000..25dec4847ac1 --- /dev/null +++ b/owl-bot-staging/google-cloud-resource_manager-v3/proto_docs/google/api/resource.rb @@ -0,0 +1,227 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + + +module Google + module Api + # A simple descriptor of a resource type. + # + # ResourceDescriptor annotates a resource message (either by means of a + # protobuf annotation or use in the service config), and associates the + # resource's schema, the resource type, and the pattern of the resource name. + # + # Example: + # + # message Topic { + # // Indicates this message defines a resource schema. + # // Declares the resource type in the format of {service}/{kind}. + # // For Kubernetes resources, the format is {api group}/{kind}. + # option (google.api.resource) = { + # type: "pubsub.googleapis.com/Topic" + # pattern: "projects/{project}/topics/{topic}" + # }; + # } + # + # The ResourceDescriptor Yaml config will look like: + # + # resources: + # - type: "pubsub.googleapis.com/Topic" + # pattern: "projects/{project}/topics/{topic}" + # + # Sometimes, resources have multiple patterns, typically because they can + # live under multiple parents. + # + # Example: + # + # message LogEntry { + # option (google.api.resource) = { + # type: "logging.googleapis.com/LogEntry" + # pattern: "projects/{project}/logs/{log}" + # pattern: "folders/{folder}/logs/{log}" + # pattern: "organizations/{organization}/logs/{log}" + # pattern: "billingAccounts/{billing_account}/logs/{log}" + # }; + # } + # + # The ResourceDescriptor Yaml config will look like: + # + # resources: + # - type: 'logging.googleapis.com/LogEntry' + # pattern: "projects/{project}/logs/{log}" + # pattern: "folders/{folder}/logs/{log}" + # pattern: "organizations/{organization}/logs/{log}" + # pattern: "billingAccounts/{billing_account}/logs/{log}" + # @!attribute [rw] type + # @return [::String] + # The resource type. It must be in the format of + # \\{service_name}/\\{resource_type_kind}. The `resource_type_kind` must be + # singular and must not include version numbers. + # + # Example: `storage.googleapis.com/Bucket` + # + # The value of the resource_type_kind must follow the regular expression + # /[A-Za-z][a-zA-Z0-9]+/. It should start with an upper case character and + # should use PascalCase (UpperCamelCase). The maximum number of + # characters allowed for the `resource_type_kind` is 100. + # @!attribute [rw] pattern + # @return [::Array<::String>] + # Optional. The relative resource name pattern associated with this resource + # type. The DNS prefix of the full resource name shouldn't be specified here. + # + # The path pattern must follow the syntax, which aligns with HTTP binding + # syntax: + # + # Template = Segment { "/" Segment } ; + # Segment = LITERAL | Variable ; + # Variable = "{" LITERAL "}" ; + # + # Examples: + # + # - "projects/\\{project}/topics/\\{topic}" + # - "projects/\\{project}/knowledgeBases/\\{knowledge_base}" + # + # The components in braces correspond to the IDs for each resource in the + # hierarchy. It is expected that, if multiple patterns are provided, + # the same component name (e.g. "project") refers to IDs of the same + # type of resource. + # @!attribute [rw] name_field + # @return [::String] + # Optional. The field on the resource that designates the resource name + # field. If omitted, this is assumed to be "name". + # @!attribute [rw] history + # @return [::Google::Api::ResourceDescriptor::History] + # Optional. The historical or future-looking state of the resource pattern. + # + # Example: + # + # // The InspectTemplate message originally only supported resource + # // names with organization, and project was added later. + # message InspectTemplate { + # option (google.api.resource) = { + # type: "dlp.googleapis.com/InspectTemplate" + # pattern: + # "organizations/{organization}/inspectTemplates/{inspect_template}" + # pattern: "projects/{project}/inspectTemplates/{inspect_template}" + # history: ORIGINALLY_SINGLE_PATTERN + # }; + # } + # @!attribute [rw] plural + # @return [::String] + # The plural name used in the resource name and permission names, such as + # 'projects' for the resource name of 'projects/\\{project}' and the permission + # name of 'cloudresourcemanager.googleapis.com/projects.get'. One exception + # to this is for Nested Collections that have stuttering names, as defined + # in [AIP-122](https://google.aip.dev/122#nested-collections), where the + # collection ID in the resource name pattern does not necessarily directly + # match the `plural` value. + # + # It is the same concept of the `plural` field in k8s CRD spec + # https://kubernetes.io/docs/tasks/access-kubernetes-api/custom-resources/custom-resource-definitions/ + # + # Note: The plural form is required even for singleton resources. See + # https://aip.dev/156 + # @!attribute [rw] singular + # @return [::String] + # The same concept of the `singular` field in k8s CRD spec + # https://kubernetes.io/docs/tasks/access-kubernetes-api/custom-resources/custom-resource-definitions/ + # Such as "project" for the `resourcemanager.googleapis.com/Project` type. + # @!attribute [rw] style + # @return [::Array<::Google::Api::ResourceDescriptor::Style>] + # Style flag(s) for this resource. + # These indicate that a resource is expected to conform to a given + # style. See the specific style flags for additional information. + class ResourceDescriptor + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # A description of the historical or future-looking state of the + # resource pattern. + module History + # The "unset" value. + HISTORY_UNSPECIFIED = 0 + + # The resource originally had one pattern and launched as such, and + # additional patterns were added later. + ORIGINALLY_SINGLE_PATTERN = 1 + + # The resource has one pattern, but the API owner expects to add more + # later. (This is the inverse of ORIGINALLY_SINGLE_PATTERN, and prevents + # that from being necessary once there are multiple patterns.) + FUTURE_MULTI_PATTERN = 2 + end + + # A flag representing a specific style that a resource claims to conform to. + module Style + # The unspecified value. Do not use. + STYLE_UNSPECIFIED = 0 + + # This resource is intended to be "declarative-friendly". + # + # Declarative-friendly resources must be more strictly consistent, and + # setting this to true communicates to tools that this resource should + # adhere to declarative-friendly expectations. + # + # Note: This is used by the API linter (linter.aip.dev) to enable + # additional checks. + DECLARATIVE_FRIENDLY = 1 + end + end + + # Defines a proto annotation that describes a string field that refers to + # an API resource. + # @!attribute [rw] type + # @return [::String] + # The resource type that the annotated field references. + # + # Example: + # + # message Subscription { + # string topic = 2 [(google.api.resource_reference) = { + # type: "pubsub.googleapis.com/Topic" + # }]; + # } + # + # Occasionally, a field may reference an arbitrary resource. In this case, + # APIs use the special value * in their resource reference. + # + # Example: + # + # message GetIamPolicyRequest { + # string resource = 2 [(google.api.resource_reference) = { + # type: "*" + # }]; + # } + # @!attribute [rw] child_type + # @return [::String] + # The resource type of a child collection that the annotated field + # references. This is useful for annotating the `parent` field that + # doesn't have a fixed resource type. + # + # Example: + # + # message ListLogEntriesRequest { + # string parent = 1 [(google.api.resource_reference) = { + # child_type: "logging.googleapis.com/LogEntry" + # }; + # } + class ResourceReference + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end +end diff --git a/owl-bot-staging/google-cloud-resource_manager-v3/proto_docs/google/cloud/resourcemanager/v3/folders.rb b/owl-bot-staging/google-cloud-resource_manager-v3/proto_docs/google/cloud/resourcemanager/v3/folders.rb new file mode 100644 index 000000000000..d5ca09d8579e --- /dev/null +++ b/owl-bot-staging/google-cloud-resource_manager-v3/proto_docs/google/cloud/resourcemanager/v3/folders.rb @@ -0,0 +1,315 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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 ResourceManager + module V3 + # A folder in an organization's resource hierarchy, used to + # organize that organization's resources. + # @!attribute [r] name + # @return [::String] + # Output only. The resource name of the folder. + # Its format is `folders/{folder_id}`, for example: "folders/1234". + # @!attribute [rw] parent + # @return [::String] + # Required. The folder's parent's resource name. + # Updates to the folder's parent must be performed using + # {::Google::Cloud::ResourceManager::V3::Folders::Client#move_folder MoveFolder}. + # @!attribute [rw] display_name + # @return [::String] + # The folder's display name. + # A folder's display name must be unique amongst its siblings. For example, + # no two folders with the same parent can share the same display name. + # The display name must start and end with a letter or digit, may contain + # letters, digits, spaces, hyphens and underscores and can be no longer + # than 30 characters. This is captured by the regular expression: + # `[\p{L}\p{N}]([\p{L}\p{N}_- ]{0,28}[\p{L}\p{N}])?`. + # @!attribute [r] state + # @return [::Google::Cloud::ResourceManager::V3::Folder::State] + # Output only. The lifecycle state of the folder. + # Updates to the state must be performed using + # {::Google::Cloud::ResourceManager::V3::Folders::Client#delete_folder DeleteFolder} and + # {::Google::Cloud::ResourceManager::V3::Folders::Client#undelete_folder UndeleteFolder}. + # @!attribute [r] create_time + # @return [::Google::Protobuf::Timestamp] + # Output only. Timestamp when the folder was created. + # @!attribute [r] update_time + # @return [::Google::Protobuf::Timestamp] + # Output only. Timestamp when the folder was last modified. + # @!attribute [r] delete_time + # @return [::Google::Protobuf::Timestamp] + # Output only. Timestamp when the folder was requested to be deleted. + # @!attribute [r] etag + # @return [::String] + # Output only. A checksum computed by the server based on the current value + # of the folder resource. This may be sent on update and delete requests to + # ensure the client has an up-to-date value before proceeding. + class Folder + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # Folder lifecycle states. + module State + # Unspecified state. + STATE_UNSPECIFIED = 0 + + # The normal and active state. + ACTIVE = 1 + + # The folder has been marked for deletion by the user. + DELETE_REQUESTED = 2 + end + end + + # The GetFolder request message. + # @!attribute [rw] name + # @return [::String] + # Required. The resource name of the folder to retrieve. + # Must be of the form `folders/{folder_id}`. + class GetFolderRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # The ListFolders request message. + # @!attribute [rw] parent + # @return [::String] + # Required. The name of the parent resource whose folders are being listed. + # Only children of this parent resource are listed; descendants are not + # listed. + # + # If the parent is a folder, use the value `folders/{folder_id}`. If the + # parent is an organization, use the value `organizations/{org_id}`. + # + # Access to this method is controlled by checking the + # `resourcemanager.folders.list` permission on the `parent`. + # @!attribute [rw] page_size + # @return [::Integer] + # Optional. The maximum number of folders to return in the response. The + # server can return fewer folders than requested. If unspecified, server + # picks an appropriate default. + # @!attribute [rw] page_token + # @return [::String] + # Optional. A pagination token returned from a previous call to `ListFolders` + # that indicates where this listing should continue from. + # @!attribute [rw] show_deleted + # @return [::Boolean] + # Optional. Controls whether folders in the + # {::Google::Cloud::ResourceManager::V3::Folder::State::DELETE_REQUESTED DELETE_REQUESTED} + # state should be returned. Defaults to false. + class ListFoldersRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # The ListFolders response message. + # @!attribute [rw] folders + # @return [::Array<::Google::Cloud::ResourceManager::V3::Folder>] + # A possibly paginated list of folders that are direct descendants of + # the specified parent resource. + # @!attribute [rw] next_page_token + # @return [::String] + # A pagination token returned from a previous call to `ListFolders` + # that indicates from where listing should continue. + class ListFoldersResponse + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # The request message for searching folders. + # @!attribute [rw] page_size + # @return [::Integer] + # Optional. The maximum number of folders to return in the response. The + # server can return fewer folders than requested. If unspecified, server + # picks an appropriate default. + # @!attribute [rw] page_token + # @return [::String] + # Optional. A pagination token returned from a previous call to + # `SearchFolders` that indicates from where search should continue. + # @!attribute [rw] query + # @return [::String] + # Optional. Search criteria used to select the folders to return. + # If no search criteria is specified then all accessible folders will be + # returned. + # + # Query expressions can be used to restrict results based upon displayName, + # state and parent, where the operators `=` (`:`) `NOT`, `AND` and `OR` + # can be used along with the suffix wildcard symbol `*`. + # + # The `displayName` field in a query expression should use escaped quotes + # for values that include whitespace to prevent unexpected behavior. + # + # ``` + # | Field | Description | + # |-------------------------|----------------------------------------| + # | displayName | Filters by displayName. | + # | parent | Filters by parent (for example: folders/123). | + # | state, lifecycleState | Filters by state. | + # ``` + # + # Some example queries are: + # + # * Query `displayName=Test*` returns Folder resources whose display name + # starts with "Test". + # * Query `state=ACTIVE` returns Folder resources with + # `state` set to `ACTIVE`. + # * Query `parent=folders/123` returns Folder resources that have + # `folders/123` as a parent resource. + # * Query `parent=folders/123 AND state=ACTIVE` returns active + # Folder resources that have `folders/123` as a parent resource. + # * Query `displayName=\\"Test String\\"` returns Folder resources with + # display names that include both "Test" and "String". + class SearchFoldersRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # The response message for searching folders. + # @!attribute [rw] folders + # @return [::Array<::Google::Cloud::ResourceManager::V3::Folder>] + # A possibly paginated folder search results. + # the specified parent resource. + # @!attribute [rw] next_page_token + # @return [::String] + # A pagination token returned from a previous call to `SearchFolders` + # that indicates from where searching should continue. + class SearchFoldersResponse + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # The CreateFolder request message. + # @!attribute [rw] folder + # @return [::Google::Cloud::ResourceManager::V3::Folder] + # Required. The folder being created, only the display name and parent will + # be consulted. All other fields will be ignored. + class CreateFolderRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Metadata pertaining to the Folder creation process. + # @!attribute [rw] display_name + # @return [::String] + # The display name of the folder. + # @!attribute [rw] parent + # @return [::String] + # The resource name of the folder or organization we are creating the folder + # under. + class CreateFolderMetadata + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # The request sent to the + # [UpdateFolder][google.cloud.resourcemanager.v3.Folder.UpdateFolder] + # method. + # + # Only the `display_name` field can be changed. All other fields will be + # ignored. Use the + # {::Google::Cloud::ResourceManager::V3::Folders::Client#move_folder MoveFolder} method to + # change the `parent` field. + # @!attribute [rw] folder + # @return [::Google::Cloud::ResourceManager::V3::Folder] + # Required. The new definition of the Folder. It must include the `name` + # field, which cannot be changed. + # @!attribute [rw] update_mask + # @return [::Google::Protobuf::FieldMask] + # Required. Fields to be updated. + # Only the `display_name` can be updated. + class UpdateFolderRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # A status object which is used as the `metadata` field for the Operation + # returned by UpdateFolder. + class UpdateFolderMetadata + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # The MoveFolder request message. + # @!attribute [rw] name + # @return [::String] + # Required. The resource name of the Folder to move. + # Must be of the form folders/\\{folder_id} + # @!attribute [rw] destination_parent + # @return [::String] + # Required. The resource name of the folder or organization which should be + # the folder's new parent. Must be of the form `folders/{folder_id}` or + # `organizations/{org_id}`. + class MoveFolderRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Metadata pertaining to the folder move process. + # @!attribute [rw] display_name + # @return [::String] + # The display name of the folder. + # @!attribute [rw] source_parent + # @return [::String] + # The resource name of the folder's parent. + # @!attribute [rw] destination_parent + # @return [::String] + # The resource name of the folder or organization to move the folder to. + class MoveFolderMetadata + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # The DeleteFolder request message. + # @!attribute [rw] name + # @return [::String] + # Required. The resource name of the folder to be deleted. + # Must be of the form `folders/{folder_id}`. + class DeleteFolderRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # A status object which is used as the `metadata` field for the `Operation` + # returned by `DeleteFolder`. + class DeleteFolderMetadata + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # The UndeleteFolder request message. + # @!attribute [rw] name + # @return [::String] + # Required. The resource name of the folder to undelete. + # Must be of the form `folders/{folder_id}`. + class UndeleteFolderRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # A status object which is used as the `metadata` field for the `Operation` + # returned by `UndeleteFolder`. + class UndeleteFolderMetadata + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-resource_manager-v3/proto_docs/google/cloud/resourcemanager/v3/organizations.rb b/owl-bot-staging/google-cloud-resource_manager-v3/proto_docs/google/cloud/resourcemanager/v3/organizations.rb new file mode 100644 index 000000000000..6133679362e8 --- /dev/null +++ b/owl-bot-staging/google-cloud-resource_manager-v3/proto_docs/google/cloud/resourcemanager/v3/organizations.rb @@ -0,0 +1,155 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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 ResourceManager + module V3 + # The root node in the resource hierarchy to which a particular entity's + # (a company, for example) resources belong. + # @!attribute [r] name + # @return [::String] + # Output only. The resource name of the organization. This is the + # organization's relative path in the API. Its format is + # "organizations/[organization_id]". For example, "organizations/1234". + # @!attribute [r] display_name + # @return [::String] + # Output only. A human-readable string that refers to the organization in the + # Google Cloud Console. This string is set by the server and cannot be + # changed. The string will be set to the primary domain (for example, + # "google.com") of the Google Workspace customer that owns the organization. + # @!attribute [rw] directory_customer_id + # @return [::String] + # Immutable. The G Suite / Workspace customer id used in the Directory API. + # @!attribute [r] state + # @return [::Google::Cloud::ResourceManager::V3::Organization::State] + # Output only. The organization's current lifecycle state. + # @!attribute [r] create_time + # @return [::Google::Protobuf::Timestamp] + # Output only. Timestamp when the Organization was created. + # @!attribute [r] update_time + # @return [::Google::Protobuf::Timestamp] + # Output only. Timestamp when the Organization was last modified. + # @!attribute [r] delete_time + # @return [::Google::Protobuf::Timestamp] + # Output only. Timestamp when the Organization was requested for deletion. + # @!attribute [r] etag + # @return [::String] + # Output only. A checksum computed by the server based on the current value + # of the Organization resource. This may be sent on update and delete + # requests to ensure the client has an up-to-date value before proceeding. + class Organization + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # Organization lifecycle states. + module State + # Unspecified state. This is only useful for distinguishing unset values. + STATE_UNSPECIFIED = 0 + + # The normal and active state. + ACTIVE = 1 + + # The organization has been marked for deletion by the user. + DELETE_REQUESTED = 2 + end + end + + # The request sent to the `GetOrganization` method. The `name` field is + # required. `organization_id` is no longer accepted. + # @!attribute [rw] name + # @return [::String] + # Required. The resource name of the Organization to fetch. This is the + # organization's relative path in the API, formatted as + # "organizations/[organizationId]". For example, "organizations/1234". + class GetOrganizationRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # The request sent to the `SearchOrganizations` method. + # @!attribute [rw] page_size + # @return [::Integer] + # Optional. The maximum number of organizations to return in the response. + # The server can return fewer organizations than requested. If unspecified, + # server picks an appropriate default. + # @!attribute [rw] page_token + # @return [::String] + # Optional. A pagination token returned from a previous call to + # `SearchOrganizations` that indicates from where listing should continue. + # @!attribute [rw] query + # @return [::String] + # Optional. An optional query string used to filter the Organizations to + # return in the response. Query rules are case-insensitive. + # + # + # ``` + # | Field | Description | + # |------------------|--------------------------------------------| + # | directoryCustomerId, owner.directoryCustomerId | Filters by directory + # customer id. | + # | domain | Filters by domain. | + # ``` + # + # Organizations may be queried by `directoryCustomerId` or by + # `domain`, where the domain is a G Suite domain, for example: + # + # * Query `directorycustomerid:123456789` returns Organization + # resources with `owner.directory_customer_id` equal to `123456789`. + # * Query `domain:google.com` returns Organization resources corresponding + # to the domain `google.com`. + class SearchOrganizationsRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # The response returned from the `SearchOrganizations` method. + # @!attribute [rw] organizations + # @return [::Array<::Google::Cloud::ResourceManager::V3::Organization>] + # The list of Organizations that matched the search query, possibly + # paginated. + # @!attribute [rw] next_page_token + # @return [::String] + # A pagination token to be used to retrieve the next page of results. If the + # result is too large to fit within the page size specified in the request, + # this field will be set with a token that can be used to fetch the next page + # of results. If this field is empty, it indicates that this response + # contains the last page of results. + class SearchOrganizationsResponse + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # A status object which is used as the `metadata` field for the operation + # returned by DeleteOrganization. + class DeleteOrganizationMetadata + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # A status object which is used as the `metadata` field for the Operation + # returned by UndeleteOrganization. + class UndeleteOrganizationMetadata + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-resource_manager-v3/proto_docs/google/cloud/resourcemanager/v3/projects.rb b/owl-bot-staging/google-cloud-resource_manager-v3/proto_docs/google/cloud/resourcemanager/v3/projects.rb new file mode 100644 index 000000000000..24e7433803a9 --- /dev/null +++ b/owl-bot-staging/google-cloud-resource_manager-v3/proto_docs/google/cloud/resourcemanager/v3/projects.rb @@ -0,0 +1,395 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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 ResourceManager + module V3 + # A project is a high-level Google Cloud entity. It is a + # container for ACLs, APIs, App Engine Apps, VMs, and other + # Google Cloud Platform resources. + # @!attribute [r] name + # @return [::String] + # Output only. The unique resource name of the project. It is an int64 + # generated number prefixed by "projects/". + # + # Example: `projects/415104041262` + # @!attribute [rw] parent + # @return [::String] + # Optional. A reference to a parent Resource. eg., `organizations/123` or + # `folders/876`. + # @!attribute [rw] project_id + # @return [::String] + # Immutable. The unique, user-assigned id of the project. + # It must be 6 to 30 lowercase ASCII letters, digits, or hyphens. + # It must start with a letter. + # Trailing hyphens are prohibited. + # + # Example: `tokyo-rain-123` + # @!attribute [r] state + # @return [::Google::Cloud::ResourceManager::V3::Project::State] + # Output only. The project lifecycle state. + # @!attribute [rw] display_name + # @return [::String] + # Optional. A user-assigned display name of the project. + # When present it must be between 4 to 30 characters. + # Allowed characters are: lowercase and uppercase letters, numbers, + # hyphen, single-quote, double-quote, space, and exclamation point. + # + # Example: `My Project` + # @!attribute [r] create_time + # @return [::Google::Protobuf::Timestamp] + # Output only. Creation time. + # @!attribute [r] update_time + # @return [::Google::Protobuf::Timestamp] + # Output only. The most recent time this resource was modified. + # @!attribute [r] delete_time + # @return [::Google::Protobuf::Timestamp] + # Output only. The time at which this resource was requested for deletion. + # @!attribute [r] etag + # @return [::String] + # Output only. A checksum computed by the server based on the current value + # of the Project resource. This may be sent on update and delete requests to + # ensure the client has an up-to-date value before proceeding. + # @!attribute [rw] labels + # @return [::Google::Protobuf::Map{::String => ::String}] + # Optional. The labels associated with this project. + # + # Label keys must be between 1 and 63 characters long and must conform + # to the following regular expression: \[a-z\](\[-a-z0-9\]*\[a-z0-9\])?. + # + # Label values must be between 0 and 63 characters long and must conform + # to the regular expression (\[a-z\](\[-a-z0-9\]*\[a-z0-9\])?)?. + # + # No more than 64 labels can be associated with a given resource. + # + # Clients should store labels in a representation such as JSON that does not + # depend on specific characters being disallowed. + # + # Example: `"myBusinessDimension" : "businessValue"` + class Project + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # @!attribute [rw] key + # @return [::String] + # @!attribute [rw] value + # @return [::String] + class LabelsEntry + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Project lifecycle states. + module State + # Unspecified state. This is only used/useful for distinguishing + # unset values. + STATE_UNSPECIFIED = 0 + + # The normal and active state. + ACTIVE = 1 + + # The project has been marked for deletion by the user + # (by invoking + # {::Google::Cloud::ResourceManager::V3::Projects::Client#delete_project DeleteProject}) + # or by the system (Google Cloud Platform). + # This can generally be reversed by invoking [UndeleteProject] + # [google.cloud.resourcemanager.v3.Projects.UndeleteProject]. + DELETE_REQUESTED = 2 + end + end + + # The request sent to the + # {::Google::Cloud::ResourceManager::V3::Projects::Client#get_project GetProject} + # method. + # @!attribute [rw] name + # @return [::String] + # Required. The name of the project (for example, `projects/415104041262`). + class GetProjectRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # The request sent to the + # {::Google::Cloud::ResourceManager::V3::Projects::Client#list_projects ListProjects} + # method. + # @!attribute [rw] parent + # @return [::String] + # Required. The name of the parent resource whose projects are being listed. + # Only children of this parent resource are listed; descendants are not + # listed. + # + # If the parent is a folder, use the value `folders/{folder_id}`. If the + # parent is an organization, use the value `organizations/{org_id}`. + # @!attribute [rw] page_token + # @return [::String] + # Optional. A pagination token returned from a previous call to + # [ListProjects] [google.cloud.resourcemanager.v3.Projects.ListProjects] that + # indicates from where listing should continue. + # @!attribute [rw] page_size + # @return [::Integer] + # Optional. The maximum number of projects to return in the response. + # The server can return fewer projects than requested. + # If unspecified, server picks an appropriate default. + # @!attribute [rw] show_deleted + # @return [::Boolean] + # Optional. Indicate that projects in the `DELETE_REQUESTED` state should + # also be returned. Normally only `ACTIVE` projects are returned. + class ListProjectsRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # A page of the response received from the + # {::Google::Cloud::ResourceManager::V3::Projects::Client#list_projects ListProjects} + # method. + # + # A paginated response where more pages are available has + # `next_page_token` set. This token can be used in a subsequent request to + # retrieve the next request page. + # + # NOTE: A response may contain fewer elements than the request `page_size` and + # still have a `next_page_token`. + # @!attribute [rw] projects + # @return [::Array<::Google::Cloud::ResourceManager::V3::Project>] + # The list of Projects under the parent. This list can be paginated. + # @!attribute [rw] next_page_token + # @return [::String] + # Pagination token. + # + # If the result set is too large to fit in a single response, this token + # is returned. It encodes the position of the current result cursor. + # Feeding this value into a new list request with the `page_token` parameter + # gives the next page of the results. + # + # When `next_page_token` is not filled in, there is no next page and + # the list returned is the last page in the result set. + # + # Pagination tokens have a limited lifetime. + class ListProjectsResponse + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # The request sent to the + # {::Google::Cloud::ResourceManager::V3::Projects::Client#search_projects SearchProjects} + # method. + # @!attribute [rw] query + # @return [::String] + # Optional. A query string for searching for projects that the caller has + # `resourcemanager.projects.get` permission to. If multiple fields are + # included in the query, then it will return results that match any of the + # fields. Some eligible fields are: + # + # - **`displayName`, `name`**: Filters by displayName. + # - **`parent`**: Project's parent (for example: `folders/123`, + # `organizations/*`). Prefer `parent` field over `parent.type` and + # `parent.id`. + # - **`parent.type`**: Parent's type: `folder` or `organization`. + # - **`parent.id`**: Parent's id number (for example: `123`). + # - **`id`, `projectId`**: Filters by projectId. + # - **`state`, `lifecycleState`**: Filters by state. + # - **`labels`**: Filters by label name or value. + # - **`labels.` (where `` is the name of a label)**: Filters by label + # name. + # + # Search expressions are case insensitive. + # + # Some examples queries: + # + # + # - **`name:how*`**: The project's name starts with "how". + # - **`name:Howl`**: The project's name is `Howl` or `howl`. + # - **`name:HOWL`**: Equivalent to above. + # - **`NAME:howl`**: Equivalent to above. + # - **`labels.color:*`**: The project has the label `color`. + # - **`labels.color:red`**: The project's label `color` has the value `red`. + # - **`labels.color:red labels.size:big`**: The project's label `color` has + # the value `red` or its label `size` has the value `big`. + # + # If no query is specified, the call will return projects for which the user + # has the `resourcemanager.projects.get` permission. + # @!attribute [rw] page_token + # @return [::String] + # Optional. A pagination token returned from a previous call to + # [ListProjects] [google.cloud.resourcemanager.v3.Projects.ListProjects] that + # indicates from where listing should continue. + # @!attribute [rw] page_size + # @return [::Integer] + # Optional. The maximum number of projects to return in the response. + # The server can return fewer projects than requested. + # If unspecified, server picks an appropriate default. + class SearchProjectsRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # A page of the response received from the + # {::Google::Cloud::ResourceManager::V3::Projects::Client#search_projects SearchProjects} + # method. + # + # A paginated response where more pages are available has + # `next_page_token` set. This token can be used in a subsequent request to + # retrieve the next request page. + # @!attribute [rw] projects + # @return [::Array<::Google::Cloud::ResourceManager::V3::Project>] + # The list of Projects that matched the list filter query. This list can + # be paginated. + # @!attribute [rw] next_page_token + # @return [::String] + # Pagination token. + # + # If the result set is too large to fit in a single response, this token + # is returned. It encodes the position of the current result cursor. + # Feeding this value into a new list request with the `page_token` parameter + # gives the next page of the results. + # + # When `next_page_token` is not filled in, there is no next page and + # the list returned is the last page in the result set. + # + # Pagination tokens have a limited lifetime. + class SearchProjectsResponse + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # The request sent to the + # {::Google::Cloud::ResourceManager::V3::Projects::Client#create_project CreateProject} + # method. + # @!attribute [rw] project + # @return [::Google::Cloud::ResourceManager::V3::Project] + # Required. The Project to create. + # + # Project ID is required. If the requested ID is unavailable, the request + # fails. + # + # If the `parent` field is set, the `resourcemanager.projects.create` + # permission is checked on the parent resource. If no parent is set and + # the authorization credentials belong to an Organization, the parent + # will be set to that Organization. + class CreateProjectRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # A status object which is used as the `metadata` field for the Operation + # returned by CreateProject. It provides insight for when significant phases of + # Project creation have completed. + # @!attribute [rw] create_time + # @return [::Google::Protobuf::Timestamp] + # Creation time of the project creation workflow. + # @!attribute [rw] gettable + # @return [::Boolean] + # True if the project can be retrieved using `GetProject`. No other + # operations on the project are guaranteed to work until the project creation + # is complete. + # @!attribute [rw] ready + # @return [::Boolean] + # True if the project creation process is complete. + class CreateProjectMetadata + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # The request sent to the + # {::Google::Cloud::ResourceManager::V3::Projects::Client#update_project UpdateProject} + # method. + # + # Only the `display_name` and `labels` fields can be change. Use the + # {::Google::Cloud::ResourceManager::V3::Projects::Client#move_project MoveProject} method to + # change the `parent` field. + # @!attribute [rw] project + # @return [::Google::Cloud::ResourceManager::V3::Project] + # Required. The new definition of the project. + # @!attribute [rw] update_mask + # @return [::Google::Protobuf::FieldMask] + # Optional. An update mask to selectively update fields. + class UpdateProjectRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # A status object which is used as the `metadata` field for the Operation + # returned by UpdateProject. + class UpdateProjectMetadata + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # The request sent to + # {::Google::Cloud::ResourceManager::V3::Projects::Client#move_project MoveProject} + # method. + # @!attribute [rw] name + # @return [::String] + # Required. The name of the project to move. + # @!attribute [rw] destination_parent + # @return [::String] + # Required. The new parent to move the Project under. + class MoveProjectRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # A status object which is used as the `metadata` field for the Operation + # returned by MoveProject. + class MoveProjectMetadata + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # {::Google::Cloud::ResourceManager::V3::Projects::Client#delete_project DeleteProject} + # method. + # @!attribute [rw] name + # @return [::String] + # Required. The name of the Project (for example, `projects/415104041262`). + class DeleteProjectRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # A status object which is used as the `metadata` field for the Operation + # returned by `DeleteProject`. + class DeleteProjectMetadata + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # The request sent to the [UndeleteProject] + # [google.cloud.resourcemanager.v3.Projects.UndeleteProject] + # method. + # @!attribute [rw] name + # @return [::String] + # Required. The name of the project (for example, `projects/415104041262`). + # + # Required. + class UndeleteProjectRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # A status object which is used as the `metadata` field for the Operation + # returned by `UndeleteProject`. + class UndeleteProjectMetadata + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-resource_manager-v3/proto_docs/google/cloud/resourcemanager/v3/tag_bindings.rb b/owl-bot-staging/google-cloud-resource_manager-v3/proto_docs/google/cloud/resourcemanager/v3/tag_bindings.rb new file mode 100644 index 000000000000..8db56693b941 --- /dev/null +++ b/owl-bot-staging/google-cloud-resource_manager-v3/proto_docs/google/cloud/resourcemanager/v3/tag_bindings.rb @@ -0,0 +1,216 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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 ResourceManager + module V3 + # A TagBinding represents a connection between a TagValue and a cloud + # resource Once a TagBinding is created, the TagValue is applied to all the + # descendants of the Google Cloud resource. + # @!attribute [r] name + # @return [::String] + # Output only. The name of the TagBinding. This is a String of the form: + # `tagBindings/{full-resource-name}/{tag-value-name}` (e.g. + # `tagBindings/%2F%2Fcloudresourcemanager.googleapis.com%2Fprojects%2F123/tagValues/456`). + # @!attribute [rw] parent + # @return [::String] + # The full resource name of the resource the TagValue is bound to. + # E.g. `//cloudresourcemanager.googleapis.com/projects/123` + # @!attribute [rw] tag_value + # @return [::String] + # The TagValue of the TagBinding. + # Must be of the form `tagValues/456`. + # @!attribute [rw] tag_value_namespaced_name + # @return [::String] + # The namespaced name for the TagValue of the TagBinding. + # Must be in the format + # `{parent_id}/{tag_key_short_name}/{short_name}`. + # + # For methods that support TagValue namespaced name, only one of + # tag_value_namespaced_name or tag_value may be filled. Requests with both + # fields will be rejected. + class TagBinding + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Runtime operation information for creating a TagValue. + class CreateTagBindingMetadata + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # The request message to create a TagBinding. + # @!attribute [rw] tag_binding + # @return [::Google::Cloud::ResourceManager::V3::TagBinding] + # Required. The TagBinding to be created. + # @!attribute [rw] validate_only + # @return [::Boolean] + # Optional. Set to true to perform the validations necessary for creating the + # resource, but not actually perform the action. + class CreateTagBindingRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Runtime operation information for deleting a TagBinding. + class DeleteTagBindingMetadata + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # The request message to delete a TagBinding. + # @!attribute [rw] name + # @return [::String] + # Required. The name of the TagBinding. This is a String of the form: + # `tagBindings/{id}` (e.g. + # `tagBindings/%2F%2Fcloudresourcemanager.googleapis.com%2Fprojects%2F123/tagValues/456`). + class DeleteTagBindingRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # The request message to list all TagBindings for a parent. + # @!attribute [rw] parent + # @return [::String] + # Required. The full resource name of a resource for which you want to list + # existing TagBindings. E.g. + # "//cloudresourcemanager.googleapis.com/projects/123" + # @!attribute [rw] page_size + # @return [::Integer] + # Optional. The maximum number of TagBindings to return in the response. The + # server allows a maximum of 300 TagBindings to return. If unspecified, the + # server will use 100 as the default. + # @!attribute [rw] page_token + # @return [::String] + # Optional. A pagination token returned from a previous call to + # `ListTagBindings` that indicates where this listing should continue from. + class ListTagBindingsRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # The ListTagBindings response. + # @!attribute [rw] tag_bindings + # @return [::Array<::Google::Cloud::ResourceManager::V3::TagBinding>] + # A possibly paginated list of TagBindings for the specified resource. + # @!attribute [rw] next_page_token + # @return [::String] + # Pagination token. + # + # If the result set is too large to fit in a single response, this token + # is returned. It encodes the position of the current result cursor. + # Feeding this value into a new list request with the `page_token` parameter + # gives the next page of the results. + # + # When `next_page_token` is not filled in, there is no next page and + # the list returned is the last page in the result set. + # + # Pagination tokens have a limited lifetime. + class ListTagBindingsResponse + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # The request message to ListEffectiveTags + # @!attribute [rw] parent + # @return [::String] + # Required. The full resource name of a resource for which you want to list + # the effective tags. E.g. + # "//cloudresourcemanager.googleapis.com/projects/123" + # @!attribute [rw] page_size + # @return [::Integer] + # Optional. The maximum number of effective tags to return in the response. + # The server allows a maximum of 300 effective tags to return in a single + # page. If unspecified, the server will use 100 as the default. + # @!attribute [rw] page_token + # @return [::String] + # Optional. A pagination token returned from a previous call to + # `ListEffectiveTags` that indicates from where this listing should continue. + class ListEffectiveTagsRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # The response of ListEffectiveTags. + # @!attribute [rw] effective_tags + # @return [::Array<::Google::Cloud::ResourceManager::V3::EffectiveTag>] + # A possibly paginated list of effective tags for the specified resource. + # @!attribute [rw] next_page_token + # @return [::String] + # Pagination token. + # + # If the result set is too large to fit in a single response, this token + # is returned. It encodes the position of the current result cursor. + # Feeding this value into a new list request with the `page_token` parameter + # gives the next page of the results. + # + # When `next_page_token` is not filled in, there is no next page and + # the list returned is the last page in the result set. + # + # Pagination tokens have a limited lifetime. + class ListEffectiveTagsResponse + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # An EffectiveTag represents a tag that applies to a resource during policy + # evaluation. Tags can be either directly bound to a resource or inherited from + # its ancestor. EffectiveTag contains the name and + # namespaced_name of the tag value and tag key, with additional fields of + # `inherited` to indicate the inheritance status of the effective tag. + # @!attribute [rw] tag_value + # @return [::String] + # Resource name for TagValue in the format `tagValues/456`. + # @!attribute [rw] namespaced_tag_value + # @return [::String] + # The namespaced name of the TagValue. Can be in the form + # `{organization_id}/{tag_key_short_name}/{tag_value_short_name}` or + # `{project_id}/{tag_key_short_name}/{tag_value_short_name}` or + # `{project_number}/{tag_key_short_name}/{tag_value_short_name}`. + # @!attribute [rw] tag_key + # @return [::String] + # The name of the TagKey, in the format `tagKeys/{id}`, such as + # `tagKeys/123`. + # @!attribute [rw] namespaced_tag_key + # @return [::String] + # The namespaced name of the TagKey. Can be in the form + # `{organization_id}/{tag_key_short_name}` or + # `{project_id}/{tag_key_short_name}` or + # `{project_number}/{tag_key_short_name}`. + # @!attribute [rw] tag_key_parent_name + # @return [::String] + # The parent name of the tag key. + # Must be in the format `organizations/{organization_id}` or + # `projects/{project_number}` + # @!attribute [rw] inherited + # @return [::Boolean] + # Indicates the inheritance status of a tag value + # attached to the given resource. If the tag value is inherited from one of + # the resource's ancestors, inherited will be true. If false, then the tag + # value is directly attached to the resource, inherited will be false. + class EffectiveTag + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-resource_manager-v3/proto_docs/google/cloud/resourcemanager/v3/tag_holds.rb b/owl-bot-staging/google-cloud-resource_manager-v3/proto_docs/google/cloud/resourcemanager/v3/tag_holds.rb new file mode 100644 index 000000000000..09705e00166b --- /dev/null +++ b/owl-bot-staging/google-cloud-resource_manager-v3/proto_docs/google/cloud/resourcemanager/v3/tag_holds.rb @@ -0,0 +1,161 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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 ResourceManager + module V3 + # A TagHold represents the use of a TagValue that is not captured by + # TagBindings. If a TagValue has any TagHolds, deletion will be blocked. + # This resource is intended to be created in the same cloud location as the + # `holder`. + # @!attribute [r] name + # @return [::String] + # Output only. The resource name of a TagHold. This is a String of the form: + # `tagValues/{tag-value-id}/tagHolds/{tag-hold-id}` + # (e.g. `tagValues/123/tagHolds/456`). This resource name is generated by + # the server. + # @!attribute [rw] holder + # @return [::String] + # Required. The name of the resource where the TagValue is being used. Must + # be less than 200 characters. E.g. + # `//compute.googleapis.com/compute/projects/myproject/regions/us-east-1/instanceGroupManagers/instance-group` + # @!attribute [rw] origin + # @return [::String] + # Optional. An optional string representing the origin of this request. This + # field should include human-understandable information to distinguish + # origins from each other. Must be less than 200 characters. E.g. + # `migs-35678234` + # @!attribute [rw] help_link + # @return [::String] + # Optional. A URL where an end user can learn more about removing this hold. + # E.g. + # `https://cloud.google.com/resource-manager/docs/tags/tags-creating-and-managing` + # @!attribute [r] create_time + # @return [::Google::Protobuf::Timestamp] + # Output only. The time this TagHold was created. + class TagHold + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # The request message to create a TagHold. + # @!attribute [rw] parent + # @return [::String] + # Required. The resource name of the TagHold's parent TagValue. Must be of + # the form: `tagValues/{tag-value-id}`. + # @!attribute [rw] tag_hold + # @return [::Google::Cloud::ResourceManager::V3::TagHold] + # Required. The TagHold to be created. + # @!attribute [rw] validate_only + # @return [::Boolean] + # Optional. Set to true to perform the validations necessary for creating the + # resource, but not actually perform the action. + class CreateTagHoldRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Runtime operation information for creating a TagHold. + # (-- The metadata is currently empty, but may include information in the + # future. --) + class CreateTagHoldMetadata + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # The request message to delete a TagHold. + # @!attribute [rw] name + # @return [::String] + # Required. The resource name of the TagHold to delete. Must be of the form: + # `tagValues/{tag-value-id}/tagHolds/{tag-hold-id}`. + # @!attribute [rw] validate_only + # @return [::Boolean] + # Optional. Set to true to perform the validations necessary for deleting the + # resource, but not actually perform the action. + class DeleteTagHoldRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Runtime operation information for deleting a TagHold. + # (-- The metadata is currently empty, but may include information in the + # future. --) + class DeleteTagHoldMetadata + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # The request message for listing the TagHolds under a TagValue. + # @!attribute [rw] parent + # @return [::String] + # Required. The resource name of the parent TagValue. Must be of the form: + # `tagValues/{tag-value-id}`. + # @!attribute [rw] page_size + # @return [::Integer] + # Optional. The maximum number of TagHolds to return in the response. The + # server allows a maximum of 300 TagHolds to return. If unspecified, the + # server will use 100 as the default. + # @!attribute [rw] page_token + # @return [::String] + # Optional. A pagination token returned from a previous call to + # `ListTagHolds` that indicates where this listing should continue from. + # @!attribute [rw] filter + # @return [::String] + # Optional. Criteria used to select a subset of TagHolds parented by the + # TagValue to return. This field follows the syntax defined by aip.dev/160; + # the `holder` and `origin` fields are supported for filtering. Currently + # only `AND` syntax is supported. Some example queries are: + # + # * `holder = + # //compute.googleapis.com/compute/projects/myproject/regions/us-east-1/instanceGroupManagers/instance-group` + # * `origin = 35678234` + # * `holder = + # //compute.googleapis.com/compute/projects/myproject/regions/us-east-1/instanceGroupManagers/instance-group + # AND origin = 35678234` + class ListTagHoldsRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # The ListTagHolds response. + # @!attribute [rw] tag_holds + # @return [::Array<::Google::Cloud::ResourceManager::V3::TagHold>] + # A possibly paginated list of TagHolds. + # @!attribute [rw] next_page_token + # @return [::String] + # Pagination token. + # + # If the result set is too large to fit in a single response, this token + # is returned. It encodes the position of the current result cursor. + # Feeding this value into a new list request with the `page_token` parameter + # gives the next page of the results. + # + # When `next_page_token` is not filled in, there is no next page and + # the list returned is the last page in the result set. + # + # Pagination tokens have a limited lifetime. + class ListTagHoldsResponse + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-resource_manager-v3/proto_docs/google/cloud/resourcemanager/v3/tag_keys.rb b/owl-bot-staging/google-cloud-resource_manager-v3/proto_docs/google/cloud/resourcemanager/v3/tag_keys.rb new file mode 100644 index 000000000000..0c2b4bf3e7b2 --- /dev/null +++ b/owl-bot-staging/google-cloud-resource_manager-v3/proto_docs/google/cloud/resourcemanager/v3/tag_keys.rb @@ -0,0 +1,247 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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 ResourceManager + module V3 + # A TagKey, used to group a set of TagValues. + # @!attribute [rw] name + # @return [::String] + # Immutable. The resource name for a TagKey. Must be in the format + # `tagKeys/{tag_key_id}`, where `tag_key_id` is the generated numeric id for + # the TagKey. + # @!attribute [rw] parent + # @return [::String] + # Immutable. The resource name of the TagKey's parent. A TagKey can be + # parented by an Organization or a Project. For a TagKey parented by an + # Organization, its parent must be in the form `organizations/{org_id}`. For + # a TagKey parented by a Project, its parent can be in the form + # `projects/{project_id}` or `projects/{project_number}`. + # @!attribute [rw] short_name + # @return [::String] + # Required. Immutable. The user friendly name for a TagKey. The short name + # should be unique for TagKeys within the same tag namespace. + # + # The short name must be 1-63 characters, beginning and ending with + # an alphanumeric character ([a-z0-9A-Z]) with dashes (-), underscores (_), + # dots (.), and alphanumerics between. + # @!attribute [r] namespaced_name + # @return [::String] + # Output only. Immutable. Namespaced name of the TagKey. + # @!attribute [rw] description + # @return [::String] + # Optional. User-assigned description of the TagKey. Must not exceed 256 + # characters. + # + # Read-write. + # @!attribute [r] create_time + # @return [::Google::Protobuf::Timestamp] + # Output only. Creation time. + # @!attribute [r] update_time + # @return [::Google::Protobuf::Timestamp] + # Output only. Update time. + # @!attribute [rw] etag + # @return [::String] + # Optional. Entity tag which users can pass to prevent race conditions. This + # field is always set in server responses. See UpdateTagKeyRequest for + # details. + # @!attribute [rw] purpose + # @return [::Google::Cloud::ResourceManager::V3::Purpose] + # Optional. A purpose denotes that this Tag is intended for use in policies + # of a specific policy engine, and will involve that policy engine in + # management operations involving this Tag. A purpose does not grant a + # policy engine exclusive rights to the Tag, and it may be referenced by + # other policy engines. + # + # A purpose cannot be changed once set. + # @!attribute [rw] purpose_data + # @return [::Google::Protobuf::Map{::String => ::String}] + # Optional. Purpose data corresponds to the policy system that the tag is + # intended for. See documentation for `Purpose` for formatting of this field. + # + # Purpose data cannot be changed once set. + class TagKey + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # @!attribute [rw] key + # @return [::String] + # @!attribute [rw] value + # @return [::String] + class PurposeDataEntry + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end + + # The request message for listing all TagKeys under a parent resource. + # @!attribute [rw] parent + # @return [::String] + # Required. The resource name of the TagKey's parent. + # Must be of the form `organizations/{org_id}` or `projects/{project_id}` or + # `projects/{project_number}` + # @!attribute [rw] page_size + # @return [::Integer] + # Optional. The maximum number of TagKeys to return in the response. The + # server allows a maximum of 300 TagKeys to return. If unspecified, the + # server will use 100 as the default. + # @!attribute [rw] page_token + # @return [::String] + # Optional. A pagination token returned from a previous call to `ListTagKey` + # that indicates where this listing should continue from. + class ListTagKeysRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # The ListTagKeys response message. + # @!attribute [rw] tag_keys + # @return [::Array<::Google::Cloud::ResourceManager::V3::TagKey>] + # List of TagKeys that live under the specified parent in the request. + # @!attribute [rw] next_page_token + # @return [::String] + # A pagination token returned from a previous call to `ListTagKeys` + # that indicates from where listing should continue. + class ListTagKeysResponse + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # The request message for getting a TagKey. + # @!attribute [rw] name + # @return [::String] + # Required. A resource name in the format `tagKeys/{id}`, such as + # `tagKeys/123`. + class GetTagKeyRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # The request message for getting a TagKey by its namespaced name. + # @!attribute [rw] name + # @return [::String] + # Required. A namespaced tag key name in the format + # `{parentId}/{tagKeyShort}`, such as `42/foo` for a key with short name + # "foo" under the organization with ID 42 or `r2-d2/bar` for a key with short + # name "bar" under the project `r2-d2`. + class GetNamespacedTagKeyRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # The request message for creating a TagKey. + # @!attribute [rw] tag_key + # @return [::Google::Cloud::ResourceManager::V3::TagKey] + # Required. The TagKey to be created. Only fields `short_name`, + # `description`, and `parent` are considered during the creation request. + # @!attribute [rw] validate_only + # @return [::Boolean] + # Optional. Set to true to perform validations necessary for creating the + # resource, but not actually perform the action. + class CreateTagKeyRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Runtime operation information for creating a TagKey. + class CreateTagKeyMetadata + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # The request message for updating a TagKey. + # @!attribute [rw] tag_key + # @return [::Google::Cloud::ResourceManager::V3::TagKey] + # Required. The new definition of the TagKey. Only the `description` and + # `etag` fields can be updated by this request. If the `etag` field is not + # empty, it must match the `etag` field of the existing tag key. Otherwise, + # `ABORTED` will be returned. + # @!attribute [rw] update_mask + # @return [::Google::Protobuf::FieldMask] + # Fields to be updated. The mask may only contain `description` or + # `etag`. If omitted entirely, both `description` and `etag` are assumed to + # be significant. + # @!attribute [rw] validate_only + # @return [::Boolean] + # Set as true to perform validations necessary for updating the resource, but + # not actually perform the action. + class UpdateTagKeyRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Runtime operation information for updating a TagKey. + class UpdateTagKeyMetadata + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # The request message for deleting a TagKey. + # @!attribute [rw] name + # @return [::String] + # Required. The resource name of a TagKey to be deleted in the format + # `tagKeys/123`. The TagKey cannot be a parent of any existing TagValues or + # it will not be deleted successfully. + # @!attribute [rw] validate_only + # @return [::Boolean] + # Optional. Set as true to perform validations necessary for deletion, but + # not actually perform the action. + # @!attribute [rw] etag + # @return [::String] + # Optional. The etag known to the client for the expected state of the + # TagKey. This is to be used for optimistic concurrency. + class DeleteTagKeyRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Runtime operation information for deleting a TagKey. + class DeleteTagKeyMetadata + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # A purpose for each policy engine requiring such an integration. A single + # policy engine may have multiple purposes defined, however a TagKey may only + # specify a single purpose. + module Purpose + # Unspecified purpose. + PURPOSE_UNSPECIFIED = 0 + + # Purpose for Compute Engine firewalls. + # A corresponding `purpose_data` should be set for the network the tag is + # intended for. The key should be `network` and the value should be in + # either of these two formats: + # + # - + # `https://www.googleapis.com/compute/{compute_version}/projects/{project_id}/global/networks/{network_id}` + # - `{project_id}/{network_name}` + # + # Examples: + # + # - + # `https://www.googleapis.com/compute/staging_v1/projects/fail-closed-load-testing/global/networks/6992953698831725600` + # - `fail-closed-load-testing/load-testing-network` + GCE_FIREWALL = 1 + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-resource_manager-v3/proto_docs/google/cloud/resourcemanager/v3/tag_values.rb b/owl-bot-staging/google-cloud-resource_manager-v3/proto_docs/google/cloud/resourcemanager/v3/tag_values.rb new file mode 100644 index 000000000000..3e7ea8cc3717 --- /dev/null +++ b/owl-bot-staging/google-cloud-resource_manager-v3/proto_docs/google/cloud/resourcemanager/v3/tag_values.rb @@ -0,0 +1,202 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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 ResourceManager + module V3 + # A TagValue is a child of a particular TagKey. This is used to group + # cloud resources for the purpose of controlling them using policies. + # @!attribute [rw] name + # @return [::String] + # Immutable. Resource name for TagValue in the format `tagValues/456`. + # @!attribute [rw] parent + # @return [::String] + # Immutable. The resource name of the new TagValue's parent TagKey. + # Must be of the form `tagKeys/{tag_key_id}`. + # @!attribute [rw] short_name + # @return [::String] + # Required. Immutable. User-assigned short name for TagValue. The short name + # should be unique for TagValues within the same parent TagKey. + # + # The short name must be 63 characters or less, beginning and ending with + # an alphanumeric character ([a-z0-9A-Z]) with dashes (-), underscores (_), + # dots (.), and alphanumerics between. + # @!attribute [r] namespaced_name + # @return [::String] + # Output only. The namespaced name of the TagValue. Can be in the form + # `{organization_id}/{tag_key_short_name}/{tag_value_short_name}` or + # `{project_id}/{tag_key_short_name}/{tag_value_short_name}` or + # `{project_number}/{tag_key_short_name}/{tag_value_short_name}`. + # @!attribute [rw] description + # @return [::String] + # Optional. User-assigned description of the TagValue. + # Must not exceed 256 characters. + # + # Read-write. + # @!attribute [r] create_time + # @return [::Google::Protobuf::Timestamp] + # Output only. Creation time. + # @!attribute [r] update_time + # @return [::Google::Protobuf::Timestamp] + # Output only. Update time. + # @!attribute [rw] etag + # @return [::String] + # Optional. Entity tag which users can pass to prevent race conditions. This + # field is always set in server responses. See UpdateTagValueRequest for + # details. + class TagValue + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # The request message for listing TagValues for the specified TagKey. + # Resource name for TagKey, parent of the TagValues to be listed, + # in the format `tagKeys/123`. + # @!attribute [rw] parent + # @return [::String] + # Required. + # @!attribute [rw] page_size + # @return [::Integer] + # Optional. The maximum number of TagValues to return in the response. The + # server allows a maximum of 300 TagValues to return. If unspecified, the + # server will use 100 as the default. + # @!attribute [rw] page_token + # @return [::String] + # Optional. A pagination token returned from a previous call to + # `ListTagValues` that indicates where this listing should continue from. + class ListTagValuesRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # The ListTagValues response. + # @!attribute [rw] tag_values + # @return [::Array<::Google::Cloud::ResourceManager::V3::TagValue>] + # A possibly paginated list of TagValues that are direct descendants of + # the specified parent TagKey. + # @!attribute [rw] next_page_token + # @return [::String] + # A pagination token returned from a previous call to `ListTagValues` + # that indicates from where listing should continue. This is currently not + # used, but the server may at any point start supplying a valid token. + class ListTagValuesResponse + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # The request message for getting a TagValue. + # @!attribute [rw] name + # @return [::String] + # Required. Resource name for TagValue to be fetched in the format + # `tagValues/456`. + class GetTagValueRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # The request message for getting a TagValue by its namespaced name. + # @!attribute [rw] name + # @return [::String] + # Required. A namespaced tag value name in the following format: + # + # `{parentId}/{tagKeyShort}/{tagValueShort}` + # + # Examples: + # - `42/foo/abc` for a value with short name "abc" under the key with short + # name "foo" under the organization with ID 42 + # - `r2-d2/bar/xyz` for a value with short name "xyz" under the key with + # short name "bar" under the project with ID "r2-d2" + class GetNamespacedTagValueRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # The request message for creating a TagValue. + # @!attribute [rw] tag_value + # @return [::Google::Cloud::ResourceManager::V3::TagValue] + # Required. The TagValue to be created. Only fields `short_name`, + # `description`, and `parent` are considered during the creation request. + # @!attribute [rw] validate_only + # @return [::Boolean] + # Optional. Set as true to perform the validations necessary for creating the + # resource, but not actually perform the action. + class CreateTagValueRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Runtime operation information for creating a TagValue. + class CreateTagValueMetadata + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # The request message for updating a TagValue. + # @!attribute [rw] tag_value + # @return [::Google::Cloud::ResourceManager::V3::TagValue] + # Required. The new definition of the TagValue. Only fields `description` and + # `etag` fields can be updated by this request. If the `etag` field is + # nonempty, it must match the `etag` field of the existing ControlGroup. + # Otherwise, `ABORTED` will be returned. + # @!attribute [rw] update_mask + # @return [::Google::Protobuf::FieldMask] + # Optional. Fields to be updated. + # @!attribute [rw] validate_only + # @return [::Boolean] + # Optional. True to perform validations necessary for updating the resource, + # but not actually perform the action. + class UpdateTagValueRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Runtime operation information for updating a TagValue. + class UpdateTagValueMetadata + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # The request message for deleting a TagValue. + # @!attribute [rw] name + # @return [::String] + # Required. Resource name for TagValue to be deleted in the format + # tagValues/456. + # @!attribute [rw] validate_only + # @return [::Boolean] + # Optional. Set as true to perform the validations necessary for deletion, + # but not actually perform the action. + # @!attribute [rw] etag + # @return [::String] + # Optional. The etag known to the client for the expected state of the + # TagValue. This is to be used for optimistic concurrency. + class DeleteTagValueRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Runtime operation information for deleting a TagValue. + class DeleteTagValueMetadata + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-resource_manager-v3/proto_docs/google/iam/v1/iam_policy.rb b/owl-bot-staging/google-cloud-resource_manager-v3/proto_docs/google/iam/v1/iam_policy.rb new file mode 100644 index 000000000000..5445c77f8258 --- /dev/null +++ b/owl-bot-staging/google-cloud-resource_manager-v3/proto_docs/google/iam/v1/iam_policy.rb @@ -0,0 +1,87 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + + +module Google + module Iam + module V1 + # Request message for `SetIamPolicy` method. + # @!attribute [rw] resource + # @return [::String] + # REQUIRED: The resource for which the policy is being specified. + # See the operation documentation for the appropriate value for this field. + # @!attribute [rw] policy + # @return [::Google::Iam::V1::Policy] + # REQUIRED: The complete policy to be applied to the `resource`. The size of + # the policy is limited to a few 10s of KB. An empty policy is a + # valid policy but certain Cloud Platform services (such as Projects) + # might reject them. + # @!attribute [rw] update_mask + # @return [::Google::Protobuf::FieldMask] + # OPTIONAL: A FieldMask specifying which fields of the policy to modify. Only + # the fields in the mask will be modified. If no mask is provided, the + # following default mask is used: + # + # `paths: "bindings, etag"` + class SetIamPolicyRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Request message for `GetIamPolicy` method. + # @!attribute [rw] resource + # @return [::String] + # REQUIRED: The resource for which the policy is being requested. + # See the operation documentation for the appropriate value for this field. + # @!attribute [rw] options + # @return [::Google::Iam::V1::GetPolicyOptions] + # OPTIONAL: A `GetPolicyOptions` object for specifying options to + # `GetIamPolicy`. + class GetIamPolicyRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Request message for `TestIamPermissions` method. + # @!attribute [rw] resource + # @return [::String] + # REQUIRED: The resource for which the policy detail is being requested. + # See the operation documentation for the appropriate value for this field. + # @!attribute [rw] permissions + # @return [::Array<::String>] + # The set of permissions to check for the `resource`. Permissions with + # wildcards (such as '*' or 'storage.*') are not allowed. For more + # information see + # [IAM Overview](https://cloud.google.com/iam/docs/overview#permissions). + class TestIamPermissionsRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Response message for `TestIamPermissions` method. + # @!attribute [rw] permissions + # @return [::Array<::String>] + # A subset of `TestPermissionsRequest.permissions` that the caller is + # allowed. + class TestIamPermissionsResponse + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end + end +end diff --git a/owl-bot-staging/google-cloud-resource_manager-v3/proto_docs/google/iam/v1/options.rb b/owl-bot-staging/google-cloud-resource_manager-v3/proto_docs/google/iam/v1/options.rb new file mode 100644 index 000000000000..60713d995b86 --- /dev/null +++ b/owl-bot-staging/google-cloud-resource_manager-v3/proto_docs/google/iam/v1/options.rb @@ -0,0 +1,50 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + + +module Google + module Iam + module V1 + # Encapsulates settings provided to GetIamPolicy. + # @!attribute [rw] requested_policy_version + # @return [::Integer] + # Optional. The maximum policy version that will be used to format the + # policy. + # + # Valid values are 0, 1, and 3. Requests specifying an invalid value will be + # rejected. + # + # Requests for policies with any conditional role bindings must specify + # version 3. Policies with no conditional role bindings may specify any valid + # value or leave the field unset. + # + # The policy in the response might use the policy version that you specified, + # or it might use a lower policy version. For example, if you specify version + # 3, but the policy has no conditional role bindings, the response uses + # version 1. + # + # To learn which resources support conditions in their IAM policies, see the + # [IAM + # documentation](https://cloud.google.com/iam/help/conditions/resource-policies). + class GetPolicyOptions + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end + end +end diff --git a/owl-bot-staging/google-cloud-resource_manager-v3/proto_docs/google/iam/v1/policy.rb b/owl-bot-staging/google-cloud-resource_manager-v3/proto_docs/google/iam/v1/policy.rb new file mode 100644 index 000000000000..999575b797df --- /dev/null +++ b/owl-bot-staging/google-cloud-resource_manager-v3/proto_docs/google/iam/v1/policy.rb @@ -0,0 +1,426 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + + +module Google + module Iam + module V1 + # An Identity and Access Management (IAM) policy, which specifies access + # controls for Google Cloud resources. + # + # + # A `Policy` is a collection of `bindings`. A `binding` binds one or more + # `members`, or principals, to a single `role`. Principals can be user + # accounts, service accounts, Google groups, and domains (such as G Suite). A + # `role` is a named list of permissions; each `role` can be an IAM predefined + # role or a user-created custom role. + # + # For some types of Google Cloud resources, a `binding` can also specify a + # `condition`, which is a logical expression that allows access to a resource + # only if the expression evaluates to `true`. A condition can add constraints + # based on attributes of the request, the resource, or both. To learn which + # resources support conditions in their IAM policies, see the + # [IAM + # documentation](https://cloud.google.com/iam/help/conditions/resource-policies). + # + # **JSON example:** + # + # ``` + # { + # "bindings": [ + # { + # "role": "roles/resourcemanager.organizationAdmin", + # "members": [ + # "user:mike@example.com", + # "group:admins@example.com", + # "domain:google.com", + # "serviceAccount:my-project-id@appspot.gserviceaccount.com" + # ] + # }, + # { + # "role": "roles/resourcemanager.organizationViewer", + # "members": [ + # "user:eve@example.com" + # ], + # "condition": { + # "title": "expirable access", + # "description": "Does not grant access after Sep 2020", + # "expression": "request.time < + # timestamp('2020-10-01T00:00:00.000Z')", + # } + # } + # ], + # "etag": "BwWWja0YfJA=", + # "version": 3 + # } + # ``` + # + # **YAML example:** + # + # ``` + # bindings: + # - members: + # - user:mike@example.com + # - group:admins@example.com + # - domain:google.com + # - serviceAccount:my-project-id@appspot.gserviceaccount.com + # role: roles/resourcemanager.organizationAdmin + # - members: + # - user:eve@example.com + # role: roles/resourcemanager.organizationViewer + # condition: + # title: expirable access + # description: Does not grant access after Sep 2020 + # expression: request.time < timestamp('2020-10-01T00:00:00.000Z') + # etag: BwWWja0YfJA= + # version: 3 + # ``` + # + # For a description of IAM and its features, see the + # [IAM documentation](https://cloud.google.com/iam/docs/). + # @!attribute [rw] version + # @return [::Integer] + # Specifies the format of the policy. + # + # Valid values are `0`, `1`, and `3`. Requests that specify an invalid value + # are rejected. + # + # Any operation that affects conditional role bindings must specify version + # `3`. This requirement applies to the following operations: + # + # * Getting a policy that includes a conditional role binding + # * Adding a conditional role binding to a policy + # * Changing a conditional role binding in a policy + # * Removing any role binding, with or without a condition, from a policy + # that includes conditions + # + # **Important:** If you use IAM Conditions, you must include the `etag` field + # whenever you call `setIamPolicy`. If you omit this field, then IAM allows + # you to overwrite a version `3` policy with a version `1` policy, and all of + # the conditions in the version `3` policy are lost. + # + # If a policy does not include any conditions, operations on that policy may + # specify any valid version or leave the field unset. + # + # To learn which resources support conditions in their IAM policies, see the + # [IAM + # documentation](https://cloud.google.com/iam/help/conditions/resource-policies). + # @!attribute [rw] bindings + # @return [::Array<::Google::Iam::V1::Binding>] + # Associates a list of `members`, or principals, with a `role`. Optionally, + # may specify a `condition` that determines how and when the `bindings` are + # applied. Each of the `bindings` must contain at least one principal. + # + # The `bindings` in a `Policy` can refer to up to 1,500 principals; up to 250 + # of these principals can be Google groups. Each occurrence of a principal + # counts towards these limits. For example, if the `bindings` grant 50 + # different roles to `user:alice@example.com`, and not to any other + # principal, then you can add another 1,450 principals to the `bindings` in + # the `Policy`. + # @!attribute [rw] audit_configs + # @return [::Array<::Google::Iam::V1::AuditConfig>] + # Specifies cloud audit logging configuration for this policy. + # @!attribute [rw] etag + # @return [::String] + # `etag` is used for optimistic concurrency control as a way to help + # prevent simultaneous updates of a policy from overwriting each other. + # It is strongly suggested that systems make use of the `etag` in the + # read-modify-write cycle to perform policy updates in order to avoid race + # conditions: An `etag` is returned in the response to `getIamPolicy`, and + # systems are expected to put that etag in the request to `setIamPolicy` to + # ensure that their change will be applied to the same version of the policy. + # + # **Important:** If you use IAM Conditions, you must include the `etag` field + # whenever you call `setIamPolicy`. If you omit this field, then IAM allows + # you to overwrite a version `3` policy with a version `1` policy, and all of + # the conditions in the version `3` policy are lost. + class Policy + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Associates `members`, or principals, with a `role`. + # @!attribute [rw] role + # @return [::String] + # Role that is assigned to the list of `members`, or principals. + # For example, `roles/viewer`, `roles/editor`, or `roles/owner`. + # @!attribute [rw] members + # @return [::Array<::String>] + # Specifies the principals requesting access for a Google Cloud resource. + # `members` can have the following values: + # + # * `allUsers`: A special identifier that represents anyone who is + # on the internet; with or without a Google account. + # + # * `allAuthenticatedUsers`: A special identifier that represents anyone + # who is authenticated with a Google account or a service account. + # + # * `user:{emailid}`: An email address that represents a specific Google + # account. For example, `alice@example.com` . + # + # + # * `serviceAccount:{emailid}`: An email address that represents a service + # account. For example, `my-other-app@appspot.gserviceaccount.com`. + # + # * `group:{emailid}`: An email address that represents a Google group. + # For example, `admins@example.com`. + # + # * `deleted:user:{emailid}?uid={uniqueid}`: An email address (plus unique + # identifier) representing a user that has been recently deleted. For + # example, `alice@example.com?uid=123456789012345678901`. If the user is + # recovered, this value reverts to `user:{emailid}` and the recovered user + # retains the role in the binding. + # + # * `deleted:serviceAccount:{emailid}?uid={uniqueid}`: An email address (plus + # unique identifier) representing a service account that has been recently + # deleted. For example, + # `my-other-app@appspot.gserviceaccount.com?uid=123456789012345678901`. + # If the service account is undeleted, this value reverts to + # `serviceAccount:{emailid}` and the undeleted service account retains the + # role in the binding. + # + # * `deleted:group:{emailid}?uid={uniqueid}`: An email address (plus unique + # identifier) representing a Google group that has been recently + # deleted. For example, `admins@example.com?uid=123456789012345678901`. If + # the group is recovered, this value reverts to `group:{emailid}` and the + # recovered group retains the role in the binding. + # + # + # * `domain:{domain}`: The G Suite domain (primary) that represents all the + # users of that domain. For example, `google.com` or `example.com`. + # @!attribute [rw] condition + # @return [::Google::Type::Expr] + # The condition that is associated with this binding. + # + # If the condition evaluates to `true`, then this binding applies to the + # current request. + # + # If the condition evaluates to `false`, then this binding does not apply to + # the current request. However, a different role binding might grant the same + # role to one or more of the principals in this binding. + # + # To learn which resources support conditions in their IAM policies, see the + # [IAM + # documentation](https://cloud.google.com/iam/help/conditions/resource-policies). + class Binding + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Specifies the audit configuration for a service. + # The configuration determines which permission types are logged, and what + # identities, if any, are exempted from logging. + # An AuditConfig must have one or more AuditLogConfigs. + # + # If there are AuditConfigs for both `allServices` and a specific service, + # the union of the two AuditConfigs is used for that service: the log_types + # specified in each AuditConfig are enabled, and the exempted_members in each + # AuditLogConfig are exempted. + # + # Example Policy with multiple AuditConfigs: + # + # { + # "audit_configs": [ + # { + # "service": "allServices", + # "audit_log_configs": [ + # { + # "log_type": "DATA_READ", + # "exempted_members": [ + # "user:jose@example.com" + # ] + # }, + # { + # "log_type": "DATA_WRITE" + # }, + # { + # "log_type": "ADMIN_READ" + # } + # ] + # }, + # { + # "service": "sampleservice.googleapis.com", + # "audit_log_configs": [ + # { + # "log_type": "DATA_READ" + # }, + # { + # "log_type": "DATA_WRITE", + # "exempted_members": [ + # "user:aliya@example.com" + # ] + # } + # ] + # } + # ] + # } + # + # For sampleservice, this policy enables DATA_READ, DATA_WRITE and ADMIN_READ + # logging. It also exempts `jose@example.com` from DATA_READ logging, and + # `aliya@example.com` from DATA_WRITE logging. + # @!attribute [rw] service + # @return [::String] + # Specifies a service that will be enabled for audit logging. + # For example, `storage.googleapis.com`, `cloudsql.googleapis.com`. + # `allServices` is a special value that covers all services. + # @!attribute [rw] audit_log_configs + # @return [::Array<::Google::Iam::V1::AuditLogConfig>] + # The configuration for logging of each type of permission. + class AuditConfig + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Provides the configuration for logging a type of permissions. + # Example: + # + # { + # "audit_log_configs": [ + # { + # "log_type": "DATA_READ", + # "exempted_members": [ + # "user:jose@example.com" + # ] + # }, + # { + # "log_type": "DATA_WRITE" + # } + # ] + # } + # + # This enables 'DATA_READ' and 'DATA_WRITE' logging, while exempting + # jose@example.com from DATA_READ logging. + # @!attribute [rw] log_type + # @return [::Google::Iam::V1::AuditLogConfig::LogType] + # The log type that this config enables. + # @!attribute [rw] exempted_members + # @return [::Array<::String>] + # Specifies the identities that do not cause logging for this type of + # permission. + # Follows the same format of + # [Binding.members][google.iam.v1.Binding.members]. + class AuditLogConfig + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # The list of valid permission types for which logging can be configured. + # Admin writes are always logged, and are not configurable. + module LogType + # Default case. Should never be this. + LOG_TYPE_UNSPECIFIED = 0 + + # Admin reads. Example: CloudIAM getIamPolicy + ADMIN_READ = 1 + + # Data writes. Example: CloudSQL Users create + DATA_WRITE = 2 + + # Data reads. Example: CloudSQL Users list + DATA_READ = 3 + end + end + + # The difference delta between two policies. + # @!attribute [rw] binding_deltas + # @return [::Array<::Google::Iam::V1::BindingDelta>] + # The delta for Bindings between two policies. + # @!attribute [rw] audit_config_deltas + # @return [::Array<::Google::Iam::V1::AuditConfigDelta>] + # The delta for AuditConfigs between two policies. + class PolicyDelta + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # One delta entry for Binding. Each individual change (only one member in each + # entry) to a binding will be a separate entry. + # @!attribute [rw] action + # @return [::Google::Iam::V1::BindingDelta::Action] + # The action that was performed on a Binding. + # Required + # @!attribute [rw] role + # @return [::String] + # Role that is assigned to `members`. + # For example, `roles/viewer`, `roles/editor`, or `roles/owner`. + # Required + # @!attribute [rw] member + # @return [::String] + # A single identity requesting access for a Google Cloud resource. + # Follows the same format of Binding.members. + # Required + # @!attribute [rw] condition + # @return [::Google::Type::Expr] + # The condition that is associated with this binding. + class BindingDelta + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # The type of action performed on a Binding in a policy. + module Action + # Unspecified. + ACTION_UNSPECIFIED = 0 + + # Addition of a Binding. + ADD = 1 + + # Removal of a Binding. + REMOVE = 2 + end + end + + # One delta entry for AuditConfig. Each individual change (only one + # exempted_member in each entry) to a AuditConfig will be a separate entry. + # @!attribute [rw] action + # @return [::Google::Iam::V1::AuditConfigDelta::Action] + # The action that was performed on an audit configuration in a policy. + # Required + # @!attribute [rw] service + # @return [::String] + # Specifies a service that was configured for Cloud Audit Logging. + # For example, `storage.googleapis.com`, `cloudsql.googleapis.com`. + # `allServices` is a special value that covers all services. + # Required + # @!attribute [rw] exempted_member + # @return [::String] + # A single identity that is exempted from "data access" audit + # logging for the `service` specified above. + # Follows the same format of Binding.members. + # @!attribute [rw] log_type + # @return [::String] + # Specifies the log_type that was be enabled. ADMIN_ACTIVITY is always + # enabled, and cannot be configured. + # Required + class AuditConfigDelta + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # The type of action performed on an audit configuration in a policy. + module Action + # Unspecified. + ACTION_UNSPECIFIED = 0 + + # Addition of an audit configuration. + ADD = 1 + + # Removal of an audit configuration. + REMOVE = 2 + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-resource_manager-v3/proto_docs/google/longrunning/operations.rb b/owl-bot-staging/google-cloud-resource_manager-v3/proto_docs/google/longrunning/operations.rb new file mode 100644 index 000000000000..7a757f512165 --- /dev/null +++ b/owl-bot-staging/google-cloud-resource_manager-v3/proto_docs/google/longrunning/operations.rb @@ -0,0 +1,191 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + + +module Google + module Longrunning + # This resource represents a long-running operation that is the result of a + # network API call. + # @!attribute [rw] name + # @return [::String] + # The server-assigned name, which is only unique within the same service that + # originally returns it. If you use the default HTTP mapping, the + # `name` should be a resource name ending with `operations/{unique_id}`. + # @!attribute [rw] metadata + # @return [::Google::Protobuf::Any] + # Service-specific metadata associated with the operation. It typically + # contains progress information and common metadata such as create time. + # Some services might not provide such metadata. Any method that returns a + # long-running operation should document the metadata type, if any. + # @!attribute [rw] done + # @return [::Boolean] + # If the value is `false`, it means the operation is still in progress. + # If `true`, the operation is completed, and either `error` or `response` is + # available. + # @!attribute [rw] error + # @return [::Google::Rpc::Status] + # The error result of the operation in case of failure or cancellation. + # + # Note: The following fields are mutually exclusive: `error`, `response`. If a field in that set is populated, all other fields in the set will automatically be cleared. + # @!attribute [rw] response + # @return [::Google::Protobuf::Any] + # The normal, successful response of the operation. If the original + # method returns no data on success, such as `Delete`, the response is + # `google.protobuf.Empty`. If the original method is standard + # `Get`/`Create`/`Update`, the response should be the resource. For other + # methods, the response should have the type `XxxResponse`, where `Xxx` + # is the original method name. For example, if the original method name + # is `TakeSnapshot()`, the inferred response type is + # `TakeSnapshotResponse`. + # + # Note: The following fields are mutually exclusive: `response`, `error`. If a field in that set is populated, all other fields in the set will automatically be cleared. + class Operation + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # The request message for + # Operations.GetOperation. + # @!attribute [rw] name + # @return [::String] + # The name of the operation resource. + class GetOperationRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # The request message for + # Operations.ListOperations. + # @!attribute [rw] name + # @return [::String] + # The name of the operation's parent resource. + # @!attribute [rw] filter + # @return [::String] + # The standard list filter. + # @!attribute [rw] page_size + # @return [::Integer] + # The standard list page size. + # @!attribute [rw] page_token + # @return [::String] + # The standard list page token. + # @!attribute [rw] return_partial_success + # @return [::Boolean] + # When set to `true`, operations that are reachable are returned as normal, + # and those that are unreachable are returned in the + # [ListOperationsResponse.unreachable] field. + # + # This can only be `true` when reading across collections e.g. when `parent` + # is set to `"projects/example/locations/-"`. + # + # This field is not by default supported and will result in an + # `UNIMPLEMENTED` error if set unless explicitly documented otherwise in + # service or product specific documentation. + class ListOperationsRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # The response message for + # Operations.ListOperations. + # @!attribute [rw] operations + # @return [::Array<::Google::Longrunning::Operation>] + # A list of operations that matches the specified filter in the request. + # @!attribute [rw] next_page_token + # @return [::String] + # The standard List next-page token. + # @!attribute [rw] unreachable + # @return [::Array<::String>] + # Unordered list. Unreachable resources. Populated when the request sets + # `ListOperationsRequest.return_partial_success` and reads across + # collections e.g. when attempting to list all resources across all supported + # locations. + class ListOperationsResponse + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # The request message for + # Operations.CancelOperation. + # @!attribute [rw] name + # @return [::String] + # The name of the operation resource to be cancelled. + class CancelOperationRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # The request message for + # Operations.DeleteOperation. + # @!attribute [rw] name + # @return [::String] + # The name of the operation resource to be deleted. + class DeleteOperationRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # The request message for + # Operations.WaitOperation. + # @!attribute [rw] name + # @return [::String] + # The name of the operation resource to wait on. + # @!attribute [rw] timeout + # @return [::Google::Protobuf::Duration] + # The maximum duration to wait before timing out. If left blank, the wait + # will be at most the time permitted by the underlying HTTP/RPC protocol. + # If RPC context deadline is also specified, the shorter one will be used. + class WaitOperationRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # A message representing the message types used by a long-running operation. + # + # Example: + # + # rpc Export(ExportRequest) returns (google.longrunning.Operation) { + # option (google.longrunning.operation_info) = { + # response_type: "ExportResponse" + # metadata_type: "ExportMetadata" + # }; + # } + # @!attribute [rw] response_type + # @return [::String] + # Required. The message name of the primary return type for this + # long-running operation. + # This type will be used to deserialize the LRO's response. + # + # If the response is in a different package from the rpc, a fully-qualified + # message name must be used (e.g. `google.protobuf.Struct`). + # + # Note: Altering this value constitutes a breaking change. + # @!attribute [rw] metadata_type + # @return [::String] + # Required. The message name of the metadata type for this long-running + # operation. + # + # If the response is in a different package from the rpc, a fully-qualified + # message name must be used (e.g. `google.protobuf.Struct`). + # + # Note: Altering this value constitutes a breaking change. + class OperationInfo + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end +end diff --git a/owl-bot-staging/google-cloud-resource_manager-v3/proto_docs/google/protobuf/any.rb b/owl-bot-staging/google-cloud-resource_manager-v3/proto_docs/google/protobuf/any.rb new file mode 100644 index 000000000000..58691995f02e --- /dev/null +++ b/owl-bot-staging/google-cloud-resource_manager-v3/proto_docs/google/protobuf/any.rb @@ -0,0 +1,145 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + + +module Google + module Protobuf + # `Any` contains an arbitrary serialized protocol buffer message along with a + # URL that describes the type of the serialized message. + # + # Protobuf library provides support to pack/unpack Any values in the form + # of utility functions or additional generated methods of the Any type. + # + # Example 1: Pack and unpack a message in C++. + # + # Foo foo = ...; + # Any any; + # any.PackFrom(foo); + # ... + # if (any.UnpackTo(&foo)) { + # ... + # } + # + # Example 2: Pack and unpack a message in Java. + # + # Foo foo = ...; + # Any any = Any.pack(foo); + # ... + # if (any.is(Foo.class)) { + # foo = any.unpack(Foo.class); + # } + # // or ... + # if (any.isSameTypeAs(Foo.getDefaultInstance())) { + # foo = any.unpack(Foo.getDefaultInstance()); + # } + # + # Example 3: Pack and unpack a message in Python. + # + # foo = Foo(...) + # any = Any() + # any.Pack(foo) + # ... + # if any.Is(Foo.DESCRIPTOR): + # any.Unpack(foo) + # ... + # + # Example 4: Pack and unpack a message in Go + # + # foo := &pb.Foo{...} + # any, err := anypb.New(foo) + # if err != nil { + # ... + # } + # ... + # foo := &pb.Foo{} + # if err := any.UnmarshalTo(foo); err != nil { + # ... + # } + # + # The pack methods provided by protobuf library will by default use + # 'type.googleapis.com/full.type.name' as the type URL and the unpack + # methods only use the fully qualified type name after the last '/' + # in the type URL, for example "foo.bar.com/x/y.z" will yield type + # name "y.z". + # + # JSON + # ==== + # The JSON representation of an `Any` value uses the regular + # representation of the deserialized, embedded message, with an + # additional field `@type` which contains the type URL. Example: + # + # package google.profile; + # message Person { + # string first_name = 1; + # string last_name = 2; + # } + # + # { + # "@type": "type.googleapis.com/google.profile.Person", + # "firstName": , + # "lastName": + # } + # + # If the embedded message type is well-known and has a custom JSON + # representation, that representation will be embedded adding a field + # `value` which holds the custom JSON in addition to the `@type` + # field. Example (for message [google.protobuf.Duration][]): + # + # { + # "@type": "type.googleapis.com/google.protobuf.Duration", + # "value": "1.212s" + # } + # @!attribute [rw] type_url + # @return [::String] + # A URL/resource name that uniquely identifies the type of the serialized + # protocol buffer message. This string must contain at least + # one "/" character. The last segment of the URL's path must represent + # the fully qualified name of the type (as in + # `path/google.protobuf.Duration`). The name should be in a canonical form + # (e.g., leading "." is not accepted). + # + # In practice, teams usually precompile into the binary all types that they + # expect it to use in the context of Any. However, for URLs which use the + # scheme `http`, `https`, or no scheme, one can optionally set up a type + # server that maps type URLs to message definitions as follows: + # + # * If no scheme is provided, `https` is assumed. + # * An HTTP GET on the URL must yield a [google.protobuf.Type][] + # value in binary format, or produce an error. + # * Applications are allowed to cache lookup results based on the + # URL, or have them precompiled into a binary to avoid any + # lookup. Therefore, binary compatibility needs to be preserved + # on changes to types. (Use versioned type names to manage + # breaking changes.) + # + # Note: this functionality is not currently available in the official + # protobuf release, and it is not used for type URLs beginning with + # type.googleapis.com. As of May 2023, there are no widely used type server + # implementations and no plans to implement one. + # + # Schemes other than `http`, `https` (or the empty scheme) might be + # used with implementation specific semantics. + # @!attribute [rw] value + # @return [::String] + # Must be a valid serialized protocol buffer of the above specified type. + class Any + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end +end diff --git a/owl-bot-staging/google-cloud-resource_manager-v3/proto_docs/google/protobuf/duration.rb b/owl-bot-staging/google-cloud-resource_manager-v3/proto_docs/google/protobuf/duration.rb new file mode 100644 index 000000000000..ea59f1f91daf --- /dev/null +++ b/owl-bot-staging/google-cloud-resource_manager-v3/proto_docs/google/protobuf/duration.rb @@ -0,0 +1,98 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + + +module Google + module Protobuf + # A Duration represents a signed, fixed-length span of time represented + # as a count of seconds and fractions of seconds at nanosecond + # resolution. It is independent of any calendar and concepts like "day" + # or "month". It is related to Timestamp in that the difference between + # two Timestamp values is a Duration and it can be added or subtracted + # from a Timestamp. Range is approximately +-10,000 years. + # + # # Examples + # + # Example 1: Compute Duration from two Timestamps in pseudo code. + # + # Timestamp start = ...; + # Timestamp end = ...; + # Duration duration = ...; + # + # duration.seconds = end.seconds - start.seconds; + # duration.nanos = end.nanos - start.nanos; + # + # if (duration.seconds < 0 && duration.nanos > 0) { + # duration.seconds += 1; + # duration.nanos -= 1000000000; + # } else if (duration.seconds > 0 && duration.nanos < 0) { + # duration.seconds -= 1; + # duration.nanos += 1000000000; + # } + # + # Example 2: Compute Timestamp from Timestamp + Duration in pseudo code. + # + # Timestamp start = ...; + # Duration duration = ...; + # Timestamp end = ...; + # + # end.seconds = start.seconds + duration.seconds; + # end.nanos = start.nanos + duration.nanos; + # + # if (end.nanos < 0) { + # end.seconds -= 1; + # end.nanos += 1000000000; + # } else if (end.nanos >= 1000000000) { + # end.seconds += 1; + # end.nanos -= 1000000000; + # } + # + # Example 3: Compute Duration from datetime.timedelta in Python. + # + # td = datetime.timedelta(days=3, minutes=10) + # duration = Duration() + # duration.FromTimedelta(td) + # + # # JSON Mapping + # + # In JSON format, the Duration type is encoded as a string rather than an + # object, where the string ends in the suffix "s" (indicating seconds) and + # is preceded by the number of seconds, with nanoseconds expressed as + # fractional seconds. For example, 3 seconds with 0 nanoseconds should be + # encoded in JSON format as "3s", while 3 seconds and 1 nanosecond should + # be expressed in JSON format as "3.000000001s", and 3 seconds and 1 + # microsecond should be expressed in JSON format as "3.000001s". + # @!attribute [rw] seconds + # @return [::Integer] + # Signed seconds of the span of time. Must be from -315,576,000,000 + # to +315,576,000,000 inclusive. Note: these bounds are computed from: + # 60 sec/min * 60 min/hr * 24 hr/day * 365.25 days/year * 10000 years + # @!attribute [rw] nanos + # @return [::Integer] + # Signed fractions of a second at nanosecond resolution of the span + # of time. Durations less than one second are represented with a 0 + # `seconds` field and a positive or negative `nanos` field. For durations + # of one second or more, a non-zero value for the `nanos` field must be + # of the same sign as the `seconds` field. Must be from -999,999,999 + # to +999,999,999 inclusive. + class Duration + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end +end diff --git a/owl-bot-staging/google-cloud-resource_manager-v3/proto_docs/google/protobuf/empty.rb b/owl-bot-staging/google-cloud-resource_manager-v3/proto_docs/google/protobuf/empty.rb new file mode 100644 index 000000000000..83e4481834a6 --- /dev/null +++ b/owl-bot-staging/google-cloud-resource_manager-v3/proto_docs/google/protobuf/empty.rb @@ -0,0 +1,34 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + + +module Google + module Protobuf + # A generic empty message that you can re-use to avoid defining duplicated + # empty messages in your APIs. A typical example is to use it as the request + # or the response type of an API method. For instance: + # + # service Foo { + # rpc Bar(google.protobuf.Empty) returns (google.protobuf.Empty); + # } + class Empty + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end +end diff --git a/owl-bot-staging/google-cloud-resource_manager-v3/proto_docs/google/protobuf/field_mask.rb b/owl-bot-staging/google-cloud-resource_manager-v3/proto_docs/google/protobuf/field_mask.rb new file mode 100644 index 000000000000..7f3ffc78601a --- /dev/null +++ b/owl-bot-staging/google-cloud-resource_manager-v3/proto_docs/google/protobuf/field_mask.rb @@ -0,0 +1,229 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + + +module Google + module Protobuf + # `FieldMask` represents a set of symbolic field paths, for example: + # + # paths: "f.a" + # paths: "f.b.d" + # + # Here `f` represents a field in some root message, `a` and `b` + # fields in the message found in `f`, and `d` a field found in the + # message in `f.b`. + # + # Field masks are used to specify a subset of fields that should be + # returned by a get operation or modified by an update operation. + # Field masks also have a custom JSON encoding (see below). + # + # # Field Masks in Projections + # + # When used in the context of a projection, a response message or + # sub-message is filtered by the API to only contain those fields as + # specified in the mask. For example, if the mask in the previous + # example is applied to a response message as follows: + # + # f { + # a : 22 + # b { + # d : 1 + # x : 2 + # } + # y : 13 + # } + # z: 8 + # + # The result will not contain specific values for fields x,y and z + # (their value will be set to the default, and omitted in proto text + # output): + # + # + # f { + # a : 22 + # b { + # d : 1 + # } + # } + # + # A repeated field is not allowed except at the last position of a + # paths string. + # + # If a FieldMask object is not present in a get operation, the + # operation applies to all fields (as if a FieldMask of all fields + # had been specified). + # + # Note that a field mask does not necessarily apply to the + # top-level response message. In case of a REST get operation, the + # field mask applies directly to the response, but in case of a REST + # list operation, the mask instead applies to each individual message + # in the returned resource list. In case of a REST custom method, + # other definitions may be used. Where the mask applies will be + # clearly documented together with its declaration in the API. In + # any case, the effect on the returned resource/resources is required + # behavior for APIs. + # + # # Field Masks in Update Operations + # + # A field mask in update operations specifies which fields of the + # targeted resource are going to be updated. The API is required + # to only change the values of the fields as specified in the mask + # and leave the others untouched. If a resource is passed in to + # describe the updated values, the API ignores the values of all + # fields not covered by the mask. + # + # If a repeated field is specified for an update operation, new values will + # be appended to the existing repeated field in the target resource. Note that + # a repeated field is only allowed in the last position of a `paths` string. + # + # If a sub-message is specified in the last position of the field mask for an + # update operation, then new value will be merged into the existing sub-message + # in the target resource. + # + # For example, given the target message: + # + # f { + # b { + # d: 1 + # x: 2 + # } + # c: [1] + # } + # + # And an update message: + # + # f { + # b { + # d: 10 + # } + # c: [2] + # } + # + # then if the field mask is: + # + # paths: ["f.b", "f.c"] + # + # then the result will be: + # + # f { + # b { + # d: 10 + # x: 2 + # } + # c: [1, 2] + # } + # + # An implementation may provide options to override this default behavior for + # repeated and message fields. + # + # In order to reset a field's value to the default, the field must + # be in the mask and set to the default value in the provided resource. + # Hence, in order to reset all fields of a resource, provide a default + # instance of the resource and set all fields in the mask, or do + # not provide a mask as described below. + # + # If a field mask is not present on update, the operation applies to + # all fields (as if a field mask of all fields has been specified). + # Note that in the presence of schema evolution, this may mean that + # fields the client does not know and has therefore not filled into + # the request will be reset to their default. If this is unwanted + # behavior, a specific service may require a client to always specify + # a field mask, producing an error if not. + # + # As with get operations, the location of the resource which + # describes the updated values in the request message depends on the + # operation kind. In any case, the effect of the field mask is + # required to be honored by the API. + # + # ## Considerations for HTTP REST + # + # The HTTP kind of an update operation which uses a field mask must + # be set to PATCH instead of PUT in order to satisfy HTTP semantics + # (PUT must only be used for full updates). + # + # # JSON Encoding of Field Masks + # + # In JSON, a field mask is encoded as a single string where paths are + # separated by a comma. Fields name in each path are converted + # to/from lower-camel naming conventions. + # + # As an example, consider the following message declarations: + # + # message Profile { + # User user = 1; + # Photo photo = 2; + # } + # message User { + # string display_name = 1; + # string address = 2; + # } + # + # In proto a field mask for `Profile` may look as such: + # + # mask { + # paths: "user.display_name" + # paths: "photo" + # } + # + # In JSON, the same mask is represented as below: + # + # { + # mask: "user.displayName,photo" + # } + # + # # Field Masks and Oneof Fields + # + # Field masks treat fields in oneofs just as regular fields. Consider the + # following message: + # + # message SampleMessage { + # oneof test_oneof { + # string name = 4; + # SubMessage sub_message = 9; + # } + # } + # + # The field mask can be: + # + # mask { + # paths: "name" + # } + # + # Or: + # + # mask { + # paths: "sub_message" + # } + # + # Note that oneof type names ("test_oneof" in this case) cannot be used in + # paths. + # + # ## Field Mask Verification + # + # The implementation of any API method which has a FieldMask type field in the + # request should verify the included field paths, and return an + # `INVALID_ARGUMENT` error if any path is unmappable. + # @!attribute [rw] paths + # @return [::Array<::String>] + # The set of field mask paths. + class FieldMask + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end +end diff --git a/owl-bot-staging/google-cloud-resource_manager-v3/proto_docs/google/protobuf/timestamp.rb b/owl-bot-staging/google-cloud-resource_manager-v3/proto_docs/google/protobuf/timestamp.rb new file mode 100644 index 000000000000..74352be9c58c --- /dev/null +++ b/owl-bot-staging/google-cloud-resource_manager-v3/proto_docs/google/protobuf/timestamp.rb @@ -0,0 +1,127 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + + +module Google + module Protobuf + # A Timestamp represents a point in time independent of any time zone or local + # calendar, encoded as a count of seconds and fractions of seconds at + # nanosecond resolution. The count is relative to an epoch at UTC midnight on + # January 1, 1970, in the proleptic Gregorian calendar which extends the + # Gregorian calendar backwards to year one. + # + # All minutes are 60 seconds long. Leap seconds are "smeared" so that no leap + # second table is needed for interpretation, using a [24-hour linear + # smear](https://developers.google.com/time/smear). + # + # The range is from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59.999999999Z. By + # restricting to that range, we ensure that we can convert to and from [RFC + # 3339](https://www.ietf.org/rfc/rfc3339.txt) date strings. + # + # # Examples + # + # Example 1: Compute Timestamp from POSIX `time()`. + # + # Timestamp timestamp; + # timestamp.set_seconds(time(NULL)); + # timestamp.set_nanos(0); + # + # Example 2: Compute Timestamp from POSIX `gettimeofday()`. + # + # struct timeval tv; + # gettimeofday(&tv, NULL); + # + # Timestamp timestamp; + # timestamp.set_seconds(tv.tv_sec); + # timestamp.set_nanos(tv.tv_usec * 1000); + # + # Example 3: Compute Timestamp from Win32 `GetSystemTimeAsFileTime()`. + # + # FILETIME ft; + # GetSystemTimeAsFileTime(&ft); + # UINT64 ticks = (((UINT64)ft.dwHighDateTime) << 32) | ft.dwLowDateTime; + # + # // A Windows tick is 100 nanoseconds. Windows epoch 1601-01-01T00:00:00Z + # // is 11644473600 seconds before Unix epoch 1970-01-01T00:00:00Z. + # Timestamp timestamp; + # timestamp.set_seconds((INT64) ((ticks / 10000000) - 11644473600LL)); + # timestamp.set_nanos((INT32) ((ticks % 10000000) * 100)); + # + # Example 4: Compute Timestamp from Java `System.currentTimeMillis()`. + # + # long millis = System.currentTimeMillis(); + # + # Timestamp timestamp = Timestamp.newBuilder().setSeconds(millis / 1000) + # .setNanos((int) ((millis % 1000) * 1000000)).build(); + # + # Example 5: Compute Timestamp from Java `Instant.now()`. + # + # Instant now = Instant.now(); + # + # Timestamp timestamp = + # Timestamp.newBuilder().setSeconds(now.getEpochSecond()) + # .setNanos(now.getNano()).build(); + # + # Example 6: Compute Timestamp from current time in Python. + # + # timestamp = Timestamp() + # timestamp.GetCurrentTime() + # + # # JSON Mapping + # + # In JSON format, the Timestamp type is encoded as a string in the + # [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format. That is, the + # format is "\\{year}-\\{month}-\\{day}T\\{hour}:\\{min}:\\{sec}[.\\{frac_sec}]Z" + # where \\{year} is always expressed using four digits while \\{month}, \\{day}, + # \\{hour}, \\{min}, and \\{sec} are zero-padded to two digits each. The fractional + # seconds, which can go up to 9 digits (i.e. up to 1 nanosecond resolution), + # are optional. The "Z" suffix indicates the timezone ("UTC"); the timezone + # is required. A proto3 JSON serializer should always use UTC (as indicated by + # "Z") when printing the Timestamp type and a proto3 JSON parser should be + # able to accept both UTC and other timezones (as indicated by an offset). + # + # For example, "2017-01-15T01:30:15.01Z" encodes 15.01 seconds past + # 01:30 UTC on January 15, 2017. + # + # In JavaScript, one can convert a Date object to this format using the + # standard + # [toISOString()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toISOString) + # method. In Python, a standard `datetime.datetime` object can be converted + # to this format using + # [`strftime`](https://docs.python.org/2/library/time.html#time.strftime) with + # the time format spec '%Y-%m-%dT%H:%M:%S.%fZ'. Likewise, in Java, one can use + # the Joda Time's [`ISODateTimeFormat.dateTime()`]( + # http://joda-time.sourceforge.net/apidocs/org/joda/time/format/ISODateTimeFormat.html#dateTime() + # ) to obtain a formatter capable of generating timestamps in this format. + # @!attribute [rw] seconds + # @return [::Integer] + # Represents seconds of UTC time since Unix epoch + # 1970-01-01T00:00:00Z. Must be from 0001-01-01T00:00:00Z to + # 9999-12-31T23:59:59Z inclusive. + # @!attribute [rw] nanos + # @return [::Integer] + # Non-negative fractions of a second at nanosecond resolution. Negative + # second values with fractions must still have non-negative nanos values + # that count forward in time. Must be from 0 to 999,999,999 + # inclusive. + class Timestamp + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end +end diff --git a/owl-bot-staging/google-cloud-resource_manager-v3/proto_docs/google/rpc/status.rb b/owl-bot-staging/google-cloud-resource_manager-v3/proto_docs/google/rpc/status.rb new file mode 100644 index 000000000000..c1a1c07eb2db --- /dev/null +++ b/owl-bot-staging/google-cloud-resource_manager-v3/proto_docs/google/rpc/status.rb @@ -0,0 +1,48 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + + +module Google + module Rpc + # The `Status` type defines a logical error model that is suitable for + # different programming environments, including REST APIs and RPC APIs. It is + # used by [gRPC](https://github.com/grpc). Each `Status` message contains + # three pieces of data: error code, error message, and error details. + # + # You can find out more about this error model and how to work with it in the + # [API Design Guide](https://cloud.google.com/apis/design/errors). + # @!attribute [rw] code + # @return [::Integer] + # The status code, which should be an enum value of + # [google.rpc.Code][google.rpc.Code]. + # @!attribute [rw] message + # @return [::String] + # A developer-facing error message, which should be in English. Any + # user-facing error message should be localized and sent in the + # {::Google::Rpc::Status#details google.rpc.Status.details} field, or localized + # by the client. + # @!attribute [rw] details + # @return [::Array<::Google::Protobuf::Any>] + # A list of messages that carry the error details. There is a common set of + # message types for APIs to use. + class Status + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end +end diff --git a/owl-bot-staging/google-cloud-resource_manager-v3/proto_docs/google/type/expr.rb b/owl-bot-staging/google-cloud-resource_manager-v3/proto_docs/google/type/expr.rb new file mode 100644 index 000000000000..53e7733b6592 --- /dev/null +++ b/owl-bot-staging/google-cloud-resource_manager-v3/proto_docs/google/type/expr.rb @@ -0,0 +1,75 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + + +module Google + module Type + # Represents a textual expression in the Common Expression Language (CEL) + # syntax. CEL is a C-like expression language. The syntax and semantics of CEL + # are documented at https://github.com/google/cel-spec. + # + # Example (Comparison): + # + # title: "Summary size limit" + # description: "Determines if a summary is less than 100 chars" + # expression: "document.summary.size() < 100" + # + # Example (Equality): + # + # title: "Requestor is owner" + # description: "Determines if requestor is the document owner" + # expression: "document.owner == request.auth.claims.email" + # + # Example (Logic): + # + # title: "Public documents" + # description: "Determine whether the document should be publicly visible" + # expression: "document.type != 'private' && document.type != 'internal'" + # + # Example (Data Manipulation): + # + # title: "Notification string" + # description: "Create a notification string with a timestamp." + # expression: "'New message received at ' + string(document.create_time)" + # + # The exact variables and functions that may be referenced within an expression + # are determined by the service that evaluates it. See the service + # documentation for additional information. + # @!attribute [rw] expression + # @return [::String] + # Textual representation of an expression in Common Expression Language + # syntax. + # @!attribute [rw] title + # @return [::String] + # Optional. Title for the expression, i.e. a short string describing + # its purpose. This can be used e.g. in UIs which allow to enter the + # expression. + # @!attribute [rw] description + # @return [::String] + # Optional. Description of the expression. This is a longer text which + # describes the expression, e.g. when hovered over it in a UI. + # @!attribute [rw] location + # @return [::String] + # Optional. String indicating the location of the expression for error + # reporting, e.g. a file name and a position in the file. + class Expr + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end +end diff --git a/owl-bot-staging/google-cloud-resource_manager-v3/snippets/Gemfile b/owl-bot-staging/google-cloud-resource_manager-v3/snippets/Gemfile new file mode 100644 index 000000000000..128b7f729ebc --- /dev/null +++ b/owl-bot-staging/google-cloud-resource_manager-v3/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-resource_manager-v3", path: "../" +else + gem "google-cloud-resource_manager-v3" +end + +group :test do + gem "google-style", "~> 1.26.1" + gem "minitest", "~> 5.16" + gem "minitest-focus", "~> 1.1" + gem "minitest-hooks", "~> 1.5" +end diff --git a/owl-bot-staging/google-cloud-resource_manager-v3/snippets/folders/create_folder.rb b/owl-bot-staging/google-cloud-resource_manager-v3/snippets/folders/create_folder.rb new file mode 100644 index 000000000000..d3012301474e --- /dev/null +++ b/owl-bot-staging/google-cloud-resource_manager-v3/snippets/folders/create_folder.rb @@ -0,0 +1,54 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +# [START cloudresourcemanager_v3_generated_Folders_CreateFolder_sync] +require "google/cloud/resource_manager/v3" + +## +# Snippet for the create_folder call in the Folders service +# +# This snippet has been automatically generated and should be regarded as a code +# template only. It will require modifications to work: +# - It may require correct/in-range values for request initialization. +# - It may require specifying regional endpoints when creating the service +# client as shown in https://cloud.google.com/ruby/docs/reference. +# +# This is an auto-generated example demonstrating basic usage of +# Google::Cloud::ResourceManager::V3::Folders::Client#create_folder. +# +def create_folder + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::ResourceManager::V3::Folders::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::ResourceManager::V3::CreateFolderRequest.new + + # Call the create_folder method. + result = client.create_folder request + + # The returned object is of type Gapic::Operation. You can use it to + # check the status of an operation, cancel it, or wait for results. + # Here is how to wait for a response. + result.wait_until_done! timeout: 60 + if result.response? + p result.response + else + puts "No response received." + end +end +# [END cloudresourcemanager_v3_generated_Folders_CreateFolder_sync] diff --git a/owl-bot-staging/google-cloud-resource_manager-v3/snippets/folders/delete_folder.rb b/owl-bot-staging/google-cloud-resource_manager-v3/snippets/folders/delete_folder.rb new file mode 100644 index 000000000000..3a25238e52b5 --- /dev/null +++ b/owl-bot-staging/google-cloud-resource_manager-v3/snippets/folders/delete_folder.rb @@ -0,0 +1,54 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +# [START cloudresourcemanager_v3_generated_Folders_DeleteFolder_sync] +require "google/cloud/resource_manager/v3" + +## +# Snippet for the delete_folder call in the Folders service +# +# This snippet has been automatically generated and should be regarded as a code +# template only. It will require modifications to work: +# - It may require correct/in-range values for request initialization. +# - It may require specifying regional endpoints when creating the service +# client as shown in https://cloud.google.com/ruby/docs/reference. +# +# This is an auto-generated example demonstrating basic usage of +# Google::Cloud::ResourceManager::V3::Folders::Client#delete_folder. +# +def delete_folder + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::ResourceManager::V3::Folders::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::ResourceManager::V3::DeleteFolderRequest.new + + # Call the delete_folder method. + result = client.delete_folder request + + # The returned object is of type Gapic::Operation. You can use it to + # check the status of an operation, cancel it, or wait for results. + # Here is how to wait for a response. + result.wait_until_done! timeout: 60 + if result.response? + p result.response + else + puts "No response received." + end +end +# [END cloudresourcemanager_v3_generated_Folders_DeleteFolder_sync] diff --git a/owl-bot-staging/google-cloud-resource_manager-v3/snippets/folders/get_folder.rb b/owl-bot-staging/google-cloud-resource_manager-v3/snippets/folders/get_folder.rb new file mode 100644 index 000000000000..910c79072b8a --- /dev/null +++ b/owl-bot-staging/google-cloud-resource_manager-v3/snippets/folders/get_folder.rb @@ -0,0 +1,47 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +# [START cloudresourcemanager_v3_generated_Folders_GetFolder_sync] +require "google/cloud/resource_manager/v3" + +## +# Snippet for the get_folder call in the Folders service +# +# This snippet has been automatically generated and should be regarded as a code +# template only. It will require modifications to work: +# - It may require correct/in-range values for request initialization. +# - It may require specifying regional endpoints when creating the service +# client as shown in https://cloud.google.com/ruby/docs/reference. +# +# This is an auto-generated example demonstrating basic usage of +# Google::Cloud::ResourceManager::V3::Folders::Client#get_folder. +# +def get_folder + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::ResourceManager::V3::Folders::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::ResourceManager::V3::GetFolderRequest.new + + # Call the get_folder method. + result = client.get_folder request + + # The returned object is of type Google::Cloud::ResourceManager::V3::Folder. + p result +end +# [END cloudresourcemanager_v3_generated_Folders_GetFolder_sync] diff --git a/owl-bot-staging/google-cloud-resource_manager-v3/snippets/folders/get_iam_policy.rb b/owl-bot-staging/google-cloud-resource_manager-v3/snippets/folders/get_iam_policy.rb new file mode 100644 index 000000000000..5792a996c39c --- /dev/null +++ b/owl-bot-staging/google-cloud-resource_manager-v3/snippets/folders/get_iam_policy.rb @@ -0,0 +1,47 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +# [START cloudresourcemanager_v3_generated_Folders_GetIamPolicy_sync] +require "google/cloud/resource_manager/v3" + +## +# Snippet for the get_iam_policy call in the Folders service +# +# This snippet has been automatically generated and should be regarded as a code +# template only. It will require modifications to work: +# - It may require correct/in-range values for request initialization. +# - It may require specifying regional endpoints when creating the service +# client as shown in https://cloud.google.com/ruby/docs/reference. +# +# This is an auto-generated example demonstrating basic usage of +# Google::Cloud::ResourceManager::V3::Folders::Client#get_iam_policy. +# +def get_iam_policy + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::ResourceManager::V3::Folders::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Iam::V1::GetIamPolicyRequest.new + + # Call the get_iam_policy method. + result = client.get_iam_policy request + + # The returned object is of type Google::Iam::V1::Policy. + p result +end +# [END cloudresourcemanager_v3_generated_Folders_GetIamPolicy_sync] diff --git a/owl-bot-staging/google-cloud-resource_manager-v3/snippets/folders/list_folders.rb b/owl-bot-staging/google-cloud-resource_manager-v3/snippets/folders/list_folders.rb new file mode 100644 index 000000000000..278c2e261ea1 --- /dev/null +++ b/owl-bot-staging/google-cloud-resource_manager-v3/snippets/folders/list_folders.rb @@ -0,0 +1,51 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +# [START cloudresourcemanager_v3_generated_Folders_ListFolders_sync] +require "google/cloud/resource_manager/v3" + +## +# Snippet for the list_folders call in the Folders service +# +# This snippet has been automatically generated and should be regarded as a code +# template only. It will require modifications to work: +# - It may require correct/in-range values for request initialization. +# - It may require specifying regional endpoints when creating the service +# client as shown in https://cloud.google.com/ruby/docs/reference. +# +# This is an auto-generated example demonstrating basic usage of +# Google::Cloud::ResourceManager::V3::Folders::Client#list_folders. +# +def list_folders + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::ResourceManager::V3::Folders::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::ResourceManager::V3::ListFoldersRequest.new + + # Call the list_folders method. + result = client.list_folders request + + # The returned object is of type Gapic::PagedEnumerable. You can iterate + # over elements, and API calls will be issued to fetch pages as needed. + result.each do |item| + # Each element is of type ::Google::Cloud::ResourceManager::V3::Folder. + p item + end +end +# [END cloudresourcemanager_v3_generated_Folders_ListFolders_sync] diff --git a/owl-bot-staging/google-cloud-resource_manager-v3/snippets/folders/move_folder.rb b/owl-bot-staging/google-cloud-resource_manager-v3/snippets/folders/move_folder.rb new file mode 100644 index 000000000000..fa3c39da9167 --- /dev/null +++ b/owl-bot-staging/google-cloud-resource_manager-v3/snippets/folders/move_folder.rb @@ -0,0 +1,54 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +# [START cloudresourcemanager_v3_generated_Folders_MoveFolder_sync] +require "google/cloud/resource_manager/v3" + +## +# Snippet for the move_folder call in the Folders service +# +# This snippet has been automatically generated and should be regarded as a code +# template only. It will require modifications to work: +# - It may require correct/in-range values for request initialization. +# - It may require specifying regional endpoints when creating the service +# client as shown in https://cloud.google.com/ruby/docs/reference. +# +# This is an auto-generated example demonstrating basic usage of +# Google::Cloud::ResourceManager::V3::Folders::Client#move_folder. +# +def move_folder + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::ResourceManager::V3::Folders::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::ResourceManager::V3::MoveFolderRequest.new + + # Call the move_folder method. + result = client.move_folder request + + # The returned object is of type Gapic::Operation. You can use it to + # check the status of an operation, cancel it, or wait for results. + # Here is how to wait for a response. + result.wait_until_done! timeout: 60 + if result.response? + p result.response + else + puts "No response received." + end +end +# [END cloudresourcemanager_v3_generated_Folders_MoveFolder_sync] diff --git a/owl-bot-staging/google-cloud-resource_manager-v3/snippets/folders/search_folders.rb b/owl-bot-staging/google-cloud-resource_manager-v3/snippets/folders/search_folders.rb new file mode 100644 index 000000000000..6647cbb197f5 --- /dev/null +++ b/owl-bot-staging/google-cloud-resource_manager-v3/snippets/folders/search_folders.rb @@ -0,0 +1,51 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +# [START cloudresourcemanager_v3_generated_Folders_SearchFolders_sync] +require "google/cloud/resource_manager/v3" + +## +# Snippet for the search_folders call in the Folders service +# +# This snippet has been automatically generated and should be regarded as a code +# template only. It will require modifications to work: +# - It may require correct/in-range values for request initialization. +# - It may require specifying regional endpoints when creating the service +# client as shown in https://cloud.google.com/ruby/docs/reference. +# +# This is an auto-generated example demonstrating basic usage of +# Google::Cloud::ResourceManager::V3::Folders::Client#search_folders. +# +def search_folders + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::ResourceManager::V3::Folders::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::ResourceManager::V3::SearchFoldersRequest.new + + # Call the search_folders method. + result = client.search_folders request + + # The returned object is of type Gapic::PagedEnumerable. You can iterate + # over elements, and API calls will be issued to fetch pages as needed. + result.each do |item| + # Each element is of type ::Google::Cloud::ResourceManager::V3::Folder. + p item + end +end +# [END cloudresourcemanager_v3_generated_Folders_SearchFolders_sync] diff --git a/owl-bot-staging/google-cloud-resource_manager-v3/snippets/folders/set_iam_policy.rb b/owl-bot-staging/google-cloud-resource_manager-v3/snippets/folders/set_iam_policy.rb new file mode 100644 index 000000000000..4a0b84555e3e --- /dev/null +++ b/owl-bot-staging/google-cloud-resource_manager-v3/snippets/folders/set_iam_policy.rb @@ -0,0 +1,47 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +# [START cloudresourcemanager_v3_generated_Folders_SetIamPolicy_sync] +require "google/cloud/resource_manager/v3" + +## +# Snippet for the set_iam_policy call in the Folders service +# +# This snippet has been automatically generated and should be regarded as a code +# template only. It will require modifications to work: +# - It may require correct/in-range values for request initialization. +# - It may require specifying regional endpoints when creating the service +# client as shown in https://cloud.google.com/ruby/docs/reference. +# +# This is an auto-generated example demonstrating basic usage of +# Google::Cloud::ResourceManager::V3::Folders::Client#set_iam_policy. +# +def set_iam_policy + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::ResourceManager::V3::Folders::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Iam::V1::SetIamPolicyRequest.new + + # Call the set_iam_policy method. + result = client.set_iam_policy request + + # The returned object is of type Google::Iam::V1::Policy. + p result +end +# [END cloudresourcemanager_v3_generated_Folders_SetIamPolicy_sync] diff --git a/owl-bot-staging/google-cloud-resource_manager-v3/snippets/folders/test_iam_permissions.rb b/owl-bot-staging/google-cloud-resource_manager-v3/snippets/folders/test_iam_permissions.rb new file mode 100644 index 000000000000..abd81f513e9b --- /dev/null +++ b/owl-bot-staging/google-cloud-resource_manager-v3/snippets/folders/test_iam_permissions.rb @@ -0,0 +1,47 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +# [START cloudresourcemanager_v3_generated_Folders_TestIamPermissions_sync] +require "google/cloud/resource_manager/v3" + +## +# Snippet for the test_iam_permissions call in the Folders service +# +# This snippet has been automatically generated and should be regarded as a code +# template only. It will require modifications to work: +# - It may require correct/in-range values for request initialization. +# - It may require specifying regional endpoints when creating the service +# client as shown in https://cloud.google.com/ruby/docs/reference. +# +# This is an auto-generated example demonstrating basic usage of +# Google::Cloud::ResourceManager::V3::Folders::Client#test_iam_permissions. +# +def test_iam_permissions + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::ResourceManager::V3::Folders::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Iam::V1::TestIamPermissionsRequest.new + + # Call the test_iam_permissions method. + result = client.test_iam_permissions request + + # The returned object is of type Google::Iam::V1::TestIamPermissionsResponse. + p result +end +# [END cloudresourcemanager_v3_generated_Folders_TestIamPermissions_sync] diff --git a/owl-bot-staging/google-cloud-resource_manager-v3/snippets/folders/undelete_folder.rb b/owl-bot-staging/google-cloud-resource_manager-v3/snippets/folders/undelete_folder.rb new file mode 100644 index 000000000000..0bdd869f25f6 --- /dev/null +++ b/owl-bot-staging/google-cloud-resource_manager-v3/snippets/folders/undelete_folder.rb @@ -0,0 +1,54 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +# [START cloudresourcemanager_v3_generated_Folders_UndeleteFolder_sync] +require "google/cloud/resource_manager/v3" + +## +# Snippet for the undelete_folder call in the Folders service +# +# This snippet has been automatically generated and should be regarded as a code +# template only. It will require modifications to work: +# - It may require correct/in-range values for request initialization. +# - It may require specifying regional endpoints when creating the service +# client as shown in https://cloud.google.com/ruby/docs/reference. +# +# This is an auto-generated example demonstrating basic usage of +# Google::Cloud::ResourceManager::V3::Folders::Client#undelete_folder. +# +def undelete_folder + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::ResourceManager::V3::Folders::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::ResourceManager::V3::UndeleteFolderRequest.new + + # Call the undelete_folder method. + result = client.undelete_folder request + + # The returned object is of type Gapic::Operation. You can use it to + # check the status of an operation, cancel it, or wait for results. + # Here is how to wait for a response. + result.wait_until_done! timeout: 60 + if result.response? + p result.response + else + puts "No response received." + end +end +# [END cloudresourcemanager_v3_generated_Folders_UndeleteFolder_sync] diff --git a/owl-bot-staging/google-cloud-resource_manager-v3/snippets/folders/update_folder.rb b/owl-bot-staging/google-cloud-resource_manager-v3/snippets/folders/update_folder.rb new file mode 100644 index 000000000000..ff425f85216e --- /dev/null +++ b/owl-bot-staging/google-cloud-resource_manager-v3/snippets/folders/update_folder.rb @@ -0,0 +1,54 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +# [START cloudresourcemanager_v3_generated_Folders_UpdateFolder_sync] +require "google/cloud/resource_manager/v3" + +## +# Snippet for the update_folder call in the Folders service +# +# This snippet has been automatically generated and should be regarded as a code +# template only. It will require modifications to work: +# - It may require correct/in-range values for request initialization. +# - It may require specifying regional endpoints when creating the service +# client as shown in https://cloud.google.com/ruby/docs/reference. +# +# This is an auto-generated example demonstrating basic usage of +# Google::Cloud::ResourceManager::V3::Folders::Client#update_folder. +# +def update_folder + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::ResourceManager::V3::Folders::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::ResourceManager::V3::UpdateFolderRequest.new + + # Call the update_folder method. + result = client.update_folder request + + # The returned object is of type Gapic::Operation. You can use it to + # check the status of an operation, cancel it, or wait for results. + # Here is how to wait for a response. + result.wait_until_done! timeout: 60 + if result.response? + p result.response + else + puts "No response received." + end +end +# [END cloudresourcemanager_v3_generated_Folders_UpdateFolder_sync] diff --git a/owl-bot-staging/google-cloud-resource_manager-v3/snippets/organizations/get_iam_policy.rb b/owl-bot-staging/google-cloud-resource_manager-v3/snippets/organizations/get_iam_policy.rb new file mode 100644 index 000000000000..6cae03a852ab --- /dev/null +++ b/owl-bot-staging/google-cloud-resource_manager-v3/snippets/organizations/get_iam_policy.rb @@ -0,0 +1,47 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +# [START cloudresourcemanager_v3_generated_Organizations_GetIamPolicy_sync] +require "google/cloud/resource_manager/v3" + +## +# Snippet for the get_iam_policy call in the Organizations service +# +# This snippet has been automatically generated and should be regarded as a code +# template only. It will require modifications to work: +# - It may require correct/in-range values for request initialization. +# - It may require specifying regional endpoints when creating the service +# client as shown in https://cloud.google.com/ruby/docs/reference. +# +# This is an auto-generated example demonstrating basic usage of +# Google::Cloud::ResourceManager::V3::Organizations::Client#get_iam_policy. +# +def get_iam_policy + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::ResourceManager::V3::Organizations::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Iam::V1::GetIamPolicyRequest.new + + # Call the get_iam_policy method. + result = client.get_iam_policy request + + # The returned object is of type Google::Iam::V1::Policy. + p result +end +# [END cloudresourcemanager_v3_generated_Organizations_GetIamPolicy_sync] diff --git a/owl-bot-staging/google-cloud-resource_manager-v3/snippets/organizations/get_organization.rb b/owl-bot-staging/google-cloud-resource_manager-v3/snippets/organizations/get_organization.rb new file mode 100644 index 000000000000..b23884e4e193 --- /dev/null +++ b/owl-bot-staging/google-cloud-resource_manager-v3/snippets/organizations/get_organization.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 cloudresourcemanager_v3_generated_Organizations_GetOrganization_sync] +require "google/cloud/resource_manager/v3" + +## +# Snippet for the get_organization call in the Organizations service +# +# This snippet has been automatically generated and should be regarded as a code +# template only. It will require modifications to work: +# - It may require correct/in-range values for request initialization. +# - It may require specifying regional endpoints when creating the service +# client as shown in https://cloud.google.com/ruby/docs/reference. +# +# This is an auto-generated example demonstrating basic usage of +# Google::Cloud::ResourceManager::V3::Organizations::Client#get_organization. +# +def get_organization + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::ResourceManager::V3::Organizations::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::ResourceManager::V3::GetOrganizationRequest.new + + # Call the get_organization method. + result = client.get_organization request + + # The returned object is of type Google::Cloud::ResourceManager::V3::Organization. + p result +end +# [END cloudresourcemanager_v3_generated_Organizations_GetOrganization_sync] diff --git a/owl-bot-staging/google-cloud-resource_manager-v3/snippets/organizations/search_organizations.rb b/owl-bot-staging/google-cloud-resource_manager-v3/snippets/organizations/search_organizations.rb new file mode 100644 index 000000000000..51f2ab2ef75a --- /dev/null +++ b/owl-bot-staging/google-cloud-resource_manager-v3/snippets/organizations/search_organizations.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 cloudresourcemanager_v3_generated_Organizations_SearchOrganizations_sync] +require "google/cloud/resource_manager/v3" + +## +# Snippet for the search_organizations call in the Organizations service +# +# This snippet has been automatically generated and should be regarded as a code +# template only. It will require modifications to work: +# - It may require correct/in-range values for request initialization. +# - It may require specifying regional endpoints when creating the service +# client as shown in https://cloud.google.com/ruby/docs/reference. +# +# This is an auto-generated example demonstrating basic usage of +# Google::Cloud::ResourceManager::V3::Organizations::Client#search_organizations. +# +def search_organizations + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::ResourceManager::V3::Organizations::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::ResourceManager::V3::SearchOrganizationsRequest.new + + # Call the search_organizations method. + result = client.search_organizations request + + # The returned object is of type Gapic::PagedEnumerable. You can iterate + # over elements, and API calls will be issued to fetch pages as needed. + result.each do |item| + # Each element is of type ::Google::Cloud::ResourceManager::V3::Organization. + p item + end +end +# [END cloudresourcemanager_v3_generated_Organizations_SearchOrganizations_sync] diff --git a/owl-bot-staging/google-cloud-resource_manager-v3/snippets/organizations/set_iam_policy.rb b/owl-bot-staging/google-cloud-resource_manager-v3/snippets/organizations/set_iam_policy.rb new file mode 100644 index 000000000000..5b3897026ec1 --- /dev/null +++ b/owl-bot-staging/google-cloud-resource_manager-v3/snippets/organizations/set_iam_policy.rb @@ -0,0 +1,47 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +# [START cloudresourcemanager_v3_generated_Organizations_SetIamPolicy_sync] +require "google/cloud/resource_manager/v3" + +## +# Snippet for the set_iam_policy call in the Organizations service +# +# This snippet has been automatically generated and should be regarded as a code +# template only. It will require modifications to work: +# - It may require correct/in-range values for request initialization. +# - It may require specifying regional endpoints when creating the service +# client as shown in https://cloud.google.com/ruby/docs/reference. +# +# This is an auto-generated example demonstrating basic usage of +# Google::Cloud::ResourceManager::V3::Organizations::Client#set_iam_policy. +# +def set_iam_policy + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::ResourceManager::V3::Organizations::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Iam::V1::SetIamPolicyRequest.new + + # Call the set_iam_policy method. + result = client.set_iam_policy request + + # The returned object is of type Google::Iam::V1::Policy. + p result +end +# [END cloudresourcemanager_v3_generated_Organizations_SetIamPolicy_sync] diff --git a/owl-bot-staging/google-cloud-resource_manager-v3/snippets/organizations/test_iam_permissions.rb b/owl-bot-staging/google-cloud-resource_manager-v3/snippets/organizations/test_iam_permissions.rb new file mode 100644 index 000000000000..b62815b436b7 --- /dev/null +++ b/owl-bot-staging/google-cloud-resource_manager-v3/snippets/organizations/test_iam_permissions.rb @@ -0,0 +1,47 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +# [START cloudresourcemanager_v3_generated_Organizations_TestIamPermissions_sync] +require "google/cloud/resource_manager/v3" + +## +# Snippet for the test_iam_permissions call in the Organizations service +# +# This snippet has been automatically generated and should be regarded as a code +# template only. It will require modifications to work: +# - It may require correct/in-range values for request initialization. +# - It may require specifying regional endpoints when creating the service +# client as shown in https://cloud.google.com/ruby/docs/reference. +# +# This is an auto-generated example demonstrating basic usage of +# Google::Cloud::ResourceManager::V3::Organizations::Client#test_iam_permissions. +# +def test_iam_permissions + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::ResourceManager::V3::Organizations::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Iam::V1::TestIamPermissionsRequest.new + + # Call the test_iam_permissions method. + result = client.test_iam_permissions request + + # The returned object is of type Google::Iam::V1::TestIamPermissionsResponse. + p result +end +# [END cloudresourcemanager_v3_generated_Organizations_TestIamPermissions_sync] diff --git a/owl-bot-staging/google-cloud-resource_manager-v3/snippets/projects/create_project.rb b/owl-bot-staging/google-cloud-resource_manager-v3/snippets/projects/create_project.rb new file mode 100644 index 000000000000..6dccb1421506 --- /dev/null +++ b/owl-bot-staging/google-cloud-resource_manager-v3/snippets/projects/create_project.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 cloudresourcemanager_v3_generated_Projects_CreateProject_sync] +require "google/cloud/resource_manager/v3" + +## +# Snippet for the create_project call in the Projects service +# +# This snippet has been automatically generated and should be regarded as a code +# template only. It will require modifications to work: +# - It may require correct/in-range values for request initialization. +# - It may require specifying regional endpoints when creating the service +# client as shown in https://cloud.google.com/ruby/docs/reference. +# +# This is an auto-generated example demonstrating basic usage of +# Google::Cloud::ResourceManager::V3::Projects::Client#create_project. +# +def create_project + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::ResourceManager::V3::Projects::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::ResourceManager::V3::CreateProjectRequest.new + + # Call the create_project method. + result = client.create_project 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 cloudresourcemanager_v3_generated_Projects_CreateProject_sync] diff --git a/owl-bot-staging/google-cloud-resource_manager-v3/snippets/projects/delete_project.rb b/owl-bot-staging/google-cloud-resource_manager-v3/snippets/projects/delete_project.rb new file mode 100644 index 000000000000..a95cfa04c506 --- /dev/null +++ b/owl-bot-staging/google-cloud-resource_manager-v3/snippets/projects/delete_project.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 cloudresourcemanager_v3_generated_Projects_DeleteProject_sync] +require "google/cloud/resource_manager/v3" + +## +# Snippet for the delete_project call in the Projects service +# +# This snippet has been automatically generated and should be regarded as a code +# template only. It will require modifications to work: +# - It may require correct/in-range values for request initialization. +# - It may require specifying regional endpoints when creating the service +# client as shown in https://cloud.google.com/ruby/docs/reference. +# +# This is an auto-generated example demonstrating basic usage of +# Google::Cloud::ResourceManager::V3::Projects::Client#delete_project. +# +def delete_project + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::ResourceManager::V3::Projects::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::ResourceManager::V3::DeleteProjectRequest.new + + # Call the delete_project method. + result = client.delete_project 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 cloudresourcemanager_v3_generated_Projects_DeleteProject_sync] diff --git a/owl-bot-staging/google-cloud-resource_manager-v3/snippets/projects/get_iam_policy.rb b/owl-bot-staging/google-cloud-resource_manager-v3/snippets/projects/get_iam_policy.rb new file mode 100644 index 000000000000..d2228583022c --- /dev/null +++ b/owl-bot-staging/google-cloud-resource_manager-v3/snippets/projects/get_iam_policy.rb @@ -0,0 +1,47 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +# [START cloudresourcemanager_v3_generated_Projects_GetIamPolicy_sync] +require "google/cloud/resource_manager/v3" + +## +# Snippet for the get_iam_policy call in the Projects service +# +# This snippet has been automatically generated and should be regarded as a code +# template only. It will require modifications to work: +# - It may require correct/in-range values for request initialization. +# - It may require specifying regional endpoints when creating the service +# client as shown in https://cloud.google.com/ruby/docs/reference. +# +# This is an auto-generated example demonstrating basic usage of +# Google::Cloud::ResourceManager::V3::Projects::Client#get_iam_policy. +# +def get_iam_policy + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::ResourceManager::V3::Projects::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Iam::V1::GetIamPolicyRequest.new + + # Call the get_iam_policy method. + result = client.get_iam_policy request + + # The returned object is of type Google::Iam::V1::Policy. + p result +end +# [END cloudresourcemanager_v3_generated_Projects_GetIamPolicy_sync] diff --git a/owl-bot-staging/google-cloud-resource_manager-v3/snippets/projects/get_project.rb b/owl-bot-staging/google-cloud-resource_manager-v3/snippets/projects/get_project.rb new file mode 100644 index 000000000000..59925415335d --- /dev/null +++ b/owl-bot-staging/google-cloud-resource_manager-v3/snippets/projects/get_project.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 cloudresourcemanager_v3_generated_Projects_GetProject_sync] +require "google/cloud/resource_manager/v3" + +## +# Snippet for the get_project call in the Projects service +# +# This snippet has been automatically generated and should be regarded as a code +# template only. It will require modifications to work: +# - It may require correct/in-range values for request initialization. +# - It may require specifying regional endpoints when creating the service +# client as shown in https://cloud.google.com/ruby/docs/reference. +# +# This is an auto-generated example demonstrating basic usage of +# Google::Cloud::ResourceManager::V3::Projects::Client#get_project. +# +def get_project + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::ResourceManager::V3::Projects::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::ResourceManager::V3::GetProjectRequest.new + + # Call the get_project method. + result = client.get_project request + + # The returned object is of type Google::Cloud::ResourceManager::V3::Project. + p result +end +# [END cloudresourcemanager_v3_generated_Projects_GetProject_sync] diff --git a/owl-bot-staging/google-cloud-resource_manager-v3/snippets/projects/list_projects.rb b/owl-bot-staging/google-cloud-resource_manager-v3/snippets/projects/list_projects.rb new file mode 100644 index 000000000000..af7344c950c5 --- /dev/null +++ b/owl-bot-staging/google-cloud-resource_manager-v3/snippets/projects/list_projects.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 cloudresourcemanager_v3_generated_Projects_ListProjects_sync] +require "google/cloud/resource_manager/v3" + +## +# Snippet for the list_projects call in the Projects service +# +# This snippet has been automatically generated and should be regarded as a code +# template only. It will require modifications to work: +# - It may require correct/in-range values for request initialization. +# - It may require specifying regional endpoints when creating the service +# client as shown in https://cloud.google.com/ruby/docs/reference. +# +# This is an auto-generated example demonstrating basic usage of +# Google::Cloud::ResourceManager::V3::Projects::Client#list_projects. +# +def list_projects + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::ResourceManager::V3::Projects::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::ResourceManager::V3::ListProjectsRequest.new + + # Call the list_projects method. + result = client.list_projects request + + # The returned object is of type Gapic::PagedEnumerable. You can iterate + # over elements, and API calls will be issued to fetch pages as needed. + result.each do |item| + # Each element is of type ::Google::Cloud::ResourceManager::V3::Project. + p item + end +end +# [END cloudresourcemanager_v3_generated_Projects_ListProjects_sync] diff --git a/owl-bot-staging/google-cloud-resource_manager-v3/snippets/projects/move_project.rb b/owl-bot-staging/google-cloud-resource_manager-v3/snippets/projects/move_project.rb new file mode 100644 index 000000000000..1586935905c7 --- /dev/null +++ b/owl-bot-staging/google-cloud-resource_manager-v3/snippets/projects/move_project.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 cloudresourcemanager_v3_generated_Projects_MoveProject_sync] +require "google/cloud/resource_manager/v3" + +## +# Snippet for the move_project call in the Projects service +# +# This snippet has been automatically generated and should be regarded as a code +# template only. It will require modifications to work: +# - It may require correct/in-range values for request initialization. +# - It may require specifying regional endpoints when creating the service +# client as shown in https://cloud.google.com/ruby/docs/reference. +# +# This is an auto-generated example demonstrating basic usage of +# Google::Cloud::ResourceManager::V3::Projects::Client#move_project. +# +def move_project + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::ResourceManager::V3::Projects::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::ResourceManager::V3::MoveProjectRequest.new + + # Call the move_project method. + result = client.move_project 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 cloudresourcemanager_v3_generated_Projects_MoveProject_sync] diff --git a/owl-bot-staging/google-cloud-resource_manager-v3/snippets/projects/search_projects.rb b/owl-bot-staging/google-cloud-resource_manager-v3/snippets/projects/search_projects.rb new file mode 100644 index 000000000000..f44af41c3e38 --- /dev/null +++ b/owl-bot-staging/google-cloud-resource_manager-v3/snippets/projects/search_projects.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 cloudresourcemanager_v3_generated_Projects_SearchProjects_sync] +require "google/cloud/resource_manager/v3" + +## +# Snippet for the search_projects call in the Projects service +# +# This snippet has been automatically generated and should be regarded as a code +# template only. It will require modifications to work: +# - It may require correct/in-range values for request initialization. +# - It may require specifying regional endpoints when creating the service +# client as shown in https://cloud.google.com/ruby/docs/reference. +# +# This is an auto-generated example demonstrating basic usage of +# Google::Cloud::ResourceManager::V3::Projects::Client#search_projects. +# +def search_projects + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::ResourceManager::V3::Projects::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::ResourceManager::V3::SearchProjectsRequest.new + + # Call the search_projects method. + result = client.search_projects request + + # The returned object is of type Gapic::PagedEnumerable. You can iterate + # over elements, and API calls will be issued to fetch pages as needed. + result.each do |item| + # Each element is of type ::Google::Cloud::ResourceManager::V3::Project. + p item + end +end +# [END cloudresourcemanager_v3_generated_Projects_SearchProjects_sync] diff --git a/owl-bot-staging/google-cloud-resource_manager-v3/snippets/projects/set_iam_policy.rb b/owl-bot-staging/google-cloud-resource_manager-v3/snippets/projects/set_iam_policy.rb new file mode 100644 index 000000000000..ee005a807434 --- /dev/null +++ b/owl-bot-staging/google-cloud-resource_manager-v3/snippets/projects/set_iam_policy.rb @@ -0,0 +1,47 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +# [START cloudresourcemanager_v3_generated_Projects_SetIamPolicy_sync] +require "google/cloud/resource_manager/v3" + +## +# Snippet for the set_iam_policy call in the Projects service +# +# This snippet has been automatically generated and should be regarded as a code +# template only. It will require modifications to work: +# - It may require correct/in-range values for request initialization. +# - It may require specifying regional endpoints when creating the service +# client as shown in https://cloud.google.com/ruby/docs/reference. +# +# This is an auto-generated example demonstrating basic usage of +# Google::Cloud::ResourceManager::V3::Projects::Client#set_iam_policy. +# +def set_iam_policy + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::ResourceManager::V3::Projects::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Iam::V1::SetIamPolicyRequest.new + + # Call the set_iam_policy method. + result = client.set_iam_policy request + + # The returned object is of type Google::Iam::V1::Policy. + p result +end +# [END cloudresourcemanager_v3_generated_Projects_SetIamPolicy_sync] diff --git a/owl-bot-staging/google-cloud-resource_manager-v3/snippets/projects/test_iam_permissions.rb b/owl-bot-staging/google-cloud-resource_manager-v3/snippets/projects/test_iam_permissions.rb new file mode 100644 index 000000000000..b0ec47a40445 --- /dev/null +++ b/owl-bot-staging/google-cloud-resource_manager-v3/snippets/projects/test_iam_permissions.rb @@ -0,0 +1,47 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +# [START cloudresourcemanager_v3_generated_Projects_TestIamPermissions_sync] +require "google/cloud/resource_manager/v3" + +## +# Snippet for the test_iam_permissions call in the Projects service +# +# This snippet has been automatically generated and should be regarded as a code +# template only. It will require modifications to work: +# - It may require correct/in-range values for request initialization. +# - It may require specifying regional endpoints when creating the service +# client as shown in https://cloud.google.com/ruby/docs/reference. +# +# This is an auto-generated example demonstrating basic usage of +# Google::Cloud::ResourceManager::V3::Projects::Client#test_iam_permissions. +# +def test_iam_permissions + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::ResourceManager::V3::Projects::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Iam::V1::TestIamPermissionsRequest.new + + # Call the test_iam_permissions method. + result = client.test_iam_permissions request + + # The returned object is of type Google::Iam::V1::TestIamPermissionsResponse. + p result +end +# [END cloudresourcemanager_v3_generated_Projects_TestIamPermissions_sync] diff --git a/owl-bot-staging/google-cloud-resource_manager-v3/snippets/projects/undelete_project.rb b/owl-bot-staging/google-cloud-resource_manager-v3/snippets/projects/undelete_project.rb new file mode 100644 index 000000000000..4ecdc3c8cb2e --- /dev/null +++ b/owl-bot-staging/google-cloud-resource_manager-v3/snippets/projects/undelete_project.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 cloudresourcemanager_v3_generated_Projects_UndeleteProject_sync] +require "google/cloud/resource_manager/v3" + +## +# Snippet for the undelete_project call in the Projects service +# +# This snippet has been automatically generated and should be regarded as a code +# template only. It will require modifications to work: +# - It may require correct/in-range values for request initialization. +# - It may require specifying regional endpoints when creating the service +# client as shown in https://cloud.google.com/ruby/docs/reference. +# +# This is an auto-generated example demonstrating basic usage of +# Google::Cloud::ResourceManager::V3::Projects::Client#undelete_project. +# +def undelete_project + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::ResourceManager::V3::Projects::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::ResourceManager::V3::UndeleteProjectRequest.new + + # Call the undelete_project method. + result = client.undelete_project 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 cloudresourcemanager_v3_generated_Projects_UndeleteProject_sync] diff --git a/owl-bot-staging/google-cloud-resource_manager-v3/snippets/projects/update_project.rb b/owl-bot-staging/google-cloud-resource_manager-v3/snippets/projects/update_project.rb new file mode 100644 index 000000000000..49dd2e37d67c --- /dev/null +++ b/owl-bot-staging/google-cloud-resource_manager-v3/snippets/projects/update_project.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 cloudresourcemanager_v3_generated_Projects_UpdateProject_sync] +require "google/cloud/resource_manager/v3" + +## +# Snippet for the update_project call in the Projects service +# +# This snippet has been automatically generated and should be regarded as a code +# template only. It will require modifications to work: +# - It may require correct/in-range values for request initialization. +# - It may require specifying regional endpoints when creating the service +# client as shown in https://cloud.google.com/ruby/docs/reference. +# +# This is an auto-generated example demonstrating basic usage of +# Google::Cloud::ResourceManager::V3::Projects::Client#update_project. +# +def update_project + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::ResourceManager::V3::Projects::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::ResourceManager::V3::UpdateProjectRequest.new + + # Call the update_project method. + result = client.update_project 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 cloudresourcemanager_v3_generated_Projects_UpdateProject_sync] diff --git a/owl-bot-staging/google-cloud-resource_manager-v3/snippets/snippet_metadata_google.cloud.resourcemanager.v3.json b/owl-bot-staging/google-cloud-resource_manager-v3/snippets/snippet_metadata_google.cloud.resourcemanager.v3.json new file mode 100644 index 000000000000..cc4c8a9301e5 --- /dev/null +++ b/owl-bot-staging/google-cloud-resource_manager-v3/snippets/snippet_metadata_google.cloud.resourcemanager.v3.json @@ -0,0 +1,2095 @@ +{ + "client_library": { + "name": "google-cloud-resource_manager-v3", + "version": "", + "language": "RUBY", + "apis": [ + { + "id": "google.cloud.resourcemanager.v3", + "version": "v3" + } + ] + }, + "snippets": [ + { + "region_tag": "cloudresourcemanager_v3_generated_Folders_GetFolder_sync", + "title": "Snippet for the get_folder call in the Folders service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::ResourceManager::V3::Folders::Client#get_folder.", + "file": "folders/get_folder.rb", + "language": "RUBY", + "client_method": { + "short_name": "get_folder", + "full_name": "::Google::Cloud::ResourceManager::V3::Folders::Client#get_folder", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::ResourceManager::V3::GetFolderRequest", + "name": "request" + } + ], + "result_type": "::Google::Cloud::ResourceManager::V3::Folder", + "client": { + "short_name": "Folders::Client", + "full_name": "::Google::Cloud::ResourceManager::V3::Folders::Client" + }, + "method": { + "short_name": "GetFolder", + "full_name": "google.cloud.resourcemanager.v3.Folders.GetFolder", + "service": { + "short_name": "Folders", + "full_name": "google.cloud.resourcemanager.v3.Folders" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 46, + "type": "FULL" + } + ] + }, + { + "region_tag": "cloudresourcemanager_v3_generated_Folders_ListFolders_sync", + "title": "Snippet for the list_folders call in the Folders service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::ResourceManager::V3::Folders::Client#list_folders.", + "file": "folders/list_folders.rb", + "language": "RUBY", + "client_method": { + "short_name": "list_folders", + "full_name": "::Google::Cloud::ResourceManager::V3::Folders::Client#list_folders", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::ResourceManager::V3::ListFoldersRequest", + "name": "request" + } + ], + "result_type": "::Google::Cloud::ResourceManager::V3::ListFoldersResponse", + "client": { + "short_name": "Folders::Client", + "full_name": "::Google::Cloud::ResourceManager::V3::Folders::Client" + }, + "method": { + "short_name": "ListFolders", + "full_name": "google.cloud.resourcemanager.v3.Folders.ListFolders", + "service": { + "short_name": "Folders", + "full_name": "google.cloud.resourcemanager.v3.Folders" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 50, + "type": "FULL" + } + ] + }, + { + "region_tag": "cloudresourcemanager_v3_generated_Folders_SearchFolders_sync", + "title": "Snippet for the search_folders call in the Folders service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::ResourceManager::V3::Folders::Client#search_folders.", + "file": "folders/search_folders.rb", + "language": "RUBY", + "client_method": { + "short_name": "search_folders", + "full_name": "::Google::Cloud::ResourceManager::V3::Folders::Client#search_folders", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::ResourceManager::V3::SearchFoldersRequest", + "name": "request" + } + ], + "result_type": "::Google::Cloud::ResourceManager::V3::SearchFoldersResponse", + "client": { + "short_name": "Folders::Client", + "full_name": "::Google::Cloud::ResourceManager::V3::Folders::Client" + }, + "method": { + "short_name": "SearchFolders", + "full_name": "google.cloud.resourcemanager.v3.Folders.SearchFolders", + "service": { + "short_name": "Folders", + "full_name": "google.cloud.resourcemanager.v3.Folders" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 50, + "type": "FULL" + } + ] + }, + { + "region_tag": "cloudresourcemanager_v3_generated_Folders_CreateFolder_sync", + "title": "Snippet for the create_folder call in the Folders service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::ResourceManager::V3::Folders::Client#create_folder.", + "file": "folders/create_folder.rb", + "language": "RUBY", + "client_method": { + "short_name": "create_folder", + "full_name": "::Google::Cloud::ResourceManager::V3::Folders::Client#create_folder", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::ResourceManager::V3::CreateFolderRequest", + "name": "request" + } + ], + "result_type": "::Google::Longrunning::Operation", + "client": { + "short_name": "Folders::Client", + "full_name": "::Google::Cloud::ResourceManager::V3::Folders::Client" + }, + "method": { + "short_name": "CreateFolder", + "full_name": "google.cloud.resourcemanager.v3.Folders.CreateFolder", + "service": { + "short_name": "Folders", + "full_name": "google.cloud.resourcemanager.v3.Folders" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 53, + "type": "FULL" + } + ] + }, + { + "region_tag": "cloudresourcemanager_v3_generated_Folders_UpdateFolder_sync", + "title": "Snippet for the update_folder call in the Folders service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::ResourceManager::V3::Folders::Client#update_folder.", + "file": "folders/update_folder.rb", + "language": "RUBY", + "client_method": { + "short_name": "update_folder", + "full_name": "::Google::Cloud::ResourceManager::V3::Folders::Client#update_folder", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::ResourceManager::V3::UpdateFolderRequest", + "name": "request" + } + ], + "result_type": "::Google::Longrunning::Operation", + "client": { + "short_name": "Folders::Client", + "full_name": "::Google::Cloud::ResourceManager::V3::Folders::Client" + }, + "method": { + "short_name": "UpdateFolder", + "full_name": "google.cloud.resourcemanager.v3.Folders.UpdateFolder", + "service": { + "short_name": "Folders", + "full_name": "google.cloud.resourcemanager.v3.Folders" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 53, + "type": "FULL" + } + ] + }, + { + "region_tag": "cloudresourcemanager_v3_generated_Folders_MoveFolder_sync", + "title": "Snippet for the move_folder call in the Folders service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::ResourceManager::V3::Folders::Client#move_folder.", + "file": "folders/move_folder.rb", + "language": "RUBY", + "client_method": { + "short_name": "move_folder", + "full_name": "::Google::Cloud::ResourceManager::V3::Folders::Client#move_folder", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::ResourceManager::V3::MoveFolderRequest", + "name": "request" + } + ], + "result_type": "::Google::Longrunning::Operation", + "client": { + "short_name": "Folders::Client", + "full_name": "::Google::Cloud::ResourceManager::V3::Folders::Client" + }, + "method": { + "short_name": "MoveFolder", + "full_name": "google.cloud.resourcemanager.v3.Folders.MoveFolder", + "service": { + "short_name": "Folders", + "full_name": "google.cloud.resourcemanager.v3.Folders" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 53, + "type": "FULL" + } + ] + }, + { + "region_tag": "cloudresourcemanager_v3_generated_Folders_DeleteFolder_sync", + "title": "Snippet for the delete_folder call in the Folders service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::ResourceManager::V3::Folders::Client#delete_folder.", + "file": "folders/delete_folder.rb", + "language": "RUBY", + "client_method": { + "short_name": "delete_folder", + "full_name": "::Google::Cloud::ResourceManager::V3::Folders::Client#delete_folder", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::ResourceManager::V3::DeleteFolderRequest", + "name": "request" + } + ], + "result_type": "::Google::Longrunning::Operation", + "client": { + "short_name": "Folders::Client", + "full_name": "::Google::Cloud::ResourceManager::V3::Folders::Client" + }, + "method": { + "short_name": "DeleteFolder", + "full_name": "google.cloud.resourcemanager.v3.Folders.DeleteFolder", + "service": { + "short_name": "Folders", + "full_name": "google.cloud.resourcemanager.v3.Folders" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 53, + "type": "FULL" + } + ] + }, + { + "region_tag": "cloudresourcemanager_v3_generated_Folders_UndeleteFolder_sync", + "title": "Snippet for the undelete_folder call in the Folders service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::ResourceManager::V3::Folders::Client#undelete_folder.", + "file": "folders/undelete_folder.rb", + "language": "RUBY", + "client_method": { + "short_name": "undelete_folder", + "full_name": "::Google::Cloud::ResourceManager::V3::Folders::Client#undelete_folder", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::ResourceManager::V3::UndeleteFolderRequest", + "name": "request" + } + ], + "result_type": "::Google::Longrunning::Operation", + "client": { + "short_name": "Folders::Client", + "full_name": "::Google::Cloud::ResourceManager::V3::Folders::Client" + }, + "method": { + "short_name": "UndeleteFolder", + "full_name": "google.cloud.resourcemanager.v3.Folders.UndeleteFolder", + "service": { + "short_name": "Folders", + "full_name": "google.cloud.resourcemanager.v3.Folders" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 53, + "type": "FULL" + } + ] + }, + { + "region_tag": "cloudresourcemanager_v3_generated_Folders_GetIamPolicy_sync", + "title": "Snippet for the get_iam_policy call in the Folders service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::ResourceManager::V3::Folders::Client#get_iam_policy.", + "file": "folders/get_iam_policy.rb", + "language": "RUBY", + "client_method": { + "short_name": "get_iam_policy", + "full_name": "::Google::Cloud::ResourceManager::V3::Folders::Client#get_iam_policy", + "async": false, + "parameters": [ + { + "type": "::Google::Iam::V1::GetIamPolicyRequest", + "name": "request" + } + ], + "result_type": "::Google::Iam::V1::Policy", + "client": { + "short_name": "Folders::Client", + "full_name": "::Google::Cloud::ResourceManager::V3::Folders::Client" + }, + "method": { + "short_name": "GetIamPolicy", + "full_name": "google.cloud.resourcemanager.v3.Folders.GetIamPolicy", + "service": { + "short_name": "Folders", + "full_name": "google.cloud.resourcemanager.v3.Folders" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 46, + "type": "FULL" + } + ] + }, + { + "region_tag": "cloudresourcemanager_v3_generated_Folders_SetIamPolicy_sync", + "title": "Snippet for the set_iam_policy call in the Folders service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::ResourceManager::V3::Folders::Client#set_iam_policy.", + "file": "folders/set_iam_policy.rb", + "language": "RUBY", + "client_method": { + "short_name": "set_iam_policy", + "full_name": "::Google::Cloud::ResourceManager::V3::Folders::Client#set_iam_policy", + "async": false, + "parameters": [ + { + "type": "::Google::Iam::V1::SetIamPolicyRequest", + "name": "request" + } + ], + "result_type": "::Google::Iam::V1::Policy", + "client": { + "short_name": "Folders::Client", + "full_name": "::Google::Cloud::ResourceManager::V3::Folders::Client" + }, + "method": { + "short_name": "SetIamPolicy", + "full_name": "google.cloud.resourcemanager.v3.Folders.SetIamPolicy", + "service": { + "short_name": "Folders", + "full_name": "google.cloud.resourcemanager.v3.Folders" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 46, + "type": "FULL" + } + ] + }, + { + "region_tag": "cloudresourcemanager_v3_generated_Folders_TestIamPermissions_sync", + "title": "Snippet for the test_iam_permissions call in the Folders service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::ResourceManager::V3::Folders::Client#test_iam_permissions.", + "file": "folders/test_iam_permissions.rb", + "language": "RUBY", + "client_method": { + "short_name": "test_iam_permissions", + "full_name": "::Google::Cloud::ResourceManager::V3::Folders::Client#test_iam_permissions", + "async": false, + "parameters": [ + { + "type": "::Google::Iam::V1::TestIamPermissionsRequest", + "name": "request" + } + ], + "result_type": "::Google::Iam::V1::TestIamPermissionsResponse", + "client": { + "short_name": "Folders::Client", + "full_name": "::Google::Cloud::ResourceManager::V3::Folders::Client" + }, + "method": { + "short_name": "TestIamPermissions", + "full_name": "google.cloud.resourcemanager.v3.Folders.TestIamPermissions", + "service": { + "short_name": "Folders", + "full_name": "google.cloud.resourcemanager.v3.Folders" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 46, + "type": "FULL" + } + ] + }, + { + "region_tag": "cloudresourcemanager_v3_generated_Organizations_GetOrganization_sync", + "title": "Snippet for the get_organization call in the Organizations service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::ResourceManager::V3::Organizations::Client#get_organization.", + "file": "organizations/get_organization.rb", + "language": "RUBY", + "client_method": { + "short_name": "get_organization", + "full_name": "::Google::Cloud::ResourceManager::V3::Organizations::Client#get_organization", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::ResourceManager::V3::GetOrganizationRequest", + "name": "request" + } + ], + "result_type": "::Google::Cloud::ResourceManager::V3::Organization", + "client": { + "short_name": "Organizations::Client", + "full_name": "::Google::Cloud::ResourceManager::V3::Organizations::Client" + }, + "method": { + "short_name": "GetOrganization", + "full_name": "google.cloud.resourcemanager.v3.Organizations.GetOrganization", + "service": { + "short_name": "Organizations", + "full_name": "google.cloud.resourcemanager.v3.Organizations" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 46, + "type": "FULL" + } + ] + }, + { + "region_tag": "cloudresourcemanager_v3_generated_Organizations_SearchOrganizations_sync", + "title": "Snippet for the search_organizations call in the Organizations service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::ResourceManager::V3::Organizations::Client#search_organizations.", + "file": "organizations/search_organizations.rb", + "language": "RUBY", + "client_method": { + "short_name": "search_organizations", + "full_name": "::Google::Cloud::ResourceManager::V3::Organizations::Client#search_organizations", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::ResourceManager::V3::SearchOrganizationsRequest", + "name": "request" + } + ], + "result_type": "::Google::Cloud::ResourceManager::V3::SearchOrganizationsResponse", + "client": { + "short_name": "Organizations::Client", + "full_name": "::Google::Cloud::ResourceManager::V3::Organizations::Client" + }, + "method": { + "short_name": "SearchOrganizations", + "full_name": "google.cloud.resourcemanager.v3.Organizations.SearchOrganizations", + "service": { + "short_name": "Organizations", + "full_name": "google.cloud.resourcemanager.v3.Organizations" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 50, + "type": "FULL" + } + ] + }, + { + "region_tag": "cloudresourcemanager_v3_generated_Organizations_GetIamPolicy_sync", + "title": "Snippet for the get_iam_policy call in the Organizations service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::ResourceManager::V3::Organizations::Client#get_iam_policy.", + "file": "organizations/get_iam_policy.rb", + "language": "RUBY", + "client_method": { + "short_name": "get_iam_policy", + "full_name": "::Google::Cloud::ResourceManager::V3::Organizations::Client#get_iam_policy", + "async": false, + "parameters": [ + { + "type": "::Google::Iam::V1::GetIamPolicyRequest", + "name": "request" + } + ], + "result_type": "::Google::Iam::V1::Policy", + "client": { + "short_name": "Organizations::Client", + "full_name": "::Google::Cloud::ResourceManager::V3::Organizations::Client" + }, + "method": { + "short_name": "GetIamPolicy", + "full_name": "google.cloud.resourcemanager.v3.Organizations.GetIamPolicy", + "service": { + "short_name": "Organizations", + "full_name": "google.cloud.resourcemanager.v3.Organizations" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 46, + "type": "FULL" + } + ] + }, + { + "region_tag": "cloudresourcemanager_v3_generated_Organizations_SetIamPolicy_sync", + "title": "Snippet for the set_iam_policy call in the Organizations service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::ResourceManager::V3::Organizations::Client#set_iam_policy.", + "file": "organizations/set_iam_policy.rb", + "language": "RUBY", + "client_method": { + "short_name": "set_iam_policy", + "full_name": "::Google::Cloud::ResourceManager::V3::Organizations::Client#set_iam_policy", + "async": false, + "parameters": [ + { + "type": "::Google::Iam::V1::SetIamPolicyRequest", + "name": "request" + } + ], + "result_type": "::Google::Iam::V1::Policy", + "client": { + "short_name": "Organizations::Client", + "full_name": "::Google::Cloud::ResourceManager::V3::Organizations::Client" + }, + "method": { + "short_name": "SetIamPolicy", + "full_name": "google.cloud.resourcemanager.v3.Organizations.SetIamPolicy", + "service": { + "short_name": "Organizations", + "full_name": "google.cloud.resourcemanager.v3.Organizations" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 46, + "type": "FULL" + } + ] + }, + { + "region_tag": "cloudresourcemanager_v3_generated_Organizations_TestIamPermissions_sync", + "title": "Snippet for the test_iam_permissions call in the Organizations service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::ResourceManager::V3::Organizations::Client#test_iam_permissions.", + "file": "organizations/test_iam_permissions.rb", + "language": "RUBY", + "client_method": { + "short_name": "test_iam_permissions", + "full_name": "::Google::Cloud::ResourceManager::V3::Organizations::Client#test_iam_permissions", + "async": false, + "parameters": [ + { + "type": "::Google::Iam::V1::TestIamPermissionsRequest", + "name": "request" + } + ], + "result_type": "::Google::Iam::V1::TestIamPermissionsResponse", + "client": { + "short_name": "Organizations::Client", + "full_name": "::Google::Cloud::ResourceManager::V3::Organizations::Client" + }, + "method": { + "short_name": "TestIamPermissions", + "full_name": "google.cloud.resourcemanager.v3.Organizations.TestIamPermissions", + "service": { + "short_name": "Organizations", + "full_name": "google.cloud.resourcemanager.v3.Organizations" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 46, + "type": "FULL" + } + ] + }, + { + "region_tag": "cloudresourcemanager_v3_generated_Projects_GetProject_sync", + "title": "Snippet for the get_project call in the Projects service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::ResourceManager::V3::Projects::Client#get_project.", + "file": "projects/get_project.rb", + "language": "RUBY", + "client_method": { + "short_name": "get_project", + "full_name": "::Google::Cloud::ResourceManager::V3::Projects::Client#get_project", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::ResourceManager::V3::GetProjectRequest", + "name": "request" + } + ], + "result_type": "::Google::Cloud::ResourceManager::V3::Project", + "client": { + "short_name": "Projects::Client", + "full_name": "::Google::Cloud::ResourceManager::V3::Projects::Client" + }, + "method": { + "short_name": "GetProject", + "full_name": "google.cloud.resourcemanager.v3.Projects.GetProject", + "service": { + "short_name": "Projects", + "full_name": "google.cloud.resourcemanager.v3.Projects" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 46, + "type": "FULL" + } + ] + }, + { + "region_tag": "cloudresourcemanager_v3_generated_Projects_ListProjects_sync", + "title": "Snippet for the list_projects call in the Projects service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::ResourceManager::V3::Projects::Client#list_projects.", + "file": "projects/list_projects.rb", + "language": "RUBY", + "client_method": { + "short_name": "list_projects", + "full_name": "::Google::Cloud::ResourceManager::V3::Projects::Client#list_projects", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::ResourceManager::V3::ListProjectsRequest", + "name": "request" + } + ], + "result_type": "::Google::Cloud::ResourceManager::V3::ListProjectsResponse", + "client": { + "short_name": "Projects::Client", + "full_name": "::Google::Cloud::ResourceManager::V3::Projects::Client" + }, + "method": { + "short_name": "ListProjects", + "full_name": "google.cloud.resourcemanager.v3.Projects.ListProjects", + "service": { + "short_name": "Projects", + "full_name": "google.cloud.resourcemanager.v3.Projects" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 50, + "type": "FULL" + } + ] + }, + { + "region_tag": "cloudresourcemanager_v3_generated_Projects_SearchProjects_sync", + "title": "Snippet for the search_projects call in the Projects service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::ResourceManager::V3::Projects::Client#search_projects.", + "file": "projects/search_projects.rb", + "language": "RUBY", + "client_method": { + "short_name": "search_projects", + "full_name": "::Google::Cloud::ResourceManager::V3::Projects::Client#search_projects", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::ResourceManager::V3::SearchProjectsRequest", + "name": "request" + } + ], + "result_type": "::Google::Cloud::ResourceManager::V3::SearchProjectsResponse", + "client": { + "short_name": "Projects::Client", + "full_name": "::Google::Cloud::ResourceManager::V3::Projects::Client" + }, + "method": { + "short_name": "SearchProjects", + "full_name": "google.cloud.resourcemanager.v3.Projects.SearchProjects", + "service": { + "short_name": "Projects", + "full_name": "google.cloud.resourcemanager.v3.Projects" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 50, + "type": "FULL" + } + ] + }, + { + "region_tag": "cloudresourcemanager_v3_generated_Projects_CreateProject_sync", + "title": "Snippet for the create_project call in the Projects service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::ResourceManager::V3::Projects::Client#create_project.", + "file": "projects/create_project.rb", + "language": "RUBY", + "client_method": { + "short_name": "create_project", + "full_name": "::Google::Cloud::ResourceManager::V3::Projects::Client#create_project", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::ResourceManager::V3::CreateProjectRequest", + "name": "request" + } + ], + "result_type": "::Google::Longrunning::Operation", + "client": { + "short_name": "Projects::Client", + "full_name": "::Google::Cloud::ResourceManager::V3::Projects::Client" + }, + "method": { + "short_name": "CreateProject", + "full_name": "google.cloud.resourcemanager.v3.Projects.CreateProject", + "service": { + "short_name": "Projects", + "full_name": "google.cloud.resourcemanager.v3.Projects" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 53, + "type": "FULL" + } + ] + }, + { + "region_tag": "cloudresourcemanager_v3_generated_Projects_UpdateProject_sync", + "title": "Snippet for the update_project call in the Projects service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::ResourceManager::V3::Projects::Client#update_project.", + "file": "projects/update_project.rb", + "language": "RUBY", + "client_method": { + "short_name": "update_project", + "full_name": "::Google::Cloud::ResourceManager::V3::Projects::Client#update_project", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::ResourceManager::V3::UpdateProjectRequest", + "name": "request" + } + ], + "result_type": "::Google::Longrunning::Operation", + "client": { + "short_name": "Projects::Client", + "full_name": "::Google::Cloud::ResourceManager::V3::Projects::Client" + }, + "method": { + "short_name": "UpdateProject", + "full_name": "google.cloud.resourcemanager.v3.Projects.UpdateProject", + "service": { + "short_name": "Projects", + "full_name": "google.cloud.resourcemanager.v3.Projects" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 53, + "type": "FULL" + } + ] + }, + { + "region_tag": "cloudresourcemanager_v3_generated_Projects_MoveProject_sync", + "title": "Snippet for the move_project call in the Projects service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::ResourceManager::V3::Projects::Client#move_project.", + "file": "projects/move_project.rb", + "language": "RUBY", + "client_method": { + "short_name": "move_project", + "full_name": "::Google::Cloud::ResourceManager::V3::Projects::Client#move_project", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::ResourceManager::V3::MoveProjectRequest", + "name": "request" + } + ], + "result_type": "::Google::Longrunning::Operation", + "client": { + "short_name": "Projects::Client", + "full_name": "::Google::Cloud::ResourceManager::V3::Projects::Client" + }, + "method": { + "short_name": "MoveProject", + "full_name": "google.cloud.resourcemanager.v3.Projects.MoveProject", + "service": { + "short_name": "Projects", + "full_name": "google.cloud.resourcemanager.v3.Projects" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 53, + "type": "FULL" + } + ] + }, + { + "region_tag": "cloudresourcemanager_v3_generated_Projects_DeleteProject_sync", + "title": "Snippet for the delete_project call in the Projects service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::ResourceManager::V3::Projects::Client#delete_project.", + "file": "projects/delete_project.rb", + "language": "RUBY", + "client_method": { + "short_name": "delete_project", + "full_name": "::Google::Cloud::ResourceManager::V3::Projects::Client#delete_project", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::ResourceManager::V3::DeleteProjectRequest", + "name": "request" + } + ], + "result_type": "::Google::Longrunning::Operation", + "client": { + "short_name": "Projects::Client", + "full_name": "::Google::Cloud::ResourceManager::V3::Projects::Client" + }, + "method": { + "short_name": "DeleteProject", + "full_name": "google.cloud.resourcemanager.v3.Projects.DeleteProject", + "service": { + "short_name": "Projects", + "full_name": "google.cloud.resourcemanager.v3.Projects" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 53, + "type": "FULL" + } + ] + }, + { + "region_tag": "cloudresourcemanager_v3_generated_Projects_UndeleteProject_sync", + "title": "Snippet for the undelete_project call in the Projects service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::ResourceManager::V3::Projects::Client#undelete_project.", + "file": "projects/undelete_project.rb", + "language": "RUBY", + "client_method": { + "short_name": "undelete_project", + "full_name": "::Google::Cloud::ResourceManager::V3::Projects::Client#undelete_project", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::ResourceManager::V3::UndeleteProjectRequest", + "name": "request" + } + ], + "result_type": "::Google::Longrunning::Operation", + "client": { + "short_name": "Projects::Client", + "full_name": "::Google::Cloud::ResourceManager::V3::Projects::Client" + }, + "method": { + "short_name": "UndeleteProject", + "full_name": "google.cloud.resourcemanager.v3.Projects.UndeleteProject", + "service": { + "short_name": "Projects", + "full_name": "google.cloud.resourcemanager.v3.Projects" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 53, + "type": "FULL" + } + ] + }, + { + "region_tag": "cloudresourcemanager_v3_generated_Projects_GetIamPolicy_sync", + "title": "Snippet for the get_iam_policy call in the Projects service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::ResourceManager::V3::Projects::Client#get_iam_policy.", + "file": "projects/get_iam_policy.rb", + "language": "RUBY", + "client_method": { + "short_name": "get_iam_policy", + "full_name": "::Google::Cloud::ResourceManager::V3::Projects::Client#get_iam_policy", + "async": false, + "parameters": [ + { + "type": "::Google::Iam::V1::GetIamPolicyRequest", + "name": "request" + } + ], + "result_type": "::Google::Iam::V1::Policy", + "client": { + "short_name": "Projects::Client", + "full_name": "::Google::Cloud::ResourceManager::V3::Projects::Client" + }, + "method": { + "short_name": "GetIamPolicy", + "full_name": "google.cloud.resourcemanager.v3.Projects.GetIamPolicy", + "service": { + "short_name": "Projects", + "full_name": "google.cloud.resourcemanager.v3.Projects" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 46, + "type": "FULL" + } + ] + }, + { + "region_tag": "cloudresourcemanager_v3_generated_Projects_SetIamPolicy_sync", + "title": "Snippet for the set_iam_policy call in the Projects service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::ResourceManager::V3::Projects::Client#set_iam_policy.", + "file": "projects/set_iam_policy.rb", + "language": "RUBY", + "client_method": { + "short_name": "set_iam_policy", + "full_name": "::Google::Cloud::ResourceManager::V3::Projects::Client#set_iam_policy", + "async": false, + "parameters": [ + { + "type": "::Google::Iam::V1::SetIamPolicyRequest", + "name": "request" + } + ], + "result_type": "::Google::Iam::V1::Policy", + "client": { + "short_name": "Projects::Client", + "full_name": "::Google::Cloud::ResourceManager::V3::Projects::Client" + }, + "method": { + "short_name": "SetIamPolicy", + "full_name": "google.cloud.resourcemanager.v3.Projects.SetIamPolicy", + "service": { + "short_name": "Projects", + "full_name": "google.cloud.resourcemanager.v3.Projects" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 46, + "type": "FULL" + } + ] + }, + { + "region_tag": "cloudresourcemanager_v3_generated_Projects_TestIamPermissions_sync", + "title": "Snippet for the test_iam_permissions call in the Projects service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::ResourceManager::V3::Projects::Client#test_iam_permissions.", + "file": "projects/test_iam_permissions.rb", + "language": "RUBY", + "client_method": { + "short_name": "test_iam_permissions", + "full_name": "::Google::Cloud::ResourceManager::V3::Projects::Client#test_iam_permissions", + "async": false, + "parameters": [ + { + "type": "::Google::Iam::V1::TestIamPermissionsRequest", + "name": "request" + } + ], + "result_type": "::Google::Iam::V1::TestIamPermissionsResponse", + "client": { + "short_name": "Projects::Client", + "full_name": "::Google::Cloud::ResourceManager::V3::Projects::Client" + }, + "method": { + "short_name": "TestIamPermissions", + "full_name": "google.cloud.resourcemanager.v3.Projects.TestIamPermissions", + "service": { + "short_name": "Projects", + "full_name": "google.cloud.resourcemanager.v3.Projects" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 46, + "type": "FULL" + } + ] + }, + { + "region_tag": "cloudresourcemanager_v3_generated_TagBindings_ListTagBindings_sync", + "title": "Snippet for the list_tag_bindings call in the TagBindings service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::ResourceManager::V3::TagBindings::Client#list_tag_bindings.", + "file": "tag_bindings/list_tag_bindings.rb", + "language": "RUBY", + "client_method": { + "short_name": "list_tag_bindings", + "full_name": "::Google::Cloud::ResourceManager::V3::TagBindings::Client#list_tag_bindings", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::ResourceManager::V3::ListTagBindingsRequest", + "name": "request" + } + ], + "result_type": "::Google::Cloud::ResourceManager::V3::ListTagBindingsResponse", + "client": { + "short_name": "TagBindings::Client", + "full_name": "::Google::Cloud::ResourceManager::V3::TagBindings::Client" + }, + "method": { + "short_name": "ListTagBindings", + "full_name": "google.cloud.resourcemanager.v3.TagBindings.ListTagBindings", + "service": { + "short_name": "TagBindings", + "full_name": "google.cloud.resourcemanager.v3.TagBindings" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 50, + "type": "FULL" + } + ] + }, + { + "region_tag": "cloudresourcemanager_v3_generated_TagBindings_CreateTagBinding_sync", + "title": "Snippet for the create_tag_binding call in the TagBindings service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::ResourceManager::V3::TagBindings::Client#create_tag_binding.", + "file": "tag_bindings/create_tag_binding.rb", + "language": "RUBY", + "client_method": { + "short_name": "create_tag_binding", + "full_name": "::Google::Cloud::ResourceManager::V3::TagBindings::Client#create_tag_binding", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::ResourceManager::V3::CreateTagBindingRequest", + "name": "request" + } + ], + "result_type": "::Google::Longrunning::Operation", + "client": { + "short_name": "TagBindings::Client", + "full_name": "::Google::Cloud::ResourceManager::V3::TagBindings::Client" + }, + "method": { + "short_name": "CreateTagBinding", + "full_name": "google.cloud.resourcemanager.v3.TagBindings.CreateTagBinding", + "service": { + "short_name": "TagBindings", + "full_name": "google.cloud.resourcemanager.v3.TagBindings" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 53, + "type": "FULL" + } + ] + }, + { + "region_tag": "cloudresourcemanager_v3_generated_TagBindings_DeleteTagBinding_sync", + "title": "Snippet for the delete_tag_binding call in the TagBindings service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::ResourceManager::V3::TagBindings::Client#delete_tag_binding.", + "file": "tag_bindings/delete_tag_binding.rb", + "language": "RUBY", + "client_method": { + "short_name": "delete_tag_binding", + "full_name": "::Google::Cloud::ResourceManager::V3::TagBindings::Client#delete_tag_binding", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::ResourceManager::V3::DeleteTagBindingRequest", + "name": "request" + } + ], + "result_type": "::Google::Longrunning::Operation", + "client": { + "short_name": "TagBindings::Client", + "full_name": "::Google::Cloud::ResourceManager::V3::TagBindings::Client" + }, + "method": { + "short_name": "DeleteTagBinding", + "full_name": "google.cloud.resourcemanager.v3.TagBindings.DeleteTagBinding", + "service": { + "short_name": "TagBindings", + "full_name": "google.cloud.resourcemanager.v3.TagBindings" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 53, + "type": "FULL" + } + ] + }, + { + "region_tag": "cloudresourcemanager_v3_generated_TagBindings_ListEffectiveTags_sync", + "title": "Snippet for the list_effective_tags call in the TagBindings service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::ResourceManager::V3::TagBindings::Client#list_effective_tags.", + "file": "tag_bindings/list_effective_tags.rb", + "language": "RUBY", + "client_method": { + "short_name": "list_effective_tags", + "full_name": "::Google::Cloud::ResourceManager::V3::TagBindings::Client#list_effective_tags", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::ResourceManager::V3::ListEffectiveTagsRequest", + "name": "request" + } + ], + "result_type": "::Google::Cloud::ResourceManager::V3::ListEffectiveTagsResponse", + "client": { + "short_name": "TagBindings::Client", + "full_name": "::Google::Cloud::ResourceManager::V3::TagBindings::Client" + }, + "method": { + "short_name": "ListEffectiveTags", + "full_name": "google.cloud.resourcemanager.v3.TagBindings.ListEffectiveTags", + "service": { + "short_name": "TagBindings", + "full_name": "google.cloud.resourcemanager.v3.TagBindings" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 50, + "type": "FULL" + } + ] + }, + { + "region_tag": "cloudresourcemanager_v3_generated_TagHolds_CreateTagHold_sync", + "title": "Snippet for the create_tag_hold call in the TagHolds service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::ResourceManager::V3::TagHolds::Client#create_tag_hold.", + "file": "tag_holds/create_tag_hold.rb", + "language": "RUBY", + "client_method": { + "short_name": "create_tag_hold", + "full_name": "::Google::Cloud::ResourceManager::V3::TagHolds::Client#create_tag_hold", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::ResourceManager::V3::CreateTagHoldRequest", + "name": "request" + } + ], + "result_type": "::Google::Longrunning::Operation", + "client": { + "short_name": "TagHolds::Client", + "full_name": "::Google::Cloud::ResourceManager::V3::TagHolds::Client" + }, + "method": { + "short_name": "CreateTagHold", + "full_name": "google.cloud.resourcemanager.v3.TagHolds.CreateTagHold", + "service": { + "short_name": "TagHolds", + "full_name": "google.cloud.resourcemanager.v3.TagHolds" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 53, + "type": "FULL" + } + ] + }, + { + "region_tag": "cloudresourcemanager_v3_generated_TagHolds_DeleteTagHold_sync", + "title": "Snippet for the delete_tag_hold call in the TagHolds service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::ResourceManager::V3::TagHolds::Client#delete_tag_hold.", + "file": "tag_holds/delete_tag_hold.rb", + "language": "RUBY", + "client_method": { + "short_name": "delete_tag_hold", + "full_name": "::Google::Cloud::ResourceManager::V3::TagHolds::Client#delete_tag_hold", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::ResourceManager::V3::DeleteTagHoldRequest", + "name": "request" + } + ], + "result_type": "::Google::Longrunning::Operation", + "client": { + "short_name": "TagHolds::Client", + "full_name": "::Google::Cloud::ResourceManager::V3::TagHolds::Client" + }, + "method": { + "short_name": "DeleteTagHold", + "full_name": "google.cloud.resourcemanager.v3.TagHolds.DeleteTagHold", + "service": { + "short_name": "TagHolds", + "full_name": "google.cloud.resourcemanager.v3.TagHolds" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 53, + "type": "FULL" + } + ] + }, + { + "region_tag": "cloudresourcemanager_v3_generated_TagHolds_ListTagHolds_sync", + "title": "Snippet for the list_tag_holds call in the TagHolds service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::ResourceManager::V3::TagHolds::Client#list_tag_holds.", + "file": "tag_holds/list_tag_holds.rb", + "language": "RUBY", + "client_method": { + "short_name": "list_tag_holds", + "full_name": "::Google::Cloud::ResourceManager::V3::TagHolds::Client#list_tag_holds", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::ResourceManager::V3::ListTagHoldsRequest", + "name": "request" + } + ], + "result_type": "::Google::Cloud::ResourceManager::V3::ListTagHoldsResponse", + "client": { + "short_name": "TagHolds::Client", + "full_name": "::Google::Cloud::ResourceManager::V3::TagHolds::Client" + }, + "method": { + "short_name": "ListTagHolds", + "full_name": "google.cloud.resourcemanager.v3.TagHolds.ListTagHolds", + "service": { + "short_name": "TagHolds", + "full_name": "google.cloud.resourcemanager.v3.TagHolds" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 50, + "type": "FULL" + } + ] + }, + { + "region_tag": "cloudresourcemanager_v3_generated_TagKeys_ListTagKeys_sync", + "title": "Snippet for the list_tag_keys call in the TagKeys service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::ResourceManager::V3::TagKeys::Client#list_tag_keys.", + "file": "tag_keys/list_tag_keys.rb", + "language": "RUBY", + "client_method": { + "short_name": "list_tag_keys", + "full_name": "::Google::Cloud::ResourceManager::V3::TagKeys::Client#list_tag_keys", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::ResourceManager::V3::ListTagKeysRequest", + "name": "request" + } + ], + "result_type": "::Google::Cloud::ResourceManager::V3::ListTagKeysResponse", + "client": { + "short_name": "TagKeys::Client", + "full_name": "::Google::Cloud::ResourceManager::V3::TagKeys::Client" + }, + "method": { + "short_name": "ListTagKeys", + "full_name": "google.cloud.resourcemanager.v3.TagKeys.ListTagKeys", + "service": { + "short_name": "TagKeys", + "full_name": "google.cloud.resourcemanager.v3.TagKeys" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 50, + "type": "FULL" + } + ] + }, + { + "region_tag": "cloudresourcemanager_v3_generated_TagKeys_GetTagKey_sync", + "title": "Snippet for the get_tag_key call in the TagKeys service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::ResourceManager::V3::TagKeys::Client#get_tag_key.", + "file": "tag_keys/get_tag_key.rb", + "language": "RUBY", + "client_method": { + "short_name": "get_tag_key", + "full_name": "::Google::Cloud::ResourceManager::V3::TagKeys::Client#get_tag_key", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::ResourceManager::V3::GetTagKeyRequest", + "name": "request" + } + ], + "result_type": "::Google::Cloud::ResourceManager::V3::TagKey", + "client": { + "short_name": "TagKeys::Client", + "full_name": "::Google::Cloud::ResourceManager::V3::TagKeys::Client" + }, + "method": { + "short_name": "GetTagKey", + "full_name": "google.cloud.resourcemanager.v3.TagKeys.GetTagKey", + "service": { + "short_name": "TagKeys", + "full_name": "google.cloud.resourcemanager.v3.TagKeys" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 46, + "type": "FULL" + } + ] + }, + { + "region_tag": "cloudresourcemanager_v3_generated_TagKeys_GetNamespacedTagKey_sync", + "title": "Snippet for the get_namespaced_tag_key call in the TagKeys service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::ResourceManager::V3::TagKeys::Client#get_namespaced_tag_key.", + "file": "tag_keys/get_namespaced_tag_key.rb", + "language": "RUBY", + "client_method": { + "short_name": "get_namespaced_tag_key", + "full_name": "::Google::Cloud::ResourceManager::V3::TagKeys::Client#get_namespaced_tag_key", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::ResourceManager::V3::GetNamespacedTagKeyRequest", + "name": "request" + } + ], + "result_type": "::Google::Cloud::ResourceManager::V3::TagKey", + "client": { + "short_name": "TagKeys::Client", + "full_name": "::Google::Cloud::ResourceManager::V3::TagKeys::Client" + }, + "method": { + "short_name": "GetNamespacedTagKey", + "full_name": "google.cloud.resourcemanager.v3.TagKeys.GetNamespacedTagKey", + "service": { + "short_name": "TagKeys", + "full_name": "google.cloud.resourcemanager.v3.TagKeys" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 46, + "type": "FULL" + } + ] + }, + { + "region_tag": "cloudresourcemanager_v3_generated_TagKeys_CreateTagKey_sync", + "title": "Snippet for the create_tag_key call in the TagKeys service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::ResourceManager::V3::TagKeys::Client#create_tag_key.", + "file": "tag_keys/create_tag_key.rb", + "language": "RUBY", + "client_method": { + "short_name": "create_tag_key", + "full_name": "::Google::Cloud::ResourceManager::V3::TagKeys::Client#create_tag_key", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::ResourceManager::V3::CreateTagKeyRequest", + "name": "request" + } + ], + "result_type": "::Google::Longrunning::Operation", + "client": { + "short_name": "TagKeys::Client", + "full_name": "::Google::Cloud::ResourceManager::V3::TagKeys::Client" + }, + "method": { + "short_name": "CreateTagKey", + "full_name": "google.cloud.resourcemanager.v3.TagKeys.CreateTagKey", + "service": { + "short_name": "TagKeys", + "full_name": "google.cloud.resourcemanager.v3.TagKeys" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 53, + "type": "FULL" + } + ] + }, + { + "region_tag": "cloudresourcemanager_v3_generated_TagKeys_UpdateTagKey_sync", + "title": "Snippet for the update_tag_key call in the TagKeys service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::ResourceManager::V3::TagKeys::Client#update_tag_key.", + "file": "tag_keys/update_tag_key.rb", + "language": "RUBY", + "client_method": { + "short_name": "update_tag_key", + "full_name": "::Google::Cloud::ResourceManager::V3::TagKeys::Client#update_tag_key", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::ResourceManager::V3::UpdateTagKeyRequest", + "name": "request" + } + ], + "result_type": "::Google::Longrunning::Operation", + "client": { + "short_name": "TagKeys::Client", + "full_name": "::Google::Cloud::ResourceManager::V3::TagKeys::Client" + }, + "method": { + "short_name": "UpdateTagKey", + "full_name": "google.cloud.resourcemanager.v3.TagKeys.UpdateTagKey", + "service": { + "short_name": "TagKeys", + "full_name": "google.cloud.resourcemanager.v3.TagKeys" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 53, + "type": "FULL" + } + ] + }, + { + "region_tag": "cloudresourcemanager_v3_generated_TagKeys_DeleteTagKey_sync", + "title": "Snippet for the delete_tag_key call in the TagKeys service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::ResourceManager::V3::TagKeys::Client#delete_tag_key.", + "file": "tag_keys/delete_tag_key.rb", + "language": "RUBY", + "client_method": { + "short_name": "delete_tag_key", + "full_name": "::Google::Cloud::ResourceManager::V3::TagKeys::Client#delete_tag_key", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::ResourceManager::V3::DeleteTagKeyRequest", + "name": "request" + } + ], + "result_type": "::Google::Longrunning::Operation", + "client": { + "short_name": "TagKeys::Client", + "full_name": "::Google::Cloud::ResourceManager::V3::TagKeys::Client" + }, + "method": { + "short_name": "DeleteTagKey", + "full_name": "google.cloud.resourcemanager.v3.TagKeys.DeleteTagKey", + "service": { + "short_name": "TagKeys", + "full_name": "google.cloud.resourcemanager.v3.TagKeys" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 53, + "type": "FULL" + } + ] + }, + { + "region_tag": "cloudresourcemanager_v3_generated_TagKeys_GetIamPolicy_sync", + "title": "Snippet for the get_iam_policy call in the TagKeys service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::ResourceManager::V3::TagKeys::Client#get_iam_policy.", + "file": "tag_keys/get_iam_policy.rb", + "language": "RUBY", + "client_method": { + "short_name": "get_iam_policy", + "full_name": "::Google::Cloud::ResourceManager::V3::TagKeys::Client#get_iam_policy", + "async": false, + "parameters": [ + { + "type": "::Google::Iam::V1::GetIamPolicyRequest", + "name": "request" + } + ], + "result_type": "::Google::Iam::V1::Policy", + "client": { + "short_name": "TagKeys::Client", + "full_name": "::Google::Cloud::ResourceManager::V3::TagKeys::Client" + }, + "method": { + "short_name": "GetIamPolicy", + "full_name": "google.cloud.resourcemanager.v3.TagKeys.GetIamPolicy", + "service": { + "short_name": "TagKeys", + "full_name": "google.cloud.resourcemanager.v3.TagKeys" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 46, + "type": "FULL" + } + ] + }, + { + "region_tag": "cloudresourcemanager_v3_generated_TagKeys_SetIamPolicy_sync", + "title": "Snippet for the set_iam_policy call in the TagKeys service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::ResourceManager::V3::TagKeys::Client#set_iam_policy.", + "file": "tag_keys/set_iam_policy.rb", + "language": "RUBY", + "client_method": { + "short_name": "set_iam_policy", + "full_name": "::Google::Cloud::ResourceManager::V3::TagKeys::Client#set_iam_policy", + "async": false, + "parameters": [ + { + "type": "::Google::Iam::V1::SetIamPolicyRequest", + "name": "request" + } + ], + "result_type": "::Google::Iam::V1::Policy", + "client": { + "short_name": "TagKeys::Client", + "full_name": "::Google::Cloud::ResourceManager::V3::TagKeys::Client" + }, + "method": { + "short_name": "SetIamPolicy", + "full_name": "google.cloud.resourcemanager.v3.TagKeys.SetIamPolicy", + "service": { + "short_name": "TagKeys", + "full_name": "google.cloud.resourcemanager.v3.TagKeys" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 46, + "type": "FULL" + } + ] + }, + { + "region_tag": "cloudresourcemanager_v3_generated_TagKeys_TestIamPermissions_sync", + "title": "Snippet for the test_iam_permissions call in the TagKeys service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::ResourceManager::V3::TagKeys::Client#test_iam_permissions.", + "file": "tag_keys/test_iam_permissions.rb", + "language": "RUBY", + "client_method": { + "short_name": "test_iam_permissions", + "full_name": "::Google::Cloud::ResourceManager::V3::TagKeys::Client#test_iam_permissions", + "async": false, + "parameters": [ + { + "type": "::Google::Iam::V1::TestIamPermissionsRequest", + "name": "request" + } + ], + "result_type": "::Google::Iam::V1::TestIamPermissionsResponse", + "client": { + "short_name": "TagKeys::Client", + "full_name": "::Google::Cloud::ResourceManager::V3::TagKeys::Client" + }, + "method": { + "short_name": "TestIamPermissions", + "full_name": "google.cloud.resourcemanager.v3.TagKeys.TestIamPermissions", + "service": { + "short_name": "TagKeys", + "full_name": "google.cloud.resourcemanager.v3.TagKeys" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 46, + "type": "FULL" + } + ] + }, + { + "region_tag": "cloudresourcemanager_v3_generated_TagValues_ListTagValues_sync", + "title": "Snippet for the list_tag_values call in the TagValues service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::ResourceManager::V3::TagValues::Client#list_tag_values.", + "file": "tag_values/list_tag_values.rb", + "language": "RUBY", + "client_method": { + "short_name": "list_tag_values", + "full_name": "::Google::Cloud::ResourceManager::V3::TagValues::Client#list_tag_values", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::ResourceManager::V3::ListTagValuesRequest", + "name": "request" + } + ], + "result_type": "::Google::Cloud::ResourceManager::V3::ListTagValuesResponse", + "client": { + "short_name": "TagValues::Client", + "full_name": "::Google::Cloud::ResourceManager::V3::TagValues::Client" + }, + "method": { + "short_name": "ListTagValues", + "full_name": "google.cloud.resourcemanager.v3.TagValues.ListTagValues", + "service": { + "short_name": "TagValues", + "full_name": "google.cloud.resourcemanager.v3.TagValues" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 50, + "type": "FULL" + } + ] + }, + { + "region_tag": "cloudresourcemanager_v3_generated_TagValues_GetTagValue_sync", + "title": "Snippet for the get_tag_value call in the TagValues service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::ResourceManager::V3::TagValues::Client#get_tag_value.", + "file": "tag_values/get_tag_value.rb", + "language": "RUBY", + "client_method": { + "short_name": "get_tag_value", + "full_name": "::Google::Cloud::ResourceManager::V3::TagValues::Client#get_tag_value", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::ResourceManager::V3::GetTagValueRequest", + "name": "request" + } + ], + "result_type": "::Google::Cloud::ResourceManager::V3::TagValue", + "client": { + "short_name": "TagValues::Client", + "full_name": "::Google::Cloud::ResourceManager::V3::TagValues::Client" + }, + "method": { + "short_name": "GetTagValue", + "full_name": "google.cloud.resourcemanager.v3.TagValues.GetTagValue", + "service": { + "short_name": "TagValues", + "full_name": "google.cloud.resourcemanager.v3.TagValues" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 46, + "type": "FULL" + } + ] + }, + { + "region_tag": "cloudresourcemanager_v3_generated_TagValues_GetNamespacedTagValue_sync", + "title": "Snippet for the get_namespaced_tag_value call in the TagValues service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::ResourceManager::V3::TagValues::Client#get_namespaced_tag_value.", + "file": "tag_values/get_namespaced_tag_value.rb", + "language": "RUBY", + "client_method": { + "short_name": "get_namespaced_tag_value", + "full_name": "::Google::Cloud::ResourceManager::V3::TagValues::Client#get_namespaced_tag_value", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::ResourceManager::V3::GetNamespacedTagValueRequest", + "name": "request" + } + ], + "result_type": "::Google::Cloud::ResourceManager::V3::TagValue", + "client": { + "short_name": "TagValues::Client", + "full_name": "::Google::Cloud::ResourceManager::V3::TagValues::Client" + }, + "method": { + "short_name": "GetNamespacedTagValue", + "full_name": "google.cloud.resourcemanager.v3.TagValues.GetNamespacedTagValue", + "service": { + "short_name": "TagValues", + "full_name": "google.cloud.resourcemanager.v3.TagValues" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 46, + "type": "FULL" + } + ] + }, + { + "region_tag": "cloudresourcemanager_v3_generated_TagValues_CreateTagValue_sync", + "title": "Snippet for the create_tag_value call in the TagValues service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::ResourceManager::V3::TagValues::Client#create_tag_value.", + "file": "tag_values/create_tag_value.rb", + "language": "RUBY", + "client_method": { + "short_name": "create_tag_value", + "full_name": "::Google::Cloud::ResourceManager::V3::TagValues::Client#create_tag_value", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::ResourceManager::V3::CreateTagValueRequest", + "name": "request" + } + ], + "result_type": "::Google::Longrunning::Operation", + "client": { + "short_name": "TagValues::Client", + "full_name": "::Google::Cloud::ResourceManager::V3::TagValues::Client" + }, + "method": { + "short_name": "CreateTagValue", + "full_name": "google.cloud.resourcemanager.v3.TagValues.CreateTagValue", + "service": { + "short_name": "TagValues", + "full_name": "google.cloud.resourcemanager.v3.TagValues" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 53, + "type": "FULL" + } + ] + }, + { + "region_tag": "cloudresourcemanager_v3_generated_TagValues_UpdateTagValue_sync", + "title": "Snippet for the update_tag_value call in the TagValues service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::ResourceManager::V3::TagValues::Client#update_tag_value.", + "file": "tag_values/update_tag_value.rb", + "language": "RUBY", + "client_method": { + "short_name": "update_tag_value", + "full_name": "::Google::Cloud::ResourceManager::V3::TagValues::Client#update_tag_value", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::ResourceManager::V3::UpdateTagValueRequest", + "name": "request" + } + ], + "result_type": "::Google::Longrunning::Operation", + "client": { + "short_name": "TagValues::Client", + "full_name": "::Google::Cloud::ResourceManager::V3::TagValues::Client" + }, + "method": { + "short_name": "UpdateTagValue", + "full_name": "google.cloud.resourcemanager.v3.TagValues.UpdateTagValue", + "service": { + "short_name": "TagValues", + "full_name": "google.cloud.resourcemanager.v3.TagValues" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 53, + "type": "FULL" + } + ] + }, + { + "region_tag": "cloudresourcemanager_v3_generated_TagValues_DeleteTagValue_sync", + "title": "Snippet for the delete_tag_value call in the TagValues service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::ResourceManager::V3::TagValues::Client#delete_tag_value.", + "file": "tag_values/delete_tag_value.rb", + "language": "RUBY", + "client_method": { + "short_name": "delete_tag_value", + "full_name": "::Google::Cloud::ResourceManager::V3::TagValues::Client#delete_tag_value", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::ResourceManager::V3::DeleteTagValueRequest", + "name": "request" + } + ], + "result_type": "::Google::Longrunning::Operation", + "client": { + "short_name": "TagValues::Client", + "full_name": "::Google::Cloud::ResourceManager::V3::TagValues::Client" + }, + "method": { + "short_name": "DeleteTagValue", + "full_name": "google.cloud.resourcemanager.v3.TagValues.DeleteTagValue", + "service": { + "short_name": "TagValues", + "full_name": "google.cloud.resourcemanager.v3.TagValues" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 53, + "type": "FULL" + } + ] + }, + { + "region_tag": "cloudresourcemanager_v3_generated_TagValues_GetIamPolicy_sync", + "title": "Snippet for the get_iam_policy call in the TagValues service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::ResourceManager::V3::TagValues::Client#get_iam_policy.", + "file": "tag_values/get_iam_policy.rb", + "language": "RUBY", + "client_method": { + "short_name": "get_iam_policy", + "full_name": "::Google::Cloud::ResourceManager::V3::TagValues::Client#get_iam_policy", + "async": false, + "parameters": [ + { + "type": "::Google::Iam::V1::GetIamPolicyRequest", + "name": "request" + } + ], + "result_type": "::Google::Iam::V1::Policy", + "client": { + "short_name": "TagValues::Client", + "full_name": "::Google::Cloud::ResourceManager::V3::TagValues::Client" + }, + "method": { + "short_name": "GetIamPolicy", + "full_name": "google.cloud.resourcemanager.v3.TagValues.GetIamPolicy", + "service": { + "short_name": "TagValues", + "full_name": "google.cloud.resourcemanager.v3.TagValues" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 46, + "type": "FULL" + } + ] + }, + { + "region_tag": "cloudresourcemanager_v3_generated_TagValues_SetIamPolicy_sync", + "title": "Snippet for the set_iam_policy call in the TagValues service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::ResourceManager::V3::TagValues::Client#set_iam_policy.", + "file": "tag_values/set_iam_policy.rb", + "language": "RUBY", + "client_method": { + "short_name": "set_iam_policy", + "full_name": "::Google::Cloud::ResourceManager::V3::TagValues::Client#set_iam_policy", + "async": false, + "parameters": [ + { + "type": "::Google::Iam::V1::SetIamPolicyRequest", + "name": "request" + } + ], + "result_type": "::Google::Iam::V1::Policy", + "client": { + "short_name": "TagValues::Client", + "full_name": "::Google::Cloud::ResourceManager::V3::TagValues::Client" + }, + "method": { + "short_name": "SetIamPolicy", + "full_name": "google.cloud.resourcemanager.v3.TagValues.SetIamPolicy", + "service": { + "short_name": "TagValues", + "full_name": "google.cloud.resourcemanager.v3.TagValues" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 46, + "type": "FULL" + } + ] + }, + { + "region_tag": "cloudresourcemanager_v3_generated_TagValues_TestIamPermissions_sync", + "title": "Snippet for the test_iam_permissions call in the TagValues service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::ResourceManager::V3::TagValues::Client#test_iam_permissions.", + "file": "tag_values/test_iam_permissions.rb", + "language": "RUBY", + "client_method": { + "short_name": "test_iam_permissions", + "full_name": "::Google::Cloud::ResourceManager::V3::TagValues::Client#test_iam_permissions", + "async": false, + "parameters": [ + { + "type": "::Google::Iam::V1::TestIamPermissionsRequest", + "name": "request" + } + ], + "result_type": "::Google::Iam::V1::TestIamPermissionsResponse", + "client": { + "short_name": "TagValues::Client", + "full_name": "::Google::Cloud::ResourceManager::V3::TagValues::Client" + }, + "method": { + "short_name": "TestIamPermissions", + "full_name": "google.cloud.resourcemanager.v3.TagValues.TestIamPermissions", + "service": { + "short_name": "TagValues", + "full_name": "google.cloud.resourcemanager.v3.TagValues" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 46, + "type": "FULL" + } + ] + } + ] +} \ No newline at end of file diff --git a/owl-bot-staging/google-cloud-resource_manager-v3/snippets/tag_bindings/create_tag_binding.rb b/owl-bot-staging/google-cloud-resource_manager-v3/snippets/tag_bindings/create_tag_binding.rb new file mode 100644 index 000000000000..a1b89b01f010 --- /dev/null +++ b/owl-bot-staging/google-cloud-resource_manager-v3/snippets/tag_bindings/create_tag_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 cloudresourcemanager_v3_generated_TagBindings_CreateTagBinding_sync] +require "google/cloud/resource_manager/v3" + +## +# Snippet for the create_tag_binding call in the TagBindings service +# +# This snippet has been automatically generated and should be regarded as a code +# template only. It will require modifications to work: +# - It may require correct/in-range values for request initialization. +# - It may require specifying regional endpoints when creating the service +# client as shown in https://cloud.google.com/ruby/docs/reference. +# +# This is an auto-generated example demonstrating basic usage of +# Google::Cloud::ResourceManager::V3::TagBindings::Client#create_tag_binding. +# +def create_tag_binding + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::ResourceManager::V3::TagBindings::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::ResourceManager::V3::CreateTagBindingRequest.new + + # Call the create_tag_binding method. + result = client.create_tag_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 cloudresourcemanager_v3_generated_TagBindings_CreateTagBinding_sync] diff --git a/owl-bot-staging/google-cloud-resource_manager-v3/snippets/tag_bindings/delete_tag_binding.rb b/owl-bot-staging/google-cloud-resource_manager-v3/snippets/tag_bindings/delete_tag_binding.rb new file mode 100644 index 000000000000..b7278bc6d63c --- /dev/null +++ b/owl-bot-staging/google-cloud-resource_manager-v3/snippets/tag_bindings/delete_tag_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 cloudresourcemanager_v3_generated_TagBindings_DeleteTagBinding_sync] +require "google/cloud/resource_manager/v3" + +## +# Snippet for the delete_tag_binding call in the TagBindings service +# +# This snippet has been automatically generated and should be regarded as a code +# template only. It will require modifications to work: +# - It may require correct/in-range values for request initialization. +# - It may require specifying regional endpoints when creating the service +# client as shown in https://cloud.google.com/ruby/docs/reference. +# +# This is an auto-generated example demonstrating basic usage of +# Google::Cloud::ResourceManager::V3::TagBindings::Client#delete_tag_binding. +# +def delete_tag_binding + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::ResourceManager::V3::TagBindings::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::ResourceManager::V3::DeleteTagBindingRequest.new + + # Call the delete_tag_binding method. + result = client.delete_tag_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 cloudresourcemanager_v3_generated_TagBindings_DeleteTagBinding_sync] diff --git a/owl-bot-staging/google-cloud-resource_manager-v3/snippets/tag_bindings/list_effective_tags.rb b/owl-bot-staging/google-cloud-resource_manager-v3/snippets/tag_bindings/list_effective_tags.rb new file mode 100644 index 000000000000..c9a1e268616a --- /dev/null +++ b/owl-bot-staging/google-cloud-resource_manager-v3/snippets/tag_bindings/list_effective_tags.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 cloudresourcemanager_v3_generated_TagBindings_ListEffectiveTags_sync] +require "google/cloud/resource_manager/v3" + +## +# Snippet for the list_effective_tags call in the TagBindings service +# +# This snippet has been automatically generated and should be regarded as a code +# template only. It will require modifications to work: +# - It may require correct/in-range values for request initialization. +# - It may require specifying regional endpoints when creating the service +# client as shown in https://cloud.google.com/ruby/docs/reference. +# +# This is an auto-generated example demonstrating basic usage of +# Google::Cloud::ResourceManager::V3::TagBindings::Client#list_effective_tags. +# +def list_effective_tags + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::ResourceManager::V3::TagBindings::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::ResourceManager::V3::ListEffectiveTagsRequest.new + + # Call the list_effective_tags method. + result = client.list_effective_tags request + + # The returned object is of type Gapic::PagedEnumerable. You can iterate + # over elements, and API calls will be issued to fetch pages as needed. + result.each do |item| + # Each element is of type ::Google::Cloud::ResourceManager::V3::EffectiveTag. + p item + end +end +# [END cloudresourcemanager_v3_generated_TagBindings_ListEffectiveTags_sync] diff --git a/owl-bot-staging/google-cloud-resource_manager-v3/snippets/tag_bindings/list_tag_bindings.rb b/owl-bot-staging/google-cloud-resource_manager-v3/snippets/tag_bindings/list_tag_bindings.rb new file mode 100644 index 000000000000..af5a789e0119 --- /dev/null +++ b/owl-bot-staging/google-cloud-resource_manager-v3/snippets/tag_bindings/list_tag_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 cloudresourcemanager_v3_generated_TagBindings_ListTagBindings_sync] +require "google/cloud/resource_manager/v3" + +## +# Snippet for the list_tag_bindings call in the TagBindings service +# +# This snippet has been automatically generated and should be regarded as a code +# template only. It will require modifications to work: +# - It may require correct/in-range values for request initialization. +# - It may require specifying regional endpoints when creating the service +# client as shown in https://cloud.google.com/ruby/docs/reference. +# +# This is an auto-generated example demonstrating basic usage of +# Google::Cloud::ResourceManager::V3::TagBindings::Client#list_tag_bindings. +# +def list_tag_bindings + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::ResourceManager::V3::TagBindings::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::ResourceManager::V3::ListTagBindingsRequest.new + + # Call the list_tag_bindings method. + result = client.list_tag_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::Cloud::ResourceManager::V3::TagBinding. + p item + end +end +# [END cloudresourcemanager_v3_generated_TagBindings_ListTagBindings_sync] diff --git a/owl-bot-staging/google-cloud-resource_manager-v3/snippets/tag_holds/create_tag_hold.rb b/owl-bot-staging/google-cloud-resource_manager-v3/snippets/tag_holds/create_tag_hold.rb new file mode 100644 index 000000000000..bdf4ffb7066d --- /dev/null +++ b/owl-bot-staging/google-cloud-resource_manager-v3/snippets/tag_holds/create_tag_hold.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 cloudresourcemanager_v3_generated_TagHolds_CreateTagHold_sync] +require "google/cloud/resource_manager/v3" + +## +# Snippet for the create_tag_hold call in the TagHolds service +# +# This snippet has been automatically generated and should be regarded as a code +# template only. It will require modifications to work: +# - It may require correct/in-range values for request initialization. +# - It may require specifying regional endpoints when creating the service +# client as shown in https://cloud.google.com/ruby/docs/reference. +# +# This is an auto-generated example demonstrating basic usage of +# Google::Cloud::ResourceManager::V3::TagHolds::Client#create_tag_hold. +# +def create_tag_hold + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::ResourceManager::V3::TagHolds::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::ResourceManager::V3::CreateTagHoldRequest.new + + # Call the create_tag_hold method. + result = client.create_tag_hold 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 cloudresourcemanager_v3_generated_TagHolds_CreateTagHold_sync] diff --git a/owl-bot-staging/google-cloud-resource_manager-v3/snippets/tag_holds/delete_tag_hold.rb b/owl-bot-staging/google-cloud-resource_manager-v3/snippets/tag_holds/delete_tag_hold.rb new file mode 100644 index 000000000000..5690a1fac388 --- /dev/null +++ b/owl-bot-staging/google-cloud-resource_manager-v3/snippets/tag_holds/delete_tag_hold.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 cloudresourcemanager_v3_generated_TagHolds_DeleteTagHold_sync] +require "google/cloud/resource_manager/v3" + +## +# Snippet for the delete_tag_hold call in the TagHolds service +# +# This snippet has been automatically generated and should be regarded as a code +# template only. It will require modifications to work: +# - It may require correct/in-range values for request initialization. +# - It may require specifying regional endpoints when creating the service +# client as shown in https://cloud.google.com/ruby/docs/reference. +# +# This is an auto-generated example demonstrating basic usage of +# Google::Cloud::ResourceManager::V3::TagHolds::Client#delete_tag_hold. +# +def delete_tag_hold + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::ResourceManager::V3::TagHolds::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::ResourceManager::V3::DeleteTagHoldRequest.new + + # Call the delete_tag_hold method. + result = client.delete_tag_hold 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 cloudresourcemanager_v3_generated_TagHolds_DeleteTagHold_sync] diff --git a/owl-bot-staging/google-cloud-resource_manager-v3/snippets/tag_holds/list_tag_holds.rb b/owl-bot-staging/google-cloud-resource_manager-v3/snippets/tag_holds/list_tag_holds.rb new file mode 100644 index 000000000000..b140a6f03956 --- /dev/null +++ b/owl-bot-staging/google-cloud-resource_manager-v3/snippets/tag_holds/list_tag_holds.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 cloudresourcemanager_v3_generated_TagHolds_ListTagHolds_sync] +require "google/cloud/resource_manager/v3" + +## +# Snippet for the list_tag_holds call in the TagHolds service +# +# This snippet has been automatically generated and should be regarded as a code +# template only. It will require modifications to work: +# - It may require correct/in-range values for request initialization. +# - It may require specifying regional endpoints when creating the service +# client as shown in https://cloud.google.com/ruby/docs/reference. +# +# This is an auto-generated example demonstrating basic usage of +# Google::Cloud::ResourceManager::V3::TagHolds::Client#list_tag_holds. +# +def list_tag_holds + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::ResourceManager::V3::TagHolds::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::ResourceManager::V3::ListTagHoldsRequest.new + + # Call the list_tag_holds method. + result = client.list_tag_holds request + + # The returned object is of type Gapic::PagedEnumerable. You can iterate + # over elements, and API calls will be issued to fetch pages as needed. + result.each do |item| + # Each element is of type ::Google::Cloud::ResourceManager::V3::TagHold. + p item + end +end +# [END cloudresourcemanager_v3_generated_TagHolds_ListTagHolds_sync] diff --git a/owl-bot-staging/google-cloud-resource_manager-v3/snippets/tag_keys/create_tag_key.rb b/owl-bot-staging/google-cloud-resource_manager-v3/snippets/tag_keys/create_tag_key.rb new file mode 100644 index 000000000000..2cd527fb10cf --- /dev/null +++ b/owl-bot-staging/google-cloud-resource_manager-v3/snippets/tag_keys/create_tag_key.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 cloudresourcemanager_v3_generated_TagKeys_CreateTagKey_sync] +require "google/cloud/resource_manager/v3" + +## +# Snippet for the create_tag_key call in the TagKeys service +# +# This snippet has been automatically generated and should be regarded as a code +# template only. It will require modifications to work: +# - It may require correct/in-range values for request initialization. +# - It may require specifying regional endpoints when creating the service +# client as shown in https://cloud.google.com/ruby/docs/reference. +# +# This is an auto-generated example demonstrating basic usage of +# Google::Cloud::ResourceManager::V3::TagKeys::Client#create_tag_key. +# +def create_tag_key + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::ResourceManager::V3::TagKeys::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::ResourceManager::V3::CreateTagKeyRequest.new + + # Call the create_tag_key method. + result = client.create_tag_key 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 cloudresourcemanager_v3_generated_TagKeys_CreateTagKey_sync] diff --git a/owl-bot-staging/google-cloud-resource_manager-v3/snippets/tag_keys/delete_tag_key.rb b/owl-bot-staging/google-cloud-resource_manager-v3/snippets/tag_keys/delete_tag_key.rb new file mode 100644 index 000000000000..85f13dc5dbaf --- /dev/null +++ b/owl-bot-staging/google-cloud-resource_manager-v3/snippets/tag_keys/delete_tag_key.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 cloudresourcemanager_v3_generated_TagKeys_DeleteTagKey_sync] +require "google/cloud/resource_manager/v3" + +## +# Snippet for the delete_tag_key call in the TagKeys service +# +# This snippet has been automatically generated and should be regarded as a code +# template only. It will require modifications to work: +# - It may require correct/in-range values for request initialization. +# - It may require specifying regional endpoints when creating the service +# client as shown in https://cloud.google.com/ruby/docs/reference. +# +# This is an auto-generated example demonstrating basic usage of +# Google::Cloud::ResourceManager::V3::TagKeys::Client#delete_tag_key. +# +def delete_tag_key + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::ResourceManager::V3::TagKeys::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::ResourceManager::V3::DeleteTagKeyRequest.new + + # Call the delete_tag_key method. + result = client.delete_tag_key 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 cloudresourcemanager_v3_generated_TagKeys_DeleteTagKey_sync] diff --git a/owl-bot-staging/google-cloud-resource_manager-v3/snippets/tag_keys/get_iam_policy.rb b/owl-bot-staging/google-cloud-resource_manager-v3/snippets/tag_keys/get_iam_policy.rb new file mode 100644 index 000000000000..0029b84faabd --- /dev/null +++ b/owl-bot-staging/google-cloud-resource_manager-v3/snippets/tag_keys/get_iam_policy.rb @@ -0,0 +1,47 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +# [START cloudresourcemanager_v3_generated_TagKeys_GetIamPolicy_sync] +require "google/cloud/resource_manager/v3" + +## +# Snippet for the get_iam_policy call in the TagKeys service +# +# This snippet has been automatically generated and should be regarded as a code +# template only. It will require modifications to work: +# - It may require correct/in-range values for request initialization. +# - It may require specifying regional endpoints when creating the service +# client as shown in https://cloud.google.com/ruby/docs/reference. +# +# This is an auto-generated example demonstrating basic usage of +# Google::Cloud::ResourceManager::V3::TagKeys::Client#get_iam_policy. +# +def get_iam_policy + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::ResourceManager::V3::TagKeys::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Iam::V1::GetIamPolicyRequest.new + + # Call the get_iam_policy method. + result = client.get_iam_policy request + + # The returned object is of type Google::Iam::V1::Policy. + p result +end +# [END cloudresourcemanager_v3_generated_TagKeys_GetIamPolicy_sync] diff --git a/owl-bot-staging/google-cloud-resource_manager-v3/snippets/tag_keys/get_namespaced_tag_key.rb b/owl-bot-staging/google-cloud-resource_manager-v3/snippets/tag_keys/get_namespaced_tag_key.rb new file mode 100644 index 000000000000..ec354144b777 --- /dev/null +++ b/owl-bot-staging/google-cloud-resource_manager-v3/snippets/tag_keys/get_namespaced_tag_key.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 cloudresourcemanager_v3_generated_TagKeys_GetNamespacedTagKey_sync] +require "google/cloud/resource_manager/v3" + +## +# Snippet for the get_namespaced_tag_key call in the TagKeys service +# +# This snippet has been automatically generated and should be regarded as a code +# template only. It will require modifications to work: +# - It may require correct/in-range values for request initialization. +# - It may require specifying regional endpoints when creating the service +# client as shown in https://cloud.google.com/ruby/docs/reference. +# +# This is an auto-generated example demonstrating basic usage of +# Google::Cloud::ResourceManager::V3::TagKeys::Client#get_namespaced_tag_key. +# +def get_namespaced_tag_key + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::ResourceManager::V3::TagKeys::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::ResourceManager::V3::GetNamespacedTagKeyRequest.new + + # Call the get_namespaced_tag_key method. + result = client.get_namespaced_tag_key request + + # The returned object is of type Google::Cloud::ResourceManager::V3::TagKey. + p result +end +# [END cloudresourcemanager_v3_generated_TagKeys_GetNamespacedTagKey_sync] diff --git a/owl-bot-staging/google-cloud-resource_manager-v3/snippets/tag_keys/get_tag_key.rb b/owl-bot-staging/google-cloud-resource_manager-v3/snippets/tag_keys/get_tag_key.rb new file mode 100644 index 000000000000..2657cb43dd01 --- /dev/null +++ b/owl-bot-staging/google-cloud-resource_manager-v3/snippets/tag_keys/get_tag_key.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 cloudresourcemanager_v3_generated_TagKeys_GetTagKey_sync] +require "google/cloud/resource_manager/v3" + +## +# Snippet for the get_tag_key call in the TagKeys service +# +# This snippet has been automatically generated and should be regarded as a code +# template only. It will require modifications to work: +# - It may require correct/in-range values for request initialization. +# - It may require specifying regional endpoints when creating the service +# client as shown in https://cloud.google.com/ruby/docs/reference. +# +# This is an auto-generated example demonstrating basic usage of +# Google::Cloud::ResourceManager::V3::TagKeys::Client#get_tag_key. +# +def get_tag_key + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::ResourceManager::V3::TagKeys::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::ResourceManager::V3::GetTagKeyRequest.new + + # Call the get_tag_key method. + result = client.get_tag_key request + + # The returned object is of type Google::Cloud::ResourceManager::V3::TagKey. + p result +end +# [END cloudresourcemanager_v3_generated_TagKeys_GetTagKey_sync] diff --git a/owl-bot-staging/google-cloud-resource_manager-v3/snippets/tag_keys/list_tag_keys.rb b/owl-bot-staging/google-cloud-resource_manager-v3/snippets/tag_keys/list_tag_keys.rb new file mode 100644 index 000000000000..1b5b6da36dc5 --- /dev/null +++ b/owl-bot-staging/google-cloud-resource_manager-v3/snippets/tag_keys/list_tag_keys.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 cloudresourcemanager_v3_generated_TagKeys_ListTagKeys_sync] +require "google/cloud/resource_manager/v3" + +## +# Snippet for the list_tag_keys call in the TagKeys service +# +# This snippet has been automatically generated and should be regarded as a code +# template only. It will require modifications to work: +# - It may require correct/in-range values for request initialization. +# - It may require specifying regional endpoints when creating the service +# client as shown in https://cloud.google.com/ruby/docs/reference. +# +# This is an auto-generated example demonstrating basic usage of +# Google::Cloud::ResourceManager::V3::TagKeys::Client#list_tag_keys. +# +def list_tag_keys + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::ResourceManager::V3::TagKeys::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::ResourceManager::V3::ListTagKeysRequest.new + + # Call the list_tag_keys method. + result = client.list_tag_keys request + + # The returned object is of type Gapic::PagedEnumerable. You can iterate + # over elements, and API calls will be issued to fetch pages as needed. + result.each do |item| + # Each element is of type ::Google::Cloud::ResourceManager::V3::TagKey. + p item + end +end +# [END cloudresourcemanager_v3_generated_TagKeys_ListTagKeys_sync] diff --git a/owl-bot-staging/google-cloud-resource_manager-v3/snippets/tag_keys/set_iam_policy.rb b/owl-bot-staging/google-cloud-resource_manager-v3/snippets/tag_keys/set_iam_policy.rb new file mode 100644 index 000000000000..5095a2df35a5 --- /dev/null +++ b/owl-bot-staging/google-cloud-resource_manager-v3/snippets/tag_keys/set_iam_policy.rb @@ -0,0 +1,47 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +# [START cloudresourcemanager_v3_generated_TagKeys_SetIamPolicy_sync] +require "google/cloud/resource_manager/v3" + +## +# Snippet for the set_iam_policy call in the TagKeys service +# +# This snippet has been automatically generated and should be regarded as a code +# template only. It will require modifications to work: +# - It may require correct/in-range values for request initialization. +# - It may require specifying regional endpoints when creating the service +# client as shown in https://cloud.google.com/ruby/docs/reference. +# +# This is an auto-generated example demonstrating basic usage of +# Google::Cloud::ResourceManager::V3::TagKeys::Client#set_iam_policy. +# +def set_iam_policy + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::ResourceManager::V3::TagKeys::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Iam::V1::SetIamPolicyRequest.new + + # Call the set_iam_policy method. + result = client.set_iam_policy request + + # The returned object is of type Google::Iam::V1::Policy. + p result +end +# [END cloudresourcemanager_v3_generated_TagKeys_SetIamPolicy_sync] diff --git a/owl-bot-staging/google-cloud-resource_manager-v3/snippets/tag_keys/test_iam_permissions.rb b/owl-bot-staging/google-cloud-resource_manager-v3/snippets/tag_keys/test_iam_permissions.rb new file mode 100644 index 000000000000..2165b1a22ce5 --- /dev/null +++ b/owl-bot-staging/google-cloud-resource_manager-v3/snippets/tag_keys/test_iam_permissions.rb @@ -0,0 +1,47 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +# [START cloudresourcemanager_v3_generated_TagKeys_TestIamPermissions_sync] +require "google/cloud/resource_manager/v3" + +## +# Snippet for the test_iam_permissions call in the TagKeys service +# +# This snippet has been automatically generated and should be regarded as a code +# template only. It will require modifications to work: +# - It may require correct/in-range values for request initialization. +# - It may require specifying regional endpoints when creating the service +# client as shown in https://cloud.google.com/ruby/docs/reference. +# +# This is an auto-generated example demonstrating basic usage of +# Google::Cloud::ResourceManager::V3::TagKeys::Client#test_iam_permissions. +# +def test_iam_permissions + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::ResourceManager::V3::TagKeys::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Iam::V1::TestIamPermissionsRequest.new + + # Call the test_iam_permissions method. + result = client.test_iam_permissions request + + # The returned object is of type Google::Iam::V1::TestIamPermissionsResponse. + p result +end +# [END cloudresourcemanager_v3_generated_TagKeys_TestIamPermissions_sync] diff --git a/owl-bot-staging/google-cloud-resource_manager-v3/snippets/tag_keys/update_tag_key.rb b/owl-bot-staging/google-cloud-resource_manager-v3/snippets/tag_keys/update_tag_key.rb new file mode 100644 index 000000000000..9d7650953889 --- /dev/null +++ b/owl-bot-staging/google-cloud-resource_manager-v3/snippets/tag_keys/update_tag_key.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 cloudresourcemanager_v3_generated_TagKeys_UpdateTagKey_sync] +require "google/cloud/resource_manager/v3" + +## +# Snippet for the update_tag_key call in the TagKeys service +# +# This snippet has been automatically generated and should be regarded as a code +# template only. It will require modifications to work: +# - It may require correct/in-range values for request initialization. +# - It may require specifying regional endpoints when creating the service +# client as shown in https://cloud.google.com/ruby/docs/reference. +# +# This is an auto-generated example demonstrating basic usage of +# Google::Cloud::ResourceManager::V3::TagKeys::Client#update_tag_key. +# +def update_tag_key + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::ResourceManager::V3::TagKeys::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::ResourceManager::V3::UpdateTagKeyRequest.new + + # Call the update_tag_key method. + result = client.update_tag_key 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 cloudresourcemanager_v3_generated_TagKeys_UpdateTagKey_sync] diff --git a/owl-bot-staging/google-cloud-resource_manager-v3/snippets/tag_values/create_tag_value.rb b/owl-bot-staging/google-cloud-resource_manager-v3/snippets/tag_values/create_tag_value.rb new file mode 100644 index 000000000000..943ab348b4ba --- /dev/null +++ b/owl-bot-staging/google-cloud-resource_manager-v3/snippets/tag_values/create_tag_value.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 cloudresourcemanager_v3_generated_TagValues_CreateTagValue_sync] +require "google/cloud/resource_manager/v3" + +## +# Snippet for the create_tag_value call in the TagValues service +# +# This snippet has been automatically generated and should be regarded as a code +# template only. It will require modifications to work: +# - It may require correct/in-range values for request initialization. +# - It may require specifying regional endpoints when creating the service +# client as shown in https://cloud.google.com/ruby/docs/reference. +# +# This is an auto-generated example demonstrating basic usage of +# Google::Cloud::ResourceManager::V3::TagValues::Client#create_tag_value. +# +def create_tag_value + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::ResourceManager::V3::TagValues::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::ResourceManager::V3::CreateTagValueRequest.new + + # Call the create_tag_value method. + result = client.create_tag_value 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 cloudresourcemanager_v3_generated_TagValues_CreateTagValue_sync] diff --git a/owl-bot-staging/google-cloud-resource_manager-v3/snippets/tag_values/delete_tag_value.rb b/owl-bot-staging/google-cloud-resource_manager-v3/snippets/tag_values/delete_tag_value.rb new file mode 100644 index 000000000000..75dc92373be8 --- /dev/null +++ b/owl-bot-staging/google-cloud-resource_manager-v3/snippets/tag_values/delete_tag_value.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 cloudresourcemanager_v3_generated_TagValues_DeleteTagValue_sync] +require "google/cloud/resource_manager/v3" + +## +# Snippet for the delete_tag_value call in the TagValues service +# +# This snippet has been automatically generated and should be regarded as a code +# template only. It will require modifications to work: +# - It may require correct/in-range values for request initialization. +# - It may require specifying regional endpoints when creating the service +# client as shown in https://cloud.google.com/ruby/docs/reference. +# +# This is an auto-generated example demonstrating basic usage of +# Google::Cloud::ResourceManager::V3::TagValues::Client#delete_tag_value. +# +def delete_tag_value + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::ResourceManager::V3::TagValues::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::ResourceManager::V3::DeleteTagValueRequest.new + + # Call the delete_tag_value method. + result = client.delete_tag_value 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 cloudresourcemanager_v3_generated_TagValues_DeleteTagValue_sync] diff --git a/owl-bot-staging/google-cloud-resource_manager-v3/snippets/tag_values/get_iam_policy.rb b/owl-bot-staging/google-cloud-resource_manager-v3/snippets/tag_values/get_iam_policy.rb new file mode 100644 index 000000000000..ae6682790f3a --- /dev/null +++ b/owl-bot-staging/google-cloud-resource_manager-v3/snippets/tag_values/get_iam_policy.rb @@ -0,0 +1,47 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +# [START cloudresourcemanager_v3_generated_TagValues_GetIamPolicy_sync] +require "google/cloud/resource_manager/v3" + +## +# Snippet for the get_iam_policy call in the TagValues service +# +# This snippet has been automatically generated and should be regarded as a code +# template only. It will require modifications to work: +# - It may require correct/in-range values for request initialization. +# - It may require specifying regional endpoints when creating the service +# client as shown in https://cloud.google.com/ruby/docs/reference. +# +# This is an auto-generated example demonstrating basic usage of +# Google::Cloud::ResourceManager::V3::TagValues::Client#get_iam_policy. +# +def get_iam_policy + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::ResourceManager::V3::TagValues::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Iam::V1::GetIamPolicyRequest.new + + # Call the get_iam_policy method. + result = client.get_iam_policy request + + # The returned object is of type Google::Iam::V1::Policy. + p result +end +# [END cloudresourcemanager_v3_generated_TagValues_GetIamPolicy_sync] diff --git a/owl-bot-staging/google-cloud-resource_manager-v3/snippets/tag_values/get_namespaced_tag_value.rb b/owl-bot-staging/google-cloud-resource_manager-v3/snippets/tag_values/get_namespaced_tag_value.rb new file mode 100644 index 000000000000..68c0d13e6dc2 --- /dev/null +++ b/owl-bot-staging/google-cloud-resource_manager-v3/snippets/tag_values/get_namespaced_tag_value.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 cloudresourcemanager_v3_generated_TagValues_GetNamespacedTagValue_sync] +require "google/cloud/resource_manager/v3" + +## +# Snippet for the get_namespaced_tag_value call in the TagValues service +# +# This snippet has been automatically generated and should be regarded as a code +# template only. It will require modifications to work: +# - It may require correct/in-range values for request initialization. +# - It may require specifying regional endpoints when creating the service +# client as shown in https://cloud.google.com/ruby/docs/reference. +# +# This is an auto-generated example demonstrating basic usage of +# Google::Cloud::ResourceManager::V3::TagValues::Client#get_namespaced_tag_value. +# +def get_namespaced_tag_value + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::ResourceManager::V3::TagValues::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::ResourceManager::V3::GetNamespacedTagValueRequest.new + + # Call the get_namespaced_tag_value method. + result = client.get_namespaced_tag_value request + + # The returned object is of type Google::Cloud::ResourceManager::V3::TagValue. + p result +end +# [END cloudresourcemanager_v3_generated_TagValues_GetNamespacedTagValue_sync] diff --git a/owl-bot-staging/google-cloud-resource_manager-v3/snippets/tag_values/get_tag_value.rb b/owl-bot-staging/google-cloud-resource_manager-v3/snippets/tag_values/get_tag_value.rb new file mode 100644 index 000000000000..55347ce706cd --- /dev/null +++ b/owl-bot-staging/google-cloud-resource_manager-v3/snippets/tag_values/get_tag_value.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 cloudresourcemanager_v3_generated_TagValues_GetTagValue_sync] +require "google/cloud/resource_manager/v3" + +## +# Snippet for the get_tag_value call in the TagValues service +# +# This snippet has been automatically generated and should be regarded as a code +# template only. It will require modifications to work: +# - It may require correct/in-range values for request initialization. +# - It may require specifying regional endpoints when creating the service +# client as shown in https://cloud.google.com/ruby/docs/reference. +# +# This is an auto-generated example demonstrating basic usage of +# Google::Cloud::ResourceManager::V3::TagValues::Client#get_tag_value. +# +def get_tag_value + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::ResourceManager::V3::TagValues::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::ResourceManager::V3::GetTagValueRequest.new + + # Call the get_tag_value method. + result = client.get_tag_value request + + # The returned object is of type Google::Cloud::ResourceManager::V3::TagValue. + p result +end +# [END cloudresourcemanager_v3_generated_TagValues_GetTagValue_sync] diff --git a/owl-bot-staging/google-cloud-resource_manager-v3/snippets/tag_values/list_tag_values.rb b/owl-bot-staging/google-cloud-resource_manager-v3/snippets/tag_values/list_tag_values.rb new file mode 100644 index 000000000000..c8c99a2abaa2 --- /dev/null +++ b/owl-bot-staging/google-cloud-resource_manager-v3/snippets/tag_values/list_tag_values.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 cloudresourcemanager_v3_generated_TagValues_ListTagValues_sync] +require "google/cloud/resource_manager/v3" + +## +# Snippet for the list_tag_values call in the TagValues service +# +# This snippet has been automatically generated and should be regarded as a code +# template only. It will require modifications to work: +# - It may require correct/in-range values for request initialization. +# - It may require specifying regional endpoints when creating the service +# client as shown in https://cloud.google.com/ruby/docs/reference. +# +# This is an auto-generated example demonstrating basic usage of +# Google::Cloud::ResourceManager::V3::TagValues::Client#list_tag_values. +# +def list_tag_values + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::ResourceManager::V3::TagValues::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::ResourceManager::V3::ListTagValuesRequest.new + + # Call the list_tag_values method. + result = client.list_tag_values request + + # The returned object is of type Gapic::PagedEnumerable. You can iterate + # over elements, and API calls will be issued to fetch pages as needed. + result.each do |item| + # Each element is of type ::Google::Cloud::ResourceManager::V3::TagValue. + p item + end +end +# [END cloudresourcemanager_v3_generated_TagValues_ListTagValues_sync] diff --git a/owl-bot-staging/google-cloud-resource_manager-v3/snippets/tag_values/set_iam_policy.rb b/owl-bot-staging/google-cloud-resource_manager-v3/snippets/tag_values/set_iam_policy.rb new file mode 100644 index 000000000000..c9c9a74edabe --- /dev/null +++ b/owl-bot-staging/google-cloud-resource_manager-v3/snippets/tag_values/set_iam_policy.rb @@ -0,0 +1,47 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +# [START cloudresourcemanager_v3_generated_TagValues_SetIamPolicy_sync] +require "google/cloud/resource_manager/v3" + +## +# Snippet for the set_iam_policy call in the TagValues service +# +# This snippet has been automatically generated and should be regarded as a code +# template only. It will require modifications to work: +# - It may require correct/in-range values for request initialization. +# - It may require specifying regional endpoints when creating the service +# client as shown in https://cloud.google.com/ruby/docs/reference. +# +# This is an auto-generated example demonstrating basic usage of +# Google::Cloud::ResourceManager::V3::TagValues::Client#set_iam_policy. +# +def set_iam_policy + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::ResourceManager::V3::TagValues::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Iam::V1::SetIamPolicyRequest.new + + # Call the set_iam_policy method. + result = client.set_iam_policy request + + # The returned object is of type Google::Iam::V1::Policy. + p result +end +# [END cloudresourcemanager_v3_generated_TagValues_SetIamPolicy_sync] diff --git a/owl-bot-staging/google-cloud-resource_manager-v3/snippets/tag_values/test_iam_permissions.rb b/owl-bot-staging/google-cloud-resource_manager-v3/snippets/tag_values/test_iam_permissions.rb new file mode 100644 index 000000000000..92c9f8ebde65 --- /dev/null +++ b/owl-bot-staging/google-cloud-resource_manager-v3/snippets/tag_values/test_iam_permissions.rb @@ -0,0 +1,47 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +# [START cloudresourcemanager_v3_generated_TagValues_TestIamPermissions_sync] +require "google/cloud/resource_manager/v3" + +## +# Snippet for the test_iam_permissions call in the TagValues service +# +# This snippet has been automatically generated and should be regarded as a code +# template only. It will require modifications to work: +# - It may require correct/in-range values for request initialization. +# - It may require specifying regional endpoints when creating the service +# client as shown in https://cloud.google.com/ruby/docs/reference. +# +# This is an auto-generated example demonstrating basic usage of +# Google::Cloud::ResourceManager::V3::TagValues::Client#test_iam_permissions. +# +def test_iam_permissions + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::ResourceManager::V3::TagValues::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Iam::V1::TestIamPermissionsRequest.new + + # Call the test_iam_permissions method. + result = client.test_iam_permissions request + + # The returned object is of type Google::Iam::V1::TestIamPermissionsResponse. + p result +end +# [END cloudresourcemanager_v3_generated_TagValues_TestIamPermissions_sync] diff --git a/owl-bot-staging/google-cloud-resource_manager-v3/snippets/tag_values/update_tag_value.rb b/owl-bot-staging/google-cloud-resource_manager-v3/snippets/tag_values/update_tag_value.rb new file mode 100644 index 000000000000..1fa003855844 --- /dev/null +++ b/owl-bot-staging/google-cloud-resource_manager-v3/snippets/tag_values/update_tag_value.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 cloudresourcemanager_v3_generated_TagValues_UpdateTagValue_sync] +require "google/cloud/resource_manager/v3" + +## +# Snippet for the update_tag_value call in the TagValues service +# +# This snippet has been automatically generated and should be regarded as a code +# template only. It will require modifications to work: +# - It may require correct/in-range values for request initialization. +# - It may require specifying regional endpoints when creating the service +# client as shown in https://cloud.google.com/ruby/docs/reference. +# +# This is an auto-generated example demonstrating basic usage of +# Google::Cloud::ResourceManager::V3::TagValues::Client#update_tag_value. +# +def update_tag_value + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::ResourceManager::V3::TagValues::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::ResourceManager::V3::UpdateTagValueRequest.new + + # Call the update_tag_value method. + result = client.update_tag_value 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 cloudresourcemanager_v3_generated_TagValues_UpdateTagValue_sync] diff --git a/owl-bot-staging/google-cloud-resource_manager-v3/test/google/cloud/resource_manager/v3/folders_operations_test.rb b/owl-bot-staging/google-cloud-resource_manager-v3/test/google/cloud/resource_manager/v3/folders_operations_test.rb new file mode 100644 index 000000000000..a6024a1e4623 --- /dev/null +++ b/owl-bot-staging/google-cloud-resource_manager-v3/test/google/cloud/resource_manager/v3/folders_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/cloud/resourcemanager/v3/folders_pb" +require "google/cloud/resourcemanager/v3/folders_services_pb" +require "google/cloud/resource_manager/v3/folders" + +class ::Google::Cloud::ResourceManager::V3::Folders::OperationsTest < Minitest::Test + class ClientStub + attr_accessor :call_rpc_count, :requests + + def initialize response, operation, &block + @response = response + @operation = operation + @block = block + @call_rpc_count = 0 + @requests = [] + end + + def call_rpc *args, **kwargs + @call_rpc_count += 1 + + @requests << @block&.call(*args, **kwargs) + + catch :response do + yield @response, @operation if block_given? + @response + end + end + + def endpoint + "endpoint.example.com" + end + + def universe_domain + "example.com" + end + + def stub_logger + nil + end + + def logger + nil + end + end + + def test_list_operations + # Create GRPC objects. + grpc_response = ::Google::Longrunning::ListOperationsResponse.new + grpc_operation = GRPC::ActiveCall::Operation.new nil + grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + grpc_options = {} + + # Create request parameters for a unary method. + name = "hello world" + filter = "hello world" + page_size = 42 + page_token = "hello world" + return_partial_success = true + + list_operations_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :list_operations, name + assert_kind_of ::Google::Longrunning::ListOperationsRequest, request + assert_equal "hello world", request["name"] + assert_equal "hello world", request["filter"] + assert_equal 42, request["page_size"] + assert_equal "hello world", request["page_token"] + assert_equal true, request["return_partial_success"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, list_operations_client_stub do + # Create client + client = ::Google::Cloud::ResourceManager::V3::Folders::Operations.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.list_operations({ name: name, filter: filter, page_size: page_size, page_token: page_token, return_partial_success: return_partial_success }) do |response, operation| + assert_kind_of Gapic::PagedEnumerable, response + assert_equal grpc_response, response.response + assert_equal grpc_operation, operation + end + + # Use named arguments + client.list_operations name: name, filter: filter, page_size: page_size, page_token: page_token, return_partial_success: return_partial_success do |response, operation| + assert_kind_of Gapic::PagedEnumerable, response + assert_equal grpc_response, response.response + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.list_operations ::Google::Longrunning::ListOperationsRequest.new(name: name, filter: filter, page_size: page_size, page_token: page_token, return_partial_success: return_partial_success) do |response, operation| + assert_kind_of Gapic::PagedEnumerable, response + assert_equal grpc_response, response.response + assert_equal grpc_operation, operation + end + + # Use hash object with options + client.list_operations({ name: name, filter: filter, page_size: page_size, page_token: page_token, return_partial_success: return_partial_success }, grpc_options) do |response, operation| + assert_kind_of Gapic::PagedEnumerable, response + assert_equal grpc_response, response.response + assert_equal grpc_operation, operation + end + + # Use protobuf object with options + client.list_operations(::Google::Longrunning::ListOperationsRequest.new(name: name, filter: filter, page_size: page_size, page_token: page_token, return_partial_success: return_partial_success), grpc_options) do |response, operation| + assert_kind_of Gapic::PagedEnumerable, response + assert_equal grpc_response, response.response + assert_equal grpc_operation, operation + end + + # Verify method calls + assert_equal 5, list_operations_client_stub.call_rpc_count + end + end + + def test_get_operation + # Create GRPC objects. + grpc_response = ::Google::Longrunning::Operation.new + grpc_operation = GRPC::ActiveCall::Operation.new nil + grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + grpc_options = {} + + # Create request parameters for a unary method. + name = "hello world" + + get_operation_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :get_operation, name + assert_kind_of ::Google::Longrunning::GetOperationRequest, request + assert_equal "hello world", request["name"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, get_operation_client_stub do + # Create client + client = ::Google::Cloud::ResourceManager::V3::Folders::Operations.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.get_operation({ name: name }) do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Use named arguments + client.get_operation name: name do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.get_operation ::Google::Longrunning::GetOperationRequest.new(name: name) do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Use hash object with options + client.get_operation({ name: name }, grpc_options) do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Use protobuf object with options + client.get_operation(::Google::Longrunning::GetOperationRequest.new(name: name), grpc_options) do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Verify method calls + assert_equal 5, get_operation_client_stub.call_rpc_count + end + end + + def test_delete_operation + # Create GRPC objects. + grpc_response = ::Google::Protobuf::Empty.new + grpc_operation = GRPC::ActiveCall::Operation.new nil + grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + grpc_options = {} + + # Create request parameters for a unary method. + name = "hello world" + + delete_operation_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :delete_operation, name + assert_kind_of ::Google::Longrunning::DeleteOperationRequest, request + assert_equal "hello world", request["name"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, delete_operation_client_stub do + # Create client + client = ::Google::Cloud::ResourceManager::V3::Folders::Operations.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.delete_operation({ name: name }) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use named arguments + client.delete_operation name: name do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.delete_operation ::Google::Longrunning::DeleteOperationRequest.new(name: name) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use hash object with options + client.delete_operation({ name: name }, grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object with options + client.delete_operation(::Google::Longrunning::DeleteOperationRequest.new(name: name), grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Verify method calls + assert_equal 5, delete_operation_client_stub.call_rpc_count + end + end + + def test_cancel_operation + # Create GRPC objects. + grpc_response = ::Google::Protobuf::Empty.new + grpc_operation = GRPC::ActiveCall::Operation.new nil + grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + grpc_options = {} + + # Create request parameters for a unary method. + name = "hello world" + + cancel_operation_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :cancel_operation, name + assert_kind_of ::Google::Longrunning::CancelOperationRequest, request + assert_equal "hello world", request["name"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, cancel_operation_client_stub do + # Create client + client = ::Google::Cloud::ResourceManager::V3::Folders::Operations.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.cancel_operation({ name: name }) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use named arguments + client.cancel_operation name: name do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.cancel_operation ::Google::Longrunning::CancelOperationRequest.new(name: name) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use hash object with options + client.cancel_operation({ name: name }, grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object with options + client.cancel_operation(::Google::Longrunning::CancelOperationRequest.new(name: name), grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Verify method calls + assert_equal 5, cancel_operation_client_stub.call_rpc_count + end + end + + def test_wait_operation + # Create GRPC objects. + grpc_response = ::Google::Longrunning::Operation.new + grpc_operation = GRPC::ActiveCall::Operation.new nil + grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + grpc_options = {} + + # Create request parameters for a unary method. + name = "hello world" + timeout = {} + + wait_operation_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :wait_operation, name + assert_kind_of ::Google::Longrunning::WaitOperationRequest, request + assert_equal "hello world", request["name"] + assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Protobuf::Duration), request["timeout"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, wait_operation_client_stub do + # Create client + client = ::Google::Cloud::ResourceManager::V3::Folders::Operations.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.wait_operation({ name: name, timeout: timeout }) do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Use named arguments + client.wait_operation name: name, timeout: timeout do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.wait_operation ::Google::Longrunning::WaitOperationRequest.new(name: name, timeout: timeout) do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Use hash object with options + client.wait_operation({ name: name, timeout: timeout }, grpc_options) do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Use protobuf object with options + client.wait_operation(::Google::Longrunning::WaitOperationRequest.new(name: name, timeout: timeout), grpc_options) do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Verify method calls + assert_equal 5, wait_operation_client_stub.call_rpc_count + end + end + + def test_configure + grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + + client = block_config = config = nil + dummy_stub = ClientStub.new nil, nil + Gapic::ServiceStub.stub :new, dummy_stub do + client = ::Google::Cloud::ResourceManager::V3::Folders::Operations.new do |config| + config.credentials = grpc_channel + end + end + + config = client.configure do |c| + block_config = c + end + + assert_same block_config, config + assert_kind_of ::Google::Cloud::ResourceManager::V3::Folders::Operations::Configuration, config + end +end diff --git a/owl-bot-staging/google-cloud-resource_manager-v3/test/google/cloud/resource_manager/v3/folders_paths_test.rb b/owl-bot-staging/google-cloud-resource_manager-v3/test/google/cloud/resource_manager/v3/folders_paths_test.rb new file mode 100644 index 000000000000..d9004604858b --- /dev/null +++ b/owl-bot-staging/google-cloud-resource_manager-v3/test/google/cloud/resource_manager/v3/folders_paths_test.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 "helper" + +require "gapic/grpc/service_stub" + +require "google/cloud/resource_manager/v3/folders" + +class ::Google::Cloud::ResourceManager::V3::Folders::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_path + grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + ::Gapic::ServiceStub.stub :new, DummyStub.new do + client = ::Google::Cloud::ResourceManager::V3::Folders::Client.new do |config| + config.credentials = grpc_channel + end + + path = client.folder_path folder: "value0" + assert_equal "folders/value0", path + end + end +end diff --git a/owl-bot-staging/google-cloud-resource_manager-v3/test/google/cloud/resource_manager/v3/folders_rest_test.rb b/owl-bot-staging/google-cloud-resource_manager-v3/test/google/cloud/resource_manager/v3/folders_rest_test.rb new file mode 100644 index 000000000000..30a2816a99b1 --- /dev/null +++ b/owl-bot-staging/google-cloud-resource_manager-v3/test/google/cloud/resource_manager/v3/folders_rest_test.rb @@ -0,0 +1,704 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +require "helper" +require "gapic/rest" +require "google/cloud/resourcemanager/v3/folders_pb" +require "google/cloud/resource_manager/v3/folders/rest" + + +class ::Google::Cloud::ResourceManager::V3::Folders::Rest::ClientTest < Minitest::Test + class ClientStub + attr_accessor :call_count, :requests + + def initialize response, &block + @response = response + @block = block + @call_count = 0 + @requests = [] + end + + def make_get_request uri:, params: {}, options: {}, method_name: nil + make_http_request :get, uri: uri, body: nil, params: params, options: options, method_name: method_name + end + + def make_delete_request uri:, params: {}, options: {}, method_name: nil + make_http_request :delete, uri: uri, body: nil, params: params, options: options, method_name: method_name + end + + def make_post_request uri:, body: nil, params: {}, options: {}, method_name: nil + make_http_request :post, uri: uri, body: body, params: params, options: options, method_name: method_name + end + + def make_patch_request uri:, body:, params: {}, options: {}, method_name: nil + make_http_request :patch, uri: uri, body: body, params: params, options: options, method_name: method_name + end + + def make_put_request uri:, body:, params: {}, options: {}, method_name: nil + make_http_request :put, uri: uri, body: body, params: params, options: options, method_name: method_name + end + + def make_http_request *args, **kwargs + @call_count += 1 + + @requests << @block&.call(*args, **kwargs) + + @response + end + + def endpoint + "endpoint.example.com" + end + + def universe_domain + "example.com" + end + + def stub_logger + nil + end + + def logger + nil + end + end + + def test_get_folder + # Create test objects. + client_result = ::Google::Cloud::ResourceManager::V3::Folder.new + http_response = OpenStruct.new body: client_result.to_json + + call_options = {} + + # Create request parameters for a unary method. + name = "hello world" + + get_folder_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| + assert options.metadata.key? :"x-goog-api-client" + assert options.metadata[:"x-goog-api-client"].include? "rest" + refute options.metadata[:"x-goog-api-client"].include? "grpc" + end + + ::Google::Cloud::ResourceManager::V3::Folders::Rest::ServiceStub.stub :transcode_get_folder_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, get_folder_client_stub do + # Create client + client = ::Google::Cloud::ResourceManager::V3::Folders::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.get_folder({ name: name }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.get_folder name: name do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.get_folder ::Google::Cloud::ResourceManager::V3::GetFolderRequest.new(name: name) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + client.get_folder({ name: name }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + client.get_folder(::Google::Cloud::ResourceManager::V3::GetFolderRequest.new(name: name), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, get_folder_client_stub.call_count + end + end + end + + def test_list_folders + # Create test objects. + client_result = ::Google::Cloud::ResourceManager::V3::ListFoldersResponse.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" + show_deleted = true + + list_folders_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| + assert options.metadata.key? :"x-goog-api-client" + assert options.metadata[:"x-goog-api-client"].include? "rest" + refute options.metadata[:"x-goog-api-client"].include? "grpc" + end + + ::Google::Cloud::ResourceManager::V3::Folders::Rest::ServiceStub.stub :transcode_list_folders_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, list_folders_client_stub do + # Create client + client = ::Google::Cloud::ResourceManager::V3::Folders::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.list_folders({ parent: parent, page_size: page_size, page_token: page_token, show_deleted: show_deleted }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.list_folders parent: parent, page_size: page_size, page_token: page_token, show_deleted: show_deleted do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.list_folders ::Google::Cloud::ResourceManager::V3::ListFoldersRequest.new(parent: parent, page_size: page_size, page_token: page_token, show_deleted: show_deleted) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + client.list_folders({ parent: parent, page_size: page_size, page_token: page_token, show_deleted: show_deleted }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + client.list_folders(::Google::Cloud::ResourceManager::V3::ListFoldersRequest.new(parent: parent, page_size: page_size, page_token: page_token, show_deleted: show_deleted), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, list_folders_client_stub.call_count + end + end + end + + def test_search_folders + # Create test objects. + client_result = ::Google::Cloud::ResourceManager::V3::SearchFoldersResponse.new + http_response = OpenStruct.new body: client_result.to_json + + call_options = {} + + # Create request parameters for a unary method. + page_size = 42 + page_token = "hello world" + query = "hello world" + + search_folders_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| + assert options.metadata.key? :"x-goog-api-client" + assert options.metadata[:"x-goog-api-client"].include? "rest" + refute options.metadata[:"x-goog-api-client"].include? "grpc" + end + + ::Google::Cloud::ResourceManager::V3::Folders::Rest::ServiceStub.stub :transcode_search_folders_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, search_folders_client_stub do + # Create client + client = ::Google::Cloud::ResourceManager::V3::Folders::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.search_folders({ page_size: page_size, page_token: page_token, query: query }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.search_folders page_size: page_size, page_token: page_token, query: query do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.search_folders ::Google::Cloud::ResourceManager::V3::SearchFoldersRequest.new(page_size: page_size, page_token: page_token, query: query) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + client.search_folders({ page_size: page_size, page_token: page_token, query: query }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + client.search_folders(::Google::Cloud::ResourceManager::V3::SearchFoldersRequest.new(page_size: page_size, page_token: page_token, query: query), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, search_folders_client_stub.call_count + end + end + end + + def test_create_folder + # 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. + folder = {} + + create_folder_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| + assert options.metadata.key? :"x-goog-api-client" + assert options.metadata[:"x-goog-api-client"].include? "rest" + refute options.metadata[:"x-goog-api-client"].include? "grpc" + end + + ::Google::Cloud::ResourceManager::V3::Folders::Rest::ServiceStub.stub :transcode_create_folder_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, create_folder_client_stub do + # Create client + client = ::Google::Cloud::ResourceManager::V3::Folders::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.create_folder({ folder: folder }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.create_folder folder: folder do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.create_folder ::Google::Cloud::ResourceManager::V3::CreateFolderRequest.new(folder: folder) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + client.create_folder({ folder: folder }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + client.create_folder(::Google::Cloud::ResourceManager::V3::CreateFolderRequest.new(folder: folder), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, create_folder_client_stub.call_count + end + end + end + + def test_update_folder + # 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. + folder = {} + update_mask = {} + + update_folder_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| + assert options.metadata.key? :"x-goog-api-client" + assert options.metadata[:"x-goog-api-client"].include? "rest" + refute options.metadata[:"x-goog-api-client"].include? "grpc" + end + + ::Google::Cloud::ResourceManager::V3::Folders::Rest::ServiceStub.stub :transcode_update_folder_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, update_folder_client_stub do + # Create client + client = ::Google::Cloud::ResourceManager::V3::Folders::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.update_folder({ folder: folder, update_mask: update_mask }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.update_folder folder: folder, update_mask: update_mask do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.update_folder ::Google::Cloud::ResourceManager::V3::UpdateFolderRequest.new(folder: folder, update_mask: update_mask) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + client.update_folder({ folder: folder, update_mask: update_mask }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + client.update_folder(::Google::Cloud::ResourceManager::V3::UpdateFolderRequest.new(folder: folder, update_mask: update_mask), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, update_folder_client_stub.call_count + end + end + end + + def test_move_folder + # 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" + destination_parent = "hello world" + + move_folder_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| + assert options.metadata.key? :"x-goog-api-client" + assert options.metadata[:"x-goog-api-client"].include? "rest" + refute options.metadata[:"x-goog-api-client"].include? "grpc" + end + + ::Google::Cloud::ResourceManager::V3::Folders::Rest::ServiceStub.stub :transcode_move_folder_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, move_folder_client_stub do + # Create client + client = ::Google::Cloud::ResourceManager::V3::Folders::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.move_folder({ name: name, destination_parent: destination_parent }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.move_folder name: name, destination_parent: destination_parent do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.move_folder ::Google::Cloud::ResourceManager::V3::MoveFolderRequest.new(name: name, destination_parent: destination_parent) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + client.move_folder({ name: name, destination_parent: destination_parent }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + client.move_folder(::Google::Cloud::ResourceManager::V3::MoveFolderRequest.new(name: name, destination_parent: destination_parent), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, move_folder_client_stub.call_count + end + end + end + + def test_delete_folder + # 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" + + delete_folder_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| + assert options.metadata.key? :"x-goog-api-client" + assert options.metadata[:"x-goog-api-client"].include? "rest" + refute options.metadata[:"x-goog-api-client"].include? "grpc" + end + + ::Google::Cloud::ResourceManager::V3::Folders::Rest::ServiceStub.stub :transcode_delete_folder_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, delete_folder_client_stub do + # Create client + client = ::Google::Cloud::ResourceManager::V3::Folders::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.delete_folder({ name: name }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.delete_folder name: name do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.delete_folder ::Google::Cloud::ResourceManager::V3::DeleteFolderRequest.new(name: name) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + client.delete_folder({ name: name }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + client.delete_folder(::Google::Cloud::ResourceManager::V3::DeleteFolderRequest.new(name: name), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, delete_folder_client_stub.call_count + end + end + end + + def test_undelete_folder + # 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" + + undelete_folder_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| + assert options.metadata.key? :"x-goog-api-client" + assert options.metadata[:"x-goog-api-client"].include? "rest" + refute options.metadata[:"x-goog-api-client"].include? "grpc" + end + + ::Google::Cloud::ResourceManager::V3::Folders::Rest::ServiceStub.stub :transcode_undelete_folder_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, undelete_folder_client_stub do + # Create client + client = ::Google::Cloud::ResourceManager::V3::Folders::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.undelete_folder({ name: name }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.undelete_folder name: name do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.undelete_folder ::Google::Cloud::ResourceManager::V3::UndeleteFolderRequest.new(name: name) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + client.undelete_folder({ name: name }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + client.undelete_folder(::Google::Cloud::ResourceManager::V3::UndeleteFolderRequest.new(name: name), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, undelete_folder_client_stub.call_count + end + end + end + + def test_get_iam_policy + # Create test objects. + client_result = ::Google::Iam::V1::Policy.new + http_response = OpenStruct.new body: client_result.to_json + + call_options = {} + + # Create request parameters for a unary method. + resource = "hello world" + options = {} + + get_iam_policy_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| + assert options.metadata.key? :"x-goog-api-client" + assert options.metadata[:"x-goog-api-client"].include? "rest" + refute options.metadata[:"x-goog-api-client"].include? "grpc" + end + + ::Google::Cloud::ResourceManager::V3::Folders::Rest::ServiceStub.stub :transcode_get_iam_policy_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, get_iam_policy_client_stub do + # Create client + client = ::Google::Cloud::ResourceManager::V3::Folders::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.get_iam_policy({ resource: resource, options: options }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.get_iam_policy resource: resource, options: options do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.get_iam_policy ::Google::Iam::V1::GetIamPolicyRequest.new(resource: resource, options: options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + client.get_iam_policy({ resource: resource, options: options }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + client.get_iam_policy(::Google::Iam::V1::GetIamPolicyRequest.new(resource: resource, options: options), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, get_iam_policy_client_stub.call_count + end + end + end + + def test_set_iam_policy + # Create test objects. + client_result = ::Google::Iam::V1::Policy.new + http_response = OpenStruct.new body: client_result.to_json + + call_options = {} + + # Create request parameters for a unary method. + resource = "hello world" + policy = {} + update_mask = {} + + set_iam_policy_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| + assert options.metadata.key? :"x-goog-api-client" + assert options.metadata[:"x-goog-api-client"].include? "rest" + refute options.metadata[:"x-goog-api-client"].include? "grpc" + end + + ::Google::Cloud::ResourceManager::V3::Folders::Rest::ServiceStub.stub :transcode_set_iam_policy_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, set_iam_policy_client_stub do + # Create client + client = ::Google::Cloud::ResourceManager::V3::Folders::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.set_iam_policy({ resource: resource, policy: policy, update_mask: update_mask }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.set_iam_policy resource: resource, policy: policy, update_mask: update_mask do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.set_iam_policy ::Google::Iam::V1::SetIamPolicyRequest.new(resource: resource, policy: policy, update_mask: update_mask) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + client.set_iam_policy({ resource: resource, policy: policy, update_mask: update_mask }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + client.set_iam_policy(::Google::Iam::V1::SetIamPolicyRequest.new(resource: resource, policy: policy, update_mask: update_mask), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, set_iam_policy_client_stub.call_count + end + end + end + + def test_test_iam_permissions + # Create test objects. + client_result = ::Google::Iam::V1::TestIamPermissionsResponse.new + http_response = OpenStruct.new body: client_result.to_json + + call_options = {} + + # Create request parameters for a unary method. + resource = "hello world" + permissions = ["hello world"] + + test_iam_permissions_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| + assert options.metadata.key? :"x-goog-api-client" + assert options.metadata[:"x-goog-api-client"].include? "rest" + refute options.metadata[:"x-goog-api-client"].include? "grpc" + end + + ::Google::Cloud::ResourceManager::V3::Folders::Rest::ServiceStub.stub :transcode_test_iam_permissions_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, test_iam_permissions_client_stub do + # Create client + client = ::Google::Cloud::ResourceManager::V3::Folders::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.test_iam_permissions({ resource: resource, permissions: permissions }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.test_iam_permissions resource: resource, permissions: permissions do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.test_iam_permissions ::Google::Iam::V1::TestIamPermissionsRequest.new(resource: resource, permissions: permissions) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + client.test_iam_permissions({ resource: resource, permissions: permissions }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + client.test_iam_permissions(::Google::Iam::V1::TestIamPermissionsRequest.new(resource: resource, permissions: permissions), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, test_iam_permissions_client_stub.call_count + end + end + end + + def test_configure + credentials_token = :dummy_value + + client = block_config = config = nil + dummy_stub = ClientStub.new nil + Gapic::Rest::ClientStub.stub :new, dummy_stub do + client = ::Google::Cloud::ResourceManager::V3::Folders::Rest::Client.new do |config| + config.credentials = credentials_token + end + end + + config = client.configure do |c| + block_config = c + end + + assert_same block_config, config + assert_kind_of ::Google::Cloud::ResourceManager::V3::Folders::Rest::Client::Configuration, config + end +end diff --git a/owl-bot-staging/google-cloud-resource_manager-v3/test/google/cloud/resource_manager/v3/folders_test.rb b/owl-bot-staging/google-cloud-resource_manager-v3/test/google/cloud/resource_manager/v3/folders_test.rb new file mode 100644 index 000000000000..8e90b470f0c2 --- /dev/null +++ b/owl-bot-staging/google-cloud-resource_manager-v3/test/google/cloud/resource_manager/v3/folders_test.rb @@ -0,0 +1,813 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +require "helper" + +require "gapic/grpc/service_stub" + +require "google/cloud/resourcemanager/v3/folders_pb" +require "google/cloud/resource_manager/v3/folders" + +class ::Google::Cloud::ResourceManager::V3::Folders::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_get_folder + # Create GRPC objects. + grpc_response = ::Google::Cloud::ResourceManager::V3::Folder.new + grpc_operation = GRPC::ActiveCall::Operation.new nil + grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + grpc_options = {} + + # Create request parameters for a unary method. + name = "hello world" + + get_folder_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :get_folder, name + assert_kind_of ::Google::Cloud::ResourceManager::V3::GetFolderRequest, request + assert_equal "hello world", request["name"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, get_folder_client_stub do + # Create client + client = ::Google::Cloud::ResourceManager::V3::Folders::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.get_folder({ name: name }) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use named arguments + client.get_folder name: name do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.get_folder ::Google::Cloud::ResourceManager::V3::GetFolderRequest.new(name: name) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use hash object with options + client.get_folder({ name: name }, grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object with options + client.get_folder(::Google::Cloud::ResourceManager::V3::GetFolderRequest.new(name: name), grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Verify method calls + assert_equal 5, get_folder_client_stub.call_rpc_count + end + end + + def test_list_folders + # Create GRPC objects. + grpc_response = ::Google::Cloud::ResourceManager::V3::ListFoldersResponse.new + grpc_operation = GRPC::ActiveCall::Operation.new nil + grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + grpc_options = {} + + # Create request parameters for a unary method. + parent = "hello world" + page_size = 42 + page_token = "hello world" + show_deleted = true + + list_folders_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :list_folders, name + assert_kind_of ::Google::Cloud::ResourceManager::V3::ListFoldersRequest, request + assert_equal "hello world", request["parent"] + assert_equal 42, request["page_size"] + assert_equal "hello world", request["page_token"] + assert_equal true, request["show_deleted"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, list_folders_client_stub do + # Create client + client = ::Google::Cloud::ResourceManager::V3::Folders::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.list_folders({ parent: parent, page_size: page_size, page_token: page_token, show_deleted: show_deleted }) do |response, operation| + assert_kind_of Gapic::PagedEnumerable, response + assert_equal grpc_response, response.response + assert_equal grpc_operation, operation + end + + # Use named arguments + client.list_folders parent: parent, page_size: page_size, page_token: page_token, show_deleted: show_deleted do |response, operation| + assert_kind_of Gapic::PagedEnumerable, response + assert_equal grpc_response, response.response + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.list_folders ::Google::Cloud::ResourceManager::V3::ListFoldersRequest.new(parent: parent, page_size: page_size, page_token: page_token, show_deleted: show_deleted) do |response, operation| + assert_kind_of Gapic::PagedEnumerable, response + assert_equal grpc_response, response.response + assert_equal grpc_operation, operation + end + + # Use hash object with options + client.list_folders({ parent: parent, page_size: page_size, page_token: page_token, show_deleted: show_deleted }, grpc_options) do |response, operation| + assert_kind_of Gapic::PagedEnumerable, response + assert_equal grpc_response, response.response + assert_equal grpc_operation, operation + end + + # Use protobuf object with options + client.list_folders(::Google::Cloud::ResourceManager::V3::ListFoldersRequest.new(parent: parent, page_size: page_size, page_token: page_token, show_deleted: show_deleted), grpc_options) do |response, operation| + assert_kind_of Gapic::PagedEnumerable, response + assert_equal grpc_response, response.response + assert_equal grpc_operation, operation + end + + # Verify method calls + assert_equal 5, list_folders_client_stub.call_rpc_count + end + end + + def test_search_folders + # Create GRPC objects. + grpc_response = ::Google::Cloud::ResourceManager::V3::SearchFoldersResponse.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. + page_size = 42 + page_token = "hello world" + query = "hello world" + + search_folders_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :search_folders, name + assert_kind_of ::Google::Cloud::ResourceManager::V3::SearchFoldersRequest, request + assert_equal 42, request["page_size"] + assert_equal "hello world", request["page_token"] + assert_equal "hello world", request["query"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, search_folders_client_stub do + # Create client + client = ::Google::Cloud::ResourceManager::V3::Folders::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.search_folders({ page_size: page_size, page_token: page_token, query: query }) 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_folders page_size: page_size, page_token: page_token, query: query 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_folders ::Google::Cloud::ResourceManager::V3::SearchFoldersRequest.new(page_size: page_size, page_token: page_token, query: query) 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_folders({ page_size: page_size, page_token: page_token, query: query }, 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_folders(::Google::Cloud::ResourceManager::V3::SearchFoldersRequest.new(page_size: page_size, page_token: page_token, query: query), 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_folders_client_stub.call_rpc_count + end + end + + def test_create_folder + # Create GRPC objects. + grpc_response = ::Google::Longrunning::Operation.new + grpc_operation = GRPC::ActiveCall::Operation.new nil + grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + grpc_options = {} + + # Create request parameters for a unary method. + folder = {} + + create_folder_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :create_folder, name + assert_kind_of ::Google::Cloud::ResourceManager::V3::CreateFolderRequest, request + assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::ResourceManager::V3::Folder), request["folder"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, create_folder_client_stub do + # Create client + client = ::Google::Cloud::ResourceManager::V3::Folders::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.create_folder({ folder: folder }) 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_folder folder: folder 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_folder ::Google::Cloud::ResourceManager::V3::CreateFolderRequest.new(folder: folder) 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_folder({ folder: folder }, 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_folder(::Google::Cloud::ResourceManager::V3::CreateFolderRequest.new(folder: folder), 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_folder_client_stub.call_rpc_count + end + end + + def test_update_folder + # Create GRPC objects. + grpc_response = ::Google::Longrunning::Operation.new + grpc_operation = GRPC::ActiveCall::Operation.new nil + grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + grpc_options = {} + + # Create request parameters for a unary method. + folder = {} + update_mask = {} + + update_folder_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :update_folder, name + assert_kind_of ::Google::Cloud::ResourceManager::V3::UpdateFolderRequest, request + assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::ResourceManager::V3::Folder), request["folder"] + assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Protobuf::FieldMask), request["update_mask"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, update_folder_client_stub do + # Create client + client = ::Google::Cloud::ResourceManager::V3::Folders::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.update_folder({ folder: folder, 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_folder folder: folder, 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_folder ::Google::Cloud::ResourceManager::V3::UpdateFolderRequest.new(folder: folder, 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_folder({ folder: folder, 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_folder(::Google::Cloud::ResourceManager::V3::UpdateFolderRequest.new(folder: folder, 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_folder_client_stub.call_rpc_count + end + end + + def test_move_folder + # Create GRPC objects. + grpc_response = ::Google::Longrunning::Operation.new + grpc_operation = GRPC::ActiveCall::Operation.new nil + grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + grpc_options = {} + + # Create request parameters for a unary method. + name = "hello world" + destination_parent = "hello world" + + move_folder_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :move_folder, name + assert_kind_of ::Google::Cloud::ResourceManager::V3::MoveFolderRequest, request + assert_equal "hello world", request["name"] + assert_equal "hello world", request["destination_parent"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, move_folder_client_stub do + # Create client + client = ::Google::Cloud::ResourceManager::V3::Folders::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.move_folder({ name: name, destination_parent: destination_parent }) 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.move_folder name: name, destination_parent: destination_parent 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.move_folder ::Google::Cloud::ResourceManager::V3::MoveFolderRequest.new(name: name, destination_parent: destination_parent) 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.move_folder({ name: name, destination_parent: destination_parent }, 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.move_folder(::Google::Cloud::ResourceManager::V3::MoveFolderRequest.new(name: name, destination_parent: destination_parent), 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, move_folder_client_stub.call_rpc_count + end + end + + def test_delete_folder + # Create GRPC objects. + grpc_response = ::Google::Longrunning::Operation.new + grpc_operation = GRPC::ActiveCall::Operation.new nil + grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + grpc_options = {} + + # Create request parameters for a unary method. + name = "hello world" + + delete_folder_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :delete_folder, name + assert_kind_of ::Google::Cloud::ResourceManager::V3::DeleteFolderRequest, request + assert_equal "hello world", request["name"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, delete_folder_client_stub do + # Create client + client = ::Google::Cloud::ResourceManager::V3::Folders::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.delete_folder({ 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.delete_folder 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.delete_folder ::Google::Cloud::ResourceManager::V3::DeleteFolderRequest.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.delete_folder({ 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.delete_folder(::Google::Cloud::ResourceManager::V3::DeleteFolderRequest.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, delete_folder_client_stub.call_rpc_count + end + end + + def test_undelete_folder + # Create GRPC objects. + grpc_response = ::Google::Longrunning::Operation.new + grpc_operation = GRPC::ActiveCall::Operation.new nil + grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + grpc_options = {} + + # Create request parameters for a unary method. + name = "hello world" + + undelete_folder_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :undelete_folder, name + assert_kind_of ::Google::Cloud::ResourceManager::V3::UndeleteFolderRequest, request + assert_equal "hello world", request["name"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, undelete_folder_client_stub do + # Create client + client = ::Google::Cloud::ResourceManager::V3::Folders::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.undelete_folder({ 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.undelete_folder 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.undelete_folder ::Google::Cloud::ResourceManager::V3::UndeleteFolderRequest.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.undelete_folder({ 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.undelete_folder(::Google::Cloud::ResourceManager::V3::UndeleteFolderRequest.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, undelete_folder_client_stub.call_rpc_count + end + end + + def test_get_iam_policy + # Create GRPC objects. + grpc_response = ::Google::Iam::V1::Policy.new + grpc_operation = GRPC::ActiveCall::Operation.new nil + grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + grpc_options = {} + + # Create request parameters for a unary method. + resource = "hello world" + options = {} + + get_iam_policy_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :get_iam_policy, name + assert_kind_of ::Google::Iam::V1::GetIamPolicyRequest, request + assert_equal "hello world", request["resource"] + assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Iam::V1::GetPolicyOptions), request["options"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, get_iam_policy_client_stub do + # Create client + client = ::Google::Cloud::ResourceManager::V3::Folders::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.get_iam_policy({ resource: resource, options: options }) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use named arguments + client.get_iam_policy resource: resource, options: options do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.get_iam_policy ::Google::Iam::V1::GetIamPolicyRequest.new(resource: resource, options: options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use hash object with options + client.get_iam_policy({ resource: resource, options: options }, grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object with options + client.get_iam_policy(::Google::Iam::V1::GetIamPolicyRequest.new(resource: resource, options: options), grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Verify method calls + assert_equal 5, get_iam_policy_client_stub.call_rpc_count + end + end + + def test_set_iam_policy + # Create GRPC objects. + grpc_response = ::Google::Iam::V1::Policy.new + grpc_operation = GRPC::ActiveCall::Operation.new nil + grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + grpc_options = {} + + # Create request parameters for a unary method. + resource = "hello world" + policy = {} + update_mask = {} + + set_iam_policy_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :set_iam_policy, name + assert_kind_of ::Google::Iam::V1::SetIamPolicyRequest, request + assert_equal "hello world", request["resource"] + assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Iam::V1::Policy), request["policy"] + assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Protobuf::FieldMask), request["update_mask"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, set_iam_policy_client_stub do + # Create client + client = ::Google::Cloud::ResourceManager::V3::Folders::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.set_iam_policy({ resource: resource, policy: policy, update_mask: update_mask }) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use named arguments + client.set_iam_policy resource: resource, policy: policy, update_mask: update_mask do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.set_iam_policy ::Google::Iam::V1::SetIamPolicyRequest.new(resource: resource, policy: policy, update_mask: update_mask) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use hash object with options + client.set_iam_policy({ resource: resource, policy: policy, update_mask: update_mask }, grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object with options + client.set_iam_policy(::Google::Iam::V1::SetIamPolicyRequest.new(resource: resource, policy: policy, update_mask: update_mask), grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Verify method calls + assert_equal 5, set_iam_policy_client_stub.call_rpc_count + end + end + + def test_test_iam_permissions + # Create GRPC objects. + grpc_response = ::Google::Iam::V1::TestIamPermissionsResponse.new + grpc_operation = GRPC::ActiveCall::Operation.new nil + grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + grpc_options = {} + + # Create request parameters for a unary method. + resource = "hello world" + permissions = ["hello world"] + + test_iam_permissions_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :test_iam_permissions, name + assert_kind_of ::Google::Iam::V1::TestIamPermissionsRequest, request + assert_equal "hello world", request["resource"] + assert_equal ["hello world"], request["permissions"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, test_iam_permissions_client_stub do + # Create client + client = ::Google::Cloud::ResourceManager::V3::Folders::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.test_iam_permissions({ resource: resource, permissions: permissions }) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use named arguments + client.test_iam_permissions resource: resource, permissions: permissions do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.test_iam_permissions ::Google::Iam::V1::TestIamPermissionsRequest.new(resource: resource, permissions: permissions) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use hash object with options + client.test_iam_permissions({ resource: resource, permissions: permissions }, grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object with options + client.test_iam_permissions(::Google::Iam::V1::TestIamPermissionsRequest.new(resource: resource, permissions: permissions), grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Verify method calls + assert_equal 5, test_iam_permissions_client_stub.call_rpc_count + end + end + + def test_configure + grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + + client = block_config = config = nil + dummy_stub = ClientStub.new nil, nil + Gapic::ServiceStub.stub :new, dummy_stub do + client = ::Google::Cloud::ResourceManager::V3::Folders::Client.new do |config| + config.credentials = grpc_channel + end + end + + config = client.configure do |c| + block_config = c + end + + assert_same block_config, config + assert_kind_of ::Google::Cloud::ResourceManager::V3::Folders::Client::Configuration, config + end + + def test_credentials + key = OpenSSL::PKey::RSA.new 2048 + cred_json = { + "private_key" => key.to_pem, + "client_email" => "app@developer.gserviceaccount.com", + "type" => "service_account" + } + key_file = StringIO.new cred_json.to_json + creds = Google::Auth::ServiceAccountCredentials.make_creds({ json_key_io: key_file }) + + dummy_stub = ClientStub.new nil, nil + Gapic::ServiceStub.stub :new, dummy_stub do + client = ::Google::Cloud::ResourceManager::V3::Folders::Client.new do |config| + config.credentials = creds + end + assert_kind_of ::Google::Cloud::ResourceManager::V3::Folders::Client, client + assert_equal creds, client.configure.credentials + end + end + + def test_operations_client + grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + + client = nil + dummy_stub = ClientStub.new nil, nil + Gapic::ServiceStub.stub :new, dummy_stub do + client = ::Google::Cloud::ResourceManager::V3::Folders::Client.new do |config| + config.credentials = grpc_channel + end + end + + assert_kind_of ::Google::Cloud::ResourceManager::V3::Folders::Operations, client.operations_client + end +end diff --git a/owl-bot-staging/google-cloud-resource_manager-v3/test/google/cloud/resource_manager/v3/organizations_paths_test.rb b/owl-bot-staging/google-cloud-resource_manager-v3/test/google/cloud/resource_manager/v3/organizations_paths_test.rb new file mode 100644 index 000000000000..ebf070ca894a --- /dev/null +++ b/owl-bot-staging/google-cloud-resource_manager-v3/test/google/cloud/resource_manager/v3/organizations_paths_test.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 "helper" + +require "gapic/grpc/service_stub" + +require "google/cloud/resource_manager/v3/organizations" + +class ::Google::Cloud::ResourceManager::V3::Organizations::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_path + grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + ::Gapic::ServiceStub.stub :new, DummyStub.new do + client = ::Google::Cloud::ResourceManager::V3::Organizations::Client.new do |config| + config.credentials = grpc_channel + end + + path = client.organization_path organization: "value0" + assert_equal "organizations/value0", path + end + end +end diff --git a/owl-bot-staging/google-cloud-resource_manager-v3/test/google/cloud/resource_manager/v3/organizations_rest_test.rb b/owl-bot-staging/google-cloud-resource_manager-v3/test/google/cloud/resource_manager/v3/organizations_rest_test.rb new file mode 100644 index 000000000000..59d2404dff49 --- /dev/null +++ b/owl-bot-staging/google-cloud-resource_manager-v3/test/google/cloud/resource_manager/v3/organizations_rest_test.rb @@ -0,0 +1,375 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +require "helper" +require "gapic/rest" +require "google/cloud/resourcemanager/v3/organizations_pb" +require "google/cloud/resource_manager/v3/organizations/rest" + + +class ::Google::Cloud::ResourceManager::V3::Organizations::Rest::ClientTest < Minitest::Test + class ClientStub + attr_accessor :call_count, :requests + + def initialize response, &block + @response = response + @block = block + @call_count = 0 + @requests = [] + end + + def make_get_request uri:, params: {}, options: {}, method_name: nil + make_http_request :get, uri: uri, body: nil, params: params, options: options, method_name: method_name + end + + def make_delete_request uri:, params: {}, options: {}, method_name: nil + make_http_request :delete, uri: uri, body: nil, params: params, options: options, method_name: method_name + end + + def make_post_request uri:, body: nil, params: {}, options: {}, method_name: nil + make_http_request :post, uri: uri, body: body, params: params, options: options, method_name: method_name + end + + def make_patch_request uri:, body:, params: {}, options: {}, method_name: nil + make_http_request :patch, uri: uri, body: body, params: params, options: options, method_name: method_name + end + + def make_put_request uri:, body:, params: {}, options: {}, method_name: nil + make_http_request :put, uri: uri, body: body, params: params, options: options, method_name: method_name + end + + def make_http_request *args, **kwargs + @call_count += 1 + + @requests << @block&.call(*args, **kwargs) + + @response + end + + def endpoint + "endpoint.example.com" + end + + def universe_domain + "example.com" + end + + def stub_logger + nil + end + + def logger + nil + end + end + + def test_get_organization + # Create test objects. + client_result = ::Google::Cloud::ResourceManager::V3::Organization.new + http_response = OpenStruct.new body: client_result.to_json + + call_options = {} + + # Create request parameters for a unary method. + name = "hello world" + + get_organization_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| + assert options.metadata.key? :"x-goog-api-client" + assert options.metadata[:"x-goog-api-client"].include? "rest" + refute options.metadata[:"x-goog-api-client"].include? "grpc" + end + + ::Google::Cloud::ResourceManager::V3::Organizations::Rest::ServiceStub.stub :transcode_get_organization_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, get_organization_client_stub do + # Create client + client = ::Google::Cloud::ResourceManager::V3::Organizations::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.get_organization({ name: name }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.get_organization name: name do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.get_organization ::Google::Cloud::ResourceManager::V3::GetOrganizationRequest.new(name: name) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + client.get_organization({ name: name }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + client.get_organization(::Google::Cloud::ResourceManager::V3::GetOrganizationRequest.new(name: name), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, get_organization_client_stub.call_count + end + end + end + + def test_search_organizations + # Create test objects. + client_result = ::Google::Cloud::ResourceManager::V3::SearchOrganizationsResponse.new + http_response = OpenStruct.new body: client_result.to_json + + call_options = {} + + # Create request parameters for a unary method. + page_size = 42 + page_token = "hello world" + query = "hello world" + + search_organizations_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| + assert options.metadata.key? :"x-goog-api-client" + assert options.metadata[:"x-goog-api-client"].include? "rest" + refute options.metadata[:"x-goog-api-client"].include? "grpc" + end + + ::Google::Cloud::ResourceManager::V3::Organizations::Rest::ServiceStub.stub :transcode_search_organizations_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, search_organizations_client_stub do + # Create client + client = ::Google::Cloud::ResourceManager::V3::Organizations::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.search_organizations({ page_size: page_size, page_token: page_token, query: query }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.search_organizations page_size: page_size, page_token: page_token, query: query do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.search_organizations ::Google::Cloud::ResourceManager::V3::SearchOrganizationsRequest.new(page_size: page_size, page_token: page_token, query: query) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + client.search_organizations({ page_size: page_size, page_token: page_token, query: query }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + client.search_organizations(::Google::Cloud::ResourceManager::V3::SearchOrganizationsRequest.new(page_size: page_size, page_token: page_token, query: query), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, search_organizations_client_stub.call_count + end + end + end + + def test_get_iam_policy + # Create test objects. + client_result = ::Google::Iam::V1::Policy.new + http_response = OpenStruct.new body: client_result.to_json + + call_options = {} + + # Create request parameters for a unary method. + resource = "hello world" + options = {} + + get_iam_policy_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| + assert options.metadata.key? :"x-goog-api-client" + assert options.metadata[:"x-goog-api-client"].include? "rest" + refute options.metadata[:"x-goog-api-client"].include? "grpc" + end + + ::Google::Cloud::ResourceManager::V3::Organizations::Rest::ServiceStub.stub :transcode_get_iam_policy_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, get_iam_policy_client_stub do + # Create client + client = ::Google::Cloud::ResourceManager::V3::Organizations::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.get_iam_policy({ resource: resource, options: options }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.get_iam_policy resource: resource, options: options do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.get_iam_policy ::Google::Iam::V1::GetIamPolicyRequest.new(resource: resource, options: options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + client.get_iam_policy({ resource: resource, options: options }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + client.get_iam_policy(::Google::Iam::V1::GetIamPolicyRequest.new(resource: resource, options: options), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, get_iam_policy_client_stub.call_count + end + end + end + + def test_set_iam_policy + # Create test objects. + client_result = ::Google::Iam::V1::Policy.new + http_response = OpenStruct.new body: client_result.to_json + + call_options = {} + + # Create request parameters for a unary method. + resource = "hello world" + policy = {} + update_mask = {} + + set_iam_policy_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| + assert options.metadata.key? :"x-goog-api-client" + assert options.metadata[:"x-goog-api-client"].include? "rest" + refute options.metadata[:"x-goog-api-client"].include? "grpc" + end + + ::Google::Cloud::ResourceManager::V3::Organizations::Rest::ServiceStub.stub :transcode_set_iam_policy_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, set_iam_policy_client_stub do + # Create client + client = ::Google::Cloud::ResourceManager::V3::Organizations::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.set_iam_policy({ resource: resource, policy: policy, update_mask: update_mask }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.set_iam_policy resource: resource, policy: policy, update_mask: update_mask do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.set_iam_policy ::Google::Iam::V1::SetIamPolicyRequest.new(resource: resource, policy: policy, update_mask: update_mask) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + client.set_iam_policy({ resource: resource, policy: policy, update_mask: update_mask }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + client.set_iam_policy(::Google::Iam::V1::SetIamPolicyRequest.new(resource: resource, policy: policy, update_mask: update_mask), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, set_iam_policy_client_stub.call_count + end + end + end + + def test_test_iam_permissions + # Create test objects. + client_result = ::Google::Iam::V1::TestIamPermissionsResponse.new + http_response = OpenStruct.new body: client_result.to_json + + call_options = {} + + # Create request parameters for a unary method. + resource = "hello world" + permissions = ["hello world"] + + test_iam_permissions_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| + assert options.metadata.key? :"x-goog-api-client" + assert options.metadata[:"x-goog-api-client"].include? "rest" + refute options.metadata[:"x-goog-api-client"].include? "grpc" + end + + ::Google::Cloud::ResourceManager::V3::Organizations::Rest::ServiceStub.stub :transcode_test_iam_permissions_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, test_iam_permissions_client_stub do + # Create client + client = ::Google::Cloud::ResourceManager::V3::Organizations::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.test_iam_permissions({ resource: resource, permissions: permissions }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.test_iam_permissions resource: resource, permissions: permissions do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.test_iam_permissions ::Google::Iam::V1::TestIamPermissionsRequest.new(resource: resource, permissions: permissions) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + client.test_iam_permissions({ resource: resource, permissions: permissions }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + client.test_iam_permissions(::Google::Iam::V1::TestIamPermissionsRequest.new(resource: resource, permissions: permissions), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, test_iam_permissions_client_stub.call_count + end + end + end + + def test_configure + credentials_token = :dummy_value + + client = block_config = config = nil + dummy_stub = ClientStub.new nil + Gapic::Rest::ClientStub.stub :new, dummy_stub do + client = ::Google::Cloud::ResourceManager::V3::Organizations::Rest::Client.new do |config| + config.credentials = credentials_token + end + end + + config = client.configure do |c| + block_config = c + end + + assert_same block_config, config + assert_kind_of ::Google::Cloud::ResourceManager::V3::Organizations::Rest::Client::Configuration, config + end +end diff --git a/owl-bot-staging/google-cloud-resource_manager-v3/test/google/cloud/resource_manager/v3/organizations_test.rb b/owl-bot-staging/google-cloud-resource_manager-v3/test/google/cloud/resource_manager/v3/organizations_test.rb new file mode 100644 index 000000000000..347358f430a8 --- /dev/null +++ b/owl-bot-staging/google-cloud-resource_manager-v3/test/google/cloud/resource_manager/v3/organizations_test.rb @@ -0,0 +1,411 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +require "helper" + +require "gapic/grpc/service_stub" + +require "google/cloud/resourcemanager/v3/organizations_pb" +require "google/cloud/resource_manager/v3/organizations" + +class ::Google::Cloud::ResourceManager::V3::Organizations::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_get_organization + # Create GRPC objects. + grpc_response = ::Google::Cloud::ResourceManager::V3::Organization.new + grpc_operation = GRPC::ActiveCall::Operation.new nil + grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + grpc_options = {} + + # Create request parameters for a unary method. + name = "hello world" + + get_organization_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :get_organization, name + assert_kind_of ::Google::Cloud::ResourceManager::V3::GetOrganizationRequest, request + assert_equal "hello world", request["name"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, get_organization_client_stub do + # Create client + client = ::Google::Cloud::ResourceManager::V3::Organizations::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.get_organization({ name: name }) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use named arguments + client.get_organization name: name do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.get_organization ::Google::Cloud::ResourceManager::V3::GetOrganizationRequest.new(name: name) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use hash object with options + client.get_organization({ name: name }, grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object with options + client.get_organization(::Google::Cloud::ResourceManager::V3::GetOrganizationRequest.new(name: name), grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Verify method calls + assert_equal 5, get_organization_client_stub.call_rpc_count + end + end + + def test_search_organizations + # Create GRPC objects. + grpc_response = ::Google::Cloud::ResourceManager::V3::SearchOrganizationsResponse.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. + page_size = 42 + page_token = "hello world" + query = "hello world" + + search_organizations_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :search_organizations, name + assert_kind_of ::Google::Cloud::ResourceManager::V3::SearchOrganizationsRequest, request + assert_equal 42, request["page_size"] + assert_equal "hello world", request["page_token"] + assert_equal "hello world", request["query"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, search_organizations_client_stub do + # Create client + client = ::Google::Cloud::ResourceManager::V3::Organizations::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.search_organizations({ page_size: page_size, page_token: page_token, query: query }) 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_organizations page_size: page_size, page_token: page_token, query: query 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_organizations ::Google::Cloud::ResourceManager::V3::SearchOrganizationsRequest.new(page_size: page_size, page_token: page_token, query: query) 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_organizations({ page_size: page_size, page_token: page_token, query: query }, 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_organizations(::Google::Cloud::ResourceManager::V3::SearchOrganizationsRequest.new(page_size: page_size, page_token: page_token, query: query), 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_organizations_client_stub.call_rpc_count + end + end + + def test_get_iam_policy + # Create GRPC objects. + grpc_response = ::Google::Iam::V1::Policy.new + grpc_operation = GRPC::ActiveCall::Operation.new nil + grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + grpc_options = {} + + # Create request parameters for a unary method. + resource = "hello world" + options = {} + + get_iam_policy_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :get_iam_policy, name + assert_kind_of ::Google::Iam::V1::GetIamPolicyRequest, request + assert_equal "hello world", request["resource"] + assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Iam::V1::GetPolicyOptions), request["options"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, get_iam_policy_client_stub do + # Create client + client = ::Google::Cloud::ResourceManager::V3::Organizations::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.get_iam_policy({ resource: resource, options: options }) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use named arguments + client.get_iam_policy resource: resource, options: options do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.get_iam_policy ::Google::Iam::V1::GetIamPolicyRequest.new(resource: resource, options: options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use hash object with options + client.get_iam_policy({ resource: resource, options: options }, grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object with options + client.get_iam_policy(::Google::Iam::V1::GetIamPolicyRequest.new(resource: resource, options: options), grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Verify method calls + assert_equal 5, get_iam_policy_client_stub.call_rpc_count + end + end + + def test_set_iam_policy + # Create GRPC objects. + grpc_response = ::Google::Iam::V1::Policy.new + grpc_operation = GRPC::ActiveCall::Operation.new nil + grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + grpc_options = {} + + # Create request parameters for a unary method. + resource = "hello world" + policy = {} + update_mask = {} + + set_iam_policy_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :set_iam_policy, name + assert_kind_of ::Google::Iam::V1::SetIamPolicyRequest, request + assert_equal "hello world", request["resource"] + assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Iam::V1::Policy), request["policy"] + assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Protobuf::FieldMask), request["update_mask"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, set_iam_policy_client_stub do + # Create client + client = ::Google::Cloud::ResourceManager::V3::Organizations::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.set_iam_policy({ resource: resource, policy: policy, update_mask: update_mask }) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use named arguments + client.set_iam_policy resource: resource, policy: policy, update_mask: update_mask do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.set_iam_policy ::Google::Iam::V1::SetIamPolicyRequest.new(resource: resource, policy: policy, update_mask: update_mask) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use hash object with options + client.set_iam_policy({ resource: resource, policy: policy, update_mask: update_mask }, grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object with options + client.set_iam_policy(::Google::Iam::V1::SetIamPolicyRequest.new(resource: resource, policy: policy, update_mask: update_mask), grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Verify method calls + assert_equal 5, set_iam_policy_client_stub.call_rpc_count + end + end + + def test_test_iam_permissions + # Create GRPC objects. + grpc_response = ::Google::Iam::V1::TestIamPermissionsResponse.new + grpc_operation = GRPC::ActiveCall::Operation.new nil + grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + grpc_options = {} + + # Create request parameters for a unary method. + resource = "hello world" + permissions = ["hello world"] + + test_iam_permissions_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :test_iam_permissions, name + assert_kind_of ::Google::Iam::V1::TestIamPermissionsRequest, request + assert_equal "hello world", request["resource"] + assert_equal ["hello world"], request["permissions"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, test_iam_permissions_client_stub do + # Create client + client = ::Google::Cloud::ResourceManager::V3::Organizations::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.test_iam_permissions({ resource: resource, permissions: permissions }) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use named arguments + client.test_iam_permissions resource: resource, permissions: permissions do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.test_iam_permissions ::Google::Iam::V1::TestIamPermissionsRequest.new(resource: resource, permissions: permissions) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use hash object with options + client.test_iam_permissions({ resource: resource, permissions: permissions }, grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object with options + client.test_iam_permissions(::Google::Iam::V1::TestIamPermissionsRequest.new(resource: resource, permissions: permissions), grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Verify method calls + assert_equal 5, test_iam_permissions_client_stub.call_rpc_count + end + end + + def test_configure + grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + + client = block_config = config = nil + dummy_stub = ClientStub.new nil, nil + Gapic::ServiceStub.stub :new, dummy_stub do + client = ::Google::Cloud::ResourceManager::V3::Organizations::Client.new do |config| + config.credentials = grpc_channel + end + end + + config = client.configure do |c| + block_config = c + end + + assert_same block_config, config + assert_kind_of ::Google::Cloud::ResourceManager::V3::Organizations::Client::Configuration, config + end + + def test_credentials + key = OpenSSL::PKey::RSA.new 2048 + cred_json = { + "private_key" => key.to_pem, + "client_email" => "app@developer.gserviceaccount.com", + "type" => "service_account" + } + key_file = StringIO.new cred_json.to_json + creds = Google::Auth::ServiceAccountCredentials.make_creds({ json_key_io: key_file }) + + dummy_stub = ClientStub.new nil, nil + Gapic::ServiceStub.stub :new, dummy_stub do + client = ::Google::Cloud::ResourceManager::V3::Organizations::Client.new do |config| + config.credentials = creds + end + assert_kind_of ::Google::Cloud::ResourceManager::V3::Organizations::Client, client + assert_equal creds, client.configure.credentials + end + end +end diff --git a/owl-bot-staging/google-cloud-resource_manager-v3/test/google/cloud/resource_manager/v3/projects_operations_test.rb b/owl-bot-staging/google-cloud-resource_manager-v3/test/google/cloud/resource_manager/v3/projects_operations_test.rb new file mode 100644 index 000000000000..6e716395fcc5 --- /dev/null +++ b/owl-bot-staging/google-cloud-resource_manager-v3/test/google/cloud/resource_manager/v3/projects_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/cloud/resourcemanager/v3/projects_pb" +require "google/cloud/resourcemanager/v3/projects_services_pb" +require "google/cloud/resource_manager/v3/projects" + +class ::Google::Cloud::ResourceManager::V3::Projects::OperationsTest < Minitest::Test + class ClientStub + attr_accessor :call_rpc_count, :requests + + def initialize response, operation, &block + @response = response + @operation = operation + @block = block + @call_rpc_count = 0 + @requests = [] + end + + def call_rpc *args, **kwargs + @call_rpc_count += 1 + + @requests << @block&.call(*args, **kwargs) + + catch :response do + yield @response, @operation if block_given? + @response + end + end + + def endpoint + "endpoint.example.com" + end + + def universe_domain + "example.com" + end + + def stub_logger + nil + end + + def logger + nil + end + end + + def test_list_operations + # Create GRPC objects. + grpc_response = ::Google::Longrunning::ListOperationsResponse.new + grpc_operation = GRPC::ActiveCall::Operation.new nil + grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + grpc_options = {} + + # Create request parameters for a unary method. + name = "hello world" + filter = "hello world" + page_size = 42 + page_token = "hello world" + return_partial_success = true + + list_operations_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :list_operations, name + assert_kind_of ::Google::Longrunning::ListOperationsRequest, request + assert_equal "hello world", request["name"] + assert_equal "hello world", request["filter"] + assert_equal 42, request["page_size"] + assert_equal "hello world", request["page_token"] + assert_equal true, request["return_partial_success"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, list_operations_client_stub do + # Create client + client = ::Google::Cloud::ResourceManager::V3::Projects::Operations.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.list_operations({ name: name, filter: filter, page_size: page_size, page_token: page_token, return_partial_success: return_partial_success }) do |response, operation| + assert_kind_of Gapic::PagedEnumerable, response + assert_equal grpc_response, response.response + assert_equal grpc_operation, operation + end + + # Use named arguments + client.list_operations name: name, filter: filter, page_size: page_size, page_token: page_token, return_partial_success: return_partial_success do |response, operation| + assert_kind_of Gapic::PagedEnumerable, response + assert_equal grpc_response, response.response + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.list_operations ::Google::Longrunning::ListOperationsRequest.new(name: name, filter: filter, page_size: page_size, page_token: page_token, return_partial_success: return_partial_success) do |response, operation| + assert_kind_of Gapic::PagedEnumerable, response + assert_equal grpc_response, response.response + assert_equal grpc_operation, operation + end + + # Use hash object with options + client.list_operations({ name: name, filter: filter, page_size: page_size, page_token: page_token, return_partial_success: return_partial_success }, grpc_options) do |response, operation| + assert_kind_of Gapic::PagedEnumerable, response + assert_equal grpc_response, response.response + assert_equal grpc_operation, operation + end + + # Use protobuf object with options + client.list_operations(::Google::Longrunning::ListOperationsRequest.new(name: name, filter: filter, page_size: page_size, page_token: page_token, return_partial_success: return_partial_success), grpc_options) do |response, operation| + assert_kind_of Gapic::PagedEnumerable, response + assert_equal grpc_response, response.response + assert_equal grpc_operation, operation + end + + # Verify method calls + assert_equal 5, list_operations_client_stub.call_rpc_count + end + end + + def test_get_operation + # Create GRPC objects. + grpc_response = ::Google::Longrunning::Operation.new + grpc_operation = GRPC::ActiveCall::Operation.new nil + grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + grpc_options = {} + + # Create request parameters for a unary method. + name = "hello world" + + get_operation_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :get_operation, name + assert_kind_of ::Google::Longrunning::GetOperationRequest, request + assert_equal "hello world", request["name"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, get_operation_client_stub do + # Create client + client = ::Google::Cloud::ResourceManager::V3::Projects::Operations.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.get_operation({ name: name }) do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Use named arguments + client.get_operation name: name do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.get_operation ::Google::Longrunning::GetOperationRequest.new(name: name) do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Use hash object with options + client.get_operation({ name: name }, grpc_options) do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Use protobuf object with options + client.get_operation(::Google::Longrunning::GetOperationRequest.new(name: name), grpc_options) do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Verify method calls + assert_equal 5, get_operation_client_stub.call_rpc_count + end + end + + def test_delete_operation + # Create GRPC objects. + grpc_response = ::Google::Protobuf::Empty.new + grpc_operation = GRPC::ActiveCall::Operation.new nil + grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + grpc_options = {} + + # Create request parameters for a unary method. + name = "hello world" + + delete_operation_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :delete_operation, name + assert_kind_of ::Google::Longrunning::DeleteOperationRequest, request + assert_equal "hello world", request["name"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, delete_operation_client_stub do + # Create client + client = ::Google::Cloud::ResourceManager::V3::Projects::Operations.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.delete_operation({ name: name }) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use named arguments + client.delete_operation name: name do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.delete_operation ::Google::Longrunning::DeleteOperationRequest.new(name: name) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use hash object with options + client.delete_operation({ name: name }, grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object with options + client.delete_operation(::Google::Longrunning::DeleteOperationRequest.new(name: name), grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Verify method calls + assert_equal 5, delete_operation_client_stub.call_rpc_count + end + end + + def test_cancel_operation + # Create GRPC objects. + grpc_response = ::Google::Protobuf::Empty.new + grpc_operation = GRPC::ActiveCall::Operation.new nil + grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + grpc_options = {} + + # Create request parameters for a unary method. + name = "hello world" + + cancel_operation_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :cancel_operation, name + assert_kind_of ::Google::Longrunning::CancelOperationRequest, request + assert_equal "hello world", request["name"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, cancel_operation_client_stub do + # Create client + client = ::Google::Cloud::ResourceManager::V3::Projects::Operations.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.cancel_operation({ name: name }) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use named arguments + client.cancel_operation name: name do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.cancel_operation ::Google::Longrunning::CancelOperationRequest.new(name: name) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use hash object with options + client.cancel_operation({ name: name }, grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object with options + client.cancel_operation(::Google::Longrunning::CancelOperationRequest.new(name: name), grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Verify method calls + assert_equal 5, cancel_operation_client_stub.call_rpc_count + end + end + + def test_wait_operation + # Create GRPC objects. + grpc_response = ::Google::Longrunning::Operation.new + grpc_operation = GRPC::ActiveCall::Operation.new nil + grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + grpc_options = {} + + # Create request parameters for a unary method. + name = "hello world" + timeout = {} + + wait_operation_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :wait_operation, name + assert_kind_of ::Google::Longrunning::WaitOperationRequest, request + assert_equal "hello world", request["name"] + assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Protobuf::Duration), request["timeout"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, wait_operation_client_stub do + # Create client + client = ::Google::Cloud::ResourceManager::V3::Projects::Operations.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.wait_operation({ name: name, timeout: timeout }) do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Use named arguments + client.wait_operation name: name, timeout: timeout do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.wait_operation ::Google::Longrunning::WaitOperationRequest.new(name: name, timeout: timeout) do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Use hash object with options + client.wait_operation({ name: name, timeout: timeout }, grpc_options) do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Use protobuf object with options + client.wait_operation(::Google::Longrunning::WaitOperationRequest.new(name: name, timeout: timeout), grpc_options) do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Verify method calls + assert_equal 5, wait_operation_client_stub.call_rpc_count + end + end + + def test_configure + grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + + client = block_config = config = nil + dummy_stub = ClientStub.new nil, nil + Gapic::ServiceStub.stub :new, dummy_stub do + client = ::Google::Cloud::ResourceManager::V3::Projects::Operations.new do |config| + config.credentials = grpc_channel + end + end + + config = client.configure do |c| + block_config = c + end + + assert_same block_config, config + assert_kind_of ::Google::Cloud::ResourceManager::V3::Projects::Operations::Configuration, config + end +end diff --git a/owl-bot-staging/google-cloud-resource_manager-v3/test/google/cloud/resource_manager/v3/projects_paths_test.rb b/owl-bot-staging/google-cloud-resource_manager-v3/test/google/cloud/resource_manager/v3/projects_paths_test.rb new file mode 100644 index 000000000000..d7a8eddcea5c --- /dev/null +++ b/owl-bot-staging/google-cloud-resource_manager-v3/test/google/cloud/resource_manager/v3/projects_paths_test.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 "helper" + +require "gapic/grpc/service_stub" + +require "google/cloud/resource_manager/v3/projects" + +class ::Google::Cloud::ResourceManager::V3::Projects::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_project_path + grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + ::Gapic::ServiceStub.stub :new, DummyStub.new do + client = ::Google::Cloud::ResourceManager::V3::Projects::Client.new do |config| + config.credentials = grpc_channel + end + + path = client.project_path project: "value0" + assert_equal "projects/value0", path + end + end +end diff --git a/owl-bot-staging/google-cloud-resource_manager-v3/test/google/cloud/resource_manager/v3/projects_rest_test.rb b/owl-bot-staging/google-cloud-resource_manager-v3/test/google/cloud/resource_manager/v3/projects_rest_test.rb new file mode 100644 index 000000000000..71932681beca --- /dev/null +++ b/owl-bot-staging/google-cloud-resource_manager-v3/test/google/cloud/resource_manager/v3/projects_rest_test.rb @@ -0,0 +1,704 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +require "helper" +require "gapic/rest" +require "google/cloud/resourcemanager/v3/projects_pb" +require "google/cloud/resource_manager/v3/projects/rest" + + +class ::Google::Cloud::ResourceManager::V3::Projects::Rest::ClientTest < Minitest::Test + class ClientStub + attr_accessor :call_count, :requests + + def initialize response, &block + @response = response + @block = block + @call_count = 0 + @requests = [] + end + + def make_get_request uri:, params: {}, options: {}, method_name: nil + make_http_request :get, uri: uri, body: nil, params: params, options: options, method_name: method_name + end + + def make_delete_request uri:, params: {}, options: {}, method_name: nil + make_http_request :delete, uri: uri, body: nil, params: params, options: options, method_name: method_name + end + + def make_post_request uri:, body: nil, params: {}, options: {}, method_name: nil + make_http_request :post, uri: uri, body: body, params: params, options: options, method_name: method_name + end + + def make_patch_request uri:, body:, params: {}, options: {}, method_name: nil + make_http_request :patch, uri: uri, body: body, params: params, options: options, method_name: method_name + end + + def make_put_request uri:, body:, params: {}, options: {}, method_name: nil + make_http_request :put, uri: uri, body: body, params: params, options: options, method_name: method_name + end + + def make_http_request *args, **kwargs + @call_count += 1 + + @requests << @block&.call(*args, **kwargs) + + @response + end + + def endpoint + "endpoint.example.com" + end + + def universe_domain + "example.com" + end + + def stub_logger + nil + end + + def logger + nil + end + end + + def test_get_project + # Create test objects. + client_result = ::Google::Cloud::ResourceManager::V3::Project.new + http_response = OpenStruct.new body: client_result.to_json + + call_options = {} + + # Create request parameters for a unary method. + name = "hello world" + + get_project_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| + assert options.metadata.key? :"x-goog-api-client" + assert options.metadata[:"x-goog-api-client"].include? "rest" + refute options.metadata[:"x-goog-api-client"].include? "grpc" + end + + ::Google::Cloud::ResourceManager::V3::Projects::Rest::ServiceStub.stub :transcode_get_project_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, get_project_client_stub do + # Create client + client = ::Google::Cloud::ResourceManager::V3::Projects::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.get_project({ name: name }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.get_project name: name do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.get_project ::Google::Cloud::ResourceManager::V3::GetProjectRequest.new(name: name) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + client.get_project({ name: name }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + client.get_project(::Google::Cloud::ResourceManager::V3::GetProjectRequest.new(name: name), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, get_project_client_stub.call_count + end + end + end + + def test_list_projects + # Create test objects. + client_result = ::Google::Cloud::ResourceManager::V3::ListProjectsResponse.new + http_response = OpenStruct.new body: client_result.to_json + + call_options = {} + + # Create request parameters for a unary method. + parent = "hello world" + page_token = "hello world" + page_size = 42 + show_deleted = true + + list_projects_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| + assert options.metadata.key? :"x-goog-api-client" + assert options.metadata[:"x-goog-api-client"].include? "rest" + refute options.metadata[:"x-goog-api-client"].include? "grpc" + end + + ::Google::Cloud::ResourceManager::V3::Projects::Rest::ServiceStub.stub :transcode_list_projects_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, list_projects_client_stub do + # Create client + client = ::Google::Cloud::ResourceManager::V3::Projects::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.list_projects({ parent: parent, page_token: page_token, page_size: page_size, show_deleted: show_deleted }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.list_projects parent: parent, page_token: page_token, page_size: page_size, show_deleted: show_deleted do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.list_projects ::Google::Cloud::ResourceManager::V3::ListProjectsRequest.new(parent: parent, page_token: page_token, page_size: page_size, show_deleted: show_deleted) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + client.list_projects({ parent: parent, page_token: page_token, page_size: page_size, show_deleted: show_deleted }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + client.list_projects(::Google::Cloud::ResourceManager::V3::ListProjectsRequest.new(parent: parent, page_token: page_token, page_size: page_size, show_deleted: show_deleted), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, list_projects_client_stub.call_count + end + end + end + + def test_search_projects + # Create test objects. + client_result = ::Google::Cloud::ResourceManager::V3::SearchProjectsResponse.new + http_response = OpenStruct.new body: client_result.to_json + + call_options = {} + + # Create request parameters for a unary method. + query = "hello world" + page_token = "hello world" + page_size = 42 + + search_projects_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| + assert options.metadata.key? :"x-goog-api-client" + assert options.metadata[:"x-goog-api-client"].include? "rest" + refute options.metadata[:"x-goog-api-client"].include? "grpc" + end + + ::Google::Cloud::ResourceManager::V3::Projects::Rest::ServiceStub.stub :transcode_search_projects_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, search_projects_client_stub do + # Create client + client = ::Google::Cloud::ResourceManager::V3::Projects::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.search_projects({ query: query, page_token: page_token, page_size: page_size }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.search_projects query: query, page_token: page_token, page_size: page_size do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.search_projects ::Google::Cloud::ResourceManager::V3::SearchProjectsRequest.new(query: query, page_token: page_token, page_size: page_size) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + client.search_projects({ query: query, page_token: page_token, page_size: page_size }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + client.search_projects(::Google::Cloud::ResourceManager::V3::SearchProjectsRequest.new(query: query, page_token: page_token, page_size: page_size), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, search_projects_client_stub.call_count + end + end + end + + def test_create_project + # 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. + project = {} + + create_project_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| + assert options.metadata.key? :"x-goog-api-client" + assert options.metadata[:"x-goog-api-client"].include? "rest" + refute options.metadata[:"x-goog-api-client"].include? "grpc" + end + + ::Google::Cloud::ResourceManager::V3::Projects::Rest::ServiceStub.stub :transcode_create_project_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, create_project_client_stub do + # Create client + client = ::Google::Cloud::ResourceManager::V3::Projects::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.create_project({ project: project }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.create_project project: project do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.create_project ::Google::Cloud::ResourceManager::V3::CreateProjectRequest.new(project: project) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + client.create_project({ project: project }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + client.create_project(::Google::Cloud::ResourceManager::V3::CreateProjectRequest.new(project: project), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, create_project_client_stub.call_count + end + end + end + + def test_update_project + # 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. + project = {} + update_mask = {} + + update_project_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| + assert options.metadata.key? :"x-goog-api-client" + assert options.metadata[:"x-goog-api-client"].include? "rest" + refute options.metadata[:"x-goog-api-client"].include? "grpc" + end + + ::Google::Cloud::ResourceManager::V3::Projects::Rest::ServiceStub.stub :transcode_update_project_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, update_project_client_stub do + # Create client + client = ::Google::Cloud::ResourceManager::V3::Projects::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.update_project({ project: project, update_mask: update_mask }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.update_project project: project, update_mask: update_mask do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.update_project ::Google::Cloud::ResourceManager::V3::UpdateProjectRequest.new(project: project, update_mask: update_mask) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + client.update_project({ project: project, update_mask: update_mask }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + client.update_project(::Google::Cloud::ResourceManager::V3::UpdateProjectRequest.new(project: project, update_mask: update_mask), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, update_project_client_stub.call_count + end + end + end + + def test_move_project + # 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" + destination_parent = "hello world" + + move_project_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| + assert options.metadata.key? :"x-goog-api-client" + assert options.metadata[:"x-goog-api-client"].include? "rest" + refute options.metadata[:"x-goog-api-client"].include? "grpc" + end + + ::Google::Cloud::ResourceManager::V3::Projects::Rest::ServiceStub.stub :transcode_move_project_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, move_project_client_stub do + # Create client + client = ::Google::Cloud::ResourceManager::V3::Projects::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.move_project({ name: name, destination_parent: destination_parent }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.move_project name: name, destination_parent: destination_parent do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.move_project ::Google::Cloud::ResourceManager::V3::MoveProjectRequest.new(name: name, destination_parent: destination_parent) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + client.move_project({ name: name, destination_parent: destination_parent }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + client.move_project(::Google::Cloud::ResourceManager::V3::MoveProjectRequest.new(name: name, destination_parent: destination_parent), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, move_project_client_stub.call_count + end + end + end + + def test_delete_project + # 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" + + delete_project_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| + assert options.metadata.key? :"x-goog-api-client" + assert options.metadata[:"x-goog-api-client"].include? "rest" + refute options.metadata[:"x-goog-api-client"].include? "grpc" + end + + ::Google::Cloud::ResourceManager::V3::Projects::Rest::ServiceStub.stub :transcode_delete_project_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, delete_project_client_stub do + # Create client + client = ::Google::Cloud::ResourceManager::V3::Projects::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.delete_project({ name: name }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.delete_project name: name do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.delete_project ::Google::Cloud::ResourceManager::V3::DeleteProjectRequest.new(name: name) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + client.delete_project({ name: name }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + client.delete_project(::Google::Cloud::ResourceManager::V3::DeleteProjectRequest.new(name: name), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, delete_project_client_stub.call_count + end + end + end + + def test_undelete_project + # 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" + + undelete_project_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| + assert options.metadata.key? :"x-goog-api-client" + assert options.metadata[:"x-goog-api-client"].include? "rest" + refute options.metadata[:"x-goog-api-client"].include? "grpc" + end + + ::Google::Cloud::ResourceManager::V3::Projects::Rest::ServiceStub.stub :transcode_undelete_project_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, undelete_project_client_stub do + # Create client + client = ::Google::Cloud::ResourceManager::V3::Projects::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.undelete_project({ name: name }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.undelete_project name: name do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.undelete_project ::Google::Cloud::ResourceManager::V3::UndeleteProjectRequest.new(name: name) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + client.undelete_project({ name: name }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + client.undelete_project(::Google::Cloud::ResourceManager::V3::UndeleteProjectRequest.new(name: name), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, undelete_project_client_stub.call_count + end + end + end + + def test_get_iam_policy + # Create test objects. + client_result = ::Google::Iam::V1::Policy.new + http_response = OpenStruct.new body: client_result.to_json + + call_options = {} + + # Create request parameters for a unary method. + resource = "hello world" + options = {} + + get_iam_policy_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| + assert options.metadata.key? :"x-goog-api-client" + assert options.metadata[:"x-goog-api-client"].include? "rest" + refute options.metadata[:"x-goog-api-client"].include? "grpc" + end + + ::Google::Cloud::ResourceManager::V3::Projects::Rest::ServiceStub.stub :transcode_get_iam_policy_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, get_iam_policy_client_stub do + # Create client + client = ::Google::Cloud::ResourceManager::V3::Projects::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.get_iam_policy({ resource: resource, options: options }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.get_iam_policy resource: resource, options: options do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.get_iam_policy ::Google::Iam::V1::GetIamPolicyRequest.new(resource: resource, options: options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + client.get_iam_policy({ resource: resource, options: options }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + client.get_iam_policy(::Google::Iam::V1::GetIamPolicyRequest.new(resource: resource, options: options), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, get_iam_policy_client_stub.call_count + end + end + end + + def test_set_iam_policy + # Create test objects. + client_result = ::Google::Iam::V1::Policy.new + http_response = OpenStruct.new body: client_result.to_json + + call_options = {} + + # Create request parameters for a unary method. + resource = "hello world" + policy = {} + update_mask = {} + + set_iam_policy_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| + assert options.metadata.key? :"x-goog-api-client" + assert options.metadata[:"x-goog-api-client"].include? "rest" + refute options.metadata[:"x-goog-api-client"].include? "grpc" + end + + ::Google::Cloud::ResourceManager::V3::Projects::Rest::ServiceStub.stub :transcode_set_iam_policy_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, set_iam_policy_client_stub do + # Create client + client = ::Google::Cloud::ResourceManager::V3::Projects::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.set_iam_policy({ resource: resource, policy: policy, update_mask: update_mask }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.set_iam_policy resource: resource, policy: policy, update_mask: update_mask do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.set_iam_policy ::Google::Iam::V1::SetIamPolicyRequest.new(resource: resource, policy: policy, update_mask: update_mask) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + client.set_iam_policy({ resource: resource, policy: policy, update_mask: update_mask }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + client.set_iam_policy(::Google::Iam::V1::SetIamPolicyRequest.new(resource: resource, policy: policy, update_mask: update_mask), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, set_iam_policy_client_stub.call_count + end + end + end + + def test_test_iam_permissions + # Create test objects. + client_result = ::Google::Iam::V1::TestIamPermissionsResponse.new + http_response = OpenStruct.new body: client_result.to_json + + call_options = {} + + # Create request parameters for a unary method. + resource = "hello world" + permissions = ["hello world"] + + test_iam_permissions_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| + assert options.metadata.key? :"x-goog-api-client" + assert options.metadata[:"x-goog-api-client"].include? "rest" + refute options.metadata[:"x-goog-api-client"].include? "grpc" + end + + ::Google::Cloud::ResourceManager::V3::Projects::Rest::ServiceStub.stub :transcode_test_iam_permissions_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, test_iam_permissions_client_stub do + # Create client + client = ::Google::Cloud::ResourceManager::V3::Projects::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.test_iam_permissions({ resource: resource, permissions: permissions }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.test_iam_permissions resource: resource, permissions: permissions do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.test_iam_permissions ::Google::Iam::V1::TestIamPermissionsRequest.new(resource: resource, permissions: permissions) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + client.test_iam_permissions({ resource: resource, permissions: permissions }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + client.test_iam_permissions(::Google::Iam::V1::TestIamPermissionsRequest.new(resource: resource, permissions: permissions), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, test_iam_permissions_client_stub.call_count + end + end + end + + def test_configure + credentials_token = :dummy_value + + client = block_config = config = nil + dummy_stub = ClientStub.new nil + Gapic::Rest::ClientStub.stub :new, dummy_stub do + client = ::Google::Cloud::ResourceManager::V3::Projects::Rest::Client.new do |config| + config.credentials = credentials_token + end + end + + config = client.configure do |c| + block_config = c + end + + assert_same block_config, config + assert_kind_of ::Google::Cloud::ResourceManager::V3::Projects::Rest::Client::Configuration, config + end +end diff --git a/owl-bot-staging/google-cloud-resource_manager-v3/test/google/cloud/resource_manager/v3/projects_test.rb b/owl-bot-staging/google-cloud-resource_manager-v3/test/google/cloud/resource_manager/v3/projects_test.rb new file mode 100644 index 000000000000..40a0dac92373 --- /dev/null +++ b/owl-bot-staging/google-cloud-resource_manager-v3/test/google/cloud/resource_manager/v3/projects_test.rb @@ -0,0 +1,813 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +require "helper" + +require "gapic/grpc/service_stub" + +require "google/cloud/resourcemanager/v3/projects_pb" +require "google/cloud/resource_manager/v3/projects" + +class ::Google::Cloud::ResourceManager::V3::Projects::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_get_project + # Create GRPC objects. + grpc_response = ::Google::Cloud::ResourceManager::V3::Project.new + grpc_operation = GRPC::ActiveCall::Operation.new nil + grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + grpc_options = {} + + # Create request parameters for a unary method. + name = "hello world" + + get_project_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :get_project, name + assert_kind_of ::Google::Cloud::ResourceManager::V3::GetProjectRequest, request + assert_equal "hello world", request["name"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, get_project_client_stub do + # Create client + client = ::Google::Cloud::ResourceManager::V3::Projects::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.get_project({ name: name }) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use named arguments + client.get_project name: name do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.get_project ::Google::Cloud::ResourceManager::V3::GetProjectRequest.new(name: name) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use hash object with options + client.get_project({ name: name }, grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object with options + client.get_project(::Google::Cloud::ResourceManager::V3::GetProjectRequest.new(name: name), grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Verify method calls + assert_equal 5, get_project_client_stub.call_rpc_count + end + end + + def test_list_projects + # Create GRPC objects. + grpc_response = ::Google::Cloud::ResourceManager::V3::ListProjectsResponse.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_token = "hello world" + page_size = 42 + show_deleted = true + + list_projects_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :list_projects, name + assert_kind_of ::Google::Cloud::ResourceManager::V3::ListProjectsRequest, request + assert_equal "hello world", request["parent"] + assert_equal "hello world", request["page_token"] + assert_equal 42, request["page_size"] + assert_equal true, request["show_deleted"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, list_projects_client_stub do + # Create client + client = ::Google::Cloud::ResourceManager::V3::Projects::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.list_projects({ parent: parent, page_token: page_token, page_size: page_size, show_deleted: show_deleted }) 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_projects parent: parent, page_token: page_token, page_size: page_size, show_deleted: show_deleted 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_projects ::Google::Cloud::ResourceManager::V3::ListProjectsRequest.new(parent: parent, page_token: page_token, page_size: page_size, show_deleted: show_deleted) 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_projects({ parent: parent, page_token: page_token, page_size: page_size, show_deleted: show_deleted }, 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_projects(::Google::Cloud::ResourceManager::V3::ListProjectsRequest.new(parent: parent, page_token: page_token, page_size: page_size, show_deleted: show_deleted), 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_projects_client_stub.call_rpc_count + end + end + + def test_search_projects + # Create GRPC objects. + grpc_response = ::Google::Cloud::ResourceManager::V3::SearchProjectsResponse.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. + query = "hello world" + page_token = "hello world" + page_size = 42 + + search_projects_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :search_projects, name + assert_kind_of ::Google::Cloud::ResourceManager::V3::SearchProjectsRequest, request + assert_equal "hello world", request["query"] + assert_equal "hello world", request["page_token"] + assert_equal 42, request["page_size"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, search_projects_client_stub do + # Create client + client = ::Google::Cloud::ResourceManager::V3::Projects::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.search_projects({ query: query, page_token: page_token, page_size: page_size }) 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_projects query: query, page_token: page_token, page_size: page_size 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_projects ::Google::Cloud::ResourceManager::V3::SearchProjectsRequest.new(query: query, page_token: page_token, page_size: page_size) 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_projects({ query: query, page_token: page_token, page_size: page_size }, 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_projects(::Google::Cloud::ResourceManager::V3::SearchProjectsRequest.new(query: query, page_token: page_token, page_size: page_size), 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_projects_client_stub.call_rpc_count + end + end + + def test_create_project + # 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. + project = {} + + create_project_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :create_project, name + assert_kind_of ::Google::Cloud::ResourceManager::V3::CreateProjectRequest, request + assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::ResourceManager::V3::Project), request["project"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, create_project_client_stub do + # Create client + client = ::Google::Cloud::ResourceManager::V3::Projects::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.create_project({ project: project }) 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_project project: project 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_project ::Google::Cloud::ResourceManager::V3::CreateProjectRequest.new(project: project) 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_project({ project: project }, 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_project(::Google::Cloud::ResourceManager::V3::CreateProjectRequest.new(project: project), 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_project_client_stub.call_rpc_count + end + end + + def test_update_project + # 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. + project = {} + update_mask = {} + + update_project_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :update_project, name + assert_kind_of ::Google::Cloud::ResourceManager::V3::UpdateProjectRequest, request + assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::ResourceManager::V3::Project), request["project"] + assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Protobuf::FieldMask), request["update_mask"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, update_project_client_stub do + # Create client + client = ::Google::Cloud::ResourceManager::V3::Projects::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.update_project({ project: project, 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_project project: project, 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_project ::Google::Cloud::ResourceManager::V3::UpdateProjectRequest.new(project: project, 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_project({ project: project, 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_project(::Google::Cloud::ResourceManager::V3::UpdateProjectRequest.new(project: project, 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_project_client_stub.call_rpc_count + end + end + + def test_move_project + # Create GRPC objects. + grpc_response = ::Google::Longrunning::Operation.new + grpc_operation = GRPC::ActiveCall::Operation.new nil + grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + grpc_options = {} + + # Create request parameters for a unary method. + name = "hello world" + destination_parent = "hello world" + + move_project_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :move_project, name + assert_kind_of ::Google::Cloud::ResourceManager::V3::MoveProjectRequest, request + assert_equal "hello world", request["name"] + assert_equal "hello world", request["destination_parent"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, move_project_client_stub do + # Create client + client = ::Google::Cloud::ResourceManager::V3::Projects::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.move_project({ name: name, destination_parent: destination_parent }) 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.move_project name: name, destination_parent: destination_parent 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.move_project ::Google::Cloud::ResourceManager::V3::MoveProjectRequest.new(name: name, destination_parent: destination_parent) 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.move_project({ name: name, destination_parent: destination_parent }, 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.move_project(::Google::Cloud::ResourceManager::V3::MoveProjectRequest.new(name: name, destination_parent: destination_parent), 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, move_project_client_stub.call_rpc_count + end + end + + def test_delete_project + # 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" + + delete_project_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :delete_project, name + assert_kind_of ::Google::Cloud::ResourceManager::V3::DeleteProjectRequest, request + assert_equal "hello world", request["name"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, delete_project_client_stub do + # Create client + client = ::Google::Cloud::ResourceManager::V3::Projects::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.delete_project({ 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.delete_project 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.delete_project ::Google::Cloud::ResourceManager::V3::DeleteProjectRequest.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.delete_project({ 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.delete_project(::Google::Cloud::ResourceManager::V3::DeleteProjectRequest.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, delete_project_client_stub.call_rpc_count + end + end + + def test_undelete_project + # 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" + + undelete_project_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :undelete_project, name + assert_kind_of ::Google::Cloud::ResourceManager::V3::UndeleteProjectRequest, request + assert_equal "hello world", request["name"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, undelete_project_client_stub do + # Create client + client = ::Google::Cloud::ResourceManager::V3::Projects::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.undelete_project({ 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.undelete_project 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.undelete_project ::Google::Cloud::ResourceManager::V3::UndeleteProjectRequest.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.undelete_project({ 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.undelete_project(::Google::Cloud::ResourceManager::V3::UndeleteProjectRequest.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, undelete_project_client_stub.call_rpc_count + end + end + + def test_get_iam_policy + # Create GRPC objects. + grpc_response = ::Google::Iam::V1::Policy.new + grpc_operation = GRPC::ActiveCall::Operation.new nil + grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + grpc_options = {} + + # Create request parameters for a unary method. + resource = "hello world" + options = {} + + get_iam_policy_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :get_iam_policy, name + assert_kind_of ::Google::Iam::V1::GetIamPolicyRequest, request + assert_equal "hello world", request["resource"] + assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Iam::V1::GetPolicyOptions), request["options"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, get_iam_policy_client_stub do + # Create client + client = ::Google::Cloud::ResourceManager::V3::Projects::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.get_iam_policy({ resource: resource, options: options }) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use named arguments + client.get_iam_policy resource: resource, options: options do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.get_iam_policy ::Google::Iam::V1::GetIamPolicyRequest.new(resource: resource, options: options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use hash object with options + client.get_iam_policy({ resource: resource, options: options }, grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object with options + client.get_iam_policy(::Google::Iam::V1::GetIamPolicyRequest.new(resource: resource, options: options), grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Verify method calls + assert_equal 5, get_iam_policy_client_stub.call_rpc_count + end + end + + def test_set_iam_policy + # Create GRPC objects. + grpc_response = ::Google::Iam::V1::Policy.new + grpc_operation = GRPC::ActiveCall::Operation.new nil + grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + grpc_options = {} + + # Create request parameters for a unary method. + resource = "hello world" + policy = {} + update_mask = {} + + set_iam_policy_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :set_iam_policy, name + assert_kind_of ::Google::Iam::V1::SetIamPolicyRequest, request + assert_equal "hello world", request["resource"] + assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Iam::V1::Policy), request["policy"] + assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Protobuf::FieldMask), request["update_mask"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, set_iam_policy_client_stub do + # Create client + client = ::Google::Cloud::ResourceManager::V3::Projects::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.set_iam_policy({ resource: resource, policy: policy, update_mask: update_mask }) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use named arguments + client.set_iam_policy resource: resource, policy: policy, update_mask: update_mask do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.set_iam_policy ::Google::Iam::V1::SetIamPolicyRequest.new(resource: resource, policy: policy, update_mask: update_mask) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use hash object with options + client.set_iam_policy({ resource: resource, policy: policy, update_mask: update_mask }, grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object with options + client.set_iam_policy(::Google::Iam::V1::SetIamPolicyRequest.new(resource: resource, policy: policy, update_mask: update_mask), grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Verify method calls + assert_equal 5, set_iam_policy_client_stub.call_rpc_count + end + end + + def test_test_iam_permissions + # Create GRPC objects. + grpc_response = ::Google::Iam::V1::TestIamPermissionsResponse.new + grpc_operation = GRPC::ActiveCall::Operation.new nil + grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + grpc_options = {} + + # Create request parameters for a unary method. + resource = "hello world" + permissions = ["hello world"] + + test_iam_permissions_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :test_iam_permissions, name + assert_kind_of ::Google::Iam::V1::TestIamPermissionsRequest, request + assert_equal "hello world", request["resource"] + assert_equal ["hello world"], request["permissions"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, test_iam_permissions_client_stub do + # Create client + client = ::Google::Cloud::ResourceManager::V3::Projects::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.test_iam_permissions({ resource: resource, permissions: permissions }) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use named arguments + client.test_iam_permissions resource: resource, permissions: permissions do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.test_iam_permissions ::Google::Iam::V1::TestIamPermissionsRequest.new(resource: resource, permissions: permissions) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use hash object with options + client.test_iam_permissions({ resource: resource, permissions: permissions }, grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object with options + client.test_iam_permissions(::Google::Iam::V1::TestIamPermissionsRequest.new(resource: resource, permissions: permissions), grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Verify method calls + assert_equal 5, test_iam_permissions_client_stub.call_rpc_count + end + end + + def test_configure + grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + + client = block_config = config = nil + dummy_stub = ClientStub.new nil, nil + Gapic::ServiceStub.stub :new, dummy_stub do + client = ::Google::Cloud::ResourceManager::V3::Projects::Client.new do |config| + config.credentials = grpc_channel + end + end + + config = client.configure do |c| + block_config = c + end + + assert_same block_config, config + assert_kind_of ::Google::Cloud::ResourceManager::V3::Projects::Client::Configuration, config + end + + def test_credentials + key = OpenSSL::PKey::RSA.new 2048 + cred_json = { + "private_key" => key.to_pem, + "client_email" => "app@developer.gserviceaccount.com", + "type" => "service_account" + } + key_file = StringIO.new cred_json.to_json + creds = Google::Auth::ServiceAccountCredentials.make_creds({ json_key_io: key_file }) + + dummy_stub = ClientStub.new nil, nil + Gapic::ServiceStub.stub :new, dummy_stub do + client = ::Google::Cloud::ResourceManager::V3::Projects::Client.new do |config| + config.credentials = creds + end + assert_kind_of ::Google::Cloud::ResourceManager::V3::Projects::Client, client + assert_equal creds, client.configure.credentials + end + end + + def test_operations_client + grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + + client = nil + dummy_stub = ClientStub.new nil, nil + Gapic::ServiceStub.stub :new, dummy_stub do + client = ::Google::Cloud::ResourceManager::V3::Projects::Client.new do |config| + config.credentials = grpc_channel + end + end + + assert_kind_of ::Google::Cloud::ResourceManager::V3::Projects::Operations, client.operations_client + end +end diff --git a/owl-bot-staging/google-cloud-resource_manager-v3/test/google/cloud/resource_manager/v3/tag_bindings_operations_test.rb b/owl-bot-staging/google-cloud-resource_manager-v3/test/google/cloud/resource_manager/v3/tag_bindings_operations_test.rb new file mode 100644 index 000000000000..a2626e3b2e5c --- /dev/null +++ b/owl-bot-staging/google-cloud-resource_manager-v3/test/google/cloud/resource_manager/v3/tag_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/cloud/resourcemanager/v3/tag_bindings_pb" +require "google/cloud/resourcemanager/v3/tag_bindings_services_pb" +require "google/cloud/resource_manager/v3/tag_bindings" + +class ::Google::Cloud::ResourceManager::V3::TagBindings::OperationsTest < Minitest::Test + class ClientStub + attr_accessor :call_rpc_count, :requests + + def initialize response, operation, &block + @response = response + @operation = operation + @block = block + @call_rpc_count = 0 + @requests = [] + end + + def call_rpc *args, **kwargs + @call_rpc_count += 1 + + @requests << @block&.call(*args, **kwargs) + + catch :response do + yield @response, @operation if block_given? + @response + end + end + + def endpoint + "endpoint.example.com" + end + + def universe_domain + "example.com" + end + + def stub_logger + nil + end + + def logger + nil + end + end + + def test_list_operations + # Create GRPC objects. + grpc_response = ::Google::Longrunning::ListOperationsResponse.new + grpc_operation = GRPC::ActiveCall::Operation.new nil + grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + grpc_options = {} + + # Create request parameters for a unary method. + name = "hello world" + filter = "hello world" + page_size = 42 + page_token = "hello world" + return_partial_success = true + + list_operations_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :list_operations, name + assert_kind_of ::Google::Longrunning::ListOperationsRequest, request + assert_equal "hello world", request["name"] + assert_equal "hello world", request["filter"] + assert_equal 42, request["page_size"] + assert_equal "hello world", request["page_token"] + assert_equal true, request["return_partial_success"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, list_operations_client_stub do + # Create client + client = ::Google::Cloud::ResourceManager::V3::TagBindings::Operations.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.list_operations({ name: name, filter: filter, page_size: page_size, page_token: page_token, return_partial_success: return_partial_success }) do |response, operation| + assert_kind_of Gapic::PagedEnumerable, response + assert_equal grpc_response, response.response + assert_equal grpc_operation, operation + end + + # Use named arguments + client.list_operations name: name, filter: filter, page_size: page_size, page_token: page_token, return_partial_success: return_partial_success do |response, operation| + assert_kind_of Gapic::PagedEnumerable, response + assert_equal grpc_response, response.response + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.list_operations ::Google::Longrunning::ListOperationsRequest.new(name: name, filter: filter, page_size: page_size, page_token: page_token, return_partial_success: return_partial_success) do |response, operation| + assert_kind_of Gapic::PagedEnumerable, response + assert_equal grpc_response, response.response + assert_equal grpc_operation, operation + end + + # Use hash object with options + client.list_operations({ name: name, filter: filter, page_size: page_size, page_token: page_token, return_partial_success: return_partial_success }, grpc_options) do |response, operation| + assert_kind_of Gapic::PagedEnumerable, response + assert_equal grpc_response, response.response + assert_equal grpc_operation, operation + end + + # Use protobuf object with options + client.list_operations(::Google::Longrunning::ListOperationsRequest.new(name: name, filter: filter, page_size: page_size, page_token: page_token, return_partial_success: return_partial_success), grpc_options) do |response, operation| + assert_kind_of Gapic::PagedEnumerable, response + assert_equal grpc_response, response.response + assert_equal grpc_operation, operation + end + + # Verify method calls + assert_equal 5, list_operations_client_stub.call_rpc_count + end + end + + def test_get_operation + # Create GRPC objects. + grpc_response = ::Google::Longrunning::Operation.new + grpc_operation = GRPC::ActiveCall::Operation.new nil + grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + grpc_options = {} + + # Create request parameters for a unary method. + name = "hello world" + + get_operation_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :get_operation, name + assert_kind_of ::Google::Longrunning::GetOperationRequest, request + assert_equal "hello world", request["name"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, get_operation_client_stub do + # Create client + client = ::Google::Cloud::ResourceManager::V3::TagBindings::Operations.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.get_operation({ name: name }) do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Use named arguments + client.get_operation name: name do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.get_operation ::Google::Longrunning::GetOperationRequest.new(name: name) do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Use hash object with options + client.get_operation({ name: name }, grpc_options) do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Use protobuf object with options + client.get_operation(::Google::Longrunning::GetOperationRequest.new(name: name), grpc_options) do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Verify method calls + assert_equal 5, get_operation_client_stub.call_rpc_count + end + end + + def test_delete_operation + # Create GRPC objects. + grpc_response = ::Google::Protobuf::Empty.new + grpc_operation = GRPC::ActiveCall::Operation.new nil + grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + grpc_options = {} + + # Create request parameters for a unary method. + name = "hello world" + + delete_operation_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :delete_operation, name + assert_kind_of ::Google::Longrunning::DeleteOperationRequest, request + assert_equal "hello world", request["name"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, delete_operation_client_stub do + # Create client + client = ::Google::Cloud::ResourceManager::V3::TagBindings::Operations.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.delete_operation({ name: name }) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use named arguments + client.delete_operation name: name do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.delete_operation ::Google::Longrunning::DeleteOperationRequest.new(name: name) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use hash object with options + client.delete_operation({ name: name }, grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object with options + client.delete_operation(::Google::Longrunning::DeleteOperationRequest.new(name: name), grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Verify method calls + assert_equal 5, delete_operation_client_stub.call_rpc_count + end + end + + def test_cancel_operation + # Create GRPC objects. + grpc_response = ::Google::Protobuf::Empty.new + grpc_operation = GRPC::ActiveCall::Operation.new nil + grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + grpc_options = {} + + # Create request parameters for a unary method. + name = "hello world" + + cancel_operation_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :cancel_operation, name + assert_kind_of ::Google::Longrunning::CancelOperationRequest, request + assert_equal "hello world", request["name"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, cancel_operation_client_stub do + # Create client + client = ::Google::Cloud::ResourceManager::V3::TagBindings::Operations.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.cancel_operation({ name: name }) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use named arguments + client.cancel_operation name: name do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.cancel_operation ::Google::Longrunning::CancelOperationRequest.new(name: name) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use hash object with options + client.cancel_operation({ name: name }, grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object with options + client.cancel_operation(::Google::Longrunning::CancelOperationRequest.new(name: name), grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Verify method calls + assert_equal 5, cancel_operation_client_stub.call_rpc_count + end + end + + def test_wait_operation + # Create GRPC objects. + grpc_response = ::Google::Longrunning::Operation.new + grpc_operation = GRPC::ActiveCall::Operation.new nil + grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + grpc_options = {} + + # Create request parameters for a unary method. + name = "hello world" + timeout = {} + + wait_operation_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :wait_operation, name + assert_kind_of ::Google::Longrunning::WaitOperationRequest, request + assert_equal "hello world", request["name"] + assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Protobuf::Duration), request["timeout"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, wait_operation_client_stub do + # Create client + client = ::Google::Cloud::ResourceManager::V3::TagBindings::Operations.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.wait_operation({ name: name, timeout: timeout }) do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Use named arguments + client.wait_operation name: name, timeout: timeout do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.wait_operation ::Google::Longrunning::WaitOperationRequest.new(name: name, timeout: timeout) do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Use hash object with options + client.wait_operation({ name: name, timeout: timeout }, grpc_options) do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Use protobuf object with options + client.wait_operation(::Google::Longrunning::WaitOperationRequest.new(name: name, timeout: timeout), grpc_options) do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Verify method calls + assert_equal 5, wait_operation_client_stub.call_rpc_count + end + end + + def test_configure + grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + + client = block_config = config = nil + dummy_stub = ClientStub.new nil, nil + Gapic::ServiceStub.stub :new, dummy_stub do + client = ::Google::Cloud::ResourceManager::V3::TagBindings::Operations.new do |config| + config.credentials = grpc_channel + end + end + + config = client.configure do |c| + block_config = c + end + + assert_same block_config, config + assert_kind_of ::Google::Cloud::ResourceManager::V3::TagBindings::Operations::Configuration, config + end +end diff --git a/owl-bot-staging/google-cloud-resource_manager-v3/test/google/cloud/resource_manager/v3/tag_bindings_paths_test.rb b/owl-bot-staging/google-cloud-resource_manager-v3/test/google/cloud/resource_manager/v3/tag_bindings_paths_test.rb new file mode 100644 index 000000000000..a67fdda9f061 --- /dev/null +++ b/owl-bot-staging/google-cloud-resource_manager-v3/test/google/cloud/resource_manager/v3/tag_bindings_paths_test.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 "helper" + +require "gapic/grpc/service_stub" + +require "google/cloud/resource_manager/v3/tag_bindings" + +class ::Google::Cloud::ResourceManager::V3::TagBindings::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_tag_binding_path + grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + ::Gapic::ServiceStub.stub :new, DummyStub.new do + client = ::Google::Cloud::ResourceManager::V3::TagBindings::Client.new do |config| + config.credentials = grpc_channel + end + + path = client.tag_binding_path tag_binding: "value0" + assert_equal "tagBindings/value0", path + end + end +end diff --git a/owl-bot-staging/google-cloud-resource_manager-v3/test/google/cloud/resource_manager/v3/tag_bindings_rest_test.rb b/owl-bot-staging/google-cloud-resource_manager-v3/test/google/cloud/resource_manager/v3/tag_bindings_rest_test.rb new file mode 100644 index 000000000000..83ca80f81e0f --- /dev/null +++ b/owl-bot-staging/google-cloud-resource_manager-v3/test/google/cloud/resource_manager/v3/tag_bindings_rest_test.rb @@ -0,0 +1,320 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +require "helper" +require "gapic/rest" +require "google/cloud/resourcemanager/v3/tag_bindings_pb" +require "google/cloud/resource_manager/v3/tag_bindings/rest" + + +class ::Google::Cloud::ResourceManager::V3::TagBindings::Rest::ClientTest < Minitest::Test + class ClientStub + attr_accessor :call_count, :requests + + def initialize response, &block + @response = response + @block = block + @call_count = 0 + @requests = [] + end + + def make_get_request uri:, params: {}, options: {}, method_name: nil + make_http_request :get, uri: uri, body: nil, params: params, options: options, method_name: method_name + end + + def make_delete_request uri:, params: {}, options: {}, method_name: nil + make_http_request :delete, uri: uri, body: nil, params: params, options: options, method_name: method_name + end + + def make_post_request uri:, body: nil, params: {}, options: {}, method_name: nil + make_http_request :post, uri: uri, body: body, params: params, options: options, method_name: method_name + end + + def make_patch_request uri:, body:, params: {}, options: {}, method_name: nil + make_http_request :patch, uri: uri, body: body, params: params, options: options, method_name: method_name + end + + def make_put_request uri:, body:, params: {}, options: {}, method_name: nil + make_http_request :put, uri: uri, body: body, params: params, options: options, method_name: method_name + end + + def make_http_request *args, **kwargs + @call_count += 1 + + @requests << @block&.call(*args, **kwargs) + + @response + end + + def endpoint + "endpoint.example.com" + end + + def universe_domain + "example.com" + end + + def stub_logger + nil + end + + def logger + nil + end + end + + def test_list_tag_bindings + # Create test objects. + client_result = ::Google::Cloud::ResourceManager::V3::ListTagBindingsResponse.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_tag_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::Cloud::ResourceManager::V3::TagBindings::Rest::ServiceStub.stub :transcode_list_tag_bindings_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, list_tag_bindings_client_stub do + # Create client + client = ::Google::Cloud::ResourceManager::V3::TagBindings::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.list_tag_bindings({ 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_tag_bindings 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_tag_bindings ::Google::Cloud::ResourceManager::V3::ListTagBindingsRequest.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_tag_bindings({ 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_tag_bindings(::Google::Cloud::ResourceManager::V3::ListTagBindingsRequest.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_tag_bindings_client_stub.call_count + end + end + end + + def test_create_tag_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. + tag_binding = {} + validate_only = true + + create_tag_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::Cloud::ResourceManager::V3::TagBindings::Rest::ServiceStub.stub :transcode_create_tag_binding_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, create_tag_binding_client_stub do + # Create client + client = ::Google::Cloud::ResourceManager::V3::TagBindings::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.create_tag_binding({ tag_binding: tag_binding, validate_only: validate_only }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.create_tag_binding tag_binding: tag_binding, validate_only: validate_only do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.create_tag_binding ::Google::Cloud::ResourceManager::V3::CreateTagBindingRequest.new(tag_binding: tag_binding, validate_only: validate_only) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + client.create_tag_binding({ tag_binding: tag_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_tag_binding(::Google::Cloud::ResourceManager::V3::CreateTagBindingRequest.new(tag_binding: tag_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_tag_binding_client_stub.call_count + end + end + end + + def test_delete_tag_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" + + delete_tag_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::Cloud::ResourceManager::V3::TagBindings::Rest::ServiceStub.stub :transcode_delete_tag_binding_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, delete_tag_binding_client_stub do + # Create client + client = ::Google::Cloud::ResourceManager::V3::TagBindings::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.delete_tag_binding({ name: name }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.delete_tag_binding name: name do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.delete_tag_binding ::Google::Cloud::ResourceManager::V3::DeleteTagBindingRequest.new(name: name) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + client.delete_tag_binding({ name: name }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + client.delete_tag_binding(::Google::Cloud::ResourceManager::V3::DeleteTagBindingRequest.new(name: name), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, delete_tag_binding_client_stub.call_count + end + end + end + + def test_list_effective_tags + # Create test objects. + client_result = ::Google::Cloud::ResourceManager::V3::ListEffectiveTagsResponse.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_effective_tags_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| + assert options.metadata.key? :"x-goog-api-client" + assert options.metadata[:"x-goog-api-client"].include? "rest" + refute options.metadata[:"x-goog-api-client"].include? "grpc" + end + + ::Google::Cloud::ResourceManager::V3::TagBindings::Rest::ServiceStub.stub :transcode_list_effective_tags_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, list_effective_tags_client_stub do + # Create client + client = ::Google::Cloud::ResourceManager::V3::TagBindings::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.list_effective_tags({ 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_effective_tags 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_effective_tags ::Google::Cloud::ResourceManager::V3::ListEffectiveTagsRequest.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_effective_tags({ 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_effective_tags(::Google::Cloud::ResourceManager::V3::ListEffectiveTagsRequest.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_effective_tags_client_stub.call_count + end + end + end + + def test_configure + credentials_token = :dummy_value + + client = block_config = config = nil + dummy_stub = ClientStub.new nil + Gapic::Rest::ClientStub.stub :new, dummy_stub do + client = ::Google::Cloud::ResourceManager::V3::TagBindings::Rest::Client.new do |config| + config.credentials = credentials_token + end + end + + config = client.configure do |c| + block_config = c + end + + assert_same block_config, config + assert_kind_of ::Google::Cloud::ResourceManager::V3::TagBindings::Rest::Client::Configuration, config + end +end diff --git a/owl-bot-staging/google-cloud-resource_manager-v3/test/google/cloud/resource_manager/v3/tag_bindings_test.rb b/owl-bot-staging/google-cloud-resource_manager-v3/test/google/cloud/resource_manager/v3/tag_bindings_test.rb new file mode 100644 index 000000000000..e6edf1976870 --- /dev/null +++ b/owl-bot-staging/google-cloud-resource_manager-v3/test/google/cloud/resource_manager/v3/tag_bindings_test.rb @@ -0,0 +1,380 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +require "helper" + +require "gapic/grpc/service_stub" + +require "google/cloud/resourcemanager/v3/tag_bindings_pb" +require "google/cloud/resource_manager/v3/tag_bindings" + +class ::Google::Cloud::ResourceManager::V3::TagBindings::ClientTest < Minitest::Test + class ClientStub + attr_accessor :call_rpc_count, :requests + + def initialize response, operation, &block + @response = response + @operation = operation + @block = block + @call_rpc_count = 0 + @requests = [] + end + + def call_rpc *args, **kwargs + @call_rpc_count += 1 + + @requests << @block&.call(*args, **kwargs) + + catch :response do + yield @response, @operation if block_given? + @response + end + end + + def endpoint + "endpoint.example.com" + end + + def universe_domain + "example.com" + end + + def stub_logger + nil + end + + def logger + nil + end + end + + def test_list_tag_bindings + # Create GRPC objects. + grpc_response = ::Google::Cloud::ResourceManager::V3::ListTagBindingsResponse.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_tag_bindings_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :list_tag_bindings, name + assert_kind_of ::Google::Cloud::ResourceManager::V3::ListTagBindingsRequest, 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_tag_bindings_client_stub do + # Create client + client = ::Google::Cloud::ResourceManager::V3::TagBindings::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.list_tag_bindings({ 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_tag_bindings 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_tag_bindings ::Google::Cloud::ResourceManager::V3::ListTagBindingsRequest.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_tag_bindings({ 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_tag_bindings(::Google::Cloud::ResourceManager::V3::ListTagBindingsRequest.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_tag_bindings_client_stub.call_rpc_count + end + end + + def test_create_tag_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. + tag_binding = {} + validate_only = true + + create_tag_binding_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :create_tag_binding, name + assert_kind_of ::Google::Cloud::ResourceManager::V3::CreateTagBindingRequest, request + assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::ResourceManager::V3::TagBinding), request["tag_binding"] + assert_equal true, request["validate_only"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, create_tag_binding_client_stub do + # Create client + client = ::Google::Cloud::ResourceManager::V3::TagBindings::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.create_tag_binding({ tag_binding: tag_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_tag_binding tag_binding: tag_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_tag_binding ::Google::Cloud::ResourceManager::V3::CreateTagBindingRequest.new(tag_binding: tag_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_tag_binding({ tag_binding: tag_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_tag_binding(::Google::Cloud::ResourceManager::V3::CreateTagBindingRequest.new(tag_binding: tag_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_tag_binding_client_stub.call_rpc_count + end + end + + def test_delete_tag_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" + + delete_tag_binding_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :delete_tag_binding, name + assert_kind_of ::Google::Cloud::ResourceManager::V3::DeleteTagBindingRequest, request + assert_equal "hello world", request["name"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, delete_tag_binding_client_stub do + # Create client + client = ::Google::Cloud::ResourceManager::V3::TagBindings::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.delete_tag_binding({ 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.delete_tag_binding 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.delete_tag_binding ::Google::Cloud::ResourceManager::V3::DeleteTagBindingRequest.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.delete_tag_binding({ 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.delete_tag_binding(::Google::Cloud::ResourceManager::V3::DeleteTagBindingRequest.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, delete_tag_binding_client_stub.call_rpc_count + end + end + + def test_list_effective_tags + # Create GRPC objects. + grpc_response = ::Google::Cloud::ResourceManager::V3::ListEffectiveTagsResponse.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_effective_tags_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :list_effective_tags, name + assert_kind_of ::Google::Cloud::ResourceManager::V3::ListEffectiveTagsRequest, 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_effective_tags_client_stub do + # Create client + client = ::Google::Cloud::ResourceManager::V3::TagBindings::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.list_effective_tags({ 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_effective_tags 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_effective_tags ::Google::Cloud::ResourceManager::V3::ListEffectiveTagsRequest.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_effective_tags({ 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_effective_tags(::Google::Cloud::ResourceManager::V3::ListEffectiveTagsRequest.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_effective_tags_client_stub.call_rpc_count + end + end + + def test_configure + grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + + client = block_config = config = nil + dummy_stub = ClientStub.new nil, nil + Gapic::ServiceStub.stub :new, dummy_stub do + client = ::Google::Cloud::ResourceManager::V3::TagBindings::Client.new do |config| + config.credentials = grpc_channel + end + end + + config = client.configure do |c| + block_config = c + end + + assert_same block_config, config + assert_kind_of ::Google::Cloud::ResourceManager::V3::TagBindings::Client::Configuration, config + end + + def test_credentials + key = OpenSSL::PKey::RSA.new 2048 + cred_json = { + "private_key" => key.to_pem, + "client_email" => "app@developer.gserviceaccount.com", + "type" => "service_account" + } + key_file = StringIO.new cred_json.to_json + creds = Google::Auth::ServiceAccountCredentials.make_creds({ json_key_io: key_file }) + + dummy_stub = ClientStub.new nil, nil + Gapic::ServiceStub.stub :new, dummy_stub do + client = ::Google::Cloud::ResourceManager::V3::TagBindings::Client.new do |config| + config.credentials = creds + end + assert_kind_of ::Google::Cloud::ResourceManager::V3::TagBindings::Client, client + assert_equal creds, client.configure.credentials + end + end + + def test_operations_client + grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + + client = nil + dummy_stub = ClientStub.new nil, nil + Gapic::ServiceStub.stub :new, dummy_stub do + client = ::Google::Cloud::ResourceManager::V3::TagBindings::Client.new do |config| + config.credentials = grpc_channel + end + end + + assert_kind_of ::Google::Cloud::ResourceManager::V3::TagBindings::Operations, client.operations_client + end +end diff --git a/owl-bot-staging/google-cloud-resource_manager-v3/test/google/cloud/resource_manager/v3/tag_holds_operations_test.rb b/owl-bot-staging/google-cloud-resource_manager-v3/test/google/cloud/resource_manager/v3/tag_holds_operations_test.rb new file mode 100644 index 000000000000..4a4cd95893bc --- /dev/null +++ b/owl-bot-staging/google-cloud-resource_manager-v3/test/google/cloud/resource_manager/v3/tag_holds_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/cloud/resourcemanager/v3/tag_holds_pb" +require "google/cloud/resourcemanager/v3/tag_holds_services_pb" +require "google/cloud/resource_manager/v3/tag_holds" + +class ::Google::Cloud::ResourceManager::V3::TagHolds::OperationsTest < Minitest::Test + class ClientStub + attr_accessor :call_rpc_count, :requests + + def initialize response, operation, &block + @response = response + @operation = operation + @block = block + @call_rpc_count = 0 + @requests = [] + end + + def call_rpc *args, **kwargs + @call_rpc_count += 1 + + @requests << @block&.call(*args, **kwargs) + + catch :response do + yield @response, @operation if block_given? + @response + end + end + + def endpoint + "endpoint.example.com" + end + + def universe_domain + "example.com" + end + + def stub_logger + nil + end + + def logger + nil + end + end + + def test_list_operations + # Create GRPC objects. + grpc_response = ::Google::Longrunning::ListOperationsResponse.new + grpc_operation = GRPC::ActiveCall::Operation.new nil + grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + grpc_options = {} + + # Create request parameters for a unary method. + name = "hello world" + filter = "hello world" + page_size = 42 + page_token = "hello world" + return_partial_success = true + + list_operations_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :list_operations, name + assert_kind_of ::Google::Longrunning::ListOperationsRequest, request + assert_equal "hello world", request["name"] + assert_equal "hello world", request["filter"] + assert_equal 42, request["page_size"] + assert_equal "hello world", request["page_token"] + assert_equal true, request["return_partial_success"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, list_operations_client_stub do + # Create client + client = ::Google::Cloud::ResourceManager::V3::TagHolds::Operations.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.list_operations({ name: name, filter: filter, page_size: page_size, page_token: page_token, return_partial_success: return_partial_success }) do |response, operation| + assert_kind_of Gapic::PagedEnumerable, response + assert_equal grpc_response, response.response + assert_equal grpc_operation, operation + end + + # Use named arguments + client.list_operations name: name, filter: filter, page_size: page_size, page_token: page_token, return_partial_success: return_partial_success do |response, operation| + assert_kind_of Gapic::PagedEnumerable, response + assert_equal grpc_response, response.response + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.list_operations ::Google::Longrunning::ListOperationsRequest.new(name: name, filter: filter, page_size: page_size, page_token: page_token, return_partial_success: return_partial_success) do |response, operation| + assert_kind_of Gapic::PagedEnumerable, response + assert_equal grpc_response, response.response + assert_equal grpc_operation, operation + end + + # Use hash object with options + client.list_operations({ name: name, filter: filter, page_size: page_size, page_token: page_token, return_partial_success: return_partial_success }, grpc_options) do |response, operation| + assert_kind_of Gapic::PagedEnumerable, response + assert_equal grpc_response, response.response + assert_equal grpc_operation, operation + end + + # Use protobuf object with options + client.list_operations(::Google::Longrunning::ListOperationsRequest.new(name: name, filter: filter, page_size: page_size, page_token: page_token, return_partial_success: return_partial_success), grpc_options) do |response, operation| + assert_kind_of Gapic::PagedEnumerable, response + assert_equal grpc_response, response.response + assert_equal grpc_operation, operation + end + + # Verify method calls + assert_equal 5, list_operations_client_stub.call_rpc_count + end + end + + def test_get_operation + # Create GRPC objects. + grpc_response = ::Google::Longrunning::Operation.new + grpc_operation = GRPC::ActiveCall::Operation.new nil + grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + grpc_options = {} + + # Create request parameters for a unary method. + name = "hello world" + + get_operation_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :get_operation, name + assert_kind_of ::Google::Longrunning::GetOperationRequest, request + assert_equal "hello world", request["name"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, get_operation_client_stub do + # Create client + client = ::Google::Cloud::ResourceManager::V3::TagHolds::Operations.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.get_operation({ name: name }) do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Use named arguments + client.get_operation name: name do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.get_operation ::Google::Longrunning::GetOperationRequest.new(name: name) do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Use hash object with options + client.get_operation({ name: name }, grpc_options) do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Use protobuf object with options + client.get_operation(::Google::Longrunning::GetOperationRequest.new(name: name), grpc_options) do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Verify method calls + assert_equal 5, get_operation_client_stub.call_rpc_count + end + end + + def test_delete_operation + # Create GRPC objects. + grpc_response = ::Google::Protobuf::Empty.new + grpc_operation = GRPC::ActiveCall::Operation.new nil + grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + grpc_options = {} + + # Create request parameters for a unary method. + name = "hello world" + + delete_operation_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :delete_operation, name + assert_kind_of ::Google::Longrunning::DeleteOperationRequest, request + assert_equal "hello world", request["name"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, delete_operation_client_stub do + # Create client + client = ::Google::Cloud::ResourceManager::V3::TagHolds::Operations.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.delete_operation({ name: name }) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use named arguments + client.delete_operation name: name do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.delete_operation ::Google::Longrunning::DeleteOperationRequest.new(name: name) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use hash object with options + client.delete_operation({ name: name }, grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object with options + client.delete_operation(::Google::Longrunning::DeleteOperationRequest.new(name: name), grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Verify method calls + assert_equal 5, delete_operation_client_stub.call_rpc_count + end + end + + def test_cancel_operation + # Create GRPC objects. + grpc_response = ::Google::Protobuf::Empty.new + grpc_operation = GRPC::ActiveCall::Operation.new nil + grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + grpc_options = {} + + # Create request parameters for a unary method. + name = "hello world" + + cancel_operation_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :cancel_operation, name + assert_kind_of ::Google::Longrunning::CancelOperationRequest, request + assert_equal "hello world", request["name"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, cancel_operation_client_stub do + # Create client + client = ::Google::Cloud::ResourceManager::V3::TagHolds::Operations.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.cancel_operation({ name: name }) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use named arguments + client.cancel_operation name: name do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.cancel_operation ::Google::Longrunning::CancelOperationRequest.new(name: name) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use hash object with options + client.cancel_operation({ name: name }, grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object with options + client.cancel_operation(::Google::Longrunning::CancelOperationRequest.new(name: name), grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Verify method calls + assert_equal 5, cancel_operation_client_stub.call_rpc_count + end + end + + def test_wait_operation + # Create GRPC objects. + grpc_response = ::Google::Longrunning::Operation.new + grpc_operation = GRPC::ActiveCall::Operation.new nil + grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + grpc_options = {} + + # Create request parameters for a unary method. + name = "hello world" + timeout = {} + + wait_operation_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :wait_operation, name + assert_kind_of ::Google::Longrunning::WaitOperationRequest, request + assert_equal "hello world", request["name"] + assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Protobuf::Duration), request["timeout"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, wait_operation_client_stub do + # Create client + client = ::Google::Cloud::ResourceManager::V3::TagHolds::Operations.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.wait_operation({ name: name, timeout: timeout }) do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Use named arguments + client.wait_operation name: name, timeout: timeout do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.wait_operation ::Google::Longrunning::WaitOperationRequest.new(name: name, timeout: timeout) do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Use hash object with options + client.wait_operation({ name: name, timeout: timeout }, grpc_options) do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Use protobuf object with options + client.wait_operation(::Google::Longrunning::WaitOperationRequest.new(name: name, timeout: timeout), grpc_options) do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Verify method calls + assert_equal 5, wait_operation_client_stub.call_rpc_count + end + end + + def test_configure + grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + + client = block_config = config = nil + dummy_stub = ClientStub.new nil, nil + Gapic::ServiceStub.stub :new, dummy_stub do + client = ::Google::Cloud::ResourceManager::V3::TagHolds::Operations.new do |config| + config.credentials = grpc_channel + end + end + + config = client.configure do |c| + block_config = c + end + + assert_same block_config, config + assert_kind_of ::Google::Cloud::ResourceManager::V3::TagHolds::Operations::Configuration, config + end +end diff --git a/owl-bot-staging/google-cloud-resource_manager-v3/test/google/cloud/resource_manager/v3/tag_holds_paths_test.rb b/owl-bot-staging/google-cloud-resource_manager-v3/test/google/cloud/resource_manager/v3/tag_holds_paths_test.rb new file mode 100644 index 000000000000..896ad53b457d --- /dev/null +++ b/owl-bot-staging/google-cloud-resource_manager-v3/test/google/cloud/resource_manager/v3/tag_holds_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/cloud/resource_manager/v3/tag_holds" + +class ::Google::Cloud::ResourceManager::V3::TagHolds::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_tag_hold_path + grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + ::Gapic::ServiceStub.stub :new, DummyStub.new do + client = ::Google::Cloud::ResourceManager::V3::TagHolds::Client.new do |config| + config.credentials = grpc_channel + end + + path = client.tag_hold_path tag_value: "value0", tag_hold: "value1" + assert_equal "tagValues/value0/tagHolds/value1", path + end + end + + def test_tag_value_path + grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + ::Gapic::ServiceStub.stub :new, DummyStub.new do + client = ::Google::Cloud::ResourceManager::V3::TagHolds::Client.new do |config| + config.credentials = grpc_channel + end + + path = client.tag_value_path tag_value: "value0" + assert_equal "tagValues/value0", path + end + end +end diff --git a/owl-bot-staging/google-cloud-resource_manager-v3/test/google/cloud/resource_manager/v3/tag_holds_rest_test.rb b/owl-bot-staging/google-cloud-resource_manager-v3/test/google/cloud/resource_manager/v3/tag_holds_rest_test.rb new file mode 100644 index 000000000000..3958e2ec0f3b --- /dev/null +++ b/owl-bot-staging/google-cloud-resource_manager-v3/test/google/cloud/resource_manager/v3/tag_holds_rest_test.rb @@ -0,0 +1,267 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +require "helper" +require "gapic/rest" +require "google/cloud/resourcemanager/v3/tag_holds_pb" +require "google/cloud/resource_manager/v3/tag_holds/rest" + + +class ::Google::Cloud::ResourceManager::V3::TagHolds::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_tag_hold + # 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" + tag_hold = {} + validate_only = true + + create_tag_hold_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| + assert options.metadata.key? :"x-goog-api-client" + assert options.metadata[:"x-goog-api-client"].include? "rest" + refute options.metadata[:"x-goog-api-client"].include? "grpc" + end + + ::Google::Cloud::ResourceManager::V3::TagHolds::Rest::ServiceStub.stub :transcode_create_tag_hold_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, create_tag_hold_client_stub do + # Create client + client = ::Google::Cloud::ResourceManager::V3::TagHolds::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.create_tag_hold({ parent: parent, tag_hold: tag_hold, validate_only: validate_only }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.create_tag_hold parent: parent, tag_hold: tag_hold, validate_only: validate_only do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.create_tag_hold ::Google::Cloud::ResourceManager::V3::CreateTagHoldRequest.new(parent: parent, tag_hold: tag_hold, validate_only: validate_only) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + client.create_tag_hold({ parent: parent, tag_hold: tag_hold, validate_only: validate_only }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + client.create_tag_hold(::Google::Cloud::ResourceManager::V3::CreateTagHoldRequest.new(parent: parent, tag_hold: tag_hold, validate_only: validate_only), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, create_tag_hold_client_stub.call_count + end + end + end + + def test_delete_tag_hold + # 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" + validate_only = true + + delete_tag_hold_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| + assert options.metadata.key? :"x-goog-api-client" + assert options.metadata[:"x-goog-api-client"].include? "rest" + refute options.metadata[:"x-goog-api-client"].include? "grpc" + end + + ::Google::Cloud::ResourceManager::V3::TagHolds::Rest::ServiceStub.stub :transcode_delete_tag_hold_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, delete_tag_hold_client_stub do + # Create client + client = ::Google::Cloud::ResourceManager::V3::TagHolds::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.delete_tag_hold({ name: name, validate_only: validate_only }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.delete_tag_hold name: name, validate_only: validate_only do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.delete_tag_hold ::Google::Cloud::ResourceManager::V3::DeleteTagHoldRequest.new(name: name, validate_only: validate_only) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + client.delete_tag_hold({ name: name, validate_only: validate_only }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + client.delete_tag_hold(::Google::Cloud::ResourceManager::V3::DeleteTagHoldRequest.new(name: name, validate_only: validate_only), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, delete_tag_hold_client_stub.call_count + end + end + end + + def test_list_tag_holds + # Create test objects. + client_result = ::Google::Cloud::ResourceManager::V3::ListTagHoldsResponse.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_tag_holds_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| + assert options.metadata.key? :"x-goog-api-client" + assert options.metadata[:"x-goog-api-client"].include? "rest" + refute options.metadata[:"x-goog-api-client"].include? "grpc" + end + + ::Google::Cloud::ResourceManager::V3::TagHolds::Rest::ServiceStub.stub :transcode_list_tag_holds_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, list_tag_holds_client_stub do + # Create client + client = ::Google::Cloud::ResourceManager::V3::TagHolds::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.list_tag_holds({ 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_tag_holds 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_tag_holds ::Google::Cloud::ResourceManager::V3::ListTagHoldsRequest.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_tag_holds({ 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_tag_holds(::Google::Cloud::ResourceManager::V3::ListTagHoldsRequest.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_tag_holds_client_stub.call_count + end + end + end + + def test_configure + credentials_token = :dummy_value + + client = block_config = config = nil + dummy_stub = ClientStub.new nil + Gapic::Rest::ClientStub.stub :new, dummy_stub do + client = ::Google::Cloud::ResourceManager::V3::TagHolds::Rest::Client.new do |config| + config.credentials = credentials_token + end + end + + config = client.configure do |c| + block_config = c + end + + assert_same block_config, config + assert_kind_of ::Google::Cloud::ResourceManager::V3::TagHolds::Rest::Client::Configuration, config + end +end diff --git a/owl-bot-staging/google-cloud-resource_manager-v3/test/google/cloud/resource_manager/v3/tag_holds_test.rb b/owl-bot-staging/google-cloud-resource_manager-v3/test/google/cloud/resource_manager/v3/tag_holds_test.rb new file mode 100644 index 000000000000..ac648fdfa9ca --- /dev/null +++ b/owl-bot-staging/google-cloud-resource_manager-v3/test/google/cloud/resource_manager/v3/tag_holds_test.rb @@ -0,0 +1,319 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +require "helper" + +require "gapic/grpc/service_stub" + +require "google/cloud/resourcemanager/v3/tag_holds_pb" +require "google/cloud/resource_manager/v3/tag_holds" + +class ::Google::Cloud::ResourceManager::V3::TagHolds::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_tag_hold + # 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" + tag_hold = {} + validate_only = true + + create_tag_hold_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :create_tag_hold, name + assert_kind_of ::Google::Cloud::ResourceManager::V3::CreateTagHoldRequest, request + assert_equal "hello world", request["parent"] + assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::ResourceManager::V3::TagHold), request["tag_hold"] + assert_equal true, request["validate_only"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, create_tag_hold_client_stub do + # Create client + client = ::Google::Cloud::ResourceManager::V3::TagHolds::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.create_tag_hold({ parent: parent, tag_hold: tag_hold, 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_tag_hold parent: parent, tag_hold: tag_hold, 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_tag_hold ::Google::Cloud::ResourceManager::V3::CreateTagHoldRequest.new(parent: parent, tag_hold: tag_hold, 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_tag_hold({ parent: parent, tag_hold: tag_hold, 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_tag_hold(::Google::Cloud::ResourceManager::V3::CreateTagHoldRequest.new(parent: parent, tag_hold: tag_hold, 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_tag_hold_client_stub.call_rpc_count + end + end + + def test_delete_tag_hold + # 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" + validate_only = true + + delete_tag_hold_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :delete_tag_hold, name + assert_kind_of ::Google::Cloud::ResourceManager::V3::DeleteTagHoldRequest, request + assert_equal "hello world", request["name"] + assert_equal true, request["validate_only"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, delete_tag_hold_client_stub do + # Create client + client = ::Google::Cloud::ResourceManager::V3::TagHolds::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.delete_tag_hold({ name: name, 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_tag_hold name: name, 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_tag_hold ::Google::Cloud::ResourceManager::V3::DeleteTagHoldRequest.new(name: name, 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_tag_hold({ name: name, 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_tag_hold(::Google::Cloud::ResourceManager::V3::DeleteTagHoldRequest.new(name: name, 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_tag_hold_client_stub.call_rpc_count + end + end + + def test_list_tag_holds + # Create GRPC objects. + grpc_response = ::Google::Cloud::ResourceManager::V3::ListTagHoldsResponse.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_tag_holds_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :list_tag_holds, name + assert_kind_of ::Google::Cloud::ResourceManager::V3::ListTagHoldsRequest, 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_tag_holds_client_stub do + # Create client + client = ::Google::Cloud::ResourceManager::V3::TagHolds::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.list_tag_holds({ 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_tag_holds 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_tag_holds ::Google::Cloud::ResourceManager::V3::ListTagHoldsRequest.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_tag_holds({ 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_tag_holds(::Google::Cloud::ResourceManager::V3::ListTagHoldsRequest.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_tag_holds_client_stub.call_rpc_count + end + end + + def test_configure + grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + + client = block_config = config = nil + dummy_stub = ClientStub.new nil, nil + Gapic::ServiceStub.stub :new, dummy_stub do + client = ::Google::Cloud::ResourceManager::V3::TagHolds::Client.new do |config| + config.credentials = grpc_channel + end + end + + config = client.configure do |c| + block_config = c + end + + assert_same block_config, config + assert_kind_of ::Google::Cloud::ResourceManager::V3::TagHolds::Client::Configuration, config + end + + def test_credentials + key = OpenSSL::PKey::RSA.new 2048 + cred_json = { + "private_key" => key.to_pem, + "client_email" => "app@developer.gserviceaccount.com", + "type" => "service_account" + } + key_file = StringIO.new cred_json.to_json + creds = Google::Auth::ServiceAccountCredentials.make_creds({ json_key_io: key_file }) + + dummy_stub = ClientStub.new nil, nil + Gapic::ServiceStub.stub :new, dummy_stub do + client = ::Google::Cloud::ResourceManager::V3::TagHolds::Client.new do |config| + config.credentials = creds + end + assert_kind_of ::Google::Cloud::ResourceManager::V3::TagHolds::Client, client + assert_equal creds, client.configure.credentials + end + end + + def test_operations_client + grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + + client = nil + dummy_stub = ClientStub.new nil, nil + Gapic::ServiceStub.stub :new, dummy_stub do + client = ::Google::Cloud::ResourceManager::V3::TagHolds::Client.new do |config| + config.credentials = grpc_channel + end + end + + assert_kind_of ::Google::Cloud::ResourceManager::V3::TagHolds::Operations, client.operations_client + end +end diff --git a/owl-bot-staging/google-cloud-resource_manager-v3/test/google/cloud/resource_manager/v3/tag_keys_operations_test.rb b/owl-bot-staging/google-cloud-resource_manager-v3/test/google/cloud/resource_manager/v3/tag_keys_operations_test.rb new file mode 100644 index 000000000000..a8f64f70ac47 --- /dev/null +++ b/owl-bot-staging/google-cloud-resource_manager-v3/test/google/cloud/resource_manager/v3/tag_keys_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/cloud/resourcemanager/v3/tag_keys_pb" +require "google/cloud/resourcemanager/v3/tag_keys_services_pb" +require "google/cloud/resource_manager/v3/tag_keys" + +class ::Google::Cloud::ResourceManager::V3::TagKeys::OperationsTest < Minitest::Test + class ClientStub + attr_accessor :call_rpc_count, :requests + + def initialize response, operation, &block + @response = response + @operation = operation + @block = block + @call_rpc_count = 0 + @requests = [] + end + + def call_rpc *args, **kwargs + @call_rpc_count += 1 + + @requests << @block&.call(*args, **kwargs) + + catch :response do + yield @response, @operation if block_given? + @response + end + end + + def endpoint + "endpoint.example.com" + end + + def universe_domain + "example.com" + end + + def stub_logger + nil + end + + def logger + nil + end + end + + def test_list_operations + # Create GRPC objects. + grpc_response = ::Google::Longrunning::ListOperationsResponse.new + grpc_operation = GRPC::ActiveCall::Operation.new nil + grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + grpc_options = {} + + # Create request parameters for a unary method. + name = "hello world" + filter = "hello world" + page_size = 42 + page_token = "hello world" + return_partial_success = true + + list_operations_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :list_operations, name + assert_kind_of ::Google::Longrunning::ListOperationsRequest, request + assert_equal "hello world", request["name"] + assert_equal "hello world", request["filter"] + assert_equal 42, request["page_size"] + assert_equal "hello world", request["page_token"] + assert_equal true, request["return_partial_success"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, list_operations_client_stub do + # Create client + client = ::Google::Cloud::ResourceManager::V3::TagKeys::Operations.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.list_operations({ name: name, filter: filter, page_size: page_size, page_token: page_token, return_partial_success: return_partial_success }) do |response, operation| + assert_kind_of Gapic::PagedEnumerable, response + assert_equal grpc_response, response.response + assert_equal grpc_operation, operation + end + + # Use named arguments + client.list_operations name: name, filter: filter, page_size: page_size, page_token: page_token, return_partial_success: return_partial_success do |response, operation| + assert_kind_of Gapic::PagedEnumerable, response + assert_equal grpc_response, response.response + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.list_operations ::Google::Longrunning::ListOperationsRequest.new(name: name, filter: filter, page_size: page_size, page_token: page_token, return_partial_success: return_partial_success) do |response, operation| + assert_kind_of Gapic::PagedEnumerable, response + assert_equal grpc_response, response.response + assert_equal grpc_operation, operation + end + + # Use hash object with options + client.list_operations({ name: name, filter: filter, page_size: page_size, page_token: page_token, return_partial_success: return_partial_success }, grpc_options) do |response, operation| + assert_kind_of Gapic::PagedEnumerable, response + assert_equal grpc_response, response.response + assert_equal grpc_operation, operation + end + + # Use protobuf object with options + client.list_operations(::Google::Longrunning::ListOperationsRequest.new(name: name, filter: filter, page_size: page_size, page_token: page_token, return_partial_success: return_partial_success), grpc_options) do |response, operation| + assert_kind_of Gapic::PagedEnumerable, response + assert_equal grpc_response, response.response + assert_equal grpc_operation, operation + end + + # Verify method calls + assert_equal 5, list_operations_client_stub.call_rpc_count + end + end + + def test_get_operation + # Create GRPC objects. + grpc_response = ::Google::Longrunning::Operation.new + grpc_operation = GRPC::ActiveCall::Operation.new nil + grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + grpc_options = {} + + # Create request parameters for a unary method. + name = "hello world" + + get_operation_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :get_operation, name + assert_kind_of ::Google::Longrunning::GetOperationRequest, request + assert_equal "hello world", request["name"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, get_operation_client_stub do + # Create client + client = ::Google::Cloud::ResourceManager::V3::TagKeys::Operations.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.get_operation({ name: name }) do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Use named arguments + client.get_operation name: name do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.get_operation ::Google::Longrunning::GetOperationRequest.new(name: name) do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Use hash object with options + client.get_operation({ name: name }, grpc_options) do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Use protobuf object with options + client.get_operation(::Google::Longrunning::GetOperationRequest.new(name: name), grpc_options) do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Verify method calls + assert_equal 5, get_operation_client_stub.call_rpc_count + end + end + + def test_delete_operation + # Create GRPC objects. + grpc_response = ::Google::Protobuf::Empty.new + grpc_operation = GRPC::ActiveCall::Operation.new nil + grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + grpc_options = {} + + # Create request parameters for a unary method. + name = "hello world" + + delete_operation_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :delete_operation, name + assert_kind_of ::Google::Longrunning::DeleteOperationRequest, request + assert_equal "hello world", request["name"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, delete_operation_client_stub do + # Create client + client = ::Google::Cloud::ResourceManager::V3::TagKeys::Operations.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.delete_operation({ name: name }) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use named arguments + client.delete_operation name: name do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.delete_operation ::Google::Longrunning::DeleteOperationRequest.new(name: name) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use hash object with options + client.delete_operation({ name: name }, grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object with options + client.delete_operation(::Google::Longrunning::DeleteOperationRequest.new(name: name), grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Verify method calls + assert_equal 5, delete_operation_client_stub.call_rpc_count + end + end + + def test_cancel_operation + # Create GRPC objects. + grpc_response = ::Google::Protobuf::Empty.new + grpc_operation = GRPC::ActiveCall::Operation.new nil + grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + grpc_options = {} + + # Create request parameters for a unary method. + name = "hello world" + + cancel_operation_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :cancel_operation, name + assert_kind_of ::Google::Longrunning::CancelOperationRequest, request + assert_equal "hello world", request["name"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, cancel_operation_client_stub do + # Create client + client = ::Google::Cloud::ResourceManager::V3::TagKeys::Operations.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.cancel_operation({ name: name }) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use named arguments + client.cancel_operation name: name do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.cancel_operation ::Google::Longrunning::CancelOperationRequest.new(name: name) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use hash object with options + client.cancel_operation({ name: name }, grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object with options + client.cancel_operation(::Google::Longrunning::CancelOperationRequest.new(name: name), grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Verify method calls + assert_equal 5, cancel_operation_client_stub.call_rpc_count + end + end + + def test_wait_operation + # Create GRPC objects. + grpc_response = ::Google::Longrunning::Operation.new + grpc_operation = GRPC::ActiveCall::Operation.new nil + grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + grpc_options = {} + + # Create request parameters for a unary method. + name = "hello world" + timeout = {} + + wait_operation_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :wait_operation, name + assert_kind_of ::Google::Longrunning::WaitOperationRequest, request + assert_equal "hello world", request["name"] + assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Protobuf::Duration), request["timeout"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, wait_operation_client_stub do + # Create client + client = ::Google::Cloud::ResourceManager::V3::TagKeys::Operations.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.wait_operation({ name: name, timeout: timeout }) do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Use named arguments + client.wait_operation name: name, timeout: timeout do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.wait_operation ::Google::Longrunning::WaitOperationRequest.new(name: name, timeout: timeout) do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Use hash object with options + client.wait_operation({ name: name, timeout: timeout }, grpc_options) do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Use protobuf object with options + client.wait_operation(::Google::Longrunning::WaitOperationRequest.new(name: name, timeout: timeout), grpc_options) do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Verify method calls + assert_equal 5, wait_operation_client_stub.call_rpc_count + end + end + + def test_configure + grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + + client = block_config = config = nil + dummy_stub = ClientStub.new nil, nil + Gapic::ServiceStub.stub :new, dummy_stub do + client = ::Google::Cloud::ResourceManager::V3::TagKeys::Operations.new do |config| + config.credentials = grpc_channel + end + end + + config = client.configure do |c| + block_config = c + end + + assert_same block_config, config + assert_kind_of ::Google::Cloud::ResourceManager::V3::TagKeys::Operations::Configuration, config + end +end diff --git a/owl-bot-staging/google-cloud-resource_manager-v3/test/google/cloud/resource_manager/v3/tag_keys_paths_test.rb b/owl-bot-staging/google-cloud-resource_manager-v3/test/google/cloud/resource_manager/v3/tag_keys_paths_test.rb new file mode 100644 index 000000000000..3b9b1b258030 --- /dev/null +++ b/owl-bot-staging/google-cloud-resource_manager-v3/test/google/cloud/resource_manager/v3/tag_keys_paths_test.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 "helper" + +require "gapic/grpc/service_stub" + +require "google/cloud/resource_manager/v3/tag_keys" + +class ::Google::Cloud::ResourceManager::V3::TagKeys::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_tag_key_path + grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + ::Gapic::ServiceStub.stub :new, DummyStub.new do + client = ::Google::Cloud::ResourceManager::V3::TagKeys::Client.new do |config| + config.credentials = grpc_channel + end + + path = client.tag_key_path tag_key: "value0" + assert_equal "tagKeys/value0", path + end + end +end diff --git a/owl-bot-staging/google-cloud-resource_manager-v3/test/google/cloud/resource_manager/v3/tag_keys_rest_test.rb b/owl-bot-staging/google-cloud-resource_manager-v3/test/google/cloud/resource_manager/v3/tag_keys_rest_test.rb new file mode 100644 index 000000000000..df8d4b17eb18 --- /dev/null +++ b/owl-bot-staging/google-cloud-resource_manager-v3/test/google/cloud/resource_manager/v3/tag_keys_rest_test.rb @@ -0,0 +1,596 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +require "helper" +require "gapic/rest" +require "google/cloud/resourcemanager/v3/tag_keys_pb" +require "google/cloud/resource_manager/v3/tag_keys/rest" + + +class ::Google::Cloud::ResourceManager::V3::TagKeys::Rest::ClientTest < Minitest::Test + class ClientStub + attr_accessor :call_count, :requests + + def initialize response, &block + @response = response + @block = block + @call_count = 0 + @requests = [] + end + + def make_get_request uri:, params: {}, options: {}, method_name: nil + make_http_request :get, uri: uri, body: nil, params: params, options: options, method_name: method_name + end + + def make_delete_request uri:, params: {}, options: {}, method_name: nil + make_http_request :delete, uri: uri, body: nil, params: params, options: options, method_name: method_name + end + + def make_post_request uri:, body: nil, params: {}, options: {}, method_name: nil + make_http_request :post, uri: uri, body: body, params: params, options: options, method_name: method_name + end + + def make_patch_request uri:, body:, params: {}, options: {}, method_name: nil + make_http_request :patch, uri: uri, body: body, params: params, options: options, method_name: method_name + end + + def make_put_request uri:, body:, params: {}, options: {}, method_name: nil + make_http_request :put, uri: uri, body: body, params: params, options: options, method_name: method_name + end + + def make_http_request *args, **kwargs + @call_count += 1 + + @requests << @block&.call(*args, **kwargs) + + @response + end + + def endpoint + "endpoint.example.com" + end + + def universe_domain + "example.com" + end + + def stub_logger + nil + end + + def logger + nil + end + end + + def test_list_tag_keys + # Create test objects. + client_result = ::Google::Cloud::ResourceManager::V3::ListTagKeysResponse.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_tag_keys_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| + assert options.metadata.key? :"x-goog-api-client" + assert options.metadata[:"x-goog-api-client"].include? "rest" + refute options.metadata[:"x-goog-api-client"].include? "grpc" + end + + ::Google::Cloud::ResourceManager::V3::TagKeys::Rest::ServiceStub.stub :transcode_list_tag_keys_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, list_tag_keys_client_stub do + # Create client + client = ::Google::Cloud::ResourceManager::V3::TagKeys::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.list_tag_keys({ 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_tag_keys 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_tag_keys ::Google::Cloud::ResourceManager::V3::ListTagKeysRequest.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_tag_keys({ 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_tag_keys(::Google::Cloud::ResourceManager::V3::ListTagKeysRequest.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_tag_keys_client_stub.call_count + end + end + end + + def test_get_tag_key + # Create test objects. + client_result = ::Google::Cloud::ResourceManager::V3::TagKey.new + http_response = OpenStruct.new body: client_result.to_json + + call_options = {} + + # Create request parameters for a unary method. + name = "hello world" + + get_tag_key_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| + assert options.metadata.key? :"x-goog-api-client" + assert options.metadata[:"x-goog-api-client"].include? "rest" + refute options.metadata[:"x-goog-api-client"].include? "grpc" + end + + ::Google::Cloud::ResourceManager::V3::TagKeys::Rest::ServiceStub.stub :transcode_get_tag_key_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, get_tag_key_client_stub do + # Create client + client = ::Google::Cloud::ResourceManager::V3::TagKeys::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.get_tag_key({ name: name }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.get_tag_key name: name do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.get_tag_key ::Google::Cloud::ResourceManager::V3::GetTagKeyRequest.new(name: name) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + client.get_tag_key({ name: name }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + client.get_tag_key(::Google::Cloud::ResourceManager::V3::GetTagKeyRequest.new(name: name), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, get_tag_key_client_stub.call_count + end + end + end + + def test_get_namespaced_tag_key + # Create test objects. + client_result = ::Google::Cloud::ResourceManager::V3::TagKey.new + http_response = OpenStruct.new body: client_result.to_json + + call_options = {} + + # Create request parameters for a unary method. + name = "hello world" + + get_namespaced_tag_key_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| + assert options.metadata.key? :"x-goog-api-client" + assert options.metadata[:"x-goog-api-client"].include? "rest" + refute options.metadata[:"x-goog-api-client"].include? "grpc" + end + + ::Google::Cloud::ResourceManager::V3::TagKeys::Rest::ServiceStub.stub :transcode_get_namespaced_tag_key_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, get_namespaced_tag_key_client_stub do + # Create client + client = ::Google::Cloud::ResourceManager::V3::TagKeys::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.get_namespaced_tag_key({ name: name }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.get_namespaced_tag_key name: name do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.get_namespaced_tag_key ::Google::Cloud::ResourceManager::V3::GetNamespacedTagKeyRequest.new(name: name) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + client.get_namespaced_tag_key({ name: name }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + client.get_namespaced_tag_key(::Google::Cloud::ResourceManager::V3::GetNamespacedTagKeyRequest.new(name: name), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, get_namespaced_tag_key_client_stub.call_count + end + end + end + + def test_create_tag_key + # 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. + tag_key = {} + validate_only = true + + create_tag_key_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| + assert options.metadata.key? :"x-goog-api-client" + assert options.metadata[:"x-goog-api-client"].include? "rest" + refute options.metadata[:"x-goog-api-client"].include? "grpc" + end + + ::Google::Cloud::ResourceManager::V3::TagKeys::Rest::ServiceStub.stub :transcode_create_tag_key_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, create_tag_key_client_stub do + # Create client + client = ::Google::Cloud::ResourceManager::V3::TagKeys::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.create_tag_key({ tag_key: tag_key, validate_only: validate_only }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.create_tag_key tag_key: tag_key, validate_only: validate_only do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.create_tag_key ::Google::Cloud::ResourceManager::V3::CreateTagKeyRequest.new(tag_key: tag_key, validate_only: validate_only) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + client.create_tag_key({ tag_key: tag_key, validate_only: validate_only }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + client.create_tag_key(::Google::Cloud::ResourceManager::V3::CreateTagKeyRequest.new(tag_key: tag_key, validate_only: validate_only), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, create_tag_key_client_stub.call_count + end + end + end + + def test_update_tag_key + # 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. + tag_key = {} + update_mask = {} + validate_only = true + + update_tag_key_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| + assert options.metadata.key? :"x-goog-api-client" + assert options.metadata[:"x-goog-api-client"].include? "rest" + refute options.metadata[:"x-goog-api-client"].include? "grpc" + end + + ::Google::Cloud::ResourceManager::V3::TagKeys::Rest::ServiceStub.stub :transcode_update_tag_key_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, update_tag_key_client_stub do + # Create client + client = ::Google::Cloud::ResourceManager::V3::TagKeys::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.update_tag_key({ tag_key: tag_key, update_mask: update_mask, validate_only: validate_only }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.update_tag_key tag_key: tag_key, update_mask: update_mask, validate_only: validate_only do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.update_tag_key ::Google::Cloud::ResourceManager::V3::UpdateTagKeyRequest.new(tag_key: tag_key, update_mask: update_mask, validate_only: validate_only) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + client.update_tag_key({ tag_key: tag_key, update_mask: update_mask, validate_only: validate_only }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + client.update_tag_key(::Google::Cloud::ResourceManager::V3::UpdateTagKeyRequest.new(tag_key: tag_key, update_mask: update_mask, validate_only: validate_only), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, update_tag_key_client_stub.call_count + end + end + end + + def test_delete_tag_key + # 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" + validate_only = true + etag = "hello world" + + delete_tag_key_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| + assert options.metadata.key? :"x-goog-api-client" + assert options.metadata[:"x-goog-api-client"].include? "rest" + refute options.metadata[:"x-goog-api-client"].include? "grpc" + end + + ::Google::Cloud::ResourceManager::V3::TagKeys::Rest::ServiceStub.stub :transcode_delete_tag_key_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, delete_tag_key_client_stub do + # Create client + client = ::Google::Cloud::ResourceManager::V3::TagKeys::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.delete_tag_key({ name: name, validate_only: validate_only, etag: etag }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.delete_tag_key name: name, validate_only: validate_only, etag: etag do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.delete_tag_key ::Google::Cloud::ResourceManager::V3::DeleteTagKeyRequest.new(name: name, validate_only: validate_only, etag: etag) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + client.delete_tag_key({ name: name, validate_only: validate_only, etag: etag }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + client.delete_tag_key(::Google::Cloud::ResourceManager::V3::DeleteTagKeyRequest.new(name: name, validate_only: validate_only, etag: etag), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, delete_tag_key_client_stub.call_count + end + end + end + + def test_get_iam_policy + # Create test objects. + client_result = ::Google::Iam::V1::Policy.new + http_response = OpenStruct.new body: client_result.to_json + + call_options = {} + + # Create request parameters for a unary method. + resource = "hello world" + options = {} + + get_iam_policy_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| + assert options.metadata.key? :"x-goog-api-client" + assert options.metadata[:"x-goog-api-client"].include? "rest" + refute options.metadata[:"x-goog-api-client"].include? "grpc" + end + + ::Google::Cloud::ResourceManager::V3::TagKeys::Rest::ServiceStub.stub :transcode_get_iam_policy_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, get_iam_policy_client_stub do + # Create client + client = ::Google::Cloud::ResourceManager::V3::TagKeys::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.get_iam_policy({ resource: resource, options: options }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.get_iam_policy resource: resource, options: options do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.get_iam_policy ::Google::Iam::V1::GetIamPolicyRequest.new(resource: resource, options: options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + client.get_iam_policy({ resource: resource, options: options }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + client.get_iam_policy(::Google::Iam::V1::GetIamPolicyRequest.new(resource: resource, options: options), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, get_iam_policy_client_stub.call_count + end + end + end + + def test_set_iam_policy + # Create test objects. + client_result = ::Google::Iam::V1::Policy.new + http_response = OpenStruct.new body: client_result.to_json + + call_options = {} + + # Create request parameters for a unary method. + resource = "hello world" + policy = {} + update_mask = {} + + set_iam_policy_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| + assert options.metadata.key? :"x-goog-api-client" + assert options.metadata[:"x-goog-api-client"].include? "rest" + refute options.metadata[:"x-goog-api-client"].include? "grpc" + end + + ::Google::Cloud::ResourceManager::V3::TagKeys::Rest::ServiceStub.stub :transcode_set_iam_policy_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, set_iam_policy_client_stub do + # Create client + client = ::Google::Cloud::ResourceManager::V3::TagKeys::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.set_iam_policy({ resource: resource, policy: policy, update_mask: update_mask }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.set_iam_policy resource: resource, policy: policy, update_mask: update_mask do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.set_iam_policy ::Google::Iam::V1::SetIamPolicyRequest.new(resource: resource, policy: policy, update_mask: update_mask) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + client.set_iam_policy({ resource: resource, policy: policy, update_mask: update_mask }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + client.set_iam_policy(::Google::Iam::V1::SetIamPolicyRequest.new(resource: resource, policy: policy, update_mask: update_mask), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, set_iam_policy_client_stub.call_count + end + end + end + + def test_test_iam_permissions + # Create test objects. + client_result = ::Google::Iam::V1::TestIamPermissionsResponse.new + http_response = OpenStruct.new body: client_result.to_json + + call_options = {} + + # Create request parameters for a unary method. + resource = "hello world" + permissions = ["hello world"] + + test_iam_permissions_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| + assert options.metadata.key? :"x-goog-api-client" + assert options.metadata[:"x-goog-api-client"].include? "rest" + refute options.metadata[:"x-goog-api-client"].include? "grpc" + end + + ::Google::Cloud::ResourceManager::V3::TagKeys::Rest::ServiceStub.stub :transcode_test_iam_permissions_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, test_iam_permissions_client_stub do + # Create client + client = ::Google::Cloud::ResourceManager::V3::TagKeys::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.test_iam_permissions({ resource: resource, permissions: permissions }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.test_iam_permissions resource: resource, permissions: permissions do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.test_iam_permissions ::Google::Iam::V1::TestIamPermissionsRequest.new(resource: resource, permissions: permissions) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + client.test_iam_permissions({ resource: resource, permissions: permissions }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + client.test_iam_permissions(::Google::Iam::V1::TestIamPermissionsRequest.new(resource: resource, permissions: permissions), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, test_iam_permissions_client_stub.call_count + end + end + end + + def test_configure + credentials_token = :dummy_value + + client = block_config = config = nil + dummy_stub = ClientStub.new nil + Gapic::Rest::ClientStub.stub :new, dummy_stub do + client = ::Google::Cloud::ResourceManager::V3::TagKeys::Rest::Client.new do |config| + config.credentials = credentials_token + end + end + + config = client.configure do |c| + block_config = c + end + + assert_same block_config, config + assert_kind_of ::Google::Cloud::ResourceManager::V3::TagKeys::Rest::Client::Configuration, config + end +end diff --git a/owl-bot-staging/google-cloud-resource_manager-v3/test/google/cloud/resource_manager/v3/tag_keys_test.rb b/owl-bot-staging/google-cloud-resource_manager-v3/test/google/cloud/resource_manager/v3/tag_keys_test.rb new file mode 100644 index 000000000000..60e31fc80d1f --- /dev/null +++ b/owl-bot-staging/google-cloud-resource_manager-v3/test/google/cloud/resource_manager/v3/tag_keys_test.rb @@ -0,0 +1,682 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +require "helper" + +require "gapic/grpc/service_stub" + +require "google/cloud/resourcemanager/v3/tag_keys_pb" +require "google/cloud/resource_manager/v3/tag_keys" + +class ::Google::Cloud::ResourceManager::V3::TagKeys::ClientTest < Minitest::Test + class ClientStub + attr_accessor :call_rpc_count, :requests + + def initialize response, operation, &block + @response = response + @operation = operation + @block = block + @call_rpc_count = 0 + @requests = [] + end + + def call_rpc *args, **kwargs + @call_rpc_count += 1 + + @requests << @block&.call(*args, **kwargs) + + catch :response do + yield @response, @operation if block_given? + @response + end + end + + def endpoint + "endpoint.example.com" + end + + def universe_domain + "example.com" + end + + def stub_logger + nil + end + + def logger + nil + end + end + + def test_list_tag_keys + # Create GRPC objects. + grpc_response = ::Google::Cloud::ResourceManager::V3::ListTagKeysResponse.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_tag_keys_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :list_tag_keys, name + assert_kind_of ::Google::Cloud::ResourceManager::V3::ListTagKeysRequest, 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_tag_keys_client_stub do + # Create client + client = ::Google::Cloud::ResourceManager::V3::TagKeys::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.list_tag_keys({ 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_tag_keys 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_tag_keys ::Google::Cloud::ResourceManager::V3::ListTagKeysRequest.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_tag_keys({ 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_tag_keys(::Google::Cloud::ResourceManager::V3::ListTagKeysRequest.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_tag_keys_client_stub.call_rpc_count + end + end + + def test_get_tag_key + # Create GRPC objects. + grpc_response = ::Google::Cloud::ResourceManager::V3::TagKey.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_tag_key_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :get_tag_key, name + assert_kind_of ::Google::Cloud::ResourceManager::V3::GetTagKeyRequest, request + assert_equal "hello world", request["name"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, get_tag_key_client_stub do + # Create client + client = ::Google::Cloud::ResourceManager::V3::TagKeys::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.get_tag_key({ name: name }) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use named arguments + client.get_tag_key name: name do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.get_tag_key ::Google::Cloud::ResourceManager::V3::GetTagKeyRequest.new(name: name) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use hash object with options + client.get_tag_key({ 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_tag_key(::Google::Cloud::ResourceManager::V3::GetTagKeyRequest.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_tag_key_client_stub.call_rpc_count + end + end + + def test_get_namespaced_tag_key + # Create GRPC objects. + grpc_response = ::Google::Cloud::ResourceManager::V3::TagKey.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_namespaced_tag_key_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :get_namespaced_tag_key, name + assert_kind_of ::Google::Cloud::ResourceManager::V3::GetNamespacedTagKeyRequest, request + assert_equal "hello world", request["name"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, get_namespaced_tag_key_client_stub do + # Create client + client = ::Google::Cloud::ResourceManager::V3::TagKeys::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.get_namespaced_tag_key({ name: name }) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use named arguments + client.get_namespaced_tag_key name: name do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.get_namespaced_tag_key ::Google::Cloud::ResourceManager::V3::GetNamespacedTagKeyRequest.new(name: name) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use hash object with options + client.get_namespaced_tag_key({ 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_namespaced_tag_key(::Google::Cloud::ResourceManager::V3::GetNamespacedTagKeyRequest.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_namespaced_tag_key_client_stub.call_rpc_count + end + end + + def test_create_tag_key + # 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. + tag_key = {} + validate_only = true + + create_tag_key_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :create_tag_key, name + assert_kind_of ::Google::Cloud::ResourceManager::V3::CreateTagKeyRequest, request + assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::ResourceManager::V3::TagKey), request["tag_key"] + assert_equal true, request["validate_only"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, create_tag_key_client_stub do + # Create client + client = ::Google::Cloud::ResourceManager::V3::TagKeys::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.create_tag_key({ tag_key: tag_key, 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_tag_key tag_key: tag_key, 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_tag_key ::Google::Cloud::ResourceManager::V3::CreateTagKeyRequest.new(tag_key: tag_key, 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_tag_key({ tag_key: tag_key, 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_tag_key(::Google::Cloud::ResourceManager::V3::CreateTagKeyRequest.new(tag_key: tag_key, 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_tag_key_client_stub.call_rpc_count + end + end + + def test_update_tag_key + # 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. + tag_key = {} + update_mask = {} + validate_only = true + + update_tag_key_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :update_tag_key, name + assert_kind_of ::Google::Cloud::ResourceManager::V3::UpdateTagKeyRequest, request + assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::ResourceManager::V3::TagKey), request["tag_key"] + assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Protobuf::FieldMask), request["update_mask"] + assert_equal true, request["validate_only"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, update_tag_key_client_stub do + # Create client + client = ::Google::Cloud::ResourceManager::V3::TagKeys::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.update_tag_key({ tag_key: tag_key, update_mask: update_mask, 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_tag_key tag_key: tag_key, update_mask: update_mask, 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_tag_key ::Google::Cloud::ResourceManager::V3::UpdateTagKeyRequest.new(tag_key: tag_key, update_mask: update_mask, 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_tag_key({ tag_key: tag_key, update_mask: update_mask, 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_tag_key(::Google::Cloud::ResourceManager::V3::UpdateTagKeyRequest.new(tag_key: tag_key, update_mask: update_mask, 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_tag_key_client_stub.call_rpc_count + end + end + + def test_delete_tag_key + # 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" + validate_only = true + etag = "hello world" + + delete_tag_key_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :delete_tag_key, name + assert_kind_of ::Google::Cloud::ResourceManager::V3::DeleteTagKeyRequest, request + assert_equal "hello world", request["name"] + assert_equal true, request["validate_only"] + assert_equal "hello world", request["etag"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, delete_tag_key_client_stub do + # Create client + client = ::Google::Cloud::ResourceManager::V3::TagKeys::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.delete_tag_key({ name: name, validate_only: validate_only, etag: etag }) 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_tag_key name: name, validate_only: validate_only, etag: etag 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_tag_key ::Google::Cloud::ResourceManager::V3::DeleteTagKeyRequest.new(name: name, validate_only: validate_only, etag: etag) 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_tag_key({ name: name, validate_only: validate_only, etag: etag }, 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_tag_key(::Google::Cloud::ResourceManager::V3::DeleteTagKeyRequest.new(name: name, validate_only: validate_only, etag: etag), 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_tag_key_client_stub.call_rpc_count + end + end + + def test_get_iam_policy + # Create GRPC objects. + grpc_response = ::Google::Iam::V1::Policy.new + grpc_operation = GRPC::ActiveCall::Operation.new nil + grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + grpc_options = {} + + # Create request parameters for a unary method. + resource = "hello world" + options = {} + + get_iam_policy_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :get_iam_policy, name + assert_kind_of ::Google::Iam::V1::GetIamPolicyRequest, request + assert_equal "hello world", request["resource"] + assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Iam::V1::GetPolicyOptions), request["options"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, get_iam_policy_client_stub do + # Create client + client = ::Google::Cloud::ResourceManager::V3::TagKeys::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.get_iam_policy({ resource: resource, options: options }) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use named arguments + client.get_iam_policy resource: resource, options: options do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.get_iam_policy ::Google::Iam::V1::GetIamPolicyRequest.new(resource: resource, options: options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use hash object with options + client.get_iam_policy({ resource: resource, options: options }, grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object with options + client.get_iam_policy(::Google::Iam::V1::GetIamPolicyRequest.new(resource: resource, options: options), grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Verify method calls + assert_equal 5, get_iam_policy_client_stub.call_rpc_count + end + end + + def test_set_iam_policy + # Create GRPC objects. + grpc_response = ::Google::Iam::V1::Policy.new + grpc_operation = GRPC::ActiveCall::Operation.new nil + grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + grpc_options = {} + + # Create request parameters for a unary method. + resource = "hello world" + policy = {} + update_mask = {} + + set_iam_policy_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :set_iam_policy, name + assert_kind_of ::Google::Iam::V1::SetIamPolicyRequest, request + assert_equal "hello world", request["resource"] + assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Iam::V1::Policy), request["policy"] + assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Protobuf::FieldMask), request["update_mask"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, set_iam_policy_client_stub do + # Create client + client = ::Google::Cloud::ResourceManager::V3::TagKeys::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.set_iam_policy({ resource: resource, policy: policy, update_mask: update_mask }) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use named arguments + client.set_iam_policy resource: resource, policy: policy, update_mask: update_mask do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.set_iam_policy ::Google::Iam::V1::SetIamPolicyRequest.new(resource: resource, policy: policy, update_mask: update_mask) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use hash object with options + client.set_iam_policy({ resource: resource, policy: policy, update_mask: update_mask }, grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object with options + client.set_iam_policy(::Google::Iam::V1::SetIamPolicyRequest.new(resource: resource, policy: policy, update_mask: update_mask), grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Verify method calls + assert_equal 5, set_iam_policy_client_stub.call_rpc_count + end + end + + def test_test_iam_permissions + # Create GRPC objects. + grpc_response = ::Google::Iam::V1::TestIamPermissionsResponse.new + grpc_operation = GRPC::ActiveCall::Operation.new nil + grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + grpc_options = {} + + # Create request parameters for a unary method. + resource = "hello world" + permissions = ["hello world"] + + test_iam_permissions_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :test_iam_permissions, name + assert_kind_of ::Google::Iam::V1::TestIamPermissionsRequest, request + assert_equal "hello world", request["resource"] + assert_equal ["hello world"], request["permissions"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, test_iam_permissions_client_stub do + # Create client + client = ::Google::Cloud::ResourceManager::V3::TagKeys::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.test_iam_permissions({ resource: resource, permissions: permissions }) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use named arguments + client.test_iam_permissions resource: resource, permissions: permissions do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.test_iam_permissions ::Google::Iam::V1::TestIamPermissionsRequest.new(resource: resource, permissions: permissions) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use hash object with options + client.test_iam_permissions({ resource: resource, permissions: permissions }, grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object with options + client.test_iam_permissions(::Google::Iam::V1::TestIamPermissionsRequest.new(resource: resource, permissions: permissions), grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Verify method calls + assert_equal 5, test_iam_permissions_client_stub.call_rpc_count + end + end + + def test_configure + grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + + client = block_config = config = nil + dummy_stub = ClientStub.new nil, nil + Gapic::ServiceStub.stub :new, dummy_stub do + client = ::Google::Cloud::ResourceManager::V3::TagKeys::Client.new do |config| + config.credentials = grpc_channel + end + end + + config = client.configure do |c| + block_config = c + end + + assert_same block_config, config + assert_kind_of ::Google::Cloud::ResourceManager::V3::TagKeys::Client::Configuration, config + end + + def test_credentials + key = OpenSSL::PKey::RSA.new 2048 + cred_json = { + "private_key" => key.to_pem, + "client_email" => "app@developer.gserviceaccount.com", + "type" => "service_account" + } + key_file = StringIO.new cred_json.to_json + creds = Google::Auth::ServiceAccountCredentials.make_creds({ json_key_io: key_file }) + + dummy_stub = ClientStub.new nil, nil + Gapic::ServiceStub.stub :new, dummy_stub do + client = ::Google::Cloud::ResourceManager::V3::TagKeys::Client.new do |config| + config.credentials = creds + end + assert_kind_of ::Google::Cloud::ResourceManager::V3::TagKeys::Client, client + assert_equal creds, client.configure.credentials + end + end + + def test_operations_client + grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + + client = nil + dummy_stub = ClientStub.new nil, nil + Gapic::ServiceStub.stub :new, dummy_stub do + client = ::Google::Cloud::ResourceManager::V3::TagKeys::Client.new do |config| + config.credentials = grpc_channel + end + end + + assert_kind_of ::Google::Cloud::ResourceManager::V3::TagKeys::Operations, client.operations_client + end +end diff --git a/owl-bot-staging/google-cloud-resource_manager-v3/test/google/cloud/resource_manager/v3/tag_values_operations_test.rb b/owl-bot-staging/google-cloud-resource_manager-v3/test/google/cloud/resource_manager/v3/tag_values_operations_test.rb new file mode 100644 index 000000000000..392537d303dc --- /dev/null +++ b/owl-bot-staging/google-cloud-resource_manager-v3/test/google/cloud/resource_manager/v3/tag_values_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/cloud/resourcemanager/v3/tag_values_pb" +require "google/cloud/resourcemanager/v3/tag_values_services_pb" +require "google/cloud/resource_manager/v3/tag_values" + +class ::Google::Cloud::ResourceManager::V3::TagValues::OperationsTest < Minitest::Test + class ClientStub + attr_accessor :call_rpc_count, :requests + + def initialize response, operation, &block + @response = response + @operation = operation + @block = block + @call_rpc_count = 0 + @requests = [] + end + + def call_rpc *args, **kwargs + @call_rpc_count += 1 + + @requests << @block&.call(*args, **kwargs) + + catch :response do + yield @response, @operation if block_given? + @response + end + end + + def endpoint + "endpoint.example.com" + end + + def universe_domain + "example.com" + end + + def stub_logger + nil + end + + def logger + nil + end + end + + def test_list_operations + # Create GRPC objects. + grpc_response = ::Google::Longrunning::ListOperationsResponse.new + grpc_operation = GRPC::ActiveCall::Operation.new nil + grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + grpc_options = {} + + # Create request parameters for a unary method. + name = "hello world" + filter = "hello world" + page_size = 42 + page_token = "hello world" + return_partial_success = true + + list_operations_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :list_operations, name + assert_kind_of ::Google::Longrunning::ListOperationsRequest, request + assert_equal "hello world", request["name"] + assert_equal "hello world", request["filter"] + assert_equal 42, request["page_size"] + assert_equal "hello world", request["page_token"] + assert_equal true, request["return_partial_success"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, list_operations_client_stub do + # Create client + client = ::Google::Cloud::ResourceManager::V3::TagValues::Operations.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.list_operations({ name: name, filter: filter, page_size: page_size, page_token: page_token, return_partial_success: return_partial_success }) do |response, operation| + assert_kind_of Gapic::PagedEnumerable, response + assert_equal grpc_response, response.response + assert_equal grpc_operation, operation + end + + # Use named arguments + client.list_operations name: name, filter: filter, page_size: page_size, page_token: page_token, return_partial_success: return_partial_success do |response, operation| + assert_kind_of Gapic::PagedEnumerable, response + assert_equal grpc_response, response.response + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.list_operations ::Google::Longrunning::ListOperationsRequest.new(name: name, filter: filter, page_size: page_size, page_token: page_token, return_partial_success: return_partial_success) do |response, operation| + assert_kind_of Gapic::PagedEnumerable, response + assert_equal grpc_response, response.response + assert_equal grpc_operation, operation + end + + # Use hash object with options + client.list_operations({ name: name, filter: filter, page_size: page_size, page_token: page_token, return_partial_success: return_partial_success }, grpc_options) do |response, operation| + assert_kind_of Gapic::PagedEnumerable, response + assert_equal grpc_response, response.response + assert_equal grpc_operation, operation + end + + # Use protobuf object with options + client.list_operations(::Google::Longrunning::ListOperationsRequest.new(name: name, filter: filter, page_size: page_size, page_token: page_token, return_partial_success: return_partial_success), grpc_options) do |response, operation| + assert_kind_of Gapic::PagedEnumerable, response + assert_equal grpc_response, response.response + assert_equal grpc_operation, operation + end + + # Verify method calls + assert_equal 5, list_operations_client_stub.call_rpc_count + end + end + + def test_get_operation + # Create GRPC objects. + grpc_response = ::Google::Longrunning::Operation.new + grpc_operation = GRPC::ActiveCall::Operation.new nil + grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + grpc_options = {} + + # Create request parameters for a unary method. + name = "hello world" + + get_operation_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :get_operation, name + assert_kind_of ::Google::Longrunning::GetOperationRequest, request + assert_equal "hello world", request["name"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, get_operation_client_stub do + # Create client + client = ::Google::Cloud::ResourceManager::V3::TagValues::Operations.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.get_operation({ name: name }) do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Use named arguments + client.get_operation name: name do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.get_operation ::Google::Longrunning::GetOperationRequest.new(name: name) do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Use hash object with options + client.get_operation({ name: name }, grpc_options) do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Use protobuf object with options + client.get_operation(::Google::Longrunning::GetOperationRequest.new(name: name), grpc_options) do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Verify method calls + assert_equal 5, get_operation_client_stub.call_rpc_count + end + end + + def test_delete_operation + # Create GRPC objects. + grpc_response = ::Google::Protobuf::Empty.new + grpc_operation = GRPC::ActiveCall::Operation.new nil + grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + grpc_options = {} + + # Create request parameters for a unary method. + name = "hello world" + + delete_operation_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :delete_operation, name + assert_kind_of ::Google::Longrunning::DeleteOperationRequest, request + assert_equal "hello world", request["name"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, delete_operation_client_stub do + # Create client + client = ::Google::Cloud::ResourceManager::V3::TagValues::Operations.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.delete_operation({ name: name }) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use named arguments + client.delete_operation name: name do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.delete_operation ::Google::Longrunning::DeleteOperationRequest.new(name: name) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use hash object with options + client.delete_operation({ name: name }, grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object with options + client.delete_operation(::Google::Longrunning::DeleteOperationRequest.new(name: name), grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Verify method calls + assert_equal 5, delete_operation_client_stub.call_rpc_count + end + end + + def test_cancel_operation + # Create GRPC objects. + grpc_response = ::Google::Protobuf::Empty.new + grpc_operation = GRPC::ActiveCall::Operation.new nil + grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + grpc_options = {} + + # Create request parameters for a unary method. + name = "hello world" + + cancel_operation_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :cancel_operation, name + assert_kind_of ::Google::Longrunning::CancelOperationRequest, request + assert_equal "hello world", request["name"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, cancel_operation_client_stub do + # Create client + client = ::Google::Cloud::ResourceManager::V3::TagValues::Operations.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.cancel_operation({ name: name }) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use named arguments + client.cancel_operation name: name do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.cancel_operation ::Google::Longrunning::CancelOperationRequest.new(name: name) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use hash object with options + client.cancel_operation({ name: name }, grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object with options + client.cancel_operation(::Google::Longrunning::CancelOperationRequest.new(name: name), grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Verify method calls + assert_equal 5, cancel_operation_client_stub.call_rpc_count + end + end + + def test_wait_operation + # Create GRPC objects. + grpc_response = ::Google::Longrunning::Operation.new + grpc_operation = GRPC::ActiveCall::Operation.new nil + grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + grpc_options = {} + + # Create request parameters for a unary method. + name = "hello world" + timeout = {} + + wait_operation_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :wait_operation, name + assert_kind_of ::Google::Longrunning::WaitOperationRequest, request + assert_equal "hello world", request["name"] + assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Protobuf::Duration), request["timeout"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, wait_operation_client_stub do + # Create client + client = ::Google::Cloud::ResourceManager::V3::TagValues::Operations.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.wait_operation({ name: name, timeout: timeout }) do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Use named arguments + client.wait_operation name: name, timeout: timeout do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.wait_operation ::Google::Longrunning::WaitOperationRequest.new(name: name, timeout: timeout) do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Use hash object with options + client.wait_operation({ name: name, timeout: timeout }, grpc_options) do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Use protobuf object with options + client.wait_operation(::Google::Longrunning::WaitOperationRequest.new(name: name, timeout: timeout), grpc_options) do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Verify method calls + assert_equal 5, wait_operation_client_stub.call_rpc_count + end + end + + def test_configure + grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + + client = block_config = config = nil + dummy_stub = ClientStub.new nil, nil + Gapic::ServiceStub.stub :new, dummy_stub do + client = ::Google::Cloud::ResourceManager::V3::TagValues::Operations.new do |config| + config.credentials = grpc_channel + end + end + + config = client.configure do |c| + block_config = c + end + + assert_same block_config, config + assert_kind_of ::Google::Cloud::ResourceManager::V3::TagValues::Operations::Configuration, config + end +end diff --git a/owl-bot-staging/google-cloud-resource_manager-v3/test/google/cloud/resource_manager/v3/tag_values_paths_test.rb b/owl-bot-staging/google-cloud-resource_manager-v3/test/google/cloud/resource_manager/v3/tag_values_paths_test.rb new file mode 100644 index 000000000000..b40a31dac3dd --- /dev/null +++ b/owl-bot-staging/google-cloud-resource_manager-v3/test/google/cloud/resource_manager/v3/tag_values_paths_test.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 "helper" + +require "gapic/grpc/service_stub" + +require "google/cloud/resource_manager/v3/tag_values" + +class ::Google::Cloud::ResourceManager::V3::TagValues::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_tag_value_path + grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + ::Gapic::ServiceStub.stub :new, DummyStub.new do + client = ::Google::Cloud::ResourceManager::V3::TagValues::Client.new do |config| + config.credentials = grpc_channel + end + + path = client.tag_value_path tag_value: "value0" + assert_equal "tagValues/value0", path + end + end +end diff --git a/owl-bot-staging/google-cloud-resource_manager-v3/test/google/cloud/resource_manager/v3/tag_values_rest_test.rb b/owl-bot-staging/google-cloud-resource_manager-v3/test/google/cloud/resource_manager/v3/tag_values_rest_test.rb new file mode 100644 index 000000000000..b683e106ec9a --- /dev/null +++ b/owl-bot-staging/google-cloud-resource_manager-v3/test/google/cloud/resource_manager/v3/tag_values_rest_test.rb @@ -0,0 +1,596 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +require "helper" +require "gapic/rest" +require "google/cloud/resourcemanager/v3/tag_values_pb" +require "google/cloud/resource_manager/v3/tag_values/rest" + + +class ::Google::Cloud::ResourceManager::V3::TagValues::Rest::ClientTest < Minitest::Test + class ClientStub + attr_accessor :call_count, :requests + + def initialize response, &block + @response = response + @block = block + @call_count = 0 + @requests = [] + end + + def make_get_request uri:, params: {}, options: {}, method_name: nil + make_http_request :get, uri: uri, body: nil, params: params, options: options, method_name: method_name + end + + def make_delete_request uri:, params: {}, options: {}, method_name: nil + make_http_request :delete, uri: uri, body: nil, params: params, options: options, method_name: method_name + end + + def make_post_request uri:, body: nil, params: {}, options: {}, method_name: nil + make_http_request :post, uri: uri, body: body, params: params, options: options, method_name: method_name + end + + def make_patch_request uri:, body:, params: {}, options: {}, method_name: nil + make_http_request :patch, uri: uri, body: body, params: params, options: options, method_name: method_name + end + + def make_put_request uri:, body:, params: {}, options: {}, method_name: nil + make_http_request :put, uri: uri, body: body, params: params, options: options, method_name: method_name + end + + def make_http_request *args, **kwargs + @call_count += 1 + + @requests << @block&.call(*args, **kwargs) + + @response + end + + def endpoint + "endpoint.example.com" + end + + def universe_domain + "example.com" + end + + def stub_logger + nil + end + + def logger + nil + end + end + + def test_list_tag_values + # Create test objects. + client_result = ::Google::Cloud::ResourceManager::V3::ListTagValuesResponse.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_tag_values_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| + assert options.metadata.key? :"x-goog-api-client" + assert options.metadata[:"x-goog-api-client"].include? "rest" + refute options.metadata[:"x-goog-api-client"].include? "grpc" + end + + ::Google::Cloud::ResourceManager::V3::TagValues::Rest::ServiceStub.stub :transcode_list_tag_values_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, list_tag_values_client_stub do + # Create client + client = ::Google::Cloud::ResourceManager::V3::TagValues::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.list_tag_values({ 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_tag_values 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_tag_values ::Google::Cloud::ResourceManager::V3::ListTagValuesRequest.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_tag_values({ 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_tag_values(::Google::Cloud::ResourceManager::V3::ListTagValuesRequest.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_tag_values_client_stub.call_count + end + end + end + + def test_get_tag_value + # Create test objects. + client_result = ::Google::Cloud::ResourceManager::V3::TagValue.new + http_response = OpenStruct.new body: client_result.to_json + + call_options = {} + + # Create request parameters for a unary method. + name = "hello world" + + get_tag_value_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| + assert options.metadata.key? :"x-goog-api-client" + assert options.metadata[:"x-goog-api-client"].include? "rest" + refute options.metadata[:"x-goog-api-client"].include? "grpc" + end + + ::Google::Cloud::ResourceManager::V3::TagValues::Rest::ServiceStub.stub :transcode_get_tag_value_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, get_tag_value_client_stub do + # Create client + client = ::Google::Cloud::ResourceManager::V3::TagValues::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.get_tag_value({ name: name }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.get_tag_value name: name do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.get_tag_value ::Google::Cloud::ResourceManager::V3::GetTagValueRequest.new(name: name) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + client.get_tag_value({ name: name }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + client.get_tag_value(::Google::Cloud::ResourceManager::V3::GetTagValueRequest.new(name: name), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, get_tag_value_client_stub.call_count + end + end + end + + def test_get_namespaced_tag_value + # Create test objects. + client_result = ::Google::Cloud::ResourceManager::V3::TagValue.new + http_response = OpenStruct.new body: client_result.to_json + + call_options = {} + + # Create request parameters for a unary method. + name = "hello world" + + get_namespaced_tag_value_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| + assert options.metadata.key? :"x-goog-api-client" + assert options.metadata[:"x-goog-api-client"].include? "rest" + refute options.metadata[:"x-goog-api-client"].include? "grpc" + end + + ::Google::Cloud::ResourceManager::V3::TagValues::Rest::ServiceStub.stub :transcode_get_namespaced_tag_value_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, get_namespaced_tag_value_client_stub do + # Create client + client = ::Google::Cloud::ResourceManager::V3::TagValues::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.get_namespaced_tag_value({ name: name }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.get_namespaced_tag_value name: name do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.get_namespaced_tag_value ::Google::Cloud::ResourceManager::V3::GetNamespacedTagValueRequest.new(name: name) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + client.get_namespaced_tag_value({ name: name }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + client.get_namespaced_tag_value(::Google::Cloud::ResourceManager::V3::GetNamespacedTagValueRequest.new(name: name), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, get_namespaced_tag_value_client_stub.call_count + end + end + end + + def test_create_tag_value + # 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. + tag_value = {} + validate_only = true + + create_tag_value_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| + assert options.metadata.key? :"x-goog-api-client" + assert options.metadata[:"x-goog-api-client"].include? "rest" + refute options.metadata[:"x-goog-api-client"].include? "grpc" + end + + ::Google::Cloud::ResourceManager::V3::TagValues::Rest::ServiceStub.stub :transcode_create_tag_value_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, create_tag_value_client_stub do + # Create client + client = ::Google::Cloud::ResourceManager::V3::TagValues::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.create_tag_value({ tag_value: tag_value, validate_only: validate_only }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.create_tag_value tag_value: tag_value, validate_only: validate_only do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.create_tag_value ::Google::Cloud::ResourceManager::V3::CreateTagValueRequest.new(tag_value: tag_value, validate_only: validate_only) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + client.create_tag_value({ tag_value: tag_value, validate_only: validate_only }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + client.create_tag_value(::Google::Cloud::ResourceManager::V3::CreateTagValueRequest.new(tag_value: tag_value, validate_only: validate_only), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, create_tag_value_client_stub.call_count + end + end + end + + def test_update_tag_value + # 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. + tag_value = {} + update_mask = {} + validate_only = true + + update_tag_value_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| + assert options.metadata.key? :"x-goog-api-client" + assert options.metadata[:"x-goog-api-client"].include? "rest" + refute options.metadata[:"x-goog-api-client"].include? "grpc" + end + + ::Google::Cloud::ResourceManager::V3::TagValues::Rest::ServiceStub.stub :transcode_update_tag_value_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, update_tag_value_client_stub do + # Create client + client = ::Google::Cloud::ResourceManager::V3::TagValues::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.update_tag_value({ tag_value: tag_value, update_mask: update_mask, validate_only: validate_only }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.update_tag_value tag_value: tag_value, update_mask: update_mask, validate_only: validate_only do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.update_tag_value ::Google::Cloud::ResourceManager::V3::UpdateTagValueRequest.new(tag_value: tag_value, update_mask: update_mask, validate_only: validate_only) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + client.update_tag_value({ tag_value: tag_value, update_mask: update_mask, validate_only: validate_only }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + client.update_tag_value(::Google::Cloud::ResourceManager::V3::UpdateTagValueRequest.new(tag_value: tag_value, update_mask: update_mask, validate_only: validate_only), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, update_tag_value_client_stub.call_count + end + end + end + + def test_delete_tag_value + # 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" + validate_only = true + etag = "hello world" + + delete_tag_value_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| + assert options.metadata.key? :"x-goog-api-client" + assert options.metadata[:"x-goog-api-client"].include? "rest" + refute options.metadata[:"x-goog-api-client"].include? "grpc" + end + + ::Google::Cloud::ResourceManager::V3::TagValues::Rest::ServiceStub.stub :transcode_delete_tag_value_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, delete_tag_value_client_stub do + # Create client + client = ::Google::Cloud::ResourceManager::V3::TagValues::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.delete_tag_value({ name: name, validate_only: validate_only, etag: etag }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.delete_tag_value name: name, validate_only: validate_only, etag: etag do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.delete_tag_value ::Google::Cloud::ResourceManager::V3::DeleteTagValueRequest.new(name: name, validate_only: validate_only, etag: etag) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + client.delete_tag_value({ name: name, validate_only: validate_only, etag: etag }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + client.delete_tag_value(::Google::Cloud::ResourceManager::V3::DeleteTagValueRequest.new(name: name, validate_only: validate_only, etag: etag), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, delete_tag_value_client_stub.call_count + end + end + end + + def test_get_iam_policy + # Create test objects. + client_result = ::Google::Iam::V1::Policy.new + http_response = OpenStruct.new body: client_result.to_json + + call_options = {} + + # Create request parameters for a unary method. + resource = "hello world" + options = {} + + get_iam_policy_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| + assert options.metadata.key? :"x-goog-api-client" + assert options.metadata[:"x-goog-api-client"].include? "rest" + refute options.metadata[:"x-goog-api-client"].include? "grpc" + end + + ::Google::Cloud::ResourceManager::V3::TagValues::Rest::ServiceStub.stub :transcode_get_iam_policy_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, get_iam_policy_client_stub do + # Create client + client = ::Google::Cloud::ResourceManager::V3::TagValues::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.get_iam_policy({ resource: resource, options: options }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.get_iam_policy resource: resource, options: options do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.get_iam_policy ::Google::Iam::V1::GetIamPolicyRequest.new(resource: resource, options: options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + client.get_iam_policy({ resource: resource, options: options }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + client.get_iam_policy(::Google::Iam::V1::GetIamPolicyRequest.new(resource: resource, options: options), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, get_iam_policy_client_stub.call_count + end + end + end + + def test_set_iam_policy + # Create test objects. + client_result = ::Google::Iam::V1::Policy.new + http_response = OpenStruct.new body: client_result.to_json + + call_options = {} + + # Create request parameters for a unary method. + resource = "hello world" + policy = {} + update_mask = {} + + set_iam_policy_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| + assert options.metadata.key? :"x-goog-api-client" + assert options.metadata[:"x-goog-api-client"].include? "rest" + refute options.metadata[:"x-goog-api-client"].include? "grpc" + end + + ::Google::Cloud::ResourceManager::V3::TagValues::Rest::ServiceStub.stub :transcode_set_iam_policy_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, set_iam_policy_client_stub do + # Create client + client = ::Google::Cloud::ResourceManager::V3::TagValues::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.set_iam_policy({ resource: resource, policy: policy, update_mask: update_mask }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.set_iam_policy resource: resource, policy: policy, update_mask: update_mask do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.set_iam_policy ::Google::Iam::V1::SetIamPolicyRequest.new(resource: resource, policy: policy, update_mask: update_mask) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + client.set_iam_policy({ resource: resource, policy: policy, update_mask: update_mask }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + client.set_iam_policy(::Google::Iam::V1::SetIamPolicyRequest.new(resource: resource, policy: policy, update_mask: update_mask), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, set_iam_policy_client_stub.call_count + end + end + end + + def test_test_iam_permissions + # Create test objects. + client_result = ::Google::Iam::V1::TestIamPermissionsResponse.new + http_response = OpenStruct.new body: client_result.to_json + + call_options = {} + + # Create request parameters for a unary method. + resource = "hello world" + permissions = ["hello world"] + + test_iam_permissions_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| + assert options.metadata.key? :"x-goog-api-client" + assert options.metadata[:"x-goog-api-client"].include? "rest" + refute options.metadata[:"x-goog-api-client"].include? "grpc" + end + + ::Google::Cloud::ResourceManager::V3::TagValues::Rest::ServiceStub.stub :transcode_test_iam_permissions_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, test_iam_permissions_client_stub do + # Create client + client = ::Google::Cloud::ResourceManager::V3::TagValues::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.test_iam_permissions({ resource: resource, permissions: permissions }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.test_iam_permissions resource: resource, permissions: permissions do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.test_iam_permissions ::Google::Iam::V1::TestIamPermissionsRequest.new(resource: resource, permissions: permissions) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + client.test_iam_permissions({ resource: resource, permissions: permissions }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + client.test_iam_permissions(::Google::Iam::V1::TestIamPermissionsRequest.new(resource: resource, permissions: permissions), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, test_iam_permissions_client_stub.call_count + end + end + end + + def test_configure + credentials_token = :dummy_value + + client = block_config = config = nil + dummy_stub = ClientStub.new nil + Gapic::Rest::ClientStub.stub :new, dummy_stub do + client = ::Google::Cloud::ResourceManager::V3::TagValues::Rest::Client.new do |config| + config.credentials = credentials_token + end + end + + config = client.configure do |c| + block_config = c + end + + assert_same block_config, config + assert_kind_of ::Google::Cloud::ResourceManager::V3::TagValues::Rest::Client::Configuration, config + end +end diff --git a/owl-bot-staging/google-cloud-resource_manager-v3/test/google/cloud/resource_manager/v3/tag_values_test.rb b/owl-bot-staging/google-cloud-resource_manager-v3/test/google/cloud/resource_manager/v3/tag_values_test.rb new file mode 100644 index 000000000000..7c18b7c21ddb --- /dev/null +++ b/owl-bot-staging/google-cloud-resource_manager-v3/test/google/cloud/resource_manager/v3/tag_values_test.rb @@ -0,0 +1,682 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +require "helper" + +require "gapic/grpc/service_stub" + +require "google/cloud/resourcemanager/v3/tag_values_pb" +require "google/cloud/resource_manager/v3/tag_values" + +class ::Google::Cloud::ResourceManager::V3::TagValues::ClientTest < Minitest::Test + class ClientStub + attr_accessor :call_rpc_count, :requests + + def initialize response, operation, &block + @response = response + @operation = operation + @block = block + @call_rpc_count = 0 + @requests = [] + end + + def call_rpc *args, **kwargs + @call_rpc_count += 1 + + @requests << @block&.call(*args, **kwargs) + + catch :response do + yield @response, @operation if block_given? + @response + end + end + + def endpoint + "endpoint.example.com" + end + + def universe_domain + "example.com" + end + + def stub_logger + nil + end + + def logger + nil + end + end + + def test_list_tag_values + # Create GRPC objects. + grpc_response = ::Google::Cloud::ResourceManager::V3::ListTagValuesResponse.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_tag_values_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :list_tag_values, name + assert_kind_of ::Google::Cloud::ResourceManager::V3::ListTagValuesRequest, 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_tag_values_client_stub do + # Create client + client = ::Google::Cloud::ResourceManager::V3::TagValues::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.list_tag_values({ 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_tag_values 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_tag_values ::Google::Cloud::ResourceManager::V3::ListTagValuesRequest.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_tag_values({ 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_tag_values(::Google::Cloud::ResourceManager::V3::ListTagValuesRequest.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_tag_values_client_stub.call_rpc_count + end + end + + def test_get_tag_value + # Create GRPC objects. + grpc_response = ::Google::Cloud::ResourceManager::V3::TagValue.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_tag_value_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :get_tag_value, name + assert_kind_of ::Google::Cloud::ResourceManager::V3::GetTagValueRequest, request + assert_equal "hello world", request["name"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, get_tag_value_client_stub do + # Create client + client = ::Google::Cloud::ResourceManager::V3::TagValues::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.get_tag_value({ name: name }) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use named arguments + client.get_tag_value name: name do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.get_tag_value ::Google::Cloud::ResourceManager::V3::GetTagValueRequest.new(name: name) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use hash object with options + client.get_tag_value({ 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_tag_value(::Google::Cloud::ResourceManager::V3::GetTagValueRequest.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_tag_value_client_stub.call_rpc_count + end + end + + def test_get_namespaced_tag_value + # Create GRPC objects. + grpc_response = ::Google::Cloud::ResourceManager::V3::TagValue.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_namespaced_tag_value_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :get_namespaced_tag_value, name + assert_kind_of ::Google::Cloud::ResourceManager::V3::GetNamespacedTagValueRequest, request + assert_equal "hello world", request["name"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, get_namespaced_tag_value_client_stub do + # Create client + client = ::Google::Cloud::ResourceManager::V3::TagValues::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.get_namespaced_tag_value({ name: name }) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use named arguments + client.get_namespaced_tag_value name: name do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.get_namespaced_tag_value ::Google::Cloud::ResourceManager::V3::GetNamespacedTagValueRequest.new(name: name) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use hash object with options + client.get_namespaced_tag_value({ 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_namespaced_tag_value(::Google::Cloud::ResourceManager::V3::GetNamespacedTagValueRequest.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_namespaced_tag_value_client_stub.call_rpc_count + end + end + + def test_create_tag_value + # 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. + tag_value = {} + validate_only = true + + create_tag_value_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :create_tag_value, name + assert_kind_of ::Google::Cloud::ResourceManager::V3::CreateTagValueRequest, request + assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::ResourceManager::V3::TagValue), request["tag_value"] + assert_equal true, request["validate_only"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, create_tag_value_client_stub do + # Create client + client = ::Google::Cloud::ResourceManager::V3::TagValues::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.create_tag_value({ tag_value: tag_value, 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_tag_value tag_value: tag_value, 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_tag_value ::Google::Cloud::ResourceManager::V3::CreateTagValueRequest.new(tag_value: tag_value, 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_tag_value({ tag_value: tag_value, 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_tag_value(::Google::Cloud::ResourceManager::V3::CreateTagValueRequest.new(tag_value: tag_value, 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_tag_value_client_stub.call_rpc_count + end + end + + def test_update_tag_value + # 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. + tag_value = {} + update_mask = {} + validate_only = true + + update_tag_value_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :update_tag_value, name + assert_kind_of ::Google::Cloud::ResourceManager::V3::UpdateTagValueRequest, request + assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::ResourceManager::V3::TagValue), request["tag_value"] + assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Protobuf::FieldMask), request["update_mask"] + assert_equal true, request["validate_only"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, update_tag_value_client_stub do + # Create client + client = ::Google::Cloud::ResourceManager::V3::TagValues::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.update_tag_value({ tag_value: tag_value, update_mask: update_mask, 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_tag_value tag_value: tag_value, update_mask: update_mask, 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_tag_value ::Google::Cloud::ResourceManager::V3::UpdateTagValueRequest.new(tag_value: tag_value, update_mask: update_mask, 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_tag_value({ tag_value: tag_value, update_mask: update_mask, 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_tag_value(::Google::Cloud::ResourceManager::V3::UpdateTagValueRequest.new(tag_value: tag_value, update_mask: update_mask, 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_tag_value_client_stub.call_rpc_count + end + end + + def test_delete_tag_value + # 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" + validate_only = true + etag = "hello world" + + delete_tag_value_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :delete_tag_value, name + assert_kind_of ::Google::Cloud::ResourceManager::V3::DeleteTagValueRequest, request + assert_equal "hello world", request["name"] + assert_equal true, request["validate_only"] + assert_equal "hello world", request["etag"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, delete_tag_value_client_stub do + # Create client + client = ::Google::Cloud::ResourceManager::V3::TagValues::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.delete_tag_value({ name: name, validate_only: validate_only, etag: etag }) 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_tag_value name: name, validate_only: validate_only, etag: etag 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_tag_value ::Google::Cloud::ResourceManager::V3::DeleteTagValueRequest.new(name: name, validate_only: validate_only, etag: etag) 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_tag_value({ name: name, validate_only: validate_only, etag: etag }, 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_tag_value(::Google::Cloud::ResourceManager::V3::DeleteTagValueRequest.new(name: name, validate_only: validate_only, etag: etag), 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_tag_value_client_stub.call_rpc_count + end + end + + def test_get_iam_policy + # Create GRPC objects. + grpc_response = ::Google::Iam::V1::Policy.new + grpc_operation = GRPC::ActiveCall::Operation.new nil + grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + grpc_options = {} + + # Create request parameters for a unary method. + resource = "hello world" + options = {} + + get_iam_policy_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :get_iam_policy, name + assert_kind_of ::Google::Iam::V1::GetIamPolicyRequest, request + assert_equal "hello world", request["resource"] + assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Iam::V1::GetPolicyOptions), request["options"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, get_iam_policy_client_stub do + # Create client + client = ::Google::Cloud::ResourceManager::V3::TagValues::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.get_iam_policy({ resource: resource, options: options }) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use named arguments + client.get_iam_policy resource: resource, options: options do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.get_iam_policy ::Google::Iam::V1::GetIamPolicyRequest.new(resource: resource, options: options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use hash object with options + client.get_iam_policy({ resource: resource, options: options }, grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object with options + client.get_iam_policy(::Google::Iam::V1::GetIamPolicyRequest.new(resource: resource, options: options), grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Verify method calls + assert_equal 5, get_iam_policy_client_stub.call_rpc_count + end + end + + def test_set_iam_policy + # Create GRPC objects. + grpc_response = ::Google::Iam::V1::Policy.new + grpc_operation = GRPC::ActiveCall::Operation.new nil + grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + grpc_options = {} + + # Create request parameters for a unary method. + resource = "hello world" + policy = {} + update_mask = {} + + set_iam_policy_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :set_iam_policy, name + assert_kind_of ::Google::Iam::V1::SetIamPolicyRequest, request + assert_equal "hello world", request["resource"] + assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Iam::V1::Policy), request["policy"] + assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Protobuf::FieldMask), request["update_mask"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, set_iam_policy_client_stub do + # Create client + client = ::Google::Cloud::ResourceManager::V3::TagValues::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.set_iam_policy({ resource: resource, policy: policy, update_mask: update_mask }) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use named arguments + client.set_iam_policy resource: resource, policy: policy, update_mask: update_mask do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.set_iam_policy ::Google::Iam::V1::SetIamPolicyRequest.new(resource: resource, policy: policy, update_mask: update_mask) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use hash object with options + client.set_iam_policy({ resource: resource, policy: policy, update_mask: update_mask }, grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object with options + client.set_iam_policy(::Google::Iam::V1::SetIamPolicyRequest.new(resource: resource, policy: policy, update_mask: update_mask), grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Verify method calls + assert_equal 5, set_iam_policy_client_stub.call_rpc_count + end + end + + def test_test_iam_permissions + # Create GRPC objects. + grpc_response = ::Google::Iam::V1::TestIamPermissionsResponse.new + grpc_operation = GRPC::ActiveCall::Operation.new nil + grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + grpc_options = {} + + # Create request parameters for a unary method. + resource = "hello world" + permissions = ["hello world"] + + test_iam_permissions_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :test_iam_permissions, name + assert_kind_of ::Google::Iam::V1::TestIamPermissionsRequest, request + assert_equal "hello world", request["resource"] + assert_equal ["hello world"], request["permissions"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, test_iam_permissions_client_stub do + # Create client + client = ::Google::Cloud::ResourceManager::V3::TagValues::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.test_iam_permissions({ resource: resource, permissions: permissions }) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use named arguments + client.test_iam_permissions resource: resource, permissions: permissions do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.test_iam_permissions ::Google::Iam::V1::TestIamPermissionsRequest.new(resource: resource, permissions: permissions) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use hash object with options + client.test_iam_permissions({ resource: resource, permissions: permissions }, grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object with options + client.test_iam_permissions(::Google::Iam::V1::TestIamPermissionsRequest.new(resource: resource, permissions: permissions), grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Verify method calls + assert_equal 5, test_iam_permissions_client_stub.call_rpc_count + end + end + + def test_configure + grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + + client = block_config = config = nil + dummy_stub = ClientStub.new nil, nil + Gapic::ServiceStub.stub :new, dummy_stub do + client = ::Google::Cloud::ResourceManager::V3::TagValues::Client.new do |config| + config.credentials = grpc_channel + end + end + + config = client.configure do |c| + block_config = c + end + + assert_same block_config, config + assert_kind_of ::Google::Cloud::ResourceManager::V3::TagValues::Client::Configuration, config + end + + def test_credentials + key = OpenSSL::PKey::RSA.new 2048 + cred_json = { + "private_key" => key.to_pem, + "client_email" => "app@developer.gserviceaccount.com", + "type" => "service_account" + } + key_file = StringIO.new cred_json.to_json + creds = Google::Auth::ServiceAccountCredentials.make_creds({ json_key_io: key_file }) + + dummy_stub = ClientStub.new nil, nil + Gapic::ServiceStub.stub :new, dummy_stub do + client = ::Google::Cloud::ResourceManager::V3::TagValues::Client.new do |config| + config.credentials = creds + end + assert_kind_of ::Google::Cloud::ResourceManager::V3::TagValues::Client, client + assert_equal creds, client.configure.credentials + end + end + + def test_operations_client + grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + + client = nil + dummy_stub = ClientStub.new nil, nil + Gapic::ServiceStub.stub :new, dummy_stub do + client = ::Google::Cloud::ResourceManager::V3::TagValues::Client.new do |config| + config.credentials = grpc_channel + end + end + + assert_kind_of ::Google::Cloud::ResourceManager::V3::TagValues::Operations, client.operations_client + end +end diff --git a/owl-bot-staging/google-cloud-resource_manager-v3/test/helper.rb b/owl-bot-staging/google-cloud-resource_manager-v3/test/helper.rb new file mode 100644 index 000000000000..672b337030e7 --- /dev/null +++ b/owl-bot-staging/google-cloud-resource_manager-v3/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" diff --git a/owl-bot-staging/google-cloud-retail-v2/.gitignore b/owl-bot-staging/google-cloud-retail-v2/.gitignore new file mode 100644 index 000000000000..0135b6bc6cfc --- /dev/null +++ b/owl-bot-staging/google-cloud-retail-v2/.gitignore @@ -0,0 +1,22 @@ +# Ignore bundler lockfiles +Gemfile.lock +gems.locked + +# Ignore documentation output +doc/* +.yardoc/* + +# Ignore test output +coverage/* + +# Ignore build artifacts +pkg/* + +# Ignore files commonly present in certain dev environments +.vagrant +.DS_STORE +.idea +*.iml + +# Ignore synth output +__pycache__ diff --git a/owl-bot-staging/google-cloud-retail-v2/.repo-metadata.json b/owl-bot-staging/google-cloud-retail-v2/.repo-metadata.json new file mode 100644 index 000000000000..034a00868333 --- /dev/null +++ b/owl-bot-staging/google-cloud-retail-v2/.repo-metadata.json @@ -0,0 +1,18 @@ +{ + "api_id": "retail.googleapis.com", + "api_shortname": "retail", + "client_documentation": "https://cloud.google.com/ruby/docs/reference/google-cloud-retail-v2/latest", + "distribution_name": "google-cloud-retail-v2", + "is_cloud": true, + "language": "ruby", + "name": "retail", + "name_pretty": "Retail V2 API", + "product_documentation": "https://cloud.google.com/retail/docs/apis", + "release_level": "unreleased", + "repo": "googleapis/google-cloud-ruby", + "requires_billing": true, + "ruby-cloud-description": "Retail enables you to build an end-to-end personalized recommendation system based on state-of-the-art deep learning ML models, without a need for expertise in ML or recommendation systems. Note that google-cloud-retail-v2 is a version-specific client library. For most uses, we recommend installing the main client library google-cloud-retail instead. See the readme for more details.", + "ruby-cloud-env-prefix": "RETAIL", + "ruby-cloud-product-url": "https://cloud.google.com/retail/docs/apis", + "library_type": "GAPIC_AUTO" +} diff --git a/owl-bot-staging/google-cloud-retail-v2/.rubocop.yml b/owl-bot-staging/google-cloud-retail-v2/.rubocop.yml new file mode 100644 index 000000000000..def961aa4ee5 --- /dev/null +++ b/owl-bot-staging/google-cloud-retail-v2/.rubocop.yml @@ -0,0 +1,33 @@ +inherit_gem: + google-style: google-style.yml + +AllCops: + Exclude: + - "google-cloud-retail-v2.gemspec" + - "lib/**/*_pb.rb" + - "proto_docs/**/*" + - "test/**/*" + - "acceptance/**/*" + - "samples/acceptance/**/*" + - "Rakefile" + +Layout/LineLength: + Enabled: false +Metrics/AbcSize: + Enabled: false +Metrics/ClassLength: + Enabled: false +Metrics/CyclomaticComplexity: + Enabled: false +Metrics/MethodLength: + Enabled: false +Metrics/ModuleLength: + Enabled: false +Metrics/PerceivedComplexity: + Enabled: false +Naming/AccessorMethodName: + Exclude: + - "snippets/**/*.rb" +Naming/FileName: + Exclude: + - "lib/google-cloud-retail-v2.rb" diff --git a/owl-bot-staging/google-cloud-retail-v2/.toys.rb b/owl-bot-staging/google-cloud-retail-v2/.toys.rb new file mode 100644 index 000000000000..177e22456e8a --- /dev/null +++ b/owl-bot-staging/google-cloud-retail-v2/.toys.rb @@ -0,0 +1,28 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +toys_version! ">= 0.15.3" + +if ENV["RUBY_COMMON_TOOLS"] + common_tools_dir = File.expand_path ENV["RUBY_COMMON_TOOLS"] + load File.join(common_tools_dir, "toys", "gapic") +else + load_git remote: "https://github.com/googleapis/ruby-common-tools.git", + path: "toys/gapic", + update: true +end diff --git a/owl-bot-staging/google-cloud-retail-v2/.yardopts b/owl-bot-staging/google-cloud-retail-v2/.yardopts new file mode 100644 index 000000000000..038190b897cc --- /dev/null +++ b/owl-bot-staging/google-cloud-retail-v2/.yardopts @@ -0,0 +1,12 @@ +--no-private +--title="Retail V2 API" +--exclude _pb\.rb$ +--markup markdown +--markup-provider redcarpet + +./lib/**/*.rb +./proto_docs/**/*.rb +- +README.md +LICENSE.md +AUTHENTICATION.md diff --git a/owl-bot-staging/google-cloud-retail-v2/AUTHENTICATION.md b/owl-bot-staging/google-cloud-retail-v2/AUTHENTICATION.md new file mode 100644 index 000000000000..8862a3fae853 --- /dev/null +++ b/owl-bot-staging/google-cloud-retail-v2/AUTHENTICATION.md @@ -0,0 +1,122 @@ +# Authentication + +The recommended way to authenticate to the google-cloud-retail-v2 library is to use +[Application Default Credentials (ADC)](https://cloud.google.com/docs/authentication/application-default-credentials). +To review all of your authentication options, see [Credentials lookup](#credential-lookup). + +## Quickstart + +The following example shows how to set up authentication for a local development +environment with your user credentials. + +**NOTE:** This method is _not_ recommended for running in production. User credentials +should be used only during development. + +1. [Download and install the Google Cloud CLI](https://cloud.google.com/sdk). +2. Set up a local ADC file with your user credentials: + +```sh +gcloud auth application-default login +``` + +3. Write code as if already authenticated. + +For more information about setting up authentication for a local development environment, see +[Set up Application Default Credentials](https://cloud.google.com/docs/authentication/provide-credentials-adc#local-dev). + +## Credential Lookup + +The google-cloud-retail-v2 library provides several mechanisms to configure your system. +Generally, using Application Default Credentials to facilitate automatic +credentials discovery is the easist method. But if you need to explicitly specify +credentials, there are several methods available to you. + +Credentials are accepted in the following ways, in the following order or precedence: + +1. Credentials specified in method arguments +2. Credentials specified in configuration +3. Credentials pointed to or included in environment variables +4. Credentials found in local ADC file +5. Credentials returned by the metadata server for the attached service account (GCP) + +### Configuration + +You can configure a path to a JSON credentials file, either for an individual client object or +globally, for all client objects. The JSON file can contain credentials created for +[workload identity federation](https://cloud.google.com/iam/docs/workload-identity-federation), +[workforce identity federation](https://cloud.google.com/iam/docs/workforce-identity-federation), or a +[service account key](https://cloud.google.com/docs/authentication/provide-credentials-adc#local-key). + +Note: Service account keys are a security risk if not managed correctly. You should +[choose a more secure alternative to service account keys](https://cloud.google.com/docs/authentication#auth-decision-tree) +whenever possible. + +To configure a credentials file for an individual client initialization: + +```ruby +require "google/cloud/retail/v2" + +client = ::Google::Cloud::Retail::V2::AnalyticsService::Client.new do |config| + config.credentials = "path/to/credentialfile.json" +end +``` + +To configure a credentials file globally for all clients: + +```ruby +require "google/cloud/retail/v2" + +::Google::Cloud::Retail::V2::AnalyticsService::Client.configure do |config| + config.credentials = "path/to/credentialfile.json" +end + +client = ::Google::Cloud::Retail::V2::AnalyticsService::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-retail-v2 +checks for credentials are: + +* `GOOGLE_CLOUD_CREDENTIALS` - Path to JSON file, or JSON contents +* `GOOGLE_APPLICATION_CREDENTIALS` - Path to JSON file + +```ruby +require "google/cloud/retail/v2" + +ENV["GOOGLE_APPLICATION_CREDENTIALS"] = "path/to/credentialfile.json" + +client = ::Google::Cloud::Retail::V2::AnalyticsService::Client.new +``` + +### Local ADC file + +You can set up a local ADC file with your user credentials for authentication during +development. If credentials are not provided in code or in environment variables, +then the local ADC credentials are discovered. + +Follow the steps in [Quickstart](#quickstart) to set up a local ADC file. + +### Google Cloud Platform environments + +When running on Google Cloud Platform (GCP), including Google Compute Engine +(GCE), Google Kubernetes Engine (GKE), Google App Engine (GAE), Google Cloud +Functions (GCF) and Cloud Run, credentials are retrieved from the attached +service account automatically. Code should be written as if already authenticated. + +For more information, see +[Set up ADC for Google Cloud services](https://cloud.google.com/docs/authentication/provide-credentials-adc#attached-sa). diff --git a/owl-bot-staging/google-cloud-retail-v2/CHANGELOG.md b/owl-bot-staging/google-cloud-retail-v2/CHANGELOG.md new file mode 100644 index 000000000000..f88957a62ba2 --- /dev/null +++ b/owl-bot-staging/google-cloud-retail-v2/CHANGELOG.md @@ -0,0 +1,2 @@ +# Release History + diff --git a/owl-bot-staging/google-cloud-retail-v2/Gemfile b/owl-bot-staging/google-cloud-retail-v2/Gemfile new file mode 100644 index 000000000000..1d08558908d8 --- /dev/null +++ b/owl-bot-staging/google-cloud-retail-v2/Gemfile @@ -0,0 +1,14 @@ +source "https://rubygems.org" + +gemspec + +gem "google-style", "~> 1.32.0" +gem "irb", "~> 1.17" +gem "minitest", "~> 6.0.2" +gem "minitest-focus", "~> 1.4" +gem "minitest-mock", "~> 5.27" +gem "minitest-rg", "~> 5.3" +gem "ostruct", "~> 0.5.5" +gem "rake", ">= 13.0" +gem "redcarpet", "~> 3.6" +gem "yard", "~> 0.9" diff --git a/owl-bot-staging/google-cloud-retail-v2/LICENSE.md b/owl-bot-staging/google-cloud-retail-v2/LICENSE.md new file mode 100644 index 000000000000..c261857ba6ad --- /dev/null +++ b/owl-bot-staging/google-cloud-retail-v2/LICENSE.md @@ -0,0 +1,201 @@ + Apache License + Version 2.0, January 2004 + http://www.apache.org/licenses/ + + TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION + + 1. Definitions. + + "License" shall mean the terms and conditions for use, reproduction, + and distribution as defined by Sections 1 through 9 of this document. + + "Licensor" shall mean the copyright owner or entity authorized by + the copyright owner that is granting the License. + + "Legal Entity" shall mean the union of the acting entity and all + other entities that control, are controlled by, or are under common + control with that entity. For the purposes of this definition, + "control" means (i) the power, direct or indirect, to cause the + direction or management of such entity, whether by contract or + otherwise, or (ii) ownership of fifty percent (50%) or more of the + outstanding shares, or (iii) beneficial ownership of such entity. + + "You" (or "Your") shall mean an individual or Legal Entity + exercising permissions granted by this License. + + "Source" form shall mean the preferred form for making modifications, + including but not limited to software source code, documentation + source, and configuration files. + + "Object" form shall mean any form resulting from mechanical + transformation or translation of a Source form, including but + not limited to compiled object code, generated documentation, + and conversions to other media types. + + "Work" shall mean the work of authorship, whether in Source or + Object form, made available under the License, as indicated by a + copyright notice that is included in or attached to the work + (an example is provided in the Appendix below). + + "Derivative Works" shall mean any work, whether in Source or Object + form, that is based on (or derived from) the Work and for which the + editorial revisions, annotations, elaborations, or other modifications + represent, as a whole, an original work of authorship. For the purposes + of this License, Derivative Works shall not include works that remain + separable from, or merely link (or bind by name) to the interfaces of, + the Work and Derivative Works thereof. + + "Contribution" shall mean any work of authorship, including + the original version of the Work and any modifications or additions + to that Work or Derivative Works thereof, that is intentionally + submitted to Licensor for inclusion in the Work by the copyright owner + or by an individual or Legal Entity authorized to submit on behalf of + the copyright owner. For the purposes of this definition, "submitted" + means any form of electronic, verbal, or written communication sent + to the Licensor or its representatives, including but not limited to + communication on electronic mailing lists, source code control systems, + and issue tracking systems that are managed by, or on behalf of, the + Licensor for the purpose of discussing and improving the Work, but + excluding communication that is conspicuously marked or otherwise + designated in writing by the copyright owner as "Not a Contribution." + + "Contributor" shall mean Licensor and any individual or Legal Entity + on behalf of whom a Contribution has been received by Licensor and + subsequently incorporated within the Work. + + 2. Grant of Copyright License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + copyright license to reproduce, prepare Derivative Works of, + publicly display, publicly perform, sublicense, and distribute the + Work and such Derivative Works in Source or Object form. + + 3. Grant of Patent License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + (except as stated in this section) patent license to make, have made, + use, offer to sell, sell, import, and otherwise transfer the Work, + where such license applies only to those patent claims licensable + by such Contributor that are necessarily infringed by their + Contribution(s) alone or by combination of their Contribution(s) + with the Work to which such Contribution(s) was submitted. If You + institute patent litigation against any entity (including a + cross-claim or counterclaim in a lawsuit) alleging that the Work + or a Contribution incorporated within the Work constitutes direct + or contributory patent infringement, then any patent licenses + granted to You under this License for that Work shall terminate + as of the date such litigation is filed. + + 4. Redistribution. You may reproduce and distribute copies of the + Work or Derivative Works thereof in any medium, with or without + modifications, and in Source or Object form, provided that You + meet the following conditions: + + (a) You must give any other recipients of the Work or + Derivative Works a copy of this License; and + + (b) You must cause any modified files to carry prominent notices + stating that You changed the files; and + + (c) You must retain, in the Source form of any Derivative Works + that You distribute, all copyright, patent, trademark, and + attribution notices from the Source form of the Work, + excluding those notices that do not pertain to any part of + the Derivative Works; and + + (d) If the Work includes a "NOTICE" text file as part of its + distribution, then any Derivative Works that You distribute must + include a readable copy of the attribution notices contained + within such NOTICE file, excluding those notices that do not + pertain to any part of the Derivative Works, in at least one + of the following places: within a NOTICE text file distributed + as part of the Derivative Works; within the Source form or + documentation, if provided along with the Derivative Works; or, + within a display generated by the Derivative Works, if and + wherever such third-party notices normally appear. The contents + of the NOTICE file are for informational purposes only and + do not modify the License. You may add Your own attribution + notices within Derivative Works that You distribute, alongside + or as an addendum to the NOTICE text from the Work, provided + that such additional attribution notices cannot be construed + as modifying the License. + + You may add Your own copyright statement to Your modifications and + may provide additional or different license terms and conditions + for use, reproduction, or distribution of Your modifications, or + for any such Derivative Works as a whole, provided Your use, + reproduction, and distribution of the Work otherwise complies with + the conditions stated in this License. + + 5. Submission of Contributions. Unless You explicitly state otherwise, + any Contribution intentionally submitted for inclusion in the Work + by You to the Licensor shall be under the terms and conditions of + this License, without any additional terms or conditions. + Notwithstanding the above, nothing herein shall supersede or modify + the terms of any separate license agreement you may have executed + with Licensor regarding such Contributions. + + 6. Trademarks. This License does not grant permission to use the trade + names, trademarks, service marks, or product names of the Licensor, + except as required for reasonable and customary use in describing the + origin of the Work and reproducing the content of the NOTICE file. + + 7. Disclaimer of Warranty. Unless required by applicable law or + agreed to in writing, Licensor provides the Work (and each + Contributor provides its Contributions) on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or + implied, including, without limitation, any warranties or conditions + of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A + PARTICULAR PURPOSE. You are solely responsible for determining the + appropriateness of using or redistributing the Work and assume any + risks associated with Your exercise of permissions under this License. + + 8. Limitation of Liability. In no event and under no legal theory, + whether in tort (including negligence), contract, or otherwise, + unless required by applicable law (such as deliberate and grossly + negligent acts) or agreed to in writing, shall any Contributor be + liable to You for damages, including any direct, indirect, special, + incidental, or consequential damages of any character arising as a + result of this License or out of the use or inability to use the + Work (including but not limited to damages for loss of goodwill, + work stoppage, computer failure or malfunction, or any and all + other commercial damages or losses), even if such Contributor + has been advised of the possibility of such damages. + + 9. Accepting Warranty or Additional Liability. While redistributing + the Work or Derivative Works thereof, You may choose to offer, + and charge a fee for, acceptance of support, warranty, indemnity, + or other liability obligations and/or rights consistent with this + License. However, in accepting such obligations, You may act only + on Your own behalf and on Your sole responsibility, not on behalf + of any other Contributor, and only if You agree to indemnify, + defend, and hold each Contributor harmless for any liability + incurred by, or claims asserted against, such Contributor by reason + of your accepting any such warranty or additional liability. + + END OF TERMS AND CONDITIONS + + APPENDIX: How to apply the Apache License to your work. + + To apply the Apache License to your work, attach the following + boilerplate notice, with the fields enclosed by brackets "[]" + replaced with your own identifying information. (Don't include + the brackets!) The text should be enclosed in the appropriate + comment syntax for the file format. We also recommend that a + file or class name and description of purpose be included on the + same "printed page" as the copyright notice for easier + identification within third-party archives. + + Copyright [yyyy] [name of copyright owner] + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. diff --git a/owl-bot-staging/google-cloud-retail-v2/README.md b/owl-bot-staging/google-cloud-retail-v2/README.md new file mode 100644 index 000000000000..58694f8a7645 --- /dev/null +++ b/owl-bot-staging/google-cloud-retail-v2/README.md @@ -0,0 +1,154 @@ +# Ruby Client for the Retail V2 API + +Vertex AI Search for commerce API is made up of Retail Search, Browse and Recommendations. These discovery AI solutions help you implement personalized search, browse and recommendations, based on machine learning models, across your websites and mobile applications. + +Retail enables you to build an end-to-end personalized recommendation system based on state-of-the-art deep learning ML models, without a need for expertise in ML or recommendation systems. + +https://github.com/googleapis/google-cloud-ruby + +This gem is a _versioned_ client. It provides basic client classes for a +specific version of the Retail V2 API. Most users should consider using +the main client gem, +[google-cloud-retail](https://rubygems.org/gems/google-cloud-retail). +See the section below titled *Which client should I use?* for more information. + +## Installation + +``` +$ gem install google-cloud-retail-v2 +``` + +## Before You Begin + +In order to use this library, you first need to go through the following steps: + +1. [Select or create a Cloud Platform project.](https://console.cloud.google.com/project) +1. [Enable billing for your project.](https://cloud.google.com/billing/docs/how-to/modify-project#enable_billing_for_a_project) +1. [Enable the API.](https://console.cloud.google.com/apis/library/retail.googleapis.com) +1. [Set up authentication.](AUTHENTICATION.md) + +## Quick Start + +```ruby +require "google/cloud/retail/v2" + +client = ::Google::Cloud::Retail::V2::AnalyticsService::Client.new +request = ::Google::Cloud::Retail::V2::ExportAnalyticsMetricsRequest.new # (request fields as keyword arguments...) +response = client.export_analytics_metrics request +``` + +View the [Client Library Documentation](https://cloud.google.com/ruby/docs/reference/google-cloud-retail-v2/latest) +for class and method documentation. + +See also the [Product Documentation](https://cloud.google.com/retail/docs/apis) +for general usage information. + +## Debug Logging + +This library comes with opt-in Debug Logging that can help you troubleshoot +your application's integration with the API. When logging is activated, key +events such as requests and responses, along with data payloads and metadata +such as headers and client configuration, are logged to the standard error +stream. + +**WARNING:** Client Library Debug Logging includes your data payloads in +plaintext, which could include sensitive data such as PII for yourself or your +customers, private keys, or other security data that could be compromising if +leaked. Always practice good data hygiene with your application logs, and follow +the principle of least access. Google also recommends that Client Library Debug +Logging be enabled only temporarily during active debugging, and not used +permanently in production. + +To enable logging, set the environment variable `GOOGLE_SDK_RUBY_LOGGING_GEMS` +to the value `all`. Alternatively, you can set the value to a comma-delimited +list of client library gem names. This will select the default logging behavior, +which writes logs to the standard error stream. On a local workstation, this may +result in logs appearing on the console. When running on a Google Cloud hosting +service such as [Google Cloud Run](https://cloud.google.com/run), this generally +results in logs appearing alongside your application logs in the +[Google Cloud Logging](https://cloud.google.com/logging/) service. + +You can customize logging by modifying the `logger` configuration when +constructing a client object. For example: + +```ruby +require "google/cloud/retail/v2" +require "logger" + +client = ::Google::Cloud::Retail::V2::AnalyticsService::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-retail`, +and lower-level _versioned_ client libraries with names such as +`google-cloud-retail-v2`. +_In most cases, you should install the main client._ + +### What's the difference between the main client and a versioned client? + +A _versioned client_ provides a basic set of data types and client classes for +a _single version_ of a specific service. (That is, for a service with multiple +versions, there might be a separate versioned client for each service version.) +Most versioned clients are written and maintained by a code generator. + +The _main client_ is designed to provide you with the _recommended_ client +interfaces for the service. There will be only one main client for any given +service, even a service with multiple versions. The main client includes +factory methods for constructing the client objects we recommend for most +users. In some cases, those will be classes provided by an underlying versioned +client; in other cases, they will be handwritten higher-level client objects +with additional capabilities, convenience methods, or best practices built in. +Generally, the main client will default to a recommended service version, +although in some cases you can override this if you need to talk to a specific +service version. + +### Why would I want to use the main client? + +We recommend that most users install the main client gem for a service. You can +identify this gem as the one _without_ a version in its name, e.g. +`google-cloud-retail`. +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-retail-v2`. + +### What about the google-apis- clients? + +Client library gems with names that begin with `google-apis-` are based on an +older code generation technology. They talk to a REST/JSON backend (whereas +most modern clients talk to a [gRPC](https://grpc.io/) backend) and they may +not offer the same performance, features, and ease of use provided by more +modern clients. + +The `google-apis-` clients have wide coverage across Google services, so you +might need to use one if there is no modern client available for the service. +However, if a modern client is available, we generally recommend it over the +older `google-apis-` clients. diff --git a/owl-bot-staging/google-cloud-retail-v2/Rakefile b/owl-bot-staging/google-cloud-retail-v2/Rakefile new file mode 100644 index 000000000000..b4e6091ef9cd --- /dev/null +++ b/owl-bot-staging/google-cloud-retail-v2/Rakefile @@ -0,0 +1,169 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +require "bundler/setup" +require "bundler/gem_tasks" + +require "rubocop/rake_task" +RuboCop::RakeTask.new + +require "rake/testtask" +desc "Run tests." +Rake::TestTask.new do |t| + t.libs << "test" + t.test_files = FileList["test/**/*_test.rb"] + t.warning = false +end + +desc "Runs the smoke tests." +Rake::TestTask.new :smoke_test do |t| + t.test_files = FileList["acceptance/**/*smoke_test.rb"] + t.warning = false +end + +# Acceptance tests +desc "Run the google-cloud-retail-v2 acceptance tests." +task :acceptance, :project, :keyfile do |t, args| + project = args[:project] + project ||= + ENV["RETAIL_TEST_PROJECT"] || + ENV["GCLOUD_TEST_PROJECT"] + keyfile = args[:keyfile] + keyfile ||= + ENV["RETAIL_TEST_KEYFILE"] || + ENV["GCLOUD_TEST_KEYFILE"] + if keyfile + keyfile = File.read keyfile + else + keyfile ||= + ENV["RETAIL_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 RETAIL_TEST_PROJECT=test123 RETAIL_TEST_KEYFILE=/path/to/keyfile.json rake acceptance" + end + require "google/cloud/retail/v2/analytics_service/credentials" + ::Google::Cloud::Retail::V2::AnalyticsService::Credentials.env_vars.each do |path| + ENV[path] = nil + end + ENV["RETAIL_PROJECT"] = project + ENV["RETAIL_TEST_PROJECT"] = project + ENV["RETAIL_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-retail-v2 gem has no acceptance tests." + end + end + + desc "Run acceptance cleanup." + task :cleanup do + end +end + +task :samples do + Rake::Task["samples:latest"].invoke +end + +namespace :samples do + task :latest do + if File.directory? "samples" + Dir.chdir "samples" do + Bundler.with_clean_env do + ENV["GOOGLE_CLOUD_SAMPLES_TEST"] = "not_master" + sh "bundle update" + sh "bundle exec rake test" + end + end + else + puts "The google-cloud-retail-v2 gem has no samples to test." + end + end + + task :master do + if File.directory? "samples" + Dir.chdir "samples" do + Bundler.with_clean_env do + ENV["GOOGLE_CLOUD_SAMPLES_TEST"] = "master" + sh "bundle update" + sh "bundle exec rake test" + end + end + else + puts "The google-cloud-retail-v2 gem has no samples to test." + end + end +end + +require "yard" +require "yard/rake/yardoc_task" +YARD::Rake::YardocTask.new do |y| + y.options << "--fail-on-warning" +end + +desc "Run yard-doctest example tests." +task :doctest do + puts "The google-cloud-retail-v2 gem does not have doctest tests." +end + +desc "Run the CI build" +task :ci do + header "BUILDING google-cloud-retail-v2" + header "google-cloud-retail-v2 rubocop", "*" + Rake::Task[:rubocop].invoke + header "google-cloud-retail-v2 yard", "*" + Rake::Task[:yard].invoke + header "google-cloud-retail-v2 test", "*" + Rake::Task[:test].invoke +end + +namespace :ci do + desc "Run the CI build, with smoke tests." + task :smoke_test do + Rake::Task[:ci].invoke + header "google-cloud-retail-v2 smoke_test", "*" + Rake::Task[:smoke_test].invoke + end + desc "Run the CI build, with acceptance tests." + task :acceptance do + Rake::Task[:ci].invoke + header "google-cloud-retail-v2 acceptance", "*" + Rake::Task[:acceptance].invoke + end + task :a do + # This is a handy shortcut to save typing + Rake::Task["ci:acceptance"].invoke + end +end + +task default: :test + +def header str, token = "#" + line_length = str.length + 8 + puts "" + puts token * line_length + puts "#{token * 3} #{str} #{token * 3}" + puts token * line_length + puts "" +end diff --git a/owl-bot-staging/google-cloud-retail-v2/gapic_metadata.json b/owl-bot-staging/google-cloud-retail-v2/gapic_metadata.json new file mode 100644 index 000000000000..d2b8ccdd6732 --- /dev/null +++ b/owl-bot-staging/google-cloud-retail-v2/gapic_metadata.json @@ -0,0 +1,412 @@ +{ + "schema": "1.0", + "comment": "This file maps proto services/RPCs to the corresponding library clients/methods", + "language": "ruby", + "protoPackage": "google.cloud.retail.v2", + "libraryPackage": "::Google::Cloud::Retail::V2", + "services": { + "AnalyticsService": { + "clients": { + "grpc": { + "libraryClient": "::Google::Cloud::Retail::V2::AnalyticsService::Client", + "rpcs": { + "ExportAnalyticsMetrics": { + "methods": [ + "export_analytics_metrics" + ] + } + } + } + } + }, + "CatalogService": { + "clients": { + "grpc": { + "libraryClient": "::Google::Cloud::Retail::V2::CatalogService::Client", + "rpcs": { + "ListCatalogs": { + "methods": [ + "list_catalogs" + ] + }, + "UpdateCatalog": { + "methods": [ + "update_catalog" + ] + }, + "SetDefaultBranch": { + "methods": [ + "set_default_branch" + ] + }, + "GetDefaultBranch": { + "methods": [ + "get_default_branch" + ] + }, + "GetCompletionConfig": { + "methods": [ + "get_completion_config" + ] + }, + "UpdateCompletionConfig": { + "methods": [ + "update_completion_config" + ] + }, + "GetAttributesConfig": { + "methods": [ + "get_attributes_config" + ] + }, + "UpdateAttributesConfig": { + "methods": [ + "update_attributes_config" + ] + }, + "AddCatalogAttribute": { + "methods": [ + "add_catalog_attribute" + ] + }, + "RemoveCatalogAttribute": { + "methods": [ + "remove_catalog_attribute" + ] + }, + "ReplaceCatalogAttribute": { + "methods": [ + "replace_catalog_attribute" + ] + } + } + } + } + }, + "CompletionService": { + "clients": { + "grpc": { + "libraryClient": "::Google::Cloud::Retail::V2::CompletionService::Client", + "rpcs": { + "CompleteQuery": { + "methods": [ + "complete_query" + ] + }, + "ImportCompletionData": { + "methods": [ + "import_completion_data" + ] + } + } + } + } + }, + "ControlService": { + "clients": { + "grpc": { + "libraryClient": "::Google::Cloud::Retail::V2::ControlService::Client", + "rpcs": { + "CreateControl": { + "methods": [ + "create_control" + ] + }, + "DeleteControl": { + "methods": [ + "delete_control" + ] + }, + "UpdateControl": { + "methods": [ + "update_control" + ] + }, + "GetControl": { + "methods": [ + "get_control" + ] + }, + "ListControls": { + "methods": [ + "list_controls" + ] + } + } + } + } + }, + "SearchService": { + "clients": { + "grpc": { + "libraryClient": "::Google::Cloud::Retail::V2::SearchService::Client", + "rpcs": { + "Search": { + "methods": [ + "search" + ] + } + } + } + } + }, + "ConversationalSearchService": { + "clients": { + "grpc": { + "libraryClient": "::Google::Cloud::Retail::V2::ConversationalSearchService::Client", + "rpcs": { + "ConversationalSearch": { + "methods": [ + "conversational_search" + ] + } + } + } + } + }, + "GenerativeQuestionService": { + "clients": { + "grpc": { + "libraryClient": "::Google::Cloud::Retail::V2::GenerativeQuestionService::Client", + "rpcs": { + "UpdateGenerativeQuestionsFeatureConfig": { + "methods": [ + "update_generative_questions_feature_config" + ] + }, + "GetGenerativeQuestionsFeatureConfig": { + "methods": [ + "get_generative_questions_feature_config" + ] + }, + "ListGenerativeQuestionConfigs": { + "methods": [ + "list_generative_question_configs" + ] + }, + "UpdateGenerativeQuestionConfig": { + "methods": [ + "update_generative_question_config" + ] + }, + "BatchUpdateGenerativeQuestionConfigs": { + "methods": [ + "batch_update_generative_question_configs" + ] + } + } + } + } + }, + "ModelService": { + "clients": { + "grpc": { + "libraryClient": "::Google::Cloud::Retail::V2::ModelService::Client", + "rpcs": { + "CreateModel": { + "methods": [ + "create_model" + ] + }, + "GetModel": { + "methods": [ + "get_model" + ] + }, + "PauseModel": { + "methods": [ + "pause_model" + ] + }, + "ResumeModel": { + "methods": [ + "resume_model" + ] + }, + "DeleteModel": { + "methods": [ + "delete_model" + ] + }, + "ListModels": { + "methods": [ + "list_models" + ] + }, + "UpdateModel": { + "methods": [ + "update_model" + ] + }, + "TuneModel": { + "methods": [ + "tune_model" + ] + } + } + } + } + }, + "PredictionService": { + "clients": { + "grpc": { + "libraryClient": "::Google::Cloud::Retail::V2::PredictionService::Client", + "rpcs": { + "Predict": { + "methods": [ + "predict" + ] + } + } + } + } + }, + "ProductService": { + "clients": { + "grpc": { + "libraryClient": "::Google::Cloud::Retail::V2::ProductService::Client", + "rpcs": { + "CreateProduct": { + "methods": [ + "create_product" + ] + }, + "GetProduct": { + "methods": [ + "get_product" + ] + }, + "ListProducts": { + "methods": [ + "list_products" + ] + }, + "UpdateProduct": { + "methods": [ + "update_product" + ] + }, + "DeleteProduct": { + "methods": [ + "delete_product" + ] + }, + "PurgeProducts": { + "methods": [ + "purge_products" + ] + }, + "ImportProducts": { + "methods": [ + "import_products" + ] + }, + "SetInventory": { + "methods": [ + "set_inventory" + ] + }, + "AddFulfillmentPlaces": { + "methods": [ + "add_fulfillment_places" + ] + }, + "RemoveFulfillmentPlaces": { + "methods": [ + "remove_fulfillment_places" + ] + }, + "AddLocalInventories": { + "methods": [ + "add_local_inventories" + ] + }, + "RemoveLocalInventories": { + "methods": [ + "remove_local_inventories" + ] + } + } + } + } + }, + "ServingConfigService": { + "clients": { + "grpc": { + "libraryClient": "::Google::Cloud::Retail::V2::ServingConfigService::Client", + "rpcs": { + "CreateServingConfig": { + "methods": [ + "create_serving_config" + ] + }, + "DeleteServingConfig": { + "methods": [ + "delete_serving_config" + ] + }, + "UpdateServingConfig": { + "methods": [ + "update_serving_config" + ] + }, + "GetServingConfig": { + "methods": [ + "get_serving_config" + ] + }, + "ListServingConfigs": { + "methods": [ + "list_serving_configs" + ] + }, + "AddControl": { + "methods": [ + "add_control" + ] + }, + "RemoveControl": { + "methods": [ + "remove_control" + ] + } + } + } + } + }, + "UserEventService": { + "clients": { + "grpc": { + "libraryClient": "::Google::Cloud::Retail::V2::UserEventService::Client", + "rpcs": { + "WriteUserEvent": { + "methods": [ + "write_user_event" + ] + }, + "CollectUserEvent": { + "methods": [ + "collect_user_event" + ] + }, + "PurgeUserEvents": { + "methods": [ + "purge_user_events" + ] + }, + "ImportUserEvents": { + "methods": [ + "import_user_events" + ] + }, + "RejoinUserEvents": { + "methods": [ + "rejoin_user_events" + ] + } + } + } + } + } + } +} diff --git a/owl-bot-staging/google-cloud-retail-v2/google-cloud-retail-v2.gemspec b/owl-bot-staging/google-cloud-retail-v2/google-cloud-retail-v2.gemspec new file mode 100644 index 000000000000..215a2f8ac3e2 --- /dev/null +++ b/owl-bot-staging/google-cloud-retail-v2/google-cloud-retail-v2.gemspec @@ -0,0 +1,29 @@ +# -*- ruby -*- +# encoding: utf-8 + +require File.expand_path("lib/google/cloud/retail/v2/version", __dir__) + +Gem::Specification.new do |gem| + gem.name = "google-cloud-retail-v2" + gem.version = Google::Cloud::Retail::V2::VERSION + + gem.authors = ["Google LLC"] + gem.email = "googleapis-packages@google.com" + gem.description = "Retail enables you to build an end-to-end personalized recommendation system based on state-of-the-art deep learning ML models, without a need for expertise in ML or recommendation systems. Note that google-cloud-retail-v2 is a version-specific client library. For most uses, we recommend installing the main client library google-cloud-retail instead. See the readme for more details." + gem.summary = "Vertex AI Search for commerce API is made up of Retail Search, Browse and Recommendations. These discovery AI solutions help you implement personalized search, browse and recommendations, based on machine learning models, across your websites and mobile applications." + 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-cloud-retail-v2/lib/google-cloud-retail-v2.rb b/owl-bot-staging/google-cloud-retail-v2/lib/google-cloud-retail-v2.rb new file mode 100644 index 000000000000..45db4898f66c --- /dev/null +++ b/owl-bot-staging/google-cloud-retail-v2/lib/google-cloud-retail-v2.rb @@ -0,0 +1,21 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +# This gem does not autoload during Bundler.require. To load this gem, +# issue explicit require statements for the packages desired, e.g.: +# require "google/cloud/retail/v2" diff --git a/owl-bot-staging/google-cloud-retail-v2/lib/google/cloud/retail/v2.rb b/owl-bot-staging/google-cloud-retail-v2/lib/google/cloud/retail/v2.rb new file mode 100644 index 000000000000..4214f1307e58 --- /dev/null +++ b/owl-bot-staging/google-cloud-retail-v2/lib/google/cloud/retail/v2.rb @@ -0,0 +1,56 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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/retail/v2/analytics_service" +require "google/cloud/retail/v2/catalog_service" +require "google/cloud/retail/v2/completion_service" +require "google/cloud/retail/v2/control_service" +require "google/cloud/retail/v2/search_service" +require "google/cloud/retail/v2/conversational_search_service" +require "google/cloud/retail/v2/generative_question_service" +require "google/cloud/retail/v2/model_service" +require "google/cloud/retail/v2/prediction_service" +require "google/cloud/retail/v2/product_service" +require "google/cloud/retail/v2/serving_config_service" +require "google/cloud/retail/v2/user_event_service" +require "google/cloud/retail/v2/version" + +module Google + module Cloud + module Retail + ## + # API client module. + # + # @example Load this package, including all its services, and instantiate a gRPC client + # + # require "google/cloud/retail/v2" + # client = ::Google::Cloud::Retail::V2::AnalyticsService::Client.new + # + # @example Load this package, including all its services, and instantiate a REST client + # + # require "google/cloud/retail/v2" + # client = ::Google::Cloud::Retail::V2::AnalyticsService::Rest::Client.new + # + module V2 + end + end + end +end + +helper_path = ::File.join __dir__, "v2", "_helpers.rb" +require "google/cloud/retail/v2/_helpers" if ::File.file? helper_path diff --git a/owl-bot-staging/google-cloud-retail-v2/lib/google/cloud/retail/v2/analytics_service.rb b/owl-bot-staging/google-cloud-retail-v2/lib/google/cloud/retail/v2/analytics_service.rb new file mode 100644 index 000000000000..3eb7f4cce88a --- /dev/null +++ b/owl-bot-staging/google-cloud-retail-v2/lib/google/cloud/retail/v2/analytics_service.rb @@ -0,0 +1,56 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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/retail/v2/version" + +require "google/cloud/retail/v2/analytics_service/credentials" +require "google/cloud/retail/v2/analytics_service/operations" +require "google/cloud/retail/v2/analytics_service/client" +require "google/cloud/retail/v2/analytics_service/rest" + +module Google + module Cloud + module Retail + module V2 + ## + # Service for managing & accessing retail search business metric. + # Retail recommendation business metric is currently not available. + # + # @example Load this service and instantiate a gRPC client + # + # require "google/cloud/retail/v2/analytics_service" + # client = ::Google::Cloud::Retail::V2::AnalyticsService::Client.new + # + # @example Load this service and instantiate a REST client + # + # require "google/cloud/retail/v2/analytics_service/rest" + # client = ::Google::Cloud::Retail::V2::AnalyticsService::Rest::Client.new + # + module AnalyticsService + end + end + end + end +end + +helper_path = ::File.join __dir__, "analytics_service", "helpers.rb" +require "google/cloud/retail/v2/analytics_service/helpers" if ::File.file? helper_path diff --git a/owl-bot-staging/google-cloud-retail-v2/lib/google/cloud/retail/v2/analytics_service/client.rb b/owl-bot-staging/google-cloud-retail-v2/lib/google/cloud/retail/v2/analytics_service/client.rb new file mode 100644 index 000000000000..ab974412fd14 --- /dev/null +++ b/owl-bot-staging/google-cloud-retail-v2/lib/google/cloud/retail/v2/analytics_service/client.rb @@ -0,0 +1,541 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +require "google/cloud/errors" +require "google/cloud/retail/v2/analytics_service_pb" +require "google/cloud/location" + +module Google + module Cloud + module Retail + module V2 + module AnalyticsService + ## + # Client for the AnalyticsService service. + # + # Service for managing & accessing retail search business metric. + # Retail recommendation business metric is currently not available. + # + class Client + # @private + API_VERSION = "" + + # @private + DEFAULT_ENDPOINT_TEMPLATE = "retail.$UNIVERSE_DOMAIN$" + + # @private + attr_reader :analytics_service_stub + + ## + # Configure the AnalyticsService Client class. + # + # See {::Google::Cloud::Retail::V2::AnalyticsService::Client::Configuration} + # for a description of the configuration fields. + # + # @example + # + # # Modify the configuration for all AnalyticsService clients + # ::Google::Cloud::Retail::V2::AnalyticsService::Client.configure do |config| + # config.timeout = 10.0 + # end + # + # @yield [config] Configure the Client client. + # @yieldparam config [Client::Configuration] + # + # @return [Client::Configuration] + # + def self.configure + @configure ||= begin + namespace = ["Google", "Cloud", "Retail", "V2"] + parent_config = while namespace.any? + parent_name = namespace.join "::" + parent_const = const_get parent_name + break parent_const.configure if parent_const.respond_to? :configure + namespace.pop + end + default_config = Client::Configuration.new parent_config + + default_config.rpcs.export_analytics_metrics.timeout = 60.0 + default_config.rpcs.export_analytics_metrics.retry_policy = { + initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [14, 4] + } + + default_config + end + yield @configure if block_given? + @configure + end + + ## + # Configure the AnalyticsService Client instance. + # + # The configuration is set to the derived mode, meaning that values can be changed, + # but structural changes (adding new fields, etc.) are not allowed. Structural changes + # should be made on {Client.configure}. + # + # See {::Google::Cloud::Retail::V2::AnalyticsService::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 + @analytics_service_stub.universe_domain + end + + ## + # Create a new AnalyticsService client object. + # + # @example + # + # # Create a client using the default configuration + # client = ::Google::Cloud::Retail::V2::AnalyticsService::Client.new + # + # # Create a client using a custom configuration + # client = ::Google::Cloud::Retail::V2::AnalyticsService::Client.new do |config| + # config.timeout = 10.0 + # end + # + # @yield [config] Configure the AnalyticsService client. + # @yieldparam config [Client::Configuration] + # + def initialize + # These require statements are intentionally placed here to initialize + # the gRPC module only when it's required. + # See https://github.com/googleapis/toolkit/issues/446 + require "gapic/grpc" + require "google/cloud/retail/v2/analytics_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 + + @analytics_service_stub = ::Gapic::ServiceStub.new( + ::Google::Cloud::Retail::V2::AnalyticsService::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 + ) + + @analytics_service_stub.stub_logger&.info do |entry| + entry.set_system_name + entry.set_service + entry.message = "Created client for #{entry.service}" + entry.set_credentials_fields credentials + entry.set "customEndpoint", @config.endpoint if @config.endpoint + entry.set "defaultTimeout", @config.timeout if @config.timeout + entry.set "quotaProject", @quota_project_id if @quota_project_id + end + + @location_client = Google::Cloud::Location::Locations::Client.new do |config| + config.credentials = credentials + config.quota_project = @quota_project_id + config.endpoint = @analytics_service_stub.endpoint + config.universe_domain = @analytics_service_stub.universe_domain + config.logger = @analytics_service_stub.logger if config.respond_to? :logger= + end + end + + ## + # Get the associated client for long-running operations. + # + # @return [::Google::Cloud::Retail::V2::AnalyticsService::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 + @analytics_service_stub.logger + end + + # Service calls + + ## + # Exports analytics metrics. + # + # `Operation.response` is of type `ExportAnalyticsMetricsResponse`. + # `Operation.metadata` is of type `ExportMetadata`. + # + # @overload export_analytics_metrics(request, options = nil) + # Pass arguments to `export_analytics_metrics` via a request object, either of type + # {::Google::Cloud::Retail::V2::ExportAnalyticsMetricsRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Retail::V2::ExportAnalyticsMetricsRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. + # + # @overload export_analytics_metrics(catalog: nil, output_config: nil, filter: nil) + # Pass arguments to `export_analytics_metrics` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param catalog [::String] + # Required. Full resource name of the parent catalog. + # Expected format: `projects/*/locations/*/catalogs/*` + # @param output_config [::Google::Cloud::Retail::V2::OutputConfig, ::Hash] + # Required. The output location of the data. + # @param filter [::String] + # A filtering expression to specify restrictions on returned metrics. + # The expression is a sequence of terms. Each term applies a restriction to + # the returned metrics. Use this expression to restrict results to a + # specific time range. + # + # Currently we expect only one types of fields: + # + # * `timestamp`: This can be specified twice, once with a + # less than operator and once with a greater than operator. The + # `timestamp` restriction should result in one, contiguous, valid, + # `timestamp` range. + # + # Some examples of valid filters expressions: + # + # * Example 1: `timestamp > "2012-04-23T18:25:43.511Z" + # timestamp < "2012-04-23T18:30:43.511Z"` + # * Example 2: `timestamp > "2012-04-23T18:25:43.511Z"` + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Gapic::Operation] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Gapic::Operation] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/retail/v2" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Retail::V2::AnalyticsService::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Retail::V2::ExportAnalyticsMetricsRequest.new + # + # # Call the export_analytics_metrics method. + # result = client.export_analytics_metrics 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 export_analytics_metrics request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Retail::V2::ExportAnalyticsMetricsRequest + + # Converts hash 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.export_analytics_metrics.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::Retail::V2::VERSION + metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.catalog + header_params["catalog"] = request.catalog + 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.export_analytics_metrics.timeout, + metadata: metadata, + retry_policy: @config.rpcs.export_analytics_metrics.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @analytics_service_stub.call_rpc :export_analytics_metrics, 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 AnalyticsService API. + # + # This class represents the configuration for AnalyticsService, + # providing control over timeouts, retry behavior, logging, transport + # parameters, and other low-level controls. Certain parameters can also be + # applied individually to specific RPCs. See + # {::Google::Cloud::Retail::V2::AnalyticsService::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 + # # export_analytics_metrics to 20 seconds, + # # and all remaining timeouts to 10 seconds. + # ::Google::Cloud::Retail::V2::AnalyticsService::Client.configure do |config| + # config.timeout = 10.0 + # config.rpcs.export_analytics_metrics.timeout = 20.0 + # end + # + # # Apply the above configuration only to a new client. + # client = ::Google::Cloud::Retail::V2::AnalyticsService::Client.new do |config| + # config.timeout = 10.0 + # config.rpcs.export_analytics_metrics.timeout = 20.0 + # end + # + # @!attribute [rw] endpoint + # A custom service endpoint, as a hostname or hostname:port. The default is + # nil, indicating to use the default endpoint in the current universe domain. + # @return [::String,nil] + # @!attribute [rw] credentials + # Credentials to send with calls. You may provide any of the following types: + # * (`Google::Auth::Credentials`) A googleauth credentials object + # (see the [googleauth docs](https://rubydoc.info/gems/googleauth/Google/Auth/Credentials)) + # * (`Signet::OAuth2::Client`) A signet oauth2 client object + # (see the [signet docs](https://rubydoc.info/gems/signet/Signet/OAuth2/Client)) + # * (`GRPC::Core::Channel`) a gRPC channel with included credentials + # * (`GRPC::Core::ChannelCredentials`) a gRPC credentails object + # * (`nil`) indicating no credentials + # + # @note Warning: Passing a `String` to a keyfile path or a `Hash` of credentials + # is deprecated. Providing an unvalidated credential configuration to + # Google APIs can compromise the security of your systems and data. + # + # @example + # + # # The recommended way to provide credentials is to use the `make_creds` method + # # on the appropriate credentials class for your environment. + # + # require "googleauth" + # + # credentials = ::Google::Auth::ServiceAccountCredentials.make_creds( + # json_key_io: ::File.open("/path/to/keyfile.json") + # ) + # + # client = ::Google::Cloud::Retail::V2::AnalyticsService::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 = "retail.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 AnalyticsService 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 `export_analytics_metrics` + # @return [::Gapic::Config::Method] + # + attr_reader :export_analytics_metrics + + # @private + def initialize parent_rpcs = nil + export_analytics_metrics_config = parent_rpcs.export_analytics_metrics if parent_rpcs.respond_to? :export_analytics_metrics + @export_analytics_metrics = ::Gapic::Config::Method.new export_analytics_metrics_config + + yield self if block_given? + end + end + end + end + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-retail-v2/lib/google/cloud/retail/v2/analytics_service/credentials.rb b/owl-bot-staging/google-cloud-retail-v2/lib/google/cloud/retail/v2/analytics_service/credentials.rb new file mode 100644 index 000000000000..89a3470cd910 --- /dev/null +++ b/owl-bot-staging/google-cloud-retail-v2/lib/google/cloud/retail/v2/analytics_service/credentials.rb @@ -0,0 +1,51 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +require "googleauth" + +module Google + module Cloud + module Retail + module V2 + module AnalyticsService + # Credentials for the AnalyticsService API. + class Credentials < ::Google::Auth::Credentials + self.scope = [ + "https://www.googleapis.com/auth/cloud-platform" + ] + self.env_vars = [ + "RETAIL_CREDENTIALS", + "RETAIL_KEYFILE", + "GOOGLE_CLOUD_CREDENTIALS", + "GOOGLE_CLOUD_KEYFILE", + "GCLOUD_KEYFILE", + "RETAIL_CREDENTIALS_JSON", + "RETAIL_KEYFILE_JSON", + "GOOGLE_CLOUD_CREDENTIALS_JSON", + "GOOGLE_CLOUD_KEYFILE_JSON", + "GCLOUD_KEYFILE_JSON" + ] + self.paths = [ + "~/.config/google_cloud/application_default_credentials.json" + ] + end + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-retail-v2/lib/google/cloud/retail/v2/analytics_service/operations.rb b/owl-bot-staging/google-cloud-retail-v2/lib/google/cloud/retail/v2/analytics_service/operations.rb new file mode 100644 index 000000000000..0eb1403cc2f0 --- /dev/null +++ b/owl-bot-staging/google-cloud-retail-v2/lib/google/cloud/retail/v2/analytics_service/operations.rb @@ -0,0 +1,841 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +require "gapic/operation" +require "google/longrunning/operations_pb" + +module Google + module Cloud + module Retail + module V2 + module AnalyticsService + # Service that implements Longrunning Operations API. + class Operations + # @private + API_VERSION = "" + + # @private + DEFAULT_ENDPOINT_TEMPLATE = "retail.$UNIVERSE_DOMAIN$" + + # @private + attr_reader :operations_stub + + ## + # Configuration for the AnalyticsService 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 AnalyticsService 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::Retail::V2::VERSION + metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.name + header_params["name"] = request.name + end + + request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") + metadata[:"x-goog-request-params"] ||= request_params_header + + options.apply_defaults timeout: @config.rpcs.list_operations.timeout, + metadata: metadata, + retry_policy: @config.rpcs.list_operations.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @operations_stub.call_rpc :list_operations, request, options: options do |response, operation| + wrap_lro_operation = ->(op_response) { ::Gapic::Operation.new op_response, @operations_client } + response = ::Gapic::PagedEnumerable.new @operations_stub, :list_operations, request, response, operation, options, format_resource: wrap_lro_operation + yield response, operation if block_given? + throw :response, response + end + rescue ::GRPC::BadStatus => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Gets the latest state of a long-running operation. Clients can use this + # method to poll the operation result at intervals as recommended by the API + # service. + # + # @overload get_operation(request, options = nil) + # Pass arguments to `get_operation` via a request object, either of type + # {::Google::Longrunning::GetOperationRequest} or an equivalent Hash. + # + # @param request [::Google::Longrunning::GetOperationRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. + # + # @overload get_operation(name: nil) + # Pass arguments to `get_operation` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param name [::String] + # The name of the operation resource. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Gapic::Operation] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Gapic::Operation] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/longrunning" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Longrunning::Operations::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Longrunning::GetOperationRequest.new + # + # # Call the get_operation method. + # result = client.get_operation request + # + # # The returned object is of type Gapic::Operation. You can use it to + # # check the status of an operation, cancel it, or wait for results. + # # Here is how to wait for a response. + # result.wait_until_done! timeout: 60 + # if result.response? + # p result.response + # else + # puts "No response received." + # end + # + def get_operation request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Longrunning::GetOperationRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + metadata = @config.rpcs.get_operation.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::Retail::V2::VERSION + metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.name + header_params["name"] = request.name + end + + request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") + metadata[:"x-goog-request-params"] ||= request_params_header + + options.apply_defaults timeout: @config.rpcs.get_operation.timeout, + metadata: metadata, + retry_policy: @config.rpcs.get_operation.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @operations_stub.call_rpc :get_operation, request, options: options do |response, operation| + response = ::Gapic::Operation.new response, @operations_client, options: options + yield response, operation if block_given? + throw :response, response + end + rescue ::GRPC::BadStatus => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Deletes a long-running operation. This method indicates that the client is + # no longer interested in the operation result. It does not cancel the + # operation. If the server doesn't support this method, it returns + # `google.rpc.Code.UNIMPLEMENTED`. + # + # @overload delete_operation(request, options = nil) + # Pass arguments to `delete_operation` via a request object, either of type + # {::Google::Longrunning::DeleteOperationRequest} or an equivalent Hash. + # + # @param request [::Google::Longrunning::DeleteOperationRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. + # + # @overload delete_operation(name: nil) + # Pass arguments to `delete_operation` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param name [::String] + # The name of the operation resource to be deleted. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Google::Protobuf::Empty] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Google::Protobuf::Empty] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/longrunning" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Longrunning::Operations::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Longrunning::DeleteOperationRequest.new + # + # # Call the delete_operation method. + # result = client.delete_operation request + # + # # The returned object is of type Google::Protobuf::Empty. + # p result + # + def delete_operation request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Longrunning::DeleteOperationRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + metadata = @config.rpcs.delete_operation.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::Retail::V2::VERSION + metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.name + header_params["name"] = request.name + end + + request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") + metadata[:"x-goog-request-params"] ||= request_params_header + + options.apply_defaults timeout: @config.rpcs.delete_operation.timeout, + metadata: metadata, + retry_policy: @config.rpcs.delete_operation.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @operations_stub.call_rpc :delete_operation, request, options: options do |response, operation| + yield response, operation if block_given? + end + rescue ::GRPC::BadStatus => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Starts asynchronous cancellation on a long-running operation. The server + # makes a best effort to cancel the operation, but success is not + # guaranteed. If the server doesn't support this method, it returns + # `google.rpc.Code.UNIMPLEMENTED`. Clients can use + # Operations.GetOperation or + # other methods to check whether the cancellation succeeded or whether the + # operation completed despite cancellation. On successful cancellation, + # the operation is not deleted; instead, it becomes an operation with + # an {::Google::Longrunning::Operation#error Operation.error} value with a + # {::Google::Rpc::Status#code google.rpc.Status.code} of `1`, corresponding to + # `Code.CANCELLED`. + # + # @overload cancel_operation(request, options = nil) + # Pass arguments to `cancel_operation` via a request object, either of type + # {::Google::Longrunning::CancelOperationRequest} or an equivalent Hash. + # + # @param request [::Google::Longrunning::CancelOperationRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. + # + # @overload cancel_operation(name: nil) + # Pass arguments to `cancel_operation` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param name [::String] + # The name of the operation resource to be cancelled. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Google::Protobuf::Empty] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Google::Protobuf::Empty] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/longrunning" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Longrunning::Operations::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Longrunning::CancelOperationRequest.new + # + # # Call the cancel_operation method. + # result = client.cancel_operation request + # + # # The returned object is of type Google::Protobuf::Empty. + # p result + # + def cancel_operation request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Longrunning::CancelOperationRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + metadata = @config.rpcs.cancel_operation.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::Retail::V2::VERSION + metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.name + header_params["name"] = request.name + end + + request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") + metadata[:"x-goog-request-params"] ||= request_params_header + + options.apply_defaults timeout: @config.rpcs.cancel_operation.timeout, + metadata: metadata, + retry_policy: @config.rpcs.cancel_operation.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @operations_stub.call_rpc :cancel_operation, request, options: options do |response, operation| + yield response, operation if block_given? + end + rescue ::GRPC::BadStatus => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Waits until the specified long-running operation is done or reaches at most + # a specified timeout, returning the latest state. If the operation is + # already done, the latest state is immediately returned. If the timeout + # specified is greater than the default HTTP/RPC timeout, the HTTP/RPC + # timeout is used. If the server does not support this method, it returns + # `google.rpc.Code.UNIMPLEMENTED`. + # Note that this method is on a best-effort basis. It may return the latest + # state before the specified timeout (including immediately), meaning even an + # immediate response is no guarantee that the operation is done. + # + # @overload wait_operation(request, options = nil) + # Pass arguments to `wait_operation` via a request object, either of type + # {::Google::Longrunning::WaitOperationRequest} or an equivalent Hash. + # + # @param request [::Google::Longrunning::WaitOperationRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. + # + # @overload wait_operation(name: nil, timeout: nil) + # Pass arguments to `wait_operation` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param name [::String] + # The name of the operation resource to wait on. + # @param timeout [::Google::Protobuf::Duration, ::Hash] + # The maximum duration to wait before timing out. If left blank, the wait + # will be at most the time permitted by the underlying HTTP/RPC protocol. + # If RPC context deadline is also specified, the shorter one will be used. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Gapic::Operation] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Gapic::Operation] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/longrunning" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Longrunning::Operations::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Longrunning::WaitOperationRequest.new + # + # # Call the wait_operation method. + # result = client.wait_operation request + # + # # The returned object is of type Gapic::Operation. You can use it to + # # check the status of an operation, cancel it, or wait for results. + # # Here is how to wait for a response. + # result.wait_until_done! timeout: 60 + # if result.response? + # p result.response + # else + # puts "No response received." + # end + # + def wait_operation request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Longrunning::WaitOperationRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + metadata = @config.rpcs.wait_operation.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::Retail::V2::VERSION + metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + options.apply_defaults timeout: @config.rpcs.wait_operation.timeout, + metadata: metadata, + retry_policy: @config.rpcs.wait_operation.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @operations_stub.call_rpc :wait_operation, request, options: options do |response, operation| + response = ::Gapic::Operation.new response, @operations_client, options: options + yield response, operation if block_given? + throw :response, response + end + rescue ::GRPC::BadStatus => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Configuration class for the Operations API. + # + # This class represents the configuration for Operations, + # providing control over timeouts, retry behavior, logging, transport + # parameters, and other low-level controls. Certain parameters can also be + # applied individually to specific RPCs. See + # {::Google::Longrunning::Operations::Client::Configuration::Rpcs} + # for a list of RPCs that can be configured independently. + # + # Configuration can be applied globally to all clients, or to a single client + # on construction. + # + # @example + # + # # Modify the global config, setting the timeout for + # # list_operations to 20 seconds, + # # and all remaining timeouts to 10 seconds. + # ::Google::Longrunning::Operations::Client.configure do |config| + # config.timeout = 10.0 + # config.rpcs.list_operations.timeout = 20.0 + # end + # + # # Apply the above configuration only to a new client. + # client = ::Google::Longrunning::Operations::Client.new do |config| + # config.timeout = 10.0 + # config.rpcs.list_operations.timeout = 20.0 + # end + # + # @!attribute [rw] endpoint + # A custom service endpoint, as a hostname or hostname:port. The default is + # nil, indicating to use the default endpoint in the current universe domain. + # @return [::String,nil] + # @!attribute [rw] credentials + # Credentials to send with calls. You may provide any of the following types: + # * (`Google::Auth::Credentials`) A googleauth credentials object + # (see the [googleauth docs](https://rubydoc.info/gems/googleauth/Google/Auth/Credentials)) + # * (`Signet::OAuth2::Client`) A signet oauth2 client object + # (see the [signet docs](https://rubydoc.info/gems/signet/Signet/OAuth2/Client)) + # * (`GRPC::Core::Channel`) a gRPC channel with included credentials + # * (`GRPC::Core::ChannelCredentials`) a gRPC credentails object + # * (`nil`) indicating no credentials + # + # @note Warning: Passing a `String` to a keyfile path or a `Hash` of credentials + # is deprecated. Providing an unvalidated credential configuration to + # Google APIs can compromise the security of your systems and data. + # + # @example + # + # # The recommended way to provide credentials is to use the `make_creds` method + # # on the appropriate credentials class for your environment. + # + # require "googleauth" + # + # credentials = ::Google::Auth::ServiceAccountCredentials.make_creds( + # json_key_io: ::File.open("/path/to/keyfile.json") + # ) + # + # client = ::Google::Longrunning::Operations::Client.new do |config| + # config.credentials = credentials + # end + # + # @note Warning: If you accept a credential configuration (JSON file or Hash) from an + # external source for authentication to Google Cloud, you must validate it before + # providing it to a Google API client library. Providing an unvalidated credential + # configuration to Google APIs can compromise the security of your systems and data. + # For more information, refer to [Validate credential configurations from external + # sources](https://cloud.google.com/docs/authentication/external/externally-sourced-credentials). + # @return [::Object] + # @!attribute [rw] scope + # The OAuth scopes + # @return [::Array<::String>] + # @!attribute [rw] lib_name + # The library name as recorded in instrumentation and logging + # @return [::String] + # @!attribute [rw] lib_version + # The library version as recorded in instrumentation and logging + # @return [::String] + # @!attribute [rw] channel_args + # Extra parameters passed to the gRPC channel. Note: this is ignored if a + # `GRPC::Core::Channel` object is provided as the credential. + # @return [::Hash] + # @!attribute [rw] interceptors + # An array of interceptors that are run before calls are executed. + # @return [::Array<::GRPC::ClientInterceptor>] + # @!attribute [rw] timeout + # The call timeout in seconds. + # @return [::Numeric] + # @!attribute [rw] metadata + # Additional gRPC headers to be sent with the call. + # @return [::Hash{::Symbol=>::String}] + # @!attribute [rw] retry_policy + # The retry policy. The value is a hash with the following keys: + # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds. + # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds. + # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier. + # * `:retry_codes` (*type:* `Array`) - The error codes that should + # trigger a retry. + # @return [::Hash] + # @!attribute [rw] quota_project + # A separate project against which to charge quota. + # @return [::String] + # @!attribute [rw] universe_domain + # The universe domain within which to make requests. This determines the + # default endpoint URL. The default value of nil uses the environment + # universe (usually the default "googleapis.com" universe). + # @return [::String,nil] + # @!attribute [rw] logger + # A custom logger to use for request/response debug logging, or the value + # `:default` (the default) to construct a default logger, or `nil` to + # explicitly disable logging. + # @return [::Logger,:default,nil] + # + class Configuration + extend ::Gapic::Config + + # @private + # The endpoint specific to the default "googleapis.com" universe. Deprecated. + DEFAULT_ENDPOINT = "retail.googleapis.com" + + config_attr :endpoint, nil, ::String, nil + config_attr :credentials, nil do |value| + allowed = [::String, ::Hash, ::Proc, ::Symbol, ::Google::Auth::Credentials, ::Google::Auth::BaseClient, ::Signet::OAuth2::Client, nil] + allowed += [::GRPC::Core::Channel, ::GRPC::Core::ChannelCredentials] if defined? ::GRPC::Core::Channel + allowed.any? { |klass| klass === value } + end + config_attr :scope, nil, ::String, ::Array, nil + config_attr :lib_name, nil, ::String, nil + config_attr :lib_version, nil, ::String, nil + config_attr(:channel_args, { "grpc.service_config_disable_resolution" => 1 }, ::Hash, nil) + config_attr :interceptors, nil, ::Array, nil + config_attr :timeout, nil, ::Numeric, nil + config_attr :metadata, nil, ::Hash, nil + config_attr :retry_policy, nil, ::Hash, ::Proc, nil + config_attr :quota_project, nil, ::String, nil + config_attr :universe_domain, nil, ::String, nil + config_attr :logger, :default, ::Logger, nil, :default + + # @private + def initialize parent_config = nil + @parent_config = parent_config unless parent_config.nil? + + yield self if block_given? + end + + ## + # Configurations for individual RPCs + # @return [Rpcs] + # + def rpcs + @rpcs ||= begin + parent_rpcs = nil + parent_rpcs = @parent_config.rpcs if defined?(@parent_config) && @parent_config.respond_to?(:rpcs) + Rpcs.new parent_rpcs + end + end + + ## + # Configuration for the channel pool + # @return [::Gapic::ServiceStub::ChannelPool::Configuration] + # + def channel_pool + @channel_pool ||= ::Gapic::ServiceStub::ChannelPool::Configuration.new + end + + ## + # Configuration RPC class for the Operations API. + # + # Includes fields providing the configuration for each RPC in this service. + # Each configuration object is of type `Gapic::Config::Method` and includes + # the following configuration fields: + # + # * `timeout` (*type:* `Numeric`) - The call timeout in seconds + # * `metadata` (*type:* `Hash{Symbol=>String}`) - Additional gRPC headers + # * `retry_policy (*type:* `Hash`) - The retry policy. The policy fields + # include the following keys: + # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds. + # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds. + # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier. + # * `:retry_codes` (*type:* `Array`) - The error codes that should + # trigger a retry. + # + class Rpcs + ## + # RPC-specific configuration for `list_operations` + # @return [::Gapic::Config::Method] + # + attr_reader :list_operations + ## + # RPC-specific configuration for `get_operation` + # @return [::Gapic::Config::Method] + # + attr_reader :get_operation + ## + # RPC-specific configuration for `delete_operation` + # @return [::Gapic::Config::Method] + # + attr_reader :delete_operation + ## + # RPC-specific configuration for `cancel_operation` + # @return [::Gapic::Config::Method] + # + attr_reader :cancel_operation + ## + # RPC-specific configuration for `wait_operation` + # @return [::Gapic::Config::Method] + # + attr_reader :wait_operation + + # @private + def initialize parent_rpcs = nil + list_operations_config = parent_rpcs.list_operations if parent_rpcs.respond_to? :list_operations + @list_operations = ::Gapic::Config::Method.new list_operations_config + get_operation_config = parent_rpcs.get_operation if parent_rpcs.respond_to? :get_operation + @get_operation = ::Gapic::Config::Method.new get_operation_config + delete_operation_config = parent_rpcs.delete_operation if parent_rpcs.respond_to? :delete_operation + @delete_operation = ::Gapic::Config::Method.new delete_operation_config + cancel_operation_config = parent_rpcs.cancel_operation if parent_rpcs.respond_to? :cancel_operation + @cancel_operation = ::Gapic::Config::Method.new cancel_operation_config + wait_operation_config = parent_rpcs.wait_operation if parent_rpcs.respond_to? :wait_operation + @wait_operation = ::Gapic::Config::Method.new wait_operation_config + + yield self if block_given? + end + end + end + end + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-retail-v2/lib/google/cloud/retail/v2/analytics_service/rest.rb b/owl-bot-staging/google-cloud-retail-v2/lib/google/cloud/retail/v2/analytics_service/rest.rb new file mode 100644 index 000000000000..df3ab00fece5 --- /dev/null +++ b/owl-bot-staging/google-cloud-retail-v2/lib/google/cloud/retail/v2/analytics_service/rest.rb @@ -0,0 +1,53 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +require "gapic/rest" +require "gapic/config" +require "gapic/config/method" + +require "google/cloud/retail/v2/version" + +require "google/cloud/retail/v2/analytics_service/credentials" +require "google/cloud/retail/v2/analytics_service/rest/operations" +require "google/cloud/retail/v2/analytics_service/rest/client" + +module Google + module Cloud + module Retail + module V2 + ## + # Service for managing & accessing retail search business metric. + # Retail recommendation business metric is currently not available. + # + # To load this service and instantiate a REST client: + # + # require "google/cloud/retail/v2/analytics_service/rest" + # client = ::Google::Cloud::Retail::V2::AnalyticsService::Rest::Client.new + # + module AnalyticsService + # Client for the REST transport + module Rest + end + end + end + end + end +end + +helper_path = ::File.join __dir__, "rest", "helpers.rb" +require "google/cloud/retail/v2/analytics_service/rest/helpers" if ::File.file? helper_path diff --git a/owl-bot-staging/google-cloud-retail-v2/lib/google/cloud/retail/v2/analytics_service/rest/client.rb b/owl-bot-staging/google-cloud-retail-v2/lib/google/cloud/retail/v2/analytics_service/rest/client.rb new file mode 100644 index 000000000000..ecfefea1a530 --- /dev/null +++ b/owl-bot-staging/google-cloud-retail-v2/lib/google/cloud/retail/v2/analytics_service/rest/client.rb @@ -0,0 +1,491 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +require "google/cloud/errors" +require "google/cloud/retail/v2/analytics_service_pb" +require "google/cloud/retail/v2/analytics_service/rest/service_stub" +require "google/cloud/location/rest" + +module Google + module Cloud + module Retail + module V2 + module AnalyticsService + module Rest + ## + # REST client for the AnalyticsService service. + # + # Service for managing & accessing retail search business metric. + # Retail recommendation business metric is currently not available. + # + class Client + # @private + API_VERSION = "" + + # @private + DEFAULT_ENDPOINT_TEMPLATE = "retail.$UNIVERSE_DOMAIN$" + + # @private + attr_reader :analytics_service_stub + + ## + # Configure the AnalyticsService Client class. + # + # See {::Google::Cloud::Retail::V2::AnalyticsService::Rest::Client::Configuration} + # for a description of the configuration fields. + # + # @example + # + # # Modify the configuration for all AnalyticsService clients + # ::Google::Cloud::Retail::V2::AnalyticsService::Rest::Client.configure do |config| + # config.timeout = 10.0 + # end + # + # @yield [config] Configure the Client client. + # @yieldparam config [Client::Configuration] + # + # @return [Client::Configuration] + # + def self.configure + @configure ||= begin + namespace = ["Google", "Cloud", "Retail", "V2"] + parent_config = while namespace.any? + parent_name = namespace.join "::" + parent_const = const_get parent_name + break parent_const.configure if parent_const.respond_to? :configure + namespace.pop + end + default_config = Client::Configuration.new parent_config + + default_config.rpcs.export_analytics_metrics.timeout = 60.0 + default_config.rpcs.export_analytics_metrics.retry_policy = { + initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [14, 4] + } + + default_config + end + yield @configure if block_given? + @configure + end + + ## + # Configure the AnalyticsService Client instance. + # + # The configuration is set to the derived mode, meaning that values can be changed, + # but structural changes (adding new fields, etc.) are not allowed. Structural changes + # should be made on {Client.configure}. + # + # See {::Google::Cloud::Retail::V2::AnalyticsService::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 + @analytics_service_stub.universe_domain + end + + ## + # Create a new AnalyticsService REST client object. + # + # @example + # + # # Create a client using the default configuration + # client = ::Google::Cloud::Retail::V2::AnalyticsService::Rest::Client.new + # + # # Create a client using a custom configuration + # client = ::Google::Cloud::Retail::V2::AnalyticsService::Rest::Client.new do |config| + # config.timeout = 10.0 + # end + # + # @yield [config] Configure the AnalyticsService client. + # @yieldparam config [Client::Configuration] + # + def initialize + # Create the configuration object + @config = Configuration.new Client.configure + + # Yield the configuration if needed + yield @config if block_given? + + # Create credentials + credentials = @config.credentials + # Use self-signed JWT if the endpoint is unchanged from default, + # but only if the default endpoint does not have a region prefix. + enable_self_signed_jwt = @config.endpoint.nil? || + (@config.endpoint == Configuration::DEFAULT_ENDPOINT && + !@config.endpoint.split(".").first.include?("-")) + credentials ||= Credentials.default scope: @config.scope, + enable_self_signed_jwt: enable_self_signed_jwt + if credentials.is_a?(::String) || credentials.is_a?(::Hash) + credentials = Credentials.new credentials, scope: @config.scope + end + + @quota_project_id = @config.quota_project + @quota_project_id ||= credentials.quota_project_id if credentials.respond_to? :quota_project_id + + @operations_client = ::Google::Cloud::Retail::V2::AnalyticsService::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 + + @analytics_service_stub = ::Google::Cloud::Retail::V2::AnalyticsService::Rest::ServiceStub.new( + endpoint: @config.endpoint, + endpoint_template: DEFAULT_ENDPOINT_TEMPLATE, + universe_domain: @config.universe_domain, + credentials: credentials, + logger: @config.logger + ) + + @analytics_service_stub.logger(stub: true)&.info do |entry| + entry.set_system_name + entry.set_service + entry.message = "Created client for #{entry.service}" + entry.set_credentials_fields credentials + entry.set "customEndpoint", @config.endpoint if @config.endpoint + entry.set "defaultTimeout", @config.timeout if @config.timeout + entry.set "quotaProject", @quota_project_id if @quota_project_id + end + + @location_client = Google::Cloud::Location::Locations::Rest::Client.new do |config| + config.credentials = credentials + config.quota_project = @quota_project_id + config.endpoint = @analytics_service_stub.endpoint + config.universe_domain = @analytics_service_stub.universe_domain + config.logger = @analytics_service_stub.logger if config.respond_to? :logger= + end + end + + ## + # Get the associated client for long-running operations. + # + # @return [::Google::Cloud::Retail::V2::AnalyticsService::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 + @analytics_service_stub.logger + end + + # Service calls + + ## + # Exports analytics metrics. + # + # `Operation.response` is of type `ExportAnalyticsMetricsResponse`. + # `Operation.metadata` is of type `ExportMetadata`. + # + # @overload export_analytics_metrics(request, options = nil) + # Pass arguments to `export_analytics_metrics` via a request object, either of type + # {::Google::Cloud::Retail::V2::ExportAnalyticsMetricsRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Retail::V2::ExportAnalyticsMetricsRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @overload export_analytics_metrics(catalog: nil, output_config: nil, filter: nil) + # Pass arguments to `export_analytics_metrics` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param catalog [::String] + # Required. Full resource name of the parent catalog. + # Expected format: `projects/*/locations/*/catalogs/*` + # @param output_config [::Google::Cloud::Retail::V2::OutputConfig, ::Hash] + # Required. The output location of the data. + # @param filter [::String] + # A filtering expression to specify restrictions on returned metrics. + # The expression is a sequence of terms. Each term applies a restriction to + # the returned metrics. Use this expression to restrict results to a + # specific time range. + # + # Currently we expect only one types of fields: + # + # * `timestamp`: This can be specified twice, once with a + # less than operator and once with a greater than operator. The + # `timestamp` restriction should result in one, contiguous, valid, + # `timestamp` range. + # + # Some examples of valid filters expressions: + # + # * Example 1: `timestamp > "2012-04-23T18:25:43.511Z" + # timestamp < "2012-04-23T18:30:43.511Z"` + # * Example 2: `timestamp > "2012-04-23T18:25:43.511Z"` + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Gapic::Operation] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Gapic::Operation] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/retail/v2" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Retail::V2::AnalyticsService::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Retail::V2::ExportAnalyticsMetricsRequest.new + # + # # Call the export_analytics_metrics method. + # result = client.export_analytics_metrics 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 export_analytics_metrics request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Retail::V2::ExportAnalyticsMetricsRequest + + # Converts hash 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.export_analytics_metrics.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::Retail::V2::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + options.apply_defaults timeout: @config.rpcs.export_analytics_metrics.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.export_analytics_metrics.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @analytics_service_stub.export_analytics_metrics 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 + + ## + # Configuration class for the AnalyticsService REST API. + # + # This class represents the configuration for AnalyticsService REST, + # providing control over timeouts, retry behavior, logging, transport + # parameters, and other low-level controls. Certain parameters can also be + # applied individually to specific RPCs. See + # {::Google::Cloud::Retail::V2::AnalyticsService::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 + # # export_analytics_metrics to 20 seconds, + # # and all remaining timeouts to 10 seconds. + # ::Google::Cloud::Retail::V2::AnalyticsService::Rest::Client.configure do |config| + # config.timeout = 10.0 + # config.rpcs.export_analytics_metrics.timeout = 20.0 + # end + # + # # Apply the above configuration only to a new client. + # client = ::Google::Cloud::Retail::V2::AnalyticsService::Rest::Client.new do |config| + # config.timeout = 10.0 + # config.rpcs.export_analytics_metrics.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 = "retail.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 AnalyticsService 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 `export_analytics_metrics` + # @return [::Gapic::Config::Method] + # + attr_reader :export_analytics_metrics + + # @private + def initialize parent_rpcs = nil + export_analytics_metrics_config = parent_rpcs.export_analytics_metrics if parent_rpcs.respond_to? :export_analytics_metrics + @export_analytics_metrics = ::Gapic::Config::Method.new export_analytics_metrics_config + + yield self if block_given? + end + end + end + end + end + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-retail-v2/lib/google/cloud/retail/v2/analytics_service/rest/operations.rb b/owl-bot-staging/google-cloud-retail-v2/lib/google/cloud/retail/v2/analytics_service/rest/operations.rb new file mode 100644 index 000000000000..90ab3b1baaba --- /dev/null +++ b/owl-bot-staging/google-cloud-retail-v2/lib/google/cloud/retail/v2/analytics_service/rest/operations.rb @@ -0,0 +1,960 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +require "gapic/operation" + +module Google + module Cloud + module Retail + module V2 + module AnalyticsService + module Rest + # Service that implements Longrunning Operations API. + class Operations + # @private + API_VERSION = "" + + # @private + DEFAULT_ENDPOINT_TEMPLATE = "retail.$UNIVERSE_DOMAIN$" + + # @private + attr_reader :operations_stub + + ## + # Configuration for the AnalyticsService 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 AnalyticsService 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::Retail::V2::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + options.apply_defaults timeout: @config.rpcs.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::Retail::V2::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + options.apply_defaults timeout: @config.rpcs.get_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::Retail::V2::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + options.apply_defaults timeout: @config.rpcs.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::Retail::V2::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + options.apply_defaults timeout: @config.rpcs.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 = "retail.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: "/v2/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v2/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/catalogs/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v2/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/?$}, 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: "/v2/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v2/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/catalogs/[^/]+/branches/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v2/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/catalogs/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v2/{name}", + matches: [ + ["name", %r{^projects/[^/]+/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 +end diff --git a/owl-bot-staging/google-cloud-retail-v2/lib/google/cloud/retail/v2/analytics_service/rest/service_stub.rb b/owl-bot-staging/google-cloud-retail-v2/lib/google/cloud/retail/v2/analytics_service/rest/service_stub.rb new file mode 100644 index 000000000000..b35aff3ed4cc --- /dev/null +++ b/owl-bot-staging/google-cloud-retail-v2/lib/google/cloud/retail/v2/analytics_service/rest/service_stub.rb @@ -0,0 +1,143 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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/retail/v2/analytics_service_pb" + +module Google + module Cloud + module Retail + module V2 + module AnalyticsService + module Rest + ## + # REST service stub for the AnalyticsService 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 export_analytics_metrics REST call + # + # @param request_pb [::Google::Cloud::Retail::V2::ExportAnalyticsMetricsRequest] + # 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 export_analytics_metrics request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_export_analytics_metrics_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: "export_analytics_metrics", + 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 + + ## + # @private + # + # GRPC transcoding helper method for the export_analytics_metrics REST call + # + # @param request_pb [::Google::Cloud::Retail::V2::ExportAnalyticsMetricsRequest] + # A request object representing the call parameters. Required. + # @return [Array(String, [String, nil], Hash{String => String})] + # Uri, Body, Query string parameters + def self.transcode_export_analytics_metrics_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :post, + uri_template: "/v2/{catalog}:exportAnalyticsMetrics", + body: "*", + matches: [ + ["catalog", %r{^projects/[^/]+/locations/[^/]+/catalogs/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + end + end + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-retail-v2/lib/google/cloud/retail/v2/analytics_service_pb.rb b/owl-bot-staging/google-cloud-retail-v2/lib/google/cloud/retail/v2/analytics_service_pb.rb new file mode 100644 index 000000000000..8ce3ddaf6f69 --- /dev/null +++ b/owl-bot-staging/google-cloud-retail-v2/lib/google/cloud/retail/v2/analytics_service_pb.rb @@ -0,0 +1,27 @@ +# frozen_string_literal: true +# Generated by the protocol buffer compiler. DO NOT EDIT! +# source: google/cloud/retail/v2/analytics_service.proto + +require 'google/protobuf' + +require 'google/api/annotations_pb' +require 'google/api/client_pb' +require 'google/api/field_behavior_pb' +require 'google/api/resource_pb' +require 'google/cloud/retail/v2/export_config_pb' +require 'google/longrunning/operations_pb' + + +descriptor_data = "\n.google/cloud/retail/v2/analytics_service.proto\x12\x16google.cloud.retail.v2\x1a\x1cgoogle/api/annotations.proto\x1a\x17google/api/client.proto\x1a\x1fgoogle/api/field_behavior.proto\x1a\x19google/api/resource.proto\x1a*google/cloud/retail/v2/export_config.proto\x1a#google/longrunning/operations.proto2\x83\x03\n\x10\x41nalyticsService\x12\xa3\x02\n\x16\x45xportAnalyticsMetrics\x12\x35.google.cloud.retail.v2.ExportAnalyticsMetricsRequest\x1a\x1d.google.longrunning.Operation\"\xb2\x01\xca\x41^\n5google.cloud.retail.v2.ExportAnalyticsMetricsResponse\x12%google.cloud.retail.v2.ExportMetadata\x82\xd3\xe4\x93\x02K\"F/v2/{catalog=projects/*/locations/*/catalogs/*}:exportAnalyticsMetrics:\x01*\x1aI\xca\x41\x15retail.googleapis.com\xd2\x41.https://www.googleapis.com/auth/cloud-platformB\xc0\x01\n\x1a\x63om.google.cloud.retail.v2B\x15\x41nalyticsServiceProtoP\x01Z2cloud.google.com/go/retail/apiv2/retailpb;retailpb\xa2\x02\x06RETAIL\xaa\x02\x16Google.Cloud.Retail.V2\xca\x02\x16Google\\Cloud\\Retail\\V2\xea\x02\x19Google::Cloud::Retail::V2b\x06proto3" + +pool = ::Google::Protobuf::DescriptorPool.generated_pool +pool.add_serialized_file(descriptor_data) + +module Google + module Cloud + module Retail + module V2 + end + end + end +end diff --git a/owl-bot-staging/google-cloud-retail-v2/lib/google/cloud/retail/v2/analytics_service_services_pb.rb b/owl-bot-staging/google-cloud-retail-v2/lib/google/cloud/retail/v2/analytics_service_services_pb.rb new file mode 100644 index 000000000000..b9425168a3f7 --- /dev/null +++ b/owl-bot-staging/google-cloud-retail-v2/lib/google/cloud/retail/v2/analytics_service_services_pb.rb @@ -0,0 +1,49 @@ +# Generated by the protocol buffer compiler. DO NOT EDIT! +# Source: google/cloud/retail/v2/analytics_service.proto for package 'Google.Cloud.Retail.V2' +# Original file comments: +# 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 +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# + +require 'grpc' +require 'google/cloud/retail/v2/analytics_service_pb' + +module Google + module Cloud + module Retail + module V2 + module AnalyticsService + # Service for managing & accessing retail search business metric. + # Retail recommendation business metric is currently not available. + class Service + + include ::GRPC::GenericService + + self.marshal_class_method = :encode + self.unmarshal_class_method = :decode + self.service_name = 'google.cloud.retail.v2.AnalyticsService' + + # Exports analytics metrics. + # + # `Operation.response` is of type `ExportAnalyticsMetricsResponse`. + # `Operation.metadata` is of type `ExportMetadata`. + rpc :ExportAnalyticsMetrics, ::Google::Cloud::Retail::V2::ExportAnalyticsMetricsRequest, ::Google::Longrunning::Operation + end + + Stub = Service.rpc_stub_class + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-retail-v2/lib/google/cloud/retail/v2/catalog_pb.rb b/owl-bot-staging/google-cloud-retail-v2/lib/google/cloud/retail/v2/catalog_pb.rb new file mode 100644 index 000000000000..251f19b9f439 --- /dev/null +++ b/owl-bot-staging/google-cloud-retail-v2/lib/google/cloud/retail/v2/catalog_pb.rb @@ -0,0 +1,42 @@ +# frozen_string_literal: true +# Generated by the protocol buffer compiler. DO NOT EDIT! +# source: google/cloud/retail/v2/catalog.proto + +require 'google/protobuf' + +require 'google/api/field_behavior_pb' +require 'google/api/resource_pb' +require 'google/cloud/retail/v2/common_pb' +require 'google/cloud/retail/v2/import_config_pb' +require 'google/protobuf/timestamp_pb' + + +descriptor_data = "\n$google/cloud/retail/v2/catalog.proto\x12\x16google.cloud.retail.v2\x1a\x1fgoogle/api/field_behavior.proto\x1a\x19google/api/resource.proto\x1a#google/cloud/retail/v2/common.proto\x1a*google/cloud/retail/v2/import_config.proto\x1a\x1fgoogle/protobuf/timestamp.proto\"^\n\x12ProductLevelConfig\x12\x1e\n\x16ingestion_product_type\x18\x01 \x01(\t\x12(\n merchant_center_product_id_field\x18\x02 \x01(\t\"\xf7\x0f\n\x10\x43\x61talogAttribute\x12\x10\n\x03key\x18\x01 \x01(\tB\x03\xe0\x41\x02\x12\x13\n\x06in_use\x18\t \x01(\x08\x42\x03\xe0\x41\x03\x12I\n\x04type\x18\n \x01(\x0e\x32\x36.google.cloud.retail.v2.CatalogAttribute.AttributeTypeB\x03\xe0\x41\x03\x12R\n\x10indexable_option\x18\x05 \x01(\x0e\x32\x38.google.cloud.retail.v2.CatalogAttribute.IndexableOption\x12\x61\n\x18\x64ynamic_facetable_option\x18\x06 \x01(\x0e\x32?.google.cloud.retail.v2.CatalogAttribute.DynamicFacetableOption\x12T\n\x11searchable_option\x18\x07 \x01(\x0e\x32\x39.google.cloud.retail.v2.CatalogAttribute.SearchableOption\x12_\n\x17\x65xact_searchable_option\x18\x0b \x01(\x0e\x32>.google.cloud.retail.v2.CatalogAttribute.ExactSearchableOption\x12V\n\x12retrievable_option\x18\x0c \x01(\x0e\x32:.google.cloud.retail.v2.CatalogAttribute.RetrievableOption\x12J\n\x0c\x66\x61\x63\x65t_config\x18\r \x01(\x0b\x32\x34.google.cloud.retail.v2.CatalogAttribute.FacetConfig\x1a\xe9\x05\n\x0b\x46\x61\x63\x65tConfig\x12\x39\n\x0f\x66\x61\x63\x65t_intervals\x18\x01 \x03(\x0b\x32 .google.cloud.retail.v2.Interval\x12\x65\n\x14ignored_facet_values\x18\x02 \x03(\x0b\x32G.google.cloud.retail.v2.CatalogAttribute.FacetConfig.IgnoredFacetValues\x12\x62\n\x13merged_facet_values\x18\x03 \x03(\x0b\x32\x45.google.cloud.retail.v2.CatalogAttribute.FacetConfig.MergedFacetValue\x12V\n\x0cmerged_facet\x18\x04 \x01(\x0b\x32@.google.cloud.retail.v2.CatalogAttribute.FacetConfig.MergedFacet\x12X\n\rrerank_config\x18\x05 \x01(\x0b\x32\x41.google.cloud.retail.v2.CatalogAttribute.FacetConfig.RerankConfig\x1a\x82\x01\n\x12IgnoredFacetValues\x12\x0e\n\x06values\x18\x01 \x03(\t\x12.\n\nstart_time\x18\x02 \x01(\x0b\x32\x1a.google.protobuf.Timestamp\x12,\n\x08\x65nd_time\x18\x03 \x01(\x0b\x32\x1a.google.protobuf.Timestamp\x1a\x38\n\x10MergedFacetValue\x12\x0e\n\x06values\x18\x01 \x03(\t\x12\x14\n\x0cmerged_value\x18\x02 \x01(\t\x1a\'\n\x0bMergedFacet\x12\x18\n\x10merged_facet_key\x18\x01 \x01(\t\x1a:\n\x0cRerankConfig\x12\x14\n\x0crerank_facet\x18\x01 \x01(\x08\x12\x14\n\x0c\x66\x61\x63\x65t_values\x18\x02 \x03(\t\"8\n\rAttributeType\x12\x0b\n\x07UNKNOWN\x10\x00\x12\x0b\n\x07TEXTUAL\x10\x01\x12\r\n\tNUMERICAL\x10\x02\"b\n\x0fIndexableOption\x12 \n\x1cINDEXABLE_OPTION_UNSPECIFIED\x10\x00\x12\x15\n\x11INDEXABLE_ENABLED\x10\x01\x12\x16\n\x12INDEXABLE_DISABLED\x10\x02\"\x81\x01\n\x16\x44ynamicFacetableOption\x12(\n$DYNAMIC_FACETABLE_OPTION_UNSPECIFIED\x10\x00\x12\x1d\n\x19\x44YNAMIC_FACETABLE_ENABLED\x10\x01\x12\x1e\n\x1a\x44YNAMIC_FACETABLE_DISABLED\x10\x02\"f\n\x10SearchableOption\x12!\n\x1dSEARCHABLE_OPTION_UNSPECIFIED\x10\x00\x12\x16\n\x12SEARCHABLE_ENABLED\x10\x01\x12\x17\n\x13SEARCHABLE_DISABLED\x10\x02\"}\n\x15\x45xactSearchableOption\x12\'\n#EXACT_SEARCHABLE_OPTION_UNSPECIFIED\x10\x00\x12\x1c\n\x18\x45XACT_SEARCHABLE_ENABLED\x10\x01\x12\x1d\n\x19\x45XACT_SEARCHABLE_DISABLED\x10\x02\"j\n\x11RetrievableOption\x12\"\n\x1eRETRIEVABLE_OPTION_UNSPECIFIED\x10\x00\x12\x17\n\x13RETRIEVABLE_ENABLED\x10\x01\x12\x18\n\x14RETRIEVABLE_DISABLED\x10\x02\"\xb6\x03\n\x10\x41ttributesConfig\x12\x14\n\x04name\x18\x01 \x01(\tB\x06\xe0\x41\x02\xe0\x41\x05\x12[\n\x12\x63\x61talog_attributes\x18\x02 \x03(\x0b\x32?.google.cloud.retail.v2.AttributesConfig.CatalogAttributesEntry\x12Q\n\x16\x61ttribute_config_level\x18\x03 \x01(\x0e\x32,.google.cloud.retail.v2.AttributeConfigLevelB\x03\xe0\x41\x03\x1a\x62\n\x16\x43\x61talogAttributesEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12\x37\n\x05value\x18\x02 \x01(\x0b\x32(.google.cloud.retail.v2.CatalogAttribute:\x02\x38\x01:x\xea\x41u\n&retail.googleapis.com/AttributesConfig\x12Kprojects/{project}/locations/{location}/catalogs/{catalog}/attributesConfig\"\x99\x05\n\x10\x43ompletionConfig\x12\x14\n\x04name\x18\x01 \x01(\tB\x06\xe0\x41\x02\xe0\x41\x05\x12\x16\n\x0ematching_order\x18\x02 \x01(\t\x12\x17\n\x0fmax_suggestions\x18\x03 \x01(\x05\x12\x19\n\x11min_prefix_length\x18\x04 \x01(\x05\x12\x15\n\rauto_learning\x18\x0b \x01(\x08\x12X\n\x18suggestions_input_config\x18\x05 \x01(\x0b\x32\x31.google.cloud.retail.v2.CompletionDataInputConfigB\x03\xe0\x41\x03\x12.\n!last_suggestions_import_operation\x18\x06 \x01(\tB\x03\xe0\x41\x03\x12U\n\x15\x64\x65nylist_input_config\x18\x07 \x01(\x0b\x32\x31.google.cloud.retail.v2.CompletionDataInputConfigB\x03\xe0\x41\x03\x12+\n\x1elast_denylist_import_operation\x18\x08 \x01(\tB\x03\xe0\x41\x03\x12V\n\x16\x61llowlist_input_config\x18\t \x01(\x0b\x32\x31.google.cloud.retail.v2.CompletionDataInputConfigB\x03\xe0\x41\x03\x12,\n\x1flast_allowlist_import_operation\x18\n \x01(\tB\x03\xe0\x41\x03:x\xea\x41u\n&retail.googleapis.com/CompletionConfig\x12Kprojects/{project}/locations/{location}/catalogs/{catalog}/completionConfig\"\xec\x01\n\x07\x43\x61talog\x12\x14\n\x04name\x18\x01 \x01(\tB\x06\xe0\x41\x02\xe0\x41\x05\x12\x1c\n\x0c\x64isplay_name\x18\x02 \x01(\tB\x06\xe0\x41\x02\xe0\x41\x05\x12M\n\x14product_level_config\x18\x04 \x01(\x0b\x32*.google.cloud.retail.v2.ProductLevelConfigB\x03\xe0\x41\x02:^\xea\x41[\n\x1dretail.googleapis.com/Catalog\x12:projects/{project}/locations/{location}/catalogs/{catalog}B\xb7\x01\n\x1a\x63om.google.cloud.retail.v2B\x0c\x43\x61talogProtoP\x01Z2cloud.google.com/go/retail/apiv2/retailpb;retailpb\xa2\x02\x06RETAIL\xaa\x02\x16Google.Cloud.Retail.V2\xca\x02\x16Google\\Cloud\\Retail\\V2\xea\x02\x19Google::Cloud::Retail::V2b\x06proto3" + +pool = ::Google::Protobuf::DescriptorPool.generated_pool +pool.add_serialized_file(descriptor_data) + +module Google + module Cloud + module Retail + module V2 + ProductLevelConfig = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.retail.v2.ProductLevelConfig").msgclass + CatalogAttribute = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.retail.v2.CatalogAttribute").msgclass + CatalogAttribute::FacetConfig = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.retail.v2.CatalogAttribute.FacetConfig").msgclass + CatalogAttribute::FacetConfig::IgnoredFacetValues = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.retail.v2.CatalogAttribute.FacetConfig.IgnoredFacetValues").msgclass + CatalogAttribute::FacetConfig::MergedFacetValue = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.retail.v2.CatalogAttribute.FacetConfig.MergedFacetValue").msgclass + CatalogAttribute::FacetConfig::MergedFacet = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.retail.v2.CatalogAttribute.FacetConfig.MergedFacet").msgclass + CatalogAttribute::FacetConfig::RerankConfig = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.retail.v2.CatalogAttribute.FacetConfig.RerankConfig").msgclass + CatalogAttribute::AttributeType = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.retail.v2.CatalogAttribute.AttributeType").enummodule + CatalogAttribute::IndexableOption = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.retail.v2.CatalogAttribute.IndexableOption").enummodule + CatalogAttribute::DynamicFacetableOption = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.retail.v2.CatalogAttribute.DynamicFacetableOption").enummodule + CatalogAttribute::SearchableOption = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.retail.v2.CatalogAttribute.SearchableOption").enummodule + CatalogAttribute::ExactSearchableOption = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.retail.v2.CatalogAttribute.ExactSearchableOption").enummodule + CatalogAttribute::RetrievableOption = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.retail.v2.CatalogAttribute.RetrievableOption").enummodule + AttributesConfig = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.retail.v2.AttributesConfig").msgclass + CompletionConfig = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.retail.v2.CompletionConfig").msgclass + Catalog = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.retail.v2.Catalog").msgclass + end + end + end +end diff --git a/owl-bot-staging/google-cloud-retail-v2/lib/google/cloud/retail/v2/catalog_service.rb b/owl-bot-staging/google-cloud-retail-v2/lib/google/cloud/retail/v2/catalog_service.rb new file mode 100644 index 000000000000..a11f97aecb81 --- /dev/null +++ b/owl-bot-staging/google-cloud-retail-v2/lib/google/cloud/retail/v2/catalog_service.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/retail/v2/version" + +require "google/cloud/retail/v2/catalog_service/credentials" +require "google/cloud/retail/v2/catalog_service/paths" +require "google/cloud/retail/v2/catalog_service/client" +require "google/cloud/retail/v2/catalog_service/rest" + +module Google + module Cloud + module Retail + module V2 + ## + # Service for managing catalog configuration. + # + # @example Load this service and instantiate a gRPC client + # + # require "google/cloud/retail/v2/catalog_service" + # client = ::Google::Cloud::Retail::V2::CatalogService::Client.new + # + # @example Load this service and instantiate a REST client + # + # require "google/cloud/retail/v2/catalog_service/rest" + # client = ::Google::Cloud::Retail::V2::CatalogService::Rest::Client.new + # + module CatalogService + end + end + end + end +end + +helper_path = ::File.join __dir__, "catalog_service", "helpers.rb" +require "google/cloud/retail/v2/catalog_service/helpers" if ::File.file? helper_path diff --git a/owl-bot-staging/google-cloud-retail-v2/lib/google/cloud/retail/v2/catalog_service/client.rb b/owl-bot-staging/google-cloud-retail-v2/lib/google/cloud/retail/v2/catalog_service/client.rb new file mode 100644 index 000000000000..c217ac55540f --- /dev/null +++ b/owl-bot-staging/google-cloud-retail-v2/lib/google/cloud/retail/v2/catalog_service/client.rb @@ -0,0 +1,1588 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +require "google/cloud/errors" +require "google/cloud/retail/v2/catalog_service_pb" +require "google/cloud/location" + +module Google + module Cloud + module Retail + module V2 + module CatalogService + ## + # Client for the CatalogService service. + # + # Service for managing catalog configuration. + # + class Client + # @private + API_VERSION = "" + + # @private + DEFAULT_ENDPOINT_TEMPLATE = "retail.$UNIVERSE_DOMAIN$" + + include Paths + + # @private + attr_reader :catalog_service_stub + + ## + # Configure the CatalogService Client class. + # + # See {::Google::Cloud::Retail::V2::CatalogService::Client::Configuration} + # for a description of the configuration fields. + # + # @example + # + # # Modify the configuration for all CatalogService clients + # ::Google::Cloud::Retail::V2::CatalogService::Client.configure do |config| + # config.timeout = 10.0 + # end + # + # @yield [config] Configure the Client client. + # @yieldparam config [Client::Configuration] + # + # @return [Client::Configuration] + # + def self.configure + @configure ||= begin + namespace = ["Google", "Cloud", "Retail", "V2"] + parent_config = while namespace.any? + parent_name = namespace.join "::" + parent_const = const_get parent_name + break parent_const.configure if parent_const.respond_to? :configure + namespace.pop + end + default_config = Client::Configuration.new parent_config + + default_config.timeout = 5.0 + default_config.retry_policy = { + initial_delay: 0.1, max_delay: 5.0, multiplier: 1.3, retry_codes: [14, 4] + } + + default_config + end + yield @configure if block_given? + @configure + end + + ## + # Configure the CatalogService Client instance. + # + # The configuration is set to the derived mode, meaning that values can be changed, + # but structural changes (adding new fields, etc.) are not allowed. Structural changes + # should be made on {Client.configure}. + # + # See {::Google::Cloud::Retail::V2::CatalogService::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 + @catalog_service_stub.universe_domain + end + + ## + # Create a new CatalogService client object. + # + # @example + # + # # Create a client using the default configuration + # client = ::Google::Cloud::Retail::V2::CatalogService::Client.new + # + # # Create a client using a custom configuration + # client = ::Google::Cloud::Retail::V2::CatalogService::Client.new do |config| + # config.timeout = 10.0 + # end + # + # @yield [config] Configure the CatalogService client. + # @yieldparam config [Client::Configuration] + # + def initialize + # These require statements are intentionally placed here to initialize + # the gRPC module only when it's required. + # See https://github.com/googleapis/toolkit/issues/446 + require "gapic/grpc" + require "google/cloud/retail/v2/catalog_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 + + @catalog_service_stub = ::Gapic::ServiceStub.new( + ::Google::Cloud::Retail::V2::CatalogService::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 + ) + + @catalog_service_stub.stub_logger&.info do |entry| + entry.set_system_name + entry.set_service + entry.message = "Created client for #{entry.service}" + entry.set_credentials_fields credentials + entry.set "customEndpoint", @config.endpoint if @config.endpoint + entry.set "defaultTimeout", @config.timeout if @config.timeout + entry.set "quotaProject", @quota_project_id if @quota_project_id + end + + @location_client = Google::Cloud::Location::Locations::Client.new do |config| + config.credentials = credentials + config.quota_project = @quota_project_id + config.endpoint = @catalog_service_stub.endpoint + config.universe_domain = @catalog_service_stub.universe_domain + config.logger = @catalog_service_stub.logger if config.respond_to? :logger= + end + end + + ## + # Get the associated client for mix-in of the Locations. + # + # @return [Google::Cloud::Location::Locations::Client] + # + attr_reader :location_client + + ## + # The logger used for request/response debug logging. + # + # @return [Logger] + # + def logger + @catalog_service_stub.logger + end + + # Service calls + + ## + # Lists all the {::Google::Cloud::Retail::V2::Catalog Catalog}s associated with + # the project. + # + # @overload list_catalogs(request, options = nil) + # Pass arguments to `list_catalogs` via a request object, either of type + # {::Google::Cloud::Retail::V2::ListCatalogsRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Retail::V2::ListCatalogsRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_catalogs(parent: nil, page_size: nil, page_token: nil) + # Pass arguments to `list_catalogs` via keyword arguments. Note that at + # least one keyword argument is 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 account resource name with an associated location. + # + # If the caller does not have permission to list + # {::Google::Cloud::Retail::V2::Catalog Catalog}s under this location, regardless + # of whether or not this location exists, a PERMISSION_DENIED error is + # returned. + # @param page_size [::Integer] + # Maximum number of {::Google::Cloud::Retail::V2::Catalog Catalog}s to return. If + # unspecified, defaults to 50. The maximum allowed value is 1000. Values + # above 1000 will be coerced to 1000. + # + # If this field is negative, an INVALID_ARGUMENT is returned. + # @param page_token [::String] + # A page token + # {::Google::Cloud::Retail::V2::ListCatalogsResponse#next_page_token ListCatalogsResponse.next_page_token}, + # received from a previous + # {::Google::Cloud::Retail::V2::CatalogService::Client#list_catalogs CatalogService.ListCatalogs} + # call. Provide this to retrieve the subsequent page. + # + # When paginating, all other parameters provided to + # {::Google::Cloud::Retail::V2::CatalogService::Client#list_catalogs CatalogService.ListCatalogs} + # must match the call that provided the page token. Otherwise, an + # INVALID_ARGUMENT error is returned. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Gapic::PagedEnumerable<::Google::Cloud::Retail::V2::Catalog>] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Gapic::PagedEnumerable<::Google::Cloud::Retail::V2::Catalog>] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/retail/v2" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Retail::V2::CatalogService::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Retail::V2::ListCatalogsRequest.new + # + # # Call the list_catalogs method. + # result = client.list_catalogs request + # + # # The returned object is of type Gapic::PagedEnumerable. You can iterate + # # over elements, and API calls will be issued to fetch pages as needed. + # result.each do |item| + # # Each element is of type ::Google::Cloud::Retail::V2::Catalog. + # p item + # end + # + def list_catalogs request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Retail::V2::ListCatalogsRequest + + # Converts hash 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_catalogs.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::Retail::V2::VERSION + metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.parent + 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_catalogs.timeout, + metadata: metadata, + retry_policy: @config.rpcs.list_catalogs.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @catalog_service_stub.call_rpc :list_catalogs, request, options: options do |response, operation| + response = ::Gapic::PagedEnumerable.new @catalog_service_stub, :list_catalogs, 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 + + ## + # Updates the {::Google::Cloud::Retail::V2::Catalog Catalog}s. + # + # @overload update_catalog(request, options = nil) + # Pass arguments to `update_catalog` via a request object, either of type + # {::Google::Cloud::Retail::V2::UpdateCatalogRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Retail::V2::UpdateCatalogRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_catalog(catalog: nil, update_mask: nil) + # Pass arguments to `update_catalog` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param catalog [::Google::Cloud::Retail::V2::Catalog, ::Hash] + # Required. The {::Google::Cloud::Retail::V2::Catalog Catalog} to update. + # + # If the caller does not have permission to update the + # {::Google::Cloud::Retail::V2::Catalog Catalog}, regardless of whether or not it + # exists, a PERMISSION_DENIED error is returned. + # + # If the {::Google::Cloud::Retail::V2::Catalog Catalog} to update does not exist, + # a NOT_FOUND error is returned. + # @param update_mask [::Google::Protobuf::FieldMask, ::Hash] + # Indicates which fields in the provided + # {::Google::Cloud::Retail::V2::Catalog Catalog} to update. + # + # If an unsupported or unknown field is provided, an INVALID_ARGUMENT error + # is returned. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Google::Cloud::Retail::V2::Catalog] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Google::Cloud::Retail::V2::Catalog] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/retail/v2" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Retail::V2::CatalogService::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Retail::V2::UpdateCatalogRequest.new + # + # # Call the update_catalog method. + # result = client.update_catalog request + # + # # The returned object is of type Google::Cloud::Retail::V2::Catalog. + # p result + # + def update_catalog request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Retail::V2::UpdateCatalogRequest + + # Converts hash 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_catalog.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::Retail::V2::VERSION + metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.catalog&.name + header_params["catalog.name"] = request.catalog.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_catalog.timeout, + metadata: metadata, + retry_policy: @config.rpcs.update_catalog.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @catalog_service_stub.call_rpc :update_catalog, 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 + + ## + # Set a specified branch id as default branch. API methods such as + # {::Google::Cloud::Retail::V2::SearchService::Client#search SearchService.Search}, + # {::Google::Cloud::Retail::V2::ProductService::Client#get_product ProductService.GetProduct}, + # {::Google::Cloud::Retail::V2::ProductService::Client#list_products ProductService.ListProducts} + # will treat requests using "default_branch" to the actual branch id set as + # default. + # + # For example, if `projects/*/locations/*/catalogs/*/branches/1` is set as + # default, setting + # {::Google::Cloud::Retail::V2::SearchRequest#branch SearchRequest.branch} to + # `projects/*/locations/*/catalogs/*/branches/default_branch` is equivalent + # to setting + # {::Google::Cloud::Retail::V2::SearchRequest#branch SearchRequest.branch} to + # `projects/*/locations/*/catalogs/*/branches/1`. + # + # Using multiple branches can be useful when developers would like + # to have a staging branch to test and verify for future usage. When it + # becomes ready, developers switch on the staging branch using this API + # while keeping using + # `projects/*/locations/*/catalogs/*/branches/default_branch` as + # {::Google::Cloud::Retail::V2::SearchRequest#branch SearchRequest.branch} to + # route the traffic to this staging branch. + # + # CAUTION: If you have live predict/search traffic, switching the default + # branch could potentially cause outages if the ID space of the new branch + # is very different from the old one. + # + # More specifically: + # + # * PredictionService will only return product IDs from branch \\{newBranch}. + # * SearchService will only return product IDs from branch \\{newBranch} + # (if branch is not explicitly set). + # * UserEventService will only join events with products from branch + # \\{newBranch}. + # + # @overload set_default_branch(request, options = nil) + # Pass arguments to `set_default_branch` via a request object, either of type + # {::Google::Cloud::Retail::V2::SetDefaultBranchRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Retail::V2::SetDefaultBranchRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. + # + # @overload set_default_branch(catalog: nil, branch_id: nil, note: nil, force: nil) + # Pass arguments to `set_default_branch` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param catalog [::String] + # Full resource name of the catalog, such as + # `projects/*/locations/global/catalogs/default_catalog`. + # @param branch_id [::String] + # The final component of the resource name of a branch. + # + # This field must be one of "0", "1" or "2". Otherwise, an INVALID_ARGUMENT + # error is returned. + # + # If there are no sufficient active products in the targeted branch and + # {::Google::Cloud::Retail::V2::SetDefaultBranchRequest#force force} is not set, a + # FAILED_PRECONDITION error is returned. + # @param note [::String] + # Some note on this request, this can be retrieved by + # {::Google::Cloud::Retail::V2::CatalogService::Client#get_default_branch CatalogService.GetDefaultBranch} + # before next valid default branch set occurs. + # + # This field must be a UTF-8 encoded string with a length limit of 1,000 + # characters. Otherwise, an INVALID_ARGUMENT error is returned. + # @param force [::Boolean] + # If set to true, it permits switching to a branch with + # {::Google::Cloud::Retail::V2::SetDefaultBranchRequest#branch_id branch_id} even + # if it has no sufficient active products. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Google::Protobuf::Empty] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Google::Protobuf::Empty] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/retail/v2" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Retail::V2::CatalogService::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Retail::V2::SetDefaultBranchRequest.new + # + # # Call the set_default_branch method. + # result = client.set_default_branch request + # + # # The returned object is of type Google::Protobuf::Empty. + # p result + # + def set_default_branch request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Retail::V2::SetDefaultBranchRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + metadata = @config.rpcs.set_default_branch.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::Retail::V2::VERSION + metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.catalog + header_params["catalog"] = request.catalog + end + + request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") + metadata[:"x-goog-request-params"] ||= request_params_header + + options.apply_defaults timeout: @config.rpcs.set_default_branch.timeout, + metadata: metadata, + retry_policy: @config.rpcs.set_default_branch.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @catalog_service_stub.call_rpc :set_default_branch, 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 + + ## + # Get which branch is currently default branch set by + # {::Google::Cloud::Retail::V2::CatalogService::Client#set_default_branch CatalogService.SetDefaultBranch} + # method under a specified parent catalog. + # + # @overload get_default_branch(request, options = nil) + # Pass arguments to `get_default_branch` via a request object, either of type + # {::Google::Cloud::Retail::V2::GetDefaultBranchRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Retail::V2::GetDefaultBranchRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_default_branch(catalog: nil) + # Pass arguments to `get_default_branch` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param catalog [::String] + # The parent catalog resource name, such as + # `projects/*/locations/global/catalogs/default_catalog`. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Google::Cloud::Retail::V2::GetDefaultBranchResponse] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Google::Cloud::Retail::V2::GetDefaultBranchResponse] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/retail/v2" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Retail::V2::CatalogService::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Retail::V2::GetDefaultBranchRequest.new + # + # # Call the get_default_branch method. + # result = client.get_default_branch request + # + # # The returned object is of type Google::Cloud::Retail::V2::GetDefaultBranchResponse. + # p result + # + def get_default_branch request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Retail::V2::GetDefaultBranchRequest + + # Converts hash 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_default_branch.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::Retail::V2::VERSION + metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.catalog + header_params["catalog"] = request.catalog + 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_default_branch.timeout, + metadata: metadata, + retry_policy: @config.rpcs.get_default_branch.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @catalog_service_stub.call_rpc :get_default_branch, request, options: options do |response, operation| + yield response, operation if block_given? + end + rescue ::GRPC::BadStatus => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Gets a {::Google::Cloud::Retail::V2::CompletionConfig CompletionConfig}. + # + # @overload get_completion_config(request, options = nil) + # Pass arguments to `get_completion_config` via a request object, either of type + # {::Google::Cloud::Retail::V2::GetCompletionConfigRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Retail::V2::GetCompletionConfigRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_completion_config(name: nil) + # Pass arguments to `get_completion_config` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param name [::String] + # Required. Full CompletionConfig resource name. Format: + # `projects/{project_number}/locations/{location_id}/catalogs/{catalog_id}/completionConfig` + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Google::Cloud::Retail::V2::CompletionConfig] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Google::Cloud::Retail::V2::CompletionConfig] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/retail/v2" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Retail::V2::CatalogService::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Retail::V2::GetCompletionConfigRequest.new + # + # # Call the get_completion_config method. + # result = client.get_completion_config request + # + # # The returned object is of type Google::Cloud::Retail::V2::CompletionConfig. + # p result + # + def get_completion_config request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Retail::V2::GetCompletionConfigRequest + + # Converts hash 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_completion_config.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::Retail::V2::VERSION + metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.name + header_params["name"] = request.name + end + + request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") + metadata[:"x-goog-request-params"] ||= request_params_header + + options.apply_defaults timeout: @config.rpcs.get_completion_config.timeout, + metadata: metadata, + retry_policy: @config.rpcs.get_completion_config.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @catalog_service_stub.call_rpc :get_completion_config, request, options: options do |response, operation| + yield response, operation if block_given? + end + rescue ::GRPC::BadStatus => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Updates the {::Google::Cloud::Retail::V2::CompletionConfig CompletionConfig}s. + # + # @overload update_completion_config(request, options = nil) + # Pass arguments to `update_completion_config` via a request object, either of type + # {::Google::Cloud::Retail::V2::UpdateCompletionConfigRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Retail::V2::UpdateCompletionConfigRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_completion_config(completion_config: nil, update_mask: nil) + # Pass arguments to `update_completion_config` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param completion_config [::Google::Cloud::Retail::V2::CompletionConfig, ::Hash] + # Required. The {::Google::Cloud::Retail::V2::CompletionConfig CompletionConfig} + # to update. + # + # If the caller does not have permission to update the + # {::Google::Cloud::Retail::V2::CompletionConfig CompletionConfig}, then a + # PERMISSION_DENIED error is returned. + # + # If the {::Google::Cloud::Retail::V2::CompletionConfig CompletionConfig} to + # update does not exist, a NOT_FOUND error is returned. + # @param update_mask [::Google::Protobuf::FieldMask, ::Hash] + # Indicates which fields in the provided + # {::Google::Cloud::Retail::V2::CompletionConfig CompletionConfig} to update. The + # following are the only supported fields: + # + # * {::Google::Cloud::Retail::V2::CompletionConfig#matching_order CompletionConfig.matching_order} + # * {::Google::Cloud::Retail::V2::CompletionConfig#max_suggestions CompletionConfig.max_suggestions} + # * {::Google::Cloud::Retail::V2::CompletionConfig#min_prefix_length CompletionConfig.min_prefix_length} + # * {::Google::Cloud::Retail::V2::CompletionConfig#auto_learning CompletionConfig.auto_learning} + # + # If not set, all supported fields are updated. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Google::Cloud::Retail::V2::CompletionConfig] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Google::Cloud::Retail::V2::CompletionConfig] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/retail/v2" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Retail::V2::CatalogService::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Retail::V2::UpdateCompletionConfigRequest.new + # + # # Call the update_completion_config method. + # result = client.update_completion_config request + # + # # The returned object is of type Google::Cloud::Retail::V2::CompletionConfig. + # p result + # + def update_completion_config request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Retail::V2::UpdateCompletionConfigRequest + + # Converts hash 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_completion_config.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::Retail::V2::VERSION + metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.completion_config&.name + header_params["completion_config.name"] = request.completion_config.name + end + + request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") + metadata[:"x-goog-request-params"] ||= request_params_header + + options.apply_defaults timeout: @config.rpcs.update_completion_config.timeout, + metadata: metadata, + retry_policy: @config.rpcs.update_completion_config.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @catalog_service_stub.call_rpc :update_completion_config, request, options: options do |response, operation| + yield response, operation if block_given? + end + rescue ::GRPC::BadStatus => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Gets an {::Google::Cloud::Retail::V2::AttributesConfig AttributesConfig}. + # + # @overload get_attributes_config(request, options = nil) + # Pass arguments to `get_attributes_config` via a request object, either of type + # {::Google::Cloud::Retail::V2::GetAttributesConfigRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Retail::V2::GetAttributesConfigRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_attributes_config(name: nil) + # Pass arguments to `get_attributes_config` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param name [::String] + # Required. Full AttributesConfig resource name. Format: + # `projects/{project_number}/locations/{location_id}/catalogs/{catalog_id}/attributesConfig` + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Google::Cloud::Retail::V2::AttributesConfig] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Google::Cloud::Retail::V2::AttributesConfig] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/retail/v2" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Retail::V2::CatalogService::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Retail::V2::GetAttributesConfigRequest.new + # + # # Call the get_attributes_config method. + # result = client.get_attributes_config request + # + # # The returned object is of type Google::Cloud::Retail::V2::AttributesConfig. + # p result + # + def get_attributes_config request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Retail::V2::GetAttributesConfigRequest + + # Converts hash 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_attributes_config.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::Retail::V2::VERSION + metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.name + header_params["name"] = request.name + end + + request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") + metadata[:"x-goog-request-params"] ||= request_params_header + + options.apply_defaults timeout: @config.rpcs.get_attributes_config.timeout, + metadata: metadata, + retry_policy: @config.rpcs.get_attributes_config.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @catalog_service_stub.call_rpc :get_attributes_config, request, options: options do |response, operation| + yield response, operation if block_given? + end + rescue ::GRPC::BadStatus => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Updates the {::Google::Cloud::Retail::V2::AttributesConfig AttributesConfig}. + # + # The catalog attributes in the request will be updated in the catalog, or + # inserted if they do not exist. Existing catalog attributes not included in + # the request will remain unchanged. Attributes that are assigned to + # products, but do not exist at the catalog level, are always included in the + # response. The product attribute is assigned default values for missing + # catalog attribute fields, e.g., searchable and dynamic facetable options. + # + # @overload update_attributes_config(request, options = nil) + # Pass arguments to `update_attributes_config` via a request object, either of type + # {::Google::Cloud::Retail::V2::UpdateAttributesConfigRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Retail::V2::UpdateAttributesConfigRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_attributes_config(attributes_config: nil, update_mask: nil) + # Pass arguments to `update_attributes_config` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param attributes_config [::Google::Cloud::Retail::V2::AttributesConfig, ::Hash] + # Required. The {::Google::Cloud::Retail::V2::AttributesConfig AttributesConfig} + # to update. + # @param update_mask [::Google::Protobuf::FieldMask, ::Hash] + # Indicates which fields in the provided + # {::Google::Cloud::Retail::V2::AttributesConfig AttributesConfig} to update. The + # following is the only supported field: + # + # * {::Google::Cloud::Retail::V2::AttributesConfig#catalog_attributes AttributesConfig.catalog_attributes} + # + # If not set, all supported fields are updated. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Google::Cloud::Retail::V2::AttributesConfig] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Google::Cloud::Retail::V2::AttributesConfig] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/retail/v2" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Retail::V2::CatalogService::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Retail::V2::UpdateAttributesConfigRequest.new + # + # # Call the update_attributes_config method. + # result = client.update_attributes_config request + # + # # The returned object is of type Google::Cloud::Retail::V2::AttributesConfig. + # p result + # + def update_attributes_config request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Retail::V2::UpdateAttributesConfigRequest + + # Converts hash 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_attributes_config.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::Retail::V2::VERSION + metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.attributes_config&.name + header_params["attributes_config.name"] = request.attributes_config.name + end + + request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") + metadata[:"x-goog-request-params"] ||= request_params_header + + options.apply_defaults timeout: @config.rpcs.update_attributes_config.timeout, + metadata: metadata, + retry_policy: @config.rpcs.update_attributes_config.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @catalog_service_stub.call_rpc :update_attributes_config, request, options: options do |response, operation| + yield response, operation if block_given? + end + rescue ::GRPC::BadStatus => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Adds the specified + # {::Google::Cloud::Retail::V2::CatalogAttribute CatalogAttribute} to the + # {::Google::Cloud::Retail::V2::AttributesConfig AttributesConfig}. + # + # If the {::Google::Cloud::Retail::V2::CatalogAttribute CatalogAttribute} to add + # already exists, an ALREADY_EXISTS error is returned. + # + # @overload add_catalog_attribute(request, options = nil) + # Pass arguments to `add_catalog_attribute` via a request object, either of type + # {::Google::Cloud::Retail::V2::AddCatalogAttributeRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Retail::V2::AddCatalogAttributeRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. + # + # @overload add_catalog_attribute(attributes_config: nil, catalog_attribute: nil) + # Pass arguments to `add_catalog_attribute` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param attributes_config [::String] + # Required. Full AttributesConfig resource name. Format: + # `projects/{project_number}/locations/{location_id}/catalogs/{catalog_id}/attributesConfig` + # @param catalog_attribute [::Google::Cloud::Retail::V2::CatalogAttribute, ::Hash] + # Required. The {::Google::Cloud::Retail::V2::CatalogAttribute CatalogAttribute} + # to add. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Google::Cloud::Retail::V2::AttributesConfig] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Google::Cloud::Retail::V2::AttributesConfig] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/retail/v2" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Retail::V2::CatalogService::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Retail::V2::AddCatalogAttributeRequest.new + # + # # Call the add_catalog_attribute method. + # result = client.add_catalog_attribute request + # + # # The returned object is of type Google::Cloud::Retail::V2::AttributesConfig. + # p result + # + def add_catalog_attribute request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Retail::V2::AddCatalogAttributeRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + metadata = @config.rpcs.add_catalog_attribute.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::Retail::V2::VERSION + metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.attributes_config + header_params["attributes_config"] = request.attributes_config + end + + request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") + metadata[:"x-goog-request-params"] ||= request_params_header + + options.apply_defaults timeout: @config.rpcs.add_catalog_attribute.timeout, + metadata: metadata, + retry_policy: @config.rpcs.add_catalog_attribute.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @catalog_service_stub.call_rpc :add_catalog_attribute, 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 + + ## + # Removes the specified + # {::Google::Cloud::Retail::V2::CatalogAttribute CatalogAttribute} from the + # {::Google::Cloud::Retail::V2::AttributesConfig AttributesConfig}. + # + # If the {::Google::Cloud::Retail::V2::CatalogAttribute CatalogAttribute} to + # remove does not exist, a NOT_FOUND error is returned. + # + # @overload remove_catalog_attribute(request, options = nil) + # Pass arguments to `remove_catalog_attribute` via a request object, either of type + # {::Google::Cloud::Retail::V2::RemoveCatalogAttributeRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Retail::V2::RemoveCatalogAttributeRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. + # + # @overload remove_catalog_attribute(attributes_config: nil, key: nil) + # Pass arguments to `remove_catalog_attribute` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param attributes_config [::String] + # Required. Full AttributesConfig resource name. Format: + # `projects/{project_number}/locations/{location_id}/catalogs/{catalog_id}/attributesConfig` + # @param key [::String] + # Required. The attribute name key of the + # {::Google::Cloud::Retail::V2::CatalogAttribute CatalogAttribute} to remove. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Google::Cloud::Retail::V2::AttributesConfig] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Google::Cloud::Retail::V2::AttributesConfig] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/retail/v2" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Retail::V2::CatalogService::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Retail::V2::RemoveCatalogAttributeRequest.new + # + # # Call the remove_catalog_attribute method. + # result = client.remove_catalog_attribute request + # + # # The returned object is of type Google::Cloud::Retail::V2::AttributesConfig. + # p result + # + def remove_catalog_attribute request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Retail::V2::RemoveCatalogAttributeRequest + + # Converts hash 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.remove_catalog_attribute.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::Retail::V2::VERSION + metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.attributes_config + header_params["attributes_config"] = request.attributes_config + 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.remove_catalog_attribute.timeout, + metadata: metadata, + retry_policy: @config.rpcs.remove_catalog_attribute.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @catalog_service_stub.call_rpc :remove_catalog_attribute, 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 + + ## + # Replaces the specified + # {::Google::Cloud::Retail::V2::CatalogAttribute CatalogAttribute} in the + # {::Google::Cloud::Retail::V2::AttributesConfig AttributesConfig} by updating the + # catalog attribute with the same + # {::Google::Cloud::Retail::V2::CatalogAttribute#key CatalogAttribute.key}. + # + # If the {::Google::Cloud::Retail::V2::CatalogAttribute CatalogAttribute} to + # replace does not exist, a NOT_FOUND error is returned. + # + # @overload replace_catalog_attribute(request, options = nil) + # Pass arguments to `replace_catalog_attribute` via a request object, either of type + # {::Google::Cloud::Retail::V2::ReplaceCatalogAttributeRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Retail::V2::ReplaceCatalogAttributeRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. + # + # @overload replace_catalog_attribute(attributes_config: nil, catalog_attribute: nil, update_mask: nil) + # Pass arguments to `replace_catalog_attribute` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param attributes_config [::String] + # Required. Full AttributesConfig resource name. Format: + # `projects/{project_number}/locations/{location_id}/catalogs/{catalog_id}/attributesConfig` + # @param catalog_attribute [::Google::Cloud::Retail::V2::CatalogAttribute, ::Hash] + # Required. The updated + # {::Google::Cloud::Retail::V2::CatalogAttribute CatalogAttribute}. + # @param update_mask [::Google::Protobuf::FieldMask, ::Hash] + # Indicates which fields in the provided + # {::Google::Cloud::Retail::V2::CatalogAttribute CatalogAttribute} to update. The + # following are NOT supported: + # + # * {::Google::Cloud::Retail::V2::CatalogAttribute#key CatalogAttribute.key} + # + # If not set, all supported fields are updated. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Google::Cloud::Retail::V2::AttributesConfig] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Google::Cloud::Retail::V2::AttributesConfig] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/retail/v2" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Retail::V2::CatalogService::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Retail::V2::ReplaceCatalogAttributeRequest.new + # + # # Call the replace_catalog_attribute method. + # result = client.replace_catalog_attribute request + # + # # The returned object is of type Google::Cloud::Retail::V2::AttributesConfig. + # p result + # + def replace_catalog_attribute request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Retail::V2::ReplaceCatalogAttributeRequest + + # Converts hash 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.replace_catalog_attribute.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::Retail::V2::VERSION + metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.attributes_config + header_params["attributes_config"] = request.attributes_config + 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.replace_catalog_attribute.timeout, + metadata: metadata, + retry_policy: @config.rpcs.replace_catalog_attribute.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @catalog_service_stub.call_rpc :replace_catalog_attribute, request, options: options do |response, operation| + yield response, operation if block_given? + end + rescue ::GRPC::BadStatus => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Configuration class for the CatalogService API. + # + # This class represents the configuration for CatalogService, + # providing control over timeouts, retry behavior, logging, transport + # parameters, and other low-level controls. Certain parameters can also be + # applied individually to specific RPCs. See + # {::Google::Cloud::Retail::V2::CatalogService::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_catalogs to 20 seconds, + # # and all remaining timeouts to 10 seconds. + # ::Google::Cloud::Retail::V2::CatalogService::Client.configure do |config| + # config.timeout = 10.0 + # config.rpcs.list_catalogs.timeout = 20.0 + # end + # + # # Apply the above configuration only to a new client. + # client = ::Google::Cloud::Retail::V2::CatalogService::Client.new do |config| + # config.timeout = 10.0 + # config.rpcs.list_catalogs.timeout = 20.0 + # end + # + # @!attribute [rw] endpoint + # A custom service endpoint, as a hostname or hostname:port. The default is + # nil, indicating to use the default endpoint in the current universe domain. + # @return [::String,nil] + # @!attribute [rw] credentials + # Credentials to send with calls. You may provide any of the following types: + # * (`Google::Auth::Credentials`) A googleauth credentials object + # (see the [googleauth docs](https://rubydoc.info/gems/googleauth/Google/Auth/Credentials)) + # * (`Signet::OAuth2::Client`) A signet oauth2 client object + # (see the [signet docs](https://rubydoc.info/gems/signet/Signet/OAuth2/Client)) + # * (`GRPC::Core::Channel`) a gRPC channel with included credentials + # * (`GRPC::Core::ChannelCredentials`) a gRPC credentails object + # * (`nil`) indicating no credentials + # + # @note Warning: Passing a `String` to a keyfile path or a `Hash` of credentials + # is deprecated. Providing an unvalidated credential configuration to + # Google APIs can compromise the security of your systems and data. + # + # @example + # + # # The recommended way to provide credentials is to use the `make_creds` method + # # on the appropriate credentials class for your environment. + # + # require "googleauth" + # + # credentials = ::Google::Auth::ServiceAccountCredentials.make_creds( + # json_key_io: ::File.open("/path/to/keyfile.json") + # ) + # + # client = ::Google::Cloud::Retail::V2::CatalogService::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 = "retail.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 CatalogService 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_catalogs` + # @return [::Gapic::Config::Method] + # + attr_reader :list_catalogs + ## + # RPC-specific configuration for `update_catalog` + # @return [::Gapic::Config::Method] + # + attr_reader :update_catalog + ## + # RPC-specific configuration for `set_default_branch` + # @return [::Gapic::Config::Method] + # + attr_reader :set_default_branch + ## + # RPC-specific configuration for `get_default_branch` + # @return [::Gapic::Config::Method] + # + attr_reader :get_default_branch + ## + # RPC-specific configuration for `get_completion_config` + # @return [::Gapic::Config::Method] + # + attr_reader :get_completion_config + ## + # RPC-specific configuration for `update_completion_config` + # @return [::Gapic::Config::Method] + # + attr_reader :update_completion_config + ## + # RPC-specific configuration for `get_attributes_config` + # @return [::Gapic::Config::Method] + # + attr_reader :get_attributes_config + ## + # RPC-specific configuration for `update_attributes_config` + # @return [::Gapic::Config::Method] + # + attr_reader :update_attributes_config + ## + # RPC-specific configuration for `add_catalog_attribute` + # @return [::Gapic::Config::Method] + # + attr_reader :add_catalog_attribute + ## + # RPC-specific configuration for `remove_catalog_attribute` + # @return [::Gapic::Config::Method] + # + attr_reader :remove_catalog_attribute + ## + # RPC-specific configuration for `replace_catalog_attribute` + # @return [::Gapic::Config::Method] + # + attr_reader :replace_catalog_attribute + + # @private + def initialize parent_rpcs = nil + list_catalogs_config = parent_rpcs.list_catalogs if parent_rpcs.respond_to? :list_catalogs + @list_catalogs = ::Gapic::Config::Method.new list_catalogs_config + update_catalog_config = parent_rpcs.update_catalog if parent_rpcs.respond_to? :update_catalog + @update_catalog = ::Gapic::Config::Method.new update_catalog_config + set_default_branch_config = parent_rpcs.set_default_branch if parent_rpcs.respond_to? :set_default_branch + @set_default_branch = ::Gapic::Config::Method.new set_default_branch_config + get_default_branch_config = parent_rpcs.get_default_branch if parent_rpcs.respond_to? :get_default_branch + @get_default_branch = ::Gapic::Config::Method.new get_default_branch_config + get_completion_config_config = parent_rpcs.get_completion_config if parent_rpcs.respond_to? :get_completion_config + @get_completion_config = ::Gapic::Config::Method.new get_completion_config_config + update_completion_config_config = parent_rpcs.update_completion_config if parent_rpcs.respond_to? :update_completion_config + @update_completion_config = ::Gapic::Config::Method.new update_completion_config_config + get_attributes_config_config = parent_rpcs.get_attributes_config if parent_rpcs.respond_to? :get_attributes_config + @get_attributes_config = ::Gapic::Config::Method.new get_attributes_config_config + update_attributes_config_config = parent_rpcs.update_attributes_config if parent_rpcs.respond_to? :update_attributes_config + @update_attributes_config = ::Gapic::Config::Method.new update_attributes_config_config + add_catalog_attribute_config = parent_rpcs.add_catalog_attribute if parent_rpcs.respond_to? :add_catalog_attribute + @add_catalog_attribute = ::Gapic::Config::Method.new add_catalog_attribute_config + remove_catalog_attribute_config = parent_rpcs.remove_catalog_attribute if parent_rpcs.respond_to? :remove_catalog_attribute + @remove_catalog_attribute = ::Gapic::Config::Method.new remove_catalog_attribute_config + replace_catalog_attribute_config = parent_rpcs.replace_catalog_attribute if parent_rpcs.respond_to? :replace_catalog_attribute + @replace_catalog_attribute = ::Gapic::Config::Method.new replace_catalog_attribute_config + + yield self if block_given? + end + end + end + end + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-retail-v2/lib/google/cloud/retail/v2/catalog_service/credentials.rb b/owl-bot-staging/google-cloud-retail-v2/lib/google/cloud/retail/v2/catalog_service/credentials.rb new file mode 100644 index 000000000000..181a310393b3 --- /dev/null +++ b/owl-bot-staging/google-cloud-retail-v2/lib/google/cloud/retail/v2/catalog_service/credentials.rb @@ -0,0 +1,51 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +require "googleauth" + +module Google + module Cloud + module Retail + module V2 + module CatalogService + # Credentials for the CatalogService API. + class Credentials < ::Google::Auth::Credentials + self.scope = [ + "https://www.googleapis.com/auth/cloud-platform" + ] + self.env_vars = [ + "RETAIL_CREDENTIALS", + "RETAIL_KEYFILE", + "GOOGLE_CLOUD_CREDENTIALS", + "GOOGLE_CLOUD_KEYFILE", + "GCLOUD_KEYFILE", + "RETAIL_CREDENTIALS_JSON", + "RETAIL_KEYFILE_JSON", + "GOOGLE_CLOUD_CREDENTIALS_JSON", + "GOOGLE_CLOUD_KEYFILE_JSON", + "GCLOUD_KEYFILE_JSON" + ] + self.paths = [ + "~/.config/google_cloud/application_default_credentials.json" + ] + end + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-retail-v2/lib/google/cloud/retail/v2/catalog_service/paths.rb b/owl-bot-staging/google-cloud-retail-v2/lib/google/cloud/retail/v2/catalog_service/paths.rb new file mode 100644 index 000000000000..19287ee026f3 --- /dev/null +++ b/owl-bot-staging/google-cloud-retail-v2/lib/google/cloud/retail/v2/catalog_service/paths.rb @@ -0,0 +1,128 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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 Retail + module V2 + module CatalogService + # Path helper methods for the CatalogService API. + module Paths + ## + # Create a fully-qualified AttributesConfig resource string. + # + # The resource will be in the following format: + # + # `projects/{project}/locations/{location}/catalogs/{catalog}/attributesConfig` + # + # @param project [String] + # @param location [String] + # @param catalog [String] + # + # @return [::String] + def attributes_config_path project:, location:, catalog: + raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" + raise ::ArgumentError, "location cannot contain /" if location.to_s.include? "/" + + "projects/#{project}/locations/#{location}/catalogs/#{catalog}/attributesConfig" + end + + ## + # Create a fully-qualified Branch resource string. + # + # The resource will be in the following format: + # + # `projects/{project}/locations/{location}/catalogs/{catalog}/branches/{branch}` + # + # @param project [String] + # @param location [String] + # @param catalog [String] + # @param branch [String] + # + # @return [::String] + def branch_path project:, location:, catalog:, branch: + raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" + raise ::ArgumentError, "location cannot contain /" if location.to_s.include? "/" + raise ::ArgumentError, "catalog cannot contain /" if catalog.to_s.include? "/" + + "projects/#{project}/locations/#{location}/catalogs/#{catalog}/branches/#{branch}" + end + + ## + # Create a fully-qualified Catalog resource string. + # + # The resource will be in the following format: + # + # `projects/{project}/locations/{location}/catalogs/{catalog}` + # + # @param project [String] + # @param location [String] + # @param catalog [String] + # + # @return [::String] + def catalog_path project:, location:, catalog: + raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" + raise ::ArgumentError, "location cannot contain /" if location.to_s.include? "/" + + "projects/#{project}/locations/#{location}/catalogs/#{catalog}" + end + + ## + # Create a fully-qualified CompletionConfig resource string. + # + # The resource will be in the following format: + # + # `projects/{project}/locations/{location}/catalogs/{catalog}/completionConfig` + # + # @param project [String] + # @param location [String] + # @param catalog [String] + # + # @return [::String] + def completion_config_path project:, location:, catalog: + raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" + raise ::ArgumentError, "location cannot contain /" if location.to_s.include? "/" + + "projects/#{project}/locations/#{location}/catalogs/#{catalog}/completionConfig" + 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 + + extend self + end + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-retail-v2/lib/google/cloud/retail/v2/catalog_service/rest.rb b/owl-bot-staging/google-cloud-retail-v2/lib/google/cloud/retail/v2/catalog_service/rest.rb new file mode 100644 index 000000000000..ea2c8cf3fcef --- /dev/null +++ b/owl-bot-staging/google-cloud-retail-v2/lib/google/cloud/retail/v2/catalog_service/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/retail/v2/version" + +require "google/cloud/retail/v2/catalog_service/credentials" +require "google/cloud/retail/v2/catalog_service/paths" +require "google/cloud/retail/v2/catalog_service/rest/client" + +module Google + module Cloud + module Retail + module V2 + ## + # Service for managing catalog configuration. + # + # To load this service and instantiate a REST client: + # + # require "google/cloud/retail/v2/catalog_service/rest" + # client = ::Google::Cloud::Retail::V2::CatalogService::Rest::Client.new + # + module CatalogService + # Client for the REST transport + module Rest + end + end + end + end + end +end + +helper_path = ::File.join __dir__, "rest", "helpers.rb" +require "google/cloud/retail/v2/catalog_service/rest/helpers" if ::File.file? helper_path diff --git a/owl-bot-staging/google-cloud-retail-v2/lib/google/cloud/retail/v2/catalog_service/rest/client.rb b/owl-bot-staging/google-cloud-retail-v2/lib/google/cloud/retail/v2/catalog_service/rest/client.rb new file mode 100644 index 000000000000..447cb7247d8e --- /dev/null +++ b/owl-bot-staging/google-cloud-retail-v2/lib/google/cloud/retail/v2/catalog_service/rest/client.rb @@ -0,0 +1,1468 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +require "google/cloud/errors" +require "google/cloud/retail/v2/catalog_service_pb" +require "google/cloud/retail/v2/catalog_service/rest/service_stub" +require "google/cloud/location/rest" + +module Google + module Cloud + module Retail + module V2 + module CatalogService + module Rest + ## + # REST client for the CatalogService service. + # + # Service for managing catalog configuration. + # + class Client + # @private + API_VERSION = "" + + # @private + DEFAULT_ENDPOINT_TEMPLATE = "retail.$UNIVERSE_DOMAIN$" + + include Paths + + # @private + attr_reader :catalog_service_stub + + ## + # Configure the CatalogService Client class. + # + # See {::Google::Cloud::Retail::V2::CatalogService::Rest::Client::Configuration} + # for a description of the configuration fields. + # + # @example + # + # # Modify the configuration for all CatalogService clients + # ::Google::Cloud::Retail::V2::CatalogService::Rest::Client.configure do |config| + # config.timeout = 10.0 + # end + # + # @yield [config] Configure the Client client. + # @yieldparam config [Client::Configuration] + # + # @return [Client::Configuration] + # + def self.configure + @configure ||= begin + namespace = ["Google", "Cloud", "Retail", "V2"] + parent_config = while namespace.any? + parent_name = namespace.join "::" + parent_const = const_get parent_name + break parent_const.configure if parent_const.respond_to? :configure + namespace.pop + end + default_config = Client::Configuration.new parent_config + + default_config.timeout = 5.0 + default_config.retry_policy = { + initial_delay: 0.1, max_delay: 5.0, multiplier: 1.3, retry_codes: [14, 4] + } + + default_config + end + yield @configure if block_given? + @configure + end + + ## + # Configure the CatalogService Client instance. + # + # The configuration is set to the derived mode, meaning that values can be changed, + # but structural changes (adding new fields, etc.) are not allowed. Structural changes + # should be made on {Client.configure}. + # + # See {::Google::Cloud::Retail::V2::CatalogService::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 + @catalog_service_stub.universe_domain + end + + ## + # Create a new CatalogService REST client object. + # + # @example + # + # # Create a client using the default configuration + # client = ::Google::Cloud::Retail::V2::CatalogService::Rest::Client.new + # + # # Create a client using a custom configuration + # client = ::Google::Cloud::Retail::V2::CatalogService::Rest::Client.new do |config| + # config.timeout = 10.0 + # end + # + # @yield [config] Configure the CatalogService 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 + + @catalog_service_stub = ::Google::Cloud::Retail::V2::CatalogService::Rest::ServiceStub.new( + endpoint: @config.endpoint, + endpoint_template: DEFAULT_ENDPOINT_TEMPLATE, + universe_domain: @config.universe_domain, + credentials: credentials, + logger: @config.logger + ) + + @catalog_service_stub.logger(stub: true)&.info do |entry| + entry.set_system_name + entry.set_service + entry.message = "Created client for #{entry.service}" + entry.set_credentials_fields credentials + entry.set "customEndpoint", @config.endpoint if @config.endpoint + entry.set "defaultTimeout", @config.timeout if @config.timeout + entry.set "quotaProject", @quota_project_id if @quota_project_id + end + + @location_client = Google::Cloud::Location::Locations::Rest::Client.new do |config| + config.credentials = credentials + config.quota_project = @quota_project_id + config.endpoint = @catalog_service_stub.endpoint + config.universe_domain = @catalog_service_stub.universe_domain + config.logger = @catalog_service_stub.logger if config.respond_to? :logger= + end + end + + ## + # Get the associated client for mix-in of the Locations. + # + # @return [Google::Cloud::Location::Locations::Rest::Client] + # + attr_reader :location_client + + ## + # The logger used for request/response debug logging. + # + # @return [Logger] + # + def logger + @catalog_service_stub.logger + end + + # Service calls + + ## + # Lists all the {::Google::Cloud::Retail::V2::Catalog Catalog}s associated with + # the project. + # + # @overload list_catalogs(request, options = nil) + # Pass arguments to `list_catalogs` via a request object, either of type + # {::Google::Cloud::Retail::V2::ListCatalogsRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Retail::V2::ListCatalogsRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_catalogs(parent: nil, page_size: nil, page_token: nil) + # Pass arguments to `list_catalogs` via keyword arguments. Note that at + # least one keyword argument is 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 account resource name with an associated location. + # + # If the caller does not have permission to list + # {::Google::Cloud::Retail::V2::Catalog Catalog}s under this location, regardless + # of whether or not this location exists, a PERMISSION_DENIED error is + # returned. + # @param page_size [::Integer] + # Maximum number of {::Google::Cloud::Retail::V2::Catalog Catalog}s to return. If + # unspecified, defaults to 50. The maximum allowed value is 1000. Values + # above 1000 will be coerced to 1000. + # + # If this field is negative, an INVALID_ARGUMENT is returned. + # @param page_token [::String] + # A page token + # {::Google::Cloud::Retail::V2::ListCatalogsResponse#next_page_token ListCatalogsResponse.next_page_token}, + # received from a previous + # {::Google::Cloud::Retail::V2::CatalogService::Rest::Client#list_catalogs CatalogService.ListCatalogs} + # call. Provide this to retrieve the subsequent page. + # + # When paginating, all other parameters provided to + # {::Google::Cloud::Retail::V2::CatalogService::Rest::Client#list_catalogs CatalogService.ListCatalogs} + # must match the call that provided the page token. Otherwise, an + # INVALID_ARGUMENT error is returned. + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Gapic::Rest::PagedEnumerable<::Google::Cloud::Retail::V2::Catalog>] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Gapic::Rest::PagedEnumerable<::Google::Cloud::Retail::V2::Catalog>] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/retail/v2" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Retail::V2::CatalogService::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Retail::V2::ListCatalogsRequest.new + # + # # Call the list_catalogs method. + # result = client.list_catalogs request + # + # # The returned object is of type Gapic::PagedEnumerable. You can iterate + # # over elements, and API calls will be issued to fetch pages as needed. + # result.each do |item| + # # Each element is of type ::Google::Cloud::Retail::V2::Catalog. + # p item + # end + # + def list_catalogs request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Retail::V2::ListCatalogsRequest + + # Converts hash 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_catalogs.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::Retail::V2::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + options.apply_defaults timeout: @config.rpcs.list_catalogs.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.list_catalogs.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @catalog_service_stub.list_catalogs request, options do |result, operation| + result = ::Gapic::Rest::PagedEnumerable.new @catalog_service_stub, :list_catalogs, "catalogs", 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 + + ## + # Updates the {::Google::Cloud::Retail::V2::Catalog Catalog}s. + # + # @overload update_catalog(request, options = nil) + # Pass arguments to `update_catalog` via a request object, either of type + # {::Google::Cloud::Retail::V2::UpdateCatalogRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Retail::V2::UpdateCatalogRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_catalog(catalog: nil, update_mask: nil) + # Pass arguments to `update_catalog` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param catalog [::Google::Cloud::Retail::V2::Catalog, ::Hash] + # Required. The {::Google::Cloud::Retail::V2::Catalog Catalog} to update. + # + # If the caller does not have permission to update the + # {::Google::Cloud::Retail::V2::Catalog Catalog}, regardless of whether or not it + # exists, a PERMISSION_DENIED error is returned. + # + # If the {::Google::Cloud::Retail::V2::Catalog Catalog} to update does not exist, + # a NOT_FOUND error is returned. + # @param update_mask [::Google::Protobuf::FieldMask, ::Hash] + # Indicates which fields in the provided + # {::Google::Cloud::Retail::V2::Catalog Catalog} to update. + # + # If an unsupported or unknown field is provided, an INVALID_ARGUMENT error + # is returned. + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Cloud::Retail::V2::Catalog] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::Retail::V2::Catalog] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/retail/v2" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Retail::V2::CatalogService::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Retail::V2::UpdateCatalogRequest.new + # + # # Call the update_catalog method. + # result = client.update_catalog request + # + # # The returned object is of type Google::Cloud::Retail::V2::Catalog. + # p result + # + def update_catalog request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Retail::V2::UpdateCatalogRequest + + # Converts hash 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_catalog.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::Retail::V2::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + options.apply_defaults timeout: @config.rpcs.update_catalog.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.update_catalog.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @catalog_service_stub.update_catalog 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 + + ## + # Set a specified branch id as default branch. API methods such as + # {::Google::Cloud::Retail::V2::SearchService::Rest::Client#search SearchService.Search}, + # {::Google::Cloud::Retail::V2::ProductService::Rest::Client#get_product ProductService.GetProduct}, + # {::Google::Cloud::Retail::V2::ProductService::Rest::Client#list_products ProductService.ListProducts} + # will treat requests using "default_branch" to the actual branch id set as + # default. + # + # For example, if `projects/*/locations/*/catalogs/*/branches/1` is set as + # default, setting + # {::Google::Cloud::Retail::V2::SearchRequest#branch SearchRequest.branch} to + # `projects/*/locations/*/catalogs/*/branches/default_branch` is equivalent + # to setting + # {::Google::Cloud::Retail::V2::SearchRequest#branch SearchRequest.branch} to + # `projects/*/locations/*/catalogs/*/branches/1`. + # + # Using multiple branches can be useful when developers would like + # to have a staging branch to test and verify for future usage. When it + # becomes ready, developers switch on the staging branch using this API + # while keeping using + # `projects/*/locations/*/catalogs/*/branches/default_branch` as + # {::Google::Cloud::Retail::V2::SearchRequest#branch SearchRequest.branch} to + # route the traffic to this staging branch. + # + # CAUTION: If you have live predict/search traffic, switching the default + # branch could potentially cause outages if the ID space of the new branch + # is very different from the old one. + # + # More specifically: + # + # * PredictionService will only return product IDs from branch \\{newBranch}. + # * SearchService will only return product IDs from branch \\{newBranch} + # (if branch is not explicitly set). + # * UserEventService will only join events with products from branch + # \\{newBranch}. + # + # @overload set_default_branch(request, options = nil) + # Pass arguments to `set_default_branch` via a request object, either of type + # {::Google::Cloud::Retail::V2::SetDefaultBranchRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Retail::V2::SetDefaultBranchRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @overload set_default_branch(catalog: nil, branch_id: nil, note: nil, force: nil) + # Pass arguments to `set_default_branch` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param catalog [::String] + # Full resource name of the catalog, such as + # `projects/*/locations/global/catalogs/default_catalog`. + # @param branch_id [::String] + # The final component of the resource name of a branch. + # + # This field must be one of "0", "1" or "2". Otherwise, an INVALID_ARGUMENT + # error is returned. + # + # If there are no sufficient active products in the targeted branch and + # {::Google::Cloud::Retail::V2::SetDefaultBranchRequest#force force} is not set, a + # FAILED_PRECONDITION error is returned. + # @param note [::String] + # Some note on this request, this can be retrieved by + # {::Google::Cloud::Retail::V2::CatalogService::Rest::Client#get_default_branch CatalogService.GetDefaultBranch} + # before next valid default branch set occurs. + # + # This field must be a UTF-8 encoded string with a length limit of 1,000 + # characters. Otherwise, an INVALID_ARGUMENT error is returned. + # @param force [::Boolean] + # If set to true, it permits switching to a branch with + # {::Google::Cloud::Retail::V2::SetDefaultBranchRequest#branch_id branch_id} even + # if it has no sufficient active products. + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Protobuf::Empty] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Protobuf::Empty] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/retail/v2" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Retail::V2::CatalogService::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Retail::V2::SetDefaultBranchRequest.new + # + # # Call the set_default_branch method. + # result = client.set_default_branch request + # + # # The returned object is of type Google::Protobuf::Empty. + # p result + # + def set_default_branch request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Retail::V2::SetDefaultBranchRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + call_metadata = @config.rpcs.set_default_branch.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::Retail::V2::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + options.apply_defaults timeout: @config.rpcs.set_default_branch.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.set_default_branch.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @catalog_service_stub.set_default_branch 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 + + ## + # Get which branch is currently default branch set by + # {::Google::Cloud::Retail::V2::CatalogService::Rest::Client#set_default_branch CatalogService.SetDefaultBranch} + # method under a specified parent catalog. + # + # @overload get_default_branch(request, options = nil) + # Pass arguments to `get_default_branch` via a request object, either of type + # {::Google::Cloud::Retail::V2::GetDefaultBranchRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Retail::V2::GetDefaultBranchRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_default_branch(catalog: nil) + # Pass arguments to `get_default_branch` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param catalog [::String] + # The parent catalog resource name, such as + # `projects/*/locations/global/catalogs/default_catalog`. + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Cloud::Retail::V2::GetDefaultBranchResponse] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::Retail::V2::GetDefaultBranchResponse] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/retail/v2" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Retail::V2::CatalogService::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Retail::V2::GetDefaultBranchRequest.new + # + # # Call the get_default_branch method. + # result = client.get_default_branch request + # + # # The returned object is of type Google::Cloud::Retail::V2::GetDefaultBranchResponse. + # p result + # + def get_default_branch request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Retail::V2::GetDefaultBranchRequest + + # Converts hash 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_default_branch.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::Retail::V2::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + options.apply_defaults timeout: @config.rpcs.get_default_branch.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.get_default_branch.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @catalog_service_stub.get_default_branch request, options do |result, operation| + yield result, operation if block_given? + end + rescue ::Gapic::Rest::Error => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Gets a {::Google::Cloud::Retail::V2::CompletionConfig CompletionConfig}. + # + # @overload get_completion_config(request, options = nil) + # Pass arguments to `get_completion_config` via a request object, either of type + # {::Google::Cloud::Retail::V2::GetCompletionConfigRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Retail::V2::GetCompletionConfigRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_completion_config(name: nil) + # Pass arguments to `get_completion_config` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param name [::String] + # Required. Full CompletionConfig resource name. Format: + # `projects/{project_number}/locations/{location_id}/catalogs/{catalog_id}/completionConfig` + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Cloud::Retail::V2::CompletionConfig] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::Retail::V2::CompletionConfig] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/retail/v2" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Retail::V2::CatalogService::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Retail::V2::GetCompletionConfigRequest.new + # + # # Call the get_completion_config method. + # result = client.get_completion_config request + # + # # The returned object is of type Google::Cloud::Retail::V2::CompletionConfig. + # p result + # + def get_completion_config request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Retail::V2::GetCompletionConfigRequest + + # Converts hash 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_completion_config.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::Retail::V2::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + options.apply_defaults timeout: @config.rpcs.get_completion_config.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.get_completion_config.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @catalog_service_stub.get_completion_config request, options do |result, operation| + yield result, operation if block_given? + end + rescue ::Gapic::Rest::Error => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Updates the {::Google::Cloud::Retail::V2::CompletionConfig CompletionConfig}s. + # + # @overload update_completion_config(request, options = nil) + # Pass arguments to `update_completion_config` via a request object, either of type + # {::Google::Cloud::Retail::V2::UpdateCompletionConfigRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Retail::V2::UpdateCompletionConfigRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_completion_config(completion_config: nil, update_mask: nil) + # Pass arguments to `update_completion_config` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param completion_config [::Google::Cloud::Retail::V2::CompletionConfig, ::Hash] + # Required. The {::Google::Cloud::Retail::V2::CompletionConfig CompletionConfig} + # to update. + # + # If the caller does not have permission to update the + # {::Google::Cloud::Retail::V2::CompletionConfig CompletionConfig}, then a + # PERMISSION_DENIED error is returned. + # + # If the {::Google::Cloud::Retail::V2::CompletionConfig CompletionConfig} to + # update does not exist, a NOT_FOUND error is returned. + # @param update_mask [::Google::Protobuf::FieldMask, ::Hash] + # Indicates which fields in the provided + # {::Google::Cloud::Retail::V2::CompletionConfig CompletionConfig} to update. The + # following are the only supported fields: + # + # * {::Google::Cloud::Retail::V2::CompletionConfig#matching_order CompletionConfig.matching_order} + # * {::Google::Cloud::Retail::V2::CompletionConfig#max_suggestions CompletionConfig.max_suggestions} + # * {::Google::Cloud::Retail::V2::CompletionConfig#min_prefix_length CompletionConfig.min_prefix_length} + # * {::Google::Cloud::Retail::V2::CompletionConfig#auto_learning CompletionConfig.auto_learning} + # + # If not set, all supported fields are updated. + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Cloud::Retail::V2::CompletionConfig] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::Retail::V2::CompletionConfig] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/retail/v2" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Retail::V2::CatalogService::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Retail::V2::UpdateCompletionConfigRequest.new + # + # # Call the update_completion_config method. + # result = client.update_completion_config request + # + # # The returned object is of type Google::Cloud::Retail::V2::CompletionConfig. + # p result + # + def update_completion_config request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Retail::V2::UpdateCompletionConfigRequest + + # Converts hash 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_completion_config.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::Retail::V2::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + options.apply_defaults timeout: @config.rpcs.update_completion_config.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.update_completion_config.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @catalog_service_stub.update_completion_config request, options do |result, operation| + yield result, operation if block_given? + end + rescue ::Gapic::Rest::Error => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Gets an {::Google::Cloud::Retail::V2::AttributesConfig AttributesConfig}. + # + # @overload get_attributes_config(request, options = nil) + # Pass arguments to `get_attributes_config` via a request object, either of type + # {::Google::Cloud::Retail::V2::GetAttributesConfigRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Retail::V2::GetAttributesConfigRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_attributes_config(name: nil) + # Pass arguments to `get_attributes_config` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param name [::String] + # Required. Full AttributesConfig resource name. Format: + # `projects/{project_number}/locations/{location_id}/catalogs/{catalog_id}/attributesConfig` + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Cloud::Retail::V2::AttributesConfig] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::Retail::V2::AttributesConfig] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/retail/v2" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Retail::V2::CatalogService::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Retail::V2::GetAttributesConfigRequest.new + # + # # Call the get_attributes_config method. + # result = client.get_attributes_config request + # + # # The returned object is of type Google::Cloud::Retail::V2::AttributesConfig. + # p result + # + def get_attributes_config request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Retail::V2::GetAttributesConfigRequest + + # Converts hash 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_attributes_config.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::Retail::V2::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + options.apply_defaults timeout: @config.rpcs.get_attributes_config.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.get_attributes_config.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @catalog_service_stub.get_attributes_config request, options do |result, operation| + yield result, operation if block_given? + end + rescue ::Gapic::Rest::Error => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Updates the {::Google::Cloud::Retail::V2::AttributesConfig AttributesConfig}. + # + # The catalog attributes in the request will be updated in the catalog, or + # inserted if they do not exist. Existing catalog attributes not included in + # the request will remain unchanged. Attributes that are assigned to + # products, but do not exist at the catalog level, are always included in the + # response. The product attribute is assigned default values for missing + # catalog attribute fields, e.g., searchable and dynamic facetable options. + # + # @overload update_attributes_config(request, options = nil) + # Pass arguments to `update_attributes_config` via a request object, either of type + # {::Google::Cloud::Retail::V2::UpdateAttributesConfigRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Retail::V2::UpdateAttributesConfigRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_attributes_config(attributes_config: nil, update_mask: nil) + # Pass arguments to `update_attributes_config` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param attributes_config [::Google::Cloud::Retail::V2::AttributesConfig, ::Hash] + # Required. The {::Google::Cloud::Retail::V2::AttributesConfig AttributesConfig} + # to update. + # @param update_mask [::Google::Protobuf::FieldMask, ::Hash] + # Indicates which fields in the provided + # {::Google::Cloud::Retail::V2::AttributesConfig AttributesConfig} to update. The + # following is the only supported field: + # + # * {::Google::Cloud::Retail::V2::AttributesConfig#catalog_attributes AttributesConfig.catalog_attributes} + # + # If not set, all supported fields are updated. + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Cloud::Retail::V2::AttributesConfig] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::Retail::V2::AttributesConfig] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/retail/v2" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Retail::V2::CatalogService::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Retail::V2::UpdateAttributesConfigRequest.new + # + # # Call the update_attributes_config method. + # result = client.update_attributes_config request + # + # # The returned object is of type Google::Cloud::Retail::V2::AttributesConfig. + # p result + # + def update_attributes_config request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Retail::V2::UpdateAttributesConfigRequest + + # Converts hash 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_attributes_config.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::Retail::V2::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + options.apply_defaults timeout: @config.rpcs.update_attributes_config.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.update_attributes_config.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @catalog_service_stub.update_attributes_config request, options do |result, operation| + yield result, operation if block_given? + end + rescue ::Gapic::Rest::Error => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Adds the specified + # {::Google::Cloud::Retail::V2::CatalogAttribute CatalogAttribute} to the + # {::Google::Cloud::Retail::V2::AttributesConfig AttributesConfig}. + # + # If the {::Google::Cloud::Retail::V2::CatalogAttribute CatalogAttribute} to add + # already exists, an ALREADY_EXISTS error is returned. + # + # @overload add_catalog_attribute(request, options = nil) + # Pass arguments to `add_catalog_attribute` via a request object, either of type + # {::Google::Cloud::Retail::V2::AddCatalogAttributeRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Retail::V2::AddCatalogAttributeRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @overload add_catalog_attribute(attributes_config: nil, catalog_attribute: nil) + # Pass arguments to `add_catalog_attribute` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param attributes_config [::String] + # Required. Full AttributesConfig resource name. Format: + # `projects/{project_number}/locations/{location_id}/catalogs/{catalog_id}/attributesConfig` + # @param catalog_attribute [::Google::Cloud::Retail::V2::CatalogAttribute, ::Hash] + # Required. The {::Google::Cloud::Retail::V2::CatalogAttribute CatalogAttribute} + # to add. + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Cloud::Retail::V2::AttributesConfig] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::Retail::V2::AttributesConfig] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/retail/v2" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Retail::V2::CatalogService::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Retail::V2::AddCatalogAttributeRequest.new + # + # # Call the add_catalog_attribute method. + # result = client.add_catalog_attribute request + # + # # The returned object is of type Google::Cloud::Retail::V2::AttributesConfig. + # p result + # + def add_catalog_attribute request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Retail::V2::AddCatalogAttributeRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + call_metadata = @config.rpcs.add_catalog_attribute.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::Retail::V2::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + options.apply_defaults timeout: @config.rpcs.add_catalog_attribute.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.add_catalog_attribute.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @catalog_service_stub.add_catalog_attribute 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 + + ## + # Removes the specified + # {::Google::Cloud::Retail::V2::CatalogAttribute CatalogAttribute} from the + # {::Google::Cloud::Retail::V2::AttributesConfig AttributesConfig}. + # + # If the {::Google::Cloud::Retail::V2::CatalogAttribute CatalogAttribute} to + # remove does not exist, a NOT_FOUND error is returned. + # + # @overload remove_catalog_attribute(request, options = nil) + # Pass arguments to `remove_catalog_attribute` via a request object, either of type + # {::Google::Cloud::Retail::V2::RemoveCatalogAttributeRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Retail::V2::RemoveCatalogAttributeRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @overload remove_catalog_attribute(attributes_config: nil, key: nil) + # Pass arguments to `remove_catalog_attribute` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param attributes_config [::String] + # Required. Full AttributesConfig resource name. Format: + # `projects/{project_number}/locations/{location_id}/catalogs/{catalog_id}/attributesConfig` + # @param key [::String] + # Required. The attribute name key of the + # {::Google::Cloud::Retail::V2::CatalogAttribute CatalogAttribute} to remove. + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Cloud::Retail::V2::AttributesConfig] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::Retail::V2::AttributesConfig] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/retail/v2" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Retail::V2::CatalogService::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Retail::V2::RemoveCatalogAttributeRequest.new + # + # # Call the remove_catalog_attribute method. + # result = client.remove_catalog_attribute request + # + # # The returned object is of type Google::Cloud::Retail::V2::AttributesConfig. + # p result + # + def remove_catalog_attribute request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Retail::V2::RemoveCatalogAttributeRequest + + # Converts hash 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.remove_catalog_attribute.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::Retail::V2::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + options.apply_defaults timeout: @config.rpcs.remove_catalog_attribute.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.remove_catalog_attribute.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @catalog_service_stub.remove_catalog_attribute 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 + + ## + # Replaces the specified + # {::Google::Cloud::Retail::V2::CatalogAttribute CatalogAttribute} in the + # {::Google::Cloud::Retail::V2::AttributesConfig AttributesConfig} by updating the + # catalog attribute with the same + # {::Google::Cloud::Retail::V2::CatalogAttribute#key CatalogAttribute.key}. + # + # If the {::Google::Cloud::Retail::V2::CatalogAttribute CatalogAttribute} to + # replace does not exist, a NOT_FOUND error is returned. + # + # @overload replace_catalog_attribute(request, options = nil) + # Pass arguments to `replace_catalog_attribute` via a request object, either of type + # {::Google::Cloud::Retail::V2::ReplaceCatalogAttributeRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Retail::V2::ReplaceCatalogAttributeRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @overload replace_catalog_attribute(attributes_config: nil, catalog_attribute: nil, update_mask: nil) + # Pass arguments to `replace_catalog_attribute` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param attributes_config [::String] + # Required. Full AttributesConfig resource name. Format: + # `projects/{project_number}/locations/{location_id}/catalogs/{catalog_id}/attributesConfig` + # @param catalog_attribute [::Google::Cloud::Retail::V2::CatalogAttribute, ::Hash] + # Required. The updated + # {::Google::Cloud::Retail::V2::CatalogAttribute CatalogAttribute}. + # @param update_mask [::Google::Protobuf::FieldMask, ::Hash] + # Indicates which fields in the provided + # {::Google::Cloud::Retail::V2::CatalogAttribute CatalogAttribute} to update. The + # following are NOT supported: + # + # * {::Google::Cloud::Retail::V2::CatalogAttribute#key CatalogAttribute.key} + # + # If not set, all supported fields are updated. + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Cloud::Retail::V2::AttributesConfig] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::Retail::V2::AttributesConfig] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/retail/v2" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Retail::V2::CatalogService::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Retail::V2::ReplaceCatalogAttributeRequest.new + # + # # Call the replace_catalog_attribute method. + # result = client.replace_catalog_attribute request + # + # # The returned object is of type Google::Cloud::Retail::V2::AttributesConfig. + # p result + # + def replace_catalog_attribute request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Retail::V2::ReplaceCatalogAttributeRequest + + # Converts hash 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.replace_catalog_attribute.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::Retail::V2::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + options.apply_defaults timeout: @config.rpcs.replace_catalog_attribute.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.replace_catalog_attribute.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @catalog_service_stub.replace_catalog_attribute 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 CatalogService REST API. + # + # This class represents the configuration for CatalogService REST, + # providing control over timeouts, retry behavior, logging, transport + # parameters, and other low-level controls. Certain parameters can also be + # applied individually to specific RPCs. See + # {::Google::Cloud::Retail::V2::CatalogService::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_catalogs to 20 seconds, + # # and all remaining timeouts to 10 seconds. + # ::Google::Cloud::Retail::V2::CatalogService::Rest::Client.configure do |config| + # config.timeout = 10.0 + # config.rpcs.list_catalogs.timeout = 20.0 + # end + # + # # Apply the above configuration only to a new client. + # client = ::Google::Cloud::Retail::V2::CatalogService::Rest::Client.new do |config| + # config.timeout = 10.0 + # config.rpcs.list_catalogs.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 = "retail.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 CatalogService 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_catalogs` + # @return [::Gapic::Config::Method] + # + attr_reader :list_catalogs + ## + # RPC-specific configuration for `update_catalog` + # @return [::Gapic::Config::Method] + # + attr_reader :update_catalog + ## + # RPC-specific configuration for `set_default_branch` + # @return [::Gapic::Config::Method] + # + attr_reader :set_default_branch + ## + # RPC-specific configuration for `get_default_branch` + # @return [::Gapic::Config::Method] + # + attr_reader :get_default_branch + ## + # RPC-specific configuration for `get_completion_config` + # @return [::Gapic::Config::Method] + # + attr_reader :get_completion_config + ## + # RPC-specific configuration for `update_completion_config` + # @return [::Gapic::Config::Method] + # + attr_reader :update_completion_config + ## + # RPC-specific configuration for `get_attributes_config` + # @return [::Gapic::Config::Method] + # + attr_reader :get_attributes_config + ## + # RPC-specific configuration for `update_attributes_config` + # @return [::Gapic::Config::Method] + # + attr_reader :update_attributes_config + ## + # RPC-specific configuration for `add_catalog_attribute` + # @return [::Gapic::Config::Method] + # + attr_reader :add_catalog_attribute + ## + # RPC-specific configuration for `remove_catalog_attribute` + # @return [::Gapic::Config::Method] + # + attr_reader :remove_catalog_attribute + ## + # RPC-specific configuration for `replace_catalog_attribute` + # @return [::Gapic::Config::Method] + # + attr_reader :replace_catalog_attribute + + # @private + def initialize parent_rpcs = nil + list_catalogs_config = parent_rpcs.list_catalogs if parent_rpcs.respond_to? :list_catalogs + @list_catalogs = ::Gapic::Config::Method.new list_catalogs_config + update_catalog_config = parent_rpcs.update_catalog if parent_rpcs.respond_to? :update_catalog + @update_catalog = ::Gapic::Config::Method.new update_catalog_config + set_default_branch_config = parent_rpcs.set_default_branch if parent_rpcs.respond_to? :set_default_branch + @set_default_branch = ::Gapic::Config::Method.new set_default_branch_config + get_default_branch_config = parent_rpcs.get_default_branch if parent_rpcs.respond_to? :get_default_branch + @get_default_branch = ::Gapic::Config::Method.new get_default_branch_config + get_completion_config_config = parent_rpcs.get_completion_config if parent_rpcs.respond_to? :get_completion_config + @get_completion_config = ::Gapic::Config::Method.new get_completion_config_config + update_completion_config_config = parent_rpcs.update_completion_config if parent_rpcs.respond_to? :update_completion_config + @update_completion_config = ::Gapic::Config::Method.new update_completion_config_config + get_attributes_config_config = parent_rpcs.get_attributes_config if parent_rpcs.respond_to? :get_attributes_config + @get_attributes_config = ::Gapic::Config::Method.new get_attributes_config_config + update_attributes_config_config = parent_rpcs.update_attributes_config if parent_rpcs.respond_to? :update_attributes_config + @update_attributes_config = ::Gapic::Config::Method.new update_attributes_config_config + add_catalog_attribute_config = parent_rpcs.add_catalog_attribute if parent_rpcs.respond_to? :add_catalog_attribute + @add_catalog_attribute = ::Gapic::Config::Method.new add_catalog_attribute_config + remove_catalog_attribute_config = parent_rpcs.remove_catalog_attribute if parent_rpcs.respond_to? :remove_catalog_attribute + @remove_catalog_attribute = ::Gapic::Config::Method.new remove_catalog_attribute_config + replace_catalog_attribute_config = parent_rpcs.replace_catalog_attribute if parent_rpcs.respond_to? :replace_catalog_attribute + @replace_catalog_attribute = ::Gapic::Config::Method.new replace_catalog_attribute_config + + yield self if block_given? + end + end + end + end + end + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-retail-v2/lib/google/cloud/retail/v2/catalog_service/rest/service_stub.rb b/owl-bot-staging/google-cloud-retail-v2/lib/google/cloud/retail/v2/catalog_service/rest/service_stub.rb new file mode 100644 index 000000000000..aba96c79d1c5 --- /dev/null +++ b/owl-bot-staging/google-cloud-retail-v2/lib/google/cloud/retail/v2/catalog_service/rest/service_stub.rb @@ -0,0 +1,759 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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/retail/v2/catalog_service_pb" + +module Google + module Cloud + module Retail + module V2 + module CatalogService + module Rest + ## + # REST service stub for the CatalogService service. + # Service stub contains baseline method implementations + # including transcoding, making the REST call, and deserialing the response. + # + class ServiceStub + # @private + def initialize endpoint:, endpoint_template:, universe_domain:, credentials:, logger: + # These require statements are intentionally placed here to initialize + # the REST modules only when it's required. + require "gapic/rest" + + @client_stub = ::Gapic::Rest::ClientStub.new endpoint: endpoint, + endpoint_template: endpoint_template, + universe_domain: universe_domain, + credentials: credentials, + numeric_enums: true, + service_name: self.class, + raise_faraday_errors: false, + logger: logger + end + + ## + # The effective universe domain + # + # @return [String] + # + def universe_domain + @client_stub.universe_domain + end + + ## + # The effective endpoint + # + # @return [String] + # + def endpoint + @client_stub.endpoint + end + + ## + # The logger used for request/response debug logging. + # + # @return [Logger] + # + def logger stub: false + stub ? @client_stub.stub_logger : @client_stub.logger + end + + ## + # Baseline implementation for the list_catalogs REST call + # + # @param request_pb [::Google::Cloud::Retail::V2::ListCatalogsRequest] + # A request object representing the call parameters. Required. + # @param options [::Gapic::CallOptions] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Cloud::Retail::V2::ListCatalogsResponse] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::Retail::V2::ListCatalogsResponse] + # A result object deserialized from the server's reply + def list_catalogs request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_list_catalogs_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_catalogs", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Cloud::Retail::V2::ListCatalogsResponse.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_catalog REST call + # + # @param request_pb [::Google::Cloud::Retail::V2::UpdateCatalogRequest] + # A request object representing the call parameters. Required. + # @param options [::Gapic::CallOptions] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Cloud::Retail::V2::Catalog] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::Retail::V2::Catalog] + # A result object deserialized from the server's reply + def update_catalog request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_update_catalog_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_catalog", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Cloud::Retail::V2::Catalog.decode_json response.body, ignore_unknown_fields: true + catch :response do + yield result, operation if block_given? + result + end + end + + ## + # Baseline implementation for the set_default_branch REST call + # + # @param request_pb [::Google::Cloud::Retail::V2::SetDefaultBranchRequest] + # 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 set_default_branch request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_set_default_branch_request request_pb + query_string_params = if query_string_params.any? + query_string_params.to_h { |p| p.split "=", 2 } + else + {} + end + + response = @client_stub.make_http_request( + verb, + uri: uri, + body: body || "", + params: query_string_params, + method_name: "set_default_branch", + 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 get_default_branch REST call + # + # @param request_pb [::Google::Cloud::Retail::V2::GetDefaultBranchRequest] + # A request object representing the call parameters. Required. + # @param options [::Gapic::CallOptions] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Cloud::Retail::V2::GetDefaultBranchResponse] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::Retail::V2::GetDefaultBranchResponse] + # A result object deserialized from the server's reply + def get_default_branch request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_get_default_branch_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_default_branch", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Cloud::Retail::V2::GetDefaultBranchResponse.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_completion_config REST call + # + # @param request_pb [::Google::Cloud::Retail::V2::GetCompletionConfigRequest] + # A request object representing the call parameters. Required. + # @param options [::Gapic::CallOptions] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Cloud::Retail::V2::CompletionConfig] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::Retail::V2::CompletionConfig] + # A result object deserialized from the server's reply + def get_completion_config request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_get_completion_config_request request_pb + query_string_params = if query_string_params.any? + query_string_params.to_h { |p| p.split "=", 2 } + else + {} + end + + response = @client_stub.make_http_request( + verb, + uri: uri, + body: body || "", + params: query_string_params, + method_name: "get_completion_config", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Cloud::Retail::V2::CompletionConfig.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_completion_config REST call + # + # @param request_pb [::Google::Cloud::Retail::V2::UpdateCompletionConfigRequest] + # A request object representing the call parameters. Required. + # @param options [::Gapic::CallOptions] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Cloud::Retail::V2::CompletionConfig] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::Retail::V2::CompletionConfig] + # A result object deserialized from the server's reply + def update_completion_config request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_update_completion_config_request request_pb + query_string_params = if query_string_params.any? + query_string_params.to_h { |p| p.split "=", 2 } + else + {} + end + + response = @client_stub.make_http_request( + verb, + uri: uri, + body: body || "", + params: query_string_params, + method_name: "update_completion_config", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Cloud::Retail::V2::CompletionConfig.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_attributes_config REST call + # + # @param request_pb [::Google::Cloud::Retail::V2::GetAttributesConfigRequest] + # A request object representing the call parameters. Required. + # @param options [::Gapic::CallOptions] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Cloud::Retail::V2::AttributesConfig] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::Retail::V2::AttributesConfig] + # A result object deserialized from the server's reply + def get_attributes_config request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_get_attributes_config_request request_pb + query_string_params = if query_string_params.any? + query_string_params.to_h { |p| p.split "=", 2 } + else + {} + end + + response = @client_stub.make_http_request( + verb, + uri: uri, + body: body || "", + params: query_string_params, + method_name: "get_attributes_config", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Cloud::Retail::V2::AttributesConfig.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_attributes_config REST call + # + # @param request_pb [::Google::Cloud::Retail::V2::UpdateAttributesConfigRequest] + # A request object representing the call parameters. Required. + # @param options [::Gapic::CallOptions] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Cloud::Retail::V2::AttributesConfig] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::Retail::V2::AttributesConfig] + # A result object deserialized from the server's reply + def update_attributes_config request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_update_attributes_config_request request_pb + query_string_params = if query_string_params.any? + query_string_params.to_h { |p| p.split "=", 2 } + else + {} + end + + response = @client_stub.make_http_request( + verb, + uri: uri, + body: body || "", + params: query_string_params, + method_name: "update_attributes_config", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Cloud::Retail::V2::AttributesConfig.decode_json response.body, ignore_unknown_fields: true + catch :response do + yield result, operation if block_given? + result + end + end + + ## + # Baseline implementation for the add_catalog_attribute REST call + # + # @param request_pb [::Google::Cloud::Retail::V2::AddCatalogAttributeRequest] + # A request object representing the call parameters. Required. + # @param options [::Gapic::CallOptions] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Cloud::Retail::V2::AttributesConfig] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::Retail::V2::AttributesConfig] + # A result object deserialized from the server's reply + def add_catalog_attribute request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_add_catalog_attribute_request request_pb + query_string_params = if query_string_params.any? + query_string_params.to_h { |p| p.split "=", 2 } + else + {} + end + + response = @client_stub.make_http_request( + verb, + uri: uri, + body: body || "", + params: query_string_params, + method_name: "add_catalog_attribute", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Cloud::Retail::V2::AttributesConfig.decode_json response.body, ignore_unknown_fields: true + catch :response do + yield result, operation if block_given? + result + end + end + + ## + # Baseline implementation for the remove_catalog_attribute REST call + # + # @param request_pb [::Google::Cloud::Retail::V2::RemoveCatalogAttributeRequest] + # A request object representing the call parameters. Required. + # @param options [::Gapic::CallOptions] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Cloud::Retail::V2::AttributesConfig] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::Retail::V2::AttributesConfig] + # A result object deserialized from the server's reply + def remove_catalog_attribute request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_remove_catalog_attribute_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: "remove_catalog_attribute", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Cloud::Retail::V2::AttributesConfig.decode_json response.body, ignore_unknown_fields: true + catch :response do + yield result, operation if block_given? + result + end + end + + ## + # Baseline implementation for the replace_catalog_attribute REST call + # + # @param request_pb [::Google::Cloud::Retail::V2::ReplaceCatalogAttributeRequest] + # A request object representing the call parameters. Required. + # @param options [::Gapic::CallOptions] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Cloud::Retail::V2::AttributesConfig] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::Retail::V2::AttributesConfig] + # A result object deserialized from the server's reply + def replace_catalog_attribute request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_replace_catalog_attribute_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: "replace_catalog_attribute", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Cloud::Retail::V2::AttributesConfig.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_catalogs REST call + # + # @param request_pb [::Google::Cloud::Retail::V2::ListCatalogsRequest] + # 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_catalogs_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :get, + uri_template: "/v2/{parent}/catalogs", + matches: [ + ["parent", %r{^projects/[^/]+/locations/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the update_catalog REST call + # + # @param request_pb [::Google::Cloud::Retail::V2::UpdateCatalogRequest] + # 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_catalog_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :patch, + uri_template: "/v2/{catalog.name}", + body: "catalog", + matches: [ + ["catalog.name", %r{^projects/[^/]+/locations/[^/]+/catalogs/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the set_default_branch REST call + # + # @param request_pb [::Google::Cloud::Retail::V2::SetDefaultBranchRequest] + # A request object representing the call parameters. Required. + # @return [Array(String, [String, nil], Hash{String => String})] + # Uri, Body, Query string parameters + def self.transcode_set_default_branch_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :post, + uri_template: "/v2/{catalog}:setDefaultBranch", + body: "*", + matches: [ + ["catalog", %r{^projects/[^/]+/locations/[^/]+/catalogs/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the get_default_branch REST call + # + # @param request_pb [::Google::Cloud::Retail::V2::GetDefaultBranchRequest] + # 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_default_branch_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :get, + uri_template: "/v2/{catalog}:getDefaultBranch", + matches: [ + ["catalog", %r{^projects/[^/]+/locations/[^/]+/catalogs/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the get_completion_config REST call + # + # @param request_pb [::Google::Cloud::Retail::V2::GetCompletionConfigRequest] + # 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_completion_config_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :get, + uri_template: "/v2/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/catalogs/[^/]+/completionConfig/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the update_completion_config REST call + # + # @param request_pb [::Google::Cloud::Retail::V2::UpdateCompletionConfigRequest] + # 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_completion_config_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :patch, + uri_template: "/v2/{completion_config.name}", + body: "completion_config", + matches: [ + ["completion_config.name", %r{^projects/[^/]+/locations/[^/]+/catalogs/[^/]+/completionConfig/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the get_attributes_config REST call + # + # @param request_pb [::Google::Cloud::Retail::V2::GetAttributesConfigRequest] + # 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_attributes_config_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :get, + uri_template: "/v2/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/catalogs/[^/]+/attributesConfig/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the update_attributes_config REST call + # + # @param request_pb [::Google::Cloud::Retail::V2::UpdateAttributesConfigRequest] + # 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_attributes_config_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :patch, + uri_template: "/v2/{attributes_config.name}", + body: "attributes_config", + matches: [ + ["attributes_config.name", %r{^projects/[^/]+/locations/[^/]+/catalogs/[^/]+/attributesConfig/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the add_catalog_attribute REST call + # + # @param request_pb [::Google::Cloud::Retail::V2::AddCatalogAttributeRequest] + # A request object representing the call parameters. Required. + # @return [Array(String, [String, nil], Hash{String => String})] + # Uri, Body, Query string parameters + def self.transcode_add_catalog_attribute_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :post, + uri_template: "/v2/{attributes_config}:addCatalogAttribute", + body: "*", + matches: [ + ["attributes_config", %r{^projects/[^/]+/locations/[^/]+/catalogs/[^/]+/attributesConfig/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the remove_catalog_attribute REST call + # + # @param request_pb [::Google::Cloud::Retail::V2::RemoveCatalogAttributeRequest] + # A request object representing the call parameters. Required. + # @return [Array(String, [String, nil], Hash{String => String})] + # Uri, Body, Query string parameters + def self.transcode_remove_catalog_attribute_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :post, + uri_template: "/v2/{attributes_config}:removeCatalogAttribute", + body: "*", + matches: [ + ["attributes_config", %r{^projects/[^/]+/locations/[^/]+/catalogs/[^/]+/attributesConfig/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the replace_catalog_attribute REST call + # + # @param request_pb [::Google::Cloud::Retail::V2::ReplaceCatalogAttributeRequest] + # A request object representing the call parameters. Required. + # @return [Array(String, [String, nil], Hash{String => String})] + # Uri, Body, Query string parameters + def self.transcode_replace_catalog_attribute_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :post, + uri_template: "/v2/{attributes_config}:replaceCatalogAttribute", + body: "*", + matches: [ + ["attributes_config", %r{^projects/[^/]+/locations/[^/]+/catalogs/[^/]+/attributesConfig/?$}, false] + ] + ) + transcoder.transcode request_pb + end + end + end + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-retail-v2/lib/google/cloud/retail/v2/catalog_service_pb.rb b/owl-bot-staging/google-cloud-retail-v2/lib/google/cloud/retail/v2/catalog_service_pb.rb new file mode 100644 index 000000000000..13226293301e --- /dev/null +++ b/owl-bot-staging/google-cloud-retail-v2/lib/google/cloud/retail/v2/catalog_service_pb.rb @@ -0,0 +1,42 @@ +# frozen_string_literal: true +# Generated by the protocol buffer compiler. DO NOT EDIT! +# source: google/cloud/retail/v2/catalog_service.proto + +require 'google/protobuf' + +require 'google/api/annotations_pb' +require 'google/api/client_pb' +require 'google/api/field_behavior_pb' +require 'google/api/resource_pb' +require 'google/cloud/retail/v2/catalog_pb' +require 'google/protobuf/empty_pb' +require 'google/protobuf/field_mask_pb' +require 'google/protobuf/timestamp_pb' + + +descriptor_data = "\n,google/cloud/retail/v2/catalog_service.proto\x12\x16google.cloud.retail.v2\x1a\x1cgoogle/api/annotations.proto\x1a\x17google/api/client.proto\x1a\x1fgoogle/api/field_behavior.proto\x1a\x19google/api/resource.proto\x1a$google/cloud/retail/v2/catalog.proto\x1a\x1bgoogle/protobuf/empty.proto\x1a google/protobuf/field_mask.proto\x1a\x1fgoogle/protobuf/timestamp.proto\"w\n\x13ListCatalogsRequest\x12\x39\n\x06parent\x18\x01 \x01(\tB)\xe0\x41\x02\xfa\x41#\n!locations.googleapis.com/Location\x12\x11\n\tpage_size\x18\x02 \x01(\x05\x12\x12\n\npage_token\x18\x03 \x01(\t\"b\n\x14ListCatalogsResponse\x12\x31\n\x08\x63\x61talogs\x18\x01 \x03(\x0b\x32\x1f.google.cloud.retail.v2.Catalog\x12\x17\n\x0fnext_page_token\x18\x02 \x01(\t\"~\n\x14UpdateCatalogRequest\x12\x35\n\x07\x63\x61talog\x18\x01 \x01(\x0b\x32\x1f.google.cloud.retail.v2.CatalogB\x03\xe0\x41\x02\x12/\n\x0bupdate_mask\x18\x02 \x01(\x0b\x32\x1a.google.protobuf.FieldMask\"\xa1\x01\n\x17SetDefaultBranchRequest\x12\x33\n\x07\x63\x61talog\x18\x01 \x01(\tB\"\xfa\x41\x1f\n\x1dretail.googleapis.com/Catalog\x12\x34\n\tbranch_id\x18\x02 \x01(\tB!\xfa\x41\x1e\n\x1cretail.googleapis.com/Branch\x12\x0c\n\x04note\x18\x03 \x01(\t\x12\r\n\x05\x66orce\x18\x04 \x01(\x08\"N\n\x17GetDefaultBranchRequest\x12\x33\n\x07\x63\x61talog\x18\x01 \x01(\tB\"\xfa\x41\x1f\n\x1dretail.googleapis.com/Catalog\"\x89\x01\n\x18GetDefaultBranchResponse\x12\x31\n\x06\x62ranch\x18\x01 \x01(\tB!\xfa\x41\x1e\n\x1cretail.googleapis.com/Branch\x12,\n\x08set_time\x18\x02 \x01(\x0b\x32\x1a.google.protobuf.Timestamp\x12\x0c\n\x04note\x18\x03 \x01(\t\"Z\n\x1aGetCompletionConfigRequest\x12<\n\x04name\x18\x01 \x01(\tB.\xe0\x41\x02\xfa\x41(\n&retail.googleapis.com/CompletionConfig\"\x9a\x01\n\x1dUpdateCompletionConfigRequest\x12H\n\x11\x63ompletion_config\x18\x01 \x01(\x0b\x32(.google.cloud.retail.v2.CompletionConfigB\x03\xe0\x41\x02\x12/\n\x0bupdate_mask\x18\x02 \x01(\x0b\x32\x1a.google.protobuf.FieldMask\"Z\n\x1aGetAttributesConfigRequest\x12<\n\x04name\x18\x01 \x01(\tB.\xe0\x41\x02\xfa\x41(\n&retail.googleapis.com/AttributesConfig\"\x9a\x01\n\x1dUpdateAttributesConfigRequest\x12H\n\x11\x61ttributes_config\x18\x01 \x01(\x0b\x32(.google.cloud.retail.v2.AttributesConfigB\x03\xe0\x41\x02\x12/\n\x0bupdate_mask\x18\x02 \x01(\x0b\x32\x1a.google.protobuf.FieldMask\"\xb1\x01\n\x1a\x41\x64\x64\x43\x61talogAttributeRequest\x12I\n\x11\x61ttributes_config\x18\x01 \x01(\tB.\xe0\x41\x02\xfa\x41(\n&retail.googleapis.com/AttributesConfig\x12H\n\x11\x63\x61talog_attribute\x18\x02 \x01(\x0b\x32(.google.cloud.retail.v2.CatalogAttributeB\x03\xe0\x41\x02\"|\n\x1dRemoveCatalogAttributeRequest\x12I\n\x11\x61ttributes_config\x18\x01 \x01(\tB.\xe0\x41\x02\xfa\x41(\n&retail.googleapis.com/AttributesConfig\x12\x10\n\x03key\x18\x02 \x01(\tB\x03\xe0\x41\x02\"\xe6\x01\n\x1eReplaceCatalogAttributeRequest\x12I\n\x11\x61ttributes_config\x18\x01 \x01(\tB.\xe0\x41\x02\xfa\x41(\n&retail.googleapis.com/AttributesConfig\x12H\n\x11\x63\x61talog_attribute\x18\x02 \x01(\x0b\x32(.google.cloud.retail.v2.CatalogAttributeB\x03\xe0\x41\x02\x12/\n\x0bupdate_mask\x18\x03 \x01(\x0b\x32\x1a.google.protobuf.FieldMask2\x97\x13\n\x0e\x43\x61talogService\x12\xa8\x01\n\x0cListCatalogs\x12+.google.cloud.retail.v2.ListCatalogsRequest\x1a,.google.cloud.retail.v2.ListCatalogsResponse\"=\xda\x41\x06parent\x82\xd3\xe4\x93\x02.\x12,/v2/{parent=projects/*/locations/*}/catalogs\x12\xbb\x01\n\rUpdateCatalog\x12,.google.cloud.retail.v2.UpdateCatalogRequest\x1a\x1f.google.cloud.retail.v2.Catalog\"[\xda\x41\x13\x63\x61talog,update_mask\x82\xd3\xe4\x93\x02?24/v2/{catalog.name=projects/*/locations/*/catalogs/*}:\x07\x63\x61talog\x12\xb2\x01\n\x10SetDefaultBranch\x12/.google.cloud.retail.v2.SetDefaultBranchRequest\x1a\x16.google.protobuf.Empty\"U\xda\x41\x07\x63\x61talog\x82\xd3\xe4\x93\x02\x45\"@/v2/{catalog=projects/*/locations/*/catalogs/*}:setDefaultBranch:\x01*\x12\xc9\x01\n\x10GetDefaultBranch\x12/.google.cloud.retail.v2.GetDefaultBranchRequest\x1a\x30.google.cloud.retail.v2.GetDefaultBranchResponse\"R\xda\x41\x07\x63\x61talog\x82\xd3\xe4\x93\x02\x42\x12@/v2/{catalog=projects/*/locations/*/catalogs/*}:getDefaultBranch\x12\xc1\x01\n\x13GetCompletionConfig\x12\x32.google.cloud.retail.v2.GetCompletionConfigRequest\x1a(.google.cloud.retail.v2.CompletionConfig\"L\xda\x41\x04name\x82\xd3\xe4\x93\x02?\x12=/v2/{name=projects/*/locations/*/catalogs/*/completionConfig}\x12\x86\x02\n\x16UpdateCompletionConfig\x12\x35.google.cloud.retail.v2.UpdateCompletionConfigRequest\x1a(.google.cloud.retail.v2.CompletionConfig\"\x8a\x01\xda\x41\x1d\x63ompletion_config,update_mask\x82\xd3\xe4\x93\x02\x64\x32O/v2/{completion_config.name=projects/*/locations/*/catalogs/*/completionConfig}:\x11\x63ompletion_config\x12\xc1\x01\n\x13GetAttributesConfig\x12\x32.google.cloud.retail.v2.GetAttributesConfigRequest\x1a(.google.cloud.retail.v2.AttributesConfig\"L\xda\x41\x04name\x82\xd3\xe4\x93\x02?\x12=/v2/{name=projects/*/locations/*/catalogs/*/attributesConfig}\x12\x86\x02\n\x16UpdateAttributesConfig\x12\x35.google.cloud.retail.v2.UpdateAttributesConfigRequest\x1a(.google.cloud.retail.v2.AttributesConfig\"\x8a\x01\xda\x41\x1d\x61ttributes_config,update_mask\x82\xd3\xe4\x93\x02\x64\x32O/v2/{attributes_config.name=projects/*/locations/*/catalogs/*/attributesConfig}:\x11\x61ttributes_config\x12\xde\x01\n\x13\x41\x64\x64\x43\x61talogAttribute\x12\x32.google.cloud.retail.v2.AddCatalogAttributeRequest\x1a(.google.cloud.retail.v2.AttributesConfig\"i\x82\xd3\xe4\x93\x02\x63\"^/v2/{attributes_config=projects/*/locations/*/catalogs/*/attributesConfig}:addCatalogAttribute:\x01*\x12\xe7\x01\n\x16RemoveCatalogAttribute\x12\x35.google.cloud.retail.v2.RemoveCatalogAttributeRequest\x1a(.google.cloud.retail.v2.AttributesConfig\"l\x82\xd3\xe4\x93\x02\x66\"a/v2/{attributes_config=projects/*/locations/*/catalogs/*/attributesConfig}:removeCatalogAttribute:\x01*\x12\xea\x01\n\x17ReplaceCatalogAttribute\x12\x36.google.cloud.retail.v2.ReplaceCatalogAttributeRequest\x1a(.google.cloud.retail.v2.AttributesConfig\"m\x82\xd3\xe4\x93\x02g\"b/v2/{attributes_config=projects/*/locations/*/catalogs/*/attributesConfig}:replaceCatalogAttribute:\x01*\x1aI\xca\x41\x15retail.googleapis.com\xd2\x41.https://www.googleapis.com/auth/cloud-platformB\xbe\x01\n\x1a\x63om.google.cloud.retail.v2B\x13\x43\x61talogServiceProtoP\x01Z2cloud.google.com/go/retail/apiv2/retailpb;retailpb\xa2\x02\x06RETAIL\xaa\x02\x16Google.Cloud.Retail.V2\xca\x02\x16Google\\Cloud\\Retail\\V2\xea\x02\x19Google::Cloud::Retail::V2b\x06proto3" + +pool = ::Google::Protobuf::DescriptorPool.generated_pool +pool.add_serialized_file(descriptor_data) + +module Google + module Cloud + module Retail + module V2 + ListCatalogsRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.retail.v2.ListCatalogsRequest").msgclass + ListCatalogsResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.retail.v2.ListCatalogsResponse").msgclass + UpdateCatalogRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.retail.v2.UpdateCatalogRequest").msgclass + SetDefaultBranchRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.retail.v2.SetDefaultBranchRequest").msgclass + GetDefaultBranchRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.retail.v2.GetDefaultBranchRequest").msgclass + GetDefaultBranchResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.retail.v2.GetDefaultBranchResponse").msgclass + GetCompletionConfigRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.retail.v2.GetCompletionConfigRequest").msgclass + UpdateCompletionConfigRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.retail.v2.UpdateCompletionConfigRequest").msgclass + GetAttributesConfigRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.retail.v2.GetAttributesConfigRequest").msgclass + UpdateAttributesConfigRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.retail.v2.UpdateAttributesConfigRequest").msgclass + AddCatalogAttributeRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.retail.v2.AddCatalogAttributeRequest").msgclass + RemoveCatalogAttributeRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.retail.v2.RemoveCatalogAttributeRequest").msgclass + ReplaceCatalogAttributeRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.retail.v2.ReplaceCatalogAttributeRequest").msgclass + end + end + end +end diff --git a/owl-bot-staging/google-cloud-retail-v2/lib/google/cloud/retail/v2/catalog_service_services_pb.rb b/owl-bot-staging/google-cloud-retail-v2/lib/google/cloud/retail/v2/catalog_service_services_pb.rb new file mode 100644 index 000000000000..bfd199b2e5c5 --- /dev/null +++ b/owl-bot-staging/google-cloud-retail-v2/lib/google/cloud/retail/v2/catalog_service_services_pb.rb @@ -0,0 +1,125 @@ +# Generated by the protocol buffer compiler. DO NOT EDIT! +# Source: google/cloud/retail/v2/catalog_service.proto for package 'Google.Cloud.Retail.V2' +# Original file comments: +# 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 +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# + +require 'grpc' +require 'google/cloud/retail/v2/catalog_service_pb' + +module Google + module Cloud + module Retail + module V2 + module CatalogService + # Service for managing catalog configuration. + class Service + + include ::GRPC::GenericService + + self.marshal_class_method = :encode + self.unmarshal_class_method = :decode + self.service_name = 'google.cloud.retail.v2.CatalogService' + + # Lists all the [Catalog][google.cloud.retail.v2.Catalog]s associated with + # the project. + rpc :ListCatalogs, ::Google::Cloud::Retail::V2::ListCatalogsRequest, ::Google::Cloud::Retail::V2::ListCatalogsResponse + # Updates the [Catalog][google.cloud.retail.v2.Catalog]s. + rpc :UpdateCatalog, ::Google::Cloud::Retail::V2::UpdateCatalogRequest, ::Google::Cloud::Retail::V2::Catalog + # Set a specified branch id as default branch. API methods such as + # [SearchService.Search][google.cloud.retail.v2.SearchService.Search], + # [ProductService.GetProduct][google.cloud.retail.v2.ProductService.GetProduct], + # [ProductService.ListProducts][google.cloud.retail.v2.ProductService.ListProducts] + # will treat requests using "default_branch" to the actual branch id set as + # default. + # + # For example, if `projects/*/locations/*/catalogs/*/branches/1` is set as + # default, setting + # [SearchRequest.branch][google.cloud.retail.v2.SearchRequest.branch] to + # `projects/*/locations/*/catalogs/*/branches/default_branch` is equivalent + # to setting + # [SearchRequest.branch][google.cloud.retail.v2.SearchRequest.branch] to + # `projects/*/locations/*/catalogs/*/branches/1`. + # + # Using multiple branches can be useful when developers would like + # to have a staging branch to test and verify for future usage. When it + # becomes ready, developers switch on the staging branch using this API + # while keeping using + # `projects/*/locations/*/catalogs/*/branches/default_branch` as + # [SearchRequest.branch][google.cloud.retail.v2.SearchRequest.branch] to + # route the traffic to this staging branch. + # + # CAUTION: If you have live predict/search traffic, switching the default + # branch could potentially cause outages if the ID space of the new branch + # is very different from the old one. + # + # More specifically: + # + # * PredictionService will only return product IDs from branch {newBranch}. + # * SearchService will only return product IDs from branch {newBranch} + # (if branch is not explicitly set). + # * UserEventService will only join events with products from branch + # {newBranch}. + rpc :SetDefaultBranch, ::Google::Cloud::Retail::V2::SetDefaultBranchRequest, ::Google::Protobuf::Empty + # Get which branch is currently default branch set by + # [CatalogService.SetDefaultBranch][google.cloud.retail.v2.CatalogService.SetDefaultBranch] + # method under a specified parent catalog. + rpc :GetDefaultBranch, ::Google::Cloud::Retail::V2::GetDefaultBranchRequest, ::Google::Cloud::Retail::V2::GetDefaultBranchResponse + # Gets a [CompletionConfig][google.cloud.retail.v2.CompletionConfig]. + rpc :GetCompletionConfig, ::Google::Cloud::Retail::V2::GetCompletionConfigRequest, ::Google::Cloud::Retail::V2::CompletionConfig + # Updates the [CompletionConfig][google.cloud.retail.v2.CompletionConfig]s. + rpc :UpdateCompletionConfig, ::Google::Cloud::Retail::V2::UpdateCompletionConfigRequest, ::Google::Cloud::Retail::V2::CompletionConfig + # Gets an [AttributesConfig][google.cloud.retail.v2.AttributesConfig]. + rpc :GetAttributesConfig, ::Google::Cloud::Retail::V2::GetAttributesConfigRequest, ::Google::Cloud::Retail::V2::AttributesConfig + # Updates the [AttributesConfig][google.cloud.retail.v2.AttributesConfig]. + # + # The catalog attributes in the request will be updated in the catalog, or + # inserted if they do not exist. Existing catalog attributes not included in + # the request will remain unchanged. Attributes that are assigned to + # products, but do not exist at the catalog level, are always included in the + # response. The product attribute is assigned default values for missing + # catalog attribute fields, e.g., searchable and dynamic facetable options. + rpc :UpdateAttributesConfig, ::Google::Cloud::Retail::V2::UpdateAttributesConfigRequest, ::Google::Cloud::Retail::V2::AttributesConfig + # Adds the specified + # [CatalogAttribute][google.cloud.retail.v2.CatalogAttribute] to the + # [AttributesConfig][google.cloud.retail.v2.AttributesConfig]. + # + # If the [CatalogAttribute][google.cloud.retail.v2.CatalogAttribute] to add + # already exists, an ALREADY_EXISTS error is returned. + rpc :AddCatalogAttribute, ::Google::Cloud::Retail::V2::AddCatalogAttributeRequest, ::Google::Cloud::Retail::V2::AttributesConfig + # Removes the specified + # [CatalogAttribute][google.cloud.retail.v2.CatalogAttribute] from the + # [AttributesConfig][google.cloud.retail.v2.AttributesConfig]. + # + # If the [CatalogAttribute][google.cloud.retail.v2.CatalogAttribute] to + # remove does not exist, a NOT_FOUND error is returned. + rpc :RemoveCatalogAttribute, ::Google::Cloud::Retail::V2::RemoveCatalogAttributeRequest, ::Google::Cloud::Retail::V2::AttributesConfig + # Replaces the specified + # [CatalogAttribute][google.cloud.retail.v2.CatalogAttribute] in the + # [AttributesConfig][google.cloud.retail.v2.AttributesConfig] by updating the + # catalog attribute with the same + # [CatalogAttribute.key][google.cloud.retail.v2.CatalogAttribute.key]. + # + # If the [CatalogAttribute][google.cloud.retail.v2.CatalogAttribute] to + # replace does not exist, a NOT_FOUND error is returned. + rpc :ReplaceCatalogAttribute, ::Google::Cloud::Retail::V2::ReplaceCatalogAttributeRequest, ::Google::Cloud::Retail::V2::AttributesConfig + end + + Stub = Service.rpc_stub_class + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-retail-v2/lib/google/cloud/retail/v2/common_pb.rb b/owl-bot-staging/google-cloud-retail-v2/lib/google/cloud/retail/v2/common_pb.rb new file mode 100644 index 000000000000..275dd759e9cb --- /dev/null +++ b/owl-bot-staging/google-cloud-retail-v2/lib/google/cloud/retail/v2/common_pb.rb @@ -0,0 +1,58 @@ +# frozen_string_literal: true +# Generated by the protocol buffer compiler. DO NOT EDIT! +# source: google/cloud/retail/v2/common.proto + +require 'google/protobuf' + +require 'google/api/field_behavior_pb' +require 'google/protobuf/timestamp_pb' + + +descriptor_data = "\n#google/cloud/retail/v2/common.proto\x12\x16google.cloud.retail.v2\x1a\x1fgoogle/api/field_behavior.proto\x1a\x1fgoogle/protobuf/timestamp.proto\"\xc9\x02\n\tCondition\x12@\n\x0bquery_terms\x18\x01 \x03(\x0b\x32+.google.cloud.retail.v2.Condition.QueryTerm\x12\x46\n\x11\x61\x63tive_time_range\x18\x03 \x03(\x0b\x32+.google.cloud.retail.v2.Condition.TimeRange\x12\x17\n\x0fpage_categories\x18\x04 \x03(\t\x1a.\n\tQueryTerm\x12\r\n\x05value\x18\x01 \x01(\t\x12\x12\n\nfull_match\x18\x02 \x01(\x08\x1ai\n\tTimeRange\x12.\n\nstart_time\x18\x01 \x01(\x0b\x32\x1a.google.protobuf.Timestamp\x12,\n\x08\x65nd_time\x18\x02 \x01(\x0b\x32\x1a.google.protobuf.Timestamp\"\xea\r\n\x04Rule\x12@\n\x0c\x62oost_action\x18\x02 \x01(\x0b\x32(.google.cloud.retail.v2.Rule.BoostActionH\x00\x12\x46\n\x0fredirect_action\x18\x03 \x01(\x0b\x32+.google.cloud.retail.v2.Rule.RedirectActionH\x00\x12S\n\x16oneway_synonyms_action\x18\x06 \x01(\x0b\x32\x31.google.cloud.retail.v2.Rule.OnewaySynonymsActionH\x00\x12T\n\x17\x64o_not_associate_action\x18\x07 \x01(\x0b\x32\x31.google.cloud.retail.v2.Rule.DoNotAssociateActionH\x00\x12L\n\x12replacement_action\x18\x08 \x01(\x0b\x32..google.cloud.retail.v2.Rule.ReplacementActionH\x00\x12\x42\n\rignore_action\x18\t \x01(\x0b\x32).google.cloud.retail.v2.Rule.IgnoreActionH\x00\x12\x42\n\rfilter_action\x18\n \x01(\x0b\x32).google.cloud.retail.v2.Rule.FilterActionH\x00\x12S\n\x16twoway_synonyms_action\x18\x0b \x01(\x0b\x32\x31.google.cloud.retail.v2.Rule.TwowaySynonymsActionH\x00\x12X\n\x19\x66orce_return_facet_action\x18\x0c \x01(\x0b\x32\x33.google.cloud.retail.v2.Rule.ForceReturnFacetActionH\x00\x12M\n\x13remove_facet_action\x18\r \x01(\x0b\x32..google.cloud.retail.v2.Rule.RemoveFacetActionH\x00\x12<\n\npin_action\x18\x0e \x01(\x0b\x32&.google.cloud.retail.v2.Rule.PinActionH\x00\x12\x39\n\tcondition\x18\x01 \x01(\x0b\x32!.google.cloud.retail.v2.ConditionB\x03\xe0\x41\x02\x1a\x35\n\x0b\x42oostAction\x12\r\n\x05\x62oost\x18\x01 \x01(\x02\x12\x17\n\x0fproducts_filter\x18\x02 \x01(\t\x1a\x1e\n\x0c\x46ilterAction\x12\x0e\n\x06\x66ilter\x18\x01 \x01(\t\x1a&\n\x0eRedirectAction\x12\x14\n\x0credirect_uri\x18\x01 \x01(\t\x1a(\n\x14TwowaySynonymsAction\x12\x10\n\x08synonyms\x18\x01 \x03(\t\x1aS\n\x14OnewaySynonymsAction\x12\x13\n\x0bquery_terms\x18\x03 \x03(\t\x12\x10\n\x08synonyms\x18\x04 \x03(\t\x12\x14\n\x0coneway_terms\x18\x02 \x03(\t\x1aZ\n\x14\x44oNotAssociateAction\x12\x13\n\x0bquery_terms\x18\x02 \x03(\t\x12\x1e\n\x16\x64o_not_associate_terms\x18\x03 \x03(\t\x12\r\n\x05terms\x18\x01 \x03(\t\x1aP\n\x11ReplacementAction\x12\x13\n\x0bquery_terms\x18\x02 \x03(\t\x12\x18\n\x10replacement_term\x18\x03 \x01(\t\x12\x0c\n\x04term\x18\x01 \x01(\t\x1a$\n\x0cIgnoreAction\x12\x14\n\x0cignore_terms\x18\x01 \x03(\t\x1a\xce\x01\n\x16\x46orceReturnFacetAction\x12o\n\x1a\x66\x61\x63\x65t_position_adjustments\x18\x01 \x03(\x0b\x32K.google.cloud.retail.v2.Rule.ForceReturnFacetAction.FacetPositionAdjustment\x1a\x43\n\x17\x46\x61\x63\x65tPositionAdjustment\x12\x16\n\x0e\x61ttribute_name\x18\x01 \x01(\t\x12\x10\n\x08position\x18\x02 \x01(\x05\x1a,\n\x11RemoveFacetAction\x12\x17\n\x0f\x61ttribute_names\x18\x01 \x03(\t\x1a\x84\x01\n\tPinAction\x12H\n\x07pin_map\x18\x01 \x03(\x0b\x32\x32.google.cloud.retail.v2.Rule.PinAction.PinMapEntryB\x03\xe0\x41\x02\x1a-\n\x0bPinMapEntry\x12\x0b\n\x03key\x18\x01 \x01(\x03\x12\r\n\x05value\x18\x02 \x01(\t:\x02\x38\x01\x42\x08\n\x06\x61\x63tion\"/\n\x08\x41udience\x12\x0f\n\x07genders\x18\x01 \x03(\t\x12\x12\n\nage_groups\x18\x02 \x03(\t\"3\n\tColorInfo\x12\x16\n\x0e\x63olor_families\x18\x01 \x03(\t\x12\x0e\n\x06\x63olors\x18\x02 \x03(\t\"\x86\x01\n\x0f\x43ustomAttribute\x12\x0c\n\x04text\x18\x01 \x03(\t\x12\x0f\n\x07numbers\x18\x02 \x03(\x01\x12\x1b\n\nsearchable\x18\x03 \x01(\x08\x42\x02\x18\x01H\x00\x88\x01\x01\x12\x1a\n\tindexable\x18\x04 \x01(\x08\x42\x02\x18\x01H\x01\x88\x01\x01\x42\r\n\x0b_searchableB\x0c\n\n_indexable\"2\n\x0f\x46ulfillmentInfo\x12\x0c\n\x04type\x18\x01 \x01(\t\x12\x11\n\tplace_ids\x18\x02 \x03(\t\"8\n\x05Image\x12\x10\n\x03uri\x18\x01 \x01(\tB\x03\xe0\x41\x02\x12\x0e\n\x06height\x18\x02 \x01(\x05\x12\r\n\x05width\x18\x03 \x01(\x05\"x\n\x08Interval\x12\x11\n\x07minimum\x18\x01 \x01(\x01H\x00\x12\x1b\n\x11\x65xclusive_minimum\x18\x02 \x01(\x01H\x00\x12\x11\n\x07maximum\x18\x03 \x01(\x01H\x01\x12\x1b\n\x11\x65xclusive_maximum\x18\x04 \x01(\x01H\x01\x42\x05\n\x03minB\x05\n\x03max\"\x89\x03\n\tPriceInfo\x12\x15\n\rcurrency_code\x18\x01 \x01(\t\x12\r\n\x05price\x18\x02 \x01(\x02\x12\x16\n\x0eoriginal_price\x18\x03 \x01(\x02\x12\x0c\n\x04\x63ost\x18\x04 \x01(\x02\x12\x38\n\x14price_effective_time\x18\x05 \x01(\x0b\x32\x1a.google.protobuf.Timestamp\x12\x35\n\x11price_expire_time\x18\x06 \x01(\x0b\x32\x1a.google.protobuf.Timestamp\x12\x46\n\x0bprice_range\x18\x07 \x01(\x0b\x32,.google.cloud.retail.v2.PriceInfo.PriceRangeB\x03\xe0\x41\x03\x1aw\n\nPriceRange\x12/\n\x05price\x18\x01 \x01(\x0b\x32 .google.cloud.retail.v2.Interval\x12\x38\n\x0eoriginal_price\x18\x02 \x01(\x0b\x32 .google.cloud.retail.v2.Interval\"P\n\x06Rating\x12\x14\n\x0crating_count\x18\x01 \x01(\x05\x12\x16\n\x0e\x61verage_rating\x18\x02 \x01(\x02\x12\x18\n\x10rating_histogram\x18\x03 \x03(\x05\"`\n\x08UserInfo\x12\x0f\n\x07user_id\x18\x01 \x01(\t\x12\x12\n\nip_address\x18\x02 \x01(\t\x12\x12\n\nuser_agent\x18\x03 \x01(\t\x12\x1b\n\x13\x64irect_user_request\x18\x04 \x01(\x08\"\xb0\x02\n\x0eLocalInventory\x12\x15\n\x08place_id\x18\x01 \x01(\tB\x03\xe0\x41\x01\x12:\n\nprice_info\x18\x02 \x01(\x0b\x32!.google.cloud.retail.v2.PriceInfoB\x03\xe0\x41\x01\x12O\n\nattributes\x18\x03 \x03(\x0b\x32\x36.google.cloud.retail.v2.LocalInventory.AttributesEntryB\x03\xe0\x41\x01\x12\x1e\n\x11\x66ulfillment_types\x18\x04 \x03(\tB\x03\xe0\x41\x01\x1aZ\n\x0f\x41ttributesEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12\x36\n\x05value\x18\x02 \x01(\x0b\x32\'.google.cloud.retail.v2.CustomAttribute:\x02\x38\x01\"\xbf\x03\n\x12PinControlMetadata\x12X\n\x10\x61ll_matched_pins\x18\x01 \x03(\x0b\x32>.google.cloud.retail.v2.PinControlMetadata.AllMatchedPinsEntry\x12Q\n\x0c\x64ropped_pins\x18\x02 \x03(\x0b\x32;.google.cloud.retail.v2.PinControlMetadata.DroppedPinsEntry\x1a!\n\x0bProductPins\x12\x12\n\nproduct_id\x18\x01 \x03(\t\x1am\n\x13\x41llMatchedPinsEntry\x12\x0b\n\x03key\x18\x01 \x01(\x03\x12\x45\n\x05value\x18\x02 \x01(\x0b\x32\x36.google.cloud.retail.v2.PinControlMetadata.ProductPins:\x02\x38\x01\x1aj\n\x10\x44roppedPinsEntry\x12\x0b\n\x03key\x18\x01 \x01(\x03\x12\x45\n\x05value\x18\x02 \x01(\x0b\x32\x36.google.cloud.retail.v2.PinControlMetadata.ProductPins:\x02\x38\x01\"\x1c\n\nStringList\x12\x0e\n\x06values\x18\x01 \x03(\t\"\x1c\n\nDoubleList\x12\x0e\n\x06values\x18\x01 \x03(\x01*\x86\x01\n\x14\x41ttributeConfigLevel\x12&\n\"ATTRIBUTE_CONFIG_LEVEL_UNSPECIFIED\x10\x00\x12\"\n\x1ePRODUCT_LEVEL_ATTRIBUTE_CONFIG\x10\x01\x12\"\n\x1e\x43\x41TALOG_LEVEL_ATTRIBUTE_CONFIG\x10\x02*i\n\x0cSolutionType\x12\x1d\n\x19SOLUTION_TYPE_UNSPECIFIED\x10\x00\x12 \n\x1cSOLUTION_TYPE_RECOMMENDATION\x10\x01\x12\x18\n\x14SOLUTION_TYPE_SEARCH\x10\x02*\xa1\x01\n\x1eRecommendationsFilteringOption\x12\x30\n,RECOMMENDATIONS_FILTERING_OPTION_UNSPECIFIED\x10\x00\x12&\n\"RECOMMENDATIONS_FILTERING_DISABLED\x10\x01\x12%\n!RECOMMENDATIONS_FILTERING_ENABLED\x10\x03*\x8b\x01\n\x15SearchSolutionUseCase\x12(\n$SEARCH_SOLUTION_USE_CASE_UNSPECIFIED\x10\x00\x12#\n\x1fSEARCH_SOLUTION_USE_CASE_SEARCH\x10\x01\x12#\n\x1fSEARCH_SOLUTION_USE_CASE_BROWSE\x10\x02\x42\xb6\x01\n\x1a\x63om.google.cloud.retail.v2B\x0b\x43ommonProtoP\x01Z2cloud.google.com/go/retail/apiv2/retailpb;retailpb\xa2\x02\x06RETAIL\xaa\x02\x16Google.Cloud.Retail.V2\xca\x02\x16Google\\Cloud\\Retail\\V2\xea\x02\x19Google::Cloud::Retail::V2b\x06proto3" + +pool = ::Google::Protobuf::DescriptorPool.generated_pool +pool.add_serialized_file(descriptor_data) + +module Google + module Cloud + module Retail + module V2 + Condition = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.retail.v2.Condition").msgclass + Condition::QueryTerm = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.retail.v2.Condition.QueryTerm").msgclass + Condition::TimeRange = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.retail.v2.Condition.TimeRange").msgclass + Rule = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.retail.v2.Rule").msgclass + Rule::BoostAction = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.retail.v2.Rule.BoostAction").msgclass + Rule::FilterAction = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.retail.v2.Rule.FilterAction").msgclass + Rule::RedirectAction = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.retail.v2.Rule.RedirectAction").msgclass + Rule::TwowaySynonymsAction = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.retail.v2.Rule.TwowaySynonymsAction").msgclass + Rule::OnewaySynonymsAction = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.retail.v2.Rule.OnewaySynonymsAction").msgclass + Rule::DoNotAssociateAction = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.retail.v2.Rule.DoNotAssociateAction").msgclass + Rule::ReplacementAction = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.retail.v2.Rule.ReplacementAction").msgclass + Rule::IgnoreAction = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.retail.v2.Rule.IgnoreAction").msgclass + Rule::ForceReturnFacetAction = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.retail.v2.Rule.ForceReturnFacetAction").msgclass + Rule::ForceReturnFacetAction::FacetPositionAdjustment = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.retail.v2.Rule.ForceReturnFacetAction.FacetPositionAdjustment").msgclass + Rule::RemoveFacetAction = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.retail.v2.Rule.RemoveFacetAction").msgclass + Rule::PinAction = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.retail.v2.Rule.PinAction").msgclass + Audience = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.retail.v2.Audience").msgclass + ColorInfo = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.retail.v2.ColorInfo").msgclass + CustomAttribute = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.retail.v2.CustomAttribute").msgclass + FulfillmentInfo = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.retail.v2.FulfillmentInfo").msgclass + Image = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.retail.v2.Image").msgclass + Interval = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.retail.v2.Interval").msgclass + PriceInfo = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.retail.v2.PriceInfo").msgclass + PriceInfo::PriceRange = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.retail.v2.PriceInfo.PriceRange").msgclass + Rating = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.retail.v2.Rating").msgclass + UserInfo = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.retail.v2.UserInfo").msgclass + LocalInventory = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.retail.v2.LocalInventory").msgclass + PinControlMetadata = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.retail.v2.PinControlMetadata").msgclass + PinControlMetadata::ProductPins = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.retail.v2.PinControlMetadata.ProductPins").msgclass + StringList = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.retail.v2.StringList").msgclass + DoubleList = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.retail.v2.DoubleList").msgclass + AttributeConfigLevel = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.retail.v2.AttributeConfigLevel").enummodule + SolutionType = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.retail.v2.SolutionType").enummodule + RecommendationsFilteringOption = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.retail.v2.RecommendationsFilteringOption").enummodule + SearchSolutionUseCase = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.retail.v2.SearchSolutionUseCase").enummodule + end + end + end +end diff --git a/owl-bot-staging/google-cloud-retail-v2/lib/google/cloud/retail/v2/completion_service.rb b/owl-bot-staging/google-cloud-retail-v2/lib/google/cloud/retail/v2/completion_service.rb new file mode 100644 index 000000000000..910963175533 --- /dev/null +++ b/owl-bot-staging/google-cloud-retail-v2/lib/google/cloud/retail/v2/completion_service.rb @@ -0,0 +1,59 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +require "gapic/common" +require "gapic/config" +require "gapic/config/method" + +require "google/cloud/retail/v2/version" + +require "google/cloud/retail/v2/completion_service/credentials" +require "google/cloud/retail/v2/completion_service/paths" +require "google/cloud/retail/v2/completion_service/operations" +require "google/cloud/retail/v2/completion_service/client" +require "google/cloud/retail/v2/completion_service/rest" + +module Google + module Cloud + module Retail + module V2 + ## + # Autocomplete service for retail. + # + # This feature is only available for users who have Retail Search enabled. + # Enable Retail Search on Cloud Console before using this feature. + # + # @example Load this service and instantiate a gRPC client + # + # require "google/cloud/retail/v2/completion_service" + # client = ::Google::Cloud::Retail::V2::CompletionService::Client.new + # + # @example Load this service and instantiate a REST client + # + # require "google/cloud/retail/v2/completion_service/rest" + # client = ::Google::Cloud::Retail::V2::CompletionService::Rest::Client.new + # + module CompletionService + end + end + end + end +end + +helper_path = ::File.join __dir__, "completion_service", "helpers.rb" +require "google/cloud/retail/v2/completion_service/helpers" if ::File.file? helper_path diff --git a/owl-bot-staging/google-cloud-retail-v2/lib/google/cloud/retail/v2/completion_service/client.rb b/owl-bot-staging/google-cloud-retail-v2/lib/google/cloud/retail/v2/completion_service/client.rb new file mode 100644 index 000000000000..28ee2fda07b6 --- /dev/null +++ b/owl-bot-staging/google-cloud-retail-v2/lib/google/cloud/retail/v2/completion_service/client.rb @@ -0,0 +1,714 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +require "google/cloud/errors" +require "google/cloud/retail/v2/completion_service_pb" +require "google/cloud/location" + +module Google + module Cloud + module Retail + module V2 + module CompletionService + ## + # Client for the CompletionService service. + # + # Autocomplete service for retail. + # + # This feature is only available for users who have Retail Search enabled. + # Enable Retail Search on Cloud Console before using this feature. + # + class Client + # @private + API_VERSION = "" + + # @private + DEFAULT_ENDPOINT_TEMPLATE = "retail.$UNIVERSE_DOMAIN$" + + include Paths + + # @private + attr_reader :completion_service_stub + + ## + # Configure the CompletionService Client class. + # + # See {::Google::Cloud::Retail::V2::CompletionService::Client::Configuration} + # for a description of the configuration fields. + # + # @example + # + # # Modify the configuration for all CompletionService clients + # ::Google::Cloud::Retail::V2::CompletionService::Client.configure do |config| + # config.timeout = 10.0 + # end + # + # @yield [config] Configure the Client client. + # @yieldparam config [Client::Configuration] + # + # @return [Client::Configuration] + # + def self.configure + @configure ||= begin + namespace = ["Google", "Cloud", "Retail", "V2"] + parent_config = while namespace.any? + parent_name = namespace.join "::" + parent_const = const_get parent_name + break parent_const.configure if parent_const.respond_to? :configure + namespace.pop + end + default_config = Client::Configuration.new parent_config + + default_config.timeout = 5.0 + default_config.retry_policy = { + initial_delay: 0.1, max_delay: 5.0, multiplier: 1.3, retry_codes: [14, 4] + } + + default_config + end + yield @configure if block_given? + @configure + end + + ## + # Configure the CompletionService Client instance. + # + # The configuration is set to the derived mode, meaning that values can be changed, + # but structural changes (adding new fields, etc.) are not allowed. Structural changes + # should be made on {Client.configure}. + # + # See {::Google::Cloud::Retail::V2::CompletionService::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 + @completion_service_stub.universe_domain + end + + ## + # Create a new CompletionService client object. + # + # @example + # + # # Create a client using the default configuration + # client = ::Google::Cloud::Retail::V2::CompletionService::Client.new + # + # # Create a client using a custom configuration + # client = ::Google::Cloud::Retail::V2::CompletionService::Client.new do |config| + # config.timeout = 10.0 + # end + # + # @yield [config] Configure the CompletionService client. + # @yieldparam config [Client::Configuration] + # + def initialize + # These require statements are intentionally placed here to initialize + # the gRPC module only when it's required. + # See https://github.com/googleapis/toolkit/issues/446 + require "gapic/grpc" + require "google/cloud/retail/v2/completion_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 + + @completion_service_stub = ::Gapic::ServiceStub.new( + ::Google::Cloud::Retail::V2::CompletionService::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 + ) + + @completion_service_stub.stub_logger&.info do |entry| + entry.set_system_name + entry.set_service + entry.message = "Created client for #{entry.service}" + entry.set_credentials_fields credentials + entry.set "customEndpoint", @config.endpoint if @config.endpoint + entry.set "defaultTimeout", @config.timeout if @config.timeout + entry.set "quotaProject", @quota_project_id if @quota_project_id + end + + @location_client = Google::Cloud::Location::Locations::Client.new do |config| + config.credentials = credentials + config.quota_project = @quota_project_id + config.endpoint = @completion_service_stub.endpoint + config.universe_domain = @completion_service_stub.universe_domain + config.logger = @completion_service_stub.logger if config.respond_to? :logger= + end + end + + ## + # Get the associated client for long-running operations. + # + # @return [::Google::Cloud::Retail::V2::CompletionService::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 + @completion_service_stub.logger + end + + # Service calls + + ## + # Completes the specified prefix with keyword suggestions. + # + # This feature is only available for users who have Retail Search enabled. + # Enable Retail Search on Cloud Console before using this feature. + # + # @overload complete_query(request, options = nil) + # Pass arguments to `complete_query` via a request object, either of type + # {::Google::Cloud::Retail::V2::CompleteQueryRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Retail::V2::CompleteQueryRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. + # + # @overload complete_query(catalog: nil, query: nil, visitor_id: nil, language_codes: nil, device_type: nil, dataset: nil, max_suggestions: nil, enable_attribute_suggestions: nil, entity: nil) + # Pass arguments to `complete_query` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param catalog [::String] + # Required. Catalog for which the completion is performed. + # + # Full resource name of catalog, such as + # `projects/*/locations/global/catalogs/default_catalog`. + # @param query [::String] + # Required. The query used to generate suggestions. + # + # The maximum number of allowed characters is 255. + # @param visitor_id [::String] + # Recommended field. A unique identifier for tracking visitors. For example, + # this could be implemented with an HTTP cookie, which should be able to + # uniquely identify a visitor on a single device. This unique identifier + # should not change if the visitor logs in or out of the website. + # + # The field must be a UTF-8 encoded string with a length limit of 128 + # characters. Otherwise, an INVALID_ARGUMENT error is returned. + # @param language_codes [::Array<::String>] + # Note that this field applies for `user-data` dataset only. For requests + # with `cloud-retail` dataset, setting this field has no effect. + # + # The language filters applied to the output suggestions. If set, it should + # contain the language of the query. If not set, suggestions are returned + # without considering language restrictions. This is the BCP-47 language + # code, such as "en-US" or "sr-Latn". For more information, see [Tags for + # Identifying Languages](https://tools.ietf.org/html/bcp47). The maximum + # number of language codes is 3. + # @param device_type [::String] + # The device type context for completion suggestions. We recommend that you + # leave this field empty. + # + # It can apply different suggestions on different device types, e.g. + # `DESKTOP`, `MOBILE`. If it is empty, the suggestions are across all device + # types. + # + # Supported formats: + # + # * `UNKNOWN_DEVICE_TYPE` + # + # * `DESKTOP` + # + # * `MOBILE` + # + # * A customized string starts with `OTHER_`, e.g. `OTHER_IPHONE`. + # @param dataset [::String] + # Determines which dataset to use for fetching completion. "user-data" will + # use the dataset imported through + # {::Google::Cloud::Retail::V2::CompletionService::Client#import_completion_data CompletionService.ImportCompletionData}. + # `cloud-retail` will use the dataset generated by Cloud Retail based on user + # events. If left empty, completions will be fetched from the `user-data` + # dataset. + # + # Current supported values: + # + # * user-data + # + # * cloud-retail: + # This option requires enabling auto-learning function first. See + # [guidelines](https://cloud.google.com/retail/docs/completion-overview#generated-completion-dataset). + # @param max_suggestions [::Integer] + # Completion max suggestions. If left unset or set to 0, then will fallback + # to the configured value + # {::Google::Cloud::Retail::V2::CompletionConfig#max_suggestions CompletionConfig.max_suggestions}. + # + # The maximum allowed max suggestions is 20. If it is set higher, it will be + # capped by 20. + # @param enable_attribute_suggestions [::Boolean] + # If true, attribute suggestions are enabled and provided in the response. + # + # This field is only available for the `cloud-retail` dataset. + # @param entity [::String] + # The entity for customers who run multiple entities, domains, sites, or + # regions, for example, `Google US`, `Google Ads`, `Waymo`, + # `google.com`, `youtube.com`, etc. + # If this is set, it must be an exact match with + # {::Google::Cloud::Retail::V2::UserEvent#entity UserEvent.entity} to get + # per-entity autocomplete results. This field will be applied to + # `completion_results` only. It has no effect on the `attribute_results`. + # Also, this entity should be limited to 256 characters, if too long, it will + # be truncated to 256 characters in both generation and serving time, and may + # lead to mis-match. To ensure it works, please set the entity with string + # within 256 characters. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Google::Cloud::Retail::V2::CompleteQueryResponse] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Google::Cloud::Retail::V2::CompleteQueryResponse] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/retail/v2" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Retail::V2::CompletionService::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Retail::V2::CompleteQueryRequest.new + # + # # Call the complete_query method. + # result = client.complete_query request + # + # # The returned object is of type Google::Cloud::Retail::V2::CompleteQueryResponse. + # p result + # + def complete_query request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Retail::V2::CompleteQueryRequest + + # Converts hash 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.complete_query.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::Retail::V2::VERSION + metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.catalog + header_params["catalog"] = request.catalog + 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.complete_query.timeout, + metadata: metadata, + retry_policy: @config.rpcs.complete_query.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @completion_service_stub.call_rpc :complete_query, 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 + + ## + # Bulk import of processed completion dataset. + # + # Request processing is asynchronous. Partial updating is not supported. + # + # The operation is successfully finished only after the imported suggestions + # are indexed successfully and ready for serving. The process takes hours. + # + # This feature is only available for users who have Retail Search enabled. + # Enable Retail Search on Cloud Console before using this feature. + # + # @overload import_completion_data(request, options = nil) + # Pass arguments to `import_completion_data` via a request object, either of type + # {::Google::Cloud::Retail::V2::ImportCompletionDataRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Retail::V2::ImportCompletionDataRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. + # + # @overload import_completion_data(parent: nil, input_config: nil, notification_pubsub_topic: nil) + # Pass arguments to `import_completion_data` via keyword arguments. Note that at + # least one keyword argument is 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 catalog which the suggestions dataset belongs to. + # + # Format: `projects/1234/locations/global/catalogs/default_catalog`. + # @param input_config [::Google::Cloud::Retail::V2::CompletionDataInputConfig, ::Hash] + # Required. The desired input location of the data. + # @param notification_pubsub_topic [::String] + # Pub/Sub topic for receiving notification. If this field is set, + # when the import is finished, a notification is sent to + # specified Pub/Sub topic. The message data is JSON string of a + # {::Google::Longrunning::Operation Operation}. + # Format of the Pub/Sub topic is `projects/{project}/topics/{topic}`. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Gapic::Operation] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Gapic::Operation] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/retail/v2" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Retail::V2::CompletionService::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Retail::V2::ImportCompletionDataRequest.new + # + # # Call the import_completion_data method. + # result = client.import_completion_data 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 import_completion_data request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Retail::V2::ImportCompletionDataRequest + + # Converts hash 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.import_completion_data.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::Retail::V2::VERSION + metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.parent + 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.import_completion_data.timeout, + metadata: metadata, + retry_policy: @config.rpcs.import_completion_data.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @completion_service_stub.call_rpc :import_completion_data, 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 CompletionService API. + # + # This class represents the configuration for CompletionService, + # providing control over timeouts, retry behavior, logging, transport + # parameters, and other low-level controls. Certain parameters can also be + # applied individually to specific RPCs. See + # {::Google::Cloud::Retail::V2::CompletionService::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 + # # complete_query to 20 seconds, + # # and all remaining timeouts to 10 seconds. + # ::Google::Cloud::Retail::V2::CompletionService::Client.configure do |config| + # config.timeout = 10.0 + # config.rpcs.complete_query.timeout = 20.0 + # end + # + # # Apply the above configuration only to a new client. + # client = ::Google::Cloud::Retail::V2::CompletionService::Client.new do |config| + # config.timeout = 10.0 + # config.rpcs.complete_query.timeout = 20.0 + # end + # + # @!attribute [rw] endpoint + # A custom service endpoint, as a hostname or hostname:port. The default is + # nil, indicating to use the default endpoint in the current universe domain. + # @return [::String,nil] + # @!attribute [rw] credentials + # Credentials to send with calls. You may provide any of the following types: + # * (`Google::Auth::Credentials`) A googleauth credentials object + # (see the [googleauth docs](https://rubydoc.info/gems/googleauth/Google/Auth/Credentials)) + # * (`Signet::OAuth2::Client`) A signet oauth2 client object + # (see the [signet docs](https://rubydoc.info/gems/signet/Signet/OAuth2/Client)) + # * (`GRPC::Core::Channel`) a gRPC channel with included credentials + # * (`GRPC::Core::ChannelCredentials`) a gRPC credentails object + # * (`nil`) indicating no credentials + # + # @note Warning: Passing a `String` to a keyfile path or a `Hash` of credentials + # is deprecated. Providing an unvalidated credential configuration to + # Google APIs can compromise the security of your systems and data. + # + # @example + # + # # The recommended way to provide credentials is to use the `make_creds` method + # # on the appropriate credentials class for your environment. + # + # require "googleauth" + # + # credentials = ::Google::Auth::ServiceAccountCredentials.make_creds( + # json_key_io: ::File.open("/path/to/keyfile.json") + # ) + # + # client = ::Google::Cloud::Retail::V2::CompletionService::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 = "retail.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 CompletionService 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 `complete_query` + # @return [::Gapic::Config::Method] + # + attr_reader :complete_query + ## + # RPC-specific configuration for `import_completion_data` + # @return [::Gapic::Config::Method] + # + attr_reader :import_completion_data + + # @private + def initialize parent_rpcs = nil + complete_query_config = parent_rpcs.complete_query if parent_rpcs.respond_to? :complete_query + @complete_query = ::Gapic::Config::Method.new complete_query_config + import_completion_data_config = parent_rpcs.import_completion_data if parent_rpcs.respond_to? :import_completion_data + @import_completion_data = ::Gapic::Config::Method.new import_completion_data_config + + yield self if block_given? + end + end + end + end + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-retail-v2/lib/google/cloud/retail/v2/completion_service/credentials.rb b/owl-bot-staging/google-cloud-retail-v2/lib/google/cloud/retail/v2/completion_service/credentials.rb new file mode 100644 index 000000000000..fad74ea58827 --- /dev/null +++ b/owl-bot-staging/google-cloud-retail-v2/lib/google/cloud/retail/v2/completion_service/credentials.rb @@ -0,0 +1,51 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +require "googleauth" + +module Google + module Cloud + module Retail + module V2 + module CompletionService + # Credentials for the CompletionService API. + class Credentials < ::Google::Auth::Credentials + self.scope = [ + "https://www.googleapis.com/auth/cloud-platform" + ] + self.env_vars = [ + "RETAIL_CREDENTIALS", + "RETAIL_KEYFILE", + "GOOGLE_CLOUD_CREDENTIALS", + "GOOGLE_CLOUD_KEYFILE", + "GCLOUD_KEYFILE", + "RETAIL_CREDENTIALS_JSON", + "RETAIL_KEYFILE_JSON", + "GOOGLE_CLOUD_CREDENTIALS_JSON", + "GOOGLE_CLOUD_KEYFILE_JSON", + "GCLOUD_KEYFILE_JSON" + ] + self.paths = [ + "~/.config/google_cloud/application_default_credentials.json" + ] + end + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-retail-v2/lib/google/cloud/retail/v2/completion_service/operations.rb b/owl-bot-staging/google-cloud-retail-v2/lib/google/cloud/retail/v2/completion_service/operations.rb new file mode 100644 index 000000000000..b79837b617c2 --- /dev/null +++ b/owl-bot-staging/google-cloud-retail-v2/lib/google/cloud/retail/v2/completion_service/operations.rb @@ -0,0 +1,841 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +require "gapic/operation" +require "google/longrunning/operations_pb" + +module Google + module Cloud + module Retail + module V2 + module CompletionService + # Service that implements Longrunning Operations API. + class Operations + # @private + API_VERSION = "" + + # @private + DEFAULT_ENDPOINT_TEMPLATE = "retail.$UNIVERSE_DOMAIN$" + + # @private + attr_reader :operations_stub + + ## + # Configuration for the CompletionService 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 CompletionService 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::Retail::V2::VERSION + metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.name + header_params["name"] = request.name + end + + request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") + metadata[:"x-goog-request-params"] ||= request_params_header + + options.apply_defaults timeout: @config.rpcs.list_operations.timeout, + metadata: metadata, + retry_policy: @config.rpcs.list_operations.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @operations_stub.call_rpc :list_operations, request, options: options do |response, operation| + wrap_lro_operation = ->(op_response) { ::Gapic::Operation.new op_response, @operations_client } + response = ::Gapic::PagedEnumerable.new @operations_stub, :list_operations, request, response, operation, options, format_resource: wrap_lro_operation + yield response, operation if block_given? + throw :response, response + end + rescue ::GRPC::BadStatus => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Gets the latest state of a long-running operation. Clients can use this + # method to poll the operation result at intervals as recommended by the API + # service. + # + # @overload get_operation(request, options = nil) + # Pass arguments to `get_operation` via a request object, either of type + # {::Google::Longrunning::GetOperationRequest} or an equivalent Hash. + # + # @param request [::Google::Longrunning::GetOperationRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. + # + # @overload get_operation(name: nil) + # Pass arguments to `get_operation` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param name [::String] + # The name of the operation resource. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Gapic::Operation] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Gapic::Operation] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/longrunning" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Longrunning::Operations::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Longrunning::GetOperationRequest.new + # + # # Call the get_operation method. + # result = client.get_operation request + # + # # The returned object is of type Gapic::Operation. You can use it to + # # check the status of an operation, cancel it, or wait for results. + # # Here is how to wait for a response. + # result.wait_until_done! timeout: 60 + # if result.response? + # p result.response + # else + # puts "No response received." + # end + # + def get_operation request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Longrunning::GetOperationRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + metadata = @config.rpcs.get_operation.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::Retail::V2::VERSION + metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.name + header_params["name"] = request.name + end + + request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") + metadata[:"x-goog-request-params"] ||= request_params_header + + options.apply_defaults timeout: @config.rpcs.get_operation.timeout, + metadata: metadata, + retry_policy: @config.rpcs.get_operation.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @operations_stub.call_rpc :get_operation, request, options: options do |response, operation| + response = ::Gapic::Operation.new response, @operations_client, options: options + yield response, operation if block_given? + throw :response, response + end + rescue ::GRPC::BadStatus => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Deletes a long-running operation. This method indicates that the client is + # no longer interested in the operation result. It does not cancel the + # operation. If the server doesn't support this method, it returns + # `google.rpc.Code.UNIMPLEMENTED`. + # + # @overload delete_operation(request, options = nil) + # Pass arguments to `delete_operation` via a request object, either of type + # {::Google::Longrunning::DeleteOperationRequest} or an equivalent Hash. + # + # @param request [::Google::Longrunning::DeleteOperationRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. + # + # @overload delete_operation(name: nil) + # Pass arguments to `delete_operation` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param name [::String] + # The name of the operation resource to be deleted. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Google::Protobuf::Empty] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Google::Protobuf::Empty] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/longrunning" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Longrunning::Operations::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Longrunning::DeleteOperationRequest.new + # + # # Call the delete_operation method. + # result = client.delete_operation request + # + # # The returned object is of type Google::Protobuf::Empty. + # p result + # + def delete_operation request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Longrunning::DeleteOperationRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + metadata = @config.rpcs.delete_operation.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::Retail::V2::VERSION + metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.name + header_params["name"] = request.name + end + + request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") + metadata[:"x-goog-request-params"] ||= request_params_header + + options.apply_defaults timeout: @config.rpcs.delete_operation.timeout, + metadata: metadata, + retry_policy: @config.rpcs.delete_operation.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @operations_stub.call_rpc :delete_operation, request, options: options do |response, operation| + yield response, operation if block_given? + end + rescue ::GRPC::BadStatus => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Starts asynchronous cancellation on a long-running operation. The server + # makes a best effort to cancel the operation, but success is not + # guaranteed. If the server doesn't support this method, it returns + # `google.rpc.Code.UNIMPLEMENTED`. Clients can use + # Operations.GetOperation or + # other methods to check whether the cancellation succeeded or whether the + # operation completed despite cancellation. On successful cancellation, + # the operation is not deleted; instead, it becomes an operation with + # an {::Google::Longrunning::Operation#error Operation.error} value with a + # {::Google::Rpc::Status#code google.rpc.Status.code} of `1`, corresponding to + # `Code.CANCELLED`. + # + # @overload cancel_operation(request, options = nil) + # Pass arguments to `cancel_operation` via a request object, either of type + # {::Google::Longrunning::CancelOperationRequest} or an equivalent Hash. + # + # @param request [::Google::Longrunning::CancelOperationRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. + # + # @overload cancel_operation(name: nil) + # Pass arguments to `cancel_operation` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param name [::String] + # The name of the operation resource to be cancelled. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Google::Protobuf::Empty] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Google::Protobuf::Empty] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/longrunning" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Longrunning::Operations::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Longrunning::CancelOperationRequest.new + # + # # Call the cancel_operation method. + # result = client.cancel_operation request + # + # # The returned object is of type Google::Protobuf::Empty. + # p result + # + def cancel_operation request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Longrunning::CancelOperationRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + metadata = @config.rpcs.cancel_operation.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::Retail::V2::VERSION + metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.name + header_params["name"] = request.name + end + + request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") + metadata[:"x-goog-request-params"] ||= request_params_header + + options.apply_defaults timeout: @config.rpcs.cancel_operation.timeout, + metadata: metadata, + retry_policy: @config.rpcs.cancel_operation.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @operations_stub.call_rpc :cancel_operation, request, options: options do |response, operation| + yield response, operation if block_given? + end + rescue ::GRPC::BadStatus => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Waits until the specified long-running operation is done or reaches at most + # a specified timeout, returning the latest state. If the operation is + # already done, the latest state is immediately returned. If the timeout + # specified is greater than the default HTTP/RPC timeout, the HTTP/RPC + # timeout is used. If the server does not support this method, it returns + # `google.rpc.Code.UNIMPLEMENTED`. + # Note that this method is on a best-effort basis. It may return the latest + # state before the specified timeout (including immediately), meaning even an + # immediate response is no guarantee that the operation is done. + # + # @overload wait_operation(request, options = nil) + # Pass arguments to `wait_operation` via a request object, either of type + # {::Google::Longrunning::WaitOperationRequest} or an equivalent Hash. + # + # @param request [::Google::Longrunning::WaitOperationRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. + # + # @overload wait_operation(name: nil, timeout: nil) + # Pass arguments to `wait_operation` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param name [::String] + # The name of the operation resource to wait on. + # @param timeout [::Google::Protobuf::Duration, ::Hash] + # The maximum duration to wait before timing out. If left blank, the wait + # will be at most the time permitted by the underlying HTTP/RPC protocol. + # If RPC context deadline is also specified, the shorter one will be used. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Gapic::Operation] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Gapic::Operation] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/longrunning" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Longrunning::Operations::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Longrunning::WaitOperationRequest.new + # + # # Call the wait_operation method. + # result = client.wait_operation request + # + # # The returned object is of type Gapic::Operation. You can use it to + # # check the status of an operation, cancel it, or wait for results. + # # Here is how to wait for a response. + # result.wait_until_done! timeout: 60 + # if result.response? + # p result.response + # else + # puts "No response received." + # end + # + def wait_operation request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Longrunning::WaitOperationRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + metadata = @config.rpcs.wait_operation.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::Retail::V2::VERSION + metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + options.apply_defaults timeout: @config.rpcs.wait_operation.timeout, + metadata: metadata, + retry_policy: @config.rpcs.wait_operation.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @operations_stub.call_rpc :wait_operation, request, options: options do |response, operation| + response = ::Gapic::Operation.new response, @operations_client, options: options + yield response, operation if block_given? + throw :response, response + end + rescue ::GRPC::BadStatus => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Configuration class for the Operations API. + # + # This class represents the configuration for Operations, + # providing control over timeouts, retry behavior, logging, transport + # parameters, and other low-level controls. Certain parameters can also be + # applied individually to specific RPCs. See + # {::Google::Longrunning::Operations::Client::Configuration::Rpcs} + # for a list of RPCs that can be configured independently. + # + # Configuration can be applied globally to all clients, or to a single client + # on construction. + # + # @example + # + # # Modify the global config, setting the timeout for + # # list_operations to 20 seconds, + # # and all remaining timeouts to 10 seconds. + # ::Google::Longrunning::Operations::Client.configure do |config| + # config.timeout = 10.0 + # config.rpcs.list_operations.timeout = 20.0 + # end + # + # # Apply the above configuration only to a new client. + # client = ::Google::Longrunning::Operations::Client.new do |config| + # config.timeout = 10.0 + # config.rpcs.list_operations.timeout = 20.0 + # end + # + # @!attribute [rw] endpoint + # A custom service endpoint, as a hostname or hostname:port. The default is + # nil, indicating to use the default endpoint in the current universe domain. + # @return [::String,nil] + # @!attribute [rw] credentials + # Credentials to send with calls. You may provide any of the following types: + # * (`Google::Auth::Credentials`) A googleauth credentials object + # (see the [googleauth docs](https://rubydoc.info/gems/googleauth/Google/Auth/Credentials)) + # * (`Signet::OAuth2::Client`) A signet oauth2 client object + # (see the [signet docs](https://rubydoc.info/gems/signet/Signet/OAuth2/Client)) + # * (`GRPC::Core::Channel`) a gRPC channel with included credentials + # * (`GRPC::Core::ChannelCredentials`) a gRPC credentails object + # * (`nil`) indicating no credentials + # + # @note Warning: Passing a `String` to a keyfile path or a `Hash` of credentials + # is deprecated. Providing an unvalidated credential configuration to + # Google APIs can compromise the security of your systems and data. + # + # @example + # + # # The recommended way to provide credentials is to use the `make_creds` method + # # on the appropriate credentials class for your environment. + # + # require "googleauth" + # + # credentials = ::Google::Auth::ServiceAccountCredentials.make_creds( + # json_key_io: ::File.open("/path/to/keyfile.json") + # ) + # + # client = ::Google::Longrunning::Operations::Client.new do |config| + # config.credentials = credentials + # end + # + # @note Warning: If you accept a credential configuration (JSON file or Hash) from an + # external source for authentication to Google Cloud, you must validate it before + # providing it to a Google API client library. Providing an unvalidated credential + # configuration to Google APIs can compromise the security of your systems and data. + # For more information, refer to [Validate credential configurations from external + # sources](https://cloud.google.com/docs/authentication/external/externally-sourced-credentials). + # @return [::Object] + # @!attribute [rw] scope + # The OAuth scopes + # @return [::Array<::String>] + # @!attribute [rw] lib_name + # The library name as recorded in instrumentation and logging + # @return [::String] + # @!attribute [rw] lib_version + # The library version as recorded in instrumentation and logging + # @return [::String] + # @!attribute [rw] channel_args + # Extra parameters passed to the gRPC channel. Note: this is ignored if a + # `GRPC::Core::Channel` object is provided as the credential. + # @return [::Hash] + # @!attribute [rw] interceptors + # An array of interceptors that are run before calls are executed. + # @return [::Array<::GRPC::ClientInterceptor>] + # @!attribute [rw] timeout + # The call timeout in seconds. + # @return [::Numeric] + # @!attribute [rw] metadata + # Additional gRPC headers to be sent with the call. + # @return [::Hash{::Symbol=>::String}] + # @!attribute [rw] retry_policy + # The retry policy. The value is a hash with the following keys: + # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds. + # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds. + # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier. + # * `:retry_codes` (*type:* `Array`) - The error codes that should + # trigger a retry. + # @return [::Hash] + # @!attribute [rw] quota_project + # A separate project against which to charge quota. + # @return [::String] + # @!attribute [rw] universe_domain + # The universe domain within which to make requests. This determines the + # default endpoint URL. The default value of nil uses the environment + # universe (usually the default "googleapis.com" universe). + # @return [::String,nil] + # @!attribute [rw] logger + # A custom logger to use for request/response debug logging, or the value + # `:default` (the default) to construct a default logger, or `nil` to + # explicitly disable logging. + # @return [::Logger,:default,nil] + # + class Configuration + extend ::Gapic::Config + + # @private + # The endpoint specific to the default "googleapis.com" universe. Deprecated. + DEFAULT_ENDPOINT = "retail.googleapis.com" + + config_attr :endpoint, nil, ::String, nil + config_attr :credentials, nil do |value| + allowed = [::String, ::Hash, ::Proc, ::Symbol, ::Google::Auth::Credentials, ::Google::Auth::BaseClient, ::Signet::OAuth2::Client, nil] + allowed += [::GRPC::Core::Channel, ::GRPC::Core::ChannelCredentials] if defined? ::GRPC::Core::Channel + allowed.any? { |klass| klass === value } + end + config_attr :scope, nil, ::String, ::Array, nil + config_attr :lib_name, nil, ::String, nil + config_attr :lib_version, nil, ::String, nil + config_attr(:channel_args, { "grpc.service_config_disable_resolution" => 1 }, ::Hash, nil) + config_attr :interceptors, nil, ::Array, nil + config_attr :timeout, nil, ::Numeric, nil + config_attr :metadata, nil, ::Hash, nil + config_attr :retry_policy, nil, ::Hash, ::Proc, nil + config_attr :quota_project, nil, ::String, nil + config_attr :universe_domain, nil, ::String, nil + config_attr :logger, :default, ::Logger, nil, :default + + # @private + def initialize parent_config = nil + @parent_config = parent_config unless parent_config.nil? + + yield self if block_given? + end + + ## + # Configurations for individual RPCs + # @return [Rpcs] + # + def rpcs + @rpcs ||= begin + parent_rpcs = nil + parent_rpcs = @parent_config.rpcs if defined?(@parent_config) && @parent_config.respond_to?(:rpcs) + Rpcs.new parent_rpcs + end + end + + ## + # Configuration for the channel pool + # @return [::Gapic::ServiceStub::ChannelPool::Configuration] + # + def channel_pool + @channel_pool ||= ::Gapic::ServiceStub::ChannelPool::Configuration.new + end + + ## + # Configuration RPC class for the Operations API. + # + # Includes fields providing the configuration for each RPC in this service. + # Each configuration object is of type `Gapic::Config::Method` and includes + # the following configuration fields: + # + # * `timeout` (*type:* `Numeric`) - The call timeout in seconds + # * `metadata` (*type:* `Hash{Symbol=>String}`) - Additional gRPC headers + # * `retry_policy (*type:* `Hash`) - The retry policy. The policy fields + # include the following keys: + # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds. + # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds. + # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier. + # * `:retry_codes` (*type:* `Array`) - The error codes that should + # trigger a retry. + # + class Rpcs + ## + # RPC-specific configuration for `list_operations` + # @return [::Gapic::Config::Method] + # + attr_reader :list_operations + ## + # RPC-specific configuration for `get_operation` + # @return [::Gapic::Config::Method] + # + attr_reader :get_operation + ## + # RPC-specific configuration for `delete_operation` + # @return [::Gapic::Config::Method] + # + attr_reader :delete_operation + ## + # RPC-specific configuration for `cancel_operation` + # @return [::Gapic::Config::Method] + # + attr_reader :cancel_operation + ## + # RPC-specific configuration for `wait_operation` + # @return [::Gapic::Config::Method] + # + attr_reader :wait_operation + + # @private + def initialize parent_rpcs = nil + list_operations_config = parent_rpcs.list_operations if parent_rpcs.respond_to? :list_operations + @list_operations = ::Gapic::Config::Method.new list_operations_config + get_operation_config = parent_rpcs.get_operation if parent_rpcs.respond_to? :get_operation + @get_operation = ::Gapic::Config::Method.new get_operation_config + delete_operation_config = parent_rpcs.delete_operation if parent_rpcs.respond_to? :delete_operation + @delete_operation = ::Gapic::Config::Method.new delete_operation_config + cancel_operation_config = parent_rpcs.cancel_operation if parent_rpcs.respond_to? :cancel_operation + @cancel_operation = ::Gapic::Config::Method.new cancel_operation_config + wait_operation_config = parent_rpcs.wait_operation if parent_rpcs.respond_to? :wait_operation + @wait_operation = ::Gapic::Config::Method.new wait_operation_config + + yield self if block_given? + end + end + end + end + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-retail-v2/lib/google/cloud/retail/v2/completion_service/paths.rb b/owl-bot-staging/google-cloud-retail-v2/lib/google/cloud/retail/v2/completion_service/paths.rb new file mode 100644 index 000000000000..600b86ed9a0d --- /dev/null +++ b/owl-bot-staging/google-cloud-retail-v2/lib/google/cloud/retail/v2/completion_service/paths.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! + + +module Google + module Cloud + module Retail + module V2 + module CompletionService + # Path helper methods for the CompletionService API. + module Paths + ## + # Create a fully-qualified Catalog resource string. + # + # The resource will be in the following format: + # + # `projects/{project}/locations/{location}/catalogs/{catalog}` + # + # @param project [String] + # @param location [String] + # @param catalog [String] + # + # @return [::String] + def catalog_path project:, location:, catalog: + raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" + raise ::ArgumentError, "location cannot contain /" if location.to_s.include? "/" + + "projects/#{project}/locations/#{location}/catalogs/#{catalog}" + end + + extend self + end + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-retail-v2/lib/google/cloud/retail/v2/completion_service/rest.rb b/owl-bot-staging/google-cloud-retail-v2/lib/google/cloud/retail/v2/completion_service/rest.rb new file mode 100644 index 000000000000..1cf8247a53be --- /dev/null +++ b/owl-bot-staging/google-cloud-retail-v2/lib/google/cloud/retail/v2/completion_service/rest.rb @@ -0,0 +1,56 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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/retail/v2/version" + +require "google/cloud/retail/v2/completion_service/credentials" +require "google/cloud/retail/v2/completion_service/paths" +require "google/cloud/retail/v2/completion_service/rest/operations" +require "google/cloud/retail/v2/completion_service/rest/client" + +module Google + module Cloud + module Retail + module V2 + ## + # Autocomplete service for retail. + # + # This feature is only available for users who have Retail Search enabled. + # Enable Retail Search on Cloud Console before using this feature. + # + # To load this service and instantiate a REST client: + # + # require "google/cloud/retail/v2/completion_service/rest" + # client = ::Google::Cloud::Retail::V2::CompletionService::Rest::Client.new + # + module CompletionService + # Client for the REST transport + module Rest + end + end + end + end + end +end + +helper_path = ::File.join __dir__, "rest", "helpers.rb" +require "google/cloud/retail/v2/completion_service/rest/helpers" if ::File.file? helper_path diff --git a/owl-bot-staging/google-cloud-retail-v2/lib/google/cloud/retail/v2/completion_service/rest/client.rb b/owl-bot-staging/google-cloud-retail-v2/lib/google/cloud/retail/v2/completion_service/rest/client.rb new file mode 100644 index 000000000000..cd346f670de0 --- /dev/null +++ b/owl-bot-staging/google-cloud-retail-v2/lib/google/cloud/retail/v2/completion_service/rest/client.rb @@ -0,0 +1,657 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +require "google/cloud/errors" +require "google/cloud/retail/v2/completion_service_pb" +require "google/cloud/retail/v2/completion_service/rest/service_stub" +require "google/cloud/location/rest" + +module Google + module Cloud + module Retail + module V2 + module CompletionService + module Rest + ## + # REST client for the CompletionService service. + # + # Autocomplete service for retail. + # + # This feature is only available for users who have Retail Search enabled. + # Enable Retail Search on Cloud Console before using this feature. + # + class Client + # @private + API_VERSION = "" + + # @private + DEFAULT_ENDPOINT_TEMPLATE = "retail.$UNIVERSE_DOMAIN$" + + include Paths + + # @private + attr_reader :completion_service_stub + + ## + # Configure the CompletionService Client class. + # + # See {::Google::Cloud::Retail::V2::CompletionService::Rest::Client::Configuration} + # for a description of the configuration fields. + # + # @example + # + # # Modify the configuration for all CompletionService clients + # ::Google::Cloud::Retail::V2::CompletionService::Rest::Client.configure do |config| + # config.timeout = 10.0 + # end + # + # @yield [config] Configure the Client client. + # @yieldparam config [Client::Configuration] + # + # @return [Client::Configuration] + # + def self.configure + @configure ||= begin + namespace = ["Google", "Cloud", "Retail", "V2"] + parent_config = while namespace.any? + parent_name = namespace.join "::" + parent_const = const_get parent_name + break parent_const.configure if parent_const.respond_to? :configure + namespace.pop + end + default_config = Client::Configuration.new parent_config + + default_config.timeout = 5.0 + default_config.retry_policy = { + initial_delay: 0.1, max_delay: 5.0, multiplier: 1.3, retry_codes: [14, 4] + } + + default_config + end + yield @configure if block_given? + @configure + end + + ## + # Configure the CompletionService Client instance. + # + # The configuration is set to the derived mode, meaning that values can be changed, + # but structural changes (adding new fields, etc.) are not allowed. Structural changes + # should be made on {Client.configure}. + # + # See {::Google::Cloud::Retail::V2::CompletionService::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 + @completion_service_stub.universe_domain + end + + ## + # Create a new CompletionService REST client object. + # + # @example + # + # # Create a client using the default configuration + # client = ::Google::Cloud::Retail::V2::CompletionService::Rest::Client.new + # + # # Create a client using a custom configuration + # client = ::Google::Cloud::Retail::V2::CompletionService::Rest::Client.new do |config| + # config.timeout = 10.0 + # end + # + # @yield [config] Configure the CompletionService client. + # @yieldparam config [Client::Configuration] + # + def initialize + # Create the configuration object + @config = Configuration.new Client.configure + + # Yield the configuration if needed + yield @config if block_given? + + # Create credentials + credentials = @config.credentials + # Use self-signed JWT if the endpoint is unchanged from default, + # but only if the default endpoint does not have a region prefix. + enable_self_signed_jwt = @config.endpoint.nil? || + (@config.endpoint == Configuration::DEFAULT_ENDPOINT && + !@config.endpoint.split(".").first.include?("-")) + credentials ||= Credentials.default scope: @config.scope, + enable_self_signed_jwt: enable_self_signed_jwt + if credentials.is_a?(::String) || credentials.is_a?(::Hash) + credentials = Credentials.new credentials, scope: @config.scope + end + + @quota_project_id = @config.quota_project + @quota_project_id ||= credentials.quota_project_id if credentials.respond_to? :quota_project_id + + @operations_client = ::Google::Cloud::Retail::V2::CompletionService::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 + + @completion_service_stub = ::Google::Cloud::Retail::V2::CompletionService::Rest::ServiceStub.new( + endpoint: @config.endpoint, + endpoint_template: DEFAULT_ENDPOINT_TEMPLATE, + universe_domain: @config.universe_domain, + credentials: credentials, + logger: @config.logger + ) + + @completion_service_stub.logger(stub: true)&.info do |entry| + entry.set_system_name + entry.set_service + entry.message = "Created client for #{entry.service}" + entry.set_credentials_fields credentials + entry.set "customEndpoint", @config.endpoint if @config.endpoint + entry.set "defaultTimeout", @config.timeout if @config.timeout + entry.set "quotaProject", @quota_project_id if @quota_project_id + end + + @location_client = Google::Cloud::Location::Locations::Rest::Client.new do |config| + config.credentials = credentials + config.quota_project = @quota_project_id + config.endpoint = @completion_service_stub.endpoint + config.universe_domain = @completion_service_stub.universe_domain + config.logger = @completion_service_stub.logger if config.respond_to? :logger= + end + end + + ## + # Get the associated client for long-running operations. + # + # @return [::Google::Cloud::Retail::V2::CompletionService::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 + @completion_service_stub.logger + end + + # Service calls + + ## + # Completes the specified prefix with keyword suggestions. + # + # This feature is only available for users who have Retail Search enabled. + # Enable Retail Search on Cloud Console before using this feature. + # + # @overload complete_query(request, options = nil) + # Pass arguments to `complete_query` via a request object, either of type + # {::Google::Cloud::Retail::V2::CompleteQueryRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Retail::V2::CompleteQueryRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @overload complete_query(catalog: nil, query: nil, visitor_id: nil, language_codes: nil, device_type: nil, dataset: nil, max_suggestions: nil, enable_attribute_suggestions: nil, entity: nil) + # Pass arguments to `complete_query` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param catalog [::String] + # Required. Catalog for which the completion is performed. + # + # Full resource name of catalog, such as + # `projects/*/locations/global/catalogs/default_catalog`. + # @param query [::String] + # Required. The query used to generate suggestions. + # + # The maximum number of allowed characters is 255. + # @param visitor_id [::String] + # Recommended field. A unique identifier for tracking visitors. For example, + # this could be implemented with an HTTP cookie, which should be able to + # uniquely identify a visitor on a single device. This unique identifier + # should not change if the visitor logs in or out of the website. + # + # The field must be a UTF-8 encoded string with a length limit of 128 + # characters. Otherwise, an INVALID_ARGUMENT error is returned. + # @param language_codes [::Array<::String>] + # Note that this field applies for `user-data` dataset only. For requests + # with `cloud-retail` dataset, setting this field has no effect. + # + # The language filters applied to the output suggestions. If set, it should + # contain the language of the query. If not set, suggestions are returned + # without considering language restrictions. This is the BCP-47 language + # code, such as "en-US" or "sr-Latn". For more information, see [Tags for + # Identifying Languages](https://tools.ietf.org/html/bcp47). The maximum + # number of language codes is 3. + # @param device_type [::String] + # The device type context for completion suggestions. We recommend that you + # leave this field empty. + # + # It can apply different suggestions on different device types, e.g. + # `DESKTOP`, `MOBILE`. If it is empty, the suggestions are across all device + # types. + # + # Supported formats: + # + # * `UNKNOWN_DEVICE_TYPE` + # + # * `DESKTOP` + # + # * `MOBILE` + # + # * A customized string starts with `OTHER_`, e.g. `OTHER_IPHONE`. + # @param dataset [::String] + # Determines which dataset to use for fetching completion. "user-data" will + # use the dataset imported through + # {::Google::Cloud::Retail::V2::CompletionService::Rest::Client#import_completion_data CompletionService.ImportCompletionData}. + # `cloud-retail` will use the dataset generated by Cloud Retail based on user + # events. If left empty, completions will be fetched from the `user-data` + # dataset. + # + # Current supported values: + # + # * user-data + # + # * cloud-retail: + # This option requires enabling auto-learning function first. See + # [guidelines](https://cloud.google.com/retail/docs/completion-overview#generated-completion-dataset). + # @param max_suggestions [::Integer] + # Completion max suggestions. If left unset or set to 0, then will fallback + # to the configured value + # {::Google::Cloud::Retail::V2::CompletionConfig#max_suggestions CompletionConfig.max_suggestions}. + # + # The maximum allowed max suggestions is 20. If it is set higher, it will be + # capped by 20. + # @param enable_attribute_suggestions [::Boolean] + # If true, attribute suggestions are enabled and provided in the response. + # + # This field is only available for the `cloud-retail` dataset. + # @param entity [::String] + # The entity for customers who run multiple entities, domains, sites, or + # regions, for example, `Google US`, `Google Ads`, `Waymo`, + # `google.com`, `youtube.com`, etc. + # If this is set, it must be an exact match with + # {::Google::Cloud::Retail::V2::UserEvent#entity UserEvent.entity} to get + # per-entity autocomplete results. This field will be applied to + # `completion_results` only. It has no effect on the `attribute_results`. + # Also, this entity should be limited to 256 characters, if too long, it will + # be truncated to 256 characters in both generation and serving time, and may + # lead to mis-match. To ensure it works, please set the entity with string + # within 256 characters. + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Cloud::Retail::V2::CompleteQueryResponse] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::Retail::V2::CompleteQueryResponse] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/retail/v2" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Retail::V2::CompletionService::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Retail::V2::CompleteQueryRequest.new + # + # # Call the complete_query method. + # result = client.complete_query request + # + # # The returned object is of type Google::Cloud::Retail::V2::CompleteQueryResponse. + # p result + # + def complete_query request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Retail::V2::CompleteQueryRequest + + # Converts hash 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.complete_query.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::Retail::V2::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + options.apply_defaults timeout: @config.rpcs.complete_query.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.complete_query.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @completion_service_stub.complete_query 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 + + ## + # Bulk import of processed completion dataset. + # + # Request processing is asynchronous. Partial updating is not supported. + # + # The operation is successfully finished only after the imported suggestions + # are indexed successfully and ready for serving. The process takes hours. + # + # This feature is only available for users who have Retail Search enabled. + # Enable Retail Search on Cloud Console before using this feature. + # + # @overload import_completion_data(request, options = nil) + # Pass arguments to `import_completion_data` via a request object, either of type + # {::Google::Cloud::Retail::V2::ImportCompletionDataRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Retail::V2::ImportCompletionDataRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @overload import_completion_data(parent: nil, input_config: nil, notification_pubsub_topic: nil) + # Pass arguments to `import_completion_data` via keyword arguments. Note that at + # least one keyword argument is 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 catalog which the suggestions dataset belongs to. + # + # Format: `projects/1234/locations/global/catalogs/default_catalog`. + # @param input_config [::Google::Cloud::Retail::V2::CompletionDataInputConfig, ::Hash] + # Required. The desired input location of the data. + # @param notification_pubsub_topic [::String] + # Pub/Sub topic for receiving notification. If this field is set, + # when the import is finished, a notification is sent to + # specified Pub/Sub topic. The message data is JSON string of a + # {::Google::Longrunning::Operation Operation}. + # Format of the Pub/Sub topic is `projects/{project}/topics/{topic}`. + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Gapic::Operation] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Gapic::Operation] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/retail/v2" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Retail::V2::CompletionService::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Retail::V2::ImportCompletionDataRequest.new + # + # # Call the import_completion_data method. + # result = client.import_completion_data 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 import_completion_data request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Retail::V2::ImportCompletionDataRequest + + # Converts hash 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.import_completion_data.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::Retail::V2::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + options.apply_defaults timeout: @config.rpcs.import_completion_data.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.import_completion_data.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @completion_service_stub.import_completion_data 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 + + ## + # Configuration class for the CompletionService REST API. + # + # This class represents the configuration for CompletionService REST, + # providing control over timeouts, retry behavior, logging, transport + # parameters, and other low-level controls. Certain parameters can also be + # applied individually to specific RPCs. See + # {::Google::Cloud::Retail::V2::CompletionService::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 + # # complete_query to 20 seconds, + # # and all remaining timeouts to 10 seconds. + # ::Google::Cloud::Retail::V2::CompletionService::Rest::Client.configure do |config| + # config.timeout = 10.0 + # config.rpcs.complete_query.timeout = 20.0 + # end + # + # # Apply the above configuration only to a new client. + # client = ::Google::Cloud::Retail::V2::CompletionService::Rest::Client.new do |config| + # config.timeout = 10.0 + # config.rpcs.complete_query.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 = "retail.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 CompletionService 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 `complete_query` + # @return [::Gapic::Config::Method] + # + attr_reader :complete_query + ## + # RPC-specific configuration for `import_completion_data` + # @return [::Gapic::Config::Method] + # + attr_reader :import_completion_data + + # @private + def initialize parent_rpcs = nil + complete_query_config = parent_rpcs.complete_query if parent_rpcs.respond_to? :complete_query + @complete_query = ::Gapic::Config::Method.new complete_query_config + import_completion_data_config = parent_rpcs.import_completion_data if parent_rpcs.respond_to? :import_completion_data + @import_completion_data = ::Gapic::Config::Method.new import_completion_data_config + + yield self if block_given? + end + end + end + end + end + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-retail-v2/lib/google/cloud/retail/v2/completion_service/rest/operations.rb b/owl-bot-staging/google-cloud-retail-v2/lib/google/cloud/retail/v2/completion_service/rest/operations.rb new file mode 100644 index 000000000000..09106f92ce9f --- /dev/null +++ b/owl-bot-staging/google-cloud-retail-v2/lib/google/cloud/retail/v2/completion_service/rest/operations.rb @@ -0,0 +1,960 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +require "gapic/operation" + +module Google + module Cloud + module Retail + module V2 + module CompletionService + module Rest + # Service that implements Longrunning Operations API. + class Operations + # @private + API_VERSION = "" + + # @private + DEFAULT_ENDPOINT_TEMPLATE = "retail.$UNIVERSE_DOMAIN$" + + # @private + attr_reader :operations_stub + + ## + # Configuration for the CompletionService 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 CompletionService 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::Retail::V2::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + options.apply_defaults timeout: @config.rpcs.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::Retail::V2::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + options.apply_defaults timeout: @config.rpcs.get_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::Retail::V2::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + options.apply_defaults timeout: @config.rpcs.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::Retail::V2::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + options.apply_defaults timeout: @config.rpcs.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 = "retail.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: "/v2/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v2/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/catalogs/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v2/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/?$}, 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: "/v2/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v2/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/catalogs/[^/]+/branches/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v2/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/catalogs/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v2/{name}", + matches: [ + ["name", %r{^projects/[^/]+/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 +end diff --git a/owl-bot-staging/google-cloud-retail-v2/lib/google/cloud/retail/v2/completion_service/rest/service_stub.rb b/owl-bot-staging/google-cloud-retail-v2/lib/google/cloud/retail/v2/completion_service/rest/service_stub.rb new file mode 100644 index 000000000000..31957d90f097 --- /dev/null +++ b/owl-bot-staging/google-cloud-retail-v2/lib/google/cloud/retail/v2/completion_service/rest/service_stub.rb @@ -0,0 +1,204 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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/retail/v2/completion_service_pb" + +module Google + module Cloud + module Retail + module V2 + module CompletionService + module Rest + ## + # REST service stub for the CompletionService 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 complete_query REST call + # + # @param request_pb [::Google::Cloud::Retail::V2::CompleteQueryRequest] + # A request object representing the call parameters. Required. + # @param options [::Gapic::CallOptions] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Cloud::Retail::V2::CompleteQueryResponse] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::Retail::V2::CompleteQueryResponse] + # A result object deserialized from the server's reply + def complete_query request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_complete_query_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: "complete_query", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Cloud::Retail::V2::CompleteQueryResponse.decode_json response.body, ignore_unknown_fields: true + catch :response do + yield result, operation if block_given? + result + end + end + + ## + # Baseline implementation for the import_completion_data REST call + # + # @param request_pb [::Google::Cloud::Retail::V2::ImportCompletionDataRequest] + # 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 import_completion_data request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_import_completion_data_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: "import_completion_data", + 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 + + ## + # @private + # + # GRPC transcoding helper method for the complete_query REST call + # + # @param request_pb [::Google::Cloud::Retail::V2::CompleteQueryRequest] + # A request object representing the call parameters. Required. + # @return [Array(String, [String, nil], Hash{String => String})] + # Uri, Body, Query string parameters + def self.transcode_complete_query_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :get, + uri_template: "/v2/{catalog}:completeQuery", + matches: [ + ["catalog", %r{^projects/[^/]+/locations/[^/]+/catalogs/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the import_completion_data REST call + # + # @param request_pb [::Google::Cloud::Retail::V2::ImportCompletionDataRequest] + # A request object representing the call parameters. Required. + # @return [Array(String, [String, nil], Hash{String => String})] + # Uri, Body, Query string parameters + def self.transcode_import_completion_data_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :post, + uri_template: "/v2/{parent}/completionData:import", + body: "*", + matches: [ + ["parent", %r{^projects/[^/]+/locations/[^/]+/catalogs/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + end + end + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-retail-v2/lib/google/cloud/retail/v2/completion_service_pb.rb b/owl-bot-staging/google-cloud-retail-v2/lib/google/cloud/retail/v2/completion_service_pb.rb new file mode 100644 index 000000000000..6f2a2a1fdade --- /dev/null +++ b/owl-bot-staging/google-cloud-retail-v2/lib/google/cloud/retail/v2/completion_service_pb.rb @@ -0,0 +1,33 @@ +# frozen_string_literal: true +# Generated by the protocol buffer compiler. DO NOT EDIT! +# source: google/cloud/retail/v2/completion_service.proto + +require 'google/protobuf' + +require 'google/api/annotations_pb' +require 'google/api/client_pb' +require 'google/api/field_behavior_pb' +require 'google/api/resource_pb' +require 'google/cloud/retail/v2/common_pb' +require 'google/cloud/retail/v2/import_config_pb' +require 'google/longrunning/operations_pb' + + +descriptor_data = "\n/google/cloud/retail/v2/completion_service.proto\x12\x16google.cloud.retail.v2\x1a\x1cgoogle/api/annotations.proto\x1a\x17google/api/client.proto\x1a\x1fgoogle/api/field_behavior.proto\x1a\x19google/api/resource.proto\x1a#google/cloud/retail/v2/common.proto\x1a*google/cloud/retail/v2/import_config.proto\x1a#google/longrunning/operations.proto\"\x83\x02\n\x14\x43ompleteQueryRequest\x12\x36\n\x07\x63\x61talog\x18\x01 \x01(\tB%\xe0\x41\x02\xfa\x41\x1f\n\x1dretail.googleapis.com/Catalog\x12\x12\n\x05query\x18\x02 \x01(\tB\x03\xe0\x41\x02\x12\x12\n\nvisitor_id\x18\x07 \x01(\t\x12\x16\n\x0elanguage_codes\x18\x03 \x03(\t\x12\x13\n\x0b\x64\x65vice_type\x18\x04 \x01(\t\x12\x0f\n\x07\x64\x61taset\x18\x06 \x01(\t\x12\x17\n\x0fmax_suggestions\x18\x05 \x01(\x05\x12$\n\x1c\x65nable_attribute_suggestions\x18\t \x01(\x08\x12\x0e\n\x06\x65ntity\x18\n \x01(\t\"\x8d\x06\n\x15\x43ompleteQueryResponse\x12Z\n\x12\x63ompletion_results\x18\x01 \x03(\x0b\x32>.google.cloud.retail.v2.CompleteQueryResponse.CompletionResult\x12\x19\n\x11\x61ttribution_token\x18\x02 \x01(\t\x12\x63\n\x15recent_search_results\x18\x03 \x03(\x0b\x32@.google.cloud.retail.v2.CompleteQueryResponse.RecentSearchResultB\x02\x18\x01\x12^\n\x11\x61ttribute_results\x18\x04 \x03(\x0b\x32\x43.google.cloud.retail.v2.CompleteQueryResponse.AttributeResultsEntry\x1a\xe6\x01\n\x10\x43ompletionResult\x12\x12\n\nsuggestion\x18\x01 \x01(\t\x12\x62\n\nattributes\x18\x02 \x03(\x0b\x32N.google.cloud.retail.v2.CompleteQueryResponse.CompletionResult.AttributesEntry\x1aZ\n\x0f\x41ttributesEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12\x36\n\x05value\x18\x02 \x01(\x0b\x32\'.google.cloud.retail.v2.CustomAttribute:\x02\x38\x01\x1a/\n\x12RecentSearchResult\x12\x15\n\rrecent_search\x18\x01 \x01(\t:\x02\x18\x01\x1a&\n\x0f\x41ttributeResult\x12\x13\n\x0bsuggestions\x18\x01 \x03(\t\x1av\n\x15\x41ttributeResultsEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12L\n\x05value\x18\x02 \x01(\x0b\x32=.google.cloud.retail.v2.CompleteQueryResponse.AttributeResult:\x02\x38\x01\x32\xb2\x04\n\x11\x43ompletionService\x12\xb3\x01\n\rCompleteQuery\x12,.google.cloud.retail.v2.CompleteQueryRequest\x1a-.google.cloud.retail.v2.CompleteQueryResponse\"E\x82\xd3\xe4\x93\x02?\x12=/v2/{catalog=projects/*/locations/*/catalogs/*}:completeQuery\x12\x9b\x02\n\x14ImportCompletionData\x12\x33.google.cloud.retail.v2.ImportCompletionDataRequest\x1a\x1d.google.longrunning.Operation\"\xae\x01\xca\x41\\\n3google.cloud.retail.v2.ImportCompletionDataResponse\x12%google.cloud.retail.v2.ImportMetadata\x82\xd3\xe4\x93\x02I\"D/v2/{parent=projects/*/locations/*/catalogs/*}/completionData:import:\x01*\x1aI\xca\x41\x15retail.googleapis.com\xd2\x41.https://www.googleapis.com/auth/cloud-platformB\xc1\x01\n\x1a\x63om.google.cloud.retail.v2B\x16\x43ompletionServiceProtoP\x01Z2cloud.google.com/go/retail/apiv2/retailpb;retailpb\xa2\x02\x06RETAIL\xaa\x02\x16Google.Cloud.Retail.V2\xca\x02\x16Google\\Cloud\\Retail\\V2\xea\x02\x19Google::Cloud::Retail::V2b\x06proto3" + +pool = ::Google::Protobuf::DescriptorPool.generated_pool +pool.add_serialized_file(descriptor_data) + +module Google + module Cloud + module Retail + module V2 + CompleteQueryRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.retail.v2.CompleteQueryRequest").msgclass + CompleteQueryResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.retail.v2.CompleteQueryResponse").msgclass + CompleteQueryResponse::CompletionResult = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.retail.v2.CompleteQueryResponse.CompletionResult").msgclass + CompleteQueryResponse::RecentSearchResult = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.retail.v2.CompleteQueryResponse.RecentSearchResult").msgclass + CompleteQueryResponse::AttributeResult = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.retail.v2.CompleteQueryResponse.AttributeResult").msgclass + end + end + end +end diff --git a/owl-bot-staging/google-cloud-retail-v2/lib/google/cloud/retail/v2/completion_service_services_pb.rb b/owl-bot-staging/google-cloud-retail-v2/lib/google/cloud/retail/v2/completion_service_services_pb.rb new file mode 100644 index 000000000000..64e7fdaa4af5 --- /dev/null +++ b/owl-bot-staging/google-cloud-retail-v2/lib/google/cloud/retail/v2/completion_service_services_pb.rb @@ -0,0 +1,61 @@ +# Generated by the protocol buffer compiler. DO NOT EDIT! +# Source: google/cloud/retail/v2/completion_service.proto for package 'Google.Cloud.Retail.V2' +# Original file comments: +# 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 +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# + +require 'grpc' +require 'google/cloud/retail/v2/completion_service_pb' + +module Google + module Cloud + module Retail + module V2 + module CompletionService + # Autocomplete service for retail. + # + # This feature is only available for users who have Retail Search enabled. + # Enable Retail Search on Cloud Console before using this feature. + class Service + + include ::GRPC::GenericService + + self.marshal_class_method = :encode + self.unmarshal_class_method = :decode + self.service_name = 'google.cloud.retail.v2.CompletionService' + + # Completes the specified prefix with keyword suggestions. + # + # This feature is only available for users who have Retail Search enabled. + # Enable Retail Search on Cloud Console before using this feature. + rpc :CompleteQuery, ::Google::Cloud::Retail::V2::CompleteQueryRequest, ::Google::Cloud::Retail::V2::CompleteQueryResponse + # Bulk import of processed completion dataset. + # + # Request processing is asynchronous. Partial updating is not supported. + # + # The operation is successfully finished only after the imported suggestions + # are indexed successfully and ready for serving. The process takes hours. + # + # This feature is only available for users who have Retail Search enabled. + # Enable Retail Search on Cloud Console before using this feature. + rpc :ImportCompletionData, ::Google::Cloud::Retail::V2::ImportCompletionDataRequest, ::Google::Longrunning::Operation + end + + Stub = Service.rpc_stub_class + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-retail-v2/lib/google/cloud/retail/v2/control_pb.rb b/owl-bot-staging/google-cloud-retail-v2/lib/google/cloud/retail/v2/control_pb.rb new file mode 100644 index 000000000000..6b4f341f7d2a --- /dev/null +++ b/owl-bot-staging/google-cloud-retail-v2/lib/google/cloud/retail/v2/control_pb.rb @@ -0,0 +1,25 @@ +# frozen_string_literal: true +# Generated by the protocol buffer compiler. DO NOT EDIT! +# source: google/cloud/retail/v2/control.proto + +require 'google/protobuf' + +require 'google/api/field_behavior_pb' +require 'google/api/resource_pb' +require 'google/cloud/retail/v2/common_pb' + + +descriptor_data = "\n$google/cloud/retail/v2/control.proto\x12\x16google.cloud.retail.v2\x1a\x1fgoogle/api/field_behavior.proto\x1a\x19google/api/resource.proto\x1a#google/cloud/retail/v2/common.proto\"\xa6\x03\n\x07\x43ontrol\x12,\n\x04rule\x18\x04 \x01(\x0b\x32\x1c.google.cloud.retail.v2.RuleH\x00\x12\x11\n\x04name\x18\x01 \x01(\tB\x03\xe0\x41\x05\x12\x19\n\x0c\x64isplay_name\x18\x02 \x01(\tB\x03\xe0\x41\x02\x12*\n\x1d\x61ssociated_serving_config_ids\x18\x05 \x03(\tB\x03\xe0\x41\x03\x12\x44\n\x0esolution_types\x18\x06 \x03(\x0e\x32$.google.cloud.retail.v2.SolutionTypeB\x06\xe0\x41\x02\xe0\x41\x05\x12O\n\x18search_solution_use_case\x18\x07 \x03(\x0e\x32-.google.cloud.retail.v2.SearchSolutionUseCase:q\xea\x41n\n\x1dretail.googleapis.com/Control\x12Mprojects/{project}/locations/{location}/catalogs/{catalog}/controls/{control}B\t\n\x07\x63ontrolB\xb7\x01\n\x1a\x63om.google.cloud.retail.v2B\x0c\x43ontrolProtoP\x01Z2cloud.google.com/go/retail/apiv2/retailpb;retailpb\xa2\x02\x06RETAIL\xaa\x02\x16Google.Cloud.Retail.V2\xca\x02\x16Google\\Cloud\\Retail\\V2\xea\x02\x19Google::Cloud::Retail::V2b\x06proto3" + +pool = ::Google::Protobuf::DescriptorPool.generated_pool +pool.add_serialized_file(descriptor_data) + +module Google + module Cloud + module Retail + module V2 + Control = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.retail.v2.Control").msgclass + end + end + end +end diff --git a/owl-bot-staging/google-cloud-retail-v2/lib/google/cloud/retail/v2/control_service.rb b/owl-bot-staging/google-cloud-retail-v2/lib/google/cloud/retail/v2/control_service.rb new file mode 100644 index 000000000000..e93086f0a231 --- /dev/null +++ b/owl-bot-staging/google-cloud-retail-v2/lib/google/cloud/retail/v2/control_service.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/retail/v2/version" + +require "google/cloud/retail/v2/control_service/credentials" +require "google/cloud/retail/v2/control_service/paths" +require "google/cloud/retail/v2/control_service/client" +require "google/cloud/retail/v2/control_service/rest" + +module Google + module Cloud + module Retail + module V2 + ## + # Service for modifying Control. + # + # @example Load this service and instantiate a gRPC client + # + # require "google/cloud/retail/v2/control_service" + # client = ::Google::Cloud::Retail::V2::ControlService::Client.new + # + # @example Load this service and instantiate a REST client + # + # require "google/cloud/retail/v2/control_service/rest" + # client = ::Google::Cloud::Retail::V2::ControlService::Rest::Client.new + # + module ControlService + end + end + end + end +end + +helper_path = ::File.join __dir__, "control_service", "helpers.rb" +require "google/cloud/retail/v2/control_service/helpers" if ::File.file? helper_path diff --git a/owl-bot-staging/google-cloud-retail-v2/lib/google/cloud/retail/v2/control_service/client.rb b/owl-bot-staging/google-cloud-retail-v2/lib/google/cloud/retail/v2/control_service/client.rb new file mode 100644 index 000000000000..718eaa29f3e1 --- /dev/null +++ b/owl-bot-staging/google-cloud-retail-v2/lib/google/cloud/retail/v2/control_service/client.rb @@ -0,0 +1,909 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +require "google/cloud/errors" +require "google/cloud/retail/v2/control_service_pb" +require "google/cloud/location" + +module Google + module Cloud + module Retail + module V2 + module ControlService + ## + # Client for the ControlService service. + # + # Service for modifying Control. + # + class Client + # @private + API_VERSION = "" + + # @private + DEFAULT_ENDPOINT_TEMPLATE = "retail.$UNIVERSE_DOMAIN$" + + include Paths + + # @private + attr_reader :control_service_stub + + ## + # Configure the ControlService Client class. + # + # See {::Google::Cloud::Retail::V2::ControlService::Client::Configuration} + # for a description of the configuration fields. + # + # @example + # + # # Modify the configuration for all ControlService clients + # ::Google::Cloud::Retail::V2::ControlService::Client.configure do |config| + # config.timeout = 10.0 + # end + # + # @yield [config] Configure the Client client. + # @yieldparam config [Client::Configuration] + # + # @return [Client::Configuration] + # + def self.configure + @configure ||= begin + namespace = ["Google", "Cloud", "Retail", "V2"] + parent_config = while namespace.any? + parent_name = namespace.join "::" + parent_const = const_get parent_name + break parent_const.configure if parent_const.respond_to? :configure + namespace.pop + end + default_config = Client::Configuration.new parent_config + + default_config + end + yield @configure if block_given? + @configure + end + + ## + # Configure the ControlService Client instance. + # + # The configuration is set to the derived mode, meaning that values can be changed, + # but structural changes (adding new fields, etc.) are not allowed. Structural changes + # should be made on {Client.configure}. + # + # See {::Google::Cloud::Retail::V2::ControlService::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 + @control_service_stub.universe_domain + end + + ## + # Create a new ControlService client object. + # + # @example + # + # # Create a client using the default configuration + # client = ::Google::Cloud::Retail::V2::ControlService::Client.new + # + # # Create a client using a custom configuration + # client = ::Google::Cloud::Retail::V2::ControlService::Client.new do |config| + # config.timeout = 10.0 + # end + # + # @yield [config] Configure the ControlService client. + # @yieldparam config [Client::Configuration] + # + def initialize + # These require statements are intentionally placed here to initialize + # the gRPC module only when it's required. + # See https://github.com/googleapis/toolkit/issues/446 + require "gapic/grpc" + require "google/cloud/retail/v2/control_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 + + @control_service_stub = ::Gapic::ServiceStub.new( + ::Google::Cloud::Retail::V2::ControlService::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 + ) + + @control_service_stub.stub_logger&.info do |entry| + entry.set_system_name + entry.set_service + entry.message = "Created client for #{entry.service}" + entry.set_credentials_fields credentials + entry.set "customEndpoint", @config.endpoint if @config.endpoint + entry.set "defaultTimeout", @config.timeout if @config.timeout + entry.set "quotaProject", @quota_project_id if @quota_project_id + end + + @location_client = Google::Cloud::Location::Locations::Client.new do |config| + config.credentials = credentials + config.quota_project = @quota_project_id + config.endpoint = @control_service_stub.endpoint + config.universe_domain = @control_service_stub.universe_domain + config.logger = @control_service_stub.logger if config.respond_to? :logger= + end + end + + ## + # Get the associated client for mix-in of the Locations. + # + # @return [Google::Cloud::Location::Locations::Client] + # + attr_reader :location_client + + ## + # The logger used for request/response debug logging. + # + # @return [Logger] + # + def logger + @control_service_stub.logger + end + + # Service calls + + ## + # Creates a Control. + # + # If the {::Google::Cloud::Retail::V2::Control Control} to create already exists, + # an ALREADY_EXISTS error is returned. + # + # @overload create_control(request, options = nil) + # Pass arguments to `create_control` via a request object, either of type + # {::Google::Cloud::Retail::V2::CreateControlRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Retail::V2::CreateControlRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_control(parent: nil, control: nil, control_id: nil) + # Pass arguments to `create_control` via keyword arguments. Note that at + # least one keyword argument is 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. Full resource name of parent catalog. Format: + # `projects/{project_number}/locations/{location_id}/catalogs/{catalog_id}` + # @param control [::Google::Cloud::Retail::V2::Control, ::Hash] + # Required. The Control to create. + # @param control_id [::String] + # Required. The ID to use for the Control, which will become the final + # component of the Control's resource name. + # + # This value should be 4-63 characters, and valid characters + # are /[a-z][0-9]-_/. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Google::Cloud::Retail::V2::Control] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Google::Cloud::Retail::V2::Control] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/retail/v2" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Retail::V2::ControlService::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Retail::V2::CreateControlRequest.new + # + # # Call the create_control method. + # result = client.create_control request + # + # # The returned object is of type Google::Cloud::Retail::V2::Control. + # p result + # + def create_control request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Retail::V2::CreateControlRequest + + # Converts hash 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_control.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::Retail::V2::VERSION + metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.parent + 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_control.timeout, + metadata: metadata, + retry_policy: @config.rpcs.create_control.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @control_service_stub.call_rpc :create_control, request, options: options do |response, operation| + yield response, operation if block_given? + end + rescue ::GRPC::BadStatus => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Deletes a Control. + # + # If the {::Google::Cloud::Retail::V2::Control Control} to delete does not exist, + # a NOT_FOUND error is returned. + # + # @overload delete_control(request, options = nil) + # Pass arguments to `delete_control` via a request object, either of type + # {::Google::Cloud::Retail::V2::DeleteControlRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Retail::V2::DeleteControlRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_control(name: nil) + # Pass arguments to `delete_control` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param name [::String] + # Required. The resource name of the Control to delete. Format: + # `projects/{project_number}/locations/{location_id}/catalogs/{catalog_id}/controls/{control_id}` + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Google::Protobuf::Empty] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Google::Protobuf::Empty] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/retail/v2" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Retail::V2::ControlService::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Retail::V2::DeleteControlRequest.new + # + # # Call the delete_control method. + # result = client.delete_control request + # + # # The returned object is of type Google::Protobuf::Empty. + # p result + # + def delete_control request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Retail::V2::DeleteControlRequest + + # Converts hash 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_control.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::Retail::V2::VERSION + metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.name + header_params["name"] = request.name + end + + request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") + metadata[:"x-goog-request-params"] ||= request_params_header + + options.apply_defaults timeout: @config.rpcs.delete_control.timeout, + metadata: metadata, + retry_policy: @config.rpcs.delete_control.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @control_service_stub.call_rpc :delete_control, 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 Control. + # + # {::Google::Cloud::Retail::V2::Control Control} cannot be set to a different + # oneof field, if so an INVALID_ARGUMENT is returned. If the + # {::Google::Cloud::Retail::V2::Control Control} to update does not exist, a + # NOT_FOUND error is returned. + # + # @overload update_control(request, options = nil) + # Pass arguments to `update_control` via a request object, either of type + # {::Google::Cloud::Retail::V2::UpdateControlRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Retail::V2::UpdateControlRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_control(control: nil, update_mask: nil) + # Pass arguments to `update_control` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param control [::Google::Cloud::Retail::V2::Control, ::Hash] + # Required. The Control to update. + # @param update_mask [::Google::Protobuf::FieldMask, ::Hash] + # Indicates which fields in the provided + # {::Google::Cloud::Retail::V2::Control Control} to update. The following are NOT + # supported: + # + # * {::Google::Cloud::Retail::V2::Control#name Control.name} + # + # If not set or empty, all supported fields are updated. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Google::Cloud::Retail::V2::Control] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Google::Cloud::Retail::V2::Control] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/retail/v2" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Retail::V2::ControlService::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Retail::V2::UpdateControlRequest.new + # + # # Call the update_control method. + # result = client.update_control request + # + # # The returned object is of type Google::Cloud::Retail::V2::Control. + # p result + # + def update_control request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Retail::V2::UpdateControlRequest + + # Converts hash 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_control.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::Retail::V2::VERSION + metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.control&.name + header_params["control.name"] = request.control.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_control.timeout, + metadata: metadata, + retry_policy: @config.rpcs.update_control.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @control_service_stub.call_rpc :update_control, request, options: options do |response, operation| + yield response, operation if block_given? + end + rescue ::GRPC::BadStatus => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Gets a Control. + # + # @overload get_control(request, options = nil) + # Pass arguments to `get_control` via a request object, either of type + # {::Google::Cloud::Retail::V2::GetControlRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Retail::V2::GetControlRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_control(name: nil) + # Pass arguments to `get_control` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param name [::String] + # Required. The resource name of the Control to get. Format: + # `projects/{project_number}/locations/{location_id}/catalogs/{catalog_id}/controls/{control_id}` + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Google::Cloud::Retail::V2::Control] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Google::Cloud::Retail::V2::Control] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/retail/v2" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Retail::V2::ControlService::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Retail::V2::GetControlRequest.new + # + # # Call the get_control method. + # result = client.get_control request + # + # # The returned object is of type Google::Cloud::Retail::V2::Control. + # p result + # + def get_control request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Retail::V2::GetControlRequest + + # Converts hash 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_control.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::Retail::V2::VERSION + metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.name + header_params["name"] = request.name + end + + request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") + metadata[:"x-goog-request-params"] ||= request_params_header + + options.apply_defaults timeout: @config.rpcs.get_control.timeout, + metadata: metadata, + retry_policy: @config.rpcs.get_control.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @control_service_stub.call_rpc :get_control, request, options: options do |response, operation| + yield response, operation if block_given? + end + rescue ::GRPC::BadStatus => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Lists all Controls by their parent + # {::Google::Cloud::Retail::V2::Catalog Catalog}. + # + # @overload list_controls(request, options = nil) + # Pass arguments to `list_controls` via a request object, either of type + # {::Google::Cloud::Retail::V2::ListControlsRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Retail::V2::ListControlsRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_controls(parent: nil, page_size: nil, page_token: nil, filter: nil) + # Pass arguments to `list_controls` via keyword arguments. Note that at + # least one keyword argument is 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 catalog resource name. Format: + # `projects/{project_number}/locations/{location_id}/catalogs/{catalog_id}` + # @param page_size [::Integer] + # Optional. Maximum number of results to return. If unspecified, defaults + # to 50. Max allowed value is 1000. + # @param page_token [::String] + # Optional. A page token, received from a previous `ListControls` call. + # Provide this to retrieve the subsequent page. + # @param filter [::String] + # Optional. A filter to apply on the list results. Supported features: + # + # * List all the products under the parent branch if + # {::Google::Cloud::Retail::V2::ListControlsRequest#filter filter} is unset. + # * List controls that are used in a single ServingConfig: + # 'serving_config = "boosted_home_page_cvr"' + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Gapic::PagedEnumerable<::Google::Cloud::Retail::V2::Control>] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Gapic::PagedEnumerable<::Google::Cloud::Retail::V2::Control>] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/retail/v2" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Retail::V2::ControlService::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Retail::V2::ListControlsRequest.new + # + # # Call the list_controls method. + # result = client.list_controls request + # + # # The returned object is of type Gapic::PagedEnumerable. You can iterate + # # over elements, and API calls will be issued to fetch pages as needed. + # result.each do |item| + # # Each element is of type ::Google::Cloud::Retail::V2::Control. + # p item + # end + # + def list_controls request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Retail::V2::ListControlsRequest + + # Converts hash 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_controls.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::Retail::V2::VERSION + metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.parent + 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_controls.timeout, + metadata: metadata, + retry_policy: @config.rpcs.list_controls.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @control_service_stub.call_rpc :list_controls, request, options: options do |response, operation| + response = ::Gapic::PagedEnumerable.new @control_service_stub, :list_controls, 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 ControlService API. + # + # This class represents the configuration for ControlService, + # providing control over timeouts, retry behavior, logging, transport + # parameters, and other low-level controls. Certain parameters can also be + # applied individually to specific RPCs. See + # {::Google::Cloud::Retail::V2::ControlService::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_control to 20 seconds, + # # and all remaining timeouts to 10 seconds. + # ::Google::Cloud::Retail::V2::ControlService::Client.configure do |config| + # config.timeout = 10.0 + # config.rpcs.create_control.timeout = 20.0 + # end + # + # # Apply the above configuration only to a new client. + # client = ::Google::Cloud::Retail::V2::ControlService::Client.new do |config| + # config.timeout = 10.0 + # config.rpcs.create_control.timeout = 20.0 + # end + # + # @!attribute [rw] endpoint + # A custom service endpoint, as a hostname or hostname:port. The default is + # nil, indicating to use the default endpoint in the current universe domain. + # @return [::String,nil] + # @!attribute [rw] credentials + # Credentials to send with calls. You may provide any of the following types: + # * (`Google::Auth::Credentials`) A googleauth credentials object + # (see the [googleauth docs](https://rubydoc.info/gems/googleauth/Google/Auth/Credentials)) + # * (`Signet::OAuth2::Client`) A signet oauth2 client object + # (see the [signet docs](https://rubydoc.info/gems/signet/Signet/OAuth2/Client)) + # * (`GRPC::Core::Channel`) a gRPC channel with included credentials + # * (`GRPC::Core::ChannelCredentials`) a gRPC credentails object + # * (`nil`) indicating no credentials + # + # @note Warning: Passing a `String` to a keyfile path or a `Hash` of credentials + # is deprecated. Providing an unvalidated credential configuration to + # Google APIs can compromise the security of your systems and data. + # + # @example + # + # # The recommended way to provide credentials is to use the `make_creds` method + # # on the appropriate credentials class for your environment. + # + # require "googleauth" + # + # credentials = ::Google::Auth::ServiceAccountCredentials.make_creds( + # json_key_io: ::File.open("/path/to/keyfile.json") + # ) + # + # client = ::Google::Cloud::Retail::V2::ControlService::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 = "retail.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 ControlService 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_control` + # @return [::Gapic::Config::Method] + # + attr_reader :create_control + ## + # RPC-specific configuration for `delete_control` + # @return [::Gapic::Config::Method] + # + attr_reader :delete_control + ## + # RPC-specific configuration for `update_control` + # @return [::Gapic::Config::Method] + # + attr_reader :update_control + ## + # RPC-specific configuration for `get_control` + # @return [::Gapic::Config::Method] + # + attr_reader :get_control + ## + # RPC-specific configuration for `list_controls` + # @return [::Gapic::Config::Method] + # + attr_reader :list_controls + + # @private + def initialize parent_rpcs = nil + create_control_config = parent_rpcs.create_control if parent_rpcs.respond_to? :create_control + @create_control = ::Gapic::Config::Method.new create_control_config + delete_control_config = parent_rpcs.delete_control if parent_rpcs.respond_to? :delete_control + @delete_control = ::Gapic::Config::Method.new delete_control_config + update_control_config = parent_rpcs.update_control if parent_rpcs.respond_to? :update_control + @update_control = ::Gapic::Config::Method.new update_control_config + get_control_config = parent_rpcs.get_control if parent_rpcs.respond_to? :get_control + @get_control = ::Gapic::Config::Method.new get_control_config + list_controls_config = parent_rpcs.list_controls if parent_rpcs.respond_to? :list_controls + @list_controls = ::Gapic::Config::Method.new list_controls_config + + yield self if block_given? + end + end + end + end + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-retail-v2/lib/google/cloud/retail/v2/control_service/credentials.rb b/owl-bot-staging/google-cloud-retail-v2/lib/google/cloud/retail/v2/control_service/credentials.rb new file mode 100644 index 000000000000..127904154fe5 --- /dev/null +++ b/owl-bot-staging/google-cloud-retail-v2/lib/google/cloud/retail/v2/control_service/credentials.rb @@ -0,0 +1,51 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +require "googleauth" + +module Google + module Cloud + module Retail + module V2 + module ControlService + # Credentials for the ControlService API. + class Credentials < ::Google::Auth::Credentials + self.scope = [ + "https://www.googleapis.com/auth/cloud-platform" + ] + self.env_vars = [ + "RETAIL_CREDENTIALS", + "RETAIL_KEYFILE", + "GOOGLE_CLOUD_CREDENTIALS", + "GOOGLE_CLOUD_KEYFILE", + "GCLOUD_KEYFILE", + "RETAIL_CREDENTIALS_JSON", + "RETAIL_KEYFILE_JSON", + "GOOGLE_CLOUD_CREDENTIALS_JSON", + "GOOGLE_CLOUD_KEYFILE_JSON", + "GCLOUD_KEYFILE_JSON" + ] + self.paths = [ + "~/.config/google_cloud/application_default_credentials.json" + ] + end + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-retail-v2/lib/google/cloud/retail/v2/control_service/paths.rb b/owl-bot-staging/google-cloud-retail-v2/lib/google/cloud/retail/v2/control_service/paths.rb new file mode 100644 index 000000000000..464e5d03b5ba --- /dev/null +++ b/owl-bot-staging/google-cloud-retail-v2/lib/google/cloud/retail/v2/control_service/paths.rb @@ -0,0 +1,73 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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 Retail + module V2 + module ControlService + # Path helper methods for the ControlService API. + module Paths + ## + # Create a fully-qualified Catalog resource string. + # + # The resource will be in the following format: + # + # `projects/{project}/locations/{location}/catalogs/{catalog}` + # + # @param project [String] + # @param location [String] + # @param catalog [String] + # + # @return [::String] + def catalog_path project:, location:, catalog: + raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" + raise ::ArgumentError, "location cannot contain /" if location.to_s.include? "/" + + "projects/#{project}/locations/#{location}/catalogs/#{catalog}" + end + + ## + # Create a fully-qualified Control resource string. + # + # The resource will be in the following format: + # + # `projects/{project}/locations/{location}/catalogs/{catalog}/controls/{control}` + # + # @param project [String] + # @param location [String] + # @param catalog [String] + # @param control [String] + # + # @return [::String] + def control_path project:, location:, catalog:, control: + raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" + raise ::ArgumentError, "location cannot contain /" if location.to_s.include? "/" + raise ::ArgumentError, "catalog cannot contain /" if catalog.to_s.include? "/" + + "projects/#{project}/locations/#{location}/catalogs/#{catalog}/controls/#{control}" + end + + extend self + end + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-retail-v2/lib/google/cloud/retail/v2/control_service/rest.rb b/owl-bot-staging/google-cloud-retail-v2/lib/google/cloud/retail/v2/control_service/rest.rb new file mode 100644 index 000000000000..31828796abd0 --- /dev/null +++ b/owl-bot-staging/google-cloud-retail-v2/lib/google/cloud/retail/v2/control_service/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/retail/v2/version" + +require "google/cloud/retail/v2/control_service/credentials" +require "google/cloud/retail/v2/control_service/paths" +require "google/cloud/retail/v2/control_service/rest/client" + +module Google + module Cloud + module Retail + module V2 + ## + # Service for modifying Control. + # + # To load this service and instantiate a REST client: + # + # require "google/cloud/retail/v2/control_service/rest" + # client = ::Google::Cloud::Retail::V2::ControlService::Rest::Client.new + # + module ControlService + # Client for the REST transport + module Rest + end + end + end + end + end +end + +helper_path = ::File.join __dir__, "rest", "helpers.rb" +require "google/cloud/retail/v2/control_service/rest/helpers" if ::File.file? helper_path diff --git a/owl-bot-staging/google-cloud-retail-v2/lib/google/cloud/retail/v2/control_service/rest/client.rb b/owl-bot-staging/google-cloud-retail-v2/lib/google/cloud/retail/v2/control_service/rest/client.rb new file mode 100644 index 000000000000..5586ba036cd8 --- /dev/null +++ b/owl-bot-staging/google-cloud-retail-v2/lib/google/cloud/retail/v2/control_service/rest/client.rb @@ -0,0 +1,831 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +require "google/cloud/errors" +require "google/cloud/retail/v2/control_service_pb" +require "google/cloud/retail/v2/control_service/rest/service_stub" +require "google/cloud/location/rest" + +module Google + module Cloud + module Retail + module V2 + module ControlService + module Rest + ## + # REST client for the ControlService service. + # + # Service for modifying Control. + # + class Client + # @private + API_VERSION = "" + + # @private + DEFAULT_ENDPOINT_TEMPLATE = "retail.$UNIVERSE_DOMAIN$" + + include Paths + + # @private + attr_reader :control_service_stub + + ## + # Configure the ControlService Client class. + # + # See {::Google::Cloud::Retail::V2::ControlService::Rest::Client::Configuration} + # for a description of the configuration fields. + # + # @example + # + # # Modify the configuration for all ControlService clients + # ::Google::Cloud::Retail::V2::ControlService::Rest::Client.configure do |config| + # config.timeout = 10.0 + # end + # + # @yield [config] Configure the Client client. + # @yieldparam config [Client::Configuration] + # + # @return [Client::Configuration] + # + def self.configure + @configure ||= begin + namespace = ["Google", "Cloud", "Retail", "V2"] + parent_config = while namespace.any? + parent_name = namespace.join "::" + parent_const = const_get parent_name + break parent_const.configure if parent_const.respond_to? :configure + namespace.pop + end + default_config = Client::Configuration.new parent_config + + default_config + end + yield @configure if block_given? + @configure + end + + ## + # Configure the ControlService Client instance. + # + # The configuration is set to the derived mode, meaning that values can be changed, + # but structural changes (adding new fields, etc.) are not allowed. Structural changes + # should be made on {Client.configure}. + # + # See {::Google::Cloud::Retail::V2::ControlService::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 + @control_service_stub.universe_domain + end + + ## + # Create a new ControlService REST client object. + # + # @example + # + # # Create a client using the default configuration + # client = ::Google::Cloud::Retail::V2::ControlService::Rest::Client.new + # + # # Create a client using a custom configuration + # client = ::Google::Cloud::Retail::V2::ControlService::Rest::Client.new do |config| + # config.timeout = 10.0 + # end + # + # @yield [config] Configure the ControlService 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 + + @control_service_stub = ::Google::Cloud::Retail::V2::ControlService::Rest::ServiceStub.new( + endpoint: @config.endpoint, + endpoint_template: DEFAULT_ENDPOINT_TEMPLATE, + universe_domain: @config.universe_domain, + credentials: credentials, + logger: @config.logger + ) + + @control_service_stub.logger(stub: true)&.info do |entry| + entry.set_system_name + entry.set_service + entry.message = "Created client for #{entry.service}" + entry.set_credentials_fields credentials + entry.set "customEndpoint", @config.endpoint if @config.endpoint + entry.set "defaultTimeout", @config.timeout if @config.timeout + entry.set "quotaProject", @quota_project_id if @quota_project_id + end + + @location_client = Google::Cloud::Location::Locations::Rest::Client.new do |config| + config.credentials = credentials + config.quota_project = @quota_project_id + config.endpoint = @control_service_stub.endpoint + config.universe_domain = @control_service_stub.universe_domain + config.logger = @control_service_stub.logger if config.respond_to? :logger= + end + end + + ## + # Get the associated client for mix-in of the Locations. + # + # @return [Google::Cloud::Location::Locations::Rest::Client] + # + attr_reader :location_client + + ## + # The logger used for request/response debug logging. + # + # @return [Logger] + # + def logger + @control_service_stub.logger + end + + # Service calls + + ## + # Creates a Control. + # + # If the {::Google::Cloud::Retail::V2::Control Control} to create already exists, + # an ALREADY_EXISTS error is returned. + # + # @overload create_control(request, options = nil) + # Pass arguments to `create_control` via a request object, either of type + # {::Google::Cloud::Retail::V2::CreateControlRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Retail::V2::CreateControlRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_control(parent: nil, control: nil, control_id: nil) + # Pass arguments to `create_control` via keyword arguments. Note that at + # least one keyword argument is 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. Full resource name of parent catalog. Format: + # `projects/{project_number}/locations/{location_id}/catalogs/{catalog_id}` + # @param control [::Google::Cloud::Retail::V2::Control, ::Hash] + # Required. The Control to create. + # @param control_id [::String] + # Required. The ID to use for the Control, which will become the final + # component of the Control's resource name. + # + # This value should be 4-63 characters, and valid characters + # are /[a-z][0-9]-_/. + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Cloud::Retail::V2::Control] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::Retail::V2::Control] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/retail/v2" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Retail::V2::ControlService::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Retail::V2::CreateControlRequest.new + # + # # Call the create_control method. + # result = client.create_control request + # + # # The returned object is of type Google::Cloud::Retail::V2::Control. + # p result + # + def create_control request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Retail::V2::CreateControlRequest + + # Converts hash 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_control.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::Retail::V2::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + options.apply_defaults timeout: @config.rpcs.create_control.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.create_control.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @control_service_stub.create_control request, options do |result, operation| + yield result, operation if block_given? + end + rescue ::Gapic::Rest::Error => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Deletes a Control. + # + # If the {::Google::Cloud::Retail::V2::Control Control} to delete does not exist, + # a NOT_FOUND error is returned. + # + # @overload delete_control(request, options = nil) + # Pass arguments to `delete_control` via a request object, either of type + # {::Google::Cloud::Retail::V2::DeleteControlRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Retail::V2::DeleteControlRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_control(name: nil) + # Pass arguments to `delete_control` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param name [::String] + # Required. The resource name of the Control to delete. Format: + # `projects/{project_number}/locations/{location_id}/catalogs/{catalog_id}/controls/{control_id}` + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Protobuf::Empty] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Protobuf::Empty] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/retail/v2" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Retail::V2::ControlService::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Retail::V2::DeleteControlRequest.new + # + # # Call the delete_control method. + # result = client.delete_control request + # + # # The returned object is of type Google::Protobuf::Empty. + # p result + # + def delete_control request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Retail::V2::DeleteControlRequest + + # Converts hash 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_control.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::Retail::V2::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + options.apply_defaults timeout: @config.rpcs.delete_control.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.delete_control.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @control_service_stub.delete_control 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 Control. + # + # {::Google::Cloud::Retail::V2::Control Control} cannot be set to a different + # oneof field, if so an INVALID_ARGUMENT is returned. If the + # {::Google::Cloud::Retail::V2::Control Control} to update does not exist, a + # NOT_FOUND error is returned. + # + # @overload update_control(request, options = nil) + # Pass arguments to `update_control` via a request object, either of type + # {::Google::Cloud::Retail::V2::UpdateControlRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Retail::V2::UpdateControlRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_control(control: nil, update_mask: nil) + # Pass arguments to `update_control` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param control [::Google::Cloud::Retail::V2::Control, ::Hash] + # Required. The Control to update. + # @param update_mask [::Google::Protobuf::FieldMask, ::Hash] + # Indicates which fields in the provided + # {::Google::Cloud::Retail::V2::Control Control} to update. The following are NOT + # supported: + # + # * {::Google::Cloud::Retail::V2::Control#name Control.name} + # + # If not set or empty, all supported fields are updated. + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Cloud::Retail::V2::Control] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::Retail::V2::Control] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/retail/v2" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Retail::V2::ControlService::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Retail::V2::UpdateControlRequest.new + # + # # Call the update_control method. + # result = client.update_control request + # + # # The returned object is of type Google::Cloud::Retail::V2::Control. + # p result + # + def update_control request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Retail::V2::UpdateControlRequest + + # Converts hash 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_control.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::Retail::V2::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + options.apply_defaults timeout: @config.rpcs.update_control.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.update_control.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @control_service_stub.update_control request, options do |result, operation| + yield result, operation if block_given? + end + rescue ::Gapic::Rest::Error => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Gets a Control. + # + # @overload get_control(request, options = nil) + # Pass arguments to `get_control` via a request object, either of type + # {::Google::Cloud::Retail::V2::GetControlRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Retail::V2::GetControlRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_control(name: nil) + # Pass arguments to `get_control` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param name [::String] + # Required. The resource name of the Control to get. Format: + # `projects/{project_number}/locations/{location_id}/catalogs/{catalog_id}/controls/{control_id}` + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Cloud::Retail::V2::Control] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::Retail::V2::Control] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/retail/v2" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Retail::V2::ControlService::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Retail::V2::GetControlRequest.new + # + # # Call the get_control method. + # result = client.get_control request + # + # # The returned object is of type Google::Cloud::Retail::V2::Control. + # p result + # + def get_control request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Retail::V2::GetControlRequest + + # Converts hash 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_control.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::Retail::V2::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + options.apply_defaults timeout: @config.rpcs.get_control.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.get_control.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @control_service_stub.get_control request, options do |result, operation| + yield result, operation if block_given? + end + rescue ::Gapic::Rest::Error => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Lists all Controls by their parent + # {::Google::Cloud::Retail::V2::Catalog Catalog}. + # + # @overload list_controls(request, options = nil) + # Pass arguments to `list_controls` via a request object, either of type + # {::Google::Cloud::Retail::V2::ListControlsRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Retail::V2::ListControlsRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_controls(parent: nil, page_size: nil, page_token: nil, filter: nil) + # Pass arguments to `list_controls` via keyword arguments. Note that at + # least one keyword argument is 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 catalog resource name. Format: + # `projects/{project_number}/locations/{location_id}/catalogs/{catalog_id}` + # @param page_size [::Integer] + # Optional. Maximum number of results to return. If unspecified, defaults + # to 50. Max allowed value is 1000. + # @param page_token [::String] + # Optional. A page token, received from a previous `ListControls` call. + # Provide this to retrieve the subsequent page. + # @param filter [::String] + # Optional. A filter to apply on the list results. Supported features: + # + # * List all the products under the parent branch if + # {::Google::Cloud::Retail::V2::ListControlsRequest#filter filter} is unset. + # * List controls that are used in a single ServingConfig: + # 'serving_config = "boosted_home_page_cvr"' + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Gapic::Rest::PagedEnumerable<::Google::Cloud::Retail::V2::Control>] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Gapic::Rest::PagedEnumerable<::Google::Cloud::Retail::V2::Control>] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/retail/v2" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Retail::V2::ControlService::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Retail::V2::ListControlsRequest.new + # + # # Call the list_controls method. + # result = client.list_controls request + # + # # The returned object is of type Gapic::PagedEnumerable. You can iterate + # # over elements, and API calls will be issued to fetch pages as needed. + # result.each do |item| + # # Each element is of type ::Google::Cloud::Retail::V2::Control. + # p item + # end + # + def list_controls request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Retail::V2::ListControlsRequest + + # Converts hash 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_controls.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::Retail::V2::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + options.apply_defaults timeout: @config.rpcs.list_controls.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.list_controls.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @control_service_stub.list_controls request, options do |result, operation| + result = ::Gapic::Rest::PagedEnumerable.new @control_service_stub, :list_controls, "controls", 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 ControlService REST API. + # + # This class represents the configuration for ControlService REST, + # providing control over timeouts, retry behavior, logging, transport + # parameters, and other low-level controls. Certain parameters can also be + # applied individually to specific RPCs. See + # {::Google::Cloud::Retail::V2::ControlService::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_control to 20 seconds, + # # and all remaining timeouts to 10 seconds. + # ::Google::Cloud::Retail::V2::ControlService::Rest::Client.configure do |config| + # config.timeout = 10.0 + # config.rpcs.create_control.timeout = 20.0 + # end + # + # # Apply the above configuration only to a new client. + # client = ::Google::Cloud::Retail::V2::ControlService::Rest::Client.new do |config| + # config.timeout = 10.0 + # config.rpcs.create_control.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 = "retail.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 ControlService 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_control` + # @return [::Gapic::Config::Method] + # + attr_reader :create_control + ## + # RPC-specific configuration for `delete_control` + # @return [::Gapic::Config::Method] + # + attr_reader :delete_control + ## + # RPC-specific configuration for `update_control` + # @return [::Gapic::Config::Method] + # + attr_reader :update_control + ## + # RPC-specific configuration for `get_control` + # @return [::Gapic::Config::Method] + # + attr_reader :get_control + ## + # RPC-specific configuration for `list_controls` + # @return [::Gapic::Config::Method] + # + attr_reader :list_controls + + # @private + def initialize parent_rpcs = nil + create_control_config = parent_rpcs.create_control if parent_rpcs.respond_to? :create_control + @create_control = ::Gapic::Config::Method.new create_control_config + delete_control_config = parent_rpcs.delete_control if parent_rpcs.respond_to? :delete_control + @delete_control = ::Gapic::Config::Method.new delete_control_config + update_control_config = parent_rpcs.update_control if parent_rpcs.respond_to? :update_control + @update_control = ::Gapic::Config::Method.new update_control_config + get_control_config = parent_rpcs.get_control if parent_rpcs.respond_to? :get_control + @get_control = ::Gapic::Config::Method.new get_control_config + list_controls_config = parent_rpcs.list_controls if parent_rpcs.respond_to? :list_controls + @list_controls = ::Gapic::Config::Method.new list_controls_config + + yield self if block_given? + end + end + end + end + end + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-retail-v2/lib/google/cloud/retail/v2/control_service/rest/service_stub.rb b/owl-bot-staging/google-cloud-retail-v2/lib/google/cloud/retail/v2/control_service/rest/service_stub.rb new file mode 100644 index 000000000000..61b0a0f77df2 --- /dev/null +++ b/owl-bot-staging/google-cloud-retail-v2/lib/google/cloud/retail/v2/control_service/rest/service_stub.rb @@ -0,0 +1,388 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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/retail/v2/control_service_pb" + +module Google + module Cloud + module Retail + module V2 + module ControlService + module Rest + ## + # REST service stub for the ControlService 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_control REST call + # + # @param request_pb [::Google::Cloud::Retail::V2::CreateControlRequest] + # A request object representing the call parameters. Required. + # @param options [::Gapic::CallOptions] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Cloud::Retail::V2::Control] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::Retail::V2::Control] + # A result object deserialized from the server's reply + def create_control request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_create_control_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_control", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Cloud::Retail::V2::Control.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_control REST call + # + # @param request_pb [::Google::Cloud::Retail::V2::DeleteControlRequest] + # 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_control request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_delete_control_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_control", + 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 update_control REST call + # + # @param request_pb [::Google::Cloud::Retail::V2::UpdateControlRequest] + # A request object representing the call parameters. Required. + # @param options [::Gapic::CallOptions] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Cloud::Retail::V2::Control] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::Retail::V2::Control] + # A result object deserialized from the server's reply + def update_control request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_update_control_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_control", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Cloud::Retail::V2::Control.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_control REST call + # + # @param request_pb [::Google::Cloud::Retail::V2::GetControlRequest] + # A request object representing the call parameters. Required. + # @param options [::Gapic::CallOptions] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Cloud::Retail::V2::Control] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::Retail::V2::Control] + # A result object deserialized from the server's reply + def get_control request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_get_control_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_control", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Cloud::Retail::V2::Control.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_controls REST call + # + # @param request_pb [::Google::Cloud::Retail::V2::ListControlsRequest] + # A request object representing the call parameters. Required. + # @param options [::Gapic::CallOptions] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Cloud::Retail::V2::ListControlsResponse] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::Retail::V2::ListControlsResponse] + # A result object deserialized from the server's reply + def list_controls request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_list_controls_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_controls", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Cloud::Retail::V2::ListControlsResponse.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_control REST call + # + # @param request_pb [::Google::Cloud::Retail::V2::CreateControlRequest] + # 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_control_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :post, + uri_template: "/v2/{parent}/controls", + body: "control", + matches: [ + ["parent", %r{^projects/[^/]+/locations/[^/]+/catalogs/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the delete_control REST call + # + # @param request_pb [::Google::Cloud::Retail::V2::DeleteControlRequest] + # 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_control_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :delete, + uri_template: "/v2/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/catalogs/[^/]+/controls/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the update_control REST call + # + # @param request_pb [::Google::Cloud::Retail::V2::UpdateControlRequest] + # 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_control_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :patch, + uri_template: "/v2/{control.name}", + body: "control", + matches: [ + ["control.name", %r{^projects/[^/]+/locations/[^/]+/catalogs/[^/]+/controls/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the get_control REST call + # + # @param request_pb [::Google::Cloud::Retail::V2::GetControlRequest] + # 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_control_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :get, + uri_template: "/v2/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/catalogs/[^/]+/controls/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the list_controls REST call + # + # @param request_pb [::Google::Cloud::Retail::V2::ListControlsRequest] + # 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_controls_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :get, + uri_template: "/v2/{parent}/controls", + matches: [ + ["parent", %r{^projects/[^/]+/locations/[^/]+/catalogs/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + end + end + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-retail-v2/lib/google/cloud/retail/v2/control_service_pb.rb b/owl-bot-staging/google-cloud-retail-v2/lib/google/cloud/retail/v2/control_service_pb.rb new file mode 100644 index 000000000000..4af2840862e1 --- /dev/null +++ b/owl-bot-staging/google-cloud-retail-v2/lib/google/cloud/retail/v2/control_service_pb.rb @@ -0,0 +1,34 @@ +# frozen_string_literal: true +# Generated by the protocol buffer compiler. DO NOT EDIT! +# source: google/cloud/retail/v2/control_service.proto + +require 'google/protobuf' + +require 'google/api/annotations_pb' +require 'google/api/client_pb' +require 'google/api/field_behavior_pb' +require 'google/api/resource_pb' +require 'google/cloud/retail/v2/control_pb' +require 'google/protobuf/empty_pb' +require 'google/protobuf/field_mask_pb' + + +descriptor_data = "\n,google/cloud/retail/v2/control_service.proto\x12\x16google.cloud.retail.v2\x1a\x1cgoogle/api/annotations.proto\x1a\x17google/api/client.proto\x1a\x1fgoogle/api/field_behavior.proto\x1a\x19google/api/resource.proto\x1a$google/cloud/retail/v2/control.proto\x1a\x1bgoogle/protobuf/empty.proto\x1a google/protobuf/field_mask.proto\"\x9d\x01\n\x14\x43reateControlRequest\x12\x35\n\x06parent\x18\x01 \x01(\tB%\xe0\x41\x02\xfa\x41\x1f\n\x1dretail.googleapis.com/Catalog\x12\x35\n\x07\x63ontrol\x18\x02 \x01(\x0b\x32\x1f.google.cloud.retail.v2.ControlB\x03\xe0\x41\x02\x12\x17\n\ncontrol_id\x18\x03 \x01(\tB\x03\xe0\x41\x02\"~\n\x14UpdateControlRequest\x12\x35\n\x07\x63ontrol\x18\x01 \x01(\x0b\x32\x1f.google.cloud.retail.v2.ControlB\x03\xe0\x41\x02\x12/\n\x0bupdate_mask\x18\x02 \x01(\x0b\x32\x1a.google.protobuf.FieldMask\"K\n\x14\x44\x65leteControlRequest\x12\x33\n\x04name\x18\x01 \x01(\tB%\xe0\x41\x02\xfa\x41\x1f\n\x1dretail.googleapis.com/Control\"H\n\x11GetControlRequest\x12\x33\n\x04name\x18\x01 \x01(\tB%\xe0\x41\x02\xfa\x41\x1f\n\x1dretail.googleapis.com/Control\"\x92\x01\n\x13ListControlsRequest\x12\x35\n\x06parent\x18\x01 \x01(\tB%\xe0\x41\x02\xfa\x41\x1f\n\x1dretail.googleapis.com/Catalog\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\"b\n\x14ListControlsResponse\x12\x31\n\x08\x63ontrols\x18\x01 \x03(\x0b\x32\x1f.google.cloud.retail.v2.Control\x12\x17\n\x0fnext_page_token\x18\x02 \x01(\t2\xe4\x07\n\x0e\x43ontrolService\x12\xc4\x01\n\rCreateControl\x12,.google.cloud.retail.v2.CreateControlRequest\x1a\x1f.google.cloud.retail.v2.Control\"d\xda\x41\x19parent,control,control_id\x82\xd3\xe4\x93\x02\x42\"7/v2/{parent=projects/*/locations/*/catalogs/*}/controls:\x07\x63ontrol\x12\x9d\x01\n\rDeleteControl\x12,.google.cloud.retail.v2.DeleteControlRequest\x1a\x16.google.protobuf.Empty\"F\xda\x41\x04name\x82\xd3\xe4\x93\x02\x39*7/v2/{name=projects/*/locations/*/catalogs/*/controls/*}\x12\xc6\x01\n\rUpdateControl\x12,.google.cloud.retail.v2.UpdateControlRequest\x1a\x1f.google.cloud.retail.v2.Control\"f\xda\x41\x13\x63ontrol,update_mask\x82\xd3\xe4\x93\x02J2?/v2/{control.name=projects/*/locations/*/catalogs/*/controls/*}:\x07\x63ontrol\x12\xa0\x01\n\nGetControl\x12).google.cloud.retail.v2.GetControlRequest\x1a\x1f.google.cloud.retail.v2.Control\"F\xda\x41\x04name\x82\xd3\xe4\x93\x02\x39\x12\x37/v2/{name=projects/*/locations/*/catalogs/*/controls/*}\x12\xb3\x01\n\x0cListControls\x12+.google.cloud.retail.v2.ListControlsRequest\x1a,.google.cloud.retail.v2.ListControlsResponse\"H\xda\x41\x06parent\x82\xd3\xe4\x93\x02\x39\x12\x37/v2/{parent=projects/*/locations/*/catalogs/*}/controls\x1aI\xca\x41\x15retail.googleapis.com\xd2\x41.https://www.googleapis.com/auth/cloud-platformB\xbe\x01\n\x1a\x63om.google.cloud.retail.v2B\x13\x43ontrolServiceProtoP\x01Z2cloud.google.com/go/retail/apiv2/retailpb;retailpb\xa2\x02\x06RETAIL\xaa\x02\x16Google.Cloud.Retail.V2\xca\x02\x16Google\\Cloud\\Retail\\V2\xea\x02\x19Google::Cloud::Retail::V2b\x06proto3" + +pool = ::Google::Protobuf::DescriptorPool.generated_pool +pool.add_serialized_file(descriptor_data) + +module Google + module Cloud + module Retail + module V2 + CreateControlRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.retail.v2.CreateControlRequest").msgclass + UpdateControlRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.retail.v2.UpdateControlRequest").msgclass + DeleteControlRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.retail.v2.DeleteControlRequest").msgclass + GetControlRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.retail.v2.GetControlRequest").msgclass + ListControlsRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.retail.v2.ListControlsRequest").msgclass + ListControlsResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.retail.v2.ListControlsResponse").msgclass + end + end + end +end diff --git a/owl-bot-staging/google-cloud-retail-v2/lib/google/cloud/retail/v2/control_service_services_pb.rb b/owl-bot-staging/google-cloud-retail-v2/lib/google/cloud/retail/v2/control_service_services_pb.rb new file mode 100644 index 000000000000..bcef36f6b4c1 --- /dev/null +++ b/owl-bot-staging/google-cloud-retail-v2/lib/google/cloud/retail/v2/control_service_services_pb.rb @@ -0,0 +1,65 @@ +# Generated by the protocol buffer compiler. DO NOT EDIT! +# Source: google/cloud/retail/v2/control_service.proto for package 'Google.Cloud.Retail.V2' +# Original file comments: +# 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 +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# + +require 'grpc' +require 'google/cloud/retail/v2/control_service_pb' + +module Google + module Cloud + module Retail + module V2 + module ControlService + # Service for modifying Control. + class Service + + include ::GRPC::GenericService + + self.marshal_class_method = :encode + self.unmarshal_class_method = :decode + self.service_name = 'google.cloud.retail.v2.ControlService' + + # Creates a Control. + # + # If the [Control][google.cloud.retail.v2.Control] to create already exists, + # an ALREADY_EXISTS error is returned. + rpc :CreateControl, ::Google::Cloud::Retail::V2::CreateControlRequest, ::Google::Cloud::Retail::V2::Control + # Deletes a Control. + # + # If the [Control][google.cloud.retail.v2.Control] to delete does not exist, + # a NOT_FOUND error is returned. + rpc :DeleteControl, ::Google::Cloud::Retail::V2::DeleteControlRequest, ::Google::Protobuf::Empty + # Updates a Control. + # + # [Control][google.cloud.retail.v2.Control] cannot be set to a different + # oneof field, if so an INVALID_ARGUMENT is returned. If the + # [Control][google.cloud.retail.v2.Control] to update does not exist, a + # NOT_FOUND error is returned. + rpc :UpdateControl, ::Google::Cloud::Retail::V2::UpdateControlRequest, ::Google::Cloud::Retail::V2::Control + # Gets a Control. + rpc :GetControl, ::Google::Cloud::Retail::V2::GetControlRequest, ::Google::Cloud::Retail::V2::Control + # Lists all Controls by their parent + # [Catalog][google.cloud.retail.v2.Catalog]. + rpc :ListControls, ::Google::Cloud::Retail::V2::ListControlsRequest, ::Google::Cloud::Retail::V2::ListControlsResponse + end + + Stub = Service.rpc_stub_class + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-retail-v2/lib/google/cloud/retail/v2/conversational_search_service.rb b/owl-bot-staging/google-cloud-retail-v2/lib/google/cloud/retail/v2/conversational_search_service.rb new file mode 100644 index 000000000000..c3b86da366b9 --- /dev/null +++ b/owl-bot-staging/google-cloud-retail-v2/lib/google/cloud/retail/v2/conversational_search_service.rb @@ -0,0 +1,59 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +require "gapic/common" +require "gapic/config" +require "gapic/config/method" + +require "google/cloud/retail/v2/version" + +require "google/cloud/retail/v2/conversational_search_service/credentials" +require "google/cloud/retail/v2/conversational_search_service/paths" +require "google/cloud/retail/v2/conversational_search_service/client" +require "google/cloud/retail/v2/conversational_search_service/rest" + +module Google + module Cloud + module Retail + module V2 + ## + # Service for retail conversational search. + # + # This feature is only available for users who have Retail Conversational + # Search enabled. Enable Retail Conversational Search on Cloud Console + # before using this feature. + # + # @example Load this service and instantiate a gRPC client + # + # require "google/cloud/retail/v2/conversational_search_service" + # client = ::Google::Cloud::Retail::V2::ConversationalSearchService::Client.new + # + # @example Load this service and instantiate a REST client + # + # require "google/cloud/retail/v2/conversational_search_service/rest" + # client = ::Google::Cloud::Retail::V2::ConversationalSearchService::Rest::Client.new + # + module ConversationalSearchService + end + end + end + end +end + +helper_path = ::File.join __dir__, "conversational_search_service", "helpers.rb" +require "google/cloud/retail/v2/conversational_search_service/helpers" if ::File.file? helper_path diff --git a/owl-bot-staging/google-cloud-retail-v2/lib/google/cloud/retail/v2/conversational_search_service/client.rb b/owl-bot-staging/google-cloud-retail-v2/lib/google/cloud/retail/v2/conversational_search_service/client.rb new file mode 100644 index 000000000000..ed6ffe7ac650 --- /dev/null +++ b/owl-bot-staging/google-cloud-retail-v2/lib/google/cloud/retail/v2/conversational_search_service/client.rb @@ -0,0 +1,574 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +require "google/cloud/errors" +require "google/cloud/retail/v2/conversational_search_service_pb" +require "google/cloud/location" + +module Google + module Cloud + module Retail + module V2 + module ConversationalSearchService + ## + # Client for the ConversationalSearchService service. + # + # Service for retail conversational search. + # + # This feature is only available for users who have Retail Conversational + # Search enabled. Enable Retail Conversational Search on Cloud Console + # before using this feature. + # + class Client + # @private + API_VERSION = "" + + # @private + DEFAULT_ENDPOINT_TEMPLATE = "retail.$UNIVERSE_DOMAIN$" + + include Paths + + # @private + attr_reader :conversational_search_service_stub + + ## + # Configure the ConversationalSearchService Client class. + # + # See {::Google::Cloud::Retail::V2::ConversationalSearchService::Client::Configuration} + # for a description of the configuration fields. + # + # @example + # + # # Modify the configuration for all ConversationalSearchService clients + # ::Google::Cloud::Retail::V2::ConversationalSearchService::Client.configure do |config| + # config.timeout = 10.0 + # end + # + # @yield [config] Configure the Client client. + # @yieldparam config [Client::Configuration] + # + # @return [Client::Configuration] + # + def self.configure + @configure ||= begin + namespace = ["Google", "Cloud", "Retail", "V2"] + parent_config = while namespace.any? + parent_name = namespace.join "::" + parent_const = const_get parent_name + break parent_const.configure if parent_const.respond_to? :configure + namespace.pop + end + default_config = Client::Configuration.new parent_config + + default_config + end + yield @configure if block_given? + @configure + end + + ## + # Configure the ConversationalSearchService Client instance. + # + # The configuration is set to the derived mode, meaning that values can be changed, + # but structural changes (adding new fields, etc.) are not allowed. Structural changes + # should be made on {Client.configure}. + # + # See {::Google::Cloud::Retail::V2::ConversationalSearchService::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 + @conversational_search_service_stub.universe_domain + end + + ## + # Create a new ConversationalSearchService client object. + # + # @example + # + # # Create a client using the default configuration + # client = ::Google::Cloud::Retail::V2::ConversationalSearchService::Client.new + # + # # Create a client using a custom configuration + # client = ::Google::Cloud::Retail::V2::ConversationalSearchService::Client.new do |config| + # config.timeout = 10.0 + # end + # + # @yield [config] Configure the ConversationalSearchService client. + # @yieldparam config [Client::Configuration] + # + def initialize + # These require statements are intentionally placed here to initialize + # the gRPC module only when it's required. + # See https://github.com/googleapis/toolkit/issues/446 + require "gapic/grpc" + require "google/cloud/retail/v2/conversational_search_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 + + @conversational_search_service_stub = ::Gapic::ServiceStub.new( + ::Google::Cloud::Retail::V2::ConversationalSearchService::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 + ) + + @conversational_search_service_stub.stub_logger&.info do |entry| + entry.set_system_name + entry.set_service + entry.message = "Created client for #{entry.service}" + entry.set_credentials_fields credentials + entry.set "customEndpoint", @config.endpoint if @config.endpoint + entry.set "defaultTimeout", @config.timeout if @config.timeout + entry.set "quotaProject", @quota_project_id if @quota_project_id + end + + @location_client = Google::Cloud::Location::Locations::Client.new do |config| + config.credentials = credentials + config.quota_project = @quota_project_id + config.endpoint = @conversational_search_service_stub.endpoint + config.universe_domain = @conversational_search_service_stub.universe_domain + config.logger = @conversational_search_service_stub.logger if config.respond_to? :logger= + end + end + + ## + # Get the associated client for mix-in of the Locations. + # + # @return [Google::Cloud::Location::Locations::Client] + # + attr_reader :location_client + + ## + # The logger used for request/response debug logging. + # + # @return [Logger] + # + def logger + @conversational_search_service_stub.logger + end + + # Service calls + + ## + # Performs a conversational search. + # + # This feature is only available for users who have Conversational Search + # enabled. + # + # @overload conversational_search(request, options = nil) + # Pass arguments to `conversational_search` via a request object, either of type + # {::Google::Cloud::Retail::V2::ConversationalSearchRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Retail::V2::ConversationalSearchRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. + # + # @overload conversational_search(placement: nil, branch: nil, query: nil, page_categories: nil, conversation_id: nil, search_params: nil, visitor_id: nil, user_info: nil, conversational_filtering_spec: nil, user_labels: nil, safety_settings: nil) + # Pass arguments to `conversational_search` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param placement [::String] + # Required. The resource name of the search engine placement, such as + # `projects/*/locations/global/catalogs/default_catalog/placements/default_search` + # or + # `projects/*/locations/global/catalogs/default_catalog/servingConfigs/default_serving_config` + # This field is used to identify the serving config name and the set + # of models that will be used to make the search. + # @param branch [::String] + # Required. The branch resource name, such as + # `projects/*/locations/global/catalogs/default_catalog/branches/0`. + # + # Use "default_branch" as the branch ID or leave this field empty, to search + # products under the default branch. + # @param query [::String] + # Optional. Raw search query to be searched for. + # + # If this field is empty, the request is considered a category browsing + # request. + # @param page_categories [::Array<::String>] + # Optional. The categories associated with a category page. Must be set for + # category navigation queries to achieve good search quality. The format + # should be the same as + # {::Google::Cloud::Retail::V2::UserEvent#page_categories UserEvent.page_categories}; + # + # To represent full path of category, use '>' sign to separate different + # hierarchies. If '>' is part of the category name, replace it with + # other character(s). + # + # Category pages include special pages such as sales or promotions. For + # instance, a special sale page may have the category hierarchy: + # "pageCategories" : ["Sales > 2017 Black Friday Deals"]. + # @param conversation_id [::String] + # Optional. This field specifies the conversation id, which maintains the + # state of the conversation between client side and server side. Use the + # value from the previous + # {::Google::Cloud::Retail::V2::ConversationalSearchResponse#conversation_id ConversationalSearchResponse.conversation_id}. + # For the initial request, this should be empty. + # @param search_params [::Google::Cloud::Retail::V2::ConversationalSearchRequest::SearchParams, ::Hash] + # Optional. Search parameters. + # @param visitor_id [::String] + # Required. A unique identifier for tracking visitors. For example, this + # could be implemented with an HTTP cookie, which should be able to uniquely + # identify a visitor on a single device. This unique identifier should not + # change if the visitor logs in or out of the website. + # + # This should be the same identifier as + # {::Google::Cloud::Retail::V2::UserEvent#visitor_id UserEvent.visitor_id}. + # + # The field must be a UTF-8 encoded string with a length limit of 128 + # characters. Otherwise, an INVALID_ARGUMENT error is returned. + # @param user_info [::Google::Cloud::Retail::V2::UserInfo, ::Hash] + # Optional. User information. + # @param conversational_filtering_spec [::Google::Cloud::Retail::V2::ConversationalSearchRequest::ConversationalFilteringSpec, ::Hash] + # Optional. This field specifies all conversational filtering related + # parameters. + # @param user_labels [::Hash{::String => ::String}] + # Optional. The user labels applied to a resource must meet the following + # requirements: + # + # * Each resource can have multiple labels, up to a maximum of 64. + # * Each label must be a key-value pair. + # * Keys have a minimum length of 1 character and a maximum length of 63 + # characters and cannot be empty. Values can be empty and have a maximum + # length of 63 characters. + # * Keys and values can contain only lowercase letters, numeric characters, + # underscores, and dashes. All characters must use UTF-8 encoding, and + # international characters are allowed. + # * The key portion of a label must be unique. However, you can use the same + # key with multiple resources. + # * Keys must start with a lowercase letter or international character. + # + # See [Google Cloud + # Document](https://cloud.google.com/resource-manager/docs/creating-managing-labels#requirements) + # for more details. + # @param safety_settings [::Array<::Google::Cloud::Retail::V2::SafetySetting, ::Hash>] + # Optional. The safety settings to be applied to the generated content. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Enumerable<::Google::Cloud::Retail::V2::ConversationalSearchResponse>] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Enumerable<::Google::Cloud::Retail::V2::ConversationalSearchResponse>] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/retail/v2" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Retail::V2::ConversationalSearchService::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Retail::V2::ConversationalSearchRequest.new + # + # # Call the conversational_search method to start streaming. + # output = client.conversational_search request + # + # # The returned object is a streamed enumerable yielding elements of type + # # ::Google::Cloud::Retail::V2::ConversationalSearchResponse + # output.each do |current_response| + # p current_response + # end + # + def conversational_search request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Retail::V2::ConversationalSearchRequest + + # Converts hash 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.conversational_search.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::Retail::V2::VERSION + metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.placement + header_params["placement"] = request.placement + 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.conversational_search.timeout, + metadata: metadata, + retry_policy: @config.rpcs.conversational_search.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @conversational_search_service_stub.call_rpc :conversational_search, request, options: options do |response, operation| + yield response, operation if block_given? + end + rescue ::GRPC::BadStatus => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Configuration class for the ConversationalSearchService API. + # + # This class represents the configuration for ConversationalSearchService, + # providing control over timeouts, retry behavior, logging, transport + # parameters, and other low-level controls. Certain parameters can also be + # applied individually to specific RPCs. See + # {::Google::Cloud::Retail::V2::ConversationalSearchService::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 + # # conversational_search to 20 seconds, + # # and all remaining timeouts to 10 seconds. + # ::Google::Cloud::Retail::V2::ConversationalSearchService::Client.configure do |config| + # config.timeout = 10.0 + # config.rpcs.conversational_search.timeout = 20.0 + # end + # + # # Apply the above configuration only to a new client. + # client = ::Google::Cloud::Retail::V2::ConversationalSearchService::Client.new do |config| + # config.timeout = 10.0 + # config.rpcs.conversational_search.timeout = 20.0 + # end + # + # @!attribute [rw] endpoint + # A custom service endpoint, as a hostname or hostname:port. The default is + # nil, indicating to use the default endpoint in the current universe domain. + # @return [::String,nil] + # @!attribute [rw] credentials + # Credentials to send with calls. You may provide any of the following types: + # * (`Google::Auth::Credentials`) A googleauth credentials object + # (see the [googleauth docs](https://rubydoc.info/gems/googleauth/Google/Auth/Credentials)) + # * (`Signet::OAuth2::Client`) A signet oauth2 client object + # (see the [signet docs](https://rubydoc.info/gems/signet/Signet/OAuth2/Client)) + # * (`GRPC::Core::Channel`) a gRPC channel with included credentials + # * (`GRPC::Core::ChannelCredentials`) a gRPC credentails object + # * (`nil`) indicating no credentials + # + # @note Warning: Passing a `String` to a keyfile path or a `Hash` of credentials + # is deprecated. Providing an unvalidated credential configuration to + # Google APIs can compromise the security of your systems and data. + # + # @example + # + # # The recommended way to provide credentials is to use the `make_creds` method + # # on the appropriate credentials class for your environment. + # + # require "googleauth" + # + # credentials = ::Google::Auth::ServiceAccountCredentials.make_creds( + # json_key_io: ::File.open("/path/to/keyfile.json") + # ) + # + # client = ::Google::Cloud::Retail::V2::ConversationalSearchService::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 = "retail.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 ConversationalSearchService 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 `conversational_search` + # @return [::Gapic::Config::Method] + # + attr_reader :conversational_search + + # @private + def initialize parent_rpcs = nil + conversational_search_config = parent_rpcs.conversational_search if parent_rpcs.respond_to? :conversational_search + @conversational_search = ::Gapic::Config::Method.new conversational_search_config + + yield self if block_given? + end + end + end + end + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-retail-v2/lib/google/cloud/retail/v2/conversational_search_service/credentials.rb b/owl-bot-staging/google-cloud-retail-v2/lib/google/cloud/retail/v2/conversational_search_service/credentials.rb new file mode 100644 index 000000000000..ccd5e02152d8 --- /dev/null +++ b/owl-bot-staging/google-cloud-retail-v2/lib/google/cloud/retail/v2/conversational_search_service/credentials.rb @@ -0,0 +1,51 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +require "googleauth" + +module Google + module Cloud + module Retail + module V2 + module ConversationalSearchService + # Credentials for the ConversationalSearchService API. + class Credentials < ::Google::Auth::Credentials + self.scope = [ + "https://www.googleapis.com/auth/cloud-platform" + ] + self.env_vars = [ + "RETAIL_CREDENTIALS", + "RETAIL_KEYFILE", + "GOOGLE_CLOUD_CREDENTIALS", + "GOOGLE_CLOUD_KEYFILE", + "GCLOUD_KEYFILE", + "RETAIL_CREDENTIALS_JSON", + "RETAIL_KEYFILE_JSON", + "GOOGLE_CLOUD_CREDENTIALS_JSON", + "GOOGLE_CLOUD_KEYFILE_JSON", + "GCLOUD_KEYFILE_JSON" + ] + self.paths = [ + "~/.config/google_cloud/application_default_credentials.json" + ] + end + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-retail-v2/lib/google/cloud/retail/v2/conversational_search_service/paths.rb b/owl-bot-staging/google-cloud-retail-v2/lib/google/cloud/retail/v2/conversational_search_service/paths.rb new file mode 100644 index 000000000000..f19dca726f47 --- /dev/null +++ b/owl-bot-staging/google-cloud-retail-v2/lib/google/cloud/retail/v2/conversational_search_service/paths.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! + + +module Google + module Cloud + module Retail + module V2 + module ConversationalSearchService + # Path helper methods for the ConversationalSearchService API. + module Paths + ## + # Create a fully-qualified Branch resource string. + # + # The resource will be in the following format: + # + # `projects/{project}/locations/{location}/catalogs/{catalog}/branches/{branch}` + # + # @param project [String] + # @param location [String] + # @param catalog [String] + # @param branch [String] + # + # @return [::String] + def branch_path project:, location:, catalog:, branch: + raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" + raise ::ArgumentError, "location cannot contain /" if location.to_s.include? "/" + raise ::ArgumentError, "catalog cannot contain /" if catalog.to_s.include? "/" + + "projects/#{project}/locations/#{location}/catalogs/#{catalog}/branches/#{branch}" + end + + extend self + end + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-retail-v2/lib/google/cloud/retail/v2/conversational_search_service/rest.rb b/owl-bot-staging/google-cloud-retail-v2/lib/google/cloud/retail/v2/conversational_search_service/rest.rb new file mode 100644 index 000000000000..2177b82399f5 --- /dev/null +++ b/owl-bot-staging/google-cloud-retail-v2/lib/google/cloud/retail/v2/conversational_search_service/rest.rb @@ -0,0 +1,56 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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/retail/v2/version" + +require "google/cloud/retail/v2/conversational_search_service/credentials" +require "google/cloud/retail/v2/conversational_search_service/paths" +require "google/cloud/retail/v2/conversational_search_service/rest/client" + +module Google + module Cloud + module Retail + module V2 + ## + # Service for retail conversational search. + # + # This feature is only available for users who have Retail Conversational + # Search enabled. Enable Retail Conversational Search on Cloud Console + # before using this feature. + # + # To load this service and instantiate a REST client: + # + # require "google/cloud/retail/v2/conversational_search_service/rest" + # client = ::Google::Cloud::Retail::V2::ConversationalSearchService::Rest::Client.new + # + module ConversationalSearchService + # Client for the REST transport + module Rest + end + end + end + end + end +end + +helper_path = ::File.join __dir__, "rest", "helpers.rb" +require "google/cloud/retail/v2/conversational_search_service/rest/helpers" if ::File.file? helper_path diff --git a/owl-bot-staging/google-cloud-retail-v2/lib/google/cloud/retail/v2/conversational_search_service/rest/client.rb b/owl-bot-staging/google-cloud-retail-v2/lib/google/cloud/retail/v2/conversational_search_service/rest/client.rb new file mode 100644 index 000000000000..4145b1924def --- /dev/null +++ b/owl-bot-staging/google-cloud-retail-v2/lib/google/cloud/retail/v2/conversational_search_service/rest/client.rb @@ -0,0 +1,526 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +require "google/cloud/errors" +require "google/cloud/retail/v2/conversational_search_service_pb" +require "google/cloud/retail/v2/conversational_search_service/rest/service_stub" +require "google/cloud/location/rest" + +module Google + module Cloud + module Retail + module V2 + module ConversationalSearchService + module Rest + ## + # REST client for the ConversationalSearchService service. + # + # Service for retail conversational search. + # + # This feature is only available for users who have Retail Conversational + # Search enabled. Enable Retail Conversational Search on Cloud Console + # before using this feature. + # + class Client + # @private + API_VERSION = "" + + # @private + DEFAULT_ENDPOINT_TEMPLATE = "retail.$UNIVERSE_DOMAIN$" + + include Paths + + # @private + attr_reader :conversational_search_service_stub + + ## + # Configure the ConversationalSearchService Client class. + # + # See {::Google::Cloud::Retail::V2::ConversationalSearchService::Rest::Client::Configuration} + # for a description of the configuration fields. + # + # @example + # + # # Modify the configuration for all ConversationalSearchService clients + # ::Google::Cloud::Retail::V2::ConversationalSearchService::Rest::Client.configure do |config| + # config.timeout = 10.0 + # end + # + # @yield [config] Configure the Client client. + # @yieldparam config [Client::Configuration] + # + # @return [Client::Configuration] + # + def self.configure + @configure ||= begin + namespace = ["Google", "Cloud", "Retail", "V2"] + parent_config = while namespace.any? + parent_name = namespace.join "::" + parent_const = const_get parent_name + break parent_const.configure if parent_const.respond_to? :configure + namespace.pop + end + default_config = Client::Configuration.new parent_config + + default_config + end + yield @configure if block_given? + @configure + end + + ## + # Configure the ConversationalSearchService Client instance. + # + # The configuration is set to the derived mode, meaning that values can be changed, + # but structural changes (adding new fields, etc.) are not allowed. Structural changes + # should be made on {Client.configure}. + # + # See {::Google::Cloud::Retail::V2::ConversationalSearchService::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 + @conversational_search_service_stub.universe_domain + end + + ## + # Create a new ConversationalSearchService REST client object. + # + # @example + # + # # Create a client using the default configuration + # client = ::Google::Cloud::Retail::V2::ConversationalSearchService::Rest::Client.new + # + # # Create a client using a custom configuration + # client = ::Google::Cloud::Retail::V2::ConversationalSearchService::Rest::Client.new do |config| + # config.timeout = 10.0 + # end + # + # @yield [config] Configure the ConversationalSearchService 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 + + @conversational_search_service_stub = ::Google::Cloud::Retail::V2::ConversationalSearchService::Rest::ServiceStub.new( + endpoint: @config.endpoint, + endpoint_template: DEFAULT_ENDPOINT_TEMPLATE, + universe_domain: @config.universe_domain, + credentials: credentials, + logger: @config.logger + ) + + @conversational_search_service_stub.logger(stub: true)&.info do |entry| + entry.set_system_name + entry.set_service + entry.message = "Created client for #{entry.service}" + entry.set_credentials_fields credentials + entry.set "customEndpoint", @config.endpoint if @config.endpoint + entry.set "defaultTimeout", @config.timeout if @config.timeout + entry.set "quotaProject", @quota_project_id if @quota_project_id + end + + @location_client = Google::Cloud::Location::Locations::Rest::Client.new do |config| + config.credentials = credentials + config.quota_project = @quota_project_id + config.endpoint = @conversational_search_service_stub.endpoint + config.universe_domain = @conversational_search_service_stub.universe_domain + config.logger = @conversational_search_service_stub.logger if config.respond_to? :logger= + end + end + + ## + # Get the associated client for mix-in of the Locations. + # + # @return [Google::Cloud::Location::Locations::Rest::Client] + # + attr_reader :location_client + + ## + # The logger used for request/response debug logging. + # + # @return [Logger] + # + def logger + @conversational_search_service_stub.logger + end + + # Service calls + + ## + # Performs a conversational search. + # + # This feature is only available for users who have Conversational Search + # enabled. + # + # @overload conversational_search(request, options = nil) + # Pass arguments to `conversational_search` via a request object, either of type + # {::Google::Cloud::Retail::V2::ConversationalSearchRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Retail::V2::ConversationalSearchRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @overload conversational_search(placement: nil, branch: nil, query: nil, page_categories: nil, conversation_id: nil, search_params: nil, visitor_id: nil, user_info: nil, conversational_filtering_spec: nil, user_labels: nil, safety_settings: nil) + # Pass arguments to `conversational_search` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param placement [::String] + # Required. The resource name of the search engine placement, such as + # `projects/*/locations/global/catalogs/default_catalog/placements/default_search` + # or + # `projects/*/locations/global/catalogs/default_catalog/servingConfigs/default_serving_config` + # This field is used to identify the serving config name and the set + # of models that will be used to make the search. + # @param branch [::String] + # Required. The branch resource name, such as + # `projects/*/locations/global/catalogs/default_catalog/branches/0`. + # + # Use "default_branch" as the branch ID or leave this field empty, to search + # products under the default branch. + # @param query [::String] + # Optional. Raw search query to be searched for. + # + # If this field is empty, the request is considered a category browsing + # request. + # @param page_categories [::Array<::String>] + # Optional. The categories associated with a category page. Must be set for + # category navigation queries to achieve good search quality. The format + # should be the same as + # {::Google::Cloud::Retail::V2::UserEvent#page_categories UserEvent.page_categories}; + # + # To represent full path of category, use '>' sign to separate different + # hierarchies. If '>' is part of the category name, replace it with + # other character(s). + # + # Category pages include special pages such as sales or promotions. For + # instance, a special sale page may have the category hierarchy: + # "pageCategories" : ["Sales > 2017 Black Friday Deals"]. + # @param conversation_id [::String] + # Optional. This field specifies the conversation id, which maintains the + # state of the conversation between client side and server side. Use the + # value from the previous + # {::Google::Cloud::Retail::V2::ConversationalSearchResponse#conversation_id ConversationalSearchResponse.conversation_id}. + # For the initial request, this should be empty. + # @param search_params [::Google::Cloud::Retail::V2::ConversationalSearchRequest::SearchParams, ::Hash] + # Optional. Search parameters. + # @param visitor_id [::String] + # Required. A unique identifier for tracking visitors. For example, this + # could be implemented with an HTTP cookie, which should be able to uniquely + # identify a visitor on a single device. This unique identifier should not + # change if the visitor logs in or out of the website. + # + # This should be the same identifier as + # {::Google::Cloud::Retail::V2::UserEvent#visitor_id UserEvent.visitor_id}. + # + # The field must be a UTF-8 encoded string with a length limit of 128 + # characters. Otherwise, an INVALID_ARGUMENT error is returned. + # @param user_info [::Google::Cloud::Retail::V2::UserInfo, ::Hash] + # Optional. User information. + # @param conversational_filtering_spec [::Google::Cloud::Retail::V2::ConversationalSearchRequest::ConversationalFilteringSpec, ::Hash] + # Optional. This field specifies all conversational filtering related + # parameters. + # @param user_labels [::Hash{::String => ::String}] + # Optional. The user labels applied to a resource must meet the following + # requirements: + # + # * Each resource can have multiple labels, up to a maximum of 64. + # * Each label must be a key-value pair. + # * Keys have a minimum length of 1 character and a maximum length of 63 + # characters and cannot be empty. Values can be empty and have a maximum + # length of 63 characters. + # * Keys and values can contain only lowercase letters, numeric characters, + # underscores, and dashes. All characters must use UTF-8 encoding, and + # international characters are allowed. + # * The key portion of a label must be unique. However, you can use the same + # key with multiple resources. + # * Keys must start with a lowercase letter or international character. + # + # See [Google Cloud + # Document](https://cloud.google.com/resource-manager/docs/creating-managing-labels#requirements) + # for more details. + # @param safety_settings [::Array<::Google::Cloud::Retail::V2::SafetySetting, ::Hash>] + # Optional. The safety settings to be applied to the generated content. + # @return [::Enumerable<::Google::Cloud::Retail::V2::ConversationalSearchResponse>] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/retail/v2" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Retail::V2::ConversationalSearchService::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Retail::V2::ConversationalSearchRequest.new + # + # # Call the conversational_search method to start streaming. + # output = client.conversational_search request + # + # # The returned object is a streamed enumerable yielding elements of type + # # ::Google::Cloud::Retail::V2::ConversationalSearchResponse + # output.each do |current_response| + # p current_response + # end + # + def conversational_search request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Retail::V2::ConversationalSearchRequest + + # Converts hash 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.conversational_search.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::Retail::V2::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + options.apply_defaults timeout: @config.rpcs.conversational_search.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.conversational_search.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + ::Gapic::Rest::ServerStream.new( + ::Google::Cloud::Retail::V2::ConversationalSearchResponse, + ::Gapic::Rest::ThreadedEnumerator.new do |in_q, out_q| + @conversational_search_service_stub.conversational_search request, options do |chunk| + in_q.deq + out_q.enq chunk + end + end + ) + rescue ::Gapic::Rest::Error => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Configuration class for the ConversationalSearchService REST API. + # + # This class represents the configuration for ConversationalSearchService REST, + # providing control over timeouts, retry behavior, logging, transport + # parameters, and other low-level controls. Certain parameters can also be + # applied individually to specific RPCs. See + # {::Google::Cloud::Retail::V2::ConversationalSearchService::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 + # # conversational_search to 20 seconds, + # # and all remaining timeouts to 10 seconds. + # ::Google::Cloud::Retail::V2::ConversationalSearchService::Rest::Client.configure do |config| + # config.timeout = 10.0 + # config.rpcs.conversational_search.timeout = 20.0 + # end + # + # # Apply the above configuration only to a new client. + # client = ::Google::Cloud::Retail::V2::ConversationalSearchService::Rest::Client.new do |config| + # config.timeout = 10.0 + # config.rpcs.conversational_search.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 = "retail.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 ConversationalSearchService 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 `conversational_search` + # @return [::Gapic::Config::Method] + # + attr_reader :conversational_search + + # @private + def initialize parent_rpcs = nil + conversational_search_config = parent_rpcs.conversational_search if parent_rpcs.respond_to? :conversational_search + @conversational_search = ::Gapic::Config::Method.new conversational_search_config + + yield self if block_given? + end + end + end + end + end + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-retail-v2/lib/google/cloud/retail/v2/conversational_search_service/rest/service_stub.rb b/owl-bot-staging/google-cloud-retail-v2/lib/google/cloud/retail/v2/conversational_search_service/rest/service_stub.rb new file mode 100644 index 000000000000..45338f592c0b --- /dev/null +++ b/owl-bot-staging/google-cloud-retail-v2/lib/google/cloud/retail/v2/conversational_search_service/rest/service_stub.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! + +require "google/cloud/retail/v2/conversational_search_service_pb" + +module Google + module Cloud + module Retail + module V2 + module ConversationalSearchService + module Rest + ## + # REST service stub for the ConversationalSearchService 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 conversational_search REST call + # + # @param request_pb [::Google::Cloud::Retail::V2::ConversationalSearchRequest] + # 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. + # + # @yieldparam chunk [::String] The chunk of data received during server streaming. + # + # @return [::Gapic::Rest::TransportOperation] + def conversational_search(request_pb, options = nil, &) + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_conversational_search_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: "conversational_search", + options: options, + is_server_streaming: true, + & + ) + ::Gapic::Rest::TransportOperation.new response + end + + ## + # @private + # + # GRPC transcoding helper method for the conversational_search REST call + # + # @param request_pb [::Google::Cloud::Retail::V2::ConversationalSearchRequest] + # A request object representing the call parameters. Required. + # @return [Array(String, [String, nil], Hash{String => String})] + # Uri, Body, Query string parameters + def self.transcode_conversational_search_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :post, + uri_template: "/v2/{placement}:conversationalSearch", + body: "*", + matches: [ + ["placement", %r{^projects/[^/]+/locations/[^/]+/catalogs/[^/]+/placements/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v2/{placement}:conversationalSearch", + body: "*", + matches: [ + ["placement", %r{^projects/[^/]+/locations/[^/]+/catalogs/[^/]+/servingConfigs/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + end + end + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-retail-v2/lib/google/cloud/retail/v2/conversational_search_service_pb.rb b/owl-bot-staging/google-cloud-retail-v2/lib/google/cloud/retail/v2/conversational_search_service_pb.rb new file mode 100644 index 000000000000..9bdaad5fdf84 --- /dev/null +++ b/owl-bot-staging/google-cloud-retail-v2/lib/google/cloud/retail/v2/conversational_search_service_pb.rb @@ -0,0 +1,41 @@ +# frozen_string_literal: true +# Generated by the protocol buffer compiler. DO NOT EDIT! +# source: google/cloud/retail/v2/conversational_search_service.proto + +require 'google/protobuf' + +require 'google/api/annotations_pb' +require 'google/api/client_pb' +require 'google/api/field_behavior_pb' +require 'google/api/resource_pb' +require 'google/cloud/retail/v2/common_pb' +require 'google/cloud/retail/v2/safety_pb' +require 'google/cloud/retail/v2/search_service_pb' + + +descriptor_data = "\n:google/cloud/retail/v2/conversational_search_service.proto\x12\x16google.cloud.retail.v2\x1a\x1cgoogle/api/annotations.proto\x1a\x17google/api/client.proto\x1a\x1fgoogle/api/field_behavior.proto\x1a\x19google/api/resource.proto\x1a#google/cloud/retail/v2/common.proto\x1a#google/cloud/retail/v2/safety.proto\x1a+google/cloud/retail/v2/search_service.proto\"\xef\x0b\n\x1b\x43onversationalSearchRequest\x12\x16\n\tplacement\x18\x01 \x01(\tB\x03\xe0\x41\x02\x12\x34\n\x06\x62ranch\x18\x02 \x01(\tB$\xe0\x41\x02\xfa\x41\x1e\n\x1cretail.googleapis.com/Branch\x12\x12\n\x05query\x18\x03 \x01(\tB\x03\xe0\x41\x01\x12\x1c\n\x0fpage_categories\x18\x04 \x03(\tB\x03\xe0\x41\x01\x12\x1c\n\x0f\x63onversation_id\x18\x05 \x01(\tB\x03\xe0\x41\x01\x12\\\n\rsearch_params\x18\x06 \x01(\x0b\x32@.google.cloud.retail.v2.ConversationalSearchRequest.SearchParamsB\x03\xe0\x41\x01\x12\x17\n\nvisitor_id\x18\t \x01(\tB\x03\xe0\x41\x02\x12\x38\n\tuser_info\x18\x07 \x01(\x0b\x32 .google.cloud.retail.v2.UserInfoB\x03\xe0\x41\x01\x12{\n\x1d\x63onversational_filtering_spec\x18\x08 \x01(\x0b\x32O.google.cloud.retail.v2.ConversationalSearchRequest.ConversationalFilteringSpecB\x03\xe0\x41\x01\x12]\n\x0buser_labels\x18\x0c \x03(\x0b\x32\x43.google.cloud.retail.v2.ConversationalSearchRequest.UserLabelsEntryB\x03\xe0\x41\x01\x12\x43\n\x0fsafety_settings\x18\x0e \x03(\x0b\x32%.google.cloud.retail.v2.SafetySettingB\x03\xe0\x41\x01\x1a\xa2\x01\n\x0cSearchParams\x12\x13\n\x06\x66ilter\x18\x01 \x01(\tB\x03\xe0\x41\x01\x12\x1d\n\x10\x63\x61nonical_filter\x18\x02 \x01(\tB\x03\xe0\x41\x01\x12\x14\n\x07sort_by\x18\x03 \x01(\tB\x03\xe0\x41\x01\x12H\n\nboost_spec\x18\x04 \x01(\x0b\x32/.google.cloud.retail.v2.SearchRequest.BoostSpecB\x03\xe0\x41\x01\x1a\x81\x02\n\nUserAnswer\x12\x15\n\x0btext_answer\x18\x01 \x01(\tH\x00\x12m\n\x0fselected_answer\x18\x02 \x01(\x0b\x32M.google.cloud.retail.v2.ConversationalSearchRequest.UserAnswer.SelectedAnswerB\x03\xe0\x41\x01H\x00\x1a\x65\n\x0eSelectedAnswer\x12S\n\x17product_attribute_value\x18\x01 \x01(\x0b\x32-.google.cloud.retail.v2.ProductAttributeValueB\x03\xe0\x41\x01\x42\x06\n\x04type\x1a\x83\x03\n\x1b\x43onversationalFilteringSpec\x12.\n\x1f\x65nable_conversational_filtering\x18\x01 \x01(\x08\x42\x05\x18\x01\xe0\x41\x01\x12X\n\x0buser_answer\x18\x02 \x01(\x0b\x32>.google.cloud.retail.v2.ConversationalSearchRequest.UserAnswerB\x03\xe0\x41\x01\x12\x80\x01\n\x1d\x63onversational_filtering_mode\x18\x04 \x01(\x0e\x32T.google.cloud.retail.v2.ConversationalSearchRequest.ConversationalFilteringSpec.ModeB\x03\xe0\x41\x01\"W\n\x04Mode\x12\x14\n\x10MODE_UNSPECIFIED\x10\x00\x12\x0c\n\x08\x44ISABLED\x10\x01\x12\x0b\n\x07\x45NABLED\x10\x02\x12\x1e\n\x1a\x43ONVERSATIONAL_FILTER_ONLY\x10\x03\x1a\x31\n\x0fUserLabelsEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12\r\n\x05value\x18\x02 \x01(\t:\x02\x38\x01\"\xcd\t\n\x1c\x43onversationalSearchResponse\x12\x18\n\x10user_query_types\x18\n \x03(\t\x12$\n\x1c\x63onversational_text_response\x18\x02 \x01(\t\x12`\n\x11\x66ollowup_question\x18\x03 \x01(\x0b\x32\x45.google.cloud.retail.v2.ConversationalSearchResponse.FollowupQuestion\x12\x17\n\x0f\x63onversation_id\x18\x04 \x01(\t\x12Z\n\x0erefined_search\x18\x06 \x03(\x0b\x32\x42.google.cloud.retail.v2.ConversationalSearchResponse.RefinedSearch\x12{\n\x1f\x63onversational_filtering_result\x18\x07 \x01(\x0b\x32R.google.cloud.retail.v2.ConversationalSearchResponse.ConversationalFilteringResult\x12N\n\x05state\x18\t \x01(\x0e\x32:.google.cloud.retail.v2.ConversationalSearchResponse.StateB\x03\xe0\x41\x03\x1a\x82\x02\n\x10\x46ollowupQuestion\x12\x19\n\x11\x66ollowup_question\x18\x01 \x01(\t\x12p\n\x11suggested_answers\x18\x02 \x03(\x0b\x32U.google.cloud.retail.v2.ConversationalSearchResponse.FollowupQuestion.SuggestedAnswer\x1a\x61\n\x0fSuggestedAnswer\x12N\n\x17product_attribute_value\x18\x01 \x01(\x0b\x32-.google.cloud.retail.v2.ProductAttributeValue\x1a\x1e\n\rRefinedSearch\x12\r\n\x05query\x18\x01 \x01(\t\x1a\xe5\x02\n\x1d\x43onversationalFilteringResult\x12`\n\x11\x66ollowup_question\x18\x01 \x01(\x0b\x32\x45.google.cloud.retail.v2.ConversationalSearchResponse.FollowupQuestion\x12~\n\x11\x61\x64\x64itional_filter\x18\x02 \x01(\x0b\x32\x63.google.cloud.retail.v2.ConversationalSearchResponse.ConversationalFilteringResult.AdditionalFilter\x1a\x62\n\x10\x41\x64\x64itionalFilter\x12N\n\x17product_attribute_value\x18\x01 \x01(\x0b\x32-.google.cloud.retail.v2.ProductAttributeValue\"<\n\x05State\x12\x15\n\x11STATE_UNSPECIFIED\x10\x00\x12\r\n\tSTREAMING\x10\x01\x12\r\n\tSUCCEEDED\x10\x02\x32\xae\x03\n\x1b\x43onversationalSearchService\x12\xc3\x02\n\x14\x43onversationalSearch\x12\x33.google.cloud.retail.v2.ConversationalSearchRequest\x1a\x34.google.cloud.retail.v2.ConversationalSearchResponse\"\xbd\x01\x82\xd3\xe4\x93\x02\xb6\x01\"S/v2/{placement=projects/*/locations/*/catalogs/*/placements/*}:conversationalSearch:\x01*Z\\\"W/v2/{placement=projects/*/locations/*/catalogs/*/servingConfigs/*}:conversationalSearch:\x01*0\x01\x1aI\xca\x41\x15retail.googleapis.com\xd2\x41.https://www.googleapis.com/auth/cloud-platformB\xcb\x01\n\x1a\x63om.google.cloud.retail.v2B ConversationalSearchServiceProtoP\x01Z2cloud.google.com/go/retail/apiv2/retailpb;retailpb\xa2\x02\x06RETAIL\xaa\x02\x16Google.Cloud.Retail.V2\xca\x02\x16Google\\Cloud\\Retail\\V2\xea\x02\x19Google::Cloud::Retail::V2b\x06proto3" + +pool = ::Google::Protobuf::DescriptorPool.generated_pool +pool.add_serialized_file(descriptor_data) + +module Google + module Cloud + module Retail + module V2 + ConversationalSearchRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.retail.v2.ConversationalSearchRequest").msgclass + ConversationalSearchRequest::SearchParams = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.retail.v2.ConversationalSearchRequest.SearchParams").msgclass + ConversationalSearchRequest::UserAnswer = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.retail.v2.ConversationalSearchRequest.UserAnswer").msgclass + ConversationalSearchRequest::UserAnswer::SelectedAnswer = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.retail.v2.ConversationalSearchRequest.UserAnswer.SelectedAnswer").msgclass + ConversationalSearchRequest::ConversationalFilteringSpec = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.retail.v2.ConversationalSearchRequest.ConversationalFilteringSpec").msgclass + ConversationalSearchRequest::ConversationalFilteringSpec::Mode = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.retail.v2.ConversationalSearchRequest.ConversationalFilteringSpec.Mode").enummodule + ConversationalSearchResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.retail.v2.ConversationalSearchResponse").msgclass + ConversationalSearchResponse::FollowupQuestion = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.retail.v2.ConversationalSearchResponse.FollowupQuestion").msgclass + ConversationalSearchResponse::FollowupQuestion::SuggestedAnswer = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.retail.v2.ConversationalSearchResponse.FollowupQuestion.SuggestedAnswer").msgclass + ConversationalSearchResponse::RefinedSearch = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.retail.v2.ConversationalSearchResponse.RefinedSearch").msgclass + ConversationalSearchResponse::ConversationalFilteringResult = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.retail.v2.ConversationalSearchResponse.ConversationalFilteringResult").msgclass + ConversationalSearchResponse::ConversationalFilteringResult::AdditionalFilter = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.retail.v2.ConversationalSearchResponse.ConversationalFilteringResult.AdditionalFilter").msgclass + ConversationalSearchResponse::State = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.retail.v2.ConversationalSearchResponse.State").enummodule + end + end + end +end diff --git a/owl-bot-staging/google-cloud-retail-v2/lib/google/cloud/retail/v2/conversational_search_service_services_pb.rb b/owl-bot-staging/google-cloud-retail-v2/lib/google/cloud/retail/v2/conversational_search_service_services_pb.rb new file mode 100644 index 000000000000..f89ba3e94889 --- /dev/null +++ b/owl-bot-staging/google-cloud-retail-v2/lib/google/cloud/retail/v2/conversational_search_service_services_pb.rb @@ -0,0 +1,52 @@ +# Generated by the protocol buffer compiler. DO NOT EDIT! +# Source: google/cloud/retail/v2/conversational_search_service.proto for package 'Google.Cloud.Retail.V2' +# Original file comments: +# 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 +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# + +require 'grpc' +require 'google/cloud/retail/v2/conversational_search_service_pb' + +module Google + module Cloud + module Retail + module V2 + module ConversationalSearchService + # Service for retail conversational search. + # + # This feature is only available for users who have Retail Conversational + # Search enabled. Enable Retail Conversational Search on Cloud Console + # before using this feature. + class Service + + include ::GRPC::GenericService + + self.marshal_class_method = :encode + self.unmarshal_class_method = :decode + self.service_name = 'google.cloud.retail.v2.ConversationalSearchService' + + # Performs a conversational search. + # + # This feature is only available for users who have Conversational Search + # enabled. + rpc :ConversationalSearch, ::Google::Cloud::Retail::V2::ConversationalSearchRequest, stream(::Google::Cloud::Retail::V2::ConversationalSearchResponse) + end + + Stub = Service.rpc_stub_class + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-retail-v2/lib/google/cloud/retail/v2/export_config_pb.rb b/owl-bot-staging/google-cloud-retail-v2/lib/google/cloud/retail/v2/export_config_pb.rb new file mode 100644 index 000000000000..0799bfb12534 --- /dev/null +++ b/owl-bot-staging/google-cloud-retail-v2/lib/google/cloud/retail/v2/export_config_pb.rb @@ -0,0 +1,35 @@ +# frozen_string_literal: true +# Generated by the protocol buffer compiler. DO NOT EDIT! +# source: google/cloud/retail/v2/export_config.proto + +require 'google/protobuf' + +require 'google/api/field_behavior_pb' +require 'google/api/resource_pb' +require 'google/protobuf/timestamp_pb' +require 'google/rpc/status_pb' + + +descriptor_data = "\n*google/cloud/retail/v2/export_config.proto\x12\x16google.cloud.retail.v2\x1a\x1fgoogle/api/field_behavior.proto\x1a\x19google/api/resource.proto\x1a\x1fgoogle/protobuf/timestamp.proto\x1a\x17google/rpc/status.proto\"\xe0\x02\n\x0cOutputConfig\x12N\n\x0fgcs_destination\x18\x01 \x01(\x0b\x32\x33.google.cloud.retail.v2.OutputConfig.GcsDestinationH\x00\x12X\n\x14\x62igquery_destination\x18\x02 \x01(\x0b\x32\x38.google.cloud.retail.v2.OutputConfig.BigQueryDestinationH\x00\x1a\x30\n\x0eGcsDestination\x12\x1e\n\x11output_uri_prefix\x18\x01 \x01(\tB\x03\xe0\x41\x02\x1a\x65\n\x13\x42igQueryDestination\x12\x17\n\ndataset_id\x18\x01 \x01(\tB\x03\xe0\x41\x02\x12\x1c\n\x0ftable_id_prefix\x18\x02 \x01(\tB\x03\xe0\x41\x02\x12\x17\n\ntable_type\x18\x03 \x01(\tB\x03\xe0\x41\x02\x42\r\n\x0b\x64\x65stination\"9\n\x12\x45xportErrorsConfig\x12\x14\n\ngcs_prefix\x18\x01 \x01(\tH\x00\x42\r\n\x0b\x64\x65stination\"\x87\x01\n\x1d\x45xportAnalyticsMetricsRequest\x12\x14\n\x07\x63\x61talog\x18\x01 \x01(\tB\x03\xe0\x41\x02\x12@\n\routput_config\x18\x02 \x01(\x0b\x32$.google.cloud.retail.v2.OutputConfigB\x03\xe0\x41\x02\x12\x0e\n\x06\x66ilter\x18\x03 \x01(\t\"r\n\x0e\x45xportMetadata\x12/\n\x0b\x63reate_time\x18\x01 \x01(\x0b\x32\x1a.google.protobuf.Timestamp\x12/\n\x0bupdate_time\x18\x02 \x01(\x0b\x32\x1a.google.protobuf.Timestamp\"\xcb\x01\n\x1e\x45xportAnalyticsMetricsResponse\x12)\n\rerror_samples\x18\x01 \x03(\x0b\x32\x12.google.rpc.Status\x12\x41\n\rerrors_config\x18\x02 \x01(\x0b\x32*.google.cloud.retail.v2.ExportErrorsConfig\x12;\n\routput_result\x18\x03 \x01(\x0b\x32$.google.cloud.retail.v2.OutputResult\"\x92\x01\n\x0cOutputResult\x12\x45\n\x0f\x62igquery_result\x18\x01 \x03(\x0b\x32,.google.cloud.retail.v2.BigQueryOutputResult\x12;\n\ngcs_result\x18\x02 \x03(\x0b\x32\'.google.cloud.retail.v2.GcsOutputResult\"<\n\x14\x42igQueryOutputResult\x12\x12\n\ndataset_id\x18\x01 \x01(\t\x12\x10\n\x08table_id\x18\x02 \x01(\t\"%\n\x0fGcsOutputResult\x12\x12\n\noutput_uri\x18\x01 \x01(\tB\xbc\x01\n\x1a\x63om.google.cloud.retail.v2B\x11\x45xportConfigProtoP\x01Z2cloud.google.com/go/retail/apiv2/retailpb;retailpb\xa2\x02\x06RETAIL\xaa\x02\x16Google.Cloud.Retail.V2\xca\x02\x16Google\\Cloud\\Retail\\V2\xea\x02\x19Google::Cloud::Retail::V2b\x06proto3" + +pool = ::Google::Protobuf::DescriptorPool.generated_pool +pool.add_serialized_file(descriptor_data) + +module Google + module Cloud + module Retail + module V2 + OutputConfig = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.retail.v2.OutputConfig").msgclass + OutputConfig::GcsDestination = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.retail.v2.OutputConfig.GcsDestination").msgclass + OutputConfig::BigQueryDestination = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.retail.v2.OutputConfig.BigQueryDestination").msgclass + ExportErrorsConfig = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.retail.v2.ExportErrorsConfig").msgclass + ExportAnalyticsMetricsRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.retail.v2.ExportAnalyticsMetricsRequest").msgclass + ExportMetadata = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.retail.v2.ExportMetadata").msgclass + ExportAnalyticsMetricsResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.retail.v2.ExportAnalyticsMetricsResponse").msgclass + OutputResult = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.retail.v2.OutputResult").msgclass + BigQueryOutputResult = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.retail.v2.BigQueryOutputResult").msgclass + GcsOutputResult = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.retail.v2.GcsOutputResult").msgclass + end + end + end +end diff --git a/owl-bot-staging/google-cloud-retail-v2/lib/google/cloud/retail/v2/generative_question_pb.rb b/owl-bot-staging/google-cloud-retail-v2/lib/google/cloud/retail/v2/generative_question_pb.rb new file mode 100644 index 000000000000..39063cf59e06 --- /dev/null +++ b/owl-bot-staging/google-cloud-retail-v2/lib/google/cloud/retail/v2/generative_question_pb.rb @@ -0,0 +1,24 @@ +# frozen_string_literal: true +# Generated by the protocol buffer compiler. DO NOT EDIT! +# source: google/cloud/retail/v2/generative_question.proto + +require 'google/protobuf' + +require 'google/api/field_behavior_pb' + + +descriptor_data = "\n0google/cloud/retail/v2/generative_question.proto\x12\x16google.cloud.retail.v2\x1a\x1fgoogle/api/field_behavior.proto\"u\n GenerativeQuestionsFeatureConfig\x12\x14\n\x07\x63\x61talog\x18\x01 \x01(\tB\x03\xe0\x41\x02\x12\x1c\n\x0f\x66\x65\x61ture_enabled\x18\x02 \x01(\x08\x42\x03\xe0\x41\x01\x12\x1d\n\x10minimum_products\x18\x03 \x01(\x05\x42\x03\xe0\x41\x01\"\xdd\x01\n\x18GenerativeQuestionConfig\x12\x14\n\x07\x63\x61talog\x18\x01 \x01(\tB\x03\xe0\x41\x02\x12\x12\n\x05\x66\x61\x63\x65t\x18\x02 \x01(\tB\x03\xe0\x41\x02\x12\x1f\n\x12generated_question\x18\x03 \x01(\tB\x03\xe0\x41\x03\x12\x1b\n\x0e\x66inal_question\x18\x04 \x01(\tB\x03\xe0\x41\x01\x12\x1b\n\x0e\x65xample_values\x18\x05 \x03(\tB\x03\xe0\x41\x03\x12\x16\n\tfrequency\x18\x06 \x01(\x02\x42\x03\xe0\x41\x03\x12$\n\x17\x61llowed_in_conversation\x18\x07 \x01(\x08\x42\x03\xe0\x41\x01\x42\xc2\x01\n\x1a\x63om.google.cloud.retail.v2B\x17GenerativeQuestionProtoP\x01Z2cloud.google.com/go/retail/apiv2/retailpb;retailpb\xa2\x02\x06RETAIL\xaa\x02\x16Google.Cloud.Retail.V2\xca\x02\x16Google\\Cloud\\Retail\\V2\xea\x02\x19Google::Cloud::Retail::V2b\x06proto3" + +pool = ::Google::Protobuf::DescriptorPool.generated_pool +pool.add_serialized_file(descriptor_data) + +module Google + module Cloud + module Retail + module V2 + GenerativeQuestionsFeatureConfig = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.retail.v2.GenerativeQuestionsFeatureConfig").msgclass + GenerativeQuestionConfig = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.retail.v2.GenerativeQuestionConfig").msgclass + end + end + end +end diff --git a/owl-bot-staging/google-cloud-retail-v2/lib/google/cloud/retail/v2/generative_question_service.rb b/owl-bot-staging/google-cloud-retail-v2/lib/google/cloud/retail/v2/generative_question_service.rb new file mode 100644 index 000000000000..820d713f4e45 --- /dev/null +++ b/owl-bot-staging/google-cloud-retail-v2/lib/google/cloud/retail/v2/generative_question_service.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/retail/v2/version" + +require "google/cloud/retail/v2/generative_question_service/credentials" +require "google/cloud/retail/v2/generative_question_service/paths" +require "google/cloud/retail/v2/generative_question_service/client" +require "google/cloud/retail/v2/generative_question_service/rest" + +module Google + module Cloud + module Retail + module V2 + ## + # Service for managing LLM generated questions in search serving. + # + # @example Load this service and instantiate a gRPC client + # + # require "google/cloud/retail/v2/generative_question_service" + # client = ::Google::Cloud::Retail::V2::GenerativeQuestionService::Client.new + # + # @example Load this service and instantiate a REST client + # + # require "google/cloud/retail/v2/generative_question_service/rest" + # client = ::Google::Cloud::Retail::V2::GenerativeQuestionService::Rest::Client.new + # + module GenerativeQuestionService + end + end + end + end +end + +helper_path = ::File.join __dir__, "generative_question_service", "helpers.rb" +require "google/cloud/retail/v2/generative_question_service/helpers" if ::File.file? helper_path diff --git a/owl-bot-staging/google-cloud-retail-v2/lib/google/cloud/retail/v2/generative_question_service/client.rb b/owl-bot-staging/google-cloud-retail-v2/lib/google/cloud/retail/v2/generative_question_service/client.rb new file mode 100644 index 000000000000..9167224e564f --- /dev/null +++ b/owl-bot-staging/google-cloud-retail-v2/lib/google/cloud/retail/v2/generative_question_service/client.rb @@ -0,0 +1,877 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +require "google/cloud/errors" +require "google/cloud/retail/v2/generative_question_service_pb" +require "google/cloud/location" + +module Google + module Cloud + module Retail + module V2 + module GenerativeQuestionService + ## + # Client for the GenerativeQuestionService service. + # + # Service for managing LLM generated questions in search serving. + # + class Client + # @private + API_VERSION = "" + + # @private + DEFAULT_ENDPOINT_TEMPLATE = "retail.$UNIVERSE_DOMAIN$" + + include Paths + + # @private + attr_reader :generative_question_service_stub + + ## + # Configure the GenerativeQuestionService Client class. + # + # See {::Google::Cloud::Retail::V2::GenerativeQuestionService::Client::Configuration} + # for a description of the configuration fields. + # + # @example + # + # # Modify the configuration for all GenerativeQuestionService clients + # ::Google::Cloud::Retail::V2::GenerativeQuestionService::Client.configure do |config| + # config.timeout = 10.0 + # end + # + # @yield [config] Configure the Client client. + # @yieldparam config [Client::Configuration] + # + # @return [Client::Configuration] + # + def self.configure + @configure ||= begin + namespace = ["Google", "Cloud", "Retail", "V2"] + parent_config = while namespace.any? + parent_name = namespace.join "::" + parent_const = const_get parent_name + break parent_const.configure if parent_const.respond_to? :configure + namespace.pop + end + default_config = Client::Configuration.new parent_config + + default_config + end + yield @configure if block_given? + @configure + end + + ## + # Configure the GenerativeQuestionService Client instance. + # + # The configuration is set to the derived mode, meaning that values can be changed, + # but structural changes (adding new fields, etc.) are not allowed. Structural changes + # should be made on {Client.configure}. + # + # See {::Google::Cloud::Retail::V2::GenerativeQuestionService::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 + @generative_question_service_stub.universe_domain + end + + ## + # Create a new GenerativeQuestionService client object. + # + # @example + # + # # Create a client using the default configuration + # client = ::Google::Cloud::Retail::V2::GenerativeQuestionService::Client.new + # + # # Create a client using a custom configuration + # client = ::Google::Cloud::Retail::V2::GenerativeQuestionService::Client.new do |config| + # config.timeout = 10.0 + # end + # + # @yield [config] Configure the GenerativeQuestionService client. + # @yieldparam config [Client::Configuration] + # + def initialize + # These require statements are intentionally placed here to initialize + # the gRPC module only when it's required. + # See https://github.com/googleapis/toolkit/issues/446 + require "gapic/grpc" + require "google/cloud/retail/v2/generative_question_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 + + @generative_question_service_stub = ::Gapic::ServiceStub.new( + ::Google::Cloud::Retail::V2::GenerativeQuestionService::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 + ) + + @generative_question_service_stub.stub_logger&.info do |entry| + entry.set_system_name + entry.set_service + entry.message = "Created client for #{entry.service}" + entry.set_credentials_fields credentials + entry.set "customEndpoint", @config.endpoint if @config.endpoint + entry.set "defaultTimeout", @config.timeout if @config.timeout + entry.set "quotaProject", @quota_project_id if @quota_project_id + end + + @location_client = Google::Cloud::Location::Locations::Client.new do |config| + config.credentials = credentials + config.quota_project = @quota_project_id + config.endpoint = @generative_question_service_stub.endpoint + config.universe_domain = @generative_question_service_stub.universe_domain + config.logger = @generative_question_service_stub.logger if config.respond_to? :logger= + end + end + + ## + # Get the associated client for mix-in of the Locations. + # + # @return [Google::Cloud::Location::Locations::Client] + # + attr_reader :location_client + + ## + # The logger used for request/response debug logging. + # + # @return [Logger] + # + def logger + @generative_question_service_stub.logger + end + + # Service calls + + ## + # Manages overal generative question feature state -- enables toggling + # feature on and off. + # + # @overload update_generative_questions_feature_config(request, options = nil) + # Pass arguments to `update_generative_questions_feature_config` via a request object, either of type + # {::Google::Cloud::Retail::V2::UpdateGenerativeQuestionsFeatureConfigRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Retail::V2::UpdateGenerativeQuestionsFeatureConfigRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_generative_questions_feature_config(generative_questions_feature_config: nil, update_mask: nil) + # Pass arguments to `update_generative_questions_feature_config` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param generative_questions_feature_config [::Google::Cloud::Retail::V2::GenerativeQuestionsFeatureConfig, ::Hash] + # Required. The configuration managing the feature state. + # @param update_mask [::Google::Protobuf::FieldMask, ::Hash] + # Optional. Indicates which fields in the provided + # {::Google::Cloud::Retail::V2::GenerativeQuestionsFeatureConfig GenerativeQuestionsFeatureConfig} + # to update. If not set or empty, all supported fields are updated. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Google::Cloud::Retail::V2::GenerativeQuestionsFeatureConfig] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Google::Cloud::Retail::V2::GenerativeQuestionsFeatureConfig] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/retail/v2" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Retail::V2::GenerativeQuestionService::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Retail::V2::UpdateGenerativeQuestionsFeatureConfigRequest.new + # + # # Call the update_generative_questions_feature_config method. + # result = client.update_generative_questions_feature_config request + # + # # The returned object is of type Google::Cloud::Retail::V2::GenerativeQuestionsFeatureConfig. + # p result + # + def update_generative_questions_feature_config request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Retail::V2::UpdateGenerativeQuestionsFeatureConfigRequest + + # Converts hash 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_generative_questions_feature_config.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::Retail::V2::VERSION + metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.generative_questions_feature_config&.catalog + header_params["generative_questions_feature_config.catalog"] = request.generative_questions_feature_config.catalog + 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_generative_questions_feature_config.timeout, + metadata: metadata, + retry_policy: @config.rpcs.update_generative_questions_feature_config.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @generative_question_service_stub.call_rpc :update_generative_questions_feature_config, request, options: options do |response, operation| + yield response, operation if block_given? + end + rescue ::GRPC::BadStatus => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Manages overal generative question feature state -- enables toggling + # feature on and off. + # + # @overload get_generative_questions_feature_config(request, options = nil) + # Pass arguments to `get_generative_questions_feature_config` via a request object, either of type + # {::Google::Cloud::Retail::V2::GetGenerativeQuestionsFeatureConfigRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Retail::V2::GetGenerativeQuestionsFeatureConfigRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_generative_questions_feature_config(catalog: nil) + # Pass arguments to `get_generative_questions_feature_config` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param catalog [::String] + # Required. Resource name of the parent catalog. + # Format: projects/\\{project}/locations/\\{location}/catalogs/\\{catalog} + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Google::Cloud::Retail::V2::GenerativeQuestionsFeatureConfig] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Google::Cloud::Retail::V2::GenerativeQuestionsFeatureConfig] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/retail/v2" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Retail::V2::GenerativeQuestionService::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Retail::V2::GetGenerativeQuestionsFeatureConfigRequest.new + # + # # Call the get_generative_questions_feature_config method. + # result = client.get_generative_questions_feature_config request + # + # # The returned object is of type Google::Cloud::Retail::V2::GenerativeQuestionsFeatureConfig. + # p result + # + def get_generative_questions_feature_config request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Retail::V2::GetGenerativeQuestionsFeatureConfigRequest + + # Converts hash 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_generative_questions_feature_config.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::Retail::V2::VERSION + metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.catalog + header_params["catalog"] = request.catalog + 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_generative_questions_feature_config.timeout, + metadata: metadata, + retry_policy: @config.rpcs.get_generative_questions_feature_config.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @generative_question_service_stub.call_rpc :get_generative_questions_feature_config, request, options: options do |response, operation| + yield response, operation if block_given? + end + rescue ::GRPC::BadStatus => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Returns all questions for a given catalog. + # + # @overload list_generative_question_configs(request, options = nil) + # Pass arguments to `list_generative_question_configs` via a request object, either of type + # {::Google::Cloud::Retail::V2::ListGenerativeQuestionConfigsRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Retail::V2::ListGenerativeQuestionConfigsRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_generative_question_configs(parent: nil) + # Pass arguments to `list_generative_question_configs` via keyword arguments. Note that at + # least one keyword argument is 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. Resource name of the parent catalog. + # Format: projects/\\{project}/locations/\\{location}/catalogs/\\{catalog} + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Google::Cloud::Retail::V2::ListGenerativeQuestionConfigsResponse] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Google::Cloud::Retail::V2::ListGenerativeQuestionConfigsResponse] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/retail/v2" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Retail::V2::GenerativeQuestionService::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Retail::V2::ListGenerativeQuestionConfigsRequest.new + # + # # Call the list_generative_question_configs method. + # result = client.list_generative_question_configs request + # + # # The returned object is of type Google::Cloud::Retail::V2::ListGenerativeQuestionConfigsResponse. + # p result + # + def list_generative_question_configs request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Retail::V2::ListGenerativeQuestionConfigsRequest + + # Converts hash 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_generative_question_configs.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::Retail::V2::VERSION + metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.parent + 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_generative_question_configs.timeout, + metadata: metadata, + retry_policy: @config.rpcs.list_generative_question_configs.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @generative_question_service_stub.call_rpc :list_generative_question_configs, 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 + + ## + # Allows management of individual questions. + # + # @overload update_generative_question_config(request, options = nil) + # Pass arguments to `update_generative_question_config` via a request object, either of type + # {::Google::Cloud::Retail::V2::UpdateGenerativeQuestionConfigRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Retail::V2::UpdateGenerativeQuestionConfigRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_generative_question_config(generative_question_config: nil, update_mask: nil) + # Pass arguments to `update_generative_question_config` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param generative_question_config [::Google::Cloud::Retail::V2::GenerativeQuestionConfig, ::Hash] + # Required. The question to update. + # @param update_mask [::Google::Protobuf::FieldMask, ::Hash] + # Optional. Indicates which fields in the provided + # {::Google::Cloud::Retail::V2::GenerativeQuestionConfig GenerativeQuestionConfig} + # to update. The following are NOT supported: + # + # * {::Google::Cloud::Retail::V2::GenerativeQuestionConfig#frequency GenerativeQuestionConfig.frequency} + # + # If not set or empty, all supported fields are updated. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Google::Cloud::Retail::V2::GenerativeQuestionConfig] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Google::Cloud::Retail::V2::GenerativeQuestionConfig] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/retail/v2" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Retail::V2::GenerativeQuestionService::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Retail::V2::UpdateGenerativeQuestionConfigRequest.new + # + # # Call the update_generative_question_config method. + # result = client.update_generative_question_config request + # + # # The returned object is of type Google::Cloud::Retail::V2::GenerativeQuestionConfig. + # p result + # + def update_generative_question_config request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Retail::V2::UpdateGenerativeQuestionConfigRequest + + # Converts hash 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_generative_question_config.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::Retail::V2::VERSION + metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.generative_question_config&.catalog + header_params["generative_question_config.catalog"] = request.generative_question_config.catalog + 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_generative_question_config.timeout, + metadata: metadata, + retry_policy: @config.rpcs.update_generative_question_config.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @generative_question_service_stub.call_rpc :update_generative_question_config, request, options: options do |response, operation| + yield response, operation if block_given? + end + rescue ::GRPC::BadStatus => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Allows management of multiple questions. + # + # @overload batch_update_generative_question_configs(request, options = nil) + # Pass arguments to `batch_update_generative_question_configs` via a request object, either of type + # {::Google::Cloud::Retail::V2::BatchUpdateGenerativeQuestionConfigsRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Retail::V2::BatchUpdateGenerativeQuestionConfigsRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. + # + # @overload batch_update_generative_question_configs(parent: nil, requests: nil) + # Pass arguments to `batch_update_generative_question_configs` via keyword arguments. Note that at + # least one keyword argument is 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] + # Optional. Resource name of the parent catalog. + # Format: projects/\\{project}/locations/\\{location}/catalogs/\\{catalog} + # @param requests [::Array<::Google::Cloud::Retail::V2::UpdateGenerativeQuestionConfigRequest, ::Hash>] + # Required. The updates question configs. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Google::Cloud::Retail::V2::BatchUpdateGenerativeQuestionConfigsResponse] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Google::Cloud::Retail::V2::BatchUpdateGenerativeQuestionConfigsResponse] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/retail/v2" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Retail::V2::GenerativeQuestionService::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Retail::V2::BatchUpdateGenerativeQuestionConfigsRequest.new + # + # # Call the batch_update_generative_question_configs method. + # result = client.batch_update_generative_question_configs request + # + # # The returned object is of type Google::Cloud::Retail::V2::BatchUpdateGenerativeQuestionConfigsResponse. + # p result + # + def batch_update_generative_question_configs request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Retail::V2::BatchUpdateGenerativeQuestionConfigsRequest + + # Converts hash 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.batch_update_generative_question_configs.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::Retail::V2::VERSION + metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.parent + 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.batch_update_generative_question_configs.timeout, + metadata: metadata, + retry_policy: @config.rpcs.batch_update_generative_question_configs.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @generative_question_service_stub.call_rpc :batch_update_generative_question_configs, request, options: options do |response, operation| + yield response, operation if block_given? + end + rescue ::GRPC::BadStatus => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Configuration class for the GenerativeQuestionService API. + # + # This class represents the configuration for GenerativeQuestionService, + # providing control over timeouts, retry behavior, logging, transport + # parameters, and other low-level controls. Certain parameters can also be + # applied individually to specific RPCs. See + # {::Google::Cloud::Retail::V2::GenerativeQuestionService::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 + # # update_generative_questions_feature_config to 20 seconds, + # # and all remaining timeouts to 10 seconds. + # ::Google::Cloud::Retail::V2::GenerativeQuestionService::Client.configure do |config| + # config.timeout = 10.0 + # config.rpcs.update_generative_questions_feature_config.timeout = 20.0 + # end + # + # # Apply the above configuration only to a new client. + # client = ::Google::Cloud::Retail::V2::GenerativeQuestionService::Client.new do |config| + # config.timeout = 10.0 + # config.rpcs.update_generative_questions_feature_config.timeout = 20.0 + # end + # + # @!attribute [rw] endpoint + # A custom service endpoint, as a hostname or hostname:port. The default is + # nil, indicating to use the default endpoint in the current universe domain. + # @return [::String,nil] + # @!attribute [rw] credentials + # Credentials to send with calls. You may provide any of the following types: + # * (`Google::Auth::Credentials`) A googleauth credentials object + # (see the [googleauth docs](https://rubydoc.info/gems/googleauth/Google/Auth/Credentials)) + # * (`Signet::OAuth2::Client`) A signet oauth2 client object + # (see the [signet docs](https://rubydoc.info/gems/signet/Signet/OAuth2/Client)) + # * (`GRPC::Core::Channel`) a gRPC channel with included credentials + # * (`GRPC::Core::ChannelCredentials`) a gRPC credentails object + # * (`nil`) indicating no credentials + # + # @note Warning: Passing a `String` to a keyfile path or a `Hash` of credentials + # is deprecated. Providing an unvalidated credential configuration to + # Google APIs can compromise the security of your systems and data. + # + # @example + # + # # The recommended way to provide credentials is to use the `make_creds` method + # # on the appropriate credentials class for your environment. + # + # require "googleauth" + # + # credentials = ::Google::Auth::ServiceAccountCredentials.make_creds( + # json_key_io: ::File.open("/path/to/keyfile.json") + # ) + # + # client = ::Google::Cloud::Retail::V2::GenerativeQuestionService::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 = "retail.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 GenerativeQuestionService 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 `update_generative_questions_feature_config` + # @return [::Gapic::Config::Method] + # + attr_reader :update_generative_questions_feature_config + ## + # RPC-specific configuration for `get_generative_questions_feature_config` + # @return [::Gapic::Config::Method] + # + attr_reader :get_generative_questions_feature_config + ## + # RPC-specific configuration for `list_generative_question_configs` + # @return [::Gapic::Config::Method] + # + attr_reader :list_generative_question_configs + ## + # RPC-specific configuration for `update_generative_question_config` + # @return [::Gapic::Config::Method] + # + attr_reader :update_generative_question_config + ## + # RPC-specific configuration for `batch_update_generative_question_configs` + # @return [::Gapic::Config::Method] + # + attr_reader :batch_update_generative_question_configs + + # @private + def initialize parent_rpcs = nil + update_generative_questions_feature_config_config = parent_rpcs.update_generative_questions_feature_config if parent_rpcs.respond_to? :update_generative_questions_feature_config + @update_generative_questions_feature_config = ::Gapic::Config::Method.new update_generative_questions_feature_config_config + get_generative_questions_feature_config_config = parent_rpcs.get_generative_questions_feature_config if parent_rpcs.respond_to? :get_generative_questions_feature_config + @get_generative_questions_feature_config = ::Gapic::Config::Method.new get_generative_questions_feature_config_config + list_generative_question_configs_config = parent_rpcs.list_generative_question_configs if parent_rpcs.respond_to? :list_generative_question_configs + @list_generative_question_configs = ::Gapic::Config::Method.new list_generative_question_configs_config + update_generative_question_config_config = parent_rpcs.update_generative_question_config if parent_rpcs.respond_to? :update_generative_question_config + @update_generative_question_config = ::Gapic::Config::Method.new update_generative_question_config_config + batch_update_generative_question_configs_config = parent_rpcs.batch_update_generative_question_configs if parent_rpcs.respond_to? :batch_update_generative_question_configs + @batch_update_generative_question_configs = ::Gapic::Config::Method.new batch_update_generative_question_configs_config + + yield self if block_given? + end + end + end + end + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-retail-v2/lib/google/cloud/retail/v2/generative_question_service/credentials.rb b/owl-bot-staging/google-cloud-retail-v2/lib/google/cloud/retail/v2/generative_question_service/credentials.rb new file mode 100644 index 000000000000..15af3d895c06 --- /dev/null +++ b/owl-bot-staging/google-cloud-retail-v2/lib/google/cloud/retail/v2/generative_question_service/credentials.rb @@ -0,0 +1,51 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +require "googleauth" + +module Google + module Cloud + module Retail + module V2 + module GenerativeQuestionService + # Credentials for the GenerativeQuestionService API. + class Credentials < ::Google::Auth::Credentials + self.scope = [ + "https://www.googleapis.com/auth/cloud-platform" + ] + self.env_vars = [ + "RETAIL_CREDENTIALS", + "RETAIL_KEYFILE", + "GOOGLE_CLOUD_CREDENTIALS", + "GOOGLE_CLOUD_KEYFILE", + "GCLOUD_KEYFILE", + "RETAIL_CREDENTIALS_JSON", + "RETAIL_KEYFILE_JSON", + "GOOGLE_CLOUD_CREDENTIALS_JSON", + "GOOGLE_CLOUD_KEYFILE_JSON", + "GCLOUD_KEYFILE_JSON" + ] + self.paths = [ + "~/.config/google_cloud/application_default_credentials.json" + ] + end + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-retail-v2/lib/google/cloud/retail/v2/generative_question_service/paths.rb b/owl-bot-staging/google-cloud-retail-v2/lib/google/cloud/retail/v2/generative_question_service/paths.rb new file mode 100644 index 000000000000..a01a45d7d88f --- /dev/null +++ b/owl-bot-staging/google-cloud-retail-v2/lib/google/cloud/retail/v2/generative_question_service/paths.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! + + +module Google + module Cloud + module Retail + module V2 + module GenerativeQuestionService + # Path helper methods for the GenerativeQuestionService API. + module Paths + ## + # Create a fully-qualified Catalog resource string. + # + # The resource will be in the following format: + # + # `projects/{project}/locations/{location}/catalogs/{catalog}` + # + # @param project [String] + # @param location [String] + # @param catalog [String] + # + # @return [::String] + def catalog_path project:, location:, catalog: + raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" + raise ::ArgumentError, "location cannot contain /" if location.to_s.include? "/" + + "projects/#{project}/locations/#{location}/catalogs/#{catalog}" + end + + extend self + end + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-retail-v2/lib/google/cloud/retail/v2/generative_question_service/rest.rb b/owl-bot-staging/google-cloud-retail-v2/lib/google/cloud/retail/v2/generative_question_service/rest.rb new file mode 100644 index 000000000000..a4599e934284 --- /dev/null +++ b/owl-bot-staging/google-cloud-retail-v2/lib/google/cloud/retail/v2/generative_question_service/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/retail/v2/version" + +require "google/cloud/retail/v2/generative_question_service/credentials" +require "google/cloud/retail/v2/generative_question_service/paths" +require "google/cloud/retail/v2/generative_question_service/rest/client" + +module Google + module Cloud + module Retail + module V2 + ## + # Service for managing LLM generated questions in search serving. + # + # To load this service and instantiate a REST client: + # + # require "google/cloud/retail/v2/generative_question_service/rest" + # client = ::Google::Cloud::Retail::V2::GenerativeQuestionService::Rest::Client.new + # + module GenerativeQuestionService + # Client for the REST transport + module Rest + end + end + end + end + end +end + +helper_path = ::File.join __dir__, "rest", "helpers.rb" +require "google/cloud/retail/v2/generative_question_service/rest/helpers" if ::File.file? helper_path diff --git a/owl-bot-staging/google-cloud-retail-v2/lib/google/cloud/retail/v2/generative_question_service/rest/client.rb b/owl-bot-staging/google-cloud-retail-v2/lib/google/cloud/retail/v2/generative_question_service/rest/client.rb new file mode 100644 index 000000000000..5e1bcd01164d --- /dev/null +++ b/owl-bot-staging/google-cloud-retail-v2/lib/google/cloud/retail/v2/generative_question_service/rest/client.rb @@ -0,0 +1,799 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +require "google/cloud/errors" +require "google/cloud/retail/v2/generative_question_service_pb" +require "google/cloud/retail/v2/generative_question_service/rest/service_stub" +require "google/cloud/location/rest" + +module Google + module Cloud + module Retail + module V2 + module GenerativeQuestionService + module Rest + ## + # REST client for the GenerativeQuestionService service. + # + # Service for managing LLM generated questions in search serving. + # + class Client + # @private + API_VERSION = "" + + # @private + DEFAULT_ENDPOINT_TEMPLATE = "retail.$UNIVERSE_DOMAIN$" + + include Paths + + # @private + attr_reader :generative_question_service_stub + + ## + # Configure the GenerativeQuestionService Client class. + # + # See {::Google::Cloud::Retail::V2::GenerativeQuestionService::Rest::Client::Configuration} + # for a description of the configuration fields. + # + # @example + # + # # Modify the configuration for all GenerativeQuestionService clients + # ::Google::Cloud::Retail::V2::GenerativeQuestionService::Rest::Client.configure do |config| + # config.timeout = 10.0 + # end + # + # @yield [config] Configure the Client client. + # @yieldparam config [Client::Configuration] + # + # @return [Client::Configuration] + # + def self.configure + @configure ||= begin + namespace = ["Google", "Cloud", "Retail", "V2"] + parent_config = while namespace.any? + parent_name = namespace.join "::" + parent_const = const_get parent_name + break parent_const.configure if parent_const.respond_to? :configure + namespace.pop + end + default_config = Client::Configuration.new parent_config + + default_config + end + yield @configure if block_given? + @configure + end + + ## + # Configure the GenerativeQuestionService Client instance. + # + # The configuration is set to the derived mode, meaning that values can be changed, + # but structural changes (adding new fields, etc.) are not allowed. Structural changes + # should be made on {Client.configure}. + # + # See {::Google::Cloud::Retail::V2::GenerativeQuestionService::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 + @generative_question_service_stub.universe_domain + end + + ## + # Create a new GenerativeQuestionService REST client object. + # + # @example + # + # # Create a client using the default configuration + # client = ::Google::Cloud::Retail::V2::GenerativeQuestionService::Rest::Client.new + # + # # Create a client using a custom configuration + # client = ::Google::Cloud::Retail::V2::GenerativeQuestionService::Rest::Client.new do |config| + # config.timeout = 10.0 + # end + # + # @yield [config] Configure the GenerativeQuestionService 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 + + @generative_question_service_stub = ::Google::Cloud::Retail::V2::GenerativeQuestionService::Rest::ServiceStub.new( + endpoint: @config.endpoint, + endpoint_template: DEFAULT_ENDPOINT_TEMPLATE, + universe_domain: @config.universe_domain, + credentials: credentials, + logger: @config.logger + ) + + @generative_question_service_stub.logger(stub: true)&.info do |entry| + entry.set_system_name + entry.set_service + entry.message = "Created client for #{entry.service}" + entry.set_credentials_fields credentials + entry.set "customEndpoint", @config.endpoint if @config.endpoint + entry.set "defaultTimeout", @config.timeout if @config.timeout + entry.set "quotaProject", @quota_project_id if @quota_project_id + end + + @location_client = Google::Cloud::Location::Locations::Rest::Client.new do |config| + config.credentials = credentials + config.quota_project = @quota_project_id + config.endpoint = @generative_question_service_stub.endpoint + config.universe_domain = @generative_question_service_stub.universe_domain + config.logger = @generative_question_service_stub.logger if config.respond_to? :logger= + end + end + + ## + # Get the associated client for mix-in of the Locations. + # + # @return [Google::Cloud::Location::Locations::Rest::Client] + # + attr_reader :location_client + + ## + # The logger used for request/response debug logging. + # + # @return [Logger] + # + def logger + @generative_question_service_stub.logger + end + + # Service calls + + ## + # Manages overal generative question feature state -- enables toggling + # feature on and off. + # + # @overload update_generative_questions_feature_config(request, options = nil) + # Pass arguments to `update_generative_questions_feature_config` via a request object, either of type + # {::Google::Cloud::Retail::V2::UpdateGenerativeQuestionsFeatureConfigRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Retail::V2::UpdateGenerativeQuestionsFeatureConfigRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_generative_questions_feature_config(generative_questions_feature_config: nil, update_mask: nil) + # Pass arguments to `update_generative_questions_feature_config` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param generative_questions_feature_config [::Google::Cloud::Retail::V2::GenerativeQuestionsFeatureConfig, ::Hash] + # Required. The configuration managing the feature state. + # @param update_mask [::Google::Protobuf::FieldMask, ::Hash] + # Optional. Indicates which fields in the provided + # {::Google::Cloud::Retail::V2::GenerativeQuestionsFeatureConfig GenerativeQuestionsFeatureConfig} + # to update. If not set or empty, all supported fields are updated. + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Cloud::Retail::V2::GenerativeQuestionsFeatureConfig] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::Retail::V2::GenerativeQuestionsFeatureConfig] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/retail/v2" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Retail::V2::GenerativeQuestionService::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Retail::V2::UpdateGenerativeQuestionsFeatureConfigRequest.new + # + # # Call the update_generative_questions_feature_config method. + # result = client.update_generative_questions_feature_config request + # + # # The returned object is of type Google::Cloud::Retail::V2::GenerativeQuestionsFeatureConfig. + # p result + # + def update_generative_questions_feature_config request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Retail::V2::UpdateGenerativeQuestionsFeatureConfigRequest + + # Converts hash 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_generative_questions_feature_config.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::Retail::V2::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + options.apply_defaults timeout: @config.rpcs.update_generative_questions_feature_config.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.update_generative_questions_feature_config.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @generative_question_service_stub.update_generative_questions_feature_config request, options do |result, operation| + yield result, operation if block_given? + end + rescue ::Gapic::Rest::Error => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Manages overal generative question feature state -- enables toggling + # feature on and off. + # + # @overload get_generative_questions_feature_config(request, options = nil) + # Pass arguments to `get_generative_questions_feature_config` via a request object, either of type + # {::Google::Cloud::Retail::V2::GetGenerativeQuestionsFeatureConfigRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Retail::V2::GetGenerativeQuestionsFeatureConfigRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_generative_questions_feature_config(catalog: nil) + # Pass arguments to `get_generative_questions_feature_config` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param catalog [::String] + # Required. Resource name of the parent catalog. + # Format: projects/\\{project}/locations/\\{location}/catalogs/\\{catalog} + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Cloud::Retail::V2::GenerativeQuestionsFeatureConfig] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::Retail::V2::GenerativeQuestionsFeatureConfig] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/retail/v2" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Retail::V2::GenerativeQuestionService::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Retail::V2::GetGenerativeQuestionsFeatureConfigRequest.new + # + # # Call the get_generative_questions_feature_config method. + # result = client.get_generative_questions_feature_config request + # + # # The returned object is of type Google::Cloud::Retail::V2::GenerativeQuestionsFeatureConfig. + # p result + # + def get_generative_questions_feature_config request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Retail::V2::GetGenerativeQuestionsFeatureConfigRequest + + # Converts hash 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_generative_questions_feature_config.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::Retail::V2::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + options.apply_defaults timeout: @config.rpcs.get_generative_questions_feature_config.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.get_generative_questions_feature_config.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @generative_question_service_stub.get_generative_questions_feature_config request, options do |result, operation| + yield result, operation if block_given? + end + rescue ::Gapic::Rest::Error => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Returns all questions for a given catalog. + # + # @overload list_generative_question_configs(request, options = nil) + # Pass arguments to `list_generative_question_configs` via a request object, either of type + # {::Google::Cloud::Retail::V2::ListGenerativeQuestionConfigsRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Retail::V2::ListGenerativeQuestionConfigsRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_generative_question_configs(parent: nil) + # Pass arguments to `list_generative_question_configs` via keyword arguments. Note that at + # least one keyword argument is 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. Resource name of the parent catalog. + # Format: projects/\\{project}/locations/\\{location}/catalogs/\\{catalog} + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Cloud::Retail::V2::ListGenerativeQuestionConfigsResponse] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::Retail::V2::ListGenerativeQuestionConfigsResponse] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/retail/v2" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Retail::V2::GenerativeQuestionService::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Retail::V2::ListGenerativeQuestionConfigsRequest.new + # + # # Call the list_generative_question_configs method. + # result = client.list_generative_question_configs request + # + # # The returned object is of type Google::Cloud::Retail::V2::ListGenerativeQuestionConfigsResponse. + # p result + # + def list_generative_question_configs request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Retail::V2::ListGenerativeQuestionConfigsRequest + + # Converts hash 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_generative_question_configs.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::Retail::V2::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + options.apply_defaults timeout: @config.rpcs.list_generative_question_configs.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.list_generative_question_configs.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @generative_question_service_stub.list_generative_question_configs 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 + + ## + # Allows management of individual questions. + # + # @overload update_generative_question_config(request, options = nil) + # Pass arguments to `update_generative_question_config` via a request object, either of type + # {::Google::Cloud::Retail::V2::UpdateGenerativeQuestionConfigRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Retail::V2::UpdateGenerativeQuestionConfigRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_generative_question_config(generative_question_config: nil, update_mask: nil) + # Pass arguments to `update_generative_question_config` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param generative_question_config [::Google::Cloud::Retail::V2::GenerativeQuestionConfig, ::Hash] + # Required. The question to update. + # @param update_mask [::Google::Protobuf::FieldMask, ::Hash] + # Optional. Indicates which fields in the provided + # {::Google::Cloud::Retail::V2::GenerativeQuestionConfig GenerativeQuestionConfig} + # to update. The following are NOT supported: + # + # * {::Google::Cloud::Retail::V2::GenerativeQuestionConfig#frequency GenerativeQuestionConfig.frequency} + # + # If not set or empty, all supported fields are updated. + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Cloud::Retail::V2::GenerativeQuestionConfig] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::Retail::V2::GenerativeQuestionConfig] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/retail/v2" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Retail::V2::GenerativeQuestionService::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Retail::V2::UpdateGenerativeQuestionConfigRequest.new + # + # # Call the update_generative_question_config method. + # result = client.update_generative_question_config request + # + # # The returned object is of type Google::Cloud::Retail::V2::GenerativeQuestionConfig. + # p result + # + def update_generative_question_config request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Retail::V2::UpdateGenerativeQuestionConfigRequest + + # Converts hash 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_generative_question_config.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::Retail::V2::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + options.apply_defaults timeout: @config.rpcs.update_generative_question_config.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.update_generative_question_config.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @generative_question_service_stub.update_generative_question_config request, options do |result, operation| + yield result, operation if block_given? + end + rescue ::Gapic::Rest::Error => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Allows management of multiple questions. + # + # @overload batch_update_generative_question_configs(request, options = nil) + # Pass arguments to `batch_update_generative_question_configs` via a request object, either of type + # {::Google::Cloud::Retail::V2::BatchUpdateGenerativeQuestionConfigsRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Retail::V2::BatchUpdateGenerativeQuestionConfigsRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @overload batch_update_generative_question_configs(parent: nil, requests: nil) + # Pass arguments to `batch_update_generative_question_configs` via keyword arguments. Note that at + # least one keyword argument is 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] + # Optional. Resource name of the parent catalog. + # Format: projects/\\{project}/locations/\\{location}/catalogs/\\{catalog} + # @param requests [::Array<::Google::Cloud::Retail::V2::UpdateGenerativeQuestionConfigRequest, ::Hash>] + # Required. The updates question configs. + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Cloud::Retail::V2::BatchUpdateGenerativeQuestionConfigsResponse] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::Retail::V2::BatchUpdateGenerativeQuestionConfigsResponse] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/retail/v2" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Retail::V2::GenerativeQuestionService::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Retail::V2::BatchUpdateGenerativeQuestionConfigsRequest.new + # + # # Call the batch_update_generative_question_configs method. + # result = client.batch_update_generative_question_configs request + # + # # The returned object is of type Google::Cloud::Retail::V2::BatchUpdateGenerativeQuestionConfigsResponse. + # p result + # + def batch_update_generative_question_configs request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Retail::V2::BatchUpdateGenerativeQuestionConfigsRequest + + # Converts hash 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.batch_update_generative_question_configs.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::Retail::V2::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + options.apply_defaults timeout: @config.rpcs.batch_update_generative_question_configs.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.batch_update_generative_question_configs.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @generative_question_service_stub.batch_update_generative_question_configs 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 GenerativeQuestionService REST API. + # + # This class represents the configuration for GenerativeQuestionService REST, + # providing control over timeouts, retry behavior, logging, transport + # parameters, and other low-level controls. Certain parameters can also be + # applied individually to specific RPCs. See + # {::Google::Cloud::Retail::V2::GenerativeQuestionService::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 + # # update_generative_questions_feature_config to 20 seconds, + # # and all remaining timeouts to 10 seconds. + # ::Google::Cloud::Retail::V2::GenerativeQuestionService::Rest::Client.configure do |config| + # config.timeout = 10.0 + # config.rpcs.update_generative_questions_feature_config.timeout = 20.0 + # end + # + # # Apply the above configuration only to a new client. + # client = ::Google::Cloud::Retail::V2::GenerativeQuestionService::Rest::Client.new do |config| + # config.timeout = 10.0 + # config.rpcs.update_generative_questions_feature_config.timeout = 20.0 + # end + # + # @!attribute [rw] endpoint + # A custom service endpoint, as a hostname or hostname:port. The default is + # nil, indicating to use the default endpoint in the current universe domain. + # @return [::String,nil] + # @!attribute [rw] credentials + # Credentials to send with calls. You may provide any of the following types: + # * (`String`) The path to a service account key file in JSON format + # * (`Hash`) A service account key as a Hash + # * (`Google::Auth::Credentials`) A googleauth credentials object + # (see the [googleauth docs](https://rubydoc.info/gems/googleauth/Google/Auth/Credentials)) + # * (`Signet::OAuth2::Client`) A signet oauth2 client object + # (see the [signet docs](https://rubydoc.info/gems/signet/Signet/OAuth2/Client)) + # * (`nil`) indicating no credentials + # + # Warning: If you accept a credential configuration (JSON file or Hash) from an + # external source for authentication to Google Cloud, you must validate it before + # providing it to a Google API client library. Providing an unvalidated credential + # configuration to Google APIs can compromise the security of your systems and data. + # For more information, refer to [Validate credential configurations from external + # sources](https://cloud.google.com/docs/authentication/external/externally-sourced-credentials). + # @return [::Object] + # @!attribute [rw] scope + # The OAuth scopes + # @return [::Array<::String>] + # @!attribute [rw] lib_name + # The library name as recorded in instrumentation and logging + # @return [::String] + # @!attribute [rw] lib_version + # The library version as recorded in instrumentation and logging + # @return [::String] + # @!attribute [rw] timeout + # The call timeout in seconds. + # @return [::Numeric] + # @!attribute [rw] metadata + # Additional headers to be sent with the call. + # @return [::Hash{::Symbol=>::String}] + # @!attribute [rw] retry_policy + # The retry policy. The value is a hash with the following keys: + # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds. + # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds. + # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier. + # * `:retry_codes` (*type:* `Array`) - The error codes that should + # trigger a retry. + # @return [::Hash] + # @!attribute [rw] quota_project + # A separate project against which to charge quota. + # @return [::String] + # @!attribute [rw] universe_domain + # The universe domain within which to make requests. This determines the + # default endpoint URL. The default value of nil uses the environment + # universe (usually the default "googleapis.com" universe). + # @return [::String,nil] + # @!attribute [rw] logger + # A custom logger to use for request/response debug logging, or the value + # `:default` (the default) to construct a default logger, or `nil` to + # explicitly disable logging. + # @return [::Logger,:default,nil] + # + class Configuration + extend ::Gapic::Config + + # @private + # The endpoint specific to the default "googleapis.com" universe. Deprecated. + DEFAULT_ENDPOINT = "retail.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 GenerativeQuestionService 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 `update_generative_questions_feature_config` + # @return [::Gapic::Config::Method] + # + attr_reader :update_generative_questions_feature_config + ## + # RPC-specific configuration for `get_generative_questions_feature_config` + # @return [::Gapic::Config::Method] + # + attr_reader :get_generative_questions_feature_config + ## + # RPC-specific configuration for `list_generative_question_configs` + # @return [::Gapic::Config::Method] + # + attr_reader :list_generative_question_configs + ## + # RPC-specific configuration for `update_generative_question_config` + # @return [::Gapic::Config::Method] + # + attr_reader :update_generative_question_config + ## + # RPC-specific configuration for `batch_update_generative_question_configs` + # @return [::Gapic::Config::Method] + # + attr_reader :batch_update_generative_question_configs + + # @private + def initialize parent_rpcs = nil + update_generative_questions_feature_config_config = parent_rpcs.update_generative_questions_feature_config if parent_rpcs.respond_to? :update_generative_questions_feature_config + @update_generative_questions_feature_config = ::Gapic::Config::Method.new update_generative_questions_feature_config_config + get_generative_questions_feature_config_config = parent_rpcs.get_generative_questions_feature_config if parent_rpcs.respond_to? :get_generative_questions_feature_config + @get_generative_questions_feature_config = ::Gapic::Config::Method.new get_generative_questions_feature_config_config + list_generative_question_configs_config = parent_rpcs.list_generative_question_configs if parent_rpcs.respond_to? :list_generative_question_configs + @list_generative_question_configs = ::Gapic::Config::Method.new list_generative_question_configs_config + update_generative_question_config_config = parent_rpcs.update_generative_question_config if parent_rpcs.respond_to? :update_generative_question_config + @update_generative_question_config = ::Gapic::Config::Method.new update_generative_question_config_config + batch_update_generative_question_configs_config = parent_rpcs.batch_update_generative_question_configs if parent_rpcs.respond_to? :batch_update_generative_question_configs + @batch_update_generative_question_configs = ::Gapic::Config::Method.new batch_update_generative_question_configs_config + + yield self if block_given? + end + end + end + end + end + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-retail-v2/lib/google/cloud/retail/v2/generative_question_service/rest/service_stub.rb b/owl-bot-staging/google-cloud-retail-v2/lib/google/cloud/retail/v2/generative_question_service/rest/service_stub.rb new file mode 100644 index 000000000000..28bb60081ea8 --- /dev/null +++ b/owl-bot-staging/google-cloud-retail-v2/lib/google/cloud/retail/v2/generative_question_service/rest/service_stub.rb @@ -0,0 +1,389 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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/retail/v2/generative_question_service_pb" + +module Google + module Cloud + module Retail + module V2 + module GenerativeQuestionService + module Rest + ## + # REST service stub for the GenerativeQuestionService 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 update_generative_questions_feature_config REST call + # + # @param request_pb [::Google::Cloud::Retail::V2::UpdateGenerativeQuestionsFeatureConfigRequest] + # A request object representing the call parameters. Required. + # @param options [::Gapic::CallOptions] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Cloud::Retail::V2::GenerativeQuestionsFeatureConfig] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::Retail::V2::GenerativeQuestionsFeatureConfig] + # A result object deserialized from the server's reply + def update_generative_questions_feature_config request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_update_generative_questions_feature_config_request request_pb + query_string_params = if query_string_params.any? + query_string_params.to_h { |p| p.split "=", 2 } + else + {} + end + + response = @client_stub.make_http_request( + verb, + uri: uri, + body: body || "", + params: query_string_params, + method_name: "update_generative_questions_feature_config", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Cloud::Retail::V2::GenerativeQuestionsFeatureConfig.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_generative_questions_feature_config REST call + # + # @param request_pb [::Google::Cloud::Retail::V2::GetGenerativeQuestionsFeatureConfigRequest] + # A request object representing the call parameters. Required. + # @param options [::Gapic::CallOptions] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Cloud::Retail::V2::GenerativeQuestionsFeatureConfig] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::Retail::V2::GenerativeQuestionsFeatureConfig] + # A result object deserialized from the server's reply + def get_generative_questions_feature_config request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_get_generative_questions_feature_config_request request_pb + query_string_params = if query_string_params.any? + query_string_params.to_h { |p| p.split "=", 2 } + else + {} + end + + response = @client_stub.make_http_request( + verb, + uri: uri, + body: body || "", + params: query_string_params, + method_name: "get_generative_questions_feature_config", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Cloud::Retail::V2::GenerativeQuestionsFeatureConfig.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_generative_question_configs REST call + # + # @param request_pb [::Google::Cloud::Retail::V2::ListGenerativeQuestionConfigsRequest] + # A request object representing the call parameters. Required. + # @param options [::Gapic::CallOptions] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Cloud::Retail::V2::ListGenerativeQuestionConfigsResponse] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::Retail::V2::ListGenerativeQuestionConfigsResponse] + # A result object deserialized from the server's reply + def list_generative_question_configs request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_list_generative_question_configs_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_generative_question_configs", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Cloud::Retail::V2::ListGenerativeQuestionConfigsResponse.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_generative_question_config REST call + # + # @param request_pb [::Google::Cloud::Retail::V2::UpdateGenerativeQuestionConfigRequest] + # A request object representing the call parameters. Required. + # @param options [::Gapic::CallOptions] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Cloud::Retail::V2::GenerativeQuestionConfig] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::Retail::V2::GenerativeQuestionConfig] + # A result object deserialized from the server's reply + def update_generative_question_config request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_update_generative_question_config_request request_pb + query_string_params = if query_string_params.any? + query_string_params.to_h { |p| p.split "=", 2 } + else + {} + end + + response = @client_stub.make_http_request( + verb, + uri: uri, + body: body || "", + params: query_string_params, + method_name: "update_generative_question_config", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Cloud::Retail::V2::GenerativeQuestionConfig.decode_json response.body, ignore_unknown_fields: true + catch :response do + yield result, operation if block_given? + result + end + end + + ## + # Baseline implementation for the batch_update_generative_question_configs REST call + # + # @param request_pb [::Google::Cloud::Retail::V2::BatchUpdateGenerativeQuestionConfigsRequest] + # A request object representing the call parameters. Required. + # @param options [::Gapic::CallOptions] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Cloud::Retail::V2::BatchUpdateGenerativeQuestionConfigsResponse] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::Retail::V2::BatchUpdateGenerativeQuestionConfigsResponse] + # A result object deserialized from the server's reply + def batch_update_generative_question_configs request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_batch_update_generative_question_configs_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: "batch_update_generative_question_configs", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Cloud::Retail::V2::BatchUpdateGenerativeQuestionConfigsResponse.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 update_generative_questions_feature_config REST call + # + # @param request_pb [::Google::Cloud::Retail::V2::UpdateGenerativeQuestionsFeatureConfigRequest] + # 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_generative_questions_feature_config_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :patch, + uri_template: "/v2/{generative_questions_feature_config.catalog}/generativeQuestionFeature", + body: "generative_questions_feature_config", + matches: [ + ["generative_questions_feature_config.catalog", %r{^projects/[^/]+/locations/[^/]+/catalogs/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the get_generative_questions_feature_config REST call + # + # @param request_pb [::Google::Cloud::Retail::V2::GetGenerativeQuestionsFeatureConfigRequest] + # 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_generative_questions_feature_config_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :get, + uri_template: "/v2/{catalog}/generativeQuestionFeature", + matches: [ + ["catalog", %r{^projects/[^/]+/locations/[^/]+/catalogs/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the list_generative_question_configs REST call + # + # @param request_pb [::Google::Cloud::Retail::V2::ListGenerativeQuestionConfigsRequest] + # 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_generative_question_configs_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :get, + uri_template: "/v2/{parent}/generativeQuestions", + matches: [ + ["parent", %r{^projects/[^/]+/locations/[^/]+/catalogs/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the update_generative_question_config REST call + # + # @param request_pb [::Google::Cloud::Retail::V2::UpdateGenerativeQuestionConfigRequest] + # 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_generative_question_config_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :patch, + uri_template: "/v2/{generative_question_config.catalog}/generativeQuestion", + body: "generative_question_config", + matches: [ + ["generative_question_config.catalog", %r{^projects/[^/]+/locations/[^/]+/catalogs/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the batch_update_generative_question_configs REST call + # + # @param request_pb [::Google::Cloud::Retail::V2::BatchUpdateGenerativeQuestionConfigsRequest] + # A request object representing the call parameters. Required. + # @return [Array(String, [String, nil], Hash{String => String})] + # Uri, Body, Query string parameters + def self.transcode_batch_update_generative_question_configs_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :post, + uri_template: "/v2/{parent}/generativeQuestion:batchUpdate", + body: "*", + matches: [ + ["parent", %r{^projects/[^/]+/locations/[^/]+/catalogs/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + end + end + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-retail-v2/lib/google/cloud/retail/v2/generative_question_service_pb.rb b/owl-bot-staging/google-cloud-retail-v2/lib/google/cloud/retail/v2/generative_question_service_pb.rb new file mode 100644 index 000000000000..36ad39b3e786 --- /dev/null +++ b/owl-bot-staging/google-cloud-retail-v2/lib/google/cloud/retail/v2/generative_question_service_pb.rb @@ -0,0 +1,34 @@ +# frozen_string_literal: true +# Generated by the protocol buffer compiler. DO NOT EDIT! +# source: google/cloud/retail/v2/generative_question_service.proto + +require 'google/protobuf' + +require 'google/api/annotations_pb' +require 'google/api/client_pb' +require 'google/api/field_behavior_pb' +require 'google/api/resource_pb' +require 'google/cloud/retail/v2/generative_question_pb' +require 'google/protobuf/field_mask_pb' + + +descriptor_data = "\n8google/cloud/retail/v2/generative_question_service.proto\x12\x16google.cloud.retail.v2\x1a\x1cgoogle/api/annotations.proto\x1a\x17google/api/client.proto\x1a\x1fgoogle/api/field_behavior.proto\x1a\x19google/api/resource.proto\x1a\x30google/cloud/retail/v2/generative_question.proto\x1a google/protobuf/field_mask.proto\"\xd1\x01\n-UpdateGenerativeQuestionsFeatureConfigRequest\x12j\n#generative_questions_feature_config\x18\x02 \x01(\x0b\x32\x38.google.cloud.retail.v2.GenerativeQuestionsFeatureConfigB\x03\xe0\x41\x02\x12\x34\n\x0bupdate_mask\x18\x04 \x01(\x0b\x32\x1a.google.protobuf.FieldMaskB\x03\xe0\x41\x01\"d\n*GetGenerativeQuestionsFeatureConfigRequest\x12\x36\n\x07\x63\x61talog\x18\x01 \x01(\tB%\xe0\x41\x02\xfa\x41\x1f\n\x1dretail.googleapis.com/Catalog\"]\n$ListGenerativeQuestionConfigsRequest\x12\x35\n\x06parent\x18\x01 \x01(\tB%\xe0\x41\x02\xfa\x41\x1f\n\x1dretail.googleapis.com/Catalog\"~\n%ListGenerativeQuestionConfigsResponse\x12U\n\x1bgenerative_question_configs\x18\x01 \x03(\x0b\x32\x30.google.cloud.retail.v2.GenerativeQuestionConfig\"\xb8\x01\n%UpdateGenerativeQuestionConfigRequest\x12Y\n\x1agenerative_question_config\x18\x03 \x01(\x0b\x32\x30.google.cloud.retail.v2.GenerativeQuestionConfigB\x03\xe0\x41\x02\x12\x34\n\x0bupdate_mask\x18\x04 \x01(\x0b\x32\x1a.google.protobuf.FieldMaskB\x03\xe0\x41\x01\"\xba\x01\n+BatchUpdateGenerativeQuestionConfigsRequest\x12\x35\n\x06parent\x18\x01 \x01(\tB%\xe0\x41\x01\xfa\x41\x1f\n\x1dretail.googleapis.com/Catalog\x12T\n\x08requests\x18\x02 \x03(\x0b\x32=.google.cloud.retail.v2.UpdateGenerativeQuestionConfigRequestB\x03\xe0\x41\x02\"\x8a\x01\n,BatchUpdateGenerativeQuestionConfigsResponse\x12Z\n\x1bgenerative_question_configs\x18\x01 \x03(\x0b\x32\x30.google.cloud.retail.v2.GenerativeQuestionConfigB\x03\xe0\x41\x01\x32\xba\x0c\n\x19GenerativeQuestionService\x12\xf9\x02\n&UpdateGenerativeQuestionsFeatureConfig\x12\x45.google.cloud.retail.v2.UpdateGenerativeQuestionsFeatureConfigRequest\x1a\x38.google.cloud.retail.v2.GenerativeQuestionsFeatureConfig\"\xcd\x01\xda\x41/generative_questions_feature_config,update_mask\x82\xd3\xe4\x93\x02\x94\x01\x32m/v2/{generative_questions_feature_config.catalog=projects/*/locations/*/catalogs/*}/generativeQuestionFeature:#generative_questions_feature_config\x12\x80\x02\n#GetGenerativeQuestionsFeatureConfig\x12\x42.google.cloud.retail.v2.GetGenerativeQuestionsFeatureConfigRequest\x1a\x38.google.cloud.retail.v2.GenerativeQuestionsFeatureConfig\"[\xda\x41\x07\x63\x61talog\x82\xd3\xe4\x93\x02K\x12I/v2/{catalog=projects/*/locations/*/catalogs/*}/generativeQuestionFeature\x12\xf1\x01\n\x1dListGenerativeQuestionConfigs\x12<.google.cloud.retail.v2.ListGenerativeQuestionConfigsRequest\x1a=.google.cloud.retail.v2.ListGenerativeQuestionConfigsResponse\"S\xda\x41\x06parent\x82\xd3\xe4\x93\x02\x44\x12\x42/v2/{parent=projects/*/locations/*/catalogs/*}/generativeQuestions\x12\xbe\x02\n\x1eUpdateGenerativeQuestionConfig\x12=.google.cloud.retail.v2.UpdateGenerativeQuestionConfigRequest\x1a\x30.google.cloud.retail.v2.GenerativeQuestionConfig\"\xaa\x01\xda\x41&generative_question_config,update_mask\x82\xd3\xe4\x93\x02{2]/v2/{generative_question_config.catalog=projects/*/locations/*/catalogs/*}/generativeQuestion:\x1agenerative_question_config\x12\x9d\x02\n$BatchUpdateGenerativeQuestionConfigs\x12\x43.google.cloud.retail.v2.BatchUpdateGenerativeQuestionConfigsRequest\x1a\x44.google.cloud.retail.v2.BatchUpdateGenerativeQuestionConfigsResponse\"j\xda\x41\x0fparent,requests\x82\xd3\xe4\x93\x02R\"M/v2/{parent=projects/*/locations/*/catalogs/*}/generativeQuestion:batchUpdate:\x01*\x1aI\xca\x41\x15retail.googleapis.com\xd2\x41.https://www.googleapis.com/auth/cloud-platformB\xc9\x01\n\x1a\x63om.google.cloud.retail.v2B\x1eGenerativeQuestionServiceProtoP\x01Z2cloud.google.com/go/retail/apiv2/retailpb;retailpb\xa2\x02\x06RETAIL\xaa\x02\x16Google.Cloud.Retail.V2\xca\x02\x16Google\\Cloud\\Retail\\V2\xea\x02\x19Google::Cloud::Retail::V2b\x06proto3" + +pool = ::Google::Protobuf::DescriptorPool.generated_pool +pool.add_serialized_file(descriptor_data) + +module Google + module Cloud + module Retail + module V2 + UpdateGenerativeQuestionsFeatureConfigRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.retail.v2.UpdateGenerativeQuestionsFeatureConfigRequest").msgclass + GetGenerativeQuestionsFeatureConfigRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.retail.v2.GetGenerativeQuestionsFeatureConfigRequest").msgclass + ListGenerativeQuestionConfigsRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.retail.v2.ListGenerativeQuestionConfigsRequest").msgclass + ListGenerativeQuestionConfigsResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.retail.v2.ListGenerativeQuestionConfigsResponse").msgclass + UpdateGenerativeQuestionConfigRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.retail.v2.UpdateGenerativeQuestionConfigRequest").msgclass + BatchUpdateGenerativeQuestionConfigsRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.retail.v2.BatchUpdateGenerativeQuestionConfigsRequest").msgclass + BatchUpdateGenerativeQuestionConfigsResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.retail.v2.BatchUpdateGenerativeQuestionConfigsResponse").msgclass + end + end + end +end diff --git a/owl-bot-staging/google-cloud-retail-v2/lib/google/cloud/retail/v2/generative_question_service_services_pb.rb b/owl-bot-staging/google-cloud-retail-v2/lib/google/cloud/retail/v2/generative_question_service_services_pb.rb new file mode 100644 index 000000000000..259ede2d8557 --- /dev/null +++ b/owl-bot-staging/google-cloud-retail-v2/lib/google/cloud/retail/v2/generative_question_service_services_pb.rb @@ -0,0 +1,55 @@ +# Generated by the protocol buffer compiler. DO NOT EDIT! +# Source: google/cloud/retail/v2/generative_question_service.proto for package 'Google.Cloud.Retail.V2' +# Original file comments: +# 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 +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# + +require 'grpc' +require 'google/cloud/retail/v2/generative_question_service_pb' + +module Google + module Cloud + module Retail + module V2 + module GenerativeQuestionService + # Service for managing LLM generated questions in search serving. + class Service + + include ::GRPC::GenericService + + self.marshal_class_method = :encode + self.unmarshal_class_method = :decode + self.service_name = 'google.cloud.retail.v2.GenerativeQuestionService' + + # Manages overal generative question feature state -- enables toggling + # feature on and off. + rpc :UpdateGenerativeQuestionsFeatureConfig, ::Google::Cloud::Retail::V2::UpdateGenerativeQuestionsFeatureConfigRequest, ::Google::Cloud::Retail::V2::GenerativeQuestionsFeatureConfig + # Manages overal generative question feature state -- enables toggling + # feature on and off. + rpc :GetGenerativeQuestionsFeatureConfig, ::Google::Cloud::Retail::V2::GetGenerativeQuestionsFeatureConfigRequest, ::Google::Cloud::Retail::V2::GenerativeQuestionsFeatureConfig + # Returns all questions for a given catalog. + rpc :ListGenerativeQuestionConfigs, ::Google::Cloud::Retail::V2::ListGenerativeQuestionConfigsRequest, ::Google::Cloud::Retail::V2::ListGenerativeQuestionConfigsResponse + # Allows management of individual questions. + rpc :UpdateGenerativeQuestionConfig, ::Google::Cloud::Retail::V2::UpdateGenerativeQuestionConfigRequest, ::Google::Cloud::Retail::V2::GenerativeQuestionConfig + # Allows management of multiple questions. + rpc :BatchUpdateGenerativeQuestionConfigs, ::Google::Cloud::Retail::V2::BatchUpdateGenerativeQuestionConfigsRequest, ::Google::Cloud::Retail::V2::BatchUpdateGenerativeQuestionConfigsResponse + end + + Stub = Service.rpc_stub_class + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-retail-v2/lib/google/cloud/retail/v2/import_config_pb.rb b/owl-bot-staging/google-cloud-retail-v2/lib/google/cloud/retail/v2/import_config_pb.rb new file mode 100644 index 000000000000..8dacabe59008 --- /dev/null +++ b/owl-bot-staging/google-cloud-retail-v2/lib/google/cloud/retail/v2/import_config_pb.rb @@ -0,0 +1,46 @@ +# frozen_string_literal: true +# Generated by the protocol buffer compiler. DO NOT EDIT! +# source: google/cloud/retail/v2/import_config.proto + +require 'google/protobuf' + +require 'google/api/field_behavior_pb' +require 'google/api/resource_pb' +require 'google/cloud/retail/v2/product_pb' +require 'google/cloud/retail/v2/user_event_pb' +require 'google/protobuf/field_mask_pb' +require 'google/protobuf/timestamp_pb' +require 'google/rpc/status_pb' +require 'google/type/date_pb' + + +descriptor_data = "\n*google/cloud/retail/v2/import_config.proto\x12\x16google.cloud.retail.v2\x1a\x1fgoogle/api/field_behavior.proto\x1a\x19google/api/resource.proto\x1a$google/cloud/retail/v2/product.proto\x1a\'google/cloud/retail/v2/user_event.proto\x1a google/protobuf/field_mask.proto\x1a\x1fgoogle/protobuf/timestamp.proto\x1a\x17google/rpc/status.proto\x1a\x16google/type/date.proto\"9\n\tGcsSource\x12\x17\n\ninput_uris\x18\x01 \x03(\tB\x03\xe0\x41\x02\x12\x13\n\x0b\x64\x61ta_schema\x18\x02 \x01(\t\"\xbc\x01\n\x0e\x42igQuerySource\x12+\n\x0epartition_date\x18\x06 \x01(\x0b\x32\x11.google.type.DateH\x00\x12\x12\n\nproject_id\x18\x05 \x01(\t\x12\x17\n\ndataset_id\x18\x01 \x01(\tB\x03\xe0\x41\x02\x12\x15\n\x08table_id\x18\x02 \x01(\tB\x03\xe0\x41\x02\x12\x17\n\x0fgcs_staging_dir\x18\x03 \x01(\t\x12\x13\n\x0b\x64\x61ta_schema\x18\x04 \x01(\tB\x0b\n\tpartition\"M\n\x13ProductInlineSource\x12\x36\n\x08products\x18\x01 \x03(\x0b\x32\x1f.google.cloud.retail.v2.ProductB\x03\xe0\x41\x02\"T\n\x15UserEventInlineSource\x12;\n\x0buser_events\x18\x01 \x03(\x0b\x32!.google.cloud.retail.v2.UserEventB\x03\xe0\x41\x02\"9\n\x12ImportErrorsConfig\x12\x14\n\ngcs_prefix\x18\x01 \x01(\tH\x00\x42\r\n\x0b\x64\x65stination\"\xf8\x03\n\x15ImportProductsRequest\x12\x34\n\x06parent\x18\x01 \x01(\tB$\xe0\x41\x02\xfa\x41\x1e\n\x1cretail.googleapis.com/Branch\x12\x16\n\nrequest_id\x18\x06 \x01(\tB\x02\x18\x01\x12\x45\n\x0cinput_config\x18\x02 \x01(\x0b\x32*.google.cloud.retail.v2.ProductInputConfigB\x03\xe0\x41\x02\x12\x41\n\rerrors_config\x18\x03 \x01(\x0b\x32*.google.cloud.retail.v2.ImportErrorsConfig\x12/\n\x0bupdate_mask\x18\x04 \x01(\x0b\x32\x1a.google.protobuf.FieldMask\x12]\n\x13reconciliation_mode\x18\x05 \x01(\x0e\x32@.google.cloud.retail.v2.ImportProductsRequest.ReconciliationMode\x12!\n\x19notification_pubsub_topic\x18\x07 \x01(\t\"T\n\x12ReconciliationMode\x12#\n\x1fRECONCILIATION_MODE_UNSPECIFIED\x10\x00\x12\x0f\n\x0bINCREMENTAL\x10\x01\x12\x08\n\x04\x46ULL\x10\x02\"\xdc\x01\n\x17ImportUserEventsRequest\x12\x35\n\x06parent\x18\x01 \x01(\tB%\xe0\x41\x02\xfa\x41\x1f\n\x1dretail.googleapis.com/Catalog\x12G\n\x0cinput_config\x18\x02 \x01(\x0b\x32,.google.cloud.retail.v2.UserEventInputConfigB\x03\xe0\x41\x02\x12\x41\n\rerrors_config\x18\x03 \x01(\x0b\x32*.google.cloud.retail.v2.ImportErrorsConfig\"\xc5\x01\n\x1bImportCompletionDataRequest\x12\x35\n\x06parent\x18\x01 \x01(\tB%\xe0\x41\x02\xfa\x41\x1f\n\x1dretail.googleapis.com/Catalog\x12L\n\x0cinput_config\x18\x02 \x01(\x0b\x32\x31.google.cloud.retail.v2.CompletionDataInputConfigB\x03\xe0\x41\x02\x12!\n\x19notification_pubsub_topic\x18\x03 \x01(\t\"\xe9\x01\n\x12ProductInputConfig\x12L\n\x15product_inline_source\x18\x01 \x01(\x0b\x32+.google.cloud.retail.v2.ProductInlineSourceH\x00\x12\x37\n\ngcs_source\x18\x02 \x01(\x0b\x32!.google.cloud.retail.v2.GcsSourceH\x00\x12\x42\n\x10\x62ig_query_source\x18\x03 \x01(\x0b\x32&.google.cloud.retail.v2.BigQuerySourceH\x00\x42\x08\n\x06source\"\xff\x01\n\x14UserEventInputConfig\x12V\n\x18user_event_inline_source\x18\x01 \x01(\x0b\x32-.google.cloud.retail.v2.UserEventInlineSourceB\x03\xe0\x41\x02H\x00\x12<\n\ngcs_source\x18\x02 \x01(\x0b\x32!.google.cloud.retail.v2.GcsSourceB\x03\xe0\x41\x02H\x00\x12G\n\x10\x62ig_query_source\x18\x03 \x01(\x0b\x32&.google.cloud.retail.v2.BigQuerySourceB\x03\xe0\x41\x02H\x00\x42\x08\n\x06source\"n\n\x19\x43ompletionDataInputConfig\x12G\n\x10\x62ig_query_source\x18\x01 \x01(\x0b\x32&.google.cloud.retail.v2.BigQuerySourceB\x03\xe0\x41\x02H\x00\x42\x08\n\x06source\"\xdb\x01\n\x0eImportMetadata\x12/\n\x0b\x63reate_time\x18\x01 \x01(\x0b\x32\x1a.google.protobuf.Timestamp\x12/\n\x0bupdate_time\x18\x02 \x01(\x0b\x32\x1a.google.protobuf.Timestamp\x12\x15\n\rsuccess_count\x18\x03 \x01(\x03\x12\x15\n\rfailure_count\x18\x04 \x01(\x03\x12\x16\n\nrequest_id\x18\x05 \x01(\tB\x02\x18\x01\x12!\n\x19notification_pubsub_topic\x18\x06 \x01(\t\"\x86\x01\n\x16ImportProductsResponse\x12)\n\rerror_samples\x18\x01 \x03(\x0b\x32\x12.google.rpc.Status\x12\x41\n\rerrors_config\x18\x02 \x01(\x0b\x32*.google.cloud.retail.v2.ImportErrorsConfig\"\xd0\x01\n\x18ImportUserEventsResponse\x12)\n\rerror_samples\x18\x01 \x03(\x0b\x32\x12.google.rpc.Status\x12\x41\n\rerrors_config\x18\x02 \x01(\x0b\x32*.google.cloud.retail.v2.ImportErrorsConfig\x12\x46\n\x0eimport_summary\x18\x03 \x01(\x0b\x32..google.cloud.retail.v2.UserEventImportSummary\"T\n\x16UserEventImportSummary\x12\x1b\n\x13joined_events_count\x18\x01 \x01(\x03\x12\x1d\n\x15unjoined_events_count\x18\x02 \x01(\x03\"I\n\x1cImportCompletionDataResponse\x12)\n\rerror_samples\x18\x01 \x03(\x0b\x32\x12.google.rpc.StatusB\xbc\x01\n\x1a\x63om.google.cloud.retail.v2B\x11ImportConfigProtoP\x01Z2cloud.google.com/go/retail/apiv2/retailpb;retailpb\xa2\x02\x06RETAIL\xaa\x02\x16Google.Cloud.Retail.V2\xca\x02\x16Google\\Cloud\\Retail\\V2\xea\x02\x19Google::Cloud::Retail::V2b\x06proto3" + +pool = ::Google::Protobuf::DescriptorPool.generated_pool +pool.add_serialized_file(descriptor_data) + +module Google + module Cloud + module Retail + module V2 + GcsSource = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.retail.v2.GcsSource").msgclass + BigQuerySource = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.retail.v2.BigQuerySource").msgclass + ProductInlineSource = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.retail.v2.ProductInlineSource").msgclass + UserEventInlineSource = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.retail.v2.UserEventInlineSource").msgclass + ImportErrorsConfig = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.retail.v2.ImportErrorsConfig").msgclass + ImportProductsRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.retail.v2.ImportProductsRequest").msgclass + ImportProductsRequest::ReconciliationMode = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.retail.v2.ImportProductsRequest.ReconciliationMode").enummodule + ImportUserEventsRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.retail.v2.ImportUserEventsRequest").msgclass + ImportCompletionDataRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.retail.v2.ImportCompletionDataRequest").msgclass + ProductInputConfig = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.retail.v2.ProductInputConfig").msgclass + UserEventInputConfig = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.retail.v2.UserEventInputConfig").msgclass + CompletionDataInputConfig = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.retail.v2.CompletionDataInputConfig").msgclass + ImportMetadata = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.retail.v2.ImportMetadata").msgclass + ImportProductsResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.retail.v2.ImportProductsResponse").msgclass + ImportUserEventsResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.retail.v2.ImportUserEventsResponse").msgclass + UserEventImportSummary = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.retail.v2.UserEventImportSummary").msgclass + ImportCompletionDataResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.retail.v2.ImportCompletionDataResponse").msgclass + end + end + end +end diff --git a/owl-bot-staging/google-cloud-retail-v2/lib/google/cloud/retail/v2/model_pb.rb b/owl-bot-staging/google-cloud-retail-v2/lib/google/cloud/retail/v2/model_pb.rb new file mode 100644 index 000000000000..037bc3c8d29c --- /dev/null +++ b/owl-bot-staging/google-cloud-retail-v2/lib/google/cloud/retail/v2/model_pb.rb @@ -0,0 +1,34 @@ +# frozen_string_literal: true +# Generated by the protocol buffer compiler. DO NOT EDIT! +# source: google/cloud/retail/v2/model.proto + +require 'google/protobuf' + +require 'google/api/field_behavior_pb' +require 'google/api/resource_pb' +require 'google/cloud/retail/v2/common_pb' +require 'google/protobuf/timestamp_pb' + + +descriptor_data = "\n\"google/cloud/retail/v2/model.proto\x12\x16google.cloud.retail.v2\x1a\x1fgoogle/api/field_behavior.proto\x1a\x19google/api/resource.proto\x1a#google/cloud/retail/v2/common.proto\x1a\x1fgoogle/protobuf/timestamp.proto\"\x97\x0e\n\x05Model\x12\x11\n\x04name\x18\x01 \x01(\tB\x03\xe0\x41\x02\x12\x19\n\x0c\x64isplay_name\x18\x02 \x01(\tB\x03\xe0\x41\x02\x12H\n\x0etraining_state\x18\x03 \x01(\x0e\x32+.google.cloud.retail.v2.Model.TrainingStateB\x03\xe0\x41\x01\x12\x46\n\rserving_state\x18\x04 \x01(\x0e\x32*.google.cloud.retail.v2.Model.ServingStateB\x03\xe0\x41\x03\x12\x34\n\x0b\x63reate_time\x18\x05 \x01(\x0b\x32\x1a.google.protobuf.TimestampB\x03\xe0\x41\x03\x12\x34\n\x0bupdate_time\x18\x06 \x01(\x0b\x32\x1a.google.protobuf.TimestampB\x03\xe0\x41\x03\x12\x11\n\x04type\x18\x07 \x01(\tB\x03\xe0\x41\x02\x12#\n\x16optimization_objective\x18\x08 \x01(\tB\x03\xe0\x41\x01\x12U\n\x15periodic_tuning_state\x18\x0b \x01(\x0e\x32\x31.google.cloud.retail.v2.Model.PeriodicTuningStateB\x03\xe0\x41\x01\x12\x37\n\x0elast_tune_time\x18\x0c \x01(\x0b\x32\x1a.google.protobuf.TimestampB\x03\xe0\x41\x03\x12\x1d\n\x10tuning_operation\x18\x0f \x01(\tB\x03\xe0\x41\x03\x12@\n\ndata_state\x18\x10 \x01(\x0e\x32\'.google.cloud.retail.v2.Model.DataStateB\x03\xe0\x41\x03\x12U\n\x10\x66iltering_option\x18\x12 \x01(\x0e\x32\x36.google.cloud.retail.v2.RecommendationsFilteringOptionB\x03\xe0\x41\x01\x12R\n\x14serving_config_lists\x18\x13 \x03(\x0b\x32/.google.cloud.retail.v2.Model.ServingConfigListB\x03\xe0\x41\x03\x12U\n\x15model_features_config\x18\x16 \x01(\x0b\x32\x31.google.cloud.retail.v2.Model.ModelFeaturesConfigB\x03\xe0\x41\x01\x1a\x34\n\x11ServingConfigList\x12\x1f\n\x12serving_config_ids\x18\x01 \x03(\tB\x03\xe0\x41\x01\x1a\x7f\n&FrequentlyBoughtTogetherFeaturesConfig\x12U\n\x15\x63ontext_products_type\x18\x02 \x01(\x0e\x32\x31.google.cloud.retail.v2.Model.ContextProductsTypeB\x03\xe0\x41\x01\x1a\xa1\x01\n\x13ModelFeaturesConfig\x12q\n!frequently_bought_together_config\x18\x01 \x01(\x0b\x32\x44.google.cloud.retail.v2.Model.FrequentlyBoughtTogetherFeaturesConfigH\x00\x42\x17\n\x15type_dedicated_config\"R\n\x0cServingState\x12\x1d\n\x19SERVING_STATE_UNSPECIFIED\x10\x00\x12\x0c\n\x08INACTIVE\x10\x01\x12\n\n\x06\x41\x43TIVE\x10\x02\x12\t\n\x05TUNED\x10\x03\"I\n\rTrainingState\x12\x1e\n\x1aTRAINING_STATE_UNSPECIFIED\x10\x00\x12\n\n\x06PAUSED\x10\x01\x12\x0c\n\x08TRAINING\x10\x02\"\x90\x01\n\x13PeriodicTuningState\x12%\n!PERIODIC_TUNING_STATE_UNSPECIFIED\x10\x00\x12\x1c\n\x18PERIODIC_TUNING_DISABLED\x10\x01\x12\x17\n\x13\x41LL_TUNING_DISABLED\x10\x03\x12\x1b\n\x17PERIODIC_TUNING_ENABLED\x10\x02\"D\n\tDataState\x12\x1a\n\x16\x44\x41TA_STATE_UNSPECIFIED\x10\x00\x12\x0b\n\x07\x44\x41TA_OK\x10\x01\x12\x0e\n\nDATA_ERROR\x10\x02\"w\n\x13\x43ontextProductsType\x12%\n!CONTEXT_PRODUCTS_TYPE_UNSPECIFIED\x10\x00\x12\x1a\n\x16SINGLE_CONTEXT_PRODUCT\x10\x01\x12\x1d\n\x19MULTIPLE_CONTEXT_PRODUCTS\x10\x02:k\xea\x41h\n\x1bretail.googleapis.com/Model\x12Iprojects/{project}/locations/{location}/catalogs/{catalog}/models/{model}B\xb5\x01\n\x1a\x63om.google.cloud.retail.v2B\nModelProtoP\x01Z2cloud.google.com/go/retail/apiv2/retailpb;retailpb\xa2\x02\x06RETAIL\xaa\x02\x16Google.Cloud.Retail.V2\xca\x02\x16Google\\Cloud\\Retail\\V2\xea\x02\x19Google::Cloud::Retail::V2b\x06proto3" + +pool = ::Google::Protobuf::DescriptorPool.generated_pool +pool.add_serialized_file(descriptor_data) + +module Google + module Cloud + module Retail + module V2 + Model = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.retail.v2.Model").msgclass + Model::ServingConfigList = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.retail.v2.Model.ServingConfigList").msgclass + Model::FrequentlyBoughtTogetherFeaturesConfig = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.retail.v2.Model.FrequentlyBoughtTogetherFeaturesConfig").msgclass + Model::ModelFeaturesConfig = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.retail.v2.Model.ModelFeaturesConfig").msgclass + Model::ServingState = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.retail.v2.Model.ServingState").enummodule + Model::TrainingState = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.retail.v2.Model.TrainingState").enummodule + Model::PeriodicTuningState = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.retail.v2.Model.PeriodicTuningState").enummodule + Model::DataState = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.retail.v2.Model.DataState").enummodule + Model::ContextProductsType = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.retail.v2.Model.ContextProductsType").enummodule + end + end + end +end diff --git a/owl-bot-staging/google-cloud-retail-v2/lib/google/cloud/retail/v2/model_service.rb b/owl-bot-staging/google-cloud-retail-v2/lib/google/cloud/retail/v2/model_service.rb new file mode 100644 index 000000000000..7494180ffbb2 --- /dev/null +++ b/owl-bot-staging/google-cloud-retail-v2/lib/google/cloud/retail/v2/model_service.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 "gapic/common" +require "gapic/config" +require "gapic/config/method" + +require "google/cloud/retail/v2/version" + +require "google/cloud/retail/v2/model_service/credentials" +require "google/cloud/retail/v2/model_service/paths" +require "google/cloud/retail/v2/model_service/operations" +require "google/cloud/retail/v2/model_service/client" +require "google/cloud/retail/v2/model_service/rest" + +module Google + module Cloud + module Retail + module V2 + ## + # Service for performing CRUD operations on models. + # Recommendation models contain all the metadata necessary to generate a set of + # models for the `Predict()` API. A model is queried + # indirectly via a ServingConfig, which associates a model with a + # given Placement (e.g. Frequently Bought Together on Home Page). + # + # This service allows you to do the following: + # + # * Initiate training of a model. + # * Pause training of an existing model. + # * List all the available models along with their metadata. + # * Control their tuning schedule. + # + # @example Load this service and instantiate a gRPC client + # + # require "google/cloud/retail/v2/model_service" + # client = ::Google::Cloud::Retail::V2::ModelService::Client.new + # + # @example Load this service and instantiate a REST client + # + # require "google/cloud/retail/v2/model_service/rest" + # client = ::Google::Cloud::Retail::V2::ModelService::Rest::Client.new + # + module ModelService + end + end + end + end +end + +helper_path = ::File.join __dir__, "model_service", "helpers.rb" +require "google/cloud/retail/v2/model_service/helpers" if ::File.file? helper_path diff --git a/owl-bot-staging/google-cloud-retail-v2/lib/google/cloud/retail/v2/model_service/client.rb b/owl-bot-staging/google-cloud-retail-v2/lib/google/cloud/retail/v2/model_service/client.rb new file mode 100644 index 000000000000..0e6782b10c3c --- /dev/null +++ b/owl-bot-staging/google-cloud-retail-v2/lib/google/cloud/retail/v2/model_service/client.rb @@ -0,0 +1,1219 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +require "google/cloud/errors" +require "google/cloud/retail/v2/model_service_pb" +require "google/cloud/location" + +module Google + module Cloud + module Retail + module V2 + module ModelService + ## + # Client for the ModelService service. + # + # Service for performing CRUD operations on models. + # Recommendation models contain all the metadata necessary to generate a set of + # models for the `Predict()` API. A model is queried + # indirectly via a ServingConfig, which associates a model with a + # given Placement (e.g. Frequently Bought Together on Home Page). + # + # This service allows you to do the following: + # + # * Initiate training of a model. + # * Pause training of an existing model. + # * List all the available models along with their metadata. + # * Control their tuning schedule. + # + class Client + # @private + API_VERSION = "" + + # @private + DEFAULT_ENDPOINT_TEMPLATE = "retail.$UNIVERSE_DOMAIN$" + + include Paths + + # @private + attr_reader :model_service_stub + + ## + # Configure the ModelService Client class. + # + # See {::Google::Cloud::Retail::V2::ModelService::Client::Configuration} + # for a description of the configuration fields. + # + # @example + # + # # Modify the configuration for all ModelService clients + # ::Google::Cloud::Retail::V2::ModelService::Client.configure do |config| + # config.timeout = 10.0 + # end + # + # @yield [config] Configure the Client client. + # @yieldparam config [Client::Configuration] + # + # @return [Client::Configuration] + # + def self.configure + @configure ||= begin + namespace = ["Google", "Cloud", "Retail", "V2"] + parent_config = while namespace.any? + parent_name = namespace.join "::" + parent_const = const_get parent_name + break parent_const.configure if parent_const.respond_to? :configure + namespace.pop + end + default_config = Client::Configuration.new parent_config + + default_config.timeout = 60.0 + default_config.retry_policy = { + initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [14, 4] + } + + default_config + end + yield @configure if block_given? + @configure + end + + ## + # Configure the ModelService Client instance. + # + # The configuration is set to the derived mode, meaning that values can be changed, + # but structural changes (adding new fields, etc.) are not allowed. Structural changes + # should be made on {Client.configure}. + # + # See {::Google::Cloud::Retail::V2::ModelService::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 + @model_service_stub.universe_domain + end + + ## + # Create a new ModelService client object. + # + # @example + # + # # Create a client using the default configuration + # client = ::Google::Cloud::Retail::V2::ModelService::Client.new + # + # # Create a client using a custom configuration + # client = ::Google::Cloud::Retail::V2::ModelService::Client.new do |config| + # config.timeout = 10.0 + # end + # + # @yield [config] Configure the ModelService client. + # @yieldparam config [Client::Configuration] + # + def initialize + # These require statements are intentionally placed here to initialize + # the gRPC module only when it's required. + # See https://github.com/googleapis/toolkit/issues/446 + require "gapic/grpc" + require "google/cloud/retail/v2/model_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 + + @model_service_stub = ::Gapic::ServiceStub.new( + ::Google::Cloud::Retail::V2::ModelService::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 + ) + + @model_service_stub.stub_logger&.info do |entry| + entry.set_system_name + entry.set_service + entry.message = "Created client for #{entry.service}" + entry.set_credentials_fields credentials + entry.set "customEndpoint", @config.endpoint if @config.endpoint + entry.set "defaultTimeout", @config.timeout if @config.timeout + entry.set "quotaProject", @quota_project_id if @quota_project_id + end + + @location_client = Google::Cloud::Location::Locations::Client.new do |config| + config.credentials = credentials + config.quota_project = @quota_project_id + config.endpoint = @model_service_stub.endpoint + config.universe_domain = @model_service_stub.universe_domain + config.logger = @model_service_stub.logger if config.respond_to? :logger= + end + end + + ## + # Get the associated client for long-running operations. + # + # @return [::Google::Cloud::Retail::V2::ModelService::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 + @model_service_stub.logger + end + + # Service calls + + ## + # Creates a new model. + # + # @overload create_model(request, options = nil) + # Pass arguments to `create_model` via a request object, either of type + # {::Google::Cloud::Retail::V2::CreateModelRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Retail::V2::CreateModelRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_model(parent: nil, model: nil, dry_run: nil) + # Pass arguments to `create_model` via keyword arguments. Note that at + # least one keyword argument is 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 under which to create the model. Format: + # `projects/{project_number}/locations/{location_id}/catalogs/{catalog_id}` + # @param model [::Google::Cloud::Retail::V2::Model, ::Hash] + # Required. The payload of the {::Google::Cloud::Retail::V2::Model Model} to + # create. + # @param dry_run [::Boolean] + # Optional. Whether to run a dry run to validate the request (without + # actually creating the model). + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Gapic::Operation] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Gapic::Operation] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/retail/v2" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Retail::V2::ModelService::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Retail::V2::CreateModelRequest.new + # + # # Call the create_model method. + # result = client.create_model 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_model request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Retail::V2::CreateModelRequest + + # Converts hash 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_model.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::Retail::V2::VERSION + metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.parent + 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_model.timeout, + metadata: metadata, + retry_policy: @config.rpcs.create_model.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @model_service_stub.call_rpc :create_model, 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 model. + # + # @overload get_model(request, options = nil) + # Pass arguments to `get_model` via a request object, either of type + # {::Google::Cloud::Retail::V2::GetModelRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Retail::V2::GetModelRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_model(name: nil) + # Pass arguments to `get_model` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param name [::String] + # Required. The resource name of the {::Google::Cloud::Retail::V2::Model Model} to + # get. Format: + # `projects/{project_number}/locations/{location_id}/catalogs/{catalog}/models/{model_id}` + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Google::Cloud::Retail::V2::Model] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Google::Cloud::Retail::V2::Model] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/retail/v2" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Retail::V2::ModelService::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Retail::V2::GetModelRequest.new + # + # # Call the get_model method. + # result = client.get_model request + # + # # The returned object is of type Google::Cloud::Retail::V2::Model. + # p result + # + def get_model request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Retail::V2::GetModelRequest + + # Converts hash 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_model.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::Retail::V2::VERSION + metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.name + header_params["name"] = request.name + end + + request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") + metadata[:"x-goog-request-params"] ||= request_params_header + + options.apply_defaults timeout: @config.rpcs.get_model.timeout, + metadata: metadata, + retry_policy: @config.rpcs.get_model.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @model_service_stub.call_rpc :get_model, request, options: options do |response, operation| + yield response, operation if block_given? + end + rescue ::GRPC::BadStatus => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Pauses the training of an existing model. + # + # @overload pause_model(request, options = nil) + # Pass arguments to `pause_model` via a request object, either of type + # {::Google::Cloud::Retail::V2::PauseModelRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Retail::V2::PauseModelRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. + # + # @overload pause_model(name: nil) + # Pass arguments to `pause_model` via keyword arguments. Note that at + # least one keyword argument is 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 model to pause. + # Format: + # `projects/{project_number}/locations/{location_id}/catalogs/{catalog_id}/models/{model_id}` + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Google::Cloud::Retail::V2::Model] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Google::Cloud::Retail::V2::Model] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/retail/v2" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Retail::V2::ModelService::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Retail::V2::PauseModelRequest.new + # + # # Call the pause_model method. + # result = client.pause_model request + # + # # The returned object is of type Google::Cloud::Retail::V2::Model. + # p result + # + def pause_model request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Retail::V2::PauseModelRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + metadata = @config.rpcs.pause_model.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::Retail::V2::VERSION + metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.name + header_params["name"] = request.name + end + + request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") + metadata[:"x-goog-request-params"] ||= request_params_header + + options.apply_defaults timeout: @config.rpcs.pause_model.timeout, + metadata: metadata, + retry_policy: @config.rpcs.pause_model.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @model_service_stub.call_rpc :pause_model, request, options: options do |response, operation| + yield response, operation if block_given? + end + rescue ::GRPC::BadStatus => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Resumes the training of an existing model. + # + # @overload resume_model(request, options = nil) + # Pass arguments to `resume_model` via a request object, either of type + # {::Google::Cloud::Retail::V2::ResumeModelRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Retail::V2::ResumeModelRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. + # + # @overload resume_model(name: nil) + # Pass arguments to `resume_model` via keyword arguments. Note that at + # least one keyword argument is 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 model to resume. + # Format: + # `projects/{project_number}/locations/{location_id}/catalogs/{catalog_id}/models/{model_id}` + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Google::Cloud::Retail::V2::Model] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Google::Cloud::Retail::V2::Model] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/retail/v2" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Retail::V2::ModelService::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Retail::V2::ResumeModelRequest.new + # + # # Call the resume_model method. + # result = client.resume_model request + # + # # The returned object is of type Google::Cloud::Retail::V2::Model. + # p result + # + def resume_model request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Retail::V2::ResumeModelRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + metadata = @config.rpcs.resume_model.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::Retail::V2::VERSION + metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.name + header_params["name"] = request.name + end + + request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") + metadata[:"x-goog-request-params"] ||= request_params_header + + options.apply_defaults timeout: @config.rpcs.resume_model.timeout, + metadata: metadata, + retry_policy: @config.rpcs.resume_model.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @model_service_stub.call_rpc :resume_model, request, options: options do |response, operation| + yield response, operation if block_given? + end + rescue ::GRPC::BadStatus => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Deletes an existing model. + # + # @overload delete_model(request, options = nil) + # Pass arguments to `delete_model` via a request object, either of type + # {::Google::Cloud::Retail::V2::DeleteModelRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Retail::V2::DeleteModelRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_model(name: nil) + # Pass arguments to `delete_model` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param name [::String] + # Required. The resource name of the {::Google::Cloud::Retail::V2::Model Model} to + # delete. Format: + # `projects/{project_number}/locations/{location_id}/catalogs/{catalog_id}/models/{model_id}` + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Google::Protobuf::Empty] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Google::Protobuf::Empty] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/retail/v2" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Retail::V2::ModelService::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Retail::V2::DeleteModelRequest.new + # + # # Call the delete_model method. + # result = client.delete_model request + # + # # The returned object is of type Google::Protobuf::Empty. + # p result + # + def delete_model request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Retail::V2::DeleteModelRequest + + # Converts hash 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_model.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::Retail::V2::VERSION + metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.name + header_params["name"] = request.name + end + + request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") + metadata[:"x-goog-request-params"] ||= request_params_header + + options.apply_defaults timeout: @config.rpcs.delete_model.timeout, + metadata: metadata, + retry_policy: @config.rpcs.delete_model.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @model_service_stub.call_rpc :delete_model, request, options: options do |response, operation| + yield response, operation if block_given? + end + rescue ::GRPC::BadStatus => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Lists all the models linked to this event store. + # + # @overload list_models(request, options = nil) + # Pass arguments to `list_models` via a request object, either of type + # {::Google::Cloud::Retail::V2::ListModelsRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Retail::V2::ListModelsRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_models(parent: nil, page_size: nil, page_token: nil) + # Pass arguments to `list_models` via keyword arguments. Note that at + # least one keyword argument is 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 for which to list models. + # Format: + # `projects/{project_number}/locations/{location_id}/catalogs/{catalog_id}` + # @param page_size [::Integer] + # Optional. Maximum number of results to return. If unspecified, defaults + # to 50. Max allowed value is 1000. + # @param page_token [::String] + # Optional. A page token, received from a previous `ListModels` + # call. Provide this to retrieve the subsequent page. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Gapic::PagedEnumerable<::Google::Cloud::Retail::V2::Model>] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Gapic::PagedEnumerable<::Google::Cloud::Retail::V2::Model>] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/retail/v2" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Retail::V2::ModelService::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Retail::V2::ListModelsRequest.new + # + # # Call the list_models method. + # result = client.list_models request + # + # # The returned object is of type Gapic::PagedEnumerable. You can iterate + # # over elements, and API calls will be issued to fetch pages as needed. + # result.each do |item| + # # Each element is of type ::Google::Cloud::Retail::V2::Model. + # p item + # end + # + def list_models request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Retail::V2::ListModelsRequest + + # Converts hash 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_models.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::Retail::V2::VERSION + metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.parent + 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_models.timeout, + metadata: metadata, + retry_policy: @config.rpcs.list_models.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @model_service_stub.call_rpc :list_models, request, options: options do |response, operation| + response = ::Gapic::PagedEnumerable.new @model_service_stub, :list_models, 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 + + ## + # Update of model metadata. Only fields that + # currently can be updated are: `filtering_option` and + # `periodic_tuning_state`. + # If other values are provided, this API method ignores them. + # + # @overload update_model(request, options = nil) + # Pass arguments to `update_model` via a request object, either of type + # {::Google::Cloud::Retail::V2::UpdateModelRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Retail::V2::UpdateModelRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_model(model: nil, update_mask: nil) + # Pass arguments to `update_model` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param model [::Google::Cloud::Retail::V2::Model, ::Hash] + # Required. The body of the updated {::Google::Cloud::Retail::V2::Model Model}. + # @param update_mask [::Google::Protobuf::FieldMask, ::Hash] + # Optional. Indicates which fields in the provided 'model' to + # update. If not set, by default updates all fields. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Google::Cloud::Retail::V2::Model] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Google::Cloud::Retail::V2::Model] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/retail/v2" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Retail::V2::ModelService::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Retail::V2::UpdateModelRequest.new + # + # # Call the update_model method. + # result = client.update_model request + # + # # The returned object is of type Google::Cloud::Retail::V2::Model. + # p result + # + def update_model request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Retail::V2::UpdateModelRequest + + # Converts hash 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_model.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::Retail::V2::VERSION + metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.model&.name + header_params["model.name"] = request.model.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_model.timeout, + metadata: metadata, + retry_policy: @config.rpcs.update_model.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @model_service_stub.call_rpc :update_model, 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 + + ## + # Tunes an existing model. + # + # @overload tune_model(request, options = nil) + # Pass arguments to `tune_model` via a request object, either of type + # {::Google::Cloud::Retail::V2::TuneModelRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Retail::V2::TuneModelRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. + # + # @overload tune_model(name: nil) + # Pass arguments to `tune_model` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param name [::String] + # Required. The resource name of the model to tune. + # Format: + # `projects/{project_number}/locations/{location_id}/catalogs/{catalog_id}/models/{model_id}` + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Gapic::Operation] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Gapic::Operation] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/retail/v2" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Retail::V2::ModelService::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Retail::V2::TuneModelRequest.new + # + # # Call the tune_model method. + # result = client.tune_model 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 tune_model request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Retail::V2::TuneModelRequest + + # Converts hash 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.tune_model.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::Retail::V2::VERSION + metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.name + header_params["name"] = request.name + end + + request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") + metadata[:"x-goog-request-params"] ||= request_params_header + + options.apply_defaults timeout: @config.rpcs.tune_model.timeout, + metadata: metadata, + retry_policy: @config.rpcs.tune_model.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @model_service_stub.call_rpc :tune_model, 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 ModelService API. + # + # This class represents the configuration for ModelService, + # providing control over timeouts, retry behavior, logging, transport + # parameters, and other low-level controls. Certain parameters can also be + # applied individually to specific RPCs. See + # {::Google::Cloud::Retail::V2::ModelService::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_model to 20 seconds, + # # and all remaining timeouts to 10 seconds. + # ::Google::Cloud::Retail::V2::ModelService::Client.configure do |config| + # config.timeout = 10.0 + # config.rpcs.create_model.timeout = 20.0 + # end + # + # # Apply the above configuration only to a new client. + # client = ::Google::Cloud::Retail::V2::ModelService::Client.new do |config| + # config.timeout = 10.0 + # config.rpcs.create_model.timeout = 20.0 + # end + # + # @!attribute [rw] endpoint + # A custom service endpoint, as a hostname or hostname:port. The default is + # nil, indicating to use the default endpoint in the current universe domain. + # @return [::String,nil] + # @!attribute [rw] credentials + # Credentials to send with calls. You may provide any of the following types: + # * (`Google::Auth::Credentials`) A googleauth credentials object + # (see the [googleauth docs](https://rubydoc.info/gems/googleauth/Google/Auth/Credentials)) + # * (`Signet::OAuth2::Client`) A signet oauth2 client object + # (see the [signet docs](https://rubydoc.info/gems/signet/Signet/OAuth2/Client)) + # * (`GRPC::Core::Channel`) a gRPC channel with included credentials + # * (`GRPC::Core::ChannelCredentials`) a gRPC credentails object + # * (`nil`) indicating no credentials + # + # @note Warning: Passing a `String` to a keyfile path or a `Hash` of credentials + # is deprecated. Providing an unvalidated credential configuration to + # Google APIs can compromise the security of your systems and data. + # + # @example + # + # # The recommended way to provide credentials is to use the `make_creds` method + # # on the appropriate credentials class for your environment. + # + # require "googleauth" + # + # credentials = ::Google::Auth::ServiceAccountCredentials.make_creds( + # json_key_io: ::File.open("/path/to/keyfile.json") + # ) + # + # client = ::Google::Cloud::Retail::V2::ModelService::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 = "retail.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 ModelService 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_model` + # @return [::Gapic::Config::Method] + # + attr_reader :create_model + ## + # RPC-specific configuration for `get_model` + # @return [::Gapic::Config::Method] + # + attr_reader :get_model + ## + # RPC-specific configuration for `pause_model` + # @return [::Gapic::Config::Method] + # + attr_reader :pause_model + ## + # RPC-specific configuration for `resume_model` + # @return [::Gapic::Config::Method] + # + attr_reader :resume_model + ## + # RPC-specific configuration for `delete_model` + # @return [::Gapic::Config::Method] + # + attr_reader :delete_model + ## + # RPC-specific configuration for `list_models` + # @return [::Gapic::Config::Method] + # + attr_reader :list_models + ## + # RPC-specific configuration for `update_model` + # @return [::Gapic::Config::Method] + # + attr_reader :update_model + ## + # RPC-specific configuration for `tune_model` + # @return [::Gapic::Config::Method] + # + attr_reader :tune_model + + # @private + def initialize parent_rpcs = nil + create_model_config = parent_rpcs.create_model if parent_rpcs.respond_to? :create_model + @create_model = ::Gapic::Config::Method.new create_model_config + get_model_config = parent_rpcs.get_model if parent_rpcs.respond_to? :get_model + @get_model = ::Gapic::Config::Method.new get_model_config + pause_model_config = parent_rpcs.pause_model if parent_rpcs.respond_to? :pause_model + @pause_model = ::Gapic::Config::Method.new pause_model_config + resume_model_config = parent_rpcs.resume_model if parent_rpcs.respond_to? :resume_model + @resume_model = ::Gapic::Config::Method.new resume_model_config + delete_model_config = parent_rpcs.delete_model if parent_rpcs.respond_to? :delete_model + @delete_model = ::Gapic::Config::Method.new delete_model_config + list_models_config = parent_rpcs.list_models if parent_rpcs.respond_to? :list_models + @list_models = ::Gapic::Config::Method.new list_models_config + update_model_config = parent_rpcs.update_model if parent_rpcs.respond_to? :update_model + @update_model = ::Gapic::Config::Method.new update_model_config + tune_model_config = parent_rpcs.tune_model if parent_rpcs.respond_to? :tune_model + @tune_model = ::Gapic::Config::Method.new tune_model_config + + yield self if block_given? + end + end + end + end + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-retail-v2/lib/google/cloud/retail/v2/model_service/credentials.rb b/owl-bot-staging/google-cloud-retail-v2/lib/google/cloud/retail/v2/model_service/credentials.rb new file mode 100644 index 000000000000..acf6300e811b --- /dev/null +++ b/owl-bot-staging/google-cloud-retail-v2/lib/google/cloud/retail/v2/model_service/credentials.rb @@ -0,0 +1,51 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +require "googleauth" + +module Google + module Cloud + module Retail + module V2 + module ModelService + # Credentials for the ModelService API. + class Credentials < ::Google::Auth::Credentials + self.scope = [ + "https://www.googleapis.com/auth/cloud-platform" + ] + self.env_vars = [ + "RETAIL_CREDENTIALS", + "RETAIL_KEYFILE", + "GOOGLE_CLOUD_CREDENTIALS", + "GOOGLE_CLOUD_KEYFILE", + "GCLOUD_KEYFILE", + "RETAIL_CREDENTIALS_JSON", + "RETAIL_KEYFILE_JSON", + "GOOGLE_CLOUD_CREDENTIALS_JSON", + "GOOGLE_CLOUD_KEYFILE_JSON", + "GCLOUD_KEYFILE_JSON" + ] + self.paths = [ + "~/.config/google_cloud/application_default_credentials.json" + ] + end + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-retail-v2/lib/google/cloud/retail/v2/model_service/operations.rb b/owl-bot-staging/google-cloud-retail-v2/lib/google/cloud/retail/v2/model_service/operations.rb new file mode 100644 index 000000000000..0366921a292a --- /dev/null +++ b/owl-bot-staging/google-cloud-retail-v2/lib/google/cloud/retail/v2/model_service/operations.rb @@ -0,0 +1,841 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +require "gapic/operation" +require "google/longrunning/operations_pb" + +module Google + module Cloud + module Retail + module V2 + module ModelService + # Service that implements Longrunning Operations API. + class Operations + # @private + API_VERSION = "" + + # @private + DEFAULT_ENDPOINT_TEMPLATE = "retail.$UNIVERSE_DOMAIN$" + + # @private + attr_reader :operations_stub + + ## + # Configuration for the ModelService 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 ModelService 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::Retail::V2::VERSION + metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.name + header_params["name"] = request.name + end + + request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") + metadata[:"x-goog-request-params"] ||= request_params_header + + options.apply_defaults timeout: @config.rpcs.list_operations.timeout, + metadata: metadata, + retry_policy: @config.rpcs.list_operations.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @operations_stub.call_rpc :list_operations, request, options: options do |response, operation| + wrap_lro_operation = ->(op_response) { ::Gapic::Operation.new op_response, @operations_client } + response = ::Gapic::PagedEnumerable.new @operations_stub, :list_operations, request, response, operation, options, format_resource: wrap_lro_operation + yield response, operation if block_given? + throw :response, response + end + rescue ::GRPC::BadStatus => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Gets the latest state of a long-running operation. Clients can use this + # method to poll the operation result at intervals as recommended by the API + # service. + # + # @overload get_operation(request, options = nil) + # Pass arguments to `get_operation` via a request object, either of type + # {::Google::Longrunning::GetOperationRequest} or an equivalent Hash. + # + # @param request [::Google::Longrunning::GetOperationRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. + # + # @overload get_operation(name: nil) + # Pass arguments to `get_operation` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param name [::String] + # The name of the operation resource. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Gapic::Operation] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Gapic::Operation] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/longrunning" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Longrunning::Operations::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Longrunning::GetOperationRequest.new + # + # # Call the get_operation method. + # result = client.get_operation request + # + # # The returned object is of type Gapic::Operation. You can use it to + # # check the status of an operation, cancel it, or wait for results. + # # Here is how to wait for a response. + # result.wait_until_done! timeout: 60 + # if result.response? + # p result.response + # else + # puts "No response received." + # end + # + def get_operation request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Longrunning::GetOperationRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + metadata = @config.rpcs.get_operation.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::Retail::V2::VERSION + metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.name + header_params["name"] = request.name + end + + request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") + metadata[:"x-goog-request-params"] ||= request_params_header + + options.apply_defaults timeout: @config.rpcs.get_operation.timeout, + metadata: metadata, + retry_policy: @config.rpcs.get_operation.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @operations_stub.call_rpc :get_operation, request, options: options do |response, operation| + response = ::Gapic::Operation.new response, @operations_client, options: options + yield response, operation if block_given? + throw :response, response + end + rescue ::GRPC::BadStatus => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Deletes a long-running operation. This method indicates that the client is + # no longer interested in the operation result. It does not cancel the + # operation. If the server doesn't support this method, it returns + # `google.rpc.Code.UNIMPLEMENTED`. + # + # @overload delete_operation(request, options = nil) + # Pass arguments to `delete_operation` via a request object, either of type + # {::Google::Longrunning::DeleteOperationRequest} or an equivalent Hash. + # + # @param request [::Google::Longrunning::DeleteOperationRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. + # + # @overload delete_operation(name: nil) + # Pass arguments to `delete_operation` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param name [::String] + # The name of the operation resource to be deleted. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Google::Protobuf::Empty] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Google::Protobuf::Empty] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/longrunning" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Longrunning::Operations::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Longrunning::DeleteOperationRequest.new + # + # # Call the delete_operation method. + # result = client.delete_operation request + # + # # The returned object is of type Google::Protobuf::Empty. + # p result + # + def delete_operation request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Longrunning::DeleteOperationRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + metadata = @config.rpcs.delete_operation.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::Retail::V2::VERSION + metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.name + header_params["name"] = request.name + end + + request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") + metadata[:"x-goog-request-params"] ||= request_params_header + + options.apply_defaults timeout: @config.rpcs.delete_operation.timeout, + metadata: metadata, + retry_policy: @config.rpcs.delete_operation.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @operations_stub.call_rpc :delete_operation, request, options: options do |response, operation| + yield response, operation if block_given? + end + rescue ::GRPC::BadStatus => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Starts asynchronous cancellation on a long-running operation. The server + # makes a best effort to cancel the operation, but success is not + # guaranteed. If the server doesn't support this method, it returns + # `google.rpc.Code.UNIMPLEMENTED`. Clients can use + # Operations.GetOperation or + # other methods to check whether the cancellation succeeded or whether the + # operation completed despite cancellation. On successful cancellation, + # the operation is not deleted; instead, it becomes an operation with + # an {::Google::Longrunning::Operation#error Operation.error} value with a + # {::Google::Rpc::Status#code google.rpc.Status.code} of `1`, corresponding to + # `Code.CANCELLED`. + # + # @overload cancel_operation(request, options = nil) + # Pass arguments to `cancel_operation` via a request object, either of type + # {::Google::Longrunning::CancelOperationRequest} or an equivalent Hash. + # + # @param request [::Google::Longrunning::CancelOperationRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. + # + # @overload cancel_operation(name: nil) + # Pass arguments to `cancel_operation` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param name [::String] + # The name of the operation resource to be cancelled. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Google::Protobuf::Empty] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Google::Protobuf::Empty] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/longrunning" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Longrunning::Operations::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Longrunning::CancelOperationRequest.new + # + # # Call the cancel_operation method. + # result = client.cancel_operation request + # + # # The returned object is of type Google::Protobuf::Empty. + # p result + # + def cancel_operation request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Longrunning::CancelOperationRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + metadata = @config.rpcs.cancel_operation.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::Retail::V2::VERSION + metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.name + header_params["name"] = request.name + end + + request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") + metadata[:"x-goog-request-params"] ||= request_params_header + + options.apply_defaults timeout: @config.rpcs.cancel_operation.timeout, + metadata: metadata, + retry_policy: @config.rpcs.cancel_operation.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @operations_stub.call_rpc :cancel_operation, request, options: options do |response, operation| + yield response, operation if block_given? + end + rescue ::GRPC::BadStatus => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Waits until the specified long-running operation is done or reaches at most + # a specified timeout, returning the latest state. If the operation is + # already done, the latest state is immediately returned. If the timeout + # specified is greater than the default HTTP/RPC timeout, the HTTP/RPC + # timeout is used. If the server does not support this method, it returns + # `google.rpc.Code.UNIMPLEMENTED`. + # Note that this method is on a best-effort basis. It may return the latest + # state before the specified timeout (including immediately), meaning even an + # immediate response is no guarantee that the operation is done. + # + # @overload wait_operation(request, options = nil) + # Pass arguments to `wait_operation` via a request object, either of type + # {::Google::Longrunning::WaitOperationRequest} or an equivalent Hash. + # + # @param request [::Google::Longrunning::WaitOperationRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. + # + # @overload wait_operation(name: nil, timeout: nil) + # Pass arguments to `wait_operation` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param name [::String] + # The name of the operation resource to wait on. + # @param timeout [::Google::Protobuf::Duration, ::Hash] + # The maximum duration to wait before timing out. If left blank, the wait + # will be at most the time permitted by the underlying HTTP/RPC protocol. + # If RPC context deadline is also specified, the shorter one will be used. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Gapic::Operation] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Gapic::Operation] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/longrunning" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Longrunning::Operations::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Longrunning::WaitOperationRequest.new + # + # # Call the wait_operation method. + # result = client.wait_operation request + # + # # The returned object is of type Gapic::Operation. You can use it to + # # check the status of an operation, cancel it, or wait for results. + # # Here is how to wait for a response. + # result.wait_until_done! timeout: 60 + # if result.response? + # p result.response + # else + # puts "No response received." + # end + # + def wait_operation request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Longrunning::WaitOperationRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + metadata = @config.rpcs.wait_operation.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::Retail::V2::VERSION + metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + options.apply_defaults timeout: @config.rpcs.wait_operation.timeout, + metadata: metadata, + retry_policy: @config.rpcs.wait_operation.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @operations_stub.call_rpc :wait_operation, request, options: options do |response, operation| + response = ::Gapic::Operation.new response, @operations_client, options: options + yield response, operation if block_given? + throw :response, response + end + rescue ::GRPC::BadStatus => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Configuration class for the Operations API. + # + # This class represents the configuration for Operations, + # providing control over timeouts, retry behavior, logging, transport + # parameters, and other low-level controls. Certain parameters can also be + # applied individually to specific RPCs. See + # {::Google::Longrunning::Operations::Client::Configuration::Rpcs} + # for a list of RPCs that can be configured independently. + # + # Configuration can be applied globally to all clients, or to a single client + # on construction. + # + # @example + # + # # Modify the global config, setting the timeout for + # # list_operations to 20 seconds, + # # and all remaining timeouts to 10 seconds. + # ::Google::Longrunning::Operations::Client.configure do |config| + # config.timeout = 10.0 + # config.rpcs.list_operations.timeout = 20.0 + # end + # + # # Apply the above configuration only to a new client. + # client = ::Google::Longrunning::Operations::Client.new do |config| + # config.timeout = 10.0 + # config.rpcs.list_operations.timeout = 20.0 + # end + # + # @!attribute [rw] endpoint + # A custom service endpoint, as a hostname or hostname:port. The default is + # nil, indicating to use the default endpoint in the current universe domain. + # @return [::String,nil] + # @!attribute [rw] credentials + # Credentials to send with calls. You may provide any of the following types: + # * (`Google::Auth::Credentials`) A googleauth credentials object + # (see the [googleauth docs](https://rubydoc.info/gems/googleauth/Google/Auth/Credentials)) + # * (`Signet::OAuth2::Client`) A signet oauth2 client object + # (see the [signet docs](https://rubydoc.info/gems/signet/Signet/OAuth2/Client)) + # * (`GRPC::Core::Channel`) a gRPC channel with included credentials + # * (`GRPC::Core::ChannelCredentials`) a gRPC credentails object + # * (`nil`) indicating no credentials + # + # @note Warning: Passing a `String` to a keyfile path or a `Hash` of credentials + # is deprecated. Providing an unvalidated credential configuration to + # Google APIs can compromise the security of your systems and data. + # + # @example + # + # # The recommended way to provide credentials is to use the `make_creds` method + # # on the appropriate credentials class for your environment. + # + # require "googleauth" + # + # credentials = ::Google::Auth::ServiceAccountCredentials.make_creds( + # json_key_io: ::File.open("/path/to/keyfile.json") + # ) + # + # client = ::Google::Longrunning::Operations::Client.new do |config| + # config.credentials = credentials + # end + # + # @note Warning: If you accept a credential configuration (JSON file or Hash) from an + # external source for authentication to Google Cloud, you must validate it before + # providing it to a Google API client library. Providing an unvalidated credential + # configuration to Google APIs can compromise the security of your systems and data. + # For more information, refer to [Validate credential configurations from external + # sources](https://cloud.google.com/docs/authentication/external/externally-sourced-credentials). + # @return [::Object] + # @!attribute [rw] scope + # The OAuth scopes + # @return [::Array<::String>] + # @!attribute [rw] lib_name + # The library name as recorded in instrumentation and logging + # @return [::String] + # @!attribute [rw] lib_version + # The library version as recorded in instrumentation and logging + # @return [::String] + # @!attribute [rw] channel_args + # Extra parameters passed to the gRPC channel. Note: this is ignored if a + # `GRPC::Core::Channel` object is provided as the credential. + # @return [::Hash] + # @!attribute [rw] interceptors + # An array of interceptors that are run before calls are executed. + # @return [::Array<::GRPC::ClientInterceptor>] + # @!attribute [rw] timeout + # The call timeout in seconds. + # @return [::Numeric] + # @!attribute [rw] metadata + # Additional gRPC headers to be sent with the call. + # @return [::Hash{::Symbol=>::String}] + # @!attribute [rw] retry_policy + # The retry policy. The value is a hash with the following keys: + # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds. + # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds. + # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier. + # * `:retry_codes` (*type:* `Array`) - The error codes that should + # trigger a retry. + # @return [::Hash] + # @!attribute [rw] quota_project + # A separate project against which to charge quota. + # @return [::String] + # @!attribute [rw] universe_domain + # The universe domain within which to make requests. This determines the + # default endpoint URL. The default value of nil uses the environment + # universe (usually the default "googleapis.com" universe). + # @return [::String,nil] + # @!attribute [rw] logger + # A custom logger to use for request/response debug logging, or the value + # `:default` (the default) to construct a default logger, or `nil` to + # explicitly disable logging. + # @return [::Logger,:default,nil] + # + class Configuration + extend ::Gapic::Config + + # @private + # The endpoint specific to the default "googleapis.com" universe. Deprecated. + DEFAULT_ENDPOINT = "retail.googleapis.com" + + config_attr :endpoint, nil, ::String, nil + config_attr :credentials, nil do |value| + allowed = [::String, ::Hash, ::Proc, ::Symbol, ::Google::Auth::Credentials, ::Google::Auth::BaseClient, ::Signet::OAuth2::Client, nil] + allowed += [::GRPC::Core::Channel, ::GRPC::Core::ChannelCredentials] if defined? ::GRPC::Core::Channel + allowed.any? { |klass| klass === value } + end + config_attr :scope, nil, ::String, ::Array, nil + config_attr :lib_name, nil, ::String, nil + config_attr :lib_version, nil, ::String, nil + config_attr(:channel_args, { "grpc.service_config_disable_resolution" => 1 }, ::Hash, nil) + config_attr :interceptors, nil, ::Array, nil + config_attr :timeout, nil, ::Numeric, nil + config_attr :metadata, nil, ::Hash, nil + config_attr :retry_policy, nil, ::Hash, ::Proc, nil + config_attr :quota_project, nil, ::String, nil + config_attr :universe_domain, nil, ::String, nil + config_attr :logger, :default, ::Logger, nil, :default + + # @private + def initialize parent_config = nil + @parent_config = parent_config unless parent_config.nil? + + yield self if block_given? + end + + ## + # Configurations for individual RPCs + # @return [Rpcs] + # + def rpcs + @rpcs ||= begin + parent_rpcs = nil + parent_rpcs = @parent_config.rpcs if defined?(@parent_config) && @parent_config.respond_to?(:rpcs) + Rpcs.new parent_rpcs + end + end + + ## + # Configuration for the channel pool + # @return [::Gapic::ServiceStub::ChannelPool::Configuration] + # + def channel_pool + @channel_pool ||= ::Gapic::ServiceStub::ChannelPool::Configuration.new + end + + ## + # Configuration RPC class for the Operations API. + # + # Includes fields providing the configuration for each RPC in this service. + # Each configuration object is of type `Gapic::Config::Method` and includes + # the following configuration fields: + # + # * `timeout` (*type:* `Numeric`) - The call timeout in seconds + # * `metadata` (*type:* `Hash{Symbol=>String}`) - Additional gRPC headers + # * `retry_policy (*type:* `Hash`) - The retry policy. The policy fields + # include the following keys: + # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds. + # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds. + # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier. + # * `:retry_codes` (*type:* `Array`) - The error codes that should + # trigger a retry. + # + class Rpcs + ## + # RPC-specific configuration for `list_operations` + # @return [::Gapic::Config::Method] + # + attr_reader :list_operations + ## + # RPC-specific configuration for `get_operation` + # @return [::Gapic::Config::Method] + # + attr_reader :get_operation + ## + # RPC-specific configuration for `delete_operation` + # @return [::Gapic::Config::Method] + # + attr_reader :delete_operation + ## + # RPC-specific configuration for `cancel_operation` + # @return [::Gapic::Config::Method] + # + attr_reader :cancel_operation + ## + # RPC-specific configuration for `wait_operation` + # @return [::Gapic::Config::Method] + # + attr_reader :wait_operation + + # @private + def initialize parent_rpcs = nil + list_operations_config = parent_rpcs.list_operations if parent_rpcs.respond_to? :list_operations + @list_operations = ::Gapic::Config::Method.new list_operations_config + get_operation_config = parent_rpcs.get_operation if parent_rpcs.respond_to? :get_operation + @get_operation = ::Gapic::Config::Method.new get_operation_config + delete_operation_config = parent_rpcs.delete_operation if parent_rpcs.respond_to? :delete_operation + @delete_operation = ::Gapic::Config::Method.new delete_operation_config + cancel_operation_config = parent_rpcs.cancel_operation if parent_rpcs.respond_to? :cancel_operation + @cancel_operation = ::Gapic::Config::Method.new cancel_operation_config + wait_operation_config = parent_rpcs.wait_operation if parent_rpcs.respond_to? :wait_operation + @wait_operation = ::Gapic::Config::Method.new wait_operation_config + + yield self if block_given? + end + end + end + end + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-retail-v2/lib/google/cloud/retail/v2/model_service/paths.rb b/owl-bot-staging/google-cloud-retail-v2/lib/google/cloud/retail/v2/model_service/paths.rb new file mode 100644 index 000000000000..dfac159c4ef5 --- /dev/null +++ b/owl-bot-staging/google-cloud-retail-v2/lib/google/cloud/retail/v2/model_service/paths.rb @@ -0,0 +1,73 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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 Retail + module V2 + module ModelService + # Path helper methods for the ModelService API. + module Paths + ## + # Create a fully-qualified Catalog resource string. + # + # The resource will be in the following format: + # + # `projects/{project}/locations/{location}/catalogs/{catalog}` + # + # @param project [String] + # @param location [String] + # @param catalog [String] + # + # @return [::String] + def catalog_path project:, location:, catalog: + raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" + raise ::ArgumentError, "location cannot contain /" if location.to_s.include? "/" + + "projects/#{project}/locations/#{location}/catalogs/#{catalog}" + end + + ## + # Create a fully-qualified Model resource string. + # + # The resource will be in the following format: + # + # `projects/{project}/locations/{location}/catalogs/{catalog}/models/{model}` + # + # @param project [String] + # @param location [String] + # @param catalog [String] + # @param model [String] + # + # @return [::String] + def model_path project:, location:, catalog:, model: + raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" + raise ::ArgumentError, "location cannot contain /" if location.to_s.include? "/" + raise ::ArgumentError, "catalog cannot contain /" if catalog.to_s.include? "/" + + "projects/#{project}/locations/#{location}/catalogs/#{catalog}/models/#{model}" + end + + extend self + end + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-retail-v2/lib/google/cloud/retail/v2/model_service/rest.rb b/owl-bot-staging/google-cloud-retail-v2/lib/google/cloud/retail/v2/model_service/rest.rb new file mode 100644 index 000000000000..09cc5600da6e --- /dev/null +++ b/owl-bot-staging/google-cloud-retail-v2/lib/google/cloud/retail/v2/model_service/rest.rb @@ -0,0 +1,64 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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/retail/v2/version" + +require "google/cloud/retail/v2/model_service/credentials" +require "google/cloud/retail/v2/model_service/paths" +require "google/cloud/retail/v2/model_service/rest/operations" +require "google/cloud/retail/v2/model_service/rest/client" + +module Google + module Cloud + module Retail + module V2 + ## + # Service for performing CRUD operations on models. + # Recommendation models contain all the metadata necessary to generate a set of + # models for the `Predict()` API. A model is queried + # indirectly via a ServingConfig, which associates a model with a + # given Placement (e.g. Frequently Bought Together on Home Page). + # + # This service allows you to do the following: + # + # * Initiate training of a model. + # * Pause training of an existing model. + # * List all the available models along with their metadata. + # * Control their tuning schedule. + # + # To load this service and instantiate a REST client: + # + # require "google/cloud/retail/v2/model_service/rest" + # client = ::Google::Cloud::Retail::V2::ModelService::Rest::Client.new + # + module ModelService + # Client for the REST transport + module Rest + end + end + end + end + end +end + +helper_path = ::File.join __dir__, "rest", "helpers.rb" +require "google/cloud/retail/v2/model_service/rest/helpers" if ::File.file? helper_path diff --git a/owl-bot-staging/google-cloud-retail-v2/lib/google/cloud/retail/v2/model_service/rest/client.rb b/owl-bot-staging/google-cloud-retail-v2/lib/google/cloud/retail/v2/model_service/rest/client.rb new file mode 100644 index 000000000000..71a202fe4e3d --- /dev/null +++ b/owl-bot-staging/google-cloud-retail-v2/lib/google/cloud/retail/v2/model_service/rest/client.rb @@ -0,0 +1,1120 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +require "google/cloud/errors" +require "google/cloud/retail/v2/model_service_pb" +require "google/cloud/retail/v2/model_service/rest/service_stub" +require "google/cloud/location/rest" + +module Google + module Cloud + module Retail + module V2 + module ModelService + module Rest + ## + # REST client for the ModelService service. + # + # Service for performing CRUD operations on models. + # Recommendation models contain all the metadata necessary to generate a set of + # models for the `Predict()` API. A model is queried + # indirectly via a ServingConfig, which associates a model with a + # given Placement (e.g. Frequently Bought Together on Home Page). + # + # This service allows you to do the following: + # + # * Initiate training of a model. + # * Pause training of an existing model. + # * List all the available models along with their metadata. + # * Control their tuning schedule. + # + class Client + # @private + API_VERSION = "" + + # @private + DEFAULT_ENDPOINT_TEMPLATE = "retail.$UNIVERSE_DOMAIN$" + + include Paths + + # @private + attr_reader :model_service_stub + + ## + # Configure the ModelService Client class. + # + # See {::Google::Cloud::Retail::V2::ModelService::Rest::Client::Configuration} + # for a description of the configuration fields. + # + # @example + # + # # Modify the configuration for all ModelService clients + # ::Google::Cloud::Retail::V2::ModelService::Rest::Client.configure do |config| + # config.timeout = 10.0 + # end + # + # @yield [config] Configure the Client client. + # @yieldparam config [Client::Configuration] + # + # @return [Client::Configuration] + # + def self.configure + @configure ||= begin + namespace = ["Google", "Cloud", "Retail", "V2"] + parent_config = while namespace.any? + parent_name = namespace.join "::" + parent_const = const_get parent_name + break parent_const.configure if parent_const.respond_to? :configure + namespace.pop + end + default_config = Client::Configuration.new parent_config + + default_config.timeout = 60.0 + default_config.retry_policy = { + initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [14, 4] + } + + default_config + end + yield @configure if block_given? + @configure + end + + ## + # Configure the ModelService Client instance. + # + # The configuration is set to the derived mode, meaning that values can be changed, + # but structural changes (adding new fields, etc.) are not allowed. Structural changes + # should be made on {Client.configure}. + # + # See {::Google::Cloud::Retail::V2::ModelService::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 + @model_service_stub.universe_domain + end + + ## + # Create a new ModelService REST client object. + # + # @example + # + # # Create a client using the default configuration + # client = ::Google::Cloud::Retail::V2::ModelService::Rest::Client.new + # + # # Create a client using a custom configuration + # client = ::Google::Cloud::Retail::V2::ModelService::Rest::Client.new do |config| + # config.timeout = 10.0 + # end + # + # @yield [config] Configure the ModelService client. + # @yieldparam config [Client::Configuration] + # + def initialize + # Create the configuration object + @config = Configuration.new Client.configure + + # Yield the configuration if needed + yield @config if block_given? + + # Create credentials + credentials = @config.credentials + # Use self-signed JWT if the endpoint is unchanged from default, + # but only if the default endpoint does not have a region prefix. + enable_self_signed_jwt = @config.endpoint.nil? || + (@config.endpoint == Configuration::DEFAULT_ENDPOINT && + !@config.endpoint.split(".").first.include?("-")) + credentials ||= Credentials.default scope: @config.scope, + enable_self_signed_jwt: enable_self_signed_jwt + if credentials.is_a?(::String) || credentials.is_a?(::Hash) + credentials = Credentials.new credentials, scope: @config.scope + end + + @quota_project_id = @config.quota_project + @quota_project_id ||= credentials.quota_project_id if credentials.respond_to? :quota_project_id + + @operations_client = ::Google::Cloud::Retail::V2::ModelService::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 + + @model_service_stub = ::Google::Cloud::Retail::V2::ModelService::Rest::ServiceStub.new( + endpoint: @config.endpoint, + endpoint_template: DEFAULT_ENDPOINT_TEMPLATE, + universe_domain: @config.universe_domain, + credentials: credentials, + logger: @config.logger + ) + + @model_service_stub.logger(stub: true)&.info do |entry| + entry.set_system_name + entry.set_service + entry.message = "Created client for #{entry.service}" + entry.set_credentials_fields credentials + entry.set "customEndpoint", @config.endpoint if @config.endpoint + entry.set "defaultTimeout", @config.timeout if @config.timeout + entry.set "quotaProject", @quota_project_id if @quota_project_id + end + + @location_client = Google::Cloud::Location::Locations::Rest::Client.new do |config| + config.credentials = credentials + config.quota_project = @quota_project_id + config.endpoint = @model_service_stub.endpoint + config.universe_domain = @model_service_stub.universe_domain + config.logger = @model_service_stub.logger if config.respond_to? :logger= + end + end + + ## + # Get the associated client for long-running operations. + # + # @return [::Google::Cloud::Retail::V2::ModelService::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 + @model_service_stub.logger + end + + # Service calls + + ## + # Creates a new model. + # + # @overload create_model(request, options = nil) + # Pass arguments to `create_model` via a request object, either of type + # {::Google::Cloud::Retail::V2::CreateModelRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Retail::V2::CreateModelRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_model(parent: nil, model: nil, dry_run: nil) + # Pass arguments to `create_model` via keyword arguments. Note that at + # least one keyword argument is 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 under which to create the model. Format: + # `projects/{project_number}/locations/{location_id}/catalogs/{catalog_id}` + # @param model [::Google::Cloud::Retail::V2::Model, ::Hash] + # Required. The payload of the {::Google::Cloud::Retail::V2::Model Model} to + # create. + # @param dry_run [::Boolean] + # Optional. Whether to run a dry run to validate the request (without + # actually creating the model). + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Gapic::Operation] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Gapic::Operation] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/retail/v2" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Retail::V2::ModelService::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Retail::V2::CreateModelRequest.new + # + # # Call the create_model method. + # result = client.create_model 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_model request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Retail::V2::CreateModelRequest + + # Converts hash 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_model.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::Retail::V2::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + options.apply_defaults timeout: @config.rpcs.create_model.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.create_model.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @model_service_stub.create_model 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 model. + # + # @overload get_model(request, options = nil) + # Pass arguments to `get_model` via a request object, either of type + # {::Google::Cloud::Retail::V2::GetModelRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Retail::V2::GetModelRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_model(name: nil) + # Pass arguments to `get_model` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param name [::String] + # Required. The resource name of the {::Google::Cloud::Retail::V2::Model Model} to + # get. Format: + # `projects/{project_number}/locations/{location_id}/catalogs/{catalog}/models/{model_id}` + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Cloud::Retail::V2::Model] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::Retail::V2::Model] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/retail/v2" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Retail::V2::ModelService::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Retail::V2::GetModelRequest.new + # + # # Call the get_model method. + # result = client.get_model request + # + # # The returned object is of type Google::Cloud::Retail::V2::Model. + # p result + # + def get_model request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Retail::V2::GetModelRequest + + # Converts hash 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_model.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::Retail::V2::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + options.apply_defaults timeout: @config.rpcs.get_model.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.get_model.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @model_service_stub.get_model 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 + + ## + # Pauses the training of an existing model. + # + # @overload pause_model(request, options = nil) + # Pass arguments to `pause_model` via a request object, either of type + # {::Google::Cloud::Retail::V2::PauseModelRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Retail::V2::PauseModelRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @overload pause_model(name: nil) + # Pass arguments to `pause_model` via keyword arguments. Note that at + # least one keyword argument is 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 model to pause. + # Format: + # `projects/{project_number}/locations/{location_id}/catalogs/{catalog_id}/models/{model_id}` + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Cloud::Retail::V2::Model] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::Retail::V2::Model] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/retail/v2" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Retail::V2::ModelService::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Retail::V2::PauseModelRequest.new + # + # # Call the pause_model method. + # result = client.pause_model request + # + # # The returned object is of type Google::Cloud::Retail::V2::Model. + # p result + # + def pause_model request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Retail::V2::PauseModelRequest + + # Converts hash 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.pause_model.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::Retail::V2::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + options.apply_defaults timeout: @config.rpcs.pause_model.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.pause_model.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @model_service_stub.pause_model 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 + + ## + # Resumes the training of an existing model. + # + # @overload resume_model(request, options = nil) + # Pass arguments to `resume_model` via a request object, either of type + # {::Google::Cloud::Retail::V2::ResumeModelRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Retail::V2::ResumeModelRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @overload resume_model(name: nil) + # Pass arguments to `resume_model` via keyword arguments. Note that at + # least one keyword argument is 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 model to resume. + # Format: + # `projects/{project_number}/locations/{location_id}/catalogs/{catalog_id}/models/{model_id}` + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Cloud::Retail::V2::Model] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::Retail::V2::Model] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/retail/v2" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Retail::V2::ModelService::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Retail::V2::ResumeModelRequest.new + # + # # Call the resume_model method. + # result = client.resume_model request + # + # # The returned object is of type Google::Cloud::Retail::V2::Model. + # p result + # + def resume_model request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Retail::V2::ResumeModelRequest + + # Converts hash 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.resume_model.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::Retail::V2::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + options.apply_defaults timeout: @config.rpcs.resume_model.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.resume_model.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @model_service_stub.resume_model request, options do |result, operation| + yield result, operation if block_given? + end + rescue ::Gapic::Rest::Error => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Deletes an existing model. + # + # @overload delete_model(request, options = nil) + # Pass arguments to `delete_model` via a request object, either of type + # {::Google::Cloud::Retail::V2::DeleteModelRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Retail::V2::DeleteModelRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_model(name: nil) + # Pass arguments to `delete_model` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param name [::String] + # Required. The resource name of the {::Google::Cloud::Retail::V2::Model Model} to + # delete. Format: + # `projects/{project_number}/locations/{location_id}/catalogs/{catalog_id}/models/{model_id}` + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Protobuf::Empty] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Protobuf::Empty] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/retail/v2" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Retail::V2::ModelService::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Retail::V2::DeleteModelRequest.new + # + # # Call the delete_model method. + # result = client.delete_model request + # + # # The returned object is of type Google::Protobuf::Empty. + # p result + # + def delete_model request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Retail::V2::DeleteModelRequest + + # Converts hash 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_model.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::Retail::V2::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + options.apply_defaults timeout: @config.rpcs.delete_model.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.delete_model.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @model_service_stub.delete_model request, options do |result, operation| + yield result, operation if block_given? + end + rescue ::Gapic::Rest::Error => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Lists all the models linked to this event store. + # + # @overload list_models(request, options = nil) + # Pass arguments to `list_models` via a request object, either of type + # {::Google::Cloud::Retail::V2::ListModelsRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Retail::V2::ListModelsRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_models(parent: nil, page_size: nil, page_token: nil) + # Pass arguments to `list_models` via keyword arguments. Note that at + # least one keyword argument is 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 for which to list models. + # Format: + # `projects/{project_number}/locations/{location_id}/catalogs/{catalog_id}` + # @param page_size [::Integer] + # Optional. Maximum number of results to return. If unspecified, defaults + # to 50. Max allowed value is 1000. + # @param page_token [::String] + # Optional. A page token, received from a previous `ListModels` + # call. Provide this to retrieve the subsequent page. + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Gapic::Rest::PagedEnumerable<::Google::Cloud::Retail::V2::Model>] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Gapic::Rest::PagedEnumerable<::Google::Cloud::Retail::V2::Model>] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/retail/v2" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Retail::V2::ModelService::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Retail::V2::ListModelsRequest.new + # + # # Call the list_models method. + # result = client.list_models request + # + # # The returned object is of type Gapic::PagedEnumerable. You can iterate + # # over elements, and API calls will be issued to fetch pages as needed. + # result.each do |item| + # # Each element is of type ::Google::Cloud::Retail::V2::Model. + # p item + # end + # + def list_models request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Retail::V2::ListModelsRequest + + # Converts hash 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_models.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::Retail::V2::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + options.apply_defaults timeout: @config.rpcs.list_models.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.list_models.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @model_service_stub.list_models request, options do |result, operation| + result = ::Gapic::Rest::PagedEnumerable.new @model_service_stub, :list_models, "models", 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 + + ## + # Update of model metadata. Only fields that + # currently can be updated are: `filtering_option` and + # `periodic_tuning_state`. + # If other values are provided, this API method ignores them. + # + # @overload update_model(request, options = nil) + # Pass arguments to `update_model` via a request object, either of type + # {::Google::Cloud::Retail::V2::UpdateModelRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Retail::V2::UpdateModelRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_model(model: nil, update_mask: nil) + # Pass arguments to `update_model` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param model [::Google::Cloud::Retail::V2::Model, ::Hash] + # Required. The body of the updated {::Google::Cloud::Retail::V2::Model Model}. + # @param update_mask [::Google::Protobuf::FieldMask, ::Hash] + # Optional. Indicates which fields in the provided 'model' to + # update. If not set, by default updates all fields. + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Cloud::Retail::V2::Model] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::Retail::V2::Model] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/retail/v2" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Retail::V2::ModelService::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Retail::V2::UpdateModelRequest.new + # + # # Call the update_model method. + # result = client.update_model request + # + # # The returned object is of type Google::Cloud::Retail::V2::Model. + # p result + # + def update_model request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Retail::V2::UpdateModelRequest + + # Converts hash 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_model.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::Retail::V2::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + options.apply_defaults timeout: @config.rpcs.update_model.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.update_model.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @model_service_stub.update_model 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 + + ## + # Tunes an existing model. + # + # @overload tune_model(request, options = nil) + # Pass arguments to `tune_model` via a request object, either of type + # {::Google::Cloud::Retail::V2::TuneModelRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Retail::V2::TuneModelRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @overload tune_model(name: nil) + # Pass arguments to `tune_model` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param name [::String] + # Required. The resource name of the model to tune. + # Format: + # `projects/{project_number}/locations/{location_id}/catalogs/{catalog_id}/models/{model_id}` + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Gapic::Operation] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Gapic::Operation] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/retail/v2" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Retail::V2::ModelService::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Retail::V2::TuneModelRequest.new + # + # # Call the tune_model method. + # result = client.tune_model 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 tune_model request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Retail::V2::TuneModelRequest + + # Converts hash 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.tune_model.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::Retail::V2::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + options.apply_defaults timeout: @config.rpcs.tune_model.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.tune_model.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @model_service_stub.tune_model 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 + + ## + # Configuration class for the ModelService REST API. + # + # This class represents the configuration for ModelService REST, + # providing control over timeouts, retry behavior, logging, transport + # parameters, and other low-level controls. Certain parameters can also be + # applied individually to specific RPCs. See + # {::Google::Cloud::Retail::V2::ModelService::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_model to 20 seconds, + # # and all remaining timeouts to 10 seconds. + # ::Google::Cloud::Retail::V2::ModelService::Rest::Client.configure do |config| + # config.timeout = 10.0 + # config.rpcs.create_model.timeout = 20.0 + # end + # + # # Apply the above configuration only to a new client. + # client = ::Google::Cloud::Retail::V2::ModelService::Rest::Client.new do |config| + # config.timeout = 10.0 + # config.rpcs.create_model.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 = "retail.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 ModelService 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_model` + # @return [::Gapic::Config::Method] + # + attr_reader :create_model + ## + # RPC-specific configuration for `get_model` + # @return [::Gapic::Config::Method] + # + attr_reader :get_model + ## + # RPC-specific configuration for `pause_model` + # @return [::Gapic::Config::Method] + # + attr_reader :pause_model + ## + # RPC-specific configuration for `resume_model` + # @return [::Gapic::Config::Method] + # + attr_reader :resume_model + ## + # RPC-specific configuration for `delete_model` + # @return [::Gapic::Config::Method] + # + attr_reader :delete_model + ## + # RPC-specific configuration for `list_models` + # @return [::Gapic::Config::Method] + # + attr_reader :list_models + ## + # RPC-specific configuration for `update_model` + # @return [::Gapic::Config::Method] + # + attr_reader :update_model + ## + # RPC-specific configuration for `tune_model` + # @return [::Gapic::Config::Method] + # + attr_reader :tune_model + + # @private + def initialize parent_rpcs = nil + create_model_config = parent_rpcs.create_model if parent_rpcs.respond_to? :create_model + @create_model = ::Gapic::Config::Method.new create_model_config + get_model_config = parent_rpcs.get_model if parent_rpcs.respond_to? :get_model + @get_model = ::Gapic::Config::Method.new get_model_config + pause_model_config = parent_rpcs.pause_model if parent_rpcs.respond_to? :pause_model + @pause_model = ::Gapic::Config::Method.new pause_model_config + resume_model_config = parent_rpcs.resume_model if parent_rpcs.respond_to? :resume_model + @resume_model = ::Gapic::Config::Method.new resume_model_config + delete_model_config = parent_rpcs.delete_model if parent_rpcs.respond_to? :delete_model + @delete_model = ::Gapic::Config::Method.new delete_model_config + list_models_config = parent_rpcs.list_models if parent_rpcs.respond_to? :list_models + @list_models = ::Gapic::Config::Method.new list_models_config + update_model_config = parent_rpcs.update_model if parent_rpcs.respond_to? :update_model + @update_model = ::Gapic::Config::Method.new update_model_config + tune_model_config = parent_rpcs.tune_model if parent_rpcs.respond_to? :tune_model + @tune_model = ::Gapic::Config::Method.new tune_model_config + + yield self if block_given? + end + end + end + end + end + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-retail-v2/lib/google/cloud/retail/v2/model_service/rest/operations.rb b/owl-bot-staging/google-cloud-retail-v2/lib/google/cloud/retail/v2/model_service/rest/operations.rb new file mode 100644 index 000000000000..466ab095ea82 --- /dev/null +++ b/owl-bot-staging/google-cloud-retail-v2/lib/google/cloud/retail/v2/model_service/rest/operations.rb @@ -0,0 +1,960 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +require "gapic/operation" + +module Google + module Cloud + module Retail + module V2 + module ModelService + module Rest + # Service that implements Longrunning Operations API. + class Operations + # @private + API_VERSION = "" + + # @private + DEFAULT_ENDPOINT_TEMPLATE = "retail.$UNIVERSE_DOMAIN$" + + # @private + attr_reader :operations_stub + + ## + # Configuration for the ModelService 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 ModelService 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::Retail::V2::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + options.apply_defaults timeout: @config.rpcs.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::Retail::V2::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + options.apply_defaults timeout: @config.rpcs.get_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::Retail::V2::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + options.apply_defaults timeout: @config.rpcs.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::Retail::V2::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + options.apply_defaults timeout: @config.rpcs.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 = "retail.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: "/v2/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v2/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/catalogs/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v2/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/?$}, 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: "/v2/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v2/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/catalogs/[^/]+/branches/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v2/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/catalogs/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v2/{name}", + matches: [ + ["name", %r{^projects/[^/]+/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 +end diff --git a/owl-bot-staging/google-cloud-retail-v2/lib/google/cloud/retail/v2/model_service/rest/service_stub.rb b/owl-bot-staging/google-cloud-retail-v2/lib/google/cloud/retail/v2/model_service/rest/service_stub.rb new file mode 100644 index 000000000000..fec1a150075d --- /dev/null +++ b/owl-bot-staging/google-cloud-retail-v2/lib/google/cloud/retail/v2/model_service/rest/service_stub.rb @@ -0,0 +1,574 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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/retail/v2/model_service_pb" + +module Google + module Cloud + module Retail + module V2 + module ModelService + module Rest + ## + # REST service stub for the ModelService 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_model REST call + # + # @param request_pb [::Google::Cloud::Retail::V2::CreateModelRequest] + # 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_model request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_create_model_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_model", + 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_model REST call + # + # @param request_pb [::Google::Cloud::Retail::V2::GetModelRequest] + # A request object representing the call parameters. Required. + # @param options [::Gapic::CallOptions] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Cloud::Retail::V2::Model] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::Retail::V2::Model] + # A result object deserialized from the server's reply + def get_model request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_get_model_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_model", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Cloud::Retail::V2::Model.decode_json response.body, ignore_unknown_fields: true + catch :response do + yield result, operation if block_given? + result + end + end + + ## + # Baseline implementation for the pause_model REST call + # + # @param request_pb [::Google::Cloud::Retail::V2::PauseModelRequest] + # A request object representing the call parameters. Required. + # @param options [::Gapic::CallOptions] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Cloud::Retail::V2::Model] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::Retail::V2::Model] + # A result object deserialized from the server's reply + def pause_model request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_pause_model_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: "pause_model", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Cloud::Retail::V2::Model.decode_json response.body, ignore_unknown_fields: true + catch :response do + yield result, operation if block_given? + result + end + end + + ## + # Baseline implementation for the resume_model REST call + # + # @param request_pb [::Google::Cloud::Retail::V2::ResumeModelRequest] + # A request object representing the call parameters. Required. + # @param options [::Gapic::CallOptions] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Cloud::Retail::V2::Model] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::Retail::V2::Model] + # A result object deserialized from the server's reply + def resume_model request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_resume_model_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: "resume_model", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Cloud::Retail::V2::Model.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_model REST call + # + # @param request_pb [::Google::Cloud::Retail::V2::DeleteModelRequest] + # 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_model request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_delete_model_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_model", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Protobuf::Empty.decode_json response.body, ignore_unknown_fields: true + catch :response do + yield result, operation if block_given? + result + end + end + + ## + # Baseline implementation for the list_models REST call + # + # @param request_pb [::Google::Cloud::Retail::V2::ListModelsRequest] + # A request object representing the call parameters. Required. + # @param options [::Gapic::CallOptions] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Cloud::Retail::V2::ListModelsResponse] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::Retail::V2::ListModelsResponse] + # A result object deserialized from the server's reply + def list_models request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_list_models_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_models", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Cloud::Retail::V2::ListModelsResponse.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_model REST call + # + # @param request_pb [::Google::Cloud::Retail::V2::UpdateModelRequest] + # A request object representing the call parameters. Required. + # @param options [::Gapic::CallOptions] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Cloud::Retail::V2::Model] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::Retail::V2::Model] + # A result object deserialized from the server's reply + def update_model request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_update_model_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_model", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Cloud::Retail::V2::Model.decode_json response.body, ignore_unknown_fields: true + catch :response do + yield result, operation if block_given? + result + end + end + + ## + # Baseline implementation for the tune_model REST call + # + # @param request_pb [::Google::Cloud::Retail::V2::TuneModelRequest] + # 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 tune_model request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_tune_model_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: "tune_model", + 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 + + ## + # @private + # + # GRPC transcoding helper method for the create_model REST call + # + # @param request_pb [::Google::Cloud::Retail::V2::CreateModelRequest] + # 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_model_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :post, + uri_template: "/v2/{parent}/models", + body: "model", + matches: [ + ["parent", %r{^projects/[^/]+/locations/[^/]+/catalogs/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the get_model REST call + # + # @param request_pb [::Google::Cloud::Retail::V2::GetModelRequest] + # 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_model_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :get, + uri_template: "/v2/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/catalogs/[^/]+/models/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the pause_model REST call + # + # @param request_pb [::Google::Cloud::Retail::V2::PauseModelRequest] + # A request object representing the call parameters. Required. + # @return [Array(String, [String, nil], Hash{String => String})] + # Uri, Body, Query string parameters + def self.transcode_pause_model_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :post, + uri_template: "/v2/{name}:pause", + body: "*", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/catalogs/[^/]+/models/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the resume_model REST call + # + # @param request_pb [::Google::Cloud::Retail::V2::ResumeModelRequest] + # A request object representing the call parameters. Required. + # @return [Array(String, [String, nil], Hash{String => String})] + # Uri, Body, Query string parameters + def self.transcode_resume_model_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :post, + uri_template: "/v2/{name}:resume", + body: "*", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/catalogs/[^/]+/models/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the delete_model REST call + # + # @param request_pb [::Google::Cloud::Retail::V2::DeleteModelRequest] + # 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_model_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :delete, + uri_template: "/v2/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/catalogs/[^/]+/models/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the list_models REST call + # + # @param request_pb [::Google::Cloud::Retail::V2::ListModelsRequest] + # 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_models_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :get, + uri_template: "/v2/{parent}/models", + matches: [ + ["parent", %r{^projects/[^/]+/locations/[^/]+/catalogs/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the update_model REST call + # + # @param request_pb [::Google::Cloud::Retail::V2::UpdateModelRequest] + # 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_model_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :patch, + uri_template: "/v2/{model.name}", + body: "model", + matches: [ + ["model.name", %r{^projects/[^/]+/locations/[^/]+/catalogs/[^/]+/models/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the tune_model REST call + # + # @param request_pb [::Google::Cloud::Retail::V2::TuneModelRequest] + # A request object representing the call parameters. Required. + # @return [Array(String, [String, nil], Hash{String => String})] + # Uri, Body, Query string parameters + def self.transcode_tune_model_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :post, + uri_template: "/v2/{name}:tune", + body: "*", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/catalogs/[^/]+/models/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + end + end + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-retail-v2/lib/google/cloud/retail/v2/model_service_pb.rb b/owl-bot-staging/google-cloud-retail-v2/lib/google/cloud/retail/v2/model_service_pb.rb new file mode 100644 index 000000000000..5b5f20690bb3 --- /dev/null +++ b/owl-bot-staging/google-cloud-retail-v2/lib/google/cloud/retail/v2/model_service_pb.rb @@ -0,0 +1,41 @@ +# frozen_string_literal: true +# Generated by the protocol buffer compiler. DO NOT EDIT! +# source: google/cloud/retail/v2/model_service.proto + +require 'google/protobuf' + +require 'google/api/annotations_pb' +require 'google/api/client_pb' +require 'google/api/field_behavior_pb' +require 'google/api/resource_pb' +require 'google/cloud/retail/v2/model_pb' +require 'google/longrunning/operations_pb' +require 'google/protobuf/empty_pb' +require 'google/protobuf/field_mask_pb' + + +descriptor_data = "\n*google/cloud/retail/v2/model_service.proto\x12\x16google.cloud.retail.v2\x1a\x1cgoogle/api/annotations.proto\x1a\x17google/api/client.proto\x1a\x1fgoogle/api/field_behavior.proto\x1a\x19google/api/resource.proto\x1a\"google/cloud/retail/v2/model.proto\x1a#google/longrunning/operations.proto\x1a\x1bgoogle/protobuf/empty.proto\x1a google/protobuf/field_mask.proto\"\x94\x01\n\x12\x43reateModelRequest\x12\x35\n\x06parent\x18\x01 \x01(\tB%\xe0\x41\x02\xfa\x41\x1f\n\x1dretail.googleapis.com/Catalog\x12\x31\n\x05model\x18\x02 \x01(\x0b\x32\x1d.google.cloud.retail.v2.ModelB\x03\xe0\x41\x02\x12\x14\n\x07\x64ry_run\x18\x03 \x01(\x08\x42\x03\xe0\x41\x01\"}\n\x12UpdateModelRequest\x12\x31\n\x05model\x18\x01 \x01(\x0b\x32\x1d.google.cloud.retail.v2.ModelB\x03\xe0\x41\x02\x12\x34\n\x0bupdate_mask\x18\x02 \x01(\x0b\x32\x1a.google.protobuf.FieldMaskB\x03\xe0\x41\x01\"D\n\x0fGetModelRequest\x12\x31\n\x04name\x18\x01 \x01(\tB#\xe0\x41\x02\xfa\x41\x1d\n\x1bretail.googleapis.com/Model\"F\n\x11PauseModelRequest\x12\x31\n\x04name\x18\x01 \x01(\tB#\xe0\x41\x02\xfa\x41\x1d\n\x1bretail.googleapis.com/Model\"\'\n\x12ResumeModelRequest\x12\x11\n\x04name\x18\x01 \x01(\tB\x03\xe0\x41\x02\"{\n\x11ListModelsRequest\x12\x35\n\x06parent\x18\x01 \x01(\tB%\xe0\x41\x02\xfa\x41\x1f\n\x1dretail.googleapis.com/Catalog\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\"G\n\x12\x44\x65leteModelRequest\x12\x31\n\x04name\x18\x01 \x01(\tB#\xe0\x41\x02\xfa\x41\x1d\n\x1bretail.googleapis.com/Model\"\\\n\x12ListModelsResponse\x12-\n\x06models\x18\x01 \x03(\x0b\x32\x1d.google.cloud.retail.v2.Model\x12\x17\n\x0fnext_page_token\x18\x02 \x01(\t\"E\n\x10TuneModelRequest\x12\x31\n\x04name\x18\x01 \x01(\tB#\xe0\x41\x02\xfa\x41\x1d\n\x1bretail.googleapis.com/Model\"$\n\x13\x43reateModelMetadata\x12\r\n\x05model\x18\x01 \x01(\t\"\"\n\x11TuneModelMetadata\x12\r\n\x05model\x18\x01 \x01(\t\"\x13\n\x11TuneModelResponse2\xc5\x0c\n\x0cModelService\x12\xfb\x01\n\x0b\x43reateModel\x12*.google.cloud.retail.v2.CreateModelRequest\x1a\x1d.google.longrunning.Operation\"\xa0\x01\xca\x41J\n\x1cgoogle.cloud.retail.v2.Model\x12*google.cloud.retail.v2.CreateModelMetadata\xda\x41\x0cparent,model\x82\xd3\xe4\x93\x02>\"5/v2/{parent=projects/*/locations/*/catalogs/*}/models:\x05model\x12\x98\x01\n\x08GetModel\x12\'.google.cloud.retail.v2.GetModelRequest\x1a\x1d.google.cloud.retail.v2.Model\"D\xda\x41\x04name\x82\xd3\xe4\x93\x02\x37\x12\x35/v2/{name=projects/*/locations/*/catalogs/*/models/*}\x12\xa5\x01\n\nPauseModel\x12).google.cloud.retail.v2.PauseModelRequest\x1a\x1d.google.cloud.retail.v2.Model\"M\xda\x41\x04name\x82\xd3\xe4\x93\x02@\";/v2/{name=projects/*/locations/*/catalogs/*/models/*}:pause:\x01*\x12\xa8\x01\n\x0bResumeModel\x12*.google.cloud.retail.v2.ResumeModelRequest\x1a\x1d.google.cloud.retail.v2.Model\"N\xda\x41\x04name\x82\xd3\xe4\x93\x02\x41\" ::Google::Protobuf::Value, ::Hash}] + # Additional domain specific parameters for the predictions. + # + # Allowed values: + # + # * `returnProduct`: Boolean. If set to true, the associated product + # object will be returned in the `results.metadata` field in the + # prediction response. + # * `returnScore`: Boolean. If set to true, the prediction 'score' + # corresponding to each returned product will be set in the + # `results.metadata` field in the prediction response. The given + # 'score' indicates the probability of a product being clicked/purchased + # given the user's context and history. + # * `strictFiltering`: Boolean. True by default. If set to false, the service + # will return generic (unfiltered) popular products instead of empty if + # your filter blocks all prediction results. + # * `priceRerankLevel`: String. Default empty. If set to be non-empty, then + # it needs to be one of {'no-price-reranking', 'low-price-reranking', + # 'medium-price-reranking', 'high-price-reranking'}. This gives + # request-level control and adjusts prediction results based on product + # price. + # * `diversityLevel`: String. Default empty. If set to be non-empty, then + # it needs to be one of {'no-diversity', 'low-diversity', + # 'medium-diversity', 'high-diversity', 'auto-diversity'}. This gives + # request-level control and adjusts prediction results based on product + # category. + # * `filterSyntaxV2`: Boolean. False by default. If set to true, the `filter` + # field is interpreteted according to the new, attribute-based syntax. + # @param labels [::Hash{::String => ::String}] + # The labels applied to a resource must meet the following requirements: + # + # * Each resource can have multiple labels, up to a maximum of 64. + # * Each label must be a key-value pair. + # * Keys have a minimum length of 1 character and a maximum length of 63 + # characters and cannot be empty. Values can be empty and have a maximum + # length of 63 characters. + # * Keys and values can contain only lowercase letters, numeric characters, + # underscores, and dashes. All characters must use UTF-8 encoding, and + # international characters are allowed. + # * The key portion of a label must be unique. However, you can use the same + # key with multiple resources. + # * Keys must start with a lowercase letter or international character. + # + # See [Google Cloud + # Document](https://cloud.google.com/resource-manager/docs/creating-managing-labels#requirements) + # for more details. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Google::Cloud::Retail::V2::PredictResponse] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Google::Cloud::Retail::V2::PredictResponse] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/retail/v2" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Retail::V2::PredictionService::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Retail::V2::PredictRequest.new + # + # # Call the predict method. + # result = client.predict request + # + # # The returned object is of type Google::Cloud::Retail::V2::PredictResponse. + # p result + # + def predict request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Retail::V2::PredictRequest + + # Converts hash 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.predict.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::Retail::V2::VERSION + metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.placement + header_params["placement"] = request.placement + 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.predict.timeout, + metadata: metadata, + retry_policy: @config.rpcs.predict.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @prediction_service_stub.call_rpc :predict, request, options: options do |response, operation| + yield response, operation if block_given? + end + rescue ::GRPC::BadStatus => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Configuration class for the PredictionService API. + # + # This class represents the configuration for PredictionService, + # providing control over timeouts, retry behavior, logging, transport + # parameters, and other low-level controls. Certain parameters can also be + # applied individually to specific RPCs. See + # {::Google::Cloud::Retail::V2::PredictionService::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 + # # predict to 20 seconds, + # # and all remaining timeouts to 10 seconds. + # ::Google::Cloud::Retail::V2::PredictionService::Client.configure do |config| + # config.timeout = 10.0 + # config.rpcs.predict.timeout = 20.0 + # end + # + # # Apply the above configuration only to a new client. + # client = ::Google::Cloud::Retail::V2::PredictionService::Client.new do |config| + # config.timeout = 10.0 + # config.rpcs.predict.timeout = 20.0 + # end + # + # @!attribute [rw] endpoint + # A custom service endpoint, as a hostname or hostname:port. The default is + # nil, indicating to use the default endpoint in the current universe domain. + # @return [::String,nil] + # @!attribute [rw] credentials + # Credentials to send with calls. You may provide any of the following types: + # * (`Google::Auth::Credentials`) A googleauth credentials object + # (see the [googleauth docs](https://rubydoc.info/gems/googleauth/Google/Auth/Credentials)) + # * (`Signet::OAuth2::Client`) A signet oauth2 client object + # (see the [signet docs](https://rubydoc.info/gems/signet/Signet/OAuth2/Client)) + # * (`GRPC::Core::Channel`) a gRPC channel with included credentials + # * (`GRPC::Core::ChannelCredentials`) a gRPC credentails object + # * (`nil`) indicating no credentials + # + # @note Warning: Passing a `String` to a keyfile path or a `Hash` of credentials + # is deprecated. Providing an unvalidated credential configuration to + # Google APIs can compromise the security of your systems and data. + # + # @example + # + # # The recommended way to provide credentials is to use the `make_creds` method + # # on the appropriate credentials class for your environment. + # + # require "googleauth" + # + # credentials = ::Google::Auth::ServiceAccountCredentials.make_creds( + # json_key_io: ::File.open("/path/to/keyfile.json") + # ) + # + # client = ::Google::Cloud::Retail::V2::PredictionService::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 = "retail.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 PredictionService 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 `predict` + # @return [::Gapic::Config::Method] + # + attr_reader :predict + + # @private + def initialize parent_rpcs = nil + predict_config = parent_rpcs.predict if parent_rpcs.respond_to? :predict + @predict = ::Gapic::Config::Method.new predict_config + + yield self if block_given? + end + end + end + end + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-retail-v2/lib/google/cloud/retail/v2/prediction_service/credentials.rb b/owl-bot-staging/google-cloud-retail-v2/lib/google/cloud/retail/v2/prediction_service/credentials.rb new file mode 100644 index 000000000000..1da276c819f4 --- /dev/null +++ b/owl-bot-staging/google-cloud-retail-v2/lib/google/cloud/retail/v2/prediction_service/credentials.rb @@ -0,0 +1,51 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +require "googleauth" + +module Google + module Cloud + module Retail + module V2 + module PredictionService + # Credentials for the PredictionService API. + class Credentials < ::Google::Auth::Credentials + self.scope = [ + "https://www.googleapis.com/auth/cloud-platform" + ] + self.env_vars = [ + "RETAIL_CREDENTIALS", + "RETAIL_KEYFILE", + "GOOGLE_CLOUD_CREDENTIALS", + "GOOGLE_CLOUD_KEYFILE", + "GCLOUD_KEYFILE", + "RETAIL_CREDENTIALS_JSON", + "RETAIL_KEYFILE_JSON", + "GOOGLE_CLOUD_CREDENTIALS_JSON", + "GOOGLE_CLOUD_KEYFILE_JSON", + "GCLOUD_KEYFILE_JSON" + ] + self.paths = [ + "~/.config/google_cloud/application_default_credentials.json" + ] + end + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-retail-v2/lib/google/cloud/retail/v2/prediction_service/paths.rb b/owl-bot-staging/google-cloud-retail-v2/lib/google/cloud/retail/v2/prediction_service/paths.rb new file mode 100644 index 000000000000..26277b36936a --- /dev/null +++ b/owl-bot-staging/google-cloud-retail-v2/lib/google/cloud/retail/v2/prediction_service/paths.rb @@ -0,0 +1,56 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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 Retail + module V2 + module PredictionService + # Path helper methods for the PredictionService API. + module Paths + ## + # Create a fully-qualified Product resource string. + # + # The resource will be in the following format: + # + # `projects/{project}/locations/{location}/catalogs/{catalog}/branches/{branch}/products/{product}` + # + # @param project [String] + # @param location [String] + # @param catalog [String] + # @param branch [String] + # @param product [String] + # + # @return [::String] + def product_path project:, location:, catalog:, branch:, product: + raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" + raise ::ArgumentError, "location cannot contain /" if location.to_s.include? "/" + raise ::ArgumentError, "catalog cannot contain /" if catalog.to_s.include? "/" + raise ::ArgumentError, "branch cannot contain /" if branch.to_s.include? "/" + + "projects/#{project}/locations/#{location}/catalogs/#{catalog}/branches/#{branch}/products/#{product}" + end + + extend self + end + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-retail-v2/lib/google/cloud/retail/v2/prediction_service/rest.rb b/owl-bot-staging/google-cloud-retail-v2/lib/google/cloud/retail/v2/prediction_service/rest.rb new file mode 100644 index 000000000000..351e68db6577 --- /dev/null +++ b/owl-bot-staging/google-cloud-retail-v2/lib/google/cloud/retail/v2/prediction_service/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/retail/v2/version" + +require "google/cloud/retail/v2/prediction_service/credentials" +require "google/cloud/retail/v2/prediction_service/paths" +require "google/cloud/retail/v2/prediction_service/rest/client" + +module Google + module Cloud + module Retail + module V2 + ## + # Service for making recommendation prediction. + # + # To load this service and instantiate a REST client: + # + # require "google/cloud/retail/v2/prediction_service/rest" + # client = ::Google::Cloud::Retail::V2::PredictionService::Rest::Client.new + # + module PredictionService + # Client for the REST transport + module Rest + end + end + end + end + end +end + +helper_path = ::File.join __dir__, "rest", "helpers.rb" +require "google/cloud/retail/v2/prediction_service/rest/helpers" if ::File.file? helper_path diff --git a/owl-bot-staging/google-cloud-retail-v2/lib/google/cloud/retail/v2/prediction_service/rest/client.rb b/owl-bot-staging/google-cloud-retail-v2/lib/google/cloud/retail/v2/prediction_service/rest/client.rb new file mode 100644 index 000000000000..d4a6255d51bc --- /dev/null +++ b/owl-bot-staging/google-cloud-retail-v2/lib/google/cloud/retail/v2/prediction_service/rest/client.rb @@ -0,0 +1,571 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +require "google/cloud/errors" +require "google/cloud/retail/v2/prediction_service_pb" +require "google/cloud/retail/v2/prediction_service/rest/service_stub" +require "google/cloud/location/rest" + +module Google + module Cloud + module Retail + module V2 + module PredictionService + module Rest + ## + # REST client for the PredictionService service. + # + # Service for making recommendation prediction. + # + class Client + # @private + API_VERSION = "" + + # @private + DEFAULT_ENDPOINT_TEMPLATE = "retail.$UNIVERSE_DOMAIN$" + + include Paths + + # @private + attr_reader :prediction_service_stub + + ## + # Configure the PredictionService Client class. + # + # See {::Google::Cloud::Retail::V2::PredictionService::Rest::Client::Configuration} + # for a description of the configuration fields. + # + # @example + # + # # Modify the configuration for all PredictionService clients + # ::Google::Cloud::Retail::V2::PredictionService::Rest::Client.configure do |config| + # config.timeout = 10.0 + # end + # + # @yield [config] Configure the Client client. + # @yieldparam config [Client::Configuration] + # + # @return [Client::Configuration] + # + def self.configure + @configure ||= begin + namespace = ["Google", "Cloud", "Retail", "V2"] + parent_config = while namespace.any? + parent_name = namespace.join "::" + parent_const = const_get parent_name + break parent_const.configure if parent_const.respond_to? :configure + namespace.pop + end + default_config = Client::Configuration.new parent_config + + default_config.timeout = 5.0 + default_config.retry_policy = { + initial_delay: 0.1, max_delay: 5.0, multiplier: 1.3, retry_codes: [14, 4] + } + + default_config + end + yield @configure if block_given? + @configure + end + + ## + # Configure the PredictionService Client instance. + # + # The configuration is set to the derived mode, meaning that values can be changed, + # but structural changes (adding new fields, etc.) are not allowed. Structural changes + # should be made on {Client.configure}. + # + # See {::Google::Cloud::Retail::V2::PredictionService::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 + @prediction_service_stub.universe_domain + end + + ## + # Create a new PredictionService REST client object. + # + # @example + # + # # Create a client using the default configuration + # client = ::Google::Cloud::Retail::V2::PredictionService::Rest::Client.new + # + # # Create a client using a custom configuration + # client = ::Google::Cloud::Retail::V2::PredictionService::Rest::Client.new do |config| + # config.timeout = 10.0 + # end + # + # @yield [config] Configure the PredictionService 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 + + @prediction_service_stub = ::Google::Cloud::Retail::V2::PredictionService::Rest::ServiceStub.new( + endpoint: @config.endpoint, + endpoint_template: DEFAULT_ENDPOINT_TEMPLATE, + universe_domain: @config.universe_domain, + credentials: credentials, + logger: @config.logger + ) + + @prediction_service_stub.logger(stub: true)&.info do |entry| + entry.set_system_name + entry.set_service + entry.message = "Created client for #{entry.service}" + entry.set_credentials_fields credentials + entry.set "customEndpoint", @config.endpoint if @config.endpoint + entry.set "defaultTimeout", @config.timeout if @config.timeout + entry.set "quotaProject", @quota_project_id if @quota_project_id + end + + @location_client = Google::Cloud::Location::Locations::Rest::Client.new do |config| + config.credentials = credentials + config.quota_project = @quota_project_id + config.endpoint = @prediction_service_stub.endpoint + config.universe_domain = @prediction_service_stub.universe_domain + config.logger = @prediction_service_stub.logger if config.respond_to? :logger= + end + end + + ## + # Get the associated client for mix-in of the Locations. + # + # @return [Google::Cloud::Location::Locations::Rest::Client] + # + attr_reader :location_client + + ## + # The logger used for request/response debug logging. + # + # @return [Logger] + # + def logger + @prediction_service_stub.logger + end + + # Service calls + + ## + # Makes a recommendation prediction. + # + # @overload predict(request, options = nil) + # Pass arguments to `predict` via a request object, either of type + # {::Google::Cloud::Retail::V2::PredictRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Retail::V2::PredictRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @overload predict(placement: nil, user_event: nil, page_size: nil, page_token: nil, filter: nil, validate_only: nil, params: nil, labels: nil) + # Pass arguments to `predict` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param placement [::String] + # Required. Full resource name of the format: + # `{placement=projects/*/locations/global/catalogs/default_catalog/servingConfigs/*}` + # or + # `{placement=projects/*/locations/global/catalogs/default_catalog/placements/*}`. + # We recommend using the `servingConfigs` resource. `placements` is a legacy + # resource. + # The ID of the Recommendations AI serving config or placement. + # Before you can request predictions from your model, you must create at + # least one serving config or placement for it. For more information, see + # [Manage serving configs] + # (https://cloud.google.com/retail/docs/manage-configs). + # + # The full list of available serving configs can be seen at + # https://console.cloud.google.com/ai/retail/catalogs/default_catalog/configs + # @param user_event [::Google::Cloud::Retail::V2::UserEvent, ::Hash] + # Required. Context about the user, what they are looking at and what action + # they took to trigger the predict request. Note that this user event detail + # won't be ingested to userEvent logs. Thus, a separate userEvent write + # request is required for event logging. + # + # Don't set + # {::Google::Cloud::Retail::V2::UserEvent#visitor_id UserEvent.visitor_id} or + # {::Google::Cloud::Retail::V2::UserInfo#user_id UserInfo.user_id} to the same + # fixed ID for different users. If you are trying to receive non-personalized + # recommendations (not recommended; this can negatively impact model + # performance), instead set + # {::Google::Cloud::Retail::V2::UserEvent#visitor_id UserEvent.visitor_id} to a + # random unique ID and leave + # {::Google::Cloud::Retail::V2::UserInfo#user_id UserInfo.user_id} unset. + # @param page_size [::Integer] + # Maximum number of results to return. Set this property to the number of + # prediction results needed. If zero, the service will choose a reasonable + # default. The maximum allowed value is 100. Values above 100 will be coerced + # to 100. + # @param page_token [::String] + # This field is not used; leave it unset. + # @param filter [::String] + # Filter for restricting prediction results with a length limit of 5,000 + # characters. Accepts values for tags and the `filterOutOfStockItems` flag. + # + # * Tag expressions. Restricts predictions to products that match all of the + # specified tags. Boolean operators `OR` and `NOT` are supported if the + # expression is enclosed in parentheses, and must be separated from the + # tag values by a space. `-"tagA"` is also supported and is equivalent to + # `NOT "tagA"`. Tag values must be double quoted UTF-8 encoded strings + # with a size limit of 1,000 characters. + # + # Note: "Recently viewed" models don't support tag filtering at the + # moment. + # + # * filterOutOfStockItems. Restricts predictions to products that do not + # have a + # stockState value of OUT_OF_STOCK. + # + # Examples: + # + # * tag=("Red" OR "Blue") tag="New-Arrival" tag=(NOT "promotional") + # * filterOutOfStockItems tag=(-"promotional") + # * filterOutOfStockItems + # + # If your filter blocks all prediction results, the API will return *no* + # results. If instead you want empty result sets to return generic + # (unfiltered) popular products, set `strictFiltering` to False in + # `PredictRequest.params`. Note that the API will never return items with + # storageStatus of "EXPIRED" or "DELETED" regardless of filter choices. + # + # If `filterSyntaxV2` is set to true under the `params` field, then + # attribute-based expressions are expected instead of the above described + # tag-based syntax. Examples: + # + # * (colors: ANY("Red", "Blue")) AND NOT (categories: ANY("Phones")) + # * (availability: ANY("IN_STOCK")) AND + # (colors: ANY("Red") OR categories: ANY("Phones")) + # + # For more information, see + # [Filter recommendations](https://cloud.google.com/retail/docs/filter-recs). + # @param validate_only [::Boolean] + # Use validate only mode for this prediction query. If set to true, a + # dummy model will be used that returns arbitrary products. + # Note that the validate only mode should only be used for testing the API, + # or if the model is not ready. + # @param params [::Hash{::String => ::Google::Protobuf::Value, ::Hash}] + # Additional domain specific parameters for the predictions. + # + # Allowed values: + # + # * `returnProduct`: Boolean. If set to true, the associated product + # object will be returned in the `results.metadata` field in the + # prediction response. + # * `returnScore`: Boolean. If set to true, the prediction 'score' + # corresponding to each returned product will be set in the + # `results.metadata` field in the prediction response. The given + # 'score' indicates the probability of a product being clicked/purchased + # given the user's context and history. + # * `strictFiltering`: Boolean. True by default. If set to false, the service + # will return generic (unfiltered) popular products instead of empty if + # your filter blocks all prediction results. + # * `priceRerankLevel`: String. Default empty. If set to be non-empty, then + # it needs to be one of {'no-price-reranking', 'low-price-reranking', + # 'medium-price-reranking', 'high-price-reranking'}. This gives + # request-level control and adjusts prediction results based on product + # price. + # * `diversityLevel`: String. Default empty. If set to be non-empty, then + # it needs to be one of {'no-diversity', 'low-diversity', + # 'medium-diversity', 'high-diversity', 'auto-diversity'}. This gives + # request-level control and adjusts prediction results based on product + # category. + # * `filterSyntaxV2`: Boolean. False by default. If set to true, the `filter` + # field is interpreteted according to the new, attribute-based syntax. + # @param labels [::Hash{::String => ::String}] + # The labels applied to a resource must meet the following requirements: + # + # * Each resource can have multiple labels, up to a maximum of 64. + # * Each label must be a key-value pair. + # * Keys have a minimum length of 1 character and a maximum length of 63 + # characters and cannot be empty. Values can be empty and have a maximum + # length of 63 characters. + # * Keys and values can contain only lowercase letters, numeric characters, + # underscores, and dashes. All characters must use UTF-8 encoding, and + # international characters are allowed. + # * The key portion of a label must be unique. However, you can use the same + # key with multiple resources. + # * Keys must start with a lowercase letter or international character. + # + # See [Google Cloud + # Document](https://cloud.google.com/resource-manager/docs/creating-managing-labels#requirements) + # for more details. + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Cloud::Retail::V2::PredictResponse] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::Retail::V2::PredictResponse] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/retail/v2" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Retail::V2::PredictionService::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Retail::V2::PredictRequest.new + # + # # Call the predict method. + # result = client.predict request + # + # # The returned object is of type Google::Cloud::Retail::V2::PredictResponse. + # p result + # + def predict request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Retail::V2::PredictRequest + + # Converts hash 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.predict.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::Retail::V2::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + options.apply_defaults timeout: @config.rpcs.predict.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.predict.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @prediction_service_stub.predict 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 PredictionService REST API. + # + # This class represents the configuration for PredictionService REST, + # providing control over timeouts, retry behavior, logging, transport + # parameters, and other low-level controls. Certain parameters can also be + # applied individually to specific RPCs. See + # {::Google::Cloud::Retail::V2::PredictionService::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 + # # predict to 20 seconds, + # # and all remaining timeouts to 10 seconds. + # ::Google::Cloud::Retail::V2::PredictionService::Rest::Client.configure do |config| + # config.timeout = 10.0 + # config.rpcs.predict.timeout = 20.0 + # end + # + # # Apply the above configuration only to a new client. + # client = ::Google::Cloud::Retail::V2::PredictionService::Rest::Client.new do |config| + # config.timeout = 10.0 + # config.rpcs.predict.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 = "retail.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 PredictionService 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 `predict` + # @return [::Gapic::Config::Method] + # + attr_reader :predict + + # @private + def initialize parent_rpcs = nil + predict_config = parent_rpcs.predict if parent_rpcs.respond_to? :predict + @predict = ::Gapic::Config::Method.new predict_config + + yield self if block_given? + end + end + end + end + end + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-retail-v2/lib/google/cloud/retail/v2/prediction_service/rest/service_stub.rb b/owl-bot-staging/google-cloud-retail-v2/lib/google/cloud/retail/v2/prediction_service/rest/service_stub.rb new file mode 100644 index 000000000000..4717b50f2d91 --- /dev/null +++ b/owl-bot-staging/google-cloud-retail-v2/lib/google/cloud/retail/v2/prediction_service/rest/service_stub.rb @@ -0,0 +1,151 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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/retail/v2/prediction_service_pb" + +module Google + module Cloud + module Retail + module V2 + module PredictionService + module Rest + ## + # REST service stub for the PredictionService 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 predict REST call + # + # @param request_pb [::Google::Cloud::Retail::V2::PredictRequest] + # A request object representing the call parameters. Required. + # @param options [::Gapic::CallOptions] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Cloud::Retail::V2::PredictResponse] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::Retail::V2::PredictResponse] + # A result object deserialized from the server's reply + def predict request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_predict_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: "predict", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Cloud::Retail::V2::PredictResponse.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 predict REST call + # + # @param request_pb [::Google::Cloud::Retail::V2::PredictRequest] + # A request object representing the call parameters. Required. + # @return [Array(String, [String, nil], Hash{String => String})] + # Uri, Body, Query string parameters + def self.transcode_predict_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :post, + uri_template: "/v2/{placement}:predict", + body: "*", + matches: [ + ["placement", %r{^projects/[^/]+/locations/[^/]+/catalogs/[^/]+/placements/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v2/{placement}:predict", + body: "*", + matches: [ + ["placement", %r{^projects/[^/]+/locations/[^/]+/catalogs/[^/]+/servingConfigs/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + end + end + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-retail-v2/lib/google/cloud/retail/v2/prediction_service_pb.rb b/owl-bot-staging/google-cloud-retail-v2/lib/google/cloud/retail/v2/prediction_service_pb.rb new file mode 100644 index 000000000000..5953dae20b84 --- /dev/null +++ b/owl-bot-staging/google-cloud-retail-v2/lib/google/cloud/retail/v2/prediction_service_pb.rb @@ -0,0 +1,30 @@ +# frozen_string_literal: true +# Generated by the protocol buffer compiler. DO NOT EDIT! +# source: google/cloud/retail/v2/prediction_service.proto + +require 'google/protobuf' + +require 'google/api/annotations_pb' +require 'google/api/client_pb' +require 'google/api/field_behavior_pb' +require 'google/api/resource_pb' +require 'google/cloud/retail/v2/user_event_pb' +require 'google/protobuf/struct_pb' + + +descriptor_data = "\n/google/cloud/retail/v2/prediction_service.proto\x12\x16google.cloud.retail.v2\x1a\x1cgoogle/api/annotations.proto\x1a\x17google/api/client.proto\x1a\x1fgoogle/api/field_behavior.proto\x1a\x19google/api/resource.proto\x1a\'google/cloud/retail/v2/user_event.proto\x1a\x1cgoogle/protobuf/struct.proto\"\xb4\x03\n\x0ePredictRequest\x12\x16\n\tplacement\x18\x01 \x01(\tB\x03\xe0\x41\x02\x12:\n\nuser_event\x18\x02 \x01(\x0b\x32!.google.cloud.retail.v2.UserEventB\x03\xe0\x41\x02\x12\x11\n\tpage_size\x18\x03 \x01(\x05\x12\x16\n\npage_token\x18\x04 \x01(\tB\x02\x18\x01\x12\x0e\n\x06\x66ilter\x18\x05 \x01(\t\x12\x15\n\rvalidate_only\x18\x06 \x01(\x08\x12\x42\n\x06params\x18\x07 \x03(\x0b\x32\x32.google.cloud.retail.v2.PredictRequest.ParamsEntry\x12\x42\n\x06labels\x18\x08 \x03(\x0b\x32\x32.google.cloud.retail.v2.PredictRequest.LabelsEntry\x1a\x45\n\x0bParamsEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12%\n\x05value\x18\x02 \x01(\x0b\x32\x16.google.protobuf.Value:\x02\x38\x01\x1a-\n\x0bLabelsEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12\r\n\x05value\x18\x02 \x01(\t:\x02\x38\x01\"\xe7\x02\n\x0fPredictResponse\x12I\n\x07results\x18\x01 \x03(\x0b\x32\x38.google.cloud.retail.v2.PredictResponse.PredictionResult\x12\x19\n\x11\x61ttribution_token\x18\x02 \x01(\t\x12\x13\n\x0bmissing_ids\x18\x03 \x03(\t\x12\x15\n\rvalidate_only\x18\x04 \x01(\x08\x1a\xc1\x01\n\x10PredictionResult\x12\n\n\x02id\x18\x01 \x01(\t\x12X\n\x08metadata\x18\x02 \x03(\x0b\x32\x46.google.cloud.retail.v2.PredictResponse.PredictionResult.MetadataEntry\x1aG\n\rMetadataEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12%\n\x05value\x18\x02 \x01(\x0b\x32\x16.google.protobuf.Value:\x02\x38\x01\x32\xe1\x02\n\x11PredictionService\x12\x80\x02\n\x07Predict\x12&.google.cloud.retail.v2.PredictRequest\x1a\'.google.cloud.retail.v2.PredictResponse\"\xa3\x01\x82\xd3\xe4\x93\x02\x9c\x01\"F/v2/{placement=projects/*/locations/*/catalogs/*/placements/*}:predict:\x01*ZO\"J/v2/{placement=projects/*/locations/*/catalogs/*/servingConfigs/*}:predict:\x01*\x1aI\xca\x41\x15retail.googleapis.com\xd2\x41.https://www.googleapis.com/auth/cloud-platformB\xc1\x01\n\x1a\x63om.google.cloud.retail.v2B\x16PredictionServiceProtoP\x01Z2cloud.google.com/go/retail/apiv2/retailpb;retailpb\xa2\x02\x06RETAIL\xaa\x02\x16Google.Cloud.Retail.V2\xca\x02\x16Google\\Cloud\\Retail\\V2\xea\x02\x19Google::Cloud::Retail::V2b\x06proto3" + +pool = ::Google::Protobuf::DescriptorPool.generated_pool +pool.add_serialized_file(descriptor_data) + +module Google + module Cloud + module Retail + module V2 + PredictRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.retail.v2.PredictRequest").msgclass + PredictResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.retail.v2.PredictResponse").msgclass + PredictResponse::PredictionResult = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.retail.v2.PredictResponse.PredictionResult").msgclass + end + end + end +end diff --git a/owl-bot-staging/google-cloud-retail-v2/lib/google/cloud/retail/v2/prediction_service_services_pb.rb b/owl-bot-staging/google-cloud-retail-v2/lib/google/cloud/retail/v2/prediction_service_services_pb.rb new file mode 100644 index 000000000000..050119438d40 --- /dev/null +++ b/owl-bot-staging/google-cloud-retail-v2/lib/google/cloud/retail/v2/prediction_service_services_pb.rb @@ -0,0 +1,45 @@ +# Generated by the protocol buffer compiler. DO NOT EDIT! +# Source: google/cloud/retail/v2/prediction_service.proto for package 'Google.Cloud.Retail.V2' +# Original file comments: +# 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 +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# + +require 'grpc' +require 'google/cloud/retail/v2/prediction_service_pb' + +module Google + module Cloud + module Retail + module V2 + module PredictionService + # Service for making recommendation prediction. + class Service + + include ::GRPC::GenericService + + self.marshal_class_method = :encode + self.unmarshal_class_method = :decode + self.service_name = 'google.cloud.retail.v2.PredictionService' + + # Makes a recommendation prediction. + rpc :Predict, ::Google::Cloud::Retail::V2::PredictRequest, ::Google::Cloud::Retail::V2::PredictResponse + end + + Stub = Service.rpc_stub_class + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-retail-v2/lib/google/cloud/retail/v2/product_pb.rb b/owl-bot-staging/google-cloud-retail-v2/lib/google/cloud/retail/v2/product_pb.rb new file mode 100644 index 000000000000..fd072d651729 --- /dev/null +++ b/owl-bot-staging/google-cloud-retail-v2/lib/google/cloud/retail/v2/product_pb.rb @@ -0,0 +1,32 @@ +# frozen_string_literal: true +# Generated by the protocol buffer compiler. DO NOT EDIT! +# source: google/cloud/retail/v2/product.proto + +require 'google/protobuf' + +require 'google/api/field_behavior_pb' +require 'google/api/resource_pb' +require 'google/cloud/retail/v2/common_pb' +require 'google/cloud/retail/v2/promotion_pb' +require 'google/protobuf/duration_pb' +require 'google/protobuf/field_mask_pb' +require 'google/protobuf/timestamp_pb' +require 'google/protobuf/wrappers_pb' + + +descriptor_data = "\n$google/cloud/retail/v2/product.proto\x12\x16google.cloud.retail.v2\x1a\x1fgoogle/api/field_behavior.proto\x1a\x19google/api/resource.proto\x1a#google/cloud/retail/v2/common.proto\x1a&google/cloud/retail/v2/promotion.proto\x1a\x1egoogle/protobuf/duration.proto\x1a google/protobuf/field_mask.proto\x1a\x1fgoogle/protobuf/timestamp.proto\x1a\x1egoogle/protobuf/wrappers.proto\"\xdb\r\n\x07Product\x12\x31\n\x0b\x65xpire_time\x18\x10 \x01(\x0b\x32\x1a.google.protobuf.TimestampH\x00\x12-\n\x03ttl\x18\x11 \x01(\x0b\x32\x19.google.protobuf.DurationB\x03\xe0\x41\x04H\x00\x12\x11\n\x04name\x18\x01 \x01(\tB\x03\xe0\x41\x05\x12\x0f\n\x02id\x18\x02 \x01(\tB\x03\xe0\x41\x05\x12\x37\n\x04type\x18\x03 \x01(\x0e\x32$.google.cloud.retail.v2.Product.TypeB\x03\xe0\x41\x05\x12\x1a\n\x12primary_product_id\x18\x04 \x01(\t\x12\x1d\n\x15\x63ollection_member_ids\x18\x05 \x03(\t\x12\x0c\n\x04gtin\x18\x06 \x01(\t\x12\x12\n\ncategories\x18\x07 \x03(\t\x12\x12\n\x05title\x18\x08 \x01(\tB\x03\xe0\x41\x02\x12\x0e\n\x06\x62rands\x18\t \x03(\t\x12\x13\n\x0b\x64\x65scription\x18\n \x01(\t\x12\x15\n\rlanguage_code\x18\x0b \x01(\t\x12\x43\n\nattributes\x18\x0c \x03(\x0b\x32/.google.cloud.retail.v2.Product.AttributesEntry\x12\x0c\n\x04tags\x18\r \x03(\t\x12\x35\n\nprice_info\x18\x0e \x01(\x0b\x32!.google.cloud.retail.v2.PriceInfo\x12.\n\x06rating\x18\x0f \x01(\x0b\x32\x1e.google.cloud.retail.v2.Rating\x12\x32\n\x0e\x61vailable_time\x18\x12 \x01(\x0b\x32\x1a.google.protobuf.Timestamp\x12\x42\n\x0c\x61vailability\x18\x13 \x01(\x0e\x32,.google.cloud.retail.v2.Product.Availability\x12\x37\n\x12\x61vailable_quantity\x18\x14 \x01(\x0b\x32\x1b.google.protobuf.Int32Value\x12\x41\n\x10\x66ulfillment_info\x18\x15 \x03(\x0b\x32\'.google.cloud.retail.v2.FulfillmentInfo\x12\x0b\n\x03uri\x18\x16 \x01(\t\x12-\n\x06images\x18\x17 \x03(\x0b\x32\x1d.google.cloud.retail.v2.Image\x12\x32\n\x08\x61udience\x18\x18 \x01(\x0b\x32 .google.cloud.retail.v2.Audience\x12\x35\n\ncolor_info\x18\x19 \x01(\x0b\x32!.google.cloud.retail.v2.ColorInfo\x12\r\n\x05sizes\x18\x1a \x03(\t\x12\x11\n\tmaterials\x18\x1b \x03(\t\x12\x10\n\x08patterns\x18\x1c \x03(\t\x12\x12\n\nconditions\x18\x1d \x03(\t\x12\x35\n\npromotions\x18\" \x03(\x0b\x32!.google.cloud.retail.v2.Promotion\x12\x30\n\x0cpublish_time\x18! \x01(\x0b\x32\x1a.google.protobuf.Timestamp\x12:\n\x12retrievable_fields\x18\x1e \x01(\x0b\x32\x1a.google.protobuf.FieldMaskB\x02\x18\x01\x12\x36\n\x08variants\x18\x1f \x03(\x0b\x32\x1f.google.cloud.retail.v2.ProductB\x03\xe0\x41\x03\x12\x46\n\x11local_inventories\x18# \x03(\x0b\x32&.google.cloud.retail.v2.LocalInventoryB\x03\xe0\x41\x03\x1aZ\n\x0f\x41ttributesEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12\x36\n\x05value\x18\x02 \x01(\x0b\x32\'.google.cloud.retail.v2.CustomAttribute:\x02\x38\x01\"F\n\x04Type\x12\x14\n\x10TYPE_UNSPECIFIED\x10\x00\x12\x0b\n\x07PRIMARY\x10\x01\x12\x0b\n\x07VARIANT\x10\x02\x12\x0e\n\nCOLLECTION\x10\x03\"i\n\x0c\x41vailability\x12\x1c\n\x18\x41VAILABILITY_UNSPECIFIED\x10\x00\x12\x0c\n\x08IN_STOCK\x10\x01\x12\x10\n\x0cOUT_OF_STOCK\x10\x02\x12\x0c\n\x08PREORDER\x10\x03\x12\r\n\tBACKORDER\x10\x04:\x84\x01\xea\x41\x80\x01\n\x1dretail.googleapis.com/Product\x12_projects/{project}/locations/{location}/catalogs/{catalog}/branches/{branch}/products/{product}B\x0c\n\nexpirationB\xa6\x02\n\x1a\x63om.google.cloud.retail.v2B\x0cProductProtoP\x01Z2cloud.google.com/go/retail/apiv2/retailpb;retailpb\xa2\x02\x06RETAIL\xaa\x02\x16Google.Cloud.Retail.V2\xca\x02\x16Google\\Cloud\\Retail\\V2\xea\x02\x19Google::Cloud::Retail::V2\xea\x41l\n\x1cretail.googleapis.com/Branch\x12Lprojects/{project}/locations/{location}/catalogs/{catalog}/branches/{branch}b\x06proto3" + +pool = ::Google::Protobuf::DescriptorPool.generated_pool +pool.add_serialized_file(descriptor_data) + +module Google + module Cloud + module Retail + module V2 + Product = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.retail.v2.Product").msgclass + Product::Type = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.retail.v2.Product.Type").enummodule + Product::Availability = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.retail.v2.Product.Availability").enummodule + end + end + end +end diff --git a/owl-bot-staging/google-cloud-retail-v2/lib/google/cloud/retail/v2/product_service.rb b/owl-bot-staging/google-cloud-retail-v2/lib/google/cloud/retail/v2/product_service.rb new file mode 100644 index 000000000000..b0bca826b962 --- /dev/null +++ b/owl-bot-staging/google-cloud-retail-v2/lib/google/cloud/retail/v2/product_service.rb @@ -0,0 +1,57 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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/retail/v2/version" + +require "google/cloud/retail/v2/product_service/credentials" +require "google/cloud/retail/v2/product_service/paths" +require "google/cloud/retail/v2/product_service/operations" +require "google/cloud/retail/v2/product_service/client" +require "google/cloud/retail/v2/product_service/rest" + +module Google + module Cloud + module Retail + module V2 + ## + # Service for ingesting {::Google::Cloud::Retail::V2::Product Product} information + # of the customer's website. + # + # @example Load this service and instantiate a gRPC client + # + # require "google/cloud/retail/v2/product_service" + # client = ::Google::Cloud::Retail::V2::ProductService::Client.new + # + # @example Load this service and instantiate a REST client + # + # require "google/cloud/retail/v2/product_service/rest" + # client = ::Google::Cloud::Retail::V2::ProductService::Rest::Client.new + # + module ProductService + end + end + end + end +end + +helper_path = ::File.join __dir__, "product_service", "helpers.rb" +require "google/cloud/retail/v2/product_service/helpers" if ::File.file? helper_path diff --git a/owl-bot-staging/google-cloud-retail-v2/lib/google/cloud/retail/v2/product_service/client.rb b/owl-bot-staging/google-cloud-retail-v2/lib/google/cloud/retail/v2/product_service/client.rb new file mode 100644 index 000000000000..59efdf52763f --- /dev/null +++ b/owl-bot-staging/google-cloud-retail-v2/lib/google/cloud/retail/v2/product_service/client.rb @@ -0,0 +1,2237 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +require "google/cloud/errors" +require "google/cloud/retail/v2/product_service_pb" +require "google/cloud/location" + +module Google + module Cloud + module Retail + module V2 + module ProductService + ## + # Client for the ProductService service. + # + # Service for ingesting {::Google::Cloud::Retail::V2::Product Product} information + # of the customer's website. + # + class Client + # @private + API_VERSION = "" + + # @private + DEFAULT_ENDPOINT_TEMPLATE = "retail.$UNIVERSE_DOMAIN$" + + include Paths + + # @private + attr_reader :product_service_stub + + ## + # Configure the ProductService Client class. + # + # See {::Google::Cloud::Retail::V2::ProductService::Client::Configuration} + # for a description of the configuration fields. + # + # @example + # + # # Modify the configuration for all ProductService clients + # ::Google::Cloud::Retail::V2::ProductService::Client.configure do |config| + # config.timeout = 10.0 + # end + # + # @yield [config] Configure the Client client. + # @yieldparam config [Client::Configuration] + # + # @return [Client::Configuration] + # + def self.configure + @configure ||= begin + namespace = ["Google", "Cloud", "Retail", "V2"] + parent_config = while namespace.any? + parent_name = namespace.join "::" + parent_const = const_get parent_name + break parent_const.configure if parent_const.respond_to? :configure + namespace.pop + end + default_config = Client::Configuration.new parent_config + + default_config.timeout = 30.0 + default_config.retry_policy = { + initial_delay: 0.1, max_delay: 30.0, multiplier: 1.3, retry_codes: [14, 4] + } + + default_config.rpcs.import_products.timeout = 300.0 + default_config.rpcs.import_products.retry_policy = { + initial_delay: 0.1, max_delay: 300.0, multiplier: 1.3, retry_codes: [14, 4] + } + + default_config + end + yield @configure if block_given? + @configure + end + + ## + # Configure the ProductService Client instance. + # + # The configuration is set to the derived mode, meaning that values can be changed, + # but structural changes (adding new fields, etc.) are not allowed. Structural changes + # should be made on {Client.configure}. + # + # See {::Google::Cloud::Retail::V2::ProductService::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 + @product_service_stub.universe_domain + end + + ## + # Create a new ProductService client object. + # + # @example + # + # # Create a client using the default configuration + # client = ::Google::Cloud::Retail::V2::ProductService::Client.new + # + # # Create a client using a custom configuration + # client = ::Google::Cloud::Retail::V2::ProductService::Client.new do |config| + # config.timeout = 10.0 + # end + # + # @yield [config] Configure the ProductService client. + # @yieldparam config [Client::Configuration] + # + def initialize + # These require statements are intentionally placed here to initialize + # the gRPC module only when it's required. + # See https://github.com/googleapis/toolkit/issues/446 + require "gapic/grpc" + require "google/cloud/retail/v2/product_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 + + @product_service_stub = ::Gapic::ServiceStub.new( + ::Google::Cloud::Retail::V2::ProductService::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 + ) + + @product_service_stub.stub_logger&.info do |entry| + entry.set_system_name + entry.set_service + entry.message = "Created client for #{entry.service}" + entry.set_credentials_fields credentials + entry.set "customEndpoint", @config.endpoint if @config.endpoint + entry.set "defaultTimeout", @config.timeout if @config.timeout + entry.set "quotaProject", @quota_project_id if @quota_project_id + end + + @location_client = Google::Cloud::Location::Locations::Client.new do |config| + config.credentials = credentials + config.quota_project = @quota_project_id + config.endpoint = @product_service_stub.endpoint + config.universe_domain = @product_service_stub.universe_domain + config.logger = @product_service_stub.logger if config.respond_to? :logger= + end + end + + ## + # Get the associated client for long-running operations. + # + # @return [::Google::Cloud::Retail::V2::ProductService::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 + @product_service_stub.logger + end + + # Service calls + + ## + # Creates a {::Google::Cloud::Retail::V2::Product Product}. + # + # @overload create_product(request, options = nil) + # Pass arguments to `create_product` via a request object, either of type + # {::Google::Cloud::Retail::V2::CreateProductRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Retail::V2::CreateProductRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_product(parent: nil, product: nil, product_id: nil) + # Pass arguments to `create_product` via keyword arguments. Note that at + # least one keyword argument is 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 catalog resource name, such as + # `projects/*/locations/global/catalogs/default_catalog/branches/default_branch`. + # @param product [::Google::Cloud::Retail::V2::Product, ::Hash] + # Required. The {::Google::Cloud::Retail::V2::Product Product} to create. + # @param product_id [::String] + # Required. The ID to use for the {::Google::Cloud::Retail::V2::Product Product}, + # which will become the final component of the + # {::Google::Cloud::Retail::V2::Product#name Product.name}. + # + # If the caller does not have permission to create the + # {::Google::Cloud::Retail::V2::Product Product}, regardless of whether or not it + # exists, a PERMISSION_DENIED error is returned. + # + # This field must be unique among all + # {::Google::Cloud::Retail::V2::Product Product}s with the same + # {::Google::Cloud::Retail::V2::CreateProductRequest#parent parent}. Otherwise, an + # ALREADY_EXISTS error is returned. + # + # This field must be a UTF-8 encoded string with a length limit of 128 + # characters. Otherwise, an INVALID_ARGUMENT error is returned. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Google::Cloud::Retail::V2::Product] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Google::Cloud::Retail::V2::Product] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/retail/v2" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Retail::V2::ProductService::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Retail::V2::CreateProductRequest.new + # + # # Call the create_product method. + # result = client.create_product request + # + # # The returned object is of type Google::Cloud::Retail::V2::Product. + # p result + # + def create_product request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Retail::V2::CreateProductRequest + + # Converts hash 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_product.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::Retail::V2::VERSION + metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.parent + 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_product.timeout, + metadata: metadata, + retry_policy: @config.rpcs.create_product.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @product_service_stub.call_rpc :create_product, request, options: options do |response, operation| + yield response, operation if block_given? + end + rescue ::GRPC::BadStatus => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Gets a {::Google::Cloud::Retail::V2::Product Product}. + # + # @overload get_product(request, options = nil) + # Pass arguments to `get_product` via a request object, either of type + # {::Google::Cloud::Retail::V2::GetProductRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Retail::V2::GetProductRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_product(name: nil) + # Pass arguments to `get_product` via keyword arguments. Note that at + # least one keyword argument is 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. Full resource name of {::Google::Cloud::Retail::V2::Product Product}, + # such as + # `projects/*/locations/global/catalogs/default_catalog/branches/default_branch/products/some_product_id`. + # + # If the caller does not have permission to access the + # {::Google::Cloud::Retail::V2::Product Product}, regardless of whether or not it + # exists, a PERMISSION_DENIED error is returned. + # + # If the requested {::Google::Cloud::Retail::V2::Product Product} does not exist, + # a NOT_FOUND error is returned. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Google::Cloud::Retail::V2::Product] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Google::Cloud::Retail::V2::Product] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/retail/v2" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Retail::V2::ProductService::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Retail::V2::GetProductRequest.new + # + # # Call the get_product method. + # result = client.get_product request + # + # # The returned object is of type Google::Cloud::Retail::V2::Product. + # p result + # + def get_product request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Retail::V2::GetProductRequest + + # Converts hash 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_product.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::Retail::V2::VERSION + metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.name + header_params["name"] = request.name + end + + request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") + metadata[:"x-goog-request-params"] ||= request_params_header + + options.apply_defaults timeout: @config.rpcs.get_product.timeout, + metadata: metadata, + retry_policy: @config.rpcs.get_product.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @product_service_stub.call_rpc :get_product, request, options: options do |response, operation| + yield response, operation if block_given? + end + rescue ::GRPC::BadStatus => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Gets a list of {::Google::Cloud::Retail::V2::Product Product}s. + # + # @overload list_products(request, options = nil) + # Pass arguments to `list_products` via a request object, either of type + # {::Google::Cloud::Retail::V2::ListProductsRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Retail::V2::ListProductsRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_products(parent: nil, page_size: nil, page_token: nil, filter: nil, read_mask: nil) + # Pass arguments to `list_products` via keyword arguments. Note that at + # least one keyword argument is 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 branch resource name, such as + # `projects/*/locations/global/catalogs/default_catalog/branches/0`. Use + # `default_branch` as the branch ID, to list products under the default + # branch. + # + # If the caller does not have permission to list + # {::Google::Cloud::Retail::V2::Product Product}s under this branch, regardless of + # whether or not this branch exists, a PERMISSION_DENIED error is returned. + # @param page_size [::Integer] + # Maximum number of {::Google::Cloud::Retail::V2::Product Product}s to return. If + # unspecified, defaults to 100. The maximum allowed value is 1000. Values + # above 1000 will be coerced to 1000. + # + # If this field is negative, an INVALID_ARGUMENT error is returned. + # @param page_token [::String] + # A page token + # {::Google::Cloud::Retail::V2::ListProductsResponse#next_page_token ListProductsResponse.next_page_token}, + # received from a previous + # {::Google::Cloud::Retail::V2::ProductService::Client#list_products ProductService.ListProducts} + # call. Provide this to retrieve the subsequent page. + # + # When paginating, all other parameters provided to + # {::Google::Cloud::Retail::V2::ProductService::Client#list_products ProductService.ListProducts} + # must match the call that provided the page token. Otherwise, an + # INVALID_ARGUMENT error is returned. + # @param filter [::String] + # A filter to apply on the list results. Supported features: + # + # * List all the products under the parent branch if + # {::Google::Cloud::Retail::V2::ListProductsRequest#filter filter} is unset. + # * List {::Google::Cloud::Retail::V2::Product::Type::VARIANT Product.Type.VARIANT} + # {::Google::Cloud::Retail::V2::Product Product}s sharing the same + # {::Google::Cloud::Retail::V2::Product::Type::PRIMARY Product.Type.PRIMARY} + # {::Google::Cloud::Retail::V2::Product Product}. For example: + # `primary_product_id = "some_product_id"` + # * List {::Google::Cloud::Retail::V2::Product Product}s bundled in a + # {::Google::Cloud::Retail::V2::Product::Type::COLLECTION Product.Type.COLLECTION} + # {::Google::Cloud::Retail::V2::Product Product}. + # For example: + # `collection_product_id = "some_product_id"` + # * List {::Google::Cloud::Retail::V2::Product Product}s with a partibular type. + # For example: + # `type = "PRIMARY"` + # `type = "VARIANT"` + # `type = "COLLECTION"` + # + # If the field is unrecognizable, an INVALID_ARGUMENT error is returned. + # + # If the specified + # {::Google::Cloud::Retail::V2::Product::Type::PRIMARY Product.Type.PRIMARY} + # {::Google::Cloud::Retail::V2::Product Product} or + # {::Google::Cloud::Retail::V2::Product::Type::COLLECTION Product.Type.COLLECTION} + # {::Google::Cloud::Retail::V2::Product Product} does not exist, a NOT_FOUND error + # is returned. + # @param read_mask [::Google::Protobuf::FieldMask, ::Hash] + # The fields of {::Google::Cloud::Retail::V2::Product Product} to return in the + # responses. If not set or empty, the following fields are returned: + # + # * {::Google::Cloud::Retail::V2::Product#name Product.name} + # * {::Google::Cloud::Retail::V2::Product#id Product.id} + # * {::Google::Cloud::Retail::V2::Product#title Product.title} + # * {::Google::Cloud::Retail::V2::Product#uri Product.uri} + # * {::Google::Cloud::Retail::V2::Product#images Product.images} + # * {::Google::Cloud::Retail::V2::Product#price_info Product.price_info} + # * {::Google::Cloud::Retail::V2::Product#brands Product.brands} + # + # If "*" is provided, all fields are returned. + # {::Google::Cloud::Retail::V2::Product#name Product.name} is always returned no + # matter what mask is set. + # + # If an unsupported or unknown field is provided, an INVALID_ARGUMENT error + # is returned. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Gapic::PagedEnumerable<::Google::Cloud::Retail::V2::Product>] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Gapic::PagedEnumerable<::Google::Cloud::Retail::V2::Product>] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/retail/v2" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Retail::V2::ProductService::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Retail::V2::ListProductsRequest.new + # + # # Call the list_products method. + # result = client.list_products request + # + # # The returned object is of type Gapic::PagedEnumerable. You can iterate + # # over elements, and API calls will be issued to fetch pages as needed. + # result.each do |item| + # # Each element is of type ::Google::Cloud::Retail::V2::Product. + # p item + # end + # + def list_products request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Retail::V2::ListProductsRequest + + # Converts hash 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_products.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::Retail::V2::VERSION + metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.parent + 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_products.timeout, + metadata: metadata, + retry_policy: @config.rpcs.list_products.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @product_service_stub.call_rpc :list_products, request, options: options do |response, operation| + response = ::Gapic::PagedEnumerable.new @product_service_stub, :list_products, 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 + + ## + # Updates a {::Google::Cloud::Retail::V2::Product Product}. + # + # @overload update_product(request, options = nil) + # Pass arguments to `update_product` via a request object, either of type + # {::Google::Cloud::Retail::V2::UpdateProductRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Retail::V2::UpdateProductRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_product(product: nil, update_mask: nil, allow_missing: nil) + # Pass arguments to `update_product` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param product [::Google::Cloud::Retail::V2::Product, ::Hash] + # Required. The product to update/create. + # + # If the caller does not have permission to update the + # {::Google::Cloud::Retail::V2::Product Product}, regardless of whether or not it + # exists, a PERMISSION_DENIED error is returned. + # + # If the {::Google::Cloud::Retail::V2::Product Product} to update does not exist + # and + # {::Google::Cloud::Retail::V2::UpdateProductRequest#allow_missing allow_missing} + # is not set, a NOT_FOUND error is returned. + # @param update_mask [::Google::Protobuf::FieldMask, ::Hash] + # Indicates which fields in the provided + # {::Google::Cloud::Retail::V2::Product Product} to update. The immutable and + # output only fields are NOT supported. If not set, all supported fields (the + # fields that are neither immutable nor output only) are updated. + # + # If an unsupported or unknown field is provided, an INVALID_ARGUMENT error + # is returned. + # + # The attribute key can be updated by setting the mask path as + # "attributes.$\\{key_name}". If a key name is present in the mask but not in + # the patching product from the request, this key will be deleted after the + # update. + # @param allow_missing [::Boolean] + # If set to true, and the {::Google::Cloud::Retail::V2::Product Product} is not + # found, a new {::Google::Cloud::Retail::V2::Product Product} will be created. In + # this situation, `update_mask` is ignored. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Google::Cloud::Retail::V2::Product] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Google::Cloud::Retail::V2::Product] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/retail/v2" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Retail::V2::ProductService::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Retail::V2::UpdateProductRequest.new + # + # # Call the update_product method. + # result = client.update_product request + # + # # The returned object is of type Google::Cloud::Retail::V2::Product. + # p result + # + def update_product request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Retail::V2::UpdateProductRequest + + # Converts hash 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_product.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::Retail::V2::VERSION + metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.product&.name + header_params["product.name"] = request.product.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_product.timeout, + metadata: metadata, + retry_policy: @config.rpcs.update_product.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @product_service_stub.call_rpc :update_product, request, options: options do |response, operation| + yield response, operation if block_given? + end + rescue ::GRPC::BadStatus => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Deletes a {::Google::Cloud::Retail::V2::Product Product}. + # + # @overload delete_product(request, options = nil) + # Pass arguments to `delete_product` via a request object, either of type + # {::Google::Cloud::Retail::V2::DeleteProductRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Retail::V2::DeleteProductRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_product(name: nil) + # Pass arguments to `delete_product` via keyword arguments. Note that at + # least one keyword argument is 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. Full resource name of {::Google::Cloud::Retail::V2::Product Product}, + # such as + # `projects/*/locations/global/catalogs/default_catalog/branches/default_branch/products/some_product_id`. + # + # If the caller does not have permission to delete the + # {::Google::Cloud::Retail::V2::Product Product}, regardless of whether or not it + # exists, a PERMISSION_DENIED error is returned. + # + # If the {::Google::Cloud::Retail::V2::Product Product} to delete does not exist, + # a NOT_FOUND error is returned. + # + # The {::Google::Cloud::Retail::V2::Product Product} to delete can neither be a + # {::Google::Cloud::Retail::V2::Product::Type::COLLECTION Product.Type.COLLECTION} + # {::Google::Cloud::Retail::V2::Product Product} member nor a + # {::Google::Cloud::Retail::V2::Product::Type::PRIMARY Product.Type.PRIMARY} + # {::Google::Cloud::Retail::V2::Product Product} with more than one + # {::Google::Cloud::Retail::V2::Product::Type::VARIANT variants}. Otherwise, an + # INVALID_ARGUMENT error is returned. + # + # All inventory information for the named + # {::Google::Cloud::Retail::V2::Product Product} will 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/cloud/retail/v2" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Retail::V2::ProductService::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Retail::V2::DeleteProductRequest.new + # + # # Call the delete_product method. + # result = client.delete_product request + # + # # The returned object is of type Google::Protobuf::Empty. + # p result + # + def delete_product request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Retail::V2::DeleteProductRequest + + # Converts hash 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_product.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::Retail::V2::VERSION + metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.name + header_params["name"] = request.name + end + + request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") + metadata[:"x-goog-request-params"] ||= request_params_header + + options.apply_defaults timeout: @config.rpcs.delete_product.timeout, + metadata: metadata, + retry_policy: @config.rpcs.delete_product.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @product_service_stub.call_rpc :delete_product, request, options: options do |response, operation| + yield response, operation if block_given? + end + rescue ::GRPC::BadStatus => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Permanently deletes all selected {::Google::Cloud::Retail::V2::Product Product}s + # under a branch. + # + # This process is asynchronous. If the request is valid, the removal will be + # enqueued and processed offline. Depending on the number of + # {::Google::Cloud::Retail::V2::Product Product}s, this operation could take hours + # to complete. Before the operation completes, some + # {::Google::Cloud::Retail::V2::Product Product}s may still be returned by + # {::Google::Cloud::Retail::V2::ProductService::Client#get_product ProductService.GetProduct} + # or + # {::Google::Cloud::Retail::V2::ProductService::Client#list_products ProductService.ListProducts}. + # + # Depending on the number of {::Google::Cloud::Retail::V2::Product Product}s, this + # operation could take hours to complete. To get a sample of + # {::Google::Cloud::Retail::V2::Product Product}s that would be deleted, set + # {::Google::Cloud::Retail::V2::PurgeProductsRequest#force PurgeProductsRequest.force} + # to false. + # + # @overload purge_products(request, options = nil) + # Pass arguments to `purge_products` via a request object, either of type + # {::Google::Cloud::Retail::V2::PurgeProductsRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Retail::V2::PurgeProductsRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. + # + # @overload purge_products(parent: nil, filter: nil, force: nil) + # Pass arguments to `purge_products` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param parent [::String] + # Required. The resource name of the branch under which the products are + # created. The format is + # `projects/${projectId}/locations/global/catalogs/${catalogId}/branches/${branchId}` + # @param filter [::String] + # Required. The filter string to specify the products to be deleted with a + # length limit of 5,000 characters. + # + # Empty string filter is not allowed. "*" implies delete all items in a + # branch. + # + # The eligible fields for filtering are: + # + # * `availability`: Double quoted + # {::Google::Cloud::Retail::V2::Product#availability Product.availability} string. + # * `create_time` : in ISO 8601 "zulu" format. + # + # Supported syntax: + # + # * Comparators (">", "<", ">=", "<=", "="). + # Examples: + # * create_time <= "2015-02-13T17:05:46Z" + # * availability = "IN_STOCK" + # + # * Conjunctions ("AND") + # Examples: + # * create_time <= "2015-02-13T17:05:46Z" AND availability = "PREORDER" + # + # * Disjunctions ("OR") + # Examples: + # * create_time <= "2015-02-13T17:05:46Z" OR availability = "IN_STOCK" + # + # * Can support nested queries. + # Examples: + # * (create_time <= "2015-02-13T17:05:46Z" AND availability = "PREORDER") + # OR (create_time >= "2015-02-14T13:03:32Z" AND availability = "IN_STOCK") + # + # * Filter Limits: + # * Filter should not contain more than 6 conditions. + # * Max nesting depth should not exceed 2 levels. + # + # Examples queries: + # * Delete back order products created before a timestamp. + # create_time <= "2015-02-13T17:05:46Z" OR availability = "BACKORDER" + # @param force [::Boolean] + # Actually perform the purge. + # If `force` is set to false, the method will return the expected purge count + # without deleting any products. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Gapic::Operation] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Gapic::Operation] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/retail/v2" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Retail::V2::ProductService::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Retail::V2::PurgeProductsRequest.new + # + # # Call the purge_products method. + # result = client.purge_products 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 purge_products request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Retail::V2::PurgeProductsRequest + + # Converts hash 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.purge_products.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::Retail::V2::VERSION + metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.parent + 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.purge_products.timeout, + metadata: metadata, + retry_policy: @config.rpcs.purge_products.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @product_service_stub.call_rpc :purge_products, 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 + + ## + # Bulk import of multiple {::Google::Cloud::Retail::V2::Product Product}s. + # + # Request processing may be synchronous. + # Non-existing items are created. + # + # Note that it is possible for a subset of the + # {::Google::Cloud::Retail::V2::Product Product}s to be successfully updated. + # + # @overload import_products(request, options = nil) + # Pass arguments to `import_products` via a request object, either of type + # {::Google::Cloud::Retail::V2::ImportProductsRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Retail::V2::ImportProductsRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. + # + # @overload import_products(parent: nil, request_id: nil, input_config: nil, errors_config: nil, update_mask: nil, reconciliation_mode: nil, notification_pubsub_topic: nil) + # Pass arguments to `import_products` via keyword arguments. Note that at + # least one keyword argument is 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. + # `projects/1234/locations/global/catalogs/default_catalog/branches/default_branch` + # + # If no updateMask is specified, requires products.create permission. + # If updateMask is specified, requires products.update permission. + # @param request_id [::String] + # Deprecated. This field has no effect. + # @param input_config [::Google::Cloud::Retail::V2::ProductInputConfig, ::Hash] + # Required. The desired input location of the data. + # @param errors_config [::Google::Cloud::Retail::V2::ImportErrorsConfig, ::Hash] + # The desired location of errors incurred during the Import. + # @param update_mask [::Google::Protobuf::FieldMask, ::Hash] + # Indicates which fields in the provided imported `products` to update. If + # not set, all fields are updated. If provided, only the existing product + # fields are updated. Missing products will not be created. + # @param reconciliation_mode [::Google::Cloud::Retail::V2::ImportProductsRequest::ReconciliationMode] + # The mode of reconciliation between existing products and the products to be + # imported. Defaults to + # {::Google::Cloud::Retail::V2::ImportProductsRequest::ReconciliationMode::INCREMENTAL ReconciliationMode.INCREMENTAL}. + # @param notification_pubsub_topic [::String] + # Full Pub/Sub topic name for receiving notification. If this field is set, + # when the import is finished, a notification is sent to + # specified Pub/Sub topic. The message data is JSON string of a + # {::Google::Longrunning::Operation Operation}. + # + # Format of the Pub/Sub topic is `projects/{project}/topics/{topic}`. It has + # to be within the same project as + # {::Google::Cloud::Retail::V2::ImportProductsRequest#parent ImportProductsRequest.parent}. + # Make sure that both + # `cloud-retail-customer-data-access@system.gserviceaccount.com` and + # `service-@gcp-sa-retail.iam.gserviceaccount.com` + # have the `pubsub.topics.publish` IAM permission on the topic. + # + # Only supported when + # {::Google::Cloud::Retail::V2::ImportProductsRequest#reconciliation_mode ImportProductsRequest.reconciliation_mode} + # is set to `FULL`. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Gapic::Operation] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Gapic::Operation] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/retail/v2" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Retail::V2::ProductService::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Retail::V2::ImportProductsRequest.new + # + # # Call the import_products method. + # result = client.import_products 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 import_products request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Retail::V2::ImportProductsRequest + + # Converts hash 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.import_products.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::Retail::V2::VERSION + metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.parent + 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.import_products.timeout, + metadata: metadata, + retry_policy: @config.rpcs.import_products.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @product_service_stub.call_rpc :import_products, request, options: options do |response, operation| + response = ::Gapic::Operation.new response, @operations_client, options: options + yield response, operation if block_given? + throw :response, response + end + rescue ::GRPC::BadStatus => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Updates inventory information for a + # {::Google::Cloud::Retail::V2::Product Product} while respecting the last update + # timestamps of each inventory field. + # + # This process is asynchronous and does not require the + # {::Google::Cloud::Retail::V2::Product Product} to exist before updating + # fulfillment information. If the request is valid, the update is enqueued + # and processed downstream. As a consequence, when a response is returned, + # updates are not immediately manifested in the + # {::Google::Cloud::Retail::V2::Product Product} queried by + # {::Google::Cloud::Retail::V2::ProductService::Client#get_product ProductService.GetProduct} + # or + # {::Google::Cloud::Retail::V2::ProductService::Client#list_products ProductService.ListProducts}. + # + # When inventory is updated with + # {::Google::Cloud::Retail::V2::ProductService::Client#create_product ProductService.CreateProduct} + # and + # {::Google::Cloud::Retail::V2::ProductService::Client#update_product ProductService.UpdateProduct}, + # the specified inventory field value(s) overwrite any existing value(s) + # while ignoring the last update time for this field. Furthermore, the last + # update times for the specified inventory fields are overwritten by the + # times of the + # {::Google::Cloud::Retail::V2::ProductService::Client#create_product ProductService.CreateProduct} + # or + # {::Google::Cloud::Retail::V2::ProductService::Client#update_product ProductService.UpdateProduct} + # request. + # + # If no inventory fields are set in + # {::Google::Cloud::Retail::V2::CreateProductRequest#product CreateProductRequest.product}, + # then any pre-existing inventory information for this product is used. + # + # If no inventory fields are set in + # {::Google::Cloud::Retail::V2::SetInventoryRequest#set_mask SetInventoryRequest.set_mask}, + # then any existing inventory information is preserved. + # + # Pre-existing inventory information can only be updated with + # {::Google::Cloud::Retail::V2::ProductService::Client#set_inventory ProductService.SetInventory}, + # {::Google::Cloud::Retail::V2::ProductService::Client#add_fulfillment_places ProductService.AddFulfillmentPlaces}, + # and + # {::Google::Cloud::Retail::V2::ProductService::Client#remove_fulfillment_places ProductService.RemoveFulfillmentPlaces}. + # + # The returned {::Google::Longrunning::Operation Operation}s is obsolete after + # one day, and the GetOperation + # API returns `NOT_FOUND` afterwards. + # + # If conflicting updates are issued, the + # {::Google::Longrunning::Operation Operation}s associated with the stale + # updates are not marked as {::Google::Longrunning::Operation#done done} until + # they are obsolete. + # + # @overload set_inventory(request, options = nil) + # Pass arguments to `set_inventory` via a request object, either of type + # {::Google::Cloud::Retail::V2::SetInventoryRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Retail::V2::SetInventoryRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. + # + # @overload set_inventory(inventory: nil, set_mask: nil, set_time: nil, allow_missing: nil) + # Pass arguments to `set_inventory` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param inventory [::Google::Cloud::Retail::V2::Product, ::Hash] + # Required. The inventory information to update. The allowable fields to + # update are: + # + # * {::Google::Cloud::Retail::V2::Product#price_info Product.price_info} + # * {::Google::Cloud::Retail::V2::Product#availability Product.availability} + # * {::Google::Cloud::Retail::V2::Product#available_quantity Product.available_quantity} + # * {::Google::Cloud::Retail::V2::Product#fulfillment_info Product.fulfillment_info} + # The updated inventory fields must be specified in + # {::Google::Cloud::Retail::V2::SetInventoryRequest#set_mask SetInventoryRequest.set_mask}. + # + # If + # {::Google::Cloud::Retail::V2::Product#name SetInventoryRequest.inventory.name} + # is empty or invalid, an INVALID_ARGUMENT error is returned. + # + # If the caller does not have permission to update the + # {::Google::Cloud::Retail::V2::Product Product} named in + # {::Google::Cloud::Retail::V2::Product#name Product.name}, regardless of whether + # or not it exists, a PERMISSION_DENIED error is returned. + # + # If the {::Google::Cloud::Retail::V2::Product Product} to update does not have + # existing inventory information, the provided inventory information will be + # inserted. + # + # If the {::Google::Cloud::Retail::V2::Product Product} to update has existing + # inventory information, the provided inventory information will be merged + # while respecting the last update time for each inventory field, using the + # provided or default value for + # {::Google::Cloud::Retail::V2::SetInventoryRequest#set_time SetInventoryRequest.set_time}. + # + # The caller can replace place IDs for a subset of fulfillment types in the + # following ways: + # + # * Adds "fulfillment_info" in + # {::Google::Cloud::Retail::V2::SetInventoryRequest#set_mask SetInventoryRequest.set_mask} + # * Specifies only the desired fulfillment types and corresponding place IDs + # to update in + # {::Google::Cloud::Retail::V2::Product#fulfillment_info SetInventoryRequest.inventory.fulfillment_info} + # + # The caller can clear all place IDs from a subset of fulfillment types in + # the following ways: + # + # * Adds "fulfillment_info" in + # {::Google::Cloud::Retail::V2::SetInventoryRequest#set_mask SetInventoryRequest.set_mask} + # * Specifies only the desired fulfillment types to clear in + # {::Google::Cloud::Retail::V2::Product#fulfillment_info SetInventoryRequest.inventory.fulfillment_info} + # * Checks that only the desired fulfillment info types have empty + # {::Google::Cloud::Retail::V2::FulfillmentInfo#place_ids SetInventoryRequest.inventory.fulfillment_info.place_ids} + # + # The last update time is recorded for the following inventory fields: + # * {::Google::Cloud::Retail::V2::Product#price_info Product.price_info} + # * {::Google::Cloud::Retail::V2::Product#availability Product.availability} + # * {::Google::Cloud::Retail::V2::Product#available_quantity Product.available_quantity} + # * {::Google::Cloud::Retail::V2::Product#fulfillment_info Product.fulfillment_info} + # + # If a full overwrite of inventory information while ignoring timestamps is + # needed, + # {::Google::Cloud::Retail::V2::ProductService::Client#update_product ProductService.UpdateProduct} + # should be invoked instead. + # @param set_mask [::Google::Protobuf::FieldMask, ::Hash] + # Indicates which inventory fields in the provided + # {::Google::Cloud::Retail::V2::Product Product} to update. + # + # At least one field must be provided. + # + # If an unsupported or unknown field is provided, an INVALID_ARGUMENT error + # is returned and the entire update will be ignored. + # @param set_time [::Google::Protobuf::Timestamp, ::Hash] + # The time when the request is issued, used to prevent + # out-of-order updates on inventory fields with the last update time + # recorded. If not provided, the internal system time will be used. + # @param allow_missing [::Boolean] + # If set to true, and the {::Google::Cloud::Retail::V2::Product Product} with name + # {::Google::Cloud::Retail::V2::Product#name Product.name} is not found, the + # inventory update will still be processed and retained for at most 1 day + # until the {::Google::Cloud::Retail::V2::Product Product} is created. If set to + # false, a NOT_FOUND error is returned if the + # {::Google::Cloud::Retail::V2::Product Product} is not found. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Gapic::Operation] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Gapic::Operation] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/retail/v2" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Retail::V2::ProductService::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Retail::V2::SetInventoryRequest.new + # + # # Call the set_inventory method. + # result = client.set_inventory 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 set_inventory request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Retail::V2::SetInventoryRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + metadata = @config.rpcs.set_inventory.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::Retail::V2::VERSION + metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.inventory&.name + header_params["inventory.name"] = request.inventory.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.set_inventory.timeout, + metadata: metadata, + retry_policy: @config.rpcs.set_inventory.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @product_service_stub.call_rpc :set_inventory, 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 + + ## + # We recommend that you use the + # {::Google::Cloud::Retail::V2::ProductService::Client#add_local_inventories ProductService.AddLocalInventories} + # method instead of the + # {::Google::Cloud::Retail::V2::ProductService::Client#add_fulfillment_places ProductService.AddFulfillmentPlaces} + # method. + # {::Google::Cloud::Retail::V2::ProductService::Client#add_local_inventories ProductService.AddLocalInventories} + # achieves the same results but provides more fine-grained control over + # ingesting local inventory data. + # + # Incrementally adds place IDs to + # {::Google::Cloud::Retail::V2::FulfillmentInfo#place_ids Product.fulfillment_info.place_ids}. + # + # This process is asynchronous and does not require the + # {::Google::Cloud::Retail::V2::Product Product} to exist before updating + # fulfillment information. If the request is valid, the update will be + # enqueued and processed downstream. As a consequence, when a response is + # returned, the added place IDs are not immediately manifested in the + # {::Google::Cloud::Retail::V2::Product Product} queried by + # {::Google::Cloud::Retail::V2::ProductService::Client#get_product ProductService.GetProduct} + # or + # {::Google::Cloud::Retail::V2::ProductService::Client#list_products ProductService.ListProducts}. + # + # The returned {::Google::Longrunning::Operation Operation}s will be obsolete + # after 1 day, and GetOperation + # API will return NOT_FOUND afterwards. + # + # If conflicting updates are issued, the + # {::Google::Longrunning::Operation Operation}s associated with the stale + # updates will not be marked as {::Google::Longrunning::Operation#done done} + # until being obsolete. + # + # @overload add_fulfillment_places(request, options = nil) + # Pass arguments to `add_fulfillment_places` via a request object, either of type + # {::Google::Cloud::Retail::V2::AddFulfillmentPlacesRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Retail::V2::AddFulfillmentPlacesRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. + # + # @overload add_fulfillment_places(product: nil, type: nil, place_ids: nil, add_time: nil, allow_missing: nil) + # Pass arguments to `add_fulfillment_places` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param product [::String] + # Required. Full resource name of {::Google::Cloud::Retail::V2::Product Product}, + # such as + # `projects/*/locations/global/catalogs/default_catalog/branches/default_branch/products/some_product_id`. + # + # If the caller does not have permission to access the + # {::Google::Cloud::Retail::V2::Product Product}, regardless of whether or not it + # exists, a PERMISSION_DENIED error is returned. + # @param type [::String] + # Required. The fulfillment type, including commonly used types (such as + # pickup in store and same day delivery), and custom types. + # + # Supported values: + # + # * "pickup-in-store" + # * "ship-to-store" + # * "same-day-delivery" + # * "next-day-delivery" + # * "custom-type-1" + # * "custom-type-2" + # * "custom-type-3" + # * "custom-type-4" + # * "custom-type-5" + # + # If this field is set to an invalid value other than these, an + # INVALID_ARGUMENT error is returned. + # + # This field directly corresponds to + # {::Google::Cloud::Retail::V2::FulfillmentInfo#type Product.fulfillment_info.type}. + # @param place_ids [::Array<::String>] + # Required. The IDs for this + # {::Google::Cloud::Retail::V2::AddFulfillmentPlacesRequest#type type}, such as + # the store IDs for "pickup-in-store" or the region IDs for + # "same-day-delivery" to be added for this + # {::Google::Cloud::Retail::V2::AddFulfillmentPlacesRequest#type type}. Duplicate + # IDs will be automatically ignored. + # + # At least 1 value is required, and a maximum of 2000 values are allowed. + # Each value must be a string with a length limit of 10 characters, matching + # the pattern `[a-zA-Z0-9_-]+`, such as "store1" or "REGION-2". Otherwise, an + # INVALID_ARGUMENT error is returned. + # + # If the total number of place IDs exceeds 2000 for this + # {::Google::Cloud::Retail::V2::AddFulfillmentPlacesRequest#type type} after + # adding, then the update will be rejected. + # @param add_time [::Google::Protobuf::Timestamp, ::Hash] + # The time when the fulfillment updates are issued, used to prevent + # out-of-order updates on fulfillment information. If not provided, the + # internal system time will be used. + # @param allow_missing [::Boolean] + # If set to true, and the {::Google::Cloud::Retail::V2::Product Product} is not + # found, the fulfillment information will still be processed and retained for + # at most 1 day and processed once the + # {::Google::Cloud::Retail::V2::Product Product} is created. If set to false, a + # NOT_FOUND error is returned if the + # {::Google::Cloud::Retail::V2::Product Product} is not found. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Gapic::Operation] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Gapic::Operation] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/retail/v2" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Retail::V2::ProductService::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Retail::V2::AddFulfillmentPlacesRequest.new + # + # # Call the add_fulfillment_places method. + # result = client.add_fulfillment_places 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 add_fulfillment_places request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Retail::V2::AddFulfillmentPlacesRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + metadata = @config.rpcs.add_fulfillment_places.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::Retail::V2::VERSION + metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.product + header_params["product"] = request.product + end + + request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") + metadata[:"x-goog-request-params"] ||= request_params_header + + options.apply_defaults timeout: @config.rpcs.add_fulfillment_places.timeout, + metadata: metadata, + retry_policy: @config.rpcs.add_fulfillment_places.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @product_service_stub.call_rpc :add_fulfillment_places, 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 + + ## + # We recommend that you use the + # {::Google::Cloud::Retail::V2::ProductService::Client#remove_local_inventories ProductService.RemoveLocalInventories} + # method instead of the + # {::Google::Cloud::Retail::V2::ProductService::Client#remove_fulfillment_places ProductService.RemoveFulfillmentPlaces} + # method. + # {::Google::Cloud::Retail::V2::ProductService::Client#remove_local_inventories ProductService.RemoveLocalInventories} + # achieves the same results but provides more fine-grained control over + # ingesting local inventory data. + # + # Incrementally removes place IDs from a + # {::Google::Cloud::Retail::V2::FulfillmentInfo#place_ids Product.fulfillment_info.place_ids}. + # + # This process is asynchronous and does not require the + # {::Google::Cloud::Retail::V2::Product Product} to exist before updating + # fulfillment information. If the request is valid, the update will be + # enqueued and processed downstream. As a consequence, when a response is + # returned, the removed place IDs are not immediately manifested in the + # {::Google::Cloud::Retail::V2::Product Product} queried by + # {::Google::Cloud::Retail::V2::ProductService::Client#get_product ProductService.GetProduct} + # or + # {::Google::Cloud::Retail::V2::ProductService::Client#list_products ProductService.ListProducts}. + # + # The returned {::Google::Longrunning::Operation Operation}s will be obsolete + # after 1 day, and GetOperation + # API will return NOT_FOUND afterwards. + # + # If conflicting updates are issued, the + # {::Google::Longrunning::Operation Operation}s associated with the stale + # updates will not be marked as {::Google::Longrunning::Operation#done done} + # until being obsolete. + # + # @overload remove_fulfillment_places(request, options = nil) + # Pass arguments to `remove_fulfillment_places` via a request object, either of type + # {::Google::Cloud::Retail::V2::RemoveFulfillmentPlacesRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Retail::V2::RemoveFulfillmentPlacesRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. + # + # @overload remove_fulfillment_places(product: nil, type: nil, place_ids: nil, remove_time: nil, allow_missing: nil) + # Pass arguments to `remove_fulfillment_places` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param product [::String] + # Required. Full resource name of {::Google::Cloud::Retail::V2::Product Product}, + # such as + # `projects/*/locations/global/catalogs/default_catalog/branches/default_branch/products/some_product_id`. + # + # If the caller does not have permission to access the + # {::Google::Cloud::Retail::V2::Product Product}, regardless of whether or not it + # exists, a PERMISSION_DENIED error is returned. + # @param type [::String] + # Required. The fulfillment type, including commonly used types (such as + # pickup in store and same day delivery), and custom types. + # + # Supported values: + # + # * "pickup-in-store" + # * "ship-to-store" + # * "same-day-delivery" + # * "next-day-delivery" + # * "custom-type-1" + # * "custom-type-2" + # * "custom-type-3" + # * "custom-type-4" + # * "custom-type-5" + # + # If this field is set to an invalid value other than these, an + # INVALID_ARGUMENT error is returned. + # + # This field directly corresponds to + # {::Google::Cloud::Retail::V2::FulfillmentInfo#type Product.fulfillment_info.type}. + # @param place_ids [::Array<::String>] + # Required. The IDs for this + # {::Google::Cloud::Retail::V2::RemoveFulfillmentPlacesRequest#type type}, such as + # the store IDs for "pickup-in-store" or the region IDs for + # "same-day-delivery", to be removed for this + # {::Google::Cloud::Retail::V2::RemoveFulfillmentPlacesRequest#type type}. + # + # At least 1 value is required, and a maximum of 2000 values are allowed. + # Each value must be a string with a length limit of 10 characters, matching + # the pattern `[a-zA-Z0-9_-]+`, such as "store1" or "REGION-2". Otherwise, an + # INVALID_ARGUMENT error is returned. + # @param remove_time [::Google::Protobuf::Timestamp, ::Hash] + # The time when the fulfillment updates are issued, used to prevent + # out-of-order updates on fulfillment information. If not provided, the + # internal system time will be used. + # @param allow_missing [::Boolean] + # If set to true, and the {::Google::Cloud::Retail::V2::Product Product} is not + # found, the fulfillment information will still be processed and retained for + # at most 1 day and processed once the + # {::Google::Cloud::Retail::V2::Product Product} is created. If set to false, a + # NOT_FOUND error is returned if the + # {::Google::Cloud::Retail::V2::Product Product} is not found. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Gapic::Operation] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Gapic::Operation] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/retail/v2" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Retail::V2::ProductService::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Retail::V2::RemoveFulfillmentPlacesRequest.new + # + # # Call the remove_fulfillment_places method. + # result = client.remove_fulfillment_places 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 remove_fulfillment_places request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Retail::V2::RemoveFulfillmentPlacesRequest + + # Converts hash 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.remove_fulfillment_places.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::Retail::V2::VERSION + metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.product + header_params["product"] = request.product + 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.remove_fulfillment_places.timeout, + metadata: metadata, + retry_policy: @config.rpcs.remove_fulfillment_places.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @product_service_stub.call_rpc :remove_fulfillment_places, request, options: options do |response, operation| + response = ::Gapic::Operation.new response, @operations_client, options: options + yield response, operation if block_given? + throw :response, response + end + rescue ::GRPC::BadStatus => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Updates local inventory information for a + # {::Google::Cloud::Retail::V2::Product Product} at a list of places, while + # respecting the last update timestamps of each inventory field. + # + # This process is asynchronous and does not require the + # {::Google::Cloud::Retail::V2::Product Product} to exist before updating + # inventory information. If the request is valid, the update will be enqueued + # and processed downstream. As a consequence, when a response is returned, + # updates are not immediately manifested in the + # {::Google::Cloud::Retail::V2::Product Product} queried by + # {::Google::Cloud::Retail::V2::ProductService::Client#get_product ProductService.GetProduct} + # or + # {::Google::Cloud::Retail::V2::ProductService::Client#list_products ProductService.ListProducts}. + # + # Local inventory information can only be modified using this method. + # {::Google::Cloud::Retail::V2::ProductService::Client#create_product ProductService.CreateProduct} + # and + # {::Google::Cloud::Retail::V2::ProductService::Client#update_product ProductService.UpdateProduct} + # has no effect on local inventories. + # + # The returned {::Google::Longrunning::Operation Operation}s will be obsolete + # after 1 day, and GetOperation + # API will return NOT_FOUND afterwards. + # + # If conflicting updates are issued, the + # {::Google::Longrunning::Operation Operation}s associated with the stale + # updates will not be marked as {::Google::Longrunning::Operation#done done} + # until being obsolete. + # + # @overload add_local_inventories(request, options = nil) + # Pass arguments to `add_local_inventories` via a request object, either of type + # {::Google::Cloud::Retail::V2::AddLocalInventoriesRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Retail::V2::AddLocalInventoriesRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. + # + # @overload add_local_inventories(product: nil, local_inventories: nil, add_mask: nil, add_time: nil, allow_missing: nil) + # Pass arguments to `add_local_inventories` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param product [::String] + # Required. Full resource name of {::Google::Cloud::Retail::V2::Product Product}, + # such as + # `projects/*/locations/global/catalogs/default_catalog/branches/default_branch/products/some_product_id`. + # + # If the caller does not have permission to access the + # {::Google::Cloud::Retail::V2::Product Product}, regardless of whether or not it + # exists, a PERMISSION_DENIED error is returned. + # @param local_inventories [::Array<::Google::Cloud::Retail::V2::LocalInventory, ::Hash>] + # Required. A list of inventory information at difference places. Each place + # is identified by its place ID. At most 3000 inventories are allowed per + # request. + # @param add_mask [::Google::Protobuf::FieldMask, ::Hash] + # Indicates which inventory fields in the provided list of + # {::Google::Cloud::Retail::V2::LocalInventory LocalInventory} to update. The + # field is updated to the provided value. + # + # If a field is set while the place does not have a previous local inventory, + # the local inventory at that store is created. + # + # If a field is set while the value of that field is not provided, the + # original field value, if it exists, is deleted. + # + # If the mask is not set or set with empty paths, all inventory fields will + # be updated. + # + # If an unsupported or unknown field is provided, an INVALID_ARGUMENT error + # is returned and the entire update will be ignored. + # @param add_time [::Google::Protobuf::Timestamp, ::Hash] + # The time when the inventory updates are issued. Used to prevent + # out-of-order updates on local inventory fields. If not provided, the + # internal system time will be used. + # @param allow_missing [::Boolean] + # If set to true, and the {::Google::Cloud::Retail::V2::Product Product} is not + # found, the local inventory will still be processed and retained for at most + # 1 day and processed once the {::Google::Cloud::Retail::V2::Product Product} is + # created. If set to false, a NOT_FOUND error is returned if the + # {::Google::Cloud::Retail::V2::Product Product} is not found. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Gapic::Operation] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Gapic::Operation] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/retail/v2" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Retail::V2::ProductService::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Retail::V2::AddLocalInventoriesRequest.new + # + # # Call the add_local_inventories method. + # result = client.add_local_inventories 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 add_local_inventories request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Retail::V2::AddLocalInventoriesRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + metadata = @config.rpcs.add_local_inventories.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::Retail::V2::VERSION + metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.product + header_params["product"] = request.product + end + + request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") + metadata[:"x-goog-request-params"] ||= request_params_header + + options.apply_defaults timeout: @config.rpcs.add_local_inventories.timeout, + metadata: metadata, + retry_policy: @config.rpcs.add_local_inventories.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @product_service_stub.call_rpc :add_local_inventories, 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 + + ## + # Remove local inventory information for a + # {::Google::Cloud::Retail::V2::Product Product} at a list of places at a removal + # timestamp. + # + # This process is asynchronous. If the request is valid, the removal will be + # enqueued and processed downstream. As a consequence, when a response is + # returned, removals are not immediately manifested in the + # {::Google::Cloud::Retail::V2::Product Product} queried by + # {::Google::Cloud::Retail::V2::ProductService::Client#get_product ProductService.GetProduct} + # or + # {::Google::Cloud::Retail::V2::ProductService::Client#list_products ProductService.ListProducts}. + # + # Local inventory information can only be removed using this method. + # {::Google::Cloud::Retail::V2::ProductService::Client#create_product ProductService.CreateProduct} + # and + # {::Google::Cloud::Retail::V2::ProductService::Client#update_product ProductService.UpdateProduct} + # has no effect on local inventories. + # + # The returned {::Google::Longrunning::Operation Operation}s will be obsolete + # after 1 day, and GetOperation + # API will return NOT_FOUND afterwards. + # + # If conflicting updates are issued, the + # {::Google::Longrunning::Operation Operation}s associated with the stale + # updates will not be marked as {::Google::Longrunning::Operation#done done} + # until being obsolete. + # + # @overload remove_local_inventories(request, options = nil) + # Pass arguments to `remove_local_inventories` via a request object, either of type + # {::Google::Cloud::Retail::V2::RemoveLocalInventoriesRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Retail::V2::RemoveLocalInventoriesRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. + # + # @overload remove_local_inventories(product: nil, place_ids: nil, remove_time: nil, allow_missing: nil) + # Pass arguments to `remove_local_inventories` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param product [::String] + # Required. Full resource name of {::Google::Cloud::Retail::V2::Product Product}, + # such as + # `projects/*/locations/global/catalogs/default_catalog/branches/default_branch/products/some_product_id`. + # + # If the caller does not have permission to access the + # {::Google::Cloud::Retail::V2::Product Product}, regardless of whether or not it + # exists, a PERMISSION_DENIED error is returned. + # @param place_ids [::Array<::String>] + # Required. A list of place IDs to have their inventory deleted. + # At most 3000 place IDs are allowed per request. + # @param remove_time [::Google::Protobuf::Timestamp, ::Hash] + # The time when the inventory deletions are issued. Used to prevent + # out-of-order updates and deletions on local inventory fields. If not + # provided, the internal system time will be used. + # @param allow_missing [::Boolean] + # If set to true, and the {::Google::Cloud::Retail::V2::Product Product} is not + # found, the local inventory removal request will still be processed and + # retained for at most 1 day and processed once the + # {::Google::Cloud::Retail::V2::Product Product} is created. If set to false, a + # NOT_FOUND error is returned if the + # {::Google::Cloud::Retail::V2::Product Product} is not found. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Gapic::Operation] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Gapic::Operation] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/retail/v2" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Retail::V2::ProductService::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Retail::V2::RemoveLocalInventoriesRequest.new + # + # # Call the remove_local_inventories method. + # result = client.remove_local_inventories 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 remove_local_inventories request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Retail::V2::RemoveLocalInventoriesRequest + + # Converts hash 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.remove_local_inventories.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::Retail::V2::VERSION + metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.product + header_params["product"] = request.product + 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.remove_local_inventories.timeout, + metadata: metadata, + retry_policy: @config.rpcs.remove_local_inventories.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @product_service_stub.call_rpc :remove_local_inventories, 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 ProductService API. + # + # This class represents the configuration for ProductService, + # providing control over timeouts, retry behavior, logging, transport + # parameters, and other low-level controls. Certain parameters can also be + # applied individually to specific RPCs. See + # {::Google::Cloud::Retail::V2::ProductService::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_product to 20 seconds, + # # and all remaining timeouts to 10 seconds. + # ::Google::Cloud::Retail::V2::ProductService::Client.configure do |config| + # config.timeout = 10.0 + # config.rpcs.create_product.timeout = 20.0 + # end + # + # # Apply the above configuration only to a new client. + # client = ::Google::Cloud::Retail::V2::ProductService::Client.new do |config| + # config.timeout = 10.0 + # config.rpcs.create_product.timeout = 20.0 + # end + # + # @!attribute [rw] endpoint + # A custom service endpoint, as a hostname or hostname:port. The default is + # nil, indicating to use the default endpoint in the current universe domain. + # @return [::String,nil] + # @!attribute [rw] credentials + # Credentials to send with calls. You may provide any of the following types: + # * (`Google::Auth::Credentials`) A googleauth credentials object + # (see the [googleauth docs](https://rubydoc.info/gems/googleauth/Google/Auth/Credentials)) + # * (`Signet::OAuth2::Client`) A signet oauth2 client object + # (see the [signet docs](https://rubydoc.info/gems/signet/Signet/OAuth2/Client)) + # * (`GRPC::Core::Channel`) a gRPC channel with included credentials + # * (`GRPC::Core::ChannelCredentials`) a gRPC credentails object + # * (`nil`) indicating no credentials + # + # @note Warning: Passing a `String` to a keyfile path or a `Hash` of credentials + # is deprecated. Providing an unvalidated credential configuration to + # Google APIs can compromise the security of your systems and data. + # + # @example + # + # # The recommended way to provide credentials is to use the `make_creds` method + # # on the appropriate credentials class for your environment. + # + # require "googleauth" + # + # credentials = ::Google::Auth::ServiceAccountCredentials.make_creds( + # json_key_io: ::File.open("/path/to/keyfile.json") + # ) + # + # client = ::Google::Cloud::Retail::V2::ProductService::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 = "retail.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 ProductService 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_product` + # @return [::Gapic::Config::Method] + # + attr_reader :create_product + ## + # RPC-specific configuration for `get_product` + # @return [::Gapic::Config::Method] + # + attr_reader :get_product + ## + # RPC-specific configuration for `list_products` + # @return [::Gapic::Config::Method] + # + attr_reader :list_products + ## + # RPC-specific configuration for `update_product` + # @return [::Gapic::Config::Method] + # + attr_reader :update_product + ## + # RPC-specific configuration for `delete_product` + # @return [::Gapic::Config::Method] + # + attr_reader :delete_product + ## + # RPC-specific configuration for `purge_products` + # @return [::Gapic::Config::Method] + # + attr_reader :purge_products + ## + # RPC-specific configuration for `import_products` + # @return [::Gapic::Config::Method] + # + attr_reader :import_products + ## + # RPC-specific configuration for `set_inventory` + # @return [::Gapic::Config::Method] + # + attr_reader :set_inventory + ## + # RPC-specific configuration for `add_fulfillment_places` + # @return [::Gapic::Config::Method] + # + attr_reader :add_fulfillment_places + ## + # RPC-specific configuration for `remove_fulfillment_places` + # @return [::Gapic::Config::Method] + # + attr_reader :remove_fulfillment_places + ## + # RPC-specific configuration for `add_local_inventories` + # @return [::Gapic::Config::Method] + # + attr_reader :add_local_inventories + ## + # RPC-specific configuration for `remove_local_inventories` + # @return [::Gapic::Config::Method] + # + attr_reader :remove_local_inventories + + # @private + def initialize parent_rpcs = nil + create_product_config = parent_rpcs.create_product if parent_rpcs.respond_to? :create_product + @create_product = ::Gapic::Config::Method.new create_product_config + get_product_config = parent_rpcs.get_product if parent_rpcs.respond_to? :get_product + @get_product = ::Gapic::Config::Method.new get_product_config + list_products_config = parent_rpcs.list_products if parent_rpcs.respond_to? :list_products + @list_products = ::Gapic::Config::Method.new list_products_config + update_product_config = parent_rpcs.update_product if parent_rpcs.respond_to? :update_product + @update_product = ::Gapic::Config::Method.new update_product_config + delete_product_config = parent_rpcs.delete_product if parent_rpcs.respond_to? :delete_product + @delete_product = ::Gapic::Config::Method.new delete_product_config + purge_products_config = parent_rpcs.purge_products if parent_rpcs.respond_to? :purge_products + @purge_products = ::Gapic::Config::Method.new purge_products_config + import_products_config = parent_rpcs.import_products if parent_rpcs.respond_to? :import_products + @import_products = ::Gapic::Config::Method.new import_products_config + set_inventory_config = parent_rpcs.set_inventory if parent_rpcs.respond_to? :set_inventory + @set_inventory = ::Gapic::Config::Method.new set_inventory_config + add_fulfillment_places_config = parent_rpcs.add_fulfillment_places if parent_rpcs.respond_to? :add_fulfillment_places + @add_fulfillment_places = ::Gapic::Config::Method.new add_fulfillment_places_config + remove_fulfillment_places_config = parent_rpcs.remove_fulfillment_places if parent_rpcs.respond_to? :remove_fulfillment_places + @remove_fulfillment_places = ::Gapic::Config::Method.new remove_fulfillment_places_config + add_local_inventories_config = parent_rpcs.add_local_inventories if parent_rpcs.respond_to? :add_local_inventories + @add_local_inventories = ::Gapic::Config::Method.new add_local_inventories_config + remove_local_inventories_config = parent_rpcs.remove_local_inventories if parent_rpcs.respond_to? :remove_local_inventories + @remove_local_inventories = ::Gapic::Config::Method.new remove_local_inventories_config + + yield self if block_given? + end + end + end + end + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-retail-v2/lib/google/cloud/retail/v2/product_service/credentials.rb b/owl-bot-staging/google-cloud-retail-v2/lib/google/cloud/retail/v2/product_service/credentials.rb new file mode 100644 index 000000000000..1a4d7700391f --- /dev/null +++ b/owl-bot-staging/google-cloud-retail-v2/lib/google/cloud/retail/v2/product_service/credentials.rb @@ -0,0 +1,51 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +require "googleauth" + +module Google + module Cloud + module Retail + module V2 + module ProductService + # Credentials for the ProductService API. + class Credentials < ::Google::Auth::Credentials + self.scope = [ + "https://www.googleapis.com/auth/cloud-platform" + ] + self.env_vars = [ + "RETAIL_CREDENTIALS", + "RETAIL_KEYFILE", + "GOOGLE_CLOUD_CREDENTIALS", + "GOOGLE_CLOUD_KEYFILE", + "GCLOUD_KEYFILE", + "RETAIL_CREDENTIALS_JSON", + "RETAIL_KEYFILE_JSON", + "GOOGLE_CLOUD_CREDENTIALS_JSON", + "GOOGLE_CLOUD_KEYFILE_JSON", + "GCLOUD_KEYFILE_JSON" + ] + self.paths = [ + "~/.config/google_cloud/application_default_credentials.json" + ] + end + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-retail-v2/lib/google/cloud/retail/v2/product_service/operations.rb b/owl-bot-staging/google-cloud-retail-v2/lib/google/cloud/retail/v2/product_service/operations.rb new file mode 100644 index 000000000000..b091c3939452 --- /dev/null +++ b/owl-bot-staging/google-cloud-retail-v2/lib/google/cloud/retail/v2/product_service/operations.rb @@ -0,0 +1,841 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +require "gapic/operation" +require "google/longrunning/operations_pb" + +module Google + module Cloud + module Retail + module V2 + module ProductService + # Service that implements Longrunning Operations API. + class Operations + # @private + API_VERSION = "" + + # @private + DEFAULT_ENDPOINT_TEMPLATE = "retail.$UNIVERSE_DOMAIN$" + + # @private + attr_reader :operations_stub + + ## + # Configuration for the ProductService 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 ProductService 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::Retail::V2::VERSION + metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.name + header_params["name"] = request.name + end + + request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") + metadata[:"x-goog-request-params"] ||= request_params_header + + options.apply_defaults timeout: @config.rpcs.list_operations.timeout, + metadata: metadata, + retry_policy: @config.rpcs.list_operations.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @operations_stub.call_rpc :list_operations, request, options: options do |response, operation| + wrap_lro_operation = ->(op_response) { ::Gapic::Operation.new op_response, @operations_client } + response = ::Gapic::PagedEnumerable.new @operations_stub, :list_operations, request, response, operation, options, format_resource: wrap_lro_operation + yield response, operation if block_given? + throw :response, response + end + rescue ::GRPC::BadStatus => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Gets the latest state of a long-running operation. Clients can use this + # method to poll the operation result at intervals as recommended by the API + # service. + # + # @overload get_operation(request, options = nil) + # Pass arguments to `get_operation` via a request object, either of type + # {::Google::Longrunning::GetOperationRequest} or an equivalent Hash. + # + # @param request [::Google::Longrunning::GetOperationRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. + # + # @overload get_operation(name: nil) + # Pass arguments to `get_operation` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param name [::String] + # The name of the operation resource. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Gapic::Operation] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Gapic::Operation] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/longrunning" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Longrunning::Operations::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Longrunning::GetOperationRequest.new + # + # # Call the get_operation method. + # result = client.get_operation request + # + # # The returned object is of type Gapic::Operation. You can use it to + # # check the status of an operation, cancel it, or wait for results. + # # Here is how to wait for a response. + # result.wait_until_done! timeout: 60 + # if result.response? + # p result.response + # else + # puts "No response received." + # end + # + def get_operation request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Longrunning::GetOperationRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + metadata = @config.rpcs.get_operation.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::Retail::V2::VERSION + metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.name + header_params["name"] = request.name + end + + request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") + metadata[:"x-goog-request-params"] ||= request_params_header + + options.apply_defaults timeout: @config.rpcs.get_operation.timeout, + metadata: metadata, + retry_policy: @config.rpcs.get_operation.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @operations_stub.call_rpc :get_operation, request, options: options do |response, operation| + response = ::Gapic::Operation.new response, @operations_client, options: options + yield response, operation if block_given? + throw :response, response + end + rescue ::GRPC::BadStatus => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Deletes a long-running operation. This method indicates that the client is + # no longer interested in the operation result. It does not cancel the + # operation. If the server doesn't support this method, it returns + # `google.rpc.Code.UNIMPLEMENTED`. + # + # @overload delete_operation(request, options = nil) + # Pass arguments to `delete_operation` via a request object, either of type + # {::Google::Longrunning::DeleteOperationRequest} or an equivalent Hash. + # + # @param request [::Google::Longrunning::DeleteOperationRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. + # + # @overload delete_operation(name: nil) + # Pass arguments to `delete_operation` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param name [::String] + # The name of the operation resource to be deleted. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Google::Protobuf::Empty] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Google::Protobuf::Empty] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/longrunning" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Longrunning::Operations::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Longrunning::DeleteOperationRequest.new + # + # # Call the delete_operation method. + # result = client.delete_operation request + # + # # The returned object is of type Google::Protobuf::Empty. + # p result + # + def delete_operation request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Longrunning::DeleteOperationRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + metadata = @config.rpcs.delete_operation.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::Retail::V2::VERSION + metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.name + header_params["name"] = request.name + end + + request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") + metadata[:"x-goog-request-params"] ||= request_params_header + + options.apply_defaults timeout: @config.rpcs.delete_operation.timeout, + metadata: metadata, + retry_policy: @config.rpcs.delete_operation.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @operations_stub.call_rpc :delete_operation, request, options: options do |response, operation| + yield response, operation if block_given? + end + rescue ::GRPC::BadStatus => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Starts asynchronous cancellation on a long-running operation. The server + # makes a best effort to cancel the operation, but success is not + # guaranteed. If the server doesn't support this method, it returns + # `google.rpc.Code.UNIMPLEMENTED`. Clients can use + # Operations.GetOperation or + # other methods to check whether the cancellation succeeded or whether the + # operation completed despite cancellation. On successful cancellation, + # the operation is not deleted; instead, it becomes an operation with + # an {::Google::Longrunning::Operation#error Operation.error} value with a + # {::Google::Rpc::Status#code google.rpc.Status.code} of `1`, corresponding to + # `Code.CANCELLED`. + # + # @overload cancel_operation(request, options = nil) + # Pass arguments to `cancel_operation` via a request object, either of type + # {::Google::Longrunning::CancelOperationRequest} or an equivalent Hash. + # + # @param request [::Google::Longrunning::CancelOperationRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. + # + # @overload cancel_operation(name: nil) + # Pass arguments to `cancel_operation` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param name [::String] + # The name of the operation resource to be cancelled. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Google::Protobuf::Empty] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Google::Protobuf::Empty] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/longrunning" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Longrunning::Operations::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Longrunning::CancelOperationRequest.new + # + # # Call the cancel_operation method. + # result = client.cancel_operation request + # + # # The returned object is of type Google::Protobuf::Empty. + # p result + # + def cancel_operation request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Longrunning::CancelOperationRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + metadata = @config.rpcs.cancel_operation.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::Retail::V2::VERSION + metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.name + header_params["name"] = request.name + end + + request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") + metadata[:"x-goog-request-params"] ||= request_params_header + + options.apply_defaults timeout: @config.rpcs.cancel_operation.timeout, + metadata: metadata, + retry_policy: @config.rpcs.cancel_operation.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @operations_stub.call_rpc :cancel_operation, request, options: options do |response, operation| + yield response, operation if block_given? + end + rescue ::GRPC::BadStatus => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Waits until the specified long-running operation is done or reaches at most + # a specified timeout, returning the latest state. If the operation is + # already done, the latest state is immediately returned. If the timeout + # specified is greater than the default HTTP/RPC timeout, the HTTP/RPC + # timeout is used. If the server does not support this method, it returns + # `google.rpc.Code.UNIMPLEMENTED`. + # Note that this method is on a best-effort basis. It may return the latest + # state before the specified timeout (including immediately), meaning even an + # immediate response is no guarantee that the operation is done. + # + # @overload wait_operation(request, options = nil) + # Pass arguments to `wait_operation` via a request object, either of type + # {::Google::Longrunning::WaitOperationRequest} or an equivalent Hash. + # + # @param request [::Google::Longrunning::WaitOperationRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. + # + # @overload wait_operation(name: nil, timeout: nil) + # Pass arguments to `wait_operation` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param name [::String] + # The name of the operation resource to wait on. + # @param timeout [::Google::Protobuf::Duration, ::Hash] + # The maximum duration to wait before timing out. If left blank, the wait + # will be at most the time permitted by the underlying HTTP/RPC protocol. + # If RPC context deadline is also specified, the shorter one will be used. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Gapic::Operation] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Gapic::Operation] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/longrunning" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Longrunning::Operations::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Longrunning::WaitOperationRequest.new + # + # # Call the wait_operation method. + # result = client.wait_operation request + # + # # The returned object is of type Gapic::Operation. You can use it to + # # check the status of an operation, cancel it, or wait for results. + # # Here is how to wait for a response. + # result.wait_until_done! timeout: 60 + # if result.response? + # p result.response + # else + # puts "No response received." + # end + # + def wait_operation request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Longrunning::WaitOperationRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + metadata = @config.rpcs.wait_operation.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::Retail::V2::VERSION + metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + options.apply_defaults timeout: @config.rpcs.wait_operation.timeout, + metadata: metadata, + retry_policy: @config.rpcs.wait_operation.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @operations_stub.call_rpc :wait_operation, request, options: options do |response, operation| + response = ::Gapic::Operation.new response, @operations_client, options: options + yield response, operation if block_given? + throw :response, response + end + rescue ::GRPC::BadStatus => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Configuration class for the Operations API. + # + # This class represents the configuration for Operations, + # providing control over timeouts, retry behavior, logging, transport + # parameters, and other low-level controls. Certain parameters can also be + # applied individually to specific RPCs. See + # {::Google::Longrunning::Operations::Client::Configuration::Rpcs} + # for a list of RPCs that can be configured independently. + # + # Configuration can be applied globally to all clients, or to a single client + # on construction. + # + # @example + # + # # Modify the global config, setting the timeout for + # # list_operations to 20 seconds, + # # and all remaining timeouts to 10 seconds. + # ::Google::Longrunning::Operations::Client.configure do |config| + # config.timeout = 10.0 + # config.rpcs.list_operations.timeout = 20.0 + # end + # + # # Apply the above configuration only to a new client. + # client = ::Google::Longrunning::Operations::Client.new do |config| + # config.timeout = 10.0 + # config.rpcs.list_operations.timeout = 20.0 + # end + # + # @!attribute [rw] endpoint + # A custom service endpoint, as a hostname or hostname:port. The default is + # nil, indicating to use the default endpoint in the current universe domain. + # @return [::String,nil] + # @!attribute [rw] credentials + # Credentials to send with calls. You may provide any of the following types: + # * (`Google::Auth::Credentials`) A googleauth credentials object + # (see the [googleauth docs](https://rubydoc.info/gems/googleauth/Google/Auth/Credentials)) + # * (`Signet::OAuth2::Client`) A signet oauth2 client object + # (see the [signet docs](https://rubydoc.info/gems/signet/Signet/OAuth2/Client)) + # * (`GRPC::Core::Channel`) a gRPC channel with included credentials + # * (`GRPC::Core::ChannelCredentials`) a gRPC credentails object + # * (`nil`) indicating no credentials + # + # @note Warning: Passing a `String` to a keyfile path or a `Hash` of credentials + # is deprecated. Providing an unvalidated credential configuration to + # Google APIs can compromise the security of your systems and data. + # + # @example + # + # # The recommended way to provide credentials is to use the `make_creds` method + # # on the appropriate credentials class for your environment. + # + # require "googleauth" + # + # credentials = ::Google::Auth::ServiceAccountCredentials.make_creds( + # json_key_io: ::File.open("/path/to/keyfile.json") + # ) + # + # client = ::Google::Longrunning::Operations::Client.new do |config| + # config.credentials = credentials + # end + # + # @note Warning: If you accept a credential configuration (JSON file or Hash) from an + # external source for authentication to Google Cloud, you must validate it before + # providing it to a Google API client library. Providing an unvalidated credential + # configuration to Google APIs can compromise the security of your systems and data. + # For more information, refer to [Validate credential configurations from external + # sources](https://cloud.google.com/docs/authentication/external/externally-sourced-credentials). + # @return [::Object] + # @!attribute [rw] scope + # The OAuth scopes + # @return [::Array<::String>] + # @!attribute [rw] lib_name + # The library name as recorded in instrumentation and logging + # @return [::String] + # @!attribute [rw] lib_version + # The library version as recorded in instrumentation and logging + # @return [::String] + # @!attribute [rw] channel_args + # Extra parameters passed to the gRPC channel. Note: this is ignored if a + # `GRPC::Core::Channel` object is provided as the credential. + # @return [::Hash] + # @!attribute [rw] interceptors + # An array of interceptors that are run before calls are executed. + # @return [::Array<::GRPC::ClientInterceptor>] + # @!attribute [rw] timeout + # The call timeout in seconds. + # @return [::Numeric] + # @!attribute [rw] metadata + # Additional gRPC headers to be sent with the call. + # @return [::Hash{::Symbol=>::String}] + # @!attribute [rw] retry_policy + # The retry policy. The value is a hash with the following keys: + # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds. + # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds. + # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier. + # * `:retry_codes` (*type:* `Array`) - The error codes that should + # trigger a retry. + # @return [::Hash] + # @!attribute [rw] quota_project + # A separate project against which to charge quota. + # @return [::String] + # @!attribute [rw] universe_domain + # The universe domain within which to make requests. This determines the + # default endpoint URL. The default value of nil uses the environment + # universe (usually the default "googleapis.com" universe). + # @return [::String,nil] + # @!attribute [rw] logger + # A custom logger to use for request/response debug logging, or the value + # `:default` (the default) to construct a default logger, or `nil` to + # explicitly disable logging. + # @return [::Logger,:default,nil] + # + class Configuration + extend ::Gapic::Config + + # @private + # The endpoint specific to the default "googleapis.com" universe. Deprecated. + DEFAULT_ENDPOINT = "retail.googleapis.com" + + config_attr :endpoint, nil, ::String, nil + config_attr :credentials, nil do |value| + allowed = [::String, ::Hash, ::Proc, ::Symbol, ::Google::Auth::Credentials, ::Google::Auth::BaseClient, ::Signet::OAuth2::Client, nil] + allowed += [::GRPC::Core::Channel, ::GRPC::Core::ChannelCredentials] if defined? ::GRPC::Core::Channel + allowed.any? { |klass| klass === value } + end + config_attr :scope, nil, ::String, ::Array, nil + config_attr :lib_name, nil, ::String, nil + config_attr :lib_version, nil, ::String, nil + config_attr(:channel_args, { "grpc.service_config_disable_resolution" => 1 }, ::Hash, nil) + config_attr :interceptors, nil, ::Array, nil + config_attr :timeout, nil, ::Numeric, nil + config_attr :metadata, nil, ::Hash, nil + config_attr :retry_policy, nil, ::Hash, ::Proc, nil + config_attr :quota_project, nil, ::String, nil + config_attr :universe_domain, nil, ::String, nil + config_attr :logger, :default, ::Logger, nil, :default + + # @private + def initialize parent_config = nil + @parent_config = parent_config unless parent_config.nil? + + yield self if block_given? + end + + ## + # Configurations for individual RPCs + # @return [Rpcs] + # + def rpcs + @rpcs ||= begin + parent_rpcs = nil + parent_rpcs = @parent_config.rpcs if defined?(@parent_config) && @parent_config.respond_to?(:rpcs) + Rpcs.new parent_rpcs + end + end + + ## + # Configuration for the channel pool + # @return [::Gapic::ServiceStub::ChannelPool::Configuration] + # + def channel_pool + @channel_pool ||= ::Gapic::ServiceStub::ChannelPool::Configuration.new + end + + ## + # Configuration RPC class for the Operations API. + # + # Includes fields providing the configuration for each RPC in this service. + # Each configuration object is of type `Gapic::Config::Method` and includes + # the following configuration fields: + # + # * `timeout` (*type:* `Numeric`) - The call timeout in seconds + # * `metadata` (*type:* `Hash{Symbol=>String}`) - Additional gRPC headers + # * `retry_policy (*type:* `Hash`) - The retry policy. The policy fields + # include the following keys: + # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds. + # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds. + # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier. + # * `:retry_codes` (*type:* `Array`) - The error codes that should + # trigger a retry. + # + class Rpcs + ## + # RPC-specific configuration for `list_operations` + # @return [::Gapic::Config::Method] + # + attr_reader :list_operations + ## + # RPC-specific configuration for `get_operation` + # @return [::Gapic::Config::Method] + # + attr_reader :get_operation + ## + # RPC-specific configuration for `delete_operation` + # @return [::Gapic::Config::Method] + # + attr_reader :delete_operation + ## + # RPC-specific configuration for `cancel_operation` + # @return [::Gapic::Config::Method] + # + attr_reader :cancel_operation + ## + # RPC-specific configuration for `wait_operation` + # @return [::Gapic::Config::Method] + # + attr_reader :wait_operation + + # @private + def initialize parent_rpcs = nil + list_operations_config = parent_rpcs.list_operations if parent_rpcs.respond_to? :list_operations + @list_operations = ::Gapic::Config::Method.new list_operations_config + get_operation_config = parent_rpcs.get_operation if parent_rpcs.respond_to? :get_operation + @get_operation = ::Gapic::Config::Method.new get_operation_config + delete_operation_config = parent_rpcs.delete_operation if parent_rpcs.respond_to? :delete_operation + @delete_operation = ::Gapic::Config::Method.new delete_operation_config + cancel_operation_config = parent_rpcs.cancel_operation if parent_rpcs.respond_to? :cancel_operation + @cancel_operation = ::Gapic::Config::Method.new cancel_operation_config + wait_operation_config = parent_rpcs.wait_operation if parent_rpcs.respond_to? :wait_operation + @wait_operation = ::Gapic::Config::Method.new wait_operation_config + + yield self if block_given? + end + end + end + end + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-retail-v2/lib/google/cloud/retail/v2/product_service/paths.rb b/owl-bot-staging/google-cloud-retail-v2/lib/google/cloud/retail/v2/product_service/paths.rb new file mode 100644 index 000000000000..c0f4efbe2230 --- /dev/null +++ b/owl-bot-staging/google-cloud-retail-v2/lib/google/cloud/retail/v2/product_service/paths.rb @@ -0,0 +1,77 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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 Retail + module V2 + module ProductService + # Path helper methods for the ProductService API. + module Paths + ## + # Create a fully-qualified Branch resource string. + # + # The resource will be in the following format: + # + # `projects/{project}/locations/{location}/catalogs/{catalog}/branches/{branch}` + # + # @param project [String] + # @param location [String] + # @param catalog [String] + # @param branch [String] + # + # @return [::String] + def branch_path project:, location:, catalog:, branch: + raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" + raise ::ArgumentError, "location cannot contain /" if location.to_s.include? "/" + raise ::ArgumentError, "catalog cannot contain /" if catalog.to_s.include? "/" + + "projects/#{project}/locations/#{location}/catalogs/#{catalog}/branches/#{branch}" + end + + ## + # Create a fully-qualified Product resource string. + # + # The resource will be in the following format: + # + # `projects/{project}/locations/{location}/catalogs/{catalog}/branches/{branch}/products/{product}` + # + # @param project [String] + # @param location [String] + # @param catalog [String] + # @param branch [String] + # @param product [String] + # + # @return [::String] + def product_path project:, location:, catalog:, branch:, product: + raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" + raise ::ArgumentError, "location cannot contain /" if location.to_s.include? "/" + raise ::ArgumentError, "catalog cannot contain /" if catalog.to_s.include? "/" + raise ::ArgumentError, "branch cannot contain /" if branch.to_s.include? "/" + + "projects/#{project}/locations/#{location}/catalogs/#{catalog}/branches/#{branch}/products/#{product}" + end + + extend self + end + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-retail-v2/lib/google/cloud/retail/v2/product_service/rest.rb b/owl-bot-staging/google-cloud-retail-v2/lib/google/cloud/retail/v2/product_service/rest.rb new file mode 100644 index 000000000000..1a50a1c1e9fd --- /dev/null +++ b/owl-bot-staging/google-cloud-retail-v2/lib/google/cloud/retail/v2/product_service/rest.rb @@ -0,0 +1,54 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +require "gapic/rest" +require "gapic/config" +require "gapic/config/method" + +require "google/cloud/retail/v2/version" + +require "google/cloud/retail/v2/product_service/credentials" +require "google/cloud/retail/v2/product_service/paths" +require "google/cloud/retail/v2/product_service/rest/operations" +require "google/cloud/retail/v2/product_service/rest/client" + +module Google + module Cloud + module Retail + module V2 + ## + # Service for ingesting {::Google::Cloud::Retail::V2::Product Product} information + # of the customer's website. + # + # To load this service and instantiate a REST client: + # + # require "google/cloud/retail/v2/product_service/rest" + # client = ::Google::Cloud::Retail::V2::ProductService::Rest::Client.new + # + module ProductService + # Client for the REST transport + module Rest + end + end + end + end + end +end + +helper_path = ::File.join __dir__, "rest", "helpers.rb" +require "google/cloud/retail/v2/product_service/rest/helpers" if ::File.file? helper_path diff --git a/owl-bot-staging/google-cloud-retail-v2/lib/google/cloud/retail/v2/product_service/rest/client.rb b/owl-bot-staging/google-cloud-retail-v2/lib/google/cloud/retail/v2/product_service/rest/client.rb new file mode 100644 index 000000000000..78f4b04b610d --- /dev/null +++ b/owl-bot-staging/google-cloud-retail-v2/lib/google/cloud/retail/v2/product_service/rest/client.rb @@ -0,0 +1,2110 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +require "google/cloud/errors" +require "google/cloud/retail/v2/product_service_pb" +require "google/cloud/retail/v2/product_service/rest/service_stub" +require "google/cloud/location/rest" + +module Google + module Cloud + module Retail + module V2 + module ProductService + module Rest + ## + # REST client for the ProductService service. + # + # Service for ingesting {::Google::Cloud::Retail::V2::Product Product} information + # of the customer's website. + # + class Client + # @private + API_VERSION = "" + + # @private + DEFAULT_ENDPOINT_TEMPLATE = "retail.$UNIVERSE_DOMAIN$" + + include Paths + + # @private + attr_reader :product_service_stub + + ## + # Configure the ProductService Client class. + # + # See {::Google::Cloud::Retail::V2::ProductService::Rest::Client::Configuration} + # for a description of the configuration fields. + # + # @example + # + # # Modify the configuration for all ProductService clients + # ::Google::Cloud::Retail::V2::ProductService::Rest::Client.configure do |config| + # config.timeout = 10.0 + # end + # + # @yield [config] Configure the Client client. + # @yieldparam config [Client::Configuration] + # + # @return [Client::Configuration] + # + def self.configure + @configure ||= begin + namespace = ["Google", "Cloud", "Retail", "V2"] + parent_config = while namespace.any? + parent_name = namespace.join "::" + parent_const = const_get parent_name + break parent_const.configure if parent_const.respond_to? :configure + namespace.pop + end + default_config = Client::Configuration.new parent_config + + default_config.timeout = 30.0 + default_config.retry_policy = { + initial_delay: 0.1, max_delay: 30.0, multiplier: 1.3, retry_codes: [14, 4] + } + + default_config.rpcs.import_products.timeout = 300.0 + default_config.rpcs.import_products.retry_policy = { + initial_delay: 0.1, max_delay: 300.0, multiplier: 1.3, retry_codes: [14, 4] + } + + default_config + end + yield @configure if block_given? + @configure + end + + ## + # Configure the ProductService Client instance. + # + # The configuration is set to the derived mode, meaning that values can be changed, + # but structural changes (adding new fields, etc.) are not allowed. Structural changes + # should be made on {Client.configure}. + # + # See {::Google::Cloud::Retail::V2::ProductService::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 + @product_service_stub.universe_domain + end + + ## + # Create a new ProductService REST client object. + # + # @example + # + # # Create a client using the default configuration + # client = ::Google::Cloud::Retail::V2::ProductService::Rest::Client.new + # + # # Create a client using a custom configuration + # client = ::Google::Cloud::Retail::V2::ProductService::Rest::Client.new do |config| + # config.timeout = 10.0 + # end + # + # @yield [config] Configure the ProductService client. + # @yieldparam config [Client::Configuration] + # + def initialize + # Create the configuration object + @config = Configuration.new Client.configure + + # Yield the configuration if needed + yield @config if block_given? + + # Create credentials + credentials = @config.credentials + # Use self-signed JWT if the endpoint is unchanged from default, + # but only if the default endpoint does not have a region prefix. + enable_self_signed_jwt = @config.endpoint.nil? || + (@config.endpoint == Configuration::DEFAULT_ENDPOINT && + !@config.endpoint.split(".").first.include?("-")) + credentials ||= Credentials.default scope: @config.scope, + enable_self_signed_jwt: enable_self_signed_jwt + if credentials.is_a?(::String) || credentials.is_a?(::Hash) + credentials = Credentials.new credentials, scope: @config.scope + end + + @quota_project_id = @config.quota_project + @quota_project_id ||= credentials.quota_project_id if credentials.respond_to? :quota_project_id + + @operations_client = ::Google::Cloud::Retail::V2::ProductService::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 + + @product_service_stub = ::Google::Cloud::Retail::V2::ProductService::Rest::ServiceStub.new( + endpoint: @config.endpoint, + endpoint_template: DEFAULT_ENDPOINT_TEMPLATE, + universe_domain: @config.universe_domain, + credentials: credentials, + logger: @config.logger + ) + + @product_service_stub.logger(stub: true)&.info do |entry| + entry.set_system_name + entry.set_service + entry.message = "Created client for #{entry.service}" + entry.set_credentials_fields credentials + entry.set "customEndpoint", @config.endpoint if @config.endpoint + entry.set "defaultTimeout", @config.timeout if @config.timeout + entry.set "quotaProject", @quota_project_id if @quota_project_id + end + + @location_client = Google::Cloud::Location::Locations::Rest::Client.new do |config| + config.credentials = credentials + config.quota_project = @quota_project_id + config.endpoint = @product_service_stub.endpoint + config.universe_domain = @product_service_stub.universe_domain + config.logger = @product_service_stub.logger if config.respond_to? :logger= + end + end + + ## + # Get the associated client for long-running operations. + # + # @return [::Google::Cloud::Retail::V2::ProductService::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 + @product_service_stub.logger + end + + # Service calls + + ## + # Creates a {::Google::Cloud::Retail::V2::Product Product}. + # + # @overload create_product(request, options = nil) + # Pass arguments to `create_product` via a request object, either of type + # {::Google::Cloud::Retail::V2::CreateProductRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Retail::V2::CreateProductRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_product(parent: nil, product: nil, product_id: nil) + # Pass arguments to `create_product` via keyword arguments. Note that at + # least one keyword argument is 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 catalog resource name, such as + # `projects/*/locations/global/catalogs/default_catalog/branches/default_branch`. + # @param product [::Google::Cloud::Retail::V2::Product, ::Hash] + # Required. The {::Google::Cloud::Retail::V2::Product Product} to create. + # @param product_id [::String] + # Required. The ID to use for the {::Google::Cloud::Retail::V2::Product Product}, + # which will become the final component of the + # {::Google::Cloud::Retail::V2::Product#name Product.name}. + # + # If the caller does not have permission to create the + # {::Google::Cloud::Retail::V2::Product Product}, regardless of whether or not it + # exists, a PERMISSION_DENIED error is returned. + # + # This field must be unique among all + # {::Google::Cloud::Retail::V2::Product Product}s with the same + # {::Google::Cloud::Retail::V2::CreateProductRequest#parent parent}. Otherwise, an + # ALREADY_EXISTS error is returned. + # + # This field must be a UTF-8 encoded string with a length limit of 128 + # characters. Otherwise, an INVALID_ARGUMENT error is returned. + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Cloud::Retail::V2::Product] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::Retail::V2::Product] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/retail/v2" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Retail::V2::ProductService::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Retail::V2::CreateProductRequest.new + # + # # Call the create_product method. + # result = client.create_product request + # + # # The returned object is of type Google::Cloud::Retail::V2::Product. + # p result + # + def create_product request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Retail::V2::CreateProductRequest + + # Converts hash 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_product.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::Retail::V2::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + options.apply_defaults timeout: @config.rpcs.create_product.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.create_product.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @product_service_stub.create_product request, options do |result, operation| + yield result, operation if block_given? + end + rescue ::Gapic::Rest::Error => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Gets a {::Google::Cloud::Retail::V2::Product Product}. + # + # @overload get_product(request, options = nil) + # Pass arguments to `get_product` via a request object, either of type + # {::Google::Cloud::Retail::V2::GetProductRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Retail::V2::GetProductRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_product(name: nil) + # Pass arguments to `get_product` via keyword arguments. Note that at + # least one keyword argument is 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. Full resource name of {::Google::Cloud::Retail::V2::Product Product}, + # such as + # `projects/*/locations/global/catalogs/default_catalog/branches/default_branch/products/some_product_id`. + # + # If the caller does not have permission to access the + # {::Google::Cloud::Retail::V2::Product Product}, regardless of whether or not it + # exists, a PERMISSION_DENIED error is returned. + # + # If the requested {::Google::Cloud::Retail::V2::Product Product} does not exist, + # a NOT_FOUND error is returned. + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Cloud::Retail::V2::Product] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::Retail::V2::Product] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/retail/v2" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Retail::V2::ProductService::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Retail::V2::GetProductRequest.new + # + # # Call the get_product method. + # result = client.get_product request + # + # # The returned object is of type Google::Cloud::Retail::V2::Product. + # p result + # + def get_product request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Retail::V2::GetProductRequest + + # Converts hash 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_product.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::Retail::V2::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + options.apply_defaults timeout: @config.rpcs.get_product.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.get_product.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @product_service_stub.get_product request, options do |result, operation| + yield result, operation if block_given? + end + rescue ::Gapic::Rest::Error => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Gets a list of {::Google::Cloud::Retail::V2::Product Product}s. + # + # @overload list_products(request, options = nil) + # Pass arguments to `list_products` via a request object, either of type + # {::Google::Cloud::Retail::V2::ListProductsRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Retail::V2::ListProductsRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_products(parent: nil, page_size: nil, page_token: nil, filter: nil, read_mask: nil) + # Pass arguments to `list_products` via keyword arguments. Note that at + # least one keyword argument is 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 branch resource name, such as + # `projects/*/locations/global/catalogs/default_catalog/branches/0`. Use + # `default_branch` as the branch ID, to list products under the default + # branch. + # + # If the caller does not have permission to list + # {::Google::Cloud::Retail::V2::Product Product}s under this branch, regardless of + # whether or not this branch exists, a PERMISSION_DENIED error is returned. + # @param page_size [::Integer] + # Maximum number of {::Google::Cloud::Retail::V2::Product Product}s to return. If + # unspecified, defaults to 100. The maximum allowed value is 1000. Values + # above 1000 will be coerced to 1000. + # + # If this field is negative, an INVALID_ARGUMENT error is returned. + # @param page_token [::String] + # A page token + # {::Google::Cloud::Retail::V2::ListProductsResponse#next_page_token ListProductsResponse.next_page_token}, + # received from a previous + # {::Google::Cloud::Retail::V2::ProductService::Rest::Client#list_products ProductService.ListProducts} + # call. Provide this to retrieve the subsequent page. + # + # When paginating, all other parameters provided to + # {::Google::Cloud::Retail::V2::ProductService::Rest::Client#list_products ProductService.ListProducts} + # must match the call that provided the page token. Otherwise, an + # INVALID_ARGUMENT error is returned. + # @param filter [::String] + # A filter to apply on the list results. Supported features: + # + # * List all the products under the parent branch if + # {::Google::Cloud::Retail::V2::ListProductsRequest#filter filter} is unset. + # * List {::Google::Cloud::Retail::V2::Product::Type::VARIANT Product.Type.VARIANT} + # {::Google::Cloud::Retail::V2::Product Product}s sharing the same + # {::Google::Cloud::Retail::V2::Product::Type::PRIMARY Product.Type.PRIMARY} + # {::Google::Cloud::Retail::V2::Product Product}. For example: + # `primary_product_id = "some_product_id"` + # * List {::Google::Cloud::Retail::V2::Product Product}s bundled in a + # {::Google::Cloud::Retail::V2::Product::Type::COLLECTION Product.Type.COLLECTION} + # {::Google::Cloud::Retail::V2::Product Product}. + # For example: + # `collection_product_id = "some_product_id"` + # * List {::Google::Cloud::Retail::V2::Product Product}s with a partibular type. + # For example: + # `type = "PRIMARY"` + # `type = "VARIANT"` + # `type = "COLLECTION"` + # + # If the field is unrecognizable, an INVALID_ARGUMENT error is returned. + # + # If the specified + # {::Google::Cloud::Retail::V2::Product::Type::PRIMARY Product.Type.PRIMARY} + # {::Google::Cloud::Retail::V2::Product Product} or + # {::Google::Cloud::Retail::V2::Product::Type::COLLECTION Product.Type.COLLECTION} + # {::Google::Cloud::Retail::V2::Product Product} does not exist, a NOT_FOUND error + # is returned. + # @param read_mask [::Google::Protobuf::FieldMask, ::Hash] + # The fields of {::Google::Cloud::Retail::V2::Product Product} to return in the + # responses. If not set or empty, the following fields are returned: + # + # * {::Google::Cloud::Retail::V2::Product#name Product.name} + # * {::Google::Cloud::Retail::V2::Product#id Product.id} + # * {::Google::Cloud::Retail::V2::Product#title Product.title} + # * {::Google::Cloud::Retail::V2::Product#uri Product.uri} + # * {::Google::Cloud::Retail::V2::Product#images Product.images} + # * {::Google::Cloud::Retail::V2::Product#price_info Product.price_info} + # * {::Google::Cloud::Retail::V2::Product#brands Product.brands} + # + # If "*" is provided, all fields are returned. + # {::Google::Cloud::Retail::V2::Product#name Product.name} is always returned no + # matter what mask is set. + # + # If an unsupported or unknown field is provided, an INVALID_ARGUMENT error + # is returned. + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Gapic::Rest::PagedEnumerable<::Google::Cloud::Retail::V2::Product>] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Gapic::Rest::PagedEnumerable<::Google::Cloud::Retail::V2::Product>] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/retail/v2" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Retail::V2::ProductService::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Retail::V2::ListProductsRequest.new + # + # # Call the list_products method. + # result = client.list_products request + # + # # The returned object is of type Gapic::PagedEnumerable. You can iterate + # # over elements, and API calls will be issued to fetch pages as needed. + # result.each do |item| + # # Each element is of type ::Google::Cloud::Retail::V2::Product. + # p item + # end + # + def list_products request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Retail::V2::ListProductsRequest + + # Converts hash 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_products.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::Retail::V2::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + options.apply_defaults timeout: @config.rpcs.list_products.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.list_products.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @product_service_stub.list_products request, options do |result, operation| + result = ::Gapic::Rest::PagedEnumerable.new @product_service_stub, :list_products, "products", 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 + + ## + # Updates a {::Google::Cloud::Retail::V2::Product Product}. + # + # @overload update_product(request, options = nil) + # Pass arguments to `update_product` via a request object, either of type + # {::Google::Cloud::Retail::V2::UpdateProductRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Retail::V2::UpdateProductRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_product(product: nil, update_mask: nil, allow_missing: nil) + # Pass arguments to `update_product` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param product [::Google::Cloud::Retail::V2::Product, ::Hash] + # Required. The product to update/create. + # + # If the caller does not have permission to update the + # {::Google::Cloud::Retail::V2::Product Product}, regardless of whether or not it + # exists, a PERMISSION_DENIED error is returned. + # + # If the {::Google::Cloud::Retail::V2::Product Product} to update does not exist + # and + # {::Google::Cloud::Retail::V2::UpdateProductRequest#allow_missing allow_missing} + # is not set, a NOT_FOUND error is returned. + # @param update_mask [::Google::Protobuf::FieldMask, ::Hash] + # Indicates which fields in the provided + # {::Google::Cloud::Retail::V2::Product Product} to update. The immutable and + # output only fields are NOT supported. If not set, all supported fields (the + # fields that are neither immutable nor output only) are updated. + # + # If an unsupported or unknown field is provided, an INVALID_ARGUMENT error + # is returned. + # + # The attribute key can be updated by setting the mask path as + # "attributes.$\\{key_name}". If a key name is present in the mask but not in + # the patching product from the request, this key will be deleted after the + # update. + # @param allow_missing [::Boolean] + # If set to true, and the {::Google::Cloud::Retail::V2::Product Product} is not + # found, a new {::Google::Cloud::Retail::V2::Product Product} will be created. In + # this situation, `update_mask` is ignored. + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Cloud::Retail::V2::Product] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::Retail::V2::Product] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/retail/v2" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Retail::V2::ProductService::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Retail::V2::UpdateProductRequest.new + # + # # Call the update_product method. + # result = client.update_product request + # + # # The returned object is of type Google::Cloud::Retail::V2::Product. + # p result + # + def update_product request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Retail::V2::UpdateProductRequest + + # Converts hash 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_product.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::Retail::V2::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + options.apply_defaults timeout: @config.rpcs.update_product.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.update_product.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @product_service_stub.update_product request, options do |result, operation| + yield result, operation if block_given? + end + rescue ::Gapic::Rest::Error => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Deletes a {::Google::Cloud::Retail::V2::Product Product}. + # + # @overload delete_product(request, options = nil) + # Pass arguments to `delete_product` via a request object, either of type + # {::Google::Cloud::Retail::V2::DeleteProductRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Retail::V2::DeleteProductRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_product(name: nil) + # Pass arguments to `delete_product` via keyword arguments. Note that at + # least one keyword argument is 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. Full resource name of {::Google::Cloud::Retail::V2::Product Product}, + # such as + # `projects/*/locations/global/catalogs/default_catalog/branches/default_branch/products/some_product_id`. + # + # If the caller does not have permission to delete the + # {::Google::Cloud::Retail::V2::Product Product}, regardless of whether or not it + # exists, a PERMISSION_DENIED error is returned. + # + # If the {::Google::Cloud::Retail::V2::Product Product} to delete does not exist, + # a NOT_FOUND error is returned. + # + # The {::Google::Cloud::Retail::V2::Product Product} to delete can neither be a + # {::Google::Cloud::Retail::V2::Product::Type::COLLECTION Product.Type.COLLECTION} + # {::Google::Cloud::Retail::V2::Product Product} member nor a + # {::Google::Cloud::Retail::V2::Product::Type::PRIMARY Product.Type.PRIMARY} + # {::Google::Cloud::Retail::V2::Product Product} with more than one + # {::Google::Cloud::Retail::V2::Product::Type::VARIANT variants}. Otherwise, an + # INVALID_ARGUMENT error is returned. + # + # All inventory information for the named + # {::Google::Cloud::Retail::V2::Product Product} will 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/cloud/retail/v2" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Retail::V2::ProductService::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Retail::V2::DeleteProductRequest.new + # + # # Call the delete_product method. + # result = client.delete_product request + # + # # The returned object is of type Google::Protobuf::Empty. + # p result + # + def delete_product request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Retail::V2::DeleteProductRequest + + # Converts hash 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_product.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::Retail::V2::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + options.apply_defaults timeout: @config.rpcs.delete_product.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.delete_product.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @product_service_stub.delete_product 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 + + ## + # Permanently deletes all selected {::Google::Cloud::Retail::V2::Product Product}s + # under a branch. + # + # This process is asynchronous. If the request is valid, the removal will be + # enqueued and processed offline. Depending on the number of + # {::Google::Cloud::Retail::V2::Product Product}s, this operation could take hours + # to complete. Before the operation completes, some + # {::Google::Cloud::Retail::V2::Product Product}s may still be returned by + # {::Google::Cloud::Retail::V2::ProductService::Rest::Client#get_product ProductService.GetProduct} + # or + # {::Google::Cloud::Retail::V2::ProductService::Rest::Client#list_products ProductService.ListProducts}. + # + # Depending on the number of {::Google::Cloud::Retail::V2::Product Product}s, this + # operation could take hours to complete. To get a sample of + # {::Google::Cloud::Retail::V2::Product Product}s that would be deleted, set + # {::Google::Cloud::Retail::V2::PurgeProductsRequest#force PurgeProductsRequest.force} + # to false. + # + # @overload purge_products(request, options = nil) + # Pass arguments to `purge_products` via a request object, either of type + # {::Google::Cloud::Retail::V2::PurgeProductsRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Retail::V2::PurgeProductsRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @overload purge_products(parent: nil, filter: nil, force: nil) + # Pass arguments to `purge_products` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param parent [::String] + # Required. The resource name of the branch under which the products are + # created. The format is + # `projects/${projectId}/locations/global/catalogs/${catalogId}/branches/${branchId}` + # @param filter [::String] + # Required. The filter string to specify the products to be deleted with a + # length limit of 5,000 characters. + # + # Empty string filter is not allowed. "*" implies delete all items in a + # branch. + # + # The eligible fields for filtering are: + # + # * `availability`: Double quoted + # {::Google::Cloud::Retail::V2::Product#availability Product.availability} string. + # * `create_time` : in ISO 8601 "zulu" format. + # + # Supported syntax: + # + # * Comparators (">", "<", ">=", "<=", "="). + # Examples: + # * create_time <= "2015-02-13T17:05:46Z" + # * availability = "IN_STOCK" + # + # * Conjunctions ("AND") + # Examples: + # * create_time <= "2015-02-13T17:05:46Z" AND availability = "PREORDER" + # + # * Disjunctions ("OR") + # Examples: + # * create_time <= "2015-02-13T17:05:46Z" OR availability = "IN_STOCK" + # + # * Can support nested queries. + # Examples: + # * (create_time <= "2015-02-13T17:05:46Z" AND availability = "PREORDER") + # OR (create_time >= "2015-02-14T13:03:32Z" AND availability = "IN_STOCK") + # + # * Filter Limits: + # * Filter should not contain more than 6 conditions. + # * Max nesting depth should not exceed 2 levels. + # + # Examples queries: + # * Delete back order products created before a timestamp. + # create_time <= "2015-02-13T17:05:46Z" OR availability = "BACKORDER" + # @param force [::Boolean] + # Actually perform the purge. + # If `force` is set to false, the method will return the expected purge count + # without deleting any products. + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Gapic::Operation] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Gapic::Operation] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/retail/v2" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Retail::V2::ProductService::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Retail::V2::PurgeProductsRequest.new + # + # # Call the purge_products method. + # result = client.purge_products 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 purge_products request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Retail::V2::PurgeProductsRequest + + # Converts hash 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.purge_products.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::Retail::V2::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + options.apply_defaults timeout: @config.rpcs.purge_products.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.purge_products.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @product_service_stub.purge_products 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 + + ## + # Bulk import of multiple {::Google::Cloud::Retail::V2::Product Product}s. + # + # Request processing may be synchronous. + # Non-existing items are created. + # + # Note that it is possible for a subset of the + # {::Google::Cloud::Retail::V2::Product Product}s to be successfully updated. + # + # @overload import_products(request, options = nil) + # Pass arguments to `import_products` via a request object, either of type + # {::Google::Cloud::Retail::V2::ImportProductsRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Retail::V2::ImportProductsRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @overload import_products(parent: nil, request_id: nil, input_config: nil, errors_config: nil, update_mask: nil, reconciliation_mode: nil, notification_pubsub_topic: nil) + # Pass arguments to `import_products` via keyword arguments. Note that at + # least one keyword argument is 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. + # `projects/1234/locations/global/catalogs/default_catalog/branches/default_branch` + # + # If no updateMask is specified, requires products.create permission. + # If updateMask is specified, requires products.update permission. + # @param request_id [::String] + # Deprecated. This field has no effect. + # @param input_config [::Google::Cloud::Retail::V2::ProductInputConfig, ::Hash] + # Required. The desired input location of the data. + # @param errors_config [::Google::Cloud::Retail::V2::ImportErrorsConfig, ::Hash] + # The desired location of errors incurred during the Import. + # @param update_mask [::Google::Protobuf::FieldMask, ::Hash] + # Indicates which fields in the provided imported `products` to update. If + # not set, all fields are updated. If provided, only the existing product + # fields are updated. Missing products will not be created. + # @param reconciliation_mode [::Google::Cloud::Retail::V2::ImportProductsRequest::ReconciliationMode] + # The mode of reconciliation between existing products and the products to be + # imported. Defaults to + # {::Google::Cloud::Retail::V2::ImportProductsRequest::ReconciliationMode::INCREMENTAL ReconciliationMode.INCREMENTAL}. + # @param notification_pubsub_topic [::String] + # Full Pub/Sub topic name for receiving notification. If this field is set, + # when the import is finished, a notification is sent to + # specified Pub/Sub topic. The message data is JSON string of a + # {::Google::Longrunning::Operation Operation}. + # + # Format of the Pub/Sub topic is `projects/{project}/topics/{topic}`. It has + # to be within the same project as + # {::Google::Cloud::Retail::V2::ImportProductsRequest#parent ImportProductsRequest.parent}. + # Make sure that both + # `cloud-retail-customer-data-access@system.gserviceaccount.com` and + # `service-@gcp-sa-retail.iam.gserviceaccount.com` + # have the `pubsub.topics.publish` IAM permission on the topic. + # + # Only supported when + # {::Google::Cloud::Retail::V2::ImportProductsRequest#reconciliation_mode ImportProductsRequest.reconciliation_mode} + # is set to `FULL`. + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Gapic::Operation] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Gapic::Operation] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/retail/v2" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Retail::V2::ProductService::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Retail::V2::ImportProductsRequest.new + # + # # Call the import_products method. + # result = client.import_products 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 import_products request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Retail::V2::ImportProductsRequest + + # Converts hash 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.import_products.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::Retail::V2::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + options.apply_defaults timeout: @config.rpcs.import_products.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.import_products.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @product_service_stub.import_products 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 + + ## + # Updates inventory information for a + # {::Google::Cloud::Retail::V2::Product Product} while respecting the last update + # timestamps of each inventory field. + # + # This process is asynchronous and does not require the + # {::Google::Cloud::Retail::V2::Product Product} to exist before updating + # fulfillment information. If the request is valid, the update is enqueued + # and processed downstream. As a consequence, when a response is returned, + # updates are not immediately manifested in the + # {::Google::Cloud::Retail::V2::Product Product} queried by + # {::Google::Cloud::Retail::V2::ProductService::Rest::Client#get_product ProductService.GetProduct} + # or + # {::Google::Cloud::Retail::V2::ProductService::Rest::Client#list_products ProductService.ListProducts}. + # + # When inventory is updated with + # {::Google::Cloud::Retail::V2::ProductService::Rest::Client#create_product ProductService.CreateProduct} + # and + # {::Google::Cloud::Retail::V2::ProductService::Rest::Client#update_product ProductService.UpdateProduct}, + # the specified inventory field value(s) overwrite any existing value(s) + # while ignoring the last update time for this field. Furthermore, the last + # update times for the specified inventory fields are overwritten by the + # times of the + # {::Google::Cloud::Retail::V2::ProductService::Rest::Client#create_product ProductService.CreateProduct} + # or + # {::Google::Cloud::Retail::V2::ProductService::Rest::Client#update_product ProductService.UpdateProduct} + # request. + # + # If no inventory fields are set in + # {::Google::Cloud::Retail::V2::CreateProductRequest#product CreateProductRequest.product}, + # then any pre-existing inventory information for this product is used. + # + # If no inventory fields are set in + # {::Google::Cloud::Retail::V2::SetInventoryRequest#set_mask SetInventoryRequest.set_mask}, + # then any existing inventory information is preserved. + # + # Pre-existing inventory information can only be updated with + # {::Google::Cloud::Retail::V2::ProductService::Rest::Client#set_inventory ProductService.SetInventory}, + # {::Google::Cloud::Retail::V2::ProductService::Rest::Client#add_fulfillment_places ProductService.AddFulfillmentPlaces}, + # and + # {::Google::Cloud::Retail::V2::ProductService::Rest::Client#remove_fulfillment_places ProductService.RemoveFulfillmentPlaces}. + # + # The returned {::Google::Longrunning::Operation Operation}s is obsolete after + # one day, and the GetOperation + # API returns `NOT_FOUND` afterwards. + # + # If conflicting updates are issued, the + # {::Google::Longrunning::Operation Operation}s associated with the stale + # updates are not marked as {::Google::Longrunning::Operation#done done} until + # they are obsolete. + # + # @overload set_inventory(request, options = nil) + # Pass arguments to `set_inventory` via a request object, either of type + # {::Google::Cloud::Retail::V2::SetInventoryRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Retail::V2::SetInventoryRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @overload set_inventory(inventory: nil, set_mask: nil, set_time: nil, allow_missing: nil) + # Pass arguments to `set_inventory` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param inventory [::Google::Cloud::Retail::V2::Product, ::Hash] + # Required. The inventory information to update. The allowable fields to + # update are: + # + # * {::Google::Cloud::Retail::V2::Product#price_info Product.price_info} + # * {::Google::Cloud::Retail::V2::Product#availability Product.availability} + # * {::Google::Cloud::Retail::V2::Product#available_quantity Product.available_quantity} + # * {::Google::Cloud::Retail::V2::Product#fulfillment_info Product.fulfillment_info} + # The updated inventory fields must be specified in + # {::Google::Cloud::Retail::V2::SetInventoryRequest#set_mask SetInventoryRequest.set_mask}. + # + # If + # {::Google::Cloud::Retail::V2::Product#name SetInventoryRequest.inventory.name} + # is empty or invalid, an INVALID_ARGUMENT error is returned. + # + # If the caller does not have permission to update the + # {::Google::Cloud::Retail::V2::Product Product} named in + # {::Google::Cloud::Retail::V2::Product#name Product.name}, regardless of whether + # or not it exists, a PERMISSION_DENIED error is returned. + # + # If the {::Google::Cloud::Retail::V2::Product Product} to update does not have + # existing inventory information, the provided inventory information will be + # inserted. + # + # If the {::Google::Cloud::Retail::V2::Product Product} to update has existing + # inventory information, the provided inventory information will be merged + # while respecting the last update time for each inventory field, using the + # provided or default value for + # {::Google::Cloud::Retail::V2::SetInventoryRequest#set_time SetInventoryRequest.set_time}. + # + # The caller can replace place IDs for a subset of fulfillment types in the + # following ways: + # + # * Adds "fulfillment_info" in + # {::Google::Cloud::Retail::V2::SetInventoryRequest#set_mask SetInventoryRequest.set_mask} + # * Specifies only the desired fulfillment types and corresponding place IDs + # to update in + # {::Google::Cloud::Retail::V2::Product#fulfillment_info SetInventoryRequest.inventory.fulfillment_info} + # + # The caller can clear all place IDs from a subset of fulfillment types in + # the following ways: + # + # * Adds "fulfillment_info" in + # {::Google::Cloud::Retail::V2::SetInventoryRequest#set_mask SetInventoryRequest.set_mask} + # * Specifies only the desired fulfillment types to clear in + # {::Google::Cloud::Retail::V2::Product#fulfillment_info SetInventoryRequest.inventory.fulfillment_info} + # * Checks that only the desired fulfillment info types have empty + # {::Google::Cloud::Retail::V2::FulfillmentInfo#place_ids SetInventoryRequest.inventory.fulfillment_info.place_ids} + # + # The last update time is recorded for the following inventory fields: + # * {::Google::Cloud::Retail::V2::Product#price_info Product.price_info} + # * {::Google::Cloud::Retail::V2::Product#availability Product.availability} + # * {::Google::Cloud::Retail::V2::Product#available_quantity Product.available_quantity} + # * {::Google::Cloud::Retail::V2::Product#fulfillment_info Product.fulfillment_info} + # + # If a full overwrite of inventory information while ignoring timestamps is + # needed, + # {::Google::Cloud::Retail::V2::ProductService::Rest::Client#update_product ProductService.UpdateProduct} + # should be invoked instead. + # @param set_mask [::Google::Protobuf::FieldMask, ::Hash] + # Indicates which inventory fields in the provided + # {::Google::Cloud::Retail::V2::Product Product} to update. + # + # At least one field must be provided. + # + # If an unsupported or unknown field is provided, an INVALID_ARGUMENT error + # is returned and the entire update will be ignored. + # @param set_time [::Google::Protobuf::Timestamp, ::Hash] + # The time when the request is issued, used to prevent + # out-of-order updates on inventory fields with the last update time + # recorded. If not provided, the internal system time will be used. + # @param allow_missing [::Boolean] + # If set to true, and the {::Google::Cloud::Retail::V2::Product Product} with name + # {::Google::Cloud::Retail::V2::Product#name Product.name} is not found, the + # inventory update will still be processed and retained for at most 1 day + # until the {::Google::Cloud::Retail::V2::Product Product} is created. If set to + # false, a NOT_FOUND error is returned if the + # {::Google::Cloud::Retail::V2::Product Product} is not found. + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Gapic::Operation] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Gapic::Operation] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/retail/v2" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Retail::V2::ProductService::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Retail::V2::SetInventoryRequest.new + # + # # Call the set_inventory method. + # result = client.set_inventory 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 set_inventory request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Retail::V2::SetInventoryRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + call_metadata = @config.rpcs.set_inventory.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::Retail::V2::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + options.apply_defaults timeout: @config.rpcs.set_inventory.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.set_inventory.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @product_service_stub.set_inventory 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 + + ## + # We recommend that you use the + # {::Google::Cloud::Retail::V2::ProductService::Rest::Client#add_local_inventories ProductService.AddLocalInventories} + # method instead of the + # {::Google::Cloud::Retail::V2::ProductService::Rest::Client#add_fulfillment_places ProductService.AddFulfillmentPlaces} + # method. + # {::Google::Cloud::Retail::V2::ProductService::Rest::Client#add_local_inventories ProductService.AddLocalInventories} + # achieves the same results but provides more fine-grained control over + # ingesting local inventory data. + # + # Incrementally adds place IDs to + # {::Google::Cloud::Retail::V2::FulfillmentInfo#place_ids Product.fulfillment_info.place_ids}. + # + # This process is asynchronous and does not require the + # {::Google::Cloud::Retail::V2::Product Product} to exist before updating + # fulfillment information. If the request is valid, the update will be + # enqueued and processed downstream. As a consequence, when a response is + # returned, the added place IDs are not immediately manifested in the + # {::Google::Cloud::Retail::V2::Product Product} queried by + # {::Google::Cloud::Retail::V2::ProductService::Rest::Client#get_product ProductService.GetProduct} + # or + # {::Google::Cloud::Retail::V2::ProductService::Rest::Client#list_products ProductService.ListProducts}. + # + # The returned {::Google::Longrunning::Operation Operation}s will be obsolete + # after 1 day, and GetOperation + # API will return NOT_FOUND afterwards. + # + # If conflicting updates are issued, the + # {::Google::Longrunning::Operation Operation}s associated with the stale + # updates will not be marked as {::Google::Longrunning::Operation#done done} + # until being obsolete. + # + # @overload add_fulfillment_places(request, options = nil) + # Pass arguments to `add_fulfillment_places` via a request object, either of type + # {::Google::Cloud::Retail::V2::AddFulfillmentPlacesRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Retail::V2::AddFulfillmentPlacesRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @overload add_fulfillment_places(product: nil, type: nil, place_ids: nil, add_time: nil, allow_missing: nil) + # Pass arguments to `add_fulfillment_places` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param product [::String] + # Required. Full resource name of {::Google::Cloud::Retail::V2::Product Product}, + # such as + # `projects/*/locations/global/catalogs/default_catalog/branches/default_branch/products/some_product_id`. + # + # If the caller does not have permission to access the + # {::Google::Cloud::Retail::V2::Product Product}, regardless of whether or not it + # exists, a PERMISSION_DENIED error is returned. + # @param type [::String] + # Required. The fulfillment type, including commonly used types (such as + # pickup in store and same day delivery), and custom types. + # + # Supported values: + # + # * "pickup-in-store" + # * "ship-to-store" + # * "same-day-delivery" + # * "next-day-delivery" + # * "custom-type-1" + # * "custom-type-2" + # * "custom-type-3" + # * "custom-type-4" + # * "custom-type-5" + # + # If this field is set to an invalid value other than these, an + # INVALID_ARGUMENT error is returned. + # + # This field directly corresponds to + # {::Google::Cloud::Retail::V2::FulfillmentInfo#type Product.fulfillment_info.type}. + # @param place_ids [::Array<::String>] + # Required. The IDs for this + # {::Google::Cloud::Retail::V2::AddFulfillmentPlacesRequest#type type}, such as + # the store IDs for "pickup-in-store" or the region IDs for + # "same-day-delivery" to be added for this + # {::Google::Cloud::Retail::V2::AddFulfillmentPlacesRequest#type type}. Duplicate + # IDs will be automatically ignored. + # + # At least 1 value is required, and a maximum of 2000 values are allowed. + # Each value must be a string with a length limit of 10 characters, matching + # the pattern `[a-zA-Z0-9_-]+`, such as "store1" or "REGION-2". Otherwise, an + # INVALID_ARGUMENT error is returned. + # + # If the total number of place IDs exceeds 2000 for this + # {::Google::Cloud::Retail::V2::AddFulfillmentPlacesRequest#type type} after + # adding, then the update will be rejected. + # @param add_time [::Google::Protobuf::Timestamp, ::Hash] + # The time when the fulfillment updates are issued, used to prevent + # out-of-order updates on fulfillment information. If not provided, the + # internal system time will be used. + # @param allow_missing [::Boolean] + # If set to true, and the {::Google::Cloud::Retail::V2::Product Product} is not + # found, the fulfillment information will still be processed and retained for + # at most 1 day and processed once the + # {::Google::Cloud::Retail::V2::Product Product} is created. If set to false, a + # NOT_FOUND error is returned if the + # {::Google::Cloud::Retail::V2::Product Product} is not found. + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Gapic::Operation] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Gapic::Operation] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/retail/v2" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Retail::V2::ProductService::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Retail::V2::AddFulfillmentPlacesRequest.new + # + # # Call the add_fulfillment_places method. + # result = client.add_fulfillment_places 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 add_fulfillment_places request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Retail::V2::AddFulfillmentPlacesRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + call_metadata = @config.rpcs.add_fulfillment_places.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::Retail::V2::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + options.apply_defaults timeout: @config.rpcs.add_fulfillment_places.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.add_fulfillment_places.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @product_service_stub.add_fulfillment_places 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 + + ## + # We recommend that you use the + # {::Google::Cloud::Retail::V2::ProductService::Rest::Client#remove_local_inventories ProductService.RemoveLocalInventories} + # method instead of the + # {::Google::Cloud::Retail::V2::ProductService::Rest::Client#remove_fulfillment_places ProductService.RemoveFulfillmentPlaces} + # method. + # {::Google::Cloud::Retail::V2::ProductService::Rest::Client#remove_local_inventories ProductService.RemoveLocalInventories} + # achieves the same results but provides more fine-grained control over + # ingesting local inventory data. + # + # Incrementally removes place IDs from a + # {::Google::Cloud::Retail::V2::FulfillmentInfo#place_ids Product.fulfillment_info.place_ids}. + # + # This process is asynchronous and does not require the + # {::Google::Cloud::Retail::V2::Product Product} to exist before updating + # fulfillment information. If the request is valid, the update will be + # enqueued and processed downstream. As a consequence, when a response is + # returned, the removed place IDs are not immediately manifested in the + # {::Google::Cloud::Retail::V2::Product Product} queried by + # {::Google::Cloud::Retail::V2::ProductService::Rest::Client#get_product ProductService.GetProduct} + # or + # {::Google::Cloud::Retail::V2::ProductService::Rest::Client#list_products ProductService.ListProducts}. + # + # The returned {::Google::Longrunning::Operation Operation}s will be obsolete + # after 1 day, and GetOperation + # API will return NOT_FOUND afterwards. + # + # If conflicting updates are issued, the + # {::Google::Longrunning::Operation Operation}s associated with the stale + # updates will not be marked as {::Google::Longrunning::Operation#done done} + # until being obsolete. + # + # @overload remove_fulfillment_places(request, options = nil) + # Pass arguments to `remove_fulfillment_places` via a request object, either of type + # {::Google::Cloud::Retail::V2::RemoveFulfillmentPlacesRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Retail::V2::RemoveFulfillmentPlacesRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @overload remove_fulfillment_places(product: nil, type: nil, place_ids: nil, remove_time: nil, allow_missing: nil) + # Pass arguments to `remove_fulfillment_places` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param product [::String] + # Required. Full resource name of {::Google::Cloud::Retail::V2::Product Product}, + # such as + # `projects/*/locations/global/catalogs/default_catalog/branches/default_branch/products/some_product_id`. + # + # If the caller does not have permission to access the + # {::Google::Cloud::Retail::V2::Product Product}, regardless of whether or not it + # exists, a PERMISSION_DENIED error is returned. + # @param type [::String] + # Required. The fulfillment type, including commonly used types (such as + # pickup in store and same day delivery), and custom types. + # + # Supported values: + # + # * "pickup-in-store" + # * "ship-to-store" + # * "same-day-delivery" + # * "next-day-delivery" + # * "custom-type-1" + # * "custom-type-2" + # * "custom-type-3" + # * "custom-type-4" + # * "custom-type-5" + # + # If this field is set to an invalid value other than these, an + # INVALID_ARGUMENT error is returned. + # + # This field directly corresponds to + # {::Google::Cloud::Retail::V2::FulfillmentInfo#type Product.fulfillment_info.type}. + # @param place_ids [::Array<::String>] + # Required. The IDs for this + # {::Google::Cloud::Retail::V2::RemoveFulfillmentPlacesRequest#type type}, such as + # the store IDs for "pickup-in-store" or the region IDs for + # "same-day-delivery", to be removed for this + # {::Google::Cloud::Retail::V2::RemoveFulfillmentPlacesRequest#type type}. + # + # At least 1 value is required, and a maximum of 2000 values are allowed. + # Each value must be a string with a length limit of 10 characters, matching + # the pattern `[a-zA-Z0-9_-]+`, such as "store1" or "REGION-2". Otherwise, an + # INVALID_ARGUMENT error is returned. + # @param remove_time [::Google::Protobuf::Timestamp, ::Hash] + # The time when the fulfillment updates are issued, used to prevent + # out-of-order updates on fulfillment information. If not provided, the + # internal system time will be used. + # @param allow_missing [::Boolean] + # If set to true, and the {::Google::Cloud::Retail::V2::Product Product} is not + # found, the fulfillment information will still be processed and retained for + # at most 1 day and processed once the + # {::Google::Cloud::Retail::V2::Product Product} is created. If set to false, a + # NOT_FOUND error is returned if the + # {::Google::Cloud::Retail::V2::Product Product} is not found. + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Gapic::Operation] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Gapic::Operation] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/retail/v2" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Retail::V2::ProductService::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Retail::V2::RemoveFulfillmentPlacesRequest.new + # + # # Call the remove_fulfillment_places method. + # result = client.remove_fulfillment_places 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 remove_fulfillment_places request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Retail::V2::RemoveFulfillmentPlacesRequest + + # Converts hash 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.remove_fulfillment_places.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::Retail::V2::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + options.apply_defaults timeout: @config.rpcs.remove_fulfillment_places.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.remove_fulfillment_places.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @product_service_stub.remove_fulfillment_places 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 + + ## + # Updates local inventory information for a + # {::Google::Cloud::Retail::V2::Product Product} at a list of places, while + # respecting the last update timestamps of each inventory field. + # + # This process is asynchronous and does not require the + # {::Google::Cloud::Retail::V2::Product Product} to exist before updating + # inventory information. If the request is valid, the update will be enqueued + # and processed downstream. As a consequence, when a response is returned, + # updates are not immediately manifested in the + # {::Google::Cloud::Retail::V2::Product Product} queried by + # {::Google::Cloud::Retail::V2::ProductService::Rest::Client#get_product ProductService.GetProduct} + # or + # {::Google::Cloud::Retail::V2::ProductService::Rest::Client#list_products ProductService.ListProducts}. + # + # Local inventory information can only be modified using this method. + # {::Google::Cloud::Retail::V2::ProductService::Rest::Client#create_product ProductService.CreateProduct} + # and + # {::Google::Cloud::Retail::V2::ProductService::Rest::Client#update_product ProductService.UpdateProduct} + # has no effect on local inventories. + # + # The returned {::Google::Longrunning::Operation Operation}s will be obsolete + # after 1 day, and GetOperation + # API will return NOT_FOUND afterwards. + # + # If conflicting updates are issued, the + # {::Google::Longrunning::Operation Operation}s associated with the stale + # updates will not be marked as {::Google::Longrunning::Operation#done done} + # until being obsolete. + # + # @overload add_local_inventories(request, options = nil) + # Pass arguments to `add_local_inventories` via a request object, either of type + # {::Google::Cloud::Retail::V2::AddLocalInventoriesRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Retail::V2::AddLocalInventoriesRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @overload add_local_inventories(product: nil, local_inventories: nil, add_mask: nil, add_time: nil, allow_missing: nil) + # Pass arguments to `add_local_inventories` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param product [::String] + # Required. Full resource name of {::Google::Cloud::Retail::V2::Product Product}, + # such as + # `projects/*/locations/global/catalogs/default_catalog/branches/default_branch/products/some_product_id`. + # + # If the caller does not have permission to access the + # {::Google::Cloud::Retail::V2::Product Product}, regardless of whether or not it + # exists, a PERMISSION_DENIED error is returned. + # @param local_inventories [::Array<::Google::Cloud::Retail::V2::LocalInventory, ::Hash>] + # Required. A list of inventory information at difference places. Each place + # is identified by its place ID. At most 3000 inventories are allowed per + # request. + # @param add_mask [::Google::Protobuf::FieldMask, ::Hash] + # Indicates which inventory fields in the provided list of + # {::Google::Cloud::Retail::V2::LocalInventory LocalInventory} to update. The + # field is updated to the provided value. + # + # If a field is set while the place does not have a previous local inventory, + # the local inventory at that store is created. + # + # If a field is set while the value of that field is not provided, the + # original field value, if it exists, is deleted. + # + # If the mask is not set or set with empty paths, all inventory fields will + # be updated. + # + # If an unsupported or unknown field is provided, an INVALID_ARGUMENT error + # is returned and the entire update will be ignored. + # @param add_time [::Google::Protobuf::Timestamp, ::Hash] + # The time when the inventory updates are issued. Used to prevent + # out-of-order updates on local inventory fields. If not provided, the + # internal system time will be used. + # @param allow_missing [::Boolean] + # If set to true, and the {::Google::Cloud::Retail::V2::Product Product} is not + # found, the local inventory will still be processed and retained for at most + # 1 day and processed once the {::Google::Cloud::Retail::V2::Product Product} is + # created. If set to false, a NOT_FOUND error is returned if the + # {::Google::Cloud::Retail::V2::Product Product} is not found. + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Gapic::Operation] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Gapic::Operation] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/retail/v2" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Retail::V2::ProductService::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Retail::V2::AddLocalInventoriesRequest.new + # + # # Call the add_local_inventories method. + # result = client.add_local_inventories 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 add_local_inventories request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Retail::V2::AddLocalInventoriesRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + call_metadata = @config.rpcs.add_local_inventories.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::Retail::V2::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + options.apply_defaults timeout: @config.rpcs.add_local_inventories.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.add_local_inventories.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @product_service_stub.add_local_inventories 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 + + ## + # Remove local inventory information for a + # {::Google::Cloud::Retail::V2::Product Product} at a list of places at a removal + # timestamp. + # + # This process is asynchronous. If the request is valid, the removal will be + # enqueued and processed downstream. As a consequence, when a response is + # returned, removals are not immediately manifested in the + # {::Google::Cloud::Retail::V2::Product Product} queried by + # {::Google::Cloud::Retail::V2::ProductService::Rest::Client#get_product ProductService.GetProduct} + # or + # {::Google::Cloud::Retail::V2::ProductService::Rest::Client#list_products ProductService.ListProducts}. + # + # Local inventory information can only be removed using this method. + # {::Google::Cloud::Retail::V2::ProductService::Rest::Client#create_product ProductService.CreateProduct} + # and + # {::Google::Cloud::Retail::V2::ProductService::Rest::Client#update_product ProductService.UpdateProduct} + # has no effect on local inventories. + # + # The returned {::Google::Longrunning::Operation Operation}s will be obsolete + # after 1 day, and GetOperation + # API will return NOT_FOUND afterwards. + # + # If conflicting updates are issued, the + # {::Google::Longrunning::Operation Operation}s associated with the stale + # updates will not be marked as {::Google::Longrunning::Operation#done done} + # until being obsolete. + # + # @overload remove_local_inventories(request, options = nil) + # Pass arguments to `remove_local_inventories` via a request object, either of type + # {::Google::Cloud::Retail::V2::RemoveLocalInventoriesRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Retail::V2::RemoveLocalInventoriesRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @overload remove_local_inventories(product: nil, place_ids: nil, remove_time: nil, allow_missing: nil) + # Pass arguments to `remove_local_inventories` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param product [::String] + # Required. Full resource name of {::Google::Cloud::Retail::V2::Product Product}, + # such as + # `projects/*/locations/global/catalogs/default_catalog/branches/default_branch/products/some_product_id`. + # + # If the caller does not have permission to access the + # {::Google::Cloud::Retail::V2::Product Product}, regardless of whether or not it + # exists, a PERMISSION_DENIED error is returned. + # @param place_ids [::Array<::String>] + # Required. A list of place IDs to have their inventory deleted. + # At most 3000 place IDs are allowed per request. + # @param remove_time [::Google::Protobuf::Timestamp, ::Hash] + # The time when the inventory deletions are issued. Used to prevent + # out-of-order updates and deletions on local inventory fields. If not + # provided, the internal system time will be used. + # @param allow_missing [::Boolean] + # If set to true, and the {::Google::Cloud::Retail::V2::Product Product} is not + # found, the local inventory removal request will still be processed and + # retained for at most 1 day and processed once the + # {::Google::Cloud::Retail::V2::Product Product} is created. If set to false, a + # NOT_FOUND error is returned if the + # {::Google::Cloud::Retail::V2::Product Product} is not found. + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Gapic::Operation] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Gapic::Operation] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/retail/v2" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Retail::V2::ProductService::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Retail::V2::RemoveLocalInventoriesRequest.new + # + # # Call the remove_local_inventories method. + # result = client.remove_local_inventories 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 remove_local_inventories request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Retail::V2::RemoveLocalInventoriesRequest + + # Converts hash 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.remove_local_inventories.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::Retail::V2::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + options.apply_defaults timeout: @config.rpcs.remove_local_inventories.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.remove_local_inventories.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @product_service_stub.remove_local_inventories 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 + + ## + # Configuration class for the ProductService REST API. + # + # This class represents the configuration for ProductService REST, + # providing control over timeouts, retry behavior, logging, transport + # parameters, and other low-level controls. Certain parameters can also be + # applied individually to specific RPCs. See + # {::Google::Cloud::Retail::V2::ProductService::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_product to 20 seconds, + # # and all remaining timeouts to 10 seconds. + # ::Google::Cloud::Retail::V2::ProductService::Rest::Client.configure do |config| + # config.timeout = 10.0 + # config.rpcs.create_product.timeout = 20.0 + # end + # + # # Apply the above configuration only to a new client. + # client = ::Google::Cloud::Retail::V2::ProductService::Rest::Client.new do |config| + # config.timeout = 10.0 + # config.rpcs.create_product.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 = "retail.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 ProductService 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_product` + # @return [::Gapic::Config::Method] + # + attr_reader :create_product + ## + # RPC-specific configuration for `get_product` + # @return [::Gapic::Config::Method] + # + attr_reader :get_product + ## + # RPC-specific configuration for `list_products` + # @return [::Gapic::Config::Method] + # + attr_reader :list_products + ## + # RPC-specific configuration for `update_product` + # @return [::Gapic::Config::Method] + # + attr_reader :update_product + ## + # RPC-specific configuration for `delete_product` + # @return [::Gapic::Config::Method] + # + attr_reader :delete_product + ## + # RPC-specific configuration for `purge_products` + # @return [::Gapic::Config::Method] + # + attr_reader :purge_products + ## + # RPC-specific configuration for `import_products` + # @return [::Gapic::Config::Method] + # + attr_reader :import_products + ## + # RPC-specific configuration for `set_inventory` + # @return [::Gapic::Config::Method] + # + attr_reader :set_inventory + ## + # RPC-specific configuration for `add_fulfillment_places` + # @return [::Gapic::Config::Method] + # + attr_reader :add_fulfillment_places + ## + # RPC-specific configuration for `remove_fulfillment_places` + # @return [::Gapic::Config::Method] + # + attr_reader :remove_fulfillment_places + ## + # RPC-specific configuration for `add_local_inventories` + # @return [::Gapic::Config::Method] + # + attr_reader :add_local_inventories + ## + # RPC-specific configuration for `remove_local_inventories` + # @return [::Gapic::Config::Method] + # + attr_reader :remove_local_inventories + + # @private + def initialize parent_rpcs = nil + create_product_config = parent_rpcs.create_product if parent_rpcs.respond_to? :create_product + @create_product = ::Gapic::Config::Method.new create_product_config + get_product_config = parent_rpcs.get_product if parent_rpcs.respond_to? :get_product + @get_product = ::Gapic::Config::Method.new get_product_config + list_products_config = parent_rpcs.list_products if parent_rpcs.respond_to? :list_products + @list_products = ::Gapic::Config::Method.new list_products_config + update_product_config = parent_rpcs.update_product if parent_rpcs.respond_to? :update_product + @update_product = ::Gapic::Config::Method.new update_product_config + delete_product_config = parent_rpcs.delete_product if parent_rpcs.respond_to? :delete_product + @delete_product = ::Gapic::Config::Method.new delete_product_config + purge_products_config = parent_rpcs.purge_products if parent_rpcs.respond_to? :purge_products + @purge_products = ::Gapic::Config::Method.new purge_products_config + import_products_config = parent_rpcs.import_products if parent_rpcs.respond_to? :import_products + @import_products = ::Gapic::Config::Method.new import_products_config + set_inventory_config = parent_rpcs.set_inventory if parent_rpcs.respond_to? :set_inventory + @set_inventory = ::Gapic::Config::Method.new set_inventory_config + add_fulfillment_places_config = parent_rpcs.add_fulfillment_places if parent_rpcs.respond_to? :add_fulfillment_places + @add_fulfillment_places = ::Gapic::Config::Method.new add_fulfillment_places_config + remove_fulfillment_places_config = parent_rpcs.remove_fulfillment_places if parent_rpcs.respond_to? :remove_fulfillment_places + @remove_fulfillment_places = ::Gapic::Config::Method.new remove_fulfillment_places_config + add_local_inventories_config = parent_rpcs.add_local_inventories if parent_rpcs.respond_to? :add_local_inventories + @add_local_inventories = ::Gapic::Config::Method.new add_local_inventories_config + remove_local_inventories_config = parent_rpcs.remove_local_inventories if parent_rpcs.respond_to? :remove_local_inventories + @remove_local_inventories = ::Gapic::Config::Method.new remove_local_inventories_config + + yield self if block_given? + end + end + end + end + end + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-retail-v2/lib/google/cloud/retail/v2/product_service/rest/operations.rb b/owl-bot-staging/google-cloud-retail-v2/lib/google/cloud/retail/v2/product_service/rest/operations.rb new file mode 100644 index 000000000000..4c8a1a539e9a --- /dev/null +++ b/owl-bot-staging/google-cloud-retail-v2/lib/google/cloud/retail/v2/product_service/rest/operations.rb @@ -0,0 +1,960 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +require "gapic/operation" + +module Google + module Cloud + module Retail + module V2 + module ProductService + module Rest + # Service that implements Longrunning Operations API. + class Operations + # @private + API_VERSION = "" + + # @private + DEFAULT_ENDPOINT_TEMPLATE = "retail.$UNIVERSE_DOMAIN$" + + # @private + attr_reader :operations_stub + + ## + # Configuration for the ProductService 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 ProductService 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::Retail::V2::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + options.apply_defaults timeout: @config.rpcs.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::Retail::V2::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + options.apply_defaults timeout: @config.rpcs.get_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::Retail::V2::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + options.apply_defaults timeout: @config.rpcs.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::Retail::V2::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + options.apply_defaults timeout: @config.rpcs.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 = "retail.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: "/v2/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v2/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/catalogs/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v2/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/?$}, 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: "/v2/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v2/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/catalogs/[^/]+/branches/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v2/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/catalogs/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v2/{name}", + matches: [ + ["name", %r{^projects/[^/]+/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 +end diff --git a/owl-bot-staging/google-cloud-retail-v2/lib/google/cloud/retail/v2/product_service/rest/service_stub.rb b/owl-bot-staging/google-cloud-retail-v2/lib/google/cloud/retail/v2/product_service/rest/service_stub.rb new file mode 100644 index 000000000000..6c786d4e6c0c --- /dev/null +++ b/owl-bot-staging/google-cloud-retail-v2/lib/google/cloud/retail/v2/product_service/rest/service_stub.rb @@ -0,0 +1,822 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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/retail/v2/product_service_pb" + +module Google + module Cloud + module Retail + module V2 + module ProductService + module Rest + ## + # REST service stub for the ProductService 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_product REST call + # + # @param request_pb [::Google::Cloud::Retail::V2::CreateProductRequest] + # A request object representing the call parameters. Required. + # @param options [::Gapic::CallOptions] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Cloud::Retail::V2::Product] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::Retail::V2::Product] + # A result object deserialized from the server's reply + def create_product request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_create_product_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_product", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Cloud::Retail::V2::Product.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_product REST call + # + # @param request_pb [::Google::Cloud::Retail::V2::GetProductRequest] + # A request object representing the call parameters. Required. + # @param options [::Gapic::CallOptions] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Cloud::Retail::V2::Product] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::Retail::V2::Product] + # A result object deserialized from the server's reply + def get_product request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_get_product_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_product", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Cloud::Retail::V2::Product.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_products REST call + # + # @param request_pb [::Google::Cloud::Retail::V2::ListProductsRequest] + # A request object representing the call parameters. Required. + # @param options [::Gapic::CallOptions] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Cloud::Retail::V2::ListProductsResponse] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::Retail::V2::ListProductsResponse] + # A result object deserialized from the server's reply + def list_products request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_list_products_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_products", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Cloud::Retail::V2::ListProductsResponse.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_product REST call + # + # @param request_pb [::Google::Cloud::Retail::V2::UpdateProductRequest] + # A request object representing the call parameters. Required. + # @param options [::Gapic::CallOptions] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Cloud::Retail::V2::Product] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::Retail::V2::Product] + # A result object deserialized from the server's reply + def update_product request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_update_product_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_product", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Cloud::Retail::V2::Product.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_product REST call + # + # @param request_pb [::Google::Cloud::Retail::V2::DeleteProductRequest] + # 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_product request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_delete_product_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_product", + 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 purge_products REST call + # + # @param request_pb [::Google::Cloud::Retail::V2::PurgeProductsRequest] + # 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 purge_products request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_purge_products_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: "purge_products", + 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 import_products REST call + # + # @param request_pb [::Google::Cloud::Retail::V2::ImportProductsRequest] + # 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 import_products request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_import_products_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: "import_products", + 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 set_inventory REST call + # + # @param request_pb [::Google::Cloud::Retail::V2::SetInventoryRequest] + # 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 set_inventory request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_set_inventory_request request_pb + query_string_params = if query_string_params.any? + query_string_params.to_h { |p| p.split "=", 2 } + else + {} + end + + response = @client_stub.make_http_request( + verb, + uri: uri, + body: body || "", + params: query_string_params, + method_name: "set_inventory", + 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 add_fulfillment_places REST call + # + # @param request_pb [::Google::Cloud::Retail::V2::AddFulfillmentPlacesRequest] + # 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 add_fulfillment_places request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_add_fulfillment_places_request request_pb + query_string_params = if query_string_params.any? + query_string_params.to_h { |p| p.split "=", 2 } + else + {} + end + + response = @client_stub.make_http_request( + verb, + uri: uri, + body: body || "", + params: query_string_params, + method_name: "add_fulfillment_places", + 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 remove_fulfillment_places REST call + # + # @param request_pb [::Google::Cloud::Retail::V2::RemoveFulfillmentPlacesRequest] + # 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 remove_fulfillment_places request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_remove_fulfillment_places_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: "remove_fulfillment_places", + 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 add_local_inventories REST call + # + # @param request_pb [::Google::Cloud::Retail::V2::AddLocalInventoriesRequest] + # 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 add_local_inventories request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_add_local_inventories_request request_pb + query_string_params = if query_string_params.any? + query_string_params.to_h { |p| p.split "=", 2 } + else + {} + end + + response = @client_stub.make_http_request( + verb, + uri: uri, + body: body || "", + params: query_string_params, + method_name: "add_local_inventories", + 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 remove_local_inventories REST call + # + # @param request_pb [::Google::Cloud::Retail::V2::RemoveLocalInventoriesRequest] + # 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 remove_local_inventories request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_remove_local_inventories_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: "remove_local_inventories", + 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 + + ## + # @private + # + # GRPC transcoding helper method for the create_product REST call + # + # @param request_pb [::Google::Cloud::Retail::V2::CreateProductRequest] + # 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_product_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :post, + uri_template: "/v2/{parent}/products", + body: "product", + matches: [ + ["parent", %r{^projects/[^/]+/locations/[^/]+/catalogs/[^/]+/branches/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the get_product REST call + # + # @param request_pb [::Google::Cloud::Retail::V2::GetProductRequest] + # 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_product_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :get, + uri_template: "/v2/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/catalogs/[^/]+/branches/[^/]+/products(?:/.*)?$}, true] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the list_products REST call + # + # @param request_pb [::Google::Cloud::Retail::V2::ListProductsRequest] + # 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_products_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :get, + uri_template: "/v2/{parent}/products", + matches: [ + ["parent", %r{^projects/[^/]+/locations/[^/]+/catalogs/[^/]+/branches/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the update_product REST call + # + # @param request_pb [::Google::Cloud::Retail::V2::UpdateProductRequest] + # 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_product_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :patch, + uri_template: "/v2/{product.name}", + body: "product", + matches: [ + ["product.name", %r{^projects/[^/]+/locations/[^/]+/catalogs/[^/]+/branches/[^/]+/products(?:/.*)?$}, true] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the delete_product REST call + # + # @param request_pb [::Google::Cloud::Retail::V2::DeleteProductRequest] + # 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_product_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :delete, + uri_template: "/v2/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/catalogs/[^/]+/branches/[^/]+/products(?:/.*)?$}, true] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the purge_products REST call + # + # @param request_pb [::Google::Cloud::Retail::V2::PurgeProductsRequest] + # A request object representing the call parameters. Required. + # @return [Array(String, [String, nil], Hash{String => String})] + # Uri, Body, Query string parameters + def self.transcode_purge_products_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :post, + uri_template: "/v2/{parent}/products:purge", + body: "*", + matches: [ + ["parent", %r{^projects/[^/]+/locations/[^/]+/catalogs/[^/]+/branches/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the import_products REST call + # + # @param request_pb [::Google::Cloud::Retail::V2::ImportProductsRequest] + # A request object representing the call parameters. Required. + # @return [Array(String, [String, nil], Hash{String => String})] + # Uri, Body, Query string parameters + def self.transcode_import_products_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :post, + uri_template: "/v2/{parent}/products:import", + body: "*", + matches: [ + ["parent", %r{^projects/[^/]+/locations/[^/]+/catalogs/[^/]+/branches/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the set_inventory REST call + # + # @param request_pb [::Google::Cloud::Retail::V2::SetInventoryRequest] + # A request object representing the call parameters. Required. + # @return [Array(String, [String, nil], Hash{String => String})] + # Uri, Body, Query string parameters + def self.transcode_set_inventory_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :post, + uri_template: "/v2/{inventory.name}:setInventory", + body: "*", + matches: [ + ["inventory.name", %r{^projects/[^/]+/locations/[^/]+/catalogs/[^/]+/branches/[^/]+/products(?:/.*)?$}, true] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the add_fulfillment_places REST call + # + # @param request_pb [::Google::Cloud::Retail::V2::AddFulfillmentPlacesRequest] + # A request object representing the call parameters. Required. + # @return [Array(String, [String, nil], Hash{String => String})] + # Uri, Body, Query string parameters + def self.transcode_add_fulfillment_places_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :post, + uri_template: "/v2/{product}:addFulfillmentPlaces", + body: "*", + matches: [ + ["product", %r{^projects/[^/]+/locations/[^/]+/catalogs/[^/]+/branches/[^/]+/products(?:/.*)?$}, true] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the remove_fulfillment_places REST call + # + # @param request_pb [::Google::Cloud::Retail::V2::RemoveFulfillmentPlacesRequest] + # A request object representing the call parameters. Required. + # @return [Array(String, [String, nil], Hash{String => String})] + # Uri, Body, Query string parameters + def self.transcode_remove_fulfillment_places_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :post, + uri_template: "/v2/{product}:removeFulfillmentPlaces", + body: "*", + matches: [ + ["product", %r{^projects/[^/]+/locations/[^/]+/catalogs/[^/]+/branches/[^/]+/products(?:/.*)?$}, true] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the add_local_inventories REST call + # + # @param request_pb [::Google::Cloud::Retail::V2::AddLocalInventoriesRequest] + # A request object representing the call parameters. Required. + # @return [Array(String, [String, nil], Hash{String => String})] + # Uri, Body, Query string parameters + def self.transcode_add_local_inventories_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :post, + uri_template: "/v2/{product}:addLocalInventories", + body: "*", + matches: [ + ["product", %r{^projects/[^/]+/locations/[^/]+/catalogs/[^/]+/branches/[^/]+/products(?:/.*)?$}, true] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the remove_local_inventories REST call + # + # @param request_pb [::Google::Cloud::Retail::V2::RemoveLocalInventoriesRequest] + # A request object representing the call parameters. Required. + # @return [Array(String, [String, nil], Hash{String => String})] + # Uri, Body, Query string parameters + def self.transcode_remove_local_inventories_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :post, + uri_template: "/v2/{product}:removeLocalInventories", + body: "*", + matches: [ + ["product", %r{^projects/[^/]+/locations/[^/]+/catalogs/[^/]+/branches/[^/]+/products(?:/.*)?$}, true] + ] + ) + transcoder.transcode request_pb + end + end + end + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-retail-v2/lib/google/cloud/retail/v2/product_service_pb.rb b/owl-bot-staging/google-cloud-retail-v2/lib/google/cloud/retail/v2/product_service_pb.rb new file mode 100644 index 000000000000..aee2b57676bc --- /dev/null +++ b/owl-bot-staging/google-cloud-retail-v2/lib/google/cloud/retail/v2/product_service_pb.rb @@ -0,0 +1,54 @@ +# frozen_string_literal: true +# Generated by the protocol buffer compiler. DO NOT EDIT! +# source: google/cloud/retail/v2/product_service.proto + +require 'google/protobuf' + +require 'google/api/annotations_pb' +require 'google/api/client_pb' +require 'google/api/field_behavior_pb' +require 'google/api/resource_pb' +require 'google/cloud/retail/v2/common_pb' +require 'google/cloud/retail/v2/import_config_pb' +require 'google/cloud/retail/v2/product_pb' +require 'google/cloud/retail/v2/purge_config_pb' +require 'google/longrunning/operations_pb' +require 'google/protobuf/empty_pb' +require 'google/protobuf/field_mask_pb' +require 'google/protobuf/timestamp_pb' + + +descriptor_data = "\n,google/cloud/retail/v2/product_service.proto\x12\x16google.cloud.retail.v2\x1a\x1cgoogle/api/annotations.proto\x1a\x17google/api/client.proto\x1a\x1fgoogle/api/field_behavior.proto\x1a\x19google/api/resource.proto\x1a#google/cloud/retail/v2/common.proto\x1a*google/cloud/retail/v2/import_config.proto\x1a$google/cloud/retail/v2/product.proto\x1a)google/cloud/retail/v2/purge_config.proto\x1a#google/longrunning/operations.proto\x1a\x1bgoogle/protobuf/empty.proto\x1a google/protobuf/field_mask.proto\x1a\x1fgoogle/protobuf/timestamp.proto\"\x9c\x01\n\x14\x43reateProductRequest\x12\x34\n\x06parent\x18\x01 \x01(\tB$\xe0\x41\x02\xfa\x41\x1e\n\x1cretail.googleapis.com/Branch\x12\x35\n\x07product\x18\x02 \x01(\x0b\x32\x1f.google.cloud.retail.v2.ProductB\x03\xe0\x41\x02\x12\x17\n\nproduct_id\x18\x03 \x01(\tB\x03\xe0\x41\x02\"H\n\x11GetProductRequest\x12\x33\n\x04name\x18\x01 \x01(\tB%\xe0\x41\x02\xfa\x41\x1f\n\x1dretail.googleapis.com/Product\"\x95\x01\n\x14UpdateProductRequest\x12\x35\n\x07product\x18\x01 \x01(\x0b\x32\x1f.google.cloud.retail.v2.ProductB\x03\xe0\x41\x02\x12/\n\x0bupdate_mask\x18\x02 \x01(\x0b\x32\x1a.google.protobuf.FieldMask\x12\x15\n\rallow_missing\x18\x03 \x01(\x08\"K\n\x14\x44\x65leteProductRequest\x12\x33\n\x04name\x18\x01 \x01(\tB%\xe0\x41\x02\xfa\x41\x1f\n\x1dretail.googleapis.com/Product\"\xb1\x01\n\x13ListProductsRequest\x12\x34\n\x06parent\x18\x01 \x01(\tB$\xe0\x41\x02\xfa\x41\x1e\n\x1cretail.googleapis.com/Branch\x12\x11\n\tpage_size\x18\x02 \x01(\x05\x12\x12\n\npage_token\x18\x03 \x01(\t\x12\x0e\n\x06\x66ilter\x18\x04 \x01(\t\x12-\n\tread_mask\x18\x05 \x01(\x0b\x32\x1a.google.protobuf.FieldMask\"b\n\x14ListProductsResponse\x12\x31\n\x08products\x18\x01 \x03(\x0b\x32\x1f.google.cloud.retail.v2.Product\x12\x17\n\x0fnext_page_token\x18\x02 \x01(\t\"\xc1\x01\n\x13SetInventoryRequest\x12\x37\n\tinventory\x18\x01 \x01(\x0b\x32\x1f.google.cloud.retail.v2.ProductB\x03\xe0\x41\x02\x12,\n\x08set_mask\x18\x02 \x01(\x0b\x32\x1a.google.protobuf.FieldMask\x12,\n\x08set_time\x18\x03 \x01(\x0b\x32\x1a.google.protobuf.Timestamp\x12\x15\n\rallow_missing\x18\x04 \x01(\x08\"\x16\n\x14SetInventoryMetadata\"\x16\n\x14SetInventoryResponse\"\xc5\x01\n\x1b\x41\x64\x64\x46ulfillmentPlacesRequest\x12\x36\n\x07product\x18\x01 \x01(\tB%\xe0\x41\x02\xfa\x41\x1f\n\x1dretail.googleapis.com/Product\x12\x11\n\x04type\x18\x02 \x01(\tB\x03\xe0\x41\x02\x12\x16\n\tplace_ids\x18\x03 \x03(\tB\x03\xe0\x41\x02\x12,\n\x08\x61\x64\x64_time\x18\x04 \x01(\x0b\x32\x1a.google.protobuf.Timestamp\x12\x15\n\rallow_missing\x18\x05 \x01(\x08\"\x1e\n\x1c\x41\x64\x64\x46ulfillmentPlacesMetadata\"\x1e\n\x1c\x41\x64\x64\x46ulfillmentPlacesResponse\"\x8f\x02\n\x1a\x41\x64\x64LocalInventoriesRequest\x12\x36\n\x07product\x18\x01 \x01(\tB%\xe0\x41\x02\xfa\x41\x1f\n\x1dretail.googleapis.com/Product\x12\x46\n\x11local_inventories\x18\x02 \x03(\x0b\x32&.google.cloud.retail.v2.LocalInventoryB\x03\xe0\x41\x02\x12,\n\x08\x61\x64\x64_mask\x18\x04 \x01(\x0b\x32\x1a.google.protobuf.FieldMask\x12,\n\x08\x61\x64\x64_time\x18\x05 \x01(\x0b\x32\x1a.google.protobuf.Timestamp\x12\x15\n\rallow_missing\x18\x06 \x01(\x08\"\x1d\n\x1b\x41\x64\x64LocalInventoriesMetadata\"\x1d\n\x1b\x41\x64\x64LocalInventoriesResponse\"\xb7\x01\n\x1dRemoveLocalInventoriesRequest\x12\x36\n\x07product\x18\x01 \x01(\tB%\xe0\x41\x02\xfa\x41\x1f\n\x1dretail.googleapis.com/Product\x12\x16\n\tplace_ids\x18\x02 \x03(\tB\x03\xe0\x41\x02\x12/\n\x0bremove_time\x18\x05 \x01(\x0b\x32\x1a.google.protobuf.Timestamp\x12\x15\n\rallow_missing\x18\x03 \x01(\x08\" \n\x1eRemoveLocalInventoriesMetadata\" \n\x1eRemoveLocalInventoriesResponse\"\xcb\x01\n\x1eRemoveFulfillmentPlacesRequest\x12\x36\n\x07product\x18\x01 \x01(\tB%\xe0\x41\x02\xfa\x41\x1f\n\x1dretail.googleapis.com/Product\x12\x11\n\x04type\x18\x02 \x01(\tB\x03\xe0\x41\x02\x12\x16\n\tplace_ids\x18\x03 \x03(\tB\x03\xe0\x41\x02\x12/\n\x0bremove_time\x18\x04 \x01(\x0b\x32\x1a.google.protobuf.Timestamp\x12\x15\n\rallow_missing\x18\x05 \x01(\x08\"!\n\x1fRemoveFulfillmentPlacesMetadata\"!\n\x1fRemoveFulfillmentPlacesResponse2\xc2\x19\n\x0eProductService\x12\xcf\x01\n\rCreateProduct\x12,.google.cloud.retail.v2.CreateProductRequest\x1a\x1f.google.cloud.retail.v2.Product\"o\xda\x41\x19parent,product,product_id\x82\xd3\xe4\x93\x02M\"B/v2/{parent=projects/*/locations/*/catalogs/*/branches/*}/products:\x07product\x12\xac\x01\n\nGetProduct\x12).google.cloud.retail.v2.GetProductRequest\x1a\x1f.google.cloud.retail.v2.Product\"R\xda\x41\x04name\x82\xd3\xe4\x93\x02\x45\x12\x43/v2/{name=projects/*/locations/*/catalogs/*/branches/*/products/**}\x12\xbe\x01\n\x0cListProducts\x12+.google.cloud.retail.v2.ListProductsRequest\x1a,.google.cloud.retail.v2.ListProductsResponse\"S\xda\x41\x06parent\x82\xd3\xe4\x93\x02\x44\x12\x42/v2/{parent=projects/*/locations/*/catalogs/*/branches/*}/products\x12\xd2\x01\n\rUpdateProduct\x12,.google.cloud.retail.v2.UpdateProductRequest\x1a\x1f.google.cloud.retail.v2.Product\"r\xda\x41\x13product,update_mask\x82\xd3\xe4\x93\x02V2K/v2/{product.name=projects/*/locations/*/catalogs/*/branches/*/products/**}:\x07product\x12\xa9\x01\n\rDeleteProduct\x12,.google.cloud.retail.v2.DeleteProductRequest\x1a\x16.google.protobuf.Empty\"R\xda\x41\x04name\x82\xd3\xe4\x93\x02\x45*C/v2/{name=projects/*/locations/*/catalogs/*/branches/*/products/**}\x12\x91\x02\n\rPurgeProducts\x12,.google.cloud.retail.v2.PurgeProductsRequest\x1a\x1d.google.longrunning.Operation\"\xb2\x01\xca\x41\\\n,google.cloud.retail.v2.PurgeProductsResponse\x12,google.cloud.retail.v2.PurgeProductsMetadata\x82\xd3\xe4\x93\x02M\"H/v2/{parent=projects/*/locations/*/catalogs/*/branches/*}/products:purge:\x01*\x12\x8e\x02\n\x0eImportProducts\x12-.google.cloud.retail.v2.ImportProductsRequest\x1a\x1d.google.longrunning.Operation\"\xad\x01\xca\x41V\n-google.cloud.retail.v2.ImportProductsResponse\x12%google.cloud.retail.v2.ImportMetadata\x82\xd3\xe4\x93\x02N\"I/v2/{parent=projects/*/locations/*/catalogs/*/branches/*}/products:import:\x01*\x12\xb4\x02\n\x0cSetInventory\x12+.google.cloud.retail.v2.SetInventoryRequest\x1a\x1d.google.longrunning.Operation\"\xd7\x01\xca\x41Z\n+google.cloud.retail.v2.SetInventoryResponse\x12+google.cloud.retail.v2.SetInventoryMetadata\xda\x41\x12inventory,set_mask\x82\xd3\xe4\x93\x02_\"Z/v2/{inventory.name=projects/*/locations/*/catalogs/*/branches/*/products/**}:setInventory:\x01*\x12\xca\x02\n\x14\x41\x64\x64\x46ulfillmentPlaces\x12\x33.google.cloud.retail.v2.AddFulfillmentPlacesRequest\x1a\x1d.google.longrunning.Operation\"\xdd\x01\xca\x41j\n3google.cloud.retail.v2.AddFulfillmentPlacesResponse\x12\x33google.cloud.retail.v2.AddFulfillmentPlacesMetadata\xda\x41\x07product\x82\xd3\xe4\x93\x02`\"[/v2/{product=projects/*/locations/*/catalogs/*/branches/*/products/**}:addFulfillmentPlaces:\x01*\x12\xd9\x02\n\x17RemoveFulfillmentPlaces\x12\x36.google.cloud.retail.v2.RemoveFulfillmentPlacesRequest\x1a\x1d.google.longrunning.Operation\"\xe6\x01\xca\x41p\n6google.cloud.retail.v2.RemoveFulfillmentPlacesResponse\x12\x36google.cloud.retail.v2.RemoveFulfillmentPlacesMetadata\xda\x41\x07product\x82\xd3\xe4\x93\x02\x63\"^/v2/{product=projects/*/locations/*/catalogs/*/branches/*/products/**}:removeFulfillmentPlaces:\x01*\x12\xc5\x02\n\x13\x41\x64\x64LocalInventories\x12\x32.google.cloud.retail.v2.AddLocalInventoriesRequest\x1a\x1d.google.longrunning.Operation\"\xda\x01\xca\x41h\n2google.cloud.retail.v2.AddLocalInventoriesResponse\x12\x32google.cloud.retail.v2.AddLocalInventoriesMetadata\xda\x41\x07product\x82\xd3\xe4\x93\x02_\"Z/v2/{product=projects/*/locations/*/catalogs/*/branches/*/products/**}:addLocalInventories:\x01*\x12\xd4\x02\n\x16RemoveLocalInventories\x12\x35.google.cloud.retail.v2.RemoveLocalInventoriesRequest\x1a\x1d.google.longrunning.Operation\"\xe3\x01\xca\x41n\n5google.cloud.retail.v2.RemoveLocalInventoriesResponse\x12\x35google.cloud.retail.v2.RemoveLocalInventoriesMetadata\xda\x41\x07product\x82\xd3\xe4\x93\x02\x62\"]/v2/{product=projects/*/locations/*/catalogs/*/branches/*/products/**}:removeLocalInventories:\x01*\x1aI\xca\x41\x15retail.googleapis.com\xd2\x41.https://www.googleapis.com/auth/cloud-platformB\xbe\x01\n\x1a\x63om.google.cloud.retail.v2B\x13ProductServiceProtoP\x01Z2cloud.google.com/go/retail/apiv2/retailpb;retailpb\xa2\x02\x06RETAIL\xaa\x02\x16Google.Cloud.Retail.V2\xca\x02\x16Google\\Cloud\\Retail\\V2\xea\x02\x19Google::Cloud::Retail::V2b\x06proto3" + +pool = ::Google::Protobuf::DescriptorPool.generated_pool +pool.add_serialized_file(descriptor_data) + +module Google + module Cloud + module Retail + module V2 + CreateProductRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.retail.v2.CreateProductRequest").msgclass + GetProductRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.retail.v2.GetProductRequest").msgclass + UpdateProductRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.retail.v2.UpdateProductRequest").msgclass + DeleteProductRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.retail.v2.DeleteProductRequest").msgclass + ListProductsRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.retail.v2.ListProductsRequest").msgclass + ListProductsResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.retail.v2.ListProductsResponse").msgclass + SetInventoryRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.retail.v2.SetInventoryRequest").msgclass + SetInventoryMetadata = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.retail.v2.SetInventoryMetadata").msgclass + SetInventoryResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.retail.v2.SetInventoryResponse").msgclass + AddFulfillmentPlacesRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.retail.v2.AddFulfillmentPlacesRequest").msgclass + AddFulfillmentPlacesMetadata = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.retail.v2.AddFulfillmentPlacesMetadata").msgclass + AddFulfillmentPlacesResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.retail.v2.AddFulfillmentPlacesResponse").msgclass + AddLocalInventoriesRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.retail.v2.AddLocalInventoriesRequest").msgclass + AddLocalInventoriesMetadata = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.retail.v2.AddLocalInventoriesMetadata").msgclass + AddLocalInventoriesResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.retail.v2.AddLocalInventoriesResponse").msgclass + RemoveLocalInventoriesRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.retail.v2.RemoveLocalInventoriesRequest").msgclass + RemoveLocalInventoriesMetadata = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.retail.v2.RemoveLocalInventoriesMetadata").msgclass + RemoveLocalInventoriesResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.retail.v2.RemoveLocalInventoriesResponse").msgclass + RemoveFulfillmentPlacesRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.retail.v2.RemoveFulfillmentPlacesRequest").msgclass + RemoveFulfillmentPlacesMetadata = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.retail.v2.RemoveFulfillmentPlacesMetadata").msgclass + RemoveFulfillmentPlacesResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.retail.v2.RemoveFulfillmentPlacesResponse").msgclass + end + end + end +end diff --git a/owl-bot-staging/google-cloud-retail-v2/lib/google/cloud/retail/v2/product_service_services_pb.rb b/owl-bot-staging/google-cloud-retail-v2/lib/google/cloud/retail/v2/product_service_services_pb.rb new file mode 100644 index 000000000000..5ae098e9d214 --- /dev/null +++ b/owl-bot-staging/google-cloud-retail-v2/lib/google/cloud/retail/v2/product_service_services_pb.rb @@ -0,0 +1,248 @@ +# Generated by the protocol buffer compiler. DO NOT EDIT! +# Source: google/cloud/retail/v2/product_service.proto for package 'Google.Cloud.Retail.V2' +# Original file comments: +# 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 +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# + +require 'grpc' +require 'google/cloud/retail/v2/product_service_pb' + +module Google + module Cloud + module Retail + module V2 + module ProductService + # Service for ingesting [Product][google.cloud.retail.v2.Product] information + # of the customer's website. + class Service + + include ::GRPC::GenericService + + self.marshal_class_method = :encode + self.unmarshal_class_method = :decode + self.service_name = 'google.cloud.retail.v2.ProductService' + + # Creates a [Product][google.cloud.retail.v2.Product]. + rpc :CreateProduct, ::Google::Cloud::Retail::V2::CreateProductRequest, ::Google::Cloud::Retail::V2::Product + # Gets a [Product][google.cloud.retail.v2.Product]. + rpc :GetProduct, ::Google::Cloud::Retail::V2::GetProductRequest, ::Google::Cloud::Retail::V2::Product + # Gets a list of [Product][google.cloud.retail.v2.Product]s. + rpc :ListProducts, ::Google::Cloud::Retail::V2::ListProductsRequest, ::Google::Cloud::Retail::V2::ListProductsResponse + # Updates a [Product][google.cloud.retail.v2.Product]. + rpc :UpdateProduct, ::Google::Cloud::Retail::V2::UpdateProductRequest, ::Google::Cloud::Retail::V2::Product + # Deletes a [Product][google.cloud.retail.v2.Product]. + rpc :DeleteProduct, ::Google::Cloud::Retail::V2::DeleteProductRequest, ::Google::Protobuf::Empty + # Permanently deletes all selected [Product][google.cloud.retail.v2.Product]s + # under a branch. + # + # This process is asynchronous. If the request is valid, the removal will be + # enqueued and processed offline. Depending on the number of + # [Product][google.cloud.retail.v2.Product]s, this operation could take hours + # to complete. Before the operation completes, some + # [Product][google.cloud.retail.v2.Product]s may still be returned by + # [ProductService.GetProduct][google.cloud.retail.v2.ProductService.GetProduct] + # or + # [ProductService.ListProducts][google.cloud.retail.v2.ProductService.ListProducts]. + # + # Depending on the number of [Product][google.cloud.retail.v2.Product]s, this + # operation could take hours to complete. To get a sample of + # [Product][google.cloud.retail.v2.Product]s that would be deleted, set + # [PurgeProductsRequest.force][google.cloud.retail.v2.PurgeProductsRequest.force] + # to false. + rpc :PurgeProducts, ::Google::Cloud::Retail::V2::PurgeProductsRequest, ::Google::Longrunning::Operation + # Bulk import of multiple [Product][google.cloud.retail.v2.Product]s. + # + # Request processing may be synchronous. + # Non-existing items are created. + # + # Note that it is possible for a subset of the + # [Product][google.cloud.retail.v2.Product]s to be successfully updated. + rpc :ImportProducts, ::Google::Cloud::Retail::V2::ImportProductsRequest, ::Google::Longrunning::Operation + # Updates inventory information for a + # [Product][google.cloud.retail.v2.Product] while respecting the last update + # timestamps of each inventory field. + # + # This process is asynchronous and does not require the + # [Product][google.cloud.retail.v2.Product] to exist before updating + # fulfillment information. If the request is valid, the update is enqueued + # and processed downstream. As a consequence, when a response is returned, + # updates are not immediately manifested in the + # [Product][google.cloud.retail.v2.Product] queried by + # [ProductService.GetProduct][google.cloud.retail.v2.ProductService.GetProduct] + # or + # [ProductService.ListProducts][google.cloud.retail.v2.ProductService.ListProducts]. + # + # When inventory is updated with + # [ProductService.CreateProduct][google.cloud.retail.v2.ProductService.CreateProduct] + # and + # [ProductService.UpdateProduct][google.cloud.retail.v2.ProductService.UpdateProduct], + # the specified inventory field value(s) overwrite any existing value(s) + # while ignoring the last update time for this field. Furthermore, the last + # update times for the specified inventory fields are overwritten by the + # times of the + # [ProductService.CreateProduct][google.cloud.retail.v2.ProductService.CreateProduct] + # or + # [ProductService.UpdateProduct][google.cloud.retail.v2.ProductService.UpdateProduct] + # request. + # + # If no inventory fields are set in + # [CreateProductRequest.product][google.cloud.retail.v2.CreateProductRequest.product], + # then any pre-existing inventory information for this product is used. + # + # If no inventory fields are set in + # [SetInventoryRequest.set_mask][google.cloud.retail.v2.SetInventoryRequest.set_mask], + # then any existing inventory information is preserved. + # + # Pre-existing inventory information can only be updated with + # [ProductService.SetInventory][google.cloud.retail.v2.ProductService.SetInventory], + # [ProductService.AddFulfillmentPlaces][google.cloud.retail.v2.ProductService.AddFulfillmentPlaces], + # and + # [ProductService.RemoveFulfillmentPlaces][google.cloud.retail.v2.ProductService.RemoveFulfillmentPlaces]. + # + # The returned [Operation][google.longrunning.Operation]s is obsolete after + # one day, and the [GetOperation][google.longrunning.Operations.GetOperation] + # API returns `NOT_FOUND` afterwards. + # + # If conflicting updates are issued, the + # [Operation][google.longrunning.Operation]s associated with the stale + # updates are not marked as [done][google.longrunning.Operation.done] until + # they are obsolete. + rpc :SetInventory, ::Google::Cloud::Retail::V2::SetInventoryRequest, ::Google::Longrunning::Operation + # We recommend that you use the + # [ProductService.AddLocalInventories][google.cloud.retail.v2.ProductService.AddLocalInventories] + # method instead of the + # [ProductService.AddFulfillmentPlaces][google.cloud.retail.v2.ProductService.AddFulfillmentPlaces] + # method. + # [ProductService.AddLocalInventories][google.cloud.retail.v2.ProductService.AddLocalInventories] + # achieves the same results but provides more fine-grained control over + # ingesting local inventory data. + # + # Incrementally adds place IDs to + # [Product.fulfillment_info.place_ids][google.cloud.retail.v2.FulfillmentInfo.place_ids]. + # + # This process is asynchronous and does not require the + # [Product][google.cloud.retail.v2.Product] to exist before updating + # fulfillment information. If the request is valid, the update will be + # enqueued and processed downstream. As a consequence, when a response is + # returned, the added place IDs are not immediately manifested in the + # [Product][google.cloud.retail.v2.Product] queried by + # [ProductService.GetProduct][google.cloud.retail.v2.ProductService.GetProduct] + # or + # [ProductService.ListProducts][google.cloud.retail.v2.ProductService.ListProducts]. + # + # The returned [Operation][google.longrunning.Operation]s will be obsolete + # after 1 day, and [GetOperation][google.longrunning.Operations.GetOperation] + # API will return NOT_FOUND afterwards. + # + # If conflicting updates are issued, the + # [Operation][google.longrunning.Operation]s associated with the stale + # updates will not be marked as [done][google.longrunning.Operation.done] + # until being obsolete. + rpc :AddFulfillmentPlaces, ::Google::Cloud::Retail::V2::AddFulfillmentPlacesRequest, ::Google::Longrunning::Operation + # We recommend that you use the + # [ProductService.RemoveLocalInventories][google.cloud.retail.v2.ProductService.RemoveLocalInventories] + # method instead of the + # [ProductService.RemoveFulfillmentPlaces][google.cloud.retail.v2.ProductService.RemoveFulfillmentPlaces] + # method. + # [ProductService.RemoveLocalInventories][google.cloud.retail.v2.ProductService.RemoveLocalInventories] + # achieves the same results but provides more fine-grained control over + # ingesting local inventory data. + # + # Incrementally removes place IDs from a + # [Product.fulfillment_info.place_ids][google.cloud.retail.v2.FulfillmentInfo.place_ids]. + # + # This process is asynchronous and does not require the + # [Product][google.cloud.retail.v2.Product] to exist before updating + # fulfillment information. If the request is valid, the update will be + # enqueued and processed downstream. As a consequence, when a response is + # returned, the removed place IDs are not immediately manifested in the + # [Product][google.cloud.retail.v2.Product] queried by + # [ProductService.GetProduct][google.cloud.retail.v2.ProductService.GetProduct] + # or + # [ProductService.ListProducts][google.cloud.retail.v2.ProductService.ListProducts]. + # + # The returned [Operation][google.longrunning.Operation]s will be obsolete + # after 1 day, and [GetOperation][google.longrunning.Operations.GetOperation] + # API will return NOT_FOUND afterwards. + # + # If conflicting updates are issued, the + # [Operation][google.longrunning.Operation]s associated with the stale + # updates will not be marked as [done][google.longrunning.Operation.done] + # until being obsolete. + rpc :RemoveFulfillmentPlaces, ::Google::Cloud::Retail::V2::RemoveFulfillmentPlacesRequest, ::Google::Longrunning::Operation + # Updates local inventory information for a + # [Product][google.cloud.retail.v2.Product] at a list of places, while + # respecting the last update timestamps of each inventory field. + # + # This process is asynchronous and does not require the + # [Product][google.cloud.retail.v2.Product] to exist before updating + # inventory information. If the request is valid, the update will be enqueued + # and processed downstream. As a consequence, when a response is returned, + # updates are not immediately manifested in the + # [Product][google.cloud.retail.v2.Product] queried by + # [ProductService.GetProduct][google.cloud.retail.v2.ProductService.GetProduct] + # or + # [ProductService.ListProducts][google.cloud.retail.v2.ProductService.ListProducts]. + # + # Local inventory information can only be modified using this method. + # [ProductService.CreateProduct][google.cloud.retail.v2.ProductService.CreateProduct] + # and + # [ProductService.UpdateProduct][google.cloud.retail.v2.ProductService.UpdateProduct] + # has no effect on local inventories. + # + # The returned [Operation][google.longrunning.Operation]s will be obsolete + # after 1 day, and [GetOperation][google.longrunning.Operations.GetOperation] + # API will return NOT_FOUND afterwards. + # + # If conflicting updates are issued, the + # [Operation][google.longrunning.Operation]s associated with the stale + # updates will not be marked as [done][google.longrunning.Operation.done] + # until being obsolete. + rpc :AddLocalInventories, ::Google::Cloud::Retail::V2::AddLocalInventoriesRequest, ::Google::Longrunning::Operation + # Remove local inventory information for a + # [Product][google.cloud.retail.v2.Product] at a list of places at a removal + # timestamp. + # + # This process is asynchronous. If the request is valid, the removal will be + # enqueued and processed downstream. As a consequence, when a response is + # returned, removals are not immediately manifested in the + # [Product][google.cloud.retail.v2.Product] queried by + # [ProductService.GetProduct][google.cloud.retail.v2.ProductService.GetProduct] + # or + # [ProductService.ListProducts][google.cloud.retail.v2.ProductService.ListProducts]. + # + # Local inventory information can only be removed using this method. + # [ProductService.CreateProduct][google.cloud.retail.v2.ProductService.CreateProduct] + # and + # [ProductService.UpdateProduct][google.cloud.retail.v2.ProductService.UpdateProduct] + # has no effect on local inventories. + # + # The returned [Operation][google.longrunning.Operation]s will be obsolete + # after 1 day, and [GetOperation][google.longrunning.Operations.GetOperation] + # API will return NOT_FOUND afterwards. + # + # If conflicting updates are issued, the + # [Operation][google.longrunning.Operation]s associated with the stale + # updates will not be marked as [done][google.longrunning.Operation.done] + # until being obsolete. + rpc :RemoveLocalInventories, ::Google::Cloud::Retail::V2::RemoveLocalInventoriesRequest, ::Google::Longrunning::Operation + end + + Stub = Service.rpc_stub_class + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-retail-v2/lib/google/cloud/retail/v2/promotion_pb.rb b/owl-bot-staging/google-cloud-retail-v2/lib/google/cloud/retail/v2/promotion_pb.rb new file mode 100644 index 000000000000..ae0f81f377b7 --- /dev/null +++ b/owl-bot-staging/google-cloud-retail-v2/lib/google/cloud/retail/v2/promotion_pb.rb @@ -0,0 +1,21 @@ +# frozen_string_literal: true +# Generated by the protocol buffer compiler. DO NOT EDIT! +# source: google/cloud/retail/v2/promotion.proto + +require 'google/protobuf' + + +descriptor_data = "\n&google/cloud/retail/v2/promotion.proto\x12\x16google.cloud.retail.v2\"!\n\tPromotion\x12\x14\n\x0cpromotion_id\x18\x01 \x01(\tB\xb9\x01\n\x1a\x63om.google.cloud.retail.v2B\x0ePromotionProtoP\x01Z2cloud.google.com/go/retail/apiv2/retailpb;retailpb\xa2\x02\x06RETAIL\xaa\x02\x16Google.Cloud.Retail.V2\xca\x02\x16Google\\Cloud\\Retail\\V2\xea\x02\x19Google::Cloud::Retail::V2b\x06proto3" + +pool = ::Google::Protobuf::DescriptorPool.generated_pool +pool.add_serialized_file(descriptor_data) + +module Google + module Cloud + module Retail + module V2 + Promotion = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.retail.v2.Promotion").msgclass + end + end + end +end diff --git a/owl-bot-staging/google-cloud-retail-v2/lib/google/cloud/retail/v2/purge_config_pb.rb b/owl-bot-staging/google-cloud-retail-v2/lib/google/cloud/retail/v2/purge_config_pb.rb new file mode 100644 index 000000000000..786696cf2180 --- /dev/null +++ b/owl-bot-staging/google-cloud-retail-v2/lib/google/cloud/retail/v2/purge_config_pb.rb @@ -0,0 +1,30 @@ +# frozen_string_literal: true +# Generated by the protocol buffer compiler. DO NOT EDIT! +# source: google/cloud/retail/v2/purge_config.proto + +require 'google/protobuf' + +require 'google/api/field_behavior_pb' +require 'google/api/resource_pb' +require 'google/protobuf/timestamp_pb' + + +descriptor_data = "\n)google/cloud/retail/v2/purge_config.proto\x12\x16google.cloud.retail.v2\x1a\x1fgoogle/api/field_behavior.proto\x1a\x19google/api/resource.proto\x1a\x1fgoogle/protobuf/timestamp.proto\"\x0f\n\rPurgeMetadata\"\xa7\x01\n\x15PurgeProductsMetadata\x12/\n\x0b\x63reate_time\x18\x01 \x01(\x0b\x32\x1a.google.protobuf.Timestamp\x12/\n\x0bupdate_time\x18\x02 \x01(\x0b\x32\x1a.google.protobuf.Timestamp\x12\x15\n\rsuccess_count\x18\x03 \x01(\x03\x12\x15\n\rfailure_count\x18\x04 \x01(\x03\"p\n\x14PurgeProductsRequest\x12\x34\n\x06parent\x18\x01 \x01(\tB$\xe0\x41\x02\xfa\x41\x1e\n\x1cretail.googleapis.com/Branch\x12\x13\n\x06\x66ilter\x18\x02 \x01(\tB\x03\xe0\x41\x02\x12\r\n\x05\x66orce\x18\x03 \x01(\x08\"f\n\x15PurgeProductsResponse\x12\x13\n\x0bpurge_count\x18\x01 \x01(\x03\x12\x38\n\x0cpurge_sample\x18\x02 \x03(\tB\"\xfa\x41\x1f\n\x1dretail.googleapis.com/Product\"s\n\x16PurgeUserEventsRequest\x12\x35\n\x06parent\x18\x01 \x01(\tB%\xe0\x41\x02\xfa\x41\x1f\n\x1dretail.googleapis.com/Catalog\x12\x13\n\x06\x66ilter\x18\x02 \x01(\tB\x03\xe0\x41\x02\x12\r\n\x05\x66orce\x18\x03 \x01(\x08\"6\n\x17PurgeUserEventsResponse\x12\x1b\n\x13purged_events_count\x18\x01 \x01(\x03\x42\xbb\x01\n\x1a\x63om.google.cloud.retail.v2B\x10PurgeConfigProtoP\x01Z2cloud.google.com/go/retail/apiv2/retailpb;retailpb\xa2\x02\x06RETAIL\xaa\x02\x16Google.Cloud.Retail.V2\xca\x02\x16Google\\Cloud\\Retail\\V2\xea\x02\x19Google::Cloud::Retail::V2b\x06proto3" + +pool = ::Google::Protobuf::DescriptorPool.generated_pool +pool.add_serialized_file(descriptor_data) + +module Google + module Cloud + module Retail + module V2 + PurgeMetadata = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.retail.v2.PurgeMetadata").msgclass + PurgeProductsMetadata = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.retail.v2.PurgeProductsMetadata").msgclass + PurgeProductsRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.retail.v2.PurgeProductsRequest").msgclass + PurgeProductsResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.retail.v2.PurgeProductsResponse").msgclass + PurgeUserEventsRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.retail.v2.PurgeUserEventsRequest").msgclass + PurgeUserEventsResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.retail.v2.PurgeUserEventsResponse").msgclass + end + end + end +end diff --git a/owl-bot-staging/google-cloud-retail-v2/lib/google/cloud/retail/v2/rest.rb b/owl-bot-staging/google-cloud-retail-v2/lib/google/cloud/retail/v2/rest.rb new file mode 100644 index 000000000000..47b06c36e7ba --- /dev/null +++ b/owl-bot-staging/google-cloud-retail-v2/lib/google/cloud/retail/v2/rest.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! + +require "google/cloud/retail/v2/analytics_service/rest" +require "google/cloud/retail/v2/catalog_service/rest" +require "google/cloud/retail/v2/completion_service/rest" +require "google/cloud/retail/v2/control_service/rest" +require "google/cloud/retail/v2/search_service/rest" +require "google/cloud/retail/v2/conversational_search_service/rest" +require "google/cloud/retail/v2/generative_question_service/rest" +require "google/cloud/retail/v2/model_service/rest" +require "google/cloud/retail/v2/prediction_service/rest" +require "google/cloud/retail/v2/product_service/rest" +require "google/cloud/retail/v2/serving_config_service/rest" +require "google/cloud/retail/v2/user_event_service/rest" +require "google/cloud/retail/v2/version" + +module Google + module Cloud + module Retail + ## + # To load just the REST part of this package, including all its services, and instantiate a REST client: + # + # @example + # + # require "google/cloud/retail/v2/rest" + # client = ::Google::Cloud::Retail::V2::AnalyticsService::Rest::Client.new + # + module V2 + end + end + end +end diff --git a/owl-bot-staging/google-cloud-retail-v2/lib/google/cloud/retail/v2/safety_pb.rb b/owl-bot-staging/google-cloud-retail-v2/lib/google/cloud/retail/v2/safety_pb.rb new file mode 100644 index 000000000000..9cf4cbf18eaa --- /dev/null +++ b/owl-bot-staging/google-cloud-retail-v2/lib/google/cloud/retail/v2/safety_pb.rb @@ -0,0 +1,26 @@ +# frozen_string_literal: true +# Generated by the protocol buffer compiler. DO NOT EDIT! +# source: google/cloud/retail/v2/safety.proto + +require 'google/protobuf' + +require 'google/api/field_behavior_pb' + + +descriptor_data = "\n#google/cloud/retail/v2/safety.proto\x12\x16google.cloud.retail.v2\x1a\x1fgoogle/api/field_behavior.proto\"\xd5\x03\n\rSafetySetting\x12\x36\n\x08\x63\x61tegory\x18\x01 \x01(\x0e\x32$.google.cloud.retail.v2.HarmCategory\x12K\n\tthreshold\x18\x02 \x01(\x0e\x32\x38.google.cloud.retail.v2.SafetySetting.HarmBlockThreshold\x12J\n\x06method\x18\x03 \x01(\x0e\x32\x35.google.cloud.retail.v2.SafetySetting.HarmBlockMethodB\x03\xe0\x41\x01\"\x9d\x01\n\x12HarmBlockThreshold\x12$\n HARM_BLOCK_THRESHOLD_UNSPECIFIED\x10\x00\x12\x17\n\x13\x42LOCK_LOW_AND_ABOVE\x10\x01\x12\x1a\n\x16\x42LOCK_MEDIUM_AND_ABOVE\x10\x02\x12\x13\n\x0f\x42LOCK_ONLY_HIGH\x10\x03\x12\x0e\n\nBLOCK_NONE\x10\x04\x12\x07\n\x03OFF\x10\x05\"S\n\x0fHarmBlockMethod\x12!\n\x1dHARM_BLOCK_METHOD_UNSPECIFIED\x10\x00\x12\x0c\n\x08SEVERITY\x10\x01\x12\x0f\n\x0bPROBABILITY\x10\x02*\xd7\x01\n\x0cHarmCategory\x12\x1d\n\x19HARM_CATEGORY_UNSPECIFIED\x10\x00\x12\x1d\n\x19HARM_CATEGORY_HATE_SPEECH\x10\x01\x12#\n\x1fHARM_CATEGORY_DANGEROUS_CONTENT\x10\x02\x12\x1c\n\x18HARM_CATEGORY_HARASSMENT\x10\x03\x12#\n\x1fHARM_CATEGORY_SEXUALLY_EXPLICIT\x10\x04\x12!\n\x1dHARM_CATEGORY_CIVIC_INTEGRITY\x10\x05\x42\xb6\x01\n\x1a\x63om.google.cloud.retail.v2B\x0bSafetyProtoP\x01Z2cloud.google.com/go/retail/apiv2/retailpb;retailpb\xa2\x02\x06RETAIL\xaa\x02\x16Google.Cloud.Retail.V2\xca\x02\x16Google\\Cloud\\Retail\\V2\xea\x02\x19Google::Cloud::Retail::V2b\x06proto3" + +pool = ::Google::Protobuf::DescriptorPool.generated_pool +pool.add_serialized_file(descriptor_data) + +module Google + module Cloud + module Retail + module V2 + SafetySetting = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.retail.v2.SafetySetting").msgclass + SafetySetting::HarmBlockThreshold = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.retail.v2.SafetySetting.HarmBlockThreshold").enummodule + SafetySetting::HarmBlockMethod = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.retail.v2.SafetySetting.HarmBlockMethod").enummodule + HarmCategory = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.retail.v2.HarmCategory").enummodule + end + end + end +end diff --git a/owl-bot-staging/google-cloud-retail-v2/lib/google/cloud/retail/v2/search_service.rb b/owl-bot-staging/google-cloud-retail-v2/lib/google/cloud/retail/v2/search_service.rb new file mode 100644 index 000000000000..dae214f30163 --- /dev/null +++ b/owl-bot-staging/google-cloud-retail-v2/lib/google/cloud/retail/v2/search_service.rb @@ -0,0 +1,58 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +require "gapic/common" +require "gapic/config" +require "gapic/config/method" + +require "google/cloud/retail/v2/version" + +require "google/cloud/retail/v2/search_service/credentials" +require "google/cloud/retail/v2/search_service/paths" +require "google/cloud/retail/v2/search_service/client" +require "google/cloud/retail/v2/search_service/rest" + +module Google + module Cloud + module Retail + module V2 + ## + # Service for search. + # + # This feature is only available for users who have Retail Search enabled. + # Enable Retail Search on Cloud Console before using this feature. + # + # @example Load this service and instantiate a gRPC client + # + # require "google/cloud/retail/v2/search_service" + # client = ::Google::Cloud::Retail::V2::SearchService::Client.new + # + # @example Load this service and instantiate a REST client + # + # require "google/cloud/retail/v2/search_service/rest" + # client = ::Google::Cloud::Retail::V2::SearchService::Rest::Client.new + # + module SearchService + end + end + end + end +end + +helper_path = ::File.join __dir__, "search_service", "helpers.rb" +require "google/cloud/retail/v2/search_service/helpers" if ::File.file? helper_path diff --git a/owl-bot-staging/google-cloud-retail-v2/lib/google/cloud/retail/v2/search_service/client.rb b/owl-bot-staging/google-cloud-retail-v2/lib/google/cloud/retail/v2/search_service/client.rb new file mode 100644 index 000000000000..8c7193d8f5c0 --- /dev/null +++ b/owl-bot-staging/google-cloud-retail-v2/lib/google/cloud/retail/v2/search_service/client.rb @@ -0,0 +1,787 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +require "google/cloud/errors" +require "google/cloud/retail/v2/search_service_pb" +require "google/cloud/location" + +module Google + module Cloud + module Retail + module V2 + module SearchService + ## + # Client for the SearchService service. + # + # Service for search. + # + # This feature is only available for users who have Retail Search enabled. + # Enable Retail Search on Cloud Console before using this feature. + # + class Client + # @private + API_VERSION = "" + + # @private + DEFAULT_ENDPOINT_TEMPLATE = "retail.$UNIVERSE_DOMAIN$" + + include Paths + + # @private + attr_reader :search_service_stub + + ## + # Configure the SearchService Client class. + # + # See {::Google::Cloud::Retail::V2::SearchService::Client::Configuration} + # for a description of the configuration fields. + # + # @example + # + # # Modify the configuration for all SearchService clients + # ::Google::Cloud::Retail::V2::SearchService::Client.configure do |config| + # config.timeout = 10.0 + # end + # + # @yield [config] Configure the Client client. + # @yieldparam config [Client::Configuration] + # + # @return [Client::Configuration] + # + def self.configure + @configure ||= begin + namespace = ["Google", "Cloud", "Retail", "V2"] + parent_config = while namespace.any? + parent_name = namespace.join "::" + parent_const = const_get parent_name + break parent_const.configure if parent_const.respond_to? :configure + namespace.pop + end + default_config = Client::Configuration.new parent_config + + default_config.timeout = 5.0 + default_config.retry_policy = { + initial_delay: 0.1, max_delay: 5.0, multiplier: 1.3, retry_codes: [14, 4] + } + + default_config + end + yield @configure if block_given? + @configure + end + + ## + # Configure the SearchService Client instance. + # + # The configuration is set to the derived mode, meaning that values can be changed, + # but structural changes (adding new fields, etc.) are not allowed. Structural changes + # should be made on {Client.configure}. + # + # See {::Google::Cloud::Retail::V2::SearchService::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 + @search_service_stub.universe_domain + end + + ## + # Create a new SearchService client object. + # + # @example + # + # # Create a client using the default configuration + # client = ::Google::Cloud::Retail::V2::SearchService::Client.new + # + # # Create a client using a custom configuration + # client = ::Google::Cloud::Retail::V2::SearchService::Client.new do |config| + # config.timeout = 10.0 + # end + # + # @yield [config] Configure the SearchService client. + # @yieldparam config [Client::Configuration] + # + def initialize + # These require statements are intentionally placed here to initialize + # the gRPC module only when it's required. + # See https://github.com/googleapis/toolkit/issues/446 + require "gapic/grpc" + require "google/cloud/retail/v2/search_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 + + @search_service_stub = ::Gapic::ServiceStub.new( + ::Google::Cloud::Retail::V2::SearchService::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 + ) + + @search_service_stub.stub_logger&.info do |entry| + entry.set_system_name + entry.set_service + entry.message = "Created client for #{entry.service}" + entry.set_credentials_fields credentials + entry.set "customEndpoint", @config.endpoint if @config.endpoint + entry.set "defaultTimeout", @config.timeout if @config.timeout + entry.set "quotaProject", @quota_project_id if @quota_project_id + end + + @location_client = Google::Cloud::Location::Locations::Client.new do |config| + config.credentials = credentials + config.quota_project = @quota_project_id + config.endpoint = @search_service_stub.endpoint + config.universe_domain = @search_service_stub.universe_domain + config.logger = @search_service_stub.logger if config.respond_to? :logger= + end + end + + ## + # Get the associated client for mix-in of the Locations. + # + # @return [Google::Cloud::Location::Locations::Client] + # + attr_reader :location_client + + ## + # The logger used for request/response debug logging. + # + # @return [Logger] + # + def logger + @search_service_stub.logger + end + + # Service calls + + ## + # Performs a search. + # + # This feature is only available for users who have Retail Search enabled. + # Enable Retail Search on Cloud Console before using this feature. + # + # @overload search(request, options = nil) + # Pass arguments to `search` via a request object, either of type + # {::Google::Cloud::Retail::V2::SearchRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Retail::V2::SearchRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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(placement: nil, branch: nil, query: nil, visitor_id: nil, user_info: nil, page_size: nil, page_token: nil, offset: nil, filter: nil, canonical_filter: nil, order_by: nil, facet_specs: nil, dynamic_facet_spec: nil, boost_spec: nil, query_expansion_spec: nil, variant_rollup_keys: nil, page_categories: nil, search_mode: nil, personalization_spec: nil, labels: nil, spell_correction_spec: nil, entity: nil, conversational_search_spec: nil, tile_navigation_spec: nil, language_code: nil, region_code: nil, place_id: nil, user_attributes: nil) + # Pass arguments to `search` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param placement [::String] + # Required. The resource name of the Retail Search serving config, such as + # `projects/*/locations/global/catalogs/default_catalog/servingConfigs/default_serving_config` + # or the name of the legacy placement resource, such as + # `projects/*/locations/global/catalogs/default_catalog/placements/default_search`. + # This field is used to identify the serving config name and the set + # of models that are used to make the search. + # @param branch [::String] + # The branch resource name, such as + # `projects/*/locations/global/catalogs/default_catalog/branches/0`. + # + # Use "default_branch" as the branch ID or leave this field empty, to search + # products under the default branch. + # @param query [::String] + # Raw search query. + # + # If this field is empty, the request is considered a category browsing + # request and returned results are based on + # {::Google::Cloud::Retail::V2::SearchRequest#filter filter} and + # {::Google::Cloud::Retail::V2::SearchRequest#page_categories page_categories}. + # @param visitor_id [::String] + # Required. A unique identifier for tracking visitors. For example, this + # could be implemented with an HTTP cookie, which should be able to uniquely + # identify a visitor on a single device. This unique identifier should not + # change if the visitor logs in or out of the website. + # + # This should be the same identifier as + # {::Google::Cloud::Retail::V2::UserEvent#visitor_id UserEvent.visitor_id}. + # + # The field must be a UTF-8 encoded string with a length limit of 128 + # characters. Otherwise, an INVALID_ARGUMENT error is returned. + # @param user_info [::Google::Cloud::Retail::V2::UserInfo, ::Hash] + # User information. + # @param page_size [::Integer] + # Maximum number of {::Google::Cloud::Retail::V2::Product Product}s to return. If + # unspecified, defaults to a reasonable value. The maximum allowed value is + # 120. Values above 120 will be coerced to 120. + # + # If this field is negative, an INVALID_ARGUMENT is returned. + # @param page_token [::String] + # A page token + # {::Google::Cloud::Retail::V2::SearchResponse#next_page_token SearchResponse.next_page_token}, + # received from a previous + # {::Google::Cloud::Retail::V2::SearchService::Client#search SearchService.Search} call. + # Provide this to retrieve the subsequent page. + # + # When paginating, all other parameters provided to + # {::Google::Cloud::Retail::V2::SearchService::Client#search SearchService.Search} must + # match the call that provided the page token. Otherwise, an INVALID_ARGUMENT + # error is returned. + # @param offset [::Integer] + # A 0-indexed integer that specifies the current offset (that is, starting + # result location, amongst the {::Google::Cloud::Retail::V2::Product Product}s + # deemed by the API as relevant) in search results. This field is only + # considered if {::Google::Cloud::Retail::V2::SearchRequest#page_token page_token} + # is unset. + # + # If this field is negative, an INVALID_ARGUMENT is returned. + # @param filter [::String] + # The filter syntax consists of an expression language for constructing a + # predicate from one or more fields of the products being filtered. Filter + # expression is case-sensitive. For more information, see + # [Filter](https://cloud.google.com/retail/docs/filter-and-order#filter). + # + # If this field is unrecognizable, an INVALID_ARGUMENT is returned. + # @param canonical_filter [::String] + # The default filter that is applied when a user performs a search without + # checking any filters on the search page. + # + # The filter applied to every search request when quality improvement such as + # query expansion is needed. In the case a query does not have a sufficient + # amount of results this filter will be used to determine whether or not to + # enable the query expansion flow. The original filter will still be used for + # the query expanded search. + # This field is strongly recommended to achieve high search quality. + # + # For more information about filter syntax, see + # {::Google::Cloud::Retail::V2::SearchRequest#filter SearchRequest.filter}. + # @param order_by [::String] + # The order in which products are returned. Products can be ordered by + # a field in an {::Google::Cloud::Retail::V2::Product Product} object. Leave it + # unset if ordered by relevance. OrderBy expression is case-sensitive. For + # more information, see + # [Order](https://cloud.google.com/retail/docs/filter-and-order#order). + # + # If this field is unrecognizable, an INVALID_ARGUMENT is returned. + # @param facet_specs [::Array<::Google::Cloud::Retail::V2::SearchRequest::FacetSpec, ::Hash>] + # Facet specifications for faceted search. If empty, no facets are returned. + # + # A maximum of 200 values are allowed. Otherwise, an INVALID_ARGUMENT error + # is returned. + # @param dynamic_facet_spec [::Google::Cloud::Retail::V2::SearchRequest::DynamicFacetSpec, ::Hash] + # Deprecated. Refer to https://cloud.google.com/retail/docs/configs#dynamic + # to enable dynamic facets. Do not set this field. + # + # The specification for dynamically generated facets. Notice that only + # textual facets can be dynamically generated. + # @param boost_spec [::Google::Cloud::Retail::V2::SearchRequest::BoostSpec, ::Hash] + # Boost specification to boost certain products. For more information, see + # [Boost results](https://cloud.google.com/retail/docs/boosting). + # + # Notice that if both + # {::Google::Cloud::Retail::V2::ServingConfig#boost_control_ids ServingConfig.boost_control_ids} + # and + # {::Google::Cloud::Retail::V2::SearchRequest#boost_spec SearchRequest.boost_spec} + # are set, the boost conditions from both places are evaluated. If a search + # request matches multiple boost conditions, the final boost score is equal + # to the sum of the boost scores from all matched boost conditions. + # @param query_expansion_spec [::Google::Cloud::Retail::V2::SearchRequest::QueryExpansionSpec, ::Hash] + # The query expansion specification that specifies the conditions under which + # query expansion occurs. For more information, see [Query + # expansion](https://cloud.google.com/retail/docs/result-size#query_expansion). + # @param variant_rollup_keys [::Array<::String>] + # The keys to fetch and rollup the matching + # {::Google::Cloud::Retail::V2::Product::Type::VARIANT variant} + # {::Google::Cloud::Retail::V2::Product Product}s attributes, + # {::Google::Cloud::Retail::V2::FulfillmentInfo FulfillmentInfo} or + # {::Google::Cloud::Retail::V2::LocalInventory LocalInventory}s attributes. The + # attributes from all the matching + # {::Google::Cloud::Retail::V2::Product::Type::VARIANT variant} + # {::Google::Cloud::Retail::V2::Product Product}s or + # {::Google::Cloud::Retail::V2::LocalInventory LocalInventory}s are merged and + # de-duplicated. Notice that rollup attributes will lead to extra query + # latency. Maximum number of keys is 30. + # + # For {::Google::Cloud::Retail::V2::FulfillmentInfo FulfillmentInfo}, a + # fulfillment type and a fulfillment ID must be provided in the format of + # "fulfillmentType.fulfillmentId". E.g., in "pickupInStore.store123", + # "pickupInStore" is fulfillment type and "store123" is the store ID. + # + # Supported keys are: + # + # * colorFamilies + # * price + # * originalPrice + # * discount + # * variantId + # * inventory(place_id,price) + # * inventory(place_id,original_price) + # * inventory(place_id,attributes.key), where key is any key in the + # {::Google::Cloud::Retail::V2::LocalInventory#attributes Product.local_inventories.attributes} + # map. + # * attributes.key, where key is any key in the + # {::Google::Cloud::Retail::V2::Product#attributes Product.attributes} map. + # * pickupInStore.id, where id is any + # {::Google::Cloud::Retail::V2::FulfillmentInfo#place_ids FulfillmentInfo.place_ids} + # for {::Google::Cloud::Retail::V2::FulfillmentInfo#type FulfillmentInfo.type} + # "pickup-in-store". + # * shipToStore.id, where id is any + # {::Google::Cloud::Retail::V2::FulfillmentInfo#place_ids FulfillmentInfo.place_ids} + # for {::Google::Cloud::Retail::V2::FulfillmentInfo#type FulfillmentInfo.type} + # "ship-to-store". + # * sameDayDelivery.id, where id is any + # {::Google::Cloud::Retail::V2::FulfillmentInfo#place_ids FulfillmentInfo.place_ids} + # for {::Google::Cloud::Retail::V2::FulfillmentInfo#type FulfillmentInfo.type} + # "same-day-delivery". + # * nextDayDelivery.id, where id is any + # {::Google::Cloud::Retail::V2::FulfillmentInfo#place_ids FulfillmentInfo.place_ids} + # for {::Google::Cloud::Retail::V2::FulfillmentInfo#type FulfillmentInfo.type} + # "next-day-delivery". + # * customFulfillment1.id, where id is any + # {::Google::Cloud::Retail::V2::FulfillmentInfo#place_ids FulfillmentInfo.place_ids} + # for {::Google::Cloud::Retail::V2::FulfillmentInfo#type FulfillmentInfo.type} + # "custom-type-1". + # * customFulfillment2.id, where id is any + # {::Google::Cloud::Retail::V2::FulfillmentInfo#place_ids FulfillmentInfo.place_ids} + # for {::Google::Cloud::Retail::V2::FulfillmentInfo#type FulfillmentInfo.type} + # "custom-type-2". + # * customFulfillment3.id, where id is any + # {::Google::Cloud::Retail::V2::FulfillmentInfo#place_ids FulfillmentInfo.place_ids} + # for {::Google::Cloud::Retail::V2::FulfillmentInfo#type FulfillmentInfo.type} + # "custom-type-3". + # * customFulfillment4.id, where id is any + # {::Google::Cloud::Retail::V2::FulfillmentInfo#place_ids FulfillmentInfo.place_ids} + # for {::Google::Cloud::Retail::V2::FulfillmentInfo#type FulfillmentInfo.type} + # "custom-type-4". + # * customFulfillment5.id, where id is any + # {::Google::Cloud::Retail::V2::FulfillmentInfo#place_ids FulfillmentInfo.place_ids} + # for {::Google::Cloud::Retail::V2::FulfillmentInfo#type FulfillmentInfo.type} + # "custom-type-5". + # + # If this field is set to an invalid value other than these, an + # INVALID_ARGUMENT error is returned. + # @param page_categories [::Array<::String>] + # The categories associated with a category page. Must be set for category + # navigation queries to achieve good search quality. The format should be + # the same as + # {::Google::Cloud::Retail::V2::UserEvent#page_categories UserEvent.page_categories}; + # + # To represent full path of category, use '>' sign to separate different + # hierarchies. If '>' is part of the category name, replace it with + # other character(s). + # + # Category pages include special pages such as sales or promotions. For + # instance, a special sale page may have the category hierarchy: + # "pageCategories" : ["Sales > 2017 Black Friday Deals"]. + # @param search_mode [::Google::Cloud::Retail::V2::SearchRequest::SearchMode] + # The search mode of the search request. If not specified, a single search + # request triggers both product search and faceted search. + # @param personalization_spec [::Google::Cloud::Retail::V2::SearchRequest::PersonalizationSpec, ::Hash] + # The specification for personalization. + # + # Notice that if both + # {::Google::Cloud::Retail::V2::ServingConfig#personalization_spec ServingConfig.personalization_spec} + # and + # {::Google::Cloud::Retail::V2::SearchRequest#personalization_spec SearchRequest.personalization_spec} + # are set. + # {::Google::Cloud::Retail::V2::SearchRequest#personalization_spec SearchRequest.personalization_spec} + # will override + # {::Google::Cloud::Retail::V2::ServingConfig#personalization_spec ServingConfig.personalization_spec}. + # @param labels [::Hash{::String => ::String}] + # The labels applied to a resource must meet the following requirements: + # + # * Each resource can have multiple labels, up to a maximum of 64. + # * Each label must be a key-value pair. + # * Keys have a minimum length of 1 character and a maximum length of 63 + # characters and cannot be empty. Values can be empty and have a maximum + # length of 63 characters. + # * Keys and values can contain only lowercase letters, numeric characters, + # underscores, and dashes. All characters must use UTF-8 encoding, and + # international characters are allowed. + # * The key portion of a label must be unique. However, you can use the same + # key with multiple resources. + # * Keys must start with a lowercase letter or international character. + # + # For more information, see [Requirements for + # labels](https://cloud.google.com/resource-manager/docs/creating-managing-labels#requirements) + # in the Resource Manager documentation. + # @param spell_correction_spec [::Google::Cloud::Retail::V2::SearchRequest::SpellCorrectionSpec, ::Hash] + # The spell correction specification that specifies the mode under + # which spell correction will take effect. + # @param entity [::String] + # The entity for customers that may run multiple different entities, domains, + # sites or regions, for example, `Google US`, `Google Ads`, `Waymo`, + # `google.com`, `youtube.com`, etc. + # If this is set, it should be exactly matched with + # {::Google::Cloud::Retail::V2::UserEvent#entity UserEvent.entity} to get search + # results boosted by entity. + # @param conversational_search_spec [::Google::Cloud::Retail::V2::SearchRequest::ConversationalSearchSpec, ::Hash] + # Optional. This field specifies all conversational related parameters + # addition to traditional retail search. + # @param tile_navigation_spec [::Google::Cloud::Retail::V2::SearchRequest::TileNavigationSpec, ::Hash] + # Optional. This field specifies tile navigation related parameters. + # @param language_code [::String] + # Optional. The BCP-47 language code, such as "en-US" or "sr-Latn" + # [list](https://www.unicode.org/cldr/charts/46/summary/root.html). For more + # information, see [Standardized codes](https://google.aip.dev/143). This + # field helps to better interpret the query. If a value isn't specified, the + # query language code is automatically detected, which may not be accurate. + # @param region_code [::String] + # Optional. The Unicode country/region code (CLDR) of a location, such as + # "US" and "419" + # [list](https://www.unicode.org/cldr/charts/46/supplemental/territory_information.html). + # For more information, see [Standardized codes](https://google.aip.dev/143). + # If set, then results will be boosted based on the region_code provided. + # @param place_id [::String] + # Optional. An id corresponding to a place, such as a store id or region id. + # When specified, we use the price from the local inventory with the matching + # product's + # {::Google::Cloud::Retail::V2::LocalInventory#place_id LocalInventory.place_id} + # for revenue optimization. + # @param user_attributes [::Hash{::String => ::Google::Cloud::Retail::V2::StringList, ::Hash}] + # Optional. The user attributes that could be used for personalization of + # search results. + # * Populate at most 100 key-value pairs per query. + # * Only supports string keys and repeated string values. + # * Duplcate keys are not allowed within a single query. + # + # Example: + # user_attributes: [ + # { key: "pets" + # value { + # values: "dog" + # values: "cat" + # } + # }, + # { key: "state" + # value { + # values: "CA" + # } + # } + # ] + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Gapic::PagedEnumerable<::Google::Cloud::Retail::V2::SearchResponse::SearchResult>] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Gapic::PagedEnumerable<::Google::Cloud::Retail::V2::SearchResponse::SearchResult>] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/retail/v2" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Retail::V2::SearchService::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Retail::V2::SearchRequest.new + # + # # Call the search method. + # result = client.search request + # + # # The returned object is of type Gapic::PagedEnumerable. You can iterate + # # over elements, and API calls will be issued to fetch pages as needed. + # result.each do |item| + # # Each element is of type ::Google::Cloud::Retail::V2::SearchResponse::SearchResult. + # p item + # end + # + def search request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Retail::V2::SearchRequest + + # Converts hash 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.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::Retail::V2::VERSION + metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.placement + header_params["placement"] = request.placement + 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.timeout, + metadata: metadata, + retry_policy: @config.rpcs.search.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @search_service_stub.call_rpc :search, request, options: options do |response, operation| + response = ::Gapic::PagedEnumerable.new @search_service_stub, :search, 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 SearchService API. + # + # This class represents the configuration for SearchService, + # providing control over timeouts, retry behavior, logging, transport + # parameters, and other low-level controls. Certain parameters can also be + # applied individually to specific RPCs. See + # {::Google::Cloud::Retail::V2::SearchService::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 + # # search to 20 seconds, + # # and all remaining timeouts to 10 seconds. + # ::Google::Cloud::Retail::V2::SearchService::Client.configure do |config| + # config.timeout = 10.0 + # config.rpcs.search.timeout = 20.0 + # end + # + # # Apply the above configuration only to a new client. + # client = ::Google::Cloud::Retail::V2::SearchService::Client.new do |config| + # config.timeout = 10.0 + # config.rpcs.search.timeout = 20.0 + # end + # + # @!attribute [rw] endpoint + # A custom service endpoint, as a hostname or hostname:port. The default is + # nil, indicating to use the default endpoint in the current universe domain. + # @return [::String,nil] + # @!attribute [rw] credentials + # Credentials to send with calls. You may provide any of the following types: + # * (`Google::Auth::Credentials`) A googleauth credentials object + # (see the [googleauth docs](https://rubydoc.info/gems/googleauth/Google/Auth/Credentials)) + # * (`Signet::OAuth2::Client`) A signet oauth2 client object + # (see the [signet docs](https://rubydoc.info/gems/signet/Signet/OAuth2/Client)) + # * (`GRPC::Core::Channel`) a gRPC channel with included credentials + # * (`GRPC::Core::ChannelCredentials`) a gRPC credentails object + # * (`nil`) indicating no credentials + # + # @note Warning: Passing a `String` to a keyfile path or a `Hash` of credentials + # is deprecated. Providing an unvalidated credential configuration to + # Google APIs can compromise the security of your systems and data. + # + # @example + # + # # The recommended way to provide credentials is to use the `make_creds` method + # # on the appropriate credentials class for your environment. + # + # require "googleauth" + # + # credentials = ::Google::Auth::ServiceAccountCredentials.make_creds( + # json_key_io: ::File.open("/path/to/keyfile.json") + # ) + # + # client = ::Google::Cloud::Retail::V2::SearchService::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 = "retail.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 SearchService 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 `search` + # @return [::Gapic::Config::Method] + # + attr_reader :search + + # @private + def initialize parent_rpcs = nil + search_config = parent_rpcs.search if parent_rpcs.respond_to? :search + @search = ::Gapic::Config::Method.new search_config + + yield self if block_given? + end + end + end + end + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-retail-v2/lib/google/cloud/retail/v2/search_service/credentials.rb b/owl-bot-staging/google-cloud-retail-v2/lib/google/cloud/retail/v2/search_service/credentials.rb new file mode 100644 index 000000000000..cac1d6f0827c --- /dev/null +++ b/owl-bot-staging/google-cloud-retail-v2/lib/google/cloud/retail/v2/search_service/credentials.rb @@ -0,0 +1,51 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +require "googleauth" + +module Google + module Cloud + module Retail + module V2 + module SearchService + # Credentials for the SearchService API. + class Credentials < ::Google::Auth::Credentials + self.scope = [ + "https://www.googleapis.com/auth/cloud-platform" + ] + self.env_vars = [ + "RETAIL_CREDENTIALS", + "RETAIL_KEYFILE", + "GOOGLE_CLOUD_CREDENTIALS", + "GOOGLE_CLOUD_KEYFILE", + "GCLOUD_KEYFILE", + "RETAIL_CREDENTIALS_JSON", + "RETAIL_KEYFILE_JSON", + "GOOGLE_CLOUD_CREDENTIALS_JSON", + "GOOGLE_CLOUD_KEYFILE_JSON", + "GCLOUD_KEYFILE_JSON" + ] + self.paths = [ + "~/.config/google_cloud/application_default_credentials.json" + ] + end + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-retail-v2/lib/google/cloud/retail/v2/search_service/paths.rb b/owl-bot-staging/google-cloud-retail-v2/lib/google/cloud/retail/v2/search_service/paths.rb new file mode 100644 index 000000000000..9bc8dfbe2895 --- /dev/null +++ b/owl-bot-staging/google-cloud-retail-v2/lib/google/cloud/retail/v2/search_service/paths.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! + + +module Google + module Cloud + module Retail + module V2 + module SearchService + # Path helper methods for the SearchService API. + module Paths + ## + # Create a fully-qualified Branch resource string. + # + # The resource will be in the following format: + # + # `projects/{project}/locations/{location}/catalogs/{catalog}/branches/{branch}` + # + # @param project [String] + # @param location [String] + # @param catalog [String] + # @param branch [String] + # + # @return [::String] + def branch_path project:, location:, catalog:, branch: + raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" + raise ::ArgumentError, "location cannot contain /" if location.to_s.include? "/" + raise ::ArgumentError, "catalog cannot contain /" if catalog.to_s.include? "/" + + "projects/#{project}/locations/#{location}/catalogs/#{catalog}/branches/#{branch}" + end + + extend self + end + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-retail-v2/lib/google/cloud/retail/v2/search_service/rest.rb b/owl-bot-staging/google-cloud-retail-v2/lib/google/cloud/retail/v2/search_service/rest.rb new file mode 100644 index 000000000000..b7b1de13989c --- /dev/null +++ b/owl-bot-staging/google-cloud-retail-v2/lib/google/cloud/retail/v2/search_service/rest.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/rest" +require "gapic/config" +require "gapic/config/method" + +require "google/cloud/retail/v2/version" + +require "google/cloud/retail/v2/search_service/credentials" +require "google/cloud/retail/v2/search_service/paths" +require "google/cloud/retail/v2/search_service/rest/client" + +module Google + module Cloud + module Retail + module V2 + ## + # Service for search. + # + # This feature is only available for users who have Retail Search enabled. + # Enable Retail Search on Cloud Console before using this feature. + # + # To load this service and instantiate a REST client: + # + # require "google/cloud/retail/v2/search_service/rest" + # client = ::Google::Cloud::Retail::V2::SearchService::Rest::Client.new + # + module SearchService + # Client for the REST transport + module Rest + end + end + end + end + end +end + +helper_path = ::File.join __dir__, "rest", "helpers.rb" +require "google/cloud/retail/v2/search_service/rest/helpers" if ::File.file? helper_path diff --git a/owl-bot-staging/google-cloud-retail-v2/lib/google/cloud/retail/v2/search_service/rest/client.rb b/owl-bot-staging/google-cloud-retail-v2/lib/google/cloud/retail/v2/search_service/rest/client.rb new file mode 100644 index 000000000000..2afc3a5a7cfe --- /dev/null +++ b/owl-bot-staging/google-cloud-retail-v2/lib/google/cloud/retail/v2/search_service/rest/client.rb @@ -0,0 +1,737 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +require "google/cloud/errors" +require "google/cloud/retail/v2/search_service_pb" +require "google/cloud/retail/v2/search_service/rest/service_stub" +require "google/cloud/location/rest" + +module Google + module Cloud + module Retail + module V2 + module SearchService + module Rest + ## + # REST client for the SearchService service. + # + # Service for search. + # + # This feature is only available for users who have Retail Search enabled. + # Enable Retail Search on Cloud Console before using this feature. + # + class Client + # @private + API_VERSION = "" + + # @private + DEFAULT_ENDPOINT_TEMPLATE = "retail.$UNIVERSE_DOMAIN$" + + include Paths + + # @private + attr_reader :search_service_stub + + ## + # Configure the SearchService Client class. + # + # See {::Google::Cloud::Retail::V2::SearchService::Rest::Client::Configuration} + # for a description of the configuration fields. + # + # @example + # + # # Modify the configuration for all SearchService clients + # ::Google::Cloud::Retail::V2::SearchService::Rest::Client.configure do |config| + # config.timeout = 10.0 + # end + # + # @yield [config] Configure the Client client. + # @yieldparam config [Client::Configuration] + # + # @return [Client::Configuration] + # + def self.configure + @configure ||= begin + namespace = ["Google", "Cloud", "Retail", "V2"] + parent_config = while namespace.any? + parent_name = namespace.join "::" + parent_const = const_get parent_name + break parent_const.configure if parent_const.respond_to? :configure + namespace.pop + end + default_config = Client::Configuration.new parent_config + + default_config.timeout = 5.0 + default_config.retry_policy = { + initial_delay: 0.1, max_delay: 5.0, multiplier: 1.3, retry_codes: [14, 4] + } + + default_config + end + yield @configure if block_given? + @configure + end + + ## + # Configure the SearchService Client instance. + # + # The configuration is set to the derived mode, meaning that values can be changed, + # but structural changes (adding new fields, etc.) are not allowed. Structural changes + # should be made on {Client.configure}. + # + # See {::Google::Cloud::Retail::V2::SearchService::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 + @search_service_stub.universe_domain + end + + ## + # Create a new SearchService REST client object. + # + # @example + # + # # Create a client using the default configuration + # client = ::Google::Cloud::Retail::V2::SearchService::Rest::Client.new + # + # # Create a client using a custom configuration + # client = ::Google::Cloud::Retail::V2::SearchService::Rest::Client.new do |config| + # config.timeout = 10.0 + # end + # + # @yield [config] Configure the SearchService 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 + + @search_service_stub = ::Google::Cloud::Retail::V2::SearchService::Rest::ServiceStub.new( + endpoint: @config.endpoint, + endpoint_template: DEFAULT_ENDPOINT_TEMPLATE, + universe_domain: @config.universe_domain, + credentials: credentials, + logger: @config.logger + ) + + @search_service_stub.logger(stub: true)&.info do |entry| + entry.set_system_name + entry.set_service + entry.message = "Created client for #{entry.service}" + entry.set_credentials_fields credentials + entry.set "customEndpoint", @config.endpoint if @config.endpoint + entry.set "defaultTimeout", @config.timeout if @config.timeout + entry.set "quotaProject", @quota_project_id if @quota_project_id + end + + @location_client = Google::Cloud::Location::Locations::Rest::Client.new do |config| + config.credentials = credentials + config.quota_project = @quota_project_id + config.endpoint = @search_service_stub.endpoint + config.universe_domain = @search_service_stub.universe_domain + config.logger = @search_service_stub.logger if config.respond_to? :logger= + end + end + + ## + # Get the associated client for mix-in of the Locations. + # + # @return [Google::Cloud::Location::Locations::Rest::Client] + # + attr_reader :location_client + + ## + # The logger used for request/response debug logging. + # + # @return [Logger] + # + def logger + @search_service_stub.logger + end + + # Service calls + + ## + # Performs a search. + # + # This feature is only available for users who have Retail Search enabled. + # Enable Retail Search on Cloud Console before using this feature. + # + # @overload search(request, options = nil) + # Pass arguments to `search` via a request object, either of type + # {::Google::Cloud::Retail::V2::SearchRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Retail::V2::SearchRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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(placement: nil, branch: nil, query: nil, visitor_id: nil, user_info: nil, page_size: nil, page_token: nil, offset: nil, filter: nil, canonical_filter: nil, order_by: nil, facet_specs: nil, dynamic_facet_spec: nil, boost_spec: nil, query_expansion_spec: nil, variant_rollup_keys: nil, page_categories: nil, search_mode: nil, personalization_spec: nil, labels: nil, spell_correction_spec: nil, entity: nil, conversational_search_spec: nil, tile_navigation_spec: nil, language_code: nil, region_code: nil, place_id: nil, user_attributes: nil) + # Pass arguments to `search` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param placement [::String] + # Required. The resource name of the Retail Search serving config, such as + # `projects/*/locations/global/catalogs/default_catalog/servingConfigs/default_serving_config` + # or the name of the legacy placement resource, such as + # `projects/*/locations/global/catalogs/default_catalog/placements/default_search`. + # This field is used to identify the serving config name and the set + # of models that are used to make the search. + # @param branch [::String] + # The branch resource name, such as + # `projects/*/locations/global/catalogs/default_catalog/branches/0`. + # + # Use "default_branch" as the branch ID or leave this field empty, to search + # products under the default branch. + # @param query [::String] + # Raw search query. + # + # If this field is empty, the request is considered a category browsing + # request and returned results are based on + # {::Google::Cloud::Retail::V2::SearchRequest#filter filter} and + # {::Google::Cloud::Retail::V2::SearchRequest#page_categories page_categories}. + # @param visitor_id [::String] + # Required. A unique identifier for tracking visitors. For example, this + # could be implemented with an HTTP cookie, which should be able to uniquely + # identify a visitor on a single device. This unique identifier should not + # change if the visitor logs in or out of the website. + # + # This should be the same identifier as + # {::Google::Cloud::Retail::V2::UserEvent#visitor_id UserEvent.visitor_id}. + # + # The field must be a UTF-8 encoded string with a length limit of 128 + # characters. Otherwise, an INVALID_ARGUMENT error is returned. + # @param user_info [::Google::Cloud::Retail::V2::UserInfo, ::Hash] + # User information. + # @param page_size [::Integer] + # Maximum number of {::Google::Cloud::Retail::V2::Product Product}s to return. If + # unspecified, defaults to a reasonable value. The maximum allowed value is + # 120. Values above 120 will be coerced to 120. + # + # If this field is negative, an INVALID_ARGUMENT is returned. + # @param page_token [::String] + # A page token + # {::Google::Cloud::Retail::V2::SearchResponse#next_page_token SearchResponse.next_page_token}, + # received from a previous + # {::Google::Cloud::Retail::V2::SearchService::Rest::Client#search SearchService.Search} call. + # Provide this to retrieve the subsequent page. + # + # When paginating, all other parameters provided to + # {::Google::Cloud::Retail::V2::SearchService::Rest::Client#search SearchService.Search} must + # match the call that provided the page token. Otherwise, an INVALID_ARGUMENT + # error is returned. + # @param offset [::Integer] + # A 0-indexed integer that specifies the current offset (that is, starting + # result location, amongst the {::Google::Cloud::Retail::V2::Product Product}s + # deemed by the API as relevant) in search results. This field is only + # considered if {::Google::Cloud::Retail::V2::SearchRequest#page_token page_token} + # is unset. + # + # If this field is negative, an INVALID_ARGUMENT is returned. + # @param filter [::String] + # The filter syntax consists of an expression language for constructing a + # predicate from one or more fields of the products being filtered. Filter + # expression is case-sensitive. For more information, see + # [Filter](https://cloud.google.com/retail/docs/filter-and-order#filter). + # + # If this field is unrecognizable, an INVALID_ARGUMENT is returned. + # @param canonical_filter [::String] + # The default filter that is applied when a user performs a search without + # checking any filters on the search page. + # + # The filter applied to every search request when quality improvement such as + # query expansion is needed. In the case a query does not have a sufficient + # amount of results this filter will be used to determine whether or not to + # enable the query expansion flow. The original filter will still be used for + # the query expanded search. + # This field is strongly recommended to achieve high search quality. + # + # For more information about filter syntax, see + # {::Google::Cloud::Retail::V2::SearchRequest#filter SearchRequest.filter}. + # @param order_by [::String] + # The order in which products are returned. Products can be ordered by + # a field in an {::Google::Cloud::Retail::V2::Product Product} object. Leave it + # unset if ordered by relevance. OrderBy expression is case-sensitive. For + # more information, see + # [Order](https://cloud.google.com/retail/docs/filter-and-order#order). + # + # If this field is unrecognizable, an INVALID_ARGUMENT is returned. + # @param facet_specs [::Array<::Google::Cloud::Retail::V2::SearchRequest::FacetSpec, ::Hash>] + # Facet specifications for faceted search. If empty, no facets are returned. + # + # A maximum of 200 values are allowed. Otherwise, an INVALID_ARGUMENT error + # is returned. + # @param dynamic_facet_spec [::Google::Cloud::Retail::V2::SearchRequest::DynamicFacetSpec, ::Hash] + # Deprecated. Refer to https://cloud.google.com/retail/docs/configs#dynamic + # to enable dynamic facets. Do not set this field. + # + # The specification for dynamically generated facets. Notice that only + # textual facets can be dynamically generated. + # @param boost_spec [::Google::Cloud::Retail::V2::SearchRequest::BoostSpec, ::Hash] + # Boost specification to boost certain products. For more information, see + # [Boost results](https://cloud.google.com/retail/docs/boosting). + # + # Notice that if both + # {::Google::Cloud::Retail::V2::ServingConfig#boost_control_ids ServingConfig.boost_control_ids} + # and + # {::Google::Cloud::Retail::V2::SearchRequest#boost_spec SearchRequest.boost_spec} + # are set, the boost conditions from both places are evaluated. If a search + # request matches multiple boost conditions, the final boost score is equal + # to the sum of the boost scores from all matched boost conditions. + # @param query_expansion_spec [::Google::Cloud::Retail::V2::SearchRequest::QueryExpansionSpec, ::Hash] + # The query expansion specification that specifies the conditions under which + # query expansion occurs. For more information, see [Query + # expansion](https://cloud.google.com/retail/docs/result-size#query_expansion). + # @param variant_rollup_keys [::Array<::String>] + # The keys to fetch and rollup the matching + # {::Google::Cloud::Retail::V2::Product::Type::VARIANT variant} + # {::Google::Cloud::Retail::V2::Product Product}s attributes, + # {::Google::Cloud::Retail::V2::FulfillmentInfo FulfillmentInfo} or + # {::Google::Cloud::Retail::V2::LocalInventory LocalInventory}s attributes. The + # attributes from all the matching + # {::Google::Cloud::Retail::V2::Product::Type::VARIANT variant} + # {::Google::Cloud::Retail::V2::Product Product}s or + # {::Google::Cloud::Retail::V2::LocalInventory LocalInventory}s are merged and + # de-duplicated. Notice that rollup attributes will lead to extra query + # latency. Maximum number of keys is 30. + # + # For {::Google::Cloud::Retail::V2::FulfillmentInfo FulfillmentInfo}, a + # fulfillment type and a fulfillment ID must be provided in the format of + # "fulfillmentType.fulfillmentId". E.g., in "pickupInStore.store123", + # "pickupInStore" is fulfillment type and "store123" is the store ID. + # + # Supported keys are: + # + # * colorFamilies + # * price + # * originalPrice + # * discount + # * variantId + # * inventory(place_id,price) + # * inventory(place_id,original_price) + # * inventory(place_id,attributes.key), where key is any key in the + # {::Google::Cloud::Retail::V2::LocalInventory#attributes Product.local_inventories.attributes} + # map. + # * attributes.key, where key is any key in the + # {::Google::Cloud::Retail::V2::Product#attributes Product.attributes} map. + # * pickupInStore.id, where id is any + # {::Google::Cloud::Retail::V2::FulfillmentInfo#place_ids FulfillmentInfo.place_ids} + # for {::Google::Cloud::Retail::V2::FulfillmentInfo#type FulfillmentInfo.type} + # "pickup-in-store". + # * shipToStore.id, where id is any + # {::Google::Cloud::Retail::V2::FulfillmentInfo#place_ids FulfillmentInfo.place_ids} + # for {::Google::Cloud::Retail::V2::FulfillmentInfo#type FulfillmentInfo.type} + # "ship-to-store". + # * sameDayDelivery.id, where id is any + # {::Google::Cloud::Retail::V2::FulfillmentInfo#place_ids FulfillmentInfo.place_ids} + # for {::Google::Cloud::Retail::V2::FulfillmentInfo#type FulfillmentInfo.type} + # "same-day-delivery". + # * nextDayDelivery.id, where id is any + # {::Google::Cloud::Retail::V2::FulfillmentInfo#place_ids FulfillmentInfo.place_ids} + # for {::Google::Cloud::Retail::V2::FulfillmentInfo#type FulfillmentInfo.type} + # "next-day-delivery". + # * customFulfillment1.id, where id is any + # {::Google::Cloud::Retail::V2::FulfillmentInfo#place_ids FulfillmentInfo.place_ids} + # for {::Google::Cloud::Retail::V2::FulfillmentInfo#type FulfillmentInfo.type} + # "custom-type-1". + # * customFulfillment2.id, where id is any + # {::Google::Cloud::Retail::V2::FulfillmentInfo#place_ids FulfillmentInfo.place_ids} + # for {::Google::Cloud::Retail::V2::FulfillmentInfo#type FulfillmentInfo.type} + # "custom-type-2". + # * customFulfillment3.id, where id is any + # {::Google::Cloud::Retail::V2::FulfillmentInfo#place_ids FulfillmentInfo.place_ids} + # for {::Google::Cloud::Retail::V2::FulfillmentInfo#type FulfillmentInfo.type} + # "custom-type-3". + # * customFulfillment4.id, where id is any + # {::Google::Cloud::Retail::V2::FulfillmentInfo#place_ids FulfillmentInfo.place_ids} + # for {::Google::Cloud::Retail::V2::FulfillmentInfo#type FulfillmentInfo.type} + # "custom-type-4". + # * customFulfillment5.id, where id is any + # {::Google::Cloud::Retail::V2::FulfillmentInfo#place_ids FulfillmentInfo.place_ids} + # for {::Google::Cloud::Retail::V2::FulfillmentInfo#type FulfillmentInfo.type} + # "custom-type-5". + # + # If this field is set to an invalid value other than these, an + # INVALID_ARGUMENT error is returned. + # @param page_categories [::Array<::String>] + # The categories associated with a category page. Must be set for category + # navigation queries to achieve good search quality. The format should be + # the same as + # {::Google::Cloud::Retail::V2::UserEvent#page_categories UserEvent.page_categories}; + # + # To represent full path of category, use '>' sign to separate different + # hierarchies. If '>' is part of the category name, replace it with + # other character(s). + # + # Category pages include special pages such as sales or promotions. For + # instance, a special sale page may have the category hierarchy: + # "pageCategories" : ["Sales > 2017 Black Friday Deals"]. + # @param search_mode [::Google::Cloud::Retail::V2::SearchRequest::SearchMode] + # The search mode of the search request. If not specified, a single search + # request triggers both product search and faceted search. + # @param personalization_spec [::Google::Cloud::Retail::V2::SearchRequest::PersonalizationSpec, ::Hash] + # The specification for personalization. + # + # Notice that if both + # {::Google::Cloud::Retail::V2::ServingConfig#personalization_spec ServingConfig.personalization_spec} + # and + # {::Google::Cloud::Retail::V2::SearchRequest#personalization_spec SearchRequest.personalization_spec} + # are set. + # {::Google::Cloud::Retail::V2::SearchRequest#personalization_spec SearchRequest.personalization_spec} + # will override + # {::Google::Cloud::Retail::V2::ServingConfig#personalization_spec ServingConfig.personalization_spec}. + # @param labels [::Hash{::String => ::String}] + # The labels applied to a resource must meet the following requirements: + # + # * Each resource can have multiple labels, up to a maximum of 64. + # * Each label must be a key-value pair. + # * Keys have a minimum length of 1 character and a maximum length of 63 + # characters and cannot be empty. Values can be empty and have a maximum + # length of 63 characters. + # * Keys and values can contain only lowercase letters, numeric characters, + # underscores, and dashes. All characters must use UTF-8 encoding, and + # international characters are allowed. + # * The key portion of a label must be unique. However, you can use the same + # key with multiple resources. + # * Keys must start with a lowercase letter or international character. + # + # For more information, see [Requirements for + # labels](https://cloud.google.com/resource-manager/docs/creating-managing-labels#requirements) + # in the Resource Manager documentation. + # @param spell_correction_spec [::Google::Cloud::Retail::V2::SearchRequest::SpellCorrectionSpec, ::Hash] + # The spell correction specification that specifies the mode under + # which spell correction will take effect. + # @param entity [::String] + # The entity for customers that may run multiple different entities, domains, + # sites or regions, for example, `Google US`, `Google Ads`, `Waymo`, + # `google.com`, `youtube.com`, etc. + # If this is set, it should be exactly matched with + # {::Google::Cloud::Retail::V2::UserEvent#entity UserEvent.entity} to get search + # results boosted by entity. + # @param conversational_search_spec [::Google::Cloud::Retail::V2::SearchRequest::ConversationalSearchSpec, ::Hash] + # Optional. This field specifies all conversational related parameters + # addition to traditional retail search. + # @param tile_navigation_spec [::Google::Cloud::Retail::V2::SearchRequest::TileNavigationSpec, ::Hash] + # Optional. This field specifies tile navigation related parameters. + # @param language_code [::String] + # Optional. The BCP-47 language code, such as "en-US" or "sr-Latn" + # [list](https://www.unicode.org/cldr/charts/46/summary/root.html). For more + # information, see [Standardized codes](https://google.aip.dev/143). This + # field helps to better interpret the query. If a value isn't specified, the + # query language code is automatically detected, which may not be accurate. + # @param region_code [::String] + # Optional. The Unicode country/region code (CLDR) of a location, such as + # "US" and "419" + # [list](https://www.unicode.org/cldr/charts/46/supplemental/territory_information.html). + # For more information, see [Standardized codes](https://google.aip.dev/143). + # If set, then results will be boosted based on the region_code provided. + # @param place_id [::String] + # Optional. An id corresponding to a place, such as a store id or region id. + # When specified, we use the price from the local inventory with the matching + # product's + # {::Google::Cloud::Retail::V2::LocalInventory#place_id LocalInventory.place_id} + # for revenue optimization. + # @param user_attributes [::Hash{::String => ::Google::Cloud::Retail::V2::StringList, ::Hash}] + # Optional. The user attributes that could be used for personalization of + # search results. + # * Populate at most 100 key-value pairs per query. + # * Only supports string keys and repeated string values. + # * Duplcate keys are not allowed within a single query. + # + # Example: + # user_attributes: [ + # { key: "pets" + # value { + # values: "dog" + # values: "cat" + # } + # }, + # { key: "state" + # value { + # values: "CA" + # } + # } + # ] + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Gapic::Rest::PagedEnumerable<::Google::Cloud::Retail::V2::SearchResponse::SearchResult>] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Gapic::Rest::PagedEnumerable<::Google::Cloud::Retail::V2::SearchResponse::SearchResult>] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/retail/v2" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Retail::V2::SearchService::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Retail::V2::SearchRequest.new + # + # # Call the search method. + # result = client.search request + # + # # The returned object is of type Gapic::PagedEnumerable. You can iterate + # # over elements, and API calls will be issued to fetch pages as needed. + # result.each do |item| + # # Each element is of type ::Google::Cloud::Retail::V2::SearchResponse::SearchResult. + # p item + # end + # + def search request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Retail::V2::SearchRequest + + # Converts hash 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.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::Retail::V2::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + options.apply_defaults timeout: @config.rpcs.search.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.search.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @search_service_stub.search request, options do |result, operation| + result = ::Gapic::Rest::PagedEnumerable.new @search_service_stub, :search, "results", 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 SearchService REST API. + # + # This class represents the configuration for SearchService REST, + # providing control over timeouts, retry behavior, logging, transport + # parameters, and other low-level controls. Certain parameters can also be + # applied individually to specific RPCs. See + # {::Google::Cloud::Retail::V2::SearchService::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 + # # search to 20 seconds, + # # and all remaining timeouts to 10 seconds. + # ::Google::Cloud::Retail::V2::SearchService::Rest::Client.configure do |config| + # config.timeout = 10.0 + # config.rpcs.search.timeout = 20.0 + # end + # + # # Apply the above configuration only to a new client. + # client = ::Google::Cloud::Retail::V2::SearchService::Rest::Client.new do |config| + # config.timeout = 10.0 + # config.rpcs.search.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 = "retail.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 SearchService 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 `search` + # @return [::Gapic::Config::Method] + # + attr_reader :search + + # @private + def initialize parent_rpcs = nil + search_config = parent_rpcs.search if parent_rpcs.respond_to? :search + @search = ::Gapic::Config::Method.new search_config + + yield self if block_given? + end + end + end + end + end + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-retail-v2/lib/google/cloud/retail/v2/search_service/rest/service_stub.rb b/owl-bot-staging/google-cloud-retail-v2/lib/google/cloud/retail/v2/search_service/rest/service_stub.rb new file mode 100644 index 000000000000..826122ca8f8d --- /dev/null +++ b/owl-bot-staging/google-cloud-retail-v2/lib/google/cloud/retail/v2/search_service/rest/service_stub.rb @@ -0,0 +1,151 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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/retail/v2/search_service_pb" + +module Google + module Cloud + module Retail + module V2 + module SearchService + module Rest + ## + # REST service stub for the SearchService 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 search REST call + # + # @param request_pb [::Google::Cloud::Retail::V2::SearchRequest] + # A request object representing the call parameters. Required. + # @param options [::Gapic::CallOptions] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Cloud::Retail::V2::SearchResponse] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::Retail::V2::SearchResponse] + # A result object deserialized from the server's reply + def search request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_search_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", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Cloud::Retail::V2::SearchResponse.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 search REST call + # + # @param request_pb [::Google::Cloud::Retail::V2::SearchRequest] + # 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_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :post, + uri_template: "/v2/{placement}:search", + body: "*", + matches: [ + ["placement", %r{^projects/[^/]+/locations/[^/]+/catalogs/[^/]+/placements/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v2/{placement}:search", + body: "*", + matches: [ + ["placement", %r{^projects/[^/]+/locations/[^/]+/catalogs/[^/]+/servingConfigs/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + end + end + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-retail-v2/lib/google/cloud/retail/v2/search_service_pb.rb b/owl-bot-staging/google-cloud-retail-v2/lib/google/cloud/retail/v2/search_service_pb.rb new file mode 100644 index 000000000000..286deb6e40e7 --- /dev/null +++ b/owl-bot-staging/google-cloud-retail-v2/lib/google/cloud/retail/v2/search_service_pb.rb @@ -0,0 +1,61 @@ +# frozen_string_literal: true +# Generated by the protocol buffer compiler. DO NOT EDIT! +# source: google/cloud/retail/v2/search_service.proto + +require 'google/protobuf' + +require 'google/api/annotations_pb' +require 'google/api/client_pb' +require 'google/api/field_behavior_pb' +require 'google/api/resource_pb' +require 'google/cloud/retail/v2/common_pb' +require 'google/cloud/retail/v2/product_pb' +require 'google/protobuf/field_mask_pb' +require 'google/protobuf/struct_pb' + + +descriptor_data = "\n+google/cloud/retail/v2/search_service.proto\x12\x16google.cloud.retail.v2\x1a\x1cgoogle/api/annotations.proto\x1a\x17google/api/client.proto\x1a\x1fgoogle/api/field_behavior.proto\x1a\x19google/api/resource.proto\x1a#google/cloud/retail/v2/common.proto\x1a$google/cloud/retail/v2/product.proto\x1a google/protobuf/field_mask.proto\x1a\x1cgoogle/protobuf/struct.proto\"4\n\x15ProductAttributeValue\x12\x0c\n\x04name\x18\x01 \x01(\t\x12\r\n\x05value\x18\x02 \x01(\t\"\\\n\x18ProductAttributeInterval\x12\x0c\n\x04name\x18\x01 \x01(\t\x12\x32\n\x08interval\x18\x02 \x01(\x0b\x32 .google.cloud.retail.v2.Interval\"\xe8\x01\n\x04Tile\x12P\n\x17product_attribute_value\x18\x01 \x01(\x0b\x32-.google.cloud.retail.v2.ProductAttributeValueH\x00\x12V\n\x1aproduct_attribute_interval\x18\x02 \x01(\x0b\x32\x30.google.cloud.retail.v2.ProductAttributeIntervalH\x00\x12!\n\x19representative_product_id\x18\x03 \x01(\tB\x13\n\x11product_attribute\"\x8d\x1c\n\rSearchRequest\x12\x16\n\tplacement\x18\x01 \x01(\tB\x03\xe0\x41\x02\x12\x31\n\x06\x62ranch\x18\x02 \x01(\tB!\xfa\x41\x1e\n\x1cretail.googleapis.com/Branch\x12\r\n\x05query\x18\x03 \x01(\t\x12\x17\n\nvisitor_id\x18\x04 \x01(\tB\x03\xe0\x41\x02\x12\x33\n\tuser_info\x18\x05 \x01(\x0b\x32 .google.cloud.retail.v2.UserInfo\x12\x11\n\tpage_size\x18\x07 \x01(\x05\x12\x12\n\npage_token\x18\x08 \x01(\t\x12\x0e\n\x06offset\x18\t \x01(\x05\x12\x0e\n\x06\x66ilter\x18\n \x01(\t\x12\x18\n\x10\x63\x61nonical_filter\x18\x1c \x01(\t\x12\x10\n\x08order_by\x18\x0b \x01(\t\x12\x44\n\x0b\x66\x61\x63\x65t_specs\x18\x0c \x03(\x0b\x32/.google.cloud.retail.v2.SearchRequest.FacetSpec\x12V\n\x12\x64ynamic_facet_spec\x18\x15 \x01(\x0b\x32\x36.google.cloud.retail.v2.SearchRequest.DynamicFacetSpecB\x02\x18\x01\x12\x43\n\nboost_spec\x18\r \x01(\x0b\x32/.google.cloud.retail.v2.SearchRequest.BoostSpec\x12V\n\x14query_expansion_spec\x18\x0e \x01(\x0b\x32\x38.google.cloud.retail.v2.SearchRequest.QueryExpansionSpec\x12\x1b\n\x13variant_rollup_keys\x18\x11 \x03(\t\x12\x17\n\x0fpage_categories\x18\x17 \x03(\t\x12\x45\n\x0bsearch_mode\x18\x1f \x01(\x0e\x32\x30.google.cloud.retail.v2.SearchRequest.SearchMode\x12W\n\x14personalization_spec\x18 \x01(\x0b\x32\x39.google.cloud.retail.v2.SearchRequest.PersonalizationSpec\x12\x41\n\x06labels\x18\" \x03(\x0b\x32\x31.google.cloud.retail.v2.SearchRequest.LabelsEntry\x12]\n\x15spell_correction_spec\x18# \x01(\x0b\x32\x39.google.cloud.retail.v2.SearchRequest.SpellCorrectionSpecH\x00\x88\x01\x01\x12\x0e\n\x06\x65ntity\x18& \x01(\t\x12g\n\x1a\x63onversational_search_spec\x18( \x01(\x0b\x32>.google.cloud.retail.v2.SearchRequest.ConversationalSearchSpecB\x03\xe0\x41\x01\x12[\n\x14tile_navigation_spec\x18) \x01(\x0b\x32\x38.google.cloud.retail.v2.SearchRequest.TileNavigationSpecB\x03\xe0\x41\x01\x12\x1a\n\rlanguage_code\x18+ \x01(\tB\x03\xe0\x41\x01\x12\x18\n\x0bregion_code\x18, \x01(\tB\x03\xe0\x41\x01\x12\x15\n\x08place_id\x18. \x01(\tB\x03\xe0\x41\x01\x12W\n\x0fuser_attributes\x18/ \x03(\x0b\x32\x39.google.cloud.retail.v2.SearchRequest.UserAttributesEntryB\x03\xe0\x41\x01\x1a\x91\x03\n\tFacetSpec\x12P\n\tfacet_key\x18\x01 \x01(\x0b\x32\x38.google.cloud.retail.v2.SearchRequest.FacetSpec.FacetKeyB\x03\xe0\x41\x02\x12\r\n\x05limit\x18\x02 \x01(\x05\x12\x1c\n\x14\x65xcluded_filter_keys\x18\x03 \x03(\t\x12\x1f\n\x17\x65nable_dynamic_position\x18\x04 \x01(\x08\x1a\xe3\x01\n\x08\x46\x61\x63\x65tKey\x12\x10\n\x03key\x18\x01 \x01(\tB\x03\xe0\x41\x02\x12\x33\n\tintervals\x18\x02 \x03(\x0b\x32 .google.cloud.retail.v2.Interval\x12\x19\n\x11restricted_values\x18\x03 \x03(\t\x12\x10\n\x08prefixes\x18\x08 \x03(\t\x12\x10\n\x08\x63ontains\x18\t \x03(\t\x12\x18\n\x10\x63\x61se_insensitive\x18\n \x01(\x08\x12\x10\n\x08order_by\x18\x04 \x01(\t\x12\r\n\x05query\x18\x05 \x01(\t\x12\x16\n\x0ereturn_min_max\x18\x0b \x01(\x08\x1a\x96\x01\n\x10\x44ynamicFacetSpec\x12I\n\x04mode\x18\x01 \x01(\x0e\x32;.google.cloud.retail.v2.SearchRequest.DynamicFacetSpec.Mode\"7\n\x04Mode\x12\x14\n\x10MODE_UNSPECIFIED\x10\x00\x12\x0c\n\x08\x44ISABLED\x10\x01\x12\x0b\n\x07\x45NABLED\x10\x02\x1a\xee\x01\n\tBoostSpec\x12\x61\n\x15\x63ondition_boost_specs\x18\x01 \x03(\x0b\x32\x42.google.cloud.retail.v2.SearchRequest.BoostSpec.ConditionBoostSpec\x12\'\n\x1askip_boost_spec_validation\x18\x02 \x01(\x08H\x00\x88\x01\x01\x1a\x36\n\x12\x43onditionBoostSpec\x12\x11\n\tcondition\x18\x01 \x01(\t\x12\r\n\x05\x62oost\x18\x02 \x01(\x02\x42\x1d\n\x1b_skip_boost_spec_validation\x1a\xcb\x01\n\x12QueryExpansionSpec\x12U\n\tcondition\x18\x01 \x01(\x0e\x32\x42.google.cloud.retail.v2.SearchRequest.QueryExpansionSpec.Condition\x12\x1e\n\x16pin_unexpanded_results\x18\x02 \x01(\x08\">\n\tCondition\x12\x19\n\x15\x43ONDITION_UNSPECIFIED\x10\x00\x12\x0c\n\x08\x44ISABLED\x10\x01\x12\x08\n\x04\x41UTO\x10\x03\x1a\x99\x01\n\x13PersonalizationSpec\x12L\n\x04mode\x18\x01 \x01(\x0e\x32>.google.cloud.retail.v2.SearchRequest.PersonalizationSpec.Mode\"4\n\x04Mode\x12\x14\n\x10MODE_UNSPECIFIED\x10\x00\x12\x08\n\x04\x41UTO\x10\x01\x12\x0c\n\x08\x44ISABLED\x10\x02\x1a\xa0\x01\n\x13SpellCorrectionSpec\x12L\n\x04mode\x18\x01 \x01(\x0e\x32>.google.cloud.retail.v2.SearchRequest.SpellCorrectionSpec.Mode\";\n\x04Mode\x12\x14\n\x10MODE_UNSPECIFIED\x10\x00\x12\x13\n\x0fSUGGESTION_ONLY\x10\x01\x12\x08\n\x04\x41UTO\x10\x02\x1a\x97\x04\n\x18\x43onversationalSearchSpec\x12\'\n\x1f\x66ollowup_conversation_requested\x18\x01 \x01(\x08\x12\x17\n\x0f\x63onversation_id\x18\x02 \x01(\t\x12^\n\x0buser_answer\x18\x03 \x01(\x0b\x32I.google.cloud.retail.v2.SearchRequest.ConversationalSearchSpec.UserAnswer\x1a\xd8\x02\n\nUserAnswer\x12\x15\n\x0btext_answer\x18\x01 \x01(\tH\x00\x12s\n\x0fselected_answer\x18\x02 \x01(\x0b\x32X.google.cloud.retail.v2.SearchRequest.ConversationalSearchSpec.UserAnswer.SelectedAnswerH\x00\x1a\xb5\x01\n\x0eSelectedAnswer\x12S\n\x18product_attribute_values\x18\x01 \x03(\x0b\x32-.google.cloud.retail.v2.ProductAttributeValueB\x02\x18\x01\x12N\n\x17product_attribute_value\x18\x02 \x01(\x0b\x32-.google.cloud.retail.v2.ProductAttributeValueB\x06\n\x04type\x1al\n\x12TileNavigationSpec\x12!\n\x19tile_navigation_requested\x18\x01 \x01(\x08\x12\x33\n\rapplied_tiles\x18\x02 \x03(\x0b\x32\x1c.google.cloud.retail.v2.Tile\x1a-\n\x0bLabelsEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12\r\n\x05value\x18\x02 \x01(\t:\x02\x38\x01\x1aY\n\x13UserAttributesEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12\x31\n\x05value\x18\x02 \x01(\x0b\x32\".google.cloud.retail.v2.StringList:\x02\x38\x01\"[\n\nSearchMode\x12\x1b\n\x17SEARCH_MODE_UNSPECIFIED\x10\x00\x12\x17\n\x13PRODUCT_SEARCH_ONLY\x10\x01\x12\x17\n\x13\x46\x41\x43\x45TED_SEARCH_ONLY\x10\x02\x42\x18\n\x16_spell_correction_spec\"\xa5\x14\n\x0eSearchResponse\x12\x44\n\x07results\x18\x01 \x03(\x0b\x32\x33.google.cloud.retail.v2.SearchResponse.SearchResult\x12<\n\x06\x66\x61\x63\x65ts\x18\x02 \x03(\x0b\x32,.google.cloud.retail.v2.SearchResponse.Facet\x12\x12\n\ntotal_size\x18\x03 \x01(\x05\x12\x17\n\x0f\x63orrected_query\x18\x04 \x01(\t\x12\x19\n\x11\x61ttribution_token\x18\x05 \x01(\t\x12\x17\n\x0fnext_page_token\x18\x06 \x01(\t\x12W\n\x14query_expansion_info\x18\x07 \x01(\x0b\x32\x39.google.cloud.retail.v2.SearchResponse.QueryExpansionInfo\x12\x14\n\x0credirect_uri\x18\n \x01(\t\x12\x18\n\x10\x61pplied_controls\x18\x0c \x03(\t\x12H\n\x14pin_control_metadata\x18\x16 \x01(\x0b\x32*.google.cloud.retail.v2.PinControlMetadata\x12i\n\x1dinvalid_condition_boost_specs\x18\x0e \x03(\x0b\x32\x42.google.cloud.retail.v2.SearchRequest.BoostSpec.ConditionBoostSpec\x12?\n\x0f\x65xperiment_info\x18\x11 \x03(\x0b\x32&.google.cloud.retail.v2.ExperimentInfo\x12g\n\x1c\x63onversational_search_result\x18\x12 \x01(\x0b\x32\x41.google.cloud.retail.v2.SearchResponse.ConversationalSearchResult\x12[\n\x16tile_navigation_result\x18\x13 \x01(\x0b\x32;.google.cloud.retail.v2.SearchResponse.TileNavigationResult\x1a\xc5\x05\n\x0cSearchResult\x12\n\n\x02id\x18\x01 \x01(\t\x12\x30\n\x07product\x18\x02 \x01(\x0b\x32\x1f.google.cloud.retail.v2.Product\x12\x1e\n\x16matching_variant_count\x18\x03 \x01(\x05\x12o\n\x17matching_variant_fields\x18\x04 \x03(\x0b\x32N.google.cloud.retail.v2.SearchResponse.SearchResult.MatchingVariantFieldsEntry\x12k\n\x15variant_rollup_values\x18\x05 \x03(\x0b\x32L.google.cloud.retail.v2.SearchResponse.SearchResult.VariantRollupValuesEntry\x12\x17\n\x0fpersonal_labels\x18\x07 \x03(\t\x12Z\n\x0cmodel_scores\x18\x08 \x03(\x0b\x32\x44.google.cloud.retail.v2.SearchResponse.SearchResult.ModelScoresEntry\x1aX\n\x1aMatchingVariantFieldsEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12)\n\x05value\x18\x02 \x01(\x0b\x32\x1a.google.protobuf.FieldMask:\x02\x38\x01\x1aR\n\x18VariantRollupValuesEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12%\n\x05value\x18\x02 \x01(\x0b\x32\x16.google.protobuf.Value:\x02\x38\x01\x1aV\n\x10ModelScoresEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12\x31\n\x05value\x18\x02 \x01(\x0b\x32\".google.cloud.retail.v2.DoubleList:\x02\x38\x01\x1a\x8e\x02\n\x05\x46\x61\x63\x65t\x12\x0b\n\x03key\x18\x01 \x01(\t\x12G\n\x06values\x18\x02 \x03(\x0b\x32\x37.google.cloud.retail.v2.SearchResponse.Facet.FacetValue\x12\x15\n\rdynamic_facet\x18\x03 \x01(\x08\x1a\x97\x01\n\nFacetValue\x12\x0f\n\x05value\x18\x01 \x01(\tH\x00\x12\x34\n\x08interval\x18\x02 \x01(\x0b\x32 .google.cloud.retail.v2.IntervalH\x00\x12\r\n\x05\x63ount\x18\x03 \x01(\x03\x12\x11\n\tmin_value\x18\x05 \x01(\x01\x12\x11\n\tmax_value\x18\x06 \x01(\x01\x42\r\n\x0b\x66\x61\x63\x65t_value\x1aI\n\x12QueryExpansionInfo\x12\x16\n\x0e\x65xpanded_query\x18\x01 \x01(\x08\x12\x1b\n\x13pinned_result_count\x18\x02 \x01(\x03\x1a\xff\x04\n\x1a\x43onversationalSearchResult\x12\x17\n\x0f\x63onversation_id\x18\x01 \x01(\t\x12\x15\n\rrefined_query\x18\x02 \x01(\t\x12r\n\x12\x61\x64\x64itional_filters\x18\x03 \x03(\x0b\x32R.google.cloud.retail.v2.SearchResponse.ConversationalSearchResult.AdditionalFilterB\x02\x18\x01\x12\x19\n\x11\x66ollowup_question\x18\x04 \x01(\t\x12l\n\x11suggested_answers\x18\x05 \x03(\x0b\x32Q.google.cloud.retail.v2.SearchResponse.ConversationalSearchResult.SuggestedAnswer\x12m\n\x11\x61\x64\x64itional_filter\x18\x06 \x01(\x0b\x32R.google.cloud.retail.v2.SearchResponse.ConversationalSearchResult.AdditionalFilter\x1a\x61\n\x0fSuggestedAnswer\x12N\n\x17product_attribute_value\x18\x01 \x01(\x0b\x32-.google.cloud.retail.v2.ProductAttributeValue\x1a\x62\n\x10\x41\x64\x64itionalFilter\x12N\n\x17product_attribute_value\x18\x01 \x01(\x0b\x32-.google.cloud.retail.v2.ProductAttributeValue\x1a\x43\n\x14TileNavigationResult\x12+\n\x05tiles\x18\x01 \x03(\x0b\x32\x1c.google.cloud.retail.v2.Tile\"\xfb\x02\n\x0e\x45xperimentInfo\x12\x63\n\x19serving_config_experiment\x18\x02 \x01(\x0b\x32>.google.cloud.retail.v2.ExperimentInfo.ServingConfigExperimentH\x00\x12\x39\n\nexperiment\x18\x01 \x01(\tB%\xfa\x41\"\n retail.googleapis.com/Experiment\x1a\xb1\x01\n\x17ServingConfigExperiment\x12I\n\x17original_serving_config\x18\x01 \x01(\tB(\xfa\x41%\n#retail.googleapis.com/ServingConfig\x12K\n\x19\x65xperiment_serving_config\x18\x02 \x01(\tB(\xfa\x41%\n#retail.googleapis.com/ServingConfigB\x15\n\x13\x65xperiment_metadata2\xd8\x02\n\rSearchService\x12\xfb\x01\n\x06Search\x12%.google.cloud.retail.v2.SearchRequest\x1a&.google.cloud.retail.v2.SearchResponse\"\xa1\x01\x82\xd3\xe4\x93\x02\x9a\x01\"E/v2/{placement=projects/*/locations/*/catalogs/*/placements/*}:search:\x01*ZN\"I/v2/{placement=projects/*/locations/*/catalogs/*/servingConfigs/*}:search:\x01*\x1aI\xca\x41\x15retail.googleapis.com\xd2\x41.https://www.googleapis.com/auth/cloud-platformB\xb7\x02\n\x1a\x63om.google.cloud.retail.v2B\x12SearchServiceProtoP\x01Z2cloud.google.com/go/retail/apiv2/retailpb;retailpb\xa2\x02\x06RETAIL\xaa\x02\x16Google.Cloud.Retail.V2\xca\x02\x16Google\\Cloud\\Retail\\V2\xea\x02\x19Google::Cloud::Retail::V2\xea\x41w\n retail.googleapis.com/Experiment\x12Sprojects/{project}/locations/{location}/catalogs/{catalog}/experiments/{experiment}b\x06proto3" + +pool = ::Google::Protobuf::DescriptorPool.generated_pool +pool.add_serialized_file(descriptor_data) + +module Google + module Cloud + module Retail + module V2 + ProductAttributeValue = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.retail.v2.ProductAttributeValue").msgclass + ProductAttributeInterval = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.retail.v2.ProductAttributeInterval").msgclass + Tile = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.retail.v2.Tile").msgclass + SearchRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.retail.v2.SearchRequest").msgclass + SearchRequest::FacetSpec = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.retail.v2.SearchRequest.FacetSpec").msgclass + SearchRequest::FacetSpec::FacetKey = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.retail.v2.SearchRequest.FacetSpec.FacetKey").msgclass + SearchRequest::DynamicFacetSpec = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.retail.v2.SearchRequest.DynamicFacetSpec").msgclass + SearchRequest::DynamicFacetSpec::Mode = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.retail.v2.SearchRequest.DynamicFacetSpec.Mode").enummodule + SearchRequest::BoostSpec = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.retail.v2.SearchRequest.BoostSpec").msgclass + SearchRequest::BoostSpec::ConditionBoostSpec = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.retail.v2.SearchRequest.BoostSpec.ConditionBoostSpec").msgclass + SearchRequest::QueryExpansionSpec = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.retail.v2.SearchRequest.QueryExpansionSpec").msgclass + SearchRequest::QueryExpansionSpec::Condition = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.retail.v2.SearchRequest.QueryExpansionSpec.Condition").enummodule + SearchRequest::PersonalizationSpec = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.retail.v2.SearchRequest.PersonalizationSpec").msgclass + SearchRequest::PersonalizationSpec::Mode = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.retail.v2.SearchRequest.PersonalizationSpec.Mode").enummodule + SearchRequest::SpellCorrectionSpec = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.retail.v2.SearchRequest.SpellCorrectionSpec").msgclass + SearchRequest::SpellCorrectionSpec::Mode = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.retail.v2.SearchRequest.SpellCorrectionSpec.Mode").enummodule + SearchRequest::ConversationalSearchSpec = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.retail.v2.SearchRequest.ConversationalSearchSpec").msgclass + SearchRequest::ConversationalSearchSpec::UserAnswer = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.retail.v2.SearchRequest.ConversationalSearchSpec.UserAnswer").msgclass + SearchRequest::ConversationalSearchSpec::UserAnswer::SelectedAnswer = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.retail.v2.SearchRequest.ConversationalSearchSpec.UserAnswer.SelectedAnswer").msgclass + SearchRequest::TileNavigationSpec = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.retail.v2.SearchRequest.TileNavigationSpec").msgclass + SearchRequest::SearchMode = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.retail.v2.SearchRequest.SearchMode").enummodule + SearchResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.retail.v2.SearchResponse").msgclass + SearchResponse::SearchResult = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.retail.v2.SearchResponse.SearchResult").msgclass + SearchResponse::Facet = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.retail.v2.SearchResponse.Facet").msgclass + SearchResponse::Facet::FacetValue = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.retail.v2.SearchResponse.Facet.FacetValue").msgclass + SearchResponse::QueryExpansionInfo = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.retail.v2.SearchResponse.QueryExpansionInfo").msgclass + SearchResponse::ConversationalSearchResult = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.retail.v2.SearchResponse.ConversationalSearchResult").msgclass + SearchResponse::ConversationalSearchResult::SuggestedAnswer = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.retail.v2.SearchResponse.ConversationalSearchResult.SuggestedAnswer").msgclass + SearchResponse::ConversationalSearchResult::AdditionalFilter = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.retail.v2.SearchResponse.ConversationalSearchResult.AdditionalFilter").msgclass + SearchResponse::TileNavigationResult = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.retail.v2.SearchResponse.TileNavigationResult").msgclass + ExperimentInfo = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.retail.v2.ExperimentInfo").msgclass + ExperimentInfo::ServingConfigExperiment = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.retail.v2.ExperimentInfo.ServingConfigExperiment").msgclass + end + end + end +end diff --git a/owl-bot-staging/google-cloud-retail-v2/lib/google/cloud/retail/v2/search_service_services_pb.rb b/owl-bot-staging/google-cloud-retail-v2/lib/google/cloud/retail/v2/search_service_services_pb.rb new file mode 100644 index 000000000000..48bf05ab1516 --- /dev/null +++ b/owl-bot-staging/google-cloud-retail-v2/lib/google/cloud/retail/v2/search_service_services_pb.rb @@ -0,0 +1,51 @@ +# Generated by the protocol buffer compiler. DO NOT EDIT! +# Source: google/cloud/retail/v2/search_service.proto for package 'Google.Cloud.Retail.V2' +# Original file comments: +# 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 +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# + +require 'grpc' +require 'google/cloud/retail/v2/search_service_pb' + +module Google + module Cloud + module Retail + module V2 + module SearchService + # Service for search. + # + # This feature is only available for users who have Retail Search enabled. + # Enable Retail Search on Cloud Console before using this feature. + class Service + + include ::GRPC::GenericService + + self.marshal_class_method = :encode + self.unmarshal_class_method = :decode + self.service_name = 'google.cloud.retail.v2.SearchService' + + # Performs a search. + # + # This feature is only available for users who have Retail Search enabled. + # Enable Retail Search on Cloud Console before using this feature. + rpc :Search, ::Google::Cloud::Retail::V2::SearchRequest, ::Google::Cloud::Retail::V2::SearchResponse + end + + Stub = Service.rpc_stub_class + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-retail-v2/lib/google/cloud/retail/v2/serving_config_pb.rb b/owl-bot-staging/google-cloud-retail-v2/lib/google/cloud/retail/v2/serving_config_pb.rb new file mode 100644 index 000000000000..151bee6ebbef --- /dev/null +++ b/owl-bot-staging/google-cloud-retail-v2/lib/google/cloud/retail/v2/serving_config_pb.rb @@ -0,0 +1,27 @@ +# frozen_string_literal: true +# Generated by the protocol buffer compiler. DO NOT EDIT! +# source: google/cloud/retail/v2/serving_config.proto + +require 'google/protobuf' + +require 'google/api/field_behavior_pb' +require 'google/api/resource_pb' +require 'google/cloud/retail/v2/common_pb' +require 'google/cloud/retail/v2/search_service_pb' + + +descriptor_data = "\n+google/cloud/retail/v2/serving_config.proto\x12\x16google.cloud.retail.v2\x1a\x1fgoogle/api/field_behavior.proto\x1a\x19google/api/resource.proto\x1a#google/cloud/retail/v2/common.proto\x1a+google/cloud/retail/v2/search_service.proto\"\x96\x08\n\rServingConfig\x12\x11\n\x04name\x18\x01 \x01(\tB\x03\xe0\x41\x05\x12\x19\n\x0c\x64isplay_name\x18\x02 \x01(\tB\x03\xe0\x41\x02\x12\x10\n\x08model_id\x18\x03 \x01(\t\x12\x1d\n\x15price_reranking_level\x18\x04 \x01(\t\x12\x19\n\x11\x66\x61\x63\x65t_control_ids\x18\x05 \x03(\t\x12R\n\x12\x64ynamic_facet_spec\x18\x06 \x01(\x0b\x32\x36.google.cloud.retail.v2.SearchRequest.DynamicFacetSpec\x12\x19\n\x11\x62oost_control_ids\x18\x07 \x03(\t\x12\x1a\n\x12\x66ilter_control_ids\x18\t \x03(\t\x12\x1c\n\x14redirect_control_ids\x18\n \x03(\t\x12#\n\x1btwoway_synonyms_control_ids\x18\x12 \x03(\t\x12#\n\x1boneway_synonyms_control_ids\x18\x0c \x03(\t\x12$\n\x1c\x64o_not_associate_control_ids\x18\r \x03(\t\x12\x1f\n\x17replacement_control_ids\x18\x0e \x03(\t\x12\x1a\n\x12ignore_control_ids\x18\x0f \x03(\t\x12\x17\n\x0f\x64iversity_level\x18\x08 \x01(\t\x12K\n\x0e\x64iversity_type\x18\x14 \x01(\x0e\x32\x33.google.cloud.retail.v2.ServingConfig.DiversityType\x12$\n\x1c\x65nable_category_filter_level\x18\x10 \x01(\t\x12\x1c\n\x14ignore_recs_denylist\x18\x18 \x01(\x08\x12W\n\x14personalization_spec\x18\x15 \x01(\x0b\x32\x39.google.cloud.retail.v2.SearchRequest.PersonalizationSpec\x12\x44\n\x0esolution_types\x18\x13 \x03(\x0e\x32$.google.cloud.retail.v2.SolutionTypeB\x06\xe0\x41\x02\xe0\x41\x05\"d\n\rDiversityType\x12\x1e\n\x1a\x44IVERSITY_TYPE_UNSPECIFIED\x10\x00\x12\x18\n\x14RULE_BASED_DIVERSITY\x10\x02\x12\x19\n\x15\x44\x41TA_DRIVEN_DIVERSITY\x10\x03:\x85\x01\xea\x41\x81\x01\n#retail.googleapis.com/ServingConfig\x12Zprojects/{project}/locations/{location}/catalogs/{catalog}/servingConfigs/{serving_config}B\xbd\x01\n\x1a\x63om.google.cloud.retail.v2B\x12ServingConfigProtoP\x01Z2cloud.google.com/go/retail/apiv2/retailpb;retailpb\xa2\x02\x06RETAIL\xaa\x02\x16Google.Cloud.Retail.V2\xca\x02\x16Google\\Cloud\\Retail\\V2\xea\x02\x19Google::Cloud::Retail::V2b\x06proto3" + +pool = ::Google::Protobuf::DescriptorPool.generated_pool +pool.add_serialized_file(descriptor_data) + +module Google + module Cloud + module Retail + module V2 + ServingConfig = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.retail.v2.ServingConfig").msgclass + ServingConfig::DiversityType = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.retail.v2.ServingConfig.DiversityType").enummodule + end + end + end +end diff --git a/owl-bot-staging/google-cloud-retail-v2/lib/google/cloud/retail/v2/serving_config_service.rb b/owl-bot-staging/google-cloud-retail-v2/lib/google/cloud/retail/v2/serving_config_service.rb new file mode 100644 index 000000000000..4a0503a4322d --- /dev/null +++ b/owl-bot-staging/google-cloud-retail-v2/lib/google/cloud/retail/v2/serving_config_service.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/retail/v2/version" + +require "google/cloud/retail/v2/serving_config_service/credentials" +require "google/cloud/retail/v2/serving_config_service/paths" +require "google/cloud/retail/v2/serving_config_service/client" +require "google/cloud/retail/v2/serving_config_service/rest" + +module Google + module Cloud + module Retail + module V2 + ## + # Service for modifying ServingConfig. + # + # @example Load this service and instantiate a gRPC client + # + # require "google/cloud/retail/v2/serving_config_service" + # client = ::Google::Cloud::Retail::V2::ServingConfigService::Client.new + # + # @example Load this service and instantiate a REST client + # + # require "google/cloud/retail/v2/serving_config_service/rest" + # client = ::Google::Cloud::Retail::V2::ServingConfigService::Rest::Client.new + # + module ServingConfigService + end + end + end + end +end + +helper_path = ::File.join __dir__, "serving_config_service", "helpers.rb" +require "google/cloud/retail/v2/serving_config_service/helpers" if ::File.file? helper_path diff --git a/owl-bot-staging/google-cloud-retail-v2/lib/google/cloud/retail/v2/serving_config_service/client.rb b/owl-bot-staging/google-cloud-retail-v2/lib/google/cloud/retail/v2/serving_config_service/client.rb new file mode 100644 index 000000000000..76f012dfb52e --- /dev/null +++ b/owl-bot-staging/google-cloud-retail-v2/lib/google/cloud/retail/v2/serving_config_service/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/cloud/retail/v2/serving_config_service_pb" +require "google/cloud/location" + +module Google + module Cloud + module Retail + module V2 + module ServingConfigService + ## + # Client for the ServingConfigService service. + # + # Service for modifying ServingConfig. + # + class Client + # @private + API_VERSION = "" + + # @private + DEFAULT_ENDPOINT_TEMPLATE = "retail.$UNIVERSE_DOMAIN$" + + include Paths + + # @private + attr_reader :serving_config_service_stub + + ## + # Configure the ServingConfigService Client class. + # + # See {::Google::Cloud::Retail::V2::ServingConfigService::Client::Configuration} + # for a description of the configuration fields. + # + # @example + # + # # Modify the configuration for all ServingConfigService clients + # ::Google::Cloud::Retail::V2::ServingConfigService::Client.configure do |config| + # config.timeout = 10.0 + # end + # + # @yield [config] Configure the Client client. + # @yieldparam config [Client::Configuration] + # + # @return [Client::Configuration] + # + def self.configure + @configure ||= begin + namespace = ["Google", "Cloud", "Retail", "V2"] + parent_config = while namespace.any? + parent_name = namespace.join "::" + parent_const = const_get parent_name + break parent_const.configure if parent_const.respond_to? :configure + namespace.pop + end + default_config = Client::Configuration.new parent_config + + default_config + end + yield @configure if block_given? + @configure + end + + ## + # Configure the ServingConfigService Client instance. + # + # The configuration is set to the derived mode, meaning that values can be changed, + # but structural changes (adding new fields, etc.) are not allowed. Structural changes + # should be made on {Client.configure}. + # + # See {::Google::Cloud::Retail::V2::ServingConfigService::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 + @serving_config_service_stub.universe_domain + end + + ## + # Create a new ServingConfigService client object. + # + # @example + # + # # Create a client using the default configuration + # client = ::Google::Cloud::Retail::V2::ServingConfigService::Client.new + # + # # Create a client using a custom configuration + # client = ::Google::Cloud::Retail::V2::ServingConfigService::Client.new do |config| + # config.timeout = 10.0 + # end + # + # @yield [config] Configure the ServingConfigService client. + # @yieldparam config [Client::Configuration] + # + def initialize + # These require statements are intentionally placed here to initialize + # the gRPC module only when it's required. + # See https://github.com/googleapis/toolkit/issues/446 + require "gapic/grpc" + require "google/cloud/retail/v2/serving_config_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 + + @serving_config_service_stub = ::Gapic::ServiceStub.new( + ::Google::Cloud::Retail::V2::ServingConfigService::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 + ) + + @serving_config_service_stub.stub_logger&.info do |entry| + entry.set_system_name + entry.set_service + entry.message = "Created client for #{entry.service}" + entry.set_credentials_fields credentials + entry.set "customEndpoint", @config.endpoint if @config.endpoint + entry.set "defaultTimeout", @config.timeout if @config.timeout + entry.set "quotaProject", @quota_project_id if @quota_project_id + end + + @location_client = Google::Cloud::Location::Locations::Client.new do |config| + config.credentials = credentials + config.quota_project = @quota_project_id + config.endpoint = @serving_config_service_stub.endpoint + config.universe_domain = @serving_config_service_stub.universe_domain + config.logger = @serving_config_service_stub.logger if config.respond_to? :logger= + end + end + + ## + # Get the associated client for mix-in of the Locations. + # + # @return [Google::Cloud::Location::Locations::Client] + # + attr_reader :location_client + + ## + # The logger used for request/response debug logging. + # + # @return [Logger] + # + def logger + @serving_config_service_stub.logger + end + + # Service calls + + ## + # Creates a ServingConfig. + # + # A maximum of 100 {::Google::Cloud::Retail::V2::ServingConfig ServingConfig}s are + # allowed in a {::Google::Cloud::Retail::V2::Catalog Catalog}, otherwise a + # FAILED_PRECONDITION error is returned. + # + # @overload create_serving_config(request, options = nil) + # Pass arguments to `create_serving_config` via a request object, either of type + # {::Google::Cloud::Retail::V2::CreateServingConfigRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Retail::V2::CreateServingConfigRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_serving_config(parent: nil, serving_config: nil, serving_config_id: nil) + # Pass arguments to `create_serving_config` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param parent [::String] + # Required. Full resource name of parent. Format: + # `projects/{project_number}/locations/{location_id}/catalogs/{catalog_id}` + # @param serving_config [::Google::Cloud::Retail::V2::ServingConfig, ::Hash] + # Required. The ServingConfig to create. + # @param serving_config_id [::String] + # Required. The ID to use for the ServingConfig, which will become the final + # component of the ServingConfig's resource name. + # + # This value should be 4-63 characters, and valid characters + # are /[a-z][0-9]-_/. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Google::Cloud::Retail::V2::ServingConfig] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Google::Cloud::Retail::V2::ServingConfig] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/retail/v2" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Retail::V2::ServingConfigService::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Retail::V2::CreateServingConfigRequest.new + # + # # Call the create_serving_config method. + # result = client.create_serving_config request + # + # # The returned object is of type Google::Cloud::Retail::V2::ServingConfig. + # p result + # + def create_serving_config request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Retail::V2::CreateServingConfigRequest + + # Converts hash 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_serving_config.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::Retail::V2::VERSION + metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.parent + 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_serving_config.timeout, + metadata: metadata, + retry_policy: @config.rpcs.create_serving_config.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @serving_config_service_stub.call_rpc :create_serving_config, request, options: options do |response, operation| + yield response, operation if block_given? + end + rescue ::GRPC::BadStatus => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Deletes a ServingConfig. + # + # Returns a NotFound error if the ServingConfig does not exist. + # + # @overload delete_serving_config(request, options = nil) + # Pass arguments to `delete_serving_config` via a request object, either of type + # {::Google::Cloud::Retail::V2::DeleteServingConfigRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Retail::V2::DeleteServingConfigRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_serving_config(name: nil) + # Pass arguments to `delete_serving_config` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param name [::String] + # Required. The resource name of the ServingConfig to delete. Format: + # `projects/{project_number}/locations/{location_id}/catalogs/{catalog_id}/servingConfigs/{serving_config_id}` + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Google::Protobuf::Empty] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Google::Protobuf::Empty] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/retail/v2" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Retail::V2::ServingConfigService::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Retail::V2::DeleteServingConfigRequest.new + # + # # Call the delete_serving_config method. + # result = client.delete_serving_config request + # + # # The returned object is of type Google::Protobuf::Empty. + # p result + # + def delete_serving_config request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Retail::V2::DeleteServingConfigRequest + + # Converts hash 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_serving_config.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::Retail::V2::VERSION + metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.name + header_params["name"] = request.name + end + + request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") + metadata[:"x-goog-request-params"] ||= request_params_header + + options.apply_defaults timeout: @config.rpcs.delete_serving_config.timeout, + metadata: metadata, + retry_policy: @config.rpcs.delete_serving_config.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @serving_config_service_stub.call_rpc :delete_serving_config, request, options: options do |response, operation| + yield response, operation if block_given? + end + rescue ::GRPC::BadStatus => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Updates a ServingConfig. + # + # @overload update_serving_config(request, options = nil) + # Pass arguments to `update_serving_config` via a request object, either of type + # {::Google::Cloud::Retail::V2::UpdateServingConfigRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Retail::V2::UpdateServingConfigRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_serving_config(serving_config: nil, update_mask: nil) + # Pass arguments to `update_serving_config` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param serving_config [::Google::Cloud::Retail::V2::ServingConfig, ::Hash] + # Required. The ServingConfig to update. + # @param update_mask [::Google::Protobuf::FieldMask, ::Hash] + # Indicates which fields in the provided + # {::Google::Cloud::Retail::V2::ServingConfig ServingConfig} to update. The + # following are NOT supported: + # + # * {::Google::Cloud::Retail::V2::ServingConfig#name ServingConfig.name} + # + # If not set, all supported fields are updated. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Google::Cloud::Retail::V2::ServingConfig] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Google::Cloud::Retail::V2::ServingConfig] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/retail/v2" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Retail::V2::ServingConfigService::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Retail::V2::UpdateServingConfigRequest.new + # + # # Call the update_serving_config method. + # result = client.update_serving_config request + # + # # The returned object is of type Google::Cloud::Retail::V2::ServingConfig. + # p result + # + def update_serving_config request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Retail::V2::UpdateServingConfigRequest + + # Converts hash 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_serving_config.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::Retail::V2::VERSION + metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.serving_config&.name + header_params["serving_config.name"] = request.serving_config.name + end + + request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") + metadata[:"x-goog-request-params"] ||= request_params_header + + options.apply_defaults timeout: @config.rpcs.update_serving_config.timeout, + metadata: metadata, + retry_policy: @config.rpcs.update_serving_config.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @serving_config_service_stub.call_rpc :update_serving_config, request, options: options do |response, operation| + yield response, operation if block_given? + end + rescue ::GRPC::BadStatus => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Gets a ServingConfig. + # + # Returns a NotFound error if the ServingConfig does not exist. + # + # @overload get_serving_config(request, options = nil) + # Pass arguments to `get_serving_config` via a request object, either of type + # {::Google::Cloud::Retail::V2::GetServingConfigRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Retail::V2::GetServingConfigRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_serving_config(name: nil) + # Pass arguments to `get_serving_config` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param name [::String] + # Required. The resource name of the ServingConfig to get. Format: + # `projects/{project_number}/locations/{location_id}/catalogs/{catalog_id}/servingConfigs/{serving_config_id}` + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Google::Cloud::Retail::V2::ServingConfig] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Google::Cloud::Retail::V2::ServingConfig] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/retail/v2" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Retail::V2::ServingConfigService::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Retail::V2::GetServingConfigRequest.new + # + # # Call the get_serving_config method. + # result = client.get_serving_config request + # + # # The returned object is of type Google::Cloud::Retail::V2::ServingConfig. + # p result + # + def get_serving_config request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Retail::V2::GetServingConfigRequest + + # Converts hash 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_serving_config.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::Retail::V2::VERSION + metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.name + header_params["name"] = request.name + end + + request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") + metadata[:"x-goog-request-params"] ||= request_params_header + + options.apply_defaults timeout: @config.rpcs.get_serving_config.timeout, + metadata: metadata, + retry_policy: @config.rpcs.get_serving_config.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @serving_config_service_stub.call_rpc :get_serving_config, request, options: options do |response, operation| + yield response, operation if block_given? + end + rescue ::GRPC::BadStatus => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Lists all ServingConfigs linked to this catalog. + # + # @overload list_serving_configs(request, options = nil) + # Pass arguments to `list_serving_configs` via a request object, either of type + # {::Google::Cloud::Retail::V2::ListServingConfigsRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Retail::V2::ListServingConfigsRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_serving_configs(parent: nil, page_size: nil, page_token: nil) + # Pass arguments to `list_serving_configs` via keyword arguments. Note that at + # least one keyword argument is 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 catalog resource name. Format: + # `projects/{project_number}/locations/{location_id}/catalogs/{catalog_id}` + # @param page_size [::Integer] + # Optional. Maximum number of results to return. If unspecified, defaults + # to 100. If a value greater than 100 is provided, at most 100 results are + # returned. + # @param page_token [::String] + # Optional. A page token, received from a previous `ListServingConfigs` call. + # Provide this to retrieve the subsequent page. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Gapic::PagedEnumerable<::Google::Cloud::Retail::V2::ServingConfig>] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Gapic::PagedEnumerable<::Google::Cloud::Retail::V2::ServingConfig>] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/retail/v2" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Retail::V2::ServingConfigService::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Retail::V2::ListServingConfigsRequest.new + # + # # Call the list_serving_configs method. + # result = client.list_serving_configs request + # + # # The returned object is of type Gapic::PagedEnumerable. You can iterate + # # over elements, and API calls will be issued to fetch pages as needed. + # result.each do |item| + # # Each element is of type ::Google::Cloud::Retail::V2::ServingConfig. + # p item + # end + # + def list_serving_configs request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Retail::V2::ListServingConfigsRequest + + # Converts hash 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_serving_configs.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::Retail::V2::VERSION + metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.parent + 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_serving_configs.timeout, + metadata: metadata, + retry_policy: @config.rpcs.list_serving_configs.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @serving_config_service_stub.call_rpc :list_serving_configs, request, options: options do |response, operation| + response = ::Gapic::PagedEnumerable.new @serving_config_service_stub, :list_serving_configs, 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 + + ## + # Enables a Control on the specified ServingConfig. + # The control is added in the last position of the list of controls + # it belongs to (e.g. if it's a facet spec control it will be applied + # in the last position of servingConfig.facetSpecIds) + # Returns a ALREADY_EXISTS error if the control has already been applied. + # Returns a FAILED_PRECONDITION error if the addition could exceed maximum + # number of control allowed for that type of control. + # + # @overload add_control(request, options = nil) + # Pass arguments to `add_control` via a request object, either of type + # {::Google::Cloud::Retail::V2::AddControlRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Retail::V2::AddControlRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. + # + # @overload add_control(serving_config: nil, control_id: nil) + # Pass arguments to `add_control` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param serving_config [::String] + # Required. The source ServingConfig resource name . Format: + # `projects/{project_number}/locations/{location_id}/catalogs/{catalog_id}/servingConfigs/{serving_config_id}` + # @param control_id [::String] + # Required. The id of the control to apply. Assumed to be in the same catalog + # as the serving config - if id is not found a NOT_FOUND error is returned. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Google::Cloud::Retail::V2::ServingConfig] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Google::Cloud::Retail::V2::ServingConfig] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/retail/v2" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Retail::V2::ServingConfigService::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Retail::V2::AddControlRequest.new + # + # # Call the add_control method. + # result = client.add_control request + # + # # The returned object is of type Google::Cloud::Retail::V2::ServingConfig. + # p result + # + def add_control request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Retail::V2::AddControlRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + metadata = @config.rpcs.add_control.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::Retail::V2::VERSION + metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.serving_config + header_params["serving_config"] = request.serving_config + end + + request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") + metadata[:"x-goog-request-params"] ||= request_params_header + + options.apply_defaults timeout: @config.rpcs.add_control.timeout, + metadata: metadata, + retry_policy: @config.rpcs.add_control.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @serving_config_service_stub.call_rpc :add_control, request, options: options do |response, operation| + yield response, operation if block_given? + end + rescue ::GRPC::BadStatus => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Disables a Control on the specified ServingConfig. + # The control is removed from the ServingConfig. + # Returns a NOT_FOUND error if the Control is not enabled for the + # ServingConfig. + # + # @overload remove_control(request, options = nil) + # Pass arguments to `remove_control` via a request object, either of type + # {::Google::Cloud::Retail::V2::RemoveControlRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Retail::V2::RemoveControlRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. + # + # @overload remove_control(serving_config: nil, control_id: nil) + # Pass arguments to `remove_control` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param serving_config [::String] + # Required. The source ServingConfig resource name . Format: + # `projects/{project_number}/locations/{location_id}/catalogs/{catalog_id}/servingConfigs/{serving_config_id}` + # @param control_id [::String] + # Required. The id of the control to apply. Assumed to be in the same catalog + # as the serving config. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Google::Cloud::Retail::V2::ServingConfig] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Google::Cloud::Retail::V2::ServingConfig] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/retail/v2" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Retail::V2::ServingConfigService::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Retail::V2::RemoveControlRequest.new + # + # # Call the remove_control method. + # result = client.remove_control request + # + # # The returned object is of type Google::Cloud::Retail::V2::ServingConfig. + # p result + # + def remove_control request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Retail::V2::RemoveControlRequest + + # Converts hash 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.remove_control.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::Retail::V2::VERSION + metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.serving_config + header_params["serving_config"] = request.serving_config + 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.remove_control.timeout, + metadata: metadata, + retry_policy: @config.rpcs.remove_control.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @serving_config_service_stub.call_rpc :remove_control, request, options: options do |response, operation| + yield response, operation if block_given? + end + rescue ::GRPC::BadStatus => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Configuration class for the ServingConfigService API. + # + # This class represents the configuration for ServingConfigService, + # providing control over timeouts, retry behavior, logging, transport + # parameters, and other low-level controls. Certain parameters can also be + # applied individually to specific RPCs. See + # {::Google::Cloud::Retail::V2::ServingConfigService::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_serving_config to 20 seconds, + # # and all remaining timeouts to 10 seconds. + # ::Google::Cloud::Retail::V2::ServingConfigService::Client.configure do |config| + # config.timeout = 10.0 + # config.rpcs.create_serving_config.timeout = 20.0 + # end + # + # # Apply the above configuration only to a new client. + # client = ::Google::Cloud::Retail::V2::ServingConfigService::Client.new do |config| + # config.timeout = 10.0 + # config.rpcs.create_serving_config.timeout = 20.0 + # end + # + # @!attribute [rw] endpoint + # A custom service endpoint, as a hostname or hostname:port. The default is + # nil, indicating to use the default endpoint in the current universe domain. + # @return [::String,nil] + # @!attribute [rw] credentials + # Credentials to send with calls. You may provide any of the following types: + # * (`Google::Auth::Credentials`) A googleauth credentials object + # (see the [googleauth docs](https://rubydoc.info/gems/googleauth/Google/Auth/Credentials)) + # * (`Signet::OAuth2::Client`) A signet oauth2 client object + # (see the [signet docs](https://rubydoc.info/gems/signet/Signet/OAuth2/Client)) + # * (`GRPC::Core::Channel`) a gRPC channel with included credentials + # * (`GRPC::Core::ChannelCredentials`) a gRPC credentails object + # * (`nil`) indicating no credentials + # + # @note Warning: Passing a `String` to a keyfile path or a `Hash` of credentials + # is deprecated. Providing an unvalidated credential configuration to + # Google APIs can compromise the security of your systems and data. + # + # @example + # + # # The recommended way to provide credentials is to use the `make_creds` method + # # on the appropriate credentials class for your environment. + # + # require "googleauth" + # + # credentials = ::Google::Auth::ServiceAccountCredentials.make_creds( + # json_key_io: ::File.open("/path/to/keyfile.json") + # ) + # + # client = ::Google::Cloud::Retail::V2::ServingConfigService::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 = "retail.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 ServingConfigService 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_serving_config` + # @return [::Gapic::Config::Method] + # + attr_reader :create_serving_config + ## + # RPC-specific configuration for `delete_serving_config` + # @return [::Gapic::Config::Method] + # + attr_reader :delete_serving_config + ## + # RPC-specific configuration for `update_serving_config` + # @return [::Gapic::Config::Method] + # + attr_reader :update_serving_config + ## + # RPC-specific configuration for `get_serving_config` + # @return [::Gapic::Config::Method] + # + attr_reader :get_serving_config + ## + # RPC-specific configuration for `list_serving_configs` + # @return [::Gapic::Config::Method] + # + attr_reader :list_serving_configs + ## + # RPC-specific configuration for `add_control` + # @return [::Gapic::Config::Method] + # + attr_reader :add_control + ## + # RPC-specific configuration for `remove_control` + # @return [::Gapic::Config::Method] + # + attr_reader :remove_control + + # @private + def initialize parent_rpcs = nil + create_serving_config_config = parent_rpcs.create_serving_config if parent_rpcs.respond_to? :create_serving_config + @create_serving_config = ::Gapic::Config::Method.new create_serving_config_config + delete_serving_config_config = parent_rpcs.delete_serving_config if parent_rpcs.respond_to? :delete_serving_config + @delete_serving_config = ::Gapic::Config::Method.new delete_serving_config_config + update_serving_config_config = parent_rpcs.update_serving_config if parent_rpcs.respond_to? :update_serving_config + @update_serving_config = ::Gapic::Config::Method.new update_serving_config_config + get_serving_config_config = parent_rpcs.get_serving_config if parent_rpcs.respond_to? :get_serving_config + @get_serving_config = ::Gapic::Config::Method.new get_serving_config_config + list_serving_configs_config = parent_rpcs.list_serving_configs if parent_rpcs.respond_to? :list_serving_configs + @list_serving_configs = ::Gapic::Config::Method.new list_serving_configs_config + add_control_config = parent_rpcs.add_control if parent_rpcs.respond_to? :add_control + @add_control = ::Gapic::Config::Method.new add_control_config + remove_control_config = parent_rpcs.remove_control if parent_rpcs.respond_to? :remove_control + @remove_control = ::Gapic::Config::Method.new remove_control_config + + yield self if block_given? + end + end + end + end + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-retail-v2/lib/google/cloud/retail/v2/serving_config_service/credentials.rb b/owl-bot-staging/google-cloud-retail-v2/lib/google/cloud/retail/v2/serving_config_service/credentials.rb new file mode 100644 index 000000000000..c42ba1c10eee --- /dev/null +++ b/owl-bot-staging/google-cloud-retail-v2/lib/google/cloud/retail/v2/serving_config_service/credentials.rb @@ -0,0 +1,51 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +require "googleauth" + +module Google + module Cloud + module Retail + module V2 + module ServingConfigService + # Credentials for the ServingConfigService API. + class Credentials < ::Google::Auth::Credentials + self.scope = [ + "https://www.googleapis.com/auth/cloud-platform" + ] + self.env_vars = [ + "RETAIL_CREDENTIALS", + "RETAIL_KEYFILE", + "GOOGLE_CLOUD_CREDENTIALS", + "GOOGLE_CLOUD_KEYFILE", + "GCLOUD_KEYFILE", + "RETAIL_CREDENTIALS_JSON", + "RETAIL_KEYFILE_JSON", + "GOOGLE_CLOUD_CREDENTIALS_JSON", + "GOOGLE_CLOUD_KEYFILE_JSON", + "GCLOUD_KEYFILE_JSON" + ] + self.paths = [ + "~/.config/google_cloud/application_default_credentials.json" + ] + end + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-retail-v2/lib/google/cloud/retail/v2/serving_config_service/paths.rb b/owl-bot-staging/google-cloud-retail-v2/lib/google/cloud/retail/v2/serving_config_service/paths.rb new file mode 100644 index 000000000000..bb9d885a6589 --- /dev/null +++ b/owl-bot-staging/google-cloud-retail-v2/lib/google/cloud/retail/v2/serving_config_service/paths.rb @@ -0,0 +1,73 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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 Retail + module V2 + module ServingConfigService + # Path helper methods for the ServingConfigService API. + module Paths + ## + # Create a fully-qualified Catalog resource string. + # + # The resource will be in the following format: + # + # `projects/{project}/locations/{location}/catalogs/{catalog}` + # + # @param project [String] + # @param location [String] + # @param catalog [String] + # + # @return [::String] + def catalog_path project:, location:, catalog: + raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" + raise ::ArgumentError, "location cannot contain /" if location.to_s.include? "/" + + "projects/#{project}/locations/#{location}/catalogs/#{catalog}" + end + + ## + # Create a fully-qualified ServingConfig resource string. + # + # The resource will be in the following format: + # + # `projects/{project}/locations/{location}/catalogs/{catalog}/servingConfigs/{serving_config}` + # + # @param project [String] + # @param location [String] + # @param catalog [String] + # @param serving_config [String] + # + # @return [::String] + def serving_config_path project:, location:, catalog:, serving_config: + raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" + raise ::ArgumentError, "location cannot contain /" if location.to_s.include? "/" + raise ::ArgumentError, "catalog cannot contain /" if catalog.to_s.include? "/" + + "projects/#{project}/locations/#{location}/catalogs/#{catalog}/servingConfigs/#{serving_config}" + end + + extend self + end + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-retail-v2/lib/google/cloud/retail/v2/serving_config_service/rest.rb b/owl-bot-staging/google-cloud-retail-v2/lib/google/cloud/retail/v2/serving_config_service/rest.rb new file mode 100644 index 000000000000..f2b31df2bbc7 --- /dev/null +++ b/owl-bot-staging/google-cloud-retail-v2/lib/google/cloud/retail/v2/serving_config_service/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/retail/v2/version" + +require "google/cloud/retail/v2/serving_config_service/credentials" +require "google/cloud/retail/v2/serving_config_service/paths" +require "google/cloud/retail/v2/serving_config_service/rest/client" + +module Google + module Cloud + module Retail + module V2 + ## + # Service for modifying ServingConfig. + # + # To load this service and instantiate a REST client: + # + # require "google/cloud/retail/v2/serving_config_service/rest" + # client = ::Google::Cloud::Retail::V2::ServingConfigService::Rest::Client.new + # + module ServingConfigService + # Client for the REST transport + module Rest + end + end + end + end + end +end + +helper_path = ::File.join __dir__, "rest", "helpers.rb" +require "google/cloud/retail/v2/serving_config_service/rest/helpers" if ::File.file? helper_path diff --git a/owl-bot-staging/google-cloud-retail-v2/lib/google/cloud/retail/v2/serving_config_service/rest/client.rb b/owl-bot-staging/google-cloud-retail-v2/lib/google/cloud/retail/v2/serving_config_service/rest/client.rb new file mode 100644 index 000000000000..c519c160aea0 --- /dev/null +++ b/owl-bot-staging/google-cloud-retail-v2/lib/google/cloud/retail/v2/serving_config_service/rest/client.rb @@ -0,0 +1,1008 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +require "google/cloud/errors" +require "google/cloud/retail/v2/serving_config_service_pb" +require "google/cloud/retail/v2/serving_config_service/rest/service_stub" +require "google/cloud/location/rest" + +module Google + module Cloud + module Retail + module V2 + module ServingConfigService + module Rest + ## + # REST client for the ServingConfigService service. + # + # Service for modifying ServingConfig. + # + class Client + # @private + API_VERSION = "" + + # @private + DEFAULT_ENDPOINT_TEMPLATE = "retail.$UNIVERSE_DOMAIN$" + + include Paths + + # @private + attr_reader :serving_config_service_stub + + ## + # Configure the ServingConfigService Client class. + # + # See {::Google::Cloud::Retail::V2::ServingConfigService::Rest::Client::Configuration} + # for a description of the configuration fields. + # + # @example + # + # # Modify the configuration for all ServingConfigService clients + # ::Google::Cloud::Retail::V2::ServingConfigService::Rest::Client.configure do |config| + # config.timeout = 10.0 + # end + # + # @yield [config] Configure the Client client. + # @yieldparam config [Client::Configuration] + # + # @return [Client::Configuration] + # + def self.configure + @configure ||= begin + namespace = ["Google", "Cloud", "Retail", "V2"] + parent_config = while namespace.any? + parent_name = namespace.join "::" + parent_const = const_get parent_name + break parent_const.configure if parent_const.respond_to? :configure + namespace.pop + end + default_config = Client::Configuration.new parent_config + + default_config + end + yield @configure if block_given? + @configure + end + + ## + # Configure the ServingConfigService Client instance. + # + # The configuration is set to the derived mode, meaning that values can be changed, + # but structural changes (adding new fields, etc.) are not allowed. Structural changes + # should be made on {Client.configure}. + # + # See {::Google::Cloud::Retail::V2::ServingConfigService::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 + @serving_config_service_stub.universe_domain + end + + ## + # Create a new ServingConfigService REST client object. + # + # @example + # + # # Create a client using the default configuration + # client = ::Google::Cloud::Retail::V2::ServingConfigService::Rest::Client.new + # + # # Create a client using a custom configuration + # client = ::Google::Cloud::Retail::V2::ServingConfigService::Rest::Client.new do |config| + # config.timeout = 10.0 + # end + # + # @yield [config] Configure the ServingConfigService 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 + + @serving_config_service_stub = ::Google::Cloud::Retail::V2::ServingConfigService::Rest::ServiceStub.new( + endpoint: @config.endpoint, + endpoint_template: DEFAULT_ENDPOINT_TEMPLATE, + universe_domain: @config.universe_domain, + credentials: credentials, + logger: @config.logger + ) + + @serving_config_service_stub.logger(stub: true)&.info do |entry| + entry.set_system_name + entry.set_service + entry.message = "Created client for #{entry.service}" + entry.set_credentials_fields credentials + entry.set "customEndpoint", @config.endpoint if @config.endpoint + entry.set "defaultTimeout", @config.timeout if @config.timeout + entry.set "quotaProject", @quota_project_id if @quota_project_id + end + + @location_client = Google::Cloud::Location::Locations::Rest::Client.new do |config| + config.credentials = credentials + config.quota_project = @quota_project_id + config.endpoint = @serving_config_service_stub.endpoint + config.universe_domain = @serving_config_service_stub.universe_domain + config.logger = @serving_config_service_stub.logger if config.respond_to? :logger= + end + end + + ## + # Get the associated client for mix-in of the Locations. + # + # @return [Google::Cloud::Location::Locations::Rest::Client] + # + attr_reader :location_client + + ## + # The logger used for request/response debug logging. + # + # @return [Logger] + # + def logger + @serving_config_service_stub.logger + end + + # Service calls + + ## + # Creates a ServingConfig. + # + # A maximum of 100 {::Google::Cloud::Retail::V2::ServingConfig ServingConfig}s are + # allowed in a {::Google::Cloud::Retail::V2::Catalog Catalog}, otherwise a + # FAILED_PRECONDITION error is returned. + # + # @overload create_serving_config(request, options = nil) + # Pass arguments to `create_serving_config` via a request object, either of type + # {::Google::Cloud::Retail::V2::CreateServingConfigRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Retail::V2::CreateServingConfigRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_serving_config(parent: nil, serving_config: nil, serving_config_id: nil) + # Pass arguments to `create_serving_config` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param parent [::String] + # Required. Full resource name of parent. Format: + # `projects/{project_number}/locations/{location_id}/catalogs/{catalog_id}` + # @param serving_config [::Google::Cloud::Retail::V2::ServingConfig, ::Hash] + # Required. The ServingConfig to create. + # @param serving_config_id [::String] + # Required. The ID to use for the ServingConfig, which will become the final + # component of the ServingConfig's resource name. + # + # This value should be 4-63 characters, and valid characters + # are /[a-z][0-9]-_/. + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Cloud::Retail::V2::ServingConfig] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::Retail::V2::ServingConfig] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/retail/v2" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Retail::V2::ServingConfigService::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Retail::V2::CreateServingConfigRequest.new + # + # # Call the create_serving_config method. + # result = client.create_serving_config request + # + # # The returned object is of type Google::Cloud::Retail::V2::ServingConfig. + # p result + # + def create_serving_config request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Retail::V2::CreateServingConfigRequest + + # Converts hash 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_serving_config.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::Retail::V2::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + options.apply_defaults timeout: @config.rpcs.create_serving_config.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.create_serving_config.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @serving_config_service_stub.create_serving_config request, options do |result, operation| + yield result, operation if block_given? + end + rescue ::Gapic::Rest::Error => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Deletes a ServingConfig. + # + # Returns a NotFound error if the ServingConfig does not exist. + # + # @overload delete_serving_config(request, options = nil) + # Pass arguments to `delete_serving_config` via a request object, either of type + # {::Google::Cloud::Retail::V2::DeleteServingConfigRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Retail::V2::DeleteServingConfigRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_serving_config(name: nil) + # Pass arguments to `delete_serving_config` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param name [::String] + # Required. The resource name of the ServingConfig to delete. Format: + # `projects/{project_number}/locations/{location_id}/catalogs/{catalog_id}/servingConfigs/{serving_config_id}` + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Protobuf::Empty] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Protobuf::Empty] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/retail/v2" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Retail::V2::ServingConfigService::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Retail::V2::DeleteServingConfigRequest.new + # + # # Call the delete_serving_config method. + # result = client.delete_serving_config request + # + # # The returned object is of type Google::Protobuf::Empty. + # p result + # + def delete_serving_config request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Retail::V2::DeleteServingConfigRequest + + # Converts hash 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_serving_config.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::Retail::V2::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + options.apply_defaults timeout: @config.rpcs.delete_serving_config.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.delete_serving_config.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @serving_config_service_stub.delete_serving_config request, options do |result, operation| + yield result, operation if block_given? + end + rescue ::Gapic::Rest::Error => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Updates a ServingConfig. + # + # @overload update_serving_config(request, options = nil) + # Pass arguments to `update_serving_config` via a request object, either of type + # {::Google::Cloud::Retail::V2::UpdateServingConfigRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Retail::V2::UpdateServingConfigRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_serving_config(serving_config: nil, update_mask: nil) + # Pass arguments to `update_serving_config` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param serving_config [::Google::Cloud::Retail::V2::ServingConfig, ::Hash] + # Required. The ServingConfig to update. + # @param update_mask [::Google::Protobuf::FieldMask, ::Hash] + # Indicates which fields in the provided + # {::Google::Cloud::Retail::V2::ServingConfig ServingConfig} to update. The + # following are NOT supported: + # + # * {::Google::Cloud::Retail::V2::ServingConfig#name ServingConfig.name} + # + # If not set, all supported fields are updated. + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Cloud::Retail::V2::ServingConfig] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::Retail::V2::ServingConfig] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/retail/v2" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Retail::V2::ServingConfigService::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Retail::V2::UpdateServingConfigRequest.new + # + # # Call the update_serving_config method. + # result = client.update_serving_config request + # + # # The returned object is of type Google::Cloud::Retail::V2::ServingConfig. + # p result + # + def update_serving_config request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Retail::V2::UpdateServingConfigRequest + + # Converts hash 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_serving_config.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::Retail::V2::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + options.apply_defaults timeout: @config.rpcs.update_serving_config.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.update_serving_config.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @serving_config_service_stub.update_serving_config request, options do |result, operation| + yield result, operation if block_given? + end + rescue ::Gapic::Rest::Error => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Gets a ServingConfig. + # + # Returns a NotFound error if the ServingConfig does not exist. + # + # @overload get_serving_config(request, options = nil) + # Pass arguments to `get_serving_config` via a request object, either of type + # {::Google::Cloud::Retail::V2::GetServingConfigRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Retail::V2::GetServingConfigRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_serving_config(name: nil) + # Pass arguments to `get_serving_config` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param name [::String] + # Required. The resource name of the ServingConfig to get. Format: + # `projects/{project_number}/locations/{location_id}/catalogs/{catalog_id}/servingConfigs/{serving_config_id}` + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Cloud::Retail::V2::ServingConfig] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::Retail::V2::ServingConfig] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/retail/v2" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Retail::V2::ServingConfigService::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Retail::V2::GetServingConfigRequest.new + # + # # Call the get_serving_config method. + # result = client.get_serving_config request + # + # # The returned object is of type Google::Cloud::Retail::V2::ServingConfig. + # p result + # + def get_serving_config request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Retail::V2::GetServingConfigRequest + + # Converts hash 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_serving_config.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::Retail::V2::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + options.apply_defaults timeout: @config.rpcs.get_serving_config.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.get_serving_config.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @serving_config_service_stub.get_serving_config request, options do |result, operation| + yield result, operation if block_given? + end + rescue ::Gapic::Rest::Error => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Lists all ServingConfigs linked to this catalog. + # + # @overload list_serving_configs(request, options = nil) + # Pass arguments to `list_serving_configs` via a request object, either of type + # {::Google::Cloud::Retail::V2::ListServingConfigsRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Retail::V2::ListServingConfigsRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_serving_configs(parent: nil, page_size: nil, page_token: nil) + # Pass arguments to `list_serving_configs` via keyword arguments. Note that at + # least one keyword argument is 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 catalog resource name. Format: + # `projects/{project_number}/locations/{location_id}/catalogs/{catalog_id}` + # @param page_size [::Integer] + # Optional. Maximum number of results to return. If unspecified, defaults + # to 100. If a value greater than 100 is provided, at most 100 results are + # returned. + # @param page_token [::String] + # Optional. A page token, received from a previous `ListServingConfigs` call. + # Provide this to retrieve the subsequent page. + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Gapic::Rest::PagedEnumerable<::Google::Cloud::Retail::V2::ServingConfig>] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Gapic::Rest::PagedEnumerable<::Google::Cloud::Retail::V2::ServingConfig>] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/retail/v2" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Retail::V2::ServingConfigService::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Retail::V2::ListServingConfigsRequest.new + # + # # Call the list_serving_configs method. + # result = client.list_serving_configs request + # + # # The returned object is of type Gapic::PagedEnumerable. You can iterate + # # over elements, and API calls will be issued to fetch pages as needed. + # result.each do |item| + # # Each element is of type ::Google::Cloud::Retail::V2::ServingConfig. + # p item + # end + # + def list_serving_configs request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Retail::V2::ListServingConfigsRequest + + # Converts hash 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_serving_configs.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::Retail::V2::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + options.apply_defaults timeout: @config.rpcs.list_serving_configs.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.list_serving_configs.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @serving_config_service_stub.list_serving_configs request, options do |result, operation| + result = ::Gapic::Rest::PagedEnumerable.new @serving_config_service_stub, :list_serving_configs, "serving_configs", 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 + + ## + # Enables a Control on the specified ServingConfig. + # The control is added in the last position of the list of controls + # it belongs to (e.g. if it's a facet spec control it will be applied + # in the last position of servingConfig.facetSpecIds) + # Returns a ALREADY_EXISTS error if the control has already been applied. + # Returns a FAILED_PRECONDITION error if the addition could exceed maximum + # number of control allowed for that type of control. + # + # @overload add_control(request, options = nil) + # Pass arguments to `add_control` via a request object, either of type + # {::Google::Cloud::Retail::V2::AddControlRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Retail::V2::AddControlRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @overload add_control(serving_config: nil, control_id: nil) + # Pass arguments to `add_control` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param serving_config [::String] + # Required. The source ServingConfig resource name . Format: + # `projects/{project_number}/locations/{location_id}/catalogs/{catalog_id}/servingConfigs/{serving_config_id}` + # @param control_id [::String] + # Required. The id of the control to apply. Assumed to be in the same catalog + # as the serving config - if id is not found a NOT_FOUND error is returned. + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Cloud::Retail::V2::ServingConfig] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::Retail::V2::ServingConfig] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/retail/v2" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Retail::V2::ServingConfigService::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Retail::V2::AddControlRequest.new + # + # # Call the add_control method. + # result = client.add_control request + # + # # The returned object is of type Google::Cloud::Retail::V2::ServingConfig. + # p result + # + def add_control request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Retail::V2::AddControlRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + call_metadata = @config.rpcs.add_control.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::Retail::V2::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + options.apply_defaults timeout: @config.rpcs.add_control.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.add_control.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @serving_config_service_stub.add_control request, options do |result, operation| + yield result, operation if block_given? + end + rescue ::Gapic::Rest::Error => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Disables a Control on the specified ServingConfig. + # The control is removed from the ServingConfig. + # Returns a NOT_FOUND error if the Control is not enabled for the + # ServingConfig. + # + # @overload remove_control(request, options = nil) + # Pass arguments to `remove_control` via a request object, either of type + # {::Google::Cloud::Retail::V2::RemoveControlRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Retail::V2::RemoveControlRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @overload remove_control(serving_config: nil, control_id: nil) + # Pass arguments to `remove_control` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param serving_config [::String] + # Required. The source ServingConfig resource name . Format: + # `projects/{project_number}/locations/{location_id}/catalogs/{catalog_id}/servingConfigs/{serving_config_id}` + # @param control_id [::String] + # Required. The id of the control to apply. Assumed to be in the same catalog + # as the serving config. + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Cloud::Retail::V2::ServingConfig] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::Retail::V2::ServingConfig] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/retail/v2" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Retail::V2::ServingConfigService::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Retail::V2::RemoveControlRequest.new + # + # # Call the remove_control method. + # result = client.remove_control request + # + # # The returned object is of type Google::Cloud::Retail::V2::ServingConfig. + # p result + # + def remove_control request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Retail::V2::RemoveControlRequest + + # Converts hash 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.remove_control.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::Retail::V2::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + options.apply_defaults timeout: @config.rpcs.remove_control.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.remove_control.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @serving_config_service_stub.remove_control 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 ServingConfigService REST API. + # + # This class represents the configuration for ServingConfigService REST, + # providing control over timeouts, retry behavior, logging, transport + # parameters, and other low-level controls. Certain parameters can also be + # applied individually to specific RPCs. See + # {::Google::Cloud::Retail::V2::ServingConfigService::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_serving_config to 20 seconds, + # # and all remaining timeouts to 10 seconds. + # ::Google::Cloud::Retail::V2::ServingConfigService::Rest::Client.configure do |config| + # config.timeout = 10.0 + # config.rpcs.create_serving_config.timeout = 20.0 + # end + # + # # Apply the above configuration only to a new client. + # client = ::Google::Cloud::Retail::V2::ServingConfigService::Rest::Client.new do |config| + # config.timeout = 10.0 + # config.rpcs.create_serving_config.timeout = 20.0 + # end + # + # @!attribute [rw] endpoint + # A custom service endpoint, as a hostname or hostname:port. The default is + # nil, indicating to use the default endpoint in the current universe domain. + # @return [::String,nil] + # @!attribute [rw] credentials + # Credentials to send with calls. You may provide any of the following types: + # * (`String`) The path to a service account key file in JSON format + # * (`Hash`) A service account key as a Hash + # * (`Google::Auth::Credentials`) A googleauth credentials object + # (see the [googleauth docs](https://rubydoc.info/gems/googleauth/Google/Auth/Credentials)) + # * (`Signet::OAuth2::Client`) A signet oauth2 client object + # (see the [signet docs](https://rubydoc.info/gems/signet/Signet/OAuth2/Client)) + # * (`nil`) indicating no credentials + # + # Warning: If you accept a credential configuration (JSON file or Hash) from an + # external source for authentication to Google Cloud, you must validate it before + # providing it to a Google API client library. Providing an unvalidated credential + # configuration to Google APIs can compromise the security of your systems and data. + # For more information, refer to [Validate credential configurations from external + # sources](https://cloud.google.com/docs/authentication/external/externally-sourced-credentials). + # @return [::Object] + # @!attribute [rw] scope + # The OAuth scopes + # @return [::Array<::String>] + # @!attribute [rw] lib_name + # The library name as recorded in instrumentation and logging + # @return [::String] + # @!attribute [rw] lib_version + # The library version as recorded in instrumentation and logging + # @return [::String] + # @!attribute [rw] timeout + # The call timeout in seconds. + # @return [::Numeric] + # @!attribute [rw] metadata + # Additional headers to be sent with the call. + # @return [::Hash{::Symbol=>::String}] + # @!attribute [rw] retry_policy + # The retry policy. The value is a hash with the following keys: + # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds. + # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds. + # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier. + # * `:retry_codes` (*type:* `Array`) - The error codes that should + # trigger a retry. + # @return [::Hash] + # @!attribute [rw] quota_project + # A separate project against which to charge quota. + # @return [::String] + # @!attribute [rw] universe_domain + # The universe domain within which to make requests. This determines the + # default endpoint URL. The default value of nil uses the environment + # universe (usually the default "googleapis.com" universe). + # @return [::String,nil] + # @!attribute [rw] logger + # A custom logger to use for request/response debug logging, or the value + # `:default` (the default) to construct a default logger, or `nil` to + # explicitly disable logging. + # @return [::Logger,:default,nil] + # + class Configuration + extend ::Gapic::Config + + # @private + # The endpoint specific to the default "googleapis.com" universe. Deprecated. + DEFAULT_ENDPOINT = "retail.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 ServingConfigService 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_serving_config` + # @return [::Gapic::Config::Method] + # + attr_reader :create_serving_config + ## + # RPC-specific configuration for `delete_serving_config` + # @return [::Gapic::Config::Method] + # + attr_reader :delete_serving_config + ## + # RPC-specific configuration for `update_serving_config` + # @return [::Gapic::Config::Method] + # + attr_reader :update_serving_config + ## + # RPC-specific configuration for `get_serving_config` + # @return [::Gapic::Config::Method] + # + attr_reader :get_serving_config + ## + # RPC-specific configuration for `list_serving_configs` + # @return [::Gapic::Config::Method] + # + attr_reader :list_serving_configs + ## + # RPC-specific configuration for `add_control` + # @return [::Gapic::Config::Method] + # + attr_reader :add_control + ## + # RPC-specific configuration for `remove_control` + # @return [::Gapic::Config::Method] + # + attr_reader :remove_control + + # @private + def initialize parent_rpcs = nil + create_serving_config_config = parent_rpcs.create_serving_config if parent_rpcs.respond_to? :create_serving_config + @create_serving_config = ::Gapic::Config::Method.new create_serving_config_config + delete_serving_config_config = parent_rpcs.delete_serving_config if parent_rpcs.respond_to? :delete_serving_config + @delete_serving_config = ::Gapic::Config::Method.new delete_serving_config_config + update_serving_config_config = parent_rpcs.update_serving_config if parent_rpcs.respond_to? :update_serving_config + @update_serving_config = ::Gapic::Config::Method.new update_serving_config_config + get_serving_config_config = parent_rpcs.get_serving_config if parent_rpcs.respond_to? :get_serving_config + @get_serving_config = ::Gapic::Config::Method.new get_serving_config_config + list_serving_configs_config = parent_rpcs.list_serving_configs if parent_rpcs.respond_to? :list_serving_configs + @list_serving_configs = ::Gapic::Config::Method.new list_serving_configs_config + add_control_config = parent_rpcs.add_control if parent_rpcs.respond_to? :add_control + @add_control = ::Gapic::Config::Method.new add_control_config + remove_control_config = parent_rpcs.remove_control if parent_rpcs.respond_to? :remove_control + @remove_control = ::Gapic::Config::Method.new remove_control_config + + yield self if block_given? + end + end + end + end + end + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-retail-v2/lib/google/cloud/retail/v2/serving_config_service/rest/service_stub.rb b/owl-bot-staging/google-cloud-retail-v2/lib/google/cloud/retail/v2/serving_config_service/rest/service_stub.rb new file mode 100644 index 000000000000..ade51caaf6b9 --- /dev/null +++ b/owl-bot-staging/google-cloud-retail-v2/lib/google/cloud/retail/v2/serving_config_service/rest/service_stub.rb @@ -0,0 +1,512 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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/retail/v2/serving_config_service_pb" + +module Google + module Cloud + module Retail + module V2 + module ServingConfigService + module Rest + ## + # REST service stub for the ServingConfigService 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_serving_config REST call + # + # @param request_pb [::Google::Cloud::Retail::V2::CreateServingConfigRequest] + # A request object representing the call parameters. Required. + # @param options [::Gapic::CallOptions] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Cloud::Retail::V2::ServingConfig] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::Retail::V2::ServingConfig] + # A result object deserialized from the server's reply + def create_serving_config request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_create_serving_config_request request_pb + query_string_params = if query_string_params.any? + query_string_params.to_h { |p| p.split "=", 2 } + else + {} + end + + response = @client_stub.make_http_request( + verb, + uri: uri, + body: body || "", + params: query_string_params, + method_name: "create_serving_config", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Cloud::Retail::V2::ServingConfig.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_serving_config REST call + # + # @param request_pb [::Google::Cloud::Retail::V2::DeleteServingConfigRequest] + # 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_serving_config request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_delete_serving_config_request request_pb + query_string_params = if query_string_params.any? + query_string_params.to_h { |p| p.split "=", 2 } + else + {} + end + + response = @client_stub.make_http_request( + verb, + uri: uri, + body: body || "", + params: query_string_params, + method_name: "delete_serving_config", + 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 update_serving_config REST call + # + # @param request_pb [::Google::Cloud::Retail::V2::UpdateServingConfigRequest] + # A request object representing the call parameters. Required. + # @param options [::Gapic::CallOptions] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Cloud::Retail::V2::ServingConfig] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::Retail::V2::ServingConfig] + # A result object deserialized from the server's reply + def update_serving_config request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_update_serving_config_request request_pb + query_string_params = if query_string_params.any? + query_string_params.to_h { |p| p.split "=", 2 } + else + {} + end + + response = @client_stub.make_http_request( + verb, + uri: uri, + body: body || "", + params: query_string_params, + method_name: "update_serving_config", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Cloud::Retail::V2::ServingConfig.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_serving_config REST call + # + # @param request_pb [::Google::Cloud::Retail::V2::GetServingConfigRequest] + # A request object representing the call parameters. Required. + # @param options [::Gapic::CallOptions] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Cloud::Retail::V2::ServingConfig] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::Retail::V2::ServingConfig] + # A result object deserialized from the server's reply + def get_serving_config request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_get_serving_config_request request_pb + query_string_params = if query_string_params.any? + query_string_params.to_h { |p| p.split "=", 2 } + else + {} + end + + response = @client_stub.make_http_request( + verb, + uri: uri, + body: body || "", + params: query_string_params, + method_name: "get_serving_config", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Cloud::Retail::V2::ServingConfig.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_serving_configs REST call + # + # @param request_pb [::Google::Cloud::Retail::V2::ListServingConfigsRequest] + # A request object representing the call parameters. Required. + # @param options [::Gapic::CallOptions] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Cloud::Retail::V2::ListServingConfigsResponse] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::Retail::V2::ListServingConfigsResponse] + # A result object deserialized from the server's reply + def list_serving_configs request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_list_serving_configs_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_serving_configs", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Cloud::Retail::V2::ListServingConfigsResponse.decode_json response.body, ignore_unknown_fields: true + catch :response do + yield result, operation if block_given? + result + end + end + + ## + # Baseline implementation for the add_control REST call + # + # @param request_pb [::Google::Cloud::Retail::V2::AddControlRequest] + # A request object representing the call parameters. Required. + # @param options [::Gapic::CallOptions] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Cloud::Retail::V2::ServingConfig] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::Retail::V2::ServingConfig] + # A result object deserialized from the server's reply + def add_control request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_add_control_request request_pb + query_string_params = if query_string_params.any? + query_string_params.to_h { |p| p.split "=", 2 } + else + {} + end + + response = @client_stub.make_http_request( + verb, + uri: uri, + body: body || "", + params: query_string_params, + method_name: "add_control", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Cloud::Retail::V2::ServingConfig.decode_json response.body, ignore_unknown_fields: true + catch :response do + yield result, operation if block_given? + result + end + end + + ## + # Baseline implementation for the remove_control REST call + # + # @param request_pb [::Google::Cloud::Retail::V2::RemoveControlRequest] + # A request object representing the call parameters. Required. + # @param options [::Gapic::CallOptions] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Cloud::Retail::V2::ServingConfig] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::Retail::V2::ServingConfig] + # A result object deserialized from the server's reply + def remove_control request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_remove_control_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: "remove_control", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Cloud::Retail::V2::ServingConfig.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_serving_config REST call + # + # @param request_pb [::Google::Cloud::Retail::V2::CreateServingConfigRequest] + # 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_serving_config_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :post, + uri_template: "/v2/{parent}/servingConfigs", + body: "serving_config", + matches: [ + ["parent", %r{^projects/[^/]+/locations/[^/]+/catalogs/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the delete_serving_config REST call + # + # @param request_pb [::Google::Cloud::Retail::V2::DeleteServingConfigRequest] + # 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_serving_config_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :delete, + uri_template: "/v2/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/catalogs/[^/]+/servingConfigs/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the update_serving_config REST call + # + # @param request_pb [::Google::Cloud::Retail::V2::UpdateServingConfigRequest] + # 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_serving_config_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :patch, + uri_template: "/v2/{serving_config.name}", + body: "serving_config", + matches: [ + ["serving_config.name", %r{^projects/[^/]+/locations/[^/]+/catalogs/[^/]+/servingConfigs/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the get_serving_config REST call + # + # @param request_pb [::Google::Cloud::Retail::V2::GetServingConfigRequest] + # 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_serving_config_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :get, + uri_template: "/v2/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/catalogs/[^/]+/servingConfigs/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the list_serving_configs REST call + # + # @param request_pb [::Google::Cloud::Retail::V2::ListServingConfigsRequest] + # 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_serving_configs_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :get, + uri_template: "/v2/{parent}/servingConfigs", + matches: [ + ["parent", %r{^projects/[^/]+/locations/[^/]+/catalogs/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the add_control REST call + # + # @param request_pb [::Google::Cloud::Retail::V2::AddControlRequest] + # A request object representing the call parameters. Required. + # @return [Array(String, [String, nil], Hash{String => String})] + # Uri, Body, Query string parameters + def self.transcode_add_control_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :post, + uri_template: "/v2/{serving_config}:addControl", + body: "*", + matches: [ + ["serving_config", %r{^projects/[^/]+/locations/[^/]+/catalogs/[^/]+/servingConfigs/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the remove_control REST call + # + # @param request_pb [::Google::Cloud::Retail::V2::RemoveControlRequest] + # A request object representing the call parameters. Required. + # @return [Array(String, [String, nil], Hash{String => String})] + # Uri, Body, Query string parameters + def self.transcode_remove_control_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :post, + uri_template: "/v2/{serving_config}:removeControl", + body: "*", + matches: [ + ["serving_config", %r{^projects/[^/]+/locations/[^/]+/catalogs/[^/]+/servingConfigs/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + end + end + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-retail-v2/lib/google/cloud/retail/v2/serving_config_service_pb.rb b/owl-bot-staging/google-cloud-retail-v2/lib/google/cloud/retail/v2/serving_config_service_pb.rb new file mode 100644 index 000000000000..8fb9b76b0e85 --- /dev/null +++ b/owl-bot-staging/google-cloud-retail-v2/lib/google/cloud/retail/v2/serving_config_service_pb.rb @@ -0,0 +1,36 @@ +# frozen_string_literal: true +# Generated by the protocol buffer compiler. DO NOT EDIT! +# source: google/cloud/retail/v2/serving_config_service.proto + +require 'google/protobuf' + +require 'google/api/annotations_pb' +require 'google/api/client_pb' +require 'google/api/field_behavior_pb' +require 'google/api/resource_pb' +require 'google/cloud/retail/v2/serving_config_pb' +require 'google/protobuf/empty_pb' +require 'google/protobuf/field_mask_pb' + + +descriptor_data = "\n3google/cloud/retail/v2/serving_config_service.proto\x12\x16google.cloud.retail.v2\x1a\x1cgoogle/api/annotations.proto\x1a\x17google/api/client.proto\x1a\x1fgoogle/api/field_behavior.proto\x1a\x19google/api/resource.proto\x1a+google/cloud/retail/v2/serving_config.proto\x1a\x1bgoogle/protobuf/empty.proto\x1a google/protobuf/field_mask.proto\"\xb7\x01\n\x1a\x43reateServingConfigRequest\x12\x35\n\x06parent\x18\x01 \x01(\tB%\xe0\x41\x02\xfa\x41\x1f\n\x1dretail.googleapis.com/Catalog\x12\x42\n\x0eserving_config\x18\x02 \x01(\x0b\x32%.google.cloud.retail.v2.ServingConfigB\x03\xe0\x41\x02\x12\x1e\n\x11serving_config_id\x18\x03 \x01(\tB\x03\xe0\x41\x02\"\x91\x01\n\x1aUpdateServingConfigRequest\x12\x42\n\x0eserving_config\x18\x01 \x01(\x0b\x32%.google.cloud.retail.v2.ServingConfigB\x03\xe0\x41\x02\x12/\n\x0bupdate_mask\x18\x02 \x01(\x0b\x32\x1a.google.protobuf.FieldMask\"W\n\x1a\x44\x65leteServingConfigRequest\x12\x39\n\x04name\x18\x01 \x01(\tB+\xe0\x41\x02\xfa\x41%\n#retail.googleapis.com/ServingConfig\"T\n\x17GetServingConfigRequest\x12\x39\n\x04name\x18\x01 \x01(\tB+\xe0\x41\x02\xfa\x41%\n#retail.googleapis.com/ServingConfig\"\x83\x01\n\x19ListServingConfigsRequest\x12\x35\n\x06parent\x18\x01 \x01(\tB%\xe0\x41\x02\xfa\x41\x1f\n\x1dretail.googleapis.com/Catalog\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\"u\n\x1aListServingConfigsResponse\x12>\n\x0fserving_configs\x18\x01 \x03(\x0b\x32%.google.cloud.retail.v2.ServingConfig\x12\x17\n\x0fnext_page_token\x18\x02 \x01(\t\"q\n\x11\x41\x64\x64\x43ontrolRequest\x12\x43\n\x0eserving_config\x18\x01 \x01(\tB+\xe0\x41\x02\xfa\x41%\n#retail.googleapis.com/ServingConfig\x12\x17\n\ncontrol_id\x18\x02 \x01(\tB\x03\xe0\x41\x02\"t\n\x14RemoveControlRequest\x12\x43\n\x0eserving_config\x18\x01 \x01(\tB+\xe0\x41\x02\xfa\x41%\n#retail.googleapis.com/ServingConfig\x12\x17\n\ncontrol_id\x18\x02 \x01(\tB\x03\xe0\x41\x02\x32\xb2\x0c\n\x14ServingConfigService\x12\xf1\x01\n\x13\x43reateServingConfig\x12\x32.google.cloud.retail.v2.CreateServingConfigRequest\x1a%.google.cloud.retail.v2.ServingConfig\"\x7f\xda\x41\'parent,serving_config,serving_config_id\x82\xd3\xe4\x93\x02O\"=/v2/{parent=projects/*/locations/*/catalogs/*}/servingConfigs:\x0eserving_config\x12\xaf\x01\n\x13\x44\x65leteServingConfig\x12\x32.google.cloud.retail.v2.DeleteServingConfigRequest\x1a\x16.google.protobuf.Empty\"L\xda\x41\x04name\x82\xd3\xe4\x93\x02?*=/v2/{name=projects/*/locations/*/catalogs/*/servingConfigs/*}\x12\xf4\x01\n\x13UpdateServingConfig\x12\x32.google.cloud.retail.v2.UpdateServingConfigRequest\x1a%.google.cloud.retail.v2.ServingConfig\"\x81\x01\xda\x41\x1aserving_config,update_mask\x82\xd3\xe4\x93\x02^2L/v2/{serving_config.name=projects/*/locations/*/catalogs/*/servingConfigs/*}:\x0eserving_config\x12\xb8\x01\n\x10GetServingConfig\x12/.google.cloud.retail.v2.GetServingConfigRequest\x1a%.google.cloud.retail.v2.ServingConfig\"L\xda\x41\x04name\x82\xd3\xe4\x93\x02?\x12=/v2/{name=projects/*/locations/*/catalogs/*/servingConfigs/*}\x12\xcb\x01\n\x12ListServingConfigs\x12\x31.google.cloud.retail.v2.ListServingConfigsRequest\x1a\x32.google.cloud.retail.v2.ListServingConfigsResponse\"N\xda\x41\x06parent\x82\xd3\xe4\x93\x02?\x12=/v2/{parent=projects/*/locations/*/catalogs/*}/servingConfigs\x12\xce\x01\n\nAddControl\x12).google.cloud.retail.v2.AddControlRequest\x1a%.google.cloud.retail.v2.ServingConfig\"n\xda\x41\x0eserving_config\x82\xd3\xe4\x93\x02W\"R/v2/{serving_config=projects/*/locations/*/catalogs/*/servingConfigs/*}:addControl:\x01*\x12\xd7\x01\n\rRemoveControl\x12,.google.cloud.retail.v2.RemoveControlRequest\x1a%.google.cloud.retail.v2.ServingConfig\"q\xda\x41\x0eserving_config\x82\xd3\xe4\x93\x02Z\"U/v2/{serving_config=projects/*/locations/*/catalogs/*/servingConfigs/*}:removeControl:\x01*\x1aI\xca\x41\x15retail.googleapis.com\xd2\x41.https://www.googleapis.com/auth/cloud-platformB\xc4\x01\n\x1a\x63om.google.cloud.retail.v2B\x19ServingConfigServiceProtoP\x01Z2cloud.google.com/go/retail/apiv2/retailpb;retailpb\xa2\x02\x06RETAIL\xaa\x02\x16Google.Cloud.Retail.V2\xca\x02\x16Google\\Cloud\\Retail\\V2\xea\x02\x19Google::Cloud::Retail::V2b\x06proto3" + +pool = ::Google::Protobuf::DescriptorPool.generated_pool +pool.add_serialized_file(descriptor_data) + +module Google + module Cloud + module Retail + module V2 + CreateServingConfigRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.retail.v2.CreateServingConfigRequest").msgclass + UpdateServingConfigRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.retail.v2.UpdateServingConfigRequest").msgclass + DeleteServingConfigRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.retail.v2.DeleteServingConfigRequest").msgclass + GetServingConfigRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.retail.v2.GetServingConfigRequest").msgclass + ListServingConfigsRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.retail.v2.ListServingConfigsRequest").msgclass + ListServingConfigsResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.retail.v2.ListServingConfigsResponse").msgclass + AddControlRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.retail.v2.AddControlRequest").msgclass + RemoveControlRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.retail.v2.RemoveControlRequest").msgclass + end + end + end +end diff --git a/owl-bot-staging/google-cloud-retail-v2/lib/google/cloud/retail/v2/serving_config_service_services_pb.rb b/owl-bot-staging/google-cloud-retail-v2/lib/google/cloud/retail/v2/serving_config_service_services_pb.rb new file mode 100644 index 000000000000..ae1db2fde215 --- /dev/null +++ b/owl-bot-staging/google-cloud-retail-v2/lib/google/cloud/retail/v2/serving_config_service_services_pb.rb @@ -0,0 +1,74 @@ +# Generated by the protocol buffer compiler. DO NOT EDIT! +# Source: google/cloud/retail/v2/serving_config_service.proto for package 'Google.Cloud.Retail.V2' +# Original file comments: +# 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 +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# + +require 'grpc' +require 'google/cloud/retail/v2/serving_config_service_pb' + +module Google + module Cloud + module Retail + module V2 + module ServingConfigService + # Service for modifying ServingConfig. + class Service + + include ::GRPC::GenericService + + self.marshal_class_method = :encode + self.unmarshal_class_method = :decode + self.service_name = 'google.cloud.retail.v2.ServingConfigService' + + # Creates a ServingConfig. + # + # A maximum of 100 [ServingConfig][google.cloud.retail.v2.ServingConfig]s are + # allowed in a [Catalog][google.cloud.retail.v2.Catalog], otherwise a + # FAILED_PRECONDITION error is returned. + rpc :CreateServingConfig, ::Google::Cloud::Retail::V2::CreateServingConfigRequest, ::Google::Cloud::Retail::V2::ServingConfig + # Deletes a ServingConfig. + # + # Returns a NotFound error if the ServingConfig does not exist. + rpc :DeleteServingConfig, ::Google::Cloud::Retail::V2::DeleteServingConfigRequest, ::Google::Protobuf::Empty + # Updates a ServingConfig. + rpc :UpdateServingConfig, ::Google::Cloud::Retail::V2::UpdateServingConfigRequest, ::Google::Cloud::Retail::V2::ServingConfig + # Gets a ServingConfig. + # + # Returns a NotFound error if the ServingConfig does not exist. + rpc :GetServingConfig, ::Google::Cloud::Retail::V2::GetServingConfigRequest, ::Google::Cloud::Retail::V2::ServingConfig + # Lists all ServingConfigs linked to this catalog. + rpc :ListServingConfigs, ::Google::Cloud::Retail::V2::ListServingConfigsRequest, ::Google::Cloud::Retail::V2::ListServingConfigsResponse + # Enables a Control on the specified ServingConfig. + # The control is added in the last position of the list of controls + # it belongs to (e.g. if it's a facet spec control it will be applied + # in the last position of servingConfig.facetSpecIds) + # Returns a ALREADY_EXISTS error if the control has already been applied. + # Returns a FAILED_PRECONDITION error if the addition could exceed maximum + # number of control allowed for that type of control. + rpc :AddControl, ::Google::Cloud::Retail::V2::AddControlRequest, ::Google::Cloud::Retail::V2::ServingConfig + # Disables a Control on the specified ServingConfig. + # The control is removed from the ServingConfig. + # Returns a NOT_FOUND error if the Control is not enabled for the + # ServingConfig. + rpc :RemoveControl, ::Google::Cloud::Retail::V2::RemoveControlRequest, ::Google::Cloud::Retail::V2::ServingConfig + end + + Stub = Service.rpc_stub_class + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-retail-v2/lib/google/cloud/retail/v2/user_event_pb.rb b/owl-bot-staging/google-cloud-retail-v2/lib/google/cloud/retail/v2/user_event_pb.rb new file mode 100644 index 000000000000..f7da172ecbbd --- /dev/null +++ b/owl-bot-staging/google-cloud-retail-v2/lib/google/cloud/retail/v2/user_event_pb.rb @@ -0,0 +1,30 @@ +# frozen_string_literal: true +# Generated by the protocol buffer compiler. DO NOT EDIT! +# source: google/cloud/retail/v2/user_event.proto + +require 'google/protobuf' + +require 'google/api/field_behavior_pb' +require 'google/cloud/retail/v2/common_pb' +require 'google/cloud/retail/v2/product_pb' +require 'google/protobuf/timestamp_pb' +require 'google/protobuf/wrappers_pb' + + +descriptor_data = "\n\'google/cloud/retail/v2/user_event.proto\x12\x16google.cloud.retail.v2\x1a\x1fgoogle/api/field_behavior.proto\x1a#google/cloud/retail/v2/common.proto\x1a$google/cloud/retail/v2/product.proto\x1a\x1fgoogle/protobuf/timestamp.proto\x1a\x1egoogle/protobuf/wrappers.proto\"\x97\x06\n\tUserEvent\x12\x17\n\nevent_type\x18\x01 \x01(\tB\x03\xe0\x41\x02\x12\x17\n\nvisitor_id\x18\x02 \x01(\tB\x03\xe0\x41\x02\x12\x12\n\nsession_id\x18\x15 \x01(\t\x12.\n\nevent_time\x18\x03 \x01(\x0b\x32\x1a.google.protobuf.Timestamp\x12\x16\n\x0e\x65xperiment_ids\x18\x04 \x03(\t\x12\x19\n\x11\x61ttribution_token\x18\x05 \x01(\t\x12>\n\x0fproduct_details\x18\x06 \x03(\x0b\x32%.google.cloud.retail.v2.ProductDetail\x12\x43\n\x11\x63ompletion_detail\x18\x16 \x01(\x0b\x32(.google.cloud.retail.v2.CompletionDetail\x12\x45\n\nattributes\x18\x07 \x03(\x0b\x32\x31.google.cloud.retail.v2.UserEvent.AttributesEntry\x12\x0f\n\x07\x63\x61rt_id\x18\x08 \x01(\t\x12I\n\x14purchase_transaction\x18\t \x01(\x0b\x32+.google.cloud.retail.v2.PurchaseTransaction\x12\x14\n\x0csearch_query\x18\n \x01(\t\x12\x0e\n\x06\x66ilter\x18\x10 \x01(\t\x12\x10\n\x08order_by\x18\x11 \x01(\t\x12\x0e\n\x06offset\x18\x12 \x01(\x05\x12\x17\n\x0fpage_categories\x18\x0b \x03(\t\x12\x33\n\tuser_info\x18\x0c \x01(\x0b\x32 .google.cloud.retail.v2.UserInfo\x12\x0b\n\x03uri\x18\r \x01(\t\x12\x14\n\x0creferrer_uri\x18\x0e \x01(\t\x12\x14\n\x0cpage_view_id\x18\x0f \x01(\t\x12\x0e\n\x06\x65ntity\x18\x17 \x01(\t\x1aZ\n\x0f\x41ttributesEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12\x36\n\x05value\x18\x02 \x01(\x0b\x32\'.google.cloud.retail.v2.CustomAttribute:\x02\x38\x01\"u\n\rProductDetail\x12\x35\n\x07product\x18\x01 \x01(\x0b\x32\x1f.google.cloud.retail.v2.ProductB\x03\xe0\x41\x02\x12-\n\x08quantity\x18\x02 \x01(\x0b\x32\x1b.google.protobuf.Int32Value\"p\n\x10\x43ompletionDetail\x12$\n\x1c\x63ompletion_attribution_token\x18\x01 \x01(\t\x12\x1b\n\x13selected_suggestion\x18\x02 \x01(\t\x12\x19\n\x11selected_position\x18\x03 \x01(\x05\"n\n\x13PurchaseTransaction\x12\n\n\x02id\x18\x01 \x01(\t\x12\x14\n\x07revenue\x18\x02 \x01(\x02\x42\x03\xe0\x41\x02\x12\x0b\n\x03tax\x18\x03 \x01(\x02\x12\x0c\n\x04\x63ost\x18\x04 \x01(\x02\x12\x1a\n\rcurrency_code\x18\x05 \x01(\tB\x03\xe0\x41\x02\x42\xb9\x01\n\x1a\x63om.google.cloud.retail.v2B\x0eUserEventProtoP\x01Z2cloud.google.com/go/retail/apiv2/retailpb;retailpb\xa2\x02\x06RETAIL\xaa\x02\x16Google.Cloud.Retail.V2\xca\x02\x16Google\\Cloud\\Retail\\V2\xea\x02\x19Google::Cloud::Retail::V2b\x06proto3" + +pool = ::Google::Protobuf::DescriptorPool.generated_pool +pool.add_serialized_file(descriptor_data) + +module Google + module Cloud + module Retail + module V2 + UserEvent = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.retail.v2.UserEvent").msgclass + ProductDetail = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.retail.v2.ProductDetail").msgclass + CompletionDetail = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.retail.v2.CompletionDetail").msgclass + PurchaseTransaction = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.retail.v2.PurchaseTransaction").msgclass + end + end + end +end diff --git a/owl-bot-staging/google-cloud-retail-v2/lib/google/cloud/retail/v2/user_event_service.rb b/owl-bot-staging/google-cloud-retail-v2/lib/google/cloud/retail/v2/user_event_service.rb new file mode 100644 index 000000000000..7ff44608d216 --- /dev/null +++ b/owl-bot-staging/google-cloud-retail-v2/lib/google/cloud/retail/v2/user_event_service.rb @@ -0,0 +1,56 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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/retail/v2/version" + +require "google/cloud/retail/v2/user_event_service/credentials" +require "google/cloud/retail/v2/user_event_service/paths" +require "google/cloud/retail/v2/user_event_service/operations" +require "google/cloud/retail/v2/user_event_service/client" +require "google/cloud/retail/v2/user_event_service/rest" + +module Google + module Cloud + module Retail + module V2 + ## + # Service for ingesting end user actions on the customer website. + # + # @example Load this service and instantiate a gRPC client + # + # require "google/cloud/retail/v2/user_event_service" + # client = ::Google::Cloud::Retail::V2::UserEventService::Client.new + # + # @example Load this service and instantiate a REST client + # + # require "google/cloud/retail/v2/user_event_service/rest" + # client = ::Google::Cloud::Retail::V2::UserEventService::Rest::Client.new + # + module UserEventService + end + end + end + end +end + +helper_path = ::File.join __dir__, "user_event_service", "helpers.rb" +require "google/cloud/retail/v2/user_event_service/helpers" if ::File.file? helper_path diff --git a/owl-bot-staging/google-cloud-retail-v2/lib/google/cloud/retail/v2/user_event_service/client.rb b/owl-bot-staging/google-cloud-retail-v2/lib/google/cloud/retail/v2/user_event_service/client.rb new file mode 100644 index 000000000000..9f024823a893 --- /dev/null +++ b/owl-bot-staging/google-cloud-retail-v2/lib/google/cloud/retail/v2/user_event_service/client.rb @@ -0,0 +1,1006 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +require "google/cloud/errors" +require "google/cloud/retail/v2/user_event_service_pb" +require "google/cloud/location" + +module Google + module Cloud + module Retail + module V2 + module UserEventService + ## + # Client for the UserEventService service. + # + # Service for ingesting end user actions on the customer website. + # + class Client + # @private + API_VERSION = "" + + # @private + DEFAULT_ENDPOINT_TEMPLATE = "retail.$UNIVERSE_DOMAIN$" + + include Paths + + # @private + attr_reader :user_event_service_stub + + ## + # Configure the UserEventService Client class. + # + # See {::Google::Cloud::Retail::V2::UserEventService::Client::Configuration} + # for a description of the configuration fields. + # + # @example + # + # # Modify the configuration for all UserEventService clients + # ::Google::Cloud::Retail::V2::UserEventService::Client.configure do |config| + # config.timeout = 10.0 + # end + # + # @yield [config] Configure the Client client. + # @yieldparam config [Client::Configuration] + # + # @return [Client::Configuration] + # + def self.configure + @configure ||= begin + namespace = ["Google", "Cloud", "Retail", "V2"] + parent_config = while namespace.any? + parent_name = namespace.join "::" + parent_const = const_get parent_name + break parent_const.configure if parent_const.respond_to? :configure + namespace.pop + end + default_config = Client::Configuration.new parent_config + + default_config.timeout = 10.0 + default_config.retry_policy = { + initial_delay: 0.1, max_delay: 5.0, multiplier: 1.3, retry_codes: [14, 4] + } + + default_config.rpcs.purge_user_events.timeout = 30.0 + default_config.rpcs.purge_user_events.retry_policy = { + initial_delay: 0.1, max_delay: 30.0, multiplier: 1.3, retry_codes: [14, 4] + } + + default_config.rpcs.import_user_events.timeout = 600.0 + default_config.rpcs.import_user_events.retry_policy = { + initial_delay: 0.1, max_delay: 300.0, multiplier: 1.3, retry_codes: [14, 4] + } + + default_config + end + yield @configure if block_given? + @configure + end + + ## + # Configure the UserEventService Client instance. + # + # The configuration is set to the derived mode, meaning that values can be changed, + # but structural changes (adding new fields, etc.) are not allowed. Structural changes + # should be made on {Client.configure}. + # + # See {::Google::Cloud::Retail::V2::UserEventService::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 + @user_event_service_stub.universe_domain + end + + ## + # Create a new UserEventService client object. + # + # @example + # + # # Create a client using the default configuration + # client = ::Google::Cloud::Retail::V2::UserEventService::Client.new + # + # # Create a client using a custom configuration + # client = ::Google::Cloud::Retail::V2::UserEventService::Client.new do |config| + # config.timeout = 10.0 + # end + # + # @yield [config] Configure the UserEventService client. + # @yieldparam config [Client::Configuration] + # + def initialize + # These require statements are intentionally placed here to initialize + # the gRPC module only when it's required. + # See https://github.com/googleapis/toolkit/issues/446 + require "gapic/grpc" + require "google/cloud/retail/v2/user_event_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 + + @user_event_service_stub = ::Gapic::ServiceStub.new( + ::Google::Cloud::Retail::V2::UserEventService::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 + ) + + @user_event_service_stub.stub_logger&.info do |entry| + entry.set_system_name + entry.set_service + entry.message = "Created client for #{entry.service}" + entry.set_credentials_fields credentials + entry.set "customEndpoint", @config.endpoint if @config.endpoint + entry.set "defaultTimeout", @config.timeout if @config.timeout + entry.set "quotaProject", @quota_project_id if @quota_project_id + end + + @location_client = Google::Cloud::Location::Locations::Client.new do |config| + config.credentials = credentials + config.quota_project = @quota_project_id + config.endpoint = @user_event_service_stub.endpoint + config.universe_domain = @user_event_service_stub.universe_domain + config.logger = @user_event_service_stub.logger if config.respond_to? :logger= + end + end + + ## + # Get the associated client for long-running operations. + # + # @return [::Google::Cloud::Retail::V2::UserEventService::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 + @user_event_service_stub.logger + end + + # Service calls + + ## + # Writes a single user event. + # + # @overload write_user_event(request, options = nil) + # Pass arguments to `write_user_event` via a request object, either of type + # {::Google::Cloud::Retail::V2::WriteUserEventRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Retail::V2::WriteUserEventRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. + # + # @overload write_user_event(parent: nil, user_event: nil, write_async: nil) + # Pass arguments to `write_user_event` via keyword arguments. Note that at + # least one keyword argument is 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 catalog resource name, such as + # `projects/1234/locations/global/catalogs/default_catalog`. + # @param user_event [::Google::Cloud::Retail::V2::UserEvent, ::Hash] + # Required. User event to write. + # @param write_async [::Boolean] + # If set to true, the user event will be written asynchronously after + # validation, and the API will respond without waiting for the write. + # Therefore, silent failures can occur even if the API returns success. In + # case of silent failures, error messages can be found in Stackdriver logs. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Google::Cloud::Retail::V2::UserEvent] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Google::Cloud::Retail::V2::UserEvent] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/retail/v2" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Retail::V2::UserEventService::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Retail::V2::WriteUserEventRequest.new + # + # # Call the write_user_event method. + # result = client.write_user_event request + # + # # The returned object is of type Google::Cloud::Retail::V2::UserEvent. + # p result + # + def write_user_event request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Retail::V2::WriteUserEventRequest + + # Converts hash 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.write_user_event.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::Retail::V2::VERSION + metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.parent + 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.write_user_event.timeout, + metadata: metadata, + retry_policy: @config.rpcs.write_user_event.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @user_event_service_stub.call_rpc :write_user_event, 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 + + ## + # Writes a single user event from the browser. + # + # For larger user event payload over 16 KB, the POST method should be used + # instead, otherwise a 400 Bad Request error is returned. + # + # This method is used only by the Retail API JavaScript pixel and Google Tag + # Manager. Users should not call this method directly. + # + # @overload collect_user_event(request, options = nil) + # Pass arguments to `collect_user_event` via a request object, either of type + # {::Google::Cloud::Retail::V2::CollectUserEventRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Retail::V2::CollectUserEventRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. + # + # @overload collect_user_event(prebuilt_rule: nil, parent: nil, user_event: nil, uri: nil, ets: nil, raw_json: nil) + # Pass arguments to `collect_user_event` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param prebuilt_rule [::String] + # The prebuilt rule name that can convert a specific type of raw_json. + # For example: "ga4_bq" rule for the GA4 user event schema. + # @param parent [::String] + # Required. The parent catalog name, such as + # `projects/1234/locations/global/catalogs/default_catalog`. + # @param user_event [::String] + # Required. URL encoded UserEvent proto with a length limit of 2,000,000 + # characters. + # @param uri [::String] + # The URL including cgi-parameters but excluding the hash fragment with a + # length limit of 5,000 characters. This is often more useful than the + # referer URL, because many browsers only send the domain for 3rd party + # requests. + # @param ets [::Integer] + # The event timestamp in milliseconds. This prevents browser caching of + # otherwise identical get requests. The name is abbreviated to reduce the + # payload bytes. + # @param raw_json [::String] + # An arbitrary serialized JSON string that contains necessary information + # that can comprise a user event. When this field is specified, the + # user_event field will be ignored. Note: line-delimited JSON is not + # supported, a single JSON only. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Google::Api::HttpBody] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Google::Api::HttpBody] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/retail/v2" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Retail::V2::UserEventService::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Retail::V2::CollectUserEventRequest.new + # + # # Call the collect_user_event method. + # result = client.collect_user_event request + # + # # The returned object is of type Google::Api::HttpBody. + # p result + # + def collect_user_event request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Retail::V2::CollectUserEventRequest + + # Converts hash 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.collect_user_event.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::Retail::V2::VERSION + metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.parent + 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.collect_user_event.timeout, + metadata: metadata, + retry_policy: @config.rpcs.collect_user_event.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @user_event_service_stub.call_rpc :collect_user_event, request, options: options do |response, operation| + yield response, operation if block_given? + end + rescue ::GRPC::BadStatus => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Deletes permanently all user events specified by the filter provided. + # Depending on the number of events specified by the filter, this operation + # could take hours or days to complete. To test a filter, use the list + # command first. + # + # @overload purge_user_events(request, options = nil) + # Pass arguments to `purge_user_events` via a request object, either of type + # {::Google::Cloud::Retail::V2::PurgeUserEventsRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Retail::V2::PurgeUserEventsRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. + # + # @overload purge_user_events(parent: nil, filter: nil, force: nil) + # Pass arguments to `purge_user_events` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param parent [::String] + # Required. The resource name of the catalog under which the events are + # created. The format is + # `projects/${projectId}/locations/global/catalogs/${catalogId}` + # @param filter [::String] + # Required. The filter string to specify the events to be deleted with a + # length limit of 5,000 characters. Empty string filter is not allowed. The + # eligible fields for filtering are: + # + # * `eventType`: Double quoted + # {::Google::Cloud::Retail::V2::UserEvent#event_type UserEvent.event_type} string. + # * `eventTime`: in ISO 8601 "zulu" format. + # * `visitorId`: Double quoted string. Specifying this will delete all + # events associated with a visitor. + # * `userId`: Double quoted string. Specifying this will delete all events + # associated with a user. + # + # Examples: + # + # * Deleting all events in a time range: + # `eventTime > "2012-04-23T18:25:43.511Z" + # eventTime < "2012-04-23T18:30:43.511Z"` + # * Deleting specific eventType in time range: + # `eventTime > "2012-04-23T18:25:43.511Z" eventType = "detail-page-view"` + # * Deleting all events for a specific visitor: + # `visitorId = "visitor1024"` + # + # The filtering fields are assumed to have an implicit AND. + # @param force [::Boolean] + # Actually perform the purge. + # If `force` is set to false, the method will return the expected purge count + # without deleting any user events. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Gapic::Operation] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Gapic::Operation] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/retail/v2" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Retail::V2::UserEventService::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Retail::V2::PurgeUserEventsRequest.new + # + # # Call the purge_user_events method. + # result = client.purge_user_events 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 purge_user_events request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Retail::V2::PurgeUserEventsRequest + + # Converts hash 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.purge_user_events.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::Retail::V2::VERSION + metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.parent + 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.purge_user_events.timeout, + metadata: metadata, + retry_policy: @config.rpcs.purge_user_events.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @user_event_service_stub.call_rpc :purge_user_events, 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 + + ## + # Bulk import of User events. Request processing might be + # synchronous. Events that already exist are skipped. + # Use this method for backfilling historical user events. + # + # `Operation.response` is of type `ImportResponse`. Note that it is + # possible for a subset of the items to be successfully inserted. + # `Operation.metadata` is of type `ImportMetadata`. + # + # @overload import_user_events(request, options = nil) + # Pass arguments to `import_user_events` via a request object, either of type + # {::Google::Cloud::Retail::V2::ImportUserEventsRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Retail::V2::ImportUserEventsRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. + # + # @overload import_user_events(parent: nil, input_config: nil, errors_config: nil) + # Pass arguments to `import_user_events` via keyword arguments. Note that at + # least one keyword argument is 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. `projects/1234/locations/global/catalogs/default_catalog` + # @param input_config [::Google::Cloud::Retail::V2::UserEventInputConfig, ::Hash] + # Required. The desired input location of the data. + # @param errors_config [::Google::Cloud::Retail::V2::ImportErrorsConfig, ::Hash] + # The desired location of errors incurred during the Import. Cannot be set + # for inline user event imports. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Gapic::Operation] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Gapic::Operation] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/retail/v2" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Retail::V2::UserEventService::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Retail::V2::ImportUserEventsRequest.new + # + # # Call the import_user_events method. + # result = client.import_user_events 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 import_user_events request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Retail::V2::ImportUserEventsRequest + + # Converts hash 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.import_user_events.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::Retail::V2::VERSION + metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.parent + 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.import_user_events.timeout, + metadata: metadata, + retry_policy: @config.rpcs.import_user_events.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @user_event_service_stub.call_rpc :import_user_events, 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 + + ## + # Starts a user-event rejoin operation with latest product catalog. Events + # are not annotated with detailed product information for products that are + # missing from the catalog when the user event is ingested. These + # events are stored as unjoined events with limited usage on training and + # serving. You can use this method to start a join operation on specified + # events with the latest version of product catalog. You can also use this + # method to correct events joined with the wrong product catalog. A rejoin + # operation can take hours or days to complete. + # + # @overload rejoin_user_events(request, options = nil) + # Pass arguments to `rejoin_user_events` via a request object, either of type + # {::Google::Cloud::Retail::V2::RejoinUserEventsRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Retail::V2::RejoinUserEventsRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. + # + # @overload rejoin_user_events(parent: nil, user_event_rejoin_scope: nil) + # Pass arguments to `rejoin_user_events` via keyword arguments. Note that at + # least one keyword argument is 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 catalog resource name, such as + # `projects/1234/locations/global/catalogs/default_catalog`. + # @param user_event_rejoin_scope [::Google::Cloud::Retail::V2::RejoinUserEventsRequest::UserEventRejoinScope] + # The type of the user event rejoin to define the scope and range of the user + # events to be rejoined with the latest product catalog. Defaults to + # `USER_EVENT_REJOIN_SCOPE_UNSPECIFIED` if this field is not set, or set to + # an invalid integer value. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Gapic::Operation] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Gapic::Operation] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/retail/v2" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Retail::V2::UserEventService::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Retail::V2::RejoinUserEventsRequest.new + # + # # Call the rejoin_user_events method. + # result = client.rejoin_user_events 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 rejoin_user_events request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Retail::V2::RejoinUserEventsRequest + + # Converts hash 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.rejoin_user_events.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::Retail::V2::VERSION + metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.parent + 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.rejoin_user_events.timeout, + metadata: metadata, + retry_policy: @config.rpcs.rejoin_user_events.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @user_event_service_stub.call_rpc :rejoin_user_events, 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 UserEventService API. + # + # This class represents the configuration for UserEventService, + # providing control over timeouts, retry behavior, logging, transport + # parameters, and other low-level controls. Certain parameters can also be + # applied individually to specific RPCs. See + # {::Google::Cloud::Retail::V2::UserEventService::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 + # # write_user_event to 20 seconds, + # # and all remaining timeouts to 10 seconds. + # ::Google::Cloud::Retail::V2::UserEventService::Client.configure do |config| + # config.timeout = 10.0 + # config.rpcs.write_user_event.timeout = 20.0 + # end + # + # # Apply the above configuration only to a new client. + # client = ::Google::Cloud::Retail::V2::UserEventService::Client.new do |config| + # config.timeout = 10.0 + # config.rpcs.write_user_event.timeout = 20.0 + # end + # + # @!attribute [rw] endpoint + # A custom service endpoint, as a hostname or hostname:port. The default is + # nil, indicating to use the default endpoint in the current universe domain. + # @return [::String,nil] + # @!attribute [rw] credentials + # Credentials to send with calls. You may provide any of the following types: + # * (`Google::Auth::Credentials`) A googleauth credentials object + # (see the [googleauth docs](https://rubydoc.info/gems/googleauth/Google/Auth/Credentials)) + # * (`Signet::OAuth2::Client`) A signet oauth2 client object + # (see the [signet docs](https://rubydoc.info/gems/signet/Signet/OAuth2/Client)) + # * (`GRPC::Core::Channel`) a gRPC channel with included credentials + # * (`GRPC::Core::ChannelCredentials`) a gRPC credentails object + # * (`nil`) indicating no credentials + # + # @note Warning: Passing a `String` to a keyfile path or a `Hash` of credentials + # is deprecated. Providing an unvalidated credential configuration to + # Google APIs can compromise the security of your systems and data. + # + # @example + # + # # The recommended way to provide credentials is to use the `make_creds` method + # # on the appropriate credentials class for your environment. + # + # require "googleauth" + # + # credentials = ::Google::Auth::ServiceAccountCredentials.make_creds( + # json_key_io: ::File.open("/path/to/keyfile.json") + # ) + # + # client = ::Google::Cloud::Retail::V2::UserEventService::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 = "retail.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 UserEventService 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 `write_user_event` + # @return [::Gapic::Config::Method] + # + attr_reader :write_user_event + ## + # RPC-specific configuration for `collect_user_event` + # @return [::Gapic::Config::Method] + # + attr_reader :collect_user_event + ## + # RPC-specific configuration for `purge_user_events` + # @return [::Gapic::Config::Method] + # + attr_reader :purge_user_events + ## + # RPC-specific configuration for `import_user_events` + # @return [::Gapic::Config::Method] + # + attr_reader :import_user_events + ## + # RPC-specific configuration for `rejoin_user_events` + # @return [::Gapic::Config::Method] + # + attr_reader :rejoin_user_events + + # @private + def initialize parent_rpcs = nil + write_user_event_config = parent_rpcs.write_user_event if parent_rpcs.respond_to? :write_user_event + @write_user_event = ::Gapic::Config::Method.new write_user_event_config + collect_user_event_config = parent_rpcs.collect_user_event if parent_rpcs.respond_to? :collect_user_event + @collect_user_event = ::Gapic::Config::Method.new collect_user_event_config + purge_user_events_config = parent_rpcs.purge_user_events if parent_rpcs.respond_to? :purge_user_events + @purge_user_events = ::Gapic::Config::Method.new purge_user_events_config + import_user_events_config = parent_rpcs.import_user_events if parent_rpcs.respond_to? :import_user_events + @import_user_events = ::Gapic::Config::Method.new import_user_events_config + rejoin_user_events_config = parent_rpcs.rejoin_user_events if parent_rpcs.respond_to? :rejoin_user_events + @rejoin_user_events = ::Gapic::Config::Method.new rejoin_user_events_config + + yield self if block_given? + end + end + end + end + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-retail-v2/lib/google/cloud/retail/v2/user_event_service/credentials.rb b/owl-bot-staging/google-cloud-retail-v2/lib/google/cloud/retail/v2/user_event_service/credentials.rb new file mode 100644 index 000000000000..d7842cfcb893 --- /dev/null +++ b/owl-bot-staging/google-cloud-retail-v2/lib/google/cloud/retail/v2/user_event_service/credentials.rb @@ -0,0 +1,51 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +require "googleauth" + +module Google + module Cloud + module Retail + module V2 + module UserEventService + # Credentials for the UserEventService API. + class Credentials < ::Google::Auth::Credentials + self.scope = [ + "https://www.googleapis.com/auth/cloud-platform" + ] + self.env_vars = [ + "RETAIL_CREDENTIALS", + "RETAIL_KEYFILE", + "GOOGLE_CLOUD_CREDENTIALS", + "GOOGLE_CLOUD_KEYFILE", + "GCLOUD_KEYFILE", + "RETAIL_CREDENTIALS_JSON", + "RETAIL_KEYFILE_JSON", + "GOOGLE_CLOUD_CREDENTIALS_JSON", + "GOOGLE_CLOUD_KEYFILE_JSON", + "GCLOUD_KEYFILE_JSON" + ] + self.paths = [ + "~/.config/google_cloud/application_default_credentials.json" + ] + end + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-retail-v2/lib/google/cloud/retail/v2/user_event_service/operations.rb b/owl-bot-staging/google-cloud-retail-v2/lib/google/cloud/retail/v2/user_event_service/operations.rb new file mode 100644 index 000000000000..53cb1582033d --- /dev/null +++ b/owl-bot-staging/google-cloud-retail-v2/lib/google/cloud/retail/v2/user_event_service/operations.rb @@ -0,0 +1,841 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +require "gapic/operation" +require "google/longrunning/operations_pb" + +module Google + module Cloud + module Retail + module V2 + module UserEventService + # Service that implements Longrunning Operations API. + class Operations + # @private + API_VERSION = "" + + # @private + DEFAULT_ENDPOINT_TEMPLATE = "retail.$UNIVERSE_DOMAIN$" + + # @private + attr_reader :operations_stub + + ## + # Configuration for the UserEventService 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 UserEventService 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::Retail::V2::VERSION + metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.name + header_params["name"] = request.name + end + + request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") + metadata[:"x-goog-request-params"] ||= request_params_header + + options.apply_defaults timeout: @config.rpcs.list_operations.timeout, + metadata: metadata, + retry_policy: @config.rpcs.list_operations.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @operations_stub.call_rpc :list_operations, request, options: options do |response, operation| + wrap_lro_operation = ->(op_response) { ::Gapic::Operation.new op_response, @operations_client } + response = ::Gapic::PagedEnumerable.new @operations_stub, :list_operations, request, response, operation, options, format_resource: wrap_lro_operation + yield response, operation if block_given? + throw :response, response + end + rescue ::GRPC::BadStatus => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Gets the latest state of a long-running operation. Clients can use this + # method to poll the operation result at intervals as recommended by the API + # service. + # + # @overload get_operation(request, options = nil) + # Pass arguments to `get_operation` via a request object, either of type + # {::Google::Longrunning::GetOperationRequest} or an equivalent Hash. + # + # @param request [::Google::Longrunning::GetOperationRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. + # + # @overload get_operation(name: nil) + # Pass arguments to `get_operation` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param name [::String] + # The name of the operation resource. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Gapic::Operation] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Gapic::Operation] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/longrunning" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Longrunning::Operations::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Longrunning::GetOperationRequest.new + # + # # Call the get_operation method. + # result = client.get_operation request + # + # # The returned object is of type Gapic::Operation. You can use it to + # # check the status of an operation, cancel it, or wait for results. + # # Here is how to wait for a response. + # result.wait_until_done! timeout: 60 + # if result.response? + # p result.response + # else + # puts "No response received." + # end + # + def get_operation request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Longrunning::GetOperationRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + metadata = @config.rpcs.get_operation.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::Retail::V2::VERSION + metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.name + header_params["name"] = request.name + end + + request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") + metadata[:"x-goog-request-params"] ||= request_params_header + + options.apply_defaults timeout: @config.rpcs.get_operation.timeout, + metadata: metadata, + retry_policy: @config.rpcs.get_operation.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @operations_stub.call_rpc :get_operation, request, options: options do |response, operation| + response = ::Gapic::Operation.new response, @operations_client, options: options + yield response, operation if block_given? + throw :response, response + end + rescue ::GRPC::BadStatus => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Deletes a long-running operation. This method indicates that the client is + # no longer interested in the operation result. It does not cancel the + # operation. If the server doesn't support this method, it returns + # `google.rpc.Code.UNIMPLEMENTED`. + # + # @overload delete_operation(request, options = nil) + # Pass arguments to `delete_operation` via a request object, either of type + # {::Google::Longrunning::DeleteOperationRequest} or an equivalent Hash. + # + # @param request [::Google::Longrunning::DeleteOperationRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. + # + # @overload delete_operation(name: nil) + # Pass arguments to `delete_operation` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param name [::String] + # The name of the operation resource to be deleted. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Google::Protobuf::Empty] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Google::Protobuf::Empty] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/longrunning" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Longrunning::Operations::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Longrunning::DeleteOperationRequest.new + # + # # Call the delete_operation method. + # result = client.delete_operation request + # + # # The returned object is of type Google::Protobuf::Empty. + # p result + # + def delete_operation request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Longrunning::DeleteOperationRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + metadata = @config.rpcs.delete_operation.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::Retail::V2::VERSION + metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.name + header_params["name"] = request.name + end + + request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") + metadata[:"x-goog-request-params"] ||= request_params_header + + options.apply_defaults timeout: @config.rpcs.delete_operation.timeout, + metadata: metadata, + retry_policy: @config.rpcs.delete_operation.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @operations_stub.call_rpc :delete_operation, request, options: options do |response, operation| + yield response, operation if block_given? + end + rescue ::GRPC::BadStatus => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Starts asynchronous cancellation on a long-running operation. The server + # makes a best effort to cancel the operation, but success is not + # guaranteed. If the server doesn't support this method, it returns + # `google.rpc.Code.UNIMPLEMENTED`. Clients can use + # Operations.GetOperation or + # other methods to check whether the cancellation succeeded or whether the + # operation completed despite cancellation. On successful cancellation, + # the operation is not deleted; instead, it becomes an operation with + # an {::Google::Longrunning::Operation#error Operation.error} value with a + # {::Google::Rpc::Status#code google.rpc.Status.code} of `1`, corresponding to + # `Code.CANCELLED`. + # + # @overload cancel_operation(request, options = nil) + # Pass arguments to `cancel_operation` via a request object, either of type + # {::Google::Longrunning::CancelOperationRequest} or an equivalent Hash. + # + # @param request [::Google::Longrunning::CancelOperationRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. + # + # @overload cancel_operation(name: nil) + # Pass arguments to `cancel_operation` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param name [::String] + # The name of the operation resource to be cancelled. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Google::Protobuf::Empty] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Google::Protobuf::Empty] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/longrunning" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Longrunning::Operations::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Longrunning::CancelOperationRequest.new + # + # # Call the cancel_operation method. + # result = client.cancel_operation request + # + # # The returned object is of type Google::Protobuf::Empty. + # p result + # + def cancel_operation request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Longrunning::CancelOperationRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + metadata = @config.rpcs.cancel_operation.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::Retail::V2::VERSION + metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.name + header_params["name"] = request.name + end + + request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") + metadata[:"x-goog-request-params"] ||= request_params_header + + options.apply_defaults timeout: @config.rpcs.cancel_operation.timeout, + metadata: metadata, + retry_policy: @config.rpcs.cancel_operation.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @operations_stub.call_rpc :cancel_operation, request, options: options do |response, operation| + yield response, operation if block_given? + end + rescue ::GRPC::BadStatus => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Waits until the specified long-running operation is done or reaches at most + # a specified timeout, returning the latest state. If the operation is + # already done, the latest state is immediately returned. If the timeout + # specified is greater than the default HTTP/RPC timeout, the HTTP/RPC + # timeout is used. If the server does not support this method, it returns + # `google.rpc.Code.UNIMPLEMENTED`. + # Note that this method is on a best-effort basis. It may return the latest + # state before the specified timeout (including immediately), meaning even an + # immediate response is no guarantee that the operation is done. + # + # @overload wait_operation(request, options = nil) + # Pass arguments to `wait_operation` via a request object, either of type + # {::Google::Longrunning::WaitOperationRequest} or an equivalent Hash. + # + # @param request [::Google::Longrunning::WaitOperationRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. + # + # @overload wait_operation(name: nil, timeout: nil) + # Pass arguments to `wait_operation` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param name [::String] + # The name of the operation resource to wait on. + # @param timeout [::Google::Protobuf::Duration, ::Hash] + # The maximum duration to wait before timing out. If left blank, the wait + # will be at most the time permitted by the underlying HTTP/RPC protocol. + # If RPC context deadline is also specified, the shorter one will be used. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Gapic::Operation] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Gapic::Operation] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/longrunning" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Longrunning::Operations::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Longrunning::WaitOperationRequest.new + # + # # Call the wait_operation method. + # result = client.wait_operation request + # + # # The returned object is of type Gapic::Operation. You can use it to + # # check the status of an operation, cancel it, or wait for results. + # # Here is how to wait for a response. + # result.wait_until_done! timeout: 60 + # if result.response? + # p result.response + # else + # puts "No response received." + # end + # + def wait_operation request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Longrunning::WaitOperationRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + metadata = @config.rpcs.wait_operation.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::Retail::V2::VERSION + metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + options.apply_defaults timeout: @config.rpcs.wait_operation.timeout, + metadata: metadata, + retry_policy: @config.rpcs.wait_operation.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @operations_stub.call_rpc :wait_operation, request, options: options do |response, operation| + response = ::Gapic::Operation.new response, @operations_client, options: options + yield response, operation if block_given? + throw :response, response + end + rescue ::GRPC::BadStatus => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Configuration class for the Operations API. + # + # This class represents the configuration for Operations, + # providing control over timeouts, retry behavior, logging, transport + # parameters, and other low-level controls. Certain parameters can also be + # applied individually to specific RPCs. See + # {::Google::Longrunning::Operations::Client::Configuration::Rpcs} + # for a list of RPCs that can be configured independently. + # + # Configuration can be applied globally to all clients, or to a single client + # on construction. + # + # @example + # + # # Modify the global config, setting the timeout for + # # list_operations to 20 seconds, + # # and all remaining timeouts to 10 seconds. + # ::Google::Longrunning::Operations::Client.configure do |config| + # config.timeout = 10.0 + # config.rpcs.list_operations.timeout = 20.0 + # end + # + # # Apply the above configuration only to a new client. + # client = ::Google::Longrunning::Operations::Client.new do |config| + # config.timeout = 10.0 + # config.rpcs.list_operations.timeout = 20.0 + # end + # + # @!attribute [rw] endpoint + # A custom service endpoint, as a hostname or hostname:port. The default is + # nil, indicating to use the default endpoint in the current universe domain. + # @return [::String,nil] + # @!attribute [rw] credentials + # Credentials to send with calls. You may provide any of the following types: + # * (`Google::Auth::Credentials`) A googleauth credentials object + # (see the [googleauth docs](https://rubydoc.info/gems/googleauth/Google/Auth/Credentials)) + # * (`Signet::OAuth2::Client`) A signet oauth2 client object + # (see the [signet docs](https://rubydoc.info/gems/signet/Signet/OAuth2/Client)) + # * (`GRPC::Core::Channel`) a gRPC channel with included credentials + # * (`GRPC::Core::ChannelCredentials`) a gRPC credentails object + # * (`nil`) indicating no credentials + # + # @note Warning: Passing a `String` to a keyfile path or a `Hash` of credentials + # is deprecated. Providing an unvalidated credential configuration to + # Google APIs can compromise the security of your systems and data. + # + # @example + # + # # The recommended way to provide credentials is to use the `make_creds` method + # # on the appropriate credentials class for your environment. + # + # require "googleauth" + # + # credentials = ::Google::Auth::ServiceAccountCredentials.make_creds( + # json_key_io: ::File.open("/path/to/keyfile.json") + # ) + # + # client = ::Google::Longrunning::Operations::Client.new do |config| + # config.credentials = credentials + # end + # + # @note Warning: If you accept a credential configuration (JSON file or Hash) from an + # external source for authentication to Google Cloud, you must validate it before + # providing it to a Google API client library. Providing an unvalidated credential + # configuration to Google APIs can compromise the security of your systems and data. + # For more information, refer to [Validate credential configurations from external + # sources](https://cloud.google.com/docs/authentication/external/externally-sourced-credentials). + # @return [::Object] + # @!attribute [rw] scope + # The OAuth scopes + # @return [::Array<::String>] + # @!attribute [rw] lib_name + # The library name as recorded in instrumentation and logging + # @return [::String] + # @!attribute [rw] lib_version + # The library version as recorded in instrumentation and logging + # @return [::String] + # @!attribute [rw] channel_args + # Extra parameters passed to the gRPC channel. Note: this is ignored if a + # `GRPC::Core::Channel` object is provided as the credential. + # @return [::Hash] + # @!attribute [rw] interceptors + # An array of interceptors that are run before calls are executed. + # @return [::Array<::GRPC::ClientInterceptor>] + # @!attribute [rw] timeout + # The call timeout in seconds. + # @return [::Numeric] + # @!attribute [rw] metadata + # Additional gRPC headers to be sent with the call. + # @return [::Hash{::Symbol=>::String}] + # @!attribute [rw] retry_policy + # The retry policy. The value is a hash with the following keys: + # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds. + # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds. + # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier. + # * `:retry_codes` (*type:* `Array`) - The error codes that should + # trigger a retry. + # @return [::Hash] + # @!attribute [rw] quota_project + # A separate project against which to charge quota. + # @return [::String] + # @!attribute [rw] universe_domain + # The universe domain within which to make requests. This determines the + # default endpoint URL. The default value of nil uses the environment + # universe (usually the default "googleapis.com" universe). + # @return [::String,nil] + # @!attribute [rw] logger + # A custom logger to use for request/response debug logging, or the value + # `:default` (the default) to construct a default logger, or `nil` to + # explicitly disable logging. + # @return [::Logger,:default,nil] + # + class Configuration + extend ::Gapic::Config + + # @private + # The endpoint specific to the default "googleapis.com" universe. Deprecated. + DEFAULT_ENDPOINT = "retail.googleapis.com" + + config_attr :endpoint, nil, ::String, nil + config_attr :credentials, nil do |value| + allowed = [::String, ::Hash, ::Proc, ::Symbol, ::Google::Auth::Credentials, ::Google::Auth::BaseClient, ::Signet::OAuth2::Client, nil] + allowed += [::GRPC::Core::Channel, ::GRPC::Core::ChannelCredentials] if defined? ::GRPC::Core::Channel + allowed.any? { |klass| klass === value } + end + config_attr :scope, nil, ::String, ::Array, nil + config_attr :lib_name, nil, ::String, nil + config_attr :lib_version, nil, ::String, nil + config_attr(:channel_args, { "grpc.service_config_disable_resolution" => 1 }, ::Hash, nil) + config_attr :interceptors, nil, ::Array, nil + config_attr :timeout, nil, ::Numeric, nil + config_attr :metadata, nil, ::Hash, nil + config_attr :retry_policy, nil, ::Hash, ::Proc, nil + config_attr :quota_project, nil, ::String, nil + config_attr :universe_domain, nil, ::String, nil + config_attr :logger, :default, ::Logger, nil, :default + + # @private + def initialize parent_config = nil + @parent_config = parent_config unless parent_config.nil? + + yield self if block_given? + end + + ## + # Configurations for individual RPCs + # @return [Rpcs] + # + def rpcs + @rpcs ||= begin + parent_rpcs = nil + parent_rpcs = @parent_config.rpcs if defined?(@parent_config) && @parent_config.respond_to?(:rpcs) + Rpcs.new parent_rpcs + end + end + + ## + # Configuration for the channel pool + # @return [::Gapic::ServiceStub::ChannelPool::Configuration] + # + def channel_pool + @channel_pool ||= ::Gapic::ServiceStub::ChannelPool::Configuration.new + end + + ## + # Configuration RPC class for the Operations API. + # + # Includes fields providing the configuration for each RPC in this service. + # Each configuration object is of type `Gapic::Config::Method` and includes + # the following configuration fields: + # + # * `timeout` (*type:* `Numeric`) - The call timeout in seconds + # * `metadata` (*type:* `Hash{Symbol=>String}`) - Additional gRPC headers + # * `retry_policy (*type:* `Hash`) - The retry policy. The policy fields + # include the following keys: + # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds. + # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds. + # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier. + # * `:retry_codes` (*type:* `Array`) - The error codes that should + # trigger a retry. + # + class Rpcs + ## + # RPC-specific configuration for `list_operations` + # @return [::Gapic::Config::Method] + # + attr_reader :list_operations + ## + # RPC-specific configuration for `get_operation` + # @return [::Gapic::Config::Method] + # + attr_reader :get_operation + ## + # RPC-specific configuration for `delete_operation` + # @return [::Gapic::Config::Method] + # + attr_reader :delete_operation + ## + # RPC-specific configuration for `cancel_operation` + # @return [::Gapic::Config::Method] + # + attr_reader :cancel_operation + ## + # RPC-specific configuration for `wait_operation` + # @return [::Gapic::Config::Method] + # + attr_reader :wait_operation + + # @private + def initialize parent_rpcs = nil + list_operations_config = parent_rpcs.list_operations if parent_rpcs.respond_to? :list_operations + @list_operations = ::Gapic::Config::Method.new list_operations_config + get_operation_config = parent_rpcs.get_operation if parent_rpcs.respond_to? :get_operation + @get_operation = ::Gapic::Config::Method.new get_operation_config + delete_operation_config = parent_rpcs.delete_operation if parent_rpcs.respond_to? :delete_operation + @delete_operation = ::Gapic::Config::Method.new delete_operation_config + cancel_operation_config = parent_rpcs.cancel_operation if parent_rpcs.respond_to? :cancel_operation + @cancel_operation = ::Gapic::Config::Method.new cancel_operation_config + wait_operation_config = parent_rpcs.wait_operation if parent_rpcs.respond_to? :wait_operation + @wait_operation = ::Gapic::Config::Method.new wait_operation_config + + yield self if block_given? + end + end + end + end + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-retail-v2/lib/google/cloud/retail/v2/user_event_service/paths.rb b/owl-bot-staging/google-cloud-retail-v2/lib/google/cloud/retail/v2/user_event_service/paths.rb new file mode 100644 index 000000000000..83bc1611ec7f --- /dev/null +++ b/owl-bot-staging/google-cloud-retail-v2/lib/google/cloud/retail/v2/user_event_service/paths.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 Cloud + module Retail + module V2 + module UserEventService + # Path helper methods for the UserEventService API. + module Paths + ## + # Create a fully-qualified Catalog resource string. + # + # The resource will be in the following format: + # + # `projects/{project}/locations/{location}/catalogs/{catalog}` + # + # @param project [String] + # @param location [String] + # @param catalog [String] + # + # @return [::String] + def catalog_path project:, location:, catalog: + raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" + raise ::ArgumentError, "location cannot contain /" if location.to_s.include? "/" + + "projects/#{project}/locations/#{location}/catalogs/#{catalog}" + end + + ## + # Create a fully-qualified Product resource string. + # + # The resource will be in the following format: + # + # `projects/{project}/locations/{location}/catalogs/{catalog}/branches/{branch}/products/{product}` + # + # @param project [String] + # @param location [String] + # @param catalog [String] + # @param branch [String] + # @param product [String] + # + # @return [::String] + def product_path project:, location:, catalog:, branch:, product: + raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" + raise ::ArgumentError, "location cannot contain /" if location.to_s.include? "/" + raise ::ArgumentError, "catalog cannot contain /" if catalog.to_s.include? "/" + raise ::ArgumentError, "branch cannot contain /" if branch.to_s.include? "/" + + "projects/#{project}/locations/#{location}/catalogs/#{catalog}/branches/#{branch}/products/#{product}" + end + + extend self + end + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-retail-v2/lib/google/cloud/retail/v2/user_event_service/rest.rb b/owl-bot-staging/google-cloud-retail-v2/lib/google/cloud/retail/v2/user_event_service/rest.rb new file mode 100644 index 000000000000..dfa91294298f --- /dev/null +++ b/owl-bot-staging/google-cloud-retail-v2/lib/google/cloud/retail/v2/user_event_service/rest.rb @@ -0,0 +1,53 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +require "gapic/rest" +require "gapic/config" +require "gapic/config/method" + +require "google/cloud/retail/v2/version" + +require "google/cloud/retail/v2/user_event_service/credentials" +require "google/cloud/retail/v2/user_event_service/paths" +require "google/cloud/retail/v2/user_event_service/rest/operations" +require "google/cloud/retail/v2/user_event_service/rest/client" + +module Google + module Cloud + module Retail + module V2 + ## + # Service for ingesting end user actions on the customer website. + # + # To load this service and instantiate a REST client: + # + # require "google/cloud/retail/v2/user_event_service/rest" + # client = ::Google::Cloud::Retail::V2::UserEventService::Rest::Client.new + # + module UserEventService + # Client for the REST transport + module Rest + end + end + end + end + end +end + +helper_path = ::File.join __dir__, "rest", "helpers.rb" +require "google/cloud/retail/v2/user_event_service/rest/helpers" if ::File.file? helper_path diff --git a/owl-bot-staging/google-cloud-retail-v2/lib/google/cloud/retail/v2/user_event_service/rest/client.rb b/owl-bot-staging/google-cloud-retail-v2/lib/google/cloud/retail/v2/user_event_service/rest/client.rb new file mode 100644 index 000000000000..758920156bf4 --- /dev/null +++ b/owl-bot-staging/google-cloud-retail-v2/lib/google/cloud/retail/v2/user_event_service/rest/client.rb @@ -0,0 +1,928 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +require "google/cloud/errors" +require "google/cloud/retail/v2/user_event_service_pb" +require "google/cloud/retail/v2/user_event_service/rest/service_stub" +require "google/cloud/location/rest" + +module Google + module Cloud + module Retail + module V2 + module UserEventService + module Rest + ## + # REST client for the UserEventService service. + # + # Service for ingesting end user actions on the customer website. + # + class Client + # @private + API_VERSION = "" + + # @private + DEFAULT_ENDPOINT_TEMPLATE = "retail.$UNIVERSE_DOMAIN$" + + include Paths + + # @private + attr_reader :user_event_service_stub + + ## + # Configure the UserEventService Client class. + # + # See {::Google::Cloud::Retail::V2::UserEventService::Rest::Client::Configuration} + # for a description of the configuration fields. + # + # @example + # + # # Modify the configuration for all UserEventService clients + # ::Google::Cloud::Retail::V2::UserEventService::Rest::Client.configure do |config| + # config.timeout = 10.0 + # end + # + # @yield [config] Configure the Client client. + # @yieldparam config [Client::Configuration] + # + # @return [Client::Configuration] + # + def self.configure + @configure ||= begin + namespace = ["Google", "Cloud", "Retail", "V2"] + parent_config = while namespace.any? + parent_name = namespace.join "::" + parent_const = const_get parent_name + break parent_const.configure if parent_const.respond_to? :configure + namespace.pop + end + default_config = Client::Configuration.new parent_config + + default_config.timeout = 10.0 + default_config.retry_policy = { + initial_delay: 0.1, max_delay: 5.0, multiplier: 1.3, retry_codes: [14, 4] + } + + default_config.rpcs.purge_user_events.timeout = 30.0 + default_config.rpcs.purge_user_events.retry_policy = { + initial_delay: 0.1, max_delay: 30.0, multiplier: 1.3, retry_codes: [14, 4] + } + + default_config.rpcs.import_user_events.timeout = 600.0 + default_config.rpcs.import_user_events.retry_policy = { + initial_delay: 0.1, max_delay: 300.0, multiplier: 1.3, retry_codes: [14, 4] + } + + default_config + end + yield @configure if block_given? + @configure + end + + ## + # Configure the UserEventService Client instance. + # + # The configuration is set to the derived mode, meaning that values can be changed, + # but structural changes (adding new fields, etc.) are not allowed. Structural changes + # should be made on {Client.configure}. + # + # See {::Google::Cloud::Retail::V2::UserEventService::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 + @user_event_service_stub.universe_domain + end + + ## + # Create a new UserEventService REST client object. + # + # @example + # + # # Create a client using the default configuration + # client = ::Google::Cloud::Retail::V2::UserEventService::Rest::Client.new + # + # # Create a client using a custom configuration + # client = ::Google::Cloud::Retail::V2::UserEventService::Rest::Client.new do |config| + # config.timeout = 10.0 + # end + # + # @yield [config] Configure the UserEventService client. + # @yieldparam config [Client::Configuration] + # + def initialize + # Create the configuration object + @config = Configuration.new Client.configure + + # Yield the configuration if needed + yield @config if block_given? + + # Create credentials + credentials = @config.credentials + # Use self-signed JWT if the endpoint is unchanged from default, + # but only if the default endpoint does not have a region prefix. + enable_self_signed_jwt = @config.endpoint.nil? || + (@config.endpoint == Configuration::DEFAULT_ENDPOINT && + !@config.endpoint.split(".").first.include?("-")) + credentials ||= Credentials.default scope: @config.scope, + enable_self_signed_jwt: enable_self_signed_jwt + if credentials.is_a?(::String) || credentials.is_a?(::Hash) + credentials = Credentials.new credentials, scope: @config.scope + end + + @quota_project_id = @config.quota_project + @quota_project_id ||= credentials.quota_project_id if credentials.respond_to? :quota_project_id + + @operations_client = ::Google::Cloud::Retail::V2::UserEventService::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 + + @user_event_service_stub = ::Google::Cloud::Retail::V2::UserEventService::Rest::ServiceStub.new( + endpoint: @config.endpoint, + endpoint_template: DEFAULT_ENDPOINT_TEMPLATE, + universe_domain: @config.universe_domain, + credentials: credentials, + logger: @config.logger + ) + + @user_event_service_stub.logger(stub: true)&.info do |entry| + entry.set_system_name + entry.set_service + entry.message = "Created client for #{entry.service}" + entry.set_credentials_fields credentials + entry.set "customEndpoint", @config.endpoint if @config.endpoint + entry.set "defaultTimeout", @config.timeout if @config.timeout + entry.set "quotaProject", @quota_project_id if @quota_project_id + end + + @location_client = Google::Cloud::Location::Locations::Rest::Client.new do |config| + config.credentials = credentials + config.quota_project = @quota_project_id + config.endpoint = @user_event_service_stub.endpoint + config.universe_domain = @user_event_service_stub.universe_domain + config.logger = @user_event_service_stub.logger if config.respond_to? :logger= + end + end + + ## + # Get the associated client for long-running operations. + # + # @return [::Google::Cloud::Retail::V2::UserEventService::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 + @user_event_service_stub.logger + end + + # Service calls + + ## + # Writes a single user event. + # + # @overload write_user_event(request, options = nil) + # Pass arguments to `write_user_event` via a request object, either of type + # {::Google::Cloud::Retail::V2::WriteUserEventRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Retail::V2::WriteUserEventRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @overload write_user_event(parent: nil, user_event: nil, write_async: nil) + # Pass arguments to `write_user_event` via keyword arguments. Note that at + # least one keyword argument is 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 catalog resource name, such as + # `projects/1234/locations/global/catalogs/default_catalog`. + # @param user_event [::Google::Cloud::Retail::V2::UserEvent, ::Hash] + # Required. User event to write. + # @param write_async [::Boolean] + # If set to true, the user event will be written asynchronously after + # validation, and the API will respond without waiting for the write. + # Therefore, silent failures can occur even if the API returns success. In + # case of silent failures, error messages can be found in Stackdriver logs. + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Cloud::Retail::V2::UserEvent] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::Retail::V2::UserEvent] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/retail/v2" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Retail::V2::UserEventService::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Retail::V2::WriteUserEventRequest.new + # + # # Call the write_user_event method. + # result = client.write_user_event request + # + # # The returned object is of type Google::Cloud::Retail::V2::UserEvent. + # p result + # + def write_user_event request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Retail::V2::WriteUserEventRequest + + # Converts hash 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.write_user_event.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::Retail::V2::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + options.apply_defaults timeout: @config.rpcs.write_user_event.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.write_user_event.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @user_event_service_stub.write_user_event 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 + + ## + # Writes a single user event from the browser. + # + # For larger user event payload over 16 KB, the POST method should be used + # instead, otherwise a 400 Bad Request error is returned. + # + # This method is used only by the Retail API JavaScript pixel and Google Tag + # Manager. Users should not call this method directly. + # + # @overload collect_user_event(request, options = nil) + # Pass arguments to `collect_user_event` via a request object, either of type + # {::Google::Cloud::Retail::V2::CollectUserEventRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Retail::V2::CollectUserEventRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @overload collect_user_event(prebuilt_rule: nil, parent: nil, user_event: nil, uri: nil, ets: nil, raw_json: nil) + # Pass arguments to `collect_user_event` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param prebuilt_rule [::String] + # The prebuilt rule name that can convert a specific type of raw_json. + # For example: "ga4_bq" rule for the GA4 user event schema. + # @param parent [::String] + # Required. The parent catalog name, such as + # `projects/1234/locations/global/catalogs/default_catalog`. + # @param user_event [::String] + # Required. URL encoded UserEvent proto with a length limit of 2,000,000 + # characters. + # @param uri [::String] + # The URL including cgi-parameters but excluding the hash fragment with a + # length limit of 5,000 characters. This is often more useful than the + # referer URL, because many browsers only send the domain for 3rd party + # requests. + # @param ets [::Integer] + # The event timestamp in milliseconds. This prevents browser caching of + # otherwise identical get requests. The name is abbreviated to reduce the + # payload bytes. + # @param raw_json [::String] + # An arbitrary serialized JSON string that contains necessary information + # that can comprise a user event. When this field is specified, the + # user_event field will be ignored. Note: line-delimited JSON is not + # supported, a single JSON only. + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Api::HttpBody] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Api::HttpBody] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/retail/v2" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Retail::V2::UserEventService::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Retail::V2::CollectUserEventRequest.new + # + # # Call the collect_user_event method. + # result = client.collect_user_event request + # + # # The returned object is of type Google::Api::HttpBody. + # p result + # + def collect_user_event request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Retail::V2::CollectUserEventRequest + + # Converts hash 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.collect_user_event.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::Retail::V2::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + options.apply_defaults timeout: @config.rpcs.collect_user_event.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.collect_user_event.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @user_event_service_stub.collect_user_event request, options do |result, operation| + yield result, operation if block_given? + end + rescue ::Gapic::Rest::Error => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Deletes permanently all user events specified by the filter provided. + # Depending on the number of events specified by the filter, this operation + # could take hours or days to complete. To test a filter, use the list + # command first. + # + # @overload purge_user_events(request, options = nil) + # Pass arguments to `purge_user_events` via a request object, either of type + # {::Google::Cloud::Retail::V2::PurgeUserEventsRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Retail::V2::PurgeUserEventsRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @overload purge_user_events(parent: nil, filter: nil, force: nil) + # Pass arguments to `purge_user_events` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param parent [::String] + # Required. The resource name of the catalog under which the events are + # created. The format is + # `projects/${projectId}/locations/global/catalogs/${catalogId}` + # @param filter [::String] + # Required. The filter string to specify the events to be deleted with a + # length limit of 5,000 characters. Empty string filter is not allowed. The + # eligible fields for filtering are: + # + # * `eventType`: Double quoted + # {::Google::Cloud::Retail::V2::UserEvent#event_type UserEvent.event_type} string. + # * `eventTime`: in ISO 8601 "zulu" format. + # * `visitorId`: Double quoted string. Specifying this will delete all + # events associated with a visitor. + # * `userId`: Double quoted string. Specifying this will delete all events + # associated with a user. + # + # Examples: + # + # * Deleting all events in a time range: + # `eventTime > "2012-04-23T18:25:43.511Z" + # eventTime < "2012-04-23T18:30:43.511Z"` + # * Deleting specific eventType in time range: + # `eventTime > "2012-04-23T18:25:43.511Z" eventType = "detail-page-view"` + # * Deleting all events for a specific visitor: + # `visitorId = "visitor1024"` + # + # The filtering fields are assumed to have an implicit AND. + # @param force [::Boolean] + # Actually perform the purge. + # If `force` is set to false, the method will return the expected purge count + # without deleting any user events. + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Gapic::Operation] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Gapic::Operation] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/retail/v2" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Retail::V2::UserEventService::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Retail::V2::PurgeUserEventsRequest.new + # + # # Call the purge_user_events method. + # result = client.purge_user_events 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 purge_user_events request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Retail::V2::PurgeUserEventsRequest + + # Converts hash 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.purge_user_events.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::Retail::V2::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + options.apply_defaults timeout: @config.rpcs.purge_user_events.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.purge_user_events.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @user_event_service_stub.purge_user_events 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 + + ## + # Bulk import of User events. Request processing might be + # synchronous. Events that already exist are skipped. + # Use this method for backfilling historical user events. + # + # `Operation.response` is of type `ImportResponse`. Note that it is + # possible for a subset of the items to be successfully inserted. + # `Operation.metadata` is of type `ImportMetadata`. + # + # @overload import_user_events(request, options = nil) + # Pass arguments to `import_user_events` via a request object, either of type + # {::Google::Cloud::Retail::V2::ImportUserEventsRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Retail::V2::ImportUserEventsRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @overload import_user_events(parent: nil, input_config: nil, errors_config: nil) + # Pass arguments to `import_user_events` via keyword arguments. Note that at + # least one keyword argument is 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. `projects/1234/locations/global/catalogs/default_catalog` + # @param input_config [::Google::Cloud::Retail::V2::UserEventInputConfig, ::Hash] + # Required. The desired input location of the data. + # @param errors_config [::Google::Cloud::Retail::V2::ImportErrorsConfig, ::Hash] + # The desired location of errors incurred during the Import. Cannot be set + # for inline user event imports. + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Gapic::Operation] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Gapic::Operation] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/retail/v2" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Retail::V2::UserEventService::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Retail::V2::ImportUserEventsRequest.new + # + # # Call the import_user_events method. + # result = client.import_user_events 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 import_user_events request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Retail::V2::ImportUserEventsRequest + + # Converts hash 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.import_user_events.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::Retail::V2::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + options.apply_defaults timeout: @config.rpcs.import_user_events.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.import_user_events.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @user_event_service_stub.import_user_events 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 + + ## + # Starts a user-event rejoin operation with latest product catalog. Events + # are not annotated with detailed product information for products that are + # missing from the catalog when the user event is ingested. These + # events are stored as unjoined events with limited usage on training and + # serving. You can use this method to start a join operation on specified + # events with the latest version of product catalog. You can also use this + # method to correct events joined with the wrong product catalog. A rejoin + # operation can take hours or days to complete. + # + # @overload rejoin_user_events(request, options = nil) + # Pass arguments to `rejoin_user_events` via a request object, either of type + # {::Google::Cloud::Retail::V2::RejoinUserEventsRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Retail::V2::RejoinUserEventsRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @overload rejoin_user_events(parent: nil, user_event_rejoin_scope: nil) + # Pass arguments to `rejoin_user_events` via keyword arguments. Note that at + # least one keyword argument is 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 catalog resource name, such as + # `projects/1234/locations/global/catalogs/default_catalog`. + # @param user_event_rejoin_scope [::Google::Cloud::Retail::V2::RejoinUserEventsRequest::UserEventRejoinScope] + # The type of the user event rejoin to define the scope and range of the user + # events to be rejoined with the latest product catalog. Defaults to + # `USER_EVENT_REJOIN_SCOPE_UNSPECIFIED` if this field is not set, or set to + # an invalid integer value. + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Gapic::Operation] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Gapic::Operation] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/retail/v2" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Retail::V2::UserEventService::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Retail::V2::RejoinUserEventsRequest.new + # + # # Call the rejoin_user_events method. + # result = client.rejoin_user_events 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 rejoin_user_events request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Retail::V2::RejoinUserEventsRequest + + # Converts hash 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.rejoin_user_events.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::Retail::V2::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + options.apply_defaults timeout: @config.rpcs.rejoin_user_events.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.rejoin_user_events.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @user_event_service_stub.rejoin_user_events 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 + + ## + # Configuration class for the UserEventService REST API. + # + # This class represents the configuration for UserEventService REST, + # providing control over timeouts, retry behavior, logging, transport + # parameters, and other low-level controls. Certain parameters can also be + # applied individually to specific RPCs. See + # {::Google::Cloud::Retail::V2::UserEventService::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 + # # write_user_event to 20 seconds, + # # and all remaining timeouts to 10 seconds. + # ::Google::Cloud::Retail::V2::UserEventService::Rest::Client.configure do |config| + # config.timeout = 10.0 + # config.rpcs.write_user_event.timeout = 20.0 + # end + # + # # Apply the above configuration only to a new client. + # client = ::Google::Cloud::Retail::V2::UserEventService::Rest::Client.new do |config| + # config.timeout = 10.0 + # config.rpcs.write_user_event.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 = "retail.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 UserEventService 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 `write_user_event` + # @return [::Gapic::Config::Method] + # + attr_reader :write_user_event + ## + # RPC-specific configuration for `collect_user_event` + # @return [::Gapic::Config::Method] + # + attr_reader :collect_user_event + ## + # RPC-specific configuration for `purge_user_events` + # @return [::Gapic::Config::Method] + # + attr_reader :purge_user_events + ## + # RPC-specific configuration for `import_user_events` + # @return [::Gapic::Config::Method] + # + attr_reader :import_user_events + ## + # RPC-specific configuration for `rejoin_user_events` + # @return [::Gapic::Config::Method] + # + attr_reader :rejoin_user_events + + # @private + def initialize parent_rpcs = nil + write_user_event_config = parent_rpcs.write_user_event if parent_rpcs.respond_to? :write_user_event + @write_user_event = ::Gapic::Config::Method.new write_user_event_config + collect_user_event_config = parent_rpcs.collect_user_event if parent_rpcs.respond_to? :collect_user_event + @collect_user_event = ::Gapic::Config::Method.new collect_user_event_config + purge_user_events_config = parent_rpcs.purge_user_events if parent_rpcs.respond_to? :purge_user_events + @purge_user_events = ::Gapic::Config::Method.new purge_user_events_config + import_user_events_config = parent_rpcs.import_user_events if parent_rpcs.respond_to? :import_user_events + @import_user_events = ::Gapic::Config::Method.new import_user_events_config + rejoin_user_events_config = parent_rpcs.rejoin_user_events if parent_rpcs.respond_to? :rejoin_user_events + @rejoin_user_events = ::Gapic::Config::Method.new rejoin_user_events_config + + yield self if block_given? + end + end + end + end + end + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-retail-v2/lib/google/cloud/retail/v2/user_event_service/rest/operations.rb b/owl-bot-staging/google-cloud-retail-v2/lib/google/cloud/retail/v2/user_event_service/rest/operations.rb new file mode 100644 index 000000000000..093c7c3864c3 --- /dev/null +++ b/owl-bot-staging/google-cloud-retail-v2/lib/google/cloud/retail/v2/user_event_service/rest/operations.rb @@ -0,0 +1,960 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +require "gapic/operation" + +module Google + module Cloud + module Retail + module V2 + module UserEventService + module Rest + # Service that implements Longrunning Operations API. + class Operations + # @private + API_VERSION = "" + + # @private + DEFAULT_ENDPOINT_TEMPLATE = "retail.$UNIVERSE_DOMAIN$" + + # @private + attr_reader :operations_stub + + ## + # Configuration for the UserEventService 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 UserEventService 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::Retail::V2::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + options.apply_defaults timeout: @config.rpcs.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::Retail::V2::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + options.apply_defaults timeout: @config.rpcs.get_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::Retail::V2::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + options.apply_defaults timeout: @config.rpcs.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::Retail::V2::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + options.apply_defaults timeout: @config.rpcs.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 = "retail.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: "/v2/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v2/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/catalogs/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v2/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/?$}, 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: "/v2/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v2/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/catalogs/[^/]+/branches/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v2/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/catalogs/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v2/{name}", + matches: [ + ["name", %r{^projects/[^/]+/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 +end diff --git a/owl-bot-staging/google-cloud-retail-v2/lib/google/cloud/retail/v2/user_event_service/rest/service_stub.rb b/owl-bot-staging/google-cloud-retail-v2/lib/google/cloud/retail/v2/user_event_service/rest/service_stub.rb new file mode 100644 index 000000000000..d2603e85207f --- /dev/null +++ b/owl-bot-staging/google-cloud-retail-v2/lib/google/cloud/retail/v2/user_event_service/rest/service_stub.rb @@ -0,0 +1,398 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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/retail/v2/user_event_service_pb" + +module Google + module Cloud + module Retail + module V2 + module UserEventService + module Rest + ## + # REST service stub for the UserEventService 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 write_user_event REST call + # + # @param request_pb [::Google::Cloud::Retail::V2::WriteUserEventRequest] + # A request object representing the call parameters. Required. + # @param options [::Gapic::CallOptions] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Cloud::Retail::V2::UserEvent] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::Retail::V2::UserEvent] + # A result object deserialized from the server's reply + def write_user_event request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_write_user_event_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: "write_user_event", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Cloud::Retail::V2::UserEvent.decode_json response.body, ignore_unknown_fields: true + catch :response do + yield result, operation if block_given? + result + end + end + + ## + # Baseline implementation for the collect_user_event REST call + # + # @param request_pb [::Google::Cloud::Retail::V2::CollectUserEventRequest] + # 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::Api::HttpBody] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Api::HttpBody] + # A result object deserialized from the server's reply + def collect_user_event request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_collect_user_event_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: "collect_user_event", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Api::HttpBody.decode_json response.body, ignore_unknown_fields: true + catch :response do + yield result, operation if block_given? + result + end + end + + ## + # Baseline implementation for the purge_user_events REST call + # + # @param request_pb [::Google::Cloud::Retail::V2::PurgeUserEventsRequest] + # 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 purge_user_events request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_purge_user_events_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: "purge_user_events", + 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 import_user_events REST call + # + # @param request_pb [::Google::Cloud::Retail::V2::ImportUserEventsRequest] + # 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 import_user_events request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_import_user_events_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: "import_user_events", + 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 rejoin_user_events REST call + # + # @param request_pb [::Google::Cloud::Retail::V2::RejoinUserEventsRequest] + # 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 rejoin_user_events request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_rejoin_user_events_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: "rejoin_user_events", + 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 + + ## + # @private + # + # GRPC transcoding helper method for the write_user_event REST call + # + # @param request_pb [::Google::Cloud::Retail::V2::WriteUserEventRequest] + # A request object representing the call parameters. Required. + # @return [Array(String, [String, nil], Hash{String => String})] + # Uri, Body, Query string parameters + def self.transcode_write_user_event_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :post, + uri_template: "/v2/{parent}/userEvents:write", + body: "user_event", + matches: [ + ["parent", %r{^projects/[^/]+/locations/[^/]+/catalogs/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the collect_user_event REST call + # + # @param request_pb [::Google::Cloud::Retail::V2::CollectUserEventRequest] + # A request object representing the call parameters. Required. + # @return [Array(String, [String, nil], Hash{String => String})] + # Uri, Body, Query string parameters + def self.transcode_collect_user_event_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :get, + uri_template: "/v2/{parent}/userEvents:collect", + matches: [ + ["parent", %r{^projects/[^/]+/locations/[^/]+/catalogs/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v2/{parent}/userEvents:collect", + body: "*", + matches: [ + ["parent", %r{^projects/[^/]+/locations/[^/]+/catalogs/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the purge_user_events REST call + # + # @param request_pb [::Google::Cloud::Retail::V2::PurgeUserEventsRequest] + # A request object representing the call parameters. Required. + # @return [Array(String, [String, nil], Hash{String => String})] + # Uri, Body, Query string parameters + def self.transcode_purge_user_events_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :post, + uri_template: "/v2/{parent}/userEvents:purge", + body: "*", + matches: [ + ["parent", %r{^projects/[^/]+/locations/[^/]+/catalogs/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the import_user_events REST call + # + # @param request_pb [::Google::Cloud::Retail::V2::ImportUserEventsRequest] + # A request object representing the call parameters. Required. + # @return [Array(String, [String, nil], Hash{String => String})] + # Uri, Body, Query string parameters + def self.transcode_import_user_events_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :post, + uri_template: "/v2/{parent}/userEvents:import", + body: "*", + matches: [ + ["parent", %r{^projects/[^/]+/locations/[^/]+/catalogs/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the rejoin_user_events REST call + # + # @param request_pb [::Google::Cloud::Retail::V2::RejoinUserEventsRequest] + # A request object representing the call parameters. Required. + # @return [Array(String, [String, nil], Hash{String => String})] + # Uri, Body, Query string parameters + def self.transcode_rejoin_user_events_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :post, + uri_template: "/v2/{parent}/userEvents:rejoin", + body: "*", + matches: [ + ["parent", %r{^projects/[^/]+/locations/[^/]+/catalogs/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + end + end + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-retail-v2/lib/google/cloud/retail/v2/user_event_service_pb.rb b/owl-bot-staging/google-cloud-retail-v2/lib/google/cloud/retail/v2/user_event_service_pb.rb new file mode 100644 index 000000000000..69dbde1899d7 --- /dev/null +++ b/owl-bot-staging/google-cloud-retail-v2/lib/google/cloud/retail/v2/user_event_service_pb.rb @@ -0,0 +1,36 @@ +# frozen_string_literal: true +# Generated by the protocol buffer compiler. DO NOT EDIT! +# source: google/cloud/retail/v2/user_event_service.proto + +require 'google/protobuf' + +require 'google/api/annotations_pb' +require 'google/api/client_pb' +require 'google/api/field_behavior_pb' +require 'google/api/httpbody_pb' +require 'google/api/resource_pb' +require 'google/cloud/retail/v2/import_config_pb' +require 'google/cloud/retail/v2/purge_config_pb' +require 'google/cloud/retail/v2/user_event_pb' +require 'google/longrunning/operations_pb' + + +descriptor_data = "\n/google/cloud/retail/v2/user_event_service.proto\x12\x16google.cloud.retail.v2\x1a\x1cgoogle/api/annotations.proto\x1a\x17google/api/client.proto\x1a\x1fgoogle/api/field_behavior.proto\x1a\x19google/api/httpbody.proto\x1a\x19google/api/resource.proto\x1a*google/cloud/retail/v2/import_config.proto\x1a)google/cloud/retail/v2/purge_config.proto\x1a\'google/cloud/retail/v2/user_event.proto\x1a#google/longrunning/operations.proto\"}\n\x15WriteUserEventRequest\x12\x13\n\x06parent\x18\x01 \x01(\tB\x03\xe0\x41\x02\x12:\n\nuser_event\x18\x02 \x01(\x0b\x32!.google.cloud.retail.v2.UserEventB\x03\xe0\x41\x02\x12\x13\n\x0bwrite_async\x18\x03 \x01(\x08\"\x9f\x01\n\x17\x43ollectUserEventRequest\x12\x17\n\rprebuilt_rule\x18\x06 \x01(\tH\x00\x12\x13\n\x06parent\x18\x01 \x01(\tB\x03\xe0\x41\x02\x12\x17\n\nuser_event\x18\x02 \x01(\tB\x03\xe0\x41\x02\x12\x0b\n\x03uri\x18\x03 \x01(\t\x12\x0b\n\x03\x65ts\x18\x04 \x01(\x03\x12\x10\n\x08raw_json\x18\x05 \x01(\tB\x11\n\x0f\x63onversion_rule\"\xfe\x01\n\x17RejoinUserEventsRequest\x12\x13\n\x06parent\x18\x01 \x01(\tB\x03\xe0\x41\x02\x12\x65\n\x17user_event_rejoin_scope\x18\x02 \x01(\x0e\x32\x44.google.cloud.retail.v2.RejoinUserEventsRequest.UserEventRejoinScope\"g\n\x14UserEventRejoinScope\x12\'\n#USER_EVENT_REJOIN_SCOPE_UNSPECIFIED\x10\x00\x12\x11\n\rJOINED_EVENTS\x10\x01\x12\x13\n\x0fUNJOINED_EVENTS\x10\x02\">\n\x18RejoinUserEventsResponse\x12\"\n\x1arejoined_user_events_count\x18\x01 \x01(\x03\"\x1a\n\x18RejoinUserEventsMetadata2\x89\n\n\x10UserEventService\x12\xb7\x01\n\x0eWriteUserEvent\x12-.google.cloud.retail.v2.WriteUserEventRequest\x1a!.google.cloud.retail.v2.UserEvent\"S\x82\xd3\xe4\x93\x02M\"?/v2/{parent=projects/*/locations/*/catalogs/*}/userEvents:write:\nuser_event\x12\xee\x01\n\x10\x43ollectUserEvent\x12/.google.cloud.retail.v2.CollectUserEventRequest\x1a\x14.google.api.HttpBody\"\x92\x01\x82\xd3\xe4\x93\x02\x8b\x01\x12\x41/v2/{parent=projects/*/locations/*/catalogs/*}/userEvents:collectZF\"A/v2/{parent=projects/*/locations/*/catalogs/*}/userEvents:collect:\x01*\x12\x86\x02\n\x0fPurgeUserEvents\x12..google.cloud.retail.v2.PurgeUserEventsRequest\x1a\x1d.google.longrunning.Operation\"\xa3\x01\xca\x41V\n.google.cloud.retail.v2.PurgeUserEventsResponse\x12$google.cloud.retail.v2.PurgeMetadata\x82\xd3\xe4\x93\x02\x44\"?/v2/{parent=projects/*/locations/*/catalogs/*}/userEvents:purge:\x01*\x12\x8b\x02\n\x10ImportUserEvents\x12/.google.cloud.retail.v2.ImportUserEventsRequest\x1a\x1d.google.longrunning.Operation\"\xa6\x01\xca\x41X\n/google.cloud.retail.v2.ImportUserEventsResponse\x12%google.cloud.retail.v2.ImportMetadata\x82\xd3\xe4\x93\x02\x45\"@/v2/{parent=projects/*/locations/*/catalogs/*}/userEvents:import:\x01*\x12\xe7\x01\n\x10RejoinUserEvents\x12/.google.cloud.retail.v2.RejoinUserEventsRequest\x1a\x1d.google.longrunning.Operation\"\x82\x01\xca\x41\x34\n\x18RejoinUserEventsResponse\x12\x18RejoinUserEventsMetadata\x82\xd3\xe4\x93\x02\x45\"@/v2/{parent=projects/*/locations/*/catalogs/*}/userEvents:rejoin:\x01*\x1aI\xca\x41\x15retail.googleapis.com\xd2\x41.https://www.googleapis.com/auth/cloud-platformB\xc0\x01\n\x1a\x63om.google.cloud.retail.v2B\x15UserEventServiceProtoP\x01Z2cloud.google.com/go/retail/apiv2/retailpb;retailpb\xa2\x02\x06RETAIL\xaa\x02\x16Google.Cloud.Retail.V2\xca\x02\x16Google\\Cloud\\Retail\\V2\xea\x02\x19Google::Cloud::Retail::V2b\x06proto3" + +pool = ::Google::Protobuf::DescriptorPool.generated_pool +pool.add_serialized_file(descriptor_data) + +module Google + module Cloud + module Retail + module V2 + WriteUserEventRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.retail.v2.WriteUserEventRequest").msgclass + CollectUserEventRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.retail.v2.CollectUserEventRequest").msgclass + RejoinUserEventsRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.retail.v2.RejoinUserEventsRequest").msgclass + RejoinUserEventsRequest::UserEventRejoinScope = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.retail.v2.RejoinUserEventsRequest.UserEventRejoinScope").enummodule + RejoinUserEventsResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.retail.v2.RejoinUserEventsResponse").msgclass + RejoinUserEventsMetadata = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.retail.v2.RejoinUserEventsMetadata").msgclass + end + end + end +end diff --git a/owl-bot-staging/google-cloud-retail-v2/lib/google/cloud/retail/v2/user_event_service_services_pb.rb b/owl-bot-staging/google-cloud-retail-v2/lib/google/cloud/retail/v2/user_event_service_services_pb.rb new file mode 100644 index 000000000000..65e9fe4b7c1f --- /dev/null +++ b/owl-bot-staging/google-cloud-retail-v2/lib/google/cloud/retail/v2/user_event_service_services_pb.rb @@ -0,0 +1,75 @@ +# Generated by the protocol buffer compiler. DO NOT EDIT! +# Source: google/cloud/retail/v2/user_event_service.proto for package 'Google.Cloud.Retail.V2' +# Original file comments: +# 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 +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# + +require 'grpc' +require 'google/cloud/retail/v2/user_event_service_pb' + +module Google + module Cloud + module Retail + module V2 + module UserEventService + # Service for ingesting end user actions on the customer website. + class Service + + include ::GRPC::GenericService + + self.marshal_class_method = :encode + self.unmarshal_class_method = :decode + self.service_name = 'google.cloud.retail.v2.UserEventService' + + # Writes a single user event. + rpc :WriteUserEvent, ::Google::Cloud::Retail::V2::WriteUserEventRequest, ::Google::Cloud::Retail::V2::UserEvent + # Writes a single user event from the browser. + # + # For larger user event payload over 16 KB, the POST method should be used + # instead, otherwise a 400 Bad Request error is returned. + # + # This method is used only by the Retail API JavaScript pixel and Google Tag + # Manager. Users should not call this method directly. + rpc :CollectUserEvent, ::Google::Cloud::Retail::V2::CollectUserEventRequest, ::Google::Api::HttpBody + # Deletes permanently all user events specified by the filter provided. + # Depending on the number of events specified by the filter, this operation + # could take hours or days to complete. To test a filter, use the list + # command first. + rpc :PurgeUserEvents, ::Google::Cloud::Retail::V2::PurgeUserEventsRequest, ::Google::Longrunning::Operation + # Bulk import of User events. Request processing might be + # synchronous. Events that already exist are skipped. + # Use this method for backfilling historical user events. + # + # `Operation.response` is of type `ImportResponse`. Note that it is + # possible for a subset of the items to be successfully inserted. + # `Operation.metadata` is of type `ImportMetadata`. + rpc :ImportUserEvents, ::Google::Cloud::Retail::V2::ImportUserEventsRequest, ::Google::Longrunning::Operation + # Starts a user-event rejoin operation with latest product catalog. Events + # are not annotated with detailed product information for products that are + # missing from the catalog when the user event is ingested. These + # events are stored as unjoined events with limited usage on training and + # serving. You can use this method to start a join operation on specified + # events with the latest version of product catalog. You can also use this + # method to correct events joined with the wrong product catalog. A rejoin + # operation can take hours or days to complete. + rpc :RejoinUserEvents, ::Google::Cloud::Retail::V2::RejoinUserEventsRequest, ::Google::Longrunning::Operation + end + + Stub = Service.rpc_stub_class + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-retail-v2/lib/google/cloud/retail/v2/version.rb b/owl-bot-staging/google-cloud-retail-v2/lib/google/cloud/retail/v2/version.rb new file mode 100644 index 000000000000..ea00c998505d --- /dev/null +++ b/owl-bot-staging/google-cloud-retail-v2/lib/google/cloud/retail/v2/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 Retail + module V2 + VERSION = "0.0.1" + end + end + end +end diff --git a/owl-bot-staging/google-cloud-retail-v2/proto_docs/README.md b/owl-bot-staging/google-cloud-retail-v2/proto_docs/README.md new file mode 100644 index 000000000000..339fa1264598 --- /dev/null +++ b/owl-bot-staging/google-cloud-retail-v2/proto_docs/README.md @@ -0,0 +1,4 @@ +# Retail V2 Protocol Buffer Documentation + +These files are for the YARD documentation of the generated protobuf files. +They are not intended to be required or loaded at runtime. diff --git a/owl-bot-staging/google-cloud-retail-v2/proto_docs/google/api/client.rb b/owl-bot-staging/google-cloud-retail-v2/proto_docs/google/api/client.rb new file mode 100644 index 000000000000..5089551e9ea4 --- /dev/null +++ b/owl-bot-staging/google-cloud-retail-v2/proto_docs/google/api/client.rb @@ -0,0 +1,589 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + + +module Google + module Api + # Required information for every language. + # @!attribute [rw] reference_docs_uri + # @deprecated This field is deprecated and may be removed in the next major version update. + # @return [::String] + # Link to automatically generated reference documentation. Example: + # https://cloud.google.com/nodejs/docs/reference/asset/latest + # @!attribute [rw] destinations + # @return [::Array<::Google::Api::ClientLibraryDestination>] + # The destination where API teams want this client library to be published. + # @!attribute [rw] selective_gapic_generation + # @return [::Google::Api::SelectiveGapicGeneration] + # Configuration for which RPCs should be generated in the GAPIC client. + class CommonLanguageSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Details about how and where to publish client libraries. + # @!attribute [rw] version + # @return [::String] + # Version of the API to apply these settings to. This is the full protobuf + # package for the API, ending in the version element. + # Examples: "google.cloud.speech.v1" and "google.spanner.admin.database.v1". + # @!attribute [rw] launch_stage + # @return [::Google::Api::LaunchStage] + # Launch stage of this version of the API. + # @!attribute [rw] rest_numeric_enums + # @return [::Boolean] + # When using transport=rest, the client request will encode enums as + # numbers rather than strings. + # @!attribute [rw] java_settings + # @return [::Google::Api::JavaSettings] + # Settings for legacy Java features, supported in the Service YAML. + # @!attribute [rw] cpp_settings + # @return [::Google::Api::CppSettings] + # Settings for C++ client libraries. + # @!attribute [rw] php_settings + # @return [::Google::Api::PhpSettings] + # Settings for PHP client libraries. + # @!attribute [rw] python_settings + # @return [::Google::Api::PythonSettings] + # Settings for Python client libraries. + # @!attribute [rw] node_settings + # @return [::Google::Api::NodeSettings] + # Settings for Node client libraries. + # @!attribute [rw] dotnet_settings + # @return [::Google::Api::DotnetSettings] + # Settings for .NET client libraries. + # @!attribute [rw] ruby_settings + # @return [::Google::Api::RubySettings] + # Settings for Ruby client libraries. + # @!attribute [rw] go_settings + # @return [::Google::Api::GoSettings] + # Settings for Go client libraries. + class ClientLibrarySettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # This message configures the settings for publishing [Google Cloud Client + # libraries](https://cloud.google.com/apis/docs/cloud-client-libraries) + # generated from the service config. + # @!attribute [rw] method_settings + # @return [::Array<::Google::Api::MethodSettings>] + # A list of API method settings, e.g. the behavior for methods that use the + # long-running operation pattern. + # @!attribute [rw] new_issue_uri + # @return [::String] + # Link to a *public* URI where users can report issues. Example: + # https://issuetracker.google.com/issues/new?component=190865&template=1161103 + # @!attribute [rw] documentation_uri + # @return [::String] + # Link to product home page. Example: + # https://cloud.google.com/asset-inventory/docs/overview + # @!attribute [rw] api_short_name + # @return [::String] + # Used as a tracking tag when collecting data about the APIs developer + # relations artifacts like docs, packages delivered to package managers, + # etc. Example: "speech". + # @!attribute [rw] github_label + # @return [::String] + # GitHub label to apply to issues and pull requests opened for this API. + # @!attribute [rw] codeowner_github_teams + # @return [::Array<::String>] + # GitHub teams to be added to CODEOWNERS in the directory in GitHub + # containing source code for the client libraries for this API. + # @!attribute [rw] doc_tag_prefix + # @return [::String] + # A prefix used in sample code when demarking regions to be included in + # documentation. + # @!attribute [rw] organization + # @return [::Google::Api::ClientLibraryOrganization] + # For whom the client library is being published. + # @!attribute [rw] library_settings + # @return [::Array<::Google::Api::ClientLibrarySettings>] + # Client library settings. If the same version string appears multiple + # times in this list, then the last one wins. Settings from earlier + # settings with the same version string are discarded. + # @!attribute [rw] proto_reference_documentation_uri + # @return [::String] + # Optional link to proto reference documentation. Example: + # https://cloud.google.com/pubsub/lite/docs/reference/rpc + # @!attribute [rw] rest_reference_documentation_uri + # @return [::String] + # Optional link to REST reference documentation. Example: + # https://cloud.google.com/pubsub/lite/docs/reference/rest + class Publishing + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Settings for Java client libraries. + # @!attribute [rw] library_package + # @return [::String] + # The package name to use in Java. Clobbers the java_package option + # set in the protobuf. This should be used **only** by APIs + # who have already set the language_settings.java.package_name" field + # in gapic.yaml. API teams should use the protobuf java_package option + # where possible. + # + # Example of a YAML configuration:: + # + # publishing: + # 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. + # @!attribute [rw] methods + # @return [::Array<::String>] + # An allowlist of the fully qualified names of RPCs that should be included + # on public client surfaces. + # @!attribute [rw] generate_omitted_as_internal + # @return [::Boolean] + # Setting this to true indicates to the client generators that methods + # that would be excluded from the generation should instead be generated + # in a way that indicates these methods should not be consumed by + # end users. How this is expressed is up to individual language + # implementations to decide. Some examples may be: added annotations, + # obfuscated identifiers, or other language idiomatic patterns. + class SelectiveGapicGeneration + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # `BatchingConfigProto` defines the batching configuration for an API method. + # @!attribute [rw] thresholds + # @return [::Google::Api::BatchingSettingsProto] + # The thresholds which trigger a batched request to be sent. + # @!attribute [rw] batch_descriptor + # @return [::Google::Api::BatchingDescriptorProto] + # The request and response fields used in batching. + class BatchingConfigProto + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # `BatchingSettingsProto` specifies a set of batching thresholds, each of + # which acts as a trigger to send a batch of messages as a request. At least + # one threshold must be positive nonzero. + # @!attribute [rw] element_count_threshold + # @return [::Integer] + # The number of elements of a field collected into a batch which, if + # exceeded, causes the batch to be sent. + # @!attribute [rw] request_byte_threshold + # @return [::Integer] + # The aggregated size of the batched field which, if exceeded, causes the + # batch to be sent. This size is computed by aggregating the sizes of the + # request field to be batched, not of the entire request message. + # @!attribute [rw] delay_threshold + # @return [::Google::Protobuf::Duration] + # The duration after which a batch should be sent, starting from the addition + # of the first message to that batch. + # @!attribute [rw] element_count_limit + # @return [::Integer] + # The maximum number of elements collected in a batch that could be accepted + # by server. + # @!attribute [rw] request_byte_limit + # @return [::Integer] + # The maximum size of the request that could be accepted by server. + # @!attribute [rw] flow_control_element_limit + # @return [::Integer] + # The maximum number of elements allowed by flow control. + # @!attribute [rw] flow_control_byte_limit + # @return [::Integer] + # The maximum size of data allowed by flow control. + # @!attribute [rw] flow_control_limit_exceeded_behavior + # @return [::Google::Api::FlowControlLimitExceededBehaviorProto] + # The behavior to take when the flow control limit is exceeded. + class BatchingSettingsProto + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # `BatchingDescriptorProto` specifies the fields of the request message to be + # used for batching, and, optionally, the fields of the response message to be + # used for demultiplexing. + # @!attribute [rw] batched_field + # @return [::String] + # The repeated field in the request message to be aggregated by batching. + # @!attribute [rw] discriminator_fields + # @return [::Array<::String>] + # A list of the fields in the request message. Two requests will be batched + # together only if the values of every field specified in + # `request_discriminator_fields` is equal between the two requests. + # @!attribute [rw] subresponse_field + # @return [::String] + # Optional. When present, indicates the field in the response message to be + # used to demultiplex the response into multiple response messages, in + # correspondence with the multiple request messages originally batched + # together. + class BatchingDescriptorProto + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # The organization for which the client libraries are being published. + # Affects the url where generated docs are published, etc. + module ClientLibraryOrganization + # Not useful. + CLIENT_LIBRARY_ORGANIZATION_UNSPECIFIED = 0 + + # Google Cloud Platform Org. + CLOUD = 1 + + # Ads (Advertising) Org. + ADS = 2 + + # Photos Org. + PHOTOS = 3 + + # Street View Org. + STREET_VIEW = 4 + + # Shopping Org. + SHOPPING = 5 + + # Geo Org. + GEO = 6 + + # Generative AI - https://developers.generativeai.google + GENERATIVE_AI = 7 + end + + # To where should client libraries be published? + module ClientLibraryDestination + # Client libraries will neither be generated nor published to package + # managers. + CLIENT_LIBRARY_DESTINATION_UNSPECIFIED = 0 + + # Generate the client library in a repo under github.com/googleapis, + # but don't publish it to package managers. + GITHUB = 10 + + # Publish the library to package managers like nuget.org and npmjs.com. + PACKAGE_MANAGER = 20 + end + + # The behavior to take when the flow control limit is exceeded. + module FlowControlLimitExceededBehaviorProto + # Default behavior, system-defined. + UNSET_BEHAVIOR = 0 + + # Stop operation, raise error. + THROW_EXCEPTION = 1 + + # Pause operation until limit clears. + BLOCK = 2 + + # Continue operation, disregard limit. + IGNORE = 3 + end + end +end diff --git a/owl-bot-staging/google-cloud-retail-v2/proto_docs/google/api/field_behavior.rb b/owl-bot-staging/google-cloud-retail-v2/proto_docs/google/api/field_behavior.rb new file mode 100644 index 000000000000..582be187d115 --- /dev/null +++ b/owl-bot-staging/google-cloud-retail-v2/proto_docs/google/api/field_behavior.rb @@ -0,0 +1,85 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + + +module Google + module Api + # An indicator of the behavior of a given field (for example, that a field + # is required in requests, or given as output but ignored as input). + # This **does not** change the behavior in protocol buffers itself; it only + # denotes the behavior and may affect how API tooling handles the field. + # + # Note: This enum **may** receive new values in the future. + module FieldBehavior + # Conventional default for enums. Do not use this. + FIELD_BEHAVIOR_UNSPECIFIED = 0 + + # Specifically denotes a field as optional. + # While all fields in protocol buffers are optional, this may be specified + # for emphasis if appropriate. + OPTIONAL = 1 + + # Denotes a field as required. + # This indicates that the field **must** be provided as part of the request, + # and failure to do so will cause an error (usually `INVALID_ARGUMENT`). + REQUIRED = 2 + + # Denotes a field as output only. + # This indicates that the field is provided in responses, but including the + # field in a request does nothing (the server *must* ignore it and + # *must not* throw an error as a result of the field's presence). + OUTPUT_ONLY = 3 + + # Denotes a field as input only. + # This indicates that the field is provided in requests, and the + # corresponding field is not included in output. + INPUT_ONLY = 4 + + # Denotes a field as immutable. + # This indicates that the field may be set once in a request to create a + # resource, but may not be changed thereafter. + IMMUTABLE = 5 + + # Denotes that a (repeated) field is an unordered list. + # This indicates that the service may provide the elements of the list + # in any arbitrary order, rather than the order the user originally + # provided. Additionally, the list's order may or may not be stable. + UNORDERED_LIST = 6 + + # Denotes that this field returns a non-empty default value if not set. + # This indicates that if the user provides the empty value in a request, + # a non-empty value will be returned. The user will not be aware of what + # non-empty value to expect. + NON_EMPTY_DEFAULT = 7 + + # Denotes that the field in a resource (a message annotated with + # google.api.resource) is used in the resource name to uniquely identify the + # resource. For AIP-compliant APIs, this should only be applied to the + # `name` field on the resource. + # + # This behavior should not be applied to references to other resources within + # the message. + # + # The identifier field of resources often have different field behavior + # depending on the request it is embedded in (e.g. for Create methods name + # is optional and unused, while for Update methods it is required). Instead + # of method-specific annotations, only `IDENTIFIER` is required. + IDENTIFIER = 8 + end + end +end diff --git a/owl-bot-staging/google-cloud-retail-v2/proto_docs/google/api/httpbody.rb b/owl-bot-staging/google-cloud-retail-v2/proto_docs/google/api/httpbody.rb new file mode 100644 index 000000000000..938f7ac6b2fd --- /dev/null +++ b/owl-bot-staging/google-cloud-retail-v2/proto_docs/google/api/httpbody.rb @@ -0,0 +1,80 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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 + # Message that represents an arbitrary HTTP body. It should only be used for + # payload formats that can't be represented as JSON, such as raw binary or + # an HTML page. + # + # + # This message can be used both in streaming and non-streaming API methods in + # the request as well as the response. + # + # It can be used as a top-level request field, which is convenient if one + # wants to extract parameters from either the URL or HTTP template into the + # request fields and also want access to the raw HTTP body. + # + # Example: + # + # message GetResourceRequest { + # // A unique request id. + # string request_id = 1; + # + # // The raw HTTP body is bound to this field. + # google.api.HttpBody http_body = 2; + # + # } + # + # service ResourceService { + # rpc GetResource(GetResourceRequest) + # returns (google.api.HttpBody); + # rpc UpdateResource(google.api.HttpBody) + # returns (google.protobuf.Empty); + # + # } + # + # Example with streaming methods: + # + # service CaldavService { + # rpc GetCalendar(stream google.api.HttpBody) + # returns (stream google.api.HttpBody); + # rpc UpdateCalendar(stream google.api.HttpBody) + # returns (stream google.api.HttpBody); + # + # } + # + # Use of this type only changes how the request and response bodies are + # handled, all other features will continue to work unchanged. + # @!attribute [rw] content_type + # @return [::String] + # The HTTP Content-Type header value specifying the content type of the body. + # @!attribute [rw] data + # @return [::String] + # The HTTP request/response body as raw binary. + # @!attribute [rw] extensions + # @return [::Array<::Google::Protobuf::Any>] + # Application specific response metadata. Must be set in the first response + # for streaming APIs. + class HttpBody + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end +end diff --git a/owl-bot-staging/google-cloud-retail-v2/proto_docs/google/api/launch_stage.rb b/owl-bot-staging/google-cloud-retail-v2/proto_docs/google/api/launch_stage.rb new file mode 100644 index 000000000000..9392a413fb1b --- /dev/null +++ b/owl-bot-staging/google-cloud-retail-v2/proto_docs/google/api/launch_stage.rb @@ -0,0 +1,71 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + + +module Google + module Api + # The launch stage as defined by [Google Cloud Platform + # Launch Stages](https://cloud.google.com/terms/launch-stages). + module LaunchStage + # Do not use this default value. + LAUNCH_STAGE_UNSPECIFIED = 0 + + # The feature is not yet implemented. Users can not use it. + UNIMPLEMENTED = 6 + + # Prelaunch features are hidden from users and are only visible internally. + PRELAUNCH = 7 + + # Early Access features are limited to a closed group of testers. To use + # these features, you must sign up in advance and sign a Trusted Tester + # agreement (which includes confidentiality provisions). These features may + # be unstable, changed in backward-incompatible ways, and are not + # guaranteed to be released. + EARLY_ACCESS = 1 + + # Alpha is a limited availability test for releases before they are cleared + # for widespread use. By Alpha, all significant design issues are resolved + # and we are in the process of verifying functionality. Alpha customers + # need to apply for access, agree to applicable terms, and have their + # projects allowlisted. Alpha releases don't have to be feature complete, + # no SLAs are provided, and there are no technical support obligations, but + # they will be far enough along that customers can actually use them in + # test environments or for limited-use tests -- just like they would in + # normal production cases. + ALPHA = 2 + + # Beta is the point at which we are ready to open a release for any + # customer to use. There are no SLA or technical support obligations in a + # Beta release. Products will be complete from a feature perspective, but + # may have some open outstanding issues. Beta releases are suitable for + # limited production use cases. + BETA = 3 + + # GA features are open to all developers and are considered stable and + # fully qualified for production use. + GA = 4 + + # Deprecated features are scheduled to be shut down and removed. For more + # information, see the "Deprecation Policy" section of our [Terms of + # Service](https://cloud.google.com/terms/) + # and the [Google Cloud Platform Subject to the Deprecation + # Policy](https://cloud.google.com/terms/deprecation) documentation. + DEPRECATED = 5 + end + end +end diff --git a/owl-bot-staging/google-cloud-retail-v2/proto_docs/google/api/resource.rb b/owl-bot-staging/google-cloud-retail-v2/proto_docs/google/api/resource.rb new file mode 100644 index 000000000000..25dec4847ac1 --- /dev/null +++ b/owl-bot-staging/google-cloud-retail-v2/proto_docs/google/api/resource.rb @@ -0,0 +1,227 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + + +module Google + module Api + # A simple descriptor of a resource type. + # + # ResourceDescriptor annotates a resource message (either by means of a + # protobuf annotation or use in the service config), and associates the + # resource's schema, the resource type, and the pattern of the resource name. + # + # Example: + # + # message Topic { + # // Indicates this message defines a resource schema. + # // Declares the resource type in the format of {service}/{kind}. + # // For Kubernetes resources, the format is {api group}/{kind}. + # option (google.api.resource) = { + # type: "pubsub.googleapis.com/Topic" + # pattern: "projects/{project}/topics/{topic}" + # }; + # } + # + # The ResourceDescriptor Yaml config will look like: + # + # resources: + # - type: "pubsub.googleapis.com/Topic" + # pattern: "projects/{project}/topics/{topic}" + # + # Sometimes, resources have multiple patterns, typically because they can + # live under multiple parents. + # + # Example: + # + # message LogEntry { + # option (google.api.resource) = { + # type: "logging.googleapis.com/LogEntry" + # pattern: "projects/{project}/logs/{log}" + # pattern: "folders/{folder}/logs/{log}" + # pattern: "organizations/{organization}/logs/{log}" + # pattern: "billingAccounts/{billing_account}/logs/{log}" + # }; + # } + # + # The ResourceDescriptor Yaml config will look like: + # + # resources: + # - type: 'logging.googleapis.com/LogEntry' + # pattern: "projects/{project}/logs/{log}" + # pattern: "folders/{folder}/logs/{log}" + # pattern: "organizations/{organization}/logs/{log}" + # pattern: "billingAccounts/{billing_account}/logs/{log}" + # @!attribute [rw] type + # @return [::String] + # The resource type. It must be in the format of + # \\{service_name}/\\{resource_type_kind}. The `resource_type_kind` must be + # singular and must not include version numbers. + # + # Example: `storage.googleapis.com/Bucket` + # + # The value of the resource_type_kind must follow the regular expression + # /[A-Za-z][a-zA-Z0-9]+/. It should start with an upper case character and + # should use PascalCase (UpperCamelCase). The maximum number of + # characters allowed for the `resource_type_kind` is 100. + # @!attribute [rw] pattern + # @return [::Array<::String>] + # Optional. The relative resource name pattern associated with this resource + # type. The DNS prefix of the full resource name shouldn't be specified here. + # + # The path pattern must follow the syntax, which aligns with HTTP binding + # syntax: + # + # Template = Segment { "/" Segment } ; + # Segment = LITERAL | Variable ; + # Variable = "{" LITERAL "}" ; + # + # Examples: + # + # - "projects/\\{project}/topics/\\{topic}" + # - "projects/\\{project}/knowledgeBases/\\{knowledge_base}" + # + # The components in braces correspond to the IDs for each resource in the + # hierarchy. It is expected that, if multiple patterns are provided, + # the same component name (e.g. "project") refers to IDs of the same + # type of resource. + # @!attribute [rw] name_field + # @return [::String] + # Optional. The field on the resource that designates the resource name + # field. If omitted, this is assumed to be "name". + # @!attribute [rw] history + # @return [::Google::Api::ResourceDescriptor::History] + # Optional. The historical or future-looking state of the resource pattern. + # + # Example: + # + # // The InspectTemplate message originally only supported resource + # // names with organization, and project was added later. + # message InspectTemplate { + # option (google.api.resource) = { + # type: "dlp.googleapis.com/InspectTemplate" + # pattern: + # "organizations/{organization}/inspectTemplates/{inspect_template}" + # pattern: "projects/{project}/inspectTemplates/{inspect_template}" + # history: ORIGINALLY_SINGLE_PATTERN + # }; + # } + # @!attribute [rw] plural + # @return [::String] + # The plural name used in the resource name and permission names, such as + # 'projects' for the resource name of 'projects/\\{project}' and the permission + # name of 'cloudresourcemanager.googleapis.com/projects.get'. One exception + # to this is for Nested Collections that have stuttering names, as defined + # in [AIP-122](https://google.aip.dev/122#nested-collections), where the + # collection ID in the resource name pattern does not necessarily directly + # match the `plural` value. + # + # It is the same concept of the `plural` field in k8s CRD spec + # https://kubernetes.io/docs/tasks/access-kubernetes-api/custom-resources/custom-resource-definitions/ + # + # Note: The plural form is required even for singleton resources. See + # https://aip.dev/156 + # @!attribute [rw] singular + # @return [::String] + # The same concept of the `singular` field in k8s CRD spec + # https://kubernetes.io/docs/tasks/access-kubernetes-api/custom-resources/custom-resource-definitions/ + # Such as "project" for the `resourcemanager.googleapis.com/Project` type. + # @!attribute [rw] style + # @return [::Array<::Google::Api::ResourceDescriptor::Style>] + # Style flag(s) for this resource. + # These indicate that a resource is expected to conform to a given + # style. See the specific style flags for additional information. + class ResourceDescriptor + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # A description of the historical or future-looking state of the + # resource pattern. + module History + # The "unset" value. + HISTORY_UNSPECIFIED = 0 + + # The resource originally had one pattern and launched as such, and + # additional patterns were added later. + ORIGINALLY_SINGLE_PATTERN = 1 + + # The resource has one pattern, but the API owner expects to add more + # later. (This is the inverse of ORIGINALLY_SINGLE_PATTERN, and prevents + # that from being necessary once there are multiple patterns.) + FUTURE_MULTI_PATTERN = 2 + end + + # A flag representing a specific style that a resource claims to conform to. + module Style + # The unspecified value. Do not use. + STYLE_UNSPECIFIED = 0 + + # This resource is intended to be "declarative-friendly". + # + # Declarative-friendly resources must be more strictly consistent, and + # setting this to true communicates to tools that this resource should + # adhere to declarative-friendly expectations. + # + # Note: This is used by the API linter (linter.aip.dev) to enable + # additional checks. + DECLARATIVE_FRIENDLY = 1 + end + end + + # Defines a proto annotation that describes a string field that refers to + # an API resource. + # @!attribute [rw] type + # @return [::String] + # The resource type that the annotated field references. + # + # Example: + # + # message Subscription { + # string topic = 2 [(google.api.resource_reference) = { + # type: "pubsub.googleapis.com/Topic" + # }]; + # } + # + # Occasionally, a field may reference an arbitrary resource. In this case, + # APIs use the special value * in their resource reference. + # + # Example: + # + # message GetIamPolicyRequest { + # string resource = 2 [(google.api.resource_reference) = { + # type: "*" + # }]; + # } + # @!attribute [rw] child_type + # @return [::String] + # The resource type of a child collection that the annotated field + # references. This is useful for annotating the `parent` field that + # doesn't have a fixed resource type. + # + # Example: + # + # message ListLogEntriesRequest { + # string parent = 1 [(google.api.resource_reference) = { + # child_type: "logging.googleapis.com/LogEntry" + # }; + # } + class ResourceReference + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end +end diff --git a/owl-bot-staging/google-cloud-retail-v2/proto_docs/google/cloud/retail/v2/catalog.rb b/owl-bot-staging/google-cloud-retail-v2/proto_docs/google/cloud/retail/v2/catalog.rb new file mode 100644 index 000000000000..40edde6ddced --- /dev/null +++ b/owl-bot-staging/google-cloud-retail-v2/proto_docs/google/cloud/retail/v2/catalog.rb @@ -0,0 +1,516 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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 Retail + module V2 + # Configures what level the product should be uploaded with regards to + # how users will be send events and how predictions will be made. + # @!attribute [rw] ingestion_product_type + # @return [::String] + # The type of {::Google::Cloud::Retail::V2::Product Product}s allowed to be + # ingested into the catalog. Acceptable values are: + # + # * `primary` (default): You can ingest + # {::Google::Cloud::Retail::V2::Product Product}s of all types. When + # ingesting a {::Google::Cloud::Retail::V2::Product Product}, its type will + # default to + # {::Google::Cloud::Retail::V2::Product::Type::PRIMARY Product.Type.PRIMARY} if + # unset. + # * `variant` (incompatible with Retail Search): You can only + # ingest + # {::Google::Cloud::Retail::V2::Product::Type::VARIANT Product.Type.VARIANT} + # {::Google::Cloud::Retail::V2::Product Product}s. This means + # {::Google::Cloud::Retail::V2::Product#primary_product_id Product.primary_product_id} + # cannot be empty. + # + # If this field is set to an invalid value other than these, an + # INVALID_ARGUMENT error is returned. + # + # If this field is `variant` and + # {::Google::Cloud::Retail::V2::ProductLevelConfig#merchant_center_product_id_field merchant_center_product_id_field} + # is `itemGroupId`, an INVALID_ARGUMENT error is returned. + # + # See [Product + # levels](https://cloud.google.com/retail/docs/catalog#product-levels) + # for more details. + # @!attribute [rw] merchant_center_product_id_field + # @return [::String] + # Which field of [Merchant Center + # Product](/bigquery-transfer/docs/merchant-center-products-schema) should be + # imported as {::Google::Cloud::Retail::V2::Product#id Product.id}. Acceptable + # values are: + # + # * `offerId` (default): Import `offerId` as the product ID. + # * `itemGroupId`: Import `itemGroupId` as the product ID. Notice that Retail + # API will choose one item from the ones with the same `itemGroupId`, and + # use it to represent the item group. + # + # If this field is set to an invalid value other than these, an + # INVALID_ARGUMENT error is returned. + # + # If this field is `itemGroupId` and + # {::Google::Cloud::Retail::V2::ProductLevelConfig#ingestion_product_type ingestion_product_type} + # is `variant`, an INVALID_ARGUMENT error is returned. + # + # See [Product + # levels](https://cloud.google.com/retail/docs/catalog#product-levels) + # for more details. + class ProductLevelConfig + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Catalog level attribute config for an attribute. For example, if customers + # want to enable/disable facet for a specific attribute. + # @!attribute [rw] key + # @return [::String] + # Required. Attribute name. + # For example: `color`, `brands`, `attributes.custom_attribute`, such as + # `attributes.xyz`. + # To be indexable, the attribute name can contain only alpha-numeric + # characters and underscores. For example, an attribute named + # `attributes.abc_xyz` can be indexed, but an attribute named + # `attributes.abc-xyz` cannot be indexed. + # + # If the attribute key starts with `attributes.`, then the attribute is a + # custom attribute. Attributes such as `brands`, `patterns`, and `title` are + # built-in and called system attributes. + # @!attribute [r] in_use + # @return [::Boolean] + # Output only. Indicates whether this attribute has been used by any + # products. `True` if at least one {::Google::Cloud::Retail::V2::Product Product} + # is using this attribute in + # {::Google::Cloud::Retail::V2::Product#attributes Product.attributes}. Otherwise, + # this field is `False`. + # + # {::Google::Cloud::Retail::V2::CatalogAttribute CatalogAttribute} can be + # pre-loaded by using + # {::Google::Cloud::Retail::V2::CatalogService::Client#add_catalog_attribute CatalogService.AddCatalogAttribute} + # or + # {::Google::Cloud::Retail::V2::CatalogService::Client#update_attributes_config CatalogService.UpdateAttributesConfig} + # APIs. This field is `False` for pre-loaded + # {::Google::Cloud::Retail::V2::CatalogAttribute CatalogAttribute}s. + # + # Only pre-loaded [catalog + # attributes][google.cloud.retail.v2.CatalogAttribute] that are neither in + # use by products nor predefined can be deleted. [Catalog + # attributes][google.cloud.retail.v2.CatalogAttribute] that are + # either in use by products or are predefined attributes cannot be deleted; + # however, their configuration properties will reset to default values upon + # removal request. + # + # After catalog changes, it takes about 10 minutes for this field to update. + # @!attribute [r] type + # @return [::Google::Cloud::Retail::V2::CatalogAttribute::AttributeType] + # Output only. The type of this attribute. This is derived from the attribute + # in {::Google::Cloud::Retail::V2::Product#attributes Product.attributes}. + # @!attribute [rw] indexable_option + # @return [::Google::Cloud::Retail::V2::CatalogAttribute::IndexableOption] + # When + # {::Google::Cloud::Retail::V2::AttributesConfig#attribute_config_level AttributesConfig.attribute_config_level} + # is CATALOG_LEVEL_ATTRIBUTE_CONFIG, if INDEXABLE_ENABLED attribute values + # are indexed so that it can be filtered, faceted, or boosted in + # {::Google::Cloud::Retail::V2::SearchService::Client#search SearchService.Search}. + # + # Must be specified when + # {::Google::Cloud::Retail::V2::AttributesConfig#attribute_config_level AttributesConfig.attribute_config_level} + # is CATALOG_LEVEL_ATTRIBUTE_CONFIG, otherwise throws INVALID_FORMAT error. + # @!attribute [rw] dynamic_facetable_option + # @return [::Google::Cloud::Retail::V2::CatalogAttribute::DynamicFacetableOption] + # If DYNAMIC_FACETABLE_ENABLED, attribute values are available for dynamic + # facet. Could only be DYNAMIC_FACETABLE_DISABLED if + # {::Google::Cloud::Retail::V2::CatalogAttribute#indexable_option CatalogAttribute.indexable_option} + # is INDEXABLE_DISABLED. Otherwise, an INVALID_ARGUMENT error is returned. + # + # Must be specified, otherwise throws INVALID_FORMAT error. + # @!attribute [rw] searchable_option + # @return [::Google::Cloud::Retail::V2::CatalogAttribute::SearchableOption] + # When + # {::Google::Cloud::Retail::V2::AttributesConfig#attribute_config_level AttributesConfig.attribute_config_level} + # is CATALOG_LEVEL_ATTRIBUTE_CONFIG, if SEARCHABLE_ENABLED, attribute values + # are searchable by text queries in + # {::Google::Cloud::Retail::V2::SearchService::Client#search SearchService.Search}. + # + # If SEARCHABLE_ENABLED but attribute type is numerical, attribute values + # will not be searchable by text queries in + # {::Google::Cloud::Retail::V2::SearchService::Client#search SearchService.Search}, as + # there are no text values associated to numerical attributes. + # + # Must be specified, when + # {::Google::Cloud::Retail::V2::AttributesConfig#attribute_config_level AttributesConfig.attribute_config_level} + # is CATALOG_LEVEL_ATTRIBUTE_CONFIG, otherwise throws INVALID_FORMAT error. + # @!attribute [rw] exact_searchable_option + # @return [::Google::Cloud::Retail::V2::CatalogAttribute::ExactSearchableOption] + # If EXACT_SEARCHABLE_ENABLED, attribute values will be exact searchable. + # This property only applies to textual custom attributes and requires + # indexable set to enabled to enable exact-searchable. If unset, the server + # behavior defaults to + # {::Google::Cloud::Retail::V2::CatalogAttribute::ExactSearchableOption::EXACT_SEARCHABLE_DISABLED EXACT_SEARCHABLE_DISABLED}. + # @!attribute [rw] retrievable_option + # @return [::Google::Cloud::Retail::V2::CatalogAttribute::RetrievableOption] + # If RETRIEVABLE_ENABLED, attribute values are retrievable in the search + # results. If unset, the server behavior defaults to + # {::Google::Cloud::Retail::V2::CatalogAttribute::RetrievableOption::RETRIEVABLE_DISABLED RETRIEVABLE_DISABLED}. + # @!attribute [rw] facet_config + # @return [::Google::Cloud::Retail::V2::CatalogAttribute::FacetConfig] + # Contains facet options. + class CatalogAttribute + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # Possible options for the facet that corresponds to the current attribute + # config. + # @!attribute [rw] facet_intervals + # @return [::Array<::Google::Cloud::Retail::V2::Interval>] + # If you don't set the facet + # {::Google::Cloud::Retail::V2::SearchRequest::FacetSpec::FacetKey#intervals SearchRequest.FacetSpec.FacetKey.intervals} + # in the request to a numerical attribute, then we use the computed + # intervals with rounded bounds obtained from all its product numerical + # attribute values. The computed intervals might not be ideal for some + # attributes. Therefore, we give you the option to overwrite them with the + # facet_intervals field. The maximum of facet intervals per + # {::Google::Cloud::Retail::V2::CatalogAttribute CatalogAttribute} is 40. Each + # interval must have a lower bound or an upper bound. If both bounds are + # provided, then the lower bound must be smaller or equal than the upper + # bound. + # @!attribute [rw] ignored_facet_values + # @return [::Array<::Google::Cloud::Retail::V2::CatalogAttribute::FacetConfig::IgnoredFacetValues>] + # Each instance represents a list of attribute values to ignore as facet + # values for a specific time range. The maximum number of instances per + # {::Google::Cloud::Retail::V2::CatalogAttribute CatalogAttribute} is 25. + # @!attribute [rw] merged_facet_values + # @return [::Array<::Google::Cloud::Retail::V2::CatalogAttribute::FacetConfig::MergedFacetValue>] + # Each instance replaces a list of facet values by a merged facet + # value. If a facet value is not in any list, then it will stay the same. + # To avoid conflicts, only paths of length 1 are accepted. In other words, + # if "dark_blue" merged into "BLUE", then the latter can't merge into + # "blues" because this would create a path of length 2. The maximum number + # of instances of MergedFacetValue per + # {::Google::Cloud::Retail::V2::CatalogAttribute CatalogAttribute} is 100. This + # feature is available only for textual custom attributes. + # @!attribute [rw] merged_facet + # @return [::Google::Cloud::Retail::V2::CatalogAttribute::FacetConfig::MergedFacet] + # Use this field only if you want to merge a facet key into another facet + # key. + # @!attribute [rw] rerank_config + # @return [::Google::Cloud::Retail::V2::CatalogAttribute::FacetConfig::RerankConfig] + # Set this field only if you want to rerank based on facet values engaged + # by the user for the current key. This option is only possible for custom + # facetable textual keys. + class FacetConfig + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # {::Google::Cloud::Retail::V2::SearchResponse::Facet#values Facet values} to + # ignore on {::Google::Cloud::Retail::V2::SearchResponse::Facet facets} during + # the specified time range for the given + # {::Google::Cloud::Retail::V2::SearchResponse::Facet#key SearchResponse.Facet.key} + # attribute. + # @!attribute [rw] values + # @return [::Array<::String>] + # List of facet values to ignore for the following time range. The facet + # values are the same as the attribute values. There is a limit of 10 + # values per instance of IgnoredFacetValues. Each value can have at most + # 128 characters. + # @!attribute [rw] start_time + # @return [::Google::Protobuf::Timestamp] + # Time range for the current list of facet values to ignore. + # If multiple time ranges are specified for an facet value for the + # current attribute, consider all of them. If both are empty, ignore + # always. If start time and end time are set, then start time + # must be before end time. + # If start time is not empty and end time is empty, then will ignore + # these facet values after the start time. + # @!attribute [rw] end_time + # @return [::Google::Protobuf::Timestamp] + # If start time is empty and end time is not empty, then ignore these + # facet values before end time. + class IgnoredFacetValues + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Replaces a set of textual facet values by the same (possibly different) + # merged facet value. Each facet value should appear at most once as a + # value per {::Google::Cloud::Retail::V2::CatalogAttribute CatalogAttribute}. + # This feature is available only for textual custom attributes. + # @!attribute [rw] values + # @return [::Array<::String>] + # All the facet values that are replaces by the same + # {::Google::Cloud::Retail::V2::CatalogAttribute::FacetConfig::MergedFacetValue#merged_value merged_value} + # that follows. The maximum number of values per MergedFacetValue is 25. + # Each value can have up to 128 characters. + # @!attribute [rw] merged_value + # @return [::String] + # All the previous values are replaced by this merged facet value. + # This merged_value must be non-empty and can have up to 128 characters. + class MergedFacetValue + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # The current facet key (i.e. attribute config) maps into the + # {::Google::Cloud::Retail::V2::CatalogAttribute::FacetConfig::MergedFacet#merged_facet_key merged_facet_key}. + # A facet key can have at most one child. The current facet key and the + # merged facet key need both to be textual custom attributes or both + # numerical custom attributes (same type). + # @!attribute [rw] merged_facet_key + # @return [::String] + # The merged facet key should be a valid facet key that is different than + # the facet key of the current catalog attribute. We refer this is + # merged facet key as the child of the current catalog attribute. This + # merged facet key can't be a parent of another facet key (i.e. no + # directed path of length 2). This merged facet key needs to be either a + # textual custom attribute or a numerical custom attribute. + class MergedFacet + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Options to rerank based on facet values engaged by the user for the + # current key. That key needs to be a custom textual key and facetable. + # To use this control, you also need to pass all the facet keys engaged by + # the user in the request using the field [SearchRequest.FacetSpec]. In + # particular, if you don't pass the facet keys engaged that you want to + # rerank on, this control won't be effective. Moreover, to obtain better + # results, the facet values that you want to rerank on should be close to + # English (ideally made of words, underscores, and spaces). + # @!attribute [rw] rerank_facet + # @return [::Boolean] + # If set to true, then we also rerank the dynamic facets based on the + # facet values engaged by the user for the current attribute key during + # serving. + # @!attribute [rw] facet_values + # @return [::Array<::String>] + # If empty, rerank on all facet values for the current key. Otherwise, + # will rerank on the facet values from this list only. + class RerankConfig + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end + + # The type of an attribute. + module AttributeType + # The type of the attribute is unknown. + # + # Used when type cannot be derived from attribute that is not + # {::Google::Cloud::Retail::V2::CatalogAttribute#in_use in_use}. + UNKNOWN = 0 + + # Textual attribute. + TEXTUAL = 1 + + # Numerical attribute. + NUMERICAL = 2 + end + + # The status of the indexable option of a catalog attribute. + module IndexableOption + # Value used when unset. + INDEXABLE_OPTION_UNSPECIFIED = 0 + + # Indexable option enabled for an attribute. + INDEXABLE_ENABLED = 1 + + # Indexable option disabled for an attribute. + INDEXABLE_DISABLED = 2 + end + + # The status of the dynamic facetable option of a catalog attribute. + module DynamicFacetableOption + # Value used when unset. + DYNAMIC_FACETABLE_OPTION_UNSPECIFIED = 0 + + # Dynamic facetable option enabled for an attribute. + DYNAMIC_FACETABLE_ENABLED = 1 + + # Dynamic facetable option disabled for an attribute. + DYNAMIC_FACETABLE_DISABLED = 2 + end + + # The status of the searchable option of a catalog attribute. + module SearchableOption + # Value used when unset. + SEARCHABLE_OPTION_UNSPECIFIED = 0 + + # Searchable option enabled for an attribute. + SEARCHABLE_ENABLED = 1 + + # Searchable option disabled for an attribute. + SEARCHABLE_DISABLED = 2 + end + + # The status of the exact-searchable option of a catalog attribute. + module ExactSearchableOption + # Value used when unset. + EXACT_SEARCHABLE_OPTION_UNSPECIFIED = 0 + + # Exact searchable option enabled for an attribute. + EXACT_SEARCHABLE_ENABLED = 1 + + # Exact searchable option disabled for an attribute. + EXACT_SEARCHABLE_DISABLED = 2 + end + + # The status of the retrievable option of a catalog attribute. + module RetrievableOption + # Value used when unset. + RETRIEVABLE_OPTION_UNSPECIFIED = 0 + + # Retrievable option enabled for an attribute. + RETRIEVABLE_ENABLED = 1 + + # Retrievable option disabled for an attribute. + RETRIEVABLE_DISABLED = 2 + end + end + + # Catalog level attribute config. + # @!attribute [rw] name + # @return [::String] + # Required. Immutable. The fully qualified resource name of the attribute + # config. Format: `projects/*/locations/*/catalogs/*/attributesConfig` + # @!attribute [rw] catalog_attributes + # @return [::Google::Protobuf::Map{::String => ::Google::Cloud::Retail::V2::CatalogAttribute}] + # Enable attribute(s) config at catalog level. + # For example, indexable, dynamic_facetable, or searchable for each + # attribute. + # + # The key is catalog attribute's name. + # For example: `color`, `brands`, `attributes.custom_attribute`, such as + # `attributes.xyz`. + # + # The maximum number of catalog attributes allowed in a request is 1000. + # @!attribute [r] attribute_config_level + # @return [::Google::Cloud::Retail::V2::AttributeConfigLevel] + # Output only. The + # {::Google::Cloud::Retail::V2::AttributeConfigLevel AttributeConfigLevel} used + # for this catalog. + class AttributesConfig + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # @!attribute [rw] key + # @return [::String] + # @!attribute [rw] value + # @return [::Google::Cloud::Retail::V2::CatalogAttribute] + class CatalogAttributesEntry + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end + + # Catalog level autocomplete config for customers to customize autocomplete + # feature's settings. + # @!attribute [rw] name + # @return [::String] + # Required. Immutable. Fully qualified name + # `projects/*/locations/*/catalogs/*/completionConfig` + # @!attribute [rw] matching_order + # @return [::String] + # Specifies the matching order for autocomplete suggestions, e.g., a query + # consisting of 'sh' with 'out-of-order' specified would suggest "women's + # shoes", whereas a query of 'red s' with 'exact-prefix' specified would + # suggest "red shoes". Currently supported values: + # + # * 'out-of-order' + # * 'exact-prefix' + # + # Default value: 'exact-prefix'. + # @!attribute [rw] max_suggestions + # @return [::Integer] + # The maximum number of autocomplete suggestions returned per term. Default + # value is 20. If left unset or set to 0, then will fallback to default + # value. + # + # Value range is 1 to 20. + # @!attribute [rw] min_prefix_length + # @return [::Integer] + # The minimum number of characters needed to be typed in order to get + # suggestions. Default value is 2. If left unset or set to 0, then will + # fallback to default value. + # + # Value range is 1 to 20. + # @!attribute [rw] auto_learning + # @return [::Boolean] + # If set to true, the auto learning function is enabled. Auto learning uses + # user data to generate suggestions using ML techniques. Default value is + # false. Only after enabling auto learning can users use `cloud-retail` + # data in + # {::Google::Cloud::Retail::V2::CompleteQueryRequest CompleteQueryRequest}. + # @!attribute [r] suggestions_input_config + # @return [::Google::Cloud::Retail::V2::CompletionDataInputConfig] + # Output only. The source data for the latest import of the autocomplete + # suggestion phrases. + # @!attribute [r] last_suggestions_import_operation + # @return [::String] + # Output only. Name of the LRO corresponding to the latest suggestion terms + # list import. + # + # Can use GetOperation API + # method to retrieve the latest state of the Long Running Operation. + # @!attribute [r] denylist_input_config + # @return [::Google::Cloud::Retail::V2::CompletionDataInputConfig] + # Output only. The source data for the latest import of the autocomplete + # denylist phrases. + # @!attribute [r] last_denylist_import_operation + # @return [::String] + # Output only. Name of the LRO corresponding to the latest denylist import. + # + # Can use GetOperation API to + # retrieve the latest state of the Long Running Operation. + # @!attribute [r] allowlist_input_config + # @return [::Google::Cloud::Retail::V2::CompletionDataInputConfig] + # Output only. The source data for the latest import of the autocomplete + # allowlist phrases. + # @!attribute [r] last_allowlist_import_operation + # @return [::String] + # Output only. Name of the LRO corresponding to the latest allowlist import. + # + # Can use GetOperation API to + # retrieve the latest state of the Long Running Operation. + class CompletionConfig + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # The catalog configuration. + # @!attribute [rw] name + # @return [::String] + # Required. Immutable. The fully qualified resource name of the catalog. + # @!attribute [rw] display_name + # @return [::String] + # Required. Immutable. The catalog display name. + # + # This field must be a UTF-8 encoded string with a length limit of 128 + # characters. Otherwise, an INVALID_ARGUMENT error is returned. + # @!attribute [rw] product_level_config + # @return [::Google::Cloud::Retail::V2::ProductLevelConfig] + # Required. The product level configuration. + class Catalog + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-retail-v2/proto_docs/google/cloud/retail/v2/catalog_service.rb b/owl-bot-staging/google-cloud-retail-v2/proto_docs/google/cloud/retail/v2/catalog_service.rb new file mode 100644 index 000000000000..062dd48b9cbe --- /dev/null +++ b/owl-bot-staging/google-cloud-retail-v2/proto_docs/google/cloud/retail/v2/catalog_service.rb @@ -0,0 +1,297 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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 Retail + module V2 + # Request for + # {::Google::Cloud::Retail::V2::CatalogService::Client#list_catalogs CatalogService.ListCatalogs} + # method. + # @!attribute [rw] parent + # @return [::String] + # Required. The account resource name with an associated location. + # + # If the caller does not have permission to list + # {::Google::Cloud::Retail::V2::Catalog Catalog}s under this location, regardless + # of whether or not this location exists, a PERMISSION_DENIED error is + # returned. + # @!attribute [rw] page_size + # @return [::Integer] + # Maximum number of {::Google::Cloud::Retail::V2::Catalog Catalog}s to return. If + # unspecified, defaults to 50. The maximum allowed value is 1000. Values + # above 1000 will be coerced to 1000. + # + # If this field is negative, an INVALID_ARGUMENT is returned. + # @!attribute [rw] page_token + # @return [::String] + # A page token + # {::Google::Cloud::Retail::V2::ListCatalogsResponse#next_page_token ListCatalogsResponse.next_page_token}, + # received from a previous + # {::Google::Cloud::Retail::V2::CatalogService::Client#list_catalogs CatalogService.ListCatalogs} + # call. Provide this to retrieve the subsequent page. + # + # When paginating, all other parameters provided to + # {::Google::Cloud::Retail::V2::CatalogService::Client#list_catalogs CatalogService.ListCatalogs} + # must match the call that provided the page token. Otherwise, an + # INVALID_ARGUMENT error is returned. + class ListCatalogsRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Response for + # {::Google::Cloud::Retail::V2::CatalogService::Client#list_catalogs CatalogService.ListCatalogs} + # method. + # @!attribute [rw] catalogs + # @return [::Array<::Google::Cloud::Retail::V2::Catalog>] + # All the customer's {::Google::Cloud::Retail::V2::Catalog Catalog}s. + # @!attribute [rw] next_page_token + # @return [::String] + # A token that can be sent as + # {::Google::Cloud::Retail::V2::ListCatalogsRequest#page_token ListCatalogsRequest.page_token} + # to retrieve the next page. If this field is omitted, there are no + # subsequent pages. + class ListCatalogsResponse + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Request for + # {::Google::Cloud::Retail::V2::CatalogService::Client#update_catalog CatalogService.UpdateCatalog} + # method. + # @!attribute [rw] catalog + # @return [::Google::Cloud::Retail::V2::Catalog] + # Required. The {::Google::Cloud::Retail::V2::Catalog Catalog} to update. + # + # If the caller does not have permission to update the + # {::Google::Cloud::Retail::V2::Catalog Catalog}, regardless of whether or not it + # exists, a PERMISSION_DENIED error is returned. + # + # If the {::Google::Cloud::Retail::V2::Catalog Catalog} to update does not exist, + # a NOT_FOUND error is returned. + # @!attribute [rw] update_mask + # @return [::Google::Protobuf::FieldMask] + # Indicates which fields in the provided + # {::Google::Cloud::Retail::V2::Catalog Catalog} to update. + # + # If an unsupported or unknown field is provided, an INVALID_ARGUMENT error + # is returned. + class UpdateCatalogRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Request message to set a specified branch as new default_branch. + # @!attribute [rw] catalog + # @return [::String] + # Full resource name of the catalog, such as + # `projects/*/locations/global/catalogs/default_catalog`. + # @!attribute [rw] branch_id + # @return [::String] + # The final component of the resource name of a branch. + # + # This field must be one of "0", "1" or "2". Otherwise, an INVALID_ARGUMENT + # error is returned. + # + # If there are no sufficient active products in the targeted branch and + # {::Google::Cloud::Retail::V2::SetDefaultBranchRequest#force force} is not set, a + # FAILED_PRECONDITION error is returned. + # @!attribute [rw] note + # @return [::String] + # Some note on this request, this can be retrieved by + # {::Google::Cloud::Retail::V2::CatalogService::Client#get_default_branch CatalogService.GetDefaultBranch} + # before next valid default branch set occurs. + # + # This field must be a UTF-8 encoded string with a length limit of 1,000 + # characters. Otherwise, an INVALID_ARGUMENT error is returned. + # @!attribute [rw] force + # @return [::Boolean] + # If set to true, it permits switching to a branch with + # {::Google::Cloud::Retail::V2::SetDefaultBranchRequest#branch_id branch_id} even + # if it has no sufficient active products. + class SetDefaultBranchRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Request message to show which branch is currently the default branch. + # @!attribute [rw] catalog + # @return [::String] + # The parent catalog resource name, such as + # `projects/*/locations/global/catalogs/default_catalog`. + class GetDefaultBranchRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Response message of + # {::Google::Cloud::Retail::V2::CatalogService::Client#get_default_branch CatalogService.GetDefaultBranch}. + # @!attribute [rw] branch + # @return [::String] + # Full resource name of the branch id currently set as default branch. + # @!attribute [rw] set_time + # @return [::Google::Protobuf::Timestamp] + # The time when this branch is set to default. + # @!attribute [rw] note + # @return [::String] + # This corresponds to + # {::Google::Cloud::Retail::V2::SetDefaultBranchRequest#note SetDefaultBranchRequest.note} + # field, when this branch was set as default. + class GetDefaultBranchResponse + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Request for + # {::Google::Cloud::Retail::V2::CatalogService::Client#get_completion_config CatalogService.GetCompletionConfig} + # method. + # @!attribute [rw] name + # @return [::String] + # Required. Full CompletionConfig resource name. Format: + # `projects/{project_number}/locations/{location_id}/catalogs/{catalog_id}/completionConfig` + class GetCompletionConfigRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Request for + # {::Google::Cloud::Retail::V2::CatalogService::Client#update_completion_config CatalogService.UpdateCompletionConfig} + # method. + # @!attribute [rw] completion_config + # @return [::Google::Cloud::Retail::V2::CompletionConfig] + # Required. The {::Google::Cloud::Retail::V2::CompletionConfig CompletionConfig} + # to update. + # + # If the caller does not have permission to update the + # {::Google::Cloud::Retail::V2::CompletionConfig CompletionConfig}, then a + # PERMISSION_DENIED error is returned. + # + # If the {::Google::Cloud::Retail::V2::CompletionConfig CompletionConfig} to + # update does not exist, a NOT_FOUND error is returned. + # @!attribute [rw] update_mask + # @return [::Google::Protobuf::FieldMask] + # Indicates which fields in the provided + # {::Google::Cloud::Retail::V2::CompletionConfig CompletionConfig} to update. The + # following are the only supported fields: + # + # * {::Google::Cloud::Retail::V2::CompletionConfig#matching_order CompletionConfig.matching_order} + # * {::Google::Cloud::Retail::V2::CompletionConfig#max_suggestions CompletionConfig.max_suggestions} + # * {::Google::Cloud::Retail::V2::CompletionConfig#min_prefix_length CompletionConfig.min_prefix_length} + # * {::Google::Cloud::Retail::V2::CompletionConfig#auto_learning CompletionConfig.auto_learning} + # + # If not set, all supported fields are updated. + class UpdateCompletionConfigRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Request for + # {::Google::Cloud::Retail::V2::CatalogService::Client#get_attributes_config CatalogService.GetAttributesConfig} + # method. + # @!attribute [rw] name + # @return [::String] + # Required. Full AttributesConfig resource name. Format: + # `projects/{project_number}/locations/{location_id}/catalogs/{catalog_id}/attributesConfig` + class GetAttributesConfigRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Request for + # {::Google::Cloud::Retail::V2::CatalogService::Client#update_attributes_config CatalogService.UpdateAttributesConfig} + # method. + # @!attribute [rw] attributes_config + # @return [::Google::Cloud::Retail::V2::AttributesConfig] + # Required. The {::Google::Cloud::Retail::V2::AttributesConfig AttributesConfig} + # to update. + # @!attribute [rw] update_mask + # @return [::Google::Protobuf::FieldMask] + # Indicates which fields in the provided + # {::Google::Cloud::Retail::V2::AttributesConfig AttributesConfig} to update. The + # following is the only supported field: + # + # * {::Google::Cloud::Retail::V2::AttributesConfig#catalog_attributes AttributesConfig.catalog_attributes} + # + # If not set, all supported fields are updated. + class UpdateAttributesConfigRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Request for + # {::Google::Cloud::Retail::V2::CatalogService::Client#add_catalog_attribute CatalogService.AddCatalogAttribute} + # method. + # @!attribute [rw] attributes_config + # @return [::String] + # Required. Full AttributesConfig resource name. Format: + # `projects/{project_number}/locations/{location_id}/catalogs/{catalog_id}/attributesConfig` + # @!attribute [rw] catalog_attribute + # @return [::Google::Cloud::Retail::V2::CatalogAttribute] + # Required. The {::Google::Cloud::Retail::V2::CatalogAttribute CatalogAttribute} + # to add. + class AddCatalogAttributeRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Request for + # {::Google::Cloud::Retail::V2::CatalogService::Client#remove_catalog_attribute CatalogService.RemoveCatalogAttribute} + # method. + # @!attribute [rw] attributes_config + # @return [::String] + # Required. Full AttributesConfig resource name. Format: + # `projects/{project_number}/locations/{location_id}/catalogs/{catalog_id}/attributesConfig` + # @!attribute [rw] key + # @return [::String] + # Required. The attribute name key of the + # {::Google::Cloud::Retail::V2::CatalogAttribute CatalogAttribute} to remove. + class RemoveCatalogAttributeRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Request for + # {::Google::Cloud::Retail::V2::CatalogService::Client#replace_catalog_attribute CatalogService.ReplaceCatalogAttribute} + # method. + # @!attribute [rw] attributes_config + # @return [::String] + # Required. Full AttributesConfig resource name. Format: + # `projects/{project_number}/locations/{location_id}/catalogs/{catalog_id}/attributesConfig` + # @!attribute [rw] catalog_attribute + # @return [::Google::Cloud::Retail::V2::CatalogAttribute] + # Required. The updated + # {::Google::Cloud::Retail::V2::CatalogAttribute CatalogAttribute}. + # @!attribute [rw] update_mask + # @return [::Google::Protobuf::FieldMask] + # Indicates which fields in the provided + # {::Google::Cloud::Retail::V2::CatalogAttribute CatalogAttribute} to update. The + # following are NOT supported: + # + # * {::Google::Cloud::Retail::V2::CatalogAttribute#key CatalogAttribute.key} + # + # If not set, all supported fields are updated. + class ReplaceCatalogAttributeRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-retail-v2/proto_docs/google/cloud/retail/v2/common.rb b/owl-bot-staging/google-cloud-retail-v2/proto_docs/google/cloud/retail/v2/common.rb new file mode 100644 index 000000000000..d73fe6763594 --- /dev/null +++ b/owl-bot-staging/google-cloud-retail-v2/proto_docs/google/cloud/retail/v2/common.rb @@ -0,0 +1,1085 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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 Retail + module V2 + # Metadata that is used to define a condition that triggers an action. + # A valid condition must specify at least one of 'query_terms' or + # 'products_filter'. If multiple fields are specified, the condition is met if + # all the fields are satisfied e.g. if a set of query terms and product_filter + # are set, then only items matching the product_filter for requests with a + # query matching the query terms wil get boosted. + # @!attribute [rw] query_terms + # @return [::Array<::Google::Cloud::Retail::V2::Condition::QueryTerm>] + # A list (up to 10 entries) of terms to match the query on. If not + # specified, match all queries. + # If many query terms are specified, the condition + # is matched if any of the terms is a match (i.e. using the OR operator). + # @!attribute [rw] active_time_range + # @return [::Array<::Google::Cloud::Retail::V2::Condition::TimeRange>] + # Range of time(s) specifying when Condition is active. + # Condition true if any time range matches. + # @!attribute [rw] page_categories + # @return [::Array<::String>] + # Used to support browse uses cases. + # A list (up to 10 entries) of categories or departments. + # The format should be the same as + # {::Google::Cloud::Retail::V2::UserEvent#page_categories UserEvent.page_categories}; + class Condition + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # Query terms that we want to match on. + # @!attribute [rw] value + # @return [::String] + # The value of the term to match on. + # Value cannot be empty. + # Value can have at most 3 terms if specified as a partial match. Each + # space separated string is considered as one term. + # For example, "a b c" is 3 terms and allowed, but " a b c d" is 4 terms + # and not allowed for a partial match. + # @!attribute [rw] full_match + # @return [::Boolean] + # Whether this is supposed to be a full or partial match. + class QueryTerm + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Used for time-dependent conditions. + # Example: Want to have rule applied for week long sale. + # @!attribute [rw] start_time + # @return [::Google::Protobuf::Timestamp] + # Start of time range. Range is inclusive. + # @!attribute [rw] end_time + # @return [::Google::Protobuf::Timestamp] + # End of time range. Range is inclusive. + class TimeRange + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end + + # A rule is a condition-action pair + # + # * A condition defines when a rule is to be triggered. + # * An action specifies what occurs on that trigger. + # Currently rules only work for {::Google::Cloud::Retail::V2::Control controls} with + # {::Google::Cloud::Retail::V2::SolutionType::SOLUTION_TYPE_SEARCH SOLUTION_TYPE_SEARCH}. + # @!attribute [rw] boost_action + # @return [::Google::Cloud::Retail::V2::Rule::BoostAction] + # A boost action. + # + # Note: The following fields are mutually exclusive: `boost_action`, `redirect_action`, `oneway_synonyms_action`, `do_not_associate_action`, `replacement_action`, `ignore_action`, `filter_action`, `twoway_synonyms_action`, `force_return_facet_action`, `remove_facet_action`, `pin_action`. If a field in that set is populated, all other fields in the set will automatically be cleared. + # @!attribute [rw] redirect_action + # @return [::Google::Cloud::Retail::V2::Rule::RedirectAction] + # Redirects a shopper to a specific page. + # + # Note: The following fields are mutually exclusive: `redirect_action`, `boost_action`, `oneway_synonyms_action`, `do_not_associate_action`, `replacement_action`, `ignore_action`, `filter_action`, `twoway_synonyms_action`, `force_return_facet_action`, `remove_facet_action`, `pin_action`. If a field in that set is populated, all other fields in the set will automatically be cleared. + # @!attribute [rw] oneway_synonyms_action + # @return [::Google::Cloud::Retail::V2::Rule::OnewaySynonymsAction] + # Treats specific term as a synonym with a group of terms. + # Group of terms will not be treated as synonyms with the specific term. + # + # Note: The following fields are mutually exclusive: `oneway_synonyms_action`, `boost_action`, `redirect_action`, `do_not_associate_action`, `replacement_action`, `ignore_action`, `filter_action`, `twoway_synonyms_action`, `force_return_facet_action`, `remove_facet_action`, `pin_action`. If a field in that set is populated, all other fields in the set will automatically be cleared. + # @!attribute [rw] do_not_associate_action + # @return [::Google::Cloud::Retail::V2::Rule::DoNotAssociateAction] + # Prevents term from being associated with other terms. + # + # Note: The following fields are mutually exclusive: `do_not_associate_action`, `boost_action`, `redirect_action`, `oneway_synonyms_action`, `replacement_action`, `ignore_action`, `filter_action`, `twoway_synonyms_action`, `force_return_facet_action`, `remove_facet_action`, `pin_action`. If a field in that set is populated, all other fields in the set will automatically be cleared. + # @!attribute [rw] replacement_action + # @return [::Google::Cloud::Retail::V2::Rule::ReplacementAction] + # Replaces specific terms in the query. + # + # Note: The following fields are mutually exclusive: `replacement_action`, `boost_action`, `redirect_action`, `oneway_synonyms_action`, `do_not_associate_action`, `ignore_action`, `filter_action`, `twoway_synonyms_action`, `force_return_facet_action`, `remove_facet_action`, `pin_action`. If a field in that set is populated, all other fields in the set will automatically be cleared. + # @!attribute [rw] ignore_action + # @return [::Google::Cloud::Retail::V2::Rule::IgnoreAction] + # Ignores specific terms from query during search. + # + # Note: The following fields are mutually exclusive: `ignore_action`, `boost_action`, `redirect_action`, `oneway_synonyms_action`, `do_not_associate_action`, `replacement_action`, `filter_action`, `twoway_synonyms_action`, `force_return_facet_action`, `remove_facet_action`, `pin_action`. If a field in that set is populated, all other fields in the set will automatically be cleared. + # @!attribute [rw] filter_action + # @return [::Google::Cloud::Retail::V2::Rule::FilterAction] + # Filters results. + # + # Note: The following fields are mutually exclusive: `filter_action`, `boost_action`, `redirect_action`, `oneway_synonyms_action`, `do_not_associate_action`, `replacement_action`, `ignore_action`, `twoway_synonyms_action`, `force_return_facet_action`, `remove_facet_action`, `pin_action`. If a field in that set is populated, all other fields in the set will automatically be cleared. + # @!attribute [rw] twoway_synonyms_action + # @return [::Google::Cloud::Retail::V2::Rule::TwowaySynonymsAction] + # Treats a set of terms as synonyms of one another. + # + # Note: The following fields are mutually exclusive: `twoway_synonyms_action`, `boost_action`, `redirect_action`, `oneway_synonyms_action`, `do_not_associate_action`, `replacement_action`, `ignore_action`, `filter_action`, `force_return_facet_action`, `remove_facet_action`, `pin_action`. If a field in that set is populated, all other fields in the set will automatically be cleared. + # @!attribute [rw] force_return_facet_action + # @return [::Google::Cloud::Retail::V2::Rule::ForceReturnFacetAction] + # Force returns an attribute as a facet in the request. + # + # Note: The following fields are mutually exclusive: `force_return_facet_action`, `boost_action`, `redirect_action`, `oneway_synonyms_action`, `do_not_associate_action`, `replacement_action`, `ignore_action`, `filter_action`, `twoway_synonyms_action`, `remove_facet_action`, `pin_action`. If a field in that set is populated, all other fields in the set will automatically be cleared. + # @!attribute [rw] remove_facet_action + # @return [::Google::Cloud::Retail::V2::Rule::RemoveFacetAction] + # Remove an attribute as a facet in the request (if present). + # + # Note: The following fields are mutually exclusive: `remove_facet_action`, `boost_action`, `redirect_action`, `oneway_synonyms_action`, `do_not_associate_action`, `replacement_action`, `ignore_action`, `filter_action`, `twoway_synonyms_action`, `force_return_facet_action`, `pin_action`. If a field in that set is populated, all other fields in the set will automatically be cleared. + # @!attribute [rw] pin_action + # @return [::Google::Cloud::Retail::V2::Rule::PinAction] + # Pins one or more specified products to a specific position in the + # results. + # + # Note: The following fields are mutually exclusive: `pin_action`, `boost_action`, `redirect_action`, `oneway_synonyms_action`, `do_not_associate_action`, `replacement_action`, `ignore_action`, `filter_action`, `twoway_synonyms_action`, `force_return_facet_action`, `remove_facet_action`. If a field in that set is populated, all other fields in the set will automatically be cleared. + # @!attribute [rw] condition + # @return [::Google::Cloud::Retail::V2::Condition] + # Required. The condition that triggers the rule. + # If the condition is empty, the rule will always apply. + class Rule + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # A boost action to apply to results matching condition specified above. + # @!attribute [rw] boost + # @return [::Float] + # Strength of the condition boost, which must be in [-1, 1]. Negative + # boost means demotion. Default is 0.0. + # + # Setting to 1.0 gives the item a big promotion. However, it does not + # necessarily mean that the boosted item will be the top result at all + # times, nor that other items will be excluded. Results could still be + # shown even when none of them matches the condition. And results that + # are significantly more relevant to the search query can still trump + # your heavily favored but irrelevant items. + # + # Setting to -1.0 gives the item a big demotion. However, results that + # are deeply relevant might still be shown. The item will have an + # upstream battle to get a fairly high ranking, but it is not blocked out + # completely. + # + # Setting to 0.0 means no boost applied. The boosting condition is + # ignored. + # @!attribute [rw] products_filter + # @return [::String] + # The filter can have a max size of 5000 characters. + # An expression which specifies which products to apply an action to. + # The syntax and supported fields are the same as a filter expression. See + # {::Google::Cloud::Retail::V2::SearchRequest#filter SearchRequest.filter} for + # detail syntax and limitations. + # + # Examples: + # + # * To boost products with product ID "product_1" or "product_2", and + # color + # "Red" or "Blue":
+ # *(id: ANY("product_1", "product_2"))
* + # *AND
* + # *(colorFamilies: ANY("Red", "Blue"))
* + class BoostAction + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # * Rule Condition: + # - No + # {::Google::Cloud::Retail::V2::Condition#query_terms Condition.query_terms} + # provided is a global match. + # - 1 or more + # {::Google::Cloud::Retail::V2::Condition#query_terms Condition.query_terms} + # provided are combined with OR operator. + # + # * Action Input: The request query and filter that are applied to the + # retrieved products, in addition to any filters already provided with the + # SearchRequest. The AND operator is used to combine the query's existing + # filters with the filter rule(s). NOTE: May result in 0 results when + # filters conflict. + # + # * Action Result: Filters the returned objects to be ONLY those that passed + # the filter. + # @!attribute [rw] filter + # @return [::String] + # A filter to apply on the matching condition results. Supported features: + # + # * {::Google::Cloud::Retail::V2::Rule::FilterAction#filter filter} must be set. + # * Filter syntax is identical to + # {::Google::Cloud::Retail::V2::SearchRequest#filter SearchRequest.filter}. For + # more + # information, see [Filter](/retail/docs/filter-and-order#filter). + # * To filter products with product ID "product_1" or "product_2", and + # color + # "Red" or "Blue":
+ # *(id: ANY("product_1", "product_2"))
* + # *AND
* + # *(colorFamilies: ANY("Red", "Blue"))
* + class FilterAction + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Redirects a shopper to a specific page. + # + # * Rule Condition: + # Must specify + # {::Google::Cloud::Retail::V2::Condition#query_terms Condition.query_terms}. + # * Action Input: Request Query + # * Action Result: Redirects shopper to provided uri. + # @!attribute [rw] redirect_uri + # @return [::String] + # URL must have length equal or less than 2000 characters. + class RedirectAction + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Creates a set of terms that will be treated as synonyms of each other. + # Example: synonyms of "sneakers" and "shoes": + # + # * "sneakers" will use a synonym of "shoes". + # * "shoes" will use a synonym of "sneakers". + # @!attribute [rw] synonyms + # @return [::Array<::String>] + # Defines a set of synonyms. + # Can specify up to 100 synonyms. + # Must specify at least 2 synonyms. + class TwowaySynonymsAction + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Maps a set of terms to a set of synonyms. + # Set of synonyms will be treated as synonyms of each query term only. + # `query_terms` will not be treated as synonyms of each other. + # Example: "sneakers" will use a synonym of "shoes". + # "shoes" will not use a synonym of "sneakers". + # @!attribute [rw] query_terms + # @return [::Array<::String>] + # Terms from the search query. + # Will treat synonyms as their synonyms. + # Not themselves synonyms of the synonyms. + # Can specify up to 100 terms. + # @!attribute [rw] synonyms + # @return [::Array<::String>] + # Defines a set of synonyms. + # Cannot contain duplicates. + # Can specify up to 100 synonyms. + # @!attribute [rw] oneway_terms + # @return [::Array<::String>] + # Will be [deprecated = true] post migration; + class OnewaySynonymsAction + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Prevents `query_term` from being associated with specified terms during + # search. + # Example: Don't associate "gShoe" and "cheap". + # @!attribute [rw] query_terms + # @return [::Array<::String>] + # Terms from the search query. + # Will not consider do_not_associate_terms for search if in search query. + # Can specify up to 100 terms. + # @!attribute [rw] do_not_associate_terms + # @return [::Array<::String>] + # Cannot contain duplicates or the query term. + # Can specify up to 100 terms. + # @!attribute [rw] terms + # @return [::Array<::String>] + # Will be [deprecated = true] post migration; + class DoNotAssociateAction + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Replaces a term in the query. Multiple replacement candidates can be + # specified. All `query_terms` will be replaced with the replacement term. + # Example: Replace "gShoe" with "google shoe". + # @!attribute [rw] query_terms + # @return [::Array<::String>] + # Terms from the search query. + # Will be replaced by replacement term. + # Can specify up to 100 terms. + # @!attribute [rw] replacement_term + # @return [::String] + # Term that will be used for replacement. + # @!attribute [rw] term + # @return [::String] + # Will be [deprecated = true] post migration; + class ReplacementAction + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Prevents a term in the query from being used in search. + # Example: Don't search for "shoddy". + # @!attribute [rw] ignore_terms + # @return [::Array<::String>] + # Terms to ignore in the search query. + class IgnoreAction + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Force returns an attribute/facet in the request around a certain position + # or above. + # + # * Rule Condition: + # Must specify non-empty + # {::Google::Cloud::Retail::V2::Condition#query_terms Condition.query_terms} + # (for search only) or + # {::Google::Cloud::Retail::V2::Condition#page_categories Condition.page_categories} + # (for browse only), but can't specify both. + # + # * Action Inputs: attribute name, position + # + # * Action Result: Will force return a facet key around a certain position + # or above if the condition is satisfied. + # + # Example: Suppose the query is "shoes", the + # {::Google::Cloud::Retail::V2::Condition#query_terms Condition.query_terms} is + # "shoes", the + # {::Google::Cloud::Retail::V2::Rule::ForceReturnFacetAction::FacetPositionAdjustment#attribute_name ForceReturnFacetAction.FacetPositionAdjustment.attribute_name} + # is "size" and the + # {::Google::Cloud::Retail::V2::Rule::ForceReturnFacetAction::FacetPositionAdjustment#position ForceReturnFacetAction.FacetPositionAdjustment.position} + # is 8. + # + # Two cases: a) The facet key "size" is not already in the top 8 slots, then + # the facet "size" will appear at a position close to 8. b) The facet key + # "size" in among the top 8 positions in the request, then it will stay at + # its current rank. + # @!attribute [rw] facet_position_adjustments + # @return [::Array<::Google::Cloud::Retail::V2::Rule::ForceReturnFacetAction::FacetPositionAdjustment>] + # Each instance corresponds to a force return attribute for the given + # condition. There can't be more 15 instances here. + class ForceReturnFacetAction + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # Each facet position adjustment consists of a single attribute name (i.e. + # facet key) along with a specified position. + # @!attribute [rw] attribute_name + # @return [::String] + # The attribute name to force return as a facet. Each attribute name + # should be a valid attribute name, be non-empty and contain at most 80 + # characters long. + # @!attribute [rw] position + # @return [::Integer] + # This is the position in the request as explained above. It should be + # strictly positive be at most 100. + class FacetPositionAdjustment + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end + + # Removes an attribute/facet in the request if is present. + # + # * Rule Condition: + # Must specify non-empty + # {::Google::Cloud::Retail::V2::Condition#query_terms Condition.query_terms} + # (for search only) or + # {::Google::Cloud::Retail::V2::Condition#page_categories Condition.page_categories} + # (for browse only), but can't specify both. + # + # * Action Input: attribute name + # + # * Action Result: Will remove the attribute (as a facet) from the request + # if it is present. + # + # Example: Suppose the query is "shoes", the + # {::Google::Cloud::Retail::V2::Condition#query_terms Condition.query_terms} is + # "shoes" and the attribute name "size", then facet key "size" will be + # removed from the request (if it is present). + # @!attribute [rw] attribute_names + # @return [::Array<::String>] + # The attribute names (i.e. facet keys) to remove from the dynamic facets + # (if present in the request). There can't be more 3 attribute names. + # Each attribute name should be a valid attribute name, be non-empty and + # contain at most 80 characters. + class RemoveFacetAction + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Pins one or more specified products to a specific position in the + # results. + # + # * Rule Condition: + # Must specify non-empty + # {::Google::Cloud::Retail::V2::Condition#query_terms Condition.query_terms} + # (for search only) or + # {::Google::Cloud::Retail::V2::Condition#page_categories Condition.page_categories} + # (for browse only), but can't specify both. + # + # * Action Input: mapping of `[pin_position, product_id]` pairs (pin position + # uses 1-based indexing). + # + # * Action Result: Will pin products with matching ids to the position + # specified in the final result order. + # + # Example: Suppose the query is `shoes`, the + # {::Google::Cloud::Retail::V2::Condition#query_terms Condition.query_terms} is + # `shoes` and the pin_map has `{1, "pid1"}`, then product with `pid1` will be + # pinned to the top position in the final results. + # + # If multiple PinActions are matched to a single request the actions will + # be processed from most to least recently updated. + # + # Pins to positions larger than the max allowed page size of 120 are not + # allowed. + # @!attribute [rw] pin_map + # @return [::Google::Protobuf::Map{::Integer => ::String}] + # Required. A map of positions to product_ids. + # + # Partial matches per action are allowed, if a certain position in the map + # is already filled that `[position, product_id]` pair will be ignored + # but the rest may still be applied. This case will only occur if multiple + # pin actions are matched to a single request, as the map guarantees that + # pin positions are unique within the same action. + # + # Duplicate product_ids are not permitted within a single pin map. + # + # The max size of this map is 120, equivalent to the max [request page + # size](https://cloud.google.com/retail/docs/reference/rest/v2/projects.locations.catalogs.placements/search#request-body). + class PinAction + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # @!attribute [rw] key + # @return [::Integer] + # @!attribute [rw] value + # @return [::String] + class PinMapEntry + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end + end + + # An intended audience of the {::Google::Cloud::Retail::V2::Product Product} for + # whom it's sold. + # @!attribute [rw] genders + # @return [::Array<::String>] + # The genders of the audience. Strongly encouraged to use the standard + # values: "male", "female", "unisex". + # + # At most 5 values are allowed. Each value must be a UTF-8 encoded string + # with a length limit of 128 characters. Otherwise, an INVALID_ARGUMENT error + # is returned. + # + # Google Merchant Center property + # [gender](https://support.google.com/merchants/answer/6324479). Schema.org + # property + # [Product.audience.suggestedGender](https://schema.org/suggestedGender). + # @!attribute [rw] age_groups + # @return [::Array<::String>] + # The age groups of the audience. Strongly encouraged to use the standard + # values: "newborn" (up to 3 months old), "infant" (3–12 months old), + # "toddler" (1–5 years old), "kids" (5–13 years old), "adult" (typically + # teens or older). + # + # At most 5 values are allowed. Each value must be a UTF-8 encoded string + # with a length limit of 128 characters. Otherwise, an INVALID_ARGUMENT error + # is returned. + # + # Google Merchant Center property + # [age_group](https://support.google.com/merchants/answer/6324463). + # Schema.org property + # [Product.audience.suggestedMinAge](https://schema.org/suggestedMinAge) and + # [Product.audience.suggestedMaxAge](https://schema.org/suggestedMaxAge). + class Audience + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # The color information of a {::Google::Cloud::Retail::V2::Product Product}. + # @!attribute [rw] color_families + # @return [::Array<::String>] + # The standard color families. Strongly recommended to use the following + # standard color groups: "Red", "Pink", "Orange", "Yellow", "Purple", + # "Green", "Cyan", "Blue", "Brown", "White", "Gray", "Black" and "Mixed". + # Normally it is expected to have only 1 color family. May consider using + # single "Mixed" instead of multiple values. + # + # A maximum of 5 values are allowed. Each value must be a UTF-8 encoded + # string with a length limit of 128 characters. Otherwise, an + # INVALID_ARGUMENT error is returned. + # + # Google Merchant Center property + # [color](https://support.google.com/merchants/answer/6324487). Schema.org + # property [Product.color](https://schema.org/color). + # + # The colorFamilies field as a system attribute is not a required field but + # strongly recommended to be specified. Google Search models treat this field + # as more important than a custom product attribute when specified. + # @!attribute [rw] colors + # @return [::Array<::String>] + # The color display names, which may be different from standard color family + # names, such as the color aliases used in the website frontend. Normally + # it is expected to have only 1 color. May consider using single "Mixed" + # instead of multiple values. + # + # A maximum of 75 colors are allowed. Each value must be a UTF-8 encoded + # string with a length limit of 128 characters. Otherwise, an + # INVALID_ARGUMENT error is returned. + # + # Google Merchant Center property + # [color](https://support.google.com/merchants/answer/6324487). Schema.org + # property [Product.color](https://schema.org/color). + class ColorInfo + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # A custom attribute that is not explicitly modeled in + # {::Google::Cloud::Retail::V2::Product Product}. + # @!attribute [rw] text + # @return [::Array<::String>] + # The textual values of this custom attribute. For example, `["yellow", + # "green"]` when the key is "color". + # + # Empty string is not allowed. Otherwise, an INVALID_ARGUMENT error is + # returned. + # + # Exactly one of {::Google::Cloud::Retail::V2::CustomAttribute#text text} or + # {::Google::Cloud::Retail::V2::CustomAttribute#numbers numbers} should be set. + # Otherwise, an INVALID_ARGUMENT error is returned. + # @!attribute [rw] numbers + # @return [::Array<::Float>] + # The numerical values of this custom attribute. For example, `[2.3, 15.4]` + # when the key is "lengths_cm". + # + # Exactly one of {::Google::Cloud::Retail::V2::CustomAttribute#text text} or + # {::Google::Cloud::Retail::V2::CustomAttribute#numbers numbers} should be set. + # Otherwise, an INVALID_ARGUMENT error is returned. + # @!attribute [rw] searchable + # @deprecated This field is deprecated and may be removed in the next major version update. + # @return [::Boolean] + # This field is normally ignored unless + # {::Google::Cloud::Retail::V2::AttributesConfig#attribute_config_level AttributesConfig.attribute_config_level} + # of the {::Google::Cloud::Retail::V2::Catalog Catalog} is set to the deprecated + # 'PRODUCT_LEVEL_ATTRIBUTE_CONFIG' mode. For information about product-level + # attribute configuration, see [Configuration + # modes](https://cloud.google.com/retail/docs/attribute-config#config-modes). + # If true, custom attribute values are searchable by text queries in + # {::Google::Cloud::Retail::V2::SearchService::Client#search SearchService.Search}. + # + # This field is ignored in a {::Google::Cloud::Retail::V2::UserEvent UserEvent}. + # + # Only set if type {::Google::Cloud::Retail::V2::CustomAttribute#text text} is + # set. Otherwise, a INVALID_ARGUMENT error is returned. + # @!attribute [rw] indexable + # @deprecated This field is deprecated and may be removed in the next major version update. + # @return [::Boolean] + # This field is normally ignored unless + # {::Google::Cloud::Retail::V2::AttributesConfig#attribute_config_level AttributesConfig.attribute_config_level} + # of the {::Google::Cloud::Retail::V2::Catalog Catalog} is set to the deprecated + # 'PRODUCT_LEVEL_ATTRIBUTE_CONFIG' mode. For information about product-level + # attribute configuration, see [Configuration + # modes](https://cloud.google.com/retail/docs/attribute-config#config-modes). + # If true, custom attribute values are indexed, so that they can be filtered, + # faceted or boosted in + # {::Google::Cloud::Retail::V2::SearchService::Client#search SearchService.Search}. + # + # This field is ignored in a {::Google::Cloud::Retail::V2::UserEvent UserEvent}. + # + # See {::Google::Cloud::Retail::V2::SearchRequest#filter SearchRequest.filter}, + # {::Google::Cloud::Retail::V2::SearchRequest#facet_specs SearchRequest.facet_specs} + # and + # {::Google::Cloud::Retail::V2::SearchRequest#boost_spec SearchRequest.boost_spec} + # for more details. + class CustomAttribute + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Fulfillment information, such as the store IDs for in-store pickup or region + # IDs for different shipping methods. + # @!attribute [rw] type + # @return [::String] + # The fulfillment type, including commonly used types (such as pickup in + # store and same day delivery), and custom types. Customers have to map + # custom types to their display names before rendering UI. + # + # Supported values: + # + # * "pickup-in-store" + # * "ship-to-store" + # * "same-day-delivery" + # * "next-day-delivery" + # * "custom-type-1" + # * "custom-type-2" + # * "custom-type-3" + # * "custom-type-4" + # * "custom-type-5" + # + # If this field is set to an invalid value other than these, an + # INVALID_ARGUMENT error is returned. + # @!attribute [rw] place_ids + # @return [::Array<::String>] + # The IDs for this {::Google::Cloud::Retail::V2::FulfillmentInfo#type type}, such + # as the store IDs for + # {::Google::Cloud::Retail::V2::FulfillmentInfo#type FulfillmentInfo.type.pickup-in-store} + # or the region IDs for + # {::Google::Cloud::Retail::V2::FulfillmentInfo#type FulfillmentInfo.type.same-day-delivery}. + # + # A maximum of 3000 values are allowed. Each value must be a string with a + # length limit of 30 characters, matching the pattern `[a-zA-Z0-9_-]+`, such + # as "store1" or "REGION-2". Otherwise, an INVALID_ARGUMENT error is + # returned. + class FulfillmentInfo + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # {::Google::Cloud::Retail::V2::Product Product} image. Recommendations AI and + # Retail Search use product images to improve prediction and search results. + # Product images can be returned in results, and are shown in prediction or + # search previews in the console. Please try to provide correct product images + # and avoid using images with size too small. + # @!attribute [rw] uri + # @return [::String] + # Required. URI of the image. + # + # This field must be a valid UTF-8 encoded URI with a length limit of 5,000 + # characters. Otherwise, an INVALID_ARGUMENT error is returned. + # + # Google Merchant Center property + # [image_link](https://support.google.com/merchants/answer/6324350). + # Schema.org property [Product.image](https://schema.org/image). + # @!attribute [rw] height + # @return [::Integer] + # Height of the image in number of pixels. + # + # This field must be nonnegative. Otherwise, an INVALID_ARGUMENT error is + # returned. + # @!attribute [rw] width + # @return [::Integer] + # Width of the image in number of pixels. + # + # This field must be nonnegative. Otherwise, an INVALID_ARGUMENT error is + # returned. + class Image + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # A floating point interval. + # @!attribute [rw] minimum + # @return [::Float] + # Inclusive lower bound. + # + # Note: The following fields are mutually exclusive: `minimum`, `exclusive_minimum`. If a field in that set is populated, all other fields in the set will automatically be cleared. + # @!attribute [rw] exclusive_minimum + # @return [::Float] + # Exclusive lower bound. + # + # Note: The following fields are mutually exclusive: `exclusive_minimum`, `minimum`. If a field in that set is populated, all other fields in the set will automatically be cleared. + # @!attribute [rw] maximum + # @return [::Float] + # Inclusive upper bound. + # + # Note: The following fields are mutually exclusive: `maximum`, `exclusive_maximum`. If a field in that set is populated, all other fields in the set will automatically be cleared. + # @!attribute [rw] exclusive_maximum + # @return [::Float] + # Exclusive upper bound. + # + # Note: The following fields are mutually exclusive: `exclusive_maximum`, `maximum`. If a field in that set is populated, all other fields in the set will automatically be cleared. + class Interval + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # The price information of a {::Google::Cloud::Retail::V2::Product Product}. + # @!attribute [rw] currency_code + # @return [::String] + # The 3-letter currency code defined in [ISO + # 4217](https://www.iso.org/iso-4217-currency-codes.html). + # + # If this field is an unrecognizable currency code, an INVALID_ARGUMENT + # error is returned. + # + # The {::Google::Cloud::Retail::V2::Product::Type::VARIANT Product.Type.VARIANT} + # {::Google::Cloud::Retail::V2::Product Product}s with the same + # {::Google::Cloud::Retail::V2::Product#primary_product_id Product.primary_product_id} + # must share the same + # {::Google::Cloud::Retail::V2::PriceInfo#currency_code currency_code}. Otherwise, + # a FAILED_PRECONDITION error is returned. + # @!attribute [rw] price + # @return [::Float] + # Price of the product. + # + # Google Merchant Center property + # [price](https://support.google.com/merchants/answer/6324371). Schema.org + # property [Offer.price](https://schema.org/price). + # @!attribute [rw] original_price + # @return [::Float] + # Price of the product without any discount. If zero, by default set to be + # the {::Google::Cloud::Retail::V2::PriceInfo#price price}. If set, + # {::Google::Cloud::Retail::V2::PriceInfo#original_price original_price} should be + # greater than or equal to {::Google::Cloud::Retail::V2::PriceInfo#price price}, + # otherwise an INVALID_ARGUMENT error is thrown. + # @!attribute [rw] cost + # @return [::Float] + # The costs associated with the sale of a particular product. Used for gross + # profit reporting. + # + # * Profit = {::Google::Cloud::Retail::V2::PriceInfo#price price} - + # {::Google::Cloud::Retail::V2::PriceInfo#cost cost} + # + # Google Merchant Center property + # [cost_of_goods_sold](https://support.google.com/merchants/answer/9017895). + # @!attribute [rw] price_effective_time + # @return [::Google::Protobuf::Timestamp] + # The timestamp when the {::Google::Cloud::Retail::V2::PriceInfo#price price} + # starts to be effective. This can be set as a future timestamp, and the + # {::Google::Cloud::Retail::V2::PriceInfo#price price} is only used for search + # after + # {::Google::Cloud::Retail::V2::PriceInfo#price_effective_time price_effective_time}. + # If so, the + # {::Google::Cloud::Retail::V2::PriceInfo#original_price original_price} must be + # set and {::Google::Cloud::Retail::V2::PriceInfo#original_price original_price} + # is used before + # {::Google::Cloud::Retail::V2::PriceInfo#price_effective_time price_effective_time}. + # + # Do not set if {::Google::Cloud::Retail::V2::PriceInfo#price price} is always + # effective because it will cause additional latency during search. + # @!attribute [rw] price_expire_time + # @return [::Google::Protobuf::Timestamp] + # The timestamp when the {::Google::Cloud::Retail::V2::PriceInfo#price price} + # stops to be effective. The {::Google::Cloud::Retail::V2::PriceInfo#price price} + # is used for search before + # {::Google::Cloud::Retail::V2::PriceInfo#price_expire_time price_expire_time}. If + # this field is set, the + # {::Google::Cloud::Retail::V2::PriceInfo#original_price original_price} must be + # set and {::Google::Cloud::Retail::V2::PriceInfo#original_price original_price} + # is used after + # {::Google::Cloud::Retail::V2::PriceInfo#price_expire_time price_expire_time}. + # + # Do not set if {::Google::Cloud::Retail::V2::PriceInfo#price price} is always + # effective because it will cause additional latency during search. + # @!attribute [r] price_range + # @return [::Google::Cloud::Retail::V2::PriceInfo::PriceRange] + # Output only. The price range of all the child + # {::Google::Cloud::Retail::V2::Product::Type::VARIANT Product.Type.VARIANT} + # {::Google::Cloud::Retail::V2::Product Product}s grouped together on the + # {::Google::Cloud::Retail::V2::Product::Type::PRIMARY Product.Type.PRIMARY} + # {::Google::Cloud::Retail::V2::Product Product}. Only populated for + # {::Google::Cloud::Retail::V2::Product::Type::PRIMARY Product.Type.PRIMARY} + # {::Google::Cloud::Retail::V2::Product Product}s. + # + # Note: This field is OUTPUT_ONLY for + # {::Google::Cloud::Retail::V2::ProductService::Client#get_product ProductService.GetProduct}. + # Do not set this field in API requests. + class PriceInfo + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # The price range of all + # {::Google::Cloud::Retail::V2::Product::Type::VARIANT variant} + # {::Google::Cloud::Retail::V2::Product Product} having the same + # {::Google::Cloud::Retail::V2::Product#primary_product_id Product.primary_product_id}. + # @!attribute [rw] price + # @return [::Google::Cloud::Retail::V2::Interval] + # The inclusive + # {::Google::Cloud::Retail::V2::PriceInfo#price Product.pricing_info.price} + # interval of all {::Google::Cloud::Retail::V2::Product::Type::VARIANT variant} + # {::Google::Cloud::Retail::V2::Product Product} having the same + # {::Google::Cloud::Retail::V2::Product#primary_product_id Product.primary_product_id}. + # @!attribute [rw] original_price + # @return [::Google::Cloud::Retail::V2::Interval] + # The inclusive + # {::Google::Cloud::Retail::V2::PriceInfo#original_price Product.pricing_info.original_price} + # internal of all {::Google::Cloud::Retail::V2::Product::Type::VARIANT variant} + # {::Google::Cloud::Retail::V2::Product Product} having the same + # {::Google::Cloud::Retail::V2::Product#primary_product_id Product.primary_product_id}. + class PriceRange + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end + + # The rating of a {::Google::Cloud::Retail::V2::Product Product}. + # @!attribute [rw] rating_count + # @return [::Integer] + # The total number of ratings. This value is independent of the value of + # {::Google::Cloud::Retail::V2::Rating#rating_histogram rating_histogram}. + # + # This value must be nonnegative. Otherwise, an INVALID_ARGUMENT error is + # returned. + # @!attribute [rw] average_rating + # @return [::Float] + # The average rating of the {::Google::Cloud::Retail::V2::Product Product}. + # + # The rating is scaled at 1-5. Otherwise, an INVALID_ARGUMENT error is + # returned. + # @!attribute [rw] rating_histogram + # @return [::Array<::Integer>] + # List of rating counts per rating value (index = rating - 1). The list is + # empty if there is no rating. If the list is non-empty, its size is + # always 5. Otherwise, an INVALID_ARGUMENT error is returned. + # + # For example, [41, 14, 13, 47, 303]. It means that the + # {::Google::Cloud::Retail::V2::Product Product} got 41 ratings with 1 star, 14 + # ratings with 2 star, and so on. + class Rating + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Information of an end user. + # @!attribute [rw] user_id + # @return [::String] + # Highly recommended for logged-in users. Unique identifier for logged-in + # user, such as a user name. Don't set for anonymous users. + # + # Always use a hashed value for this ID. + # + # Don't set the field to the same fixed ID for different users. This mixes + # the event history of those users together, which results in degraded + # model quality. + # + # The field must be a UTF-8 encoded string with a length limit of 128 + # characters. Otherwise, an INVALID_ARGUMENT error is returned. + # @!attribute [rw] ip_address + # @return [::String] + # The end user's IP address. This field is used to extract location + # information for personalization. + # + # This field must be either an IPv4 address (e.g. "104.133.9.80") or an IPv6 + # address (e.g. "2001:0db8:85a3:0000:0000:8a2e:0370:7334"). Otherwise, an + # INVALID_ARGUMENT error is returned. + # + # This should not be set when: + # + # * setting + # {::Google::Cloud::Retail::V2::SearchRequest#user_info SearchRequest.user_info}. + # * using the JavaScript tag in + # {::Google::Cloud::Retail::V2::UserEventService::Client#collect_user_event UserEventService.CollectUserEvent} + # or if + # {::Google::Cloud::Retail::V2::UserInfo#direct_user_request direct_user_request} + # is set. + # @!attribute [rw] user_agent + # @return [::String] + # User agent as included in the HTTP header. + # The field must be a UTF-8 encoded string with a length limit of 1,000 + # characters. Otherwise, an INVALID_ARGUMENT error is returned. + # + # This should not be set when using the client side event reporting with + # GTM or JavaScript tag in + # {::Google::Cloud::Retail::V2::UserEventService::Client#collect_user_event UserEventService.CollectUserEvent} + # or if + # {::Google::Cloud::Retail::V2::UserInfo#direct_user_request direct_user_request} + # is set. + # @!attribute [rw] direct_user_request + # @return [::Boolean] + # True if the request is made directly from the end user, in which case the + # {::Google::Cloud::Retail::V2::UserInfo#ip_address ip_address} and + # {::Google::Cloud::Retail::V2::UserInfo#user_agent user_agent} can be populated + # from the HTTP request. This flag should be set only if the API request is + # made directly from the end user such as a mobile app (and not if a gateway + # or a server is processing and pushing the user events). + # + # This should not be set when using the JavaScript tag in + # {::Google::Cloud::Retail::V2::UserEventService::Client#collect_user_event UserEventService.CollectUserEvent}. + class UserInfo + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # The inventory information at a place (e.g. a store) identified + # by a place ID. + # @!attribute [rw] place_id + # @return [::String] + # Optional. The place ID for the current set of inventory information. + # @!attribute [rw] price_info + # @return [::Google::Cloud::Retail::V2::PriceInfo] + # Optional. Product price and cost information. + # + # Google Merchant Center property + # [price](https://support.google.com/merchants/answer/6324371). + # @!attribute [rw] attributes + # @return [::Google::Protobuf::Map{::String => ::Google::Cloud::Retail::V2::CustomAttribute}] + # Optional. Additional local inventory attributes, for example, store name, + # promotion tags, etc. + # + # This field needs to pass all below criteria, otherwise an INVALID_ARGUMENT + # error is returned: + # + # * At most 30 attributes are allowed. + # * The key must be a UTF-8 encoded string with a length limit of 32 + # characters. + # * The key must match the pattern: `[a-zA-Z0-9][a-zA-Z0-9_]*`. For example, + # key0LikeThis or KEY_1_LIKE_THIS. + # * The attribute values must be of the same type (text or number). + # * Only 1 value is allowed for each attribute. + # * For text values, the length limit is 256 UTF-8 characters. + # * The attribute does not support search. The `searchable` field should be + # unset or set to false. + # * The max summed total bytes of custom attribute keys and values per + # product is 5MiB. + # @!attribute [rw] fulfillment_types + # @return [::Array<::String>] + # Optional. Supported fulfillment types. Valid fulfillment type values + # include commonly used types (such as pickup in store and same day + # delivery), and custom types. Customers have to map custom types to their + # display names before rendering UI. + # + # Supported values: + # + # * "pickup-in-store" + # * "ship-to-store" + # * "same-day-delivery" + # * "next-day-delivery" + # * "custom-type-1" + # * "custom-type-2" + # * "custom-type-3" + # * "custom-type-4" + # * "custom-type-5" + # + # If this field is set to an invalid value other than these, an + # INVALID_ARGUMENT error is returned. + # + # All the elements must be distinct. Otherwise, an INVALID_ARGUMENT error is + # returned. + class LocalInventory + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # @!attribute [rw] key + # @return [::String] + # @!attribute [rw] value + # @return [::Google::Cloud::Retail::V2::CustomAttribute] + class AttributesEntry + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end + + # Metadata for pinning to be returned in the response. + # This is used for distinguishing between applied vs dropped pins. + # @!attribute [rw] all_matched_pins + # @return [::Google::Protobuf::Map{::Integer => ::Google::Cloud::Retail::V2::PinControlMetadata::ProductPins}] + # Map of all matched pins, keyed by pin position. + # @!attribute [rw] dropped_pins + # @return [::Google::Protobuf::Map{::Integer => ::Google::Cloud::Retail::V2::PinControlMetadata::ProductPins}] + # Map of pins that were dropped due to overlap with other matching pins, + # keyed by pin position. + class PinControlMetadata + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # List of product ids which have associated pins. + # @!attribute [rw] product_id + # @return [::Array<::String>] + # List of product ids which have associated pins. + class ProductPins + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # @!attribute [rw] key + # @return [::Integer] + # @!attribute [rw] value + # @return [::Google::Cloud::Retail::V2::PinControlMetadata::ProductPins] + class AllMatchedPinsEntry + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # @!attribute [rw] key + # @return [::Integer] + # @!attribute [rw] value + # @return [::Google::Cloud::Retail::V2::PinControlMetadata::ProductPins] + class DroppedPinsEntry + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end + + # A list of string values. + # @!attribute [rw] values + # @return [::Array<::String>] + # String values. + class StringList + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # A message with a list of double values. + # @!attribute [rw] values + # @return [::Array<::Float>] + # The list of double values. + class DoubleList + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # At which level we offer configuration for attributes. + module AttributeConfigLevel + # Value used when unset. In this case, server behavior defaults to + # {::Google::Cloud::Retail::V2::AttributeConfigLevel::CATALOG_LEVEL_ATTRIBUTE_CONFIG CATALOG_LEVEL_ATTRIBUTE_CONFIG}. + ATTRIBUTE_CONFIG_LEVEL_UNSPECIFIED = 0 + + # At this level, we honor the attribute configurations set in + # {::Google::Cloud::Retail::V2::Product#attributes Product.attributes}. + PRODUCT_LEVEL_ATTRIBUTE_CONFIG = 1 + + # At this level, we honor the attribute configurations set in + # `CatalogConfig.attribute_configs`. + CATALOG_LEVEL_ATTRIBUTE_CONFIG = 2 + end + + # The type of solution. + module SolutionType + # Default value. + SOLUTION_TYPE_UNSPECIFIED = 0 + + # Used for Recommendations AI. + SOLUTION_TYPE_RECOMMENDATION = 1 + + # Used for Retail Search. + SOLUTION_TYPE_SEARCH = 2 + end + + # If filtering for recommendations is enabled. + module RecommendationsFilteringOption + # Value used when unset. + # In this case, server behavior defaults to + # {::Google::Cloud::Retail::V2::RecommendationsFilteringOption::RECOMMENDATIONS_FILTERING_DISABLED RECOMMENDATIONS_FILTERING_DISABLED}. + RECOMMENDATIONS_FILTERING_OPTION_UNSPECIFIED = 0 + + # Recommendation filtering is disabled. + RECOMMENDATIONS_FILTERING_DISABLED = 1 + + # Recommendation filtering is enabled. + RECOMMENDATIONS_FILTERING_ENABLED = 3 + end + + # The use case of Cloud Retail Search. + module SearchSolutionUseCase + # The value when it's unspecified. In this case, server behavior defaults to + # {::Google::Cloud::Retail::V2::SearchSolutionUseCase::SEARCH_SOLUTION_USE_CASE_SEARCH SEARCH_SOLUTION_USE_CASE_SEARCH}. + SEARCH_SOLUTION_USE_CASE_UNSPECIFIED = 0 + + # Search use case. Expects the traffic has a non-empty + # {::Google::Cloud::Retail::V2::SearchRequest#query query}. + SEARCH_SOLUTION_USE_CASE_SEARCH = 1 + + # Browse use case. Expects the traffic has an empty + # {::Google::Cloud::Retail::V2::SearchRequest#query query}. + SEARCH_SOLUTION_USE_CASE_BROWSE = 2 + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-retail-v2/proto_docs/google/cloud/retail/v2/completion_service.rb b/owl-bot-staging/google-cloud-retail-v2/proto_docs/google/cloud/retail/v2/completion_service.rb new file mode 100644 index 000000000000..b0608b79614d --- /dev/null +++ b/owl-bot-staging/google-cloud-retail-v2/proto_docs/google/cloud/retail/v2/completion_service.rb @@ -0,0 +1,230 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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 Retail + module V2 + # Autocomplete parameters. + # @!attribute [rw] catalog + # @return [::String] + # Required. Catalog for which the completion is performed. + # + # Full resource name of catalog, such as + # `projects/*/locations/global/catalogs/default_catalog`. + # @!attribute [rw] query + # @return [::String] + # Required. The query used to generate suggestions. + # + # The maximum number of allowed characters is 255. + # @!attribute [rw] visitor_id + # @return [::String] + # Recommended field. A unique identifier for tracking visitors. For example, + # this could be implemented with an HTTP cookie, which should be able to + # uniquely identify a visitor on a single device. This unique identifier + # should not change if the visitor logs in or out of the website. + # + # The field must be a UTF-8 encoded string with a length limit of 128 + # characters. Otherwise, an INVALID_ARGUMENT error is returned. + # @!attribute [rw] language_codes + # @return [::Array<::String>] + # Note that this field applies for `user-data` dataset only. For requests + # with `cloud-retail` dataset, setting this field has no effect. + # + # The language filters applied to the output suggestions. If set, it should + # contain the language of the query. If not set, suggestions are returned + # without considering language restrictions. This is the BCP-47 language + # code, such as "en-US" or "sr-Latn". For more information, see [Tags for + # Identifying Languages](https://tools.ietf.org/html/bcp47). The maximum + # number of language codes is 3. + # @!attribute [rw] device_type + # @return [::String] + # The device type context for completion suggestions. We recommend that you + # leave this field empty. + # + # It can apply different suggestions on different device types, e.g. + # `DESKTOP`, `MOBILE`. If it is empty, the suggestions are across all device + # types. + # + # Supported formats: + # + # * `UNKNOWN_DEVICE_TYPE` + # + # * `DESKTOP` + # + # * `MOBILE` + # + # * A customized string starts with `OTHER_`, e.g. `OTHER_IPHONE`. + # @!attribute [rw] dataset + # @return [::String] + # Determines which dataset to use for fetching completion. "user-data" will + # use the dataset imported through + # {::Google::Cloud::Retail::V2::CompletionService::Client#import_completion_data CompletionService.ImportCompletionData}. + # `cloud-retail` will use the dataset generated by Cloud Retail based on user + # events. If left empty, completions will be fetched from the `user-data` + # dataset. + # + # Current supported values: + # + # * user-data + # + # * cloud-retail: + # This option requires enabling auto-learning function first. See + # [guidelines](https://cloud.google.com/retail/docs/completion-overview#generated-completion-dataset). + # @!attribute [rw] max_suggestions + # @return [::Integer] + # Completion max suggestions. If left unset or set to 0, then will fallback + # to the configured value + # {::Google::Cloud::Retail::V2::CompletionConfig#max_suggestions CompletionConfig.max_suggestions}. + # + # The maximum allowed max suggestions is 20. If it is set higher, it will be + # capped by 20. + # @!attribute [rw] enable_attribute_suggestions + # @return [::Boolean] + # If true, attribute suggestions are enabled and provided in the response. + # + # This field is only available for the `cloud-retail` dataset. + # @!attribute [rw] entity + # @return [::String] + # The entity for customers who run multiple entities, domains, sites, or + # regions, for example, `Google US`, `Google Ads`, `Waymo`, + # `google.com`, `youtube.com`, etc. + # If this is set, it must be an exact match with + # {::Google::Cloud::Retail::V2::UserEvent#entity UserEvent.entity} to get + # per-entity autocomplete results. This field will be applied to + # `completion_results` only. It has no effect on the `attribute_results`. + # Also, this entity should be limited to 256 characters, if too long, it will + # be truncated to 256 characters in both generation and serving time, and may + # lead to mis-match. To ensure it works, please set the entity with string + # within 256 characters. + class CompleteQueryRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Response of the autocomplete query. + # @!attribute [rw] completion_results + # @return [::Array<::Google::Cloud::Retail::V2::CompleteQueryResponse::CompletionResult>] + # Results of the matching suggestions. The result list is ordered and the + # first result is top suggestion. + # @!attribute [rw] attribution_token + # @return [::String] + # A unique complete token. This should be included in the + # {::Google::Cloud::Retail::V2::UserEvent#completion_detail UserEvent.completion_detail} + # for search events resulting from this completion, which enables accurate + # attribution of complete model performance. + # @!attribute [rw] recent_search_results + # @deprecated This field is deprecated and may be removed in the next major version update. + # @return [::Array<::Google::Cloud::Retail::V2::CompleteQueryResponse::RecentSearchResult>] + # Deprecated. Matched recent searches of this user. The maximum number of + # recent searches is 10. This field is a restricted feature. If you want to + # enable it, contact Retail Search support. + # + # This feature is only available when + # {::Google::Cloud::Retail::V2::CompleteQueryRequest#visitor_id CompleteQueryRequest.visitor_id} + # field is set and {::Google::Cloud::Retail::V2::UserEvent UserEvent} is imported. + # The recent searches satisfy the follow rules: + # + # * They are ordered from latest to oldest. + # + # * They are matched with + # {::Google::Cloud::Retail::V2::CompleteQueryRequest#query CompleteQueryRequest.query} + # case insensitively. + # + # * They are transformed to lower case. + # + # * They are UTF-8 safe. + # + # Recent searches are deduplicated. More recent searches will be reserved + # when duplication happens. + # @!attribute [rw] attribute_results + # @return [::Google::Protobuf::Map{::String => ::Google::Cloud::Retail::V2::CompleteQueryResponse::AttributeResult}] + # A map of matched attribute suggestions. This field is only available for + # `cloud-retail` dataset. + # + # Current supported keys: + # + # * `brands` + # + # * `categories` + class CompleteQueryResponse + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # Resource that represents completion results. + # @!attribute [rw] suggestion + # @return [::String] + # The suggestion for the query. + # @!attribute [rw] attributes + # @return [::Google::Protobuf::Map{::String => ::Google::Cloud::Retail::V2::CustomAttribute}] + # Custom attributes for the suggestion term. + # + # * For `user-data`, the attributes are additional custom attributes + # ingested through BigQuery. + # + # * For `cloud-retail`, the attributes are product attributes generated + # by Cloud Retail. It requires + # {::Google::Cloud::Retail::V2::UserEvent#product_details UserEvent.product_details} + # is imported properly. + class CompletionResult + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # @!attribute [rw] key + # @return [::String] + # @!attribute [rw] value + # @return [::Google::Cloud::Retail::V2::CustomAttribute] + class AttributesEntry + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end + + # Deprecated: Recent search of this user. + # @deprecated This message is deprecated and may be removed in the next major version update. + # @!attribute [rw] recent_search + # @return [::String] + # The recent search query. + class RecentSearchResult + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Resource that represents attribute results. + # @!attribute [rw] suggestions + # @return [::Array<::String>] + # The list of suggestions for the attribute. + class AttributeResult + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # @!attribute [rw] key + # @return [::String] + # @!attribute [rw] value + # @return [::Google::Cloud::Retail::V2::CompleteQueryResponse::AttributeResult] + class AttributeResultsEntry + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-retail-v2/proto_docs/google/cloud/retail/v2/control.rb b/owl-bot-staging/google-cloud-retail-v2/proto_docs/google/cloud/retail/v2/control.rb new file mode 100644 index 000000000000..8a377de74e6d --- /dev/null +++ b/owl-bot-staging/google-cloud-retail-v2/proto_docs/google/cloud/retail/v2/control.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 Cloud + module Retail + module V2 + # Configures dynamic metadata that can be linked to a + # {::Google::Cloud::Retail::V2::ServingConfig ServingConfig} and affect search or + # recommendation results at serving time. + # @!attribute [rw] rule + # @return [::Google::Cloud::Retail::V2::Rule] + # A rule control - a condition-action pair. + # Enacts a set action when the condition is triggered. + # For example: Boost "gShoe" when query full matches "Running Shoes". + # @!attribute [rw] name + # @return [::String] + # Immutable. Fully qualified name + # `projects/*/locations/global/catalogs/*/controls/*` + # @!attribute [rw] display_name + # @return [::String] + # Required. The human readable control display name. Used in Retail UI. + # + # This field must be a UTF-8 encoded string with a length limit of 128 + # characters. Otherwise, an INVALID_ARGUMENT error is thrown. + # @!attribute [r] associated_serving_config_ids + # @return [::Array<::String>] + # Output only. List of {::Google::Cloud::Retail::V2::ServingConfig serving config} + # ids that are associated with this control in the same + # {::Google::Cloud::Retail::V2::Catalog Catalog}. + # + # Note the association is managed via the + # {::Google::Cloud::Retail::V2::ServingConfig ServingConfig}, this is an output + # only denormalized view. + # @!attribute [rw] solution_types + # @return [::Array<::Google::Cloud::Retail::V2::SolutionType>] + # Required. Immutable. The solution types that the control is used for. + # Currently we support setting only one type of solution at creation time. + # + # Only `SOLUTION_TYPE_SEARCH` value is supported at the moment. + # If no solution type is provided at creation time, will default to + # {::Google::Cloud::Retail::V2::SolutionType::SOLUTION_TYPE_SEARCH SOLUTION_TYPE_SEARCH}. + # @!attribute [rw] search_solution_use_case + # @return [::Array<::Google::Cloud::Retail::V2::SearchSolutionUseCase>] + # Specifies the use case for the control. + # Affects what condition fields can be set. + # Only settable by search controls. + # Will default to + # {::Google::Cloud::Retail::V2::SearchSolutionUseCase::SEARCH_SOLUTION_USE_CASE_SEARCH SEARCH_SOLUTION_USE_CASE_SEARCH} + # if not specified. Currently only allow one search_solution_use_case per + # control. + class Control + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-retail-v2/proto_docs/google/cloud/retail/v2/control_service.rb b/owl-bot-staging/google-cloud-retail-v2/proto_docs/google/cloud/retail/v2/control_service.rb new file mode 100644 index 000000000000..317de6e4a175 --- /dev/null +++ b/owl-bot-staging/google-cloud-retail-v2/proto_docs/google/cloud/retail/v2/control_service.rb @@ -0,0 +1,122 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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 Retail + module V2 + # Request for CreateControl method. + # @!attribute [rw] parent + # @return [::String] + # Required. Full resource name of parent catalog. Format: + # `projects/{project_number}/locations/{location_id}/catalogs/{catalog_id}` + # @!attribute [rw] control + # @return [::Google::Cloud::Retail::V2::Control] + # Required. The Control to create. + # @!attribute [rw] control_id + # @return [::String] + # Required. The ID to use for the Control, which will become the final + # component of the Control's resource name. + # + # This value should be 4-63 characters, and valid characters + # are /[a-z][0-9]-_/. + class CreateControlRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Request for UpdateControl method. + # @!attribute [rw] control + # @return [::Google::Cloud::Retail::V2::Control] + # Required. The Control to update. + # @!attribute [rw] update_mask + # @return [::Google::Protobuf::FieldMask] + # Indicates which fields in the provided + # {::Google::Cloud::Retail::V2::Control Control} to update. The following are NOT + # supported: + # + # * {::Google::Cloud::Retail::V2::Control#name Control.name} + # + # If not set or empty, all supported fields are updated. + class UpdateControlRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Request for DeleteControl method. + # @!attribute [rw] name + # @return [::String] + # Required. The resource name of the Control to delete. Format: + # `projects/{project_number}/locations/{location_id}/catalogs/{catalog_id}/controls/{control_id}` + class DeleteControlRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Request for GetControl method. + # @!attribute [rw] name + # @return [::String] + # Required. The resource name of the Control to get. Format: + # `projects/{project_number}/locations/{location_id}/catalogs/{catalog_id}/controls/{control_id}` + class GetControlRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Request for ListControls method. + # @!attribute [rw] parent + # @return [::String] + # Required. The catalog resource name. Format: + # `projects/{project_number}/locations/{location_id}/catalogs/{catalog_id}` + # @!attribute [rw] page_size + # @return [::Integer] + # Optional. Maximum number of results to return. If unspecified, defaults + # to 50. Max allowed value is 1000. + # @!attribute [rw] page_token + # @return [::String] + # Optional. A page token, received from a previous `ListControls` call. + # Provide this to retrieve the subsequent page. + # @!attribute [rw] filter + # @return [::String] + # Optional. A filter to apply on the list results. Supported features: + # + # * List all the products under the parent branch if + # {::Google::Cloud::Retail::V2::ListControlsRequest#filter filter} is unset. + # * List controls that are used in a single ServingConfig: + # 'serving_config = "boosted_home_page_cvr"' + class ListControlsRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Response for ListControls method. + # @!attribute [rw] controls + # @return [::Array<::Google::Cloud::Retail::V2::Control>] + # All the Controls for a given catalog. + # @!attribute [rw] next_page_token + # @return [::String] + # Pagination token, if not returned indicates the last page. + class ListControlsResponse + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-retail-v2/proto_docs/google/cloud/retail/v2/conversational_search_service.rb b/owl-bot-staging/google-cloud-retail-v2/proto_docs/google/cloud/retail/v2/conversational_search_service.rb new file mode 100644 index 000000000000..5d3753d8f9ec --- /dev/null +++ b/owl-bot-staging/google-cloud-retail-v2/proto_docs/google/cloud/retail/v2/conversational_search_service.rb @@ -0,0 +1,358 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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 Retail + module V2 + # Request message for + # {::Google::Cloud::Retail::V2::ConversationalSearchService::Client#conversational_search ConversationalSearchService.ConversationalSearch} + # method. + # @!attribute [rw] placement + # @return [::String] + # Required. The resource name of the search engine placement, such as + # `projects/*/locations/global/catalogs/default_catalog/placements/default_search` + # or + # `projects/*/locations/global/catalogs/default_catalog/servingConfigs/default_serving_config` + # This field is used to identify the serving config name and the set + # of models that will be used to make the search. + # @!attribute [rw] branch + # @return [::String] + # Required. The branch resource name, such as + # `projects/*/locations/global/catalogs/default_catalog/branches/0`. + # + # Use "default_branch" as the branch ID or leave this field empty, to search + # products under the default branch. + # @!attribute [rw] query + # @return [::String] + # Optional. Raw search query to be searched for. + # + # If this field is empty, the request is considered a category browsing + # request. + # @!attribute [rw] page_categories + # @return [::Array<::String>] + # Optional. The categories associated with a category page. Must be set for + # category navigation queries to achieve good search quality. The format + # should be the same as + # {::Google::Cloud::Retail::V2::UserEvent#page_categories UserEvent.page_categories}; + # + # To represent full path of category, use '>' sign to separate different + # hierarchies. If '>' is part of the category name, replace it with + # other character(s). + # + # Category pages include special pages such as sales or promotions. For + # instance, a special sale page may have the category hierarchy: + # "pageCategories" : ["Sales > 2017 Black Friday Deals"]. + # @!attribute [rw] conversation_id + # @return [::String] + # Optional. This field specifies the conversation id, which maintains the + # state of the conversation between client side and server side. Use the + # value from the previous + # {::Google::Cloud::Retail::V2::ConversationalSearchResponse#conversation_id ConversationalSearchResponse.conversation_id}. + # For the initial request, this should be empty. + # @!attribute [rw] search_params + # @return [::Google::Cloud::Retail::V2::ConversationalSearchRequest::SearchParams] + # Optional. Search parameters. + # @!attribute [rw] visitor_id + # @return [::String] + # Required. A unique identifier for tracking visitors. For example, this + # could be implemented with an HTTP cookie, which should be able to uniquely + # identify a visitor on a single device. This unique identifier should not + # change if the visitor logs in or out of the website. + # + # This should be the same identifier as + # {::Google::Cloud::Retail::V2::UserEvent#visitor_id UserEvent.visitor_id}. + # + # The field must be a UTF-8 encoded string with a length limit of 128 + # characters. Otherwise, an INVALID_ARGUMENT error is returned. + # @!attribute [rw] user_info + # @return [::Google::Cloud::Retail::V2::UserInfo] + # Optional. User information. + # @!attribute [rw] conversational_filtering_spec + # @return [::Google::Cloud::Retail::V2::ConversationalSearchRequest::ConversationalFilteringSpec] + # Optional. This field specifies all conversational filtering related + # parameters. + # @!attribute [rw] user_labels + # @return [::Google::Protobuf::Map{::String => ::String}] + # Optional. The user labels applied to a resource must meet the following + # requirements: + # + # * Each resource can have multiple labels, up to a maximum of 64. + # * Each label must be a key-value pair. + # * Keys have a minimum length of 1 character and a maximum length of 63 + # characters and cannot be empty. Values can be empty and have a maximum + # length of 63 characters. + # * Keys and values can contain only lowercase letters, numeric characters, + # underscores, and dashes. All characters must use UTF-8 encoding, and + # international characters are allowed. + # * The key portion of a label must be unique. However, you can use the same + # key with multiple resources. + # * Keys must start with a lowercase letter or international character. + # + # See [Google Cloud + # Document](https://cloud.google.com/resource-manager/docs/creating-managing-labels#requirements) + # for more details. + # @!attribute [rw] safety_settings + # @return [::Array<::Google::Cloud::Retail::V2::SafetySetting>] + # Optional. The safety settings to be applied to the generated content. + class ConversationalSearchRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # Search parameters. + # @!attribute [rw] filter + # @return [::String] + # Optional. The filter string to restrict search results. + # + # The syntax of the filter string is the same as + # {::Google::Cloud::Retail::V2::SearchRequest#filter SearchRequest.filter}. + # @!attribute [rw] canonical_filter + # @return [::String] + # Optional. The canonical filter string to restrict search results. + # + # The syntax of the canonical filter string is the same as + # {::Google::Cloud::Retail::V2::SearchRequest#canonical_filter SearchRequest.canonical_filter}. + # @!attribute [rw] sort_by + # @return [::String] + # Optional. The sort string to specify the sorting of search results. + # + # The syntax of the sort string is the same as + # [SearchRequest.sort][]. + # @!attribute [rw] boost_spec + # @return [::Google::Cloud::Retail::V2::SearchRequest::BoostSpec] + # Optional. The boost spec to specify the boosting of search results. + # + # The syntax of the boost spec is the same as + # {::Google::Cloud::Retail::V2::SearchRequest#boost_spec SearchRequest.boost_spec}. + class SearchParams + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # This field specifies the current user answer during the conversational + # filtering search. This can be either user selected from suggested answers + # or user input plain text. + # @!attribute [rw] text_answer + # @return [::String] + # This field specifies the incremental input text from the user during + # the conversational search. + # + # Note: The following fields are mutually exclusive: `text_answer`, `selected_answer`. If a field in that set is populated, all other fields in the set will automatically be cleared. + # @!attribute [rw] selected_answer + # @return [::Google::Cloud::Retail::V2::ConversationalSearchRequest::UserAnswer::SelectedAnswer] + # Optional. This field specifies the selected answer during the + # conversational search. This should be a subset of + # [ConversationalSearchResponse.followup_question.suggested_answers][]. + # + # Note: The following fields are mutually exclusive: `selected_answer`, `text_answer`. If a field in that set is populated, all other fields in the set will automatically be cleared. + class UserAnswer + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # This field specifies the selected answers during the conversational + # search. + # @!attribute [rw] product_attribute_value + # @return [::Google::Cloud::Retail::V2::ProductAttributeValue] + # Optional. This field specifies the selected answer which is a attribute + # key-value. + class SelectedAnswer + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end + + # This field specifies all conversational filtering related parameters + # addition to conversational retail search. + # @!attribute [rw] enable_conversational_filtering + # @deprecated This field is deprecated and may be removed in the next major version update. + # @return [::Boolean] + # Optional. This field is deprecated. Please use + # {::Google::Cloud::Retail::V2::ConversationalSearchRequest::ConversationalFilteringSpec#conversational_filtering_mode ConversationalFilteringSpec.conversational_filtering_mode} + # instead. + # @!attribute [rw] user_answer + # @return [::Google::Cloud::Retail::V2::ConversationalSearchRequest::UserAnswer] + # Optional. This field specifies the current user answer during the + # conversational filtering search. It can be either user selected from + # suggested answers or user input plain text. + # @!attribute [rw] conversational_filtering_mode + # @return [::Google::Cloud::Retail::V2::ConversationalSearchRequest::ConversationalFilteringSpec::Mode] + # Optional. Mode to control Conversational Filtering. + # Defaults to + # {::Google::Cloud::Retail::V2::ConversationalSearchRequest::ConversationalFilteringSpec::Mode::DISABLED Mode.DISABLED} + # if it's unset. + class ConversationalFilteringSpec + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # Enum to control Conversational Filtering mode. + # A single conversation session including multiple turns supports modes for + # Conversational Search OR Conversational Filtering without + # Conversational Search, but not both. + module Mode + # Default value. + MODE_UNSPECIFIED = 0 + + # Disables Conversational Filtering when using Conversational Search. + DISABLED = 1 + + # Enables Conversational Filtering when using Conversational Search. + ENABLED = 2 + + # Enables Conversational Filtering without Conversational Search. + CONVERSATIONAL_FILTER_ONLY = 3 + end + end + + # @!attribute [rw] key + # @return [::String] + # @!attribute [rw] value + # @return [::String] + class UserLabelsEntry + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end + + # Response message for + # {::Google::Cloud::Retail::V2::ConversationalSearchService::Client#conversational_search ConversationalSearchService.ConversationalSearch} + # method. + # @!attribute [rw] user_query_types + # @return [::Array<::String>] + # The types Retail classifies the search query as. + # + # Supported values are: + # + # - "ORDER_SUPPORT" + # - "SIMPLE_PRODUCT_SEARCH" + # - "INTENT_REFINEMENT" + # - "PRODUCT_DETAILS" + # - "PRODUCT_COMPARISON" + # - "DEALS_AND_COUPONS" + # - "STORE_RELEVANT" + # - "BLOCKLISTED" + # - "BEST_PRODUCT" + # - "RETAIL_SUPPORT" + # - "DISABLED" + # @!attribute [rw] conversational_text_response + # @return [::String] + # The conversational answer-based text response generated by the Server. + # @!attribute [rw] followup_question + # @return [::Google::Cloud::Retail::V2::ConversationalSearchResponse::FollowupQuestion] + # The conversational followup question generated for Intent refinement. + # @!attribute [rw] conversation_id + # @return [::String] + # Conversation UUID. This field will be stored in client side storage to + # maintain the conversation session with server and will be used for next + # search request's + # {::Google::Cloud::Retail::V2::ConversationalSearchRequest#conversation_id ConversationalSearchRequest.conversation_id} + # to restore conversation state in server. + # @!attribute [rw] refined_search + # @return [::Array<::Google::Cloud::Retail::V2::ConversationalSearchResponse::RefinedSearch>] + # The proposed refined search queries. They can be used to fetch the relevant + # search results. When using CONVERSATIONAL_FILTER_ONLY mode, the + # refined_query from search response will be populated here. + # @!attribute [rw] conversational_filtering_result + # @return [::Google::Cloud::Retail::V2::ConversationalSearchResponse::ConversationalFilteringResult] + # This field specifies all related information that is needed on client + # side for UI rendering of conversational filtering search. + # @!attribute [r] state + # @return [::Google::Cloud::Retail::V2::ConversationalSearchResponse::State] + # Output only. The state of the response generation. + class ConversationalSearchResponse + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # The conversational followup question generated for Intent refinement. + # @!attribute [rw] followup_question + # @return [::String] + # The conversational followup question generated for Intent refinement. + # @!attribute [rw] suggested_answers + # @return [::Array<::Google::Cloud::Retail::V2::ConversationalSearchResponse::FollowupQuestion::SuggestedAnswer>] + # The answer options provided to client for the follow-up question. + class FollowupQuestion + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # Suggested answers to the follow-up question. + # If it's numerical attribute, only ProductAttributeInterval will be set. + # If it's textual attribute, only productAttributeValue will be set. + # @!attribute [rw] product_attribute_value + # @return [::Google::Cloud::Retail::V2::ProductAttributeValue] + # Product attribute value, including an attribute key and an + # attribute value. Other types can be added here in the future. + class SuggestedAnswer + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end + + # The proposed refined search for intent-refinement/bundled shopping + # conversation. When using CONVERSATIONAL_FILTER_ONLY mode, the + # refined_query from search response will be populated here. + # @!attribute [rw] query + # @return [::String] + # The query to be used for search. + class RefinedSearch + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # This field specifies all related information that is needed on client + # side for UI rendering of conversational filtering search. + # @!attribute [rw] followup_question + # @return [::Google::Cloud::Retail::V2::ConversationalSearchResponse::FollowupQuestion] + # The conversational filtering question. + # @!attribute [rw] additional_filter + # @return [::Google::Cloud::Retail::V2::ConversationalSearchResponse::ConversationalFilteringResult::AdditionalFilter] + # This is the incremental additional filters implied from the current + # user answer. User should add the suggested addition filters to the + # previous [ConversationalSearchRequest.search_params.filter][] and + # {::Google::Cloud::Retail::V2::SearchRequest#filter SearchRequest.filter}, and + # use the merged filter in the follow up requests. + class ConversationalFilteringResult + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # Additional filter that client side need to apply. + # @!attribute [rw] product_attribute_value + # @return [::Google::Cloud::Retail::V2::ProductAttributeValue] + # Product attribute value, including an attribute key and an + # attribute value. Other types can be added here in the future. + class AdditionalFilter + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end + + # The state of the response generation. + module State + # Unknown. + STATE_UNSPECIFIED = 0 + + # Response generation is being streamed. + STREAMING = 1 + + # Response generation has succeeded. + SUCCEEDED = 2 + end + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-retail-v2/proto_docs/google/cloud/retail/v2/export_config.rb b/owl-bot-staging/google-cloud-retail-v2/proto_docs/google/cloud/retail/v2/export_config.rb new file mode 100644 index 000000000000..913e07ef4121 --- /dev/null +++ b/owl-bot-staging/google-cloud-retail-v2/proto_docs/google/cloud/retail/v2/export_config.rb @@ -0,0 +1,184 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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 Retail + module V2 + # The output configuration setting. + # @!attribute [rw] gcs_destination + # @return [::Google::Cloud::Retail::V2::OutputConfig::GcsDestination] + # The Google Cloud Storage location where the output is to be written to. + # + # Note: The following fields are mutually exclusive: `gcs_destination`, `bigquery_destination`. If a field in that set is populated, all other fields in the set will automatically be cleared. + # @!attribute [rw] bigquery_destination + # @return [::Google::Cloud::Retail::V2::OutputConfig::BigQueryDestination] + # The BigQuery location where the output is to be written to. + # + # Note: The following fields are mutually exclusive: `bigquery_destination`, `gcs_destination`. If a field in that set is populated, all other fields in the set will automatically be cleared. + class OutputConfig + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # The Google Cloud Storage output destination configuration. + # @!attribute [rw] output_uri_prefix + # @return [::String] + # Required. The output uri prefix for saving output data to json files. + # Some mapping examples are as follows: + # output_uri_prefix sample output(assuming the object is foo.json) + # ======================== ============================================= + # gs://bucket/ gs://bucket/foo.json + # gs://bucket/folder/ gs://bucket/folder/foo.json + # gs://bucket/folder/item_ gs://bucket/folder/item_foo.json + class GcsDestination + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # The BigQuery output destination configuration. + # @!attribute [rw] dataset_id + # @return [::String] + # Required. The ID of a BigQuery Dataset. + # @!attribute [rw] table_id_prefix + # @return [::String] + # Required. The prefix of exported BigQuery tables. + # @!attribute [rw] table_type + # @return [::String] + # Required. Describes the table type. The following values are supported: + # + # * `table`: A BigQuery native table. + # * `view`: A virtual table defined by a SQL query. + class BigQueryDestination + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end + + # Configuration of destination for Export related errors. + # @!attribute [rw] gcs_prefix + # @return [::String] + # Google Cloud Storage path for import errors. This must be an empty, + # existing Cloud Storage bucket. Export errors will be written to a file in + # this bucket, one per line, as a JSON-encoded + # `google.rpc.Status` message. + class ExportErrorsConfig + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Request message for the `ExportAnalyticsMetrics` method. + # @!attribute [rw] catalog + # @return [::String] + # Required. Full resource name of the parent catalog. + # Expected format: `projects/*/locations/*/catalogs/*` + # @!attribute [rw] output_config + # @return [::Google::Cloud::Retail::V2::OutputConfig] + # Required. The output location of the data. + # @!attribute [rw] filter + # @return [::String] + # A filtering expression to specify restrictions on returned metrics. + # The expression is a sequence of terms. Each term applies a restriction to + # the returned metrics. Use this expression to restrict results to a + # specific time range. + # + # Currently we expect only one types of fields: + # + # * `timestamp`: This can be specified twice, once with a + # less than operator and once with a greater than operator. The + # `timestamp` restriction should result in one, contiguous, valid, + # `timestamp` range. + # + # Some examples of valid filters expressions: + # + # * Example 1: `timestamp > "2012-04-23T18:25:43.511Z" + # timestamp < "2012-04-23T18:30:43.511Z"` + # * Example 2: `timestamp > "2012-04-23T18:25:43.511Z"` + class ExportAnalyticsMetricsRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Metadata related to the progress of the Export operation. This is + # returned by the google.longrunning.Operation.metadata field. + # @!attribute [rw] create_time + # @return [::Google::Protobuf::Timestamp] + # Operation create time. + # @!attribute [rw] update_time + # @return [::Google::Protobuf::Timestamp] + # Operation last update time. If the operation is done, this is also the + # finish time. + class ExportMetadata + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Response of the ExportAnalyticsMetricsRequest. If the long running + # operation was successful, then this message is returned by the + # google.longrunning.Operations.response field if the operation was successful. + # @!attribute [rw] error_samples + # @return [::Array<::Google::Rpc::Status>] + # A sample of errors encountered while processing the request. + # @!attribute [rw] errors_config + # @return [::Google::Cloud::Retail::V2::ExportErrorsConfig] + # This field is never set. + # @!attribute [rw] output_result + # @return [::Google::Cloud::Retail::V2::OutputResult] + # Output result indicating where the data were exported to. + class ExportAnalyticsMetricsResponse + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Output result that stores the information about where the exported data is + # stored. + # @!attribute [rw] bigquery_result + # @return [::Array<::Google::Cloud::Retail::V2::BigQueryOutputResult>] + # The BigQuery location where the result is stored. + # @!attribute [rw] gcs_result + # @return [::Array<::Google::Cloud::Retail::V2::GcsOutputResult>] + # The Google Cloud Storage location where the result is stored. + class OutputResult + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # A BigQuery output result. + # @!attribute [rw] dataset_id + # @return [::String] + # The ID of a BigQuery Dataset. + # @!attribute [rw] table_id + # @return [::String] + # The ID of a BigQuery Table. + class BigQueryOutputResult + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # A Gcs output result. + # @!attribute [rw] output_uri + # @return [::String] + # The uri of Gcs output + class GcsOutputResult + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-retail-v2/proto_docs/google/cloud/retail/v2/generative_question.rb b/owl-bot-staging/google-cloud-retail-v2/proto_docs/google/cloud/retail/v2/generative_question.rb new file mode 100644 index 000000000000..7a58a54f8f3c --- /dev/null +++ b/owl-bot-staging/google-cloud-retail-v2/proto_docs/google/cloud/retail/v2/generative_question.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 Cloud + module Retail + module V2 + # Configuration for overall generative question feature state. + # @!attribute [rw] catalog + # @return [::String] + # Required. Resource name of the affected catalog. + # Format: projects/\\{project}/locations/\\{location}/catalogs/\\{catalog} + # @!attribute [rw] feature_enabled + # @return [::Boolean] + # Optional. Determines whether questions will be used at serving time. + # Note: This feature cannot be enabled until initial data requirements are + # satisfied. + # @!attribute [rw] minimum_products + # @return [::Integer] + # Optional. Minimum number of products in the response to trigger follow-up + # questions. Value must be 0 or positive. + class GenerativeQuestionsFeatureConfig + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Configuration for a single generated question. + # @!attribute [rw] catalog + # @return [::String] + # Required. Resource name of the catalog. + # Format: projects/\\{project}/locations/\\{location}/catalogs/\\{catalog} + # @!attribute [rw] facet + # @return [::String] + # Required. The facet to which the question is associated. + # @!attribute [r] generated_question + # @return [::String] + # Output only. The LLM generated question. + # @!attribute [rw] final_question + # @return [::String] + # Optional. The question that will be used at serving time. + # Question can have a max length of 300 bytes. + # When not populated, generated_question should be used. + # @!attribute [r] example_values + # @return [::Array<::String>] + # Output only. Values that can be used to answer the question. + # @!attribute [r] frequency + # @return [::Float] + # Output only. The ratio of how often a question was asked. + # @!attribute [rw] allowed_in_conversation + # @return [::Boolean] + # Optional. Whether the question is asked at serving time. + class GenerativeQuestionConfig + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-retail-v2/proto_docs/google/cloud/retail/v2/generative_question_service.rb b/owl-bot-staging/google-cloud-retail-v2/proto_docs/google/cloud/retail/v2/generative_question_service.rb new file mode 100644 index 000000000000..dcd3144bc211 --- /dev/null +++ b/owl-bot-staging/google-cloud-retail-v2/proto_docs/google/cloud/retail/v2/generative_question_service.rb @@ -0,0 +1,109 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + + +module Google + module Cloud + module Retail + module V2 + # Request for UpdateGenerativeQuestionsFeatureConfig method. + # @!attribute [rw] generative_questions_feature_config + # @return [::Google::Cloud::Retail::V2::GenerativeQuestionsFeatureConfig] + # Required. The configuration managing the feature state. + # @!attribute [rw] update_mask + # @return [::Google::Protobuf::FieldMask] + # Optional. Indicates which fields in the provided + # {::Google::Cloud::Retail::V2::GenerativeQuestionsFeatureConfig GenerativeQuestionsFeatureConfig} + # to update. If not set or empty, all supported fields are updated. + class UpdateGenerativeQuestionsFeatureConfigRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Request for GetGenerativeQuestionsFeatureConfig method. + # @!attribute [rw] catalog + # @return [::String] + # Required. Resource name of the parent catalog. + # Format: projects/\\{project}/locations/\\{location}/catalogs/\\{catalog} + class GetGenerativeQuestionsFeatureConfigRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Request for ListQuestions method. + # @!attribute [rw] parent + # @return [::String] + # Required. Resource name of the parent catalog. + # Format: projects/\\{project}/locations/\\{location}/catalogs/\\{catalog} + class ListGenerativeQuestionConfigsRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Response for ListQuestions method. + # @!attribute [rw] generative_question_configs + # @return [::Array<::Google::Cloud::Retail::V2::GenerativeQuestionConfig>] + # All the questions for a given catalog. + class ListGenerativeQuestionConfigsResponse + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Request for UpdateGenerativeQuestionConfig method. + # @!attribute [rw] generative_question_config + # @return [::Google::Cloud::Retail::V2::GenerativeQuestionConfig] + # Required. The question to update. + # @!attribute [rw] update_mask + # @return [::Google::Protobuf::FieldMask] + # Optional. Indicates which fields in the provided + # {::Google::Cloud::Retail::V2::GenerativeQuestionConfig GenerativeQuestionConfig} + # to update. The following are NOT supported: + # + # * {::Google::Cloud::Retail::V2::GenerativeQuestionConfig#frequency GenerativeQuestionConfig.frequency} + # + # If not set or empty, all supported fields are updated. + class UpdateGenerativeQuestionConfigRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Request for BatchUpdateGenerativeQuestionConfig method. + # @!attribute [rw] parent + # @return [::String] + # Optional. Resource name of the parent catalog. + # Format: projects/\\{project}/locations/\\{location}/catalogs/\\{catalog} + # @!attribute [rw] requests + # @return [::Array<::Google::Cloud::Retail::V2::UpdateGenerativeQuestionConfigRequest>] + # Required. The updates question configs. + class BatchUpdateGenerativeQuestionConfigsRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Aggregated response for UpdateGenerativeQuestionConfig method. + # @!attribute [rw] generative_question_configs + # @return [::Array<::Google::Cloud::Retail::V2::GenerativeQuestionConfig>] + # Optional. The updates question configs. + class BatchUpdateGenerativeQuestionConfigsResponse + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-retail-v2/proto_docs/google/cloud/retail/v2/import_config.rb b/owl-bot-staging/google-cloud-retail-v2/proto_docs/google/cloud/retail/v2/import_config.rb new file mode 100644 index 000000000000..e95a50d7e11c --- /dev/null +++ b/owl-bot-staging/google-cloud-retail-v2/proto_docs/google/cloud/retail/v2/import_config.rb @@ -0,0 +1,404 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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 Retail + module V2 + # Google Cloud Storage location for input content. + # @!attribute [rw] input_uris + # @return [::Array<::String>] + # Required. Google Cloud Storage URIs to input files. URI can be up to + # 2000 characters long. URIs can match the full object path (for example, + # `gs://bucket/directory/object.json`) or a pattern matching one or more + # files, such as `gs://bucket/directory/*.json`. A request can + # contain at most 100 files, and each file can be up to 2 GB. See + # [Importing product + # information](https://cloud.google.com/retail/recommendations-ai/docs/upload-catalog) + # for the expected file format and setup instructions. + # @!attribute [rw] data_schema + # @return [::String] + # The schema to use when parsing the data from the source. + # + # Supported values for product imports: + # + # * `product` (default): One JSON {::Google::Cloud::Retail::V2::Product Product} + # per line. Each product must + # have a valid {::Google::Cloud::Retail::V2::Product#id Product.id}. + # * `product_merchant_center`: See [Importing catalog data from Merchant + # Center](https://cloud.google.com/retail/recommendations-ai/docs/upload-catalog#mc). + # + # Supported values for user events imports: + # + # * `user_event` (default): One JSON + # {::Google::Cloud::Retail::V2::UserEvent UserEvent} per line. + # * `user_event_ga360`: Using + # https://support.google.com/analytics/answer/3437719. + # + # Supported values for control imports: + # + # * `control` (default): One JSON {::Google::Cloud::Retail::V2::Control Control} + # per line. + # + # Supported values for catalog attribute imports: + # + # * `catalog_attribute` (default): One CSV + # {::Google::Cloud::Retail::V2::CatalogAttribute CatalogAttribute} per line. + class GcsSource + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # BigQuery source import data from. + # @!attribute [rw] partition_date + # @return [::Google::Type::Date] + # BigQuery time partitioned table's _PARTITIONDATE in YYYY-MM-DD format. + # @!attribute [rw] project_id + # @return [::String] + # The project ID (can be project # or ID) that the BigQuery source is in with + # a length limit of 128 characters. If not specified, inherits the project + # ID from the parent request. + # @!attribute [rw] dataset_id + # @return [::String] + # Required. The BigQuery data set to copy the data from with a length limit + # of 1,024 characters. + # @!attribute [rw] table_id + # @return [::String] + # Required. The BigQuery table to copy the data from with a length limit of + # 1,024 characters. + # @!attribute [rw] gcs_staging_dir + # @return [::String] + # Intermediate Cloud Storage directory used for the import with a length + # limit of 2,000 characters. Can be specified if one wants to have the + # BigQuery export to a specific Cloud Storage directory. + # @!attribute [rw] data_schema + # @return [::String] + # The schema to use when parsing the data from the source. + # + # Supported values for product imports: + # + # * `product` (default): One JSON {::Google::Cloud::Retail::V2::Product Product} + # per line. Each product must + # have a valid {::Google::Cloud::Retail::V2::Product#id Product.id}. + # * `product_merchant_center`: See [Importing catalog data from Merchant + # Center](https://cloud.google.com/retail/recommendations-ai/docs/upload-catalog#mc). + # + # Supported values for user events imports: + # + # * `user_event` (default): One JSON + # {::Google::Cloud::Retail::V2::UserEvent UserEvent} per line. + # * `user_event_ga360`: + # The schema is available here: + # https://support.google.com/analytics/answer/3437719. + # * `user_event_ga4`: + # The schema is available here: + # https://support.google.com/analytics/answer/7029846. + # + # Supported values for autocomplete imports: + # + # * `suggestions` (default): One JSON completion suggestion per line. + # * `denylist`: One JSON deny suggestion per line. + # * `allowlist`: One JSON allow suggestion per line. + class BigQuerySource + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # The inline source for the input config for ImportProducts method. + # @!attribute [rw] products + # @return [::Array<::Google::Cloud::Retail::V2::Product>] + # Required. A list of products to update/create. Each product must have a + # valid {::Google::Cloud::Retail::V2::Product#id Product.id}. Recommended max of + # 100 items. + class ProductInlineSource + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # The inline source for the input config for ImportUserEvents method. + # @!attribute [rw] user_events + # @return [::Array<::Google::Cloud::Retail::V2::UserEvent>] + # Required. A list of user events to import. Recommended max of 10k items. + class UserEventInlineSource + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Configuration of destination for Import related errors. + # @!attribute [rw] gcs_prefix + # @return [::String] + # Google Cloud Storage prefix for import errors. This must be an empty, + # existing Cloud Storage directory. Import errors are written to + # sharded files in this directory, one per line, as a JSON-encoded + # `google.rpc.Status` message. + class ImportErrorsConfig + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Request message for Import methods. + # @!attribute [rw] parent + # @return [::String] + # Required. + # `projects/1234/locations/global/catalogs/default_catalog/branches/default_branch` + # + # If no updateMask is specified, requires products.create permission. + # If updateMask is specified, requires products.update permission. + # @!attribute [rw] request_id + # @deprecated This field is deprecated and may be removed in the next major version update. + # @return [::String] + # Deprecated. This field has no effect. + # @!attribute [rw] input_config + # @return [::Google::Cloud::Retail::V2::ProductInputConfig] + # Required. The desired input location of the data. + # @!attribute [rw] errors_config + # @return [::Google::Cloud::Retail::V2::ImportErrorsConfig] + # The desired location of errors incurred during the Import. + # @!attribute [rw] update_mask + # @return [::Google::Protobuf::FieldMask] + # Indicates which fields in the provided imported `products` to update. If + # not set, all fields are updated. If provided, only the existing product + # fields are updated. Missing products will not be created. + # @!attribute [rw] reconciliation_mode + # @return [::Google::Cloud::Retail::V2::ImportProductsRequest::ReconciliationMode] + # The mode of reconciliation between existing products and the products to be + # imported. Defaults to + # {::Google::Cloud::Retail::V2::ImportProductsRequest::ReconciliationMode::INCREMENTAL ReconciliationMode.INCREMENTAL}. + # @!attribute [rw] notification_pubsub_topic + # @return [::String] + # Full Pub/Sub topic name for receiving notification. If this field is set, + # when the import is finished, a notification is sent to + # specified Pub/Sub topic. The message data is JSON string of a + # {::Google::Longrunning::Operation Operation}. + # + # Format of the Pub/Sub topic is `projects/{project}/topics/{topic}`. It has + # to be within the same project as + # {::Google::Cloud::Retail::V2::ImportProductsRequest#parent ImportProductsRequest.parent}. + # Make sure that both + # `cloud-retail-customer-data-access@system.gserviceaccount.com` and + # `service-@gcp-sa-retail.iam.gserviceaccount.com` + # have the `pubsub.topics.publish` IAM permission on the topic. + # + # Only supported when + # {::Google::Cloud::Retail::V2::ImportProductsRequest#reconciliation_mode ImportProductsRequest.reconciliation_mode} + # is set to `FULL`. + class ImportProductsRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # Indicates how imported products are reconciled with the existing products + # created or imported before. + module ReconciliationMode + # Defaults to INCREMENTAL. + RECONCILIATION_MODE_UNSPECIFIED = 0 + + # Inserts new products or updates existing products. + INCREMENTAL = 1 + + # Calculates diff and replaces the entire product dataset. Existing + # products may be deleted if they are not present in the source location. + FULL = 2 + end + end + + # Request message for the ImportUserEvents request. + # @!attribute [rw] parent + # @return [::String] + # Required. `projects/1234/locations/global/catalogs/default_catalog` + # @!attribute [rw] input_config + # @return [::Google::Cloud::Retail::V2::UserEventInputConfig] + # Required. The desired input location of the data. + # @!attribute [rw] errors_config + # @return [::Google::Cloud::Retail::V2::ImportErrorsConfig] + # The desired location of errors incurred during the Import. Cannot be set + # for inline user event imports. + class ImportUserEventsRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Request message for ImportCompletionData methods. + # @!attribute [rw] parent + # @return [::String] + # Required. The catalog which the suggestions dataset belongs to. + # + # Format: `projects/1234/locations/global/catalogs/default_catalog`. + # @!attribute [rw] input_config + # @return [::Google::Cloud::Retail::V2::CompletionDataInputConfig] + # Required. The desired input location of the data. + # @!attribute [rw] notification_pubsub_topic + # @return [::String] + # Pub/Sub topic for receiving notification. If this field is set, + # when the import is finished, a notification is sent to + # specified Pub/Sub topic. The message data is JSON string of a + # {::Google::Longrunning::Operation Operation}. + # Format of the Pub/Sub topic is `projects/{project}/topics/{topic}`. + class ImportCompletionDataRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # The input config source for products. + # @!attribute [rw] product_inline_source + # @return [::Google::Cloud::Retail::V2::ProductInlineSource] + # The Inline source for the input content for products. + # + # Note: The following fields are mutually exclusive: `product_inline_source`, `gcs_source`, `big_query_source`. If a field in that set is populated, all other fields in the set will automatically be cleared. + # @!attribute [rw] gcs_source + # @return [::Google::Cloud::Retail::V2::GcsSource] + # Google Cloud Storage location for the input content. + # + # Note: The following fields are mutually exclusive: `gcs_source`, `product_inline_source`, `big_query_source`. If a field in that set is populated, all other fields in the set will automatically be cleared. + # @!attribute [rw] big_query_source + # @return [::Google::Cloud::Retail::V2::BigQuerySource] + # BigQuery input source. + # + # Note: The following fields are mutually exclusive: `big_query_source`, `product_inline_source`, `gcs_source`. If a field in that set is populated, all other fields in the set will automatically be cleared. + class ProductInputConfig + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # The input config source for user events. + # @!attribute [rw] user_event_inline_source + # @return [::Google::Cloud::Retail::V2::UserEventInlineSource] + # Required. The Inline source for the input content for UserEvents. + # + # Note: The following fields are mutually exclusive: `user_event_inline_source`, `gcs_source`, `big_query_source`. If a field in that set is populated, all other fields in the set will automatically be cleared. + # @!attribute [rw] gcs_source + # @return [::Google::Cloud::Retail::V2::GcsSource] + # Required. Google Cloud Storage location for the input content. + # + # Note: The following fields are mutually exclusive: `gcs_source`, `user_event_inline_source`, `big_query_source`. If a field in that set is populated, all other fields in the set will automatically be cleared. + # @!attribute [rw] big_query_source + # @return [::Google::Cloud::Retail::V2::BigQuerySource] + # Required. BigQuery input source. + # + # Note: The following fields are mutually exclusive: `big_query_source`, `user_event_inline_source`, `gcs_source`. If a field in that set is populated, all other fields in the set will automatically be cleared. + class UserEventInputConfig + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # The input config source for completion data. + # @!attribute [rw] big_query_source + # @return [::Google::Cloud::Retail::V2::BigQuerySource] + # Required. BigQuery input source. + # + # Add the IAM permission "BigQuery Data Viewer" for + # cloud-retail-customer-data-access@system.gserviceaccount.com before + # using this feature otherwise an error is thrown. + class CompletionDataInputConfig + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Metadata related to the progress of the Import operation. This is + # returned by the google.longrunning.Operation.metadata field. + # @!attribute [rw] create_time + # @return [::Google::Protobuf::Timestamp] + # Operation create time. + # @!attribute [rw] update_time + # @return [::Google::Protobuf::Timestamp] + # Operation last update time. If the operation is done, this is also the + # finish time. + # @!attribute [rw] success_count + # @return [::Integer] + # Count of entries that were processed successfully. + # @!attribute [rw] failure_count + # @return [::Integer] + # Count of entries that encountered errors while processing. + # @!attribute [rw] request_id + # @deprecated This field is deprecated and may be removed in the next major version update. + # @return [::String] + # Deprecated. This field is never set. + # @!attribute [rw] notification_pubsub_topic + # @return [::String] + # Pub/Sub topic for receiving notification. If this field is set, + # when the import is finished, a notification is sent to + # specified Pub/Sub topic. The message data is JSON string of a + # {::Google::Longrunning::Operation Operation}. + # Format of the Pub/Sub topic is `projects/{project}/topics/{topic}`. + class ImportMetadata + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Response of the + # {::Google::Cloud::Retail::V2::ImportProductsRequest ImportProductsRequest}. If the + # long running operation is done, then this message is returned by the + # google.longrunning.Operations.response field if the operation was successful. + # @!attribute [rw] error_samples + # @return [::Array<::Google::Rpc::Status>] + # A sample of errors encountered while processing the request. + # @!attribute [rw] errors_config + # @return [::Google::Cloud::Retail::V2::ImportErrorsConfig] + # Echoes the destination for the complete errors in the request if set. + class ImportProductsResponse + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Response of the ImportUserEventsRequest. If the long running + # operation was successful, then this message is returned by the + # google.longrunning.Operations.response field if the operation was successful. + # @!attribute [rw] error_samples + # @return [::Array<::Google::Rpc::Status>] + # A sample of errors encountered while processing the request. + # @!attribute [rw] errors_config + # @return [::Google::Cloud::Retail::V2::ImportErrorsConfig] + # Echoes the destination for the complete errors if this field was set in + # the request. + # @!attribute [rw] import_summary + # @return [::Google::Cloud::Retail::V2::UserEventImportSummary] + # Aggregated statistics of user event import status. + class ImportUserEventsResponse + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # A summary of import result. The UserEventImportSummary summarizes + # the import status for user events. + # @!attribute [rw] joined_events_count + # @return [::Integer] + # Count of user events imported with complete existing catalog information. + # @!attribute [rw] unjoined_events_count + # @return [::Integer] + # Count of user events imported, but with catalog information not found + # in the imported catalog. + class UserEventImportSummary + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Response of the + # {::Google::Cloud::Retail::V2::ImportCompletionDataRequest ImportCompletionDataRequest}. + # If the long running operation is done, this message is returned by the + # google.longrunning.Operations.response field if the operation is successful. + # @!attribute [rw] error_samples + # @return [::Array<::Google::Rpc::Status>] + # A sample of errors encountered while processing the request. + class ImportCompletionDataResponse + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-retail-v2/proto_docs/google/cloud/retail/v2/model.rb b/owl-bot-staging/google-cloud-retail-v2/proto_docs/google/cloud/retail/v2/model.rb new file mode 100644 index 000000000000..76ac3160ed3b --- /dev/null +++ b/owl-bot-staging/google-cloud-retail-v2/proto_docs/google/cloud/retail/v2/model.rb @@ -0,0 +1,267 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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 Retail + module V2 + # Metadata that describes the training and serving parameters of a + # {::Google::Cloud::Retail::V2::Model Model}. A + # {::Google::Cloud::Retail::V2::Model Model} can be associated with a + # {::Google::Cloud::Retail::V2::ServingConfig ServingConfig} and then queried + # through the Predict API. + # @!attribute [rw] name + # @return [::String] + # Required. The fully qualified resource name of the model. + # + # Format: + # `projects/{project_number}/locations/{location_id}/catalogs/{catalog_id}/models/{model_id}` + # catalog_id has char limit of 50. + # recommendation_model_id has char limit of 40. + # @!attribute [rw] display_name + # @return [::String] + # Required. The display name of the model. + # + # Should be human readable, used to display Recommendation Models in the + # Retail Cloud Console Dashboard. UTF-8 encoded string with limit of 1024 + # characters. + # @!attribute [rw] training_state + # @return [::Google::Cloud::Retail::V2::Model::TrainingState] + # Optional. The training state that the model is in (e.g. + # `TRAINING` or `PAUSED`). + # + # Since part of the cost of running the service + # is frequency of training - this can be used to determine when to train + # model in order to control cost. If not specified: the default value for + # `CreateModel` method is `TRAINING`. The default value for + # `UpdateModel` method is to keep the state the same as before. + # @!attribute [r] serving_state + # @return [::Google::Cloud::Retail::V2::Model::ServingState] + # Output only. The serving state of the model: `ACTIVE`, `NOT_ACTIVE`. + # @!attribute [r] create_time + # @return [::Google::Protobuf::Timestamp] + # Output only. Timestamp the Recommendation Model was created at. + # @!attribute [r] update_time + # @return [::Google::Protobuf::Timestamp] + # Output only. Timestamp the Recommendation Model was last updated. E.g. + # if a Recommendation Model was paused - this would be the time the pause was + # initiated. + # @!attribute [rw] type + # @return [::String] + # Required. The type of model e.g. `home-page`. + # + # Currently supported values: `recommended-for-you`, `others-you-may-like`, + # `frequently-bought-together`, `page-optimization`, `similar-items`, + # `buy-it-again`, `on-sale-items`, and `recently-viewed`(readonly value). + # + # This field together with + # {::Google::Cloud::Retail::V2::Model#optimization_objective optimization_objective} + # describe model metadata to use to control model training and serving. + # See https://cloud.google.com/retail/docs/models + # for more details on what the model metadata control and which combination + # of parameters are valid. For invalid combinations of parameters (e.g. type + # = `frequently-bought-together` and optimization_objective = `ctr`), you + # receive an error 400 if you try to create/update a recommendation with + # this set of knobs. + # @!attribute [rw] optimization_objective + # @return [::String] + # Optional. The optimization objective e.g. `cvr`. + # + # Currently supported + # values: `ctr`, `cvr`, `revenue-per-order`. + # + # If not specified, we choose default based on model type. + # Default depends on type of recommendation: + # + # `recommended-for-you` => `ctr` + # + # `others-you-may-like` => `ctr` + # + # `frequently-bought-together` => `revenue_per_order` + # + # This field together with + # {::Google::Cloud::Retail::V2::Model#type optimization_objective} + # describe model metadata to use to control model training and serving. + # See https://cloud.google.com/retail/docs/models + # for more details on what the model metadata control and which combination + # of parameters are valid. For invalid combinations of parameters (e.g. type + # = `frequently-bought-together` and optimization_objective = `ctr`), you + # receive an error 400 if you try to create/update a recommendation with + # this set of knobs. + # @!attribute [rw] periodic_tuning_state + # @return [::Google::Cloud::Retail::V2::Model::PeriodicTuningState] + # Optional. The state of periodic tuning. + # + # The period we use is 3 months - to do a + # one-off tune earlier use the `TuneModel` method. Default value + # is `PERIODIC_TUNING_ENABLED`. + # @!attribute [r] last_tune_time + # @return [::Google::Protobuf::Timestamp] + # Output only. The timestamp when the latest successful tune finished. + # @!attribute [r] tuning_operation + # @return [::String] + # Output only. The tune operation associated with the model. + # + # Can be used to determine if there is an ongoing tune for this + # recommendation. Empty field implies no tune is goig on. + # @!attribute [r] data_state + # @return [::Google::Cloud::Retail::V2::Model::DataState] + # Output only. The state of data requirements for this model: `DATA_OK` and + # `DATA_ERROR`. + # + # Recommendation model cannot be trained if the data is in + # `DATA_ERROR` state. Recommendation model can have `DATA_ERROR` state even + # if serving state is `ACTIVE`: models were trained successfully before, but + # cannot be refreshed because model no longer has sufficient + # data for training. + # @!attribute [rw] filtering_option + # @return [::Google::Cloud::Retail::V2::RecommendationsFilteringOption] + # Optional. If `RECOMMENDATIONS_FILTERING_ENABLED`, recommendation filtering + # by attributes is enabled for the model. + # @!attribute [r] serving_config_lists + # @return [::Array<::Google::Cloud::Retail::V2::Model::ServingConfigList>] + # Output only. The list of valid serving configs associated with the + # PageOptimizationConfig. + # @!attribute [rw] model_features_config + # @return [::Google::Cloud::Retail::V2::Model::ModelFeaturesConfig] + # Optional. Additional model features config. + class Model + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # Represents an ordered combination of valid serving configs, which + # can be used for `PAGE_OPTIMIZATION` recommendations. + # @!attribute [rw] serving_config_ids + # @return [::Array<::String>] + # Optional. A set of valid serving configs that may be used for + # `PAGE_OPTIMIZATION`. + class ServingConfigList + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Additional configs for the frequently-bought-together model type. + # @!attribute [rw] context_products_type + # @return [::Google::Cloud::Retail::V2::Model::ContextProductsType] + # Optional. Specifies the context of the model when it is used in predict + # requests. Can only be set for the `frequently-bought-together` type. If + # it isn't specified, it defaults to + # {::Google::Cloud::Retail::V2::Model::ContextProductsType::MULTIPLE_CONTEXT_PRODUCTS MULTIPLE_CONTEXT_PRODUCTS}. + class FrequentlyBoughtTogetherFeaturesConfig + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Additional model features config. + # @!attribute [rw] frequently_bought_together_config + # @return [::Google::Cloud::Retail::V2::Model::FrequentlyBoughtTogetherFeaturesConfig] + # Additional configs for frequently-bought-together models. + class ModelFeaturesConfig + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # The serving state of the model. + module ServingState + # Unspecified serving state. + SERVING_STATE_UNSPECIFIED = 0 + + # The model is not serving. + INACTIVE = 1 + + # The model is serving and can be queried. + ACTIVE = 2 + + # The model is trained on tuned hyperparameters and can be + # queried. + TUNED = 3 + end + + # The training state of the model. + module TrainingState + # Unspecified training state. + TRAINING_STATE_UNSPECIFIED = 0 + + # The model training is paused. + PAUSED = 1 + + # The model is training. + TRAINING = 2 + end + + # Describes whether periodic tuning is enabled for this model + # or not. Periodic tuning is scheduled at most every three months. You can + # start a tuning process manually by using the `TuneModel` + # method, which starts a tuning process immediately and resets the quarterly + # schedule. Enabling or disabling periodic tuning does not affect any + # current tuning processes. + module PeriodicTuningState + # Unspecified default value, should never be explicitly set. + PERIODIC_TUNING_STATE_UNSPECIFIED = 0 + + # The model has periodic tuning disabled. Tuning + # can be reenabled by calling the `EnableModelPeriodicTuning` + # method or by calling the `TuneModel` method. + PERIODIC_TUNING_DISABLED = 1 + + # The model cannot be tuned with periodic tuning OR the + # `TuneModel` method. Hide the options in customer UI and + # reject any requests through the backend self serve API. + ALL_TUNING_DISABLED = 3 + + # The model has periodic tuning enabled. Tuning + # can be disabled by calling the `DisableModelPeriodicTuning` + # method. + PERIODIC_TUNING_ENABLED = 2 + end + + # Describes whether this model have sufficient training data + # to be continuously trained. + module DataState + # Unspecified default value, should never be explicitly set. + DATA_STATE_UNSPECIFIED = 0 + + # The model has sufficient training data. + DATA_OK = 1 + + # The model does not have sufficient training data. Error + # messages can be queried via Stackdriver. + DATA_ERROR = 2 + end + + # Use single or multiple context products for recommendations. + module ContextProductsType + # Unspecified default value, should never be explicitly set. + # Defaults to + # {::Google::Cloud::Retail::V2::Model::ContextProductsType::MULTIPLE_CONTEXT_PRODUCTS MULTIPLE_CONTEXT_PRODUCTS}. + CONTEXT_PRODUCTS_TYPE_UNSPECIFIED = 0 + + # Use only a single product as context for the recommendation. Typically + # used on pages like add-to-cart or product details. + SINGLE_CONTEXT_PRODUCT = 1 + + # Use one or multiple products as context for the recommendation. Typically + # used on shopping cart pages. + MULTIPLE_CONTEXT_PRODUCTS = 2 + end + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-retail-v2/proto_docs/google/cloud/retail/v2/model_service.rb b/owl-bot-staging/google-cloud-retail-v2/proto_docs/google/cloud/retail/v2/model_service.rb new file mode 100644 index 000000000000..0fe12a4770c2 --- /dev/null +++ b/owl-bot-staging/google-cloud-retail-v2/proto_docs/google/cloud/retail/v2/model_service.rb @@ -0,0 +1,172 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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 Retail + module V2 + # Request for creating a model. + # @!attribute [rw] parent + # @return [::String] + # Required. The parent resource under which to create the model. Format: + # `projects/{project_number}/locations/{location_id}/catalogs/{catalog_id}` + # @!attribute [rw] model + # @return [::Google::Cloud::Retail::V2::Model] + # Required. The payload of the {::Google::Cloud::Retail::V2::Model Model} to + # create. + # @!attribute [rw] dry_run + # @return [::Boolean] + # Optional. Whether to run a dry run to validate the request (without + # actually creating the model). + class CreateModelRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Request for updating an existing model. + # @!attribute [rw] model + # @return [::Google::Cloud::Retail::V2::Model] + # Required. The body of the updated {::Google::Cloud::Retail::V2::Model Model}. + # @!attribute [rw] update_mask + # @return [::Google::Protobuf::FieldMask] + # Optional. Indicates which fields in the provided 'model' to + # update. If not set, by default updates all fields. + class UpdateModelRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Request for getting a model. + # @!attribute [rw] name + # @return [::String] + # Required. The resource name of the {::Google::Cloud::Retail::V2::Model Model} to + # get. Format: + # `projects/{project_number}/locations/{location_id}/catalogs/{catalog}/models/{model_id}` + class GetModelRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Request for pausing training of a model. + # @!attribute [rw] name + # @return [::String] + # Required. The name of the model to pause. + # Format: + # `projects/{project_number}/locations/{location_id}/catalogs/{catalog_id}/models/{model_id}` + class PauseModelRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Request for resuming training of a model. + # @!attribute [rw] name + # @return [::String] + # Required. The name of the model to resume. + # Format: + # `projects/{project_number}/locations/{location_id}/catalogs/{catalog_id}/models/{model_id}` + class ResumeModelRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Request for listing models associated with a resource. + # @!attribute [rw] parent + # @return [::String] + # Required. The parent for which to list models. + # Format: + # `projects/{project_number}/locations/{location_id}/catalogs/{catalog_id}` + # @!attribute [rw] page_size + # @return [::Integer] + # Optional. Maximum number of results to return. If unspecified, defaults + # to 50. Max allowed value is 1000. + # @!attribute [rw] page_token + # @return [::String] + # Optional. A page token, received from a previous `ListModels` + # call. Provide this to retrieve the subsequent page. + class ListModelsRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Request for deleting a model. + # @!attribute [rw] name + # @return [::String] + # Required. The resource name of the {::Google::Cloud::Retail::V2::Model Model} to + # delete. Format: + # `projects/{project_number}/locations/{location_id}/catalogs/{catalog_id}/models/{model_id}` + class DeleteModelRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Response to a ListModelRequest. + # @!attribute [rw] models + # @return [::Array<::Google::Cloud::Retail::V2::Model>] + # List of Models. + # @!attribute [rw] next_page_token + # @return [::String] + # Pagination token, if not returned indicates the last page. + class ListModelsResponse + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Request to manually start a tuning process now (instead of waiting for + # the periodically scheduled tuning to happen). + # @!attribute [rw] name + # @return [::String] + # Required. The resource name of the model to tune. + # Format: + # `projects/{project_number}/locations/{location_id}/catalogs/{catalog_id}/models/{model_id}` + class TuneModelRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Metadata associated with a create operation. + # @!attribute [rw] model + # @return [::String] + # The resource name of the model that this create applies to. + # Format: + # `projects/{project_number}/locations/{location_id}/catalogs/{catalog_id}/models/{model_id}` + class CreateModelMetadata + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Metadata associated with a tune operation. + # @!attribute [rw] model + # @return [::String] + # The resource name of the model that this tune applies to. + # Format: + # `projects/{project_number}/locations/{location_id}/catalogs/{catalog_id}/models/{model_id}` + class TuneModelMetadata + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Response associated with a tune operation. + class TuneModelResponse + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-retail-v2/proto_docs/google/cloud/retail/v2/prediction_service.rb b/owl-bot-staging/google-cloud-retail-v2/proto_docs/google/cloud/retail/v2/prediction_service.rb new file mode 100644 index 000000000000..53e46e58df05 --- /dev/null +++ b/owl-bot-staging/google-cloud-retail-v2/proto_docs/google/cloud/retail/v2/prediction_service.rb @@ -0,0 +1,237 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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 Retail + module V2 + # Request message for Predict method. + # @!attribute [rw] placement + # @return [::String] + # Required. Full resource name of the format: + # `{placement=projects/*/locations/global/catalogs/default_catalog/servingConfigs/*}` + # or + # `{placement=projects/*/locations/global/catalogs/default_catalog/placements/*}`. + # We recommend using the `servingConfigs` resource. `placements` is a legacy + # resource. + # The ID of the Recommendations AI serving config or placement. + # Before you can request predictions from your model, you must create at + # least one serving config or placement for it. For more information, see + # [Manage serving configs] + # (https://cloud.google.com/retail/docs/manage-configs). + # + # The full list of available serving configs can be seen at + # https://console.cloud.google.com/ai/retail/catalogs/default_catalog/configs + # @!attribute [rw] user_event + # @return [::Google::Cloud::Retail::V2::UserEvent] + # Required. Context about the user, what they are looking at and what action + # they took to trigger the predict request. Note that this user event detail + # won't be ingested to userEvent logs. Thus, a separate userEvent write + # request is required for event logging. + # + # Don't set + # {::Google::Cloud::Retail::V2::UserEvent#visitor_id UserEvent.visitor_id} or + # {::Google::Cloud::Retail::V2::UserInfo#user_id UserInfo.user_id} to the same + # fixed ID for different users. If you are trying to receive non-personalized + # recommendations (not recommended; this can negatively impact model + # performance), instead set + # {::Google::Cloud::Retail::V2::UserEvent#visitor_id UserEvent.visitor_id} to a + # random unique ID and leave + # {::Google::Cloud::Retail::V2::UserInfo#user_id UserInfo.user_id} unset. + # @!attribute [rw] page_size + # @return [::Integer] + # Maximum number of results to return. Set this property to the number of + # prediction results needed. If zero, the service will choose a reasonable + # default. The maximum allowed value is 100. Values above 100 will be coerced + # to 100. + # @!attribute [rw] page_token + # @deprecated This field is deprecated and may be removed in the next major version update. + # @return [::String] + # This field is not used; leave it unset. + # @!attribute [rw] filter + # @return [::String] + # Filter for restricting prediction results with a length limit of 5,000 + # characters. Accepts values for tags and the `filterOutOfStockItems` flag. + # + # * Tag expressions. Restricts predictions to products that match all of the + # specified tags. Boolean operators `OR` and `NOT` are supported if the + # expression is enclosed in parentheses, and must be separated from the + # tag values by a space. `-"tagA"` is also supported and is equivalent to + # `NOT "tagA"`. Tag values must be double quoted UTF-8 encoded strings + # with a size limit of 1,000 characters. + # + # Note: "Recently viewed" models don't support tag filtering at the + # moment. + # + # * filterOutOfStockItems. Restricts predictions to products that do not + # have a + # stockState value of OUT_OF_STOCK. + # + # Examples: + # + # * tag=("Red" OR "Blue") tag="New-Arrival" tag=(NOT "promotional") + # * filterOutOfStockItems tag=(-"promotional") + # * filterOutOfStockItems + # + # If your filter blocks all prediction results, the API will return *no* + # results. If instead you want empty result sets to return generic + # (unfiltered) popular products, set `strictFiltering` to False in + # `PredictRequest.params`. Note that the API will never return items with + # storageStatus of "EXPIRED" or "DELETED" regardless of filter choices. + # + # If `filterSyntaxV2` is set to true under the `params` field, then + # attribute-based expressions are expected instead of the above described + # tag-based syntax. Examples: + # + # * (colors: ANY("Red", "Blue")) AND NOT (categories: ANY("Phones")) + # * (availability: ANY("IN_STOCK")) AND + # (colors: ANY("Red") OR categories: ANY("Phones")) + # + # For more information, see + # [Filter recommendations](https://cloud.google.com/retail/docs/filter-recs). + # @!attribute [rw] validate_only + # @return [::Boolean] + # Use validate only mode for this prediction query. If set to true, a + # dummy model will be used that returns arbitrary products. + # Note that the validate only mode should only be used for testing the API, + # or if the model is not ready. + # @!attribute [rw] params + # @return [::Google::Protobuf::Map{::String => ::Google::Protobuf::Value}] + # Additional domain specific parameters for the predictions. + # + # Allowed values: + # + # * `returnProduct`: Boolean. If set to true, the associated product + # object will be returned in the `results.metadata` field in the + # prediction response. + # * `returnScore`: Boolean. If set to true, the prediction 'score' + # corresponding to each returned product will be set in the + # `results.metadata` field in the prediction response. The given + # 'score' indicates the probability of a product being clicked/purchased + # given the user's context and history. + # * `strictFiltering`: Boolean. True by default. If set to false, the service + # will return generic (unfiltered) popular products instead of empty if + # your filter blocks all prediction results. + # * `priceRerankLevel`: String. Default empty. If set to be non-empty, then + # it needs to be one of {'no-price-reranking', 'low-price-reranking', + # 'medium-price-reranking', 'high-price-reranking'}. This gives + # request-level control and adjusts prediction results based on product + # price. + # * `diversityLevel`: String. Default empty. If set to be non-empty, then + # it needs to be one of {'no-diversity', 'low-diversity', + # 'medium-diversity', 'high-diversity', 'auto-diversity'}. This gives + # request-level control and adjusts prediction results based on product + # category. + # * `filterSyntaxV2`: Boolean. False by default. If set to true, the `filter` + # field is interpreteted according to the new, attribute-based syntax. + # @!attribute [rw] labels + # @return [::Google::Protobuf::Map{::String => ::String}] + # The labels applied to a resource must meet the following requirements: + # + # * Each resource can have multiple labels, up to a maximum of 64. + # * Each label must be a key-value pair. + # * Keys have a minimum length of 1 character and a maximum length of 63 + # characters and cannot be empty. Values can be empty and have a maximum + # length of 63 characters. + # * Keys and values can contain only lowercase letters, numeric characters, + # underscores, and dashes. All characters must use UTF-8 encoding, and + # international characters are allowed. + # * The key portion of a label must be unique. However, you can use the same + # key with multiple resources. + # * Keys must start with a lowercase letter or international character. + # + # See [Google Cloud + # Document](https://cloud.google.com/resource-manager/docs/creating-managing-labels#requirements) + # for more details. + class PredictRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # @!attribute [rw] key + # @return [::String] + # @!attribute [rw] value + # @return [::Google::Protobuf::Value] + class ParamsEntry + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # @!attribute [rw] key + # @return [::String] + # @!attribute [rw] value + # @return [::String] + class LabelsEntry + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end + + # Response message for predict method. + # @!attribute [rw] results + # @return [::Array<::Google::Cloud::Retail::V2::PredictResponse::PredictionResult>] + # A list of recommended products. The order represents the ranking (from the + # most relevant product to the least). + # @!attribute [rw] attribution_token + # @return [::String] + # A unique attribution token. This should be included in the + # {::Google::Cloud::Retail::V2::UserEvent UserEvent} logs resulting from this + # recommendation, which enables accurate attribution of recommendation model + # performance. + # @!attribute [rw] missing_ids + # @return [::Array<::String>] + # IDs of products in the request that were missing from the inventory. + # @!attribute [rw] validate_only + # @return [::Boolean] + # True if the validateOnly property was set in the request. + class PredictResponse + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # PredictionResult represents the recommendation prediction results. + # @!attribute [rw] id + # @return [::String] + # ID of the recommended product + # @!attribute [rw] metadata + # @return [::Google::Protobuf::Map{::String => ::Google::Protobuf::Value}] + # Additional product metadata / annotations. + # + # Possible values: + # + # * `product`: JSON representation of the product. Is set if + # `returnProduct` is set to true in `PredictRequest.params`. + # * `score`: Prediction score in double value. Is set if + # `returnScore` is set to true in `PredictRequest.params`. + class PredictionResult + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # @!attribute [rw] key + # @return [::String] + # @!attribute [rw] value + # @return [::Google::Protobuf::Value] + class MetadataEntry + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-retail-v2/proto_docs/google/cloud/retail/v2/product.rb b/owl-bot-staging/google-cloud-retail-v2/proto_docs/google/cloud/retail/v2/product.rb new file mode 100644 index 000000000000..a5c89f524c45 --- /dev/null +++ b/owl-bot-staging/google-cloud-retail-v2/proto_docs/google/cloud/retail/v2/product.rb @@ -0,0 +1,588 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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 Retail + module V2 + # Product captures all metadata information of items to be recommended or + # searched. + # @!attribute [rw] expire_time + # @return [::Google::Protobuf::Timestamp] + # Note that this field is applied in the following ways: + # + # * If the {::Google::Cloud::Retail::V2::Product Product} is already expired + # when it is uploaded, this product + # is not indexed for search. + # + # * If the {::Google::Cloud::Retail::V2::Product Product} is not expired when it + # is uploaded, only the + # {::Google::Cloud::Retail::V2::Product::Type::PRIMARY Type.PRIMARY}'s and + # {::Google::Cloud::Retail::V2::Product::Type::COLLECTION Type.COLLECTION}'s + # expireTime is respected, and + # {::Google::Cloud::Retail::V2::Product::Type::VARIANT Type.VARIANT}'s + # expireTime is not used. + # + # In general, we suggest the users to delete the stale + # products explicitly, instead of using this field to determine staleness. + # + # {::Google::Cloud::Retail::V2::Product#expire_time expire_time} must be later + # than {::Google::Cloud::Retail::V2::Product#available_time available_time} and + # {::Google::Cloud::Retail::V2::Product#publish_time publish_time}, otherwise an + # INVALID_ARGUMENT error is thrown. + # + # Corresponding properties: Google Merchant Center property + # [expiration_date](https://support.google.com/merchants/answer/6324499). + # + # Note: The following fields are mutually exclusive: `expire_time`, `ttl`. If a field in that set is populated, all other fields in the set will automatically be cleared. + # @!attribute [rw] ttl + # @return [::Google::Protobuf::Duration] + # Input only. The TTL (time to live) of the product. Note that this is only + # applicable to {::Google::Cloud::Retail::V2::Product::Type::PRIMARY Type.PRIMARY} + # and {::Google::Cloud::Retail::V2::Product::Type::COLLECTION Type.COLLECTION}, + # and ignored for + # {::Google::Cloud::Retail::V2::Product::Type::VARIANT Type.VARIANT}. In general, + # we suggest the users to delete the stale products explicitly, instead of + # using this field to determine staleness. + # + # If it is set, it must be a non-negative value, and + # {::Google::Cloud::Retail::V2::Product#expire_time expire_time} is set as + # current timestamp plus {::Google::Cloud::Retail::V2::Product#ttl ttl}. The + # derived {::Google::Cloud::Retail::V2::Product#expire_time expire_time} is + # returned in the output and {::Google::Cloud::Retail::V2::Product#ttl ttl} is + # left blank when retrieving the {::Google::Cloud::Retail::V2::Product Product}. + # + # If it is set, the product is not available for + # {::Google::Cloud::Retail::V2::SearchService::Client#search SearchService.Search} after + # current timestamp plus {::Google::Cloud::Retail::V2::Product#ttl ttl}. + # However, the product can still be retrieved by + # {::Google::Cloud::Retail::V2::ProductService::Client#get_product ProductService.GetProduct} + # and + # {::Google::Cloud::Retail::V2::ProductService::Client#list_products ProductService.ListProducts}. + # + # Note: The following fields are mutually exclusive: `ttl`, `expire_time`. If a field in that set is populated, all other fields in the set will automatically be cleared. + # @!attribute [rw] name + # @return [::String] + # Immutable. Full resource name of the product, such as + # `projects/*/locations/global/catalogs/default_catalog/branches/default_branch/products/product_id`. + # @!attribute [rw] id + # @return [::String] + # Immutable. {::Google::Cloud::Retail::V2::Product Product} identifier, which is + # the final component of {::Google::Cloud::Retail::V2::Product#name name}. For + # example, this field is "id_1", if + # {::Google::Cloud::Retail::V2::Product#name name} is + # `projects/*/locations/global/catalogs/default_catalog/branches/default_branch/products/id_1`. + # + # This field must be a UTF-8 encoded string with a length limit of 128 + # characters. Otherwise, an INVALID_ARGUMENT error is returned. + # + # Corresponding properties: Google Merchant Center property + # [id](https://support.google.com/merchants/answer/6324405). Schema.org + # property [Product.sku](https://schema.org/sku). + # @!attribute [rw] type + # @return [::Google::Cloud::Retail::V2::Product::Type] + # Immutable. The type of the product. Default to + # {::Google::Cloud::Retail::V2::ProductLevelConfig#ingestion_product_type Catalog.product_level_config.ingestion_product_type} + # if unset. + # @!attribute [rw] primary_product_id + # @return [::String] + # Variant group identifier. Must be an + # {::Google::Cloud::Retail::V2::Product#id id}, with the same parent branch with + # this product. Otherwise, an error is thrown. + # + # For {::Google::Cloud::Retail::V2::Product::Type::PRIMARY Type.PRIMARY} + # {::Google::Cloud::Retail::V2::Product Product}s, this field can only be empty or + # set to the same value as {::Google::Cloud::Retail::V2::Product#id id}. + # + # For VARIANT {::Google::Cloud::Retail::V2::Product Product}s, this field cannot + # be empty. A maximum of 2,000 products are allowed to share the same + # {::Google::Cloud::Retail::V2::Product::Type::PRIMARY Type.PRIMARY} + # {::Google::Cloud::Retail::V2::Product Product}. Otherwise, an INVALID_ARGUMENT + # error is returned. + # + # Corresponding properties: Google Merchant Center property + # [item_group_id](https://support.google.com/merchants/answer/6324507). + # Schema.org property + # [Product.inProductGroupWithID](https://schema.org/inProductGroupWithID). + # @!attribute [rw] collection_member_ids + # @return [::Array<::String>] + # The {::Google::Cloud::Retail::V2::Product#id id} of the collection members when + # {::Google::Cloud::Retail::V2::Product#type type} is + # {::Google::Cloud::Retail::V2::Product::Type::COLLECTION Type.COLLECTION}. + # + # Non-existent product ids are allowed. + # The {::Google::Cloud::Retail::V2::Product#type type} of the members must be + # either {::Google::Cloud::Retail::V2::Product::Type::PRIMARY Type.PRIMARY} or + # {::Google::Cloud::Retail::V2::Product::Type::VARIANT Type.VARIANT} otherwise an + # INVALID_ARGUMENT error is thrown. Should not set it for other types. A + # maximum of 1000 values are allowed. Otherwise, an INVALID_ARGUMENT error is + # return. + # @!attribute [rw] gtin + # @return [::String] + # The Global Trade Item Number (GTIN) of the product. + # + # This field must be a UTF-8 encoded string with a length limit of 128 + # characters. Otherwise, an INVALID_ARGUMENT error is returned. + # + # This field must be a Unigram. Otherwise, an INVALID_ARGUMENT error is + # returned. + # + # Corresponding properties: Google Merchant Center property + # [gtin](https://support.google.com/merchants/answer/6324461). + # Schema.org property + # [Product.isbn](https://schema.org/isbn), + # [Product.gtin8](https://schema.org/gtin8), + # [Product.gtin12](https://schema.org/gtin12), + # [Product.gtin13](https://schema.org/gtin13), or + # [Product.gtin14](https://schema.org/gtin14). + # + # If the value is not a valid GTIN, an INVALID_ARGUMENT error is returned. + # @!attribute [rw] categories + # @return [::Array<::String>] + # Product categories. This field is repeated for supporting one product + # belonging to several parallel categories. Strongly recommended using the + # full path for better search / recommendation quality. + # + # + # To represent full path of category, use '>' sign to separate different + # hierarchies. If '>' is part of the category name, replace it with + # other character(s). + # + # For example, if a shoes product belongs to both + # ["Shoes & Accessories" -> "Shoes"] and + # ["Sports & Fitness" -> "Athletic Clothing" -> "Shoes"], it could be + # represented as: + # + # "categories": [ + # "Shoes & Accessories > Shoes", + # "Sports & Fitness > Athletic Clothing > Shoes" + # ] + # + # Must be set for {::Google::Cloud::Retail::V2::Product::Type::PRIMARY Type.PRIMARY} + # {::Google::Cloud::Retail::V2::Product Product} otherwise an INVALID_ARGUMENT + # error is returned. + # + # At most 250 values are allowed per + # {::Google::Cloud::Retail::V2::Product Product} unless overridden through the + # Google Cloud console. Empty values are not allowed. Each value must be a + # UTF-8 encoded string with a length limit of 5,000 characters. Otherwise, an + # INVALID_ARGUMENT error is returned. + # + # Corresponding properties: Google Merchant Center property + # [google_product_category][mc_google_product_category]. Schema.org property + # [Product.category] (https://schema.org/category). + # + # [mc_google_product_category]: + # https://support.google.com/merchants/answer/6324436 + # @!attribute [rw] title + # @return [::String] + # Required. Product title. + # + # This field must be a UTF-8 encoded string with a length limit of 1,000 + # characters. Otherwise, an INVALID_ARGUMENT error is returned. + # + # Corresponding properties: Google Merchant Center property + # [title](https://support.google.com/merchants/answer/6324415). Schema.org + # property [Product.name](https://schema.org/name). + # @!attribute [rw] brands + # @return [::Array<::String>] + # The brands of the product. + # + # A maximum of 30 brands are allowed unless overridden through the Google + # Cloud console. Each + # brand must be a UTF-8 encoded string with a length limit of 1,000 + # characters. Otherwise, an INVALID_ARGUMENT error is returned. + # + # Corresponding properties: Google Merchant Center property + # [brand](https://support.google.com/merchants/answer/6324351). Schema.org + # property [Product.brand](https://schema.org/brand). + # @!attribute [rw] description + # @return [::String] + # Product description. + # + # This field must be a UTF-8 encoded string with a length limit of 5,000 + # characters. Otherwise, an INVALID_ARGUMENT error is returned. + # + # Corresponding properties: Google Merchant Center property + # [description](https://support.google.com/merchants/answer/6324468). + # Schema.org property [Product.description](https://schema.org/description). + # @!attribute [rw] language_code + # @return [::String] + # Language of the title/description and other string attributes. Use language + # tags defined by [BCP 47](https://www.rfc-editor.org/rfc/bcp/bcp47.txt). + # + # For product prediction, this field is ignored and the model automatically + # detects the text language. The {::Google::Cloud::Retail::V2::Product Product} + # can include text in different languages, but duplicating + # {::Google::Cloud::Retail::V2::Product Product}s to provide text in multiple + # languages can result in degraded model performance. + # + # For product search this field is in use. It defaults to "en-US" if unset. + # @!attribute [rw] attributes + # @return [::Google::Protobuf::Map{::String => ::Google::Cloud::Retail::V2::CustomAttribute}] + # Highly encouraged. Extra product attributes to be included. For example, + # for products, this could include the store name, vendor, style, color, etc. + # These are very strong signals for recommendation model, thus we highly + # recommend providing the attributes here. + # + # Features that can take on one of a limited number of possible values. Two + # types of features can be set are: + # + # Textual features. some examples would be the brand/maker of a product, or + # country of a customer. Numerical features. Some examples would be the + # height/weight of a product, or age of a customer. + # + # For example: `{ "vendor": {"text": ["vendor123", "vendor456"]}, + # "lengths_cm": \\{"numbers":[2.3, 15.4]}, "heights_cm": \\{"numbers":[8.1, 6.4]} + # }`. + # + # This field needs to pass all below criteria, otherwise an INVALID_ARGUMENT + # error is returned: + # + # * Max entries count: 200. + # * The key must be a UTF-8 encoded string with a length limit of 128 + # characters. + # * For indexable attribute, the key must match the pattern: + # `[a-zA-Z0-9][a-zA-Z0-9_]*`. For example, `key0LikeThis` or + # `KEY_1_LIKE_THIS`. + # * For text attributes, at most 400 values are allowed. Empty values are not + # allowed. Each value must be a non-empty UTF-8 encoded string with a + # length limit of 256 characters. + # * For number attributes, at most 400 values are allowed. + # @!attribute [rw] tags + # @return [::Array<::String>] + # Custom tags associated with the product. + # + # At most 250 values are allowed per + # {::Google::Cloud::Retail::V2::Product Product}. This value must be a UTF-8 + # encoded string with a length limit of 1,000 characters. Otherwise, an + # INVALID_ARGUMENT error is returned. + # + # This tag can be used for filtering recommendation results by passing the + # tag as part of the + # {::Google::Cloud::Retail::V2::PredictRequest#filter PredictRequest.filter}. + # + # Corresponding properties: Google Merchant Center property + # [custom_label_0–4](https://support.google.com/merchants/answer/6324473). + # @!attribute [rw] price_info + # @return [::Google::Cloud::Retail::V2::PriceInfo] + # Product price and cost information. + # + # Corresponding properties: Google Merchant Center property + # [price](https://support.google.com/merchants/answer/6324371). + # @!attribute [rw] rating + # @return [::Google::Cloud::Retail::V2::Rating] + # The rating of this product. + # @!attribute [rw] available_time + # @return [::Google::Protobuf::Timestamp] + # The timestamp when this {::Google::Cloud::Retail::V2::Product Product} becomes + # available for + # {::Google::Cloud::Retail::V2::SearchService::Client#search SearchService.Search}. Note + # that this is only applicable to + # {::Google::Cloud::Retail::V2::Product::Type::PRIMARY Type.PRIMARY} and + # {::Google::Cloud::Retail::V2::Product::Type::COLLECTION Type.COLLECTION}, and + # ignored for {::Google::Cloud::Retail::V2::Product::Type::VARIANT Type.VARIANT}. + # @!attribute [rw] availability + # @return [::Google::Cloud::Retail::V2::Product::Availability] + # The online availability of the {::Google::Cloud::Retail::V2::Product Product}. + # Default to + # {::Google::Cloud::Retail::V2::Product::Availability::IN_STOCK Availability.IN_STOCK}. + # + # For primary products with variants set the availability of the primary as + # {::Google::Cloud::Retail::V2::Product::Availability::OUT_OF_STOCK Availability.OUT_OF_STOCK} + # and set the true availability at the variant level. This way the primary + # product will be considered "in stock" as long as it has at least one + # variant in stock. + # + # For primary products with no variants set the true availability at the + # primary level. + # + # Corresponding properties: Google Merchant Center property + # [availability](https://support.google.com/merchants/answer/6324448). + # Schema.org property [Offer.availability](https://schema.org/availability). + # @!attribute [rw] available_quantity + # @return [::Google::Protobuf::Int32Value] + # The available quantity of the item. + # @!attribute [rw] fulfillment_info + # @return [::Array<::Google::Cloud::Retail::V2::FulfillmentInfo>] + # Fulfillment information, such as the store IDs for in-store pickup or + # region IDs for different shipping methods. + # + # All the elements must have distinct + # {::Google::Cloud::Retail::V2::FulfillmentInfo#type FulfillmentInfo.type}. + # Otherwise, an INVALID_ARGUMENT error is returned. + # @!attribute [rw] uri + # @return [::String] + # Canonical URL directly linking to the product detail page. + # + # It is strongly recommended to provide a valid uri for the product, + # otherwise the service performance could be significantly degraded. + # + # This field must be a UTF-8 encoded string with a length limit of 5,000 + # characters. Otherwise, an INVALID_ARGUMENT error is returned. + # + # Corresponding properties: Google Merchant Center property + # [link](https://support.google.com/merchants/answer/6324416). Schema.org + # property [Offer.url](https://schema.org/url). + # @!attribute [rw] images + # @return [::Array<::Google::Cloud::Retail::V2::Image>] + # Product images for the product. We highly recommend putting the main + # image first. + # + # A maximum of 300 images are allowed. + # + # Corresponding properties: Google Merchant Center property + # [image_link](https://support.google.com/merchants/answer/6324350). + # Schema.org property [Product.image](https://schema.org/image). + # @!attribute [rw] audience + # @return [::Google::Cloud::Retail::V2::Audience] + # The target group associated with a given audience (e.g. male, veterans, + # car owners, musicians, etc.) of the product. + # @!attribute [rw] color_info + # @return [::Google::Cloud::Retail::V2::ColorInfo] + # The color of the product. + # + # Corresponding properties: Google Merchant Center property + # [color](https://support.google.com/merchants/answer/6324487). Schema.org + # property [Product.color](https://schema.org/color). + # @!attribute [rw] sizes + # @return [::Array<::String>] + # The size of the product. To represent different size systems or size types, + # consider using this format: [[[size_system:]size_type:]size_value]. + # + # For example, in "US:MENS:M", "US" represents size system; "MENS" represents + # size type; "M" represents size value. In "GIRLS:27", size system is empty; + # "GIRLS" represents size type; "27" represents size value. In "32 inches", + # both size system and size type are empty, while size value is "32 inches". + # + # A maximum of 20 values are allowed per + # {::Google::Cloud::Retail::V2::Product Product}. Each value must be a UTF-8 + # encoded string with a length limit of 128 characters. Otherwise, an + # INVALID_ARGUMENT error is returned. + # + # Corresponding properties: Google Merchant Center property + # [size](https://support.google.com/merchants/answer/6324492), + # [size_type](https://support.google.com/merchants/answer/6324497), and + # [size_system](https://support.google.com/merchants/answer/6324502). + # Schema.org property [Product.size](https://schema.org/size). + # @!attribute [rw] materials + # @return [::Array<::String>] + # The material of the product. For example, "leather", "wooden". + # + # A maximum of 20 values are allowed. Each value must be a UTF-8 encoded + # string with a length limit of 200 characters. Otherwise, an + # INVALID_ARGUMENT error is returned. + # + # Corresponding properties: Google Merchant Center property + # [material](https://support.google.com/merchants/answer/6324410). Schema.org + # property [Product.material](https://schema.org/material). + # @!attribute [rw] patterns + # @return [::Array<::String>] + # The pattern or graphic print of the product. For example, "striped", "polka + # dot", "paisley". + # + # A maximum of 20 values are allowed per + # {::Google::Cloud::Retail::V2::Product Product}. Each value must be a UTF-8 + # encoded string with a length limit of 128 characters. Otherwise, an + # INVALID_ARGUMENT error is returned. + # + # Corresponding properties: Google Merchant Center property + # [pattern](https://support.google.com/merchants/answer/6324483). Schema.org + # property [Product.pattern](https://schema.org/pattern). + # @!attribute [rw] conditions + # @return [::Array<::String>] + # The condition of the product. Strongly encouraged to use the standard + # values: "new", "refurbished", "used". + # + # A maximum of 1 value is allowed per + # {::Google::Cloud::Retail::V2::Product Product}. Each value must be a UTF-8 + # encoded string with a length limit of 128 characters. Otherwise, an + # INVALID_ARGUMENT error is returned. + # + # Corresponding properties: Google Merchant Center property + # [condition](https://support.google.com/merchants/answer/6324469). + # Schema.org property + # [Offer.itemCondition](https://schema.org/itemCondition). + # @!attribute [rw] promotions + # @return [::Array<::Google::Cloud::Retail::V2::Promotion>] + # The promotions applied to the product. A maximum of 10 values are allowed + # per {::Google::Cloud::Retail::V2::Product Product}. Only + # {::Google::Cloud::Retail::V2::Promotion#promotion_id Promotion.promotion_id} + # will be used, other fields will be ignored if set. + # @!attribute [rw] publish_time + # @return [::Google::Protobuf::Timestamp] + # The timestamp when the product is published by the retailer for the first + # time, which indicates the freshness of the products. Note that this field + # is different from + # {::Google::Cloud::Retail::V2::Product#available_time available_time}, given it + # purely describes product freshness regardless of when it is available on + # search and recommendation. + # @!attribute [rw] retrievable_fields + # @deprecated This field is deprecated and may be removed in the next major version update. + # @return [::Google::Protobuf::FieldMask] + # Indicates which fields in the {::Google::Cloud::Retail::V2::Product Product}s + # are returned in {::Google::Cloud::Retail::V2::SearchResponse SearchResponse}. + # + # Supported fields for all {::Google::Cloud::Retail::V2::Product#type type}s: + # + # * {::Google::Cloud::Retail::V2::Product#audience audience} + # * {::Google::Cloud::Retail::V2::Product#availability availability} + # * {::Google::Cloud::Retail::V2::Product#brands brands} + # * {::Google::Cloud::Retail::V2::Product#color_info color_info} + # * {::Google::Cloud::Retail::V2::Product#conditions conditions} + # * {::Google::Cloud::Retail::V2::Product#gtin gtin} + # * {::Google::Cloud::Retail::V2::Product#materials materials} + # * {::Google::Cloud::Retail::V2::Product#name name} + # * {::Google::Cloud::Retail::V2::Product#patterns patterns} + # * {::Google::Cloud::Retail::V2::Product#price_info price_info} + # * {::Google::Cloud::Retail::V2::Product#rating rating} + # * {::Google::Cloud::Retail::V2::Product#sizes sizes} + # * {::Google::Cloud::Retail::V2::Product#title title} + # * {::Google::Cloud::Retail::V2::Product#uri uri} + # + # Supported fields only for + # {::Google::Cloud::Retail::V2::Product::Type::PRIMARY Type.PRIMARY} and + # {::Google::Cloud::Retail::V2::Product::Type::COLLECTION Type.COLLECTION}: + # + # * {::Google::Cloud::Retail::V2::Product#categories categories} + # * {::Google::Cloud::Retail::V2::Product#description description} + # * {::Google::Cloud::Retail::V2::Product#images images} + # + # Supported fields only for + # {::Google::Cloud::Retail::V2::Product::Type::VARIANT Type.VARIANT}: + # + # * Only the first image in {::Google::Cloud::Retail::V2::Product#images images} + # + # To mark {::Google::Cloud::Retail::V2::Product#attributes attributes} as + # retrievable, include paths of the form "attributes.key" where "key" is the + # key of a custom attribute, as specified in + # {::Google::Cloud::Retail::V2::Product#attributes attributes}. + # + # For {::Google::Cloud::Retail::V2::Product::Type::PRIMARY Type.PRIMARY} and + # {::Google::Cloud::Retail::V2::Product::Type::COLLECTION Type.COLLECTION}, the + # following fields are always returned in + # {::Google::Cloud::Retail::V2::SearchResponse SearchResponse} by default: + # + # * {::Google::Cloud::Retail::V2::Product#name name} + # + # For {::Google::Cloud::Retail::V2::Product::Type::VARIANT Type.VARIANT}, the + # following fields are always returned in by default: + # + # * {::Google::Cloud::Retail::V2::Product#name name} + # * {::Google::Cloud::Retail::V2::Product#color_info color_info} + # + # Note: Returning more fields in + # {::Google::Cloud::Retail::V2::SearchResponse SearchResponse} can increase + # response payload size and serving latency. + # + # This field is deprecated. Use the retrievable site-wide control instead. + # @!attribute [r] variants + # @return [::Array<::Google::Cloud::Retail::V2::Product>] + # Output only. Product variants grouped together on primary product which + # share similar product attributes. It's automatically grouped by + # {::Google::Cloud::Retail::V2::Product#primary_product_id primary_product_id} for + # all the product variants. Only populated for + # {::Google::Cloud::Retail::V2::Product::Type::PRIMARY Type.PRIMARY} + # {::Google::Cloud::Retail::V2::Product Product}s. + # + # Note: This field is OUTPUT_ONLY for + # {::Google::Cloud::Retail::V2::ProductService::Client#get_product ProductService.GetProduct}. + # Do not set this field in API requests. + # @!attribute [r] local_inventories + # @return [::Array<::Google::Cloud::Retail::V2::LocalInventory>] + # Output only. A list of local inventories specific to different places. + # + # This field can be managed by + # {::Google::Cloud::Retail::V2::ProductService::Client#add_local_inventories ProductService.AddLocalInventories} + # and + # {::Google::Cloud::Retail::V2::ProductService::Client#remove_local_inventories ProductService.RemoveLocalInventories} + # APIs if fine-grained, high-volume updates are necessary. + class Product + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # @!attribute [rw] key + # @return [::String] + # @!attribute [rw] value + # @return [::Google::Cloud::Retail::V2::CustomAttribute] + class AttributesEntry + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # The type of this product. + module Type + # Default value. Default to + # {::Google::Cloud::Retail::V2::ProductLevelConfig#ingestion_product_type Catalog.product_level_config.ingestion_product_type} + # if unset. + TYPE_UNSPECIFIED = 0 + + # The primary type. + # + # As the primary unit for predicting, indexing and search serving, a + # {::Google::Cloud::Retail::V2::Product::Type::PRIMARY Type.PRIMARY} + # {::Google::Cloud::Retail::V2::Product Product} is grouped with multiple + # {::Google::Cloud::Retail::V2::Product::Type::VARIANT Type.VARIANT} + # {::Google::Cloud::Retail::V2::Product Product}s. + PRIMARY = 1 + + # The variant type. + # + # {::Google::Cloud::Retail::V2::Product::Type::VARIANT Type.VARIANT} + # {::Google::Cloud::Retail::V2::Product Product}s usually share some common + # attributes on the same + # {::Google::Cloud::Retail::V2::Product::Type::PRIMARY Type.PRIMARY} + # {::Google::Cloud::Retail::V2::Product Product}s, but they have variant + # attributes like different colors, sizes and prices, etc. + VARIANT = 2 + + # The collection type. Collection products are bundled + # {::Google::Cloud::Retail::V2::Product::Type::PRIMARY Type.PRIMARY} + # {::Google::Cloud::Retail::V2::Product Product}s or + # {::Google::Cloud::Retail::V2::Product::Type::VARIANT Type.VARIANT} + # {::Google::Cloud::Retail::V2::Product Product}s that are sold together, such + # as a jewelry set with necklaces, earrings and rings, etc. + COLLECTION = 3 + end + + # Product availability. If this field is unspecified, the product is + # assumed to be in stock. + module Availability + # Default product availability. Default to + # {::Google::Cloud::Retail::V2::Product::Availability::IN_STOCK Availability.IN_STOCK} + # if unset. + AVAILABILITY_UNSPECIFIED = 0 + + # Product in stock. + IN_STOCK = 1 + + # Product out of stock. + OUT_OF_STOCK = 2 + + # Product that is in pre-order state. + PREORDER = 3 + + # Product that is back-ordered (i.e. temporarily out of stock). + BACKORDER = 4 + end + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-retail-v2/proto_docs/google/cloud/retail/v2/product_service.rb b/owl-bot-staging/google-cloud-retail-v2/proto_docs/google/cloud/retail/v2/product_service.rb new file mode 100644 index 000000000000..c6fb71059137 --- /dev/null +++ b/owl-bot-staging/google-cloud-retail-v2/proto_docs/google/cloud/retail/v2/product_service.rb @@ -0,0 +1,653 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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 Retail + module V2 + # Request message for + # {::Google::Cloud::Retail::V2::ProductService::Client#create_product ProductService.CreateProduct} + # method. + # @!attribute [rw] parent + # @return [::String] + # Required. The parent catalog resource name, such as + # `projects/*/locations/global/catalogs/default_catalog/branches/default_branch`. + # @!attribute [rw] product + # @return [::Google::Cloud::Retail::V2::Product] + # Required. The {::Google::Cloud::Retail::V2::Product Product} to create. + # @!attribute [rw] product_id + # @return [::String] + # Required. The ID to use for the {::Google::Cloud::Retail::V2::Product Product}, + # which will become the final component of the + # {::Google::Cloud::Retail::V2::Product#name Product.name}. + # + # If the caller does not have permission to create the + # {::Google::Cloud::Retail::V2::Product Product}, regardless of whether or not it + # exists, a PERMISSION_DENIED error is returned. + # + # This field must be unique among all + # {::Google::Cloud::Retail::V2::Product Product}s with the same + # {::Google::Cloud::Retail::V2::CreateProductRequest#parent parent}. Otherwise, an + # ALREADY_EXISTS error is returned. + # + # This field must be a UTF-8 encoded string with a length limit of 128 + # characters. Otherwise, an INVALID_ARGUMENT error is returned. + class CreateProductRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Request message for + # {::Google::Cloud::Retail::V2::ProductService::Client#get_product ProductService.GetProduct} + # method. + # @!attribute [rw] name + # @return [::String] + # Required. Full resource name of {::Google::Cloud::Retail::V2::Product Product}, + # such as + # `projects/*/locations/global/catalogs/default_catalog/branches/default_branch/products/some_product_id`. + # + # If the caller does not have permission to access the + # {::Google::Cloud::Retail::V2::Product Product}, regardless of whether or not it + # exists, a PERMISSION_DENIED error is returned. + # + # If the requested {::Google::Cloud::Retail::V2::Product Product} does not exist, + # a NOT_FOUND error is returned. + class GetProductRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Request message for + # {::Google::Cloud::Retail::V2::ProductService::Client#update_product ProductService.UpdateProduct} + # method. + # @!attribute [rw] product + # @return [::Google::Cloud::Retail::V2::Product] + # Required. The product to update/create. + # + # If the caller does not have permission to update the + # {::Google::Cloud::Retail::V2::Product Product}, regardless of whether or not it + # exists, a PERMISSION_DENIED error is returned. + # + # If the {::Google::Cloud::Retail::V2::Product Product} to update does not exist + # and + # {::Google::Cloud::Retail::V2::UpdateProductRequest#allow_missing allow_missing} + # is not set, a NOT_FOUND error is returned. + # @!attribute [rw] update_mask + # @return [::Google::Protobuf::FieldMask] + # Indicates which fields in the provided + # {::Google::Cloud::Retail::V2::Product Product} to update. The immutable and + # output only fields are NOT supported. If not set, all supported fields (the + # fields that are neither immutable nor output only) are updated. + # + # If an unsupported or unknown field is provided, an INVALID_ARGUMENT error + # is returned. + # + # The attribute key can be updated by setting the mask path as + # "attributes.$\\{key_name}". If a key name is present in the mask but not in + # the patching product from the request, this key will be deleted after the + # update. + # @!attribute [rw] allow_missing + # @return [::Boolean] + # If set to true, and the {::Google::Cloud::Retail::V2::Product Product} is not + # found, a new {::Google::Cloud::Retail::V2::Product Product} will be created. In + # this situation, `update_mask` is ignored. + class UpdateProductRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Request message for + # {::Google::Cloud::Retail::V2::ProductService::Client#delete_product ProductService.DeleteProduct} + # method. + # @!attribute [rw] name + # @return [::String] + # Required. Full resource name of {::Google::Cloud::Retail::V2::Product Product}, + # such as + # `projects/*/locations/global/catalogs/default_catalog/branches/default_branch/products/some_product_id`. + # + # If the caller does not have permission to delete the + # {::Google::Cloud::Retail::V2::Product Product}, regardless of whether or not it + # exists, a PERMISSION_DENIED error is returned. + # + # If the {::Google::Cloud::Retail::V2::Product Product} to delete does not exist, + # a NOT_FOUND error is returned. + # + # The {::Google::Cloud::Retail::V2::Product Product} to delete can neither be a + # {::Google::Cloud::Retail::V2::Product::Type::COLLECTION Product.Type.COLLECTION} + # {::Google::Cloud::Retail::V2::Product Product} member nor a + # {::Google::Cloud::Retail::V2::Product::Type::PRIMARY Product.Type.PRIMARY} + # {::Google::Cloud::Retail::V2::Product Product} with more than one + # {::Google::Cloud::Retail::V2::Product::Type::VARIANT variants}. Otherwise, an + # INVALID_ARGUMENT error is returned. + # + # All inventory information for the named + # {::Google::Cloud::Retail::V2::Product Product} will be deleted. + class DeleteProductRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Request message for + # {::Google::Cloud::Retail::V2::ProductService::Client#list_products ProductService.ListProducts} + # method. + # @!attribute [rw] parent + # @return [::String] + # Required. The parent branch resource name, such as + # `projects/*/locations/global/catalogs/default_catalog/branches/0`. Use + # `default_branch` as the branch ID, to list products under the default + # branch. + # + # If the caller does not have permission to list + # {::Google::Cloud::Retail::V2::Product Product}s under this branch, regardless of + # whether or not this branch exists, a PERMISSION_DENIED error is returned. + # @!attribute [rw] page_size + # @return [::Integer] + # Maximum number of {::Google::Cloud::Retail::V2::Product Product}s to return. If + # unspecified, defaults to 100. The maximum allowed value is 1000. Values + # above 1000 will be coerced to 1000. + # + # If this field is negative, an INVALID_ARGUMENT error is returned. + # @!attribute [rw] page_token + # @return [::String] + # A page token + # {::Google::Cloud::Retail::V2::ListProductsResponse#next_page_token ListProductsResponse.next_page_token}, + # received from a previous + # {::Google::Cloud::Retail::V2::ProductService::Client#list_products ProductService.ListProducts} + # call. Provide this to retrieve the subsequent page. + # + # When paginating, all other parameters provided to + # {::Google::Cloud::Retail::V2::ProductService::Client#list_products ProductService.ListProducts} + # must match the call that provided the page token. Otherwise, an + # INVALID_ARGUMENT error is returned. + # @!attribute [rw] filter + # @return [::String] + # A filter to apply on the list results. Supported features: + # + # * List all the products under the parent branch if + # {::Google::Cloud::Retail::V2::ListProductsRequest#filter filter} is unset. + # * List {::Google::Cloud::Retail::V2::Product::Type::VARIANT Product.Type.VARIANT} + # {::Google::Cloud::Retail::V2::Product Product}s sharing the same + # {::Google::Cloud::Retail::V2::Product::Type::PRIMARY Product.Type.PRIMARY} + # {::Google::Cloud::Retail::V2::Product Product}. For example: + # `primary_product_id = "some_product_id"` + # * List {::Google::Cloud::Retail::V2::Product Product}s bundled in a + # {::Google::Cloud::Retail::V2::Product::Type::COLLECTION Product.Type.COLLECTION} + # {::Google::Cloud::Retail::V2::Product Product}. + # For example: + # `collection_product_id = "some_product_id"` + # * List {::Google::Cloud::Retail::V2::Product Product}s with a partibular type. + # For example: + # `type = "PRIMARY"` + # `type = "VARIANT"` + # `type = "COLLECTION"` + # + # If the field is unrecognizable, an INVALID_ARGUMENT error is returned. + # + # If the specified + # {::Google::Cloud::Retail::V2::Product::Type::PRIMARY Product.Type.PRIMARY} + # {::Google::Cloud::Retail::V2::Product Product} or + # {::Google::Cloud::Retail::V2::Product::Type::COLLECTION Product.Type.COLLECTION} + # {::Google::Cloud::Retail::V2::Product Product} does not exist, a NOT_FOUND error + # is returned. + # @!attribute [rw] read_mask + # @return [::Google::Protobuf::FieldMask] + # The fields of {::Google::Cloud::Retail::V2::Product Product} to return in the + # responses. If not set or empty, the following fields are returned: + # + # * {::Google::Cloud::Retail::V2::Product#name Product.name} + # * {::Google::Cloud::Retail::V2::Product#id Product.id} + # * {::Google::Cloud::Retail::V2::Product#title Product.title} + # * {::Google::Cloud::Retail::V2::Product#uri Product.uri} + # * {::Google::Cloud::Retail::V2::Product#images Product.images} + # * {::Google::Cloud::Retail::V2::Product#price_info Product.price_info} + # * {::Google::Cloud::Retail::V2::Product#brands Product.brands} + # + # If "*" is provided, all fields are returned. + # {::Google::Cloud::Retail::V2::Product#name Product.name} is always returned no + # matter what mask is set. + # + # If an unsupported or unknown field is provided, an INVALID_ARGUMENT error + # is returned. + class ListProductsRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Response message for + # {::Google::Cloud::Retail::V2::ProductService::Client#list_products ProductService.ListProducts} + # method. + # @!attribute [rw] products + # @return [::Array<::Google::Cloud::Retail::V2::Product>] + # The {::Google::Cloud::Retail::V2::Product Product}s. + # @!attribute [rw] next_page_token + # @return [::String] + # A token that can be sent as + # {::Google::Cloud::Retail::V2::ListProductsRequest#page_token ListProductsRequest.page_token} + # to retrieve the next page. If this field is omitted, there are no + # subsequent pages. + class ListProductsResponse + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Request message for + # {::Google::Cloud::Retail::V2::ProductService::Client#set_inventory ProductService.SetInventory} + # method. + # @!attribute [rw] inventory + # @return [::Google::Cloud::Retail::V2::Product] + # Required. The inventory information to update. The allowable fields to + # update are: + # + # * {::Google::Cloud::Retail::V2::Product#price_info Product.price_info} + # * {::Google::Cloud::Retail::V2::Product#availability Product.availability} + # * {::Google::Cloud::Retail::V2::Product#available_quantity Product.available_quantity} + # * {::Google::Cloud::Retail::V2::Product#fulfillment_info Product.fulfillment_info} + # The updated inventory fields must be specified in + # {::Google::Cloud::Retail::V2::SetInventoryRequest#set_mask SetInventoryRequest.set_mask}. + # + # If + # {::Google::Cloud::Retail::V2::Product#name SetInventoryRequest.inventory.name} + # is empty or invalid, an INVALID_ARGUMENT error is returned. + # + # If the caller does not have permission to update the + # {::Google::Cloud::Retail::V2::Product Product} named in + # {::Google::Cloud::Retail::V2::Product#name Product.name}, regardless of whether + # or not it exists, a PERMISSION_DENIED error is returned. + # + # If the {::Google::Cloud::Retail::V2::Product Product} to update does not have + # existing inventory information, the provided inventory information will be + # inserted. + # + # If the {::Google::Cloud::Retail::V2::Product Product} to update has existing + # inventory information, the provided inventory information will be merged + # while respecting the last update time for each inventory field, using the + # provided or default value for + # {::Google::Cloud::Retail::V2::SetInventoryRequest#set_time SetInventoryRequest.set_time}. + # + # The caller can replace place IDs for a subset of fulfillment types in the + # following ways: + # + # * Adds "fulfillment_info" in + # {::Google::Cloud::Retail::V2::SetInventoryRequest#set_mask SetInventoryRequest.set_mask} + # * Specifies only the desired fulfillment types and corresponding place IDs + # to update in + # {::Google::Cloud::Retail::V2::Product#fulfillment_info SetInventoryRequest.inventory.fulfillment_info} + # + # The caller can clear all place IDs from a subset of fulfillment types in + # the following ways: + # + # * Adds "fulfillment_info" in + # {::Google::Cloud::Retail::V2::SetInventoryRequest#set_mask SetInventoryRequest.set_mask} + # * Specifies only the desired fulfillment types to clear in + # {::Google::Cloud::Retail::V2::Product#fulfillment_info SetInventoryRequest.inventory.fulfillment_info} + # * Checks that only the desired fulfillment info types have empty + # {::Google::Cloud::Retail::V2::FulfillmentInfo#place_ids SetInventoryRequest.inventory.fulfillment_info.place_ids} + # + # The last update time is recorded for the following inventory fields: + # * {::Google::Cloud::Retail::V2::Product#price_info Product.price_info} + # * {::Google::Cloud::Retail::V2::Product#availability Product.availability} + # * {::Google::Cloud::Retail::V2::Product#available_quantity Product.available_quantity} + # * {::Google::Cloud::Retail::V2::Product#fulfillment_info Product.fulfillment_info} + # + # If a full overwrite of inventory information while ignoring timestamps is + # needed, + # {::Google::Cloud::Retail::V2::ProductService::Client#update_product ProductService.UpdateProduct} + # should be invoked instead. + # @!attribute [rw] set_mask + # @return [::Google::Protobuf::FieldMask] + # Indicates which inventory fields in the provided + # {::Google::Cloud::Retail::V2::Product Product} to update. + # + # At least one field must be provided. + # + # If an unsupported or unknown field is provided, an INVALID_ARGUMENT error + # is returned and the entire update will be ignored. + # @!attribute [rw] set_time + # @return [::Google::Protobuf::Timestamp] + # The time when the request is issued, used to prevent + # out-of-order updates on inventory fields with the last update time + # recorded. If not provided, the internal system time will be used. + # @!attribute [rw] allow_missing + # @return [::Boolean] + # If set to true, and the {::Google::Cloud::Retail::V2::Product Product} with name + # {::Google::Cloud::Retail::V2::Product#name Product.name} is not found, the + # inventory update will still be processed and retained for at most 1 day + # until the {::Google::Cloud::Retail::V2::Product Product} is created. If set to + # false, a NOT_FOUND error is returned if the + # {::Google::Cloud::Retail::V2::Product Product} is not found. + class SetInventoryRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Metadata related to the progress of the SetInventory operation. + # Currently empty because there is no meaningful metadata populated from the + # {::Google::Cloud::Retail::V2::ProductService::Client#set_inventory ProductService.SetInventory} + # method. + class SetInventoryMetadata + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Response of the SetInventoryRequest. Currently empty because + # there is no meaningful response populated from the + # {::Google::Cloud::Retail::V2::ProductService::Client#set_inventory ProductService.SetInventory} + # method. + class SetInventoryResponse + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Request message for + # {::Google::Cloud::Retail::V2::ProductService::Client#add_fulfillment_places ProductService.AddFulfillmentPlaces} + # method. + # @!attribute [rw] product + # @return [::String] + # Required. Full resource name of {::Google::Cloud::Retail::V2::Product Product}, + # such as + # `projects/*/locations/global/catalogs/default_catalog/branches/default_branch/products/some_product_id`. + # + # If the caller does not have permission to access the + # {::Google::Cloud::Retail::V2::Product Product}, regardless of whether or not it + # exists, a PERMISSION_DENIED error is returned. + # @!attribute [rw] type + # @return [::String] + # Required. The fulfillment type, including commonly used types (such as + # pickup in store and same day delivery), and custom types. + # + # Supported values: + # + # * "pickup-in-store" + # * "ship-to-store" + # * "same-day-delivery" + # * "next-day-delivery" + # * "custom-type-1" + # * "custom-type-2" + # * "custom-type-3" + # * "custom-type-4" + # * "custom-type-5" + # + # If this field is set to an invalid value other than these, an + # INVALID_ARGUMENT error is returned. + # + # This field directly corresponds to + # {::Google::Cloud::Retail::V2::FulfillmentInfo#type Product.fulfillment_info.type}. + # @!attribute [rw] place_ids + # @return [::Array<::String>] + # Required. The IDs for this + # {::Google::Cloud::Retail::V2::AddFulfillmentPlacesRequest#type type}, such as + # the store IDs for "pickup-in-store" or the region IDs for + # "same-day-delivery" to be added for this + # {::Google::Cloud::Retail::V2::AddFulfillmentPlacesRequest#type type}. Duplicate + # IDs will be automatically ignored. + # + # At least 1 value is required, and a maximum of 2000 values are allowed. + # Each value must be a string with a length limit of 10 characters, matching + # the pattern `[a-zA-Z0-9_-]+`, such as "store1" or "REGION-2". Otherwise, an + # INVALID_ARGUMENT error is returned. + # + # If the total number of place IDs exceeds 2000 for this + # {::Google::Cloud::Retail::V2::AddFulfillmentPlacesRequest#type type} after + # adding, then the update will be rejected. + # @!attribute [rw] add_time + # @return [::Google::Protobuf::Timestamp] + # The time when the fulfillment updates are issued, used to prevent + # out-of-order updates on fulfillment information. If not provided, the + # internal system time will be used. + # @!attribute [rw] allow_missing + # @return [::Boolean] + # If set to true, and the {::Google::Cloud::Retail::V2::Product Product} is not + # found, the fulfillment information will still be processed and retained for + # at most 1 day and processed once the + # {::Google::Cloud::Retail::V2::Product Product} is created. If set to false, a + # NOT_FOUND error is returned if the + # {::Google::Cloud::Retail::V2::Product Product} is not found. + class AddFulfillmentPlacesRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Metadata related to the progress of the AddFulfillmentPlaces operation. + # Currently empty because there is no meaningful metadata populated from the + # {::Google::Cloud::Retail::V2::ProductService::Client#add_fulfillment_places ProductService.AddFulfillmentPlaces} + # method. + class AddFulfillmentPlacesMetadata + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Response of the AddFulfillmentPlacesRequest. Currently empty because + # there is no meaningful response populated from the + # {::Google::Cloud::Retail::V2::ProductService::Client#add_fulfillment_places ProductService.AddFulfillmentPlaces} + # method. + class AddFulfillmentPlacesResponse + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Request message for + # {::Google::Cloud::Retail::V2::ProductService::Client#add_local_inventories ProductService.AddLocalInventories} + # method. + # @!attribute [rw] product + # @return [::String] + # Required. Full resource name of {::Google::Cloud::Retail::V2::Product Product}, + # such as + # `projects/*/locations/global/catalogs/default_catalog/branches/default_branch/products/some_product_id`. + # + # If the caller does not have permission to access the + # {::Google::Cloud::Retail::V2::Product Product}, regardless of whether or not it + # exists, a PERMISSION_DENIED error is returned. + # @!attribute [rw] local_inventories + # @return [::Array<::Google::Cloud::Retail::V2::LocalInventory>] + # Required. A list of inventory information at difference places. Each place + # is identified by its place ID. At most 3000 inventories are allowed per + # request. + # @!attribute [rw] add_mask + # @return [::Google::Protobuf::FieldMask] + # Indicates which inventory fields in the provided list of + # {::Google::Cloud::Retail::V2::LocalInventory LocalInventory} to update. The + # field is updated to the provided value. + # + # If a field is set while the place does not have a previous local inventory, + # the local inventory at that store is created. + # + # If a field is set while the value of that field is not provided, the + # original field value, if it exists, is deleted. + # + # If the mask is not set or set with empty paths, all inventory fields will + # be updated. + # + # If an unsupported or unknown field is provided, an INVALID_ARGUMENT error + # is returned and the entire update will be ignored. + # @!attribute [rw] add_time + # @return [::Google::Protobuf::Timestamp] + # The time when the inventory updates are issued. Used to prevent + # out-of-order updates on local inventory fields. If not provided, the + # internal system time will be used. + # @!attribute [rw] allow_missing + # @return [::Boolean] + # If set to true, and the {::Google::Cloud::Retail::V2::Product Product} is not + # found, the local inventory will still be processed and retained for at most + # 1 day and processed once the {::Google::Cloud::Retail::V2::Product Product} is + # created. If set to false, a NOT_FOUND error is returned if the + # {::Google::Cloud::Retail::V2::Product Product} is not found. + class AddLocalInventoriesRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Metadata related to the progress of the AddLocalInventories operation. + # Currently empty because there is no meaningful metadata populated from the + # {::Google::Cloud::Retail::V2::ProductService::Client#add_local_inventories ProductService.AddLocalInventories} + # method. + class AddLocalInventoriesMetadata + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Response of the + # {::Google::Cloud::Retail::V2::ProductService::Client#add_local_inventories ProductService.AddLocalInventories} + # API. Currently empty because there is no meaningful response populated from + # the + # {::Google::Cloud::Retail::V2::ProductService::Client#add_local_inventories ProductService.AddLocalInventories} + # method. + class AddLocalInventoriesResponse + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Request message for + # {::Google::Cloud::Retail::V2::ProductService::Client#remove_local_inventories ProductService.RemoveLocalInventories} + # method. + # @!attribute [rw] product + # @return [::String] + # Required. Full resource name of {::Google::Cloud::Retail::V2::Product Product}, + # such as + # `projects/*/locations/global/catalogs/default_catalog/branches/default_branch/products/some_product_id`. + # + # If the caller does not have permission to access the + # {::Google::Cloud::Retail::V2::Product Product}, regardless of whether or not it + # exists, a PERMISSION_DENIED error is returned. + # @!attribute [rw] place_ids + # @return [::Array<::String>] + # Required. A list of place IDs to have their inventory deleted. + # At most 3000 place IDs are allowed per request. + # @!attribute [rw] remove_time + # @return [::Google::Protobuf::Timestamp] + # The time when the inventory deletions are issued. Used to prevent + # out-of-order updates and deletions on local inventory fields. If not + # provided, the internal system time will be used. + # @!attribute [rw] allow_missing + # @return [::Boolean] + # If set to true, and the {::Google::Cloud::Retail::V2::Product Product} is not + # found, the local inventory removal request will still be processed and + # retained for at most 1 day and processed once the + # {::Google::Cloud::Retail::V2::Product Product} is created. If set to false, a + # NOT_FOUND error is returned if the + # {::Google::Cloud::Retail::V2::Product Product} is not found. + class RemoveLocalInventoriesRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Metadata related to the progress of the RemoveLocalInventories operation. + # Currently empty because there is no meaningful metadata populated from the + # {::Google::Cloud::Retail::V2::ProductService::Client#remove_local_inventories ProductService.RemoveLocalInventories} + # method. + class RemoveLocalInventoriesMetadata + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Response of the + # {::Google::Cloud::Retail::V2::ProductService::Client#remove_local_inventories ProductService.RemoveLocalInventories} + # API. Currently empty because there is no meaningful response populated from + # the + # {::Google::Cloud::Retail::V2::ProductService::Client#remove_local_inventories ProductService.RemoveLocalInventories} + # method. + class RemoveLocalInventoriesResponse + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Request message for + # {::Google::Cloud::Retail::V2::ProductService::Client#remove_fulfillment_places ProductService.RemoveFulfillmentPlaces} + # method. + # @!attribute [rw] product + # @return [::String] + # Required. Full resource name of {::Google::Cloud::Retail::V2::Product Product}, + # such as + # `projects/*/locations/global/catalogs/default_catalog/branches/default_branch/products/some_product_id`. + # + # If the caller does not have permission to access the + # {::Google::Cloud::Retail::V2::Product Product}, regardless of whether or not it + # exists, a PERMISSION_DENIED error is returned. + # @!attribute [rw] type + # @return [::String] + # Required. The fulfillment type, including commonly used types (such as + # pickup in store and same day delivery), and custom types. + # + # Supported values: + # + # * "pickup-in-store" + # * "ship-to-store" + # * "same-day-delivery" + # * "next-day-delivery" + # * "custom-type-1" + # * "custom-type-2" + # * "custom-type-3" + # * "custom-type-4" + # * "custom-type-5" + # + # If this field is set to an invalid value other than these, an + # INVALID_ARGUMENT error is returned. + # + # This field directly corresponds to + # {::Google::Cloud::Retail::V2::FulfillmentInfo#type Product.fulfillment_info.type}. + # @!attribute [rw] place_ids + # @return [::Array<::String>] + # Required. The IDs for this + # {::Google::Cloud::Retail::V2::RemoveFulfillmentPlacesRequest#type type}, such as + # the store IDs for "pickup-in-store" or the region IDs for + # "same-day-delivery", to be removed for this + # {::Google::Cloud::Retail::V2::RemoveFulfillmentPlacesRequest#type type}. + # + # At least 1 value is required, and a maximum of 2000 values are allowed. + # Each value must be a string with a length limit of 10 characters, matching + # the pattern `[a-zA-Z0-9_-]+`, such as "store1" or "REGION-2". Otherwise, an + # INVALID_ARGUMENT error is returned. + # @!attribute [rw] remove_time + # @return [::Google::Protobuf::Timestamp] + # The time when the fulfillment updates are issued, used to prevent + # out-of-order updates on fulfillment information. If not provided, the + # internal system time will be used. + # @!attribute [rw] allow_missing + # @return [::Boolean] + # If set to true, and the {::Google::Cloud::Retail::V2::Product Product} is not + # found, the fulfillment information will still be processed and retained for + # at most 1 day and processed once the + # {::Google::Cloud::Retail::V2::Product Product} is created. If set to false, a + # NOT_FOUND error is returned if the + # {::Google::Cloud::Retail::V2::Product Product} is not found. + class RemoveFulfillmentPlacesRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Metadata related to the progress of the RemoveFulfillmentPlaces operation. + # Currently empty because there is no meaningful metadata populated from the + # {::Google::Cloud::Retail::V2::ProductService::Client#remove_fulfillment_places ProductService.RemoveFulfillmentPlaces} + # method. + class RemoveFulfillmentPlacesMetadata + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Response of the RemoveFulfillmentPlacesRequest. Currently empty because there + # is no meaningful response populated from the + # {::Google::Cloud::Retail::V2::ProductService::Client#remove_fulfillment_places ProductService.RemoveFulfillmentPlaces} + # method. + class RemoveFulfillmentPlacesResponse + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-retail-v2/proto_docs/google/cloud/retail/v2/promotion.rb b/owl-bot-staging/google-cloud-retail-v2/proto_docs/google/cloud/retail/v2/promotion.rb new file mode 100644 index 000000000000..1b9a47b22ebd --- /dev/null +++ b/owl-bot-staging/google-cloud-retail-v2/proto_docs/google/cloud/retail/v2/promotion.rb @@ -0,0 +1,43 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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 Retail + module V2 + # Promotion information. + # @!attribute [rw] promotion_id + # @return [::String] + # ID of the promotion. For example, "free gift". + # + # The value must be a UTF-8 encoded string with a length limit of 128 + # characters, and match the pattern: `[a-zA-Z][a-zA-Z0-9_]*`. For example, + # id0LikeThis or ID_1_LIKE_THIS. Otherwise, an INVALID_ARGUMENT error is + # returned. + # + # Corresponds to Google Merchant Center property + # [promotion_id](https://support.google.com/merchants/answer/7050148). + class Promotion + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-retail-v2/proto_docs/google/cloud/retail/v2/purge_config.rb b/owl-bot-staging/google-cloud-retail-v2/proto_docs/google/cloud/retail/v2/purge_config.rb new file mode 100644 index 000000000000..cfeb05692659 --- /dev/null +++ b/owl-bot-staging/google-cloud-retail-v2/proto_docs/google/cloud/retail/v2/purge_config.rb @@ -0,0 +1,178 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + + +module Google + module Cloud + module Retail + module V2 + # Metadata related to the progress of the Purge operation. + # This will be returned by the google.longrunning.Operation.metadata field. + class PurgeMetadata + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Metadata related to the progress of the PurgeProducts operation. + # This will be returned by the google.longrunning.Operation.metadata field. + # @!attribute [rw] create_time + # @return [::Google::Protobuf::Timestamp] + # Operation create time. + # @!attribute [rw] update_time + # @return [::Google::Protobuf::Timestamp] + # Operation last update time. If the operation is done, this is also the + # finish time. + # @!attribute [rw] success_count + # @return [::Integer] + # Count of entries that were deleted successfully. + # @!attribute [rw] failure_count + # @return [::Integer] + # Count of entries that encountered errors while processing. + class PurgeProductsMetadata + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Request message for PurgeProducts method. + # @!attribute [rw] parent + # @return [::String] + # Required. The resource name of the branch under which the products are + # created. The format is + # `projects/${projectId}/locations/global/catalogs/${catalogId}/branches/${branchId}` + # @!attribute [rw] filter + # @return [::String] + # Required. The filter string to specify the products to be deleted with a + # length limit of 5,000 characters. + # + # Empty string filter is not allowed. "*" implies delete all items in a + # branch. + # + # The eligible fields for filtering are: + # + # * `availability`: Double quoted + # {::Google::Cloud::Retail::V2::Product#availability Product.availability} string. + # * `create_time` : in ISO 8601 "zulu" format. + # + # Supported syntax: + # + # * Comparators (">", "<", ">=", "<=", "="). + # Examples: + # * create_time <= "2015-02-13T17:05:46Z" + # * availability = "IN_STOCK" + # + # * Conjunctions ("AND") + # Examples: + # * create_time <= "2015-02-13T17:05:46Z" AND availability = "PREORDER" + # + # * Disjunctions ("OR") + # Examples: + # * create_time <= "2015-02-13T17:05:46Z" OR availability = "IN_STOCK" + # + # * Can support nested queries. + # Examples: + # * (create_time <= "2015-02-13T17:05:46Z" AND availability = "PREORDER") + # OR (create_time >= "2015-02-14T13:03:32Z" AND availability = "IN_STOCK") + # + # * Filter Limits: + # * Filter should not contain more than 6 conditions. + # * Max nesting depth should not exceed 2 levels. + # + # Examples queries: + # * Delete back order products created before a timestamp. + # create_time <= "2015-02-13T17:05:46Z" OR availability = "BACKORDER" + # @!attribute [rw] force + # @return [::Boolean] + # Actually perform the purge. + # If `force` is set to false, the method will return the expected purge count + # without deleting any products. + class PurgeProductsRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Response of the PurgeProductsRequest. If the long running operation is + # successfully done, then this message is returned by the + # google.longrunning.Operations.response field. + # @!attribute [rw] purge_count + # @return [::Integer] + # The total count of products purged as a result of the operation. + # @!attribute [rw] purge_sample + # @return [::Array<::String>] + # A sample of the product names that will be deleted. + # Only populated if `force` is set to false. A max of 100 names will be + # returned and the names are chosen at random. + class PurgeProductsResponse + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Request message for PurgeUserEvents method. + # @!attribute [rw] parent + # @return [::String] + # Required. The resource name of the catalog under which the events are + # created. The format is + # `projects/${projectId}/locations/global/catalogs/${catalogId}` + # @!attribute [rw] filter + # @return [::String] + # Required. The filter string to specify the events to be deleted with a + # length limit of 5,000 characters. Empty string filter is not allowed. The + # eligible fields for filtering are: + # + # * `eventType`: Double quoted + # {::Google::Cloud::Retail::V2::UserEvent#event_type UserEvent.event_type} string. + # * `eventTime`: in ISO 8601 "zulu" format. + # * `visitorId`: Double quoted string. Specifying this will delete all + # events associated with a visitor. + # * `userId`: Double quoted string. Specifying this will delete all events + # associated with a user. + # + # Examples: + # + # * Deleting all events in a time range: + # `eventTime > "2012-04-23T18:25:43.511Z" + # eventTime < "2012-04-23T18:30:43.511Z"` + # * Deleting specific eventType in time range: + # `eventTime > "2012-04-23T18:25:43.511Z" eventType = "detail-page-view"` + # * Deleting all events for a specific visitor: + # `visitorId = "visitor1024"` + # + # The filtering fields are assumed to have an implicit AND. + # @!attribute [rw] force + # @return [::Boolean] + # Actually perform the purge. + # If `force` is set to false, the method will return the expected purge count + # without deleting any user events. + class PurgeUserEventsRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Response of the PurgeUserEventsRequest. If the long running operation is + # successfully done, then this message is returned by the + # google.longrunning.Operations.response field. + # @!attribute [rw] purged_events_count + # @return [::Integer] + # The total count of events purged as a result of the operation. + class PurgeUserEventsResponse + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-retail-v2/proto_docs/google/cloud/retail/v2/safety.rb b/owl-bot-staging/google-cloud-retail-v2/proto_docs/google/cloud/retail/v2/safety.rb new file mode 100644 index 000000000000..c4c11c6cbd93 --- /dev/null +++ b/owl-bot-staging/google-cloud-retail-v2/proto_docs/google/cloud/retail/v2/safety.rb @@ -0,0 +1,96 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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 Retail + module V2 + # Safety settings. + # @!attribute [rw] category + # @return [::Google::Cloud::Retail::V2::HarmCategory] + # Harm category. + # @!attribute [rw] threshold + # @return [::Google::Cloud::Retail::V2::SafetySetting::HarmBlockThreshold] + # The harm block threshold. + # @!attribute [rw] method + # @return [::Google::Cloud::Retail::V2::SafetySetting::HarmBlockMethod] + # Optional. Specify if the threshold is used for probability or severity + # score. If not specified, the threshold is used for probability score. + class SafetySetting + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # Probability based thresholds levels for blocking. + module HarmBlockThreshold + # Unspecified harm block threshold. + HARM_BLOCK_THRESHOLD_UNSPECIFIED = 0 + + # Block low threshold and above (i.e. block more). + BLOCK_LOW_AND_ABOVE = 1 + + # Block medium threshold and above. + BLOCK_MEDIUM_AND_ABOVE = 2 + + # Block only high threshold (i.e. block less). + BLOCK_ONLY_HIGH = 3 + + # Block none. + BLOCK_NONE = 4 + + # Turn off the safety filter. + OFF = 5 + end + + # Probability vs severity. + module HarmBlockMethod + # The harm block method is unspecified. + HARM_BLOCK_METHOD_UNSPECIFIED = 0 + + # The harm block method uses both probability and severity scores. + SEVERITY = 1 + + # The harm block method uses the probability score. + PROBABILITY = 2 + end + end + + # Harm categories that will block the content. + module HarmCategory + # The harm category is unspecified. + HARM_CATEGORY_UNSPECIFIED = 0 + + # The harm category is hate speech. + HARM_CATEGORY_HATE_SPEECH = 1 + + # The harm category is dangerous content. + HARM_CATEGORY_DANGEROUS_CONTENT = 2 + + # The harm category is harassment. + HARM_CATEGORY_HARASSMENT = 3 + + # The harm category is sexually explicit content. + HARM_CATEGORY_SEXUALLY_EXPLICIT = 4 + + # The harm category is civic integrity. + HARM_CATEGORY_CIVIC_INTEGRITY = 5 + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-retail-v2/proto_docs/google/cloud/retail/v2/search_service.rb b/owl-bot-staging/google-cloud-retail-v2/proto_docs/google/cloud/retail/v2/search_service.rb new file mode 100644 index 000000000000..beb964cfdc66 --- /dev/null +++ b/owl-bot-staging/google-cloud-retail-v2/proto_docs/google/cloud/retail/v2/search_service.rb @@ -0,0 +1,1301 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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 Retail + module V2 + # Product attribute which structured by an attribute name and value. This + # structure is used in conversational search filters and answers. For example, + # if we have `name=color` and `value=red`, this means that the color is `red`. + # @!attribute [rw] name + # @return [::String] + # The attribute name. + # @!attribute [rw] value + # @return [::String] + # The attribute value. + class ProductAttributeValue + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Product attribute name and numeric interval. + # @!attribute [rw] name + # @return [::String] + # The attribute name (e.g. "length") + # @!attribute [rw] interval + # @return [::Google::Cloud::Retail::V2::Interval] + # The numeric interval (e.g. [10, 20)) + class ProductAttributeInterval + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # This field specifies the tile information including an attribute key, + # attribute value. More fields will be added in the future, eg: product id + # or product counts, etc. + # @!attribute [rw] product_attribute_value + # @return [::Google::Cloud::Retail::V2::ProductAttributeValue] + # The product attribute key-value. + # + # Note: The following fields are mutually exclusive: `product_attribute_value`, `product_attribute_interval`. If a field in that set is populated, all other fields in the set will automatically be cleared. + # @!attribute [rw] product_attribute_interval + # @return [::Google::Cloud::Retail::V2::ProductAttributeInterval] + # The product attribute key-numeric interval. + # + # Note: The following fields are mutually exclusive: `product_attribute_interval`, `product_attribute_value`. If a field in that set is populated, all other fields in the set will automatically be cleared. + # @!attribute [rw] representative_product_id + # @return [::String] + # The representative product id for this tile. + class Tile + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Request message for + # {::Google::Cloud::Retail::V2::SearchService::Client#search SearchService.Search} method. + # @!attribute [rw] placement + # @return [::String] + # Required. The resource name of the Retail Search serving config, such as + # `projects/*/locations/global/catalogs/default_catalog/servingConfigs/default_serving_config` + # or the name of the legacy placement resource, such as + # `projects/*/locations/global/catalogs/default_catalog/placements/default_search`. + # This field is used to identify the serving config name and the set + # of models that are used to make the search. + # @!attribute [rw] branch + # @return [::String] + # The branch resource name, such as + # `projects/*/locations/global/catalogs/default_catalog/branches/0`. + # + # Use "default_branch" as the branch ID or leave this field empty, to search + # products under the default branch. + # @!attribute [rw] query + # @return [::String] + # Raw search query. + # + # If this field is empty, the request is considered a category browsing + # request and returned results are based on + # {::Google::Cloud::Retail::V2::SearchRequest#filter filter} and + # {::Google::Cloud::Retail::V2::SearchRequest#page_categories page_categories}. + # @!attribute [rw] visitor_id + # @return [::String] + # Required. A unique identifier for tracking visitors. For example, this + # could be implemented with an HTTP cookie, which should be able to uniquely + # identify a visitor on a single device. This unique identifier should not + # change if the visitor logs in or out of the website. + # + # This should be the same identifier as + # {::Google::Cloud::Retail::V2::UserEvent#visitor_id UserEvent.visitor_id}. + # + # The field must be a UTF-8 encoded string with a length limit of 128 + # characters. Otherwise, an INVALID_ARGUMENT error is returned. + # @!attribute [rw] user_info + # @return [::Google::Cloud::Retail::V2::UserInfo] + # User information. + # @!attribute [rw] page_size + # @return [::Integer] + # Maximum number of {::Google::Cloud::Retail::V2::Product Product}s to return. If + # unspecified, defaults to a reasonable value. The maximum allowed value is + # 120. Values above 120 will be coerced to 120. + # + # If this field is negative, an INVALID_ARGUMENT is returned. + # @!attribute [rw] page_token + # @return [::String] + # A page token + # {::Google::Cloud::Retail::V2::SearchResponse#next_page_token SearchResponse.next_page_token}, + # received from a previous + # {::Google::Cloud::Retail::V2::SearchService::Client#search SearchService.Search} call. + # Provide this to retrieve the subsequent page. + # + # When paginating, all other parameters provided to + # {::Google::Cloud::Retail::V2::SearchService::Client#search SearchService.Search} must + # match the call that provided the page token. Otherwise, an INVALID_ARGUMENT + # error is returned. + # @!attribute [rw] offset + # @return [::Integer] + # A 0-indexed integer that specifies the current offset (that is, starting + # result location, amongst the {::Google::Cloud::Retail::V2::Product Product}s + # deemed by the API as relevant) in search results. This field is only + # considered if {::Google::Cloud::Retail::V2::SearchRequest#page_token page_token} + # is unset. + # + # If this field is negative, an INVALID_ARGUMENT is returned. + # @!attribute [rw] filter + # @return [::String] + # The filter syntax consists of an expression language for constructing a + # predicate from one or more fields of the products being filtered. Filter + # expression is case-sensitive. For more information, see + # [Filter](https://cloud.google.com/retail/docs/filter-and-order#filter). + # + # If this field is unrecognizable, an INVALID_ARGUMENT is returned. + # @!attribute [rw] canonical_filter + # @return [::String] + # The default filter that is applied when a user performs a search without + # checking any filters on the search page. + # + # The filter applied to every search request when quality improvement such as + # query expansion is needed. In the case a query does not have a sufficient + # amount of results this filter will be used to determine whether or not to + # enable the query expansion flow. The original filter will still be used for + # the query expanded search. + # This field is strongly recommended to achieve high search quality. + # + # For more information about filter syntax, see + # {::Google::Cloud::Retail::V2::SearchRequest#filter SearchRequest.filter}. + # @!attribute [rw] order_by + # @return [::String] + # The order in which products are returned. Products can be ordered by + # a field in an {::Google::Cloud::Retail::V2::Product Product} object. Leave it + # unset if ordered by relevance. OrderBy expression is case-sensitive. For + # more information, see + # [Order](https://cloud.google.com/retail/docs/filter-and-order#order). + # + # If this field is unrecognizable, an INVALID_ARGUMENT is returned. + # @!attribute [rw] facet_specs + # @return [::Array<::Google::Cloud::Retail::V2::SearchRequest::FacetSpec>] + # Facet specifications for faceted search. If empty, no facets are returned. + # + # A maximum of 200 values are allowed. Otherwise, an INVALID_ARGUMENT error + # is returned. + # @!attribute [rw] dynamic_facet_spec + # @deprecated This field is deprecated and may be removed in the next major version update. + # @return [::Google::Cloud::Retail::V2::SearchRequest::DynamicFacetSpec] + # Deprecated. Refer to https://cloud.google.com/retail/docs/configs#dynamic + # to enable dynamic facets. Do not set this field. + # + # The specification for dynamically generated facets. Notice that only + # textual facets can be dynamically generated. + # @!attribute [rw] boost_spec + # @return [::Google::Cloud::Retail::V2::SearchRequest::BoostSpec] + # Boost specification to boost certain products. For more information, see + # [Boost results](https://cloud.google.com/retail/docs/boosting). + # + # Notice that if both + # {::Google::Cloud::Retail::V2::ServingConfig#boost_control_ids ServingConfig.boost_control_ids} + # and + # {::Google::Cloud::Retail::V2::SearchRequest#boost_spec SearchRequest.boost_spec} + # are set, the boost conditions from both places are evaluated. If a search + # request matches multiple boost conditions, the final boost score is equal + # to the sum of the boost scores from all matched boost conditions. + # @!attribute [rw] query_expansion_spec + # @return [::Google::Cloud::Retail::V2::SearchRequest::QueryExpansionSpec] + # The query expansion specification that specifies the conditions under which + # query expansion occurs. For more information, see [Query + # expansion](https://cloud.google.com/retail/docs/result-size#query_expansion). + # @!attribute [rw] variant_rollup_keys + # @return [::Array<::String>] + # The keys to fetch and rollup the matching + # {::Google::Cloud::Retail::V2::Product::Type::VARIANT variant} + # {::Google::Cloud::Retail::V2::Product Product}s attributes, + # {::Google::Cloud::Retail::V2::FulfillmentInfo FulfillmentInfo} or + # {::Google::Cloud::Retail::V2::LocalInventory LocalInventory}s attributes. The + # attributes from all the matching + # {::Google::Cloud::Retail::V2::Product::Type::VARIANT variant} + # {::Google::Cloud::Retail::V2::Product Product}s or + # {::Google::Cloud::Retail::V2::LocalInventory LocalInventory}s are merged and + # de-duplicated. Notice that rollup attributes will lead to extra query + # latency. Maximum number of keys is 30. + # + # For {::Google::Cloud::Retail::V2::FulfillmentInfo FulfillmentInfo}, a + # fulfillment type and a fulfillment ID must be provided in the format of + # "fulfillmentType.fulfillmentId". E.g., in "pickupInStore.store123", + # "pickupInStore" is fulfillment type and "store123" is the store ID. + # + # Supported keys are: + # + # * colorFamilies + # * price + # * originalPrice + # * discount + # * variantId + # * inventory(place_id,price) + # * inventory(place_id,original_price) + # * inventory(place_id,attributes.key), where key is any key in the + # {::Google::Cloud::Retail::V2::LocalInventory#attributes Product.local_inventories.attributes} + # map. + # * attributes.key, where key is any key in the + # {::Google::Cloud::Retail::V2::Product#attributes Product.attributes} map. + # * pickupInStore.id, where id is any + # {::Google::Cloud::Retail::V2::FulfillmentInfo#place_ids FulfillmentInfo.place_ids} + # for {::Google::Cloud::Retail::V2::FulfillmentInfo#type FulfillmentInfo.type} + # "pickup-in-store". + # * shipToStore.id, where id is any + # {::Google::Cloud::Retail::V2::FulfillmentInfo#place_ids FulfillmentInfo.place_ids} + # for {::Google::Cloud::Retail::V2::FulfillmentInfo#type FulfillmentInfo.type} + # "ship-to-store". + # * sameDayDelivery.id, where id is any + # {::Google::Cloud::Retail::V2::FulfillmentInfo#place_ids FulfillmentInfo.place_ids} + # for {::Google::Cloud::Retail::V2::FulfillmentInfo#type FulfillmentInfo.type} + # "same-day-delivery". + # * nextDayDelivery.id, where id is any + # {::Google::Cloud::Retail::V2::FulfillmentInfo#place_ids FulfillmentInfo.place_ids} + # for {::Google::Cloud::Retail::V2::FulfillmentInfo#type FulfillmentInfo.type} + # "next-day-delivery". + # * customFulfillment1.id, where id is any + # {::Google::Cloud::Retail::V2::FulfillmentInfo#place_ids FulfillmentInfo.place_ids} + # for {::Google::Cloud::Retail::V2::FulfillmentInfo#type FulfillmentInfo.type} + # "custom-type-1". + # * customFulfillment2.id, where id is any + # {::Google::Cloud::Retail::V2::FulfillmentInfo#place_ids FulfillmentInfo.place_ids} + # for {::Google::Cloud::Retail::V2::FulfillmentInfo#type FulfillmentInfo.type} + # "custom-type-2". + # * customFulfillment3.id, where id is any + # {::Google::Cloud::Retail::V2::FulfillmentInfo#place_ids FulfillmentInfo.place_ids} + # for {::Google::Cloud::Retail::V2::FulfillmentInfo#type FulfillmentInfo.type} + # "custom-type-3". + # * customFulfillment4.id, where id is any + # {::Google::Cloud::Retail::V2::FulfillmentInfo#place_ids FulfillmentInfo.place_ids} + # for {::Google::Cloud::Retail::V2::FulfillmentInfo#type FulfillmentInfo.type} + # "custom-type-4". + # * customFulfillment5.id, where id is any + # {::Google::Cloud::Retail::V2::FulfillmentInfo#place_ids FulfillmentInfo.place_ids} + # for {::Google::Cloud::Retail::V2::FulfillmentInfo#type FulfillmentInfo.type} + # "custom-type-5". + # + # If this field is set to an invalid value other than these, an + # INVALID_ARGUMENT error is returned. + # @!attribute [rw] page_categories + # @return [::Array<::String>] + # The categories associated with a category page. Must be set for category + # navigation queries to achieve good search quality. The format should be + # the same as + # {::Google::Cloud::Retail::V2::UserEvent#page_categories UserEvent.page_categories}; + # + # To represent full path of category, use '>' sign to separate different + # hierarchies. If '>' is part of the category name, replace it with + # other character(s). + # + # Category pages include special pages such as sales or promotions. For + # instance, a special sale page may have the category hierarchy: + # "pageCategories" : ["Sales > 2017 Black Friday Deals"]. + # @!attribute [rw] search_mode + # @return [::Google::Cloud::Retail::V2::SearchRequest::SearchMode] + # The search mode of the search request. If not specified, a single search + # request triggers both product search and faceted search. + # @!attribute [rw] personalization_spec + # @return [::Google::Cloud::Retail::V2::SearchRequest::PersonalizationSpec] + # The specification for personalization. + # + # Notice that if both + # {::Google::Cloud::Retail::V2::ServingConfig#personalization_spec ServingConfig.personalization_spec} + # and + # {::Google::Cloud::Retail::V2::SearchRequest#personalization_spec SearchRequest.personalization_spec} + # are set. + # {::Google::Cloud::Retail::V2::SearchRequest#personalization_spec SearchRequest.personalization_spec} + # will override + # {::Google::Cloud::Retail::V2::ServingConfig#personalization_spec ServingConfig.personalization_spec}. + # @!attribute [rw] labels + # @return [::Google::Protobuf::Map{::String => ::String}] + # The labels applied to a resource must meet the following requirements: + # + # * Each resource can have multiple labels, up to a maximum of 64. + # * Each label must be a key-value pair. + # * Keys have a minimum length of 1 character and a maximum length of 63 + # characters and cannot be empty. Values can be empty and have a maximum + # length of 63 characters. + # * Keys and values can contain only lowercase letters, numeric characters, + # underscores, and dashes. All characters must use UTF-8 encoding, and + # international characters are allowed. + # * The key portion of a label must be unique. However, you can use the same + # key with multiple resources. + # * Keys must start with a lowercase letter or international character. + # + # For more information, see [Requirements for + # labels](https://cloud.google.com/resource-manager/docs/creating-managing-labels#requirements) + # in the Resource Manager documentation. + # @!attribute [rw] spell_correction_spec + # @return [::Google::Cloud::Retail::V2::SearchRequest::SpellCorrectionSpec] + # The spell correction specification that specifies the mode under + # which spell correction will take effect. + # @!attribute [rw] entity + # @return [::String] + # The entity for customers that may run multiple different entities, domains, + # sites or regions, for example, `Google US`, `Google Ads`, `Waymo`, + # `google.com`, `youtube.com`, etc. + # If this is set, it should be exactly matched with + # {::Google::Cloud::Retail::V2::UserEvent#entity UserEvent.entity} to get search + # results boosted by entity. + # @!attribute [rw] conversational_search_spec + # @return [::Google::Cloud::Retail::V2::SearchRequest::ConversationalSearchSpec] + # Optional. This field specifies all conversational related parameters + # addition to traditional retail search. + # @!attribute [rw] tile_navigation_spec + # @return [::Google::Cloud::Retail::V2::SearchRequest::TileNavigationSpec] + # Optional. This field specifies tile navigation related parameters. + # @!attribute [rw] language_code + # @return [::String] + # Optional. The BCP-47 language code, such as "en-US" or "sr-Latn" + # [list](https://www.unicode.org/cldr/charts/46/summary/root.html). For more + # information, see [Standardized codes](https://google.aip.dev/143). This + # field helps to better interpret the query. If a value isn't specified, the + # query language code is automatically detected, which may not be accurate. + # @!attribute [rw] region_code + # @return [::String] + # Optional. The Unicode country/region code (CLDR) of a location, such as + # "US" and "419" + # [list](https://www.unicode.org/cldr/charts/46/supplemental/territory_information.html). + # For more information, see [Standardized codes](https://google.aip.dev/143). + # If set, then results will be boosted based on the region_code provided. + # @!attribute [rw] place_id + # @return [::String] + # Optional. An id corresponding to a place, such as a store id or region id. + # When specified, we use the price from the local inventory with the matching + # product's + # {::Google::Cloud::Retail::V2::LocalInventory#place_id LocalInventory.place_id} + # for revenue optimization. + # @!attribute [rw] user_attributes + # @return [::Google::Protobuf::Map{::String => ::Google::Cloud::Retail::V2::StringList}] + # Optional. The user attributes that could be used for personalization of + # search results. + # * Populate at most 100 key-value pairs per query. + # * Only supports string keys and repeated string values. + # * Duplcate keys are not allowed within a single query. + # + # Example: + # user_attributes: [ + # { key: "pets" + # value { + # values: "dog" + # values: "cat" + # } + # }, + # { key: "state" + # value { + # values: "CA" + # } + # } + # ] + class SearchRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # A facet specification to perform faceted search. + # @!attribute [rw] facet_key + # @return [::Google::Cloud::Retail::V2::SearchRequest::FacetSpec::FacetKey] + # Required. The facet key specification. + # @!attribute [rw] limit + # @return [::Integer] + # Maximum of facet values that should be returned for this facet. If + # unspecified, defaults to 50. The maximum allowed value is 300. Values + # above 300 will be coerced to 300. + # + # If this field is negative, an INVALID_ARGUMENT is returned. + # @!attribute [rw] excluded_filter_keys + # @return [::Array<::String>] + # List of keys to exclude when faceting. + # + # By default, + # {::Google::Cloud::Retail::V2::SearchRequest::FacetSpec::FacetKey#key FacetKey.key} + # is not excluded from the filter unless it is listed in this field. + # + # Listing a facet key in this field allows its values to appear as facet + # results, even when they are filtered out of search results. Using this + # field does not affect what search results are returned. + # + # For example, suppose there are 100 products with the color facet "Red" + # and 200 products with the color facet "Blue". A query containing the + # filter "colorFamilies:ANY("Red")" and having "colorFamilies" as + # {::Google::Cloud::Retail::V2::SearchRequest::FacetSpec::FacetKey#key FacetKey.key} + # would by default return only "Red" products in the search results, and + # also return "Red" with count 100 as the only color facet. Although there + # are also blue products available, "Blue" would not be shown as an + # available facet value. + # + # If "colorFamilies" is listed in "excludedFilterKeys", then the query + # returns the facet values "Red" with count 100 and "Blue" with count + # 200, because the "colorFamilies" key is now excluded from the filter. + # Because this field doesn't affect search results, the search results + # are still correctly filtered to return only "Red" products. + # + # A maximum of 100 values are allowed. Otherwise, an INVALID_ARGUMENT error + # is returned. + # @!attribute [rw] enable_dynamic_position + # @return [::Boolean] + # Enables dynamic position for this facet. If set to true, the position of + # this facet among all facets in the response is determined by Google + # Retail Search. It is ordered together with dynamic facets if dynamic + # facets is enabled. If set to false, the position of this facet in the + # response is the same as in the request, and it is ranked before + # the facets with dynamic position enable and all dynamic facets. + # + # For example, you may always want to have rating facet returned in + # the response, but it's not necessarily to always display the rating facet + # at the top. In that case, you can set enable_dynamic_position to true so + # that the position of rating facet in response is determined by + # Google Retail Search. + # + # Another example, assuming you have the following facets in the request: + # + # * "rating", enable_dynamic_position = true + # + # * "price", enable_dynamic_position = false + # + # * "brands", enable_dynamic_position = false + # + # And also you have a dynamic facets enable, which generates a facet + # "gender". Then, the final order of the facets in the response can be + # ("price", "brands", "rating", "gender") or ("price", "brands", "gender", + # "rating") depends on how Google Retail Search orders "gender" and + # "rating" facets. However, notice that "price" and "brands" are always + # ranked at first and second position because their enable_dynamic_position + # values are false. + class FacetSpec + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # Specifies how a facet is computed. + # @!attribute [rw] key + # @return [::String] + # Required. Supported textual and numerical facet keys in + # {::Google::Cloud::Retail::V2::Product Product} object, over which the facet + # values are computed. Facet key is case-sensitive. + # + # Allowed facet keys when + # {::Google::Cloud::Retail::V2::SearchRequest::FacetSpec::FacetKey#query FacetKey.query} + # is not specified: + # + # * textual_field = + # * "brands" + # * "categories" + # * "genders" + # * "ageGroups" + # * "availability" + # * "colorFamilies" + # * "colors" + # * "sizes" + # * "materials" + # * "patterns" + # * "conditions" + # * "attributes.key" + # * "pickupInStore" + # * "shipToStore" + # * "sameDayDelivery" + # * "nextDayDelivery" + # * "customFulfillment1" + # * "customFulfillment2" + # * "customFulfillment3" + # * "customFulfillment4" + # * "customFulfillment5" + # * "inventory(place_id,attributes.key)" + # + # * numerical_field = + # * "price" + # * "discount" + # * "rating" + # * "ratingCount" + # * "attributes.key" + # * "inventory(place_id,price)" + # * "inventory(place_id,original_price)" + # * "inventory(place_id,attributes.key)" + # @!attribute [rw] intervals + # @return [::Array<::Google::Cloud::Retail::V2::Interval>] + # Set only if values should be bucketized into intervals. Must be set + # for facets with numerical values. Must not be set for facet with text + # values. Maximum number of intervals is 40. + # + # For all numerical facet keys that appear in the list of products from + # the catalog, the percentiles 0, 10, 30, 50, 70, 90, and 100 are + # computed from their distribution weekly. If the model assigns a high + # score to a numerical facet key and its intervals are not specified in + # the search request, these percentiles become the bounds + # for its intervals and are returned in the response. If the + # facet key intervals are specified in the request, then the specified + # intervals are returned instead. + # @!attribute [rw] restricted_values + # @return [::Array<::String>] + # Only get facet for the given restricted values. For example, when using + # "pickupInStore" as key and set restricted values to + # ["store123", "store456"], only facets for "store123" and "store456" are + # returned. Only supported on predefined textual fields, custom textual + # attributes and fulfillments. Maximum is 20. + # + # Must be set for the fulfillment facet keys: + # + # * pickupInStore + # + # * shipToStore + # + # * sameDayDelivery + # + # * nextDayDelivery + # + # * customFulfillment1 + # + # * customFulfillment2 + # + # * customFulfillment3 + # + # * customFulfillment4 + # + # * customFulfillment5 + # @!attribute [rw] prefixes + # @return [::Array<::String>] + # Only get facet values that start with the given string prefix. For + # example, suppose "categories" has three values "Women > Shoe", + # "Women > Dress" and "Men > Shoe". If set "prefixes" to "Women", the + # "categories" facet gives only "Women > Shoe" and "Women > Dress". + # Only supported on textual fields. Maximum is 10. + # @!attribute [rw] contains + # @return [::Array<::String>] + # Only get facet values that contains the given strings. For example, + # suppose "categories" has three values "Women > Shoe", + # "Women > Dress" and "Men > Shoe". If set "contains" to "Shoe", the + # "categories" facet gives only "Women > Shoe" and "Men > Shoe". + # Only supported on textual fields. Maximum is 10. + # @!attribute [rw] case_insensitive + # @return [::Boolean] + # True to make facet keys case insensitive when getting faceting + # values with prefixes or contains; false otherwise. + # @!attribute [rw] order_by + # @return [::String] + # The order in which + # {::Google::Cloud::Retail::V2::SearchResponse::Facet#values SearchResponse.Facet.values} + # are returned. + # + # Allowed values are: + # + # * "count desc", which means order by + # {::Google::Cloud::Retail::V2::SearchResponse::Facet::FacetValue#count SearchResponse.Facet.values.count} + # descending. + # + # * "value desc", which means order by + # {::Google::Cloud::Retail::V2::SearchResponse::Facet::FacetValue#value SearchResponse.Facet.values.value} + # descending. + # Only applies to textual facets. + # + # If not set, textual values are sorted in [natural + # order](https://en.wikipedia.org/wiki/Natural_sort_order); numerical + # intervals are sorted in the order given by + # {::Google::Cloud::Retail::V2::SearchRequest::FacetSpec::FacetKey#intervals FacetSpec.FacetKey.intervals}; + # {::Google::Cloud::Retail::V2::FulfillmentInfo#place_ids FulfillmentInfo.place_ids} + # are sorted in the order given by + # {::Google::Cloud::Retail::V2::SearchRequest::FacetSpec::FacetKey#restricted_values FacetSpec.FacetKey.restricted_values}. + # @!attribute [rw] query + # @return [::String] + # The query that is used to compute facet for the given facet key. + # When provided, it overrides the default behavior of facet + # computation. The query syntax is the same as a filter expression. See + # {::Google::Cloud::Retail::V2::SearchRequest#filter SearchRequest.filter} for + # detail syntax and limitations. Notice that there is no limitation on + # {::Google::Cloud::Retail::V2::SearchRequest::FacetSpec::FacetKey#key FacetKey.key} + # when query is specified. + # + # In the response, + # {::Google::Cloud::Retail::V2::SearchResponse::Facet::FacetValue#value SearchResponse.Facet.values.value} + # is always "1" and + # {::Google::Cloud::Retail::V2::SearchResponse::Facet::FacetValue#count SearchResponse.Facet.values.count} + # is the number of results that match the query. + # + # For example, you can set a customized facet for "shipToStore", + # where + # {::Google::Cloud::Retail::V2::SearchRequest::FacetSpec::FacetKey#key FacetKey.key} + # is "customizedShipToStore", and + # {::Google::Cloud::Retail::V2::SearchRequest::FacetSpec::FacetKey#query FacetKey.query} + # is "availability: ANY(\"IN_STOCK\") AND shipToStore: ANY(\"123\")". + # Then the facet counts the products that are both in stock and ship + # to store "123". + # @!attribute [rw] return_min_max + # @return [::Boolean] + # Returns the min and max value for each numerical facet intervals. + # Ignored for textual facets. + class FacetKey + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end + + # The specifications of dynamically generated facets. + # @!attribute [rw] mode + # @return [::Google::Cloud::Retail::V2::SearchRequest::DynamicFacetSpec::Mode] + # Mode of the DynamicFacet feature. + # Defaults to + # {::Google::Cloud::Retail::V2::SearchRequest::DynamicFacetSpec::Mode::DISABLED Mode.DISABLED} + # if it's unset. + class DynamicFacetSpec + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # Enum to control DynamicFacet mode + module Mode + # Default value. + MODE_UNSPECIFIED = 0 + + # Disable Dynamic Facet. + DISABLED = 1 + + # Automatic mode built by Google Retail Search. + ENABLED = 2 + end + end + + # Boost specification to boost certain items. + # @!attribute [rw] condition_boost_specs + # @return [::Array<::Google::Cloud::Retail::V2::SearchRequest::BoostSpec::ConditionBoostSpec>] + # Condition boost specifications. If a product matches multiple conditions + # in the specifications, boost scores from these specifications are all + # applied and combined in a non-linear way. Maximum number of + # specifications is 20. + # @!attribute [rw] skip_boost_spec_validation + # @return [::Boolean] + # Whether to skip boostspec validation. If this field is set to true, + # invalid + # {::Google::Cloud::Retail::V2::SearchRequest::BoostSpec#condition_boost_specs BoostSpec.condition_boost_specs} + # will be ignored and valid + # {::Google::Cloud::Retail::V2::SearchRequest::BoostSpec#condition_boost_specs BoostSpec.condition_boost_specs} + # will still be applied. + class BoostSpec + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # Boost applies to products which match a condition. + # @!attribute [rw] condition + # @return [::String] + # An expression which specifies a boost condition. The syntax and + # supported fields are the same as a filter expression. See + # {::Google::Cloud::Retail::V2::SearchRequest#filter SearchRequest.filter} for + # detail syntax and limitations. + # + # Examples: + # + # * To boost products with product ID "product_1" or "product_2", and + # color + # "Red" or "Blue": + # * (id: ANY("product_1", "product_2")) AND (colorFamilies: + # ANY("Red","Blue")) + # @!attribute [rw] boost + # @return [::Float] + # Strength of the condition boost, which should be in [-1, 1]. Negative + # boost means demotion. Default is 0.0. + # + # Setting to 1.0 gives the item a big promotion. However, it does not + # necessarily mean that the boosted item will be the top result at all + # times, nor that other items will be excluded. Results could still be + # shown even when none of them matches the condition. And results that + # are significantly more relevant to the search query can still trump + # your heavily favored but irrelevant items. + # + # Setting to -1.0 gives the item a big demotion. However, results that + # are deeply relevant might still be shown. The item will have an + # upstream battle to get a fairly high ranking, but it is not blocked out + # completely. + # + # Setting to 0.0 means no boost applied. The boosting condition is + # ignored. + class ConditionBoostSpec + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end + + # Specification to determine under which conditions query expansion should + # occur. + # @!attribute [rw] condition + # @return [::Google::Cloud::Retail::V2::SearchRequest::QueryExpansionSpec::Condition] + # The condition under which query expansion should occur. Default to + # {::Google::Cloud::Retail::V2::SearchRequest::QueryExpansionSpec::Condition::DISABLED Condition.DISABLED}. + # @!attribute [rw] pin_unexpanded_results + # @return [::Boolean] + # Whether to pin unexpanded results. The default value is false. If this + # field is set to true, + # unexpanded products are always at the top of the search results, followed + # by the expanded results. + class QueryExpansionSpec + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # Enum describing under which condition query expansion should occur. + module Condition + # Unspecified query expansion condition. In this case, server behavior + # defaults to + # {::Google::Cloud::Retail::V2::SearchRequest::QueryExpansionSpec::Condition::DISABLED Condition.DISABLED}. + CONDITION_UNSPECIFIED = 0 + + # Disabled query expansion. Only the exact search query is used, even if + # {::Google::Cloud::Retail::V2::SearchResponse#total_size SearchResponse.total_size} + # is zero. + DISABLED = 1 + + # Automatic query expansion built by Google Retail Search. + AUTO = 3 + end + end + + # The specification for personalization. + # @!attribute [rw] mode + # @return [::Google::Cloud::Retail::V2::SearchRequest::PersonalizationSpec::Mode] + # Defaults to + # {::Google::Cloud::Retail::V2::SearchRequest::PersonalizationSpec::Mode::AUTO Mode.AUTO}. + class PersonalizationSpec + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # The personalization mode of each search request. + module Mode + # Default value. In this case, server behavior defaults to + # {::Google::Cloud::Retail::V2::SearchRequest::PersonalizationSpec::Mode::AUTO Mode.AUTO}. + MODE_UNSPECIFIED = 0 + + # Let CRS decide whether to use personalization based on quality of user + # event data. + AUTO = 1 + + # Disable personalization. + DISABLED = 2 + end + end + + # The specification for query spell correction. + # @!attribute [rw] mode + # @return [::Google::Cloud::Retail::V2::SearchRequest::SpellCorrectionSpec::Mode] + # The mode under which spell correction should take effect to + # replace the original search query. Default to + # {::Google::Cloud::Retail::V2::SearchRequest::SpellCorrectionSpec::Mode::AUTO Mode.AUTO}. + class SpellCorrectionSpec + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # Enum describing under which mode spell correction should occur. + module Mode + # Unspecified spell correction mode. In this case, server behavior + # defaults to + # {::Google::Cloud::Retail::V2::SearchRequest::SpellCorrectionSpec::Mode::AUTO Mode.AUTO}. + MODE_UNSPECIFIED = 0 + + # Google Retail Search will try to find a spell suggestion if there + # is any and put in the + # {::Google::Cloud::Retail::V2::SearchResponse#corrected_query SearchResponse.corrected_query}. + # The spell suggestion will not be used as the search query. + SUGGESTION_ONLY = 1 + + # Automatic spell correction built by Google Retail Search. Search will + # be based on the corrected query if found. + AUTO = 2 + end + end + + # This field specifies all conversational related parameters addition to + # traditional retail search. + # @!attribute [rw] followup_conversation_requested + # @return [::Boolean] + # This field specifies whether the customer would like to do conversational + # search. If this field is set to true, conversational related extra + # information will be returned from server side, including follow-up + # question, answer options, etc. + # @!attribute [rw] conversation_id + # @return [::String] + # This field specifies the conversation id, which maintains the state of + # the conversation between client side and server side. Use the value from + # the previous [ConversationalSearchResult.conversation_id][]. For the + # initial request, this should be empty. + # @!attribute [rw] user_answer + # @return [::Google::Cloud::Retail::V2::SearchRequest::ConversationalSearchSpec::UserAnswer] + # This field specifies the current user answer during the conversational + # search. This can be either user selected from suggested answers or user + # input plain text. + class ConversationalSearchSpec + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # This field specifies the current user answer during the conversational + # search. This can be either user selected from suggested answers or user + # input plain text. + # @!attribute [rw] text_answer + # @return [::String] + # This field specifies the incremental input text from the user during + # the conversational search. + # + # Note: The following fields are mutually exclusive: `text_answer`, `selected_answer`. If a field in that set is populated, all other fields in the set will automatically be cleared. + # @!attribute [rw] selected_answer + # @return [::Google::Cloud::Retail::V2::SearchRequest::ConversationalSearchSpec::UserAnswer::SelectedAnswer] + # This field specifies the selected attributes during the + # conversational search. This should be a subset of + # [ConversationalSearchResult.suggested_answers][]. + # + # Note: The following fields are mutually exclusive: `selected_answer`, `text_answer`. If a field in that set is populated, all other fields in the set will automatically be cleared. + class UserAnswer + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # This field specifies the selected answers during the conversational + # search. + # @!attribute [rw] product_attribute_values + # @deprecated This field is deprecated and may be removed in the next major version update. + # @return [::Array<::Google::Cloud::Retail::V2::ProductAttributeValue>] + # This field is deprecated and should not be set. + # @!attribute [rw] product_attribute_value + # @return [::Google::Cloud::Retail::V2::ProductAttributeValue] + # This field specifies the selected answer which is a attribute + # key-value. + class SelectedAnswer + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end + end + + # This field specifies tile navigation related parameters. + # @!attribute [rw] tile_navigation_requested + # @return [::Boolean] + # This field specifies whether the customer would like to request tile + # navigation. + # @!attribute [rw] applied_tiles + # @return [::Array<::Google::Cloud::Retail::V2::Tile>] + # This optional field specifies the tiles which are already clicked in + # client side. While the feature works without this field set, particularly + # for an initial query, it is highly recommended to set this field because + # it can improve the quality of the search response and removes possible + # duplicate tiles. + # + # NOTE: This field is not being used for filtering search + # products. Client side should also put all the applied tiles in + # {::Google::Cloud::Retail::V2::SearchRequest#filter SearchRequest.filter}. + class TileNavigationSpec + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # @!attribute [rw] key + # @return [::String] + # @!attribute [rw] value + # @return [::String] + class LabelsEntry + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # @!attribute [rw] key + # @return [::String] + # @!attribute [rw] value + # @return [::Google::Cloud::Retail::V2::StringList] + class UserAttributesEntry + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # The search mode of each search request. + module SearchMode + # Default value. In this case both product search and faceted search will + # be performed. Both + # {::Google::Cloud::Retail::V2::SearchResponse::SearchResult SearchResponse.SearchResult} + # and {::Google::Cloud::Retail::V2::SearchResponse::Facet SearchResponse.Facet} + # will be returned. + SEARCH_MODE_UNSPECIFIED = 0 + + # Only product search will be performed. The faceted search will be + # disabled. + # + # Only + # {::Google::Cloud::Retail::V2::SearchResponse::SearchResult SearchResponse.SearchResult} + # will be returned. + # {::Google::Cloud::Retail::V2::SearchResponse::Facet SearchResponse.Facet} will + # not be returned, even if + # {::Google::Cloud::Retail::V2::SearchRequest#facet_specs SearchRequest.facet_specs} + # or + # {::Google::Cloud::Retail::V2::SearchRequest#dynamic_facet_spec SearchRequest.dynamic_facet_spec} + # is set. + PRODUCT_SEARCH_ONLY = 1 + + # Only faceted search will be performed. The product search will be + # disabled. + # + # When in this mode, one or both of + # {::Google::Cloud::Retail::V2::SearchRequest#facet_specs SearchRequest.facet_specs} + # and + # {::Google::Cloud::Retail::V2::SearchRequest#dynamic_facet_spec SearchRequest.dynamic_facet_spec} + # should be set. Otherwise, an INVALID_ARGUMENT error is returned. Only + # {::Google::Cloud::Retail::V2::SearchResponse::Facet SearchResponse.Facet} will + # be returned. + # {::Google::Cloud::Retail::V2::SearchResponse::SearchResult SearchResponse.SearchResult} + # will not be returned. + FACETED_SEARCH_ONLY = 2 + end + end + + # Response message for + # {::Google::Cloud::Retail::V2::SearchService::Client#search SearchService.Search} method. + # @!attribute [rw] results + # @return [::Array<::Google::Cloud::Retail::V2::SearchResponse::SearchResult>] + # A list of matched items. The order represents the ranking. + # @!attribute [rw] facets + # @return [::Array<::Google::Cloud::Retail::V2::SearchResponse::Facet>] + # Results of facets requested by user. + # @!attribute [rw] total_size + # @return [::Integer] + # The estimated total count of matched items irrespective of pagination. The + # count of {::Google::Cloud::Retail::V2::SearchResponse#results results} returned + # by pagination may be less than the + # {::Google::Cloud::Retail::V2::SearchResponse#total_size total_size} that + # matches. + # @!attribute [rw] corrected_query + # @return [::String] + # Contains the spell corrected query, if found. If the spell correction type + # is AUTOMATIC, then the search results are based on corrected_query. + # Otherwise the original query is used for search. + # @!attribute [rw] attribution_token + # @return [::String] + # A unique search token. This should be included in the + # {::Google::Cloud::Retail::V2::UserEvent UserEvent} logs resulting from this + # search, which enables accurate attribution of search model performance. + # @!attribute [rw] next_page_token + # @return [::String] + # A token that can be sent as + # {::Google::Cloud::Retail::V2::SearchRequest#page_token SearchRequest.page_token} + # to retrieve the next page. If this field is omitted, there are no + # subsequent pages. + # @!attribute [rw] query_expansion_info + # @return [::Google::Cloud::Retail::V2::SearchResponse::QueryExpansionInfo] + # Query expansion information for the returned results. + # @!attribute [rw] redirect_uri + # @return [::String] + # The URI of a customer-defined redirect page. If redirect action is + # triggered, no search is performed, and only + # {::Google::Cloud::Retail::V2::SearchResponse#redirect_uri redirect_uri} and + # {::Google::Cloud::Retail::V2::SearchResponse#attribution_token attribution_token} + # are set in the response. + # @!attribute [rw] applied_controls + # @return [::Array<::String>] + # The fully qualified resource name of applied + # [controls](https://cloud.google.com/retail/docs/serving-control-rules). + # @!attribute [rw] pin_control_metadata + # @return [::Google::Cloud::Retail::V2::PinControlMetadata] + # Metadata for pin controls which were applicable to the request. + # This contains two map fields, one for all matched pins and one for pins + # which were matched but not applied. + # + # The two maps are keyed by pin position, and the values are the product ids + # which were matched to that pin. + # @!attribute [rw] invalid_condition_boost_specs + # @return [::Array<::Google::Cloud::Retail::V2::SearchRequest::BoostSpec::ConditionBoostSpec>] + # The invalid + # {::Google::Cloud::Retail::V2::SearchRequest::BoostSpec#condition_boost_specs SearchRequest.BoostSpec.condition_boost_specs} + # that are not applied during serving. + # @!attribute [rw] experiment_info + # @return [::Array<::Google::Cloud::Retail::V2::ExperimentInfo>] + # Metadata related to A/B testing experiment associated with this + # response. Only exists when an experiment is triggered. + # @!attribute [rw] conversational_search_result + # @return [::Google::Cloud::Retail::V2::SearchResponse::ConversationalSearchResult] + # This field specifies all related information that is needed on client + # side for UI rendering of conversational retail search. + # @!attribute [rw] tile_navigation_result + # @return [::Google::Cloud::Retail::V2::SearchResponse::TileNavigationResult] + # This field specifies all related information for tile navigation that will + # be used in client side. + class SearchResponse + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # Represents the search results. + # @!attribute [rw] id + # @return [::String] + # {::Google::Cloud::Retail::V2::Product#id Product.id} of the searched + # {::Google::Cloud::Retail::V2::Product Product}. + # @!attribute [rw] product + # @return [::Google::Cloud::Retail::V2::Product] + # The product data snippet in the search response. Only + # {::Google::Cloud::Retail::V2::Product#name Product.name} is guaranteed to be + # populated. + # + # {::Google::Cloud::Retail::V2::Product#variants Product.variants} contains the + # product variants that match the search query. If there are multiple + # product variants matching the query, top 5 most relevant product variants + # are returned and ordered by relevancy. + # + # If relevancy can be deternmined, use + # {::Google::Cloud::Retail::V2::SearchResponse::SearchResult#matching_variant_fields matching_variant_fields} + # to look up matched product variants fields. If relevancy cannot be + # determined, e.g. when searching "shoe" all products in a shoe product can + # be a match, 5 product variants are returned but order is meaningless. + # @!attribute [rw] matching_variant_count + # @return [::Integer] + # The count of matched + # {::Google::Cloud::Retail::V2::Product::Type::VARIANT variant} + # {::Google::Cloud::Retail::V2::Product Product}s. + # @!attribute [rw] matching_variant_fields + # @return [::Google::Protobuf::Map{::String => ::Google::Protobuf::FieldMask}] + # If a {::Google::Cloud::Retail::V2::Product::Type::VARIANT variant} + # {::Google::Cloud::Retail::V2::Product Product} matches the search query, this + # map indicates which {::Google::Cloud::Retail::V2::Product Product} fields are + # matched. The key is the + # {::Google::Cloud::Retail::V2::Product#name Product.name}, the value is a field + # mask of the matched {::Google::Cloud::Retail::V2::Product Product} fields. If + # matched attributes cannot be determined, this map will be empty. + # + # For example, a key "sku1" with field mask + # "products.color_info" indicates there is a match between + # "sku1" {::Google::Cloud::Retail::V2::ColorInfo ColorInfo} and the query. + # @!attribute [rw] variant_rollup_values + # @return [::Google::Protobuf::Map{::String => ::Google::Protobuf::Value}] + # The rollup matching + # {::Google::Cloud::Retail::V2::Product::Type::VARIANT variant} + # {::Google::Cloud::Retail::V2::Product Product} attributes. The key is one of + # the + # {::Google::Cloud::Retail::V2::SearchRequest#variant_rollup_keys SearchRequest.variant_rollup_keys}. + # The values are the merged and de-duplicated + # {::Google::Cloud::Retail::V2::Product Product} attributes. Notice that the + # rollup values are respect filter. For example, when filtering by + # "colorFamilies:ANY(\"red\")" and rollup "colorFamilies", only "red" is + # returned. + # + # For textual and numerical attributes, the rollup values is a list of + # string or double values with type + # {::Google::Protobuf::ListValue google.protobuf.ListValue}. For example, if + # there are two variants with colors "red" and "blue", the rollup values + # are + # + # { key: "colorFamilies" + # value { + # list_value { + # values { string_value: "red" } + # values { string_value: "blue" } + # } + # } + # } + # + # For {::Google::Cloud::Retail::V2::FulfillmentInfo FulfillmentInfo}, the rollup + # values is a double value with type + # {::Google::Protobuf::Value google.protobuf.Value}. For example, + # `{key: "pickupInStore.store1" value { number_value: 10 }}` means a there + # are 10 variants in this product are available in the store "store1". + # @!attribute [rw] personal_labels + # @return [::Array<::String>] + # Specifies previous events related to this product for this user based on + # {::Google::Cloud::Retail::V2::UserEvent UserEvent} with same + # {::Google::Cloud::Retail::V2::SearchRequest#visitor_id SearchRequest.visitor_id} + # or {::Google::Cloud::Retail::V2::UserInfo#user_id UserInfo.user_id}. + # + # This is set only when + # {::Google::Cloud::Retail::V2::SearchRequest::PersonalizationSpec#mode SearchRequest.PersonalizationSpec.mode} + # is + # {::Google::Cloud::Retail::V2::SearchRequest::PersonalizationSpec::Mode::AUTO SearchRequest.PersonalizationSpec.Mode.AUTO}. + # + # Possible values: + # + # * `purchased`: Indicates that this product has been purchased before. + # @!attribute [rw] model_scores + # @return [::Google::Protobuf::Map{::String => ::Google::Cloud::Retail::V2::DoubleList}] + # Google provided available scores. + class SearchResult + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # @!attribute [rw] key + # @return [::String] + # @!attribute [rw] value + # @return [::Google::Protobuf::FieldMask] + class MatchingVariantFieldsEntry + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # @!attribute [rw] key + # @return [::String] + # @!attribute [rw] value + # @return [::Google::Protobuf::Value] + class VariantRollupValuesEntry + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # @!attribute [rw] key + # @return [::String] + # @!attribute [rw] value + # @return [::Google::Cloud::Retail::V2::DoubleList] + class ModelScoresEntry + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end + + # A facet result. + # @!attribute [rw] key + # @return [::String] + # The key for this facet. E.g., "colorFamilies" or "price" or + # "attributes.attr1". + # @!attribute [rw] values + # @return [::Array<::Google::Cloud::Retail::V2::SearchResponse::Facet::FacetValue>] + # The facet values for this field. + # @!attribute [rw] dynamic_facet + # @return [::Boolean] + # Whether the facet is dynamically generated. + class Facet + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # A facet value which contains value names and their count. + # @!attribute [rw] value + # @return [::String] + # Text value of a facet, such as "Black" for facet "colorFamilies". + # + # Note: The following fields are mutually exclusive: `value`, `interval`. If a field in that set is populated, all other fields in the set will automatically be cleared. + # @!attribute [rw] interval + # @return [::Google::Cloud::Retail::V2::Interval] + # Interval value for a facet, such as [10, 20) for facet "price". + # + # Note: The following fields are mutually exclusive: `interval`, `value`. If a field in that set is populated, all other fields in the set will automatically be cleared. + # @!attribute [rw] count + # @return [::Integer] + # Number of items that have this facet value. + # @!attribute [rw] min_value + # @return [::Float] + # The minimum value in the + # {::Google::Cloud::Retail::V2::SearchResponse::Facet::FacetValue#interval FacetValue.interval}. + # Only supported on numerical facets and returned if + # {::Google::Cloud::Retail::V2::SearchRequest::FacetSpec::FacetKey#return_min_max SearchRequest.FacetSpec.FacetKey.return_min_max} + # is true. + # @!attribute [rw] max_value + # @return [::Float] + # The maximum value in the + # {::Google::Cloud::Retail::V2::SearchResponse::Facet::FacetValue#interval FacetValue.interval}. + # Only supported on numerical facets and returned if + # {::Google::Cloud::Retail::V2::SearchRequest::FacetSpec::FacetKey#return_min_max SearchRequest.FacetSpec.FacetKey.return_min_max} + # is true. + class FacetValue + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end + + # Information describing query expansion including whether expansion has + # occurred. + # @!attribute [rw] expanded_query + # @return [::Boolean] + # Bool describing whether query expansion has occurred. + # @!attribute [rw] pinned_result_count + # @return [::Integer] + # Number of pinned results. This field will only be set when expansion + # happens and + # {::Google::Cloud::Retail::V2::SearchRequest::QueryExpansionSpec#pin_unexpanded_results SearchRequest.QueryExpansionSpec.pin_unexpanded_results} + # is set to true. + class QueryExpansionInfo + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # This field specifies all related information that is needed on client + # side for UI rendering of conversational retail search. + # @!attribute [rw] conversation_id + # @return [::String] + # Conversation UUID. This field will be stored in client side storage to + # maintain the conversation session with server and will be used for next + # search request's + # {::Google::Cloud::Retail::V2::SearchRequest::ConversationalSearchSpec#conversation_id SearchRequest.ConversationalSearchSpec.conversation_id} + # to restore conversation state in server. + # @!attribute [rw] refined_query + # @return [::String] + # The current refined query for the conversational search. This field + # will be used in customer UI that the query in the search bar should be + # replaced with the refined query. For example, if + # {::Google::Cloud::Retail::V2::SearchRequest#query SearchRequest.query} is + # `dress` and next + # {::Google::Cloud::Retail::V2::SearchRequest::ConversationalSearchSpec::UserAnswer#text_answer SearchRequest.ConversationalSearchSpec.UserAnswer.text_answer} + # is `red color`, which does not match any product attribute value filters, + # the refined query will be `dress, red color`. + # @!attribute [rw] additional_filters + # @deprecated This field is deprecated and may be removed in the next major version update. + # @return [::Array<::Google::Cloud::Retail::V2::SearchResponse::ConversationalSearchResult::AdditionalFilter>] + # This field is deprecated but will be kept for backward compatibility. + # There is expected to have only one additional filter and the value will + # be the same to the same as field `additional_filter`. + # @!attribute [rw] followup_question + # @return [::String] + # The follow-up question. e.g., `What is the color?` + # @!attribute [rw] suggested_answers + # @return [::Array<::Google::Cloud::Retail::V2::SearchResponse::ConversationalSearchResult::SuggestedAnswer>] + # The answer options provided to client for the follow-up question. + # @!attribute [rw] additional_filter + # @return [::Google::Cloud::Retail::V2::SearchResponse::ConversationalSearchResult::AdditionalFilter] + # This is the incremental additional filters implied from the current + # user answer. User should add the suggested addition filters to the + # previous + # {::Google::Cloud::Retail::V2::SearchRequest#filter SearchRequest.filter}, and + # use the merged filter in the follow up search request. + class ConversationalSearchResult + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # Suggested answers to the follow-up question. + # @!attribute [rw] product_attribute_value + # @return [::Google::Cloud::Retail::V2::ProductAttributeValue] + # Product attribute value, including an attribute key and an + # attribute value. Other types can be added here in the future. + class SuggestedAnswer + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Additional filter that client side need to apply. + # @!attribute [rw] product_attribute_value + # @return [::Google::Cloud::Retail::V2::ProductAttributeValue] + # Product attribute value, including an attribute key and an + # attribute value. Other types can be added here in the future. + class AdditionalFilter + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end + + # This field specifies all related information for tile navigation that will + # be used in client side. + # @!attribute [rw] tiles + # @return [::Array<::Google::Cloud::Retail::V2::Tile>] + # The current tiles that are used for tile navigation, sorted by + # engagement. + class TileNavigationResult + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end + + # Metadata for active A/B testing experiment. + # @!attribute [rw] serving_config_experiment + # @return [::Google::Cloud::Retail::V2::ExperimentInfo::ServingConfigExperiment] + # A/B test between existing Cloud Retail Search + # {::Google::Cloud::Retail::V2::ServingConfig ServingConfig}s. + # @!attribute [rw] experiment + # @return [::String] + # The fully qualified resource name of the experiment that provides the + # serving config under test, should an active experiment exist. For example: + # `projects/*/locations/global/catalogs/default_catalog/experiments/experiment_id` + class ExperimentInfo + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # Metadata for active serving config A/B tests. + # @!attribute [rw] original_serving_config + # @return [::String] + # The fully qualified resource name of the original + # {::Google::Cloud::Retail::V2::SearchRequest#placement SearchRequest.placement} + # in the search request prior to reassignment by experiment API. For + # example: `projects/*/locations/*/catalogs/*/servingConfigs/*`. + # @!attribute [rw] experiment_serving_config + # @return [::String] + # The fully qualified resource name of the serving config + # `Experiment.VariantArm.serving_config_id` responsible for generating + # the search response. For example: + # `projects/*/locations/*/catalogs/*/servingConfigs/*`. + class ServingConfigExperiment + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-retail-v2/proto_docs/google/cloud/retail/v2/serving_config.rb b/owl-bot-staging/google-cloud-retail-v2/proto_docs/google/cloud/retail/v2/serving_config.rb new file mode 100644 index 000000000000..2237b3c08193 --- /dev/null +++ b/owl-bot-staging/google-cloud-retail-v2/proto_docs/google/cloud/retail/v2/serving_config.rb @@ -0,0 +1,259 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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 Retail + module V2 + # Configures metadata that is used to generate serving time results (e.g. + # search results or recommendation predictions). + # @!attribute [rw] name + # @return [::String] + # Immutable. Fully qualified name + # `projects/*/locations/global/catalogs/*/servingConfig/*` + # @!attribute [rw] display_name + # @return [::String] + # Required. The human readable serving config display name. Used in Retail + # UI. + # + # This field must be a UTF-8 encoded string with a length limit of 128 + # characters. Otherwise, an INVALID_ARGUMENT error is returned. + # @!attribute [rw] model_id + # @return [::String] + # The id of the model in the same {::Google::Cloud::Retail::V2::Catalog Catalog} + # to use at serving time. Currently only RecommendationModels are supported: + # https://cloud.google.com/retail/recommendations-ai/docs/create-models + # Can be changed but only to a compatible model (e.g. + # others-you-may-like CTR to others-you-may-like CVR). + # + # Required when + # {::Google::Cloud::Retail::V2::ServingConfig#solution_types solution_types} is + # {::Google::Cloud::Retail::V2::SolutionType::SOLUTION_TYPE_RECOMMENDATION SOLUTION_TYPE_RECOMMENDATION}. + # @!attribute [rw] price_reranking_level + # @return [::String] + # How much price ranking we want in serving results. + # Price reranking causes product items with a similar + # recommendation probability to be ordered by price, with the + # highest-priced items first. This setting could result in a decrease in + # click-through and conversion rates. + # Allowed values are: + # + # * `no-price-reranking` + # * `low-price-reranking` + # * `medium-price-reranking` + # * `high-price-reranking` + # + # If not specified, we choose default based on model type. Default value: + # `no-price-reranking`. + # + # Can only be set if + # {::Google::Cloud::Retail::V2::ServingConfig#solution_types solution_types} is + # {::Google::Cloud::Retail::V2::SolutionType::SOLUTION_TYPE_RECOMMENDATION SOLUTION_TYPE_RECOMMENDATION}. + # @!attribute [rw] facet_control_ids + # @return [::Array<::String>] + # Facet specifications for faceted search. If empty, no facets are returned. + # The ids refer to the ids of {::Google::Cloud::Retail::V2::Control Control} + # resources with only the Facet control set. These controls are assumed to be + # in the same {::Google::Cloud::Retail::V2::Catalog Catalog} as the + # {::Google::Cloud::Retail::V2::ServingConfig ServingConfig}. + # A maximum of 100 values are allowed. Otherwise, an INVALID_ARGUMENT error + # is returned. + # + # Can only be set if + # {::Google::Cloud::Retail::V2::ServingConfig#solution_types solution_types} is + # {::Google::Cloud::Retail::V2::SolutionType::SOLUTION_TYPE_SEARCH SOLUTION_TYPE_SEARCH}. + # @!attribute [rw] dynamic_facet_spec + # @return [::Google::Cloud::Retail::V2::SearchRequest::DynamicFacetSpec] + # The specification for dynamically generated facets. Notice that only + # textual facets can be dynamically generated. + # + # Can only be set if + # {::Google::Cloud::Retail::V2::ServingConfig#solution_types solution_types} is + # {::Google::Cloud::Retail::V2::SolutionType::SOLUTION_TYPE_SEARCH SOLUTION_TYPE_SEARCH}. + # @!attribute [rw] boost_control_ids + # @return [::Array<::String>] + # Condition boost specifications. If a product matches multiple conditions + # in the specifications, boost scores from these specifications are all + # applied and combined in a non-linear way. Maximum number of + # specifications is 100. + # + # Notice that if both + # {::Google::Cloud::Retail::V2::ServingConfig#boost_control_ids ServingConfig.boost_control_ids} + # and + # {::Google::Cloud::Retail::V2::SearchRequest#boost_spec SearchRequest.boost_spec} + # are set, the boost conditions from both places are evaluated. If a search + # request matches multiple boost conditions, the final boost score is equal + # to the sum of the boost scores from all matched boost conditions. + # + # Can only be set if + # {::Google::Cloud::Retail::V2::ServingConfig#solution_types solution_types} is + # {::Google::Cloud::Retail::V2::SolutionType::SOLUTION_TYPE_SEARCH SOLUTION_TYPE_SEARCH}. + # @!attribute [rw] filter_control_ids + # @return [::Array<::String>] + # Condition filter specifications. If a product matches multiple conditions + # in the specifications, filters from these specifications are all + # applied and combined via the AND operator. Maximum number of + # specifications is 100. + # + # Can only be set if + # {::Google::Cloud::Retail::V2::ServingConfig#solution_types solution_types} is + # {::Google::Cloud::Retail::V2::SolutionType::SOLUTION_TYPE_SEARCH SOLUTION_TYPE_SEARCH}. + # @!attribute [rw] redirect_control_ids + # @return [::Array<::String>] + # Condition redirect specifications. Only the first triggered redirect action + # is applied, even if multiple apply. Maximum number of specifications is + # 1000. + # + # Can only be set if + # {::Google::Cloud::Retail::V2::ServingConfig#solution_types solution_types} is + # {::Google::Cloud::Retail::V2::SolutionType::SOLUTION_TYPE_SEARCH SOLUTION_TYPE_SEARCH}. + # @!attribute [rw] twoway_synonyms_control_ids + # @return [::Array<::String>] + # Condition synonyms specifications. If multiple syonyms conditions match, + # all matching synonyms control in the list will execute. Order of controls + # in the list will not matter. Maximum number of specifications is + # 100. + # + # Can only be set if + # {::Google::Cloud::Retail::V2::ServingConfig#solution_types solution_types} is + # {::Google::Cloud::Retail::V2::SolutionType::SOLUTION_TYPE_SEARCH SOLUTION_TYPE_SEARCH}. + # @!attribute [rw] oneway_synonyms_control_ids + # @return [::Array<::String>] + # Condition oneway synonyms specifications. If multiple oneway synonyms + # conditions match, all matching oneway synonyms controls in the list will + # execute. Order of controls in the list will not matter. Maximum number of + # specifications is 100. + # + # Can only be set if + # {::Google::Cloud::Retail::V2::ServingConfig#solution_types solution_types} is + # {::Google::Cloud::Retail::V2::SolutionType::SOLUTION_TYPE_SEARCH SOLUTION_TYPE_SEARCH}. + # @!attribute [rw] do_not_associate_control_ids + # @return [::Array<::String>] + # Condition do not associate specifications. If multiple do not associate + # conditions match, all matching do not associate controls in the list will + # execute. + # - Order does not matter. + # - Maximum number of specifications is 100. + # + # Can only be set if + # {::Google::Cloud::Retail::V2::ServingConfig#solution_types solution_types} is + # {::Google::Cloud::Retail::V2::SolutionType::SOLUTION_TYPE_SEARCH SOLUTION_TYPE_SEARCH}. + # @!attribute [rw] replacement_control_ids + # @return [::Array<::String>] + # Condition replacement specifications. + # - Applied according to the order in the list. + # - A previously replaced term can not be re-replaced. + # - Maximum number of specifications is 100. + # + # Can only be set if + # {::Google::Cloud::Retail::V2::ServingConfig#solution_types solution_types} is + # {::Google::Cloud::Retail::V2::SolutionType::SOLUTION_TYPE_SEARCH SOLUTION_TYPE_SEARCH}. + # @!attribute [rw] ignore_control_ids + # @return [::Array<::String>] + # Condition ignore specifications. If multiple ignore + # conditions match, all matching ignore controls in the list will + # execute. + # - Order does not matter. + # - Maximum number of specifications is 100. + # + # Can only be set if + # {::Google::Cloud::Retail::V2::ServingConfig#solution_types solution_types} is + # {::Google::Cloud::Retail::V2::SolutionType::SOLUTION_TYPE_SEARCH SOLUTION_TYPE_SEARCH}. + # @!attribute [rw] diversity_level + # @return [::String] + # How much diversity to use in recommendation model results e.g. + # `medium-diversity` or `high-diversity`. Currently supported values: + # + # * `no-diversity` + # * `low-diversity` + # * `medium-diversity` + # * `high-diversity` + # * `auto-diversity` + # + # If not specified, we choose default based on recommendation model + # type. Default value: `no-diversity`. + # + # Can only be set if + # {::Google::Cloud::Retail::V2::ServingConfig#solution_types solution_types} is + # {::Google::Cloud::Retail::V2::SolutionType::SOLUTION_TYPE_RECOMMENDATION SOLUTION_TYPE_RECOMMENDATION}. + # @!attribute [rw] diversity_type + # @return [::Google::Cloud::Retail::V2::ServingConfig::DiversityType] + # What kind of diversity to use - data driven or rule based. If unset, the + # server behavior defaults to + # {::Google::Cloud::Retail::V2::ServingConfig::DiversityType::RULE_BASED_DIVERSITY RULE_BASED_DIVERSITY}. + # @!attribute [rw] enable_category_filter_level + # @return [::String] + # Whether to add additional category filters on the `similar-items` model. + # If not specified, we enable it by default. + # Allowed values are: + # + # * `no-category-match`: No additional filtering of original results from + # the model and the customer's filters. + # * `relaxed-category-match`: Only keep results with categories that match + # at least one item categories in the PredictRequests's context item. + # * If customer also sends filters in the PredictRequest, then the results + # will satisfy both conditions (user given and category match). + # + # Can only be set if + # {::Google::Cloud::Retail::V2::ServingConfig#solution_types solution_types} is + # {::Google::Cloud::Retail::V2::SolutionType::SOLUTION_TYPE_RECOMMENDATION SOLUTION_TYPE_RECOMMENDATION}. + # @!attribute [rw] ignore_recs_denylist + # @return [::Boolean] + # When the flag is enabled, the products in the denylist will not be filtered + # out in the recommendation filtering results. + # @!attribute [rw] personalization_spec + # @return [::Google::Cloud::Retail::V2::SearchRequest::PersonalizationSpec] + # The specification for personalization spec. + # + # Can only be set if + # {::Google::Cloud::Retail::V2::ServingConfig#solution_types solution_types} is + # {::Google::Cloud::Retail::V2::SolutionType::SOLUTION_TYPE_SEARCH SOLUTION_TYPE_SEARCH}. + # + # Notice that if both + # {::Google::Cloud::Retail::V2::ServingConfig#personalization_spec ServingConfig.personalization_spec} + # and + # {::Google::Cloud::Retail::V2::SearchRequest#personalization_spec SearchRequest.personalization_spec} + # are set. + # {::Google::Cloud::Retail::V2::SearchRequest#personalization_spec SearchRequest.personalization_spec} + # will override + # {::Google::Cloud::Retail::V2::ServingConfig#personalization_spec ServingConfig.personalization_spec}. + # @!attribute [rw] solution_types + # @return [::Array<::Google::Cloud::Retail::V2::SolutionType>] + # Required. Immutable. Specifies the solution types that a serving config can + # be associated with. Currently we support setting only one type of solution. + class ServingConfig + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # What type of diversity - data or rule based. + module DiversityType + # Default value. + DIVERSITY_TYPE_UNSPECIFIED = 0 + + # Rule based diversity. + RULE_BASED_DIVERSITY = 2 + + # Data driven diversity. + DATA_DRIVEN_DIVERSITY = 3 + end + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-retail-v2/proto_docs/google/cloud/retail/v2/serving_config_service.rb b/owl-bot-staging/google-cloud-retail-v2/proto_docs/google/cloud/retail/v2/serving_config_service.rb new file mode 100644 index 000000000000..943913f2996e --- /dev/null +++ b/owl-bot-staging/google-cloud-retail-v2/proto_docs/google/cloud/retail/v2/serving_config_service.rb @@ -0,0 +1,143 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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 Retail + module V2 + # Request for CreateServingConfig method. + # @!attribute [rw] parent + # @return [::String] + # Required. Full resource name of parent. Format: + # `projects/{project_number}/locations/{location_id}/catalogs/{catalog_id}` + # @!attribute [rw] serving_config + # @return [::Google::Cloud::Retail::V2::ServingConfig] + # Required. The ServingConfig to create. + # @!attribute [rw] serving_config_id + # @return [::String] + # Required. The ID to use for the ServingConfig, which will become the final + # component of the ServingConfig's resource name. + # + # This value should be 4-63 characters, and valid characters + # are /[a-z][0-9]-_/. + class CreateServingConfigRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Request for UpdateServingConfig method. + # @!attribute [rw] serving_config + # @return [::Google::Cloud::Retail::V2::ServingConfig] + # Required. The ServingConfig to update. + # @!attribute [rw] update_mask + # @return [::Google::Protobuf::FieldMask] + # Indicates which fields in the provided + # {::Google::Cloud::Retail::V2::ServingConfig ServingConfig} to update. The + # following are NOT supported: + # + # * {::Google::Cloud::Retail::V2::ServingConfig#name ServingConfig.name} + # + # If not set, all supported fields are updated. + class UpdateServingConfigRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Request for DeleteServingConfig method. + # @!attribute [rw] name + # @return [::String] + # Required. The resource name of the ServingConfig to delete. Format: + # `projects/{project_number}/locations/{location_id}/catalogs/{catalog_id}/servingConfigs/{serving_config_id}` + class DeleteServingConfigRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Request for GetServingConfig method. + # @!attribute [rw] name + # @return [::String] + # Required. The resource name of the ServingConfig to get. Format: + # `projects/{project_number}/locations/{location_id}/catalogs/{catalog_id}/servingConfigs/{serving_config_id}` + class GetServingConfigRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Request for ListServingConfigs method. + # @!attribute [rw] parent + # @return [::String] + # Required. The catalog resource name. Format: + # `projects/{project_number}/locations/{location_id}/catalogs/{catalog_id}` + # @!attribute [rw] page_size + # @return [::Integer] + # Optional. Maximum number of results to return. If unspecified, defaults + # to 100. If a value greater than 100 is provided, at most 100 results are + # returned. + # @!attribute [rw] page_token + # @return [::String] + # Optional. A page token, received from a previous `ListServingConfigs` call. + # Provide this to retrieve the subsequent page. + class ListServingConfigsRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Response for ListServingConfigs method. + # @!attribute [rw] serving_configs + # @return [::Array<::Google::Cloud::Retail::V2::ServingConfig>] + # All the ServingConfigs for a given catalog. + # @!attribute [rw] next_page_token + # @return [::String] + # Pagination token, if not returned indicates the last page. + class ListServingConfigsResponse + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Request for AddControl method. + # @!attribute [rw] serving_config + # @return [::String] + # Required. The source ServingConfig resource name . Format: + # `projects/{project_number}/locations/{location_id}/catalogs/{catalog_id}/servingConfigs/{serving_config_id}` + # @!attribute [rw] control_id + # @return [::String] + # Required. The id of the control to apply. Assumed to be in the same catalog + # as the serving config - if id is not found a NOT_FOUND error is returned. + class AddControlRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Request for RemoveControl method. + # @!attribute [rw] serving_config + # @return [::String] + # Required. The source ServingConfig resource name . Format: + # `projects/{project_number}/locations/{location_id}/catalogs/{catalog_id}/servingConfigs/{serving_config_id}` + # @!attribute [rw] control_id + # @return [::String] + # Required. The id of the control to apply. Assumed to be in the same catalog + # as the serving config. + class RemoveControlRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-retail-v2/proto_docs/google/cloud/retail/v2/user_event.rb b/owl-bot-staging/google-cloud-retail-v2/proto_docs/google/cloud/retail/v2/user_event.rb new file mode 100644 index 000000000000..2c119fd76473 --- /dev/null +++ b/owl-bot-staging/google-cloud-retail-v2/proto_docs/google/cloud/retail/v2/user_event.rb @@ -0,0 +1,364 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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 Retail + module V2 + # UserEvent captures all metadata information Retail API needs to know about + # how end users interact with customers' website. + # @!attribute [rw] event_type + # @return [::String] + # Required. User event type. Allowed values are: + # + # * `add-to-cart`: Products being added to cart. + # * `remove-from-cart`: Products being removed from cart. + # * `category-page-view`: Special pages such as sale or promotion pages + # viewed. + # * `detail-page-view`: Products detail page viewed. + # * `home-page-view`: Homepage viewed. + # * `purchase-complete`: User finishing a purchase. + # * `search`: Product search. + # * `shopping-cart-page-view`: User viewing a shopping cart. + # @!attribute [rw] visitor_id + # @return [::String] + # Required. A unique identifier for tracking visitors. + # + # For example, this could be implemented with an HTTP cookie, which should be + # able to uniquely identify a visitor on a single device. This unique + # identifier should not change if the visitor log in/out of the website. + # + # Don't set the field to the same fixed ID for different users. This mixes + # the event history of those users together, which results in degraded model + # quality. + # + # The field must be a UTF-8 encoded string with a length limit of 128 + # characters. Otherwise, an INVALID_ARGUMENT error is returned. + # + # The field should not contain PII or user-data. We recommend to use Google + # Analytics [Client + # ID](https://developers.google.com/analytics/devguides/collection/analyticsjs/field-reference#clientId) + # for this field. + # @!attribute [rw] session_id + # @return [::String] + # A unique identifier for tracking a visitor session with a length limit of + # 128 bytes. A session is an aggregation of an end user behavior in a time + # span. + # + # A general guideline to populate the session_id: + # 1. If user has no activity for 30 min, a new session_id should be assigned. + # 2. The session_id should be unique across users, suggest use uuid or add + # visitor_id as prefix. + # @!attribute [rw] event_time + # @return [::Google::Protobuf::Timestamp] + # Only required for + # {::Google::Cloud::Retail::V2::UserEventService::Client#import_user_events UserEventService.ImportUserEvents} + # method. Timestamp of when the user event happened. + # @!attribute [rw] experiment_ids + # @return [::Array<::String>] + # A list of identifiers for the independent experiment groups this user event + # belongs to. This is used to distinguish between user events associated with + # different experiment setups (e.g. using Retail API, using different + # recommendation models). + # @!attribute [rw] attribution_token + # @return [::String] + # Highly recommended for user events that are the result of + # {::Google::Cloud::Retail::V2::PredictionService::Client#predict PredictionService.Predict}. + # This field enables accurate attribution of recommendation model + # performance. + # + # The value must be a valid + # {::Google::Cloud::Retail::V2::PredictResponse#attribution_token PredictResponse.attribution_token} + # for user events that are the result of + # {::Google::Cloud::Retail::V2::PredictionService::Client#predict PredictionService.Predict}. + # The value must be a valid + # {::Google::Cloud::Retail::V2::SearchResponse#attribution_token SearchResponse.attribution_token} + # for user events that are the result of + # {::Google::Cloud::Retail::V2::SearchService::Client#search SearchService.Search}. + # + # This token enables us to accurately attribute page view or purchase back to + # the event and the particular predict response containing this + # clicked/purchased product. If user clicks on product K in the + # recommendation results, pass + # {::Google::Cloud::Retail::V2::PredictResponse#attribution_token PredictResponse.attribution_token} + # as a URL parameter to product K's page. When recording events on product + # K's page, log the + # {::Google::Cloud::Retail::V2::PredictResponse#attribution_token PredictResponse.attribution_token} + # to this field. + # @!attribute [rw] product_details + # @return [::Array<::Google::Cloud::Retail::V2::ProductDetail>] + # The main product details related to the event. + # + # This field is optional except for the following event types: + # + # * `add-to-cart` + # * `detail-page-view` + # * `purchase-complete` + # + # In a `search` event, this field represents the products returned to the end + # user on the current page (the end user may have not finished browsing the + # whole page yet). When a new page is returned to the end user, after + # pagination/filtering/ordering even for the same query, a new `search` event + # with different + # {::Google::Cloud::Retail::V2::UserEvent#product_details product_details} is + # desired. The end user may have not finished browsing the whole page yet. + # @!attribute [rw] completion_detail + # @return [::Google::Cloud::Retail::V2::CompletionDetail] + # The main auto-completion details related to the event. + # + # This field should be set for `search` event when autocomplete function is + # enabled and the user clicks a suggestion for search. + # @!attribute [rw] attributes + # @return [::Google::Protobuf::Map{::String => ::Google::Cloud::Retail::V2::CustomAttribute}] + # Extra user event features to include in the recommendation model. + # + # If you provide custom attributes for ingested user events, also include + # them in the user events that you associate with prediction requests. Custom + # attribute formatting must be consistent between imported events and events + # provided with prediction requests. This lets the Retail API use + # those custom attributes when training models and serving predictions, which + # helps improve recommendation quality. + # + # This field needs to pass all below criteria, otherwise an INVALID_ARGUMENT + # error is returned: + # + # * The key must be a UTF-8 encoded string with a length limit of 5,000 + # characters. + # * For text attributes, at most 400 values are allowed. Empty values are not + # allowed. Each value must be a UTF-8 encoded string with a length limit of + # 256 characters. + # * For number attributes, at most 400 values are allowed. + # + # For product recommendations, an example of extra user information is + # traffic_channel, which is how a user arrives at the site. Users can arrive + # at the site by coming to the site directly, coming through Google + # search, or in other ways. + # @!attribute [rw] cart_id + # @return [::String] + # The ID or name of the associated shopping cart. This ID is used + # to associate multiple items added or present in the cart before purchase. + # + # This can only be set for `add-to-cart`, `purchase-complete`, or + # `shopping-cart-page-view` events. + # @!attribute [rw] purchase_transaction + # @return [::Google::Cloud::Retail::V2::PurchaseTransaction] + # A transaction represents the entire purchase transaction. + # + # Required for `purchase-complete` events. Other event types should not set + # this field. Otherwise, an INVALID_ARGUMENT error is returned. + # @!attribute [rw] search_query + # @return [::String] + # The user's search query. + # + # See {::Google::Cloud::Retail::V2::SearchRequest#query SearchRequest.query} for + # definition. + # + # The value must be a UTF-8 encoded string with a length limit of 5,000 + # characters. Otherwise, an INVALID_ARGUMENT error is returned. + # + # At least one of + # {::Google::Cloud::Retail::V2::UserEvent#search_query search_query} or + # {::Google::Cloud::Retail::V2::UserEvent#page_categories page_categories} is + # required for `search` events. Other event types should not set this field. + # Otherwise, an INVALID_ARGUMENT error is returned. + # @!attribute [rw] filter + # @return [::String] + # The filter syntax consists of an expression language for constructing a + # predicate from one or more fields of the products being filtered. + # + # See {::Google::Cloud::Retail::V2::SearchRequest#filter SearchRequest.filter} for + # definition and syntax. + # + # The value must be a UTF-8 encoded string with a length limit of 1,000 + # characters. Otherwise, an INVALID_ARGUMENT error is returned. + # @!attribute [rw] order_by + # @return [::String] + # The order in which products are returned. + # + # See {::Google::Cloud::Retail::V2::SearchRequest#order_by SearchRequest.order_by} + # for definition and syntax. + # + # The value must be a UTF-8 encoded string with a length limit of 1,000 + # characters. Otherwise, an INVALID_ARGUMENT error is returned. + # + # This can only be set for `search` events. Other event types should not set + # this field. Otherwise, an INVALID_ARGUMENT error is returned. + # @!attribute [rw] offset + # @return [::Integer] + # An integer that specifies the current offset for pagination (the 0-indexed + # starting location, amongst the products deemed by the API as relevant). + # + # See {::Google::Cloud::Retail::V2::SearchRequest#offset SearchRequest.offset} for + # definition. + # + # If this field is negative, an INVALID_ARGUMENT is returned. + # + # This can only be set for `search` events. Other event types should not set + # this field. Otherwise, an INVALID_ARGUMENT error is returned. + # @!attribute [rw] page_categories + # @return [::Array<::String>] + # The categories associated with a category page. + # + # To represent full path of category, use '>' sign to separate different + # hierarchies. If '>' is part of the category name, replace it with + # other character(s). + # + # Category pages include special pages such as sales or promotions. For + # instance, a special sale page may have the category hierarchy: + # "pageCategories" : ["Sales > 2017 Black Friday Deals"]. + # + # Required for `category-page-view` events. At least one of + # {::Google::Cloud::Retail::V2::UserEvent#search_query search_query} or + # {::Google::Cloud::Retail::V2::UserEvent#page_categories page_categories} is + # required for `search` events. Other event types should not set this field. + # Otherwise, an INVALID_ARGUMENT error is returned. + # @!attribute [rw] user_info + # @return [::Google::Cloud::Retail::V2::UserInfo] + # User information. + # @!attribute [rw] uri + # @return [::String] + # Complete URL (window.location.href) of the user's current page. + # + # When using the client side event reporting with JavaScript pixel and Google + # Tag Manager, this value is filled in automatically. Maximum length 5,000 + # characters. + # @!attribute [rw] referrer_uri + # @return [::String] + # The referrer URL of the current page. + # + # When using the client side event reporting with JavaScript pixel and Google + # Tag Manager, this value is filled in automatically. + # @!attribute [rw] page_view_id + # @return [::String] + # A unique ID of a web page view. + # + # This should be kept the same for all user events triggered from the same + # pageview. For example, an item detail page view could trigger multiple + # events as the user is browsing the page. The `pageViewId` property should + # be kept the same for all these events so that they can be grouped together + # properly. + # + # When using the client side event reporting with JavaScript pixel and Google + # Tag Manager, this value is filled in automatically. + # @!attribute [rw] entity + # @return [::String] + # The entity for customers that may run multiple different entities, domains, + # sites or regions, for example, `Google US`, `Google Ads`, `Waymo`, + # `google.com`, `youtube.com`, etc. + # We recommend that you set this field to get better per-entity search, + # completion, and prediction results. + class UserEvent + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # @!attribute [rw] key + # @return [::String] + # @!attribute [rw] value + # @return [::Google::Cloud::Retail::V2::CustomAttribute] + class AttributesEntry + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end + + # Detailed product information associated with a user event. + # @!attribute [rw] product + # @return [::Google::Cloud::Retail::V2::Product] + # Required. {::Google::Cloud::Retail::V2::Product Product} information. + # + # Required field(s): + # + # * {::Google::Cloud::Retail::V2::Product#id Product.id} + # + # Optional override field(s): + # + # * {::Google::Cloud::Retail::V2::Product#price_info Product.price_info} + # + # If any supported optional fields are provided, we will treat them as a full + # override when looking up product information from the catalog. Thus, it is + # important to ensure that the overriding fields are accurate and + # complete. + # + # All other product fields are ignored and instead populated via catalog + # lookup after event ingestion. + # @!attribute [rw] quantity + # @return [::Google::Protobuf::Int32Value] + # Quantity of the product associated with the user event. + # + # For example, this field will be 2 if two products are added to the shopping + # cart for `purchase-complete` event. Required for `add-to-cart` and + # `purchase-complete` event types. + class ProductDetail + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Detailed completion information including completion attribution token and + # clicked completion info. + # @!attribute [rw] completion_attribution_token + # @return [::String] + # Completion attribution token in + # {::Google::Cloud::Retail::V2::CompleteQueryResponse#attribution_token CompleteQueryResponse.attribution_token}. + # @!attribute [rw] selected_suggestion + # @return [::String] + # End user selected + # {::Google::Cloud::Retail::V2::CompleteQueryResponse::CompletionResult#suggestion CompleteQueryResponse.CompletionResult.suggestion}. + # @!attribute [rw] selected_position + # @return [::Integer] + # End user selected + # {::Google::Cloud::Retail::V2::CompleteQueryResponse::CompletionResult#suggestion CompleteQueryResponse.CompletionResult.suggestion} + # position, starting from 0. + class CompletionDetail + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # A transaction represents the entire purchase transaction. + # @!attribute [rw] id + # @return [::String] + # The transaction ID with a length limit of 128 characters. + # @!attribute [rw] revenue + # @return [::Float] + # Required. Total non-zero revenue or grand total associated with the + # transaction. This value include shipping, tax, or other adjustments to + # total revenue that you want to include as part of your revenue + # calculations. + # @!attribute [rw] tax + # @return [::Float] + # All the taxes associated with the transaction. + # @!attribute [rw] cost + # @return [::Float] + # All the costs associated with the products. These can be manufacturing + # costs, shipping expenses not borne by the end user, or any other costs, + # such that: + # + # * Profit = {::Google::Cloud::Retail::V2::PurchaseTransaction#revenue revenue} - + # {::Google::Cloud::Retail::V2::PurchaseTransaction#tax tax} - + # {::Google::Cloud::Retail::V2::PurchaseTransaction#cost cost} + # @!attribute [rw] currency_code + # @return [::String] + # Required. Currency code. Use three-character ISO-4217 code. + class PurchaseTransaction + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-retail-v2/proto_docs/google/cloud/retail/v2/user_event_service.rb b/owl-bot-staging/google-cloud-retail-v2/proto_docs/google/cloud/retail/v2/user_event_service.rb new file mode 100644 index 000000000000..cb0896f85338 --- /dev/null +++ b/owl-bot-staging/google-cloud-retail-v2/proto_docs/google/cloud/retail/v2/user_event_service.rb @@ -0,0 +1,130 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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 Retail + module V2 + # Request message for WriteUserEvent method. + # @!attribute [rw] parent + # @return [::String] + # Required. The parent catalog resource name, such as + # `projects/1234/locations/global/catalogs/default_catalog`. + # @!attribute [rw] user_event + # @return [::Google::Cloud::Retail::V2::UserEvent] + # Required. User event to write. + # @!attribute [rw] write_async + # @return [::Boolean] + # If set to true, the user event will be written asynchronously after + # validation, and the API will respond without waiting for the write. + # Therefore, silent failures can occur even if the API returns success. In + # case of silent failures, error messages can be found in Stackdriver logs. + class WriteUserEventRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Request message for CollectUserEvent method. + # @!attribute [rw] prebuilt_rule + # @return [::String] + # The prebuilt rule name that can convert a specific type of raw_json. + # For example: "ga4_bq" rule for the GA4 user event schema. + # @!attribute [rw] parent + # @return [::String] + # Required. The parent catalog name, such as + # `projects/1234/locations/global/catalogs/default_catalog`. + # @!attribute [rw] user_event + # @return [::String] + # Required. URL encoded UserEvent proto with a length limit of 2,000,000 + # characters. + # @!attribute [rw] uri + # @return [::String] + # The URL including cgi-parameters but excluding the hash fragment with a + # length limit of 5,000 characters. This is often more useful than the + # referer URL, because many browsers only send the domain for 3rd party + # requests. + # @!attribute [rw] ets + # @return [::Integer] + # The event timestamp in milliseconds. This prevents browser caching of + # otherwise identical get requests. The name is abbreviated to reduce the + # payload bytes. + # @!attribute [rw] raw_json + # @return [::String] + # An arbitrary serialized JSON string that contains necessary information + # that can comprise a user event. When this field is specified, the + # user_event field will be ignored. Note: line-delimited JSON is not + # supported, a single JSON only. + class CollectUserEventRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Request message for RejoinUserEvents method. + # @!attribute [rw] parent + # @return [::String] + # Required. The parent catalog resource name, such as + # `projects/1234/locations/global/catalogs/default_catalog`. + # @!attribute [rw] user_event_rejoin_scope + # @return [::Google::Cloud::Retail::V2::RejoinUserEventsRequest::UserEventRejoinScope] + # The type of the user event rejoin to define the scope and range of the user + # events to be rejoined with the latest product catalog. Defaults to + # `USER_EVENT_REJOIN_SCOPE_UNSPECIFIED` if this field is not set, or set to + # an invalid integer value. + class RejoinUserEventsRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # The scope of user events to be rejoined with the latest product catalog. + # If the rejoining aims at reducing number of unjoined events, set + # `UserEventRejoinScope` to `UNJOINED_EVENTS`. + # If the rejoining aims at correcting product catalog information in joined + # events, set `UserEventRejoinScope` to `JOINED_EVENTS`. + # If all events needs to be rejoined, set `UserEventRejoinScope` to + # `USER_EVENT_REJOIN_SCOPE_UNSPECIFIED`. + module UserEventRejoinScope + # Rejoin all events with the latest product catalog, including both joined + # events and unjoined events. + USER_EVENT_REJOIN_SCOPE_UNSPECIFIED = 0 + + # Only rejoin joined events with the latest product catalog. + JOINED_EVENTS = 1 + + # Only rejoin unjoined events with the latest product catalog. + UNJOINED_EVENTS = 2 + end + end + + # Response message for `RejoinUserEvents` method. + # @!attribute [rw] rejoined_user_events_count + # @return [::Integer] + # Number of user events that were joined with latest product catalog. + class RejoinUserEventsResponse + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Metadata for `RejoinUserEvents` method. + class RejoinUserEventsMetadata + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-retail-v2/proto_docs/google/longrunning/operations.rb b/owl-bot-staging/google-cloud-retail-v2/proto_docs/google/longrunning/operations.rb new file mode 100644 index 000000000000..7a757f512165 --- /dev/null +++ b/owl-bot-staging/google-cloud-retail-v2/proto_docs/google/longrunning/operations.rb @@ -0,0 +1,191 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + + +module Google + module Longrunning + # This resource represents a long-running operation that is the result of a + # network API call. + # @!attribute [rw] name + # @return [::String] + # The server-assigned name, which is only unique within the same service that + # originally returns it. If you use the default HTTP mapping, the + # `name` should be a resource name ending with `operations/{unique_id}`. + # @!attribute [rw] metadata + # @return [::Google::Protobuf::Any] + # Service-specific metadata associated with the operation. It typically + # contains progress information and common metadata such as create time. + # Some services might not provide such metadata. Any method that returns a + # long-running operation should document the metadata type, if any. + # @!attribute [rw] done + # @return [::Boolean] + # If the value is `false`, it means the operation is still in progress. + # If `true`, the operation is completed, and either `error` or `response` is + # available. + # @!attribute [rw] error + # @return [::Google::Rpc::Status] + # The error result of the operation in case of failure or cancellation. + # + # Note: The following fields are mutually exclusive: `error`, `response`. If a field in that set is populated, all other fields in the set will automatically be cleared. + # @!attribute [rw] response + # @return [::Google::Protobuf::Any] + # The normal, successful response of the operation. If the original + # method returns no data on success, such as `Delete`, the response is + # `google.protobuf.Empty`. If the original method is standard + # `Get`/`Create`/`Update`, the response should be the resource. For other + # methods, the response should have the type `XxxResponse`, where `Xxx` + # is the original method name. For example, if the original method name + # is `TakeSnapshot()`, the inferred response type is + # `TakeSnapshotResponse`. + # + # Note: The following fields are mutually exclusive: `response`, `error`. If a field in that set is populated, all other fields in the set will automatically be cleared. + class Operation + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # The request message for + # Operations.GetOperation. + # @!attribute [rw] name + # @return [::String] + # The name of the operation resource. + class GetOperationRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # The request message for + # Operations.ListOperations. + # @!attribute [rw] name + # @return [::String] + # The name of the operation's parent resource. + # @!attribute [rw] filter + # @return [::String] + # The standard list filter. + # @!attribute [rw] page_size + # @return [::Integer] + # The standard list page size. + # @!attribute [rw] page_token + # @return [::String] + # The standard list page token. + # @!attribute [rw] return_partial_success + # @return [::Boolean] + # When set to `true`, operations that are reachable are returned as normal, + # and those that are unreachable are returned in the + # [ListOperationsResponse.unreachable] field. + # + # This can only be `true` when reading across collections e.g. when `parent` + # is set to `"projects/example/locations/-"`. + # + # This field is not by default supported and will result in an + # `UNIMPLEMENTED` error if set unless explicitly documented otherwise in + # service or product specific documentation. + class ListOperationsRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # The response message for + # Operations.ListOperations. + # @!attribute [rw] operations + # @return [::Array<::Google::Longrunning::Operation>] + # A list of operations that matches the specified filter in the request. + # @!attribute [rw] next_page_token + # @return [::String] + # The standard List next-page token. + # @!attribute [rw] unreachable + # @return [::Array<::String>] + # Unordered list. Unreachable resources. Populated when the request sets + # `ListOperationsRequest.return_partial_success` and reads across + # collections e.g. when attempting to list all resources across all supported + # locations. + class ListOperationsResponse + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # The request message for + # Operations.CancelOperation. + # @!attribute [rw] name + # @return [::String] + # The name of the operation resource to be cancelled. + class CancelOperationRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # The request message for + # Operations.DeleteOperation. + # @!attribute [rw] name + # @return [::String] + # The name of the operation resource to be deleted. + class DeleteOperationRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # The request message for + # Operations.WaitOperation. + # @!attribute [rw] name + # @return [::String] + # The name of the operation resource to wait on. + # @!attribute [rw] timeout + # @return [::Google::Protobuf::Duration] + # The maximum duration to wait before timing out. If left blank, the wait + # will be at most the time permitted by the underlying HTTP/RPC protocol. + # If RPC context deadline is also specified, the shorter one will be used. + class WaitOperationRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # A message representing the message types used by a long-running operation. + # + # Example: + # + # rpc Export(ExportRequest) returns (google.longrunning.Operation) { + # option (google.longrunning.operation_info) = { + # response_type: "ExportResponse" + # metadata_type: "ExportMetadata" + # }; + # } + # @!attribute [rw] response_type + # @return [::String] + # Required. The message name of the primary return type for this + # long-running operation. + # This type will be used to deserialize the LRO's response. + # + # If the response is in a different package from the rpc, a fully-qualified + # message name must be used (e.g. `google.protobuf.Struct`). + # + # Note: Altering this value constitutes a breaking change. + # @!attribute [rw] metadata_type + # @return [::String] + # Required. The message name of the metadata type for this long-running + # operation. + # + # If the response is in a different package from the rpc, a fully-qualified + # message name must be used (e.g. `google.protobuf.Struct`). + # + # Note: Altering this value constitutes a breaking change. + class OperationInfo + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end +end diff --git a/owl-bot-staging/google-cloud-retail-v2/proto_docs/google/protobuf/any.rb b/owl-bot-staging/google-cloud-retail-v2/proto_docs/google/protobuf/any.rb new file mode 100644 index 000000000000..58691995f02e --- /dev/null +++ b/owl-bot-staging/google-cloud-retail-v2/proto_docs/google/protobuf/any.rb @@ -0,0 +1,145 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + + +module Google + module Protobuf + # `Any` contains an arbitrary serialized protocol buffer message along with a + # URL that describes the type of the serialized message. + # + # Protobuf library provides support to pack/unpack Any values in the form + # of utility functions or additional generated methods of the Any type. + # + # Example 1: Pack and unpack a message in C++. + # + # Foo foo = ...; + # Any any; + # any.PackFrom(foo); + # ... + # if (any.UnpackTo(&foo)) { + # ... + # } + # + # Example 2: Pack and unpack a message in Java. + # + # Foo foo = ...; + # Any any = Any.pack(foo); + # ... + # if (any.is(Foo.class)) { + # foo = any.unpack(Foo.class); + # } + # // or ... + # if (any.isSameTypeAs(Foo.getDefaultInstance())) { + # foo = any.unpack(Foo.getDefaultInstance()); + # } + # + # Example 3: Pack and unpack a message in Python. + # + # foo = Foo(...) + # any = Any() + # any.Pack(foo) + # ... + # if any.Is(Foo.DESCRIPTOR): + # any.Unpack(foo) + # ... + # + # Example 4: Pack and unpack a message in Go + # + # foo := &pb.Foo{...} + # any, err := anypb.New(foo) + # if err != nil { + # ... + # } + # ... + # foo := &pb.Foo{} + # if err := any.UnmarshalTo(foo); err != nil { + # ... + # } + # + # The pack methods provided by protobuf library will by default use + # 'type.googleapis.com/full.type.name' as the type URL and the unpack + # methods only use the fully qualified type name after the last '/' + # in the type URL, for example "foo.bar.com/x/y.z" will yield type + # name "y.z". + # + # JSON + # ==== + # The JSON representation of an `Any` value uses the regular + # representation of the deserialized, embedded message, with an + # additional field `@type` which contains the type URL. Example: + # + # package google.profile; + # message Person { + # string first_name = 1; + # string last_name = 2; + # } + # + # { + # "@type": "type.googleapis.com/google.profile.Person", + # "firstName": , + # "lastName": + # } + # + # If the embedded message type is well-known and has a custom JSON + # representation, that representation will be embedded adding a field + # `value` which holds the custom JSON in addition to the `@type` + # field. Example (for message [google.protobuf.Duration][]): + # + # { + # "@type": "type.googleapis.com/google.protobuf.Duration", + # "value": "1.212s" + # } + # @!attribute [rw] type_url + # @return [::String] + # A URL/resource name that uniquely identifies the type of the serialized + # protocol buffer message. This string must contain at least + # one "/" character. The last segment of the URL's path must represent + # the fully qualified name of the type (as in + # `path/google.protobuf.Duration`). The name should be in a canonical form + # (e.g., leading "." is not accepted). + # + # In practice, teams usually precompile into the binary all types that they + # expect it to use in the context of Any. However, for URLs which use the + # scheme `http`, `https`, or no scheme, one can optionally set up a type + # server that maps type URLs to message definitions as follows: + # + # * If no scheme is provided, `https` is assumed. + # * An HTTP GET on the URL must yield a [google.protobuf.Type][] + # value in binary format, or produce an error. + # * Applications are allowed to cache lookup results based on the + # URL, or have them precompiled into a binary to avoid any + # lookup. Therefore, binary compatibility needs to be preserved + # on changes to types. (Use versioned type names to manage + # breaking changes.) + # + # Note: this functionality is not currently available in the official + # protobuf release, and it is not used for type URLs beginning with + # type.googleapis.com. As of May 2023, there are no widely used type server + # implementations and no plans to implement one. + # + # Schemes other than `http`, `https` (or the empty scheme) might be + # used with implementation specific semantics. + # @!attribute [rw] value + # @return [::String] + # Must be a valid serialized protocol buffer of the above specified type. + class Any + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end +end diff --git a/owl-bot-staging/google-cloud-retail-v2/proto_docs/google/protobuf/duration.rb b/owl-bot-staging/google-cloud-retail-v2/proto_docs/google/protobuf/duration.rb new file mode 100644 index 000000000000..ea59f1f91daf --- /dev/null +++ b/owl-bot-staging/google-cloud-retail-v2/proto_docs/google/protobuf/duration.rb @@ -0,0 +1,98 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + + +module Google + module Protobuf + # A Duration represents a signed, fixed-length span of time represented + # as a count of seconds and fractions of seconds at nanosecond + # resolution. It is independent of any calendar and concepts like "day" + # or "month". It is related to Timestamp in that the difference between + # two Timestamp values is a Duration and it can be added or subtracted + # from a Timestamp. Range is approximately +-10,000 years. + # + # # Examples + # + # Example 1: Compute Duration from two Timestamps in pseudo code. + # + # Timestamp start = ...; + # Timestamp end = ...; + # Duration duration = ...; + # + # duration.seconds = end.seconds - start.seconds; + # duration.nanos = end.nanos - start.nanos; + # + # if (duration.seconds < 0 && duration.nanos > 0) { + # duration.seconds += 1; + # duration.nanos -= 1000000000; + # } else if (duration.seconds > 0 && duration.nanos < 0) { + # duration.seconds -= 1; + # duration.nanos += 1000000000; + # } + # + # Example 2: Compute Timestamp from Timestamp + Duration in pseudo code. + # + # Timestamp start = ...; + # Duration duration = ...; + # Timestamp end = ...; + # + # end.seconds = start.seconds + duration.seconds; + # end.nanos = start.nanos + duration.nanos; + # + # if (end.nanos < 0) { + # end.seconds -= 1; + # end.nanos += 1000000000; + # } else if (end.nanos >= 1000000000) { + # end.seconds += 1; + # end.nanos -= 1000000000; + # } + # + # Example 3: Compute Duration from datetime.timedelta in Python. + # + # td = datetime.timedelta(days=3, minutes=10) + # duration = Duration() + # duration.FromTimedelta(td) + # + # # JSON Mapping + # + # In JSON format, the Duration type is encoded as a string rather than an + # object, where the string ends in the suffix "s" (indicating seconds) and + # is preceded by the number of seconds, with nanoseconds expressed as + # fractional seconds. For example, 3 seconds with 0 nanoseconds should be + # encoded in JSON format as "3s", while 3 seconds and 1 nanosecond should + # be expressed in JSON format as "3.000000001s", and 3 seconds and 1 + # microsecond should be expressed in JSON format as "3.000001s". + # @!attribute [rw] seconds + # @return [::Integer] + # Signed seconds of the span of time. Must be from -315,576,000,000 + # to +315,576,000,000 inclusive. Note: these bounds are computed from: + # 60 sec/min * 60 min/hr * 24 hr/day * 365.25 days/year * 10000 years + # @!attribute [rw] nanos + # @return [::Integer] + # Signed fractions of a second at nanosecond resolution of the span + # of time. Durations less than one second are represented with a 0 + # `seconds` field and a positive or negative `nanos` field. For durations + # of one second or more, a non-zero value for the `nanos` field must be + # of the same sign as the `seconds` field. Must be from -999,999,999 + # to +999,999,999 inclusive. + class Duration + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end +end diff --git a/owl-bot-staging/google-cloud-retail-v2/proto_docs/google/protobuf/empty.rb b/owl-bot-staging/google-cloud-retail-v2/proto_docs/google/protobuf/empty.rb new file mode 100644 index 000000000000..83e4481834a6 --- /dev/null +++ b/owl-bot-staging/google-cloud-retail-v2/proto_docs/google/protobuf/empty.rb @@ -0,0 +1,34 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + + +module Google + module Protobuf + # A generic empty message that you can re-use to avoid defining duplicated + # empty messages in your APIs. A typical example is to use it as the request + # or the response type of an API method. For instance: + # + # service Foo { + # rpc Bar(google.protobuf.Empty) returns (google.protobuf.Empty); + # } + class Empty + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end +end diff --git a/owl-bot-staging/google-cloud-retail-v2/proto_docs/google/protobuf/field_mask.rb b/owl-bot-staging/google-cloud-retail-v2/proto_docs/google/protobuf/field_mask.rb new file mode 100644 index 000000000000..7f3ffc78601a --- /dev/null +++ b/owl-bot-staging/google-cloud-retail-v2/proto_docs/google/protobuf/field_mask.rb @@ -0,0 +1,229 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + + +module Google + module Protobuf + # `FieldMask` represents a set of symbolic field paths, for example: + # + # paths: "f.a" + # paths: "f.b.d" + # + # Here `f` represents a field in some root message, `a` and `b` + # fields in the message found in `f`, and `d` a field found in the + # message in `f.b`. + # + # Field masks are used to specify a subset of fields that should be + # returned by a get operation or modified by an update operation. + # Field masks also have a custom JSON encoding (see below). + # + # # Field Masks in Projections + # + # When used in the context of a projection, a response message or + # sub-message is filtered by the API to only contain those fields as + # specified in the mask. For example, if the mask in the previous + # example is applied to a response message as follows: + # + # f { + # a : 22 + # b { + # d : 1 + # x : 2 + # } + # y : 13 + # } + # z: 8 + # + # The result will not contain specific values for fields x,y and z + # (their value will be set to the default, and omitted in proto text + # output): + # + # + # f { + # a : 22 + # b { + # d : 1 + # } + # } + # + # A repeated field is not allowed except at the last position of a + # paths string. + # + # If a FieldMask object is not present in a get operation, the + # operation applies to all fields (as if a FieldMask of all fields + # had been specified). + # + # Note that a field mask does not necessarily apply to the + # top-level response message. In case of a REST get operation, the + # field mask applies directly to the response, but in case of a REST + # list operation, the mask instead applies to each individual message + # in the returned resource list. In case of a REST custom method, + # other definitions may be used. Where the mask applies will be + # clearly documented together with its declaration in the API. In + # any case, the effect on the returned resource/resources is required + # behavior for APIs. + # + # # Field Masks in Update Operations + # + # A field mask in update operations specifies which fields of the + # targeted resource are going to be updated. The API is required + # to only change the values of the fields as specified in the mask + # and leave the others untouched. If a resource is passed in to + # describe the updated values, the API ignores the values of all + # fields not covered by the mask. + # + # If a repeated field is specified for an update operation, new values will + # be appended to the existing repeated field in the target resource. Note that + # a repeated field is only allowed in the last position of a `paths` string. + # + # If a sub-message is specified in the last position of the field mask for an + # update operation, then new value will be merged into the existing sub-message + # in the target resource. + # + # For example, given the target message: + # + # f { + # b { + # d: 1 + # x: 2 + # } + # c: [1] + # } + # + # And an update message: + # + # f { + # b { + # d: 10 + # } + # c: [2] + # } + # + # then if the field mask is: + # + # paths: ["f.b", "f.c"] + # + # then the result will be: + # + # f { + # b { + # d: 10 + # x: 2 + # } + # c: [1, 2] + # } + # + # An implementation may provide options to override this default behavior for + # repeated and message fields. + # + # In order to reset a field's value to the default, the field must + # be in the mask and set to the default value in the provided resource. + # Hence, in order to reset all fields of a resource, provide a default + # instance of the resource and set all fields in the mask, or do + # not provide a mask as described below. + # + # If a field mask is not present on update, the operation applies to + # all fields (as if a field mask of all fields has been specified). + # Note that in the presence of schema evolution, this may mean that + # fields the client does not know and has therefore not filled into + # the request will be reset to their default. If this is unwanted + # behavior, a specific service may require a client to always specify + # a field mask, producing an error if not. + # + # As with get operations, the location of the resource which + # describes the updated values in the request message depends on the + # operation kind. In any case, the effect of the field mask is + # required to be honored by the API. + # + # ## Considerations for HTTP REST + # + # The HTTP kind of an update operation which uses a field mask must + # be set to PATCH instead of PUT in order to satisfy HTTP semantics + # (PUT must only be used for full updates). + # + # # JSON Encoding of Field Masks + # + # In JSON, a field mask is encoded as a single string where paths are + # separated by a comma. Fields name in each path are converted + # to/from lower-camel naming conventions. + # + # As an example, consider the following message declarations: + # + # message Profile { + # User user = 1; + # Photo photo = 2; + # } + # message User { + # string display_name = 1; + # string address = 2; + # } + # + # In proto a field mask for `Profile` may look as such: + # + # mask { + # paths: "user.display_name" + # paths: "photo" + # } + # + # In JSON, the same mask is represented as below: + # + # { + # mask: "user.displayName,photo" + # } + # + # # Field Masks and Oneof Fields + # + # Field masks treat fields in oneofs just as regular fields. Consider the + # following message: + # + # message SampleMessage { + # oneof test_oneof { + # string name = 4; + # SubMessage sub_message = 9; + # } + # } + # + # The field mask can be: + # + # mask { + # paths: "name" + # } + # + # Or: + # + # mask { + # paths: "sub_message" + # } + # + # Note that oneof type names ("test_oneof" in this case) cannot be used in + # paths. + # + # ## Field Mask Verification + # + # The implementation of any API method which has a FieldMask type field in the + # request should verify the included field paths, and return an + # `INVALID_ARGUMENT` error if any path is unmappable. + # @!attribute [rw] paths + # @return [::Array<::String>] + # The set of field mask paths. + class FieldMask + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end +end diff --git a/owl-bot-staging/google-cloud-retail-v2/proto_docs/google/protobuf/struct.rb b/owl-bot-staging/google-cloud-retail-v2/proto_docs/google/protobuf/struct.rb new file mode 100644 index 000000000000..39e1aca868d2 --- /dev/null +++ b/owl-bot-staging/google-cloud-retail-v2/proto_docs/google/protobuf/struct.rb @@ -0,0 +1,108 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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 + # `Struct` represents a structured data value, consisting of fields + # which map to dynamically typed values. In some languages, `Struct` + # might be supported by a native representation. For example, in + # scripting languages like JS a struct is represented as an + # object. The details of that representation are described together + # with the proto support for the language. + # + # The JSON representation for `Struct` is JSON object. + # @!attribute [rw] fields + # @return [::Google::Protobuf::Map{::String => ::Google::Protobuf::Value}] + # Unordered map of dynamically typed values. + class Struct + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # @!attribute [rw] key + # @return [::String] + # @!attribute [rw] value + # @return [::Google::Protobuf::Value] + class FieldsEntry + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end + + # `Value` represents a dynamically typed value which can be either + # null, a number, a string, a boolean, a recursive struct value, or a + # list of values. A producer of value is expected to set one of these + # variants. Absence of any variant indicates an error. + # + # The JSON representation for `Value` is JSON value. + # @!attribute [rw] null_value + # @return [::Google::Protobuf::NullValue] + # Represents a null value. + # + # Note: The following fields are mutually exclusive: `null_value`, `number_value`, `string_value`, `bool_value`, `struct_value`, `list_value`. If a field in that set is populated, all other fields in the set will automatically be cleared. + # @!attribute [rw] number_value + # @return [::Float] + # Represents a double value. + # + # Note: The following fields are mutually exclusive: `number_value`, `null_value`, `string_value`, `bool_value`, `struct_value`, `list_value`. If a field in that set is populated, all other fields in the set will automatically be cleared. + # @!attribute [rw] string_value + # @return [::String] + # Represents a string value. + # + # Note: The following fields are mutually exclusive: `string_value`, `null_value`, `number_value`, `bool_value`, `struct_value`, `list_value`. If a field in that set is populated, all other fields in the set will automatically be cleared. + # @!attribute [rw] bool_value + # @return [::Boolean] + # Represents a boolean value. + # + # Note: The following fields are mutually exclusive: `bool_value`, `null_value`, `number_value`, `string_value`, `struct_value`, `list_value`. If a field in that set is populated, all other fields in the set will automatically be cleared. + # @!attribute [rw] struct_value + # @return [::Google::Protobuf::Struct] + # Represents a structured value. + # + # Note: The following fields are mutually exclusive: `struct_value`, `null_value`, `number_value`, `string_value`, `bool_value`, `list_value`. If a field in that set is populated, all other fields in the set will automatically be cleared. + # @!attribute [rw] list_value + # @return [::Google::Protobuf::ListValue] + # Represents a repeated `Value`. + # + # Note: The following fields are mutually exclusive: `list_value`, `null_value`, `number_value`, `string_value`, `bool_value`, `struct_value`. If a field in that set is populated, all other fields in the set will automatically be cleared. + class Value + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # `ListValue` is a wrapper around a repeated field of values. + # + # The JSON representation for `ListValue` is JSON array. + # @!attribute [rw] values + # @return [::Array<::Google::Protobuf::Value>] + # Repeated field of dynamically typed values. + class ListValue + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # `NullValue` is a singleton enumeration to represent the null value for the + # `Value` type union. + # + # The JSON representation for `NullValue` is JSON `null`. + module NullValue + # Null value. + NULL_VALUE = 0 + end + end +end diff --git a/owl-bot-staging/google-cloud-retail-v2/proto_docs/google/protobuf/timestamp.rb b/owl-bot-staging/google-cloud-retail-v2/proto_docs/google/protobuf/timestamp.rb new file mode 100644 index 000000000000..74352be9c58c --- /dev/null +++ b/owl-bot-staging/google-cloud-retail-v2/proto_docs/google/protobuf/timestamp.rb @@ -0,0 +1,127 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + + +module Google + module Protobuf + # A Timestamp represents a point in time independent of any time zone or local + # calendar, encoded as a count of seconds and fractions of seconds at + # nanosecond resolution. The count is relative to an epoch at UTC midnight on + # January 1, 1970, in the proleptic Gregorian calendar which extends the + # Gregorian calendar backwards to year one. + # + # All minutes are 60 seconds long. Leap seconds are "smeared" so that no leap + # second table is needed for interpretation, using a [24-hour linear + # smear](https://developers.google.com/time/smear). + # + # The range is from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59.999999999Z. By + # restricting to that range, we ensure that we can convert to and from [RFC + # 3339](https://www.ietf.org/rfc/rfc3339.txt) date strings. + # + # # Examples + # + # Example 1: Compute Timestamp from POSIX `time()`. + # + # Timestamp timestamp; + # timestamp.set_seconds(time(NULL)); + # timestamp.set_nanos(0); + # + # Example 2: Compute Timestamp from POSIX `gettimeofday()`. + # + # struct timeval tv; + # gettimeofday(&tv, NULL); + # + # Timestamp timestamp; + # timestamp.set_seconds(tv.tv_sec); + # timestamp.set_nanos(tv.tv_usec * 1000); + # + # Example 3: Compute Timestamp from Win32 `GetSystemTimeAsFileTime()`. + # + # FILETIME ft; + # GetSystemTimeAsFileTime(&ft); + # UINT64 ticks = (((UINT64)ft.dwHighDateTime) << 32) | ft.dwLowDateTime; + # + # // A Windows tick is 100 nanoseconds. Windows epoch 1601-01-01T00:00:00Z + # // is 11644473600 seconds before Unix epoch 1970-01-01T00:00:00Z. + # Timestamp timestamp; + # timestamp.set_seconds((INT64) ((ticks / 10000000) - 11644473600LL)); + # timestamp.set_nanos((INT32) ((ticks % 10000000) * 100)); + # + # Example 4: Compute Timestamp from Java `System.currentTimeMillis()`. + # + # long millis = System.currentTimeMillis(); + # + # Timestamp timestamp = Timestamp.newBuilder().setSeconds(millis / 1000) + # .setNanos((int) ((millis % 1000) * 1000000)).build(); + # + # Example 5: Compute Timestamp from Java `Instant.now()`. + # + # Instant now = Instant.now(); + # + # Timestamp timestamp = + # Timestamp.newBuilder().setSeconds(now.getEpochSecond()) + # .setNanos(now.getNano()).build(); + # + # Example 6: Compute Timestamp from current time in Python. + # + # timestamp = Timestamp() + # timestamp.GetCurrentTime() + # + # # JSON Mapping + # + # In JSON format, the Timestamp type is encoded as a string in the + # [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format. That is, the + # format is "\\{year}-\\{month}-\\{day}T\\{hour}:\\{min}:\\{sec}[.\\{frac_sec}]Z" + # where \\{year} is always expressed using four digits while \\{month}, \\{day}, + # \\{hour}, \\{min}, and \\{sec} are zero-padded to two digits each. The fractional + # seconds, which can go up to 9 digits (i.e. up to 1 nanosecond resolution), + # are optional. The "Z" suffix indicates the timezone ("UTC"); the timezone + # is required. A proto3 JSON serializer should always use UTC (as indicated by + # "Z") when printing the Timestamp type and a proto3 JSON parser should be + # able to accept both UTC and other timezones (as indicated by an offset). + # + # For example, "2017-01-15T01:30:15.01Z" encodes 15.01 seconds past + # 01:30 UTC on January 15, 2017. + # + # In JavaScript, one can convert a Date object to this format using the + # standard + # [toISOString()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toISOString) + # method. In Python, a standard `datetime.datetime` object can be converted + # to this format using + # [`strftime`](https://docs.python.org/2/library/time.html#time.strftime) with + # the time format spec '%Y-%m-%dT%H:%M:%S.%fZ'. Likewise, in Java, one can use + # the Joda Time's [`ISODateTimeFormat.dateTime()`]( + # http://joda-time.sourceforge.net/apidocs/org/joda/time/format/ISODateTimeFormat.html#dateTime() + # ) to obtain a formatter capable of generating timestamps in this format. + # @!attribute [rw] seconds + # @return [::Integer] + # Represents seconds of UTC time since Unix epoch + # 1970-01-01T00:00:00Z. Must be from 0001-01-01T00:00:00Z to + # 9999-12-31T23:59:59Z inclusive. + # @!attribute [rw] nanos + # @return [::Integer] + # Non-negative fractions of a second at nanosecond resolution. Negative + # second values with fractions must still have non-negative nanos values + # that count forward in time. Must be from 0 to 999,999,999 + # inclusive. + class Timestamp + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end +end diff --git a/owl-bot-staging/google-cloud-retail-v2/proto_docs/google/protobuf/wrappers.rb b/owl-bot-staging/google-cloud-retail-v2/proto_docs/google/protobuf/wrappers.rb new file mode 100644 index 000000000000..9a7c0269fa42 --- /dev/null +++ b/owl-bot-staging/google-cloud-retail-v2/proto_docs/google/protobuf/wrappers.rb @@ -0,0 +1,148 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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 + # Wrapper message for `double`. + # + # The JSON representation for `DoubleValue` is JSON number. + # + # Not recommended for use in new APIs, but still useful for legacy APIs and + # has no plan to be removed. + # @!attribute [rw] value + # @return [::Float] + # The double value. + class DoubleValue + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Wrapper message for `float`. + # + # The JSON representation for `FloatValue` is JSON number. + # + # Not recommended for use in new APIs, but still useful for legacy APIs and + # has no plan to be removed. + # @!attribute [rw] value + # @return [::Float] + # The float value. + class FloatValue + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Wrapper message for `int64`. + # + # The JSON representation for `Int64Value` is JSON string. + # + # Not recommended for use in new APIs, but still useful for legacy APIs and + # has no plan to be removed. + # @!attribute [rw] value + # @return [::Integer] + # The int64 value. + class Int64Value + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Wrapper message for `uint64`. + # + # The JSON representation for `UInt64Value` is JSON string. + # + # Not recommended for use in new APIs, but still useful for legacy APIs and + # has no plan to be removed. + # @!attribute [rw] value + # @return [::Integer] + # The uint64 value. + class UInt64Value + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Wrapper message for `int32`. + # + # The JSON representation for `Int32Value` is JSON number. + # + # Not recommended for use in new APIs, but still useful for legacy APIs and + # has no plan to be removed. + # @!attribute [rw] value + # @return [::Integer] + # The int32 value. + class Int32Value + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Wrapper message for `uint32`. + # + # The JSON representation for `UInt32Value` is JSON number. + # + # Not recommended for use in new APIs, but still useful for legacy APIs and + # has no plan to be removed. + # @!attribute [rw] value + # @return [::Integer] + # The uint32 value. + class UInt32Value + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Wrapper message for `bool`. + # + # The JSON representation for `BoolValue` is JSON `true` and `false`. + # + # Not recommended for use in new APIs, but still useful for legacy APIs and + # has no plan to be removed. + # @!attribute [rw] value + # @return [::Boolean] + # The bool value. + class BoolValue + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Wrapper message for `string`. + # + # The JSON representation for `StringValue` is JSON string. + # + # Not recommended for use in new APIs, but still useful for legacy APIs and + # has no plan to be removed. + # @!attribute [rw] value + # @return [::String] + # The string value. + class StringValue + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Wrapper message for `bytes`. + # + # The JSON representation for `BytesValue` is JSON string. + # + # Not recommended for use in new APIs, but still useful for legacy APIs and + # has no plan to be removed. + # @!attribute [rw] value + # @return [::String] + # The bytes value. + class BytesValue + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end +end diff --git a/owl-bot-staging/google-cloud-retail-v2/proto_docs/google/rpc/status.rb b/owl-bot-staging/google-cloud-retail-v2/proto_docs/google/rpc/status.rb new file mode 100644 index 000000000000..c1a1c07eb2db --- /dev/null +++ b/owl-bot-staging/google-cloud-retail-v2/proto_docs/google/rpc/status.rb @@ -0,0 +1,48 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + + +module Google + module Rpc + # The `Status` type defines a logical error model that is suitable for + # different programming environments, including REST APIs and RPC APIs. It is + # used by [gRPC](https://github.com/grpc). Each `Status` message contains + # three pieces of data: error code, error message, and error details. + # + # You can find out more about this error model and how to work with it in the + # [API Design Guide](https://cloud.google.com/apis/design/errors). + # @!attribute [rw] code + # @return [::Integer] + # The status code, which should be an enum value of + # [google.rpc.Code][google.rpc.Code]. + # @!attribute [rw] message + # @return [::String] + # A developer-facing error message, which should be in English. Any + # user-facing error message should be localized and sent in the + # {::Google::Rpc::Status#details google.rpc.Status.details} field, or localized + # by the client. + # @!attribute [rw] details + # @return [::Array<::Google::Protobuf::Any>] + # A list of messages that carry the error details. There is a common set of + # message types for APIs to use. + class Status + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end +end diff --git a/owl-bot-staging/google-cloud-retail-v2/proto_docs/google/type/date.rb b/owl-bot-staging/google-cloud-retail-v2/proto_docs/google/type/date.rb new file mode 100644 index 000000000000..1d0a9780457f --- /dev/null +++ b/owl-bot-staging/google-cloud-retail-v2/proto_docs/google/type/date.rb @@ -0,0 +1,53 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + + +module Google + module Type + # Represents a whole or partial calendar date, such as a birthday. The time of + # day and time zone are either specified elsewhere or are insignificant. The + # date is relative to the Gregorian Calendar. This can represent one of the + # following: + # + # * A full date, with non-zero year, month, and day values + # * A month and day value, with a zero year, such as an anniversary + # * A year on its own, with zero month and day values + # * A year and month value, with a zero day, such as a credit card expiration + # date + # + # Related types are [google.type.TimeOfDay][google.type.TimeOfDay] and + # `google.protobuf.Timestamp`. + # @!attribute [rw] year + # @return [::Integer] + # Year of the date. Must be from 1 to 9999, or 0 to specify a date without + # a year. + # @!attribute [rw] month + # @return [::Integer] + # Month of a year. Must be from 1 to 12, or 0 to specify a year without a + # month and day. + # @!attribute [rw] day + # @return [::Integer] + # Day of a month. Must be from 1 to 31 and valid for the year and month, or 0 + # to specify a year by itself or a year and month where the day isn't + # significant. + class Date + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end +end diff --git a/owl-bot-staging/google-cloud-retail-v2/snippets/Gemfile b/owl-bot-staging/google-cloud-retail-v2/snippets/Gemfile new file mode 100644 index 000000000000..d2cc0c1eb2ed --- /dev/null +++ b/owl-bot-staging/google-cloud-retail-v2/snippets/Gemfile @@ -0,0 +1,32 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +source "https://rubygems.org" + +if ENV["GOOGLE_CLOUD_SAMPLES_TEST"] == "master" + gem "google-cloud-retail-v2", path: "../" +else + gem "google-cloud-retail-v2" +end + +group :test do + gem "google-style", "~> 1.26.1" + gem "minitest", "~> 5.16" + gem "minitest-focus", "~> 1.1" + gem "minitest-hooks", "~> 1.5" +end diff --git a/owl-bot-staging/google-cloud-retail-v2/snippets/analytics_service/export_analytics_metrics.rb b/owl-bot-staging/google-cloud-retail-v2/snippets/analytics_service/export_analytics_metrics.rb new file mode 100644 index 000000000000..f5249b7f1e32 --- /dev/null +++ b/owl-bot-staging/google-cloud-retail-v2/snippets/analytics_service/export_analytics_metrics.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 retail_v2_generated_AnalyticsService_ExportAnalyticsMetrics_sync] +require "google/cloud/retail/v2" + +## +# Snippet for the export_analytics_metrics call in the AnalyticsService service +# +# This snippet has been automatically generated and should be regarded as a code +# template only. It will require modifications to work: +# - It may require correct/in-range values for request initialization. +# - It may require specifying regional endpoints when creating the service +# client as shown in https://cloud.google.com/ruby/docs/reference. +# +# This is an auto-generated example demonstrating basic usage of +# Google::Cloud::Retail::V2::AnalyticsService::Client#export_analytics_metrics. +# +def export_analytics_metrics + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Retail::V2::AnalyticsService::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Retail::V2::ExportAnalyticsMetricsRequest.new + + # Call the export_analytics_metrics method. + result = client.export_analytics_metrics 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 retail_v2_generated_AnalyticsService_ExportAnalyticsMetrics_sync] diff --git a/owl-bot-staging/google-cloud-retail-v2/snippets/catalog_service/add_catalog_attribute.rb b/owl-bot-staging/google-cloud-retail-v2/snippets/catalog_service/add_catalog_attribute.rb new file mode 100644 index 000000000000..dc85a92e6277 --- /dev/null +++ b/owl-bot-staging/google-cloud-retail-v2/snippets/catalog_service/add_catalog_attribute.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 retail_v2_generated_CatalogService_AddCatalogAttribute_sync] +require "google/cloud/retail/v2" + +## +# Snippet for the add_catalog_attribute call in the CatalogService service +# +# This snippet has been automatically generated and should be regarded as a code +# template only. It will require modifications to work: +# - It may require correct/in-range values for request initialization. +# - It may require specifying regional endpoints when creating the service +# client as shown in https://cloud.google.com/ruby/docs/reference. +# +# This is an auto-generated example demonstrating basic usage of +# Google::Cloud::Retail::V2::CatalogService::Client#add_catalog_attribute. +# +def add_catalog_attribute + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Retail::V2::CatalogService::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Retail::V2::AddCatalogAttributeRequest.new + + # Call the add_catalog_attribute method. + result = client.add_catalog_attribute request + + # The returned object is of type Google::Cloud::Retail::V2::AttributesConfig. + p result +end +# [END retail_v2_generated_CatalogService_AddCatalogAttribute_sync] diff --git a/owl-bot-staging/google-cloud-retail-v2/snippets/catalog_service/get_attributes_config.rb b/owl-bot-staging/google-cloud-retail-v2/snippets/catalog_service/get_attributes_config.rb new file mode 100644 index 000000000000..cb21a1f8e879 --- /dev/null +++ b/owl-bot-staging/google-cloud-retail-v2/snippets/catalog_service/get_attributes_config.rb @@ -0,0 +1,47 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +# [START retail_v2_generated_CatalogService_GetAttributesConfig_sync] +require "google/cloud/retail/v2" + +## +# Snippet for the get_attributes_config call in the CatalogService service +# +# This snippet has been automatically generated and should be regarded as a code +# template only. It will require modifications to work: +# - It may require correct/in-range values for request initialization. +# - It may require specifying regional endpoints when creating the service +# client as shown in https://cloud.google.com/ruby/docs/reference. +# +# This is an auto-generated example demonstrating basic usage of +# Google::Cloud::Retail::V2::CatalogService::Client#get_attributes_config. +# +def get_attributes_config + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Retail::V2::CatalogService::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Retail::V2::GetAttributesConfigRequest.new + + # Call the get_attributes_config method. + result = client.get_attributes_config request + + # The returned object is of type Google::Cloud::Retail::V2::AttributesConfig. + p result +end +# [END retail_v2_generated_CatalogService_GetAttributesConfig_sync] diff --git a/owl-bot-staging/google-cloud-retail-v2/snippets/catalog_service/get_completion_config.rb b/owl-bot-staging/google-cloud-retail-v2/snippets/catalog_service/get_completion_config.rb new file mode 100644 index 000000000000..1668c703deda --- /dev/null +++ b/owl-bot-staging/google-cloud-retail-v2/snippets/catalog_service/get_completion_config.rb @@ -0,0 +1,47 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +# [START retail_v2_generated_CatalogService_GetCompletionConfig_sync] +require "google/cloud/retail/v2" + +## +# Snippet for the get_completion_config call in the CatalogService service +# +# This snippet has been automatically generated and should be regarded as a code +# template only. It will require modifications to work: +# - It may require correct/in-range values for request initialization. +# - It may require specifying regional endpoints when creating the service +# client as shown in https://cloud.google.com/ruby/docs/reference. +# +# This is an auto-generated example demonstrating basic usage of +# Google::Cloud::Retail::V2::CatalogService::Client#get_completion_config. +# +def get_completion_config + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Retail::V2::CatalogService::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Retail::V2::GetCompletionConfigRequest.new + + # Call the get_completion_config method. + result = client.get_completion_config request + + # The returned object is of type Google::Cloud::Retail::V2::CompletionConfig. + p result +end +# [END retail_v2_generated_CatalogService_GetCompletionConfig_sync] diff --git a/owl-bot-staging/google-cloud-retail-v2/snippets/catalog_service/get_default_branch.rb b/owl-bot-staging/google-cloud-retail-v2/snippets/catalog_service/get_default_branch.rb new file mode 100644 index 000000000000..a7c5c47a999d --- /dev/null +++ b/owl-bot-staging/google-cloud-retail-v2/snippets/catalog_service/get_default_branch.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 retail_v2_generated_CatalogService_GetDefaultBranch_sync] +require "google/cloud/retail/v2" + +## +# Snippet for the get_default_branch call in the CatalogService service +# +# This snippet has been automatically generated and should be regarded as a code +# template only. It will require modifications to work: +# - It may require correct/in-range values for request initialization. +# - It may require specifying regional endpoints when creating the service +# client as shown in https://cloud.google.com/ruby/docs/reference. +# +# This is an auto-generated example demonstrating basic usage of +# Google::Cloud::Retail::V2::CatalogService::Client#get_default_branch. +# +def get_default_branch + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Retail::V2::CatalogService::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Retail::V2::GetDefaultBranchRequest.new + + # Call the get_default_branch method. + result = client.get_default_branch request + + # The returned object is of type Google::Cloud::Retail::V2::GetDefaultBranchResponse. + p result +end +# [END retail_v2_generated_CatalogService_GetDefaultBranch_sync] diff --git a/owl-bot-staging/google-cloud-retail-v2/snippets/catalog_service/list_catalogs.rb b/owl-bot-staging/google-cloud-retail-v2/snippets/catalog_service/list_catalogs.rb new file mode 100644 index 000000000000..27f668be91bd --- /dev/null +++ b/owl-bot-staging/google-cloud-retail-v2/snippets/catalog_service/list_catalogs.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 retail_v2_generated_CatalogService_ListCatalogs_sync] +require "google/cloud/retail/v2" + +## +# Snippet for the list_catalogs call in the CatalogService service +# +# This snippet has been automatically generated and should be regarded as a code +# template only. It will require modifications to work: +# - It may require correct/in-range values for request initialization. +# - It may require specifying regional endpoints when creating the service +# client as shown in https://cloud.google.com/ruby/docs/reference. +# +# This is an auto-generated example demonstrating basic usage of +# Google::Cloud::Retail::V2::CatalogService::Client#list_catalogs. +# +def list_catalogs + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Retail::V2::CatalogService::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Retail::V2::ListCatalogsRequest.new + + # Call the list_catalogs method. + result = client.list_catalogs request + + # The returned object is of type Gapic::PagedEnumerable. You can iterate + # over elements, and API calls will be issued to fetch pages as needed. + result.each do |item| + # Each element is of type ::Google::Cloud::Retail::V2::Catalog. + p item + end +end +# [END retail_v2_generated_CatalogService_ListCatalogs_sync] diff --git a/owl-bot-staging/google-cloud-retail-v2/snippets/catalog_service/remove_catalog_attribute.rb b/owl-bot-staging/google-cloud-retail-v2/snippets/catalog_service/remove_catalog_attribute.rb new file mode 100644 index 000000000000..7e0a01dc5446 --- /dev/null +++ b/owl-bot-staging/google-cloud-retail-v2/snippets/catalog_service/remove_catalog_attribute.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 retail_v2_generated_CatalogService_RemoveCatalogAttribute_sync] +require "google/cloud/retail/v2" + +## +# Snippet for the remove_catalog_attribute call in the CatalogService service +# +# This snippet has been automatically generated and should be regarded as a code +# template only. It will require modifications to work: +# - It may require correct/in-range values for request initialization. +# - It may require specifying regional endpoints when creating the service +# client as shown in https://cloud.google.com/ruby/docs/reference. +# +# This is an auto-generated example demonstrating basic usage of +# Google::Cloud::Retail::V2::CatalogService::Client#remove_catalog_attribute. +# +def remove_catalog_attribute + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Retail::V2::CatalogService::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Retail::V2::RemoveCatalogAttributeRequest.new + + # Call the remove_catalog_attribute method. + result = client.remove_catalog_attribute request + + # The returned object is of type Google::Cloud::Retail::V2::AttributesConfig. + p result +end +# [END retail_v2_generated_CatalogService_RemoveCatalogAttribute_sync] diff --git a/owl-bot-staging/google-cloud-retail-v2/snippets/catalog_service/replace_catalog_attribute.rb b/owl-bot-staging/google-cloud-retail-v2/snippets/catalog_service/replace_catalog_attribute.rb new file mode 100644 index 000000000000..7b7e35e9755b --- /dev/null +++ b/owl-bot-staging/google-cloud-retail-v2/snippets/catalog_service/replace_catalog_attribute.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 retail_v2_generated_CatalogService_ReplaceCatalogAttribute_sync] +require "google/cloud/retail/v2" + +## +# Snippet for the replace_catalog_attribute call in the CatalogService service +# +# This snippet has been automatically generated and should be regarded as a code +# template only. It will require modifications to work: +# - It may require correct/in-range values for request initialization. +# - It may require specifying regional endpoints when creating the service +# client as shown in https://cloud.google.com/ruby/docs/reference. +# +# This is an auto-generated example demonstrating basic usage of +# Google::Cloud::Retail::V2::CatalogService::Client#replace_catalog_attribute. +# +def replace_catalog_attribute + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Retail::V2::CatalogService::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Retail::V2::ReplaceCatalogAttributeRequest.new + + # Call the replace_catalog_attribute method. + result = client.replace_catalog_attribute request + + # The returned object is of type Google::Cloud::Retail::V2::AttributesConfig. + p result +end +# [END retail_v2_generated_CatalogService_ReplaceCatalogAttribute_sync] diff --git a/owl-bot-staging/google-cloud-retail-v2/snippets/catalog_service/set_default_branch.rb b/owl-bot-staging/google-cloud-retail-v2/snippets/catalog_service/set_default_branch.rb new file mode 100644 index 000000000000..9c0d64022fa4 --- /dev/null +++ b/owl-bot-staging/google-cloud-retail-v2/snippets/catalog_service/set_default_branch.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 retail_v2_generated_CatalogService_SetDefaultBranch_sync] +require "google/cloud/retail/v2" + +## +# Snippet for the set_default_branch call in the CatalogService service +# +# This snippet has been automatically generated and should be regarded as a code +# template only. It will require modifications to work: +# - It may require correct/in-range values for request initialization. +# - It may require specifying regional endpoints when creating the service +# client as shown in https://cloud.google.com/ruby/docs/reference. +# +# This is an auto-generated example demonstrating basic usage of +# Google::Cloud::Retail::V2::CatalogService::Client#set_default_branch. +# +def set_default_branch + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Retail::V2::CatalogService::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Retail::V2::SetDefaultBranchRequest.new + + # Call the set_default_branch method. + result = client.set_default_branch request + + # The returned object is of type Google::Protobuf::Empty. + p result +end +# [END retail_v2_generated_CatalogService_SetDefaultBranch_sync] diff --git a/owl-bot-staging/google-cloud-retail-v2/snippets/catalog_service/update_attributes_config.rb b/owl-bot-staging/google-cloud-retail-v2/snippets/catalog_service/update_attributes_config.rb new file mode 100644 index 000000000000..1b5fc7f4253a --- /dev/null +++ b/owl-bot-staging/google-cloud-retail-v2/snippets/catalog_service/update_attributes_config.rb @@ -0,0 +1,47 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +# [START retail_v2_generated_CatalogService_UpdateAttributesConfig_sync] +require "google/cloud/retail/v2" + +## +# Snippet for the update_attributes_config call in the CatalogService service +# +# This snippet has been automatically generated and should be regarded as a code +# template only. It will require modifications to work: +# - It may require correct/in-range values for request initialization. +# - It may require specifying regional endpoints when creating the service +# client as shown in https://cloud.google.com/ruby/docs/reference. +# +# This is an auto-generated example demonstrating basic usage of +# Google::Cloud::Retail::V2::CatalogService::Client#update_attributes_config. +# +def update_attributes_config + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Retail::V2::CatalogService::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Retail::V2::UpdateAttributesConfigRequest.new + + # Call the update_attributes_config method. + result = client.update_attributes_config request + + # The returned object is of type Google::Cloud::Retail::V2::AttributesConfig. + p result +end +# [END retail_v2_generated_CatalogService_UpdateAttributesConfig_sync] diff --git a/owl-bot-staging/google-cloud-retail-v2/snippets/catalog_service/update_catalog.rb b/owl-bot-staging/google-cloud-retail-v2/snippets/catalog_service/update_catalog.rb new file mode 100644 index 000000000000..ea0eaa4f2b83 --- /dev/null +++ b/owl-bot-staging/google-cloud-retail-v2/snippets/catalog_service/update_catalog.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 retail_v2_generated_CatalogService_UpdateCatalog_sync] +require "google/cloud/retail/v2" + +## +# Snippet for the update_catalog call in the CatalogService service +# +# This snippet has been automatically generated and should be regarded as a code +# template only. It will require modifications to work: +# - It may require correct/in-range values for request initialization. +# - It may require specifying regional endpoints when creating the service +# client as shown in https://cloud.google.com/ruby/docs/reference. +# +# This is an auto-generated example demonstrating basic usage of +# Google::Cloud::Retail::V2::CatalogService::Client#update_catalog. +# +def update_catalog + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Retail::V2::CatalogService::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Retail::V2::UpdateCatalogRequest.new + + # Call the update_catalog method. + result = client.update_catalog request + + # The returned object is of type Google::Cloud::Retail::V2::Catalog. + p result +end +# [END retail_v2_generated_CatalogService_UpdateCatalog_sync] diff --git a/owl-bot-staging/google-cloud-retail-v2/snippets/catalog_service/update_completion_config.rb b/owl-bot-staging/google-cloud-retail-v2/snippets/catalog_service/update_completion_config.rb new file mode 100644 index 000000000000..5d8036e6732d --- /dev/null +++ b/owl-bot-staging/google-cloud-retail-v2/snippets/catalog_service/update_completion_config.rb @@ -0,0 +1,47 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +# [START retail_v2_generated_CatalogService_UpdateCompletionConfig_sync] +require "google/cloud/retail/v2" + +## +# Snippet for the update_completion_config call in the CatalogService service +# +# This snippet has been automatically generated and should be regarded as a code +# template only. It will require modifications to work: +# - It may require correct/in-range values for request initialization. +# - It may require specifying regional endpoints when creating the service +# client as shown in https://cloud.google.com/ruby/docs/reference. +# +# This is an auto-generated example demonstrating basic usage of +# Google::Cloud::Retail::V2::CatalogService::Client#update_completion_config. +# +def update_completion_config + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Retail::V2::CatalogService::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Retail::V2::UpdateCompletionConfigRequest.new + + # Call the update_completion_config method. + result = client.update_completion_config request + + # The returned object is of type Google::Cloud::Retail::V2::CompletionConfig. + p result +end +# [END retail_v2_generated_CatalogService_UpdateCompletionConfig_sync] diff --git a/owl-bot-staging/google-cloud-retail-v2/snippets/completion_service/complete_query.rb b/owl-bot-staging/google-cloud-retail-v2/snippets/completion_service/complete_query.rb new file mode 100644 index 000000000000..874d7cee8d67 --- /dev/null +++ b/owl-bot-staging/google-cloud-retail-v2/snippets/completion_service/complete_query.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 retail_v2_generated_CompletionService_CompleteQuery_sync] +require "google/cloud/retail/v2" + +## +# Snippet for the complete_query call in the CompletionService service +# +# This snippet has been automatically generated and should be regarded as a code +# template only. It will require modifications to work: +# - It may require correct/in-range values for request initialization. +# - It may require specifying regional endpoints when creating the service +# client as shown in https://cloud.google.com/ruby/docs/reference. +# +# This is an auto-generated example demonstrating basic usage of +# Google::Cloud::Retail::V2::CompletionService::Client#complete_query. +# +def complete_query + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Retail::V2::CompletionService::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Retail::V2::CompleteQueryRequest.new + + # Call the complete_query method. + result = client.complete_query request + + # The returned object is of type Google::Cloud::Retail::V2::CompleteQueryResponse. + p result +end +# [END retail_v2_generated_CompletionService_CompleteQuery_sync] diff --git a/owl-bot-staging/google-cloud-retail-v2/snippets/completion_service/import_completion_data.rb b/owl-bot-staging/google-cloud-retail-v2/snippets/completion_service/import_completion_data.rb new file mode 100644 index 000000000000..fe1f28f0844e --- /dev/null +++ b/owl-bot-staging/google-cloud-retail-v2/snippets/completion_service/import_completion_data.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 retail_v2_generated_CompletionService_ImportCompletionData_sync] +require "google/cloud/retail/v2" + +## +# Snippet for the import_completion_data call in the CompletionService service +# +# This snippet has been automatically generated and should be regarded as a code +# template only. It will require modifications to work: +# - It may require correct/in-range values for request initialization. +# - It may require specifying regional endpoints when creating the service +# client as shown in https://cloud.google.com/ruby/docs/reference. +# +# This is an auto-generated example demonstrating basic usage of +# Google::Cloud::Retail::V2::CompletionService::Client#import_completion_data. +# +def import_completion_data + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Retail::V2::CompletionService::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Retail::V2::ImportCompletionDataRequest.new + + # Call the import_completion_data method. + result = client.import_completion_data 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 retail_v2_generated_CompletionService_ImportCompletionData_sync] diff --git a/owl-bot-staging/google-cloud-retail-v2/snippets/control_service/create_control.rb b/owl-bot-staging/google-cloud-retail-v2/snippets/control_service/create_control.rb new file mode 100644 index 000000000000..32b89537acd9 --- /dev/null +++ b/owl-bot-staging/google-cloud-retail-v2/snippets/control_service/create_control.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 retail_v2_generated_ControlService_CreateControl_sync] +require "google/cloud/retail/v2" + +## +# Snippet for the create_control call in the ControlService service +# +# This snippet has been automatically generated and should be regarded as a code +# template only. It will require modifications to work: +# - It may require correct/in-range values for request initialization. +# - It may require specifying regional endpoints when creating the service +# client as shown in https://cloud.google.com/ruby/docs/reference. +# +# This is an auto-generated example demonstrating basic usage of +# Google::Cloud::Retail::V2::ControlService::Client#create_control. +# +def create_control + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Retail::V2::ControlService::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Retail::V2::CreateControlRequest.new + + # Call the create_control method. + result = client.create_control request + + # The returned object is of type Google::Cloud::Retail::V2::Control. + p result +end +# [END retail_v2_generated_ControlService_CreateControl_sync] diff --git a/owl-bot-staging/google-cloud-retail-v2/snippets/control_service/delete_control.rb b/owl-bot-staging/google-cloud-retail-v2/snippets/control_service/delete_control.rb new file mode 100644 index 000000000000..42aa73e1063a --- /dev/null +++ b/owl-bot-staging/google-cloud-retail-v2/snippets/control_service/delete_control.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 retail_v2_generated_ControlService_DeleteControl_sync] +require "google/cloud/retail/v2" + +## +# Snippet for the delete_control call in the ControlService service +# +# This snippet has been automatically generated and should be regarded as a code +# template only. It will require modifications to work: +# - It may require correct/in-range values for request initialization. +# - It may require specifying regional endpoints when creating the service +# client as shown in https://cloud.google.com/ruby/docs/reference. +# +# This is an auto-generated example demonstrating basic usage of +# Google::Cloud::Retail::V2::ControlService::Client#delete_control. +# +def delete_control + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Retail::V2::ControlService::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Retail::V2::DeleteControlRequest.new + + # Call the delete_control method. + result = client.delete_control request + + # The returned object is of type Google::Protobuf::Empty. + p result +end +# [END retail_v2_generated_ControlService_DeleteControl_sync] diff --git a/owl-bot-staging/google-cloud-retail-v2/snippets/control_service/get_control.rb b/owl-bot-staging/google-cloud-retail-v2/snippets/control_service/get_control.rb new file mode 100644 index 000000000000..2785feb65202 --- /dev/null +++ b/owl-bot-staging/google-cloud-retail-v2/snippets/control_service/get_control.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 retail_v2_generated_ControlService_GetControl_sync] +require "google/cloud/retail/v2" + +## +# Snippet for the get_control call in the ControlService service +# +# This snippet has been automatically generated and should be regarded as a code +# template only. It will require modifications to work: +# - It may require correct/in-range values for request initialization. +# - It may require specifying regional endpoints when creating the service +# client as shown in https://cloud.google.com/ruby/docs/reference. +# +# This is an auto-generated example demonstrating basic usage of +# Google::Cloud::Retail::V2::ControlService::Client#get_control. +# +def get_control + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Retail::V2::ControlService::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Retail::V2::GetControlRequest.new + + # Call the get_control method. + result = client.get_control request + + # The returned object is of type Google::Cloud::Retail::V2::Control. + p result +end +# [END retail_v2_generated_ControlService_GetControl_sync] diff --git a/owl-bot-staging/google-cloud-retail-v2/snippets/control_service/list_controls.rb b/owl-bot-staging/google-cloud-retail-v2/snippets/control_service/list_controls.rb new file mode 100644 index 000000000000..7394fdd3076a --- /dev/null +++ b/owl-bot-staging/google-cloud-retail-v2/snippets/control_service/list_controls.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 retail_v2_generated_ControlService_ListControls_sync] +require "google/cloud/retail/v2" + +## +# Snippet for the list_controls call in the ControlService service +# +# This snippet has been automatically generated and should be regarded as a code +# template only. It will require modifications to work: +# - It may require correct/in-range values for request initialization. +# - It may require specifying regional endpoints when creating the service +# client as shown in https://cloud.google.com/ruby/docs/reference. +# +# This is an auto-generated example demonstrating basic usage of +# Google::Cloud::Retail::V2::ControlService::Client#list_controls. +# +def list_controls + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Retail::V2::ControlService::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Retail::V2::ListControlsRequest.new + + # Call the list_controls method. + result = client.list_controls request + + # The returned object is of type Gapic::PagedEnumerable. You can iterate + # over elements, and API calls will be issued to fetch pages as needed. + result.each do |item| + # Each element is of type ::Google::Cloud::Retail::V2::Control. + p item + end +end +# [END retail_v2_generated_ControlService_ListControls_sync] diff --git a/owl-bot-staging/google-cloud-retail-v2/snippets/control_service/update_control.rb b/owl-bot-staging/google-cloud-retail-v2/snippets/control_service/update_control.rb new file mode 100644 index 000000000000..f3bf5821b03b --- /dev/null +++ b/owl-bot-staging/google-cloud-retail-v2/snippets/control_service/update_control.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 retail_v2_generated_ControlService_UpdateControl_sync] +require "google/cloud/retail/v2" + +## +# Snippet for the update_control call in the ControlService service +# +# This snippet has been automatically generated and should be regarded as a code +# template only. It will require modifications to work: +# - It may require correct/in-range values for request initialization. +# - It may require specifying regional endpoints when creating the service +# client as shown in https://cloud.google.com/ruby/docs/reference. +# +# This is an auto-generated example demonstrating basic usage of +# Google::Cloud::Retail::V2::ControlService::Client#update_control. +# +def update_control + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Retail::V2::ControlService::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Retail::V2::UpdateControlRequest.new + + # Call the update_control method. + result = client.update_control request + + # The returned object is of type Google::Cloud::Retail::V2::Control. + p result +end +# [END retail_v2_generated_ControlService_UpdateControl_sync] diff --git a/owl-bot-staging/google-cloud-retail-v2/snippets/conversational_search_service/conversational_search.rb b/owl-bot-staging/google-cloud-retail-v2/snippets/conversational_search_service/conversational_search.rb new file mode 100644 index 000000000000..19ab711ac479 --- /dev/null +++ b/owl-bot-staging/google-cloud-retail-v2/snippets/conversational_search_service/conversational_search.rb @@ -0,0 +1,50 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +# [START retail_v2_generated_ConversationalSearchService_ConversationalSearch_sync] +require "google/cloud/retail/v2" + +## +# Snippet for the conversational_search call in the ConversationalSearchService service +# +# This snippet has been automatically generated and should be regarded as a code +# template only. It will require modifications to work: +# - It may require correct/in-range values for request initialization. +# - It may require specifying regional endpoints when creating the service +# client as shown in https://cloud.google.com/ruby/docs/reference. +# +# This is an auto-generated example demonstrating basic usage of +# Google::Cloud::Retail::V2::ConversationalSearchService::Client#conversational_search. +# +def conversational_search + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Retail::V2::ConversationalSearchService::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Retail::V2::ConversationalSearchRequest.new + + # Call the conversational_search method to start streaming. + output = client.conversational_search request + + # The returned object is a streamed enumerable yielding elements of type + # ::Google::Cloud::Retail::V2::ConversationalSearchResponse + output.each do |current_response| + p current_response + end +end +# [END retail_v2_generated_ConversationalSearchService_ConversationalSearch_sync] diff --git a/owl-bot-staging/google-cloud-retail-v2/snippets/generative_question_service/batch_update_generative_question_configs.rb b/owl-bot-staging/google-cloud-retail-v2/snippets/generative_question_service/batch_update_generative_question_configs.rb new file mode 100644 index 000000000000..ec7f82414dea --- /dev/null +++ b/owl-bot-staging/google-cloud-retail-v2/snippets/generative_question_service/batch_update_generative_question_configs.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 retail_v2_generated_GenerativeQuestionService_BatchUpdateGenerativeQuestionConfigs_sync] +require "google/cloud/retail/v2" + +## +# Snippet for the batch_update_generative_question_configs call in the GenerativeQuestionService service +# +# This snippet has been automatically generated and should be regarded as a code +# template only. It will require modifications to work: +# - It may require correct/in-range values for request initialization. +# - It may require specifying regional endpoints when creating the service +# client as shown in https://cloud.google.com/ruby/docs/reference. +# +# This is an auto-generated example demonstrating basic usage of +# Google::Cloud::Retail::V2::GenerativeQuestionService::Client#batch_update_generative_question_configs. +# +def batch_update_generative_question_configs + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Retail::V2::GenerativeQuestionService::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Retail::V2::BatchUpdateGenerativeQuestionConfigsRequest.new + + # Call the batch_update_generative_question_configs method. + result = client.batch_update_generative_question_configs request + + # The returned object is of type Google::Cloud::Retail::V2::BatchUpdateGenerativeQuestionConfigsResponse. + p result +end +# [END retail_v2_generated_GenerativeQuestionService_BatchUpdateGenerativeQuestionConfigs_sync] diff --git a/owl-bot-staging/google-cloud-retail-v2/snippets/generative_question_service/get_generative_questions_feature_config.rb b/owl-bot-staging/google-cloud-retail-v2/snippets/generative_question_service/get_generative_questions_feature_config.rb new file mode 100644 index 000000000000..d9b400ceed6d --- /dev/null +++ b/owl-bot-staging/google-cloud-retail-v2/snippets/generative_question_service/get_generative_questions_feature_config.rb @@ -0,0 +1,47 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +# [START retail_v2_generated_GenerativeQuestionService_GetGenerativeQuestionsFeatureConfig_sync] +require "google/cloud/retail/v2" + +## +# Snippet for the get_generative_questions_feature_config call in the GenerativeQuestionService service +# +# This snippet has been automatically generated and should be regarded as a code +# template only. It will require modifications to work: +# - It may require correct/in-range values for request initialization. +# - It may require specifying regional endpoints when creating the service +# client as shown in https://cloud.google.com/ruby/docs/reference. +# +# This is an auto-generated example demonstrating basic usage of +# Google::Cloud::Retail::V2::GenerativeQuestionService::Client#get_generative_questions_feature_config. +# +def get_generative_questions_feature_config + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Retail::V2::GenerativeQuestionService::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Retail::V2::GetGenerativeQuestionsFeatureConfigRequest.new + + # Call the get_generative_questions_feature_config method. + result = client.get_generative_questions_feature_config request + + # The returned object is of type Google::Cloud::Retail::V2::GenerativeQuestionsFeatureConfig. + p result +end +# [END retail_v2_generated_GenerativeQuestionService_GetGenerativeQuestionsFeatureConfig_sync] diff --git a/owl-bot-staging/google-cloud-retail-v2/snippets/generative_question_service/list_generative_question_configs.rb b/owl-bot-staging/google-cloud-retail-v2/snippets/generative_question_service/list_generative_question_configs.rb new file mode 100644 index 000000000000..66d6f2d20042 --- /dev/null +++ b/owl-bot-staging/google-cloud-retail-v2/snippets/generative_question_service/list_generative_question_configs.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 retail_v2_generated_GenerativeQuestionService_ListGenerativeQuestionConfigs_sync] +require "google/cloud/retail/v2" + +## +# Snippet for the list_generative_question_configs call in the GenerativeQuestionService service +# +# This snippet has been automatically generated and should be regarded as a code +# template only. It will require modifications to work: +# - It may require correct/in-range values for request initialization. +# - It may require specifying regional endpoints when creating the service +# client as shown in https://cloud.google.com/ruby/docs/reference. +# +# This is an auto-generated example demonstrating basic usage of +# Google::Cloud::Retail::V2::GenerativeQuestionService::Client#list_generative_question_configs. +# +def list_generative_question_configs + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Retail::V2::GenerativeQuestionService::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Retail::V2::ListGenerativeQuestionConfigsRequest.new + + # Call the list_generative_question_configs method. + result = client.list_generative_question_configs request + + # The returned object is of type Google::Cloud::Retail::V2::ListGenerativeQuestionConfigsResponse. + p result +end +# [END retail_v2_generated_GenerativeQuestionService_ListGenerativeQuestionConfigs_sync] diff --git a/owl-bot-staging/google-cloud-retail-v2/snippets/generative_question_service/update_generative_question_config.rb b/owl-bot-staging/google-cloud-retail-v2/snippets/generative_question_service/update_generative_question_config.rb new file mode 100644 index 000000000000..73faa0a00347 --- /dev/null +++ b/owl-bot-staging/google-cloud-retail-v2/snippets/generative_question_service/update_generative_question_config.rb @@ -0,0 +1,47 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +# [START retail_v2_generated_GenerativeQuestionService_UpdateGenerativeQuestionConfig_sync] +require "google/cloud/retail/v2" + +## +# Snippet for the update_generative_question_config call in the GenerativeQuestionService service +# +# This snippet has been automatically generated and should be regarded as a code +# template only. It will require modifications to work: +# - It may require correct/in-range values for request initialization. +# - It may require specifying regional endpoints when creating the service +# client as shown in https://cloud.google.com/ruby/docs/reference. +# +# This is an auto-generated example demonstrating basic usage of +# Google::Cloud::Retail::V2::GenerativeQuestionService::Client#update_generative_question_config. +# +def update_generative_question_config + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Retail::V2::GenerativeQuestionService::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Retail::V2::UpdateGenerativeQuestionConfigRequest.new + + # Call the update_generative_question_config method. + result = client.update_generative_question_config request + + # The returned object is of type Google::Cloud::Retail::V2::GenerativeQuestionConfig. + p result +end +# [END retail_v2_generated_GenerativeQuestionService_UpdateGenerativeQuestionConfig_sync] diff --git a/owl-bot-staging/google-cloud-retail-v2/snippets/generative_question_service/update_generative_questions_feature_config.rb b/owl-bot-staging/google-cloud-retail-v2/snippets/generative_question_service/update_generative_questions_feature_config.rb new file mode 100644 index 000000000000..edec3d61d8a8 --- /dev/null +++ b/owl-bot-staging/google-cloud-retail-v2/snippets/generative_question_service/update_generative_questions_feature_config.rb @@ -0,0 +1,47 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +# [START retail_v2_generated_GenerativeQuestionService_UpdateGenerativeQuestionsFeatureConfig_sync] +require "google/cloud/retail/v2" + +## +# Snippet for the update_generative_questions_feature_config call in the GenerativeQuestionService service +# +# This snippet has been automatically generated and should be regarded as a code +# template only. It will require modifications to work: +# - It may require correct/in-range values for request initialization. +# - It may require specifying regional endpoints when creating the service +# client as shown in https://cloud.google.com/ruby/docs/reference. +# +# This is an auto-generated example demonstrating basic usage of +# Google::Cloud::Retail::V2::GenerativeQuestionService::Client#update_generative_questions_feature_config. +# +def update_generative_questions_feature_config + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Retail::V2::GenerativeQuestionService::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Retail::V2::UpdateGenerativeQuestionsFeatureConfigRequest.new + + # Call the update_generative_questions_feature_config method. + result = client.update_generative_questions_feature_config request + + # The returned object is of type Google::Cloud::Retail::V2::GenerativeQuestionsFeatureConfig. + p result +end +# [END retail_v2_generated_GenerativeQuestionService_UpdateGenerativeQuestionsFeatureConfig_sync] diff --git a/owl-bot-staging/google-cloud-retail-v2/snippets/model_service/create_model.rb b/owl-bot-staging/google-cloud-retail-v2/snippets/model_service/create_model.rb new file mode 100644 index 000000000000..ffbfd59f4a13 --- /dev/null +++ b/owl-bot-staging/google-cloud-retail-v2/snippets/model_service/create_model.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 retail_v2_generated_ModelService_CreateModel_sync] +require "google/cloud/retail/v2" + +## +# Snippet for the create_model call in the ModelService service +# +# This snippet has been automatically generated and should be regarded as a code +# template only. It will require modifications to work: +# - It may require correct/in-range values for request initialization. +# - It may require specifying regional endpoints when creating the service +# client as shown in https://cloud.google.com/ruby/docs/reference. +# +# This is an auto-generated example demonstrating basic usage of +# Google::Cloud::Retail::V2::ModelService::Client#create_model. +# +def create_model + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Retail::V2::ModelService::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Retail::V2::CreateModelRequest.new + + # Call the create_model method. + result = client.create_model 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 retail_v2_generated_ModelService_CreateModel_sync] diff --git a/owl-bot-staging/google-cloud-retail-v2/snippets/model_service/delete_model.rb b/owl-bot-staging/google-cloud-retail-v2/snippets/model_service/delete_model.rb new file mode 100644 index 000000000000..8a92e3fe6c8e --- /dev/null +++ b/owl-bot-staging/google-cloud-retail-v2/snippets/model_service/delete_model.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 retail_v2_generated_ModelService_DeleteModel_sync] +require "google/cloud/retail/v2" + +## +# Snippet for the delete_model call in the ModelService service +# +# This snippet has been automatically generated and should be regarded as a code +# template only. It will require modifications to work: +# - It may require correct/in-range values for request initialization. +# - It may require specifying regional endpoints when creating the service +# client as shown in https://cloud.google.com/ruby/docs/reference. +# +# This is an auto-generated example demonstrating basic usage of +# Google::Cloud::Retail::V2::ModelService::Client#delete_model. +# +def delete_model + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Retail::V2::ModelService::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Retail::V2::DeleteModelRequest.new + + # Call the delete_model method. + result = client.delete_model request + + # The returned object is of type Google::Protobuf::Empty. + p result +end +# [END retail_v2_generated_ModelService_DeleteModel_sync] diff --git a/owl-bot-staging/google-cloud-retail-v2/snippets/model_service/get_model.rb b/owl-bot-staging/google-cloud-retail-v2/snippets/model_service/get_model.rb new file mode 100644 index 000000000000..8ca949873471 --- /dev/null +++ b/owl-bot-staging/google-cloud-retail-v2/snippets/model_service/get_model.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 retail_v2_generated_ModelService_GetModel_sync] +require "google/cloud/retail/v2" + +## +# Snippet for the get_model call in the ModelService service +# +# This snippet has been automatically generated and should be regarded as a code +# template only. It will require modifications to work: +# - It may require correct/in-range values for request initialization. +# - It may require specifying regional endpoints when creating the service +# client as shown in https://cloud.google.com/ruby/docs/reference. +# +# This is an auto-generated example demonstrating basic usage of +# Google::Cloud::Retail::V2::ModelService::Client#get_model. +# +def get_model + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Retail::V2::ModelService::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Retail::V2::GetModelRequest.new + + # Call the get_model method. + result = client.get_model request + + # The returned object is of type Google::Cloud::Retail::V2::Model. + p result +end +# [END retail_v2_generated_ModelService_GetModel_sync] diff --git a/owl-bot-staging/google-cloud-retail-v2/snippets/model_service/list_models.rb b/owl-bot-staging/google-cloud-retail-v2/snippets/model_service/list_models.rb new file mode 100644 index 000000000000..a652ccbdc26a --- /dev/null +++ b/owl-bot-staging/google-cloud-retail-v2/snippets/model_service/list_models.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 retail_v2_generated_ModelService_ListModels_sync] +require "google/cloud/retail/v2" + +## +# Snippet for the list_models call in the ModelService service +# +# This snippet has been automatically generated and should be regarded as a code +# template only. It will require modifications to work: +# - It may require correct/in-range values for request initialization. +# - It may require specifying regional endpoints when creating the service +# client as shown in https://cloud.google.com/ruby/docs/reference. +# +# This is an auto-generated example demonstrating basic usage of +# Google::Cloud::Retail::V2::ModelService::Client#list_models. +# +def list_models + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Retail::V2::ModelService::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Retail::V2::ListModelsRequest.new + + # Call the list_models method. + result = client.list_models request + + # The returned object is of type Gapic::PagedEnumerable. You can iterate + # over elements, and API calls will be issued to fetch pages as needed. + result.each do |item| + # Each element is of type ::Google::Cloud::Retail::V2::Model. + p item + end +end +# [END retail_v2_generated_ModelService_ListModels_sync] diff --git a/owl-bot-staging/google-cloud-retail-v2/snippets/model_service/pause_model.rb b/owl-bot-staging/google-cloud-retail-v2/snippets/model_service/pause_model.rb new file mode 100644 index 000000000000..d563bf2a6c88 --- /dev/null +++ b/owl-bot-staging/google-cloud-retail-v2/snippets/model_service/pause_model.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 retail_v2_generated_ModelService_PauseModel_sync] +require "google/cloud/retail/v2" + +## +# Snippet for the pause_model call in the ModelService service +# +# This snippet has been automatically generated and should be regarded as a code +# template only. It will require modifications to work: +# - It may require correct/in-range values for request initialization. +# - It may require specifying regional endpoints when creating the service +# client as shown in https://cloud.google.com/ruby/docs/reference. +# +# This is an auto-generated example demonstrating basic usage of +# Google::Cloud::Retail::V2::ModelService::Client#pause_model. +# +def pause_model + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Retail::V2::ModelService::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Retail::V2::PauseModelRequest.new + + # Call the pause_model method. + result = client.pause_model request + + # The returned object is of type Google::Cloud::Retail::V2::Model. + p result +end +# [END retail_v2_generated_ModelService_PauseModel_sync] diff --git a/owl-bot-staging/google-cloud-retail-v2/snippets/model_service/resume_model.rb b/owl-bot-staging/google-cloud-retail-v2/snippets/model_service/resume_model.rb new file mode 100644 index 000000000000..175e84817b36 --- /dev/null +++ b/owl-bot-staging/google-cloud-retail-v2/snippets/model_service/resume_model.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 retail_v2_generated_ModelService_ResumeModel_sync] +require "google/cloud/retail/v2" + +## +# Snippet for the resume_model call in the ModelService service +# +# This snippet has been automatically generated and should be regarded as a code +# template only. It will require modifications to work: +# - It may require correct/in-range values for request initialization. +# - It may require specifying regional endpoints when creating the service +# client as shown in https://cloud.google.com/ruby/docs/reference. +# +# This is an auto-generated example demonstrating basic usage of +# Google::Cloud::Retail::V2::ModelService::Client#resume_model. +# +def resume_model + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Retail::V2::ModelService::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Retail::V2::ResumeModelRequest.new + + # Call the resume_model method. + result = client.resume_model request + + # The returned object is of type Google::Cloud::Retail::V2::Model. + p result +end +# [END retail_v2_generated_ModelService_ResumeModel_sync] diff --git a/owl-bot-staging/google-cloud-retail-v2/snippets/model_service/tune_model.rb b/owl-bot-staging/google-cloud-retail-v2/snippets/model_service/tune_model.rb new file mode 100644 index 000000000000..8b60f30ed5ee --- /dev/null +++ b/owl-bot-staging/google-cloud-retail-v2/snippets/model_service/tune_model.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 retail_v2_generated_ModelService_TuneModel_sync] +require "google/cloud/retail/v2" + +## +# Snippet for the tune_model call in the ModelService service +# +# This snippet has been automatically generated and should be regarded as a code +# template only. It will require modifications to work: +# - It may require correct/in-range values for request initialization. +# - It may require specifying regional endpoints when creating the service +# client as shown in https://cloud.google.com/ruby/docs/reference. +# +# This is an auto-generated example demonstrating basic usage of +# Google::Cloud::Retail::V2::ModelService::Client#tune_model. +# +def tune_model + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Retail::V2::ModelService::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Retail::V2::TuneModelRequest.new + + # Call the tune_model method. + result = client.tune_model 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 retail_v2_generated_ModelService_TuneModel_sync] diff --git a/owl-bot-staging/google-cloud-retail-v2/snippets/model_service/update_model.rb b/owl-bot-staging/google-cloud-retail-v2/snippets/model_service/update_model.rb new file mode 100644 index 000000000000..0648bf6ab25e --- /dev/null +++ b/owl-bot-staging/google-cloud-retail-v2/snippets/model_service/update_model.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 retail_v2_generated_ModelService_UpdateModel_sync] +require "google/cloud/retail/v2" + +## +# Snippet for the update_model call in the ModelService service +# +# This snippet has been automatically generated and should be regarded as a code +# template only. It will require modifications to work: +# - It may require correct/in-range values for request initialization. +# - It may require specifying regional endpoints when creating the service +# client as shown in https://cloud.google.com/ruby/docs/reference. +# +# This is an auto-generated example demonstrating basic usage of +# Google::Cloud::Retail::V2::ModelService::Client#update_model. +# +def update_model + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Retail::V2::ModelService::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Retail::V2::UpdateModelRequest.new + + # Call the update_model method. + result = client.update_model request + + # The returned object is of type Google::Cloud::Retail::V2::Model. + p result +end +# [END retail_v2_generated_ModelService_UpdateModel_sync] diff --git a/owl-bot-staging/google-cloud-retail-v2/snippets/prediction_service/predict.rb b/owl-bot-staging/google-cloud-retail-v2/snippets/prediction_service/predict.rb new file mode 100644 index 000000000000..da0cc34c34ab --- /dev/null +++ b/owl-bot-staging/google-cloud-retail-v2/snippets/prediction_service/predict.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 retail_v2_generated_PredictionService_Predict_sync] +require "google/cloud/retail/v2" + +## +# Snippet for the predict call in the PredictionService service +# +# This snippet has been automatically generated and should be regarded as a code +# template only. It will require modifications to work: +# - It may require correct/in-range values for request initialization. +# - It may require specifying regional endpoints when creating the service +# client as shown in https://cloud.google.com/ruby/docs/reference. +# +# This is an auto-generated example demonstrating basic usage of +# Google::Cloud::Retail::V2::PredictionService::Client#predict. +# +def predict + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Retail::V2::PredictionService::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Retail::V2::PredictRequest.new + + # Call the predict method. + result = client.predict request + + # The returned object is of type Google::Cloud::Retail::V2::PredictResponse. + p result +end +# [END retail_v2_generated_PredictionService_Predict_sync] diff --git a/owl-bot-staging/google-cloud-retail-v2/snippets/product_service/add_fulfillment_places.rb b/owl-bot-staging/google-cloud-retail-v2/snippets/product_service/add_fulfillment_places.rb new file mode 100644 index 000000000000..4ec26b4419f7 --- /dev/null +++ b/owl-bot-staging/google-cloud-retail-v2/snippets/product_service/add_fulfillment_places.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 retail_v2_generated_ProductService_AddFulfillmentPlaces_sync] +require "google/cloud/retail/v2" + +## +# Snippet for the add_fulfillment_places call in the ProductService service +# +# This snippet has been automatically generated and should be regarded as a code +# template only. It will require modifications to work: +# - It may require correct/in-range values for request initialization. +# - It may require specifying regional endpoints when creating the service +# client as shown in https://cloud.google.com/ruby/docs/reference. +# +# This is an auto-generated example demonstrating basic usage of +# Google::Cloud::Retail::V2::ProductService::Client#add_fulfillment_places. +# +def add_fulfillment_places + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Retail::V2::ProductService::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Retail::V2::AddFulfillmentPlacesRequest.new + + # Call the add_fulfillment_places method. + result = client.add_fulfillment_places 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 retail_v2_generated_ProductService_AddFulfillmentPlaces_sync] diff --git a/owl-bot-staging/google-cloud-retail-v2/snippets/product_service/add_local_inventories.rb b/owl-bot-staging/google-cloud-retail-v2/snippets/product_service/add_local_inventories.rb new file mode 100644 index 000000000000..2f4627281ccb --- /dev/null +++ b/owl-bot-staging/google-cloud-retail-v2/snippets/product_service/add_local_inventories.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 retail_v2_generated_ProductService_AddLocalInventories_sync] +require "google/cloud/retail/v2" + +## +# Snippet for the add_local_inventories call in the ProductService service +# +# This snippet has been automatically generated and should be regarded as a code +# template only. It will require modifications to work: +# - It may require correct/in-range values for request initialization. +# - It may require specifying regional endpoints when creating the service +# client as shown in https://cloud.google.com/ruby/docs/reference. +# +# This is an auto-generated example demonstrating basic usage of +# Google::Cloud::Retail::V2::ProductService::Client#add_local_inventories. +# +def add_local_inventories + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Retail::V2::ProductService::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Retail::V2::AddLocalInventoriesRequest.new + + # Call the add_local_inventories method. + result = client.add_local_inventories 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 retail_v2_generated_ProductService_AddLocalInventories_sync] diff --git a/owl-bot-staging/google-cloud-retail-v2/snippets/product_service/create_product.rb b/owl-bot-staging/google-cloud-retail-v2/snippets/product_service/create_product.rb new file mode 100644 index 000000000000..4042ed4becf7 --- /dev/null +++ b/owl-bot-staging/google-cloud-retail-v2/snippets/product_service/create_product.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 retail_v2_generated_ProductService_CreateProduct_sync] +require "google/cloud/retail/v2" + +## +# Snippet for the create_product call in the ProductService service +# +# This snippet has been automatically generated and should be regarded as a code +# template only. It will require modifications to work: +# - It may require correct/in-range values for request initialization. +# - It may require specifying regional endpoints when creating the service +# client as shown in https://cloud.google.com/ruby/docs/reference. +# +# This is an auto-generated example demonstrating basic usage of +# Google::Cloud::Retail::V2::ProductService::Client#create_product. +# +def create_product + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Retail::V2::ProductService::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Retail::V2::CreateProductRequest.new + + # Call the create_product method. + result = client.create_product request + + # The returned object is of type Google::Cloud::Retail::V2::Product. + p result +end +# [END retail_v2_generated_ProductService_CreateProduct_sync] diff --git a/owl-bot-staging/google-cloud-retail-v2/snippets/product_service/delete_product.rb b/owl-bot-staging/google-cloud-retail-v2/snippets/product_service/delete_product.rb new file mode 100644 index 000000000000..6a95e9192bfa --- /dev/null +++ b/owl-bot-staging/google-cloud-retail-v2/snippets/product_service/delete_product.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 retail_v2_generated_ProductService_DeleteProduct_sync] +require "google/cloud/retail/v2" + +## +# Snippet for the delete_product call in the ProductService service +# +# This snippet has been automatically generated and should be regarded as a code +# template only. It will require modifications to work: +# - It may require correct/in-range values for request initialization. +# - It may require specifying regional endpoints when creating the service +# client as shown in https://cloud.google.com/ruby/docs/reference. +# +# This is an auto-generated example demonstrating basic usage of +# Google::Cloud::Retail::V2::ProductService::Client#delete_product. +# +def delete_product + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Retail::V2::ProductService::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Retail::V2::DeleteProductRequest.new + + # Call the delete_product method. + result = client.delete_product request + + # The returned object is of type Google::Protobuf::Empty. + p result +end +# [END retail_v2_generated_ProductService_DeleteProduct_sync] diff --git a/owl-bot-staging/google-cloud-retail-v2/snippets/product_service/get_product.rb b/owl-bot-staging/google-cloud-retail-v2/snippets/product_service/get_product.rb new file mode 100644 index 000000000000..72fa221658aa --- /dev/null +++ b/owl-bot-staging/google-cloud-retail-v2/snippets/product_service/get_product.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 retail_v2_generated_ProductService_GetProduct_sync] +require "google/cloud/retail/v2" + +## +# Snippet for the get_product call in the ProductService service +# +# This snippet has been automatically generated and should be regarded as a code +# template only. It will require modifications to work: +# - It may require correct/in-range values for request initialization. +# - It may require specifying regional endpoints when creating the service +# client as shown in https://cloud.google.com/ruby/docs/reference. +# +# This is an auto-generated example demonstrating basic usage of +# Google::Cloud::Retail::V2::ProductService::Client#get_product. +# +def get_product + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Retail::V2::ProductService::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Retail::V2::GetProductRequest.new + + # Call the get_product method. + result = client.get_product request + + # The returned object is of type Google::Cloud::Retail::V2::Product. + p result +end +# [END retail_v2_generated_ProductService_GetProduct_sync] diff --git a/owl-bot-staging/google-cloud-retail-v2/snippets/product_service/import_products.rb b/owl-bot-staging/google-cloud-retail-v2/snippets/product_service/import_products.rb new file mode 100644 index 000000000000..1db99c203a0e --- /dev/null +++ b/owl-bot-staging/google-cloud-retail-v2/snippets/product_service/import_products.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 retail_v2_generated_ProductService_ImportProducts_sync] +require "google/cloud/retail/v2" + +## +# Snippet for the import_products call in the ProductService service +# +# This snippet has been automatically generated and should be regarded as a code +# template only. It will require modifications to work: +# - It may require correct/in-range values for request initialization. +# - It may require specifying regional endpoints when creating the service +# client as shown in https://cloud.google.com/ruby/docs/reference. +# +# This is an auto-generated example demonstrating basic usage of +# Google::Cloud::Retail::V2::ProductService::Client#import_products. +# +def import_products + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Retail::V2::ProductService::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Retail::V2::ImportProductsRequest.new + + # Call the import_products method. + result = client.import_products 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 retail_v2_generated_ProductService_ImportProducts_sync] diff --git a/owl-bot-staging/google-cloud-retail-v2/snippets/product_service/list_products.rb b/owl-bot-staging/google-cloud-retail-v2/snippets/product_service/list_products.rb new file mode 100644 index 000000000000..3c55a501794a --- /dev/null +++ b/owl-bot-staging/google-cloud-retail-v2/snippets/product_service/list_products.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 retail_v2_generated_ProductService_ListProducts_sync] +require "google/cloud/retail/v2" + +## +# Snippet for the list_products call in the ProductService service +# +# This snippet has been automatically generated and should be regarded as a code +# template only. It will require modifications to work: +# - It may require correct/in-range values for request initialization. +# - It may require specifying regional endpoints when creating the service +# client as shown in https://cloud.google.com/ruby/docs/reference. +# +# This is an auto-generated example demonstrating basic usage of +# Google::Cloud::Retail::V2::ProductService::Client#list_products. +# +def list_products + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Retail::V2::ProductService::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Retail::V2::ListProductsRequest.new + + # Call the list_products method. + result = client.list_products request + + # The returned object is of type Gapic::PagedEnumerable. You can iterate + # over elements, and API calls will be issued to fetch pages as needed. + result.each do |item| + # Each element is of type ::Google::Cloud::Retail::V2::Product. + p item + end +end +# [END retail_v2_generated_ProductService_ListProducts_sync] diff --git a/owl-bot-staging/google-cloud-retail-v2/snippets/product_service/purge_products.rb b/owl-bot-staging/google-cloud-retail-v2/snippets/product_service/purge_products.rb new file mode 100644 index 000000000000..6ba93cc5c41b --- /dev/null +++ b/owl-bot-staging/google-cloud-retail-v2/snippets/product_service/purge_products.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 retail_v2_generated_ProductService_PurgeProducts_sync] +require "google/cloud/retail/v2" + +## +# Snippet for the purge_products call in the ProductService service +# +# This snippet has been automatically generated and should be regarded as a code +# template only. It will require modifications to work: +# - It may require correct/in-range values for request initialization. +# - It may require specifying regional endpoints when creating the service +# client as shown in https://cloud.google.com/ruby/docs/reference. +# +# This is an auto-generated example demonstrating basic usage of +# Google::Cloud::Retail::V2::ProductService::Client#purge_products. +# +def purge_products + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Retail::V2::ProductService::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Retail::V2::PurgeProductsRequest.new + + # Call the purge_products method. + result = client.purge_products 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 retail_v2_generated_ProductService_PurgeProducts_sync] diff --git a/owl-bot-staging/google-cloud-retail-v2/snippets/product_service/remove_fulfillment_places.rb b/owl-bot-staging/google-cloud-retail-v2/snippets/product_service/remove_fulfillment_places.rb new file mode 100644 index 000000000000..7e48ed058cec --- /dev/null +++ b/owl-bot-staging/google-cloud-retail-v2/snippets/product_service/remove_fulfillment_places.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 retail_v2_generated_ProductService_RemoveFulfillmentPlaces_sync] +require "google/cloud/retail/v2" + +## +# Snippet for the remove_fulfillment_places call in the ProductService service +# +# This snippet has been automatically generated and should be regarded as a code +# template only. It will require modifications to work: +# - It may require correct/in-range values for request initialization. +# - It may require specifying regional endpoints when creating the service +# client as shown in https://cloud.google.com/ruby/docs/reference. +# +# This is an auto-generated example demonstrating basic usage of +# Google::Cloud::Retail::V2::ProductService::Client#remove_fulfillment_places. +# +def remove_fulfillment_places + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Retail::V2::ProductService::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Retail::V2::RemoveFulfillmentPlacesRequest.new + + # Call the remove_fulfillment_places method. + result = client.remove_fulfillment_places 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 retail_v2_generated_ProductService_RemoveFulfillmentPlaces_sync] diff --git a/owl-bot-staging/google-cloud-retail-v2/snippets/product_service/remove_local_inventories.rb b/owl-bot-staging/google-cloud-retail-v2/snippets/product_service/remove_local_inventories.rb new file mode 100644 index 000000000000..348089c03910 --- /dev/null +++ b/owl-bot-staging/google-cloud-retail-v2/snippets/product_service/remove_local_inventories.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 retail_v2_generated_ProductService_RemoveLocalInventories_sync] +require "google/cloud/retail/v2" + +## +# Snippet for the remove_local_inventories call in the ProductService service +# +# This snippet has been automatically generated and should be regarded as a code +# template only. It will require modifications to work: +# - It may require correct/in-range values for request initialization. +# - It may require specifying regional endpoints when creating the service +# client as shown in https://cloud.google.com/ruby/docs/reference. +# +# This is an auto-generated example demonstrating basic usage of +# Google::Cloud::Retail::V2::ProductService::Client#remove_local_inventories. +# +def remove_local_inventories + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Retail::V2::ProductService::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Retail::V2::RemoveLocalInventoriesRequest.new + + # Call the remove_local_inventories method. + result = client.remove_local_inventories 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 retail_v2_generated_ProductService_RemoveLocalInventories_sync] diff --git a/owl-bot-staging/google-cloud-retail-v2/snippets/product_service/set_inventory.rb b/owl-bot-staging/google-cloud-retail-v2/snippets/product_service/set_inventory.rb new file mode 100644 index 000000000000..bae7bf9a57e5 --- /dev/null +++ b/owl-bot-staging/google-cloud-retail-v2/snippets/product_service/set_inventory.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 retail_v2_generated_ProductService_SetInventory_sync] +require "google/cloud/retail/v2" + +## +# Snippet for the set_inventory call in the ProductService service +# +# This snippet has been automatically generated and should be regarded as a code +# template only. It will require modifications to work: +# - It may require correct/in-range values for request initialization. +# - It may require specifying regional endpoints when creating the service +# client as shown in https://cloud.google.com/ruby/docs/reference. +# +# This is an auto-generated example demonstrating basic usage of +# Google::Cloud::Retail::V2::ProductService::Client#set_inventory. +# +def set_inventory + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Retail::V2::ProductService::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Retail::V2::SetInventoryRequest.new + + # Call the set_inventory method. + result = client.set_inventory 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 retail_v2_generated_ProductService_SetInventory_sync] diff --git a/owl-bot-staging/google-cloud-retail-v2/snippets/product_service/update_product.rb b/owl-bot-staging/google-cloud-retail-v2/snippets/product_service/update_product.rb new file mode 100644 index 000000000000..36642534fa9e --- /dev/null +++ b/owl-bot-staging/google-cloud-retail-v2/snippets/product_service/update_product.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 retail_v2_generated_ProductService_UpdateProduct_sync] +require "google/cloud/retail/v2" + +## +# Snippet for the update_product call in the ProductService service +# +# This snippet has been automatically generated and should be regarded as a code +# template only. It will require modifications to work: +# - It may require correct/in-range values for request initialization. +# - It may require specifying regional endpoints when creating the service +# client as shown in https://cloud.google.com/ruby/docs/reference. +# +# This is an auto-generated example demonstrating basic usage of +# Google::Cloud::Retail::V2::ProductService::Client#update_product. +# +def update_product + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Retail::V2::ProductService::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Retail::V2::UpdateProductRequest.new + + # Call the update_product method. + result = client.update_product request + + # The returned object is of type Google::Cloud::Retail::V2::Product. + p result +end +# [END retail_v2_generated_ProductService_UpdateProduct_sync] diff --git a/owl-bot-staging/google-cloud-retail-v2/snippets/search_service/search.rb b/owl-bot-staging/google-cloud-retail-v2/snippets/search_service/search.rb new file mode 100644 index 000000000000..5dc88c9cf583 --- /dev/null +++ b/owl-bot-staging/google-cloud-retail-v2/snippets/search_service/search.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 retail_v2_generated_SearchService_Search_sync] +require "google/cloud/retail/v2" + +## +# Snippet for the search call in the SearchService service +# +# This snippet has been automatically generated and should be regarded as a code +# template only. It will require modifications to work: +# - It may require correct/in-range values for request initialization. +# - It may require specifying regional endpoints when creating the service +# client as shown in https://cloud.google.com/ruby/docs/reference. +# +# This is an auto-generated example demonstrating basic usage of +# Google::Cloud::Retail::V2::SearchService::Client#search. +# +def search + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Retail::V2::SearchService::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Retail::V2::SearchRequest.new + + # Call the search method. + result = client.search request + + # The returned object is of type Gapic::PagedEnumerable. You can iterate + # over elements, and API calls will be issued to fetch pages as needed. + result.each do |item| + # Each element is of type ::Google::Cloud::Retail::V2::SearchResponse::SearchResult. + p item + end +end +# [END retail_v2_generated_SearchService_Search_sync] diff --git a/owl-bot-staging/google-cloud-retail-v2/snippets/serving_config_service/add_control.rb b/owl-bot-staging/google-cloud-retail-v2/snippets/serving_config_service/add_control.rb new file mode 100644 index 000000000000..220931b22733 --- /dev/null +++ b/owl-bot-staging/google-cloud-retail-v2/snippets/serving_config_service/add_control.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 retail_v2_generated_ServingConfigService_AddControl_sync] +require "google/cloud/retail/v2" + +## +# Snippet for the add_control call in the ServingConfigService service +# +# This snippet has been automatically generated and should be regarded as a code +# template only. It will require modifications to work: +# - It may require correct/in-range values for request initialization. +# - It may require specifying regional endpoints when creating the service +# client as shown in https://cloud.google.com/ruby/docs/reference. +# +# This is an auto-generated example demonstrating basic usage of +# Google::Cloud::Retail::V2::ServingConfigService::Client#add_control. +# +def add_control + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Retail::V2::ServingConfigService::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Retail::V2::AddControlRequest.new + + # Call the add_control method. + result = client.add_control request + + # The returned object is of type Google::Cloud::Retail::V2::ServingConfig. + p result +end +# [END retail_v2_generated_ServingConfigService_AddControl_sync] diff --git a/owl-bot-staging/google-cloud-retail-v2/snippets/serving_config_service/create_serving_config.rb b/owl-bot-staging/google-cloud-retail-v2/snippets/serving_config_service/create_serving_config.rb new file mode 100644 index 000000000000..83294bf46733 --- /dev/null +++ b/owl-bot-staging/google-cloud-retail-v2/snippets/serving_config_service/create_serving_config.rb @@ -0,0 +1,47 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +# [START retail_v2_generated_ServingConfigService_CreateServingConfig_sync] +require "google/cloud/retail/v2" + +## +# Snippet for the create_serving_config call in the ServingConfigService service +# +# This snippet has been automatically generated and should be regarded as a code +# template only. It will require modifications to work: +# - It may require correct/in-range values for request initialization. +# - It may require specifying regional endpoints when creating the service +# client as shown in https://cloud.google.com/ruby/docs/reference. +# +# This is an auto-generated example demonstrating basic usage of +# Google::Cloud::Retail::V2::ServingConfigService::Client#create_serving_config. +# +def create_serving_config + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Retail::V2::ServingConfigService::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Retail::V2::CreateServingConfigRequest.new + + # Call the create_serving_config method. + result = client.create_serving_config request + + # The returned object is of type Google::Cloud::Retail::V2::ServingConfig. + p result +end +# [END retail_v2_generated_ServingConfigService_CreateServingConfig_sync] diff --git a/owl-bot-staging/google-cloud-retail-v2/snippets/serving_config_service/delete_serving_config.rb b/owl-bot-staging/google-cloud-retail-v2/snippets/serving_config_service/delete_serving_config.rb new file mode 100644 index 000000000000..40f9a2606fca --- /dev/null +++ b/owl-bot-staging/google-cloud-retail-v2/snippets/serving_config_service/delete_serving_config.rb @@ -0,0 +1,47 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +# [START retail_v2_generated_ServingConfigService_DeleteServingConfig_sync] +require "google/cloud/retail/v2" + +## +# Snippet for the delete_serving_config call in the ServingConfigService service +# +# This snippet has been automatically generated and should be regarded as a code +# template only. It will require modifications to work: +# - It may require correct/in-range values for request initialization. +# - It may require specifying regional endpoints when creating the service +# client as shown in https://cloud.google.com/ruby/docs/reference. +# +# This is an auto-generated example demonstrating basic usage of +# Google::Cloud::Retail::V2::ServingConfigService::Client#delete_serving_config. +# +def delete_serving_config + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Retail::V2::ServingConfigService::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Retail::V2::DeleteServingConfigRequest.new + + # Call the delete_serving_config method. + result = client.delete_serving_config request + + # The returned object is of type Google::Protobuf::Empty. + p result +end +# [END retail_v2_generated_ServingConfigService_DeleteServingConfig_sync] diff --git a/owl-bot-staging/google-cloud-retail-v2/snippets/serving_config_service/get_serving_config.rb b/owl-bot-staging/google-cloud-retail-v2/snippets/serving_config_service/get_serving_config.rb new file mode 100644 index 000000000000..c2f3df505c5f --- /dev/null +++ b/owl-bot-staging/google-cloud-retail-v2/snippets/serving_config_service/get_serving_config.rb @@ -0,0 +1,47 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +# [START retail_v2_generated_ServingConfigService_GetServingConfig_sync] +require "google/cloud/retail/v2" + +## +# Snippet for the get_serving_config call in the ServingConfigService service +# +# This snippet has been automatically generated and should be regarded as a code +# template only. It will require modifications to work: +# - It may require correct/in-range values for request initialization. +# - It may require specifying regional endpoints when creating the service +# client as shown in https://cloud.google.com/ruby/docs/reference. +# +# This is an auto-generated example demonstrating basic usage of +# Google::Cloud::Retail::V2::ServingConfigService::Client#get_serving_config. +# +def get_serving_config + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Retail::V2::ServingConfigService::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Retail::V2::GetServingConfigRequest.new + + # Call the get_serving_config method. + result = client.get_serving_config request + + # The returned object is of type Google::Cloud::Retail::V2::ServingConfig. + p result +end +# [END retail_v2_generated_ServingConfigService_GetServingConfig_sync] diff --git a/owl-bot-staging/google-cloud-retail-v2/snippets/serving_config_service/list_serving_configs.rb b/owl-bot-staging/google-cloud-retail-v2/snippets/serving_config_service/list_serving_configs.rb new file mode 100644 index 000000000000..1c0c7dcdf923 --- /dev/null +++ b/owl-bot-staging/google-cloud-retail-v2/snippets/serving_config_service/list_serving_configs.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 retail_v2_generated_ServingConfigService_ListServingConfigs_sync] +require "google/cloud/retail/v2" + +## +# Snippet for the list_serving_configs call in the ServingConfigService service +# +# This snippet has been automatically generated and should be regarded as a code +# template only. It will require modifications to work: +# - It may require correct/in-range values for request initialization. +# - It may require specifying regional endpoints when creating the service +# client as shown in https://cloud.google.com/ruby/docs/reference. +# +# This is an auto-generated example demonstrating basic usage of +# Google::Cloud::Retail::V2::ServingConfigService::Client#list_serving_configs. +# +def list_serving_configs + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Retail::V2::ServingConfigService::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Retail::V2::ListServingConfigsRequest.new + + # Call the list_serving_configs method. + result = client.list_serving_configs request + + # The returned object is of type Gapic::PagedEnumerable. You can iterate + # over elements, and API calls will be issued to fetch pages as needed. + result.each do |item| + # Each element is of type ::Google::Cloud::Retail::V2::ServingConfig. + p item + end +end +# [END retail_v2_generated_ServingConfigService_ListServingConfigs_sync] diff --git a/owl-bot-staging/google-cloud-retail-v2/snippets/serving_config_service/remove_control.rb b/owl-bot-staging/google-cloud-retail-v2/snippets/serving_config_service/remove_control.rb new file mode 100644 index 000000000000..7917bea15485 --- /dev/null +++ b/owl-bot-staging/google-cloud-retail-v2/snippets/serving_config_service/remove_control.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 retail_v2_generated_ServingConfigService_RemoveControl_sync] +require "google/cloud/retail/v2" + +## +# Snippet for the remove_control call in the ServingConfigService service +# +# This snippet has been automatically generated and should be regarded as a code +# template only. It will require modifications to work: +# - It may require correct/in-range values for request initialization. +# - It may require specifying regional endpoints when creating the service +# client as shown in https://cloud.google.com/ruby/docs/reference. +# +# This is an auto-generated example demonstrating basic usage of +# Google::Cloud::Retail::V2::ServingConfigService::Client#remove_control. +# +def remove_control + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Retail::V2::ServingConfigService::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Retail::V2::RemoveControlRequest.new + + # Call the remove_control method. + result = client.remove_control request + + # The returned object is of type Google::Cloud::Retail::V2::ServingConfig. + p result +end +# [END retail_v2_generated_ServingConfigService_RemoveControl_sync] diff --git a/owl-bot-staging/google-cloud-retail-v2/snippets/serving_config_service/update_serving_config.rb b/owl-bot-staging/google-cloud-retail-v2/snippets/serving_config_service/update_serving_config.rb new file mode 100644 index 000000000000..669a5bd2a303 --- /dev/null +++ b/owl-bot-staging/google-cloud-retail-v2/snippets/serving_config_service/update_serving_config.rb @@ -0,0 +1,47 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +# [START retail_v2_generated_ServingConfigService_UpdateServingConfig_sync] +require "google/cloud/retail/v2" + +## +# Snippet for the update_serving_config call in the ServingConfigService service +# +# This snippet has been automatically generated and should be regarded as a code +# template only. It will require modifications to work: +# - It may require correct/in-range values for request initialization. +# - It may require specifying regional endpoints when creating the service +# client as shown in https://cloud.google.com/ruby/docs/reference. +# +# This is an auto-generated example demonstrating basic usage of +# Google::Cloud::Retail::V2::ServingConfigService::Client#update_serving_config. +# +def update_serving_config + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Retail::V2::ServingConfigService::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Retail::V2::UpdateServingConfigRequest.new + + # Call the update_serving_config method. + result = client.update_serving_config request + + # The returned object is of type Google::Cloud::Retail::V2::ServingConfig. + p result +end +# [END retail_v2_generated_ServingConfigService_UpdateServingConfig_sync] diff --git a/owl-bot-staging/google-cloud-retail-v2/snippets/snippet_metadata_google.cloud.retail.v2.json b/owl-bot-staging/google-cloud-retail-v2/snippets/snippet_metadata_google.cloud.retail.v2.json new file mode 100644 index 000000000000..3903e19ad375 --- /dev/null +++ b/owl-bot-staging/google-cloud-retail-v2/snippets/snippet_metadata_google.cloud.retail.v2.json @@ -0,0 +1,2375 @@ +{ + "client_library": { + "name": "google-cloud-retail-v2", + "version": "", + "language": "RUBY", + "apis": [ + { + "id": "google.cloud.retail.v2", + "version": "v2" + } + ] + }, + "snippets": [ + { + "region_tag": "retail_v2_generated_AnalyticsService_ExportAnalyticsMetrics_sync", + "title": "Snippet for the export_analytics_metrics call in the AnalyticsService service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Retail::V2::AnalyticsService::Client#export_analytics_metrics.", + "file": "analytics_service/export_analytics_metrics.rb", + "language": "RUBY", + "client_method": { + "short_name": "export_analytics_metrics", + "full_name": "::Google::Cloud::Retail::V2::AnalyticsService::Client#export_analytics_metrics", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::Retail::V2::ExportAnalyticsMetricsRequest", + "name": "request" + } + ], + "result_type": "::Google::Longrunning::Operation", + "client": { + "short_name": "AnalyticsService::Client", + "full_name": "::Google::Cloud::Retail::V2::AnalyticsService::Client" + }, + "method": { + "short_name": "ExportAnalyticsMetrics", + "full_name": "google.cloud.retail.v2.AnalyticsService.ExportAnalyticsMetrics", + "service": { + "short_name": "AnalyticsService", + "full_name": "google.cloud.retail.v2.AnalyticsService" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 53, + "type": "FULL" + } + ] + }, + { + "region_tag": "retail_v2_generated_CatalogService_ListCatalogs_sync", + "title": "Snippet for the list_catalogs call in the CatalogService service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Retail::V2::CatalogService::Client#list_catalogs.", + "file": "catalog_service/list_catalogs.rb", + "language": "RUBY", + "client_method": { + "short_name": "list_catalogs", + "full_name": "::Google::Cloud::Retail::V2::CatalogService::Client#list_catalogs", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::Retail::V2::ListCatalogsRequest", + "name": "request" + } + ], + "result_type": "::Google::Cloud::Retail::V2::ListCatalogsResponse", + "client": { + "short_name": "CatalogService::Client", + "full_name": "::Google::Cloud::Retail::V2::CatalogService::Client" + }, + "method": { + "short_name": "ListCatalogs", + "full_name": "google.cloud.retail.v2.CatalogService.ListCatalogs", + "service": { + "short_name": "CatalogService", + "full_name": "google.cloud.retail.v2.CatalogService" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 50, + "type": "FULL" + } + ] + }, + { + "region_tag": "retail_v2_generated_CatalogService_UpdateCatalog_sync", + "title": "Snippet for the update_catalog call in the CatalogService service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Retail::V2::CatalogService::Client#update_catalog.", + "file": "catalog_service/update_catalog.rb", + "language": "RUBY", + "client_method": { + "short_name": "update_catalog", + "full_name": "::Google::Cloud::Retail::V2::CatalogService::Client#update_catalog", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::Retail::V2::UpdateCatalogRequest", + "name": "request" + } + ], + "result_type": "::Google::Cloud::Retail::V2::Catalog", + "client": { + "short_name": "CatalogService::Client", + "full_name": "::Google::Cloud::Retail::V2::CatalogService::Client" + }, + "method": { + "short_name": "UpdateCatalog", + "full_name": "google.cloud.retail.v2.CatalogService.UpdateCatalog", + "service": { + "short_name": "CatalogService", + "full_name": "google.cloud.retail.v2.CatalogService" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 46, + "type": "FULL" + } + ] + }, + { + "region_tag": "retail_v2_generated_CatalogService_SetDefaultBranch_sync", + "title": "Snippet for the set_default_branch call in the CatalogService service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Retail::V2::CatalogService::Client#set_default_branch.", + "file": "catalog_service/set_default_branch.rb", + "language": "RUBY", + "client_method": { + "short_name": "set_default_branch", + "full_name": "::Google::Cloud::Retail::V2::CatalogService::Client#set_default_branch", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::Retail::V2::SetDefaultBranchRequest", + "name": "request" + } + ], + "result_type": "::Google::Protobuf::Empty", + "client": { + "short_name": "CatalogService::Client", + "full_name": "::Google::Cloud::Retail::V2::CatalogService::Client" + }, + "method": { + "short_name": "SetDefaultBranch", + "full_name": "google.cloud.retail.v2.CatalogService.SetDefaultBranch", + "service": { + "short_name": "CatalogService", + "full_name": "google.cloud.retail.v2.CatalogService" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 46, + "type": "FULL" + } + ] + }, + { + "region_tag": "retail_v2_generated_CatalogService_GetDefaultBranch_sync", + "title": "Snippet for the get_default_branch call in the CatalogService service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Retail::V2::CatalogService::Client#get_default_branch.", + "file": "catalog_service/get_default_branch.rb", + "language": "RUBY", + "client_method": { + "short_name": "get_default_branch", + "full_name": "::Google::Cloud::Retail::V2::CatalogService::Client#get_default_branch", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::Retail::V2::GetDefaultBranchRequest", + "name": "request" + } + ], + "result_type": "::Google::Cloud::Retail::V2::GetDefaultBranchResponse", + "client": { + "short_name": "CatalogService::Client", + "full_name": "::Google::Cloud::Retail::V2::CatalogService::Client" + }, + "method": { + "short_name": "GetDefaultBranch", + "full_name": "google.cloud.retail.v2.CatalogService.GetDefaultBranch", + "service": { + "short_name": "CatalogService", + "full_name": "google.cloud.retail.v2.CatalogService" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 46, + "type": "FULL" + } + ] + }, + { + "region_tag": "retail_v2_generated_CatalogService_GetCompletionConfig_sync", + "title": "Snippet for the get_completion_config call in the CatalogService service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Retail::V2::CatalogService::Client#get_completion_config.", + "file": "catalog_service/get_completion_config.rb", + "language": "RUBY", + "client_method": { + "short_name": "get_completion_config", + "full_name": "::Google::Cloud::Retail::V2::CatalogService::Client#get_completion_config", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::Retail::V2::GetCompletionConfigRequest", + "name": "request" + } + ], + "result_type": "::Google::Cloud::Retail::V2::CompletionConfig", + "client": { + "short_name": "CatalogService::Client", + "full_name": "::Google::Cloud::Retail::V2::CatalogService::Client" + }, + "method": { + "short_name": "GetCompletionConfig", + "full_name": "google.cloud.retail.v2.CatalogService.GetCompletionConfig", + "service": { + "short_name": "CatalogService", + "full_name": "google.cloud.retail.v2.CatalogService" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 46, + "type": "FULL" + } + ] + }, + { + "region_tag": "retail_v2_generated_CatalogService_UpdateCompletionConfig_sync", + "title": "Snippet for the update_completion_config call in the CatalogService service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Retail::V2::CatalogService::Client#update_completion_config.", + "file": "catalog_service/update_completion_config.rb", + "language": "RUBY", + "client_method": { + "short_name": "update_completion_config", + "full_name": "::Google::Cloud::Retail::V2::CatalogService::Client#update_completion_config", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::Retail::V2::UpdateCompletionConfigRequest", + "name": "request" + } + ], + "result_type": "::Google::Cloud::Retail::V2::CompletionConfig", + "client": { + "short_name": "CatalogService::Client", + "full_name": "::Google::Cloud::Retail::V2::CatalogService::Client" + }, + "method": { + "short_name": "UpdateCompletionConfig", + "full_name": "google.cloud.retail.v2.CatalogService.UpdateCompletionConfig", + "service": { + "short_name": "CatalogService", + "full_name": "google.cloud.retail.v2.CatalogService" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 46, + "type": "FULL" + } + ] + }, + { + "region_tag": "retail_v2_generated_CatalogService_GetAttributesConfig_sync", + "title": "Snippet for the get_attributes_config call in the CatalogService service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Retail::V2::CatalogService::Client#get_attributes_config.", + "file": "catalog_service/get_attributes_config.rb", + "language": "RUBY", + "client_method": { + "short_name": "get_attributes_config", + "full_name": "::Google::Cloud::Retail::V2::CatalogService::Client#get_attributes_config", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::Retail::V2::GetAttributesConfigRequest", + "name": "request" + } + ], + "result_type": "::Google::Cloud::Retail::V2::AttributesConfig", + "client": { + "short_name": "CatalogService::Client", + "full_name": "::Google::Cloud::Retail::V2::CatalogService::Client" + }, + "method": { + "short_name": "GetAttributesConfig", + "full_name": "google.cloud.retail.v2.CatalogService.GetAttributesConfig", + "service": { + "short_name": "CatalogService", + "full_name": "google.cloud.retail.v2.CatalogService" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 46, + "type": "FULL" + } + ] + }, + { + "region_tag": "retail_v2_generated_CatalogService_UpdateAttributesConfig_sync", + "title": "Snippet for the update_attributes_config call in the CatalogService service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Retail::V2::CatalogService::Client#update_attributes_config.", + "file": "catalog_service/update_attributes_config.rb", + "language": "RUBY", + "client_method": { + "short_name": "update_attributes_config", + "full_name": "::Google::Cloud::Retail::V2::CatalogService::Client#update_attributes_config", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::Retail::V2::UpdateAttributesConfigRequest", + "name": "request" + } + ], + "result_type": "::Google::Cloud::Retail::V2::AttributesConfig", + "client": { + "short_name": "CatalogService::Client", + "full_name": "::Google::Cloud::Retail::V2::CatalogService::Client" + }, + "method": { + "short_name": "UpdateAttributesConfig", + "full_name": "google.cloud.retail.v2.CatalogService.UpdateAttributesConfig", + "service": { + "short_name": "CatalogService", + "full_name": "google.cloud.retail.v2.CatalogService" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 46, + "type": "FULL" + } + ] + }, + { + "region_tag": "retail_v2_generated_CatalogService_AddCatalogAttribute_sync", + "title": "Snippet for the add_catalog_attribute call in the CatalogService service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Retail::V2::CatalogService::Client#add_catalog_attribute.", + "file": "catalog_service/add_catalog_attribute.rb", + "language": "RUBY", + "client_method": { + "short_name": "add_catalog_attribute", + "full_name": "::Google::Cloud::Retail::V2::CatalogService::Client#add_catalog_attribute", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::Retail::V2::AddCatalogAttributeRequest", + "name": "request" + } + ], + "result_type": "::Google::Cloud::Retail::V2::AttributesConfig", + "client": { + "short_name": "CatalogService::Client", + "full_name": "::Google::Cloud::Retail::V2::CatalogService::Client" + }, + "method": { + "short_name": "AddCatalogAttribute", + "full_name": "google.cloud.retail.v2.CatalogService.AddCatalogAttribute", + "service": { + "short_name": "CatalogService", + "full_name": "google.cloud.retail.v2.CatalogService" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 46, + "type": "FULL" + } + ] + }, + { + "region_tag": "retail_v2_generated_CatalogService_RemoveCatalogAttribute_sync", + "title": "Snippet for the remove_catalog_attribute call in the CatalogService service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Retail::V2::CatalogService::Client#remove_catalog_attribute.", + "file": "catalog_service/remove_catalog_attribute.rb", + "language": "RUBY", + "client_method": { + "short_name": "remove_catalog_attribute", + "full_name": "::Google::Cloud::Retail::V2::CatalogService::Client#remove_catalog_attribute", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::Retail::V2::RemoveCatalogAttributeRequest", + "name": "request" + } + ], + "result_type": "::Google::Cloud::Retail::V2::AttributesConfig", + "client": { + "short_name": "CatalogService::Client", + "full_name": "::Google::Cloud::Retail::V2::CatalogService::Client" + }, + "method": { + "short_name": "RemoveCatalogAttribute", + "full_name": "google.cloud.retail.v2.CatalogService.RemoveCatalogAttribute", + "service": { + "short_name": "CatalogService", + "full_name": "google.cloud.retail.v2.CatalogService" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 46, + "type": "FULL" + } + ] + }, + { + "region_tag": "retail_v2_generated_CatalogService_ReplaceCatalogAttribute_sync", + "title": "Snippet for the replace_catalog_attribute call in the CatalogService service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Retail::V2::CatalogService::Client#replace_catalog_attribute.", + "file": "catalog_service/replace_catalog_attribute.rb", + "language": "RUBY", + "client_method": { + "short_name": "replace_catalog_attribute", + "full_name": "::Google::Cloud::Retail::V2::CatalogService::Client#replace_catalog_attribute", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::Retail::V2::ReplaceCatalogAttributeRequest", + "name": "request" + } + ], + "result_type": "::Google::Cloud::Retail::V2::AttributesConfig", + "client": { + "short_name": "CatalogService::Client", + "full_name": "::Google::Cloud::Retail::V2::CatalogService::Client" + }, + "method": { + "short_name": "ReplaceCatalogAttribute", + "full_name": "google.cloud.retail.v2.CatalogService.ReplaceCatalogAttribute", + "service": { + "short_name": "CatalogService", + "full_name": "google.cloud.retail.v2.CatalogService" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 46, + "type": "FULL" + } + ] + }, + { + "region_tag": "retail_v2_generated_CompletionService_CompleteQuery_sync", + "title": "Snippet for the complete_query call in the CompletionService service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Retail::V2::CompletionService::Client#complete_query.", + "file": "completion_service/complete_query.rb", + "language": "RUBY", + "client_method": { + "short_name": "complete_query", + "full_name": "::Google::Cloud::Retail::V2::CompletionService::Client#complete_query", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::Retail::V2::CompleteQueryRequest", + "name": "request" + } + ], + "result_type": "::Google::Cloud::Retail::V2::CompleteQueryResponse", + "client": { + "short_name": "CompletionService::Client", + "full_name": "::Google::Cloud::Retail::V2::CompletionService::Client" + }, + "method": { + "short_name": "CompleteQuery", + "full_name": "google.cloud.retail.v2.CompletionService.CompleteQuery", + "service": { + "short_name": "CompletionService", + "full_name": "google.cloud.retail.v2.CompletionService" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 46, + "type": "FULL" + } + ] + }, + { + "region_tag": "retail_v2_generated_CompletionService_ImportCompletionData_sync", + "title": "Snippet for the import_completion_data call in the CompletionService service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Retail::V2::CompletionService::Client#import_completion_data.", + "file": "completion_service/import_completion_data.rb", + "language": "RUBY", + "client_method": { + "short_name": "import_completion_data", + "full_name": "::Google::Cloud::Retail::V2::CompletionService::Client#import_completion_data", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::Retail::V2::ImportCompletionDataRequest", + "name": "request" + } + ], + "result_type": "::Google::Longrunning::Operation", + "client": { + "short_name": "CompletionService::Client", + "full_name": "::Google::Cloud::Retail::V2::CompletionService::Client" + }, + "method": { + "short_name": "ImportCompletionData", + "full_name": "google.cloud.retail.v2.CompletionService.ImportCompletionData", + "service": { + "short_name": "CompletionService", + "full_name": "google.cloud.retail.v2.CompletionService" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 53, + "type": "FULL" + } + ] + }, + { + "region_tag": "retail_v2_generated_ControlService_CreateControl_sync", + "title": "Snippet for the create_control call in the ControlService service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Retail::V2::ControlService::Client#create_control.", + "file": "control_service/create_control.rb", + "language": "RUBY", + "client_method": { + "short_name": "create_control", + "full_name": "::Google::Cloud::Retail::V2::ControlService::Client#create_control", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::Retail::V2::CreateControlRequest", + "name": "request" + } + ], + "result_type": "::Google::Cloud::Retail::V2::Control", + "client": { + "short_name": "ControlService::Client", + "full_name": "::Google::Cloud::Retail::V2::ControlService::Client" + }, + "method": { + "short_name": "CreateControl", + "full_name": "google.cloud.retail.v2.ControlService.CreateControl", + "service": { + "short_name": "ControlService", + "full_name": "google.cloud.retail.v2.ControlService" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 46, + "type": "FULL" + } + ] + }, + { + "region_tag": "retail_v2_generated_ControlService_DeleteControl_sync", + "title": "Snippet for the delete_control call in the ControlService service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Retail::V2::ControlService::Client#delete_control.", + "file": "control_service/delete_control.rb", + "language": "RUBY", + "client_method": { + "short_name": "delete_control", + "full_name": "::Google::Cloud::Retail::V2::ControlService::Client#delete_control", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::Retail::V2::DeleteControlRequest", + "name": "request" + } + ], + "result_type": "::Google::Protobuf::Empty", + "client": { + "short_name": "ControlService::Client", + "full_name": "::Google::Cloud::Retail::V2::ControlService::Client" + }, + "method": { + "short_name": "DeleteControl", + "full_name": "google.cloud.retail.v2.ControlService.DeleteControl", + "service": { + "short_name": "ControlService", + "full_name": "google.cloud.retail.v2.ControlService" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 46, + "type": "FULL" + } + ] + }, + { + "region_tag": "retail_v2_generated_ControlService_UpdateControl_sync", + "title": "Snippet for the update_control call in the ControlService service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Retail::V2::ControlService::Client#update_control.", + "file": "control_service/update_control.rb", + "language": "RUBY", + "client_method": { + "short_name": "update_control", + "full_name": "::Google::Cloud::Retail::V2::ControlService::Client#update_control", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::Retail::V2::UpdateControlRequest", + "name": "request" + } + ], + "result_type": "::Google::Cloud::Retail::V2::Control", + "client": { + "short_name": "ControlService::Client", + "full_name": "::Google::Cloud::Retail::V2::ControlService::Client" + }, + "method": { + "short_name": "UpdateControl", + "full_name": "google.cloud.retail.v2.ControlService.UpdateControl", + "service": { + "short_name": "ControlService", + "full_name": "google.cloud.retail.v2.ControlService" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 46, + "type": "FULL" + } + ] + }, + { + "region_tag": "retail_v2_generated_ControlService_GetControl_sync", + "title": "Snippet for the get_control call in the ControlService service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Retail::V2::ControlService::Client#get_control.", + "file": "control_service/get_control.rb", + "language": "RUBY", + "client_method": { + "short_name": "get_control", + "full_name": "::Google::Cloud::Retail::V2::ControlService::Client#get_control", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::Retail::V2::GetControlRequest", + "name": "request" + } + ], + "result_type": "::Google::Cloud::Retail::V2::Control", + "client": { + "short_name": "ControlService::Client", + "full_name": "::Google::Cloud::Retail::V2::ControlService::Client" + }, + "method": { + "short_name": "GetControl", + "full_name": "google.cloud.retail.v2.ControlService.GetControl", + "service": { + "short_name": "ControlService", + "full_name": "google.cloud.retail.v2.ControlService" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 46, + "type": "FULL" + } + ] + }, + { + "region_tag": "retail_v2_generated_ControlService_ListControls_sync", + "title": "Snippet for the list_controls call in the ControlService service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Retail::V2::ControlService::Client#list_controls.", + "file": "control_service/list_controls.rb", + "language": "RUBY", + "client_method": { + "short_name": "list_controls", + "full_name": "::Google::Cloud::Retail::V2::ControlService::Client#list_controls", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::Retail::V2::ListControlsRequest", + "name": "request" + } + ], + "result_type": "::Google::Cloud::Retail::V2::ListControlsResponse", + "client": { + "short_name": "ControlService::Client", + "full_name": "::Google::Cloud::Retail::V2::ControlService::Client" + }, + "method": { + "short_name": "ListControls", + "full_name": "google.cloud.retail.v2.ControlService.ListControls", + "service": { + "short_name": "ControlService", + "full_name": "google.cloud.retail.v2.ControlService" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 50, + "type": "FULL" + } + ] + }, + { + "region_tag": "retail_v2_generated_SearchService_Search_sync", + "title": "Snippet for the search call in the SearchService service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Retail::V2::SearchService::Client#search.", + "file": "search_service/search.rb", + "language": "RUBY", + "client_method": { + "short_name": "search", + "full_name": "::Google::Cloud::Retail::V2::SearchService::Client#search", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::Retail::V2::SearchRequest", + "name": "request" + } + ], + "result_type": "::Google::Cloud::Retail::V2::SearchResponse", + "client": { + "short_name": "SearchService::Client", + "full_name": "::Google::Cloud::Retail::V2::SearchService::Client" + }, + "method": { + "short_name": "Search", + "full_name": "google.cloud.retail.v2.SearchService.Search", + "service": { + "short_name": "SearchService", + "full_name": "google.cloud.retail.v2.SearchService" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 50, + "type": "FULL" + } + ] + }, + { + "region_tag": "retail_v2_generated_ConversationalSearchService_ConversationalSearch_sync", + "title": "Snippet for the conversational_search call in the ConversationalSearchService service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Retail::V2::ConversationalSearchService::Client#conversational_search.", + "file": "conversational_search_service/conversational_search.rb", + "language": "RUBY", + "client_method": { + "short_name": "conversational_search", + "full_name": "::Google::Cloud::Retail::V2::ConversationalSearchService::Client#conversational_search", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::Retail::V2::ConversationalSearchRequest", + "name": "request" + } + ], + "result_type": "::Google::Cloud::Retail::V2::ConversationalSearchResponse", + "client": { + "short_name": "ConversationalSearchService::Client", + "full_name": "::Google::Cloud::Retail::V2::ConversationalSearchService::Client" + }, + "method": { + "short_name": "ConversationalSearch", + "full_name": "google.cloud.retail.v2.ConversationalSearchService.ConversationalSearch", + "service": { + "short_name": "ConversationalSearchService", + "full_name": "google.cloud.retail.v2.ConversationalSearchService" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 49, + "type": "FULL" + } + ] + }, + { + "region_tag": "retail_v2_generated_GenerativeQuestionService_UpdateGenerativeQuestionsFeatureConfig_sync", + "title": "Snippet for the update_generative_questions_feature_config call in the GenerativeQuestionService service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Retail::V2::GenerativeQuestionService::Client#update_generative_questions_feature_config.", + "file": "generative_question_service/update_generative_questions_feature_config.rb", + "language": "RUBY", + "client_method": { + "short_name": "update_generative_questions_feature_config", + "full_name": "::Google::Cloud::Retail::V2::GenerativeQuestionService::Client#update_generative_questions_feature_config", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::Retail::V2::UpdateGenerativeQuestionsFeatureConfigRequest", + "name": "request" + } + ], + "result_type": "::Google::Cloud::Retail::V2::GenerativeQuestionsFeatureConfig", + "client": { + "short_name": "GenerativeQuestionService::Client", + "full_name": "::Google::Cloud::Retail::V2::GenerativeQuestionService::Client" + }, + "method": { + "short_name": "UpdateGenerativeQuestionsFeatureConfig", + "full_name": "google.cloud.retail.v2.GenerativeQuestionService.UpdateGenerativeQuestionsFeatureConfig", + "service": { + "short_name": "GenerativeQuestionService", + "full_name": "google.cloud.retail.v2.GenerativeQuestionService" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 46, + "type": "FULL" + } + ] + }, + { + "region_tag": "retail_v2_generated_GenerativeQuestionService_GetGenerativeQuestionsFeatureConfig_sync", + "title": "Snippet for the get_generative_questions_feature_config call in the GenerativeQuestionService service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Retail::V2::GenerativeQuestionService::Client#get_generative_questions_feature_config.", + "file": "generative_question_service/get_generative_questions_feature_config.rb", + "language": "RUBY", + "client_method": { + "short_name": "get_generative_questions_feature_config", + "full_name": "::Google::Cloud::Retail::V2::GenerativeQuestionService::Client#get_generative_questions_feature_config", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::Retail::V2::GetGenerativeQuestionsFeatureConfigRequest", + "name": "request" + } + ], + "result_type": "::Google::Cloud::Retail::V2::GenerativeQuestionsFeatureConfig", + "client": { + "short_name": "GenerativeQuestionService::Client", + "full_name": "::Google::Cloud::Retail::V2::GenerativeQuestionService::Client" + }, + "method": { + "short_name": "GetGenerativeQuestionsFeatureConfig", + "full_name": "google.cloud.retail.v2.GenerativeQuestionService.GetGenerativeQuestionsFeatureConfig", + "service": { + "short_name": "GenerativeQuestionService", + "full_name": "google.cloud.retail.v2.GenerativeQuestionService" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 46, + "type": "FULL" + } + ] + }, + { + "region_tag": "retail_v2_generated_GenerativeQuestionService_ListGenerativeQuestionConfigs_sync", + "title": "Snippet for the list_generative_question_configs call in the GenerativeQuestionService service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Retail::V2::GenerativeQuestionService::Client#list_generative_question_configs.", + "file": "generative_question_service/list_generative_question_configs.rb", + "language": "RUBY", + "client_method": { + "short_name": "list_generative_question_configs", + "full_name": "::Google::Cloud::Retail::V2::GenerativeQuestionService::Client#list_generative_question_configs", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::Retail::V2::ListGenerativeQuestionConfigsRequest", + "name": "request" + } + ], + "result_type": "::Google::Cloud::Retail::V2::ListGenerativeQuestionConfigsResponse", + "client": { + "short_name": "GenerativeQuestionService::Client", + "full_name": "::Google::Cloud::Retail::V2::GenerativeQuestionService::Client" + }, + "method": { + "short_name": "ListGenerativeQuestionConfigs", + "full_name": "google.cloud.retail.v2.GenerativeQuestionService.ListGenerativeQuestionConfigs", + "service": { + "short_name": "GenerativeQuestionService", + "full_name": "google.cloud.retail.v2.GenerativeQuestionService" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 46, + "type": "FULL" + } + ] + }, + { + "region_tag": "retail_v2_generated_GenerativeQuestionService_UpdateGenerativeQuestionConfig_sync", + "title": "Snippet for the update_generative_question_config call in the GenerativeQuestionService service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Retail::V2::GenerativeQuestionService::Client#update_generative_question_config.", + "file": "generative_question_service/update_generative_question_config.rb", + "language": "RUBY", + "client_method": { + "short_name": "update_generative_question_config", + "full_name": "::Google::Cloud::Retail::V2::GenerativeQuestionService::Client#update_generative_question_config", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::Retail::V2::UpdateGenerativeQuestionConfigRequest", + "name": "request" + } + ], + "result_type": "::Google::Cloud::Retail::V2::GenerativeQuestionConfig", + "client": { + "short_name": "GenerativeQuestionService::Client", + "full_name": "::Google::Cloud::Retail::V2::GenerativeQuestionService::Client" + }, + "method": { + "short_name": "UpdateGenerativeQuestionConfig", + "full_name": "google.cloud.retail.v2.GenerativeQuestionService.UpdateGenerativeQuestionConfig", + "service": { + "short_name": "GenerativeQuestionService", + "full_name": "google.cloud.retail.v2.GenerativeQuestionService" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 46, + "type": "FULL" + } + ] + }, + { + "region_tag": "retail_v2_generated_GenerativeQuestionService_BatchUpdateGenerativeQuestionConfigs_sync", + "title": "Snippet for the batch_update_generative_question_configs call in the GenerativeQuestionService service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Retail::V2::GenerativeQuestionService::Client#batch_update_generative_question_configs.", + "file": "generative_question_service/batch_update_generative_question_configs.rb", + "language": "RUBY", + "client_method": { + "short_name": "batch_update_generative_question_configs", + "full_name": "::Google::Cloud::Retail::V2::GenerativeQuestionService::Client#batch_update_generative_question_configs", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::Retail::V2::BatchUpdateGenerativeQuestionConfigsRequest", + "name": "request" + } + ], + "result_type": "::Google::Cloud::Retail::V2::BatchUpdateGenerativeQuestionConfigsResponse", + "client": { + "short_name": "GenerativeQuestionService::Client", + "full_name": "::Google::Cloud::Retail::V2::GenerativeQuestionService::Client" + }, + "method": { + "short_name": "BatchUpdateGenerativeQuestionConfigs", + "full_name": "google.cloud.retail.v2.GenerativeQuestionService.BatchUpdateGenerativeQuestionConfigs", + "service": { + "short_name": "GenerativeQuestionService", + "full_name": "google.cloud.retail.v2.GenerativeQuestionService" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 46, + "type": "FULL" + } + ] + }, + { + "region_tag": "retail_v2_generated_ModelService_CreateModel_sync", + "title": "Snippet for the create_model call in the ModelService service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Retail::V2::ModelService::Client#create_model.", + "file": "model_service/create_model.rb", + "language": "RUBY", + "client_method": { + "short_name": "create_model", + "full_name": "::Google::Cloud::Retail::V2::ModelService::Client#create_model", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::Retail::V2::CreateModelRequest", + "name": "request" + } + ], + "result_type": "::Google::Longrunning::Operation", + "client": { + "short_name": "ModelService::Client", + "full_name": "::Google::Cloud::Retail::V2::ModelService::Client" + }, + "method": { + "short_name": "CreateModel", + "full_name": "google.cloud.retail.v2.ModelService.CreateModel", + "service": { + "short_name": "ModelService", + "full_name": "google.cloud.retail.v2.ModelService" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 53, + "type": "FULL" + } + ] + }, + { + "region_tag": "retail_v2_generated_ModelService_GetModel_sync", + "title": "Snippet for the get_model call in the ModelService service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Retail::V2::ModelService::Client#get_model.", + "file": "model_service/get_model.rb", + "language": "RUBY", + "client_method": { + "short_name": "get_model", + "full_name": "::Google::Cloud::Retail::V2::ModelService::Client#get_model", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::Retail::V2::GetModelRequest", + "name": "request" + } + ], + "result_type": "::Google::Cloud::Retail::V2::Model", + "client": { + "short_name": "ModelService::Client", + "full_name": "::Google::Cloud::Retail::V2::ModelService::Client" + }, + "method": { + "short_name": "GetModel", + "full_name": "google.cloud.retail.v2.ModelService.GetModel", + "service": { + "short_name": "ModelService", + "full_name": "google.cloud.retail.v2.ModelService" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 46, + "type": "FULL" + } + ] + }, + { + "region_tag": "retail_v2_generated_ModelService_PauseModel_sync", + "title": "Snippet for the pause_model call in the ModelService service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Retail::V2::ModelService::Client#pause_model.", + "file": "model_service/pause_model.rb", + "language": "RUBY", + "client_method": { + "short_name": "pause_model", + "full_name": "::Google::Cloud::Retail::V2::ModelService::Client#pause_model", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::Retail::V2::PauseModelRequest", + "name": "request" + } + ], + "result_type": "::Google::Cloud::Retail::V2::Model", + "client": { + "short_name": "ModelService::Client", + "full_name": "::Google::Cloud::Retail::V2::ModelService::Client" + }, + "method": { + "short_name": "PauseModel", + "full_name": "google.cloud.retail.v2.ModelService.PauseModel", + "service": { + "short_name": "ModelService", + "full_name": "google.cloud.retail.v2.ModelService" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 46, + "type": "FULL" + } + ] + }, + { + "region_tag": "retail_v2_generated_ModelService_ResumeModel_sync", + "title": "Snippet for the resume_model call in the ModelService service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Retail::V2::ModelService::Client#resume_model.", + "file": "model_service/resume_model.rb", + "language": "RUBY", + "client_method": { + "short_name": "resume_model", + "full_name": "::Google::Cloud::Retail::V2::ModelService::Client#resume_model", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::Retail::V2::ResumeModelRequest", + "name": "request" + } + ], + "result_type": "::Google::Cloud::Retail::V2::Model", + "client": { + "short_name": "ModelService::Client", + "full_name": "::Google::Cloud::Retail::V2::ModelService::Client" + }, + "method": { + "short_name": "ResumeModel", + "full_name": "google.cloud.retail.v2.ModelService.ResumeModel", + "service": { + "short_name": "ModelService", + "full_name": "google.cloud.retail.v2.ModelService" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 46, + "type": "FULL" + } + ] + }, + { + "region_tag": "retail_v2_generated_ModelService_DeleteModel_sync", + "title": "Snippet for the delete_model call in the ModelService service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Retail::V2::ModelService::Client#delete_model.", + "file": "model_service/delete_model.rb", + "language": "RUBY", + "client_method": { + "short_name": "delete_model", + "full_name": "::Google::Cloud::Retail::V2::ModelService::Client#delete_model", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::Retail::V2::DeleteModelRequest", + "name": "request" + } + ], + "result_type": "::Google::Protobuf::Empty", + "client": { + "short_name": "ModelService::Client", + "full_name": "::Google::Cloud::Retail::V2::ModelService::Client" + }, + "method": { + "short_name": "DeleteModel", + "full_name": "google.cloud.retail.v2.ModelService.DeleteModel", + "service": { + "short_name": "ModelService", + "full_name": "google.cloud.retail.v2.ModelService" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 46, + "type": "FULL" + } + ] + }, + { + "region_tag": "retail_v2_generated_ModelService_ListModels_sync", + "title": "Snippet for the list_models call in the ModelService service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Retail::V2::ModelService::Client#list_models.", + "file": "model_service/list_models.rb", + "language": "RUBY", + "client_method": { + "short_name": "list_models", + "full_name": "::Google::Cloud::Retail::V2::ModelService::Client#list_models", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::Retail::V2::ListModelsRequest", + "name": "request" + } + ], + "result_type": "::Google::Cloud::Retail::V2::ListModelsResponse", + "client": { + "short_name": "ModelService::Client", + "full_name": "::Google::Cloud::Retail::V2::ModelService::Client" + }, + "method": { + "short_name": "ListModels", + "full_name": "google.cloud.retail.v2.ModelService.ListModels", + "service": { + "short_name": "ModelService", + "full_name": "google.cloud.retail.v2.ModelService" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 50, + "type": "FULL" + } + ] + }, + { + "region_tag": "retail_v2_generated_ModelService_UpdateModel_sync", + "title": "Snippet for the update_model call in the ModelService service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Retail::V2::ModelService::Client#update_model.", + "file": "model_service/update_model.rb", + "language": "RUBY", + "client_method": { + "short_name": "update_model", + "full_name": "::Google::Cloud::Retail::V2::ModelService::Client#update_model", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::Retail::V2::UpdateModelRequest", + "name": "request" + } + ], + "result_type": "::Google::Cloud::Retail::V2::Model", + "client": { + "short_name": "ModelService::Client", + "full_name": "::Google::Cloud::Retail::V2::ModelService::Client" + }, + "method": { + "short_name": "UpdateModel", + "full_name": "google.cloud.retail.v2.ModelService.UpdateModel", + "service": { + "short_name": "ModelService", + "full_name": "google.cloud.retail.v2.ModelService" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 46, + "type": "FULL" + } + ] + }, + { + "region_tag": "retail_v2_generated_ModelService_TuneModel_sync", + "title": "Snippet for the tune_model call in the ModelService service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Retail::V2::ModelService::Client#tune_model.", + "file": "model_service/tune_model.rb", + "language": "RUBY", + "client_method": { + "short_name": "tune_model", + "full_name": "::Google::Cloud::Retail::V2::ModelService::Client#tune_model", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::Retail::V2::TuneModelRequest", + "name": "request" + } + ], + "result_type": "::Google::Longrunning::Operation", + "client": { + "short_name": "ModelService::Client", + "full_name": "::Google::Cloud::Retail::V2::ModelService::Client" + }, + "method": { + "short_name": "TuneModel", + "full_name": "google.cloud.retail.v2.ModelService.TuneModel", + "service": { + "short_name": "ModelService", + "full_name": "google.cloud.retail.v2.ModelService" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 53, + "type": "FULL" + } + ] + }, + { + "region_tag": "retail_v2_generated_PredictionService_Predict_sync", + "title": "Snippet for the predict call in the PredictionService service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Retail::V2::PredictionService::Client#predict.", + "file": "prediction_service/predict.rb", + "language": "RUBY", + "client_method": { + "short_name": "predict", + "full_name": "::Google::Cloud::Retail::V2::PredictionService::Client#predict", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::Retail::V2::PredictRequest", + "name": "request" + } + ], + "result_type": "::Google::Cloud::Retail::V2::PredictResponse", + "client": { + "short_name": "PredictionService::Client", + "full_name": "::Google::Cloud::Retail::V2::PredictionService::Client" + }, + "method": { + "short_name": "Predict", + "full_name": "google.cloud.retail.v2.PredictionService.Predict", + "service": { + "short_name": "PredictionService", + "full_name": "google.cloud.retail.v2.PredictionService" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 46, + "type": "FULL" + } + ] + }, + { + "region_tag": "retail_v2_generated_ProductService_CreateProduct_sync", + "title": "Snippet for the create_product call in the ProductService service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Retail::V2::ProductService::Client#create_product.", + "file": "product_service/create_product.rb", + "language": "RUBY", + "client_method": { + "short_name": "create_product", + "full_name": "::Google::Cloud::Retail::V2::ProductService::Client#create_product", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::Retail::V2::CreateProductRequest", + "name": "request" + } + ], + "result_type": "::Google::Cloud::Retail::V2::Product", + "client": { + "short_name": "ProductService::Client", + "full_name": "::Google::Cloud::Retail::V2::ProductService::Client" + }, + "method": { + "short_name": "CreateProduct", + "full_name": "google.cloud.retail.v2.ProductService.CreateProduct", + "service": { + "short_name": "ProductService", + "full_name": "google.cloud.retail.v2.ProductService" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 46, + "type": "FULL" + } + ] + }, + { + "region_tag": "retail_v2_generated_ProductService_GetProduct_sync", + "title": "Snippet for the get_product call in the ProductService service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Retail::V2::ProductService::Client#get_product.", + "file": "product_service/get_product.rb", + "language": "RUBY", + "client_method": { + "short_name": "get_product", + "full_name": "::Google::Cloud::Retail::V2::ProductService::Client#get_product", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::Retail::V2::GetProductRequest", + "name": "request" + } + ], + "result_type": "::Google::Cloud::Retail::V2::Product", + "client": { + "short_name": "ProductService::Client", + "full_name": "::Google::Cloud::Retail::V2::ProductService::Client" + }, + "method": { + "short_name": "GetProduct", + "full_name": "google.cloud.retail.v2.ProductService.GetProduct", + "service": { + "short_name": "ProductService", + "full_name": "google.cloud.retail.v2.ProductService" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 46, + "type": "FULL" + } + ] + }, + { + "region_tag": "retail_v2_generated_ProductService_ListProducts_sync", + "title": "Snippet for the list_products call in the ProductService service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Retail::V2::ProductService::Client#list_products.", + "file": "product_service/list_products.rb", + "language": "RUBY", + "client_method": { + "short_name": "list_products", + "full_name": "::Google::Cloud::Retail::V2::ProductService::Client#list_products", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::Retail::V2::ListProductsRequest", + "name": "request" + } + ], + "result_type": "::Google::Cloud::Retail::V2::ListProductsResponse", + "client": { + "short_name": "ProductService::Client", + "full_name": "::Google::Cloud::Retail::V2::ProductService::Client" + }, + "method": { + "short_name": "ListProducts", + "full_name": "google.cloud.retail.v2.ProductService.ListProducts", + "service": { + "short_name": "ProductService", + "full_name": "google.cloud.retail.v2.ProductService" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 50, + "type": "FULL" + } + ] + }, + { + "region_tag": "retail_v2_generated_ProductService_UpdateProduct_sync", + "title": "Snippet for the update_product call in the ProductService service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Retail::V2::ProductService::Client#update_product.", + "file": "product_service/update_product.rb", + "language": "RUBY", + "client_method": { + "short_name": "update_product", + "full_name": "::Google::Cloud::Retail::V2::ProductService::Client#update_product", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::Retail::V2::UpdateProductRequest", + "name": "request" + } + ], + "result_type": "::Google::Cloud::Retail::V2::Product", + "client": { + "short_name": "ProductService::Client", + "full_name": "::Google::Cloud::Retail::V2::ProductService::Client" + }, + "method": { + "short_name": "UpdateProduct", + "full_name": "google.cloud.retail.v2.ProductService.UpdateProduct", + "service": { + "short_name": "ProductService", + "full_name": "google.cloud.retail.v2.ProductService" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 46, + "type": "FULL" + } + ] + }, + { + "region_tag": "retail_v2_generated_ProductService_DeleteProduct_sync", + "title": "Snippet for the delete_product call in the ProductService service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Retail::V2::ProductService::Client#delete_product.", + "file": "product_service/delete_product.rb", + "language": "RUBY", + "client_method": { + "short_name": "delete_product", + "full_name": "::Google::Cloud::Retail::V2::ProductService::Client#delete_product", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::Retail::V2::DeleteProductRequest", + "name": "request" + } + ], + "result_type": "::Google::Protobuf::Empty", + "client": { + "short_name": "ProductService::Client", + "full_name": "::Google::Cloud::Retail::V2::ProductService::Client" + }, + "method": { + "short_name": "DeleteProduct", + "full_name": "google.cloud.retail.v2.ProductService.DeleteProduct", + "service": { + "short_name": "ProductService", + "full_name": "google.cloud.retail.v2.ProductService" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 46, + "type": "FULL" + } + ] + }, + { + "region_tag": "retail_v2_generated_ProductService_PurgeProducts_sync", + "title": "Snippet for the purge_products call in the ProductService service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Retail::V2::ProductService::Client#purge_products.", + "file": "product_service/purge_products.rb", + "language": "RUBY", + "client_method": { + "short_name": "purge_products", + "full_name": "::Google::Cloud::Retail::V2::ProductService::Client#purge_products", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::Retail::V2::PurgeProductsRequest", + "name": "request" + } + ], + "result_type": "::Google::Longrunning::Operation", + "client": { + "short_name": "ProductService::Client", + "full_name": "::Google::Cloud::Retail::V2::ProductService::Client" + }, + "method": { + "short_name": "PurgeProducts", + "full_name": "google.cloud.retail.v2.ProductService.PurgeProducts", + "service": { + "short_name": "ProductService", + "full_name": "google.cloud.retail.v2.ProductService" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 53, + "type": "FULL" + } + ] + }, + { + "region_tag": "retail_v2_generated_ProductService_ImportProducts_sync", + "title": "Snippet for the import_products call in the ProductService service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Retail::V2::ProductService::Client#import_products.", + "file": "product_service/import_products.rb", + "language": "RUBY", + "client_method": { + "short_name": "import_products", + "full_name": "::Google::Cloud::Retail::V2::ProductService::Client#import_products", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::Retail::V2::ImportProductsRequest", + "name": "request" + } + ], + "result_type": "::Google::Longrunning::Operation", + "client": { + "short_name": "ProductService::Client", + "full_name": "::Google::Cloud::Retail::V2::ProductService::Client" + }, + "method": { + "short_name": "ImportProducts", + "full_name": "google.cloud.retail.v2.ProductService.ImportProducts", + "service": { + "short_name": "ProductService", + "full_name": "google.cloud.retail.v2.ProductService" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 53, + "type": "FULL" + } + ] + }, + { + "region_tag": "retail_v2_generated_ProductService_SetInventory_sync", + "title": "Snippet for the set_inventory call in the ProductService service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Retail::V2::ProductService::Client#set_inventory.", + "file": "product_service/set_inventory.rb", + "language": "RUBY", + "client_method": { + "short_name": "set_inventory", + "full_name": "::Google::Cloud::Retail::V2::ProductService::Client#set_inventory", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::Retail::V2::SetInventoryRequest", + "name": "request" + } + ], + "result_type": "::Google::Longrunning::Operation", + "client": { + "short_name": "ProductService::Client", + "full_name": "::Google::Cloud::Retail::V2::ProductService::Client" + }, + "method": { + "short_name": "SetInventory", + "full_name": "google.cloud.retail.v2.ProductService.SetInventory", + "service": { + "short_name": "ProductService", + "full_name": "google.cloud.retail.v2.ProductService" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 53, + "type": "FULL" + } + ] + }, + { + "region_tag": "retail_v2_generated_ProductService_AddFulfillmentPlaces_sync", + "title": "Snippet for the add_fulfillment_places call in the ProductService service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Retail::V2::ProductService::Client#add_fulfillment_places.", + "file": "product_service/add_fulfillment_places.rb", + "language": "RUBY", + "client_method": { + "short_name": "add_fulfillment_places", + "full_name": "::Google::Cloud::Retail::V2::ProductService::Client#add_fulfillment_places", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::Retail::V2::AddFulfillmentPlacesRequest", + "name": "request" + } + ], + "result_type": "::Google::Longrunning::Operation", + "client": { + "short_name": "ProductService::Client", + "full_name": "::Google::Cloud::Retail::V2::ProductService::Client" + }, + "method": { + "short_name": "AddFulfillmentPlaces", + "full_name": "google.cloud.retail.v2.ProductService.AddFulfillmentPlaces", + "service": { + "short_name": "ProductService", + "full_name": "google.cloud.retail.v2.ProductService" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 53, + "type": "FULL" + } + ] + }, + { + "region_tag": "retail_v2_generated_ProductService_RemoveFulfillmentPlaces_sync", + "title": "Snippet for the remove_fulfillment_places call in the ProductService service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Retail::V2::ProductService::Client#remove_fulfillment_places.", + "file": "product_service/remove_fulfillment_places.rb", + "language": "RUBY", + "client_method": { + "short_name": "remove_fulfillment_places", + "full_name": "::Google::Cloud::Retail::V2::ProductService::Client#remove_fulfillment_places", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::Retail::V2::RemoveFulfillmentPlacesRequest", + "name": "request" + } + ], + "result_type": "::Google::Longrunning::Operation", + "client": { + "short_name": "ProductService::Client", + "full_name": "::Google::Cloud::Retail::V2::ProductService::Client" + }, + "method": { + "short_name": "RemoveFulfillmentPlaces", + "full_name": "google.cloud.retail.v2.ProductService.RemoveFulfillmentPlaces", + "service": { + "short_name": "ProductService", + "full_name": "google.cloud.retail.v2.ProductService" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 53, + "type": "FULL" + } + ] + }, + { + "region_tag": "retail_v2_generated_ProductService_AddLocalInventories_sync", + "title": "Snippet for the add_local_inventories call in the ProductService service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Retail::V2::ProductService::Client#add_local_inventories.", + "file": "product_service/add_local_inventories.rb", + "language": "RUBY", + "client_method": { + "short_name": "add_local_inventories", + "full_name": "::Google::Cloud::Retail::V2::ProductService::Client#add_local_inventories", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::Retail::V2::AddLocalInventoriesRequest", + "name": "request" + } + ], + "result_type": "::Google::Longrunning::Operation", + "client": { + "short_name": "ProductService::Client", + "full_name": "::Google::Cloud::Retail::V2::ProductService::Client" + }, + "method": { + "short_name": "AddLocalInventories", + "full_name": "google.cloud.retail.v2.ProductService.AddLocalInventories", + "service": { + "short_name": "ProductService", + "full_name": "google.cloud.retail.v2.ProductService" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 53, + "type": "FULL" + } + ] + }, + { + "region_tag": "retail_v2_generated_ProductService_RemoveLocalInventories_sync", + "title": "Snippet for the remove_local_inventories call in the ProductService service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Retail::V2::ProductService::Client#remove_local_inventories.", + "file": "product_service/remove_local_inventories.rb", + "language": "RUBY", + "client_method": { + "short_name": "remove_local_inventories", + "full_name": "::Google::Cloud::Retail::V2::ProductService::Client#remove_local_inventories", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::Retail::V2::RemoveLocalInventoriesRequest", + "name": "request" + } + ], + "result_type": "::Google::Longrunning::Operation", + "client": { + "short_name": "ProductService::Client", + "full_name": "::Google::Cloud::Retail::V2::ProductService::Client" + }, + "method": { + "short_name": "RemoveLocalInventories", + "full_name": "google.cloud.retail.v2.ProductService.RemoveLocalInventories", + "service": { + "short_name": "ProductService", + "full_name": "google.cloud.retail.v2.ProductService" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 53, + "type": "FULL" + } + ] + }, + { + "region_tag": "retail_v2_generated_ServingConfigService_CreateServingConfig_sync", + "title": "Snippet for the create_serving_config call in the ServingConfigService service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Retail::V2::ServingConfigService::Client#create_serving_config.", + "file": "serving_config_service/create_serving_config.rb", + "language": "RUBY", + "client_method": { + "short_name": "create_serving_config", + "full_name": "::Google::Cloud::Retail::V2::ServingConfigService::Client#create_serving_config", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::Retail::V2::CreateServingConfigRequest", + "name": "request" + } + ], + "result_type": "::Google::Cloud::Retail::V2::ServingConfig", + "client": { + "short_name": "ServingConfigService::Client", + "full_name": "::Google::Cloud::Retail::V2::ServingConfigService::Client" + }, + "method": { + "short_name": "CreateServingConfig", + "full_name": "google.cloud.retail.v2.ServingConfigService.CreateServingConfig", + "service": { + "short_name": "ServingConfigService", + "full_name": "google.cloud.retail.v2.ServingConfigService" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 46, + "type": "FULL" + } + ] + }, + { + "region_tag": "retail_v2_generated_ServingConfigService_DeleteServingConfig_sync", + "title": "Snippet for the delete_serving_config call in the ServingConfigService service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Retail::V2::ServingConfigService::Client#delete_serving_config.", + "file": "serving_config_service/delete_serving_config.rb", + "language": "RUBY", + "client_method": { + "short_name": "delete_serving_config", + "full_name": "::Google::Cloud::Retail::V2::ServingConfigService::Client#delete_serving_config", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::Retail::V2::DeleteServingConfigRequest", + "name": "request" + } + ], + "result_type": "::Google::Protobuf::Empty", + "client": { + "short_name": "ServingConfigService::Client", + "full_name": "::Google::Cloud::Retail::V2::ServingConfigService::Client" + }, + "method": { + "short_name": "DeleteServingConfig", + "full_name": "google.cloud.retail.v2.ServingConfigService.DeleteServingConfig", + "service": { + "short_name": "ServingConfigService", + "full_name": "google.cloud.retail.v2.ServingConfigService" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 46, + "type": "FULL" + } + ] + }, + { + "region_tag": "retail_v2_generated_ServingConfigService_UpdateServingConfig_sync", + "title": "Snippet for the update_serving_config call in the ServingConfigService service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Retail::V2::ServingConfigService::Client#update_serving_config.", + "file": "serving_config_service/update_serving_config.rb", + "language": "RUBY", + "client_method": { + "short_name": "update_serving_config", + "full_name": "::Google::Cloud::Retail::V2::ServingConfigService::Client#update_serving_config", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::Retail::V2::UpdateServingConfigRequest", + "name": "request" + } + ], + "result_type": "::Google::Cloud::Retail::V2::ServingConfig", + "client": { + "short_name": "ServingConfigService::Client", + "full_name": "::Google::Cloud::Retail::V2::ServingConfigService::Client" + }, + "method": { + "short_name": "UpdateServingConfig", + "full_name": "google.cloud.retail.v2.ServingConfigService.UpdateServingConfig", + "service": { + "short_name": "ServingConfigService", + "full_name": "google.cloud.retail.v2.ServingConfigService" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 46, + "type": "FULL" + } + ] + }, + { + "region_tag": "retail_v2_generated_ServingConfigService_GetServingConfig_sync", + "title": "Snippet for the get_serving_config call in the ServingConfigService service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Retail::V2::ServingConfigService::Client#get_serving_config.", + "file": "serving_config_service/get_serving_config.rb", + "language": "RUBY", + "client_method": { + "short_name": "get_serving_config", + "full_name": "::Google::Cloud::Retail::V2::ServingConfigService::Client#get_serving_config", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::Retail::V2::GetServingConfigRequest", + "name": "request" + } + ], + "result_type": "::Google::Cloud::Retail::V2::ServingConfig", + "client": { + "short_name": "ServingConfigService::Client", + "full_name": "::Google::Cloud::Retail::V2::ServingConfigService::Client" + }, + "method": { + "short_name": "GetServingConfig", + "full_name": "google.cloud.retail.v2.ServingConfigService.GetServingConfig", + "service": { + "short_name": "ServingConfigService", + "full_name": "google.cloud.retail.v2.ServingConfigService" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 46, + "type": "FULL" + } + ] + }, + { + "region_tag": "retail_v2_generated_ServingConfigService_ListServingConfigs_sync", + "title": "Snippet for the list_serving_configs call in the ServingConfigService service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Retail::V2::ServingConfigService::Client#list_serving_configs.", + "file": "serving_config_service/list_serving_configs.rb", + "language": "RUBY", + "client_method": { + "short_name": "list_serving_configs", + "full_name": "::Google::Cloud::Retail::V2::ServingConfigService::Client#list_serving_configs", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::Retail::V2::ListServingConfigsRequest", + "name": "request" + } + ], + "result_type": "::Google::Cloud::Retail::V2::ListServingConfigsResponse", + "client": { + "short_name": "ServingConfigService::Client", + "full_name": "::Google::Cloud::Retail::V2::ServingConfigService::Client" + }, + "method": { + "short_name": "ListServingConfigs", + "full_name": "google.cloud.retail.v2.ServingConfigService.ListServingConfigs", + "service": { + "short_name": "ServingConfigService", + "full_name": "google.cloud.retail.v2.ServingConfigService" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 50, + "type": "FULL" + } + ] + }, + { + "region_tag": "retail_v2_generated_ServingConfigService_AddControl_sync", + "title": "Snippet for the add_control call in the ServingConfigService service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Retail::V2::ServingConfigService::Client#add_control.", + "file": "serving_config_service/add_control.rb", + "language": "RUBY", + "client_method": { + "short_name": "add_control", + "full_name": "::Google::Cloud::Retail::V2::ServingConfigService::Client#add_control", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::Retail::V2::AddControlRequest", + "name": "request" + } + ], + "result_type": "::Google::Cloud::Retail::V2::ServingConfig", + "client": { + "short_name": "ServingConfigService::Client", + "full_name": "::Google::Cloud::Retail::V2::ServingConfigService::Client" + }, + "method": { + "short_name": "AddControl", + "full_name": "google.cloud.retail.v2.ServingConfigService.AddControl", + "service": { + "short_name": "ServingConfigService", + "full_name": "google.cloud.retail.v2.ServingConfigService" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 46, + "type": "FULL" + } + ] + }, + { + "region_tag": "retail_v2_generated_ServingConfigService_RemoveControl_sync", + "title": "Snippet for the remove_control call in the ServingConfigService service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Retail::V2::ServingConfigService::Client#remove_control.", + "file": "serving_config_service/remove_control.rb", + "language": "RUBY", + "client_method": { + "short_name": "remove_control", + "full_name": "::Google::Cloud::Retail::V2::ServingConfigService::Client#remove_control", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::Retail::V2::RemoveControlRequest", + "name": "request" + } + ], + "result_type": "::Google::Cloud::Retail::V2::ServingConfig", + "client": { + "short_name": "ServingConfigService::Client", + "full_name": "::Google::Cloud::Retail::V2::ServingConfigService::Client" + }, + "method": { + "short_name": "RemoveControl", + "full_name": "google.cloud.retail.v2.ServingConfigService.RemoveControl", + "service": { + "short_name": "ServingConfigService", + "full_name": "google.cloud.retail.v2.ServingConfigService" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 46, + "type": "FULL" + } + ] + }, + { + "region_tag": "retail_v2_generated_UserEventService_WriteUserEvent_sync", + "title": "Snippet for the write_user_event call in the UserEventService service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Retail::V2::UserEventService::Client#write_user_event.", + "file": "user_event_service/write_user_event.rb", + "language": "RUBY", + "client_method": { + "short_name": "write_user_event", + "full_name": "::Google::Cloud::Retail::V2::UserEventService::Client#write_user_event", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::Retail::V2::WriteUserEventRequest", + "name": "request" + } + ], + "result_type": "::Google::Cloud::Retail::V2::UserEvent", + "client": { + "short_name": "UserEventService::Client", + "full_name": "::Google::Cloud::Retail::V2::UserEventService::Client" + }, + "method": { + "short_name": "WriteUserEvent", + "full_name": "google.cloud.retail.v2.UserEventService.WriteUserEvent", + "service": { + "short_name": "UserEventService", + "full_name": "google.cloud.retail.v2.UserEventService" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 46, + "type": "FULL" + } + ] + }, + { + "region_tag": "retail_v2_generated_UserEventService_CollectUserEvent_sync", + "title": "Snippet for the collect_user_event call in the UserEventService service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Retail::V2::UserEventService::Client#collect_user_event.", + "file": "user_event_service/collect_user_event.rb", + "language": "RUBY", + "client_method": { + "short_name": "collect_user_event", + "full_name": "::Google::Cloud::Retail::V2::UserEventService::Client#collect_user_event", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::Retail::V2::CollectUserEventRequest", + "name": "request" + } + ], + "result_type": "::Google::Api::HttpBody", + "client": { + "short_name": "UserEventService::Client", + "full_name": "::Google::Cloud::Retail::V2::UserEventService::Client" + }, + "method": { + "short_name": "CollectUserEvent", + "full_name": "google.cloud.retail.v2.UserEventService.CollectUserEvent", + "service": { + "short_name": "UserEventService", + "full_name": "google.cloud.retail.v2.UserEventService" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 46, + "type": "FULL" + } + ] + }, + { + "region_tag": "retail_v2_generated_UserEventService_PurgeUserEvents_sync", + "title": "Snippet for the purge_user_events call in the UserEventService service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Retail::V2::UserEventService::Client#purge_user_events.", + "file": "user_event_service/purge_user_events.rb", + "language": "RUBY", + "client_method": { + "short_name": "purge_user_events", + "full_name": "::Google::Cloud::Retail::V2::UserEventService::Client#purge_user_events", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::Retail::V2::PurgeUserEventsRequest", + "name": "request" + } + ], + "result_type": "::Google::Longrunning::Operation", + "client": { + "short_name": "UserEventService::Client", + "full_name": "::Google::Cloud::Retail::V2::UserEventService::Client" + }, + "method": { + "short_name": "PurgeUserEvents", + "full_name": "google.cloud.retail.v2.UserEventService.PurgeUserEvents", + "service": { + "short_name": "UserEventService", + "full_name": "google.cloud.retail.v2.UserEventService" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 53, + "type": "FULL" + } + ] + }, + { + "region_tag": "retail_v2_generated_UserEventService_ImportUserEvents_sync", + "title": "Snippet for the import_user_events call in the UserEventService service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Retail::V2::UserEventService::Client#import_user_events.", + "file": "user_event_service/import_user_events.rb", + "language": "RUBY", + "client_method": { + "short_name": "import_user_events", + "full_name": "::Google::Cloud::Retail::V2::UserEventService::Client#import_user_events", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::Retail::V2::ImportUserEventsRequest", + "name": "request" + } + ], + "result_type": "::Google::Longrunning::Operation", + "client": { + "short_name": "UserEventService::Client", + "full_name": "::Google::Cloud::Retail::V2::UserEventService::Client" + }, + "method": { + "short_name": "ImportUserEvents", + "full_name": "google.cloud.retail.v2.UserEventService.ImportUserEvents", + "service": { + "short_name": "UserEventService", + "full_name": "google.cloud.retail.v2.UserEventService" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 53, + "type": "FULL" + } + ] + }, + { + "region_tag": "retail_v2_generated_UserEventService_RejoinUserEvents_sync", + "title": "Snippet for the rejoin_user_events call in the UserEventService service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Retail::V2::UserEventService::Client#rejoin_user_events.", + "file": "user_event_service/rejoin_user_events.rb", + "language": "RUBY", + "client_method": { + "short_name": "rejoin_user_events", + "full_name": "::Google::Cloud::Retail::V2::UserEventService::Client#rejoin_user_events", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::Retail::V2::RejoinUserEventsRequest", + "name": "request" + } + ], + "result_type": "::Google::Longrunning::Operation", + "client": { + "short_name": "UserEventService::Client", + "full_name": "::Google::Cloud::Retail::V2::UserEventService::Client" + }, + "method": { + "short_name": "RejoinUserEvents", + "full_name": "google.cloud.retail.v2.UserEventService.RejoinUserEvents", + "service": { + "short_name": "UserEventService", + "full_name": "google.cloud.retail.v2.UserEventService" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 53, + "type": "FULL" + } + ] + } + ] +} \ No newline at end of file diff --git a/owl-bot-staging/google-cloud-retail-v2/snippets/user_event_service/collect_user_event.rb b/owl-bot-staging/google-cloud-retail-v2/snippets/user_event_service/collect_user_event.rb new file mode 100644 index 000000000000..ee81b5ede9b4 --- /dev/null +++ b/owl-bot-staging/google-cloud-retail-v2/snippets/user_event_service/collect_user_event.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 retail_v2_generated_UserEventService_CollectUserEvent_sync] +require "google/cloud/retail/v2" + +## +# Snippet for the collect_user_event call in the UserEventService service +# +# This snippet has been automatically generated and should be regarded as a code +# template only. It will require modifications to work: +# - It may require correct/in-range values for request initialization. +# - It may require specifying regional endpoints when creating the service +# client as shown in https://cloud.google.com/ruby/docs/reference. +# +# This is an auto-generated example demonstrating basic usage of +# Google::Cloud::Retail::V2::UserEventService::Client#collect_user_event. +# +def collect_user_event + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Retail::V2::UserEventService::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Retail::V2::CollectUserEventRequest.new + + # Call the collect_user_event method. + result = client.collect_user_event request + + # The returned object is of type Google::Api::HttpBody. + p result +end +# [END retail_v2_generated_UserEventService_CollectUserEvent_sync] diff --git a/owl-bot-staging/google-cloud-retail-v2/snippets/user_event_service/import_user_events.rb b/owl-bot-staging/google-cloud-retail-v2/snippets/user_event_service/import_user_events.rb new file mode 100644 index 000000000000..4c20c5a126d4 --- /dev/null +++ b/owl-bot-staging/google-cloud-retail-v2/snippets/user_event_service/import_user_events.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 retail_v2_generated_UserEventService_ImportUserEvents_sync] +require "google/cloud/retail/v2" + +## +# Snippet for the import_user_events call in the UserEventService service +# +# This snippet has been automatically generated and should be regarded as a code +# template only. It will require modifications to work: +# - It may require correct/in-range values for request initialization. +# - It may require specifying regional endpoints when creating the service +# client as shown in https://cloud.google.com/ruby/docs/reference. +# +# This is an auto-generated example demonstrating basic usage of +# Google::Cloud::Retail::V2::UserEventService::Client#import_user_events. +# +def import_user_events + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Retail::V2::UserEventService::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Retail::V2::ImportUserEventsRequest.new + + # Call the import_user_events method. + result = client.import_user_events 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 retail_v2_generated_UserEventService_ImportUserEvents_sync] diff --git a/owl-bot-staging/google-cloud-retail-v2/snippets/user_event_service/purge_user_events.rb b/owl-bot-staging/google-cloud-retail-v2/snippets/user_event_service/purge_user_events.rb new file mode 100644 index 000000000000..7d7df5d779bd --- /dev/null +++ b/owl-bot-staging/google-cloud-retail-v2/snippets/user_event_service/purge_user_events.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 retail_v2_generated_UserEventService_PurgeUserEvents_sync] +require "google/cloud/retail/v2" + +## +# Snippet for the purge_user_events call in the UserEventService service +# +# This snippet has been automatically generated and should be regarded as a code +# template only. It will require modifications to work: +# - It may require correct/in-range values for request initialization. +# - It may require specifying regional endpoints when creating the service +# client as shown in https://cloud.google.com/ruby/docs/reference. +# +# This is an auto-generated example demonstrating basic usage of +# Google::Cloud::Retail::V2::UserEventService::Client#purge_user_events. +# +def purge_user_events + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Retail::V2::UserEventService::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Retail::V2::PurgeUserEventsRequest.new + + # Call the purge_user_events method. + result = client.purge_user_events 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 retail_v2_generated_UserEventService_PurgeUserEvents_sync] diff --git a/owl-bot-staging/google-cloud-retail-v2/snippets/user_event_service/rejoin_user_events.rb b/owl-bot-staging/google-cloud-retail-v2/snippets/user_event_service/rejoin_user_events.rb new file mode 100644 index 000000000000..38e48c8b00d3 --- /dev/null +++ b/owl-bot-staging/google-cloud-retail-v2/snippets/user_event_service/rejoin_user_events.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 retail_v2_generated_UserEventService_RejoinUserEvents_sync] +require "google/cloud/retail/v2" + +## +# Snippet for the rejoin_user_events call in the UserEventService service +# +# This snippet has been automatically generated and should be regarded as a code +# template only. It will require modifications to work: +# - It may require correct/in-range values for request initialization. +# - It may require specifying regional endpoints when creating the service +# client as shown in https://cloud.google.com/ruby/docs/reference. +# +# This is an auto-generated example demonstrating basic usage of +# Google::Cloud::Retail::V2::UserEventService::Client#rejoin_user_events. +# +def rejoin_user_events + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Retail::V2::UserEventService::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Retail::V2::RejoinUserEventsRequest.new + + # Call the rejoin_user_events method. + result = client.rejoin_user_events 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 retail_v2_generated_UserEventService_RejoinUserEvents_sync] diff --git a/owl-bot-staging/google-cloud-retail-v2/snippets/user_event_service/write_user_event.rb b/owl-bot-staging/google-cloud-retail-v2/snippets/user_event_service/write_user_event.rb new file mode 100644 index 000000000000..e1946f8c6a8d --- /dev/null +++ b/owl-bot-staging/google-cloud-retail-v2/snippets/user_event_service/write_user_event.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 retail_v2_generated_UserEventService_WriteUserEvent_sync] +require "google/cloud/retail/v2" + +## +# Snippet for the write_user_event call in the UserEventService service +# +# This snippet has been automatically generated and should be regarded as a code +# template only. It will require modifications to work: +# - It may require correct/in-range values for request initialization. +# - It may require specifying regional endpoints when creating the service +# client as shown in https://cloud.google.com/ruby/docs/reference. +# +# This is an auto-generated example demonstrating basic usage of +# Google::Cloud::Retail::V2::UserEventService::Client#write_user_event. +# +def write_user_event + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Retail::V2::UserEventService::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Retail::V2::WriteUserEventRequest.new + + # Call the write_user_event method. + result = client.write_user_event request + + # The returned object is of type Google::Cloud::Retail::V2::UserEvent. + p result +end +# [END retail_v2_generated_UserEventService_WriteUserEvent_sync] diff --git a/owl-bot-staging/google-cloud-retail-v2/test/google/cloud/retail/v2/analytics_service_operations_test.rb b/owl-bot-staging/google-cloud-retail-v2/test/google/cloud/retail/v2/analytics_service_operations_test.rb new file mode 100644 index 000000000000..98720382d56c --- /dev/null +++ b/owl-bot-staging/google-cloud-retail-v2/test/google/cloud/retail/v2/analytics_service_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/cloud/retail/v2/analytics_service_pb" +require "google/cloud/retail/v2/analytics_service_services_pb" +require "google/cloud/retail/v2/analytics_service" + +class ::Google::Cloud::Retail::V2::AnalyticsService::OperationsTest < Minitest::Test + class ClientStub + attr_accessor :call_rpc_count, :requests + + def initialize response, operation, &block + @response = response + @operation = operation + @block = block + @call_rpc_count = 0 + @requests = [] + end + + def call_rpc *args, **kwargs + @call_rpc_count += 1 + + @requests << @block&.call(*args, **kwargs) + + catch :response do + yield @response, @operation if block_given? + @response + end + end + + def endpoint + "endpoint.example.com" + end + + def universe_domain + "example.com" + end + + def stub_logger + nil + end + + def logger + nil + end + end + + def test_list_operations + # Create GRPC objects. + grpc_response = ::Google::Longrunning::ListOperationsResponse.new + grpc_operation = GRPC::ActiveCall::Operation.new nil + grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + grpc_options = {} + + # Create request parameters for a unary method. + name = "hello world" + filter = "hello world" + page_size = 42 + page_token = "hello world" + return_partial_success = true + + list_operations_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :list_operations, name + assert_kind_of ::Google::Longrunning::ListOperationsRequest, request + assert_equal "hello world", request["name"] + assert_equal "hello world", request["filter"] + assert_equal 42, request["page_size"] + assert_equal "hello world", request["page_token"] + assert_equal true, request["return_partial_success"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, list_operations_client_stub do + # Create client + client = ::Google::Cloud::Retail::V2::AnalyticsService::Operations.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.list_operations({ name: name, filter: filter, page_size: page_size, page_token: page_token, return_partial_success: return_partial_success }) do |response, operation| + assert_kind_of Gapic::PagedEnumerable, response + assert_equal grpc_response, response.response + assert_equal grpc_operation, operation + end + + # Use named arguments + client.list_operations name: name, filter: filter, page_size: page_size, page_token: page_token, return_partial_success: return_partial_success do |response, operation| + assert_kind_of Gapic::PagedEnumerable, response + assert_equal grpc_response, response.response + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.list_operations ::Google::Longrunning::ListOperationsRequest.new(name: name, filter: filter, page_size: page_size, page_token: page_token, return_partial_success: return_partial_success) do |response, operation| + assert_kind_of Gapic::PagedEnumerable, response + assert_equal grpc_response, response.response + assert_equal grpc_operation, operation + end + + # Use hash object with options + client.list_operations({ name: name, filter: filter, page_size: page_size, page_token: page_token, return_partial_success: return_partial_success }, grpc_options) do |response, operation| + assert_kind_of Gapic::PagedEnumerable, response + assert_equal grpc_response, response.response + assert_equal grpc_operation, operation + end + + # Use protobuf object with options + client.list_operations(::Google::Longrunning::ListOperationsRequest.new(name: name, filter: filter, page_size: page_size, page_token: page_token, return_partial_success: return_partial_success), grpc_options) do |response, operation| + assert_kind_of Gapic::PagedEnumerable, response + assert_equal grpc_response, response.response + assert_equal grpc_operation, operation + end + + # Verify method calls + assert_equal 5, list_operations_client_stub.call_rpc_count + end + end + + def test_get_operation + # Create GRPC objects. + grpc_response = ::Google::Longrunning::Operation.new + grpc_operation = GRPC::ActiveCall::Operation.new nil + grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + grpc_options = {} + + # Create request parameters for a unary method. + name = "hello world" + + get_operation_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :get_operation, name + assert_kind_of ::Google::Longrunning::GetOperationRequest, request + assert_equal "hello world", request["name"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, get_operation_client_stub do + # Create client + client = ::Google::Cloud::Retail::V2::AnalyticsService::Operations.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.get_operation({ name: name }) do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Use named arguments + client.get_operation name: name do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.get_operation ::Google::Longrunning::GetOperationRequest.new(name: name) do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Use hash object with options + client.get_operation({ name: name }, grpc_options) do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Use protobuf object with options + client.get_operation(::Google::Longrunning::GetOperationRequest.new(name: name), grpc_options) do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Verify method calls + assert_equal 5, get_operation_client_stub.call_rpc_count + end + end + + def test_delete_operation + # Create GRPC objects. + grpc_response = ::Google::Protobuf::Empty.new + grpc_operation = GRPC::ActiveCall::Operation.new nil + grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + grpc_options = {} + + # Create request parameters for a unary method. + name = "hello world" + + delete_operation_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :delete_operation, name + assert_kind_of ::Google::Longrunning::DeleteOperationRequest, request + assert_equal "hello world", request["name"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, delete_operation_client_stub do + # Create client + client = ::Google::Cloud::Retail::V2::AnalyticsService::Operations.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.delete_operation({ name: name }) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use named arguments + client.delete_operation name: name do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.delete_operation ::Google::Longrunning::DeleteOperationRequest.new(name: name) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use hash object with options + client.delete_operation({ name: name }, grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object with options + client.delete_operation(::Google::Longrunning::DeleteOperationRequest.new(name: name), grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Verify method calls + assert_equal 5, delete_operation_client_stub.call_rpc_count + end + end + + def test_cancel_operation + # Create GRPC objects. + grpc_response = ::Google::Protobuf::Empty.new + grpc_operation = GRPC::ActiveCall::Operation.new nil + grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + grpc_options = {} + + # Create request parameters for a unary method. + name = "hello world" + + cancel_operation_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :cancel_operation, name + assert_kind_of ::Google::Longrunning::CancelOperationRequest, request + assert_equal "hello world", request["name"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, cancel_operation_client_stub do + # Create client + client = ::Google::Cloud::Retail::V2::AnalyticsService::Operations.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.cancel_operation({ name: name }) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use named arguments + client.cancel_operation name: name do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.cancel_operation ::Google::Longrunning::CancelOperationRequest.new(name: name) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use hash object with options + client.cancel_operation({ name: name }, grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object with options + client.cancel_operation(::Google::Longrunning::CancelOperationRequest.new(name: name), grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Verify method calls + assert_equal 5, cancel_operation_client_stub.call_rpc_count + end + end + + def test_wait_operation + # Create GRPC objects. + grpc_response = ::Google::Longrunning::Operation.new + grpc_operation = GRPC::ActiveCall::Operation.new nil + grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + grpc_options = {} + + # Create request parameters for a unary method. + name = "hello world" + timeout = {} + + wait_operation_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :wait_operation, name + assert_kind_of ::Google::Longrunning::WaitOperationRequest, request + assert_equal "hello world", request["name"] + assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Protobuf::Duration), request["timeout"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, wait_operation_client_stub do + # Create client + client = ::Google::Cloud::Retail::V2::AnalyticsService::Operations.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.wait_operation({ name: name, timeout: timeout }) do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Use named arguments + client.wait_operation name: name, timeout: timeout do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.wait_operation ::Google::Longrunning::WaitOperationRequest.new(name: name, timeout: timeout) do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Use hash object with options + client.wait_operation({ name: name, timeout: timeout }, grpc_options) do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Use protobuf object with options + client.wait_operation(::Google::Longrunning::WaitOperationRequest.new(name: name, timeout: timeout), grpc_options) do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Verify method calls + assert_equal 5, wait_operation_client_stub.call_rpc_count + end + end + + def test_configure + grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + + client = block_config = config = nil + dummy_stub = ClientStub.new nil, nil + Gapic::ServiceStub.stub :new, dummy_stub do + client = ::Google::Cloud::Retail::V2::AnalyticsService::Operations.new do |config| + config.credentials = grpc_channel + end + end + + config = client.configure do |c| + block_config = c + end + + assert_same block_config, config + assert_kind_of ::Google::Cloud::Retail::V2::AnalyticsService::Operations::Configuration, config + end +end diff --git a/owl-bot-staging/google-cloud-retail-v2/test/google/cloud/retail/v2/analytics_service_rest_test.rb b/owl-bot-staging/google-cloud-retail-v2/test/google/cloud/retail/v2/analytics_service_rest_test.rb new file mode 100644 index 000000000000..f24138baeb71 --- /dev/null +++ b/owl-bot-staging/google-cloud-retail-v2/test/google/cloud/retail/v2/analytics_service_rest_test.rb @@ -0,0 +1,155 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +require "helper" +require "gapic/rest" +require "google/cloud/retail/v2/analytics_service_pb" +require "google/cloud/retail/v2/analytics_service/rest" + + +class ::Google::Cloud::Retail::V2::AnalyticsService::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_export_analytics_metrics + # 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. + catalog = "hello world" + output_config = {} + filter = "hello world" + + export_analytics_metrics_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| + assert options.metadata.key? :"x-goog-api-client" + assert options.metadata[:"x-goog-api-client"].include? "rest" + refute options.metadata[:"x-goog-api-client"].include? "grpc" + end + + ::Google::Cloud::Retail::V2::AnalyticsService::Rest::ServiceStub.stub :transcode_export_analytics_metrics_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, export_analytics_metrics_client_stub do + # Create client + client = ::Google::Cloud::Retail::V2::AnalyticsService::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.export_analytics_metrics({ catalog: catalog, output_config: output_config, filter: filter }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.export_analytics_metrics catalog: catalog, output_config: output_config, filter: filter do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.export_analytics_metrics ::Google::Cloud::Retail::V2::ExportAnalyticsMetricsRequest.new(catalog: catalog, output_config: output_config, filter: filter) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + client.export_analytics_metrics({ catalog: catalog, output_config: output_config, filter: filter }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + client.export_analytics_metrics(::Google::Cloud::Retail::V2::ExportAnalyticsMetricsRequest.new(catalog: catalog, output_config: output_config, filter: filter), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, export_analytics_metrics_client_stub.call_count + end + end + end + + def test_configure + credentials_token = :dummy_value + + client = block_config = config = nil + dummy_stub = ClientStub.new nil + Gapic::Rest::ClientStub.stub :new, dummy_stub do + client = ::Google::Cloud::Retail::V2::AnalyticsService::Rest::Client.new do |config| + config.credentials = credentials_token + end + end + + config = client.configure do |c| + block_config = c + end + + assert_same block_config, config + assert_kind_of ::Google::Cloud::Retail::V2::AnalyticsService::Rest::Client::Configuration, config + end +end diff --git a/owl-bot-staging/google-cloud-retail-v2/test/google/cloud/retail/v2/analytics_service_test.rb b/owl-bot-staging/google-cloud-retail-v2/test/google/cloud/retail/v2/analytics_service_test.rb new file mode 100644 index 000000000000..05797bd8a20f --- /dev/null +++ b/owl-bot-staging/google-cloud-retail-v2/test/google/cloud/retail/v2/analytics_service_test.rb @@ -0,0 +1,185 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +require "helper" + +require "gapic/grpc/service_stub" + +require "google/cloud/retail/v2/analytics_service_pb" +require "google/cloud/retail/v2/analytics_service" + +class ::Google::Cloud::Retail::V2::AnalyticsService::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_export_analytics_metrics + # 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. + catalog = "hello world" + output_config = {} + filter = "hello world" + + export_analytics_metrics_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :export_analytics_metrics, name + assert_kind_of ::Google::Cloud::Retail::V2::ExportAnalyticsMetricsRequest, request + assert_equal "hello world", request["catalog"] + assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::Retail::V2::OutputConfig), request["output_config"] + assert_equal "hello world", request["filter"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, export_analytics_metrics_client_stub do + # Create client + client = ::Google::Cloud::Retail::V2::AnalyticsService::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.export_analytics_metrics({ catalog: catalog, output_config: output_config, filter: filter }) 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.export_analytics_metrics catalog: catalog, output_config: output_config, filter: filter 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.export_analytics_metrics ::Google::Cloud::Retail::V2::ExportAnalyticsMetricsRequest.new(catalog: catalog, output_config: output_config, filter: filter) 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.export_analytics_metrics({ catalog: catalog, output_config: output_config, filter: filter }, 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.export_analytics_metrics(::Google::Cloud::Retail::V2::ExportAnalyticsMetricsRequest.new(catalog: catalog, output_config: output_config, filter: filter), 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, export_analytics_metrics_client_stub.call_rpc_count + end + end + + def test_configure + grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + + client = block_config = config = nil + dummy_stub = ClientStub.new nil, nil + Gapic::ServiceStub.stub :new, dummy_stub do + client = ::Google::Cloud::Retail::V2::AnalyticsService::Client.new do |config| + config.credentials = grpc_channel + end + end + + config = client.configure do |c| + block_config = c + end + + assert_same block_config, config + assert_kind_of ::Google::Cloud::Retail::V2::AnalyticsService::Client::Configuration, config + end + + def test_credentials + key = OpenSSL::PKey::RSA.new 2048 + cred_json = { + "private_key" => key.to_pem, + "client_email" => "app@developer.gserviceaccount.com", + "type" => "service_account" + } + key_file = StringIO.new cred_json.to_json + creds = Google::Auth::ServiceAccountCredentials.make_creds({ json_key_io: key_file }) + + dummy_stub = ClientStub.new nil, nil + Gapic::ServiceStub.stub :new, dummy_stub do + client = ::Google::Cloud::Retail::V2::AnalyticsService::Client.new do |config| + config.credentials = creds + end + assert_kind_of ::Google::Cloud::Retail::V2::AnalyticsService::Client, client + assert_equal creds, client.configure.credentials + end + end + + def test_operations_client + grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + + client = nil + dummy_stub = ClientStub.new nil, nil + Gapic::ServiceStub.stub :new, dummy_stub do + client = ::Google::Cloud::Retail::V2::AnalyticsService::Client.new do |config| + config.credentials = grpc_channel + end + end + + assert_kind_of ::Google::Cloud::Retail::V2::AnalyticsService::Operations, client.operations_client + end +end diff --git a/owl-bot-staging/google-cloud-retail-v2/test/google/cloud/retail/v2/catalog_service_paths_test.rb b/owl-bot-staging/google-cloud-retail-v2/test/google/cloud/retail/v2/catalog_service_paths_test.rb new file mode 100644 index 000000000000..e107597737b1 --- /dev/null +++ b/owl-bot-staging/google-cloud-retail-v2/test/google/cloud/retail/v2/catalog_service_paths_test.rb @@ -0,0 +1,103 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +require "helper" + +require "gapic/grpc/service_stub" + +require "google/cloud/retail/v2/catalog_service" + +class ::Google::Cloud::Retail::V2::CatalogService::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_attributes_config_path + grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + ::Gapic::ServiceStub.stub :new, DummyStub.new do + client = ::Google::Cloud::Retail::V2::CatalogService::Client.new do |config| + config.credentials = grpc_channel + end + + path = client.attributes_config_path project: "value0", location: "value1", catalog: "value2" + assert_equal "projects/value0/locations/value1/catalogs/value2/attributesConfig", path + end + end + + def test_branch_path + grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + ::Gapic::ServiceStub.stub :new, DummyStub.new do + client = ::Google::Cloud::Retail::V2::CatalogService::Client.new do |config| + config.credentials = grpc_channel + end + + path = client.branch_path project: "value0", location: "value1", catalog: "value2", branch: "value3" + assert_equal "projects/value0/locations/value1/catalogs/value2/branches/value3", path + end + end + + def test_catalog_path + grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + ::Gapic::ServiceStub.stub :new, DummyStub.new do + client = ::Google::Cloud::Retail::V2::CatalogService::Client.new do |config| + config.credentials = grpc_channel + end + + path = client.catalog_path project: "value0", location: "value1", catalog: "value2" + assert_equal "projects/value0/locations/value1/catalogs/value2", path + end + end + + def test_completion_config_path + grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + ::Gapic::ServiceStub.stub :new, DummyStub.new do + client = ::Google::Cloud::Retail::V2::CatalogService::Client.new do |config| + config.credentials = grpc_channel + end + + path = client.completion_config_path project: "value0", location: "value1", catalog: "value2" + assert_equal "projects/value0/locations/value1/catalogs/value2/completionConfig", path + end + end + + def test_location_path + grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + ::Gapic::ServiceStub.stub :new, DummyStub.new do + client = ::Google::Cloud::Retail::V2::CatalogService::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 +end diff --git a/owl-bot-staging/google-cloud-retail-v2/test/google/cloud/retail/v2/catalog_service_rest_test.rb b/owl-bot-staging/google-cloud-retail-v2/test/google/cloud/retail/v2/catalog_service_rest_test.rb new file mode 100644 index 000000000000..5bdadb8726ab --- /dev/null +++ b/owl-bot-staging/google-cloud-retail-v2/test/google/cloud/retail/v2/catalog_service_rest_test.rb @@ -0,0 +1,705 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +require "helper" +require "gapic/rest" +require "google/cloud/retail/v2/catalog_service_pb" +require "google/cloud/retail/v2/catalog_service/rest" + + +class ::Google::Cloud::Retail::V2::CatalogService::Rest::ClientTest < Minitest::Test + class ClientStub + attr_accessor :call_count, :requests + + def initialize response, &block + @response = response + @block = block + @call_count = 0 + @requests = [] + end + + def make_get_request uri:, params: {}, options: {}, method_name: nil + make_http_request :get, uri: uri, body: nil, params: params, options: options, method_name: method_name + end + + def make_delete_request uri:, params: {}, options: {}, method_name: nil + make_http_request :delete, uri: uri, body: nil, params: params, options: options, method_name: method_name + end + + def make_post_request uri:, body: nil, params: {}, options: {}, method_name: nil + make_http_request :post, uri: uri, body: body, params: params, options: options, method_name: method_name + end + + def make_patch_request uri:, body:, params: {}, options: {}, method_name: nil + make_http_request :patch, uri: uri, body: body, params: params, options: options, method_name: method_name + end + + def make_put_request uri:, body:, params: {}, options: {}, method_name: nil + make_http_request :put, uri: uri, body: body, params: params, options: options, method_name: method_name + end + + def make_http_request *args, **kwargs + @call_count += 1 + + @requests << @block&.call(*args, **kwargs) + + @response + end + + def endpoint + "endpoint.example.com" + end + + def universe_domain + "example.com" + end + + def stub_logger + nil + end + + def logger + nil + end + end + + def test_list_catalogs + # Create test objects. + client_result = ::Google::Cloud::Retail::V2::ListCatalogsResponse.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_catalogs_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| + assert options.metadata.key? :"x-goog-api-client" + assert options.metadata[:"x-goog-api-client"].include? "rest" + refute options.metadata[:"x-goog-api-client"].include? "grpc" + end + + ::Google::Cloud::Retail::V2::CatalogService::Rest::ServiceStub.stub :transcode_list_catalogs_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, list_catalogs_client_stub do + # Create client + client = ::Google::Cloud::Retail::V2::CatalogService::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.list_catalogs({ 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_catalogs 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_catalogs ::Google::Cloud::Retail::V2::ListCatalogsRequest.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_catalogs({ 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_catalogs(::Google::Cloud::Retail::V2::ListCatalogsRequest.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_catalogs_client_stub.call_count + end + end + end + + def test_update_catalog + # Create test objects. + client_result = ::Google::Cloud::Retail::V2::Catalog.new + http_response = OpenStruct.new body: client_result.to_json + + call_options = {} + + # Create request parameters for a unary method. + catalog = {} + update_mask = {} + + update_catalog_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| + assert options.metadata.key? :"x-goog-api-client" + assert options.metadata[:"x-goog-api-client"].include? "rest" + refute options.metadata[:"x-goog-api-client"].include? "grpc" + end + + ::Google::Cloud::Retail::V2::CatalogService::Rest::ServiceStub.stub :transcode_update_catalog_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, update_catalog_client_stub do + # Create client + client = ::Google::Cloud::Retail::V2::CatalogService::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.update_catalog({ catalog: catalog, update_mask: update_mask }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.update_catalog catalog: catalog, update_mask: update_mask do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.update_catalog ::Google::Cloud::Retail::V2::UpdateCatalogRequest.new(catalog: catalog, update_mask: update_mask) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + client.update_catalog({ catalog: catalog, update_mask: update_mask }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + client.update_catalog(::Google::Cloud::Retail::V2::UpdateCatalogRequest.new(catalog: catalog, update_mask: update_mask), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, update_catalog_client_stub.call_count + end + end + end + + def test_set_default_branch + # Create test objects. + client_result = ::Google::Protobuf::Empty.new + http_response = OpenStruct.new body: client_result.to_json + + call_options = {} + + # Create request parameters for a unary method. + catalog = "hello world" + branch_id = "hello world" + note = "hello world" + force = true + + set_default_branch_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| + assert options.metadata.key? :"x-goog-api-client" + assert options.metadata[:"x-goog-api-client"].include? "rest" + refute options.metadata[:"x-goog-api-client"].include? "grpc" + end + + ::Google::Cloud::Retail::V2::CatalogService::Rest::ServiceStub.stub :transcode_set_default_branch_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, set_default_branch_client_stub do + # Create client + client = ::Google::Cloud::Retail::V2::CatalogService::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.set_default_branch({ catalog: catalog, branch_id: branch_id, note: note, force: force }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.set_default_branch catalog: catalog, branch_id: branch_id, note: note, force: force do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.set_default_branch ::Google::Cloud::Retail::V2::SetDefaultBranchRequest.new(catalog: catalog, branch_id: branch_id, note: note, force: force) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + client.set_default_branch({ catalog: catalog, branch_id: branch_id, note: note, force: force }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + client.set_default_branch(::Google::Cloud::Retail::V2::SetDefaultBranchRequest.new(catalog: catalog, branch_id: branch_id, note: note, force: force), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, set_default_branch_client_stub.call_count + end + end + end + + def test_get_default_branch + # Create test objects. + client_result = ::Google::Cloud::Retail::V2::GetDefaultBranchResponse.new + http_response = OpenStruct.new body: client_result.to_json + + call_options = {} + + # Create request parameters for a unary method. + catalog = "hello world" + + get_default_branch_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| + assert options.metadata.key? :"x-goog-api-client" + assert options.metadata[:"x-goog-api-client"].include? "rest" + refute options.metadata[:"x-goog-api-client"].include? "grpc" + end + + ::Google::Cloud::Retail::V2::CatalogService::Rest::ServiceStub.stub :transcode_get_default_branch_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, get_default_branch_client_stub do + # Create client + client = ::Google::Cloud::Retail::V2::CatalogService::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.get_default_branch({ catalog: catalog }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.get_default_branch catalog: catalog do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.get_default_branch ::Google::Cloud::Retail::V2::GetDefaultBranchRequest.new(catalog: catalog) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + client.get_default_branch({ catalog: catalog }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + client.get_default_branch(::Google::Cloud::Retail::V2::GetDefaultBranchRequest.new(catalog: catalog), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, get_default_branch_client_stub.call_count + end + end + end + + def test_get_completion_config + # Create test objects. + client_result = ::Google::Cloud::Retail::V2::CompletionConfig.new + http_response = OpenStruct.new body: client_result.to_json + + call_options = {} + + # Create request parameters for a unary method. + name = "hello world" + + get_completion_config_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| + assert options.metadata.key? :"x-goog-api-client" + assert options.metadata[:"x-goog-api-client"].include? "rest" + refute options.metadata[:"x-goog-api-client"].include? "grpc" + end + + ::Google::Cloud::Retail::V2::CatalogService::Rest::ServiceStub.stub :transcode_get_completion_config_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, get_completion_config_client_stub do + # Create client + client = ::Google::Cloud::Retail::V2::CatalogService::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.get_completion_config({ name: name }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.get_completion_config name: name do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.get_completion_config ::Google::Cloud::Retail::V2::GetCompletionConfigRequest.new(name: name) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + client.get_completion_config({ name: name }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + client.get_completion_config(::Google::Cloud::Retail::V2::GetCompletionConfigRequest.new(name: name), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, get_completion_config_client_stub.call_count + end + end + end + + def test_update_completion_config + # Create test objects. + client_result = ::Google::Cloud::Retail::V2::CompletionConfig.new + http_response = OpenStruct.new body: client_result.to_json + + call_options = {} + + # Create request parameters for a unary method. + completion_config = {} + update_mask = {} + + update_completion_config_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| + assert options.metadata.key? :"x-goog-api-client" + assert options.metadata[:"x-goog-api-client"].include? "rest" + refute options.metadata[:"x-goog-api-client"].include? "grpc" + end + + ::Google::Cloud::Retail::V2::CatalogService::Rest::ServiceStub.stub :transcode_update_completion_config_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, update_completion_config_client_stub do + # Create client + client = ::Google::Cloud::Retail::V2::CatalogService::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.update_completion_config({ completion_config: completion_config, update_mask: update_mask }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.update_completion_config completion_config: completion_config, update_mask: update_mask do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.update_completion_config ::Google::Cloud::Retail::V2::UpdateCompletionConfigRequest.new(completion_config: completion_config, update_mask: update_mask) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + client.update_completion_config({ completion_config: completion_config, update_mask: update_mask }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + client.update_completion_config(::Google::Cloud::Retail::V2::UpdateCompletionConfigRequest.new(completion_config: completion_config, update_mask: update_mask), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, update_completion_config_client_stub.call_count + end + end + end + + def test_get_attributes_config + # Create test objects. + client_result = ::Google::Cloud::Retail::V2::AttributesConfig.new + http_response = OpenStruct.new body: client_result.to_json + + call_options = {} + + # Create request parameters for a unary method. + name = "hello world" + + get_attributes_config_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| + assert options.metadata.key? :"x-goog-api-client" + assert options.metadata[:"x-goog-api-client"].include? "rest" + refute options.metadata[:"x-goog-api-client"].include? "grpc" + end + + ::Google::Cloud::Retail::V2::CatalogService::Rest::ServiceStub.stub :transcode_get_attributes_config_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, get_attributes_config_client_stub do + # Create client + client = ::Google::Cloud::Retail::V2::CatalogService::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.get_attributes_config({ name: name }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.get_attributes_config name: name do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.get_attributes_config ::Google::Cloud::Retail::V2::GetAttributesConfigRequest.new(name: name) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + client.get_attributes_config({ name: name }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + client.get_attributes_config(::Google::Cloud::Retail::V2::GetAttributesConfigRequest.new(name: name), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, get_attributes_config_client_stub.call_count + end + end + end + + def test_update_attributes_config + # Create test objects. + client_result = ::Google::Cloud::Retail::V2::AttributesConfig.new + http_response = OpenStruct.new body: client_result.to_json + + call_options = {} + + # Create request parameters for a unary method. + attributes_config = {} + update_mask = {} + + update_attributes_config_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| + assert options.metadata.key? :"x-goog-api-client" + assert options.metadata[:"x-goog-api-client"].include? "rest" + refute options.metadata[:"x-goog-api-client"].include? "grpc" + end + + ::Google::Cloud::Retail::V2::CatalogService::Rest::ServiceStub.stub :transcode_update_attributes_config_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, update_attributes_config_client_stub do + # Create client + client = ::Google::Cloud::Retail::V2::CatalogService::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.update_attributes_config({ attributes_config: attributes_config, update_mask: update_mask }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.update_attributes_config attributes_config: attributes_config, update_mask: update_mask do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.update_attributes_config ::Google::Cloud::Retail::V2::UpdateAttributesConfigRequest.new(attributes_config: attributes_config, update_mask: update_mask) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + client.update_attributes_config({ attributes_config: attributes_config, update_mask: update_mask }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + client.update_attributes_config(::Google::Cloud::Retail::V2::UpdateAttributesConfigRequest.new(attributes_config: attributes_config, update_mask: update_mask), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, update_attributes_config_client_stub.call_count + end + end + end + + def test_add_catalog_attribute + # Create test objects. + client_result = ::Google::Cloud::Retail::V2::AttributesConfig.new + http_response = OpenStruct.new body: client_result.to_json + + call_options = {} + + # Create request parameters for a unary method. + attributes_config = "hello world" + catalog_attribute = {} + + add_catalog_attribute_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| + assert options.metadata.key? :"x-goog-api-client" + assert options.metadata[:"x-goog-api-client"].include? "rest" + refute options.metadata[:"x-goog-api-client"].include? "grpc" + end + + ::Google::Cloud::Retail::V2::CatalogService::Rest::ServiceStub.stub :transcode_add_catalog_attribute_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, add_catalog_attribute_client_stub do + # Create client + client = ::Google::Cloud::Retail::V2::CatalogService::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.add_catalog_attribute({ attributes_config: attributes_config, catalog_attribute: catalog_attribute }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.add_catalog_attribute attributes_config: attributes_config, catalog_attribute: catalog_attribute do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.add_catalog_attribute ::Google::Cloud::Retail::V2::AddCatalogAttributeRequest.new(attributes_config: attributes_config, catalog_attribute: catalog_attribute) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + client.add_catalog_attribute({ attributes_config: attributes_config, catalog_attribute: catalog_attribute }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + client.add_catalog_attribute(::Google::Cloud::Retail::V2::AddCatalogAttributeRequest.new(attributes_config: attributes_config, catalog_attribute: catalog_attribute), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, add_catalog_attribute_client_stub.call_count + end + end + end + + def test_remove_catalog_attribute + # Create test objects. + client_result = ::Google::Cloud::Retail::V2::AttributesConfig.new + http_response = OpenStruct.new body: client_result.to_json + + call_options = {} + + # Create request parameters for a unary method. + attributes_config = "hello world" + key = "hello world" + + remove_catalog_attribute_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| + assert options.metadata.key? :"x-goog-api-client" + assert options.metadata[:"x-goog-api-client"].include? "rest" + refute options.metadata[:"x-goog-api-client"].include? "grpc" + end + + ::Google::Cloud::Retail::V2::CatalogService::Rest::ServiceStub.stub :transcode_remove_catalog_attribute_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, remove_catalog_attribute_client_stub do + # Create client + client = ::Google::Cloud::Retail::V2::CatalogService::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.remove_catalog_attribute({ attributes_config: attributes_config, key: key }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.remove_catalog_attribute attributes_config: attributes_config, key: key do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.remove_catalog_attribute ::Google::Cloud::Retail::V2::RemoveCatalogAttributeRequest.new(attributes_config: attributes_config, key: key) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + client.remove_catalog_attribute({ attributes_config: attributes_config, key: key }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + client.remove_catalog_attribute(::Google::Cloud::Retail::V2::RemoveCatalogAttributeRequest.new(attributes_config: attributes_config, key: key), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, remove_catalog_attribute_client_stub.call_count + end + end + end + + def test_replace_catalog_attribute + # Create test objects. + client_result = ::Google::Cloud::Retail::V2::AttributesConfig.new + http_response = OpenStruct.new body: client_result.to_json + + call_options = {} + + # Create request parameters for a unary method. + attributes_config = "hello world" + catalog_attribute = {} + update_mask = {} + + replace_catalog_attribute_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| + assert options.metadata.key? :"x-goog-api-client" + assert options.metadata[:"x-goog-api-client"].include? "rest" + refute options.metadata[:"x-goog-api-client"].include? "grpc" + end + + ::Google::Cloud::Retail::V2::CatalogService::Rest::ServiceStub.stub :transcode_replace_catalog_attribute_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, replace_catalog_attribute_client_stub do + # Create client + client = ::Google::Cloud::Retail::V2::CatalogService::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.replace_catalog_attribute({ attributes_config: attributes_config, catalog_attribute: catalog_attribute, update_mask: update_mask }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.replace_catalog_attribute attributes_config: attributes_config, catalog_attribute: catalog_attribute, update_mask: update_mask do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.replace_catalog_attribute ::Google::Cloud::Retail::V2::ReplaceCatalogAttributeRequest.new(attributes_config: attributes_config, catalog_attribute: catalog_attribute, update_mask: update_mask) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + client.replace_catalog_attribute({ attributes_config: attributes_config, catalog_attribute: catalog_attribute, update_mask: update_mask }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + client.replace_catalog_attribute(::Google::Cloud::Retail::V2::ReplaceCatalogAttributeRequest.new(attributes_config: attributes_config, catalog_attribute: catalog_attribute, update_mask: update_mask), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, replace_catalog_attribute_client_stub.call_count + end + end + end + + def test_configure + credentials_token = :dummy_value + + client = block_config = config = nil + dummy_stub = ClientStub.new nil + Gapic::Rest::ClientStub.stub :new, dummy_stub do + client = ::Google::Cloud::Retail::V2::CatalogService::Rest::Client.new do |config| + config.credentials = credentials_token + end + end + + config = client.configure do |c| + block_config = c + end + + assert_same block_config, config + assert_kind_of ::Google::Cloud::Retail::V2::CatalogService::Rest::Client::Configuration, config + end +end diff --git a/owl-bot-staging/google-cloud-retail-v2/test/google/cloud/retail/v2/catalog_service_test.rb b/owl-bot-staging/google-cloud-retail-v2/test/google/cloud/retail/v2/catalog_service_test.rb new file mode 100644 index 000000000000..7e89b2083b1a --- /dev/null +++ b/owl-bot-staging/google-cloud-retail-v2/test/google/cloud/retail/v2/catalog_service_test.rb @@ -0,0 +1,771 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +require "helper" + +require "gapic/grpc/service_stub" + +require "google/cloud/retail/v2/catalog_service_pb" +require "google/cloud/retail/v2/catalog_service" + +class ::Google::Cloud::Retail::V2::CatalogService::ClientTest < Minitest::Test + class ClientStub + attr_accessor :call_rpc_count, :requests + + def initialize response, operation, &block + @response = response + @operation = operation + @block = block + @call_rpc_count = 0 + @requests = [] + end + + def call_rpc *args, **kwargs + @call_rpc_count += 1 + + @requests << @block&.call(*args, **kwargs) + + catch :response do + yield @response, @operation if block_given? + @response + end + end + + def endpoint + "endpoint.example.com" + end + + def universe_domain + "example.com" + end + + def stub_logger + nil + end + + def logger + nil + end + end + + def test_list_catalogs + # Create GRPC objects. + grpc_response = ::Google::Cloud::Retail::V2::ListCatalogsResponse.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_catalogs_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :list_catalogs, name + assert_kind_of ::Google::Cloud::Retail::V2::ListCatalogsRequest, 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_catalogs_client_stub do + # Create client + client = ::Google::Cloud::Retail::V2::CatalogService::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.list_catalogs({ 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_catalogs 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_catalogs ::Google::Cloud::Retail::V2::ListCatalogsRequest.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_catalogs({ 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_catalogs(::Google::Cloud::Retail::V2::ListCatalogsRequest.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_catalogs_client_stub.call_rpc_count + end + end + + def test_update_catalog + # Create GRPC objects. + grpc_response = ::Google::Cloud::Retail::V2::Catalog.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. + catalog = {} + update_mask = {} + + update_catalog_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :update_catalog, name + assert_kind_of ::Google::Cloud::Retail::V2::UpdateCatalogRequest, request + assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::Retail::V2::Catalog), request["catalog"] + assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Protobuf::FieldMask), request["update_mask"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, update_catalog_client_stub do + # Create client + client = ::Google::Cloud::Retail::V2::CatalogService::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.update_catalog({ catalog: catalog, update_mask: update_mask }) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use named arguments + client.update_catalog catalog: catalog, update_mask: update_mask do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.update_catalog ::Google::Cloud::Retail::V2::UpdateCatalogRequest.new(catalog: catalog, update_mask: update_mask) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use hash object with options + client.update_catalog({ catalog: catalog, update_mask: update_mask }, grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object with options + client.update_catalog(::Google::Cloud::Retail::V2::UpdateCatalogRequest.new(catalog: catalog, update_mask: update_mask), grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Verify method calls + assert_equal 5, update_catalog_client_stub.call_rpc_count + end + end + + def test_set_default_branch + # 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. + catalog = "hello world" + branch_id = "hello world" + note = "hello world" + force = true + + set_default_branch_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :set_default_branch, name + assert_kind_of ::Google::Cloud::Retail::V2::SetDefaultBranchRequest, request + assert_equal "hello world", request["catalog"] + assert_equal "hello world", request["branch_id"] + assert_equal "hello world", request["note"] + assert_equal true, request["force"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, set_default_branch_client_stub do + # Create client + client = ::Google::Cloud::Retail::V2::CatalogService::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.set_default_branch({ catalog: catalog, branch_id: branch_id, note: note, force: force }) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use named arguments + client.set_default_branch catalog: catalog, branch_id: branch_id, note: note, force: force do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.set_default_branch ::Google::Cloud::Retail::V2::SetDefaultBranchRequest.new(catalog: catalog, branch_id: branch_id, note: note, force: force) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use hash object with options + client.set_default_branch({ catalog: catalog, branch_id: branch_id, note: note, force: force }, grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object with options + client.set_default_branch(::Google::Cloud::Retail::V2::SetDefaultBranchRequest.new(catalog: catalog, branch_id: branch_id, note: note, force: force), grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Verify method calls + assert_equal 5, set_default_branch_client_stub.call_rpc_count + end + end + + def test_get_default_branch + # Create GRPC objects. + grpc_response = ::Google::Cloud::Retail::V2::GetDefaultBranchResponse.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. + catalog = "hello world" + + get_default_branch_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :get_default_branch, name + assert_kind_of ::Google::Cloud::Retail::V2::GetDefaultBranchRequest, request + assert_equal "hello world", request["catalog"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, get_default_branch_client_stub do + # Create client + client = ::Google::Cloud::Retail::V2::CatalogService::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.get_default_branch({ catalog: catalog }) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use named arguments + client.get_default_branch catalog: catalog do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.get_default_branch ::Google::Cloud::Retail::V2::GetDefaultBranchRequest.new(catalog: catalog) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use hash object with options + client.get_default_branch({ catalog: catalog }, grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object with options + client.get_default_branch(::Google::Cloud::Retail::V2::GetDefaultBranchRequest.new(catalog: catalog), grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Verify method calls + assert_equal 5, get_default_branch_client_stub.call_rpc_count + end + end + + def test_get_completion_config + # Create GRPC objects. + grpc_response = ::Google::Cloud::Retail::V2::CompletionConfig.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_completion_config_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :get_completion_config, name + assert_kind_of ::Google::Cloud::Retail::V2::GetCompletionConfigRequest, request + assert_equal "hello world", request["name"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, get_completion_config_client_stub do + # Create client + client = ::Google::Cloud::Retail::V2::CatalogService::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.get_completion_config({ name: name }) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use named arguments + client.get_completion_config name: name do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.get_completion_config ::Google::Cloud::Retail::V2::GetCompletionConfigRequest.new(name: name) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use hash object with options + client.get_completion_config({ name: name }, grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object with options + client.get_completion_config(::Google::Cloud::Retail::V2::GetCompletionConfigRequest.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_completion_config_client_stub.call_rpc_count + end + end + + def test_update_completion_config + # Create GRPC objects. + grpc_response = ::Google::Cloud::Retail::V2::CompletionConfig.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. + completion_config = {} + update_mask = {} + + update_completion_config_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :update_completion_config, name + assert_kind_of ::Google::Cloud::Retail::V2::UpdateCompletionConfigRequest, request + assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::Retail::V2::CompletionConfig), request["completion_config"] + assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Protobuf::FieldMask), request["update_mask"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, update_completion_config_client_stub do + # Create client + client = ::Google::Cloud::Retail::V2::CatalogService::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.update_completion_config({ completion_config: completion_config, update_mask: update_mask }) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use named arguments + client.update_completion_config completion_config: completion_config, update_mask: update_mask do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.update_completion_config ::Google::Cloud::Retail::V2::UpdateCompletionConfigRequest.new(completion_config: completion_config, update_mask: update_mask) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use hash object with options + client.update_completion_config({ completion_config: completion_config, update_mask: update_mask }, grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object with options + client.update_completion_config(::Google::Cloud::Retail::V2::UpdateCompletionConfigRequest.new(completion_config: completion_config, update_mask: update_mask), grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Verify method calls + assert_equal 5, update_completion_config_client_stub.call_rpc_count + end + end + + def test_get_attributes_config + # Create GRPC objects. + grpc_response = ::Google::Cloud::Retail::V2::AttributesConfig.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_attributes_config_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :get_attributes_config, name + assert_kind_of ::Google::Cloud::Retail::V2::GetAttributesConfigRequest, request + assert_equal "hello world", request["name"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, get_attributes_config_client_stub do + # Create client + client = ::Google::Cloud::Retail::V2::CatalogService::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.get_attributes_config({ name: name }) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use named arguments + client.get_attributes_config name: name do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.get_attributes_config ::Google::Cloud::Retail::V2::GetAttributesConfigRequest.new(name: name) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use hash object with options + client.get_attributes_config({ name: name }, grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object with options + client.get_attributes_config(::Google::Cloud::Retail::V2::GetAttributesConfigRequest.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_attributes_config_client_stub.call_rpc_count + end + end + + def test_update_attributes_config + # Create GRPC objects. + grpc_response = ::Google::Cloud::Retail::V2::AttributesConfig.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. + attributes_config = {} + update_mask = {} + + update_attributes_config_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :update_attributes_config, name + assert_kind_of ::Google::Cloud::Retail::V2::UpdateAttributesConfigRequest, request + assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::Retail::V2::AttributesConfig), request["attributes_config"] + assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Protobuf::FieldMask), request["update_mask"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, update_attributes_config_client_stub do + # Create client + client = ::Google::Cloud::Retail::V2::CatalogService::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.update_attributes_config({ attributes_config: attributes_config, update_mask: update_mask }) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use named arguments + client.update_attributes_config attributes_config: attributes_config, update_mask: update_mask do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.update_attributes_config ::Google::Cloud::Retail::V2::UpdateAttributesConfigRequest.new(attributes_config: attributes_config, update_mask: update_mask) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use hash object with options + client.update_attributes_config({ attributes_config: attributes_config, update_mask: update_mask }, grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object with options + client.update_attributes_config(::Google::Cloud::Retail::V2::UpdateAttributesConfigRequest.new(attributes_config: attributes_config, update_mask: update_mask), grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Verify method calls + assert_equal 5, update_attributes_config_client_stub.call_rpc_count + end + end + + def test_add_catalog_attribute + # Create GRPC objects. + grpc_response = ::Google::Cloud::Retail::V2::AttributesConfig.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. + attributes_config = "hello world" + catalog_attribute = {} + + add_catalog_attribute_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :add_catalog_attribute, name + assert_kind_of ::Google::Cloud::Retail::V2::AddCatalogAttributeRequest, request + assert_equal "hello world", request["attributes_config"] + assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::Retail::V2::CatalogAttribute), request["catalog_attribute"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, add_catalog_attribute_client_stub do + # Create client + client = ::Google::Cloud::Retail::V2::CatalogService::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.add_catalog_attribute({ attributes_config: attributes_config, catalog_attribute: catalog_attribute }) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use named arguments + client.add_catalog_attribute attributes_config: attributes_config, catalog_attribute: catalog_attribute do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.add_catalog_attribute ::Google::Cloud::Retail::V2::AddCatalogAttributeRequest.new(attributes_config: attributes_config, catalog_attribute: catalog_attribute) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use hash object with options + client.add_catalog_attribute({ attributes_config: attributes_config, catalog_attribute: catalog_attribute }, grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object with options + client.add_catalog_attribute(::Google::Cloud::Retail::V2::AddCatalogAttributeRequest.new(attributes_config: attributes_config, catalog_attribute: catalog_attribute), grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Verify method calls + assert_equal 5, add_catalog_attribute_client_stub.call_rpc_count + end + end + + def test_remove_catalog_attribute + # Create GRPC objects. + grpc_response = ::Google::Cloud::Retail::V2::AttributesConfig.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. + attributes_config = "hello world" + key = "hello world" + + remove_catalog_attribute_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :remove_catalog_attribute, name + assert_kind_of ::Google::Cloud::Retail::V2::RemoveCatalogAttributeRequest, request + assert_equal "hello world", request["attributes_config"] + assert_equal "hello world", request["key"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, remove_catalog_attribute_client_stub do + # Create client + client = ::Google::Cloud::Retail::V2::CatalogService::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.remove_catalog_attribute({ attributes_config: attributes_config, key: key }) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use named arguments + client.remove_catalog_attribute attributes_config: attributes_config, key: key do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.remove_catalog_attribute ::Google::Cloud::Retail::V2::RemoveCatalogAttributeRequest.new(attributes_config: attributes_config, key: key) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use hash object with options + client.remove_catalog_attribute({ attributes_config: attributes_config, key: key }, grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object with options + client.remove_catalog_attribute(::Google::Cloud::Retail::V2::RemoveCatalogAttributeRequest.new(attributes_config: attributes_config, key: key), grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Verify method calls + assert_equal 5, remove_catalog_attribute_client_stub.call_rpc_count + end + end + + def test_replace_catalog_attribute + # Create GRPC objects. + grpc_response = ::Google::Cloud::Retail::V2::AttributesConfig.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. + attributes_config = "hello world" + catalog_attribute = {} + update_mask = {} + + replace_catalog_attribute_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :replace_catalog_attribute, name + assert_kind_of ::Google::Cloud::Retail::V2::ReplaceCatalogAttributeRequest, request + assert_equal "hello world", request["attributes_config"] + assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::Retail::V2::CatalogAttribute), request["catalog_attribute"] + assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Protobuf::FieldMask), request["update_mask"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, replace_catalog_attribute_client_stub do + # Create client + client = ::Google::Cloud::Retail::V2::CatalogService::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.replace_catalog_attribute({ attributes_config: attributes_config, catalog_attribute: catalog_attribute, update_mask: update_mask }) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use named arguments + client.replace_catalog_attribute attributes_config: attributes_config, catalog_attribute: catalog_attribute, update_mask: update_mask do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.replace_catalog_attribute ::Google::Cloud::Retail::V2::ReplaceCatalogAttributeRequest.new(attributes_config: attributes_config, catalog_attribute: catalog_attribute, update_mask: update_mask) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use hash object with options + client.replace_catalog_attribute({ attributes_config: attributes_config, catalog_attribute: catalog_attribute, update_mask: update_mask }, grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object with options + client.replace_catalog_attribute(::Google::Cloud::Retail::V2::ReplaceCatalogAttributeRequest.new(attributes_config: attributes_config, catalog_attribute: catalog_attribute, update_mask: update_mask), grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Verify method calls + assert_equal 5, replace_catalog_attribute_client_stub.call_rpc_count + end + end + + def test_configure + grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + + client = block_config = config = nil + dummy_stub = ClientStub.new nil, nil + Gapic::ServiceStub.stub :new, dummy_stub do + client = ::Google::Cloud::Retail::V2::CatalogService::Client.new do |config| + config.credentials = grpc_channel + end + end + + config = client.configure do |c| + block_config = c + end + + assert_same block_config, config + assert_kind_of ::Google::Cloud::Retail::V2::CatalogService::Client::Configuration, config + end + + def test_credentials + key = OpenSSL::PKey::RSA.new 2048 + cred_json = { + "private_key" => key.to_pem, + "client_email" => "app@developer.gserviceaccount.com", + "type" => "service_account" + } + key_file = StringIO.new cred_json.to_json + creds = Google::Auth::ServiceAccountCredentials.make_creds({ json_key_io: key_file }) + + dummy_stub = ClientStub.new nil, nil + Gapic::ServiceStub.stub :new, dummy_stub do + client = ::Google::Cloud::Retail::V2::CatalogService::Client.new do |config| + config.credentials = creds + end + assert_kind_of ::Google::Cloud::Retail::V2::CatalogService::Client, client + assert_equal creds, client.configure.credentials + end + end +end diff --git a/owl-bot-staging/google-cloud-retail-v2/test/google/cloud/retail/v2/completion_service_operations_test.rb b/owl-bot-staging/google-cloud-retail-v2/test/google/cloud/retail/v2/completion_service_operations_test.rb new file mode 100644 index 000000000000..cf6f4f6ee7bf --- /dev/null +++ b/owl-bot-staging/google-cloud-retail-v2/test/google/cloud/retail/v2/completion_service_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/cloud/retail/v2/completion_service_pb" +require "google/cloud/retail/v2/completion_service_services_pb" +require "google/cloud/retail/v2/completion_service" + +class ::Google::Cloud::Retail::V2::CompletionService::OperationsTest < Minitest::Test + class ClientStub + attr_accessor :call_rpc_count, :requests + + def initialize response, operation, &block + @response = response + @operation = operation + @block = block + @call_rpc_count = 0 + @requests = [] + end + + def call_rpc *args, **kwargs + @call_rpc_count += 1 + + @requests << @block&.call(*args, **kwargs) + + catch :response do + yield @response, @operation if block_given? + @response + end + end + + def endpoint + "endpoint.example.com" + end + + def universe_domain + "example.com" + end + + def stub_logger + nil + end + + def logger + nil + end + end + + def test_list_operations + # Create GRPC objects. + grpc_response = ::Google::Longrunning::ListOperationsResponse.new + grpc_operation = GRPC::ActiveCall::Operation.new nil + grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + grpc_options = {} + + # Create request parameters for a unary method. + name = "hello world" + filter = "hello world" + page_size = 42 + page_token = "hello world" + return_partial_success = true + + list_operations_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :list_operations, name + assert_kind_of ::Google::Longrunning::ListOperationsRequest, request + assert_equal "hello world", request["name"] + assert_equal "hello world", request["filter"] + assert_equal 42, request["page_size"] + assert_equal "hello world", request["page_token"] + assert_equal true, request["return_partial_success"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, list_operations_client_stub do + # Create client + client = ::Google::Cloud::Retail::V2::CompletionService::Operations.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.list_operations({ name: name, filter: filter, page_size: page_size, page_token: page_token, return_partial_success: return_partial_success }) do |response, operation| + assert_kind_of Gapic::PagedEnumerable, response + assert_equal grpc_response, response.response + assert_equal grpc_operation, operation + end + + # Use named arguments + client.list_operations name: name, filter: filter, page_size: page_size, page_token: page_token, return_partial_success: return_partial_success do |response, operation| + assert_kind_of Gapic::PagedEnumerable, response + assert_equal grpc_response, response.response + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.list_operations ::Google::Longrunning::ListOperationsRequest.new(name: name, filter: filter, page_size: page_size, page_token: page_token, return_partial_success: return_partial_success) do |response, operation| + assert_kind_of Gapic::PagedEnumerable, response + assert_equal grpc_response, response.response + assert_equal grpc_operation, operation + end + + # Use hash object with options + client.list_operations({ name: name, filter: filter, page_size: page_size, page_token: page_token, return_partial_success: return_partial_success }, grpc_options) do |response, operation| + assert_kind_of Gapic::PagedEnumerable, response + assert_equal grpc_response, response.response + assert_equal grpc_operation, operation + end + + # Use protobuf object with options + client.list_operations(::Google::Longrunning::ListOperationsRequest.new(name: name, filter: filter, page_size: page_size, page_token: page_token, return_partial_success: return_partial_success), grpc_options) do |response, operation| + assert_kind_of Gapic::PagedEnumerable, response + assert_equal grpc_response, response.response + assert_equal grpc_operation, operation + end + + # Verify method calls + assert_equal 5, list_operations_client_stub.call_rpc_count + end + end + + def test_get_operation + # Create GRPC objects. + grpc_response = ::Google::Longrunning::Operation.new + grpc_operation = GRPC::ActiveCall::Operation.new nil + grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + grpc_options = {} + + # Create request parameters for a unary method. + name = "hello world" + + get_operation_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :get_operation, name + assert_kind_of ::Google::Longrunning::GetOperationRequest, request + assert_equal "hello world", request["name"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, get_operation_client_stub do + # Create client + client = ::Google::Cloud::Retail::V2::CompletionService::Operations.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.get_operation({ name: name }) do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Use named arguments + client.get_operation name: name do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.get_operation ::Google::Longrunning::GetOperationRequest.new(name: name) do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Use hash object with options + client.get_operation({ name: name }, grpc_options) do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Use protobuf object with options + client.get_operation(::Google::Longrunning::GetOperationRequest.new(name: name), grpc_options) do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Verify method calls + assert_equal 5, get_operation_client_stub.call_rpc_count + end + end + + def test_delete_operation + # Create GRPC objects. + grpc_response = ::Google::Protobuf::Empty.new + grpc_operation = GRPC::ActiveCall::Operation.new nil + grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + grpc_options = {} + + # Create request parameters for a unary method. + name = "hello world" + + delete_operation_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :delete_operation, name + assert_kind_of ::Google::Longrunning::DeleteOperationRequest, request + assert_equal "hello world", request["name"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, delete_operation_client_stub do + # Create client + client = ::Google::Cloud::Retail::V2::CompletionService::Operations.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.delete_operation({ name: name }) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use named arguments + client.delete_operation name: name do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.delete_operation ::Google::Longrunning::DeleteOperationRequest.new(name: name) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use hash object with options + client.delete_operation({ name: name }, grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object with options + client.delete_operation(::Google::Longrunning::DeleteOperationRequest.new(name: name), grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Verify method calls + assert_equal 5, delete_operation_client_stub.call_rpc_count + end + end + + def test_cancel_operation + # Create GRPC objects. + grpc_response = ::Google::Protobuf::Empty.new + grpc_operation = GRPC::ActiveCall::Operation.new nil + grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + grpc_options = {} + + # Create request parameters for a unary method. + name = "hello world" + + cancel_operation_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :cancel_operation, name + assert_kind_of ::Google::Longrunning::CancelOperationRequest, request + assert_equal "hello world", request["name"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, cancel_operation_client_stub do + # Create client + client = ::Google::Cloud::Retail::V2::CompletionService::Operations.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.cancel_operation({ name: name }) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use named arguments + client.cancel_operation name: name do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.cancel_operation ::Google::Longrunning::CancelOperationRequest.new(name: name) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use hash object with options + client.cancel_operation({ name: name }, grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object with options + client.cancel_operation(::Google::Longrunning::CancelOperationRequest.new(name: name), grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Verify method calls + assert_equal 5, cancel_operation_client_stub.call_rpc_count + end + end + + def test_wait_operation + # Create GRPC objects. + grpc_response = ::Google::Longrunning::Operation.new + grpc_operation = GRPC::ActiveCall::Operation.new nil + grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + grpc_options = {} + + # Create request parameters for a unary method. + name = "hello world" + timeout = {} + + wait_operation_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :wait_operation, name + assert_kind_of ::Google::Longrunning::WaitOperationRequest, request + assert_equal "hello world", request["name"] + assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Protobuf::Duration), request["timeout"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, wait_operation_client_stub do + # Create client + client = ::Google::Cloud::Retail::V2::CompletionService::Operations.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.wait_operation({ name: name, timeout: timeout }) do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Use named arguments + client.wait_operation name: name, timeout: timeout do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.wait_operation ::Google::Longrunning::WaitOperationRequest.new(name: name, timeout: timeout) do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Use hash object with options + client.wait_operation({ name: name, timeout: timeout }, grpc_options) do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Use protobuf object with options + client.wait_operation(::Google::Longrunning::WaitOperationRequest.new(name: name, timeout: timeout), grpc_options) do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Verify method calls + assert_equal 5, wait_operation_client_stub.call_rpc_count + end + end + + def test_configure + grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + + client = block_config = config = nil + dummy_stub = ClientStub.new nil, nil + Gapic::ServiceStub.stub :new, dummy_stub do + client = ::Google::Cloud::Retail::V2::CompletionService::Operations.new do |config| + config.credentials = grpc_channel + end + end + + config = client.configure do |c| + block_config = c + end + + assert_same block_config, config + assert_kind_of ::Google::Cloud::Retail::V2::CompletionService::Operations::Configuration, config + end +end diff --git a/owl-bot-staging/google-cloud-retail-v2/test/google/cloud/retail/v2/completion_service_paths_test.rb b/owl-bot-staging/google-cloud-retail-v2/test/google/cloud/retail/v2/completion_service_paths_test.rb new file mode 100644 index 000000000000..1fdf7e2de46a --- /dev/null +++ b/owl-bot-staging/google-cloud-retail-v2/test/google/cloud/retail/v2/completion_service_paths_test.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 "helper" + +require "gapic/grpc/service_stub" + +require "google/cloud/retail/v2/completion_service" + +class ::Google::Cloud::Retail::V2::CompletionService::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_catalog_path + grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + ::Gapic::ServiceStub.stub :new, DummyStub.new do + client = ::Google::Cloud::Retail::V2::CompletionService::Client.new do |config| + config.credentials = grpc_channel + end + + path = client.catalog_path project: "value0", location: "value1", catalog: "value2" + assert_equal "projects/value0/locations/value1/catalogs/value2", path + end + end +end diff --git a/owl-bot-staging/google-cloud-retail-v2/test/google/cloud/retail/v2/completion_service_rest_test.rb b/owl-bot-staging/google-cloud-retail-v2/test/google/cloud/retail/v2/completion_service_rest_test.rb new file mode 100644 index 000000000000..8e7fbac8d56d --- /dev/null +++ b/owl-bot-staging/google-cloud-retail-v2/test/google/cloud/retail/v2/completion_service_rest_test.rb @@ -0,0 +1,217 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +require "helper" +require "gapic/rest" +require "google/cloud/retail/v2/completion_service_pb" +require "google/cloud/retail/v2/completion_service/rest" + + +class ::Google::Cloud::Retail::V2::CompletionService::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_complete_query + # Create test objects. + client_result = ::Google::Cloud::Retail::V2::CompleteQueryResponse.new + http_response = OpenStruct.new body: client_result.to_json + + call_options = {} + + # Create request parameters for a unary method. + catalog = "hello world" + query = "hello world" + visitor_id = "hello world" + language_codes = ["hello world"] + device_type = "hello world" + dataset = "hello world" + max_suggestions = 42 + enable_attribute_suggestions = true + entity = "hello world" + + complete_query_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| + assert options.metadata.key? :"x-goog-api-client" + assert options.metadata[:"x-goog-api-client"].include? "rest" + refute options.metadata[:"x-goog-api-client"].include? "grpc" + end + + ::Google::Cloud::Retail::V2::CompletionService::Rest::ServiceStub.stub :transcode_complete_query_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, complete_query_client_stub do + # Create client + client = ::Google::Cloud::Retail::V2::CompletionService::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.complete_query({ catalog: catalog, query: query, visitor_id: visitor_id, language_codes: language_codes, device_type: device_type, dataset: dataset, max_suggestions: max_suggestions, enable_attribute_suggestions: enable_attribute_suggestions, entity: entity }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.complete_query catalog: catalog, query: query, visitor_id: visitor_id, language_codes: language_codes, device_type: device_type, dataset: dataset, max_suggestions: max_suggestions, enable_attribute_suggestions: enable_attribute_suggestions, entity: entity do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.complete_query ::Google::Cloud::Retail::V2::CompleteQueryRequest.new(catalog: catalog, query: query, visitor_id: visitor_id, language_codes: language_codes, device_type: device_type, dataset: dataset, max_suggestions: max_suggestions, enable_attribute_suggestions: enable_attribute_suggestions, entity: entity) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + client.complete_query({ catalog: catalog, query: query, visitor_id: visitor_id, language_codes: language_codes, device_type: device_type, dataset: dataset, max_suggestions: max_suggestions, enable_attribute_suggestions: enable_attribute_suggestions, entity: entity }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + client.complete_query(::Google::Cloud::Retail::V2::CompleteQueryRequest.new(catalog: catalog, query: query, visitor_id: visitor_id, language_codes: language_codes, device_type: device_type, dataset: dataset, max_suggestions: max_suggestions, enable_attribute_suggestions: enable_attribute_suggestions, entity: entity), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, complete_query_client_stub.call_count + end + end + end + + def test_import_completion_data + # 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" + input_config = {} + notification_pubsub_topic = "hello world" + + import_completion_data_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| + assert options.metadata.key? :"x-goog-api-client" + assert options.metadata[:"x-goog-api-client"].include? "rest" + refute options.metadata[:"x-goog-api-client"].include? "grpc" + end + + ::Google::Cloud::Retail::V2::CompletionService::Rest::ServiceStub.stub :transcode_import_completion_data_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, import_completion_data_client_stub do + # Create client + client = ::Google::Cloud::Retail::V2::CompletionService::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.import_completion_data({ parent: parent, input_config: input_config, notification_pubsub_topic: notification_pubsub_topic }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.import_completion_data parent: parent, input_config: input_config, notification_pubsub_topic: notification_pubsub_topic do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.import_completion_data ::Google::Cloud::Retail::V2::ImportCompletionDataRequest.new(parent: parent, input_config: input_config, notification_pubsub_topic: notification_pubsub_topic) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + client.import_completion_data({ parent: parent, input_config: input_config, notification_pubsub_topic: notification_pubsub_topic }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + client.import_completion_data(::Google::Cloud::Retail::V2::ImportCompletionDataRequest.new(parent: parent, input_config: input_config, notification_pubsub_topic: notification_pubsub_topic), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, import_completion_data_client_stub.call_count + end + end + end + + def test_configure + credentials_token = :dummy_value + + client = block_config = config = nil + dummy_stub = ClientStub.new nil + Gapic::Rest::ClientStub.stub :new, dummy_stub do + client = ::Google::Cloud::Retail::V2::CompletionService::Rest::Client.new do |config| + config.credentials = credentials_token + end + end + + config = client.configure do |c| + block_config = c + end + + assert_same block_config, config + assert_kind_of ::Google::Cloud::Retail::V2::CompletionService::Rest::Client::Configuration, config + end +end diff --git a/owl-bot-staging/google-cloud-retail-v2/test/google/cloud/retail/v2/completion_service_test.rb b/owl-bot-staging/google-cloud-retail-v2/test/google/cloud/retail/v2/completion_service_test.rb new file mode 100644 index 000000000000..dd4f6de59807 --- /dev/null +++ b/owl-bot-staging/google-cloud-retail-v2/test/google/cloud/retail/v2/completion_service_test.rb @@ -0,0 +1,259 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +require "helper" + +require "gapic/grpc/service_stub" + +require "google/cloud/retail/v2/completion_service_pb" +require "google/cloud/retail/v2/completion_service" + +class ::Google::Cloud::Retail::V2::CompletionService::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_complete_query + # Create GRPC objects. + grpc_response = ::Google::Cloud::Retail::V2::CompleteQueryResponse.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. + catalog = "hello world" + query = "hello world" + visitor_id = "hello world" + language_codes = ["hello world"] + device_type = "hello world" + dataset = "hello world" + max_suggestions = 42 + enable_attribute_suggestions = true + entity = "hello world" + + complete_query_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :complete_query, name + assert_kind_of ::Google::Cloud::Retail::V2::CompleteQueryRequest, request + assert_equal "hello world", request["catalog"] + assert_equal "hello world", request["query"] + assert_equal "hello world", request["visitor_id"] + assert_equal ["hello world"], request["language_codes"] + assert_equal "hello world", request["device_type"] + assert_equal "hello world", request["dataset"] + assert_equal 42, request["max_suggestions"] + assert_equal true, request["enable_attribute_suggestions"] + assert_equal "hello world", request["entity"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, complete_query_client_stub do + # Create client + client = ::Google::Cloud::Retail::V2::CompletionService::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.complete_query({ catalog: catalog, query: query, visitor_id: visitor_id, language_codes: language_codes, device_type: device_type, dataset: dataset, max_suggestions: max_suggestions, enable_attribute_suggestions: enable_attribute_suggestions, entity: entity }) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use named arguments + client.complete_query catalog: catalog, query: query, visitor_id: visitor_id, language_codes: language_codes, device_type: device_type, dataset: dataset, max_suggestions: max_suggestions, enable_attribute_suggestions: enable_attribute_suggestions, entity: entity do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.complete_query ::Google::Cloud::Retail::V2::CompleteQueryRequest.new(catalog: catalog, query: query, visitor_id: visitor_id, language_codes: language_codes, device_type: device_type, dataset: dataset, max_suggestions: max_suggestions, enable_attribute_suggestions: enable_attribute_suggestions, entity: entity) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use hash object with options + client.complete_query({ catalog: catalog, query: query, visitor_id: visitor_id, language_codes: language_codes, device_type: device_type, dataset: dataset, max_suggestions: max_suggestions, enable_attribute_suggestions: enable_attribute_suggestions, entity: entity }, grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object with options + client.complete_query(::Google::Cloud::Retail::V2::CompleteQueryRequest.new(catalog: catalog, query: query, visitor_id: visitor_id, language_codes: language_codes, device_type: device_type, dataset: dataset, max_suggestions: max_suggestions, enable_attribute_suggestions: enable_attribute_suggestions, entity: entity), grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Verify method calls + assert_equal 5, complete_query_client_stub.call_rpc_count + end + end + + def test_import_completion_data + # 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" + input_config = {} + notification_pubsub_topic = "hello world" + + import_completion_data_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :import_completion_data, name + assert_kind_of ::Google::Cloud::Retail::V2::ImportCompletionDataRequest, request + assert_equal "hello world", request["parent"] + assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::Retail::V2::CompletionDataInputConfig), request["input_config"] + assert_equal "hello world", request["notification_pubsub_topic"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, import_completion_data_client_stub do + # Create client + client = ::Google::Cloud::Retail::V2::CompletionService::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.import_completion_data({ parent: parent, input_config: input_config, notification_pubsub_topic: notification_pubsub_topic }) 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.import_completion_data parent: parent, input_config: input_config, notification_pubsub_topic: notification_pubsub_topic 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.import_completion_data ::Google::Cloud::Retail::V2::ImportCompletionDataRequest.new(parent: parent, input_config: input_config, notification_pubsub_topic: notification_pubsub_topic) 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.import_completion_data({ parent: parent, input_config: input_config, notification_pubsub_topic: notification_pubsub_topic }, 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.import_completion_data(::Google::Cloud::Retail::V2::ImportCompletionDataRequest.new(parent: parent, input_config: input_config, notification_pubsub_topic: notification_pubsub_topic), 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, import_completion_data_client_stub.call_rpc_count + end + end + + def test_configure + grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + + client = block_config = config = nil + dummy_stub = ClientStub.new nil, nil + Gapic::ServiceStub.stub :new, dummy_stub do + client = ::Google::Cloud::Retail::V2::CompletionService::Client.new do |config| + config.credentials = grpc_channel + end + end + + config = client.configure do |c| + block_config = c + end + + assert_same block_config, config + assert_kind_of ::Google::Cloud::Retail::V2::CompletionService::Client::Configuration, config + end + + def test_credentials + key = OpenSSL::PKey::RSA.new 2048 + cred_json = { + "private_key" => key.to_pem, + "client_email" => "app@developer.gserviceaccount.com", + "type" => "service_account" + } + key_file = StringIO.new cred_json.to_json + creds = Google::Auth::ServiceAccountCredentials.make_creds({ json_key_io: key_file }) + + dummy_stub = ClientStub.new nil, nil + Gapic::ServiceStub.stub :new, dummy_stub do + client = ::Google::Cloud::Retail::V2::CompletionService::Client.new do |config| + config.credentials = creds + end + assert_kind_of ::Google::Cloud::Retail::V2::CompletionService::Client, client + assert_equal creds, client.configure.credentials + end + end + + def test_operations_client + grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + + client = nil + dummy_stub = ClientStub.new nil, nil + Gapic::ServiceStub.stub :new, dummy_stub do + client = ::Google::Cloud::Retail::V2::CompletionService::Client.new do |config| + config.credentials = grpc_channel + end + end + + assert_kind_of ::Google::Cloud::Retail::V2::CompletionService::Operations, client.operations_client + end +end diff --git a/owl-bot-staging/google-cloud-retail-v2/test/google/cloud/retail/v2/control_service_paths_test.rb b/owl-bot-staging/google-cloud-retail-v2/test/google/cloud/retail/v2/control_service_paths_test.rb new file mode 100644 index 000000000000..3a2ba3c8bc0f --- /dev/null +++ b/owl-bot-staging/google-cloud-retail-v2/test/google/cloud/retail/v2/control_service_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/cloud/retail/v2/control_service" + +class ::Google::Cloud::Retail::V2::ControlService::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_catalog_path + grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + ::Gapic::ServiceStub.stub :new, DummyStub.new do + client = ::Google::Cloud::Retail::V2::ControlService::Client.new do |config| + config.credentials = grpc_channel + end + + path = client.catalog_path project: "value0", location: "value1", catalog: "value2" + assert_equal "projects/value0/locations/value1/catalogs/value2", path + end + end + + def test_control_path + grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + ::Gapic::ServiceStub.stub :new, DummyStub.new do + client = ::Google::Cloud::Retail::V2::ControlService::Client.new do |config| + config.credentials = grpc_channel + end + + path = client.control_path project: "value0", location: "value1", catalog: "value2", control: "value3" + assert_equal "projects/value0/locations/value1/catalogs/value2/controls/value3", path + end + end +end diff --git a/owl-bot-staging/google-cloud-retail-v2/test/google/cloud/retail/v2/control_service_rest_test.rb b/owl-bot-staging/google-cloud-retail-v2/test/google/cloud/retail/v2/control_service_rest_test.rb new file mode 100644 index 000000000000..3bc359d864c3 --- /dev/null +++ b/owl-bot-staging/google-cloud-retail-v2/test/google/cloud/retail/v2/control_service_rest_test.rb @@ -0,0 +1,375 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +require "helper" +require "gapic/rest" +require "google/cloud/retail/v2/control_service_pb" +require "google/cloud/retail/v2/control_service/rest" + + +class ::Google::Cloud::Retail::V2::ControlService::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_control + # Create test objects. + client_result = ::Google::Cloud::Retail::V2::Control.new + http_response = OpenStruct.new body: client_result.to_json + + call_options = {} + + # Create request parameters for a unary method. + parent = "hello world" + control = {} + control_id = "hello world" + + create_control_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| + assert options.metadata.key? :"x-goog-api-client" + assert options.metadata[:"x-goog-api-client"].include? "rest" + refute options.metadata[:"x-goog-api-client"].include? "grpc" + end + + ::Google::Cloud::Retail::V2::ControlService::Rest::ServiceStub.stub :transcode_create_control_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, create_control_client_stub do + # Create client + client = ::Google::Cloud::Retail::V2::ControlService::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.create_control({ parent: parent, control: control, control_id: control_id }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.create_control parent: parent, control: control, control_id: control_id do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.create_control ::Google::Cloud::Retail::V2::CreateControlRequest.new(parent: parent, control: control, control_id: control_id) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + client.create_control({ parent: parent, control: control, control_id: control_id }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + client.create_control(::Google::Cloud::Retail::V2::CreateControlRequest.new(parent: parent, control: control, control_id: control_id), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, create_control_client_stub.call_count + end + end + end + + def test_delete_control + # Create test objects. + client_result = ::Google::Protobuf::Empty.new + http_response = OpenStruct.new body: client_result.to_json + + call_options = {} + + # Create request parameters for a unary method. + name = "hello world" + + delete_control_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| + assert options.metadata.key? :"x-goog-api-client" + assert options.metadata[:"x-goog-api-client"].include? "rest" + refute options.metadata[:"x-goog-api-client"].include? "grpc" + end + + ::Google::Cloud::Retail::V2::ControlService::Rest::ServiceStub.stub :transcode_delete_control_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, delete_control_client_stub do + # Create client + client = ::Google::Cloud::Retail::V2::ControlService::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.delete_control({ name: name }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.delete_control name: name do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.delete_control ::Google::Cloud::Retail::V2::DeleteControlRequest.new(name: name) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + client.delete_control({ name: name }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + client.delete_control(::Google::Cloud::Retail::V2::DeleteControlRequest.new(name: name), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, delete_control_client_stub.call_count + end + end + end + + def test_update_control + # Create test objects. + client_result = ::Google::Cloud::Retail::V2::Control.new + http_response = OpenStruct.new body: client_result.to_json + + call_options = {} + + # Create request parameters for a unary method. + control = {} + update_mask = {} + + update_control_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| + assert options.metadata.key? :"x-goog-api-client" + assert options.metadata[:"x-goog-api-client"].include? "rest" + refute options.metadata[:"x-goog-api-client"].include? "grpc" + end + + ::Google::Cloud::Retail::V2::ControlService::Rest::ServiceStub.stub :transcode_update_control_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, update_control_client_stub do + # Create client + client = ::Google::Cloud::Retail::V2::ControlService::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.update_control({ control: control, update_mask: update_mask }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.update_control control: control, update_mask: update_mask do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.update_control ::Google::Cloud::Retail::V2::UpdateControlRequest.new(control: control, update_mask: update_mask) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + client.update_control({ control: control, update_mask: update_mask }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + client.update_control(::Google::Cloud::Retail::V2::UpdateControlRequest.new(control: control, update_mask: update_mask), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, update_control_client_stub.call_count + end + end + end + + def test_get_control + # Create test objects. + client_result = ::Google::Cloud::Retail::V2::Control.new + http_response = OpenStruct.new body: client_result.to_json + + call_options = {} + + # Create request parameters for a unary method. + name = "hello world" + + get_control_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| + assert options.metadata.key? :"x-goog-api-client" + assert options.metadata[:"x-goog-api-client"].include? "rest" + refute options.metadata[:"x-goog-api-client"].include? "grpc" + end + + ::Google::Cloud::Retail::V2::ControlService::Rest::ServiceStub.stub :transcode_get_control_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, get_control_client_stub do + # Create client + client = ::Google::Cloud::Retail::V2::ControlService::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.get_control({ name: name }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.get_control name: name do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.get_control ::Google::Cloud::Retail::V2::GetControlRequest.new(name: name) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + client.get_control({ name: name }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + client.get_control(::Google::Cloud::Retail::V2::GetControlRequest.new(name: name), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, get_control_client_stub.call_count + end + end + end + + def test_list_controls + # Create test objects. + client_result = ::Google::Cloud::Retail::V2::ListControlsResponse.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_controls_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| + assert options.metadata.key? :"x-goog-api-client" + assert options.metadata[:"x-goog-api-client"].include? "rest" + refute options.metadata[:"x-goog-api-client"].include? "grpc" + end + + ::Google::Cloud::Retail::V2::ControlService::Rest::ServiceStub.stub :transcode_list_controls_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, list_controls_client_stub do + # Create client + client = ::Google::Cloud::Retail::V2::ControlService::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.list_controls({ 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_controls 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_controls ::Google::Cloud::Retail::V2::ListControlsRequest.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_controls({ 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_controls(::Google::Cloud::Retail::V2::ListControlsRequest.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_controls_client_stub.call_count + end + end + end + + def test_configure + credentials_token = :dummy_value + + client = block_config = config = nil + dummy_stub = ClientStub.new nil + Gapic::Rest::ClientStub.stub :new, dummy_stub do + client = ::Google::Cloud::Retail::V2::ControlService::Rest::Client.new do |config| + config.credentials = credentials_token + end + end + + config = client.configure do |c| + block_config = c + end + + assert_same block_config, config + assert_kind_of ::Google::Cloud::Retail::V2::ControlService::Rest::Client::Configuration, config + end +end diff --git a/owl-bot-staging/google-cloud-retail-v2/test/google/cloud/retail/v2/control_service_test.rb b/owl-bot-staging/google-cloud-retail-v2/test/google/cloud/retail/v2/control_service_test.rb new file mode 100644 index 000000000000..0a9d24f2adf0 --- /dev/null +++ b/owl-bot-staging/google-cloud-retail-v2/test/google/cloud/retail/v2/control_service_test.rb @@ -0,0 +1,411 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +require "helper" + +require "gapic/grpc/service_stub" + +require "google/cloud/retail/v2/control_service_pb" +require "google/cloud/retail/v2/control_service" + +class ::Google::Cloud::Retail::V2::ControlService::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_control + # Create GRPC objects. + grpc_response = ::Google::Cloud::Retail::V2::Control.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" + control = {} + control_id = "hello world" + + create_control_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :create_control, name + assert_kind_of ::Google::Cloud::Retail::V2::CreateControlRequest, request + assert_equal "hello world", request["parent"] + assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::Retail::V2::Control), request["control"] + assert_equal "hello world", request["control_id"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, create_control_client_stub do + # Create client + client = ::Google::Cloud::Retail::V2::ControlService::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.create_control({ parent: parent, control: control, control_id: control_id }) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use named arguments + client.create_control parent: parent, control: control, control_id: control_id do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.create_control ::Google::Cloud::Retail::V2::CreateControlRequest.new(parent: parent, control: control, control_id: control_id) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use hash object with options + client.create_control({ parent: parent, control: control, control_id: control_id }, grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object with options + client.create_control(::Google::Cloud::Retail::V2::CreateControlRequest.new(parent: parent, control: control, control_id: control_id), grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Verify method calls + assert_equal 5, create_control_client_stub.call_rpc_count + end + end + + def test_delete_control + # 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_control_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :delete_control, name + assert_kind_of ::Google::Cloud::Retail::V2::DeleteControlRequest, request + assert_equal "hello world", request["name"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, delete_control_client_stub do + # Create client + client = ::Google::Cloud::Retail::V2::ControlService::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.delete_control({ name: name }) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use named arguments + client.delete_control name: name do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.delete_control ::Google::Cloud::Retail::V2::DeleteControlRequest.new(name: name) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use hash object with options + client.delete_control({ 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_control(::Google::Cloud::Retail::V2::DeleteControlRequest.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_control_client_stub.call_rpc_count + end + end + + def test_update_control + # Create GRPC objects. + grpc_response = ::Google::Cloud::Retail::V2::Control.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. + control = {} + update_mask = {} + + update_control_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :update_control, name + assert_kind_of ::Google::Cloud::Retail::V2::UpdateControlRequest, request + assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::Retail::V2::Control), request["control"] + assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Protobuf::FieldMask), request["update_mask"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, update_control_client_stub do + # Create client + client = ::Google::Cloud::Retail::V2::ControlService::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.update_control({ control: control, update_mask: update_mask }) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use named arguments + client.update_control control: control, update_mask: update_mask do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.update_control ::Google::Cloud::Retail::V2::UpdateControlRequest.new(control: control, update_mask: update_mask) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use hash object with options + client.update_control({ control: control, update_mask: update_mask }, grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object with options + client.update_control(::Google::Cloud::Retail::V2::UpdateControlRequest.new(control: control, update_mask: update_mask), grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Verify method calls + assert_equal 5, update_control_client_stub.call_rpc_count + end + end + + def test_get_control + # Create GRPC objects. + grpc_response = ::Google::Cloud::Retail::V2::Control.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_control_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :get_control, name + assert_kind_of ::Google::Cloud::Retail::V2::GetControlRequest, request + assert_equal "hello world", request["name"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, get_control_client_stub do + # Create client + client = ::Google::Cloud::Retail::V2::ControlService::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.get_control({ name: name }) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use named arguments + client.get_control name: name do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.get_control ::Google::Cloud::Retail::V2::GetControlRequest.new(name: name) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use hash object with options + client.get_control({ 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_control(::Google::Cloud::Retail::V2::GetControlRequest.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_control_client_stub.call_rpc_count + end + end + + def test_list_controls + # Create GRPC objects. + grpc_response = ::Google::Cloud::Retail::V2::ListControlsResponse.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_controls_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :list_controls, name + assert_kind_of ::Google::Cloud::Retail::V2::ListControlsRequest, 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_controls_client_stub do + # Create client + client = ::Google::Cloud::Retail::V2::ControlService::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.list_controls({ 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_controls 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_controls ::Google::Cloud::Retail::V2::ListControlsRequest.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_controls({ 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_controls(::Google::Cloud::Retail::V2::ListControlsRequest.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_controls_client_stub.call_rpc_count + end + end + + def test_configure + grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + + client = block_config = config = nil + dummy_stub = ClientStub.new nil, nil + Gapic::ServiceStub.stub :new, dummy_stub do + client = ::Google::Cloud::Retail::V2::ControlService::Client.new do |config| + config.credentials = grpc_channel + end + end + + config = client.configure do |c| + block_config = c + end + + assert_same block_config, config + assert_kind_of ::Google::Cloud::Retail::V2::ControlService::Client::Configuration, config + end + + def test_credentials + key = OpenSSL::PKey::RSA.new 2048 + cred_json = { + "private_key" => key.to_pem, + "client_email" => "app@developer.gserviceaccount.com", + "type" => "service_account" + } + key_file = StringIO.new cred_json.to_json + creds = Google::Auth::ServiceAccountCredentials.make_creds({ json_key_io: key_file }) + + dummy_stub = ClientStub.new nil, nil + Gapic::ServiceStub.stub :new, dummy_stub do + client = ::Google::Cloud::Retail::V2::ControlService::Client.new do |config| + config.credentials = creds + end + assert_kind_of ::Google::Cloud::Retail::V2::ControlService::Client, client + assert_equal creds, client.configure.credentials + end + end +end diff --git a/owl-bot-staging/google-cloud-retail-v2/test/google/cloud/retail/v2/conversational_search_service_paths_test.rb b/owl-bot-staging/google-cloud-retail-v2/test/google/cloud/retail/v2/conversational_search_service_paths_test.rb new file mode 100644 index 000000000000..fdef51260f2e --- /dev/null +++ b/owl-bot-staging/google-cloud-retail-v2/test/google/cloud/retail/v2/conversational_search_service_paths_test.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 "helper" + +require "gapic/grpc/service_stub" + +require "google/cloud/retail/v2/conversational_search_service" + +class ::Google::Cloud::Retail::V2::ConversationalSearchService::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_branch_path + grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + ::Gapic::ServiceStub.stub :new, DummyStub.new do + client = ::Google::Cloud::Retail::V2::ConversationalSearchService::Client.new do |config| + config.credentials = grpc_channel + end + + path = client.branch_path project: "value0", location: "value1", catalog: "value2", branch: "value3" + assert_equal "projects/value0/locations/value1/catalogs/value2/branches/value3", path + end + end +end diff --git a/owl-bot-staging/google-cloud-retail-v2/test/google/cloud/retail/v2/conversational_search_service_rest_test.rb b/owl-bot-staging/google-cloud-retail-v2/test/google/cloud/retail/v2/conversational_search_service_rest_test.rb new file mode 100644 index 000000000000..43fc3af657e0 --- /dev/null +++ b/owl-bot-staging/google-cloud-retail-v2/test/google/cloud/retail/v2/conversational_search_service_rest_test.rb @@ -0,0 +1,163 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +require "helper" +require "gapic/rest" +require "google/cloud/retail/v2/conversational_search_service_pb" +require "google/cloud/retail/v2/conversational_search_service/rest" + + +class ::Google::Cloud::Retail::V2::ConversationalSearchService::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_conversational_search + # Create test objects. + client_result = ::Google::Cloud::Retail::V2::ConversationalSearchResponse.new + http_response = OpenStruct.new body: client_result.to_json + + call_options = {} + + # Create request parameters for a unary method. + placement = "hello world" + branch = "hello world" + query = "hello world" + page_categories = ["hello world"] + conversation_id = "hello world" + search_params = {} + visitor_id = "hello world" + user_info = {} + conversational_filtering_spec = {} + user_labels = {} + safety_settings = [{}] + + conversational_search_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, is_server_streaming:, method_name:| + assert options.metadata.key? :"x-goog-api-client" + assert options.metadata[:"x-goog-api-client"].include? "rest" + refute options.metadata[:"x-goog-api-client"].include? "grpc" + end + + ::Google::Cloud::Retail::V2::ConversationalSearchService::Rest::ServiceStub.stub :transcode_conversational_search_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, conversational_search_client_stub do + # Create client + client = ::Google::Cloud::Retail::V2::ConversationalSearchService::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.conversational_search({ placement: placement, branch: branch, query: query, page_categories: page_categories, conversation_id: conversation_id, search_params: search_params, visitor_id: visitor_id, user_info: user_info, conversational_filtering_spec: conversational_filtering_spec, user_labels: user_labels, safety_settings: safety_settings }) do |_result, response| + assert_equal http_response, response.underlying_op + end.first + + # Use named arguments + client.conversational_search placement: placement, branch: branch, query: query, page_categories: page_categories, conversation_id: conversation_id, search_params: search_params, visitor_id: visitor_id, user_info: user_info, conversational_filtering_spec: conversational_filtering_spec, user_labels: user_labels, safety_settings: safety_settings do |_result, response| + assert_equal http_response, response.underlying_op + end.first + + # Use protobuf object + client.conversational_search ::Google::Cloud::Retail::V2::ConversationalSearchRequest.new(placement: placement, branch: branch, query: query, page_categories: page_categories, conversation_id: conversation_id, search_params: search_params, visitor_id: visitor_id, user_info: user_info, conversational_filtering_spec: conversational_filtering_spec, user_labels: user_labels, safety_settings: safety_settings) do |_result, response| + assert_equal http_response, response.underlying_op + end.first + + # Use hash object with options + client.conversational_search({ placement: placement, branch: branch, query: query, page_categories: page_categories, conversation_id: conversation_id, search_params: search_params, visitor_id: visitor_id, user_info: user_info, conversational_filtering_spec: conversational_filtering_spec, user_labels: user_labels, safety_settings: safety_settings }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end.first + + # Use protobuf object with options + client.conversational_search(::Google::Cloud::Retail::V2::ConversationalSearchRequest.new(placement: placement, branch: branch, query: query, page_categories: page_categories, conversation_id: conversation_id, search_params: search_params, visitor_id: visitor_id, user_info: user_info, conversational_filtering_spec: conversational_filtering_spec, user_labels: user_labels, safety_settings: safety_settings), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end.first + + # Verify method calls + assert_equal 5, conversational_search_client_stub.call_count + end + end + end + + def test_configure + credentials_token = :dummy_value + + client = block_config = config = nil + dummy_stub = ClientStub.new nil + Gapic::Rest::ClientStub.stub :new, dummy_stub do + client = ::Google::Cloud::Retail::V2::ConversationalSearchService::Rest::Client.new do |config| + config.credentials = credentials_token + end + end + + config = client.configure do |c| + block_config = c + end + + assert_same block_config, config + assert_kind_of ::Google::Cloud::Retail::V2::ConversationalSearchService::Rest::Client::Configuration, config + end +end diff --git a/owl-bot-staging/google-cloud-retail-v2/test/google/cloud/retail/v2/conversational_search_service_test.rb b/owl-bot-staging/google-cloud-retail-v2/test/google/cloud/retail/v2/conversational_search_service_test.rb new file mode 100644 index 000000000000..bceb09b9597a --- /dev/null +++ b/owl-bot-staging/google-cloud-retail-v2/test/google/cloud/retail/v2/conversational_search_service_test.rb @@ -0,0 +1,197 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +require "helper" + +require "gapic/grpc/service_stub" + +require "google/cloud/retail/v2/conversational_search_service_pb" +require "google/cloud/retail/v2/conversational_search_service" + +class ::Google::Cloud::Retail::V2::ConversationalSearchService::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_conversational_search + # Create GRPC objects. + grpc_response = ::Google::Cloud::Retail::V2::ConversationalSearchResponse.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 server streaming method. + placement = "hello world" + branch = "hello world" + query = "hello world" + page_categories = ["hello world"] + conversation_id = "hello world" + search_params = {} + visitor_id = "hello world" + user_info = {} + conversational_filtering_spec = {} + user_labels = {} + safety_settings = [{}] + + conversational_search_client_stub = ClientStub.new [grpc_response].to_enum, grpc_operation do |name, request, options:| + assert_equal :conversational_search, name + assert_kind_of ::Google::Cloud::Retail::V2::ConversationalSearchRequest, request + assert_equal "hello world", request["placement"] + assert_equal "hello world", request["branch"] + assert_equal "hello world", request["query"] + assert_equal ["hello world"], request["page_categories"] + assert_equal "hello world", request["conversation_id"] + assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::Retail::V2::ConversationalSearchRequest::SearchParams), request["search_params"] + assert_equal "hello world", request["visitor_id"] + assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::Retail::V2::UserInfo), request["user_info"] + assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::Retail::V2::ConversationalSearchRequest::ConversationalFilteringSpec), request["conversational_filtering_spec"] + assert_equal({}, request["user_labels"].to_h) + assert_kind_of ::Google::Cloud::Retail::V2::SafetySetting, request["safety_settings"].first + refute_nil options + end + + Gapic::ServiceStub.stub :new, conversational_search_client_stub do + # Create client + client = ::Google::Cloud::Retail::V2::ConversationalSearchService::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.conversational_search({ placement: placement, branch: branch, query: query, page_categories: page_categories, conversation_id: conversation_id, search_params: search_params, visitor_id: visitor_id, user_info: user_info, conversational_filtering_spec: conversational_filtering_spec, user_labels: user_labels, safety_settings: safety_settings }) do |response, operation| + assert_kind_of Enumerable, response + response.to_a.each do |r| + assert_kind_of ::Google::Cloud::Retail::V2::ConversationalSearchResponse, r + end + assert_equal grpc_operation, operation + end + + # Use named arguments + client.conversational_search placement: placement, branch: branch, query: query, page_categories: page_categories, conversation_id: conversation_id, search_params: search_params, visitor_id: visitor_id, user_info: user_info, conversational_filtering_spec: conversational_filtering_spec, user_labels: user_labels, safety_settings: safety_settings do |response, operation| + assert_kind_of Enumerable, response + response.to_a.each do |r| + assert_kind_of ::Google::Cloud::Retail::V2::ConversationalSearchResponse, r + end + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.conversational_search ::Google::Cloud::Retail::V2::ConversationalSearchRequest.new(placement: placement, branch: branch, query: query, page_categories: page_categories, conversation_id: conversation_id, search_params: search_params, visitor_id: visitor_id, user_info: user_info, conversational_filtering_spec: conversational_filtering_spec, user_labels: user_labels, safety_settings: safety_settings) do |response, operation| + assert_kind_of Enumerable, response + response.to_a.each do |r| + assert_kind_of ::Google::Cloud::Retail::V2::ConversationalSearchResponse, r + end + assert_equal grpc_operation, operation + end + + # Use hash object with options + client.conversational_search({ placement: placement, branch: branch, query: query, page_categories: page_categories, conversation_id: conversation_id, search_params: search_params, visitor_id: visitor_id, user_info: user_info, conversational_filtering_spec: conversational_filtering_spec, user_labels: user_labels, safety_settings: safety_settings }, grpc_options) do |response, operation| + assert_kind_of Enumerable, response + response.to_a.each do |r| + assert_kind_of ::Google::Cloud::Retail::V2::ConversationalSearchResponse, r + end + assert_equal grpc_operation, operation + end + + # Use protobuf object with options + client.conversational_search(::Google::Cloud::Retail::V2::ConversationalSearchRequest.new(placement: placement, branch: branch, query: query, page_categories: page_categories, conversation_id: conversation_id, search_params: search_params, visitor_id: visitor_id, user_info: user_info, conversational_filtering_spec: conversational_filtering_spec, user_labels: user_labels, safety_settings: safety_settings), grpc_options) do |response, operation| + assert_kind_of Enumerable, response + response.to_a.each do |r| + assert_kind_of ::Google::Cloud::Retail::V2::ConversationalSearchResponse, r + end + assert_equal grpc_operation, operation + end + + # Verify method calls + assert_equal 5, conversational_search_client_stub.call_rpc_count + end + end + + def test_configure + grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + + client = block_config = config = nil + dummy_stub = ClientStub.new nil, nil + Gapic::ServiceStub.stub :new, dummy_stub do + client = ::Google::Cloud::Retail::V2::ConversationalSearchService::Client.new do |config| + config.credentials = grpc_channel + end + end + + config = client.configure do |c| + block_config = c + end + + assert_same block_config, config + assert_kind_of ::Google::Cloud::Retail::V2::ConversationalSearchService::Client::Configuration, config + end + + def test_credentials + key = OpenSSL::PKey::RSA.new 2048 + cred_json = { + "private_key" => key.to_pem, + "client_email" => "app@developer.gserviceaccount.com", + "type" => "service_account" + } + key_file = StringIO.new cred_json.to_json + creds = Google::Auth::ServiceAccountCredentials.make_creds({ json_key_io: key_file }) + + dummy_stub = ClientStub.new nil, nil + Gapic::ServiceStub.stub :new, dummy_stub do + client = ::Google::Cloud::Retail::V2::ConversationalSearchService::Client.new do |config| + config.credentials = creds + end + assert_kind_of ::Google::Cloud::Retail::V2::ConversationalSearchService::Client, client + assert_equal creds, client.configure.credentials + end + end +end diff --git a/owl-bot-staging/google-cloud-retail-v2/test/google/cloud/retail/v2/generative_question_service_paths_test.rb b/owl-bot-staging/google-cloud-retail-v2/test/google/cloud/retail/v2/generative_question_service_paths_test.rb new file mode 100644 index 000000000000..453c3660b939 --- /dev/null +++ b/owl-bot-staging/google-cloud-retail-v2/test/google/cloud/retail/v2/generative_question_service_paths_test.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 "helper" + +require "gapic/grpc/service_stub" + +require "google/cloud/retail/v2/generative_question_service" + +class ::Google::Cloud::Retail::V2::GenerativeQuestionService::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_catalog_path + grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + ::Gapic::ServiceStub.stub :new, DummyStub.new do + client = ::Google::Cloud::Retail::V2::GenerativeQuestionService::Client.new do |config| + config.credentials = grpc_channel + end + + path = client.catalog_path project: "value0", location: "value1", catalog: "value2" + assert_equal "projects/value0/locations/value1/catalogs/value2", path + end + end +end diff --git a/owl-bot-staging/google-cloud-retail-v2/test/google/cloud/retail/v2/generative_question_service_rest_test.rb b/owl-bot-staging/google-cloud-retail-v2/test/google/cloud/retail/v2/generative_question_service_rest_test.rb new file mode 100644 index 000000000000..81a282af9702 --- /dev/null +++ b/owl-bot-staging/google-cloud-retail-v2/test/google/cloud/retail/v2/generative_question_service_rest_test.rb @@ -0,0 +1,372 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +require "helper" +require "gapic/rest" +require "google/cloud/retail/v2/generative_question_service_pb" +require "google/cloud/retail/v2/generative_question_service/rest" + + +class ::Google::Cloud::Retail::V2::GenerativeQuestionService::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_update_generative_questions_feature_config + # Create test objects. + client_result = ::Google::Cloud::Retail::V2::GenerativeQuestionsFeatureConfig.new + http_response = OpenStruct.new body: client_result.to_json + + call_options = {} + + # Create request parameters for a unary method. + generative_questions_feature_config = {} + update_mask = {} + + update_generative_questions_feature_config_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| + assert options.metadata.key? :"x-goog-api-client" + assert options.metadata[:"x-goog-api-client"].include? "rest" + refute options.metadata[:"x-goog-api-client"].include? "grpc" + end + + ::Google::Cloud::Retail::V2::GenerativeQuestionService::Rest::ServiceStub.stub :transcode_update_generative_questions_feature_config_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, update_generative_questions_feature_config_client_stub do + # Create client + client = ::Google::Cloud::Retail::V2::GenerativeQuestionService::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.update_generative_questions_feature_config({ generative_questions_feature_config: generative_questions_feature_config, update_mask: update_mask }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.update_generative_questions_feature_config generative_questions_feature_config: generative_questions_feature_config, update_mask: update_mask do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.update_generative_questions_feature_config ::Google::Cloud::Retail::V2::UpdateGenerativeQuestionsFeatureConfigRequest.new(generative_questions_feature_config: generative_questions_feature_config, update_mask: update_mask) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + client.update_generative_questions_feature_config({ generative_questions_feature_config: generative_questions_feature_config, update_mask: update_mask }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + client.update_generative_questions_feature_config(::Google::Cloud::Retail::V2::UpdateGenerativeQuestionsFeatureConfigRequest.new(generative_questions_feature_config: generative_questions_feature_config, update_mask: update_mask), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, update_generative_questions_feature_config_client_stub.call_count + end + end + end + + def test_get_generative_questions_feature_config + # Create test objects. + client_result = ::Google::Cloud::Retail::V2::GenerativeQuestionsFeatureConfig.new + http_response = OpenStruct.new body: client_result.to_json + + call_options = {} + + # Create request parameters for a unary method. + catalog = "hello world" + + get_generative_questions_feature_config_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| + assert options.metadata.key? :"x-goog-api-client" + assert options.metadata[:"x-goog-api-client"].include? "rest" + refute options.metadata[:"x-goog-api-client"].include? "grpc" + end + + ::Google::Cloud::Retail::V2::GenerativeQuestionService::Rest::ServiceStub.stub :transcode_get_generative_questions_feature_config_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, get_generative_questions_feature_config_client_stub do + # Create client + client = ::Google::Cloud::Retail::V2::GenerativeQuestionService::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.get_generative_questions_feature_config({ catalog: catalog }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.get_generative_questions_feature_config catalog: catalog do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.get_generative_questions_feature_config ::Google::Cloud::Retail::V2::GetGenerativeQuestionsFeatureConfigRequest.new(catalog: catalog) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + client.get_generative_questions_feature_config({ catalog: catalog }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + client.get_generative_questions_feature_config(::Google::Cloud::Retail::V2::GetGenerativeQuestionsFeatureConfigRequest.new(catalog: catalog), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, get_generative_questions_feature_config_client_stub.call_count + end + end + end + + def test_list_generative_question_configs + # Create test objects. + client_result = ::Google::Cloud::Retail::V2::ListGenerativeQuestionConfigsResponse.new + http_response = OpenStruct.new body: client_result.to_json + + call_options = {} + + # Create request parameters for a unary method. + parent = "hello world" + + list_generative_question_configs_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| + assert options.metadata.key? :"x-goog-api-client" + assert options.metadata[:"x-goog-api-client"].include? "rest" + refute options.metadata[:"x-goog-api-client"].include? "grpc" + end + + ::Google::Cloud::Retail::V2::GenerativeQuestionService::Rest::ServiceStub.stub :transcode_list_generative_question_configs_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, list_generative_question_configs_client_stub do + # Create client + client = ::Google::Cloud::Retail::V2::GenerativeQuestionService::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.list_generative_question_configs({ parent: parent }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.list_generative_question_configs parent: parent do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.list_generative_question_configs ::Google::Cloud::Retail::V2::ListGenerativeQuestionConfigsRequest.new(parent: parent) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + client.list_generative_question_configs({ parent: parent }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + client.list_generative_question_configs(::Google::Cloud::Retail::V2::ListGenerativeQuestionConfigsRequest.new(parent: parent), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, list_generative_question_configs_client_stub.call_count + end + end + end + + def test_update_generative_question_config + # Create test objects. + client_result = ::Google::Cloud::Retail::V2::GenerativeQuestionConfig.new + http_response = OpenStruct.new body: client_result.to_json + + call_options = {} + + # Create request parameters for a unary method. + generative_question_config = {} + update_mask = {} + + update_generative_question_config_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| + assert options.metadata.key? :"x-goog-api-client" + assert options.metadata[:"x-goog-api-client"].include? "rest" + refute options.metadata[:"x-goog-api-client"].include? "grpc" + end + + ::Google::Cloud::Retail::V2::GenerativeQuestionService::Rest::ServiceStub.stub :transcode_update_generative_question_config_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, update_generative_question_config_client_stub do + # Create client + client = ::Google::Cloud::Retail::V2::GenerativeQuestionService::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.update_generative_question_config({ generative_question_config: generative_question_config, update_mask: update_mask }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.update_generative_question_config generative_question_config: generative_question_config, update_mask: update_mask do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.update_generative_question_config ::Google::Cloud::Retail::V2::UpdateGenerativeQuestionConfigRequest.new(generative_question_config: generative_question_config, update_mask: update_mask) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + client.update_generative_question_config({ generative_question_config: generative_question_config, update_mask: update_mask }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + client.update_generative_question_config(::Google::Cloud::Retail::V2::UpdateGenerativeQuestionConfigRequest.new(generative_question_config: generative_question_config, update_mask: update_mask), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, update_generative_question_config_client_stub.call_count + end + end + end + + def test_batch_update_generative_question_configs + # Create test objects. + client_result = ::Google::Cloud::Retail::V2::BatchUpdateGenerativeQuestionConfigsResponse.new + http_response = OpenStruct.new body: client_result.to_json + + call_options = {} + + # Create request parameters for a unary method. + parent = "hello world" + requests = [{}] + + batch_update_generative_question_configs_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| + assert options.metadata.key? :"x-goog-api-client" + assert options.metadata[:"x-goog-api-client"].include? "rest" + refute options.metadata[:"x-goog-api-client"].include? "grpc" + end + + ::Google::Cloud::Retail::V2::GenerativeQuestionService::Rest::ServiceStub.stub :transcode_batch_update_generative_question_configs_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, batch_update_generative_question_configs_client_stub do + # Create client + client = ::Google::Cloud::Retail::V2::GenerativeQuestionService::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.batch_update_generative_question_configs({ parent: parent, requests: requests }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.batch_update_generative_question_configs parent: parent, requests: requests do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.batch_update_generative_question_configs ::Google::Cloud::Retail::V2::BatchUpdateGenerativeQuestionConfigsRequest.new(parent: parent, requests: requests) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + client.batch_update_generative_question_configs({ parent: parent, requests: requests }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + client.batch_update_generative_question_configs(::Google::Cloud::Retail::V2::BatchUpdateGenerativeQuestionConfigsRequest.new(parent: parent, requests: requests), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, batch_update_generative_question_configs_client_stub.call_count + end + end + end + + def test_configure + credentials_token = :dummy_value + + client = block_config = config = nil + dummy_stub = ClientStub.new nil + Gapic::Rest::ClientStub.stub :new, dummy_stub do + client = ::Google::Cloud::Retail::V2::GenerativeQuestionService::Rest::Client.new do |config| + config.credentials = credentials_token + end + end + + config = client.configure do |c| + block_config = c + end + + assert_same block_config, config + assert_kind_of ::Google::Cloud::Retail::V2::GenerativeQuestionService::Rest::Client::Configuration, config + end +end diff --git a/owl-bot-staging/google-cloud-retail-v2/test/google/cloud/retail/v2/generative_question_service_test.rb b/owl-bot-staging/google-cloud-retail-v2/test/google/cloud/retail/v2/generative_question_service_test.rb new file mode 100644 index 000000000000..472531143e27 --- /dev/null +++ b/owl-bot-staging/google-cloud-retail-v2/test/google/cloud/retail/v2/generative_question_service_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/cloud/retail/v2/generative_question_service_pb" +require "google/cloud/retail/v2/generative_question_service" + +class ::Google::Cloud::Retail::V2::GenerativeQuestionService::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_update_generative_questions_feature_config + # Create GRPC objects. + grpc_response = ::Google::Cloud::Retail::V2::GenerativeQuestionsFeatureConfig.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. + generative_questions_feature_config = {} + update_mask = {} + + update_generative_questions_feature_config_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :update_generative_questions_feature_config, name + assert_kind_of ::Google::Cloud::Retail::V2::UpdateGenerativeQuestionsFeatureConfigRequest, request + assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::Retail::V2::GenerativeQuestionsFeatureConfig), request["generative_questions_feature_config"] + assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Protobuf::FieldMask), request["update_mask"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, update_generative_questions_feature_config_client_stub do + # Create client + client = ::Google::Cloud::Retail::V2::GenerativeQuestionService::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.update_generative_questions_feature_config({ generative_questions_feature_config: generative_questions_feature_config, update_mask: update_mask }) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use named arguments + client.update_generative_questions_feature_config generative_questions_feature_config: generative_questions_feature_config, update_mask: update_mask do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.update_generative_questions_feature_config ::Google::Cloud::Retail::V2::UpdateGenerativeQuestionsFeatureConfigRequest.new(generative_questions_feature_config: generative_questions_feature_config, update_mask: update_mask) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use hash object with options + client.update_generative_questions_feature_config({ generative_questions_feature_config: generative_questions_feature_config, update_mask: update_mask }, grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object with options + client.update_generative_questions_feature_config(::Google::Cloud::Retail::V2::UpdateGenerativeQuestionsFeatureConfigRequest.new(generative_questions_feature_config: generative_questions_feature_config, update_mask: update_mask), grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Verify method calls + assert_equal 5, update_generative_questions_feature_config_client_stub.call_rpc_count + end + end + + def test_get_generative_questions_feature_config + # Create GRPC objects. + grpc_response = ::Google::Cloud::Retail::V2::GenerativeQuestionsFeatureConfig.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. + catalog = "hello world" + + get_generative_questions_feature_config_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :get_generative_questions_feature_config, name + assert_kind_of ::Google::Cloud::Retail::V2::GetGenerativeQuestionsFeatureConfigRequest, request + assert_equal "hello world", request["catalog"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, get_generative_questions_feature_config_client_stub do + # Create client + client = ::Google::Cloud::Retail::V2::GenerativeQuestionService::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.get_generative_questions_feature_config({ catalog: catalog }) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use named arguments + client.get_generative_questions_feature_config catalog: catalog do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.get_generative_questions_feature_config ::Google::Cloud::Retail::V2::GetGenerativeQuestionsFeatureConfigRequest.new(catalog: catalog) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use hash object with options + client.get_generative_questions_feature_config({ catalog: catalog }, grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object with options + client.get_generative_questions_feature_config(::Google::Cloud::Retail::V2::GetGenerativeQuestionsFeatureConfigRequest.new(catalog: catalog), grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Verify method calls + assert_equal 5, get_generative_questions_feature_config_client_stub.call_rpc_count + end + end + + def test_list_generative_question_configs + # Create GRPC objects. + grpc_response = ::Google::Cloud::Retail::V2::ListGenerativeQuestionConfigsResponse.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" + + list_generative_question_configs_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :list_generative_question_configs, name + assert_kind_of ::Google::Cloud::Retail::V2::ListGenerativeQuestionConfigsRequest, request + assert_equal "hello world", request["parent"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, list_generative_question_configs_client_stub do + # Create client + client = ::Google::Cloud::Retail::V2::GenerativeQuestionService::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.list_generative_question_configs({ parent: parent }) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use named arguments + client.list_generative_question_configs parent: parent do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.list_generative_question_configs ::Google::Cloud::Retail::V2::ListGenerativeQuestionConfigsRequest.new(parent: parent) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use hash object with options + client.list_generative_question_configs({ parent: parent }, grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object with options + client.list_generative_question_configs(::Google::Cloud::Retail::V2::ListGenerativeQuestionConfigsRequest.new(parent: parent), grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Verify method calls + assert_equal 5, list_generative_question_configs_client_stub.call_rpc_count + end + end + + def test_update_generative_question_config + # Create GRPC objects. + grpc_response = ::Google::Cloud::Retail::V2::GenerativeQuestionConfig.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. + generative_question_config = {} + update_mask = {} + + update_generative_question_config_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :update_generative_question_config, name + assert_kind_of ::Google::Cloud::Retail::V2::UpdateGenerativeQuestionConfigRequest, request + assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::Retail::V2::GenerativeQuestionConfig), request["generative_question_config"] + assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Protobuf::FieldMask), request["update_mask"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, update_generative_question_config_client_stub do + # Create client + client = ::Google::Cloud::Retail::V2::GenerativeQuestionService::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.update_generative_question_config({ generative_question_config: generative_question_config, update_mask: update_mask }) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use named arguments + client.update_generative_question_config generative_question_config: generative_question_config, update_mask: update_mask do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.update_generative_question_config ::Google::Cloud::Retail::V2::UpdateGenerativeQuestionConfigRequest.new(generative_question_config: generative_question_config, update_mask: update_mask) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use hash object with options + client.update_generative_question_config({ generative_question_config: generative_question_config, update_mask: update_mask }, grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object with options + client.update_generative_question_config(::Google::Cloud::Retail::V2::UpdateGenerativeQuestionConfigRequest.new(generative_question_config: generative_question_config, update_mask: update_mask), grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Verify method calls + assert_equal 5, update_generative_question_config_client_stub.call_rpc_count + end + end + + def test_batch_update_generative_question_configs + # Create GRPC objects. + grpc_response = ::Google::Cloud::Retail::V2::BatchUpdateGenerativeQuestionConfigsResponse.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" + requests = [{}] + + batch_update_generative_question_configs_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :batch_update_generative_question_configs, name + assert_kind_of ::Google::Cloud::Retail::V2::BatchUpdateGenerativeQuestionConfigsRequest, request + assert_equal "hello world", request["parent"] + assert_kind_of ::Google::Cloud::Retail::V2::UpdateGenerativeQuestionConfigRequest, request["requests"].first + refute_nil options + end + + Gapic::ServiceStub.stub :new, batch_update_generative_question_configs_client_stub do + # Create client + client = ::Google::Cloud::Retail::V2::GenerativeQuestionService::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.batch_update_generative_question_configs({ parent: parent, requests: requests }) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use named arguments + client.batch_update_generative_question_configs parent: parent, requests: requests do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.batch_update_generative_question_configs ::Google::Cloud::Retail::V2::BatchUpdateGenerativeQuestionConfigsRequest.new(parent: parent, requests: requests) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use hash object with options + client.batch_update_generative_question_configs({ parent: parent, requests: requests }, grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object with options + client.batch_update_generative_question_configs(::Google::Cloud::Retail::V2::BatchUpdateGenerativeQuestionConfigsRequest.new(parent: parent, requests: requests), grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Verify method calls + assert_equal 5, batch_update_generative_question_configs_client_stub.call_rpc_count + end + end + + def test_configure + grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + + client = block_config = config = nil + dummy_stub = ClientStub.new nil, nil + Gapic::ServiceStub.stub :new, dummy_stub do + client = ::Google::Cloud::Retail::V2::GenerativeQuestionService::Client.new do |config| + config.credentials = grpc_channel + end + end + + config = client.configure do |c| + block_config = c + end + + assert_same block_config, config + assert_kind_of ::Google::Cloud::Retail::V2::GenerativeQuestionService::Client::Configuration, config + end + + def test_credentials + key = OpenSSL::PKey::RSA.new 2048 + cred_json = { + "private_key" => key.to_pem, + "client_email" => "app@developer.gserviceaccount.com", + "type" => "service_account" + } + key_file = StringIO.new cred_json.to_json + creds = Google::Auth::ServiceAccountCredentials.make_creds({ json_key_io: key_file }) + + dummy_stub = ClientStub.new nil, nil + Gapic::ServiceStub.stub :new, dummy_stub do + client = ::Google::Cloud::Retail::V2::GenerativeQuestionService::Client.new do |config| + config.credentials = creds + end + assert_kind_of ::Google::Cloud::Retail::V2::GenerativeQuestionService::Client, client + assert_equal creds, client.configure.credentials + end + end +end diff --git a/owl-bot-staging/google-cloud-retail-v2/test/google/cloud/retail/v2/model_service_operations_test.rb b/owl-bot-staging/google-cloud-retail-v2/test/google/cloud/retail/v2/model_service_operations_test.rb new file mode 100644 index 000000000000..2cc0089dba34 --- /dev/null +++ b/owl-bot-staging/google-cloud-retail-v2/test/google/cloud/retail/v2/model_service_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/cloud/retail/v2/model_service_pb" +require "google/cloud/retail/v2/model_service_services_pb" +require "google/cloud/retail/v2/model_service" + +class ::Google::Cloud::Retail::V2::ModelService::OperationsTest < Minitest::Test + class ClientStub + attr_accessor :call_rpc_count, :requests + + def initialize response, operation, &block + @response = response + @operation = operation + @block = block + @call_rpc_count = 0 + @requests = [] + end + + def call_rpc *args, **kwargs + @call_rpc_count += 1 + + @requests << @block&.call(*args, **kwargs) + + catch :response do + yield @response, @operation if block_given? + @response + end + end + + def endpoint + "endpoint.example.com" + end + + def universe_domain + "example.com" + end + + def stub_logger + nil + end + + def logger + nil + end + end + + def test_list_operations + # Create GRPC objects. + grpc_response = ::Google::Longrunning::ListOperationsResponse.new + grpc_operation = GRPC::ActiveCall::Operation.new nil + grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + grpc_options = {} + + # Create request parameters for a unary method. + name = "hello world" + filter = "hello world" + page_size = 42 + page_token = "hello world" + return_partial_success = true + + list_operations_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :list_operations, name + assert_kind_of ::Google::Longrunning::ListOperationsRequest, request + assert_equal "hello world", request["name"] + assert_equal "hello world", request["filter"] + assert_equal 42, request["page_size"] + assert_equal "hello world", request["page_token"] + assert_equal true, request["return_partial_success"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, list_operations_client_stub do + # Create client + client = ::Google::Cloud::Retail::V2::ModelService::Operations.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.list_operations({ name: name, filter: filter, page_size: page_size, page_token: page_token, return_partial_success: return_partial_success }) do |response, operation| + assert_kind_of Gapic::PagedEnumerable, response + assert_equal grpc_response, response.response + assert_equal grpc_operation, operation + end + + # Use named arguments + client.list_operations name: name, filter: filter, page_size: page_size, page_token: page_token, return_partial_success: return_partial_success do |response, operation| + assert_kind_of Gapic::PagedEnumerable, response + assert_equal grpc_response, response.response + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.list_operations ::Google::Longrunning::ListOperationsRequest.new(name: name, filter: filter, page_size: page_size, page_token: page_token, return_partial_success: return_partial_success) do |response, operation| + assert_kind_of Gapic::PagedEnumerable, response + assert_equal grpc_response, response.response + assert_equal grpc_operation, operation + end + + # Use hash object with options + client.list_operations({ name: name, filter: filter, page_size: page_size, page_token: page_token, return_partial_success: return_partial_success }, grpc_options) do |response, operation| + assert_kind_of Gapic::PagedEnumerable, response + assert_equal grpc_response, response.response + assert_equal grpc_operation, operation + end + + # Use protobuf object with options + client.list_operations(::Google::Longrunning::ListOperationsRequest.new(name: name, filter: filter, page_size: page_size, page_token: page_token, return_partial_success: return_partial_success), grpc_options) do |response, operation| + assert_kind_of Gapic::PagedEnumerable, response + assert_equal grpc_response, response.response + assert_equal grpc_operation, operation + end + + # Verify method calls + assert_equal 5, list_operations_client_stub.call_rpc_count + end + end + + def test_get_operation + # Create GRPC objects. + grpc_response = ::Google::Longrunning::Operation.new + grpc_operation = GRPC::ActiveCall::Operation.new nil + grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + grpc_options = {} + + # Create request parameters for a unary method. + name = "hello world" + + get_operation_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :get_operation, name + assert_kind_of ::Google::Longrunning::GetOperationRequest, request + assert_equal "hello world", request["name"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, get_operation_client_stub do + # Create client + client = ::Google::Cloud::Retail::V2::ModelService::Operations.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.get_operation({ name: name }) do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Use named arguments + client.get_operation name: name do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.get_operation ::Google::Longrunning::GetOperationRequest.new(name: name) do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Use hash object with options + client.get_operation({ name: name }, grpc_options) do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Use protobuf object with options + client.get_operation(::Google::Longrunning::GetOperationRequest.new(name: name), grpc_options) do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Verify method calls + assert_equal 5, get_operation_client_stub.call_rpc_count + end + end + + def test_delete_operation + # Create GRPC objects. + grpc_response = ::Google::Protobuf::Empty.new + grpc_operation = GRPC::ActiveCall::Operation.new nil + grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + grpc_options = {} + + # Create request parameters for a unary method. + name = "hello world" + + delete_operation_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :delete_operation, name + assert_kind_of ::Google::Longrunning::DeleteOperationRequest, request + assert_equal "hello world", request["name"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, delete_operation_client_stub do + # Create client + client = ::Google::Cloud::Retail::V2::ModelService::Operations.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.delete_operation({ name: name }) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use named arguments + client.delete_operation name: name do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.delete_operation ::Google::Longrunning::DeleteOperationRequest.new(name: name) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use hash object with options + client.delete_operation({ name: name }, grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object with options + client.delete_operation(::Google::Longrunning::DeleteOperationRequest.new(name: name), grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Verify method calls + assert_equal 5, delete_operation_client_stub.call_rpc_count + end + end + + def test_cancel_operation + # Create GRPC objects. + grpc_response = ::Google::Protobuf::Empty.new + grpc_operation = GRPC::ActiveCall::Operation.new nil + grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + grpc_options = {} + + # Create request parameters for a unary method. + name = "hello world" + + cancel_operation_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :cancel_operation, name + assert_kind_of ::Google::Longrunning::CancelOperationRequest, request + assert_equal "hello world", request["name"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, cancel_operation_client_stub do + # Create client + client = ::Google::Cloud::Retail::V2::ModelService::Operations.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.cancel_operation({ name: name }) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use named arguments + client.cancel_operation name: name do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.cancel_operation ::Google::Longrunning::CancelOperationRequest.new(name: name) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use hash object with options + client.cancel_operation({ name: name }, grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object with options + client.cancel_operation(::Google::Longrunning::CancelOperationRequest.new(name: name), grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Verify method calls + assert_equal 5, cancel_operation_client_stub.call_rpc_count + end + end + + def test_wait_operation + # Create GRPC objects. + grpc_response = ::Google::Longrunning::Operation.new + grpc_operation = GRPC::ActiveCall::Operation.new nil + grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + grpc_options = {} + + # Create request parameters for a unary method. + name = "hello world" + timeout = {} + + wait_operation_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :wait_operation, name + assert_kind_of ::Google::Longrunning::WaitOperationRequest, request + assert_equal "hello world", request["name"] + assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Protobuf::Duration), request["timeout"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, wait_operation_client_stub do + # Create client + client = ::Google::Cloud::Retail::V2::ModelService::Operations.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.wait_operation({ name: name, timeout: timeout }) do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Use named arguments + client.wait_operation name: name, timeout: timeout do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.wait_operation ::Google::Longrunning::WaitOperationRequest.new(name: name, timeout: timeout) do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Use hash object with options + client.wait_operation({ name: name, timeout: timeout }, grpc_options) do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Use protobuf object with options + client.wait_operation(::Google::Longrunning::WaitOperationRequest.new(name: name, timeout: timeout), grpc_options) do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Verify method calls + assert_equal 5, wait_operation_client_stub.call_rpc_count + end + end + + def test_configure + grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + + client = block_config = config = nil + dummy_stub = ClientStub.new nil, nil + Gapic::ServiceStub.stub :new, dummy_stub do + client = ::Google::Cloud::Retail::V2::ModelService::Operations.new do |config| + config.credentials = grpc_channel + end + end + + config = client.configure do |c| + block_config = c + end + + assert_same block_config, config + assert_kind_of ::Google::Cloud::Retail::V2::ModelService::Operations::Configuration, config + end +end diff --git a/owl-bot-staging/google-cloud-retail-v2/test/google/cloud/retail/v2/model_service_paths_test.rb b/owl-bot-staging/google-cloud-retail-v2/test/google/cloud/retail/v2/model_service_paths_test.rb new file mode 100644 index 000000000000..f077beeed1ed --- /dev/null +++ b/owl-bot-staging/google-cloud-retail-v2/test/google/cloud/retail/v2/model_service_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/cloud/retail/v2/model_service" + +class ::Google::Cloud::Retail::V2::ModelService::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_catalog_path + grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + ::Gapic::ServiceStub.stub :new, DummyStub.new do + client = ::Google::Cloud::Retail::V2::ModelService::Client.new do |config| + config.credentials = grpc_channel + end + + path = client.catalog_path project: "value0", location: "value1", catalog: "value2" + assert_equal "projects/value0/locations/value1/catalogs/value2", path + end + end + + def test_model_path + grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + ::Gapic::ServiceStub.stub :new, DummyStub.new do + client = ::Google::Cloud::Retail::V2::ModelService::Client.new do |config| + config.credentials = grpc_channel + end + + path = client.model_path project: "value0", location: "value1", catalog: "value2", model: "value3" + assert_equal "projects/value0/locations/value1/catalogs/value2/models/value3", path + end + end +end diff --git a/owl-bot-staging/google-cloud-retail-v2/test/google/cloud/retail/v2/model_service_rest_test.rb b/owl-bot-staging/google-cloud-retail-v2/test/google/cloud/retail/v2/model_service_rest_test.rb new file mode 100644 index 000000000000..46478d2e2e7b --- /dev/null +++ b/owl-bot-staging/google-cloud-retail-v2/test/google/cloud/retail/v2/model_service_rest_test.rb @@ -0,0 +1,536 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +require "helper" +require "gapic/rest" +require "google/cloud/retail/v2/model_service_pb" +require "google/cloud/retail/v2/model_service/rest" + + +class ::Google::Cloud::Retail::V2::ModelService::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_model + # 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" + model = {} + dry_run = true + + create_model_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| + assert options.metadata.key? :"x-goog-api-client" + assert options.metadata[:"x-goog-api-client"].include? "rest" + refute options.metadata[:"x-goog-api-client"].include? "grpc" + end + + ::Google::Cloud::Retail::V2::ModelService::Rest::ServiceStub.stub :transcode_create_model_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, create_model_client_stub do + # Create client + client = ::Google::Cloud::Retail::V2::ModelService::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.create_model({ parent: parent, model: model, dry_run: dry_run }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.create_model parent: parent, model: model, dry_run: dry_run do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.create_model ::Google::Cloud::Retail::V2::CreateModelRequest.new(parent: parent, model: model, dry_run: dry_run) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + client.create_model({ parent: parent, model: model, dry_run: dry_run }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + client.create_model(::Google::Cloud::Retail::V2::CreateModelRequest.new(parent: parent, model: model, dry_run: dry_run), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, create_model_client_stub.call_count + end + end + end + + def test_get_model + # Create test objects. + client_result = ::Google::Cloud::Retail::V2::Model.new + http_response = OpenStruct.new body: client_result.to_json + + call_options = {} + + # Create request parameters for a unary method. + name = "hello world" + + get_model_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| + assert options.metadata.key? :"x-goog-api-client" + assert options.metadata[:"x-goog-api-client"].include? "rest" + refute options.metadata[:"x-goog-api-client"].include? "grpc" + end + + ::Google::Cloud::Retail::V2::ModelService::Rest::ServiceStub.stub :transcode_get_model_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, get_model_client_stub do + # Create client + client = ::Google::Cloud::Retail::V2::ModelService::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.get_model({ name: name }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.get_model name: name do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.get_model ::Google::Cloud::Retail::V2::GetModelRequest.new(name: name) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + client.get_model({ name: name }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + client.get_model(::Google::Cloud::Retail::V2::GetModelRequest.new(name: name), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, get_model_client_stub.call_count + end + end + end + + def test_pause_model + # Create test objects. + client_result = ::Google::Cloud::Retail::V2::Model.new + http_response = OpenStruct.new body: client_result.to_json + + call_options = {} + + # Create request parameters for a unary method. + name = "hello world" + + pause_model_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| + assert options.metadata.key? :"x-goog-api-client" + assert options.metadata[:"x-goog-api-client"].include? "rest" + refute options.metadata[:"x-goog-api-client"].include? "grpc" + end + + ::Google::Cloud::Retail::V2::ModelService::Rest::ServiceStub.stub :transcode_pause_model_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, pause_model_client_stub do + # Create client + client = ::Google::Cloud::Retail::V2::ModelService::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.pause_model({ name: name }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.pause_model name: name do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.pause_model ::Google::Cloud::Retail::V2::PauseModelRequest.new(name: name) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + client.pause_model({ name: name }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + client.pause_model(::Google::Cloud::Retail::V2::PauseModelRequest.new(name: name), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, pause_model_client_stub.call_count + end + end + end + + def test_resume_model + # Create test objects. + client_result = ::Google::Cloud::Retail::V2::Model.new + http_response = OpenStruct.new body: client_result.to_json + + call_options = {} + + # Create request parameters for a unary method. + name = "hello world" + + resume_model_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| + assert options.metadata.key? :"x-goog-api-client" + assert options.metadata[:"x-goog-api-client"].include? "rest" + refute options.metadata[:"x-goog-api-client"].include? "grpc" + end + + ::Google::Cloud::Retail::V2::ModelService::Rest::ServiceStub.stub :transcode_resume_model_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, resume_model_client_stub do + # Create client + client = ::Google::Cloud::Retail::V2::ModelService::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.resume_model({ name: name }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.resume_model name: name do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.resume_model ::Google::Cloud::Retail::V2::ResumeModelRequest.new(name: name) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + client.resume_model({ name: name }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + client.resume_model(::Google::Cloud::Retail::V2::ResumeModelRequest.new(name: name), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, resume_model_client_stub.call_count + end + end + end + + def test_delete_model + # Create test objects. + client_result = ::Google::Protobuf::Empty.new + http_response = OpenStruct.new body: client_result.to_json + + call_options = {} + + # Create request parameters for a unary method. + name = "hello world" + + delete_model_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| + assert options.metadata.key? :"x-goog-api-client" + assert options.metadata[:"x-goog-api-client"].include? "rest" + refute options.metadata[:"x-goog-api-client"].include? "grpc" + end + + ::Google::Cloud::Retail::V2::ModelService::Rest::ServiceStub.stub :transcode_delete_model_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, delete_model_client_stub do + # Create client + client = ::Google::Cloud::Retail::V2::ModelService::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.delete_model({ name: name }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.delete_model name: name do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.delete_model ::Google::Cloud::Retail::V2::DeleteModelRequest.new(name: name) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + client.delete_model({ name: name }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + client.delete_model(::Google::Cloud::Retail::V2::DeleteModelRequest.new(name: name), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, delete_model_client_stub.call_count + end + end + end + + def test_list_models + # Create test objects. + client_result = ::Google::Cloud::Retail::V2::ListModelsResponse.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_models_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| + assert options.metadata.key? :"x-goog-api-client" + assert options.metadata[:"x-goog-api-client"].include? "rest" + refute options.metadata[:"x-goog-api-client"].include? "grpc" + end + + ::Google::Cloud::Retail::V2::ModelService::Rest::ServiceStub.stub :transcode_list_models_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, list_models_client_stub do + # Create client + client = ::Google::Cloud::Retail::V2::ModelService::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.list_models({ 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_models 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_models ::Google::Cloud::Retail::V2::ListModelsRequest.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_models({ 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_models(::Google::Cloud::Retail::V2::ListModelsRequest.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_models_client_stub.call_count + end + end + end + + def test_update_model + # Create test objects. + client_result = ::Google::Cloud::Retail::V2::Model.new + http_response = OpenStruct.new body: client_result.to_json + + call_options = {} + + # Create request parameters for a unary method. + model = {} + update_mask = {} + + update_model_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| + assert options.metadata.key? :"x-goog-api-client" + assert options.metadata[:"x-goog-api-client"].include? "rest" + refute options.metadata[:"x-goog-api-client"].include? "grpc" + end + + ::Google::Cloud::Retail::V2::ModelService::Rest::ServiceStub.stub :transcode_update_model_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, update_model_client_stub do + # Create client + client = ::Google::Cloud::Retail::V2::ModelService::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.update_model({ model: model, update_mask: update_mask }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.update_model model: model, update_mask: update_mask do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.update_model ::Google::Cloud::Retail::V2::UpdateModelRequest.new(model: model, update_mask: update_mask) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + client.update_model({ model: model, update_mask: update_mask }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + client.update_model(::Google::Cloud::Retail::V2::UpdateModelRequest.new(model: model, update_mask: update_mask), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, update_model_client_stub.call_count + end + end + end + + def test_tune_model + # 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" + + tune_model_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| + assert options.metadata.key? :"x-goog-api-client" + assert options.metadata[:"x-goog-api-client"].include? "rest" + refute options.metadata[:"x-goog-api-client"].include? "grpc" + end + + ::Google::Cloud::Retail::V2::ModelService::Rest::ServiceStub.stub :transcode_tune_model_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, tune_model_client_stub do + # Create client + client = ::Google::Cloud::Retail::V2::ModelService::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.tune_model({ name: name }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.tune_model name: name do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.tune_model ::Google::Cloud::Retail::V2::TuneModelRequest.new(name: name) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + client.tune_model({ name: name }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + client.tune_model(::Google::Cloud::Retail::V2::TuneModelRequest.new(name: name), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, tune_model_client_stub.call_count + end + end + end + + def test_configure + credentials_token = :dummy_value + + client = block_config = config = nil + dummy_stub = ClientStub.new nil + Gapic::Rest::ClientStub.stub :new, dummy_stub do + client = ::Google::Cloud::Retail::V2::ModelService::Rest::Client.new do |config| + config.credentials = credentials_token + end + end + + config = client.configure do |c| + block_config = c + end + + assert_same block_config, config + assert_kind_of ::Google::Cloud::Retail::V2::ModelService::Rest::Client::Configuration, config + end +end diff --git a/owl-bot-staging/google-cloud-retail-v2/test/google/cloud/retail/v2/model_service_test.rb b/owl-bot-staging/google-cloud-retail-v2/test/google/cloud/retail/v2/model_service_test.rb new file mode 100644 index 000000000000..9e7a175a3c0f --- /dev/null +++ b/owl-bot-staging/google-cloud-retail-v2/test/google/cloud/retail/v2/model_service_test.rb @@ -0,0 +1,607 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +require "helper" + +require "gapic/grpc/service_stub" + +require "google/cloud/retail/v2/model_service_pb" +require "google/cloud/retail/v2/model_service" + +class ::Google::Cloud::Retail::V2::ModelService::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_model + # 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" + model = {} + dry_run = true + + create_model_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :create_model, name + assert_kind_of ::Google::Cloud::Retail::V2::CreateModelRequest, request + assert_equal "hello world", request["parent"] + assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::Retail::V2::Model), request["model"] + assert_equal true, request["dry_run"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, create_model_client_stub do + # Create client + client = ::Google::Cloud::Retail::V2::ModelService::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.create_model({ parent: parent, model: model, dry_run: dry_run }) 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_model parent: parent, model: model, dry_run: dry_run 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_model ::Google::Cloud::Retail::V2::CreateModelRequest.new(parent: parent, model: model, dry_run: dry_run) 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_model({ parent: parent, model: model, dry_run: dry_run }, 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_model(::Google::Cloud::Retail::V2::CreateModelRequest.new(parent: parent, model: model, dry_run: dry_run), 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_model_client_stub.call_rpc_count + end + end + + def test_get_model + # Create GRPC objects. + grpc_response = ::Google::Cloud::Retail::V2::Model.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_model_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :get_model, name + assert_kind_of ::Google::Cloud::Retail::V2::GetModelRequest, request + assert_equal "hello world", request["name"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, get_model_client_stub do + # Create client + client = ::Google::Cloud::Retail::V2::ModelService::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.get_model({ name: name }) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use named arguments + client.get_model name: name do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.get_model ::Google::Cloud::Retail::V2::GetModelRequest.new(name: name) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use hash object with options + client.get_model({ 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_model(::Google::Cloud::Retail::V2::GetModelRequest.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_model_client_stub.call_rpc_count + end + end + + def test_pause_model + # Create GRPC objects. + grpc_response = ::Google::Cloud::Retail::V2::Model.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" + + pause_model_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :pause_model, name + assert_kind_of ::Google::Cloud::Retail::V2::PauseModelRequest, request + assert_equal "hello world", request["name"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, pause_model_client_stub do + # Create client + client = ::Google::Cloud::Retail::V2::ModelService::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.pause_model({ name: name }) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use named arguments + client.pause_model name: name do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.pause_model ::Google::Cloud::Retail::V2::PauseModelRequest.new(name: name) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use hash object with options + client.pause_model({ name: name }, grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object with options + client.pause_model(::Google::Cloud::Retail::V2::PauseModelRequest.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, pause_model_client_stub.call_rpc_count + end + end + + def test_resume_model + # Create GRPC objects. + grpc_response = ::Google::Cloud::Retail::V2::Model.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" + + resume_model_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :resume_model, name + assert_kind_of ::Google::Cloud::Retail::V2::ResumeModelRequest, request + assert_equal "hello world", request["name"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, resume_model_client_stub do + # Create client + client = ::Google::Cloud::Retail::V2::ModelService::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.resume_model({ name: name }) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use named arguments + client.resume_model name: name do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.resume_model ::Google::Cloud::Retail::V2::ResumeModelRequest.new(name: name) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use hash object with options + client.resume_model({ name: name }, grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object with options + client.resume_model(::Google::Cloud::Retail::V2::ResumeModelRequest.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, resume_model_client_stub.call_rpc_count + end + end + + def test_delete_model + # 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_model_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :delete_model, name + assert_kind_of ::Google::Cloud::Retail::V2::DeleteModelRequest, request + assert_equal "hello world", request["name"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, delete_model_client_stub do + # Create client + client = ::Google::Cloud::Retail::V2::ModelService::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.delete_model({ name: name }) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use named arguments + client.delete_model name: name do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.delete_model ::Google::Cloud::Retail::V2::DeleteModelRequest.new(name: name) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use hash object with options + client.delete_model({ 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_model(::Google::Cloud::Retail::V2::DeleteModelRequest.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_model_client_stub.call_rpc_count + end + end + + def test_list_models + # Create GRPC objects. + grpc_response = ::Google::Cloud::Retail::V2::ListModelsResponse.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_models_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :list_models, name + assert_kind_of ::Google::Cloud::Retail::V2::ListModelsRequest, 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_models_client_stub do + # Create client + client = ::Google::Cloud::Retail::V2::ModelService::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.list_models({ 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_models 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_models ::Google::Cloud::Retail::V2::ListModelsRequest.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_models({ 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_models(::Google::Cloud::Retail::V2::ListModelsRequest.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_models_client_stub.call_rpc_count + end + end + + def test_update_model + # Create GRPC objects. + grpc_response = ::Google::Cloud::Retail::V2::Model.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. + model = {} + update_mask = {} + + update_model_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :update_model, name + assert_kind_of ::Google::Cloud::Retail::V2::UpdateModelRequest, request + assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::Retail::V2::Model), request["model"] + assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Protobuf::FieldMask), request["update_mask"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, update_model_client_stub do + # Create client + client = ::Google::Cloud::Retail::V2::ModelService::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.update_model({ model: model, update_mask: update_mask }) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use named arguments + client.update_model model: model, update_mask: update_mask do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.update_model ::Google::Cloud::Retail::V2::UpdateModelRequest.new(model: model, update_mask: update_mask) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use hash object with options + client.update_model({ model: model, update_mask: update_mask }, grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object with options + client.update_model(::Google::Cloud::Retail::V2::UpdateModelRequest.new(model: model, update_mask: update_mask), grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Verify method calls + assert_equal 5, update_model_client_stub.call_rpc_count + end + end + + def test_tune_model + # 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" + + tune_model_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :tune_model, name + assert_kind_of ::Google::Cloud::Retail::V2::TuneModelRequest, request + assert_equal "hello world", request["name"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, tune_model_client_stub do + # Create client + client = ::Google::Cloud::Retail::V2::ModelService::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.tune_model({ 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.tune_model 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.tune_model ::Google::Cloud::Retail::V2::TuneModelRequest.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.tune_model({ 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.tune_model(::Google::Cloud::Retail::V2::TuneModelRequest.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, tune_model_client_stub.call_rpc_count + end + end + + def test_configure + grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + + client = block_config = config = nil + dummy_stub = ClientStub.new nil, nil + Gapic::ServiceStub.stub :new, dummy_stub do + client = ::Google::Cloud::Retail::V2::ModelService::Client.new do |config| + config.credentials = grpc_channel + end + end + + config = client.configure do |c| + block_config = c + end + + assert_same block_config, config + assert_kind_of ::Google::Cloud::Retail::V2::ModelService::Client::Configuration, config + end + + def test_credentials + key = OpenSSL::PKey::RSA.new 2048 + cred_json = { + "private_key" => key.to_pem, + "client_email" => "app@developer.gserviceaccount.com", + "type" => "service_account" + } + key_file = StringIO.new cred_json.to_json + creds = Google::Auth::ServiceAccountCredentials.make_creds({ json_key_io: key_file }) + + dummy_stub = ClientStub.new nil, nil + Gapic::ServiceStub.stub :new, dummy_stub do + client = ::Google::Cloud::Retail::V2::ModelService::Client.new do |config| + config.credentials = creds + end + assert_kind_of ::Google::Cloud::Retail::V2::ModelService::Client, client + assert_equal creds, client.configure.credentials + end + end + + def test_operations_client + grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + + client = nil + dummy_stub = ClientStub.new nil, nil + Gapic::ServiceStub.stub :new, dummy_stub do + client = ::Google::Cloud::Retail::V2::ModelService::Client.new do |config| + config.credentials = grpc_channel + end + end + + assert_kind_of ::Google::Cloud::Retail::V2::ModelService::Operations, client.operations_client + end +end diff --git a/owl-bot-staging/google-cloud-retail-v2/test/google/cloud/retail/v2/prediction_service_paths_test.rb b/owl-bot-staging/google-cloud-retail-v2/test/google/cloud/retail/v2/prediction_service_paths_test.rb new file mode 100644 index 000000000000..531290668702 --- /dev/null +++ b/owl-bot-staging/google-cloud-retail-v2/test/google/cloud/retail/v2/prediction_service_paths_test.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 "helper" + +require "gapic/grpc/service_stub" + +require "google/cloud/retail/v2/prediction_service" + +class ::Google::Cloud::Retail::V2::PredictionService::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_product_path + grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + ::Gapic::ServiceStub.stub :new, DummyStub.new do + client = ::Google::Cloud::Retail::V2::PredictionService::Client.new do |config| + config.credentials = grpc_channel + end + + path = client.product_path project: "value0", location: "value1", catalog: "value2", branch: "value3", product: "value4" + assert_equal "projects/value0/locations/value1/catalogs/value2/branches/value3/products/value4", path + end + end +end diff --git a/owl-bot-staging/google-cloud-retail-v2/test/google/cloud/retail/v2/prediction_service_rest_test.rb b/owl-bot-staging/google-cloud-retail-v2/test/google/cloud/retail/v2/prediction_service_rest_test.rb new file mode 100644 index 000000000000..a4467b15702d --- /dev/null +++ b/owl-bot-staging/google-cloud-retail-v2/test/google/cloud/retail/v2/prediction_service_rest_test.rb @@ -0,0 +1,160 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +require "helper" +require "gapic/rest" +require "google/cloud/retail/v2/prediction_service_pb" +require "google/cloud/retail/v2/prediction_service/rest" + + +class ::Google::Cloud::Retail::V2::PredictionService::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_predict + # Create test objects. + client_result = ::Google::Cloud::Retail::V2::PredictResponse.new + http_response = OpenStruct.new body: client_result.to_json + + call_options = {} + + # Create request parameters for a unary method. + placement = "hello world" + user_event = {} + page_size = 42 + page_token = "hello world" + filter = "hello world" + validate_only = true + params = {} + labels = {} + + predict_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| + assert options.metadata.key? :"x-goog-api-client" + assert options.metadata[:"x-goog-api-client"].include? "rest" + refute options.metadata[:"x-goog-api-client"].include? "grpc" + end + + ::Google::Cloud::Retail::V2::PredictionService::Rest::ServiceStub.stub :transcode_predict_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, predict_client_stub do + # Create client + client = ::Google::Cloud::Retail::V2::PredictionService::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.predict({ placement: placement, user_event: user_event, page_size: page_size, page_token: page_token, filter: filter, validate_only: validate_only, params: params, labels: labels }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.predict placement: placement, user_event: user_event, page_size: page_size, page_token: page_token, filter: filter, validate_only: validate_only, params: params, labels: labels do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.predict ::Google::Cloud::Retail::V2::PredictRequest.new(placement: placement, user_event: user_event, page_size: page_size, page_token: page_token, filter: filter, validate_only: validate_only, params: params, labels: labels) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + client.predict({ placement: placement, user_event: user_event, page_size: page_size, page_token: page_token, filter: filter, validate_only: validate_only, params: params, labels: labels }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + client.predict(::Google::Cloud::Retail::V2::PredictRequest.new(placement: placement, user_event: user_event, page_size: page_size, page_token: page_token, filter: filter, validate_only: validate_only, params: params, labels: labels), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, predict_client_stub.call_count + end + end + end + + def test_configure + credentials_token = :dummy_value + + client = block_config = config = nil + dummy_stub = ClientStub.new nil + Gapic::Rest::ClientStub.stub :new, dummy_stub do + client = ::Google::Cloud::Retail::V2::PredictionService::Rest::Client.new do |config| + config.credentials = credentials_token + end + end + + config = client.configure do |c| + block_config = c + end + + assert_same block_config, config + assert_kind_of ::Google::Cloud::Retail::V2::PredictionService::Rest::Client::Configuration, config + end +end diff --git a/owl-bot-staging/google-cloud-retail-v2/test/google/cloud/retail/v2/prediction_service_test.rb b/owl-bot-staging/google-cloud-retail-v2/test/google/cloud/retail/v2/prediction_service_test.rb new file mode 100644 index 000000000000..7b954f3adb96 --- /dev/null +++ b/owl-bot-staging/google-cloud-retail-v2/test/google/cloud/retail/v2/prediction_service_test.rb @@ -0,0 +1,176 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +require "helper" + +require "gapic/grpc/service_stub" + +require "google/cloud/retail/v2/prediction_service_pb" +require "google/cloud/retail/v2/prediction_service" + +class ::Google::Cloud::Retail::V2::PredictionService::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_predict + # Create GRPC objects. + grpc_response = ::Google::Cloud::Retail::V2::PredictResponse.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. + placement = "hello world" + user_event = {} + page_size = 42 + page_token = "hello world" + filter = "hello world" + validate_only = true + params = {} + labels = {} + + predict_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :predict, name + assert_kind_of ::Google::Cloud::Retail::V2::PredictRequest, request + assert_equal "hello world", request["placement"] + assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::Retail::V2::UserEvent), request["user_event"] + assert_equal 42, request["page_size"] + assert_equal "hello world", request["page_token"] + assert_equal "hello world", request["filter"] + assert_equal true, request["validate_only"] + assert_equal({}, request["params"].to_h) + assert_equal({}, request["labels"].to_h) + refute_nil options + end + + Gapic::ServiceStub.stub :new, predict_client_stub do + # Create client + client = ::Google::Cloud::Retail::V2::PredictionService::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.predict({ placement: placement, user_event: user_event, page_size: page_size, page_token: page_token, filter: filter, validate_only: validate_only, params: params, labels: labels }) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use named arguments + client.predict placement: placement, user_event: user_event, page_size: page_size, page_token: page_token, filter: filter, validate_only: validate_only, params: params, labels: labels do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.predict ::Google::Cloud::Retail::V2::PredictRequest.new(placement: placement, user_event: user_event, page_size: page_size, page_token: page_token, filter: filter, validate_only: validate_only, params: params, labels: labels) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use hash object with options + client.predict({ placement: placement, user_event: user_event, page_size: page_size, page_token: page_token, filter: filter, validate_only: validate_only, params: params, labels: labels }, grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object with options + client.predict(::Google::Cloud::Retail::V2::PredictRequest.new(placement: placement, user_event: user_event, page_size: page_size, page_token: page_token, filter: filter, validate_only: validate_only, params: params, labels: labels), grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Verify method calls + assert_equal 5, predict_client_stub.call_rpc_count + end + end + + def test_configure + grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + + client = block_config = config = nil + dummy_stub = ClientStub.new nil, nil + Gapic::ServiceStub.stub :new, dummy_stub do + client = ::Google::Cloud::Retail::V2::PredictionService::Client.new do |config| + config.credentials = grpc_channel + end + end + + config = client.configure do |c| + block_config = c + end + + assert_same block_config, config + assert_kind_of ::Google::Cloud::Retail::V2::PredictionService::Client::Configuration, config + end + + def test_credentials + key = OpenSSL::PKey::RSA.new 2048 + cred_json = { + "private_key" => key.to_pem, + "client_email" => "app@developer.gserviceaccount.com", + "type" => "service_account" + } + key_file = StringIO.new cred_json.to_json + creds = Google::Auth::ServiceAccountCredentials.make_creds({ json_key_io: key_file }) + + dummy_stub = ClientStub.new nil, nil + Gapic::ServiceStub.stub :new, dummy_stub do + client = ::Google::Cloud::Retail::V2::PredictionService::Client.new do |config| + config.credentials = creds + end + assert_kind_of ::Google::Cloud::Retail::V2::PredictionService::Client, client + assert_equal creds, client.configure.credentials + end + end +end diff --git a/owl-bot-staging/google-cloud-retail-v2/test/google/cloud/retail/v2/product_service_operations_test.rb b/owl-bot-staging/google-cloud-retail-v2/test/google/cloud/retail/v2/product_service_operations_test.rb new file mode 100644 index 000000000000..967bc636ac7c --- /dev/null +++ b/owl-bot-staging/google-cloud-retail-v2/test/google/cloud/retail/v2/product_service_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/cloud/retail/v2/product_service_pb" +require "google/cloud/retail/v2/product_service_services_pb" +require "google/cloud/retail/v2/product_service" + +class ::Google::Cloud::Retail::V2::ProductService::OperationsTest < Minitest::Test + class ClientStub + attr_accessor :call_rpc_count, :requests + + def initialize response, operation, &block + @response = response + @operation = operation + @block = block + @call_rpc_count = 0 + @requests = [] + end + + def call_rpc *args, **kwargs + @call_rpc_count += 1 + + @requests << @block&.call(*args, **kwargs) + + catch :response do + yield @response, @operation if block_given? + @response + end + end + + def endpoint + "endpoint.example.com" + end + + def universe_domain + "example.com" + end + + def stub_logger + nil + end + + def logger + nil + end + end + + def test_list_operations + # Create GRPC objects. + grpc_response = ::Google::Longrunning::ListOperationsResponse.new + grpc_operation = GRPC::ActiveCall::Operation.new nil + grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + grpc_options = {} + + # Create request parameters for a unary method. + name = "hello world" + filter = "hello world" + page_size = 42 + page_token = "hello world" + return_partial_success = true + + list_operations_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :list_operations, name + assert_kind_of ::Google::Longrunning::ListOperationsRequest, request + assert_equal "hello world", request["name"] + assert_equal "hello world", request["filter"] + assert_equal 42, request["page_size"] + assert_equal "hello world", request["page_token"] + assert_equal true, request["return_partial_success"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, list_operations_client_stub do + # Create client + client = ::Google::Cloud::Retail::V2::ProductService::Operations.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.list_operations({ name: name, filter: filter, page_size: page_size, page_token: page_token, return_partial_success: return_partial_success }) do |response, operation| + assert_kind_of Gapic::PagedEnumerable, response + assert_equal grpc_response, response.response + assert_equal grpc_operation, operation + end + + # Use named arguments + client.list_operations name: name, filter: filter, page_size: page_size, page_token: page_token, return_partial_success: return_partial_success do |response, operation| + assert_kind_of Gapic::PagedEnumerable, response + assert_equal grpc_response, response.response + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.list_operations ::Google::Longrunning::ListOperationsRequest.new(name: name, filter: filter, page_size: page_size, page_token: page_token, return_partial_success: return_partial_success) do |response, operation| + assert_kind_of Gapic::PagedEnumerable, response + assert_equal grpc_response, response.response + assert_equal grpc_operation, operation + end + + # Use hash object with options + client.list_operations({ name: name, filter: filter, page_size: page_size, page_token: page_token, return_partial_success: return_partial_success }, grpc_options) do |response, operation| + assert_kind_of Gapic::PagedEnumerable, response + assert_equal grpc_response, response.response + assert_equal grpc_operation, operation + end + + # Use protobuf object with options + client.list_operations(::Google::Longrunning::ListOperationsRequest.new(name: name, filter: filter, page_size: page_size, page_token: page_token, return_partial_success: return_partial_success), grpc_options) do |response, operation| + assert_kind_of Gapic::PagedEnumerable, response + assert_equal grpc_response, response.response + assert_equal grpc_operation, operation + end + + # Verify method calls + assert_equal 5, list_operations_client_stub.call_rpc_count + end + end + + def test_get_operation + # Create GRPC objects. + grpc_response = ::Google::Longrunning::Operation.new + grpc_operation = GRPC::ActiveCall::Operation.new nil + grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + grpc_options = {} + + # Create request parameters for a unary method. + name = "hello world" + + get_operation_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :get_operation, name + assert_kind_of ::Google::Longrunning::GetOperationRequest, request + assert_equal "hello world", request["name"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, get_operation_client_stub do + # Create client + client = ::Google::Cloud::Retail::V2::ProductService::Operations.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.get_operation({ name: name }) do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Use named arguments + client.get_operation name: name do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.get_operation ::Google::Longrunning::GetOperationRequest.new(name: name) do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Use hash object with options + client.get_operation({ name: name }, grpc_options) do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Use protobuf object with options + client.get_operation(::Google::Longrunning::GetOperationRequest.new(name: name), grpc_options) do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Verify method calls + assert_equal 5, get_operation_client_stub.call_rpc_count + end + end + + def test_delete_operation + # Create GRPC objects. + grpc_response = ::Google::Protobuf::Empty.new + grpc_operation = GRPC::ActiveCall::Operation.new nil + grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + grpc_options = {} + + # Create request parameters for a unary method. + name = "hello world" + + delete_operation_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :delete_operation, name + assert_kind_of ::Google::Longrunning::DeleteOperationRequest, request + assert_equal "hello world", request["name"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, delete_operation_client_stub do + # Create client + client = ::Google::Cloud::Retail::V2::ProductService::Operations.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.delete_operation({ name: name }) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use named arguments + client.delete_operation name: name do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.delete_operation ::Google::Longrunning::DeleteOperationRequest.new(name: name) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use hash object with options + client.delete_operation({ name: name }, grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object with options + client.delete_operation(::Google::Longrunning::DeleteOperationRequest.new(name: name), grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Verify method calls + assert_equal 5, delete_operation_client_stub.call_rpc_count + end + end + + def test_cancel_operation + # Create GRPC objects. + grpc_response = ::Google::Protobuf::Empty.new + grpc_operation = GRPC::ActiveCall::Operation.new nil + grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + grpc_options = {} + + # Create request parameters for a unary method. + name = "hello world" + + cancel_operation_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :cancel_operation, name + assert_kind_of ::Google::Longrunning::CancelOperationRequest, request + assert_equal "hello world", request["name"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, cancel_operation_client_stub do + # Create client + client = ::Google::Cloud::Retail::V2::ProductService::Operations.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.cancel_operation({ name: name }) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use named arguments + client.cancel_operation name: name do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.cancel_operation ::Google::Longrunning::CancelOperationRequest.new(name: name) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use hash object with options + client.cancel_operation({ name: name }, grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object with options + client.cancel_operation(::Google::Longrunning::CancelOperationRequest.new(name: name), grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Verify method calls + assert_equal 5, cancel_operation_client_stub.call_rpc_count + end + end + + def test_wait_operation + # Create GRPC objects. + grpc_response = ::Google::Longrunning::Operation.new + grpc_operation = GRPC::ActiveCall::Operation.new nil + grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + grpc_options = {} + + # Create request parameters for a unary method. + name = "hello world" + timeout = {} + + wait_operation_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :wait_operation, name + assert_kind_of ::Google::Longrunning::WaitOperationRequest, request + assert_equal "hello world", request["name"] + assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Protobuf::Duration), request["timeout"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, wait_operation_client_stub do + # Create client + client = ::Google::Cloud::Retail::V2::ProductService::Operations.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.wait_operation({ name: name, timeout: timeout }) do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Use named arguments + client.wait_operation name: name, timeout: timeout do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.wait_operation ::Google::Longrunning::WaitOperationRequest.new(name: name, timeout: timeout) do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Use hash object with options + client.wait_operation({ name: name, timeout: timeout }, grpc_options) do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Use protobuf object with options + client.wait_operation(::Google::Longrunning::WaitOperationRequest.new(name: name, timeout: timeout), grpc_options) do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Verify method calls + assert_equal 5, wait_operation_client_stub.call_rpc_count + end + end + + def test_configure + grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + + client = block_config = config = nil + dummy_stub = ClientStub.new nil, nil + Gapic::ServiceStub.stub :new, dummy_stub do + client = ::Google::Cloud::Retail::V2::ProductService::Operations.new do |config| + config.credentials = grpc_channel + end + end + + config = client.configure do |c| + block_config = c + end + + assert_same block_config, config + assert_kind_of ::Google::Cloud::Retail::V2::ProductService::Operations::Configuration, config + end +end diff --git a/owl-bot-staging/google-cloud-retail-v2/test/google/cloud/retail/v2/product_service_paths_test.rb b/owl-bot-staging/google-cloud-retail-v2/test/google/cloud/retail/v2/product_service_paths_test.rb new file mode 100644 index 000000000000..b58df28b3831 --- /dev/null +++ b/owl-bot-staging/google-cloud-retail-v2/test/google/cloud/retail/v2/product_service_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/cloud/retail/v2/product_service" + +class ::Google::Cloud::Retail::V2::ProductService::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_branch_path + grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + ::Gapic::ServiceStub.stub :new, DummyStub.new do + client = ::Google::Cloud::Retail::V2::ProductService::Client.new do |config| + config.credentials = grpc_channel + end + + path = client.branch_path project: "value0", location: "value1", catalog: "value2", branch: "value3" + assert_equal "projects/value0/locations/value1/catalogs/value2/branches/value3", path + end + end + + def test_product_path + grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + ::Gapic::ServiceStub.stub :new, DummyStub.new do + client = ::Google::Cloud::Retail::V2::ProductService::Client.new do |config| + config.credentials = grpc_channel + end + + path = client.product_path project: "value0", location: "value1", catalog: "value2", branch: "value3", product: "value4" + assert_equal "projects/value0/locations/value1/catalogs/value2/branches/value3/products/value4", path + end + end +end diff --git a/owl-bot-staging/google-cloud-retail-v2/test/google/cloud/retail/v2/product_service_rest_test.rb b/owl-bot-staging/google-cloud-retail-v2/test/google/cloud/retail/v2/product_service_rest_test.rb new file mode 100644 index 000000000000..960c2c21047b --- /dev/null +++ b/owl-bot-staging/google-cloud-retail-v2/test/google/cloud/retail/v2/product_service_rest_test.rb @@ -0,0 +1,781 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +require "helper" +require "gapic/rest" +require "google/cloud/retail/v2/product_service_pb" +require "google/cloud/retail/v2/product_service/rest" + + +class ::Google::Cloud::Retail::V2::ProductService::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_product + # Create test objects. + client_result = ::Google::Cloud::Retail::V2::Product.new + http_response = OpenStruct.new body: client_result.to_json + + call_options = {} + + # Create request parameters for a unary method. + parent = "hello world" + product = {} + product_id = "hello world" + + create_product_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| + assert options.metadata.key? :"x-goog-api-client" + assert options.metadata[:"x-goog-api-client"].include? "rest" + refute options.metadata[:"x-goog-api-client"].include? "grpc" + end + + ::Google::Cloud::Retail::V2::ProductService::Rest::ServiceStub.stub :transcode_create_product_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, create_product_client_stub do + # Create client + client = ::Google::Cloud::Retail::V2::ProductService::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.create_product({ parent: parent, product: product, product_id: product_id }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.create_product parent: parent, product: product, product_id: product_id do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.create_product ::Google::Cloud::Retail::V2::CreateProductRequest.new(parent: parent, product: product, product_id: product_id) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + client.create_product({ parent: parent, product: product, product_id: product_id }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + client.create_product(::Google::Cloud::Retail::V2::CreateProductRequest.new(parent: parent, product: product, product_id: product_id), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, create_product_client_stub.call_count + end + end + end + + def test_get_product + # Create test objects. + client_result = ::Google::Cloud::Retail::V2::Product.new + http_response = OpenStruct.new body: client_result.to_json + + call_options = {} + + # Create request parameters for a unary method. + name = "hello world" + + get_product_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| + assert options.metadata.key? :"x-goog-api-client" + assert options.metadata[:"x-goog-api-client"].include? "rest" + refute options.metadata[:"x-goog-api-client"].include? "grpc" + end + + ::Google::Cloud::Retail::V2::ProductService::Rest::ServiceStub.stub :transcode_get_product_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, get_product_client_stub do + # Create client + client = ::Google::Cloud::Retail::V2::ProductService::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.get_product({ name: name }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.get_product name: name do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.get_product ::Google::Cloud::Retail::V2::GetProductRequest.new(name: name) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + client.get_product({ name: name }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + client.get_product(::Google::Cloud::Retail::V2::GetProductRequest.new(name: name), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, get_product_client_stub.call_count + end + end + end + + def test_list_products + # Create test objects. + client_result = ::Google::Cloud::Retail::V2::ListProductsResponse.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" + read_mask = {} + + list_products_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| + assert options.metadata.key? :"x-goog-api-client" + assert options.metadata[:"x-goog-api-client"].include? "rest" + refute options.metadata[:"x-goog-api-client"].include? "grpc" + end + + ::Google::Cloud::Retail::V2::ProductService::Rest::ServiceStub.stub :transcode_list_products_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, list_products_client_stub do + # Create client + client = ::Google::Cloud::Retail::V2::ProductService::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.list_products({ parent: parent, page_size: page_size, page_token: page_token, filter: filter, read_mask: read_mask }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.list_products parent: parent, page_size: page_size, page_token: page_token, filter: filter, read_mask: read_mask do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.list_products ::Google::Cloud::Retail::V2::ListProductsRequest.new(parent: parent, page_size: page_size, page_token: page_token, filter: filter, read_mask: read_mask) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + client.list_products({ parent: parent, page_size: page_size, page_token: page_token, filter: filter, read_mask: read_mask }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + client.list_products(::Google::Cloud::Retail::V2::ListProductsRequest.new(parent: parent, page_size: page_size, page_token: page_token, filter: filter, read_mask: read_mask), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, list_products_client_stub.call_count + end + end + end + + def test_update_product + # Create test objects. + client_result = ::Google::Cloud::Retail::V2::Product.new + http_response = OpenStruct.new body: client_result.to_json + + call_options = {} + + # Create request parameters for a unary method. + product = {} + update_mask = {} + allow_missing = true + + update_product_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| + assert options.metadata.key? :"x-goog-api-client" + assert options.metadata[:"x-goog-api-client"].include? "rest" + refute options.metadata[:"x-goog-api-client"].include? "grpc" + end + + ::Google::Cloud::Retail::V2::ProductService::Rest::ServiceStub.stub :transcode_update_product_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, update_product_client_stub do + # Create client + client = ::Google::Cloud::Retail::V2::ProductService::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.update_product({ product: product, update_mask: update_mask, allow_missing: allow_missing }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.update_product product: product, update_mask: update_mask, allow_missing: allow_missing do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.update_product ::Google::Cloud::Retail::V2::UpdateProductRequest.new(product: product, update_mask: update_mask, allow_missing: allow_missing) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + client.update_product({ product: product, update_mask: update_mask, allow_missing: allow_missing }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + client.update_product(::Google::Cloud::Retail::V2::UpdateProductRequest.new(product: product, update_mask: update_mask, allow_missing: allow_missing), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, update_product_client_stub.call_count + end + end + end + + def test_delete_product + # Create test objects. + client_result = ::Google::Protobuf::Empty.new + http_response = OpenStruct.new body: client_result.to_json + + call_options = {} + + # Create request parameters for a unary method. + name = "hello world" + + delete_product_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| + assert options.metadata.key? :"x-goog-api-client" + assert options.metadata[:"x-goog-api-client"].include? "rest" + refute options.metadata[:"x-goog-api-client"].include? "grpc" + end + + ::Google::Cloud::Retail::V2::ProductService::Rest::ServiceStub.stub :transcode_delete_product_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, delete_product_client_stub do + # Create client + client = ::Google::Cloud::Retail::V2::ProductService::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.delete_product({ name: name }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.delete_product name: name do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.delete_product ::Google::Cloud::Retail::V2::DeleteProductRequest.new(name: name) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + client.delete_product({ name: name }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + client.delete_product(::Google::Cloud::Retail::V2::DeleteProductRequest.new(name: name), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, delete_product_client_stub.call_count + end + end + end + + def test_purge_products + # 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" + filter = "hello world" + force = true + + purge_products_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| + assert options.metadata.key? :"x-goog-api-client" + assert options.metadata[:"x-goog-api-client"].include? "rest" + refute options.metadata[:"x-goog-api-client"].include? "grpc" + end + + ::Google::Cloud::Retail::V2::ProductService::Rest::ServiceStub.stub :transcode_purge_products_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, purge_products_client_stub do + # Create client + client = ::Google::Cloud::Retail::V2::ProductService::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.purge_products({ parent: parent, filter: filter, force: force }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.purge_products parent: parent, filter: filter, force: force do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.purge_products ::Google::Cloud::Retail::V2::PurgeProductsRequest.new(parent: parent, filter: filter, force: force) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + client.purge_products({ parent: parent, filter: filter, force: force }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + client.purge_products(::Google::Cloud::Retail::V2::PurgeProductsRequest.new(parent: parent, filter: filter, force: force), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, purge_products_client_stub.call_count + end + end + end + + def test_import_products + # 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" + request_id = "hello world" + input_config = {} + errors_config = {} + update_mask = {} + reconciliation_mode = :RECONCILIATION_MODE_UNSPECIFIED + notification_pubsub_topic = "hello world" + + import_products_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| + assert options.metadata.key? :"x-goog-api-client" + assert options.metadata[:"x-goog-api-client"].include? "rest" + refute options.metadata[:"x-goog-api-client"].include? "grpc" + end + + ::Google::Cloud::Retail::V2::ProductService::Rest::ServiceStub.stub :transcode_import_products_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, import_products_client_stub do + # Create client + client = ::Google::Cloud::Retail::V2::ProductService::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.import_products({ parent: parent, request_id: request_id, input_config: input_config, errors_config: errors_config, update_mask: update_mask, reconciliation_mode: reconciliation_mode, notification_pubsub_topic: notification_pubsub_topic }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.import_products parent: parent, request_id: request_id, input_config: input_config, errors_config: errors_config, update_mask: update_mask, reconciliation_mode: reconciliation_mode, notification_pubsub_topic: notification_pubsub_topic do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.import_products ::Google::Cloud::Retail::V2::ImportProductsRequest.new(parent: parent, request_id: request_id, input_config: input_config, errors_config: errors_config, update_mask: update_mask, reconciliation_mode: reconciliation_mode, notification_pubsub_topic: notification_pubsub_topic) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + client.import_products({ parent: parent, request_id: request_id, input_config: input_config, errors_config: errors_config, update_mask: update_mask, reconciliation_mode: reconciliation_mode, notification_pubsub_topic: notification_pubsub_topic }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + client.import_products(::Google::Cloud::Retail::V2::ImportProductsRequest.new(parent: parent, request_id: request_id, input_config: input_config, errors_config: errors_config, update_mask: update_mask, reconciliation_mode: reconciliation_mode, notification_pubsub_topic: notification_pubsub_topic), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, import_products_client_stub.call_count + end + end + end + + def test_set_inventory + # 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. + inventory = {} + set_mask = {} + set_time = {} + allow_missing = true + + set_inventory_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| + assert options.metadata.key? :"x-goog-api-client" + assert options.metadata[:"x-goog-api-client"].include? "rest" + refute options.metadata[:"x-goog-api-client"].include? "grpc" + end + + ::Google::Cloud::Retail::V2::ProductService::Rest::ServiceStub.stub :transcode_set_inventory_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, set_inventory_client_stub do + # Create client + client = ::Google::Cloud::Retail::V2::ProductService::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.set_inventory({ inventory: inventory, set_mask: set_mask, set_time: set_time, allow_missing: allow_missing }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.set_inventory inventory: inventory, set_mask: set_mask, set_time: set_time, allow_missing: allow_missing do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.set_inventory ::Google::Cloud::Retail::V2::SetInventoryRequest.new(inventory: inventory, set_mask: set_mask, set_time: set_time, allow_missing: allow_missing) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + client.set_inventory({ inventory: inventory, set_mask: set_mask, set_time: set_time, allow_missing: allow_missing }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + client.set_inventory(::Google::Cloud::Retail::V2::SetInventoryRequest.new(inventory: inventory, set_mask: set_mask, set_time: set_time, allow_missing: allow_missing), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, set_inventory_client_stub.call_count + end + end + end + + def test_add_fulfillment_places + # 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. + product = "hello world" + type = "hello world" + place_ids = ["hello world"] + add_time = {} + allow_missing = true + + add_fulfillment_places_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| + assert options.metadata.key? :"x-goog-api-client" + assert options.metadata[:"x-goog-api-client"].include? "rest" + refute options.metadata[:"x-goog-api-client"].include? "grpc" + end + + ::Google::Cloud::Retail::V2::ProductService::Rest::ServiceStub.stub :transcode_add_fulfillment_places_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, add_fulfillment_places_client_stub do + # Create client + client = ::Google::Cloud::Retail::V2::ProductService::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.add_fulfillment_places({ product: product, type: type, place_ids: place_ids, add_time: add_time, allow_missing: allow_missing }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.add_fulfillment_places product: product, type: type, place_ids: place_ids, add_time: add_time, allow_missing: allow_missing do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.add_fulfillment_places ::Google::Cloud::Retail::V2::AddFulfillmentPlacesRequest.new(product: product, type: type, place_ids: place_ids, add_time: add_time, allow_missing: allow_missing) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + client.add_fulfillment_places({ product: product, type: type, place_ids: place_ids, add_time: add_time, allow_missing: allow_missing }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + client.add_fulfillment_places(::Google::Cloud::Retail::V2::AddFulfillmentPlacesRequest.new(product: product, type: type, place_ids: place_ids, add_time: add_time, allow_missing: allow_missing), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, add_fulfillment_places_client_stub.call_count + end + end + end + + def test_remove_fulfillment_places + # 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. + product = "hello world" + type = "hello world" + place_ids = ["hello world"] + remove_time = {} + allow_missing = true + + remove_fulfillment_places_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| + assert options.metadata.key? :"x-goog-api-client" + assert options.metadata[:"x-goog-api-client"].include? "rest" + refute options.metadata[:"x-goog-api-client"].include? "grpc" + end + + ::Google::Cloud::Retail::V2::ProductService::Rest::ServiceStub.stub :transcode_remove_fulfillment_places_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, remove_fulfillment_places_client_stub do + # Create client + client = ::Google::Cloud::Retail::V2::ProductService::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.remove_fulfillment_places({ product: product, type: type, place_ids: place_ids, remove_time: remove_time, allow_missing: allow_missing }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.remove_fulfillment_places product: product, type: type, place_ids: place_ids, remove_time: remove_time, allow_missing: allow_missing do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.remove_fulfillment_places ::Google::Cloud::Retail::V2::RemoveFulfillmentPlacesRequest.new(product: product, type: type, place_ids: place_ids, remove_time: remove_time, allow_missing: allow_missing) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + client.remove_fulfillment_places({ product: product, type: type, place_ids: place_ids, remove_time: remove_time, allow_missing: allow_missing }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + client.remove_fulfillment_places(::Google::Cloud::Retail::V2::RemoveFulfillmentPlacesRequest.new(product: product, type: type, place_ids: place_ids, remove_time: remove_time, allow_missing: allow_missing), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, remove_fulfillment_places_client_stub.call_count + end + end + end + + def test_add_local_inventories + # 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. + product = "hello world" + local_inventories = [{}] + add_mask = {} + add_time = {} + allow_missing = true + + add_local_inventories_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| + assert options.metadata.key? :"x-goog-api-client" + assert options.metadata[:"x-goog-api-client"].include? "rest" + refute options.metadata[:"x-goog-api-client"].include? "grpc" + end + + ::Google::Cloud::Retail::V2::ProductService::Rest::ServiceStub.stub :transcode_add_local_inventories_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, add_local_inventories_client_stub do + # Create client + client = ::Google::Cloud::Retail::V2::ProductService::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.add_local_inventories({ product: product, local_inventories: local_inventories, add_mask: add_mask, add_time: add_time, allow_missing: allow_missing }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.add_local_inventories product: product, local_inventories: local_inventories, add_mask: add_mask, add_time: add_time, allow_missing: allow_missing do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.add_local_inventories ::Google::Cloud::Retail::V2::AddLocalInventoriesRequest.new(product: product, local_inventories: local_inventories, add_mask: add_mask, add_time: add_time, allow_missing: allow_missing) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + client.add_local_inventories({ product: product, local_inventories: local_inventories, add_mask: add_mask, add_time: add_time, allow_missing: allow_missing }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + client.add_local_inventories(::Google::Cloud::Retail::V2::AddLocalInventoriesRequest.new(product: product, local_inventories: local_inventories, add_mask: add_mask, add_time: add_time, allow_missing: allow_missing), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, add_local_inventories_client_stub.call_count + end + end + end + + def test_remove_local_inventories + # 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. + product = "hello world" + place_ids = ["hello world"] + remove_time = {} + allow_missing = true + + remove_local_inventories_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| + assert options.metadata.key? :"x-goog-api-client" + assert options.metadata[:"x-goog-api-client"].include? "rest" + refute options.metadata[:"x-goog-api-client"].include? "grpc" + end + + ::Google::Cloud::Retail::V2::ProductService::Rest::ServiceStub.stub :transcode_remove_local_inventories_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, remove_local_inventories_client_stub do + # Create client + client = ::Google::Cloud::Retail::V2::ProductService::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.remove_local_inventories({ product: product, place_ids: place_ids, remove_time: remove_time, allow_missing: allow_missing }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.remove_local_inventories product: product, place_ids: place_ids, remove_time: remove_time, allow_missing: allow_missing do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.remove_local_inventories ::Google::Cloud::Retail::V2::RemoveLocalInventoriesRequest.new(product: product, place_ids: place_ids, remove_time: remove_time, allow_missing: allow_missing) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + client.remove_local_inventories({ product: product, place_ids: place_ids, remove_time: remove_time, allow_missing: allow_missing }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + client.remove_local_inventories(::Google::Cloud::Retail::V2::RemoveLocalInventoriesRequest.new(product: product, place_ids: place_ids, remove_time: remove_time, allow_missing: allow_missing), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, remove_local_inventories_client_stub.call_count + end + end + end + + def test_configure + credentials_token = :dummy_value + + client = block_config = config = nil + dummy_stub = ClientStub.new nil + Gapic::Rest::ClientStub.stub :new, dummy_stub do + client = ::Google::Cloud::Retail::V2::ProductService::Rest::Client.new do |config| + config.credentials = credentials_token + end + end + + config = client.configure do |c| + block_config = c + end + + assert_same block_config, config + assert_kind_of ::Google::Cloud::Retail::V2::ProductService::Rest::Client::Configuration, config + end +end diff --git a/owl-bot-staging/google-cloud-retail-v2/test/google/cloud/retail/v2/product_service_test.rb b/owl-bot-staging/google-cloud-retail-v2/test/google/cloud/retail/v2/product_service_test.rb new file mode 100644 index 000000000000..d1e30b41d491 --- /dev/null +++ b/owl-bot-staging/google-cloud-retail-v2/test/google/cloud/retail/v2/product_service_test.rb @@ -0,0 +1,922 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +require "helper" + +require "gapic/grpc/service_stub" + +require "google/cloud/retail/v2/product_service_pb" +require "google/cloud/retail/v2/product_service" + +class ::Google::Cloud::Retail::V2::ProductService::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_product + # Create GRPC objects. + grpc_response = ::Google::Cloud::Retail::V2::Product.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" + product = {} + product_id = "hello world" + + create_product_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :create_product, name + assert_kind_of ::Google::Cloud::Retail::V2::CreateProductRequest, request + assert_equal "hello world", request["parent"] + assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::Retail::V2::Product), request["product"] + assert_equal "hello world", request["product_id"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, create_product_client_stub do + # Create client + client = ::Google::Cloud::Retail::V2::ProductService::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.create_product({ parent: parent, product: product, product_id: product_id }) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use named arguments + client.create_product parent: parent, product: product, product_id: product_id do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.create_product ::Google::Cloud::Retail::V2::CreateProductRequest.new(parent: parent, product: product, product_id: product_id) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use hash object with options + client.create_product({ parent: parent, product: product, product_id: product_id }, grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object with options + client.create_product(::Google::Cloud::Retail::V2::CreateProductRequest.new(parent: parent, product: product, product_id: product_id), grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Verify method calls + assert_equal 5, create_product_client_stub.call_rpc_count + end + end + + def test_get_product + # Create GRPC objects. + grpc_response = ::Google::Cloud::Retail::V2::Product.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_product_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :get_product, name + assert_kind_of ::Google::Cloud::Retail::V2::GetProductRequest, request + assert_equal "hello world", request["name"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, get_product_client_stub do + # Create client + client = ::Google::Cloud::Retail::V2::ProductService::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.get_product({ name: name }) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use named arguments + client.get_product name: name do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.get_product ::Google::Cloud::Retail::V2::GetProductRequest.new(name: name) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use hash object with options + client.get_product({ 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_product(::Google::Cloud::Retail::V2::GetProductRequest.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_product_client_stub.call_rpc_count + end + end + + def test_list_products + # Create GRPC objects. + grpc_response = ::Google::Cloud::Retail::V2::ListProductsResponse.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" + read_mask = {} + + list_products_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :list_products, name + assert_kind_of ::Google::Cloud::Retail::V2::ListProductsRequest, 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"] + assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Protobuf::FieldMask), request["read_mask"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, list_products_client_stub do + # Create client + client = ::Google::Cloud::Retail::V2::ProductService::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.list_products({ parent: parent, page_size: page_size, page_token: page_token, filter: filter, read_mask: read_mask }) 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_products parent: parent, page_size: page_size, page_token: page_token, filter: filter, read_mask: read_mask 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_products ::Google::Cloud::Retail::V2::ListProductsRequest.new(parent: parent, page_size: page_size, page_token: page_token, filter: filter, read_mask: read_mask) 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_products({ parent: parent, page_size: page_size, page_token: page_token, filter: filter, read_mask: read_mask }, 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_products(::Google::Cloud::Retail::V2::ListProductsRequest.new(parent: parent, page_size: page_size, page_token: page_token, filter: filter, read_mask: read_mask), 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_products_client_stub.call_rpc_count + end + end + + def test_update_product + # Create GRPC objects. + grpc_response = ::Google::Cloud::Retail::V2::Product.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. + product = {} + update_mask = {} + allow_missing = true + + update_product_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :update_product, name + assert_kind_of ::Google::Cloud::Retail::V2::UpdateProductRequest, request + assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::Retail::V2::Product), request["product"] + assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Protobuf::FieldMask), request["update_mask"] + assert_equal true, request["allow_missing"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, update_product_client_stub do + # Create client + client = ::Google::Cloud::Retail::V2::ProductService::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.update_product({ product: product, update_mask: update_mask, allow_missing: allow_missing }) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use named arguments + client.update_product product: product, update_mask: update_mask, allow_missing: allow_missing do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.update_product ::Google::Cloud::Retail::V2::UpdateProductRequest.new(product: product, update_mask: update_mask, allow_missing: allow_missing) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use hash object with options + client.update_product({ product: product, update_mask: update_mask, allow_missing: allow_missing }, grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object with options + client.update_product(::Google::Cloud::Retail::V2::UpdateProductRequest.new(product: product, update_mask: update_mask, allow_missing: allow_missing), grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Verify method calls + assert_equal 5, update_product_client_stub.call_rpc_count + end + end + + def test_delete_product + # 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_product_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :delete_product, name + assert_kind_of ::Google::Cloud::Retail::V2::DeleteProductRequest, request + assert_equal "hello world", request["name"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, delete_product_client_stub do + # Create client + client = ::Google::Cloud::Retail::V2::ProductService::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.delete_product({ name: name }) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use named arguments + client.delete_product name: name do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.delete_product ::Google::Cloud::Retail::V2::DeleteProductRequest.new(name: name) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use hash object with options + client.delete_product({ 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_product(::Google::Cloud::Retail::V2::DeleteProductRequest.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_product_client_stub.call_rpc_count + end + end + + def test_purge_products + # 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" + filter = "hello world" + force = true + + purge_products_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :purge_products, name + assert_kind_of ::Google::Cloud::Retail::V2::PurgeProductsRequest, request + assert_equal "hello world", request["parent"] + assert_equal "hello world", request["filter"] + assert_equal true, request["force"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, purge_products_client_stub do + # Create client + client = ::Google::Cloud::Retail::V2::ProductService::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.purge_products({ parent: parent, filter: filter, 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.purge_products parent: parent, filter: filter, 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.purge_products ::Google::Cloud::Retail::V2::PurgeProductsRequest.new(parent: parent, filter: filter, 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.purge_products({ parent: parent, filter: filter, 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.purge_products(::Google::Cloud::Retail::V2::PurgeProductsRequest.new(parent: parent, filter: filter, 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, purge_products_client_stub.call_rpc_count + end + end + + def test_import_products + # 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" + request_id = "hello world" + input_config = {} + errors_config = {} + update_mask = {} + reconciliation_mode = :RECONCILIATION_MODE_UNSPECIFIED + notification_pubsub_topic = "hello world" + + import_products_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :import_products, name + assert_kind_of ::Google::Cloud::Retail::V2::ImportProductsRequest, request + assert_equal "hello world", request["parent"] + assert_equal "hello world", request["request_id"] + assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::Retail::V2::ProductInputConfig), request["input_config"] + assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::Retail::V2::ImportErrorsConfig), request["errors_config"] + assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Protobuf::FieldMask), request["update_mask"] + assert_equal :RECONCILIATION_MODE_UNSPECIFIED, request["reconciliation_mode"] + assert_equal "hello world", request["notification_pubsub_topic"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, import_products_client_stub do + # Create client + client = ::Google::Cloud::Retail::V2::ProductService::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.import_products({ parent: parent, request_id: request_id, input_config: input_config, errors_config: errors_config, update_mask: update_mask, reconciliation_mode: reconciliation_mode, notification_pubsub_topic: notification_pubsub_topic }) 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.import_products parent: parent, request_id: request_id, input_config: input_config, errors_config: errors_config, update_mask: update_mask, reconciliation_mode: reconciliation_mode, notification_pubsub_topic: notification_pubsub_topic 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.import_products ::Google::Cloud::Retail::V2::ImportProductsRequest.new(parent: parent, request_id: request_id, input_config: input_config, errors_config: errors_config, update_mask: update_mask, reconciliation_mode: reconciliation_mode, notification_pubsub_topic: notification_pubsub_topic) 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.import_products({ parent: parent, request_id: request_id, input_config: input_config, errors_config: errors_config, update_mask: update_mask, reconciliation_mode: reconciliation_mode, notification_pubsub_topic: notification_pubsub_topic }, 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.import_products(::Google::Cloud::Retail::V2::ImportProductsRequest.new(parent: parent, request_id: request_id, input_config: input_config, errors_config: errors_config, update_mask: update_mask, reconciliation_mode: reconciliation_mode, notification_pubsub_topic: notification_pubsub_topic), 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, import_products_client_stub.call_rpc_count + end + end + + def test_set_inventory + # 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. + inventory = {} + set_mask = {} + set_time = {} + allow_missing = true + + set_inventory_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :set_inventory, name + assert_kind_of ::Google::Cloud::Retail::V2::SetInventoryRequest, request + assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::Retail::V2::Product), request["inventory"] + assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Protobuf::FieldMask), request["set_mask"] + assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Protobuf::Timestamp), request["set_time"] + assert_equal true, request["allow_missing"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, set_inventory_client_stub do + # Create client + client = ::Google::Cloud::Retail::V2::ProductService::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.set_inventory({ inventory: inventory, set_mask: set_mask, set_time: set_time, allow_missing: allow_missing }) 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.set_inventory inventory: inventory, set_mask: set_mask, set_time: set_time, allow_missing: allow_missing 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.set_inventory ::Google::Cloud::Retail::V2::SetInventoryRequest.new(inventory: inventory, set_mask: set_mask, set_time: set_time, allow_missing: allow_missing) 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.set_inventory({ inventory: inventory, set_mask: set_mask, set_time: set_time, allow_missing: allow_missing }, 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.set_inventory(::Google::Cloud::Retail::V2::SetInventoryRequest.new(inventory: inventory, set_mask: set_mask, set_time: set_time, allow_missing: allow_missing), 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, set_inventory_client_stub.call_rpc_count + end + end + + def test_add_fulfillment_places + # 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. + product = "hello world" + type = "hello world" + place_ids = ["hello world"] + add_time = {} + allow_missing = true + + add_fulfillment_places_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :add_fulfillment_places, name + assert_kind_of ::Google::Cloud::Retail::V2::AddFulfillmentPlacesRequest, request + assert_equal "hello world", request["product"] + assert_equal "hello world", request["type"] + assert_equal ["hello world"], request["place_ids"] + assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Protobuf::Timestamp), request["add_time"] + assert_equal true, request["allow_missing"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, add_fulfillment_places_client_stub do + # Create client + client = ::Google::Cloud::Retail::V2::ProductService::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.add_fulfillment_places({ product: product, type: type, place_ids: place_ids, add_time: add_time, allow_missing: allow_missing }) 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.add_fulfillment_places product: product, type: type, place_ids: place_ids, add_time: add_time, allow_missing: allow_missing 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.add_fulfillment_places ::Google::Cloud::Retail::V2::AddFulfillmentPlacesRequest.new(product: product, type: type, place_ids: place_ids, add_time: add_time, allow_missing: allow_missing) 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.add_fulfillment_places({ product: product, type: type, place_ids: place_ids, add_time: add_time, allow_missing: allow_missing }, 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.add_fulfillment_places(::Google::Cloud::Retail::V2::AddFulfillmentPlacesRequest.new(product: product, type: type, place_ids: place_ids, add_time: add_time, allow_missing: allow_missing), 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, add_fulfillment_places_client_stub.call_rpc_count + end + end + + def test_remove_fulfillment_places + # 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. + product = "hello world" + type = "hello world" + place_ids = ["hello world"] + remove_time = {} + allow_missing = true + + remove_fulfillment_places_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :remove_fulfillment_places, name + assert_kind_of ::Google::Cloud::Retail::V2::RemoveFulfillmentPlacesRequest, request + assert_equal "hello world", request["product"] + assert_equal "hello world", request["type"] + assert_equal ["hello world"], request["place_ids"] + assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Protobuf::Timestamp), request["remove_time"] + assert_equal true, request["allow_missing"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, remove_fulfillment_places_client_stub do + # Create client + client = ::Google::Cloud::Retail::V2::ProductService::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.remove_fulfillment_places({ product: product, type: type, place_ids: place_ids, remove_time: remove_time, allow_missing: allow_missing }) 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.remove_fulfillment_places product: product, type: type, place_ids: place_ids, remove_time: remove_time, allow_missing: allow_missing 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.remove_fulfillment_places ::Google::Cloud::Retail::V2::RemoveFulfillmentPlacesRequest.new(product: product, type: type, place_ids: place_ids, remove_time: remove_time, allow_missing: allow_missing) 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.remove_fulfillment_places({ product: product, type: type, place_ids: place_ids, remove_time: remove_time, allow_missing: allow_missing }, 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.remove_fulfillment_places(::Google::Cloud::Retail::V2::RemoveFulfillmentPlacesRequest.new(product: product, type: type, place_ids: place_ids, remove_time: remove_time, allow_missing: allow_missing), 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, remove_fulfillment_places_client_stub.call_rpc_count + end + end + + def test_add_local_inventories + # 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. + product = "hello world" + local_inventories = [{}] + add_mask = {} + add_time = {} + allow_missing = true + + add_local_inventories_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :add_local_inventories, name + assert_kind_of ::Google::Cloud::Retail::V2::AddLocalInventoriesRequest, request + assert_equal "hello world", request["product"] + assert_kind_of ::Google::Cloud::Retail::V2::LocalInventory, request["local_inventories"].first + assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Protobuf::FieldMask), request["add_mask"] + assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Protobuf::Timestamp), request["add_time"] + assert_equal true, request["allow_missing"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, add_local_inventories_client_stub do + # Create client + client = ::Google::Cloud::Retail::V2::ProductService::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.add_local_inventories({ product: product, local_inventories: local_inventories, add_mask: add_mask, add_time: add_time, allow_missing: allow_missing }) 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.add_local_inventories product: product, local_inventories: local_inventories, add_mask: add_mask, add_time: add_time, allow_missing: allow_missing 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.add_local_inventories ::Google::Cloud::Retail::V2::AddLocalInventoriesRequest.new(product: product, local_inventories: local_inventories, add_mask: add_mask, add_time: add_time, allow_missing: allow_missing) 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.add_local_inventories({ product: product, local_inventories: local_inventories, add_mask: add_mask, add_time: add_time, allow_missing: allow_missing }, 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.add_local_inventories(::Google::Cloud::Retail::V2::AddLocalInventoriesRequest.new(product: product, local_inventories: local_inventories, add_mask: add_mask, add_time: add_time, allow_missing: allow_missing), 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, add_local_inventories_client_stub.call_rpc_count + end + end + + def test_remove_local_inventories + # 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. + product = "hello world" + place_ids = ["hello world"] + remove_time = {} + allow_missing = true + + remove_local_inventories_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :remove_local_inventories, name + assert_kind_of ::Google::Cloud::Retail::V2::RemoveLocalInventoriesRequest, request + assert_equal "hello world", request["product"] + assert_equal ["hello world"], request["place_ids"] + assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Protobuf::Timestamp), request["remove_time"] + assert_equal true, request["allow_missing"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, remove_local_inventories_client_stub do + # Create client + client = ::Google::Cloud::Retail::V2::ProductService::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.remove_local_inventories({ product: product, place_ids: place_ids, remove_time: remove_time, allow_missing: allow_missing }) 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.remove_local_inventories product: product, place_ids: place_ids, remove_time: remove_time, allow_missing: allow_missing 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.remove_local_inventories ::Google::Cloud::Retail::V2::RemoveLocalInventoriesRequest.new(product: product, place_ids: place_ids, remove_time: remove_time, allow_missing: allow_missing) 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.remove_local_inventories({ product: product, place_ids: place_ids, remove_time: remove_time, allow_missing: allow_missing }, 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.remove_local_inventories(::Google::Cloud::Retail::V2::RemoveLocalInventoriesRequest.new(product: product, place_ids: place_ids, remove_time: remove_time, allow_missing: allow_missing), 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, remove_local_inventories_client_stub.call_rpc_count + end + end + + def test_configure + grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + + client = block_config = config = nil + dummy_stub = ClientStub.new nil, nil + Gapic::ServiceStub.stub :new, dummy_stub do + client = ::Google::Cloud::Retail::V2::ProductService::Client.new do |config| + config.credentials = grpc_channel + end + end + + config = client.configure do |c| + block_config = c + end + + assert_same block_config, config + assert_kind_of ::Google::Cloud::Retail::V2::ProductService::Client::Configuration, config + end + + def test_credentials + key = OpenSSL::PKey::RSA.new 2048 + cred_json = { + "private_key" => key.to_pem, + "client_email" => "app@developer.gserviceaccount.com", + "type" => "service_account" + } + key_file = StringIO.new cred_json.to_json + creds = Google::Auth::ServiceAccountCredentials.make_creds({ json_key_io: key_file }) + + dummy_stub = ClientStub.new nil, nil + Gapic::ServiceStub.stub :new, dummy_stub do + client = ::Google::Cloud::Retail::V2::ProductService::Client.new do |config| + config.credentials = creds + end + assert_kind_of ::Google::Cloud::Retail::V2::ProductService::Client, client + assert_equal creds, client.configure.credentials + end + end + + def test_operations_client + grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + + client = nil + dummy_stub = ClientStub.new nil, nil + Gapic::ServiceStub.stub :new, dummy_stub do + client = ::Google::Cloud::Retail::V2::ProductService::Client.new do |config| + config.credentials = grpc_channel + end + end + + assert_kind_of ::Google::Cloud::Retail::V2::ProductService::Operations, client.operations_client + end +end diff --git a/owl-bot-staging/google-cloud-retail-v2/test/google/cloud/retail/v2/search_service_paths_test.rb b/owl-bot-staging/google-cloud-retail-v2/test/google/cloud/retail/v2/search_service_paths_test.rb new file mode 100644 index 000000000000..666f380e368d --- /dev/null +++ b/owl-bot-staging/google-cloud-retail-v2/test/google/cloud/retail/v2/search_service_paths_test.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 "helper" + +require "gapic/grpc/service_stub" + +require "google/cloud/retail/v2/search_service" + +class ::Google::Cloud::Retail::V2::SearchService::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_branch_path + grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + ::Gapic::ServiceStub.stub :new, DummyStub.new do + client = ::Google::Cloud::Retail::V2::SearchService::Client.new do |config| + config.credentials = grpc_channel + end + + path = client.branch_path project: "value0", location: "value1", catalog: "value2", branch: "value3" + assert_equal "projects/value0/locations/value1/catalogs/value2/branches/value3", path + end + end +end diff --git a/owl-bot-staging/google-cloud-retail-v2/test/google/cloud/retail/v2/search_service_rest_test.rb b/owl-bot-staging/google-cloud-retail-v2/test/google/cloud/retail/v2/search_service_rest_test.rb new file mode 100644 index 000000000000..412999d3965e --- /dev/null +++ b/owl-bot-staging/google-cloud-retail-v2/test/google/cloud/retail/v2/search_service_rest_test.rb @@ -0,0 +1,180 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +require "helper" +require "gapic/rest" +require "google/cloud/retail/v2/search_service_pb" +require "google/cloud/retail/v2/search_service/rest" + + +class ::Google::Cloud::Retail::V2::SearchService::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_search + # Create test objects. + client_result = ::Google::Cloud::Retail::V2::SearchResponse.new + http_response = OpenStruct.new body: client_result.to_json + + call_options = {} + + # Create request parameters for a unary method. + placement = "hello world" + branch = "hello world" + query = "hello world" + visitor_id = "hello world" + user_info = {} + page_size = 42 + page_token = "hello world" + offset = 42 + filter = "hello world" + canonical_filter = "hello world" + order_by = "hello world" + facet_specs = [{}] + dynamic_facet_spec = {} + boost_spec = {} + query_expansion_spec = {} + variant_rollup_keys = ["hello world"] + page_categories = ["hello world"] + search_mode = :SEARCH_MODE_UNSPECIFIED + personalization_spec = {} + labels = {} + spell_correction_spec = {} + entity = "hello world" + conversational_search_spec = {} + tile_navigation_spec = {} + language_code = "hello world" + region_code = "hello world" + place_id = "hello world" + user_attributes = {} + + search_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| + assert options.metadata.key? :"x-goog-api-client" + assert options.metadata[:"x-goog-api-client"].include? "rest" + refute options.metadata[:"x-goog-api-client"].include? "grpc" + end + + ::Google::Cloud::Retail::V2::SearchService::Rest::ServiceStub.stub :transcode_search_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, search_client_stub do + # Create client + client = ::Google::Cloud::Retail::V2::SearchService::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.search({ placement: placement, branch: branch, query: query, visitor_id: visitor_id, user_info: user_info, page_size: page_size, page_token: page_token, offset: offset, filter: filter, canonical_filter: canonical_filter, order_by: order_by, facet_specs: facet_specs, dynamic_facet_spec: dynamic_facet_spec, boost_spec: boost_spec, query_expansion_spec: query_expansion_spec, variant_rollup_keys: variant_rollup_keys, page_categories: page_categories, search_mode: search_mode, personalization_spec: personalization_spec, labels: labels, spell_correction_spec: spell_correction_spec, entity: entity, conversational_search_spec: conversational_search_spec, tile_navigation_spec: tile_navigation_spec, language_code: language_code, region_code: region_code, place_id: place_id, user_attributes: user_attributes }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.search placement: placement, branch: branch, query: query, visitor_id: visitor_id, user_info: user_info, page_size: page_size, page_token: page_token, offset: offset, filter: filter, canonical_filter: canonical_filter, order_by: order_by, facet_specs: facet_specs, dynamic_facet_spec: dynamic_facet_spec, boost_spec: boost_spec, query_expansion_spec: query_expansion_spec, variant_rollup_keys: variant_rollup_keys, page_categories: page_categories, search_mode: search_mode, personalization_spec: personalization_spec, labels: labels, spell_correction_spec: spell_correction_spec, entity: entity, conversational_search_spec: conversational_search_spec, tile_navigation_spec: tile_navigation_spec, language_code: language_code, region_code: region_code, place_id: place_id, user_attributes: user_attributes do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.search ::Google::Cloud::Retail::V2::SearchRequest.new(placement: placement, branch: branch, query: query, visitor_id: visitor_id, user_info: user_info, page_size: page_size, page_token: page_token, offset: offset, filter: filter, canonical_filter: canonical_filter, order_by: order_by, facet_specs: facet_specs, dynamic_facet_spec: dynamic_facet_spec, boost_spec: boost_spec, query_expansion_spec: query_expansion_spec, variant_rollup_keys: variant_rollup_keys, page_categories: page_categories, search_mode: search_mode, personalization_spec: personalization_spec, labels: labels, spell_correction_spec: spell_correction_spec, entity: entity, conversational_search_spec: conversational_search_spec, tile_navigation_spec: tile_navigation_spec, language_code: language_code, region_code: region_code, place_id: place_id, user_attributes: user_attributes) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + client.search({ placement: placement, branch: branch, query: query, visitor_id: visitor_id, user_info: user_info, page_size: page_size, page_token: page_token, offset: offset, filter: filter, canonical_filter: canonical_filter, order_by: order_by, facet_specs: facet_specs, dynamic_facet_spec: dynamic_facet_spec, boost_spec: boost_spec, query_expansion_spec: query_expansion_spec, variant_rollup_keys: variant_rollup_keys, page_categories: page_categories, search_mode: search_mode, personalization_spec: personalization_spec, labels: labels, spell_correction_spec: spell_correction_spec, entity: entity, conversational_search_spec: conversational_search_spec, tile_navigation_spec: tile_navigation_spec, language_code: language_code, region_code: region_code, place_id: place_id, user_attributes: user_attributes }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + client.search(::Google::Cloud::Retail::V2::SearchRequest.new(placement: placement, branch: branch, query: query, visitor_id: visitor_id, user_info: user_info, page_size: page_size, page_token: page_token, offset: offset, filter: filter, canonical_filter: canonical_filter, order_by: order_by, facet_specs: facet_specs, dynamic_facet_spec: dynamic_facet_spec, boost_spec: boost_spec, query_expansion_spec: query_expansion_spec, variant_rollup_keys: variant_rollup_keys, page_categories: page_categories, search_mode: search_mode, personalization_spec: personalization_spec, labels: labels, spell_correction_spec: spell_correction_spec, entity: entity, conversational_search_spec: conversational_search_spec, tile_navigation_spec: tile_navigation_spec, language_code: language_code, region_code: region_code, place_id: place_id, user_attributes: user_attributes), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, search_client_stub.call_count + end + end + end + + def test_configure + credentials_token = :dummy_value + + client = block_config = config = nil + dummy_stub = ClientStub.new nil + Gapic::Rest::ClientStub.stub :new, dummy_stub do + client = ::Google::Cloud::Retail::V2::SearchService::Rest::Client.new do |config| + config.credentials = credentials_token + end + end + + config = client.configure do |c| + block_config = c + end + + assert_same block_config, config + assert_kind_of ::Google::Cloud::Retail::V2::SearchService::Rest::Client::Configuration, config + end +end diff --git a/owl-bot-staging/google-cloud-retail-v2/test/google/cloud/retail/v2/search_service_test.rb b/owl-bot-staging/google-cloud-retail-v2/test/google/cloud/retail/v2/search_service_test.rb new file mode 100644 index 000000000000..a005e4e2cc3e --- /dev/null +++ b/owl-bot-staging/google-cloud-retail-v2/test/google/cloud/retail/v2/search_service_test.rb @@ -0,0 +1,222 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +require "helper" + +require "gapic/grpc/service_stub" + +require "google/cloud/retail/v2/search_service_pb" +require "google/cloud/retail/v2/search_service" + +class ::Google::Cloud::Retail::V2::SearchService::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_search + # Create GRPC objects. + grpc_response = ::Google::Cloud::Retail::V2::SearchResponse.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. + placement = "hello world" + branch = "hello world" + query = "hello world" + visitor_id = "hello world" + user_info = {} + page_size = 42 + page_token = "hello world" + offset = 42 + filter = "hello world" + canonical_filter = "hello world" + order_by = "hello world" + facet_specs = [{}] + dynamic_facet_spec = {} + boost_spec = {} + query_expansion_spec = {} + variant_rollup_keys = ["hello world"] + page_categories = ["hello world"] + search_mode = :SEARCH_MODE_UNSPECIFIED + personalization_spec = {} + labels = {} + spell_correction_spec = {} + entity = "hello world" + conversational_search_spec = {} + tile_navigation_spec = {} + language_code = "hello world" + region_code = "hello world" + place_id = "hello world" + user_attributes = {} + + search_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :search, name + assert_kind_of ::Google::Cloud::Retail::V2::SearchRequest, request + assert_equal "hello world", request["placement"] + assert_equal "hello world", request["branch"] + assert_equal "hello world", request["query"] + assert_equal "hello world", request["visitor_id"] + assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::Retail::V2::UserInfo), request["user_info"] + assert_equal 42, request["page_size"] + assert_equal "hello world", request["page_token"] + assert_equal 42, request["offset"] + assert_equal "hello world", request["filter"] + assert_equal "hello world", request["canonical_filter"] + assert_equal "hello world", request["order_by"] + assert_kind_of ::Google::Cloud::Retail::V2::SearchRequest::FacetSpec, request["facet_specs"].first + assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::Retail::V2::SearchRequest::DynamicFacetSpec), request["dynamic_facet_spec"] + assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::Retail::V2::SearchRequest::BoostSpec), request["boost_spec"] + assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::Retail::V2::SearchRequest::QueryExpansionSpec), request["query_expansion_spec"] + assert_equal ["hello world"], request["variant_rollup_keys"] + assert_equal ["hello world"], request["page_categories"] + assert_equal :SEARCH_MODE_UNSPECIFIED, request["search_mode"] + assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::Retail::V2::SearchRequest::PersonalizationSpec), request["personalization_spec"] + assert_equal({}, request["labels"].to_h) + assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::Retail::V2::SearchRequest::SpellCorrectionSpec), request["spell_correction_spec"] + assert request.has_spell_correction_spec? + assert_equal "hello world", request["entity"] + assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::Retail::V2::SearchRequest::ConversationalSearchSpec), request["conversational_search_spec"] + assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::Retail::V2::SearchRequest::TileNavigationSpec), request["tile_navigation_spec"] + assert_equal "hello world", request["language_code"] + assert_equal "hello world", request["region_code"] + assert_equal "hello world", request["place_id"] + assert_equal({}, request["user_attributes"].to_h) + refute_nil options + end + + Gapic::ServiceStub.stub :new, search_client_stub do + # Create client + client = ::Google::Cloud::Retail::V2::SearchService::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.search({ placement: placement, branch: branch, query: query, visitor_id: visitor_id, user_info: user_info, page_size: page_size, page_token: page_token, offset: offset, filter: filter, canonical_filter: canonical_filter, order_by: order_by, facet_specs: facet_specs, dynamic_facet_spec: dynamic_facet_spec, boost_spec: boost_spec, query_expansion_spec: query_expansion_spec, variant_rollup_keys: variant_rollup_keys, page_categories: page_categories, search_mode: search_mode, personalization_spec: personalization_spec, labels: labels, spell_correction_spec: spell_correction_spec, entity: entity, conversational_search_spec: conversational_search_spec, tile_navigation_spec: tile_navigation_spec, language_code: language_code, region_code: region_code, place_id: place_id, user_attributes: user_attributes }) 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 placement: placement, branch: branch, query: query, visitor_id: visitor_id, user_info: user_info, page_size: page_size, page_token: page_token, offset: offset, filter: filter, canonical_filter: canonical_filter, order_by: order_by, facet_specs: facet_specs, dynamic_facet_spec: dynamic_facet_spec, boost_spec: boost_spec, query_expansion_spec: query_expansion_spec, variant_rollup_keys: variant_rollup_keys, page_categories: page_categories, search_mode: search_mode, personalization_spec: personalization_spec, labels: labels, spell_correction_spec: spell_correction_spec, entity: entity, conversational_search_spec: conversational_search_spec, tile_navigation_spec: tile_navigation_spec, language_code: language_code, region_code: region_code, place_id: place_id, user_attributes: user_attributes 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 ::Google::Cloud::Retail::V2::SearchRequest.new(placement: placement, branch: branch, query: query, visitor_id: visitor_id, user_info: user_info, page_size: page_size, page_token: page_token, offset: offset, filter: filter, canonical_filter: canonical_filter, order_by: order_by, facet_specs: facet_specs, dynamic_facet_spec: dynamic_facet_spec, boost_spec: boost_spec, query_expansion_spec: query_expansion_spec, variant_rollup_keys: variant_rollup_keys, page_categories: page_categories, search_mode: search_mode, personalization_spec: personalization_spec, labels: labels, spell_correction_spec: spell_correction_spec, entity: entity, conversational_search_spec: conversational_search_spec, tile_navigation_spec: tile_navigation_spec, language_code: language_code, region_code: region_code, place_id: place_id, user_attributes: user_attributes) 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({ placement: placement, branch: branch, query: query, visitor_id: visitor_id, user_info: user_info, page_size: page_size, page_token: page_token, offset: offset, filter: filter, canonical_filter: canonical_filter, order_by: order_by, facet_specs: facet_specs, dynamic_facet_spec: dynamic_facet_spec, boost_spec: boost_spec, query_expansion_spec: query_expansion_spec, variant_rollup_keys: variant_rollup_keys, page_categories: page_categories, search_mode: search_mode, personalization_spec: personalization_spec, labels: labels, spell_correction_spec: spell_correction_spec, entity: entity, conversational_search_spec: conversational_search_spec, tile_navigation_spec: tile_navigation_spec, language_code: language_code, region_code: region_code, place_id: place_id, user_attributes: user_attributes }, 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(::Google::Cloud::Retail::V2::SearchRequest.new(placement: placement, branch: branch, query: query, visitor_id: visitor_id, user_info: user_info, page_size: page_size, page_token: page_token, offset: offset, filter: filter, canonical_filter: canonical_filter, order_by: order_by, facet_specs: facet_specs, dynamic_facet_spec: dynamic_facet_spec, boost_spec: boost_spec, query_expansion_spec: query_expansion_spec, variant_rollup_keys: variant_rollup_keys, page_categories: page_categories, search_mode: search_mode, personalization_spec: personalization_spec, labels: labels, spell_correction_spec: spell_correction_spec, entity: entity, conversational_search_spec: conversational_search_spec, tile_navigation_spec: tile_navigation_spec, language_code: language_code, region_code: region_code, place_id: place_id, user_attributes: user_attributes), 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_client_stub.call_rpc_count + end + end + + def test_configure + grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + + client = block_config = config = nil + dummy_stub = ClientStub.new nil, nil + Gapic::ServiceStub.stub :new, dummy_stub do + client = ::Google::Cloud::Retail::V2::SearchService::Client.new do |config| + config.credentials = grpc_channel + end + end + + config = client.configure do |c| + block_config = c + end + + assert_same block_config, config + assert_kind_of ::Google::Cloud::Retail::V2::SearchService::Client::Configuration, config + end + + def test_credentials + key = OpenSSL::PKey::RSA.new 2048 + cred_json = { + "private_key" => key.to_pem, + "client_email" => "app@developer.gserviceaccount.com", + "type" => "service_account" + } + key_file = StringIO.new cred_json.to_json + creds = Google::Auth::ServiceAccountCredentials.make_creds({ json_key_io: key_file }) + + dummy_stub = ClientStub.new nil, nil + Gapic::ServiceStub.stub :new, dummy_stub do + client = ::Google::Cloud::Retail::V2::SearchService::Client.new do |config| + config.credentials = creds + end + assert_kind_of ::Google::Cloud::Retail::V2::SearchService::Client, client + assert_equal creds, client.configure.credentials + end + end +end diff --git a/owl-bot-staging/google-cloud-retail-v2/test/google/cloud/retail/v2/serving_config_service_paths_test.rb b/owl-bot-staging/google-cloud-retail-v2/test/google/cloud/retail/v2/serving_config_service_paths_test.rb new file mode 100644 index 000000000000..68252813b8a3 --- /dev/null +++ b/owl-bot-staging/google-cloud-retail-v2/test/google/cloud/retail/v2/serving_config_service_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/cloud/retail/v2/serving_config_service" + +class ::Google::Cloud::Retail::V2::ServingConfigService::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_catalog_path + grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + ::Gapic::ServiceStub.stub :new, DummyStub.new do + client = ::Google::Cloud::Retail::V2::ServingConfigService::Client.new do |config| + config.credentials = grpc_channel + end + + path = client.catalog_path project: "value0", location: "value1", catalog: "value2" + assert_equal "projects/value0/locations/value1/catalogs/value2", path + end + end + + def test_serving_config_path + grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + ::Gapic::ServiceStub.stub :new, DummyStub.new do + client = ::Google::Cloud::Retail::V2::ServingConfigService::Client.new do |config| + config.credentials = grpc_channel + end + + path = client.serving_config_path project: "value0", location: "value1", catalog: "value2", serving_config: "value3" + assert_equal "projects/value0/locations/value1/catalogs/value2/servingConfigs/value3", path + end + end +end diff --git a/owl-bot-staging/google-cloud-retail-v2/test/google/cloud/retail/v2/serving_config_service_rest_test.rb b/owl-bot-staging/google-cloud-retail-v2/test/google/cloud/retail/v2/serving_config_service_rest_test.rb new file mode 100644 index 000000000000..ac8e84b3513b --- /dev/null +++ b/owl-bot-staging/google-cloud-retail-v2/test/google/cloud/retail/v2/serving_config_service_rest_test.rb @@ -0,0 +1,484 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +require "helper" +require "gapic/rest" +require "google/cloud/retail/v2/serving_config_service_pb" +require "google/cloud/retail/v2/serving_config_service/rest" + + +class ::Google::Cloud::Retail::V2::ServingConfigService::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_serving_config + # Create test objects. + client_result = ::Google::Cloud::Retail::V2::ServingConfig.new + http_response = OpenStruct.new body: client_result.to_json + + call_options = {} + + # Create request parameters for a unary method. + parent = "hello world" + serving_config = {} + serving_config_id = "hello world" + + create_serving_config_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| + assert options.metadata.key? :"x-goog-api-client" + assert options.metadata[:"x-goog-api-client"].include? "rest" + refute options.metadata[:"x-goog-api-client"].include? "grpc" + end + + ::Google::Cloud::Retail::V2::ServingConfigService::Rest::ServiceStub.stub :transcode_create_serving_config_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, create_serving_config_client_stub do + # Create client + client = ::Google::Cloud::Retail::V2::ServingConfigService::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.create_serving_config({ parent: parent, serving_config: serving_config, serving_config_id: serving_config_id }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.create_serving_config parent: parent, serving_config: serving_config, serving_config_id: serving_config_id do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.create_serving_config ::Google::Cloud::Retail::V2::CreateServingConfigRequest.new(parent: parent, serving_config: serving_config, serving_config_id: serving_config_id) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + client.create_serving_config({ parent: parent, serving_config: serving_config, serving_config_id: serving_config_id }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + client.create_serving_config(::Google::Cloud::Retail::V2::CreateServingConfigRequest.new(parent: parent, serving_config: serving_config, serving_config_id: serving_config_id), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, create_serving_config_client_stub.call_count + end + end + end + + def test_delete_serving_config + # Create test objects. + client_result = ::Google::Protobuf::Empty.new + http_response = OpenStruct.new body: client_result.to_json + + call_options = {} + + # Create request parameters for a unary method. + name = "hello world" + + delete_serving_config_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| + assert options.metadata.key? :"x-goog-api-client" + assert options.metadata[:"x-goog-api-client"].include? "rest" + refute options.metadata[:"x-goog-api-client"].include? "grpc" + end + + ::Google::Cloud::Retail::V2::ServingConfigService::Rest::ServiceStub.stub :transcode_delete_serving_config_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, delete_serving_config_client_stub do + # Create client + client = ::Google::Cloud::Retail::V2::ServingConfigService::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.delete_serving_config({ name: name }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.delete_serving_config name: name do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.delete_serving_config ::Google::Cloud::Retail::V2::DeleteServingConfigRequest.new(name: name) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + client.delete_serving_config({ name: name }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + client.delete_serving_config(::Google::Cloud::Retail::V2::DeleteServingConfigRequest.new(name: name), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, delete_serving_config_client_stub.call_count + end + end + end + + def test_update_serving_config + # Create test objects. + client_result = ::Google::Cloud::Retail::V2::ServingConfig.new + http_response = OpenStruct.new body: client_result.to_json + + call_options = {} + + # Create request parameters for a unary method. + serving_config = {} + update_mask = {} + + update_serving_config_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| + assert options.metadata.key? :"x-goog-api-client" + assert options.metadata[:"x-goog-api-client"].include? "rest" + refute options.metadata[:"x-goog-api-client"].include? "grpc" + end + + ::Google::Cloud::Retail::V2::ServingConfigService::Rest::ServiceStub.stub :transcode_update_serving_config_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, update_serving_config_client_stub do + # Create client + client = ::Google::Cloud::Retail::V2::ServingConfigService::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.update_serving_config({ serving_config: serving_config, update_mask: update_mask }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.update_serving_config serving_config: serving_config, update_mask: update_mask do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.update_serving_config ::Google::Cloud::Retail::V2::UpdateServingConfigRequest.new(serving_config: serving_config, update_mask: update_mask) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + client.update_serving_config({ serving_config: serving_config, update_mask: update_mask }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + client.update_serving_config(::Google::Cloud::Retail::V2::UpdateServingConfigRequest.new(serving_config: serving_config, update_mask: update_mask), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, update_serving_config_client_stub.call_count + end + end + end + + def test_get_serving_config + # Create test objects. + client_result = ::Google::Cloud::Retail::V2::ServingConfig.new + http_response = OpenStruct.new body: client_result.to_json + + call_options = {} + + # Create request parameters for a unary method. + name = "hello world" + + get_serving_config_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| + assert options.metadata.key? :"x-goog-api-client" + assert options.metadata[:"x-goog-api-client"].include? "rest" + refute options.metadata[:"x-goog-api-client"].include? "grpc" + end + + ::Google::Cloud::Retail::V2::ServingConfigService::Rest::ServiceStub.stub :transcode_get_serving_config_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, get_serving_config_client_stub do + # Create client + client = ::Google::Cloud::Retail::V2::ServingConfigService::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.get_serving_config({ name: name }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.get_serving_config name: name do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.get_serving_config ::Google::Cloud::Retail::V2::GetServingConfigRequest.new(name: name) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + client.get_serving_config({ name: name }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + client.get_serving_config(::Google::Cloud::Retail::V2::GetServingConfigRequest.new(name: name), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, get_serving_config_client_stub.call_count + end + end + end + + def test_list_serving_configs + # Create test objects. + client_result = ::Google::Cloud::Retail::V2::ListServingConfigsResponse.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_serving_configs_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| + assert options.metadata.key? :"x-goog-api-client" + assert options.metadata[:"x-goog-api-client"].include? "rest" + refute options.metadata[:"x-goog-api-client"].include? "grpc" + end + + ::Google::Cloud::Retail::V2::ServingConfigService::Rest::ServiceStub.stub :transcode_list_serving_configs_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, list_serving_configs_client_stub do + # Create client + client = ::Google::Cloud::Retail::V2::ServingConfigService::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.list_serving_configs({ 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_serving_configs 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_serving_configs ::Google::Cloud::Retail::V2::ListServingConfigsRequest.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_serving_configs({ 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_serving_configs(::Google::Cloud::Retail::V2::ListServingConfigsRequest.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_serving_configs_client_stub.call_count + end + end + end + + def test_add_control + # Create test objects. + client_result = ::Google::Cloud::Retail::V2::ServingConfig.new + http_response = OpenStruct.new body: client_result.to_json + + call_options = {} + + # Create request parameters for a unary method. + serving_config = "hello world" + control_id = "hello world" + + add_control_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| + assert options.metadata.key? :"x-goog-api-client" + assert options.metadata[:"x-goog-api-client"].include? "rest" + refute options.metadata[:"x-goog-api-client"].include? "grpc" + end + + ::Google::Cloud::Retail::V2::ServingConfigService::Rest::ServiceStub.stub :transcode_add_control_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, add_control_client_stub do + # Create client + client = ::Google::Cloud::Retail::V2::ServingConfigService::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.add_control({ serving_config: serving_config, control_id: control_id }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.add_control serving_config: serving_config, control_id: control_id do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.add_control ::Google::Cloud::Retail::V2::AddControlRequest.new(serving_config: serving_config, control_id: control_id) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + client.add_control({ serving_config: serving_config, control_id: control_id }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + client.add_control(::Google::Cloud::Retail::V2::AddControlRequest.new(serving_config: serving_config, control_id: control_id), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, add_control_client_stub.call_count + end + end + end + + def test_remove_control + # Create test objects. + client_result = ::Google::Cloud::Retail::V2::ServingConfig.new + http_response = OpenStruct.new body: client_result.to_json + + call_options = {} + + # Create request parameters for a unary method. + serving_config = "hello world" + control_id = "hello world" + + remove_control_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| + assert options.metadata.key? :"x-goog-api-client" + assert options.metadata[:"x-goog-api-client"].include? "rest" + refute options.metadata[:"x-goog-api-client"].include? "grpc" + end + + ::Google::Cloud::Retail::V2::ServingConfigService::Rest::ServiceStub.stub :transcode_remove_control_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, remove_control_client_stub do + # Create client + client = ::Google::Cloud::Retail::V2::ServingConfigService::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.remove_control({ serving_config: serving_config, control_id: control_id }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.remove_control serving_config: serving_config, control_id: control_id do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.remove_control ::Google::Cloud::Retail::V2::RemoveControlRequest.new(serving_config: serving_config, control_id: control_id) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + client.remove_control({ serving_config: serving_config, control_id: control_id }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + client.remove_control(::Google::Cloud::Retail::V2::RemoveControlRequest.new(serving_config: serving_config, control_id: control_id), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, remove_control_client_stub.call_count + end + end + end + + def test_configure + credentials_token = :dummy_value + + client = block_config = config = nil + dummy_stub = ClientStub.new nil + Gapic::Rest::ClientStub.stub :new, dummy_stub do + client = ::Google::Cloud::Retail::V2::ServingConfigService::Rest::Client.new do |config| + config.credentials = credentials_token + end + end + + config = client.configure do |c| + block_config = c + end + + assert_same block_config, config + assert_kind_of ::Google::Cloud::Retail::V2::ServingConfigService::Rest::Client::Configuration, config + end +end diff --git a/owl-bot-staging/google-cloud-retail-v2/test/google/cloud/retail/v2/serving_config_service_test.rb b/owl-bot-staging/google-cloud-retail-v2/test/google/cloud/retail/v2/serving_config_service_test.rb new file mode 100644 index 000000000000..693621620896 --- /dev/null +++ b/owl-bot-staging/google-cloud-retail-v2/test/google/cloud/retail/v2/serving_config_service_test.rb @@ -0,0 +1,529 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +require "helper" + +require "gapic/grpc/service_stub" + +require "google/cloud/retail/v2/serving_config_service_pb" +require "google/cloud/retail/v2/serving_config_service" + +class ::Google::Cloud::Retail::V2::ServingConfigService::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_serving_config + # Create GRPC objects. + grpc_response = ::Google::Cloud::Retail::V2::ServingConfig.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" + serving_config = {} + serving_config_id = "hello world" + + create_serving_config_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :create_serving_config, name + assert_kind_of ::Google::Cloud::Retail::V2::CreateServingConfigRequest, request + assert_equal "hello world", request["parent"] + assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::Retail::V2::ServingConfig), request["serving_config"] + assert_equal "hello world", request["serving_config_id"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, create_serving_config_client_stub do + # Create client + client = ::Google::Cloud::Retail::V2::ServingConfigService::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.create_serving_config({ parent: parent, serving_config: serving_config, serving_config_id: serving_config_id }) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use named arguments + client.create_serving_config parent: parent, serving_config: serving_config, serving_config_id: serving_config_id do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.create_serving_config ::Google::Cloud::Retail::V2::CreateServingConfigRequest.new(parent: parent, serving_config: serving_config, serving_config_id: serving_config_id) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use hash object with options + client.create_serving_config({ parent: parent, serving_config: serving_config, serving_config_id: serving_config_id }, grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object with options + client.create_serving_config(::Google::Cloud::Retail::V2::CreateServingConfigRequest.new(parent: parent, serving_config: serving_config, serving_config_id: serving_config_id), grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Verify method calls + assert_equal 5, create_serving_config_client_stub.call_rpc_count + end + end + + def test_delete_serving_config + # 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_serving_config_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :delete_serving_config, name + assert_kind_of ::Google::Cloud::Retail::V2::DeleteServingConfigRequest, request + assert_equal "hello world", request["name"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, delete_serving_config_client_stub do + # Create client + client = ::Google::Cloud::Retail::V2::ServingConfigService::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.delete_serving_config({ name: name }) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use named arguments + client.delete_serving_config name: name do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.delete_serving_config ::Google::Cloud::Retail::V2::DeleteServingConfigRequest.new(name: name) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use hash object with options + client.delete_serving_config({ name: name }, grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object with options + client.delete_serving_config(::Google::Cloud::Retail::V2::DeleteServingConfigRequest.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_serving_config_client_stub.call_rpc_count + end + end + + def test_update_serving_config + # Create GRPC objects. + grpc_response = ::Google::Cloud::Retail::V2::ServingConfig.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. + serving_config = {} + update_mask = {} + + update_serving_config_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :update_serving_config, name + assert_kind_of ::Google::Cloud::Retail::V2::UpdateServingConfigRequest, request + assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::Retail::V2::ServingConfig), request["serving_config"] + assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Protobuf::FieldMask), request["update_mask"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, update_serving_config_client_stub do + # Create client + client = ::Google::Cloud::Retail::V2::ServingConfigService::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.update_serving_config({ serving_config: serving_config, update_mask: update_mask }) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use named arguments + client.update_serving_config serving_config: serving_config, update_mask: update_mask do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.update_serving_config ::Google::Cloud::Retail::V2::UpdateServingConfigRequest.new(serving_config: serving_config, update_mask: update_mask) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use hash object with options + client.update_serving_config({ serving_config: serving_config, update_mask: update_mask }, grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object with options + client.update_serving_config(::Google::Cloud::Retail::V2::UpdateServingConfigRequest.new(serving_config: serving_config, update_mask: update_mask), grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Verify method calls + assert_equal 5, update_serving_config_client_stub.call_rpc_count + end + end + + def test_get_serving_config + # Create GRPC objects. + grpc_response = ::Google::Cloud::Retail::V2::ServingConfig.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_serving_config_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :get_serving_config, name + assert_kind_of ::Google::Cloud::Retail::V2::GetServingConfigRequest, request + assert_equal "hello world", request["name"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, get_serving_config_client_stub do + # Create client + client = ::Google::Cloud::Retail::V2::ServingConfigService::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.get_serving_config({ name: name }) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use named arguments + client.get_serving_config name: name do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.get_serving_config ::Google::Cloud::Retail::V2::GetServingConfigRequest.new(name: name) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use hash object with options + client.get_serving_config({ name: name }, grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object with options + client.get_serving_config(::Google::Cloud::Retail::V2::GetServingConfigRequest.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_serving_config_client_stub.call_rpc_count + end + end + + def test_list_serving_configs + # Create GRPC objects. + grpc_response = ::Google::Cloud::Retail::V2::ListServingConfigsResponse.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_serving_configs_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :list_serving_configs, name + assert_kind_of ::Google::Cloud::Retail::V2::ListServingConfigsRequest, 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_serving_configs_client_stub do + # Create client + client = ::Google::Cloud::Retail::V2::ServingConfigService::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.list_serving_configs({ 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_serving_configs 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_serving_configs ::Google::Cloud::Retail::V2::ListServingConfigsRequest.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_serving_configs({ 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_serving_configs(::Google::Cloud::Retail::V2::ListServingConfigsRequest.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_serving_configs_client_stub.call_rpc_count + end + end + + def test_add_control + # Create GRPC objects. + grpc_response = ::Google::Cloud::Retail::V2::ServingConfig.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. + serving_config = "hello world" + control_id = "hello world" + + add_control_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :add_control, name + assert_kind_of ::Google::Cloud::Retail::V2::AddControlRequest, request + assert_equal "hello world", request["serving_config"] + assert_equal "hello world", request["control_id"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, add_control_client_stub do + # Create client + client = ::Google::Cloud::Retail::V2::ServingConfigService::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.add_control({ serving_config: serving_config, control_id: control_id }) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use named arguments + client.add_control serving_config: serving_config, control_id: control_id do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.add_control ::Google::Cloud::Retail::V2::AddControlRequest.new(serving_config: serving_config, control_id: control_id) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use hash object with options + client.add_control({ serving_config: serving_config, control_id: control_id }, grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object with options + client.add_control(::Google::Cloud::Retail::V2::AddControlRequest.new(serving_config: serving_config, control_id: control_id), grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Verify method calls + assert_equal 5, add_control_client_stub.call_rpc_count + end + end + + def test_remove_control + # Create GRPC objects. + grpc_response = ::Google::Cloud::Retail::V2::ServingConfig.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. + serving_config = "hello world" + control_id = "hello world" + + remove_control_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :remove_control, name + assert_kind_of ::Google::Cloud::Retail::V2::RemoveControlRequest, request + assert_equal "hello world", request["serving_config"] + assert_equal "hello world", request["control_id"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, remove_control_client_stub do + # Create client + client = ::Google::Cloud::Retail::V2::ServingConfigService::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.remove_control({ serving_config: serving_config, control_id: control_id }) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use named arguments + client.remove_control serving_config: serving_config, control_id: control_id do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.remove_control ::Google::Cloud::Retail::V2::RemoveControlRequest.new(serving_config: serving_config, control_id: control_id) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use hash object with options + client.remove_control({ serving_config: serving_config, control_id: control_id }, grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object with options + client.remove_control(::Google::Cloud::Retail::V2::RemoveControlRequest.new(serving_config: serving_config, control_id: control_id), grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Verify method calls + assert_equal 5, remove_control_client_stub.call_rpc_count + end + end + + def test_configure + grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + + client = block_config = config = nil + dummy_stub = ClientStub.new nil, nil + Gapic::ServiceStub.stub :new, dummy_stub do + client = ::Google::Cloud::Retail::V2::ServingConfigService::Client.new do |config| + config.credentials = grpc_channel + end + end + + config = client.configure do |c| + block_config = c + end + + assert_same block_config, config + assert_kind_of ::Google::Cloud::Retail::V2::ServingConfigService::Client::Configuration, config + end + + def test_credentials + key = OpenSSL::PKey::RSA.new 2048 + cred_json = { + "private_key" => key.to_pem, + "client_email" => "app@developer.gserviceaccount.com", + "type" => "service_account" + } + key_file = StringIO.new cred_json.to_json + creds = Google::Auth::ServiceAccountCredentials.make_creds({ json_key_io: key_file }) + + dummy_stub = ClientStub.new nil, nil + Gapic::ServiceStub.stub :new, dummy_stub do + client = ::Google::Cloud::Retail::V2::ServingConfigService::Client.new do |config| + config.credentials = creds + end + assert_kind_of ::Google::Cloud::Retail::V2::ServingConfigService::Client, client + assert_equal creds, client.configure.credentials + end + end +end diff --git a/owl-bot-staging/google-cloud-retail-v2/test/google/cloud/retail/v2/user_event_service_operations_test.rb b/owl-bot-staging/google-cloud-retail-v2/test/google/cloud/retail/v2/user_event_service_operations_test.rb new file mode 100644 index 000000000000..df06fda9f578 --- /dev/null +++ b/owl-bot-staging/google-cloud-retail-v2/test/google/cloud/retail/v2/user_event_service_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/cloud/retail/v2/user_event_service_pb" +require "google/cloud/retail/v2/user_event_service_services_pb" +require "google/cloud/retail/v2/user_event_service" + +class ::Google::Cloud::Retail::V2::UserEventService::OperationsTest < Minitest::Test + class ClientStub + attr_accessor :call_rpc_count, :requests + + def initialize response, operation, &block + @response = response + @operation = operation + @block = block + @call_rpc_count = 0 + @requests = [] + end + + def call_rpc *args, **kwargs + @call_rpc_count += 1 + + @requests << @block&.call(*args, **kwargs) + + catch :response do + yield @response, @operation if block_given? + @response + end + end + + def endpoint + "endpoint.example.com" + end + + def universe_domain + "example.com" + end + + def stub_logger + nil + end + + def logger + nil + end + end + + def test_list_operations + # Create GRPC objects. + grpc_response = ::Google::Longrunning::ListOperationsResponse.new + grpc_operation = GRPC::ActiveCall::Operation.new nil + grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + grpc_options = {} + + # Create request parameters for a unary method. + name = "hello world" + filter = "hello world" + page_size = 42 + page_token = "hello world" + return_partial_success = true + + list_operations_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :list_operations, name + assert_kind_of ::Google::Longrunning::ListOperationsRequest, request + assert_equal "hello world", request["name"] + assert_equal "hello world", request["filter"] + assert_equal 42, request["page_size"] + assert_equal "hello world", request["page_token"] + assert_equal true, request["return_partial_success"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, list_operations_client_stub do + # Create client + client = ::Google::Cloud::Retail::V2::UserEventService::Operations.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.list_operations({ name: name, filter: filter, page_size: page_size, page_token: page_token, return_partial_success: return_partial_success }) do |response, operation| + assert_kind_of Gapic::PagedEnumerable, response + assert_equal grpc_response, response.response + assert_equal grpc_operation, operation + end + + # Use named arguments + client.list_operations name: name, filter: filter, page_size: page_size, page_token: page_token, return_partial_success: return_partial_success do |response, operation| + assert_kind_of Gapic::PagedEnumerable, response + assert_equal grpc_response, response.response + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.list_operations ::Google::Longrunning::ListOperationsRequest.new(name: name, filter: filter, page_size: page_size, page_token: page_token, return_partial_success: return_partial_success) do |response, operation| + assert_kind_of Gapic::PagedEnumerable, response + assert_equal grpc_response, response.response + assert_equal grpc_operation, operation + end + + # Use hash object with options + client.list_operations({ name: name, filter: filter, page_size: page_size, page_token: page_token, return_partial_success: return_partial_success }, grpc_options) do |response, operation| + assert_kind_of Gapic::PagedEnumerable, response + assert_equal grpc_response, response.response + assert_equal grpc_operation, operation + end + + # Use protobuf object with options + client.list_operations(::Google::Longrunning::ListOperationsRequest.new(name: name, filter: filter, page_size: page_size, page_token: page_token, return_partial_success: return_partial_success), grpc_options) do |response, operation| + assert_kind_of Gapic::PagedEnumerable, response + assert_equal grpc_response, response.response + assert_equal grpc_operation, operation + end + + # Verify method calls + assert_equal 5, list_operations_client_stub.call_rpc_count + end + end + + def test_get_operation + # Create GRPC objects. + grpc_response = ::Google::Longrunning::Operation.new + grpc_operation = GRPC::ActiveCall::Operation.new nil + grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + grpc_options = {} + + # Create request parameters for a unary method. + name = "hello world" + + get_operation_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :get_operation, name + assert_kind_of ::Google::Longrunning::GetOperationRequest, request + assert_equal "hello world", request["name"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, get_operation_client_stub do + # Create client + client = ::Google::Cloud::Retail::V2::UserEventService::Operations.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.get_operation({ name: name }) do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Use named arguments + client.get_operation name: name do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.get_operation ::Google::Longrunning::GetOperationRequest.new(name: name) do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Use hash object with options + client.get_operation({ name: name }, grpc_options) do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Use protobuf object with options + client.get_operation(::Google::Longrunning::GetOperationRequest.new(name: name), grpc_options) do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Verify method calls + assert_equal 5, get_operation_client_stub.call_rpc_count + end + end + + def test_delete_operation + # Create GRPC objects. + grpc_response = ::Google::Protobuf::Empty.new + grpc_operation = GRPC::ActiveCall::Operation.new nil + grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + grpc_options = {} + + # Create request parameters for a unary method. + name = "hello world" + + delete_operation_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :delete_operation, name + assert_kind_of ::Google::Longrunning::DeleteOperationRequest, request + assert_equal "hello world", request["name"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, delete_operation_client_stub do + # Create client + client = ::Google::Cloud::Retail::V2::UserEventService::Operations.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.delete_operation({ name: name }) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use named arguments + client.delete_operation name: name do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.delete_operation ::Google::Longrunning::DeleteOperationRequest.new(name: name) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use hash object with options + client.delete_operation({ name: name }, grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object with options + client.delete_operation(::Google::Longrunning::DeleteOperationRequest.new(name: name), grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Verify method calls + assert_equal 5, delete_operation_client_stub.call_rpc_count + end + end + + def test_cancel_operation + # Create GRPC objects. + grpc_response = ::Google::Protobuf::Empty.new + grpc_operation = GRPC::ActiveCall::Operation.new nil + grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + grpc_options = {} + + # Create request parameters for a unary method. + name = "hello world" + + cancel_operation_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :cancel_operation, name + assert_kind_of ::Google::Longrunning::CancelOperationRequest, request + assert_equal "hello world", request["name"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, cancel_operation_client_stub do + # Create client + client = ::Google::Cloud::Retail::V2::UserEventService::Operations.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.cancel_operation({ name: name }) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use named arguments + client.cancel_operation name: name do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.cancel_operation ::Google::Longrunning::CancelOperationRequest.new(name: name) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use hash object with options + client.cancel_operation({ name: name }, grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object with options + client.cancel_operation(::Google::Longrunning::CancelOperationRequest.new(name: name), grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Verify method calls + assert_equal 5, cancel_operation_client_stub.call_rpc_count + end + end + + def test_wait_operation + # Create GRPC objects. + grpc_response = ::Google::Longrunning::Operation.new + grpc_operation = GRPC::ActiveCall::Operation.new nil + grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + grpc_options = {} + + # Create request parameters for a unary method. + name = "hello world" + timeout = {} + + wait_operation_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :wait_operation, name + assert_kind_of ::Google::Longrunning::WaitOperationRequest, request + assert_equal "hello world", request["name"] + assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Protobuf::Duration), request["timeout"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, wait_operation_client_stub do + # Create client + client = ::Google::Cloud::Retail::V2::UserEventService::Operations.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.wait_operation({ name: name, timeout: timeout }) do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Use named arguments + client.wait_operation name: name, timeout: timeout do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.wait_operation ::Google::Longrunning::WaitOperationRequest.new(name: name, timeout: timeout) do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Use hash object with options + client.wait_operation({ name: name, timeout: timeout }, grpc_options) do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Use protobuf object with options + client.wait_operation(::Google::Longrunning::WaitOperationRequest.new(name: name, timeout: timeout), grpc_options) do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Verify method calls + assert_equal 5, wait_operation_client_stub.call_rpc_count + end + end + + def test_configure + grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + + client = block_config = config = nil + dummy_stub = ClientStub.new nil, nil + Gapic::ServiceStub.stub :new, dummy_stub do + client = ::Google::Cloud::Retail::V2::UserEventService::Operations.new do |config| + config.credentials = grpc_channel + end + end + + config = client.configure do |c| + block_config = c + end + + assert_same block_config, config + assert_kind_of ::Google::Cloud::Retail::V2::UserEventService::Operations::Configuration, config + end +end diff --git a/owl-bot-staging/google-cloud-retail-v2/test/google/cloud/retail/v2/user_event_service_paths_test.rb b/owl-bot-staging/google-cloud-retail-v2/test/google/cloud/retail/v2/user_event_service_paths_test.rb new file mode 100644 index 000000000000..359bdf51e611 --- /dev/null +++ b/owl-bot-staging/google-cloud-retail-v2/test/google/cloud/retail/v2/user_event_service_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/cloud/retail/v2/user_event_service" + +class ::Google::Cloud::Retail::V2::UserEventService::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_catalog_path + grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + ::Gapic::ServiceStub.stub :new, DummyStub.new do + client = ::Google::Cloud::Retail::V2::UserEventService::Client.new do |config| + config.credentials = grpc_channel + end + + path = client.catalog_path project: "value0", location: "value1", catalog: "value2" + assert_equal "projects/value0/locations/value1/catalogs/value2", path + end + end + + def test_product_path + grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + ::Gapic::ServiceStub.stub :new, DummyStub.new do + client = ::Google::Cloud::Retail::V2::UserEventService::Client.new do |config| + config.credentials = grpc_channel + end + + path = client.product_path project: "value0", location: "value1", catalog: "value2", branch: "value3", product: "value4" + assert_equal "projects/value0/locations/value1/catalogs/value2/branches/value3/products/value4", path + end + end +end diff --git a/owl-bot-staging/google-cloud-retail-v2/test/google/cloud/retail/v2/user_event_service_rest_test.rb b/owl-bot-staging/google-cloud-retail-v2/test/google/cloud/retail/v2/user_event_service_rest_test.rb new file mode 100644 index 000000000000..77ab953b6c06 --- /dev/null +++ b/owl-bot-staging/google-cloud-retail-v2/test/google/cloud/retail/v2/user_event_service_rest_test.rb @@ -0,0 +1,381 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +require "helper" +require "gapic/rest" +require "google/cloud/retail/v2/user_event_service_pb" +require "google/cloud/retail/v2/user_event_service/rest" + + +class ::Google::Cloud::Retail::V2::UserEventService::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_write_user_event + # Create test objects. + client_result = ::Google::Cloud::Retail::V2::UserEvent.new + http_response = OpenStruct.new body: client_result.to_json + + call_options = {} + + # Create request parameters for a unary method. + parent = "hello world" + user_event = {} + write_async = true + + write_user_event_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| + assert options.metadata.key? :"x-goog-api-client" + assert options.metadata[:"x-goog-api-client"].include? "rest" + refute options.metadata[:"x-goog-api-client"].include? "grpc" + end + + ::Google::Cloud::Retail::V2::UserEventService::Rest::ServiceStub.stub :transcode_write_user_event_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, write_user_event_client_stub do + # Create client + client = ::Google::Cloud::Retail::V2::UserEventService::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.write_user_event({ parent: parent, user_event: user_event, write_async: write_async }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.write_user_event parent: parent, user_event: user_event, write_async: write_async do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.write_user_event ::Google::Cloud::Retail::V2::WriteUserEventRequest.new(parent: parent, user_event: user_event, write_async: write_async) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + client.write_user_event({ parent: parent, user_event: user_event, write_async: write_async }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + client.write_user_event(::Google::Cloud::Retail::V2::WriteUserEventRequest.new(parent: parent, user_event: user_event, write_async: write_async), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, write_user_event_client_stub.call_count + end + end + end + + def test_collect_user_event + # Create test objects. + client_result = ::Google::Api::HttpBody.new + http_response = OpenStruct.new body: client_result.to_json + + call_options = {} + + # Create request parameters for a unary method. + prebuilt_rule = "hello world" + parent = "hello world" + user_event = "hello world" + uri = "hello world" + ets = 42 + raw_json = "hello world" + + collect_user_event_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| + assert options.metadata.key? :"x-goog-api-client" + assert options.metadata[:"x-goog-api-client"].include? "rest" + refute options.metadata[:"x-goog-api-client"].include? "grpc" + end + + ::Google::Cloud::Retail::V2::UserEventService::Rest::ServiceStub.stub :transcode_collect_user_event_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, collect_user_event_client_stub do + # Create client + client = ::Google::Cloud::Retail::V2::UserEventService::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.collect_user_event({ prebuilt_rule: prebuilt_rule, parent: parent, user_event: user_event, uri: uri, ets: ets, raw_json: raw_json }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.collect_user_event prebuilt_rule: prebuilt_rule, parent: parent, user_event: user_event, uri: uri, ets: ets, raw_json: raw_json do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.collect_user_event ::Google::Cloud::Retail::V2::CollectUserEventRequest.new(prebuilt_rule: prebuilt_rule, parent: parent, user_event: user_event, uri: uri, ets: ets, raw_json: raw_json) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + client.collect_user_event({ prebuilt_rule: prebuilt_rule, parent: parent, user_event: user_event, uri: uri, ets: ets, raw_json: raw_json }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + client.collect_user_event(::Google::Cloud::Retail::V2::CollectUserEventRequest.new(prebuilt_rule: prebuilt_rule, parent: parent, user_event: user_event, uri: uri, ets: ets, raw_json: raw_json), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, collect_user_event_client_stub.call_count + end + end + end + + def test_purge_user_events + # 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" + filter = "hello world" + force = true + + purge_user_events_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| + assert options.metadata.key? :"x-goog-api-client" + assert options.metadata[:"x-goog-api-client"].include? "rest" + refute options.metadata[:"x-goog-api-client"].include? "grpc" + end + + ::Google::Cloud::Retail::V2::UserEventService::Rest::ServiceStub.stub :transcode_purge_user_events_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, purge_user_events_client_stub do + # Create client + client = ::Google::Cloud::Retail::V2::UserEventService::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.purge_user_events({ parent: parent, filter: filter, force: force }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.purge_user_events parent: parent, filter: filter, force: force do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.purge_user_events ::Google::Cloud::Retail::V2::PurgeUserEventsRequest.new(parent: parent, filter: filter, force: force) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + client.purge_user_events({ parent: parent, filter: filter, force: force }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + client.purge_user_events(::Google::Cloud::Retail::V2::PurgeUserEventsRequest.new(parent: parent, filter: filter, force: force), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, purge_user_events_client_stub.call_count + end + end + end + + def test_import_user_events + # 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" + input_config = {} + errors_config = {} + + import_user_events_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| + assert options.metadata.key? :"x-goog-api-client" + assert options.metadata[:"x-goog-api-client"].include? "rest" + refute options.metadata[:"x-goog-api-client"].include? "grpc" + end + + ::Google::Cloud::Retail::V2::UserEventService::Rest::ServiceStub.stub :transcode_import_user_events_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, import_user_events_client_stub do + # Create client + client = ::Google::Cloud::Retail::V2::UserEventService::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.import_user_events({ parent: parent, input_config: input_config, errors_config: errors_config }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.import_user_events parent: parent, input_config: input_config, errors_config: errors_config do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.import_user_events ::Google::Cloud::Retail::V2::ImportUserEventsRequest.new(parent: parent, input_config: input_config, errors_config: errors_config) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + client.import_user_events({ parent: parent, input_config: input_config, errors_config: errors_config }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + client.import_user_events(::Google::Cloud::Retail::V2::ImportUserEventsRequest.new(parent: parent, input_config: input_config, errors_config: errors_config), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, import_user_events_client_stub.call_count + end + end + end + + def test_rejoin_user_events + # 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" + user_event_rejoin_scope = :USER_EVENT_REJOIN_SCOPE_UNSPECIFIED + + rejoin_user_events_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| + assert options.metadata.key? :"x-goog-api-client" + assert options.metadata[:"x-goog-api-client"].include? "rest" + refute options.metadata[:"x-goog-api-client"].include? "grpc" + end + + ::Google::Cloud::Retail::V2::UserEventService::Rest::ServiceStub.stub :transcode_rejoin_user_events_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, rejoin_user_events_client_stub do + # Create client + client = ::Google::Cloud::Retail::V2::UserEventService::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.rejoin_user_events({ parent: parent, user_event_rejoin_scope: user_event_rejoin_scope }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.rejoin_user_events parent: parent, user_event_rejoin_scope: user_event_rejoin_scope do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.rejoin_user_events ::Google::Cloud::Retail::V2::RejoinUserEventsRequest.new(parent: parent, user_event_rejoin_scope: user_event_rejoin_scope) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + client.rejoin_user_events({ parent: parent, user_event_rejoin_scope: user_event_rejoin_scope }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + client.rejoin_user_events(::Google::Cloud::Retail::V2::RejoinUserEventsRequest.new(parent: parent, user_event_rejoin_scope: user_event_rejoin_scope), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, rejoin_user_events_client_stub.call_count + end + end + end + + def test_configure + credentials_token = :dummy_value + + client = block_config = config = nil + dummy_stub = ClientStub.new nil + Gapic::Rest::ClientStub.stub :new, dummy_stub do + client = ::Google::Cloud::Retail::V2::UserEventService::Rest::Client.new do |config| + config.credentials = credentials_token + end + end + + config = client.configure do |c| + block_config = c + end + + assert_same block_config, config + assert_kind_of ::Google::Cloud::Retail::V2::UserEventService::Rest::Client::Configuration, config + end +end diff --git a/owl-bot-staging/google-cloud-retail-v2/test/google/cloud/retail/v2/user_event_service_test.rb b/owl-bot-staging/google-cloud-retail-v2/test/google/cloud/retail/v2/user_event_service_test.rb new file mode 100644 index 000000000000..9ae8db888385 --- /dev/null +++ b/owl-bot-staging/google-cloud-retail-v2/test/google/cloud/retail/v2/user_event_service_test.rb @@ -0,0 +1,448 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +require "helper" + +require "gapic/grpc/service_stub" + +require "google/cloud/retail/v2/user_event_service_pb" +require "google/cloud/retail/v2/user_event_service" + +class ::Google::Cloud::Retail::V2::UserEventService::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_write_user_event + # Create GRPC objects. + grpc_response = ::Google::Cloud::Retail::V2::UserEvent.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" + user_event = {} + write_async = true + + write_user_event_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :write_user_event, name + assert_kind_of ::Google::Cloud::Retail::V2::WriteUserEventRequest, request + assert_equal "hello world", request["parent"] + assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::Retail::V2::UserEvent), request["user_event"] + assert_equal true, request["write_async"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, write_user_event_client_stub do + # Create client + client = ::Google::Cloud::Retail::V2::UserEventService::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.write_user_event({ parent: parent, user_event: user_event, write_async: write_async }) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use named arguments + client.write_user_event parent: parent, user_event: user_event, write_async: write_async do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.write_user_event ::Google::Cloud::Retail::V2::WriteUserEventRequest.new(parent: parent, user_event: user_event, write_async: write_async) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use hash object with options + client.write_user_event({ parent: parent, user_event: user_event, write_async: write_async }, grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object with options + client.write_user_event(::Google::Cloud::Retail::V2::WriteUserEventRequest.new(parent: parent, user_event: user_event, write_async: write_async), grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Verify method calls + assert_equal 5, write_user_event_client_stub.call_rpc_count + end + end + + def test_collect_user_event + # Create GRPC objects. + grpc_response = ::Google::Api::HttpBody.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. + prebuilt_rule = "hello world" + parent = "hello world" + user_event = "hello world" + uri = "hello world" + ets = 42 + raw_json = "hello world" + + collect_user_event_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :collect_user_event, name + assert_kind_of ::Google::Cloud::Retail::V2::CollectUserEventRequest, request + assert_equal "hello world", request["prebuilt_rule"] + assert_equal :prebuilt_rule, request.conversion_rule + assert_equal "hello world", request["parent"] + assert_equal "hello world", request["user_event"] + assert_equal "hello world", request["uri"] + assert_equal 42, request["ets"] + assert_equal "hello world", request["raw_json"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, collect_user_event_client_stub do + # Create client + client = ::Google::Cloud::Retail::V2::UserEventService::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.collect_user_event({ prebuilt_rule: prebuilt_rule, parent: parent, user_event: user_event, uri: uri, ets: ets, raw_json: raw_json }) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use named arguments + client.collect_user_event prebuilt_rule: prebuilt_rule, parent: parent, user_event: user_event, uri: uri, ets: ets, raw_json: raw_json do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.collect_user_event ::Google::Cloud::Retail::V2::CollectUserEventRequest.new(prebuilt_rule: prebuilt_rule, parent: parent, user_event: user_event, uri: uri, ets: ets, raw_json: raw_json) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use hash object with options + client.collect_user_event({ prebuilt_rule: prebuilt_rule, parent: parent, user_event: user_event, uri: uri, ets: ets, raw_json: raw_json }, grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object with options + client.collect_user_event(::Google::Cloud::Retail::V2::CollectUserEventRequest.new(prebuilt_rule: prebuilt_rule, parent: parent, user_event: user_event, uri: uri, ets: ets, raw_json: raw_json), grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Verify method calls + assert_equal 5, collect_user_event_client_stub.call_rpc_count + end + end + + def test_purge_user_events + # 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" + filter = "hello world" + force = true + + purge_user_events_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :purge_user_events, name + assert_kind_of ::Google::Cloud::Retail::V2::PurgeUserEventsRequest, request + assert_equal "hello world", request["parent"] + assert_equal "hello world", request["filter"] + assert_equal true, request["force"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, purge_user_events_client_stub do + # Create client + client = ::Google::Cloud::Retail::V2::UserEventService::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.purge_user_events({ parent: parent, filter: filter, 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.purge_user_events parent: parent, filter: filter, 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.purge_user_events ::Google::Cloud::Retail::V2::PurgeUserEventsRequest.new(parent: parent, filter: filter, 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.purge_user_events({ parent: parent, filter: filter, 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.purge_user_events(::Google::Cloud::Retail::V2::PurgeUserEventsRequest.new(parent: parent, filter: filter, 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, purge_user_events_client_stub.call_rpc_count + end + end + + def test_import_user_events + # 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" + input_config = {} + errors_config = {} + + import_user_events_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :import_user_events, name + assert_kind_of ::Google::Cloud::Retail::V2::ImportUserEventsRequest, request + assert_equal "hello world", request["parent"] + assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::Retail::V2::UserEventInputConfig), request["input_config"] + assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::Retail::V2::ImportErrorsConfig), request["errors_config"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, import_user_events_client_stub do + # Create client + client = ::Google::Cloud::Retail::V2::UserEventService::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.import_user_events({ parent: parent, input_config: input_config, errors_config: errors_config }) 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.import_user_events parent: parent, input_config: input_config, errors_config: errors_config 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.import_user_events ::Google::Cloud::Retail::V2::ImportUserEventsRequest.new(parent: parent, input_config: input_config, errors_config: errors_config) 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.import_user_events({ parent: parent, input_config: input_config, errors_config: errors_config }, 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.import_user_events(::Google::Cloud::Retail::V2::ImportUserEventsRequest.new(parent: parent, input_config: input_config, errors_config: errors_config), 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, import_user_events_client_stub.call_rpc_count + end + end + + def test_rejoin_user_events + # 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" + user_event_rejoin_scope = :USER_EVENT_REJOIN_SCOPE_UNSPECIFIED + + rejoin_user_events_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :rejoin_user_events, name + assert_kind_of ::Google::Cloud::Retail::V2::RejoinUserEventsRequest, request + assert_equal "hello world", request["parent"] + assert_equal :USER_EVENT_REJOIN_SCOPE_UNSPECIFIED, request["user_event_rejoin_scope"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, rejoin_user_events_client_stub do + # Create client + client = ::Google::Cloud::Retail::V2::UserEventService::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.rejoin_user_events({ parent: parent, user_event_rejoin_scope: user_event_rejoin_scope }) 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.rejoin_user_events parent: parent, user_event_rejoin_scope: user_event_rejoin_scope 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.rejoin_user_events ::Google::Cloud::Retail::V2::RejoinUserEventsRequest.new(parent: parent, user_event_rejoin_scope: user_event_rejoin_scope) 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.rejoin_user_events({ parent: parent, user_event_rejoin_scope: user_event_rejoin_scope }, 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.rejoin_user_events(::Google::Cloud::Retail::V2::RejoinUserEventsRequest.new(parent: parent, user_event_rejoin_scope: user_event_rejoin_scope), 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, rejoin_user_events_client_stub.call_rpc_count + end + end + + def test_configure + grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + + client = block_config = config = nil + dummy_stub = ClientStub.new nil, nil + Gapic::ServiceStub.stub :new, dummy_stub do + client = ::Google::Cloud::Retail::V2::UserEventService::Client.new do |config| + config.credentials = grpc_channel + end + end + + config = client.configure do |c| + block_config = c + end + + assert_same block_config, config + assert_kind_of ::Google::Cloud::Retail::V2::UserEventService::Client::Configuration, config + end + + def test_credentials + key = OpenSSL::PKey::RSA.new 2048 + cred_json = { + "private_key" => key.to_pem, + "client_email" => "app@developer.gserviceaccount.com", + "type" => "service_account" + } + key_file = StringIO.new cred_json.to_json + creds = Google::Auth::ServiceAccountCredentials.make_creds({ json_key_io: key_file }) + + dummy_stub = ClientStub.new nil, nil + Gapic::ServiceStub.stub :new, dummy_stub do + client = ::Google::Cloud::Retail::V2::UserEventService::Client.new do |config| + config.credentials = creds + end + assert_kind_of ::Google::Cloud::Retail::V2::UserEventService::Client, client + assert_equal creds, client.configure.credentials + end + end + + def test_operations_client + grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + + client = nil + dummy_stub = ClientStub.new nil, nil + Gapic::ServiceStub.stub :new, dummy_stub do + client = ::Google::Cloud::Retail::V2::UserEventService::Client.new do |config| + config.credentials = grpc_channel + end + end + + assert_kind_of ::Google::Cloud::Retail::V2::UserEventService::Operations, client.operations_client + end +end diff --git a/owl-bot-staging/google-cloud-retail-v2/test/helper.rb b/owl-bot-staging/google-cloud-retail-v2/test/helper.rb new file mode 100644 index 000000000000..672b337030e7 --- /dev/null +++ b/owl-bot-staging/google-cloud-retail-v2/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" diff --git a/owl-bot-staging/google-cloud-saas_platform-saas_service_mgmt-v1beta1/.gitignore b/owl-bot-staging/google-cloud-saas_platform-saas_service_mgmt-v1beta1/.gitignore new file mode 100644 index 000000000000..0135b6bc6cfc --- /dev/null +++ b/owl-bot-staging/google-cloud-saas_platform-saas_service_mgmt-v1beta1/.gitignore @@ -0,0 +1,22 @@ +# Ignore bundler lockfiles +Gemfile.lock +gems.locked + +# Ignore documentation output +doc/* +.yardoc/* + +# Ignore test output +coverage/* + +# Ignore build artifacts +pkg/* + +# Ignore files commonly present in certain dev environments +.vagrant +.DS_STORE +.idea +*.iml + +# Ignore synth output +__pycache__ diff --git a/owl-bot-staging/google-cloud-saas_platform-saas_service_mgmt-v1beta1/.repo-metadata.json b/owl-bot-staging/google-cloud-saas_platform-saas_service_mgmt-v1beta1/.repo-metadata.json new file mode 100644 index 000000000000..97994f56b769 --- /dev/null +++ b/owl-bot-staging/google-cloud-saas_platform-saas_service_mgmt-v1beta1/.repo-metadata.json @@ -0,0 +1,17 @@ +{ + "api_id": "saasservicemgmt.googleapis.com", + "api_shortname": "saasservicemgmt", + "client_documentation": "https://cloud.google.com/ruby/docs/reference/google-cloud-saas_platform-saas_service_mgmt-v1beta1/latest", + "distribution_name": "google-cloud-saas_platform-saas_service_mgmt-v1beta1", + "is_cloud": true, + "language": "ruby", + "name": "saasservicemgmt", + "name_pretty": "SaaS Runtime V1BETA1 API", + "product_documentation": "https://cloud.google.com/saas-runtime/docs/overview", + "release_level": "unreleased", + "repo": "googleapis/google-cloud-ruby", + "requires_billing": true, + "ruby-cloud-description": "SaaS Runtime lets you store, host, manage, and monitor software as a service (SaaS) applications on Google Cloud. Note that google-cloud-saas_platform-saas_service_mgmt-v1beta1 is a version-specific client library. For most uses, we recommend installing the main client library google-cloud-saas_platform-saas_service_mgmt instead. See the readme for more details.", + "ruby-cloud-product-url": "https://cloud.google.com/saas-runtime/docs/overview", + "library_type": "GAPIC_AUTO" +} diff --git a/owl-bot-staging/google-cloud-saas_platform-saas_service_mgmt-v1beta1/.rubocop.yml b/owl-bot-staging/google-cloud-saas_platform-saas_service_mgmt-v1beta1/.rubocop.yml new file mode 100644 index 000000000000..981315800771 --- /dev/null +++ b/owl-bot-staging/google-cloud-saas_platform-saas_service_mgmt-v1beta1/.rubocop.yml @@ -0,0 +1,33 @@ +inherit_gem: + google-style: google-style.yml + +AllCops: + Exclude: + - "google-cloud-saas_platform-saas_service_mgmt-v1beta1.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-saas_platform-saas_service_mgmt-v1beta1.rb" diff --git a/owl-bot-staging/google-cloud-saas_platform-saas_service_mgmt-v1beta1/.toys.rb b/owl-bot-staging/google-cloud-saas_platform-saas_service_mgmt-v1beta1/.toys.rb new file mode 100644 index 000000000000..177e22456e8a --- /dev/null +++ b/owl-bot-staging/google-cloud-saas_platform-saas_service_mgmt-v1beta1/.toys.rb @@ -0,0 +1,28 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +toys_version! ">= 0.15.3" + +if ENV["RUBY_COMMON_TOOLS"] + common_tools_dir = File.expand_path ENV["RUBY_COMMON_TOOLS"] + load File.join(common_tools_dir, "toys", "gapic") +else + load_git remote: "https://github.com/googleapis/ruby-common-tools.git", + path: "toys/gapic", + update: true +end diff --git a/owl-bot-staging/google-cloud-saas_platform-saas_service_mgmt-v1beta1/.yardopts b/owl-bot-staging/google-cloud-saas_platform-saas_service_mgmt-v1beta1/.yardopts new file mode 100644 index 000000000000..66921bbab993 --- /dev/null +++ b/owl-bot-staging/google-cloud-saas_platform-saas_service_mgmt-v1beta1/.yardopts @@ -0,0 +1,12 @@ +--no-private +--title="SaaS Runtime V1BETA1 API" +--exclude _pb\.rb$ +--markup markdown +--markup-provider redcarpet + +./lib/**/*.rb +./proto_docs/**/*.rb +- +README.md +LICENSE.md +AUTHENTICATION.md diff --git a/owl-bot-staging/google-cloud-saas_platform-saas_service_mgmt-v1beta1/AUTHENTICATION.md b/owl-bot-staging/google-cloud-saas_platform-saas_service_mgmt-v1beta1/AUTHENTICATION.md new file mode 100644 index 000000000000..60e04154887d --- /dev/null +++ b/owl-bot-staging/google-cloud-saas_platform-saas_service_mgmt-v1beta1/AUTHENTICATION.md @@ -0,0 +1,122 @@ +# Authentication + +The recommended way to authenticate to the google-cloud-saas_platform-saas_service_mgmt-v1beta1 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-saas_platform-saas_service_mgmt-v1beta1 library provides several mechanisms to configure your system. +Generally, using Application Default Credentials to facilitate automatic +credentials discovery is the easist method. But if you need to explicitly specify +credentials, there are several methods available to you. + +Credentials are accepted in the following ways, in the following order or precedence: + +1. Credentials specified in method arguments +2. Credentials specified in configuration +3. Credentials pointed to or included in environment variables +4. Credentials found in local ADC file +5. Credentials returned by the metadata server for the attached service account (GCP) + +### Configuration + +You can configure a path to a JSON credentials file, either for an individual client object or +globally, for all client objects. The JSON file can contain credentials created for +[workload identity federation](https://cloud.google.com/iam/docs/workload-identity-federation), +[workforce identity federation](https://cloud.google.com/iam/docs/workforce-identity-federation), or a +[service account key](https://cloud.google.com/docs/authentication/provide-credentials-adc#local-key). + +Note: Service account keys are a security risk if not managed correctly. You should +[choose a more secure alternative to service account keys](https://cloud.google.com/docs/authentication#auth-decision-tree) +whenever possible. + +To configure a credentials file for an individual client initialization: + +```ruby +require "google/cloud/saas_platform/saas_service_mgmt/v1beta1" + +client = ::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::SaasDeployments::Client.new do |config| + config.credentials = "path/to/credentialfile.json" +end +``` + +To configure a credentials file globally for all clients: + +```ruby +require "google/cloud/saas_platform/saas_service_mgmt/v1beta1" + +::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::SaasDeployments::Client.configure do |config| + config.credentials = "path/to/credentialfile.json" +end + +client = ::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::SaasDeployments::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-saas_platform-saas_service_mgmt-v1beta1 +checks for credentials are: + +* `GOOGLE_CLOUD_CREDENTIALS` - Path to JSON file, or JSON contents +* `GOOGLE_APPLICATION_CREDENTIALS` - Path to JSON file + +```ruby +require "google/cloud/saas_platform/saas_service_mgmt/v1beta1" + +ENV["GOOGLE_APPLICATION_CREDENTIALS"] = "path/to/credentialfile.json" + +client = ::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::SaasDeployments::Client.new +``` + +### Local ADC file + +You can set up a local ADC file with your user credentials for authentication during +development. If credentials are not provided in code or in environment variables, +then the local ADC credentials are discovered. + +Follow the steps in [Quickstart](#quickstart) to set up a local ADC file. + +### Google Cloud Platform environments + +When running on Google Cloud Platform (GCP), including Google Compute Engine +(GCE), Google Kubernetes Engine (GKE), Google App Engine (GAE), Google Cloud +Functions (GCF) and Cloud Run, credentials are retrieved from the attached +service account automatically. Code should be written as if already authenticated. + +For more information, see +[Set up ADC for Google Cloud services](https://cloud.google.com/docs/authentication/provide-credentials-adc#attached-sa). diff --git a/owl-bot-staging/google-cloud-saas_platform-saas_service_mgmt-v1beta1/CHANGELOG.md b/owl-bot-staging/google-cloud-saas_platform-saas_service_mgmt-v1beta1/CHANGELOG.md new file mode 100644 index 000000000000..f88957a62ba2 --- /dev/null +++ b/owl-bot-staging/google-cloud-saas_platform-saas_service_mgmt-v1beta1/CHANGELOG.md @@ -0,0 +1,2 @@ +# Release History + diff --git a/owl-bot-staging/google-cloud-saas_platform-saas_service_mgmt-v1beta1/Gemfile b/owl-bot-staging/google-cloud-saas_platform-saas_service_mgmt-v1beta1/Gemfile new file mode 100644 index 000000000000..1d08558908d8 --- /dev/null +++ b/owl-bot-staging/google-cloud-saas_platform-saas_service_mgmt-v1beta1/Gemfile @@ -0,0 +1,14 @@ +source "https://rubygems.org" + +gemspec + +gem "google-style", "~> 1.32.0" +gem "irb", "~> 1.17" +gem "minitest", "~> 6.0.2" +gem "minitest-focus", "~> 1.4" +gem "minitest-mock", "~> 5.27" +gem "minitest-rg", "~> 5.3" +gem "ostruct", "~> 0.5.5" +gem "rake", ">= 13.0" +gem "redcarpet", "~> 3.6" +gem "yard", "~> 0.9" diff --git a/owl-bot-staging/google-cloud-saas_platform-saas_service_mgmt-v1beta1/LICENSE.md b/owl-bot-staging/google-cloud-saas_platform-saas_service_mgmt-v1beta1/LICENSE.md new file mode 100644 index 000000000000..c261857ba6ad --- /dev/null +++ b/owl-bot-staging/google-cloud-saas_platform-saas_service_mgmt-v1beta1/LICENSE.md @@ -0,0 +1,201 @@ + Apache License + Version 2.0, January 2004 + http://www.apache.org/licenses/ + + TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION + + 1. Definitions. + + "License" shall mean the terms and conditions for use, reproduction, + and distribution as defined by Sections 1 through 9 of this document. + + "Licensor" shall mean the copyright owner or entity authorized by + the copyright owner that is granting the License. + + "Legal Entity" shall mean the union of the acting entity and all + other entities that control, are controlled by, or are under common + control with that entity. For the purposes of this definition, + "control" means (i) the power, direct or indirect, to cause the + direction or management of such entity, whether by contract or + otherwise, or (ii) ownership of fifty percent (50%) or more of the + outstanding shares, or (iii) beneficial ownership of such entity. + + "You" (or "Your") shall mean an individual or Legal Entity + exercising permissions granted by this License. + + "Source" form shall mean the preferred form for making modifications, + including but not limited to software source code, documentation + source, and configuration files. + + "Object" form shall mean any form resulting from mechanical + transformation or translation of a Source form, including but + not limited to compiled object code, generated documentation, + and conversions to other media types. + + "Work" shall mean the work of authorship, whether in Source or + Object form, made available under the License, as indicated by a + copyright notice that is included in or attached to the work + (an example is provided in the Appendix below). + + "Derivative Works" shall mean any work, whether in Source or Object + form, that is based on (or derived from) the Work and for which the + editorial revisions, annotations, elaborations, or other modifications + represent, as a whole, an original work of authorship. For the purposes + of this License, Derivative Works shall not include works that remain + separable from, or merely link (or bind by name) to the interfaces of, + the Work and Derivative Works thereof. + + "Contribution" shall mean any work of authorship, including + the original version of the Work and any modifications or additions + to that Work or Derivative Works thereof, that is intentionally + submitted to Licensor for inclusion in the Work by the copyright owner + or by an individual or Legal Entity authorized to submit on behalf of + the copyright owner. For the purposes of this definition, "submitted" + means any form of electronic, verbal, or written communication sent + to the Licensor or its representatives, including but not limited to + communication on electronic mailing lists, source code control systems, + and issue tracking systems that are managed by, or on behalf of, the + Licensor for the purpose of discussing and improving the Work, but + excluding communication that is conspicuously marked or otherwise + designated in writing by the copyright owner as "Not a Contribution." + + "Contributor" shall mean Licensor and any individual or Legal Entity + on behalf of whom a Contribution has been received by Licensor and + subsequently incorporated within the Work. + + 2. Grant of Copyright License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + copyright license to reproduce, prepare Derivative Works of, + publicly display, publicly perform, sublicense, and distribute the + Work and such Derivative Works in Source or Object form. + + 3. Grant of Patent License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + (except as stated in this section) patent license to make, have made, + use, offer to sell, sell, import, and otherwise transfer the Work, + where such license applies only to those patent claims licensable + by such Contributor that are necessarily infringed by their + Contribution(s) alone or by combination of their Contribution(s) + with the Work to which such Contribution(s) was submitted. If You + institute patent litigation against any entity (including a + cross-claim or counterclaim in a lawsuit) alleging that the Work + or a Contribution incorporated within the Work constitutes direct + or contributory patent infringement, then any patent licenses + granted to You under this License for that Work shall terminate + as of the date such litigation is filed. + + 4. Redistribution. You may reproduce and distribute copies of the + Work or Derivative Works thereof in any medium, with or without + modifications, and in Source or Object form, provided that You + meet the following conditions: + + (a) You must give any other recipients of the Work or + Derivative Works a copy of this License; and + + (b) You must cause any modified files to carry prominent notices + stating that You changed the files; and + + (c) You must retain, in the Source form of any Derivative Works + that You distribute, all copyright, patent, trademark, and + attribution notices from the Source form of the Work, + excluding those notices that do not pertain to any part of + the Derivative Works; and + + (d) If the Work includes a "NOTICE" text file as part of its + distribution, then any Derivative Works that You distribute must + include a readable copy of the attribution notices contained + within such NOTICE file, excluding those notices that do not + pertain to any part of the Derivative Works, in at least one + of the following places: within a NOTICE text file distributed + as part of the Derivative Works; within the Source form or + documentation, if provided along with the Derivative Works; or, + within a display generated by the Derivative Works, if and + wherever such third-party notices normally appear. The contents + of the NOTICE file are for informational purposes only and + do not modify the License. You may add Your own attribution + notices within Derivative Works that You distribute, alongside + or as an addendum to the NOTICE text from the Work, provided + that such additional attribution notices cannot be construed + as modifying the License. + + You may add Your own copyright statement to Your modifications and + may provide additional or different license terms and conditions + for use, reproduction, or distribution of Your modifications, or + for any such Derivative Works as a whole, provided Your use, + reproduction, and distribution of the Work otherwise complies with + the conditions stated in this License. + + 5. Submission of Contributions. Unless You explicitly state otherwise, + any Contribution intentionally submitted for inclusion in the Work + by You to the Licensor shall be under the terms and conditions of + this License, without any additional terms or conditions. + Notwithstanding the above, nothing herein shall supersede or modify + the terms of any separate license agreement you may have executed + with Licensor regarding such Contributions. + + 6. Trademarks. This License does not grant permission to use the trade + names, trademarks, service marks, or product names of the Licensor, + except as required for reasonable and customary use in describing the + origin of the Work and reproducing the content of the NOTICE file. + + 7. Disclaimer of Warranty. Unless required by applicable law or + agreed to in writing, Licensor provides the Work (and each + Contributor provides its Contributions) on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or + implied, including, without limitation, any warranties or conditions + of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A + PARTICULAR PURPOSE. You are solely responsible for determining the + appropriateness of using or redistributing the Work and assume any + risks associated with Your exercise of permissions under this License. + + 8. Limitation of Liability. In no event and under no legal theory, + whether in tort (including negligence), contract, or otherwise, + unless required by applicable law (such as deliberate and grossly + negligent acts) or agreed to in writing, shall any Contributor be + liable to You for damages, including any direct, indirect, special, + incidental, or consequential damages of any character arising as a + result of this License or out of the use or inability to use the + Work (including but not limited to damages for loss of goodwill, + work stoppage, computer failure or malfunction, or any and all + other commercial damages or losses), even if such Contributor + has been advised of the possibility of such damages. + + 9. Accepting Warranty or Additional Liability. While redistributing + the Work or Derivative Works thereof, You may choose to offer, + and charge a fee for, acceptance of support, warranty, indemnity, + or other liability obligations and/or rights consistent with this + License. However, in accepting such obligations, You may act only + on Your own behalf and on Your sole responsibility, not on behalf + of any other Contributor, and only if You agree to indemnify, + defend, and hold each Contributor harmless for any liability + incurred by, or claims asserted against, such Contributor by reason + of your accepting any such warranty or additional liability. + + END OF TERMS AND CONDITIONS + + APPENDIX: How to apply the Apache License to your work. + + To apply the Apache License to your work, attach the following + boilerplate notice, with the fields enclosed by brackets "[]" + replaced with your own identifying information. (Don't include + the brackets!) The text should be enclosed in the appropriate + comment syntax for the file format. We also recommend that a + file or class name and description of purpose be included on the + same "printed page" as the copyright notice for easier + identification within third-party archives. + + Copyright [yyyy] [name of copyright owner] + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. diff --git a/owl-bot-staging/google-cloud-saas_platform-saas_service_mgmt-v1beta1/README.md b/owl-bot-staging/google-cloud-saas_platform-saas_service_mgmt-v1beta1/README.md new file mode 100644 index 000000000000..027ccdec4891 --- /dev/null +++ b/owl-bot-staging/google-cloud-saas_platform-saas_service_mgmt-v1beta1/README.md @@ -0,0 +1,154 @@ +# Ruby Client for the SaaS Runtime V1BETA1 API + +Model, deploy, and operate your SaaS at scale. + +SaaS Runtime lets you store, host, manage, and monitor software as a service (SaaS) applications on Google Cloud. + +https://github.com/googleapis/google-cloud-ruby + +This gem is a _versioned_ client. It provides basic client classes for a +specific version of the SaaS Runtime V1BETA1 API. Most users should consider using +the main client gem, +[google-cloud-saas_platform-saas_service_mgmt](https://rubygems.org/gems/google-cloud-saas_platform-saas_service_mgmt). +See the section below titled *Which client should I use?* for more information. + +## Installation + +``` +$ gem install google-cloud-saas_platform-saas_service_mgmt-v1beta1 +``` + +## 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/saasservicemgmt.googleapis.com) +1. [Set up authentication.](AUTHENTICATION.md) + +## Quick Start + +```ruby +require "google/cloud/saas_platform/saas_service_mgmt/v1beta1" + +client = ::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::SaasDeployments::Client.new +request = ::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::ListSaasRequest.new # (request fields as keyword arguments...) +response = client.list_saas request +``` + +View the [Client Library Documentation](https://cloud.google.com/ruby/docs/reference/google-cloud-saas_platform-saas_service_mgmt-v1beta1/latest) +for class and method documentation. + +See also the [Product Documentation](https://cloud.google.com/saas-runtime/docs/overview) +for general usage information. + +## Debug Logging + +This library comes with opt-in Debug Logging that can help you troubleshoot +your application's integration with the API. When logging is activated, key +events such as requests and responses, along with data payloads and metadata +such as headers and client configuration, are logged to the standard error +stream. + +**WARNING:** Client Library Debug Logging includes your data payloads in +plaintext, which could include sensitive data such as PII for yourself or your +customers, private keys, or other security data that could be compromising if +leaked. Always practice good data hygiene with your application logs, and follow +the principle of least access. Google also recommends that Client Library Debug +Logging be enabled only temporarily during active debugging, and not used +permanently in production. + +To enable logging, set the environment variable `GOOGLE_SDK_RUBY_LOGGING_GEMS` +to the value `all`. Alternatively, you can set the value to a comma-delimited +list of client library gem names. This will select the default logging behavior, +which writes logs to the standard error stream. On a local workstation, this may +result in logs appearing on the console. When running on a Google Cloud hosting +service such as [Google Cloud Run](https://cloud.google.com/run), this generally +results in logs appearing alongside your application logs in the +[Google Cloud Logging](https://cloud.google.com/logging/) service. + +You can customize logging by modifying the `logger` configuration when +constructing a client object. For example: + +```ruby +require "google/cloud/saas_platform/saas_service_mgmt/v1beta1" +require "logger" + +client = ::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::SaasDeployments::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-saas_platform-saas_service_mgmt`, +and lower-level _versioned_ client libraries with names such as +`google-cloud-saas_platform-saas_service_mgmt-v1beta1`. +_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-saas_platform-saas_service_mgmt`. +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-saas_platform-saas_service_mgmt-v1beta1`. + +### What about the google-apis- clients? + +Client library gems with names that begin with `google-apis-` are based on an +older code generation technology. They talk to a REST/JSON backend (whereas +most modern clients talk to a [gRPC](https://grpc.io/) backend) and they may +not offer the same performance, features, and ease of use provided by more +modern clients. + +The `google-apis-` clients have wide coverage across Google services, so you +might need to use one if there is no modern client available for the service. +However, if a modern client is available, we generally recommend it over the +older `google-apis-` clients. diff --git a/owl-bot-staging/google-cloud-saas_platform-saas_service_mgmt-v1beta1/Rakefile b/owl-bot-staging/google-cloud-saas_platform-saas_service_mgmt-v1beta1/Rakefile new file mode 100644 index 000000000000..78bfe245658f --- /dev/null +++ b/owl-bot-staging/google-cloud-saas_platform-saas_service_mgmt-v1beta1/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-saas_platform-saas_service_mgmt-v1beta1 acceptance tests." +task :acceptance, :project, :keyfile do |t, args| + project = args[:project] + project ||= + ENV["GOOGLE_CLOUD_TEST_PROJECT"] || + ENV["GCLOUD_TEST_PROJECT"] + keyfile = args[:keyfile] + keyfile ||= + ENV["GOOGLE_CLOUD_TEST_KEYFILE"] || + ENV["GCLOUD_TEST_KEYFILE"] + if keyfile + keyfile = File.read keyfile + else + keyfile ||= + ENV["GOOGLE_CLOUD_TEST_KEYFILE_JSON"] || + ENV["GCLOUD_TEST_KEYFILE_JSON"] + end + if project.nil? || keyfile.nil? + fail "You must provide a project and keyfile. e.g. rake acceptance[test123, /path/to/keyfile.json] or GOOGLE_CLOUD_TEST_PROJECT=test123 GOOGLE_CLOUD_TEST_KEYFILE=/path/to/keyfile.json rake acceptance" + end + require "google/cloud/saas_platform/saas_service_mgmt/v1beta1/saas_deployments/credentials" + ::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::SaasDeployments::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-saas_platform-saas_service_mgmt-v1beta1 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-saas_platform-saas_service_mgmt-v1beta1 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-saas_platform-saas_service_mgmt-v1beta1 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-saas_platform-saas_service_mgmt-v1beta1 gem does not have doctest tests." +end + +desc "Run the CI build" +task :ci do + header "BUILDING google-cloud-saas_platform-saas_service_mgmt-v1beta1" + header "google-cloud-saas_platform-saas_service_mgmt-v1beta1 rubocop", "*" + Rake::Task[:rubocop].invoke + header "google-cloud-saas_platform-saas_service_mgmt-v1beta1 yard", "*" + Rake::Task[:yard].invoke + header "google-cloud-saas_platform-saas_service_mgmt-v1beta1 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-saas_platform-saas_service_mgmt-v1beta1 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-saas_platform-saas_service_mgmt-v1beta1 acceptance", "*" + Rake::Task[:acceptance].invoke + end + task :a do + # This is a handy shortcut to save typing + Rake::Task["ci:acceptance"].invoke + end +end + +task default: :test + +def header str, token = "#" + line_length = str.length + 8 + puts "" + puts token * line_length + puts "#{token * 3} #{str} #{token * 3}" + puts token * line_length + puts "" +end diff --git a/owl-bot-staging/google-cloud-saas_platform-saas_service_mgmt-v1beta1/gapic_metadata.json b/owl-bot-staging/google-cloud-saas_platform-saas_service_mgmt-v1beta1/gapic_metadata.json new file mode 100644 index 000000000000..be051f6cea19 --- /dev/null +++ b/owl-bot-staging/google-cloud-saas_platform-saas_service_mgmt-v1beta1/gapic_metadata.json @@ -0,0 +1,227 @@ +{ + "schema": "1.0", + "comment": "This file maps proto services/RPCs to the corresponding library clients/methods", + "language": "ruby", + "protoPackage": "google.cloud.saasplatform.saasservicemgmt.v1beta1", + "libraryPackage": "::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1", + "services": { + "SaasDeployments": { + "clients": { + "grpc": { + "libraryClient": "::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::SaasDeployments::Client", + "rpcs": { + "ListSaas": { + "methods": [ + "list_saas" + ] + }, + "GetSaas": { + "methods": [ + "get_saas" + ] + }, + "CreateSaas": { + "methods": [ + "create_saas" + ] + }, + "UpdateSaas": { + "methods": [ + "update_saas" + ] + }, + "DeleteSaas": { + "methods": [ + "delete_saas" + ] + }, + "ListTenants": { + "methods": [ + "list_tenants" + ] + }, + "GetTenant": { + "methods": [ + "get_tenant" + ] + }, + "CreateTenant": { + "methods": [ + "create_tenant" + ] + }, + "UpdateTenant": { + "methods": [ + "update_tenant" + ] + }, + "DeleteTenant": { + "methods": [ + "delete_tenant" + ] + }, + "ListUnitKinds": { + "methods": [ + "list_unit_kinds" + ] + }, + "GetUnitKind": { + "methods": [ + "get_unit_kind" + ] + }, + "CreateUnitKind": { + "methods": [ + "create_unit_kind" + ] + }, + "UpdateUnitKind": { + "methods": [ + "update_unit_kind" + ] + }, + "DeleteUnitKind": { + "methods": [ + "delete_unit_kind" + ] + }, + "ListUnits": { + "methods": [ + "list_units" + ] + }, + "GetUnit": { + "methods": [ + "get_unit" + ] + }, + "CreateUnit": { + "methods": [ + "create_unit" + ] + }, + "UpdateUnit": { + "methods": [ + "update_unit" + ] + }, + "DeleteUnit": { + "methods": [ + "delete_unit" + ] + }, + "ListUnitOperations": { + "methods": [ + "list_unit_operations" + ] + }, + "GetUnitOperation": { + "methods": [ + "get_unit_operation" + ] + }, + "CreateUnitOperation": { + "methods": [ + "create_unit_operation" + ] + }, + "UpdateUnitOperation": { + "methods": [ + "update_unit_operation" + ] + }, + "DeleteUnitOperation": { + "methods": [ + "delete_unit_operation" + ] + }, + "ListReleases": { + "methods": [ + "list_releases" + ] + }, + "GetRelease": { + "methods": [ + "get_release" + ] + }, + "CreateRelease": { + "methods": [ + "create_release" + ] + }, + "UpdateRelease": { + "methods": [ + "update_release" + ] + }, + "DeleteRelease": { + "methods": [ + "delete_release" + ] + } + } + } + } + }, + "SaasRollouts": { + "clients": { + "grpc": { + "libraryClient": "::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::SaasRollouts::Client", + "rpcs": { + "ListRollouts": { + "methods": [ + "list_rollouts" + ] + }, + "GetRollout": { + "methods": [ + "get_rollout" + ] + }, + "CreateRollout": { + "methods": [ + "create_rollout" + ] + }, + "UpdateRollout": { + "methods": [ + "update_rollout" + ] + }, + "DeleteRollout": { + "methods": [ + "delete_rollout" + ] + }, + "ListRolloutKinds": { + "methods": [ + "list_rollout_kinds" + ] + }, + "GetRolloutKind": { + "methods": [ + "get_rollout_kind" + ] + }, + "CreateRolloutKind": { + "methods": [ + "create_rollout_kind" + ] + }, + "UpdateRolloutKind": { + "methods": [ + "update_rollout_kind" + ] + }, + "DeleteRolloutKind": { + "methods": [ + "delete_rollout_kind" + ] + } + } + } + } + } + } +} diff --git a/owl-bot-staging/google-cloud-saas_platform-saas_service_mgmt-v1beta1/google-cloud-saas_platform-saas_service_mgmt-v1beta1.gemspec b/owl-bot-staging/google-cloud-saas_platform-saas_service_mgmt-v1beta1/google-cloud-saas_platform-saas_service_mgmt-v1beta1.gemspec new file mode 100644 index 000000000000..064e627f316c --- /dev/null +++ b/owl-bot-staging/google-cloud-saas_platform-saas_service_mgmt-v1beta1/google-cloud-saas_platform-saas_service_mgmt-v1beta1.gemspec @@ -0,0 +1,29 @@ +# -*- ruby -*- +# encoding: utf-8 + +require File.expand_path("lib/google/cloud/saas_platform/saas_service_mgmt/v1beta1/version", __dir__) + +Gem::Specification.new do |gem| + gem.name = "google-cloud-saas_platform-saas_service_mgmt-v1beta1" + gem.version = Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::VERSION + + gem.authors = ["Google LLC"] + gem.email = "googleapis-packages@google.com" + gem.description = "SaaS Runtime lets you store, host, manage, and monitor software as a service (SaaS) applications on Google Cloud. Note that google-cloud-saas_platform-saas_service_mgmt-v1beta1 is a version-specific client library. For most uses, we recommend installing the main client library google-cloud-saas_platform-saas_service_mgmt instead. See the readme for more details." + gem.summary = "Model, deploy, and operate your SaaS at scale." + 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-cloud-saas_platform-saas_service_mgmt-v1beta1/lib/google-cloud-saas_platform-saas_service_mgmt-v1beta1.rb b/owl-bot-staging/google-cloud-saas_platform-saas_service_mgmt-v1beta1/lib/google-cloud-saas_platform-saas_service_mgmt-v1beta1.rb new file mode 100644 index 000000000000..80bcd766d674 --- /dev/null +++ b/owl-bot-staging/google-cloud-saas_platform-saas_service_mgmt-v1beta1/lib/google-cloud-saas_platform-saas_service_mgmt-v1beta1.rb @@ -0,0 +1,21 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +# This gem does not autoload during Bundler.require. To load this gem, +# issue explicit require statements for the packages desired, e.g.: +# require "google/cloud/saas_platform/saas_service_mgmt/v1beta1" diff --git a/owl-bot-staging/google-cloud-saas_platform-saas_service_mgmt-v1beta1/lib/google/cloud/saas_platform/saas_service_mgmt/v1beta1.rb b/owl-bot-staging/google-cloud-saas_platform-saas_service_mgmt-v1beta1/lib/google/cloud/saas_platform/saas_service_mgmt/v1beta1.rb new file mode 100644 index 000000000000..791947b8231a --- /dev/null +++ b/owl-bot-staging/google-cloud-saas_platform-saas_service_mgmt-v1beta1/lib/google/cloud/saas_platform/saas_service_mgmt/v1beta1.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! + +require "google/cloud/saas_platform/saas_service_mgmt/v1beta1/saas_deployments" +require "google/cloud/saas_platform/saas_service_mgmt/v1beta1/saas_rollouts" +require "google/cloud/saas_platform/saas_service_mgmt/v1beta1/version" + +module Google + module Cloud + module SaasPlatform + module SaasServiceMgmt + ## + # API client module. + # + # @example Load this package, including all its services, and instantiate a gRPC client + # + # require "google/cloud/saas_platform/saas_service_mgmt/v1beta1" + # client = ::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::SaasDeployments::Client.new + # + # @example Load this package, including all its services, and instantiate a REST client + # + # require "google/cloud/saas_platform/saas_service_mgmt/v1beta1" + # client = ::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::SaasDeployments::Rest::Client.new + # + module V1beta1 + end + end + end + end +end + +helper_path = ::File.join __dir__, "v1beta1", "_helpers.rb" +require "google/cloud/saas_platform/saas_service_mgmt/v1beta1/_helpers" if ::File.file? helper_path diff --git a/owl-bot-staging/google-cloud-saas_platform-saas_service_mgmt-v1beta1/lib/google/cloud/saas_platform/saas_service_mgmt/v1beta1/bindings_override.rb b/owl-bot-staging/google-cloud-saas_platform-saas_service_mgmt-v1beta1/lib/google/cloud/saas_platform/saas_service_mgmt/v1beta1/bindings_override.rb new file mode 100644 index 000000000000..04229d9920ee --- /dev/null +++ b/owl-bot-staging/google-cloud-saas_platform-saas_service_mgmt-v1beta1/lib/google/cloud/saas_platform/saas_service_mgmt/v1beta1/bindings_override.rb @@ -0,0 +1,77 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +require "gapic/rest" + +module Google + module Cloud + module SaasPlatform + module SaasServiceMgmt + ## + # @example Loading just the REST part of this package, including all its services, and instantiating a REST client + # + # require "google/cloud/saas_platform/saas_service_mgmt/v1beta1/rest" + # client = ::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::SaasDeployments::Rest::Client.new + # + module V1beta1 + ## + # @private + # Initialize the mixin bindings configuration + # + def self.configure + @configure ||= begin + namespace = ["Google", "Cloud", "SaasPlatform", "SaasServiceMgmt"] + parent_config = while namespace.any? + parent_name = namespace.join "::" + parent_const = const_get parent_name + break parent_const.configure if parent_const.respond_to? :configure + namespace.pop + end + + default_config = ::Gapic::Rest::HttpBindingOverrideConfiguration.new parent_config + default_config.bindings_override["google.cloud.location.Locations.GetLocation"] = [ + Gapic::Rest::GrpcTranscoder::HttpBinding.create_with_validation( + uri_method: :get, + uri_template: "/v1beta1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/?$}, false] + ], + body: nil + ) + ] + default_config.bindings_override["google.cloud.location.Locations.ListLocations"] = [ + + Gapic::Rest::GrpcTranscoder::HttpBinding.create_with_validation( + uri_method: :get, + uri_template: "/v1beta1/{name}/locations", + matches: [ + ["name", %r{^projects/[^/]+/?$}, false] + ], + body: nil + ) + ] + default_config + end + yield @configure if block_given? + @configure + end + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-saas_platform-saas_service_mgmt-v1beta1/lib/google/cloud/saas_platform/saas_service_mgmt/v1beta1/rest.rb b/owl-bot-staging/google-cloud-saas_platform-saas_service_mgmt-v1beta1/lib/google/cloud/saas_platform/saas_service_mgmt/v1beta1/rest.rb new file mode 100644 index 000000000000..f8c683743050 --- /dev/null +++ b/owl-bot-staging/google-cloud-saas_platform-saas_service_mgmt-v1beta1/lib/google/cloud/saas_platform/saas_service_mgmt/v1beta1/rest.rb @@ -0,0 +1,41 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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/saas_platform/saas_service_mgmt/v1beta1/saas_deployments/rest" +require "google/cloud/saas_platform/saas_service_mgmt/v1beta1/saas_rollouts/rest" +require "google/cloud/saas_platform/saas_service_mgmt/v1beta1/bindings_override" +require "google/cloud/saas_platform/saas_service_mgmt/v1beta1/version" + +module Google + module Cloud + module SaasPlatform + module SaasServiceMgmt + ## + # To load just the REST part of this package, including all its services, and instantiate a REST client: + # + # @example + # + # require "google/cloud/saas_platform/saas_service_mgmt/v1beta1/rest" + # client = ::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::SaasDeployments::Rest::Client.new + # + module V1beta1 + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-saas_platform-saas_service_mgmt-v1beta1/lib/google/cloud/saas_platform/saas_service_mgmt/v1beta1/saas_deployments.rb b/owl-bot-staging/google-cloud-saas_platform-saas_service_mgmt-v1beta1/lib/google/cloud/saas_platform/saas_service_mgmt/v1beta1/saas_deployments.rb new file mode 100644 index 000000000000..11bbdfccaec4 --- /dev/null +++ b/owl-bot-staging/google-cloud-saas_platform-saas_service_mgmt-v1beta1/lib/google/cloud/saas_platform/saas_service_mgmt/v1beta1/saas_deployments.rb @@ -0,0 +1,57 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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/saas_platform/saas_service_mgmt/v1beta1/version" + +require "google/cloud/saas_platform/saas_service_mgmt/v1beta1/saas_deployments/credentials" +require "google/cloud/saas_platform/saas_service_mgmt/v1beta1/saas_deployments/paths" +require "google/cloud/saas_platform/saas_service_mgmt/v1beta1/saas_deployments/client" +require "google/cloud/saas_platform/saas_service_mgmt/v1beta1/saas_deployments/rest" + +module Google + module Cloud + module SaasPlatform + module SaasServiceMgmt + module V1beta1 + ## + # Manages the deployment of SaaS services. + # + # @example Load this service and instantiate a gRPC client + # + # require "google/cloud/saas_platform/saas_service_mgmt/v1beta1/saas_deployments" + # client = ::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::SaasDeployments::Client.new + # + # @example Load this service and instantiate a REST client + # + # require "google/cloud/saas_platform/saas_service_mgmt/v1beta1/saas_deployments/rest" + # client = ::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::SaasDeployments::Rest::Client.new + # + module SaasDeployments + end + end + end + end + end +end + +helper_path = ::File.join __dir__, "saas_deployments", "helpers.rb" +require "google/cloud/saas_platform/saas_service_mgmt/v1beta1/saas_deployments/helpers" if ::File.file? helper_path diff --git a/owl-bot-staging/google-cloud-saas_platform-saas_service_mgmt-v1beta1/lib/google/cloud/saas_platform/saas_service_mgmt/v1beta1/saas_deployments/client.rb b/owl-bot-staging/google-cloud-saas_platform-saas_service_mgmt-v1beta1/lib/google/cloud/saas_platform/saas_service_mgmt/v1beta1/saas_deployments/client.rb new file mode 100644 index 000000000000..328a3619f2ee --- /dev/null +++ b/owl-bot-staging/google-cloud-saas_platform-saas_service_mgmt-v1beta1/lib/google/cloud/saas_platform/saas_service_mgmt/v1beta1/saas_deployments/client.rb @@ -0,0 +1,3802 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +require "google/cloud/errors" +require "google/cloud/saasplatform/saasservicemgmt/v1beta1/deployments_service_pb" +require "google/cloud/location" + +module Google + module Cloud + module SaasPlatform + module SaasServiceMgmt + module V1beta1 + module SaasDeployments + ## + # Client for the SaasDeployments service. + # + # Manages the deployment of SaaS services. + # + class Client + # @private + API_VERSION = "" + + # @private + DEFAULT_ENDPOINT_TEMPLATE = "saasservicemgmt.$UNIVERSE_DOMAIN$" + + include Paths + + # @private + attr_reader :saas_deployments_stub + + ## + # Configure the SaasDeployments Client class. + # + # See {::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::SaasDeployments::Client::Configuration} + # for a description of the configuration fields. + # + # @example + # + # # Modify the configuration for all SaasDeployments clients + # ::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::SaasDeployments::Client.configure do |config| + # config.timeout = 10.0 + # end + # + # @yield [config] Configure the Client client. + # @yieldparam config [Client::Configuration] + # + # @return [Client::Configuration] + # + def self.configure + @configure ||= begin + namespace = ["Google", "Cloud", "SaasPlatform", "SaasServiceMgmt", "V1beta1"] + parent_config = while namespace.any? + parent_name = namespace.join "::" + parent_const = const_get parent_name + break parent_const.configure if parent_const.respond_to? :configure + namespace.pop + end + default_config = Client::Configuration.new parent_config + + default_config.rpcs.list_saas.timeout = 80.0 + default_config.rpcs.list_saas.retry_policy = { + initial_delay: 1.0, max_delay: 10.0, multiplier: 1.3, retry_codes: [14] + } + + default_config.rpcs.get_saas.timeout = 30.0 + default_config.rpcs.get_saas.retry_policy = { + initial_delay: 1.0, max_delay: 10.0, multiplier: 1.3, retry_codes: [14] + } + + default_config.rpcs.create_saas.timeout = 30.0 + + default_config.rpcs.update_saas.timeout = 30.0 + + default_config.rpcs.delete_saas.timeout = 30.0 + default_config.rpcs.delete_saas.retry_policy = { + initial_delay: 1.0, max_delay: 10.0, multiplier: 1.3, retry_codes: [14] + } + + default_config.rpcs.list_tenants.timeout = 80.0 + default_config.rpcs.list_tenants.retry_policy = { + initial_delay: 1.0, max_delay: 10.0, multiplier: 1.3, retry_codes: [14] + } + + default_config.rpcs.get_tenant.timeout = 30.0 + default_config.rpcs.get_tenant.retry_policy = { + initial_delay: 1.0, max_delay: 10.0, multiplier: 1.3, retry_codes: [14] + } + + default_config.rpcs.create_tenant.timeout = 30.0 + + default_config.rpcs.update_tenant.timeout = 30.0 + + default_config.rpcs.delete_tenant.timeout = 30.0 + default_config.rpcs.delete_tenant.retry_policy = { + initial_delay: 1.0, max_delay: 10.0, multiplier: 1.3, retry_codes: [14] + } + + default_config.rpcs.list_unit_kinds.timeout = 80.0 + default_config.rpcs.list_unit_kinds.retry_policy = { + initial_delay: 1.0, max_delay: 10.0, multiplier: 1.3, retry_codes: [14] + } + + default_config.rpcs.get_unit_kind.timeout = 30.0 + default_config.rpcs.get_unit_kind.retry_policy = { + initial_delay: 1.0, max_delay: 10.0, multiplier: 1.3, retry_codes: [14] + } + + default_config.rpcs.create_unit_kind.timeout = 30.0 + + default_config.rpcs.update_unit_kind.timeout = 80.0 + + default_config.rpcs.delete_unit_kind.timeout = 80.0 + default_config.rpcs.delete_unit_kind.retry_policy = { + initial_delay: 1.0, max_delay: 10.0, multiplier: 1.3, retry_codes: [14] + } + + default_config.rpcs.list_units.timeout = 80.0 + default_config.rpcs.list_units.retry_policy = { + initial_delay: 1.0, max_delay: 10.0, multiplier: 1.3, retry_codes: [14] + } + + default_config.rpcs.get_unit.timeout = 30.0 + default_config.rpcs.get_unit.retry_policy = { + initial_delay: 1.0, max_delay: 10.0, multiplier: 1.3, retry_codes: [14] + } + + default_config.rpcs.create_unit.timeout = 30.0 + + default_config.rpcs.update_unit.timeout = 30.0 + + default_config.rpcs.delete_unit.timeout = 30.0 + default_config.rpcs.delete_unit.retry_policy = { + initial_delay: 1.0, max_delay: 10.0, multiplier: 1.3, retry_codes: [14] + } + + default_config.rpcs.list_unit_operations.timeout = 80.0 + default_config.rpcs.list_unit_operations.retry_policy = { + initial_delay: 1.0, max_delay: 10.0, multiplier: 1.3, retry_codes: [14] + } + + default_config.rpcs.get_unit_operation.timeout = 30.0 + default_config.rpcs.get_unit_operation.retry_policy = { + initial_delay: 1.0, max_delay: 10.0, multiplier: 1.3, retry_codes: [14] + } + + default_config.rpcs.create_unit_operation.timeout = 30.0 + + default_config.rpcs.update_unit_operation.timeout = 30.0 + + default_config.rpcs.delete_unit_operation.timeout = 30.0 + default_config.rpcs.delete_unit_operation.retry_policy = { + initial_delay: 1.0, max_delay: 10.0, multiplier: 1.3, retry_codes: [14] + } + + default_config.rpcs.list_releases.timeout = 80.0 + default_config.rpcs.list_releases.retry_policy = { + initial_delay: 1.0, max_delay: 10.0, multiplier: 1.3, retry_codes: [14] + } + + default_config.rpcs.get_release.timeout = 30.0 + default_config.rpcs.get_release.retry_policy = { + initial_delay: 1.0, max_delay: 10.0, multiplier: 1.3, retry_codes: [14] + } + + default_config.rpcs.create_release.timeout = 30.0 + + default_config.rpcs.update_release.timeout = 30.0 + + default_config.rpcs.delete_release.timeout = 30.0 + default_config.rpcs.delete_release.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 SaasDeployments Client instance. + # + # The configuration is set to the derived mode, meaning that values can be changed, + # but structural changes (adding new fields, etc.) are not allowed. Structural changes + # should be made on {Client.configure}. + # + # See {::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::SaasDeployments::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 + @saas_deployments_stub.universe_domain + end + + ## + # Create a new SaasDeployments client object. + # + # @example + # + # # Create a client using the default configuration + # client = ::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::SaasDeployments::Client.new + # + # # Create a client using a custom configuration + # client = ::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::SaasDeployments::Client.new do |config| + # config.timeout = 10.0 + # end + # + # @yield [config] Configure the SaasDeployments client. + # @yieldparam config [Client::Configuration] + # + def initialize + # These require statements are intentionally placed here to initialize + # the gRPC module only when it's required. + # See https://github.com/googleapis/toolkit/issues/446 + require "gapic/grpc" + require "google/cloud/saasplatform/saasservicemgmt/v1beta1/deployments_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 + + @saas_deployments_stub = ::Gapic::ServiceStub.new( + ::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::SaasDeployments::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 + ) + + @saas_deployments_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 = @saas_deployments_stub.endpoint + config.universe_domain = @saas_deployments_stub.universe_domain + config.logger = @saas_deployments_stub.logger if config.respond_to? :logger= + end + end + + ## + # Get the associated client for mix-in of the Locations. + # + # @return [Google::Cloud::Location::Locations::Client] + # + attr_reader :location_client + + ## + # The logger used for request/response debug logging. + # + # @return [Logger] + # + def logger + @saas_deployments_stub.logger + end + + # Service calls + + ## + # Retrieve a collection of saas. + # + # @overload list_saas(request, options = nil) + # Pass arguments to `list_saas` via a request object, either of type + # {::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::ListSaasRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::ListSaasRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_saas(parent: nil, page_size: nil, page_token: nil, filter: nil, order_by: nil) + # Pass arguments to `list_saas` via keyword arguments. Note that at + # least one keyword argument is 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 of the saas. + # @param page_size [::Integer] + # The maximum number of saas to send per page. + # @param page_token [::String] + # The page token: If the next_page_token from a previous response + # is provided, this request will send the subsequent page. + # @param filter [::String] + # Filter the list as specified in https://google.aip.dev/160. + # @param order_by [::String] + # Order results as specified in https://google.aip.dev/132. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Gapic::PagedEnumerable<::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::Saas>] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Gapic::PagedEnumerable<::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::Saas>] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/saas_platform/saas_service_mgmt/v1beta1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::SaasDeployments::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::ListSaasRequest.new + # + # # Call the list_saas method. + # result = client.list_saas request + # + # # The returned object is of type Gapic::PagedEnumerable. You can iterate + # # over elements, and API calls will be issued to fetch pages as needed. + # result.each do |item| + # # Each element is of type ::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::Saas. + # p item + # end + # + def list_saas request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::ListSaasRequest + + # Converts hash 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_saas.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::SaasPlatform::SaasServiceMgmt::V1beta1::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_saas.timeout, + metadata: metadata, + retry_policy: @config.rpcs.list_saas.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @saas_deployments_stub.call_rpc :list_saas, request, options: options do |response, operation| + response = ::Gapic::PagedEnumerable.new @saas_deployments_stub, :list_saas, 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 + + ## + # Retrieve a single saas. + # + # @overload get_saas(request, options = nil) + # Pass arguments to `get_saas` via a request object, either of type + # {::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::GetSaasRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::GetSaasRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_saas(name: nil) + # Pass arguments to `get_saas` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param name [::String] + # Required. The resource name of the resource within a service. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::Saas] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::Saas] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/saas_platform/saas_service_mgmt/v1beta1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::SaasDeployments::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::GetSaasRequest.new + # + # # Call the get_saas method. + # result = client.get_saas request + # + # # The returned object is of type Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::Saas. + # p result + # + def get_saas request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::GetSaasRequest + + # Converts hash 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_saas.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::SaasPlatform::SaasServiceMgmt::V1beta1::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_saas.timeout, + metadata: metadata, + retry_policy: @config.rpcs.get_saas.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @saas_deployments_stub.call_rpc :get_saas, 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 + + ## + # Create a new saas. + # + # @overload create_saas(request, options = nil) + # Pass arguments to `create_saas` via a request object, either of type + # {::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::CreateSaasRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::CreateSaasRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_saas(parent: nil, saas_id: nil, saas: nil, validate_only: nil, request_id: nil) + # Pass arguments to `create_saas` via keyword arguments. Note that at + # least one keyword argument is 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 of the saas. + # @param saas_id [::String] + # Required. The ID value for the new saas. + # @param saas [::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::Saas, ::Hash] + # Required. The desired state for the saas. + # @param validate_only [::Boolean] + # If "validate_only" is set to true, the service will try to validate + # that this request would succeed, but will not actually make changes. + # @param request_id [::String] + # An optional request ID to identify requests. Specify a unique request ID + # so that if you must retry your request, the server will know to ignore + # the request if it has already been completed. The server will guarantee + # that for at least 60 minutes since the first request. + # + # For example, consider a situation where you make an initial request and the + # request times out. If you make the request again with the same request + # ID, the server can check if original operation with the same request ID + # was received, and if so, will ignore the second request. This prevents + # clients from accidentally creating duplicate commitments. + # + # The request ID must be a valid UUID with the exception that zero UUID is + # not supported (00000000-0000-0000-0000-000000000000). + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::Saas] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::Saas] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/saas_platform/saas_service_mgmt/v1beta1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::SaasDeployments::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::CreateSaasRequest.new + # + # # Call the create_saas method. + # result = client.create_saas request + # + # # The returned object is of type Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::Saas. + # p result + # + def create_saas request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::CreateSaasRequest + + # Converts hash 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_saas.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::SaasPlatform::SaasServiceMgmt::V1beta1::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_saas.timeout, + metadata: metadata, + retry_policy: @config.rpcs.create_saas.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @saas_deployments_stub.call_rpc :create_saas, 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 + + ## + # Update a single saas. + # + # @overload update_saas(request, options = nil) + # Pass arguments to `update_saas` via a request object, either of type + # {::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::UpdateSaasRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::UpdateSaasRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_saas(saas: nil, validate_only: nil, request_id: nil, update_mask: nil) + # Pass arguments to `update_saas` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param saas [::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::Saas, ::Hash] + # Required. The desired state for the saas. + # @param validate_only [::Boolean] + # If "validate_only" is set to true, the service will try to validate + # that this request would succeed, but will not actually make changes. + # @param request_id [::String] + # An optional request ID to identify requests. Specify a unique request ID + # so that if you must retry your request, the server will know to ignore + # the request if it has already been completed. The server will guarantee + # that for at least 60 minutes since the first request. + # + # For example, consider a situation where you make an initial request and the + # request times out. If you make the request again with the same request + # ID, the server can check if original operation with the same request ID + # was received, and if so, will ignore the second request. This prevents + # clients from accidentally creating duplicate commitments. + # + # The request ID must be a valid UUID with the exception that zero UUID is + # not supported (00000000-0000-0000-0000-000000000000). + # @param update_mask [::Google::Protobuf::FieldMask, ::Hash] + # Field mask is used to specify the fields to be overwritten in the + # Saas resource by the update. + # + # The fields specified in the update_mask are relative to the resource, not + # the full request. A field will be overwritten if it is in the mask. + # + # If the user does not provide a mask then all fields in the + # Saas will be overwritten. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::Saas] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::Saas] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/saas_platform/saas_service_mgmt/v1beta1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::SaasDeployments::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::UpdateSaasRequest.new + # + # # Call the update_saas method. + # result = client.update_saas request + # + # # The returned object is of type Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::Saas. + # p result + # + def update_saas request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::UpdateSaasRequest + + # Converts hash 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_saas.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::SaasPlatform::SaasServiceMgmt::V1beta1::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.saas&.name + header_params["saas.name"] = request.saas.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_saas.timeout, + metadata: metadata, + retry_policy: @config.rpcs.update_saas.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @saas_deployments_stub.call_rpc :update_saas, 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 + + ## + # Delete a single saas. + # + # @overload delete_saas(request, options = nil) + # Pass arguments to `delete_saas` via a request object, either of type + # {::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::DeleteSaasRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::DeleteSaasRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_saas(name: nil, etag: nil, validate_only: nil, request_id: nil) + # Pass arguments to `delete_saas` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param name [::String] + # Required. The resource name of the resource within a service. + # @param etag [::String] + # The etag known to the client for the expected state of the saas. This is + # used with state-changing methods to prevent accidental overwrites when + # multiple user agents might be acting in parallel on the same resource. + # + # An etag wildcard provide optimistic concurrency based on the expected + # existence of the saas. The Any wildcard (`*`) requires that the resource + # must already exists, and the Not Any wildcard (`!*`) requires that it must + # not. + # @param validate_only [::Boolean] + # If "validate_only" is set to true, the service will try to validate + # that this request would succeed, but will not actually make changes. + # @param request_id [::String] + # An optional request ID to identify requests. Specify a unique request ID + # so that if you must retry your request, the server will know to ignore + # the request if it has already been completed. The server will guarantee + # that for at least 60 minutes since the first request. + # + # For example, consider a situation where you make an initial request and the + # request times out. If you make the request again with the same request + # ID, the server can check if original operation with the same request ID + # was received, and if so, will ignore the second request. This prevents + # clients from accidentally creating duplicate commitments. + # + # The request ID must be a valid UUID with the exception that zero UUID is + # not supported (00000000-0000-0000-0000-000000000000). + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Google::Protobuf::Empty] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Google::Protobuf::Empty] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/saas_platform/saas_service_mgmt/v1beta1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::SaasDeployments::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::DeleteSaasRequest.new + # + # # Call the delete_saas method. + # result = client.delete_saas request + # + # # The returned object is of type Google::Protobuf::Empty. + # p result + # + def delete_saas request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::DeleteSaasRequest + + # Converts hash 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_saas.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::SaasPlatform::SaasServiceMgmt::V1beta1::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_saas.timeout, + metadata: metadata, + retry_policy: @config.rpcs.delete_saas.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @saas_deployments_stub.call_rpc :delete_saas, 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 + + ## + # Retrieve a collection of tenants. + # + # @overload list_tenants(request, options = nil) + # Pass arguments to `list_tenants` via a request object, either of type + # {::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::ListTenantsRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::ListTenantsRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_tenants(parent: nil, page_size: nil, page_token: nil, filter: nil, order_by: nil) + # Pass arguments to `list_tenants` via keyword arguments. Note that at + # least one keyword argument is 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 of the tenant. + # @param page_size [::Integer] + # The maximum number of tenants to send per page. + # @param page_token [::String] + # The page token: If the next_page_token from a previous response + # is provided, this request will send the subsequent page. + # @param filter [::String] + # Filter the list as specified in https://google.aip.dev/160. + # @param order_by [::String] + # Order results as specified in https://google.aip.dev/132. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Gapic::PagedEnumerable<::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::Tenant>] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Gapic::PagedEnumerable<::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::Tenant>] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/saas_platform/saas_service_mgmt/v1beta1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::SaasDeployments::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::ListTenantsRequest.new + # + # # Call the list_tenants method. + # result = client.list_tenants request + # + # # The returned object is of type Gapic::PagedEnumerable. You can iterate + # # over elements, and API calls will be issued to fetch pages as needed. + # result.each do |item| + # # Each element is of type ::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::Tenant. + # p item + # end + # + def list_tenants request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::ListTenantsRequest + + # Converts hash 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_tenants.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::SaasPlatform::SaasServiceMgmt::V1beta1::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_tenants.timeout, + metadata: metadata, + retry_policy: @config.rpcs.list_tenants.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @saas_deployments_stub.call_rpc :list_tenants, request, options: options do |response, operation| + response = ::Gapic::PagedEnumerable.new @saas_deployments_stub, :list_tenants, 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 + + ## + # Retrieve a single tenant. + # + # @overload get_tenant(request, options = nil) + # Pass arguments to `get_tenant` via a request object, either of type + # {::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::GetTenantRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::GetTenantRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_tenant(name: nil) + # Pass arguments to `get_tenant` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param name [::String] + # Required. The resource name of the resource within a service. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::Tenant] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::Tenant] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/saas_platform/saas_service_mgmt/v1beta1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::SaasDeployments::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::GetTenantRequest.new + # + # # Call the get_tenant method. + # result = client.get_tenant request + # + # # The returned object is of type Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::Tenant. + # p result + # + def get_tenant request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::GetTenantRequest + + # Converts hash 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_tenant.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::SaasPlatform::SaasServiceMgmt::V1beta1::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_tenant.timeout, + metadata: metadata, + retry_policy: @config.rpcs.get_tenant.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @saas_deployments_stub.call_rpc :get_tenant, 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 + + ## + # Create a new tenant. + # + # @overload create_tenant(request, options = nil) + # Pass arguments to `create_tenant` via a request object, either of type + # {::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::CreateTenantRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::CreateTenantRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_tenant(parent: nil, tenant_id: nil, tenant: nil, validate_only: nil, request_id: nil) + # Pass arguments to `create_tenant` via keyword arguments. Note that at + # least one keyword argument is 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 of the tenant. + # @param tenant_id [::String] + # Required. The ID value for the new tenant. + # @param tenant [::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::Tenant, ::Hash] + # Required. The desired state for the tenant. + # @param validate_only [::Boolean] + # If "validate_only" is set to true, the service will try to validate + # that this request would succeed, but will not actually make changes. + # @param request_id [::String] + # An optional request ID to identify requests. Specify a unique request ID + # so that if you must retry your request, the server will know to ignore + # the request if it has already been completed. The server will guarantee + # that for at least 60 minutes since the first request. + # + # For example, consider a situation where you make an initial request and the + # request times out. If you make the request again with the same request + # ID, the server can check if original operation with the same request ID + # was received, and if so, will ignore the second request. This prevents + # clients from accidentally creating duplicate commitments. + # + # The request ID must be a valid UUID with the exception that zero UUID is + # not supported (00000000-0000-0000-0000-000000000000). + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::Tenant] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::Tenant] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/saas_platform/saas_service_mgmt/v1beta1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::SaasDeployments::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::CreateTenantRequest.new + # + # # Call the create_tenant method. + # result = client.create_tenant request + # + # # The returned object is of type Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::Tenant. + # p result + # + def create_tenant request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::CreateTenantRequest + + # Converts hash 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_tenant.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::SaasPlatform::SaasServiceMgmt::V1beta1::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_tenant.timeout, + metadata: metadata, + retry_policy: @config.rpcs.create_tenant.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @saas_deployments_stub.call_rpc :create_tenant, 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 + + ## + # Update a single tenant. + # + # @overload update_tenant(request, options = nil) + # Pass arguments to `update_tenant` via a request object, either of type + # {::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::UpdateTenantRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::UpdateTenantRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_tenant(tenant: nil, validate_only: nil, request_id: nil, update_mask: nil) + # Pass arguments to `update_tenant` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param tenant [::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::Tenant, ::Hash] + # Required. The desired state for the tenant. + # @param validate_only [::Boolean] + # If "validate_only" is set to true, the service will try to validate + # that this request would succeed, but will not actually make changes. + # @param request_id [::String] + # An optional request ID to identify requests. Specify a unique request ID + # so that if you must retry your request, the server will know to ignore + # the request if it has already been completed. The server will guarantee + # that for at least 60 minutes since the first request. + # + # For example, consider a situation where you make an initial request and the + # request times out. If you make the request again with the same request + # ID, the server can check if original operation with the same request ID + # was received, and if so, will ignore the second request. This prevents + # clients from accidentally creating duplicate commitments. + # + # The request ID must be a valid UUID with the exception that zero UUID is + # not supported (00000000-0000-0000-0000-000000000000). + # @param update_mask [::Google::Protobuf::FieldMask, ::Hash] + # Field mask is used to specify the fields to be overwritten in the + # Tenant resource by the update. + # + # The fields specified in the update_mask are relative to the resource, not + # the full request. A field will be overwritten if it is in the mask. + # + # If the user does not provide a mask then all fields in the + # Tenant will be overwritten. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::Tenant] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::Tenant] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/saas_platform/saas_service_mgmt/v1beta1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::SaasDeployments::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::UpdateTenantRequest.new + # + # # Call the update_tenant method. + # result = client.update_tenant request + # + # # The returned object is of type Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::Tenant. + # p result + # + def update_tenant request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::UpdateTenantRequest + + # Converts hash 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_tenant.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::SaasPlatform::SaasServiceMgmt::V1beta1::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.tenant&.name + header_params["tenant.name"] = request.tenant.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_tenant.timeout, + metadata: metadata, + retry_policy: @config.rpcs.update_tenant.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @saas_deployments_stub.call_rpc :update_tenant, 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 + + ## + # Delete a single tenant. + # + # @overload delete_tenant(request, options = nil) + # Pass arguments to `delete_tenant` via a request object, either of type + # {::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::DeleteTenantRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::DeleteTenantRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_tenant(name: nil, etag: nil, validate_only: nil, request_id: nil) + # Pass arguments to `delete_tenant` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param name [::String] + # Required. The resource name of the resource within a service. + # @param etag [::String] + # The etag known to the client for the expected state of the tenant. This is + # used with state-changing methods to prevent accidental overwrites when + # multiple user agents might be acting in parallel on the same resource. + # + # An etag wildcard provide optimistic concurrency based on the expected + # existence of the tenant. The Any wildcard (`*`) requires that the resource + # must already exists, and the Not Any wildcard (`!*`) requires that it must + # not. + # @param validate_only [::Boolean] + # If "validate_only" is set to true, the service will try to validate + # that this request would succeed, but will not actually make changes. + # @param request_id [::String] + # An optional request ID to identify requests. Specify a unique request ID + # so that if you must retry your request, the server will know to ignore + # the request if it has already been completed. The server will guarantee + # that for at least 60 minutes since the first request. + # + # For example, consider a situation where you make an initial request and the + # request times out. If you make the request again with the same request + # ID, the server can check if original operation with the same request ID + # was received, and if so, will ignore the second request. This prevents + # clients from accidentally creating duplicate commitments. + # + # The request ID must be a valid UUID with the exception that zero UUID is + # not supported (00000000-0000-0000-0000-000000000000). + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Google::Protobuf::Empty] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Google::Protobuf::Empty] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/saas_platform/saas_service_mgmt/v1beta1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::SaasDeployments::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::DeleteTenantRequest.new + # + # # Call the delete_tenant method. + # result = client.delete_tenant request + # + # # The returned object is of type Google::Protobuf::Empty. + # p result + # + def delete_tenant request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::DeleteTenantRequest + + # Converts hash 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_tenant.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::SaasPlatform::SaasServiceMgmt::V1beta1::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_tenant.timeout, + metadata: metadata, + retry_policy: @config.rpcs.delete_tenant.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @saas_deployments_stub.call_rpc :delete_tenant, 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 + + ## + # Retrieve a collection of unit kinds. + # + # @overload list_unit_kinds(request, options = nil) + # Pass arguments to `list_unit_kinds` via a request object, either of type + # {::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::ListUnitKindsRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::ListUnitKindsRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_unit_kinds(parent: nil, page_size: nil, page_token: nil, filter: nil, order_by: nil) + # Pass arguments to `list_unit_kinds` via keyword arguments. Note that at + # least one keyword argument is 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 of the unit kind. + # @param page_size [::Integer] + # The maximum number of unit kinds to send per page. + # @param page_token [::String] + # The page token: If the next_page_token from a previous response + # is provided, this request will send the subsequent page. + # @param filter [::String] + # Filter the list as specified in https://google.aip.dev/160. + # @param order_by [::String] + # Order results as specified in https://google.aip.dev/132. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Gapic::PagedEnumerable<::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::UnitKind>] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Gapic::PagedEnumerable<::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::UnitKind>] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/saas_platform/saas_service_mgmt/v1beta1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::SaasDeployments::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::ListUnitKindsRequest.new + # + # # Call the list_unit_kinds method. + # result = client.list_unit_kinds request + # + # # The returned object is of type Gapic::PagedEnumerable. You can iterate + # # over elements, and API calls will be issued to fetch pages as needed. + # result.each do |item| + # # Each element is of type ::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::UnitKind. + # p item + # end + # + def list_unit_kinds request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::ListUnitKindsRequest + + # Converts hash 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_unit_kinds.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::SaasPlatform::SaasServiceMgmt::V1beta1::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_unit_kinds.timeout, + metadata: metadata, + retry_policy: @config.rpcs.list_unit_kinds.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @saas_deployments_stub.call_rpc :list_unit_kinds, request, options: options do |response, operation| + response = ::Gapic::PagedEnumerable.new @saas_deployments_stub, :list_unit_kinds, 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 + + ## + # Retrieve a single unit kind. + # + # @overload get_unit_kind(request, options = nil) + # Pass arguments to `get_unit_kind` via a request object, either of type + # {::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::GetUnitKindRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::GetUnitKindRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_unit_kind(name: nil) + # Pass arguments to `get_unit_kind` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param name [::String] + # Required. The resource name of the resource within a service. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::UnitKind] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::UnitKind] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/saas_platform/saas_service_mgmt/v1beta1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::SaasDeployments::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::GetUnitKindRequest.new + # + # # Call the get_unit_kind method. + # result = client.get_unit_kind request + # + # # The returned object is of type Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::UnitKind. + # p result + # + def get_unit_kind request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::GetUnitKindRequest + + # Converts hash 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_unit_kind.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::SaasPlatform::SaasServiceMgmt::V1beta1::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_unit_kind.timeout, + metadata: metadata, + retry_policy: @config.rpcs.get_unit_kind.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @saas_deployments_stub.call_rpc :get_unit_kind, 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 + + ## + # Create a new unit kind. + # + # @overload create_unit_kind(request, options = nil) + # Pass arguments to `create_unit_kind` via a request object, either of type + # {::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::CreateUnitKindRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::CreateUnitKindRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_unit_kind(parent: nil, unit_kind_id: nil, unit_kind: nil, validate_only: nil, request_id: nil) + # Pass arguments to `create_unit_kind` via keyword arguments. Note that at + # least one keyword argument is 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 of the unit kind. + # @param unit_kind_id [::String] + # Required. The ID value for the new unit kind. + # @param unit_kind [::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::UnitKind, ::Hash] + # Required. The desired state for the unit kind. + # @param validate_only [::Boolean] + # If "validate_only" is set to true, the service will try to validate + # that this request would succeed, but will not actually make changes. + # @param request_id [::String] + # An optional request ID to identify requests. Specify a unique request ID + # so that if you must retry your request, the server will know to ignore + # the request if it has already been completed. The server will guarantee + # that for at least 60 minutes since the first request. + # + # For example, consider a situation where you make an initial request and the + # request times out. If you make the request again with the same request + # ID, the server can check if original operation with the same request ID + # was received, and if so, will ignore the second request. This prevents + # clients from accidentally creating duplicate commitments. + # + # The request ID must be a valid UUID with the exception that zero UUID is + # not supported (00000000-0000-0000-0000-000000000000). + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::UnitKind] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::UnitKind] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/saas_platform/saas_service_mgmt/v1beta1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::SaasDeployments::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::CreateUnitKindRequest.new + # + # # Call the create_unit_kind method. + # result = client.create_unit_kind request + # + # # The returned object is of type Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::UnitKind. + # p result + # + def create_unit_kind request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::CreateUnitKindRequest + + # Converts hash 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_unit_kind.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::SaasPlatform::SaasServiceMgmt::V1beta1::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_unit_kind.timeout, + metadata: metadata, + retry_policy: @config.rpcs.create_unit_kind.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @saas_deployments_stub.call_rpc :create_unit_kind, 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 + + ## + # Update a single unit kind. + # + # @overload update_unit_kind(request, options = nil) + # Pass arguments to `update_unit_kind` via a request object, either of type + # {::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::UpdateUnitKindRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::UpdateUnitKindRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_unit_kind(unit_kind: nil, validate_only: nil, request_id: nil, update_mask: nil) + # Pass arguments to `update_unit_kind` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param unit_kind [::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::UnitKind, ::Hash] + # Required. The desired state for the unit kind. + # @param validate_only [::Boolean] + # If "validate_only" is set to true, the service will try to validate + # that this request would succeed, but will not actually make changes. + # @param request_id [::String] + # An optional request ID to identify requests. Specify a unique request ID + # so that if you must retry your request, the server will know to ignore + # the request if it has already been completed. The server will guarantee + # that for at least 60 minutes since the first request. + # + # For example, consider a situation where you make an initial request and the + # request times out. If you make the request again with the same request + # ID, the server can check if original operation with the same request ID + # was received, and if so, will ignore the second request. This prevents + # clients from accidentally creating duplicate commitments. + # + # The request ID must be a valid UUID with the exception that zero UUID is + # not supported (00000000-0000-0000-0000-000000000000). + # @param update_mask [::Google::Protobuf::FieldMask, ::Hash] + # Field mask is used to specify the fields to be overwritten in the + # UnitKind resource by the update. + # + # The fields specified in the update_mask are relative to the resource, not + # the full request. A field will be overwritten if it is in the mask. + # + # If the user does not provide a mask then all fields in the + # UnitKind will be overwritten. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::UnitKind] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::UnitKind] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/saas_platform/saas_service_mgmt/v1beta1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::SaasDeployments::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::UpdateUnitKindRequest.new + # + # # Call the update_unit_kind method. + # result = client.update_unit_kind request + # + # # The returned object is of type Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::UnitKind. + # p result + # + def update_unit_kind request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::UpdateUnitKindRequest + + # Converts hash 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_unit_kind.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::SaasPlatform::SaasServiceMgmt::V1beta1::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.unit_kind&.name + header_params["unit_kind.name"] = request.unit_kind.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_unit_kind.timeout, + metadata: metadata, + retry_policy: @config.rpcs.update_unit_kind.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @saas_deployments_stub.call_rpc :update_unit_kind, 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 + + ## + # Delete a single unit kind. + # + # @overload delete_unit_kind(request, options = nil) + # Pass arguments to `delete_unit_kind` via a request object, either of type + # {::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::DeleteUnitKindRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::DeleteUnitKindRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_unit_kind(name: nil, etag: nil, validate_only: nil, request_id: nil) + # Pass arguments to `delete_unit_kind` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param name [::String] + # Required. The resource name of the resource within a service. + # @param etag [::String] + # The etag known to the client for the expected state of the unit kind. This + # is used with state-changing methods to prevent accidental overwrites when + # multiple user agents might be acting in parallel on the same resource. + # + # An etag wildcard provide optimistic concurrency based on the expected + # existence of the unit kind. The Any wildcard (`*`) requires that the + # resource must already exists, and the Not Any wildcard (`!*`) requires that + # it must not. + # @param validate_only [::Boolean] + # If "validate_only" is set to true, the service will try to validate + # that this request would succeed, but will not actually make changes. + # @param request_id [::String] + # An optional request ID to identify requests. Specify a unique request ID + # so that if you must retry your request, the server will know to ignore + # the request if it has already been completed. The server will guarantee + # that for at least 60 minutes since the first request. + # + # For example, consider a situation where you make an initial request and the + # request times out. If you make the request again with the same request + # ID, the server can check if original operation with the same request ID + # was received, and if so, will ignore the second request. This prevents + # clients from accidentally creating duplicate commitments. + # + # The request ID must be a valid UUID with the exception that zero UUID is + # not supported (00000000-0000-0000-0000-000000000000). + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Google::Protobuf::Empty] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Google::Protobuf::Empty] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/saas_platform/saas_service_mgmt/v1beta1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::SaasDeployments::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::DeleteUnitKindRequest.new + # + # # Call the delete_unit_kind method. + # result = client.delete_unit_kind request + # + # # The returned object is of type Google::Protobuf::Empty. + # p result + # + def delete_unit_kind request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::DeleteUnitKindRequest + + # Converts hash 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_unit_kind.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::SaasPlatform::SaasServiceMgmt::V1beta1::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_unit_kind.timeout, + metadata: metadata, + retry_policy: @config.rpcs.delete_unit_kind.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @saas_deployments_stub.call_rpc :delete_unit_kind, 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 + + ## + # Retrieve a collection of units. + # + # @overload list_units(request, options = nil) + # Pass arguments to `list_units` via a request object, either of type + # {::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::ListUnitsRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::ListUnitsRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_units(parent: nil, page_size: nil, page_token: nil, filter: nil, order_by: nil) + # Pass arguments to `list_units` via keyword arguments. Note that at + # least one keyword argument is 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 of the unit. + # @param page_size [::Integer] + # The maximum number of units to send per page. + # @param page_token [::String] + # The page token: If the next_page_token from a previous response + # is provided, this request will send the subsequent page. + # @param filter [::String] + # Filter the list as specified in https://google.aip.dev/160. + # @param order_by [::String] + # Order results as specified in https://google.aip.dev/132. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Gapic::PagedEnumerable<::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::Unit>] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Gapic::PagedEnumerable<::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::Unit>] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/saas_platform/saas_service_mgmt/v1beta1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::SaasDeployments::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::ListUnitsRequest.new + # + # # Call the list_units method. + # result = client.list_units request + # + # # The returned object is of type Gapic::PagedEnumerable. You can iterate + # # over elements, and API calls will be issued to fetch pages as needed. + # result.each do |item| + # # Each element is of type ::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::Unit. + # p item + # end + # + def list_units request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::ListUnitsRequest + + # Converts hash 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_units.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::SaasPlatform::SaasServiceMgmt::V1beta1::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_units.timeout, + metadata: metadata, + retry_policy: @config.rpcs.list_units.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @saas_deployments_stub.call_rpc :list_units, request, options: options do |response, operation| + response = ::Gapic::PagedEnumerable.new @saas_deployments_stub, :list_units, 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 + + ## + # Retrieve a single unit. + # + # @overload get_unit(request, options = nil) + # Pass arguments to `get_unit` via a request object, either of type + # {::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::GetUnitRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::GetUnitRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_unit(name: nil) + # Pass arguments to `get_unit` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param name [::String] + # Required. The resource name of the resource within a service. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::Unit] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::Unit] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/saas_platform/saas_service_mgmt/v1beta1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::SaasDeployments::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::GetUnitRequest.new + # + # # Call the get_unit method. + # result = client.get_unit request + # + # # The returned object is of type Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::Unit. + # p result + # + def get_unit request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::GetUnitRequest + + # Converts hash 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_unit.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::SaasPlatform::SaasServiceMgmt::V1beta1::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_unit.timeout, + metadata: metadata, + retry_policy: @config.rpcs.get_unit.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @saas_deployments_stub.call_rpc :get_unit, 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 + + ## + # Create a new unit. + # + # @overload create_unit(request, options = nil) + # Pass arguments to `create_unit` via a request object, either of type + # {::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::CreateUnitRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::CreateUnitRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_unit(parent: nil, unit_id: nil, unit: nil, validate_only: nil, request_id: nil) + # Pass arguments to `create_unit` via keyword arguments. Note that at + # least one keyword argument is 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 of the unit. + # @param unit_id [::String] + # Required. The ID value for the new unit. + # @param unit [::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::Unit, ::Hash] + # Required. The desired state for the unit. + # @param validate_only [::Boolean] + # If "validate_only" is set to true, the service will try to validate + # that this request would succeed, but will not actually make changes. + # @param request_id [::String] + # An optional request ID to identify requests. Specify a unique request ID + # so that if you must retry your request, the server will know to ignore + # the request if it has already been completed. The server will guarantee + # that for at least 60 minutes since the first request. + # + # For example, consider a situation where you make an initial request and the + # request times out. If you make the request again with the same request + # ID, the server can check if original operation with the same request ID + # was received, and if so, will ignore the second request. This prevents + # clients from accidentally creating duplicate commitments. + # + # The request ID must be a valid UUID with the exception that zero UUID is + # not supported (00000000-0000-0000-0000-000000000000). + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::Unit] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::Unit] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/saas_platform/saas_service_mgmt/v1beta1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::SaasDeployments::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::CreateUnitRequest.new + # + # # Call the create_unit method. + # result = client.create_unit request + # + # # The returned object is of type Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::Unit. + # p result + # + def create_unit request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::CreateUnitRequest + + # Converts hash 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_unit.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::SaasPlatform::SaasServiceMgmt::V1beta1::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_unit.timeout, + metadata: metadata, + retry_policy: @config.rpcs.create_unit.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @saas_deployments_stub.call_rpc :create_unit, 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 + + ## + # Update a single unit. + # + # @overload update_unit(request, options = nil) + # Pass arguments to `update_unit` via a request object, either of type + # {::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::UpdateUnitRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::UpdateUnitRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_unit(unit: nil, validate_only: nil, request_id: nil, update_mask: nil) + # Pass arguments to `update_unit` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param unit [::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::Unit, ::Hash] + # Required. The desired state for the unit. + # @param validate_only [::Boolean] + # If "validate_only" is set to true, the service will try to validate + # that this request would succeed, but will not actually make changes. + # @param request_id [::String] + # An optional request ID to identify requests. Specify a unique request ID + # so that if you must retry your request, the server will know to ignore + # the request if it has already been completed. The server will guarantee + # that for at least 60 minutes since the first request. + # + # For example, consider a situation where you make an initial request and the + # request times out. If you make the request again with the same request + # ID, the server can check if original operation with the same request ID + # was received, and if so, will ignore the second request. This prevents + # clients from accidentally creating duplicate commitments. + # + # The request ID must be a valid UUID with the exception that zero UUID is + # not supported (00000000-0000-0000-0000-000000000000). + # @param update_mask [::Google::Protobuf::FieldMask, ::Hash] + # Field mask is used to specify the fields to be overwritten in the + # Unit resource by the update. + # + # The fields specified in the update_mask are relative to the resource, not + # the full request. A field will be overwritten if it is in the mask. + # + # If the user does not provide a mask then all fields in the + # Unit will be overwritten. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::Unit] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::Unit] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/saas_platform/saas_service_mgmt/v1beta1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::SaasDeployments::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::UpdateUnitRequest.new + # + # # Call the update_unit method. + # result = client.update_unit request + # + # # The returned object is of type Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::Unit. + # p result + # + def update_unit request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::UpdateUnitRequest + + # Converts hash 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_unit.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::SaasPlatform::SaasServiceMgmt::V1beta1::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.unit&.name + header_params["unit.name"] = request.unit.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_unit.timeout, + metadata: metadata, + retry_policy: @config.rpcs.update_unit.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @saas_deployments_stub.call_rpc :update_unit, 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 + + ## + # Delete a single unit. + # + # @overload delete_unit(request, options = nil) + # Pass arguments to `delete_unit` via a request object, either of type + # {::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::DeleteUnitRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::DeleteUnitRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_unit(name: nil, etag: nil, validate_only: nil, request_id: nil) + # Pass arguments to `delete_unit` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param name [::String] + # Required. The resource name of the resource within a service. + # @param etag [::String] + # The etag known to the client for the expected state of the unit. This is + # used with state-changing methods to prevent accidental overwrites when + # multiple user agents might be acting in parallel on the same resource. + # + # An etag wildcard provide optimistic concurrency based on the expected + # existence of the unit. The Any wildcard (`*`) requires that the resource + # must already exists, and the Not Any wildcard (`!*`) requires that it must + # not. + # @param validate_only [::Boolean] + # If "validate_only" is set to true, the service will try to validate + # that this request would succeed, but will not actually make changes. + # @param request_id [::String] + # An optional request ID to identify requests. Specify a unique request ID + # so that if you must retry your request, the server will know to ignore + # the request if it has already been completed. The server will guarantee + # that for at least 60 minutes since the first request. + # + # For example, consider a situation where you make an initial request and the + # request times out. If you make the request again with the same request + # ID, the server can check if original operation with the same request ID + # was received, and if so, will ignore the second request. This prevents + # clients from accidentally creating duplicate commitments. + # + # The request ID must be a valid UUID with the exception that zero UUID is + # not supported (00000000-0000-0000-0000-000000000000). + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Google::Protobuf::Empty] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Google::Protobuf::Empty] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/saas_platform/saas_service_mgmt/v1beta1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::SaasDeployments::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::DeleteUnitRequest.new + # + # # Call the delete_unit method. + # result = client.delete_unit request + # + # # The returned object is of type Google::Protobuf::Empty. + # p result + # + def delete_unit request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::DeleteUnitRequest + + # Converts hash 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_unit.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::SaasPlatform::SaasServiceMgmt::V1beta1::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_unit.timeout, + metadata: metadata, + retry_policy: @config.rpcs.delete_unit.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @saas_deployments_stub.call_rpc :delete_unit, 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 + + ## + # Retrieve a collection of unit operations. + # + # @overload list_unit_operations(request, options = nil) + # Pass arguments to `list_unit_operations` via a request object, either of type + # {::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::ListUnitOperationsRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::ListUnitOperationsRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_unit_operations(parent: nil, page_size: nil, page_token: nil, filter: nil, order_by: nil) + # Pass arguments to `list_unit_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 parent [::String] + # Required. The parent of the unit operation. + # @param page_size [::Integer] + # The maximum number of unit operations to send per page. + # @param page_token [::String] + # The page token: If the next_page_token from a previous response + # is provided, this request will send the subsequent page. + # @param filter [::String] + # Filter the list as specified in https://google.aip.dev/160. + # @param order_by [::String] + # Order results as specified in https://google.aip.dev/132. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Gapic::PagedEnumerable<::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::UnitOperation>] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Gapic::PagedEnumerable<::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::UnitOperation>] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/saas_platform/saas_service_mgmt/v1beta1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::SaasDeployments::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::ListUnitOperationsRequest.new + # + # # Call the list_unit_operations method. + # result = client.list_unit_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::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::UnitOperation. + # p item + # end + # + def list_unit_operations request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::ListUnitOperationsRequest + + # Converts hash 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_unit_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::SaasPlatform::SaasServiceMgmt::V1beta1::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_unit_operations.timeout, + metadata: metadata, + retry_policy: @config.rpcs.list_unit_operations.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @saas_deployments_stub.call_rpc :list_unit_operations, request, options: options do |response, operation| + response = ::Gapic::PagedEnumerable.new @saas_deployments_stub, :list_unit_operations, 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 + + ## + # Retrieve a single unit operation. + # + # @overload get_unit_operation(request, options = nil) + # Pass arguments to `get_unit_operation` via a request object, either of type + # {::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::GetUnitOperationRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::GetUnitOperationRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_unit_operation(name: nil) + # Pass arguments to `get_unit_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] + # Required. The resource name of the resource within a service. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::UnitOperation] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::UnitOperation] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/saas_platform/saas_service_mgmt/v1beta1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::SaasDeployments::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::GetUnitOperationRequest.new + # + # # Call the get_unit_operation method. + # result = client.get_unit_operation request + # + # # The returned object is of type Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::UnitOperation. + # p result + # + def get_unit_operation request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::GetUnitOperationRequest + + # Converts hash 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_unit_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::SaasPlatform::SaasServiceMgmt::V1beta1::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_unit_operation.timeout, + metadata: metadata, + retry_policy: @config.rpcs.get_unit_operation.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @saas_deployments_stub.call_rpc :get_unit_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 + + ## + # Create a new unit operation. + # + # @overload create_unit_operation(request, options = nil) + # Pass arguments to `create_unit_operation` via a request object, either of type + # {::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::CreateUnitOperationRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::CreateUnitOperationRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_unit_operation(parent: nil, unit_operation_id: nil, unit_operation: nil, validate_only: nil, request_id: nil) + # Pass arguments to `create_unit_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 parent [::String] + # Required. The parent of the unit operation. + # @param unit_operation_id [::String] + # Required. The ID value for the new unit operation. + # @param unit_operation [::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::UnitOperation, ::Hash] + # Required. The desired state for the unit operation. + # @param validate_only [::Boolean] + # If "validate_only" is set to true, the service will try to validate + # that this request would succeed, but will not actually make changes. + # @param request_id [::String] + # An optional request ID to identify requests. Specify a unique request ID + # so that if you must retry your request, the server will know to ignore + # the request if it has already been completed. The server will guarantee + # that for at least 60 minutes since the first request. + # + # For example, consider a situation where you make an initial request and the + # request times out. If you make the request again with the same request + # ID, the server can check if original operation with the same request ID + # was received, and if so, will ignore the second request. This prevents + # clients from accidentally creating duplicate commitments. + # + # The request ID must be a valid UUID with the exception that zero UUID is + # not supported (00000000-0000-0000-0000-000000000000). + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::UnitOperation] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::UnitOperation] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/saas_platform/saas_service_mgmt/v1beta1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::SaasDeployments::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::CreateUnitOperationRequest.new + # + # # Call the create_unit_operation method. + # result = client.create_unit_operation request + # + # # The returned object is of type Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::UnitOperation. + # p result + # + def create_unit_operation request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::CreateUnitOperationRequest + + # Converts hash 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_unit_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::SaasPlatform::SaasServiceMgmt::V1beta1::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_unit_operation.timeout, + metadata: metadata, + retry_policy: @config.rpcs.create_unit_operation.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @saas_deployments_stub.call_rpc :create_unit_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 + + ## + # Update a single unit operation. + # + # @overload update_unit_operation(request, options = nil) + # Pass arguments to `update_unit_operation` via a request object, either of type + # {::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::UpdateUnitOperationRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::UpdateUnitOperationRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_unit_operation(unit_operation: nil, validate_only: nil, request_id: nil, update_mask: nil) + # Pass arguments to `update_unit_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 unit_operation [::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::UnitOperation, ::Hash] + # Required. The desired state for the unit operation. + # @param validate_only [::Boolean] + # If "validate_only" is set to true, the service will try to validate + # that this request would succeed, but will not actually make changes. + # @param request_id [::String] + # An optional request ID to identify requests. Specify a unique request ID + # so that if you must retry your request, the server will know to ignore + # the request if it has already been completed. The server will guarantee + # that for at least 60 minutes since the first request. + # + # For example, consider a situation where you make an initial request and the + # request times out. If you make the request again with the same request + # ID, the server can check if original operation with the same request ID + # was received, and if so, will ignore the second request. This prevents + # clients from accidentally creating duplicate commitments. + # + # The request ID must be a valid UUID with the exception that zero UUID is + # not supported (00000000-0000-0000-0000-000000000000). + # @param update_mask [::Google::Protobuf::FieldMask, ::Hash] + # Field mask is used to specify the fields to be overwritten in the + # UnitOperation resource by the update. + # + # The fields specified in the update_mask are relative to the resource, not + # the full request. A field will be overwritten if it is in the mask. + # + # If the user does not provide a mask then all fields in the + # UnitOperation will be overwritten. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::UnitOperation] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::UnitOperation] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/saas_platform/saas_service_mgmt/v1beta1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::SaasDeployments::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::UpdateUnitOperationRequest.new + # + # # Call the update_unit_operation method. + # result = client.update_unit_operation request + # + # # The returned object is of type Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::UnitOperation. + # p result + # + def update_unit_operation request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::UpdateUnitOperationRequest + + # Converts hash 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_unit_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::SaasPlatform::SaasServiceMgmt::V1beta1::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.unit_operation&.name + header_params["unit_operation.name"] = request.unit_operation.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_unit_operation.timeout, + metadata: metadata, + retry_policy: @config.rpcs.update_unit_operation.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @saas_deployments_stub.call_rpc :update_unit_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 + + ## + # Delete a single unit operation. + # + # @overload delete_unit_operation(request, options = nil) + # Pass arguments to `delete_unit_operation` via a request object, either of type + # {::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::DeleteUnitOperationRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::DeleteUnitOperationRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_unit_operation(name: nil, etag: nil, validate_only: nil, request_id: nil) + # Pass arguments to `delete_unit_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] + # Required. The resource name of the resource within a service. + # @param etag [::String] + # The etag known to the client for the expected state of the unit operation. + # This is used with state-changing methods to prevent accidental overwrites + # when multiple user agents might be acting in parallel on the same resource. + # + # An etag wildcard provide optimistic concurrency based on the expected + # existence of the unit operation. The Any wildcard (`*`) requires that the + # resource must already exists, and the Not Any wildcard (`!*`) requires that + # it must not. + # @param validate_only [::Boolean] + # If "validate_only" is set to true, the service will try to validate + # that this request would succeed, but will not actually make changes. + # @param request_id [::String] + # An optional request ID to identify requests. Specify a unique request ID + # so that if you must retry your request, the server will know to ignore + # the request if it has already been completed. The server will guarantee + # that for at least 60 minutes since the first request. + # + # For example, consider a situation where you make an initial request and the + # request times out. If you make the request again with the same request + # ID, the server can check if original operation with the same request ID + # was received, and if so, will ignore the second request. This prevents + # clients from accidentally creating duplicate commitments. + # + # The request ID must be a valid UUID with the exception that zero UUID is + # not supported (00000000-0000-0000-0000-000000000000). + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Google::Protobuf::Empty] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Google::Protobuf::Empty] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/saas_platform/saas_service_mgmt/v1beta1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::SaasDeployments::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::DeleteUnitOperationRequest.new + # + # # Call the delete_unit_operation method. + # result = client.delete_unit_operation request + # + # # The returned object is of type Google::Protobuf::Empty. + # p result + # + def delete_unit_operation request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::DeleteUnitOperationRequest + + # Converts hash 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_unit_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::SaasPlatform::SaasServiceMgmt::V1beta1::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_unit_operation.timeout, + metadata: metadata, + retry_policy: @config.rpcs.delete_unit_operation.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @saas_deployments_stub.call_rpc :delete_unit_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 + + ## + # Retrieve a collection of releases. + # + # @overload list_releases(request, options = nil) + # Pass arguments to `list_releases` via a request object, either of type + # {::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::ListReleasesRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::ListReleasesRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_releases(parent: nil, page_size: nil, page_token: nil, filter: nil, order_by: nil) + # Pass arguments to `list_releases` via keyword arguments. Note that at + # least one keyword argument is 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 of the release. + # @param page_size [::Integer] + # The maximum number of releases to send per page. + # @param page_token [::String] + # The page token: If the next_page_token from a previous response + # is provided, this request will send the subsequent page. + # @param filter [::String] + # Filter the list as specified in https://google.aip.dev/160. + # @param order_by [::String] + # Order results as specified in https://google.aip.dev/132. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Gapic::PagedEnumerable<::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::Release>] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Gapic::PagedEnumerable<::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::Release>] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/saas_platform/saas_service_mgmt/v1beta1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::SaasDeployments::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::ListReleasesRequest.new + # + # # Call the list_releases method. + # result = client.list_releases request + # + # # The returned object is of type Gapic::PagedEnumerable. You can iterate + # # over elements, and API calls will be issued to fetch pages as needed. + # result.each do |item| + # # Each element is of type ::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::Release. + # p item + # end + # + def list_releases request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::ListReleasesRequest + + # Converts hash 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_releases.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::SaasPlatform::SaasServiceMgmt::V1beta1::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_releases.timeout, + metadata: metadata, + retry_policy: @config.rpcs.list_releases.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @saas_deployments_stub.call_rpc :list_releases, request, options: options do |response, operation| + response = ::Gapic::PagedEnumerable.new @saas_deployments_stub, :list_releases, 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 + + ## + # Retrieve a single release. + # + # @overload get_release(request, options = nil) + # Pass arguments to `get_release` via a request object, either of type + # {::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::GetReleaseRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::GetReleaseRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_release(name: nil) + # Pass arguments to `get_release` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param name [::String] + # Required. The resource name of the resource within a service. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::Release] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::Release] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/saas_platform/saas_service_mgmt/v1beta1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::SaasDeployments::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::GetReleaseRequest.new + # + # # Call the get_release method. + # result = client.get_release request + # + # # The returned object is of type Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::Release. + # p result + # + def get_release request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::GetReleaseRequest + + # Converts hash 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_release.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::SaasPlatform::SaasServiceMgmt::V1beta1::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_release.timeout, + metadata: metadata, + retry_policy: @config.rpcs.get_release.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @saas_deployments_stub.call_rpc :get_release, 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 + + ## + # Create a new release. + # + # @overload create_release(request, options = nil) + # Pass arguments to `create_release` via a request object, either of type + # {::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::CreateReleaseRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::CreateReleaseRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_release(parent: nil, release_id: nil, release: nil, validate_only: nil, request_id: nil) + # Pass arguments to `create_release` via keyword arguments. Note that at + # least one keyword argument is 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 of the release. + # @param release_id [::String] + # Required. The ID value for the new release. + # @param release [::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::Release, ::Hash] + # Required. The desired state for the release. + # @param validate_only [::Boolean] + # If "validate_only" is set to true, the service will try to validate + # that this request would succeed, but will not actually make changes. + # @param request_id [::String] + # An optional request ID to identify requests. Specify a unique request ID + # so that if you must retry your request, the server will know to ignore + # the request if it has already been completed. The server will guarantee + # that for at least 60 minutes since the first request. + # + # For example, consider a situation where you make an initial request and the + # request times out. If you make the request again with the same request + # ID, the server can check if original operation with the same request ID + # was received, and if so, will ignore the second request. This prevents + # clients from accidentally creating duplicate commitments. + # + # The request ID must be a valid UUID with the exception that zero UUID is + # not supported (00000000-0000-0000-0000-000000000000). + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::Release] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::Release] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/saas_platform/saas_service_mgmt/v1beta1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::SaasDeployments::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::CreateReleaseRequest.new + # + # # Call the create_release method. + # result = client.create_release request + # + # # The returned object is of type Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::Release. + # p result + # + def create_release request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::CreateReleaseRequest + + # Converts hash 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_release.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::SaasPlatform::SaasServiceMgmt::V1beta1::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_release.timeout, + metadata: metadata, + retry_policy: @config.rpcs.create_release.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @saas_deployments_stub.call_rpc :create_release, 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 + + ## + # Update a single release. + # + # @overload update_release(request, options = nil) + # Pass arguments to `update_release` via a request object, either of type + # {::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::UpdateReleaseRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::UpdateReleaseRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_release(release: nil, validate_only: nil, request_id: nil, update_mask: nil) + # Pass arguments to `update_release` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param release [::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::Release, ::Hash] + # Required. The desired state for the release. + # @param validate_only [::Boolean] + # If "validate_only" is set to true, the service will try to validate + # that this request would succeed, but will not actually make changes. + # @param request_id [::String] + # An optional request ID to identify requests. Specify a unique request ID + # so that if you must retry your request, the server will know to ignore + # the request if it has already been completed. The server will guarantee + # that for at least 60 minutes since the first request. + # + # For example, consider a situation where you make an initial request and the + # request times out. If you make the request again with the same request + # ID, the server can check if original operation with the same request ID + # was received, and if so, will ignore the second request. This prevents + # clients from accidentally creating duplicate commitments. + # + # The request ID must be a valid UUID with the exception that zero UUID is + # not supported (00000000-0000-0000-0000-000000000000). + # @param update_mask [::Google::Protobuf::FieldMask, ::Hash] + # Field mask is used to specify the fields to be overwritten in the + # Release resource by the update. + # + # The fields specified in the update_mask are relative to the resource, not + # the full request. A field will be overwritten if it is in the mask. + # + # If the user does not provide a mask then all fields in the + # Release will be overwritten. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::Release] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::Release] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/saas_platform/saas_service_mgmt/v1beta1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::SaasDeployments::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::UpdateReleaseRequest.new + # + # # Call the update_release method. + # result = client.update_release request + # + # # The returned object is of type Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::Release. + # p result + # + def update_release request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::UpdateReleaseRequest + + # Converts hash 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_release.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::SaasPlatform::SaasServiceMgmt::V1beta1::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.release&.name + header_params["release.name"] = request.release.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_release.timeout, + metadata: metadata, + retry_policy: @config.rpcs.update_release.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @saas_deployments_stub.call_rpc :update_release, 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 + + ## + # Delete a single release. + # + # @overload delete_release(request, options = nil) + # Pass arguments to `delete_release` via a request object, either of type + # {::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::DeleteReleaseRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::DeleteReleaseRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_release(name: nil, etag: nil, validate_only: nil, request_id: nil) + # Pass arguments to `delete_release` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param name [::String] + # Required. The resource name of the resource within a service. + # @param etag [::String] + # The etag known to the client for the expected state of the release. This is + # used with state-changing methods to prevent accidental overwrites when + # multiple user agents might be acting in parallel on the same resource. + # + # An etag wildcard provide optimistic concurrency based on the expected + # existence of the release. The Any wildcard (`*`) requires that the resource + # must already exists, and the Not Any wildcard (`!*`) requires that it must + # not. + # @param validate_only [::Boolean] + # If "validate_only" is set to true, the service will try to validate + # that this request would succeed, but will not actually make changes. + # @param request_id [::String] + # An optional request ID to identify requests. Specify a unique request ID + # so that if you must retry your request, the server will know to ignore + # the request if it has already been completed. The server will guarantee + # that for at least 60 minutes since the first request. + # + # For example, consider a situation where you make an initial request and the + # request times out. If you make the request again with the same request + # ID, the server can check if original operation with the same request ID + # was received, and if so, will ignore the second request. This prevents + # clients from accidentally creating duplicate commitments. + # + # The request ID must be a valid UUID with the exception that zero UUID is + # not supported (00000000-0000-0000-0000-000000000000). + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Google::Protobuf::Empty] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Google::Protobuf::Empty] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/saas_platform/saas_service_mgmt/v1beta1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::SaasDeployments::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::DeleteReleaseRequest.new + # + # # Call the delete_release method. + # result = client.delete_release request + # + # # The returned object is of type Google::Protobuf::Empty. + # p result + # + def delete_release request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::DeleteReleaseRequest + + # Converts hash 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_release.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::SaasPlatform::SaasServiceMgmt::V1beta1::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_release.timeout, + metadata: metadata, + retry_policy: @config.rpcs.delete_release.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @saas_deployments_stub.call_rpc :delete_release, request, options: options do |response, operation| + yield response, operation if block_given? + end + rescue ::GRPC::BadStatus => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Configuration class for the SaasDeployments API. + # + # This class represents the configuration for SaasDeployments, + # providing control over timeouts, retry behavior, logging, transport + # parameters, and other low-level controls. Certain parameters can also be + # applied individually to specific RPCs. See + # {::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::SaasDeployments::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_saas to 20 seconds, + # # and all remaining timeouts to 10 seconds. + # ::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::SaasDeployments::Client.configure do |config| + # config.timeout = 10.0 + # config.rpcs.list_saas.timeout = 20.0 + # end + # + # # Apply the above configuration only to a new client. + # client = ::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::SaasDeployments::Client.new do |config| + # config.timeout = 10.0 + # config.rpcs.list_saas.timeout = 20.0 + # end + # + # @!attribute [rw] endpoint + # A custom service endpoint, as a hostname or hostname:port. The default is + # nil, indicating to use the default endpoint in the current universe domain. + # @return [::String,nil] + # @!attribute [rw] credentials + # Credentials to send with calls. You may provide any of the following types: + # * (`Google::Auth::Credentials`) A googleauth credentials object + # (see the [googleauth docs](https://rubydoc.info/gems/googleauth/Google/Auth/Credentials)) + # * (`Signet::OAuth2::Client`) A signet oauth2 client object + # (see the [signet docs](https://rubydoc.info/gems/signet/Signet/OAuth2/Client)) + # * (`GRPC::Core::Channel`) a gRPC channel with included credentials + # * (`GRPC::Core::ChannelCredentials`) a gRPC credentails object + # * (`nil`) indicating no credentials + # + # @note Warning: Passing a `String` to a keyfile path or a `Hash` of credentials + # is deprecated. Providing an unvalidated credential configuration to + # Google APIs can compromise the security of your systems and data. + # + # @example + # + # # The recommended way to provide credentials is to use the `make_creds` method + # # on the appropriate credentials class for your environment. + # + # require "googleauth" + # + # credentials = ::Google::Auth::ServiceAccountCredentials.make_creds( + # json_key_io: ::File.open("/path/to/keyfile.json") + # ) + # + # client = ::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::SaasDeployments::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 = "saasservicemgmt.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 SaasDeployments 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_saas` + # @return [::Gapic::Config::Method] + # + attr_reader :list_saas + ## + # RPC-specific configuration for `get_saas` + # @return [::Gapic::Config::Method] + # + attr_reader :get_saas + ## + # RPC-specific configuration for `create_saas` + # @return [::Gapic::Config::Method] + # + attr_reader :create_saas + ## + # RPC-specific configuration for `update_saas` + # @return [::Gapic::Config::Method] + # + attr_reader :update_saas + ## + # RPC-specific configuration for `delete_saas` + # @return [::Gapic::Config::Method] + # + attr_reader :delete_saas + ## + # RPC-specific configuration for `list_tenants` + # @return [::Gapic::Config::Method] + # + attr_reader :list_tenants + ## + # RPC-specific configuration for `get_tenant` + # @return [::Gapic::Config::Method] + # + attr_reader :get_tenant + ## + # RPC-specific configuration for `create_tenant` + # @return [::Gapic::Config::Method] + # + attr_reader :create_tenant + ## + # RPC-specific configuration for `update_tenant` + # @return [::Gapic::Config::Method] + # + attr_reader :update_tenant + ## + # RPC-specific configuration for `delete_tenant` + # @return [::Gapic::Config::Method] + # + attr_reader :delete_tenant + ## + # RPC-specific configuration for `list_unit_kinds` + # @return [::Gapic::Config::Method] + # + attr_reader :list_unit_kinds + ## + # RPC-specific configuration for `get_unit_kind` + # @return [::Gapic::Config::Method] + # + attr_reader :get_unit_kind + ## + # RPC-specific configuration for `create_unit_kind` + # @return [::Gapic::Config::Method] + # + attr_reader :create_unit_kind + ## + # RPC-specific configuration for `update_unit_kind` + # @return [::Gapic::Config::Method] + # + attr_reader :update_unit_kind + ## + # RPC-specific configuration for `delete_unit_kind` + # @return [::Gapic::Config::Method] + # + attr_reader :delete_unit_kind + ## + # RPC-specific configuration for `list_units` + # @return [::Gapic::Config::Method] + # + attr_reader :list_units + ## + # RPC-specific configuration for `get_unit` + # @return [::Gapic::Config::Method] + # + attr_reader :get_unit + ## + # RPC-specific configuration for `create_unit` + # @return [::Gapic::Config::Method] + # + attr_reader :create_unit + ## + # RPC-specific configuration for `update_unit` + # @return [::Gapic::Config::Method] + # + attr_reader :update_unit + ## + # RPC-specific configuration for `delete_unit` + # @return [::Gapic::Config::Method] + # + attr_reader :delete_unit + ## + # RPC-specific configuration for `list_unit_operations` + # @return [::Gapic::Config::Method] + # + attr_reader :list_unit_operations + ## + # RPC-specific configuration for `get_unit_operation` + # @return [::Gapic::Config::Method] + # + attr_reader :get_unit_operation + ## + # RPC-specific configuration for `create_unit_operation` + # @return [::Gapic::Config::Method] + # + attr_reader :create_unit_operation + ## + # RPC-specific configuration for `update_unit_operation` + # @return [::Gapic::Config::Method] + # + attr_reader :update_unit_operation + ## + # RPC-specific configuration for `delete_unit_operation` + # @return [::Gapic::Config::Method] + # + attr_reader :delete_unit_operation + ## + # RPC-specific configuration for `list_releases` + # @return [::Gapic::Config::Method] + # + attr_reader :list_releases + ## + # RPC-specific configuration for `get_release` + # @return [::Gapic::Config::Method] + # + attr_reader :get_release + ## + # RPC-specific configuration for `create_release` + # @return [::Gapic::Config::Method] + # + attr_reader :create_release + ## + # RPC-specific configuration for `update_release` + # @return [::Gapic::Config::Method] + # + attr_reader :update_release + ## + # RPC-specific configuration for `delete_release` + # @return [::Gapic::Config::Method] + # + attr_reader :delete_release + + # @private + def initialize parent_rpcs = nil + list_saas_config = parent_rpcs.list_saas if parent_rpcs.respond_to? :list_saas + @list_saas = ::Gapic::Config::Method.new list_saas_config + get_saas_config = parent_rpcs.get_saas if parent_rpcs.respond_to? :get_saas + @get_saas = ::Gapic::Config::Method.new get_saas_config + create_saas_config = parent_rpcs.create_saas if parent_rpcs.respond_to? :create_saas + @create_saas = ::Gapic::Config::Method.new create_saas_config + update_saas_config = parent_rpcs.update_saas if parent_rpcs.respond_to? :update_saas + @update_saas = ::Gapic::Config::Method.new update_saas_config + delete_saas_config = parent_rpcs.delete_saas if parent_rpcs.respond_to? :delete_saas + @delete_saas = ::Gapic::Config::Method.new delete_saas_config + list_tenants_config = parent_rpcs.list_tenants if parent_rpcs.respond_to? :list_tenants + @list_tenants = ::Gapic::Config::Method.new list_tenants_config + get_tenant_config = parent_rpcs.get_tenant if parent_rpcs.respond_to? :get_tenant + @get_tenant = ::Gapic::Config::Method.new get_tenant_config + create_tenant_config = parent_rpcs.create_tenant if parent_rpcs.respond_to? :create_tenant + @create_tenant = ::Gapic::Config::Method.new create_tenant_config + update_tenant_config = parent_rpcs.update_tenant if parent_rpcs.respond_to? :update_tenant + @update_tenant = ::Gapic::Config::Method.new update_tenant_config + delete_tenant_config = parent_rpcs.delete_tenant if parent_rpcs.respond_to? :delete_tenant + @delete_tenant = ::Gapic::Config::Method.new delete_tenant_config + list_unit_kinds_config = parent_rpcs.list_unit_kinds if parent_rpcs.respond_to? :list_unit_kinds + @list_unit_kinds = ::Gapic::Config::Method.new list_unit_kinds_config + get_unit_kind_config = parent_rpcs.get_unit_kind if parent_rpcs.respond_to? :get_unit_kind + @get_unit_kind = ::Gapic::Config::Method.new get_unit_kind_config + create_unit_kind_config = parent_rpcs.create_unit_kind if parent_rpcs.respond_to? :create_unit_kind + @create_unit_kind = ::Gapic::Config::Method.new create_unit_kind_config + update_unit_kind_config = parent_rpcs.update_unit_kind if parent_rpcs.respond_to? :update_unit_kind + @update_unit_kind = ::Gapic::Config::Method.new update_unit_kind_config + delete_unit_kind_config = parent_rpcs.delete_unit_kind if parent_rpcs.respond_to? :delete_unit_kind + @delete_unit_kind = ::Gapic::Config::Method.new delete_unit_kind_config + list_units_config = parent_rpcs.list_units if parent_rpcs.respond_to? :list_units + @list_units = ::Gapic::Config::Method.new list_units_config + get_unit_config = parent_rpcs.get_unit if parent_rpcs.respond_to? :get_unit + @get_unit = ::Gapic::Config::Method.new get_unit_config + create_unit_config = parent_rpcs.create_unit if parent_rpcs.respond_to? :create_unit + @create_unit = ::Gapic::Config::Method.new create_unit_config + update_unit_config = parent_rpcs.update_unit if parent_rpcs.respond_to? :update_unit + @update_unit = ::Gapic::Config::Method.new update_unit_config + delete_unit_config = parent_rpcs.delete_unit if parent_rpcs.respond_to? :delete_unit + @delete_unit = ::Gapic::Config::Method.new delete_unit_config + list_unit_operations_config = parent_rpcs.list_unit_operations if parent_rpcs.respond_to? :list_unit_operations + @list_unit_operations = ::Gapic::Config::Method.new list_unit_operations_config + get_unit_operation_config = parent_rpcs.get_unit_operation if parent_rpcs.respond_to? :get_unit_operation + @get_unit_operation = ::Gapic::Config::Method.new get_unit_operation_config + create_unit_operation_config = parent_rpcs.create_unit_operation if parent_rpcs.respond_to? :create_unit_operation + @create_unit_operation = ::Gapic::Config::Method.new create_unit_operation_config + update_unit_operation_config = parent_rpcs.update_unit_operation if parent_rpcs.respond_to? :update_unit_operation + @update_unit_operation = ::Gapic::Config::Method.new update_unit_operation_config + delete_unit_operation_config = parent_rpcs.delete_unit_operation if parent_rpcs.respond_to? :delete_unit_operation + @delete_unit_operation = ::Gapic::Config::Method.new delete_unit_operation_config + list_releases_config = parent_rpcs.list_releases if parent_rpcs.respond_to? :list_releases + @list_releases = ::Gapic::Config::Method.new list_releases_config + get_release_config = parent_rpcs.get_release if parent_rpcs.respond_to? :get_release + @get_release = ::Gapic::Config::Method.new get_release_config + create_release_config = parent_rpcs.create_release if parent_rpcs.respond_to? :create_release + @create_release = ::Gapic::Config::Method.new create_release_config + update_release_config = parent_rpcs.update_release if parent_rpcs.respond_to? :update_release + @update_release = ::Gapic::Config::Method.new update_release_config + delete_release_config = parent_rpcs.delete_release if parent_rpcs.respond_to? :delete_release + @delete_release = ::Gapic::Config::Method.new delete_release_config + + yield self if block_given? + end + end + end + end + end + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-saas_platform-saas_service_mgmt-v1beta1/lib/google/cloud/saas_platform/saas_service_mgmt/v1beta1/saas_deployments/credentials.rb b/owl-bot-staging/google-cloud-saas_platform-saas_service_mgmt-v1beta1/lib/google/cloud/saas_platform/saas_service_mgmt/v1beta1/saas_deployments/credentials.rb new file mode 100644 index 000000000000..2d24511b8897 --- /dev/null +++ b/owl-bot-staging/google-cloud-saas_platform-saas_service_mgmt-v1beta1/lib/google/cloud/saas_platform/saas_service_mgmt/v1beta1/saas_deployments/credentials.rb @@ -0,0 +1,49 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +require "googleauth" + +module Google + module Cloud + module SaasPlatform + module SaasServiceMgmt + module V1beta1 + module SaasDeployments + # Credentials for the SaasDeployments API. + class Credentials < ::Google::Auth::Credentials + self.scope = [ + "https://www.googleapis.com/auth/cloud-platform" + ] + self.env_vars = [ + "GOOGLE_CLOUD_CREDENTIALS", + "GOOGLE_CLOUD_KEYFILE", + "GCLOUD_KEYFILE", + "GOOGLE_CLOUD_CREDENTIALS_JSON", + "GOOGLE_CLOUD_KEYFILE_JSON", + "GCLOUD_KEYFILE_JSON" + ] + self.paths = [ + "~/.config/google_cloud/application_default_credentials.json" + ] + end + end + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-saas_platform-saas_service_mgmt-v1beta1/lib/google/cloud/saas_platform/saas_service_mgmt/v1beta1/saas_deployments/paths.rb b/owl-bot-staging/google-cloud-saas_platform-saas_service_mgmt-v1beta1/lib/google/cloud/saas_platform/saas_service_mgmt/v1beta1/saas_deployments/paths.rb new file mode 100644 index 000000000000..6d3457f8559d --- /dev/null +++ b/owl-bot-staging/google-cloud-saas_platform-saas_service_mgmt-v1beta1/lib/google/cloud/saas_platform/saas_service_mgmt/v1beta1/saas_deployments/paths.rb @@ -0,0 +1,185 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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 SaasPlatform + module SaasServiceMgmt + module V1beta1 + module SaasDeployments + # Path helper methods for the SaasDeployments API. + module Paths + ## + # Create a fully-qualified Location resource string. + # + # The resource will be in the following format: + # + # `projects/{project}/locations/{location}` + # + # @param project [String] + # @param location [String] + # + # @return [::String] + def location_path project:, location: + raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" + + "projects/#{project}/locations/#{location}" + end + + ## + # Create a fully-qualified Release resource string. + # + # The resource will be in the following format: + # + # `projects/{project}/locations/{location}/releases/{release}` + # + # @param project [String] + # @param location [String] + # @param release [String] + # + # @return [::String] + def release_path project:, location:, release: + raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" + raise ::ArgumentError, "location cannot contain /" if location.to_s.include? "/" + + "projects/#{project}/locations/#{location}/releases/#{release}" + end + + ## + # Create a fully-qualified Rollout resource string. + # + # The resource will be in the following format: + # + # `projects/{project}/locations/{location}/rollouts/{rollout_id}` + # + # @param project [String] + # @param location [String] + # @param rollout_id [String] + # + # @return [::String] + def rollout_path project:, location:, rollout_id: + raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" + raise ::ArgumentError, "location cannot contain /" if location.to_s.include? "/" + + "projects/#{project}/locations/#{location}/rollouts/#{rollout_id}" + end + + ## + # Create a fully-qualified Saas resource string. + # + # The resource will be in the following format: + # + # `projects/{project}/locations/{location}/saas/{saas}` + # + # @param project [String] + # @param location [String] + # @param saas [String] + # + # @return [::String] + def saas_path project:, location:, saas: + raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" + raise ::ArgumentError, "location cannot contain /" if location.to_s.include? "/" + + "projects/#{project}/locations/#{location}/saas/#{saas}" + end + + ## + # Create a fully-qualified Tenant resource string. + # + # The resource will be in the following format: + # + # `projects/{project}/locations/{location}/tenants/{tenant}` + # + # @param project [String] + # @param location [String] + # @param tenant [String] + # + # @return [::String] + def tenant_path project:, location:, tenant: + raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" + raise ::ArgumentError, "location cannot contain /" if location.to_s.include? "/" + + "projects/#{project}/locations/#{location}/tenants/#{tenant}" + end + + ## + # Create a fully-qualified Unit resource string. + # + # The resource will be in the following format: + # + # `projects/{project}/locations/{location}/units/{unit}` + # + # @param project [String] + # @param location [String] + # @param unit [String] + # + # @return [::String] + def unit_path project:, location:, unit: + raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" + raise ::ArgumentError, "location cannot contain /" if location.to_s.include? "/" + + "projects/#{project}/locations/#{location}/units/#{unit}" + end + + ## + # Create a fully-qualified UnitKind resource string. + # + # The resource will be in the following format: + # + # `projects/{project}/locations/{location}/unitKinds/{unit_kind}` + # + # @param project [String] + # @param location [String] + # @param unit_kind [String] + # + # @return [::String] + def unit_kind_path project:, location:, unit_kind: + raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" + raise ::ArgumentError, "location cannot contain /" if location.to_s.include? "/" + + "projects/#{project}/locations/#{location}/unitKinds/#{unit_kind}" + end + + ## + # Create a fully-qualified UnitOperation resource string. + # + # The resource will be in the following format: + # + # `projects/{project}/locations/{location}/unitOperations/{unit_operation}` + # + # @param project [String] + # @param location [String] + # @param unit_operation [String] + # + # @return [::String] + def unit_operation_path project:, location:, unit_operation: + raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" + raise ::ArgumentError, "location cannot contain /" if location.to_s.include? "/" + + "projects/#{project}/locations/#{location}/unitOperations/#{unit_operation}" + end + + extend self + end + end + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-saas_platform-saas_service_mgmt-v1beta1/lib/google/cloud/saas_platform/saas_service_mgmt/v1beta1/saas_deployments/rest.rb b/owl-bot-staging/google-cloud-saas_platform-saas_service_mgmt-v1beta1/lib/google/cloud/saas_platform/saas_service_mgmt/v1beta1/saas_deployments/rest.rb new file mode 100644 index 000000000000..d312932d45ac --- /dev/null +++ b/owl-bot-staging/google-cloud-saas_platform-saas_service_mgmt-v1beta1/lib/google/cloud/saas_platform/saas_service_mgmt/v1beta1/saas_deployments/rest.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/rest" +require "gapic/config" +require "gapic/config/method" + +require "google/cloud/saas_platform/saas_service_mgmt/v1beta1/version" +require "google/cloud/saas_platform/saas_service_mgmt/v1beta1/bindings_override" + +require "google/cloud/saas_platform/saas_service_mgmt/v1beta1/saas_deployments/credentials" +require "google/cloud/saas_platform/saas_service_mgmt/v1beta1/saas_deployments/paths" +require "google/cloud/saas_platform/saas_service_mgmt/v1beta1/saas_deployments/rest/client" + +module Google + module Cloud + module SaasPlatform + module SaasServiceMgmt + module V1beta1 + ## + # Manages the deployment of SaaS services. + # + # To load this service and instantiate a REST client: + # + # require "google/cloud/saas_platform/saas_service_mgmt/v1beta1/saas_deployments/rest" + # client = ::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::SaasDeployments::Rest::Client.new + # + module SaasDeployments + # Client for the REST transport + module Rest + end + end + end + end + end + end +end + +helper_path = ::File.join __dir__, "rest", "helpers.rb" +require "google/cloud/saas_platform/saas_service_mgmt/v1beta1/saas_deployments/rest/helpers" if ::File.file? helper_path diff --git a/owl-bot-staging/google-cloud-saas_platform-saas_service_mgmt-v1beta1/lib/google/cloud/saas_platform/saas_service_mgmt/v1beta1/saas_deployments/rest/client.rb b/owl-bot-staging/google-cloud-saas_platform-saas_service_mgmt-v1beta1/lib/google/cloud/saas_platform/saas_service_mgmt/v1beta1/saas_deployments/rest/client.rb new file mode 100644 index 000000000000..242da77bafad --- /dev/null +++ b/owl-bot-staging/google-cloud-saas_platform-saas_service_mgmt-v1beta1/lib/google/cloud/saas_platform/saas_service_mgmt/v1beta1/saas_deployments/rest/client.rb @@ -0,0 +1,3557 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +require "google/cloud/errors" +require "google/cloud/saasplatform/saasservicemgmt/v1beta1/deployments_service_pb" +require "google/cloud/saas_platform/saas_service_mgmt/v1beta1/saas_deployments/rest/service_stub" +require "google/cloud/location/rest" + +module Google + module Cloud + module SaasPlatform + module SaasServiceMgmt + module V1beta1 + module SaasDeployments + module Rest + ## + # REST client for the SaasDeployments service. + # + # Manages the deployment of SaaS services. + # + class Client + # @private + API_VERSION = "" + + # @private + DEFAULT_ENDPOINT_TEMPLATE = "saasservicemgmt.$UNIVERSE_DOMAIN$" + + include Paths + + # @private + attr_reader :saas_deployments_stub + + ## + # Configure the SaasDeployments Client class. + # + # See {::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::SaasDeployments::Rest::Client::Configuration} + # for a description of the configuration fields. + # + # @example + # + # # Modify the configuration for all SaasDeployments clients + # ::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::SaasDeployments::Rest::Client.configure do |config| + # config.timeout = 10.0 + # end + # + # @yield [config] Configure the Client client. + # @yieldparam config [Client::Configuration] + # + # @return [Client::Configuration] + # + def self.configure + @configure ||= begin + namespace = ["Google", "Cloud", "SaasPlatform", "SaasServiceMgmt", "V1beta1"] + parent_config = while namespace.any? + parent_name = namespace.join "::" + parent_const = const_get parent_name + break parent_const.configure if parent_const.respond_to? :configure + namespace.pop + end + default_config = Client::Configuration.new parent_config + + default_config.rpcs.list_saas.timeout = 80.0 + default_config.rpcs.list_saas.retry_policy = { + initial_delay: 1.0, max_delay: 10.0, multiplier: 1.3, retry_codes: [14] + } + + default_config.rpcs.get_saas.timeout = 30.0 + default_config.rpcs.get_saas.retry_policy = { + initial_delay: 1.0, max_delay: 10.0, multiplier: 1.3, retry_codes: [14] + } + + default_config.rpcs.create_saas.timeout = 30.0 + + default_config.rpcs.update_saas.timeout = 30.0 + + default_config.rpcs.delete_saas.timeout = 30.0 + default_config.rpcs.delete_saas.retry_policy = { + initial_delay: 1.0, max_delay: 10.0, multiplier: 1.3, retry_codes: [14] + } + + default_config.rpcs.list_tenants.timeout = 80.0 + default_config.rpcs.list_tenants.retry_policy = { + initial_delay: 1.0, max_delay: 10.0, multiplier: 1.3, retry_codes: [14] + } + + default_config.rpcs.get_tenant.timeout = 30.0 + default_config.rpcs.get_tenant.retry_policy = { + initial_delay: 1.0, max_delay: 10.0, multiplier: 1.3, retry_codes: [14] + } + + default_config.rpcs.create_tenant.timeout = 30.0 + + default_config.rpcs.update_tenant.timeout = 30.0 + + default_config.rpcs.delete_tenant.timeout = 30.0 + default_config.rpcs.delete_tenant.retry_policy = { + initial_delay: 1.0, max_delay: 10.0, multiplier: 1.3, retry_codes: [14] + } + + default_config.rpcs.list_unit_kinds.timeout = 80.0 + default_config.rpcs.list_unit_kinds.retry_policy = { + initial_delay: 1.0, max_delay: 10.0, multiplier: 1.3, retry_codes: [14] + } + + default_config.rpcs.get_unit_kind.timeout = 30.0 + default_config.rpcs.get_unit_kind.retry_policy = { + initial_delay: 1.0, max_delay: 10.0, multiplier: 1.3, retry_codes: [14] + } + + default_config.rpcs.create_unit_kind.timeout = 30.0 + + default_config.rpcs.update_unit_kind.timeout = 80.0 + + default_config.rpcs.delete_unit_kind.timeout = 80.0 + default_config.rpcs.delete_unit_kind.retry_policy = { + initial_delay: 1.0, max_delay: 10.0, multiplier: 1.3, retry_codes: [14] + } + + default_config.rpcs.list_units.timeout = 80.0 + default_config.rpcs.list_units.retry_policy = { + initial_delay: 1.0, max_delay: 10.0, multiplier: 1.3, retry_codes: [14] + } + + default_config.rpcs.get_unit.timeout = 30.0 + default_config.rpcs.get_unit.retry_policy = { + initial_delay: 1.0, max_delay: 10.0, multiplier: 1.3, retry_codes: [14] + } + + default_config.rpcs.create_unit.timeout = 30.0 + + default_config.rpcs.update_unit.timeout = 30.0 + + default_config.rpcs.delete_unit.timeout = 30.0 + default_config.rpcs.delete_unit.retry_policy = { + initial_delay: 1.0, max_delay: 10.0, multiplier: 1.3, retry_codes: [14] + } + + default_config.rpcs.list_unit_operations.timeout = 80.0 + default_config.rpcs.list_unit_operations.retry_policy = { + initial_delay: 1.0, max_delay: 10.0, multiplier: 1.3, retry_codes: [14] + } + + default_config.rpcs.get_unit_operation.timeout = 30.0 + default_config.rpcs.get_unit_operation.retry_policy = { + initial_delay: 1.0, max_delay: 10.0, multiplier: 1.3, retry_codes: [14] + } + + default_config.rpcs.create_unit_operation.timeout = 30.0 + + default_config.rpcs.update_unit_operation.timeout = 30.0 + + default_config.rpcs.delete_unit_operation.timeout = 30.0 + default_config.rpcs.delete_unit_operation.retry_policy = { + initial_delay: 1.0, max_delay: 10.0, multiplier: 1.3, retry_codes: [14] + } + + default_config.rpcs.list_releases.timeout = 80.0 + default_config.rpcs.list_releases.retry_policy = { + initial_delay: 1.0, max_delay: 10.0, multiplier: 1.3, retry_codes: [14] + } + + default_config.rpcs.get_release.timeout = 30.0 + default_config.rpcs.get_release.retry_policy = { + initial_delay: 1.0, max_delay: 10.0, multiplier: 1.3, retry_codes: [14] + } + + default_config.rpcs.create_release.timeout = 30.0 + + default_config.rpcs.update_release.timeout = 30.0 + + default_config.rpcs.delete_release.timeout = 30.0 + default_config.rpcs.delete_release.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 SaasDeployments Client instance. + # + # The configuration is set to the derived mode, meaning that values can be changed, + # but structural changes (adding new fields, etc.) are not allowed. Structural changes + # should be made on {Client.configure}. + # + # See {::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::SaasDeployments::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 + @saas_deployments_stub.universe_domain + end + + ## + # Create a new SaasDeployments REST client object. + # + # @example + # + # # Create a client using the default configuration + # client = ::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::SaasDeployments::Rest::Client.new + # + # # Create a client using a custom configuration + # client = ::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::SaasDeployments::Rest::Client.new do |config| + # config.timeout = 10.0 + # end + # + # @yield [config] Configure the SaasDeployments 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 + + @saas_deployments_stub = ::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::SaasDeployments::Rest::ServiceStub.new( + endpoint: @config.endpoint, + endpoint_template: DEFAULT_ENDPOINT_TEMPLATE, + universe_domain: @config.universe_domain, + credentials: credentials, + logger: @config.logger + ) + + @saas_deployments_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 = @saas_deployments_stub.endpoint + config.universe_domain = @saas_deployments_stub.universe_domain + config.bindings_override = @config.bindings_override + config.logger = @saas_deployments_stub.logger if config.respond_to? :logger= + end + end + + ## + # Get the associated client for mix-in of the Locations. + # + # @return [Google::Cloud::Location::Locations::Rest::Client] + # + attr_reader :location_client + + ## + # The logger used for request/response debug logging. + # + # @return [Logger] + # + def logger + @saas_deployments_stub.logger + end + + # Service calls + + ## + # Retrieve a collection of saas. + # + # @overload list_saas(request, options = nil) + # Pass arguments to `list_saas` via a request object, either of type + # {::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::ListSaasRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::ListSaasRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_saas(parent: nil, page_size: nil, page_token: nil, filter: nil, order_by: nil) + # Pass arguments to `list_saas` via keyword arguments. Note that at + # least one keyword argument is 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 of the saas. + # @param page_size [::Integer] + # The maximum number of saas to send per page. + # @param page_token [::String] + # The page token: If the next_page_token from a previous response + # is provided, this request will send the subsequent page. + # @param filter [::String] + # Filter the list as specified in https://google.aip.dev/160. + # @param order_by [::String] + # Order results as specified in https://google.aip.dev/132. + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Gapic::Rest::PagedEnumerable<::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::Saas>] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Gapic::Rest::PagedEnumerable<::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::Saas>] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/saas_platform/saas_service_mgmt/v1beta1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::SaasDeployments::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::ListSaasRequest.new + # + # # Call the list_saas method. + # result = client.list_saas request + # + # # The returned object is of type Gapic::PagedEnumerable. You can iterate + # # over elements, and API calls will be issued to fetch pages as needed. + # result.each do |item| + # # Each element is of type ::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::Saas. + # p item + # end + # + def list_saas request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::ListSaasRequest + + # Converts hash 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_saas.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::SaasPlatform::SaasServiceMgmt::V1beta1::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_saas.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.list_saas.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @saas_deployments_stub.list_saas request, options do |result, operation| + result = ::Gapic::Rest::PagedEnumerable.new @saas_deployments_stub, :list_saas, "saas", 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 + + ## + # Retrieve a single saas. + # + # @overload get_saas(request, options = nil) + # Pass arguments to `get_saas` via a request object, either of type + # {::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::GetSaasRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::GetSaasRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_saas(name: nil) + # Pass arguments to `get_saas` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param name [::String] + # Required. The resource name of the resource within a service. + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::Saas] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::Saas] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/saas_platform/saas_service_mgmt/v1beta1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::SaasDeployments::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::GetSaasRequest.new + # + # # Call the get_saas method. + # result = client.get_saas request + # + # # The returned object is of type Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::Saas. + # p result + # + def get_saas request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::GetSaasRequest + + # Converts hash 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_saas.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::SaasPlatform::SaasServiceMgmt::V1beta1::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_saas.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.get_saas.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @saas_deployments_stub.get_saas 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 + + ## + # Create a new saas. + # + # @overload create_saas(request, options = nil) + # Pass arguments to `create_saas` via a request object, either of type + # {::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::CreateSaasRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::CreateSaasRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_saas(parent: nil, saas_id: nil, saas: nil, validate_only: nil, request_id: nil) + # Pass arguments to `create_saas` via keyword arguments. Note that at + # least one keyword argument is 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 of the saas. + # @param saas_id [::String] + # Required. The ID value for the new saas. + # @param saas [::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::Saas, ::Hash] + # Required. The desired state for the saas. + # @param validate_only [::Boolean] + # If "validate_only" is set to true, the service will try to validate + # that this request would succeed, but will not actually make changes. + # @param request_id [::String] + # An optional request ID to identify requests. Specify a unique request ID + # so that if you must retry your request, the server will know to ignore + # the request if it has already been completed. The server will guarantee + # that for at least 60 minutes since the first request. + # + # For example, consider a situation where you make an initial request and the + # request times out. If you make the request again with the same request + # ID, the server can check if original operation with the same request ID + # was received, and if so, will ignore the second request. This prevents + # clients from accidentally creating duplicate commitments. + # + # The request ID must be a valid UUID with the exception that zero UUID is + # not supported (00000000-0000-0000-0000-000000000000). + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::Saas] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::Saas] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/saas_platform/saas_service_mgmt/v1beta1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::SaasDeployments::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::CreateSaasRequest.new + # + # # Call the create_saas method. + # result = client.create_saas request + # + # # The returned object is of type Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::Saas. + # p result + # + def create_saas request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::CreateSaasRequest + + # Converts hash 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_saas.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::SaasPlatform::SaasServiceMgmt::V1beta1::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_saas.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.create_saas.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @saas_deployments_stub.create_saas 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 + + ## + # Update a single saas. + # + # @overload update_saas(request, options = nil) + # Pass arguments to `update_saas` via a request object, either of type + # {::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::UpdateSaasRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::UpdateSaasRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_saas(saas: nil, validate_only: nil, request_id: nil, update_mask: nil) + # Pass arguments to `update_saas` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param saas [::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::Saas, ::Hash] + # Required. The desired state for the saas. + # @param validate_only [::Boolean] + # If "validate_only" is set to true, the service will try to validate + # that this request would succeed, but will not actually make changes. + # @param request_id [::String] + # An optional request ID to identify requests. Specify a unique request ID + # so that if you must retry your request, the server will know to ignore + # the request if it has already been completed. The server will guarantee + # that for at least 60 minutes since the first request. + # + # For example, consider a situation where you make an initial request and the + # request times out. If you make the request again with the same request + # ID, the server can check if original operation with the same request ID + # was received, and if so, will ignore the second request. This prevents + # clients from accidentally creating duplicate commitments. + # + # The request ID must be a valid UUID with the exception that zero UUID is + # not supported (00000000-0000-0000-0000-000000000000). + # @param update_mask [::Google::Protobuf::FieldMask, ::Hash] + # Field mask is used to specify the fields to be overwritten in the + # Saas resource by the update. + # + # The fields specified in the update_mask are relative to the resource, not + # the full request. A field will be overwritten if it is in the mask. + # + # If the user does not provide a mask then all fields in the + # Saas will be overwritten. + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::Saas] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::Saas] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/saas_platform/saas_service_mgmt/v1beta1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::SaasDeployments::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::UpdateSaasRequest.new + # + # # Call the update_saas method. + # result = client.update_saas request + # + # # The returned object is of type Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::Saas. + # p result + # + def update_saas request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::UpdateSaasRequest + + # Converts hash 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_saas.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::SaasPlatform::SaasServiceMgmt::V1beta1::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_saas.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.update_saas.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @saas_deployments_stub.update_saas 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 + + ## + # Delete a single saas. + # + # @overload delete_saas(request, options = nil) + # Pass arguments to `delete_saas` via a request object, either of type + # {::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::DeleteSaasRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::DeleteSaasRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_saas(name: nil, etag: nil, validate_only: nil, request_id: nil) + # Pass arguments to `delete_saas` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param name [::String] + # Required. The resource name of the resource within a service. + # @param etag [::String] + # The etag known to the client for the expected state of the saas. This is + # used with state-changing methods to prevent accidental overwrites when + # multiple user agents might be acting in parallel on the same resource. + # + # An etag wildcard provide optimistic concurrency based on the expected + # existence of the saas. The Any wildcard (`*`) requires that the resource + # must already exists, and the Not Any wildcard (`!*`) requires that it must + # not. + # @param validate_only [::Boolean] + # If "validate_only" is set to true, the service will try to validate + # that this request would succeed, but will not actually make changes. + # @param request_id [::String] + # An optional request ID to identify requests. Specify a unique request ID + # so that if you must retry your request, the server will know to ignore + # the request if it has already been completed. The server will guarantee + # that for at least 60 minutes since the first request. + # + # For example, consider a situation where you make an initial request and the + # request times out. If you make the request again with the same request + # ID, the server can check if original operation with the same request ID + # was received, and if so, will ignore the second request. This prevents + # clients from accidentally creating duplicate commitments. + # + # The request ID must be a valid UUID with the exception that zero UUID is + # not supported (00000000-0000-0000-0000-000000000000). + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Protobuf::Empty] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Protobuf::Empty] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/saas_platform/saas_service_mgmt/v1beta1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::SaasDeployments::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::DeleteSaasRequest.new + # + # # Call the delete_saas method. + # result = client.delete_saas request + # + # # The returned object is of type Google::Protobuf::Empty. + # p result + # + def delete_saas request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::DeleteSaasRequest + + # Converts hash 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_saas.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::SaasPlatform::SaasServiceMgmt::V1beta1::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_saas.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.delete_saas.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @saas_deployments_stub.delete_saas 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 + + ## + # Retrieve a collection of tenants. + # + # @overload list_tenants(request, options = nil) + # Pass arguments to `list_tenants` via a request object, either of type + # {::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::ListTenantsRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::ListTenantsRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_tenants(parent: nil, page_size: nil, page_token: nil, filter: nil, order_by: nil) + # Pass arguments to `list_tenants` via keyword arguments. Note that at + # least one keyword argument is 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 of the tenant. + # @param page_size [::Integer] + # The maximum number of tenants to send per page. + # @param page_token [::String] + # The page token: If the next_page_token from a previous response + # is provided, this request will send the subsequent page. + # @param filter [::String] + # Filter the list as specified in https://google.aip.dev/160. + # @param order_by [::String] + # Order results as specified in https://google.aip.dev/132. + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Gapic::Rest::PagedEnumerable<::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::Tenant>] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Gapic::Rest::PagedEnumerable<::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::Tenant>] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/saas_platform/saas_service_mgmt/v1beta1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::SaasDeployments::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::ListTenantsRequest.new + # + # # Call the list_tenants method. + # result = client.list_tenants request + # + # # The returned object is of type Gapic::PagedEnumerable. You can iterate + # # over elements, and API calls will be issued to fetch pages as needed. + # result.each do |item| + # # Each element is of type ::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::Tenant. + # p item + # end + # + def list_tenants request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::ListTenantsRequest + + # Converts hash 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_tenants.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::SaasPlatform::SaasServiceMgmt::V1beta1::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_tenants.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.list_tenants.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @saas_deployments_stub.list_tenants request, options do |result, operation| + result = ::Gapic::Rest::PagedEnumerable.new @saas_deployments_stub, :list_tenants, "tenants", 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 + + ## + # Retrieve a single tenant. + # + # @overload get_tenant(request, options = nil) + # Pass arguments to `get_tenant` via a request object, either of type + # {::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::GetTenantRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::GetTenantRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_tenant(name: nil) + # Pass arguments to `get_tenant` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param name [::String] + # Required. The resource name of the resource within a service. + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::Tenant] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::Tenant] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/saas_platform/saas_service_mgmt/v1beta1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::SaasDeployments::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::GetTenantRequest.new + # + # # Call the get_tenant method. + # result = client.get_tenant request + # + # # The returned object is of type Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::Tenant. + # p result + # + def get_tenant request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::GetTenantRequest + + # Converts hash 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_tenant.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::SaasPlatform::SaasServiceMgmt::V1beta1::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_tenant.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.get_tenant.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @saas_deployments_stub.get_tenant 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 + + ## + # Create a new tenant. + # + # @overload create_tenant(request, options = nil) + # Pass arguments to `create_tenant` via a request object, either of type + # {::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::CreateTenantRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::CreateTenantRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_tenant(parent: nil, tenant_id: nil, tenant: nil, validate_only: nil, request_id: nil) + # Pass arguments to `create_tenant` via keyword arguments. Note that at + # least one keyword argument is 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 of the tenant. + # @param tenant_id [::String] + # Required. The ID value for the new tenant. + # @param tenant [::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::Tenant, ::Hash] + # Required. The desired state for the tenant. + # @param validate_only [::Boolean] + # If "validate_only" is set to true, the service will try to validate + # that this request would succeed, but will not actually make changes. + # @param request_id [::String] + # An optional request ID to identify requests. Specify a unique request ID + # so that if you must retry your request, the server will know to ignore + # the request if it has already been completed. The server will guarantee + # that for at least 60 minutes since the first request. + # + # For example, consider a situation where you make an initial request and the + # request times out. If you make the request again with the same request + # ID, the server can check if original operation with the same request ID + # was received, and if so, will ignore the second request. This prevents + # clients from accidentally creating duplicate commitments. + # + # The request ID must be a valid UUID with the exception that zero UUID is + # not supported (00000000-0000-0000-0000-000000000000). + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::Tenant] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::Tenant] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/saas_platform/saas_service_mgmt/v1beta1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::SaasDeployments::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::CreateTenantRequest.new + # + # # Call the create_tenant method. + # result = client.create_tenant request + # + # # The returned object is of type Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::Tenant. + # p result + # + def create_tenant request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::CreateTenantRequest + + # Converts hash 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_tenant.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::SaasPlatform::SaasServiceMgmt::V1beta1::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_tenant.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.create_tenant.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @saas_deployments_stub.create_tenant 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 + + ## + # Update a single tenant. + # + # @overload update_tenant(request, options = nil) + # Pass arguments to `update_tenant` via a request object, either of type + # {::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::UpdateTenantRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::UpdateTenantRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_tenant(tenant: nil, validate_only: nil, request_id: nil, update_mask: nil) + # Pass arguments to `update_tenant` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param tenant [::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::Tenant, ::Hash] + # Required. The desired state for the tenant. + # @param validate_only [::Boolean] + # If "validate_only" is set to true, the service will try to validate + # that this request would succeed, but will not actually make changes. + # @param request_id [::String] + # An optional request ID to identify requests. Specify a unique request ID + # so that if you must retry your request, the server will know to ignore + # the request if it has already been completed. The server will guarantee + # that for at least 60 minutes since the first request. + # + # For example, consider a situation where you make an initial request and the + # request times out. If you make the request again with the same request + # ID, the server can check if original operation with the same request ID + # was received, and if so, will ignore the second request. This prevents + # clients from accidentally creating duplicate commitments. + # + # The request ID must be a valid UUID with the exception that zero UUID is + # not supported (00000000-0000-0000-0000-000000000000). + # @param update_mask [::Google::Protobuf::FieldMask, ::Hash] + # Field mask is used to specify the fields to be overwritten in the + # Tenant resource by the update. + # + # The fields specified in the update_mask are relative to the resource, not + # the full request. A field will be overwritten if it is in the mask. + # + # If the user does not provide a mask then all fields in the + # Tenant will be overwritten. + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::Tenant] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::Tenant] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/saas_platform/saas_service_mgmt/v1beta1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::SaasDeployments::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::UpdateTenantRequest.new + # + # # Call the update_tenant method. + # result = client.update_tenant request + # + # # The returned object is of type Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::Tenant. + # p result + # + def update_tenant request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::UpdateTenantRequest + + # Converts hash 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_tenant.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::SaasPlatform::SaasServiceMgmt::V1beta1::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_tenant.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.update_tenant.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @saas_deployments_stub.update_tenant 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 + + ## + # Delete a single tenant. + # + # @overload delete_tenant(request, options = nil) + # Pass arguments to `delete_tenant` via a request object, either of type + # {::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::DeleteTenantRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::DeleteTenantRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_tenant(name: nil, etag: nil, validate_only: nil, request_id: nil) + # Pass arguments to `delete_tenant` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param name [::String] + # Required. The resource name of the resource within a service. + # @param etag [::String] + # The etag known to the client for the expected state of the tenant. This is + # used with state-changing methods to prevent accidental overwrites when + # multiple user agents might be acting in parallel on the same resource. + # + # An etag wildcard provide optimistic concurrency based on the expected + # existence of the tenant. The Any wildcard (`*`) requires that the resource + # must already exists, and the Not Any wildcard (`!*`) requires that it must + # not. + # @param validate_only [::Boolean] + # If "validate_only" is set to true, the service will try to validate + # that this request would succeed, but will not actually make changes. + # @param request_id [::String] + # An optional request ID to identify requests. Specify a unique request ID + # so that if you must retry your request, the server will know to ignore + # the request if it has already been completed. The server will guarantee + # that for at least 60 minutes since the first request. + # + # For example, consider a situation where you make an initial request and the + # request times out. If you make the request again with the same request + # ID, the server can check if original operation with the same request ID + # was received, and if so, will ignore the second request. This prevents + # clients from accidentally creating duplicate commitments. + # + # The request ID must be a valid UUID with the exception that zero UUID is + # not supported (00000000-0000-0000-0000-000000000000). + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Protobuf::Empty] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Protobuf::Empty] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/saas_platform/saas_service_mgmt/v1beta1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::SaasDeployments::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::DeleteTenantRequest.new + # + # # Call the delete_tenant method. + # result = client.delete_tenant request + # + # # The returned object is of type Google::Protobuf::Empty. + # p result + # + def delete_tenant request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::DeleteTenantRequest + + # Converts hash 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_tenant.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::SaasPlatform::SaasServiceMgmt::V1beta1::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_tenant.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.delete_tenant.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @saas_deployments_stub.delete_tenant 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 + + ## + # Retrieve a collection of unit kinds. + # + # @overload list_unit_kinds(request, options = nil) + # Pass arguments to `list_unit_kinds` via a request object, either of type + # {::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::ListUnitKindsRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::ListUnitKindsRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_unit_kinds(parent: nil, page_size: nil, page_token: nil, filter: nil, order_by: nil) + # Pass arguments to `list_unit_kinds` via keyword arguments. Note that at + # least one keyword argument is 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 of the unit kind. + # @param page_size [::Integer] + # The maximum number of unit kinds to send per page. + # @param page_token [::String] + # The page token: If the next_page_token from a previous response + # is provided, this request will send the subsequent page. + # @param filter [::String] + # Filter the list as specified in https://google.aip.dev/160. + # @param order_by [::String] + # Order results as specified in https://google.aip.dev/132. + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Gapic::Rest::PagedEnumerable<::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::UnitKind>] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Gapic::Rest::PagedEnumerable<::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::UnitKind>] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/saas_platform/saas_service_mgmt/v1beta1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::SaasDeployments::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::ListUnitKindsRequest.new + # + # # Call the list_unit_kinds method. + # result = client.list_unit_kinds request + # + # # The returned object is of type Gapic::PagedEnumerable. You can iterate + # # over elements, and API calls will be issued to fetch pages as needed. + # result.each do |item| + # # Each element is of type ::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::UnitKind. + # p item + # end + # + def list_unit_kinds request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::ListUnitKindsRequest + + # Converts hash 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_unit_kinds.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::SaasPlatform::SaasServiceMgmt::V1beta1::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_unit_kinds.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.list_unit_kinds.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @saas_deployments_stub.list_unit_kinds request, options do |result, operation| + result = ::Gapic::Rest::PagedEnumerable.new @saas_deployments_stub, :list_unit_kinds, "unit_kinds", 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 + + ## + # Retrieve a single unit kind. + # + # @overload get_unit_kind(request, options = nil) + # Pass arguments to `get_unit_kind` via a request object, either of type + # {::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::GetUnitKindRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::GetUnitKindRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_unit_kind(name: nil) + # Pass arguments to `get_unit_kind` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param name [::String] + # Required. The resource name of the resource within a service. + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::UnitKind] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::UnitKind] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/saas_platform/saas_service_mgmt/v1beta1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::SaasDeployments::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::GetUnitKindRequest.new + # + # # Call the get_unit_kind method. + # result = client.get_unit_kind request + # + # # The returned object is of type Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::UnitKind. + # p result + # + def get_unit_kind request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::GetUnitKindRequest + + # Converts hash 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_unit_kind.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::SaasPlatform::SaasServiceMgmt::V1beta1::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_unit_kind.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.get_unit_kind.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @saas_deployments_stub.get_unit_kind 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 + + ## + # Create a new unit kind. + # + # @overload create_unit_kind(request, options = nil) + # Pass arguments to `create_unit_kind` via a request object, either of type + # {::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::CreateUnitKindRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::CreateUnitKindRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_unit_kind(parent: nil, unit_kind_id: nil, unit_kind: nil, validate_only: nil, request_id: nil) + # Pass arguments to `create_unit_kind` via keyword arguments. Note that at + # least one keyword argument is 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 of the unit kind. + # @param unit_kind_id [::String] + # Required. The ID value for the new unit kind. + # @param unit_kind [::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::UnitKind, ::Hash] + # Required. The desired state for the unit kind. + # @param validate_only [::Boolean] + # If "validate_only" is set to true, the service will try to validate + # that this request would succeed, but will not actually make changes. + # @param request_id [::String] + # An optional request ID to identify requests. Specify a unique request ID + # so that if you must retry your request, the server will know to ignore + # the request if it has already been completed. The server will guarantee + # that for at least 60 minutes since the first request. + # + # For example, consider a situation where you make an initial request and the + # request times out. If you make the request again with the same request + # ID, the server can check if original operation with the same request ID + # was received, and if so, will ignore the second request. This prevents + # clients from accidentally creating duplicate commitments. + # + # The request ID must be a valid UUID with the exception that zero UUID is + # not supported (00000000-0000-0000-0000-000000000000). + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::UnitKind] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::UnitKind] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/saas_platform/saas_service_mgmt/v1beta1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::SaasDeployments::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::CreateUnitKindRequest.new + # + # # Call the create_unit_kind method. + # result = client.create_unit_kind request + # + # # The returned object is of type Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::UnitKind. + # p result + # + def create_unit_kind request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::CreateUnitKindRequest + + # Converts hash 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_unit_kind.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::SaasPlatform::SaasServiceMgmt::V1beta1::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_unit_kind.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.create_unit_kind.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @saas_deployments_stub.create_unit_kind 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 + + ## + # Update a single unit kind. + # + # @overload update_unit_kind(request, options = nil) + # Pass arguments to `update_unit_kind` via a request object, either of type + # {::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::UpdateUnitKindRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::UpdateUnitKindRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_unit_kind(unit_kind: nil, validate_only: nil, request_id: nil, update_mask: nil) + # Pass arguments to `update_unit_kind` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param unit_kind [::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::UnitKind, ::Hash] + # Required. The desired state for the unit kind. + # @param validate_only [::Boolean] + # If "validate_only" is set to true, the service will try to validate + # that this request would succeed, but will not actually make changes. + # @param request_id [::String] + # An optional request ID to identify requests. Specify a unique request ID + # so that if you must retry your request, the server will know to ignore + # the request if it has already been completed. The server will guarantee + # that for at least 60 minutes since the first request. + # + # For example, consider a situation where you make an initial request and the + # request times out. If you make the request again with the same request + # ID, the server can check if original operation with the same request ID + # was received, and if so, will ignore the second request. This prevents + # clients from accidentally creating duplicate commitments. + # + # The request ID must be a valid UUID with the exception that zero UUID is + # not supported (00000000-0000-0000-0000-000000000000). + # @param update_mask [::Google::Protobuf::FieldMask, ::Hash] + # Field mask is used to specify the fields to be overwritten in the + # UnitKind resource by the update. + # + # The fields specified in the update_mask are relative to the resource, not + # the full request. A field will be overwritten if it is in the mask. + # + # If the user does not provide a mask then all fields in the + # UnitKind will be overwritten. + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::UnitKind] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::UnitKind] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/saas_platform/saas_service_mgmt/v1beta1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::SaasDeployments::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::UpdateUnitKindRequest.new + # + # # Call the update_unit_kind method. + # result = client.update_unit_kind request + # + # # The returned object is of type Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::UnitKind. + # p result + # + def update_unit_kind request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::UpdateUnitKindRequest + + # Converts hash 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_unit_kind.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::SaasPlatform::SaasServiceMgmt::V1beta1::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_unit_kind.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.update_unit_kind.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @saas_deployments_stub.update_unit_kind 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 + + ## + # Delete a single unit kind. + # + # @overload delete_unit_kind(request, options = nil) + # Pass arguments to `delete_unit_kind` via a request object, either of type + # {::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::DeleteUnitKindRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::DeleteUnitKindRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_unit_kind(name: nil, etag: nil, validate_only: nil, request_id: nil) + # Pass arguments to `delete_unit_kind` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param name [::String] + # Required. The resource name of the resource within a service. + # @param etag [::String] + # The etag known to the client for the expected state of the unit kind. This + # is used with state-changing methods to prevent accidental overwrites when + # multiple user agents might be acting in parallel on the same resource. + # + # An etag wildcard provide optimistic concurrency based on the expected + # existence of the unit kind. The Any wildcard (`*`) requires that the + # resource must already exists, and the Not Any wildcard (`!*`) requires that + # it must not. + # @param validate_only [::Boolean] + # If "validate_only" is set to true, the service will try to validate + # that this request would succeed, but will not actually make changes. + # @param request_id [::String] + # An optional request ID to identify requests. Specify a unique request ID + # so that if you must retry your request, the server will know to ignore + # the request if it has already been completed. The server will guarantee + # that for at least 60 minutes since the first request. + # + # For example, consider a situation where you make an initial request and the + # request times out. If you make the request again with the same request + # ID, the server can check if original operation with the same request ID + # was received, and if so, will ignore the second request. This prevents + # clients from accidentally creating duplicate commitments. + # + # The request ID must be a valid UUID with the exception that zero UUID is + # not supported (00000000-0000-0000-0000-000000000000). + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Protobuf::Empty] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Protobuf::Empty] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/saas_platform/saas_service_mgmt/v1beta1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::SaasDeployments::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::DeleteUnitKindRequest.new + # + # # Call the delete_unit_kind method. + # result = client.delete_unit_kind request + # + # # The returned object is of type Google::Protobuf::Empty. + # p result + # + def delete_unit_kind request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::DeleteUnitKindRequest + + # Converts hash 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_unit_kind.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::SaasPlatform::SaasServiceMgmt::V1beta1::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_unit_kind.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.delete_unit_kind.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @saas_deployments_stub.delete_unit_kind 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 + + ## + # Retrieve a collection of units. + # + # @overload list_units(request, options = nil) + # Pass arguments to `list_units` via a request object, either of type + # {::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::ListUnitsRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::ListUnitsRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_units(parent: nil, page_size: nil, page_token: nil, filter: nil, order_by: nil) + # Pass arguments to `list_units` via keyword arguments. Note that at + # least one keyword argument is 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 of the unit. + # @param page_size [::Integer] + # The maximum number of units to send per page. + # @param page_token [::String] + # The page token: If the next_page_token from a previous response + # is provided, this request will send the subsequent page. + # @param filter [::String] + # Filter the list as specified in https://google.aip.dev/160. + # @param order_by [::String] + # Order results as specified in https://google.aip.dev/132. + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Gapic::Rest::PagedEnumerable<::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::Unit>] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Gapic::Rest::PagedEnumerable<::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::Unit>] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/saas_platform/saas_service_mgmt/v1beta1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::SaasDeployments::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::ListUnitsRequest.new + # + # # Call the list_units method. + # result = client.list_units request + # + # # The returned object is of type Gapic::PagedEnumerable. You can iterate + # # over elements, and API calls will be issued to fetch pages as needed. + # result.each do |item| + # # Each element is of type ::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::Unit. + # p item + # end + # + def list_units request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::ListUnitsRequest + + # Converts hash 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_units.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::SaasPlatform::SaasServiceMgmt::V1beta1::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_units.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.list_units.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @saas_deployments_stub.list_units request, options do |result, operation| + result = ::Gapic::Rest::PagedEnumerable.new @saas_deployments_stub, :list_units, "units", 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 + + ## + # Retrieve a single unit. + # + # @overload get_unit(request, options = nil) + # Pass arguments to `get_unit` via a request object, either of type + # {::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::GetUnitRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::GetUnitRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_unit(name: nil) + # Pass arguments to `get_unit` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param name [::String] + # Required. The resource name of the resource within a service. + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::Unit] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::Unit] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/saas_platform/saas_service_mgmt/v1beta1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::SaasDeployments::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::GetUnitRequest.new + # + # # Call the get_unit method. + # result = client.get_unit request + # + # # The returned object is of type Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::Unit. + # p result + # + def get_unit request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::GetUnitRequest + + # Converts hash 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_unit.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::SaasPlatform::SaasServiceMgmt::V1beta1::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_unit.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.get_unit.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @saas_deployments_stub.get_unit 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 + + ## + # Create a new unit. + # + # @overload create_unit(request, options = nil) + # Pass arguments to `create_unit` via a request object, either of type + # {::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::CreateUnitRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::CreateUnitRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_unit(parent: nil, unit_id: nil, unit: nil, validate_only: nil, request_id: nil) + # Pass arguments to `create_unit` via keyword arguments. Note that at + # least one keyword argument is 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 of the unit. + # @param unit_id [::String] + # Required. The ID value for the new unit. + # @param unit [::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::Unit, ::Hash] + # Required. The desired state for the unit. + # @param validate_only [::Boolean] + # If "validate_only" is set to true, the service will try to validate + # that this request would succeed, but will not actually make changes. + # @param request_id [::String] + # An optional request ID to identify requests. Specify a unique request ID + # so that if you must retry your request, the server will know to ignore + # the request if it has already been completed. The server will guarantee + # that for at least 60 minutes since the first request. + # + # For example, consider a situation where you make an initial request and the + # request times out. If you make the request again with the same request + # ID, the server can check if original operation with the same request ID + # was received, and if so, will ignore the second request. This prevents + # clients from accidentally creating duplicate commitments. + # + # The request ID must be a valid UUID with the exception that zero UUID is + # not supported (00000000-0000-0000-0000-000000000000). + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::Unit] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::Unit] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/saas_platform/saas_service_mgmt/v1beta1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::SaasDeployments::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::CreateUnitRequest.new + # + # # Call the create_unit method. + # result = client.create_unit request + # + # # The returned object is of type Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::Unit. + # p result + # + def create_unit request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::CreateUnitRequest + + # Converts hash 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_unit.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::SaasPlatform::SaasServiceMgmt::V1beta1::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_unit.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.create_unit.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @saas_deployments_stub.create_unit 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 + + ## + # Update a single unit. + # + # @overload update_unit(request, options = nil) + # Pass arguments to `update_unit` via a request object, either of type + # {::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::UpdateUnitRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::UpdateUnitRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_unit(unit: nil, validate_only: nil, request_id: nil, update_mask: nil) + # Pass arguments to `update_unit` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param unit [::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::Unit, ::Hash] + # Required. The desired state for the unit. + # @param validate_only [::Boolean] + # If "validate_only" is set to true, the service will try to validate + # that this request would succeed, but will not actually make changes. + # @param request_id [::String] + # An optional request ID to identify requests. Specify a unique request ID + # so that if you must retry your request, the server will know to ignore + # the request if it has already been completed. The server will guarantee + # that for at least 60 minutes since the first request. + # + # For example, consider a situation where you make an initial request and the + # request times out. If you make the request again with the same request + # ID, the server can check if original operation with the same request ID + # was received, and if so, will ignore the second request. This prevents + # clients from accidentally creating duplicate commitments. + # + # The request ID must be a valid UUID with the exception that zero UUID is + # not supported (00000000-0000-0000-0000-000000000000). + # @param update_mask [::Google::Protobuf::FieldMask, ::Hash] + # Field mask is used to specify the fields to be overwritten in the + # Unit resource by the update. + # + # The fields specified in the update_mask are relative to the resource, not + # the full request. A field will be overwritten if it is in the mask. + # + # If the user does not provide a mask then all fields in the + # Unit will be overwritten. + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::Unit] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::Unit] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/saas_platform/saas_service_mgmt/v1beta1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::SaasDeployments::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::UpdateUnitRequest.new + # + # # Call the update_unit method. + # result = client.update_unit request + # + # # The returned object is of type Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::Unit. + # p result + # + def update_unit request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::UpdateUnitRequest + + # Converts hash 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_unit.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::SaasPlatform::SaasServiceMgmt::V1beta1::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_unit.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.update_unit.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @saas_deployments_stub.update_unit 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 + + ## + # Delete a single unit. + # + # @overload delete_unit(request, options = nil) + # Pass arguments to `delete_unit` via a request object, either of type + # {::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::DeleteUnitRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::DeleteUnitRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_unit(name: nil, etag: nil, validate_only: nil, request_id: nil) + # Pass arguments to `delete_unit` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param name [::String] + # Required. The resource name of the resource within a service. + # @param etag [::String] + # The etag known to the client for the expected state of the unit. This is + # used with state-changing methods to prevent accidental overwrites when + # multiple user agents might be acting in parallel on the same resource. + # + # An etag wildcard provide optimistic concurrency based on the expected + # existence of the unit. The Any wildcard (`*`) requires that the resource + # must already exists, and the Not Any wildcard (`!*`) requires that it must + # not. + # @param validate_only [::Boolean] + # If "validate_only" is set to true, the service will try to validate + # that this request would succeed, but will not actually make changes. + # @param request_id [::String] + # An optional request ID to identify requests. Specify a unique request ID + # so that if you must retry your request, the server will know to ignore + # the request if it has already been completed. The server will guarantee + # that for at least 60 minutes since the first request. + # + # For example, consider a situation where you make an initial request and the + # request times out. If you make the request again with the same request + # ID, the server can check if original operation with the same request ID + # was received, and if so, will ignore the second request. This prevents + # clients from accidentally creating duplicate commitments. + # + # The request ID must be a valid UUID with the exception that zero UUID is + # not supported (00000000-0000-0000-0000-000000000000). + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Protobuf::Empty] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Protobuf::Empty] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/saas_platform/saas_service_mgmt/v1beta1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::SaasDeployments::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::DeleteUnitRequest.new + # + # # Call the delete_unit method. + # result = client.delete_unit request + # + # # The returned object is of type Google::Protobuf::Empty. + # p result + # + def delete_unit request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::DeleteUnitRequest + + # Converts hash 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_unit.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::SaasPlatform::SaasServiceMgmt::V1beta1::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_unit.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.delete_unit.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @saas_deployments_stub.delete_unit 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 + + ## + # Retrieve a collection of unit operations. + # + # @overload list_unit_operations(request, options = nil) + # Pass arguments to `list_unit_operations` via a request object, either of type + # {::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::ListUnitOperationsRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::ListUnitOperationsRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_unit_operations(parent: nil, page_size: nil, page_token: nil, filter: nil, order_by: nil) + # Pass arguments to `list_unit_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 parent [::String] + # Required. The parent of the unit operation. + # @param page_size [::Integer] + # The maximum number of unit operations to send per page. + # @param page_token [::String] + # The page token: If the next_page_token from a previous response + # is provided, this request will send the subsequent page. + # @param filter [::String] + # Filter the list as specified in https://google.aip.dev/160. + # @param order_by [::String] + # Order results as specified in https://google.aip.dev/132. + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Gapic::Rest::PagedEnumerable<::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::UnitOperation>] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Gapic::Rest::PagedEnumerable<::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::UnitOperation>] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/saas_platform/saas_service_mgmt/v1beta1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::SaasDeployments::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::ListUnitOperationsRequest.new + # + # # Call the list_unit_operations method. + # result = client.list_unit_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::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::UnitOperation. + # p item + # end + # + def list_unit_operations request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::ListUnitOperationsRequest + + # Converts hash 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_unit_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::SaasPlatform::SaasServiceMgmt::V1beta1::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_unit_operations.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.list_unit_operations.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @saas_deployments_stub.list_unit_operations request, options do |result, operation| + result = ::Gapic::Rest::PagedEnumerable.new @saas_deployments_stub, :list_unit_operations, "unit_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 + + ## + # Retrieve a single unit operation. + # + # @overload get_unit_operation(request, options = nil) + # Pass arguments to `get_unit_operation` via a request object, either of type + # {::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::GetUnitOperationRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::GetUnitOperationRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_unit_operation(name: nil) + # Pass arguments to `get_unit_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] + # Required. The resource name of the resource within a service. + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::UnitOperation] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::UnitOperation] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/saas_platform/saas_service_mgmt/v1beta1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::SaasDeployments::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::GetUnitOperationRequest.new + # + # # Call the get_unit_operation method. + # result = client.get_unit_operation request + # + # # The returned object is of type Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::UnitOperation. + # p result + # + def get_unit_operation request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::GetUnitOperationRequest + + # Converts hash 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_unit_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::SaasPlatform::SaasServiceMgmt::V1beta1::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_unit_operation.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.get_unit_operation.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @saas_deployments_stub.get_unit_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 + + ## + # Create a new unit operation. + # + # @overload create_unit_operation(request, options = nil) + # Pass arguments to `create_unit_operation` via a request object, either of type + # {::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::CreateUnitOperationRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::CreateUnitOperationRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_unit_operation(parent: nil, unit_operation_id: nil, unit_operation: nil, validate_only: nil, request_id: nil) + # Pass arguments to `create_unit_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 parent [::String] + # Required. The parent of the unit operation. + # @param unit_operation_id [::String] + # Required. The ID value for the new unit operation. + # @param unit_operation [::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::UnitOperation, ::Hash] + # Required. The desired state for the unit operation. + # @param validate_only [::Boolean] + # If "validate_only" is set to true, the service will try to validate + # that this request would succeed, but will not actually make changes. + # @param request_id [::String] + # An optional request ID to identify requests. Specify a unique request ID + # so that if you must retry your request, the server will know to ignore + # the request if it has already been completed. The server will guarantee + # that for at least 60 minutes since the first request. + # + # For example, consider a situation where you make an initial request and the + # request times out. If you make the request again with the same request + # ID, the server can check if original operation with the same request ID + # was received, and if so, will ignore the second request. This prevents + # clients from accidentally creating duplicate commitments. + # + # The request ID must be a valid UUID with the exception that zero UUID is + # not supported (00000000-0000-0000-0000-000000000000). + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::UnitOperation] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::UnitOperation] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/saas_platform/saas_service_mgmt/v1beta1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::SaasDeployments::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::CreateUnitOperationRequest.new + # + # # Call the create_unit_operation method. + # result = client.create_unit_operation request + # + # # The returned object is of type Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::UnitOperation. + # p result + # + def create_unit_operation request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::CreateUnitOperationRequest + + # Converts hash 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_unit_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::SaasPlatform::SaasServiceMgmt::V1beta1::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_unit_operation.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.create_unit_operation.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @saas_deployments_stub.create_unit_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 + + ## + # Update a single unit operation. + # + # @overload update_unit_operation(request, options = nil) + # Pass arguments to `update_unit_operation` via a request object, either of type + # {::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::UpdateUnitOperationRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::UpdateUnitOperationRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_unit_operation(unit_operation: nil, validate_only: nil, request_id: nil, update_mask: nil) + # Pass arguments to `update_unit_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 unit_operation [::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::UnitOperation, ::Hash] + # Required. The desired state for the unit operation. + # @param validate_only [::Boolean] + # If "validate_only" is set to true, the service will try to validate + # that this request would succeed, but will not actually make changes. + # @param request_id [::String] + # An optional request ID to identify requests. Specify a unique request ID + # so that if you must retry your request, the server will know to ignore + # the request if it has already been completed. The server will guarantee + # that for at least 60 minutes since the first request. + # + # For example, consider a situation where you make an initial request and the + # request times out. If you make the request again with the same request + # ID, the server can check if original operation with the same request ID + # was received, and if so, will ignore the second request. This prevents + # clients from accidentally creating duplicate commitments. + # + # The request ID must be a valid UUID with the exception that zero UUID is + # not supported (00000000-0000-0000-0000-000000000000). + # @param update_mask [::Google::Protobuf::FieldMask, ::Hash] + # Field mask is used to specify the fields to be overwritten in the + # UnitOperation resource by the update. + # + # The fields specified in the update_mask are relative to the resource, not + # the full request. A field will be overwritten if it is in the mask. + # + # If the user does not provide a mask then all fields in the + # UnitOperation will be overwritten. + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::UnitOperation] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::UnitOperation] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/saas_platform/saas_service_mgmt/v1beta1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::SaasDeployments::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::UpdateUnitOperationRequest.new + # + # # Call the update_unit_operation method. + # result = client.update_unit_operation request + # + # # The returned object is of type Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::UnitOperation. + # p result + # + def update_unit_operation request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::UpdateUnitOperationRequest + + # Converts hash 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_unit_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::SaasPlatform::SaasServiceMgmt::V1beta1::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_unit_operation.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.update_unit_operation.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @saas_deployments_stub.update_unit_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 + + ## + # Delete a single unit operation. + # + # @overload delete_unit_operation(request, options = nil) + # Pass arguments to `delete_unit_operation` via a request object, either of type + # {::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::DeleteUnitOperationRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::DeleteUnitOperationRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_unit_operation(name: nil, etag: nil, validate_only: nil, request_id: nil) + # Pass arguments to `delete_unit_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] + # Required. The resource name of the resource within a service. + # @param etag [::String] + # The etag known to the client for the expected state of the unit operation. + # This is used with state-changing methods to prevent accidental overwrites + # when multiple user agents might be acting in parallel on the same resource. + # + # An etag wildcard provide optimistic concurrency based on the expected + # existence of the unit operation. The Any wildcard (`*`) requires that the + # resource must already exists, and the Not Any wildcard (`!*`) requires that + # it must not. + # @param validate_only [::Boolean] + # If "validate_only" is set to true, the service will try to validate + # that this request would succeed, but will not actually make changes. + # @param request_id [::String] + # An optional request ID to identify requests. Specify a unique request ID + # so that if you must retry your request, the server will know to ignore + # the request if it has already been completed. The server will guarantee + # that for at least 60 minutes since the first request. + # + # For example, consider a situation where you make an initial request and the + # request times out. If you make the request again with the same request + # ID, the server can check if original operation with the same request ID + # was received, and if so, will ignore the second request. This prevents + # clients from accidentally creating duplicate commitments. + # + # The request ID must be a valid UUID with the exception that zero UUID is + # not supported (00000000-0000-0000-0000-000000000000). + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Protobuf::Empty] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Protobuf::Empty] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/saas_platform/saas_service_mgmt/v1beta1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::SaasDeployments::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::DeleteUnitOperationRequest.new + # + # # Call the delete_unit_operation method. + # result = client.delete_unit_operation request + # + # # The returned object is of type Google::Protobuf::Empty. + # p result + # + def delete_unit_operation request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::DeleteUnitOperationRequest + + # Converts hash 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_unit_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::SaasPlatform::SaasServiceMgmt::V1beta1::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_unit_operation.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.delete_unit_operation.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @saas_deployments_stub.delete_unit_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 + + ## + # Retrieve a collection of releases. + # + # @overload list_releases(request, options = nil) + # Pass arguments to `list_releases` via a request object, either of type + # {::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::ListReleasesRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::ListReleasesRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_releases(parent: nil, page_size: nil, page_token: nil, filter: nil, order_by: nil) + # Pass arguments to `list_releases` via keyword arguments. Note that at + # least one keyword argument is 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 of the release. + # @param page_size [::Integer] + # The maximum number of releases to send per page. + # @param page_token [::String] + # The page token: If the next_page_token from a previous response + # is provided, this request will send the subsequent page. + # @param filter [::String] + # Filter the list as specified in https://google.aip.dev/160. + # @param order_by [::String] + # Order results as specified in https://google.aip.dev/132. + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Gapic::Rest::PagedEnumerable<::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::Release>] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Gapic::Rest::PagedEnumerable<::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::Release>] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/saas_platform/saas_service_mgmt/v1beta1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::SaasDeployments::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::ListReleasesRequest.new + # + # # Call the list_releases method. + # result = client.list_releases request + # + # # The returned object is of type Gapic::PagedEnumerable. You can iterate + # # over elements, and API calls will be issued to fetch pages as needed. + # result.each do |item| + # # Each element is of type ::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::Release. + # p item + # end + # + def list_releases request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::ListReleasesRequest + + # Converts hash 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_releases.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::SaasPlatform::SaasServiceMgmt::V1beta1::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_releases.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.list_releases.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @saas_deployments_stub.list_releases request, options do |result, operation| + result = ::Gapic::Rest::PagedEnumerable.new @saas_deployments_stub, :list_releases, "releases", 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 + + ## + # Retrieve a single release. + # + # @overload get_release(request, options = nil) + # Pass arguments to `get_release` via a request object, either of type + # {::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::GetReleaseRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::GetReleaseRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_release(name: nil) + # Pass arguments to `get_release` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param name [::String] + # Required. The resource name of the resource within a service. + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::Release] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::Release] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/saas_platform/saas_service_mgmt/v1beta1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::SaasDeployments::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::GetReleaseRequest.new + # + # # Call the get_release method. + # result = client.get_release request + # + # # The returned object is of type Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::Release. + # p result + # + def get_release request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::GetReleaseRequest + + # Converts hash 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_release.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::SaasPlatform::SaasServiceMgmt::V1beta1::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_release.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.get_release.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @saas_deployments_stub.get_release 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 + + ## + # Create a new release. + # + # @overload create_release(request, options = nil) + # Pass arguments to `create_release` via a request object, either of type + # {::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::CreateReleaseRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::CreateReleaseRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_release(parent: nil, release_id: nil, release: nil, validate_only: nil, request_id: nil) + # Pass arguments to `create_release` via keyword arguments. Note that at + # least one keyword argument is 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 of the release. + # @param release_id [::String] + # Required. The ID value for the new release. + # @param release [::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::Release, ::Hash] + # Required. The desired state for the release. + # @param validate_only [::Boolean] + # If "validate_only" is set to true, the service will try to validate + # that this request would succeed, but will not actually make changes. + # @param request_id [::String] + # An optional request ID to identify requests. Specify a unique request ID + # so that if you must retry your request, the server will know to ignore + # the request if it has already been completed. The server will guarantee + # that for at least 60 minutes since the first request. + # + # For example, consider a situation where you make an initial request and the + # request times out. If you make the request again with the same request + # ID, the server can check if original operation with the same request ID + # was received, and if so, will ignore the second request. This prevents + # clients from accidentally creating duplicate commitments. + # + # The request ID must be a valid UUID with the exception that zero UUID is + # not supported (00000000-0000-0000-0000-000000000000). + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::Release] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::Release] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/saas_platform/saas_service_mgmt/v1beta1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::SaasDeployments::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::CreateReleaseRequest.new + # + # # Call the create_release method. + # result = client.create_release request + # + # # The returned object is of type Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::Release. + # p result + # + def create_release request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::CreateReleaseRequest + + # Converts hash 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_release.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::SaasPlatform::SaasServiceMgmt::V1beta1::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_release.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.create_release.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @saas_deployments_stub.create_release 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 + + ## + # Update a single release. + # + # @overload update_release(request, options = nil) + # Pass arguments to `update_release` via a request object, either of type + # {::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::UpdateReleaseRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::UpdateReleaseRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_release(release: nil, validate_only: nil, request_id: nil, update_mask: nil) + # Pass arguments to `update_release` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param release [::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::Release, ::Hash] + # Required. The desired state for the release. + # @param validate_only [::Boolean] + # If "validate_only" is set to true, the service will try to validate + # that this request would succeed, but will not actually make changes. + # @param request_id [::String] + # An optional request ID to identify requests. Specify a unique request ID + # so that if you must retry your request, the server will know to ignore + # the request if it has already been completed. The server will guarantee + # that for at least 60 minutes since the first request. + # + # For example, consider a situation where you make an initial request and the + # request times out. If you make the request again with the same request + # ID, the server can check if original operation with the same request ID + # was received, and if so, will ignore the second request. This prevents + # clients from accidentally creating duplicate commitments. + # + # The request ID must be a valid UUID with the exception that zero UUID is + # not supported (00000000-0000-0000-0000-000000000000). + # @param update_mask [::Google::Protobuf::FieldMask, ::Hash] + # Field mask is used to specify the fields to be overwritten in the + # Release resource by the update. + # + # The fields specified in the update_mask are relative to the resource, not + # the full request. A field will be overwritten if it is in the mask. + # + # If the user does not provide a mask then all fields in the + # Release will be overwritten. + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::Release] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::Release] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/saas_platform/saas_service_mgmt/v1beta1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::SaasDeployments::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::UpdateReleaseRequest.new + # + # # Call the update_release method. + # result = client.update_release request + # + # # The returned object is of type Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::Release. + # p result + # + def update_release request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::UpdateReleaseRequest + + # Converts hash 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_release.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::SaasPlatform::SaasServiceMgmt::V1beta1::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_release.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.update_release.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @saas_deployments_stub.update_release 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 + + ## + # Delete a single release. + # + # @overload delete_release(request, options = nil) + # Pass arguments to `delete_release` via a request object, either of type + # {::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::DeleteReleaseRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::DeleteReleaseRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_release(name: nil, etag: nil, validate_only: nil, request_id: nil) + # Pass arguments to `delete_release` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param name [::String] + # Required. The resource name of the resource within a service. + # @param etag [::String] + # The etag known to the client for the expected state of the release. This is + # used with state-changing methods to prevent accidental overwrites when + # multiple user agents might be acting in parallel on the same resource. + # + # An etag wildcard provide optimistic concurrency based on the expected + # existence of the release. The Any wildcard (`*`) requires that the resource + # must already exists, and the Not Any wildcard (`!*`) requires that it must + # not. + # @param validate_only [::Boolean] + # If "validate_only" is set to true, the service will try to validate + # that this request would succeed, but will not actually make changes. + # @param request_id [::String] + # An optional request ID to identify requests. Specify a unique request ID + # so that if you must retry your request, the server will know to ignore + # the request if it has already been completed. The server will guarantee + # that for at least 60 minutes since the first request. + # + # For example, consider a situation where you make an initial request and the + # request times out. If you make the request again with the same request + # ID, the server can check if original operation with the same request ID + # was received, and if so, will ignore the second request. This prevents + # clients from accidentally creating duplicate commitments. + # + # The request ID must be a valid UUID with the exception that zero UUID is + # not supported (00000000-0000-0000-0000-000000000000). + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Protobuf::Empty] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Protobuf::Empty] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/saas_platform/saas_service_mgmt/v1beta1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::SaasDeployments::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::DeleteReleaseRequest.new + # + # # Call the delete_release method. + # result = client.delete_release request + # + # # The returned object is of type Google::Protobuf::Empty. + # p result + # + def delete_release request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::DeleteReleaseRequest + + # Converts hash 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_release.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::SaasPlatform::SaasServiceMgmt::V1beta1::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_release.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.delete_release.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @saas_deployments_stub.delete_release 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 SaasDeployments REST API. + # + # This class represents the configuration for SaasDeployments REST, + # providing control over timeouts, retry behavior, logging, transport + # parameters, and other low-level controls. Certain parameters can also be + # applied individually to specific RPCs. See + # {::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::SaasDeployments::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_saas to 20 seconds, + # # and all remaining timeouts to 10 seconds. + # ::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::SaasDeployments::Rest::Client.configure do |config| + # config.timeout = 10.0 + # config.rpcs.list_saas.timeout = 20.0 + # end + # + # # Apply the above configuration only to a new client. + # client = ::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::SaasDeployments::Rest::Client.new do |config| + # config.timeout = 10.0 + # config.rpcs.list_saas.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 = "saasservicemgmt.googleapis.com" + + config_attr :endpoint, nil, ::String, nil + config_attr :credentials, nil do |value| + allowed = [::String, ::Hash, ::Proc, ::Symbol, ::Google::Auth::Credentials, ::Google::Auth::BaseClient, ::Signet::OAuth2::Client, nil] + allowed.any? { |klass| klass === value } + end + config_attr :scope, nil, ::String, ::Array, nil + config_attr :lib_name, nil, ::String, nil + config_attr :lib_version, nil, ::String, nil + config_attr :timeout, nil, ::Numeric, nil + config_attr :metadata, nil, ::Hash, nil + config_attr :retry_policy, nil, ::Hash, ::Proc, nil + config_attr :quota_project, nil, ::String, nil + config_attr :universe_domain, nil, ::String, nil + + # @private + # Overrides for http bindings for the RPCs of this service + # are only used when this service is used as mixin, and only + # by the host service. + # @return [::Hash{::Symbol=>::Array<::Gapic::Rest::GrpcTranscoder::HttpBinding>}] + config_attr :bindings_override, {}, ::Hash, nil + config_attr :logger, :default, ::Logger, nil, :default + + # @private + def initialize parent_config = nil + @parent_config = parent_config unless parent_config.nil? + + yield self if block_given? + end + + ## + # Configurations for individual RPCs + # @return [Rpcs] + # + def rpcs + @rpcs ||= begin + parent_rpcs = nil + parent_rpcs = @parent_config.rpcs if defined?(@parent_config) && @parent_config.respond_to?(:rpcs) + Rpcs.new parent_rpcs + end + end + + ## + # Configuration RPC class for the SaasDeployments 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_saas` + # @return [::Gapic::Config::Method] + # + attr_reader :list_saas + ## + # RPC-specific configuration for `get_saas` + # @return [::Gapic::Config::Method] + # + attr_reader :get_saas + ## + # RPC-specific configuration for `create_saas` + # @return [::Gapic::Config::Method] + # + attr_reader :create_saas + ## + # RPC-specific configuration for `update_saas` + # @return [::Gapic::Config::Method] + # + attr_reader :update_saas + ## + # RPC-specific configuration for `delete_saas` + # @return [::Gapic::Config::Method] + # + attr_reader :delete_saas + ## + # RPC-specific configuration for `list_tenants` + # @return [::Gapic::Config::Method] + # + attr_reader :list_tenants + ## + # RPC-specific configuration for `get_tenant` + # @return [::Gapic::Config::Method] + # + attr_reader :get_tenant + ## + # RPC-specific configuration for `create_tenant` + # @return [::Gapic::Config::Method] + # + attr_reader :create_tenant + ## + # RPC-specific configuration for `update_tenant` + # @return [::Gapic::Config::Method] + # + attr_reader :update_tenant + ## + # RPC-specific configuration for `delete_tenant` + # @return [::Gapic::Config::Method] + # + attr_reader :delete_tenant + ## + # RPC-specific configuration for `list_unit_kinds` + # @return [::Gapic::Config::Method] + # + attr_reader :list_unit_kinds + ## + # RPC-specific configuration for `get_unit_kind` + # @return [::Gapic::Config::Method] + # + attr_reader :get_unit_kind + ## + # RPC-specific configuration for `create_unit_kind` + # @return [::Gapic::Config::Method] + # + attr_reader :create_unit_kind + ## + # RPC-specific configuration for `update_unit_kind` + # @return [::Gapic::Config::Method] + # + attr_reader :update_unit_kind + ## + # RPC-specific configuration for `delete_unit_kind` + # @return [::Gapic::Config::Method] + # + attr_reader :delete_unit_kind + ## + # RPC-specific configuration for `list_units` + # @return [::Gapic::Config::Method] + # + attr_reader :list_units + ## + # RPC-specific configuration for `get_unit` + # @return [::Gapic::Config::Method] + # + attr_reader :get_unit + ## + # RPC-specific configuration for `create_unit` + # @return [::Gapic::Config::Method] + # + attr_reader :create_unit + ## + # RPC-specific configuration for `update_unit` + # @return [::Gapic::Config::Method] + # + attr_reader :update_unit + ## + # RPC-specific configuration for `delete_unit` + # @return [::Gapic::Config::Method] + # + attr_reader :delete_unit + ## + # RPC-specific configuration for `list_unit_operations` + # @return [::Gapic::Config::Method] + # + attr_reader :list_unit_operations + ## + # RPC-specific configuration for `get_unit_operation` + # @return [::Gapic::Config::Method] + # + attr_reader :get_unit_operation + ## + # RPC-specific configuration for `create_unit_operation` + # @return [::Gapic::Config::Method] + # + attr_reader :create_unit_operation + ## + # RPC-specific configuration for `update_unit_operation` + # @return [::Gapic::Config::Method] + # + attr_reader :update_unit_operation + ## + # RPC-specific configuration for `delete_unit_operation` + # @return [::Gapic::Config::Method] + # + attr_reader :delete_unit_operation + ## + # RPC-specific configuration for `list_releases` + # @return [::Gapic::Config::Method] + # + attr_reader :list_releases + ## + # RPC-specific configuration for `get_release` + # @return [::Gapic::Config::Method] + # + attr_reader :get_release + ## + # RPC-specific configuration for `create_release` + # @return [::Gapic::Config::Method] + # + attr_reader :create_release + ## + # RPC-specific configuration for `update_release` + # @return [::Gapic::Config::Method] + # + attr_reader :update_release + ## + # RPC-specific configuration for `delete_release` + # @return [::Gapic::Config::Method] + # + attr_reader :delete_release + + # @private + def initialize parent_rpcs = nil + list_saas_config = parent_rpcs.list_saas if parent_rpcs.respond_to? :list_saas + @list_saas = ::Gapic::Config::Method.new list_saas_config + get_saas_config = parent_rpcs.get_saas if parent_rpcs.respond_to? :get_saas + @get_saas = ::Gapic::Config::Method.new get_saas_config + create_saas_config = parent_rpcs.create_saas if parent_rpcs.respond_to? :create_saas + @create_saas = ::Gapic::Config::Method.new create_saas_config + update_saas_config = parent_rpcs.update_saas if parent_rpcs.respond_to? :update_saas + @update_saas = ::Gapic::Config::Method.new update_saas_config + delete_saas_config = parent_rpcs.delete_saas if parent_rpcs.respond_to? :delete_saas + @delete_saas = ::Gapic::Config::Method.new delete_saas_config + list_tenants_config = parent_rpcs.list_tenants if parent_rpcs.respond_to? :list_tenants + @list_tenants = ::Gapic::Config::Method.new list_tenants_config + get_tenant_config = parent_rpcs.get_tenant if parent_rpcs.respond_to? :get_tenant + @get_tenant = ::Gapic::Config::Method.new get_tenant_config + create_tenant_config = parent_rpcs.create_tenant if parent_rpcs.respond_to? :create_tenant + @create_tenant = ::Gapic::Config::Method.new create_tenant_config + update_tenant_config = parent_rpcs.update_tenant if parent_rpcs.respond_to? :update_tenant + @update_tenant = ::Gapic::Config::Method.new update_tenant_config + delete_tenant_config = parent_rpcs.delete_tenant if parent_rpcs.respond_to? :delete_tenant + @delete_tenant = ::Gapic::Config::Method.new delete_tenant_config + list_unit_kinds_config = parent_rpcs.list_unit_kinds if parent_rpcs.respond_to? :list_unit_kinds + @list_unit_kinds = ::Gapic::Config::Method.new list_unit_kinds_config + get_unit_kind_config = parent_rpcs.get_unit_kind if parent_rpcs.respond_to? :get_unit_kind + @get_unit_kind = ::Gapic::Config::Method.new get_unit_kind_config + create_unit_kind_config = parent_rpcs.create_unit_kind if parent_rpcs.respond_to? :create_unit_kind + @create_unit_kind = ::Gapic::Config::Method.new create_unit_kind_config + update_unit_kind_config = parent_rpcs.update_unit_kind if parent_rpcs.respond_to? :update_unit_kind + @update_unit_kind = ::Gapic::Config::Method.new update_unit_kind_config + delete_unit_kind_config = parent_rpcs.delete_unit_kind if parent_rpcs.respond_to? :delete_unit_kind + @delete_unit_kind = ::Gapic::Config::Method.new delete_unit_kind_config + list_units_config = parent_rpcs.list_units if parent_rpcs.respond_to? :list_units + @list_units = ::Gapic::Config::Method.new list_units_config + get_unit_config = parent_rpcs.get_unit if parent_rpcs.respond_to? :get_unit + @get_unit = ::Gapic::Config::Method.new get_unit_config + create_unit_config = parent_rpcs.create_unit if parent_rpcs.respond_to? :create_unit + @create_unit = ::Gapic::Config::Method.new create_unit_config + update_unit_config = parent_rpcs.update_unit if parent_rpcs.respond_to? :update_unit + @update_unit = ::Gapic::Config::Method.new update_unit_config + delete_unit_config = parent_rpcs.delete_unit if parent_rpcs.respond_to? :delete_unit + @delete_unit = ::Gapic::Config::Method.new delete_unit_config + list_unit_operations_config = parent_rpcs.list_unit_operations if parent_rpcs.respond_to? :list_unit_operations + @list_unit_operations = ::Gapic::Config::Method.new list_unit_operations_config + get_unit_operation_config = parent_rpcs.get_unit_operation if parent_rpcs.respond_to? :get_unit_operation + @get_unit_operation = ::Gapic::Config::Method.new get_unit_operation_config + create_unit_operation_config = parent_rpcs.create_unit_operation if parent_rpcs.respond_to? :create_unit_operation + @create_unit_operation = ::Gapic::Config::Method.new create_unit_operation_config + update_unit_operation_config = parent_rpcs.update_unit_operation if parent_rpcs.respond_to? :update_unit_operation + @update_unit_operation = ::Gapic::Config::Method.new update_unit_operation_config + delete_unit_operation_config = parent_rpcs.delete_unit_operation if parent_rpcs.respond_to? :delete_unit_operation + @delete_unit_operation = ::Gapic::Config::Method.new delete_unit_operation_config + list_releases_config = parent_rpcs.list_releases if parent_rpcs.respond_to? :list_releases + @list_releases = ::Gapic::Config::Method.new list_releases_config + get_release_config = parent_rpcs.get_release if parent_rpcs.respond_to? :get_release + @get_release = ::Gapic::Config::Method.new get_release_config + create_release_config = parent_rpcs.create_release if parent_rpcs.respond_to? :create_release + @create_release = ::Gapic::Config::Method.new create_release_config + update_release_config = parent_rpcs.update_release if parent_rpcs.respond_to? :update_release + @update_release = ::Gapic::Config::Method.new update_release_config + delete_release_config = parent_rpcs.delete_release if parent_rpcs.respond_to? :delete_release + @delete_release = ::Gapic::Config::Method.new delete_release_config + + yield self if block_given? + end + end + end + end + end + end + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-saas_platform-saas_service_mgmt-v1beta1/lib/google/cloud/saas_platform/saas_service_mgmt/v1beta1/saas_deployments/rest/service_stub.rb b/owl-bot-staging/google-cloud-saas_platform-saas_service_mgmt-v1beta1/lib/google/cloud/saas_platform/saas_service_mgmt/v1beta1/saas_deployments/rest/service_stub.rb new file mode 100644 index 000000000000..f5cdfdb251a2 --- /dev/null +++ b/owl-bot-staging/google-cloud-saas_platform-saas_service_mgmt-v1beta1/lib/google/cloud/saas_platform/saas_service_mgmt/v1beta1/saas_deployments/rest/service_stub.rb @@ -0,0 +1,1925 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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/saasplatform/saasservicemgmt/v1beta1/deployments_service_pb" + +module Google + module Cloud + module SaasPlatform + module SaasServiceMgmt + module V1beta1 + module SaasDeployments + module Rest + ## + # REST service stub for the SaasDeployments service. + # Service stub contains baseline method implementations + # including transcoding, making the REST call, and deserialing the response. + # + class ServiceStub + # @private + def initialize endpoint:, endpoint_template:, universe_domain:, credentials:, logger: + # These require statements are intentionally placed here to initialize + # the REST modules only when it's required. + require "gapic/rest" + + @client_stub = ::Gapic::Rest::ClientStub.new endpoint: endpoint, + endpoint_template: endpoint_template, + universe_domain: universe_domain, + credentials: credentials, + numeric_enums: true, + service_name: self.class, + raise_faraday_errors: false, + logger: logger + end + + ## + # The effective universe domain + # + # @return [String] + # + def universe_domain + @client_stub.universe_domain + end + + ## + # The effective endpoint + # + # @return [String] + # + def endpoint + @client_stub.endpoint + end + + ## + # The logger used for request/response debug logging. + # + # @return [Logger] + # + def logger stub: false + stub ? @client_stub.stub_logger : @client_stub.logger + end + + ## + # Baseline implementation for the list_saas REST call + # + # @param request_pb [::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::ListSaasRequest] + # A request object representing the call parameters. Required. + # @param options [::Gapic::CallOptions] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::ListSaasResponse] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::ListSaasResponse] + # A result object deserialized from the server's reply + def list_saas request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_list_saas_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_saas", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::ListSaasResponse.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_saas REST call + # + # @param request_pb [::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::GetSaasRequest] + # A request object representing the call parameters. Required. + # @param options [::Gapic::CallOptions] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::Saas] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::Saas] + # A result object deserialized from the server's reply + def get_saas request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_get_saas_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_saas", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::Saas.decode_json response.body, ignore_unknown_fields: true + catch :response do + yield result, operation if block_given? + result + end + end + + ## + # Baseline implementation for the create_saas REST call + # + # @param request_pb [::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::CreateSaasRequest] + # A request object representing the call parameters. Required. + # @param options [::Gapic::CallOptions] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::Saas] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::Saas] + # A result object deserialized from the server's reply + def create_saas request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_create_saas_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_saas", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::Saas.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_saas REST call + # + # @param request_pb [::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::UpdateSaasRequest] + # A request object representing the call parameters. Required. + # @param options [::Gapic::CallOptions] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::Saas] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::Saas] + # A result object deserialized from the server's reply + def update_saas request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_update_saas_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_saas", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::Saas.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_saas REST call + # + # @param request_pb [::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::DeleteSaasRequest] + # 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_saas request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_delete_saas_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_saas", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Protobuf::Empty.decode_json response.body, ignore_unknown_fields: true + catch :response do + yield result, operation if block_given? + result + end + end + + ## + # Baseline implementation for the list_tenants REST call + # + # @param request_pb [::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::ListTenantsRequest] + # A request object representing the call parameters. Required. + # @param options [::Gapic::CallOptions] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::ListTenantsResponse] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::ListTenantsResponse] + # A result object deserialized from the server's reply + def list_tenants request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_list_tenants_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_tenants", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::ListTenantsResponse.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_tenant REST call + # + # @param request_pb [::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::GetTenantRequest] + # A request object representing the call parameters. Required. + # @param options [::Gapic::CallOptions] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::Tenant] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::Tenant] + # A result object deserialized from the server's reply + def get_tenant request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_get_tenant_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_tenant", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::Tenant.decode_json response.body, ignore_unknown_fields: true + catch :response do + yield result, operation if block_given? + result + end + end + + ## + # Baseline implementation for the create_tenant REST call + # + # @param request_pb [::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::CreateTenantRequest] + # A request object representing the call parameters. Required. + # @param options [::Gapic::CallOptions] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::Tenant] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::Tenant] + # A result object deserialized from the server's reply + def create_tenant request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_create_tenant_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_tenant", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::Tenant.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_tenant REST call + # + # @param request_pb [::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::UpdateTenantRequest] + # A request object representing the call parameters. Required. + # @param options [::Gapic::CallOptions] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::Tenant] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::Tenant] + # A result object deserialized from the server's reply + def update_tenant request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_update_tenant_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_tenant", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::Tenant.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_tenant REST call + # + # @param request_pb [::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::DeleteTenantRequest] + # 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_tenant request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_delete_tenant_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_tenant", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Protobuf::Empty.decode_json response.body, ignore_unknown_fields: true + catch :response do + yield result, operation if block_given? + result + end + end + + ## + # Baseline implementation for the list_unit_kinds REST call + # + # @param request_pb [::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::ListUnitKindsRequest] + # A request object representing the call parameters. Required. + # @param options [::Gapic::CallOptions] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::ListUnitKindsResponse] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::ListUnitKindsResponse] + # A result object deserialized from the server's reply + def list_unit_kinds request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_list_unit_kinds_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_unit_kinds", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::ListUnitKindsResponse.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_unit_kind REST call + # + # @param request_pb [::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::GetUnitKindRequest] + # A request object representing the call parameters. Required. + # @param options [::Gapic::CallOptions] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::UnitKind] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::UnitKind] + # A result object deserialized from the server's reply + def get_unit_kind request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_get_unit_kind_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_unit_kind", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::UnitKind.decode_json response.body, ignore_unknown_fields: true + catch :response do + yield result, operation if block_given? + result + end + end + + ## + # Baseline implementation for the create_unit_kind REST call + # + # @param request_pb [::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::CreateUnitKindRequest] + # A request object representing the call parameters. Required. + # @param options [::Gapic::CallOptions] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::UnitKind] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::UnitKind] + # A result object deserialized from the server's reply + def create_unit_kind request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_create_unit_kind_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_unit_kind", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::UnitKind.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_unit_kind REST call + # + # @param request_pb [::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::UpdateUnitKindRequest] + # A request object representing the call parameters. Required. + # @param options [::Gapic::CallOptions] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::UnitKind] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::UnitKind] + # A result object deserialized from the server's reply + def update_unit_kind request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_update_unit_kind_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_unit_kind", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::UnitKind.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_unit_kind REST call + # + # @param request_pb [::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::DeleteUnitKindRequest] + # 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_unit_kind request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_delete_unit_kind_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_unit_kind", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Protobuf::Empty.decode_json response.body, ignore_unknown_fields: true + catch :response do + yield result, operation if block_given? + result + end + end + + ## + # Baseline implementation for the list_units REST call + # + # @param request_pb [::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::ListUnitsRequest] + # A request object representing the call parameters. Required. + # @param options [::Gapic::CallOptions] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::ListUnitsResponse] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::ListUnitsResponse] + # A result object deserialized from the server's reply + def list_units request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_list_units_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_units", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::ListUnitsResponse.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_unit REST call + # + # @param request_pb [::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::GetUnitRequest] + # A request object representing the call parameters. Required. + # @param options [::Gapic::CallOptions] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::Unit] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::Unit] + # A result object deserialized from the server's reply + def get_unit request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_get_unit_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_unit", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::Unit.decode_json response.body, ignore_unknown_fields: true + catch :response do + yield result, operation if block_given? + result + end + end + + ## + # Baseline implementation for the create_unit REST call + # + # @param request_pb [::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::CreateUnitRequest] + # A request object representing the call parameters. Required. + # @param options [::Gapic::CallOptions] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::Unit] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::Unit] + # A result object deserialized from the server's reply + def create_unit request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_create_unit_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_unit", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::Unit.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_unit REST call + # + # @param request_pb [::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::UpdateUnitRequest] + # A request object representing the call parameters. Required. + # @param options [::Gapic::CallOptions] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::Unit] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::Unit] + # A result object deserialized from the server's reply + def update_unit request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_update_unit_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_unit", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::Unit.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_unit REST call + # + # @param request_pb [::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::DeleteUnitRequest] + # 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_unit request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_delete_unit_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_unit", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Protobuf::Empty.decode_json response.body, ignore_unknown_fields: true + catch :response do + yield result, operation if block_given? + result + end + end + + ## + # Baseline implementation for the list_unit_operations REST call + # + # @param request_pb [::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::ListUnitOperationsRequest] + # A request object representing the call parameters. Required. + # @param options [::Gapic::CallOptions] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::ListUnitOperationsResponse] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::ListUnitOperationsResponse] + # A result object deserialized from the server's reply + def list_unit_operations request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_list_unit_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_unit_operations", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::ListUnitOperationsResponse.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_unit_operation REST call + # + # @param request_pb [::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::GetUnitOperationRequest] + # A request object representing the call parameters. Required. + # @param options [::Gapic::CallOptions] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::UnitOperation] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::UnitOperation] + # A result object deserialized from the server's reply + def get_unit_operation request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_get_unit_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_unit_operation", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::UnitOperation.decode_json response.body, ignore_unknown_fields: true + catch :response do + yield result, operation if block_given? + result + end + end + + ## + # Baseline implementation for the create_unit_operation REST call + # + # @param request_pb [::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::CreateUnitOperationRequest] + # A request object representing the call parameters. Required. + # @param options [::Gapic::CallOptions] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::UnitOperation] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::UnitOperation] + # A result object deserialized from the server's reply + def create_unit_operation request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_create_unit_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: "create_unit_operation", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::UnitOperation.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_unit_operation REST call + # + # @param request_pb [::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::UpdateUnitOperationRequest] + # A request object representing the call parameters. Required. + # @param options [::Gapic::CallOptions] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::UnitOperation] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::UnitOperation] + # A result object deserialized from the server's reply + def update_unit_operation request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_update_unit_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: "update_unit_operation", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::UnitOperation.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_unit_operation REST call + # + # @param request_pb [::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::DeleteUnitOperationRequest] + # 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_unit_operation request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_delete_unit_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_unit_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 list_releases REST call + # + # @param request_pb [::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::ListReleasesRequest] + # A request object representing the call parameters. Required. + # @param options [::Gapic::CallOptions] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::ListReleasesResponse] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::ListReleasesResponse] + # A result object deserialized from the server's reply + def list_releases request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_list_releases_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_releases", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::ListReleasesResponse.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_release REST call + # + # @param request_pb [::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::GetReleaseRequest] + # A request object representing the call parameters. Required. + # @param options [::Gapic::CallOptions] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::Release] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::Release] + # A result object deserialized from the server's reply + def get_release request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_get_release_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_release", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::Release.decode_json response.body, ignore_unknown_fields: true + catch :response do + yield result, operation if block_given? + result + end + end + + ## + # Baseline implementation for the create_release REST call + # + # @param request_pb [::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::CreateReleaseRequest] + # A request object representing the call parameters. Required. + # @param options [::Gapic::CallOptions] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::Release] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::Release] + # A result object deserialized from the server's reply + def create_release request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_create_release_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_release", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::Release.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_release REST call + # + # @param request_pb [::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::UpdateReleaseRequest] + # A request object representing the call parameters. Required. + # @param options [::Gapic::CallOptions] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::Release] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::Release] + # A result object deserialized from the server's reply + def update_release request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_update_release_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_release", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::Release.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_release REST call + # + # @param request_pb [::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::DeleteReleaseRequest] + # 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_release request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_delete_release_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_release", + 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_saas REST call + # + # @param request_pb [::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::ListSaasRequest] + # 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_saas_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :get, + uri_template: "/v1beta1/{parent}/saas", + matches: [ + ["parent", %r{^projects/[^/]+/locations/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the get_saas REST call + # + # @param request_pb [::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::GetSaasRequest] + # 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_saas_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :get, + uri_template: "/v1beta1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/saas/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the create_saas REST call + # + # @param request_pb [::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::CreateSaasRequest] + # 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_saas_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :post, + uri_template: "/v1beta1/{parent}/saas", + body: "saas", + matches: [ + ["parent", %r{^projects/[^/]+/locations/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the update_saas REST call + # + # @param request_pb [::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::UpdateSaasRequest] + # 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_saas_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :patch, + uri_template: "/v1beta1/{saas.name}", + body: "saas", + matches: [ + ["saas.name", %r{^projects/[^/]+/locations/[^/]+/saas/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the delete_saas REST call + # + # @param request_pb [::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::DeleteSaasRequest] + # 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_saas_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :delete, + uri_template: "/v1beta1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/saas/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the list_tenants REST call + # + # @param request_pb [::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::ListTenantsRequest] + # 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_tenants_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :get, + uri_template: "/v1beta1/{parent}/tenants", + matches: [ + ["parent", %r{^projects/[^/]+/locations/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the get_tenant REST call + # + # @param request_pb [::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::GetTenantRequest] + # 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_tenant_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :get, + uri_template: "/v1beta1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/tenants/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the create_tenant REST call + # + # @param request_pb [::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::CreateTenantRequest] + # 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_tenant_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :post, + uri_template: "/v1beta1/{parent}/tenants", + body: "tenant", + matches: [ + ["parent", %r{^projects/[^/]+/locations/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the update_tenant REST call + # + # @param request_pb [::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::UpdateTenantRequest] + # 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_tenant_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :patch, + uri_template: "/v1beta1/{tenant.name}", + body: "tenant", + matches: [ + ["tenant.name", %r{^projects/[^/]+/locations/[^/]+/tenants/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the delete_tenant REST call + # + # @param request_pb [::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::DeleteTenantRequest] + # 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_tenant_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :delete, + uri_template: "/v1beta1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/tenants/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the list_unit_kinds REST call + # + # @param request_pb [::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::ListUnitKindsRequest] + # 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_unit_kinds_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :get, + uri_template: "/v1beta1/{parent}/unitKinds", + matches: [ + ["parent", %r{^projects/[^/]+/locations/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the get_unit_kind REST call + # + # @param request_pb [::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::GetUnitKindRequest] + # 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_unit_kind_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :get, + uri_template: "/v1beta1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/unitKinds/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the create_unit_kind REST call + # + # @param request_pb [::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::CreateUnitKindRequest] + # 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_unit_kind_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :post, + uri_template: "/v1beta1/{parent}/unitKinds", + body: "unit_kind", + matches: [ + ["parent", %r{^projects/[^/]+/locations/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the update_unit_kind REST call + # + # @param request_pb [::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::UpdateUnitKindRequest] + # 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_unit_kind_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :patch, + uri_template: "/v1beta1/{unit_kind.name}", + body: "unit_kind", + matches: [ + ["unit_kind.name", %r{^projects/[^/]+/locations/[^/]+/unitKinds/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the delete_unit_kind REST call + # + # @param request_pb [::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::DeleteUnitKindRequest] + # 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_unit_kind_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :delete, + uri_template: "/v1beta1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/unitKinds/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the list_units REST call + # + # @param request_pb [::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::ListUnitsRequest] + # 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_units_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :get, + uri_template: "/v1beta1/{parent}/units", + matches: [ + ["parent", %r{^projects/[^/]+/locations/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the get_unit REST call + # + # @param request_pb [::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::GetUnitRequest] + # 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_unit_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :get, + uri_template: "/v1beta1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/units/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the create_unit REST call + # + # @param request_pb [::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::CreateUnitRequest] + # 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_unit_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :post, + uri_template: "/v1beta1/{parent}/units", + body: "unit", + matches: [ + ["parent", %r{^projects/[^/]+/locations/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the update_unit REST call + # + # @param request_pb [::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::UpdateUnitRequest] + # 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_unit_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :patch, + uri_template: "/v1beta1/{unit.name}", + body: "unit", + matches: [ + ["unit.name", %r{^projects/[^/]+/locations/[^/]+/units/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the delete_unit REST call + # + # @param request_pb [::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::DeleteUnitRequest] + # 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_unit_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :delete, + uri_template: "/v1beta1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/units/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the list_unit_operations REST call + # + # @param request_pb [::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::ListUnitOperationsRequest] + # 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_unit_operations_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :get, + uri_template: "/v1beta1/{parent}/unitOperations", + matches: [ + ["parent", %r{^projects/[^/]+/locations/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the get_unit_operation REST call + # + # @param request_pb [::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::GetUnitOperationRequest] + # 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_unit_operation_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :get, + uri_template: "/v1beta1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/unitOperations/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the create_unit_operation REST call + # + # @param request_pb [::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::CreateUnitOperationRequest] + # 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_unit_operation_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :post, + uri_template: "/v1beta1/{parent}/unitOperations", + body: "unit_operation", + matches: [ + ["parent", %r{^projects/[^/]+/locations/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the update_unit_operation REST call + # + # @param request_pb [::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::UpdateUnitOperationRequest] + # 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_unit_operation_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :patch, + uri_template: "/v1beta1/{unit_operation.name}", + body: "unit_operation", + matches: [ + ["unit_operation.name", %r{^projects/[^/]+/locations/[^/]+/unitOperations/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the delete_unit_operation REST call + # + # @param request_pb [::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::DeleteUnitOperationRequest] + # 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_unit_operation_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :delete, + uri_template: "/v1beta1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/unitOperations/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the list_releases REST call + # + # @param request_pb [::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::ListReleasesRequest] + # 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_releases_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :get, + uri_template: "/v1beta1/{parent}/releases", + matches: [ + ["parent", %r{^projects/[^/]+/locations/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the get_release REST call + # + # @param request_pb [::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::GetReleaseRequest] + # 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_release_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :get, + uri_template: "/v1beta1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/releases/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the create_release REST call + # + # @param request_pb [::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::CreateReleaseRequest] + # 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_release_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :post, + uri_template: "/v1beta1/{parent}/releases", + body: "release", + matches: [ + ["parent", %r{^projects/[^/]+/locations/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the update_release REST call + # + # @param request_pb [::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::UpdateReleaseRequest] + # 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_release_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :patch, + uri_template: "/v1beta1/{release.name}", + body: "release", + matches: [ + ["release.name", %r{^projects/[^/]+/locations/[^/]+/releases/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the delete_release REST call + # + # @param request_pb [::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::DeleteReleaseRequest] + # 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_release_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :delete, + uri_template: "/v1beta1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/releases/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + end + end + end + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-saas_platform-saas_service_mgmt-v1beta1/lib/google/cloud/saas_platform/saas_service_mgmt/v1beta1/saas_rollouts.rb b/owl-bot-staging/google-cloud-saas_platform-saas_service_mgmt-v1beta1/lib/google/cloud/saas_platform/saas_service_mgmt/v1beta1/saas_rollouts.rb new file mode 100644 index 000000000000..5e1c1a19ccc6 --- /dev/null +++ b/owl-bot-staging/google-cloud-saas_platform-saas_service_mgmt-v1beta1/lib/google/cloud/saas_platform/saas_service_mgmt/v1beta1/saas_rollouts.rb @@ -0,0 +1,57 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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/saas_platform/saas_service_mgmt/v1beta1/version" + +require "google/cloud/saas_platform/saas_service_mgmt/v1beta1/saas_rollouts/credentials" +require "google/cloud/saas_platform/saas_service_mgmt/v1beta1/saas_rollouts/paths" +require "google/cloud/saas_platform/saas_service_mgmt/v1beta1/saas_rollouts/client" +require "google/cloud/saas_platform/saas_service_mgmt/v1beta1/saas_rollouts/rest" + +module Google + module Cloud + module SaasPlatform + module SaasServiceMgmt + module V1beta1 + ## + # Manages the rollout of SaaS services. + # + # @example Load this service and instantiate a gRPC client + # + # require "google/cloud/saas_platform/saas_service_mgmt/v1beta1/saas_rollouts" + # client = ::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::SaasRollouts::Client.new + # + # @example Load this service and instantiate a REST client + # + # require "google/cloud/saas_platform/saas_service_mgmt/v1beta1/saas_rollouts/rest" + # client = ::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::SaasRollouts::Rest::Client.new + # + module SaasRollouts + end + end + end + end + end +end + +helper_path = ::File.join __dir__, "saas_rollouts", "helpers.rb" +require "google/cloud/saas_platform/saas_service_mgmt/v1beta1/saas_rollouts/helpers" if ::File.file? helper_path diff --git a/owl-bot-staging/google-cloud-saas_platform-saas_service_mgmt-v1beta1/lib/google/cloud/saas_platform/saas_service_mgmt/v1beta1/saas_rollouts/client.rb b/owl-bot-staging/google-cloud-saas_platform-saas_service_mgmt-v1beta1/lib/google/cloud/saas_platform/saas_service_mgmt/v1beta1/saas_rollouts/client.rb new file mode 100644 index 000000000000..887bff6b5738 --- /dev/null +++ b/owl-bot-staging/google-cloud-saas_platform-saas_service_mgmt-v1beta1/lib/google/cloud/saas_platform/saas_service_mgmt/v1beta1/saas_rollouts/client.rb @@ -0,0 +1,1534 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +require "google/cloud/errors" +require "google/cloud/saasplatform/saasservicemgmt/v1beta1/rollouts_service_pb" +require "google/cloud/location" + +module Google + module Cloud + module SaasPlatform + module SaasServiceMgmt + module V1beta1 + module SaasRollouts + ## + # Client for the SaasRollouts service. + # + # Manages the rollout of SaaS services. + # + class Client + # @private + API_VERSION = "" + + # @private + DEFAULT_ENDPOINT_TEMPLATE = "saasservicemgmt.$UNIVERSE_DOMAIN$" + + include Paths + + # @private + attr_reader :saas_rollouts_stub + + ## + # Configure the SaasRollouts Client class. + # + # See {::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::SaasRollouts::Client::Configuration} + # for a description of the configuration fields. + # + # @example + # + # # Modify the configuration for all SaasRollouts clients + # ::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::SaasRollouts::Client.configure do |config| + # config.timeout = 10.0 + # end + # + # @yield [config] Configure the Client client. + # @yieldparam config [Client::Configuration] + # + # @return [Client::Configuration] + # + def self.configure + @configure ||= begin + namespace = ["Google", "Cloud", "SaasPlatform", "SaasServiceMgmt", "V1beta1"] + parent_config = while namespace.any? + parent_name = namespace.join "::" + parent_const = const_get parent_name + break parent_const.configure if parent_const.respond_to? :configure + namespace.pop + end + default_config = Client::Configuration.new parent_config + + default_config.rpcs.list_rollouts.timeout = 60.0 + default_config.rpcs.list_rollouts.retry_policy = { + initial_delay: 1.0, max_delay: 10.0, multiplier: 1.3, retry_codes: [14] + } + + default_config.rpcs.get_rollout.timeout = 60.0 + default_config.rpcs.get_rollout.retry_policy = { + initial_delay: 1.0, max_delay: 10.0, multiplier: 1.3, retry_codes: [14] + } + + default_config.rpcs.create_rollout.timeout = 60.0 + + default_config.rpcs.update_rollout.timeout = 60.0 + + default_config.rpcs.delete_rollout.timeout = 540.0 + default_config.rpcs.delete_rollout.retry_policy = { + initial_delay: 1.0, max_delay: 10.0, multiplier: 1.3, retry_codes: [14] + } + + default_config.rpcs.list_rollout_kinds.timeout = 60.0 + default_config.rpcs.list_rollout_kinds.retry_policy = { + initial_delay: 1.0, max_delay: 10.0, multiplier: 1.3, retry_codes: [14] + } + + default_config.rpcs.get_rollout_kind.timeout = 60.0 + default_config.rpcs.get_rollout_kind.retry_policy = { + initial_delay: 1.0, max_delay: 10.0, multiplier: 1.3, retry_codes: [14] + } + + default_config.rpcs.create_rollout_kind.timeout = 60.0 + + default_config.rpcs.update_rollout_kind.timeout = 60.0 + + default_config.rpcs.delete_rollout_kind.timeout = 60.0 + default_config.rpcs.delete_rollout_kind.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 SaasRollouts Client instance. + # + # The configuration is set to the derived mode, meaning that values can be changed, + # but structural changes (adding new fields, etc.) are not allowed. Structural changes + # should be made on {Client.configure}. + # + # See {::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::SaasRollouts::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 + @saas_rollouts_stub.universe_domain + end + + ## + # Create a new SaasRollouts client object. + # + # @example + # + # # Create a client using the default configuration + # client = ::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::SaasRollouts::Client.new + # + # # Create a client using a custom configuration + # client = ::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::SaasRollouts::Client.new do |config| + # config.timeout = 10.0 + # end + # + # @yield [config] Configure the SaasRollouts client. + # @yieldparam config [Client::Configuration] + # + def initialize + # These require statements are intentionally placed here to initialize + # the gRPC module only when it's required. + # See https://github.com/googleapis/toolkit/issues/446 + require "gapic/grpc" + require "google/cloud/saasplatform/saasservicemgmt/v1beta1/rollouts_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 + + @saas_rollouts_stub = ::Gapic::ServiceStub.new( + ::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::SaasRollouts::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 + ) + + @saas_rollouts_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 = @saas_rollouts_stub.endpoint + config.universe_domain = @saas_rollouts_stub.universe_domain + config.logger = @saas_rollouts_stub.logger if config.respond_to? :logger= + end + end + + ## + # Get the associated client for mix-in of the Locations. + # + # @return [Google::Cloud::Location::Locations::Client] + # + attr_reader :location_client + + ## + # The logger used for request/response debug logging. + # + # @return [Logger] + # + def logger + @saas_rollouts_stub.logger + end + + # Service calls + + ## + # Retrieve a collection of rollouts. + # + # @overload list_rollouts(request, options = nil) + # Pass arguments to `list_rollouts` via a request object, either of type + # {::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::ListRolloutsRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::ListRolloutsRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_rollouts(parent: nil, page_size: nil, page_token: nil, filter: nil, order_by: nil) + # Pass arguments to `list_rollouts` via keyword arguments. Note that at + # least one keyword argument is 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 of the rollout. + # @param page_size [::Integer] + # The maximum number of rollouts to send per page. + # @param page_token [::String] + # The page token: If the next_page_token from a previous response + # is provided, this request will send the subsequent page. + # @param filter [::String] + # Filter the list as specified in https://google.aip.dev/160. + # @param order_by [::String] + # Order results as specified in https://google.aip.dev/132. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Gapic::PagedEnumerable<::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::Rollout>] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Gapic::PagedEnumerable<::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::Rollout>] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/saas_platform/saas_service_mgmt/v1beta1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::SaasRollouts::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::ListRolloutsRequest.new + # + # # Call the list_rollouts method. + # result = client.list_rollouts request + # + # # The returned object is of type Gapic::PagedEnumerable. You can iterate + # # over elements, and API calls will be issued to fetch pages as needed. + # result.each do |item| + # # Each element is of type ::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::Rollout. + # p item + # end + # + def list_rollouts request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::ListRolloutsRequest + + # Converts hash 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_rollouts.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::SaasPlatform::SaasServiceMgmt::V1beta1::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_rollouts.timeout, + metadata: metadata, + retry_policy: @config.rpcs.list_rollouts.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @saas_rollouts_stub.call_rpc :list_rollouts, request, options: options do |response, operation| + response = ::Gapic::PagedEnumerable.new @saas_rollouts_stub, :list_rollouts, 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 + + ## + # Retrieve a single rollout. + # + # @overload get_rollout(request, options = nil) + # Pass arguments to `get_rollout` via a request object, either of type + # {::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::GetRolloutRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::GetRolloutRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_rollout(name: nil) + # Pass arguments to `get_rollout` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param name [::String] + # Required. The resource name of the resource within a service. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::Rollout] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::Rollout] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/saas_platform/saas_service_mgmt/v1beta1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::SaasRollouts::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::GetRolloutRequest.new + # + # # Call the get_rollout method. + # result = client.get_rollout request + # + # # The returned object is of type Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::Rollout. + # p result + # + def get_rollout request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::GetRolloutRequest + + # Converts hash 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_rollout.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::SaasPlatform::SaasServiceMgmt::V1beta1::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_rollout.timeout, + metadata: metadata, + retry_policy: @config.rpcs.get_rollout.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @saas_rollouts_stub.call_rpc :get_rollout, 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 + + ## + # Create a new rollout. + # + # @overload create_rollout(request, options = nil) + # Pass arguments to `create_rollout` via a request object, either of type + # {::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::CreateRolloutRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::CreateRolloutRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_rollout(parent: nil, rollout_id: nil, rollout: nil, validate_only: nil, request_id: nil) + # Pass arguments to `create_rollout` via keyword arguments. Note that at + # least one keyword argument is 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 of the rollout. + # @param rollout_id [::String] + # Required. The ID value for the new rollout. + # @param rollout [::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::Rollout, ::Hash] + # Required. The desired state for the rollout. + # @param validate_only [::Boolean] + # If "validate_only" is set to true, the service will try to validate + # that this request would succeed, but will not actually make changes. + # @param request_id [::String] + # An optional request ID to identify requests. Specify a unique request ID + # so that if you must retry your request, the server will know to ignore + # the request if it has already been completed. The server will guarantee + # that for at least 60 minutes since the first request. + # + # For example, consider a situation where you make an initial request and the + # request times out. If you make the request again with the same request + # ID, the server can check if original operation with the same request ID + # was received, and if so, will ignore the second request. This prevents + # clients from accidentally creating duplicate commitments. + # + # The request ID must be a valid UUID with the exception that zero UUID is + # not supported (00000000-0000-0000-0000-000000000000). + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::Rollout] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::Rollout] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/saas_platform/saas_service_mgmt/v1beta1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::SaasRollouts::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::CreateRolloutRequest.new + # + # # Call the create_rollout method. + # result = client.create_rollout request + # + # # The returned object is of type Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::Rollout. + # p result + # + def create_rollout request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::CreateRolloutRequest + + # Converts hash 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_rollout.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::SaasPlatform::SaasServiceMgmt::V1beta1::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_rollout.timeout, + metadata: metadata, + retry_policy: @config.rpcs.create_rollout.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @saas_rollouts_stub.call_rpc :create_rollout, 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 + + ## + # Update a single rollout. + # + # @overload update_rollout(request, options = nil) + # Pass arguments to `update_rollout` via a request object, either of type + # {::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::UpdateRolloutRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::UpdateRolloutRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_rollout(rollout: nil, validate_only: nil, request_id: nil, update_mask: nil) + # Pass arguments to `update_rollout` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param rollout [::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::Rollout, ::Hash] + # Required. The desired state for the rollout. + # @param validate_only [::Boolean] + # If "validate_only" is set to true, the service will try to validate + # that this request would succeed, but will not actually make changes. + # @param request_id [::String] + # An optional request ID to identify requests. Specify a unique request ID + # so that if you must retry your request, the server will know to ignore + # the request if it has already been completed. The server will guarantee + # that for at least 60 minutes since the first request. + # + # For example, consider a situation where you make an initial request and the + # request times out. If you make the request again with the same request + # ID, the server can check if original operation with the same request ID + # was received, and if so, will ignore the second request. This prevents + # clients from accidentally creating duplicate commitments. + # + # The request ID must be a valid UUID with the exception that zero UUID is + # not supported (00000000-0000-0000-0000-000000000000). + # @param update_mask [::Google::Protobuf::FieldMask, ::Hash] + # Field mask is used to specify the fields to be overwritten in the + # Rollout resource by the update. + # + # The fields specified in the update_mask are relative to the resource, not + # the full request. A field will be overwritten if it is in the mask. + # + # If the user does not provide a mask then all fields in the + # Rollout will be overwritten. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::Rollout] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::Rollout] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/saas_platform/saas_service_mgmt/v1beta1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::SaasRollouts::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::UpdateRolloutRequest.new + # + # # Call the update_rollout method. + # result = client.update_rollout request + # + # # The returned object is of type Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::Rollout. + # p result + # + def update_rollout request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::UpdateRolloutRequest + + # Converts hash 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_rollout.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::SaasPlatform::SaasServiceMgmt::V1beta1::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.rollout&.name + header_params["rollout.name"] = request.rollout.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_rollout.timeout, + metadata: metadata, + retry_policy: @config.rpcs.update_rollout.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @saas_rollouts_stub.call_rpc :update_rollout, 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 + + ## + # Delete a single rollout. + # + # @overload delete_rollout(request, options = nil) + # Pass arguments to `delete_rollout` via a request object, either of type + # {::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::DeleteRolloutRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::DeleteRolloutRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_rollout(name: nil, etag: nil, validate_only: nil, request_id: nil) + # Pass arguments to `delete_rollout` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param name [::String] + # Required. The resource name of the resource within a service. + # @param etag [::String] + # The etag known to the client for the expected state of the rollout. This is + # used with state-changing methods to prevent accidental overwrites when + # multiple user agents might be acting in parallel on the same resource. + # + # An etag wildcard provide optimistic concurrency based on the expected + # existence of the rollout. The Any wildcard (`*`) requires that the resource + # must already exists, and the Not Any wildcard (`!*`) requires that it must + # not. + # @param validate_only [::Boolean] + # If "validate_only" is set to true, the service will try to validate + # that this request would succeed, but will not actually make changes. + # @param request_id [::String] + # An optional request ID to identify requests. Specify a unique request ID + # so that if you must retry your request, the server will know to ignore + # the request if it has already been completed. The server will guarantee + # that for at least 60 minutes since the first request. + # + # For example, consider a situation where you make an initial request and the + # request times out. If you make the request again with the same request + # ID, the server can check if original operation with the same request ID + # was received, and if so, will ignore the second request. This prevents + # clients from accidentally creating duplicate commitments. + # + # The request ID must be a valid UUID with the exception that zero UUID is + # not supported (00000000-0000-0000-0000-000000000000). + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Google::Protobuf::Empty] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Google::Protobuf::Empty] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/saas_platform/saas_service_mgmt/v1beta1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::SaasRollouts::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::DeleteRolloutRequest.new + # + # # Call the delete_rollout method. + # result = client.delete_rollout request + # + # # The returned object is of type Google::Protobuf::Empty. + # p result + # + def delete_rollout request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::DeleteRolloutRequest + + # Converts hash 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_rollout.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::SaasPlatform::SaasServiceMgmt::V1beta1::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_rollout.timeout, + metadata: metadata, + retry_policy: @config.rpcs.delete_rollout.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @saas_rollouts_stub.call_rpc :delete_rollout, 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 + + ## + # Retrieve a collection of rollout kinds. + # + # @overload list_rollout_kinds(request, options = nil) + # Pass arguments to `list_rollout_kinds` via a request object, either of type + # {::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::ListRolloutKindsRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::ListRolloutKindsRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_rollout_kinds(parent: nil, page_size: nil, page_token: nil, filter: nil, order_by: nil) + # Pass arguments to `list_rollout_kinds` via keyword arguments. Note that at + # least one keyword argument is 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 of the rollout kind. + # @param page_size [::Integer] + # The maximum number of rollout kinds to send per page. + # @param page_token [::String] + # The page token: If the next_page_token from a previous response + # is provided, this request will send the subsequent page. + # @param filter [::String] + # Filter the list as specified in https://google.aip.dev/160. + # @param order_by [::String] + # Order results as specified in https://google.aip.dev/132. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Gapic::PagedEnumerable<::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::RolloutKind>] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Gapic::PagedEnumerable<::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::RolloutKind>] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/saas_platform/saas_service_mgmt/v1beta1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::SaasRollouts::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::ListRolloutKindsRequest.new + # + # # Call the list_rollout_kinds method. + # result = client.list_rollout_kinds request + # + # # The returned object is of type Gapic::PagedEnumerable. You can iterate + # # over elements, and API calls will be issued to fetch pages as needed. + # result.each do |item| + # # Each element is of type ::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::RolloutKind. + # p item + # end + # + def list_rollout_kinds request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::ListRolloutKindsRequest + + # Converts hash 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_rollout_kinds.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::SaasPlatform::SaasServiceMgmt::V1beta1::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_rollout_kinds.timeout, + metadata: metadata, + retry_policy: @config.rpcs.list_rollout_kinds.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @saas_rollouts_stub.call_rpc :list_rollout_kinds, request, options: options do |response, operation| + response = ::Gapic::PagedEnumerable.new @saas_rollouts_stub, :list_rollout_kinds, 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 + + ## + # Retrieve a single rollout kind. + # + # @overload get_rollout_kind(request, options = nil) + # Pass arguments to `get_rollout_kind` via a request object, either of type + # {::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::GetRolloutKindRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::GetRolloutKindRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_rollout_kind(name: nil) + # Pass arguments to `get_rollout_kind` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param name [::String] + # Required. The resource name of the resource within a service. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::RolloutKind] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::RolloutKind] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/saas_platform/saas_service_mgmt/v1beta1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::SaasRollouts::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::GetRolloutKindRequest.new + # + # # Call the get_rollout_kind method. + # result = client.get_rollout_kind request + # + # # The returned object is of type Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::RolloutKind. + # p result + # + def get_rollout_kind request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::GetRolloutKindRequest + + # Converts hash 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_rollout_kind.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::SaasPlatform::SaasServiceMgmt::V1beta1::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_rollout_kind.timeout, + metadata: metadata, + retry_policy: @config.rpcs.get_rollout_kind.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @saas_rollouts_stub.call_rpc :get_rollout_kind, 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 + + ## + # Create a new rollout kind. + # + # @overload create_rollout_kind(request, options = nil) + # Pass arguments to `create_rollout_kind` via a request object, either of type + # {::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::CreateRolloutKindRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::CreateRolloutKindRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_rollout_kind(parent: nil, rollout_kind_id: nil, rollout_kind: nil, validate_only: nil, request_id: nil) + # Pass arguments to `create_rollout_kind` via keyword arguments. Note that at + # least one keyword argument is 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 of the rollout kind. + # @param rollout_kind_id [::String] + # Required. The ID value for the new rollout kind. + # @param rollout_kind [::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::RolloutKind, ::Hash] + # Required. The desired state for the rollout kind. + # @param validate_only [::Boolean] + # If "validate_only" is set to true, the service will try to validate + # that this request would succeed, but will not actually make changes. + # @param request_id [::String] + # An optional request ID to identify requests. Specify a unique request ID + # so that if you must retry your request, the server will know to ignore + # the request if it has already been completed. The server will guarantee + # that for at least 60 minutes since the first request. + # + # For example, consider a situation where you make an initial request and the + # request times out. If you make the request again with the same request + # ID, the server can check if original operation with the same request ID + # was received, and if so, will ignore the second request. This prevents + # clients from accidentally creating duplicate commitments. + # + # The request ID must be a valid UUID with the exception that zero UUID is + # not supported (00000000-0000-0000-0000-000000000000). + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::RolloutKind] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::RolloutKind] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/saas_platform/saas_service_mgmt/v1beta1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::SaasRollouts::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::CreateRolloutKindRequest.new + # + # # Call the create_rollout_kind method. + # result = client.create_rollout_kind request + # + # # The returned object is of type Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::RolloutKind. + # p result + # + def create_rollout_kind request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::CreateRolloutKindRequest + + # Converts hash 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_rollout_kind.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::SaasPlatform::SaasServiceMgmt::V1beta1::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_rollout_kind.timeout, + metadata: metadata, + retry_policy: @config.rpcs.create_rollout_kind.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @saas_rollouts_stub.call_rpc :create_rollout_kind, 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 + + ## + # Update a single rollout kind. + # + # @overload update_rollout_kind(request, options = nil) + # Pass arguments to `update_rollout_kind` via a request object, either of type + # {::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::UpdateRolloutKindRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::UpdateRolloutKindRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_rollout_kind(rollout_kind: nil, validate_only: nil, request_id: nil, update_mask: nil) + # Pass arguments to `update_rollout_kind` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param rollout_kind [::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::RolloutKind, ::Hash] + # Required. The desired state for the rollout kind. + # @param validate_only [::Boolean] + # If "validate_only" is set to true, the service will try to validate + # that this request would succeed, but will not actually make changes. + # @param request_id [::String] + # An optional request ID to identify requests. Specify a unique request ID + # so that if you must retry your request, the server will know to ignore + # the request if it has already been completed. The server will guarantee + # that for at least 60 minutes since the first request. + # + # For example, consider a situation where you make an initial request and the + # request times out. If you make the request again with the same request + # ID, the server can check if original operation with the same request ID + # was received, and if so, will ignore the second request. This prevents + # clients from accidentally creating duplicate commitments. + # + # The request ID must be a valid UUID with the exception that zero UUID is + # not supported (00000000-0000-0000-0000-000000000000). + # @param update_mask [::Google::Protobuf::FieldMask, ::Hash] + # Field mask is used to specify the fields to be overwritten in the + # RolloutKind resource by the update. + # + # The fields specified in the update_mask are relative to the resource, not + # the full request. A field will be overwritten if it is in the mask. + # + # If the user does not provide a mask then all fields in the + # RolloutKind will be overwritten. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::RolloutKind] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::RolloutKind] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/saas_platform/saas_service_mgmt/v1beta1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::SaasRollouts::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::UpdateRolloutKindRequest.new + # + # # Call the update_rollout_kind method. + # result = client.update_rollout_kind request + # + # # The returned object is of type Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::RolloutKind. + # p result + # + def update_rollout_kind request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::UpdateRolloutKindRequest + + # Converts hash 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_rollout_kind.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::SaasPlatform::SaasServiceMgmt::V1beta1::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.rollout_kind&.name + header_params["rollout_kind.name"] = request.rollout_kind.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_rollout_kind.timeout, + metadata: metadata, + retry_policy: @config.rpcs.update_rollout_kind.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @saas_rollouts_stub.call_rpc :update_rollout_kind, 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 + + ## + # Delete a single rollout kind. + # + # @overload delete_rollout_kind(request, options = nil) + # Pass arguments to `delete_rollout_kind` via a request object, either of type + # {::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::DeleteRolloutKindRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::DeleteRolloutKindRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_rollout_kind(name: nil, etag: nil, validate_only: nil, request_id: nil) + # Pass arguments to `delete_rollout_kind` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param name [::String] + # Required. The resource name of the resource within a service. + # @param etag [::String] + # The etag known to the client for the expected state of the rollout kind. + # This is used with state-changing methods to prevent accidental overwrites + # when multiple user agents might be acting in parallel on the same resource. + # + # An etag wildcard provide optimistic concurrency based on the expected + # existence of the rollout kind. The Any wildcard (`*`) requires that the + # resource must already exists, and the Not Any wildcard (`!*`) requires that + # it must not. + # @param validate_only [::Boolean] + # If "validate_only" is set to true, the service will try to validate + # that this request would succeed, but will not actually make changes. + # @param request_id [::String] + # An optional request ID to identify requests. Specify a unique request ID + # so that if you must retry your request, the server will know to ignore + # the request if it has already been completed. The server will guarantee + # that for at least 60 minutes since the first request. + # + # For example, consider a situation where you make an initial request and the + # request times out. If you make the request again with the same request + # ID, the server can check if original operation with the same request ID + # was received, and if so, will ignore the second request. This prevents + # clients from accidentally creating duplicate commitments. + # + # The request ID must be a valid UUID with the exception that zero UUID is + # not supported (00000000-0000-0000-0000-000000000000). + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Google::Protobuf::Empty] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Google::Protobuf::Empty] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/saas_platform/saas_service_mgmt/v1beta1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::SaasRollouts::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::DeleteRolloutKindRequest.new + # + # # Call the delete_rollout_kind method. + # result = client.delete_rollout_kind request + # + # # The returned object is of type Google::Protobuf::Empty. + # p result + # + def delete_rollout_kind request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::DeleteRolloutKindRequest + + # Converts hash 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_rollout_kind.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::SaasPlatform::SaasServiceMgmt::V1beta1::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_rollout_kind.timeout, + metadata: metadata, + retry_policy: @config.rpcs.delete_rollout_kind.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @saas_rollouts_stub.call_rpc :delete_rollout_kind, request, options: options do |response, operation| + yield response, operation if block_given? + end + rescue ::GRPC::BadStatus => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Configuration class for the SaasRollouts API. + # + # This class represents the configuration for SaasRollouts, + # providing control over timeouts, retry behavior, logging, transport + # parameters, and other low-level controls. Certain parameters can also be + # applied individually to specific RPCs. See + # {::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::SaasRollouts::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_rollouts to 20 seconds, + # # and all remaining timeouts to 10 seconds. + # ::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::SaasRollouts::Client.configure do |config| + # config.timeout = 10.0 + # config.rpcs.list_rollouts.timeout = 20.0 + # end + # + # # Apply the above configuration only to a new client. + # client = ::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::SaasRollouts::Client.new do |config| + # config.timeout = 10.0 + # config.rpcs.list_rollouts.timeout = 20.0 + # end + # + # @!attribute [rw] endpoint + # A custom service endpoint, as a hostname or hostname:port. The default is + # nil, indicating to use the default endpoint in the current universe domain. + # @return [::String,nil] + # @!attribute [rw] credentials + # Credentials to send with calls. You may provide any of the following types: + # * (`Google::Auth::Credentials`) A googleauth credentials object + # (see the [googleauth docs](https://rubydoc.info/gems/googleauth/Google/Auth/Credentials)) + # * (`Signet::OAuth2::Client`) A signet oauth2 client object + # (see the [signet docs](https://rubydoc.info/gems/signet/Signet/OAuth2/Client)) + # * (`GRPC::Core::Channel`) a gRPC channel with included credentials + # * (`GRPC::Core::ChannelCredentials`) a gRPC credentails object + # * (`nil`) indicating no credentials + # + # @note Warning: Passing a `String` to a keyfile path or a `Hash` of credentials + # is deprecated. Providing an unvalidated credential configuration to + # Google APIs can compromise the security of your systems and data. + # + # @example + # + # # The recommended way to provide credentials is to use the `make_creds` method + # # on the appropriate credentials class for your environment. + # + # require "googleauth" + # + # credentials = ::Google::Auth::ServiceAccountCredentials.make_creds( + # json_key_io: ::File.open("/path/to/keyfile.json") + # ) + # + # client = ::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::SaasRollouts::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 = "saasservicemgmt.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 SaasRollouts 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_rollouts` + # @return [::Gapic::Config::Method] + # + attr_reader :list_rollouts + ## + # RPC-specific configuration for `get_rollout` + # @return [::Gapic::Config::Method] + # + attr_reader :get_rollout + ## + # RPC-specific configuration for `create_rollout` + # @return [::Gapic::Config::Method] + # + attr_reader :create_rollout + ## + # RPC-specific configuration for `update_rollout` + # @return [::Gapic::Config::Method] + # + attr_reader :update_rollout + ## + # RPC-specific configuration for `delete_rollout` + # @return [::Gapic::Config::Method] + # + attr_reader :delete_rollout + ## + # RPC-specific configuration for `list_rollout_kinds` + # @return [::Gapic::Config::Method] + # + attr_reader :list_rollout_kinds + ## + # RPC-specific configuration for `get_rollout_kind` + # @return [::Gapic::Config::Method] + # + attr_reader :get_rollout_kind + ## + # RPC-specific configuration for `create_rollout_kind` + # @return [::Gapic::Config::Method] + # + attr_reader :create_rollout_kind + ## + # RPC-specific configuration for `update_rollout_kind` + # @return [::Gapic::Config::Method] + # + attr_reader :update_rollout_kind + ## + # RPC-specific configuration for `delete_rollout_kind` + # @return [::Gapic::Config::Method] + # + attr_reader :delete_rollout_kind + + # @private + def initialize parent_rpcs = nil + list_rollouts_config = parent_rpcs.list_rollouts if parent_rpcs.respond_to? :list_rollouts + @list_rollouts = ::Gapic::Config::Method.new list_rollouts_config + get_rollout_config = parent_rpcs.get_rollout if parent_rpcs.respond_to? :get_rollout + @get_rollout = ::Gapic::Config::Method.new get_rollout_config + create_rollout_config = parent_rpcs.create_rollout if parent_rpcs.respond_to? :create_rollout + @create_rollout = ::Gapic::Config::Method.new create_rollout_config + update_rollout_config = parent_rpcs.update_rollout if parent_rpcs.respond_to? :update_rollout + @update_rollout = ::Gapic::Config::Method.new update_rollout_config + delete_rollout_config = parent_rpcs.delete_rollout if parent_rpcs.respond_to? :delete_rollout + @delete_rollout = ::Gapic::Config::Method.new delete_rollout_config + list_rollout_kinds_config = parent_rpcs.list_rollout_kinds if parent_rpcs.respond_to? :list_rollout_kinds + @list_rollout_kinds = ::Gapic::Config::Method.new list_rollout_kinds_config + get_rollout_kind_config = parent_rpcs.get_rollout_kind if parent_rpcs.respond_to? :get_rollout_kind + @get_rollout_kind = ::Gapic::Config::Method.new get_rollout_kind_config + create_rollout_kind_config = parent_rpcs.create_rollout_kind if parent_rpcs.respond_to? :create_rollout_kind + @create_rollout_kind = ::Gapic::Config::Method.new create_rollout_kind_config + update_rollout_kind_config = parent_rpcs.update_rollout_kind if parent_rpcs.respond_to? :update_rollout_kind + @update_rollout_kind = ::Gapic::Config::Method.new update_rollout_kind_config + delete_rollout_kind_config = parent_rpcs.delete_rollout_kind if parent_rpcs.respond_to? :delete_rollout_kind + @delete_rollout_kind = ::Gapic::Config::Method.new delete_rollout_kind_config + + yield self if block_given? + end + end + end + end + end + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-saas_platform-saas_service_mgmt-v1beta1/lib/google/cloud/saas_platform/saas_service_mgmt/v1beta1/saas_rollouts/credentials.rb b/owl-bot-staging/google-cloud-saas_platform-saas_service_mgmt-v1beta1/lib/google/cloud/saas_platform/saas_service_mgmt/v1beta1/saas_rollouts/credentials.rb new file mode 100644 index 000000000000..120f664d6639 --- /dev/null +++ b/owl-bot-staging/google-cloud-saas_platform-saas_service_mgmt-v1beta1/lib/google/cloud/saas_platform/saas_service_mgmt/v1beta1/saas_rollouts/credentials.rb @@ -0,0 +1,49 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +require "googleauth" + +module Google + module Cloud + module SaasPlatform + module SaasServiceMgmt + module V1beta1 + module SaasRollouts + # Credentials for the SaasRollouts API. + class Credentials < ::Google::Auth::Credentials + self.scope = [ + "https://www.googleapis.com/auth/cloud-platform" + ] + self.env_vars = [ + "GOOGLE_CLOUD_CREDENTIALS", + "GOOGLE_CLOUD_KEYFILE", + "GCLOUD_KEYFILE", + "GOOGLE_CLOUD_CREDENTIALS_JSON", + "GOOGLE_CLOUD_KEYFILE_JSON", + "GCLOUD_KEYFILE_JSON" + ] + self.paths = [ + "~/.config/google_cloud/application_default_credentials.json" + ] + end + end + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-saas_platform-saas_service_mgmt-v1beta1/lib/google/cloud/saas_platform/saas_service_mgmt/v1beta1/saas_rollouts/paths.rb b/owl-bot-staging/google-cloud-saas_platform-saas_service_mgmt-v1beta1/lib/google/cloud/saas_platform/saas_service_mgmt/v1beta1/saas_rollouts/paths.rb new file mode 100644 index 000000000000..3e94a7b7305c --- /dev/null +++ b/owl-bot-staging/google-cloud-saas_platform-saas_service_mgmt-v1beta1/lib/google/cloud/saas_platform/saas_service_mgmt/v1beta1/saas_rollouts/paths.rb @@ -0,0 +1,128 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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 SaasPlatform + module SaasServiceMgmt + module V1beta1 + module SaasRollouts + # Path helper methods for the SaasRollouts API. + module Paths + ## + # Create a fully-qualified Location resource string. + # + # The resource will be in the following format: + # + # `projects/{project}/locations/{location}` + # + # @param project [String] + # @param location [String] + # + # @return [::String] + def location_path project:, location: + raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" + + "projects/#{project}/locations/#{location}" + end + + ## + # Create a fully-qualified Release resource string. + # + # The resource will be in the following format: + # + # `projects/{project}/locations/{location}/releases/{release}` + # + # @param project [String] + # @param location [String] + # @param release [String] + # + # @return [::String] + def release_path project:, location:, release: + raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" + raise ::ArgumentError, "location cannot contain /" if location.to_s.include? "/" + + "projects/#{project}/locations/#{location}/releases/#{release}" + end + + ## + # Create a fully-qualified Rollout resource string. + # + # The resource will be in the following format: + # + # `projects/{project}/locations/{location}/rollouts/{rollout_id}` + # + # @param project [String] + # @param location [String] + # @param rollout_id [String] + # + # @return [::String] + def rollout_path project:, location:, rollout_id: + raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" + raise ::ArgumentError, "location cannot contain /" if location.to_s.include? "/" + + "projects/#{project}/locations/#{location}/rollouts/#{rollout_id}" + end + + ## + # Create a fully-qualified RolloutKind resource string. + # + # The resource will be in the following format: + # + # `projects/{project}/locations/{location}/rolloutKinds/{rollout_kind_id}` + # + # @param project [String] + # @param location [String] + # @param rollout_kind_id [String] + # + # @return [::String] + def rollout_kind_path project:, location:, rollout_kind_id: + raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" + raise ::ArgumentError, "location cannot contain /" if location.to_s.include? "/" + + "projects/#{project}/locations/#{location}/rolloutKinds/#{rollout_kind_id}" + end + + ## + # Create a fully-qualified UnitKind resource string. + # + # The resource will be in the following format: + # + # `projects/{project}/locations/{location}/unitKinds/{unit_kind}` + # + # @param project [String] + # @param location [String] + # @param unit_kind [String] + # + # @return [::String] + def unit_kind_path project:, location:, unit_kind: + raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" + raise ::ArgumentError, "location cannot contain /" if location.to_s.include? "/" + + "projects/#{project}/locations/#{location}/unitKinds/#{unit_kind}" + end + + extend self + end + end + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-saas_platform-saas_service_mgmt-v1beta1/lib/google/cloud/saas_platform/saas_service_mgmt/v1beta1/saas_rollouts/rest.rb b/owl-bot-staging/google-cloud-saas_platform-saas_service_mgmt-v1beta1/lib/google/cloud/saas_platform/saas_service_mgmt/v1beta1/saas_rollouts/rest.rb new file mode 100644 index 000000000000..d93824138b96 --- /dev/null +++ b/owl-bot-staging/google-cloud-saas_platform-saas_service_mgmt-v1beta1/lib/google/cloud/saas_platform/saas_service_mgmt/v1beta1/saas_rollouts/rest.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/rest" +require "gapic/config" +require "gapic/config/method" + +require "google/cloud/saas_platform/saas_service_mgmt/v1beta1/version" +require "google/cloud/saas_platform/saas_service_mgmt/v1beta1/bindings_override" + +require "google/cloud/saas_platform/saas_service_mgmt/v1beta1/saas_rollouts/credentials" +require "google/cloud/saas_platform/saas_service_mgmt/v1beta1/saas_rollouts/paths" +require "google/cloud/saas_platform/saas_service_mgmt/v1beta1/saas_rollouts/rest/client" + +module Google + module Cloud + module SaasPlatform + module SaasServiceMgmt + module V1beta1 + ## + # Manages the rollout of SaaS services. + # + # To load this service and instantiate a REST client: + # + # require "google/cloud/saas_platform/saas_service_mgmt/v1beta1/saas_rollouts/rest" + # client = ::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::SaasRollouts::Rest::Client.new + # + module SaasRollouts + # Client for the REST transport + module Rest + end + end + end + end + end + end +end + +helper_path = ::File.join __dir__, "rest", "helpers.rb" +require "google/cloud/saas_platform/saas_service_mgmt/v1beta1/saas_rollouts/rest/helpers" if ::File.file? helper_path diff --git a/owl-bot-staging/google-cloud-saas_platform-saas_service_mgmt-v1beta1/lib/google/cloud/saas_platform/saas_service_mgmt/v1beta1/saas_rollouts/rest/client.rb b/owl-bot-staging/google-cloud-saas_platform-saas_service_mgmt-v1beta1/lib/google/cloud/saas_platform/saas_service_mgmt/v1beta1/saas_rollouts/rest/client.rb new file mode 100644 index 000000000000..9b51fa8ce98a --- /dev/null +++ b/owl-bot-staging/google-cloud-saas_platform-saas_service_mgmt-v1beta1/lib/google/cloud/saas_platform/saas_service_mgmt/v1beta1/saas_rollouts/rest/client.rb @@ -0,0 +1,1429 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +require "google/cloud/errors" +require "google/cloud/saasplatform/saasservicemgmt/v1beta1/rollouts_service_pb" +require "google/cloud/saas_platform/saas_service_mgmt/v1beta1/saas_rollouts/rest/service_stub" +require "google/cloud/location/rest" + +module Google + module Cloud + module SaasPlatform + module SaasServiceMgmt + module V1beta1 + module SaasRollouts + module Rest + ## + # REST client for the SaasRollouts service. + # + # Manages the rollout of SaaS services. + # + class Client + # @private + API_VERSION = "" + + # @private + DEFAULT_ENDPOINT_TEMPLATE = "saasservicemgmt.$UNIVERSE_DOMAIN$" + + include Paths + + # @private + attr_reader :saas_rollouts_stub + + ## + # Configure the SaasRollouts Client class. + # + # See {::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::SaasRollouts::Rest::Client::Configuration} + # for a description of the configuration fields. + # + # @example + # + # # Modify the configuration for all SaasRollouts clients + # ::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::SaasRollouts::Rest::Client.configure do |config| + # config.timeout = 10.0 + # end + # + # @yield [config] Configure the Client client. + # @yieldparam config [Client::Configuration] + # + # @return [Client::Configuration] + # + def self.configure + @configure ||= begin + namespace = ["Google", "Cloud", "SaasPlatform", "SaasServiceMgmt", "V1beta1"] + parent_config = while namespace.any? + parent_name = namespace.join "::" + parent_const = const_get parent_name + break parent_const.configure if parent_const.respond_to? :configure + namespace.pop + end + default_config = Client::Configuration.new parent_config + + default_config.rpcs.list_rollouts.timeout = 60.0 + default_config.rpcs.list_rollouts.retry_policy = { + initial_delay: 1.0, max_delay: 10.0, multiplier: 1.3, retry_codes: [14] + } + + default_config.rpcs.get_rollout.timeout = 60.0 + default_config.rpcs.get_rollout.retry_policy = { + initial_delay: 1.0, max_delay: 10.0, multiplier: 1.3, retry_codes: [14] + } + + default_config.rpcs.create_rollout.timeout = 60.0 + + default_config.rpcs.update_rollout.timeout = 60.0 + + default_config.rpcs.delete_rollout.timeout = 540.0 + default_config.rpcs.delete_rollout.retry_policy = { + initial_delay: 1.0, max_delay: 10.0, multiplier: 1.3, retry_codes: [14] + } + + default_config.rpcs.list_rollout_kinds.timeout = 60.0 + default_config.rpcs.list_rollout_kinds.retry_policy = { + initial_delay: 1.0, max_delay: 10.0, multiplier: 1.3, retry_codes: [14] + } + + default_config.rpcs.get_rollout_kind.timeout = 60.0 + default_config.rpcs.get_rollout_kind.retry_policy = { + initial_delay: 1.0, max_delay: 10.0, multiplier: 1.3, retry_codes: [14] + } + + default_config.rpcs.create_rollout_kind.timeout = 60.0 + + default_config.rpcs.update_rollout_kind.timeout = 60.0 + + default_config.rpcs.delete_rollout_kind.timeout = 60.0 + default_config.rpcs.delete_rollout_kind.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 SaasRollouts Client instance. + # + # The configuration is set to the derived mode, meaning that values can be changed, + # but structural changes (adding new fields, etc.) are not allowed. Structural changes + # should be made on {Client.configure}. + # + # See {::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::SaasRollouts::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 + @saas_rollouts_stub.universe_domain + end + + ## + # Create a new SaasRollouts REST client object. + # + # @example + # + # # Create a client using the default configuration + # client = ::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::SaasRollouts::Rest::Client.new + # + # # Create a client using a custom configuration + # client = ::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::SaasRollouts::Rest::Client.new do |config| + # config.timeout = 10.0 + # end + # + # @yield [config] Configure the SaasRollouts 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 + + @saas_rollouts_stub = ::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::SaasRollouts::Rest::ServiceStub.new( + endpoint: @config.endpoint, + endpoint_template: DEFAULT_ENDPOINT_TEMPLATE, + universe_domain: @config.universe_domain, + credentials: credentials, + logger: @config.logger + ) + + @saas_rollouts_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 = @saas_rollouts_stub.endpoint + config.universe_domain = @saas_rollouts_stub.universe_domain + config.bindings_override = @config.bindings_override + config.logger = @saas_rollouts_stub.logger if config.respond_to? :logger= + end + end + + ## + # Get the associated client for mix-in of the Locations. + # + # @return [Google::Cloud::Location::Locations::Rest::Client] + # + attr_reader :location_client + + ## + # The logger used for request/response debug logging. + # + # @return [Logger] + # + def logger + @saas_rollouts_stub.logger + end + + # Service calls + + ## + # Retrieve a collection of rollouts. + # + # @overload list_rollouts(request, options = nil) + # Pass arguments to `list_rollouts` via a request object, either of type + # {::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::ListRolloutsRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::ListRolloutsRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_rollouts(parent: nil, page_size: nil, page_token: nil, filter: nil, order_by: nil) + # Pass arguments to `list_rollouts` via keyword arguments. Note that at + # least one keyword argument is 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 of the rollout. + # @param page_size [::Integer] + # The maximum number of rollouts to send per page. + # @param page_token [::String] + # The page token: If the next_page_token from a previous response + # is provided, this request will send the subsequent page. + # @param filter [::String] + # Filter the list as specified in https://google.aip.dev/160. + # @param order_by [::String] + # Order results as specified in https://google.aip.dev/132. + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Gapic::Rest::PagedEnumerable<::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::Rollout>] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Gapic::Rest::PagedEnumerable<::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::Rollout>] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/saas_platform/saas_service_mgmt/v1beta1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::SaasRollouts::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::ListRolloutsRequest.new + # + # # Call the list_rollouts method. + # result = client.list_rollouts request + # + # # The returned object is of type Gapic::PagedEnumerable. You can iterate + # # over elements, and API calls will be issued to fetch pages as needed. + # result.each do |item| + # # Each element is of type ::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::Rollout. + # p item + # end + # + def list_rollouts request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::ListRolloutsRequest + + # Converts hash 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_rollouts.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::SaasPlatform::SaasServiceMgmt::V1beta1::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_rollouts.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.list_rollouts.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @saas_rollouts_stub.list_rollouts request, options do |result, operation| + result = ::Gapic::Rest::PagedEnumerable.new @saas_rollouts_stub, :list_rollouts, "rollouts", 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 + + ## + # Retrieve a single rollout. + # + # @overload get_rollout(request, options = nil) + # Pass arguments to `get_rollout` via a request object, either of type + # {::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::GetRolloutRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::GetRolloutRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_rollout(name: nil) + # Pass arguments to `get_rollout` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param name [::String] + # Required. The resource name of the resource within a service. + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::Rollout] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::Rollout] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/saas_platform/saas_service_mgmt/v1beta1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::SaasRollouts::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::GetRolloutRequest.new + # + # # Call the get_rollout method. + # result = client.get_rollout request + # + # # The returned object is of type Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::Rollout. + # p result + # + def get_rollout request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::GetRolloutRequest + + # Converts hash 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_rollout.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::SaasPlatform::SaasServiceMgmt::V1beta1::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_rollout.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.get_rollout.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @saas_rollouts_stub.get_rollout 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 + + ## + # Create a new rollout. + # + # @overload create_rollout(request, options = nil) + # Pass arguments to `create_rollout` via a request object, either of type + # {::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::CreateRolloutRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::CreateRolloutRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_rollout(parent: nil, rollout_id: nil, rollout: nil, validate_only: nil, request_id: nil) + # Pass arguments to `create_rollout` via keyword arguments. Note that at + # least one keyword argument is 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 of the rollout. + # @param rollout_id [::String] + # Required. The ID value for the new rollout. + # @param rollout [::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::Rollout, ::Hash] + # Required. The desired state for the rollout. + # @param validate_only [::Boolean] + # If "validate_only" is set to true, the service will try to validate + # that this request would succeed, but will not actually make changes. + # @param request_id [::String] + # An optional request ID to identify requests. Specify a unique request ID + # so that if you must retry your request, the server will know to ignore + # the request if it has already been completed. The server will guarantee + # that for at least 60 minutes since the first request. + # + # For example, consider a situation where you make an initial request and the + # request times out. If you make the request again with the same request + # ID, the server can check if original operation with the same request ID + # was received, and if so, will ignore the second request. This prevents + # clients from accidentally creating duplicate commitments. + # + # The request ID must be a valid UUID with the exception that zero UUID is + # not supported (00000000-0000-0000-0000-000000000000). + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::Rollout] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::Rollout] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/saas_platform/saas_service_mgmt/v1beta1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::SaasRollouts::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::CreateRolloutRequest.new + # + # # Call the create_rollout method. + # result = client.create_rollout request + # + # # The returned object is of type Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::Rollout. + # p result + # + def create_rollout request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::CreateRolloutRequest + + # Converts hash 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_rollout.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::SaasPlatform::SaasServiceMgmt::V1beta1::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_rollout.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.create_rollout.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @saas_rollouts_stub.create_rollout 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 + + ## + # Update a single rollout. + # + # @overload update_rollout(request, options = nil) + # Pass arguments to `update_rollout` via a request object, either of type + # {::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::UpdateRolloutRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::UpdateRolloutRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_rollout(rollout: nil, validate_only: nil, request_id: nil, update_mask: nil) + # Pass arguments to `update_rollout` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param rollout [::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::Rollout, ::Hash] + # Required. The desired state for the rollout. + # @param validate_only [::Boolean] + # If "validate_only" is set to true, the service will try to validate + # that this request would succeed, but will not actually make changes. + # @param request_id [::String] + # An optional request ID to identify requests. Specify a unique request ID + # so that if you must retry your request, the server will know to ignore + # the request if it has already been completed. The server will guarantee + # that for at least 60 minutes since the first request. + # + # For example, consider a situation where you make an initial request and the + # request times out. If you make the request again with the same request + # ID, the server can check if original operation with the same request ID + # was received, and if so, will ignore the second request. This prevents + # clients from accidentally creating duplicate commitments. + # + # The request ID must be a valid UUID with the exception that zero UUID is + # not supported (00000000-0000-0000-0000-000000000000). + # @param update_mask [::Google::Protobuf::FieldMask, ::Hash] + # Field mask is used to specify the fields to be overwritten in the + # Rollout resource by the update. + # + # The fields specified in the update_mask are relative to the resource, not + # the full request. A field will be overwritten if it is in the mask. + # + # If the user does not provide a mask then all fields in the + # Rollout will be overwritten. + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::Rollout] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::Rollout] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/saas_platform/saas_service_mgmt/v1beta1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::SaasRollouts::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::UpdateRolloutRequest.new + # + # # Call the update_rollout method. + # result = client.update_rollout request + # + # # The returned object is of type Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::Rollout. + # p result + # + def update_rollout request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::UpdateRolloutRequest + + # Converts hash 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_rollout.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::SaasPlatform::SaasServiceMgmt::V1beta1::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_rollout.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.update_rollout.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @saas_rollouts_stub.update_rollout 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 + + ## + # Delete a single rollout. + # + # @overload delete_rollout(request, options = nil) + # Pass arguments to `delete_rollout` via a request object, either of type + # {::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::DeleteRolloutRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::DeleteRolloutRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_rollout(name: nil, etag: nil, validate_only: nil, request_id: nil) + # Pass arguments to `delete_rollout` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param name [::String] + # Required. The resource name of the resource within a service. + # @param etag [::String] + # The etag known to the client for the expected state of the rollout. This is + # used with state-changing methods to prevent accidental overwrites when + # multiple user agents might be acting in parallel on the same resource. + # + # An etag wildcard provide optimistic concurrency based on the expected + # existence of the rollout. The Any wildcard (`*`) requires that the resource + # must already exists, and the Not Any wildcard (`!*`) requires that it must + # not. + # @param validate_only [::Boolean] + # If "validate_only" is set to true, the service will try to validate + # that this request would succeed, but will not actually make changes. + # @param request_id [::String] + # An optional request ID to identify requests. Specify a unique request ID + # so that if you must retry your request, the server will know to ignore + # the request if it has already been completed. The server will guarantee + # that for at least 60 minutes since the first request. + # + # For example, consider a situation where you make an initial request and the + # request times out. If you make the request again with the same request + # ID, the server can check if original operation with the same request ID + # was received, and if so, will ignore the second request. This prevents + # clients from accidentally creating duplicate commitments. + # + # The request ID must be a valid UUID with the exception that zero UUID is + # not supported (00000000-0000-0000-0000-000000000000). + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Protobuf::Empty] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Protobuf::Empty] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/saas_platform/saas_service_mgmt/v1beta1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::SaasRollouts::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::DeleteRolloutRequest.new + # + # # Call the delete_rollout method. + # result = client.delete_rollout request + # + # # The returned object is of type Google::Protobuf::Empty. + # p result + # + def delete_rollout request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::DeleteRolloutRequest + + # Converts hash 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_rollout.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::SaasPlatform::SaasServiceMgmt::V1beta1::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_rollout.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.delete_rollout.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @saas_rollouts_stub.delete_rollout 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 + + ## + # Retrieve a collection of rollout kinds. + # + # @overload list_rollout_kinds(request, options = nil) + # Pass arguments to `list_rollout_kinds` via a request object, either of type + # {::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::ListRolloutKindsRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::ListRolloutKindsRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_rollout_kinds(parent: nil, page_size: nil, page_token: nil, filter: nil, order_by: nil) + # Pass arguments to `list_rollout_kinds` via keyword arguments. Note that at + # least one keyword argument is 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 of the rollout kind. + # @param page_size [::Integer] + # The maximum number of rollout kinds to send per page. + # @param page_token [::String] + # The page token: If the next_page_token from a previous response + # is provided, this request will send the subsequent page. + # @param filter [::String] + # Filter the list as specified in https://google.aip.dev/160. + # @param order_by [::String] + # Order results as specified in https://google.aip.dev/132. + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Gapic::Rest::PagedEnumerable<::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::RolloutKind>] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Gapic::Rest::PagedEnumerable<::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::RolloutKind>] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/saas_platform/saas_service_mgmt/v1beta1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::SaasRollouts::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::ListRolloutKindsRequest.new + # + # # Call the list_rollout_kinds method. + # result = client.list_rollout_kinds request + # + # # The returned object is of type Gapic::PagedEnumerable. You can iterate + # # over elements, and API calls will be issued to fetch pages as needed. + # result.each do |item| + # # Each element is of type ::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::RolloutKind. + # p item + # end + # + def list_rollout_kinds request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::ListRolloutKindsRequest + + # Converts hash 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_rollout_kinds.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::SaasPlatform::SaasServiceMgmt::V1beta1::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_rollout_kinds.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.list_rollout_kinds.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @saas_rollouts_stub.list_rollout_kinds request, options do |result, operation| + result = ::Gapic::Rest::PagedEnumerable.new @saas_rollouts_stub, :list_rollout_kinds, "rollout_kinds", 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 + + ## + # Retrieve a single rollout kind. + # + # @overload get_rollout_kind(request, options = nil) + # Pass arguments to `get_rollout_kind` via a request object, either of type + # {::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::GetRolloutKindRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::GetRolloutKindRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_rollout_kind(name: nil) + # Pass arguments to `get_rollout_kind` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param name [::String] + # Required. The resource name of the resource within a service. + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::RolloutKind] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::RolloutKind] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/saas_platform/saas_service_mgmt/v1beta1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::SaasRollouts::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::GetRolloutKindRequest.new + # + # # Call the get_rollout_kind method. + # result = client.get_rollout_kind request + # + # # The returned object is of type Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::RolloutKind. + # p result + # + def get_rollout_kind request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::GetRolloutKindRequest + + # Converts hash 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_rollout_kind.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::SaasPlatform::SaasServiceMgmt::V1beta1::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_rollout_kind.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.get_rollout_kind.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @saas_rollouts_stub.get_rollout_kind 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 + + ## + # Create a new rollout kind. + # + # @overload create_rollout_kind(request, options = nil) + # Pass arguments to `create_rollout_kind` via a request object, either of type + # {::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::CreateRolloutKindRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::CreateRolloutKindRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_rollout_kind(parent: nil, rollout_kind_id: nil, rollout_kind: nil, validate_only: nil, request_id: nil) + # Pass arguments to `create_rollout_kind` via keyword arguments. Note that at + # least one keyword argument is 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 of the rollout kind. + # @param rollout_kind_id [::String] + # Required. The ID value for the new rollout kind. + # @param rollout_kind [::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::RolloutKind, ::Hash] + # Required. The desired state for the rollout kind. + # @param validate_only [::Boolean] + # If "validate_only" is set to true, the service will try to validate + # that this request would succeed, but will not actually make changes. + # @param request_id [::String] + # An optional request ID to identify requests. Specify a unique request ID + # so that if you must retry your request, the server will know to ignore + # the request if it has already been completed. The server will guarantee + # that for at least 60 minutes since the first request. + # + # For example, consider a situation where you make an initial request and the + # request times out. If you make the request again with the same request + # ID, the server can check if original operation with the same request ID + # was received, and if so, will ignore the second request. This prevents + # clients from accidentally creating duplicate commitments. + # + # The request ID must be a valid UUID with the exception that zero UUID is + # not supported (00000000-0000-0000-0000-000000000000). + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::RolloutKind] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::RolloutKind] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/saas_platform/saas_service_mgmt/v1beta1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::SaasRollouts::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::CreateRolloutKindRequest.new + # + # # Call the create_rollout_kind method. + # result = client.create_rollout_kind request + # + # # The returned object is of type Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::RolloutKind. + # p result + # + def create_rollout_kind request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::CreateRolloutKindRequest + + # Converts hash 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_rollout_kind.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::SaasPlatform::SaasServiceMgmt::V1beta1::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_rollout_kind.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.create_rollout_kind.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @saas_rollouts_stub.create_rollout_kind 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 + + ## + # Update a single rollout kind. + # + # @overload update_rollout_kind(request, options = nil) + # Pass arguments to `update_rollout_kind` via a request object, either of type + # {::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::UpdateRolloutKindRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::UpdateRolloutKindRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_rollout_kind(rollout_kind: nil, validate_only: nil, request_id: nil, update_mask: nil) + # Pass arguments to `update_rollout_kind` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param rollout_kind [::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::RolloutKind, ::Hash] + # Required. The desired state for the rollout kind. + # @param validate_only [::Boolean] + # If "validate_only" is set to true, the service will try to validate + # that this request would succeed, but will not actually make changes. + # @param request_id [::String] + # An optional request ID to identify requests. Specify a unique request ID + # so that if you must retry your request, the server will know to ignore + # the request if it has already been completed. The server will guarantee + # that for at least 60 minutes since the first request. + # + # For example, consider a situation where you make an initial request and the + # request times out. If you make the request again with the same request + # ID, the server can check if original operation with the same request ID + # was received, and if so, will ignore the second request. This prevents + # clients from accidentally creating duplicate commitments. + # + # The request ID must be a valid UUID with the exception that zero UUID is + # not supported (00000000-0000-0000-0000-000000000000). + # @param update_mask [::Google::Protobuf::FieldMask, ::Hash] + # Field mask is used to specify the fields to be overwritten in the + # RolloutKind resource by the update. + # + # The fields specified in the update_mask are relative to the resource, not + # the full request. A field will be overwritten if it is in the mask. + # + # If the user does not provide a mask then all fields in the + # RolloutKind will be overwritten. + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::RolloutKind] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::RolloutKind] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/saas_platform/saas_service_mgmt/v1beta1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::SaasRollouts::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::UpdateRolloutKindRequest.new + # + # # Call the update_rollout_kind method. + # result = client.update_rollout_kind request + # + # # The returned object is of type Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::RolloutKind. + # p result + # + def update_rollout_kind request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::UpdateRolloutKindRequest + + # Converts hash 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_rollout_kind.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::SaasPlatform::SaasServiceMgmt::V1beta1::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_rollout_kind.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.update_rollout_kind.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @saas_rollouts_stub.update_rollout_kind 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 + + ## + # Delete a single rollout kind. + # + # @overload delete_rollout_kind(request, options = nil) + # Pass arguments to `delete_rollout_kind` via a request object, either of type + # {::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::DeleteRolloutKindRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::DeleteRolloutKindRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_rollout_kind(name: nil, etag: nil, validate_only: nil, request_id: nil) + # Pass arguments to `delete_rollout_kind` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param name [::String] + # Required. The resource name of the resource within a service. + # @param etag [::String] + # The etag known to the client for the expected state of the rollout kind. + # This is used with state-changing methods to prevent accidental overwrites + # when multiple user agents might be acting in parallel on the same resource. + # + # An etag wildcard provide optimistic concurrency based on the expected + # existence of the rollout kind. The Any wildcard (`*`) requires that the + # resource must already exists, and the Not Any wildcard (`!*`) requires that + # it must not. + # @param validate_only [::Boolean] + # If "validate_only" is set to true, the service will try to validate + # that this request would succeed, but will not actually make changes. + # @param request_id [::String] + # An optional request ID to identify requests. Specify a unique request ID + # so that if you must retry your request, the server will know to ignore + # the request if it has already been completed. The server will guarantee + # that for at least 60 minutes since the first request. + # + # For example, consider a situation where you make an initial request and the + # request times out. If you make the request again with the same request + # ID, the server can check if original operation with the same request ID + # was received, and if so, will ignore the second request. This prevents + # clients from accidentally creating duplicate commitments. + # + # The request ID must be a valid UUID with the exception that zero UUID is + # not supported (00000000-0000-0000-0000-000000000000). + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Protobuf::Empty] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Protobuf::Empty] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/saas_platform/saas_service_mgmt/v1beta1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::SaasRollouts::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::DeleteRolloutKindRequest.new + # + # # Call the delete_rollout_kind method. + # result = client.delete_rollout_kind request + # + # # The returned object is of type Google::Protobuf::Empty. + # p result + # + def delete_rollout_kind request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::DeleteRolloutKindRequest + + # Converts hash 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_rollout_kind.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::SaasPlatform::SaasServiceMgmt::V1beta1::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_rollout_kind.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.delete_rollout_kind.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @saas_rollouts_stub.delete_rollout_kind 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 SaasRollouts REST API. + # + # This class represents the configuration for SaasRollouts REST, + # providing control over timeouts, retry behavior, logging, transport + # parameters, and other low-level controls. Certain parameters can also be + # applied individually to specific RPCs. See + # {::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::SaasRollouts::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_rollouts to 20 seconds, + # # and all remaining timeouts to 10 seconds. + # ::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::SaasRollouts::Rest::Client.configure do |config| + # config.timeout = 10.0 + # config.rpcs.list_rollouts.timeout = 20.0 + # end + # + # # Apply the above configuration only to a new client. + # client = ::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::SaasRollouts::Rest::Client.new do |config| + # config.timeout = 10.0 + # config.rpcs.list_rollouts.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 = "saasservicemgmt.googleapis.com" + + config_attr :endpoint, nil, ::String, nil + config_attr :credentials, nil do |value| + allowed = [::String, ::Hash, ::Proc, ::Symbol, ::Google::Auth::Credentials, ::Google::Auth::BaseClient, ::Signet::OAuth2::Client, nil] + allowed.any? { |klass| klass === value } + end + config_attr :scope, nil, ::String, ::Array, nil + config_attr :lib_name, nil, ::String, nil + config_attr :lib_version, nil, ::String, nil + config_attr :timeout, nil, ::Numeric, nil + config_attr :metadata, nil, ::Hash, nil + config_attr :retry_policy, nil, ::Hash, ::Proc, nil + config_attr :quota_project, nil, ::String, nil + config_attr :universe_domain, nil, ::String, nil + + # @private + # Overrides for http bindings for the RPCs of this service + # are only used when this service is used as mixin, and only + # by the host service. + # @return [::Hash{::Symbol=>::Array<::Gapic::Rest::GrpcTranscoder::HttpBinding>}] + config_attr :bindings_override, {}, ::Hash, nil + config_attr :logger, :default, ::Logger, nil, :default + + # @private + def initialize parent_config = nil + @parent_config = parent_config unless parent_config.nil? + + yield self if block_given? + end + + ## + # Configurations for individual RPCs + # @return [Rpcs] + # + def rpcs + @rpcs ||= begin + parent_rpcs = nil + parent_rpcs = @parent_config.rpcs if defined?(@parent_config) && @parent_config.respond_to?(:rpcs) + Rpcs.new parent_rpcs + end + end + + ## + # Configuration RPC class for the SaasRollouts 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_rollouts` + # @return [::Gapic::Config::Method] + # + attr_reader :list_rollouts + ## + # RPC-specific configuration for `get_rollout` + # @return [::Gapic::Config::Method] + # + attr_reader :get_rollout + ## + # RPC-specific configuration for `create_rollout` + # @return [::Gapic::Config::Method] + # + attr_reader :create_rollout + ## + # RPC-specific configuration for `update_rollout` + # @return [::Gapic::Config::Method] + # + attr_reader :update_rollout + ## + # RPC-specific configuration for `delete_rollout` + # @return [::Gapic::Config::Method] + # + attr_reader :delete_rollout + ## + # RPC-specific configuration for `list_rollout_kinds` + # @return [::Gapic::Config::Method] + # + attr_reader :list_rollout_kinds + ## + # RPC-specific configuration for `get_rollout_kind` + # @return [::Gapic::Config::Method] + # + attr_reader :get_rollout_kind + ## + # RPC-specific configuration for `create_rollout_kind` + # @return [::Gapic::Config::Method] + # + attr_reader :create_rollout_kind + ## + # RPC-specific configuration for `update_rollout_kind` + # @return [::Gapic::Config::Method] + # + attr_reader :update_rollout_kind + ## + # RPC-specific configuration for `delete_rollout_kind` + # @return [::Gapic::Config::Method] + # + attr_reader :delete_rollout_kind + + # @private + def initialize parent_rpcs = nil + list_rollouts_config = parent_rpcs.list_rollouts if parent_rpcs.respond_to? :list_rollouts + @list_rollouts = ::Gapic::Config::Method.new list_rollouts_config + get_rollout_config = parent_rpcs.get_rollout if parent_rpcs.respond_to? :get_rollout + @get_rollout = ::Gapic::Config::Method.new get_rollout_config + create_rollout_config = parent_rpcs.create_rollout if parent_rpcs.respond_to? :create_rollout + @create_rollout = ::Gapic::Config::Method.new create_rollout_config + update_rollout_config = parent_rpcs.update_rollout if parent_rpcs.respond_to? :update_rollout + @update_rollout = ::Gapic::Config::Method.new update_rollout_config + delete_rollout_config = parent_rpcs.delete_rollout if parent_rpcs.respond_to? :delete_rollout + @delete_rollout = ::Gapic::Config::Method.new delete_rollout_config + list_rollout_kinds_config = parent_rpcs.list_rollout_kinds if parent_rpcs.respond_to? :list_rollout_kinds + @list_rollout_kinds = ::Gapic::Config::Method.new list_rollout_kinds_config + get_rollout_kind_config = parent_rpcs.get_rollout_kind if parent_rpcs.respond_to? :get_rollout_kind + @get_rollout_kind = ::Gapic::Config::Method.new get_rollout_kind_config + create_rollout_kind_config = parent_rpcs.create_rollout_kind if parent_rpcs.respond_to? :create_rollout_kind + @create_rollout_kind = ::Gapic::Config::Method.new create_rollout_kind_config + update_rollout_kind_config = parent_rpcs.update_rollout_kind if parent_rpcs.respond_to? :update_rollout_kind + @update_rollout_kind = ::Gapic::Config::Method.new update_rollout_kind_config + delete_rollout_kind_config = parent_rpcs.delete_rollout_kind if parent_rpcs.respond_to? :delete_rollout_kind + @delete_rollout_kind = ::Gapic::Config::Method.new delete_rollout_kind_config + + yield self if block_given? + end + end + end + end + end + end + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-saas_platform-saas_service_mgmt-v1beta1/lib/google/cloud/saas_platform/saas_service_mgmt/v1beta1/saas_rollouts/rest/service_stub.rb b/owl-bot-staging/google-cloud-saas_platform-saas_service_mgmt-v1beta1/lib/google/cloud/saas_platform/saas_service_mgmt/v1beta1/saas_rollouts/rest/service_stub.rb new file mode 100644 index 000000000000..b0d0e3b97106 --- /dev/null +++ b/owl-bot-staging/google-cloud-saas_platform-saas_service_mgmt-v1beta1/lib/google/cloud/saas_platform/saas_service_mgmt/v1beta1/saas_rollouts/rest/service_stub.rb @@ -0,0 +1,697 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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/saasplatform/saasservicemgmt/v1beta1/rollouts_service_pb" + +module Google + module Cloud + module SaasPlatform + module SaasServiceMgmt + module V1beta1 + module SaasRollouts + module Rest + ## + # REST service stub for the SaasRollouts service. + # Service stub contains baseline method implementations + # including transcoding, making the REST call, and deserialing the response. + # + class ServiceStub + # @private + def initialize endpoint:, endpoint_template:, universe_domain:, credentials:, logger: + # These require statements are intentionally placed here to initialize + # the REST modules only when it's required. + require "gapic/rest" + + @client_stub = ::Gapic::Rest::ClientStub.new endpoint: endpoint, + endpoint_template: endpoint_template, + universe_domain: universe_domain, + credentials: credentials, + numeric_enums: true, + service_name: self.class, + raise_faraday_errors: false, + logger: logger + end + + ## + # The effective universe domain + # + # @return [String] + # + def universe_domain + @client_stub.universe_domain + end + + ## + # The effective endpoint + # + # @return [String] + # + def endpoint + @client_stub.endpoint + end + + ## + # The logger used for request/response debug logging. + # + # @return [Logger] + # + def logger stub: false + stub ? @client_stub.stub_logger : @client_stub.logger + end + + ## + # Baseline implementation for the list_rollouts REST call + # + # @param request_pb [::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::ListRolloutsRequest] + # A request object representing the call parameters. Required. + # @param options [::Gapic::CallOptions] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::ListRolloutsResponse] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::ListRolloutsResponse] + # A result object deserialized from the server's reply + def list_rollouts request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_list_rollouts_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_rollouts", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::ListRolloutsResponse.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_rollout REST call + # + # @param request_pb [::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::GetRolloutRequest] + # A request object representing the call parameters. Required. + # @param options [::Gapic::CallOptions] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::Rollout] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::Rollout] + # A result object deserialized from the server's reply + def get_rollout request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_get_rollout_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_rollout", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::Rollout.decode_json response.body, ignore_unknown_fields: true + catch :response do + yield result, operation if block_given? + result + end + end + + ## + # Baseline implementation for the create_rollout REST call + # + # @param request_pb [::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::CreateRolloutRequest] + # A request object representing the call parameters. Required. + # @param options [::Gapic::CallOptions] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::Rollout] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::Rollout] + # A result object deserialized from the server's reply + def create_rollout request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_create_rollout_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_rollout", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::Rollout.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_rollout REST call + # + # @param request_pb [::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::UpdateRolloutRequest] + # A request object representing the call parameters. Required. + # @param options [::Gapic::CallOptions] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::Rollout] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::Rollout] + # A result object deserialized from the server's reply + def update_rollout request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_update_rollout_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_rollout", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::Rollout.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_rollout REST call + # + # @param request_pb [::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::DeleteRolloutRequest] + # 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_rollout request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_delete_rollout_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_rollout", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Protobuf::Empty.decode_json response.body, ignore_unknown_fields: true + catch :response do + yield result, operation if block_given? + result + end + end + + ## + # Baseline implementation for the list_rollout_kinds REST call + # + # @param request_pb [::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::ListRolloutKindsRequest] + # A request object representing the call parameters. Required. + # @param options [::Gapic::CallOptions] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::ListRolloutKindsResponse] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::ListRolloutKindsResponse] + # A result object deserialized from the server's reply + def list_rollout_kinds request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_list_rollout_kinds_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_rollout_kinds", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::ListRolloutKindsResponse.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_rollout_kind REST call + # + # @param request_pb [::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::GetRolloutKindRequest] + # A request object representing the call parameters. Required. + # @param options [::Gapic::CallOptions] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::RolloutKind] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::RolloutKind] + # A result object deserialized from the server's reply + def get_rollout_kind request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_get_rollout_kind_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_rollout_kind", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::RolloutKind.decode_json response.body, ignore_unknown_fields: true + catch :response do + yield result, operation if block_given? + result + end + end + + ## + # Baseline implementation for the create_rollout_kind REST call + # + # @param request_pb [::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::CreateRolloutKindRequest] + # A request object representing the call parameters. Required. + # @param options [::Gapic::CallOptions] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::RolloutKind] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::RolloutKind] + # A result object deserialized from the server's reply + def create_rollout_kind request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_create_rollout_kind_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_rollout_kind", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::RolloutKind.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_rollout_kind REST call + # + # @param request_pb [::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::UpdateRolloutKindRequest] + # A request object representing the call parameters. Required. + # @param options [::Gapic::CallOptions] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::RolloutKind] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::RolloutKind] + # A result object deserialized from the server's reply + def update_rollout_kind request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_update_rollout_kind_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_rollout_kind", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::RolloutKind.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_rollout_kind REST call + # + # @param request_pb [::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::DeleteRolloutKindRequest] + # 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_rollout_kind request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_delete_rollout_kind_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_rollout_kind", + 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_rollouts REST call + # + # @param request_pb [::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::ListRolloutsRequest] + # 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_rollouts_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :get, + uri_template: "/v1beta1/{parent}/rollouts", + matches: [ + ["parent", %r{^projects/[^/]+/locations/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the get_rollout REST call + # + # @param request_pb [::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::GetRolloutRequest] + # 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_rollout_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :get, + uri_template: "/v1beta1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/rollouts/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the create_rollout REST call + # + # @param request_pb [::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::CreateRolloutRequest] + # 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_rollout_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :post, + uri_template: "/v1beta1/{parent}/rollouts", + body: "rollout", + matches: [ + ["parent", %r{^projects/[^/]+/locations/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the update_rollout REST call + # + # @param request_pb [::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::UpdateRolloutRequest] + # 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_rollout_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :patch, + uri_template: "/v1beta1/{rollout.name}", + body: "rollout", + matches: [ + ["rollout.name", %r{^projects/[^/]+/locations/[^/]+/rollouts/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the delete_rollout REST call + # + # @param request_pb [::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::DeleteRolloutRequest] + # 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_rollout_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :delete, + uri_template: "/v1beta1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/rollouts/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the list_rollout_kinds REST call + # + # @param request_pb [::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::ListRolloutKindsRequest] + # 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_rollout_kinds_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :get, + uri_template: "/v1beta1/{parent}/rolloutKinds", + matches: [ + ["parent", %r{^projects/[^/]+/locations/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the get_rollout_kind REST call + # + # @param request_pb [::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::GetRolloutKindRequest] + # 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_rollout_kind_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :get, + uri_template: "/v1beta1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/rolloutKinds/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the create_rollout_kind REST call + # + # @param request_pb [::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::CreateRolloutKindRequest] + # 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_rollout_kind_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :post, + uri_template: "/v1beta1/{parent}/rolloutKinds", + body: "rollout_kind", + matches: [ + ["parent", %r{^projects/[^/]+/locations/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the update_rollout_kind REST call + # + # @param request_pb [::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::UpdateRolloutKindRequest] + # 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_rollout_kind_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :patch, + uri_template: "/v1beta1/{rollout_kind.name}", + body: "rollout_kind", + matches: [ + ["rollout_kind.name", %r{^projects/[^/]+/locations/[^/]+/rolloutKinds/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the delete_rollout_kind REST call + # + # @param request_pb [::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::DeleteRolloutKindRequest] + # 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_rollout_kind_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :delete, + uri_template: "/v1beta1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/rolloutKinds/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + end + end + end + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-saas_platform-saas_service_mgmt-v1beta1/lib/google/cloud/saas_platform/saas_service_mgmt/v1beta1/version.rb b/owl-bot-staging/google-cloud-saas_platform-saas_service_mgmt-v1beta1/lib/google/cloud/saas_platform/saas_service_mgmt/v1beta1/version.rb new file mode 100644 index 000000000000..14648b82728e --- /dev/null +++ b/owl-bot-staging/google-cloud-saas_platform-saas_service_mgmt-v1beta1/lib/google/cloud/saas_platform/saas_service_mgmt/v1beta1/version.rb @@ -0,0 +1,30 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + + +module Google + module Cloud + module SaasPlatform + module SaasServiceMgmt + module V1beta1 + VERSION = "0.0.1" + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-saas_platform-saas_service_mgmt-v1beta1/lib/google/cloud/saasplatform/saasservicemgmt/v1beta1/common_pb.rb b/owl-bot-staging/google-cloud-saas_platform-saas_service_mgmt-v1beta1/lib/google/cloud/saasplatform/saasservicemgmt/v1beta1/common_pb.rb new file mode 100644 index 000000000000..816cbc457c60 --- /dev/null +++ b/owl-bot-staging/google-cloud-saas_platform-saas_service_mgmt-v1beta1/lib/google/cloud/saasplatform/saasservicemgmt/v1beta1/common_pb.rb @@ -0,0 +1,36 @@ +# frozen_string_literal: true +# Generated by the protocol buffer compiler. DO NOT EDIT! +# source: google/cloud/saasplatform/saasservicemgmt/v1beta1/common.proto + +require 'google/protobuf' + +require 'google/api/field_behavior_pb' +require 'google/protobuf/timestamp_pb' + + +descriptor_data = "\n>google/cloud/saasplatform/saasservicemgmt/v1beta1/common.proto\x12\x31google.cloud.saasplatform.saasservicemgmt.v1beta1\x1a\x1fgoogle/api/field_behavior.proto\x1a\x1fgoogle/protobuf/timestamp.proto\"O\n\tBlueprint\x12\x17\n\x07package\x18\x01 \x01(\tB\x06\xe0\x41\x01\xe0\x41\x05\x12\x13\n\x06\x65ngine\x18\x02 \x01(\tB\x03\xe0\x41\x03\x12\x14\n\x07version\x18\x03 \x01(\tB\x03\xe0\x41\x03\"\xd5\x01\n\x0cUnitVariable\x12\x18\n\x08variable\x18\x01 \x01(\tB\x06\xe0\x41\x02\xe0\x41\x05\x12Z\n\x04type\x18\x02 \x01(\x0e\x32\x44.google.cloud.saasplatform.saasservicemgmt.v1beta1.UnitVariable.TypeB\x06\xe0\x41\x01\xe0\x41\x05\x12\x12\n\x05value\x18\x03 \x01(\tB\x03\xe0\x41\x01\";\n\x04Type\x12\x14\n\x10TYPE_UNSPECIFIED\x10\x00\x12\n\n\x06STRING\x10\x01\x12\x07\n\x03INT\x10\x02\x12\x08\n\x04\x42OOL\x10\x03\"\xfb\x03\n\rUnitCondition\x12\\\n\x06status\x18\x01 \x01(\x0e\x32G.google.cloud.saasplatform.saasservicemgmt.v1beta1.UnitCondition.StatusB\x03\xe0\x41\x02\x12X\n\x04type\x18\x02 \x01(\x0e\x32\x45.google.cloud.saasplatform.saasservicemgmt.v1beta1.UnitCondition.TypeB\x03\xe0\x41\x02\x12=\n\x14last_transition_time\x18\x03 \x01(\x0b\x32\x1a.google.protobuf.TimestampB\x03\xe0\x41\x02\x12\x14\n\x07message\x18\x04 \x01(\tB\x03\xe0\x41\x02\x12\x13\n\x06reason\x18\x05 \x01(\tB\x03\xe0\x41\x02\"W\n\x06Status\x12\x16\n\x12STATUS_UNSPECIFIED\x10\x00\x12\x12\n\x0eSTATUS_UNKNOWN\x10\x01\x12\x0f\n\x0bSTATUS_TRUE\x10\x02\x12\x10\n\x0cSTATUS_FALSE\x10\x03\"o\n\x04Type\x12\x14\n\x10TYPE_UNSPECIFIED\x10\x00\x12\x0e\n\nTYPE_READY\x10\x01\x12\x11\n\rTYPE_UPDATING\x10\x02\x12\x14\n\x10TYPE_PROVISIONED\x10\x03\x12\x18\n\x14TYPE_OPERATION_ERROR\x10\x04\"\xcc\x04\n\x16UnitOperationCondition\x12\x65\n\x06status\x18\x01 \x01(\x0e\x32P.google.cloud.saasplatform.saasservicemgmt.v1beta1.UnitOperationCondition.StatusB\x03\xe0\x41\x02\x12\x61\n\x04type\x18\x02 \x01(\x0e\x32N.google.cloud.saasplatform.saasservicemgmt.v1beta1.UnitOperationCondition.TypeB\x03\xe0\x41\x02\x12=\n\x14last_transition_time\x18\x03 \x01(\x0b\x32\x1a.google.protobuf.TimestampB\x03\xe0\x41\x02\x12\x14\n\x07message\x18\x04 \x01(\tB\x03\xe0\x41\x02\x12\x13\n\x06reason\x18\x05 \x01(\tB\x03\xe0\x41\x02\"W\n\x06Status\x12\x16\n\x12STATUS_UNSPECIFIED\x10\x00\x12\x12\n\x0eSTATUS_UNKNOWN\x10\x01\x12\x0f\n\x0bSTATUS_TRUE\x10\x02\x12\x10\n\x0cSTATUS_FALSE\x10\x03\"\xa4\x01\n\x04Type\x12\x14\n\x10TYPE_UNSPECIFIED\x10\x00\x12\x12\n\x0eTYPE_SCHEDULED\x10\x02\x12\x10\n\x0cTYPE_RUNNING\x10\x03\x12\x12\n\x0eTYPE_SUCCEEDED\x10\x04\x12\x12\n\x0eTYPE_CANCELLED\x10\x05\x12\x14\n\x10TYPE_APP_CREATED\x10\x06\x12\"\n\x1eTYPE_APP_COMPONENTS_REGISTERED\x10\x07\"3\n\tAggregate\x12\x12\n\x05group\x18\x01 \x01(\tB\x03\xe0\x41\x02\x12\x12\n\x05\x63ount\x18\x02 \x01(\x05\x42\x03\xe0\x41\x02*\x96\x01\n\x1aUnitOperationErrorCategory\x12-\n)UNIT_OPERATION_ERROR_CATEGORY_UNSPECIFIED\x10\x00\x12\x12\n\x0eNOT_APPLICABLE\x10\x01\x12\t\n\x05\x46\x41TAL\x10\x02\x12\r\n\tRETRIABLE\x10\x03\x12\r\n\tIGNORABLE\x10\x04\x12\x0c\n\x08STANDARD\x10\x05\x42\xc7\x02\n5com.google.cloud.saasplatform.saasservicemgmt.v1beta1B\x0b\x43ommonProtoP\x01Z_cloud.google.com/go/saasplatform/saasservicemgmt/apiv1beta1/saasservicemgmtpb;saasservicemgmtpb\xaa\x02\x31Google.Cloud.SaasPlatform.SaasServiceMgmt.V1Beta1\xca\x02\x31Google\\Cloud\\SaasPlatform\\SaasServiceMgmt\\V1beta1\xea\x02\x35Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1b\x06proto3" + +pool = ::Google::Protobuf::DescriptorPool.generated_pool +pool.add_serialized_file(descriptor_data) + +module Google + module Cloud + module SaasPlatform + module SaasServiceMgmt + module V1beta1 + Blueprint = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.saasplatform.saasservicemgmt.v1beta1.Blueprint").msgclass + UnitVariable = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.saasplatform.saasservicemgmt.v1beta1.UnitVariable").msgclass + UnitVariable::Type = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.saasplatform.saasservicemgmt.v1beta1.UnitVariable.Type").enummodule + UnitCondition = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.saasplatform.saasservicemgmt.v1beta1.UnitCondition").msgclass + UnitCondition::Status = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.saasplatform.saasservicemgmt.v1beta1.UnitCondition.Status").enummodule + UnitCondition::Type = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.saasplatform.saasservicemgmt.v1beta1.UnitCondition.Type").enummodule + UnitOperationCondition = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.saasplatform.saasservicemgmt.v1beta1.UnitOperationCondition").msgclass + UnitOperationCondition::Status = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.saasplatform.saasservicemgmt.v1beta1.UnitOperationCondition.Status").enummodule + UnitOperationCondition::Type = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.saasplatform.saasservicemgmt.v1beta1.UnitOperationCondition.Type").enummodule + Aggregate = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.saasplatform.saasservicemgmt.v1beta1.Aggregate").msgclass + UnitOperationErrorCategory = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.saasplatform.saasservicemgmt.v1beta1.UnitOperationErrorCategory").enummodule + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-saas_platform-saas_service_mgmt-v1beta1/lib/google/cloud/saasplatform/saasservicemgmt/v1beta1/deployments_resources_pb.rb b/owl-bot-staging/google-cloud-saas_platform-saas_service_mgmt-v1beta1/lib/google/cloud/saasplatform/saasservicemgmt/v1beta1/deployments_resources_pb.rb new file mode 100644 index 000000000000..7f4669657418 --- /dev/null +++ b/owl-bot-staging/google-cloud-saas_platform-saas_service_mgmt-v1beta1/lib/google/cloud/saasplatform/saasservicemgmt/v1beta1/deployments_resources_pb.rb @@ -0,0 +1,50 @@ +# frozen_string_literal: true +# Generated by the protocol buffer compiler. DO NOT EDIT! +# source: google/cloud/saasplatform/saasservicemgmt/v1beta1/deployments_resources.proto + +require 'google/protobuf' + +require 'google/api/field_behavior_pb' +require 'google/api/field_info_pb' +require 'google/api/resource_pb' +require 'google/cloud/saasplatform/saasservicemgmt/v1beta1/common_pb' +require 'google/protobuf/timestamp_pb' + + +descriptor_data = "\nMgoogle/cloud/saasplatform/saasservicemgmt/v1beta1/deployments_resources.proto\x12\x31google.cloud.saasplatform.saasservicemgmt.v1beta1\x1a\x1fgoogle/api/field_behavior.proto\x1a\x1bgoogle/api/field_info.proto\x1a\x19google/api/resource.proto\x1a>google/cloud/saasplatform/saasservicemgmt/v1beta1/common.proto\x1a\x1fgoogle/protobuf/timestamp.proto\"\x1d\n\x08Location\x12\x11\n\x04name\x18\x01 \x01(\tB\x03\xe0\x41\x01\"\x99\x05\n\x04Saas\x12\x11\n\x04name\x18\x01 \x01(\tB\x03\xe0\x41\x08\x12S\n\tlocations\x18\x04 \x03(\x0b\x32;.google.cloud.saasplatform.saasservicemgmt.v1beta1.LocationB\x03\xe0\x41\x01\x12Y\n\x06labels\x18\xa1Q \x03(\x0b\x32\x43.google.cloud.saasplatform.saasservicemgmt.v1beta1.Saas.LabelsEntryB\x03\xe0\x41\x01\x12\x63\n\x0b\x61nnotations\x18\xa2Q \x03(\x0b\x32H.google.cloud.saasplatform.saasservicemgmt.v1beta1.Saas.AnnotationsEntryB\x03\xe0\x41\x01\x12\x19\n\x03uid\x18\xd9O \x01(\tB\x0b\xe0\x41\x03\xe2\x8c\xcf\xd7\x08\x02\x08\x01\x12\x12\n\x04\x65tag\x18\xdaO \x01(\tB\x03\xe0\x41\x03\x12\x35\n\x0b\x63reate_time\x18\xbfP \x01(\x0b\x32\x1a.google.protobuf.TimestampB\x03\xe0\x41\x03\x12\x35\n\x0bupdate_time\x18\xc0P \x01(\x0b\x32\x1a.google.protobuf.TimestampB\x03\xe0\x41\x03\x1a-\n\x0bLabelsEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12\r\n\x05value\x18\x02 \x01(\t:\x02\x38\x01\x1a\x32\n\x10\x41nnotationsEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12\r\n\x05value\x18\x02 \x01(\t:\x02\x38\x01:i\xea\x41\x66\n#saasservicemgmt.googleapis.com/Saas\x12\x33projects/{project}/locations/{location}/saas/{saas}*\x04saas2\x04saas\"\xb7\x05\n\x06Tenant\x12\x11\n\x04name\x18\x01 \x01(\tB\x03\xe0\x41\x08\x12!\n\x11\x63onsumer_resource\x18\x02 \x01(\tB\x06\xe0\x41\x01\xe0\x41\x05\x12<\n\x04saas\x18\x03 \x01(\tB.\xe0\x41\x02\xe0\x41\x05\xfa\x41%\n#saasservicemgmt.googleapis.com/Saas\x12[\n\x06labels\x18\xa1Q \x03(\x0b\x32\x45.google.cloud.saasplatform.saasservicemgmt.v1beta1.Tenant.LabelsEntryB\x03\xe0\x41\x01\x12\x65\n\x0b\x61nnotations\x18\xa2Q \x03(\x0b\x32J.google.cloud.saasplatform.saasservicemgmt.v1beta1.Tenant.AnnotationsEntryB\x03\xe0\x41\x01\x12\x19\n\x03uid\x18\xd9O \x01(\tB\x0b\xe0\x41\x03\xe2\x8c\xcf\xd7\x08\x02\x08\x01\x12\x12\n\x04\x65tag\x18\xdaO \x01(\tB\x03\xe0\x41\x03\x12\x35\n\x0b\x63reate_time\x18\xbfP \x01(\x0b\x32\x1a.google.protobuf.TimestampB\x03\xe0\x41\x03\x12\x35\n\x0bupdate_time\x18\xc0P \x01(\x0b\x32\x1a.google.protobuf.TimestampB\x03\xe0\x41\x03\x1a-\n\x0bLabelsEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12\r\n\x05value\x18\x02 \x01(\t:\x02\x38\x01\x1a\x32\n\x10\x41nnotationsEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12\r\n\x05value\x18\x02 \x01(\t:\x02\x38\x01:u\xea\x41r\n%saasservicemgmt.googleapis.com/Tenant\x12\x38projects/{project}/locations/{location}/tenants/{tenant}*\x07tenants2\x06tenant\"\x9f\x08\n\x08UnitKind\x12\x11\n\x04name\x18\x01 \x01(\tB\x03\xe0\x41\x08\x12G\n\x0f\x64\x65\x66\x61ult_release\x18\x02 \x01(\tB.\xe0\x41\x01\xfa\x41(\n&saasservicemgmt.googleapis.com/Release\x12[\n\x0c\x64\x65pendencies\x18\x04 \x03(\x0b\x32=.google.cloud.saasplatform.saasservicemgmt.v1beta1.DependencyB\x06\xe0\x41\x01\xe0\x41\x05\x12h\n\x17input_variable_mappings\x18\x05 \x03(\x0b\x32\x42.google.cloud.saasplatform.saasservicemgmt.v1beta1.VariableMappingB\x03\xe0\x41\x01\x12i\n\x18output_variable_mappings\x18\x06 \x03(\x0b\x32\x42.google.cloud.saasplatform.saasservicemgmt.v1beta1.VariableMappingB\x03\xe0\x41\x01\x12<\n\x04saas\x18\x08 \x01(\tB.\xe0\x41\x02\xe0\x41\x05\xfa\x41%\n#saasservicemgmt.googleapis.com/Saas\x12]\n\x06labels\x18\xa1Q \x03(\x0b\x32G.google.cloud.saasplatform.saasservicemgmt.v1beta1.UnitKind.LabelsEntryB\x03\xe0\x41\x01\x12g\n\x0b\x61nnotations\x18\xa2Q \x03(\x0b\x32L.google.cloud.saasplatform.saasservicemgmt.v1beta1.UnitKind.AnnotationsEntryB\x03\xe0\x41\x01\x12\x19\n\x03uid\x18\xd9O \x01(\tB\x0b\xe0\x41\x03\xe2\x8c\xcf\xd7\x08\x02\x08\x01\x12\x12\n\x04\x65tag\x18\xdaO \x01(\tB\x03\xe0\x41\x03\x12\x35\n\x0b\x63reate_time\x18\xbfP \x01(\x0b\x32\x1a.google.protobuf.TimestampB\x03\xe0\x41\x03\x12\x35\n\x0bupdate_time\x18\xc0P \x01(\x0b\x32\x1a.google.protobuf.TimestampB\x03\xe0\x41\x03\x1a-\n\x0bLabelsEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12\r\n\x05value\x18\x02 \x01(\t:\x02\x38\x01\x1a\x32\n\x10\x41nnotationsEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12\r\n\x05value\x18\x02 \x01(\t:\x02\x38\x01:\x7f\xea\x41|\n\'saasservicemgmt.googleapis.com/UnitKind\x12.google.cloud.saasplatform.saasservicemgmt.v1beta1.DeprovisionB\x03\xe0\x41\x01H\x00\x12\x11\n\x04name\x18\x01 \x01(\tB\x03\xe0\x41\x08\x12<\n\x04unit\x18\x02 \x01(\tB.\xe0\x41\x02\xe0\x41\x05\xfa\x41%\n#saasservicemgmt.googleapis.com/Unit\x12S\n\x15parent_unit_operation\x18\x03 \x01(\tB4\xe0\x41\x01\xfa\x41.\n,saasservicemgmt.googleapis.com/UnitOperation\x12?\n\x07rollout\x18\x04 \x01(\tB.\xe0\x41\x01\xfa\x41(\n&saasservicemgmt.googleapis.com/Rollout\x12\x13\n\x06\x63\x61ncel\x18\x05 \x01(\x08\x42\x03\xe0\x41\x01\x12j\n\x05state\x18\x06 \x01(\x0e\x32S.google.cloud.saasplatform.saasservicemgmt.v1beta1.UnitOperation.UnitOperationStateB\x06\xe0\x41\x01\xe0\x41\x03\x12\x65\n\nconditions\x18\x07 \x03(\x0b\x32I.google.cloud.saasplatform.saasservicemgmt.v1beta1.UnitOperationConditionB\x06\xe0\x41\x01\xe0\x41\x03\x12R\n\x08schedule\x18\x0c \x01(\x0b\x32;.google.cloud.saasplatform.saasservicemgmt.v1beta1.ScheduleB\x03\xe0\x41\x01\x12\x1c\n\x0c\x65ngine_state\x18\x0e \x01(\tB\x06\xe0\x41\x01\xe0\x41\x03\x12m\n\x0e\x65rror_category\x18\x0f \x01(\x0e\x32M.google.cloud.saasplatform.saasservicemgmt.v1beta1.UnitOperationErrorCategoryB\x06\xe0\x41\x01\xe0\x41\x03\x12\x62\n\x06labels\x18\xa1Q \x03(\x0b\x32L.google.cloud.saasplatform.saasservicemgmt.v1beta1.UnitOperation.LabelsEntryB\x03\xe0\x41\x01\x12l\n\x0b\x61nnotations\x18\xa2Q \x03(\x0b\x32Q.google.cloud.saasplatform.saasservicemgmt.v1beta1.UnitOperation.AnnotationsEntryB\x03\xe0\x41\x01\x12\x19\n\x03uid\x18\xd9O \x01(\tB\x0b\xe0\x41\x03\xe2\x8c\xcf\xd7\x08\x02\x08\x01\x12\x12\n\x04\x65tag\x18\xdaO \x01(\tB\x03\xe0\x41\x03\x12\x35\n\x0b\x63reate_time\x18\xbfP \x01(\x0b\x32\x1a.google.protobuf.TimestampB\x03\xe0\x41\x03\x12\x35\n\x0bupdate_time\x18\xc0P \x01(\x0b\x32\x1a.google.protobuf.TimestampB\x03\xe0\x41\x03\x1a-\n\x0bLabelsEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12\r\n\x05value\x18\x02 \x01(\t:\x02\x38\x01\x1a\x32\n\x10\x41nnotationsEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12\r\n\x05value\x18\x02 \x01(\t:\x02\x38\x01\"\x87\x02\n\x12UnitOperationState\x12 \n\x1cUNIT_OPERATION_STATE_UNKNOWN\x10\x00\x12 \n\x1cUNIT_OPERATION_STATE_PENDING\x10\x01\x12\"\n\x1eUNIT_OPERATION_STATE_SCHEDULED\x10\x02\x12 \n\x1cUNIT_OPERATION_STATE_RUNNING\x10\x04\x12\"\n\x1eUNIT_OPERATION_STATE_SUCCEEDED\x10\x05\x12\x1f\n\x1bUNIT_OPERATION_STATE_FAILED\x10\x06\x12\"\n\x1eUNIT_OPERATION_STATE_CANCELLED\x10\x07:\x99\x01\xea\x41\x95\x01\n,saasservicemgmt.googleapis.com/UnitOperation\x12\x46projects/{project}/locations/{location}/unitOperations/{unitOperation}*\x0eunitOperations2\runitOperationB\x15\n\x13unit_operation_type\"\xab\x01\n\tProvision\x12?\n\x07release\x18\x01 \x01(\tB.\xe0\x41\x01\xfa\x41(\n&saasservicemgmt.googleapis.com/Release\x12]\n\x0finput_variables\x18\x03 \x03(\x0b\x32?.google.cloud.saasplatform.saasservicemgmt.v1beta1.UnitVariableB\x03\xe0\x41\x01\"\r\n\x0b\x44\x65provision\"\xa9\x01\n\x07Upgrade\x12?\n\x07release\x18\x01 \x01(\tB.\xe0\x41\x01\xfa\x41(\n&saasservicemgmt.googleapis.com/Release\x12]\n\x0finput_variables\x18\x02 \x03(\x0b\x32?.google.cloud.saasplatform.saasservicemgmt.v1beta1.UnitVariableB\x03\xe0\x41\x01\"?\n\x08Schedule\x12\x33\n\nstart_time\x18\x01 \x01(\x0b\x32\x1a.google.protobuf.TimestampB\x03\xe0\x41\x01\"\x84\n\n\x07Release\x12\x11\n\x04name\x18\x01 \x01(\tB\x03\xe0\x41\x08\x12\x45\n\tunit_kind\x18\x02 \x01(\tB2\xe0\x41\x02\xe0\x41\x05\xfa\x41)\n\'saasservicemgmt.googleapis.com/UnitKind\x12T\n\tblueprint\x18\x03 \x01(\x0b\x32<.google.cloud.saasplatform.saasservicemgmt.v1beta1.BlueprintB\x03\xe0\x41\x01\x12q\n\x14release_requirements\x18\x04 \x01(\x0b\x32N.google.cloud.saasplatform.saasservicemgmt.v1beta1.Release.ReleaseRequirementsB\x03\xe0\x41\x01\x12`\n\x0finput_variables\x18\x05 \x03(\x0b\x32?.google.cloud.saasplatform.saasservicemgmt.v1beta1.UnitVariableB\x06\xe0\x41\x01\xe0\x41\x03\x12\x61\n\x10output_variables\x18\x06 \x03(\x0b\x32?.google.cloud.saasplatform.saasservicemgmt.v1beta1.UnitVariableB\x06\xe0\x41\x01\xe0\x41\x03\x12\x65\n\x17input_variable_defaults\x18\x07 \x03(\x0b\x32?.google.cloud.saasplatform.saasservicemgmt.v1beta1.UnitVariableB\x03\xe0\x41\x01\x12\\\n\x06labels\x18\xa1Q \x03(\x0b\x32\x46.google.cloud.saasplatform.saasservicemgmt.v1beta1.Release.LabelsEntryB\x03\xe0\x41\x01\x12\x66\n\x0b\x61nnotations\x18\xa2Q \x03(\x0b\x32K.google.cloud.saasplatform.saasservicemgmt.v1beta1.Release.AnnotationsEntryB\x03\xe0\x41\x01\x12\x19\n\x03uid\x18\xd9O \x01(\tB\x0b\xe0\x41\x03\xe2\x8c\xcf\xd7\x08\x02\x08\x01\x12\x12\n\x04\x65tag\x18\xdaO \x01(\tB\x03\xe0\x41\x03\x12\x35\n\x0b\x63reate_time\x18\xbfP \x01(\x0b\x32\x1a.google.protobuf.TimestampB\x03\xe0\x41\x03\x12\x35\n\x0bupdate_time\x18\xc0P \x01(\x0b\x32\x1a.google.protobuf.TimestampB\x03\xe0\x41\x03\x1ah\n\x13ReleaseRequirements\x12Q\n\x19upgradeable_from_releases\x18\x01 \x03(\tB.\xe0\x41\x01\xfa\x41(\n&saasservicemgmt.googleapis.com/Release\x1a-\n\x0bLabelsEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12\r\n\x05value\x18\x02 \x01(\t:\x02\x38\x01\x1a\x32\n\x10\x41nnotationsEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12\r\n\x05value\x18\x02 \x01(\t:\x02\x38\x01:z\xea\x41w\n&saasservicemgmt.googleapis.com/Release\x12:projects/{project}/locations/{location}/releases/{release}*\x08releases2\x07release\"\xde\x01\n\x0fVariableMapping\x12S\n\x04\x66rom\x18\x02 \x01(\x0b\x32>.google.cloud.saasplatform.saasservicemgmt.v1beta1.FromMappingB\x03\xe0\x41\x01H\x00\x12O\n\x02to\x18\x03 \x01(\x0b\x32<.google.cloud.saasplatform.saasservicemgmt.v1beta1.ToMappingB\x03\xe0\x41\x01H\x00\x12\x15\n\x08variable\x18\x01 \x01(\tB\x03\xe0\x41\x02\x42\x0e\n\x0cmapping_type\"D\n\x0b\x46romMapping\x12\x17\n\ndependency\x18\x01 \x01(\tB\x03\xe0\x41\x02\x12\x1c\n\x0foutput_variable\x18\x02 \x01(\tB\x03\xe0\x41\x02\"a\n\tToMapping\x12\x17\n\ndependency\x18\x01 \x01(\tB\x03\xe0\x41\x02\x12\x1b\n\x0einput_variable\x18\x02 \x01(\tB\x03\xe0\x41\x02\x12\x1e\n\x11ignore_for_lookup\x18\x03 \x01(\x08\x42\x03\xe0\x41\x01\"g\n\nDependency\x12\x45\n\tunit_kind\x18\x01 \x01(\tB2\xe0\x41\x02\xe0\x41\x05\xfa\x41)\n\'saasservicemgmt.googleapis.com/UnitKind\x12\x12\n\x05\x61lias\x18\x02 \x01(\tB\x03\xe0\x41\x02\x42\xd9\x02\n5com.google.cloud.saasplatform.saasservicemgmt.v1beta1B\x1dSaasDeploymentsResourcesProtoP\x01Z_cloud.google.com/go/saasplatform/saasservicemgmt/apiv1beta1/saasservicemgmtpb;saasservicemgmtpb\xaa\x02\x31Google.Cloud.SaasPlatform.SaasServiceMgmt.V1Beta1\xca\x02\x31Google\\Cloud\\SaasPlatform\\SaasServiceMgmt\\V1beta1\xea\x02\x35Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1b\x06proto3" + +pool = ::Google::Protobuf::DescriptorPool.generated_pool +pool.add_serialized_file(descriptor_data) + +module Google + module Cloud + module SaasPlatform + module SaasServiceMgmt + module V1beta1 + Location = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.saasplatform.saasservicemgmt.v1beta1.Location").msgclass + Saas = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.saasplatform.saasservicemgmt.v1beta1.Saas").msgclass + Tenant = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.saasplatform.saasservicemgmt.v1beta1.Tenant").msgclass + UnitKind = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.saasplatform.saasservicemgmt.v1beta1.UnitKind").msgclass + Unit = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.saasplatform.saasservicemgmt.v1beta1.Unit").msgclass + Unit::MaintenanceSettings = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.saasplatform.saasservicemgmt.v1beta1.Unit.MaintenanceSettings").msgclass + Unit::UnitState = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.saasplatform.saasservicemgmt.v1beta1.Unit.UnitState").enummodule + Unit::ManagementMode = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.saasplatform.saasservicemgmt.v1beta1.Unit.ManagementMode").enummodule + Unit::SystemManagedState = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.saasplatform.saasservicemgmt.v1beta1.Unit.SystemManagedState").enummodule + UnitDependency = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.saasplatform.saasservicemgmt.v1beta1.UnitDependency").msgclass + UnitOperation = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.saasplatform.saasservicemgmt.v1beta1.UnitOperation").msgclass + UnitOperation::UnitOperationState = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.saasplatform.saasservicemgmt.v1beta1.UnitOperation.UnitOperationState").enummodule + Provision = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.saasplatform.saasservicemgmt.v1beta1.Provision").msgclass + Deprovision = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.saasplatform.saasservicemgmt.v1beta1.Deprovision").msgclass + Upgrade = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.saasplatform.saasservicemgmt.v1beta1.Upgrade").msgclass + Schedule = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.saasplatform.saasservicemgmt.v1beta1.Schedule").msgclass + Release = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.saasplatform.saasservicemgmt.v1beta1.Release").msgclass + Release::ReleaseRequirements = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.saasplatform.saasservicemgmt.v1beta1.Release.ReleaseRequirements").msgclass + VariableMapping = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.saasplatform.saasservicemgmt.v1beta1.VariableMapping").msgclass + FromMapping = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.saasplatform.saasservicemgmt.v1beta1.FromMapping").msgclass + ToMapping = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.saasplatform.saasservicemgmt.v1beta1.ToMapping").msgclass + Dependency = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.saasplatform.saasservicemgmt.v1beta1.Dependency").msgclass + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-saas_platform-saas_service_mgmt-v1beta1/lib/google/cloud/saasplatform/saasservicemgmt/v1beta1/deployments_service_pb.rb b/owl-bot-staging/google-cloud-saas_platform-saas_service_mgmt-v1beta1/lib/google/cloud/saasplatform/saasservicemgmt/v1beta1/deployments_service_pb.rb new file mode 100644 index 000000000000..4c6e843c3907 --- /dev/null +++ b/owl-bot-staging/google-cloud-saas_platform-saas_service_mgmt-v1beta1/lib/google/cloud/saasplatform/saasservicemgmt/v1beta1/deployments_service_pb.rb @@ -0,0 +1,66 @@ +# frozen_string_literal: true +# Generated by the protocol buffer compiler. DO NOT EDIT! +# source: google/cloud/saasplatform/saasservicemgmt/v1beta1/deployments_service.proto + +require 'google/protobuf' + +require 'google/api/annotations_pb' +require 'google/api/client_pb' +require 'google/api/field_behavior_pb' +require 'google/api/resource_pb' +require 'google/cloud/saasplatform/saasservicemgmt/v1beta1/deployments_resources_pb' +require 'google/protobuf/empty_pb' +require 'google/protobuf/field_mask_pb' + + +descriptor_data = "\nKgoogle/cloud/saasplatform/saasservicemgmt/v1beta1/deployments_service.proto\x12\x31google.cloud.saasplatform.saasservicemgmt.v1beta1\x1a\x1cgoogle/api/annotations.proto\x1a\x17google/api/client.proto\x1a\x1fgoogle/api/field_behavior.proto\x1a\x19google/api/resource.proto\x1aMgoogle/cloud/saasplatform/saasservicemgmt/v1beta1/deployments_resources.proto\x1a\x1bgoogle/protobuf/empty.proto\x1a google/protobuf/field_mask.proto\"\x9c\x01\n\x0fListSaasRequest\x12<\n\x06parent\x18\x96N \x01(\tB+\xe0\x41\x02\xfa\x41%\x12#saasservicemgmt.googleapis.com/Saas\x12\x12\n\tpage_size\x18\x89R \x01(\x05\x12\x13\n\npage_token\x18\x8aR \x01(\t\x12\x0f\n\x06\x66ilter\x18\x8bR \x01(\t\x12\x11\n\x08order_by\x18\x8cR \x01(\t\"\x8a\x01\n\x10ListSaasResponse\x12\x46\n\x04saas\x18\x8dR \x03(\x0b\x32\x37.google.cloud.saasplatform.saasservicemgmt.v1beta1.Saas\x12\x18\n\x0fnext_page_token\x18\x8eR \x01(\t\x12\x14\n\x0bunreachable\x18\x8fR \x03(\t\"L\n\x0eGetSaasRequest\x12:\n\x04name\x18\x91N \x01(\tB+\xe0\x41\x02\xfa\x41%\n#saasservicemgmt.googleapis.com/Saas\"\xe2\x01\n\x11\x43reateSaasRequest\x12<\n\x06parent\x18\x96N \x01(\tB+\xe0\x41\x02\xfa\x41%\x12#saasservicemgmt.googleapis.com/Saas\x12\x15\n\x07saas_id\x18\x87R \x01(\tB\x03\xe0\x41\x02\x12K\n\x04saas\x18\x88R \x01(\x0b\x32\x37.google.cloud.saasplatform.saasservicemgmt.v1beta1.SaasB\x03\xe0\x41\x02\x12\x16\n\rvalidate_only\x18\x85R \x01(\x08\x12\x13\n\nrequest_id\x18\x86R \x01(\t\"\xbf\x01\n\x11UpdateSaasRequest\x12K\n\x04saas\x18\x88R \x01(\x0b\x32\x37.google.cloud.saasplatform.saasservicemgmt.v1beta1.SaasB\x03\xe0\x41\x02\x12\x16\n\rvalidate_only\x18\x85R \x01(\x08\x12\x13\n\nrequest_id\x18\x86R \x01(\t\x12\x30\n\x0bupdate_mask\x18\x90R \x01(\x0b\x32\x1a.google.protobuf.FieldMask\"\x8b\x01\n\x11\x44\x65leteSaasRequest\x12:\n\x04name\x18\x91N \x01(\tB+\xe0\x41\x02\xfa\x41%\n#saasservicemgmt.googleapis.com/Saas\x12\r\n\x04\x65tag\x18\xdaO \x01(\t\x12\x16\n\rvalidate_only\x18\x85R \x01(\x08\x12\x13\n\nrequest_id\x18\x86R \x01(\t\"\xa1\x01\n\x12ListTenantsRequest\x12>\n\x06parent\x18\x96N \x01(\tB-\xe0\x41\x02\xfa\x41\'\x12%saasservicemgmt.googleapis.com/Tenant\x12\x12\n\tpage_size\x18\x89R \x01(\x05\x12\x13\n\npage_token\x18\x8aR \x01(\t\x12\x0f\n\x06\x66ilter\x18\x8bR \x01(\t\x12\x11\n\x08order_by\x18\x8cR \x01(\t\"\x92\x01\n\x13ListTenantsResponse\x12K\n\x07tenants\x18\x8dR \x03(\x0b\x32\x39.google.cloud.saasplatform.saasservicemgmt.v1beta1.Tenant\x12\x18\n\x0fnext_page_token\x18\x8eR \x01(\t\x12\x14\n\x0bunreachable\x18\x8fR \x03(\t\"P\n\x10GetTenantRequest\x12<\n\x04name\x18\x91N \x01(\tB-\xe0\x41\x02\xfa\x41\'\n%saasservicemgmt.googleapis.com/Tenant\"\xec\x01\n\x13\x43reateTenantRequest\x12>\n\x06parent\x18\x96N \x01(\tB-\xe0\x41\x02\xfa\x41\'\x12%saasservicemgmt.googleapis.com/Tenant\x12\x17\n\ttenant_id\x18\x87R \x01(\tB\x03\xe0\x41\x02\x12O\n\x06tenant\x18\x88R \x01(\x0b\x32\x39.google.cloud.saasplatform.saasservicemgmt.v1beta1.TenantB\x03\xe0\x41\x02\x12\x16\n\rvalidate_only\x18\x85R \x01(\x08\x12\x13\n\nrequest_id\x18\x86R \x01(\t\"\xc5\x01\n\x13UpdateTenantRequest\x12O\n\x06tenant\x18\x88R \x01(\x0b\x32\x39.google.cloud.saasplatform.saasservicemgmt.v1beta1.TenantB\x03\xe0\x41\x02\x12\x16\n\rvalidate_only\x18\x85R \x01(\x08\x12\x13\n\nrequest_id\x18\x86R \x01(\t\x12\x30\n\x0bupdate_mask\x18\x90R \x01(\x0b\x32\x1a.google.protobuf.FieldMask\"\x8f\x01\n\x13\x44\x65leteTenantRequest\x12<\n\x04name\x18\x91N \x01(\tB-\xe0\x41\x02\xfa\x41\'\n%saasservicemgmt.googleapis.com/Tenant\x12\r\n\x04\x65tag\x18\xdaO \x01(\t\x12\x16\n\rvalidate_only\x18\x85R \x01(\x08\x12\x13\n\nrequest_id\x18\x86R \x01(\t\"\xa5\x01\n\x14ListUnitKindsRequest\x12@\n\x06parent\x18\x96N \x01(\tB/\xe0\x41\x02\xfa\x41)\x12\'saasservicemgmt.googleapis.com/UnitKind\x12\x12\n\tpage_size\x18\x89R \x01(\x05\x12\x13\n\npage_token\x18\x8aR \x01(\t\x12\x0f\n\x06\x66ilter\x18\x8bR \x01(\t\x12\x11\n\x08order_by\x18\x8cR \x01(\t\"\x99\x01\n\x15ListUnitKindsResponse\x12P\n\nunit_kinds\x18\x8dR \x03(\x0b\x32;.google.cloud.saasplatform.saasservicemgmt.v1beta1.UnitKind\x12\x18\n\x0fnext_page_token\x18\x8eR \x01(\t\x12\x14\n\x0bunreachable\x18\x8fR \x03(\t\"T\n\x12GetUnitKindRequest\x12>\n\x04name\x18\x91N \x01(\tB/\xe0\x41\x02\xfa\x41)\n\'saasservicemgmt.googleapis.com/UnitKind\"\xf8\x01\n\x15\x43reateUnitKindRequest\x12@\n\x06parent\x18\x96N \x01(\tB/\xe0\x41\x02\xfa\x41)\x12\'saasservicemgmt.googleapis.com/UnitKind\x12\x1a\n\x0cunit_kind_id\x18\x87R \x01(\tB\x03\xe0\x41\x02\x12T\n\tunit_kind\x18\x88R \x01(\x0b\x32;.google.cloud.saasplatform.saasservicemgmt.v1beta1.UnitKindB\x03\xe0\x41\x02\x12\x16\n\rvalidate_only\x18\x85R \x01(\x08\x12\x13\n\nrequest_id\x18\x86R \x01(\t\"\xcc\x01\n\x15UpdateUnitKindRequest\x12T\n\tunit_kind\x18\x88R \x01(\x0b\x32;.google.cloud.saasplatform.saasservicemgmt.v1beta1.UnitKindB\x03\xe0\x41\x02\x12\x16\n\rvalidate_only\x18\x85R \x01(\x08\x12\x13\n\nrequest_id\x18\x86R \x01(\t\x12\x30\n\x0bupdate_mask\x18\x90R \x01(\x0b\x32\x1a.google.protobuf.FieldMask\"\x93\x01\n\x15\x44\x65leteUnitKindRequest\x12>\n\x04name\x18\x91N \x01(\tB/\xe0\x41\x02\xfa\x41)\n\'saasservicemgmt.googleapis.com/UnitKind\x12\r\n\x04\x65tag\x18\xdaO \x01(\t\x12\x16\n\rvalidate_only\x18\x85R \x01(\x08\x12\x13\n\nrequest_id\x18\x86R \x01(\t\"\x9d\x01\n\x10ListUnitsRequest\x12<\n\x06parent\x18\x96N \x01(\tB+\xe0\x41\x02\xfa\x41%\x12#saasservicemgmt.googleapis.com/Unit\x12\x12\n\tpage_size\x18\x89R \x01(\x05\x12\x13\n\npage_token\x18\x8aR \x01(\t\x12\x0f\n\x06\x66ilter\x18\x8bR \x01(\t\x12\x11\n\x08order_by\x18\x8cR \x01(\t\"\x8c\x01\n\x11ListUnitsResponse\x12G\n\x05units\x18\x8dR \x03(\x0b\x32\x37.google.cloud.saasplatform.saasservicemgmt.v1beta1.Unit\x12\x18\n\x0fnext_page_token\x18\x8eR \x01(\t\x12\x14\n\x0bunreachable\x18\x8fR \x03(\t\"L\n\x0eGetUnitRequest\x12:\n\x04name\x18\x91N \x01(\tB+\xe0\x41\x02\xfa\x41%\n#saasservicemgmt.googleapis.com/Unit\"\xe2\x01\n\x11\x43reateUnitRequest\x12<\n\x06parent\x18\x96N \x01(\tB+\xe0\x41\x02\xfa\x41%\x12#saasservicemgmt.googleapis.com/Unit\x12\x15\n\x07unit_id\x18\x87R \x01(\tB\x03\xe0\x41\x02\x12K\n\x04unit\x18\x88R \x01(\x0b\x32\x37.google.cloud.saasplatform.saasservicemgmt.v1beta1.UnitB\x03\xe0\x41\x02\x12\x16\n\rvalidate_only\x18\x85R \x01(\x08\x12\x13\n\nrequest_id\x18\x86R \x01(\t\"\xbf\x01\n\x11UpdateUnitRequest\x12K\n\x04unit\x18\x88R \x01(\x0b\x32\x37.google.cloud.saasplatform.saasservicemgmt.v1beta1.UnitB\x03\xe0\x41\x02\x12\x16\n\rvalidate_only\x18\x85R \x01(\x08\x12\x13\n\nrequest_id\x18\x86R \x01(\t\x12\x30\n\x0bupdate_mask\x18\x90R \x01(\x0b\x32\x1a.google.protobuf.FieldMask\"\x8b\x01\n\x11\x44\x65leteUnitRequest\x12:\n\x04name\x18\x91N \x01(\tB+\xe0\x41\x02\xfa\x41%\n#saasservicemgmt.googleapis.com/Unit\x12\r\n\x04\x65tag\x18\xdaO \x01(\t\x12\x16\n\rvalidate_only\x18\x85R \x01(\x08\x12\x13\n\nrequest_id\x18\x86R \x01(\t\"\xaf\x01\n\x19ListUnitOperationsRequest\x12\x45\n\x06parent\x18\x96N \x01(\tB4\xe0\x41\x02\xfa\x41.\x12,saasservicemgmt.googleapis.com/UnitOperation\x12\x12\n\tpage_size\x18\x89R \x01(\x05\x12\x13\n\npage_token\x18\x8aR \x01(\t\x12\x0f\n\x06\x66ilter\x18\x8bR \x01(\t\x12\x11\n\x08order_by\x18\x8cR \x01(\t\"\xa8\x01\n\x1aListUnitOperationsResponse\x12Z\n\x0funit_operations\x18\x8dR \x03(\x0b\x32@.google.cloud.saasplatform.saasservicemgmt.v1beta1.UnitOperation\x12\x18\n\x0fnext_page_token\x18\x8eR \x01(\t\x12\x14\n\x0bunreachable\x18\x8fR \x03(\t\"^\n\x17GetUnitOperationRequest\x12\x43\n\x04name\x18\x91N \x01(\tB4\xe0\x41\x02\xfa\x41.\n,saasservicemgmt.googleapis.com/UnitOperation\"\x91\x02\n\x1a\x43reateUnitOperationRequest\x12\x45\n\x06parent\x18\x96N \x01(\tB4\xe0\x41\x02\xfa\x41.\x12,saasservicemgmt.googleapis.com/UnitOperation\x12\x1f\n\x11unit_operation_id\x18\x87R \x01(\tB\x03\xe0\x41\x02\x12^\n\x0eunit_operation\x18\x88R \x01(\x0b\x32@.google.cloud.saasplatform.saasservicemgmt.v1beta1.UnitOperationB\x03\xe0\x41\x02\x12\x16\n\rvalidate_only\x18\x85R \x01(\x08\x12\x13\n\nrequest_id\x18\x86R \x01(\t\"\xdb\x01\n\x1aUpdateUnitOperationRequest\x12^\n\x0eunit_operation\x18\x88R \x01(\x0b\x32@.google.cloud.saasplatform.saasservicemgmt.v1beta1.UnitOperationB\x03\xe0\x41\x02\x12\x16\n\rvalidate_only\x18\x85R \x01(\x08\x12\x13\n\nrequest_id\x18\x86R \x01(\t\x12\x30\n\x0bupdate_mask\x18\x90R \x01(\x0b\x32\x1a.google.protobuf.FieldMask\"\x9d\x01\n\x1a\x44\x65leteUnitOperationRequest\x12\x43\n\x04name\x18\x91N \x01(\tB4\xe0\x41\x02\xfa\x41.\n,saasservicemgmt.googleapis.com/UnitOperation\x12\r\n\x04\x65tag\x18\xdaO \x01(\t\x12\x16\n\rvalidate_only\x18\x85R \x01(\x08\x12\x13\n\nrequest_id\x18\x86R \x01(\t\"\xa3\x01\n\x13ListReleasesRequest\x12?\n\x06parent\x18\x96N \x01(\tB.\xe0\x41\x02\xfa\x41(\x12&saasservicemgmt.googleapis.com/Release\x12\x12\n\tpage_size\x18\x89R \x01(\x05\x12\x13\n\npage_token\x18\x8aR \x01(\t\x12\x0f\n\x06\x66ilter\x18\x8bR \x01(\t\x12\x11\n\x08order_by\x18\x8cR \x01(\t\"\x95\x01\n\x14ListReleasesResponse\x12M\n\x08releases\x18\x8dR \x03(\x0b\x32:.google.cloud.saasplatform.saasservicemgmt.v1beta1.Release\x12\x18\n\x0fnext_page_token\x18\x8eR \x01(\t\x12\x14\n\x0bunreachable\x18\x8fR \x03(\t\"R\n\x11GetReleaseRequest\x12=\n\x04name\x18\x91N \x01(\tB.\xe0\x41\x02\xfa\x41(\n&saasservicemgmt.googleapis.com/Release\"\xf1\x01\n\x14\x43reateReleaseRequest\x12?\n\x06parent\x18\x96N \x01(\tB.\xe0\x41\x02\xfa\x41(\x12&saasservicemgmt.googleapis.com/Release\x12\x18\n\nrelease_id\x18\x87R \x01(\tB\x03\xe0\x41\x02\x12Q\n\x07release\x18\x88R \x01(\x0b\x32:.google.cloud.saasplatform.saasservicemgmt.v1beta1.ReleaseB\x03\xe0\x41\x02\x12\x16\n\rvalidate_only\x18\x85R \x01(\x08\x12\x13\n\nrequest_id\x18\x86R \x01(\t\"\xc8\x01\n\x14UpdateReleaseRequest\x12Q\n\x07release\x18\x88R \x01(\x0b\x32:.google.cloud.saasplatform.saasservicemgmt.v1beta1.ReleaseB\x03\xe0\x41\x02\x12\x16\n\rvalidate_only\x18\x85R \x01(\x08\x12\x13\n\nrequest_id\x18\x86R \x01(\t\x12\x30\n\x0bupdate_mask\x18\x90R \x01(\x0b\x32\x1a.google.protobuf.FieldMask\"\x91\x01\n\x14\x44\x65leteReleaseRequest\x12=\n\x04name\x18\x91N \x01(\tB.\xe0\x41\x02\xfa\x41(\n&saasservicemgmt.googleapis.com/Release\x12\r\n\x04\x65tag\x18\xdaO \x01(\t\x12\x16\n\rvalidate_only\x18\x85R \x01(\x08\x12\x13\n\nrequest_id\x18\x86R \x01(\t2\x9d\x35\n\x0fSaasDeployments\x12\xd3\x01\n\x08ListSaas\x12\x42.google.cloud.saasplatform.saasservicemgmt.v1beta1.ListSaasRequest\x1a\x43.google.cloud.saasplatform.saasservicemgmt.v1beta1.ListSaasResponse\">\xda\x41\x06parent\x82\xd3\xe4\x93\x02/\x12-/v1beta1/{parent=projects/*/locations/*}/saas\x12\xc3\x01\n\x07GetSaas\x12\x41.google.cloud.saasplatform.saasservicemgmt.v1beta1.GetSaasRequest\x1a\x37.google.cloud.saasplatform.saasservicemgmt.v1beta1.Saas\"<\xda\x41\x04name\x82\xd3\xe4\x93\x02/\x12-/v1beta1/{name=projects/*/locations/*/saas/*}\x12\xde\x01\n\nCreateSaas\x12\x44.google.cloud.saasplatform.saasservicemgmt.v1beta1.CreateSaasRequest\x1a\x37.google.cloud.saasplatform.saasservicemgmt.v1beta1.Saas\"Q\xda\x41\x13parent,saas,saas_id\x82\xd3\xe4\x93\x02\x35\"-/v1beta1/{parent=projects/*/locations/*}/saas:\x04saas\x12\xe0\x01\n\nUpdateSaas\x12\x44.google.cloud.saasplatform.saasservicemgmt.v1beta1.UpdateSaasRequest\x1a\x37.google.cloud.saasplatform.saasservicemgmt.v1beta1.Saas\"S\xda\x41\x10saas,update_mask\x82\xd3\xe4\x93\x02:22/v1beta1/{saas.name=projects/*/locations/*/saas/*}:\x04saas\x12\xa8\x01\n\nDeleteSaas\x12\x44.google.cloud.saasplatform.saasservicemgmt.v1beta1.DeleteSaasRequest\x1a\x16.google.protobuf.Empty\"<\xda\x41\x04name\x82\xd3\xe4\x93\x02/*-/v1beta1/{name=projects/*/locations/*/saas/*}\x12\xdf\x01\n\x0bListTenants\x12\x45.google.cloud.saasplatform.saasservicemgmt.v1beta1.ListTenantsRequest\x1a\x46.google.cloud.saasplatform.saasservicemgmt.v1beta1.ListTenantsResponse\"A\xda\x41\x06parent\x82\xd3\xe4\x93\x02\x32\x12\x30/v1beta1/{parent=projects/*/locations/*}/tenants\x12\xcc\x01\n\tGetTenant\x12\x43.google.cloud.saasplatform.saasservicemgmt.v1beta1.GetTenantRequest\x1a\x39.google.cloud.saasplatform.saasservicemgmt.v1beta1.Tenant\"?\xda\x41\x04name\x82\xd3\xe4\x93\x02\x32\x12\x30/v1beta1/{name=projects/*/locations/*/tenants/*}\x12\xed\x01\n\x0c\x43reateTenant\x12\x46.google.cloud.saasplatform.saasservicemgmt.v1beta1.CreateTenantRequest\x1a\x39.google.cloud.saasplatform.saasservicemgmt.v1beta1.Tenant\"Z\xda\x41\x17parent,tenant,tenant_id\x82\xd3\xe4\x93\x02:\"0/v1beta1/{parent=projects/*/locations/*}/tenants:\x06tenant\x12\xef\x01\n\x0cUpdateTenant\x12\x46.google.cloud.saasplatform.saasservicemgmt.v1beta1.UpdateTenantRequest\x1a\x39.google.cloud.saasplatform.saasservicemgmt.v1beta1.Tenant\"\\\xda\x41\x12tenant,update_mask\x82\xd3\xe4\x93\x02\x41\x32\x37/v1beta1/{tenant.name=projects/*/locations/*/tenants/*}:\x06tenant\x12\xaf\x01\n\x0c\x44\x65leteTenant\x12\x46.google.cloud.saasplatform.saasservicemgmt.v1beta1.DeleteTenantRequest\x1a\x16.google.protobuf.Empty\"?\xda\x41\x04name\x82\xd3\xe4\x93\x02\x32*0/v1beta1/{name=projects/*/locations/*/tenants/*}\x12\xe7\x01\n\rListUnitKinds\x12G.google.cloud.saasplatform.saasservicemgmt.v1beta1.ListUnitKindsRequest\x1aH.google.cloud.saasplatform.saasservicemgmt.v1beta1.ListUnitKindsResponse\"C\xda\x41\x06parent\x82\xd3\xe4\x93\x02\x34\x12\x32/v1beta1/{parent=projects/*/locations/*}/unitKinds\x12\xd4\x01\n\x0bGetUnitKind\x12\x45.google.cloud.saasplatform.saasservicemgmt.v1beta1.GetUnitKindRequest\x1a;.google.cloud.saasplatform.saasservicemgmt.v1beta1.UnitKind\"A\xda\x41\x04name\x82\xd3\xe4\x93\x02\x34\x12\x32/v1beta1/{name=projects/*/locations/*/unitKinds/*}\x12\xfe\x01\n\x0e\x43reateUnitKind\x12H.google.cloud.saasplatform.saasservicemgmt.v1beta1.CreateUnitKindRequest\x1a;.google.cloud.saasplatform.saasservicemgmt.v1beta1.UnitKind\"e\xda\x41\x1dparent,unit_kind,unit_kind_id\x82\xd3\xe4\x93\x02?\"2/v1beta1/{parent=projects/*/locations/*}/unitKinds:\tunit_kind\x12\x80\x02\n\x0eUpdateUnitKind\x12H.google.cloud.saasplatform.saasservicemgmt.v1beta1.UpdateUnitKindRequest\x1a;.google.cloud.saasplatform.saasservicemgmt.v1beta1.UnitKind\"g\xda\x41\x15unit_kind,update_mask\x82\xd3\xe4\x93\x02I2.google.cloud.saasplatform.saasservicemgmt.v1beta1.ErrorBudgetB\x03\xe0\x41\x01H\x00\x88\x01\x01\x12`\n\x06labels\x18\xa1Q \x03(\x0b\x32J.google.cloud.saasplatform.saasservicemgmt.v1beta1.RolloutKind.LabelsEntryB\x03\xe0\x41\x01\x12j\n\x0b\x61nnotations\x18\xa2Q \x03(\x0b\x32O.google.cloud.saasplatform.saasservicemgmt.v1beta1.RolloutKind.AnnotationsEntryB\x03\xe0\x41\x01\x12\x19\n\x03uid\x18\xd9O \x01(\tB\x0b\xe0\x41\x03\xe2\x8c\xcf\xd7\x08\x02\x08\x01\x12\x12\n\x04\x65tag\x18\xdaO \x01(\tB\x03\xe0\x41\x03\x12\x35\n\x0b\x63reate_time\x18\xbfP \x01(\x0b\x32\x1a.google.protobuf.TimestampB\x03\xe0\x41\x03\x12\x35\n\x0bupdate_time\x18\xc0P \x01(\x0b\x32\x1a.google.protobuf.TimestampB\x03\xe0\x41\x03\x1a-\n\x0bLabelsEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12\r\n\x05value\x18\x02 \x01(\t:\x02\x38\x01\x1a\x32\n\x10\x41nnotationsEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12\r\n\x05value\x18\x02 \x01(\t:\x02\x38\x01\"\x90\x01\n\x16UpdateUnitKindStrategy\x12)\n%UPDATE_UNIT_KIND_STRATEGY_UNSPECIFIED\x10\x00\x12&\n\"UPDATE_UNIT_KIND_STRATEGY_ON_START\x10\x01\x12#\n\x1fUPDATE_UNIT_KIND_STRATEGY_NEVER\x10\x02:\x93\x01\xea\x41\x8f\x01\n*saasservicemgmt.googleapis.com/RolloutKind\x12\x46projects/{project}/locations/{location}/rolloutKinds/{rollout_kind_id}*\x0crolloutKinds2\x0brolloutKindB\x0f\n\r_error_budget\"J\n\x0b\x45rrorBudget\x12\x1a\n\rallowed_count\x18\x01 \x01(\x05\x42\x03\xe0\x41\x01\x12\x1f\n\x12\x61llowed_percentage\x18\x02 \x01(\x05\x42\x03\xe0\x41\x01\"n\n\x0cRolloutStats\x12^\n\x13operations_by_state\x18\x02 \x03(\x0b\x32<.google.cloud.saasplatform.saasservicemgmt.v1beta1.AggregateB\x03\xe0\x41\x03\"\xad\x02\n\x0eRolloutControl\x12s\n\nrun_params\x18\x02 \x01(\x0b\x32X.google.cloud.saasplatform.saasservicemgmt.v1beta1.RolloutControl.RunRolloutActionParamsB\x03\xe0\x41\x01H\x00\x12U\n\x06\x61\x63tion\x18\x01 \x01(\x0e\x32@.google.cloud.saasplatform.saasservicemgmt.v1beta1.RolloutActionB\x03\xe0\x41\x02\x1a>\n\x16RunRolloutActionParams\x12$\n\x17retry_failed_operations\x18\x01 \x01(\x08\x42\x03\xe0\x41\x02\x42\x0f\n\raction_params*|\n\rRolloutAction\x12\x1e\n\x1aROLLOUT_ACTION_UNSPECIFIED\x10\x00\x12\x16\n\x12ROLLOUT_ACTION_RUN\x10\x01\x12\x18\n\x14ROLLOUT_ACTION_PAUSE\x10\x02\x12\x19\n\x15ROLLOUT_ACTION_CANCEL\x10\x03\x42\xd6\x02\n5com.google.cloud.saasplatform.saasservicemgmt.v1beta1B\x1aSaasRolloutsResourcesProtoP\x01Z_cloud.google.com/go/saasplatform/saasservicemgmt/apiv1beta1/saasservicemgmtpb;saasservicemgmtpb\xaa\x02\x31Google.Cloud.SaasPlatform.SaasServiceMgmt.V1Beta1\xca\x02\x31Google\\Cloud\\SaasPlatform\\SaasServiceMgmt\\V1beta1\xea\x02\x35Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1b\x06proto3" + +pool = ::Google::Protobuf::DescriptorPool.generated_pool +pool.add_serialized_file(descriptor_data) + +module Google + module Cloud + module SaasPlatform + module SaasServiceMgmt + module V1beta1 + Rollout = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.saasplatform.saasservicemgmt.v1beta1.Rollout").msgclass + Rollout::RolloutState = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.saasplatform.saasservicemgmt.v1beta1.Rollout.RolloutState").enummodule + RolloutKind = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.saasplatform.saasservicemgmt.v1beta1.RolloutKind").msgclass + RolloutKind::UpdateUnitKindStrategy = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.saasplatform.saasservicemgmt.v1beta1.RolloutKind.UpdateUnitKindStrategy").enummodule + ErrorBudget = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.saasplatform.saasservicemgmt.v1beta1.ErrorBudget").msgclass + RolloutStats = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.saasplatform.saasservicemgmt.v1beta1.RolloutStats").msgclass + RolloutControl = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.saasplatform.saasservicemgmt.v1beta1.RolloutControl").msgclass + RolloutControl::RunRolloutActionParams = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.saasplatform.saasservicemgmt.v1beta1.RolloutControl.RunRolloutActionParams").msgclass + RolloutAction = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.saasplatform.saasservicemgmt.v1beta1.RolloutAction").enummodule + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-saas_platform-saas_service_mgmt-v1beta1/lib/google/cloud/saasplatform/saasservicemgmt/v1beta1/rollouts_service_pb.rb b/owl-bot-staging/google-cloud-saas_platform-saas_service_mgmt-v1beta1/lib/google/cloud/saasplatform/saasservicemgmt/v1beta1/rollouts_service_pb.rb new file mode 100644 index 000000000000..d26dbd9cf432 --- /dev/null +++ b/owl-bot-staging/google-cloud-saas_platform-saas_service_mgmt-v1beta1/lib/google/cloud/saasplatform/saasservicemgmt/v1beta1/rollouts_service_pb.rb @@ -0,0 +1,42 @@ +# frozen_string_literal: true +# Generated by the protocol buffer compiler. DO NOT EDIT! +# source: google/cloud/saasplatform/saasservicemgmt/v1beta1/rollouts_service.proto + +require 'google/protobuf' + +require 'google/api/annotations_pb' +require 'google/api/client_pb' +require 'google/api/field_behavior_pb' +require 'google/api/resource_pb' +require 'google/cloud/saasplatform/saasservicemgmt/v1beta1/rollouts_resources_pb' +require 'google/protobuf/empty_pb' +require 'google/protobuf/field_mask_pb' + + +descriptor_data = "\nHgoogle/cloud/saasplatform/saasservicemgmt/v1beta1/rollouts_service.proto\x12\x31google.cloud.saasplatform.saasservicemgmt.v1beta1\x1a\x1cgoogle/api/annotations.proto\x1a\x17google/api/client.proto\x1a\x1fgoogle/api/field_behavior.proto\x1a\x19google/api/resource.proto\x1aJgoogle/cloud/saasplatform/saasservicemgmt/v1beta1/rollouts_resources.proto\x1a\x1bgoogle/protobuf/empty.proto\x1a google/protobuf/field_mask.proto\"\xa3\x01\n\x13ListRolloutsRequest\x12?\n\x06parent\x18\x96N \x01(\tB.\xe0\x41\x02\xfa\x41(\x12&saasservicemgmt.googleapis.com/Rollout\x12\x12\n\tpage_size\x18\x89R \x01(\x05\x12\x13\n\npage_token\x18\x8aR \x01(\t\x12\x0f\n\x06\x66ilter\x18\x8bR \x01(\t\x12\x11\n\x08order_by\x18\x8cR \x01(\t\"\x95\x01\n\x14ListRolloutsResponse\x12M\n\x08rollouts\x18\x8dR \x03(\x0b\x32:.google.cloud.saasplatform.saasservicemgmt.v1beta1.Rollout\x12\x18\n\x0fnext_page_token\x18\x8eR \x01(\t\x12\x14\n\x0bunreachable\x18\x8fR \x03(\t\"R\n\x11GetRolloutRequest\x12=\n\x04name\x18\x91N \x01(\tB.\xe0\x41\x02\xfa\x41(\n&saasservicemgmt.googleapis.com/Rollout\"\xf1\x01\n\x14\x43reateRolloutRequest\x12?\n\x06parent\x18\x96N \x01(\tB.\xe0\x41\x02\xfa\x41(\x12&saasservicemgmt.googleapis.com/Rollout\x12\x18\n\nrollout_id\x18\x87R \x01(\tB\x03\xe0\x41\x02\x12Q\n\x07rollout\x18\x88R \x01(\x0b\x32:.google.cloud.saasplatform.saasservicemgmt.v1beta1.RolloutB\x03\xe0\x41\x02\x12\x16\n\rvalidate_only\x18\x85R \x01(\x08\x12\x13\n\nrequest_id\x18\x86R \x01(\t\"\xc8\x01\n\x14UpdateRolloutRequest\x12Q\n\x07rollout\x18\x88R \x01(\x0b\x32:.google.cloud.saasplatform.saasservicemgmt.v1beta1.RolloutB\x03\xe0\x41\x02\x12\x16\n\rvalidate_only\x18\x85R \x01(\x08\x12\x13\n\nrequest_id\x18\x86R \x01(\t\x12\x30\n\x0bupdate_mask\x18\x90R \x01(\x0b\x32\x1a.google.protobuf.FieldMask\"\x91\x01\n\x14\x44\x65leteRolloutRequest\x12=\n\x04name\x18\x91N \x01(\tB.\xe0\x41\x02\xfa\x41(\n&saasservicemgmt.googleapis.com/Rollout\x12\r\n\x04\x65tag\x18\xdaO \x01(\t\x12\x16\n\rvalidate_only\x18\x85R \x01(\x08\x12\x13\n\nrequest_id\x18\x86R \x01(\t\"\xab\x01\n\x17ListRolloutKindsRequest\x12\x43\n\x06parent\x18\x96N \x01(\tB2\xe0\x41\x02\xfa\x41,\x12*saasservicemgmt.googleapis.com/RolloutKind\x12\x12\n\tpage_size\x18\x89R \x01(\x05\x12\x13\n\npage_token\x18\x8aR \x01(\t\x12\x0f\n\x06\x66ilter\x18\x8bR \x01(\t\x12\x11\n\x08order_by\x18\x8cR \x01(\t\"\xa2\x01\n\x18ListRolloutKindsResponse\x12V\n\rrollout_kinds\x18\x8dR \x03(\x0b\x32>.google.cloud.saasplatform.saasservicemgmt.v1beta1.RolloutKind\x12\x18\n\x0fnext_page_token\x18\x8eR \x01(\t\x12\x14\n\x0bunreachable\x18\x8fR \x03(\t\"Z\n\x15GetRolloutKindRequest\x12\x41\n\x04name\x18\x91N \x01(\tB2\xe0\x41\x02\xfa\x41,\n*saasservicemgmt.googleapis.com/RolloutKind\"\x87\x02\n\x18\x43reateRolloutKindRequest\x12\x43\n\x06parent\x18\x96N \x01(\tB2\xe0\x41\x02\xfa\x41,\x12*saasservicemgmt.googleapis.com/RolloutKind\x12\x1d\n\x0frollout_kind_id\x18\x87R \x01(\tB\x03\xe0\x41\x02\x12Z\n\x0crollout_kind\x18\x88R \x01(\x0b\x32>.google.cloud.saasplatform.saasservicemgmt.v1beta1.RolloutKindB\x03\xe0\x41\x02\x12\x16\n\rvalidate_only\x18\x85R \x01(\x08\x12\x13\n\nrequest_id\x18\x86R \x01(\t\"\xd5\x01\n\x18UpdateRolloutKindRequest\x12Z\n\x0crollout_kind\x18\x88R \x01(\x0b\x32>.google.cloud.saasplatform.saasservicemgmt.v1beta1.RolloutKindB\x03\xe0\x41\x02\x12\x16\n\rvalidate_only\x18\x85R \x01(\x08\x12\x13\n\nrequest_id\x18\x86R \x01(\t\x12\x30\n\x0bupdate_mask\x18\x90R \x01(\x0b\x32\x1a.google.protobuf.FieldMask\"\x99\x01\n\x18\x44\x65leteRolloutKindRequest\x12\x41\n\x04name\x18\x91N \x01(\tB2\xe0\x41\x02\xfa\x41,\n*saasservicemgmt.googleapis.com/RolloutKind\x12\r\n\x04\x65tag\x18\xdaO \x01(\t\x12\x16\n\rvalidate_only\x18\x85R \x01(\x08\x12\x13\n\nrequest_id\x18\x86R \x01(\t2\x88\x13\n\x0cSaasRollouts\x12\xe3\x01\n\x0cListRollouts\x12\x46.google.cloud.saasplatform.saasservicemgmt.v1beta1.ListRolloutsRequest\x1aG.google.cloud.saasplatform.saasservicemgmt.v1beta1.ListRolloutsResponse\"B\xda\x41\x06parent\x82\xd3\xe4\x93\x02\x33\x12\x31/v1beta1/{parent=projects/*/locations/*}/rollouts\x12\xd0\x01\n\nGetRollout\x12\x44.google.cloud.saasplatform.saasservicemgmt.v1beta1.GetRolloutRequest\x1a:.google.cloud.saasplatform.saasservicemgmt.v1beta1.Rollout\"@\xda\x41\x04name\x82\xd3\xe4\x93\x02\x33\x12\x31/v1beta1/{name=projects/*/locations/*/rollouts/*}\x12\xf4\x01\n\rCreateRollout\x12G.google.cloud.saasplatform.saasservicemgmt.v1beta1.CreateRolloutRequest\x1a:.google.cloud.saasplatform.saasservicemgmt.v1beta1.Rollout\"^\xda\x41\x19parent,rollout,rollout_id\x82\xd3\xe4\x93\x02<\"1/v1beta1/{parent=projects/*/locations/*}/rollouts:\x07rollout\x12\xf6\x01\n\rUpdateRollout\x12G.google.cloud.saasplatform.saasservicemgmt.v1beta1.UpdateRolloutRequest\x1a:.google.cloud.saasplatform.saasservicemgmt.v1beta1.Rollout\"`\xda\x41\x13rollout,update_mask\x82\xd3\xe4\x93\x02\x44\x32\x39/v1beta1/{rollout.name=projects/*/locations/*/rollouts/*}:\x07rollout\x12\xb2\x01\n\rDeleteRollout\x12G.google.cloud.saasplatform.saasservicemgmt.v1beta1.DeleteRolloutRequest\x1a\x16.google.protobuf.Empty\"@\xda\x41\x04name\x82\xd3\xe4\x93\x02\x33*1/v1beta1/{name=projects/*/locations/*/rollouts/*}\x12\xf3\x01\n\x10ListRolloutKinds\x12J.google.cloud.saasplatform.saasservicemgmt.v1beta1.ListRolloutKindsRequest\x1aK.google.cloud.saasplatform.saasservicemgmt.v1beta1.ListRolloutKindsResponse\"F\xda\x41\x06parent\x82\xd3\xe4\x93\x02\x37\x12\x35/v1beta1/{parent=projects/*/locations/*}/rolloutKinds\x12\xe0\x01\n\x0eGetRolloutKind\x12H.google.cloud.saasplatform.saasservicemgmt.v1beta1.GetRolloutKindRequest\x1a>.google.cloud.saasplatform.saasservicemgmt.v1beta1.RolloutKind\"D\xda\x41\x04name\x82\xd3\xe4\x93\x02\x37\x12\x35/v1beta1/{name=projects/*/locations/*/rolloutKinds/*}\x12\x93\x02\n\x11\x43reateRolloutKind\x12K.google.cloud.saasplatform.saasservicemgmt.v1beta1.CreateRolloutKindRequest\x1a>.google.cloud.saasplatform.saasservicemgmt.v1beta1.RolloutKind\"q\xda\x41#parent,rollout_kind,rollout_kind_id\x82\xd3\xe4\x93\x02\x45\"5/v1beta1/{parent=projects/*/locations/*}/rolloutKinds:\x0crollout_kind\x12\x95\x02\n\x11UpdateRolloutKind\x12K.google.cloud.saasplatform.saasservicemgmt.v1beta1.UpdateRolloutKindRequest\x1a>.google.cloud.saasplatform.saasservicemgmt.v1beta1.RolloutKind\"s\xda\x41\x18rollout_kind,update_mask\x82\xd3\xe4\x93\x02R2B/v1beta1/{rollout_kind.name=projects/*/locations/*/rolloutKinds/*}:\x0crollout_kind\x12\xbe\x01\n\x11\x44\x65leteRolloutKind\x12K.google.cloud.saasplatform.saasservicemgmt.v1beta1.DeleteRolloutKindRequest\x1a\x16.google.protobuf.Empty\"D\xda\x41\x04name\x82\xd3\xe4\x93\x02\x37*5/v1beta1/{name=projects/*/locations/*/rolloutKinds/*}\x1aR\xca\x41\x1esaasservicemgmt.googleapis.com\xd2\x41.https://www.googleapis.com/auth/cloud-platformB\xd4\x02\n5com.google.cloud.saasplatform.saasservicemgmt.v1beta1B\x18SaasRolloutsServiceProtoP\x01Z_cloud.google.com/go/saasplatform/saasservicemgmt/apiv1beta1/saasservicemgmtpb;saasservicemgmtpb\xaa\x02\x31Google.Cloud.SaasPlatform.SaasServiceMgmt.V1Beta1\xca\x02\x31Google\\Cloud\\SaasPlatform\\SaasServiceMgmt\\V1beta1\xea\x02\x35Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1b\x06proto3" + +pool = ::Google::Protobuf::DescriptorPool.generated_pool +pool.add_serialized_file(descriptor_data) + +module Google + module Cloud + module SaasPlatform + module SaasServiceMgmt + module V1beta1 + ListRolloutsRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.saasplatform.saasservicemgmt.v1beta1.ListRolloutsRequest").msgclass + ListRolloutsResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.saasplatform.saasservicemgmt.v1beta1.ListRolloutsResponse").msgclass + GetRolloutRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.saasplatform.saasservicemgmt.v1beta1.GetRolloutRequest").msgclass + CreateRolloutRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.saasplatform.saasservicemgmt.v1beta1.CreateRolloutRequest").msgclass + UpdateRolloutRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.saasplatform.saasservicemgmt.v1beta1.UpdateRolloutRequest").msgclass + DeleteRolloutRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.saasplatform.saasservicemgmt.v1beta1.DeleteRolloutRequest").msgclass + ListRolloutKindsRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.saasplatform.saasservicemgmt.v1beta1.ListRolloutKindsRequest").msgclass + ListRolloutKindsResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.saasplatform.saasservicemgmt.v1beta1.ListRolloutKindsResponse").msgclass + GetRolloutKindRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.saasplatform.saasservicemgmt.v1beta1.GetRolloutKindRequest").msgclass + CreateRolloutKindRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.saasplatform.saasservicemgmt.v1beta1.CreateRolloutKindRequest").msgclass + UpdateRolloutKindRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.saasplatform.saasservicemgmt.v1beta1.UpdateRolloutKindRequest").msgclass + DeleteRolloutKindRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.saasplatform.saasservicemgmt.v1beta1.DeleteRolloutKindRequest").msgclass + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-saas_platform-saas_service_mgmt-v1beta1/lib/google/cloud/saasplatform/saasservicemgmt/v1beta1/rollouts_service_services_pb.rb b/owl-bot-staging/google-cloud-saas_platform-saas_service_mgmt-v1beta1/lib/google/cloud/saasplatform/saasservicemgmt/v1beta1/rollouts_service_services_pb.rb new file mode 100644 index 000000000000..48e36153293b --- /dev/null +++ b/owl-bot-staging/google-cloud-saas_platform-saas_service_mgmt-v1beta1/lib/google/cloud/saasplatform/saasservicemgmt/v1beta1/rollouts_service_services_pb.rb @@ -0,0 +1,65 @@ +# Generated by the protocol buffer compiler. DO NOT EDIT! +# Source: google/cloud/saasplatform/saasservicemgmt/v1beta1/rollouts_service.proto for package 'Google.Cloud.SaasPlatform.SaasServiceMgmt.V1beta1' +# Original file comments: +# 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 +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# + +require 'grpc' +require 'google/cloud/saasplatform/saasservicemgmt/v1beta1/rollouts_service_pb' + +module Google + module Cloud + module SaasPlatform + module SaasServiceMgmt + module V1beta1 + module SaasRollouts + # Manages the rollout of SaaS services. + class Service + + include ::GRPC::GenericService + + self.marshal_class_method = :encode + self.unmarshal_class_method = :decode + self.service_name = 'google.cloud.saasplatform.saasservicemgmt.v1beta1.SaasRollouts' + + # Retrieve a collection of rollouts. + rpc :ListRollouts, ::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::ListRolloutsRequest, ::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::ListRolloutsResponse + # Retrieve a single rollout. + rpc :GetRollout, ::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::GetRolloutRequest, ::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::Rollout + # Create a new rollout. + rpc :CreateRollout, ::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::CreateRolloutRequest, ::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::Rollout + # Update a single rollout. + rpc :UpdateRollout, ::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::UpdateRolloutRequest, ::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::Rollout + # Delete a single rollout. + rpc :DeleteRollout, ::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::DeleteRolloutRequest, ::Google::Protobuf::Empty + # Retrieve a collection of rollout kinds. + rpc :ListRolloutKinds, ::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::ListRolloutKindsRequest, ::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::ListRolloutKindsResponse + # Retrieve a single rollout kind. + rpc :GetRolloutKind, ::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::GetRolloutKindRequest, ::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::RolloutKind + # Create a new rollout kind. + rpc :CreateRolloutKind, ::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::CreateRolloutKindRequest, ::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::RolloutKind + # Update a single rollout kind. + rpc :UpdateRolloutKind, ::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::UpdateRolloutKindRequest, ::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::RolloutKind + # Delete a single rollout kind. + rpc :DeleteRolloutKind, ::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::DeleteRolloutKindRequest, ::Google::Protobuf::Empty + end + + Stub = Service.rpc_stub_class + end + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-saas_platform-saas_service_mgmt-v1beta1/proto_docs/README.md b/owl-bot-staging/google-cloud-saas_platform-saas_service_mgmt-v1beta1/proto_docs/README.md new file mode 100644 index 000000000000..10d10d09fe56 --- /dev/null +++ b/owl-bot-staging/google-cloud-saas_platform-saas_service_mgmt-v1beta1/proto_docs/README.md @@ -0,0 +1,4 @@ +# SaaS Runtime V1BETA1 Protocol Buffer Documentation + +These files are for the YARD documentation of the generated protobuf files. +They are not intended to be required or loaded at runtime. diff --git a/owl-bot-staging/google-cloud-saas_platform-saas_service_mgmt-v1beta1/proto_docs/google/api/client.rb b/owl-bot-staging/google-cloud-saas_platform-saas_service_mgmt-v1beta1/proto_docs/google/api/client.rb new file mode 100644 index 000000000000..5089551e9ea4 --- /dev/null +++ b/owl-bot-staging/google-cloud-saas_platform-saas_service_mgmt-v1beta1/proto_docs/google/api/client.rb @@ -0,0 +1,589 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + + +module Google + module Api + # Required information for every language. + # @!attribute [rw] reference_docs_uri + # @deprecated This field is deprecated and may be removed in the next major version update. + # @return [::String] + # Link to automatically generated reference documentation. Example: + # https://cloud.google.com/nodejs/docs/reference/asset/latest + # @!attribute [rw] destinations + # @return [::Array<::Google::Api::ClientLibraryDestination>] + # The destination where API teams want this client library to be published. + # @!attribute [rw] selective_gapic_generation + # @return [::Google::Api::SelectiveGapicGeneration] + # Configuration for which RPCs should be generated in the GAPIC client. + class CommonLanguageSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Details about how and where to publish client libraries. + # @!attribute [rw] version + # @return [::String] + # Version of the API to apply these settings to. This is the full protobuf + # package for the API, ending in the version element. + # Examples: "google.cloud.speech.v1" and "google.spanner.admin.database.v1". + # @!attribute [rw] launch_stage + # @return [::Google::Api::LaunchStage] + # Launch stage of this version of the API. + # @!attribute [rw] rest_numeric_enums + # @return [::Boolean] + # When using transport=rest, the client request will encode enums as + # numbers rather than strings. + # @!attribute [rw] java_settings + # @return [::Google::Api::JavaSettings] + # Settings for legacy Java features, supported in the Service YAML. + # @!attribute [rw] cpp_settings + # @return [::Google::Api::CppSettings] + # Settings for C++ client libraries. + # @!attribute [rw] php_settings + # @return [::Google::Api::PhpSettings] + # Settings for PHP client libraries. + # @!attribute [rw] python_settings + # @return [::Google::Api::PythonSettings] + # Settings for Python client libraries. + # @!attribute [rw] node_settings + # @return [::Google::Api::NodeSettings] + # Settings for Node client libraries. + # @!attribute [rw] dotnet_settings + # @return [::Google::Api::DotnetSettings] + # Settings for .NET client libraries. + # @!attribute [rw] ruby_settings + # @return [::Google::Api::RubySettings] + # Settings for Ruby client libraries. + # @!attribute [rw] go_settings + # @return [::Google::Api::GoSettings] + # Settings for Go client libraries. + class ClientLibrarySettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # This message configures the settings for publishing [Google Cloud Client + # libraries](https://cloud.google.com/apis/docs/cloud-client-libraries) + # generated from the service config. + # @!attribute [rw] method_settings + # @return [::Array<::Google::Api::MethodSettings>] + # A list of API method settings, e.g. the behavior for methods that use the + # long-running operation pattern. + # @!attribute [rw] new_issue_uri + # @return [::String] + # Link to a *public* URI where users can report issues. Example: + # https://issuetracker.google.com/issues/new?component=190865&template=1161103 + # @!attribute [rw] documentation_uri + # @return [::String] + # Link to product home page. Example: + # https://cloud.google.com/asset-inventory/docs/overview + # @!attribute [rw] api_short_name + # @return [::String] + # Used as a tracking tag when collecting data about the APIs developer + # relations artifacts like docs, packages delivered to package managers, + # etc. Example: "speech". + # @!attribute [rw] github_label + # @return [::String] + # GitHub label to apply to issues and pull requests opened for this API. + # @!attribute [rw] codeowner_github_teams + # @return [::Array<::String>] + # GitHub teams to be added to CODEOWNERS in the directory in GitHub + # containing source code for the client libraries for this API. + # @!attribute [rw] doc_tag_prefix + # @return [::String] + # A prefix used in sample code when demarking regions to be included in + # documentation. + # @!attribute [rw] organization + # @return [::Google::Api::ClientLibraryOrganization] + # For whom the client library is being published. + # @!attribute [rw] library_settings + # @return [::Array<::Google::Api::ClientLibrarySettings>] + # Client library settings. If the same version string appears multiple + # times in this list, then the last one wins. Settings from earlier + # settings with the same version string are discarded. + # @!attribute [rw] proto_reference_documentation_uri + # @return [::String] + # Optional link to proto reference documentation. Example: + # https://cloud.google.com/pubsub/lite/docs/reference/rpc + # @!attribute [rw] rest_reference_documentation_uri + # @return [::String] + # Optional link to REST reference documentation. Example: + # https://cloud.google.com/pubsub/lite/docs/reference/rest + class Publishing + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Settings for Java client libraries. + # @!attribute [rw] library_package + # @return [::String] + # The package name to use in Java. Clobbers the java_package option + # set in the protobuf. This should be used **only** by APIs + # who have already set the language_settings.java.package_name" field + # in gapic.yaml. API teams should use the protobuf java_package option + # where possible. + # + # Example of a YAML configuration:: + # + # publishing: + # 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. + # @!attribute [rw] methods + # @return [::Array<::String>] + # An allowlist of the fully qualified names of RPCs that should be included + # on public client surfaces. + # @!attribute [rw] generate_omitted_as_internal + # @return [::Boolean] + # Setting this to true indicates to the client generators that methods + # that would be excluded from the generation should instead be generated + # in a way that indicates these methods should not be consumed by + # end users. How this is expressed is up to individual language + # implementations to decide. Some examples may be: added annotations, + # obfuscated identifiers, or other language idiomatic patterns. + class SelectiveGapicGeneration + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # `BatchingConfigProto` defines the batching configuration for an API method. + # @!attribute [rw] thresholds + # @return [::Google::Api::BatchingSettingsProto] + # The thresholds which trigger a batched request to be sent. + # @!attribute [rw] batch_descriptor + # @return [::Google::Api::BatchingDescriptorProto] + # The request and response fields used in batching. + class BatchingConfigProto + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # `BatchingSettingsProto` specifies a set of batching thresholds, each of + # which acts as a trigger to send a batch of messages as a request. At least + # one threshold must be positive nonzero. + # @!attribute [rw] element_count_threshold + # @return [::Integer] + # The number of elements of a field collected into a batch which, if + # exceeded, causes the batch to be sent. + # @!attribute [rw] request_byte_threshold + # @return [::Integer] + # The aggregated size of the batched field which, if exceeded, causes the + # batch to be sent. This size is computed by aggregating the sizes of the + # request field to be batched, not of the entire request message. + # @!attribute [rw] delay_threshold + # @return [::Google::Protobuf::Duration] + # The duration after which a batch should be sent, starting from the addition + # of the first message to that batch. + # @!attribute [rw] element_count_limit + # @return [::Integer] + # The maximum number of elements collected in a batch that could be accepted + # by server. + # @!attribute [rw] request_byte_limit + # @return [::Integer] + # The maximum size of the request that could be accepted by server. + # @!attribute [rw] flow_control_element_limit + # @return [::Integer] + # The maximum number of elements allowed by flow control. + # @!attribute [rw] flow_control_byte_limit + # @return [::Integer] + # The maximum size of data allowed by flow control. + # @!attribute [rw] flow_control_limit_exceeded_behavior + # @return [::Google::Api::FlowControlLimitExceededBehaviorProto] + # The behavior to take when the flow control limit is exceeded. + class BatchingSettingsProto + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # `BatchingDescriptorProto` specifies the fields of the request message to be + # used for batching, and, optionally, the fields of the response message to be + # used for demultiplexing. + # @!attribute [rw] batched_field + # @return [::String] + # The repeated field in the request message to be aggregated by batching. + # @!attribute [rw] discriminator_fields + # @return [::Array<::String>] + # A list of the fields in the request message. Two requests will be batched + # together only if the values of every field specified in + # `request_discriminator_fields` is equal between the two requests. + # @!attribute [rw] subresponse_field + # @return [::String] + # Optional. When present, indicates the field in the response message to be + # used to demultiplex the response into multiple response messages, in + # correspondence with the multiple request messages originally batched + # together. + class BatchingDescriptorProto + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # The organization for which the client libraries are being published. + # Affects the url where generated docs are published, etc. + module ClientLibraryOrganization + # Not useful. + CLIENT_LIBRARY_ORGANIZATION_UNSPECIFIED = 0 + + # Google Cloud Platform Org. + CLOUD = 1 + + # Ads (Advertising) Org. + ADS = 2 + + # Photos Org. + PHOTOS = 3 + + # Street View Org. + STREET_VIEW = 4 + + # Shopping Org. + SHOPPING = 5 + + # Geo Org. + GEO = 6 + + # Generative AI - https://developers.generativeai.google + GENERATIVE_AI = 7 + end + + # To where should client libraries be published? + module ClientLibraryDestination + # Client libraries will neither be generated nor published to package + # managers. + CLIENT_LIBRARY_DESTINATION_UNSPECIFIED = 0 + + # Generate the client library in a repo under github.com/googleapis, + # but don't publish it to package managers. + GITHUB = 10 + + # Publish the library to package managers like nuget.org and npmjs.com. + PACKAGE_MANAGER = 20 + end + + # The behavior to take when the flow control limit is exceeded. + module FlowControlLimitExceededBehaviorProto + # Default behavior, system-defined. + UNSET_BEHAVIOR = 0 + + # Stop operation, raise error. + THROW_EXCEPTION = 1 + + # Pause operation until limit clears. + BLOCK = 2 + + # Continue operation, disregard limit. + IGNORE = 3 + end + end +end diff --git a/owl-bot-staging/google-cloud-saas_platform-saas_service_mgmt-v1beta1/proto_docs/google/api/field_behavior.rb b/owl-bot-staging/google-cloud-saas_platform-saas_service_mgmt-v1beta1/proto_docs/google/api/field_behavior.rb new file mode 100644 index 000000000000..582be187d115 --- /dev/null +++ b/owl-bot-staging/google-cloud-saas_platform-saas_service_mgmt-v1beta1/proto_docs/google/api/field_behavior.rb @@ -0,0 +1,85 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + + +module Google + module Api + # An indicator of the behavior of a given field (for example, that a field + # is required in requests, or given as output but ignored as input). + # This **does not** change the behavior in protocol buffers itself; it only + # denotes the behavior and may affect how API tooling handles the field. + # + # Note: This enum **may** receive new values in the future. + module FieldBehavior + # Conventional default for enums. Do not use this. + FIELD_BEHAVIOR_UNSPECIFIED = 0 + + # Specifically denotes a field as optional. + # While all fields in protocol buffers are optional, this may be specified + # for emphasis if appropriate. + OPTIONAL = 1 + + # Denotes a field as required. + # This indicates that the field **must** be provided as part of the request, + # and failure to do so will cause an error (usually `INVALID_ARGUMENT`). + REQUIRED = 2 + + # Denotes a field as output only. + # This indicates that the field is provided in responses, but including the + # field in a request does nothing (the server *must* ignore it and + # *must not* throw an error as a result of the field's presence). + OUTPUT_ONLY = 3 + + # Denotes a field as input only. + # This indicates that the field is provided in requests, and the + # corresponding field is not included in output. + INPUT_ONLY = 4 + + # Denotes a field as immutable. + # This indicates that the field may be set once in a request to create a + # resource, but may not be changed thereafter. + IMMUTABLE = 5 + + # Denotes that a (repeated) field is an unordered list. + # This indicates that the service may provide the elements of the list + # in any arbitrary order, rather than the order the user originally + # provided. Additionally, the list's order may or may not be stable. + UNORDERED_LIST = 6 + + # Denotes that this field returns a non-empty default value if not set. + # This indicates that if the user provides the empty value in a request, + # a non-empty value will be returned. The user will not be aware of what + # non-empty value to expect. + NON_EMPTY_DEFAULT = 7 + + # Denotes that the field in a resource (a message annotated with + # google.api.resource) is used in the resource name to uniquely identify the + # resource. For AIP-compliant APIs, this should only be applied to the + # `name` field on the resource. + # + # This behavior should not be applied to references to other resources within + # the message. + # + # The identifier field of resources often have different field behavior + # depending on the request it is embedded in (e.g. for Create methods name + # is optional and unused, while for Update methods it is required). Instead + # of method-specific annotations, only `IDENTIFIER` is required. + IDENTIFIER = 8 + end + end +end diff --git a/owl-bot-staging/google-cloud-saas_platform-saas_service_mgmt-v1beta1/proto_docs/google/api/field_info.rb b/owl-bot-staging/google-cloud-saas_platform-saas_service_mgmt-v1beta1/proto_docs/google/api/field_info.rb new file mode 100644 index 000000000000..0f5acf0a5538 --- /dev/null +++ b/owl-bot-staging/google-cloud-saas_platform-saas_service_mgmt-v1beta1/proto_docs/google/api/field_info.rb @@ -0,0 +1,88 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + + +module Google + module Api + # Rich semantic information of an API field beyond basic typing. + # @!attribute [rw] format + # @return [::Google::Api::FieldInfo::Format] + # The standard format of a field value. This does not explicitly configure + # any API consumer, just documents the API's format for the field it is + # applied to. + # @!attribute [rw] referenced_types + # @return [::Array<::Google::Api::TypeReference>] + # The type(s) that the annotated, generic field may represent. + # + # Currently, this must only be used on fields of type `google.protobuf.Any`. + # Supporting other generic types may be considered in the future. + class FieldInfo + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # The standard format of a field value. The supported formats are all backed + # by either an RFC defined by the IETF or a Google-defined AIP. + module Format + # Default, unspecified value. + FORMAT_UNSPECIFIED = 0 + + # Universally Unique Identifier, version 4, value as defined by + # https://datatracker.ietf.org/doc/html/rfc4122. The value may be + # normalized to entirely lowercase letters. For example, the value + # `F47AC10B-58CC-0372-8567-0E02B2C3D479` would be normalized to + # `f47ac10b-58cc-0372-8567-0e02b2c3d479`. + UUID4 = 1 + + # Internet Protocol v4 value as defined by [RFC + # 791](https://datatracker.ietf.org/doc/html/rfc791). The value may be + # condensed, with leading zeros in each octet stripped. For example, + # `001.022.233.040` would be condensed to `1.22.233.40`. + IPV4 = 2 + + # Internet Protocol v6 value as defined by [RFC + # 2460](https://datatracker.ietf.org/doc/html/rfc2460). The value may be + # normalized to entirely lowercase letters with zeros compressed, following + # [RFC 5952](https://datatracker.ietf.org/doc/html/rfc5952). For example, + # the value `2001:0DB8:0::0` would be normalized to `2001:db8::`. + IPV6 = 3 + + # An IP address in either v4 or v6 format as described by the individual + # values defined herein. See the comments on the IPV4 and IPV6 types for + # allowed normalizations of each. + IPV4_OR_IPV6 = 4 + end + end + + # A reference to a message type, for use in {::Google::Api::FieldInfo FieldInfo}. + # @!attribute [rw] type_name + # @return [::String] + # The name of the type that the annotated, generic field may represent. + # If the type is in the same protobuf package, the value can be the simple + # message name e.g., `"MyMessage"`. Otherwise, the value must be the + # fully-qualified message name e.g., `"google.library.v1.Book"`. + # + # If the type(s) are unknown to the service (e.g. the field accepts generic + # user input), use the wildcard `"*"` to denote this behavior. + # + # See [AIP-202](https://google.aip.dev/202#type-references) for more details. + class TypeReference + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end +end diff --git a/owl-bot-staging/google-cloud-saas_platform-saas_service_mgmt-v1beta1/proto_docs/google/api/launch_stage.rb b/owl-bot-staging/google-cloud-saas_platform-saas_service_mgmt-v1beta1/proto_docs/google/api/launch_stage.rb new file mode 100644 index 000000000000..9392a413fb1b --- /dev/null +++ b/owl-bot-staging/google-cloud-saas_platform-saas_service_mgmt-v1beta1/proto_docs/google/api/launch_stage.rb @@ -0,0 +1,71 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + + +module Google + module Api + # The launch stage as defined by [Google Cloud Platform + # Launch Stages](https://cloud.google.com/terms/launch-stages). + module LaunchStage + # Do not use this default value. + LAUNCH_STAGE_UNSPECIFIED = 0 + + # The feature is not yet implemented. Users can not use it. + UNIMPLEMENTED = 6 + + # Prelaunch features are hidden from users and are only visible internally. + PRELAUNCH = 7 + + # Early Access features are limited to a closed group of testers. To use + # these features, you must sign up in advance and sign a Trusted Tester + # agreement (which includes confidentiality provisions). These features may + # be unstable, changed in backward-incompatible ways, and are not + # guaranteed to be released. + EARLY_ACCESS = 1 + + # Alpha is a limited availability test for releases before they are cleared + # for widespread use. By Alpha, all significant design issues are resolved + # and we are in the process of verifying functionality. Alpha customers + # need to apply for access, agree to applicable terms, and have their + # projects allowlisted. Alpha releases don't have to be feature complete, + # no SLAs are provided, and there are no technical support obligations, but + # they will be far enough along that customers can actually use them in + # test environments or for limited-use tests -- just like they would in + # normal production cases. + ALPHA = 2 + + # Beta is the point at which we are ready to open a release for any + # customer to use. There are no SLA or technical support obligations in a + # Beta release. Products will be complete from a feature perspective, but + # may have some open outstanding issues. Beta releases are suitable for + # limited production use cases. + BETA = 3 + + # GA features are open to all developers and are considered stable and + # fully qualified for production use. + GA = 4 + + # Deprecated features are scheduled to be shut down and removed. For more + # information, see the "Deprecation Policy" section of our [Terms of + # Service](https://cloud.google.com/terms/) + # and the [Google Cloud Platform Subject to the Deprecation + # Policy](https://cloud.google.com/terms/deprecation) documentation. + DEPRECATED = 5 + end + end +end diff --git a/owl-bot-staging/google-cloud-saas_platform-saas_service_mgmt-v1beta1/proto_docs/google/api/resource.rb b/owl-bot-staging/google-cloud-saas_platform-saas_service_mgmt-v1beta1/proto_docs/google/api/resource.rb new file mode 100644 index 000000000000..25dec4847ac1 --- /dev/null +++ b/owl-bot-staging/google-cloud-saas_platform-saas_service_mgmt-v1beta1/proto_docs/google/api/resource.rb @@ -0,0 +1,227 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + + +module Google + module Api + # A simple descriptor of a resource type. + # + # ResourceDescriptor annotates a resource message (either by means of a + # protobuf annotation or use in the service config), and associates the + # resource's schema, the resource type, and the pattern of the resource name. + # + # Example: + # + # message Topic { + # // Indicates this message defines a resource schema. + # // Declares the resource type in the format of {service}/{kind}. + # // For Kubernetes resources, the format is {api group}/{kind}. + # option (google.api.resource) = { + # type: "pubsub.googleapis.com/Topic" + # pattern: "projects/{project}/topics/{topic}" + # }; + # } + # + # The ResourceDescriptor Yaml config will look like: + # + # resources: + # - type: "pubsub.googleapis.com/Topic" + # pattern: "projects/{project}/topics/{topic}" + # + # Sometimes, resources have multiple patterns, typically because they can + # live under multiple parents. + # + # Example: + # + # message LogEntry { + # option (google.api.resource) = { + # type: "logging.googleapis.com/LogEntry" + # pattern: "projects/{project}/logs/{log}" + # pattern: "folders/{folder}/logs/{log}" + # pattern: "organizations/{organization}/logs/{log}" + # pattern: "billingAccounts/{billing_account}/logs/{log}" + # }; + # } + # + # The ResourceDescriptor Yaml config will look like: + # + # resources: + # - type: 'logging.googleapis.com/LogEntry' + # pattern: "projects/{project}/logs/{log}" + # pattern: "folders/{folder}/logs/{log}" + # pattern: "organizations/{organization}/logs/{log}" + # pattern: "billingAccounts/{billing_account}/logs/{log}" + # @!attribute [rw] type + # @return [::String] + # The resource type. It must be in the format of + # \\{service_name}/\\{resource_type_kind}. The `resource_type_kind` must be + # singular and must not include version numbers. + # + # Example: `storage.googleapis.com/Bucket` + # + # The value of the resource_type_kind must follow the regular expression + # /[A-Za-z][a-zA-Z0-9]+/. It should start with an upper case character and + # should use PascalCase (UpperCamelCase). The maximum number of + # characters allowed for the `resource_type_kind` is 100. + # @!attribute [rw] pattern + # @return [::Array<::String>] + # Optional. The relative resource name pattern associated with this resource + # type. The DNS prefix of the full resource name shouldn't be specified here. + # + # The path pattern must follow the syntax, which aligns with HTTP binding + # syntax: + # + # Template = Segment { "/" Segment } ; + # Segment = LITERAL | Variable ; + # Variable = "{" LITERAL "}" ; + # + # Examples: + # + # - "projects/\\{project}/topics/\\{topic}" + # - "projects/\\{project}/knowledgeBases/\\{knowledge_base}" + # + # The components in braces correspond to the IDs for each resource in the + # hierarchy. It is expected that, if multiple patterns are provided, + # the same component name (e.g. "project") refers to IDs of the same + # type of resource. + # @!attribute [rw] name_field + # @return [::String] + # Optional. The field on the resource that designates the resource name + # field. If omitted, this is assumed to be "name". + # @!attribute [rw] history + # @return [::Google::Api::ResourceDescriptor::History] + # Optional. The historical or future-looking state of the resource pattern. + # + # Example: + # + # // The InspectTemplate message originally only supported resource + # // names with organization, and project was added later. + # message InspectTemplate { + # option (google.api.resource) = { + # type: "dlp.googleapis.com/InspectTemplate" + # pattern: + # "organizations/{organization}/inspectTemplates/{inspect_template}" + # pattern: "projects/{project}/inspectTemplates/{inspect_template}" + # history: ORIGINALLY_SINGLE_PATTERN + # }; + # } + # @!attribute [rw] plural + # @return [::String] + # The plural name used in the resource name and permission names, such as + # 'projects' for the resource name of 'projects/\\{project}' and the permission + # name of 'cloudresourcemanager.googleapis.com/projects.get'. One exception + # to this is for Nested Collections that have stuttering names, as defined + # in [AIP-122](https://google.aip.dev/122#nested-collections), where the + # collection ID in the resource name pattern does not necessarily directly + # match the `plural` value. + # + # It is the same concept of the `plural` field in k8s CRD spec + # https://kubernetes.io/docs/tasks/access-kubernetes-api/custom-resources/custom-resource-definitions/ + # + # Note: The plural form is required even for singleton resources. See + # https://aip.dev/156 + # @!attribute [rw] singular + # @return [::String] + # The same concept of the `singular` field in k8s CRD spec + # https://kubernetes.io/docs/tasks/access-kubernetes-api/custom-resources/custom-resource-definitions/ + # Such as "project" for the `resourcemanager.googleapis.com/Project` type. + # @!attribute [rw] style + # @return [::Array<::Google::Api::ResourceDescriptor::Style>] + # Style flag(s) for this resource. + # These indicate that a resource is expected to conform to a given + # style. See the specific style flags for additional information. + class ResourceDescriptor + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # A description of the historical or future-looking state of the + # resource pattern. + module History + # The "unset" value. + HISTORY_UNSPECIFIED = 0 + + # The resource originally had one pattern and launched as such, and + # additional patterns were added later. + ORIGINALLY_SINGLE_PATTERN = 1 + + # The resource has one pattern, but the API owner expects to add more + # later. (This is the inverse of ORIGINALLY_SINGLE_PATTERN, and prevents + # that from being necessary once there are multiple patterns.) + FUTURE_MULTI_PATTERN = 2 + end + + # A flag representing a specific style that a resource claims to conform to. + module Style + # The unspecified value. Do not use. + STYLE_UNSPECIFIED = 0 + + # This resource is intended to be "declarative-friendly". + # + # Declarative-friendly resources must be more strictly consistent, and + # setting this to true communicates to tools that this resource should + # adhere to declarative-friendly expectations. + # + # Note: This is used by the API linter (linter.aip.dev) to enable + # additional checks. + DECLARATIVE_FRIENDLY = 1 + end + end + + # Defines a proto annotation that describes a string field that refers to + # an API resource. + # @!attribute [rw] type + # @return [::String] + # The resource type that the annotated field references. + # + # Example: + # + # message Subscription { + # string topic = 2 [(google.api.resource_reference) = { + # type: "pubsub.googleapis.com/Topic" + # }]; + # } + # + # Occasionally, a field may reference an arbitrary resource. In this case, + # APIs use the special value * in their resource reference. + # + # Example: + # + # message GetIamPolicyRequest { + # string resource = 2 [(google.api.resource_reference) = { + # type: "*" + # }]; + # } + # @!attribute [rw] child_type + # @return [::String] + # The resource type of a child collection that the annotated field + # references. This is useful for annotating the `parent` field that + # doesn't have a fixed resource type. + # + # Example: + # + # message ListLogEntriesRequest { + # string parent = 1 [(google.api.resource_reference) = { + # child_type: "logging.googleapis.com/LogEntry" + # }; + # } + class ResourceReference + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end +end diff --git a/owl-bot-staging/google-cloud-saas_platform-saas_service_mgmt-v1beta1/proto_docs/google/cloud/saasplatform/saasservicemgmt/v1beta1/common.rb b/owl-bot-staging/google-cloud-saas_platform-saas_service_mgmt-v1beta1/proto_docs/google/cloud/saasplatform/saasservicemgmt/v1beta1/common.rb new file mode 100644 index 000000000000..6a0da327d9a7 --- /dev/null +++ b/owl-bot-staging/google-cloud-saas_platform-saas_service_mgmt-v1beta1/proto_docs/google/cloud/saasplatform/saasservicemgmt/v1beta1/common.rb @@ -0,0 +1,237 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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 SaasPlatform + module SaasServiceMgmt + module V1beta1 + # Blueprints are OCI Images that contain all of the artifacts needed to + # provision a unit. Metadata such as, type of the engine used to actuate the + # blueprint (e.g. terraform, helm etc) and version will come from the image + # manifest. If the hostname is omitted, it will be assumed to be the regional + # path to Artifact Registry (eg. us-east1-docker.pkg.dev). + # @!attribute [rw] package + # @return [::String] + # Optional. Immutable. URI to a blueprint used by the Unit (required unless + # unitKind or release is set). + # @!attribute [r] engine + # @return [::String] + # Output only. Type of the engine used to actuate the blueprint. e.g. + # terraform, helm etc. + # @!attribute [r] version + # @return [::String] + # Output only. Version metadata if present on the blueprint. + class Blueprint + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # UnitVariable describes a parameter for a Unit. + # @!attribute [rw] variable + # @return [::String] + # Required. Immutable. Name of the variable from actuation configs. + # @!attribute [rw] type + # @return [::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::UnitVariable::Type] + # Optional. Immutable. Name of a supported variable type. Supported types are + # string, int, bool. + # @!attribute [rw] value + # @return [::String] + # Optional. String encoded value for the variable. + class UnitVariable + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # Enumeration of variable types. + module Type + # Variable type is unspecified. + TYPE_UNSPECIFIED = 0 + + # Variable type is string. + STRING = 1 + + # Variable type is int. + INT = 2 + + # Variable type is bool. + BOOL = 3 + end + end + + # UnitCondition describes the status of an Unit. UnitCondition is individual + # components that contribute to an overall state. + # @!attribute [rw] status + # @return [::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::UnitCondition::Status] + # Required. Status of the condition. + # @!attribute [rw] type + # @return [::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::UnitCondition::Type] + # Required. Type of the condition. + # @!attribute [rw] last_transition_time + # @return [::Google::Protobuf::Timestamp] + # Required. Last time the condition transited from one status to another. + # @!attribute [rw] message + # @return [::String] + # Required. Human readable message indicating details about the last + # transition. + # @!attribute [rw] reason + # @return [::String] + # Required. Brief reason for the condition's last transition. + class UnitCondition + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # Enumeration of condition statuses. + module Status + # Condition status is unspecified. + STATUS_UNSPECIFIED = 0 + + # Condition is unknown. + STATUS_UNKNOWN = 1 + + # Condition is true. + STATUS_TRUE = 2 + + # Condition is false. + STATUS_FALSE = 3 + end + + # Enumeration of condition types. + module Type + # Condition type is unspecified. + TYPE_UNSPECIFIED = 0 + + # Condition type is ready. + TYPE_READY = 1 + + # Condition type is updating. + TYPE_UPDATING = 2 + + # Condition type is provisioned. + TYPE_PROVISIONED = 3 + + # Condition type is operationError. + # True when the last unit operation fails with a non-ignorable error. + TYPE_OPERATION_ERROR = 4 + end + end + + # UnitOperationCondition describes the status of an Unit Operation. + # UnitOperationCondition is individual components that contribute to an overall + # state. + # @!attribute [rw] status + # @return [::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::UnitOperationCondition::Status] + # Required. Status of the condition. + # @!attribute [rw] type + # @return [::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::UnitOperationCondition::Type] + # Required. Type of the condition. + # @!attribute [rw] last_transition_time + # @return [::Google::Protobuf::Timestamp] + # Required. Last time the condition transited from one status to another. + # @!attribute [rw] message + # @return [::String] + # Required. Human readable message indicating details about the last + # transition. + # @!attribute [rw] reason + # @return [::String] + # Required. Brief reason for the condition's last transition. + class UnitOperationCondition + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # Enumeration of condition statuses. + module Status + # Condition status is unspecified. + STATUS_UNSPECIFIED = 0 + + # Condition is unknown. + STATUS_UNKNOWN = 1 + + # Condition is true. + STATUS_TRUE = 2 + + # Condition is false. + STATUS_FALSE = 3 + end + + # Enumeration of condition types. + module Type + # Condition type is unspecified. + TYPE_UNSPECIFIED = 0 + + # Condition type is scheduled. + TYPE_SCHEDULED = 2 + + # Condition type is running. + TYPE_RUNNING = 3 + + # Condition type is succeeded. + TYPE_SUCCEEDED = 4 + + # Condition type is cancelled. + TYPE_CANCELLED = 5 + + # Indicates if AppHub app has been created. + TYPE_APP_CREATED = 6 + + # Indicates if services and workloads have been registered with AppHub. + TYPE_APP_COMPONENTS_REGISTERED = 7 + end + end + + # Represents the aggregation of a set of population of like records by a + # certain group. For example, a collection of unit counts can be aggregated and + # grouped by their state. + # @!attribute [rw] group + # @return [::String] + # Required. Group by which to aggregate. + # @!attribute [rw] count + # @return [::Integer] + # Required. Number of records in the group. + class Aggregate + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # UnitOperationErrorCategory describes the error category of the unit + # operation. + module UnitOperationErrorCategory + # Unit operation error category is unspecified + UNIT_OPERATION_ERROR_CATEGORY_UNSPECIFIED = 0 + + # Unit operation error category is not applicable, or it is not an error + NOT_APPLICABLE = 1 + + # Unit operation error category is fatal + FATAL = 2 + + # Unit operation error category is retriable + RETRIABLE = 3 + + # Unit operation error category is ignorable + IGNORABLE = 4 + + # Unit operation error category is standard, counts towards Rollout error + # budget + STANDARD = 5 + end + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-saas_platform-saas_service_mgmt-v1beta1/proto_docs/google/cloud/saasplatform/saasservicemgmt/v1beta1/deployments_resources.rb b/owl-bot-staging/google-cloud-saas_platform-saas_service_mgmt-v1beta1/proto_docs/google/cloud/saasplatform/saasservicemgmt/v1beta1/deployments_resources.rb new file mode 100644 index 000000000000..77d6b2a09c64 --- /dev/null +++ b/owl-bot-staging/google-cloud-saas_platform-saas_service_mgmt-v1beta1/proto_docs/google/cloud/saasplatform/saasservicemgmt/v1beta1/deployments_resources.rb @@ -0,0 +1,837 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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 SaasPlatform + module SaasServiceMgmt + module V1beta1 + # Location information that the service is available in. + # @!attribute [rw] name + # @return [::String] + # Optional. Name of location. + class Location + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Saas is a representation of a SaaS service managed by the Producer. + # @!attribute [rw] name + # @return [::String] + # Identifier. The resource name (full URI of the resource) following the + # standard naming scheme: + # + # "projects/\\{project}/locations/\\{location}/saas/\\{saas}" + # @!attribute [rw] locations + # @return [::Array<::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::Location>] + # Optional. List of locations that the service is available in. Rollout + # refers to the list to generate a rollout plan. + # @!attribute [rw] labels + # @return [::Google::Protobuf::Map{::String => ::String}] + # Optional. The labels on the resource, which can be used for categorization. + # similar to Kubernetes resource labels. + # @!attribute [rw] annotations + # @return [::Google::Protobuf::Map{::String => ::String}] + # Optional. Annotations is an unstructured key-value map stored with a + # resource that may be set by external tools to store and retrieve arbitrary + # metadata. They are not queryable and should be preserved when modifying + # objects. + # + # More info: https://kubernetes.io/docs/user-guide/annotations + # @!attribute [r] uid + # @return [::String] + # Output only. The unique identifier of the resource. UID is unique in the + # time and space for this resource within the scope of the service. It is + # typically generated by the server on successful creation of a resource + # and must not be changed. UID is used to uniquely identify resources + # with resource name reuses. This should be a UUID4. + # @!attribute [r] etag + # @return [::String] + # Output only. An opaque value that uniquely identifies a version or + # generation of a resource. It can be used to confirm that the client + # and server agree on the ordering of a resource being written. + # @!attribute [r] create_time + # @return [::Google::Protobuf::Timestamp] + # Output only. The timestamp when the resource was created. + # @!attribute [r] update_time + # @return [::Google::Protobuf::Timestamp] + # Output only. The timestamp when the resource was last updated. Any + # change to the resource made by users must refresh this value. + # Changes to a resource made by the service should refresh this value. + class Saas + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # @!attribute [rw] key + # @return [::String] + # @!attribute [rw] value + # @return [::String] + class LabelsEntry + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # @!attribute [rw] key + # @return [::String] + # @!attribute [rw] value + # @return [::String] + class AnnotationsEntry + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end + + # Tenant represents the service producer side of an instance of the + # service created based on a request from a consumer. In a typical scenario a + # Tenant has a one-to-one mapping with a resource given out to a service + # consumer. + # + # Example: + # + # tenant: + # name: "projects/svc1/locations/loc/tenants/inst-068afff8" + # consumer_resource: "projects/gshoe/locations/loc/shoes/black-shoe" + # @!attribute [rw] name + # @return [::String] + # Identifier. The resource name (full URI of the resource) following the + # standard naming scheme: + # + # "projects/\\{project}/locations/\\{location}/tenants/\\{tenant}" + # @!attribute [rw] consumer_resource + # @return [::String] + # Optional. Immutable. A reference to the consumer resource this SaaS Tenant + # is representing. + # + # The relationship with a consumer resource can be used by SaaS Runtime for + # retrieving consumer-defined settings and policies such as maintenance + # policies (using Unified Maintenance Policy API). + # @!attribute [rw] saas + # @return [::String] + # Required. Immutable. A reference to the Saas that defines the product + # (managed service) that the producer wants to manage with SaaS Runtime. Part + # of the SaaS Runtime common data model. + # @!attribute [rw] labels + # @return [::Google::Protobuf::Map{::String => ::String}] + # Optional. The labels on the resource, which can be used for categorization. + # similar to Kubernetes resource labels. + # @!attribute [rw] annotations + # @return [::Google::Protobuf::Map{::String => ::String}] + # Optional. Annotations is an unstructured key-value map stored with a + # resource that may be set by external tools to store and retrieve arbitrary + # metadata. They are not queryable and should be preserved when modifying + # objects. + # + # More info: https://kubernetes.io/docs/user-guide/annotations + # @!attribute [r] uid + # @return [::String] + # Output only. The unique identifier of the resource. UID is unique in the + # time and space for this resource within the scope of the service. It is + # typically generated by the server on successful creation of a resource + # and must not be changed. UID is used to uniquely identify resources + # with resource name reuses. This should be a UUID4. + # @!attribute [r] etag + # @return [::String] + # Output only. An opaque value that uniquely identifies a version or + # generation of a resource. It can be used to confirm that the client + # and server agree on the ordering of a resource being written. + # @!attribute [r] create_time + # @return [::Google::Protobuf::Timestamp] + # Output only. The timestamp when the resource was created. + # @!attribute [r] update_time + # @return [::Google::Protobuf::Timestamp] + # Output only. The timestamp when the resource was last updated. Any + # change to the resource made by users must refresh this value. + # Changes to a resource made by the service should refresh this value. + class Tenant + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # @!attribute [rw] key + # @return [::String] + # @!attribute [rw] value + # @return [::String] + class LabelsEntry + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # @!attribute [rw] key + # @return [::String] + # @!attribute [rw] value + # @return [::String] + class AnnotationsEntry + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end + + # Definition of a Unit. Units belonging to the same UnitKind are managed + # together; for example they follow the same release model (blueprints, + # versions etc.) and are typically rolled out together. + # @!attribute [rw] name + # @return [::String] + # Identifier. The resource name (full URI of the resource) following the + # standard naming scheme: + # + # "projects/\\{project}/locations/\\{location}/unitKinds/\\{unitKind}" + # @!attribute [rw] default_release + # @return [::String] + # Optional. A reference to the Release object to use as default for creating + # new units of this UnitKind (optional). + # + # If not specified, a new unit must explicitly reference which release to use + # for its creation. + # @!attribute [rw] dependencies + # @return [::Array<::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::Dependency>] + # Optional. Immutable. List of other unit kinds that this release will depend + # on. Dependencies will be automatically provisioned if not found. + # Maximum 10. + # @!attribute [rw] input_variable_mappings + # @return [::Array<::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::VariableMapping>] + # Optional. List of inputVariables for this release that will either be + # retrieved from a dependency’s outputVariables, or will be passed on to a + # dependency’s inputVariables. Maximum 100. + # @!attribute [rw] output_variable_mappings + # @return [::Array<::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::VariableMapping>] + # Optional. List of outputVariables for this unit kind will be passed to this + # unit's outputVariables. Maximum 100. + # @!attribute [rw] saas + # @return [::String] + # Required. Immutable. A reference to the Saas that defines the product + # (managed service) that the producer wants to manage with SaaS Runtime. Part + # of the SaaS Runtime common data model. Immutable once set. + # @!attribute [rw] labels + # @return [::Google::Protobuf::Map{::String => ::String}] + # Optional. The labels on the resource, which can be used for categorization. + # similar to Kubernetes resource labels. + # @!attribute [rw] annotations + # @return [::Google::Protobuf::Map{::String => ::String}] + # Optional. Annotations is an unstructured key-value map stored with a + # resource that may be set by external tools to store and retrieve arbitrary + # metadata. They are not queryable and should be preserved when modifying + # objects. + # + # More info: https://kubernetes.io/docs/user-guide/annotations + # @!attribute [r] uid + # @return [::String] + # Output only. The unique identifier of the resource. UID is unique in the + # time and space for this resource within the scope of the service. It is + # typically generated by the server on successful creation of a resource + # and must not be changed. UID is used to uniquely identify resources + # with resource name reuses. This should be a UUID4. + # @!attribute [r] etag + # @return [::String] + # Output only. An opaque value that uniquely identifies a version or + # generation of a resource. It can be used to confirm that the client + # and server agree on the ordering of a resource being written. + # @!attribute [r] create_time + # @return [::Google::Protobuf::Timestamp] + # Output only. The timestamp when the resource was created. + # @!attribute [r] update_time + # @return [::Google::Protobuf::Timestamp] + # Output only. The timestamp when the resource was last updated. Any + # change to the resource made by users must refresh this value. + # Changes to a resource made by the service should refresh this value. + class UnitKind + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # @!attribute [rw] key + # @return [::String] + # @!attribute [rw] value + # @return [::String] + class LabelsEntry + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # @!attribute [rw] key + # @return [::String] + # @!attribute [rw] value + # @return [::String] + class AnnotationsEntry + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end + + # A unit of deployment that has its lifecycle via a CRUD API using an actuation + # engine under the hood (e.g. based on Terraform, Helm or a custom + # implementation provided by a service producer). A building block of a SaaS + # Tenant. + # @!attribute [rw] name + # @return [::String] + # Identifier. The resource name (full URI of the resource) following the + # standard naming scheme: + # + # "projects/\\{project}/locations/\\{location}/units/\\{unit}" + # @!attribute [rw] unit_kind + # @return [::String] + # Optional. Reference to the UnitKind this Unit belongs to. Immutable once + # set. + # @!attribute [r] release + # @return [::String] + # Optional. Output only. The current Release object for this Unit. + # @!attribute [rw] tenant + # @return [::String] + # Optional. Reference to the Saas Tenant resource this unit belongs to. This + # for example informs the maintenance policies to use for scheduling future + # updates on a unit. (optional and immutable once created) + # @!attribute [r] ongoing_operations + # @return [::Array<::String>] + # Optional. Output only. List of concurrent UnitOperations that are operating + # on this Unit. + # @!attribute [r] pending_operations + # @return [::Array<::String>] + # Optional. Output only. List of pending (wait to be executed) UnitOperations + # for this unit. + # @!attribute [r] scheduled_operations + # @return [::Array<::String>] + # Optional. Output only. List of scheduled UnitOperations for this unit. + # @!attribute [r] dependents + # @return [::Array<::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::UnitDependency>] + # Optional. Output only. List of Units that depend on this unit. Unit can + # only be deprovisioned if this list is empty. Maximum 1000. + # @!attribute [r] dependencies + # @return [::Array<::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::UnitDependency>] + # Optional. Output only. Set of dependencies for this unit. Maximum 10. + # @!attribute [r] input_variables + # @return [::Array<::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::UnitVariable>] + # Optional. Output only. Indicates the current input variables deployed by + # the unit + # @!attribute [r] output_variables + # @return [::Array<::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::UnitVariable>] + # Optional. Output only. Set of key/value pairs corresponding to output + # variables from execution of actuation templates. The variables are declared + # in actuation configs (e.g in helm chart or terraform) and the values are + # fetched and returned by the actuation engine upon completion of execution. + # @!attribute [rw] maintenance + # @return [::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::Unit::MaintenanceSettings] + # Optional. Captures requested directives for performing future maintenance + # on the unit. This includes a request for the unit to skip maintenance for a + # period of time and remain pinned to its current release as well as controls + # for postponing maintenance scheduled in future. + # @!attribute [r] state + # @return [::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::Unit::UnitState] + # Optional. Output only. Current lifecycle state of the resource (e.g. if + # it's being created or ready to use). + # @!attribute [r] conditions + # @return [::Array<::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::UnitCondition>] + # Optional. Output only. A set of conditions which indicate the various + # conditions this resource can have. + # @!attribute [rw] management_mode + # @return [::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::Unit::ManagementMode] + # Optional. Immutable. Indicates whether the Unit life cycle is controlled + # by the user or by the system. + # Immutable once created. + # @!attribute [r] system_managed_state + # @return [::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::Unit::SystemManagedState] + # Optional. Output only. Indicates the system managed state of the unit. + # @!attribute [r] system_cleanup_at + # @return [::Google::Protobuf::Timestamp] + # Optional. Output only. If set, indicates the time when the system will + # start removing the unit. + # @!attribute [rw] labels + # @return [::Google::Protobuf::Map{::String => ::String}] + # Optional. The labels on the resource, which can be used for categorization. + # similar to Kubernetes resource labels. + # @!attribute [rw] annotations + # @return [::Google::Protobuf::Map{::String => ::String}] + # Optional. Annotations is an unstructured key-value map stored with a + # resource that may be set by external tools to store and retrieve arbitrary + # metadata. They are not queryable and should be preserved when modifying + # objects. + # + # More info: https://kubernetes.io/docs/user-guide/annotations + # @!attribute [r] uid + # @return [::String] + # Output only. The unique identifier of the resource. UID is unique in the + # time and space for this resource within the scope of the service. It is + # typically generated by the server on successful creation of a resource + # and must not be changed. UID is used to uniquely identify resources + # with resource name reuses. This should be a UUID4. + # @!attribute [r] etag + # @return [::String] + # Output only. An opaque value that uniquely identifies a version or + # generation of a resource. It can be used to confirm that the client + # and server agree on the ordering of a resource being written. + # @!attribute [r] create_time + # @return [::Google::Protobuf::Timestamp] + # Output only. The timestamp when the resource was created. + # @!attribute [r] update_time + # @return [::Google::Protobuf::Timestamp] + # Output only. The timestamp when the resource was last updated. Any + # change to the resource made by users must refresh this value. + # Changes to a resource made by the service should refresh this value. + class Unit + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # Captures requested directives for performing future maintenance on the + # unit. This includes a request for the unit to skip maintenance for a period + # of time and remain pinned to its current release as well as controls for + # postponing maintenance scheduled in future. + # @!attribute [rw] pinned_until_time + # @return [::Google::Protobuf::Timestamp] + # Optional. If present, it fixes the release on the unit until the given + # time; i.e. changes to the release field will be rejected. Rollouts should + # and will also respect this by not requesting an upgrade in the first + # place. + class MaintenanceSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # @!attribute [rw] key + # @return [::String] + # @!attribute [rw] value + # @return [::String] + class LabelsEntry + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # @!attribute [rw] key + # @return [::String] + # @!attribute [rw] value + # @return [::String] + class AnnotationsEntry + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # UnitState annotates what is the current state of the unit itself. + module UnitState + # Unspecified state. + UNIT_STATE_UNSPECIFIED = 0 + + # Unit is not provisioned. + UNIT_STATE_NOT_PROVISIONED = 1 + + # Unit is being provisioned. + UNIT_STATE_PROVISIONING = 2 + + # Unit is being updated. This is typically when a unit is being upgraded to + # a new release or some of the input variables on the Unit is being + # changed. Certain kinds of updates may cause the Unit to become unusable + # while the update is in progress. + UNIT_STATE_UPDATING = 3 + + # Unit is being deleted. + UNIT_STATE_DEPROVISIONING = 4 + + # Unit has been provisioned and is ready for use + UNIT_STATE_READY = 5 + + # Unit has error, when it is not ready and some error operation + UNIT_STATE_ERROR = 6 + end + + # ManagementMode describes who is responsible for the management of the unit. + module ManagementMode + MANAGEMENT_MODE_UNSPECIFIED = 0 + + # Unit's lifecycle is managed by the user. + MANAGEMENT_MODE_USER = 1 + + # The system will decide when to deprovision and delete the unit. + # User still can deprovision or delete the unit manually. + MANAGEMENT_MODE_SYSTEM = 2 + end + + module SystemManagedState + SYSTEM_MANAGED_STATE_UNSPECIFIED = 0 + + # Unit has dependents attached. + SYSTEM_MANAGED_STATE_ACTIVE = 1 + + # Unit has no dependencies attached, but attachment is allowed. + SYSTEM_MANAGED_STATE_INACTIVE = 2 + + # Unit has no dependencies attached, and attachment is not allowed. + SYSTEM_MANAGED_STATE_DECOMMISSIONED = 3 + end + end + + # Set of dependencies for this unit. Maximum 10. + # @!attribute [r] alias + # @return [::String] + # Output only. Alias for the name of the dependency. + # @!attribute [r] unit + # @return [::String] + # Output only. A reference to the Unit object. + class UnitDependency + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # UnitOperation encapsulates the intent of changing/interacting with the + # service component represented by the specific Unit. Multiple UnitOperations + # can be created (requested) and scheduled in the future, however only one will + # be allowed to execute at a time (that can change in the future for + # non-mutating operations). + # + # UnitOperations allow different actors interacting with the same + # unit to focus only on the change they have requested. + # + # This is a base object that contains the common fields in all unit operations. + # Next: 19 + # @!attribute [rw] provision + # @return [::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::Provision] + # Note: The following fields are mutually exclusive: `provision`, `upgrade`, `deprovision`. If a field in that set is populated, all other fields in the set will automatically be cleared. + # @!attribute [rw] upgrade + # @return [::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::Upgrade] + # Note: The following fields are mutually exclusive: `upgrade`, `provision`, `deprovision`. If a field in that set is populated, all other fields in the set will automatically be cleared. + # @!attribute [rw] deprovision + # @return [::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::Deprovision] + # Note: The following fields are mutually exclusive: `deprovision`, `provision`, `upgrade`. If a field in that set is populated, all other fields in the set will automatically be cleared. + # @!attribute [rw] name + # @return [::String] + # Identifier. The resource name (full URI of the resource) following the + # standard naming scheme: + # + # "projects/\\{project}/locations/\\{location}/unitOperations/\\{unitOperation}" + # @!attribute [rw] unit + # @return [::String] + # Required. Immutable. The Unit a given UnitOperation will act upon. + # @!attribute [rw] parent_unit_operation + # @return [::String] + # Optional. Reference to parent resource: UnitOperation. If an operation + # needs to create other operations as part of its workflow, each of the child + # operations should have this field set to the parent. This can be used for + # tracing. (Optional) + # @!attribute [rw] rollout + # @return [::String] + # Optional. Specifies which rollout created this Unit Operation. This cannot + # be modified and is used for filtering purposes only. If a dependent unit + # and unit operation are created as part of another unit operation, they will + # use the same rolloutId. + # @!attribute [rw] cancel + # @return [::Boolean] + # Optional. When true, attempt to cancel the operation. Cancellation may fail + # if the operation is already executing. (Optional) + # @!attribute [r] state + # @return [::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::UnitOperation::UnitOperationState] + # Optional. Output only. UnitOperationState describes the current state of + # the unit operation. + # @!attribute [r] conditions + # @return [::Array<::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::UnitOperationCondition>] + # Optional. Output only. A set of conditions which indicate the various + # conditions this resource can have. + # @!attribute [rw] schedule + # @return [::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::Schedule] + # Optional. When to schedule this operation. + # @!attribute [r] engine_state + # @return [::String] + # Optional. Output only. The engine state for on-going + # deployment engine operation(s). + # This field is opaque for external usage. + # @!attribute [r] error_category + # @return [::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::UnitOperationErrorCategory] + # Optional. Output only. UnitOperationErrorCategory describe the error + # category. + # @!attribute [rw] labels + # @return [::Google::Protobuf::Map{::String => ::String}] + # Optional. The labels on the resource, which can be used for categorization. + # similar to Kubernetes resource labels. + # @!attribute [rw] annotations + # @return [::Google::Protobuf::Map{::String => ::String}] + # Optional. Annotations is an unstructured key-value map stored with a + # resource that may be set by external tools to store and retrieve arbitrary + # metadata. They are not queryable and should be preserved when modifying + # objects. + # + # More info: https://kubernetes.io/docs/user-guide/annotations + # @!attribute [r] uid + # @return [::String] + # Output only. The unique identifier of the resource. UID is unique in the + # time and space for this resource within the scope of the service. It is + # typically generated by the server on successful creation of a resource + # and must not be changed. UID is used to uniquely identify resources + # with resource name reuses. This should be a UUID4. + # @!attribute [r] etag + # @return [::String] + # Output only. An opaque value that uniquely identifies a version or + # generation of a resource. It can be used to confirm that the client + # and server agree on the ordering of a resource being written. + # @!attribute [r] create_time + # @return [::Google::Protobuf::Timestamp] + # Output only. The timestamp when the resource was created. + # @!attribute [r] update_time + # @return [::Google::Protobuf::Timestamp] + # Output only. The timestamp when the resource was last updated. Any + # change to the resource made by users must refresh this value. + # Changes to a resource made by the service should refresh this value. + class UnitOperation + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # @!attribute [rw] key + # @return [::String] + # @!attribute [rw] value + # @return [::String] + class LabelsEntry + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # @!attribute [rw] key + # @return [::String] + # @!attribute [rw] value + # @return [::String] + class AnnotationsEntry + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # UnitOperationState describes the current state of the unit operation. + module UnitOperationState + UNIT_OPERATION_STATE_UNKNOWN = 0 + + # Unit operation is accepted but not ready to run. + UNIT_OPERATION_STATE_PENDING = 1 + + # Unit operation is accepted and scheduled. + UNIT_OPERATION_STATE_SCHEDULED = 2 + + # Unit operation is running. + UNIT_OPERATION_STATE_RUNNING = 4 + + # Unit operation has completed successfully. + UNIT_OPERATION_STATE_SUCCEEDED = 5 + + # Unit operation has failed. + UNIT_OPERATION_STATE_FAILED = 6 + + # Unit operation was cancelled. + UNIT_OPERATION_STATE_CANCELLED = 7 + end + end + + # Provision is the unit operation that provision the underlying resources + # represented by a Unit. Can only execute if the Unit is not currently + # provisioned. + # @!attribute [rw] release + # @return [::String] + # Optional. Reference to the Release object to use for the Unit. (optional). + # @!attribute [rw] input_variables + # @return [::Array<::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::UnitVariable>] + # Optional. Set of input variables. Maximum 100. (optional) + class Provision + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Deprovision is the unit operation that deprovision the underlying + # resources represented by a Unit. Can only execute if the Unit is currently + # provisioned. + class Deprovision + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Upgrade is the unit operation that upgrades a provisioned unit, which may + # also include the underlying resources represented by a Unit. Can only execute + # if the Unit is currently provisioned. + # @!attribute [rw] release + # @return [::String] + # Optional. Reference to the Release object to use for the Unit. (optional). + # @!attribute [rw] input_variables + # @return [::Array<::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::UnitVariable>] + # Optional. Set of input variables. Maximum 100. (optional) + class Upgrade + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # A time specification to schedule the maintenance. + # @!attribute [rw] start_time + # @return [::Google::Protobuf::Timestamp] + # Optional. Start of operation. If not set, will be set to the start of the + # next window. (optional) + class Schedule + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # A new version to be propagated and deployed to units. This includes pointers + # to packaged blueprints for actuation (e.g Helm or Terraform configuration + # packages) via artifact registry. + # @!attribute [rw] name + # @return [::String] + # Identifier. The resource name (full URI of the resource) following the + # standard naming scheme: + # + # "projects/\\{project}/locations/\\{location}/releases/\\{release}" + # @!attribute [rw] unit_kind + # @return [::String] + # Required. Immutable. Reference to the UnitKind this Release corresponds to + # (required and immutable once created). + # @!attribute [rw] blueprint + # @return [::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::Blueprint] + # Optional. Blueprints are OCI Images that contain all of the artifacts + # needed to provision a unit. + # @!attribute [rw] release_requirements + # @return [::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::Release::ReleaseRequirements] + # Optional. Set of requirements to be fulfilled on the Unit when using this + # Release. + # @!attribute [r] input_variables + # @return [::Array<::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::UnitVariable>] + # Optional. Output only. List of input variables declared on the blueprint + # and can be present with their values on the unit spec + # @!attribute [r] output_variables + # @return [::Array<::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::UnitVariable>] + # Optional. Output only. List of output variables declared on the blueprint + # and can be present with their values on the unit status + # @!attribute [rw] input_variable_defaults + # @return [::Array<::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::UnitVariable>] + # Optional. Mapping of input variables to default values. Maximum 100 + # @!attribute [rw] labels + # @return [::Google::Protobuf::Map{::String => ::String}] + # Optional. The labels on the resource, which can be used for categorization. + # similar to Kubernetes resource labels. + # @!attribute [rw] annotations + # @return [::Google::Protobuf::Map{::String => ::String}] + # Optional. Annotations is an unstructured key-value map stored with a + # resource that may be set by external tools to store and retrieve arbitrary + # metadata. They are not queryable and should be preserved when modifying + # objects. + # + # More info: https://kubernetes.io/docs/user-guide/annotations + # @!attribute [r] uid + # @return [::String] + # Output only. The unique identifier of the resource. UID is unique in the + # time and space for this resource within the scope of the service. It is + # typically generated by the server on successful creation of a resource + # and must not be changed. UID is used to uniquely identify resources + # with resource name reuses. This should be a UUID4. + # @!attribute [r] etag + # @return [::String] + # Output only. An opaque value that uniquely identifies a version or + # generation of a resource. It can be used to confirm that the client + # and server agree on the ordering of a resource being written. + # @!attribute [r] create_time + # @return [::Google::Protobuf::Timestamp] + # Output only. The timestamp when the resource was created. + # @!attribute [r] update_time + # @return [::Google::Protobuf::Timestamp] + # Output only. The timestamp when the resource was last updated. Any + # change to the resource made by users must refresh this value. + # Changes to a resource made by the service should refresh this value. + class Release + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # Set of requirements to be fulfilled on the Unit when using this Release. + # @!attribute [rw] upgradeable_from_releases + # @return [::Array<::String>] + # Optional. A list of releases from which a unit can be upgraded to this + # one (optional). If left empty no constraints will be applied. When + # provided, unit upgrade requests to this release will check and enforce + # this constraint. + class ReleaseRequirements + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # @!attribute [rw] key + # @return [::String] + # @!attribute [rw] value + # @return [::String] + class LabelsEntry + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # @!attribute [rw] key + # @return [::String] + # @!attribute [rw] value + # @return [::String] + class AnnotationsEntry + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end + + # Mapping of input variables to their respective output variable for + # depedenencies + # @!attribute [rw] from + # @return [::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::FromMapping] + # Optional. Output variables which will get their values from dependencies + # + # Note: The following fields are mutually exclusive: `from`, `to`. If a field in that set is populated, all other fields in the set will automatically be cleared. + # @!attribute [rw] to + # @return [::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::ToMapping] + # Optional. Input variables whose values will be passed on to dependencies. + # + # Note: The following fields are mutually exclusive: `to`, `from`. If a field in that set is populated, all other fields in the set will automatically be cleared. + # @!attribute [rw] variable + # @return [::String] + # Required. name of the variable + class VariableMapping + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Output variables whose values will be passed on to dependencies + # @!attribute [rw] dependency + # @return [::String] + # Required. Alias of the dependency that the outputVariable will pass its + # value to + # @!attribute [rw] output_variable + # @return [::String] + # Required. Name of the outputVariable on the dependency + class FromMapping + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Input variables whose values will be passed on to dependencies + # @!attribute [rw] dependency + # @return [::String] + # Required. Alias of the dependency that the inputVariable will pass its + # value to + # @!attribute [rw] input_variable + # @return [::String] + # Required. Name of the inputVariable on the dependency + # @!attribute [rw] ignore_for_lookup + # @return [::Boolean] + # Optional. Tells SaaS Runtime if this mapping should be used during lookup + # or not + class ToMapping + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Dependency represent a single dependency with another unit kind by alias. + # @!attribute [rw] unit_kind + # @return [::String] + # Required. Immutable. The unit kind of the dependency. + # @!attribute [rw] alias + # @return [::String] + # Required. An alias for the dependency. Used for input variable mapping. + class Dependency + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-saas_platform-saas_service_mgmt-v1beta1/proto_docs/google/cloud/saasplatform/saasservicemgmt/v1beta1/deployments_service.rb b/owl-bot-staging/google-cloud-saas_platform-saas_service_mgmt-v1beta1/proto_docs/google/cloud/saasplatform/saasservicemgmt/v1beta1/deployments_service.rb new file mode 100644 index 000000000000..25428282bb54 --- /dev/null +++ b/owl-bot-staging/google-cloud-saas_platform-saas_service_mgmt-v1beta1/proto_docs/google/cloud/saasplatform/saasservicemgmt/v1beta1/deployments_service.rb @@ -0,0 +1,976 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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 SaasPlatform + module SaasServiceMgmt + module V1beta1 + # The request structure for the ListSaas method. + # @!attribute [rw] parent + # @return [::String] + # Required. The parent of the saas. + # @!attribute [rw] page_size + # @return [::Integer] + # The maximum number of saas to send per page. + # @!attribute [rw] page_token + # @return [::String] + # The page token: If the next_page_token from a previous response + # is provided, this request will send the subsequent page. + # @!attribute [rw] filter + # @return [::String] + # Filter the list as specified in https://google.aip.dev/160. + # @!attribute [rw] order_by + # @return [::String] + # Order results as specified in https://google.aip.dev/132. + class ListSaasRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # The response structure for the ListSaas method. + # @!attribute [rw] saas + # @return [::Array<::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::Saas>] + # The resulting saas. + # @!attribute [rw] next_page_token + # @return [::String] + # If present, the next page token can be provided to a subsequent + # ListSaas call to list the next page. + # If empty, there are no more pages. + # @!attribute [rw] unreachable + # @return [::Array<::String>] + # Locations that could not be reached. + class ListSaasResponse + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # The request structure for the GetSaas method. + # @!attribute [rw] name + # @return [::String] + # Required. The resource name of the resource within a service. + class GetSaasRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # The request structure for the CreateSaas method. + # @!attribute [rw] parent + # @return [::String] + # Required. The parent of the saas. + # @!attribute [rw] saas_id + # @return [::String] + # Required. The ID value for the new saas. + # @!attribute [rw] saas + # @return [::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::Saas] + # Required. The desired state for the saas. + # @!attribute [rw] validate_only + # @return [::Boolean] + # If "validate_only" is set to true, the service will try to validate + # that this request would succeed, but will not actually make changes. + # @!attribute [rw] request_id + # @return [::String] + # An optional request ID to identify requests. Specify a unique request ID + # so that if you must retry your request, the server will know to ignore + # the request if it has already been completed. The server will guarantee + # that for at least 60 minutes since the first request. + # + # For example, consider a situation where you make an initial request and the + # request times out. If you make the request again with the same request + # ID, the server can check if original operation with the same request ID + # was received, and if so, will ignore the second request. This prevents + # clients from accidentally creating duplicate commitments. + # + # The request ID must be a valid UUID with the exception that zero UUID is + # not supported (00000000-0000-0000-0000-000000000000). + class CreateSaasRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # The request structure for the UpdateSaas method. + # @!attribute [rw] saas + # @return [::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::Saas] + # Required. The desired state for the saas. + # @!attribute [rw] validate_only + # @return [::Boolean] + # If "validate_only" is set to true, the service will try to validate + # that this request would succeed, but will not actually make changes. + # @!attribute [rw] request_id + # @return [::String] + # An optional request ID to identify requests. Specify a unique request ID + # so that if you must retry your request, the server will know to ignore + # the request if it has already been completed. The server will guarantee + # that for at least 60 minutes since the first request. + # + # For example, consider a situation where you make an initial request and the + # request times out. If you make the request again with the same request + # ID, the server can check if original operation with the same request ID + # was received, and if so, will ignore the second request. This prevents + # clients from accidentally creating duplicate commitments. + # + # The request ID must be a valid UUID with the exception that zero UUID is + # not supported (00000000-0000-0000-0000-000000000000). + # @!attribute [rw] update_mask + # @return [::Google::Protobuf::FieldMask] + # Field mask is used to specify the fields to be overwritten in the + # Saas resource by the update. + # + # The fields specified in the update_mask are relative to the resource, not + # the full request. A field will be overwritten if it is in the mask. + # + # If the user does not provide a mask then all fields in the + # Saas will be overwritten. + class UpdateSaasRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # The request structure for the DeleteSaas method. + # @!attribute [rw] name + # @return [::String] + # Required. The resource name of the resource within a service. + # @!attribute [rw] etag + # @return [::String] + # The etag known to the client for the expected state of the saas. This is + # used with state-changing methods to prevent accidental overwrites when + # multiple user agents might be acting in parallel on the same resource. + # + # An etag wildcard provide optimistic concurrency based on the expected + # existence of the saas. The Any wildcard (`*`) requires that the resource + # must already exists, and the Not Any wildcard (`!*`) requires that it must + # not. + # @!attribute [rw] validate_only + # @return [::Boolean] + # If "validate_only" is set to true, the service will try to validate + # that this request would succeed, but will not actually make changes. + # @!attribute [rw] request_id + # @return [::String] + # An optional request ID to identify requests. Specify a unique request ID + # so that if you must retry your request, the server will know to ignore + # the request if it has already been completed. The server will guarantee + # that for at least 60 minutes since the first request. + # + # For example, consider a situation where you make an initial request and the + # request times out. If you make the request again with the same request + # ID, the server can check if original operation with the same request ID + # was received, and if so, will ignore the second request. This prevents + # clients from accidentally creating duplicate commitments. + # + # The request ID must be a valid UUID with the exception that zero UUID is + # not supported (00000000-0000-0000-0000-000000000000). + class DeleteSaasRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # The request structure for the ListTenants method. + # @!attribute [rw] parent + # @return [::String] + # Required. The parent of the tenant. + # @!attribute [rw] page_size + # @return [::Integer] + # The maximum number of tenants to send per page. + # @!attribute [rw] page_token + # @return [::String] + # The page token: If the next_page_token from a previous response + # is provided, this request will send the subsequent page. + # @!attribute [rw] filter + # @return [::String] + # Filter the list as specified in https://google.aip.dev/160. + # @!attribute [rw] order_by + # @return [::String] + # Order results as specified in https://google.aip.dev/132. + class ListTenantsRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # The response structure for the ListTenants method. + # @!attribute [rw] tenants + # @return [::Array<::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::Tenant>] + # The resulting tenants. + # @!attribute [rw] next_page_token + # @return [::String] + # If present, the next page token can be provided to a subsequent + # ListTenants call to list the next page. + # If empty, there are no more pages. + # @!attribute [rw] unreachable + # @return [::Array<::String>] + # Locations that could not be reached. + class ListTenantsResponse + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # The request structure for the GetTenant method. + # @!attribute [rw] name + # @return [::String] + # Required. The resource name of the resource within a service. + class GetTenantRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # The request structure for the CreateTenant method. + # @!attribute [rw] parent + # @return [::String] + # Required. The parent of the tenant. + # @!attribute [rw] tenant_id + # @return [::String] + # Required. The ID value for the new tenant. + # @!attribute [rw] tenant + # @return [::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::Tenant] + # Required. The desired state for the tenant. + # @!attribute [rw] validate_only + # @return [::Boolean] + # If "validate_only" is set to true, the service will try to validate + # that this request would succeed, but will not actually make changes. + # @!attribute [rw] request_id + # @return [::String] + # An optional request ID to identify requests. Specify a unique request ID + # so that if you must retry your request, the server will know to ignore + # the request if it has already been completed. The server will guarantee + # that for at least 60 minutes since the first request. + # + # For example, consider a situation where you make an initial request and the + # request times out. If you make the request again with the same request + # ID, the server can check if original operation with the same request ID + # was received, and if so, will ignore the second request. This prevents + # clients from accidentally creating duplicate commitments. + # + # The request ID must be a valid UUID with the exception that zero UUID is + # not supported (00000000-0000-0000-0000-000000000000). + class CreateTenantRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # The request structure for the UpdateTenant method. + # @!attribute [rw] tenant + # @return [::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::Tenant] + # Required. The desired state for the tenant. + # @!attribute [rw] validate_only + # @return [::Boolean] + # If "validate_only" is set to true, the service will try to validate + # that this request would succeed, but will not actually make changes. + # @!attribute [rw] request_id + # @return [::String] + # An optional request ID to identify requests. Specify a unique request ID + # so that if you must retry your request, the server will know to ignore + # the request if it has already been completed. The server will guarantee + # that for at least 60 minutes since the first request. + # + # For example, consider a situation where you make an initial request and the + # request times out. If you make the request again with the same request + # ID, the server can check if original operation with the same request ID + # was received, and if so, will ignore the second request. This prevents + # clients from accidentally creating duplicate commitments. + # + # The request ID must be a valid UUID with the exception that zero UUID is + # not supported (00000000-0000-0000-0000-000000000000). + # @!attribute [rw] update_mask + # @return [::Google::Protobuf::FieldMask] + # Field mask is used to specify the fields to be overwritten in the + # Tenant resource by the update. + # + # The fields specified in the update_mask are relative to the resource, not + # the full request. A field will be overwritten if it is in the mask. + # + # If the user does not provide a mask then all fields in the + # Tenant will be overwritten. + class UpdateTenantRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # The request structure for the DeleteTenant method. + # @!attribute [rw] name + # @return [::String] + # Required. The resource name of the resource within a service. + # @!attribute [rw] etag + # @return [::String] + # The etag known to the client for the expected state of the tenant. This is + # used with state-changing methods to prevent accidental overwrites when + # multiple user agents might be acting in parallel on the same resource. + # + # An etag wildcard provide optimistic concurrency based on the expected + # existence of the tenant. The Any wildcard (`*`) requires that the resource + # must already exists, and the Not Any wildcard (`!*`) requires that it must + # not. + # @!attribute [rw] validate_only + # @return [::Boolean] + # If "validate_only" is set to true, the service will try to validate + # that this request would succeed, but will not actually make changes. + # @!attribute [rw] request_id + # @return [::String] + # An optional request ID to identify requests. Specify a unique request ID + # so that if you must retry your request, the server will know to ignore + # the request if it has already been completed. The server will guarantee + # that for at least 60 minutes since the first request. + # + # For example, consider a situation where you make an initial request and the + # request times out. If you make the request again with the same request + # ID, the server can check if original operation with the same request ID + # was received, and if so, will ignore the second request. This prevents + # clients from accidentally creating duplicate commitments. + # + # The request ID must be a valid UUID with the exception that zero UUID is + # not supported (00000000-0000-0000-0000-000000000000). + class DeleteTenantRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # The request structure for the ListUnitKinds method. + # @!attribute [rw] parent + # @return [::String] + # Required. The parent of the unit kind. + # @!attribute [rw] page_size + # @return [::Integer] + # The maximum number of unit kinds to send per page. + # @!attribute [rw] page_token + # @return [::String] + # The page token: If the next_page_token from a previous response + # is provided, this request will send the subsequent page. + # @!attribute [rw] filter + # @return [::String] + # Filter the list as specified in https://google.aip.dev/160. + # @!attribute [rw] order_by + # @return [::String] + # Order results as specified in https://google.aip.dev/132. + class ListUnitKindsRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # The response structure for the ListUnitKinds method. + # @!attribute [rw] unit_kinds + # @return [::Array<::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::UnitKind>] + # The resulting unit kinds. + # @!attribute [rw] next_page_token + # @return [::String] + # If present, the next page token can be provided to a subsequent + # ListUnitKinds call to list the next page. + # If empty, there are no more pages. + # @!attribute [rw] unreachable + # @return [::Array<::String>] + # Locations that could not be reached. + class ListUnitKindsResponse + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # The request structure for the GetUnitKind method. + # @!attribute [rw] name + # @return [::String] + # Required. The resource name of the resource within a service. + class GetUnitKindRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # The request structure for the CreateUnitKind method. + # @!attribute [rw] parent + # @return [::String] + # Required. The parent of the unit kind. + # @!attribute [rw] unit_kind_id + # @return [::String] + # Required. The ID value for the new unit kind. + # @!attribute [rw] unit_kind + # @return [::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::UnitKind] + # Required. The desired state for the unit kind. + # @!attribute [rw] validate_only + # @return [::Boolean] + # If "validate_only" is set to true, the service will try to validate + # that this request would succeed, but will not actually make changes. + # @!attribute [rw] request_id + # @return [::String] + # An optional request ID to identify requests. Specify a unique request ID + # so that if you must retry your request, the server will know to ignore + # the request if it has already been completed. The server will guarantee + # that for at least 60 minutes since the first request. + # + # For example, consider a situation where you make an initial request and the + # request times out. If you make the request again with the same request + # ID, the server can check if original operation with the same request ID + # was received, and if so, will ignore the second request. This prevents + # clients from accidentally creating duplicate commitments. + # + # The request ID must be a valid UUID with the exception that zero UUID is + # not supported (00000000-0000-0000-0000-000000000000). + class CreateUnitKindRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # The request structure for the UpdateUnitKind method. + # @!attribute [rw] unit_kind + # @return [::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::UnitKind] + # Required. The desired state for the unit kind. + # @!attribute [rw] validate_only + # @return [::Boolean] + # If "validate_only" is set to true, the service will try to validate + # that this request would succeed, but will not actually make changes. + # @!attribute [rw] request_id + # @return [::String] + # An optional request ID to identify requests. Specify a unique request ID + # so that if you must retry your request, the server will know to ignore + # the request if it has already been completed. The server will guarantee + # that for at least 60 minutes since the first request. + # + # For example, consider a situation where you make an initial request and the + # request times out. If you make the request again with the same request + # ID, the server can check if original operation with the same request ID + # was received, and if so, will ignore the second request. This prevents + # clients from accidentally creating duplicate commitments. + # + # The request ID must be a valid UUID with the exception that zero UUID is + # not supported (00000000-0000-0000-0000-000000000000). + # @!attribute [rw] update_mask + # @return [::Google::Protobuf::FieldMask] + # Field mask is used to specify the fields to be overwritten in the + # UnitKind resource by the update. + # + # The fields specified in the update_mask are relative to the resource, not + # the full request. A field will be overwritten if it is in the mask. + # + # If the user does not provide a mask then all fields in the + # UnitKind will be overwritten. + class UpdateUnitKindRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # The request structure for the DeleteUnitKind method. + # @!attribute [rw] name + # @return [::String] + # Required. The resource name of the resource within a service. + # @!attribute [rw] etag + # @return [::String] + # The etag known to the client for the expected state of the unit kind. This + # is used with state-changing methods to prevent accidental overwrites when + # multiple user agents might be acting in parallel on the same resource. + # + # An etag wildcard provide optimistic concurrency based on the expected + # existence of the unit kind. The Any wildcard (`*`) requires that the + # resource must already exists, and the Not Any wildcard (`!*`) requires that + # it must not. + # @!attribute [rw] validate_only + # @return [::Boolean] + # If "validate_only" is set to true, the service will try to validate + # that this request would succeed, but will not actually make changes. + # @!attribute [rw] request_id + # @return [::String] + # An optional request ID to identify requests. Specify a unique request ID + # so that if you must retry your request, the server will know to ignore + # the request if it has already been completed. The server will guarantee + # that for at least 60 minutes since the first request. + # + # For example, consider a situation where you make an initial request and the + # request times out. If you make the request again with the same request + # ID, the server can check if original operation with the same request ID + # was received, and if so, will ignore the second request. This prevents + # clients from accidentally creating duplicate commitments. + # + # The request ID must be a valid UUID with the exception that zero UUID is + # not supported (00000000-0000-0000-0000-000000000000). + class DeleteUnitKindRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # The request structure for the ListUnits method. + # @!attribute [rw] parent + # @return [::String] + # Required. The parent of the unit. + # @!attribute [rw] page_size + # @return [::Integer] + # The maximum number of units to send per page. + # @!attribute [rw] page_token + # @return [::String] + # The page token: If the next_page_token from a previous response + # is provided, this request will send the subsequent page. + # @!attribute [rw] filter + # @return [::String] + # Filter the list as specified in https://google.aip.dev/160. + # @!attribute [rw] order_by + # @return [::String] + # Order results as specified in https://google.aip.dev/132. + class ListUnitsRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # The response structure for the ListUnits method. + # @!attribute [rw] units + # @return [::Array<::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::Unit>] + # The resulting units. + # @!attribute [rw] next_page_token + # @return [::String] + # If present, the next page token can be provided to a subsequent + # ListUnits call to list the next page. + # If empty, there are no more pages. + # @!attribute [rw] unreachable + # @return [::Array<::String>] + # Locations that could not be reached. + class ListUnitsResponse + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # The request structure for the GetUnit method. + # @!attribute [rw] name + # @return [::String] + # Required. The resource name of the resource within a service. + class GetUnitRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # The request structure for the CreateUnit method. + # @!attribute [rw] parent + # @return [::String] + # Required. The parent of the unit. + # @!attribute [rw] unit_id + # @return [::String] + # Required. The ID value for the new unit. + # @!attribute [rw] unit + # @return [::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::Unit] + # Required. The desired state for the unit. + # @!attribute [rw] validate_only + # @return [::Boolean] + # If "validate_only" is set to true, the service will try to validate + # that this request would succeed, but will not actually make changes. + # @!attribute [rw] request_id + # @return [::String] + # An optional request ID to identify requests. Specify a unique request ID + # so that if you must retry your request, the server will know to ignore + # the request if it has already been completed. The server will guarantee + # that for at least 60 minutes since the first request. + # + # For example, consider a situation where you make an initial request and the + # request times out. If you make the request again with the same request + # ID, the server can check if original operation with the same request ID + # was received, and if so, will ignore the second request. This prevents + # clients from accidentally creating duplicate commitments. + # + # The request ID must be a valid UUID with the exception that zero UUID is + # not supported (00000000-0000-0000-0000-000000000000). + class CreateUnitRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # The request structure for the UpdateUnit method. + # @!attribute [rw] unit + # @return [::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::Unit] + # Required. The desired state for the unit. + # @!attribute [rw] validate_only + # @return [::Boolean] + # If "validate_only" is set to true, the service will try to validate + # that this request would succeed, but will not actually make changes. + # @!attribute [rw] request_id + # @return [::String] + # An optional request ID to identify requests. Specify a unique request ID + # so that if you must retry your request, the server will know to ignore + # the request if it has already been completed. The server will guarantee + # that for at least 60 minutes since the first request. + # + # For example, consider a situation where you make an initial request and the + # request times out. If you make the request again with the same request + # ID, the server can check if original operation with the same request ID + # was received, and if so, will ignore the second request. This prevents + # clients from accidentally creating duplicate commitments. + # + # The request ID must be a valid UUID with the exception that zero UUID is + # not supported (00000000-0000-0000-0000-000000000000). + # @!attribute [rw] update_mask + # @return [::Google::Protobuf::FieldMask] + # Field mask is used to specify the fields to be overwritten in the + # Unit resource by the update. + # + # The fields specified in the update_mask are relative to the resource, not + # the full request. A field will be overwritten if it is in the mask. + # + # If the user does not provide a mask then all fields in the + # Unit will be overwritten. + class UpdateUnitRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # The request structure for the DeleteUnit method. + # @!attribute [rw] name + # @return [::String] + # Required. The resource name of the resource within a service. + # @!attribute [rw] etag + # @return [::String] + # The etag known to the client for the expected state of the unit. This is + # used with state-changing methods to prevent accidental overwrites when + # multiple user agents might be acting in parallel on the same resource. + # + # An etag wildcard provide optimistic concurrency based on the expected + # existence of the unit. The Any wildcard (`*`) requires that the resource + # must already exists, and the Not Any wildcard (`!*`) requires that it must + # not. + # @!attribute [rw] validate_only + # @return [::Boolean] + # If "validate_only" is set to true, the service will try to validate + # that this request would succeed, but will not actually make changes. + # @!attribute [rw] request_id + # @return [::String] + # An optional request ID to identify requests. Specify a unique request ID + # so that if you must retry your request, the server will know to ignore + # the request if it has already been completed. The server will guarantee + # that for at least 60 minutes since the first request. + # + # For example, consider a situation where you make an initial request and the + # request times out. If you make the request again with the same request + # ID, the server can check if original operation with the same request ID + # was received, and if so, will ignore the second request. This prevents + # clients from accidentally creating duplicate commitments. + # + # The request ID must be a valid UUID with the exception that zero UUID is + # not supported (00000000-0000-0000-0000-000000000000). + class DeleteUnitRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # The request structure for the ListUnitOperations method. + # @!attribute [rw] parent + # @return [::String] + # Required. The parent of the unit operation. + # @!attribute [rw] page_size + # @return [::Integer] + # The maximum number of unit operations to send per page. + # @!attribute [rw] page_token + # @return [::String] + # The page token: If the next_page_token from a previous response + # is provided, this request will send the subsequent page. + # @!attribute [rw] filter + # @return [::String] + # Filter the list as specified in https://google.aip.dev/160. + # @!attribute [rw] order_by + # @return [::String] + # Order results as specified in https://google.aip.dev/132. + class ListUnitOperationsRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # The response structure for the ListUnitOperations method. + # @!attribute [rw] unit_operations + # @return [::Array<::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::UnitOperation>] + # The resulting unit operations. + # @!attribute [rw] next_page_token + # @return [::String] + # If present, the next page token can be provided to a subsequent + # ListUnitOperations call to list the next page. + # If empty, there are no more pages. + # @!attribute [rw] unreachable + # @return [::Array<::String>] + # Locations that could not be reached. + class ListUnitOperationsResponse + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # The request structure for the GetUnitOperation method. + # @!attribute [rw] name + # @return [::String] + # Required. The resource name of the resource within a service. + class GetUnitOperationRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # The request structure for the CreateUnitOperation method. + # @!attribute [rw] parent + # @return [::String] + # Required. The parent of the unit operation. + # @!attribute [rw] unit_operation_id + # @return [::String] + # Required. The ID value for the new unit operation. + # @!attribute [rw] unit_operation + # @return [::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::UnitOperation] + # Required. The desired state for the unit operation. + # @!attribute [rw] validate_only + # @return [::Boolean] + # If "validate_only" is set to true, the service will try to validate + # that this request would succeed, but will not actually make changes. + # @!attribute [rw] request_id + # @return [::String] + # An optional request ID to identify requests. Specify a unique request ID + # so that if you must retry your request, the server will know to ignore + # the request if it has already been completed. The server will guarantee + # that for at least 60 minutes since the first request. + # + # For example, consider a situation where you make an initial request and the + # request times out. If you make the request again with the same request + # ID, the server can check if original operation with the same request ID + # was received, and if so, will ignore the second request. This prevents + # clients from accidentally creating duplicate commitments. + # + # The request ID must be a valid UUID with the exception that zero UUID is + # not supported (00000000-0000-0000-0000-000000000000). + class CreateUnitOperationRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # The request structure for the UpdateUnitOperation method. + # @!attribute [rw] unit_operation + # @return [::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::UnitOperation] + # Required. The desired state for the unit operation. + # @!attribute [rw] validate_only + # @return [::Boolean] + # If "validate_only" is set to true, the service will try to validate + # that this request would succeed, but will not actually make changes. + # @!attribute [rw] request_id + # @return [::String] + # An optional request ID to identify requests. Specify a unique request ID + # so that if you must retry your request, the server will know to ignore + # the request if it has already been completed. The server will guarantee + # that for at least 60 minutes since the first request. + # + # For example, consider a situation where you make an initial request and the + # request times out. If you make the request again with the same request + # ID, the server can check if original operation with the same request ID + # was received, and if so, will ignore the second request. This prevents + # clients from accidentally creating duplicate commitments. + # + # The request ID must be a valid UUID with the exception that zero UUID is + # not supported (00000000-0000-0000-0000-000000000000). + # @!attribute [rw] update_mask + # @return [::Google::Protobuf::FieldMask] + # Field mask is used to specify the fields to be overwritten in the + # UnitOperation resource by the update. + # + # The fields specified in the update_mask are relative to the resource, not + # the full request. A field will be overwritten if it is in the mask. + # + # If the user does not provide a mask then all fields in the + # UnitOperation will be overwritten. + class UpdateUnitOperationRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # The request structure for the DeleteUnitOperation method. + # @!attribute [rw] name + # @return [::String] + # Required. The resource name of the resource within a service. + # @!attribute [rw] etag + # @return [::String] + # The etag known to the client for the expected state of the unit operation. + # This is used with state-changing methods to prevent accidental overwrites + # when multiple user agents might be acting in parallel on the same resource. + # + # An etag wildcard provide optimistic concurrency based on the expected + # existence of the unit operation. The Any wildcard (`*`) requires that the + # resource must already exists, and the Not Any wildcard (`!*`) requires that + # it must not. + # @!attribute [rw] validate_only + # @return [::Boolean] + # If "validate_only" is set to true, the service will try to validate + # that this request would succeed, but will not actually make changes. + # @!attribute [rw] request_id + # @return [::String] + # An optional request ID to identify requests. Specify a unique request ID + # so that if you must retry your request, the server will know to ignore + # the request if it has already been completed. The server will guarantee + # that for at least 60 minutes since the first request. + # + # For example, consider a situation where you make an initial request and the + # request times out. If you make the request again with the same request + # ID, the server can check if original operation with the same request ID + # was received, and if so, will ignore the second request. This prevents + # clients from accidentally creating duplicate commitments. + # + # The request ID must be a valid UUID with the exception that zero UUID is + # not supported (00000000-0000-0000-0000-000000000000). + class DeleteUnitOperationRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # The request structure for the ListReleases method. + # @!attribute [rw] parent + # @return [::String] + # Required. The parent of the release. + # @!attribute [rw] page_size + # @return [::Integer] + # The maximum number of releases to send per page. + # @!attribute [rw] page_token + # @return [::String] + # The page token: If the next_page_token from a previous response + # is provided, this request will send the subsequent page. + # @!attribute [rw] filter + # @return [::String] + # Filter the list as specified in https://google.aip.dev/160. + # @!attribute [rw] order_by + # @return [::String] + # Order results as specified in https://google.aip.dev/132. + class ListReleasesRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # The response structure for the ListReleases method. + # @!attribute [rw] releases + # @return [::Array<::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::Release>] + # The resulting releases. + # @!attribute [rw] next_page_token + # @return [::String] + # If present, the next page token can be provided to a subsequent + # ListReleases call to list the next page. + # If empty, there are no more pages. + # @!attribute [rw] unreachable + # @return [::Array<::String>] + # Locations that could not be reached. + class ListReleasesResponse + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # The request structure for the GetRelease method. + # @!attribute [rw] name + # @return [::String] + # Required. The resource name of the resource within a service. + class GetReleaseRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # The request structure for the CreateRelease method. + # @!attribute [rw] parent + # @return [::String] + # Required. The parent of the release. + # @!attribute [rw] release_id + # @return [::String] + # Required. The ID value for the new release. + # @!attribute [rw] release + # @return [::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::Release] + # Required. The desired state for the release. + # @!attribute [rw] validate_only + # @return [::Boolean] + # If "validate_only" is set to true, the service will try to validate + # that this request would succeed, but will not actually make changes. + # @!attribute [rw] request_id + # @return [::String] + # An optional request ID to identify requests. Specify a unique request ID + # so that if you must retry your request, the server will know to ignore + # the request if it has already been completed. The server will guarantee + # that for at least 60 minutes since the first request. + # + # For example, consider a situation where you make an initial request and the + # request times out. If you make the request again with the same request + # ID, the server can check if original operation with the same request ID + # was received, and if so, will ignore the second request. This prevents + # clients from accidentally creating duplicate commitments. + # + # The request ID must be a valid UUID with the exception that zero UUID is + # not supported (00000000-0000-0000-0000-000000000000). + class CreateReleaseRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # The request structure for the UpdateRelease method. + # @!attribute [rw] release + # @return [::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::Release] + # Required. The desired state for the release. + # @!attribute [rw] validate_only + # @return [::Boolean] + # If "validate_only" is set to true, the service will try to validate + # that this request would succeed, but will not actually make changes. + # @!attribute [rw] request_id + # @return [::String] + # An optional request ID to identify requests. Specify a unique request ID + # so that if you must retry your request, the server will know to ignore + # the request if it has already been completed. The server will guarantee + # that for at least 60 minutes since the first request. + # + # For example, consider a situation where you make an initial request and the + # request times out. If you make the request again with the same request + # ID, the server can check if original operation with the same request ID + # was received, and if so, will ignore the second request. This prevents + # clients from accidentally creating duplicate commitments. + # + # The request ID must be a valid UUID with the exception that zero UUID is + # not supported (00000000-0000-0000-0000-000000000000). + # @!attribute [rw] update_mask + # @return [::Google::Protobuf::FieldMask] + # Field mask is used to specify the fields to be overwritten in the + # Release resource by the update. + # + # The fields specified in the update_mask are relative to the resource, not + # the full request. A field will be overwritten if it is in the mask. + # + # If the user does not provide a mask then all fields in the + # Release will be overwritten. + class UpdateReleaseRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # The request structure for the DeleteRelease method. + # @!attribute [rw] name + # @return [::String] + # Required. The resource name of the resource within a service. + # @!attribute [rw] etag + # @return [::String] + # The etag known to the client for the expected state of the release. This is + # used with state-changing methods to prevent accidental overwrites when + # multiple user agents might be acting in parallel on the same resource. + # + # An etag wildcard provide optimistic concurrency based on the expected + # existence of the release. The Any wildcard (`*`) requires that the resource + # must already exists, and the Not Any wildcard (`!*`) requires that it must + # not. + # @!attribute [rw] validate_only + # @return [::Boolean] + # If "validate_only" is set to true, the service will try to validate + # that this request would succeed, but will not actually make changes. + # @!attribute [rw] request_id + # @return [::String] + # An optional request ID to identify requests. Specify a unique request ID + # so that if you must retry your request, the server will know to ignore + # the request if it has already been completed. The server will guarantee + # that for at least 60 minutes since the first request. + # + # For example, consider a situation where you make an initial request and the + # request times out. If you make the request again with the same request + # ID, the server can check if original operation with the same request ID + # was received, and if so, will ignore the second request. This prevents + # clients from accidentally creating duplicate commitments. + # + # The request ID must be a valid UUID with the exception that zero UUID is + # not supported (00000000-0000-0000-0000-000000000000). + class DeleteReleaseRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-saas_platform-saas_service_mgmt-v1beta1/proto_docs/google/cloud/saasplatform/saasservicemgmt/v1beta1/rollouts_resources.rb b/owl-bot-staging/google-cloud-saas_platform-saas_service_mgmt-v1beta1/proto_docs/google/cloud/saasplatform/saasservicemgmt/v1beta1/rollouts_resources.rb new file mode 100644 index 000000000000..8bf8722fd171 --- /dev/null +++ b/owl-bot-staging/google-cloud-saas_platform-saas_service_mgmt-v1beta1/proto_docs/google/cloud/saasplatform/saasservicemgmt/v1beta1/rollouts_resources.rb @@ -0,0 +1,389 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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 SaasPlatform + module SaasServiceMgmt + module V1beta1 + # Represents a single rollout execution and its results + # @!attribute [rw] name + # @return [::String] + # Identifier. The resource name (full URI of the resource) following the + # standard naming scheme: + # + # "projects/\\{project}/locations/\\{location}/rollout/\\{rollout_id}" + # @!attribute [rw] release + # @return [::String] + # Optional. Immutable. Name of the Release that gets rolled out to target + # Units. Required if no other type of release is specified. + # @!attribute [r] start_time + # @return [::Google::Protobuf::Timestamp] + # Optional. Output only. The time when the rollout started executing. Will be + # empty if the rollout hasn't started yet. + # @!attribute [r] end_time + # @return [::Google::Protobuf::Timestamp] + # Optional. Output only. The time when the rollout finished execution + # (regardless of success, failure, or cancellation). Will be empty if the + # rollout hasn't finished yet. Once set, the rollout is in terminal state and + # all the results are final. + # @!attribute [r] state + # @return [::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::Rollout::RolloutState] + # Output only. Current state of the rollout. + # @!attribute [r] state_message + # @return [::String] + # Output only. Human readable message indicating details about the last state + # transition. + # @!attribute [r] state_transition_time + # @return [::Google::Protobuf::Timestamp] + # Optional. Output only. The time when the rollout transitioned into its + # current state. + # @!attribute [r] root_rollout + # @return [::String] + # Optional. Output only. The root rollout that this rollout is stemming from. + # The resource name (full URI of the resource) following the standard naming + # scheme: + # + # "projects/\\{project}/locations/\\{location}/rollouts/\\{rollout_id}" + # @!attribute [r] parent_rollout + # @return [::String] + # Optional. Output only. The direct parent rollout that this rollout is + # stemming from. The resource name (full URI of the resource) following the + # standard naming scheme: + # + # "projects/\\{project}/locations/\\{location}/rollouts/\\{rollout_id}" + # @!attribute [rw] rollout_orchestration_strategy + # @return [::String] + # Optional. The strategy used for executing this Rollout. + # This strategy will override whatever strategy is specified in the + # RolloutType. If not specified on creation, the + # strategy from RolloutType will be used. + # + # There are two supported values strategies which are used to control + # - "Google.Cloud.Simple.AllAtOnce" + # - "Google.Cloud.Simple.OneLocationAtATime" + # + # A rollout with one of these simple strategies will rollout across + # all locations defined in the targeted UnitKind's Saas Locations. + # @!attribute [rw] unit_filter + # @return [::String] + # Optional. CEL(https://github.com/google/cel-spec) formatted filter string + # against Unit. The filter will be applied to determine the eligible unit + # population. This filter can only reduce, but not expand the scope of the + # rollout. If not provided, the unit_filter from the RolloutType will be + # used. + # @!attribute [rw] rollout_kind + # @return [::String] + # Optional. Immutable. Name of the RolloutKind this rollout is stemming from + # and adhering to. + # @!attribute [r] stats + # @return [::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::RolloutStats] + # Optional. Output only. Details about the progress of the rollout. + # @!attribute [rw] control + # @return [::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::RolloutControl] + # Optional. Requested change to the execution of this rollout. + # Default RolloutControl.action is ROLLOUT_ACTION_RUN meaning + # the rollout will be executed to completion while progressing through + # all natural Rollout States (such as RUNNING -> SUCCEEDED or RUNNING -> + # FAILED). Requests can only be made when the Rollout is in a non-terminal + # state. + # @!attribute [rw] labels + # @return [::Google::Protobuf::Map{::String => ::String}] + # Optional. The labels on the resource, which can be used for categorization. + # similar to Kubernetes resource labels. + # @!attribute [rw] annotations + # @return [::Google::Protobuf::Map{::String => ::String}] + # Optional. Annotations is an unstructured key-value map stored with a + # resource that may be set by external tools to store and retrieve arbitrary + # metadata. They are not queryable and should be preserved when modifying + # objects. + # + # More info: https://kubernetes.io/docs/user-guide/annotations + # @!attribute [r] uid + # @return [::String] + # Output only. The unique identifier of the resource. UID is unique in the + # time and space for this resource within the scope of the service. It is + # typically generated by the server on successful creation of a resource + # and must not be changed. UID is used to uniquely identify resources + # with resource name reuses. This should be a UUID4. + # @!attribute [r] etag + # @return [::String] + # Output only. An opaque value that uniquely identifies a version or + # generation of a resource. It can be used to confirm that the client + # and server agree on the ordering of a resource being written. + # @!attribute [r] create_time + # @return [::Google::Protobuf::Timestamp] + # Output only. The timestamp when the resource was created. + # @!attribute [r] update_time + # @return [::Google::Protobuf::Timestamp] + # Output only. The timestamp when the resource was last updated. Any + # change to the resource made by users must refresh this value. + # Changes to a resource made by the service should refresh this value. + class Rollout + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # @!attribute [rw] key + # @return [::String] + # @!attribute [rw] value + # @return [::String] + class LabelsEntry + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # @!attribute [rw] key + # @return [::String] + # @!attribute [rw] value + # @return [::String] + class AnnotationsEntry + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # The current state of the rollout. + module RolloutState + # Unspecified state. + ROLLOUT_STATE_UNSPECIFIED = 0 + + # Rollout is in progress. + ROLLOUT_STATE_RUNNING = 1 + + # Rollout has been paused. + ROLLOUT_STATE_PAUSED = 2 + + # Rollout completed successfully. + ROLLOUT_STATE_SUCCEEDED = 3 + + # Rollout has failed. + ROLLOUT_STATE_FAILED = 4 + + # Rollout has been canceled. + ROLLOUT_STATE_CANCELLED = 5 + + # Rollout is waiting for some condition to be met before starting. + ROLLOUT_STATE_WAITING = 6 + + # Rollout is being canceled. + ROLLOUT_STATE_CANCELLING = 7 + + # Rollout is being resumed. + ROLLOUT_STATE_RESUMING = 8 + + # Rollout is being paused. + ROLLOUT_STATE_PAUSING = 9 + end + end + + # An object that describes various settings of Rollout execution. Includes + # built-in policies across GCP and GDC, and customizable policies. + # @!attribute [rw] name + # @return [::String] + # Identifier. The resource name (full URI of the resource) following the + # standard naming scheme: + # + # "projects/\\{project}/locations/\\{location}/rolloutKinds/\\{rollout_kind_id}" + # @!attribute [rw] unit_kind + # @return [::String] + # Required. Immutable. UnitKind that this rollout kind corresponds to. + # Rollouts stemming from this rollout kind will target the units of this unit + # kind. In other words, this defines the population of target units to be + # upgraded by rollouts. + # @!attribute [rw] rollout_orchestration_strategy + # @return [::String] + # Optional. The strategy used for executing a Rollout. This is a required + # field. + # + # There are two supported values strategies which are used to control + # - "Google.Cloud.Simple.AllAtOnce" + # - "Google.Cloud.Simple.OneLocationAtATime" + # + # A rollout with one of these simple strategies will rollout across + # all locations defined in the associated UnitKind's Saas Locations. + # @!attribute [rw] unit_filter + # @return [::String] + # Optional. CEL(https://github.com/google/cel-spec) formatted filter string + # against Unit. The filter will be applied to determine the eligible unit + # population. This filter can only reduce, but not expand the scope of the + # rollout. + # @!attribute [rw] update_unit_kind_strategy + # @return [::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::RolloutKind::UpdateUnitKindStrategy] + # Optional. The config for updating the unit kind. By default, the unit kind + # will be updated on the rollout start. + # @!attribute [rw] error_budget + # @return [::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::ErrorBudget] + # Optional. The configuration for error budget. If the number of failed units + # exceeds max(allowed_count, allowed_ratio * total_units), the rollout will + # be paused. If not set, all units will be attempted to be updated regardless + # of the number of failures encountered. + # @!attribute [rw] labels + # @return [::Google::Protobuf::Map{::String => ::String}] + # Optional. The labels on the resource, which can be used for categorization. + # similar to Kubernetes resource labels. + # @!attribute [rw] annotations + # @return [::Google::Protobuf::Map{::String => ::String}] + # Optional. Annotations is an unstructured key-value map stored with a + # resource that may be set by external tools to store and retrieve arbitrary + # metadata. They are not queryable and should be preserved when modifying + # objects. + # + # More info: https://kubernetes.io/docs/user-guide/annotations + # @!attribute [r] uid + # @return [::String] + # Output only. The unique identifier of the resource. UID is unique in the + # time and space for this resource within the scope of the service. It is + # typically generated by the server on successful creation of a resource + # and must not be changed. UID is used to uniquely identify resources + # with resource name reuses. This should be a UUID4. + # @!attribute [r] etag + # @return [::String] + # Output only. An opaque value that uniquely identifies a version or + # generation of a resource. It can be used to confirm that the client + # and server agree on the ordering of a resource being written. + # @!attribute [r] create_time + # @return [::Google::Protobuf::Timestamp] + # Output only. The timestamp when the resource was created. + # @!attribute [r] update_time + # @return [::Google::Protobuf::Timestamp] + # Output only. The timestamp when the resource was last updated. Any + # change to the resource made by users must refresh this value. + # Changes to a resource made by the service should refresh this value. + class RolloutKind + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # @!attribute [rw] key + # @return [::String] + # @!attribute [rw] value + # @return [::String] + class LabelsEntry + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # @!attribute [rw] key + # @return [::String] + # @!attribute [rw] value + # @return [::String] + class AnnotationsEntry + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + module UpdateUnitKindStrategy + # Strategy unspecified. + UPDATE_UNIT_KIND_STRATEGY_UNSPECIFIED = 0 + + # Update the unit kind strategy on the rollout start. + UPDATE_UNIT_KIND_STRATEGY_ON_START = 1 + + # Never update the unit kind. + UPDATE_UNIT_KIND_STRATEGY_NEVER = 2 + end + end + + # The configuration for error budget. If the number of failed units exceeds + # max(allowed_count, allowed_ratio * total_units), the rollout will be paused. + # @!attribute [rw] allowed_count + # @return [::Integer] + # Optional. The maximum number of failed units allowed in a location without + # pausing the rollout. + # @!attribute [rw] allowed_percentage + # @return [::Integer] + # Optional. The maximum percentage of units allowed to fail (0, 100] within a + # location without pausing the rollout. + class ErrorBudget + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # RolloutStats contains information about the progress of a rollout. + # @!attribute [r] operations_by_state + # @return [::Array<::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::Aggregate>] + # Output only. A breakdown of the progress of operations triggered by the + # rollout. Provides a count of Operations by their state. This can be used to + # determine the number of units which have been updated, or are scheduled to + # be updated. + # + # There will be at most one entry per group. + # Possible values for operation groups are: + # - "SCHEDULED" + # - "PENDING" + # - "RUNNING" + # - "SUCCEEDED" + # - "FAILED" + # - "CANCELLED" + class RolloutStats + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # RolloutControl provides a way to request a change to the execution of a + # Rollout by pausing or canceling it. + # @!attribute [rw] run_params + # @return [::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::RolloutControl::RunRolloutActionParams] + # Optional. Parameters for the RUN action. It is an error to specify this + # if the RolloutAction is not set to RUN. By default, the rollout will + # retry failed operations when resumed. + # @!attribute [rw] action + # @return [::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::RolloutAction] + # Required. Action to be performed on the Rollout. + # The default behavior is to run the rollout until it naturally reaches a + # terminal state. + class RolloutControl + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # Parameters for the RUN action controlling the behavior of the rollout + # when it is resumed from a PAUSED state. + # @!attribute [rw] retry_failed_operations + # @return [::Boolean] + # Required. If true, the rollout will retry failed operations when resumed. + # This is applicable only the current state of the Rollout is PAUSED and + # the requested action is RUN. + class RunRolloutActionParams + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end + + # RolloutAction indicates the action to be performed on the Rollout. + module RolloutAction + # Unspecified action, will be treated as RUN by default. + ROLLOUT_ACTION_UNSPECIFIED = 0 + + # Run the Rollout until it naturally reaches a terminal state. + # A rollout requested to run will progress through all natural Rollout + # States (such as RUNNING -> SUCCEEDED or RUNNING -> FAILED). + # If retriable errors are encountered during the rollout, the rollout + # will paused by default and can be resumed by re-requesting this RUN + # action. + ROLLOUT_ACTION_RUN = 1 + + # Pause the Rollout until it is resumed (i.e. RUN is requested). + ROLLOUT_ACTION_PAUSE = 2 + + # Cancel the Rollout permanently. + ROLLOUT_ACTION_CANCEL = 3 + end + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-saas_platform-saas_service_mgmt-v1beta1/proto_docs/google/cloud/saasplatform/saasservicemgmt/v1beta1/rollouts_service.rb b/owl-bot-staging/google-cloud-saas_platform-saas_service_mgmt-v1beta1/proto_docs/google/cloud/saasplatform/saasservicemgmt/v1beta1/rollouts_service.rb new file mode 100644 index 000000000000..62274e2bab73 --- /dev/null +++ b/owl-bot-staging/google-cloud-saas_platform-saas_service_mgmt-v1beta1/proto_docs/google/cloud/saasplatform/saasservicemgmt/v1beta1/rollouts_service.rb @@ -0,0 +1,344 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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 SaasPlatform + module SaasServiceMgmt + module V1beta1 + # The request structure for the ListRollouts method. + # @!attribute [rw] parent + # @return [::String] + # Required. The parent of the rollout. + # @!attribute [rw] page_size + # @return [::Integer] + # The maximum number of rollouts to send per page. + # @!attribute [rw] page_token + # @return [::String] + # The page token: If the next_page_token from a previous response + # is provided, this request will send the subsequent page. + # @!attribute [rw] filter + # @return [::String] + # Filter the list as specified in https://google.aip.dev/160. + # @!attribute [rw] order_by + # @return [::String] + # Order results as specified in https://google.aip.dev/132. + class ListRolloutsRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # The response structure for the ListRollouts method. + # @!attribute [rw] rollouts + # @return [::Array<::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::Rollout>] + # The resulting rollouts. + # @!attribute [rw] next_page_token + # @return [::String] + # If present, the next page token can be provided to a subsequent + # ListRollouts call to list the next page. + # If empty, there are no more pages. + # @!attribute [rw] unreachable + # @return [::Array<::String>] + # Locations that could not be reached. + class ListRolloutsResponse + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # The request structure for the GetRollout method. + # @!attribute [rw] name + # @return [::String] + # Required. The resource name of the resource within a service. + class GetRolloutRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # The request structure for the CreateRollout method. + # @!attribute [rw] parent + # @return [::String] + # Required. The parent of the rollout. + # @!attribute [rw] rollout_id + # @return [::String] + # Required. The ID value for the new rollout. + # @!attribute [rw] rollout + # @return [::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::Rollout] + # Required. The desired state for the rollout. + # @!attribute [rw] validate_only + # @return [::Boolean] + # If "validate_only" is set to true, the service will try to validate + # that this request would succeed, but will not actually make changes. + # @!attribute [rw] request_id + # @return [::String] + # An optional request ID to identify requests. Specify a unique request ID + # so that if you must retry your request, the server will know to ignore + # the request if it has already been completed. The server will guarantee + # that for at least 60 minutes since the first request. + # + # For example, consider a situation where you make an initial request and the + # request times out. If you make the request again with the same request + # ID, the server can check if original operation with the same request ID + # was received, and if so, will ignore the second request. This prevents + # clients from accidentally creating duplicate commitments. + # + # The request ID must be a valid UUID with the exception that zero UUID is + # not supported (00000000-0000-0000-0000-000000000000). + class CreateRolloutRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # The request structure for the UpdateRollout method. + # @!attribute [rw] rollout + # @return [::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::Rollout] + # Required. The desired state for the rollout. + # @!attribute [rw] validate_only + # @return [::Boolean] + # If "validate_only" is set to true, the service will try to validate + # that this request would succeed, but will not actually make changes. + # @!attribute [rw] request_id + # @return [::String] + # An optional request ID to identify requests. Specify a unique request ID + # so that if you must retry your request, the server will know to ignore + # the request if it has already been completed. The server will guarantee + # that for at least 60 minutes since the first request. + # + # For example, consider a situation where you make an initial request and the + # request times out. If you make the request again with the same request + # ID, the server can check if original operation with the same request ID + # was received, and if so, will ignore the second request. This prevents + # clients from accidentally creating duplicate commitments. + # + # The request ID must be a valid UUID with the exception that zero UUID is + # not supported (00000000-0000-0000-0000-000000000000). + # @!attribute [rw] update_mask + # @return [::Google::Protobuf::FieldMask] + # Field mask is used to specify the fields to be overwritten in the + # Rollout resource by the update. + # + # The fields specified in the update_mask are relative to the resource, not + # the full request. A field will be overwritten if it is in the mask. + # + # If the user does not provide a mask then all fields in the + # Rollout will be overwritten. + class UpdateRolloutRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # The request structure for the DeleteRollout method. + # @!attribute [rw] name + # @return [::String] + # Required. The resource name of the resource within a service. + # @!attribute [rw] etag + # @return [::String] + # The etag known to the client for the expected state of the rollout. This is + # used with state-changing methods to prevent accidental overwrites when + # multiple user agents might be acting in parallel on the same resource. + # + # An etag wildcard provide optimistic concurrency based on the expected + # existence of the rollout. The Any wildcard (`*`) requires that the resource + # must already exists, and the Not Any wildcard (`!*`) requires that it must + # not. + # @!attribute [rw] validate_only + # @return [::Boolean] + # If "validate_only" is set to true, the service will try to validate + # that this request would succeed, but will not actually make changes. + # @!attribute [rw] request_id + # @return [::String] + # An optional request ID to identify requests. Specify a unique request ID + # so that if you must retry your request, the server will know to ignore + # the request if it has already been completed. The server will guarantee + # that for at least 60 minutes since the first request. + # + # For example, consider a situation where you make an initial request and the + # request times out. If you make the request again with the same request + # ID, the server can check if original operation with the same request ID + # was received, and if so, will ignore the second request. This prevents + # clients from accidentally creating duplicate commitments. + # + # The request ID must be a valid UUID with the exception that zero UUID is + # not supported (00000000-0000-0000-0000-000000000000). + class DeleteRolloutRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # The request structure for the ListRolloutKinds method. + # @!attribute [rw] parent + # @return [::String] + # Required. The parent of the rollout kind. + # @!attribute [rw] page_size + # @return [::Integer] + # The maximum number of rollout kinds to send per page. + # @!attribute [rw] page_token + # @return [::String] + # The page token: If the next_page_token from a previous response + # is provided, this request will send the subsequent page. + # @!attribute [rw] filter + # @return [::String] + # Filter the list as specified in https://google.aip.dev/160. + # @!attribute [rw] order_by + # @return [::String] + # Order results as specified in https://google.aip.dev/132. + class ListRolloutKindsRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # The response structure for the ListRolloutKinds method. + # @!attribute [rw] rollout_kinds + # @return [::Array<::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::RolloutKind>] + # The resulting rollout kinds. + # @!attribute [rw] next_page_token + # @return [::String] + # If present, the next page token can be provided to a subsequent + # ListRolloutKinds call to list the next page. + # If empty, there are no more pages. + # @!attribute [rw] unreachable + # @return [::Array<::String>] + # Locations that could not be reached. + class ListRolloutKindsResponse + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # The request structure for the GetRolloutKind method. + # @!attribute [rw] name + # @return [::String] + # Required. The resource name of the resource within a service. + class GetRolloutKindRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # The request structure for the CreateRolloutKind method. + # @!attribute [rw] parent + # @return [::String] + # Required. The parent of the rollout kind. + # @!attribute [rw] rollout_kind_id + # @return [::String] + # Required. The ID value for the new rollout kind. + # @!attribute [rw] rollout_kind + # @return [::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::RolloutKind] + # Required. The desired state for the rollout kind. + # @!attribute [rw] validate_only + # @return [::Boolean] + # If "validate_only" is set to true, the service will try to validate + # that this request would succeed, but will not actually make changes. + # @!attribute [rw] request_id + # @return [::String] + # An optional request ID to identify requests. Specify a unique request ID + # so that if you must retry your request, the server will know to ignore + # the request if it has already been completed. The server will guarantee + # that for at least 60 minutes since the first request. + # + # For example, consider a situation where you make an initial request and the + # request times out. If you make the request again with the same request + # ID, the server can check if original operation with the same request ID + # was received, and if so, will ignore the second request. This prevents + # clients from accidentally creating duplicate commitments. + # + # The request ID must be a valid UUID with the exception that zero UUID is + # not supported (00000000-0000-0000-0000-000000000000). + class CreateRolloutKindRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # The request structure for the UpdateRolloutKind method. + # @!attribute [rw] rollout_kind + # @return [::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::RolloutKind] + # Required. The desired state for the rollout kind. + # @!attribute [rw] validate_only + # @return [::Boolean] + # If "validate_only" is set to true, the service will try to validate + # that this request would succeed, but will not actually make changes. + # @!attribute [rw] request_id + # @return [::String] + # An optional request ID to identify requests. Specify a unique request ID + # so that if you must retry your request, the server will know to ignore + # the request if it has already been completed. The server will guarantee + # that for at least 60 minutes since the first request. + # + # For example, consider a situation where you make an initial request and the + # request times out. If you make the request again with the same request + # ID, the server can check if original operation with the same request ID + # was received, and if so, will ignore the second request. This prevents + # clients from accidentally creating duplicate commitments. + # + # The request ID must be a valid UUID with the exception that zero UUID is + # not supported (00000000-0000-0000-0000-000000000000). + # @!attribute [rw] update_mask + # @return [::Google::Protobuf::FieldMask] + # Field mask is used to specify the fields to be overwritten in the + # RolloutKind resource by the update. + # + # The fields specified in the update_mask are relative to the resource, not + # the full request. A field will be overwritten if it is in the mask. + # + # If the user does not provide a mask then all fields in the + # RolloutKind will be overwritten. + class UpdateRolloutKindRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # The request structure for the DeleteRolloutKind method. + # @!attribute [rw] name + # @return [::String] + # Required. The resource name of the resource within a service. + # @!attribute [rw] etag + # @return [::String] + # The etag known to the client for the expected state of the rollout kind. + # This is used with state-changing methods to prevent accidental overwrites + # when multiple user agents might be acting in parallel on the same resource. + # + # An etag wildcard provide optimistic concurrency based on the expected + # existence of the rollout kind. The Any wildcard (`*`) requires that the + # resource must already exists, and the Not Any wildcard (`!*`) requires that + # it must not. + # @!attribute [rw] validate_only + # @return [::Boolean] + # If "validate_only" is set to true, the service will try to validate + # that this request would succeed, but will not actually make changes. + # @!attribute [rw] request_id + # @return [::String] + # An optional request ID to identify requests. Specify a unique request ID + # so that if you must retry your request, the server will know to ignore + # the request if it has already been completed. The server will guarantee + # that for at least 60 minutes since the first request. + # + # For example, consider a situation where you make an initial request and the + # request times out. If you make the request again with the same request + # ID, the server can check if original operation with the same request ID + # was received, and if so, will ignore the second request. This prevents + # clients from accidentally creating duplicate commitments. + # + # The request ID must be a valid UUID with the exception that zero UUID is + # not supported (00000000-0000-0000-0000-000000000000). + class DeleteRolloutKindRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-saas_platform-saas_service_mgmt-v1beta1/proto_docs/google/protobuf/any.rb b/owl-bot-staging/google-cloud-saas_platform-saas_service_mgmt-v1beta1/proto_docs/google/protobuf/any.rb new file mode 100644 index 000000000000..58691995f02e --- /dev/null +++ b/owl-bot-staging/google-cloud-saas_platform-saas_service_mgmt-v1beta1/proto_docs/google/protobuf/any.rb @@ -0,0 +1,145 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + + +module Google + module Protobuf + # `Any` contains an arbitrary serialized protocol buffer message along with a + # URL that describes the type of the serialized message. + # + # Protobuf library provides support to pack/unpack Any values in the form + # of utility functions or additional generated methods of the Any type. + # + # Example 1: Pack and unpack a message in C++. + # + # Foo foo = ...; + # Any any; + # any.PackFrom(foo); + # ... + # if (any.UnpackTo(&foo)) { + # ... + # } + # + # Example 2: Pack and unpack a message in Java. + # + # Foo foo = ...; + # Any any = Any.pack(foo); + # ... + # if (any.is(Foo.class)) { + # foo = any.unpack(Foo.class); + # } + # // or ... + # if (any.isSameTypeAs(Foo.getDefaultInstance())) { + # foo = any.unpack(Foo.getDefaultInstance()); + # } + # + # Example 3: Pack and unpack a message in Python. + # + # foo = Foo(...) + # any = Any() + # any.Pack(foo) + # ... + # if any.Is(Foo.DESCRIPTOR): + # any.Unpack(foo) + # ... + # + # Example 4: Pack and unpack a message in Go + # + # foo := &pb.Foo{...} + # any, err := anypb.New(foo) + # if err != nil { + # ... + # } + # ... + # foo := &pb.Foo{} + # if err := any.UnmarshalTo(foo); err != nil { + # ... + # } + # + # The pack methods provided by protobuf library will by default use + # 'type.googleapis.com/full.type.name' as the type URL and the unpack + # methods only use the fully qualified type name after the last '/' + # in the type URL, for example "foo.bar.com/x/y.z" will yield type + # name "y.z". + # + # JSON + # ==== + # The JSON representation of an `Any` value uses the regular + # representation of the deserialized, embedded message, with an + # additional field `@type` which contains the type URL. Example: + # + # package google.profile; + # message Person { + # string first_name = 1; + # string last_name = 2; + # } + # + # { + # "@type": "type.googleapis.com/google.profile.Person", + # "firstName": , + # "lastName": + # } + # + # If the embedded message type is well-known and has a custom JSON + # representation, that representation will be embedded adding a field + # `value` which holds the custom JSON in addition to the `@type` + # field. Example (for message [google.protobuf.Duration][]): + # + # { + # "@type": "type.googleapis.com/google.protobuf.Duration", + # "value": "1.212s" + # } + # @!attribute [rw] type_url + # @return [::String] + # A URL/resource name that uniquely identifies the type of the serialized + # protocol buffer message. This string must contain at least + # one "/" character. The last segment of the URL's path must represent + # the fully qualified name of the type (as in + # `path/google.protobuf.Duration`). The name should be in a canonical form + # (e.g., leading "." is not accepted). + # + # In practice, teams usually precompile into the binary all types that they + # expect it to use in the context of Any. However, for URLs which use the + # scheme `http`, `https`, or no scheme, one can optionally set up a type + # server that maps type URLs to message definitions as follows: + # + # * If no scheme is provided, `https` is assumed. + # * An HTTP GET on the URL must yield a [google.protobuf.Type][] + # value in binary format, or produce an error. + # * Applications are allowed to cache lookup results based on the + # URL, or have them precompiled into a binary to avoid any + # lookup. Therefore, binary compatibility needs to be preserved + # on changes to types. (Use versioned type names to manage + # breaking changes.) + # + # Note: this functionality is not currently available in the official + # protobuf release, and it is not used for type URLs beginning with + # type.googleapis.com. As of May 2023, there are no widely used type server + # implementations and no plans to implement one. + # + # Schemes other than `http`, `https` (or the empty scheme) might be + # used with implementation specific semantics. + # @!attribute [rw] value + # @return [::String] + # Must be a valid serialized protocol buffer of the above specified type. + class Any + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end +end diff --git a/owl-bot-staging/google-cloud-saas_platform-saas_service_mgmt-v1beta1/proto_docs/google/protobuf/duration.rb b/owl-bot-staging/google-cloud-saas_platform-saas_service_mgmt-v1beta1/proto_docs/google/protobuf/duration.rb new file mode 100644 index 000000000000..ea59f1f91daf --- /dev/null +++ b/owl-bot-staging/google-cloud-saas_platform-saas_service_mgmt-v1beta1/proto_docs/google/protobuf/duration.rb @@ -0,0 +1,98 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + + +module Google + module Protobuf + # A Duration represents a signed, fixed-length span of time represented + # as a count of seconds and fractions of seconds at nanosecond + # resolution. It is independent of any calendar and concepts like "day" + # or "month". It is related to Timestamp in that the difference between + # two Timestamp values is a Duration and it can be added or subtracted + # from a Timestamp. Range is approximately +-10,000 years. + # + # # Examples + # + # Example 1: Compute Duration from two Timestamps in pseudo code. + # + # Timestamp start = ...; + # Timestamp end = ...; + # Duration duration = ...; + # + # duration.seconds = end.seconds - start.seconds; + # duration.nanos = end.nanos - start.nanos; + # + # if (duration.seconds < 0 && duration.nanos > 0) { + # duration.seconds += 1; + # duration.nanos -= 1000000000; + # } else if (duration.seconds > 0 && duration.nanos < 0) { + # duration.seconds -= 1; + # duration.nanos += 1000000000; + # } + # + # Example 2: Compute Timestamp from Timestamp + Duration in pseudo code. + # + # Timestamp start = ...; + # Duration duration = ...; + # Timestamp end = ...; + # + # end.seconds = start.seconds + duration.seconds; + # end.nanos = start.nanos + duration.nanos; + # + # if (end.nanos < 0) { + # end.seconds -= 1; + # end.nanos += 1000000000; + # } else if (end.nanos >= 1000000000) { + # end.seconds += 1; + # end.nanos -= 1000000000; + # } + # + # Example 3: Compute Duration from datetime.timedelta in Python. + # + # td = datetime.timedelta(days=3, minutes=10) + # duration = Duration() + # duration.FromTimedelta(td) + # + # # JSON Mapping + # + # In JSON format, the Duration type is encoded as a string rather than an + # object, where the string ends in the suffix "s" (indicating seconds) and + # is preceded by the number of seconds, with nanoseconds expressed as + # fractional seconds. For example, 3 seconds with 0 nanoseconds should be + # encoded in JSON format as "3s", while 3 seconds and 1 nanosecond should + # be expressed in JSON format as "3.000000001s", and 3 seconds and 1 + # microsecond should be expressed in JSON format as "3.000001s". + # @!attribute [rw] seconds + # @return [::Integer] + # Signed seconds of the span of time. Must be from -315,576,000,000 + # to +315,576,000,000 inclusive. Note: these bounds are computed from: + # 60 sec/min * 60 min/hr * 24 hr/day * 365.25 days/year * 10000 years + # @!attribute [rw] nanos + # @return [::Integer] + # Signed fractions of a second at nanosecond resolution of the span + # of time. Durations less than one second are represented with a 0 + # `seconds` field and a positive or negative `nanos` field. For durations + # of one second or more, a non-zero value for the `nanos` field must be + # of the same sign as the `seconds` field. Must be from -999,999,999 + # to +999,999,999 inclusive. + class Duration + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end +end diff --git a/owl-bot-staging/google-cloud-saas_platform-saas_service_mgmt-v1beta1/proto_docs/google/protobuf/empty.rb b/owl-bot-staging/google-cloud-saas_platform-saas_service_mgmt-v1beta1/proto_docs/google/protobuf/empty.rb new file mode 100644 index 000000000000..83e4481834a6 --- /dev/null +++ b/owl-bot-staging/google-cloud-saas_platform-saas_service_mgmt-v1beta1/proto_docs/google/protobuf/empty.rb @@ -0,0 +1,34 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + + +module Google + module Protobuf + # A generic empty message that you can re-use to avoid defining duplicated + # empty messages in your APIs. A typical example is to use it as the request + # or the response type of an API method. For instance: + # + # service Foo { + # rpc Bar(google.protobuf.Empty) returns (google.protobuf.Empty); + # } + class Empty + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end +end diff --git a/owl-bot-staging/google-cloud-saas_platform-saas_service_mgmt-v1beta1/proto_docs/google/protobuf/field_mask.rb b/owl-bot-staging/google-cloud-saas_platform-saas_service_mgmt-v1beta1/proto_docs/google/protobuf/field_mask.rb new file mode 100644 index 000000000000..7f3ffc78601a --- /dev/null +++ b/owl-bot-staging/google-cloud-saas_platform-saas_service_mgmt-v1beta1/proto_docs/google/protobuf/field_mask.rb @@ -0,0 +1,229 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + + +module Google + module Protobuf + # `FieldMask` represents a set of symbolic field paths, for example: + # + # paths: "f.a" + # paths: "f.b.d" + # + # Here `f` represents a field in some root message, `a` and `b` + # fields in the message found in `f`, and `d` a field found in the + # message in `f.b`. + # + # Field masks are used to specify a subset of fields that should be + # returned by a get operation or modified by an update operation. + # Field masks also have a custom JSON encoding (see below). + # + # # Field Masks in Projections + # + # When used in the context of a projection, a response message or + # sub-message is filtered by the API to only contain those fields as + # specified in the mask. For example, if the mask in the previous + # example is applied to a response message as follows: + # + # f { + # a : 22 + # b { + # d : 1 + # x : 2 + # } + # y : 13 + # } + # z: 8 + # + # The result will not contain specific values for fields x,y and z + # (their value will be set to the default, and omitted in proto text + # output): + # + # + # f { + # a : 22 + # b { + # d : 1 + # } + # } + # + # A repeated field is not allowed except at the last position of a + # paths string. + # + # If a FieldMask object is not present in a get operation, the + # operation applies to all fields (as if a FieldMask of all fields + # had been specified). + # + # Note that a field mask does not necessarily apply to the + # top-level response message. In case of a REST get operation, the + # field mask applies directly to the response, but in case of a REST + # list operation, the mask instead applies to each individual message + # in the returned resource list. In case of a REST custom method, + # other definitions may be used. Where the mask applies will be + # clearly documented together with its declaration in the API. In + # any case, the effect on the returned resource/resources is required + # behavior for APIs. + # + # # Field Masks in Update Operations + # + # A field mask in update operations specifies which fields of the + # targeted resource are going to be updated. The API is required + # to only change the values of the fields as specified in the mask + # and leave the others untouched. If a resource is passed in to + # describe the updated values, the API ignores the values of all + # fields not covered by the mask. + # + # If a repeated field is specified for an update operation, new values will + # be appended to the existing repeated field in the target resource. Note that + # a repeated field is only allowed in the last position of a `paths` string. + # + # If a sub-message is specified in the last position of the field mask for an + # update operation, then new value will be merged into the existing sub-message + # in the target resource. + # + # For example, given the target message: + # + # f { + # b { + # d: 1 + # x: 2 + # } + # c: [1] + # } + # + # And an update message: + # + # f { + # b { + # d: 10 + # } + # c: [2] + # } + # + # then if the field mask is: + # + # paths: ["f.b", "f.c"] + # + # then the result will be: + # + # f { + # b { + # d: 10 + # x: 2 + # } + # c: [1, 2] + # } + # + # An implementation may provide options to override this default behavior for + # repeated and message fields. + # + # In order to reset a field's value to the default, the field must + # be in the mask and set to the default value in the provided resource. + # Hence, in order to reset all fields of a resource, provide a default + # instance of the resource and set all fields in the mask, or do + # not provide a mask as described below. + # + # If a field mask is not present on update, the operation applies to + # all fields (as if a field mask of all fields has been specified). + # Note that in the presence of schema evolution, this may mean that + # fields the client does not know and has therefore not filled into + # the request will be reset to their default. If this is unwanted + # behavior, a specific service may require a client to always specify + # a field mask, producing an error if not. + # + # As with get operations, the location of the resource which + # describes the updated values in the request message depends on the + # operation kind. In any case, the effect of the field mask is + # required to be honored by the API. + # + # ## Considerations for HTTP REST + # + # The HTTP kind of an update operation which uses a field mask must + # be set to PATCH instead of PUT in order to satisfy HTTP semantics + # (PUT must only be used for full updates). + # + # # JSON Encoding of Field Masks + # + # In JSON, a field mask is encoded as a single string where paths are + # separated by a comma. Fields name in each path are converted + # to/from lower-camel naming conventions. + # + # As an example, consider the following message declarations: + # + # message Profile { + # User user = 1; + # Photo photo = 2; + # } + # message User { + # string display_name = 1; + # string address = 2; + # } + # + # In proto a field mask for `Profile` may look as such: + # + # mask { + # paths: "user.display_name" + # paths: "photo" + # } + # + # In JSON, the same mask is represented as below: + # + # { + # mask: "user.displayName,photo" + # } + # + # # Field Masks and Oneof Fields + # + # Field masks treat fields in oneofs just as regular fields. Consider the + # following message: + # + # message SampleMessage { + # oneof test_oneof { + # string name = 4; + # SubMessage sub_message = 9; + # } + # } + # + # The field mask can be: + # + # mask { + # paths: "name" + # } + # + # Or: + # + # mask { + # paths: "sub_message" + # } + # + # Note that oneof type names ("test_oneof" in this case) cannot be used in + # paths. + # + # ## Field Mask Verification + # + # The implementation of any API method which has a FieldMask type field in the + # request should verify the included field paths, and return an + # `INVALID_ARGUMENT` error if any path is unmappable. + # @!attribute [rw] paths + # @return [::Array<::String>] + # The set of field mask paths. + class FieldMask + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end +end diff --git a/owl-bot-staging/google-cloud-saas_platform-saas_service_mgmt-v1beta1/proto_docs/google/protobuf/timestamp.rb b/owl-bot-staging/google-cloud-saas_platform-saas_service_mgmt-v1beta1/proto_docs/google/protobuf/timestamp.rb new file mode 100644 index 000000000000..74352be9c58c --- /dev/null +++ b/owl-bot-staging/google-cloud-saas_platform-saas_service_mgmt-v1beta1/proto_docs/google/protobuf/timestamp.rb @@ -0,0 +1,127 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + + +module Google + module Protobuf + # A Timestamp represents a point in time independent of any time zone or local + # calendar, encoded as a count of seconds and fractions of seconds at + # nanosecond resolution. The count is relative to an epoch at UTC midnight on + # January 1, 1970, in the proleptic Gregorian calendar which extends the + # Gregorian calendar backwards to year one. + # + # All minutes are 60 seconds long. Leap seconds are "smeared" so that no leap + # second table is needed for interpretation, using a [24-hour linear + # smear](https://developers.google.com/time/smear). + # + # The range is from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59.999999999Z. By + # restricting to that range, we ensure that we can convert to and from [RFC + # 3339](https://www.ietf.org/rfc/rfc3339.txt) date strings. + # + # # Examples + # + # Example 1: Compute Timestamp from POSIX `time()`. + # + # Timestamp timestamp; + # timestamp.set_seconds(time(NULL)); + # timestamp.set_nanos(0); + # + # Example 2: Compute Timestamp from POSIX `gettimeofday()`. + # + # struct timeval tv; + # gettimeofday(&tv, NULL); + # + # Timestamp timestamp; + # timestamp.set_seconds(tv.tv_sec); + # timestamp.set_nanos(tv.tv_usec * 1000); + # + # Example 3: Compute Timestamp from Win32 `GetSystemTimeAsFileTime()`. + # + # FILETIME ft; + # GetSystemTimeAsFileTime(&ft); + # UINT64 ticks = (((UINT64)ft.dwHighDateTime) << 32) | ft.dwLowDateTime; + # + # // A Windows tick is 100 nanoseconds. Windows epoch 1601-01-01T00:00:00Z + # // is 11644473600 seconds before Unix epoch 1970-01-01T00:00:00Z. + # Timestamp timestamp; + # timestamp.set_seconds((INT64) ((ticks / 10000000) - 11644473600LL)); + # timestamp.set_nanos((INT32) ((ticks % 10000000) * 100)); + # + # Example 4: Compute Timestamp from Java `System.currentTimeMillis()`. + # + # long millis = System.currentTimeMillis(); + # + # Timestamp timestamp = Timestamp.newBuilder().setSeconds(millis / 1000) + # .setNanos((int) ((millis % 1000) * 1000000)).build(); + # + # Example 5: Compute Timestamp from Java `Instant.now()`. + # + # Instant now = Instant.now(); + # + # Timestamp timestamp = + # Timestamp.newBuilder().setSeconds(now.getEpochSecond()) + # .setNanos(now.getNano()).build(); + # + # Example 6: Compute Timestamp from current time in Python. + # + # timestamp = Timestamp() + # timestamp.GetCurrentTime() + # + # # JSON Mapping + # + # In JSON format, the Timestamp type is encoded as a string in the + # [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format. That is, the + # format is "\\{year}-\\{month}-\\{day}T\\{hour}:\\{min}:\\{sec}[.\\{frac_sec}]Z" + # where \\{year} is always expressed using four digits while \\{month}, \\{day}, + # \\{hour}, \\{min}, and \\{sec} are zero-padded to two digits each. The fractional + # seconds, which can go up to 9 digits (i.e. up to 1 nanosecond resolution), + # are optional. The "Z" suffix indicates the timezone ("UTC"); the timezone + # is required. A proto3 JSON serializer should always use UTC (as indicated by + # "Z") when printing the Timestamp type and a proto3 JSON parser should be + # able to accept both UTC and other timezones (as indicated by an offset). + # + # For example, "2017-01-15T01:30:15.01Z" encodes 15.01 seconds past + # 01:30 UTC on January 15, 2017. + # + # In JavaScript, one can convert a Date object to this format using the + # standard + # [toISOString()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toISOString) + # method. In Python, a standard `datetime.datetime` object can be converted + # to this format using + # [`strftime`](https://docs.python.org/2/library/time.html#time.strftime) with + # the time format spec '%Y-%m-%dT%H:%M:%S.%fZ'. Likewise, in Java, one can use + # the Joda Time's [`ISODateTimeFormat.dateTime()`]( + # http://joda-time.sourceforge.net/apidocs/org/joda/time/format/ISODateTimeFormat.html#dateTime() + # ) to obtain a formatter capable of generating timestamps in this format. + # @!attribute [rw] seconds + # @return [::Integer] + # Represents seconds of UTC time since Unix epoch + # 1970-01-01T00:00:00Z. Must be from 0001-01-01T00:00:00Z to + # 9999-12-31T23:59:59Z inclusive. + # @!attribute [rw] nanos + # @return [::Integer] + # Non-negative fractions of a second at nanosecond resolution. Negative + # second values with fractions must still have non-negative nanos values + # that count forward in time. Must be from 0 to 999,999,999 + # inclusive. + class Timestamp + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end +end diff --git a/owl-bot-staging/google-cloud-saas_platform-saas_service_mgmt-v1beta1/snippets/Gemfile b/owl-bot-staging/google-cloud-saas_platform-saas_service_mgmt-v1beta1/snippets/Gemfile new file mode 100644 index 000000000000..90ed07065127 --- /dev/null +++ b/owl-bot-staging/google-cloud-saas_platform-saas_service_mgmt-v1beta1/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-saas_platform-saas_service_mgmt-v1beta1", path: "../" +else + gem "google-cloud-saas_platform-saas_service_mgmt-v1beta1" +end + +group :test do + gem "google-style", "~> 1.26.1" + gem "minitest", "~> 5.16" + gem "minitest-focus", "~> 1.1" + gem "minitest-hooks", "~> 1.5" +end diff --git a/owl-bot-staging/google-cloud-saas_platform-saas_service_mgmt-v1beta1/snippets/saas_deployments/create_release.rb b/owl-bot-staging/google-cloud-saas_platform-saas_service_mgmt-v1beta1/snippets/saas_deployments/create_release.rb new file mode 100644 index 000000000000..671b415bccaf --- /dev/null +++ b/owl-bot-staging/google-cloud-saas_platform-saas_service_mgmt-v1beta1/snippets/saas_deployments/create_release.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 saasservicemgmt_v1beta1_generated_SaasDeployments_CreateRelease_sync] +require "google/cloud/saas_platform/saas_service_mgmt/v1beta1" + +## +# Snippet for the create_release call in the SaasDeployments service +# +# This snippet has been automatically generated and should be regarded as a code +# template only. It will require modifications to work: +# - It may require correct/in-range values for request initialization. +# - It may require specifying regional endpoints when creating the service +# client as shown in https://cloud.google.com/ruby/docs/reference. +# +# This is an auto-generated example demonstrating basic usage of +# Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::SaasDeployments::Client#create_release. +# +def create_release + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::SaasDeployments::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::CreateReleaseRequest.new + + # Call the create_release method. + result = client.create_release request + + # The returned object is of type Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::Release. + p result +end +# [END saasservicemgmt_v1beta1_generated_SaasDeployments_CreateRelease_sync] diff --git a/owl-bot-staging/google-cloud-saas_platform-saas_service_mgmt-v1beta1/snippets/saas_deployments/create_saas.rb b/owl-bot-staging/google-cloud-saas_platform-saas_service_mgmt-v1beta1/snippets/saas_deployments/create_saas.rb new file mode 100644 index 000000000000..02fe4e5f79a9 --- /dev/null +++ b/owl-bot-staging/google-cloud-saas_platform-saas_service_mgmt-v1beta1/snippets/saas_deployments/create_saas.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 saasservicemgmt_v1beta1_generated_SaasDeployments_CreateSaas_sync] +require "google/cloud/saas_platform/saas_service_mgmt/v1beta1" + +## +# Snippet for the create_saas call in the SaasDeployments service +# +# This snippet has been automatically generated and should be regarded as a code +# template only. It will require modifications to work: +# - It may require correct/in-range values for request initialization. +# - It may require specifying regional endpoints when creating the service +# client as shown in https://cloud.google.com/ruby/docs/reference. +# +# This is an auto-generated example demonstrating basic usage of +# Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::SaasDeployments::Client#create_saas. +# +def create_saas + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::SaasDeployments::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::CreateSaasRequest.new + + # Call the create_saas method. + result = client.create_saas request + + # The returned object is of type Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::Saas. + p result +end +# [END saasservicemgmt_v1beta1_generated_SaasDeployments_CreateSaas_sync] diff --git a/owl-bot-staging/google-cloud-saas_platform-saas_service_mgmt-v1beta1/snippets/saas_deployments/create_tenant.rb b/owl-bot-staging/google-cloud-saas_platform-saas_service_mgmt-v1beta1/snippets/saas_deployments/create_tenant.rb new file mode 100644 index 000000000000..29430bc889e1 --- /dev/null +++ b/owl-bot-staging/google-cloud-saas_platform-saas_service_mgmt-v1beta1/snippets/saas_deployments/create_tenant.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 saasservicemgmt_v1beta1_generated_SaasDeployments_CreateTenant_sync] +require "google/cloud/saas_platform/saas_service_mgmt/v1beta1" + +## +# Snippet for the create_tenant call in the SaasDeployments service +# +# This snippet has been automatically generated and should be regarded as a code +# template only. It will require modifications to work: +# - It may require correct/in-range values for request initialization. +# - It may require specifying regional endpoints when creating the service +# client as shown in https://cloud.google.com/ruby/docs/reference. +# +# This is an auto-generated example demonstrating basic usage of +# Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::SaasDeployments::Client#create_tenant. +# +def create_tenant + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::SaasDeployments::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::CreateTenantRequest.new + + # Call the create_tenant method. + result = client.create_tenant request + + # The returned object is of type Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::Tenant. + p result +end +# [END saasservicemgmt_v1beta1_generated_SaasDeployments_CreateTenant_sync] diff --git a/owl-bot-staging/google-cloud-saas_platform-saas_service_mgmt-v1beta1/snippets/saas_deployments/create_unit.rb b/owl-bot-staging/google-cloud-saas_platform-saas_service_mgmt-v1beta1/snippets/saas_deployments/create_unit.rb new file mode 100644 index 000000000000..8405bbd51ea4 --- /dev/null +++ b/owl-bot-staging/google-cloud-saas_platform-saas_service_mgmt-v1beta1/snippets/saas_deployments/create_unit.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 saasservicemgmt_v1beta1_generated_SaasDeployments_CreateUnit_sync] +require "google/cloud/saas_platform/saas_service_mgmt/v1beta1" + +## +# Snippet for the create_unit call in the SaasDeployments service +# +# This snippet has been automatically generated and should be regarded as a code +# template only. It will require modifications to work: +# - It may require correct/in-range values for request initialization. +# - It may require specifying regional endpoints when creating the service +# client as shown in https://cloud.google.com/ruby/docs/reference. +# +# This is an auto-generated example demonstrating basic usage of +# Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::SaasDeployments::Client#create_unit. +# +def create_unit + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::SaasDeployments::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::CreateUnitRequest.new + + # Call the create_unit method. + result = client.create_unit request + + # The returned object is of type Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::Unit. + p result +end +# [END saasservicemgmt_v1beta1_generated_SaasDeployments_CreateUnit_sync] diff --git a/owl-bot-staging/google-cloud-saas_platform-saas_service_mgmt-v1beta1/snippets/saas_deployments/create_unit_kind.rb b/owl-bot-staging/google-cloud-saas_platform-saas_service_mgmt-v1beta1/snippets/saas_deployments/create_unit_kind.rb new file mode 100644 index 000000000000..7ac9b6a85477 --- /dev/null +++ b/owl-bot-staging/google-cloud-saas_platform-saas_service_mgmt-v1beta1/snippets/saas_deployments/create_unit_kind.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 saasservicemgmt_v1beta1_generated_SaasDeployments_CreateUnitKind_sync] +require "google/cloud/saas_platform/saas_service_mgmt/v1beta1" + +## +# Snippet for the create_unit_kind call in the SaasDeployments service +# +# This snippet has been automatically generated and should be regarded as a code +# template only. It will require modifications to work: +# - It may require correct/in-range values for request initialization. +# - It may require specifying regional endpoints when creating the service +# client as shown in https://cloud.google.com/ruby/docs/reference. +# +# This is an auto-generated example demonstrating basic usage of +# Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::SaasDeployments::Client#create_unit_kind. +# +def create_unit_kind + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::SaasDeployments::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::CreateUnitKindRequest.new + + # Call the create_unit_kind method. + result = client.create_unit_kind request + + # The returned object is of type Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::UnitKind. + p result +end +# [END saasservicemgmt_v1beta1_generated_SaasDeployments_CreateUnitKind_sync] diff --git a/owl-bot-staging/google-cloud-saas_platform-saas_service_mgmt-v1beta1/snippets/saas_deployments/create_unit_operation.rb b/owl-bot-staging/google-cloud-saas_platform-saas_service_mgmt-v1beta1/snippets/saas_deployments/create_unit_operation.rb new file mode 100644 index 000000000000..1a57192d0804 --- /dev/null +++ b/owl-bot-staging/google-cloud-saas_platform-saas_service_mgmt-v1beta1/snippets/saas_deployments/create_unit_operation.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 saasservicemgmt_v1beta1_generated_SaasDeployments_CreateUnitOperation_sync] +require "google/cloud/saas_platform/saas_service_mgmt/v1beta1" + +## +# Snippet for the create_unit_operation call in the SaasDeployments service +# +# This snippet has been automatically generated and should be regarded as a code +# template only. It will require modifications to work: +# - It may require correct/in-range values for request initialization. +# - It may require specifying regional endpoints when creating the service +# client as shown in https://cloud.google.com/ruby/docs/reference. +# +# This is an auto-generated example demonstrating basic usage of +# Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::SaasDeployments::Client#create_unit_operation. +# +def create_unit_operation + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::SaasDeployments::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::CreateUnitOperationRequest.new + + # Call the create_unit_operation method. + result = client.create_unit_operation request + + # The returned object is of type Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::UnitOperation. + p result +end +# [END saasservicemgmt_v1beta1_generated_SaasDeployments_CreateUnitOperation_sync] diff --git a/owl-bot-staging/google-cloud-saas_platform-saas_service_mgmt-v1beta1/snippets/saas_deployments/delete_release.rb b/owl-bot-staging/google-cloud-saas_platform-saas_service_mgmt-v1beta1/snippets/saas_deployments/delete_release.rb new file mode 100644 index 000000000000..4b085d53871c --- /dev/null +++ b/owl-bot-staging/google-cloud-saas_platform-saas_service_mgmt-v1beta1/snippets/saas_deployments/delete_release.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 saasservicemgmt_v1beta1_generated_SaasDeployments_DeleteRelease_sync] +require "google/cloud/saas_platform/saas_service_mgmt/v1beta1" + +## +# Snippet for the delete_release call in the SaasDeployments service +# +# This snippet has been automatically generated and should be regarded as a code +# template only. It will require modifications to work: +# - It may require correct/in-range values for request initialization. +# - It may require specifying regional endpoints when creating the service +# client as shown in https://cloud.google.com/ruby/docs/reference. +# +# This is an auto-generated example demonstrating basic usage of +# Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::SaasDeployments::Client#delete_release. +# +def delete_release + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::SaasDeployments::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::DeleteReleaseRequest.new + + # Call the delete_release method. + result = client.delete_release request + + # The returned object is of type Google::Protobuf::Empty. + p result +end +# [END saasservicemgmt_v1beta1_generated_SaasDeployments_DeleteRelease_sync] diff --git a/owl-bot-staging/google-cloud-saas_platform-saas_service_mgmt-v1beta1/snippets/saas_deployments/delete_saas.rb b/owl-bot-staging/google-cloud-saas_platform-saas_service_mgmt-v1beta1/snippets/saas_deployments/delete_saas.rb new file mode 100644 index 000000000000..287b20fdd8de --- /dev/null +++ b/owl-bot-staging/google-cloud-saas_platform-saas_service_mgmt-v1beta1/snippets/saas_deployments/delete_saas.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 saasservicemgmt_v1beta1_generated_SaasDeployments_DeleteSaas_sync] +require "google/cloud/saas_platform/saas_service_mgmt/v1beta1" + +## +# Snippet for the delete_saas call in the SaasDeployments service +# +# This snippet has been automatically generated and should be regarded as a code +# template only. It will require modifications to work: +# - It may require correct/in-range values for request initialization. +# - It may require specifying regional endpoints when creating the service +# client as shown in https://cloud.google.com/ruby/docs/reference. +# +# This is an auto-generated example demonstrating basic usage of +# Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::SaasDeployments::Client#delete_saas. +# +def delete_saas + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::SaasDeployments::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::DeleteSaasRequest.new + + # Call the delete_saas method. + result = client.delete_saas request + + # The returned object is of type Google::Protobuf::Empty. + p result +end +# [END saasservicemgmt_v1beta1_generated_SaasDeployments_DeleteSaas_sync] diff --git a/owl-bot-staging/google-cloud-saas_platform-saas_service_mgmt-v1beta1/snippets/saas_deployments/delete_tenant.rb b/owl-bot-staging/google-cloud-saas_platform-saas_service_mgmt-v1beta1/snippets/saas_deployments/delete_tenant.rb new file mode 100644 index 000000000000..ff3f88c333bb --- /dev/null +++ b/owl-bot-staging/google-cloud-saas_platform-saas_service_mgmt-v1beta1/snippets/saas_deployments/delete_tenant.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 saasservicemgmt_v1beta1_generated_SaasDeployments_DeleteTenant_sync] +require "google/cloud/saas_platform/saas_service_mgmt/v1beta1" + +## +# Snippet for the delete_tenant call in the SaasDeployments service +# +# This snippet has been automatically generated and should be regarded as a code +# template only. It will require modifications to work: +# - It may require correct/in-range values for request initialization. +# - It may require specifying regional endpoints when creating the service +# client as shown in https://cloud.google.com/ruby/docs/reference. +# +# This is an auto-generated example demonstrating basic usage of +# Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::SaasDeployments::Client#delete_tenant. +# +def delete_tenant + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::SaasDeployments::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::DeleteTenantRequest.new + + # Call the delete_tenant method. + result = client.delete_tenant request + + # The returned object is of type Google::Protobuf::Empty. + p result +end +# [END saasservicemgmt_v1beta1_generated_SaasDeployments_DeleteTenant_sync] diff --git a/owl-bot-staging/google-cloud-saas_platform-saas_service_mgmt-v1beta1/snippets/saas_deployments/delete_unit.rb b/owl-bot-staging/google-cloud-saas_platform-saas_service_mgmt-v1beta1/snippets/saas_deployments/delete_unit.rb new file mode 100644 index 000000000000..f6f2d7f2d174 --- /dev/null +++ b/owl-bot-staging/google-cloud-saas_platform-saas_service_mgmt-v1beta1/snippets/saas_deployments/delete_unit.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 saasservicemgmt_v1beta1_generated_SaasDeployments_DeleteUnit_sync] +require "google/cloud/saas_platform/saas_service_mgmt/v1beta1" + +## +# Snippet for the delete_unit call in the SaasDeployments service +# +# This snippet has been automatically generated and should be regarded as a code +# template only. It will require modifications to work: +# - It may require correct/in-range values for request initialization. +# - It may require specifying regional endpoints when creating the service +# client as shown in https://cloud.google.com/ruby/docs/reference. +# +# This is an auto-generated example demonstrating basic usage of +# Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::SaasDeployments::Client#delete_unit. +# +def delete_unit + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::SaasDeployments::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::DeleteUnitRequest.new + + # Call the delete_unit method. + result = client.delete_unit request + + # The returned object is of type Google::Protobuf::Empty. + p result +end +# [END saasservicemgmt_v1beta1_generated_SaasDeployments_DeleteUnit_sync] diff --git a/owl-bot-staging/google-cloud-saas_platform-saas_service_mgmt-v1beta1/snippets/saas_deployments/delete_unit_kind.rb b/owl-bot-staging/google-cloud-saas_platform-saas_service_mgmt-v1beta1/snippets/saas_deployments/delete_unit_kind.rb new file mode 100644 index 000000000000..464fd58d299d --- /dev/null +++ b/owl-bot-staging/google-cloud-saas_platform-saas_service_mgmt-v1beta1/snippets/saas_deployments/delete_unit_kind.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 saasservicemgmt_v1beta1_generated_SaasDeployments_DeleteUnitKind_sync] +require "google/cloud/saas_platform/saas_service_mgmt/v1beta1" + +## +# Snippet for the delete_unit_kind call in the SaasDeployments service +# +# This snippet has been automatically generated and should be regarded as a code +# template only. It will require modifications to work: +# - It may require correct/in-range values for request initialization. +# - It may require specifying regional endpoints when creating the service +# client as shown in https://cloud.google.com/ruby/docs/reference. +# +# This is an auto-generated example demonstrating basic usage of +# Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::SaasDeployments::Client#delete_unit_kind. +# +def delete_unit_kind + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::SaasDeployments::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::DeleteUnitKindRequest.new + + # Call the delete_unit_kind method. + result = client.delete_unit_kind request + + # The returned object is of type Google::Protobuf::Empty. + p result +end +# [END saasservicemgmt_v1beta1_generated_SaasDeployments_DeleteUnitKind_sync] diff --git a/owl-bot-staging/google-cloud-saas_platform-saas_service_mgmt-v1beta1/snippets/saas_deployments/delete_unit_operation.rb b/owl-bot-staging/google-cloud-saas_platform-saas_service_mgmt-v1beta1/snippets/saas_deployments/delete_unit_operation.rb new file mode 100644 index 000000000000..3cebe280b187 --- /dev/null +++ b/owl-bot-staging/google-cloud-saas_platform-saas_service_mgmt-v1beta1/snippets/saas_deployments/delete_unit_operation.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 saasservicemgmt_v1beta1_generated_SaasDeployments_DeleteUnitOperation_sync] +require "google/cloud/saas_platform/saas_service_mgmt/v1beta1" + +## +# Snippet for the delete_unit_operation call in the SaasDeployments service +# +# This snippet has been automatically generated and should be regarded as a code +# template only. It will require modifications to work: +# - It may require correct/in-range values for request initialization. +# - It may require specifying regional endpoints when creating the service +# client as shown in https://cloud.google.com/ruby/docs/reference. +# +# This is an auto-generated example demonstrating basic usage of +# Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::SaasDeployments::Client#delete_unit_operation. +# +def delete_unit_operation + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::SaasDeployments::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::DeleteUnitOperationRequest.new + + # Call the delete_unit_operation method. + result = client.delete_unit_operation request + + # The returned object is of type Google::Protobuf::Empty. + p result +end +# [END saasservicemgmt_v1beta1_generated_SaasDeployments_DeleteUnitOperation_sync] diff --git a/owl-bot-staging/google-cloud-saas_platform-saas_service_mgmt-v1beta1/snippets/saas_deployments/get_release.rb b/owl-bot-staging/google-cloud-saas_platform-saas_service_mgmt-v1beta1/snippets/saas_deployments/get_release.rb new file mode 100644 index 000000000000..d5bc5e385302 --- /dev/null +++ b/owl-bot-staging/google-cloud-saas_platform-saas_service_mgmt-v1beta1/snippets/saas_deployments/get_release.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 saasservicemgmt_v1beta1_generated_SaasDeployments_GetRelease_sync] +require "google/cloud/saas_platform/saas_service_mgmt/v1beta1" + +## +# Snippet for the get_release call in the SaasDeployments service +# +# This snippet has been automatically generated and should be regarded as a code +# template only. It will require modifications to work: +# - It may require correct/in-range values for request initialization. +# - It may require specifying regional endpoints when creating the service +# client as shown in https://cloud.google.com/ruby/docs/reference. +# +# This is an auto-generated example demonstrating basic usage of +# Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::SaasDeployments::Client#get_release. +# +def get_release + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::SaasDeployments::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::GetReleaseRequest.new + + # Call the get_release method. + result = client.get_release request + + # The returned object is of type Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::Release. + p result +end +# [END saasservicemgmt_v1beta1_generated_SaasDeployments_GetRelease_sync] diff --git a/owl-bot-staging/google-cloud-saas_platform-saas_service_mgmt-v1beta1/snippets/saas_deployments/get_saas.rb b/owl-bot-staging/google-cloud-saas_platform-saas_service_mgmt-v1beta1/snippets/saas_deployments/get_saas.rb new file mode 100644 index 000000000000..2f6921848e62 --- /dev/null +++ b/owl-bot-staging/google-cloud-saas_platform-saas_service_mgmt-v1beta1/snippets/saas_deployments/get_saas.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 saasservicemgmt_v1beta1_generated_SaasDeployments_GetSaas_sync] +require "google/cloud/saas_platform/saas_service_mgmt/v1beta1" + +## +# Snippet for the get_saas call in the SaasDeployments service +# +# This snippet has been automatically generated and should be regarded as a code +# template only. It will require modifications to work: +# - It may require correct/in-range values for request initialization. +# - It may require specifying regional endpoints when creating the service +# client as shown in https://cloud.google.com/ruby/docs/reference. +# +# This is an auto-generated example demonstrating basic usage of +# Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::SaasDeployments::Client#get_saas. +# +def get_saas + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::SaasDeployments::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::GetSaasRequest.new + + # Call the get_saas method. + result = client.get_saas request + + # The returned object is of type Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::Saas. + p result +end +# [END saasservicemgmt_v1beta1_generated_SaasDeployments_GetSaas_sync] diff --git a/owl-bot-staging/google-cloud-saas_platform-saas_service_mgmt-v1beta1/snippets/saas_deployments/get_tenant.rb b/owl-bot-staging/google-cloud-saas_platform-saas_service_mgmt-v1beta1/snippets/saas_deployments/get_tenant.rb new file mode 100644 index 000000000000..e60c8042ce13 --- /dev/null +++ b/owl-bot-staging/google-cloud-saas_platform-saas_service_mgmt-v1beta1/snippets/saas_deployments/get_tenant.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 saasservicemgmt_v1beta1_generated_SaasDeployments_GetTenant_sync] +require "google/cloud/saas_platform/saas_service_mgmt/v1beta1" + +## +# Snippet for the get_tenant call in the SaasDeployments service +# +# This snippet has been automatically generated and should be regarded as a code +# template only. It will require modifications to work: +# - It may require correct/in-range values for request initialization. +# - It may require specifying regional endpoints when creating the service +# client as shown in https://cloud.google.com/ruby/docs/reference. +# +# This is an auto-generated example demonstrating basic usage of +# Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::SaasDeployments::Client#get_tenant. +# +def get_tenant + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::SaasDeployments::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::GetTenantRequest.new + + # Call the get_tenant method. + result = client.get_tenant request + + # The returned object is of type Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::Tenant. + p result +end +# [END saasservicemgmt_v1beta1_generated_SaasDeployments_GetTenant_sync] diff --git a/owl-bot-staging/google-cloud-saas_platform-saas_service_mgmt-v1beta1/snippets/saas_deployments/get_unit.rb b/owl-bot-staging/google-cloud-saas_platform-saas_service_mgmt-v1beta1/snippets/saas_deployments/get_unit.rb new file mode 100644 index 000000000000..b539f8b644dc --- /dev/null +++ b/owl-bot-staging/google-cloud-saas_platform-saas_service_mgmt-v1beta1/snippets/saas_deployments/get_unit.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 saasservicemgmt_v1beta1_generated_SaasDeployments_GetUnit_sync] +require "google/cloud/saas_platform/saas_service_mgmt/v1beta1" + +## +# Snippet for the get_unit call in the SaasDeployments service +# +# This snippet has been automatically generated and should be regarded as a code +# template only. It will require modifications to work: +# - It may require correct/in-range values for request initialization. +# - It may require specifying regional endpoints when creating the service +# client as shown in https://cloud.google.com/ruby/docs/reference. +# +# This is an auto-generated example demonstrating basic usage of +# Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::SaasDeployments::Client#get_unit. +# +def get_unit + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::SaasDeployments::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::GetUnitRequest.new + + # Call the get_unit method. + result = client.get_unit request + + # The returned object is of type Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::Unit. + p result +end +# [END saasservicemgmt_v1beta1_generated_SaasDeployments_GetUnit_sync] diff --git a/owl-bot-staging/google-cloud-saas_platform-saas_service_mgmt-v1beta1/snippets/saas_deployments/get_unit_kind.rb b/owl-bot-staging/google-cloud-saas_platform-saas_service_mgmt-v1beta1/snippets/saas_deployments/get_unit_kind.rb new file mode 100644 index 000000000000..82f5ce85888b --- /dev/null +++ b/owl-bot-staging/google-cloud-saas_platform-saas_service_mgmt-v1beta1/snippets/saas_deployments/get_unit_kind.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 saasservicemgmt_v1beta1_generated_SaasDeployments_GetUnitKind_sync] +require "google/cloud/saas_platform/saas_service_mgmt/v1beta1" + +## +# Snippet for the get_unit_kind call in the SaasDeployments service +# +# This snippet has been automatically generated and should be regarded as a code +# template only. It will require modifications to work: +# - It may require correct/in-range values for request initialization. +# - It may require specifying regional endpoints when creating the service +# client as shown in https://cloud.google.com/ruby/docs/reference. +# +# This is an auto-generated example demonstrating basic usage of +# Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::SaasDeployments::Client#get_unit_kind. +# +def get_unit_kind + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::SaasDeployments::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::GetUnitKindRequest.new + + # Call the get_unit_kind method. + result = client.get_unit_kind request + + # The returned object is of type Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::UnitKind. + p result +end +# [END saasservicemgmt_v1beta1_generated_SaasDeployments_GetUnitKind_sync] diff --git a/owl-bot-staging/google-cloud-saas_platform-saas_service_mgmt-v1beta1/snippets/saas_deployments/get_unit_operation.rb b/owl-bot-staging/google-cloud-saas_platform-saas_service_mgmt-v1beta1/snippets/saas_deployments/get_unit_operation.rb new file mode 100644 index 000000000000..6cfaedfe0ca0 --- /dev/null +++ b/owl-bot-staging/google-cloud-saas_platform-saas_service_mgmt-v1beta1/snippets/saas_deployments/get_unit_operation.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 saasservicemgmt_v1beta1_generated_SaasDeployments_GetUnitOperation_sync] +require "google/cloud/saas_platform/saas_service_mgmt/v1beta1" + +## +# Snippet for the get_unit_operation call in the SaasDeployments service +# +# This snippet has been automatically generated and should be regarded as a code +# template only. It will require modifications to work: +# - It may require correct/in-range values for request initialization. +# - It may require specifying regional endpoints when creating the service +# client as shown in https://cloud.google.com/ruby/docs/reference. +# +# This is an auto-generated example demonstrating basic usage of +# Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::SaasDeployments::Client#get_unit_operation. +# +def get_unit_operation + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::SaasDeployments::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::GetUnitOperationRequest.new + + # Call the get_unit_operation method. + result = client.get_unit_operation request + + # The returned object is of type Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::UnitOperation. + p result +end +# [END saasservicemgmt_v1beta1_generated_SaasDeployments_GetUnitOperation_sync] diff --git a/owl-bot-staging/google-cloud-saas_platform-saas_service_mgmt-v1beta1/snippets/saas_deployments/list_releases.rb b/owl-bot-staging/google-cloud-saas_platform-saas_service_mgmt-v1beta1/snippets/saas_deployments/list_releases.rb new file mode 100644 index 000000000000..7e0d486189c4 --- /dev/null +++ b/owl-bot-staging/google-cloud-saas_platform-saas_service_mgmt-v1beta1/snippets/saas_deployments/list_releases.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 saasservicemgmt_v1beta1_generated_SaasDeployments_ListReleases_sync] +require "google/cloud/saas_platform/saas_service_mgmt/v1beta1" + +## +# Snippet for the list_releases call in the SaasDeployments service +# +# This snippet has been automatically generated and should be regarded as a code +# template only. It will require modifications to work: +# - It may require correct/in-range values for request initialization. +# - It may require specifying regional endpoints when creating the service +# client as shown in https://cloud.google.com/ruby/docs/reference. +# +# This is an auto-generated example demonstrating basic usage of +# Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::SaasDeployments::Client#list_releases. +# +def list_releases + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::SaasDeployments::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::ListReleasesRequest.new + + # Call the list_releases method. + result = client.list_releases request + + # The returned object is of type Gapic::PagedEnumerable. You can iterate + # over elements, and API calls will be issued to fetch pages as needed. + result.each do |item| + # Each element is of type ::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::Release. + p item + end +end +# [END saasservicemgmt_v1beta1_generated_SaasDeployments_ListReleases_sync] diff --git a/owl-bot-staging/google-cloud-saas_platform-saas_service_mgmt-v1beta1/snippets/saas_deployments/list_saas.rb b/owl-bot-staging/google-cloud-saas_platform-saas_service_mgmt-v1beta1/snippets/saas_deployments/list_saas.rb new file mode 100644 index 000000000000..e329ba8bf277 --- /dev/null +++ b/owl-bot-staging/google-cloud-saas_platform-saas_service_mgmt-v1beta1/snippets/saas_deployments/list_saas.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 saasservicemgmt_v1beta1_generated_SaasDeployments_ListSaas_sync] +require "google/cloud/saas_platform/saas_service_mgmt/v1beta1" + +## +# Snippet for the list_saas call in the SaasDeployments service +# +# This snippet has been automatically generated and should be regarded as a code +# template only. It will require modifications to work: +# - It may require correct/in-range values for request initialization. +# - It may require specifying regional endpoints when creating the service +# client as shown in https://cloud.google.com/ruby/docs/reference. +# +# This is an auto-generated example demonstrating basic usage of +# Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::SaasDeployments::Client#list_saas. +# +def list_saas + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::SaasDeployments::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::ListSaasRequest.new + + # Call the list_saas method. + result = client.list_saas request + + # The returned object is of type Gapic::PagedEnumerable. You can iterate + # over elements, and API calls will be issued to fetch pages as needed. + result.each do |item| + # Each element is of type ::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::Saas. + p item + end +end +# [END saasservicemgmt_v1beta1_generated_SaasDeployments_ListSaas_sync] diff --git a/owl-bot-staging/google-cloud-saas_platform-saas_service_mgmt-v1beta1/snippets/saas_deployments/list_tenants.rb b/owl-bot-staging/google-cloud-saas_platform-saas_service_mgmt-v1beta1/snippets/saas_deployments/list_tenants.rb new file mode 100644 index 000000000000..63aa78449af2 --- /dev/null +++ b/owl-bot-staging/google-cloud-saas_platform-saas_service_mgmt-v1beta1/snippets/saas_deployments/list_tenants.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 saasservicemgmt_v1beta1_generated_SaasDeployments_ListTenants_sync] +require "google/cloud/saas_platform/saas_service_mgmt/v1beta1" + +## +# Snippet for the list_tenants call in the SaasDeployments service +# +# This snippet has been automatically generated and should be regarded as a code +# template only. It will require modifications to work: +# - It may require correct/in-range values for request initialization. +# - It may require specifying regional endpoints when creating the service +# client as shown in https://cloud.google.com/ruby/docs/reference. +# +# This is an auto-generated example demonstrating basic usage of +# Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::SaasDeployments::Client#list_tenants. +# +def list_tenants + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::SaasDeployments::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::ListTenantsRequest.new + + # Call the list_tenants method. + result = client.list_tenants request + + # The returned object is of type Gapic::PagedEnumerable. You can iterate + # over elements, and API calls will be issued to fetch pages as needed. + result.each do |item| + # Each element is of type ::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::Tenant. + p item + end +end +# [END saasservicemgmt_v1beta1_generated_SaasDeployments_ListTenants_sync] diff --git a/owl-bot-staging/google-cloud-saas_platform-saas_service_mgmt-v1beta1/snippets/saas_deployments/list_unit_kinds.rb b/owl-bot-staging/google-cloud-saas_platform-saas_service_mgmt-v1beta1/snippets/saas_deployments/list_unit_kinds.rb new file mode 100644 index 000000000000..853423937a44 --- /dev/null +++ b/owl-bot-staging/google-cloud-saas_platform-saas_service_mgmt-v1beta1/snippets/saas_deployments/list_unit_kinds.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 saasservicemgmt_v1beta1_generated_SaasDeployments_ListUnitKinds_sync] +require "google/cloud/saas_platform/saas_service_mgmt/v1beta1" + +## +# Snippet for the list_unit_kinds call in the SaasDeployments service +# +# This snippet has been automatically generated and should be regarded as a code +# template only. It will require modifications to work: +# - It may require correct/in-range values for request initialization. +# - It may require specifying regional endpoints when creating the service +# client as shown in https://cloud.google.com/ruby/docs/reference. +# +# This is an auto-generated example demonstrating basic usage of +# Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::SaasDeployments::Client#list_unit_kinds. +# +def list_unit_kinds + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::SaasDeployments::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::ListUnitKindsRequest.new + + # Call the list_unit_kinds method. + result = client.list_unit_kinds request + + # The returned object is of type Gapic::PagedEnumerable. You can iterate + # over elements, and API calls will be issued to fetch pages as needed. + result.each do |item| + # Each element is of type ::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::UnitKind. + p item + end +end +# [END saasservicemgmt_v1beta1_generated_SaasDeployments_ListUnitKinds_sync] diff --git a/owl-bot-staging/google-cloud-saas_platform-saas_service_mgmt-v1beta1/snippets/saas_deployments/list_unit_operations.rb b/owl-bot-staging/google-cloud-saas_platform-saas_service_mgmt-v1beta1/snippets/saas_deployments/list_unit_operations.rb new file mode 100644 index 000000000000..c1338c41f63b --- /dev/null +++ b/owl-bot-staging/google-cloud-saas_platform-saas_service_mgmt-v1beta1/snippets/saas_deployments/list_unit_operations.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 saasservicemgmt_v1beta1_generated_SaasDeployments_ListUnitOperations_sync] +require "google/cloud/saas_platform/saas_service_mgmt/v1beta1" + +## +# Snippet for the list_unit_operations call in the SaasDeployments service +# +# This snippet has been automatically generated and should be regarded as a code +# template only. It will require modifications to work: +# - It may require correct/in-range values for request initialization. +# - It may require specifying regional endpoints when creating the service +# client as shown in https://cloud.google.com/ruby/docs/reference. +# +# This is an auto-generated example demonstrating basic usage of +# Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::SaasDeployments::Client#list_unit_operations. +# +def list_unit_operations + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::SaasDeployments::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::ListUnitOperationsRequest.new + + # Call the list_unit_operations method. + result = client.list_unit_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::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::UnitOperation. + p item + end +end +# [END saasservicemgmt_v1beta1_generated_SaasDeployments_ListUnitOperations_sync] diff --git a/owl-bot-staging/google-cloud-saas_platform-saas_service_mgmt-v1beta1/snippets/saas_deployments/list_units.rb b/owl-bot-staging/google-cloud-saas_platform-saas_service_mgmt-v1beta1/snippets/saas_deployments/list_units.rb new file mode 100644 index 000000000000..91dec6bd49e1 --- /dev/null +++ b/owl-bot-staging/google-cloud-saas_platform-saas_service_mgmt-v1beta1/snippets/saas_deployments/list_units.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 saasservicemgmt_v1beta1_generated_SaasDeployments_ListUnits_sync] +require "google/cloud/saas_platform/saas_service_mgmt/v1beta1" + +## +# Snippet for the list_units call in the SaasDeployments service +# +# This snippet has been automatically generated and should be regarded as a code +# template only. It will require modifications to work: +# - It may require correct/in-range values for request initialization. +# - It may require specifying regional endpoints when creating the service +# client as shown in https://cloud.google.com/ruby/docs/reference. +# +# This is an auto-generated example demonstrating basic usage of +# Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::SaasDeployments::Client#list_units. +# +def list_units + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::SaasDeployments::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::ListUnitsRequest.new + + # Call the list_units method. + result = client.list_units request + + # The returned object is of type Gapic::PagedEnumerable. You can iterate + # over elements, and API calls will be issued to fetch pages as needed. + result.each do |item| + # Each element is of type ::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::Unit. + p item + end +end +# [END saasservicemgmt_v1beta1_generated_SaasDeployments_ListUnits_sync] diff --git a/owl-bot-staging/google-cloud-saas_platform-saas_service_mgmt-v1beta1/snippets/saas_deployments/update_release.rb b/owl-bot-staging/google-cloud-saas_platform-saas_service_mgmt-v1beta1/snippets/saas_deployments/update_release.rb new file mode 100644 index 000000000000..9de4514884f5 --- /dev/null +++ b/owl-bot-staging/google-cloud-saas_platform-saas_service_mgmt-v1beta1/snippets/saas_deployments/update_release.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 saasservicemgmt_v1beta1_generated_SaasDeployments_UpdateRelease_sync] +require "google/cloud/saas_platform/saas_service_mgmt/v1beta1" + +## +# Snippet for the update_release call in the SaasDeployments service +# +# This snippet has been automatically generated and should be regarded as a code +# template only. It will require modifications to work: +# - It may require correct/in-range values for request initialization. +# - It may require specifying regional endpoints when creating the service +# client as shown in https://cloud.google.com/ruby/docs/reference. +# +# This is an auto-generated example demonstrating basic usage of +# Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::SaasDeployments::Client#update_release. +# +def update_release + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::SaasDeployments::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::UpdateReleaseRequest.new + + # Call the update_release method. + result = client.update_release request + + # The returned object is of type Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::Release. + p result +end +# [END saasservicemgmt_v1beta1_generated_SaasDeployments_UpdateRelease_sync] diff --git a/owl-bot-staging/google-cloud-saas_platform-saas_service_mgmt-v1beta1/snippets/saas_deployments/update_saas.rb b/owl-bot-staging/google-cloud-saas_platform-saas_service_mgmt-v1beta1/snippets/saas_deployments/update_saas.rb new file mode 100644 index 000000000000..5701d900ad11 --- /dev/null +++ b/owl-bot-staging/google-cloud-saas_platform-saas_service_mgmt-v1beta1/snippets/saas_deployments/update_saas.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 saasservicemgmt_v1beta1_generated_SaasDeployments_UpdateSaas_sync] +require "google/cloud/saas_platform/saas_service_mgmt/v1beta1" + +## +# Snippet for the update_saas call in the SaasDeployments service +# +# This snippet has been automatically generated and should be regarded as a code +# template only. It will require modifications to work: +# - It may require correct/in-range values for request initialization. +# - It may require specifying regional endpoints when creating the service +# client as shown in https://cloud.google.com/ruby/docs/reference. +# +# This is an auto-generated example demonstrating basic usage of +# Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::SaasDeployments::Client#update_saas. +# +def update_saas + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::SaasDeployments::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::UpdateSaasRequest.new + + # Call the update_saas method. + result = client.update_saas request + + # The returned object is of type Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::Saas. + p result +end +# [END saasservicemgmt_v1beta1_generated_SaasDeployments_UpdateSaas_sync] diff --git a/owl-bot-staging/google-cloud-saas_platform-saas_service_mgmt-v1beta1/snippets/saas_deployments/update_tenant.rb b/owl-bot-staging/google-cloud-saas_platform-saas_service_mgmt-v1beta1/snippets/saas_deployments/update_tenant.rb new file mode 100644 index 000000000000..5a9daf469f69 --- /dev/null +++ b/owl-bot-staging/google-cloud-saas_platform-saas_service_mgmt-v1beta1/snippets/saas_deployments/update_tenant.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 saasservicemgmt_v1beta1_generated_SaasDeployments_UpdateTenant_sync] +require "google/cloud/saas_platform/saas_service_mgmt/v1beta1" + +## +# Snippet for the update_tenant call in the SaasDeployments service +# +# This snippet has been automatically generated and should be regarded as a code +# template only. It will require modifications to work: +# - It may require correct/in-range values for request initialization. +# - It may require specifying regional endpoints when creating the service +# client as shown in https://cloud.google.com/ruby/docs/reference. +# +# This is an auto-generated example demonstrating basic usage of +# Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::SaasDeployments::Client#update_tenant. +# +def update_tenant + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::SaasDeployments::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::UpdateTenantRequest.new + + # Call the update_tenant method. + result = client.update_tenant request + + # The returned object is of type Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::Tenant. + p result +end +# [END saasservicemgmt_v1beta1_generated_SaasDeployments_UpdateTenant_sync] diff --git a/owl-bot-staging/google-cloud-saas_platform-saas_service_mgmt-v1beta1/snippets/saas_deployments/update_unit.rb b/owl-bot-staging/google-cloud-saas_platform-saas_service_mgmt-v1beta1/snippets/saas_deployments/update_unit.rb new file mode 100644 index 000000000000..f0ea79580356 --- /dev/null +++ b/owl-bot-staging/google-cloud-saas_platform-saas_service_mgmt-v1beta1/snippets/saas_deployments/update_unit.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 saasservicemgmt_v1beta1_generated_SaasDeployments_UpdateUnit_sync] +require "google/cloud/saas_platform/saas_service_mgmt/v1beta1" + +## +# Snippet for the update_unit call in the SaasDeployments service +# +# This snippet has been automatically generated and should be regarded as a code +# template only. It will require modifications to work: +# - It may require correct/in-range values for request initialization. +# - It may require specifying regional endpoints when creating the service +# client as shown in https://cloud.google.com/ruby/docs/reference. +# +# This is an auto-generated example demonstrating basic usage of +# Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::SaasDeployments::Client#update_unit. +# +def update_unit + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::SaasDeployments::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::UpdateUnitRequest.new + + # Call the update_unit method. + result = client.update_unit request + + # The returned object is of type Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::Unit. + p result +end +# [END saasservicemgmt_v1beta1_generated_SaasDeployments_UpdateUnit_sync] diff --git a/owl-bot-staging/google-cloud-saas_platform-saas_service_mgmt-v1beta1/snippets/saas_deployments/update_unit_kind.rb b/owl-bot-staging/google-cloud-saas_platform-saas_service_mgmt-v1beta1/snippets/saas_deployments/update_unit_kind.rb new file mode 100644 index 000000000000..c5f670d063c8 --- /dev/null +++ b/owl-bot-staging/google-cloud-saas_platform-saas_service_mgmt-v1beta1/snippets/saas_deployments/update_unit_kind.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 saasservicemgmt_v1beta1_generated_SaasDeployments_UpdateUnitKind_sync] +require "google/cloud/saas_platform/saas_service_mgmt/v1beta1" + +## +# Snippet for the update_unit_kind call in the SaasDeployments service +# +# This snippet has been automatically generated and should be regarded as a code +# template only. It will require modifications to work: +# - It may require correct/in-range values for request initialization. +# - It may require specifying regional endpoints when creating the service +# client as shown in https://cloud.google.com/ruby/docs/reference. +# +# This is an auto-generated example demonstrating basic usage of +# Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::SaasDeployments::Client#update_unit_kind. +# +def update_unit_kind + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::SaasDeployments::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::UpdateUnitKindRequest.new + + # Call the update_unit_kind method. + result = client.update_unit_kind request + + # The returned object is of type Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::UnitKind. + p result +end +# [END saasservicemgmt_v1beta1_generated_SaasDeployments_UpdateUnitKind_sync] diff --git a/owl-bot-staging/google-cloud-saas_platform-saas_service_mgmt-v1beta1/snippets/saas_deployments/update_unit_operation.rb b/owl-bot-staging/google-cloud-saas_platform-saas_service_mgmt-v1beta1/snippets/saas_deployments/update_unit_operation.rb new file mode 100644 index 000000000000..45e4839655fe --- /dev/null +++ b/owl-bot-staging/google-cloud-saas_platform-saas_service_mgmt-v1beta1/snippets/saas_deployments/update_unit_operation.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 saasservicemgmt_v1beta1_generated_SaasDeployments_UpdateUnitOperation_sync] +require "google/cloud/saas_platform/saas_service_mgmt/v1beta1" + +## +# Snippet for the update_unit_operation call in the SaasDeployments service +# +# This snippet has been automatically generated and should be regarded as a code +# template only. It will require modifications to work: +# - It may require correct/in-range values for request initialization. +# - It may require specifying regional endpoints when creating the service +# client as shown in https://cloud.google.com/ruby/docs/reference. +# +# This is an auto-generated example demonstrating basic usage of +# Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::SaasDeployments::Client#update_unit_operation. +# +def update_unit_operation + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::SaasDeployments::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::UpdateUnitOperationRequest.new + + # Call the update_unit_operation method. + result = client.update_unit_operation request + + # The returned object is of type Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::UnitOperation. + p result +end +# [END saasservicemgmt_v1beta1_generated_SaasDeployments_UpdateUnitOperation_sync] diff --git a/owl-bot-staging/google-cloud-saas_platform-saas_service_mgmt-v1beta1/snippets/saas_rollouts/create_rollout.rb b/owl-bot-staging/google-cloud-saas_platform-saas_service_mgmt-v1beta1/snippets/saas_rollouts/create_rollout.rb new file mode 100644 index 000000000000..ca268c23b8e5 --- /dev/null +++ b/owl-bot-staging/google-cloud-saas_platform-saas_service_mgmt-v1beta1/snippets/saas_rollouts/create_rollout.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 saasservicemgmt_v1beta1_generated_SaasRollouts_CreateRollout_sync] +require "google/cloud/saas_platform/saas_service_mgmt/v1beta1" + +## +# Snippet for the create_rollout call in the SaasRollouts service +# +# This snippet has been automatically generated and should be regarded as a code +# template only. It will require modifications to work: +# - It may require correct/in-range values for request initialization. +# - It may require specifying regional endpoints when creating the service +# client as shown in https://cloud.google.com/ruby/docs/reference. +# +# This is an auto-generated example demonstrating basic usage of +# Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::SaasRollouts::Client#create_rollout. +# +def create_rollout + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::SaasRollouts::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::CreateRolloutRequest.new + + # Call the create_rollout method. + result = client.create_rollout request + + # The returned object is of type Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::Rollout. + p result +end +# [END saasservicemgmt_v1beta1_generated_SaasRollouts_CreateRollout_sync] diff --git a/owl-bot-staging/google-cloud-saas_platform-saas_service_mgmt-v1beta1/snippets/saas_rollouts/create_rollout_kind.rb b/owl-bot-staging/google-cloud-saas_platform-saas_service_mgmt-v1beta1/snippets/saas_rollouts/create_rollout_kind.rb new file mode 100644 index 000000000000..b2eff129e8aa --- /dev/null +++ b/owl-bot-staging/google-cloud-saas_platform-saas_service_mgmt-v1beta1/snippets/saas_rollouts/create_rollout_kind.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 saasservicemgmt_v1beta1_generated_SaasRollouts_CreateRolloutKind_sync] +require "google/cloud/saas_platform/saas_service_mgmt/v1beta1" + +## +# Snippet for the create_rollout_kind call in the SaasRollouts service +# +# This snippet has been automatically generated and should be regarded as a code +# template only. It will require modifications to work: +# - It may require correct/in-range values for request initialization. +# - It may require specifying regional endpoints when creating the service +# client as shown in https://cloud.google.com/ruby/docs/reference. +# +# This is an auto-generated example demonstrating basic usage of +# Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::SaasRollouts::Client#create_rollout_kind. +# +def create_rollout_kind + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::SaasRollouts::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::CreateRolloutKindRequest.new + + # Call the create_rollout_kind method. + result = client.create_rollout_kind request + + # The returned object is of type Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::RolloutKind. + p result +end +# [END saasservicemgmt_v1beta1_generated_SaasRollouts_CreateRolloutKind_sync] diff --git a/owl-bot-staging/google-cloud-saas_platform-saas_service_mgmt-v1beta1/snippets/saas_rollouts/delete_rollout.rb b/owl-bot-staging/google-cloud-saas_platform-saas_service_mgmt-v1beta1/snippets/saas_rollouts/delete_rollout.rb new file mode 100644 index 000000000000..3635f31da3c8 --- /dev/null +++ b/owl-bot-staging/google-cloud-saas_platform-saas_service_mgmt-v1beta1/snippets/saas_rollouts/delete_rollout.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 saasservicemgmt_v1beta1_generated_SaasRollouts_DeleteRollout_sync] +require "google/cloud/saas_platform/saas_service_mgmt/v1beta1" + +## +# Snippet for the delete_rollout call in the SaasRollouts service +# +# This snippet has been automatically generated and should be regarded as a code +# template only. It will require modifications to work: +# - It may require correct/in-range values for request initialization. +# - It may require specifying regional endpoints when creating the service +# client as shown in https://cloud.google.com/ruby/docs/reference. +# +# This is an auto-generated example demonstrating basic usage of +# Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::SaasRollouts::Client#delete_rollout. +# +def delete_rollout + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::SaasRollouts::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::DeleteRolloutRequest.new + + # Call the delete_rollout method. + result = client.delete_rollout request + + # The returned object is of type Google::Protobuf::Empty. + p result +end +# [END saasservicemgmt_v1beta1_generated_SaasRollouts_DeleteRollout_sync] diff --git a/owl-bot-staging/google-cloud-saas_platform-saas_service_mgmt-v1beta1/snippets/saas_rollouts/delete_rollout_kind.rb b/owl-bot-staging/google-cloud-saas_platform-saas_service_mgmt-v1beta1/snippets/saas_rollouts/delete_rollout_kind.rb new file mode 100644 index 000000000000..85b390cdb835 --- /dev/null +++ b/owl-bot-staging/google-cloud-saas_platform-saas_service_mgmt-v1beta1/snippets/saas_rollouts/delete_rollout_kind.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 saasservicemgmt_v1beta1_generated_SaasRollouts_DeleteRolloutKind_sync] +require "google/cloud/saas_platform/saas_service_mgmt/v1beta1" + +## +# Snippet for the delete_rollout_kind call in the SaasRollouts service +# +# This snippet has been automatically generated and should be regarded as a code +# template only. It will require modifications to work: +# - It may require correct/in-range values for request initialization. +# - It may require specifying regional endpoints when creating the service +# client as shown in https://cloud.google.com/ruby/docs/reference. +# +# This is an auto-generated example demonstrating basic usage of +# Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::SaasRollouts::Client#delete_rollout_kind. +# +def delete_rollout_kind + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::SaasRollouts::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::DeleteRolloutKindRequest.new + + # Call the delete_rollout_kind method. + result = client.delete_rollout_kind request + + # The returned object is of type Google::Protobuf::Empty. + p result +end +# [END saasservicemgmt_v1beta1_generated_SaasRollouts_DeleteRolloutKind_sync] diff --git a/owl-bot-staging/google-cloud-saas_platform-saas_service_mgmt-v1beta1/snippets/saas_rollouts/get_rollout.rb b/owl-bot-staging/google-cloud-saas_platform-saas_service_mgmt-v1beta1/snippets/saas_rollouts/get_rollout.rb new file mode 100644 index 000000000000..a753725a1396 --- /dev/null +++ b/owl-bot-staging/google-cloud-saas_platform-saas_service_mgmt-v1beta1/snippets/saas_rollouts/get_rollout.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 saasservicemgmt_v1beta1_generated_SaasRollouts_GetRollout_sync] +require "google/cloud/saas_platform/saas_service_mgmt/v1beta1" + +## +# Snippet for the get_rollout call in the SaasRollouts service +# +# This snippet has been automatically generated and should be regarded as a code +# template only. It will require modifications to work: +# - It may require correct/in-range values for request initialization. +# - It may require specifying regional endpoints when creating the service +# client as shown in https://cloud.google.com/ruby/docs/reference. +# +# This is an auto-generated example demonstrating basic usage of +# Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::SaasRollouts::Client#get_rollout. +# +def get_rollout + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::SaasRollouts::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::GetRolloutRequest.new + + # Call the get_rollout method. + result = client.get_rollout request + + # The returned object is of type Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::Rollout. + p result +end +# [END saasservicemgmt_v1beta1_generated_SaasRollouts_GetRollout_sync] diff --git a/owl-bot-staging/google-cloud-saas_platform-saas_service_mgmt-v1beta1/snippets/saas_rollouts/get_rollout_kind.rb b/owl-bot-staging/google-cloud-saas_platform-saas_service_mgmt-v1beta1/snippets/saas_rollouts/get_rollout_kind.rb new file mode 100644 index 000000000000..4bfbd24ee493 --- /dev/null +++ b/owl-bot-staging/google-cloud-saas_platform-saas_service_mgmt-v1beta1/snippets/saas_rollouts/get_rollout_kind.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 saasservicemgmt_v1beta1_generated_SaasRollouts_GetRolloutKind_sync] +require "google/cloud/saas_platform/saas_service_mgmt/v1beta1" + +## +# Snippet for the get_rollout_kind call in the SaasRollouts service +# +# This snippet has been automatically generated and should be regarded as a code +# template only. It will require modifications to work: +# - It may require correct/in-range values for request initialization. +# - It may require specifying regional endpoints when creating the service +# client as shown in https://cloud.google.com/ruby/docs/reference. +# +# This is an auto-generated example demonstrating basic usage of +# Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::SaasRollouts::Client#get_rollout_kind. +# +def get_rollout_kind + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::SaasRollouts::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::GetRolloutKindRequest.new + + # Call the get_rollout_kind method. + result = client.get_rollout_kind request + + # The returned object is of type Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::RolloutKind. + p result +end +# [END saasservicemgmt_v1beta1_generated_SaasRollouts_GetRolloutKind_sync] diff --git a/owl-bot-staging/google-cloud-saas_platform-saas_service_mgmt-v1beta1/snippets/saas_rollouts/list_rollout_kinds.rb b/owl-bot-staging/google-cloud-saas_platform-saas_service_mgmt-v1beta1/snippets/saas_rollouts/list_rollout_kinds.rb new file mode 100644 index 000000000000..ae58381bb397 --- /dev/null +++ b/owl-bot-staging/google-cloud-saas_platform-saas_service_mgmt-v1beta1/snippets/saas_rollouts/list_rollout_kinds.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 saasservicemgmt_v1beta1_generated_SaasRollouts_ListRolloutKinds_sync] +require "google/cloud/saas_platform/saas_service_mgmt/v1beta1" + +## +# Snippet for the list_rollout_kinds call in the SaasRollouts service +# +# This snippet has been automatically generated and should be regarded as a code +# template only. It will require modifications to work: +# - It may require correct/in-range values for request initialization. +# - It may require specifying regional endpoints when creating the service +# client as shown in https://cloud.google.com/ruby/docs/reference. +# +# This is an auto-generated example demonstrating basic usage of +# Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::SaasRollouts::Client#list_rollout_kinds. +# +def list_rollout_kinds + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::SaasRollouts::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::ListRolloutKindsRequest.new + + # Call the list_rollout_kinds method. + result = client.list_rollout_kinds request + + # The returned object is of type Gapic::PagedEnumerable. You can iterate + # over elements, and API calls will be issued to fetch pages as needed. + result.each do |item| + # Each element is of type ::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::RolloutKind. + p item + end +end +# [END saasservicemgmt_v1beta1_generated_SaasRollouts_ListRolloutKinds_sync] diff --git a/owl-bot-staging/google-cloud-saas_platform-saas_service_mgmt-v1beta1/snippets/saas_rollouts/list_rollouts.rb b/owl-bot-staging/google-cloud-saas_platform-saas_service_mgmt-v1beta1/snippets/saas_rollouts/list_rollouts.rb new file mode 100644 index 000000000000..4a9d1ea856ee --- /dev/null +++ b/owl-bot-staging/google-cloud-saas_platform-saas_service_mgmt-v1beta1/snippets/saas_rollouts/list_rollouts.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 saasservicemgmt_v1beta1_generated_SaasRollouts_ListRollouts_sync] +require "google/cloud/saas_platform/saas_service_mgmt/v1beta1" + +## +# Snippet for the list_rollouts call in the SaasRollouts service +# +# This snippet has been automatically generated and should be regarded as a code +# template only. It will require modifications to work: +# - It may require correct/in-range values for request initialization. +# - It may require specifying regional endpoints when creating the service +# client as shown in https://cloud.google.com/ruby/docs/reference. +# +# This is an auto-generated example demonstrating basic usage of +# Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::SaasRollouts::Client#list_rollouts. +# +def list_rollouts + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::SaasRollouts::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::ListRolloutsRequest.new + + # Call the list_rollouts method. + result = client.list_rollouts request + + # The returned object is of type Gapic::PagedEnumerable. You can iterate + # over elements, and API calls will be issued to fetch pages as needed. + result.each do |item| + # Each element is of type ::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::Rollout. + p item + end +end +# [END saasservicemgmt_v1beta1_generated_SaasRollouts_ListRollouts_sync] diff --git a/owl-bot-staging/google-cloud-saas_platform-saas_service_mgmt-v1beta1/snippets/saas_rollouts/update_rollout.rb b/owl-bot-staging/google-cloud-saas_platform-saas_service_mgmt-v1beta1/snippets/saas_rollouts/update_rollout.rb new file mode 100644 index 000000000000..fdc3c34c42ae --- /dev/null +++ b/owl-bot-staging/google-cloud-saas_platform-saas_service_mgmt-v1beta1/snippets/saas_rollouts/update_rollout.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 saasservicemgmt_v1beta1_generated_SaasRollouts_UpdateRollout_sync] +require "google/cloud/saas_platform/saas_service_mgmt/v1beta1" + +## +# Snippet for the update_rollout call in the SaasRollouts service +# +# This snippet has been automatically generated and should be regarded as a code +# template only. It will require modifications to work: +# - It may require correct/in-range values for request initialization. +# - It may require specifying regional endpoints when creating the service +# client as shown in https://cloud.google.com/ruby/docs/reference. +# +# This is an auto-generated example demonstrating basic usage of +# Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::SaasRollouts::Client#update_rollout. +# +def update_rollout + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::SaasRollouts::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::UpdateRolloutRequest.new + + # Call the update_rollout method. + result = client.update_rollout request + + # The returned object is of type Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::Rollout. + p result +end +# [END saasservicemgmt_v1beta1_generated_SaasRollouts_UpdateRollout_sync] diff --git a/owl-bot-staging/google-cloud-saas_platform-saas_service_mgmt-v1beta1/snippets/saas_rollouts/update_rollout_kind.rb b/owl-bot-staging/google-cloud-saas_platform-saas_service_mgmt-v1beta1/snippets/saas_rollouts/update_rollout_kind.rb new file mode 100644 index 000000000000..1343b74ff25c --- /dev/null +++ b/owl-bot-staging/google-cloud-saas_platform-saas_service_mgmt-v1beta1/snippets/saas_rollouts/update_rollout_kind.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 saasservicemgmt_v1beta1_generated_SaasRollouts_UpdateRolloutKind_sync] +require "google/cloud/saas_platform/saas_service_mgmt/v1beta1" + +## +# Snippet for the update_rollout_kind call in the SaasRollouts service +# +# This snippet has been automatically generated and should be regarded as a code +# template only. It will require modifications to work: +# - It may require correct/in-range values for request initialization. +# - It may require specifying regional endpoints when creating the service +# client as shown in https://cloud.google.com/ruby/docs/reference. +# +# This is an auto-generated example demonstrating basic usage of +# Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::SaasRollouts::Client#update_rollout_kind. +# +def update_rollout_kind + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::SaasRollouts::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::UpdateRolloutKindRequest.new + + # Call the update_rollout_kind method. + result = client.update_rollout_kind request + + # The returned object is of type Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::RolloutKind. + p result +end +# [END saasservicemgmt_v1beta1_generated_SaasRollouts_UpdateRolloutKind_sync] diff --git a/owl-bot-staging/google-cloud-saas_platform-saas_service_mgmt-v1beta1/snippets/snippet_metadata_google.cloud.saasplatform.saasservicemgmt.v1beta1.json b/owl-bot-staging/google-cloud-saas_platform-saas_service_mgmt-v1beta1/snippets/snippet_metadata_google.cloud.saasplatform.saasservicemgmt.v1beta1.json new file mode 100644 index 000000000000..212cb6c72d68 --- /dev/null +++ b/owl-bot-staging/google-cloud-saas_platform-saas_service_mgmt-v1beta1/snippets/snippet_metadata_google.cloud.saasplatform.saasservicemgmt.v1beta1.json @@ -0,0 +1,1615 @@ +{ + "client_library": { + "name": "google-cloud-saas_platform-saas_service_mgmt-v1beta1", + "version": "", + "language": "RUBY", + "apis": [ + { + "id": "google.cloud.saasplatform.saasservicemgmt.v1beta1", + "version": "v1beta1" + } + ] + }, + "snippets": [ + { + "region_tag": "saasservicemgmt_v1beta1_generated_SaasDeployments_ListSaas_sync", + "title": "Snippet for the list_saas call in the SaasDeployments service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::SaasDeployments::Client#list_saas.", + "file": "saas_deployments/list_saas.rb", + "language": "RUBY", + "client_method": { + "short_name": "list_saas", + "full_name": "::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::SaasDeployments::Client#list_saas", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::ListSaasRequest", + "name": "request" + } + ], + "result_type": "::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::ListSaasResponse", + "client": { + "short_name": "SaasDeployments::Client", + "full_name": "::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::SaasDeployments::Client" + }, + "method": { + "short_name": "ListSaas", + "full_name": "google.cloud.saasplatform.saasservicemgmt.v1beta1.SaasDeployments.ListSaas", + "service": { + "short_name": "SaasDeployments", + "full_name": "google.cloud.saasplatform.saasservicemgmt.v1beta1.SaasDeployments" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 50, + "type": "FULL" + } + ] + }, + { + "region_tag": "saasservicemgmt_v1beta1_generated_SaasDeployments_GetSaas_sync", + "title": "Snippet for the get_saas call in the SaasDeployments service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::SaasDeployments::Client#get_saas.", + "file": "saas_deployments/get_saas.rb", + "language": "RUBY", + "client_method": { + "short_name": "get_saas", + "full_name": "::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::SaasDeployments::Client#get_saas", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::GetSaasRequest", + "name": "request" + } + ], + "result_type": "::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::Saas", + "client": { + "short_name": "SaasDeployments::Client", + "full_name": "::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::SaasDeployments::Client" + }, + "method": { + "short_name": "GetSaas", + "full_name": "google.cloud.saasplatform.saasservicemgmt.v1beta1.SaasDeployments.GetSaas", + "service": { + "short_name": "SaasDeployments", + "full_name": "google.cloud.saasplatform.saasservicemgmt.v1beta1.SaasDeployments" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 46, + "type": "FULL" + } + ] + }, + { + "region_tag": "saasservicemgmt_v1beta1_generated_SaasDeployments_CreateSaas_sync", + "title": "Snippet for the create_saas call in the SaasDeployments service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::SaasDeployments::Client#create_saas.", + "file": "saas_deployments/create_saas.rb", + "language": "RUBY", + "client_method": { + "short_name": "create_saas", + "full_name": "::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::SaasDeployments::Client#create_saas", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::CreateSaasRequest", + "name": "request" + } + ], + "result_type": "::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::Saas", + "client": { + "short_name": "SaasDeployments::Client", + "full_name": "::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::SaasDeployments::Client" + }, + "method": { + "short_name": "CreateSaas", + "full_name": "google.cloud.saasplatform.saasservicemgmt.v1beta1.SaasDeployments.CreateSaas", + "service": { + "short_name": "SaasDeployments", + "full_name": "google.cloud.saasplatform.saasservicemgmt.v1beta1.SaasDeployments" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 46, + "type": "FULL" + } + ] + }, + { + "region_tag": "saasservicemgmt_v1beta1_generated_SaasDeployments_UpdateSaas_sync", + "title": "Snippet for the update_saas call in the SaasDeployments service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::SaasDeployments::Client#update_saas.", + "file": "saas_deployments/update_saas.rb", + "language": "RUBY", + "client_method": { + "short_name": "update_saas", + "full_name": "::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::SaasDeployments::Client#update_saas", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::UpdateSaasRequest", + "name": "request" + } + ], + "result_type": "::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::Saas", + "client": { + "short_name": "SaasDeployments::Client", + "full_name": "::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::SaasDeployments::Client" + }, + "method": { + "short_name": "UpdateSaas", + "full_name": "google.cloud.saasplatform.saasservicemgmt.v1beta1.SaasDeployments.UpdateSaas", + "service": { + "short_name": "SaasDeployments", + "full_name": "google.cloud.saasplatform.saasservicemgmt.v1beta1.SaasDeployments" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 46, + "type": "FULL" + } + ] + }, + { + "region_tag": "saasservicemgmt_v1beta1_generated_SaasDeployments_DeleteSaas_sync", + "title": "Snippet for the delete_saas call in the SaasDeployments service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::SaasDeployments::Client#delete_saas.", + "file": "saas_deployments/delete_saas.rb", + "language": "RUBY", + "client_method": { + "short_name": "delete_saas", + "full_name": "::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::SaasDeployments::Client#delete_saas", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::DeleteSaasRequest", + "name": "request" + } + ], + "result_type": "::Google::Protobuf::Empty", + "client": { + "short_name": "SaasDeployments::Client", + "full_name": "::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::SaasDeployments::Client" + }, + "method": { + "short_name": "DeleteSaas", + "full_name": "google.cloud.saasplatform.saasservicemgmt.v1beta1.SaasDeployments.DeleteSaas", + "service": { + "short_name": "SaasDeployments", + "full_name": "google.cloud.saasplatform.saasservicemgmt.v1beta1.SaasDeployments" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 46, + "type": "FULL" + } + ] + }, + { + "region_tag": "saasservicemgmt_v1beta1_generated_SaasDeployments_ListTenants_sync", + "title": "Snippet for the list_tenants call in the SaasDeployments service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::SaasDeployments::Client#list_tenants.", + "file": "saas_deployments/list_tenants.rb", + "language": "RUBY", + "client_method": { + "short_name": "list_tenants", + "full_name": "::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::SaasDeployments::Client#list_tenants", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::ListTenantsRequest", + "name": "request" + } + ], + "result_type": "::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::ListTenantsResponse", + "client": { + "short_name": "SaasDeployments::Client", + "full_name": "::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::SaasDeployments::Client" + }, + "method": { + "short_name": "ListTenants", + "full_name": "google.cloud.saasplatform.saasservicemgmt.v1beta1.SaasDeployments.ListTenants", + "service": { + "short_name": "SaasDeployments", + "full_name": "google.cloud.saasplatform.saasservicemgmt.v1beta1.SaasDeployments" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 50, + "type": "FULL" + } + ] + }, + { + "region_tag": "saasservicemgmt_v1beta1_generated_SaasDeployments_GetTenant_sync", + "title": "Snippet for the get_tenant call in the SaasDeployments service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::SaasDeployments::Client#get_tenant.", + "file": "saas_deployments/get_tenant.rb", + "language": "RUBY", + "client_method": { + "short_name": "get_tenant", + "full_name": "::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::SaasDeployments::Client#get_tenant", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::GetTenantRequest", + "name": "request" + } + ], + "result_type": "::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::Tenant", + "client": { + "short_name": "SaasDeployments::Client", + "full_name": "::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::SaasDeployments::Client" + }, + "method": { + "short_name": "GetTenant", + "full_name": "google.cloud.saasplatform.saasservicemgmt.v1beta1.SaasDeployments.GetTenant", + "service": { + "short_name": "SaasDeployments", + "full_name": "google.cloud.saasplatform.saasservicemgmt.v1beta1.SaasDeployments" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 46, + "type": "FULL" + } + ] + }, + { + "region_tag": "saasservicemgmt_v1beta1_generated_SaasDeployments_CreateTenant_sync", + "title": "Snippet for the create_tenant call in the SaasDeployments service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::SaasDeployments::Client#create_tenant.", + "file": "saas_deployments/create_tenant.rb", + "language": "RUBY", + "client_method": { + "short_name": "create_tenant", + "full_name": "::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::SaasDeployments::Client#create_tenant", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::CreateTenantRequest", + "name": "request" + } + ], + "result_type": "::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::Tenant", + "client": { + "short_name": "SaasDeployments::Client", + "full_name": "::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::SaasDeployments::Client" + }, + "method": { + "short_name": "CreateTenant", + "full_name": "google.cloud.saasplatform.saasservicemgmt.v1beta1.SaasDeployments.CreateTenant", + "service": { + "short_name": "SaasDeployments", + "full_name": "google.cloud.saasplatform.saasservicemgmt.v1beta1.SaasDeployments" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 46, + "type": "FULL" + } + ] + }, + { + "region_tag": "saasservicemgmt_v1beta1_generated_SaasDeployments_UpdateTenant_sync", + "title": "Snippet for the update_tenant call in the SaasDeployments service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::SaasDeployments::Client#update_tenant.", + "file": "saas_deployments/update_tenant.rb", + "language": "RUBY", + "client_method": { + "short_name": "update_tenant", + "full_name": "::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::SaasDeployments::Client#update_tenant", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::UpdateTenantRequest", + "name": "request" + } + ], + "result_type": "::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::Tenant", + "client": { + "short_name": "SaasDeployments::Client", + "full_name": "::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::SaasDeployments::Client" + }, + "method": { + "short_name": "UpdateTenant", + "full_name": "google.cloud.saasplatform.saasservicemgmt.v1beta1.SaasDeployments.UpdateTenant", + "service": { + "short_name": "SaasDeployments", + "full_name": "google.cloud.saasplatform.saasservicemgmt.v1beta1.SaasDeployments" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 46, + "type": "FULL" + } + ] + }, + { + "region_tag": "saasservicemgmt_v1beta1_generated_SaasDeployments_DeleteTenant_sync", + "title": "Snippet for the delete_tenant call in the SaasDeployments service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::SaasDeployments::Client#delete_tenant.", + "file": "saas_deployments/delete_tenant.rb", + "language": "RUBY", + "client_method": { + "short_name": "delete_tenant", + "full_name": "::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::SaasDeployments::Client#delete_tenant", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::DeleteTenantRequest", + "name": "request" + } + ], + "result_type": "::Google::Protobuf::Empty", + "client": { + "short_name": "SaasDeployments::Client", + "full_name": "::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::SaasDeployments::Client" + }, + "method": { + "short_name": "DeleteTenant", + "full_name": "google.cloud.saasplatform.saasservicemgmt.v1beta1.SaasDeployments.DeleteTenant", + "service": { + "short_name": "SaasDeployments", + "full_name": "google.cloud.saasplatform.saasservicemgmt.v1beta1.SaasDeployments" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 46, + "type": "FULL" + } + ] + }, + { + "region_tag": "saasservicemgmt_v1beta1_generated_SaasDeployments_ListUnitKinds_sync", + "title": "Snippet for the list_unit_kinds call in the SaasDeployments service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::SaasDeployments::Client#list_unit_kinds.", + "file": "saas_deployments/list_unit_kinds.rb", + "language": "RUBY", + "client_method": { + "short_name": "list_unit_kinds", + "full_name": "::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::SaasDeployments::Client#list_unit_kinds", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::ListUnitKindsRequest", + "name": "request" + } + ], + "result_type": "::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::ListUnitKindsResponse", + "client": { + "short_name": "SaasDeployments::Client", + "full_name": "::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::SaasDeployments::Client" + }, + "method": { + "short_name": "ListUnitKinds", + "full_name": "google.cloud.saasplatform.saasservicemgmt.v1beta1.SaasDeployments.ListUnitKinds", + "service": { + "short_name": "SaasDeployments", + "full_name": "google.cloud.saasplatform.saasservicemgmt.v1beta1.SaasDeployments" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 50, + "type": "FULL" + } + ] + }, + { + "region_tag": "saasservicemgmt_v1beta1_generated_SaasDeployments_GetUnitKind_sync", + "title": "Snippet for the get_unit_kind call in the SaasDeployments service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::SaasDeployments::Client#get_unit_kind.", + "file": "saas_deployments/get_unit_kind.rb", + "language": "RUBY", + "client_method": { + "short_name": "get_unit_kind", + "full_name": "::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::SaasDeployments::Client#get_unit_kind", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::GetUnitKindRequest", + "name": "request" + } + ], + "result_type": "::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::UnitKind", + "client": { + "short_name": "SaasDeployments::Client", + "full_name": "::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::SaasDeployments::Client" + }, + "method": { + "short_name": "GetUnitKind", + "full_name": "google.cloud.saasplatform.saasservicemgmt.v1beta1.SaasDeployments.GetUnitKind", + "service": { + "short_name": "SaasDeployments", + "full_name": "google.cloud.saasplatform.saasservicemgmt.v1beta1.SaasDeployments" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 46, + "type": "FULL" + } + ] + }, + { + "region_tag": "saasservicemgmt_v1beta1_generated_SaasDeployments_CreateUnitKind_sync", + "title": "Snippet for the create_unit_kind call in the SaasDeployments service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::SaasDeployments::Client#create_unit_kind.", + "file": "saas_deployments/create_unit_kind.rb", + "language": "RUBY", + "client_method": { + "short_name": "create_unit_kind", + "full_name": "::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::SaasDeployments::Client#create_unit_kind", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::CreateUnitKindRequest", + "name": "request" + } + ], + "result_type": "::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::UnitKind", + "client": { + "short_name": "SaasDeployments::Client", + "full_name": "::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::SaasDeployments::Client" + }, + "method": { + "short_name": "CreateUnitKind", + "full_name": "google.cloud.saasplatform.saasservicemgmt.v1beta1.SaasDeployments.CreateUnitKind", + "service": { + "short_name": "SaasDeployments", + "full_name": "google.cloud.saasplatform.saasservicemgmt.v1beta1.SaasDeployments" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 46, + "type": "FULL" + } + ] + }, + { + "region_tag": "saasservicemgmt_v1beta1_generated_SaasDeployments_UpdateUnitKind_sync", + "title": "Snippet for the update_unit_kind call in the SaasDeployments service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::SaasDeployments::Client#update_unit_kind.", + "file": "saas_deployments/update_unit_kind.rb", + "language": "RUBY", + "client_method": { + "short_name": "update_unit_kind", + "full_name": "::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::SaasDeployments::Client#update_unit_kind", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::UpdateUnitKindRequest", + "name": "request" + } + ], + "result_type": "::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::UnitKind", + "client": { + "short_name": "SaasDeployments::Client", + "full_name": "::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::SaasDeployments::Client" + }, + "method": { + "short_name": "UpdateUnitKind", + "full_name": "google.cloud.saasplatform.saasservicemgmt.v1beta1.SaasDeployments.UpdateUnitKind", + "service": { + "short_name": "SaasDeployments", + "full_name": "google.cloud.saasplatform.saasservicemgmt.v1beta1.SaasDeployments" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 46, + "type": "FULL" + } + ] + }, + { + "region_tag": "saasservicemgmt_v1beta1_generated_SaasDeployments_DeleteUnitKind_sync", + "title": "Snippet for the delete_unit_kind call in the SaasDeployments service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::SaasDeployments::Client#delete_unit_kind.", + "file": "saas_deployments/delete_unit_kind.rb", + "language": "RUBY", + "client_method": { + "short_name": "delete_unit_kind", + "full_name": "::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::SaasDeployments::Client#delete_unit_kind", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::DeleteUnitKindRequest", + "name": "request" + } + ], + "result_type": "::Google::Protobuf::Empty", + "client": { + "short_name": "SaasDeployments::Client", + "full_name": "::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::SaasDeployments::Client" + }, + "method": { + "short_name": "DeleteUnitKind", + "full_name": "google.cloud.saasplatform.saasservicemgmt.v1beta1.SaasDeployments.DeleteUnitKind", + "service": { + "short_name": "SaasDeployments", + "full_name": "google.cloud.saasplatform.saasservicemgmt.v1beta1.SaasDeployments" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 46, + "type": "FULL" + } + ] + }, + { + "region_tag": "saasservicemgmt_v1beta1_generated_SaasDeployments_ListUnits_sync", + "title": "Snippet for the list_units call in the SaasDeployments service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::SaasDeployments::Client#list_units.", + "file": "saas_deployments/list_units.rb", + "language": "RUBY", + "client_method": { + "short_name": "list_units", + "full_name": "::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::SaasDeployments::Client#list_units", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::ListUnitsRequest", + "name": "request" + } + ], + "result_type": "::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::ListUnitsResponse", + "client": { + "short_name": "SaasDeployments::Client", + "full_name": "::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::SaasDeployments::Client" + }, + "method": { + "short_name": "ListUnits", + "full_name": "google.cloud.saasplatform.saasservicemgmt.v1beta1.SaasDeployments.ListUnits", + "service": { + "short_name": "SaasDeployments", + "full_name": "google.cloud.saasplatform.saasservicemgmt.v1beta1.SaasDeployments" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 50, + "type": "FULL" + } + ] + }, + { + "region_tag": "saasservicemgmt_v1beta1_generated_SaasDeployments_GetUnit_sync", + "title": "Snippet for the get_unit call in the SaasDeployments service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::SaasDeployments::Client#get_unit.", + "file": "saas_deployments/get_unit.rb", + "language": "RUBY", + "client_method": { + "short_name": "get_unit", + "full_name": "::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::SaasDeployments::Client#get_unit", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::GetUnitRequest", + "name": "request" + } + ], + "result_type": "::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::Unit", + "client": { + "short_name": "SaasDeployments::Client", + "full_name": "::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::SaasDeployments::Client" + }, + "method": { + "short_name": "GetUnit", + "full_name": "google.cloud.saasplatform.saasservicemgmt.v1beta1.SaasDeployments.GetUnit", + "service": { + "short_name": "SaasDeployments", + "full_name": "google.cloud.saasplatform.saasservicemgmt.v1beta1.SaasDeployments" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 46, + "type": "FULL" + } + ] + }, + { + "region_tag": "saasservicemgmt_v1beta1_generated_SaasDeployments_CreateUnit_sync", + "title": "Snippet for the create_unit call in the SaasDeployments service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::SaasDeployments::Client#create_unit.", + "file": "saas_deployments/create_unit.rb", + "language": "RUBY", + "client_method": { + "short_name": "create_unit", + "full_name": "::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::SaasDeployments::Client#create_unit", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::CreateUnitRequest", + "name": "request" + } + ], + "result_type": "::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::Unit", + "client": { + "short_name": "SaasDeployments::Client", + "full_name": "::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::SaasDeployments::Client" + }, + "method": { + "short_name": "CreateUnit", + "full_name": "google.cloud.saasplatform.saasservicemgmt.v1beta1.SaasDeployments.CreateUnit", + "service": { + "short_name": "SaasDeployments", + "full_name": "google.cloud.saasplatform.saasservicemgmt.v1beta1.SaasDeployments" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 46, + "type": "FULL" + } + ] + }, + { + "region_tag": "saasservicemgmt_v1beta1_generated_SaasDeployments_UpdateUnit_sync", + "title": "Snippet for the update_unit call in the SaasDeployments service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::SaasDeployments::Client#update_unit.", + "file": "saas_deployments/update_unit.rb", + "language": "RUBY", + "client_method": { + "short_name": "update_unit", + "full_name": "::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::SaasDeployments::Client#update_unit", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::UpdateUnitRequest", + "name": "request" + } + ], + "result_type": "::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::Unit", + "client": { + "short_name": "SaasDeployments::Client", + "full_name": "::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::SaasDeployments::Client" + }, + "method": { + "short_name": "UpdateUnit", + "full_name": "google.cloud.saasplatform.saasservicemgmt.v1beta1.SaasDeployments.UpdateUnit", + "service": { + "short_name": "SaasDeployments", + "full_name": "google.cloud.saasplatform.saasservicemgmt.v1beta1.SaasDeployments" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 46, + "type": "FULL" + } + ] + }, + { + "region_tag": "saasservicemgmt_v1beta1_generated_SaasDeployments_DeleteUnit_sync", + "title": "Snippet for the delete_unit call in the SaasDeployments service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::SaasDeployments::Client#delete_unit.", + "file": "saas_deployments/delete_unit.rb", + "language": "RUBY", + "client_method": { + "short_name": "delete_unit", + "full_name": "::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::SaasDeployments::Client#delete_unit", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::DeleteUnitRequest", + "name": "request" + } + ], + "result_type": "::Google::Protobuf::Empty", + "client": { + "short_name": "SaasDeployments::Client", + "full_name": "::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::SaasDeployments::Client" + }, + "method": { + "short_name": "DeleteUnit", + "full_name": "google.cloud.saasplatform.saasservicemgmt.v1beta1.SaasDeployments.DeleteUnit", + "service": { + "short_name": "SaasDeployments", + "full_name": "google.cloud.saasplatform.saasservicemgmt.v1beta1.SaasDeployments" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 46, + "type": "FULL" + } + ] + }, + { + "region_tag": "saasservicemgmt_v1beta1_generated_SaasDeployments_ListUnitOperations_sync", + "title": "Snippet for the list_unit_operations call in the SaasDeployments service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::SaasDeployments::Client#list_unit_operations.", + "file": "saas_deployments/list_unit_operations.rb", + "language": "RUBY", + "client_method": { + "short_name": "list_unit_operations", + "full_name": "::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::SaasDeployments::Client#list_unit_operations", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::ListUnitOperationsRequest", + "name": "request" + } + ], + "result_type": "::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::ListUnitOperationsResponse", + "client": { + "short_name": "SaasDeployments::Client", + "full_name": "::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::SaasDeployments::Client" + }, + "method": { + "short_name": "ListUnitOperations", + "full_name": "google.cloud.saasplatform.saasservicemgmt.v1beta1.SaasDeployments.ListUnitOperations", + "service": { + "short_name": "SaasDeployments", + "full_name": "google.cloud.saasplatform.saasservicemgmt.v1beta1.SaasDeployments" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 50, + "type": "FULL" + } + ] + }, + { + "region_tag": "saasservicemgmt_v1beta1_generated_SaasDeployments_GetUnitOperation_sync", + "title": "Snippet for the get_unit_operation call in the SaasDeployments service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::SaasDeployments::Client#get_unit_operation.", + "file": "saas_deployments/get_unit_operation.rb", + "language": "RUBY", + "client_method": { + "short_name": "get_unit_operation", + "full_name": "::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::SaasDeployments::Client#get_unit_operation", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::GetUnitOperationRequest", + "name": "request" + } + ], + "result_type": "::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::UnitOperation", + "client": { + "short_name": "SaasDeployments::Client", + "full_name": "::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::SaasDeployments::Client" + }, + "method": { + "short_name": "GetUnitOperation", + "full_name": "google.cloud.saasplatform.saasservicemgmt.v1beta1.SaasDeployments.GetUnitOperation", + "service": { + "short_name": "SaasDeployments", + "full_name": "google.cloud.saasplatform.saasservicemgmt.v1beta1.SaasDeployments" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 46, + "type": "FULL" + } + ] + }, + { + "region_tag": "saasservicemgmt_v1beta1_generated_SaasDeployments_CreateUnitOperation_sync", + "title": "Snippet for the create_unit_operation call in the SaasDeployments service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::SaasDeployments::Client#create_unit_operation.", + "file": "saas_deployments/create_unit_operation.rb", + "language": "RUBY", + "client_method": { + "short_name": "create_unit_operation", + "full_name": "::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::SaasDeployments::Client#create_unit_operation", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::CreateUnitOperationRequest", + "name": "request" + } + ], + "result_type": "::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::UnitOperation", + "client": { + "short_name": "SaasDeployments::Client", + "full_name": "::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::SaasDeployments::Client" + }, + "method": { + "short_name": "CreateUnitOperation", + "full_name": "google.cloud.saasplatform.saasservicemgmt.v1beta1.SaasDeployments.CreateUnitOperation", + "service": { + "short_name": "SaasDeployments", + "full_name": "google.cloud.saasplatform.saasservicemgmt.v1beta1.SaasDeployments" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 46, + "type": "FULL" + } + ] + }, + { + "region_tag": "saasservicemgmt_v1beta1_generated_SaasDeployments_UpdateUnitOperation_sync", + "title": "Snippet for the update_unit_operation call in the SaasDeployments service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::SaasDeployments::Client#update_unit_operation.", + "file": "saas_deployments/update_unit_operation.rb", + "language": "RUBY", + "client_method": { + "short_name": "update_unit_operation", + "full_name": "::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::SaasDeployments::Client#update_unit_operation", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::UpdateUnitOperationRequest", + "name": "request" + } + ], + "result_type": "::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::UnitOperation", + "client": { + "short_name": "SaasDeployments::Client", + "full_name": "::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::SaasDeployments::Client" + }, + "method": { + "short_name": "UpdateUnitOperation", + "full_name": "google.cloud.saasplatform.saasservicemgmt.v1beta1.SaasDeployments.UpdateUnitOperation", + "service": { + "short_name": "SaasDeployments", + "full_name": "google.cloud.saasplatform.saasservicemgmt.v1beta1.SaasDeployments" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 46, + "type": "FULL" + } + ] + }, + { + "region_tag": "saasservicemgmt_v1beta1_generated_SaasDeployments_DeleteUnitOperation_sync", + "title": "Snippet for the delete_unit_operation call in the SaasDeployments service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::SaasDeployments::Client#delete_unit_operation.", + "file": "saas_deployments/delete_unit_operation.rb", + "language": "RUBY", + "client_method": { + "short_name": "delete_unit_operation", + "full_name": "::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::SaasDeployments::Client#delete_unit_operation", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::DeleteUnitOperationRequest", + "name": "request" + } + ], + "result_type": "::Google::Protobuf::Empty", + "client": { + "short_name": "SaasDeployments::Client", + "full_name": "::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::SaasDeployments::Client" + }, + "method": { + "short_name": "DeleteUnitOperation", + "full_name": "google.cloud.saasplatform.saasservicemgmt.v1beta1.SaasDeployments.DeleteUnitOperation", + "service": { + "short_name": "SaasDeployments", + "full_name": "google.cloud.saasplatform.saasservicemgmt.v1beta1.SaasDeployments" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 46, + "type": "FULL" + } + ] + }, + { + "region_tag": "saasservicemgmt_v1beta1_generated_SaasDeployments_ListReleases_sync", + "title": "Snippet for the list_releases call in the SaasDeployments service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::SaasDeployments::Client#list_releases.", + "file": "saas_deployments/list_releases.rb", + "language": "RUBY", + "client_method": { + "short_name": "list_releases", + "full_name": "::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::SaasDeployments::Client#list_releases", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::ListReleasesRequest", + "name": "request" + } + ], + "result_type": "::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::ListReleasesResponse", + "client": { + "short_name": "SaasDeployments::Client", + "full_name": "::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::SaasDeployments::Client" + }, + "method": { + "short_name": "ListReleases", + "full_name": "google.cloud.saasplatform.saasservicemgmt.v1beta1.SaasDeployments.ListReleases", + "service": { + "short_name": "SaasDeployments", + "full_name": "google.cloud.saasplatform.saasservicemgmt.v1beta1.SaasDeployments" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 50, + "type": "FULL" + } + ] + }, + { + "region_tag": "saasservicemgmt_v1beta1_generated_SaasDeployments_GetRelease_sync", + "title": "Snippet for the get_release call in the SaasDeployments service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::SaasDeployments::Client#get_release.", + "file": "saas_deployments/get_release.rb", + "language": "RUBY", + "client_method": { + "short_name": "get_release", + "full_name": "::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::SaasDeployments::Client#get_release", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::GetReleaseRequest", + "name": "request" + } + ], + "result_type": "::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::Release", + "client": { + "short_name": "SaasDeployments::Client", + "full_name": "::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::SaasDeployments::Client" + }, + "method": { + "short_name": "GetRelease", + "full_name": "google.cloud.saasplatform.saasservicemgmt.v1beta1.SaasDeployments.GetRelease", + "service": { + "short_name": "SaasDeployments", + "full_name": "google.cloud.saasplatform.saasservicemgmt.v1beta1.SaasDeployments" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 46, + "type": "FULL" + } + ] + }, + { + "region_tag": "saasservicemgmt_v1beta1_generated_SaasDeployments_CreateRelease_sync", + "title": "Snippet for the create_release call in the SaasDeployments service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::SaasDeployments::Client#create_release.", + "file": "saas_deployments/create_release.rb", + "language": "RUBY", + "client_method": { + "short_name": "create_release", + "full_name": "::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::SaasDeployments::Client#create_release", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::CreateReleaseRequest", + "name": "request" + } + ], + "result_type": "::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::Release", + "client": { + "short_name": "SaasDeployments::Client", + "full_name": "::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::SaasDeployments::Client" + }, + "method": { + "short_name": "CreateRelease", + "full_name": "google.cloud.saasplatform.saasservicemgmt.v1beta1.SaasDeployments.CreateRelease", + "service": { + "short_name": "SaasDeployments", + "full_name": "google.cloud.saasplatform.saasservicemgmt.v1beta1.SaasDeployments" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 46, + "type": "FULL" + } + ] + }, + { + "region_tag": "saasservicemgmt_v1beta1_generated_SaasDeployments_UpdateRelease_sync", + "title": "Snippet for the update_release call in the SaasDeployments service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::SaasDeployments::Client#update_release.", + "file": "saas_deployments/update_release.rb", + "language": "RUBY", + "client_method": { + "short_name": "update_release", + "full_name": "::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::SaasDeployments::Client#update_release", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::UpdateReleaseRequest", + "name": "request" + } + ], + "result_type": "::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::Release", + "client": { + "short_name": "SaasDeployments::Client", + "full_name": "::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::SaasDeployments::Client" + }, + "method": { + "short_name": "UpdateRelease", + "full_name": "google.cloud.saasplatform.saasservicemgmt.v1beta1.SaasDeployments.UpdateRelease", + "service": { + "short_name": "SaasDeployments", + "full_name": "google.cloud.saasplatform.saasservicemgmt.v1beta1.SaasDeployments" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 46, + "type": "FULL" + } + ] + }, + { + "region_tag": "saasservicemgmt_v1beta1_generated_SaasDeployments_DeleteRelease_sync", + "title": "Snippet for the delete_release call in the SaasDeployments service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::SaasDeployments::Client#delete_release.", + "file": "saas_deployments/delete_release.rb", + "language": "RUBY", + "client_method": { + "short_name": "delete_release", + "full_name": "::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::SaasDeployments::Client#delete_release", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::DeleteReleaseRequest", + "name": "request" + } + ], + "result_type": "::Google::Protobuf::Empty", + "client": { + "short_name": "SaasDeployments::Client", + "full_name": "::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::SaasDeployments::Client" + }, + "method": { + "short_name": "DeleteRelease", + "full_name": "google.cloud.saasplatform.saasservicemgmt.v1beta1.SaasDeployments.DeleteRelease", + "service": { + "short_name": "SaasDeployments", + "full_name": "google.cloud.saasplatform.saasservicemgmt.v1beta1.SaasDeployments" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 46, + "type": "FULL" + } + ] + }, + { + "region_tag": "saasservicemgmt_v1beta1_generated_SaasRollouts_ListRollouts_sync", + "title": "Snippet for the list_rollouts call in the SaasRollouts service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::SaasRollouts::Client#list_rollouts.", + "file": "saas_rollouts/list_rollouts.rb", + "language": "RUBY", + "client_method": { + "short_name": "list_rollouts", + "full_name": "::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::SaasRollouts::Client#list_rollouts", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::ListRolloutsRequest", + "name": "request" + } + ], + "result_type": "::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::ListRolloutsResponse", + "client": { + "short_name": "SaasRollouts::Client", + "full_name": "::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::SaasRollouts::Client" + }, + "method": { + "short_name": "ListRollouts", + "full_name": "google.cloud.saasplatform.saasservicemgmt.v1beta1.SaasRollouts.ListRollouts", + "service": { + "short_name": "SaasRollouts", + "full_name": "google.cloud.saasplatform.saasservicemgmt.v1beta1.SaasRollouts" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 50, + "type": "FULL" + } + ] + }, + { + "region_tag": "saasservicemgmt_v1beta1_generated_SaasRollouts_GetRollout_sync", + "title": "Snippet for the get_rollout call in the SaasRollouts service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::SaasRollouts::Client#get_rollout.", + "file": "saas_rollouts/get_rollout.rb", + "language": "RUBY", + "client_method": { + "short_name": "get_rollout", + "full_name": "::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::SaasRollouts::Client#get_rollout", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::GetRolloutRequest", + "name": "request" + } + ], + "result_type": "::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::Rollout", + "client": { + "short_name": "SaasRollouts::Client", + "full_name": "::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::SaasRollouts::Client" + }, + "method": { + "short_name": "GetRollout", + "full_name": "google.cloud.saasplatform.saasservicemgmt.v1beta1.SaasRollouts.GetRollout", + "service": { + "short_name": "SaasRollouts", + "full_name": "google.cloud.saasplatform.saasservicemgmt.v1beta1.SaasRollouts" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 46, + "type": "FULL" + } + ] + }, + { + "region_tag": "saasservicemgmt_v1beta1_generated_SaasRollouts_CreateRollout_sync", + "title": "Snippet for the create_rollout call in the SaasRollouts service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::SaasRollouts::Client#create_rollout.", + "file": "saas_rollouts/create_rollout.rb", + "language": "RUBY", + "client_method": { + "short_name": "create_rollout", + "full_name": "::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::SaasRollouts::Client#create_rollout", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::CreateRolloutRequest", + "name": "request" + } + ], + "result_type": "::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::Rollout", + "client": { + "short_name": "SaasRollouts::Client", + "full_name": "::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::SaasRollouts::Client" + }, + "method": { + "short_name": "CreateRollout", + "full_name": "google.cloud.saasplatform.saasservicemgmt.v1beta1.SaasRollouts.CreateRollout", + "service": { + "short_name": "SaasRollouts", + "full_name": "google.cloud.saasplatform.saasservicemgmt.v1beta1.SaasRollouts" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 46, + "type": "FULL" + } + ] + }, + { + "region_tag": "saasservicemgmt_v1beta1_generated_SaasRollouts_UpdateRollout_sync", + "title": "Snippet for the update_rollout call in the SaasRollouts service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::SaasRollouts::Client#update_rollout.", + "file": "saas_rollouts/update_rollout.rb", + "language": "RUBY", + "client_method": { + "short_name": "update_rollout", + "full_name": "::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::SaasRollouts::Client#update_rollout", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::UpdateRolloutRequest", + "name": "request" + } + ], + "result_type": "::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::Rollout", + "client": { + "short_name": "SaasRollouts::Client", + "full_name": "::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::SaasRollouts::Client" + }, + "method": { + "short_name": "UpdateRollout", + "full_name": "google.cloud.saasplatform.saasservicemgmt.v1beta1.SaasRollouts.UpdateRollout", + "service": { + "short_name": "SaasRollouts", + "full_name": "google.cloud.saasplatform.saasservicemgmt.v1beta1.SaasRollouts" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 46, + "type": "FULL" + } + ] + }, + { + "region_tag": "saasservicemgmt_v1beta1_generated_SaasRollouts_DeleteRollout_sync", + "title": "Snippet for the delete_rollout call in the SaasRollouts service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::SaasRollouts::Client#delete_rollout.", + "file": "saas_rollouts/delete_rollout.rb", + "language": "RUBY", + "client_method": { + "short_name": "delete_rollout", + "full_name": "::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::SaasRollouts::Client#delete_rollout", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::DeleteRolloutRequest", + "name": "request" + } + ], + "result_type": "::Google::Protobuf::Empty", + "client": { + "short_name": "SaasRollouts::Client", + "full_name": "::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::SaasRollouts::Client" + }, + "method": { + "short_name": "DeleteRollout", + "full_name": "google.cloud.saasplatform.saasservicemgmt.v1beta1.SaasRollouts.DeleteRollout", + "service": { + "short_name": "SaasRollouts", + "full_name": "google.cloud.saasplatform.saasservicemgmt.v1beta1.SaasRollouts" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 46, + "type": "FULL" + } + ] + }, + { + "region_tag": "saasservicemgmt_v1beta1_generated_SaasRollouts_ListRolloutKinds_sync", + "title": "Snippet for the list_rollout_kinds call in the SaasRollouts service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::SaasRollouts::Client#list_rollout_kinds.", + "file": "saas_rollouts/list_rollout_kinds.rb", + "language": "RUBY", + "client_method": { + "short_name": "list_rollout_kinds", + "full_name": "::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::SaasRollouts::Client#list_rollout_kinds", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::ListRolloutKindsRequest", + "name": "request" + } + ], + "result_type": "::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::ListRolloutKindsResponse", + "client": { + "short_name": "SaasRollouts::Client", + "full_name": "::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::SaasRollouts::Client" + }, + "method": { + "short_name": "ListRolloutKinds", + "full_name": "google.cloud.saasplatform.saasservicemgmt.v1beta1.SaasRollouts.ListRolloutKinds", + "service": { + "short_name": "SaasRollouts", + "full_name": "google.cloud.saasplatform.saasservicemgmt.v1beta1.SaasRollouts" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 50, + "type": "FULL" + } + ] + }, + { + "region_tag": "saasservicemgmt_v1beta1_generated_SaasRollouts_GetRolloutKind_sync", + "title": "Snippet for the get_rollout_kind call in the SaasRollouts service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::SaasRollouts::Client#get_rollout_kind.", + "file": "saas_rollouts/get_rollout_kind.rb", + "language": "RUBY", + "client_method": { + "short_name": "get_rollout_kind", + "full_name": "::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::SaasRollouts::Client#get_rollout_kind", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::GetRolloutKindRequest", + "name": "request" + } + ], + "result_type": "::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::RolloutKind", + "client": { + "short_name": "SaasRollouts::Client", + "full_name": "::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::SaasRollouts::Client" + }, + "method": { + "short_name": "GetRolloutKind", + "full_name": "google.cloud.saasplatform.saasservicemgmt.v1beta1.SaasRollouts.GetRolloutKind", + "service": { + "short_name": "SaasRollouts", + "full_name": "google.cloud.saasplatform.saasservicemgmt.v1beta1.SaasRollouts" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 46, + "type": "FULL" + } + ] + }, + { + "region_tag": "saasservicemgmt_v1beta1_generated_SaasRollouts_CreateRolloutKind_sync", + "title": "Snippet for the create_rollout_kind call in the SaasRollouts service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::SaasRollouts::Client#create_rollout_kind.", + "file": "saas_rollouts/create_rollout_kind.rb", + "language": "RUBY", + "client_method": { + "short_name": "create_rollout_kind", + "full_name": "::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::SaasRollouts::Client#create_rollout_kind", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::CreateRolloutKindRequest", + "name": "request" + } + ], + "result_type": "::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::RolloutKind", + "client": { + "short_name": "SaasRollouts::Client", + "full_name": "::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::SaasRollouts::Client" + }, + "method": { + "short_name": "CreateRolloutKind", + "full_name": "google.cloud.saasplatform.saasservicemgmt.v1beta1.SaasRollouts.CreateRolloutKind", + "service": { + "short_name": "SaasRollouts", + "full_name": "google.cloud.saasplatform.saasservicemgmt.v1beta1.SaasRollouts" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 46, + "type": "FULL" + } + ] + }, + { + "region_tag": "saasservicemgmt_v1beta1_generated_SaasRollouts_UpdateRolloutKind_sync", + "title": "Snippet for the update_rollout_kind call in the SaasRollouts service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::SaasRollouts::Client#update_rollout_kind.", + "file": "saas_rollouts/update_rollout_kind.rb", + "language": "RUBY", + "client_method": { + "short_name": "update_rollout_kind", + "full_name": "::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::SaasRollouts::Client#update_rollout_kind", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::UpdateRolloutKindRequest", + "name": "request" + } + ], + "result_type": "::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::RolloutKind", + "client": { + "short_name": "SaasRollouts::Client", + "full_name": "::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::SaasRollouts::Client" + }, + "method": { + "short_name": "UpdateRolloutKind", + "full_name": "google.cloud.saasplatform.saasservicemgmt.v1beta1.SaasRollouts.UpdateRolloutKind", + "service": { + "short_name": "SaasRollouts", + "full_name": "google.cloud.saasplatform.saasservicemgmt.v1beta1.SaasRollouts" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 46, + "type": "FULL" + } + ] + }, + { + "region_tag": "saasservicemgmt_v1beta1_generated_SaasRollouts_DeleteRolloutKind_sync", + "title": "Snippet for the delete_rollout_kind call in the SaasRollouts service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::SaasRollouts::Client#delete_rollout_kind.", + "file": "saas_rollouts/delete_rollout_kind.rb", + "language": "RUBY", + "client_method": { + "short_name": "delete_rollout_kind", + "full_name": "::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::SaasRollouts::Client#delete_rollout_kind", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::DeleteRolloutKindRequest", + "name": "request" + } + ], + "result_type": "::Google::Protobuf::Empty", + "client": { + "short_name": "SaasRollouts::Client", + "full_name": "::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::SaasRollouts::Client" + }, + "method": { + "short_name": "DeleteRolloutKind", + "full_name": "google.cloud.saasplatform.saasservicemgmt.v1beta1.SaasRollouts.DeleteRolloutKind", + "service": { + "short_name": "SaasRollouts", + "full_name": "google.cloud.saasplatform.saasservicemgmt.v1beta1.SaasRollouts" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 46, + "type": "FULL" + } + ] + } + ] +} \ No newline at end of file diff --git a/owl-bot-staging/google-cloud-saas_platform-saas_service_mgmt-v1beta1/test/google/cloud/saas_platform/saas_service_mgmt/v1beta1/saas_deployments_paths_test.rb b/owl-bot-staging/google-cloud-saas_platform-saas_service_mgmt-v1beta1/test/google/cloud/saas_platform/saas_service_mgmt/v1beta1/saas_deployments_paths_test.rb new file mode 100644 index 000000000000..005ecd987b9d --- /dev/null +++ b/owl-bot-staging/google-cloud-saas_platform-saas_service_mgmt-v1beta1/test/google/cloud/saas_platform/saas_service_mgmt/v1beta1/saas_deployments_paths_test.rb @@ -0,0 +1,139 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +require "helper" + +require "gapic/grpc/service_stub" + +require "google/cloud/saas_platform/saas_service_mgmt/v1beta1/saas_deployments" + +class ::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::SaasDeployments::ClientPathsTest < Minitest::Test + class DummyStub + def endpoint + "endpoint.example.com" + end + + def universe_domain + "example.com" + end + + def stub_logger + nil + end + + def logger + nil + end + end + + def test_location_path + grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + ::Gapic::ServiceStub.stub :new, DummyStub.new do + client = ::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::SaasDeployments::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_release_path + grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + ::Gapic::ServiceStub.stub :new, DummyStub.new do + client = ::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::SaasDeployments::Client.new do |config| + config.credentials = grpc_channel + end + + path = client.release_path project: "value0", location: "value1", release: "value2" + assert_equal "projects/value0/locations/value1/releases/value2", path + end + end + + def test_rollout_path + grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + ::Gapic::ServiceStub.stub :new, DummyStub.new do + client = ::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::SaasDeployments::Client.new do |config| + config.credentials = grpc_channel + end + + path = client.rollout_path project: "value0", location: "value1", rollout_id: "value2" + assert_equal "projects/value0/locations/value1/rollouts/value2", path + end + end + + def test_saas_path + grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + ::Gapic::ServiceStub.stub :new, DummyStub.new do + client = ::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::SaasDeployments::Client.new do |config| + config.credentials = grpc_channel + end + + path = client.saas_path project: "value0", location: "value1", saas: "value2" + assert_equal "projects/value0/locations/value1/saas/value2", path + end + end + + def test_tenant_path + grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + ::Gapic::ServiceStub.stub :new, DummyStub.new do + client = ::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::SaasDeployments::Client.new do |config| + config.credentials = grpc_channel + end + + path = client.tenant_path project: "value0", location: "value1", tenant: "value2" + assert_equal "projects/value0/locations/value1/tenants/value2", path + end + end + + def test_unit_path + grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + ::Gapic::ServiceStub.stub :new, DummyStub.new do + client = ::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::SaasDeployments::Client.new do |config| + config.credentials = grpc_channel + end + + path = client.unit_path project: "value0", location: "value1", unit: "value2" + assert_equal "projects/value0/locations/value1/units/value2", path + end + end + + def test_unit_kind_path + grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + ::Gapic::ServiceStub.stub :new, DummyStub.new do + client = ::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::SaasDeployments::Client.new do |config| + config.credentials = grpc_channel + end + + path = client.unit_kind_path project: "value0", location: "value1", unit_kind: "value2" + assert_equal "projects/value0/locations/value1/unitKinds/value2", path + end + end + + def test_unit_operation_path + grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + ::Gapic::ServiceStub.stub :new, DummyStub.new do + client = ::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::SaasDeployments::Client.new do |config| + config.credentials = grpc_channel + end + + path = client.unit_operation_path project: "value0", location: "value1", unit_operation: "value2" + assert_equal "projects/value0/locations/value1/unitOperations/value2", path + end + end +end diff --git a/owl-bot-staging/google-cloud-saas_platform-saas_service_mgmt-v1beta1/test/google/cloud/saas_platform/saas_service_mgmt/v1beta1/saas_deployments_rest_test.rb b/owl-bot-staging/google-cloud-saas_platform-saas_service_mgmt-v1beta1/test/google/cloud/saas_platform/saas_service_mgmt/v1beta1/saas_deployments_rest_test.rb new file mode 100644 index 000000000000..f3cf27a8a1e7 --- /dev/null +++ b/owl-bot-staging/google-cloud-saas_platform-saas_service_mgmt-v1beta1/test/google/cloud/saas_platform/saas_service_mgmt/v1beta1/saas_deployments_rest_test.rb @@ -0,0 +1,1803 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +require "helper" +require "gapic/rest" +require "google/cloud/saasplatform/saasservicemgmt/v1beta1/deployments_service_pb" +require "google/cloud/saas_platform/saas_service_mgmt/v1beta1/saas_deployments/rest" + + +class ::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::SaasDeployments::Rest::ClientTest < Minitest::Test + class ClientStub + attr_accessor :call_count, :requests + + def initialize response, &block + @response = response + @block = block + @call_count = 0 + @requests = [] + end + + def make_get_request uri:, params: {}, options: {}, method_name: nil + make_http_request :get, uri: uri, body: nil, params: params, options: options, method_name: method_name + end + + def make_delete_request uri:, params: {}, options: {}, method_name: nil + make_http_request :delete, uri: uri, body: nil, params: params, options: options, method_name: method_name + end + + def make_post_request uri:, body: nil, params: {}, options: {}, method_name: nil + make_http_request :post, uri: uri, body: body, params: params, options: options, method_name: method_name + end + + def make_patch_request uri:, body:, params: {}, options: {}, method_name: nil + make_http_request :patch, uri: uri, body: body, params: params, options: options, method_name: method_name + end + + def make_put_request uri:, body:, params: {}, options: {}, method_name: nil + make_http_request :put, uri: uri, body: body, params: params, options: options, method_name: method_name + end + + def make_http_request *args, **kwargs + @call_count += 1 + + @requests << @block&.call(*args, **kwargs) + + @response + end + + def endpoint + "endpoint.example.com" + end + + def universe_domain + "example.com" + end + + def stub_logger + nil + end + + def logger + nil + end + end + + def test_list_saas + # Create test objects. + client_result = ::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::ListSaasResponse.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" + order_by = "hello world" + + list_saas_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| + assert options.metadata.key? :"x-goog-api-client" + assert options.metadata[:"x-goog-api-client"].include? "rest" + refute options.metadata[:"x-goog-api-client"].include? "grpc" + end + + ::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::SaasDeployments::Rest::ServiceStub.stub :transcode_list_saas_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, list_saas_client_stub do + # Create client + client = ::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::SaasDeployments::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.list_saas({ parent: parent, page_size: page_size, page_token: page_token, filter: filter, order_by: order_by }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.list_saas parent: parent, page_size: page_size, page_token: page_token, filter: filter, order_by: order_by do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.list_saas ::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::ListSaasRequest.new(parent: parent, page_size: page_size, page_token: page_token, filter: filter, order_by: order_by) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + client.list_saas({ parent: parent, page_size: page_size, page_token: page_token, filter: filter, order_by: order_by }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + client.list_saas(::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::ListSaasRequest.new(parent: parent, page_size: page_size, page_token: page_token, filter: filter, order_by: order_by), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, list_saas_client_stub.call_count + end + end + end + + def test_get_saas + # Create test objects. + client_result = ::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::Saas.new + http_response = OpenStruct.new body: client_result.to_json + + call_options = {} + + # Create request parameters for a unary method. + name = "hello world" + + get_saas_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| + assert options.metadata.key? :"x-goog-api-client" + assert options.metadata[:"x-goog-api-client"].include? "rest" + refute options.metadata[:"x-goog-api-client"].include? "grpc" + end + + ::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::SaasDeployments::Rest::ServiceStub.stub :transcode_get_saas_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, get_saas_client_stub do + # Create client + client = ::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::SaasDeployments::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.get_saas({ name: name }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.get_saas name: name do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.get_saas ::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::GetSaasRequest.new(name: name) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + client.get_saas({ name: name }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + client.get_saas(::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::GetSaasRequest.new(name: name), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, get_saas_client_stub.call_count + end + end + end + + def test_create_saas + # Create test objects. + client_result = ::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::Saas.new + http_response = OpenStruct.new body: client_result.to_json + + call_options = {} + + # Create request parameters for a unary method. + parent = "hello world" + saas_id = "hello world" + saas = {} + validate_only = true + request_id = "hello world" + + create_saas_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| + assert options.metadata.key? :"x-goog-api-client" + assert options.metadata[:"x-goog-api-client"].include? "rest" + refute options.metadata[:"x-goog-api-client"].include? "grpc" + end + + ::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::SaasDeployments::Rest::ServiceStub.stub :transcode_create_saas_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, create_saas_client_stub do + # Create client + client = ::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::SaasDeployments::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.create_saas({ parent: parent, saas_id: saas_id, saas: saas, validate_only: validate_only, request_id: request_id }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.create_saas parent: parent, saas_id: saas_id, saas: saas, validate_only: validate_only, request_id: request_id do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.create_saas ::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::CreateSaasRequest.new(parent: parent, saas_id: saas_id, saas: saas, validate_only: validate_only, request_id: request_id) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + client.create_saas({ parent: parent, saas_id: saas_id, saas: saas, validate_only: validate_only, request_id: request_id }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + client.create_saas(::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::CreateSaasRequest.new(parent: parent, saas_id: saas_id, saas: saas, validate_only: validate_only, request_id: request_id), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, create_saas_client_stub.call_count + end + end + end + + def test_update_saas + # Create test objects. + client_result = ::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::Saas.new + http_response = OpenStruct.new body: client_result.to_json + + call_options = {} + + # Create request parameters for a unary method. + saas = {} + validate_only = true + request_id = "hello world" + update_mask = {} + + update_saas_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| + assert options.metadata.key? :"x-goog-api-client" + assert options.metadata[:"x-goog-api-client"].include? "rest" + refute options.metadata[:"x-goog-api-client"].include? "grpc" + end + + ::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::SaasDeployments::Rest::ServiceStub.stub :transcode_update_saas_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, update_saas_client_stub do + # Create client + client = ::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::SaasDeployments::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.update_saas({ saas: saas, validate_only: validate_only, request_id: request_id, update_mask: update_mask }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.update_saas saas: saas, validate_only: validate_only, request_id: request_id, update_mask: update_mask do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.update_saas ::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::UpdateSaasRequest.new(saas: saas, validate_only: validate_only, request_id: request_id, update_mask: update_mask) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + client.update_saas({ saas: saas, validate_only: validate_only, request_id: request_id, update_mask: update_mask }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + client.update_saas(::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::UpdateSaasRequest.new(saas: saas, validate_only: validate_only, request_id: request_id, update_mask: update_mask), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, update_saas_client_stub.call_count + end + end + end + + def test_delete_saas + # Create test objects. + client_result = ::Google::Protobuf::Empty.new + http_response = OpenStruct.new body: client_result.to_json + + call_options = {} + + # Create request parameters for a unary method. + name = "hello world" + etag = "hello world" + validate_only = true + request_id = "hello world" + + delete_saas_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| + assert options.metadata.key? :"x-goog-api-client" + assert options.metadata[:"x-goog-api-client"].include? "rest" + refute options.metadata[:"x-goog-api-client"].include? "grpc" + end + + ::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::SaasDeployments::Rest::ServiceStub.stub :transcode_delete_saas_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, delete_saas_client_stub do + # Create client + client = ::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::SaasDeployments::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.delete_saas({ name: name, etag: etag, validate_only: validate_only, request_id: request_id }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.delete_saas name: name, etag: etag, validate_only: validate_only, request_id: request_id do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.delete_saas ::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::DeleteSaasRequest.new(name: name, etag: etag, validate_only: validate_only, request_id: request_id) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + client.delete_saas({ name: name, etag: etag, validate_only: validate_only, request_id: request_id }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + client.delete_saas(::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::DeleteSaasRequest.new(name: name, etag: etag, validate_only: validate_only, request_id: request_id), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, delete_saas_client_stub.call_count + end + end + end + + def test_list_tenants + # Create test objects. + client_result = ::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::ListTenantsResponse.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" + order_by = "hello world" + + list_tenants_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| + assert options.metadata.key? :"x-goog-api-client" + assert options.metadata[:"x-goog-api-client"].include? "rest" + refute options.metadata[:"x-goog-api-client"].include? "grpc" + end + + ::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::SaasDeployments::Rest::ServiceStub.stub :transcode_list_tenants_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, list_tenants_client_stub do + # Create client + client = ::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::SaasDeployments::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.list_tenants({ parent: parent, page_size: page_size, page_token: page_token, filter: filter, order_by: order_by }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.list_tenants parent: parent, page_size: page_size, page_token: page_token, filter: filter, order_by: order_by do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.list_tenants ::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::ListTenantsRequest.new(parent: parent, page_size: page_size, page_token: page_token, filter: filter, order_by: order_by) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + client.list_tenants({ parent: parent, page_size: page_size, page_token: page_token, filter: filter, order_by: order_by }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + client.list_tenants(::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::ListTenantsRequest.new(parent: parent, page_size: page_size, page_token: page_token, filter: filter, order_by: order_by), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, list_tenants_client_stub.call_count + end + end + end + + def test_get_tenant + # Create test objects. + client_result = ::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::Tenant.new + http_response = OpenStruct.new body: client_result.to_json + + call_options = {} + + # Create request parameters for a unary method. + name = "hello world" + + get_tenant_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| + assert options.metadata.key? :"x-goog-api-client" + assert options.metadata[:"x-goog-api-client"].include? "rest" + refute options.metadata[:"x-goog-api-client"].include? "grpc" + end + + ::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::SaasDeployments::Rest::ServiceStub.stub :transcode_get_tenant_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, get_tenant_client_stub do + # Create client + client = ::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::SaasDeployments::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.get_tenant({ name: name }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.get_tenant name: name do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.get_tenant ::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::GetTenantRequest.new(name: name) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + client.get_tenant({ name: name }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + client.get_tenant(::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::GetTenantRequest.new(name: name), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, get_tenant_client_stub.call_count + end + end + end + + def test_create_tenant + # Create test objects. + client_result = ::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::Tenant.new + http_response = OpenStruct.new body: client_result.to_json + + call_options = {} + + # Create request parameters for a unary method. + parent = "hello world" + tenant_id = "hello world" + tenant = {} + validate_only = true + request_id = "hello world" + + create_tenant_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| + assert options.metadata.key? :"x-goog-api-client" + assert options.metadata[:"x-goog-api-client"].include? "rest" + refute options.metadata[:"x-goog-api-client"].include? "grpc" + end + + ::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::SaasDeployments::Rest::ServiceStub.stub :transcode_create_tenant_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, create_tenant_client_stub do + # Create client + client = ::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::SaasDeployments::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.create_tenant({ parent: parent, tenant_id: tenant_id, tenant: tenant, validate_only: validate_only, request_id: request_id }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.create_tenant parent: parent, tenant_id: tenant_id, tenant: tenant, validate_only: validate_only, request_id: request_id do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.create_tenant ::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::CreateTenantRequest.new(parent: parent, tenant_id: tenant_id, tenant: tenant, validate_only: validate_only, request_id: request_id) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + client.create_tenant({ parent: parent, tenant_id: tenant_id, tenant: tenant, validate_only: validate_only, request_id: request_id }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + client.create_tenant(::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::CreateTenantRequest.new(parent: parent, tenant_id: tenant_id, tenant: tenant, validate_only: validate_only, request_id: request_id), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, create_tenant_client_stub.call_count + end + end + end + + def test_update_tenant + # Create test objects. + client_result = ::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::Tenant.new + http_response = OpenStruct.new body: client_result.to_json + + call_options = {} + + # Create request parameters for a unary method. + tenant = {} + validate_only = true + request_id = "hello world" + update_mask = {} + + update_tenant_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| + assert options.metadata.key? :"x-goog-api-client" + assert options.metadata[:"x-goog-api-client"].include? "rest" + refute options.metadata[:"x-goog-api-client"].include? "grpc" + end + + ::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::SaasDeployments::Rest::ServiceStub.stub :transcode_update_tenant_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, update_tenant_client_stub do + # Create client + client = ::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::SaasDeployments::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.update_tenant({ tenant: tenant, validate_only: validate_only, request_id: request_id, update_mask: update_mask }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.update_tenant tenant: tenant, validate_only: validate_only, request_id: request_id, update_mask: update_mask do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.update_tenant ::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::UpdateTenantRequest.new(tenant: tenant, validate_only: validate_only, request_id: request_id, update_mask: update_mask) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + client.update_tenant({ tenant: tenant, validate_only: validate_only, request_id: request_id, update_mask: update_mask }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + client.update_tenant(::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::UpdateTenantRequest.new(tenant: tenant, validate_only: validate_only, request_id: request_id, update_mask: update_mask), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, update_tenant_client_stub.call_count + end + end + end + + def test_delete_tenant + # Create test objects. + client_result = ::Google::Protobuf::Empty.new + http_response = OpenStruct.new body: client_result.to_json + + call_options = {} + + # Create request parameters for a unary method. + name = "hello world" + etag = "hello world" + validate_only = true + request_id = "hello world" + + delete_tenant_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| + assert options.metadata.key? :"x-goog-api-client" + assert options.metadata[:"x-goog-api-client"].include? "rest" + refute options.metadata[:"x-goog-api-client"].include? "grpc" + end + + ::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::SaasDeployments::Rest::ServiceStub.stub :transcode_delete_tenant_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, delete_tenant_client_stub do + # Create client + client = ::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::SaasDeployments::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.delete_tenant({ name: name, etag: etag, validate_only: validate_only, request_id: request_id }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.delete_tenant name: name, etag: etag, validate_only: validate_only, request_id: request_id do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.delete_tenant ::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::DeleteTenantRequest.new(name: name, etag: etag, validate_only: validate_only, request_id: request_id) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + client.delete_tenant({ name: name, etag: etag, validate_only: validate_only, request_id: request_id }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + client.delete_tenant(::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::DeleteTenantRequest.new(name: name, etag: etag, validate_only: validate_only, request_id: request_id), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, delete_tenant_client_stub.call_count + end + end + end + + def test_list_unit_kinds + # Create test objects. + client_result = ::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::ListUnitKindsResponse.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" + order_by = "hello world" + + list_unit_kinds_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| + assert options.metadata.key? :"x-goog-api-client" + assert options.metadata[:"x-goog-api-client"].include? "rest" + refute options.metadata[:"x-goog-api-client"].include? "grpc" + end + + ::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::SaasDeployments::Rest::ServiceStub.stub :transcode_list_unit_kinds_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, list_unit_kinds_client_stub do + # Create client + client = ::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::SaasDeployments::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.list_unit_kinds({ parent: parent, page_size: page_size, page_token: page_token, filter: filter, order_by: order_by }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.list_unit_kinds parent: parent, page_size: page_size, page_token: page_token, filter: filter, order_by: order_by do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.list_unit_kinds ::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::ListUnitKindsRequest.new(parent: parent, page_size: page_size, page_token: page_token, filter: filter, order_by: order_by) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + client.list_unit_kinds({ parent: parent, page_size: page_size, page_token: page_token, filter: filter, order_by: order_by }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + client.list_unit_kinds(::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::ListUnitKindsRequest.new(parent: parent, page_size: page_size, page_token: page_token, filter: filter, order_by: order_by), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, list_unit_kinds_client_stub.call_count + end + end + end + + def test_get_unit_kind + # Create test objects. + client_result = ::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::UnitKind.new + http_response = OpenStruct.new body: client_result.to_json + + call_options = {} + + # Create request parameters for a unary method. + name = "hello world" + + get_unit_kind_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| + assert options.metadata.key? :"x-goog-api-client" + assert options.metadata[:"x-goog-api-client"].include? "rest" + refute options.metadata[:"x-goog-api-client"].include? "grpc" + end + + ::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::SaasDeployments::Rest::ServiceStub.stub :transcode_get_unit_kind_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, get_unit_kind_client_stub do + # Create client + client = ::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::SaasDeployments::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.get_unit_kind({ name: name }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.get_unit_kind name: name do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.get_unit_kind ::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::GetUnitKindRequest.new(name: name) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + client.get_unit_kind({ name: name }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + client.get_unit_kind(::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::GetUnitKindRequest.new(name: name), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, get_unit_kind_client_stub.call_count + end + end + end + + def test_create_unit_kind + # Create test objects. + client_result = ::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::UnitKind.new + http_response = OpenStruct.new body: client_result.to_json + + call_options = {} + + # Create request parameters for a unary method. + parent = "hello world" + unit_kind_id = "hello world" + unit_kind = {} + validate_only = true + request_id = "hello world" + + create_unit_kind_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| + assert options.metadata.key? :"x-goog-api-client" + assert options.metadata[:"x-goog-api-client"].include? "rest" + refute options.metadata[:"x-goog-api-client"].include? "grpc" + end + + ::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::SaasDeployments::Rest::ServiceStub.stub :transcode_create_unit_kind_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, create_unit_kind_client_stub do + # Create client + client = ::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::SaasDeployments::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.create_unit_kind({ parent: parent, unit_kind_id: unit_kind_id, unit_kind: unit_kind, validate_only: validate_only, request_id: request_id }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.create_unit_kind parent: parent, unit_kind_id: unit_kind_id, unit_kind: unit_kind, validate_only: validate_only, request_id: request_id do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.create_unit_kind ::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::CreateUnitKindRequest.new(parent: parent, unit_kind_id: unit_kind_id, unit_kind: unit_kind, validate_only: validate_only, request_id: request_id) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + client.create_unit_kind({ parent: parent, unit_kind_id: unit_kind_id, unit_kind: unit_kind, validate_only: validate_only, request_id: request_id }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + client.create_unit_kind(::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::CreateUnitKindRequest.new(parent: parent, unit_kind_id: unit_kind_id, unit_kind: unit_kind, validate_only: validate_only, request_id: request_id), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, create_unit_kind_client_stub.call_count + end + end + end + + def test_update_unit_kind + # Create test objects. + client_result = ::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::UnitKind.new + http_response = OpenStruct.new body: client_result.to_json + + call_options = {} + + # Create request parameters for a unary method. + unit_kind = {} + validate_only = true + request_id = "hello world" + update_mask = {} + + update_unit_kind_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| + assert options.metadata.key? :"x-goog-api-client" + assert options.metadata[:"x-goog-api-client"].include? "rest" + refute options.metadata[:"x-goog-api-client"].include? "grpc" + end + + ::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::SaasDeployments::Rest::ServiceStub.stub :transcode_update_unit_kind_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, update_unit_kind_client_stub do + # Create client + client = ::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::SaasDeployments::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.update_unit_kind({ unit_kind: unit_kind, validate_only: validate_only, request_id: request_id, update_mask: update_mask }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.update_unit_kind unit_kind: unit_kind, validate_only: validate_only, request_id: request_id, update_mask: update_mask do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.update_unit_kind ::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::UpdateUnitKindRequest.new(unit_kind: unit_kind, validate_only: validate_only, request_id: request_id, update_mask: update_mask) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + client.update_unit_kind({ unit_kind: unit_kind, validate_only: validate_only, request_id: request_id, update_mask: update_mask }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + client.update_unit_kind(::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::UpdateUnitKindRequest.new(unit_kind: unit_kind, validate_only: validate_only, request_id: request_id, update_mask: update_mask), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, update_unit_kind_client_stub.call_count + end + end + end + + def test_delete_unit_kind + # Create test objects. + client_result = ::Google::Protobuf::Empty.new + http_response = OpenStruct.new body: client_result.to_json + + call_options = {} + + # Create request parameters for a unary method. + name = "hello world" + etag = "hello world" + validate_only = true + request_id = "hello world" + + delete_unit_kind_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| + assert options.metadata.key? :"x-goog-api-client" + assert options.metadata[:"x-goog-api-client"].include? "rest" + refute options.metadata[:"x-goog-api-client"].include? "grpc" + end + + ::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::SaasDeployments::Rest::ServiceStub.stub :transcode_delete_unit_kind_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, delete_unit_kind_client_stub do + # Create client + client = ::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::SaasDeployments::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.delete_unit_kind({ name: name, etag: etag, validate_only: validate_only, request_id: request_id }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.delete_unit_kind name: name, etag: etag, validate_only: validate_only, request_id: request_id do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.delete_unit_kind ::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::DeleteUnitKindRequest.new(name: name, etag: etag, validate_only: validate_only, request_id: request_id) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + client.delete_unit_kind({ name: name, etag: etag, validate_only: validate_only, request_id: request_id }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + client.delete_unit_kind(::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::DeleteUnitKindRequest.new(name: name, etag: etag, validate_only: validate_only, request_id: request_id), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, delete_unit_kind_client_stub.call_count + end + end + end + + def test_list_units + # Create test objects. + client_result = ::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::ListUnitsResponse.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" + order_by = "hello world" + + list_units_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| + assert options.metadata.key? :"x-goog-api-client" + assert options.metadata[:"x-goog-api-client"].include? "rest" + refute options.metadata[:"x-goog-api-client"].include? "grpc" + end + + ::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::SaasDeployments::Rest::ServiceStub.stub :transcode_list_units_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, list_units_client_stub do + # Create client + client = ::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::SaasDeployments::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.list_units({ parent: parent, page_size: page_size, page_token: page_token, filter: filter, order_by: order_by }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.list_units parent: parent, page_size: page_size, page_token: page_token, filter: filter, order_by: order_by do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.list_units ::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::ListUnitsRequest.new(parent: parent, page_size: page_size, page_token: page_token, filter: filter, order_by: order_by) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + client.list_units({ parent: parent, page_size: page_size, page_token: page_token, filter: filter, order_by: order_by }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + client.list_units(::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::ListUnitsRequest.new(parent: parent, page_size: page_size, page_token: page_token, filter: filter, order_by: order_by), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, list_units_client_stub.call_count + end + end + end + + def test_get_unit + # Create test objects. + client_result = ::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::Unit.new + http_response = OpenStruct.new body: client_result.to_json + + call_options = {} + + # Create request parameters for a unary method. + name = "hello world" + + get_unit_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| + assert options.metadata.key? :"x-goog-api-client" + assert options.metadata[:"x-goog-api-client"].include? "rest" + refute options.metadata[:"x-goog-api-client"].include? "grpc" + end + + ::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::SaasDeployments::Rest::ServiceStub.stub :transcode_get_unit_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, get_unit_client_stub do + # Create client + client = ::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::SaasDeployments::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.get_unit({ name: name }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.get_unit name: name do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.get_unit ::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::GetUnitRequest.new(name: name) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + client.get_unit({ name: name }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + client.get_unit(::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::GetUnitRequest.new(name: name), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, get_unit_client_stub.call_count + end + end + end + + def test_create_unit + # Create test objects. + client_result = ::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::Unit.new + http_response = OpenStruct.new body: client_result.to_json + + call_options = {} + + # Create request parameters for a unary method. + parent = "hello world" + unit_id = "hello world" + unit = {} + validate_only = true + request_id = "hello world" + + create_unit_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| + assert options.metadata.key? :"x-goog-api-client" + assert options.metadata[:"x-goog-api-client"].include? "rest" + refute options.metadata[:"x-goog-api-client"].include? "grpc" + end + + ::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::SaasDeployments::Rest::ServiceStub.stub :transcode_create_unit_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, create_unit_client_stub do + # Create client + client = ::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::SaasDeployments::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.create_unit({ parent: parent, unit_id: unit_id, unit: unit, validate_only: validate_only, request_id: request_id }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.create_unit parent: parent, unit_id: unit_id, unit: unit, validate_only: validate_only, request_id: request_id do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.create_unit ::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::CreateUnitRequest.new(parent: parent, unit_id: unit_id, unit: unit, validate_only: validate_only, request_id: request_id) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + client.create_unit({ parent: parent, unit_id: unit_id, unit: unit, validate_only: validate_only, request_id: request_id }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + client.create_unit(::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::CreateUnitRequest.new(parent: parent, unit_id: unit_id, unit: unit, validate_only: validate_only, request_id: request_id), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, create_unit_client_stub.call_count + end + end + end + + def test_update_unit + # Create test objects. + client_result = ::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::Unit.new + http_response = OpenStruct.new body: client_result.to_json + + call_options = {} + + # Create request parameters for a unary method. + unit = {} + validate_only = true + request_id = "hello world" + update_mask = {} + + update_unit_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| + assert options.metadata.key? :"x-goog-api-client" + assert options.metadata[:"x-goog-api-client"].include? "rest" + refute options.metadata[:"x-goog-api-client"].include? "grpc" + end + + ::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::SaasDeployments::Rest::ServiceStub.stub :transcode_update_unit_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, update_unit_client_stub do + # Create client + client = ::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::SaasDeployments::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.update_unit({ unit: unit, validate_only: validate_only, request_id: request_id, update_mask: update_mask }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.update_unit unit: unit, validate_only: validate_only, request_id: request_id, update_mask: update_mask do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.update_unit ::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::UpdateUnitRequest.new(unit: unit, validate_only: validate_only, request_id: request_id, update_mask: update_mask) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + client.update_unit({ unit: unit, validate_only: validate_only, request_id: request_id, update_mask: update_mask }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + client.update_unit(::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::UpdateUnitRequest.new(unit: unit, validate_only: validate_only, request_id: request_id, update_mask: update_mask), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, update_unit_client_stub.call_count + end + end + end + + def test_delete_unit + # Create test objects. + client_result = ::Google::Protobuf::Empty.new + http_response = OpenStruct.new body: client_result.to_json + + call_options = {} + + # Create request parameters for a unary method. + name = "hello world" + etag = "hello world" + validate_only = true + request_id = "hello world" + + delete_unit_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| + assert options.metadata.key? :"x-goog-api-client" + assert options.metadata[:"x-goog-api-client"].include? "rest" + refute options.metadata[:"x-goog-api-client"].include? "grpc" + end + + ::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::SaasDeployments::Rest::ServiceStub.stub :transcode_delete_unit_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, delete_unit_client_stub do + # Create client + client = ::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::SaasDeployments::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.delete_unit({ name: name, etag: etag, validate_only: validate_only, request_id: request_id }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.delete_unit name: name, etag: etag, validate_only: validate_only, request_id: request_id do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.delete_unit ::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::DeleteUnitRequest.new(name: name, etag: etag, validate_only: validate_only, request_id: request_id) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + client.delete_unit({ name: name, etag: etag, validate_only: validate_only, request_id: request_id }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + client.delete_unit(::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::DeleteUnitRequest.new(name: name, etag: etag, validate_only: validate_only, request_id: request_id), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, delete_unit_client_stub.call_count + end + end + end + + def test_list_unit_operations + # Create test objects. + client_result = ::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::ListUnitOperationsResponse.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" + order_by = "hello world" + + list_unit_operations_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| + assert options.metadata.key? :"x-goog-api-client" + assert options.metadata[:"x-goog-api-client"].include? "rest" + refute options.metadata[:"x-goog-api-client"].include? "grpc" + end + + ::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::SaasDeployments::Rest::ServiceStub.stub :transcode_list_unit_operations_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, list_unit_operations_client_stub do + # Create client + client = ::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::SaasDeployments::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.list_unit_operations({ parent: parent, page_size: page_size, page_token: page_token, filter: filter, order_by: order_by }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.list_unit_operations parent: parent, page_size: page_size, page_token: page_token, filter: filter, order_by: order_by do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.list_unit_operations ::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::ListUnitOperationsRequest.new(parent: parent, page_size: page_size, page_token: page_token, filter: filter, order_by: order_by) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + client.list_unit_operations({ parent: parent, page_size: page_size, page_token: page_token, filter: filter, order_by: order_by }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + client.list_unit_operations(::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::ListUnitOperationsRequest.new(parent: parent, page_size: page_size, page_token: page_token, filter: filter, order_by: order_by), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, list_unit_operations_client_stub.call_count + end + end + end + + def test_get_unit_operation + # Create test objects. + client_result = ::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::UnitOperation.new + http_response = OpenStruct.new body: client_result.to_json + + call_options = {} + + # Create request parameters for a unary method. + name = "hello world" + + get_unit_operation_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| + assert options.metadata.key? :"x-goog-api-client" + assert options.metadata[:"x-goog-api-client"].include? "rest" + refute options.metadata[:"x-goog-api-client"].include? "grpc" + end + + ::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::SaasDeployments::Rest::ServiceStub.stub :transcode_get_unit_operation_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, get_unit_operation_client_stub do + # Create client + client = ::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::SaasDeployments::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.get_unit_operation({ name: name }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.get_unit_operation name: name do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.get_unit_operation ::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::GetUnitOperationRequest.new(name: name) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + client.get_unit_operation({ name: name }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + client.get_unit_operation(::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::GetUnitOperationRequest.new(name: name), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, get_unit_operation_client_stub.call_count + end + end + end + + def test_create_unit_operation + # Create test objects. + client_result = ::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::UnitOperation.new + http_response = OpenStruct.new body: client_result.to_json + + call_options = {} + + # Create request parameters for a unary method. + parent = "hello world" + unit_operation_id = "hello world" + unit_operation = {} + validate_only = true + request_id = "hello world" + + create_unit_operation_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| + assert options.metadata.key? :"x-goog-api-client" + assert options.metadata[:"x-goog-api-client"].include? "rest" + refute options.metadata[:"x-goog-api-client"].include? "grpc" + end + + ::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::SaasDeployments::Rest::ServiceStub.stub :transcode_create_unit_operation_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, create_unit_operation_client_stub do + # Create client + client = ::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::SaasDeployments::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.create_unit_operation({ parent: parent, unit_operation_id: unit_operation_id, unit_operation: unit_operation, validate_only: validate_only, request_id: request_id }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.create_unit_operation parent: parent, unit_operation_id: unit_operation_id, unit_operation: unit_operation, validate_only: validate_only, request_id: request_id do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.create_unit_operation ::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::CreateUnitOperationRequest.new(parent: parent, unit_operation_id: unit_operation_id, unit_operation: unit_operation, validate_only: validate_only, request_id: request_id) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + client.create_unit_operation({ parent: parent, unit_operation_id: unit_operation_id, unit_operation: unit_operation, validate_only: validate_only, request_id: request_id }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + client.create_unit_operation(::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::CreateUnitOperationRequest.new(parent: parent, unit_operation_id: unit_operation_id, unit_operation: unit_operation, validate_only: validate_only, request_id: request_id), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, create_unit_operation_client_stub.call_count + end + end + end + + def test_update_unit_operation + # Create test objects. + client_result = ::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::UnitOperation.new + http_response = OpenStruct.new body: client_result.to_json + + call_options = {} + + # Create request parameters for a unary method. + unit_operation = {} + validate_only = true + request_id = "hello world" + update_mask = {} + + update_unit_operation_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| + assert options.metadata.key? :"x-goog-api-client" + assert options.metadata[:"x-goog-api-client"].include? "rest" + refute options.metadata[:"x-goog-api-client"].include? "grpc" + end + + ::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::SaasDeployments::Rest::ServiceStub.stub :transcode_update_unit_operation_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, update_unit_operation_client_stub do + # Create client + client = ::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::SaasDeployments::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.update_unit_operation({ unit_operation: unit_operation, validate_only: validate_only, request_id: request_id, update_mask: update_mask }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.update_unit_operation unit_operation: unit_operation, validate_only: validate_only, request_id: request_id, update_mask: update_mask do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.update_unit_operation ::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::UpdateUnitOperationRequest.new(unit_operation: unit_operation, validate_only: validate_only, request_id: request_id, update_mask: update_mask) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + client.update_unit_operation({ unit_operation: unit_operation, validate_only: validate_only, request_id: request_id, update_mask: update_mask }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + client.update_unit_operation(::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::UpdateUnitOperationRequest.new(unit_operation: unit_operation, validate_only: validate_only, request_id: request_id, update_mask: update_mask), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, update_unit_operation_client_stub.call_count + end + end + end + + def test_delete_unit_operation + # Create test objects. + client_result = ::Google::Protobuf::Empty.new + http_response = OpenStruct.new body: client_result.to_json + + call_options = {} + + # Create request parameters for a unary method. + name = "hello world" + etag = "hello world" + validate_only = true + request_id = "hello world" + + delete_unit_operation_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| + assert options.metadata.key? :"x-goog-api-client" + assert options.metadata[:"x-goog-api-client"].include? "rest" + refute options.metadata[:"x-goog-api-client"].include? "grpc" + end + + ::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::SaasDeployments::Rest::ServiceStub.stub :transcode_delete_unit_operation_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, delete_unit_operation_client_stub do + # Create client + client = ::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::SaasDeployments::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.delete_unit_operation({ name: name, etag: etag, validate_only: validate_only, request_id: request_id }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.delete_unit_operation name: name, etag: etag, validate_only: validate_only, request_id: request_id do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.delete_unit_operation ::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::DeleteUnitOperationRequest.new(name: name, etag: etag, validate_only: validate_only, request_id: request_id) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + client.delete_unit_operation({ name: name, etag: etag, validate_only: validate_only, request_id: request_id }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + client.delete_unit_operation(::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::DeleteUnitOperationRequest.new(name: name, etag: etag, validate_only: validate_only, request_id: request_id), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, delete_unit_operation_client_stub.call_count + end + end + end + + def test_list_releases + # Create test objects. + client_result = ::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::ListReleasesResponse.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" + order_by = "hello world" + + list_releases_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| + assert options.metadata.key? :"x-goog-api-client" + assert options.metadata[:"x-goog-api-client"].include? "rest" + refute options.metadata[:"x-goog-api-client"].include? "grpc" + end + + ::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::SaasDeployments::Rest::ServiceStub.stub :transcode_list_releases_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, list_releases_client_stub do + # Create client + client = ::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::SaasDeployments::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.list_releases({ parent: parent, page_size: page_size, page_token: page_token, filter: filter, order_by: order_by }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.list_releases parent: parent, page_size: page_size, page_token: page_token, filter: filter, order_by: order_by do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.list_releases ::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::ListReleasesRequest.new(parent: parent, page_size: page_size, page_token: page_token, filter: filter, order_by: order_by) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + client.list_releases({ parent: parent, page_size: page_size, page_token: page_token, filter: filter, order_by: order_by }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + client.list_releases(::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::ListReleasesRequest.new(parent: parent, page_size: page_size, page_token: page_token, filter: filter, order_by: order_by), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, list_releases_client_stub.call_count + end + end + end + + def test_get_release + # Create test objects. + client_result = ::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::Release.new + http_response = OpenStruct.new body: client_result.to_json + + call_options = {} + + # Create request parameters for a unary method. + name = "hello world" + + get_release_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| + assert options.metadata.key? :"x-goog-api-client" + assert options.metadata[:"x-goog-api-client"].include? "rest" + refute options.metadata[:"x-goog-api-client"].include? "grpc" + end + + ::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::SaasDeployments::Rest::ServiceStub.stub :transcode_get_release_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, get_release_client_stub do + # Create client + client = ::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::SaasDeployments::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.get_release({ name: name }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.get_release name: name do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.get_release ::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::GetReleaseRequest.new(name: name) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + client.get_release({ name: name }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + client.get_release(::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::GetReleaseRequest.new(name: name), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, get_release_client_stub.call_count + end + end + end + + def test_create_release + # Create test objects. + client_result = ::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::Release.new + http_response = OpenStruct.new body: client_result.to_json + + call_options = {} + + # Create request parameters for a unary method. + parent = "hello world" + release_id = "hello world" + release = {} + validate_only = true + request_id = "hello world" + + create_release_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| + assert options.metadata.key? :"x-goog-api-client" + assert options.metadata[:"x-goog-api-client"].include? "rest" + refute options.metadata[:"x-goog-api-client"].include? "grpc" + end + + ::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::SaasDeployments::Rest::ServiceStub.stub :transcode_create_release_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, create_release_client_stub do + # Create client + client = ::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::SaasDeployments::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.create_release({ parent: parent, release_id: release_id, release: release, validate_only: validate_only, request_id: request_id }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.create_release parent: parent, release_id: release_id, release: release, validate_only: validate_only, request_id: request_id do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.create_release ::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::CreateReleaseRequest.new(parent: parent, release_id: release_id, release: release, validate_only: validate_only, request_id: request_id) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + client.create_release({ parent: parent, release_id: release_id, release: release, validate_only: validate_only, request_id: request_id }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + client.create_release(::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::CreateReleaseRequest.new(parent: parent, release_id: release_id, release: release, validate_only: validate_only, request_id: request_id), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, create_release_client_stub.call_count + end + end + end + + def test_update_release + # Create test objects. + client_result = ::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::Release.new + http_response = OpenStruct.new body: client_result.to_json + + call_options = {} + + # Create request parameters for a unary method. + release = {} + validate_only = true + request_id = "hello world" + update_mask = {} + + update_release_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| + assert options.metadata.key? :"x-goog-api-client" + assert options.metadata[:"x-goog-api-client"].include? "rest" + refute options.metadata[:"x-goog-api-client"].include? "grpc" + end + + ::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::SaasDeployments::Rest::ServiceStub.stub :transcode_update_release_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, update_release_client_stub do + # Create client + client = ::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::SaasDeployments::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.update_release({ release: release, validate_only: validate_only, request_id: request_id, update_mask: update_mask }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.update_release release: release, validate_only: validate_only, request_id: request_id, update_mask: update_mask do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.update_release ::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::UpdateReleaseRequest.new(release: release, validate_only: validate_only, request_id: request_id, update_mask: update_mask) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + client.update_release({ release: release, validate_only: validate_only, request_id: request_id, update_mask: update_mask }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + client.update_release(::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::UpdateReleaseRequest.new(release: release, validate_only: validate_only, request_id: request_id, update_mask: update_mask), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, update_release_client_stub.call_count + end + end + end + + def test_delete_release + # Create test objects. + client_result = ::Google::Protobuf::Empty.new + http_response = OpenStruct.new body: client_result.to_json + + call_options = {} + + # Create request parameters for a unary method. + name = "hello world" + etag = "hello world" + validate_only = true + request_id = "hello world" + + delete_release_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| + assert options.metadata.key? :"x-goog-api-client" + assert options.metadata[:"x-goog-api-client"].include? "rest" + refute options.metadata[:"x-goog-api-client"].include? "grpc" + end + + ::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::SaasDeployments::Rest::ServiceStub.stub :transcode_delete_release_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, delete_release_client_stub do + # Create client + client = ::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::SaasDeployments::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.delete_release({ name: name, etag: etag, validate_only: validate_only, request_id: request_id }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.delete_release name: name, etag: etag, validate_only: validate_only, request_id: request_id do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.delete_release ::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::DeleteReleaseRequest.new(name: name, etag: etag, validate_only: validate_only, request_id: request_id) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + client.delete_release({ name: name, etag: etag, validate_only: validate_only, request_id: request_id }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + client.delete_release(::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::DeleteReleaseRequest.new(name: name, etag: etag, validate_only: validate_only, request_id: request_id), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, delete_release_client_stub.call_count + end + end + end + + def test_configure + credentials_token = :dummy_value + + client = block_config = config = nil + dummy_stub = ClientStub.new nil + Gapic::Rest::ClientStub.stub :new, dummy_stub do + client = ::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::SaasDeployments::Rest::Client.new do |config| + config.credentials = credentials_token + end + end + + config = client.configure do |c| + block_config = c + end + + assert_same block_config, config + assert_kind_of ::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::SaasDeployments::Rest::Client::Configuration, config + end +end diff --git a/owl-bot-staging/google-cloud-saas_platform-saas_service_mgmt-v1beta1/test/google/cloud/saas_platform/saas_service_mgmt/v1beta1/saas_deployments_test.rb b/owl-bot-staging/google-cloud-saas_platform-saas_service_mgmt-v1beta1/test/google/cloud/saas_platform/saas_service_mgmt/v1beta1/saas_deployments_test.rb new file mode 100644 index 000000000000..17a118efd092 --- /dev/null +++ b/owl-bot-staging/google-cloud-saas_platform-saas_service_mgmt-v1beta1/test/google/cloud/saas_platform/saas_service_mgmt/v1beta1/saas_deployments_test.rb @@ -0,0 +1,2042 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +require "helper" + +require "gapic/grpc/service_stub" + +require "google/cloud/saasplatform/saasservicemgmt/v1beta1/deployments_service_pb" +require "google/cloud/saas_platform/saas_service_mgmt/v1beta1/saas_deployments" + +class ::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::SaasDeployments::ClientTest < Minitest::Test + class ClientStub + attr_accessor :call_rpc_count, :requests + + def initialize response, operation, &block + @response = response + @operation = operation + @block = block + @call_rpc_count = 0 + @requests = [] + end + + def call_rpc *args, **kwargs + @call_rpc_count += 1 + + @requests << @block&.call(*args, **kwargs) + + catch :response do + yield @response, @operation if block_given? + @response + end + end + + def endpoint + "endpoint.example.com" + end + + def universe_domain + "example.com" + end + + def stub_logger + nil + end + + def logger + nil + end + end + + def test_list_saas + # Create GRPC objects. + grpc_response = ::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::ListSaasResponse.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" + order_by = "hello world" + + list_saas_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :list_saas, name + assert_kind_of ::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::ListSaasRequest, 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"] + assert_equal "hello world", request["order_by"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, list_saas_client_stub do + # Create client + client = ::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::SaasDeployments::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.list_saas({ parent: parent, page_size: page_size, page_token: page_token, filter: filter, order_by: order_by }) 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_saas parent: parent, page_size: page_size, page_token: page_token, filter: filter, order_by: order_by 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_saas ::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::ListSaasRequest.new(parent: parent, page_size: page_size, page_token: page_token, filter: filter, order_by: order_by) 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_saas({ parent: parent, page_size: page_size, page_token: page_token, filter: filter, order_by: order_by }, 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_saas(::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::ListSaasRequest.new(parent: parent, page_size: page_size, page_token: page_token, filter: filter, order_by: order_by), 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_saas_client_stub.call_rpc_count + end + end + + def test_get_saas + # Create GRPC objects. + grpc_response = ::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::Saas.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_saas_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :get_saas, name + assert_kind_of ::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::GetSaasRequest, request + assert_equal "hello world", request["name"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, get_saas_client_stub do + # Create client + client = ::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::SaasDeployments::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.get_saas({ name: name }) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use named arguments + client.get_saas name: name do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.get_saas ::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::GetSaasRequest.new(name: name) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use hash object with options + client.get_saas({ 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_saas(::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::GetSaasRequest.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_saas_client_stub.call_rpc_count + end + end + + def test_create_saas + # Create GRPC objects. + grpc_response = ::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::Saas.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" + saas_id = "hello world" + saas = {} + validate_only = true + request_id = "hello world" + + create_saas_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :create_saas, name + assert_kind_of ::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::CreateSaasRequest, request + assert_equal "hello world", request["parent"] + assert_equal "hello world", request["saas_id"] + assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::Saas), request["saas"] + assert_equal true, request["validate_only"] + assert_equal "hello world", request["request_id"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, create_saas_client_stub do + # Create client + client = ::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::SaasDeployments::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.create_saas({ parent: parent, saas_id: saas_id, saas: saas, validate_only: validate_only, request_id: request_id }) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use named arguments + client.create_saas parent: parent, saas_id: saas_id, saas: saas, validate_only: validate_only, request_id: request_id do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.create_saas ::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::CreateSaasRequest.new(parent: parent, saas_id: saas_id, saas: saas, validate_only: validate_only, request_id: request_id) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use hash object with options + client.create_saas({ parent: parent, saas_id: saas_id, saas: saas, validate_only: validate_only, request_id: request_id }, grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object with options + client.create_saas(::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::CreateSaasRequest.new(parent: parent, saas_id: saas_id, saas: saas, validate_only: validate_only, request_id: request_id), grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Verify method calls + assert_equal 5, create_saas_client_stub.call_rpc_count + end + end + + def test_update_saas + # Create GRPC objects. + grpc_response = ::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::Saas.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. + saas = {} + validate_only = true + request_id = "hello world" + update_mask = {} + + update_saas_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :update_saas, name + assert_kind_of ::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::UpdateSaasRequest, request + assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::Saas), request["saas"] + assert_equal true, request["validate_only"] + assert_equal "hello world", request["request_id"] + assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Protobuf::FieldMask), request["update_mask"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, update_saas_client_stub do + # Create client + client = ::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::SaasDeployments::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.update_saas({ saas: saas, validate_only: validate_only, request_id: request_id, update_mask: update_mask }) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use named arguments + client.update_saas saas: saas, validate_only: validate_only, request_id: request_id, update_mask: update_mask do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.update_saas ::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::UpdateSaasRequest.new(saas: saas, validate_only: validate_only, request_id: request_id, update_mask: update_mask) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use hash object with options + client.update_saas({ saas: saas, validate_only: validate_only, request_id: request_id, update_mask: update_mask }, grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object with options + client.update_saas(::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::UpdateSaasRequest.new(saas: saas, validate_only: validate_only, request_id: request_id, update_mask: update_mask), grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Verify method calls + assert_equal 5, update_saas_client_stub.call_rpc_count + end + end + + def test_delete_saas + # Create GRPC objects. + grpc_response = ::Google::Protobuf::Empty.new + grpc_operation = GRPC::ActiveCall::Operation.new nil + grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + grpc_options = {} + + # Create request parameters for a unary method. + name = "hello world" + etag = "hello world" + validate_only = true + request_id = "hello world" + + delete_saas_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :delete_saas, name + assert_kind_of ::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::DeleteSaasRequest, request + assert_equal "hello world", request["name"] + assert_equal "hello world", request["etag"] + assert_equal true, request["validate_only"] + assert_equal "hello world", request["request_id"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, delete_saas_client_stub do + # Create client + client = ::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::SaasDeployments::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.delete_saas({ name: name, etag: etag, validate_only: validate_only, request_id: request_id }) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use named arguments + client.delete_saas name: name, etag: etag, validate_only: validate_only, request_id: request_id do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.delete_saas ::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::DeleteSaasRequest.new(name: name, etag: etag, validate_only: validate_only, request_id: request_id) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use hash object with options + client.delete_saas({ name: name, etag: etag, validate_only: validate_only, request_id: request_id }, grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object with options + client.delete_saas(::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::DeleteSaasRequest.new(name: name, etag: etag, validate_only: validate_only, request_id: request_id), grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Verify method calls + assert_equal 5, delete_saas_client_stub.call_rpc_count + end + end + + def test_list_tenants + # Create GRPC objects. + grpc_response = ::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::ListTenantsResponse.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" + order_by = "hello world" + + list_tenants_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :list_tenants, name + assert_kind_of ::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::ListTenantsRequest, 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"] + assert_equal "hello world", request["order_by"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, list_tenants_client_stub do + # Create client + client = ::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::SaasDeployments::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.list_tenants({ parent: parent, page_size: page_size, page_token: page_token, filter: filter, order_by: order_by }) 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_tenants parent: parent, page_size: page_size, page_token: page_token, filter: filter, order_by: order_by 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_tenants ::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::ListTenantsRequest.new(parent: parent, page_size: page_size, page_token: page_token, filter: filter, order_by: order_by) 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_tenants({ parent: parent, page_size: page_size, page_token: page_token, filter: filter, order_by: order_by }, 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_tenants(::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::ListTenantsRequest.new(parent: parent, page_size: page_size, page_token: page_token, filter: filter, order_by: order_by), 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_tenants_client_stub.call_rpc_count + end + end + + def test_get_tenant + # Create GRPC objects. + grpc_response = ::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::Tenant.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_tenant_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :get_tenant, name + assert_kind_of ::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::GetTenantRequest, request + assert_equal "hello world", request["name"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, get_tenant_client_stub do + # Create client + client = ::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::SaasDeployments::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.get_tenant({ name: name }) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use named arguments + client.get_tenant name: name do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.get_tenant ::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::GetTenantRequest.new(name: name) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use hash object with options + client.get_tenant({ 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_tenant(::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::GetTenantRequest.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_tenant_client_stub.call_rpc_count + end + end + + def test_create_tenant + # Create GRPC objects. + grpc_response = ::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::Tenant.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" + tenant_id = "hello world" + tenant = {} + validate_only = true + request_id = "hello world" + + create_tenant_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :create_tenant, name + assert_kind_of ::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::CreateTenantRequest, request + assert_equal "hello world", request["parent"] + assert_equal "hello world", request["tenant_id"] + assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::Tenant), request["tenant"] + assert_equal true, request["validate_only"] + assert_equal "hello world", request["request_id"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, create_tenant_client_stub do + # Create client + client = ::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::SaasDeployments::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.create_tenant({ parent: parent, tenant_id: tenant_id, tenant: tenant, validate_only: validate_only, request_id: request_id }) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use named arguments + client.create_tenant parent: parent, tenant_id: tenant_id, tenant: tenant, validate_only: validate_only, request_id: request_id do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.create_tenant ::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::CreateTenantRequest.new(parent: parent, tenant_id: tenant_id, tenant: tenant, validate_only: validate_only, request_id: request_id) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use hash object with options + client.create_tenant({ parent: parent, tenant_id: tenant_id, tenant: tenant, validate_only: validate_only, request_id: request_id }, grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object with options + client.create_tenant(::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::CreateTenantRequest.new(parent: parent, tenant_id: tenant_id, tenant: tenant, validate_only: validate_only, request_id: request_id), grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Verify method calls + assert_equal 5, create_tenant_client_stub.call_rpc_count + end + end + + def test_update_tenant + # Create GRPC objects. + grpc_response = ::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::Tenant.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. + tenant = {} + validate_only = true + request_id = "hello world" + update_mask = {} + + update_tenant_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :update_tenant, name + assert_kind_of ::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::UpdateTenantRequest, request + assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::Tenant), request["tenant"] + assert_equal true, request["validate_only"] + assert_equal "hello world", request["request_id"] + assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Protobuf::FieldMask), request["update_mask"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, update_tenant_client_stub do + # Create client + client = ::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::SaasDeployments::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.update_tenant({ tenant: tenant, validate_only: validate_only, request_id: request_id, update_mask: update_mask }) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use named arguments + client.update_tenant tenant: tenant, validate_only: validate_only, request_id: request_id, update_mask: update_mask do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.update_tenant ::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::UpdateTenantRequest.new(tenant: tenant, validate_only: validate_only, request_id: request_id, update_mask: update_mask) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use hash object with options + client.update_tenant({ tenant: tenant, validate_only: validate_only, request_id: request_id, update_mask: update_mask }, grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object with options + client.update_tenant(::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::UpdateTenantRequest.new(tenant: tenant, validate_only: validate_only, request_id: request_id, update_mask: update_mask), grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Verify method calls + assert_equal 5, update_tenant_client_stub.call_rpc_count + end + end + + def test_delete_tenant + # Create GRPC objects. + grpc_response = ::Google::Protobuf::Empty.new + grpc_operation = GRPC::ActiveCall::Operation.new nil + grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + grpc_options = {} + + # Create request parameters for a unary method. + name = "hello world" + etag = "hello world" + validate_only = true + request_id = "hello world" + + delete_tenant_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :delete_tenant, name + assert_kind_of ::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::DeleteTenantRequest, request + assert_equal "hello world", request["name"] + assert_equal "hello world", request["etag"] + assert_equal true, request["validate_only"] + assert_equal "hello world", request["request_id"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, delete_tenant_client_stub do + # Create client + client = ::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::SaasDeployments::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.delete_tenant({ name: name, etag: etag, validate_only: validate_only, request_id: request_id }) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use named arguments + client.delete_tenant name: name, etag: etag, validate_only: validate_only, request_id: request_id do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.delete_tenant ::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::DeleteTenantRequest.new(name: name, etag: etag, validate_only: validate_only, request_id: request_id) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use hash object with options + client.delete_tenant({ name: name, etag: etag, validate_only: validate_only, request_id: request_id }, grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object with options + client.delete_tenant(::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::DeleteTenantRequest.new(name: name, etag: etag, validate_only: validate_only, request_id: request_id), grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Verify method calls + assert_equal 5, delete_tenant_client_stub.call_rpc_count + end + end + + def test_list_unit_kinds + # Create GRPC objects. + grpc_response = ::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::ListUnitKindsResponse.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" + order_by = "hello world" + + list_unit_kinds_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :list_unit_kinds, name + assert_kind_of ::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::ListUnitKindsRequest, 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"] + assert_equal "hello world", request["order_by"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, list_unit_kinds_client_stub do + # Create client + client = ::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::SaasDeployments::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.list_unit_kinds({ parent: parent, page_size: page_size, page_token: page_token, filter: filter, order_by: order_by }) 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_unit_kinds parent: parent, page_size: page_size, page_token: page_token, filter: filter, order_by: order_by 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_unit_kinds ::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::ListUnitKindsRequest.new(parent: parent, page_size: page_size, page_token: page_token, filter: filter, order_by: order_by) 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_unit_kinds({ parent: parent, page_size: page_size, page_token: page_token, filter: filter, order_by: order_by }, 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_unit_kinds(::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::ListUnitKindsRequest.new(parent: parent, page_size: page_size, page_token: page_token, filter: filter, order_by: order_by), 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_unit_kinds_client_stub.call_rpc_count + end + end + + def test_get_unit_kind + # Create GRPC objects. + grpc_response = ::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::UnitKind.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_unit_kind_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :get_unit_kind, name + assert_kind_of ::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::GetUnitKindRequest, request + assert_equal "hello world", request["name"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, get_unit_kind_client_stub do + # Create client + client = ::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::SaasDeployments::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.get_unit_kind({ name: name }) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use named arguments + client.get_unit_kind name: name do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.get_unit_kind ::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::GetUnitKindRequest.new(name: name) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use hash object with options + client.get_unit_kind({ 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_unit_kind(::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::GetUnitKindRequest.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_unit_kind_client_stub.call_rpc_count + end + end + + def test_create_unit_kind + # Create GRPC objects. + grpc_response = ::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::UnitKind.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" + unit_kind_id = "hello world" + unit_kind = {} + validate_only = true + request_id = "hello world" + + create_unit_kind_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :create_unit_kind, name + assert_kind_of ::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::CreateUnitKindRequest, request + assert_equal "hello world", request["parent"] + assert_equal "hello world", request["unit_kind_id"] + assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::UnitKind), request["unit_kind"] + assert_equal true, request["validate_only"] + assert_equal "hello world", request["request_id"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, create_unit_kind_client_stub do + # Create client + client = ::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::SaasDeployments::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.create_unit_kind({ parent: parent, unit_kind_id: unit_kind_id, unit_kind: unit_kind, validate_only: validate_only, request_id: request_id }) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use named arguments + client.create_unit_kind parent: parent, unit_kind_id: unit_kind_id, unit_kind: unit_kind, validate_only: validate_only, request_id: request_id do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.create_unit_kind ::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::CreateUnitKindRequest.new(parent: parent, unit_kind_id: unit_kind_id, unit_kind: unit_kind, validate_only: validate_only, request_id: request_id) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use hash object with options + client.create_unit_kind({ parent: parent, unit_kind_id: unit_kind_id, unit_kind: unit_kind, validate_only: validate_only, request_id: request_id }, grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object with options + client.create_unit_kind(::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::CreateUnitKindRequest.new(parent: parent, unit_kind_id: unit_kind_id, unit_kind: unit_kind, validate_only: validate_only, request_id: request_id), grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Verify method calls + assert_equal 5, create_unit_kind_client_stub.call_rpc_count + end + end + + def test_update_unit_kind + # Create GRPC objects. + grpc_response = ::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::UnitKind.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. + unit_kind = {} + validate_only = true + request_id = "hello world" + update_mask = {} + + update_unit_kind_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :update_unit_kind, name + assert_kind_of ::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::UpdateUnitKindRequest, request + assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::UnitKind), request["unit_kind"] + assert_equal true, request["validate_only"] + assert_equal "hello world", request["request_id"] + assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Protobuf::FieldMask), request["update_mask"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, update_unit_kind_client_stub do + # Create client + client = ::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::SaasDeployments::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.update_unit_kind({ unit_kind: unit_kind, validate_only: validate_only, request_id: request_id, update_mask: update_mask }) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use named arguments + client.update_unit_kind unit_kind: unit_kind, validate_only: validate_only, request_id: request_id, update_mask: update_mask do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.update_unit_kind ::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::UpdateUnitKindRequest.new(unit_kind: unit_kind, validate_only: validate_only, request_id: request_id, update_mask: update_mask) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use hash object with options + client.update_unit_kind({ unit_kind: unit_kind, validate_only: validate_only, request_id: request_id, update_mask: update_mask }, grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object with options + client.update_unit_kind(::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::UpdateUnitKindRequest.new(unit_kind: unit_kind, validate_only: validate_only, request_id: request_id, update_mask: update_mask), grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Verify method calls + assert_equal 5, update_unit_kind_client_stub.call_rpc_count + end + end + + def test_delete_unit_kind + # Create GRPC objects. + grpc_response = ::Google::Protobuf::Empty.new + grpc_operation = GRPC::ActiveCall::Operation.new nil + grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + grpc_options = {} + + # Create request parameters for a unary method. + name = "hello world" + etag = "hello world" + validate_only = true + request_id = "hello world" + + delete_unit_kind_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :delete_unit_kind, name + assert_kind_of ::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::DeleteUnitKindRequest, request + assert_equal "hello world", request["name"] + assert_equal "hello world", request["etag"] + assert_equal true, request["validate_only"] + assert_equal "hello world", request["request_id"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, delete_unit_kind_client_stub do + # Create client + client = ::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::SaasDeployments::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.delete_unit_kind({ name: name, etag: etag, validate_only: validate_only, request_id: request_id }) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use named arguments + client.delete_unit_kind name: name, etag: etag, validate_only: validate_only, request_id: request_id do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.delete_unit_kind ::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::DeleteUnitKindRequest.new(name: name, etag: etag, validate_only: validate_only, request_id: request_id) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use hash object with options + client.delete_unit_kind({ name: name, etag: etag, validate_only: validate_only, request_id: request_id }, grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object with options + client.delete_unit_kind(::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::DeleteUnitKindRequest.new(name: name, etag: etag, validate_only: validate_only, request_id: request_id), grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Verify method calls + assert_equal 5, delete_unit_kind_client_stub.call_rpc_count + end + end + + def test_list_units + # Create GRPC objects. + grpc_response = ::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::ListUnitsResponse.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" + order_by = "hello world" + + list_units_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :list_units, name + assert_kind_of ::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::ListUnitsRequest, 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"] + assert_equal "hello world", request["order_by"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, list_units_client_stub do + # Create client + client = ::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::SaasDeployments::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.list_units({ parent: parent, page_size: page_size, page_token: page_token, filter: filter, order_by: order_by }) 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_units parent: parent, page_size: page_size, page_token: page_token, filter: filter, order_by: order_by 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_units ::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::ListUnitsRequest.new(parent: parent, page_size: page_size, page_token: page_token, filter: filter, order_by: order_by) 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_units({ parent: parent, page_size: page_size, page_token: page_token, filter: filter, order_by: order_by }, 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_units(::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::ListUnitsRequest.new(parent: parent, page_size: page_size, page_token: page_token, filter: filter, order_by: order_by), 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_units_client_stub.call_rpc_count + end + end + + def test_get_unit + # Create GRPC objects. + grpc_response = ::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::Unit.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_unit_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :get_unit, name + assert_kind_of ::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::GetUnitRequest, request + assert_equal "hello world", request["name"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, get_unit_client_stub do + # Create client + client = ::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::SaasDeployments::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.get_unit({ name: name }) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use named arguments + client.get_unit name: name do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.get_unit ::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::GetUnitRequest.new(name: name) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use hash object with options + client.get_unit({ 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_unit(::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::GetUnitRequest.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_unit_client_stub.call_rpc_count + end + end + + def test_create_unit + # Create GRPC objects. + grpc_response = ::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::Unit.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" + unit_id = "hello world" + unit = {} + validate_only = true + request_id = "hello world" + + create_unit_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :create_unit, name + assert_kind_of ::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::CreateUnitRequest, request + assert_equal "hello world", request["parent"] + assert_equal "hello world", request["unit_id"] + assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::Unit), request["unit"] + assert_equal true, request["validate_only"] + assert_equal "hello world", request["request_id"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, create_unit_client_stub do + # Create client + client = ::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::SaasDeployments::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.create_unit({ parent: parent, unit_id: unit_id, unit: unit, validate_only: validate_only, request_id: request_id }) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use named arguments + client.create_unit parent: parent, unit_id: unit_id, unit: unit, validate_only: validate_only, request_id: request_id do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.create_unit ::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::CreateUnitRequest.new(parent: parent, unit_id: unit_id, unit: unit, validate_only: validate_only, request_id: request_id) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use hash object with options + client.create_unit({ parent: parent, unit_id: unit_id, unit: unit, validate_only: validate_only, request_id: request_id }, grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object with options + client.create_unit(::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::CreateUnitRequest.new(parent: parent, unit_id: unit_id, unit: unit, validate_only: validate_only, request_id: request_id), grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Verify method calls + assert_equal 5, create_unit_client_stub.call_rpc_count + end + end + + def test_update_unit + # Create GRPC objects. + grpc_response = ::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::Unit.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. + unit = {} + validate_only = true + request_id = "hello world" + update_mask = {} + + update_unit_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :update_unit, name + assert_kind_of ::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::UpdateUnitRequest, request + assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::Unit), request["unit"] + assert_equal true, request["validate_only"] + assert_equal "hello world", request["request_id"] + assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Protobuf::FieldMask), request["update_mask"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, update_unit_client_stub do + # Create client + client = ::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::SaasDeployments::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.update_unit({ unit: unit, validate_only: validate_only, request_id: request_id, update_mask: update_mask }) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use named arguments + client.update_unit unit: unit, validate_only: validate_only, request_id: request_id, update_mask: update_mask do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.update_unit ::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::UpdateUnitRequest.new(unit: unit, validate_only: validate_only, request_id: request_id, update_mask: update_mask) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use hash object with options + client.update_unit({ unit: unit, validate_only: validate_only, request_id: request_id, update_mask: update_mask }, grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object with options + client.update_unit(::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::UpdateUnitRequest.new(unit: unit, validate_only: validate_only, request_id: request_id, update_mask: update_mask), grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Verify method calls + assert_equal 5, update_unit_client_stub.call_rpc_count + end + end + + def test_delete_unit + # Create GRPC objects. + grpc_response = ::Google::Protobuf::Empty.new + grpc_operation = GRPC::ActiveCall::Operation.new nil + grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + grpc_options = {} + + # Create request parameters for a unary method. + name = "hello world" + etag = "hello world" + validate_only = true + request_id = "hello world" + + delete_unit_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :delete_unit, name + assert_kind_of ::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::DeleteUnitRequest, request + assert_equal "hello world", request["name"] + assert_equal "hello world", request["etag"] + assert_equal true, request["validate_only"] + assert_equal "hello world", request["request_id"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, delete_unit_client_stub do + # Create client + client = ::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::SaasDeployments::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.delete_unit({ name: name, etag: etag, validate_only: validate_only, request_id: request_id }) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use named arguments + client.delete_unit name: name, etag: etag, validate_only: validate_only, request_id: request_id do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.delete_unit ::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::DeleteUnitRequest.new(name: name, etag: etag, validate_only: validate_only, request_id: request_id) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use hash object with options + client.delete_unit({ name: name, etag: etag, validate_only: validate_only, request_id: request_id }, grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object with options + client.delete_unit(::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::DeleteUnitRequest.new(name: name, etag: etag, validate_only: validate_only, request_id: request_id), grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Verify method calls + assert_equal 5, delete_unit_client_stub.call_rpc_count + end + end + + def test_list_unit_operations + # Create GRPC objects. + grpc_response = ::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::ListUnitOperationsResponse.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" + order_by = "hello world" + + list_unit_operations_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :list_unit_operations, name + assert_kind_of ::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::ListUnitOperationsRequest, 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"] + assert_equal "hello world", request["order_by"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, list_unit_operations_client_stub do + # Create client + client = ::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::SaasDeployments::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.list_unit_operations({ parent: parent, page_size: page_size, page_token: page_token, filter: filter, order_by: order_by }) 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_unit_operations parent: parent, page_size: page_size, page_token: page_token, filter: filter, order_by: order_by 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_unit_operations ::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::ListUnitOperationsRequest.new(parent: parent, page_size: page_size, page_token: page_token, filter: filter, order_by: order_by) 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_unit_operations({ parent: parent, page_size: page_size, page_token: page_token, filter: filter, order_by: order_by }, 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_unit_operations(::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::ListUnitOperationsRequest.new(parent: parent, page_size: page_size, page_token: page_token, filter: filter, order_by: order_by), 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_unit_operations_client_stub.call_rpc_count + end + end + + def test_get_unit_operation + # Create GRPC objects. + grpc_response = ::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::UnitOperation.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_unit_operation_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :get_unit_operation, name + assert_kind_of ::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::GetUnitOperationRequest, request + assert_equal "hello world", request["name"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, get_unit_operation_client_stub do + # Create client + client = ::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::SaasDeployments::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.get_unit_operation({ name: name }) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use named arguments + client.get_unit_operation name: name do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.get_unit_operation ::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::GetUnitOperationRequest.new(name: name) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use hash object with options + client.get_unit_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.get_unit_operation(::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::GetUnitOperationRequest.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_unit_operation_client_stub.call_rpc_count + end + end + + def test_create_unit_operation + # Create GRPC objects. + grpc_response = ::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::UnitOperation.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" + unit_operation_id = "hello world" + unit_operation = {} + validate_only = true + request_id = "hello world" + + create_unit_operation_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :create_unit_operation, name + assert_kind_of ::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::CreateUnitOperationRequest, request + assert_equal "hello world", request["parent"] + assert_equal "hello world", request["unit_operation_id"] + assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::UnitOperation), request["unit_operation"] + assert_equal true, request["validate_only"] + assert_equal "hello world", request["request_id"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, create_unit_operation_client_stub do + # Create client + client = ::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::SaasDeployments::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.create_unit_operation({ parent: parent, unit_operation_id: unit_operation_id, unit_operation: unit_operation, validate_only: validate_only, request_id: request_id }) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use named arguments + client.create_unit_operation parent: parent, unit_operation_id: unit_operation_id, unit_operation: unit_operation, validate_only: validate_only, request_id: request_id do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.create_unit_operation ::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::CreateUnitOperationRequest.new(parent: parent, unit_operation_id: unit_operation_id, unit_operation: unit_operation, validate_only: validate_only, request_id: request_id) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use hash object with options + client.create_unit_operation({ parent: parent, unit_operation_id: unit_operation_id, unit_operation: unit_operation, validate_only: validate_only, request_id: request_id }, grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object with options + client.create_unit_operation(::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::CreateUnitOperationRequest.new(parent: parent, unit_operation_id: unit_operation_id, unit_operation: unit_operation, validate_only: validate_only, request_id: request_id), grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Verify method calls + assert_equal 5, create_unit_operation_client_stub.call_rpc_count + end + end + + def test_update_unit_operation + # Create GRPC objects. + grpc_response = ::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::UnitOperation.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. + unit_operation = {} + validate_only = true + request_id = "hello world" + update_mask = {} + + update_unit_operation_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :update_unit_operation, name + assert_kind_of ::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::UpdateUnitOperationRequest, request + assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::UnitOperation), request["unit_operation"] + assert_equal true, request["validate_only"] + assert_equal "hello world", request["request_id"] + assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Protobuf::FieldMask), request["update_mask"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, update_unit_operation_client_stub do + # Create client + client = ::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::SaasDeployments::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.update_unit_operation({ unit_operation: unit_operation, validate_only: validate_only, request_id: request_id, update_mask: update_mask }) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use named arguments + client.update_unit_operation unit_operation: unit_operation, validate_only: validate_only, request_id: request_id, update_mask: update_mask do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.update_unit_operation ::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::UpdateUnitOperationRequest.new(unit_operation: unit_operation, validate_only: validate_only, request_id: request_id, update_mask: update_mask) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use hash object with options + client.update_unit_operation({ unit_operation: unit_operation, validate_only: validate_only, request_id: request_id, update_mask: update_mask }, grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object with options + client.update_unit_operation(::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::UpdateUnitOperationRequest.new(unit_operation: unit_operation, validate_only: validate_only, request_id: request_id, update_mask: update_mask), grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Verify method calls + assert_equal 5, update_unit_operation_client_stub.call_rpc_count + end + end + + def test_delete_unit_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" + etag = "hello world" + validate_only = true + request_id = "hello world" + + delete_unit_operation_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :delete_unit_operation, name + assert_kind_of ::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::DeleteUnitOperationRequest, request + assert_equal "hello world", request["name"] + assert_equal "hello world", request["etag"] + assert_equal true, request["validate_only"] + assert_equal "hello world", request["request_id"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, delete_unit_operation_client_stub do + # Create client + client = ::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::SaasDeployments::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.delete_unit_operation({ name: name, etag: etag, validate_only: validate_only, request_id: request_id }) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use named arguments + client.delete_unit_operation name: name, etag: etag, validate_only: validate_only, request_id: request_id do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.delete_unit_operation ::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::DeleteUnitOperationRequest.new(name: name, etag: etag, validate_only: validate_only, request_id: request_id) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use hash object with options + client.delete_unit_operation({ name: name, etag: etag, validate_only: validate_only, request_id: request_id }, grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object with options + client.delete_unit_operation(::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::DeleteUnitOperationRequest.new(name: name, etag: etag, validate_only: validate_only, request_id: request_id), grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Verify method calls + assert_equal 5, delete_unit_operation_client_stub.call_rpc_count + end + end + + def test_list_releases + # Create GRPC objects. + grpc_response = ::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::ListReleasesResponse.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" + order_by = "hello world" + + list_releases_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :list_releases, name + assert_kind_of ::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::ListReleasesRequest, 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"] + assert_equal "hello world", request["order_by"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, list_releases_client_stub do + # Create client + client = ::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::SaasDeployments::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.list_releases({ parent: parent, page_size: page_size, page_token: page_token, filter: filter, order_by: order_by }) 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_releases parent: parent, page_size: page_size, page_token: page_token, filter: filter, order_by: order_by 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_releases ::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::ListReleasesRequest.new(parent: parent, page_size: page_size, page_token: page_token, filter: filter, order_by: order_by) 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_releases({ parent: parent, page_size: page_size, page_token: page_token, filter: filter, order_by: order_by }, 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_releases(::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::ListReleasesRequest.new(parent: parent, page_size: page_size, page_token: page_token, filter: filter, order_by: order_by), 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_releases_client_stub.call_rpc_count + end + end + + def test_get_release + # Create GRPC objects. + grpc_response = ::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::Release.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_release_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :get_release, name + assert_kind_of ::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::GetReleaseRequest, request + assert_equal "hello world", request["name"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, get_release_client_stub do + # Create client + client = ::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::SaasDeployments::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.get_release({ name: name }) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use named arguments + client.get_release name: name do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.get_release ::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::GetReleaseRequest.new(name: name) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use hash object with options + client.get_release({ 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_release(::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::GetReleaseRequest.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_release_client_stub.call_rpc_count + end + end + + def test_create_release + # Create GRPC objects. + grpc_response = ::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::Release.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" + release_id = "hello world" + release = {} + validate_only = true + request_id = "hello world" + + create_release_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :create_release, name + assert_kind_of ::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::CreateReleaseRequest, request + assert_equal "hello world", request["parent"] + assert_equal "hello world", request["release_id"] + assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::Release), request["release"] + assert_equal true, request["validate_only"] + assert_equal "hello world", request["request_id"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, create_release_client_stub do + # Create client + client = ::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::SaasDeployments::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.create_release({ parent: parent, release_id: release_id, release: release, validate_only: validate_only, request_id: request_id }) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use named arguments + client.create_release parent: parent, release_id: release_id, release: release, validate_only: validate_only, request_id: request_id do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.create_release ::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::CreateReleaseRequest.new(parent: parent, release_id: release_id, release: release, validate_only: validate_only, request_id: request_id) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use hash object with options + client.create_release({ parent: parent, release_id: release_id, release: release, validate_only: validate_only, request_id: request_id }, grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object with options + client.create_release(::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::CreateReleaseRequest.new(parent: parent, release_id: release_id, release: release, validate_only: validate_only, request_id: request_id), grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Verify method calls + assert_equal 5, create_release_client_stub.call_rpc_count + end + end + + def test_update_release + # Create GRPC objects. + grpc_response = ::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::Release.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. + release = {} + validate_only = true + request_id = "hello world" + update_mask = {} + + update_release_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :update_release, name + assert_kind_of ::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::UpdateReleaseRequest, request + assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::Release), request["release"] + assert_equal true, request["validate_only"] + assert_equal "hello world", request["request_id"] + assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Protobuf::FieldMask), request["update_mask"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, update_release_client_stub do + # Create client + client = ::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::SaasDeployments::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.update_release({ release: release, validate_only: validate_only, request_id: request_id, update_mask: update_mask }) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use named arguments + client.update_release release: release, validate_only: validate_only, request_id: request_id, update_mask: update_mask do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.update_release ::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::UpdateReleaseRequest.new(release: release, validate_only: validate_only, request_id: request_id, update_mask: update_mask) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use hash object with options + client.update_release({ release: release, validate_only: validate_only, request_id: request_id, update_mask: update_mask }, grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object with options + client.update_release(::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::UpdateReleaseRequest.new(release: release, validate_only: validate_only, request_id: request_id, update_mask: update_mask), grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Verify method calls + assert_equal 5, update_release_client_stub.call_rpc_count + end + end + + def test_delete_release + # Create GRPC objects. + grpc_response = ::Google::Protobuf::Empty.new + grpc_operation = GRPC::ActiveCall::Operation.new nil + grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + grpc_options = {} + + # Create request parameters for a unary method. + name = "hello world" + etag = "hello world" + validate_only = true + request_id = "hello world" + + delete_release_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :delete_release, name + assert_kind_of ::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::DeleteReleaseRequest, request + assert_equal "hello world", request["name"] + assert_equal "hello world", request["etag"] + assert_equal true, request["validate_only"] + assert_equal "hello world", request["request_id"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, delete_release_client_stub do + # Create client + client = ::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::SaasDeployments::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.delete_release({ name: name, etag: etag, validate_only: validate_only, request_id: request_id }) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use named arguments + client.delete_release name: name, etag: etag, validate_only: validate_only, request_id: request_id do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.delete_release ::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::DeleteReleaseRequest.new(name: name, etag: etag, validate_only: validate_only, request_id: request_id) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use hash object with options + client.delete_release({ name: name, etag: etag, validate_only: validate_only, request_id: request_id }, grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object with options + client.delete_release(::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::DeleteReleaseRequest.new(name: name, etag: etag, validate_only: validate_only, request_id: request_id), grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Verify method calls + assert_equal 5, delete_release_client_stub.call_rpc_count + end + end + + def test_configure + grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + + client = block_config = config = nil + dummy_stub = ClientStub.new nil, nil + Gapic::ServiceStub.stub :new, dummy_stub do + client = ::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::SaasDeployments::Client.new do |config| + config.credentials = grpc_channel + end + end + + config = client.configure do |c| + block_config = c + end + + assert_same block_config, config + assert_kind_of ::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::SaasDeployments::Client::Configuration, config + end + + def test_credentials + key = OpenSSL::PKey::RSA.new 2048 + cred_json = { + "private_key" => key.to_pem, + "client_email" => "app@developer.gserviceaccount.com", + "type" => "service_account" + } + key_file = StringIO.new cred_json.to_json + creds = Google::Auth::ServiceAccountCredentials.make_creds({ json_key_io: key_file }) + + dummy_stub = ClientStub.new nil, nil + Gapic::ServiceStub.stub :new, dummy_stub do + client = ::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::SaasDeployments::Client.new do |config| + config.credentials = creds + end + assert_kind_of ::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::SaasDeployments::Client, client + assert_equal creds, client.configure.credentials + end + end +end diff --git a/owl-bot-staging/google-cloud-saas_platform-saas_service_mgmt-v1beta1/test/google/cloud/saas_platform/saas_service_mgmt/v1beta1/saas_rollouts_paths_test.rb b/owl-bot-staging/google-cloud-saas_platform-saas_service_mgmt-v1beta1/test/google/cloud/saas_platform/saas_service_mgmt/v1beta1/saas_rollouts_paths_test.rb new file mode 100644 index 000000000000..74ed06aa7ce4 --- /dev/null +++ b/owl-bot-staging/google-cloud-saas_platform-saas_service_mgmt-v1beta1/test/google/cloud/saas_platform/saas_service_mgmt/v1beta1/saas_rollouts_paths_test.rb @@ -0,0 +1,103 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +require "helper" + +require "gapic/grpc/service_stub" + +require "google/cloud/saas_platform/saas_service_mgmt/v1beta1/saas_rollouts" + +class ::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::SaasRollouts::ClientPathsTest < Minitest::Test + class DummyStub + def endpoint + "endpoint.example.com" + end + + def universe_domain + "example.com" + end + + def stub_logger + nil + end + + def logger + nil + end + end + + def test_location_path + grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + ::Gapic::ServiceStub.stub :new, DummyStub.new do + client = ::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::SaasRollouts::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_release_path + grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + ::Gapic::ServiceStub.stub :new, DummyStub.new do + client = ::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::SaasRollouts::Client.new do |config| + config.credentials = grpc_channel + end + + path = client.release_path project: "value0", location: "value1", release: "value2" + assert_equal "projects/value0/locations/value1/releases/value2", path + end + end + + def test_rollout_path + grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + ::Gapic::ServiceStub.stub :new, DummyStub.new do + client = ::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::SaasRollouts::Client.new do |config| + config.credentials = grpc_channel + end + + path = client.rollout_path project: "value0", location: "value1", rollout_id: "value2" + assert_equal "projects/value0/locations/value1/rollouts/value2", path + end + end + + def test_rollout_kind_path + grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + ::Gapic::ServiceStub.stub :new, DummyStub.new do + client = ::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::SaasRollouts::Client.new do |config| + config.credentials = grpc_channel + end + + path = client.rollout_kind_path project: "value0", location: "value1", rollout_kind_id: "value2" + assert_equal "projects/value0/locations/value1/rolloutKinds/value2", path + end + end + + def test_unit_kind_path + grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + ::Gapic::ServiceStub.stub :new, DummyStub.new do + client = ::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::SaasRollouts::Client.new do |config| + config.credentials = grpc_channel + end + + path = client.unit_kind_path project: "value0", location: "value1", unit_kind: "value2" + assert_equal "projects/value0/locations/value1/unitKinds/value2", path + end + end +end diff --git a/owl-bot-staging/google-cloud-saas_platform-saas_service_mgmt-v1beta1/test/google/cloud/saas_platform/saas_service_mgmt/v1beta1/saas_rollouts_rest_test.rb b/owl-bot-staging/google-cloud-saas_platform-saas_service_mgmt-v1beta1/test/google/cloud/saas_platform/saas_service_mgmt/v1beta1/saas_rollouts_rest_test.rb new file mode 100644 index 000000000000..74e871ac379c --- /dev/null +++ b/owl-bot-staging/google-cloud-saas_platform-saas_service_mgmt-v1beta1/test/google/cloud/saas_platform/saas_service_mgmt/v1beta1/saas_rollouts_rest_test.rb @@ -0,0 +1,667 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +require "helper" +require "gapic/rest" +require "google/cloud/saasplatform/saasservicemgmt/v1beta1/rollouts_service_pb" +require "google/cloud/saas_platform/saas_service_mgmt/v1beta1/saas_rollouts/rest" + + +class ::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::SaasRollouts::Rest::ClientTest < Minitest::Test + class ClientStub + attr_accessor :call_count, :requests + + def initialize response, &block + @response = response + @block = block + @call_count = 0 + @requests = [] + end + + def make_get_request uri:, params: {}, options: {}, method_name: nil + make_http_request :get, uri: uri, body: nil, params: params, options: options, method_name: method_name + end + + def make_delete_request uri:, params: {}, options: {}, method_name: nil + make_http_request :delete, uri: uri, body: nil, params: params, options: options, method_name: method_name + end + + def make_post_request uri:, body: nil, params: {}, options: {}, method_name: nil + make_http_request :post, uri: uri, body: body, params: params, options: options, method_name: method_name + end + + def make_patch_request uri:, body:, params: {}, options: {}, method_name: nil + make_http_request :patch, uri: uri, body: body, params: params, options: options, method_name: method_name + end + + def make_put_request uri:, body:, params: {}, options: {}, method_name: nil + make_http_request :put, uri: uri, body: body, params: params, options: options, method_name: method_name + end + + def make_http_request *args, **kwargs + @call_count += 1 + + @requests << @block&.call(*args, **kwargs) + + @response + end + + def endpoint + "endpoint.example.com" + end + + def universe_domain + "example.com" + end + + def stub_logger + nil + end + + def logger + nil + end + end + + def test_list_rollouts + # Create test objects. + client_result = ::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::ListRolloutsResponse.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" + order_by = "hello world" + + list_rollouts_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| + assert options.metadata.key? :"x-goog-api-client" + assert options.metadata[:"x-goog-api-client"].include? "rest" + refute options.metadata[:"x-goog-api-client"].include? "grpc" + end + + ::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::SaasRollouts::Rest::ServiceStub.stub :transcode_list_rollouts_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, list_rollouts_client_stub do + # Create client + client = ::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::SaasRollouts::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.list_rollouts({ parent: parent, page_size: page_size, page_token: page_token, filter: filter, order_by: order_by }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.list_rollouts parent: parent, page_size: page_size, page_token: page_token, filter: filter, order_by: order_by do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.list_rollouts ::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::ListRolloutsRequest.new(parent: parent, page_size: page_size, page_token: page_token, filter: filter, order_by: order_by) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + client.list_rollouts({ parent: parent, page_size: page_size, page_token: page_token, filter: filter, order_by: order_by }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + client.list_rollouts(::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::ListRolloutsRequest.new(parent: parent, page_size: page_size, page_token: page_token, filter: filter, order_by: order_by), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, list_rollouts_client_stub.call_count + end + end + end + + def test_get_rollout + # Create test objects. + client_result = ::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::Rollout.new + http_response = OpenStruct.new body: client_result.to_json + + call_options = {} + + # Create request parameters for a unary method. + name = "hello world" + + get_rollout_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| + assert options.metadata.key? :"x-goog-api-client" + assert options.metadata[:"x-goog-api-client"].include? "rest" + refute options.metadata[:"x-goog-api-client"].include? "grpc" + end + + ::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::SaasRollouts::Rest::ServiceStub.stub :transcode_get_rollout_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, get_rollout_client_stub do + # Create client + client = ::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::SaasRollouts::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.get_rollout({ name: name }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.get_rollout name: name do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.get_rollout ::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::GetRolloutRequest.new(name: name) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + client.get_rollout({ name: name }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + client.get_rollout(::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::GetRolloutRequest.new(name: name), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, get_rollout_client_stub.call_count + end + end + end + + def test_create_rollout + # Create test objects. + client_result = ::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::Rollout.new + http_response = OpenStruct.new body: client_result.to_json + + call_options = {} + + # Create request parameters for a unary method. + parent = "hello world" + rollout_id = "hello world" + rollout = {} + validate_only = true + request_id = "hello world" + + create_rollout_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| + assert options.metadata.key? :"x-goog-api-client" + assert options.metadata[:"x-goog-api-client"].include? "rest" + refute options.metadata[:"x-goog-api-client"].include? "grpc" + end + + ::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::SaasRollouts::Rest::ServiceStub.stub :transcode_create_rollout_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, create_rollout_client_stub do + # Create client + client = ::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::SaasRollouts::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.create_rollout({ parent: parent, rollout_id: rollout_id, rollout: rollout, validate_only: validate_only, request_id: request_id }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.create_rollout parent: parent, rollout_id: rollout_id, rollout: rollout, validate_only: validate_only, request_id: request_id do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.create_rollout ::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::CreateRolloutRequest.new(parent: parent, rollout_id: rollout_id, rollout: rollout, validate_only: validate_only, request_id: request_id) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + client.create_rollout({ parent: parent, rollout_id: rollout_id, rollout: rollout, validate_only: validate_only, request_id: request_id }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + client.create_rollout(::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::CreateRolloutRequest.new(parent: parent, rollout_id: rollout_id, rollout: rollout, validate_only: validate_only, request_id: request_id), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, create_rollout_client_stub.call_count + end + end + end + + def test_update_rollout + # Create test objects. + client_result = ::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::Rollout.new + http_response = OpenStruct.new body: client_result.to_json + + call_options = {} + + # Create request parameters for a unary method. + rollout = {} + validate_only = true + request_id = "hello world" + update_mask = {} + + update_rollout_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| + assert options.metadata.key? :"x-goog-api-client" + assert options.metadata[:"x-goog-api-client"].include? "rest" + refute options.metadata[:"x-goog-api-client"].include? "grpc" + end + + ::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::SaasRollouts::Rest::ServiceStub.stub :transcode_update_rollout_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, update_rollout_client_stub do + # Create client + client = ::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::SaasRollouts::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.update_rollout({ rollout: rollout, validate_only: validate_only, request_id: request_id, update_mask: update_mask }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.update_rollout rollout: rollout, validate_only: validate_only, request_id: request_id, update_mask: update_mask do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.update_rollout ::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::UpdateRolloutRequest.new(rollout: rollout, validate_only: validate_only, request_id: request_id, update_mask: update_mask) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + client.update_rollout({ rollout: rollout, validate_only: validate_only, request_id: request_id, update_mask: update_mask }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + client.update_rollout(::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::UpdateRolloutRequest.new(rollout: rollout, validate_only: validate_only, request_id: request_id, update_mask: update_mask), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, update_rollout_client_stub.call_count + end + end + end + + def test_delete_rollout + # Create test objects. + client_result = ::Google::Protobuf::Empty.new + http_response = OpenStruct.new body: client_result.to_json + + call_options = {} + + # Create request parameters for a unary method. + name = "hello world" + etag = "hello world" + validate_only = true + request_id = "hello world" + + delete_rollout_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| + assert options.metadata.key? :"x-goog-api-client" + assert options.metadata[:"x-goog-api-client"].include? "rest" + refute options.metadata[:"x-goog-api-client"].include? "grpc" + end + + ::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::SaasRollouts::Rest::ServiceStub.stub :transcode_delete_rollout_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, delete_rollout_client_stub do + # Create client + client = ::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::SaasRollouts::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.delete_rollout({ name: name, etag: etag, validate_only: validate_only, request_id: request_id }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.delete_rollout name: name, etag: etag, validate_only: validate_only, request_id: request_id do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.delete_rollout ::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::DeleteRolloutRequest.new(name: name, etag: etag, validate_only: validate_only, request_id: request_id) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + client.delete_rollout({ name: name, etag: etag, validate_only: validate_only, request_id: request_id }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + client.delete_rollout(::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::DeleteRolloutRequest.new(name: name, etag: etag, validate_only: validate_only, request_id: request_id), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, delete_rollout_client_stub.call_count + end + end + end + + def test_list_rollout_kinds + # Create test objects. + client_result = ::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::ListRolloutKindsResponse.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" + order_by = "hello world" + + list_rollout_kinds_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| + assert options.metadata.key? :"x-goog-api-client" + assert options.metadata[:"x-goog-api-client"].include? "rest" + refute options.metadata[:"x-goog-api-client"].include? "grpc" + end + + ::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::SaasRollouts::Rest::ServiceStub.stub :transcode_list_rollout_kinds_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, list_rollout_kinds_client_stub do + # Create client + client = ::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::SaasRollouts::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.list_rollout_kinds({ parent: parent, page_size: page_size, page_token: page_token, filter: filter, order_by: order_by }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.list_rollout_kinds parent: parent, page_size: page_size, page_token: page_token, filter: filter, order_by: order_by do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.list_rollout_kinds ::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::ListRolloutKindsRequest.new(parent: parent, page_size: page_size, page_token: page_token, filter: filter, order_by: order_by) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + client.list_rollout_kinds({ parent: parent, page_size: page_size, page_token: page_token, filter: filter, order_by: order_by }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + client.list_rollout_kinds(::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::ListRolloutKindsRequest.new(parent: parent, page_size: page_size, page_token: page_token, filter: filter, order_by: order_by), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, list_rollout_kinds_client_stub.call_count + end + end + end + + def test_get_rollout_kind + # Create test objects. + client_result = ::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::RolloutKind.new + http_response = OpenStruct.new body: client_result.to_json + + call_options = {} + + # Create request parameters for a unary method. + name = "hello world" + + get_rollout_kind_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| + assert options.metadata.key? :"x-goog-api-client" + assert options.metadata[:"x-goog-api-client"].include? "rest" + refute options.metadata[:"x-goog-api-client"].include? "grpc" + end + + ::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::SaasRollouts::Rest::ServiceStub.stub :transcode_get_rollout_kind_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, get_rollout_kind_client_stub do + # Create client + client = ::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::SaasRollouts::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.get_rollout_kind({ name: name }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.get_rollout_kind name: name do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.get_rollout_kind ::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::GetRolloutKindRequest.new(name: name) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + client.get_rollout_kind({ name: name }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + client.get_rollout_kind(::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::GetRolloutKindRequest.new(name: name), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, get_rollout_kind_client_stub.call_count + end + end + end + + def test_create_rollout_kind + # Create test objects. + client_result = ::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::RolloutKind.new + http_response = OpenStruct.new body: client_result.to_json + + call_options = {} + + # Create request parameters for a unary method. + parent = "hello world" + rollout_kind_id = "hello world" + rollout_kind = {} + validate_only = true + request_id = "hello world" + + create_rollout_kind_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| + assert options.metadata.key? :"x-goog-api-client" + assert options.metadata[:"x-goog-api-client"].include? "rest" + refute options.metadata[:"x-goog-api-client"].include? "grpc" + end + + ::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::SaasRollouts::Rest::ServiceStub.stub :transcode_create_rollout_kind_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, create_rollout_kind_client_stub do + # Create client + client = ::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::SaasRollouts::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.create_rollout_kind({ parent: parent, rollout_kind_id: rollout_kind_id, rollout_kind: rollout_kind, validate_only: validate_only, request_id: request_id }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.create_rollout_kind parent: parent, rollout_kind_id: rollout_kind_id, rollout_kind: rollout_kind, validate_only: validate_only, request_id: request_id do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.create_rollout_kind ::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::CreateRolloutKindRequest.new(parent: parent, rollout_kind_id: rollout_kind_id, rollout_kind: rollout_kind, validate_only: validate_only, request_id: request_id) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + client.create_rollout_kind({ parent: parent, rollout_kind_id: rollout_kind_id, rollout_kind: rollout_kind, validate_only: validate_only, request_id: request_id }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + client.create_rollout_kind(::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::CreateRolloutKindRequest.new(parent: parent, rollout_kind_id: rollout_kind_id, rollout_kind: rollout_kind, validate_only: validate_only, request_id: request_id), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, create_rollout_kind_client_stub.call_count + end + end + end + + def test_update_rollout_kind + # Create test objects. + client_result = ::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::RolloutKind.new + http_response = OpenStruct.new body: client_result.to_json + + call_options = {} + + # Create request parameters for a unary method. + rollout_kind = {} + validate_only = true + request_id = "hello world" + update_mask = {} + + update_rollout_kind_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| + assert options.metadata.key? :"x-goog-api-client" + assert options.metadata[:"x-goog-api-client"].include? "rest" + refute options.metadata[:"x-goog-api-client"].include? "grpc" + end + + ::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::SaasRollouts::Rest::ServiceStub.stub :transcode_update_rollout_kind_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, update_rollout_kind_client_stub do + # Create client + client = ::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::SaasRollouts::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.update_rollout_kind({ rollout_kind: rollout_kind, validate_only: validate_only, request_id: request_id, update_mask: update_mask }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.update_rollout_kind rollout_kind: rollout_kind, validate_only: validate_only, request_id: request_id, update_mask: update_mask do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.update_rollout_kind ::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::UpdateRolloutKindRequest.new(rollout_kind: rollout_kind, validate_only: validate_only, request_id: request_id, update_mask: update_mask) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + client.update_rollout_kind({ rollout_kind: rollout_kind, validate_only: validate_only, request_id: request_id, update_mask: update_mask }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + client.update_rollout_kind(::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::UpdateRolloutKindRequest.new(rollout_kind: rollout_kind, validate_only: validate_only, request_id: request_id, update_mask: update_mask), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, update_rollout_kind_client_stub.call_count + end + end + end + + def test_delete_rollout_kind + # Create test objects. + client_result = ::Google::Protobuf::Empty.new + http_response = OpenStruct.new body: client_result.to_json + + call_options = {} + + # Create request parameters for a unary method. + name = "hello world" + etag = "hello world" + validate_only = true + request_id = "hello world" + + delete_rollout_kind_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| + assert options.metadata.key? :"x-goog-api-client" + assert options.metadata[:"x-goog-api-client"].include? "rest" + refute options.metadata[:"x-goog-api-client"].include? "grpc" + end + + ::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::SaasRollouts::Rest::ServiceStub.stub :transcode_delete_rollout_kind_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, delete_rollout_kind_client_stub do + # Create client + client = ::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::SaasRollouts::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.delete_rollout_kind({ name: name, etag: etag, validate_only: validate_only, request_id: request_id }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.delete_rollout_kind name: name, etag: etag, validate_only: validate_only, request_id: request_id do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.delete_rollout_kind ::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::DeleteRolloutKindRequest.new(name: name, etag: etag, validate_only: validate_only, request_id: request_id) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + client.delete_rollout_kind({ name: name, etag: etag, validate_only: validate_only, request_id: request_id }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + client.delete_rollout_kind(::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::DeleteRolloutKindRequest.new(name: name, etag: etag, validate_only: validate_only, request_id: request_id), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, delete_rollout_kind_client_stub.call_count + end + end + end + + def test_configure + credentials_token = :dummy_value + + client = block_config = config = nil + dummy_stub = ClientStub.new nil + Gapic::Rest::ClientStub.stub :new, dummy_stub do + client = ::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::SaasRollouts::Rest::Client.new do |config| + config.credentials = credentials_token + end + end + + config = client.configure do |c| + block_config = c + end + + assert_same block_config, config + assert_kind_of ::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::SaasRollouts::Rest::Client::Configuration, config + end +end diff --git a/owl-bot-staging/google-cloud-saas_platform-saas_service_mgmt-v1beta1/test/google/cloud/saas_platform/saas_service_mgmt/v1beta1/saas_rollouts_test.rb b/owl-bot-staging/google-cloud-saas_platform-saas_service_mgmt-v1beta1/test/google/cloud/saas_platform/saas_service_mgmt/v1beta1/saas_rollouts_test.rb new file mode 100644 index 000000000000..eae3d040a59d --- /dev/null +++ b/owl-bot-staging/google-cloud-saas_platform-saas_service_mgmt-v1beta1/test/google/cloud/saas_platform/saas_service_mgmt/v1beta1/saas_rollouts_test.rb @@ -0,0 +1,750 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +require "helper" + +require "gapic/grpc/service_stub" + +require "google/cloud/saasplatform/saasservicemgmt/v1beta1/rollouts_service_pb" +require "google/cloud/saas_platform/saas_service_mgmt/v1beta1/saas_rollouts" + +class ::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::SaasRollouts::ClientTest < Minitest::Test + class ClientStub + attr_accessor :call_rpc_count, :requests + + def initialize response, operation, &block + @response = response + @operation = operation + @block = block + @call_rpc_count = 0 + @requests = [] + end + + def call_rpc *args, **kwargs + @call_rpc_count += 1 + + @requests << @block&.call(*args, **kwargs) + + catch :response do + yield @response, @operation if block_given? + @response + end + end + + def endpoint + "endpoint.example.com" + end + + def universe_domain + "example.com" + end + + def stub_logger + nil + end + + def logger + nil + end + end + + def test_list_rollouts + # Create GRPC objects. + grpc_response = ::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::ListRolloutsResponse.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" + order_by = "hello world" + + list_rollouts_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :list_rollouts, name + assert_kind_of ::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::ListRolloutsRequest, 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"] + assert_equal "hello world", request["order_by"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, list_rollouts_client_stub do + # Create client + client = ::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::SaasRollouts::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.list_rollouts({ parent: parent, page_size: page_size, page_token: page_token, filter: filter, order_by: order_by }) 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_rollouts parent: parent, page_size: page_size, page_token: page_token, filter: filter, order_by: order_by 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_rollouts ::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::ListRolloutsRequest.new(parent: parent, page_size: page_size, page_token: page_token, filter: filter, order_by: order_by) 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_rollouts({ parent: parent, page_size: page_size, page_token: page_token, filter: filter, order_by: order_by }, 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_rollouts(::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::ListRolloutsRequest.new(parent: parent, page_size: page_size, page_token: page_token, filter: filter, order_by: order_by), 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_rollouts_client_stub.call_rpc_count + end + end + + def test_get_rollout + # Create GRPC objects. + grpc_response = ::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::Rollout.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_rollout_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :get_rollout, name + assert_kind_of ::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::GetRolloutRequest, request + assert_equal "hello world", request["name"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, get_rollout_client_stub do + # Create client + client = ::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::SaasRollouts::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.get_rollout({ name: name }) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use named arguments + client.get_rollout name: name do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.get_rollout ::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::GetRolloutRequest.new(name: name) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use hash object with options + client.get_rollout({ 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_rollout(::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::GetRolloutRequest.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_rollout_client_stub.call_rpc_count + end + end + + def test_create_rollout + # Create GRPC objects. + grpc_response = ::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::Rollout.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" + rollout_id = "hello world" + rollout = {} + validate_only = true + request_id = "hello world" + + create_rollout_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :create_rollout, name + assert_kind_of ::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::CreateRolloutRequest, request + assert_equal "hello world", request["parent"] + assert_equal "hello world", request["rollout_id"] + assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::Rollout), request["rollout"] + assert_equal true, request["validate_only"] + assert_equal "hello world", request["request_id"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, create_rollout_client_stub do + # Create client + client = ::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::SaasRollouts::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.create_rollout({ parent: parent, rollout_id: rollout_id, rollout: rollout, validate_only: validate_only, request_id: request_id }) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use named arguments + client.create_rollout parent: parent, rollout_id: rollout_id, rollout: rollout, validate_only: validate_only, request_id: request_id do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.create_rollout ::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::CreateRolloutRequest.new(parent: parent, rollout_id: rollout_id, rollout: rollout, validate_only: validate_only, request_id: request_id) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use hash object with options + client.create_rollout({ parent: parent, rollout_id: rollout_id, rollout: rollout, validate_only: validate_only, request_id: request_id }, grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object with options + client.create_rollout(::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::CreateRolloutRequest.new(parent: parent, rollout_id: rollout_id, rollout: rollout, validate_only: validate_only, request_id: request_id), grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Verify method calls + assert_equal 5, create_rollout_client_stub.call_rpc_count + end + end + + def test_update_rollout + # Create GRPC objects. + grpc_response = ::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::Rollout.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. + rollout = {} + validate_only = true + request_id = "hello world" + update_mask = {} + + update_rollout_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :update_rollout, name + assert_kind_of ::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::UpdateRolloutRequest, request + assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::Rollout), request["rollout"] + assert_equal true, request["validate_only"] + assert_equal "hello world", request["request_id"] + assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Protobuf::FieldMask), request["update_mask"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, update_rollout_client_stub do + # Create client + client = ::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::SaasRollouts::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.update_rollout({ rollout: rollout, validate_only: validate_only, request_id: request_id, update_mask: update_mask }) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use named arguments + client.update_rollout rollout: rollout, validate_only: validate_only, request_id: request_id, update_mask: update_mask do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.update_rollout ::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::UpdateRolloutRequest.new(rollout: rollout, validate_only: validate_only, request_id: request_id, update_mask: update_mask) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use hash object with options + client.update_rollout({ rollout: rollout, validate_only: validate_only, request_id: request_id, update_mask: update_mask }, grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object with options + client.update_rollout(::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::UpdateRolloutRequest.new(rollout: rollout, validate_only: validate_only, request_id: request_id, update_mask: update_mask), grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Verify method calls + assert_equal 5, update_rollout_client_stub.call_rpc_count + end + end + + def test_delete_rollout + # Create GRPC objects. + grpc_response = ::Google::Protobuf::Empty.new + grpc_operation = GRPC::ActiveCall::Operation.new nil + grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + grpc_options = {} + + # Create request parameters for a unary method. + name = "hello world" + etag = "hello world" + validate_only = true + request_id = "hello world" + + delete_rollout_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :delete_rollout, name + assert_kind_of ::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::DeleteRolloutRequest, request + assert_equal "hello world", request["name"] + assert_equal "hello world", request["etag"] + assert_equal true, request["validate_only"] + assert_equal "hello world", request["request_id"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, delete_rollout_client_stub do + # Create client + client = ::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::SaasRollouts::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.delete_rollout({ name: name, etag: etag, validate_only: validate_only, request_id: request_id }) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use named arguments + client.delete_rollout name: name, etag: etag, validate_only: validate_only, request_id: request_id do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.delete_rollout ::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::DeleteRolloutRequest.new(name: name, etag: etag, validate_only: validate_only, request_id: request_id) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use hash object with options + client.delete_rollout({ name: name, etag: etag, validate_only: validate_only, request_id: request_id }, grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object with options + client.delete_rollout(::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::DeleteRolloutRequest.new(name: name, etag: etag, validate_only: validate_only, request_id: request_id), grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Verify method calls + assert_equal 5, delete_rollout_client_stub.call_rpc_count + end + end + + def test_list_rollout_kinds + # Create GRPC objects. + grpc_response = ::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::ListRolloutKindsResponse.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" + order_by = "hello world" + + list_rollout_kinds_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :list_rollout_kinds, name + assert_kind_of ::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::ListRolloutKindsRequest, 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"] + assert_equal "hello world", request["order_by"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, list_rollout_kinds_client_stub do + # Create client + client = ::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::SaasRollouts::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.list_rollout_kinds({ parent: parent, page_size: page_size, page_token: page_token, filter: filter, order_by: order_by }) 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_rollout_kinds parent: parent, page_size: page_size, page_token: page_token, filter: filter, order_by: order_by 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_rollout_kinds ::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::ListRolloutKindsRequest.new(parent: parent, page_size: page_size, page_token: page_token, filter: filter, order_by: order_by) 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_rollout_kinds({ parent: parent, page_size: page_size, page_token: page_token, filter: filter, order_by: order_by }, 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_rollout_kinds(::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::ListRolloutKindsRequest.new(parent: parent, page_size: page_size, page_token: page_token, filter: filter, order_by: order_by), 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_rollout_kinds_client_stub.call_rpc_count + end + end + + def test_get_rollout_kind + # Create GRPC objects. + grpc_response = ::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::RolloutKind.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_rollout_kind_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :get_rollout_kind, name + assert_kind_of ::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::GetRolloutKindRequest, request + assert_equal "hello world", request["name"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, get_rollout_kind_client_stub do + # Create client + client = ::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::SaasRollouts::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.get_rollout_kind({ name: name }) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use named arguments + client.get_rollout_kind name: name do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.get_rollout_kind ::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::GetRolloutKindRequest.new(name: name) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use hash object with options + client.get_rollout_kind({ 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_rollout_kind(::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::GetRolloutKindRequest.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_rollout_kind_client_stub.call_rpc_count + end + end + + def test_create_rollout_kind + # Create GRPC objects. + grpc_response = ::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::RolloutKind.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" + rollout_kind_id = "hello world" + rollout_kind = {} + validate_only = true + request_id = "hello world" + + create_rollout_kind_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :create_rollout_kind, name + assert_kind_of ::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::CreateRolloutKindRequest, request + assert_equal "hello world", request["parent"] + assert_equal "hello world", request["rollout_kind_id"] + assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::RolloutKind), request["rollout_kind"] + assert_equal true, request["validate_only"] + assert_equal "hello world", request["request_id"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, create_rollout_kind_client_stub do + # Create client + client = ::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::SaasRollouts::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.create_rollout_kind({ parent: parent, rollout_kind_id: rollout_kind_id, rollout_kind: rollout_kind, validate_only: validate_only, request_id: request_id }) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use named arguments + client.create_rollout_kind parent: parent, rollout_kind_id: rollout_kind_id, rollout_kind: rollout_kind, validate_only: validate_only, request_id: request_id do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.create_rollout_kind ::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::CreateRolloutKindRequest.new(parent: parent, rollout_kind_id: rollout_kind_id, rollout_kind: rollout_kind, validate_only: validate_only, request_id: request_id) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use hash object with options + client.create_rollout_kind({ parent: parent, rollout_kind_id: rollout_kind_id, rollout_kind: rollout_kind, validate_only: validate_only, request_id: request_id }, grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object with options + client.create_rollout_kind(::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::CreateRolloutKindRequest.new(parent: parent, rollout_kind_id: rollout_kind_id, rollout_kind: rollout_kind, validate_only: validate_only, request_id: request_id), grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Verify method calls + assert_equal 5, create_rollout_kind_client_stub.call_rpc_count + end + end + + def test_update_rollout_kind + # Create GRPC objects. + grpc_response = ::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::RolloutKind.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. + rollout_kind = {} + validate_only = true + request_id = "hello world" + update_mask = {} + + update_rollout_kind_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :update_rollout_kind, name + assert_kind_of ::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::UpdateRolloutKindRequest, request + assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::RolloutKind), request["rollout_kind"] + assert_equal true, request["validate_only"] + assert_equal "hello world", request["request_id"] + assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Protobuf::FieldMask), request["update_mask"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, update_rollout_kind_client_stub do + # Create client + client = ::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::SaasRollouts::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.update_rollout_kind({ rollout_kind: rollout_kind, validate_only: validate_only, request_id: request_id, update_mask: update_mask }) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use named arguments + client.update_rollout_kind rollout_kind: rollout_kind, validate_only: validate_only, request_id: request_id, update_mask: update_mask do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.update_rollout_kind ::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::UpdateRolloutKindRequest.new(rollout_kind: rollout_kind, validate_only: validate_only, request_id: request_id, update_mask: update_mask) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use hash object with options + client.update_rollout_kind({ rollout_kind: rollout_kind, validate_only: validate_only, request_id: request_id, update_mask: update_mask }, grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object with options + client.update_rollout_kind(::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::UpdateRolloutKindRequest.new(rollout_kind: rollout_kind, validate_only: validate_only, request_id: request_id, update_mask: update_mask), grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Verify method calls + assert_equal 5, update_rollout_kind_client_stub.call_rpc_count + end + end + + def test_delete_rollout_kind + # Create GRPC objects. + grpc_response = ::Google::Protobuf::Empty.new + grpc_operation = GRPC::ActiveCall::Operation.new nil + grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + grpc_options = {} + + # Create request parameters for a unary method. + name = "hello world" + etag = "hello world" + validate_only = true + request_id = "hello world" + + delete_rollout_kind_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :delete_rollout_kind, name + assert_kind_of ::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::DeleteRolloutKindRequest, request + assert_equal "hello world", request["name"] + assert_equal "hello world", request["etag"] + assert_equal true, request["validate_only"] + assert_equal "hello world", request["request_id"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, delete_rollout_kind_client_stub do + # Create client + client = ::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::SaasRollouts::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.delete_rollout_kind({ name: name, etag: etag, validate_only: validate_only, request_id: request_id }) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use named arguments + client.delete_rollout_kind name: name, etag: etag, validate_only: validate_only, request_id: request_id do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.delete_rollout_kind ::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::DeleteRolloutKindRequest.new(name: name, etag: etag, validate_only: validate_only, request_id: request_id) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use hash object with options + client.delete_rollout_kind({ name: name, etag: etag, validate_only: validate_only, request_id: request_id }, grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object with options + client.delete_rollout_kind(::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::DeleteRolloutKindRequest.new(name: name, etag: etag, validate_only: validate_only, request_id: request_id), grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Verify method calls + assert_equal 5, delete_rollout_kind_client_stub.call_rpc_count + end + end + + def test_configure + grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + + client = block_config = config = nil + dummy_stub = ClientStub.new nil, nil + Gapic::ServiceStub.stub :new, dummy_stub do + client = ::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::SaasRollouts::Client.new do |config| + config.credentials = grpc_channel + end + end + + config = client.configure do |c| + block_config = c + end + + assert_same block_config, config + assert_kind_of ::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::SaasRollouts::Client::Configuration, config + end + + def test_credentials + key = OpenSSL::PKey::RSA.new 2048 + cred_json = { + "private_key" => key.to_pem, + "client_email" => "app@developer.gserviceaccount.com", + "type" => "service_account" + } + key_file = StringIO.new cred_json.to_json + creds = Google::Auth::ServiceAccountCredentials.make_creds({ json_key_io: key_file }) + + dummy_stub = ClientStub.new nil, nil + Gapic::ServiceStub.stub :new, dummy_stub do + client = ::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::SaasRollouts::Client.new do |config| + config.credentials = creds + end + assert_kind_of ::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::SaasRollouts::Client, client + assert_equal creds, client.configure.credentials + end + end +end diff --git a/owl-bot-staging/google-cloud-saas_platform-saas_service_mgmt-v1beta1/test/helper.rb b/owl-bot-staging/google-cloud-saas_platform-saas_service_mgmt-v1beta1/test/helper.rb new file mode 100644 index 000000000000..672b337030e7 --- /dev/null +++ b/owl-bot-staging/google-cloud-saas_platform-saas_service_mgmt-v1beta1/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" diff --git a/owl-bot-staging/google-cloud-scheduler-v1/.gitignore b/owl-bot-staging/google-cloud-scheduler-v1/.gitignore new file mode 100644 index 000000000000..0135b6bc6cfc --- /dev/null +++ b/owl-bot-staging/google-cloud-scheduler-v1/.gitignore @@ -0,0 +1,22 @@ +# Ignore bundler lockfiles +Gemfile.lock +gems.locked + +# Ignore documentation output +doc/* +.yardoc/* + +# Ignore test output +coverage/* + +# Ignore build artifacts +pkg/* + +# Ignore files commonly present in certain dev environments +.vagrant +.DS_STORE +.idea +*.iml + +# Ignore synth output +__pycache__ diff --git a/owl-bot-staging/google-cloud-scheduler-v1/.repo-metadata.json b/owl-bot-staging/google-cloud-scheduler-v1/.repo-metadata.json new file mode 100644 index 000000000000..fd620042e2d3 --- /dev/null +++ b/owl-bot-staging/google-cloud-scheduler-v1/.repo-metadata.json @@ -0,0 +1,18 @@ +{ + "api_id": "cloudscheduler.googleapis.com", + "api_shortname": "cloudscheduler", + "client_documentation": "https://cloud.google.com/ruby/docs/reference/google-cloud-scheduler-v1/latest", + "distribution_name": "google-cloud-scheduler-v1", + "is_cloud": true, + "language": "ruby", + "name": "cloudscheduler", + "name_pretty": "Cloud Scheduler V1 API", + "product_documentation": "https://cloud.google.com/scheduler", + "release_level": "unreleased", + "repo": "googleapis/google-cloud-ruby", + "requires_billing": true, + "ruby-cloud-description": "Cloud Scheduler is a fully managed enterprise-grade cron job scheduler. It allows you to schedule virtually any job, including batch, big data jobs, cloud infrastructure operations, and more. You can automate everything, including retries in case of failure to reduce manual toil and intervention. Cloud Scheduler even acts as a single pane of glass, allowing you to manage all your automation tasks from one place. Note that google-cloud-scheduler-v1 is a version-specific client library. For most uses, we recommend installing the main client library google-cloud-scheduler instead. See the readme for more details.", + "ruby-cloud-env-prefix": "SCHEDULER", + "ruby-cloud-product-url": "https://cloud.google.com/scheduler", + "library_type": "GAPIC_AUTO" +} diff --git a/owl-bot-staging/google-cloud-scheduler-v1/.rubocop.yml b/owl-bot-staging/google-cloud-scheduler-v1/.rubocop.yml new file mode 100644 index 000000000000..1aa300a65945 --- /dev/null +++ b/owl-bot-staging/google-cloud-scheduler-v1/.rubocop.yml @@ -0,0 +1,33 @@ +inherit_gem: + google-style: google-style.yml + +AllCops: + Exclude: + - "google-cloud-scheduler-v1.gemspec" + - "lib/**/*_pb.rb" + - "proto_docs/**/*" + - "test/**/*" + - "acceptance/**/*" + - "samples/acceptance/**/*" + - "Rakefile" + +Layout/LineLength: + Enabled: false +Metrics/AbcSize: + Enabled: false +Metrics/ClassLength: + Enabled: false +Metrics/CyclomaticComplexity: + Enabled: false +Metrics/MethodLength: + Enabled: false +Metrics/ModuleLength: + Enabled: false +Metrics/PerceivedComplexity: + Enabled: false +Naming/AccessorMethodName: + Exclude: + - "snippets/**/*.rb" +Naming/FileName: + Exclude: + - "lib/google-cloud-scheduler-v1.rb" diff --git a/owl-bot-staging/google-cloud-scheduler-v1/.toys.rb b/owl-bot-staging/google-cloud-scheduler-v1/.toys.rb new file mode 100644 index 000000000000..177e22456e8a --- /dev/null +++ b/owl-bot-staging/google-cloud-scheduler-v1/.toys.rb @@ -0,0 +1,28 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +toys_version! ">= 0.15.3" + +if ENV["RUBY_COMMON_TOOLS"] + common_tools_dir = File.expand_path ENV["RUBY_COMMON_TOOLS"] + load File.join(common_tools_dir, "toys", "gapic") +else + load_git remote: "https://github.com/googleapis/ruby-common-tools.git", + path: "toys/gapic", + update: true +end diff --git a/owl-bot-staging/google-cloud-scheduler-v1/.yardopts b/owl-bot-staging/google-cloud-scheduler-v1/.yardopts new file mode 100644 index 000000000000..dacf43e29c36 --- /dev/null +++ b/owl-bot-staging/google-cloud-scheduler-v1/.yardopts @@ -0,0 +1,12 @@ +--no-private +--title="Cloud Scheduler V1 API" +--exclude _pb\.rb$ +--markup markdown +--markup-provider redcarpet + +./lib/**/*.rb +./proto_docs/**/*.rb +- +README.md +LICENSE.md +AUTHENTICATION.md diff --git a/owl-bot-staging/google-cloud-scheduler-v1/AUTHENTICATION.md b/owl-bot-staging/google-cloud-scheduler-v1/AUTHENTICATION.md new file mode 100644 index 000000000000..b1f5a6bb6432 --- /dev/null +++ b/owl-bot-staging/google-cloud-scheduler-v1/AUTHENTICATION.md @@ -0,0 +1,122 @@ +# Authentication + +The recommended way to authenticate to the google-cloud-scheduler-v1 library is to use +[Application Default Credentials (ADC)](https://cloud.google.com/docs/authentication/application-default-credentials). +To review all of your authentication options, see [Credentials lookup](#credential-lookup). + +## Quickstart + +The following example shows how to set up authentication for a local development +environment with your user credentials. + +**NOTE:** This method is _not_ recommended for running in production. User credentials +should be used only during development. + +1. [Download and install the Google Cloud CLI](https://cloud.google.com/sdk). +2. Set up a local ADC file with your user credentials: + +```sh +gcloud auth application-default login +``` + +3. Write code as if already authenticated. + +For more information about setting up authentication for a local development environment, see +[Set up Application Default Credentials](https://cloud.google.com/docs/authentication/provide-credentials-adc#local-dev). + +## Credential Lookup + +The google-cloud-scheduler-v1 library provides several mechanisms to configure your system. +Generally, using Application Default Credentials to facilitate automatic +credentials discovery is the easist method. But if you need to explicitly specify +credentials, there are several methods available to you. + +Credentials are accepted in the following ways, in the following order or precedence: + +1. Credentials specified in method arguments +2. Credentials specified in configuration +3. Credentials pointed to or included in environment variables +4. Credentials found in local ADC file +5. Credentials returned by the metadata server for the attached service account (GCP) + +### Configuration + +You can configure a path to a JSON credentials file, either for an individual client object or +globally, for all client objects. The JSON file can contain credentials created for +[workload identity federation](https://cloud.google.com/iam/docs/workload-identity-federation), +[workforce identity federation](https://cloud.google.com/iam/docs/workforce-identity-federation), or a +[service account key](https://cloud.google.com/docs/authentication/provide-credentials-adc#local-key). + +Note: Service account keys are a security risk if not managed correctly. You should +[choose a more secure alternative to service account keys](https://cloud.google.com/docs/authentication#auth-decision-tree) +whenever possible. + +To configure a credentials file for an individual client initialization: + +```ruby +require "google/cloud/scheduler/v1" + +client = ::Google::Cloud::Scheduler::V1::CloudScheduler::Client.new do |config| + config.credentials = "path/to/credentialfile.json" +end +``` + +To configure a credentials file globally for all clients: + +```ruby +require "google/cloud/scheduler/v1" + +::Google::Cloud::Scheduler::V1::CloudScheduler::Client.configure do |config| + config.credentials = "path/to/credentialfile.json" +end + +client = ::Google::Cloud::Scheduler::V1::CloudScheduler::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-scheduler-v1 +checks for credentials are: + +* `GOOGLE_CLOUD_CREDENTIALS` - Path to JSON file, or JSON contents +* `GOOGLE_APPLICATION_CREDENTIALS` - Path to JSON file + +```ruby +require "google/cloud/scheduler/v1" + +ENV["GOOGLE_APPLICATION_CREDENTIALS"] = "path/to/credentialfile.json" + +client = ::Google::Cloud::Scheduler::V1::CloudScheduler::Client.new +``` + +### Local ADC file + +You can set up a local ADC file with your user credentials for authentication during +development. If credentials are not provided in code or in environment variables, +then the local ADC credentials are discovered. + +Follow the steps in [Quickstart](#quickstart) to set up a local ADC file. + +### Google Cloud Platform environments + +When running on Google Cloud Platform (GCP), including Google Compute Engine +(GCE), Google Kubernetes Engine (GKE), Google App Engine (GAE), Google Cloud +Functions (GCF) and Cloud Run, credentials are retrieved from the attached +service account automatically. Code should be written as if already authenticated. + +For more information, see +[Set up ADC for Google Cloud services](https://cloud.google.com/docs/authentication/provide-credentials-adc#attached-sa). diff --git a/owl-bot-staging/google-cloud-scheduler-v1/CHANGELOG.md b/owl-bot-staging/google-cloud-scheduler-v1/CHANGELOG.md new file mode 100644 index 000000000000..f88957a62ba2 --- /dev/null +++ b/owl-bot-staging/google-cloud-scheduler-v1/CHANGELOG.md @@ -0,0 +1,2 @@ +# Release History + diff --git a/owl-bot-staging/google-cloud-scheduler-v1/Gemfile b/owl-bot-staging/google-cloud-scheduler-v1/Gemfile new file mode 100644 index 000000000000..1d08558908d8 --- /dev/null +++ b/owl-bot-staging/google-cloud-scheduler-v1/Gemfile @@ -0,0 +1,14 @@ +source "https://rubygems.org" + +gemspec + +gem "google-style", "~> 1.32.0" +gem "irb", "~> 1.17" +gem "minitest", "~> 6.0.2" +gem "minitest-focus", "~> 1.4" +gem "minitest-mock", "~> 5.27" +gem "minitest-rg", "~> 5.3" +gem "ostruct", "~> 0.5.5" +gem "rake", ">= 13.0" +gem "redcarpet", "~> 3.6" +gem "yard", "~> 0.9" diff --git a/owl-bot-staging/google-cloud-scheduler-v1/LICENSE.md b/owl-bot-staging/google-cloud-scheduler-v1/LICENSE.md new file mode 100644 index 000000000000..c261857ba6ad --- /dev/null +++ b/owl-bot-staging/google-cloud-scheduler-v1/LICENSE.md @@ -0,0 +1,201 @@ + Apache License + Version 2.0, January 2004 + http://www.apache.org/licenses/ + + TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION + + 1. Definitions. + + "License" shall mean the terms and conditions for use, reproduction, + and distribution as defined by Sections 1 through 9 of this document. + + "Licensor" shall mean the copyright owner or entity authorized by + the copyright owner that is granting the License. + + "Legal Entity" shall mean the union of the acting entity and all + other entities that control, are controlled by, or are under common + control with that entity. For the purposes of this definition, + "control" means (i) the power, direct or indirect, to cause the + direction or management of such entity, whether by contract or + otherwise, or (ii) ownership of fifty percent (50%) or more of the + outstanding shares, or (iii) beneficial ownership of such entity. + + "You" (or "Your") shall mean an individual or Legal Entity + exercising permissions granted by this License. + + "Source" form shall mean the preferred form for making modifications, + including but not limited to software source code, documentation + source, and configuration files. + + "Object" form shall mean any form resulting from mechanical + transformation or translation of a Source form, including but + not limited to compiled object code, generated documentation, + and conversions to other media types. + + "Work" shall mean the work of authorship, whether in Source or + Object form, made available under the License, as indicated by a + copyright notice that is included in or attached to the work + (an example is provided in the Appendix below). + + "Derivative Works" shall mean any work, whether in Source or Object + form, that is based on (or derived from) the Work and for which the + editorial revisions, annotations, elaborations, or other modifications + represent, as a whole, an original work of authorship. For the purposes + of this License, Derivative Works shall not include works that remain + separable from, or merely link (or bind by name) to the interfaces of, + the Work and Derivative Works thereof. + + "Contribution" shall mean any work of authorship, including + the original version of the Work and any modifications or additions + to that Work or Derivative Works thereof, that is intentionally + submitted to Licensor for inclusion in the Work by the copyright owner + or by an individual or Legal Entity authorized to submit on behalf of + the copyright owner. For the purposes of this definition, "submitted" + means any form of electronic, verbal, or written communication sent + to the Licensor or its representatives, including but not limited to + communication on electronic mailing lists, source code control systems, + and issue tracking systems that are managed by, or on behalf of, the + Licensor for the purpose of discussing and improving the Work, but + excluding communication that is conspicuously marked or otherwise + designated in writing by the copyright owner as "Not a Contribution." + + "Contributor" shall mean Licensor and any individual or Legal Entity + on behalf of whom a Contribution has been received by Licensor and + subsequently incorporated within the Work. + + 2. Grant of Copyright License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + copyright license to reproduce, prepare Derivative Works of, + publicly display, publicly perform, sublicense, and distribute the + Work and such Derivative Works in Source or Object form. + + 3. Grant of Patent License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + (except as stated in this section) patent license to make, have made, + use, offer to sell, sell, import, and otherwise transfer the Work, + where such license applies only to those patent claims licensable + by such Contributor that are necessarily infringed by their + Contribution(s) alone or by combination of their Contribution(s) + with the Work to which such Contribution(s) was submitted. If You + institute patent litigation against any entity (including a + cross-claim or counterclaim in a lawsuit) alleging that the Work + or a Contribution incorporated within the Work constitutes direct + or contributory patent infringement, then any patent licenses + granted to You under this License for that Work shall terminate + as of the date such litigation is filed. + + 4. Redistribution. You may reproduce and distribute copies of the + Work or Derivative Works thereof in any medium, with or without + modifications, and in Source or Object form, provided that You + meet the following conditions: + + (a) You must give any other recipients of the Work or + Derivative Works a copy of this License; and + + (b) You must cause any modified files to carry prominent notices + stating that You changed the files; and + + (c) You must retain, in the Source form of any Derivative Works + that You distribute, all copyright, patent, trademark, and + attribution notices from the Source form of the Work, + excluding those notices that do not pertain to any part of + the Derivative Works; and + + (d) If the Work includes a "NOTICE" text file as part of its + distribution, then any Derivative Works that You distribute must + include a readable copy of the attribution notices contained + within such NOTICE file, excluding those notices that do not + pertain to any part of the Derivative Works, in at least one + of the following places: within a NOTICE text file distributed + as part of the Derivative Works; within the Source form or + documentation, if provided along with the Derivative Works; or, + within a display generated by the Derivative Works, if and + wherever such third-party notices normally appear. The contents + of the NOTICE file are for informational purposes only and + do not modify the License. You may add Your own attribution + notices within Derivative Works that You distribute, alongside + or as an addendum to the NOTICE text from the Work, provided + that such additional attribution notices cannot be construed + as modifying the License. + + You may add Your own copyright statement to Your modifications and + may provide additional or different license terms and conditions + for use, reproduction, or distribution of Your modifications, or + for any such Derivative Works as a whole, provided Your use, + reproduction, and distribution of the Work otherwise complies with + the conditions stated in this License. + + 5. Submission of Contributions. Unless You explicitly state otherwise, + any Contribution intentionally submitted for inclusion in the Work + by You to the Licensor shall be under the terms and conditions of + this License, without any additional terms or conditions. + Notwithstanding the above, nothing herein shall supersede or modify + the terms of any separate license agreement you may have executed + with Licensor regarding such Contributions. + + 6. Trademarks. This License does not grant permission to use the trade + names, trademarks, service marks, or product names of the Licensor, + except as required for reasonable and customary use in describing the + origin of the Work and reproducing the content of the NOTICE file. + + 7. Disclaimer of Warranty. Unless required by applicable law or + agreed to in writing, Licensor provides the Work (and each + Contributor provides its Contributions) on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or + implied, including, without limitation, any warranties or conditions + of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A + PARTICULAR PURPOSE. You are solely responsible for determining the + appropriateness of using or redistributing the Work and assume any + risks associated with Your exercise of permissions under this License. + + 8. Limitation of Liability. In no event and under no legal theory, + whether in tort (including negligence), contract, or otherwise, + unless required by applicable law (such as deliberate and grossly + negligent acts) or agreed to in writing, shall any Contributor be + liable to You for damages, including any direct, indirect, special, + incidental, or consequential damages of any character arising as a + result of this License or out of the use or inability to use the + Work (including but not limited to damages for loss of goodwill, + work stoppage, computer failure or malfunction, or any and all + other commercial damages or losses), even if such Contributor + has been advised of the possibility of such damages. + + 9. Accepting Warranty or Additional Liability. While redistributing + the Work or Derivative Works thereof, You may choose to offer, + and charge a fee for, acceptance of support, warranty, indemnity, + or other liability obligations and/or rights consistent with this + License. However, in accepting such obligations, You may act only + on Your own behalf and on Your sole responsibility, not on behalf + of any other Contributor, and only if You agree to indemnify, + defend, and hold each Contributor harmless for any liability + incurred by, or claims asserted against, such Contributor by reason + of your accepting any such warranty or additional liability. + + END OF TERMS AND CONDITIONS + + APPENDIX: How to apply the Apache License to your work. + + To apply the Apache License to your work, attach the following + boilerplate notice, with the fields enclosed by brackets "[]" + replaced with your own identifying information. (Don't include + the brackets!) The text should be enclosed in the appropriate + comment syntax for the file format. We also recommend that a + file or class name and description of purpose be included on the + same "printed page" as the copyright notice for easier + identification within third-party archives. + + Copyright [yyyy] [name of copyright owner] + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. diff --git a/owl-bot-staging/google-cloud-scheduler-v1/README.md b/owl-bot-staging/google-cloud-scheduler-v1/README.md new file mode 100644 index 000000000000..d6f063bc8627 --- /dev/null +++ b/owl-bot-staging/google-cloud-scheduler-v1/README.md @@ -0,0 +1,154 @@ +# Ruby Client for the Cloud Scheduler V1 API + +Creates and manages jobs run on a regular recurring schedule. + +Cloud Scheduler is a fully managed enterprise-grade cron job scheduler. It allows you to schedule virtually any job, including batch, big data jobs, cloud infrastructure operations, and more. You can automate everything, including retries in case of failure to reduce manual toil and intervention. Cloud Scheduler even acts as a single pane of glass, allowing you to manage all your automation tasks from one place. + +https://github.com/googleapis/google-cloud-ruby + +This gem is a _versioned_ client. It provides basic client classes for a +specific version of the Cloud Scheduler V1 API. Most users should consider using +the main client gem, +[google-cloud-scheduler](https://rubygems.org/gems/google-cloud-scheduler). +See the section below titled *Which client should I use?* for more information. + +## Installation + +``` +$ gem install google-cloud-scheduler-v1 +``` + +## Before You Begin + +In order to use this library, you first need to go through the following steps: + +1. [Select or create a Cloud Platform project.](https://console.cloud.google.com/project) +1. [Enable billing for your project.](https://cloud.google.com/billing/docs/how-to/modify-project#enable_billing_for_a_project) +1. [Enable the API.](https://console.cloud.google.com/apis/library/cloudscheduler.googleapis.com) +1. [Set up authentication.](AUTHENTICATION.md) + +## Quick Start + +```ruby +require "google/cloud/scheduler/v1" + +client = ::Google::Cloud::Scheduler::V1::CloudScheduler::Client.new +request = ::Google::Cloud::Scheduler::V1::ListJobsRequest.new # (request fields as keyword arguments...) +response = client.list_jobs request +``` + +View the [Client Library Documentation](https://cloud.google.com/ruby/docs/reference/google-cloud-scheduler-v1/latest) +for class and method documentation. + +See also the [Product Documentation](https://cloud.google.com/scheduler) +for general usage information. + +## Debug Logging + +This library comes with opt-in Debug Logging that can help you troubleshoot +your application's integration with the API. When logging is activated, key +events such as requests and responses, along with data payloads and metadata +such as headers and client configuration, are logged to the standard error +stream. + +**WARNING:** Client Library Debug Logging includes your data payloads in +plaintext, which could include sensitive data such as PII for yourself or your +customers, private keys, or other security data that could be compromising if +leaked. Always practice good data hygiene with your application logs, and follow +the principle of least access. Google also recommends that Client Library Debug +Logging be enabled only temporarily during active debugging, and not used +permanently in production. + +To enable logging, set the environment variable `GOOGLE_SDK_RUBY_LOGGING_GEMS` +to the value `all`. Alternatively, you can set the value to a comma-delimited +list of client library gem names. This will select the default logging behavior, +which writes logs to the standard error stream. On a local workstation, this may +result in logs appearing on the console. When running on a Google Cloud hosting +service such as [Google Cloud Run](https://cloud.google.com/run), this generally +results in logs appearing alongside your application logs in the +[Google Cloud Logging](https://cloud.google.com/logging/) service. + +You can customize logging by modifying the `logger` configuration when +constructing a client object. For example: + +```ruby +require "google/cloud/scheduler/v1" +require "logger" + +client = ::Google::Cloud::Scheduler::V1::CloudScheduler::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-scheduler`, +and lower-level _versioned_ client libraries with names such as +`google-cloud-scheduler-v1`. +_In most cases, you should install the main client._ + +### What's the difference between the main client and a versioned client? + +A _versioned client_ provides a basic set of data types and client classes for +a _single version_ of a specific service. (That is, for a service with multiple +versions, there might be a separate versioned client for each service version.) +Most versioned clients are written and maintained by a code generator. + +The _main client_ is designed to provide you with the _recommended_ client +interfaces for the service. There will be only one main client for any given +service, even a service with multiple versions. The main client includes +factory methods for constructing the client objects we recommend for most +users. In some cases, those will be classes provided by an underlying versioned +client; in other cases, they will be handwritten higher-level client objects +with additional capabilities, convenience methods, or best practices built in. +Generally, the main client will default to a recommended service version, +although in some cases you can override this if you need to talk to a specific +service version. + +### Why would I want to use the main client? + +We recommend that most users install the main client gem for a service. You can +identify this gem as the one _without_ a version in its name, e.g. +`google-cloud-scheduler`. +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-scheduler-v1`. + +### What about the google-apis- clients? + +Client library gems with names that begin with `google-apis-` are based on an +older code generation technology. They talk to a REST/JSON backend (whereas +most modern clients talk to a [gRPC](https://grpc.io/) backend) and they may +not offer the same performance, features, and ease of use provided by more +modern clients. + +The `google-apis-` clients have wide coverage across Google services, so you +might need to use one if there is no modern client available for the service. +However, if a modern client is available, we generally recommend it over the +older `google-apis-` clients. diff --git a/owl-bot-staging/google-cloud-scheduler-v1/Rakefile b/owl-bot-staging/google-cloud-scheduler-v1/Rakefile new file mode 100644 index 000000000000..8144c51373a5 --- /dev/null +++ b/owl-bot-staging/google-cloud-scheduler-v1/Rakefile @@ -0,0 +1,169 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +require "bundler/setup" +require "bundler/gem_tasks" + +require "rubocop/rake_task" +RuboCop::RakeTask.new + +require "rake/testtask" +desc "Run tests." +Rake::TestTask.new do |t| + t.libs << "test" + t.test_files = FileList["test/**/*_test.rb"] + t.warning = false +end + +desc "Runs the smoke tests." +Rake::TestTask.new :smoke_test do |t| + t.test_files = FileList["acceptance/**/*smoke_test.rb"] + t.warning = false +end + +# Acceptance tests +desc "Run the google-cloud-scheduler-v1 acceptance tests." +task :acceptance, :project, :keyfile do |t, args| + project = args[:project] + project ||= + ENV["SCHEDULER_TEST_PROJECT"] || + ENV["GCLOUD_TEST_PROJECT"] + keyfile = args[:keyfile] + keyfile ||= + ENV["SCHEDULER_TEST_KEYFILE"] || + ENV["GCLOUD_TEST_KEYFILE"] + if keyfile + keyfile = File.read keyfile + else + keyfile ||= + ENV["SCHEDULER_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 SCHEDULER_TEST_PROJECT=test123 SCHEDULER_TEST_KEYFILE=/path/to/keyfile.json rake acceptance" + end + require "google/cloud/scheduler/v1/cloud_scheduler/credentials" + ::Google::Cloud::Scheduler::V1::CloudScheduler::Credentials.env_vars.each do |path| + ENV[path] = nil + end + ENV["SCHEDULER_PROJECT"] = project + ENV["SCHEDULER_TEST_PROJECT"] = project + ENV["SCHEDULER_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-scheduler-v1 gem has no acceptance tests." + end + end + + desc "Run acceptance cleanup." + task :cleanup do + end +end + +task :samples do + Rake::Task["samples:latest"].invoke +end + +namespace :samples do + task :latest do + if File.directory? "samples" + Dir.chdir "samples" do + Bundler.with_clean_env do + ENV["GOOGLE_CLOUD_SAMPLES_TEST"] = "not_master" + sh "bundle update" + sh "bundle exec rake test" + end + end + else + puts "The google-cloud-scheduler-v1 gem has no samples to test." + end + end + + task :master do + if File.directory? "samples" + Dir.chdir "samples" do + Bundler.with_clean_env do + ENV["GOOGLE_CLOUD_SAMPLES_TEST"] = "master" + sh "bundle update" + sh "bundle exec rake test" + end + end + else + puts "The google-cloud-scheduler-v1 gem has no samples to test." + end + end +end + +require "yard" +require "yard/rake/yardoc_task" +YARD::Rake::YardocTask.new do |y| + y.options << "--fail-on-warning" +end + +desc "Run yard-doctest example tests." +task :doctest do + puts "The google-cloud-scheduler-v1 gem does not have doctest tests." +end + +desc "Run the CI build" +task :ci do + header "BUILDING google-cloud-scheduler-v1" + header "google-cloud-scheduler-v1 rubocop", "*" + Rake::Task[:rubocop].invoke + header "google-cloud-scheduler-v1 yard", "*" + Rake::Task[:yard].invoke + header "google-cloud-scheduler-v1 test", "*" + Rake::Task[:test].invoke +end + +namespace :ci do + desc "Run the CI build, with smoke tests." + task :smoke_test do + Rake::Task[:ci].invoke + header "google-cloud-scheduler-v1 smoke_test", "*" + Rake::Task[:smoke_test].invoke + end + desc "Run the CI build, with acceptance tests." + task :acceptance do + Rake::Task[:ci].invoke + header "google-cloud-scheduler-v1 acceptance", "*" + Rake::Task[:acceptance].invoke + end + task :a do + # This is a handy shortcut to save typing + Rake::Task["ci:acceptance"].invoke + end +end + +task default: :test + +def header str, token = "#" + line_length = str.length + 8 + puts "" + puts token * line_length + puts "#{token * 3} #{str} #{token * 3}" + puts token * line_length + puts "" +end diff --git a/owl-bot-staging/google-cloud-scheduler-v1/gapic_metadata.json b/owl-bot-staging/google-cloud-scheduler-v1/gapic_metadata.json new file mode 100644 index 000000000000..df9b4bb49562 --- /dev/null +++ b/owl-bot-staging/google-cloud-scheduler-v1/gapic_metadata.json @@ -0,0 +1,58 @@ +{ + "schema": "1.0", + "comment": "This file maps proto services/RPCs to the corresponding library clients/methods", + "language": "ruby", + "protoPackage": "google.cloud.scheduler.v1", + "libraryPackage": "::Google::Cloud::Scheduler::V1", + "services": { + "CloudScheduler": { + "clients": { + "grpc": { + "libraryClient": "::Google::Cloud::Scheduler::V1::CloudScheduler::Client", + "rpcs": { + "ListJobs": { + "methods": [ + "list_jobs" + ] + }, + "GetJob": { + "methods": [ + "get_job" + ] + }, + "CreateJob": { + "methods": [ + "create_job" + ] + }, + "UpdateJob": { + "methods": [ + "update_job" + ] + }, + "DeleteJob": { + "methods": [ + "delete_job" + ] + }, + "PauseJob": { + "methods": [ + "pause_job" + ] + }, + "ResumeJob": { + "methods": [ + "resume_job" + ] + }, + "RunJob": { + "methods": [ + "run_job" + ] + } + } + } + } + } + } +} diff --git a/owl-bot-staging/google-cloud-scheduler-v1/google-cloud-scheduler-v1.gemspec b/owl-bot-staging/google-cloud-scheduler-v1/google-cloud-scheduler-v1.gemspec new file mode 100644 index 000000000000..32cf7c515b50 --- /dev/null +++ b/owl-bot-staging/google-cloud-scheduler-v1/google-cloud-scheduler-v1.gemspec @@ -0,0 +1,29 @@ +# -*- ruby -*- +# encoding: utf-8 + +require File.expand_path("lib/google/cloud/scheduler/v1/version", __dir__) + +Gem::Specification.new do |gem| + gem.name = "google-cloud-scheduler-v1" + gem.version = Google::Cloud::Scheduler::V1::VERSION + + gem.authors = ["Google LLC"] + gem.email = "googleapis-packages@google.com" + gem.description = "Cloud Scheduler is a fully managed enterprise-grade cron job scheduler. It allows you to schedule virtually any job, including batch, big data jobs, cloud infrastructure operations, and more. You can automate everything, including retries in case of failure to reduce manual toil and intervention. Cloud Scheduler even acts as a single pane of glass, allowing you to manage all your automation tasks from one place. Note that google-cloud-scheduler-v1 is a version-specific client library. For most uses, we recommend installing the main client library google-cloud-scheduler instead. See the readme for more details." + gem.summary = "Creates and manages jobs run on a regular recurring schedule." + 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-cloud-scheduler-v1/lib/google-cloud-scheduler-v1.rb b/owl-bot-staging/google-cloud-scheduler-v1/lib/google-cloud-scheduler-v1.rb new file mode 100644 index 000000000000..0b7eee484b27 --- /dev/null +++ b/owl-bot-staging/google-cloud-scheduler-v1/lib/google-cloud-scheduler-v1.rb @@ -0,0 +1,21 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +# This gem does not autoload during Bundler.require. To load this gem, +# issue explicit require statements for the packages desired, e.g.: +# require "google/cloud/scheduler/v1" diff --git a/owl-bot-staging/google-cloud-scheduler-v1/lib/google/cloud/scheduler/v1.rb b/owl-bot-staging/google-cloud-scheduler-v1/lib/google/cloud/scheduler/v1.rb new file mode 100644 index 000000000000..5f416675c340 --- /dev/null +++ b/owl-bot-staging/google-cloud-scheduler-v1/lib/google/cloud/scheduler/v1.rb @@ -0,0 +1,45 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +require "google/cloud/scheduler/v1/cloud_scheduler" +require "google/cloud/scheduler/v1/version" + +module Google + module Cloud + module Scheduler + ## + # API client module. + # + # @example Load this package, including all its services, and instantiate a gRPC client + # + # require "google/cloud/scheduler/v1" + # client = ::Google::Cloud::Scheduler::V1::CloudScheduler::Client.new + # + # @example Load this package, including all its services, and instantiate a REST client + # + # require "google/cloud/scheduler/v1" + # client = ::Google::Cloud::Scheduler::V1::CloudScheduler::Rest::Client.new + # + module V1 + end + end + end +end + +helper_path = ::File.join __dir__, "v1", "_helpers.rb" +require "google/cloud/scheduler/v1/_helpers" if ::File.file? helper_path diff --git a/owl-bot-staging/google-cloud-scheduler-v1/lib/google/cloud/scheduler/v1/bindings_override.rb b/owl-bot-staging/google-cloud-scheduler-v1/lib/google/cloud/scheduler/v1/bindings_override.rb new file mode 100644 index 000000000000..1da2ab067f2d --- /dev/null +++ b/owl-bot-staging/google-cloud-scheduler-v1/lib/google/cloud/scheduler/v1/bindings_override.rb @@ -0,0 +1,75 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +require "gapic/rest" + +module Google + module Cloud + module Scheduler + ## + # @example Loading just the REST part of this package, including all its services, and instantiating a REST client + # + # require "google/cloud/scheduler/v1/rest" + # client = ::Google::Cloud::Scheduler::V1::CloudScheduler::Rest::Client.new + # + module V1 + ## + # @private + # Initialize the mixin bindings configuration + # + def self.configure + @configure ||= begin + namespace = ["Google", "Cloud", "Scheduler"] + parent_config = while namespace.any? + parent_name = namespace.join "::" + parent_const = const_get parent_name + break parent_const.configure if parent_const.respond_to? :configure + namespace.pop + end + + default_config = ::Gapic::Rest::HttpBindingOverrideConfiguration.new parent_config + default_config.bindings_override["google.cloud.location.Locations.GetLocation"] = [ + Gapic::Rest::GrpcTranscoder::HttpBinding.create_with_validation( + uri_method: :get, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/?$}, false] + ], + body: nil + ) + ] + default_config.bindings_override["google.cloud.location.Locations.ListLocations"] = [ + + Gapic::Rest::GrpcTranscoder::HttpBinding.create_with_validation( + uri_method: :get, + uri_template: "/v1/{name}/locations", + matches: [ + ["name", %r{^projects/[^/]+/?$}, false] + ], + body: nil + ) + ] + default_config + end + yield @configure if block_given? + @configure + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-scheduler-v1/lib/google/cloud/scheduler/v1/cloud_scheduler.rb b/owl-bot-staging/google-cloud-scheduler-v1/lib/google/cloud/scheduler/v1/cloud_scheduler.rb new file mode 100644 index 000000000000..2c0701522319 --- /dev/null +++ b/owl-bot-staging/google-cloud-scheduler-v1/lib/google/cloud/scheduler/v1/cloud_scheduler.rb @@ -0,0 +1,56 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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/scheduler/v1/version" + +require "google/cloud/scheduler/v1/cloud_scheduler/credentials" +require "google/cloud/scheduler/v1/cloud_scheduler/paths" +require "google/cloud/scheduler/v1/cloud_scheduler/client" +require "google/cloud/scheduler/v1/cloud_scheduler/rest" + +module Google + module Cloud + module Scheduler + module V1 + ## + # The Cloud Scheduler API allows external entities to reliably + # schedule asynchronous jobs. + # + # @example Load this service and instantiate a gRPC client + # + # require "google/cloud/scheduler/v1/cloud_scheduler" + # client = ::Google::Cloud::Scheduler::V1::CloudScheduler::Client.new + # + # @example Load this service and instantiate a REST client + # + # require "google/cloud/scheduler/v1/cloud_scheduler/rest" + # client = ::Google::Cloud::Scheduler::V1::CloudScheduler::Rest::Client.new + # + module CloudScheduler + end + end + end + end +end + +helper_path = ::File.join __dir__, "cloud_scheduler", "helpers.rb" +require "google/cloud/scheduler/v1/cloud_scheduler/helpers" if ::File.file? helper_path diff --git a/owl-bot-staging/google-cloud-scheduler-v1/lib/google/cloud/scheduler/v1/cloud_scheduler/client.rb b/owl-bot-staging/google-cloud-scheduler-v1/lib/google/cloud/scheduler/v1/cloud_scheduler/client.rb new file mode 100644 index 000000000000..b4a3e2d51493 --- /dev/null +++ b/owl-bot-staging/google-cloud-scheduler-v1/lib/google/cloud/scheduler/v1/cloud_scheduler/client.rb @@ -0,0 +1,1229 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +require "google/cloud/errors" +require "google/cloud/scheduler/v1/cloudscheduler_pb" +require "google/cloud/location" + +module Google + module Cloud + module Scheduler + module V1 + module CloudScheduler + ## + # Client for the CloudScheduler service. + # + # The Cloud Scheduler API allows external entities to reliably + # schedule asynchronous jobs. + # + class Client + # @private + API_VERSION = "" + + # @private + DEFAULT_ENDPOINT_TEMPLATE = "cloudscheduler.$UNIVERSE_DOMAIN$" + + include Paths + + # @private + attr_reader :cloud_scheduler_stub + + ## + # Configure the CloudScheduler Client class. + # + # See {::Google::Cloud::Scheduler::V1::CloudScheduler::Client::Configuration} + # for a description of the configuration fields. + # + # @example + # + # # Modify the configuration for all CloudScheduler clients + # ::Google::Cloud::Scheduler::V1::CloudScheduler::Client.configure do |config| + # config.timeout = 10.0 + # end + # + # @yield [config] Configure the Client client. + # @yieldparam config [Client::Configuration] + # + # @return [Client::Configuration] + # + def self.configure + @configure ||= begin + namespace = ["Google", "Cloud", "Scheduler", "V1"] + parent_config = while namespace.any? + parent_name = namespace.join "::" + parent_const = const_get parent_name + break parent_const.configure if parent_const.respond_to? :configure + namespace.pop + end + default_config = Client::Configuration.new parent_config + + default_config.rpcs.list_jobs.timeout = 600.0 + default_config.rpcs.list_jobs.retry_policy = { + initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [4, 14] + } + + default_config.rpcs.get_job.timeout = 600.0 + default_config.rpcs.get_job.retry_policy = { + initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [4, 14] + } + + default_config.rpcs.create_job.timeout = 600.0 + + default_config.rpcs.update_job.timeout = 600.0 + + default_config.rpcs.delete_job.timeout = 600.0 + default_config.rpcs.delete_job.retry_policy = { + initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [4, 14] + } + + default_config.rpcs.pause_job.timeout = 600.0 + + default_config.rpcs.resume_job.timeout = 600.0 + + default_config.rpcs.run_job.timeout = 600.0 + + default_config + end + yield @configure if block_given? + @configure + end + + ## + # Configure the CloudScheduler Client instance. + # + # The configuration is set to the derived mode, meaning that values can be changed, + # but structural changes (adding new fields, etc.) are not allowed. Structural changes + # should be made on {Client.configure}. + # + # See {::Google::Cloud::Scheduler::V1::CloudScheduler::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 + @cloud_scheduler_stub.universe_domain + end + + ## + # Create a new CloudScheduler client object. + # + # @example + # + # # Create a client using the default configuration + # client = ::Google::Cloud::Scheduler::V1::CloudScheduler::Client.new + # + # # Create a client using a custom configuration + # client = ::Google::Cloud::Scheduler::V1::CloudScheduler::Client.new do |config| + # config.timeout = 10.0 + # end + # + # @yield [config] Configure the CloudScheduler client. + # @yieldparam config [Client::Configuration] + # + def initialize + # These require statements are intentionally placed here to initialize + # the gRPC module only when it's required. + # See https://github.com/googleapis/toolkit/issues/446 + require "gapic/grpc" + require "google/cloud/scheduler/v1/cloudscheduler_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 + + @cloud_scheduler_stub = ::Gapic::ServiceStub.new( + ::Google::Cloud::Scheduler::V1::CloudScheduler::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 + ) + + @cloud_scheduler_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 = @cloud_scheduler_stub.endpoint + config.universe_domain = @cloud_scheduler_stub.universe_domain + config.logger = @cloud_scheduler_stub.logger if config.respond_to? :logger= + end + end + + ## + # Get the associated client for mix-in of the Locations. + # + # @return [Google::Cloud::Location::Locations::Client] + # + attr_reader :location_client + + ## + # The logger used for request/response debug logging. + # + # @return [Logger] + # + def logger + @cloud_scheduler_stub.logger + end + + # Service calls + + ## + # Lists jobs. + # + # @overload list_jobs(request, options = nil) + # Pass arguments to `list_jobs` via a request object, either of type + # {::Google::Cloud::Scheduler::V1::ListJobsRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Scheduler::V1::ListJobsRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. + # + # @overload list_jobs(parent: nil, page_size: nil, page_token: nil) + # Pass arguments to `list_jobs` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param parent [::String] + # Required. The location name. For example: + # `projects/PROJECT_ID/locations/LOCATION_ID`. + # @param page_size [::Integer] + # Requested page size. + # + # The maximum page size is 500. If unspecified, the page size will + # be the maximum. Fewer jobs than requested might be returned, + # even if more jobs exist; use next_page_token to determine if more + # jobs exist. + # @param page_token [::String] + # A token identifying a page of results the server will return. To + # request the first page results, page_token must be empty. To + # request the next page of results, page_token must be the value of + # {::Google::Cloud::Scheduler::V1::ListJobsResponse#next_page_token next_page_token} + # returned from the previous call to + # {::Google::Cloud::Scheduler::V1::CloudScheduler::Client#list_jobs ListJobs}. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Gapic::PagedEnumerable<::Google::Cloud::Scheduler::V1::Job>] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Gapic::PagedEnumerable<::Google::Cloud::Scheduler::V1::Job>] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/scheduler/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Scheduler::V1::CloudScheduler::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Scheduler::V1::ListJobsRequest.new + # + # # Call the list_jobs method. + # result = client.list_jobs request + # + # # The returned object is of type Gapic::PagedEnumerable. You can iterate + # # over elements, and API calls will be issued to fetch pages as needed. + # result.each do |item| + # # Each element is of type ::Google::Cloud::Scheduler::V1::Job. + # p item + # end + # + def list_jobs request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Scheduler::V1::ListJobsRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + metadata = @config.rpcs.list_jobs.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::Scheduler::V1::VERSION + metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.parent + header_params["parent"] = request.parent + end + + request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") + metadata[:"x-goog-request-params"] ||= request_params_header + + options.apply_defaults timeout: @config.rpcs.list_jobs.timeout, + metadata: metadata, + retry_policy: @config.rpcs.list_jobs.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @cloud_scheduler_stub.call_rpc :list_jobs, request, options: options do |response, operation| + response = ::Gapic::PagedEnumerable.new @cloud_scheduler_stub, :list_jobs, request, response, operation, options + yield response, operation if block_given? + throw :response, response + end + rescue ::GRPC::BadStatus => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Gets a job. + # + # @overload get_job(request, options = nil) + # Pass arguments to `get_job` via a request object, either of type + # {::Google::Cloud::Scheduler::V1::GetJobRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Scheduler::V1::GetJobRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. + # + # @overload get_job(name: nil) + # Pass arguments to `get_job` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param name [::String] + # Required. The job name. For example: + # `projects/PROJECT_ID/locations/LOCATION_ID/jobs/JOB_ID`. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Google::Cloud::Scheduler::V1::Job] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Google::Cloud::Scheduler::V1::Job] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/scheduler/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Scheduler::V1::CloudScheduler::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Scheduler::V1::GetJobRequest.new + # + # # Call the get_job method. + # result = client.get_job request + # + # # The returned object is of type Google::Cloud::Scheduler::V1::Job. + # p result + # + def get_job request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Scheduler::V1::GetJobRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + metadata = @config.rpcs.get_job.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::Scheduler::V1::VERSION + metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.name + header_params["name"] = request.name + end + + request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") + metadata[:"x-goog-request-params"] ||= request_params_header + + options.apply_defaults timeout: @config.rpcs.get_job.timeout, + metadata: metadata, + retry_policy: @config.rpcs.get_job.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @cloud_scheduler_stub.call_rpc :get_job, request, options: options do |response, operation| + yield response, operation if block_given? + end + rescue ::GRPC::BadStatus => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Creates a job. + # + # @overload create_job(request, options = nil) + # Pass arguments to `create_job` via a request object, either of type + # {::Google::Cloud::Scheduler::V1::CreateJobRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Scheduler::V1::CreateJobRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. + # + # @overload create_job(parent: nil, job: nil) + # Pass arguments to `create_job` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param parent [::String] + # Required. The location name. For example: + # `projects/PROJECT_ID/locations/LOCATION_ID`. + # @param job [::Google::Cloud::Scheduler::V1::Job, ::Hash] + # Required. The job to add. The user can optionally specify a name for the + # job in {::Google::Cloud::Scheduler::V1::Job#name name}. + # {::Google::Cloud::Scheduler::V1::Job#name name} cannot be the same as an + # existing job. If a name is not specified then the system will + # generate a random unique name that will be returned + # ({::Google::Cloud::Scheduler::V1::Job#name name}) in the response. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Google::Cloud::Scheduler::V1::Job] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Google::Cloud::Scheduler::V1::Job] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/scheduler/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Scheduler::V1::CloudScheduler::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Scheduler::V1::CreateJobRequest.new + # + # # Call the create_job method. + # result = client.create_job request + # + # # The returned object is of type Google::Cloud::Scheduler::V1::Job. + # p result + # + def create_job request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Scheduler::V1::CreateJobRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + metadata = @config.rpcs.create_job.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::Scheduler::V1::VERSION + metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.parent + header_params["parent"] = request.parent + end + + request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") + metadata[:"x-goog-request-params"] ||= request_params_header + + options.apply_defaults timeout: @config.rpcs.create_job.timeout, + metadata: metadata, + retry_policy: @config.rpcs.create_job.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @cloud_scheduler_stub.call_rpc :create_job, 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 job. + # + # If successful, the updated {::Google::Cloud::Scheduler::V1::Job Job} is + # returned. If the job does not exist, `NOT_FOUND` is returned. + # + # If UpdateJob does not successfully return, it is possible for the + # job to be in an + # {::Google::Cloud::Scheduler::V1::Job::State::UPDATE_FAILED Job.State.UPDATE_FAILED} + # state. A job in this state may not be executed. If this happens, retry the + # UpdateJob request until a successful response is received. + # + # @overload update_job(request, options = nil) + # Pass arguments to `update_job` via a request object, either of type + # {::Google::Cloud::Scheduler::V1::UpdateJobRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Scheduler::V1::UpdateJobRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_job(job: nil, update_mask: nil) + # Pass arguments to `update_job` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param job [::Google::Cloud::Scheduler::V1::Job, ::Hash] + # Required. The new job properties. + # {::Google::Cloud::Scheduler::V1::Job#name name} must be specified. + # + # Output only fields cannot be modified using UpdateJob. + # Any value specified for an output only field will be ignored. + # @param update_mask [::Google::Protobuf::FieldMask, ::Hash] + # A mask used to specify which fields of the job are being updated. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Google::Cloud::Scheduler::V1::Job] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Google::Cloud::Scheduler::V1::Job] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/scheduler/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Scheduler::V1::CloudScheduler::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Scheduler::V1::UpdateJobRequest.new + # + # # Call the update_job method. + # result = client.update_job request + # + # # The returned object is of type Google::Cloud::Scheduler::V1::Job. + # p result + # + def update_job request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Scheduler::V1::UpdateJobRequest + + # Converts hash 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_job.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::Scheduler::V1::VERSION + metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.job&.name + header_params["job.name"] = request.job.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_job.timeout, + metadata: metadata, + retry_policy: @config.rpcs.update_job.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @cloud_scheduler_stub.call_rpc :update_job, request, options: options do |response, operation| + yield response, operation if block_given? + end + rescue ::GRPC::BadStatus => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Deletes a job. + # + # @overload delete_job(request, options = nil) + # Pass arguments to `delete_job` via a request object, either of type + # {::Google::Cloud::Scheduler::V1::DeleteJobRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Scheduler::V1::DeleteJobRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. + # + # @overload delete_job(name: nil) + # Pass arguments to `delete_job` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param name [::String] + # Required. The job name. For example: + # `projects/PROJECT_ID/locations/LOCATION_ID/jobs/JOB_ID`. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Google::Protobuf::Empty] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Google::Protobuf::Empty] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/scheduler/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Scheduler::V1::CloudScheduler::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Scheduler::V1::DeleteJobRequest.new + # + # # Call the delete_job method. + # result = client.delete_job request + # + # # The returned object is of type Google::Protobuf::Empty. + # p result + # + def delete_job request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Scheduler::V1::DeleteJobRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + metadata = @config.rpcs.delete_job.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::Scheduler::V1::VERSION + metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.name + header_params["name"] = request.name + end + + request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") + metadata[:"x-goog-request-params"] ||= request_params_header + + options.apply_defaults timeout: @config.rpcs.delete_job.timeout, + metadata: metadata, + retry_policy: @config.rpcs.delete_job.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @cloud_scheduler_stub.call_rpc :delete_job, request, options: options do |response, operation| + yield response, operation if block_given? + end + rescue ::GRPC::BadStatus => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Pauses a job. + # + # If a job is paused then the system will stop executing the job + # until it is re-enabled via + # {::Google::Cloud::Scheduler::V1::CloudScheduler::Client#resume_job ResumeJob}. The state + # of the job is stored in {::Google::Cloud::Scheduler::V1::Job#state state}; if + # paused it will be set to + # {::Google::Cloud::Scheduler::V1::Job::State::PAUSED Job.State.PAUSED}. A job must + # be in {::Google::Cloud::Scheduler::V1::Job::State::ENABLED Job.State.ENABLED} to + # be paused. + # + # @overload pause_job(request, options = nil) + # Pass arguments to `pause_job` via a request object, either of type + # {::Google::Cloud::Scheduler::V1::PauseJobRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Scheduler::V1::PauseJobRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. + # + # @overload pause_job(name: nil) + # Pass arguments to `pause_job` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param name [::String] + # Required. The job name. For example: + # `projects/PROJECT_ID/locations/LOCATION_ID/jobs/JOB_ID`. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Google::Cloud::Scheduler::V1::Job] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Google::Cloud::Scheduler::V1::Job] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/scheduler/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Scheduler::V1::CloudScheduler::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Scheduler::V1::PauseJobRequest.new + # + # # Call the pause_job method. + # result = client.pause_job request + # + # # The returned object is of type Google::Cloud::Scheduler::V1::Job. + # p result + # + def pause_job request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Scheduler::V1::PauseJobRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + metadata = @config.rpcs.pause_job.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::Scheduler::V1::VERSION + metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.name + header_params["name"] = request.name + end + + request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") + metadata[:"x-goog-request-params"] ||= request_params_header + + options.apply_defaults timeout: @config.rpcs.pause_job.timeout, + metadata: metadata, + retry_policy: @config.rpcs.pause_job.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @cloud_scheduler_stub.call_rpc :pause_job, 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 + + ## + # Resume a job. + # + # This method reenables a job after it has been + # {::Google::Cloud::Scheduler::V1::Job::State::PAUSED Job.State.PAUSED}. The state + # of a job is stored in {::Google::Cloud::Scheduler::V1::Job#state Job.state}; + # after calling this method it will be set to + # {::Google::Cloud::Scheduler::V1::Job::State::ENABLED Job.State.ENABLED}. A job + # must be in {::Google::Cloud::Scheduler::V1::Job::State::PAUSED Job.State.PAUSED} + # to be resumed. + # + # @overload resume_job(request, options = nil) + # Pass arguments to `resume_job` via a request object, either of type + # {::Google::Cloud::Scheduler::V1::ResumeJobRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Scheduler::V1::ResumeJobRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. + # + # @overload resume_job(name: nil) + # Pass arguments to `resume_job` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param name [::String] + # Required. The job name. For example: + # `projects/PROJECT_ID/locations/LOCATION_ID/jobs/JOB_ID`. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Google::Cloud::Scheduler::V1::Job] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Google::Cloud::Scheduler::V1::Job] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/scheduler/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Scheduler::V1::CloudScheduler::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Scheduler::V1::ResumeJobRequest.new + # + # # Call the resume_job method. + # result = client.resume_job request + # + # # The returned object is of type Google::Cloud::Scheduler::V1::Job. + # p result + # + def resume_job request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Scheduler::V1::ResumeJobRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + metadata = @config.rpcs.resume_job.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::Scheduler::V1::VERSION + metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.name + header_params["name"] = request.name + end + + request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") + metadata[:"x-goog-request-params"] ||= request_params_header + + options.apply_defaults timeout: @config.rpcs.resume_job.timeout, + metadata: metadata, + retry_policy: @config.rpcs.resume_job.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @cloud_scheduler_stub.call_rpc :resume_job, 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 + + ## + # Forces a job to run now. + # + # When this method is called, Cloud Scheduler will dispatch the job, even + # if the job is already running. + # + # @overload run_job(request, options = nil) + # Pass arguments to `run_job` via a request object, either of type + # {::Google::Cloud::Scheduler::V1::RunJobRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Scheduler::V1::RunJobRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. + # + # @overload run_job(name: nil) + # Pass arguments to `run_job` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param name [::String] + # Required. The job name. For example: + # `projects/PROJECT_ID/locations/LOCATION_ID/jobs/JOB_ID`. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Google::Cloud::Scheduler::V1::Job] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Google::Cloud::Scheduler::V1::Job] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/scheduler/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Scheduler::V1::CloudScheduler::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Scheduler::V1::RunJobRequest.new + # + # # Call the run_job method. + # result = client.run_job request + # + # # The returned object is of type Google::Cloud::Scheduler::V1::Job. + # p result + # + def run_job request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Scheduler::V1::RunJobRequest + + # Converts hash 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.run_job.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::Scheduler::V1::VERSION + metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.name + header_params["name"] = request.name + end + + request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") + metadata[:"x-goog-request-params"] ||= request_params_header + + options.apply_defaults timeout: @config.rpcs.run_job.timeout, + metadata: metadata, + retry_policy: @config.rpcs.run_job.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @cloud_scheduler_stub.call_rpc :run_job, request, options: options do |response, operation| + yield response, operation if block_given? + end + rescue ::GRPC::BadStatus => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Configuration class for the CloudScheduler API. + # + # This class represents the configuration for CloudScheduler, + # providing control over timeouts, retry behavior, logging, transport + # parameters, and other low-level controls. Certain parameters can also be + # applied individually to specific RPCs. See + # {::Google::Cloud::Scheduler::V1::CloudScheduler::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_jobs to 20 seconds, + # # and all remaining timeouts to 10 seconds. + # ::Google::Cloud::Scheduler::V1::CloudScheduler::Client.configure do |config| + # config.timeout = 10.0 + # config.rpcs.list_jobs.timeout = 20.0 + # end + # + # # Apply the above configuration only to a new client. + # client = ::Google::Cloud::Scheduler::V1::CloudScheduler::Client.new do |config| + # config.timeout = 10.0 + # config.rpcs.list_jobs.timeout = 20.0 + # end + # + # @!attribute [rw] endpoint + # A custom service endpoint, as a hostname or hostname:port. The default is + # nil, indicating to use the default endpoint in the current universe domain. + # @return [::String,nil] + # @!attribute [rw] credentials + # Credentials to send with calls. You may provide any of the following types: + # * (`Google::Auth::Credentials`) A googleauth credentials object + # (see the [googleauth docs](https://rubydoc.info/gems/googleauth/Google/Auth/Credentials)) + # * (`Signet::OAuth2::Client`) A signet oauth2 client object + # (see the [signet docs](https://rubydoc.info/gems/signet/Signet/OAuth2/Client)) + # * (`GRPC::Core::Channel`) a gRPC channel with included credentials + # * (`GRPC::Core::ChannelCredentials`) a gRPC credentails object + # * (`nil`) indicating no credentials + # + # @note Warning: Passing a `String` to a keyfile path or a `Hash` of credentials + # is deprecated. Providing an unvalidated credential configuration to + # Google APIs can compromise the security of your systems and data. + # + # @example + # + # # The recommended way to provide credentials is to use the `make_creds` method + # # on the appropriate credentials class for your environment. + # + # require "googleauth" + # + # credentials = ::Google::Auth::ServiceAccountCredentials.make_creds( + # json_key_io: ::File.open("/path/to/keyfile.json") + # ) + # + # client = ::Google::Cloud::Scheduler::V1::CloudScheduler::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 = "cloudscheduler.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 CloudScheduler 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_jobs` + # @return [::Gapic::Config::Method] + # + attr_reader :list_jobs + ## + # RPC-specific configuration for `get_job` + # @return [::Gapic::Config::Method] + # + attr_reader :get_job + ## + # RPC-specific configuration for `create_job` + # @return [::Gapic::Config::Method] + # + attr_reader :create_job + ## + # RPC-specific configuration for `update_job` + # @return [::Gapic::Config::Method] + # + attr_reader :update_job + ## + # RPC-specific configuration for `delete_job` + # @return [::Gapic::Config::Method] + # + attr_reader :delete_job + ## + # RPC-specific configuration for `pause_job` + # @return [::Gapic::Config::Method] + # + attr_reader :pause_job + ## + # RPC-specific configuration for `resume_job` + # @return [::Gapic::Config::Method] + # + attr_reader :resume_job + ## + # RPC-specific configuration for `run_job` + # @return [::Gapic::Config::Method] + # + attr_reader :run_job + + # @private + def initialize parent_rpcs = nil + list_jobs_config = parent_rpcs.list_jobs if parent_rpcs.respond_to? :list_jobs + @list_jobs = ::Gapic::Config::Method.new list_jobs_config + get_job_config = parent_rpcs.get_job if parent_rpcs.respond_to? :get_job + @get_job = ::Gapic::Config::Method.new get_job_config + create_job_config = parent_rpcs.create_job if parent_rpcs.respond_to? :create_job + @create_job = ::Gapic::Config::Method.new create_job_config + update_job_config = parent_rpcs.update_job if parent_rpcs.respond_to? :update_job + @update_job = ::Gapic::Config::Method.new update_job_config + delete_job_config = parent_rpcs.delete_job if parent_rpcs.respond_to? :delete_job + @delete_job = ::Gapic::Config::Method.new delete_job_config + pause_job_config = parent_rpcs.pause_job if parent_rpcs.respond_to? :pause_job + @pause_job = ::Gapic::Config::Method.new pause_job_config + resume_job_config = parent_rpcs.resume_job if parent_rpcs.respond_to? :resume_job + @resume_job = ::Gapic::Config::Method.new resume_job_config + run_job_config = parent_rpcs.run_job if parent_rpcs.respond_to? :run_job + @run_job = ::Gapic::Config::Method.new run_job_config + + yield self if block_given? + end + end + end + end + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-scheduler-v1/lib/google/cloud/scheduler/v1/cloud_scheduler/credentials.rb b/owl-bot-staging/google-cloud-scheduler-v1/lib/google/cloud/scheduler/v1/cloud_scheduler/credentials.rb new file mode 100644 index 000000000000..efe3a6fb9d69 --- /dev/null +++ b/owl-bot-staging/google-cloud-scheduler-v1/lib/google/cloud/scheduler/v1/cloud_scheduler/credentials.rb @@ -0,0 +1,51 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +require "googleauth" + +module Google + module Cloud + module Scheduler + module V1 + module CloudScheduler + # Credentials for the CloudScheduler API. + class Credentials < ::Google::Auth::Credentials + self.scope = [ + "https://www.googleapis.com/auth/cloud-platform" + ] + self.env_vars = [ + "SCHEDULER_CREDENTIALS", + "SCHEDULER_KEYFILE", + "GOOGLE_CLOUD_CREDENTIALS", + "GOOGLE_CLOUD_KEYFILE", + "GCLOUD_KEYFILE", + "SCHEDULER_CREDENTIALS_JSON", + "SCHEDULER_KEYFILE_JSON", + "GOOGLE_CLOUD_CREDENTIALS_JSON", + "GOOGLE_CLOUD_KEYFILE_JSON", + "GCLOUD_KEYFILE_JSON" + ] + self.paths = [ + "~/.config/google_cloud/application_default_credentials.json" + ] + end + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-scheduler-v1/lib/google/cloud/scheduler/v1/cloud_scheduler/paths.rb b/owl-bot-staging/google-cloud-scheduler-v1/lib/google/cloud/scheduler/v1/cloud_scheduler/paths.rb new file mode 100644 index 000000000000..885130d56682 --- /dev/null +++ b/owl-bot-staging/google-cloud-scheduler-v1/lib/google/cloud/scheduler/v1/cloud_scheduler/paths.rb @@ -0,0 +1,86 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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 Scheduler + module V1 + module CloudScheduler + # Path helper methods for the CloudScheduler API. + module Paths + ## + # Create a fully-qualified Job resource string. + # + # The resource will be in the following format: + # + # `projects/{project}/locations/{location}/jobs/{job}` + # + # @param project [String] + # @param location [String] + # @param job [String] + # + # @return [::String] + def job_path project:, location:, job: + raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" + raise ::ArgumentError, "location cannot contain /" if location.to_s.include? "/" + + "projects/#{project}/locations/#{location}/jobs/#{job}" + end + + ## + # Create a fully-qualified Location resource string. + # + # The resource will be in the following format: + # + # `projects/{project}/locations/{location}` + # + # @param project [String] + # @param location [String] + # + # @return [::String] + def location_path project:, location: + raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" + + "projects/#{project}/locations/#{location}" + end + + ## + # Create a fully-qualified Topic resource string. + # + # The resource will be in the following format: + # + # `projects/{project}/topics/{topic}` + # + # @param project [String] + # @param topic [String] + # + # @return [::String] + def topic_path project:, topic: + raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" + + "projects/#{project}/topics/#{topic}" + end + + extend self + end + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-scheduler-v1/lib/google/cloud/scheduler/v1/cloud_scheduler/rest.rb b/owl-bot-staging/google-cloud-scheduler-v1/lib/google/cloud/scheduler/v1/cloud_scheduler/rest.rb new file mode 100644 index 000000000000..ad8e3aece516 --- /dev/null +++ b/owl-bot-staging/google-cloud-scheduler-v1/lib/google/cloud/scheduler/v1/cloud_scheduler/rest.rb @@ -0,0 +1,54 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +require "gapic/rest" +require "gapic/config" +require "gapic/config/method" + +require "google/cloud/scheduler/v1/version" +require "google/cloud/scheduler/v1/bindings_override" + +require "google/cloud/scheduler/v1/cloud_scheduler/credentials" +require "google/cloud/scheduler/v1/cloud_scheduler/paths" +require "google/cloud/scheduler/v1/cloud_scheduler/rest/client" + +module Google + module Cloud + module Scheduler + module V1 + ## + # The Cloud Scheduler API allows external entities to reliably + # schedule asynchronous jobs. + # + # To load this service and instantiate a REST client: + # + # require "google/cloud/scheduler/v1/cloud_scheduler/rest" + # client = ::Google::Cloud::Scheduler::V1::CloudScheduler::Rest::Client.new + # + module CloudScheduler + # Client for the REST transport + module Rest + end + end + end + end + end +end + +helper_path = ::File.join __dir__, "rest", "helpers.rb" +require "google/cloud/scheduler/v1/cloud_scheduler/rest/helpers" if ::File.file? helper_path diff --git a/owl-bot-staging/google-cloud-scheduler-v1/lib/google/cloud/scheduler/v1/cloud_scheduler/rest/client.rb b/owl-bot-staging/google-cloud-scheduler-v1/lib/google/cloud/scheduler/v1/cloud_scheduler/rest/client.rb new file mode 100644 index 000000000000..1ab6822532e5 --- /dev/null +++ b/owl-bot-staging/google-cloud-scheduler-v1/lib/google/cloud/scheduler/v1/cloud_scheduler/rest/client.rb @@ -0,0 +1,1138 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +require "google/cloud/errors" +require "google/cloud/scheduler/v1/cloudscheduler_pb" +require "google/cloud/scheduler/v1/cloud_scheduler/rest/service_stub" +require "google/cloud/location/rest" + +module Google + module Cloud + module Scheduler + module V1 + module CloudScheduler + module Rest + ## + # REST client for the CloudScheduler service. + # + # The Cloud Scheduler API allows external entities to reliably + # schedule asynchronous jobs. + # + class Client + # @private + API_VERSION = "" + + # @private + DEFAULT_ENDPOINT_TEMPLATE = "cloudscheduler.$UNIVERSE_DOMAIN$" + + include Paths + + # @private + attr_reader :cloud_scheduler_stub + + ## + # Configure the CloudScheduler Client class. + # + # See {::Google::Cloud::Scheduler::V1::CloudScheduler::Rest::Client::Configuration} + # for a description of the configuration fields. + # + # @example + # + # # Modify the configuration for all CloudScheduler clients + # ::Google::Cloud::Scheduler::V1::CloudScheduler::Rest::Client.configure do |config| + # config.timeout = 10.0 + # end + # + # @yield [config] Configure the Client client. + # @yieldparam config [Client::Configuration] + # + # @return [Client::Configuration] + # + def self.configure + @configure ||= begin + namespace = ["Google", "Cloud", "Scheduler", "V1"] + parent_config = while namespace.any? + parent_name = namespace.join "::" + parent_const = const_get parent_name + break parent_const.configure if parent_const.respond_to? :configure + namespace.pop + end + default_config = Client::Configuration.new parent_config + + default_config.rpcs.list_jobs.timeout = 600.0 + default_config.rpcs.list_jobs.retry_policy = { + initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [4, 14] + } + + default_config.rpcs.get_job.timeout = 600.0 + default_config.rpcs.get_job.retry_policy = { + initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [4, 14] + } + + default_config.rpcs.create_job.timeout = 600.0 + + default_config.rpcs.update_job.timeout = 600.0 + + default_config.rpcs.delete_job.timeout = 600.0 + default_config.rpcs.delete_job.retry_policy = { + initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [4, 14] + } + + default_config.rpcs.pause_job.timeout = 600.0 + + default_config.rpcs.resume_job.timeout = 600.0 + + default_config.rpcs.run_job.timeout = 600.0 + + default_config + end + yield @configure if block_given? + @configure + end + + ## + # Configure the CloudScheduler Client instance. + # + # The configuration is set to the derived mode, meaning that values can be changed, + # but structural changes (adding new fields, etc.) are not allowed. Structural changes + # should be made on {Client.configure}. + # + # See {::Google::Cloud::Scheduler::V1::CloudScheduler::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 + @cloud_scheduler_stub.universe_domain + end + + ## + # Create a new CloudScheduler REST client object. + # + # @example + # + # # Create a client using the default configuration + # client = ::Google::Cloud::Scheduler::V1::CloudScheduler::Rest::Client.new + # + # # Create a client using a custom configuration + # client = ::Google::Cloud::Scheduler::V1::CloudScheduler::Rest::Client.new do |config| + # config.timeout = 10.0 + # end + # + # @yield [config] Configure the CloudScheduler 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 + + @cloud_scheduler_stub = ::Google::Cloud::Scheduler::V1::CloudScheduler::Rest::ServiceStub.new( + endpoint: @config.endpoint, + endpoint_template: DEFAULT_ENDPOINT_TEMPLATE, + universe_domain: @config.universe_domain, + credentials: credentials, + logger: @config.logger + ) + + @cloud_scheduler_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 = @cloud_scheduler_stub.endpoint + config.universe_domain = @cloud_scheduler_stub.universe_domain + config.bindings_override = @config.bindings_override + config.logger = @cloud_scheduler_stub.logger if config.respond_to? :logger= + end + end + + ## + # Get the associated client for mix-in of the Locations. + # + # @return [Google::Cloud::Location::Locations::Rest::Client] + # + attr_reader :location_client + + ## + # The logger used for request/response debug logging. + # + # @return [Logger] + # + def logger + @cloud_scheduler_stub.logger + end + + # Service calls + + ## + # Lists jobs. + # + # @overload list_jobs(request, options = nil) + # Pass arguments to `list_jobs` via a request object, either of type + # {::Google::Cloud::Scheduler::V1::ListJobsRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Scheduler::V1::ListJobsRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @overload list_jobs(parent: nil, page_size: nil, page_token: nil) + # Pass arguments to `list_jobs` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param parent [::String] + # Required. The location name. For example: + # `projects/PROJECT_ID/locations/LOCATION_ID`. + # @param page_size [::Integer] + # Requested page size. + # + # The maximum page size is 500. If unspecified, the page size will + # be the maximum. Fewer jobs than requested might be returned, + # even if more jobs exist; use next_page_token to determine if more + # jobs exist. + # @param page_token [::String] + # A token identifying a page of results the server will return. To + # request the first page results, page_token must be empty. To + # request the next page of results, page_token must be the value of + # {::Google::Cloud::Scheduler::V1::ListJobsResponse#next_page_token next_page_token} + # returned from the previous call to + # {::Google::Cloud::Scheduler::V1::CloudScheduler::Rest::Client#list_jobs ListJobs}. + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Gapic::Rest::PagedEnumerable<::Google::Cloud::Scheduler::V1::Job>] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Gapic::Rest::PagedEnumerable<::Google::Cloud::Scheduler::V1::Job>] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/scheduler/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Scheduler::V1::CloudScheduler::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Scheduler::V1::ListJobsRequest.new + # + # # Call the list_jobs method. + # result = client.list_jobs request + # + # # The returned object is of type Gapic::PagedEnumerable. You can iterate + # # over elements, and API calls will be issued to fetch pages as needed. + # result.each do |item| + # # Each element is of type ::Google::Cloud::Scheduler::V1::Job. + # p item + # end + # + def list_jobs request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Scheduler::V1::ListJobsRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + call_metadata = @config.rpcs.list_jobs.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::Scheduler::V1::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + options.apply_defaults timeout: @config.rpcs.list_jobs.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.list_jobs.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @cloud_scheduler_stub.list_jobs request, options do |result, operation| + result = ::Gapic::Rest::PagedEnumerable.new @cloud_scheduler_stub, :list_jobs, "jobs", 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 a job. + # + # @overload get_job(request, options = nil) + # Pass arguments to `get_job` via a request object, either of type + # {::Google::Cloud::Scheduler::V1::GetJobRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Scheduler::V1::GetJobRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @overload get_job(name: nil) + # Pass arguments to `get_job` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param name [::String] + # Required. The job name. For example: + # `projects/PROJECT_ID/locations/LOCATION_ID/jobs/JOB_ID`. + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Cloud::Scheduler::V1::Job] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::Scheduler::V1::Job] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/scheduler/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Scheduler::V1::CloudScheduler::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Scheduler::V1::GetJobRequest.new + # + # # Call the get_job method. + # result = client.get_job request + # + # # The returned object is of type Google::Cloud::Scheduler::V1::Job. + # p result + # + def get_job request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Scheduler::V1::GetJobRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + call_metadata = @config.rpcs.get_job.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::Scheduler::V1::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + options.apply_defaults timeout: @config.rpcs.get_job.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.get_job.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @cloud_scheduler_stub.get_job request, options do |result, operation| + yield result, operation if block_given? + end + rescue ::Gapic::Rest::Error => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Creates a job. + # + # @overload create_job(request, options = nil) + # Pass arguments to `create_job` via a request object, either of type + # {::Google::Cloud::Scheduler::V1::CreateJobRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Scheduler::V1::CreateJobRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @overload create_job(parent: nil, job: nil) + # Pass arguments to `create_job` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param parent [::String] + # Required. The location name. For example: + # `projects/PROJECT_ID/locations/LOCATION_ID`. + # @param job [::Google::Cloud::Scheduler::V1::Job, ::Hash] + # Required. The job to add. The user can optionally specify a name for the + # job in {::Google::Cloud::Scheduler::V1::Job#name name}. + # {::Google::Cloud::Scheduler::V1::Job#name name} cannot be the same as an + # existing job. If a name is not specified then the system will + # generate a random unique name that will be returned + # ({::Google::Cloud::Scheduler::V1::Job#name name}) in the response. + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Cloud::Scheduler::V1::Job] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::Scheduler::V1::Job] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/scheduler/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Scheduler::V1::CloudScheduler::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Scheduler::V1::CreateJobRequest.new + # + # # Call the create_job method. + # result = client.create_job request + # + # # The returned object is of type Google::Cloud::Scheduler::V1::Job. + # p result + # + def create_job request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Scheduler::V1::CreateJobRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + call_metadata = @config.rpcs.create_job.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::Scheduler::V1::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + options.apply_defaults timeout: @config.rpcs.create_job.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.create_job.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @cloud_scheduler_stub.create_job 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 job. + # + # If successful, the updated {::Google::Cloud::Scheduler::V1::Job Job} is + # returned. If the job does not exist, `NOT_FOUND` is returned. + # + # If UpdateJob does not successfully return, it is possible for the + # job to be in an + # {::Google::Cloud::Scheduler::V1::Job::State::UPDATE_FAILED Job.State.UPDATE_FAILED} + # state. A job in this state may not be executed. If this happens, retry the + # UpdateJob request until a successful response is received. + # + # @overload update_job(request, options = nil) + # Pass arguments to `update_job` via a request object, either of type + # {::Google::Cloud::Scheduler::V1::UpdateJobRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Scheduler::V1::UpdateJobRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_job(job: nil, update_mask: nil) + # Pass arguments to `update_job` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param job [::Google::Cloud::Scheduler::V1::Job, ::Hash] + # Required. The new job properties. + # {::Google::Cloud::Scheduler::V1::Job#name name} must be specified. + # + # Output only fields cannot be modified using UpdateJob. + # Any value specified for an output only field will be ignored. + # @param update_mask [::Google::Protobuf::FieldMask, ::Hash] + # A mask used to specify which fields of the job are being updated. + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Cloud::Scheduler::V1::Job] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::Scheduler::V1::Job] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/scheduler/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Scheduler::V1::CloudScheduler::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Scheduler::V1::UpdateJobRequest.new + # + # # Call the update_job method. + # result = client.update_job request + # + # # The returned object is of type Google::Cloud::Scheduler::V1::Job. + # p result + # + def update_job request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Scheduler::V1::UpdateJobRequest + + # Converts hash 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_job.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::Scheduler::V1::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + options.apply_defaults timeout: @config.rpcs.update_job.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.update_job.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @cloud_scheduler_stub.update_job request, options do |result, operation| + yield result, operation if block_given? + end + rescue ::Gapic::Rest::Error => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Deletes a job. + # + # @overload delete_job(request, options = nil) + # Pass arguments to `delete_job` via a request object, either of type + # {::Google::Cloud::Scheduler::V1::DeleteJobRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Scheduler::V1::DeleteJobRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @overload delete_job(name: nil) + # Pass arguments to `delete_job` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param name [::String] + # Required. The job name. For example: + # `projects/PROJECT_ID/locations/LOCATION_ID/jobs/JOB_ID`. + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Protobuf::Empty] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Protobuf::Empty] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/scheduler/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Scheduler::V1::CloudScheduler::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Scheduler::V1::DeleteJobRequest.new + # + # # Call the delete_job method. + # result = client.delete_job request + # + # # The returned object is of type Google::Protobuf::Empty. + # p result + # + def delete_job request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Scheduler::V1::DeleteJobRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + call_metadata = @config.rpcs.delete_job.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::Scheduler::V1::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + options.apply_defaults timeout: @config.rpcs.delete_job.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.delete_job.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @cloud_scheduler_stub.delete_job 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 + + ## + # Pauses a job. + # + # If a job is paused then the system will stop executing the job + # until it is re-enabled via + # {::Google::Cloud::Scheduler::V1::CloudScheduler::Rest::Client#resume_job ResumeJob}. The state + # of the job is stored in {::Google::Cloud::Scheduler::V1::Job#state state}; if + # paused it will be set to + # {::Google::Cloud::Scheduler::V1::Job::State::PAUSED Job.State.PAUSED}. A job must + # be in {::Google::Cloud::Scheduler::V1::Job::State::ENABLED Job.State.ENABLED} to + # be paused. + # + # @overload pause_job(request, options = nil) + # Pass arguments to `pause_job` via a request object, either of type + # {::Google::Cloud::Scheduler::V1::PauseJobRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Scheduler::V1::PauseJobRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @overload pause_job(name: nil) + # Pass arguments to `pause_job` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param name [::String] + # Required. The job name. For example: + # `projects/PROJECT_ID/locations/LOCATION_ID/jobs/JOB_ID`. + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Cloud::Scheduler::V1::Job] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::Scheduler::V1::Job] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/scheduler/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Scheduler::V1::CloudScheduler::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Scheduler::V1::PauseJobRequest.new + # + # # Call the pause_job method. + # result = client.pause_job request + # + # # The returned object is of type Google::Cloud::Scheduler::V1::Job. + # p result + # + def pause_job request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Scheduler::V1::PauseJobRequest + + # Converts hash 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.pause_job.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::Scheduler::V1::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + options.apply_defaults timeout: @config.rpcs.pause_job.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.pause_job.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @cloud_scheduler_stub.pause_job 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 + + ## + # Resume a job. + # + # This method reenables a job after it has been + # {::Google::Cloud::Scheduler::V1::Job::State::PAUSED Job.State.PAUSED}. The state + # of a job is stored in {::Google::Cloud::Scheduler::V1::Job#state Job.state}; + # after calling this method it will be set to + # {::Google::Cloud::Scheduler::V1::Job::State::ENABLED Job.State.ENABLED}. A job + # must be in {::Google::Cloud::Scheduler::V1::Job::State::PAUSED Job.State.PAUSED} + # to be resumed. + # + # @overload resume_job(request, options = nil) + # Pass arguments to `resume_job` via a request object, either of type + # {::Google::Cloud::Scheduler::V1::ResumeJobRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Scheduler::V1::ResumeJobRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @overload resume_job(name: nil) + # Pass arguments to `resume_job` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param name [::String] + # Required. The job name. For example: + # `projects/PROJECT_ID/locations/LOCATION_ID/jobs/JOB_ID`. + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Cloud::Scheduler::V1::Job] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::Scheduler::V1::Job] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/scheduler/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Scheduler::V1::CloudScheduler::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Scheduler::V1::ResumeJobRequest.new + # + # # Call the resume_job method. + # result = client.resume_job request + # + # # The returned object is of type Google::Cloud::Scheduler::V1::Job. + # p result + # + def resume_job request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Scheduler::V1::ResumeJobRequest + + # Converts hash 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.resume_job.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::Scheduler::V1::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + options.apply_defaults timeout: @config.rpcs.resume_job.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.resume_job.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @cloud_scheduler_stub.resume_job 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 + + ## + # Forces a job to run now. + # + # When this method is called, Cloud Scheduler will dispatch the job, even + # if the job is already running. + # + # @overload run_job(request, options = nil) + # Pass arguments to `run_job` via a request object, either of type + # {::Google::Cloud::Scheduler::V1::RunJobRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Scheduler::V1::RunJobRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @overload run_job(name: nil) + # Pass arguments to `run_job` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param name [::String] + # Required. The job name. For example: + # `projects/PROJECT_ID/locations/LOCATION_ID/jobs/JOB_ID`. + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Cloud::Scheduler::V1::Job] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::Scheduler::V1::Job] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/scheduler/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Scheduler::V1::CloudScheduler::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Scheduler::V1::RunJobRequest.new + # + # # Call the run_job method. + # result = client.run_job request + # + # # The returned object is of type Google::Cloud::Scheduler::V1::Job. + # p result + # + def run_job request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Scheduler::V1::RunJobRequest + + # Converts hash 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.run_job.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::Scheduler::V1::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + options.apply_defaults timeout: @config.rpcs.run_job.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.run_job.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @cloud_scheduler_stub.run_job 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 CloudScheduler REST API. + # + # This class represents the configuration for CloudScheduler REST, + # providing control over timeouts, retry behavior, logging, transport + # parameters, and other low-level controls. Certain parameters can also be + # applied individually to specific RPCs. See + # {::Google::Cloud::Scheduler::V1::CloudScheduler::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_jobs to 20 seconds, + # # and all remaining timeouts to 10 seconds. + # ::Google::Cloud::Scheduler::V1::CloudScheduler::Rest::Client.configure do |config| + # config.timeout = 10.0 + # config.rpcs.list_jobs.timeout = 20.0 + # end + # + # # Apply the above configuration only to a new client. + # client = ::Google::Cloud::Scheduler::V1::CloudScheduler::Rest::Client.new do |config| + # config.timeout = 10.0 + # config.rpcs.list_jobs.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 = "cloudscheduler.googleapis.com" + + config_attr :endpoint, nil, ::String, nil + config_attr :credentials, nil do |value| + allowed = [::String, ::Hash, ::Proc, ::Symbol, ::Google::Auth::Credentials, ::Google::Auth::BaseClient, ::Signet::OAuth2::Client, nil] + allowed.any? { |klass| klass === value } + end + config_attr :scope, nil, ::String, ::Array, nil + config_attr :lib_name, nil, ::String, nil + config_attr :lib_version, nil, ::String, nil + config_attr :timeout, nil, ::Numeric, nil + config_attr :metadata, nil, ::Hash, nil + config_attr :retry_policy, nil, ::Hash, ::Proc, nil + config_attr :quota_project, nil, ::String, nil + config_attr :universe_domain, nil, ::String, nil + + # @private + # Overrides for http bindings for the RPCs of this service + # are only used when this service is used as mixin, and only + # by the host service. + # @return [::Hash{::Symbol=>::Array<::Gapic::Rest::GrpcTranscoder::HttpBinding>}] + config_attr :bindings_override, {}, ::Hash, nil + config_attr :logger, :default, ::Logger, nil, :default + + # @private + def initialize parent_config = nil + @parent_config = parent_config unless parent_config.nil? + + yield self if block_given? + end + + ## + # Configurations for individual RPCs + # @return [Rpcs] + # + def rpcs + @rpcs ||= begin + parent_rpcs = nil + parent_rpcs = @parent_config.rpcs if defined?(@parent_config) && @parent_config.respond_to?(:rpcs) + Rpcs.new parent_rpcs + end + end + + ## + # Configuration RPC class for the CloudScheduler 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_jobs` + # @return [::Gapic::Config::Method] + # + attr_reader :list_jobs + ## + # RPC-specific configuration for `get_job` + # @return [::Gapic::Config::Method] + # + attr_reader :get_job + ## + # RPC-specific configuration for `create_job` + # @return [::Gapic::Config::Method] + # + attr_reader :create_job + ## + # RPC-specific configuration for `update_job` + # @return [::Gapic::Config::Method] + # + attr_reader :update_job + ## + # RPC-specific configuration for `delete_job` + # @return [::Gapic::Config::Method] + # + attr_reader :delete_job + ## + # RPC-specific configuration for `pause_job` + # @return [::Gapic::Config::Method] + # + attr_reader :pause_job + ## + # RPC-specific configuration for `resume_job` + # @return [::Gapic::Config::Method] + # + attr_reader :resume_job + ## + # RPC-specific configuration for `run_job` + # @return [::Gapic::Config::Method] + # + attr_reader :run_job + + # @private + def initialize parent_rpcs = nil + list_jobs_config = parent_rpcs.list_jobs if parent_rpcs.respond_to? :list_jobs + @list_jobs = ::Gapic::Config::Method.new list_jobs_config + get_job_config = parent_rpcs.get_job if parent_rpcs.respond_to? :get_job + @get_job = ::Gapic::Config::Method.new get_job_config + create_job_config = parent_rpcs.create_job if parent_rpcs.respond_to? :create_job + @create_job = ::Gapic::Config::Method.new create_job_config + update_job_config = parent_rpcs.update_job if parent_rpcs.respond_to? :update_job + @update_job = ::Gapic::Config::Method.new update_job_config + delete_job_config = parent_rpcs.delete_job if parent_rpcs.respond_to? :delete_job + @delete_job = ::Gapic::Config::Method.new delete_job_config + pause_job_config = parent_rpcs.pause_job if parent_rpcs.respond_to? :pause_job + @pause_job = ::Gapic::Config::Method.new pause_job_config + resume_job_config = parent_rpcs.resume_job if parent_rpcs.respond_to? :resume_job + @resume_job = ::Gapic::Config::Method.new resume_job_config + run_job_config = parent_rpcs.run_job if parent_rpcs.respond_to? :run_job + @run_job = ::Gapic::Config::Method.new run_job_config + + yield self if block_given? + end + end + end + end + end + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-scheduler-v1/lib/google/cloud/scheduler/v1/cloud_scheduler/rest/service_stub.rb b/owl-bot-staging/google-cloud-scheduler-v1/lib/google/cloud/scheduler/v1/cloud_scheduler/rest/service_stub.rb new file mode 100644 index 000000000000..0c51f76d75d1 --- /dev/null +++ b/owl-bot-staging/google-cloud-scheduler-v1/lib/google/cloud/scheduler/v1/cloud_scheduler/rest/service_stub.rb @@ -0,0 +1,574 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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/scheduler/v1/cloudscheduler_pb" + +module Google + module Cloud + module Scheduler + module V1 + module CloudScheduler + module Rest + ## + # REST service stub for the CloudScheduler service. + # Service stub contains baseline method implementations + # including transcoding, making the REST call, and deserialing the response. + # + class ServiceStub + # @private + def initialize endpoint:, endpoint_template:, universe_domain:, credentials:, logger: + # These require statements are intentionally placed here to initialize + # the REST modules only when it's required. + require "gapic/rest" + + @client_stub = ::Gapic::Rest::ClientStub.new endpoint: endpoint, + endpoint_template: endpoint_template, + universe_domain: universe_domain, + credentials: credentials, + numeric_enums: true, + service_name: self.class, + raise_faraday_errors: false, + logger: logger + end + + ## + # The effective universe domain + # + # @return [String] + # + def universe_domain + @client_stub.universe_domain + end + + ## + # The effective endpoint + # + # @return [String] + # + def endpoint + @client_stub.endpoint + end + + ## + # The logger used for request/response debug logging. + # + # @return [Logger] + # + def logger stub: false + stub ? @client_stub.stub_logger : @client_stub.logger + end + + ## + # Baseline implementation for the list_jobs REST call + # + # @param request_pb [::Google::Cloud::Scheduler::V1::ListJobsRequest] + # A request object representing the call parameters. Required. + # @param options [::Gapic::CallOptions] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Cloud::Scheduler::V1::ListJobsResponse] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::Scheduler::V1::ListJobsResponse] + # A result object deserialized from the server's reply + def list_jobs request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_list_jobs_request request_pb + query_string_params = if query_string_params.any? + query_string_params.to_h { |p| p.split "=", 2 } + else + {} + end + + response = @client_stub.make_http_request( + verb, + uri: uri, + body: body || "", + params: query_string_params, + method_name: "list_jobs", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Cloud::Scheduler::V1::ListJobsResponse.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_job REST call + # + # @param request_pb [::Google::Cloud::Scheduler::V1::GetJobRequest] + # A request object representing the call parameters. Required. + # @param options [::Gapic::CallOptions] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Cloud::Scheduler::V1::Job] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::Scheduler::V1::Job] + # A result object deserialized from the server's reply + def get_job request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_get_job_request request_pb + query_string_params = if query_string_params.any? + query_string_params.to_h { |p| p.split "=", 2 } + else + {} + end + + response = @client_stub.make_http_request( + verb, + uri: uri, + body: body || "", + params: query_string_params, + method_name: "get_job", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Cloud::Scheduler::V1::Job.decode_json response.body, ignore_unknown_fields: true + catch :response do + yield result, operation if block_given? + result + end + end + + ## + # Baseline implementation for the create_job REST call + # + # @param request_pb [::Google::Cloud::Scheduler::V1::CreateJobRequest] + # A request object representing the call parameters. Required. + # @param options [::Gapic::CallOptions] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Cloud::Scheduler::V1::Job] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::Scheduler::V1::Job] + # A result object deserialized from the server's reply + def create_job request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_create_job_request request_pb + query_string_params = if query_string_params.any? + query_string_params.to_h { |p| p.split "=", 2 } + else + {} + end + + response = @client_stub.make_http_request( + verb, + uri: uri, + body: body || "", + params: query_string_params, + method_name: "create_job", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Cloud::Scheduler::V1::Job.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_job REST call + # + # @param request_pb [::Google::Cloud::Scheduler::V1::UpdateJobRequest] + # A request object representing the call parameters. Required. + # @param options [::Gapic::CallOptions] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Cloud::Scheduler::V1::Job] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::Scheduler::V1::Job] + # A result object deserialized from the server's reply + def update_job request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_update_job_request request_pb + query_string_params = if query_string_params.any? + query_string_params.to_h { |p| p.split "=", 2 } + else + {} + end + + response = @client_stub.make_http_request( + verb, + uri: uri, + body: body || "", + params: query_string_params, + method_name: "update_job", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Cloud::Scheduler::V1::Job.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_job REST call + # + # @param request_pb [::Google::Cloud::Scheduler::V1::DeleteJobRequest] + # A request object representing the call parameters. Required. + # @param options [::Gapic::CallOptions] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Protobuf::Empty] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Protobuf::Empty] + # A result object deserialized from the server's reply + def delete_job request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_delete_job_request request_pb + query_string_params = if query_string_params.any? + query_string_params.to_h { |p| p.split "=", 2 } + else + {} + end + + response = @client_stub.make_http_request( + verb, + uri: uri, + body: body || "", + params: query_string_params, + method_name: "delete_job", + 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 pause_job REST call + # + # @param request_pb [::Google::Cloud::Scheduler::V1::PauseJobRequest] + # A request object representing the call parameters. Required. + # @param options [::Gapic::CallOptions] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Cloud::Scheduler::V1::Job] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::Scheduler::V1::Job] + # A result object deserialized from the server's reply + def pause_job request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_pause_job_request request_pb + query_string_params = if query_string_params.any? + query_string_params.to_h { |p| p.split "=", 2 } + else + {} + end + + response = @client_stub.make_http_request( + verb, + uri: uri, + body: body || "", + params: query_string_params, + method_name: "pause_job", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Cloud::Scheduler::V1::Job.decode_json response.body, ignore_unknown_fields: true + catch :response do + yield result, operation if block_given? + result + end + end + + ## + # Baseline implementation for the resume_job REST call + # + # @param request_pb [::Google::Cloud::Scheduler::V1::ResumeJobRequest] + # A request object representing the call parameters. Required. + # @param options [::Gapic::CallOptions] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Cloud::Scheduler::V1::Job] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::Scheduler::V1::Job] + # A result object deserialized from the server's reply + def resume_job request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_resume_job_request request_pb + query_string_params = if query_string_params.any? + query_string_params.to_h { |p| p.split "=", 2 } + else + {} + end + + response = @client_stub.make_http_request( + verb, + uri: uri, + body: body || "", + params: query_string_params, + method_name: "resume_job", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Cloud::Scheduler::V1::Job.decode_json response.body, ignore_unknown_fields: true + catch :response do + yield result, operation if block_given? + result + end + end + + ## + # Baseline implementation for the run_job REST call + # + # @param request_pb [::Google::Cloud::Scheduler::V1::RunJobRequest] + # A request object representing the call parameters. Required. + # @param options [::Gapic::CallOptions] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Cloud::Scheduler::V1::Job] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::Scheduler::V1::Job] + # A result object deserialized from the server's reply + def run_job request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_run_job_request request_pb + query_string_params = if query_string_params.any? + query_string_params.to_h { |p| p.split "=", 2 } + else + {} + end + + response = @client_stub.make_http_request( + verb, + uri: uri, + body: body || "", + params: query_string_params, + method_name: "run_job", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Cloud::Scheduler::V1::Job.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_jobs REST call + # + # @param request_pb [::Google::Cloud::Scheduler::V1::ListJobsRequest] + # A request object representing the call parameters. Required. + # @return [Array(String, [String, nil], Hash{String => String})] + # Uri, Body, Query string parameters + def self.transcode_list_jobs_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :get, + uri_template: "/v1/{parent}/jobs", + matches: [ + ["parent", %r{^projects/[^/]+/locations/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the get_job REST call + # + # @param request_pb [::Google::Cloud::Scheduler::V1::GetJobRequest] + # A request object representing the call parameters. Required. + # @return [Array(String, [String, nil], Hash{String => String})] + # Uri, Body, Query string parameters + def self.transcode_get_job_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/jobs/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the create_job REST call + # + # @param request_pb [::Google::Cloud::Scheduler::V1::CreateJobRequest] + # A request object representing the call parameters. Required. + # @return [Array(String, [String, nil], Hash{String => String})] + # Uri, Body, Query string parameters + def self.transcode_create_job_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :post, + uri_template: "/v1/{parent}/jobs", + body: "job", + matches: [ + ["parent", %r{^projects/[^/]+/locations/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the update_job REST call + # + # @param request_pb [::Google::Cloud::Scheduler::V1::UpdateJobRequest] + # 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_job_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :patch, + uri_template: "/v1/{job.name}", + body: "job", + matches: [ + ["job.name", %r{^projects/[^/]+/locations/[^/]+/jobs/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the delete_job REST call + # + # @param request_pb [::Google::Cloud::Scheduler::V1::DeleteJobRequest] + # A request object representing the call parameters. Required. + # @return [Array(String, [String, nil], Hash{String => String})] + # Uri, Body, Query string parameters + def self.transcode_delete_job_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :delete, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/jobs/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the pause_job REST call + # + # @param request_pb [::Google::Cloud::Scheduler::V1::PauseJobRequest] + # A request object representing the call parameters. Required. + # @return [Array(String, [String, nil], Hash{String => String})] + # Uri, Body, Query string parameters + def self.transcode_pause_job_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:pause", + body: "*", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/jobs/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the resume_job REST call + # + # @param request_pb [::Google::Cloud::Scheduler::V1::ResumeJobRequest] + # A request object representing the call parameters. Required. + # @return [Array(String, [String, nil], Hash{String => String})] + # Uri, Body, Query string parameters + def self.transcode_resume_job_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:resume", + body: "*", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/jobs/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the run_job REST call + # + # @param request_pb [::Google::Cloud::Scheduler::V1::RunJobRequest] + # A request object representing the call parameters. Required. + # @return [Array(String, [String, nil], Hash{String => String})] + # Uri, Body, Query string parameters + def self.transcode_run_job_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:run", + body: "*", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/jobs/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + end + end + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-scheduler-v1/lib/google/cloud/scheduler/v1/cloudscheduler_pb.rb b/owl-bot-staging/google-cloud-scheduler-v1/lib/google/cloud/scheduler/v1/cloudscheduler_pb.rb new file mode 100644 index 000000000000..4dd0fb324086 --- /dev/null +++ b/owl-bot-staging/google-cloud-scheduler-v1/lib/google/cloud/scheduler/v1/cloudscheduler_pb.rb @@ -0,0 +1,37 @@ +# frozen_string_literal: true +# Generated by the protocol buffer compiler. DO NOT EDIT! +# source: google/cloud/scheduler/v1/cloudscheduler.proto + +require 'google/protobuf' + +require 'google/api/annotations_pb' +require 'google/api/client_pb' +require 'google/api/field_behavior_pb' +require 'google/api/resource_pb' +require 'google/cloud/scheduler/v1/job_pb' +require 'google/protobuf/empty_pb' +require 'google/protobuf/field_mask_pb' + + +descriptor_data = "\n.google/cloud/scheduler/v1/cloudscheduler.proto\x12\x19google.cloud.scheduler.v1\x1a\x1cgoogle/api/annotations.proto\x1a\x17google/api/client.proto\x1a\x1fgoogle/api/field_behavior.proto\x1a\x19google/api/resource.proto\x1a#google/cloud/scheduler/v1/job.proto\x1a\x1bgoogle/protobuf/empty.proto\x1a google/protobuf/field_mask.proto\"s\n\x0fListJobsRequest\x12\x39\n\x06parent\x18\x01 \x01(\tB)\xe0\x41\x02\xfa\x41#\x12!cloudscheduler.googleapis.com/Job\x12\x11\n\tpage_size\x18\x05 \x01(\x05\x12\x12\n\npage_token\x18\x06 \x01(\t\"Y\n\x10ListJobsResponse\x12,\n\x04jobs\x18\x01 \x03(\x0b\x32\x1e.google.cloud.scheduler.v1.Job\x12\x17\n\x0fnext_page_token\x18\x02 \x01(\t\"H\n\rGetJobRequest\x12\x37\n\x04name\x18\x01 \x01(\tB)\xe0\x41\x02\xfa\x41#\n!cloudscheduler.googleapis.com/Job\"\x7f\n\x10\x43reateJobRequest\x12\x39\n\x06parent\x18\x01 \x01(\tB)\xe0\x41\x02\xfa\x41#\x12!cloudscheduler.googleapis.com/Job\x12\x30\n\x03job\x18\x02 \x01(\x0b\x32\x1e.google.cloud.scheduler.v1.JobB\x03\xe0\x41\x02\"u\n\x10UpdateJobRequest\x12\x30\n\x03job\x18\x01 \x01(\x0b\x32\x1e.google.cloud.scheduler.v1.JobB\x03\xe0\x41\x02\x12/\n\x0bupdate_mask\x18\x02 \x01(\x0b\x32\x1a.google.protobuf.FieldMask\"K\n\x10\x44\x65leteJobRequest\x12\x37\n\x04name\x18\x01 \x01(\tB)\xe0\x41\x02\xfa\x41#\n!cloudscheduler.googleapis.com/Job\"J\n\x0fPauseJobRequest\x12\x37\n\x04name\x18\x01 \x01(\tB)\xe0\x41\x02\xfa\x41#\n!cloudscheduler.googleapis.com/Job\"K\n\x10ResumeJobRequest\x12\x37\n\x04name\x18\x01 \x01(\tB)\xe0\x41\x02\xfa\x41#\n!cloudscheduler.googleapis.com/Job\"H\n\rRunJobRequest\x12\x37\n\x04name\x18\x01 \x01(\tB)\xe0\x41\x02\xfa\x41#\n!cloudscheduler.googleapis.com/Job2\xb3\n\n\x0e\x43loudScheduler\x12\x9e\x01\n\x08ListJobs\x12*.google.cloud.scheduler.v1.ListJobsRequest\x1a+.google.cloud.scheduler.v1.ListJobsResponse\"9\xda\x41\x06parent\x82\xd3\xe4\x93\x02*\x12(/v1/{parent=projects/*/locations/*}/jobs\x12\x8b\x01\n\x06GetJob\x12(.google.cloud.scheduler.v1.GetJobRequest\x1a\x1e.google.cloud.scheduler.v1.Job\"7\xda\x41\x04name\x82\xd3\xe4\x93\x02*\x12(/v1/{name=projects/*/locations/*/jobs/*}\x12\x9c\x01\n\tCreateJob\x12+.google.cloud.scheduler.v1.CreateJobRequest\x1a\x1e.google.cloud.scheduler.v1.Job\"B\xda\x41\nparent,job\x82\xd3\xe4\x93\x02/\"(/v1/{parent=projects/*/locations/*}/jobs:\x03job\x12\xa5\x01\n\tUpdateJob\x12+.google.cloud.scheduler.v1.UpdateJobRequest\x1a\x1e.google.cloud.scheduler.v1.Job\"K\xda\x41\x0fjob,update_mask\x82\xd3\xe4\x93\x02\x33\x32,/v1/{job.name=projects/*/locations/*/jobs/*}:\x03job\x12\x89\x01\n\tDeleteJob\x12+.google.cloud.scheduler.v1.DeleteJobRequest\x1a\x16.google.protobuf.Empty\"7\xda\x41\x04name\x82\xd3\xe4\x93\x02**(/v1/{name=projects/*/locations/*/jobs/*}\x12\x98\x01\n\x08PauseJob\x12*.google.cloud.scheduler.v1.PauseJobRequest\x1a\x1e.google.cloud.scheduler.v1.Job\"@\xda\x41\x04name\x82\xd3\xe4\x93\x02\x33\"./v1/{name=projects/*/locations/*/jobs/*}:pause:\x01*\x12\x9b\x01\n\tResumeJob\x12+.google.cloud.scheduler.v1.ResumeJobRequest\x1a\x1e.google.cloud.scheduler.v1.Job\"A\xda\x41\x04name\x82\xd3\xe4\x93\x02\x34\"//v1/{name=projects/*/locations/*/jobs/*}:resume:\x01*\x12\x92\x01\n\x06RunJob\x12(.google.cloud.scheduler.v1.RunJobRequest\x1a\x1e.google.cloud.scheduler.v1.Job\">\xda\x41\x04name\x82\xd3\xe4\x93\x02\x31\",/v1/{name=projects/*/locations/*/jobs/*}:run:\x01*\x1aQ\xca\x41\x1d\x63loudscheduler.googleapis.com\xd2\x41.https://www.googleapis.com/auth/cloud-platformBz\n\x1d\x63om.google.cloud.scheduler.v1B\x0eSchedulerProtoP\x01Z;cloud.google.com/go/scheduler/apiv1/schedulerpb;schedulerpb\xa2\x02\tSCHEDULERb\x06proto3" + +pool = ::Google::Protobuf::DescriptorPool.generated_pool +pool.add_serialized_file(descriptor_data) + +module Google + module Cloud + module Scheduler + module V1 + ListJobsRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.scheduler.v1.ListJobsRequest").msgclass + ListJobsResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.scheduler.v1.ListJobsResponse").msgclass + GetJobRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.scheduler.v1.GetJobRequest").msgclass + CreateJobRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.scheduler.v1.CreateJobRequest").msgclass + UpdateJobRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.scheduler.v1.UpdateJobRequest").msgclass + DeleteJobRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.scheduler.v1.DeleteJobRequest").msgclass + PauseJobRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.scheduler.v1.PauseJobRequest").msgclass + ResumeJobRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.scheduler.v1.ResumeJobRequest").msgclass + RunJobRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.scheduler.v1.RunJobRequest").msgclass + end + end + end +end diff --git a/owl-bot-staging/google-cloud-scheduler-v1/lib/google/cloud/scheduler/v1/cloudscheduler_services_pb.rb b/owl-bot-staging/google-cloud-scheduler-v1/lib/google/cloud/scheduler/v1/cloudscheduler_services_pb.rb new file mode 100644 index 000000000000..74ea2172ef3b --- /dev/null +++ b/owl-bot-staging/google-cloud-scheduler-v1/lib/google/cloud/scheduler/v1/cloudscheduler_services_pb.rb @@ -0,0 +1,89 @@ +# Generated by the protocol buffer compiler. DO NOT EDIT! +# Source: google/cloud/scheduler/v1/cloudscheduler.proto for package 'google.cloud.scheduler.v1' +# Original file comments: +# 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 +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# + +require 'grpc' +require 'google/cloud/scheduler/v1/cloudscheduler_pb' + +module Google + module Cloud + module Scheduler + module V1 + module CloudScheduler + # The Cloud Scheduler API allows external entities to reliably + # schedule asynchronous jobs. + class Service + + include ::GRPC::GenericService + + self.marshal_class_method = :encode + self.unmarshal_class_method = :decode + self.service_name = 'google.cloud.scheduler.v1.CloudScheduler' + + # Lists jobs. + rpc :ListJobs, ::Google::Cloud::Scheduler::V1::ListJobsRequest, ::Google::Cloud::Scheduler::V1::ListJobsResponse + # Gets a job. + rpc :GetJob, ::Google::Cloud::Scheduler::V1::GetJobRequest, ::Google::Cloud::Scheduler::V1::Job + # Creates a job. + rpc :CreateJob, ::Google::Cloud::Scheduler::V1::CreateJobRequest, ::Google::Cloud::Scheduler::V1::Job + # Updates a job. + # + # If successful, the updated [Job][google.cloud.scheduler.v1.Job] is + # returned. If the job does not exist, `NOT_FOUND` is returned. + # + # If UpdateJob does not successfully return, it is possible for the + # job to be in an + # [Job.State.UPDATE_FAILED][google.cloud.scheduler.v1.Job.State.UPDATE_FAILED] + # state. A job in this state may not be executed. If this happens, retry the + # UpdateJob request until a successful response is received. + rpc :UpdateJob, ::Google::Cloud::Scheduler::V1::UpdateJobRequest, ::Google::Cloud::Scheduler::V1::Job + # Deletes a job. + rpc :DeleteJob, ::Google::Cloud::Scheduler::V1::DeleteJobRequest, ::Google::Protobuf::Empty + # Pauses a job. + # + # If a job is paused then the system will stop executing the job + # until it is re-enabled via + # [ResumeJob][google.cloud.scheduler.v1.CloudScheduler.ResumeJob]. The state + # of the job is stored in [state][google.cloud.scheduler.v1.Job.state]; if + # paused it will be set to + # [Job.State.PAUSED][google.cloud.scheduler.v1.Job.State.PAUSED]. A job must + # be in [Job.State.ENABLED][google.cloud.scheduler.v1.Job.State.ENABLED] to + # be paused. + rpc :PauseJob, ::Google::Cloud::Scheduler::V1::PauseJobRequest, ::Google::Cloud::Scheduler::V1::Job + # Resume a job. + # + # This method reenables a job after it has been + # [Job.State.PAUSED][google.cloud.scheduler.v1.Job.State.PAUSED]. The state + # of a job is stored in [Job.state][google.cloud.scheduler.v1.Job.state]; + # after calling this method it will be set to + # [Job.State.ENABLED][google.cloud.scheduler.v1.Job.State.ENABLED]. A job + # must be in [Job.State.PAUSED][google.cloud.scheduler.v1.Job.State.PAUSED] + # to be resumed. + rpc :ResumeJob, ::Google::Cloud::Scheduler::V1::ResumeJobRequest, ::Google::Cloud::Scheduler::V1::Job + # Forces a job to run now. + # + # When this method is called, Cloud Scheduler will dispatch the job, even + # if the job is already running. + rpc :RunJob, ::Google::Cloud::Scheduler::V1::RunJobRequest, ::Google::Cloud::Scheduler::V1::Job + end + + Stub = Service.rpc_stub_class + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-scheduler-v1/lib/google/cloud/scheduler/v1/job_pb.rb b/owl-bot-staging/google-cloud-scheduler-v1/lib/google/cloud/scheduler/v1/job_pb.rb new file mode 100644 index 000000000000..a47e690ec889 --- /dev/null +++ b/owl-bot-staging/google-cloud-scheduler-v1/lib/google/cloud/scheduler/v1/job_pb.rb @@ -0,0 +1,30 @@ +# frozen_string_literal: true +# Generated by the protocol buffer compiler. DO NOT EDIT! +# source: google/cloud/scheduler/v1/job.proto + +require 'google/protobuf' + +require 'google/api/field_behavior_pb' +require 'google/api/resource_pb' +require 'google/cloud/scheduler/v1/target_pb' +require 'google/protobuf/duration_pb' +require 'google/protobuf/timestamp_pb' +require 'google/rpc/status_pb' + + +descriptor_data = "\n#google/cloud/scheduler/v1/job.proto\x12\x19google.cloud.scheduler.v1\x1a\x1fgoogle/api/field_behavior.proto\x1a\x19google/api/resource.proto\x1a&google/cloud/scheduler/v1/target.proto\x1a\x1egoogle/protobuf/duration.proto\x1a\x1fgoogle/protobuf/timestamp.proto\x1a\x17google/rpc/status.proto\"\xef\x06\n\x03Job\x12\x0c\n\x04name\x18\x01 \x01(\t\x12\x13\n\x0b\x64\x65scription\x18\x02 \x01(\t\x12@\n\rpubsub_target\x18\x04 \x01(\x0b\x32\'.google.cloud.scheduler.v1.PubsubTargetH\x00\x12P\n\x16\x61pp_engine_http_target\x18\x05 \x01(\x0b\x32..google.cloud.scheduler.v1.AppEngineHttpTargetH\x00\x12<\n\x0bhttp_target\x18\x06 \x01(\x0b\x32%.google.cloud.scheduler.v1.HttpTargetH\x00\x12\x10\n\x08schedule\x18\x14 \x01(\t\x12\x11\n\ttime_zone\x18\x15 \x01(\t\x12\x39\n\x10user_update_time\x18\t \x01(\x0b\x32\x1a.google.protobuf.TimestampB\x03\xe0\x41\x03\x12\x38\n\x05state\x18\n \x01(\x0e\x32$.google.cloud.scheduler.v1.Job.StateB\x03\xe0\x41\x03\x12\'\n\x06status\x18\x0b \x01(\x0b\x32\x12.google.rpc.StatusB\x03\xe0\x41\x03\x12\x36\n\rschedule_time\x18\x11 \x01(\x0b\x32\x1a.google.protobuf.TimestampB\x03\xe0\x41\x03\x12:\n\x11last_attempt_time\x18\x12 \x01(\x0b\x32\x1a.google.protobuf.TimestampB\x03\xe0\x41\x03\x12<\n\x0cretry_config\x18\x13 \x01(\x0b\x32&.google.cloud.scheduler.v1.RetryConfig\x12\x33\n\x10\x61ttempt_deadline\x18\x16 \x01(\x0b\x32\x19.google.protobuf.Duration\"X\n\x05State\x12\x15\n\x11STATE_UNSPECIFIED\x10\x00\x12\x0b\n\x07\x45NABLED\x10\x01\x12\n\n\x06PAUSED\x10\x02\x12\x0c\n\x08\x44ISABLED\x10\x03\x12\x11\n\rUPDATE_FAILED\x10\x04:e\xea\x41\x62\n!cloudscheduler.googleapis.com/Job\x12\x32projects/{project}/locations/{location}/jobs/{job}*\x04jobs2\x03jobB\x08\n\x06target\"\xe2\x01\n\x0bRetryConfig\x12\x13\n\x0bretry_count\x18\x01 \x01(\x05\x12\x35\n\x12max_retry_duration\x18\x02 \x01(\x0b\x32\x19.google.protobuf.Duration\x12\x37\n\x14min_backoff_duration\x18\x03 \x01(\x0b\x32\x19.google.protobuf.Duration\x12\x37\n\x14max_backoff_duration\x18\x04 \x01(\x0b\x32\x19.google.protobuf.Duration\x12\x15\n\rmax_doublings\x18\x05 \x01(\x05\x42h\n\x1d\x63om.google.cloud.scheduler.v1B\x08JobProtoP\x01Z;cloud.google.com/go/scheduler/apiv1/schedulerpb;schedulerpbb\x06proto3" + +pool = ::Google::Protobuf::DescriptorPool.generated_pool +pool.add_serialized_file(descriptor_data) + +module Google + module Cloud + module Scheduler + module V1 + Job = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.scheduler.v1.Job").msgclass + Job::State = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.scheduler.v1.Job.State").enummodule + RetryConfig = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.scheduler.v1.RetryConfig").msgclass + end + end + end +end diff --git a/owl-bot-staging/google-cloud-scheduler-v1/lib/google/cloud/scheduler/v1/rest.rb b/owl-bot-staging/google-cloud-scheduler-v1/lib/google/cloud/scheduler/v1/rest.rb new file mode 100644 index 000000000000..c05f1f65b59c --- /dev/null +++ b/owl-bot-staging/google-cloud-scheduler-v1/lib/google/cloud/scheduler/v1/rest.rb @@ -0,0 +1,38 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +require "google/cloud/scheduler/v1/cloud_scheduler/rest" +require "google/cloud/scheduler/v1/bindings_override" +require "google/cloud/scheduler/v1/version" + +module Google + module Cloud + module Scheduler + ## + # To load just the REST part of this package, including all its services, and instantiate a REST client: + # + # @example + # + # require "google/cloud/scheduler/v1/rest" + # client = ::Google::Cloud::Scheduler::V1::CloudScheduler::Rest::Client.new + # + module V1 + end + end + end +end diff --git a/owl-bot-staging/google-cloud-scheduler-v1/lib/google/cloud/scheduler/v1/target_pb.rb b/owl-bot-staging/google-cloud-scheduler-v1/lib/google/cloud/scheduler/v1/target_pb.rb new file mode 100644 index 000000000000..35186ffc0517 --- /dev/null +++ b/owl-bot-staging/google-cloud-scheduler-v1/lib/google/cloud/scheduler/v1/target_pb.rb @@ -0,0 +1,29 @@ +# frozen_string_literal: true +# Generated by the protocol buffer compiler. DO NOT EDIT! +# source: google/cloud/scheduler/v1/target.proto + +require 'google/protobuf' + +require 'google/api/resource_pb' + + +descriptor_data = "\n&google/cloud/scheduler/v1/target.proto\x12\x19google.cloud.scheduler.v1\x1a\x19google/api/resource.proto\"\xea\x02\n\nHttpTarget\x12\x0b\n\x03uri\x18\x01 \x01(\t\x12:\n\x0bhttp_method\x18\x02 \x01(\x0e\x32%.google.cloud.scheduler.v1.HttpMethod\x12\x43\n\x07headers\x18\x03 \x03(\x0b\x32\x32.google.cloud.scheduler.v1.HttpTarget.HeadersEntry\x12\x0c\n\x04\x62ody\x18\x04 \x01(\x0c\x12<\n\x0boauth_token\x18\x05 \x01(\x0b\x32%.google.cloud.scheduler.v1.OAuthTokenH\x00\x12:\n\noidc_token\x18\x06 \x01(\x0b\x32$.google.cloud.scheduler.v1.OidcTokenH\x00\x1a.\n\x0cHeadersEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12\r\n\x05value\x18\x02 \x01(\t:\x02\x38\x01\x42\x16\n\x14\x61uthorization_header\"\xbc\x02\n\x13\x41ppEngineHttpTarget\x12:\n\x0bhttp_method\x18\x01 \x01(\x0e\x32%.google.cloud.scheduler.v1.HttpMethod\x12G\n\x12\x61pp_engine_routing\x18\x02 \x01(\x0b\x32+.google.cloud.scheduler.v1.AppEngineRouting\x12\x14\n\x0crelative_uri\x18\x03 \x01(\t\x12L\n\x07headers\x18\x04 \x03(\x0b\x32;.google.cloud.scheduler.v1.AppEngineHttpTarget.HeadersEntry\x12\x0c\n\x04\x62ody\x18\x05 \x01(\x0c\x1a.\n\x0cHeadersEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12\r\n\x05value\x18\x02 \x01(\t:\x02\x38\x01\"\xd2\x01\n\x0cPubsubTarget\x12\x34\n\ntopic_name\x18\x01 \x01(\tB \xfa\x41\x1d\n\x1bpubsub.googleapis.com/Topic\x12\x0c\n\x04\x64\x61ta\x18\x03 \x01(\x0c\x12K\n\nattributes\x18\x04 \x03(\x0b\x32\x37.google.cloud.scheduler.v1.PubsubTarget.AttributesEntry\x1a\x31\n\x0f\x41ttributesEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12\r\n\x05value\x18\x02 \x01(\t:\x02\x38\x01\"T\n\x10\x41ppEngineRouting\x12\x0f\n\x07service\x18\x01 \x01(\t\x12\x0f\n\x07version\x18\x02 \x01(\t\x12\x10\n\x08instance\x18\x03 \x01(\t\x12\x0c\n\x04host\x18\x04 \x01(\t\":\n\nOAuthToken\x12\x1d\n\x15service_account_email\x18\x01 \x01(\t\x12\r\n\x05scope\x18\x02 \x01(\t\"<\n\tOidcToken\x12\x1d\n\x15service_account_email\x18\x01 \x01(\t\x12\x10\n\x08\x61udience\x18\x02 \x01(\t*s\n\nHttpMethod\x12\x1b\n\x17HTTP_METHOD_UNSPECIFIED\x10\x00\x12\x08\n\x04POST\x10\x01\x12\x07\n\x03GET\x10\x02\x12\x08\n\x04HEAD\x10\x03\x12\x07\n\x03PUT\x10\x04\x12\n\n\x06\x44\x45LETE\x10\x05\x12\t\n\x05PATCH\x10\x06\x12\x0b\n\x07OPTIONS\x10\x07\x42\xae\x01\n\x1d\x63om.google.cloud.scheduler.v1B\x0bTargetProtoP\x01Z;cloud.google.com/go/scheduler/apiv1/schedulerpb;schedulerpb\xea\x41@\n\x1bpubsub.googleapis.com/Topic\x12!projects/{project}/topics/{topic}b\x06proto3" + +pool = ::Google::Protobuf::DescriptorPool.generated_pool +pool.add_serialized_file(descriptor_data) + +module Google + module Cloud + module Scheduler + module V1 + HttpTarget = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.scheduler.v1.HttpTarget").msgclass + AppEngineHttpTarget = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.scheduler.v1.AppEngineHttpTarget").msgclass + PubsubTarget = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.scheduler.v1.PubsubTarget").msgclass + AppEngineRouting = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.scheduler.v1.AppEngineRouting").msgclass + OAuthToken = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.scheduler.v1.OAuthToken").msgclass + OidcToken = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.scheduler.v1.OidcToken").msgclass + HttpMethod = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.scheduler.v1.HttpMethod").enummodule + end + end + end +end diff --git a/owl-bot-staging/google-cloud-scheduler-v1/lib/google/cloud/scheduler/v1/version.rb b/owl-bot-staging/google-cloud-scheduler-v1/lib/google/cloud/scheduler/v1/version.rb new file mode 100644 index 000000000000..207c07f5c915 --- /dev/null +++ b/owl-bot-staging/google-cloud-scheduler-v1/lib/google/cloud/scheduler/v1/version.rb @@ -0,0 +1,28 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + + +module Google + module Cloud + module Scheduler + module V1 + VERSION = "0.0.1" + end + end + end +end diff --git a/owl-bot-staging/google-cloud-scheduler-v1/proto_docs/README.md b/owl-bot-staging/google-cloud-scheduler-v1/proto_docs/README.md new file mode 100644 index 000000000000..3bc7344421da --- /dev/null +++ b/owl-bot-staging/google-cloud-scheduler-v1/proto_docs/README.md @@ -0,0 +1,4 @@ +# Cloud Scheduler V1 Protocol Buffer Documentation + +These files are for the YARD documentation of the generated protobuf files. +They are not intended to be required or loaded at runtime. diff --git a/owl-bot-staging/google-cloud-scheduler-v1/proto_docs/google/api/client.rb b/owl-bot-staging/google-cloud-scheduler-v1/proto_docs/google/api/client.rb new file mode 100644 index 000000000000..5089551e9ea4 --- /dev/null +++ b/owl-bot-staging/google-cloud-scheduler-v1/proto_docs/google/api/client.rb @@ -0,0 +1,589 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + + +module Google + module Api + # Required information for every language. + # @!attribute [rw] reference_docs_uri + # @deprecated This field is deprecated and may be removed in the next major version update. + # @return [::String] + # Link to automatically generated reference documentation. Example: + # https://cloud.google.com/nodejs/docs/reference/asset/latest + # @!attribute [rw] destinations + # @return [::Array<::Google::Api::ClientLibraryDestination>] + # The destination where API teams want this client library to be published. + # @!attribute [rw] selective_gapic_generation + # @return [::Google::Api::SelectiveGapicGeneration] + # Configuration for which RPCs should be generated in the GAPIC client. + class CommonLanguageSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Details about how and where to publish client libraries. + # @!attribute [rw] version + # @return [::String] + # Version of the API to apply these settings to. This is the full protobuf + # package for the API, ending in the version element. + # Examples: "google.cloud.speech.v1" and "google.spanner.admin.database.v1". + # @!attribute [rw] launch_stage + # @return [::Google::Api::LaunchStage] + # Launch stage of this version of the API. + # @!attribute [rw] rest_numeric_enums + # @return [::Boolean] + # When using transport=rest, the client request will encode enums as + # numbers rather than strings. + # @!attribute [rw] java_settings + # @return [::Google::Api::JavaSettings] + # Settings for legacy Java features, supported in the Service YAML. + # @!attribute [rw] cpp_settings + # @return [::Google::Api::CppSettings] + # Settings for C++ client libraries. + # @!attribute [rw] php_settings + # @return [::Google::Api::PhpSettings] + # Settings for PHP client libraries. + # @!attribute [rw] python_settings + # @return [::Google::Api::PythonSettings] + # Settings for Python client libraries. + # @!attribute [rw] node_settings + # @return [::Google::Api::NodeSettings] + # Settings for Node client libraries. + # @!attribute [rw] dotnet_settings + # @return [::Google::Api::DotnetSettings] + # Settings for .NET client libraries. + # @!attribute [rw] ruby_settings + # @return [::Google::Api::RubySettings] + # Settings for Ruby client libraries. + # @!attribute [rw] go_settings + # @return [::Google::Api::GoSettings] + # Settings for Go client libraries. + class ClientLibrarySettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # This message configures the settings for publishing [Google Cloud Client + # libraries](https://cloud.google.com/apis/docs/cloud-client-libraries) + # generated from the service config. + # @!attribute [rw] method_settings + # @return [::Array<::Google::Api::MethodSettings>] + # A list of API method settings, e.g. the behavior for methods that use the + # long-running operation pattern. + # @!attribute [rw] new_issue_uri + # @return [::String] + # Link to a *public* URI where users can report issues. Example: + # https://issuetracker.google.com/issues/new?component=190865&template=1161103 + # @!attribute [rw] documentation_uri + # @return [::String] + # Link to product home page. Example: + # https://cloud.google.com/asset-inventory/docs/overview + # @!attribute [rw] api_short_name + # @return [::String] + # Used as a tracking tag when collecting data about the APIs developer + # relations artifacts like docs, packages delivered to package managers, + # etc. Example: "speech". + # @!attribute [rw] github_label + # @return [::String] + # GitHub label to apply to issues and pull requests opened for this API. + # @!attribute [rw] codeowner_github_teams + # @return [::Array<::String>] + # GitHub teams to be added to CODEOWNERS in the directory in GitHub + # containing source code for the client libraries for this API. + # @!attribute [rw] doc_tag_prefix + # @return [::String] + # A prefix used in sample code when demarking regions to be included in + # documentation. + # @!attribute [rw] organization + # @return [::Google::Api::ClientLibraryOrganization] + # For whom the client library is being published. + # @!attribute [rw] library_settings + # @return [::Array<::Google::Api::ClientLibrarySettings>] + # Client library settings. If the same version string appears multiple + # times in this list, then the last one wins. Settings from earlier + # settings with the same version string are discarded. + # @!attribute [rw] proto_reference_documentation_uri + # @return [::String] + # Optional link to proto reference documentation. Example: + # https://cloud.google.com/pubsub/lite/docs/reference/rpc + # @!attribute [rw] rest_reference_documentation_uri + # @return [::String] + # Optional link to REST reference documentation. Example: + # https://cloud.google.com/pubsub/lite/docs/reference/rest + class Publishing + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Settings for Java client libraries. + # @!attribute [rw] library_package + # @return [::String] + # The package name to use in Java. Clobbers the java_package option + # set in the protobuf. This should be used **only** by APIs + # who have already set the language_settings.java.package_name" field + # in gapic.yaml. API teams should use the protobuf java_package option + # where possible. + # + # Example of a YAML configuration:: + # + # publishing: + # 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. + # @!attribute [rw] methods + # @return [::Array<::String>] + # An allowlist of the fully qualified names of RPCs that should be included + # on public client surfaces. + # @!attribute [rw] generate_omitted_as_internal + # @return [::Boolean] + # Setting this to true indicates to the client generators that methods + # that would be excluded from the generation should instead be generated + # in a way that indicates these methods should not be consumed by + # end users. How this is expressed is up to individual language + # implementations to decide. Some examples may be: added annotations, + # obfuscated identifiers, or other language idiomatic patterns. + class SelectiveGapicGeneration + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # `BatchingConfigProto` defines the batching configuration for an API method. + # @!attribute [rw] thresholds + # @return [::Google::Api::BatchingSettingsProto] + # The thresholds which trigger a batched request to be sent. + # @!attribute [rw] batch_descriptor + # @return [::Google::Api::BatchingDescriptorProto] + # The request and response fields used in batching. + class BatchingConfigProto + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # `BatchingSettingsProto` specifies a set of batching thresholds, each of + # which acts as a trigger to send a batch of messages as a request. At least + # one threshold must be positive nonzero. + # @!attribute [rw] element_count_threshold + # @return [::Integer] + # The number of elements of a field collected into a batch which, if + # exceeded, causes the batch to be sent. + # @!attribute [rw] request_byte_threshold + # @return [::Integer] + # The aggregated size of the batched field which, if exceeded, causes the + # batch to be sent. This size is computed by aggregating the sizes of the + # request field to be batched, not of the entire request message. + # @!attribute [rw] delay_threshold + # @return [::Google::Protobuf::Duration] + # The duration after which a batch should be sent, starting from the addition + # of the first message to that batch. + # @!attribute [rw] element_count_limit + # @return [::Integer] + # The maximum number of elements collected in a batch that could be accepted + # by server. + # @!attribute [rw] request_byte_limit + # @return [::Integer] + # The maximum size of the request that could be accepted by server. + # @!attribute [rw] flow_control_element_limit + # @return [::Integer] + # The maximum number of elements allowed by flow control. + # @!attribute [rw] flow_control_byte_limit + # @return [::Integer] + # The maximum size of data allowed by flow control. + # @!attribute [rw] flow_control_limit_exceeded_behavior + # @return [::Google::Api::FlowControlLimitExceededBehaviorProto] + # The behavior to take when the flow control limit is exceeded. + class BatchingSettingsProto + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # `BatchingDescriptorProto` specifies the fields of the request message to be + # used for batching, and, optionally, the fields of the response message to be + # used for demultiplexing. + # @!attribute [rw] batched_field + # @return [::String] + # The repeated field in the request message to be aggregated by batching. + # @!attribute [rw] discriminator_fields + # @return [::Array<::String>] + # A list of the fields in the request message. Two requests will be batched + # together only if the values of every field specified in + # `request_discriminator_fields` is equal between the two requests. + # @!attribute [rw] subresponse_field + # @return [::String] + # Optional. When present, indicates the field in the response message to be + # used to demultiplex the response into multiple response messages, in + # correspondence with the multiple request messages originally batched + # together. + class BatchingDescriptorProto + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # The organization for which the client libraries are being published. + # Affects the url where generated docs are published, etc. + module ClientLibraryOrganization + # Not useful. + CLIENT_LIBRARY_ORGANIZATION_UNSPECIFIED = 0 + + # Google Cloud Platform Org. + CLOUD = 1 + + # Ads (Advertising) Org. + ADS = 2 + + # Photos Org. + PHOTOS = 3 + + # Street View Org. + STREET_VIEW = 4 + + # Shopping Org. + SHOPPING = 5 + + # Geo Org. + GEO = 6 + + # Generative AI - https://developers.generativeai.google + GENERATIVE_AI = 7 + end + + # To where should client libraries be published? + module ClientLibraryDestination + # Client libraries will neither be generated nor published to package + # managers. + CLIENT_LIBRARY_DESTINATION_UNSPECIFIED = 0 + + # Generate the client library in a repo under github.com/googleapis, + # but don't publish it to package managers. + GITHUB = 10 + + # Publish the library to package managers like nuget.org and npmjs.com. + PACKAGE_MANAGER = 20 + end + + # The behavior to take when the flow control limit is exceeded. + module FlowControlLimitExceededBehaviorProto + # Default behavior, system-defined. + UNSET_BEHAVIOR = 0 + + # Stop operation, raise error. + THROW_EXCEPTION = 1 + + # Pause operation until limit clears. + BLOCK = 2 + + # Continue operation, disregard limit. + IGNORE = 3 + end + end +end diff --git a/owl-bot-staging/google-cloud-scheduler-v1/proto_docs/google/api/field_behavior.rb b/owl-bot-staging/google-cloud-scheduler-v1/proto_docs/google/api/field_behavior.rb new file mode 100644 index 000000000000..582be187d115 --- /dev/null +++ b/owl-bot-staging/google-cloud-scheduler-v1/proto_docs/google/api/field_behavior.rb @@ -0,0 +1,85 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + + +module Google + module Api + # An indicator of the behavior of a given field (for example, that a field + # is required in requests, or given as output but ignored as input). + # This **does not** change the behavior in protocol buffers itself; it only + # denotes the behavior and may affect how API tooling handles the field. + # + # Note: This enum **may** receive new values in the future. + module FieldBehavior + # Conventional default for enums. Do not use this. + FIELD_BEHAVIOR_UNSPECIFIED = 0 + + # Specifically denotes a field as optional. + # While all fields in protocol buffers are optional, this may be specified + # for emphasis if appropriate. + OPTIONAL = 1 + + # Denotes a field as required. + # This indicates that the field **must** be provided as part of the request, + # and failure to do so will cause an error (usually `INVALID_ARGUMENT`). + REQUIRED = 2 + + # Denotes a field as output only. + # This indicates that the field is provided in responses, but including the + # field in a request does nothing (the server *must* ignore it and + # *must not* throw an error as a result of the field's presence). + OUTPUT_ONLY = 3 + + # Denotes a field as input only. + # This indicates that the field is provided in requests, and the + # corresponding field is not included in output. + INPUT_ONLY = 4 + + # Denotes a field as immutable. + # This indicates that the field may be set once in a request to create a + # resource, but may not be changed thereafter. + IMMUTABLE = 5 + + # Denotes that a (repeated) field is an unordered list. + # This indicates that the service may provide the elements of the list + # in any arbitrary order, rather than the order the user originally + # provided. Additionally, the list's order may or may not be stable. + UNORDERED_LIST = 6 + + # Denotes that this field returns a non-empty default value if not set. + # This indicates that if the user provides the empty value in a request, + # a non-empty value will be returned. The user will not be aware of what + # non-empty value to expect. + NON_EMPTY_DEFAULT = 7 + + # Denotes that the field in a resource (a message annotated with + # google.api.resource) is used in the resource name to uniquely identify the + # resource. For AIP-compliant APIs, this should only be applied to the + # `name` field on the resource. + # + # This behavior should not be applied to references to other resources within + # the message. + # + # The identifier field of resources often have different field behavior + # depending on the request it is embedded in (e.g. for Create methods name + # is optional and unused, while for Update methods it is required). Instead + # of method-specific annotations, only `IDENTIFIER` is required. + IDENTIFIER = 8 + end + end +end diff --git a/owl-bot-staging/google-cloud-scheduler-v1/proto_docs/google/api/launch_stage.rb b/owl-bot-staging/google-cloud-scheduler-v1/proto_docs/google/api/launch_stage.rb new file mode 100644 index 000000000000..9392a413fb1b --- /dev/null +++ b/owl-bot-staging/google-cloud-scheduler-v1/proto_docs/google/api/launch_stage.rb @@ -0,0 +1,71 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + + +module Google + module Api + # The launch stage as defined by [Google Cloud Platform + # Launch Stages](https://cloud.google.com/terms/launch-stages). + module LaunchStage + # Do not use this default value. + LAUNCH_STAGE_UNSPECIFIED = 0 + + # The feature is not yet implemented. Users can not use it. + UNIMPLEMENTED = 6 + + # Prelaunch features are hidden from users and are only visible internally. + PRELAUNCH = 7 + + # Early Access features are limited to a closed group of testers. To use + # these features, you must sign up in advance and sign a Trusted Tester + # agreement (which includes confidentiality provisions). These features may + # be unstable, changed in backward-incompatible ways, and are not + # guaranteed to be released. + EARLY_ACCESS = 1 + + # Alpha is a limited availability test for releases before they are cleared + # for widespread use. By Alpha, all significant design issues are resolved + # and we are in the process of verifying functionality. Alpha customers + # need to apply for access, agree to applicable terms, and have their + # projects allowlisted. Alpha releases don't have to be feature complete, + # no SLAs are provided, and there are no technical support obligations, but + # they will be far enough along that customers can actually use them in + # test environments or for limited-use tests -- just like they would in + # normal production cases. + ALPHA = 2 + + # Beta is the point at which we are ready to open a release for any + # customer to use. There are no SLA or technical support obligations in a + # Beta release. Products will be complete from a feature perspective, but + # may have some open outstanding issues. Beta releases are suitable for + # limited production use cases. + BETA = 3 + + # GA features are open to all developers and are considered stable and + # fully qualified for production use. + GA = 4 + + # Deprecated features are scheduled to be shut down and removed. For more + # information, see the "Deprecation Policy" section of our [Terms of + # Service](https://cloud.google.com/terms/) + # and the [Google Cloud Platform Subject to the Deprecation + # Policy](https://cloud.google.com/terms/deprecation) documentation. + DEPRECATED = 5 + end + end +end diff --git a/owl-bot-staging/google-cloud-scheduler-v1/proto_docs/google/api/resource.rb b/owl-bot-staging/google-cloud-scheduler-v1/proto_docs/google/api/resource.rb new file mode 100644 index 000000000000..25dec4847ac1 --- /dev/null +++ b/owl-bot-staging/google-cloud-scheduler-v1/proto_docs/google/api/resource.rb @@ -0,0 +1,227 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + + +module Google + module Api + # A simple descriptor of a resource type. + # + # ResourceDescriptor annotates a resource message (either by means of a + # protobuf annotation or use in the service config), and associates the + # resource's schema, the resource type, and the pattern of the resource name. + # + # Example: + # + # message Topic { + # // Indicates this message defines a resource schema. + # // Declares the resource type in the format of {service}/{kind}. + # // For Kubernetes resources, the format is {api group}/{kind}. + # option (google.api.resource) = { + # type: "pubsub.googleapis.com/Topic" + # pattern: "projects/{project}/topics/{topic}" + # }; + # } + # + # The ResourceDescriptor Yaml config will look like: + # + # resources: + # - type: "pubsub.googleapis.com/Topic" + # pattern: "projects/{project}/topics/{topic}" + # + # Sometimes, resources have multiple patterns, typically because they can + # live under multiple parents. + # + # Example: + # + # message LogEntry { + # option (google.api.resource) = { + # type: "logging.googleapis.com/LogEntry" + # pattern: "projects/{project}/logs/{log}" + # pattern: "folders/{folder}/logs/{log}" + # pattern: "organizations/{organization}/logs/{log}" + # pattern: "billingAccounts/{billing_account}/logs/{log}" + # }; + # } + # + # The ResourceDescriptor Yaml config will look like: + # + # resources: + # - type: 'logging.googleapis.com/LogEntry' + # pattern: "projects/{project}/logs/{log}" + # pattern: "folders/{folder}/logs/{log}" + # pattern: "organizations/{organization}/logs/{log}" + # pattern: "billingAccounts/{billing_account}/logs/{log}" + # @!attribute [rw] type + # @return [::String] + # The resource type. It must be in the format of + # \\{service_name}/\\{resource_type_kind}. The `resource_type_kind` must be + # singular and must not include version numbers. + # + # Example: `storage.googleapis.com/Bucket` + # + # The value of the resource_type_kind must follow the regular expression + # /[A-Za-z][a-zA-Z0-9]+/. It should start with an upper case character and + # should use PascalCase (UpperCamelCase). The maximum number of + # characters allowed for the `resource_type_kind` is 100. + # @!attribute [rw] pattern + # @return [::Array<::String>] + # Optional. The relative resource name pattern associated with this resource + # type. The DNS prefix of the full resource name shouldn't be specified here. + # + # The path pattern must follow the syntax, which aligns with HTTP binding + # syntax: + # + # Template = Segment { "/" Segment } ; + # Segment = LITERAL | Variable ; + # Variable = "{" LITERAL "}" ; + # + # Examples: + # + # - "projects/\\{project}/topics/\\{topic}" + # - "projects/\\{project}/knowledgeBases/\\{knowledge_base}" + # + # The components in braces correspond to the IDs for each resource in the + # hierarchy. It is expected that, if multiple patterns are provided, + # the same component name (e.g. "project") refers to IDs of the same + # type of resource. + # @!attribute [rw] name_field + # @return [::String] + # Optional. The field on the resource that designates the resource name + # field. If omitted, this is assumed to be "name". + # @!attribute [rw] history + # @return [::Google::Api::ResourceDescriptor::History] + # Optional. The historical or future-looking state of the resource pattern. + # + # Example: + # + # // The InspectTemplate message originally only supported resource + # // names with organization, and project was added later. + # message InspectTemplate { + # option (google.api.resource) = { + # type: "dlp.googleapis.com/InspectTemplate" + # pattern: + # "organizations/{organization}/inspectTemplates/{inspect_template}" + # pattern: "projects/{project}/inspectTemplates/{inspect_template}" + # history: ORIGINALLY_SINGLE_PATTERN + # }; + # } + # @!attribute [rw] plural + # @return [::String] + # The plural name used in the resource name and permission names, such as + # 'projects' for the resource name of 'projects/\\{project}' and the permission + # name of 'cloudresourcemanager.googleapis.com/projects.get'. One exception + # to this is for Nested Collections that have stuttering names, as defined + # in [AIP-122](https://google.aip.dev/122#nested-collections), where the + # collection ID in the resource name pattern does not necessarily directly + # match the `plural` value. + # + # It is the same concept of the `plural` field in k8s CRD spec + # https://kubernetes.io/docs/tasks/access-kubernetes-api/custom-resources/custom-resource-definitions/ + # + # Note: The plural form is required even for singleton resources. See + # https://aip.dev/156 + # @!attribute [rw] singular + # @return [::String] + # The same concept of the `singular` field in k8s CRD spec + # https://kubernetes.io/docs/tasks/access-kubernetes-api/custom-resources/custom-resource-definitions/ + # Such as "project" for the `resourcemanager.googleapis.com/Project` type. + # @!attribute [rw] style + # @return [::Array<::Google::Api::ResourceDescriptor::Style>] + # Style flag(s) for this resource. + # These indicate that a resource is expected to conform to a given + # style. See the specific style flags for additional information. + class ResourceDescriptor + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # A description of the historical or future-looking state of the + # resource pattern. + module History + # The "unset" value. + HISTORY_UNSPECIFIED = 0 + + # The resource originally had one pattern and launched as such, and + # additional patterns were added later. + ORIGINALLY_SINGLE_PATTERN = 1 + + # The resource has one pattern, but the API owner expects to add more + # later. (This is the inverse of ORIGINALLY_SINGLE_PATTERN, and prevents + # that from being necessary once there are multiple patterns.) + FUTURE_MULTI_PATTERN = 2 + end + + # A flag representing a specific style that a resource claims to conform to. + module Style + # The unspecified value. Do not use. + STYLE_UNSPECIFIED = 0 + + # This resource is intended to be "declarative-friendly". + # + # Declarative-friendly resources must be more strictly consistent, and + # setting this to true communicates to tools that this resource should + # adhere to declarative-friendly expectations. + # + # Note: This is used by the API linter (linter.aip.dev) to enable + # additional checks. + DECLARATIVE_FRIENDLY = 1 + end + end + + # Defines a proto annotation that describes a string field that refers to + # an API resource. + # @!attribute [rw] type + # @return [::String] + # The resource type that the annotated field references. + # + # Example: + # + # message Subscription { + # string topic = 2 [(google.api.resource_reference) = { + # type: "pubsub.googleapis.com/Topic" + # }]; + # } + # + # Occasionally, a field may reference an arbitrary resource. In this case, + # APIs use the special value * in their resource reference. + # + # Example: + # + # message GetIamPolicyRequest { + # string resource = 2 [(google.api.resource_reference) = { + # type: "*" + # }]; + # } + # @!attribute [rw] child_type + # @return [::String] + # The resource type of a child collection that the annotated field + # references. This is useful for annotating the `parent` field that + # doesn't have a fixed resource type. + # + # Example: + # + # message ListLogEntriesRequest { + # string parent = 1 [(google.api.resource_reference) = { + # child_type: "logging.googleapis.com/LogEntry" + # }; + # } + class ResourceReference + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end +end diff --git a/owl-bot-staging/google-cloud-scheduler-v1/proto_docs/google/cloud/scheduler/v1/cloudscheduler.rb b/owl-bot-staging/google-cloud-scheduler-v1/proto_docs/google/cloud/scheduler/v1/cloudscheduler.rb new file mode 100644 index 000000000000..7ec919d8b28e --- /dev/null +++ b/owl-bot-staging/google-cloud-scheduler-v1/proto_docs/google/cloud/scheduler/v1/cloudscheduler.rb @@ -0,0 +1,164 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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 Scheduler + module V1 + # Request message for listing jobs using + # {::Google::Cloud::Scheduler::V1::CloudScheduler::Client#list_jobs ListJobs}. + # @!attribute [rw] parent + # @return [::String] + # Required. The location name. For example: + # `projects/PROJECT_ID/locations/LOCATION_ID`. + # @!attribute [rw] page_size + # @return [::Integer] + # Requested page size. + # + # The maximum page size is 500. If unspecified, the page size will + # be the maximum. Fewer jobs than requested might be returned, + # even if more jobs exist; use next_page_token to determine if more + # jobs exist. + # @!attribute [rw] page_token + # @return [::String] + # A token identifying a page of results the server will return. To + # request the first page results, page_token must be empty. To + # request the next page of results, page_token must be the value of + # {::Google::Cloud::Scheduler::V1::ListJobsResponse#next_page_token next_page_token} + # returned from the previous call to + # {::Google::Cloud::Scheduler::V1::CloudScheduler::Client#list_jobs ListJobs}. + class ListJobsRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Response message for listing jobs using + # {::Google::Cloud::Scheduler::V1::CloudScheduler::Client#list_jobs ListJobs}. + # @!attribute [rw] jobs + # @return [::Array<::Google::Cloud::Scheduler::V1::Job>] + # The list of jobs. + # @!attribute [rw] next_page_token + # @return [::String] + # A token to retrieve next page of results. Pass this value in the + # {::Google::Cloud::Scheduler::V1::ListJobsRequest#page_token page_token} field in + # the subsequent call to + # {::Google::Cloud::Scheduler::V1::CloudScheduler::Client#list_jobs ListJobs} to retrieve + # the next page of results. If this is empty it indicates that there are no + # more results through which to paginate. + # + # The page token is valid for only 2 hours. + class ListJobsResponse + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Request message for + # {::Google::Cloud::Scheduler::V1::CloudScheduler::Client#get_job GetJob}. + # @!attribute [rw] name + # @return [::String] + # Required. The job name. For example: + # `projects/PROJECT_ID/locations/LOCATION_ID/jobs/JOB_ID`. + class GetJobRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Request message for + # {::Google::Cloud::Scheduler::V1::CloudScheduler::Client#create_job CreateJob}. + # @!attribute [rw] parent + # @return [::String] + # Required. The location name. For example: + # `projects/PROJECT_ID/locations/LOCATION_ID`. + # @!attribute [rw] job + # @return [::Google::Cloud::Scheduler::V1::Job] + # Required. The job to add. The user can optionally specify a name for the + # job in {::Google::Cloud::Scheduler::V1::Job#name name}. + # {::Google::Cloud::Scheduler::V1::Job#name name} cannot be the same as an + # existing job. If a name is not specified then the system will + # generate a random unique name that will be returned + # ({::Google::Cloud::Scheduler::V1::Job#name name}) in the response. + class CreateJobRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Request message for + # {::Google::Cloud::Scheduler::V1::CloudScheduler::Client#update_job UpdateJob}. + # @!attribute [rw] job + # @return [::Google::Cloud::Scheduler::V1::Job] + # Required. The new job properties. + # {::Google::Cloud::Scheduler::V1::Job#name name} must be specified. + # + # Output only fields cannot be modified using UpdateJob. + # Any value specified for an output only field will be ignored. + # @!attribute [rw] update_mask + # @return [::Google::Protobuf::FieldMask] + # A mask used to specify which fields of the job are being updated. + class UpdateJobRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Request message for deleting a job using + # {::Google::Cloud::Scheduler::V1::CloudScheduler::Client#delete_job DeleteJob}. + # @!attribute [rw] name + # @return [::String] + # Required. The job name. For example: + # `projects/PROJECT_ID/locations/LOCATION_ID/jobs/JOB_ID`. + class DeleteJobRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Request message for + # {::Google::Cloud::Scheduler::V1::CloudScheduler::Client#pause_job PauseJob}. + # @!attribute [rw] name + # @return [::String] + # Required. The job name. For example: + # `projects/PROJECT_ID/locations/LOCATION_ID/jobs/JOB_ID`. + class PauseJobRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Request message for + # {::Google::Cloud::Scheduler::V1::CloudScheduler::Client#resume_job ResumeJob}. + # @!attribute [rw] name + # @return [::String] + # Required. The job name. For example: + # `projects/PROJECT_ID/locations/LOCATION_ID/jobs/JOB_ID`. + class ResumeJobRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Request message for forcing a job to run now using + # {::Google::Cloud::Scheduler::V1::CloudScheduler::Client#run_job RunJob}. + # @!attribute [rw] name + # @return [::String] + # Required. The job name. For example: + # `projects/PROJECT_ID/locations/LOCATION_ID/jobs/JOB_ID`. + class RunJobRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-scheduler-v1/proto_docs/google/cloud/scheduler/v1/job.rb b/owl-bot-staging/google-cloud-scheduler-v1/proto_docs/google/cloud/scheduler/v1/job.rb new file mode 100644 index 000000000000..b37a1e462593 --- /dev/null +++ b/owl-bot-staging/google-cloud-scheduler-v1/proto_docs/google/cloud/scheduler/v1/job.rb @@ -0,0 +1,264 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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 Scheduler + module V1 + # Configuration for a job. + # The maximum allowed size for a job is 1MB. + # @!attribute [rw] name + # @return [::String] + # Optionally caller-specified in + # {::Google::Cloud::Scheduler::V1::CloudScheduler::Client#create_job CreateJob}, after + # which it becomes output only. + # + # The job name. For example: + # `projects/PROJECT_ID/locations/LOCATION_ID/jobs/JOB_ID`. + # + # * `PROJECT_ID` can contain letters ([A-Za-z]), numbers ([0-9]), + # hyphens (-), colons (:), or periods (.). + # For more information, see + # [Identifying + # projects](https://cloud.google.com/resource-manager/docs/creating-managing-projects#identifying_projects) + # * `LOCATION_ID` is the canonical ID for the job's location. + # The list of available locations can be obtained by calling + # [ListLocations][google.cloud.location.Locations.ListLocations]. + # For more information, see https://cloud.google.com/about/locations/. + # * `JOB_ID` can contain only letters ([A-Za-z]), numbers ([0-9]), + # hyphens (-), or underscores (_). The maximum length is 500 characters. + # @!attribute [rw] description + # @return [::String] + # Optionally caller-specified in + # {::Google::Cloud::Scheduler::V1::CloudScheduler::Client#create_job CreateJob} or + # {::Google::Cloud::Scheduler::V1::CloudScheduler::Client#update_job UpdateJob}. + # + # A human-readable description for the job. This string must not contain + # more than 500 characters. + # @!attribute [rw] pubsub_target + # @return [::Google::Cloud::Scheduler::V1::PubsubTarget] + # Pub/Sub target. + # + # Note: The following fields are mutually exclusive: `pubsub_target`, `app_engine_http_target`, `http_target`. If a field in that set is populated, all other fields in the set will automatically be cleared. + # @!attribute [rw] app_engine_http_target + # @return [::Google::Cloud::Scheduler::V1::AppEngineHttpTarget] + # App Engine HTTP target. + # + # Note: The following fields are mutually exclusive: `app_engine_http_target`, `pubsub_target`, `http_target`. If a field in that set is populated, all other fields in the set will automatically be cleared. + # @!attribute [rw] http_target + # @return [::Google::Cloud::Scheduler::V1::HttpTarget] + # HTTP target. + # + # Note: The following fields are mutually exclusive: `http_target`, `pubsub_target`, `app_engine_http_target`. If a field in that set is populated, all other fields in the set will automatically be cleared. + # @!attribute [rw] schedule + # @return [::String] + # Required, except when used with + # {::Google::Cloud::Scheduler::V1::CloudScheduler::Client#update_job UpdateJob}. + # + # Describes the schedule on which the job will be executed. + # + # The schedule can be either of the following types: + # + # * [Crontab](https://en.wikipedia.org/wiki/Cron#Overview) + # * English-like + # [schedule](https://cloud.google.com/scheduler/docs/configuring/cron-job-schedules) + # + # As a general rule, execution `n + 1` of a job will not begin + # until execution `n` has finished. Cloud Scheduler will never + # allow two simultaneously outstanding executions. For example, + # this implies that if the `n+1`th execution is scheduled to run at + # 16:00 but the `n`th execution takes until 16:15, the `n+1`th + # execution will not start until `16:15`. + # A scheduled start time will be delayed if the previous + # execution has not ended when its scheduled time occurs. + # + # If {::Google::Cloud::Scheduler::V1::RetryConfig#retry_count retry_count} > 0 and + # a job attempt fails, the job will be tried a total of + # {::Google::Cloud::Scheduler::V1::RetryConfig#retry_count retry_count} times, + # with exponential backoff, until the next scheduled start time. If + # retry_count is 0, a job attempt will not be retried if it fails. Instead + # the Cloud Scheduler system will wait for the next scheduled execution time. + # Setting retry_count to 0 does not prevent failed jobs from running + # according to schedule after the failure. + # @!attribute [rw] time_zone + # @return [::String] + # Specifies the time zone to be used in interpreting + # {::Google::Cloud::Scheduler::V1::Job#schedule schedule}. The value of this field + # must be a time zone name from the [tz + # database](http://en.wikipedia.org/wiki/Tz_database). + # + # Note that some time zones include a provision for + # daylight savings time. The rules for daylight saving time are + # determined by the chosen tz. For UTC use the string "utc". If a + # time zone is not specified, the default will be in UTC (also known + # as GMT). + # @!attribute [r] user_update_time + # @return [::Google::Protobuf::Timestamp] + # Output only. The creation time of the job. + # @!attribute [r] state + # @return [::Google::Cloud::Scheduler::V1::Job::State] + # Output only. State of the job. + # @!attribute [r] status + # @return [::Google::Rpc::Status] + # Output only. The response from the target for the last attempted execution. + # @!attribute [r] schedule_time + # @return [::Google::Protobuf::Timestamp] + # Output only. The next time the job is scheduled. Note that this may be a + # retry of a previously failed attempt or the next execution time + # according to the schedule. + # @!attribute [r] last_attempt_time + # @return [::Google::Protobuf::Timestamp] + # Output only. The time the last job attempt started. + # @!attribute [rw] retry_config + # @return [::Google::Cloud::Scheduler::V1::RetryConfig] + # Settings that determine the retry behavior. + # @!attribute [rw] attempt_deadline + # @return [::Google::Protobuf::Duration] + # The deadline for job attempts. If the request handler does not respond by + # this deadline then the request is cancelled and the attempt is marked as a + # `DEADLINE_EXCEEDED` failure. The failed attempt can be viewed in + # execution logs. Cloud Scheduler will retry the job according + # to the {::Google::Cloud::Scheduler::V1::RetryConfig RetryConfig}. + # + # The default and the allowed values depend on the type of target: + # + # * For {::Google::Cloud::Scheduler::V1::Job#http_target HTTP targets}, the + # default is 3 minutes. The deadline must be in the interval [15 seconds, 30 + # minutes]. + # + # * For [App Engine HTTP + # targets][google.cloud.scheduler.v1.Job.app_engine_http_target], 0 indicates + # that the request has the default deadline. The default deadline depends on + # the scaling type of the service: 10 minutes for standard apps with + # automatic scaling, 24 hours for standard apps with manual and basic + # scaling, and 60 minutes for flex apps. If the request deadline is set, it + # must be in the interval [15 seconds, 24 hours 15 seconds]. + # + # * For [Pub/Sub targets][google.cloud.scheduler.v1.Job.pubsub_target], this + # field is ignored. + class Job + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # State of the job. + module State + # Unspecified state. + STATE_UNSPECIFIED = 0 + + # The job is executing normally. + ENABLED = 1 + + # The job is paused by the user. It will not execute. A user can + # intentionally pause the job using + # {::Google::Cloud::Scheduler::V1::PauseJobRequest PauseJobRequest}. + PAUSED = 2 + + # The job is disabled by the system due to error. The user + # cannot directly set a job to be disabled. + DISABLED = 3 + + # The job state resulting from a failed + # {::Google::Cloud::Scheduler::V1::CloudScheduler::Client#update_job CloudScheduler.UpdateJob} + # operation. To recover a job from this state, retry + # {::Google::Cloud::Scheduler::V1::CloudScheduler::Client#update_job CloudScheduler.UpdateJob} + # until a successful response is received. + UPDATE_FAILED = 4 + end + end + + # Settings that determine the retry behavior. + # + # By default, if a job does not complete successfully (meaning that + # an acknowledgement is not received from the handler, then it will be retried + # with exponential backoff according to the settings in + # {::Google::Cloud::Scheduler::V1::RetryConfig RetryConfig}. + # @!attribute [rw] retry_count + # @return [::Integer] + # The number of attempts that the system will make to run a job using the + # exponential backoff procedure described by + # {::Google::Cloud::Scheduler::V1::RetryConfig#max_doublings max_doublings}. + # + # The default value of retry_count is zero. + # + # If retry_count is 0, a job attempt will not be retried if + # it fails. Instead the Cloud Scheduler system will wait for the + # next scheduled execution time. Setting retry_count to 0 does not prevent + # failed jobs from running according to schedule after the failure. + # + # If retry_count is set to a non-zero number then Cloud Scheduler + # will retry failed attempts, using exponential backoff, + # retry_count times, or until the next scheduled execution time, + # whichever comes first. + # + # Values greater than 5 and negative values are not allowed. + # @!attribute [rw] max_retry_duration + # @return [::Google::Protobuf::Duration] + # The time limit for retrying a failed job, measured from time when an + # execution was first attempted. If specified with + # {::Google::Cloud::Scheduler::V1::RetryConfig#retry_count retry_count}, the job + # will be retried until both limits are reached. + # + # The default value for max_retry_duration is zero, which means retry + # duration is unlimited. + # @!attribute [rw] min_backoff_duration + # @return [::Google::Protobuf::Duration] + # The minimum amount of time to wait before retrying a job after + # it fails. + # + # The default value of this field is 5 seconds. + # @!attribute [rw] max_backoff_duration + # @return [::Google::Protobuf::Duration] + # The maximum amount of time to wait before retrying a job after + # it fails. + # + # The default value of this field is 1 hour. + # @!attribute [rw] max_doublings + # @return [::Integer] + # The time between retries will double `max_doublings` times. + # + # A job's retry interval starts at + # {::Google::Cloud::Scheduler::V1::RetryConfig#min_backoff_duration min_backoff_duration}, + # then doubles `max_doublings` times, then increases linearly, and finally + # retries at intervals of + # {::Google::Cloud::Scheduler::V1::RetryConfig#max_backoff_duration max_backoff_duration} + # up to {::Google::Cloud::Scheduler::V1::RetryConfig#retry_count retry_count} + # times. + # + # For example, if + # {::Google::Cloud::Scheduler::V1::RetryConfig#min_backoff_duration min_backoff_duration} + # is 10s, + # {::Google::Cloud::Scheduler::V1::RetryConfig#max_backoff_duration max_backoff_duration} + # is 300s, and `max_doublings` is 3, then the job will first be retried in + # 10s. The retry interval will double three times, and then increase linearly + # by 2^3 * 10s. Finally, the job will retry at intervals of + # {::Google::Cloud::Scheduler::V1::RetryConfig#max_backoff_duration max_backoff_duration} + # until the job has been attempted + # {::Google::Cloud::Scheduler::V1::RetryConfig#retry_count retry_count} times. + # Thus, the requests will retry at 10s, 20s, 40s, 80s, 160s, 240s, 300s, + # 300s, .... + # + # The default value of this field is 5. + class RetryConfig + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-scheduler-v1/proto_docs/google/cloud/scheduler/v1/target.rb b/owl-bot-staging/google-cloud-scheduler-v1/proto_docs/google/cloud/scheduler/v1/target.rb new file mode 100644 index 000000000000..e272bf407ead --- /dev/null +++ b/owl-bot-staging/google-cloud-scheduler-v1/proto_docs/google/cloud/scheduler/v1/target.rb @@ -0,0 +1,420 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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 Scheduler + module V1 + # Http target. The job will be pushed to the job handler by means of + # an HTTP request via an + # {::Google::Cloud::Scheduler::V1::HttpTarget#http_method http_method} such as HTTP + # POST, HTTP GET, etc. The job is acknowledged by means of an HTTP + # response code in the range [200 - 299]. A failure to receive a response + # constitutes a failed execution. For a redirected request, the response + # returned by the redirected request is considered. + # @!attribute [rw] uri + # @return [::String] + # Required. The full URI path that the request will be sent to. This string + # must begin with either "http://" or "https://". Some examples of + # valid values for {::Google::Cloud::Scheduler::V1::HttpTarget#uri uri} are: + # `http://acme.com` and `https://acme.com/sales:8080`. Cloud Scheduler will + # encode some characters for safety and compatibility. The maximum allowed + # URL length is 2083 characters after encoding. + # @!attribute [rw] http_method + # @return [::Google::Cloud::Scheduler::V1::HttpMethod] + # Which HTTP method to use for the request. + # @!attribute [rw] headers + # @return [::Google::Protobuf::Map{::String => ::String}] + # HTTP request headers. + # + # This map contains the header field names and values. + # + # The user can specify HTTP request headers to send with the job's + # HTTP request. Repeated headers are not supported, but a header value can + # contain commas. + # + # The following headers represent a subset of the headers + # that accompany the job's HTTP request. Some HTTP request + # headers are ignored or replaced. A partial list of headers that + # are ignored or replaced is below: + # + # * Host: This will be computed by Cloud Scheduler and derived from + # {::Google::Cloud::Scheduler::V1::HttpTarget#uri uri}. + # * `Content-Length`: This will be computed by Cloud Scheduler. + # * `User-Agent`: This will be set to `"Google-Cloud-Scheduler"`. + # * `X-Google-*`: Google internal use only. + # * `X-AppEngine-*`: Google internal use only. + # * `X-CloudScheduler`: This header will be set to true. + # * `X-CloudScheduler-JobName`: This header will contain the job name. + # * `X-CloudScheduler-ScheduleTime`: For Cloud Scheduler jobs specified in + # the unix-cron format, this header will contain the job schedule as an + # offset of UTC parsed according to RFC3339. + # + # If the job has a {::Google::Cloud::Scheduler::V1::HttpTarget#body body} and the + # following headers are not set by the user, Cloud Scheduler sets default + # values: + # + # * `Content-Type`: This will be set to `"application/octet-stream"`. You + # can override this default by explicitly setting `Content-Type` to a + # particular media type when creating the job. For example, you can set + # `Content-Type` to `"application/json"`. + # + # The total size of headers must be less than 80KB. + # @!attribute [rw] body + # @return [::String] + # HTTP request body. A request body is allowed only if the HTTP + # method is POST, PUT, or PATCH. It is an error to set body on a job with an + # incompatible {::Google::Cloud::Scheduler::V1::HttpMethod HttpMethod}. + # @!attribute [rw] oauth_token + # @return [::Google::Cloud::Scheduler::V1::OAuthToken] + # If specified, an + # [OAuth token](https://developers.google.com/identity/protocols/OAuth2) + # will be generated and attached as an `Authorization` header in the HTTP + # request. + # + # This type of authorization should generally only be used when calling + # Google APIs hosted on *.googleapis.com. + # + # Note: The following fields are mutually exclusive: `oauth_token`, `oidc_token`. If a field in that set is populated, all other fields in the set will automatically be cleared. + # @!attribute [rw] oidc_token + # @return [::Google::Cloud::Scheduler::V1::OidcToken] + # If specified, an + # [OIDC](https://developers.google.com/identity/protocols/OpenIDConnect) + # token will be generated and attached as an `Authorization` header in the + # HTTP request. + # + # This type of authorization can be used for many scenarios, including + # calling Cloud Run, or endpoints where you intend to validate the token + # yourself. + # + # Note: The following fields are mutually exclusive: `oidc_token`, `oauth_token`. If a field in that set is populated, all other fields in the set will automatically be cleared. + class HttpTarget + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # @!attribute [rw] key + # @return [::String] + # @!attribute [rw] value + # @return [::String] + class HeadersEntry + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end + + # App Engine target. The job will be pushed to a job handler by means + # of an HTTP request via an + # {::Google::Cloud::Scheduler::V1::AppEngineHttpTarget#http_method http_method} such + # as HTTP POST, HTTP GET, etc. The job is acknowledged by means of an + # HTTP response code in the range [200 - 299]. Error 503 is + # considered an App Engine system error instead of an application + # error. Requests returning error 503 will be retried regardless of + # retry configuration and not counted against retry counts. Any other + # response code, or a failure to receive a response before the + # deadline, constitutes a failed attempt. + # @!attribute [rw] http_method + # @return [::Google::Cloud::Scheduler::V1::HttpMethod] + # The HTTP method to use for the request. PATCH and OPTIONS are not + # permitted. + # @!attribute [rw] app_engine_routing + # @return [::Google::Cloud::Scheduler::V1::AppEngineRouting] + # App Engine Routing setting for the job. + # @!attribute [rw] relative_uri + # @return [::String] + # The relative URI. + # + # The relative URL must begin with "/" and must be a valid HTTP relative URL. + # It can contain a path, query string arguments, and `#` fragments. + # If the relative URL is empty, then the root path "/" will be used. + # No spaces are allowed, and the maximum length allowed is 2083 characters. + # @!attribute [rw] headers + # @return [::Google::Protobuf::Map{::String => ::String}] + # HTTP request headers. + # + # This map contains the header field names and values. Headers can be set + # when the job is created. + # + # Cloud Scheduler sets some headers to default values: + # + # * `User-Agent`: By default, this header is + # `"AppEngine-Google; (+http://code.google.com/appengine)"`. + # This header can be modified, but Cloud Scheduler will append + # `"AppEngine-Google; (+http://code.google.com/appengine)"` to the + # modified `User-Agent`. + # * `X-CloudScheduler`: This header will be set to true. + # * `X-CloudScheduler-JobName`: This header will contain the job name. + # * `X-CloudScheduler-ScheduleTime`: For Cloud Scheduler jobs specified in + # the unix-cron format, this header will contain the job schedule as an + # offset of UTC parsed according to RFC3339. + # + # If the job has a {::Google::Cloud::Scheduler::V1::AppEngineHttpTarget#body body} + # and the following headers are not set by the user, Cloud Scheduler sets + # default values: + # + # * `Content-Type`: This will be set to `"application/octet-stream"`. You + # can override this default by explicitly setting `Content-Type` to a + # particular media type when creating the job. For example, you can set + # `Content-Type` to `"application/json"`. + # + # The headers below are output only. They cannot be set or overridden: + # + # * `Content-Length`: This is computed by Cloud Scheduler. + # * `X-Google-*`: For Google internal use only. + # * `X-AppEngine-*`: For Google internal use only. + # + # In addition, some App Engine headers, which contain + # job-specific information, are also be sent to the job handler. + # @!attribute [rw] body + # @return [::String] + # Body. + # + # HTTP request body. A request body is allowed only if the HTTP method is + # POST or PUT. It will result in invalid argument error to set a body on a + # job with an incompatible + # {::Google::Cloud::Scheduler::V1::HttpMethod HttpMethod}. + class AppEngineHttpTarget + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # @!attribute [rw] key + # @return [::String] + # @!attribute [rw] value + # @return [::String] + class HeadersEntry + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end + + # Pub/Sub target. The job will be delivered by publishing a message to + # the given Pub/Sub topic. + # @!attribute [rw] topic_name + # @return [::String] + # Required. The name of the Cloud Pub/Sub topic to which messages will + # be published when a job is delivered. The topic name must be in the + # same format as required by Pub/Sub's + # [PublishRequest.name](https://cloud.google.com/pubsub/docs/reference/rpc/google.pubsub.v1#publishrequest), + # for example `projects/PROJECT_ID/topics/TOPIC_ID`. + # + # The topic must be in the same project as the Cloud Scheduler job. + # @!attribute [rw] data + # @return [::String] + # The message payload for PubsubMessage. + # + # Pubsub message must contain either non-empty data, or at least one + # attribute. + # @!attribute [rw] attributes + # @return [::Google::Protobuf::Map{::String => ::String}] + # Attributes for PubsubMessage. + # + # Pubsub message must contain either non-empty data, or at least one + # attribute. + class PubsubTarget + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # @!attribute [rw] key + # @return [::String] + # @!attribute [rw] value + # @return [::String] + class AttributesEntry + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end + + # App Engine Routing. + # + # For more information about services, versions, and instances see + # [An Overview of App + # Engine](https://cloud.google.com/appengine/docs/python/an-overview-of-app-engine), + # [Microservices Architecture on Google App + # Engine](https://cloud.google.com/appengine/docs/python/microservices-on-app-engine), + # [App Engine Standard request + # routing](https://cloud.google.com/appengine/docs/standard/python/how-requests-are-routed), + # and [App Engine Flex request + # routing](https://cloud.google.com/appengine/docs/flexible/python/how-requests-are-routed). + # @!attribute [rw] service + # @return [::String] + # App service. + # + # By default, the job is sent to the service which is the default + # service when the job is attempted. + # @!attribute [rw] version + # @return [::String] + # App version. + # + # By default, the job is sent to the version which is the default + # version when the job is attempted. + # @!attribute [rw] instance + # @return [::String] + # App instance. + # + # By default, the job is sent to an instance which is available when + # the job is attempted. + # + # Requests can only be sent to a specific instance if + # [manual scaling is used in App Engine + # Standard](https://cloud.google.com/appengine/docs/python/an-overview-of-app-engine?#scaling_types_and_instance_classes). + # App Engine Flex does not support instances. For more information, see + # [App Engine Standard request + # routing](https://cloud.google.com/appengine/docs/standard/python/how-requests-are-routed) + # and [App Engine Flex request + # routing](https://cloud.google.com/appengine/docs/flexible/python/how-requests-are-routed). + # @!attribute [rw] host + # @return [::String] + # Output only. The host that the job is sent to. + # + # For more information about how App Engine requests are routed, see + # [here](https://cloud.google.com/appengine/docs/standard/python/how-requests-are-routed). + # + # The host is constructed as: + # + # + # * `host = [application_domain_name]`
+ # `| [service] + '.' + [application_domain_name]`
+ # `| [version] + '.' + [application_domain_name]`
+ # `| [version_dot_service]+ '.' + [application_domain_name]`
+ # `| [instance] + '.' + [application_domain_name]`
+ # `| [instance_dot_service] + '.' + [application_domain_name]`
+ # `| [instance_dot_version] + '.' + [application_domain_name]`
+ # `| [instance_dot_version_dot_service] + '.' + [application_domain_name]` + # + # * `application_domain_name` = The domain name of the app, for + # example .appspot.com, which is associated with the + # job's project ID. + # + # * `service =` {::Google::Cloud::Scheduler::V1::AppEngineRouting#service service} + # + # * `version =` {::Google::Cloud::Scheduler::V1::AppEngineRouting#version version} + # + # * `version_dot_service =` + # {::Google::Cloud::Scheduler::V1::AppEngineRouting#version version} `+ '.' +` + # {::Google::Cloud::Scheduler::V1::AppEngineRouting#service service} + # + # * `instance =` + # {::Google::Cloud::Scheduler::V1::AppEngineRouting#instance instance} + # + # * `instance_dot_service =` + # {::Google::Cloud::Scheduler::V1::AppEngineRouting#instance instance} `+ '.' +` + # {::Google::Cloud::Scheduler::V1::AppEngineRouting#service service} + # + # * `instance_dot_version =` + # {::Google::Cloud::Scheduler::V1::AppEngineRouting#instance instance} `+ '.' +` + # {::Google::Cloud::Scheduler::V1::AppEngineRouting#version version} + # + # * `instance_dot_version_dot_service =` + # {::Google::Cloud::Scheduler::V1::AppEngineRouting#instance instance} `+ '.' +` + # {::Google::Cloud::Scheduler::V1::AppEngineRouting#version version} `+ '.' +` + # {::Google::Cloud::Scheduler::V1::AppEngineRouting#service service} + # + # + # If {::Google::Cloud::Scheduler::V1::AppEngineRouting#service service} is empty, + # then the job will be sent to the service which is the default service when + # the job is attempted. + # + # If {::Google::Cloud::Scheduler::V1::AppEngineRouting#version version} is empty, + # then the job will be sent to the version which is the default version when + # the job is attempted. + # + # If {::Google::Cloud::Scheduler::V1::AppEngineRouting#instance instance} is + # empty, then the job will be sent to an instance which is available when the + # job is attempted. + # + # If {::Google::Cloud::Scheduler::V1::AppEngineRouting#service service}, + # {::Google::Cloud::Scheduler::V1::AppEngineRouting#version version}, or + # {::Google::Cloud::Scheduler::V1::AppEngineRouting#instance instance} is invalid, + # then the job will be sent to the default version of the default service + # when the job is attempted. + class AppEngineRouting + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Contains information needed for generating an + # [OAuth token](https://developers.google.com/identity/protocols/OAuth2). + # This type of authorization should generally only be used when calling Google + # APIs hosted on *.googleapis.com. + # @!attribute [rw] service_account_email + # @return [::String] + # [Service account email](https://cloud.google.com/iam/docs/service-accounts) + # to be used for generating OAuth token. + # The service account must be within the same project as the job. The caller + # must have iam.serviceAccounts.actAs permission for the service account. + # @!attribute [rw] scope + # @return [::String] + # OAuth scope to be used for generating OAuth access token. + # If not specified, "https://www.googleapis.com/auth/cloud-platform" + # will be used. + class OAuthToken + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Contains information needed for generating an + # [OpenID Connect + # token](https://developers.google.com/identity/protocols/OpenIDConnect). + # This type of authorization can be used for many scenarios, including + # calling Cloud Run, or endpoints where you intend to validate the token + # yourself. + # @!attribute [rw] service_account_email + # @return [::String] + # [Service account email](https://cloud.google.com/iam/docs/service-accounts) + # to be used for generating OIDC token. + # The service account must be within the same project as the job. The caller + # must have iam.serviceAccounts.actAs permission for the service account. + # @!attribute [rw] audience + # @return [::String] + # Audience to be used when generating OIDC token. If not specified, the URI + # specified in target will be used. + class OidcToken + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # The HTTP method used to execute the job. + module HttpMethod + # HTTP method unspecified. Defaults to POST. + HTTP_METHOD_UNSPECIFIED = 0 + + # HTTP POST + POST = 1 + + # HTTP GET + GET = 2 + + # HTTP HEAD + HEAD = 3 + + # HTTP PUT + PUT = 4 + + # HTTP DELETE + DELETE = 5 + + # HTTP PATCH + PATCH = 6 + + # HTTP OPTIONS + OPTIONS = 7 + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-scheduler-v1/proto_docs/google/protobuf/any.rb b/owl-bot-staging/google-cloud-scheduler-v1/proto_docs/google/protobuf/any.rb new file mode 100644 index 000000000000..58691995f02e --- /dev/null +++ b/owl-bot-staging/google-cloud-scheduler-v1/proto_docs/google/protobuf/any.rb @@ -0,0 +1,145 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + + +module Google + module Protobuf + # `Any` contains an arbitrary serialized protocol buffer message along with a + # URL that describes the type of the serialized message. + # + # Protobuf library provides support to pack/unpack Any values in the form + # of utility functions or additional generated methods of the Any type. + # + # Example 1: Pack and unpack a message in C++. + # + # Foo foo = ...; + # Any any; + # any.PackFrom(foo); + # ... + # if (any.UnpackTo(&foo)) { + # ... + # } + # + # Example 2: Pack and unpack a message in Java. + # + # Foo foo = ...; + # Any any = Any.pack(foo); + # ... + # if (any.is(Foo.class)) { + # foo = any.unpack(Foo.class); + # } + # // or ... + # if (any.isSameTypeAs(Foo.getDefaultInstance())) { + # foo = any.unpack(Foo.getDefaultInstance()); + # } + # + # Example 3: Pack and unpack a message in Python. + # + # foo = Foo(...) + # any = Any() + # any.Pack(foo) + # ... + # if any.Is(Foo.DESCRIPTOR): + # any.Unpack(foo) + # ... + # + # Example 4: Pack and unpack a message in Go + # + # foo := &pb.Foo{...} + # any, err := anypb.New(foo) + # if err != nil { + # ... + # } + # ... + # foo := &pb.Foo{} + # if err := any.UnmarshalTo(foo); err != nil { + # ... + # } + # + # The pack methods provided by protobuf library will by default use + # 'type.googleapis.com/full.type.name' as the type URL and the unpack + # methods only use the fully qualified type name after the last '/' + # in the type URL, for example "foo.bar.com/x/y.z" will yield type + # name "y.z". + # + # JSON + # ==== + # The JSON representation of an `Any` value uses the regular + # representation of the deserialized, embedded message, with an + # additional field `@type` which contains the type URL. Example: + # + # package google.profile; + # message Person { + # string first_name = 1; + # string last_name = 2; + # } + # + # { + # "@type": "type.googleapis.com/google.profile.Person", + # "firstName": , + # "lastName": + # } + # + # If the embedded message type is well-known and has a custom JSON + # representation, that representation will be embedded adding a field + # `value` which holds the custom JSON in addition to the `@type` + # field. Example (for message [google.protobuf.Duration][]): + # + # { + # "@type": "type.googleapis.com/google.protobuf.Duration", + # "value": "1.212s" + # } + # @!attribute [rw] type_url + # @return [::String] + # A URL/resource name that uniquely identifies the type of the serialized + # protocol buffer message. This string must contain at least + # one "/" character. The last segment of the URL's path must represent + # the fully qualified name of the type (as in + # `path/google.protobuf.Duration`). The name should be in a canonical form + # (e.g., leading "." is not accepted). + # + # In practice, teams usually precompile into the binary all types that they + # expect it to use in the context of Any. However, for URLs which use the + # scheme `http`, `https`, or no scheme, one can optionally set up a type + # server that maps type URLs to message definitions as follows: + # + # * If no scheme is provided, `https` is assumed. + # * An HTTP GET on the URL must yield a [google.protobuf.Type][] + # value in binary format, or produce an error. + # * Applications are allowed to cache lookup results based on the + # URL, or have them precompiled into a binary to avoid any + # lookup. Therefore, binary compatibility needs to be preserved + # on changes to types. (Use versioned type names to manage + # breaking changes.) + # + # Note: this functionality is not currently available in the official + # protobuf release, and it is not used for type URLs beginning with + # type.googleapis.com. As of May 2023, there are no widely used type server + # implementations and no plans to implement one. + # + # Schemes other than `http`, `https` (or the empty scheme) might be + # used with implementation specific semantics. + # @!attribute [rw] value + # @return [::String] + # Must be a valid serialized protocol buffer of the above specified type. + class Any + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end +end diff --git a/owl-bot-staging/google-cloud-scheduler-v1/proto_docs/google/protobuf/duration.rb b/owl-bot-staging/google-cloud-scheduler-v1/proto_docs/google/protobuf/duration.rb new file mode 100644 index 000000000000..ea59f1f91daf --- /dev/null +++ b/owl-bot-staging/google-cloud-scheduler-v1/proto_docs/google/protobuf/duration.rb @@ -0,0 +1,98 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + + +module Google + module Protobuf + # A Duration represents a signed, fixed-length span of time represented + # as a count of seconds and fractions of seconds at nanosecond + # resolution. It is independent of any calendar and concepts like "day" + # or "month". It is related to Timestamp in that the difference between + # two Timestamp values is a Duration and it can be added or subtracted + # from a Timestamp. Range is approximately +-10,000 years. + # + # # Examples + # + # Example 1: Compute Duration from two Timestamps in pseudo code. + # + # Timestamp start = ...; + # Timestamp end = ...; + # Duration duration = ...; + # + # duration.seconds = end.seconds - start.seconds; + # duration.nanos = end.nanos - start.nanos; + # + # if (duration.seconds < 0 && duration.nanos > 0) { + # duration.seconds += 1; + # duration.nanos -= 1000000000; + # } else if (duration.seconds > 0 && duration.nanos < 0) { + # duration.seconds -= 1; + # duration.nanos += 1000000000; + # } + # + # Example 2: Compute Timestamp from Timestamp + Duration in pseudo code. + # + # Timestamp start = ...; + # Duration duration = ...; + # Timestamp end = ...; + # + # end.seconds = start.seconds + duration.seconds; + # end.nanos = start.nanos + duration.nanos; + # + # if (end.nanos < 0) { + # end.seconds -= 1; + # end.nanos += 1000000000; + # } else if (end.nanos >= 1000000000) { + # end.seconds += 1; + # end.nanos -= 1000000000; + # } + # + # Example 3: Compute Duration from datetime.timedelta in Python. + # + # td = datetime.timedelta(days=3, minutes=10) + # duration = Duration() + # duration.FromTimedelta(td) + # + # # JSON Mapping + # + # In JSON format, the Duration type is encoded as a string rather than an + # object, where the string ends in the suffix "s" (indicating seconds) and + # is preceded by the number of seconds, with nanoseconds expressed as + # fractional seconds. For example, 3 seconds with 0 nanoseconds should be + # encoded in JSON format as "3s", while 3 seconds and 1 nanosecond should + # be expressed in JSON format as "3.000000001s", and 3 seconds and 1 + # microsecond should be expressed in JSON format as "3.000001s". + # @!attribute [rw] seconds + # @return [::Integer] + # Signed seconds of the span of time. Must be from -315,576,000,000 + # to +315,576,000,000 inclusive. Note: these bounds are computed from: + # 60 sec/min * 60 min/hr * 24 hr/day * 365.25 days/year * 10000 years + # @!attribute [rw] nanos + # @return [::Integer] + # Signed fractions of a second at nanosecond resolution of the span + # of time. Durations less than one second are represented with a 0 + # `seconds` field and a positive or negative `nanos` field. For durations + # of one second or more, a non-zero value for the `nanos` field must be + # of the same sign as the `seconds` field. Must be from -999,999,999 + # to +999,999,999 inclusive. + class Duration + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end +end diff --git a/owl-bot-staging/google-cloud-scheduler-v1/proto_docs/google/protobuf/empty.rb b/owl-bot-staging/google-cloud-scheduler-v1/proto_docs/google/protobuf/empty.rb new file mode 100644 index 000000000000..83e4481834a6 --- /dev/null +++ b/owl-bot-staging/google-cloud-scheduler-v1/proto_docs/google/protobuf/empty.rb @@ -0,0 +1,34 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + + +module Google + module Protobuf + # A generic empty message that you can re-use to avoid defining duplicated + # empty messages in your APIs. A typical example is to use it as the request + # or the response type of an API method. For instance: + # + # service Foo { + # rpc Bar(google.protobuf.Empty) returns (google.protobuf.Empty); + # } + class Empty + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end +end diff --git a/owl-bot-staging/google-cloud-scheduler-v1/proto_docs/google/protobuf/field_mask.rb b/owl-bot-staging/google-cloud-scheduler-v1/proto_docs/google/protobuf/field_mask.rb new file mode 100644 index 000000000000..7f3ffc78601a --- /dev/null +++ b/owl-bot-staging/google-cloud-scheduler-v1/proto_docs/google/protobuf/field_mask.rb @@ -0,0 +1,229 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + + +module Google + module Protobuf + # `FieldMask` represents a set of symbolic field paths, for example: + # + # paths: "f.a" + # paths: "f.b.d" + # + # Here `f` represents a field in some root message, `a` and `b` + # fields in the message found in `f`, and `d` a field found in the + # message in `f.b`. + # + # Field masks are used to specify a subset of fields that should be + # returned by a get operation or modified by an update operation. + # Field masks also have a custom JSON encoding (see below). + # + # # Field Masks in Projections + # + # When used in the context of a projection, a response message or + # sub-message is filtered by the API to only contain those fields as + # specified in the mask. For example, if the mask in the previous + # example is applied to a response message as follows: + # + # f { + # a : 22 + # b { + # d : 1 + # x : 2 + # } + # y : 13 + # } + # z: 8 + # + # The result will not contain specific values for fields x,y and z + # (their value will be set to the default, and omitted in proto text + # output): + # + # + # f { + # a : 22 + # b { + # d : 1 + # } + # } + # + # A repeated field is not allowed except at the last position of a + # paths string. + # + # If a FieldMask object is not present in a get operation, the + # operation applies to all fields (as if a FieldMask of all fields + # had been specified). + # + # Note that a field mask does not necessarily apply to the + # top-level response message. In case of a REST get operation, the + # field mask applies directly to the response, but in case of a REST + # list operation, the mask instead applies to each individual message + # in the returned resource list. In case of a REST custom method, + # other definitions may be used. Where the mask applies will be + # clearly documented together with its declaration in the API. In + # any case, the effect on the returned resource/resources is required + # behavior for APIs. + # + # # Field Masks in Update Operations + # + # A field mask in update operations specifies which fields of the + # targeted resource are going to be updated. The API is required + # to only change the values of the fields as specified in the mask + # and leave the others untouched. If a resource is passed in to + # describe the updated values, the API ignores the values of all + # fields not covered by the mask. + # + # If a repeated field is specified for an update operation, new values will + # be appended to the existing repeated field in the target resource. Note that + # a repeated field is only allowed in the last position of a `paths` string. + # + # If a sub-message is specified in the last position of the field mask for an + # update operation, then new value will be merged into the existing sub-message + # in the target resource. + # + # For example, given the target message: + # + # f { + # b { + # d: 1 + # x: 2 + # } + # c: [1] + # } + # + # And an update message: + # + # f { + # b { + # d: 10 + # } + # c: [2] + # } + # + # then if the field mask is: + # + # paths: ["f.b", "f.c"] + # + # then the result will be: + # + # f { + # b { + # d: 10 + # x: 2 + # } + # c: [1, 2] + # } + # + # An implementation may provide options to override this default behavior for + # repeated and message fields. + # + # In order to reset a field's value to the default, the field must + # be in the mask and set to the default value in the provided resource. + # Hence, in order to reset all fields of a resource, provide a default + # instance of the resource and set all fields in the mask, or do + # not provide a mask as described below. + # + # If a field mask is not present on update, the operation applies to + # all fields (as if a field mask of all fields has been specified). + # Note that in the presence of schema evolution, this may mean that + # fields the client does not know and has therefore not filled into + # the request will be reset to their default. If this is unwanted + # behavior, a specific service may require a client to always specify + # a field mask, producing an error if not. + # + # As with get operations, the location of the resource which + # describes the updated values in the request message depends on the + # operation kind. In any case, the effect of the field mask is + # required to be honored by the API. + # + # ## Considerations for HTTP REST + # + # The HTTP kind of an update operation which uses a field mask must + # be set to PATCH instead of PUT in order to satisfy HTTP semantics + # (PUT must only be used for full updates). + # + # # JSON Encoding of Field Masks + # + # In JSON, a field mask is encoded as a single string where paths are + # separated by a comma. Fields name in each path are converted + # to/from lower-camel naming conventions. + # + # As an example, consider the following message declarations: + # + # message Profile { + # User user = 1; + # Photo photo = 2; + # } + # message User { + # string display_name = 1; + # string address = 2; + # } + # + # In proto a field mask for `Profile` may look as such: + # + # mask { + # paths: "user.display_name" + # paths: "photo" + # } + # + # In JSON, the same mask is represented as below: + # + # { + # mask: "user.displayName,photo" + # } + # + # # Field Masks and Oneof Fields + # + # Field masks treat fields in oneofs just as regular fields. Consider the + # following message: + # + # message SampleMessage { + # oneof test_oneof { + # string name = 4; + # SubMessage sub_message = 9; + # } + # } + # + # The field mask can be: + # + # mask { + # paths: "name" + # } + # + # Or: + # + # mask { + # paths: "sub_message" + # } + # + # Note that oneof type names ("test_oneof" in this case) cannot be used in + # paths. + # + # ## Field Mask Verification + # + # The implementation of any API method which has a FieldMask type field in the + # request should verify the included field paths, and return an + # `INVALID_ARGUMENT` error if any path is unmappable. + # @!attribute [rw] paths + # @return [::Array<::String>] + # The set of field mask paths. + class FieldMask + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end +end diff --git a/owl-bot-staging/google-cloud-scheduler-v1/proto_docs/google/protobuf/timestamp.rb b/owl-bot-staging/google-cloud-scheduler-v1/proto_docs/google/protobuf/timestamp.rb new file mode 100644 index 000000000000..74352be9c58c --- /dev/null +++ b/owl-bot-staging/google-cloud-scheduler-v1/proto_docs/google/protobuf/timestamp.rb @@ -0,0 +1,127 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + + +module Google + module Protobuf + # A Timestamp represents a point in time independent of any time zone or local + # calendar, encoded as a count of seconds and fractions of seconds at + # nanosecond resolution. The count is relative to an epoch at UTC midnight on + # January 1, 1970, in the proleptic Gregorian calendar which extends the + # Gregorian calendar backwards to year one. + # + # All minutes are 60 seconds long. Leap seconds are "smeared" so that no leap + # second table is needed for interpretation, using a [24-hour linear + # smear](https://developers.google.com/time/smear). + # + # The range is from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59.999999999Z. By + # restricting to that range, we ensure that we can convert to and from [RFC + # 3339](https://www.ietf.org/rfc/rfc3339.txt) date strings. + # + # # Examples + # + # Example 1: Compute Timestamp from POSIX `time()`. + # + # Timestamp timestamp; + # timestamp.set_seconds(time(NULL)); + # timestamp.set_nanos(0); + # + # Example 2: Compute Timestamp from POSIX `gettimeofday()`. + # + # struct timeval tv; + # gettimeofday(&tv, NULL); + # + # Timestamp timestamp; + # timestamp.set_seconds(tv.tv_sec); + # timestamp.set_nanos(tv.tv_usec * 1000); + # + # Example 3: Compute Timestamp from Win32 `GetSystemTimeAsFileTime()`. + # + # FILETIME ft; + # GetSystemTimeAsFileTime(&ft); + # UINT64 ticks = (((UINT64)ft.dwHighDateTime) << 32) | ft.dwLowDateTime; + # + # // A Windows tick is 100 nanoseconds. Windows epoch 1601-01-01T00:00:00Z + # // is 11644473600 seconds before Unix epoch 1970-01-01T00:00:00Z. + # Timestamp timestamp; + # timestamp.set_seconds((INT64) ((ticks / 10000000) - 11644473600LL)); + # timestamp.set_nanos((INT32) ((ticks % 10000000) * 100)); + # + # Example 4: Compute Timestamp from Java `System.currentTimeMillis()`. + # + # long millis = System.currentTimeMillis(); + # + # Timestamp timestamp = Timestamp.newBuilder().setSeconds(millis / 1000) + # .setNanos((int) ((millis % 1000) * 1000000)).build(); + # + # Example 5: Compute Timestamp from Java `Instant.now()`. + # + # Instant now = Instant.now(); + # + # Timestamp timestamp = + # Timestamp.newBuilder().setSeconds(now.getEpochSecond()) + # .setNanos(now.getNano()).build(); + # + # Example 6: Compute Timestamp from current time in Python. + # + # timestamp = Timestamp() + # timestamp.GetCurrentTime() + # + # # JSON Mapping + # + # In JSON format, the Timestamp type is encoded as a string in the + # [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format. That is, the + # format is "\\{year}-\\{month}-\\{day}T\\{hour}:\\{min}:\\{sec}[.\\{frac_sec}]Z" + # where \\{year} is always expressed using four digits while \\{month}, \\{day}, + # \\{hour}, \\{min}, and \\{sec} are zero-padded to two digits each. The fractional + # seconds, which can go up to 9 digits (i.e. up to 1 nanosecond resolution), + # are optional. The "Z" suffix indicates the timezone ("UTC"); the timezone + # is required. A proto3 JSON serializer should always use UTC (as indicated by + # "Z") when printing the Timestamp type and a proto3 JSON parser should be + # able to accept both UTC and other timezones (as indicated by an offset). + # + # For example, "2017-01-15T01:30:15.01Z" encodes 15.01 seconds past + # 01:30 UTC on January 15, 2017. + # + # In JavaScript, one can convert a Date object to this format using the + # standard + # [toISOString()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toISOString) + # method. In Python, a standard `datetime.datetime` object can be converted + # to this format using + # [`strftime`](https://docs.python.org/2/library/time.html#time.strftime) with + # the time format spec '%Y-%m-%dT%H:%M:%S.%fZ'. Likewise, in Java, one can use + # the Joda Time's [`ISODateTimeFormat.dateTime()`]( + # http://joda-time.sourceforge.net/apidocs/org/joda/time/format/ISODateTimeFormat.html#dateTime() + # ) to obtain a formatter capable of generating timestamps in this format. + # @!attribute [rw] seconds + # @return [::Integer] + # Represents seconds of UTC time since Unix epoch + # 1970-01-01T00:00:00Z. Must be from 0001-01-01T00:00:00Z to + # 9999-12-31T23:59:59Z inclusive. + # @!attribute [rw] nanos + # @return [::Integer] + # Non-negative fractions of a second at nanosecond resolution. Negative + # second values with fractions must still have non-negative nanos values + # that count forward in time. Must be from 0 to 999,999,999 + # inclusive. + class Timestamp + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end +end diff --git a/owl-bot-staging/google-cloud-scheduler-v1/proto_docs/google/rpc/status.rb b/owl-bot-staging/google-cloud-scheduler-v1/proto_docs/google/rpc/status.rb new file mode 100644 index 000000000000..c1a1c07eb2db --- /dev/null +++ b/owl-bot-staging/google-cloud-scheduler-v1/proto_docs/google/rpc/status.rb @@ -0,0 +1,48 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + + +module Google + module Rpc + # The `Status` type defines a logical error model that is suitable for + # different programming environments, including REST APIs and RPC APIs. It is + # used by [gRPC](https://github.com/grpc). Each `Status` message contains + # three pieces of data: error code, error message, and error details. + # + # You can find out more about this error model and how to work with it in the + # [API Design Guide](https://cloud.google.com/apis/design/errors). + # @!attribute [rw] code + # @return [::Integer] + # The status code, which should be an enum value of + # [google.rpc.Code][google.rpc.Code]. + # @!attribute [rw] message + # @return [::String] + # A developer-facing error message, which should be in English. Any + # user-facing error message should be localized and sent in the + # {::Google::Rpc::Status#details google.rpc.Status.details} field, or localized + # by the client. + # @!attribute [rw] details + # @return [::Array<::Google::Protobuf::Any>] + # A list of messages that carry the error details. There is a common set of + # message types for APIs to use. + class Status + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end +end diff --git a/owl-bot-staging/google-cloud-scheduler-v1/snippets/Gemfile b/owl-bot-staging/google-cloud-scheduler-v1/snippets/Gemfile new file mode 100644 index 000000000000..c02c47d852c8 --- /dev/null +++ b/owl-bot-staging/google-cloud-scheduler-v1/snippets/Gemfile @@ -0,0 +1,32 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +source "https://rubygems.org" + +if ENV["GOOGLE_CLOUD_SAMPLES_TEST"] == "master" + gem "google-cloud-scheduler-v1", path: "../" +else + gem "google-cloud-scheduler-v1" +end + +group :test do + gem "google-style", "~> 1.26.1" + gem "minitest", "~> 5.16" + gem "minitest-focus", "~> 1.1" + gem "minitest-hooks", "~> 1.5" +end diff --git a/owl-bot-staging/google-cloud-scheduler-v1/snippets/cloud_scheduler/create_job.rb b/owl-bot-staging/google-cloud-scheduler-v1/snippets/cloud_scheduler/create_job.rb new file mode 100644 index 000000000000..b397a8482a23 --- /dev/null +++ b/owl-bot-staging/google-cloud-scheduler-v1/snippets/cloud_scheduler/create_job.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 cloudscheduler_v1_generated_CloudScheduler_CreateJob_sync] +require "google/cloud/scheduler/v1" + +## +# Snippet for the create_job call in the CloudScheduler service +# +# This snippet has been automatically generated and should be regarded as a code +# template only. It will require modifications to work: +# - It may require correct/in-range values for request initialization. +# - It may require specifying regional endpoints when creating the service +# client as shown in https://cloud.google.com/ruby/docs/reference. +# +# This is an auto-generated example demonstrating basic usage of +# Google::Cloud::Scheduler::V1::CloudScheduler::Client#create_job. +# +def create_job + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Scheduler::V1::CloudScheduler::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Scheduler::V1::CreateJobRequest.new + + # Call the create_job method. + result = client.create_job request + + # The returned object is of type Google::Cloud::Scheduler::V1::Job. + p result +end +# [END cloudscheduler_v1_generated_CloudScheduler_CreateJob_sync] diff --git a/owl-bot-staging/google-cloud-scheduler-v1/snippets/cloud_scheduler/delete_job.rb b/owl-bot-staging/google-cloud-scheduler-v1/snippets/cloud_scheduler/delete_job.rb new file mode 100644 index 000000000000..97549a79d316 --- /dev/null +++ b/owl-bot-staging/google-cloud-scheduler-v1/snippets/cloud_scheduler/delete_job.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 cloudscheduler_v1_generated_CloudScheduler_DeleteJob_sync] +require "google/cloud/scheduler/v1" + +## +# Snippet for the delete_job call in the CloudScheduler service +# +# This snippet has been automatically generated and should be regarded as a code +# template only. It will require modifications to work: +# - It may require correct/in-range values for request initialization. +# - It may require specifying regional endpoints when creating the service +# client as shown in https://cloud.google.com/ruby/docs/reference. +# +# This is an auto-generated example demonstrating basic usage of +# Google::Cloud::Scheduler::V1::CloudScheduler::Client#delete_job. +# +def delete_job + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Scheduler::V1::CloudScheduler::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Scheduler::V1::DeleteJobRequest.new + + # Call the delete_job method. + result = client.delete_job request + + # The returned object is of type Google::Protobuf::Empty. + p result +end +# [END cloudscheduler_v1_generated_CloudScheduler_DeleteJob_sync] diff --git a/owl-bot-staging/google-cloud-scheduler-v1/snippets/cloud_scheduler/get_job.rb b/owl-bot-staging/google-cloud-scheduler-v1/snippets/cloud_scheduler/get_job.rb new file mode 100644 index 000000000000..b6bc399e6655 --- /dev/null +++ b/owl-bot-staging/google-cloud-scheduler-v1/snippets/cloud_scheduler/get_job.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 cloudscheduler_v1_generated_CloudScheduler_GetJob_sync] +require "google/cloud/scheduler/v1" + +## +# Snippet for the get_job call in the CloudScheduler service +# +# This snippet has been automatically generated and should be regarded as a code +# template only. It will require modifications to work: +# - It may require correct/in-range values for request initialization. +# - It may require specifying regional endpoints when creating the service +# client as shown in https://cloud.google.com/ruby/docs/reference. +# +# This is an auto-generated example demonstrating basic usage of +# Google::Cloud::Scheduler::V1::CloudScheduler::Client#get_job. +# +def get_job + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Scheduler::V1::CloudScheduler::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Scheduler::V1::GetJobRequest.new + + # Call the get_job method. + result = client.get_job request + + # The returned object is of type Google::Cloud::Scheduler::V1::Job. + p result +end +# [END cloudscheduler_v1_generated_CloudScheduler_GetJob_sync] diff --git a/owl-bot-staging/google-cloud-scheduler-v1/snippets/cloud_scheduler/list_jobs.rb b/owl-bot-staging/google-cloud-scheduler-v1/snippets/cloud_scheduler/list_jobs.rb new file mode 100644 index 000000000000..9b659a6cfdf5 --- /dev/null +++ b/owl-bot-staging/google-cloud-scheduler-v1/snippets/cloud_scheduler/list_jobs.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 cloudscheduler_v1_generated_CloudScheduler_ListJobs_sync] +require "google/cloud/scheduler/v1" + +## +# Snippet for the list_jobs call in the CloudScheduler service +# +# This snippet has been automatically generated and should be regarded as a code +# template only. It will require modifications to work: +# - It may require correct/in-range values for request initialization. +# - It may require specifying regional endpoints when creating the service +# client as shown in https://cloud.google.com/ruby/docs/reference. +# +# This is an auto-generated example demonstrating basic usage of +# Google::Cloud::Scheduler::V1::CloudScheduler::Client#list_jobs. +# +def list_jobs + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Scheduler::V1::CloudScheduler::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Scheduler::V1::ListJobsRequest.new + + # Call the list_jobs method. + result = client.list_jobs request + + # The returned object is of type Gapic::PagedEnumerable. You can iterate + # over elements, and API calls will be issued to fetch pages as needed. + result.each do |item| + # Each element is of type ::Google::Cloud::Scheduler::V1::Job. + p item + end +end +# [END cloudscheduler_v1_generated_CloudScheduler_ListJobs_sync] diff --git a/owl-bot-staging/google-cloud-scheduler-v1/snippets/cloud_scheduler/pause_job.rb b/owl-bot-staging/google-cloud-scheduler-v1/snippets/cloud_scheduler/pause_job.rb new file mode 100644 index 000000000000..fcf829fcca02 --- /dev/null +++ b/owl-bot-staging/google-cloud-scheduler-v1/snippets/cloud_scheduler/pause_job.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 cloudscheduler_v1_generated_CloudScheduler_PauseJob_sync] +require "google/cloud/scheduler/v1" + +## +# Snippet for the pause_job call in the CloudScheduler service +# +# This snippet has been automatically generated and should be regarded as a code +# template only. It will require modifications to work: +# - It may require correct/in-range values for request initialization. +# - It may require specifying regional endpoints when creating the service +# client as shown in https://cloud.google.com/ruby/docs/reference. +# +# This is an auto-generated example demonstrating basic usage of +# Google::Cloud::Scheduler::V1::CloudScheduler::Client#pause_job. +# +def pause_job + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Scheduler::V1::CloudScheduler::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Scheduler::V1::PauseJobRequest.new + + # Call the pause_job method. + result = client.pause_job request + + # The returned object is of type Google::Cloud::Scheduler::V1::Job. + p result +end +# [END cloudscheduler_v1_generated_CloudScheduler_PauseJob_sync] diff --git a/owl-bot-staging/google-cloud-scheduler-v1/snippets/cloud_scheduler/resume_job.rb b/owl-bot-staging/google-cloud-scheduler-v1/snippets/cloud_scheduler/resume_job.rb new file mode 100644 index 000000000000..436bdc7d5ed9 --- /dev/null +++ b/owl-bot-staging/google-cloud-scheduler-v1/snippets/cloud_scheduler/resume_job.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 cloudscheduler_v1_generated_CloudScheduler_ResumeJob_sync] +require "google/cloud/scheduler/v1" + +## +# Snippet for the resume_job call in the CloudScheduler service +# +# This snippet has been automatically generated and should be regarded as a code +# template only. It will require modifications to work: +# - It may require correct/in-range values for request initialization. +# - It may require specifying regional endpoints when creating the service +# client as shown in https://cloud.google.com/ruby/docs/reference. +# +# This is an auto-generated example demonstrating basic usage of +# Google::Cloud::Scheduler::V1::CloudScheduler::Client#resume_job. +# +def resume_job + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Scheduler::V1::CloudScheduler::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Scheduler::V1::ResumeJobRequest.new + + # Call the resume_job method. + result = client.resume_job request + + # The returned object is of type Google::Cloud::Scheduler::V1::Job. + p result +end +# [END cloudscheduler_v1_generated_CloudScheduler_ResumeJob_sync] diff --git a/owl-bot-staging/google-cloud-scheduler-v1/snippets/cloud_scheduler/run_job.rb b/owl-bot-staging/google-cloud-scheduler-v1/snippets/cloud_scheduler/run_job.rb new file mode 100644 index 000000000000..5b9f45f48110 --- /dev/null +++ b/owl-bot-staging/google-cloud-scheduler-v1/snippets/cloud_scheduler/run_job.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 cloudscheduler_v1_generated_CloudScheduler_RunJob_sync] +require "google/cloud/scheduler/v1" + +## +# Snippet for the run_job call in the CloudScheduler service +# +# This snippet has been automatically generated and should be regarded as a code +# template only. It will require modifications to work: +# - It may require correct/in-range values for request initialization. +# - It may require specifying regional endpoints when creating the service +# client as shown in https://cloud.google.com/ruby/docs/reference. +# +# This is an auto-generated example demonstrating basic usage of +# Google::Cloud::Scheduler::V1::CloudScheduler::Client#run_job. +# +def run_job + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Scheduler::V1::CloudScheduler::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Scheduler::V1::RunJobRequest.new + + # Call the run_job method. + result = client.run_job request + + # The returned object is of type Google::Cloud::Scheduler::V1::Job. + p result +end +# [END cloudscheduler_v1_generated_CloudScheduler_RunJob_sync] diff --git a/owl-bot-staging/google-cloud-scheduler-v1/snippets/cloud_scheduler/update_job.rb b/owl-bot-staging/google-cloud-scheduler-v1/snippets/cloud_scheduler/update_job.rb new file mode 100644 index 000000000000..d69082323ccf --- /dev/null +++ b/owl-bot-staging/google-cloud-scheduler-v1/snippets/cloud_scheduler/update_job.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 cloudscheduler_v1_generated_CloudScheduler_UpdateJob_sync] +require "google/cloud/scheduler/v1" + +## +# Snippet for the update_job call in the CloudScheduler service +# +# This snippet has been automatically generated and should be regarded as a code +# template only. It will require modifications to work: +# - It may require correct/in-range values for request initialization. +# - It may require specifying regional endpoints when creating the service +# client as shown in https://cloud.google.com/ruby/docs/reference. +# +# This is an auto-generated example demonstrating basic usage of +# Google::Cloud::Scheduler::V1::CloudScheduler::Client#update_job. +# +def update_job + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Scheduler::V1::CloudScheduler::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Scheduler::V1::UpdateJobRequest.new + + # Call the update_job method. + result = client.update_job request + + # The returned object is of type Google::Cloud::Scheduler::V1::Job. + p result +end +# [END cloudscheduler_v1_generated_CloudScheduler_UpdateJob_sync] diff --git a/owl-bot-staging/google-cloud-scheduler-v1/snippets/snippet_metadata_google.cloud.scheduler.v1.json b/owl-bot-staging/google-cloud-scheduler-v1/snippets/snippet_metadata_google.cloud.scheduler.v1.json new file mode 100644 index 000000000000..c9cff986a1da --- /dev/null +++ b/owl-bot-staging/google-cloud-scheduler-v1/snippets/snippet_metadata_google.cloud.scheduler.v1.json @@ -0,0 +1,335 @@ +{ + "client_library": { + "name": "google-cloud-scheduler-v1", + "version": "", + "language": "RUBY", + "apis": [ + { + "id": "google.cloud.scheduler.v1", + "version": "v1" + } + ] + }, + "snippets": [ + { + "region_tag": "cloudscheduler_v1_generated_CloudScheduler_ListJobs_sync", + "title": "Snippet for the list_jobs call in the CloudScheduler service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Scheduler::V1::CloudScheduler::Client#list_jobs.", + "file": "cloud_scheduler/list_jobs.rb", + "language": "RUBY", + "client_method": { + "short_name": "list_jobs", + "full_name": "::Google::Cloud::Scheduler::V1::CloudScheduler::Client#list_jobs", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::Scheduler::V1::ListJobsRequest", + "name": "request" + } + ], + "result_type": "::Google::Cloud::Scheduler::V1::ListJobsResponse", + "client": { + "short_name": "CloudScheduler::Client", + "full_name": "::Google::Cloud::Scheduler::V1::CloudScheduler::Client" + }, + "method": { + "short_name": "ListJobs", + "full_name": "google.cloud.scheduler.v1.CloudScheduler.ListJobs", + "service": { + "short_name": "CloudScheduler", + "full_name": "google.cloud.scheduler.v1.CloudScheduler" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 50, + "type": "FULL" + } + ] + }, + { + "region_tag": "cloudscheduler_v1_generated_CloudScheduler_GetJob_sync", + "title": "Snippet for the get_job call in the CloudScheduler service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Scheduler::V1::CloudScheduler::Client#get_job.", + "file": "cloud_scheduler/get_job.rb", + "language": "RUBY", + "client_method": { + "short_name": "get_job", + "full_name": "::Google::Cloud::Scheduler::V1::CloudScheduler::Client#get_job", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::Scheduler::V1::GetJobRequest", + "name": "request" + } + ], + "result_type": "::Google::Cloud::Scheduler::V1::Job", + "client": { + "short_name": "CloudScheduler::Client", + "full_name": "::Google::Cloud::Scheduler::V1::CloudScheduler::Client" + }, + "method": { + "short_name": "GetJob", + "full_name": "google.cloud.scheduler.v1.CloudScheduler.GetJob", + "service": { + "short_name": "CloudScheduler", + "full_name": "google.cloud.scheduler.v1.CloudScheduler" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 46, + "type": "FULL" + } + ] + }, + { + "region_tag": "cloudscheduler_v1_generated_CloudScheduler_CreateJob_sync", + "title": "Snippet for the create_job call in the CloudScheduler service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Scheduler::V1::CloudScheduler::Client#create_job.", + "file": "cloud_scheduler/create_job.rb", + "language": "RUBY", + "client_method": { + "short_name": "create_job", + "full_name": "::Google::Cloud::Scheduler::V1::CloudScheduler::Client#create_job", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::Scheduler::V1::CreateJobRequest", + "name": "request" + } + ], + "result_type": "::Google::Cloud::Scheduler::V1::Job", + "client": { + "short_name": "CloudScheduler::Client", + "full_name": "::Google::Cloud::Scheduler::V1::CloudScheduler::Client" + }, + "method": { + "short_name": "CreateJob", + "full_name": "google.cloud.scheduler.v1.CloudScheduler.CreateJob", + "service": { + "short_name": "CloudScheduler", + "full_name": "google.cloud.scheduler.v1.CloudScheduler" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 46, + "type": "FULL" + } + ] + }, + { + "region_tag": "cloudscheduler_v1_generated_CloudScheduler_UpdateJob_sync", + "title": "Snippet for the update_job call in the CloudScheduler service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Scheduler::V1::CloudScheduler::Client#update_job.", + "file": "cloud_scheduler/update_job.rb", + "language": "RUBY", + "client_method": { + "short_name": "update_job", + "full_name": "::Google::Cloud::Scheduler::V1::CloudScheduler::Client#update_job", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::Scheduler::V1::UpdateJobRequest", + "name": "request" + } + ], + "result_type": "::Google::Cloud::Scheduler::V1::Job", + "client": { + "short_name": "CloudScheduler::Client", + "full_name": "::Google::Cloud::Scheduler::V1::CloudScheduler::Client" + }, + "method": { + "short_name": "UpdateJob", + "full_name": "google.cloud.scheduler.v1.CloudScheduler.UpdateJob", + "service": { + "short_name": "CloudScheduler", + "full_name": "google.cloud.scheduler.v1.CloudScheduler" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 46, + "type": "FULL" + } + ] + }, + { + "region_tag": "cloudscheduler_v1_generated_CloudScheduler_DeleteJob_sync", + "title": "Snippet for the delete_job call in the CloudScheduler service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Scheduler::V1::CloudScheduler::Client#delete_job.", + "file": "cloud_scheduler/delete_job.rb", + "language": "RUBY", + "client_method": { + "short_name": "delete_job", + "full_name": "::Google::Cloud::Scheduler::V1::CloudScheduler::Client#delete_job", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::Scheduler::V1::DeleteJobRequest", + "name": "request" + } + ], + "result_type": "::Google::Protobuf::Empty", + "client": { + "short_name": "CloudScheduler::Client", + "full_name": "::Google::Cloud::Scheduler::V1::CloudScheduler::Client" + }, + "method": { + "short_name": "DeleteJob", + "full_name": "google.cloud.scheduler.v1.CloudScheduler.DeleteJob", + "service": { + "short_name": "CloudScheduler", + "full_name": "google.cloud.scheduler.v1.CloudScheduler" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 46, + "type": "FULL" + } + ] + }, + { + "region_tag": "cloudscheduler_v1_generated_CloudScheduler_PauseJob_sync", + "title": "Snippet for the pause_job call in the CloudScheduler service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Scheduler::V1::CloudScheduler::Client#pause_job.", + "file": "cloud_scheduler/pause_job.rb", + "language": "RUBY", + "client_method": { + "short_name": "pause_job", + "full_name": "::Google::Cloud::Scheduler::V1::CloudScheduler::Client#pause_job", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::Scheduler::V1::PauseJobRequest", + "name": "request" + } + ], + "result_type": "::Google::Cloud::Scheduler::V1::Job", + "client": { + "short_name": "CloudScheduler::Client", + "full_name": "::Google::Cloud::Scheduler::V1::CloudScheduler::Client" + }, + "method": { + "short_name": "PauseJob", + "full_name": "google.cloud.scheduler.v1.CloudScheduler.PauseJob", + "service": { + "short_name": "CloudScheduler", + "full_name": "google.cloud.scheduler.v1.CloudScheduler" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 46, + "type": "FULL" + } + ] + }, + { + "region_tag": "cloudscheduler_v1_generated_CloudScheduler_ResumeJob_sync", + "title": "Snippet for the resume_job call in the CloudScheduler service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Scheduler::V1::CloudScheduler::Client#resume_job.", + "file": "cloud_scheduler/resume_job.rb", + "language": "RUBY", + "client_method": { + "short_name": "resume_job", + "full_name": "::Google::Cloud::Scheduler::V1::CloudScheduler::Client#resume_job", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::Scheduler::V1::ResumeJobRequest", + "name": "request" + } + ], + "result_type": "::Google::Cloud::Scheduler::V1::Job", + "client": { + "short_name": "CloudScheduler::Client", + "full_name": "::Google::Cloud::Scheduler::V1::CloudScheduler::Client" + }, + "method": { + "short_name": "ResumeJob", + "full_name": "google.cloud.scheduler.v1.CloudScheduler.ResumeJob", + "service": { + "short_name": "CloudScheduler", + "full_name": "google.cloud.scheduler.v1.CloudScheduler" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 46, + "type": "FULL" + } + ] + }, + { + "region_tag": "cloudscheduler_v1_generated_CloudScheduler_RunJob_sync", + "title": "Snippet for the run_job call in the CloudScheduler service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Scheduler::V1::CloudScheduler::Client#run_job.", + "file": "cloud_scheduler/run_job.rb", + "language": "RUBY", + "client_method": { + "short_name": "run_job", + "full_name": "::Google::Cloud::Scheduler::V1::CloudScheduler::Client#run_job", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::Scheduler::V1::RunJobRequest", + "name": "request" + } + ], + "result_type": "::Google::Cloud::Scheduler::V1::Job", + "client": { + "short_name": "CloudScheduler::Client", + "full_name": "::Google::Cloud::Scheduler::V1::CloudScheduler::Client" + }, + "method": { + "short_name": "RunJob", + "full_name": "google.cloud.scheduler.v1.CloudScheduler.RunJob", + "service": { + "short_name": "CloudScheduler", + "full_name": "google.cloud.scheduler.v1.CloudScheduler" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 46, + "type": "FULL" + } + ] + } + ] +} \ No newline at end of file diff --git a/owl-bot-staging/google-cloud-scheduler-v1/test/google/cloud/scheduler/v1/cloud_scheduler_paths_test.rb b/owl-bot-staging/google-cloud-scheduler-v1/test/google/cloud/scheduler/v1/cloud_scheduler_paths_test.rb new file mode 100644 index 000000000000..f3cd6eff3195 --- /dev/null +++ b/owl-bot-staging/google-cloud-scheduler-v1/test/google/cloud/scheduler/v1/cloud_scheduler_paths_test.rb @@ -0,0 +1,79 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +require "helper" + +require "gapic/grpc/service_stub" + +require "google/cloud/scheduler/v1/cloud_scheduler" + +class ::Google::Cloud::Scheduler::V1::CloudScheduler::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_job_path + grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + ::Gapic::ServiceStub.stub :new, DummyStub.new do + client = ::Google::Cloud::Scheduler::V1::CloudScheduler::Client.new do |config| + config.credentials = grpc_channel + end + + path = client.job_path project: "value0", location: "value1", job: "value2" + assert_equal "projects/value0/locations/value1/jobs/value2", path + end + end + + def test_location_path + grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + ::Gapic::ServiceStub.stub :new, DummyStub.new do + client = ::Google::Cloud::Scheduler::V1::CloudScheduler::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_topic_path + grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + ::Gapic::ServiceStub.stub :new, DummyStub.new do + client = ::Google::Cloud::Scheduler::V1::CloudScheduler::Client.new do |config| + config.credentials = grpc_channel + end + + path = client.topic_path project: "value0", topic: "value1" + assert_equal "projects/value0/topics/value1", path + end + end +end diff --git a/owl-bot-staging/google-cloud-scheduler-v1/test/google/cloud/scheduler/v1/cloud_scheduler_rest_test.rb b/owl-bot-staging/google-cloud-scheduler-v1/test/google/cloud/scheduler/v1/cloud_scheduler_rest_test.rb new file mode 100644 index 000000000000..fb7b628563c0 --- /dev/null +++ b/owl-bot-staging/google-cloud-scheduler-v1/test/google/cloud/scheduler/v1/cloud_scheduler_rest_test.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 "helper" +require "gapic/rest" +require "google/cloud/scheduler/v1/cloudscheduler_pb" +require "google/cloud/scheduler/v1/cloud_scheduler/rest" + + +class ::Google::Cloud::Scheduler::V1::CloudScheduler::Rest::ClientTest < Minitest::Test + class ClientStub + attr_accessor :call_count, :requests + + def initialize response, &block + @response = response + @block = block + @call_count = 0 + @requests = [] + end + + def make_get_request uri:, params: {}, options: {}, method_name: nil + make_http_request :get, uri: uri, body: nil, params: params, options: options, method_name: method_name + end + + def make_delete_request uri:, params: {}, options: {}, method_name: nil + make_http_request :delete, uri: uri, body: nil, params: params, options: options, method_name: method_name + end + + def make_post_request uri:, body: nil, params: {}, options: {}, method_name: nil + make_http_request :post, uri: uri, body: body, params: params, options: options, method_name: method_name + end + + def make_patch_request uri:, body:, params: {}, options: {}, method_name: nil + make_http_request :patch, uri: uri, body: body, params: params, options: options, method_name: method_name + end + + def make_put_request uri:, body:, params: {}, options: {}, method_name: nil + make_http_request :put, uri: uri, body: body, params: params, options: options, method_name: method_name + end + + def make_http_request *args, **kwargs + @call_count += 1 + + @requests << @block&.call(*args, **kwargs) + + @response + end + + def endpoint + "endpoint.example.com" + end + + def universe_domain + "example.com" + end + + def stub_logger + nil + end + + def logger + nil + end + end + + def test_list_jobs + # Create test objects. + client_result = ::Google::Cloud::Scheduler::V1::ListJobsResponse.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_jobs_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| + assert options.metadata.key? :"x-goog-api-client" + assert options.metadata[:"x-goog-api-client"].include? "rest" + refute options.metadata[:"x-goog-api-client"].include? "grpc" + end + + ::Google::Cloud::Scheduler::V1::CloudScheduler::Rest::ServiceStub.stub :transcode_list_jobs_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, list_jobs_client_stub do + # Create client + client = ::Google::Cloud::Scheduler::V1::CloudScheduler::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.list_jobs({ 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_jobs 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_jobs ::Google::Cloud::Scheduler::V1::ListJobsRequest.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_jobs({ 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_jobs(::Google::Cloud::Scheduler::V1::ListJobsRequest.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_jobs_client_stub.call_count + end + end + end + + def test_get_job + # Create test objects. + client_result = ::Google::Cloud::Scheduler::V1::Job.new + http_response = OpenStruct.new body: client_result.to_json + + call_options = {} + + # Create request parameters for a unary method. + name = "hello world" + + get_job_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| + assert options.metadata.key? :"x-goog-api-client" + assert options.metadata[:"x-goog-api-client"].include? "rest" + refute options.metadata[:"x-goog-api-client"].include? "grpc" + end + + ::Google::Cloud::Scheduler::V1::CloudScheduler::Rest::ServiceStub.stub :transcode_get_job_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, get_job_client_stub do + # Create client + client = ::Google::Cloud::Scheduler::V1::CloudScheduler::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.get_job({ name: name }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.get_job name: name do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.get_job ::Google::Cloud::Scheduler::V1::GetJobRequest.new(name: name) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + client.get_job({ name: name }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + client.get_job(::Google::Cloud::Scheduler::V1::GetJobRequest.new(name: name), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, get_job_client_stub.call_count + end + end + end + + def test_create_job + # Create test objects. + client_result = ::Google::Cloud::Scheduler::V1::Job.new + http_response = OpenStruct.new body: client_result.to_json + + call_options = {} + + # Create request parameters for a unary method. + parent = "hello world" + job = {} + + create_job_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| + assert options.metadata.key? :"x-goog-api-client" + assert options.metadata[:"x-goog-api-client"].include? "rest" + refute options.metadata[:"x-goog-api-client"].include? "grpc" + end + + ::Google::Cloud::Scheduler::V1::CloudScheduler::Rest::ServiceStub.stub :transcode_create_job_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, create_job_client_stub do + # Create client + client = ::Google::Cloud::Scheduler::V1::CloudScheduler::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.create_job({ parent: parent, job: job }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.create_job parent: parent, job: job do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.create_job ::Google::Cloud::Scheduler::V1::CreateJobRequest.new(parent: parent, job: job) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + client.create_job({ parent: parent, job: job }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + client.create_job(::Google::Cloud::Scheduler::V1::CreateJobRequest.new(parent: parent, job: job), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, create_job_client_stub.call_count + end + end + end + + def test_update_job + # Create test objects. + client_result = ::Google::Cloud::Scheduler::V1::Job.new + http_response = OpenStruct.new body: client_result.to_json + + call_options = {} + + # Create request parameters for a unary method. + job = {} + update_mask = {} + + update_job_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| + assert options.metadata.key? :"x-goog-api-client" + assert options.metadata[:"x-goog-api-client"].include? "rest" + refute options.metadata[:"x-goog-api-client"].include? "grpc" + end + + ::Google::Cloud::Scheduler::V1::CloudScheduler::Rest::ServiceStub.stub :transcode_update_job_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, update_job_client_stub do + # Create client + client = ::Google::Cloud::Scheduler::V1::CloudScheduler::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.update_job({ job: job, update_mask: update_mask }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.update_job job: job, update_mask: update_mask do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.update_job ::Google::Cloud::Scheduler::V1::UpdateJobRequest.new(job: job, update_mask: update_mask) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + client.update_job({ job: job, update_mask: update_mask }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + client.update_job(::Google::Cloud::Scheduler::V1::UpdateJobRequest.new(job: job, update_mask: update_mask), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, update_job_client_stub.call_count + end + end + end + + def test_delete_job + # Create test objects. + client_result = ::Google::Protobuf::Empty.new + http_response = OpenStruct.new body: client_result.to_json + + call_options = {} + + # Create request parameters for a unary method. + name = "hello world" + + delete_job_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| + assert options.metadata.key? :"x-goog-api-client" + assert options.metadata[:"x-goog-api-client"].include? "rest" + refute options.metadata[:"x-goog-api-client"].include? "grpc" + end + + ::Google::Cloud::Scheduler::V1::CloudScheduler::Rest::ServiceStub.stub :transcode_delete_job_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, delete_job_client_stub do + # Create client + client = ::Google::Cloud::Scheduler::V1::CloudScheduler::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.delete_job({ name: name }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.delete_job name: name do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.delete_job ::Google::Cloud::Scheduler::V1::DeleteJobRequest.new(name: name) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + client.delete_job({ name: name }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + client.delete_job(::Google::Cloud::Scheduler::V1::DeleteJobRequest.new(name: name), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, delete_job_client_stub.call_count + end + end + end + + def test_pause_job + # Create test objects. + client_result = ::Google::Cloud::Scheduler::V1::Job.new + http_response = OpenStruct.new body: client_result.to_json + + call_options = {} + + # Create request parameters for a unary method. + name = "hello world" + + pause_job_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| + assert options.metadata.key? :"x-goog-api-client" + assert options.metadata[:"x-goog-api-client"].include? "rest" + refute options.metadata[:"x-goog-api-client"].include? "grpc" + end + + ::Google::Cloud::Scheduler::V1::CloudScheduler::Rest::ServiceStub.stub :transcode_pause_job_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, pause_job_client_stub do + # Create client + client = ::Google::Cloud::Scheduler::V1::CloudScheduler::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.pause_job({ name: name }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.pause_job name: name do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.pause_job ::Google::Cloud::Scheduler::V1::PauseJobRequest.new(name: name) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + client.pause_job({ name: name }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + client.pause_job(::Google::Cloud::Scheduler::V1::PauseJobRequest.new(name: name), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, pause_job_client_stub.call_count + end + end + end + + def test_resume_job + # Create test objects. + client_result = ::Google::Cloud::Scheduler::V1::Job.new + http_response = OpenStruct.new body: client_result.to_json + + call_options = {} + + # Create request parameters for a unary method. + name = "hello world" + + resume_job_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| + assert options.metadata.key? :"x-goog-api-client" + assert options.metadata[:"x-goog-api-client"].include? "rest" + refute options.metadata[:"x-goog-api-client"].include? "grpc" + end + + ::Google::Cloud::Scheduler::V1::CloudScheduler::Rest::ServiceStub.stub :transcode_resume_job_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, resume_job_client_stub do + # Create client + client = ::Google::Cloud::Scheduler::V1::CloudScheduler::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.resume_job({ name: name }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.resume_job name: name do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.resume_job ::Google::Cloud::Scheduler::V1::ResumeJobRequest.new(name: name) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + client.resume_job({ name: name }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + client.resume_job(::Google::Cloud::Scheduler::V1::ResumeJobRequest.new(name: name), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, resume_job_client_stub.call_count + end + end + end + + def test_run_job + # Create test objects. + client_result = ::Google::Cloud::Scheduler::V1::Job.new + http_response = OpenStruct.new body: client_result.to_json + + call_options = {} + + # Create request parameters for a unary method. + name = "hello world" + + run_job_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| + assert options.metadata.key? :"x-goog-api-client" + assert options.metadata[:"x-goog-api-client"].include? "rest" + refute options.metadata[:"x-goog-api-client"].include? "grpc" + end + + ::Google::Cloud::Scheduler::V1::CloudScheduler::Rest::ServiceStub.stub :transcode_run_job_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, run_job_client_stub do + # Create client + client = ::Google::Cloud::Scheduler::V1::CloudScheduler::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.run_job({ name: name }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.run_job name: name do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.run_job ::Google::Cloud::Scheduler::V1::RunJobRequest.new(name: name) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + client.run_job({ name: name }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + client.run_job(::Google::Cloud::Scheduler::V1::RunJobRequest.new(name: name), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, run_job_client_stub.call_count + end + end + end + + def test_configure + credentials_token = :dummy_value + + client = block_config = config = nil + dummy_stub = ClientStub.new nil + Gapic::Rest::ClientStub.stub :new, dummy_stub do + client = ::Google::Cloud::Scheduler::V1::CloudScheduler::Rest::Client.new do |config| + config.credentials = credentials_token + end + end + + config = client.configure do |c| + block_config = c + end + + assert_same block_config, config + assert_kind_of ::Google::Cloud::Scheduler::V1::CloudScheduler::Rest::Client::Configuration, config + end +end diff --git a/owl-bot-staging/google-cloud-scheduler-v1/test/google/cloud/scheduler/v1/cloud_scheduler_test.rb b/owl-bot-staging/google-cloud-scheduler-v1/test/google/cloud/scheduler/v1/cloud_scheduler_test.rb new file mode 100644 index 000000000000..7348b8f733d8 --- /dev/null +++ b/owl-bot-staging/google-cloud-scheduler-v1/test/google/cloud/scheduler/v1/cloud_scheduler_test.rb @@ -0,0 +1,581 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +require "helper" + +require "gapic/grpc/service_stub" + +require "google/cloud/scheduler/v1/cloudscheduler_pb" +require "google/cloud/scheduler/v1/cloud_scheduler" + +class ::Google::Cloud::Scheduler::V1::CloudScheduler::ClientTest < Minitest::Test + class ClientStub + attr_accessor :call_rpc_count, :requests + + def initialize response, operation, &block + @response = response + @operation = operation + @block = block + @call_rpc_count = 0 + @requests = [] + end + + def call_rpc *args, **kwargs + @call_rpc_count += 1 + + @requests << @block&.call(*args, **kwargs) + + catch :response do + yield @response, @operation if block_given? + @response + end + end + + def endpoint + "endpoint.example.com" + end + + def universe_domain + "example.com" + end + + def stub_logger + nil + end + + def logger + nil + end + end + + def test_list_jobs + # Create GRPC objects. + grpc_response = ::Google::Cloud::Scheduler::V1::ListJobsResponse.new + grpc_operation = GRPC::ActiveCall::Operation.new nil + grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + grpc_options = {} + + # Create request parameters for a unary method. + parent = "hello world" + page_size = 42 + page_token = "hello world" + + list_jobs_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :list_jobs, name + assert_kind_of ::Google::Cloud::Scheduler::V1::ListJobsRequest, 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_jobs_client_stub do + # Create client + client = ::Google::Cloud::Scheduler::V1::CloudScheduler::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.list_jobs({ 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_jobs 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_jobs ::Google::Cloud::Scheduler::V1::ListJobsRequest.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_jobs({ 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_jobs(::Google::Cloud::Scheduler::V1::ListJobsRequest.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_jobs_client_stub.call_rpc_count + end + end + + def test_get_job + # Create GRPC objects. + grpc_response = ::Google::Cloud::Scheduler::V1::Job.new + grpc_operation = GRPC::ActiveCall::Operation.new nil + grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + grpc_options = {} + + # Create request parameters for a unary method. + name = "hello world" + + get_job_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :get_job, name + assert_kind_of ::Google::Cloud::Scheduler::V1::GetJobRequest, request + assert_equal "hello world", request["name"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, get_job_client_stub do + # Create client + client = ::Google::Cloud::Scheduler::V1::CloudScheduler::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.get_job({ name: name }) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use named arguments + client.get_job name: name do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.get_job ::Google::Cloud::Scheduler::V1::GetJobRequest.new(name: name) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use hash object with options + client.get_job({ name: name }, grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object with options + client.get_job(::Google::Cloud::Scheduler::V1::GetJobRequest.new(name: name), grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Verify method calls + assert_equal 5, get_job_client_stub.call_rpc_count + end + end + + def test_create_job + # Create GRPC objects. + grpc_response = ::Google::Cloud::Scheduler::V1::Job.new + grpc_operation = GRPC::ActiveCall::Operation.new nil + grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + grpc_options = {} + + # Create request parameters for a unary method. + parent = "hello world" + job = {} + + create_job_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :create_job, name + assert_kind_of ::Google::Cloud::Scheduler::V1::CreateJobRequest, request + assert_equal "hello world", request["parent"] + assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::Scheduler::V1::Job), request["job"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, create_job_client_stub do + # Create client + client = ::Google::Cloud::Scheduler::V1::CloudScheduler::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.create_job({ parent: parent, job: job }) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use named arguments + client.create_job parent: parent, job: job do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.create_job ::Google::Cloud::Scheduler::V1::CreateJobRequest.new(parent: parent, job: job) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use hash object with options + client.create_job({ parent: parent, job: job }, grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object with options + client.create_job(::Google::Cloud::Scheduler::V1::CreateJobRequest.new(parent: parent, job: job), grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Verify method calls + assert_equal 5, create_job_client_stub.call_rpc_count + end + end + + def test_update_job + # Create GRPC objects. + grpc_response = ::Google::Cloud::Scheduler::V1::Job.new + grpc_operation = GRPC::ActiveCall::Operation.new nil + grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + grpc_options = {} + + # Create request parameters for a unary method. + job = {} + update_mask = {} + + update_job_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :update_job, name + assert_kind_of ::Google::Cloud::Scheduler::V1::UpdateJobRequest, request + assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::Scheduler::V1::Job), request["job"] + assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Protobuf::FieldMask), request["update_mask"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, update_job_client_stub do + # Create client + client = ::Google::Cloud::Scheduler::V1::CloudScheduler::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.update_job({ job: job, update_mask: update_mask }) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use named arguments + client.update_job job: job, update_mask: update_mask do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.update_job ::Google::Cloud::Scheduler::V1::UpdateJobRequest.new(job: job, update_mask: update_mask) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use hash object with options + client.update_job({ job: job, update_mask: update_mask }, grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object with options + client.update_job(::Google::Cloud::Scheduler::V1::UpdateJobRequest.new(job: job, update_mask: update_mask), grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Verify method calls + assert_equal 5, update_job_client_stub.call_rpc_count + end + end + + def test_delete_job + # 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_job_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :delete_job, name + assert_kind_of ::Google::Cloud::Scheduler::V1::DeleteJobRequest, request + assert_equal "hello world", request["name"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, delete_job_client_stub do + # Create client + client = ::Google::Cloud::Scheduler::V1::CloudScheduler::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.delete_job({ name: name }) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use named arguments + client.delete_job name: name do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.delete_job ::Google::Cloud::Scheduler::V1::DeleteJobRequest.new(name: name) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use hash object with options + client.delete_job({ name: name }, grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object with options + client.delete_job(::Google::Cloud::Scheduler::V1::DeleteJobRequest.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_job_client_stub.call_rpc_count + end + end + + def test_pause_job + # Create GRPC objects. + grpc_response = ::Google::Cloud::Scheduler::V1::Job.new + grpc_operation = GRPC::ActiveCall::Operation.new nil + grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + grpc_options = {} + + # Create request parameters for a unary method. + name = "hello world" + + pause_job_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :pause_job, name + assert_kind_of ::Google::Cloud::Scheduler::V1::PauseJobRequest, request + assert_equal "hello world", request["name"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, pause_job_client_stub do + # Create client + client = ::Google::Cloud::Scheduler::V1::CloudScheduler::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.pause_job({ name: name }) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use named arguments + client.pause_job name: name do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.pause_job ::Google::Cloud::Scheduler::V1::PauseJobRequest.new(name: name) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use hash object with options + client.pause_job({ name: name }, grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object with options + client.pause_job(::Google::Cloud::Scheduler::V1::PauseJobRequest.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, pause_job_client_stub.call_rpc_count + end + end + + def test_resume_job + # Create GRPC objects. + grpc_response = ::Google::Cloud::Scheduler::V1::Job.new + grpc_operation = GRPC::ActiveCall::Operation.new nil + grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + grpc_options = {} + + # Create request parameters for a unary method. + name = "hello world" + + resume_job_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :resume_job, name + assert_kind_of ::Google::Cloud::Scheduler::V1::ResumeJobRequest, request + assert_equal "hello world", request["name"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, resume_job_client_stub do + # Create client + client = ::Google::Cloud::Scheduler::V1::CloudScheduler::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.resume_job({ name: name }) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use named arguments + client.resume_job name: name do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.resume_job ::Google::Cloud::Scheduler::V1::ResumeJobRequest.new(name: name) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use hash object with options + client.resume_job({ name: name }, grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object with options + client.resume_job(::Google::Cloud::Scheduler::V1::ResumeJobRequest.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, resume_job_client_stub.call_rpc_count + end + end + + def test_run_job + # Create GRPC objects. + grpc_response = ::Google::Cloud::Scheduler::V1::Job.new + grpc_operation = GRPC::ActiveCall::Operation.new nil + grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + grpc_options = {} + + # Create request parameters for a unary method. + name = "hello world" + + run_job_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :run_job, name + assert_kind_of ::Google::Cloud::Scheduler::V1::RunJobRequest, request + assert_equal "hello world", request["name"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, run_job_client_stub do + # Create client + client = ::Google::Cloud::Scheduler::V1::CloudScheduler::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.run_job({ name: name }) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use named arguments + client.run_job name: name do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.run_job ::Google::Cloud::Scheduler::V1::RunJobRequest.new(name: name) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use hash object with options + client.run_job({ name: name }, grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object with options + client.run_job(::Google::Cloud::Scheduler::V1::RunJobRequest.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, run_job_client_stub.call_rpc_count + end + end + + def test_configure + grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + + client = block_config = config = nil + dummy_stub = ClientStub.new nil, nil + Gapic::ServiceStub.stub :new, dummy_stub do + client = ::Google::Cloud::Scheduler::V1::CloudScheduler::Client.new do |config| + config.credentials = grpc_channel + end + end + + config = client.configure do |c| + block_config = c + end + + assert_same block_config, config + assert_kind_of ::Google::Cloud::Scheduler::V1::CloudScheduler::Client::Configuration, config + end + + def test_credentials + key = OpenSSL::PKey::RSA.new 2048 + cred_json = { + "private_key" => key.to_pem, + "client_email" => "app@developer.gserviceaccount.com", + "type" => "service_account" + } + key_file = StringIO.new cred_json.to_json + creds = Google::Auth::ServiceAccountCredentials.make_creds({ json_key_io: key_file }) + + dummy_stub = ClientStub.new nil, nil + Gapic::ServiceStub.stub :new, dummy_stub do + client = ::Google::Cloud::Scheduler::V1::CloudScheduler::Client.new do |config| + config.credentials = creds + end + assert_kind_of ::Google::Cloud::Scheduler::V1::CloudScheduler::Client, client + assert_equal creds, client.configure.credentials + end + end +end diff --git a/owl-bot-staging/google-cloud-scheduler-v1/test/helper.rb b/owl-bot-staging/google-cloud-scheduler-v1/test/helper.rb new file mode 100644 index 000000000000..672b337030e7 --- /dev/null +++ b/owl-bot-staging/google-cloud-scheduler-v1/test/helper.rb @@ -0,0 +1,26 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +require "minitest/autorun" +require "minitest/focus" +require "minitest/mock" +require "minitest/rg" + +require "grpc" + +require "ostruct" diff --git a/owl-bot-staging/google-cloud-scheduler-v1beta1/.gitignore b/owl-bot-staging/google-cloud-scheduler-v1beta1/.gitignore new file mode 100644 index 000000000000..0135b6bc6cfc --- /dev/null +++ b/owl-bot-staging/google-cloud-scheduler-v1beta1/.gitignore @@ -0,0 +1,22 @@ +# Ignore bundler lockfiles +Gemfile.lock +gems.locked + +# Ignore documentation output +doc/* +.yardoc/* + +# Ignore test output +coverage/* + +# Ignore build artifacts +pkg/* + +# Ignore files commonly present in certain dev environments +.vagrant +.DS_STORE +.idea +*.iml + +# Ignore synth output +__pycache__ diff --git a/owl-bot-staging/google-cloud-scheduler-v1beta1/.repo-metadata.json b/owl-bot-staging/google-cloud-scheduler-v1beta1/.repo-metadata.json new file mode 100644 index 000000000000..f3f5f9efcb7f --- /dev/null +++ b/owl-bot-staging/google-cloud-scheduler-v1beta1/.repo-metadata.json @@ -0,0 +1,18 @@ +{ + "api_id": "cloudscheduler.googleapis.com", + "api_shortname": "cloudscheduler", + "client_documentation": "https://cloud.google.com/ruby/docs/reference/google-cloud-scheduler-v1beta1/latest", + "distribution_name": "google-cloud-scheduler-v1beta1", + "is_cloud": true, + "language": "ruby", + "name": "cloudscheduler", + "name_pretty": "Cloud Scheduler V1beta1 API", + "product_documentation": "https://cloud.google.com/scheduler", + "release_level": "unreleased", + "repo": "googleapis/google-cloud-ruby", + "requires_billing": true, + "ruby-cloud-description": "Cloud Scheduler is a fully managed enterprise-grade cron job scheduler. It allows you to schedule virtually any job, including batch, big data jobs, cloud infrastructure operations, and more. You can automate everything, including retries in case of failure to reduce manual toil and intervention. Cloud Scheduler even acts as a single pane of glass, allowing you to manage all your automation tasks from one place. Note that google-cloud-scheduler-v1beta1 is a version-specific client library. For most uses, we recommend installing the main client library google-cloud-scheduler instead. See the readme for more details.", + "ruby-cloud-env-prefix": "SCHEDULER", + "ruby-cloud-product-url": "https://cloud.google.com/scheduler", + "library_type": "GAPIC_AUTO" +} diff --git a/owl-bot-staging/google-cloud-scheduler-v1beta1/.rubocop.yml b/owl-bot-staging/google-cloud-scheduler-v1beta1/.rubocop.yml new file mode 100644 index 000000000000..ea48b9fe0f26 --- /dev/null +++ b/owl-bot-staging/google-cloud-scheduler-v1beta1/.rubocop.yml @@ -0,0 +1,33 @@ +inherit_gem: + google-style: google-style.yml + +AllCops: + Exclude: + - "google-cloud-scheduler-v1beta1.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-scheduler-v1beta1.rb" diff --git a/owl-bot-staging/google-cloud-scheduler-v1beta1/.toys.rb b/owl-bot-staging/google-cloud-scheduler-v1beta1/.toys.rb new file mode 100644 index 000000000000..177e22456e8a --- /dev/null +++ b/owl-bot-staging/google-cloud-scheduler-v1beta1/.toys.rb @@ -0,0 +1,28 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +toys_version! ">= 0.15.3" + +if ENV["RUBY_COMMON_TOOLS"] + common_tools_dir = File.expand_path ENV["RUBY_COMMON_TOOLS"] + load File.join(common_tools_dir, "toys", "gapic") +else + load_git remote: "https://github.com/googleapis/ruby-common-tools.git", + path: "toys/gapic", + update: true +end diff --git a/owl-bot-staging/google-cloud-scheduler-v1beta1/.yardopts b/owl-bot-staging/google-cloud-scheduler-v1beta1/.yardopts new file mode 100644 index 000000000000..68204fd650cb --- /dev/null +++ b/owl-bot-staging/google-cloud-scheduler-v1beta1/.yardopts @@ -0,0 +1,12 @@ +--no-private +--title="Cloud Scheduler V1beta1 API" +--exclude _pb\.rb$ +--markup markdown +--markup-provider redcarpet + +./lib/**/*.rb +./proto_docs/**/*.rb +- +README.md +LICENSE.md +AUTHENTICATION.md diff --git a/owl-bot-staging/google-cloud-scheduler-v1beta1/AUTHENTICATION.md b/owl-bot-staging/google-cloud-scheduler-v1beta1/AUTHENTICATION.md new file mode 100644 index 000000000000..79ce23be1f05 --- /dev/null +++ b/owl-bot-staging/google-cloud-scheduler-v1beta1/AUTHENTICATION.md @@ -0,0 +1,122 @@ +# Authentication + +The recommended way to authenticate to the google-cloud-scheduler-v1beta1 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-scheduler-v1beta1 library provides several mechanisms to configure your system. +Generally, using Application Default Credentials to facilitate automatic +credentials discovery is the easist method. But if you need to explicitly specify +credentials, there are several methods available to you. + +Credentials are accepted in the following ways, in the following order or precedence: + +1. Credentials specified in method arguments +2. Credentials specified in configuration +3. Credentials pointed to or included in environment variables +4. Credentials found in local ADC file +5. Credentials returned by the metadata server for the attached service account (GCP) + +### Configuration + +You can configure a path to a JSON credentials file, either for an individual client object or +globally, for all client objects. The JSON file can contain credentials created for +[workload identity federation](https://cloud.google.com/iam/docs/workload-identity-federation), +[workforce identity federation](https://cloud.google.com/iam/docs/workforce-identity-federation), or a +[service account key](https://cloud.google.com/docs/authentication/provide-credentials-adc#local-key). + +Note: Service account keys are a security risk if not managed correctly. You should +[choose a more secure alternative to service account keys](https://cloud.google.com/docs/authentication#auth-decision-tree) +whenever possible. + +To configure a credentials file for an individual client initialization: + +```ruby +require "google/cloud/scheduler/v1beta1" + +client = ::Google::Cloud::Scheduler::V1beta1::CloudScheduler::Client.new do |config| + config.credentials = "path/to/credentialfile.json" +end +``` + +To configure a credentials file globally for all clients: + +```ruby +require "google/cloud/scheduler/v1beta1" + +::Google::Cloud::Scheduler::V1beta1::CloudScheduler::Client.configure do |config| + config.credentials = "path/to/credentialfile.json" +end + +client = ::Google::Cloud::Scheduler::V1beta1::CloudScheduler::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-scheduler-v1beta1 +checks for credentials are: + +* `GOOGLE_CLOUD_CREDENTIALS` - Path to JSON file, or JSON contents +* `GOOGLE_APPLICATION_CREDENTIALS` - Path to JSON file + +```ruby +require "google/cloud/scheduler/v1beta1" + +ENV["GOOGLE_APPLICATION_CREDENTIALS"] = "path/to/credentialfile.json" + +client = ::Google::Cloud::Scheduler::V1beta1::CloudScheduler::Client.new +``` + +### Local ADC file + +You can set up a local ADC file with your user credentials for authentication during +development. If credentials are not provided in code or in environment variables, +then the local ADC credentials are discovered. + +Follow the steps in [Quickstart](#quickstart) to set up a local ADC file. + +### Google Cloud Platform environments + +When running on Google Cloud Platform (GCP), including Google Compute Engine +(GCE), Google Kubernetes Engine (GKE), Google App Engine (GAE), Google Cloud +Functions (GCF) and Cloud Run, credentials are retrieved from the attached +service account automatically. Code should be written as if already authenticated. + +For more information, see +[Set up ADC for Google Cloud services](https://cloud.google.com/docs/authentication/provide-credentials-adc#attached-sa). diff --git a/owl-bot-staging/google-cloud-scheduler-v1beta1/CHANGELOG.md b/owl-bot-staging/google-cloud-scheduler-v1beta1/CHANGELOG.md new file mode 100644 index 000000000000..f88957a62ba2 --- /dev/null +++ b/owl-bot-staging/google-cloud-scheduler-v1beta1/CHANGELOG.md @@ -0,0 +1,2 @@ +# Release History + diff --git a/owl-bot-staging/google-cloud-scheduler-v1beta1/Gemfile b/owl-bot-staging/google-cloud-scheduler-v1beta1/Gemfile new file mode 100644 index 000000000000..1d08558908d8 --- /dev/null +++ b/owl-bot-staging/google-cloud-scheduler-v1beta1/Gemfile @@ -0,0 +1,14 @@ +source "https://rubygems.org" + +gemspec + +gem "google-style", "~> 1.32.0" +gem "irb", "~> 1.17" +gem "minitest", "~> 6.0.2" +gem "minitest-focus", "~> 1.4" +gem "minitest-mock", "~> 5.27" +gem "minitest-rg", "~> 5.3" +gem "ostruct", "~> 0.5.5" +gem "rake", ">= 13.0" +gem "redcarpet", "~> 3.6" +gem "yard", "~> 0.9" diff --git a/owl-bot-staging/google-cloud-scheduler-v1beta1/LICENSE.md b/owl-bot-staging/google-cloud-scheduler-v1beta1/LICENSE.md new file mode 100644 index 000000000000..c261857ba6ad --- /dev/null +++ b/owl-bot-staging/google-cloud-scheduler-v1beta1/LICENSE.md @@ -0,0 +1,201 @@ + Apache License + Version 2.0, January 2004 + http://www.apache.org/licenses/ + + TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION + + 1. Definitions. + + "License" shall mean the terms and conditions for use, reproduction, + and distribution as defined by Sections 1 through 9 of this document. + + "Licensor" shall mean the copyright owner or entity authorized by + the copyright owner that is granting the License. + + "Legal Entity" shall mean the union of the acting entity and all + other entities that control, are controlled by, or are under common + control with that entity. For the purposes of this definition, + "control" means (i) the power, direct or indirect, to cause the + direction or management of such entity, whether by contract or + otherwise, or (ii) ownership of fifty percent (50%) or more of the + outstanding shares, or (iii) beneficial ownership of such entity. + + "You" (or "Your") shall mean an individual or Legal Entity + exercising permissions granted by this License. + + "Source" form shall mean the preferred form for making modifications, + including but not limited to software source code, documentation + source, and configuration files. + + "Object" form shall mean any form resulting from mechanical + transformation or translation of a Source form, including but + not limited to compiled object code, generated documentation, + and conversions to other media types. + + "Work" shall mean the work of authorship, whether in Source or + Object form, made available under the License, as indicated by a + copyright notice that is included in or attached to the work + (an example is provided in the Appendix below). + + "Derivative Works" shall mean any work, whether in Source or Object + form, that is based on (or derived from) the Work and for which the + editorial revisions, annotations, elaborations, or other modifications + represent, as a whole, an original work of authorship. For the purposes + of this License, Derivative Works shall not include works that remain + separable from, or merely link (or bind by name) to the interfaces of, + the Work and Derivative Works thereof. + + "Contribution" shall mean any work of authorship, including + the original version of the Work and any modifications or additions + to that Work or Derivative Works thereof, that is intentionally + submitted to Licensor for inclusion in the Work by the copyright owner + or by an individual or Legal Entity authorized to submit on behalf of + the copyright owner. For the purposes of this definition, "submitted" + means any form of electronic, verbal, or written communication sent + to the Licensor or its representatives, including but not limited to + communication on electronic mailing lists, source code control systems, + and issue tracking systems that are managed by, or on behalf of, the + Licensor for the purpose of discussing and improving the Work, but + excluding communication that is conspicuously marked or otherwise + designated in writing by the copyright owner as "Not a Contribution." + + "Contributor" shall mean Licensor and any individual or Legal Entity + on behalf of whom a Contribution has been received by Licensor and + subsequently incorporated within the Work. + + 2. Grant of Copyright License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + copyright license to reproduce, prepare Derivative Works of, + publicly display, publicly perform, sublicense, and distribute the + Work and such Derivative Works in Source or Object form. + + 3. Grant of Patent License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + (except as stated in this section) patent license to make, have made, + use, offer to sell, sell, import, and otherwise transfer the Work, + where such license applies only to those patent claims licensable + by such Contributor that are necessarily infringed by their + Contribution(s) alone or by combination of their Contribution(s) + with the Work to which such Contribution(s) was submitted. If You + institute patent litigation against any entity (including a + cross-claim or counterclaim in a lawsuit) alleging that the Work + or a Contribution incorporated within the Work constitutes direct + or contributory patent infringement, then any patent licenses + granted to You under this License for that Work shall terminate + as of the date such litigation is filed. + + 4. Redistribution. You may reproduce and distribute copies of the + Work or Derivative Works thereof in any medium, with or without + modifications, and in Source or Object form, provided that You + meet the following conditions: + + (a) You must give any other recipients of the Work or + Derivative Works a copy of this License; and + + (b) You must cause any modified files to carry prominent notices + stating that You changed the files; and + + (c) You must retain, in the Source form of any Derivative Works + that You distribute, all copyright, patent, trademark, and + attribution notices from the Source form of the Work, + excluding those notices that do not pertain to any part of + the Derivative Works; and + + (d) If the Work includes a "NOTICE" text file as part of its + distribution, then any Derivative Works that You distribute must + include a readable copy of the attribution notices contained + within such NOTICE file, excluding those notices that do not + pertain to any part of the Derivative Works, in at least one + of the following places: within a NOTICE text file distributed + as part of the Derivative Works; within the Source form or + documentation, if provided along with the Derivative Works; or, + within a display generated by the Derivative Works, if and + wherever such third-party notices normally appear. The contents + of the NOTICE file are for informational purposes only and + do not modify the License. You may add Your own attribution + notices within Derivative Works that You distribute, alongside + or as an addendum to the NOTICE text from the Work, provided + that such additional attribution notices cannot be construed + as modifying the License. + + You may add Your own copyright statement to Your modifications and + may provide additional or different license terms and conditions + for use, reproduction, or distribution of Your modifications, or + for any such Derivative Works as a whole, provided Your use, + reproduction, and distribution of the Work otherwise complies with + the conditions stated in this License. + + 5. Submission of Contributions. Unless You explicitly state otherwise, + any Contribution intentionally submitted for inclusion in the Work + by You to the Licensor shall be under the terms and conditions of + this License, without any additional terms or conditions. + Notwithstanding the above, nothing herein shall supersede or modify + the terms of any separate license agreement you may have executed + with Licensor regarding such Contributions. + + 6. Trademarks. This License does not grant permission to use the trade + names, trademarks, service marks, or product names of the Licensor, + except as required for reasonable and customary use in describing the + origin of the Work and reproducing the content of the NOTICE file. + + 7. Disclaimer of Warranty. Unless required by applicable law or + agreed to in writing, Licensor provides the Work (and each + Contributor provides its Contributions) on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or + implied, including, without limitation, any warranties or conditions + of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A + PARTICULAR PURPOSE. You are solely responsible for determining the + appropriateness of using or redistributing the Work and assume any + risks associated with Your exercise of permissions under this License. + + 8. Limitation of Liability. In no event and under no legal theory, + whether in tort (including negligence), contract, or otherwise, + unless required by applicable law (such as deliberate and grossly + negligent acts) or agreed to in writing, shall any Contributor be + liable to You for damages, including any direct, indirect, special, + incidental, or consequential damages of any character arising as a + result of this License or out of the use or inability to use the + Work (including but not limited to damages for loss of goodwill, + work stoppage, computer failure or malfunction, or any and all + other commercial damages or losses), even if such Contributor + has been advised of the possibility of such damages. + + 9. Accepting Warranty or Additional Liability. While redistributing + the Work or Derivative Works thereof, You may choose to offer, + and charge a fee for, acceptance of support, warranty, indemnity, + or other liability obligations and/or rights consistent with this + License. However, in accepting such obligations, You may act only + on Your own behalf and on Your sole responsibility, not on behalf + of any other Contributor, and only if You agree to indemnify, + defend, and hold each Contributor harmless for any liability + incurred by, or claims asserted against, such Contributor by reason + of your accepting any such warranty or additional liability. + + END OF TERMS AND CONDITIONS + + APPENDIX: How to apply the Apache License to your work. + + To apply the Apache License to your work, attach the following + boilerplate notice, with the fields enclosed by brackets "[]" + replaced with your own identifying information. (Don't include + the brackets!) The text should be enclosed in the appropriate + comment syntax for the file format. We also recommend that a + file or class name and description of purpose be included on the + same "printed page" as the copyright notice for easier + identification within third-party archives. + + Copyright [yyyy] [name of copyright owner] + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. diff --git a/owl-bot-staging/google-cloud-scheduler-v1beta1/README.md b/owl-bot-staging/google-cloud-scheduler-v1beta1/README.md new file mode 100644 index 000000000000..547e97f8de13 --- /dev/null +++ b/owl-bot-staging/google-cloud-scheduler-v1beta1/README.md @@ -0,0 +1,154 @@ +# Ruby Client for the Cloud Scheduler V1beta1 API + +Creates and manages jobs run on a regular recurring schedule. + +Cloud Scheduler is a fully managed enterprise-grade cron job scheduler. It allows you to schedule virtually any job, including batch, big data jobs, cloud infrastructure operations, and more. You can automate everything, including retries in case of failure to reduce manual toil and intervention. Cloud Scheduler even acts as a single pane of glass, allowing you to manage all your automation tasks from one place. + +https://github.com/googleapis/google-cloud-ruby + +This gem is a _versioned_ client. It provides basic client classes for a +specific version of the Cloud Scheduler V1beta1 API. Most users should consider using +the main client gem, +[google-cloud-scheduler](https://rubygems.org/gems/google-cloud-scheduler). +See the section below titled *Which client should I use?* for more information. + +## Installation + +``` +$ gem install google-cloud-scheduler-v1beta1 +``` + +## 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/cloudscheduler.googleapis.com) +1. [Set up authentication.](AUTHENTICATION.md) + +## Quick Start + +```ruby +require "google/cloud/scheduler/v1beta1" + +client = ::Google::Cloud::Scheduler::V1beta1::CloudScheduler::Client.new +request = ::Google::Cloud::Scheduler::V1beta1::ListJobsRequest.new # (request fields as keyword arguments...) +response = client.list_jobs request +``` + +View the [Client Library Documentation](https://cloud.google.com/ruby/docs/reference/google-cloud-scheduler-v1beta1/latest) +for class and method documentation. + +See also the [Product Documentation](https://cloud.google.com/scheduler) +for general usage information. + +## Debug Logging + +This library comes with opt-in Debug Logging that can help you troubleshoot +your application's integration with the API. When logging is activated, key +events such as requests and responses, along with data payloads and metadata +such as headers and client configuration, are logged to the standard error +stream. + +**WARNING:** Client Library Debug Logging includes your data payloads in +plaintext, which could include sensitive data such as PII for yourself or your +customers, private keys, or other security data that could be compromising if +leaked. Always practice good data hygiene with your application logs, and follow +the principle of least access. Google also recommends that Client Library Debug +Logging be enabled only temporarily during active debugging, and not used +permanently in production. + +To enable logging, set the environment variable `GOOGLE_SDK_RUBY_LOGGING_GEMS` +to the value `all`. Alternatively, you can set the value to a comma-delimited +list of client library gem names. This will select the default logging behavior, +which writes logs to the standard error stream. On a local workstation, this may +result in logs appearing on the console. When running on a Google Cloud hosting +service such as [Google Cloud Run](https://cloud.google.com/run), this generally +results in logs appearing alongside your application logs in the +[Google Cloud Logging](https://cloud.google.com/logging/) service. + +You can customize logging by modifying the `logger` configuration when +constructing a client object. For example: + +```ruby +require "google/cloud/scheduler/v1beta1" +require "logger" + +client = ::Google::Cloud::Scheduler::V1beta1::CloudScheduler::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-scheduler`, +and lower-level _versioned_ client libraries with names such as +`google-cloud-scheduler-v1beta1`. +_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-scheduler`. +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-scheduler-v1beta1`. + +### What about the google-apis- clients? + +Client library gems with names that begin with `google-apis-` are based on an +older code generation technology. They talk to a REST/JSON backend (whereas +most modern clients talk to a [gRPC](https://grpc.io/) backend) and they may +not offer the same performance, features, and ease of use provided by more +modern clients. + +The `google-apis-` clients have wide coverage across Google services, so you +might need to use one if there is no modern client available for the service. +However, if a modern client is available, we generally recommend it over the +older `google-apis-` clients. diff --git a/owl-bot-staging/google-cloud-scheduler-v1beta1/Rakefile b/owl-bot-staging/google-cloud-scheduler-v1beta1/Rakefile new file mode 100644 index 000000000000..1b73f3167c83 --- /dev/null +++ b/owl-bot-staging/google-cloud-scheduler-v1beta1/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-scheduler-v1beta1 acceptance tests." +task :acceptance, :project, :keyfile do |t, args| + project = args[:project] + project ||= + ENV["SCHEDULER_TEST_PROJECT"] || + ENV["GCLOUD_TEST_PROJECT"] + keyfile = args[:keyfile] + keyfile ||= + ENV["SCHEDULER_TEST_KEYFILE"] || + ENV["GCLOUD_TEST_KEYFILE"] + if keyfile + keyfile = File.read keyfile + else + keyfile ||= + ENV["SCHEDULER_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 SCHEDULER_TEST_PROJECT=test123 SCHEDULER_TEST_KEYFILE=/path/to/keyfile.json rake acceptance" + end + require "google/cloud/scheduler/v1beta1/cloud_scheduler/credentials" + ::Google::Cloud::Scheduler::V1beta1::CloudScheduler::Credentials.env_vars.each do |path| + ENV[path] = nil + end + ENV["SCHEDULER_PROJECT"] = project + ENV["SCHEDULER_TEST_PROJECT"] = project + ENV["SCHEDULER_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-scheduler-v1beta1 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-scheduler-v1beta1 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-scheduler-v1beta1 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-scheduler-v1beta1 gem does not have doctest tests." +end + +desc "Run the CI build" +task :ci do + header "BUILDING google-cloud-scheduler-v1beta1" + header "google-cloud-scheduler-v1beta1 rubocop", "*" + Rake::Task[:rubocop].invoke + header "google-cloud-scheduler-v1beta1 yard", "*" + Rake::Task[:yard].invoke + header "google-cloud-scheduler-v1beta1 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-scheduler-v1beta1 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-scheduler-v1beta1 acceptance", "*" + Rake::Task[:acceptance].invoke + end + task :a do + # This is a handy shortcut to save typing + Rake::Task["ci:acceptance"].invoke + end +end + +task default: :test + +def header str, token = "#" + line_length = str.length + 8 + puts "" + puts token * line_length + puts "#{token * 3} #{str} #{token * 3}" + puts token * line_length + puts "" +end diff --git a/owl-bot-staging/google-cloud-scheduler-v1beta1/gapic_metadata.json b/owl-bot-staging/google-cloud-scheduler-v1beta1/gapic_metadata.json new file mode 100644 index 000000000000..38068627a009 --- /dev/null +++ b/owl-bot-staging/google-cloud-scheduler-v1beta1/gapic_metadata.json @@ -0,0 +1,58 @@ +{ + "schema": "1.0", + "comment": "This file maps proto services/RPCs to the corresponding library clients/methods", + "language": "ruby", + "protoPackage": "google.cloud.scheduler.v1beta1", + "libraryPackage": "::Google::Cloud::Scheduler::V1beta1", + "services": { + "CloudScheduler": { + "clients": { + "grpc": { + "libraryClient": "::Google::Cloud::Scheduler::V1beta1::CloudScheduler::Client", + "rpcs": { + "ListJobs": { + "methods": [ + "list_jobs" + ] + }, + "GetJob": { + "methods": [ + "get_job" + ] + }, + "CreateJob": { + "methods": [ + "create_job" + ] + }, + "UpdateJob": { + "methods": [ + "update_job" + ] + }, + "DeleteJob": { + "methods": [ + "delete_job" + ] + }, + "PauseJob": { + "methods": [ + "pause_job" + ] + }, + "ResumeJob": { + "methods": [ + "resume_job" + ] + }, + "RunJob": { + "methods": [ + "run_job" + ] + } + } + } + } + } + } +} diff --git a/owl-bot-staging/google-cloud-scheduler-v1beta1/google-cloud-scheduler-v1beta1.gemspec b/owl-bot-staging/google-cloud-scheduler-v1beta1/google-cloud-scheduler-v1beta1.gemspec new file mode 100644 index 000000000000..dfc2480a97e6 --- /dev/null +++ b/owl-bot-staging/google-cloud-scheduler-v1beta1/google-cloud-scheduler-v1beta1.gemspec @@ -0,0 +1,29 @@ +# -*- ruby -*- +# encoding: utf-8 + +require File.expand_path("lib/google/cloud/scheduler/v1beta1/version", __dir__) + +Gem::Specification.new do |gem| + gem.name = "google-cloud-scheduler-v1beta1" + gem.version = Google::Cloud::Scheduler::V1beta1::VERSION + + gem.authors = ["Google LLC"] + gem.email = "googleapis-packages@google.com" + gem.description = "Cloud Scheduler is a fully managed enterprise-grade cron job scheduler. It allows you to schedule virtually any job, including batch, big data jobs, cloud infrastructure operations, and more. You can automate everything, including retries in case of failure to reduce manual toil and intervention. Cloud Scheduler even acts as a single pane of glass, allowing you to manage all your automation tasks from one place. Note that google-cloud-scheduler-v1beta1 is a version-specific client library. For most uses, we recommend installing the main client library google-cloud-scheduler instead. See the readme for more details." + gem.summary = "Creates and manages jobs run on a regular recurring schedule." + 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-cloud-scheduler-v1beta1/lib/google-cloud-scheduler-v1beta1.rb b/owl-bot-staging/google-cloud-scheduler-v1beta1/lib/google-cloud-scheduler-v1beta1.rb new file mode 100644 index 000000000000..2fc8d8df7f1b --- /dev/null +++ b/owl-bot-staging/google-cloud-scheduler-v1beta1/lib/google-cloud-scheduler-v1beta1.rb @@ -0,0 +1,21 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +# This gem does not autoload during Bundler.require. To load this gem, +# issue explicit require statements for the packages desired, e.g.: +# require "google/cloud/scheduler/v1beta1" diff --git a/owl-bot-staging/google-cloud-scheduler-v1beta1/lib/google/cloud/scheduler/v1beta1.rb b/owl-bot-staging/google-cloud-scheduler-v1beta1/lib/google/cloud/scheduler/v1beta1.rb new file mode 100644 index 000000000000..9d6957410905 --- /dev/null +++ b/owl-bot-staging/google-cloud-scheduler-v1beta1/lib/google/cloud/scheduler/v1beta1.rb @@ -0,0 +1,45 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +require "google/cloud/scheduler/v1beta1/cloud_scheduler" +require "google/cloud/scheduler/v1beta1/version" + +module Google + module Cloud + module Scheduler + ## + # API client module. + # + # @example Load this package, including all its services, and instantiate a gRPC client + # + # require "google/cloud/scheduler/v1beta1" + # client = ::Google::Cloud::Scheduler::V1beta1::CloudScheduler::Client.new + # + # @example Load this package, including all its services, and instantiate a REST client + # + # require "google/cloud/scheduler/v1beta1" + # client = ::Google::Cloud::Scheduler::V1beta1::CloudScheduler::Rest::Client.new + # + module V1beta1 + end + end + end +end + +helper_path = ::File.join __dir__, "v1beta1", "_helpers.rb" +require "google/cloud/scheduler/v1beta1/_helpers" if ::File.file? helper_path diff --git a/owl-bot-staging/google-cloud-scheduler-v1beta1/lib/google/cloud/scheduler/v1beta1/bindings_override.rb b/owl-bot-staging/google-cloud-scheduler-v1beta1/lib/google/cloud/scheduler/v1beta1/bindings_override.rb new file mode 100644 index 000000000000..d6e1755d072e --- /dev/null +++ b/owl-bot-staging/google-cloud-scheduler-v1beta1/lib/google/cloud/scheduler/v1beta1/bindings_override.rb @@ -0,0 +1,75 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +require "gapic/rest" + +module Google + module Cloud + module Scheduler + ## + # @example Loading just the REST part of this package, including all its services, and instantiating a REST client + # + # require "google/cloud/scheduler/v1beta1/rest" + # client = ::Google::Cloud::Scheduler::V1beta1::CloudScheduler::Rest::Client.new + # + module V1beta1 + ## + # @private + # Initialize the mixin bindings configuration + # + def self.configure + @configure ||= begin + namespace = ["Google", "Cloud", "Scheduler"] + parent_config = while namespace.any? + parent_name = namespace.join "::" + parent_const = const_get parent_name + break parent_const.configure if parent_const.respond_to? :configure + namespace.pop + end + + default_config = ::Gapic::Rest::HttpBindingOverrideConfiguration.new parent_config + default_config.bindings_override["google.cloud.location.Locations.GetLocation"] = [ + Gapic::Rest::GrpcTranscoder::HttpBinding.create_with_validation( + uri_method: :get, + uri_template: "/v1beta1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/?$}, false] + ], + body: nil + ) + ] + default_config.bindings_override["google.cloud.location.Locations.ListLocations"] = [ + + Gapic::Rest::GrpcTranscoder::HttpBinding.create_with_validation( + uri_method: :get, + uri_template: "/v1beta1/{name}/locations", + matches: [ + ["name", %r{^projects/[^/]+/?$}, false] + ], + body: nil + ) + ] + default_config + end + yield @configure if block_given? + @configure + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-scheduler-v1beta1/lib/google/cloud/scheduler/v1beta1/cloud_scheduler.rb b/owl-bot-staging/google-cloud-scheduler-v1beta1/lib/google/cloud/scheduler/v1beta1/cloud_scheduler.rb new file mode 100644 index 000000000000..8d2939bc3884 --- /dev/null +++ b/owl-bot-staging/google-cloud-scheduler-v1beta1/lib/google/cloud/scheduler/v1beta1/cloud_scheduler.rb @@ -0,0 +1,56 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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/scheduler/v1beta1/version" + +require "google/cloud/scheduler/v1beta1/cloud_scheduler/credentials" +require "google/cloud/scheduler/v1beta1/cloud_scheduler/paths" +require "google/cloud/scheduler/v1beta1/cloud_scheduler/client" +require "google/cloud/scheduler/v1beta1/cloud_scheduler/rest" + +module Google + module Cloud + module Scheduler + module V1beta1 + ## + # The Cloud Scheduler API allows external entities to reliably + # schedule asynchronous jobs. + # + # @example Load this service and instantiate a gRPC client + # + # require "google/cloud/scheduler/v1beta1/cloud_scheduler" + # client = ::Google::Cloud::Scheduler::V1beta1::CloudScheduler::Client.new + # + # @example Load this service and instantiate a REST client + # + # require "google/cloud/scheduler/v1beta1/cloud_scheduler/rest" + # client = ::Google::Cloud::Scheduler::V1beta1::CloudScheduler::Rest::Client.new + # + module CloudScheduler + end + end + end + end +end + +helper_path = ::File.join __dir__, "cloud_scheduler", "helpers.rb" +require "google/cloud/scheduler/v1beta1/cloud_scheduler/helpers" if ::File.file? helper_path diff --git a/owl-bot-staging/google-cloud-scheduler-v1beta1/lib/google/cloud/scheduler/v1beta1/cloud_scheduler/client.rb b/owl-bot-staging/google-cloud-scheduler-v1beta1/lib/google/cloud/scheduler/v1beta1/cloud_scheduler/client.rb new file mode 100644 index 000000000000..6640f3feecc1 --- /dev/null +++ b/owl-bot-staging/google-cloud-scheduler-v1beta1/lib/google/cloud/scheduler/v1beta1/cloud_scheduler/client.rb @@ -0,0 +1,1263 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +require "google/cloud/errors" +require "google/cloud/scheduler/v1beta1/cloudscheduler_pb" +require "google/cloud/location" + +module Google + module Cloud + module Scheduler + module V1beta1 + module CloudScheduler + ## + # Client for the CloudScheduler service. + # + # The Cloud Scheduler API allows external entities to reliably + # schedule asynchronous jobs. + # + class Client + # @private + API_VERSION = "" + + # @private + DEFAULT_ENDPOINT_TEMPLATE = "cloudscheduler.$UNIVERSE_DOMAIN$" + + include Paths + + # @private + attr_reader :cloud_scheduler_stub + + ## + # Configure the CloudScheduler Client class. + # + # See {::Google::Cloud::Scheduler::V1beta1::CloudScheduler::Client::Configuration} + # for a description of the configuration fields. + # + # @example + # + # # Modify the configuration for all CloudScheduler clients + # ::Google::Cloud::Scheduler::V1beta1::CloudScheduler::Client.configure do |config| + # config.timeout = 10.0 + # end + # + # @yield [config] Configure the Client client. + # @yieldparam config [Client::Configuration] + # + # @return [Client::Configuration] + # + def self.configure + @configure ||= begin + namespace = ["Google", "Cloud", "Scheduler", "V1beta1"] + parent_config = while namespace.any? + parent_name = namespace.join "::" + parent_const = const_get parent_name + break parent_const.configure if parent_const.respond_to? :configure + namespace.pop + end + default_config = Client::Configuration.new parent_config + + default_config.rpcs.list_jobs.timeout = 600.0 + default_config.rpcs.list_jobs.retry_policy = { + initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [4, 14] + } + + default_config.rpcs.get_job.timeout = 600.0 + default_config.rpcs.get_job.retry_policy = { + initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [4, 14] + } + + default_config.rpcs.create_job.timeout = 600.0 + + default_config.rpcs.update_job.timeout = 600.0 + + default_config.rpcs.delete_job.timeout = 600.0 + default_config.rpcs.delete_job.retry_policy = { + initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [4, 14] + } + + default_config.rpcs.pause_job.timeout = 600.0 + default_config.rpcs.pause_job.retry_policy = { + initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [4, 14] + } + + default_config.rpcs.resume_job.timeout = 600.0 + default_config.rpcs.resume_job.retry_policy = { + initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [4, 14] + } + + default_config.rpcs.run_job.timeout = 600.0 + + default_config + end + yield @configure if block_given? + @configure + end + + ## + # Configure the CloudScheduler Client instance. + # + # The configuration is set to the derived mode, meaning that values can be changed, + # but structural changes (adding new fields, etc.) are not allowed. Structural changes + # should be made on {Client.configure}. + # + # See {::Google::Cloud::Scheduler::V1beta1::CloudScheduler::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 + @cloud_scheduler_stub.universe_domain + end + + ## + # Create a new CloudScheduler client object. + # + # @example + # + # # Create a client using the default configuration + # client = ::Google::Cloud::Scheduler::V1beta1::CloudScheduler::Client.new + # + # # Create a client using a custom configuration + # client = ::Google::Cloud::Scheduler::V1beta1::CloudScheduler::Client.new do |config| + # config.timeout = 10.0 + # end + # + # @yield [config] Configure the CloudScheduler client. + # @yieldparam config [Client::Configuration] + # + def initialize + # These require statements are intentionally placed here to initialize + # the gRPC module only when it's required. + # See https://github.com/googleapis/toolkit/issues/446 + require "gapic/grpc" + require "google/cloud/scheduler/v1beta1/cloudscheduler_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 + + @cloud_scheduler_stub = ::Gapic::ServiceStub.new( + ::Google::Cloud::Scheduler::V1beta1::CloudScheduler::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 + ) + + @cloud_scheduler_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 = @cloud_scheduler_stub.endpoint + config.universe_domain = @cloud_scheduler_stub.universe_domain + config.logger = @cloud_scheduler_stub.logger if config.respond_to? :logger= + end + end + + ## + # Get the associated client for mix-in of the Locations. + # + # @return [Google::Cloud::Location::Locations::Client] + # + attr_reader :location_client + + ## + # The logger used for request/response debug logging. + # + # @return [Logger] + # + def logger + @cloud_scheduler_stub.logger + end + + # Service calls + + ## + # Lists jobs. + # + # @overload list_jobs(request, options = nil) + # Pass arguments to `list_jobs` via a request object, either of type + # {::Google::Cloud::Scheduler::V1beta1::ListJobsRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Scheduler::V1beta1::ListJobsRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. + # + # @overload list_jobs(parent: nil, filter: nil, page_size: nil, page_token: nil, legacy_app_engine_cron: nil) + # Pass arguments to `list_jobs` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param parent [::String] + # Required. The location name. For example: + # `projects/PROJECT_ID/locations/LOCATION_ID`. + # @param filter [::String] + # `filter` can be used to specify a subset of jobs. + # + # If `filter` equals `target_config="HttpConfig"`, then the http + # target jobs are retrieved. If `filter` equals + # `target_config="PubSubConfig"`, then the Pub/Sub target jobs are + # retrieved. If `filter` equals `labels.foo=value1 + # labels.foo=value2` then only jobs which are labeled with + # foo=value1 AND foo=value2 will be returned. + # @param page_size [::Integer] + # Requested page size. + # + # The maximum page size is 500. If unspecified, the page size will + # be the maximum. Fewer jobs than requested might be returned, + # even if more jobs exist; use next_page_token to determine if more + # jobs exist. + # @param page_token [::String] + # A token identifying a page of results the server will return. To + # request the first page results, page_token must be empty. To + # request the next page of results, page_token must be the value of + # {::Google::Cloud::Scheduler::V1beta1::ListJobsResponse#next_page_token next_page_token} + # returned from the previous call to + # {::Google::Cloud::Scheduler::V1beta1::CloudScheduler::Client#list_jobs ListJobs}. It is + # an error to switch the value of + # {::Google::Cloud::Scheduler::V1beta1::ListJobsRequest#filter filter} or + # [order_by][google.cloud.scheduler.v1beta1.ListJobsRequest.order_by] while + # iterating through pages. + # @param legacy_app_engine_cron [::Boolean] + # This field is used to manage the legacy App Engine Cron jobs using the + # Cloud Scheduler API. If the field is set to true, the jobs in the __cron + # queue will be listed instead. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Gapic::PagedEnumerable<::Google::Cloud::Scheduler::V1beta1::Job>] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Gapic::PagedEnumerable<::Google::Cloud::Scheduler::V1beta1::Job>] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/scheduler/v1beta1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Scheduler::V1beta1::CloudScheduler::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Scheduler::V1beta1::ListJobsRequest.new + # + # # Call the list_jobs method. + # result = client.list_jobs request + # + # # The returned object is of type Gapic::PagedEnumerable. You can iterate + # # over elements, and API calls will be issued to fetch pages as needed. + # result.each do |item| + # # Each element is of type ::Google::Cloud::Scheduler::V1beta1::Job. + # p item + # end + # + def list_jobs request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Scheduler::V1beta1::ListJobsRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + metadata = @config.rpcs.list_jobs.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::Scheduler::V1beta1::VERSION + metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.parent + header_params["parent"] = request.parent + end + + request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") + metadata[:"x-goog-request-params"] ||= request_params_header + + options.apply_defaults timeout: @config.rpcs.list_jobs.timeout, + metadata: metadata, + retry_policy: @config.rpcs.list_jobs.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @cloud_scheduler_stub.call_rpc :list_jobs, request, options: options do |response, operation| + response = ::Gapic::PagedEnumerable.new @cloud_scheduler_stub, :list_jobs, request, response, operation, options + yield response, operation if block_given? + throw :response, response + end + rescue ::GRPC::BadStatus => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Gets a job. + # + # @overload get_job(request, options = nil) + # Pass arguments to `get_job` via a request object, either of type + # {::Google::Cloud::Scheduler::V1beta1::GetJobRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Scheduler::V1beta1::GetJobRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. + # + # @overload get_job(name: nil) + # Pass arguments to `get_job` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param name [::String] + # Required. The job name. For example: + # `projects/PROJECT_ID/locations/LOCATION_ID/jobs/JOB_ID`. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Google::Cloud::Scheduler::V1beta1::Job] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Google::Cloud::Scheduler::V1beta1::Job] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/scheduler/v1beta1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Scheduler::V1beta1::CloudScheduler::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Scheduler::V1beta1::GetJobRequest.new + # + # # Call the get_job method. + # result = client.get_job request + # + # # The returned object is of type Google::Cloud::Scheduler::V1beta1::Job. + # p result + # + def get_job request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Scheduler::V1beta1::GetJobRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + metadata = @config.rpcs.get_job.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::Scheduler::V1beta1::VERSION + metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.name + header_params["name"] = request.name + end + + request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") + metadata[:"x-goog-request-params"] ||= request_params_header + + options.apply_defaults timeout: @config.rpcs.get_job.timeout, + metadata: metadata, + retry_policy: @config.rpcs.get_job.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @cloud_scheduler_stub.call_rpc :get_job, request, options: options do |response, operation| + yield response, operation if block_given? + end + rescue ::GRPC::BadStatus => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Creates a job. + # + # @overload create_job(request, options = nil) + # Pass arguments to `create_job` via a request object, either of type + # {::Google::Cloud::Scheduler::V1beta1::CreateJobRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Scheduler::V1beta1::CreateJobRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. + # + # @overload create_job(parent: nil, job: nil) + # Pass arguments to `create_job` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param parent [::String] + # Required. The location name. For example: + # `projects/PROJECT_ID/locations/LOCATION_ID`. + # @param job [::Google::Cloud::Scheduler::V1beta1::Job, ::Hash] + # Required. The job to add. The user can optionally specify a name for the + # job in {::Google::Cloud::Scheduler::V1beta1::Job#name name}. + # {::Google::Cloud::Scheduler::V1beta1::Job#name name} cannot be the same as an + # existing job. If a name is not specified then the system will + # generate a random unique name that will be returned + # ({::Google::Cloud::Scheduler::V1beta1::Job#name name}) in the response. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Google::Cloud::Scheduler::V1beta1::Job] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Google::Cloud::Scheduler::V1beta1::Job] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/scheduler/v1beta1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Scheduler::V1beta1::CloudScheduler::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Scheduler::V1beta1::CreateJobRequest.new + # + # # Call the create_job method. + # result = client.create_job request + # + # # The returned object is of type Google::Cloud::Scheduler::V1beta1::Job. + # p result + # + def create_job request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Scheduler::V1beta1::CreateJobRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + metadata = @config.rpcs.create_job.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::Scheduler::V1beta1::VERSION + metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.parent + header_params["parent"] = request.parent + end + + request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") + metadata[:"x-goog-request-params"] ||= request_params_header + + options.apply_defaults timeout: @config.rpcs.create_job.timeout, + metadata: metadata, + retry_policy: @config.rpcs.create_job.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @cloud_scheduler_stub.call_rpc :create_job, 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 job. + # + # If successful, the updated {::Google::Cloud::Scheduler::V1beta1::Job Job} is + # returned. If the job does not exist, `NOT_FOUND` is returned. + # + # If UpdateJob does not successfully return, it is possible for the + # job to be in an + # {::Google::Cloud::Scheduler::V1beta1::Job::State::UPDATE_FAILED Job.State.UPDATE_FAILED} + # state. A job in this state may not be executed. If this happens, retry the + # UpdateJob request until a successful response is received. + # + # @overload update_job(request, options = nil) + # Pass arguments to `update_job` via a request object, either of type + # {::Google::Cloud::Scheduler::V1beta1::UpdateJobRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Scheduler::V1beta1::UpdateJobRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_job(job: nil, update_mask: nil) + # Pass arguments to `update_job` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param job [::Google::Cloud::Scheduler::V1beta1::Job, ::Hash] + # Required. The new job properties. + # {::Google::Cloud::Scheduler::V1beta1::Job#name name} must be specified. + # + # Output only fields cannot be modified using UpdateJob. + # Any value specified for an output only field will be ignored. + # @param update_mask [::Google::Protobuf::FieldMask, ::Hash] + # A mask used to specify which fields of the job are being updated. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Google::Cloud::Scheduler::V1beta1::Job] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Google::Cloud::Scheduler::V1beta1::Job] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/scheduler/v1beta1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Scheduler::V1beta1::CloudScheduler::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Scheduler::V1beta1::UpdateJobRequest.new + # + # # Call the update_job method. + # result = client.update_job request + # + # # The returned object is of type Google::Cloud::Scheduler::V1beta1::Job. + # p result + # + def update_job request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Scheduler::V1beta1::UpdateJobRequest + + # Converts hash 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_job.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::Scheduler::V1beta1::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.job&.name + header_params["job.name"] = request.job.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_job.timeout, + metadata: metadata, + retry_policy: @config.rpcs.update_job.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @cloud_scheduler_stub.call_rpc :update_job, request, options: options do |response, operation| + yield response, operation if block_given? + end + rescue ::GRPC::BadStatus => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Deletes a job. + # + # @overload delete_job(request, options = nil) + # Pass arguments to `delete_job` via a request object, either of type + # {::Google::Cloud::Scheduler::V1beta1::DeleteJobRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Scheduler::V1beta1::DeleteJobRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. + # + # @overload delete_job(name: nil, legacy_app_engine_cron: nil) + # Pass arguments to `delete_job` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param name [::String] + # Required. The job name. For example: + # `projects/PROJECT_ID/locations/LOCATION_ID/jobs/JOB_ID`. + # @param legacy_app_engine_cron [::Boolean] + # This field is used to manage the legacy App Engine Cron jobs using the + # Cloud Scheduler API. If the field is set to true, the job in the __cron + # queue with the corresponding name will be deleted instead. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Google::Protobuf::Empty] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Google::Protobuf::Empty] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/scheduler/v1beta1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Scheduler::V1beta1::CloudScheduler::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Scheduler::V1beta1::DeleteJobRequest.new + # + # # Call the delete_job method. + # result = client.delete_job request + # + # # The returned object is of type Google::Protobuf::Empty. + # p result + # + def delete_job request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Scheduler::V1beta1::DeleteJobRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + metadata = @config.rpcs.delete_job.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::Scheduler::V1beta1::VERSION + metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.name + header_params["name"] = request.name + end + + request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") + metadata[:"x-goog-request-params"] ||= request_params_header + + options.apply_defaults timeout: @config.rpcs.delete_job.timeout, + metadata: metadata, + retry_policy: @config.rpcs.delete_job.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @cloud_scheduler_stub.call_rpc :delete_job, request, options: options do |response, operation| + yield response, operation if block_given? + end + rescue ::GRPC::BadStatus => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Pauses a job. + # + # If a job is paused then the system will stop executing the job + # until it is re-enabled via + # {::Google::Cloud::Scheduler::V1beta1::CloudScheduler::Client#resume_job ResumeJob}. The + # state of the job is stored in + # {::Google::Cloud::Scheduler::V1beta1::Job#state state}; if paused it will be set + # to {::Google::Cloud::Scheduler::V1beta1::Job::State::PAUSED Job.State.PAUSED}. A + # job must be in + # {::Google::Cloud::Scheduler::V1beta1::Job::State::ENABLED Job.State.ENABLED} to be + # paused. + # + # @overload pause_job(request, options = nil) + # Pass arguments to `pause_job` via a request object, either of type + # {::Google::Cloud::Scheduler::V1beta1::PauseJobRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Scheduler::V1beta1::PauseJobRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. + # + # @overload pause_job(name: nil) + # Pass arguments to `pause_job` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param name [::String] + # Required. The job name. For example: + # `projects/PROJECT_ID/locations/LOCATION_ID/jobs/JOB_ID`. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Google::Cloud::Scheduler::V1beta1::Job] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Google::Cloud::Scheduler::V1beta1::Job] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/scheduler/v1beta1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Scheduler::V1beta1::CloudScheduler::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Scheduler::V1beta1::PauseJobRequest.new + # + # # Call the pause_job method. + # result = client.pause_job request + # + # # The returned object is of type Google::Cloud::Scheduler::V1beta1::Job. + # p result + # + def pause_job request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Scheduler::V1beta1::PauseJobRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + metadata = @config.rpcs.pause_job.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::Scheduler::V1beta1::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.pause_job.timeout, + metadata: metadata, + retry_policy: @config.rpcs.pause_job.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @cloud_scheduler_stub.call_rpc :pause_job, 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 + + ## + # Resume a job. + # + # This method reenables a job after it has been + # {::Google::Cloud::Scheduler::V1beta1::Job::State::PAUSED Job.State.PAUSED}. The + # state of a job is stored in + # {::Google::Cloud::Scheduler::V1beta1::Job#state Job.state}; after calling this + # method it will be set to + # {::Google::Cloud::Scheduler::V1beta1::Job::State::ENABLED Job.State.ENABLED}. A + # job must be in + # {::Google::Cloud::Scheduler::V1beta1::Job::State::PAUSED Job.State.PAUSED} to be + # resumed. + # + # @overload resume_job(request, options = nil) + # Pass arguments to `resume_job` via a request object, either of type + # {::Google::Cloud::Scheduler::V1beta1::ResumeJobRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Scheduler::V1beta1::ResumeJobRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. + # + # @overload resume_job(name: nil) + # Pass arguments to `resume_job` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param name [::String] + # Required. The job name. For example: + # `projects/PROJECT_ID/locations/LOCATION_ID/jobs/JOB_ID`. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Google::Cloud::Scheduler::V1beta1::Job] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Google::Cloud::Scheduler::V1beta1::Job] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/scheduler/v1beta1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Scheduler::V1beta1::CloudScheduler::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Scheduler::V1beta1::ResumeJobRequest.new + # + # # Call the resume_job method. + # result = client.resume_job request + # + # # The returned object is of type Google::Cloud::Scheduler::V1beta1::Job. + # p result + # + def resume_job request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Scheduler::V1beta1::ResumeJobRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + metadata = @config.rpcs.resume_job.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::Scheduler::V1beta1::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.resume_job.timeout, + metadata: metadata, + retry_policy: @config.rpcs.resume_job.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @cloud_scheduler_stub.call_rpc :resume_job, 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 + + ## + # Forces a job to run now. + # + # When this method is called, Cloud Scheduler will dispatch the job, even + # if the job is already running. + # + # @overload run_job(request, options = nil) + # Pass arguments to `run_job` via a request object, either of type + # {::Google::Cloud::Scheduler::V1beta1::RunJobRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Scheduler::V1beta1::RunJobRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. + # + # @overload run_job(name: nil, legacy_app_engine_cron: nil) + # Pass arguments to `run_job` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param name [::String] + # Required. The job name. For example: + # `projects/PROJECT_ID/locations/LOCATION_ID/jobs/JOB_ID`. + # @param legacy_app_engine_cron [::Boolean] + # This field is used to manage the legacy App Engine Cron jobs using the + # Cloud Scheduler API. If the field is set to true, the job in the __cron + # queue with the corresponding name will be forced to run instead. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Google::Cloud::Scheduler::V1beta1::Job] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Google::Cloud::Scheduler::V1beta1::Job] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/scheduler/v1beta1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Scheduler::V1beta1::CloudScheduler::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Scheduler::V1beta1::RunJobRequest.new + # + # # Call the run_job method. + # result = client.run_job request + # + # # The returned object is of type Google::Cloud::Scheduler::V1beta1::Job. + # p result + # + def run_job request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Scheduler::V1beta1::RunJobRequest + + # Converts hash 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.run_job.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::Scheduler::V1beta1::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.run_job.timeout, + metadata: metadata, + retry_policy: @config.rpcs.run_job.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @cloud_scheduler_stub.call_rpc :run_job, request, options: options do |response, operation| + yield response, operation if block_given? + end + rescue ::GRPC::BadStatus => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Configuration class for the CloudScheduler API. + # + # This class represents the configuration for CloudScheduler, + # providing control over timeouts, retry behavior, logging, transport + # parameters, and other low-level controls. Certain parameters can also be + # applied individually to specific RPCs. See + # {::Google::Cloud::Scheduler::V1beta1::CloudScheduler::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_jobs to 20 seconds, + # # and all remaining timeouts to 10 seconds. + # ::Google::Cloud::Scheduler::V1beta1::CloudScheduler::Client.configure do |config| + # config.timeout = 10.0 + # config.rpcs.list_jobs.timeout = 20.0 + # end + # + # # Apply the above configuration only to a new client. + # client = ::Google::Cloud::Scheduler::V1beta1::CloudScheduler::Client.new do |config| + # config.timeout = 10.0 + # config.rpcs.list_jobs.timeout = 20.0 + # end + # + # @!attribute [rw] endpoint + # A custom service endpoint, as a hostname or hostname:port. The default is + # nil, indicating to use the default endpoint in the current universe domain. + # @return [::String,nil] + # @!attribute [rw] credentials + # Credentials to send with calls. You may provide any of the following types: + # * (`Google::Auth::Credentials`) A googleauth credentials object + # (see the [googleauth docs](https://rubydoc.info/gems/googleauth/Google/Auth/Credentials)) + # * (`Signet::OAuth2::Client`) A signet oauth2 client object + # (see the [signet docs](https://rubydoc.info/gems/signet/Signet/OAuth2/Client)) + # * (`GRPC::Core::Channel`) a gRPC channel with included credentials + # * (`GRPC::Core::ChannelCredentials`) a gRPC credentails object + # * (`nil`) indicating no credentials + # + # @note Warning: Passing a `String` to a keyfile path or a `Hash` of credentials + # is deprecated. Providing an unvalidated credential configuration to + # Google APIs can compromise the security of your systems and data. + # + # @example + # + # # The recommended way to provide credentials is to use the `make_creds` method + # # on the appropriate credentials class for your environment. + # + # require "googleauth" + # + # credentials = ::Google::Auth::ServiceAccountCredentials.make_creds( + # json_key_io: ::File.open("/path/to/keyfile.json") + # ) + # + # client = ::Google::Cloud::Scheduler::V1beta1::CloudScheduler::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 = "cloudscheduler.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 CloudScheduler 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_jobs` + # @return [::Gapic::Config::Method] + # + attr_reader :list_jobs + ## + # RPC-specific configuration for `get_job` + # @return [::Gapic::Config::Method] + # + attr_reader :get_job + ## + # RPC-specific configuration for `create_job` + # @return [::Gapic::Config::Method] + # + attr_reader :create_job + ## + # RPC-specific configuration for `update_job` + # @return [::Gapic::Config::Method] + # + attr_reader :update_job + ## + # RPC-specific configuration for `delete_job` + # @return [::Gapic::Config::Method] + # + attr_reader :delete_job + ## + # RPC-specific configuration for `pause_job` + # @return [::Gapic::Config::Method] + # + attr_reader :pause_job + ## + # RPC-specific configuration for `resume_job` + # @return [::Gapic::Config::Method] + # + attr_reader :resume_job + ## + # RPC-specific configuration for `run_job` + # @return [::Gapic::Config::Method] + # + attr_reader :run_job + + # @private + def initialize parent_rpcs = nil + list_jobs_config = parent_rpcs.list_jobs if parent_rpcs.respond_to? :list_jobs + @list_jobs = ::Gapic::Config::Method.new list_jobs_config + get_job_config = parent_rpcs.get_job if parent_rpcs.respond_to? :get_job + @get_job = ::Gapic::Config::Method.new get_job_config + create_job_config = parent_rpcs.create_job if parent_rpcs.respond_to? :create_job + @create_job = ::Gapic::Config::Method.new create_job_config + update_job_config = parent_rpcs.update_job if parent_rpcs.respond_to? :update_job + @update_job = ::Gapic::Config::Method.new update_job_config + delete_job_config = parent_rpcs.delete_job if parent_rpcs.respond_to? :delete_job + @delete_job = ::Gapic::Config::Method.new delete_job_config + pause_job_config = parent_rpcs.pause_job if parent_rpcs.respond_to? :pause_job + @pause_job = ::Gapic::Config::Method.new pause_job_config + resume_job_config = parent_rpcs.resume_job if parent_rpcs.respond_to? :resume_job + @resume_job = ::Gapic::Config::Method.new resume_job_config + run_job_config = parent_rpcs.run_job if parent_rpcs.respond_to? :run_job + @run_job = ::Gapic::Config::Method.new run_job_config + + yield self if block_given? + end + end + end + end + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-scheduler-v1beta1/lib/google/cloud/scheduler/v1beta1/cloud_scheduler/credentials.rb b/owl-bot-staging/google-cloud-scheduler-v1beta1/lib/google/cloud/scheduler/v1beta1/cloud_scheduler/credentials.rb new file mode 100644 index 000000000000..1e748ee1d335 --- /dev/null +++ b/owl-bot-staging/google-cloud-scheduler-v1beta1/lib/google/cloud/scheduler/v1beta1/cloud_scheduler/credentials.rb @@ -0,0 +1,51 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +require "googleauth" + +module Google + module Cloud + module Scheduler + module V1beta1 + module CloudScheduler + # Credentials for the CloudScheduler API. + class Credentials < ::Google::Auth::Credentials + self.scope = [ + "https://www.googleapis.com/auth/cloud-platform" + ] + self.env_vars = [ + "SCHEDULER_CREDENTIALS", + "SCHEDULER_KEYFILE", + "GOOGLE_CLOUD_CREDENTIALS", + "GOOGLE_CLOUD_KEYFILE", + "GCLOUD_KEYFILE", + "SCHEDULER_CREDENTIALS_JSON", + "SCHEDULER_KEYFILE_JSON", + "GOOGLE_CLOUD_CREDENTIALS_JSON", + "GOOGLE_CLOUD_KEYFILE_JSON", + "GCLOUD_KEYFILE_JSON" + ] + self.paths = [ + "~/.config/google_cloud/application_default_credentials.json" + ] + end + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-scheduler-v1beta1/lib/google/cloud/scheduler/v1beta1/cloud_scheduler/paths.rb b/owl-bot-staging/google-cloud-scheduler-v1beta1/lib/google/cloud/scheduler/v1beta1/cloud_scheduler/paths.rb new file mode 100644 index 000000000000..4aa2f604894d --- /dev/null +++ b/owl-bot-staging/google-cloud-scheduler-v1beta1/lib/google/cloud/scheduler/v1beta1/cloud_scheduler/paths.rb @@ -0,0 +1,86 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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 Scheduler + module V1beta1 + module CloudScheduler + # Path helper methods for the CloudScheduler API. + module Paths + ## + # Create a fully-qualified Job resource string. + # + # The resource will be in the following format: + # + # `projects/{project}/locations/{location}/jobs/{job}` + # + # @param project [String] + # @param location [String] + # @param job [String] + # + # @return [::String] + def job_path project:, location:, job: + raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" + raise ::ArgumentError, "location cannot contain /" if location.to_s.include? "/" + + "projects/#{project}/locations/#{location}/jobs/#{job}" + end + + ## + # Create a fully-qualified Location resource string. + # + # The resource will be in the following format: + # + # `projects/{project}/locations/{location}` + # + # @param project [String] + # @param location [String] + # + # @return [::String] + def location_path project:, location: + raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" + + "projects/#{project}/locations/#{location}" + end + + ## + # Create a fully-qualified Topic resource string. + # + # The resource will be in the following format: + # + # `projects/{project}/topics/{topic}` + # + # @param project [String] + # @param topic [String] + # + # @return [::String] + def topic_path project:, topic: + raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" + + "projects/#{project}/topics/#{topic}" + end + + extend self + end + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-scheduler-v1beta1/lib/google/cloud/scheduler/v1beta1/cloud_scheduler/rest.rb b/owl-bot-staging/google-cloud-scheduler-v1beta1/lib/google/cloud/scheduler/v1beta1/cloud_scheduler/rest.rb new file mode 100644 index 000000000000..5b196c24f2f5 --- /dev/null +++ b/owl-bot-staging/google-cloud-scheduler-v1beta1/lib/google/cloud/scheduler/v1beta1/cloud_scheduler/rest.rb @@ -0,0 +1,54 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +require "gapic/rest" +require "gapic/config" +require "gapic/config/method" + +require "google/cloud/scheduler/v1beta1/version" +require "google/cloud/scheduler/v1beta1/bindings_override" + +require "google/cloud/scheduler/v1beta1/cloud_scheduler/credentials" +require "google/cloud/scheduler/v1beta1/cloud_scheduler/paths" +require "google/cloud/scheduler/v1beta1/cloud_scheduler/rest/client" + +module Google + module Cloud + module Scheduler + module V1beta1 + ## + # The Cloud Scheduler API allows external entities to reliably + # schedule asynchronous jobs. + # + # To load this service and instantiate a REST client: + # + # require "google/cloud/scheduler/v1beta1/cloud_scheduler/rest" + # client = ::Google::Cloud::Scheduler::V1beta1::CloudScheduler::Rest::Client.new + # + module CloudScheduler + # Client for the REST transport + module Rest + end + end + end + end + end +end + +helper_path = ::File.join __dir__, "rest", "helpers.rb" +require "google/cloud/scheduler/v1beta1/cloud_scheduler/rest/helpers" if ::File.file? helper_path diff --git a/owl-bot-staging/google-cloud-scheduler-v1beta1/lib/google/cloud/scheduler/v1beta1/cloud_scheduler/rest/client.rb b/owl-bot-staging/google-cloud-scheduler-v1beta1/lib/google/cloud/scheduler/v1beta1/cloud_scheduler/rest/client.rb new file mode 100644 index 000000000000..9475b683bd26 --- /dev/null +++ b/owl-bot-staging/google-cloud-scheduler-v1beta1/lib/google/cloud/scheduler/v1beta1/cloud_scheduler/rest/client.rb @@ -0,0 +1,1172 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +require "google/cloud/errors" +require "google/cloud/scheduler/v1beta1/cloudscheduler_pb" +require "google/cloud/scheduler/v1beta1/cloud_scheduler/rest/service_stub" +require "google/cloud/location/rest" + +module Google + module Cloud + module Scheduler + module V1beta1 + module CloudScheduler + module Rest + ## + # REST client for the CloudScheduler service. + # + # The Cloud Scheduler API allows external entities to reliably + # schedule asynchronous jobs. + # + class Client + # @private + API_VERSION = "" + + # @private + DEFAULT_ENDPOINT_TEMPLATE = "cloudscheduler.$UNIVERSE_DOMAIN$" + + include Paths + + # @private + attr_reader :cloud_scheduler_stub + + ## + # Configure the CloudScheduler Client class. + # + # See {::Google::Cloud::Scheduler::V1beta1::CloudScheduler::Rest::Client::Configuration} + # for a description of the configuration fields. + # + # @example + # + # # Modify the configuration for all CloudScheduler clients + # ::Google::Cloud::Scheduler::V1beta1::CloudScheduler::Rest::Client.configure do |config| + # config.timeout = 10.0 + # end + # + # @yield [config] Configure the Client client. + # @yieldparam config [Client::Configuration] + # + # @return [Client::Configuration] + # + def self.configure + @configure ||= begin + namespace = ["Google", "Cloud", "Scheduler", "V1beta1"] + parent_config = while namespace.any? + parent_name = namespace.join "::" + parent_const = const_get parent_name + break parent_const.configure if parent_const.respond_to? :configure + namespace.pop + end + default_config = Client::Configuration.new parent_config + + default_config.rpcs.list_jobs.timeout = 600.0 + default_config.rpcs.list_jobs.retry_policy = { + initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [4, 14] + } + + default_config.rpcs.get_job.timeout = 600.0 + default_config.rpcs.get_job.retry_policy = { + initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [4, 14] + } + + default_config.rpcs.create_job.timeout = 600.0 + + default_config.rpcs.update_job.timeout = 600.0 + + default_config.rpcs.delete_job.timeout = 600.0 + default_config.rpcs.delete_job.retry_policy = { + initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [4, 14] + } + + default_config.rpcs.pause_job.timeout = 600.0 + default_config.rpcs.pause_job.retry_policy = { + initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [4, 14] + } + + default_config.rpcs.resume_job.timeout = 600.0 + default_config.rpcs.resume_job.retry_policy = { + initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [4, 14] + } + + default_config.rpcs.run_job.timeout = 600.0 + + default_config + end + yield @configure if block_given? + @configure + end + + ## + # Configure the CloudScheduler Client instance. + # + # The configuration is set to the derived mode, meaning that values can be changed, + # but structural changes (adding new fields, etc.) are not allowed. Structural changes + # should be made on {Client.configure}. + # + # See {::Google::Cloud::Scheduler::V1beta1::CloudScheduler::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 + @cloud_scheduler_stub.universe_domain + end + + ## + # Create a new CloudScheduler REST client object. + # + # @example + # + # # Create a client using the default configuration + # client = ::Google::Cloud::Scheduler::V1beta1::CloudScheduler::Rest::Client.new + # + # # Create a client using a custom configuration + # client = ::Google::Cloud::Scheduler::V1beta1::CloudScheduler::Rest::Client.new do |config| + # config.timeout = 10.0 + # end + # + # @yield [config] Configure the CloudScheduler 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 + + @cloud_scheduler_stub = ::Google::Cloud::Scheduler::V1beta1::CloudScheduler::Rest::ServiceStub.new( + endpoint: @config.endpoint, + endpoint_template: DEFAULT_ENDPOINT_TEMPLATE, + universe_domain: @config.universe_domain, + credentials: credentials, + logger: @config.logger + ) + + @cloud_scheduler_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 = @cloud_scheduler_stub.endpoint + config.universe_domain = @cloud_scheduler_stub.universe_domain + config.bindings_override = @config.bindings_override + config.logger = @cloud_scheduler_stub.logger if config.respond_to? :logger= + end + end + + ## + # Get the associated client for mix-in of the Locations. + # + # @return [Google::Cloud::Location::Locations::Rest::Client] + # + attr_reader :location_client + + ## + # The logger used for request/response debug logging. + # + # @return [Logger] + # + def logger + @cloud_scheduler_stub.logger + end + + # Service calls + + ## + # Lists jobs. + # + # @overload list_jobs(request, options = nil) + # Pass arguments to `list_jobs` via a request object, either of type + # {::Google::Cloud::Scheduler::V1beta1::ListJobsRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Scheduler::V1beta1::ListJobsRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @overload list_jobs(parent: nil, filter: nil, page_size: nil, page_token: nil, legacy_app_engine_cron: nil) + # Pass arguments to `list_jobs` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param parent [::String] + # Required. The location name. For example: + # `projects/PROJECT_ID/locations/LOCATION_ID`. + # @param filter [::String] + # `filter` can be used to specify a subset of jobs. + # + # If `filter` equals `target_config="HttpConfig"`, then the http + # target jobs are retrieved. If `filter` equals + # `target_config="PubSubConfig"`, then the Pub/Sub target jobs are + # retrieved. If `filter` equals `labels.foo=value1 + # labels.foo=value2` then only jobs which are labeled with + # foo=value1 AND foo=value2 will be returned. + # @param page_size [::Integer] + # Requested page size. + # + # The maximum page size is 500. If unspecified, the page size will + # be the maximum. Fewer jobs than requested might be returned, + # even if more jobs exist; use next_page_token to determine if more + # jobs exist. + # @param page_token [::String] + # A token identifying a page of results the server will return. To + # request the first page results, page_token must be empty. To + # request the next page of results, page_token must be the value of + # {::Google::Cloud::Scheduler::V1beta1::ListJobsResponse#next_page_token next_page_token} + # returned from the previous call to + # {::Google::Cloud::Scheduler::V1beta1::CloudScheduler::Rest::Client#list_jobs ListJobs}. It is + # an error to switch the value of + # {::Google::Cloud::Scheduler::V1beta1::ListJobsRequest#filter filter} or + # [order_by][google.cloud.scheduler.v1beta1.ListJobsRequest.order_by] while + # iterating through pages. + # @param legacy_app_engine_cron [::Boolean] + # This field is used to manage the legacy App Engine Cron jobs using the + # Cloud Scheduler API. If the field is set to true, the jobs in the __cron + # queue will be listed instead. + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Gapic::Rest::PagedEnumerable<::Google::Cloud::Scheduler::V1beta1::Job>] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Gapic::Rest::PagedEnumerable<::Google::Cloud::Scheduler::V1beta1::Job>] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/scheduler/v1beta1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Scheduler::V1beta1::CloudScheduler::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Scheduler::V1beta1::ListJobsRequest.new + # + # # Call the list_jobs method. + # result = client.list_jobs request + # + # # The returned object is of type Gapic::PagedEnumerable. You can iterate + # # over elements, and API calls will be issued to fetch pages as needed. + # result.each do |item| + # # Each element is of type ::Google::Cloud::Scheduler::V1beta1::Job. + # p item + # end + # + def list_jobs request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Scheduler::V1beta1::ListJobsRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + call_metadata = @config.rpcs.list_jobs.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::Scheduler::V1beta1::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + options.apply_defaults timeout: @config.rpcs.list_jobs.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.list_jobs.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @cloud_scheduler_stub.list_jobs request, options do |result, operation| + result = ::Gapic::Rest::PagedEnumerable.new @cloud_scheduler_stub, :list_jobs, "jobs", 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 a job. + # + # @overload get_job(request, options = nil) + # Pass arguments to `get_job` via a request object, either of type + # {::Google::Cloud::Scheduler::V1beta1::GetJobRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Scheduler::V1beta1::GetJobRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @overload get_job(name: nil) + # Pass arguments to `get_job` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param name [::String] + # Required. The job name. For example: + # `projects/PROJECT_ID/locations/LOCATION_ID/jobs/JOB_ID`. + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Cloud::Scheduler::V1beta1::Job] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::Scheduler::V1beta1::Job] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/scheduler/v1beta1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Scheduler::V1beta1::CloudScheduler::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Scheduler::V1beta1::GetJobRequest.new + # + # # Call the get_job method. + # result = client.get_job request + # + # # The returned object is of type Google::Cloud::Scheduler::V1beta1::Job. + # p result + # + def get_job request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Scheduler::V1beta1::GetJobRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + call_metadata = @config.rpcs.get_job.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::Scheduler::V1beta1::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + options.apply_defaults timeout: @config.rpcs.get_job.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.get_job.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @cloud_scheduler_stub.get_job request, options do |result, operation| + yield result, operation if block_given? + end + rescue ::Gapic::Rest::Error => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Creates a job. + # + # @overload create_job(request, options = nil) + # Pass arguments to `create_job` via a request object, either of type + # {::Google::Cloud::Scheduler::V1beta1::CreateJobRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Scheduler::V1beta1::CreateJobRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @overload create_job(parent: nil, job: nil) + # Pass arguments to `create_job` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param parent [::String] + # Required. The location name. For example: + # `projects/PROJECT_ID/locations/LOCATION_ID`. + # @param job [::Google::Cloud::Scheduler::V1beta1::Job, ::Hash] + # Required. The job to add. The user can optionally specify a name for the + # job in {::Google::Cloud::Scheduler::V1beta1::Job#name name}. + # {::Google::Cloud::Scheduler::V1beta1::Job#name name} cannot be the same as an + # existing job. If a name is not specified then the system will + # generate a random unique name that will be returned + # ({::Google::Cloud::Scheduler::V1beta1::Job#name name}) in the response. + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Cloud::Scheduler::V1beta1::Job] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::Scheduler::V1beta1::Job] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/scheduler/v1beta1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Scheduler::V1beta1::CloudScheduler::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Scheduler::V1beta1::CreateJobRequest.new + # + # # Call the create_job method. + # result = client.create_job request + # + # # The returned object is of type Google::Cloud::Scheduler::V1beta1::Job. + # p result + # + def create_job request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Scheduler::V1beta1::CreateJobRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + call_metadata = @config.rpcs.create_job.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::Scheduler::V1beta1::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + options.apply_defaults timeout: @config.rpcs.create_job.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.create_job.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @cloud_scheduler_stub.create_job 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 job. + # + # If successful, the updated {::Google::Cloud::Scheduler::V1beta1::Job Job} is + # returned. If the job does not exist, `NOT_FOUND` is returned. + # + # If UpdateJob does not successfully return, it is possible for the + # job to be in an + # {::Google::Cloud::Scheduler::V1beta1::Job::State::UPDATE_FAILED Job.State.UPDATE_FAILED} + # state. A job in this state may not be executed. If this happens, retry the + # UpdateJob request until a successful response is received. + # + # @overload update_job(request, options = nil) + # Pass arguments to `update_job` via a request object, either of type + # {::Google::Cloud::Scheduler::V1beta1::UpdateJobRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Scheduler::V1beta1::UpdateJobRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_job(job: nil, update_mask: nil) + # Pass arguments to `update_job` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param job [::Google::Cloud::Scheduler::V1beta1::Job, ::Hash] + # Required. The new job properties. + # {::Google::Cloud::Scheduler::V1beta1::Job#name name} must be specified. + # + # Output only fields cannot be modified using UpdateJob. + # Any value specified for an output only field will be ignored. + # @param update_mask [::Google::Protobuf::FieldMask, ::Hash] + # A mask used to specify which fields of the job are being updated. + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Cloud::Scheduler::V1beta1::Job] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::Scheduler::V1beta1::Job] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/scheduler/v1beta1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Scheduler::V1beta1::CloudScheduler::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Scheduler::V1beta1::UpdateJobRequest.new + # + # # Call the update_job method. + # result = client.update_job request + # + # # The returned object is of type Google::Cloud::Scheduler::V1beta1::Job. + # p result + # + def update_job request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Scheduler::V1beta1::UpdateJobRequest + + # Converts hash 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_job.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::Scheduler::V1beta1::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_job.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.update_job.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @cloud_scheduler_stub.update_job request, options do |result, operation| + yield result, operation if block_given? + end + rescue ::Gapic::Rest::Error => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Deletes a job. + # + # @overload delete_job(request, options = nil) + # Pass arguments to `delete_job` via a request object, either of type + # {::Google::Cloud::Scheduler::V1beta1::DeleteJobRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Scheduler::V1beta1::DeleteJobRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @overload delete_job(name: nil, legacy_app_engine_cron: nil) + # Pass arguments to `delete_job` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param name [::String] + # Required. The job name. For example: + # `projects/PROJECT_ID/locations/LOCATION_ID/jobs/JOB_ID`. + # @param legacy_app_engine_cron [::Boolean] + # This field is used to manage the legacy App Engine Cron jobs using the + # Cloud Scheduler API. If the field is set to true, the job in the __cron + # queue with the corresponding name will be deleted instead. + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Protobuf::Empty] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Protobuf::Empty] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/scheduler/v1beta1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Scheduler::V1beta1::CloudScheduler::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Scheduler::V1beta1::DeleteJobRequest.new + # + # # Call the delete_job method. + # result = client.delete_job request + # + # # The returned object is of type Google::Protobuf::Empty. + # p result + # + def delete_job request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Scheduler::V1beta1::DeleteJobRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + call_metadata = @config.rpcs.delete_job.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::Scheduler::V1beta1::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + options.apply_defaults timeout: @config.rpcs.delete_job.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.delete_job.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @cloud_scheduler_stub.delete_job 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 + + ## + # Pauses a job. + # + # If a job is paused then the system will stop executing the job + # until it is re-enabled via + # {::Google::Cloud::Scheduler::V1beta1::CloudScheduler::Rest::Client#resume_job ResumeJob}. The + # state of the job is stored in + # {::Google::Cloud::Scheduler::V1beta1::Job#state state}; if paused it will be set + # to {::Google::Cloud::Scheduler::V1beta1::Job::State::PAUSED Job.State.PAUSED}. A + # job must be in + # {::Google::Cloud::Scheduler::V1beta1::Job::State::ENABLED Job.State.ENABLED} to be + # paused. + # + # @overload pause_job(request, options = nil) + # Pass arguments to `pause_job` via a request object, either of type + # {::Google::Cloud::Scheduler::V1beta1::PauseJobRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Scheduler::V1beta1::PauseJobRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @overload pause_job(name: nil) + # Pass arguments to `pause_job` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param name [::String] + # Required. The job name. For example: + # `projects/PROJECT_ID/locations/LOCATION_ID/jobs/JOB_ID`. + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Cloud::Scheduler::V1beta1::Job] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::Scheduler::V1beta1::Job] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/scheduler/v1beta1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Scheduler::V1beta1::CloudScheduler::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Scheduler::V1beta1::PauseJobRequest.new + # + # # Call the pause_job method. + # result = client.pause_job request + # + # # The returned object is of type Google::Cloud::Scheduler::V1beta1::Job. + # p result + # + def pause_job request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Scheduler::V1beta1::PauseJobRequest + + # Converts hash 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.pause_job.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::Scheduler::V1beta1::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.pause_job.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.pause_job.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @cloud_scheduler_stub.pause_job 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 + + ## + # Resume a job. + # + # This method reenables a job after it has been + # {::Google::Cloud::Scheduler::V1beta1::Job::State::PAUSED Job.State.PAUSED}. The + # state of a job is stored in + # {::Google::Cloud::Scheduler::V1beta1::Job#state Job.state}; after calling this + # method it will be set to + # {::Google::Cloud::Scheduler::V1beta1::Job::State::ENABLED Job.State.ENABLED}. A + # job must be in + # {::Google::Cloud::Scheduler::V1beta1::Job::State::PAUSED Job.State.PAUSED} to be + # resumed. + # + # @overload resume_job(request, options = nil) + # Pass arguments to `resume_job` via a request object, either of type + # {::Google::Cloud::Scheduler::V1beta1::ResumeJobRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Scheduler::V1beta1::ResumeJobRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @overload resume_job(name: nil) + # Pass arguments to `resume_job` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param name [::String] + # Required. The job name. For example: + # `projects/PROJECT_ID/locations/LOCATION_ID/jobs/JOB_ID`. + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Cloud::Scheduler::V1beta1::Job] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::Scheduler::V1beta1::Job] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/scheduler/v1beta1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Scheduler::V1beta1::CloudScheduler::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Scheduler::V1beta1::ResumeJobRequest.new + # + # # Call the resume_job method. + # result = client.resume_job request + # + # # The returned object is of type Google::Cloud::Scheduler::V1beta1::Job. + # p result + # + def resume_job request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Scheduler::V1beta1::ResumeJobRequest + + # Converts hash 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.resume_job.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::Scheduler::V1beta1::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.resume_job.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.resume_job.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @cloud_scheduler_stub.resume_job 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 + + ## + # Forces a job to run now. + # + # When this method is called, Cloud Scheduler will dispatch the job, even + # if the job is already running. + # + # @overload run_job(request, options = nil) + # Pass arguments to `run_job` via a request object, either of type + # {::Google::Cloud::Scheduler::V1beta1::RunJobRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Scheduler::V1beta1::RunJobRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @overload run_job(name: nil, legacy_app_engine_cron: nil) + # Pass arguments to `run_job` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param name [::String] + # Required. The job name. For example: + # `projects/PROJECT_ID/locations/LOCATION_ID/jobs/JOB_ID`. + # @param legacy_app_engine_cron [::Boolean] + # This field is used to manage the legacy App Engine Cron jobs using the + # Cloud Scheduler API. If the field is set to true, the job in the __cron + # queue with the corresponding name will be forced to run instead. + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Cloud::Scheduler::V1beta1::Job] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::Scheduler::V1beta1::Job] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/scheduler/v1beta1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Scheduler::V1beta1::CloudScheduler::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Scheduler::V1beta1::RunJobRequest.new + # + # # Call the run_job method. + # result = client.run_job request + # + # # The returned object is of type Google::Cloud::Scheduler::V1beta1::Job. + # p result + # + def run_job request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Scheduler::V1beta1::RunJobRequest + + # Converts hash 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.run_job.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::Scheduler::V1beta1::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.run_job.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.run_job.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @cloud_scheduler_stub.run_job 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 CloudScheduler REST API. + # + # This class represents the configuration for CloudScheduler REST, + # providing control over timeouts, retry behavior, logging, transport + # parameters, and other low-level controls. Certain parameters can also be + # applied individually to specific RPCs. See + # {::Google::Cloud::Scheduler::V1beta1::CloudScheduler::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_jobs to 20 seconds, + # # and all remaining timeouts to 10 seconds. + # ::Google::Cloud::Scheduler::V1beta1::CloudScheduler::Rest::Client.configure do |config| + # config.timeout = 10.0 + # config.rpcs.list_jobs.timeout = 20.0 + # end + # + # # Apply the above configuration only to a new client. + # client = ::Google::Cloud::Scheduler::V1beta1::CloudScheduler::Rest::Client.new do |config| + # config.timeout = 10.0 + # config.rpcs.list_jobs.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 = "cloudscheduler.googleapis.com" + + config_attr :endpoint, nil, ::String, nil + config_attr :credentials, nil do |value| + allowed = [::String, ::Hash, ::Proc, ::Symbol, ::Google::Auth::Credentials, ::Google::Auth::BaseClient, ::Signet::OAuth2::Client, nil] + allowed.any? { |klass| klass === value } + end + config_attr :scope, nil, ::String, ::Array, nil + config_attr :lib_name, nil, ::String, nil + config_attr :lib_version, nil, ::String, nil + config_attr :timeout, nil, ::Numeric, nil + config_attr :metadata, nil, ::Hash, nil + config_attr :retry_policy, nil, ::Hash, ::Proc, nil + config_attr :quota_project, nil, ::String, nil + config_attr :universe_domain, nil, ::String, nil + + # @private + # Overrides for http bindings for the RPCs of this service + # are only used when this service is used as mixin, and only + # by the host service. + # @return [::Hash{::Symbol=>::Array<::Gapic::Rest::GrpcTranscoder::HttpBinding>}] + config_attr :bindings_override, {}, ::Hash, nil + config_attr :logger, :default, ::Logger, nil, :default + + # @private + def initialize parent_config = nil + @parent_config = parent_config unless parent_config.nil? + + yield self if block_given? + end + + ## + # Configurations for individual RPCs + # @return [Rpcs] + # + def rpcs + @rpcs ||= begin + parent_rpcs = nil + parent_rpcs = @parent_config.rpcs if defined?(@parent_config) && @parent_config.respond_to?(:rpcs) + Rpcs.new parent_rpcs + end + end + + ## + # Configuration RPC class for the CloudScheduler 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_jobs` + # @return [::Gapic::Config::Method] + # + attr_reader :list_jobs + ## + # RPC-specific configuration for `get_job` + # @return [::Gapic::Config::Method] + # + attr_reader :get_job + ## + # RPC-specific configuration for `create_job` + # @return [::Gapic::Config::Method] + # + attr_reader :create_job + ## + # RPC-specific configuration for `update_job` + # @return [::Gapic::Config::Method] + # + attr_reader :update_job + ## + # RPC-specific configuration for `delete_job` + # @return [::Gapic::Config::Method] + # + attr_reader :delete_job + ## + # RPC-specific configuration for `pause_job` + # @return [::Gapic::Config::Method] + # + attr_reader :pause_job + ## + # RPC-specific configuration for `resume_job` + # @return [::Gapic::Config::Method] + # + attr_reader :resume_job + ## + # RPC-specific configuration for `run_job` + # @return [::Gapic::Config::Method] + # + attr_reader :run_job + + # @private + def initialize parent_rpcs = nil + list_jobs_config = parent_rpcs.list_jobs if parent_rpcs.respond_to? :list_jobs + @list_jobs = ::Gapic::Config::Method.new list_jobs_config + get_job_config = parent_rpcs.get_job if parent_rpcs.respond_to? :get_job + @get_job = ::Gapic::Config::Method.new get_job_config + create_job_config = parent_rpcs.create_job if parent_rpcs.respond_to? :create_job + @create_job = ::Gapic::Config::Method.new create_job_config + update_job_config = parent_rpcs.update_job if parent_rpcs.respond_to? :update_job + @update_job = ::Gapic::Config::Method.new update_job_config + delete_job_config = parent_rpcs.delete_job if parent_rpcs.respond_to? :delete_job + @delete_job = ::Gapic::Config::Method.new delete_job_config + pause_job_config = parent_rpcs.pause_job if parent_rpcs.respond_to? :pause_job + @pause_job = ::Gapic::Config::Method.new pause_job_config + resume_job_config = parent_rpcs.resume_job if parent_rpcs.respond_to? :resume_job + @resume_job = ::Gapic::Config::Method.new resume_job_config + run_job_config = parent_rpcs.run_job if parent_rpcs.respond_to? :run_job + @run_job = ::Gapic::Config::Method.new run_job_config + + yield self if block_given? + end + end + end + end + end + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-scheduler-v1beta1/lib/google/cloud/scheduler/v1beta1/cloud_scheduler/rest/service_stub.rb b/owl-bot-staging/google-cloud-scheduler-v1beta1/lib/google/cloud/scheduler/v1beta1/cloud_scheduler/rest/service_stub.rb new file mode 100644 index 000000000000..0601d73d2008 --- /dev/null +++ b/owl-bot-staging/google-cloud-scheduler-v1beta1/lib/google/cloud/scheduler/v1beta1/cloud_scheduler/rest/service_stub.rb @@ -0,0 +1,574 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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/scheduler/v1beta1/cloudscheduler_pb" + +module Google + module Cloud + module Scheduler + module V1beta1 + module CloudScheduler + module Rest + ## + # REST service stub for the CloudScheduler service. + # Service stub contains baseline method implementations + # including transcoding, making the REST call, and deserialing the response. + # + class ServiceStub + # @private + def initialize endpoint:, endpoint_template:, universe_domain:, credentials:, logger: + # These require statements are intentionally placed here to initialize + # the REST modules only when it's required. + require "gapic/rest" + + @client_stub = ::Gapic::Rest::ClientStub.new endpoint: endpoint, + endpoint_template: endpoint_template, + universe_domain: universe_domain, + credentials: credentials, + numeric_enums: true, + service_name: self.class, + raise_faraday_errors: false, + logger: logger + end + + ## + # The effective universe domain + # + # @return [String] + # + def universe_domain + @client_stub.universe_domain + end + + ## + # The effective endpoint + # + # @return [String] + # + def endpoint + @client_stub.endpoint + end + + ## + # The logger used for request/response debug logging. + # + # @return [Logger] + # + def logger stub: false + stub ? @client_stub.stub_logger : @client_stub.logger + end + + ## + # Baseline implementation for the list_jobs REST call + # + # @param request_pb [::Google::Cloud::Scheduler::V1beta1::ListJobsRequest] + # A request object representing the call parameters. Required. + # @param options [::Gapic::CallOptions] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Cloud::Scheduler::V1beta1::ListJobsResponse] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::Scheduler::V1beta1::ListJobsResponse] + # A result object deserialized from the server's reply + def list_jobs request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_list_jobs_request request_pb + query_string_params = if query_string_params.any? + query_string_params.to_h { |p| p.split "=", 2 } + else + {} + end + + response = @client_stub.make_http_request( + verb, + uri: uri, + body: body || "", + params: query_string_params, + method_name: "list_jobs", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Cloud::Scheduler::V1beta1::ListJobsResponse.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_job REST call + # + # @param request_pb [::Google::Cloud::Scheduler::V1beta1::GetJobRequest] + # A request object representing the call parameters. Required. + # @param options [::Gapic::CallOptions] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Cloud::Scheduler::V1beta1::Job] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::Scheduler::V1beta1::Job] + # A result object deserialized from the server's reply + def get_job request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_get_job_request request_pb + query_string_params = if query_string_params.any? + query_string_params.to_h { |p| p.split "=", 2 } + else + {} + end + + response = @client_stub.make_http_request( + verb, + uri: uri, + body: body || "", + params: query_string_params, + method_name: "get_job", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Cloud::Scheduler::V1beta1::Job.decode_json response.body, ignore_unknown_fields: true + catch :response do + yield result, operation if block_given? + result + end + end + + ## + # Baseline implementation for the create_job REST call + # + # @param request_pb [::Google::Cloud::Scheduler::V1beta1::CreateJobRequest] + # A request object representing the call parameters. Required. + # @param options [::Gapic::CallOptions] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Cloud::Scheduler::V1beta1::Job] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::Scheduler::V1beta1::Job] + # A result object deserialized from the server's reply + def create_job request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_create_job_request request_pb + query_string_params = if query_string_params.any? + query_string_params.to_h { |p| p.split "=", 2 } + else + {} + end + + response = @client_stub.make_http_request( + verb, + uri: uri, + body: body || "", + params: query_string_params, + method_name: "create_job", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Cloud::Scheduler::V1beta1::Job.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_job REST call + # + # @param request_pb [::Google::Cloud::Scheduler::V1beta1::UpdateJobRequest] + # A request object representing the call parameters. Required. + # @param options [::Gapic::CallOptions] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Cloud::Scheduler::V1beta1::Job] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::Scheduler::V1beta1::Job] + # A result object deserialized from the server's reply + def update_job request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_update_job_request request_pb + query_string_params = if query_string_params.any? + query_string_params.to_h { |p| p.split "=", 2 } + else + {} + end + + response = @client_stub.make_http_request( + verb, + uri: uri, + body: body || "", + params: query_string_params, + method_name: "update_job", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Cloud::Scheduler::V1beta1::Job.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_job REST call + # + # @param request_pb [::Google::Cloud::Scheduler::V1beta1::DeleteJobRequest] + # A request object representing the call parameters. Required. + # @param options [::Gapic::CallOptions] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Protobuf::Empty] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Protobuf::Empty] + # A result object deserialized from the server's reply + def delete_job request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_delete_job_request request_pb + query_string_params = if query_string_params.any? + query_string_params.to_h { |p| p.split "=", 2 } + else + {} + end + + response = @client_stub.make_http_request( + verb, + uri: uri, + body: body || "", + params: query_string_params, + method_name: "delete_job", + 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 pause_job REST call + # + # @param request_pb [::Google::Cloud::Scheduler::V1beta1::PauseJobRequest] + # A request object representing the call parameters. Required. + # @param options [::Gapic::CallOptions] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Cloud::Scheduler::V1beta1::Job] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::Scheduler::V1beta1::Job] + # A result object deserialized from the server's reply + def pause_job request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_pause_job_request request_pb + query_string_params = if query_string_params.any? + query_string_params.to_h { |p| p.split "=", 2 } + else + {} + end + + response = @client_stub.make_http_request( + verb, + uri: uri, + body: body || "", + params: query_string_params, + method_name: "pause_job", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Cloud::Scheduler::V1beta1::Job.decode_json response.body, ignore_unknown_fields: true + catch :response do + yield result, operation if block_given? + result + end + end + + ## + # Baseline implementation for the resume_job REST call + # + # @param request_pb [::Google::Cloud::Scheduler::V1beta1::ResumeJobRequest] + # A request object representing the call parameters. Required. + # @param options [::Gapic::CallOptions] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Cloud::Scheduler::V1beta1::Job] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::Scheduler::V1beta1::Job] + # A result object deserialized from the server's reply + def resume_job request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_resume_job_request request_pb + query_string_params = if query_string_params.any? + query_string_params.to_h { |p| p.split "=", 2 } + else + {} + end + + response = @client_stub.make_http_request( + verb, + uri: uri, + body: body || "", + params: query_string_params, + method_name: "resume_job", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Cloud::Scheduler::V1beta1::Job.decode_json response.body, ignore_unknown_fields: true + catch :response do + yield result, operation if block_given? + result + end + end + + ## + # Baseline implementation for the run_job REST call + # + # @param request_pb [::Google::Cloud::Scheduler::V1beta1::RunJobRequest] + # A request object representing the call parameters. Required. + # @param options [::Gapic::CallOptions] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Cloud::Scheduler::V1beta1::Job] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::Scheduler::V1beta1::Job] + # A result object deserialized from the server's reply + def run_job request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_run_job_request request_pb + query_string_params = if query_string_params.any? + query_string_params.to_h { |p| p.split "=", 2 } + else + {} + end + + response = @client_stub.make_http_request( + verb, + uri: uri, + body: body || "", + params: query_string_params, + method_name: "run_job", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Cloud::Scheduler::V1beta1::Job.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_jobs REST call + # + # @param request_pb [::Google::Cloud::Scheduler::V1beta1::ListJobsRequest] + # A request object representing the call parameters. Required. + # @return [Array(String, [String, nil], Hash{String => String})] + # Uri, Body, Query string parameters + def self.transcode_list_jobs_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :get, + uri_template: "/v1beta1/{parent}/jobs", + matches: [ + ["parent", %r{^projects/[^/]+/locations/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the get_job REST call + # + # @param request_pb [::Google::Cloud::Scheduler::V1beta1::GetJobRequest] + # A request object representing the call parameters. Required. + # @return [Array(String, [String, nil], Hash{String => String})] + # Uri, Body, Query string parameters + def self.transcode_get_job_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :get, + uri_template: "/v1beta1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/jobs/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the create_job REST call + # + # @param request_pb [::Google::Cloud::Scheduler::V1beta1::CreateJobRequest] + # A request object representing the call parameters. Required. + # @return [Array(String, [String, nil], Hash{String => String})] + # Uri, Body, Query string parameters + def self.transcode_create_job_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :post, + uri_template: "/v1beta1/{parent}/jobs", + body: "job", + matches: [ + ["parent", %r{^projects/[^/]+/locations/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the update_job REST call + # + # @param request_pb [::Google::Cloud::Scheduler::V1beta1::UpdateJobRequest] + # 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_job_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :patch, + uri_template: "/v1beta1/{job.name}", + body: "job", + matches: [ + ["job.name", %r{^projects/[^/]+/locations/[^/]+/jobs/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the delete_job REST call + # + # @param request_pb [::Google::Cloud::Scheduler::V1beta1::DeleteJobRequest] + # A request object representing the call parameters. Required. + # @return [Array(String, [String, nil], Hash{String => String})] + # Uri, Body, Query string parameters + def self.transcode_delete_job_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :delete, + uri_template: "/v1beta1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/jobs/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the pause_job REST call + # + # @param request_pb [::Google::Cloud::Scheduler::V1beta1::PauseJobRequest] + # A request object representing the call parameters. Required. + # @return [Array(String, [String, nil], Hash{String => String})] + # Uri, Body, Query string parameters + def self.transcode_pause_job_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :post, + uri_template: "/v1beta1/{name}:pause", + body: "*", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/jobs/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the resume_job REST call + # + # @param request_pb [::Google::Cloud::Scheduler::V1beta1::ResumeJobRequest] + # A request object representing the call parameters. Required. + # @return [Array(String, [String, nil], Hash{String => String})] + # Uri, Body, Query string parameters + def self.transcode_resume_job_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :post, + uri_template: "/v1beta1/{name}:resume", + body: "*", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/jobs/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the run_job REST call + # + # @param request_pb [::Google::Cloud::Scheduler::V1beta1::RunJobRequest] + # A request object representing the call parameters. Required. + # @return [Array(String, [String, nil], Hash{String => String})] + # Uri, Body, Query string parameters + def self.transcode_run_job_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :post, + uri_template: "/v1beta1/{name}:run", + body: "*", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/jobs/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + end + end + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-scheduler-v1beta1/lib/google/cloud/scheduler/v1beta1/cloudscheduler_pb.rb b/owl-bot-staging/google-cloud-scheduler-v1beta1/lib/google/cloud/scheduler/v1beta1/cloudscheduler_pb.rb new file mode 100644 index 000000000000..53d54323d798 --- /dev/null +++ b/owl-bot-staging/google-cloud-scheduler-v1beta1/lib/google/cloud/scheduler/v1beta1/cloudscheduler_pb.rb @@ -0,0 +1,37 @@ +# frozen_string_literal: true +# Generated by the protocol buffer compiler. DO NOT EDIT! +# source: google/cloud/scheduler/v1beta1/cloudscheduler.proto + +require 'google/protobuf' + +require 'google/api/annotations_pb' +require 'google/api/client_pb' +require 'google/api/field_behavior_pb' +require 'google/api/resource_pb' +require 'google/cloud/scheduler/v1beta1/job_pb' +require 'google/protobuf/empty_pb' +require 'google/protobuf/field_mask_pb' + + +descriptor_data = "\n3google/cloud/scheduler/v1beta1/cloudscheduler.proto\x12\x1egoogle.cloud.scheduler.v1beta1\x1a\x1cgoogle/api/annotations.proto\x1a\x17google/api/client.proto\x1a\x1fgoogle/api/field_behavior.proto\x1a\x19google/api/resource.proto\x1a(google/cloud/scheduler/v1beta1/job.proto\x1a\x1bgoogle/protobuf/empty.proto\x1a google/protobuf/field_mask.proto\"\xa3\x01\n\x0fListJobsRequest\x12\x39\n\x06parent\x18\x01 \x01(\tB)\xe0\x41\x02\xfa\x41#\x12!cloudscheduler.googleapis.com/Job\x12\x0e\n\x06\x66ilter\x18\x04 \x01(\t\x12\x11\n\tpage_size\x18\x05 \x01(\x05\x12\x12\n\npage_token\x18\x06 \x01(\t\x12\x1e\n\x16legacy_app_engine_cron\x18\x07 \x01(\x08\"^\n\x10ListJobsResponse\x12\x31\n\x04jobs\x18\x01 \x03(\x0b\x32#.google.cloud.scheduler.v1beta1.Job\x12\x17\n\x0fnext_page_token\x18\x02 \x01(\t\"H\n\rGetJobRequest\x12\x37\n\x04name\x18\x01 \x01(\tB)\xe0\x41\x02\xfa\x41#\n!cloudscheduler.googleapis.com/Job\"\x84\x01\n\x10\x43reateJobRequest\x12\x39\n\x06parent\x18\x01 \x01(\tB)\xe0\x41\x02\xfa\x41#\x12!cloudscheduler.googleapis.com/Job\x12\x35\n\x03job\x18\x02 \x01(\x0b\x32#.google.cloud.scheduler.v1beta1.JobB\x03\xe0\x41\x02\"z\n\x10UpdateJobRequest\x12\x35\n\x03job\x18\x01 \x01(\x0b\x32#.google.cloud.scheduler.v1beta1.JobB\x03\xe0\x41\x02\x12/\n\x0bupdate_mask\x18\x02 \x01(\x0b\x32\x1a.google.protobuf.FieldMask\"k\n\x10\x44\x65leteJobRequest\x12\x37\n\x04name\x18\x01 \x01(\tB)\xe0\x41\x02\xfa\x41#\n!cloudscheduler.googleapis.com/Job\x12\x1e\n\x16legacy_app_engine_cron\x18\x02 \x01(\x08\"J\n\x0fPauseJobRequest\x12\x37\n\x04name\x18\x01 \x01(\tB)\xe0\x41\x02\xfa\x41#\n!cloudscheduler.googleapis.com/Job\"K\n\x10ResumeJobRequest\x12\x37\n\x04name\x18\x01 \x01(\tB)\xe0\x41\x02\xfa\x41#\n!cloudscheduler.googleapis.com/Job\"h\n\rRunJobRequest\x12\x37\n\x04name\x18\x01 \x01(\tB)\xe0\x41\x02\xfa\x41#\n!cloudscheduler.googleapis.com/Job\x12\x1e\n\x16legacy_app_engine_cron\x18\x02 \x01(\x08\x32\xa6\x0b\n\x0e\x43loudScheduler\x12\xad\x01\n\x08ListJobs\x12/.google.cloud.scheduler.v1beta1.ListJobsRequest\x1a\x30.google.cloud.scheduler.v1beta1.ListJobsResponse\">\xda\x41\x06parent\x82\xd3\xe4\x93\x02/\x12-/v1beta1/{parent=projects/*/locations/*}/jobs\x12\x9a\x01\n\x06GetJob\x12-.google.cloud.scheduler.v1beta1.GetJobRequest\x1a#.google.cloud.scheduler.v1beta1.Job\"<\xda\x41\x04name\x82\xd3\xe4\x93\x02/\x12-/v1beta1/{name=projects/*/locations/*/jobs/*}\x12\xab\x01\n\tCreateJob\x12\x30.google.cloud.scheduler.v1beta1.CreateJobRequest\x1a#.google.cloud.scheduler.v1beta1.Job\"G\xda\x41\nparent,job\x82\xd3\xe4\x93\x02\x34\"-/v1beta1/{parent=projects/*/locations/*}/jobs:\x03job\x12\xb4\x01\n\tUpdateJob\x12\x30.google.cloud.scheduler.v1beta1.UpdateJobRequest\x1a#.google.cloud.scheduler.v1beta1.Job\"P\xda\x41\x0fjob,update_mask\x82\xd3\xe4\x93\x02\x38\x32\x31/v1beta1/{job.name=projects/*/locations/*/jobs/*}:\x03job\x12\x93\x01\n\tDeleteJob\x12\x30.google.cloud.scheduler.v1beta1.DeleteJobRequest\x1a\x16.google.protobuf.Empty\"<\xda\x41\x04name\x82\xd3\xe4\x93\x02/*-/v1beta1/{name=projects/*/locations/*/jobs/*}\x12\xa7\x01\n\x08PauseJob\x12/.google.cloud.scheduler.v1beta1.PauseJobRequest\x1a#.google.cloud.scheduler.v1beta1.Job\"E\xda\x41\x04name\x82\xd3\xe4\x93\x02\x38\"3/v1beta1/{name=projects/*/locations/*/jobs/*}:pause:\x01*\x12\xaa\x01\n\tResumeJob\x12\x30.google.cloud.scheduler.v1beta1.ResumeJobRequest\x1a#.google.cloud.scheduler.v1beta1.Job\"F\xda\x41\x04name\x82\xd3\xe4\x93\x02\x39\"4/v1beta1/{name=projects/*/locations/*/jobs/*}:resume:\x01*\x12\xa1\x01\n\x06RunJob\x12-.google.cloud.scheduler.v1beta1.RunJobRequest\x1a#.google.cloud.scheduler.v1beta1.Job\"C\xda\x41\x04name\x82\xd3\xe4\x93\x02\x36\"1/v1beta1/{name=projects/*/locations/*/jobs/*}:run:\x01*\x1aQ\xca\x41\x1d\x63loudscheduler.googleapis.com\xd2\x41.https://www.googleapis.com/auth/cloud-platformB\x84\x01\n\"com.google.cloud.scheduler.v1beta1B\x0eSchedulerProtoP\x01Z@cloud.google.com/go/scheduler/apiv1beta1/schedulerpb;schedulerpb\xa2\x02\tSCHEDULERb\x06proto3" + +pool = ::Google::Protobuf::DescriptorPool.generated_pool +pool.add_serialized_file(descriptor_data) + +module Google + module Cloud + module Scheduler + module V1beta1 + ListJobsRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.scheduler.v1beta1.ListJobsRequest").msgclass + ListJobsResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.scheduler.v1beta1.ListJobsResponse").msgclass + GetJobRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.scheduler.v1beta1.GetJobRequest").msgclass + CreateJobRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.scheduler.v1beta1.CreateJobRequest").msgclass + UpdateJobRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.scheduler.v1beta1.UpdateJobRequest").msgclass + DeleteJobRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.scheduler.v1beta1.DeleteJobRequest").msgclass + PauseJobRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.scheduler.v1beta1.PauseJobRequest").msgclass + ResumeJobRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.scheduler.v1beta1.ResumeJobRequest").msgclass + RunJobRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.scheduler.v1beta1.RunJobRequest").msgclass + end + end + end +end diff --git a/owl-bot-staging/google-cloud-scheduler-v1beta1/lib/google/cloud/scheduler/v1beta1/cloudscheduler_services_pb.rb b/owl-bot-staging/google-cloud-scheduler-v1beta1/lib/google/cloud/scheduler/v1beta1/cloudscheduler_services_pb.rb new file mode 100644 index 000000000000..776df3d89d4f --- /dev/null +++ b/owl-bot-staging/google-cloud-scheduler-v1beta1/lib/google/cloud/scheduler/v1beta1/cloudscheduler_services_pb.rb @@ -0,0 +1,92 @@ +# Generated by the protocol buffer compiler. DO NOT EDIT! +# Source: google/cloud/scheduler/v1beta1/cloudscheduler.proto for package 'google.cloud.scheduler.v1beta1' +# Original file comments: +# 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 +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# + +require 'grpc' +require 'google/cloud/scheduler/v1beta1/cloudscheduler_pb' + +module Google + module Cloud + module Scheduler + module V1beta1 + module CloudScheduler + # The Cloud Scheduler API allows external entities to reliably + # schedule asynchronous jobs. + class Service + + include ::GRPC::GenericService + + self.marshal_class_method = :encode + self.unmarshal_class_method = :decode + self.service_name = 'google.cloud.scheduler.v1beta1.CloudScheduler' + + # Lists jobs. + rpc :ListJobs, ::Google::Cloud::Scheduler::V1beta1::ListJobsRequest, ::Google::Cloud::Scheduler::V1beta1::ListJobsResponse + # Gets a job. + rpc :GetJob, ::Google::Cloud::Scheduler::V1beta1::GetJobRequest, ::Google::Cloud::Scheduler::V1beta1::Job + # Creates a job. + rpc :CreateJob, ::Google::Cloud::Scheduler::V1beta1::CreateJobRequest, ::Google::Cloud::Scheduler::V1beta1::Job + # Updates a job. + # + # If successful, the updated [Job][google.cloud.scheduler.v1beta1.Job] is + # returned. If the job does not exist, `NOT_FOUND` is returned. + # + # If UpdateJob does not successfully return, it is possible for the + # job to be in an + # [Job.State.UPDATE_FAILED][google.cloud.scheduler.v1beta1.Job.State.UPDATE_FAILED] + # state. A job in this state may not be executed. If this happens, retry the + # UpdateJob request until a successful response is received. + rpc :UpdateJob, ::Google::Cloud::Scheduler::V1beta1::UpdateJobRequest, ::Google::Cloud::Scheduler::V1beta1::Job + # Deletes a job. + rpc :DeleteJob, ::Google::Cloud::Scheduler::V1beta1::DeleteJobRequest, ::Google::Protobuf::Empty + # Pauses a job. + # + # If a job is paused then the system will stop executing the job + # until it is re-enabled via + # [ResumeJob][google.cloud.scheduler.v1beta1.CloudScheduler.ResumeJob]. The + # state of the job is stored in + # [state][google.cloud.scheduler.v1beta1.Job.state]; if paused it will be set + # to [Job.State.PAUSED][google.cloud.scheduler.v1beta1.Job.State.PAUSED]. A + # job must be in + # [Job.State.ENABLED][google.cloud.scheduler.v1beta1.Job.State.ENABLED] to be + # paused. + rpc :PauseJob, ::Google::Cloud::Scheduler::V1beta1::PauseJobRequest, ::Google::Cloud::Scheduler::V1beta1::Job + # Resume a job. + # + # This method reenables a job after it has been + # [Job.State.PAUSED][google.cloud.scheduler.v1beta1.Job.State.PAUSED]. The + # state of a job is stored in + # [Job.state][google.cloud.scheduler.v1beta1.Job.state]; after calling this + # method it will be set to + # [Job.State.ENABLED][google.cloud.scheduler.v1beta1.Job.State.ENABLED]. A + # job must be in + # [Job.State.PAUSED][google.cloud.scheduler.v1beta1.Job.State.PAUSED] to be + # resumed. + rpc :ResumeJob, ::Google::Cloud::Scheduler::V1beta1::ResumeJobRequest, ::Google::Cloud::Scheduler::V1beta1::Job + # Forces a job to run now. + # + # When this method is called, Cloud Scheduler will dispatch the job, even + # if the job is already running. + rpc :RunJob, ::Google::Cloud::Scheduler::V1beta1::RunJobRequest, ::Google::Cloud::Scheduler::V1beta1::Job + end + + Stub = Service.rpc_stub_class + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-scheduler-v1beta1/lib/google/cloud/scheduler/v1beta1/job_pb.rb b/owl-bot-staging/google-cloud-scheduler-v1beta1/lib/google/cloud/scheduler/v1beta1/job_pb.rb new file mode 100644 index 000000000000..0eafd2e79d09 --- /dev/null +++ b/owl-bot-staging/google-cloud-scheduler-v1beta1/lib/google/cloud/scheduler/v1beta1/job_pb.rb @@ -0,0 +1,30 @@ +# frozen_string_literal: true +# Generated by the protocol buffer compiler. DO NOT EDIT! +# source: google/cloud/scheduler/v1beta1/job.proto + +require 'google/protobuf' + +require 'google/api/field_behavior_pb' +require 'google/api/resource_pb' +require 'google/cloud/scheduler/v1beta1/target_pb' +require 'google/protobuf/duration_pb' +require 'google/protobuf/timestamp_pb' +require 'google/rpc/status_pb' + + +descriptor_data = "\n(google/cloud/scheduler/v1beta1/job.proto\x12\x1egoogle.cloud.scheduler.v1beta1\x1a\x1fgoogle/api/field_behavior.proto\x1a\x19google/api/resource.proto\x1a+google/cloud/scheduler/v1beta1/target.proto\x1a\x1egoogle/protobuf/duration.proto\x1a\x1fgoogle/protobuf/timestamp.proto\x1a\x17google/rpc/status.proto\"\x89\x07\n\x03Job\x12\x0c\n\x04name\x18\x01 \x01(\t\x12\x13\n\x0b\x64\x65scription\x18\x02 \x01(\t\x12\x45\n\rpubsub_target\x18\x04 \x01(\x0b\x32,.google.cloud.scheduler.v1beta1.PubsubTargetH\x00\x12U\n\x16\x61pp_engine_http_target\x18\x05 \x01(\x0b\x32\x33.google.cloud.scheduler.v1beta1.AppEngineHttpTargetH\x00\x12\x41\n\x0bhttp_target\x18\x06 \x01(\x0b\x32*.google.cloud.scheduler.v1beta1.HttpTargetH\x00\x12\x10\n\x08schedule\x18\x14 \x01(\t\x12\x11\n\ttime_zone\x18\x15 \x01(\t\x12\x34\n\x10user_update_time\x18\t \x01(\x0b\x32\x1a.google.protobuf.Timestamp\x12\x38\n\x05state\x18\n \x01(\x0e\x32).google.cloud.scheduler.v1beta1.Job.State\x12\"\n\x06status\x18\x0b \x01(\x0b\x32\x12.google.rpc.Status\x12\x31\n\rschedule_time\x18\x11 \x01(\x0b\x32\x1a.google.protobuf.Timestamp\x12\x35\n\x11last_attempt_time\x18\x12 \x01(\x0b\x32\x1a.google.protobuf.Timestamp\x12\x41\n\x0cretry_config\x18\x13 \x01(\x0b\x32+.google.cloud.scheduler.v1beta1.RetryConfig\x12\x33\n\x10\x61ttempt_deadline\x18\x16 \x01(\x0b\x32\x19.google.protobuf.Duration\x12#\n\x16legacy_app_engine_cron\x18\x17 \x01(\x08\x42\x03\xe0\x41\x05\"X\n\x05State\x12\x15\n\x11STATE_UNSPECIFIED\x10\x00\x12\x0b\n\x07\x45NABLED\x10\x01\x12\n\n\x06PAUSED\x10\x02\x12\x0c\n\x08\x44ISABLED\x10\x03\x12\x11\n\rUPDATE_FAILED\x10\x04:Z\xea\x41W\n!cloudscheduler.googleapis.com/Job\x12\x32projects/{project}/locations/{location}/jobs/{job}B\x08\n\x06target\"\xe2\x01\n\x0bRetryConfig\x12\x13\n\x0bretry_count\x18\x01 \x01(\x05\x12\x35\n\x12max_retry_duration\x18\x02 \x01(\x0b\x32\x19.google.protobuf.Duration\x12\x37\n\x14min_backoff_duration\x18\x03 \x01(\x0b\x32\x19.google.protobuf.Duration\x12\x37\n\x14max_backoff_duration\x18\x04 \x01(\x0b\x32\x19.google.protobuf.Duration\x12\x15\n\rmax_doublings\x18\x05 \x01(\x05\x42r\n\"com.google.cloud.scheduler.v1beta1B\x08JobProtoP\x01Z@cloud.google.com/go/scheduler/apiv1beta1/schedulerpb;schedulerpbb\x06proto3" + +pool = ::Google::Protobuf::DescriptorPool.generated_pool +pool.add_serialized_file(descriptor_data) + +module Google + module Cloud + module Scheduler + module V1beta1 + Job = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.scheduler.v1beta1.Job").msgclass + Job::State = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.scheduler.v1beta1.Job.State").enummodule + RetryConfig = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.scheduler.v1beta1.RetryConfig").msgclass + end + end + end +end diff --git a/owl-bot-staging/google-cloud-scheduler-v1beta1/lib/google/cloud/scheduler/v1beta1/rest.rb b/owl-bot-staging/google-cloud-scheduler-v1beta1/lib/google/cloud/scheduler/v1beta1/rest.rb new file mode 100644 index 000000000000..70df3be7ef52 --- /dev/null +++ b/owl-bot-staging/google-cloud-scheduler-v1beta1/lib/google/cloud/scheduler/v1beta1/rest.rb @@ -0,0 +1,38 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +require "google/cloud/scheduler/v1beta1/cloud_scheduler/rest" +require "google/cloud/scheduler/v1beta1/bindings_override" +require "google/cloud/scheduler/v1beta1/version" + +module Google + module Cloud + module Scheduler + ## + # To load just the REST part of this package, including all its services, and instantiate a REST client: + # + # @example + # + # require "google/cloud/scheduler/v1beta1/rest" + # client = ::Google::Cloud::Scheduler::V1beta1::CloudScheduler::Rest::Client.new + # + module V1beta1 + end + end + end +end diff --git a/owl-bot-staging/google-cloud-scheduler-v1beta1/lib/google/cloud/scheduler/v1beta1/target_pb.rb b/owl-bot-staging/google-cloud-scheduler-v1beta1/lib/google/cloud/scheduler/v1beta1/target_pb.rb new file mode 100644 index 000000000000..35e628e0c5e1 --- /dev/null +++ b/owl-bot-staging/google-cloud-scheduler-v1beta1/lib/google/cloud/scheduler/v1beta1/target_pb.rb @@ -0,0 +1,29 @@ +# frozen_string_literal: true +# Generated by the protocol buffer compiler. DO NOT EDIT! +# source: google/cloud/scheduler/v1beta1/target.proto + +require 'google/protobuf' + +require 'google/api/resource_pb' + + +descriptor_data = "\n+google/cloud/scheduler/v1beta1/target.proto\x12\x1egoogle.cloud.scheduler.v1beta1\x1a\x19google/api/resource.proto\"\xfe\x02\n\nHttpTarget\x12\x0b\n\x03uri\x18\x01 \x01(\t\x12?\n\x0bhttp_method\x18\x02 \x01(\x0e\x32*.google.cloud.scheduler.v1beta1.HttpMethod\x12H\n\x07headers\x18\x03 \x03(\x0b\x32\x37.google.cloud.scheduler.v1beta1.HttpTarget.HeadersEntry\x12\x0c\n\x04\x62ody\x18\x04 \x01(\x0c\x12\x41\n\x0boauth_token\x18\x05 \x01(\x0b\x32*.google.cloud.scheduler.v1beta1.OAuthTokenH\x00\x12?\n\noidc_token\x18\x06 \x01(\x0b\x32).google.cloud.scheduler.v1beta1.OidcTokenH\x00\x1a.\n\x0cHeadersEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12\r\n\x05value\x18\x02 \x01(\t:\x02\x38\x01\x42\x16\n\x14\x61uthorization_header\"\xcb\x02\n\x13\x41ppEngineHttpTarget\x12?\n\x0bhttp_method\x18\x01 \x01(\x0e\x32*.google.cloud.scheduler.v1beta1.HttpMethod\x12L\n\x12\x61pp_engine_routing\x18\x02 \x01(\x0b\x32\x30.google.cloud.scheduler.v1beta1.AppEngineRouting\x12\x14\n\x0crelative_uri\x18\x03 \x01(\t\x12Q\n\x07headers\x18\x04 \x03(\x0b\x32@.google.cloud.scheduler.v1beta1.AppEngineHttpTarget.HeadersEntry\x12\x0c\n\x04\x62ody\x18\x05 \x01(\x0c\x1a.\n\x0cHeadersEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12\r\n\x05value\x18\x02 \x01(\t:\x02\x38\x01\"\xd7\x01\n\x0cPubsubTarget\x12\x34\n\ntopic_name\x18\x01 \x01(\tB \xfa\x41\x1d\n\x1bpubsub.googleapis.com/Topic\x12\x0c\n\x04\x64\x61ta\x18\x03 \x01(\x0c\x12P\n\nattributes\x18\x04 \x03(\x0b\x32<.google.cloud.scheduler.v1beta1.PubsubTarget.AttributesEntry\x1a\x31\n\x0f\x41ttributesEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12\r\n\x05value\x18\x02 \x01(\t:\x02\x38\x01\"T\n\x10\x41ppEngineRouting\x12\x0f\n\x07service\x18\x01 \x01(\t\x12\x0f\n\x07version\x18\x02 \x01(\t\x12\x10\n\x08instance\x18\x03 \x01(\t\x12\x0c\n\x04host\x18\x04 \x01(\t\":\n\nOAuthToken\x12\x1d\n\x15service_account_email\x18\x01 \x01(\t\x12\r\n\x05scope\x18\x02 \x01(\t\"<\n\tOidcToken\x12\x1d\n\x15service_account_email\x18\x01 \x01(\t\x12\x10\n\x08\x61udience\x18\x02 \x01(\t*s\n\nHttpMethod\x12\x1b\n\x17HTTP_METHOD_UNSPECIFIED\x10\x00\x12\x08\n\x04POST\x10\x01\x12\x07\n\x03GET\x10\x02\x12\x08\n\x04HEAD\x10\x03\x12\x07\n\x03PUT\x10\x04\x12\n\n\x06\x44\x45LETE\x10\x05\x12\t\n\x05PATCH\x10\x06\x12\x0b\n\x07OPTIONS\x10\x07\x42\xb8\x01\n\"com.google.cloud.scheduler.v1beta1B\x0bTargetProtoP\x01Z@cloud.google.com/go/scheduler/apiv1beta1/schedulerpb;schedulerpb\xea\x41@\n\x1bpubsub.googleapis.com/Topic\x12!projects/{project}/topics/{topic}b\x06proto3" + +pool = ::Google::Protobuf::DescriptorPool.generated_pool +pool.add_serialized_file(descriptor_data) + +module Google + module Cloud + module Scheduler + module V1beta1 + HttpTarget = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.scheduler.v1beta1.HttpTarget").msgclass + AppEngineHttpTarget = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.scheduler.v1beta1.AppEngineHttpTarget").msgclass + PubsubTarget = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.scheduler.v1beta1.PubsubTarget").msgclass + AppEngineRouting = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.scheduler.v1beta1.AppEngineRouting").msgclass + OAuthToken = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.scheduler.v1beta1.OAuthToken").msgclass + OidcToken = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.scheduler.v1beta1.OidcToken").msgclass + HttpMethod = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.scheduler.v1beta1.HttpMethod").enummodule + end + end + end +end diff --git a/owl-bot-staging/google-cloud-scheduler-v1beta1/lib/google/cloud/scheduler/v1beta1/version.rb b/owl-bot-staging/google-cloud-scheduler-v1beta1/lib/google/cloud/scheduler/v1beta1/version.rb new file mode 100644 index 000000000000..77a010d3732f --- /dev/null +++ b/owl-bot-staging/google-cloud-scheduler-v1beta1/lib/google/cloud/scheduler/v1beta1/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 Scheduler + module V1beta1 + VERSION = "0.0.1" + end + end + end +end diff --git a/owl-bot-staging/google-cloud-scheduler-v1beta1/proto_docs/README.md b/owl-bot-staging/google-cloud-scheduler-v1beta1/proto_docs/README.md new file mode 100644 index 000000000000..f0fc6932b5fd --- /dev/null +++ b/owl-bot-staging/google-cloud-scheduler-v1beta1/proto_docs/README.md @@ -0,0 +1,4 @@ +# Cloud Scheduler V1beta1 Protocol Buffer Documentation + +These files are for the YARD documentation of the generated protobuf files. +They are not intended to be required or loaded at runtime. diff --git a/owl-bot-staging/google-cloud-scheduler-v1beta1/proto_docs/google/api/client.rb b/owl-bot-staging/google-cloud-scheduler-v1beta1/proto_docs/google/api/client.rb new file mode 100644 index 000000000000..5089551e9ea4 --- /dev/null +++ b/owl-bot-staging/google-cloud-scheduler-v1beta1/proto_docs/google/api/client.rb @@ -0,0 +1,589 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + + +module Google + module Api + # Required information for every language. + # @!attribute [rw] reference_docs_uri + # @deprecated This field is deprecated and may be removed in the next major version update. + # @return [::String] + # Link to automatically generated reference documentation. Example: + # https://cloud.google.com/nodejs/docs/reference/asset/latest + # @!attribute [rw] destinations + # @return [::Array<::Google::Api::ClientLibraryDestination>] + # The destination where API teams want this client library to be published. + # @!attribute [rw] selective_gapic_generation + # @return [::Google::Api::SelectiveGapicGeneration] + # Configuration for which RPCs should be generated in the GAPIC client. + class CommonLanguageSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Details about how and where to publish client libraries. + # @!attribute [rw] version + # @return [::String] + # Version of the API to apply these settings to. This is the full protobuf + # package for the API, ending in the version element. + # Examples: "google.cloud.speech.v1" and "google.spanner.admin.database.v1". + # @!attribute [rw] launch_stage + # @return [::Google::Api::LaunchStage] + # Launch stage of this version of the API. + # @!attribute [rw] rest_numeric_enums + # @return [::Boolean] + # When using transport=rest, the client request will encode enums as + # numbers rather than strings. + # @!attribute [rw] java_settings + # @return [::Google::Api::JavaSettings] + # Settings for legacy Java features, supported in the Service YAML. + # @!attribute [rw] cpp_settings + # @return [::Google::Api::CppSettings] + # Settings for C++ client libraries. + # @!attribute [rw] php_settings + # @return [::Google::Api::PhpSettings] + # Settings for PHP client libraries. + # @!attribute [rw] python_settings + # @return [::Google::Api::PythonSettings] + # Settings for Python client libraries. + # @!attribute [rw] node_settings + # @return [::Google::Api::NodeSettings] + # Settings for Node client libraries. + # @!attribute [rw] dotnet_settings + # @return [::Google::Api::DotnetSettings] + # Settings for .NET client libraries. + # @!attribute [rw] ruby_settings + # @return [::Google::Api::RubySettings] + # Settings for Ruby client libraries. + # @!attribute [rw] go_settings + # @return [::Google::Api::GoSettings] + # Settings for Go client libraries. + class ClientLibrarySettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # This message configures the settings for publishing [Google Cloud Client + # libraries](https://cloud.google.com/apis/docs/cloud-client-libraries) + # generated from the service config. + # @!attribute [rw] method_settings + # @return [::Array<::Google::Api::MethodSettings>] + # A list of API method settings, e.g. the behavior for methods that use the + # long-running operation pattern. + # @!attribute [rw] new_issue_uri + # @return [::String] + # Link to a *public* URI where users can report issues. Example: + # https://issuetracker.google.com/issues/new?component=190865&template=1161103 + # @!attribute [rw] documentation_uri + # @return [::String] + # Link to product home page. Example: + # https://cloud.google.com/asset-inventory/docs/overview + # @!attribute [rw] api_short_name + # @return [::String] + # Used as a tracking tag when collecting data about the APIs developer + # relations artifacts like docs, packages delivered to package managers, + # etc. Example: "speech". + # @!attribute [rw] github_label + # @return [::String] + # GitHub label to apply to issues and pull requests opened for this API. + # @!attribute [rw] codeowner_github_teams + # @return [::Array<::String>] + # GitHub teams to be added to CODEOWNERS in the directory in GitHub + # containing source code for the client libraries for this API. + # @!attribute [rw] doc_tag_prefix + # @return [::String] + # A prefix used in sample code when demarking regions to be included in + # documentation. + # @!attribute [rw] organization + # @return [::Google::Api::ClientLibraryOrganization] + # For whom the client library is being published. + # @!attribute [rw] library_settings + # @return [::Array<::Google::Api::ClientLibrarySettings>] + # Client library settings. If the same version string appears multiple + # times in this list, then the last one wins. Settings from earlier + # settings with the same version string are discarded. + # @!attribute [rw] proto_reference_documentation_uri + # @return [::String] + # Optional link to proto reference documentation. Example: + # https://cloud.google.com/pubsub/lite/docs/reference/rpc + # @!attribute [rw] rest_reference_documentation_uri + # @return [::String] + # Optional link to REST reference documentation. Example: + # https://cloud.google.com/pubsub/lite/docs/reference/rest + class Publishing + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Settings for Java client libraries. + # @!attribute [rw] library_package + # @return [::String] + # The package name to use in Java. Clobbers the java_package option + # set in the protobuf. This should be used **only** by APIs + # who have already set the language_settings.java.package_name" field + # in gapic.yaml. API teams should use the protobuf java_package option + # where possible. + # + # Example of a YAML configuration:: + # + # publishing: + # 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. + # @!attribute [rw] methods + # @return [::Array<::String>] + # An allowlist of the fully qualified names of RPCs that should be included + # on public client surfaces. + # @!attribute [rw] generate_omitted_as_internal + # @return [::Boolean] + # Setting this to true indicates to the client generators that methods + # that would be excluded from the generation should instead be generated + # in a way that indicates these methods should not be consumed by + # end users. How this is expressed is up to individual language + # implementations to decide. Some examples may be: added annotations, + # obfuscated identifiers, or other language idiomatic patterns. + class SelectiveGapicGeneration + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # `BatchingConfigProto` defines the batching configuration for an API method. + # @!attribute [rw] thresholds + # @return [::Google::Api::BatchingSettingsProto] + # The thresholds which trigger a batched request to be sent. + # @!attribute [rw] batch_descriptor + # @return [::Google::Api::BatchingDescriptorProto] + # The request and response fields used in batching. + class BatchingConfigProto + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # `BatchingSettingsProto` specifies a set of batching thresholds, each of + # which acts as a trigger to send a batch of messages as a request. At least + # one threshold must be positive nonzero. + # @!attribute [rw] element_count_threshold + # @return [::Integer] + # The number of elements of a field collected into a batch which, if + # exceeded, causes the batch to be sent. + # @!attribute [rw] request_byte_threshold + # @return [::Integer] + # The aggregated size of the batched field which, if exceeded, causes the + # batch to be sent. This size is computed by aggregating the sizes of the + # request field to be batched, not of the entire request message. + # @!attribute [rw] delay_threshold + # @return [::Google::Protobuf::Duration] + # The duration after which a batch should be sent, starting from the addition + # of the first message to that batch. + # @!attribute [rw] element_count_limit + # @return [::Integer] + # The maximum number of elements collected in a batch that could be accepted + # by server. + # @!attribute [rw] request_byte_limit + # @return [::Integer] + # The maximum size of the request that could be accepted by server. + # @!attribute [rw] flow_control_element_limit + # @return [::Integer] + # The maximum number of elements allowed by flow control. + # @!attribute [rw] flow_control_byte_limit + # @return [::Integer] + # The maximum size of data allowed by flow control. + # @!attribute [rw] flow_control_limit_exceeded_behavior + # @return [::Google::Api::FlowControlLimitExceededBehaviorProto] + # The behavior to take when the flow control limit is exceeded. + class BatchingSettingsProto + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # `BatchingDescriptorProto` specifies the fields of the request message to be + # used for batching, and, optionally, the fields of the response message to be + # used for demultiplexing. + # @!attribute [rw] batched_field + # @return [::String] + # The repeated field in the request message to be aggregated by batching. + # @!attribute [rw] discriminator_fields + # @return [::Array<::String>] + # A list of the fields in the request message. Two requests will be batched + # together only if the values of every field specified in + # `request_discriminator_fields` is equal between the two requests. + # @!attribute [rw] subresponse_field + # @return [::String] + # Optional. When present, indicates the field in the response message to be + # used to demultiplex the response into multiple response messages, in + # correspondence with the multiple request messages originally batched + # together. + class BatchingDescriptorProto + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # The organization for which the client libraries are being published. + # Affects the url where generated docs are published, etc. + module ClientLibraryOrganization + # Not useful. + CLIENT_LIBRARY_ORGANIZATION_UNSPECIFIED = 0 + + # Google Cloud Platform Org. + CLOUD = 1 + + # Ads (Advertising) Org. + ADS = 2 + + # Photos Org. + PHOTOS = 3 + + # Street View Org. + STREET_VIEW = 4 + + # Shopping Org. + SHOPPING = 5 + + # Geo Org. + GEO = 6 + + # Generative AI - https://developers.generativeai.google + GENERATIVE_AI = 7 + end + + # To where should client libraries be published? + module ClientLibraryDestination + # Client libraries will neither be generated nor published to package + # managers. + CLIENT_LIBRARY_DESTINATION_UNSPECIFIED = 0 + + # Generate the client library in a repo under github.com/googleapis, + # but don't publish it to package managers. + GITHUB = 10 + + # Publish the library to package managers like nuget.org and npmjs.com. + PACKAGE_MANAGER = 20 + end + + # The behavior to take when the flow control limit is exceeded. + module FlowControlLimitExceededBehaviorProto + # Default behavior, system-defined. + UNSET_BEHAVIOR = 0 + + # Stop operation, raise error. + THROW_EXCEPTION = 1 + + # Pause operation until limit clears. + BLOCK = 2 + + # Continue operation, disregard limit. + IGNORE = 3 + end + end +end diff --git a/owl-bot-staging/google-cloud-scheduler-v1beta1/proto_docs/google/api/field_behavior.rb b/owl-bot-staging/google-cloud-scheduler-v1beta1/proto_docs/google/api/field_behavior.rb new file mode 100644 index 000000000000..582be187d115 --- /dev/null +++ b/owl-bot-staging/google-cloud-scheduler-v1beta1/proto_docs/google/api/field_behavior.rb @@ -0,0 +1,85 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + + +module Google + module Api + # An indicator of the behavior of a given field (for example, that a field + # is required in requests, or given as output but ignored as input). + # This **does not** change the behavior in protocol buffers itself; it only + # denotes the behavior and may affect how API tooling handles the field. + # + # Note: This enum **may** receive new values in the future. + module FieldBehavior + # Conventional default for enums. Do not use this. + FIELD_BEHAVIOR_UNSPECIFIED = 0 + + # Specifically denotes a field as optional. + # While all fields in protocol buffers are optional, this may be specified + # for emphasis if appropriate. + OPTIONAL = 1 + + # Denotes a field as required. + # This indicates that the field **must** be provided as part of the request, + # and failure to do so will cause an error (usually `INVALID_ARGUMENT`). + REQUIRED = 2 + + # Denotes a field as output only. + # This indicates that the field is provided in responses, but including the + # field in a request does nothing (the server *must* ignore it and + # *must not* throw an error as a result of the field's presence). + OUTPUT_ONLY = 3 + + # Denotes a field as input only. + # This indicates that the field is provided in requests, and the + # corresponding field is not included in output. + INPUT_ONLY = 4 + + # Denotes a field as immutable. + # This indicates that the field may be set once in a request to create a + # resource, but may not be changed thereafter. + IMMUTABLE = 5 + + # Denotes that a (repeated) field is an unordered list. + # This indicates that the service may provide the elements of the list + # in any arbitrary order, rather than the order the user originally + # provided. Additionally, the list's order may or may not be stable. + UNORDERED_LIST = 6 + + # Denotes that this field returns a non-empty default value if not set. + # This indicates that if the user provides the empty value in a request, + # a non-empty value will be returned. The user will not be aware of what + # non-empty value to expect. + NON_EMPTY_DEFAULT = 7 + + # Denotes that the field in a resource (a message annotated with + # google.api.resource) is used in the resource name to uniquely identify the + # resource. For AIP-compliant APIs, this should only be applied to the + # `name` field on the resource. + # + # This behavior should not be applied to references to other resources within + # the message. + # + # The identifier field of resources often have different field behavior + # depending on the request it is embedded in (e.g. for Create methods name + # is optional and unused, while for Update methods it is required). Instead + # of method-specific annotations, only `IDENTIFIER` is required. + IDENTIFIER = 8 + end + end +end diff --git a/owl-bot-staging/google-cloud-scheduler-v1beta1/proto_docs/google/api/launch_stage.rb b/owl-bot-staging/google-cloud-scheduler-v1beta1/proto_docs/google/api/launch_stage.rb new file mode 100644 index 000000000000..9392a413fb1b --- /dev/null +++ b/owl-bot-staging/google-cloud-scheduler-v1beta1/proto_docs/google/api/launch_stage.rb @@ -0,0 +1,71 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + + +module Google + module Api + # The launch stage as defined by [Google Cloud Platform + # Launch Stages](https://cloud.google.com/terms/launch-stages). + module LaunchStage + # Do not use this default value. + LAUNCH_STAGE_UNSPECIFIED = 0 + + # The feature is not yet implemented. Users can not use it. + UNIMPLEMENTED = 6 + + # Prelaunch features are hidden from users and are only visible internally. + PRELAUNCH = 7 + + # Early Access features are limited to a closed group of testers. To use + # these features, you must sign up in advance and sign a Trusted Tester + # agreement (which includes confidentiality provisions). These features may + # be unstable, changed in backward-incompatible ways, and are not + # guaranteed to be released. + EARLY_ACCESS = 1 + + # Alpha is a limited availability test for releases before they are cleared + # for widespread use. By Alpha, all significant design issues are resolved + # and we are in the process of verifying functionality. Alpha customers + # need to apply for access, agree to applicable terms, and have their + # projects allowlisted. Alpha releases don't have to be feature complete, + # no SLAs are provided, and there are no technical support obligations, but + # they will be far enough along that customers can actually use them in + # test environments or for limited-use tests -- just like they would in + # normal production cases. + ALPHA = 2 + + # Beta is the point at which we are ready to open a release for any + # customer to use. There are no SLA or technical support obligations in a + # Beta release. Products will be complete from a feature perspective, but + # may have some open outstanding issues. Beta releases are suitable for + # limited production use cases. + BETA = 3 + + # GA features are open to all developers and are considered stable and + # fully qualified for production use. + GA = 4 + + # Deprecated features are scheduled to be shut down and removed. For more + # information, see the "Deprecation Policy" section of our [Terms of + # Service](https://cloud.google.com/terms/) + # and the [Google Cloud Platform Subject to the Deprecation + # Policy](https://cloud.google.com/terms/deprecation) documentation. + DEPRECATED = 5 + end + end +end diff --git a/owl-bot-staging/google-cloud-scheduler-v1beta1/proto_docs/google/api/resource.rb b/owl-bot-staging/google-cloud-scheduler-v1beta1/proto_docs/google/api/resource.rb new file mode 100644 index 000000000000..25dec4847ac1 --- /dev/null +++ b/owl-bot-staging/google-cloud-scheduler-v1beta1/proto_docs/google/api/resource.rb @@ -0,0 +1,227 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + + +module Google + module Api + # A simple descriptor of a resource type. + # + # ResourceDescriptor annotates a resource message (either by means of a + # protobuf annotation or use in the service config), and associates the + # resource's schema, the resource type, and the pattern of the resource name. + # + # Example: + # + # message Topic { + # // Indicates this message defines a resource schema. + # // Declares the resource type in the format of {service}/{kind}. + # // For Kubernetes resources, the format is {api group}/{kind}. + # option (google.api.resource) = { + # type: "pubsub.googleapis.com/Topic" + # pattern: "projects/{project}/topics/{topic}" + # }; + # } + # + # The ResourceDescriptor Yaml config will look like: + # + # resources: + # - type: "pubsub.googleapis.com/Topic" + # pattern: "projects/{project}/topics/{topic}" + # + # Sometimes, resources have multiple patterns, typically because they can + # live under multiple parents. + # + # Example: + # + # message LogEntry { + # option (google.api.resource) = { + # type: "logging.googleapis.com/LogEntry" + # pattern: "projects/{project}/logs/{log}" + # pattern: "folders/{folder}/logs/{log}" + # pattern: "organizations/{organization}/logs/{log}" + # pattern: "billingAccounts/{billing_account}/logs/{log}" + # }; + # } + # + # The ResourceDescriptor Yaml config will look like: + # + # resources: + # - type: 'logging.googleapis.com/LogEntry' + # pattern: "projects/{project}/logs/{log}" + # pattern: "folders/{folder}/logs/{log}" + # pattern: "organizations/{organization}/logs/{log}" + # pattern: "billingAccounts/{billing_account}/logs/{log}" + # @!attribute [rw] type + # @return [::String] + # The resource type. It must be in the format of + # \\{service_name}/\\{resource_type_kind}. The `resource_type_kind` must be + # singular and must not include version numbers. + # + # Example: `storage.googleapis.com/Bucket` + # + # The value of the resource_type_kind must follow the regular expression + # /[A-Za-z][a-zA-Z0-9]+/. It should start with an upper case character and + # should use PascalCase (UpperCamelCase). The maximum number of + # characters allowed for the `resource_type_kind` is 100. + # @!attribute [rw] pattern + # @return [::Array<::String>] + # Optional. The relative resource name pattern associated with this resource + # type. The DNS prefix of the full resource name shouldn't be specified here. + # + # The path pattern must follow the syntax, which aligns with HTTP binding + # syntax: + # + # Template = Segment { "/" Segment } ; + # Segment = LITERAL | Variable ; + # Variable = "{" LITERAL "}" ; + # + # Examples: + # + # - "projects/\\{project}/topics/\\{topic}" + # - "projects/\\{project}/knowledgeBases/\\{knowledge_base}" + # + # The components in braces correspond to the IDs for each resource in the + # hierarchy. It is expected that, if multiple patterns are provided, + # the same component name (e.g. "project") refers to IDs of the same + # type of resource. + # @!attribute [rw] name_field + # @return [::String] + # Optional. The field on the resource that designates the resource name + # field. If omitted, this is assumed to be "name". + # @!attribute [rw] history + # @return [::Google::Api::ResourceDescriptor::History] + # Optional. The historical or future-looking state of the resource pattern. + # + # Example: + # + # // The InspectTemplate message originally only supported resource + # // names with organization, and project was added later. + # message InspectTemplate { + # option (google.api.resource) = { + # type: "dlp.googleapis.com/InspectTemplate" + # pattern: + # "organizations/{organization}/inspectTemplates/{inspect_template}" + # pattern: "projects/{project}/inspectTemplates/{inspect_template}" + # history: ORIGINALLY_SINGLE_PATTERN + # }; + # } + # @!attribute [rw] plural + # @return [::String] + # The plural name used in the resource name and permission names, such as + # 'projects' for the resource name of 'projects/\\{project}' and the permission + # name of 'cloudresourcemanager.googleapis.com/projects.get'. One exception + # to this is for Nested Collections that have stuttering names, as defined + # in [AIP-122](https://google.aip.dev/122#nested-collections), where the + # collection ID in the resource name pattern does not necessarily directly + # match the `plural` value. + # + # It is the same concept of the `plural` field in k8s CRD spec + # https://kubernetes.io/docs/tasks/access-kubernetes-api/custom-resources/custom-resource-definitions/ + # + # Note: The plural form is required even for singleton resources. See + # https://aip.dev/156 + # @!attribute [rw] singular + # @return [::String] + # The same concept of the `singular` field in k8s CRD spec + # https://kubernetes.io/docs/tasks/access-kubernetes-api/custom-resources/custom-resource-definitions/ + # Such as "project" for the `resourcemanager.googleapis.com/Project` type. + # @!attribute [rw] style + # @return [::Array<::Google::Api::ResourceDescriptor::Style>] + # Style flag(s) for this resource. + # These indicate that a resource is expected to conform to a given + # style. See the specific style flags for additional information. + class ResourceDescriptor + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # A description of the historical or future-looking state of the + # resource pattern. + module History + # The "unset" value. + HISTORY_UNSPECIFIED = 0 + + # The resource originally had one pattern and launched as such, and + # additional patterns were added later. + ORIGINALLY_SINGLE_PATTERN = 1 + + # The resource has one pattern, but the API owner expects to add more + # later. (This is the inverse of ORIGINALLY_SINGLE_PATTERN, and prevents + # that from being necessary once there are multiple patterns.) + FUTURE_MULTI_PATTERN = 2 + end + + # A flag representing a specific style that a resource claims to conform to. + module Style + # The unspecified value. Do not use. + STYLE_UNSPECIFIED = 0 + + # This resource is intended to be "declarative-friendly". + # + # Declarative-friendly resources must be more strictly consistent, and + # setting this to true communicates to tools that this resource should + # adhere to declarative-friendly expectations. + # + # Note: This is used by the API linter (linter.aip.dev) to enable + # additional checks. + DECLARATIVE_FRIENDLY = 1 + end + end + + # Defines a proto annotation that describes a string field that refers to + # an API resource. + # @!attribute [rw] type + # @return [::String] + # The resource type that the annotated field references. + # + # Example: + # + # message Subscription { + # string topic = 2 [(google.api.resource_reference) = { + # type: "pubsub.googleapis.com/Topic" + # }]; + # } + # + # Occasionally, a field may reference an arbitrary resource. In this case, + # APIs use the special value * in their resource reference. + # + # Example: + # + # message GetIamPolicyRequest { + # string resource = 2 [(google.api.resource_reference) = { + # type: "*" + # }]; + # } + # @!attribute [rw] child_type + # @return [::String] + # The resource type of a child collection that the annotated field + # references. This is useful for annotating the `parent` field that + # doesn't have a fixed resource type. + # + # Example: + # + # message ListLogEntriesRequest { + # string parent = 1 [(google.api.resource_reference) = { + # child_type: "logging.googleapis.com/LogEntry" + # }; + # } + class ResourceReference + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end +end diff --git a/owl-bot-staging/google-cloud-scheduler-v1beta1/proto_docs/google/cloud/scheduler/v1beta1/cloudscheduler.rb b/owl-bot-staging/google-cloud-scheduler-v1beta1/proto_docs/google/cloud/scheduler/v1beta1/cloudscheduler.rb new file mode 100644 index 000000000000..7265aa876409 --- /dev/null +++ b/owl-bot-staging/google-cloud-scheduler-v1beta1/proto_docs/google/cloud/scheduler/v1beta1/cloudscheduler.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 Cloud + module Scheduler + module V1beta1 + # Request message for listing jobs using + # {::Google::Cloud::Scheduler::V1beta1::CloudScheduler::Client#list_jobs ListJobs}. + # @!attribute [rw] parent + # @return [::String] + # Required. The location name. For example: + # `projects/PROJECT_ID/locations/LOCATION_ID`. + # @!attribute [rw] filter + # @return [::String] + # `filter` can be used to specify a subset of jobs. + # + # If `filter` equals `target_config="HttpConfig"`, then the http + # target jobs are retrieved. If `filter` equals + # `target_config="PubSubConfig"`, then the Pub/Sub target jobs are + # retrieved. If `filter` equals `labels.foo=value1 + # labels.foo=value2` then only jobs which are labeled with + # foo=value1 AND foo=value2 will be returned. + # @!attribute [rw] page_size + # @return [::Integer] + # Requested page size. + # + # The maximum page size is 500. If unspecified, the page size will + # be the maximum. Fewer jobs than requested might be returned, + # even if more jobs exist; use next_page_token to determine if more + # jobs exist. + # @!attribute [rw] page_token + # @return [::String] + # A token identifying a page of results the server will return. To + # request the first page results, page_token must be empty. To + # request the next page of results, page_token must be the value of + # {::Google::Cloud::Scheduler::V1beta1::ListJobsResponse#next_page_token next_page_token} + # returned from the previous call to + # {::Google::Cloud::Scheduler::V1beta1::CloudScheduler::Client#list_jobs ListJobs}. It is + # an error to switch the value of + # {::Google::Cloud::Scheduler::V1beta1::ListJobsRequest#filter filter} or + # [order_by][google.cloud.scheduler.v1beta1.ListJobsRequest.order_by] while + # iterating through pages. + # @!attribute [rw] legacy_app_engine_cron + # @return [::Boolean] + # This field is used to manage the legacy App Engine Cron jobs using the + # Cloud Scheduler API. If the field is set to true, the jobs in the __cron + # queue will be listed instead. + class ListJobsRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Response message for listing jobs using + # {::Google::Cloud::Scheduler::V1beta1::CloudScheduler::Client#list_jobs ListJobs}. + # @!attribute [rw] jobs + # @return [::Array<::Google::Cloud::Scheduler::V1beta1::Job>] + # The list of jobs. + # @!attribute [rw] next_page_token + # @return [::String] + # A token to retrieve next page of results. Pass this value in the + # {::Google::Cloud::Scheduler::V1beta1::ListJobsRequest#page_token page_token} + # field in the subsequent call to + # {::Google::Cloud::Scheduler::V1beta1::CloudScheduler::Client#list_jobs ListJobs} to + # retrieve the next page of results. If this is empty it indicates that there + # are no more results through which to paginate. + # + # The page token is valid for only 2 hours. + class ListJobsResponse + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Request message for + # {::Google::Cloud::Scheduler::V1beta1::CloudScheduler::Client#get_job GetJob}. + # @!attribute [rw] name + # @return [::String] + # Required. The job name. For example: + # `projects/PROJECT_ID/locations/LOCATION_ID/jobs/JOB_ID`. + class GetJobRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Request message for + # {::Google::Cloud::Scheduler::V1beta1::CloudScheduler::Client#create_job CreateJob}. + # @!attribute [rw] parent + # @return [::String] + # Required. The location name. For example: + # `projects/PROJECT_ID/locations/LOCATION_ID`. + # @!attribute [rw] job + # @return [::Google::Cloud::Scheduler::V1beta1::Job] + # Required. The job to add. The user can optionally specify a name for the + # job in {::Google::Cloud::Scheduler::V1beta1::Job#name name}. + # {::Google::Cloud::Scheduler::V1beta1::Job#name name} cannot be the same as an + # existing job. If a name is not specified then the system will + # generate a random unique name that will be returned + # ({::Google::Cloud::Scheduler::V1beta1::Job#name name}) in the response. + class CreateJobRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Request message for + # {::Google::Cloud::Scheduler::V1beta1::CloudScheduler::Client#update_job UpdateJob}. + # @!attribute [rw] job + # @return [::Google::Cloud::Scheduler::V1beta1::Job] + # Required. The new job properties. + # {::Google::Cloud::Scheduler::V1beta1::Job#name name} must be specified. + # + # Output only fields cannot be modified using UpdateJob. + # Any value specified for an output only field will be ignored. + # @!attribute [rw] update_mask + # @return [::Google::Protobuf::FieldMask] + # A mask used to specify which fields of the job are being updated. + class UpdateJobRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Request message for deleting a job using + # {::Google::Cloud::Scheduler::V1beta1::CloudScheduler::Client#delete_job DeleteJob}. + # @!attribute [rw] name + # @return [::String] + # Required. The job name. For example: + # `projects/PROJECT_ID/locations/LOCATION_ID/jobs/JOB_ID`. + # @!attribute [rw] legacy_app_engine_cron + # @return [::Boolean] + # This field is used to manage the legacy App Engine Cron jobs using the + # Cloud Scheduler API. If the field is set to true, the job in the __cron + # queue with the corresponding name will be deleted instead. + class DeleteJobRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Request message for + # {::Google::Cloud::Scheduler::V1beta1::CloudScheduler::Client#pause_job PauseJob}. + # @!attribute [rw] name + # @return [::String] + # Required. The job name. For example: + # `projects/PROJECT_ID/locations/LOCATION_ID/jobs/JOB_ID`. + class PauseJobRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Request message for + # {::Google::Cloud::Scheduler::V1beta1::CloudScheduler::Client#resume_job ResumeJob}. + # @!attribute [rw] name + # @return [::String] + # Required. The job name. For example: + # `projects/PROJECT_ID/locations/LOCATION_ID/jobs/JOB_ID`. + class ResumeJobRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Request message for forcing a job to run now using + # {::Google::Cloud::Scheduler::V1beta1::CloudScheduler::Client#run_job RunJob}. + # @!attribute [rw] name + # @return [::String] + # Required. The job name. For example: + # `projects/PROJECT_ID/locations/LOCATION_ID/jobs/JOB_ID`. + # @!attribute [rw] legacy_app_engine_cron + # @return [::Boolean] + # This field is used to manage the legacy App Engine Cron jobs using the + # Cloud Scheduler API. If the field is set to true, the job in the __cron + # queue with the corresponding name will be forced to run instead. + class RunJobRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-scheduler-v1beta1/proto_docs/google/cloud/scheduler/v1beta1/job.rb b/owl-bot-staging/google-cloud-scheduler-v1beta1/proto_docs/google/cloud/scheduler/v1beta1/job.rb new file mode 100644 index 000000000000..50f3e82e2d83 --- /dev/null +++ b/owl-bot-staging/google-cloud-scheduler-v1beta1/proto_docs/google/cloud/scheduler/v1beta1/job.rb @@ -0,0 +1,267 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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 Scheduler + module V1beta1 + # Configuration for a job. + # The maximum allowed size for a job is 1MB. + # @!attribute [rw] name + # @return [::String] + # Optionally caller-specified in + # {::Google::Cloud::Scheduler::V1beta1::CloudScheduler::Client#create_job CreateJob}, after + # which it becomes output only. + # + # The job name. For example: + # `projects/PROJECT_ID/locations/LOCATION_ID/jobs/JOB_ID`. + # + # * `PROJECT_ID` can contain letters ([A-Za-z]), numbers ([0-9]), + # hyphens (-), colons (:), or periods (.). + # For more information, see + # [Identifying + # projects](https://cloud.google.com/resource-manager/docs/creating-managing-projects#identifying_projects) + # * `LOCATION_ID` is the canonical ID for the job's location. + # The list of available locations can be obtained by calling + # [ListLocations][google.cloud.location.Locations.ListLocations]. + # For more information, see https://cloud.google.com/about/locations/. + # * `JOB_ID` can contain only letters ([A-Za-z]), numbers ([0-9]), + # hyphens (-), or underscores (_). The maximum length is 500 characters. + # @!attribute [rw] description + # @return [::String] + # Optionally caller-specified in + # {::Google::Cloud::Scheduler::V1beta1::CloudScheduler::Client#create_job CreateJob} or + # {::Google::Cloud::Scheduler::V1beta1::CloudScheduler::Client#update_job UpdateJob}. + # + # A human-readable description for the job. This string must not contain + # more than 500 characters. + # @!attribute [rw] pubsub_target + # @return [::Google::Cloud::Scheduler::V1beta1::PubsubTarget] + # Pub/Sub target. + # + # Note: The following fields are mutually exclusive: `pubsub_target`, `app_engine_http_target`, `http_target`. If a field in that set is populated, all other fields in the set will automatically be cleared. + # @!attribute [rw] app_engine_http_target + # @return [::Google::Cloud::Scheduler::V1beta1::AppEngineHttpTarget] + # App Engine HTTP target. + # + # Note: The following fields are mutually exclusive: `app_engine_http_target`, `pubsub_target`, `http_target`. If a field in that set is populated, all other fields in the set will automatically be cleared. + # @!attribute [rw] http_target + # @return [::Google::Cloud::Scheduler::V1beta1::HttpTarget] + # HTTP target. + # + # Note: The following fields are mutually exclusive: `http_target`, `pubsub_target`, `app_engine_http_target`. If a field in that set is populated, all other fields in the set will automatically be cleared. + # @!attribute [rw] schedule + # @return [::String] + # Required, except when used with + # {::Google::Cloud::Scheduler::V1beta1::CloudScheduler::Client#update_job UpdateJob}. + # + # Describes the schedule on which the job will be executed. + # + # The schedule can be either of the following types: + # + # * [Crontab](https://en.wikipedia.org/wiki/Cron#Overview) + # * English-like + # [schedule](https://cloud.google.com/scheduler/docs/configuring/cron-job-schedules) + # + # As a general rule, execution `n + 1` of a job will not begin + # until execution `n` has finished. Cloud Scheduler will never + # allow two simultaneously outstanding executions. For example, + # this implies that if the `n+1`th execution is scheduled to run at + # 16:00 but the `n`th execution takes until 16:15, the `n+1`th + # execution will not start until `16:15`. + # A scheduled start time will be delayed if the previous + # execution has not ended when its scheduled time occurs. + # + # If {::Google::Cloud::Scheduler::V1beta1::RetryConfig#retry_count retry_count} > + # 0 and a job attempt fails, the job will be tried a total of + # {::Google::Cloud::Scheduler::V1beta1::RetryConfig#retry_count retry_count} + # times, with exponential backoff, until the next scheduled start + # time. + # @!attribute [rw] time_zone + # @return [::String] + # Specifies the time zone to be used in interpreting + # {::Google::Cloud::Scheduler::V1beta1::Job#schedule schedule}. The value of this + # field must be a time zone name from the [tz + # database](http://en.wikipedia.org/wiki/Tz_database). + # + # Note that some time zones include a provision for + # daylight savings time. The rules for daylight saving time are + # determined by the chosen tz. For UTC use the string "utc". If a + # time zone is not specified, the default will be in UTC (also known + # as GMT). + # @!attribute [rw] user_update_time + # @return [::Google::Protobuf::Timestamp] + # Output only. The creation time of the job. + # @!attribute [rw] state + # @return [::Google::Cloud::Scheduler::V1beta1::Job::State] + # Output only. State of the job. + # @!attribute [rw] status + # @return [::Google::Rpc::Status] + # Output only. The response from the target for the last attempted execution. + # @!attribute [rw] schedule_time + # @return [::Google::Protobuf::Timestamp] + # Output only. The next time the job is scheduled. Note that this may be a + # retry of a previously failed attempt or the next execution time + # according to the schedule. + # @!attribute [rw] last_attempt_time + # @return [::Google::Protobuf::Timestamp] + # Output only. The time the last job attempt started. + # @!attribute [rw] retry_config + # @return [::Google::Cloud::Scheduler::V1beta1::RetryConfig] + # Settings that determine the retry behavior. + # @!attribute [rw] attempt_deadline + # @return [::Google::Protobuf::Duration] + # The deadline for job attempts. If the request handler does not respond by + # this deadline then the request is cancelled and the attempt is marked as a + # `DEADLINE_EXCEEDED` failure. The failed attempt can be viewed in + # execution logs. Cloud Scheduler will retry the job according + # to the {::Google::Cloud::Scheduler::V1beta1::RetryConfig RetryConfig}. + # + # The default and the allowed values depend on the type of target: + # + # * For {::Google::Cloud::Scheduler::V1beta1::Job#http_target HTTP targets}, the + # default is 3 minutes. The deadline must be in the interval [15 seconds, 30 + # minutes]. + # + # * For [App Engine HTTP + # targets][google.cloud.scheduler.v1beta1.Job.app_engine_http_target], 0 + # indicates that the request has the default deadline. The default deadline + # depends on the scaling type of the service: 10 minutes for standard apps + # with automatic scaling, 24 hours for standard apps with manual and basic + # scaling, and 60 minutes for flex apps. If the request deadline is set, it + # must be in the interval [15 seconds, 24 hours 15 seconds]. + # + # * For [Pub/Sub targets][google.cloud.scheduler.v1beta1.Job.pubsub_target], + # this field is ignored. + # @!attribute [rw] legacy_app_engine_cron + # @return [::Boolean] + # Immutable. This field is used to manage the legacy App Engine Cron jobs + # using the Cloud Scheduler API. If the field is set to true, the job will be + # considered a legacy job. Note that App Engine Cron jobs have fewer + # features than Cloud Scheduler jobs, e.g., are only limited to App Engine + # targets. + class Job + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # State of the job. + module State + # Unspecified state. + STATE_UNSPECIFIED = 0 + + # The job is executing normally. + ENABLED = 1 + + # The job is paused by the user. It will not execute. A user can + # intentionally pause the job using + # {::Google::Cloud::Scheduler::V1beta1::PauseJobRequest PauseJobRequest}. + PAUSED = 2 + + # The job is disabled by the system due to error. The user + # cannot directly set a job to be disabled. + DISABLED = 3 + + # The job state resulting from a failed + # {::Google::Cloud::Scheduler::V1beta1::CloudScheduler::Client#update_job CloudScheduler.UpdateJob} + # operation. To recover a job from this state, retry + # {::Google::Cloud::Scheduler::V1beta1::CloudScheduler::Client#update_job CloudScheduler.UpdateJob} + # until a successful response is received. + UPDATE_FAILED = 4 + end + end + + # Settings that determine the retry behavior. + # + # By default, if a job does not complete successfully (meaning that + # an acknowledgement is not received from the handler, then it will be retried + # with exponential backoff according to the settings in + # {::Google::Cloud::Scheduler::V1beta1::RetryConfig RetryConfig}. + # @!attribute [rw] retry_count + # @return [::Integer] + # The number of attempts that the system will make to run a job using the + # exponential backoff procedure described by + # {::Google::Cloud::Scheduler::V1beta1::RetryConfig#max_doublings max_doublings}. + # + # The default value of retry_count is zero. + # + # If retry_count is zero, a job attempt will *not* be retried if + # it fails. Instead the Cloud Scheduler system will wait for the + # next scheduled execution time. + # + # If retry_count is set to a non-zero number then Cloud Scheduler + # will retry failed attempts, using exponential backoff, + # retry_count times, or until the next scheduled execution time, + # whichever comes first. + # + # Values greater than 5 and negative values are not allowed. + # @!attribute [rw] max_retry_duration + # @return [::Google::Protobuf::Duration] + # The time limit for retrying a failed job, measured from time when an + # execution was first attempted. If specified with + # {::Google::Cloud::Scheduler::V1beta1::RetryConfig#retry_count retry_count}, the + # job will be retried until both limits are reached. + # + # The default value for max_retry_duration is zero, which means retry + # duration is unlimited. + # @!attribute [rw] min_backoff_duration + # @return [::Google::Protobuf::Duration] + # The minimum amount of time to wait before retrying a job after + # it fails. + # + # The default value of this field is 5 seconds. + # @!attribute [rw] max_backoff_duration + # @return [::Google::Protobuf::Duration] + # The maximum amount of time to wait before retrying a job after + # it fails. + # + # The default value of this field is 1 hour. + # @!attribute [rw] max_doublings + # @return [::Integer] + # The time between retries will double `max_doublings` times. + # + # A job's retry interval starts at + # {::Google::Cloud::Scheduler::V1beta1::RetryConfig#min_backoff_duration min_backoff_duration}, + # then doubles `max_doublings` times, then increases linearly, and finally + # retries at intervals of + # {::Google::Cloud::Scheduler::V1beta1::RetryConfig#max_backoff_duration max_backoff_duration} + # up to {::Google::Cloud::Scheduler::V1beta1::RetryConfig#retry_count retry_count} + # times. + # + # For example, if + # {::Google::Cloud::Scheduler::V1beta1::RetryConfig#min_backoff_duration min_backoff_duration} + # is 10s, + # {::Google::Cloud::Scheduler::V1beta1::RetryConfig#max_backoff_duration max_backoff_duration} + # is 300s, and `max_doublings` is 3, then the a job will first be retried in + # 10s. The retry interval will double three times, and then increase linearly + # by 2^3 * 10s. Finally, the job will retry at intervals of + # {::Google::Cloud::Scheduler::V1beta1::RetryConfig#max_backoff_duration max_backoff_duration} + # until the job has been attempted + # {::Google::Cloud::Scheduler::V1beta1::RetryConfig#retry_count retry_count} + # times. Thus, the requests will retry at 10s, 20s, 40s, 80s, 160s, 240s, + # 300s, 300s, .... + # + # The default value of this field is 5. + class RetryConfig + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-scheduler-v1beta1/proto_docs/google/cloud/scheduler/v1beta1/target.rb b/owl-bot-staging/google-cloud-scheduler-v1beta1/proto_docs/google/cloud/scheduler/v1beta1/target.rb new file mode 100644 index 000000000000..6e78134b664f --- /dev/null +++ b/owl-bot-staging/google-cloud-scheduler-v1beta1/proto_docs/google/cloud/scheduler/v1beta1/target.rb @@ -0,0 +1,409 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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 Scheduler + module V1beta1 + # Http target. The job will be pushed to the job handler by means of + # an HTTP request via an + # {::Google::Cloud::Scheduler::V1beta1::HttpTarget#http_method http_method} such as + # HTTP POST, HTTP GET, etc. The job is acknowledged by means of an HTTP + # response code in the range [200 - 299]. A failure to receive a response + # constitutes a failed execution. For a redirected request, the response + # returned by the redirected request is considered. + # @!attribute [rw] uri + # @return [::String] + # Required. The full URI path that the request will be sent to. This string + # must begin with either "http://" or "https://". Some examples of + # valid values for {::Google::Cloud::Scheduler::V1beta1::HttpTarget#uri uri} are: + # `http://acme.com` and `https://acme.com/sales:8080`. Cloud Scheduler will + # encode some characters for safety and compatibility. The maximum allowed + # URL length is 2083 characters after encoding. + # @!attribute [rw] http_method + # @return [::Google::Cloud::Scheduler::V1beta1::HttpMethod] + # Which HTTP method to use for the request. + # @!attribute [rw] headers + # @return [::Google::Protobuf::Map{::String => ::String}] + # The user can specify HTTP request headers to send with the job's + # HTTP request. This map contains the header field names and + # values. Repeated headers are not supported, but a header value can + # contain commas. These headers represent a subset of the headers + # that will accompany the job's HTTP request. Some HTTP request + # headers will be ignored or replaced. A partial list of headers that + # will be ignored or replaced is below: + # - Host: This will be computed by Cloud Scheduler and derived from + # {::Google::Cloud::Scheduler::V1beta1::HttpTarget#uri uri}. + # * `Content-Length`: This will be computed by Cloud Scheduler. + # * `User-Agent`: This will be set to `"Google-Cloud-Scheduler"`. + # * `X-Google-*`: Google internal use only. + # * `X-AppEngine-*`: Google internal use only. + # * `X-CloudScheduler`: This header will be set to true. + # * `X-CloudScheduler-JobName`: This header will contain the job name. + # * `X-CloudScheduler-ScheduleTime`: For Cloud Scheduler jobs specified in + # the unix-cron format, this header will contain the job schedule as an + # offset of UTC parsed according to RFC3339. + # + # The total size of headers must be less than 80KB. + # @!attribute [rw] body + # @return [::String] + # HTTP request body. A request body is allowed only if the HTTP + # method is POST, PUT, or PATCH. It is an error to set body on a job with an + # incompatible {::Google::Cloud::Scheduler::V1beta1::HttpMethod HttpMethod}. + # @!attribute [rw] oauth_token + # @return [::Google::Cloud::Scheduler::V1beta1::OAuthToken] + # If specified, an + # [OAuth token](https://developers.google.com/identity/protocols/OAuth2) + # will be generated and attached as an `Authorization` header in the HTTP + # request. + # + # This type of authorization should generally only be used when calling + # Google APIs hosted on *.googleapis.com. + # + # Note: The following fields are mutually exclusive: `oauth_token`, `oidc_token`. If a field in that set is populated, all other fields in the set will automatically be cleared. + # @!attribute [rw] oidc_token + # @return [::Google::Cloud::Scheduler::V1beta1::OidcToken] + # If specified, an + # [OIDC](https://developers.google.com/identity/protocols/OpenIDConnect) + # token will be generated and attached as an `Authorization` header in the + # HTTP request. + # + # This type of authorization can be used for many scenarios, including + # calling Cloud Run, or endpoints where you intend to validate the token + # yourself. + # + # Note: The following fields are mutually exclusive: `oidc_token`, `oauth_token`. If a field in that set is populated, all other fields in the set will automatically be cleared. + class HttpTarget + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # @!attribute [rw] key + # @return [::String] + # @!attribute [rw] value + # @return [::String] + class HeadersEntry + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end + + # App Engine target. The job will be pushed to a job handler by means + # of an HTTP request via an + # {::Google::Cloud::Scheduler::V1beta1::AppEngineHttpTarget#http_method http_method} + # such as HTTP POST, HTTP GET, etc. The job is acknowledged by means of an HTTP + # response code in the range [200 - 299]. Error 503 is considered an App Engine + # system error instead of an application error. Requests returning error 503 + # will be retried regardless of retry configuration and not counted against + # retry counts. Any other response code, or a failure to receive a response + # before the deadline, constitutes a failed attempt. + # @!attribute [rw] http_method + # @return [::Google::Cloud::Scheduler::V1beta1::HttpMethod] + # The HTTP method to use for the request. PATCH and OPTIONS are not + # permitted. + # @!attribute [rw] app_engine_routing + # @return [::Google::Cloud::Scheduler::V1beta1::AppEngineRouting] + # App Engine Routing setting for the job. + # @!attribute [rw] relative_uri + # @return [::String] + # The relative URI. + # + # The relative URL must begin with "/" and must be a valid HTTP relative URL. + # It can contain a path, query string arguments, and `#` fragments. + # If the relative URL is empty, then the root path "/" will be used. + # No spaces are allowed, and the maximum length allowed is 2083 characters. + # @!attribute [rw] headers + # @return [::Google::Protobuf::Map{::String => ::String}] + # HTTP request headers. + # + # This map contains the header field names and values. Headers can be set + # when the job is created. + # + # Cloud Scheduler sets some headers to default values: + # + # * `User-Agent`: By default, this header is + # `"AppEngine-Google; (+http://code.google.com/appengine)"`. + # This header can be modified, but Cloud Scheduler will append + # `"AppEngine-Google; (+http://code.google.com/appengine)"` to the + # modified `User-Agent`. + # * `X-CloudScheduler`: This header will be set to true. + # * `X-CloudScheduler-JobName`: This header will contain the job name. + # * `X-CloudScheduler-ScheduleTime`: For Cloud Scheduler jobs specified in + # the unix-cron format, this header will contain the job schedule as an + # offset of UTC parsed according to RFC3339. + # + # If the job has an + # {::Google::Cloud::Scheduler::V1beta1::AppEngineHttpTarget#body body}, Cloud + # Scheduler sets the following headers: + # + # * `Content-Type`: By default, the `Content-Type` header is set to + # `"application/octet-stream"`. The default can be overridden by explictly + # setting `Content-Type` to a particular media type when the job is + # created. + # For example, `Content-Type` can be set to `"application/json"`. + # * `Content-Length`: This is computed by Cloud Scheduler. This value is + # output only. It cannot be changed. + # + # The headers below are output only. They cannot be set or overridden: + # + # * `X-Google-*`: For Google internal use only. + # * `X-AppEngine-*`: For Google internal use only. + # + # In addition, some App Engine headers, which contain + # job-specific information, are also be sent to the job handler. + # @!attribute [rw] body + # @return [::String] + # Body. + # + # HTTP request body. A request body is allowed only if the HTTP method is + # POST or PUT. It will result in invalid argument error to set a body on a + # job with an incompatible + # {::Google::Cloud::Scheduler::V1beta1::HttpMethod HttpMethod}. + class AppEngineHttpTarget + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # @!attribute [rw] key + # @return [::String] + # @!attribute [rw] value + # @return [::String] + class HeadersEntry + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end + + # Pub/Sub target. The job will be delivered by publishing a message to + # the given Pub/Sub topic. + # @!attribute [rw] topic_name + # @return [::String] + # Required. The name of the Cloud Pub/Sub topic to which messages will + # be published when a job is delivered. The topic name must be in the + # same format as required by Pub/Sub's + # [PublishRequest.name](https://cloud.google.com/pubsub/docs/reference/rpc/google.pubsub.v1#publishrequest), + # for example `projects/PROJECT_ID/topics/TOPIC_ID`. + # + # The topic must be in the same project as the Cloud Scheduler job. + # @!attribute [rw] data + # @return [::String] + # The message payload for PubsubMessage. + # + # Pubsub message must contain either non-empty data, or at least one + # attribute. + # @!attribute [rw] attributes + # @return [::Google::Protobuf::Map{::String => ::String}] + # Attributes for PubsubMessage. + # + # Pubsub message must contain either non-empty data, or at least one + # attribute. + class PubsubTarget + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # @!attribute [rw] key + # @return [::String] + # @!attribute [rw] value + # @return [::String] + class AttributesEntry + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end + + # App Engine Routing. + # + # For more information about services, versions, and instances see + # [An Overview of App + # Engine](https://cloud.google.com/appengine/docs/python/an-overview-of-app-engine), + # [Microservices Architecture on Google App + # Engine](https://cloud.google.com/appengine/docs/python/microservices-on-app-engine), + # [App Engine Standard request + # routing](https://cloud.google.com/appengine/docs/standard/python/how-requests-are-routed), + # and [App Engine Flex request + # routing](https://cloud.google.com/appengine/docs/flexible/python/how-requests-are-routed). + # @!attribute [rw] service + # @return [::String] + # App service. + # + # By default, the job is sent to the service which is the default + # service when the job is attempted. + # @!attribute [rw] version + # @return [::String] + # App version. + # + # By default, the job is sent to the version which is the default + # version when the job is attempted. + # @!attribute [rw] instance + # @return [::String] + # App instance. + # + # By default, the job is sent to an instance which is available when + # the job is attempted. + # + # Requests can only be sent to a specific instance if + # [manual scaling is used in App Engine + # Standard](https://cloud.google.com/appengine/docs/python/an-overview-of-app-engine?#scaling_types_and_instance_classes). + # App Engine Flex does not support instances. For more information, see + # [App Engine Standard request + # routing](https://cloud.google.com/appengine/docs/standard/python/how-requests-are-routed) + # and [App Engine Flex request + # routing](https://cloud.google.com/appengine/docs/flexible/python/how-requests-are-routed). + # @!attribute [rw] host + # @return [::String] + # Output only. The host that the job is sent to. + # + # For more information about how App Engine requests are routed, see + # [here](https://cloud.google.com/appengine/docs/standard/python/how-requests-are-routed). + # + # The host is constructed as: + # + # + # * `host = [application_domain_name]`
+ # `| [service] + '.' + [application_domain_name]`
+ # `| [version] + '.' + [application_domain_name]`
+ # `| [version_dot_service]+ '.' + [application_domain_name]`
+ # `| [instance] + '.' + [application_domain_name]`
+ # `| [instance_dot_service] + '.' + [application_domain_name]`
+ # `| [instance_dot_version] + '.' + [application_domain_name]`
+ # `| [instance_dot_version_dot_service] + '.' + [application_domain_name]` + # + # * `application_domain_name` = The domain name of the app, for + # example .appspot.com, which is associated with the + # job's project ID. + # + # * `service =` + # {::Google::Cloud::Scheduler::V1beta1::AppEngineRouting#service service} + # + # * `version =` + # {::Google::Cloud::Scheduler::V1beta1::AppEngineRouting#version version} + # + # * `version_dot_service =` + # {::Google::Cloud::Scheduler::V1beta1::AppEngineRouting#version version} `+ '.' + # +` [service][google.cloud.scheduler.v1beta1.AppEngineRouting.service] + # + # * `instance =` + # {::Google::Cloud::Scheduler::V1beta1::AppEngineRouting#instance instance} + # + # * `instance_dot_service =` + # {::Google::Cloud::Scheduler::V1beta1::AppEngineRouting#instance instance} `+ + # '.' +` [service][google.cloud.scheduler.v1beta1.AppEngineRouting.service] + # + # * `instance_dot_version =` + # {::Google::Cloud::Scheduler::V1beta1::AppEngineRouting#instance instance} `+ + # '.' +` [version][google.cloud.scheduler.v1beta1.AppEngineRouting.version] + # + # * `instance_dot_version_dot_service =` + # {::Google::Cloud::Scheduler::V1beta1::AppEngineRouting#instance instance} `+ + # '.' +` [version][google.cloud.scheduler.v1beta1.AppEngineRouting.version] + # `+ '.' +` + # {::Google::Cloud::Scheduler::V1beta1::AppEngineRouting#service service} + # + # + # If {::Google::Cloud::Scheduler::V1beta1::AppEngineRouting#service service} is + # empty, then the job will be sent to the service which is the default + # service when the job is attempted. + # + # If {::Google::Cloud::Scheduler::V1beta1::AppEngineRouting#version version} is + # empty, then the job will be sent to the version which is the default + # version when the job is attempted. + # + # If {::Google::Cloud::Scheduler::V1beta1::AppEngineRouting#instance instance} is + # empty, then the job will be sent to an instance which is available when the + # job is attempted. + # + # If {::Google::Cloud::Scheduler::V1beta1::AppEngineRouting#service service}, + # {::Google::Cloud::Scheduler::V1beta1::AppEngineRouting#version version}, or + # {::Google::Cloud::Scheduler::V1beta1::AppEngineRouting#instance instance} is + # invalid, then the job will be sent to the default version of the default + # service when the job is attempted. + class AppEngineRouting + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Contains information needed for generating an + # [OAuth token](https://developers.google.com/identity/protocols/OAuth2). + # This type of authorization should generally only be used when calling Google + # APIs hosted on *.googleapis.com. + # @!attribute [rw] service_account_email + # @return [::String] + # [Service account email](https://cloud.google.com/iam/docs/service-accounts) + # to be used for generating OAuth token. + # The service account must be within the same project as the job. The caller + # must have iam.serviceAccounts.actAs permission for the service account. + # @!attribute [rw] scope + # @return [::String] + # OAuth scope to be used for generating OAuth access token. + # If not specified, "https://www.googleapis.com/auth/cloud-platform" + # will be used. + class OAuthToken + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Contains information needed for generating an + # [OpenID Connect + # token](https://developers.google.com/identity/protocols/OpenIDConnect). + # This type of authorization can be used for many scenarios, including + # calling Cloud Run, or endpoints where you intend to validate the token + # yourself. + # @!attribute [rw] service_account_email + # @return [::String] + # [Service account email](https://cloud.google.com/iam/docs/service-accounts) + # to be used for generating OIDC token. + # The service account must be within the same project as the job. The caller + # must have iam.serviceAccounts.actAs permission for the service account. + # @!attribute [rw] audience + # @return [::String] + # Audience to be used when generating OIDC token. If not specified, the URI + # specified in target will be used. + class OidcToken + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # The HTTP method used to execute the job. + module HttpMethod + # HTTP method unspecified. Defaults to POST. + HTTP_METHOD_UNSPECIFIED = 0 + + # HTTP POST + POST = 1 + + # HTTP GET + GET = 2 + + # HTTP HEAD + HEAD = 3 + + # HTTP PUT + PUT = 4 + + # HTTP DELETE + DELETE = 5 + + # HTTP PATCH + PATCH = 6 + + # HTTP OPTIONS + OPTIONS = 7 + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-scheduler-v1beta1/proto_docs/google/protobuf/any.rb b/owl-bot-staging/google-cloud-scheduler-v1beta1/proto_docs/google/protobuf/any.rb new file mode 100644 index 000000000000..58691995f02e --- /dev/null +++ b/owl-bot-staging/google-cloud-scheduler-v1beta1/proto_docs/google/protobuf/any.rb @@ -0,0 +1,145 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + + +module Google + module Protobuf + # `Any` contains an arbitrary serialized protocol buffer message along with a + # URL that describes the type of the serialized message. + # + # Protobuf library provides support to pack/unpack Any values in the form + # of utility functions or additional generated methods of the Any type. + # + # Example 1: Pack and unpack a message in C++. + # + # Foo foo = ...; + # Any any; + # any.PackFrom(foo); + # ... + # if (any.UnpackTo(&foo)) { + # ... + # } + # + # Example 2: Pack and unpack a message in Java. + # + # Foo foo = ...; + # Any any = Any.pack(foo); + # ... + # if (any.is(Foo.class)) { + # foo = any.unpack(Foo.class); + # } + # // or ... + # if (any.isSameTypeAs(Foo.getDefaultInstance())) { + # foo = any.unpack(Foo.getDefaultInstance()); + # } + # + # Example 3: Pack and unpack a message in Python. + # + # foo = Foo(...) + # any = Any() + # any.Pack(foo) + # ... + # if any.Is(Foo.DESCRIPTOR): + # any.Unpack(foo) + # ... + # + # Example 4: Pack and unpack a message in Go + # + # foo := &pb.Foo{...} + # any, err := anypb.New(foo) + # if err != nil { + # ... + # } + # ... + # foo := &pb.Foo{} + # if err := any.UnmarshalTo(foo); err != nil { + # ... + # } + # + # The pack methods provided by protobuf library will by default use + # 'type.googleapis.com/full.type.name' as the type URL and the unpack + # methods only use the fully qualified type name after the last '/' + # in the type URL, for example "foo.bar.com/x/y.z" will yield type + # name "y.z". + # + # JSON + # ==== + # The JSON representation of an `Any` value uses the regular + # representation of the deserialized, embedded message, with an + # additional field `@type` which contains the type URL. Example: + # + # package google.profile; + # message Person { + # string first_name = 1; + # string last_name = 2; + # } + # + # { + # "@type": "type.googleapis.com/google.profile.Person", + # "firstName": , + # "lastName": + # } + # + # If the embedded message type is well-known and has a custom JSON + # representation, that representation will be embedded adding a field + # `value` which holds the custom JSON in addition to the `@type` + # field. Example (for message [google.protobuf.Duration][]): + # + # { + # "@type": "type.googleapis.com/google.protobuf.Duration", + # "value": "1.212s" + # } + # @!attribute [rw] type_url + # @return [::String] + # A URL/resource name that uniquely identifies the type of the serialized + # protocol buffer message. This string must contain at least + # one "/" character. The last segment of the URL's path must represent + # the fully qualified name of the type (as in + # `path/google.protobuf.Duration`). The name should be in a canonical form + # (e.g., leading "." is not accepted). + # + # In practice, teams usually precompile into the binary all types that they + # expect it to use in the context of Any. However, for URLs which use the + # scheme `http`, `https`, or no scheme, one can optionally set up a type + # server that maps type URLs to message definitions as follows: + # + # * If no scheme is provided, `https` is assumed. + # * An HTTP GET on the URL must yield a [google.protobuf.Type][] + # value in binary format, or produce an error. + # * Applications are allowed to cache lookup results based on the + # URL, or have them precompiled into a binary to avoid any + # lookup. Therefore, binary compatibility needs to be preserved + # on changes to types. (Use versioned type names to manage + # breaking changes.) + # + # Note: this functionality is not currently available in the official + # protobuf release, and it is not used for type URLs beginning with + # type.googleapis.com. As of May 2023, there are no widely used type server + # implementations and no plans to implement one. + # + # Schemes other than `http`, `https` (or the empty scheme) might be + # used with implementation specific semantics. + # @!attribute [rw] value + # @return [::String] + # Must be a valid serialized protocol buffer of the above specified type. + class Any + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end +end diff --git a/owl-bot-staging/google-cloud-scheduler-v1beta1/proto_docs/google/protobuf/duration.rb b/owl-bot-staging/google-cloud-scheduler-v1beta1/proto_docs/google/protobuf/duration.rb new file mode 100644 index 000000000000..ea59f1f91daf --- /dev/null +++ b/owl-bot-staging/google-cloud-scheduler-v1beta1/proto_docs/google/protobuf/duration.rb @@ -0,0 +1,98 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + + +module Google + module Protobuf + # A Duration represents a signed, fixed-length span of time represented + # as a count of seconds and fractions of seconds at nanosecond + # resolution. It is independent of any calendar and concepts like "day" + # or "month". It is related to Timestamp in that the difference between + # two Timestamp values is a Duration and it can be added or subtracted + # from a Timestamp. Range is approximately +-10,000 years. + # + # # Examples + # + # Example 1: Compute Duration from two Timestamps in pseudo code. + # + # Timestamp start = ...; + # Timestamp end = ...; + # Duration duration = ...; + # + # duration.seconds = end.seconds - start.seconds; + # duration.nanos = end.nanos - start.nanos; + # + # if (duration.seconds < 0 && duration.nanos > 0) { + # duration.seconds += 1; + # duration.nanos -= 1000000000; + # } else if (duration.seconds > 0 && duration.nanos < 0) { + # duration.seconds -= 1; + # duration.nanos += 1000000000; + # } + # + # Example 2: Compute Timestamp from Timestamp + Duration in pseudo code. + # + # Timestamp start = ...; + # Duration duration = ...; + # Timestamp end = ...; + # + # end.seconds = start.seconds + duration.seconds; + # end.nanos = start.nanos + duration.nanos; + # + # if (end.nanos < 0) { + # end.seconds -= 1; + # end.nanos += 1000000000; + # } else if (end.nanos >= 1000000000) { + # end.seconds += 1; + # end.nanos -= 1000000000; + # } + # + # Example 3: Compute Duration from datetime.timedelta in Python. + # + # td = datetime.timedelta(days=3, minutes=10) + # duration = Duration() + # duration.FromTimedelta(td) + # + # # JSON Mapping + # + # In JSON format, the Duration type is encoded as a string rather than an + # object, where the string ends in the suffix "s" (indicating seconds) and + # is preceded by the number of seconds, with nanoseconds expressed as + # fractional seconds. For example, 3 seconds with 0 nanoseconds should be + # encoded in JSON format as "3s", while 3 seconds and 1 nanosecond should + # be expressed in JSON format as "3.000000001s", and 3 seconds and 1 + # microsecond should be expressed in JSON format as "3.000001s". + # @!attribute [rw] seconds + # @return [::Integer] + # Signed seconds of the span of time. Must be from -315,576,000,000 + # to +315,576,000,000 inclusive. Note: these bounds are computed from: + # 60 sec/min * 60 min/hr * 24 hr/day * 365.25 days/year * 10000 years + # @!attribute [rw] nanos + # @return [::Integer] + # Signed fractions of a second at nanosecond resolution of the span + # of time. Durations less than one second are represented with a 0 + # `seconds` field and a positive or negative `nanos` field. For durations + # of one second or more, a non-zero value for the `nanos` field must be + # of the same sign as the `seconds` field. Must be from -999,999,999 + # to +999,999,999 inclusive. + class Duration + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end +end diff --git a/owl-bot-staging/google-cloud-scheduler-v1beta1/proto_docs/google/protobuf/empty.rb b/owl-bot-staging/google-cloud-scheduler-v1beta1/proto_docs/google/protobuf/empty.rb new file mode 100644 index 000000000000..83e4481834a6 --- /dev/null +++ b/owl-bot-staging/google-cloud-scheduler-v1beta1/proto_docs/google/protobuf/empty.rb @@ -0,0 +1,34 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + + +module Google + module Protobuf + # A generic empty message that you can re-use to avoid defining duplicated + # empty messages in your APIs. A typical example is to use it as the request + # or the response type of an API method. For instance: + # + # service Foo { + # rpc Bar(google.protobuf.Empty) returns (google.protobuf.Empty); + # } + class Empty + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end +end diff --git a/owl-bot-staging/google-cloud-scheduler-v1beta1/proto_docs/google/protobuf/field_mask.rb b/owl-bot-staging/google-cloud-scheduler-v1beta1/proto_docs/google/protobuf/field_mask.rb new file mode 100644 index 000000000000..7f3ffc78601a --- /dev/null +++ b/owl-bot-staging/google-cloud-scheduler-v1beta1/proto_docs/google/protobuf/field_mask.rb @@ -0,0 +1,229 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + + +module Google + module Protobuf + # `FieldMask` represents a set of symbolic field paths, for example: + # + # paths: "f.a" + # paths: "f.b.d" + # + # Here `f` represents a field in some root message, `a` and `b` + # fields in the message found in `f`, and `d` a field found in the + # message in `f.b`. + # + # Field masks are used to specify a subset of fields that should be + # returned by a get operation or modified by an update operation. + # Field masks also have a custom JSON encoding (see below). + # + # # Field Masks in Projections + # + # When used in the context of a projection, a response message or + # sub-message is filtered by the API to only contain those fields as + # specified in the mask. For example, if the mask in the previous + # example is applied to a response message as follows: + # + # f { + # a : 22 + # b { + # d : 1 + # x : 2 + # } + # y : 13 + # } + # z: 8 + # + # The result will not contain specific values for fields x,y and z + # (their value will be set to the default, and omitted in proto text + # output): + # + # + # f { + # a : 22 + # b { + # d : 1 + # } + # } + # + # A repeated field is not allowed except at the last position of a + # paths string. + # + # If a FieldMask object is not present in a get operation, the + # operation applies to all fields (as if a FieldMask of all fields + # had been specified). + # + # Note that a field mask does not necessarily apply to the + # top-level response message. In case of a REST get operation, the + # field mask applies directly to the response, but in case of a REST + # list operation, the mask instead applies to each individual message + # in the returned resource list. In case of a REST custom method, + # other definitions may be used. Where the mask applies will be + # clearly documented together with its declaration in the API. In + # any case, the effect on the returned resource/resources is required + # behavior for APIs. + # + # # Field Masks in Update Operations + # + # A field mask in update operations specifies which fields of the + # targeted resource are going to be updated. The API is required + # to only change the values of the fields as specified in the mask + # and leave the others untouched. If a resource is passed in to + # describe the updated values, the API ignores the values of all + # fields not covered by the mask. + # + # If a repeated field is specified for an update operation, new values will + # be appended to the existing repeated field in the target resource. Note that + # a repeated field is only allowed in the last position of a `paths` string. + # + # If a sub-message is specified in the last position of the field mask for an + # update operation, then new value will be merged into the existing sub-message + # in the target resource. + # + # For example, given the target message: + # + # f { + # b { + # d: 1 + # x: 2 + # } + # c: [1] + # } + # + # And an update message: + # + # f { + # b { + # d: 10 + # } + # c: [2] + # } + # + # then if the field mask is: + # + # paths: ["f.b", "f.c"] + # + # then the result will be: + # + # f { + # b { + # d: 10 + # x: 2 + # } + # c: [1, 2] + # } + # + # An implementation may provide options to override this default behavior for + # repeated and message fields. + # + # In order to reset a field's value to the default, the field must + # be in the mask and set to the default value in the provided resource. + # Hence, in order to reset all fields of a resource, provide a default + # instance of the resource and set all fields in the mask, or do + # not provide a mask as described below. + # + # If a field mask is not present on update, the operation applies to + # all fields (as if a field mask of all fields has been specified). + # Note that in the presence of schema evolution, this may mean that + # fields the client does not know and has therefore not filled into + # the request will be reset to their default. If this is unwanted + # behavior, a specific service may require a client to always specify + # a field mask, producing an error if not. + # + # As with get operations, the location of the resource which + # describes the updated values in the request message depends on the + # operation kind. In any case, the effect of the field mask is + # required to be honored by the API. + # + # ## Considerations for HTTP REST + # + # The HTTP kind of an update operation which uses a field mask must + # be set to PATCH instead of PUT in order to satisfy HTTP semantics + # (PUT must only be used for full updates). + # + # # JSON Encoding of Field Masks + # + # In JSON, a field mask is encoded as a single string where paths are + # separated by a comma. Fields name in each path are converted + # to/from lower-camel naming conventions. + # + # As an example, consider the following message declarations: + # + # message Profile { + # User user = 1; + # Photo photo = 2; + # } + # message User { + # string display_name = 1; + # string address = 2; + # } + # + # In proto a field mask for `Profile` may look as such: + # + # mask { + # paths: "user.display_name" + # paths: "photo" + # } + # + # In JSON, the same mask is represented as below: + # + # { + # mask: "user.displayName,photo" + # } + # + # # Field Masks and Oneof Fields + # + # Field masks treat fields in oneofs just as regular fields. Consider the + # following message: + # + # message SampleMessage { + # oneof test_oneof { + # string name = 4; + # SubMessage sub_message = 9; + # } + # } + # + # The field mask can be: + # + # mask { + # paths: "name" + # } + # + # Or: + # + # mask { + # paths: "sub_message" + # } + # + # Note that oneof type names ("test_oneof" in this case) cannot be used in + # paths. + # + # ## Field Mask Verification + # + # The implementation of any API method which has a FieldMask type field in the + # request should verify the included field paths, and return an + # `INVALID_ARGUMENT` error if any path is unmappable. + # @!attribute [rw] paths + # @return [::Array<::String>] + # The set of field mask paths. + class FieldMask + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end +end diff --git a/owl-bot-staging/google-cloud-scheduler-v1beta1/proto_docs/google/protobuf/timestamp.rb b/owl-bot-staging/google-cloud-scheduler-v1beta1/proto_docs/google/protobuf/timestamp.rb new file mode 100644 index 000000000000..74352be9c58c --- /dev/null +++ b/owl-bot-staging/google-cloud-scheduler-v1beta1/proto_docs/google/protobuf/timestamp.rb @@ -0,0 +1,127 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + + +module Google + module Protobuf + # A Timestamp represents a point in time independent of any time zone or local + # calendar, encoded as a count of seconds and fractions of seconds at + # nanosecond resolution. The count is relative to an epoch at UTC midnight on + # January 1, 1970, in the proleptic Gregorian calendar which extends the + # Gregorian calendar backwards to year one. + # + # All minutes are 60 seconds long. Leap seconds are "smeared" so that no leap + # second table is needed for interpretation, using a [24-hour linear + # smear](https://developers.google.com/time/smear). + # + # The range is from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59.999999999Z. By + # restricting to that range, we ensure that we can convert to and from [RFC + # 3339](https://www.ietf.org/rfc/rfc3339.txt) date strings. + # + # # Examples + # + # Example 1: Compute Timestamp from POSIX `time()`. + # + # Timestamp timestamp; + # timestamp.set_seconds(time(NULL)); + # timestamp.set_nanos(0); + # + # Example 2: Compute Timestamp from POSIX `gettimeofday()`. + # + # struct timeval tv; + # gettimeofday(&tv, NULL); + # + # Timestamp timestamp; + # timestamp.set_seconds(tv.tv_sec); + # timestamp.set_nanos(tv.tv_usec * 1000); + # + # Example 3: Compute Timestamp from Win32 `GetSystemTimeAsFileTime()`. + # + # FILETIME ft; + # GetSystemTimeAsFileTime(&ft); + # UINT64 ticks = (((UINT64)ft.dwHighDateTime) << 32) | ft.dwLowDateTime; + # + # // A Windows tick is 100 nanoseconds. Windows epoch 1601-01-01T00:00:00Z + # // is 11644473600 seconds before Unix epoch 1970-01-01T00:00:00Z. + # Timestamp timestamp; + # timestamp.set_seconds((INT64) ((ticks / 10000000) - 11644473600LL)); + # timestamp.set_nanos((INT32) ((ticks % 10000000) * 100)); + # + # Example 4: Compute Timestamp from Java `System.currentTimeMillis()`. + # + # long millis = System.currentTimeMillis(); + # + # Timestamp timestamp = Timestamp.newBuilder().setSeconds(millis / 1000) + # .setNanos((int) ((millis % 1000) * 1000000)).build(); + # + # Example 5: Compute Timestamp from Java `Instant.now()`. + # + # Instant now = Instant.now(); + # + # Timestamp timestamp = + # Timestamp.newBuilder().setSeconds(now.getEpochSecond()) + # .setNanos(now.getNano()).build(); + # + # Example 6: Compute Timestamp from current time in Python. + # + # timestamp = Timestamp() + # timestamp.GetCurrentTime() + # + # # JSON Mapping + # + # In JSON format, the Timestamp type is encoded as a string in the + # [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format. That is, the + # format is "\\{year}-\\{month}-\\{day}T\\{hour}:\\{min}:\\{sec}[.\\{frac_sec}]Z" + # where \\{year} is always expressed using four digits while \\{month}, \\{day}, + # \\{hour}, \\{min}, and \\{sec} are zero-padded to two digits each. The fractional + # seconds, which can go up to 9 digits (i.e. up to 1 nanosecond resolution), + # are optional. The "Z" suffix indicates the timezone ("UTC"); the timezone + # is required. A proto3 JSON serializer should always use UTC (as indicated by + # "Z") when printing the Timestamp type and a proto3 JSON parser should be + # able to accept both UTC and other timezones (as indicated by an offset). + # + # For example, "2017-01-15T01:30:15.01Z" encodes 15.01 seconds past + # 01:30 UTC on January 15, 2017. + # + # In JavaScript, one can convert a Date object to this format using the + # standard + # [toISOString()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toISOString) + # method. In Python, a standard `datetime.datetime` object can be converted + # to this format using + # [`strftime`](https://docs.python.org/2/library/time.html#time.strftime) with + # the time format spec '%Y-%m-%dT%H:%M:%S.%fZ'. Likewise, in Java, one can use + # the Joda Time's [`ISODateTimeFormat.dateTime()`]( + # http://joda-time.sourceforge.net/apidocs/org/joda/time/format/ISODateTimeFormat.html#dateTime() + # ) to obtain a formatter capable of generating timestamps in this format. + # @!attribute [rw] seconds + # @return [::Integer] + # Represents seconds of UTC time since Unix epoch + # 1970-01-01T00:00:00Z. Must be from 0001-01-01T00:00:00Z to + # 9999-12-31T23:59:59Z inclusive. + # @!attribute [rw] nanos + # @return [::Integer] + # Non-negative fractions of a second at nanosecond resolution. Negative + # second values with fractions must still have non-negative nanos values + # that count forward in time. Must be from 0 to 999,999,999 + # inclusive. + class Timestamp + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end +end diff --git a/owl-bot-staging/google-cloud-scheduler-v1beta1/proto_docs/google/rpc/status.rb b/owl-bot-staging/google-cloud-scheduler-v1beta1/proto_docs/google/rpc/status.rb new file mode 100644 index 000000000000..c1a1c07eb2db --- /dev/null +++ b/owl-bot-staging/google-cloud-scheduler-v1beta1/proto_docs/google/rpc/status.rb @@ -0,0 +1,48 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + + +module Google + module Rpc + # The `Status` type defines a logical error model that is suitable for + # different programming environments, including REST APIs and RPC APIs. It is + # used by [gRPC](https://github.com/grpc). Each `Status` message contains + # three pieces of data: error code, error message, and error details. + # + # You can find out more about this error model and how to work with it in the + # [API Design Guide](https://cloud.google.com/apis/design/errors). + # @!attribute [rw] code + # @return [::Integer] + # The status code, which should be an enum value of + # [google.rpc.Code][google.rpc.Code]. + # @!attribute [rw] message + # @return [::String] + # A developer-facing error message, which should be in English. Any + # user-facing error message should be localized and sent in the + # {::Google::Rpc::Status#details google.rpc.Status.details} field, or localized + # by the client. + # @!attribute [rw] details + # @return [::Array<::Google::Protobuf::Any>] + # A list of messages that carry the error details. There is a common set of + # message types for APIs to use. + class Status + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end +end diff --git a/owl-bot-staging/google-cloud-scheduler-v1beta1/snippets/Gemfile b/owl-bot-staging/google-cloud-scheduler-v1beta1/snippets/Gemfile new file mode 100644 index 000000000000..6d51a2c203b3 --- /dev/null +++ b/owl-bot-staging/google-cloud-scheduler-v1beta1/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-scheduler-v1beta1", path: "../" +else + gem "google-cloud-scheduler-v1beta1" +end + +group :test do + gem "google-style", "~> 1.26.1" + gem "minitest", "~> 5.16" + gem "minitest-focus", "~> 1.1" + gem "minitest-hooks", "~> 1.5" +end diff --git a/owl-bot-staging/google-cloud-scheduler-v1beta1/snippets/cloud_scheduler/create_job.rb b/owl-bot-staging/google-cloud-scheduler-v1beta1/snippets/cloud_scheduler/create_job.rb new file mode 100644 index 000000000000..f5debf431a13 --- /dev/null +++ b/owl-bot-staging/google-cloud-scheduler-v1beta1/snippets/cloud_scheduler/create_job.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 cloudscheduler_v1beta1_generated_CloudScheduler_CreateJob_sync] +require "google/cloud/scheduler/v1beta1" + +## +# Snippet for the create_job call in the CloudScheduler service +# +# This snippet has been automatically generated and should be regarded as a code +# template only. It will require modifications to work: +# - It may require correct/in-range values for request initialization. +# - It may require specifying regional endpoints when creating the service +# client as shown in https://cloud.google.com/ruby/docs/reference. +# +# This is an auto-generated example demonstrating basic usage of +# Google::Cloud::Scheduler::V1beta1::CloudScheduler::Client#create_job. +# +def create_job + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Scheduler::V1beta1::CloudScheduler::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Scheduler::V1beta1::CreateJobRequest.new + + # Call the create_job method. + result = client.create_job request + + # The returned object is of type Google::Cloud::Scheduler::V1beta1::Job. + p result +end +# [END cloudscheduler_v1beta1_generated_CloudScheduler_CreateJob_sync] diff --git a/owl-bot-staging/google-cloud-scheduler-v1beta1/snippets/cloud_scheduler/delete_job.rb b/owl-bot-staging/google-cloud-scheduler-v1beta1/snippets/cloud_scheduler/delete_job.rb new file mode 100644 index 000000000000..413607c65dda --- /dev/null +++ b/owl-bot-staging/google-cloud-scheduler-v1beta1/snippets/cloud_scheduler/delete_job.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 cloudscheduler_v1beta1_generated_CloudScheduler_DeleteJob_sync] +require "google/cloud/scheduler/v1beta1" + +## +# Snippet for the delete_job call in the CloudScheduler service +# +# This snippet has been automatically generated and should be regarded as a code +# template only. It will require modifications to work: +# - It may require correct/in-range values for request initialization. +# - It may require specifying regional endpoints when creating the service +# client as shown in https://cloud.google.com/ruby/docs/reference. +# +# This is an auto-generated example demonstrating basic usage of +# Google::Cloud::Scheduler::V1beta1::CloudScheduler::Client#delete_job. +# +def delete_job + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Scheduler::V1beta1::CloudScheduler::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Scheduler::V1beta1::DeleteJobRequest.new + + # Call the delete_job method. + result = client.delete_job request + + # The returned object is of type Google::Protobuf::Empty. + p result +end +# [END cloudscheduler_v1beta1_generated_CloudScheduler_DeleteJob_sync] diff --git a/owl-bot-staging/google-cloud-scheduler-v1beta1/snippets/cloud_scheduler/get_job.rb b/owl-bot-staging/google-cloud-scheduler-v1beta1/snippets/cloud_scheduler/get_job.rb new file mode 100644 index 000000000000..a04df05772aa --- /dev/null +++ b/owl-bot-staging/google-cloud-scheduler-v1beta1/snippets/cloud_scheduler/get_job.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 cloudscheduler_v1beta1_generated_CloudScheduler_GetJob_sync] +require "google/cloud/scheduler/v1beta1" + +## +# Snippet for the get_job call in the CloudScheduler service +# +# This snippet has been automatically generated and should be regarded as a code +# template only. It will require modifications to work: +# - It may require correct/in-range values for request initialization. +# - It may require specifying regional endpoints when creating the service +# client as shown in https://cloud.google.com/ruby/docs/reference. +# +# This is an auto-generated example demonstrating basic usage of +# Google::Cloud::Scheduler::V1beta1::CloudScheduler::Client#get_job. +# +def get_job + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Scheduler::V1beta1::CloudScheduler::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Scheduler::V1beta1::GetJobRequest.new + + # Call the get_job method. + result = client.get_job request + + # The returned object is of type Google::Cloud::Scheduler::V1beta1::Job. + p result +end +# [END cloudscheduler_v1beta1_generated_CloudScheduler_GetJob_sync] diff --git a/owl-bot-staging/google-cloud-scheduler-v1beta1/snippets/cloud_scheduler/list_jobs.rb b/owl-bot-staging/google-cloud-scheduler-v1beta1/snippets/cloud_scheduler/list_jobs.rb new file mode 100644 index 000000000000..267d1483822a --- /dev/null +++ b/owl-bot-staging/google-cloud-scheduler-v1beta1/snippets/cloud_scheduler/list_jobs.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 cloudscheduler_v1beta1_generated_CloudScheduler_ListJobs_sync] +require "google/cloud/scheduler/v1beta1" + +## +# Snippet for the list_jobs call in the CloudScheduler service +# +# This snippet has been automatically generated and should be regarded as a code +# template only. It will require modifications to work: +# - It may require correct/in-range values for request initialization. +# - It may require specifying regional endpoints when creating the service +# client as shown in https://cloud.google.com/ruby/docs/reference. +# +# This is an auto-generated example demonstrating basic usage of +# Google::Cloud::Scheduler::V1beta1::CloudScheduler::Client#list_jobs. +# +def list_jobs + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Scheduler::V1beta1::CloudScheduler::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Scheduler::V1beta1::ListJobsRequest.new + + # Call the list_jobs method. + result = client.list_jobs request + + # The returned object is of type Gapic::PagedEnumerable. You can iterate + # over elements, and API calls will be issued to fetch pages as needed. + result.each do |item| + # Each element is of type ::Google::Cloud::Scheduler::V1beta1::Job. + p item + end +end +# [END cloudscheduler_v1beta1_generated_CloudScheduler_ListJobs_sync] diff --git a/owl-bot-staging/google-cloud-scheduler-v1beta1/snippets/cloud_scheduler/pause_job.rb b/owl-bot-staging/google-cloud-scheduler-v1beta1/snippets/cloud_scheduler/pause_job.rb new file mode 100644 index 000000000000..08bd32590153 --- /dev/null +++ b/owl-bot-staging/google-cloud-scheduler-v1beta1/snippets/cloud_scheduler/pause_job.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 cloudscheduler_v1beta1_generated_CloudScheduler_PauseJob_sync] +require "google/cloud/scheduler/v1beta1" + +## +# Snippet for the pause_job call in the CloudScheduler service +# +# This snippet has been automatically generated and should be regarded as a code +# template only. It will require modifications to work: +# - It may require correct/in-range values for request initialization. +# - It may require specifying regional endpoints when creating the service +# client as shown in https://cloud.google.com/ruby/docs/reference. +# +# This is an auto-generated example demonstrating basic usage of +# Google::Cloud::Scheduler::V1beta1::CloudScheduler::Client#pause_job. +# +def pause_job + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Scheduler::V1beta1::CloudScheduler::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Scheduler::V1beta1::PauseJobRequest.new + + # Call the pause_job method. + result = client.pause_job request + + # The returned object is of type Google::Cloud::Scheduler::V1beta1::Job. + p result +end +# [END cloudscheduler_v1beta1_generated_CloudScheduler_PauseJob_sync] diff --git a/owl-bot-staging/google-cloud-scheduler-v1beta1/snippets/cloud_scheduler/resume_job.rb b/owl-bot-staging/google-cloud-scheduler-v1beta1/snippets/cloud_scheduler/resume_job.rb new file mode 100644 index 000000000000..6c9575abc4e9 --- /dev/null +++ b/owl-bot-staging/google-cloud-scheduler-v1beta1/snippets/cloud_scheduler/resume_job.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 cloudscheduler_v1beta1_generated_CloudScheduler_ResumeJob_sync] +require "google/cloud/scheduler/v1beta1" + +## +# Snippet for the resume_job call in the CloudScheduler service +# +# This snippet has been automatically generated and should be regarded as a code +# template only. It will require modifications to work: +# - It may require correct/in-range values for request initialization. +# - It may require specifying regional endpoints when creating the service +# client as shown in https://cloud.google.com/ruby/docs/reference. +# +# This is an auto-generated example demonstrating basic usage of +# Google::Cloud::Scheduler::V1beta1::CloudScheduler::Client#resume_job. +# +def resume_job + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Scheduler::V1beta1::CloudScheduler::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Scheduler::V1beta1::ResumeJobRequest.new + + # Call the resume_job method. + result = client.resume_job request + + # The returned object is of type Google::Cloud::Scheduler::V1beta1::Job. + p result +end +# [END cloudscheduler_v1beta1_generated_CloudScheduler_ResumeJob_sync] diff --git a/owl-bot-staging/google-cloud-scheduler-v1beta1/snippets/cloud_scheduler/run_job.rb b/owl-bot-staging/google-cloud-scheduler-v1beta1/snippets/cloud_scheduler/run_job.rb new file mode 100644 index 000000000000..2e3b6b05363a --- /dev/null +++ b/owl-bot-staging/google-cloud-scheduler-v1beta1/snippets/cloud_scheduler/run_job.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 cloudscheduler_v1beta1_generated_CloudScheduler_RunJob_sync] +require "google/cloud/scheduler/v1beta1" + +## +# Snippet for the run_job call in the CloudScheduler service +# +# This snippet has been automatically generated and should be regarded as a code +# template only. It will require modifications to work: +# - It may require correct/in-range values for request initialization. +# - It may require specifying regional endpoints when creating the service +# client as shown in https://cloud.google.com/ruby/docs/reference. +# +# This is an auto-generated example demonstrating basic usage of +# Google::Cloud::Scheduler::V1beta1::CloudScheduler::Client#run_job. +# +def run_job + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Scheduler::V1beta1::CloudScheduler::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Scheduler::V1beta1::RunJobRequest.new + + # Call the run_job method. + result = client.run_job request + + # The returned object is of type Google::Cloud::Scheduler::V1beta1::Job. + p result +end +# [END cloudscheduler_v1beta1_generated_CloudScheduler_RunJob_sync] diff --git a/owl-bot-staging/google-cloud-scheduler-v1beta1/snippets/cloud_scheduler/update_job.rb b/owl-bot-staging/google-cloud-scheduler-v1beta1/snippets/cloud_scheduler/update_job.rb new file mode 100644 index 000000000000..ae2ca10a6e2f --- /dev/null +++ b/owl-bot-staging/google-cloud-scheduler-v1beta1/snippets/cloud_scheduler/update_job.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 cloudscheduler_v1beta1_generated_CloudScheduler_UpdateJob_sync] +require "google/cloud/scheduler/v1beta1" + +## +# Snippet for the update_job call in the CloudScheduler service +# +# This snippet has been automatically generated and should be regarded as a code +# template only. It will require modifications to work: +# - It may require correct/in-range values for request initialization. +# - It may require specifying regional endpoints when creating the service +# client as shown in https://cloud.google.com/ruby/docs/reference. +# +# This is an auto-generated example demonstrating basic usage of +# Google::Cloud::Scheduler::V1beta1::CloudScheduler::Client#update_job. +# +def update_job + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Scheduler::V1beta1::CloudScheduler::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Scheduler::V1beta1::UpdateJobRequest.new + + # Call the update_job method. + result = client.update_job request + + # The returned object is of type Google::Cloud::Scheduler::V1beta1::Job. + p result +end +# [END cloudscheduler_v1beta1_generated_CloudScheduler_UpdateJob_sync] diff --git a/owl-bot-staging/google-cloud-scheduler-v1beta1/snippets/snippet_metadata_google.cloud.scheduler.v1beta1.json b/owl-bot-staging/google-cloud-scheduler-v1beta1/snippets/snippet_metadata_google.cloud.scheduler.v1beta1.json new file mode 100644 index 000000000000..9b98a4f44978 --- /dev/null +++ b/owl-bot-staging/google-cloud-scheduler-v1beta1/snippets/snippet_metadata_google.cloud.scheduler.v1beta1.json @@ -0,0 +1,335 @@ +{ + "client_library": { + "name": "google-cloud-scheduler-v1beta1", + "version": "", + "language": "RUBY", + "apis": [ + { + "id": "google.cloud.scheduler.v1beta1", + "version": "v1beta1" + } + ] + }, + "snippets": [ + { + "region_tag": "cloudscheduler_v1beta1_generated_CloudScheduler_ListJobs_sync", + "title": "Snippet for the list_jobs call in the CloudScheduler service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Scheduler::V1beta1::CloudScheduler::Client#list_jobs.", + "file": "cloud_scheduler/list_jobs.rb", + "language": "RUBY", + "client_method": { + "short_name": "list_jobs", + "full_name": "::Google::Cloud::Scheduler::V1beta1::CloudScheduler::Client#list_jobs", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::Scheduler::V1beta1::ListJobsRequest", + "name": "request" + } + ], + "result_type": "::Google::Cloud::Scheduler::V1beta1::ListJobsResponse", + "client": { + "short_name": "CloudScheduler::Client", + "full_name": "::Google::Cloud::Scheduler::V1beta1::CloudScheduler::Client" + }, + "method": { + "short_name": "ListJobs", + "full_name": "google.cloud.scheduler.v1beta1.CloudScheduler.ListJobs", + "service": { + "short_name": "CloudScheduler", + "full_name": "google.cloud.scheduler.v1beta1.CloudScheduler" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 50, + "type": "FULL" + } + ] + }, + { + "region_tag": "cloudscheduler_v1beta1_generated_CloudScheduler_GetJob_sync", + "title": "Snippet for the get_job call in the CloudScheduler service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Scheduler::V1beta1::CloudScheduler::Client#get_job.", + "file": "cloud_scheduler/get_job.rb", + "language": "RUBY", + "client_method": { + "short_name": "get_job", + "full_name": "::Google::Cloud::Scheduler::V1beta1::CloudScheduler::Client#get_job", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::Scheduler::V1beta1::GetJobRequest", + "name": "request" + } + ], + "result_type": "::Google::Cloud::Scheduler::V1beta1::Job", + "client": { + "short_name": "CloudScheduler::Client", + "full_name": "::Google::Cloud::Scheduler::V1beta1::CloudScheduler::Client" + }, + "method": { + "short_name": "GetJob", + "full_name": "google.cloud.scheduler.v1beta1.CloudScheduler.GetJob", + "service": { + "short_name": "CloudScheduler", + "full_name": "google.cloud.scheduler.v1beta1.CloudScheduler" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 46, + "type": "FULL" + } + ] + }, + { + "region_tag": "cloudscheduler_v1beta1_generated_CloudScheduler_CreateJob_sync", + "title": "Snippet for the create_job call in the CloudScheduler service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Scheduler::V1beta1::CloudScheduler::Client#create_job.", + "file": "cloud_scheduler/create_job.rb", + "language": "RUBY", + "client_method": { + "short_name": "create_job", + "full_name": "::Google::Cloud::Scheduler::V1beta1::CloudScheduler::Client#create_job", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::Scheduler::V1beta1::CreateJobRequest", + "name": "request" + } + ], + "result_type": "::Google::Cloud::Scheduler::V1beta1::Job", + "client": { + "short_name": "CloudScheduler::Client", + "full_name": "::Google::Cloud::Scheduler::V1beta1::CloudScheduler::Client" + }, + "method": { + "short_name": "CreateJob", + "full_name": "google.cloud.scheduler.v1beta1.CloudScheduler.CreateJob", + "service": { + "short_name": "CloudScheduler", + "full_name": "google.cloud.scheduler.v1beta1.CloudScheduler" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 46, + "type": "FULL" + } + ] + }, + { + "region_tag": "cloudscheduler_v1beta1_generated_CloudScheduler_UpdateJob_sync", + "title": "Snippet for the update_job call in the CloudScheduler service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Scheduler::V1beta1::CloudScheduler::Client#update_job.", + "file": "cloud_scheduler/update_job.rb", + "language": "RUBY", + "client_method": { + "short_name": "update_job", + "full_name": "::Google::Cloud::Scheduler::V1beta1::CloudScheduler::Client#update_job", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::Scheduler::V1beta1::UpdateJobRequest", + "name": "request" + } + ], + "result_type": "::Google::Cloud::Scheduler::V1beta1::Job", + "client": { + "short_name": "CloudScheduler::Client", + "full_name": "::Google::Cloud::Scheduler::V1beta1::CloudScheduler::Client" + }, + "method": { + "short_name": "UpdateJob", + "full_name": "google.cloud.scheduler.v1beta1.CloudScheduler.UpdateJob", + "service": { + "short_name": "CloudScheduler", + "full_name": "google.cloud.scheduler.v1beta1.CloudScheduler" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 46, + "type": "FULL" + } + ] + }, + { + "region_tag": "cloudscheduler_v1beta1_generated_CloudScheduler_DeleteJob_sync", + "title": "Snippet for the delete_job call in the CloudScheduler service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Scheduler::V1beta1::CloudScheduler::Client#delete_job.", + "file": "cloud_scheduler/delete_job.rb", + "language": "RUBY", + "client_method": { + "short_name": "delete_job", + "full_name": "::Google::Cloud::Scheduler::V1beta1::CloudScheduler::Client#delete_job", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::Scheduler::V1beta1::DeleteJobRequest", + "name": "request" + } + ], + "result_type": "::Google::Protobuf::Empty", + "client": { + "short_name": "CloudScheduler::Client", + "full_name": "::Google::Cloud::Scheduler::V1beta1::CloudScheduler::Client" + }, + "method": { + "short_name": "DeleteJob", + "full_name": "google.cloud.scheduler.v1beta1.CloudScheduler.DeleteJob", + "service": { + "short_name": "CloudScheduler", + "full_name": "google.cloud.scheduler.v1beta1.CloudScheduler" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 46, + "type": "FULL" + } + ] + }, + { + "region_tag": "cloudscheduler_v1beta1_generated_CloudScheduler_PauseJob_sync", + "title": "Snippet for the pause_job call in the CloudScheduler service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Scheduler::V1beta1::CloudScheduler::Client#pause_job.", + "file": "cloud_scheduler/pause_job.rb", + "language": "RUBY", + "client_method": { + "short_name": "pause_job", + "full_name": "::Google::Cloud::Scheduler::V1beta1::CloudScheduler::Client#pause_job", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::Scheduler::V1beta1::PauseJobRequest", + "name": "request" + } + ], + "result_type": "::Google::Cloud::Scheduler::V1beta1::Job", + "client": { + "short_name": "CloudScheduler::Client", + "full_name": "::Google::Cloud::Scheduler::V1beta1::CloudScheduler::Client" + }, + "method": { + "short_name": "PauseJob", + "full_name": "google.cloud.scheduler.v1beta1.CloudScheduler.PauseJob", + "service": { + "short_name": "CloudScheduler", + "full_name": "google.cloud.scheduler.v1beta1.CloudScheduler" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 46, + "type": "FULL" + } + ] + }, + { + "region_tag": "cloudscheduler_v1beta1_generated_CloudScheduler_ResumeJob_sync", + "title": "Snippet for the resume_job call in the CloudScheduler service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Scheduler::V1beta1::CloudScheduler::Client#resume_job.", + "file": "cloud_scheduler/resume_job.rb", + "language": "RUBY", + "client_method": { + "short_name": "resume_job", + "full_name": "::Google::Cloud::Scheduler::V1beta1::CloudScheduler::Client#resume_job", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::Scheduler::V1beta1::ResumeJobRequest", + "name": "request" + } + ], + "result_type": "::Google::Cloud::Scheduler::V1beta1::Job", + "client": { + "short_name": "CloudScheduler::Client", + "full_name": "::Google::Cloud::Scheduler::V1beta1::CloudScheduler::Client" + }, + "method": { + "short_name": "ResumeJob", + "full_name": "google.cloud.scheduler.v1beta1.CloudScheduler.ResumeJob", + "service": { + "short_name": "CloudScheduler", + "full_name": "google.cloud.scheduler.v1beta1.CloudScheduler" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 46, + "type": "FULL" + } + ] + }, + { + "region_tag": "cloudscheduler_v1beta1_generated_CloudScheduler_RunJob_sync", + "title": "Snippet for the run_job call in the CloudScheduler service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Scheduler::V1beta1::CloudScheduler::Client#run_job.", + "file": "cloud_scheduler/run_job.rb", + "language": "RUBY", + "client_method": { + "short_name": "run_job", + "full_name": "::Google::Cloud::Scheduler::V1beta1::CloudScheduler::Client#run_job", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::Scheduler::V1beta1::RunJobRequest", + "name": "request" + } + ], + "result_type": "::Google::Cloud::Scheduler::V1beta1::Job", + "client": { + "short_name": "CloudScheduler::Client", + "full_name": "::Google::Cloud::Scheduler::V1beta1::CloudScheduler::Client" + }, + "method": { + "short_name": "RunJob", + "full_name": "google.cloud.scheduler.v1beta1.CloudScheduler.RunJob", + "service": { + "short_name": "CloudScheduler", + "full_name": "google.cloud.scheduler.v1beta1.CloudScheduler" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 46, + "type": "FULL" + } + ] + } + ] +} \ No newline at end of file diff --git a/owl-bot-staging/google-cloud-scheduler-v1beta1/test/google/cloud/scheduler/v1beta1/cloud_scheduler_paths_test.rb b/owl-bot-staging/google-cloud-scheduler-v1beta1/test/google/cloud/scheduler/v1beta1/cloud_scheduler_paths_test.rb new file mode 100644 index 000000000000..753de68473c5 --- /dev/null +++ b/owl-bot-staging/google-cloud-scheduler-v1beta1/test/google/cloud/scheduler/v1beta1/cloud_scheduler_paths_test.rb @@ -0,0 +1,79 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +require "helper" + +require "gapic/grpc/service_stub" + +require "google/cloud/scheduler/v1beta1/cloud_scheduler" + +class ::Google::Cloud::Scheduler::V1beta1::CloudScheduler::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_job_path + grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + ::Gapic::ServiceStub.stub :new, DummyStub.new do + client = ::Google::Cloud::Scheduler::V1beta1::CloudScheduler::Client.new do |config| + config.credentials = grpc_channel + end + + path = client.job_path project: "value0", location: "value1", job: "value2" + assert_equal "projects/value0/locations/value1/jobs/value2", path + end + end + + def test_location_path + grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + ::Gapic::ServiceStub.stub :new, DummyStub.new do + client = ::Google::Cloud::Scheduler::V1beta1::CloudScheduler::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_topic_path + grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + ::Gapic::ServiceStub.stub :new, DummyStub.new do + client = ::Google::Cloud::Scheduler::V1beta1::CloudScheduler::Client.new do |config| + config.credentials = grpc_channel + end + + path = client.topic_path project: "value0", topic: "value1" + assert_equal "projects/value0/topics/value1", path + end + end +end diff --git a/owl-bot-staging/google-cloud-scheduler-v1beta1/test/google/cloud/scheduler/v1beta1/cloud_scheduler_rest_test.rb b/owl-bot-staging/google-cloud-scheduler-v1beta1/test/google/cloud/scheduler/v1beta1/cloud_scheduler_rest_test.rb new file mode 100644 index 000000000000..f050bab21648 --- /dev/null +++ b/owl-bot-staging/google-cloud-scheduler-v1beta1/test/google/cloud/scheduler/v1beta1/cloud_scheduler_rest_test.rb @@ -0,0 +1,539 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +require "helper" +require "gapic/rest" +require "google/cloud/scheduler/v1beta1/cloudscheduler_pb" +require "google/cloud/scheduler/v1beta1/cloud_scheduler/rest" + + +class ::Google::Cloud::Scheduler::V1beta1::CloudScheduler::Rest::ClientTest < Minitest::Test + class ClientStub + attr_accessor :call_count, :requests + + def initialize response, &block + @response = response + @block = block + @call_count = 0 + @requests = [] + end + + def make_get_request uri:, params: {}, options: {}, method_name: nil + make_http_request :get, uri: uri, body: nil, params: params, options: options, method_name: method_name + end + + def make_delete_request uri:, params: {}, options: {}, method_name: nil + make_http_request :delete, uri: uri, body: nil, params: params, options: options, method_name: method_name + end + + def make_post_request uri:, body: nil, params: {}, options: {}, method_name: nil + make_http_request :post, uri: uri, body: body, params: params, options: options, method_name: method_name + end + + def make_patch_request uri:, body:, params: {}, options: {}, method_name: nil + make_http_request :patch, uri: uri, body: body, params: params, options: options, method_name: method_name + end + + def make_put_request uri:, body:, params: {}, options: {}, method_name: nil + make_http_request :put, uri: uri, body: body, params: params, options: options, method_name: method_name + end + + def make_http_request *args, **kwargs + @call_count += 1 + + @requests << @block&.call(*args, **kwargs) + + @response + end + + def endpoint + "endpoint.example.com" + end + + def universe_domain + "example.com" + end + + def stub_logger + nil + end + + def logger + nil + end + end + + def test_list_jobs + # Create test objects. + client_result = ::Google::Cloud::Scheduler::V1beta1::ListJobsResponse.new + http_response = OpenStruct.new body: client_result.to_json + + call_options = {} + + # Create request parameters for a unary method. + parent = "hello world" + filter = "hello world" + page_size = 42 + page_token = "hello world" + legacy_app_engine_cron = true + + list_jobs_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| + assert options.metadata.key? :"x-goog-api-client" + assert options.metadata[:"x-goog-api-client"].include? "rest" + refute options.metadata[:"x-goog-api-client"].include? "grpc" + end + + ::Google::Cloud::Scheduler::V1beta1::CloudScheduler::Rest::ServiceStub.stub :transcode_list_jobs_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, list_jobs_client_stub do + # Create client + client = ::Google::Cloud::Scheduler::V1beta1::CloudScheduler::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.list_jobs({ parent: parent, filter: filter, page_size: page_size, page_token: page_token, legacy_app_engine_cron: legacy_app_engine_cron }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.list_jobs parent: parent, filter: filter, page_size: page_size, page_token: page_token, legacy_app_engine_cron: legacy_app_engine_cron do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.list_jobs ::Google::Cloud::Scheduler::V1beta1::ListJobsRequest.new(parent: parent, filter: filter, page_size: page_size, page_token: page_token, legacy_app_engine_cron: legacy_app_engine_cron) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + client.list_jobs({ parent: parent, filter: filter, page_size: page_size, page_token: page_token, legacy_app_engine_cron: legacy_app_engine_cron }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + client.list_jobs(::Google::Cloud::Scheduler::V1beta1::ListJobsRequest.new(parent: parent, filter: filter, page_size: page_size, page_token: page_token, legacy_app_engine_cron: legacy_app_engine_cron), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, list_jobs_client_stub.call_count + end + end + end + + def test_get_job + # Create test objects. + client_result = ::Google::Cloud::Scheduler::V1beta1::Job.new + http_response = OpenStruct.new body: client_result.to_json + + call_options = {} + + # Create request parameters for a unary method. + name = "hello world" + + get_job_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| + assert options.metadata.key? :"x-goog-api-client" + assert options.metadata[:"x-goog-api-client"].include? "rest" + refute options.metadata[:"x-goog-api-client"].include? "grpc" + end + + ::Google::Cloud::Scheduler::V1beta1::CloudScheduler::Rest::ServiceStub.stub :transcode_get_job_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, get_job_client_stub do + # Create client + client = ::Google::Cloud::Scheduler::V1beta1::CloudScheduler::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.get_job({ name: name }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.get_job name: name do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.get_job ::Google::Cloud::Scheduler::V1beta1::GetJobRequest.new(name: name) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + client.get_job({ name: name }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + client.get_job(::Google::Cloud::Scheduler::V1beta1::GetJobRequest.new(name: name), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, get_job_client_stub.call_count + end + end + end + + def test_create_job + # Create test objects. + client_result = ::Google::Cloud::Scheduler::V1beta1::Job.new + http_response = OpenStruct.new body: client_result.to_json + + call_options = {} + + # Create request parameters for a unary method. + parent = "hello world" + job = {} + + create_job_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| + assert options.metadata.key? :"x-goog-api-client" + assert options.metadata[:"x-goog-api-client"].include? "rest" + refute options.metadata[:"x-goog-api-client"].include? "grpc" + end + + ::Google::Cloud::Scheduler::V1beta1::CloudScheduler::Rest::ServiceStub.stub :transcode_create_job_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, create_job_client_stub do + # Create client + client = ::Google::Cloud::Scheduler::V1beta1::CloudScheduler::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.create_job({ parent: parent, job: job }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.create_job parent: parent, job: job do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.create_job ::Google::Cloud::Scheduler::V1beta1::CreateJobRequest.new(parent: parent, job: job) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + client.create_job({ parent: parent, job: job }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + client.create_job(::Google::Cloud::Scheduler::V1beta1::CreateJobRequest.new(parent: parent, job: job), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, create_job_client_stub.call_count + end + end + end + + def test_update_job + # Create test objects. + client_result = ::Google::Cloud::Scheduler::V1beta1::Job.new + http_response = OpenStruct.new body: client_result.to_json + + call_options = {} + + # Create request parameters for a unary method. + job = {} + update_mask = {} + + update_job_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| + assert options.metadata.key? :"x-goog-api-client" + assert options.metadata[:"x-goog-api-client"].include? "rest" + refute options.metadata[:"x-goog-api-client"].include? "grpc" + end + + ::Google::Cloud::Scheduler::V1beta1::CloudScheduler::Rest::ServiceStub.stub :transcode_update_job_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, update_job_client_stub do + # Create client + client = ::Google::Cloud::Scheduler::V1beta1::CloudScheduler::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.update_job({ job: job, update_mask: update_mask }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.update_job job: job, update_mask: update_mask do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.update_job ::Google::Cloud::Scheduler::V1beta1::UpdateJobRequest.new(job: job, update_mask: update_mask) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + client.update_job({ job: job, update_mask: update_mask }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + client.update_job(::Google::Cloud::Scheduler::V1beta1::UpdateJobRequest.new(job: job, update_mask: update_mask), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, update_job_client_stub.call_count + end + end + end + + def test_delete_job + # Create test objects. + client_result = ::Google::Protobuf::Empty.new + http_response = OpenStruct.new body: client_result.to_json + + call_options = {} + + # Create request parameters for a unary method. + name = "hello world" + legacy_app_engine_cron = true + + delete_job_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| + assert options.metadata.key? :"x-goog-api-client" + assert options.metadata[:"x-goog-api-client"].include? "rest" + refute options.metadata[:"x-goog-api-client"].include? "grpc" + end + + ::Google::Cloud::Scheduler::V1beta1::CloudScheduler::Rest::ServiceStub.stub :transcode_delete_job_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, delete_job_client_stub do + # Create client + client = ::Google::Cloud::Scheduler::V1beta1::CloudScheduler::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.delete_job({ name: name, legacy_app_engine_cron: legacy_app_engine_cron }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.delete_job name: name, legacy_app_engine_cron: legacy_app_engine_cron do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.delete_job ::Google::Cloud::Scheduler::V1beta1::DeleteJobRequest.new(name: name, legacy_app_engine_cron: legacy_app_engine_cron) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + client.delete_job({ name: name, legacy_app_engine_cron: legacy_app_engine_cron }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + client.delete_job(::Google::Cloud::Scheduler::V1beta1::DeleteJobRequest.new(name: name, legacy_app_engine_cron: legacy_app_engine_cron), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, delete_job_client_stub.call_count + end + end + end + + def test_pause_job + # Create test objects. + client_result = ::Google::Cloud::Scheduler::V1beta1::Job.new + http_response = OpenStruct.new body: client_result.to_json + + call_options = {} + + # Create request parameters for a unary method. + name = "hello world" + + pause_job_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| + assert options.metadata.key? :"x-goog-api-client" + assert options.metadata[:"x-goog-api-client"].include? "rest" + refute options.metadata[:"x-goog-api-client"].include? "grpc" + end + + ::Google::Cloud::Scheduler::V1beta1::CloudScheduler::Rest::ServiceStub.stub :transcode_pause_job_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, pause_job_client_stub do + # Create client + client = ::Google::Cloud::Scheduler::V1beta1::CloudScheduler::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.pause_job({ name: name }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.pause_job name: name do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.pause_job ::Google::Cloud::Scheduler::V1beta1::PauseJobRequest.new(name: name) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + client.pause_job({ name: name }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + client.pause_job(::Google::Cloud::Scheduler::V1beta1::PauseJobRequest.new(name: name), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, pause_job_client_stub.call_count + end + end + end + + def test_resume_job + # Create test objects. + client_result = ::Google::Cloud::Scheduler::V1beta1::Job.new + http_response = OpenStruct.new body: client_result.to_json + + call_options = {} + + # Create request parameters for a unary method. + name = "hello world" + + resume_job_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| + assert options.metadata.key? :"x-goog-api-client" + assert options.metadata[:"x-goog-api-client"].include? "rest" + refute options.metadata[:"x-goog-api-client"].include? "grpc" + end + + ::Google::Cloud::Scheduler::V1beta1::CloudScheduler::Rest::ServiceStub.stub :transcode_resume_job_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, resume_job_client_stub do + # Create client + client = ::Google::Cloud::Scheduler::V1beta1::CloudScheduler::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.resume_job({ name: name }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.resume_job name: name do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.resume_job ::Google::Cloud::Scheduler::V1beta1::ResumeJobRequest.new(name: name) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + client.resume_job({ name: name }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + client.resume_job(::Google::Cloud::Scheduler::V1beta1::ResumeJobRequest.new(name: name), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, resume_job_client_stub.call_count + end + end + end + + def test_run_job + # Create test objects. + client_result = ::Google::Cloud::Scheduler::V1beta1::Job.new + http_response = OpenStruct.new body: client_result.to_json + + call_options = {} + + # Create request parameters for a unary method. + name = "hello world" + legacy_app_engine_cron = true + + run_job_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| + assert options.metadata.key? :"x-goog-api-client" + assert options.metadata[:"x-goog-api-client"].include? "rest" + refute options.metadata[:"x-goog-api-client"].include? "grpc" + end + + ::Google::Cloud::Scheduler::V1beta1::CloudScheduler::Rest::ServiceStub.stub :transcode_run_job_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, run_job_client_stub do + # Create client + client = ::Google::Cloud::Scheduler::V1beta1::CloudScheduler::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.run_job({ name: name, legacy_app_engine_cron: legacy_app_engine_cron }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.run_job name: name, legacy_app_engine_cron: legacy_app_engine_cron do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.run_job ::Google::Cloud::Scheduler::V1beta1::RunJobRequest.new(name: name, legacy_app_engine_cron: legacy_app_engine_cron) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + client.run_job({ name: name, legacy_app_engine_cron: legacy_app_engine_cron }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + client.run_job(::Google::Cloud::Scheduler::V1beta1::RunJobRequest.new(name: name, legacy_app_engine_cron: legacy_app_engine_cron), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, run_job_client_stub.call_count + end + end + end + + def test_configure + credentials_token = :dummy_value + + client = block_config = config = nil + dummy_stub = ClientStub.new nil + Gapic::Rest::ClientStub.stub :new, dummy_stub do + client = ::Google::Cloud::Scheduler::V1beta1::CloudScheduler::Rest::Client.new do |config| + config.credentials = credentials_token + end + end + + config = client.configure do |c| + block_config = c + end + + assert_same block_config, config + assert_kind_of ::Google::Cloud::Scheduler::V1beta1::CloudScheduler::Rest::Client::Configuration, config + end +end diff --git a/owl-bot-staging/google-cloud-scheduler-v1beta1/test/google/cloud/scheduler/v1beta1/cloud_scheduler_test.rb b/owl-bot-staging/google-cloud-scheduler-v1beta1/test/google/cloud/scheduler/v1beta1/cloud_scheduler_test.rb new file mode 100644 index 000000000000..847aeedfb1c4 --- /dev/null +++ b/owl-bot-staging/google-cloud-scheduler-v1beta1/test/google/cloud/scheduler/v1beta1/cloud_scheduler_test.rb @@ -0,0 +1,589 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +require "helper" + +require "gapic/grpc/service_stub" + +require "google/cloud/scheduler/v1beta1/cloudscheduler_pb" +require "google/cloud/scheduler/v1beta1/cloud_scheduler" + +class ::Google::Cloud::Scheduler::V1beta1::CloudScheduler::ClientTest < Minitest::Test + class ClientStub + attr_accessor :call_rpc_count, :requests + + def initialize response, operation, &block + @response = response + @operation = operation + @block = block + @call_rpc_count = 0 + @requests = [] + end + + def call_rpc *args, **kwargs + @call_rpc_count += 1 + + @requests << @block&.call(*args, **kwargs) + + catch :response do + yield @response, @operation if block_given? + @response + end + end + + def endpoint + "endpoint.example.com" + end + + def universe_domain + "example.com" + end + + def stub_logger + nil + end + + def logger + nil + end + end + + def test_list_jobs + # Create GRPC objects. + grpc_response = ::Google::Cloud::Scheduler::V1beta1::ListJobsResponse.new + grpc_operation = GRPC::ActiveCall::Operation.new nil + grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + grpc_options = {} + + # Create request parameters for a unary method. + parent = "hello world" + filter = "hello world" + page_size = 42 + page_token = "hello world" + legacy_app_engine_cron = true + + list_jobs_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :list_jobs, name + assert_kind_of ::Google::Cloud::Scheduler::V1beta1::ListJobsRequest, request + assert_equal "hello world", request["parent"] + assert_equal "hello world", request["filter"] + assert_equal 42, request["page_size"] + assert_equal "hello world", request["page_token"] + assert_equal true, request["legacy_app_engine_cron"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, list_jobs_client_stub do + # Create client + client = ::Google::Cloud::Scheduler::V1beta1::CloudScheduler::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.list_jobs({ parent: parent, filter: filter, page_size: page_size, page_token: page_token, legacy_app_engine_cron: legacy_app_engine_cron }) do |response, operation| + assert_kind_of Gapic::PagedEnumerable, response + assert_equal grpc_response, response.response + assert_equal grpc_operation, operation + end + + # Use named arguments + client.list_jobs parent: parent, filter: filter, page_size: page_size, page_token: page_token, legacy_app_engine_cron: legacy_app_engine_cron do |response, operation| + assert_kind_of Gapic::PagedEnumerable, response + assert_equal grpc_response, response.response + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.list_jobs ::Google::Cloud::Scheduler::V1beta1::ListJobsRequest.new(parent: parent, filter: filter, page_size: page_size, page_token: page_token, legacy_app_engine_cron: legacy_app_engine_cron) do |response, operation| + assert_kind_of Gapic::PagedEnumerable, response + assert_equal grpc_response, response.response + assert_equal grpc_operation, operation + end + + # Use hash object with options + client.list_jobs({ parent: parent, filter: filter, page_size: page_size, page_token: page_token, legacy_app_engine_cron: legacy_app_engine_cron }, grpc_options) do |response, operation| + assert_kind_of Gapic::PagedEnumerable, response + assert_equal grpc_response, response.response + assert_equal grpc_operation, operation + end + + # Use protobuf object with options + client.list_jobs(::Google::Cloud::Scheduler::V1beta1::ListJobsRequest.new(parent: parent, filter: filter, page_size: page_size, page_token: page_token, legacy_app_engine_cron: legacy_app_engine_cron), grpc_options) do |response, operation| + assert_kind_of Gapic::PagedEnumerable, response + assert_equal grpc_response, response.response + assert_equal grpc_operation, operation + end + + # Verify method calls + assert_equal 5, list_jobs_client_stub.call_rpc_count + end + end + + def test_get_job + # Create GRPC objects. + grpc_response = ::Google::Cloud::Scheduler::V1beta1::Job.new + grpc_operation = GRPC::ActiveCall::Operation.new nil + grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + grpc_options = {} + + # Create request parameters for a unary method. + name = "hello world" + + get_job_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :get_job, name + assert_kind_of ::Google::Cloud::Scheduler::V1beta1::GetJobRequest, request + assert_equal "hello world", request["name"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, get_job_client_stub do + # Create client + client = ::Google::Cloud::Scheduler::V1beta1::CloudScheduler::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.get_job({ name: name }) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use named arguments + client.get_job name: name do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.get_job ::Google::Cloud::Scheduler::V1beta1::GetJobRequest.new(name: name) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use hash object with options + client.get_job({ name: name }, grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object with options + client.get_job(::Google::Cloud::Scheduler::V1beta1::GetJobRequest.new(name: name), grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Verify method calls + assert_equal 5, get_job_client_stub.call_rpc_count + end + end + + def test_create_job + # Create GRPC objects. + grpc_response = ::Google::Cloud::Scheduler::V1beta1::Job.new + grpc_operation = GRPC::ActiveCall::Operation.new nil + grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + grpc_options = {} + + # Create request parameters for a unary method. + parent = "hello world" + job = {} + + create_job_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :create_job, name + assert_kind_of ::Google::Cloud::Scheduler::V1beta1::CreateJobRequest, request + assert_equal "hello world", request["parent"] + assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::Scheduler::V1beta1::Job), request["job"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, create_job_client_stub do + # Create client + client = ::Google::Cloud::Scheduler::V1beta1::CloudScheduler::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.create_job({ parent: parent, job: job }) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use named arguments + client.create_job parent: parent, job: job do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.create_job ::Google::Cloud::Scheduler::V1beta1::CreateJobRequest.new(parent: parent, job: job) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use hash object with options + client.create_job({ parent: parent, job: job }, grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object with options + client.create_job(::Google::Cloud::Scheduler::V1beta1::CreateJobRequest.new(parent: parent, job: job), grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Verify method calls + assert_equal 5, create_job_client_stub.call_rpc_count + end + end + + def test_update_job + # Create GRPC objects. + grpc_response = ::Google::Cloud::Scheduler::V1beta1::Job.new + grpc_operation = GRPC::ActiveCall::Operation.new nil + grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + grpc_options = {} + + # Create request parameters for a unary method. + job = {} + update_mask = {} + + update_job_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :update_job, name + assert_kind_of ::Google::Cloud::Scheduler::V1beta1::UpdateJobRequest, request + assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::Scheduler::V1beta1::Job), request["job"] + assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Protobuf::FieldMask), request["update_mask"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, update_job_client_stub do + # Create client + client = ::Google::Cloud::Scheduler::V1beta1::CloudScheduler::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.update_job({ job: job, update_mask: update_mask }) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use named arguments + client.update_job job: job, update_mask: update_mask do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.update_job ::Google::Cloud::Scheduler::V1beta1::UpdateJobRequest.new(job: job, update_mask: update_mask) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use hash object with options + client.update_job({ job: job, update_mask: update_mask }, grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object with options + client.update_job(::Google::Cloud::Scheduler::V1beta1::UpdateJobRequest.new(job: job, update_mask: update_mask), grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Verify method calls + assert_equal 5, update_job_client_stub.call_rpc_count + end + end + + def test_delete_job + # 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" + legacy_app_engine_cron = true + + delete_job_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :delete_job, name + assert_kind_of ::Google::Cloud::Scheduler::V1beta1::DeleteJobRequest, request + assert_equal "hello world", request["name"] + assert_equal true, request["legacy_app_engine_cron"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, delete_job_client_stub do + # Create client + client = ::Google::Cloud::Scheduler::V1beta1::CloudScheduler::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.delete_job({ name: name, legacy_app_engine_cron: legacy_app_engine_cron }) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use named arguments + client.delete_job name: name, legacy_app_engine_cron: legacy_app_engine_cron do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.delete_job ::Google::Cloud::Scheduler::V1beta1::DeleteJobRequest.new(name: name, legacy_app_engine_cron: legacy_app_engine_cron) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use hash object with options + client.delete_job({ name: name, legacy_app_engine_cron: legacy_app_engine_cron }, grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object with options + client.delete_job(::Google::Cloud::Scheduler::V1beta1::DeleteJobRequest.new(name: name, legacy_app_engine_cron: legacy_app_engine_cron), grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Verify method calls + assert_equal 5, delete_job_client_stub.call_rpc_count + end + end + + def test_pause_job + # Create GRPC objects. + grpc_response = ::Google::Cloud::Scheduler::V1beta1::Job.new + grpc_operation = GRPC::ActiveCall::Operation.new nil + grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + grpc_options = {} + + # Create request parameters for a unary method. + name = "hello world" + + pause_job_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :pause_job, name + assert_kind_of ::Google::Cloud::Scheduler::V1beta1::PauseJobRequest, request + assert_equal "hello world", request["name"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, pause_job_client_stub do + # Create client + client = ::Google::Cloud::Scheduler::V1beta1::CloudScheduler::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.pause_job({ name: name }) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use named arguments + client.pause_job name: name do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.pause_job ::Google::Cloud::Scheduler::V1beta1::PauseJobRequest.new(name: name) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use hash object with options + client.pause_job({ name: name }, grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object with options + client.pause_job(::Google::Cloud::Scheduler::V1beta1::PauseJobRequest.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, pause_job_client_stub.call_rpc_count + end + end + + def test_resume_job + # Create GRPC objects. + grpc_response = ::Google::Cloud::Scheduler::V1beta1::Job.new + grpc_operation = GRPC::ActiveCall::Operation.new nil + grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + grpc_options = {} + + # Create request parameters for a unary method. + name = "hello world" + + resume_job_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :resume_job, name + assert_kind_of ::Google::Cloud::Scheduler::V1beta1::ResumeJobRequest, request + assert_equal "hello world", request["name"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, resume_job_client_stub do + # Create client + client = ::Google::Cloud::Scheduler::V1beta1::CloudScheduler::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.resume_job({ name: name }) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use named arguments + client.resume_job name: name do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.resume_job ::Google::Cloud::Scheduler::V1beta1::ResumeJobRequest.new(name: name) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use hash object with options + client.resume_job({ name: name }, grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object with options + client.resume_job(::Google::Cloud::Scheduler::V1beta1::ResumeJobRequest.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, resume_job_client_stub.call_rpc_count + end + end + + def test_run_job + # Create GRPC objects. + grpc_response = ::Google::Cloud::Scheduler::V1beta1::Job.new + grpc_operation = GRPC::ActiveCall::Operation.new nil + grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + grpc_options = {} + + # Create request parameters for a unary method. + name = "hello world" + legacy_app_engine_cron = true + + run_job_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :run_job, name + assert_kind_of ::Google::Cloud::Scheduler::V1beta1::RunJobRequest, request + assert_equal "hello world", request["name"] + assert_equal true, request["legacy_app_engine_cron"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, run_job_client_stub do + # Create client + client = ::Google::Cloud::Scheduler::V1beta1::CloudScheduler::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.run_job({ name: name, legacy_app_engine_cron: legacy_app_engine_cron }) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use named arguments + client.run_job name: name, legacy_app_engine_cron: legacy_app_engine_cron do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.run_job ::Google::Cloud::Scheduler::V1beta1::RunJobRequest.new(name: name, legacy_app_engine_cron: legacy_app_engine_cron) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use hash object with options + client.run_job({ name: name, legacy_app_engine_cron: legacy_app_engine_cron }, grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object with options + client.run_job(::Google::Cloud::Scheduler::V1beta1::RunJobRequest.new(name: name, legacy_app_engine_cron: legacy_app_engine_cron), grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Verify method calls + assert_equal 5, run_job_client_stub.call_rpc_count + end + end + + def test_configure + grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + + client = block_config = config = nil + dummy_stub = ClientStub.new nil, nil + Gapic::ServiceStub.stub :new, dummy_stub do + client = ::Google::Cloud::Scheduler::V1beta1::CloudScheduler::Client.new do |config| + config.credentials = grpc_channel + end + end + + config = client.configure do |c| + block_config = c + end + + assert_same block_config, config + assert_kind_of ::Google::Cloud::Scheduler::V1beta1::CloudScheduler::Client::Configuration, config + end + + def test_credentials + key = OpenSSL::PKey::RSA.new 2048 + cred_json = { + "private_key" => key.to_pem, + "client_email" => "app@developer.gserviceaccount.com", + "type" => "service_account" + } + key_file = StringIO.new cred_json.to_json + creds = Google::Auth::ServiceAccountCredentials.make_creds({ json_key_io: key_file }) + + dummy_stub = ClientStub.new nil, nil + Gapic::ServiceStub.stub :new, dummy_stub do + client = ::Google::Cloud::Scheduler::V1beta1::CloudScheduler::Client.new do |config| + config.credentials = creds + end + assert_kind_of ::Google::Cloud::Scheduler::V1beta1::CloudScheduler::Client, client + assert_equal creds, client.configure.credentials + end + end +end diff --git a/owl-bot-staging/google-cloud-scheduler-v1beta1/test/helper.rb b/owl-bot-staging/google-cloud-scheduler-v1beta1/test/helper.rb new file mode 100644 index 000000000000..672b337030e7 --- /dev/null +++ b/owl-bot-staging/google-cloud-scheduler-v1beta1/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" diff --git a/owl-bot-staging/google-cloud-secret_manager-v1/.gitignore b/owl-bot-staging/google-cloud-secret_manager-v1/.gitignore new file mode 100644 index 000000000000..0135b6bc6cfc --- /dev/null +++ b/owl-bot-staging/google-cloud-secret_manager-v1/.gitignore @@ -0,0 +1,22 @@ +# Ignore bundler lockfiles +Gemfile.lock +gems.locked + +# Ignore documentation output +doc/* +.yardoc/* + +# Ignore test output +coverage/* + +# Ignore build artifacts +pkg/* + +# Ignore files commonly present in certain dev environments +.vagrant +.DS_STORE +.idea +*.iml + +# Ignore synth output +__pycache__ diff --git a/owl-bot-staging/google-cloud-secret_manager-v1/.repo-metadata.json b/owl-bot-staging/google-cloud-secret_manager-v1/.repo-metadata.json new file mode 100644 index 000000000000..828476632af4 --- /dev/null +++ b/owl-bot-staging/google-cloud-secret_manager-v1/.repo-metadata.json @@ -0,0 +1,18 @@ +{ + "api_id": "secretmanager.googleapis.com", + "api_shortname": "secretmanager", + "client_documentation": "https://cloud.google.com/ruby/docs/reference/google-cloud-secret_manager-v1/latest", + "distribution_name": "google-cloud-secret_manager-v1", + "is_cloud": true, + "language": "ruby", + "name": "secretmanager", + "name_pretty": "Secret Manager V1 API", + "product_documentation": "https://cloud.google.com/secret-manager", + "release_level": "unreleased", + "repo": "googleapis/google-cloud-ruby", + "requires_billing": true, + "ruby-cloud-description": "Secret Manager is a secure and convenient storage system for API keys, passwords, certificates, and other sensitive data. Secret Manager provides a central place and single source of truth to manage, access, and audit secrets across Google Cloud. Note that google-cloud-secret_manager-v1 is a version-specific client library. For most uses, we recommend installing the main client library google-cloud-secret_manager instead. See the readme for more details.", + "ruby-cloud-env-prefix": "SECRET_MANAGER", + "ruby-cloud-product-url": "https://cloud.google.com/secret-manager", + "library_type": "GAPIC_AUTO" +} diff --git a/owl-bot-staging/google-cloud-secret_manager-v1/.rubocop.yml b/owl-bot-staging/google-cloud-secret_manager-v1/.rubocop.yml new file mode 100644 index 000000000000..2600ed75e42a --- /dev/null +++ b/owl-bot-staging/google-cloud-secret_manager-v1/.rubocop.yml @@ -0,0 +1,33 @@ +inherit_gem: + google-style: google-style.yml + +AllCops: + Exclude: + - "google-cloud-secret_manager-v1.gemspec" + - "lib/**/*_pb.rb" + - "proto_docs/**/*" + - "test/**/*" + - "acceptance/**/*" + - "samples/acceptance/**/*" + - "Rakefile" + +Layout/LineLength: + Enabled: false +Metrics/AbcSize: + Enabled: false +Metrics/ClassLength: + Enabled: false +Metrics/CyclomaticComplexity: + Enabled: false +Metrics/MethodLength: + Enabled: false +Metrics/ModuleLength: + Enabled: false +Metrics/PerceivedComplexity: + Enabled: false +Naming/AccessorMethodName: + Exclude: + - "snippets/**/*.rb" +Naming/FileName: + Exclude: + - "lib/google-cloud-secret_manager-v1.rb" diff --git a/owl-bot-staging/google-cloud-secret_manager-v1/.toys.rb b/owl-bot-staging/google-cloud-secret_manager-v1/.toys.rb new file mode 100644 index 000000000000..177e22456e8a --- /dev/null +++ b/owl-bot-staging/google-cloud-secret_manager-v1/.toys.rb @@ -0,0 +1,28 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +toys_version! ">= 0.15.3" + +if ENV["RUBY_COMMON_TOOLS"] + common_tools_dir = File.expand_path ENV["RUBY_COMMON_TOOLS"] + load File.join(common_tools_dir, "toys", "gapic") +else + load_git remote: "https://github.com/googleapis/ruby-common-tools.git", + path: "toys/gapic", + update: true +end diff --git a/owl-bot-staging/google-cloud-secret_manager-v1/.yardopts b/owl-bot-staging/google-cloud-secret_manager-v1/.yardopts new file mode 100644 index 000000000000..6a5817faa0dc --- /dev/null +++ b/owl-bot-staging/google-cloud-secret_manager-v1/.yardopts @@ -0,0 +1,12 @@ +--no-private +--title="Secret Manager V1 API" +--exclude _pb\.rb$ +--markup markdown +--markup-provider redcarpet + +./lib/**/*.rb +./proto_docs/**/*.rb +- +README.md +LICENSE.md +AUTHENTICATION.md diff --git a/owl-bot-staging/google-cloud-secret_manager-v1/AUTHENTICATION.md b/owl-bot-staging/google-cloud-secret_manager-v1/AUTHENTICATION.md new file mode 100644 index 000000000000..6ba9773b1dc0 --- /dev/null +++ b/owl-bot-staging/google-cloud-secret_manager-v1/AUTHENTICATION.md @@ -0,0 +1,122 @@ +# Authentication + +The recommended way to authenticate to the google-cloud-secret_manager-v1 library is to use +[Application Default Credentials (ADC)](https://cloud.google.com/docs/authentication/application-default-credentials). +To review all of your authentication options, see [Credentials lookup](#credential-lookup). + +## Quickstart + +The following example shows how to set up authentication for a local development +environment with your user credentials. + +**NOTE:** This method is _not_ recommended for running in production. User credentials +should be used only during development. + +1. [Download and install the Google Cloud CLI](https://cloud.google.com/sdk). +2. Set up a local ADC file with your user credentials: + +```sh +gcloud auth application-default login +``` + +3. Write code as if already authenticated. + +For more information about setting up authentication for a local development environment, see +[Set up Application Default Credentials](https://cloud.google.com/docs/authentication/provide-credentials-adc#local-dev). + +## Credential Lookup + +The google-cloud-secret_manager-v1 library provides several mechanisms to configure your system. +Generally, using Application Default Credentials to facilitate automatic +credentials discovery is the easist method. But if you need to explicitly specify +credentials, there are several methods available to you. + +Credentials are accepted in the following ways, in the following order or precedence: + +1. Credentials specified in method arguments +2. Credentials specified in configuration +3. Credentials pointed to or included in environment variables +4. Credentials found in local ADC file +5. Credentials returned by the metadata server for the attached service account (GCP) + +### Configuration + +You can configure a path to a JSON credentials file, either for an individual client object or +globally, for all client objects. The JSON file can contain credentials created for +[workload identity federation](https://cloud.google.com/iam/docs/workload-identity-federation), +[workforce identity federation](https://cloud.google.com/iam/docs/workforce-identity-federation), or a +[service account key](https://cloud.google.com/docs/authentication/provide-credentials-adc#local-key). + +Note: Service account keys are a security risk if not managed correctly. You should +[choose a more secure alternative to service account keys](https://cloud.google.com/docs/authentication#auth-decision-tree) +whenever possible. + +To configure a credentials file for an individual client initialization: + +```ruby +require "google/cloud/secret_manager/v1" + +client = ::Google::Cloud::SecretManager::V1::SecretManagerService::Client.new do |config| + config.credentials = "path/to/credentialfile.json" +end +``` + +To configure a credentials file globally for all clients: + +```ruby +require "google/cloud/secret_manager/v1" + +::Google::Cloud::SecretManager::V1::SecretManagerService::Client.configure do |config| + config.credentials = "path/to/credentialfile.json" +end + +client = ::Google::Cloud::SecretManager::V1::SecretManagerService::Client.new +``` + +### Environment Variables + +You can also use an environment variable to provide a JSON credentials file. +The environment variable can contain a path to the credentials file or, for +environments such as Docker containers where writing files is not encouraged, +you can include the credentials file itself. + +The JSON file can contain credentials created for +[workload identity federation](https://cloud.google.com/iam/docs/workload-identity-federation), +[workforce identity federation](https://cloud.google.com/iam/docs/workforce-identity-federation), or a +[service account key](https://cloud.google.com/docs/authentication/provide-credentials-adc#local-key). + +Note: Service account keys are a security risk if not managed correctly. You should +[choose a more secure alternative to service account keys](https://cloud.google.com/docs/authentication#auth-decision-tree) +whenever possible. + +The environment variables that google-cloud-secret_manager-v1 +checks for credentials are: + +* `GOOGLE_CLOUD_CREDENTIALS` - Path to JSON file, or JSON contents +* `GOOGLE_APPLICATION_CREDENTIALS` - Path to JSON file + +```ruby +require "google/cloud/secret_manager/v1" + +ENV["GOOGLE_APPLICATION_CREDENTIALS"] = "path/to/credentialfile.json" + +client = ::Google::Cloud::SecretManager::V1::SecretManagerService::Client.new +``` + +### Local ADC file + +You can set up a local ADC file with your user credentials for authentication during +development. If credentials are not provided in code or in environment variables, +then the local ADC credentials are discovered. + +Follow the steps in [Quickstart](#quickstart) to set up a local ADC file. + +### Google Cloud Platform environments + +When running on Google Cloud Platform (GCP), including Google Compute Engine +(GCE), Google Kubernetes Engine (GKE), Google App Engine (GAE), Google Cloud +Functions (GCF) and Cloud Run, credentials are retrieved from the attached +service account automatically. Code should be written as if already authenticated. + +For more information, see +[Set up ADC for Google Cloud services](https://cloud.google.com/docs/authentication/provide-credentials-adc#attached-sa). diff --git a/owl-bot-staging/google-cloud-secret_manager-v1/CHANGELOG.md b/owl-bot-staging/google-cloud-secret_manager-v1/CHANGELOG.md new file mode 100644 index 000000000000..f88957a62ba2 --- /dev/null +++ b/owl-bot-staging/google-cloud-secret_manager-v1/CHANGELOG.md @@ -0,0 +1,2 @@ +# Release History + diff --git a/owl-bot-staging/google-cloud-secret_manager-v1/Gemfile b/owl-bot-staging/google-cloud-secret_manager-v1/Gemfile new file mode 100644 index 000000000000..1d08558908d8 --- /dev/null +++ b/owl-bot-staging/google-cloud-secret_manager-v1/Gemfile @@ -0,0 +1,14 @@ +source "https://rubygems.org" + +gemspec + +gem "google-style", "~> 1.32.0" +gem "irb", "~> 1.17" +gem "minitest", "~> 6.0.2" +gem "minitest-focus", "~> 1.4" +gem "minitest-mock", "~> 5.27" +gem "minitest-rg", "~> 5.3" +gem "ostruct", "~> 0.5.5" +gem "rake", ">= 13.0" +gem "redcarpet", "~> 3.6" +gem "yard", "~> 0.9" diff --git a/owl-bot-staging/google-cloud-secret_manager-v1/LICENSE.md b/owl-bot-staging/google-cloud-secret_manager-v1/LICENSE.md new file mode 100644 index 000000000000..c261857ba6ad --- /dev/null +++ b/owl-bot-staging/google-cloud-secret_manager-v1/LICENSE.md @@ -0,0 +1,201 @@ + Apache License + Version 2.0, January 2004 + http://www.apache.org/licenses/ + + TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION + + 1. Definitions. + + "License" shall mean the terms and conditions for use, reproduction, + and distribution as defined by Sections 1 through 9 of this document. + + "Licensor" shall mean the copyright owner or entity authorized by + the copyright owner that is granting the License. + + "Legal Entity" shall mean the union of the acting entity and all + other entities that control, are controlled by, or are under common + control with that entity. For the purposes of this definition, + "control" means (i) the power, direct or indirect, to cause the + direction or management of such entity, whether by contract or + otherwise, or (ii) ownership of fifty percent (50%) or more of the + outstanding shares, or (iii) beneficial ownership of such entity. + + "You" (or "Your") shall mean an individual or Legal Entity + exercising permissions granted by this License. + + "Source" form shall mean the preferred form for making modifications, + including but not limited to software source code, documentation + source, and configuration files. + + "Object" form shall mean any form resulting from mechanical + transformation or translation of a Source form, including but + not limited to compiled object code, generated documentation, + and conversions to other media types. + + "Work" shall mean the work of authorship, whether in Source or + Object form, made available under the License, as indicated by a + copyright notice that is included in or attached to the work + (an example is provided in the Appendix below). + + "Derivative Works" shall mean any work, whether in Source or Object + form, that is based on (or derived from) the Work and for which the + editorial revisions, annotations, elaborations, or other modifications + represent, as a whole, an original work of authorship. For the purposes + of this License, Derivative Works shall not include works that remain + separable from, or merely link (or bind by name) to the interfaces of, + the Work and Derivative Works thereof. + + "Contribution" shall mean any work of authorship, including + the original version of the Work and any modifications or additions + to that Work or Derivative Works thereof, that is intentionally + submitted to Licensor for inclusion in the Work by the copyright owner + or by an individual or Legal Entity authorized to submit on behalf of + the copyright owner. For the purposes of this definition, "submitted" + means any form of electronic, verbal, or written communication sent + to the Licensor or its representatives, including but not limited to + communication on electronic mailing lists, source code control systems, + and issue tracking systems that are managed by, or on behalf of, the + Licensor for the purpose of discussing and improving the Work, but + excluding communication that is conspicuously marked or otherwise + designated in writing by the copyright owner as "Not a Contribution." + + "Contributor" shall mean Licensor and any individual or Legal Entity + on behalf of whom a Contribution has been received by Licensor and + subsequently incorporated within the Work. + + 2. Grant of Copyright License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + copyright license to reproduce, prepare Derivative Works of, + publicly display, publicly perform, sublicense, and distribute the + Work and such Derivative Works in Source or Object form. + + 3. Grant of Patent License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + (except as stated in this section) patent license to make, have made, + use, offer to sell, sell, import, and otherwise transfer the Work, + where such license applies only to those patent claims licensable + by such Contributor that are necessarily infringed by their + Contribution(s) alone or by combination of their Contribution(s) + with the Work to which such Contribution(s) was submitted. If You + institute patent litigation against any entity (including a + cross-claim or counterclaim in a lawsuit) alleging that the Work + or a Contribution incorporated within the Work constitutes direct + or contributory patent infringement, then any patent licenses + granted to You under this License for that Work shall terminate + as of the date such litigation is filed. + + 4. Redistribution. You may reproduce and distribute copies of the + Work or Derivative Works thereof in any medium, with or without + modifications, and in Source or Object form, provided that You + meet the following conditions: + + (a) You must give any other recipients of the Work or + Derivative Works a copy of this License; and + + (b) You must cause any modified files to carry prominent notices + stating that You changed the files; and + + (c) You must retain, in the Source form of any Derivative Works + that You distribute, all copyright, patent, trademark, and + attribution notices from the Source form of the Work, + excluding those notices that do not pertain to any part of + the Derivative Works; and + + (d) If the Work includes a "NOTICE" text file as part of its + distribution, then any Derivative Works that You distribute must + include a readable copy of the attribution notices contained + within such NOTICE file, excluding those notices that do not + pertain to any part of the Derivative Works, in at least one + of the following places: within a NOTICE text file distributed + as part of the Derivative Works; within the Source form or + documentation, if provided along with the Derivative Works; or, + within a display generated by the Derivative Works, if and + wherever such third-party notices normally appear. The contents + of the NOTICE file are for informational purposes only and + do not modify the License. You may add Your own attribution + notices within Derivative Works that You distribute, alongside + or as an addendum to the NOTICE text from the Work, provided + that such additional attribution notices cannot be construed + as modifying the License. + + You may add Your own copyright statement to Your modifications and + may provide additional or different license terms and conditions + for use, reproduction, or distribution of Your modifications, or + for any such Derivative Works as a whole, provided Your use, + reproduction, and distribution of the Work otherwise complies with + the conditions stated in this License. + + 5. Submission of Contributions. Unless You explicitly state otherwise, + any Contribution intentionally submitted for inclusion in the Work + by You to the Licensor shall be under the terms and conditions of + this License, without any additional terms or conditions. + Notwithstanding the above, nothing herein shall supersede or modify + the terms of any separate license agreement you may have executed + with Licensor regarding such Contributions. + + 6. Trademarks. This License does not grant permission to use the trade + names, trademarks, service marks, or product names of the Licensor, + except as required for reasonable and customary use in describing the + origin of the Work and reproducing the content of the NOTICE file. + + 7. Disclaimer of Warranty. Unless required by applicable law or + agreed to in writing, Licensor provides the Work (and each + Contributor provides its Contributions) on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or + implied, including, without limitation, any warranties or conditions + of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A + PARTICULAR PURPOSE. You are solely responsible for determining the + appropriateness of using or redistributing the Work and assume any + risks associated with Your exercise of permissions under this License. + + 8. Limitation of Liability. In no event and under no legal theory, + whether in tort (including negligence), contract, or otherwise, + unless required by applicable law (such as deliberate and grossly + negligent acts) or agreed to in writing, shall any Contributor be + liable to You for damages, including any direct, indirect, special, + incidental, or consequential damages of any character arising as a + result of this License or out of the use or inability to use the + Work (including but not limited to damages for loss of goodwill, + work stoppage, computer failure or malfunction, or any and all + other commercial damages or losses), even if such Contributor + has been advised of the possibility of such damages. + + 9. Accepting Warranty or Additional Liability. While redistributing + the Work or Derivative Works thereof, You may choose to offer, + and charge a fee for, acceptance of support, warranty, indemnity, + or other liability obligations and/or rights consistent with this + License. However, in accepting such obligations, You may act only + on Your own behalf and on Your sole responsibility, not on behalf + of any other Contributor, and only if You agree to indemnify, + defend, and hold each Contributor harmless for any liability + incurred by, or claims asserted against, such Contributor by reason + of your accepting any such warranty or additional liability. + + END OF TERMS AND CONDITIONS + + APPENDIX: How to apply the Apache License to your work. + + To apply the Apache License to your work, attach the following + boilerplate notice, with the fields enclosed by brackets "[]" + replaced with your own identifying information. (Don't include + the brackets!) The text should be enclosed in the appropriate + comment syntax for the file format. We also recommend that a + file or class name and description of purpose be included on the + same "printed page" as the copyright notice for easier + identification within third-party archives. + + Copyright [yyyy] [name of copyright owner] + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. diff --git a/owl-bot-staging/google-cloud-secret_manager-v1/README.md b/owl-bot-staging/google-cloud-secret_manager-v1/README.md new file mode 100644 index 000000000000..729cba534926 --- /dev/null +++ b/owl-bot-staging/google-cloud-secret_manager-v1/README.md @@ -0,0 +1,154 @@ +# Ruby Client for the Secret Manager V1 API + +Stores sensitive data such as API keys, passwords, and certificates. Provides convenience while improving security. + +Secret Manager is a secure and convenient storage system for API keys, passwords, certificates, and other sensitive data. Secret Manager provides a central place and single source of truth to manage, access, and audit secrets across Google Cloud. + +https://github.com/googleapis/google-cloud-ruby + +This gem is a _versioned_ client. It provides basic client classes for a +specific version of the Secret Manager V1 API. Most users should consider using +the main client gem, +[google-cloud-secret_manager](https://rubygems.org/gems/google-cloud-secret_manager). +See the section below titled *Which client should I use?* for more information. + +## Installation + +``` +$ gem install google-cloud-secret_manager-v1 +``` + +## Before You Begin + +In order to use this library, you first need to go through the following steps: + +1. [Select or create a Cloud Platform project.](https://console.cloud.google.com/project) +1. [Enable billing for your project.](https://cloud.google.com/billing/docs/how-to/modify-project#enable_billing_for_a_project) +1. [Enable the API.](https://console.cloud.google.com/apis/library/secretmanager.googleapis.com) +1. [Set up authentication.](AUTHENTICATION.md) + +## Quick Start + +```ruby +require "google/cloud/secret_manager/v1" + +client = ::Google::Cloud::SecretManager::V1::SecretManagerService::Client.new +request = ::Google::Cloud::SecretManager::V1::ListSecretsRequest.new # (request fields as keyword arguments...) +response = client.list_secrets request +``` + +View the [Client Library Documentation](https://cloud.google.com/ruby/docs/reference/google-cloud-secret_manager-v1/latest) +for class and method documentation. + +See also the [Product Documentation](https://cloud.google.com/secret-manager) +for general usage information. + +## Debug Logging + +This library comes with opt-in Debug Logging that can help you troubleshoot +your application's integration with the API. When logging is activated, key +events such as requests and responses, along with data payloads and metadata +such as headers and client configuration, are logged to the standard error +stream. + +**WARNING:** Client Library Debug Logging includes your data payloads in +plaintext, which could include sensitive data such as PII for yourself or your +customers, private keys, or other security data that could be compromising if +leaked. Always practice good data hygiene with your application logs, and follow +the principle of least access. Google also recommends that Client Library Debug +Logging be enabled only temporarily during active debugging, and not used +permanently in production. + +To enable logging, set the environment variable `GOOGLE_SDK_RUBY_LOGGING_GEMS` +to the value `all`. Alternatively, you can set the value to a comma-delimited +list of client library gem names. This will select the default logging behavior, +which writes logs to the standard error stream. On a local workstation, this may +result in logs appearing on the console. When running on a Google Cloud hosting +service such as [Google Cloud Run](https://cloud.google.com/run), this generally +results in logs appearing alongside your application logs in the +[Google Cloud Logging](https://cloud.google.com/logging/) service. + +You can customize logging by modifying the `logger` configuration when +constructing a client object. For example: + +```ruby +require "google/cloud/secret_manager/v1" +require "logger" + +client = ::Google::Cloud::SecretManager::V1::SecretManagerService::Client.new do |config| + config.logger = Logger.new "my-app.log" +end +``` + +## Google Cloud Samples + +To browse ready to use code samples check [Google Cloud Samples](https://cloud.google.com/docs/samples). + +## Supported Ruby Versions + +This library is supported on Ruby 3.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-secret_manager`, +and lower-level _versioned_ client libraries with names such as +`google-cloud-secret_manager-v1`. +_In most cases, you should install the main client._ + +### What's the difference between the main client and a versioned client? + +A _versioned client_ provides a basic set of data types and client classes for +a _single version_ of a specific service. (That is, for a service with multiple +versions, there might be a separate versioned client for each service version.) +Most versioned clients are written and maintained by a code generator. + +The _main client_ is designed to provide you with the _recommended_ client +interfaces for the service. There will be only one main client for any given +service, even a service with multiple versions. The main client includes +factory methods for constructing the client objects we recommend for most +users. In some cases, those will be classes provided by an underlying versioned +client; in other cases, they will be handwritten higher-level client objects +with additional capabilities, convenience methods, or best practices built in. +Generally, the main client will default to a recommended service version, +although in some cases you can override this if you need to talk to a specific +service version. + +### Why would I want to use the main client? + +We recommend that most users install the main client gem for a service. You can +identify this gem as the one _without_ a version in its name, e.g. +`google-cloud-secret_manager`. +The main client is recommended because it will embody the best practices for +accessing the service, and may also provide more convenient interfaces or +tighter integration into frameworks and third-party libraries. In addition, the +documentation and samples published by Google will generally demonstrate use of +the main client. + +### Why would I want to use a versioned client? + +You can use a versioned client if you are content with a possibly lower-level +class interface, you explicitly want to avoid features provided by the main +client, or you want to access a specific service version not be covered by the +main client. You can identify versioned client gems because the service version +is part of the name, e.g. `google-cloud-secret_manager-v1`. + +### What about the google-apis- clients? + +Client library gems with names that begin with `google-apis-` are based on an +older code generation technology. They talk to a REST/JSON backend (whereas +most modern clients talk to a [gRPC](https://grpc.io/) backend) and they may +not offer the same performance, features, and ease of use provided by more +modern clients. + +The `google-apis-` clients have wide coverage across Google services, so you +might need to use one if there is no modern client available for the service. +However, if a modern client is available, we generally recommend it over the +older `google-apis-` clients. diff --git a/owl-bot-staging/google-cloud-secret_manager-v1/Rakefile b/owl-bot-staging/google-cloud-secret_manager-v1/Rakefile new file mode 100644 index 000000000000..47dd5c67678f --- /dev/null +++ b/owl-bot-staging/google-cloud-secret_manager-v1/Rakefile @@ -0,0 +1,169 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +require "bundler/setup" +require "bundler/gem_tasks" + +require "rubocop/rake_task" +RuboCop::RakeTask.new + +require "rake/testtask" +desc "Run tests." +Rake::TestTask.new do |t| + t.libs << "test" + t.test_files = FileList["test/**/*_test.rb"] + t.warning = false +end + +desc "Runs the smoke tests." +Rake::TestTask.new :smoke_test do |t| + t.test_files = FileList["acceptance/**/*smoke_test.rb"] + t.warning = false +end + +# Acceptance tests +desc "Run the google-cloud-secret_manager-v1 acceptance tests." +task :acceptance, :project, :keyfile do |t, args| + project = args[:project] + project ||= + ENV["SECRET_MANAGER_TEST_PROJECT"] || + ENV["GCLOUD_TEST_PROJECT"] + keyfile = args[:keyfile] + keyfile ||= + ENV["SECRET_MANAGER_TEST_KEYFILE"] || + ENV["GCLOUD_TEST_KEYFILE"] + if keyfile + keyfile = File.read keyfile + else + keyfile ||= + ENV["SECRET_MANAGER_TEST_KEYFILE_JSON"] || + ENV["GCLOUD_TEST_KEYFILE_JSON"] + end + if project.nil? || keyfile.nil? + fail "You must provide a project and keyfile. e.g. rake acceptance[test123, /path/to/keyfile.json] or SECRET_MANAGER_TEST_PROJECT=test123 SECRET_MANAGER_TEST_KEYFILE=/path/to/keyfile.json rake acceptance" + end + require "google/cloud/secret_manager/v1/secret_manager_service/credentials" + ::Google::Cloud::SecretManager::V1::SecretManagerService::Credentials.env_vars.each do |path| + ENV[path] = nil + end + ENV["SECRET_MANAGER_PROJECT"] = project + ENV["SECRET_MANAGER_TEST_PROJECT"] = project + ENV["SECRET_MANAGER_KEYFILE_JSON"] = keyfile + + Rake::Task["acceptance:run"].invoke +end + +namespace :acceptance do + task :run do + if File.directory? "acceptance" + Rake::Task[:smoke_test].invoke + else + puts "The google-cloud-secret_manager-v1 gem has no acceptance tests." + end + end + + desc "Run acceptance cleanup." + task :cleanup do + end +end + +task :samples do + Rake::Task["samples:latest"].invoke +end + +namespace :samples do + task :latest do + if File.directory? "samples" + Dir.chdir "samples" do + Bundler.with_clean_env do + ENV["GOOGLE_CLOUD_SAMPLES_TEST"] = "not_master" + sh "bundle update" + sh "bundle exec rake test" + end + end + else + puts "The google-cloud-secret_manager-v1 gem has no samples to test." + end + end + + task :master do + if File.directory? "samples" + Dir.chdir "samples" do + Bundler.with_clean_env do + ENV["GOOGLE_CLOUD_SAMPLES_TEST"] = "master" + sh "bundle update" + sh "bundle exec rake test" + end + end + else + puts "The google-cloud-secret_manager-v1 gem has no samples to test." + end + end +end + +require "yard" +require "yard/rake/yardoc_task" +YARD::Rake::YardocTask.new do |y| + y.options << "--fail-on-warning" +end + +desc "Run yard-doctest example tests." +task :doctest do + puts "The google-cloud-secret_manager-v1 gem does not have doctest tests." +end + +desc "Run the CI build" +task :ci do + header "BUILDING google-cloud-secret_manager-v1" + header "google-cloud-secret_manager-v1 rubocop", "*" + Rake::Task[:rubocop].invoke + header "google-cloud-secret_manager-v1 yard", "*" + Rake::Task[:yard].invoke + header "google-cloud-secret_manager-v1 test", "*" + Rake::Task[:test].invoke +end + +namespace :ci do + desc "Run the CI build, with smoke tests." + task :smoke_test do + Rake::Task[:ci].invoke + header "google-cloud-secret_manager-v1 smoke_test", "*" + Rake::Task[:smoke_test].invoke + end + desc "Run the CI build, with acceptance tests." + task :acceptance do + Rake::Task[:ci].invoke + header "google-cloud-secret_manager-v1 acceptance", "*" + Rake::Task[:acceptance].invoke + end + task :a do + # This is a handy shortcut to save typing + Rake::Task["ci:acceptance"].invoke + end +end + +task default: :test + +def header str, token = "#" + line_length = str.length + 8 + puts "" + puts token * line_length + puts "#{token * 3} #{str} #{token * 3}" + puts token * line_length + puts "" +end diff --git a/owl-bot-staging/google-cloud-secret_manager-v1/gapic_metadata.json b/owl-bot-staging/google-cloud-secret_manager-v1/gapic_metadata.json new file mode 100644 index 000000000000..195f6c899ecf --- /dev/null +++ b/owl-bot-staging/google-cloud-secret_manager-v1/gapic_metadata.json @@ -0,0 +1,93 @@ +{ + "schema": "1.0", + "comment": "This file maps proto services/RPCs to the corresponding library clients/methods", + "language": "ruby", + "protoPackage": "google.cloud.secretmanager.v1", + "libraryPackage": "::Google::Cloud::SecretManager::V1", + "services": { + "SecretManagerService": { + "clients": { + "grpc": { + "libraryClient": "::Google::Cloud::SecretManager::V1::SecretManagerService::Client", + "rpcs": { + "ListSecrets": { + "methods": [ + "list_secrets" + ] + }, + "CreateSecret": { + "methods": [ + "create_secret" + ] + }, + "AddSecretVersion": { + "methods": [ + "add_secret_version" + ] + }, + "GetSecret": { + "methods": [ + "get_secret" + ] + }, + "UpdateSecret": { + "methods": [ + "update_secret" + ] + }, + "DeleteSecret": { + "methods": [ + "delete_secret" + ] + }, + "ListSecretVersions": { + "methods": [ + "list_secret_versions" + ] + }, + "GetSecretVersion": { + "methods": [ + "get_secret_version" + ] + }, + "AccessSecretVersion": { + "methods": [ + "access_secret_version" + ] + }, + "DisableSecretVersion": { + "methods": [ + "disable_secret_version" + ] + }, + "EnableSecretVersion": { + "methods": [ + "enable_secret_version" + ] + }, + "DestroySecretVersion": { + "methods": [ + "destroy_secret_version" + ] + }, + "SetIamPolicy": { + "methods": [ + "set_iam_policy" + ] + }, + "GetIamPolicy": { + "methods": [ + "get_iam_policy" + ] + }, + "TestIamPermissions": { + "methods": [ + "test_iam_permissions" + ] + } + } + } + } + } + } +} diff --git a/owl-bot-staging/google-cloud-secret_manager-v1/google-cloud-secret_manager-v1.gemspec b/owl-bot-staging/google-cloud-secret_manager-v1/google-cloud-secret_manager-v1.gemspec new file mode 100644 index 000000000000..329c53d1a9d3 --- /dev/null +++ b/owl-bot-staging/google-cloud-secret_manager-v1/google-cloud-secret_manager-v1.gemspec @@ -0,0 +1,30 @@ +# -*- ruby -*- +# encoding: utf-8 + +require File.expand_path("lib/google/cloud/secret_manager/v1/version", __dir__) + +Gem::Specification.new do |gem| + gem.name = "google-cloud-secret_manager-v1" + gem.version = Google::Cloud::SecretManager::V1::VERSION + + gem.authors = ["Google LLC"] + gem.email = "googleapis-packages@google.com" + gem.description = "Secret Manager is a secure and convenient storage system for API keys, passwords, certificates, and other sensitive data. Secret Manager provides a central place and single source of truth to manage, access, and audit secrets across Google Cloud. Note that google-cloud-secret_manager-v1 is a version-specific client library. For most uses, we recommend installing the main client library google-cloud-secret_manager instead. See the readme for more details." + gem.summary = "Stores sensitive data such as API keys, passwords, and certificates. Provides convenience while improving security." + gem.homepage = "https://github.com/googleapis/google-cloud-ruby" + gem.license = "Apache-2.0" + + gem.platform = Gem::Platform::RUBY + + gem.files = `git ls-files -- lib/*`.split("\n") + + `git ls-files -- proto_docs/*`.split("\n") + + ["README.md", "LICENSE.md", "AUTHENTICATION.md", ".yardopts"] + gem.require_paths = ["lib"] + + gem.required_ruby_version = ">= 3.2" + + gem.add_dependency "gapic-common", "~> 1.2" + gem.add_dependency "google-cloud-errors", "~> 1.0" + gem.add_dependency "google-cloud-location", "~> 1.0" + gem.add_dependency "grpc-google-iam-v1", "~> 1.11" +end diff --git a/owl-bot-staging/google-cloud-secret_manager-v1/lib/google-cloud-secret_manager-v1.rb b/owl-bot-staging/google-cloud-secret_manager-v1/lib/google-cloud-secret_manager-v1.rb new file mode 100644 index 000000000000..7a966609a639 --- /dev/null +++ b/owl-bot-staging/google-cloud-secret_manager-v1/lib/google-cloud-secret_manager-v1.rb @@ -0,0 +1,21 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +# This gem does not autoload during Bundler.require. To load this gem, +# issue explicit require statements for the packages desired, e.g.: +# require "google/cloud/secret_manager/v1" diff --git a/owl-bot-staging/google-cloud-secret_manager-v1/lib/google/cloud/secret_manager/v1.rb b/owl-bot-staging/google-cloud-secret_manager-v1/lib/google/cloud/secret_manager/v1.rb new file mode 100644 index 000000000000..7ea91d418dcd --- /dev/null +++ b/owl-bot-staging/google-cloud-secret_manager-v1/lib/google/cloud/secret_manager/v1.rb @@ -0,0 +1,45 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +require "google/cloud/secret_manager/v1/secret_manager_service" +require "google/cloud/secret_manager/v1/version" + +module Google + module Cloud + module SecretManager + ## + # API client module. + # + # @example Load this package, including all its services, and instantiate a gRPC client + # + # require "google/cloud/secret_manager/v1" + # client = ::Google::Cloud::SecretManager::V1::SecretManagerService::Client.new + # + # @example Load this package, including all its services, and instantiate a REST client + # + # require "google/cloud/secret_manager/v1" + # client = ::Google::Cloud::SecretManager::V1::SecretManagerService::Rest::Client.new + # + module V1 + end + end + end +end + +helper_path = ::File.join __dir__, "v1", "_helpers.rb" +require "google/cloud/secret_manager/v1/_helpers" if ::File.file? helper_path diff --git a/owl-bot-staging/google-cloud-secret_manager-v1/lib/google/cloud/secret_manager/v1/bindings_override.rb b/owl-bot-staging/google-cloud-secret_manager-v1/lib/google/cloud/secret_manager/v1/bindings_override.rb new file mode 100644 index 000000000000..fc80b7225c1e --- /dev/null +++ b/owl-bot-staging/google-cloud-secret_manager-v1/lib/google/cloud/secret_manager/v1/bindings_override.rb @@ -0,0 +1,75 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +require "gapic/rest" + +module Google + module Cloud + module SecretManager + ## + # @example Loading just the REST part of this package, including all its services, and instantiating a REST client + # + # require "google/cloud/secret_manager/v1/rest" + # client = ::Google::Cloud::SecretManager::V1::SecretManagerService::Rest::Client.new + # + module V1 + ## + # @private + # Initialize the mixin bindings configuration + # + def self.configure + @configure ||= begin + namespace = ["Google", "Cloud", "SecretManager"] + parent_config = while namespace.any? + parent_name = namespace.join "::" + parent_const = const_get parent_name + break parent_const.configure if parent_const.respond_to? :configure + namespace.pop + end + + default_config = ::Gapic::Rest::HttpBindingOverrideConfiguration.new parent_config + default_config.bindings_override["google.cloud.location.Locations.GetLocation"] = [ + Gapic::Rest::GrpcTranscoder::HttpBinding.create_with_validation( + uri_method: :get, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/?$}, false] + ], + body: nil + ) + ] + default_config.bindings_override["google.cloud.location.Locations.ListLocations"] = [ + + Gapic::Rest::GrpcTranscoder::HttpBinding.create_with_validation( + uri_method: :get, + uri_template: "/v1/{name}/locations", + matches: [ + ["name", %r{^projects/[^/]+/?$}, false] + ], + body: nil + ) + ] + default_config + end + yield @configure if block_given? + @configure + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-secret_manager-v1/lib/google/cloud/secret_manager/v1/rest.rb b/owl-bot-staging/google-cloud-secret_manager-v1/lib/google/cloud/secret_manager/v1/rest.rb new file mode 100644 index 000000000000..4131c19cc0dc --- /dev/null +++ b/owl-bot-staging/google-cloud-secret_manager-v1/lib/google/cloud/secret_manager/v1/rest.rb @@ -0,0 +1,38 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +require "google/cloud/secret_manager/v1/secret_manager_service/rest" +require "google/cloud/secret_manager/v1/bindings_override" +require "google/cloud/secret_manager/v1/version" + +module Google + module Cloud + module SecretManager + ## + # To load just the REST part of this package, including all its services, and instantiate a REST client: + # + # @example + # + # require "google/cloud/secret_manager/v1/rest" + # client = ::Google::Cloud::SecretManager::V1::SecretManagerService::Rest::Client.new + # + module V1 + end + end + end +end diff --git a/owl-bot-staging/google-cloud-secret_manager-v1/lib/google/cloud/secret_manager/v1/secret_manager_service.rb b/owl-bot-staging/google-cloud-secret_manager-v1/lib/google/cloud/secret_manager/v1/secret_manager_service.rb new file mode 100644 index 000000000000..951657359f0c --- /dev/null +++ b/owl-bot-staging/google-cloud-secret_manager-v1/lib/google/cloud/secret_manager/v1/secret_manager_service.rb @@ -0,0 +1,61 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +require "gapic/common" +require "gapic/config" +require "gapic/config/method" + +require "google/cloud/secret_manager/v1/version" + +require "google/cloud/secret_manager/v1/secret_manager_service/credentials" +require "google/cloud/secret_manager/v1/secret_manager_service/paths" +require "google/cloud/secret_manager/v1/secret_manager_service/client" +require "google/cloud/secret_manager/v1/secret_manager_service/rest" + +module Google + module Cloud + module SecretManager + module V1 + ## + # Secret Manager Service + # + # Manages secrets and operations using those secrets. Implements a REST + # model with the following objects: + # + # * {::Google::Cloud::SecretManager::V1::Secret Secret} + # * {::Google::Cloud::SecretManager::V1::SecretVersion SecretVersion} + # + # @example Load this service and instantiate a gRPC client + # + # require "google/cloud/secret_manager/v1/secret_manager_service" + # client = ::Google::Cloud::SecretManager::V1::SecretManagerService::Client.new + # + # @example Load this service and instantiate a REST client + # + # require "google/cloud/secret_manager/v1/secret_manager_service/rest" + # client = ::Google::Cloud::SecretManager::V1::SecretManagerService::Rest::Client.new + # + module SecretManagerService + end + end + end + end +end + +helper_path = ::File.join __dir__, "secret_manager_service", "helpers.rb" +require "google/cloud/secret_manager/v1/secret_manager_service/helpers" if ::File.file? helper_path diff --git a/owl-bot-staging/google-cloud-secret_manager-v1/lib/google/cloud/secret_manager/v1/secret_manager_service/client.rb b/owl-bot-staging/google-cloud-secret_manager-v1/lib/google/cloud/secret_manager/v1/secret_manager_service/client.rb new file mode 100644 index 000000000000..ad5dd9f15a9e --- /dev/null +++ b/owl-bot-staging/google-cloud-secret_manager-v1/lib/google/cloud/secret_manager/v1/secret_manager_service/client.rb @@ -0,0 +1,1989 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +require "google/cloud/errors" +require "google/cloud/secretmanager/v1/service_pb" +require "google/cloud/location" + +module Google + module Cloud + module SecretManager + module V1 + module SecretManagerService + ## + # Client for the SecretManagerService service. + # + # Secret Manager Service + # + # Manages secrets and operations using those secrets. Implements a REST + # model with the following objects: + # + # * {::Google::Cloud::SecretManager::V1::Secret Secret} + # * {::Google::Cloud::SecretManager::V1::SecretVersion SecretVersion} + # + class Client + # @private + API_VERSION = "" + + # @private + DEFAULT_ENDPOINT_TEMPLATE = "secretmanager.$UNIVERSE_DOMAIN$" + + include Paths + + # @private + attr_reader :secret_manager_service_stub + + ## + # Configure the SecretManagerService Client class. + # + # See {::Google::Cloud::SecretManager::V1::SecretManagerService::Client::Configuration} + # for a description of the configuration fields. + # + # @example + # + # # Modify the configuration for all SecretManagerService clients + # ::Google::Cloud::SecretManager::V1::SecretManagerService::Client.configure do |config| + # config.timeout = 10.0 + # end + # + # @yield [config] Configure the Client client. + # @yieldparam config [Client::Configuration] + # + # @return [Client::Configuration] + # + def self.configure + @configure ||= begin + namespace = ["Google", "Cloud", "SecretManager", "V1"] + parent_config = while namespace.any? + parent_name = namespace.join "::" + parent_const = const_get parent_name + break parent_const.configure if parent_const.respond_to? :configure + namespace.pop + end + default_config = Client::Configuration.new parent_config + + default_config.rpcs.list_secrets.timeout = 60.0 + + default_config.rpcs.create_secret.timeout = 60.0 + + default_config.rpcs.add_secret_version.timeout = 60.0 + + default_config.rpcs.get_secret.timeout = 60.0 + + default_config.rpcs.update_secret.timeout = 60.0 + + default_config.rpcs.delete_secret.timeout = 60.0 + + default_config.rpcs.list_secret_versions.timeout = 60.0 + + default_config.rpcs.get_secret_version.timeout = 60.0 + + default_config.rpcs.access_secret_version.timeout = 60.0 + default_config.rpcs.access_secret_version.retry_policy = { + initial_delay: 2.0, max_delay: 60.0, multiplier: 2.0, retry_codes: [14, 8] + } + + default_config.rpcs.disable_secret_version.timeout = 60.0 + + default_config.rpcs.enable_secret_version.timeout = 60.0 + + default_config.rpcs.destroy_secret_version.timeout = 60.0 + + default_config.rpcs.set_iam_policy.timeout = 60.0 + + default_config.rpcs.get_iam_policy.timeout = 60.0 + + default_config.rpcs.test_iam_permissions.timeout = 60.0 + + default_config + end + yield @configure if block_given? + @configure + end + + ## + # Configure the SecretManagerService Client instance. + # + # The configuration is set to the derived mode, meaning that values can be changed, + # but structural changes (adding new fields, etc.) are not allowed. Structural changes + # should be made on {Client.configure}. + # + # See {::Google::Cloud::SecretManager::V1::SecretManagerService::Client::Configuration} + # for a description of the configuration fields. + # + # @yield [config] Configure the Client client. + # @yieldparam config [Client::Configuration] + # + # @return [Client::Configuration] + # + def configure + yield @config if block_given? + @config + end + + ## + # The effective universe domain + # + # @return [String] + # + def universe_domain + @secret_manager_service_stub.universe_domain + end + + ## + # Create a new SecretManagerService client object. + # + # @example + # + # # Create a client using the default configuration + # client = ::Google::Cloud::SecretManager::V1::SecretManagerService::Client.new + # + # # Create a client using a custom configuration + # client = ::Google::Cloud::SecretManager::V1::SecretManagerService::Client.new do |config| + # config.timeout = 10.0 + # end + # + # @yield [config] Configure the SecretManagerService client. + # @yieldparam config [Client::Configuration] + # + def initialize + # These require statements are intentionally placed here to initialize + # the gRPC module only when it's required. + # See https://github.com/googleapis/toolkit/issues/446 + require "gapic/grpc" + require "google/cloud/secretmanager/v1/service_services_pb" + + # Create the configuration object + @config = Configuration.new Client.configure + + # Yield the configuration if needed + yield @config if block_given? + + # Create credentials + credentials = @config.credentials + # Use self-signed JWT if the endpoint is unchanged from default, + # but only if the default endpoint does not have a region prefix. + enable_self_signed_jwt = @config.endpoint.nil? || + (@config.endpoint == Configuration::DEFAULT_ENDPOINT && + !@config.endpoint.split(".").first.include?("-")) + credentials ||= Credentials.default scope: @config.scope, + enable_self_signed_jwt: enable_self_signed_jwt + if credentials.is_a?(::String) || credentials.is_a?(::Hash) + credentials = Credentials.new credentials, scope: @config.scope + end + @quota_project_id = @config.quota_project + @quota_project_id ||= credentials.quota_project_id if credentials.respond_to? :quota_project_id + + @secret_manager_service_stub = ::Gapic::ServiceStub.new( + ::Google::Cloud::SecretManager::V1::SecretManagerService::Stub, + credentials: credentials, + endpoint: @config.endpoint, + endpoint_template: DEFAULT_ENDPOINT_TEMPLATE, + universe_domain: @config.universe_domain, + channel_args: @config.channel_args, + interceptors: @config.interceptors, + channel_pool_config: @config.channel_pool, + logger: @config.logger + ) + + @secret_manager_service_stub.stub_logger&.info do |entry| + entry.set_system_name + entry.set_service + entry.message = "Created client for #{entry.service}" + entry.set_credentials_fields credentials + entry.set "customEndpoint", @config.endpoint if @config.endpoint + entry.set "defaultTimeout", @config.timeout if @config.timeout + entry.set "quotaProject", @quota_project_id if @quota_project_id + end + + @location_client = Google::Cloud::Location::Locations::Client.new do |config| + config.credentials = credentials + config.quota_project = @quota_project_id + config.endpoint = @secret_manager_service_stub.endpoint + config.universe_domain = @secret_manager_service_stub.universe_domain + config.logger = @secret_manager_service_stub.logger if config.respond_to? :logger= + end + end + + ## + # Get the associated client for mix-in of the Locations. + # + # @return [Google::Cloud::Location::Locations::Client] + # + attr_reader :location_client + + ## + # The logger used for request/response debug logging. + # + # @return [Logger] + # + def logger + @secret_manager_service_stub.logger + end + + # Service calls + + ## + # Lists {::Google::Cloud::SecretManager::V1::Secret Secrets}. + # + # @overload list_secrets(request, options = nil) + # Pass arguments to `list_secrets` via a request object, either of type + # {::Google::Cloud::SecretManager::V1::ListSecretsRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::SecretManager::V1::ListSecretsRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. + # + # @overload list_secrets(parent: nil, page_size: nil, page_token: nil, filter: nil) + # Pass arguments to `list_secrets` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param parent [::String] + # Required. The resource name of the project associated with the + # {::Google::Cloud::SecretManager::V1::Secret Secrets}, in the format `projects/*` + # or `projects/*/locations/*` + # @param page_size [::Integer] + # Optional. The maximum number of results to be returned in a single page. If + # set to 0, the server decides the number of results to return. If the + # number is greater than 25000, it is capped at 25000. + # @param page_token [::String] + # Optional. Pagination token, returned earlier via + # {::Google::Cloud::SecretManager::V1::ListSecretsResponse#next_page_token ListSecretsResponse.next_page_token}. + # @param filter [::String] + # Optional. Filter string, adhering to the rules in + # [List-operation + # filtering](https://cloud.google.com/secret-manager/docs/filtering). List + # only secrets matching the filter. If filter is empty, all secrets are + # listed. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Gapic::PagedEnumerable<::Google::Cloud::SecretManager::V1::Secret>] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Gapic::PagedEnumerable<::Google::Cloud::SecretManager::V1::Secret>] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/secret_manager/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::SecretManager::V1::SecretManagerService::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::SecretManager::V1::ListSecretsRequest.new + # + # # Call the list_secrets method. + # result = client.list_secrets request + # + # # The returned object is of type Gapic::PagedEnumerable. You can iterate + # # over elements, and API calls will be issued to fetch pages as needed. + # result.each do |item| + # # Each element is of type ::Google::Cloud::SecretManager::V1::Secret. + # p item + # end + # + def list_secrets request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::SecretManager::V1::ListSecretsRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + metadata = @config.rpcs.list_secrets.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::SecretManager::V1::VERSION + metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.parent + header_params["parent"] = request.parent + end + + request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") + metadata[:"x-goog-request-params"] ||= request_params_header + + options.apply_defaults timeout: @config.rpcs.list_secrets.timeout, + metadata: metadata, + retry_policy: @config.rpcs.list_secrets.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @secret_manager_service_stub.call_rpc :list_secrets, request, options: options do |response, operation| + response = ::Gapic::PagedEnumerable.new @secret_manager_service_stub, :list_secrets, request, response, operation, options + yield response, operation if block_given? + throw :response, response + end + rescue ::GRPC::BadStatus => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Creates a new {::Google::Cloud::SecretManager::V1::Secret Secret} containing no + # {::Google::Cloud::SecretManager::V1::SecretVersion SecretVersions}. + # + # @overload create_secret(request, options = nil) + # Pass arguments to `create_secret` via a request object, either of type + # {::Google::Cloud::SecretManager::V1::CreateSecretRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::SecretManager::V1::CreateSecretRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. + # + # @overload create_secret(parent: nil, secret_id: nil, secret: nil) + # Pass arguments to `create_secret` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param parent [::String] + # Required. The resource name of the project to associate with the + # {::Google::Cloud::SecretManager::V1::Secret Secret}, in the format `projects/*` + # or `projects/*/locations/*`. + # @param secret_id [::String] + # Required. This must be unique within the project. + # + # A secret ID is a string with a maximum length of 255 characters and can + # contain uppercase and lowercase letters, numerals, and the hyphen (`-`) and + # underscore (`_`) characters. + # @param secret [::Google::Cloud::SecretManager::V1::Secret, ::Hash] + # Required. A {::Google::Cloud::SecretManager::V1::Secret Secret} with initial + # field values. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Google::Cloud::SecretManager::V1::Secret] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Google::Cloud::SecretManager::V1::Secret] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/secret_manager/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::SecretManager::V1::SecretManagerService::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::SecretManager::V1::CreateSecretRequest.new + # + # # Call the create_secret method. + # result = client.create_secret request + # + # # The returned object is of type Google::Cloud::SecretManager::V1::Secret. + # p result + # + def create_secret request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::SecretManager::V1::CreateSecretRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + metadata = @config.rpcs.create_secret.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::SecretManager::V1::VERSION + metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.parent + header_params["parent"] = request.parent + end + + request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") + metadata[:"x-goog-request-params"] ||= request_params_header + + options.apply_defaults timeout: @config.rpcs.create_secret.timeout, + metadata: metadata, + retry_policy: @config.rpcs.create_secret.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @secret_manager_service_stub.call_rpc :create_secret, request, options: options do |response, operation| + yield response, operation if block_given? + end + rescue ::GRPC::BadStatus => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Creates a new {::Google::Cloud::SecretManager::V1::SecretVersion SecretVersion} + # containing secret data and attaches it to an existing + # {::Google::Cloud::SecretManager::V1::Secret Secret}. + # + # @overload add_secret_version(request, options = nil) + # Pass arguments to `add_secret_version` via a request object, either of type + # {::Google::Cloud::SecretManager::V1::AddSecretVersionRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::SecretManager::V1::AddSecretVersionRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. + # + # @overload add_secret_version(parent: nil, payload: nil) + # Pass arguments to `add_secret_version` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param parent [::String] + # Required. The resource name of the + # {::Google::Cloud::SecretManager::V1::Secret Secret} to associate with the + # {::Google::Cloud::SecretManager::V1::SecretVersion SecretVersion} in the format + # `projects/*/secrets/*` or `projects/*/locations/*/secrets/*`. + # @param payload [::Google::Cloud::SecretManager::V1::SecretPayload, ::Hash] + # Required. The secret payload of the + # {::Google::Cloud::SecretManager::V1::SecretVersion SecretVersion}. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Google::Cloud::SecretManager::V1::SecretVersion] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Google::Cloud::SecretManager::V1::SecretVersion] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/secret_manager/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::SecretManager::V1::SecretManagerService::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::SecretManager::V1::AddSecretVersionRequest.new + # + # # Call the add_secret_version method. + # result = client.add_secret_version request + # + # # The returned object is of type Google::Cloud::SecretManager::V1::SecretVersion. + # p result + # + def add_secret_version request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::SecretManager::V1::AddSecretVersionRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + metadata = @config.rpcs.add_secret_version.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::SecretManager::V1::VERSION + metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.parent + header_params["parent"] = request.parent + end + + request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") + metadata[:"x-goog-request-params"] ||= request_params_header + + options.apply_defaults timeout: @config.rpcs.add_secret_version.timeout, + metadata: metadata, + retry_policy: @config.rpcs.add_secret_version.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @secret_manager_service_stub.call_rpc :add_secret_version, request, options: options do |response, operation| + yield response, operation if block_given? + end + rescue ::GRPC::BadStatus => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Gets metadata for a given {::Google::Cloud::SecretManager::V1::Secret Secret}. + # + # @overload get_secret(request, options = nil) + # Pass arguments to `get_secret` via a request object, either of type + # {::Google::Cloud::SecretManager::V1::GetSecretRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::SecretManager::V1::GetSecretRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. + # + # @overload get_secret(name: nil) + # Pass arguments to `get_secret` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param name [::String] + # Required. The resource name of the + # {::Google::Cloud::SecretManager::V1::Secret Secret}, in the format + # `projects/*/secrets/*` or `projects/*/locations/*/secrets/*`. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Google::Cloud::SecretManager::V1::Secret] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Google::Cloud::SecretManager::V1::Secret] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/secret_manager/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::SecretManager::V1::SecretManagerService::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::SecretManager::V1::GetSecretRequest.new + # + # # Call the get_secret method. + # result = client.get_secret request + # + # # The returned object is of type Google::Cloud::SecretManager::V1::Secret. + # p result + # + def get_secret request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::SecretManager::V1::GetSecretRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + metadata = @config.rpcs.get_secret.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::SecretManager::V1::VERSION + metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.name + header_params["name"] = request.name + end + + request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") + metadata[:"x-goog-request-params"] ||= request_params_header + + options.apply_defaults timeout: @config.rpcs.get_secret.timeout, + metadata: metadata, + retry_policy: @config.rpcs.get_secret.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @secret_manager_service_stub.call_rpc :get_secret, request, options: options do |response, operation| + yield response, operation if block_given? + end + rescue ::GRPC::BadStatus => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Updates metadata of an existing + # {::Google::Cloud::SecretManager::V1::Secret Secret}. + # + # @overload update_secret(request, options = nil) + # Pass arguments to `update_secret` via a request object, either of type + # {::Google::Cloud::SecretManager::V1::UpdateSecretRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::SecretManager::V1::UpdateSecretRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. + # + # @overload update_secret(secret: nil, update_mask: nil) + # Pass arguments to `update_secret` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param secret [::Google::Cloud::SecretManager::V1::Secret, ::Hash] + # Required. {::Google::Cloud::SecretManager::V1::Secret Secret} with updated field + # values. + # @param update_mask [::Google::Protobuf::FieldMask, ::Hash] + # Required. Specifies the fields to be updated. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Google::Cloud::SecretManager::V1::Secret] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Google::Cloud::SecretManager::V1::Secret] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/secret_manager/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::SecretManager::V1::SecretManagerService::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::SecretManager::V1::UpdateSecretRequest.new + # + # # Call the update_secret method. + # result = client.update_secret request + # + # # The returned object is of type Google::Cloud::SecretManager::V1::Secret. + # p result + # + def update_secret request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::SecretManager::V1::UpdateSecretRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + metadata = @config.rpcs.update_secret.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::SecretManager::V1::VERSION + metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.secret&.name + header_params["secret.name"] = request.secret.name + end + + request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") + metadata[:"x-goog-request-params"] ||= request_params_header + + options.apply_defaults timeout: @config.rpcs.update_secret.timeout, + metadata: metadata, + retry_policy: @config.rpcs.update_secret.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @secret_manager_service_stub.call_rpc :update_secret, request, options: options do |response, operation| + yield response, operation if block_given? + end + rescue ::GRPC::BadStatus => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Deletes a {::Google::Cloud::SecretManager::V1::Secret Secret}. + # + # @overload delete_secret(request, options = nil) + # Pass arguments to `delete_secret` via a request object, either of type + # {::Google::Cloud::SecretManager::V1::DeleteSecretRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::SecretManager::V1::DeleteSecretRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. + # + # @overload delete_secret(name: nil, etag: nil) + # Pass arguments to `delete_secret` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param name [::String] + # Required. The resource name of the + # {::Google::Cloud::SecretManager::V1::Secret Secret} to delete in the format + # `projects/*/secrets/*`. + # @param etag [::String] + # Optional. Etag of the {::Google::Cloud::SecretManager::V1::Secret Secret}. The + # request succeeds if it matches the etag of the currently stored secret + # object. If the etag is omitted, the request succeeds. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Google::Protobuf::Empty] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Google::Protobuf::Empty] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/secret_manager/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::SecretManager::V1::SecretManagerService::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::SecretManager::V1::DeleteSecretRequest.new + # + # # Call the delete_secret method. + # result = client.delete_secret request + # + # # The returned object is of type Google::Protobuf::Empty. + # p result + # + def delete_secret request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::SecretManager::V1::DeleteSecretRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + metadata = @config.rpcs.delete_secret.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::SecretManager::V1::VERSION + metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.name + header_params["name"] = request.name + end + + request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") + metadata[:"x-goog-request-params"] ||= request_params_header + + options.apply_defaults timeout: @config.rpcs.delete_secret.timeout, + metadata: metadata, + retry_policy: @config.rpcs.delete_secret.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @secret_manager_service_stub.call_rpc :delete_secret, request, options: options do |response, operation| + yield response, operation if block_given? + end + rescue ::GRPC::BadStatus => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Lists {::Google::Cloud::SecretManager::V1::SecretVersion SecretVersions}. This + # call does not return secret data. + # + # @overload list_secret_versions(request, options = nil) + # Pass arguments to `list_secret_versions` via a request object, either of type + # {::Google::Cloud::SecretManager::V1::ListSecretVersionsRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::SecretManager::V1::ListSecretVersionsRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. + # + # @overload list_secret_versions(parent: nil, page_size: nil, page_token: nil, filter: nil) + # Pass arguments to `list_secret_versions` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param parent [::String] + # Required. The resource name of the + # {::Google::Cloud::SecretManager::V1::Secret Secret} associated with the + # {::Google::Cloud::SecretManager::V1::SecretVersion SecretVersions} to list, in + # the format `projects/*/secrets/*` or `projects/*/locations/*/secrets/*`. + # @param page_size [::Integer] + # Optional. The maximum number of results to be returned in a single page. If + # set to 0, the server decides the number of results to return. If the + # number is greater than 25000, it is capped at 25000. + # @param page_token [::String] + # Optional. Pagination token, returned earlier via + # ListSecretVersionsResponse.next_page_token][]. + # @param filter [::String] + # Optional. Filter string, adhering to the rules in + # [List-operation + # filtering](https://cloud.google.com/secret-manager/docs/filtering). List + # only secret versions matching the filter. If filter is empty, all secret + # versions are listed. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Gapic::PagedEnumerable<::Google::Cloud::SecretManager::V1::SecretVersion>] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Gapic::PagedEnumerable<::Google::Cloud::SecretManager::V1::SecretVersion>] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/secret_manager/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::SecretManager::V1::SecretManagerService::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::SecretManager::V1::ListSecretVersionsRequest.new + # + # # Call the list_secret_versions method. + # result = client.list_secret_versions request + # + # # The returned object is of type Gapic::PagedEnumerable. You can iterate + # # over elements, and API calls will be issued to fetch pages as needed. + # result.each do |item| + # # Each element is of type ::Google::Cloud::SecretManager::V1::SecretVersion. + # p item + # end + # + def list_secret_versions request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::SecretManager::V1::ListSecretVersionsRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + metadata = @config.rpcs.list_secret_versions.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::SecretManager::V1::VERSION + metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.parent + header_params["parent"] = request.parent + end + + request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") + metadata[:"x-goog-request-params"] ||= request_params_header + + options.apply_defaults timeout: @config.rpcs.list_secret_versions.timeout, + metadata: metadata, + retry_policy: @config.rpcs.list_secret_versions.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @secret_manager_service_stub.call_rpc :list_secret_versions, request, options: options do |response, operation| + response = ::Gapic::PagedEnumerable.new @secret_manager_service_stub, :list_secret_versions, request, response, operation, options + yield response, operation if block_given? + throw :response, response + end + rescue ::GRPC::BadStatus => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Gets metadata for a + # {::Google::Cloud::SecretManager::V1::SecretVersion SecretVersion}. + # + # `projects/*/secrets/*/versions/latest` is an alias to the most recently + # created {::Google::Cloud::SecretManager::V1::SecretVersion SecretVersion}. + # + # @overload get_secret_version(request, options = nil) + # Pass arguments to `get_secret_version` via a request object, either of type + # {::Google::Cloud::SecretManager::V1::GetSecretVersionRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::SecretManager::V1::GetSecretVersionRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. + # + # @overload get_secret_version(name: nil) + # Pass arguments to `get_secret_version` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param name [::String] + # Required. The resource name of the + # {::Google::Cloud::SecretManager::V1::SecretVersion SecretVersion} in the format + # `projects/*/secrets/*/versions/*` or + # `projects/*/locations/*/secrets/*/versions/*`. + # + # `projects/*/secrets/*/versions/latest` or + # `projects/*/locations/*/secrets/*/versions/latest` is an alias to the most + # recently created + # {::Google::Cloud::SecretManager::V1::SecretVersion SecretVersion}. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Google::Cloud::SecretManager::V1::SecretVersion] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Google::Cloud::SecretManager::V1::SecretVersion] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/secret_manager/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::SecretManager::V1::SecretManagerService::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::SecretManager::V1::GetSecretVersionRequest.new + # + # # Call the get_secret_version method. + # result = client.get_secret_version request + # + # # The returned object is of type Google::Cloud::SecretManager::V1::SecretVersion. + # p result + # + def get_secret_version request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::SecretManager::V1::GetSecretVersionRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + metadata = @config.rpcs.get_secret_version.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::SecretManager::V1::VERSION + metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.name + header_params["name"] = request.name + end + + request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") + metadata[:"x-goog-request-params"] ||= request_params_header + + options.apply_defaults timeout: @config.rpcs.get_secret_version.timeout, + metadata: metadata, + retry_policy: @config.rpcs.get_secret_version.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @secret_manager_service_stub.call_rpc :get_secret_version, request, options: options do |response, operation| + yield response, operation if block_given? + end + rescue ::GRPC::BadStatus => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Accesses a {::Google::Cloud::SecretManager::V1::SecretVersion SecretVersion}. + # This call returns the secret data. + # + # `projects/*/secrets/*/versions/latest` is an alias to the most recently + # created {::Google::Cloud::SecretManager::V1::SecretVersion SecretVersion}. + # + # @overload access_secret_version(request, options = nil) + # Pass arguments to `access_secret_version` via a request object, either of type + # {::Google::Cloud::SecretManager::V1::AccessSecretVersionRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::SecretManager::V1::AccessSecretVersionRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. + # + # @overload access_secret_version(name: nil) + # Pass arguments to `access_secret_version` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param name [::String] + # Required. The resource name of the + # {::Google::Cloud::SecretManager::V1::SecretVersion SecretVersion} in the format + # `projects/*/secrets/*/versions/*` or + # `projects/*/locations/*/secrets/*/versions/*`. + # + # `projects/*/secrets/*/versions/latest` or + # `projects/*/locations/*/secrets/*/versions/latest` is an alias to the most + # recently created + # {::Google::Cloud::SecretManager::V1::SecretVersion SecretVersion}. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Google::Cloud::SecretManager::V1::AccessSecretVersionResponse] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Google::Cloud::SecretManager::V1::AccessSecretVersionResponse] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/secret_manager/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::SecretManager::V1::SecretManagerService::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::SecretManager::V1::AccessSecretVersionRequest.new + # + # # Call the access_secret_version method. + # result = client.access_secret_version request + # + # # The returned object is of type Google::Cloud::SecretManager::V1::AccessSecretVersionResponse. + # p result + # + def access_secret_version request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::SecretManager::V1::AccessSecretVersionRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + metadata = @config.rpcs.access_secret_version.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::SecretManager::V1::VERSION + metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.name + header_params["name"] = request.name + end + + request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") + metadata[:"x-goog-request-params"] ||= request_params_header + + options.apply_defaults timeout: @config.rpcs.access_secret_version.timeout, + metadata: metadata, + retry_policy: @config.rpcs.access_secret_version.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @secret_manager_service_stub.call_rpc :access_secret_version, request, options: options do |response, operation| + yield response, operation if block_given? + end + rescue ::GRPC::BadStatus => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Disables a {::Google::Cloud::SecretManager::V1::SecretVersion SecretVersion}. + # + # Sets the {::Google::Cloud::SecretManager::V1::SecretVersion#state state} of the + # {::Google::Cloud::SecretManager::V1::SecretVersion SecretVersion} to + # {::Google::Cloud::SecretManager::V1::SecretVersion::State::DISABLED DISABLED}. + # + # @overload disable_secret_version(request, options = nil) + # Pass arguments to `disable_secret_version` via a request object, either of type + # {::Google::Cloud::SecretManager::V1::DisableSecretVersionRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::SecretManager::V1::DisableSecretVersionRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. + # + # @overload disable_secret_version(name: nil, etag: nil) + # Pass arguments to `disable_secret_version` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param name [::String] + # Required. The resource name of the + # {::Google::Cloud::SecretManager::V1::SecretVersion SecretVersion} to disable in + # the format `projects/*/secrets/*/versions/*` or + # `projects/*/locations/*/secrets/*/versions/*`. + # @param etag [::String] + # Optional. Etag of the + # {::Google::Cloud::SecretManager::V1::SecretVersion SecretVersion}. The request + # succeeds if it matches the etag of the currently stored secret version + # object. If the etag is omitted, the request succeeds. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Google::Cloud::SecretManager::V1::SecretVersion] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Google::Cloud::SecretManager::V1::SecretVersion] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/secret_manager/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::SecretManager::V1::SecretManagerService::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::SecretManager::V1::DisableSecretVersionRequest.new + # + # # Call the disable_secret_version method. + # result = client.disable_secret_version request + # + # # The returned object is of type Google::Cloud::SecretManager::V1::SecretVersion. + # p result + # + def disable_secret_version request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::SecretManager::V1::DisableSecretVersionRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + metadata = @config.rpcs.disable_secret_version.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::SecretManager::V1::VERSION + metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.name + header_params["name"] = request.name + end + + request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") + metadata[:"x-goog-request-params"] ||= request_params_header + + options.apply_defaults timeout: @config.rpcs.disable_secret_version.timeout, + metadata: metadata, + retry_policy: @config.rpcs.disable_secret_version.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @secret_manager_service_stub.call_rpc :disable_secret_version, request, options: options do |response, operation| + yield response, operation if block_given? + end + rescue ::GRPC::BadStatus => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Enables a {::Google::Cloud::SecretManager::V1::SecretVersion SecretVersion}. + # + # Sets the {::Google::Cloud::SecretManager::V1::SecretVersion#state state} of the + # {::Google::Cloud::SecretManager::V1::SecretVersion SecretVersion} to + # {::Google::Cloud::SecretManager::V1::SecretVersion::State::ENABLED ENABLED}. + # + # @overload enable_secret_version(request, options = nil) + # Pass arguments to `enable_secret_version` via a request object, either of type + # {::Google::Cloud::SecretManager::V1::EnableSecretVersionRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::SecretManager::V1::EnableSecretVersionRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. + # + # @overload enable_secret_version(name: nil, etag: nil) + # Pass arguments to `enable_secret_version` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param name [::String] + # Required. The resource name of the + # {::Google::Cloud::SecretManager::V1::SecretVersion SecretVersion} to enable in + # the format `projects/*/secrets/*/versions/*` or + # `projects/*/locations/*/secrets/*/versions/*`. + # @param etag [::String] + # Optional. Etag of the + # {::Google::Cloud::SecretManager::V1::SecretVersion SecretVersion}. The request + # succeeds if it matches the etag of the currently stored secret version + # object. If the etag is omitted, the request succeeds. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Google::Cloud::SecretManager::V1::SecretVersion] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Google::Cloud::SecretManager::V1::SecretVersion] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/secret_manager/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::SecretManager::V1::SecretManagerService::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::SecretManager::V1::EnableSecretVersionRequest.new + # + # # Call the enable_secret_version method. + # result = client.enable_secret_version request + # + # # The returned object is of type Google::Cloud::SecretManager::V1::SecretVersion. + # p result + # + def enable_secret_version request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::SecretManager::V1::EnableSecretVersionRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + metadata = @config.rpcs.enable_secret_version.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::SecretManager::V1::VERSION + metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.name + header_params["name"] = request.name + end + + request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") + metadata[:"x-goog-request-params"] ||= request_params_header + + options.apply_defaults timeout: @config.rpcs.enable_secret_version.timeout, + metadata: metadata, + retry_policy: @config.rpcs.enable_secret_version.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @secret_manager_service_stub.call_rpc :enable_secret_version, request, options: options do |response, operation| + yield response, operation if block_given? + end + rescue ::GRPC::BadStatus => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Destroys a {::Google::Cloud::SecretManager::V1::SecretVersion SecretVersion}. + # + # Sets the {::Google::Cloud::SecretManager::V1::SecretVersion#state state} of the + # {::Google::Cloud::SecretManager::V1::SecretVersion SecretVersion} to + # {::Google::Cloud::SecretManager::V1::SecretVersion::State::DESTROYED DESTROYED} + # and irrevocably destroys the secret data. + # + # @overload destroy_secret_version(request, options = nil) + # Pass arguments to `destroy_secret_version` via a request object, either of type + # {::Google::Cloud::SecretManager::V1::DestroySecretVersionRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::SecretManager::V1::DestroySecretVersionRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. + # + # @overload destroy_secret_version(name: nil, etag: nil) + # Pass arguments to `destroy_secret_version` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param name [::String] + # Required. The resource name of the + # {::Google::Cloud::SecretManager::V1::SecretVersion SecretVersion} to destroy in + # the format `projects/*/secrets/*/versions/*` or + # `projects/*/locations/*/secrets/*/versions/*`. + # @param etag [::String] + # Optional. Etag of the + # {::Google::Cloud::SecretManager::V1::SecretVersion SecretVersion}. The request + # succeeds if it matches the etag of the currently stored secret version + # object. If the etag is omitted, the request succeeds. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Google::Cloud::SecretManager::V1::SecretVersion] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Google::Cloud::SecretManager::V1::SecretVersion] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/secret_manager/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::SecretManager::V1::SecretManagerService::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::SecretManager::V1::DestroySecretVersionRequest.new + # + # # Call the destroy_secret_version method. + # result = client.destroy_secret_version request + # + # # The returned object is of type Google::Cloud::SecretManager::V1::SecretVersion. + # p result + # + def destroy_secret_version request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::SecretManager::V1::DestroySecretVersionRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + metadata = @config.rpcs.destroy_secret_version.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::SecretManager::V1::VERSION + metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.name + header_params["name"] = request.name + end + + request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") + metadata[:"x-goog-request-params"] ||= request_params_header + + options.apply_defaults timeout: @config.rpcs.destroy_secret_version.timeout, + metadata: metadata, + retry_policy: @config.rpcs.destroy_secret_version.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @secret_manager_service_stub.call_rpc :destroy_secret_version, request, options: options do |response, operation| + yield response, operation if block_given? + end + rescue ::GRPC::BadStatus => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Sets the access control policy on the specified secret. Replaces any + # existing policy. + # + # Permissions on + # {::Google::Cloud::SecretManager::V1::SecretVersion SecretVersions} are enforced + # according to the policy set on the associated + # {::Google::Cloud::SecretManager::V1::Secret Secret}. + # + # @overload set_iam_policy(request, options = nil) + # Pass arguments to `set_iam_policy` via a request object, either of type + # {::Google::Iam::V1::SetIamPolicyRequest} or an equivalent Hash. + # + # @param request [::Google::Iam::V1::SetIamPolicyRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. + # + # @overload set_iam_policy(resource: nil, policy: nil, update_mask: nil) + # Pass arguments to `set_iam_policy` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param resource [::String] + # REQUIRED: The resource for which the policy is being specified. + # See the operation documentation for the appropriate value for this field. + # @param policy [::Google::Iam::V1::Policy, ::Hash] + # REQUIRED: The complete policy to be applied to the `resource`. The size of + # the policy is limited to a few 10s of KB. An empty policy is a + # valid policy but certain Cloud Platform services (such as Projects) + # might reject them. + # @param update_mask [::Google::Protobuf::FieldMask, ::Hash] + # OPTIONAL: A FieldMask specifying which fields of the policy to modify. Only + # the fields in the mask will be modified. If no mask is provided, the + # following default mask is used: + # + # `paths: "bindings, etag"` + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Google::Iam::V1::Policy] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Google::Iam::V1::Policy] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/secret_manager/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::SecretManager::V1::SecretManagerService::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Iam::V1::SetIamPolicyRequest.new + # + # # Call the set_iam_policy method. + # result = client.set_iam_policy request + # + # # The returned object is of type Google::Iam::V1::Policy. + # p result + # + def set_iam_policy request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Iam::V1::SetIamPolicyRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + metadata = @config.rpcs.set_iam_policy.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::SecretManager::V1::VERSION + metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.resource + header_params["resource"] = request.resource + end + + request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") + metadata[:"x-goog-request-params"] ||= request_params_header + + options.apply_defaults timeout: @config.rpcs.set_iam_policy.timeout, + metadata: metadata, + retry_policy: @config.rpcs.set_iam_policy.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @secret_manager_service_stub.call_rpc :set_iam_policy, request, options: options do |response, operation| + yield response, operation if block_given? + end + rescue ::GRPC::BadStatus => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Gets the access control policy for a secret. + # Returns empty policy if the secret exists and does not have a policy set. + # + # @overload get_iam_policy(request, options = nil) + # Pass arguments to `get_iam_policy` via a request object, either of type + # {::Google::Iam::V1::GetIamPolicyRequest} or an equivalent Hash. + # + # @param request [::Google::Iam::V1::GetIamPolicyRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. + # + # @overload get_iam_policy(resource: nil, options: nil) + # Pass arguments to `get_iam_policy` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param resource [::String] + # REQUIRED: The resource for which the policy is being requested. + # See the operation documentation for the appropriate value for this field. + # @param options [::Google::Iam::V1::GetPolicyOptions, ::Hash] + # OPTIONAL: A `GetPolicyOptions` object for specifying options to + # `GetIamPolicy`. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Google::Iam::V1::Policy] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Google::Iam::V1::Policy] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/secret_manager/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::SecretManager::V1::SecretManagerService::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Iam::V1::GetIamPolicyRequest.new + # + # # Call the get_iam_policy method. + # result = client.get_iam_policy request + # + # # The returned object is of type Google::Iam::V1::Policy. + # p result + # + def get_iam_policy request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Iam::V1::GetIamPolicyRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + metadata = @config.rpcs.get_iam_policy.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::SecretManager::V1::VERSION + metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.resource + header_params["resource"] = request.resource + end + + request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") + metadata[:"x-goog-request-params"] ||= request_params_header + + options.apply_defaults timeout: @config.rpcs.get_iam_policy.timeout, + metadata: metadata, + retry_policy: @config.rpcs.get_iam_policy.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @secret_manager_service_stub.call_rpc :get_iam_policy, request, options: options do |response, operation| + yield response, operation if block_given? + end + rescue ::GRPC::BadStatus => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Returns permissions that a caller has for the specified secret. + # If the secret does not exist, this call returns an empty set of + # permissions, not a NOT_FOUND error. + # + # Note: This operation is designed to be used for building permission-aware + # UIs and command-line tools, not for authorization checking. This operation + # may "fail open" without warning. + # + # @overload test_iam_permissions(request, options = nil) + # Pass arguments to `test_iam_permissions` via a request object, either of type + # {::Google::Iam::V1::TestIamPermissionsRequest} or an equivalent Hash. + # + # @param request [::Google::Iam::V1::TestIamPermissionsRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. + # + # @overload test_iam_permissions(resource: nil, permissions: nil) + # Pass arguments to `test_iam_permissions` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param resource [::String] + # REQUIRED: The resource for which the policy detail is being requested. + # See the operation documentation for the appropriate value for this field. + # @param permissions [::Array<::String>] + # The set of permissions to check for the `resource`. Permissions with + # wildcards (such as '*' or 'storage.*') are not allowed. For more + # information see + # [IAM Overview](https://cloud.google.com/iam/docs/overview#permissions). + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Google::Iam::V1::TestIamPermissionsResponse] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Google::Iam::V1::TestIamPermissionsResponse] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/secret_manager/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::SecretManager::V1::SecretManagerService::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Iam::V1::TestIamPermissionsRequest.new + # + # # Call the test_iam_permissions method. + # result = client.test_iam_permissions request + # + # # The returned object is of type Google::Iam::V1::TestIamPermissionsResponse. + # p result + # + def test_iam_permissions request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Iam::V1::TestIamPermissionsRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + metadata = @config.rpcs.test_iam_permissions.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::SecretManager::V1::VERSION + metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.resource + header_params["resource"] = request.resource + end + + request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") + metadata[:"x-goog-request-params"] ||= request_params_header + + options.apply_defaults timeout: @config.rpcs.test_iam_permissions.timeout, + metadata: metadata, + retry_policy: @config.rpcs.test_iam_permissions.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @secret_manager_service_stub.call_rpc :test_iam_permissions, request, options: options do |response, operation| + yield response, operation if block_given? + end + rescue ::GRPC::BadStatus => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Configuration class for the SecretManagerService API. + # + # This class represents the configuration for SecretManagerService, + # providing control over timeouts, retry behavior, logging, transport + # parameters, and other low-level controls. Certain parameters can also be + # applied individually to specific RPCs. See + # {::Google::Cloud::SecretManager::V1::SecretManagerService::Client::Configuration::Rpcs} + # for a list of RPCs that can be configured independently. + # + # Configuration can be applied globally to all clients, or to a single client + # on construction. + # + # @example + # + # # Modify the global config, setting the timeout for + # # list_secrets to 20 seconds, + # # and all remaining timeouts to 10 seconds. + # ::Google::Cloud::SecretManager::V1::SecretManagerService::Client.configure do |config| + # config.timeout = 10.0 + # config.rpcs.list_secrets.timeout = 20.0 + # end + # + # # Apply the above configuration only to a new client. + # client = ::Google::Cloud::SecretManager::V1::SecretManagerService::Client.new do |config| + # config.timeout = 10.0 + # config.rpcs.list_secrets.timeout = 20.0 + # end + # + # @!attribute [rw] endpoint + # A custom service endpoint, as a hostname or hostname:port. The default is + # nil, indicating to use the default endpoint in the current universe domain. + # @return [::String,nil] + # @!attribute [rw] credentials + # Credentials to send with calls. You may provide any of the following types: + # * (`Google::Auth::Credentials`) A googleauth credentials object + # (see the [googleauth docs](https://rubydoc.info/gems/googleauth/Google/Auth/Credentials)) + # * (`Signet::OAuth2::Client`) A signet oauth2 client object + # (see the [signet docs](https://rubydoc.info/gems/signet/Signet/OAuth2/Client)) + # * (`GRPC::Core::Channel`) a gRPC channel with included credentials + # * (`GRPC::Core::ChannelCredentials`) a gRPC credentails object + # * (`nil`) indicating no credentials + # + # @note Warning: Passing a `String` to a keyfile path or a `Hash` of credentials + # is deprecated. Providing an unvalidated credential configuration to + # Google APIs can compromise the security of your systems and data. + # + # @example + # + # # The recommended way to provide credentials is to use the `make_creds` method + # # on the appropriate credentials class for your environment. + # + # require "googleauth" + # + # credentials = ::Google::Auth::ServiceAccountCredentials.make_creds( + # json_key_io: ::File.open("/path/to/keyfile.json") + # ) + # + # client = ::Google::Cloud::SecretManager::V1::SecretManagerService::Client.new do |config| + # config.credentials = credentials + # end + # + # @note Warning: If you accept a credential configuration (JSON file or Hash) from an + # external source for authentication to Google Cloud, you must validate it before + # providing it to a Google API client library. Providing an unvalidated credential + # configuration to Google APIs can compromise the security of your systems and data. + # For more information, refer to [Validate credential configurations from external + # sources](https://cloud.google.com/docs/authentication/external/externally-sourced-credentials). + # @return [::Object] + # @!attribute [rw] scope + # The OAuth scopes + # @return [::Array<::String>] + # @!attribute [rw] lib_name + # The library name as recorded in instrumentation and logging + # @return [::String] + # @!attribute [rw] lib_version + # The library version as recorded in instrumentation and logging + # @return [::String] + # @!attribute [rw] channel_args + # Extra parameters passed to the gRPC channel. Note: this is ignored if a + # `GRPC::Core::Channel` object is provided as the credential. + # @return [::Hash] + # @!attribute [rw] interceptors + # An array of interceptors that are run before calls are executed. + # @return [::Array<::GRPC::ClientInterceptor>] + # @!attribute [rw] timeout + # The call timeout in seconds. + # @return [::Numeric] + # @!attribute [rw] metadata + # Additional gRPC headers to be sent with the call. + # @return [::Hash{::Symbol=>::String}] + # @!attribute [rw] retry_policy + # The retry policy. The value is a hash with the following keys: + # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds. + # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds. + # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier. + # * `:retry_codes` (*type:* `Array`) - The error codes that should + # trigger a retry. + # @return [::Hash] + # @!attribute [rw] quota_project + # A separate project against which to charge quota. + # @return [::String] + # @!attribute [rw] universe_domain + # The universe domain within which to make requests. This determines the + # default endpoint URL. The default value of nil uses the environment + # universe (usually the default "googleapis.com" universe). + # @return [::String,nil] + # @!attribute [rw] logger + # A custom logger to use for request/response debug logging, or the value + # `:default` (the default) to construct a default logger, or `nil` to + # explicitly disable logging. + # @return [::Logger,:default,nil] + # + class Configuration + extend ::Gapic::Config + + # @private + # The endpoint specific to the default "googleapis.com" universe. Deprecated. + DEFAULT_ENDPOINT = "secretmanager.googleapis.com" + + config_attr :endpoint, nil, ::String, nil + config_attr :credentials, nil do |value| + allowed = [::String, ::Hash, ::Proc, ::Symbol, ::Google::Auth::Credentials, ::Google::Auth::BaseClient, ::Signet::OAuth2::Client, nil] + allowed += [::GRPC::Core::Channel, ::GRPC::Core::ChannelCredentials] if defined? ::GRPC::Core::Channel + allowed.any? { |klass| klass === value } + end + config_attr :scope, nil, ::String, ::Array, nil + config_attr :lib_name, nil, ::String, nil + config_attr :lib_version, nil, ::String, nil + config_attr(:channel_args, { "grpc.service_config_disable_resolution" => 1 }, ::Hash, nil) + config_attr :interceptors, nil, ::Array, nil + config_attr :timeout, nil, ::Numeric, nil + config_attr :metadata, nil, ::Hash, nil + config_attr :retry_policy, nil, ::Hash, ::Proc, nil + config_attr :quota_project, nil, ::String, nil + config_attr :universe_domain, nil, ::String, nil + config_attr :logger, :default, ::Logger, nil, :default + + # @private + def initialize parent_config = nil + @parent_config = parent_config unless parent_config.nil? + + yield self if block_given? + end + + ## + # Configurations for individual RPCs + # @return [Rpcs] + # + def rpcs + @rpcs ||= begin + parent_rpcs = nil + parent_rpcs = @parent_config.rpcs if defined?(@parent_config) && @parent_config.respond_to?(:rpcs) + Rpcs.new parent_rpcs + end + end + + ## + # Configuration for the channel pool + # @return [::Gapic::ServiceStub::ChannelPool::Configuration] + # + def channel_pool + @channel_pool ||= ::Gapic::ServiceStub::ChannelPool::Configuration.new + end + + ## + # Configuration RPC class for the SecretManagerService API. + # + # Includes fields providing the configuration for each RPC in this service. + # Each configuration object is of type `Gapic::Config::Method` and includes + # the following configuration fields: + # + # * `timeout` (*type:* `Numeric`) - The call timeout in seconds + # * `metadata` (*type:* `Hash{Symbol=>String}`) - Additional gRPC headers + # * `retry_policy (*type:* `Hash`) - The retry policy. The policy fields + # include the following keys: + # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds. + # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds. + # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier. + # * `:retry_codes` (*type:* `Array`) - The error codes that should + # trigger a retry. + # + class Rpcs + ## + # RPC-specific configuration for `list_secrets` + # @return [::Gapic::Config::Method] + # + attr_reader :list_secrets + ## + # RPC-specific configuration for `create_secret` + # @return [::Gapic::Config::Method] + # + attr_reader :create_secret + ## + # RPC-specific configuration for `add_secret_version` + # @return [::Gapic::Config::Method] + # + attr_reader :add_secret_version + ## + # RPC-specific configuration for `get_secret` + # @return [::Gapic::Config::Method] + # + attr_reader :get_secret + ## + # RPC-specific configuration for `update_secret` + # @return [::Gapic::Config::Method] + # + attr_reader :update_secret + ## + # RPC-specific configuration for `delete_secret` + # @return [::Gapic::Config::Method] + # + attr_reader :delete_secret + ## + # RPC-specific configuration for `list_secret_versions` + # @return [::Gapic::Config::Method] + # + attr_reader :list_secret_versions + ## + # RPC-specific configuration for `get_secret_version` + # @return [::Gapic::Config::Method] + # + attr_reader :get_secret_version + ## + # RPC-specific configuration for `access_secret_version` + # @return [::Gapic::Config::Method] + # + attr_reader :access_secret_version + ## + # RPC-specific configuration for `disable_secret_version` + # @return [::Gapic::Config::Method] + # + attr_reader :disable_secret_version + ## + # RPC-specific configuration for `enable_secret_version` + # @return [::Gapic::Config::Method] + # + attr_reader :enable_secret_version + ## + # RPC-specific configuration for `destroy_secret_version` + # @return [::Gapic::Config::Method] + # + attr_reader :destroy_secret_version + ## + # RPC-specific configuration for `set_iam_policy` + # @return [::Gapic::Config::Method] + # + attr_reader :set_iam_policy + ## + # RPC-specific configuration for `get_iam_policy` + # @return [::Gapic::Config::Method] + # + attr_reader :get_iam_policy + ## + # RPC-specific configuration for `test_iam_permissions` + # @return [::Gapic::Config::Method] + # + attr_reader :test_iam_permissions + + # @private + def initialize parent_rpcs = nil + list_secrets_config = parent_rpcs.list_secrets if parent_rpcs.respond_to? :list_secrets + @list_secrets = ::Gapic::Config::Method.new list_secrets_config + create_secret_config = parent_rpcs.create_secret if parent_rpcs.respond_to? :create_secret + @create_secret = ::Gapic::Config::Method.new create_secret_config + add_secret_version_config = parent_rpcs.add_secret_version if parent_rpcs.respond_to? :add_secret_version + @add_secret_version = ::Gapic::Config::Method.new add_secret_version_config + get_secret_config = parent_rpcs.get_secret if parent_rpcs.respond_to? :get_secret + @get_secret = ::Gapic::Config::Method.new get_secret_config + update_secret_config = parent_rpcs.update_secret if parent_rpcs.respond_to? :update_secret + @update_secret = ::Gapic::Config::Method.new update_secret_config + delete_secret_config = parent_rpcs.delete_secret if parent_rpcs.respond_to? :delete_secret + @delete_secret = ::Gapic::Config::Method.new delete_secret_config + list_secret_versions_config = parent_rpcs.list_secret_versions if parent_rpcs.respond_to? :list_secret_versions + @list_secret_versions = ::Gapic::Config::Method.new list_secret_versions_config + get_secret_version_config = parent_rpcs.get_secret_version if parent_rpcs.respond_to? :get_secret_version + @get_secret_version = ::Gapic::Config::Method.new get_secret_version_config + access_secret_version_config = parent_rpcs.access_secret_version if parent_rpcs.respond_to? :access_secret_version + @access_secret_version = ::Gapic::Config::Method.new access_secret_version_config + disable_secret_version_config = parent_rpcs.disable_secret_version if parent_rpcs.respond_to? :disable_secret_version + @disable_secret_version = ::Gapic::Config::Method.new disable_secret_version_config + enable_secret_version_config = parent_rpcs.enable_secret_version if parent_rpcs.respond_to? :enable_secret_version + @enable_secret_version = ::Gapic::Config::Method.new enable_secret_version_config + destroy_secret_version_config = parent_rpcs.destroy_secret_version if parent_rpcs.respond_to? :destroy_secret_version + @destroy_secret_version = ::Gapic::Config::Method.new destroy_secret_version_config + set_iam_policy_config = parent_rpcs.set_iam_policy if parent_rpcs.respond_to? :set_iam_policy + @set_iam_policy = ::Gapic::Config::Method.new set_iam_policy_config + get_iam_policy_config = parent_rpcs.get_iam_policy if parent_rpcs.respond_to? :get_iam_policy + @get_iam_policy = ::Gapic::Config::Method.new get_iam_policy_config + test_iam_permissions_config = parent_rpcs.test_iam_permissions if parent_rpcs.respond_to? :test_iam_permissions + @test_iam_permissions = ::Gapic::Config::Method.new test_iam_permissions_config + + yield self if block_given? + end + end + end + end + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-secret_manager-v1/lib/google/cloud/secret_manager/v1/secret_manager_service/credentials.rb b/owl-bot-staging/google-cloud-secret_manager-v1/lib/google/cloud/secret_manager/v1/secret_manager_service/credentials.rb new file mode 100644 index 000000000000..b47fca61abf1 --- /dev/null +++ b/owl-bot-staging/google-cloud-secret_manager-v1/lib/google/cloud/secret_manager/v1/secret_manager_service/credentials.rb @@ -0,0 +1,51 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +require "googleauth" + +module Google + module Cloud + module SecretManager + module V1 + module SecretManagerService + # Credentials for the SecretManagerService API. + class Credentials < ::Google::Auth::Credentials + self.scope = [ + "https://www.googleapis.com/auth/cloud-platform" + ] + self.env_vars = [ + "SECRET_MANAGER_CREDENTIALS", + "SECRET_MANAGER_KEYFILE", + "GOOGLE_CLOUD_CREDENTIALS", + "GOOGLE_CLOUD_KEYFILE", + "GCLOUD_KEYFILE", + "SECRET_MANAGER_CREDENTIALS_JSON", + "SECRET_MANAGER_KEYFILE_JSON", + "GOOGLE_CLOUD_CREDENTIALS_JSON", + "GOOGLE_CLOUD_KEYFILE_JSON", + "GCLOUD_KEYFILE_JSON" + ] + self.paths = [ + "~/.config/google_cloud/application_default_credentials.json" + ] + end + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-secret_manager-v1/lib/google/cloud/secret_manager/v1/secret_manager_service/paths.rb b/owl-bot-staging/google-cloud-secret_manager-v1/lib/google/cloud/secret_manager/v1/secret_manager_service/paths.rb new file mode 100644 index 000000000000..426a2a6ef38b --- /dev/null +++ b/owl-bot-staging/google-cloud-secret_manager-v1/lib/google/cloud/secret_manager/v1/secret_manager_service/paths.rb @@ -0,0 +1,167 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + + +module Google + module Cloud + module SecretManager + module V1 + module SecretManagerService + # Path helper methods for the SecretManagerService API. + module Paths + ## + # Create a fully-qualified Location resource string. + # + # The resource will be in the following format: + # + # `projects/{project}/locations/{location}` + # + # @param project [String] + # @param location [String] + # + # @return [::String] + def location_path project:, location: + raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" + + "projects/#{project}/locations/#{location}" + end + + ## + # Create a fully-qualified Project resource string. + # + # The resource will be in the following format: + # + # `projects/{project}` + # + # @param project [String] + # + # @return [::String] + def project_path project: + "projects/#{project}" + end + + ## + # Create a fully-qualified Secret resource string. + # + # @overload secret_path(project:, secret:) + # The resource will be in the following format: + # + # `projects/{project}/secrets/{secret}` + # + # @param project [String] + # @param secret [String] + # + # @overload secret_path(project:, location:, secret:) + # The resource will be in the following format: + # + # `projects/{project}/locations/{location}/secrets/{secret}` + # + # @param project [String] + # @param location [String] + # @param secret [String] + # + # @return [::String] + def secret_path **args + resources = { + "project:secret" => (proc do |project:, secret:| + raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" + + "projects/#{project}/secrets/#{secret}" + end), + "location:project:secret" => (proc do |project:, location:, secret:| + raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" + raise ::ArgumentError, "location cannot contain /" if location.to_s.include? "/" + + "projects/#{project}/locations/#{location}/secrets/#{secret}" + end) + } + + resource = resources[args.keys.sort.join(":")] + raise ::ArgumentError, "no resource found for values #{args.keys}" if resource.nil? + resource.call(**args) + end + + ## + # Create a fully-qualified SecretVersion resource string. + # + # @overload secret_version_path(project:, secret:, secret_version:) + # The resource will be in the following format: + # + # `projects/{project}/secrets/{secret}/versions/{secret_version}` + # + # @param project [String] + # @param secret [String] + # @param secret_version [String] + # + # @overload secret_version_path(project:, location:, secret:, secret_version:) + # The resource will be in the following format: + # + # `projects/{project}/locations/{location}/secrets/{secret}/versions/{secret_version}` + # + # @param project [String] + # @param location [String] + # @param secret [String] + # @param secret_version [String] + # + # @return [::String] + def secret_version_path **args + resources = { + "project:secret:secret_version" => (proc do |project:, secret:, secret_version:| + raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" + raise ::ArgumentError, "secret cannot contain /" if secret.to_s.include? "/" + + "projects/#{project}/secrets/#{secret}/versions/#{secret_version}" + end), + "location:project:secret:secret_version" => (proc do |project:, location:, secret:, secret_version:| + raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" + raise ::ArgumentError, "location cannot contain /" if location.to_s.include? "/" + raise ::ArgumentError, "secret cannot contain /" if secret.to_s.include? "/" + + "projects/#{project}/locations/#{location}/secrets/#{secret}/versions/#{secret_version}" + end) + } + + resource = resources[args.keys.sort.join(":")] + raise ::ArgumentError, "no resource found for values #{args.keys}" if resource.nil? + resource.call(**args) + end + + ## + # Create a fully-qualified Topic resource string. + # + # The resource will be in the following format: + # + # `projects/{project}/topics/{topic}` + # + # @param project [String] + # @param topic [String] + # + # @return [::String] + def topic_path project:, topic: + raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" + + "projects/#{project}/topics/#{topic}" + end + + extend self + end + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-secret_manager-v1/lib/google/cloud/secret_manager/v1/secret_manager_service/rest.rb b/owl-bot-staging/google-cloud-secret_manager-v1/lib/google/cloud/secret_manager/v1/secret_manager_service/rest.rb new file mode 100644 index 000000000000..75d9fc9de126 --- /dev/null +++ b/owl-bot-staging/google-cloud-secret_manager-v1/lib/google/cloud/secret_manager/v1/secret_manager_service/rest.rb @@ -0,0 +1,59 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +require "gapic/rest" +require "gapic/config" +require "gapic/config/method" + +require "google/cloud/secret_manager/v1/version" +require "google/cloud/secret_manager/v1/bindings_override" + +require "google/cloud/secret_manager/v1/secret_manager_service/credentials" +require "google/cloud/secret_manager/v1/secret_manager_service/paths" +require "google/cloud/secret_manager/v1/secret_manager_service/rest/client" + +module Google + module Cloud + module SecretManager + module V1 + ## + # Secret Manager Service + # + # Manages secrets and operations using those secrets. Implements a REST + # model with the following objects: + # + # * {::Google::Cloud::SecretManager::V1::Secret Secret} + # * {::Google::Cloud::SecretManager::V1::SecretVersion SecretVersion} + # + # To load this service and instantiate a REST client: + # + # require "google/cloud/secret_manager/v1/secret_manager_service/rest" + # client = ::Google::Cloud::SecretManager::V1::SecretManagerService::Rest::Client.new + # + module SecretManagerService + # Client for the REST transport + module Rest + end + end + end + end + end +end + +helper_path = ::File.join __dir__, "rest", "helpers.rb" +require "google/cloud/secret_manager/v1/secret_manager_service/rest/helpers" if ::File.file? helper_path diff --git a/owl-bot-staging/google-cloud-secret_manager-v1/lib/google/cloud/secret_manager/v1/secret_manager_service/rest/client.rb b/owl-bot-staging/google-cloud-secret_manager-v1/lib/google/cloud/secret_manager/v1/secret_manager_service/rest/client.rb new file mode 100644 index 000000000000..403207f878b0 --- /dev/null +++ b/owl-bot-staging/google-cloud-secret_manager-v1/lib/google/cloud/secret_manager/v1/secret_manager_service/rest/client.rb @@ -0,0 +1,1849 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +require "google/cloud/errors" +require "google/cloud/secretmanager/v1/service_pb" +require "google/cloud/secret_manager/v1/secret_manager_service/rest/service_stub" +require "google/cloud/location/rest" + +module Google + module Cloud + module SecretManager + module V1 + module SecretManagerService + module Rest + ## + # REST client for the SecretManagerService service. + # + # Secret Manager Service + # + # Manages secrets and operations using those secrets. Implements a REST + # model with the following objects: + # + # * {::Google::Cloud::SecretManager::V1::Secret Secret} + # * {::Google::Cloud::SecretManager::V1::SecretVersion SecretVersion} + # + class Client + # @private + API_VERSION = "" + + # @private + DEFAULT_ENDPOINT_TEMPLATE = "secretmanager.$UNIVERSE_DOMAIN$" + + include Paths + + # @private + attr_reader :secret_manager_service_stub + + ## + # Configure the SecretManagerService Client class. + # + # See {::Google::Cloud::SecretManager::V1::SecretManagerService::Rest::Client::Configuration} + # for a description of the configuration fields. + # + # @example + # + # # Modify the configuration for all SecretManagerService clients + # ::Google::Cloud::SecretManager::V1::SecretManagerService::Rest::Client.configure do |config| + # config.timeout = 10.0 + # end + # + # @yield [config] Configure the Client client. + # @yieldparam config [Client::Configuration] + # + # @return [Client::Configuration] + # + def self.configure + @configure ||= begin + namespace = ["Google", "Cloud", "SecretManager", "V1"] + parent_config = while namespace.any? + parent_name = namespace.join "::" + parent_const = const_get parent_name + break parent_const.configure if parent_const.respond_to? :configure + namespace.pop + end + default_config = Client::Configuration.new parent_config + + default_config.rpcs.list_secrets.timeout = 60.0 + + default_config.rpcs.create_secret.timeout = 60.0 + + default_config.rpcs.add_secret_version.timeout = 60.0 + + default_config.rpcs.get_secret.timeout = 60.0 + + default_config.rpcs.update_secret.timeout = 60.0 + + default_config.rpcs.delete_secret.timeout = 60.0 + + default_config.rpcs.list_secret_versions.timeout = 60.0 + + default_config.rpcs.get_secret_version.timeout = 60.0 + + default_config.rpcs.access_secret_version.timeout = 60.0 + default_config.rpcs.access_secret_version.retry_policy = { + initial_delay: 2.0, max_delay: 60.0, multiplier: 2.0, retry_codes: [14, 8] + } + + default_config.rpcs.disable_secret_version.timeout = 60.0 + + default_config.rpcs.enable_secret_version.timeout = 60.0 + + default_config.rpcs.destroy_secret_version.timeout = 60.0 + + default_config.rpcs.set_iam_policy.timeout = 60.0 + + default_config.rpcs.get_iam_policy.timeout = 60.0 + + default_config.rpcs.test_iam_permissions.timeout = 60.0 + + default_config + end + yield @configure if block_given? + @configure + end + + ## + # Configure the SecretManagerService Client instance. + # + # The configuration is set to the derived mode, meaning that values can be changed, + # but structural changes (adding new fields, etc.) are not allowed. Structural changes + # should be made on {Client.configure}. + # + # See {::Google::Cloud::SecretManager::V1::SecretManagerService::Rest::Client::Configuration} + # for a description of the configuration fields. + # + # @yield [config] Configure the Client client. + # @yieldparam config [Client::Configuration] + # + # @return [Client::Configuration] + # + def configure + yield @config if block_given? + @config + end + + ## + # The effective universe domain + # + # @return [String] + # + def universe_domain + @secret_manager_service_stub.universe_domain + end + + ## + # Create a new SecretManagerService REST client object. + # + # @example + # + # # Create a client using the default configuration + # client = ::Google::Cloud::SecretManager::V1::SecretManagerService::Rest::Client.new + # + # # Create a client using a custom configuration + # client = ::Google::Cloud::SecretManager::V1::SecretManagerService::Rest::Client.new do |config| + # config.timeout = 10.0 + # end + # + # @yield [config] Configure the SecretManagerService client. + # @yieldparam config [Client::Configuration] + # + def initialize + # Create the configuration object + @config = Configuration.new Client.configure + + # Yield the configuration if needed + yield @config if block_given? + + # Create credentials + credentials = @config.credentials + # Use self-signed JWT if the endpoint is unchanged from default, + # but only if the default endpoint does not have a region prefix. + enable_self_signed_jwt = @config.endpoint.nil? || + (@config.endpoint == Configuration::DEFAULT_ENDPOINT && + !@config.endpoint.split(".").first.include?("-")) + credentials ||= Credentials.default scope: @config.scope, + enable_self_signed_jwt: enable_self_signed_jwt + if credentials.is_a?(::String) || credentials.is_a?(::Hash) + credentials = Credentials.new credentials, scope: @config.scope + end + + @quota_project_id = @config.quota_project + @quota_project_id ||= credentials.quota_project_id if credentials.respond_to? :quota_project_id + + @secret_manager_service_stub = ::Google::Cloud::SecretManager::V1::SecretManagerService::Rest::ServiceStub.new( + endpoint: @config.endpoint, + endpoint_template: DEFAULT_ENDPOINT_TEMPLATE, + universe_domain: @config.universe_domain, + credentials: credentials, + logger: @config.logger + ) + + @secret_manager_service_stub.logger(stub: true)&.info do |entry| + entry.set_system_name + entry.set_service + entry.message = "Created client for #{entry.service}" + entry.set_credentials_fields credentials + entry.set "customEndpoint", @config.endpoint if @config.endpoint + entry.set "defaultTimeout", @config.timeout if @config.timeout + entry.set "quotaProject", @quota_project_id if @quota_project_id + end + + @location_client = Google::Cloud::Location::Locations::Rest::Client.new do |config| + config.credentials = credentials + config.quota_project = @quota_project_id + config.endpoint = @secret_manager_service_stub.endpoint + config.universe_domain = @secret_manager_service_stub.universe_domain + config.bindings_override = @config.bindings_override + config.logger = @secret_manager_service_stub.logger if config.respond_to? :logger= + end + end + + ## + # Get the associated client for mix-in of the Locations. + # + # @return [Google::Cloud::Location::Locations::Rest::Client] + # + attr_reader :location_client + + ## + # The logger used for request/response debug logging. + # + # @return [Logger] + # + def logger + @secret_manager_service_stub.logger + end + + # Service calls + + ## + # Lists {::Google::Cloud::SecretManager::V1::Secret Secrets}. + # + # @overload list_secrets(request, options = nil) + # Pass arguments to `list_secrets` via a request object, either of type + # {::Google::Cloud::SecretManager::V1::ListSecretsRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::SecretManager::V1::ListSecretsRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @overload list_secrets(parent: nil, page_size: nil, page_token: nil, filter: nil) + # Pass arguments to `list_secrets` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param parent [::String] + # Required. The resource name of the project associated with the + # {::Google::Cloud::SecretManager::V1::Secret Secrets}, in the format `projects/*` + # or `projects/*/locations/*` + # @param page_size [::Integer] + # Optional. The maximum number of results to be returned in a single page. If + # set to 0, the server decides the number of results to return. If the + # number is greater than 25000, it is capped at 25000. + # @param page_token [::String] + # Optional. Pagination token, returned earlier via + # {::Google::Cloud::SecretManager::V1::ListSecretsResponse#next_page_token ListSecretsResponse.next_page_token}. + # @param filter [::String] + # Optional. Filter string, adhering to the rules in + # [List-operation + # filtering](https://cloud.google.com/secret-manager/docs/filtering). List + # only secrets matching the filter. If filter is empty, all secrets are + # listed. + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Gapic::Rest::PagedEnumerable<::Google::Cloud::SecretManager::V1::Secret>] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Gapic::Rest::PagedEnumerable<::Google::Cloud::SecretManager::V1::Secret>] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/secret_manager/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::SecretManager::V1::SecretManagerService::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::SecretManager::V1::ListSecretsRequest.new + # + # # Call the list_secrets method. + # result = client.list_secrets request + # + # # The returned object is of type Gapic::PagedEnumerable. You can iterate + # # over elements, and API calls will be issued to fetch pages as needed. + # result.each do |item| + # # Each element is of type ::Google::Cloud::SecretManager::V1::Secret. + # p item + # end + # + def list_secrets request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::SecretManager::V1::ListSecretsRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + call_metadata = @config.rpcs.list_secrets.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::SecretManager::V1::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + options.apply_defaults timeout: @config.rpcs.list_secrets.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.list_secrets.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @secret_manager_service_stub.list_secrets request, options do |result, operation| + result = ::Gapic::Rest::PagedEnumerable.new @secret_manager_service_stub, :list_secrets, "secrets", request, result, options + yield result, operation if block_given? + throw :response, result + end + rescue ::Gapic::Rest::Error => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Creates a new {::Google::Cloud::SecretManager::V1::Secret Secret} containing no + # {::Google::Cloud::SecretManager::V1::SecretVersion SecretVersions}. + # + # @overload create_secret(request, options = nil) + # Pass arguments to `create_secret` via a request object, either of type + # {::Google::Cloud::SecretManager::V1::CreateSecretRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::SecretManager::V1::CreateSecretRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @overload create_secret(parent: nil, secret_id: nil, secret: nil) + # Pass arguments to `create_secret` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param parent [::String] + # Required. The resource name of the project to associate with the + # {::Google::Cloud::SecretManager::V1::Secret Secret}, in the format `projects/*` + # or `projects/*/locations/*`. + # @param secret_id [::String] + # Required. This must be unique within the project. + # + # A secret ID is a string with a maximum length of 255 characters and can + # contain uppercase and lowercase letters, numerals, and the hyphen (`-`) and + # underscore (`_`) characters. + # @param secret [::Google::Cloud::SecretManager::V1::Secret, ::Hash] + # Required. A {::Google::Cloud::SecretManager::V1::Secret Secret} with initial + # field values. + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Cloud::SecretManager::V1::Secret] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::SecretManager::V1::Secret] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/secret_manager/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::SecretManager::V1::SecretManagerService::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::SecretManager::V1::CreateSecretRequest.new + # + # # Call the create_secret method. + # result = client.create_secret request + # + # # The returned object is of type Google::Cloud::SecretManager::V1::Secret. + # p result + # + def create_secret request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::SecretManager::V1::CreateSecretRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + call_metadata = @config.rpcs.create_secret.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::SecretManager::V1::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + options.apply_defaults timeout: @config.rpcs.create_secret.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.create_secret.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @secret_manager_service_stub.create_secret request, options do |result, operation| + yield result, operation if block_given? + end + rescue ::Gapic::Rest::Error => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Creates a new {::Google::Cloud::SecretManager::V1::SecretVersion SecretVersion} + # containing secret data and attaches it to an existing + # {::Google::Cloud::SecretManager::V1::Secret Secret}. + # + # @overload add_secret_version(request, options = nil) + # Pass arguments to `add_secret_version` via a request object, either of type + # {::Google::Cloud::SecretManager::V1::AddSecretVersionRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::SecretManager::V1::AddSecretVersionRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @overload add_secret_version(parent: nil, payload: nil) + # Pass arguments to `add_secret_version` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param parent [::String] + # Required. The resource name of the + # {::Google::Cloud::SecretManager::V1::Secret Secret} to associate with the + # {::Google::Cloud::SecretManager::V1::SecretVersion SecretVersion} in the format + # `projects/*/secrets/*` or `projects/*/locations/*/secrets/*`. + # @param payload [::Google::Cloud::SecretManager::V1::SecretPayload, ::Hash] + # Required. The secret payload of the + # {::Google::Cloud::SecretManager::V1::SecretVersion SecretVersion}. + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Cloud::SecretManager::V1::SecretVersion] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::SecretManager::V1::SecretVersion] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/secret_manager/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::SecretManager::V1::SecretManagerService::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::SecretManager::V1::AddSecretVersionRequest.new + # + # # Call the add_secret_version method. + # result = client.add_secret_version request + # + # # The returned object is of type Google::Cloud::SecretManager::V1::SecretVersion. + # p result + # + def add_secret_version request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::SecretManager::V1::AddSecretVersionRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + call_metadata = @config.rpcs.add_secret_version.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::SecretManager::V1::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + options.apply_defaults timeout: @config.rpcs.add_secret_version.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.add_secret_version.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @secret_manager_service_stub.add_secret_version request, options do |result, operation| + yield result, operation if block_given? + end + rescue ::Gapic::Rest::Error => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Gets metadata for a given {::Google::Cloud::SecretManager::V1::Secret Secret}. + # + # @overload get_secret(request, options = nil) + # Pass arguments to `get_secret` via a request object, either of type + # {::Google::Cloud::SecretManager::V1::GetSecretRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::SecretManager::V1::GetSecretRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @overload get_secret(name: nil) + # Pass arguments to `get_secret` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param name [::String] + # Required. The resource name of the + # {::Google::Cloud::SecretManager::V1::Secret Secret}, in the format + # `projects/*/secrets/*` or `projects/*/locations/*/secrets/*`. + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Cloud::SecretManager::V1::Secret] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::SecretManager::V1::Secret] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/secret_manager/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::SecretManager::V1::SecretManagerService::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::SecretManager::V1::GetSecretRequest.new + # + # # Call the get_secret method. + # result = client.get_secret request + # + # # The returned object is of type Google::Cloud::SecretManager::V1::Secret. + # p result + # + def get_secret request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::SecretManager::V1::GetSecretRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + call_metadata = @config.rpcs.get_secret.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::SecretManager::V1::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + options.apply_defaults timeout: @config.rpcs.get_secret.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.get_secret.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @secret_manager_service_stub.get_secret request, options do |result, operation| + yield result, operation if block_given? + end + rescue ::Gapic::Rest::Error => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Updates metadata of an existing + # {::Google::Cloud::SecretManager::V1::Secret Secret}. + # + # @overload update_secret(request, options = nil) + # Pass arguments to `update_secret` via a request object, either of type + # {::Google::Cloud::SecretManager::V1::UpdateSecretRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::SecretManager::V1::UpdateSecretRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @overload update_secret(secret: nil, update_mask: nil) + # Pass arguments to `update_secret` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param secret [::Google::Cloud::SecretManager::V1::Secret, ::Hash] + # Required. {::Google::Cloud::SecretManager::V1::Secret Secret} with updated field + # values. + # @param update_mask [::Google::Protobuf::FieldMask, ::Hash] + # Required. Specifies the fields to be updated. + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Cloud::SecretManager::V1::Secret] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::SecretManager::V1::Secret] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/secret_manager/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::SecretManager::V1::SecretManagerService::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::SecretManager::V1::UpdateSecretRequest.new + # + # # Call the update_secret method. + # result = client.update_secret request + # + # # The returned object is of type Google::Cloud::SecretManager::V1::Secret. + # p result + # + def update_secret request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::SecretManager::V1::UpdateSecretRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + call_metadata = @config.rpcs.update_secret.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::SecretManager::V1::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + options.apply_defaults timeout: @config.rpcs.update_secret.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.update_secret.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @secret_manager_service_stub.update_secret request, options do |result, operation| + yield result, operation if block_given? + end + rescue ::Gapic::Rest::Error => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Deletes a {::Google::Cloud::SecretManager::V1::Secret Secret}. + # + # @overload delete_secret(request, options = nil) + # Pass arguments to `delete_secret` via a request object, either of type + # {::Google::Cloud::SecretManager::V1::DeleteSecretRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::SecretManager::V1::DeleteSecretRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @overload delete_secret(name: nil, etag: nil) + # Pass arguments to `delete_secret` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param name [::String] + # Required. The resource name of the + # {::Google::Cloud::SecretManager::V1::Secret Secret} to delete in the format + # `projects/*/secrets/*`. + # @param etag [::String] + # Optional. Etag of the {::Google::Cloud::SecretManager::V1::Secret Secret}. The + # request succeeds if it matches the etag of the currently stored secret + # object. If the etag is omitted, the request succeeds. + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Protobuf::Empty] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Protobuf::Empty] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/secret_manager/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::SecretManager::V1::SecretManagerService::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::SecretManager::V1::DeleteSecretRequest.new + # + # # Call the delete_secret method. + # result = client.delete_secret request + # + # # The returned object is of type Google::Protobuf::Empty. + # p result + # + def delete_secret request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::SecretManager::V1::DeleteSecretRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + call_metadata = @config.rpcs.delete_secret.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::SecretManager::V1::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + options.apply_defaults timeout: @config.rpcs.delete_secret.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.delete_secret.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @secret_manager_service_stub.delete_secret request, options do |result, operation| + yield result, operation if block_given? + end + rescue ::Gapic::Rest::Error => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Lists {::Google::Cloud::SecretManager::V1::SecretVersion SecretVersions}. This + # call does not return secret data. + # + # @overload list_secret_versions(request, options = nil) + # Pass arguments to `list_secret_versions` via a request object, either of type + # {::Google::Cloud::SecretManager::V1::ListSecretVersionsRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::SecretManager::V1::ListSecretVersionsRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @overload list_secret_versions(parent: nil, page_size: nil, page_token: nil, filter: nil) + # Pass arguments to `list_secret_versions` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param parent [::String] + # Required. The resource name of the + # {::Google::Cloud::SecretManager::V1::Secret Secret} associated with the + # {::Google::Cloud::SecretManager::V1::SecretVersion SecretVersions} to list, in + # the format `projects/*/secrets/*` or `projects/*/locations/*/secrets/*`. + # @param page_size [::Integer] + # Optional. The maximum number of results to be returned in a single page. If + # set to 0, the server decides the number of results to return. If the + # number is greater than 25000, it is capped at 25000. + # @param page_token [::String] + # Optional. Pagination token, returned earlier via + # ListSecretVersionsResponse.next_page_token][]. + # @param filter [::String] + # Optional. Filter string, adhering to the rules in + # [List-operation + # filtering](https://cloud.google.com/secret-manager/docs/filtering). List + # only secret versions matching the filter. If filter is empty, all secret + # versions are listed. + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Gapic::Rest::PagedEnumerable<::Google::Cloud::SecretManager::V1::SecretVersion>] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Gapic::Rest::PagedEnumerable<::Google::Cloud::SecretManager::V1::SecretVersion>] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/secret_manager/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::SecretManager::V1::SecretManagerService::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::SecretManager::V1::ListSecretVersionsRequest.new + # + # # Call the list_secret_versions method. + # result = client.list_secret_versions request + # + # # The returned object is of type Gapic::PagedEnumerable. You can iterate + # # over elements, and API calls will be issued to fetch pages as needed. + # result.each do |item| + # # Each element is of type ::Google::Cloud::SecretManager::V1::SecretVersion. + # p item + # end + # + def list_secret_versions request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::SecretManager::V1::ListSecretVersionsRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + call_metadata = @config.rpcs.list_secret_versions.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::SecretManager::V1::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + options.apply_defaults timeout: @config.rpcs.list_secret_versions.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.list_secret_versions.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @secret_manager_service_stub.list_secret_versions request, options do |result, operation| + result = ::Gapic::Rest::PagedEnumerable.new @secret_manager_service_stub, :list_secret_versions, "versions", request, result, options + yield result, operation if block_given? + throw :response, result + end + rescue ::Gapic::Rest::Error => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Gets metadata for a + # {::Google::Cloud::SecretManager::V1::SecretVersion SecretVersion}. + # + # `projects/*/secrets/*/versions/latest` is an alias to the most recently + # created {::Google::Cloud::SecretManager::V1::SecretVersion SecretVersion}. + # + # @overload get_secret_version(request, options = nil) + # Pass arguments to `get_secret_version` via a request object, either of type + # {::Google::Cloud::SecretManager::V1::GetSecretVersionRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::SecretManager::V1::GetSecretVersionRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @overload get_secret_version(name: nil) + # Pass arguments to `get_secret_version` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param name [::String] + # Required. The resource name of the + # {::Google::Cloud::SecretManager::V1::SecretVersion SecretVersion} in the format + # `projects/*/secrets/*/versions/*` or + # `projects/*/locations/*/secrets/*/versions/*`. + # + # `projects/*/secrets/*/versions/latest` or + # `projects/*/locations/*/secrets/*/versions/latest` is an alias to the most + # recently created + # {::Google::Cloud::SecretManager::V1::SecretVersion SecretVersion}. + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Cloud::SecretManager::V1::SecretVersion] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::SecretManager::V1::SecretVersion] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/secret_manager/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::SecretManager::V1::SecretManagerService::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::SecretManager::V1::GetSecretVersionRequest.new + # + # # Call the get_secret_version method. + # result = client.get_secret_version request + # + # # The returned object is of type Google::Cloud::SecretManager::V1::SecretVersion. + # p result + # + def get_secret_version request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::SecretManager::V1::GetSecretVersionRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + call_metadata = @config.rpcs.get_secret_version.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::SecretManager::V1::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + options.apply_defaults timeout: @config.rpcs.get_secret_version.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.get_secret_version.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @secret_manager_service_stub.get_secret_version request, options do |result, operation| + yield result, operation if block_given? + end + rescue ::Gapic::Rest::Error => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Accesses a {::Google::Cloud::SecretManager::V1::SecretVersion SecretVersion}. + # This call returns the secret data. + # + # `projects/*/secrets/*/versions/latest` is an alias to the most recently + # created {::Google::Cloud::SecretManager::V1::SecretVersion SecretVersion}. + # + # @overload access_secret_version(request, options = nil) + # Pass arguments to `access_secret_version` via a request object, either of type + # {::Google::Cloud::SecretManager::V1::AccessSecretVersionRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::SecretManager::V1::AccessSecretVersionRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @overload access_secret_version(name: nil) + # Pass arguments to `access_secret_version` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param name [::String] + # Required. The resource name of the + # {::Google::Cloud::SecretManager::V1::SecretVersion SecretVersion} in the format + # `projects/*/secrets/*/versions/*` or + # `projects/*/locations/*/secrets/*/versions/*`. + # + # `projects/*/secrets/*/versions/latest` or + # `projects/*/locations/*/secrets/*/versions/latest` is an alias to the most + # recently created + # {::Google::Cloud::SecretManager::V1::SecretVersion SecretVersion}. + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Cloud::SecretManager::V1::AccessSecretVersionResponse] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::SecretManager::V1::AccessSecretVersionResponse] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/secret_manager/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::SecretManager::V1::SecretManagerService::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::SecretManager::V1::AccessSecretVersionRequest.new + # + # # Call the access_secret_version method. + # result = client.access_secret_version request + # + # # The returned object is of type Google::Cloud::SecretManager::V1::AccessSecretVersionResponse. + # p result + # + def access_secret_version request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::SecretManager::V1::AccessSecretVersionRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + call_metadata = @config.rpcs.access_secret_version.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::SecretManager::V1::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + options.apply_defaults timeout: @config.rpcs.access_secret_version.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.access_secret_version.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @secret_manager_service_stub.access_secret_version request, options do |result, operation| + yield result, operation if block_given? + end + rescue ::Gapic::Rest::Error => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Disables a {::Google::Cloud::SecretManager::V1::SecretVersion SecretVersion}. + # + # Sets the {::Google::Cloud::SecretManager::V1::SecretVersion#state state} of the + # {::Google::Cloud::SecretManager::V1::SecretVersion SecretVersion} to + # {::Google::Cloud::SecretManager::V1::SecretVersion::State::DISABLED DISABLED}. + # + # @overload disable_secret_version(request, options = nil) + # Pass arguments to `disable_secret_version` via a request object, either of type + # {::Google::Cloud::SecretManager::V1::DisableSecretVersionRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::SecretManager::V1::DisableSecretVersionRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @overload disable_secret_version(name: nil, etag: nil) + # Pass arguments to `disable_secret_version` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param name [::String] + # Required. The resource name of the + # {::Google::Cloud::SecretManager::V1::SecretVersion SecretVersion} to disable in + # the format `projects/*/secrets/*/versions/*` or + # `projects/*/locations/*/secrets/*/versions/*`. + # @param etag [::String] + # Optional. Etag of the + # {::Google::Cloud::SecretManager::V1::SecretVersion SecretVersion}. The request + # succeeds if it matches the etag of the currently stored secret version + # object. If the etag is omitted, the request succeeds. + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Cloud::SecretManager::V1::SecretVersion] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::SecretManager::V1::SecretVersion] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/secret_manager/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::SecretManager::V1::SecretManagerService::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::SecretManager::V1::DisableSecretVersionRequest.new + # + # # Call the disable_secret_version method. + # result = client.disable_secret_version request + # + # # The returned object is of type Google::Cloud::SecretManager::V1::SecretVersion. + # p result + # + def disable_secret_version request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::SecretManager::V1::DisableSecretVersionRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + call_metadata = @config.rpcs.disable_secret_version.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::SecretManager::V1::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + options.apply_defaults timeout: @config.rpcs.disable_secret_version.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.disable_secret_version.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @secret_manager_service_stub.disable_secret_version request, options do |result, operation| + yield result, operation if block_given? + end + rescue ::Gapic::Rest::Error => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Enables a {::Google::Cloud::SecretManager::V1::SecretVersion SecretVersion}. + # + # Sets the {::Google::Cloud::SecretManager::V1::SecretVersion#state state} of the + # {::Google::Cloud::SecretManager::V1::SecretVersion SecretVersion} to + # {::Google::Cloud::SecretManager::V1::SecretVersion::State::ENABLED ENABLED}. + # + # @overload enable_secret_version(request, options = nil) + # Pass arguments to `enable_secret_version` via a request object, either of type + # {::Google::Cloud::SecretManager::V1::EnableSecretVersionRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::SecretManager::V1::EnableSecretVersionRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @overload enable_secret_version(name: nil, etag: nil) + # Pass arguments to `enable_secret_version` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param name [::String] + # Required. The resource name of the + # {::Google::Cloud::SecretManager::V1::SecretVersion SecretVersion} to enable in + # the format `projects/*/secrets/*/versions/*` or + # `projects/*/locations/*/secrets/*/versions/*`. + # @param etag [::String] + # Optional. Etag of the + # {::Google::Cloud::SecretManager::V1::SecretVersion SecretVersion}. The request + # succeeds if it matches the etag of the currently stored secret version + # object. If the etag is omitted, the request succeeds. + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Cloud::SecretManager::V1::SecretVersion] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::SecretManager::V1::SecretVersion] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/secret_manager/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::SecretManager::V1::SecretManagerService::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::SecretManager::V1::EnableSecretVersionRequest.new + # + # # Call the enable_secret_version method. + # result = client.enable_secret_version request + # + # # The returned object is of type Google::Cloud::SecretManager::V1::SecretVersion. + # p result + # + def enable_secret_version request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::SecretManager::V1::EnableSecretVersionRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + call_metadata = @config.rpcs.enable_secret_version.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::SecretManager::V1::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + options.apply_defaults timeout: @config.rpcs.enable_secret_version.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.enable_secret_version.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @secret_manager_service_stub.enable_secret_version request, options do |result, operation| + yield result, operation if block_given? + end + rescue ::Gapic::Rest::Error => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Destroys a {::Google::Cloud::SecretManager::V1::SecretVersion SecretVersion}. + # + # Sets the {::Google::Cloud::SecretManager::V1::SecretVersion#state state} of the + # {::Google::Cloud::SecretManager::V1::SecretVersion SecretVersion} to + # {::Google::Cloud::SecretManager::V1::SecretVersion::State::DESTROYED DESTROYED} + # and irrevocably destroys the secret data. + # + # @overload destroy_secret_version(request, options = nil) + # Pass arguments to `destroy_secret_version` via a request object, either of type + # {::Google::Cloud::SecretManager::V1::DestroySecretVersionRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::SecretManager::V1::DestroySecretVersionRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @overload destroy_secret_version(name: nil, etag: nil) + # Pass arguments to `destroy_secret_version` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param name [::String] + # Required. The resource name of the + # {::Google::Cloud::SecretManager::V1::SecretVersion SecretVersion} to destroy in + # the format `projects/*/secrets/*/versions/*` or + # `projects/*/locations/*/secrets/*/versions/*`. + # @param etag [::String] + # Optional. Etag of the + # {::Google::Cloud::SecretManager::V1::SecretVersion SecretVersion}. The request + # succeeds if it matches the etag of the currently stored secret version + # object. If the etag is omitted, the request succeeds. + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Cloud::SecretManager::V1::SecretVersion] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::SecretManager::V1::SecretVersion] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/secret_manager/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::SecretManager::V1::SecretManagerService::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::SecretManager::V1::DestroySecretVersionRequest.new + # + # # Call the destroy_secret_version method. + # result = client.destroy_secret_version request + # + # # The returned object is of type Google::Cloud::SecretManager::V1::SecretVersion. + # p result + # + def destroy_secret_version request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::SecretManager::V1::DestroySecretVersionRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + call_metadata = @config.rpcs.destroy_secret_version.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::SecretManager::V1::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + options.apply_defaults timeout: @config.rpcs.destroy_secret_version.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.destroy_secret_version.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @secret_manager_service_stub.destroy_secret_version request, options do |result, operation| + yield result, operation if block_given? + end + rescue ::Gapic::Rest::Error => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Sets the access control policy on the specified secret. Replaces any + # existing policy. + # + # Permissions on + # {::Google::Cloud::SecretManager::V1::SecretVersion SecretVersions} are enforced + # according to the policy set on the associated + # {::Google::Cloud::SecretManager::V1::Secret Secret}. + # + # @overload set_iam_policy(request, options = nil) + # Pass arguments to `set_iam_policy` via a request object, either of type + # {::Google::Iam::V1::SetIamPolicyRequest} or an equivalent Hash. + # + # @param request [::Google::Iam::V1::SetIamPolicyRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @overload set_iam_policy(resource: nil, policy: nil, update_mask: nil) + # Pass arguments to `set_iam_policy` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param resource [::String] + # REQUIRED: The resource for which the policy is being specified. + # See the operation documentation for the appropriate value for this field. + # @param policy [::Google::Iam::V1::Policy, ::Hash] + # REQUIRED: The complete policy to be applied to the `resource`. The size of + # the policy is limited to a few 10s of KB. An empty policy is a + # valid policy but certain Cloud Platform services (such as Projects) + # might reject them. + # @param update_mask [::Google::Protobuf::FieldMask, ::Hash] + # OPTIONAL: A FieldMask specifying which fields of the policy to modify. Only + # the fields in the mask will be modified. If no mask is provided, the + # following default mask is used: + # + # `paths: "bindings, etag"` + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Iam::V1::Policy] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Iam::V1::Policy] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/secret_manager/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::SecretManager::V1::SecretManagerService::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Iam::V1::SetIamPolicyRequest.new + # + # # Call the set_iam_policy method. + # result = client.set_iam_policy request + # + # # The returned object is of type Google::Iam::V1::Policy. + # p result + # + def set_iam_policy request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Iam::V1::SetIamPolicyRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + call_metadata = @config.rpcs.set_iam_policy.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::SecretManager::V1::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + options.apply_defaults timeout: @config.rpcs.set_iam_policy.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.set_iam_policy.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @secret_manager_service_stub.set_iam_policy request, options do |result, operation| + yield result, operation if block_given? + end + rescue ::Gapic::Rest::Error => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Gets the access control policy for a secret. + # Returns empty policy if the secret exists and does not have a policy set. + # + # @overload get_iam_policy(request, options = nil) + # Pass arguments to `get_iam_policy` via a request object, either of type + # {::Google::Iam::V1::GetIamPolicyRequest} or an equivalent Hash. + # + # @param request [::Google::Iam::V1::GetIamPolicyRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @overload get_iam_policy(resource: nil, options: nil) + # Pass arguments to `get_iam_policy` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param resource [::String] + # REQUIRED: The resource for which the policy is being requested. + # See the operation documentation for the appropriate value for this field. + # @param options [::Google::Iam::V1::GetPolicyOptions, ::Hash] + # OPTIONAL: A `GetPolicyOptions` object for specifying options to + # `GetIamPolicy`. + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Iam::V1::Policy] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Iam::V1::Policy] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/secret_manager/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::SecretManager::V1::SecretManagerService::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Iam::V1::GetIamPolicyRequest.new + # + # # Call the get_iam_policy method. + # result = client.get_iam_policy request + # + # # The returned object is of type Google::Iam::V1::Policy. + # p result + # + def get_iam_policy request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Iam::V1::GetIamPolicyRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + call_metadata = @config.rpcs.get_iam_policy.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::SecretManager::V1::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + options.apply_defaults timeout: @config.rpcs.get_iam_policy.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.get_iam_policy.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @secret_manager_service_stub.get_iam_policy request, options do |result, operation| + yield result, operation if block_given? + end + rescue ::Gapic::Rest::Error => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Returns permissions that a caller has for the specified secret. + # If the secret does not exist, this call returns an empty set of + # permissions, not a NOT_FOUND error. + # + # Note: This operation is designed to be used for building permission-aware + # UIs and command-line tools, not for authorization checking. This operation + # may "fail open" without warning. + # + # @overload test_iam_permissions(request, options = nil) + # Pass arguments to `test_iam_permissions` via a request object, either of type + # {::Google::Iam::V1::TestIamPermissionsRequest} or an equivalent Hash. + # + # @param request [::Google::Iam::V1::TestIamPermissionsRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @overload test_iam_permissions(resource: nil, permissions: nil) + # Pass arguments to `test_iam_permissions` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param resource [::String] + # REQUIRED: The resource for which the policy detail is being requested. + # See the operation documentation for the appropriate value for this field. + # @param permissions [::Array<::String>] + # The set of permissions to check for the `resource`. Permissions with + # wildcards (such as '*' or 'storage.*') are not allowed. For more + # information see + # [IAM Overview](https://cloud.google.com/iam/docs/overview#permissions). + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Iam::V1::TestIamPermissionsResponse] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Iam::V1::TestIamPermissionsResponse] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/secret_manager/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::SecretManager::V1::SecretManagerService::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Iam::V1::TestIamPermissionsRequest.new + # + # # Call the test_iam_permissions method. + # result = client.test_iam_permissions request + # + # # The returned object is of type Google::Iam::V1::TestIamPermissionsResponse. + # p result + # + def test_iam_permissions request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Iam::V1::TestIamPermissionsRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + call_metadata = @config.rpcs.test_iam_permissions.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::SecretManager::V1::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + options.apply_defaults timeout: @config.rpcs.test_iam_permissions.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.test_iam_permissions.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @secret_manager_service_stub.test_iam_permissions request, options do |result, operation| + yield result, operation if block_given? + end + rescue ::Gapic::Rest::Error => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Configuration class for the SecretManagerService REST API. + # + # This class represents the configuration for SecretManagerService REST, + # providing control over timeouts, retry behavior, logging, transport + # parameters, and other low-level controls. Certain parameters can also be + # applied individually to specific RPCs. See + # {::Google::Cloud::SecretManager::V1::SecretManagerService::Rest::Client::Configuration::Rpcs} + # for a list of RPCs that can be configured independently. + # + # Configuration can be applied globally to all clients, or to a single client + # on construction. + # + # @example + # + # # Modify the global config, setting the timeout for + # # list_secrets to 20 seconds, + # # and all remaining timeouts to 10 seconds. + # ::Google::Cloud::SecretManager::V1::SecretManagerService::Rest::Client.configure do |config| + # config.timeout = 10.0 + # config.rpcs.list_secrets.timeout = 20.0 + # end + # + # # Apply the above configuration only to a new client. + # client = ::Google::Cloud::SecretManager::V1::SecretManagerService::Rest::Client.new do |config| + # config.timeout = 10.0 + # config.rpcs.list_secrets.timeout = 20.0 + # end + # + # @!attribute [rw] endpoint + # A custom service endpoint, as a hostname or hostname:port. The default is + # nil, indicating to use the default endpoint in the current universe domain. + # @return [::String,nil] + # @!attribute [rw] credentials + # Credentials to send with calls. You may provide any of the following types: + # * (`String`) The path to a service account key file in JSON format + # * (`Hash`) A service account key as a Hash + # * (`Google::Auth::Credentials`) A googleauth credentials object + # (see the [googleauth docs](https://rubydoc.info/gems/googleauth/Google/Auth/Credentials)) + # * (`Signet::OAuth2::Client`) A signet oauth2 client object + # (see the [signet docs](https://rubydoc.info/gems/signet/Signet/OAuth2/Client)) + # * (`nil`) indicating no credentials + # + # Warning: If you accept a credential configuration (JSON file or Hash) from an + # external source for authentication to Google Cloud, you must validate it before + # providing it to a Google API client library. Providing an unvalidated credential + # configuration to Google APIs can compromise the security of your systems and data. + # For more information, refer to [Validate credential configurations from external + # sources](https://cloud.google.com/docs/authentication/external/externally-sourced-credentials). + # @return [::Object] + # @!attribute [rw] scope + # The OAuth scopes + # @return [::Array<::String>] + # @!attribute [rw] lib_name + # The library name as recorded in instrumentation and logging + # @return [::String] + # @!attribute [rw] lib_version + # The library version as recorded in instrumentation and logging + # @return [::String] + # @!attribute [rw] timeout + # The call timeout in seconds. + # @return [::Numeric] + # @!attribute [rw] metadata + # Additional headers to be sent with the call. + # @return [::Hash{::Symbol=>::String}] + # @!attribute [rw] retry_policy + # The retry policy. The value is a hash with the following keys: + # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds. + # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds. + # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier. + # * `:retry_codes` (*type:* `Array`) - The error codes that should + # trigger a retry. + # @return [::Hash] + # @!attribute [rw] quota_project + # A separate project against which to charge quota. + # @return [::String] + # @!attribute [rw] universe_domain + # The universe domain within which to make requests. This determines the + # default endpoint URL. The default value of nil uses the environment + # universe (usually the default "googleapis.com" universe). + # @return [::String,nil] + # @!attribute [rw] logger + # A custom logger to use for request/response debug logging, or the value + # `:default` (the default) to construct a default logger, or `nil` to + # explicitly disable logging. + # @return [::Logger,:default,nil] + # + class Configuration + extend ::Gapic::Config + + # @private + # The endpoint specific to the default "googleapis.com" universe. Deprecated. + DEFAULT_ENDPOINT = "secretmanager.googleapis.com" + + config_attr :endpoint, nil, ::String, nil + config_attr :credentials, nil do |value| + allowed = [::String, ::Hash, ::Proc, ::Symbol, ::Google::Auth::Credentials, ::Google::Auth::BaseClient, ::Signet::OAuth2::Client, nil] + allowed.any? { |klass| klass === value } + end + config_attr :scope, nil, ::String, ::Array, nil + config_attr :lib_name, nil, ::String, nil + config_attr :lib_version, nil, ::String, nil + config_attr :timeout, nil, ::Numeric, nil + config_attr :metadata, nil, ::Hash, nil + config_attr :retry_policy, nil, ::Hash, ::Proc, nil + config_attr :quota_project, nil, ::String, nil + config_attr :universe_domain, nil, ::String, nil + + # @private + # Overrides for http bindings for the RPCs of this service + # are only used when this service is used as mixin, and only + # by the host service. + # @return [::Hash{::Symbol=>::Array<::Gapic::Rest::GrpcTranscoder::HttpBinding>}] + config_attr :bindings_override, {}, ::Hash, nil + config_attr :logger, :default, ::Logger, nil, :default + + # @private + def initialize parent_config = nil + @parent_config = parent_config unless parent_config.nil? + + yield self if block_given? + end + + ## + # Configurations for individual RPCs + # @return [Rpcs] + # + def rpcs + @rpcs ||= begin + parent_rpcs = nil + parent_rpcs = @parent_config.rpcs if defined?(@parent_config) && @parent_config.respond_to?(:rpcs) + Rpcs.new parent_rpcs + end + end + + ## + # Configuration RPC class for the SecretManagerService API. + # + # Includes fields providing the configuration for each RPC in this service. + # Each configuration object is of type `Gapic::Config::Method` and includes + # the following configuration fields: + # + # * `timeout` (*type:* `Numeric`) - The call timeout in seconds + # * `metadata` (*type:* `Hash{Symbol=>String}`) - Additional headers + # * `retry_policy (*type:* `Hash`) - The retry policy. The policy fields + # include the following keys: + # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds. + # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds. + # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier. + # * `:retry_codes` (*type:* `Array`) - The error codes that should + # trigger a retry. + # + class Rpcs + ## + # RPC-specific configuration for `list_secrets` + # @return [::Gapic::Config::Method] + # + attr_reader :list_secrets + ## + # RPC-specific configuration for `create_secret` + # @return [::Gapic::Config::Method] + # + attr_reader :create_secret + ## + # RPC-specific configuration for `add_secret_version` + # @return [::Gapic::Config::Method] + # + attr_reader :add_secret_version + ## + # RPC-specific configuration for `get_secret` + # @return [::Gapic::Config::Method] + # + attr_reader :get_secret + ## + # RPC-specific configuration for `update_secret` + # @return [::Gapic::Config::Method] + # + attr_reader :update_secret + ## + # RPC-specific configuration for `delete_secret` + # @return [::Gapic::Config::Method] + # + attr_reader :delete_secret + ## + # RPC-specific configuration for `list_secret_versions` + # @return [::Gapic::Config::Method] + # + attr_reader :list_secret_versions + ## + # RPC-specific configuration for `get_secret_version` + # @return [::Gapic::Config::Method] + # + attr_reader :get_secret_version + ## + # RPC-specific configuration for `access_secret_version` + # @return [::Gapic::Config::Method] + # + attr_reader :access_secret_version + ## + # RPC-specific configuration for `disable_secret_version` + # @return [::Gapic::Config::Method] + # + attr_reader :disable_secret_version + ## + # RPC-specific configuration for `enable_secret_version` + # @return [::Gapic::Config::Method] + # + attr_reader :enable_secret_version + ## + # RPC-specific configuration for `destroy_secret_version` + # @return [::Gapic::Config::Method] + # + attr_reader :destroy_secret_version + ## + # RPC-specific configuration for `set_iam_policy` + # @return [::Gapic::Config::Method] + # + attr_reader :set_iam_policy + ## + # RPC-specific configuration for `get_iam_policy` + # @return [::Gapic::Config::Method] + # + attr_reader :get_iam_policy + ## + # RPC-specific configuration for `test_iam_permissions` + # @return [::Gapic::Config::Method] + # + attr_reader :test_iam_permissions + + # @private + def initialize parent_rpcs = nil + list_secrets_config = parent_rpcs.list_secrets if parent_rpcs.respond_to? :list_secrets + @list_secrets = ::Gapic::Config::Method.new list_secrets_config + create_secret_config = parent_rpcs.create_secret if parent_rpcs.respond_to? :create_secret + @create_secret = ::Gapic::Config::Method.new create_secret_config + add_secret_version_config = parent_rpcs.add_secret_version if parent_rpcs.respond_to? :add_secret_version + @add_secret_version = ::Gapic::Config::Method.new add_secret_version_config + get_secret_config = parent_rpcs.get_secret if parent_rpcs.respond_to? :get_secret + @get_secret = ::Gapic::Config::Method.new get_secret_config + update_secret_config = parent_rpcs.update_secret if parent_rpcs.respond_to? :update_secret + @update_secret = ::Gapic::Config::Method.new update_secret_config + delete_secret_config = parent_rpcs.delete_secret if parent_rpcs.respond_to? :delete_secret + @delete_secret = ::Gapic::Config::Method.new delete_secret_config + list_secret_versions_config = parent_rpcs.list_secret_versions if parent_rpcs.respond_to? :list_secret_versions + @list_secret_versions = ::Gapic::Config::Method.new list_secret_versions_config + get_secret_version_config = parent_rpcs.get_secret_version if parent_rpcs.respond_to? :get_secret_version + @get_secret_version = ::Gapic::Config::Method.new get_secret_version_config + access_secret_version_config = parent_rpcs.access_secret_version if parent_rpcs.respond_to? :access_secret_version + @access_secret_version = ::Gapic::Config::Method.new access_secret_version_config + disable_secret_version_config = parent_rpcs.disable_secret_version if parent_rpcs.respond_to? :disable_secret_version + @disable_secret_version = ::Gapic::Config::Method.new disable_secret_version_config + enable_secret_version_config = parent_rpcs.enable_secret_version if parent_rpcs.respond_to? :enable_secret_version + @enable_secret_version = ::Gapic::Config::Method.new enable_secret_version_config + destroy_secret_version_config = parent_rpcs.destroy_secret_version if parent_rpcs.respond_to? :destroy_secret_version + @destroy_secret_version = ::Gapic::Config::Method.new destroy_secret_version_config + set_iam_policy_config = parent_rpcs.set_iam_policy if parent_rpcs.respond_to? :set_iam_policy + @set_iam_policy = ::Gapic::Config::Method.new set_iam_policy_config + get_iam_policy_config = parent_rpcs.get_iam_policy if parent_rpcs.respond_to? :get_iam_policy + @get_iam_policy = ::Gapic::Config::Method.new get_iam_policy_config + test_iam_permissions_config = parent_rpcs.test_iam_permissions if parent_rpcs.respond_to? :test_iam_permissions + @test_iam_permissions = ::Gapic::Config::Method.new test_iam_permissions_config + + yield self if block_given? + end + end + end + end + end + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-secret_manager-v1/lib/google/cloud/secret_manager/v1/secret_manager_service/rest/service_stub.rb b/owl-bot-staging/google-cloud-secret_manager-v1/lib/google/cloud/secret_manager/v1/secret_manager_service/rest/service_stub.rb new file mode 100644 index 000000000000..8568784eec95 --- /dev/null +++ b/owl-bot-staging/google-cloud-secret_manager-v1/lib/google/cloud/secret_manager/v1/secret_manager_service/rest/service_stub.rb @@ -0,0 +1,1117 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +require "google/cloud/secretmanager/v1/service_pb" + +module Google + module Cloud + module SecretManager + module V1 + module SecretManagerService + module Rest + ## + # REST service stub for the SecretManagerService service. + # Service stub contains baseline method implementations + # including transcoding, making the REST call, and deserialing the response. + # + class ServiceStub + # @private + def initialize endpoint:, endpoint_template:, universe_domain:, credentials:, logger: + # These require statements are intentionally placed here to initialize + # the REST modules only when it's required. + require "gapic/rest" + + @client_stub = ::Gapic::Rest::ClientStub.new endpoint: endpoint, + endpoint_template: endpoint_template, + universe_domain: universe_domain, + credentials: credentials, + numeric_enums: true, + service_name: self.class, + raise_faraday_errors: false, + logger: logger + end + + ## + # The effective universe domain + # + # @return [String] + # + def universe_domain + @client_stub.universe_domain + end + + ## + # The effective endpoint + # + # @return [String] + # + def endpoint + @client_stub.endpoint + end + + ## + # The logger used for request/response debug logging. + # + # @return [Logger] + # + def logger stub: false + stub ? @client_stub.stub_logger : @client_stub.logger + end + + ## + # Baseline implementation for the list_secrets REST call + # + # @param request_pb [::Google::Cloud::SecretManager::V1::ListSecretsRequest] + # A request object representing the call parameters. Required. + # @param options [::Gapic::CallOptions] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Cloud::SecretManager::V1::ListSecretsResponse] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::SecretManager::V1::ListSecretsResponse] + # A result object deserialized from the server's reply + def list_secrets request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_list_secrets_request request_pb + query_string_params = if query_string_params.any? + query_string_params.to_h { |p| p.split "=", 2 } + else + {} + end + + response = @client_stub.make_http_request( + verb, + uri: uri, + body: body || "", + params: query_string_params, + method_name: "list_secrets", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Cloud::SecretManager::V1::ListSecretsResponse.decode_json response.body, ignore_unknown_fields: true + catch :response do + yield result, operation if block_given? + result + end + end + + ## + # Baseline implementation for the create_secret REST call + # + # @param request_pb [::Google::Cloud::SecretManager::V1::CreateSecretRequest] + # A request object representing the call parameters. Required. + # @param options [::Gapic::CallOptions] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Cloud::SecretManager::V1::Secret] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::SecretManager::V1::Secret] + # A result object deserialized from the server's reply + def create_secret request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_create_secret_request request_pb + query_string_params = if query_string_params.any? + query_string_params.to_h { |p| p.split "=", 2 } + else + {} + end + + response = @client_stub.make_http_request( + verb, + uri: uri, + body: body || "", + params: query_string_params, + method_name: "create_secret", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Cloud::SecretManager::V1::Secret.decode_json response.body, ignore_unknown_fields: true + catch :response do + yield result, operation if block_given? + result + end + end + + ## + # Baseline implementation for the add_secret_version REST call + # + # @param request_pb [::Google::Cloud::SecretManager::V1::AddSecretVersionRequest] + # A request object representing the call parameters. Required. + # @param options [::Gapic::CallOptions] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Cloud::SecretManager::V1::SecretVersion] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::SecretManager::V1::SecretVersion] + # A result object deserialized from the server's reply + def add_secret_version request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_add_secret_version_request request_pb + query_string_params = if query_string_params.any? + query_string_params.to_h { |p| p.split "=", 2 } + else + {} + end + + response = @client_stub.make_http_request( + verb, + uri: uri, + body: body || "", + params: query_string_params, + method_name: "add_secret_version", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Cloud::SecretManager::V1::SecretVersion.decode_json response.body, ignore_unknown_fields: true + catch :response do + yield result, operation if block_given? + result + end + end + + ## + # Baseline implementation for the get_secret REST call + # + # @param request_pb [::Google::Cloud::SecretManager::V1::GetSecretRequest] + # A request object representing the call parameters. Required. + # @param options [::Gapic::CallOptions] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Cloud::SecretManager::V1::Secret] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::SecretManager::V1::Secret] + # A result object deserialized from the server's reply + def get_secret request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_get_secret_request request_pb + query_string_params = if query_string_params.any? + query_string_params.to_h { |p| p.split "=", 2 } + else + {} + end + + response = @client_stub.make_http_request( + verb, + uri: uri, + body: body || "", + params: query_string_params, + method_name: "get_secret", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Cloud::SecretManager::V1::Secret.decode_json response.body, ignore_unknown_fields: true + catch :response do + yield result, operation if block_given? + result + end + end + + ## + # Baseline implementation for the update_secret REST call + # + # @param request_pb [::Google::Cloud::SecretManager::V1::UpdateSecretRequest] + # A request object representing the call parameters. Required. + # @param options [::Gapic::CallOptions] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Cloud::SecretManager::V1::Secret] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::SecretManager::V1::Secret] + # A result object deserialized from the server's reply + def update_secret request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_update_secret_request request_pb + query_string_params = if query_string_params.any? + query_string_params.to_h { |p| p.split "=", 2 } + else + {} + end + + response = @client_stub.make_http_request( + verb, + uri: uri, + body: body || "", + params: query_string_params, + method_name: "update_secret", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Cloud::SecretManager::V1::Secret.decode_json response.body, ignore_unknown_fields: true + catch :response do + yield result, operation if block_given? + result + end + end + + ## + # Baseline implementation for the delete_secret REST call + # + # @param request_pb [::Google::Cloud::SecretManager::V1::DeleteSecretRequest] + # A request object representing the call parameters. Required. + # @param options [::Gapic::CallOptions] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Protobuf::Empty] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Protobuf::Empty] + # A result object deserialized from the server's reply + def delete_secret request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_delete_secret_request request_pb + query_string_params = if query_string_params.any? + query_string_params.to_h { |p| p.split "=", 2 } + else + {} + end + + response = @client_stub.make_http_request( + verb, + uri: uri, + body: body || "", + params: query_string_params, + method_name: "delete_secret", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Protobuf::Empty.decode_json response.body, ignore_unknown_fields: true + catch :response do + yield result, operation if block_given? + result + end + end + + ## + # Baseline implementation for the list_secret_versions REST call + # + # @param request_pb [::Google::Cloud::SecretManager::V1::ListSecretVersionsRequest] + # A request object representing the call parameters. Required. + # @param options [::Gapic::CallOptions] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Cloud::SecretManager::V1::ListSecretVersionsResponse] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::SecretManager::V1::ListSecretVersionsResponse] + # A result object deserialized from the server's reply + def list_secret_versions request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_list_secret_versions_request request_pb + query_string_params = if query_string_params.any? + query_string_params.to_h { |p| p.split "=", 2 } + else + {} + end + + response = @client_stub.make_http_request( + verb, + uri: uri, + body: body || "", + params: query_string_params, + method_name: "list_secret_versions", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Cloud::SecretManager::V1::ListSecretVersionsResponse.decode_json response.body, ignore_unknown_fields: true + catch :response do + yield result, operation if block_given? + result + end + end + + ## + # Baseline implementation for the get_secret_version REST call + # + # @param request_pb [::Google::Cloud::SecretManager::V1::GetSecretVersionRequest] + # A request object representing the call parameters. Required. + # @param options [::Gapic::CallOptions] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Cloud::SecretManager::V1::SecretVersion] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::SecretManager::V1::SecretVersion] + # A result object deserialized from the server's reply + def get_secret_version request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_get_secret_version_request request_pb + query_string_params = if query_string_params.any? + query_string_params.to_h { |p| p.split "=", 2 } + else + {} + end + + response = @client_stub.make_http_request( + verb, + uri: uri, + body: body || "", + params: query_string_params, + method_name: "get_secret_version", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Cloud::SecretManager::V1::SecretVersion.decode_json response.body, ignore_unknown_fields: true + catch :response do + yield result, operation if block_given? + result + end + end + + ## + # Baseline implementation for the access_secret_version REST call + # + # @param request_pb [::Google::Cloud::SecretManager::V1::AccessSecretVersionRequest] + # A request object representing the call parameters. Required. + # @param options [::Gapic::CallOptions] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Cloud::SecretManager::V1::AccessSecretVersionResponse] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::SecretManager::V1::AccessSecretVersionResponse] + # A result object deserialized from the server's reply + def access_secret_version request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_access_secret_version_request request_pb + query_string_params = if query_string_params.any? + query_string_params.to_h { |p| p.split "=", 2 } + else + {} + end + + response = @client_stub.make_http_request( + verb, + uri: uri, + body: body || "", + params: query_string_params, + method_name: "access_secret_version", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Cloud::SecretManager::V1::AccessSecretVersionResponse.decode_json response.body, ignore_unknown_fields: true + catch :response do + yield result, operation if block_given? + result + end + end + + ## + # Baseline implementation for the disable_secret_version REST call + # + # @param request_pb [::Google::Cloud::SecretManager::V1::DisableSecretVersionRequest] + # A request object representing the call parameters. Required. + # @param options [::Gapic::CallOptions] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Cloud::SecretManager::V1::SecretVersion] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::SecretManager::V1::SecretVersion] + # A result object deserialized from the server's reply + def disable_secret_version request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_disable_secret_version_request request_pb + query_string_params = if query_string_params.any? + query_string_params.to_h { |p| p.split "=", 2 } + else + {} + end + + response = @client_stub.make_http_request( + verb, + uri: uri, + body: body || "", + params: query_string_params, + method_name: "disable_secret_version", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Cloud::SecretManager::V1::SecretVersion.decode_json response.body, ignore_unknown_fields: true + catch :response do + yield result, operation if block_given? + result + end + end + + ## + # Baseline implementation for the enable_secret_version REST call + # + # @param request_pb [::Google::Cloud::SecretManager::V1::EnableSecretVersionRequest] + # A request object representing the call parameters. Required. + # @param options [::Gapic::CallOptions] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Cloud::SecretManager::V1::SecretVersion] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::SecretManager::V1::SecretVersion] + # A result object deserialized from the server's reply + def enable_secret_version request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_enable_secret_version_request request_pb + query_string_params = if query_string_params.any? + query_string_params.to_h { |p| p.split "=", 2 } + else + {} + end + + response = @client_stub.make_http_request( + verb, + uri: uri, + body: body || "", + params: query_string_params, + method_name: "enable_secret_version", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Cloud::SecretManager::V1::SecretVersion.decode_json response.body, ignore_unknown_fields: true + catch :response do + yield result, operation if block_given? + result + end + end + + ## + # Baseline implementation for the destroy_secret_version REST call + # + # @param request_pb [::Google::Cloud::SecretManager::V1::DestroySecretVersionRequest] + # A request object representing the call parameters. Required. + # @param options [::Gapic::CallOptions] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Cloud::SecretManager::V1::SecretVersion] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::SecretManager::V1::SecretVersion] + # A result object deserialized from the server's reply + def destroy_secret_version request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_destroy_secret_version_request request_pb + query_string_params = if query_string_params.any? + query_string_params.to_h { |p| p.split "=", 2 } + else + {} + end + + response = @client_stub.make_http_request( + verb, + uri: uri, + body: body || "", + params: query_string_params, + method_name: "destroy_secret_version", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Cloud::SecretManager::V1::SecretVersion.decode_json response.body, ignore_unknown_fields: true + catch :response do + yield result, operation if block_given? + result + end + end + + ## + # Baseline implementation for the set_iam_policy REST call + # + # @param request_pb [::Google::Iam::V1::SetIamPolicyRequest] + # A request object representing the call parameters. Required. + # @param options [::Gapic::CallOptions] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Iam::V1::Policy] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Iam::V1::Policy] + # A result object deserialized from the server's reply + def set_iam_policy request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_set_iam_policy_request request_pb + query_string_params = if query_string_params.any? + query_string_params.to_h { |p| p.split "=", 2 } + else + {} + end + + response = @client_stub.make_http_request( + verb, + uri: uri, + body: body || "", + params: query_string_params, + method_name: "set_iam_policy", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Iam::V1::Policy.decode_json response.body, ignore_unknown_fields: true + catch :response do + yield result, operation if block_given? + result + end + end + + ## + # Baseline implementation for the get_iam_policy REST call + # + # @param request_pb [::Google::Iam::V1::GetIamPolicyRequest] + # A request object representing the call parameters. Required. + # @param options [::Gapic::CallOptions] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Iam::V1::Policy] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Iam::V1::Policy] + # A result object deserialized from the server's reply + def get_iam_policy request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_get_iam_policy_request request_pb + query_string_params = if query_string_params.any? + query_string_params.to_h { |p| p.split "=", 2 } + else + {} + end + + response = @client_stub.make_http_request( + verb, + uri: uri, + body: body || "", + params: query_string_params, + method_name: "get_iam_policy", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Iam::V1::Policy.decode_json response.body, ignore_unknown_fields: true + catch :response do + yield result, operation if block_given? + result + end + end + + ## + # Baseline implementation for the test_iam_permissions REST call + # + # @param request_pb [::Google::Iam::V1::TestIamPermissionsRequest] + # A request object representing the call parameters. Required. + # @param options [::Gapic::CallOptions] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Iam::V1::TestIamPermissionsResponse] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Iam::V1::TestIamPermissionsResponse] + # A result object deserialized from the server's reply + def test_iam_permissions request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_test_iam_permissions_request request_pb + query_string_params = if query_string_params.any? + query_string_params.to_h { |p| p.split "=", 2 } + else + {} + end + + response = @client_stub.make_http_request( + verb, + uri: uri, + body: body || "", + params: query_string_params, + method_name: "test_iam_permissions", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Iam::V1::TestIamPermissionsResponse.decode_json response.body, ignore_unknown_fields: true + catch :response do + yield result, operation if block_given? + result + end + end + + ## + # @private + # + # GRPC transcoding helper method for the list_secrets REST call + # + # @param request_pb [::Google::Cloud::SecretManager::V1::ListSecretsRequest] + # A request object representing the call parameters. Required. + # @return [Array(String, [String, nil], Hash{String => String})] + # Uri, Body, Query string parameters + def self.transcode_list_secrets_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :get, + uri_template: "/v1/{parent}/secrets", + matches: [ + ["parent", %r{^projects/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{parent}/secrets", + matches: [ + ["parent", %r{^projects/[^/]+/locations/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the create_secret REST call + # + # @param request_pb [::Google::Cloud::SecretManager::V1::CreateSecretRequest] + # A request object representing the call parameters. Required. + # @return [Array(String, [String, nil], Hash{String => String})] + # Uri, Body, Query string parameters + def self.transcode_create_secret_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :post, + uri_template: "/v1/{parent}/secrets", + body: "secret", + matches: [ + ["parent", %r{^projects/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{parent}/secrets", + body: "secret", + matches: [ + ["parent", %r{^projects/[^/]+/locations/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the add_secret_version REST call + # + # @param request_pb [::Google::Cloud::SecretManager::V1::AddSecretVersionRequest] + # A request object representing the call parameters. Required. + # @return [Array(String, [String, nil], Hash{String => String})] + # Uri, Body, Query string parameters + def self.transcode_add_secret_version_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :post, + uri_template: "/v1/{parent}:addVersion", + body: "*", + matches: [ + ["parent", %r{^projects/[^/]+/secrets/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{parent}:addVersion", + body: "*", + matches: [ + ["parent", %r{^projects/[^/]+/locations/[^/]+/secrets/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the get_secret REST call + # + # @param request_pb [::Google::Cloud::SecretManager::V1::GetSecretRequest] + # A request object representing the call parameters. Required. + # @return [Array(String, [String, nil], Hash{String => String})] + # Uri, Body, Query string parameters + def self.transcode_get_secret_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/secrets/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/secrets/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the update_secret REST call + # + # @param request_pb [::Google::Cloud::SecretManager::V1::UpdateSecretRequest] + # A request object representing the call parameters. Required. + # @return [Array(String, [String, nil], Hash{String => String})] + # Uri, Body, Query string parameters + def self.transcode_update_secret_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :patch, + uri_template: "/v1/{secret.name}", + body: "secret", + matches: [ + ["secret.name", %r{^projects/[^/]+/secrets/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :patch, + uri_template: "/v1/{secret.name}", + body: "secret", + matches: [ + ["secret.name", %r{^projects/[^/]+/locations/[^/]+/secrets/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the delete_secret REST call + # + # @param request_pb [::Google::Cloud::SecretManager::V1::DeleteSecretRequest] + # A request object representing the call parameters. Required. + # @return [Array(String, [String, nil], Hash{String => String})] + # Uri, Body, Query string parameters + def self.transcode_delete_secret_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :delete, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/secrets/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/secrets/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the list_secret_versions REST call + # + # @param request_pb [::Google::Cloud::SecretManager::V1::ListSecretVersionsRequest] + # A request object representing the call parameters. Required. + # @return [Array(String, [String, nil], Hash{String => String})] + # Uri, Body, Query string parameters + def self.transcode_list_secret_versions_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :get, + uri_template: "/v1/{parent}/versions", + matches: [ + ["parent", %r{^projects/[^/]+/secrets/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{parent}/versions", + matches: [ + ["parent", %r{^projects/[^/]+/locations/[^/]+/secrets/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the get_secret_version REST call + # + # @param request_pb [::Google::Cloud::SecretManager::V1::GetSecretVersionRequest] + # A request object representing the call parameters. Required. + # @return [Array(String, [String, nil], Hash{String => String})] + # Uri, Body, Query string parameters + def self.transcode_get_secret_version_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/secrets/[^/]+/versions/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/secrets/[^/]+/versions/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the access_secret_version REST call + # + # @param request_pb [::Google::Cloud::SecretManager::V1::AccessSecretVersionRequest] + # A request object representing the call parameters. Required. + # @return [Array(String, [String, nil], Hash{String => String})] + # Uri, Body, Query string parameters + def self.transcode_access_secret_version_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}:access", + matches: [ + ["name", %r{^projects/[^/]+/secrets/[^/]+/versions/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}:access", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/secrets/[^/]+/versions/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the disable_secret_version REST call + # + # @param request_pb [::Google::Cloud::SecretManager::V1::DisableSecretVersionRequest] + # A request object representing the call parameters. Required. + # @return [Array(String, [String, nil], Hash{String => String})] + # Uri, Body, Query string parameters + def self.transcode_disable_secret_version_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:disable", + body: "*", + matches: [ + ["name", %r{^projects/[^/]+/secrets/[^/]+/versions/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:disable", + body: "*", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/secrets/[^/]+/versions/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the enable_secret_version REST call + # + # @param request_pb [::Google::Cloud::SecretManager::V1::EnableSecretVersionRequest] + # A request object representing the call parameters. Required. + # @return [Array(String, [String, nil], Hash{String => String})] + # Uri, Body, Query string parameters + def self.transcode_enable_secret_version_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:enable", + body: "*", + matches: [ + ["name", %r{^projects/[^/]+/secrets/[^/]+/versions/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:enable", + body: "*", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/secrets/[^/]+/versions/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the destroy_secret_version REST call + # + # @param request_pb [::Google::Cloud::SecretManager::V1::DestroySecretVersionRequest] + # A request object representing the call parameters. Required. + # @return [Array(String, [String, nil], Hash{String => String})] + # Uri, Body, Query string parameters + def self.transcode_destroy_secret_version_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:destroy", + body: "*", + matches: [ + ["name", %r{^projects/[^/]+/secrets/[^/]+/versions/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:destroy", + body: "*", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/secrets/[^/]+/versions/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the set_iam_policy REST call + # + # @param request_pb [::Google::Iam::V1::SetIamPolicyRequest] + # A request object representing the call parameters. Required. + # @return [Array(String, [String, nil], Hash{String => String})] + # Uri, Body, Query string parameters + def self.transcode_set_iam_policy_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :post, + uri_template: "/v1/{resource}:setIamPolicy", + body: "*", + matches: [ + ["resource", %r{^projects/[^/]+/secrets/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{resource}:setIamPolicy", + body: "*", + matches: [ + ["resource", %r{^projects/[^/]+/locations/[^/]+/secrets/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the get_iam_policy REST call + # + # @param request_pb [::Google::Iam::V1::GetIamPolicyRequest] + # A request object representing the call parameters. Required. + # @return [Array(String, [String, nil], Hash{String => String})] + # Uri, Body, Query string parameters + def self.transcode_get_iam_policy_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :get, + uri_template: "/v1/{resource}:getIamPolicy", + matches: [ + ["resource", %r{^projects/[^/]+/secrets/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{resource}:getIamPolicy", + matches: [ + ["resource", %r{^projects/[^/]+/locations/[^/]+/secrets/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the test_iam_permissions REST call + # + # @param request_pb [::Google::Iam::V1::TestIamPermissionsRequest] + # A request object representing the call parameters. Required. + # @return [Array(String, [String, nil], Hash{String => String})] + # Uri, Body, Query string parameters + def self.transcode_test_iam_permissions_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :post, + uri_template: "/v1/{resource}:testIamPermissions", + body: "*", + matches: [ + ["resource", %r{^projects/[^/]+/secrets/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{resource}:testIamPermissions", + body: "*", + matches: [ + ["resource", %r{^projects/[^/]+/locations/[^/]+/secrets/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + end + end + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-secret_manager-v1/lib/google/cloud/secret_manager/v1/version.rb b/owl-bot-staging/google-cloud-secret_manager-v1/lib/google/cloud/secret_manager/v1/version.rb new file mode 100644 index 000000000000..3ac096ce123c --- /dev/null +++ b/owl-bot-staging/google-cloud-secret_manager-v1/lib/google/cloud/secret_manager/v1/version.rb @@ -0,0 +1,28 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + + +module Google + module Cloud + module SecretManager + module V1 + VERSION = "0.0.1" + end + end + end +end diff --git a/owl-bot-staging/google-cloud-secret_manager-v1/lib/google/cloud/secretmanager/v1/resources_pb.rb b/owl-bot-staging/google-cloud-secret_manager-v1/lib/google/cloud/secretmanager/v1/resources_pb.rb new file mode 100644 index 000000000000..6864a9474c87 --- /dev/null +++ b/owl-bot-staging/google-cloud-secret_manager-v1/lib/google/cloud/secretmanager/v1/resources_pb.rb @@ -0,0 +1,41 @@ +# frozen_string_literal: true +# Generated by the protocol buffer compiler. DO NOT EDIT! +# source: google/cloud/secretmanager/v1/resources.proto + +require 'google/protobuf' + +require 'google/api/field_behavior_pb' +require 'google/api/resource_pb' +require 'google/protobuf/duration_pb' +require 'google/protobuf/timestamp_pb' + + +descriptor_data = "\n-google/cloud/secretmanager/v1/resources.proto\x12\x1dgoogle.cloud.secretmanager.v1\x1a\x1fgoogle/api/field_behavior.proto\x1a\x19google/api/resource.proto\x1a\x1egoogle/protobuf/duration.proto\x1a\x1fgoogle/protobuf/timestamp.proto\"\xd9\t\n\x06Secret\x12\x11\n\x04name\x18\x01 \x01(\tB\x03\xe0\x41\x03\x12G\n\x0breplication\x18\x02 \x01(\x0b\x32*.google.cloud.secretmanager.v1.ReplicationB\x06\xe0\x41\x05\xe0\x41\x01\x12\x34\n\x0b\x63reate_time\x18\x03 \x01(\x0b\x32\x1a.google.protobuf.TimestampB\x03\xe0\x41\x03\x12\x41\n\x06labels\x18\x04 \x03(\x0b\x32\x31.google.cloud.secretmanager.v1.Secret.LabelsEntry\x12\x39\n\x06topics\x18\x05 \x03(\x0b\x32$.google.cloud.secretmanager.v1.TopicB\x03\xe0\x41\x01\x12\x36\n\x0b\x65xpire_time\x18\x06 \x01(\x0b\x32\x1a.google.protobuf.TimestampB\x03\xe0\x41\x01H\x00\x12-\n\x03ttl\x18\x07 \x01(\x0b\x32\x19.google.protobuf.DurationB\x03\xe0\x41\x04H\x00\x12\x11\n\x04\x65tag\x18\x08 \x01(\tB\x03\xe0\x41\x01\x12>\n\x08rotation\x18\t \x01(\x0b\x32\'.google.cloud.secretmanager.v1.RotationB\x03\xe0\x41\x01\x12W\n\x0fversion_aliases\x18\x0b \x03(\x0b\x32\x39.google.cloud.secretmanager.v1.Secret.VersionAliasesEntryB\x03\xe0\x41\x01\x12P\n\x0b\x61nnotations\x18\r \x03(\x0b\x32\x36.google.cloud.secretmanager.v1.Secret.AnnotationsEntryB\x03\xe0\x41\x01\x12;\n\x13version_destroy_ttl\x18\x0e \x01(\x0b\x32\x19.google.protobuf.DurationB\x03\xe0\x41\x01\x12\x62\n\x1b\x63ustomer_managed_encryption\x18\x0f \x01(\x0b\x32\x38.google.cloud.secretmanager.v1.CustomerManagedEncryptionB\x03\xe0\x41\x01\x12H\n\x04tags\x18\x10 \x03(\x0b\x32/.google.cloud.secretmanager.v1.Secret.TagsEntryB\t\xe0\x41\x04\xe0\x41\x05\xe0\x41\x01\x1a-\n\x0bLabelsEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12\r\n\x05value\x18\x02 \x01(\t:\x02\x38\x01\x1a\x35\n\x13VersionAliasesEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12\r\n\x05value\x18\x02 \x01(\x03:\x02\x38\x01\x1a\x32\n\x10\x41nnotationsEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12\r\n\x05value\x18\x02 \x01(\t:\x02\x38\x01\x1a+\n\tTagsEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12\r\n\x05value\x18\x02 \x01(\t:\x02\x38\x01:\x99\x01\xea\x41\x95\x01\n#secretmanager.googleapis.com/Secret\x12#projects/{project}/secrets/{secret}\x12\x38projects/{project}/locations/{location}/secrets/{secret}*\x07secrets2\x06secretB\x0c\n\nexpiration\"\xc2\x06\n\rSecretVersion\x12\x11\n\x04name\x18\x01 \x01(\tB\x03\xe0\x41\x03\x12\x34\n\x0b\x63reate_time\x18\x02 \x01(\x0b\x32\x1a.google.protobuf.TimestampB\x03\xe0\x41\x03\x12\x35\n\x0c\x64\x65stroy_time\x18\x03 \x01(\x0b\x32\x1a.google.protobuf.TimestampB\x03\xe0\x41\x03\x12\x46\n\x05state\x18\x04 \x01(\x0e\x32\x32.google.cloud.secretmanager.v1.SecretVersion.StateB\x03\xe0\x41\x03\x12L\n\x12replication_status\x18\x05 \x01(\x0b\x32\x30.google.cloud.secretmanager.v1.ReplicationStatus\x12\x11\n\x04\x65tag\x18\x06 \x01(\tB\x03\xe0\x41\x03\x12.\n!client_specified_payload_checksum\x18\x07 \x01(\x08\x42\x03\xe0\x41\x03\x12?\n\x16scheduled_destroy_time\x18\x08 \x01(\x0b\x32\x1a.google.protobuf.TimestampB\x03\xe0\x41\x03\x12h\n\x1b\x63ustomer_managed_encryption\x18\t \x01(\x0b\x32>.google.cloud.secretmanager.v1.CustomerManagedEncryptionStatusB\x03\xe0\x41\x03\"H\n\x05State\x12\x15\n\x11STATE_UNSPECIFIED\x10\x00\x12\x0b\n\x07\x45NABLED\x10\x01\x12\x0c\n\x08\x44ISABLED\x10\x02\x12\r\n\tDESTROYED\x10\x03:\xe2\x01\xea\x41\xde\x01\n*secretmanager.googleapis.com/SecretVersion\x12=projects/{project}/secrets/{secret}/versions/{secret_version}\x12Rprojects/{project}/locations/{location}/secrets/{secret}/versions/{secret_version}*\x0esecretVersions2\rsecretVersion\"\x90\x04\n\x0bReplication\x12I\n\tautomatic\x18\x01 \x01(\x0b\x32\x34.google.cloud.secretmanager.v1.Replication.AutomaticH\x00\x12N\n\x0cuser_managed\x18\x02 \x01(\x0b\x32\x36.google.cloud.secretmanager.v1.Replication.UserManagedH\x00\x1ao\n\tAutomatic\x12\x62\n\x1b\x63ustomer_managed_encryption\x18\x01 \x01(\x0b\x32\x38.google.cloud.secretmanager.v1.CustomerManagedEncryptionB\x03\xe0\x41\x01\x1a\xe5\x01\n\x0bUserManaged\x12U\n\x08replicas\x18\x01 \x03(\x0b\x32>.google.cloud.secretmanager.v1.Replication.UserManaged.ReplicaB\x03\xe0\x41\x02\x1a\x7f\n\x07Replica\x12\x10\n\x08location\x18\x01 \x01(\t\x12\x62\n\x1b\x63ustomer_managed_encryption\x18\x02 \x01(\x0b\x32\x38.google.cloud.secretmanager.v1.CustomerManagedEncryptionB\x03\xe0\x41\x01\x42\r\n\x0breplication\"6\n\x19\x43ustomerManagedEncryption\x12\x19\n\x0ckms_key_name\x18\x01 \x01(\tB\x03\xe0\x41\x02\"\xeb\x04\n\x11ReplicationStatus\x12U\n\tautomatic\x18\x01 \x01(\x0b\x32@.google.cloud.secretmanager.v1.ReplicationStatus.AutomaticStatusH\x00\x12Z\n\x0cuser_managed\x18\x02 \x01(\x0b\x32\x42.google.cloud.secretmanager.v1.ReplicationStatus.UserManagedStatusH\x00\x1a{\n\x0f\x41utomaticStatus\x12h\n\x1b\x63ustomer_managed_encryption\x18\x01 \x01(\x0b\x32>.google.cloud.secretmanager.v1.CustomerManagedEncryptionStatusB\x03\xe0\x41\x03\x1a\x8f\x02\n\x11UserManagedStatus\x12g\n\x08replicas\x18\x01 \x03(\x0b\x32P.google.cloud.secretmanager.v1.ReplicationStatus.UserManagedStatus.ReplicaStatusB\x03\xe0\x41\x03\x1a\x90\x01\n\rReplicaStatus\x12\x15\n\x08location\x18\x01 \x01(\tB\x03\xe0\x41\x03\x12h\n\x1b\x63ustomer_managed_encryption\x18\x02 \x01(\x0b\x32>.google.cloud.secretmanager.v1.CustomerManagedEncryptionStatusB\x03\xe0\x41\x03\x42\x14\n\x12replication_status\"D\n\x1f\x43ustomerManagedEncryptionStatus\x12!\n\x14kms_key_version_name\x18\x01 \x01(\tB\x03\xe0\x41\x02\"_\n\x05Topic\x12\x11\n\x04name\x18\x01 \x01(\tB\x03\xe0\x41\x08:C\xea\x41@\n\x1bpubsub.googleapis.com/Topic\x12!projects/{project}/topics/{topic}\"\x80\x01\n\x08Rotation\x12;\n\x12next_rotation_time\x18\x01 \x01(\x0b\x32\x1a.google.protobuf.TimestampB\x03\xe0\x41\x01\x12\x37\n\x0frotation_period\x18\x02 \x01(\x0b\x32\x19.google.protobuf.DurationB\x03\xe0\x41\x04\"L\n\rSecretPayload\x12\x0c\n\x04\x64\x61ta\x18\x01 \x01(\x0c\x12\x1d\n\x0b\x64\x61ta_crc32c\x18\x02 \x01(\x03\x42\x03\xe0\x41\x01H\x00\x88\x01\x01\x42\x0e\n\x0c_data_crc32cB\xe7\x01\n!com.google.cloud.secretmanager.v1B\x0eResourcesProtoP\x01ZGcloud.google.com/go/secretmanager/apiv1/secretmanagerpb;secretmanagerpb\xa2\x02\x03GSM\xaa\x02\x1dGoogle.Cloud.SecretManager.V1\xca\x02\x1dGoogle\\Cloud\\SecretManager\\V1\xea\x02 Google::Cloud::SecretManager::V1b\x06proto3" + +pool = ::Google::Protobuf::DescriptorPool.generated_pool +pool.add_serialized_file(descriptor_data) + +module Google + module Cloud + module SecretManager + module V1 + Secret = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.secretmanager.v1.Secret").msgclass + SecretVersion = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.secretmanager.v1.SecretVersion").msgclass + SecretVersion::State = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.secretmanager.v1.SecretVersion.State").enummodule + Replication = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.secretmanager.v1.Replication").msgclass + Replication::Automatic = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.secretmanager.v1.Replication.Automatic").msgclass + Replication::UserManaged = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.secretmanager.v1.Replication.UserManaged").msgclass + Replication::UserManaged::Replica = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.secretmanager.v1.Replication.UserManaged.Replica").msgclass + CustomerManagedEncryption = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.secretmanager.v1.CustomerManagedEncryption").msgclass + ReplicationStatus = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.secretmanager.v1.ReplicationStatus").msgclass + ReplicationStatus::AutomaticStatus = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.secretmanager.v1.ReplicationStatus.AutomaticStatus").msgclass + ReplicationStatus::UserManagedStatus = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.secretmanager.v1.ReplicationStatus.UserManagedStatus").msgclass + ReplicationStatus::UserManagedStatus::ReplicaStatus = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.secretmanager.v1.ReplicationStatus.UserManagedStatus.ReplicaStatus").msgclass + CustomerManagedEncryptionStatus = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.secretmanager.v1.CustomerManagedEncryptionStatus").msgclass + Topic = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.secretmanager.v1.Topic").msgclass + Rotation = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.secretmanager.v1.Rotation").msgclass + SecretPayload = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.secretmanager.v1.SecretPayload").msgclass + end + end + end +end diff --git a/owl-bot-staging/google-cloud-secret_manager-v1/lib/google/cloud/secretmanager/v1/service_pb.rb b/owl-bot-staging/google-cloud-secret_manager-v1/lib/google/cloud/secretmanager/v1/service_pb.rb new file mode 100644 index 000000000000..347d6e922756 --- /dev/null +++ b/owl-bot-staging/google-cloud-secret_manager-v1/lib/google/cloud/secretmanager/v1/service_pb.rb @@ -0,0 +1,45 @@ +# frozen_string_literal: true +# Generated by the protocol buffer compiler. DO NOT EDIT! +# source: google/cloud/secretmanager/v1/service.proto + +require 'google/protobuf' + +require 'google/api/annotations_pb' +require 'google/api/client_pb' +require 'google/api/field_behavior_pb' +require 'google/api/resource_pb' +require 'google/cloud/secretmanager/v1/resources_pb' +require 'google/iam/v1/iam_policy_pb' +require 'google/iam/v1/policy_pb' +require 'google/protobuf/empty_pb' +require 'google/protobuf/field_mask_pb' + + +descriptor_data = "\n+google/cloud/secretmanager/v1/service.proto\x12\x1dgoogle.cloud.secretmanager.v1\x1a\x1cgoogle/api/annotations.proto\x1a\x17google/api/client.proto\x1a\x1fgoogle/api/field_behavior.proto\x1a\x19google/api/resource.proto\x1a-google/cloud/secretmanager/v1/resources.proto\x1a\x1egoogle/iam/v1/iam_policy.proto\x1a\x1agoogle/iam/v1/policy.proto\x1a\x1bgoogle/protobuf/empty.proto\x1a google/protobuf/field_mask.proto\"\x97\x01\n\x12ListSecretsRequest\x12;\n\x06parent\x18\x01 \x01(\tB+\xe0\x41\x02\xfa\x41%\x12#secretmanager.googleapis.com/Secret\x12\x16\n\tpage_size\x18\x02 \x01(\x05\x42\x03\xe0\x41\x01\x12\x17\n\npage_token\x18\x03 \x01(\tB\x03\xe0\x41\x01\x12\x13\n\x06\x66ilter\x18\x04 \x01(\tB\x03\xe0\x41\x01\"z\n\x13ListSecretsResponse\x12\x36\n\x07secrets\x18\x01 \x03(\x0b\x32%.google.cloud.secretmanager.v1.Secret\x12\x17\n\x0fnext_page_token\x18\x02 \x01(\t\x12\x12\n\ntotal_size\x18\x03 \x01(\x05\"\xa6\x01\n\x13\x43reateSecretRequest\x12;\n\x06parent\x18\x01 \x01(\tB+\xe0\x41\x02\xfa\x41%\x12#secretmanager.googleapis.com/Secret\x12\x16\n\tsecret_id\x18\x02 \x01(\tB\x03\xe0\x41\x02\x12:\n\x06secret\x18\x03 \x01(\x0b\x32%.google.cloud.secretmanager.v1.SecretB\x03\xe0\x41\x02\"\x9a\x01\n\x17\x41\x64\x64SecretVersionRequest\x12;\n\x06parent\x18\x01 \x01(\tB+\xe0\x41\x02\xfa\x41%\n#secretmanager.googleapis.com/Secret\x12\x42\n\x07payload\x18\x02 \x01(\x0b\x32,.google.cloud.secretmanager.v1.SecretPayloadB\x03\xe0\x41\x02\"M\n\x10GetSecretRequest\x12\x39\n\x04name\x18\x01 \x01(\tB+\xe0\x41\x02\xfa\x41%\n#secretmanager.googleapis.com/Secret\"\x9e\x01\n\x19ListSecretVersionsRequest\x12;\n\x06parent\x18\x01 \x01(\tB+\xe0\x41\x02\xfa\x41%\n#secretmanager.googleapis.com/Secret\x12\x16\n\tpage_size\x18\x02 \x01(\x05\x42\x03\xe0\x41\x01\x12\x17\n\npage_token\x18\x03 \x01(\tB\x03\xe0\x41\x01\x12\x13\n\x06\x66ilter\x18\x04 \x01(\tB\x03\xe0\x41\x01\"\x89\x01\n\x1aListSecretVersionsResponse\x12>\n\x08versions\x18\x01 \x03(\x0b\x32,.google.cloud.secretmanager.v1.SecretVersion\x12\x17\n\x0fnext_page_token\x18\x02 \x01(\t\x12\x12\n\ntotal_size\x18\x03 \x01(\x05\"[\n\x17GetSecretVersionRequest\x12@\n\x04name\x18\x01 \x01(\tB2\xe0\x41\x02\xfa\x41,\n*secretmanager.googleapis.com/SecretVersion\"\x87\x01\n\x13UpdateSecretRequest\x12:\n\x06secret\x18\x01 \x01(\x0b\x32%.google.cloud.secretmanager.v1.SecretB\x03\xe0\x41\x02\x12\x34\n\x0bupdate_mask\x18\x02 \x01(\x0b\x32\x1a.google.protobuf.FieldMaskB\x03\xe0\x41\x02\"^\n\x1a\x41\x63\x63\x65ssSecretVersionRequest\x12@\n\x04name\x18\x01 \x01(\tB2\xe0\x41\x02\xfa\x41,\n*secretmanager.googleapis.com/SecretVersion\"\x9b\x01\n\x1b\x41\x63\x63\x65ssSecretVersionResponse\x12=\n\x04name\x18\x01 \x01(\tB/\xfa\x41,\n*secretmanager.googleapis.com/SecretVersion\x12=\n\x07payload\x18\x02 \x01(\x0b\x32,.google.cloud.secretmanager.v1.SecretPayload\"c\n\x13\x44\x65leteSecretRequest\x12\x39\n\x04name\x18\x01 \x01(\tB+\xe0\x41\x02\xfa\x41%\n#secretmanager.googleapis.com/Secret\x12\x11\n\x04\x65tag\x18\x02 \x01(\tB\x03\xe0\x41\x01\"r\n\x1b\x44isableSecretVersionRequest\x12@\n\x04name\x18\x01 \x01(\tB2\xe0\x41\x02\xfa\x41,\n*secretmanager.googleapis.com/SecretVersion\x12\x11\n\x04\x65tag\x18\x02 \x01(\tB\x03\xe0\x41\x01\"q\n\x1a\x45nableSecretVersionRequest\x12@\n\x04name\x18\x01 \x01(\tB2\xe0\x41\x02\xfa\x41,\n*secretmanager.googleapis.com/SecretVersion\x12\x11\n\x04\x65tag\x18\x02 \x01(\tB\x03\xe0\x41\x01\"r\n\x1b\x44\x65stroySecretVersionRequest\x12@\n\x04name\x18\x01 \x01(\tB2\xe0\x41\x02\xfa\x41,\n*secretmanager.googleapis.com/SecretVersion\x12\x11\n\x04\x65tag\x18\x02 \x01(\tB\x03\xe0\x41\x01\x32\xe8\x1c\n\x14SecretManagerService\x12\xd5\x01\n\x0bListSecrets\x12\x31.google.cloud.secretmanager.v1.ListSecretsRequest\x1a\x32.google.cloud.secretmanager.v1.ListSecretsResponse\"_\xda\x41\x06parent\x82\xd3\xe4\x93\x02P\x12\x1f/v1/{parent=projects/*}/secretsZ-\x12+/v1/{parent=projects/*/locations/*}/secrets\x12\xec\x01\n\x0c\x43reateSecret\x12\x32.google.cloud.secretmanager.v1.CreateSecretRequest\x1a%.google.cloud.secretmanager.v1.Secret\"\x80\x01\xda\x41\x17parent,secret_id,secret\x82\xd3\xe4\x93\x02`\"\x1f/v1/{parent=projects/*}/secrets:\x06secretZ5\"+/v1/{parent=projects/*/locations/*}/secrets:\x06secret\x12\x82\x02\n\x10\x41\x64\x64SecretVersion\x12\x36.google.cloud.secretmanager.v1.AddSecretVersionRequest\x1a,.google.cloud.secretmanager.v1.SecretVersion\"\x87\x01\xda\x41\x0eparent,payload\x82\xd3\xe4\x93\x02p\",/v1/{parent=projects/*/secrets/*}:addVersion:\x01*Z=\"8/v1/{parent=projects/*/locations/*/secrets/*}:addVersion:\x01*\x12\xc2\x01\n\tGetSecret\x12/.google.cloud.secretmanager.v1.GetSecretRequest\x1a%.google.cloud.secretmanager.v1.Secret\"]\xda\x41\x04name\x82\xd3\xe4\x93\x02P\x12\x1f/v1/{name=projects/*/secrets/*}Z-\x12+/v1/{name=projects/*/locations/*/secrets/*}\x12\xf5\x01\n\x0cUpdateSecret\x12\x32.google.cloud.secretmanager.v1.UpdateSecretRequest\x1a%.google.cloud.secretmanager.v1.Secret\"\x89\x01\xda\x41\x12secret,update_mask\x82\xd3\xe4\x93\x02n2&/v1/{secret.name=projects/*/secrets/*}:\x06secretZ<22/v1/{secret.name=projects/*/locations/*/secrets/*}:\x06secret\x12\xb9\x01\n\x0c\x44\x65leteSecret\x12\x32.google.cloud.secretmanager.v1.DeleteSecretRequest\x1a\x16.google.protobuf.Empty\"]\xda\x41\x04name\x82\xd3\xe4\x93\x02P*\x1f/v1/{name=projects/*/secrets/*}Z-*+/v1/{name=projects/*/locations/*/secrets/*}\x12\x80\x02\n\x12ListSecretVersions\x12\x38.google.cloud.secretmanager.v1.ListSecretVersionsRequest\x1a\x39.google.cloud.secretmanager.v1.ListSecretVersionsResponse\"u\xda\x41\x06parent\x82\xd3\xe4\x93\x02\x66\x12*/v1/{parent=projects/*/secrets/*}/versionsZ8\x12\x36/v1/{parent=projects/*/locations/*/secrets/*}/versions\x12\xed\x01\n\x10GetSecretVersion\x12\x36.google.cloud.secretmanager.v1.GetSecretVersionRequest\x1a,.google.cloud.secretmanager.v1.SecretVersion\"s\xda\x41\x04name\x82\xd3\xe4\x93\x02\x66\x12*/v1/{name=projects/*/secrets/*/versions/*}Z8\x12\x36/v1/{name=projects/*/locations/*/secrets/*/versions/*}\x12\x90\x02\n\x13\x41\x63\x63\x65ssSecretVersion\x12\x39.google.cloud.secretmanager.v1.AccessSecretVersionRequest\x1a:.google.cloud.secretmanager.v1.AccessSecretVersionResponse\"\x81\x01\xda\x41\x04name\x82\xd3\xe4\x93\x02t\x12\x31/v1/{name=projects/*/secrets/*/versions/*}:accessZ?\x12=/v1/{name=projects/*/locations/*/secrets/*/versions/*}:access\x12\x8c\x02\n\x14\x44isableSecretVersion\x12:.google.cloud.secretmanager.v1.DisableSecretVersionRequest\x1a,.google.cloud.secretmanager.v1.SecretVersion\"\x89\x01\xda\x41\x04name\x82\xd3\xe4\x93\x02|\"2/v1/{name=projects/*/secrets/*/versions/*}:disable:\x01*ZC\">/v1/{name=projects/*/locations/*/secrets/*/versions/*}:disable:\x01*\x12\x88\x02\n\x13\x45nableSecretVersion\x12\x39.google.cloud.secretmanager.v1.EnableSecretVersionRequest\x1a,.google.cloud.secretmanager.v1.SecretVersion\"\x87\x01\xda\x41\x04name\x82\xd3\xe4\x93\x02z\"1/v1/{name=projects/*/secrets/*/versions/*}:enable:\x01*ZB\"=/v1/{name=projects/*/locations/*/secrets/*/versions/*}:enable:\x01*\x12\x8c\x02\n\x14\x44\x65stroySecretVersion\x12:.google.cloud.secretmanager.v1.DestroySecretVersionRequest\x1a,.google.cloud.secretmanager.v1.SecretVersion\"\x89\x01\xda\x41\x04name\x82\xd3\xe4\x93\x02|\"2/v1/{name=projects/*/secrets/*/versions/*}:destroy:\x01*ZC\">/v1/{name=projects/*/locations/*/secrets/*/versions/*}:destroy:\x01*\x12\xc9\x01\n\x0cSetIamPolicy\x12\".google.iam.v1.SetIamPolicyRequest\x1a\x15.google.iam.v1.Policy\"~\x82\xd3\xe4\x93\x02x\"0/v1/{resource=projects/*/secrets/*}:setIamPolicy:\x01*ZA\"\x12] + # The destination where API teams want this client library to be published. + # @!attribute [rw] selective_gapic_generation + # @return [::Google::Api::SelectiveGapicGeneration] + # Configuration for which RPCs should be generated in the GAPIC client. + class CommonLanguageSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Details about how and where to publish client libraries. + # @!attribute [rw] version + # @return [::String] + # Version of the API to apply these settings to. This is the full protobuf + # package for the API, ending in the version element. + # Examples: "google.cloud.speech.v1" and "google.spanner.admin.database.v1". + # @!attribute [rw] launch_stage + # @return [::Google::Api::LaunchStage] + # Launch stage of this version of the API. + # @!attribute [rw] rest_numeric_enums + # @return [::Boolean] + # When using transport=rest, the client request will encode enums as + # numbers rather than strings. + # @!attribute [rw] java_settings + # @return [::Google::Api::JavaSettings] + # Settings for legacy Java features, supported in the Service YAML. + # @!attribute [rw] cpp_settings + # @return [::Google::Api::CppSettings] + # Settings for C++ client libraries. + # @!attribute [rw] php_settings + # @return [::Google::Api::PhpSettings] + # Settings for PHP client libraries. + # @!attribute [rw] python_settings + # @return [::Google::Api::PythonSettings] + # Settings for Python client libraries. + # @!attribute [rw] node_settings + # @return [::Google::Api::NodeSettings] + # Settings for Node client libraries. + # @!attribute [rw] dotnet_settings + # @return [::Google::Api::DotnetSettings] + # Settings for .NET client libraries. + # @!attribute [rw] ruby_settings + # @return [::Google::Api::RubySettings] + # Settings for Ruby client libraries. + # @!attribute [rw] go_settings + # @return [::Google::Api::GoSettings] + # Settings for Go client libraries. + class ClientLibrarySettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # This message configures the settings for publishing [Google Cloud Client + # libraries](https://cloud.google.com/apis/docs/cloud-client-libraries) + # generated from the service config. + # @!attribute [rw] method_settings + # @return [::Array<::Google::Api::MethodSettings>] + # A list of API method settings, e.g. the behavior for methods that use the + # long-running operation pattern. + # @!attribute [rw] new_issue_uri + # @return [::String] + # Link to a *public* URI where users can report issues. Example: + # https://issuetracker.google.com/issues/new?component=190865&template=1161103 + # @!attribute [rw] documentation_uri + # @return [::String] + # Link to product home page. Example: + # https://cloud.google.com/asset-inventory/docs/overview + # @!attribute [rw] api_short_name + # @return [::String] + # Used as a tracking tag when collecting data about the APIs developer + # relations artifacts like docs, packages delivered to package managers, + # etc. Example: "speech". + # @!attribute [rw] github_label + # @return [::String] + # GitHub label to apply to issues and pull requests opened for this API. + # @!attribute [rw] codeowner_github_teams + # @return [::Array<::String>] + # GitHub teams to be added to CODEOWNERS in the directory in GitHub + # containing source code for the client libraries for this API. + # @!attribute [rw] doc_tag_prefix + # @return [::String] + # A prefix used in sample code when demarking regions to be included in + # documentation. + # @!attribute [rw] organization + # @return [::Google::Api::ClientLibraryOrganization] + # For whom the client library is being published. + # @!attribute [rw] library_settings + # @return [::Array<::Google::Api::ClientLibrarySettings>] + # Client library settings. If the same version string appears multiple + # times in this list, then the last one wins. Settings from earlier + # settings with the same version string are discarded. + # @!attribute [rw] proto_reference_documentation_uri + # @return [::String] + # Optional link to proto reference documentation. Example: + # https://cloud.google.com/pubsub/lite/docs/reference/rpc + # @!attribute [rw] rest_reference_documentation_uri + # @return [::String] + # Optional link to REST reference documentation. Example: + # https://cloud.google.com/pubsub/lite/docs/reference/rest + class Publishing + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Settings for Java client libraries. + # @!attribute [rw] library_package + # @return [::String] + # The package name to use in Java. Clobbers the java_package option + # set in the protobuf. This should be used **only** by APIs + # who have already set the language_settings.java.package_name" field + # in gapic.yaml. API teams should use the protobuf java_package option + # where possible. + # + # Example of a YAML configuration:: + # + # publishing: + # 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. + # @!attribute [rw] methods + # @return [::Array<::String>] + # An allowlist of the fully qualified names of RPCs that should be included + # on public client surfaces. + # @!attribute [rw] generate_omitted_as_internal + # @return [::Boolean] + # Setting this to true indicates to the client generators that methods + # that would be excluded from the generation should instead be generated + # in a way that indicates these methods should not be consumed by + # end users. How this is expressed is up to individual language + # implementations to decide. Some examples may be: added annotations, + # obfuscated identifiers, or other language idiomatic patterns. + class SelectiveGapicGeneration + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # `BatchingConfigProto` defines the batching configuration for an API method. + # @!attribute [rw] thresholds + # @return [::Google::Api::BatchingSettingsProto] + # The thresholds which trigger a batched request to be sent. + # @!attribute [rw] batch_descriptor + # @return [::Google::Api::BatchingDescriptorProto] + # The request and response fields used in batching. + class BatchingConfigProto + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # `BatchingSettingsProto` specifies a set of batching thresholds, each of + # which acts as a trigger to send a batch of messages as a request. At least + # one threshold must be positive nonzero. + # @!attribute [rw] element_count_threshold + # @return [::Integer] + # The number of elements of a field collected into a batch which, if + # exceeded, causes the batch to be sent. + # @!attribute [rw] request_byte_threshold + # @return [::Integer] + # The aggregated size of the batched field which, if exceeded, causes the + # batch to be sent. This size is computed by aggregating the sizes of the + # request field to be batched, not of the entire request message. + # @!attribute [rw] delay_threshold + # @return [::Google::Protobuf::Duration] + # The duration after which a batch should be sent, starting from the addition + # of the first message to that batch. + # @!attribute [rw] element_count_limit + # @return [::Integer] + # The maximum number of elements collected in a batch that could be accepted + # by server. + # @!attribute [rw] request_byte_limit + # @return [::Integer] + # The maximum size of the request that could be accepted by server. + # @!attribute [rw] flow_control_element_limit + # @return [::Integer] + # The maximum number of elements allowed by flow control. + # @!attribute [rw] flow_control_byte_limit + # @return [::Integer] + # The maximum size of data allowed by flow control. + # @!attribute [rw] flow_control_limit_exceeded_behavior + # @return [::Google::Api::FlowControlLimitExceededBehaviorProto] + # The behavior to take when the flow control limit is exceeded. + class BatchingSettingsProto + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # `BatchingDescriptorProto` specifies the fields of the request message to be + # used for batching, and, optionally, the fields of the response message to be + # used for demultiplexing. + # @!attribute [rw] batched_field + # @return [::String] + # The repeated field in the request message to be aggregated by batching. + # @!attribute [rw] discriminator_fields + # @return [::Array<::String>] + # A list of the fields in the request message. Two requests will be batched + # together only if the values of every field specified in + # `request_discriminator_fields` is equal between the two requests. + # @!attribute [rw] subresponse_field + # @return [::String] + # Optional. When present, indicates the field in the response message to be + # used to demultiplex the response into multiple response messages, in + # correspondence with the multiple request messages originally batched + # together. + class BatchingDescriptorProto + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # The organization for which the client libraries are being published. + # Affects the url where generated docs are published, etc. + module ClientLibraryOrganization + # Not useful. + CLIENT_LIBRARY_ORGANIZATION_UNSPECIFIED = 0 + + # Google Cloud Platform Org. + CLOUD = 1 + + # Ads (Advertising) Org. + ADS = 2 + + # Photos Org. + PHOTOS = 3 + + # Street View Org. + STREET_VIEW = 4 + + # Shopping Org. + SHOPPING = 5 + + # Geo Org. + GEO = 6 + + # Generative AI - https://developers.generativeai.google + GENERATIVE_AI = 7 + end + + # To where should client libraries be published? + module ClientLibraryDestination + # Client libraries will neither be generated nor published to package + # managers. + CLIENT_LIBRARY_DESTINATION_UNSPECIFIED = 0 + + # Generate the client library in a repo under github.com/googleapis, + # but don't publish it to package managers. + GITHUB = 10 + + # Publish the library to package managers like nuget.org and npmjs.com. + PACKAGE_MANAGER = 20 + end + + # The behavior to take when the flow control limit is exceeded. + module FlowControlLimitExceededBehaviorProto + # Default behavior, system-defined. + UNSET_BEHAVIOR = 0 + + # Stop operation, raise error. + THROW_EXCEPTION = 1 + + # Pause operation until limit clears. + BLOCK = 2 + + # Continue operation, disregard limit. + IGNORE = 3 + end + end +end diff --git a/owl-bot-staging/google-cloud-secret_manager-v1/proto_docs/google/api/field_behavior.rb b/owl-bot-staging/google-cloud-secret_manager-v1/proto_docs/google/api/field_behavior.rb new file mode 100644 index 000000000000..582be187d115 --- /dev/null +++ b/owl-bot-staging/google-cloud-secret_manager-v1/proto_docs/google/api/field_behavior.rb @@ -0,0 +1,85 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + + +module Google + module Api + # An indicator of the behavior of a given field (for example, that a field + # is required in requests, or given as output but ignored as input). + # This **does not** change the behavior in protocol buffers itself; it only + # denotes the behavior and may affect how API tooling handles the field. + # + # Note: This enum **may** receive new values in the future. + module FieldBehavior + # Conventional default for enums. Do not use this. + FIELD_BEHAVIOR_UNSPECIFIED = 0 + + # Specifically denotes a field as optional. + # While all fields in protocol buffers are optional, this may be specified + # for emphasis if appropriate. + OPTIONAL = 1 + + # Denotes a field as required. + # This indicates that the field **must** be provided as part of the request, + # and failure to do so will cause an error (usually `INVALID_ARGUMENT`). + REQUIRED = 2 + + # Denotes a field as output only. + # This indicates that the field is provided in responses, but including the + # field in a request does nothing (the server *must* ignore it and + # *must not* throw an error as a result of the field's presence). + OUTPUT_ONLY = 3 + + # Denotes a field as input only. + # This indicates that the field is provided in requests, and the + # corresponding field is not included in output. + INPUT_ONLY = 4 + + # Denotes a field as immutable. + # This indicates that the field may be set once in a request to create a + # resource, but may not be changed thereafter. + IMMUTABLE = 5 + + # Denotes that a (repeated) field is an unordered list. + # This indicates that the service may provide the elements of the list + # in any arbitrary order, rather than the order the user originally + # provided. Additionally, the list's order may or may not be stable. + UNORDERED_LIST = 6 + + # Denotes that this field returns a non-empty default value if not set. + # This indicates that if the user provides the empty value in a request, + # a non-empty value will be returned. The user will not be aware of what + # non-empty value to expect. + NON_EMPTY_DEFAULT = 7 + + # Denotes that the field in a resource (a message annotated with + # google.api.resource) is used in the resource name to uniquely identify the + # resource. For AIP-compliant APIs, this should only be applied to the + # `name` field on the resource. + # + # This behavior should not be applied to references to other resources within + # the message. + # + # The identifier field of resources often have different field behavior + # depending on the request it is embedded in (e.g. for Create methods name + # is optional and unused, while for Update methods it is required). Instead + # of method-specific annotations, only `IDENTIFIER` is required. + IDENTIFIER = 8 + end + end +end diff --git a/owl-bot-staging/google-cloud-secret_manager-v1/proto_docs/google/api/launch_stage.rb b/owl-bot-staging/google-cloud-secret_manager-v1/proto_docs/google/api/launch_stage.rb new file mode 100644 index 000000000000..9392a413fb1b --- /dev/null +++ b/owl-bot-staging/google-cloud-secret_manager-v1/proto_docs/google/api/launch_stage.rb @@ -0,0 +1,71 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + + +module Google + module Api + # The launch stage as defined by [Google Cloud Platform + # Launch Stages](https://cloud.google.com/terms/launch-stages). + module LaunchStage + # Do not use this default value. + LAUNCH_STAGE_UNSPECIFIED = 0 + + # The feature is not yet implemented. Users can not use it. + UNIMPLEMENTED = 6 + + # Prelaunch features are hidden from users and are only visible internally. + PRELAUNCH = 7 + + # Early Access features are limited to a closed group of testers. To use + # these features, you must sign up in advance and sign a Trusted Tester + # agreement (which includes confidentiality provisions). These features may + # be unstable, changed in backward-incompatible ways, and are not + # guaranteed to be released. + EARLY_ACCESS = 1 + + # Alpha is a limited availability test for releases before they are cleared + # for widespread use. By Alpha, all significant design issues are resolved + # and we are in the process of verifying functionality. Alpha customers + # need to apply for access, agree to applicable terms, and have their + # projects allowlisted. Alpha releases don't have to be feature complete, + # no SLAs are provided, and there are no technical support obligations, but + # they will be far enough along that customers can actually use them in + # test environments or for limited-use tests -- just like they would in + # normal production cases. + ALPHA = 2 + + # Beta is the point at which we are ready to open a release for any + # customer to use. There are no SLA or technical support obligations in a + # Beta release. Products will be complete from a feature perspective, but + # may have some open outstanding issues. Beta releases are suitable for + # limited production use cases. + BETA = 3 + + # GA features are open to all developers and are considered stable and + # fully qualified for production use. + GA = 4 + + # Deprecated features are scheduled to be shut down and removed. For more + # information, see the "Deprecation Policy" section of our [Terms of + # Service](https://cloud.google.com/terms/) + # and the [Google Cloud Platform Subject to the Deprecation + # Policy](https://cloud.google.com/terms/deprecation) documentation. + DEPRECATED = 5 + end + end +end diff --git a/owl-bot-staging/google-cloud-secret_manager-v1/proto_docs/google/api/resource.rb b/owl-bot-staging/google-cloud-secret_manager-v1/proto_docs/google/api/resource.rb new file mode 100644 index 000000000000..25dec4847ac1 --- /dev/null +++ b/owl-bot-staging/google-cloud-secret_manager-v1/proto_docs/google/api/resource.rb @@ -0,0 +1,227 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + + +module Google + module Api + # A simple descriptor of a resource type. + # + # ResourceDescriptor annotates a resource message (either by means of a + # protobuf annotation or use in the service config), and associates the + # resource's schema, the resource type, and the pattern of the resource name. + # + # Example: + # + # message Topic { + # // Indicates this message defines a resource schema. + # // Declares the resource type in the format of {service}/{kind}. + # // For Kubernetes resources, the format is {api group}/{kind}. + # option (google.api.resource) = { + # type: "pubsub.googleapis.com/Topic" + # pattern: "projects/{project}/topics/{topic}" + # }; + # } + # + # The ResourceDescriptor Yaml config will look like: + # + # resources: + # - type: "pubsub.googleapis.com/Topic" + # pattern: "projects/{project}/topics/{topic}" + # + # Sometimes, resources have multiple patterns, typically because they can + # live under multiple parents. + # + # Example: + # + # message LogEntry { + # option (google.api.resource) = { + # type: "logging.googleapis.com/LogEntry" + # pattern: "projects/{project}/logs/{log}" + # pattern: "folders/{folder}/logs/{log}" + # pattern: "organizations/{organization}/logs/{log}" + # pattern: "billingAccounts/{billing_account}/logs/{log}" + # }; + # } + # + # The ResourceDescriptor Yaml config will look like: + # + # resources: + # - type: 'logging.googleapis.com/LogEntry' + # pattern: "projects/{project}/logs/{log}" + # pattern: "folders/{folder}/logs/{log}" + # pattern: "organizations/{organization}/logs/{log}" + # pattern: "billingAccounts/{billing_account}/logs/{log}" + # @!attribute [rw] type + # @return [::String] + # The resource type. It must be in the format of + # \\{service_name}/\\{resource_type_kind}. The `resource_type_kind` must be + # singular and must not include version numbers. + # + # Example: `storage.googleapis.com/Bucket` + # + # The value of the resource_type_kind must follow the regular expression + # /[A-Za-z][a-zA-Z0-9]+/. It should start with an upper case character and + # should use PascalCase (UpperCamelCase). The maximum number of + # characters allowed for the `resource_type_kind` is 100. + # @!attribute [rw] pattern + # @return [::Array<::String>] + # Optional. The relative resource name pattern associated with this resource + # type. The DNS prefix of the full resource name shouldn't be specified here. + # + # The path pattern must follow the syntax, which aligns with HTTP binding + # syntax: + # + # Template = Segment { "/" Segment } ; + # Segment = LITERAL | Variable ; + # Variable = "{" LITERAL "}" ; + # + # Examples: + # + # - "projects/\\{project}/topics/\\{topic}" + # - "projects/\\{project}/knowledgeBases/\\{knowledge_base}" + # + # The components in braces correspond to the IDs for each resource in the + # hierarchy. It is expected that, if multiple patterns are provided, + # the same component name (e.g. "project") refers to IDs of the same + # type of resource. + # @!attribute [rw] name_field + # @return [::String] + # Optional. The field on the resource that designates the resource name + # field. If omitted, this is assumed to be "name". + # @!attribute [rw] history + # @return [::Google::Api::ResourceDescriptor::History] + # Optional. The historical or future-looking state of the resource pattern. + # + # Example: + # + # // The InspectTemplate message originally only supported resource + # // names with organization, and project was added later. + # message InspectTemplate { + # option (google.api.resource) = { + # type: "dlp.googleapis.com/InspectTemplate" + # pattern: + # "organizations/{organization}/inspectTemplates/{inspect_template}" + # pattern: "projects/{project}/inspectTemplates/{inspect_template}" + # history: ORIGINALLY_SINGLE_PATTERN + # }; + # } + # @!attribute [rw] plural + # @return [::String] + # The plural name used in the resource name and permission names, such as + # 'projects' for the resource name of 'projects/\\{project}' and the permission + # name of 'cloudresourcemanager.googleapis.com/projects.get'. One exception + # to this is for Nested Collections that have stuttering names, as defined + # in [AIP-122](https://google.aip.dev/122#nested-collections), where the + # collection ID in the resource name pattern does not necessarily directly + # match the `plural` value. + # + # It is the same concept of the `plural` field in k8s CRD spec + # https://kubernetes.io/docs/tasks/access-kubernetes-api/custom-resources/custom-resource-definitions/ + # + # Note: The plural form is required even for singleton resources. See + # https://aip.dev/156 + # @!attribute [rw] singular + # @return [::String] + # The same concept of the `singular` field in k8s CRD spec + # https://kubernetes.io/docs/tasks/access-kubernetes-api/custom-resources/custom-resource-definitions/ + # Such as "project" for the `resourcemanager.googleapis.com/Project` type. + # @!attribute [rw] style + # @return [::Array<::Google::Api::ResourceDescriptor::Style>] + # Style flag(s) for this resource. + # These indicate that a resource is expected to conform to a given + # style. See the specific style flags for additional information. + class ResourceDescriptor + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # A description of the historical or future-looking state of the + # resource pattern. + module History + # The "unset" value. + HISTORY_UNSPECIFIED = 0 + + # The resource originally had one pattern and launched as such, and + # additional patterns were added later. + ORIGINALLY_SINGLE_PATTERN = 1 + + # The resource has one pattern, but the API owner expects to add more + # later. (This is the inverse of ORIGINALLY_SINGLE_PATTERN, and prevents + # that from being necessary once there are multiple patterns.) + FUTURE_MULTI_PATTERN = 2 + end + + # A flag representing a specific style that a resource claims to conform to. + module Style + # The unspecified value. Do not use. + STYLE_UNSPECIFIED = 0 + + # This resource is intended to be "declarative-friendly". + # + # Declarative-friendly resources must be more strictly consistent, and + # setting this to true communicates to tools that this resource should + # adhere to declarative-friendly expectations. + # + # Note: This is used by the API linter (linter.aip.dev) to enable + # additional checks. + DECLARATIVE_FRIENDLY = 1 + end + end + + # Defines a proto annotation that describes a string field that refers to + # an API resource. + # @!attribute [rw] type + # @return [::String] + # The resource type that the annotated field references. + # + # Example: + # + # message Subscription { + # string topic = 2 [(google.api.resource_reference) = { + # type: "pubsub.googleapis.com/Topic" + # }]; + # } + # + # Occasionally, a field may reference an arbitrary resource. In this case, + # APIs use the special value * in their resource reference. + # + # Example: + # + # message GetIamPolicyRequest { + # string resource = 2 [(google.api.resource_reference) = { + # type: "*" + # }]; + # } + # @!attribute [rw] child_type + # @return [::String] + # The resource type of a child collection that the annotated field + # references. This is useful for annotating the `parent` field that + # doesn't have a fixed resource type. + # + # Example: + # + # message ListLogEntriesRequest { + # string parent = 1 [(google.api.resource_reference) = { + # child_type: "logging.googleapis.com/LogEntry" + # }; + # } + class ResourceReference + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end +end diff --git a/owl-bot-staging/google-cloud-secret_manager-v1/proto_docs/google/cloud/secretmanager/v1/resources.rb b/owl-bot-staging/google-cloud-secret_manager-v1/proto_docs/google/cloud/secretmanager/v1/resources.rb new file mode 100644 index 000000000000..b7f873a9588d --- /dev/null +++ b/owl-bot-staging/google-cloud-secret_manager-v1/proto_docs/google/cloud/secretmanager/v1/resources.rb @@ -0,0 +1,526 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + + +module Google + module Cloud + module SecretManager + module V1 + # A {::Google::Cloud::SecretManager::V1::Secret Secret} is a logical secret whose + # value and versions can be accessed. + # + # A {::Google::Cloud::SecretManager::V1::Secret Secret} is made up of zero or more + # {::Google::Cloud::SecretManager::V1::SecretVersion SecretVersions} that represent + # the secret data. + # @!attribute [r] name + # @return [::String] + # Output only. The resource name of the + # {::Google::Cloud::SecretManager::V1::Secret Secret} in the format + # `projects/*/secrets/*`. + # @!attribute [rw] replication + # @return [::Google::Cloud::SecretManager::V1::Replication] + # Optional. Immutable. The replication policy of the secret data attached to + # the {::Google::Cloud::SecretManager::V1::Secret Secret}. + # + # The replication policy cannot be changed after the Secret has been created. + # @!attribute [r] create_time + # @return [::Google::Protobuf::Timestamp] + # Output only. The time at which the + # {::Google::Cloud::SecretManager::V1::Secret Secret} was created. + # @!attribute [rw] labels + # @return [::Google::Protobuf::Map{::String => ::String}] + # The labels assigned to this Secret. + # + # Label keys must be between 1 and 63 characters long, have a UTF-8 encoding + # of maximum 128 bytes, and must conform to the following PCRE regular + # expression: `[\p{Ll}\p{Lo}][\p{Ll}\p{Lo}\p{N}_-]{0,62}` + # + # Label values must be between 0 and 63 characters long, have a UTF-8 + # encoding of maximum 128 bytes, and must conform to the following PCRE + # regular expression: `[\p{Ll}\p{Lo}\p{N}_-]{0,63}` + # + # No more than 64 labels can be assigned to a given resource. + # @!attribute [rw] topics + # @return [::Array<::Google::Cloud::SecretManager::V1::Topic>] + # Optional. A list of up to 10 Pub/Sub topics to which messages are published + # when control plane operations are called on the secret or its versions. + # @!attribute [rw] expire_time + # @return [::Google::Protobuf::Timestamp] + # Optional. Timestamp in UTC when the + # {::Google::Cloud::SecretManager::V1::Secret Secret} is scheduled to expire. + # This is always provided on output, regardless of what was sent on input. + # + # Note: The following fields are mutually exclusive: `expire_time`, `ttl`. If a field in that set is populated, all other fields in the set will automatically be cleared. + # @!attribute [rw] ttl + # @return [::Google::Protobuf::Duration] + # Input only. The TTL for the + # {::Google::Cloud::SecretManager::V1::Secret Secret}. + # + # Note: The following fields are mutually exclusive: `ttl`, `expire_time`. If a field in that set is populated, all other fields in the set will automatically be cleared. + # @!attribute [rw] etag + # @return [::String] + # Optional. Etag of the currently stored + # {::Google::Cloud::SecretManager::V1::Secret Secret}. + # @!attribute [rw] rotation + # @return [::Google::Cloud::SecretManager::V1::Rotation] + # Optional. Rotation policy attached to the + # {::Google::Cloud::SecretManager::V1::Secret Secret}. May be excluded if there is + # no rotation policy. + # @!attribute [rw] version_aliases + # @return [::Google::Protobuf::Map{::String => ::Integer}] + # Optional. Mapping from version alias to version name. + # + # A version alias is a string with a maximum length of 63 characters and can + # contain uppercase and lowercase letters, numerals, and the hyphen (`-`) + # and underscore ('_') characters. An alias string must start with a + # letter and cannot be the string 'latest' or 'NEW'. + # No more than 50 aliases can be assigned to a given secret. + # + # Version-Alias pairs will be viewable via GetSecret and modifiable via + # UpdateSecret. Access by alias is only be supported on + # GetSecretVersion and AccessSecretVersion. + # @!attribute [rw] annotations + # @return [::Google::Protobuf::Map{::String => ::String}] + # Optional. Custom metadata about the secret. + # + # Annotations are distinct from various forms of labels. + # Annotations exist to allow client tools to store their own state + # information without requiring a database. + # + # Annotation keys must be between 1 and 63 characters long, have a UTF-8 + # encoding of maximum 128 bytes, begin and end with an alphanumeric character + # ([a-z0-9A-Z]), and may have dashes (-), underscores (_), dots (.), and + # alphanumerics in between these symbols. + # + # The total size of annotation keys and values must be less than 16KiB. + # @!attribute [rw] version_destroy_ttl + # @return [::Google::Protobuf::Duration] + # Optional. Secret Version TTL after destruction request + # + # This is a part of the Delayed secret version destroy feature. + # For secret with TTL>0, version destruction doesn't happen immediately + # on calling destroy instead the version goes to a disabled state and + # destruction happens after the TTL expires. + # @!attribute [rw] customer_managed_encryption + # @return [::Google::Cloud::SecretManager::V1::CustomerManagedEncryption] + # Optional. The customer-managed encryption configuration of the regionalized + # secrets. If no configuration is provided, Google-managed default encryption + # is used. + # + # Updates to the {::Google::Cloud::SecretManager::V1::Secret Secret} encryption + # configuration only apply to + # {::Google::Cloud::SecretManager::V1::SecretVersion SecretVersions} added + # afterwards. They do not apply retroactively to existing + # {::Google::Cloud::SecretManager::V1::SecretVersion SecretVersions}. + # @!attribute [rw] tags + # @return [::Google::Protobuf::Map{::String => ::String}] + # Optional. Input only. Immutable. Mapping of Tag keys/values directly bound + # to this resource. For example: + # "123/environment": "production", + # "123/costCenter": "marketing" + # + # Tags are used to organize and group resources. + # + # Tags can be used to control policy evaluation for the resource. + class Secret + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # @!attribute [rw] key + # @return [::String] + # @!attribute [rw] value + # @return [::String] + class LabelsEntry + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # @!attribute [rw] key + # @return [::String] + # @!attribute [rw] value + # @return [::Integer] + class VersionAliasesEntry + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # @!attribute [rw] key + # @return [::String] + # @!attribute [rw] value + # @return [::String] + class AnnotationsEntry + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # @!attribute [rw] key + # @return [::String] + # @!attribute [rw] value + # @return [::String] + class TagsEntry + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end + + # A secret version resource in the Secret Manager API. + # @!attribute [r] name + # @return [::String] + # Output only. The resource name of the + # {::Google::Cloud::SecretManager::V1::SecretVersion SecretVersion} in the format + # `projects/*/secrets/*/versions/*`. + # + # {::Google::Cloud::SecretManager::V1::SecretVersion SecretVersion} IDs in a + # {::Google::Cloud::SecretManager::V1::Secret Secret} start at 1 and are + # incremented for each subsequent version of the secret. + # @!attribute [r] create_time + # @return [::Google::Protobuf::Timestamp] + # Output only. The time at which the + # {::Google::Cloud::SecretManager::V1::SecretVersion SecretVersion} was created. + # @!attribute [r] destroy_time + # @return [::Google::Protobuf::Timestamp] + # Output only. The time this + # {::Google::Cloud::SecretManager::V1::SecretVersion SecretVersion} was destroyed. + # Only present if {::Google::Cloud::SecretManager::V1::SecretVersion#state state} + # is + # {::Google::Cloud::SecretManager::V1::SecretVersion::State::DESTROYED DESTROYED}. + # @!attribute [r] state + # @return [::Google::Cloud::SecretManager::V1::SecretVersion::State] + # Output only. The current state of the + # {::Google::Cloud::SecretManager::V1::SecretVersion SecretVersion}. + # @!attribute [rw] replication_status + # @return [::Google::Cloud::SecretManager::V1::ReplicationStatus] + # The replication status of the + # {::Google::Cloud::SecretManager::V1::SecretVersion SecretVersion}. + # @!attribute [r] etag + # @return [::String] + # Output only. Etag of the currently stored + # {::Google::Cloud::SecretManager::V1::SecretVersion SecretVersion}. + # @!attribute [r] client_specified_payload_checksum + # @return [::Boolean] + # Output only. True if payload checksum specified in + # {::Google::Cloud::SecretManager::V1::SecretPayload SecretPayload} object has + # been received by + # {::Google::Cloud::SecretManager::V1::SecretManagerService::Client SecretManagerService} + # on + # {::Google::Cloud::SecretManager::V1::SecretManagerService::Client#add_secret_version SecretManagerService.AddSecretVersion}. + # @!attribute [r] scheduled_destroy_time + # @return [::Google::Protobuf::Timestamp] + # Optional. Output only. Scheduled destroy time for secret version. + # This is a part of the Delayed secret version destroy feature. For a + # Secret with a valid version destroy TTL, when a secert version is + # destroyed, version is moved to disabled state and it is scheduled for + # destruction Version is destroyed only after the scheduled_destroy_time. + # @!attribute [r] customer_managed_encryption + # @return [::Google::Cloud::SecretManager::V1::CustomerManagedEncryptionStatus] + # Output only. The customer-managed encryption status of the + # {::Google::Cloud::SecretManager::V1::SecretVersion SecretVersion}. Only + # populated if customer-managed encryption is used and + # {::Google::Cloud::SecretManager::V1::Secret Secret} is a regionalized secret. + class SecretVersion + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # The state of a + # {::Google::Cloud::SecretManager::V1::SecretVersion SecretVersion}, indicating if + # it can be accessed. + module State + # Not specified. This value is unused and invalid. + STATE_UNSPECIFIED = 0 + + # The {::Google::Cloud::SecretManager::V1::SecretVersion SecretVersion} may be + # accessed. + ENABLED = 1 + + # The {::Google::Cloud::SecretManager::V1::SecretVersion SecretVersion} may not + # be accessed, but the secret data is still available and can be placed + # back into the + # {::Google::Cloud::SecretManager::V1::SecretVersion::State::ENABLED ENABLED} + # state. + DISABLED = 2 + + # The {::Google::Cloud::SecretManager::V1::SecretVersion SecretVersion} is + # destroyed and the secret data is no longer stored. A version may not + # leave this state once entered. + DESTROYED = 3 + end + end + + # A policy that defines the replication and encryption configuration of data. + # @!attribute [rw] automatic + # @return [::Google::Cloud::SecretManager::V1::Replication::Automatic] + # The {::Google::Cloud::SecretManager::V1::Secret Secret} will automatically be + # replicated without any restrictions. + # + # Note: The following fields are mutually exclusive: `automatic`, `user_managed`. If a field in that set is populated, all other fields in the set will automatically be cleared. + # @!attribute [rw] user_managed + # @return [::Google::Cloud::SecretManager::V1::Replication::UserManaged] + # The {::Google::Cloud::SecretManager::V1::Secret Secret} will only be + # replicated into the locations specified. + # + # Note: The following fields are mutually exclusive: `user_managed`, `automatic`. If a field in that set is populated, all other fields in the set will automatically be cleared. + class Replication + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # A replication policy that replicates the + # {::Google::Cloud::SecretManager::V1::Secret Secret} payload without any + # restrictions. + # @!attribute [rw] customer_managed_encryption + # @return [::Google::Cloud::SecretManager::V1::CustomerManagedEncryption] + # Optional. The customer-managed encryption configuration of the + # {::Google::Cloud::SecretManager::V1::Secret Secret}. If no configuration is + # provided, Google-managed default encryption is used. + # + # Updates to the {::Google::Cloud::SecretManager::V1::Secret Secret} encryption + # configuration only apply to + # {::Google::Cloud::SecretManager::V1::SecretVersion SecretVersions} added + # afterwards. They do not apply retroactively to existing + # {::Google::Cloud::SecretManager::V1::SecretVersion SecretVersions}. + class Automatic + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # A replication policy that replicates the + # {::Google::Cloud::SecretManager::V1::Secret Secret} payload into the locations + # specified in + # {::Google::Cloud::SecretManager::V1::Replication::UserManaged#replicas Replication.UserManaged.replicas} + # @!attribute [rw] replicas + # @return [::Array<::Google::Cloud::SecretManager::V1::Replication::UserManaged::Replica>] + # Required. The list of Replicas for this + # {::Google::Cloud::SecretManager::V1::Secret Secret}. + # + # Cannot be empty. + class UserManaged + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # Represents a Replica for this + # {::Google::Cloud::SecretManager::V1::Secret Secret}. + # @!attribute [rw] location + # @return [::String] + # The canonical IDs of the location to replicate data. + # For example: `"us-east1"`. + # @!attribute [rw] customer_managed_encryption + # @return [::Google::Cloud::SecretManager::V1::CustomerManagedEncryption] + # Optional. The customer-managed encryption configuration of the + # [User-Managed Replica][Replication.UserManaged.Replica]. If no + # configuration is provided, Google-managed default encryption is used. + # + # Updates to the {::Google::Cloud::SecretManager::V1::Secret Secret} + # encryption configuration only apply to + # {::Google::Cloud::SecretManager::V1::SecretVersion SecretVersions} added + # afterwards. They do not apply retroactively to existing + # {::Google::Cloud::SecretManager::V1::SecretVersion SecretVersions}. + class Replica + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end + end + + # Configuration for encrypting secret payloads using customer-managed + # encryption keys (CMEK). + # @!attribute [rw] kms_key_name + # @return [::String] + # Required. The resource name of the Cloud KMS CryptoKey used to encrypt + # secret payloads. + # + # For secrets using the + # {::Google::Cloud::SecretManager::V1::Replication::UserManaged UserManaged} + # replication policy type, Cloud KMS CryptoKeys must reside in the same + # location as the [replica location][Secret.UserManaged.Replica.location]. + # + # For secrets using the + # {::Google::Cloud::SecretManager::V1::Replication::Automatic Automatic} + # replication policy type, Cloud KMS CryptoKeys must reside in `global`. + # + # The expected format is `projects/*/locations/*/keyRings/*/cryptoKeys/*`. + class CustomerManagedEncryption + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # The replication status of a + # {::Google::Cloud::SecretManager::V1::SecretVersion SecretVersion}. + # @!attribute [rw] automatic + # @return [::Google::Cloud::SecretManager::V1::ReplicationStatus::AutomaticStatus] + # Describes the replication status of a + # {::Google::Cloud::SecretManager::V1::SecretVersion SecretVersion} with + # automatic replication. + # + # Only populated if the parent + # {::Google::Cloud::SecretManager::V1::Secret Secret} has an automatic + # replication policy. + # + # Note: The following fields are mutually exclusive: `automatic`, `user_managed`. If a field in that set is populated, all other fields in the set will automatically be cleared. + # @!attribute [rw] user_managed + # @return [::Google::Cloud::SecretManager::V1::ReplicationStatus::UserManagedStatus] + # Describes the replication status of a + # {::Google::Cloud::SecretManager::V1::SecretVersion SecretVersion} with + # user-managed replication. + # + # Only populated if the parent + # {::Google::Cloud::SecretManager::V1::Secret Secret} has a user-managed + # replication policy. + # + # Note: The following fields are mutually exclusive: `user_managed`, `automatic`. If a field in that set is populated, all other fields in the set will automatically be cleared. + class ReplicationStatus + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # The replication status of a + # {::Google::Cloud::SecretManager::V1::SecretVersion SecretVersion} using + # automatic replication. + # + # Only populated if the parent {::Google::Cloud::SecretManager::V1::Secret Secret} + # has an automatic replication policy. + # @!attribute [r] customer_managed_encryption + # @return [::Google::Cloud::SecretManager::V1::CustomerManagedEncryptionStatus] + # Output only. The customer-managed encryption status of the + # {::Google::Cloud::SecretManager::V1::SecretVersion SecretVersion}. Only + # populated if customer-managed encryption is used. + class AutomaticStatus + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # The replication status of a + # {::Google::Cloud::SecretManager::V1::SecretVersion SecretVersion} using + # user-managed replication. + # + # Only populated if the parent {::Google::Cloud::SecretManager::V1::Secret Secret} + # has a user-managed replication policy. + # @!attribute [r] replicas + # @return [::Array<::Google::Cloud::SecretManager::V1::ReplicationStatus::UserManagedStatus::ReplicaStatus>] + # Output only. The list of replica statuses for the + # {::Google::Cloud::SecretManager::V1::SecretVersion SecretVersion}. + class UserManagedStatus + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # Describes the status of a user-managed replica for the + # {::Google::Cloud::SecretManager::V1::SecretVersion SecretVersion}. + # @!attribute [r] location + # @return [::String] + # Output only. The canonical ID of the replica location. + # For example: `"us-east1"`. + # @!attribute [r] customer_managed_encryption + # @return [::Google::Cloud::SecretManager::V1::CustomerManagedEncryptionStatus] + # Output only. The customer-managed encryption status of the + # {::Google::Cloud::SecretManager::V1::SecretVersion SecretVersion}. Only + # populated if customer-managed encryption is used. + class ReplicaStatus + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end + end + + # Describes the status of customer-managed encryption. + # @!attribute [rw] kms_key_version_name + # @return [::String] + # Required. The resource name of the Cloud KMS CryptoKeyVersion used to + # encrypt the secret payload, in the following format: + # `projects/*/locations/*/keyRings/*/cryptoKeys/*/versions/*`. + class CustomerManagedEncryptionStatus + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # A Pub/Sub topic which Secret Manager will publish to when control plane + # events occur on this secret. + # @!attribute [rw] name + # @return [::String] + # Identifier. The resource name of the Pub/Sub topic that will be published + # to, in the following format: `projects/*/topics/*`. For publication to + # succeed, the Secret Manager service agent must have the + # `pubsub.topic.publish` permission on the topic. The Pub/Sub Publisher role + # (`roles/pubsub.publisher`) includes this permission. + class Topic + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # The rotation time and period for a + # {::Google::Cloud::SecretManager::V1::Secret Secret}. At next_rotation_time, Secret + # Manager will send a Pub/Sub notification to the topics configured on the + # Secret. {::Google::Cloud::SecretManager::V1::Secret#topics Secret.topics} must be + # set to configure rotation. + # @!attribute [rw] next_rotation_time + # @return [::Google::Protobuf::Timestamp] + # Optional. Timestamp in UTC at which the + # {::Google::Cloud::SecretManager::V1::Secret Secret} is scheduled to rotate. + # Cannot be set to less than 300s (5 min) in the future and at most + # 3153600000s (100 years). + # + # {::Google::Cloud::SecretManager::V1::Rotation#next_rotation_time next_rotation_time} + # MUST be set if + # {::Google::Cloud::SecretManager::V1::Rotation#rotation_period rotation_period} + # is set. + # @!attribute [rw] rotation_period + # @return [::Google::Protobuf::Duration] + # Input only. The Duration between rotation notifications. Must be in seconds + # and at least 3600s (1h) and at most 3153600000s (100 years). + # + # If + # {::Google::Cloud::SecretManager::V1::Rotation#rotation_period rotation_period} + # is set, + # {::Google::Cloud::SecretManager::V1::Rotation#next_rotation_time next_rotation_time} + # must be set. + # {::Google::Cloud::SecretManager::V1::Rotation#next_rotation_time next_rotation_time} + # will be advanced by this period when the service automatically sends + # rotation notifications. + class Rotation + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # A secret payload resource in the Secret Manager API. This contains the + # sensitive secret payload that is associated with a + # {::Google::Cloud::SecretManager::V1::SecretVersion SecretVersion}. + # @!attribute [rw] data + # @return [::String] + # The secret data. Must be no larger than 64KiB. + # @!attribute [rw] data_crc32c + # @return [::Integer] + # Optional. If specified, + # {::Google::Cloud::SecretManager::V1::SecretManagerService::Client SecretManagerService} + # will verify the integrity of the received + # {::Google::Cloud::SecretManager::V1::SecretPayload#data data} on + # {::Google::Cloud::SecretManager::V1::SecretManagerService::Client#add_secret_version SecretManagerService.AddSecretVersion} + # calls using the crc32c checksum and store it to include in future + # {::Google::Cloud::SecretManager::V1::SecretManagerService::Client#access_secret_version SecretManagerService.AccessSecretVersion} + # responses. If a checksum is not provided in the + # {::Google::Cloud::SecretManager::V1::SecretManagerService::Client#add_secret_version SecretManagerService.AddSecretVersion} + # request, the + # {::Google::Cloud::SecretManager::V1::SecretManagerService::Client SecretManagerService} + # will generate and store one for you. + # + # The CRC32C value is encoded as a Int64 for compatibility, and can be + # safely downconverted to uint32 in languages that support this type. + # https://cloud.google.com/apis/design/design_patterns#integer_types + class SecretPayload + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-secret_manager-v1/proto_docs/google/cloud/secretmanager/v1/service.rb b/owl-bot-staging/google-cloud-secret_manager-v1/proto_docs/google/cloud/secretmanager/v1/service.rb new file mode 100644 index 000000000000..2ccf18690cd5 --- /dev/null +++ b/owl-bot-staging/google-cloud-secret_manager-v1/proto_docs/google/cloud/secretmanager/v1/service.rb @@ -0,0 +1,320 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + + +module Google + module Cloud + module SecretManager + module V1 + # Request message for + # {::Google::Cloud::SecretManager::V1::SecretManagerService::Client#list_secrets SecretManagerService.ListSecrets}. + # @!attribute [rw] parent + # @return [::String] + # Required. The resource name of the project associated with the + # {::Google::Cloud::SecretManager::V1::Secret Secrets}, in the format `projects/*` + # or `projects/*/locations/*` + # @!attribute [rw] page_size + # @return [::Integer] + # Optional. The maximum number of results to be returned in a single page. If + # set to 0, the server decides the number of results to return. If the + # number is greater than 25000, it is capped at 25000. + # @!attribute [rw] page_token + # @return [::String] + # Optional. Pagination token, returned earlier via + # {::Google::Cloud::SecretManager::V1::ListSecretsResponse#next_page_token ListSecretsResponse.next_page_token}. + # @!attribute [rw] filter + # @return [::String] + # Optional. Filter string, adhering to the rules in + # [List-operation + # filtering](https://cloud.google.com/secret-manager/docs/filtering). List + # only secrets matching the filter. If filter is empty, all secrets are + # listed. + class ListSecretsRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Response message for + # {::Google::Cloud::SecretManager::V1::SecretManagerService::Client#list_secrets SecretManagerService.ListSecrets}. + # @!attribute [rw] secrets + # @return [::Array<::Google::Cloud::SecretManager::V1::Secret>] + # The list of {::Google::Cloud::SecretManager::V1::Secret Secrets} sorted in + # reverse by create_time (newest first). + # @!attribute [rw] next_page_token + # @return [::String] + # A token to retrieve the next page of results. Pass this value in + # {::Google::Cloud::SecretManager::V1::ListSecretsRequest#page_token ListSecretsRequest.page_token} + # to retrieve the next page. + # @!attribute [rw] total_size + # @return [::Integer] + # The total number of {::Google::Cloud::SecretManager::V1::Secret Secrets} but 0 + # when the + # {::Google::Cloud::SecretManager::V1::ListSecretsRequest#filter ListSecretsRequest.filter} + # field is set. + class ListSecretsResponse + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Request message for + # {::Google::Cloud::SecretManager::V1::SecretManagerService::Client#create_secret SecretManagerService.CreateSecret}. + # @!attribute [rw] parent + # @return [::String] + # Required. The resource name of the project to associate with the + # {::Google::Cloud::SecretManager::V1::Secret Secret}, in the format `projects/*` + # or `projects/*/locations/*`. + # @!attribute [rw] secret_id + # @return [::String] + # Required. This must be unique within the project. + # + # A secret ID is a string with a maximum length of 255 characters and can + # contain uppercase and lowercase letters, numerals, and the hyphen (`-`) and + # underscore (`_`) characters. + # @!attribute [rw] secret + # @return [::Google::Cloud::SecretManager::V1::Secret] + # Required. A {::Google::Cloud::SecretManager::V1::Secret Secret} with initial + # field values. + class CreateSecretRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Request message for + # {::Google::Cloud::SecretManager::V1::SecretManagerService::Client#add_secret_version SecretManagerService.AddSecretVersion}. + # @!attribute [rw] parent + # @return [::String] + # Required. The resource name of the + # {::Google::Cloud::SecretManager::V1::Secret Secret} to associate with the + # {::Google::Cloud::SecretManager::V1::SecretVersion SecretVersion} in the format + # `projects/*/secrets/*` or `projects/*/locations/*/secrets/*`. + # @!attribute [rw] payload + # @return [::Google::Cloud::SecretManager::V1::SecretPayload] + # Required. The secret payload of the + # {::Google::Cloud::SecretManager::V1::SecretVersion SecretVersion}. + class AddSecretVersionRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Request message for + # {::Google::Cloud::SecretManager::V1::SecretManagerService::Client#get_secret SecretManagerService.GetSecret}. + # @!attribute [rw] name + # @return [::String] + # Required. The resource name of the + # {::Google::Cloud::SecretManager::V1::Secret Secret}, in the format + # `projects/*/secrets/*` or `projects/*/locations/*/secrets/*`. + class GetSecretRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Request message for + # {::Google::Cloud::SecretManager::V1::SecretManagerService::Client#list_secret_versions SecretManagerService.ListSecretVersions}. + # @!attribute [rw] parent + # @return [::String] + # Required. The resource name of the + # {::Google::Cloud::SecretManager::V1::Secret Secret} associated with the + # {::Google::Cloud::SecretManager::V1::SecretVersion SecretVersions} to list, in + # the format `projects/*/secrets/*` or `projects/*/locations/*/secrets/*`. + # @!attribute [rw] page_size + # @return [::Integer] + # Optional. The maximum number of results to be returned in a single page. If + # set to 0, the server decides the number of results to return. If the + # number is greater than 25000, it is capped at 25000. + # @!attribute [rw] page_token + # @return [::String] + # Optional. Pagination token, returned earlier via + # ListSecretVersionsResponse.next_page_token][]. + # @!attribute [rw] filter + # @return [::String] + # Optional. Filter string, adhering to the rules in + # [List-operation + # filtering](https://cloud.google.com/secret-manager/docs/filtering). List + # only secret versions matching the filter. If filter is empty, all secret + # versions are listed. + class ListSecretVersionsRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Response message for + # {::Google::Cloud::SecretManager::V1::SecretManagerService::Client#list_secret_versions SecretManagerService.ListSecretVersions}. + # @!attribute [rw] versions + # @return [::Array<::Google::Cloud::SecretManager::V1::SecretVersion>] + # The list of {::Google::Cloud::SecretManager::V1::SecretVersion SecretVersions} + # sorted in reverse by create_time (newest first). + # @!attribute [rw] next_page_token + # @return [::String] + # A token to retrieve the next page of results. Pass this value in + # {::Google::Cloud::SecretManager::V1::ListSecretVersionsRequest#page_token ListSecretVersionsRequest.page_token} + # to retrieve the next page. + # @!attribute [rw] total_size + # @return [::Integer] + # The total number of + # {::Google::Cloud::SecretManager::V1::SecretVersion SecretVersions} but 0 when + # the + # {::Google::Cloud::SecretManager::V1::ListSecretsRequest#filter ListSecretsRequest.filter} + # field is set. + class ListSecretVersionsResponse + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Request message for + # {::Google::Cloud::SecretManager::V1::SecretManagerService::Client#get_secret_version SecretManagerService.GetSecretVersion}. + # @!attribute [rw] name + # @return [::String] + # Required. The resource name of the + # {::Google::Cloud::SecretManager::V1::SecretVersion SecretVersion} in the format + # `projects/*/secrets/*/versions/*` or + # `projects/*/locations/*/secrets/*/versions/*`. + # + # `projects/*/secrets/*/versions/latest` or + # `projects/*/locations/*/secrets/*/versions/latest` is an alias to the most + # recently created + # {::Google::Cloud::SecretManager::V1::SecretVersion SecretVersion}. + class GetSecretVersionRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Request message for + # {::Google::Cloud::SecretManager::V1::SecretManagerService::Client#update_secret SecretManagerService.UpdateSecret}. + # @!attribute [rw] secret + # @return [::Google::Cloud::SecretManager::V1::Secret] + # Required. {::Google::Cloud::SecretManager::V1::Secret Secret} with updated field + # values. + # @!attribute [rw] update_mask + # @return [::Google::Protobuf::FieldMask] + # Required. Specifies the fields to be updated. + class UpdateSecretRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Request message for + # {::Google::Cloud::SecretManager::V1::SecretManagerService::Client#access_secret_version SecretManagerService.AccessSecretVersion}. + # @!attribute [rw] name + # @return [::String] + # Required. The resource name of the + # {::Google::Cloud::SecretManager::V1::SecretVersion SecretVersion} in the format + # `projects/*/secrets/*/versions/*` or + # `projects/*/locations/*/secrets/*/versions/*`. + # + # `projects/*/secrets/*/versions/latest` or + # `projects/*/locations/*/secrets/*/versions/latest` is an alias to the most + # recently created + # {::Google::Cloud::SecretManager::V1::SecretVersion SecretVersion}. + class AccessSecretVersionRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Response message for + # {::Google::Cloud::SecretManager::V1::SecretManagerService::Client#access_secret_version SecretManagerService.AccessSecretVersion}. + # @!attribute [rw] name + # @return [::String] + # The resource name of the + # {::Google::Cloud::SecretManager::V1::SecretVersion SecretVersion} in the format + # `projects/*/secrets/*/versions/*` or + # `projects/*/locations/*/secrets/*/versions/*`. + # @!attribute [rw] payload + # @return [::Google::Cloud::SecretManager::V1::SecretPayload] + # Secret payload + class AccessSecretVersionResponse + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Request message for + # {::Google::Cloud::SecretManager::V1::SecretManagerService::Client#delete_secret SecretManagerService.DeleteSecret}. + # @!attribute [rw] name + # @return [::String] + # Required. The resource name of the + # {::Google::Cloud::SecretManager::V1::Secret Secret} to delete in the format + # `projects/*/secrets/*`. + # @!attribute [rw] etag + # @return [::String] + # Optional. Etag of the {::Google::Cloud::SecretManager::V1::Secret Secret}. The + # request succeeds if it matches the etag of the currently stored secret + # object. If the etag is omitted, the request succeeds. + class DeleteSecretRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Request message for + # {::Google::Cloud::SecretManager::V1::SecretManagerService::Client#disable_secret_version SecretManagerService.DisableSecretVersion}. + # @!attribute [rw] name + # @return [::String] + # Required. The resource name of the + # {::Google::Cloud::SecretManager::V1::SecretVersion SecretVersion} to disable in + # the format `projects/*/secrets/*/versions/*` or + # `projects/*/locations/*/secrets/*/versions/*`. + # @!attribute [rw] etag + # @return [::String] + # Optional. Etag of the + # {::Google::Cloud::SecretManager::V1::SecretVersion SecretVersion}. The request + # succeeds if it matches the etag of the currently stored secret version + # object. If the etag is omitted, the request succeeds. + class DisableSecretVersionRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Request message for + # {::Google::Cloud::SecretManager::V1::SecretManagerService::Client#enable_secret_version SecretManagerService.EnableSecretVersion}. + # @!attribute [rw] name + # @return [::String] + # Required. The resource name of the + # {::Google::Cloud::SecretManager::V1::SecretVersion SecretVersion} to enable in + # the format `projects/*/secrets/*/versions/*` or + # `projects/*/locations/*/secrets/*/versions/*`. + # @!attribute [rw] etag + # @return [::String] + # Optional. Etag of the + # {::Google::Cloud::SecretManager::V1::SecretVersion SecretVersion}. The request + # succeeds if it matches the etag of the currently stored secret version + # object. If the etag is omitted, the request succeeds. + class EnableSecretVersionRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Request message for + # {::Google::Cloud::SecretManager::V1::SecretManagerService::Client#destroy_secret_version SecretManagerService.DestroySecretVersion}. + # @!attribute [rw] name + # @return [::String] + # Required. The resource name of the + # {::Google::Cloud::SecretManager::V1::SecretVersion SecretVersion} to destroy in + # the format `projects/*/secrets/*/versions/*` or + # `projects/*/locations/*/secrets/*/versions/*`. + # @!attribute [rw] etag + # @return [::String] + # Optional. Etag of the + # {::Google::Cloud::SecretManager::V1::SecretVersion SecretVersion}. The request + # succeeds if it matches the etag of the currently stored secret version + # object. If the etag is omitted, the request succeeds. + class DestroySecretVersionRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-secret_manager-v1/proto_docs/google/iam/v1/iam_policy.rb b/owl-bot-staging/google-cloud-secret_manager-v1/proto_docs/google/iam/v1/iam_policy.rb new file mode 100644 index 000000000000..5445c77f8258 --- /dev/null +++ b/owl-bot-staging/google-cloud-secret_manager-v1/proto_docs/google/iam/v1/iam_policy.rb @@ -0,0 +1,87 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + + +module Google + module Iam + module V1 + # Request message for `SetIamPolicy` method. + # @!attribute [rw] resource + # @return [::String] + # REQUIRED: The resource for which the policy is being specified. + # See the operation documentation for the appropriate value for this field. + # @!attribute [rw] policy + # @return [::Google::Iam::V1::Policy] + # REQUIRED: The complete policy to be applied to the `resource`. The size of + # the policy is limited to a few 10s of KB. An empty policy is a + # valid policy but certain Cloud Platform services (such as Projects) + # might reject them. + # @!attribute [rw] update_mask + # @return [::Google::Protobuf::FieldMask] + # OPTIONAL: A FieldMask specifying which fields of the policy to modify. Only + # the fields in the mask will be modified. If no mask is provided, the + # following default mask is used: + # + # `paths: "bindings, etag"` + class SetIamPolicyRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Request message for `GetIamPolicy` method. + # @!attribute [rw] resource + # @return [::String] + # REQUIRED: The resource for which the policy is being requested. + # See the operation documentation for the appropriate value for this field. + # @!attribute [rw] options + # @return [::Google::Iam::V1::GetPolicyOptions] + # OPTIONAL: A `GetPolicyOptions` object for specifying options to + # `GetIamPolicy`. + class GetIamPolicyRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Request message for `TestIamPermissions` method. + # @!attribute [rw] resource + # @return [::String] + # REQUIRED: The resource for which the policy detail is being requested. + # See the operation documentation for the appropriate value for this field. + # @!attribute [rw] permissions + # @return [::Array<::String>] + # The set of permissions to check for the `resource`. Permissions with + # wildcards (such as '*' or 'storage.*') are not allowed. For more + # information see + # [IAM Overview](https://cloud.google.com/iam/docs/overview#permissions). + class TestIamPermissionsRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Response message for `TestIamPermissions` method. + # @!attribute [rw] permissions + # @return [::Array<::String>] + # A subset of `TestPermissionsRequest.permissions` that the caller is + # allowed. + class TestIamPermissionsResponse + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end + end +end diff --git a/owl-bot-staging/google-cloud-secret_manager-v1/proto_docs/google/iam/v1/options.rb b/owl-bot-staging/google-cloud-secret_manager-v1/proto_docs/google/iam/v1/options.rb new file mode 100644 index 000000000000..60713d995b86 --- /dev/null +++ b/owl-bot-staging/google-cloud-secret_manager-v1/proto_docs/google/iam/v1/options.rb @@ -0,0 +1,50 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + + +module Google + module Iam + module V1 + # Encapsulates settings provided to GetIamPolicy. + # @!attribute [rw] requested_policy_version + # @return [::Integer] + # Optional. The maximum policy version that will be used to format the + # policy. + # + # Valid values are 0, 1, and 3. Requests specifying an invalid value will be + # rejected. + # + # Requests for policies with any conditional role bindings must specify + # version 3. Policies with no conditional role bindings may specify any valid + # value or leave the field unset. + # + # The policy in the response might use the policy version that you specified, + # or it might use a lower policy version. For example, if you specify version + # 3, but the policy has no conditional role bindings, the response uses + # version 1. + # + # To learn which resources support conditions in their IAM policies, see the + # [IAM + # documentation](https://cloud.google.com/iam/help/conditions/resource-policies). + class GetPolicyOptions + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end + end +end diff --git a/owl-bot-staging/google-cloud-secret_manager-v1/proto_docs/google/iam/v1/policy.rb b/owl-bot-staging/google-cloud-secret_manager-v1/proto_docs/google/iam/v1/policy.rb new file mode 100644 index 000000000000..999575b797df --- /dev/null +++ b/owl-bot-staging/google-cloud-secret_manager-v1/proto_docs/google/iam/v1/policy.rb @@ -0,0 +1,426 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + + +module Google + module Iam + module V1 + # An Identity and Access Management (IAM) policy, which specifies access + # controls for Google Cloud resources. + # + # + # A `Policy` is a collection of `bindings`. A `binding` binds one or more + # `members`, or principals, to a single `role`. Principals can be user + # accounts, service accounts, Google groups, and domains (such as G Suite). A + # `role` is a named list of permissions; each `role` can be an IAM predefined + # role or a user-created custom role. + # + # For some types of Google Cloud resources, a `binding` can also specify a + # `condition`, which is a logical expression that allows access to a resource + # only if the expression evaluates to `true`. A condition can add constraints + # based on attributes of the request, the resource, or both. To learn which + # resources support conditions in their IAM policies, see the + # [IAM + # documentation](https://cloud.google.com/iam/help/conditions/resource-policies). + # + # **JSON example:** + # + # ``` + # { + # "bindings": [ + # { + # "role": "roles/resourcemanager.organizationAdmin", + # "members": [ + # "user:mike@example.com", + # "group:admins@example.com", + # "domain:google.com", + # "serviceAccount:my-project-id@appspot.gserviceaccount.com" + # ] + # }, + # { + # "role": "roles/resourcemanager.organizationViewer", + # "members": [ + # "user:eve@example.com" + # ], + # "condition": { + # "title": "expirable access", + # "description": "Does not grant access after Sep 2020", + # "expression": "request.time < + # timestamp('2020-10-01T00:00:00.000Z')", + # } + # } + # ], + # "etag": "BwWWja0YfJA=", + # "version": 3 + # } + # ``` + # + # **YAML example:** + # + # ``` + # bindings: + # - members: + # - user:mike@example.com + # - group:admins@example.com + # - domain:google.com + # - serviceAccount:my-project-id@appspot.gserviceaccount.com + # role: roles/resourcemanager.organizationAdmin + # - members: + # - user:eve@example.com + # role: roles/resourcemanager.organizationViewer + # condition: + # title: expirable access + # description: Does not grant access after Sep 2020 + # expression: request.time < timestamp('2020-10-01T00:00:00.000Z') + # etag: BwWWja0YfJA= + # version: 3 + # ``` + # + # For a description of IAM and its features, see the + # [IAM documentation](https://cloud.google.com/iam/docs/). + # @!attribute [rw] version + # @return [::Integer] + # Specifies the format of the policy. + # + # Valid values are `0`, `1`, and `3`. Requests that specify an invalid value + # are rejected. + # + # Any operation that affects conditional role bindings must specify version + # `3`. This requirement applies to the following operations: + # + # * Getting a policy that includes a conditional role binding + # * Adding a conditional role binding to a policy + # * Changing a conditional role binding in a policy + # * Removing any role binding, with or without a condition, from a policy + # that includes conditions + # + # **Important:** If you use IAM Conditions, you must include the `etag` field + # whenever you call `setIamPolicy`. If you omit this field, then IAM allows + # you to overwrite a version `3` policy with a version `1` policy, and all of + # the conditions in the version `3` policy are lost. + # + # If a policy does not include any conditions, operations on that policy may + # specify any valid version or leave the field unset. + # + # To learn which resources support conditions in their IAM policies, see the + # [IAM + # documentation](https://cloud.google.com/iam/help/conditions/resource-policies). + # @!attribute [rw] bindings + # @return [::Array<::Google::Iam::V1::Binding>] + # Associates a list of `members`, or principals, with a `role`. Optionally, + # may specify a `condition` that determines how and when the `bindings` are + # applied. Each of the `bindings` must contain at least one principal. + # + # The `bindings` in a `Policy` can refer to up to 1,500 principals; up to 250 + # of these principals can be Google groups. Each occurrence of a principal + # counts towards these limits. For example, if the `bindings` grant 50 + # different roles to `user:alice@example.com`, and not to any other + # principal, then you can add another 1,450 principals to the `bindings` in + # the `Policy`. + # @!attribute [rw] audit_configs + # @return [::Array<::Google::Iam::V1::AuditConfig>] + # Specifies cloud audit logging configuration for this policy. + # @!attribute [rw] etag + # @return [::String] + # `etag` is used for optimistic concurrency control as a way to help + # prevent simultaneous updates of a policy from overwriting each other. + # It is strongly suggested that systems make use of the `etag` in the + # read-modify-write cycle to perform policy updates in order to avoid race + # conditions: An `etag` is returned in the response to `getIamPolicy`, and + # systems are expected to put that etag in the request to `setIamPolicy` to + # ensure that their change will be applied to the same version of the policy. + # + # **Important:** If you use IAM Conditions, you must include the `etag` field + # whenever you call `setIamPolicy`. If you omit this field, then IAM allows + # you to overwrite a version `3` policy with a version `1` policy, and all of + # the conditions in the version `3` policy are lost. + class Policy + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Associates `members`, or principals, with a `role`. + # @!attribute [rw] role + # @return [::String] + # Role that is assigned to the list of `members`, or principals. + # For example, `roles/viewer`, `roles/editor`, or `roles/owner`. + # @!attribute [rw] members + # @return [::Array<::String>] + # Specifies the principals requesting access for a Google Cloud resource. + # `members` can have the following values: + # + # * `allUsers`: A special identifier that represents anyone who is + # on the internet; with or without a Google account. + # + # * `allAuthenticatedUsers`: A special identifier that represents anyone + # who is authenticated with a Google account or a service account. + # + # * `user:{emailid}`: An email address that represents a specific Google + # account. For example, `alice@example.com` . + # + # + # * `serviceAccount:{emailid}`: An email address that represents a service + # account. For example, `my-other-app@appspot.gserviceaccount.com`. + # + # * `group:{emailid}`: An email address that represents a Google group. + # For example, `admins@example.com`. + # + # * `deleted:user:{emailid}?uid={uniqueid}`: An email address (plus unique + # identifier) representing a user that has been recently deleted. For + # example, `alice@example.com?uid=123456789012345678901`. If the user is + # recovered, this value reverts to `user:{emailid}` and the recovered user + # retains the role in the binding. + # + # * `deleted:serviceAccount:{emailid}?uid={uniqueid}`: An email address (plus + # unique identifier) representing a service account that has been recently + # deleted. For example, + # `my-other-app@appspot.gserviceaccount.com?uid=123456789012345678901`. + # If the service account is undeleted, this value reverts to + # `serviceAccount:{emailid}` and the undeleted service account retains the + # role in the binding. + # + # * `deleted:group:{emailid}?uid={uniqueid}`: An email address (plus unique + # identifier) representing a Google group that has been recently + # deleted. For example, `admins@example.com?uid=123456789012345678901`. If + # the group is recovered, this value reverts to `group:{emailid}` and the + # recovered group retains the role in the binding. + # + # + # * `domain:{domain}`: The G Suite domain (primary) that represents all the + # users of that domain. For example, `google.com` or `example.com`. + # @!attribute [rw] condition + # @return [::Google::Type::Expr] + # The condition that is associated with this binding. + # + # If the condition evaluates to `true`, then this binding applies to the + # current request. + # + # If the condition evaluates to `false`, then this binding does not apply to + # the current request. However, a different role binding might grant the same + # role to one or more of the principals in this binding. + # + # To learn which resources support conditions in their IAM policies, see the + # [IAM + # documentation](https://cloud.google.com/iam/help/conditions/resource-policies). + class Binding + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Specifies the audit configuration for a service. + # The configuration determines which permission types are logged, and what + # identities, if any, are exempted from logging. + # An AuditConfig must have one or more AuditLogConfigs. + # + # If there are AuditConfigs for both `allServices` and a specific service, + # the union of the two AuditConfigs is used for that service: the log_types + # specified in each AuditConfig are enabled, and the exempted_members in each + # AuditLogConfig are exempted. + # + # Example Policy with multiple AuditConfigs: + # + # { + # "audit_configs": [ + # { + # "service": "allServices", + # "audit_log_configs": [ + # { + # "log_type": "DATA_READ", + # "exempted_members": [ + # "user:jose@example.com" + # ] + # }, + # { + # "log_type": "DATA_WRITE" + # }, + # { + # "log_type": "ADMIN_READ" + # } + # ] + # }, + # { + # "service": "sampleservice.googleapis.com", + # "audit_log_configs": [ + # { + # "log_type": "DATA_READ" + # }, + # { + # "log_type": "DATA_WRITE", + # "exempted_members": [ + # "user:aliya@example.com" + # ] + # } + # ] + # } + # ] + # } + # + # For sampleservice, this policy enables DATA_READ, DATA_WRITE and ADMIN_READ + # logging. It also exempts `jose@example.com` from DATA_READ logging, and + # `aliya@example.com` from DATA_WRITE logging. + # @!attribute [rw] service + # @return [::String] + # Specifies a service that will be enabled for audit logging. + # For example, `storage.googleapis.com`, `cloudsql.googleapis.com`. + # `allServices` is a special value that covers all services. + # @!attribute [rw] audit_log_configs + # @return [::Array<::Google::Iam::V1::AuditLogConfig>] + # The configuration for logging of each type of permission. + class AuditConfig + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Provides the configuration for logging a type of permissions. + # Example: + # + # { + # "audit_log_configs": [ + # { + # "log_type": "DATA_READ", + # "exempted_members": [ + # "user:jose@example.com" + # ] + # }, + # { + # "log_type": "DATA_WRITE" + # } + # ] + # } + # + # This enables 'DATA_READ' and 'DATA_WRITE' logging, while exempting + # jose@example.com from DATA_READ logging. + # @!attribute [rw] log_type + # @return [::Google::Iam::V1::AuditLogConfig::LogType] + # The log type that this config enables. + # @!attribute [rw] exempted_members + # @return [::Array<::String>] + # Specifies the identities that do not cause logging for this type of + # permission. + # Follows the same format of + # [Binding.members][google.iam.v1.Binding.members]. + class AuditLogConfig + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # The list of valid permission types for which logging can be configured. + # Admin writes are always logged, and are not configurable. + module LogType + # Default case. Should never be this. + LOG_TYPE_UNSPECIFIED = 0 + + # Admin reads. Example: CloudIAM getIamPolicy + ADMIN_READ = 1 + + # Data writes. Example: CloudSQL Users create + DATA_WRITE = 2 + + # Data reads. Example: CloudSQL Users list + DATA_READ = 3 + end + end + + # The difference delta between two policies. + # @!attribute [rw] binding_deltas + # @return [::Array<::Google::Iam::V1::BindingDelta>] + # The delta for Bindings between two policies. + # @!attribute [rw] audit_config_deltas + # @return [::Array<::Google::Iam::V1::AuditConfigDelta>] + # The delta for AuditConfigs between two policies. + class PolicyDelta + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # One delta entry for Binding. Each individual change (only one member in each + # entry) to a binding will be a separate entry. + # @!attribute [rw] action + # @return [::Google::Iam::V1::BindingDelta::Action] + # The action that was performed on a Binding. + # Required + # @!attribute [rw] role + # @return [::String] + # Role that is assigned to `members`. + # For example, `roles/viewer`, `roles/editor`, or `roles/owner`. + # Required + # @!attribute [rw] member + # @return [::String] + # A single identity requesting access for a Google Cloud resource. + # Follows the same format of Binding.members. + # Required + # @!attribute [rw] condition + # @return [::Google::Type::Expr] + # The condition that is associated with this binding. + class BindingDelta + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # The type of action performed on a Binding in a policy. + module Action + # Unspecified. + ACTION_UNSPECIFIED = 0 + + # Addition of a Binding. + ADD = 1 + + # Removal of a Binding. + REMOVE = 2 + end + end + + # One delta entry for AuditConfig. Each individual change (only one + # exempted_member in each entry) to a AuditConfig will be a separate entry. + # @!attribute [rw] action + # @return [::Google::Iam::V1::AuditConfigDelta::Action] + # The action that was performed on an audit configuration in a policy. + # Required + # @!attribute [rw] service + # @return [::String] + # Specifies a service that was configured for Cloud Audit Logging. + # For example, `storage.googleapis.com`, `cloudsql.googleapis.com`. + # `allServices` is a special value that covers all services. + # Required + # @!attribute [rw] exempted_member + # @return [::String] + # A single identity that is exempted from "data access" audit + # logging for the `service` specified above. + # Follows the same format of Binding.members. + # @!attribute [rw] log_type + # @return [::String] + # Specifies the log_type that was be enabled. ADMIN_ACTIVITY is always + # enabled, and cannot be configured. + # Required + class AuditConfigDelta + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # The type of action performed on an audit configuration in a policy. + module Action + # Unspecified. + ACTION_UNSPECIFIED = 0 + + # Addition of an audit configuration. + ADD = 1 + + # Removal of an audit configuration. + REMOVE = 2 + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-secret_manager-v1/proto_docs/google/protobuf/duration.rb b/owl-bot-staging/google-cloud-secret_manager-v1/proto_docs/google/protobuf/duration.rb new file mode 100644 index 000000000000..ea59f1f91daf --- /dev/null +++ b/owl-bot-staging/google-cloud-secret_manager-v1/proto_docs/google/protobuf/duration.rb @@ -0,0 +1,98 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + + +module Google + module Protobuf + # A Duration represents a signed, fixed-length span of time represented + # as a count of seconds and fractions of seconds at nanosecond + # resolution. It is independent of any calendar and concepts like "day" + # or "month". It is related to Timestamp in that the difference between + # two Timestamp values is a Duration and it can be added or subtracted + # from a Timestamp. Range is approximately +-10,000 years. + # + # # Examples + # + # Example 1: Compute Duration from two Timestamps in pseudo code. + # + # Timestamp start = ...; + # Timestamp end = ...; + # Duration duration = ...; + # + # duration.seconds = end.seconds - start.seconds; + # duration.nanos = end.nanos - start.nanos; + # + # if (duration.seconds < 0 && duration.nanos > 0) { + # duration.seconds += 1; + # duration.nanos -= 1000000000; + # } else if (duration.seconds > 0 && duration.nanos < 0) { + # duration.seconds -= 1; + # duration.nanos += 1000000000; + # } + # + # Example 2: Compute Timestamp from Timestamp + Duration in pseudo code. + # + # Timestamp start = ...; + # Duration duration = ...; + # Timestamp end = ...; + # + # end.seconds = start.seconds + duration.seconds; + # end.nanos = start.nanos + duration.nanos; + # + # if (end.nanos < 0) { + # end.seconds -= 1; + # end.nanos += 1000000000; + # } else if (end.nanos >= 1000000000) { + # end.seconds += 1; + # end.nanos -= 1000000000; + # } + # + # Example 3: Compute Duration from datetime.timedelta in Python. + # + # td = datetime.timedelta(days=3, minutes=10) + # duration = Duration() + # duration.FromTimedelta(td) + # + # # JSON Mapping + # + # In JSON format, the Duration type is encoded as a string rather than an + # object, where the string ends in the suffix "s" (indicating seconds) and + # is preceded by the number of seconds, with nanoseconds expressed as + # fractional seconds. For example, 3 seconds with 0 nanoseconds should be + # encoded in JSON format as "3s", while 3 seconds and 1 nanosecond should + # be expressed in JSON format as "3.000000001s", and 3 seconds and 1 + # microsecond should be expressed in JSON format as "3.000001s". + # @!attribute [rw] seconds + # @return [::Integer] + # Signed seconds of the span of time. Must be from -315,576,000,000 + # to +315,576,000,000 inclusive. Note: these bounds are computed from: + # 60 sec/min * 60 min/hr * 24 hr/day * 365.25 days/year * 10000 years + # @!attribute [rw] nanos + # @return [::Integer] + # Signed fractions of a second at nanosecond resolution of the span + # of time. Durations less than one second are represented with a 0 + # `seconds` field and a positive or negative `nanos` field. For durations + # of one second or more, a non-zero value for the `nanos` field must be + # of the same sign as the `seconds` field. Must be from -999,999,999 + # to +999,999,999 inclusive. + class Duration + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end +end diff --git a/owl-bot-staging/google-cloud-secret_manager-v1/proto_docs/google/protobuf/empty.rb b/owl-bot-staging/google-cloud-secret_manager-v1/proto_docs/google/protobuf/empty.rb new file mode 100644 index 000000000000..83e4481834a6 --- /dev/null +++ b/owl-bot-staging/google-cloud-secret_manager-v1/proto_docs/google/protobuf/empty.rb @@ -0,0 +1,34 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + + +module Google + module Protobuf + # A generic empty message that you can re-use to avoid defining duplicated + # empty messages in your APIs. A typical example is to use it as the request + # or the response type of an API method. For instance: + # + # service Foo { + # rpc Bar(google.protobuf.Empty) returns (google.protobuf.Empty); + # } + class Empty + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end +end diff --git a/owl-bot-staging/google-cloud-secret_manager-v1/proto_docs/google/protobuf/field_mask.rb b/owl-bot-staging/google-cloud-secret_manager-v1/proto_docs/google/protobuf/field_mask.rb new file mode 100644 index 000000000000..7f3ffc78601a --- /dev/null +++ b/owl-bot-staging/google-cloud-secret_manager-v1/proto_docs/google/protobuf/field_mask.rb @@ -0,0 +1,229 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + + +module Google + module Protobuf + # `FieldMask` represents a set of symbolic field paths, for example: + # + # paths: "f.a" + # paths: "f.b.d" + # + # Here `f` represents a field in some root message, `a` and `b` + # fields in the message found in `f`, and `d` a field found in the + # message in `f.b`. + # + # Field masks are used to specify a subset of fields that should be + # returned by a get operation or modified by an update operation. + # Field masks also have a custom JSON encoding (see below). + # + # # Field Masks in Projections + # + # When used in the context of a projection, a response message or + # sub-message is filtered by the API to only contain those fields as + # specified in the mask. For example, if the mask in the previous + # example is applied to a response message as follows: + # + # f { + # a : 22 + # b { + # d : 1 + # x : 2 + # } + # y : 13 + # } + # z: 8 + # + # The result will not contain specific values for fields x,y and z + # (their value will be set to the default, and omitted in proto text + # output): + # + # + # f { + # a : 22 + # b { + # d : 1 + # } + # } + # + # A repeated field is not allowed except at the last position of a + # paths string. + # + # If a FieldMask object is not present in a get operation, the + # operation applies to all fields (as if a FieldMask of all fields + # had been specified). + # + # Note that a field mask does not necessarily apply to the + # top-level response message. In case of a REST get operation, the + # field mask applies directly to the response, but in case of a REST + # list operation, the mask instead applies to each individual message + # in the returned resource list. In case of a REST custom method, + # other definitions may be used. Where the mask applies will be + # clearly documented together with its declaration in the API. In + # any case, the effect on the returned resource/resources is required + # behavior for APIs. + # + # # Field Masks in Update Operations + # + # A field mask in update operations specifies which fields of the + # targeted resource are going to be updated. The API is required + # to only change the values of the fields as specified in the mask + # and leave the others untouched. If a resource is passed in to + # describe the updated values, the API ignores the values of all + # fields not covered by the mask. + # + # If a repeated field is specified for an update operation, new values will + # be appended to the existing repeated field in the target resource. Note that + # a repeated field is only allowed in the last position of a `paths` string. + # + # If a sub-message is specified in the last position of the field mask for an + # update operation, then new value will be merged into the existing sub-message + # in the target resource. + # + # For example, given the target message: + # + # f { + # b { + # d: 1 + # x: 2 + # } + # c: [1] + # } + # + # And an update message: + # + # f { + # b { + # d: 10 + # } + # c: [2] + # } + # + # then if the field mask is: + # + # paths: ["f.b", "f.c"] + # + # then the result will be: + # + # f { + # b { + # d: 10 + # x: 2 + # } + # c: [1, 2] + # } + # + # An implementation may provide options to override this default behavior for + # repeated and message fields. + # + # In order to reset a field's value to the default, the field must + # be in the mask and set to the default value in the provided resource. + # Hence, in order to reset all fields of a resource, provide a default + # instance of the resource and set all fields in the mask, or do + # not provide a mask as described below. + # + # If a field mask is not present on update, the operation applies to + # all fields (as if a field mask of all fields has been specified). + # Note that in the presence of schema evolution, this may mean that + # fields the client does not know and has therefore not filled into + # the request will be reset to their default. If this is unwanted + # behavior, a specific service may require a client to always specify + # a field mask, producing an error if not. + # + # As with get operations, the location of the resource which + # describes the updated values in the request message depends on the + # operation kind. In any case, the effect of the field mask is + # required to be honored by the API. + # + # ## Considerations for HTTP REST + # + # The HTTP kind of an update operation which uses a field mask must + # be set to PATCH instead of PUT in order to satisfy HTTP semantics + # (PUT must only be used for full updates). + # + # # JSON Encoding of Field Masks + # + # In JSON, a field mask is encoded as a single string where paths are + # separated by a comma. Fields name in each path are converted + # to/from lower-camel naming conventions. + # + # As an example, consider the following message declarations: + # + # message Profile { + # User user = 1; + # Photo photo = 2; + # } + # message User { + # string display_name = 1; + # string address = 2; + # } + # + # In proto a field mask for `Profile` may look as such: + # + # mask { + # paths: "user.display_name" + # paths: "photo" + # } + # + # In JSON, the same mask is represented as below: + # + # { + # mask: "user.displayName,photo" + # } + # + # # Field Masks and Oneof Fields + # + # Field masks treat fields in oneofs just as regular fields. Consider the + # following message: + # + # message SampleMessage { + # oneof test_oneof { + # string name = 4; + # SubMessage sub_message = 9; + # } + # } + # + # The field mask can be: + # + # mask { + # paths: "name" + # } + # + # Or: + # + # mask { + # paths: "sub_message" + # } + # + # Note that oneof type names ("test_oneof" in this case) cannot be used in + # paths. + # + # ## Field Mask Verification + # + # The implementation of any API method which has a FieldMask type field in the + # request should verify the included field paths, and return an + # `INVALID_ARGUMENT` error if any path is unmappable. + # @!attribute [rw] paths + # @return [::Array<::String>] + # The set of field mask paths. + class FieldMask + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end +end diff --git a/owl-bot-staging/google-cloud-secret_manager-v1/proto_docs/google/protobuf/timestamp.rb b/owl-bot-staging/google-cloud-secret_manager-v1/proto_docs/google/protobuf/timestamp.rb new file mode 100644 index 000000000000..74352be9c58c --- /dev/null +++ b/owl-bot-staging/google-cloud-secret_manager-v1/proto_docs/google/protobuf/timestamp.rb @@ -0,0 +1,127 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + + +module Google + module Protobuf + # A Timestamp represents a point in time independent of any time zone or local + # calendar, encoded as a count of seconds and fractions of seconds at + # nanosecond resolution. The count is relative to an epoch at UTC midnight on + # January 1, 1970, in the proleptic Gregorian calendar which extends the + # Gregorian calendar backwards to year one. + # + # All minutes are 60 seconds long. Leap seconds are "smeared" so that no leap + # second table is needed for interpretation, using a [24-hour linear + # smear](https://developers.google.com/time/smear). + # + # The range is from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59.999999999Z. By + # restricting to that range, we ensure that we can convert to and from [RFC + # 3339](https://www.ietf.org/rfc/rfc3339.txt) date strings. + # + # # Examples + # + # Example 1: Compute Timestamp from POSIX `time()`. + # + # Timestamp timestamp; + # timestamp.set_seconds(time(NULL)); + # timestamp.set_nanos(0); + # + # Example 2: Compute Timestamp from POSIX `gettimeofday()`. + # + # struct timeval tv; + # gettimeofday(&tv, NULL); + # + # Timestamp timestamp; + # timestamp.set_seconds(tv.tv_sec); + # timestamp.set_nanos(tv.tv_usec * 1000); + # + # Example 3: Compute Timestamp from Win32 `GetSystemTimeAsFileTime()`. + # + # FILETIME ft; + # GetSystemTimeAsFileTime(&ft); + # UINT64 ticks = (((UINT64)ft.dwHighDateTime) << 32) | ft.dwLowDateTime; + # + # // A Windows tick is 100 nanoseconds. Windows epoch 1601-01-01T00:00:00Z + # // is 11644473600 seconds before Unix epoch 1970-01-01T00:00:00Z. + # Timestamp timestamp; + # timestamp.set_seconds((INT64) ((ticks / 10000000) - 11644473600LL)); + # timestamp.set_nanos((INT32) ((ticks % 10000000) * 100)); + # + # Example 4: Compute Timestamp from Java `System.currentTimeMillis()`. + # + # long millis = System.currentTimeMillis(); + # + # Timestamp timestamp = Timestamp.newBuilder().setSeconds(millis / 1000) + # .setNanos((int) ((millis % 1000) * 1000000)).build(); + # + # Example 5: Compute Timestamp from Java `Instant.now()`. + # + # Instant now = Instant.now(); + # + # Timestamp timestamp = + # Timestamp.newBuilder().setSeconds(now.getEpochSecond()) + # .setNanos(now.getNano()).build(); + # + # Example 6: Compute Timestamp from current time in Python. + # + # timestamp = Timestamp() + # timestamp.GetCurrentTime() + # + # # JSON Mapping + # + # In JSON format, the Timestamp type is encoded as a string in the + # [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format. That is, the + # format is "\\{year}-\\{month}-\\{day}T\\{hour}:\\{min}:\\{sec}[.\\{frac_sec}]Z" + # where \\{year} is always expressed using four digits while \\{month}, \\{day}, + # \\{hour}, \\{min}, and \\{sec} are zero-padded to two digits each. The fractional + # seconds, which can go up to 9 digits (i.e. up to 1 nanosecond resolution), + # are optional. The "Z" suffix indicates the timezone ("UTC"); the timezone + # is required. A proto3 JSON serializer should always use UTC (as indicated by + # "Z") when printing the Timestamp type and a proto3 JSON parser should be + # able to accept both UTC and other timezones (as indicated by an offset). + # + # For example, "2017-01-15T01:30:15.01Z" encodes 15.01 seconds past + # 01:30 UTC on January 15, 2017. + # + # In JavaScript, one can convert a Date object to this format using the + # standard + # [toISOString()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toISOString) + # method. In Python, a standard `datetime.datetime` object can be converted + # to this format using + # [`strftime`](https://docs.python.org/2/library/time.html#time.strftime) with + # the time format spec '%Y-%m-%dT%H:%M:%S.%fZ'. Likewise, in Java, one can use + # the Joda Time's [`ISODateTimeFormat.dateTime()`]( + # http://joda-time.sourceforge.net/apidocs/org/joda/time/format/ISODateTimeFormat.html#dateTime() + # ) to obtain a formatter capable of generating timestamps in this format. + # @!attribute [rw] seconds + # @return [::Integer] + # Represents seconds of UTC time since Unix epoch + # 1970-01-01T00:00:00Z. Must be from 0001-01-01T00:00:00Z to + # 9999-12-31T23:59:59Z inclusive. + # @!attribute [rw] nanos + # @return [::Integer] + # Non-negative fractions of a second at nanosecond resolution. Negative + # second values with fractions must still have non-negative nanos values + # that count forward in time. Must be from 0 to 999,999,999 + # inclusive. + class Timestamp + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end +end diff --git a/owl-bot-staging/google-cloud-secret_manager-v1/proto_docs/google/type/expr.rb b/owl-bot-staging/google-cloud-secret_manager-v1/proto_docs/google/type/expr.rb new file mode 100644 index 000000000000..53e7733b6592 --- /dev/null +++ b/owl-bot-staging/google-cloud-secret_manager-v1/proto_docs/google/type/expr.rb @@ -0,0 +1,75 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + + +module Google + module Type + # Represents a textual expression in the Common Expression Language (CEL) + # syntax. CEL is a C-like expression language. The syntax and semantics of CEL + # are documented at https://github.com/google/cel-spec. + # + # Example (Comparison): + # + # title: "Summary size limit" + # description: "Determines if a summary is less than 100 chars" + # expression: "document.summary.size() < 100" + # + # Example (Equality): + # + # title: "Requestor is owner" + # description: "Determines if requestor is the document owner" + # expression: "document.owner == request.auth.claims.email" + # + # Example (Logic): + # + # title: "Public documents" + # description: "Determine whether the document should be publicly visible" + # expression: "document.type != 'private' && document.type != 'internal'" + # + # Example (Data Manipulation): + # + # title: "Notification string" + # description: "Create a notification string with a timestamp." + # expression: "'New message received at ' + string(document.create_time)" + # + # The exact variables and functions that may be referenced within an expression + # are determined by the service that evaluates it. See the service + # documentation for additional information. + # @!attribute [rw] expression + # @return [::String] + # Textual representation of an expression in Common Expression Language + # syntax. + # @!attribute [rw] title + # @return [::String] + # Optional. Title for the expression, i.e. a short string describing + # its purpose. This can be used e.g. in UIs which allow to enter the + # expression. + # @!attribute [rw] description + # @return [::String] + # Optional. Description of the expression. This is a longer text which + # describes the expression, e.g. when hovered over it in a UI. + # @!attribute [rw] location + # @return [::String] + # Optional. String indicating the location of the expression for error + # reporting, e.g. a file name and a position in the file. + class Expr + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end +end diff --git a/owl-bot-staging/google-cloud-secret_manager-v1/snippets/Gemfile b/owl-bot-staging/google-cloud-secret_manager-v1/snippets/Gemfile new file mode 100644 index 000000000000..714e81d5760e --- /dev/null +++ b/owl-bot-staging/google-cloud-secret_manager-v1/snippets/Gemfile @@ -0,0 +1,32 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +source "https://rubygems.org" + +if ENV["GOOGLE_CLOUD_SAMPLES_TEST"] == "master" + gem "google-cloud-secret_manager-v1", path: "../" +else + gem "google-cloud-secret_manager-v1" +end + +group :test do + gem "google-style", "~> 1.26.1" + gem "minitest", "~> 5.16" + gem "minitest-focus", "~> 1.1" + gem "minitest-hooks", "~> 1.5" +end diff --git a/owl-bot-staging/google-cloud-secret_manager-v1/snippets/secret_manager_service/access_secret_version.rb b/owl-bot-staging/google-cloud-secret_manager-v1/snippets/secret_manager_service/access_secret_version.rb new file mode 100644 index 000000000000..dae0739c31ec --- /dev/null +++ b/owl-bot-staging/google-cloud-secret_manager-v1/snippets/secret_manager_service/access_secret_version.rb @@ -0,0 +1,47 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +# [START secretmanager_v1_generated_SecretManagerService_AccessSecretVersion_sync] +require "google/cloud/secret_manager/v1" + +## +# Snippet for the access_secret_version call in the SecretManagerService service +# +# This snippet has been automatically generated and should be regarded as a code +# template only. It will require modifications to work: +# - It may require correct/in-range values for request initialization. +# - It may require specifying regional endpoints when creating the service +# client as shown in https://cloud.google.com/ruby/docs/reference. +# +# This is an auto-generated example demonstrating basic usage of +# Google::Cloud::SecretManager::V1::SecretManagerService::Client#access_secret_version. +# +def access_secret_version + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::SecretManager::V1::SecretManagerService::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::SecretManager::V1::AccessSecretVersionRequest.new + + # Call the access_secret_version method. + result = client.access_secret_version request + + # The returned object is of type Google::Cloud::SecretManager::V1::AccessSecretVersionResponse. + p result +end +# [END secretmanager_v1_generated_SecretManagerService_AccessSecretVersion_sync] diff --git a/owl-bot-staging/google-cloud-secret_manager-v1/snippets/secret_manager_service/add_secret_version.rb b/owl-bot-staging/google-cloud-secret_manager-v1/snippets/secret_manager_service/add_secret_version.rb new file mode 100644 index 000000000000..7167e1195230 --- /dev/null +++ b/owl-bot-staging/google-cloud-secret_manager-v1/snippets/secret_manager_service/add_secret_version.rb @@ -0,0 +1,47 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +# [START secretmanager_v1_generated_SecretManagerService_AddSecretVersion_sync] +require "google/cloud/secret_manager/v1" + +## +# Snippet for the add_secret_version call in the SecretManagerService service +# +# This snippet has been automatically generated and should be regarded as a code +# template only. It will require modifications to work: +# - It may require correct/in-range values for request initialization. +# - It may require specifying regional endpoints when creating the service +# client as shown in https://cloud.google.com/ruby/docs/reference. +# +# This is an auto-generated example demonstrating basic usage of +# Google::Cloud::SecretManager::V1::SecretManagerService::Client#add_secret_version. +# +def add_secret_version + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::SecretManager::V1::SecretManagerService::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::SecretManager::V1::AddSecretVersionRequest.new + + # Call the add_secret_version method. + result = client.add_secret_version request + + # The returned object is of type Google::Cloud::SecretManager::V1::SecretVersion. + p result +end +# [END secretmanager_v1_generated_SecretManagerService_AddSecretVersion_sync] diff --git a/owl-bot-staging/google-cloud-secret_manager-v1/snippets/secret_manager_service/create_secret.rb b/owl-bot-staging/google-cloud-secret_manager-v1/snippets/secret_manager_service/create_secret.rb new file mode 100644 index 000000000000..18e84e0e0cf6 --- /dev/null +++ b/owl-bot-staging/google-cloud-secret_manager-v1/snippets/secret_manager_service/create_secret.rb @@ -0,0 +1,47 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +# [START secretmanager_v1_generated_SecretManagerService_CreateSecret_sync] +require "google/cloud/secret_manager/v1" + +## +# Snippet for the create_secret call in the SecretManagerService service +# +# This snippet has been automatically generated and should be regarded as a code +# template only. It will require modifications to work: +# - It may require correct/in-range values for request initialization. +# - It may require specifying regional endpoints when creating the service +# client as shown in https://cloud.google.com/ruby/docs/reference. +# +# This is an auto-generated example demonstrating basic usage of +# Google::Cloud::SecretManager::V1::SecretManagerService::Client#create_secret. +# +def create_secret + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::SecretManager::V1::SecretManagerService::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::SecretManager::V1::CreateSecretRequest.new + + # Call the create_secret method. + result = client.create_secret request + + # The returned object is of type Google::Cloud::SecretManager::V1::Secret. + p result +end +# [END secretmanager_v1_generated_SecretManagerService_CreateSecret_sync] diff --git a/owl-bot-staging/google-cloud-secret_manager-v1/snippets/secret_manager_service/delete_secret.rb b/owl-bot-staging/google-cloud-secret_manager-v1/snippets/secret_manager_service/delete_secret.rb new file mode 100644 index 000000000000..d2cda7727281 --- /dev/null +++ b/owl-bot-staging/google-cloud-secret_manager-v1/snippets/secret_manager_service/delete_secret.rb @@ -0,0 +1,47 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +# [START secretmanager_v1_generated_SecretManagerService_DeleteSecret_sync] +require "google/cloud/secret_manager/v1" + +## +# Snippet for the delete_secret call in the SecretManagerService service +# +# This snippet has been automatically generated and should be regarded as a code +# template only. It will require modifications to work: +# - It may require correct/in-range values for request initialization. +# - It may require specifying regional endpoints when creating the service +# client as shown in https://cloud.google.com/ruby/docs/reference. +# +# This is an auto-generated example demonstrating basic usage of +# Google::Cloud::SecretManager::V1::SecretManagerService::Client#delete_secret. +# +def delete_secret + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::SecretManager::V1::SecretManagerService::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::SecretManager::V1::DeleteSecretRequest.new + + # Call the delete_secret method. + result = client.delete_secret request + + # The returned object is of type Google::Protobuf::Empty. + p result +end +# [END secretmanager_v1_generated_SecretManagerService_DeleteSecret_sync] diff --git a/owl-bot-staging/google-cloud-secret_manager-v1/snippets/secret_manager_service/destroy_secret_version.rb b/owl-bot-staging/google-cloud-secret_manager-v1/snippets/secret_manager_service/destroy_secret_version.rb new file mode 100644 index 000000000000..f2a4956d1bfa --- /dev/null +++ b/owl-bot-staging/google-cloud-secret_manager-v1/snippets/secret_manager_service/destroy_secret_version.rb @@ -0,0 +1,47 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +# [START secretmanager_v1_generated_SecretManagerService_DestroySecretVersion_sync] +require "google/cloud/secret_manager/v1" + +## +# Snippet for the destroy_secret_version call in the SecretManagerService service +# +# This snippet has been automatically generated and should be regarded as a code +# template only. It will require modifications to work: +# - It may require correct/in-range values for request initialization. +# - It may require specifying regional endpoints when creating the service +# client as shown in https://cloud.google.com/ruby/docs/reference. +# +# This is an auto-generated example demonstrating basic usage of +# Google::Cloud::SecretManager::V1::SecretManagerService::Client#destroy_secret_version. +# +def destroy_secret_version + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::SecretManager::V1::SecretManagerService::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::SecretManager::V1::DestroySecretVersionRequest.new + + # Call the destroy_secret_version method. + result = client.destroy_secret_version request + + # The returned object is of type Google::Cloud::SecretManager::V1::SecretVersion. + p result +end +# [END secretmanager_v1_generated_SecretManagerService_DestroySecretVersion_sync] diff --git a/owl-bot-staging/google-cloud-secret_manager-v1/snippets/secret_manager_service/disable_secret_version.rb b/owl-bot-staging/google-cloud-secret_manager-v1/snippets/secret_manager_service/disable_secret_version.rb new file mode 100644 index 000000000000..2acddd330453 --- /dev/null +++ b/owl-bot-staging/google-cloud-secret_manager-v1/snippets/secret_manager_service/disable_secret_version.rb @@ -0,0 +1,47 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +# [START secretmanager_v1_generated_SecretManagerService_DisableSecretVersion_sync] +require "google/cloud/secret_manager/v1" + +## +# Snippet for the disable_secret_version call in the SecretManagerService service +# +# This snippet has been automatically generated and should be regarded as a code +# template only. It will require modifications to work: +# - It may require correct/in-range values for request initialization. +# - It may require specifying regional endpoints when creating the service +# client as shown in https://cloud.google.com/ruby/docs/reference. +# +# This is an auto-generated example demonstrating basic usage of +# Google::Cloud::SecretManager::V1::SecretManagerService::Client#disable_secret_version. +# +def disable_secret_version + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::SecretManager::V1::SecretManagerService::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::SecretManager::V1::DisableSecretVersionRequest.new + + # Call the disable_secret_version method. + result = client.disable_secret_version request + + # The returned object is of type Google::Cloud::SecretManager::V1::SecretVersion. + p result +end +# [END secretmanager_v1_generated_SecretManagerService_DisableSecretVersion_sync] diff --git a/owl-bot-staging/google-cloud-secret_manager-v1/snippets/secret_manager_service/enable_secret_version.rb b/owl-bot-staging/google-cloud-secret_manager-v1/snippets/secret_manager_service/enable_secret_version.rb new file mode 100644 index 000000000000..124945e6f241 --- /dev/null +++ b/owl-bot-staging/google-cloud-secret_manager-v1/snippets/secret_manager_service/enable_secret_version.rb @@ -0,0 +1,47 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +# [START secretmanager_v1_generated_SecretManagerService_EnableSecretVersion_sync] +require "google/cloud/secret_manager/v1" + +## +# Snippet for the enable_secret_version call in the SecretManagerService service +# +# This snippet has been automatically generated and should be regarded as a code +# template only. It will require modifications to work: +# - It may require correct/in-range values for request initialization. +# - It may require specifying regional endpoints when creating the service +# client as shown in https://cloud.google.com/ruby/docs/reference. +# +# This is an auto-generated example demonstrating basic usage of +# Google::Cloud::SecretManager::V1::SecretManagerService::Client#enable_secret_version. +# +def enable_secret_version + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::SecretManager::V1::SecretManagerService::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::SecretManager::V1::EnableSecretVersionRequest.new + + # Call the enable_secret_version method. + result = client.enable_secret_version request + + # The returned object is of type Google::Cloud::SecretManager::V1::SecretVersion. + p result +end +# [END secretmanager_v1_generated_SecretManagerService_EnableSecretVersion_sync] diff --git a/owl-bot-staging/google-cloud-secret_manager-v1/snippets/secret_manager_service/get_iam_policy.rb b/owl-bot-staging/google-cloud-secret_manager-v1/snippets/secret_manager_service/get_iam_policy.rb new file mode 100644 index 000000000000..939129c0ed81 --- /dev/null +++ b/owl-bot-staging/google-cloud-secret_manager-v1/snippets/secret_manager_service/get_iam_policy.rb @@ -0,0 +1,47 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +# [START secretmanager_v1_generated_SecretManagerService_GetIamPolicy_sync] +require "google/cloud/secret_manager/v1" + +## +# Snippet for the get_iam_policy call in the SecretManagerService service +# +# This snippet has been automatically generated and should be regarded as a code +# template only. It will require modifications to work: +# - It may require correct/in-range values for request initialization. +# - It may require specifying regional endpoints when creating the service +# client as shown in https://cloud.google.com/ruby/docs/reference. +# +# This is an auto-generated example demonstrating basic usage of +# Google::Cloud::SecretManager::V1::SecretManagerService::Client#get_iam_policy. +# +def get_iam_policy + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::SecretManager::V1::SecretManagerService::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Iam::V1::GetIamPolicyRequest.new + + # Call the get_iam_policy method. + result = client.get_iam_policy request + + # The returned object is of type Google::Iam::V1::Policy. + p result +end +# [END secretmanager_v1_generated_SecretManagerService_GetIamPolicy_sync] diff --git a/owl-bot-staging/google-cloud-secret_manager-v1/snippets/secret_manager_service/get_secret.rb b/owl-bot-staging/google-cloud-secret_manager-v1/snippets/secret_manager_service/get_secret.rb new file mode 100644 index 000000000000..d63674176991 --- /dev/null +++ b/owl-bot-staging/google-cloud-secret_manager-v1/snippets/secret_manager_service/get_secret.rb @@ -0,0 +1,47 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +# [START secretmanager_v1_generated_SecretManagerService_GetSecret_sync] +require "google/cloud/secret_manager/v1" + +## +# Snippet for the get_secret call in the SecretManagerService service +# +# This snippet has been automatically generated and should be regarded as a code +# template only. It will require modifications to work: +# - It may require correct/in-range values for request initialization. +# - It may require specifying regional endpoints when creating the service +# client as shown in https://cloud.google.com/ruby/docs/reference. +# +# This is an auto-generated example demonstrating basic usage of +# Google::Cloud::SecretManager::V1::SecretManagerService::Client#get_secret. +# +def get_secret + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::SecretManager::V1::SecretManagerService::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::SecretManager::V1::GetSecretRequest.new + + # Call the get_secret method. + result = client.get_secret request + + # The returned object is of type Google::Cloud::SecretManager::V1::Secret. + p result +end +# [END secretmanager_v1_generated_SecretManagerService_GetSecret_sync] diff --git a/owl-bot-staging/google-cloud-secret_manager-v1/snippets/secret_manager_service/get_secret_version.rb b/owl-bot-staging/google-cloud-secret_manager-v1/snippets/secret_manager_service/get_secret_version.rb new file mode 100644 index 000000000000..d784f543ecf2 --- /dev/null +++ b/owl-bot-staging/google-cloud-secret_manager-v1/snippets/secret_manager_service/get_secret_version.rb @@ -0,0 +1,47 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +# [START secretmanager_v1_generated_SecretManagerService_GetSecretVersion_sync] +require "google/cloud/secret_manager/v1" + +## +# Snippet for the get_secret_version call in the SecretManagerService service +# +# This snippet has been automatically generated and should be regarded as a code +# template only. It will require modifications to work: +# - It may require correct/in-range values for request initialization. +# - It may require specifying regional endpoints when creating the service +# client as shown in https://cloud.google.com/ruby/docs/reference. +# +# This is an auto-generated example demonstrating basic usage of +# Google::Cloud::SecretManager::V1::SecretManagerService::Client#get_secret_version. +# +def get_secret_version + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::SecretManager::V1::SecretManagerService::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::SecretManager::V1::GetSecretVersionRequest.new + + # Call the get_secret_version method. + result = client.get_secret_version request + + # The returned object is of type Google::Cloud::SecretManager::V1::SecretVersion. + p result +end +# [END secretmanager_v1_generated_SecretManagerService_GetSecretVersion_sync] diff --git a/owl-bot-staging/google-cloud-secret_manager-v1/snippets/secret_manager_service/list_secret_versions.rb b/owl-bot-staging/google-cloud-secret_manager-v1/snippets/secret_manager_service/list_secret_versions.rb new file mode 100644 index 000000000000..1e197877f1eb --- /dev/null +++ b/owl-bot-staging/google-cloud-secret_manager-v1/snippets/secret_manager_service/list_secret_versions.rb @@ -0,0 +1,51 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +# [START secretmanager_v1_generated_SecretManagerService_ListSecretVersions_sync] +require "google/cloud/secret_manager/v1" + +## +# Snippet for the list_secret_versions call in the SecretManagerService service +# +# This snippet has been automatically generated and should be regarded as a code +# template only. It will require modifications to work: +# - It may require correct/in-range values for request initialization. +# - It may require specifying regional endpoints when creating the service +# client as shown in https://cloud.google.com/ruby/docs/reference. +# +# This is an auto-generated example demonstrating basic usage of +# Google::Cloud::SecretManager::V1::SecretManagerService::Client#list_secret_versions. +# +def list_secret_versions + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::SecretManager::V1::SecretManagerService::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::SecretManager::V1::ListSecretVersionsRequest.new + + # Call the list_secret_versions method. + result = client.list_secret_versions request + + # The returned object is of type Gapic::PagedEnumerable. You can iterate + # over elements, and API calls will be issued to fetch pages as needed. + result.each do |item| + # Each element is of type ::Google::Cloud::SecretManager::V1::SecretVersion. + p item + end +end +# [END secretmanager_v1_generated_SecretManagerService_ListSecretVersions_sync] diff --git a/owl-bot-staging/google-cloud-secret_manager-v1/snippets/secret_manager_service/list_secrets.rb b/owl-bot-staging/google-cloud-secret_manager-v1/snippets/secret_manager_service/list_secrets.rb new file mode 100644 index 000000000000..42e277c580e9 --- /dev/null +++ b/owl-bot-staging/google-cloud-secret_manager-v1/snippets/secret_manager_service/list_secrets.rb @@ -0,0 +1,51 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +# [START secretmanager_v1_generated_SecretManagerService_ListSecrets_sync] +require "google/cloud/secret_manager/v1" + +## +# Snippet for the list_secrets call in the SecretManagerService service +# +# This snippet has been automatically generated and should be regarded as a code +# template only. It will require modifications to work: +# - It may require correct/in-range values for request initialization. +# - It may require specifying regional endpoints when creating the service +# client as shown in https://cloud.google.com/ruby/docs/reference. +# +# This is an auto-generated example demonstrating basic usage of +# Google::Cloud::SecretManager::V1::SecretManagerService::Client#list_secrets. +# +def list_secrets + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::SecretManager::V1::SecretManagerService::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::SecretManager::V1::ListSecretsRequest.new + + # Call the list_secrets method. + result = client.list_secrets request + + # The returned object is of type Gapic::PagedEnumerable. You can iterate + # over elements, and API calls will be issued to fetch pages as needed. + result.each do |item| + # Each element is of type ::Google::Cloud::SecretManager::V1::Secret. + p item + end +end +# [END secretmanager_v1_generated_SecretManagerService_ListSecrets_sync] diff --git a/owl-bot-staging/google-cloud-secret_manager-v1/snippets/secret_manager_service/set_iam_policy.rb b/owl-bot-staging/google-cloud-secret_manager-v1/snippets/secret_manager_service/set_iam_policy.rb new file mode 100644 index 000000000000..54b76b5acc8c --- /dev/null +++ b/owl-bot-staging/google-cloud-secret_manager-v1/snippets/secret_manager_service/set_iam_policy.rb @@ -0,0 +1,47 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +# [START secretmanager_v1_generated_SecretManagerService_SetIamPolicy_sync] +require "google/cloud/secret_manager/v1" + +## +# Snippet for the set_iam_policy call in the SecretManagerService service +# +# This snippet has been automatically generated and should be regarded as a code +# template only. It will require modifications to work: +# - It may require correct/in-range values for request initialization. +# - It may require specifying regional endpoints when creating the service +# client as shown in https://cloud.google.com/ruby/docs/reference. +# +# This is an auto-generated example demonstrating basic usage of +# Google::Cloud::SecretManager::V1::SecretManagerService::Client#set_iam_policy. +# +def set_iam_policy + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::SecretManager::V1::SecretManagerService::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Iam::V1::SetIamPolicyRequest.new + + # Call the set_iam_policy method. + result = client.set_iam_policy request + + # The returned object is of type Google::Iam::V1::Policy. + p result +end +# [END secretmanager_v1_generated_SecretManagerService_SetIamPolicy_sync] diff --git a/owl-bot-staging/google-cloud-secret_manager-v1/snippets/secret_manager_service/test_iam_permissions.rb b/owl-bot-staging/google-cloud-secret_manager-v1/snippets/secret_manager_service/test_iam_permissions.rb new file mode 100644 index 000000000000..5b817c93d9c0 --- /dev/null +++ b/owl-bot-staging/google-cloud-secret_manager-v1/snippets/secret_manager_service/test_iam_permissions.rb @@ -0,0 +1,47 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +# [START secretmanager_v1_generated_SecretManagerService_TestIamPermissions_sync] +require "google/cloud/secret_manager/v1" + +## +# Snippet for the test_iam_permissions call in the SecretManagerService service +# +# This snippet has been automatically generated and should be regarded as a code +# template only. It will require modifications to work: +# - It may require correct/in-range values for request initialization. +# - It may require specifying regional endpoints when creating the service +# client as shown in https://cloud.google.com/ruby/docs/reference. +# +# This is an auto-generated example demonstrating basic usage of +# Google::Cloud::SecretManager::V1::SecretManagerService::Client#test_iam_permissions. +# +def test_iam_permissions + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::SecretManager::V1::SecretManagerService::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Iam::V1::TestIamPermissionsRequest.new + + # Call the test_iam_permissions method. + result = client.test_iam_permissions request + + # The returned object is of type Google::Iam::V1::TestIamPermissionsResponse. + p result +end +# [END secretmanager_v1_generated_SecretManagerService_TestIamPermissions_sync] diff --git a/owl-bot-staging/google-cloud-secret_manager-v1/snippets/secret_manager_service/update_secret.rb b/owl-bot-staging/google-cloud-secret_manager-v1/snippets/secret_manager_service/update_secret.rb new file mode 100644 index 000000000000..c9d6041cca95 --- /dev/null +++ b/owl-bot-staging/google-cloud-secret_manager-v1/snippets/secret_manager_service/update_secret.rb @@ -0,0 +1,47 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +# [START secretmanager_v1_generated_SecretManagerService_UpdateSecret_sync] +require "google/cloud/secret_manager/v1" + +## +# Snippet for the update_secret call in the SecretManagerService service +# +# This snippet has been automatically generated and should be regarded as a code +# template only. It will require modifications to work: +# - It may require correct/in-range values for request initialization. +# - It may require specifying regional endpoints when creating the service +# client as shown in https://cloud.google.com/ruby/docs/reference. +# +# This is an auto-generated example demonstrating basic usage of +# Google::Cloud::SecretManager::V1::SecretManagerService::Client#update_secret. +# +def update_secret + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::SecretManager::V1::SecretManagerService::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::SecretManager::V1::UpdateSecretRequest.new + + # Call the update_secret method. + result = client.update_secret request + + # The returned object is of type Google::Cloud::SecretManager::V1::Secret. + p result +end +# [END secretmanager_v1_generated_SecretManagerService_UpdateSecret_sync] diff --git a/owl-bot-staging/google-cloud-secret_manager-v1/snippets/snippet_metadata_google.cloud.secretmanager.v1.json b/owl-bot-staging/google-cloud-secret_manager-v1/snippets/snippet_metadata_google.cloud.secretmanager.v1.json new file mode 100644 index 000000000000..d8acd8e2d4af --- /dev/null +++ b/owl-bot-staging/google-cloud-secret_manager-v1/snippets/snippet_metadata_google.cloud.secretmanager.v1.json @@ -0,0 +1,615 @@ +{ + "client_library": { + "name": "google-cloud-secret_manager-v1", + "version": "", + "language": "RUBY", + "apis": [ + { + "id": "google.cloud.secretmanager.v1", + "version": "v1" + } + ] + }, + "snippets": [ + { + "region_tag": "secretmanager_v1_generated_SecretManagerService_ListSecrets_sync", + "title": "Snippet for the list_secrets call in the SecretManagerService service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::SecretManager::V1::SecretManagerService::Client#list_secrets.", + "file": "secret_manager_service/list_secrets.rb", + "language": "RUBY", + "client_method": { + "short_name": "list_secrets", + "full_name": "::Google::Cloud::SecretManager::V1::SecretManagerService::Client#list_secrets", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::SecretManager::V1::ListSecretsRequest", + "name": "request" + } + ], + "result_type": "::Google::Cloud::SecretManager::V1::ListSecretsResponse", + "client": { + "short_name": "SecretManagerService::Client", + "full_name": "::Google::Cloud::SecretManager::V1::SecretManagerService::Client" + }, + "method": { + "short_name": "ListSecrets", + "full_name": "google.cloud.secretmanager.v1.SecretManagerService.ListSecrets", + "service": { + "short_name": "SecretManagerService", + "full_name": "google.cloud.secretmanager.v1.SecretManagerService" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 50, + "type": "FULL" + } + ] + }, + { + "region_tag": "secretmanager_v1_generated_SecretManagerService_CreateSecret_sync", + "title": "Snippet for the create_secret call in the SecretManagerService service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::SecretManager::V1::SecretManagerService::Client#create_secret.", + "file": "secret_manager_service/create_secret.rb", + "language": "RUBY", + "client_method": { + "short_name": "create_secret", + "full_name": "::Google::Cloud::SecretManager::V1::SecretManagerService::Client#create_secret", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::SecretManager::V1::CreateSecretRequest", + "name": "request" + } + ], + "result_type": "::Google::Cloud::SecretManager::V1::Secret", + "client": { + "short_name": "SecretManagerService::Client", + "full_name": "::Google::Cloud::SecretManager::V1::SecretManagerService::Client" + }, + "method": { + "short_name": "CreateSecret", + "full_name": "google.cloud.secretmanager.v1.SecretManagerService.CreateSecret", + "service": { + "short_name": "SecretManagerService", + "full_name": "google.cloud.secretmanager.v1.SecretManagerService" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 46, + "type": "FULL" + } + ] + }, + { + "region_tag": "secretmanager_v1_generated_SecretManagerService_AddSecretVersion_sync", + "title": "Snippet for the add_secret_version call in the SecretManagerService service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::SecretManager::V1::SecretManagerService::Client#add_secret_version.", + "file": "secret_manager_service/add_secret_version.rb", + "language": "RUBY", + "client_method": { + "short_name": "add_secret_version", + "full_name": "::Google::Cloud::SecretManager::V1::SecretManagerService::Client#add_secret_version", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::SecretManager::V1::AddSecretVersionRequest", + "name": "request" + } + ], + "result_type": "::Google::Cloud::SecretManager::V1::SecretVersion", + "client": { + "short_name": "SecretManagerService::Client", + "full_name": "::Google::Cloud::SecretManager::V1::SecretManagerService::Client" + }, + "method": { + "short_name": "AddSecretVersion", + "full_name": "google.cloud.secretmanager.v1.SecretManagerService.AddSecretVersion", + "service": { + "short_name": "SecretManagerService", + "full_name": "google.cloud.secretmanager.v1.SecretManagerService" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 46, + "type": "FULL" + } + ] + }, + { + "region_tag": "secretmanager_v1_generated_SecretManagerService_GetSecret_sync", + "title": "Snippet for the get_secret call in the SecretManagerService service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::SecretManager::V1::SecretManagerService::Client#get_secret.", + "file": "secret_manager_service/get_secret.rb", + "language": "RUBY", + "client_method": { + "short_name": "get_secret", + "full_name": "::Google::Cloud::SecretManager::V1::SecretManagerService::Client#get_secret", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::SecretManager::V1::GetSecretRequest", + "name": "request" + } + ], + "result_type": "::Google::Cloud::SecretManager::V1::Secret", + "client": { + "short_name": "SecretManagerService::Client", + "full_name": "::Google::Cloud::SecretManager::V1::SecretManagerService::Client" + }, + "method": { + "short_name": "GetSecret", + "full_name": "google.cloud.secretmanager.v1.SecretManagerService.GetSecret", + "service": { + "short_name": "SecretManagerService", + "full_name": "google.cloud.secretmanager.v1.SecretManagerService" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 46, + "type": "FULL" + } + ] + }, + { + "region_tag": "secretmanager_v1_generated_SecretManagerService_UpdateSecret_sync", + "title": "Snippet for the update_secret call in the SecretManagerService service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::SecretManager::V1::SecretManagerService::Client#update_secret.", + "file": "secret_manager_service/update_secret.rb", + "language": "RUBY", + "client_method": { + "short_name": "update_secret", + "full_name": "::Google::Cloud::SecretManager::V1::SecretManagerService::Client#update_secret", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::SecretManager::V1::UpdateSecretRequest", + "name": "request" + } + ], + "result_type": "::Google::Cloud::SecretManager::V1::Secret", + "client": { + "short_name": "SecretManagerService::Client", + "full_name": "::Google::Cloud::SecretManager::V1::SecretManagerService::Client" + }, + "method": { + "short_name": "UpdateSecret", + "full_name": "google.cloud.secretmanager.v1.SecretManagerService.UpdateSecret", + "service": { + "short_name": "SecretManagerService", + "full_name": "google.cloud.secretmanager.v1.SecretManagerService" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 46, + "type": "FULL" + } + ] + }, + { + "region_tag": "secretmanager_v1_generated_SecretManagerService_DeleteSecret_sync", + "title": "Snippet for the delete_secret call in the SecretManagerService service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::SecretManager::V1::SecretManagerService::Client#delete_secret.", + "file": "secret_manager_service/delete_secret.rb", + "language": "RUBY", + "client_method": { + "short_name": "delete_secret", + "full_name": "::Google::Cloud::SecretManager::V1::SecretManagerService::Client#delete_secret", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::SecretManager::V1::DeleteSecretRequest", + "name": "request" + } + ], + "result_type": "::Google::Protobuf::Empty", + "client": { + "short_name": "SecretManagerService::Client", + "full_name": "::Google::Cloud::SecretManager::V1::SecretManagerService::Client" + }, + "method": { + "short_name": "DeleteSecret", + "full_name": "google.cloud.secretmanager.v1.SecretManagerService.DeleteSecret", + "service": { + "short_name": "SecretManagerService", + "full_name": "google.cloud.secretmanager.v1.SecretManagerService" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 46, + "type": "FULL" + } + ] + }, + { + "region_tag": "secretmanager_v1_generated_SecretManagerService_ListSecretVersions_sync", + "title": "Snippet for the list_secret_versions call in the SecretManagerService service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::SecretManager::V1::SecretManagerService::Client#list_secret_versions.", + "file": "secret_manager_service/list_secret_versions.rb", + "language": "RUBY", + "client_method": { + "short_name": "list_secret_versions", + "full_name": "::Google::Cloud::SecretManager::V1::SecretManagerService::Client#list_secret_versions", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::SecretManager::V1::ListSecretVersionsRequest", + "name": "request" + } + ], + "result_type": "::Google::Cloud::SecretManager::V1::ListSecretVersionsResponse", + "client": { + "short_name": "SecretManagerService::Client", + "full_name": "::Google::Cloud::SecretManager::V1::SecretManagerService::Client" + }, + "method": { + "short_name": "ListSecretVersions", + "full_name": "google.cloud.secretmanager.v1.SecretManagerService.ListSecretVersions", + "service": { + "short_name": "SecretManagerService", + "full_name": "google.cloud.secretmanager.v1.SecretManagerService" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 50, + "type": "FULL" + } + ] + }, + { + "region_tag": "secretmanager_v1_generated_SecretManagerService_GetSecretVersion_sync", + "title": "Snippet for the get_secret_version call in the SecretManagerService service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::SecretManager::V1::SecretManagerService::Client#get_secret_version.", + "file": "secret_manager_service/get_secret_version.rb", + "language": "RUBY", + "client_method": { + "short_name": "get_secret_version", + "full_name": "::Google::Cloud::SecretManager::V1::SecretManagerService::Client#get_secret_version", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::SecretManager::V1::GetSecretVersionRequest", + "name": "request" + } + ], + "result_type": "::Google::Cloud::SecretManager::V1::SecretVersion", + "client": { + "short_name": "SecretManagerService::Client", + "full_name": "::Google::Cloud::SecretManager::V1::SecretManagerService::Client" + }, + "method": { + "short_name": "GetSecretVersion", + "full_name": "google.cloud.secretmanager.v1.SecretManagerService.GetSecretVersion", + "service": { + "short_name": "SecretManagerService", + "full_name": "google.cloud.secretmanager.v1.SecretManagerService" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 46, + "type": "FULL" + } + ] + }, + { + "region_tag": "secretmanager_v1_generated_SecretManagerService_AccessSecretVersion_sync", + "title": "Snippet for the access_secret_version call in the SecretManagerService service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::SecretManager::V1::SecretManagerService::Client#access_secret_version.", + "file": "secret_manager_service/access_secret_version.rb", + "language": "RUBY", + "client_method": { + "short_name": "access_secret_version", + "full_name": "::Google::Cloud::SecretManager::V1::SecretManagerService::Client#access_secret_version", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::SecretManager::V1::AccessSecretVersionRequest", + "name": "request" + } + ], + "result_type": "::Google::Cloud::SecretManager::V1::AccessSecretVersionResponse", + "client": { + "short_name": "SecretManagerService::Client", + "full_name": "::Google::Cloud::SecretManager::V1::SecretManagerService::Client" + }, + "method": { + "short_name": "AccessSecretVersion", + "full_name": "google.cloud.secretmanager.v1.SecretManagerService.AccessSecretVersion", + "service": { + "short_name": "SecretManagerService", + "full_name": "google.cloud.secretmanager.v1.SecretManagerService" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 46, + "type": "FULL" + } + ] + }, + { + "region_tag": "secretmanager_v1_generated_SecretManagerService_DisableSecretVersion_sync", + "title": "Snippet for the disable_secret_version call in the SecretManagerService service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::SecretManager::V1::SecretManagerService::Client#disable_secret_version.", + "file": "secret_manager_service/disable_secret_version.rb", + "language": "RUBY", + "client_method": { + "short_name": "disable_secret_version", + "full_name": "::Google::Cloud::SecretManager::V1::SecretManagerService::Client#disable_secret_version", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::SecretManager::V1::DisableSecretVersionRequest", + "name": "request" + } + ], + "result_type": "::Google::Cloud::SecretManager::V1::SecretVersion", + "client": { + "short_name": "SecretManagerService::Client", + "full_name": "::Google::Cloud::SecretManager::V1::SecretManagerService::Client" + }, + "method": { + "short_name": "DisableSecretVersion", + "full_name": "google.cloud.secretmanager.v1.SecretManagerService.DisableSecretVersion", + "service": { + "short_name": "SecretManagerService", + "full_name": "google.cloud.secretmanager.v1.SecretManagerService" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 46, + "type": "FULL" + } + ] + }, + { + "region_tag": "secretmanager_v1_generated_SecretManagerService_EnableSecretVersion_sync", + "title": "Snippet for the enable_secret_version call in the SecretManagerService service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::SecretManager::V1::SecretManagerService::Client#enable_secret_version.", + "file": "secret_manager_service/enable_secret_version.rb", + "language": "RUBY", + "client_method": { + "short_name": "enable_secret_version", + "full_name": "::Google::Cloud::SecretManager::V1::SecretManagerService::Client#enable_secret_version", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::SecretManager::V1::EnableSecretVersionRequest", + "name": "request" + } + ], + "result_type": "::Google::Cloud::SecretManager::V1::SecretVersion", + "client": { + "short_name": "SecretManagerService::Client", + "full_name": "::Google::Cloud::SecretManager::V1::SecretManagerService::Client" + }, + "method": { + "short_name": "EnableSecretVersion", + "full_name": "google.cloud.secretmanager.v1.SecretManagerService.EnableSecretVersion", + "service": { + "short_name": "SecretManagerService", + "full_name": "google.cloud.secretmanager.v1.SecretManagerService" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 46, + "type": "FULL" + } + ] + }, + { + "region_tag": "secretmanager_v1_generated_SecretManagerService_DestroySecretVersion_sync", + "title": "Snippet for the destroy_secret_version call in the SecretManagerService service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::SecretManager::V1::SecretManagerService::Client#destroy_secret_version.", + "file": "secret_manager_service/destroy_secret_version.rb", + "language": "RUBY", + "client_method": { + "short_name": "destroy_secret_version", + "full_name": "::Google::Cloud::SecretManager::V1::SecretManagerService::Client#destroy_secret_version", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::SecretManager::V1::DestroySecretVersionRequest", + "name": "request" + } + ], + "result_type": "::Google::Cloud::SecretManager::V1::SecretVersion", + "client": { + "short_name": "SecretManagerService::Client", + "full_name": "::Google::Cloud::SecretManager::V1::SecretManagerService::Client" + }, + "method": { + "short_name": "DestroySecretVersion", + "full_name": "google.cloud.secretmanager.v1.SecretManagerService.DestroySecretVersion", + "service": { + "short_name": "SecretManagerService", + "full_name": "google.cloud.secretmanager.v1.SecretManagerService" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 46, + "type": "FULL" + } + ] + }, + { + "region_tag": "secretmanager_v1_generated_SecretManagerService_SetIamPolicy_sync", + "title": "Snippet for the set_iam_policy call in the SecretManagerService service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::SecretManager::V1::SecretManagerService::Client#set_iam_policy.", + "file": "secret_manager_service/set_iam_policy.rb", + "language": "RUBY", + "client_method": { + "short_name": "set_iam_policy", + "full_name": "::Google::Cloud::SecretManager::V1::SecretManagerService::Client#set_iam_policy", + "async": false, + "parameters": [ + { + "type": "::Google::Iam::V1::SetIamPolicyRequest", + "name": "request" + } + ], + "result_type": "::Google::Iam::V1::Policy", + "client": { + "short_name": "SecretManagerService::Client", + "full_name": "::Google::Cloud::SecretManager::V1::SecretManagerService::Client" + }, + "method": { + "short_name": "SetIamPolicy", + "full_name": "google.cloud.secretmanager.v1.SecretManagerService.SetIamPolicy", + "service": { + "short_name": "SecretManagerService", + "full_name": "google.cloud.secretmanager.v1.SecretManagerService" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 46, + "type": "FULL" + } + ] + }, + { + "region_tag": "secretmanager_v1_generated_SecretManagerService_GetIamPolicy_sync", + "title": "Snippet for the get_iam_policy call in the SecretManagerService service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::SecretManager::V1::SecretManagerService::Client#get_iam_policy.", + "file": "secret_manager_service/get_iam_policy.rb", + "language": "RUBY", + "client_method": { + "short_name": "get_iam_policy", + "full_name": "::Google::Cloud::SecretManager::V1::SecretManagerService::Client#get_iam_policy", + "async": false, + "parameters": [ + { + "type": "::Google::Iam::V1::GetIamPolicyRequest", + "name": "request" + } + ], + "result_type": "::Google::Iam::V1::Policy", + "client": { + "short_name": "SecretManagerService::Client", + "full_name": "::Google::Cloud::SecretManager::V1::SecretManagerService::Client" + }, + "method": { + "short_name": "GetIamPolicy", + "full_name": "google.cloud.secretmanager.v1.SecretManagerService.GetIamPolicy", + "service": { + "short_name": "SecretManagerService", + "full_name": "google.cloud.secretmanager.v1.SecretManagerService" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 46, + "type": "FULL" + } + ] + }, + { + "region_tag": "secretmanager_v1_generated_SecretManagerService_TestIamPermissions_sync", + "title": "Snippet for the test_iam_permissions call in the SecretManagerService service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::SecretManager::V1::SecretManagerService::Client#test_iam_permissions.", + "file": "secret_manager_service/test_iam_permissions.rb", + "language": "RUBY", + "client_method": { + "short_name": "test_iam_permissions", + "full_name": "::Google::Cloud::SecretManager::V1::SecretManagerService::Client#test_iam_permissions", + "async": false, + "parameters": [ + { + "type": "::Google::Iam::V1::TestIamPermissionsRequest", + "name": "request" + } + ], + "result_type": "::Google::Iam::V1::TestIamPermissionsResponse", + "client": { + "short_name": "SecretManagerService::Client", + "full_name": "::Google::Cloud::SecretManager::V1::SecretManagerService::Client" + }, + "method": { + "short_name": "TestIamPermissions", + "full_name": "google.cloud.secretmanager.v1.SecretManagerService.TestIamPermissions", + "service": { + "short_name": "SecretManagerService", + "full_name": "google.cloud.secretmanager.v1.SecretManagerService" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 46, + "type": "FULL" + } + ] + } + ] +} \ No newline at end of file diff --git a/owl-bot-staging/google-cloud-secret_manager-v1/test/google/cloud/secret_manager/v1/secret_manager_service_paths_test.rb b/owl-bot-staging/google-cloud-secret_manager-v1/test/google/cloud/secret_manager/v1/secret_manager_service_paths_test.rb new file mode 100644 index 000000000000..7ec6d9553efe --- /dev/null +++ b/owl-bot-staging/google-cloud-secret_manager-v1/test/google/cloud/secret_manager/v1/secret_manager_service_paths_test.rb @@ -0,0 +1,109 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +require "helper" + +require "gapic/grpc/service_stub" + +require "google/cloud/secret_manager/v1/secret_manager_service" + +class ::Google::Cloud::SecretManager::V1::SecretManagerService::ClientPathsTest < Minitest::Test + class DummyStub + def endpoint + "endpoint.example.com" + end + + def universe_domain + "example.com" + end + + def stub_logger + nil + end + + def logger + nil + end + end + + def test_location_path + grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + ::Gapic::ServiceStub.stub :new, DummyStub.new do + client = ::Google::Cloud::SecretManager::V1::SecretManagerService::Client.new do |config| + config.credentials = grpc_channel + end + + path = client.location_path project: "value0", location: "value1" + assert_equal "projects/value0/locations/value1", path + end + end + + def test_project_path + grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + ::Gapic::ServiceStub.stub :new, DummyStub.new do + client = ::Google::Cloud::SecretManager::V1::SecretManagerService::Client.new do |config| + config.credentials = grpc_channel + end + + path = client.project_path project: "value0" + assert_equal "projects/value0", path + end + end + + def test_secret_path + grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + ::Gapic::ServiceStub.stub :new, DummyStub.new do + client = ::Google::Cloud::SecretManager::V1::SecretManagerService::Client.new do |config| + config.credentials = grpc_channel + end + + path = client.secret_path project: "value0", secret: "value1" + assert_equal "projects/value0/secrets/value1", path + + path = client.secret_path project: "value0", location: "value1", secret: "value2" + assert_equal "projects/value0/locations/value1/secrets/value2", path + end + end + + def test_secret_version_path + grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + ::Gapic::ServiceStub.stub :new, DummyStub.new do + client = ::Google::Cloud::SecretManager::V1::SecretManagerService::Client.new do |config| + config.credentials = grpc_channel + end + + path = client.secret_version_path project: "value0", secret: "value1", secret_version: "value2" + assert_equal "projects/value0/secrets/value1/versions/value2", path + + path = client.secret_version_path project: "value0", location: "value1", secret: "value2", secret_version: "value3" + assert_equal "projects/value0/locations/value1/secrets/value2/versions/value3", path + end + end + + def test_topic_path + grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + ::Gapic::ServiceStub.stub :new, DummyStub.new do + client = ::Google::Cloud::SecretManager::V1::SecretManagerService::Client.new do |config| + config.credentials = grpc_channel + end + + path = client.topic_path project: "value0", topic: "value1" + assert_equal "projects/value0/topics/value1", path + end + end +end diff --git a/owl-bot-staging/google-cloud-secret_manager-v1/test/google/cloud/secret_manager/v1/secret_manager_service_rest_test.rb b/owl-bot-staging/google-cloud-secret_manager-v1/test/google/cloud/secret_manager/v1/secret_manager_service_rest_test.rb new file mode 100644 index 000000000000..3098cdf2bfb2 --- /dev/null +++ b/owl-bot-staging/google-cloud-secret_manager-v1/test/google/cloud/secret_manager/v1/secret_manager_service_rest_test.rb @@ -0,0 +1,927 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +require "helper" +require "gapic/rest" +require "google/cloud/secretmanager/v1/service_pb" +require "google/cloud/secret_manager/v1/secret_manager_service/rest" + + +class ::Google::Cloud::SecretManager::V1::SecretManagerService::Rest::ClientTest < Minitest::Test + class ClientStub + attr_accessor :call_count, :requests + + def initialize response, &block + @response = response + @block = block + @call_count = 0 + @requests = [] + end + + def make_get_request uri:, params: {}, options: {}, method_name: nil + make_http_request :get, uri: uri, body: nil, params: params, options: options, method_name: method_name + end + + def make_delete_request uri:, params: {}, options: {}, method_name: nil + make_http_request :delete, uri: uri, body: nil, params: params, options: options, method_name: method_name + end + + def make_post_request uri:, body: nil, params: {}, options: {}, method_name: nil + make_http_request :post, uri: uri, body: body, params: params, options: options, method_name: method_name + end + + def make_patch_request uri:, body:, params: {}, options: {}, method_name: nil + make_http_request :patch, uri: uri, body: body, params: params, options: options, method_name: method_name + end + + def make_put_request uri:, body:, params: {}, options: {}, method_name: nil + make_http_request :put, uri: uri, body: body, params: params, options: options, method_name: method_name + end + + def make_http_request *args, **kwargs + @call_count += 1 + + @requests << @block&.call(*args, **kwargs) + + @response + end + + def endpoint + "endpoint.example.com" + end + + def universe_domain + "example.com" + end + + def stub_logger + nil + end + + def logger + nil + end + end + + def test_list_secrets + # Create test objects. + client_result = ::Google::Cloud::SecretManager::V1::ListSecretsResponse.new + http_response = OpenStruct.new body: client_result.to_json + + call_options = {} + + # Create request parameters for a unary method. + parent = "hello world" + page_size = 42 + page_token = "hello world" + filter = "hello world" + + list_secrets_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| + assert options.metadata.key? :"x-goog-api-client" + assert options.metadata[:"x-goog-api-client"].include? "rest" + refute options.metadata[:"x-goog-api-client"].include? "grpc" + end + + ::Google::Cloud::SecretManager::V1::SecretManagerService::Rest::ServiceStub.stub :transcode_list_secrets_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, list_secrets_client_stub do + # Create client + client = ::Google::Cloud::SecretManager::V1::SecretManagerService::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.list_secrets({ parent: parent, page_size: page_size, page_token: page_token, filter: filter }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.list_secrets parent: parent, page_size: page_size, page_token: page_token, filter: filter do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.list_secrets ::Google::Cloud::SecretManager::V1::ListSecretsRequest.new(parent: parent, page_size: page_size, page_token: page_token, filter: filter) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + client.list_secrets({ parent: parent, page_size: page_size, page_token: page_token, filter: filter }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + client.list_secrets(::Google::Cloud::SecretManager::V1::ListSecretsRequest.new(parent: parent, page_size: page_size, page_token: page_token, filter: filter), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, list_secrets_client_stub.call_count + end + end + end + + def test_create_secret + # Create test objects. + client_result = ::Google::Cloud::SecretManager::V1::Secret.new + http_response = OpenStruct.new body: client_result.to_json + + call_options = {} + + # Create request parameters for a unary method. + parent = "hello world" + secret_id = "hello world" + secret = {} + + create_secret_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| + assert options.metadata.key? :"x-goog-api-client" + assert options.metadata[:"x-goog-api-client"].include? "rest" + refute options.metadata[:"x-goog-api-client"].include? "grpc" + end + + ::Google::Cloud::SecretManager::V1::SecretManagerService::Rest::ServiceStub.stub :transcode_create_secret_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, create_secret_client_stub do + # Create client + client = ::Google::Cloud::SecretManager::V1::SecretManagerService::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.create_secret({ parent: parent, secret_id: secret_id, secret: secret }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.create_secret parent: parent, secret_id: secret_id, secret: secret do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.create_secret ::Google::Cloud::SecretManager::V1::CreateSecretRequest.new(parent: parent, secret_id: secret_id, secret: secret) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + client.create_secret({ parent: parent, secret_id: secret_id, secret: secret }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + client.create_secret(::Google::Cloud::SecretManager::V1::CreateSecretRequest.new(parent: parent, secret_id: secret_id, secret: secret), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, create_secret_client_stub.call_count + end + end + end + + def test_add_secret_version + # Create test objects. + client_result = ::Google::Cloud::SecretManager::V1::SecretVersion.new + http_response = OpenStruct.new body: client_result.to_json + + call_options = {} + + # Create request parameters for a unary method. + parent = "hello world" + payload = {} + + add_secret_version_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| + assert options.metadata.key? :"x-goog-api-client" + assert options.metadata[:"x-goog-api-client"].include? "rest" + refute options.metadata[:"x-goog-api-client"].include? "grpc" + end + + ::Google::Cloud::SecretManager::V1::SecretManagerService::Rest::ServiceStub.stub :transcode_add_secret_version_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, add_secret_version_client_stub do + # Create client + client = ::Google::Cloud::SecretManager::V1::SecretManagerService::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.add_secret_version({ parent: parent, payload: payload }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.add_secret_version parent: parent, payload: payload do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.add_secret_version ::Google::Cloud::SecretManager::V1::AddSecretVersionRequest.new(parent: parent, payload: payload) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + client.add_secret_version({ parent: parent, payload: payload }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + client.add_secret_version(::Google::Cloud::SecretManager::V1::AddSecretVersionRequest.new(parent: parent, payload: payload), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, add_secret_version_client_stub.call_count + end + end + end + + def test_get_secret + # Create test objects. + client_result = ::Google::Cloud::SecretManager::V1::Secret.new + http_response = OpenStruct.new body: client_result.to_json + + call_options = {} + + # Create request parameters for a unary method. + name = "hello world" + + get_secret_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| + assert options.metadata.key? :"x-goog-api-client" + assert options.metadata[:"x-goog-api-client"].include? "rest" + refute options.metadata[:"x-goog-api-client"].include? "grpc" + end + + ::Google::Cloud::SecretManager::V1::SecretManagerService::Rest::ServiceStub.stub :transcode_get_secret_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, get_secret_client_stub do + # Create client + client = ::Google::Cloud::SecretManager::V1::SecretManagerService::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.get_secret({ name: name }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.get_secret name: name do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.get_secret ::Google::Cloud::SecretManager::V1::GetSecretRequest.new(name: name) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + client.get_secret({ name: name }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + client.get_secret(::Google::Cloud::SecretManager::V1::GetSecretRequest.new(name: name), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, get_secret_client_stub.call_count + end + end + end + + def test_update_secret + # Create test objects. + client_result = ::Google::Cloud::SecretManager::V1::Secret.new + http_response = OpenStruct.new body: client_result.to_json + + call_options = {} + + # Create request parameters for a unary method. + secret = {} + update_mask = {} + + update_secret_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| + assert options.metadata.key? :"x-goog-api-client" + assert options.metadata[:"x-goog-api-client"].include? "rest" + refute options.metadata[:"x-goog-api-client"].include? "grpc" + end + + ::Google::Cloud::SecretManager::V1::SecretManagerService::Rest::ServiceStub.stub :transcode_update_secret_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, update_secret_client_stub do + # Create client + client = ::Google::Cloud::SecretManager::V1::SecretManagerService::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.update_secret({ secret: secret, update_mask: update_mask }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.update_secret secret: secret, update_mask: update_mask do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.update_secret ::Google::Cloud::SecretManager::V1::UpdateSecretRequest.new(secret: secret, update_mask: update_mask) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + client.update_secret({ secret: secret, update_mask: update_mask }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + client.update_secret(::Google::Cloud::SecretManager::V1::UpdateSecretRequest.new(secret: secret, update_mask: update_mask), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, update_secret_client_stub.call_count + end + end + end + + def test_delete_secret + # Create test objects. + client_result = ::Google::Protobuf::Empty.new + http_response = OpenStruct.new body: client_result.to_json + + call_options = {} + + # Create request parameters for a unary method. + name = "hello world" + etag = "hello world" + + delete_secret_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| + assert options.metadata.key? :"x-goog-api-client" + assert options.metadata[:"x-goog-api-client"].include? "rest" + refute options.metadata[:"x-goog-api-client"].include? "grpc" + end + + ::Google::Cloud::SecretManager::V1::SecretManagerService::Rest::ServiceStub.stub :transcode_delete_secret_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, delete_secret_client_stub do + # Create client + client = ::Google::Cloud::SecretManager::V1::SecretManagerService::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.delete_secret({ name: name, etag: etag }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.delete_secret name: name, etag: etag do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.delete_secret ::Google::Cloud::SecretManager::V1::DeleteSecretRequest.new(name: name, etag: etag) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + client.delete_secret({ name: name, etag: etag }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + client.delete_secret(::Google::Cloud::SecretManager::V1::DeleteSecretRequest.new(name: name, etag: etag), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, delete_secret_client_stub.call_count + end + end + end + + def test_list_secret_versions + # Create test objects. + client_result = ::Google::Cloud::SecretManager::V1::ListSecretVersionsResponse.new + http_response = OpenStruct.new body: client_result.to_json + + call_options = {} + + # Create request parameters for a unary method. + parent = "hello world" + page_size = 42 + page_token = "hello world" + filter = "hello world" + + list_secret_versions_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| + assert options.metadata.key? :"x-goog-api-client" + assert options.metadata[:"x-goog-api-client"].include? "rest" + refute options.metadata[:"x-goog-api-client"].include? "grpc" + end + + ::Google::Cloud::SecretManager::V1::SecretManagerService::Rest::ServiceStub.stub :transcode_list_secret_versions_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, list_secret_versions_client_stub do + # Create client + client = ::Google::Cloud::SecretManager::V1::SecretManagerService::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.list_secret_versions({ parent: parent, page_size: page_size, page_token: page_token, filter: filter }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.list_secret_versions parent: parent, page_size: page_size, page_token: page_token, filter: filter do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.list_secret_versions ::Google::Cloud::SecretManager::V1::ListSecretVersionsRequest.new(parent: parent, page_size: page_size, page_token: page_token, filter: filter) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + client.list_secret_versions({ parent: parent, page_size: page_size, page_token: page_token, filter: filter }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + client.list_secret_versions(::Google::Cloud::SecretManager::V1::ListSecretVersionsRequest.new(parent: parent, page_size: page_size, page_token: page_token, filter: filter), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, list_secret_versions_client_stub.call_count + end + end + end + + def test_get_secret_version + # Create test objects. + client_result = ::Google::Cloud::SecretManager::V1::SecretVersion.new + http_response = OpenStruct.new body: client_result.to_json + + call_options = {} + + # Create request parameters for a unary method. + name = "hello world" + + get_secret_version_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| + assert options.metadata.key? :"x-goog-api-client" + assert options.metadata[:"x-goog-api-client"].include? "rest" + refute options.metadata[:"x-goog-api-client"].include? "grpc" + end + + ::Google::Cloud::SecretManager::V1::SecretManagerService::Rest::ServiceStub.stub :transcode_get_secret_version_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, get_secret_version_client_stub do + # Create client + client = ::Google::Cloud::SecretManager::V1::SecretManagerService::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.get_secret_version({ name: name }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.get_secret_version name: name do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.get_secret_version ::Google::Cloud::SecretManager::V1::GetSecretVersionRequest.new(name: name) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + client.get_secret_version({ name: name }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + client.get_secret_version(::Google::Cloud::SecretManager::V1::GetSecretVersionRequest.new(name: name), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, get_secret_version_client_stub.call_count + end + end + end + + def test_access_secret_version + # Create test objects. + client_result = ::Google::Cloud::SecretManager::V1::AccessSecretVersionResponse.new + http_response = OpenStruct.new body: client_result.to_json + + call_options = {} + + # Create request parameters for a unary method. + name = "hello world" + + access_secret_version_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| + assert options.metadata.key? :"x-goog-api-client" + assert options.metadata[:"x-goog-api-client"].include? "rest" + refute options.metadata[:"x-goog-api-client"].include? "grpc" + end + + ::Google::Cloud::SecretManager::V1::SecretManagerService::Rest::ServiceStub.stub :transcode_access_secret_version_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, access_secret_version_client_stub do + # Create client + client = ::Google::Cloud::SecretManager::V1::SecretManagerService::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.access_secret_version({ name: name }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.access_secret_version name: name do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.access_secret_version ::Google::Cloud::SecretManager::V1::AccessSecretVersionRequest.new(name: name) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + client.access_secret_version({ name: name }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + client.access_secret_version(::Google::Cloud::SecretManager::V1::AccessSecretVersionRequest.new(name: name), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, access_secret_version_client_stub.call_count + end + end + end + + def test_disable_secret_version + # Create test objects. + client_result = ::Google::Cloud::SecretManager::V1::SecretVersion.new + http_response = OpenStruct.new body: client_result.to_json + + call_options = {} + + # Create request parameters for a unary method. + name = "hello world" + etag = "hello world" + + disable_secret_version_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| + assert options.metadata.key? :"x-goog-api-client" + assert options.metadata[:"x-goog-api-client"].include? "rest" + refute options.metadata[:"x-goog-api-client"].include? "grpc" + end + + ::Google::Cloud::SecretManager::V1::SecretManagerService::Rest::ServiceStub.stub :transcode_disable_secret_version_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, disable_secret_version_client_stub do + # Create client + client = ::Google::Cloud::SecretManager::V1::SecretManagerService::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.disable_secret_version({ name: name, etag: etag }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.disable_secret_version name: name, etag: etag do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.disable_secret_version ::Google::Cloud::SecretManager::V1::DisableSecretVersionRequest.new(name: name, etag: etag) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + client.disable_secret_version({ name: name, etag: etag }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + client.disable_secret_version(::Google::Cloud::SecretManager::V1::DisableSecretVersionRequest.new(name: name, etag: etag), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, disable_secret_version_client_stub.call_count + end + end + end + + def test_enable_secret_version + # Create test objects. + client_result = ::Google::Cloud::SecretManager::V1::SecretVersion.new + http_response = OpenStruct.new body: client_result.to_json + + call_options = {} + + # Create request parameters for a unary method. + name = "hello world" + etag = "hello world" + + enable_secret_version_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| + assert options.metadata.key? :"x-goog-api-client" + assert options.metadata[:"x-goog-api-client"].include? "rest" + refute options.metadata[:"x-goog-api-client"].include? "grpc" + end + + ::Google::Cloud::SecretManager::V1::SecretManagerService::Rest::ServiceStub.stub :transcode_enable_secret_version_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, enable_secret_version_client_stub do + # Create client + client = ::Google::Cloud::SecretManager::V1::SecretManagerService::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.enable_secret_version({ name: name, etag: etag }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.enable_secret_version name: name, etag: etag do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.enable_secret_version ::Google::Cloud::SecretManager::V1::EnableSecretVersionRequest.new(name: name, etag: etag) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + client.enable_secret_version({ name: name, etag: etag }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + client.enable_secret_version(::Google::Cloud::SecretManager::V1::EnableSecretVersionRequest.new(name: name, etag: etag), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, enable_secret_version_client_stub.call_count + end + end + end + + def test_destroy_secret_version + # Create test objects. + client_result = ::Google::Cloud::SecretManager::V1::SecretVersion.new + http_response = OpenStruct.new body: client_result.to_json + + call_options = {} + + # Create request parameters for a unary method. + name = "hello world" + etag = "hello world" + + destroy_secret_version_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| + assert options.metadata.key? :"x-goog-api-client" + assert options.metadata[:"x-goog-api-client"].include? "rest" + refute options.metadata[:"x-goog-api-client"].include? "grpc" + end + + ::Google::Cloud::SecretManager::V1::SecretManagerService::Rest::ServiceStub.stub :transcode_destroy_secret_version_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, destroy_secret_version_client_stub do + # Create client + client = ::Google::Cloud::SecretManager::V1::SecretManagerService::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.destroy_secret_version({ name: name, etag: etag }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.destroy_secret_version name: name, etag: etag do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.destroy_secret_version ::Google::Cloud::SecretManager::V1::DestroySecretVersionRequest.new(name: name, etag: etag) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + client.destroy_secret_version({ name: name, etag: etag }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + client.destroy_secret_version(::Google::Cloud::SecretManager::V1::DestroySecretVersionRequest.new(name: name, etag: etag), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, destroy_secret_version_client_stub.call_count + end + end + end + + def test_set_iam_policy + # Create test objects. + client_result = ::Google::Iam::V1::Policy.new + http_response = OpenStruct.new body: client_result.to_json + + call_options = {} + + # Create request parameters for a unary method. + resource = "hello world" + policy = {} + update_mask = {} + + set_iam_policy_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| + assert options.metadata.key? :"x-goog-api-client" + assert options.metadata[:"x-goog-api-client"].include? "rest" + refute options.metadata[:"x-goog-api-client"].include? "grpc" + end + + ::Google::Cloud::SecretManager::V1::SecretManagerService::Rest::ServiceStub.stub :transcode_set_iam_policy_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, set_iam_policy_client_stub do + # Create client + client = ::Google::Cloud::SecretManager::V1::SecretManagerService::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.set_iam_policy({ resource: resource, policy: policy, update_mask: update_mask }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.set_iam_policy resource: resource, policy: policy, update_mask: update_mask do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.set_iam_policy ::Google::Iam::V1::SetIamPolicyRequest.new(resource: resource, policy: policy, update_mask: update_mask) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + client.set_iam_policy({ resource: resource, policy: policy, update_mask: update_mask }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + client.set_iam_policy(::Google::Iam::V1::SetIamPolicyRequest.new(resource: resource, policy: policy, update_mask: update_mask), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, set_iam_policy_client_stub.call_count + end + end + end + + def test_get_iam_policy + # Create test objects. + client_result = ::Google::Iam::V1::Policy.new + http_response = OpenStruct.new body: client_result.to_json + + call_options = {} + + # Create request parameters for a unary method. + resource = "hello world" + options = {} + + get_iam_policy_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| + assert options.metadata.key? :"x-goog-api-client" + assert options.metadata[:"x-goog-api-client"].include? "rest" + refute options.metadata[:"x-goog-api-client"].include? "grpc" + end + + ::Google::Cloud::SecretManager::V1::SecretManagerService::Rest::ServiceStub.stub :transcode_get_iam_policy_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, get_iam_policy_client_stub do + # Create client + client = ::Google::Cloud::SecretManager::V1::SecretManagerService::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.get_iam_policy({ resource: resource, options: options }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.get_iam_policy resource: resource, options: options do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.get_iam_policy ::Google::Iam::V1::GetIamPolicyRequest.new(resource: resource, options: options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + client.get_iam_policy({ resource: resource, options: options }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + client.get_iam_policy(::Google::Iam::V1::GetIamPolicyRequest.new(resource: resource, options: options), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, get_iam_policy_client_stub.call_count + end + end + end + + def test_test_iam_permissions + # Create test objects. + client_result = ::Google::Iam::V1::TestIamPermissionsResponse.new + http_response = OpenStruct.new body: client_result.to_json + + call_options = {} + + # Create request parameters for a unary method. + resource = "hello world" + permissions = ["hello world"] + + test_iam_permissions_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| + assert options.metadata.key? :"x-goog-api-client" + assert options.metadata[:"x-goog-api-client"].include? "rest" + refute options.metadata[:"x-goog-api-client"].include? "grpc" + end + + ::Google::Cloud::SecretManager::V1::SecretManagerService::Rest::ServiceStub.stub :transcode_test_iam_permissions_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, test_iam_permissions_client_stub do + # Create client + client = ::Google::Cloud::SecretManager::V1::SecretManagerService::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.test_iam_permissions({ resource: resource, permissions: permissions }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.test_iam_permissions resource: resource, permissions: permissions do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.test_iam_permissions ::Google::Iam::V1::TestIamPermissionsRequest.new(resource: resource, permissions: permissions) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + client.test_iam_permissions({ resource: resource, permissions: permissions }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + client.test_iam_permissions(::Google::Iam::V1::TestIamPermissionsRequest.new(resource: resource, permissions: permissions), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, test_iam_permissions_client_stub.call_count + end + end + end + + def test_configure + credentials_token = :dummy_value + + client = block_config = config = nil + dummy_stub = ClientStub.new nil + Gapic::Rest::ClientStub.stub :new, dummy_stub do + client = ::Google::Cloud::SecretManager::V1::SecretManagerService::Rest::Client.new do |config| + config.credentials = credentials_token + end + end + + config = client.configure do |c| + block_config = c + end + + assert_same block_config, config + assert_kind_of ::Google::Cloud::SecretManager::V1::SecretManagerService::Rest::Client::Configuration, config + end +end diff --git a/owl-bot-staging/google-cloud-secret_manager-v1/test/google/cloud/secret_manager/v1/secret_manager_service_test.rb b/owl-bot-staging/google-cloud-secret_manager-v1/test/google/cloud/secret_manager/v1/secret_manager_service_test.rb new file mode 100644 index 000000000000..abcfa4a56894 --- /dev/null +++ b/owl-bot-staging/google-cloud-secret_manager-v1/test/google/cloud/secret_manager/v1/secret_manager_service_test.rb @@ -0,0 +1,1020 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +require "helper" + +require "gapic/grpc/service_stub" + +require "google/cloud/secretmanager/v1/service_pb" +require "google/cloud/secret_manager/v1/secret_manager_service" + +class ::Google::Cloud::SecretManager::V1::SecretManagerService::ClientTest < Minitest::Test + class ClientStub + attr_accessor :call_rpc_count, :requests + + def initialize response, operation, &block + @response = response + @operation = operation + @block = block + @call_rpc_count = 0 + @requests = [] + end + + def call_rpc *args, **kwargs + @call_rpc_count += 1 + + @requests << @block&.call(*args, **kwargs) + + catch :response do + yield @response, @operation if block_given? + @response + end + end + + def endpoint + "endpoint.example.com" + end + + def universe_domain + "example.com" + end + + def stub_logger + nil + end + + def logger + nil + end + end + + def test_list_secrets + # Create GRPC objects. + grpc_response = ::Google::Cloud::SecretManager::V1::ListSecretsResponse.new + grpc_operation = GRPC::ActiveCall::Operation.new nil + grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + grpc_options = {} + + # Create request parameters for a unary method. + parent = "hello world" + page_size = 42 + page_token = "hello world" + filter = "hello world" + + list_secrets_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :list_secrets, name + assert_kind_of ::Google::Cloud::SecretManager::V1::ListSecretsRequest, request + assert_equal "hello world", request["parent"] + assert_equal 42, request["page_size"] + assert_equal "hello world", request["page_token"] + assert_equal "hello world", request["filter"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, list_secrets_client_stub do + # Create client + client = ::Google::Cloud::SecretManager::V1::SecretManagerService::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.list_secrets({ parent: parent, page_size: page_size, page_token: page_token, filter: filter }) do |response, operation| + assert_kind_of Gapic::PagedEnumerable, response + assert_equal grpc_response, response.response + assert_equal grpc_operation, operation + end + + # Use named arguments + client.list_secrets parent: parent, page_size: page_size, page_token: page_token, filter: filter do |response, operation| + assert_kind_of Gapic::PagedEnumerable, response + assert_equal grpc_response, response.response + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.list_secrets ::Google::Cloud::SecretManager::V1::ListSecretsRequest.new(parent: parent, page_size: page_size, page_token: page_token, filter: filter) do |response, operation| + assert_kind_of Gapic::PagedEnumerable, response + assert_equal grpc_response, response.response + assert_equal grpc_operation, operation + end + + # Use hash object with options + client.list_secrets({ parent: parent, page_size: page_size, page_token: page_token, filter: filter }, grpc_options) do |response, operation| + assert_kind_of Gapic::PagedEnumerable, response + assert_equal grpc_response, response.response + assert_equal grpc_operation, operation + end + + # Use protobuf object with options + client.list_secrets(::Google::Cloud::SecretManager::V1::ListSecretsRequest.new(parent: parent, page_size: page_size, page_token: page_token, filter: filter), grpc_options) do |response, operation| + assert_kind_of Gapic::PagedEnumerable, response + assert_equal grpc_response, response.response + assert_equal grpc_operation, operation + end + + # Verify method calls + assert_equal 5, list_secrets_client_stub.call_rpc_count + end + end + + def test_create_secret + # Create GRPC objects. + grpc_response = ::Google::Cloud::SecretManager::V1::Secret.new + grpc_operation = GRPC::ActiveCall::Operation.new nil + grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + grpc_options = {} + + # Create request parameters for a unary method. + parent = "hello world" + secret_id = "hello world" + secret = {} + + create_secret_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :create_secret, name + assert_kind_of ::Google::Cloud::SecretManager::V1::CreateSecretRequest, request + assert_equal "hello world", request["parent"] + assert_equal "hello world", request["secret_id"] + assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::SecretManager::V1::Secret), request["secret"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, create_secret_client_stub do + # Create client + client = ::Google::Cloud::SecretManager::V1::SecretManagerService::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.create_secret({ parent: parent, secret_id: secret_id, secret: secret }) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use named arguments + client.create_secret parent: parent, secret_id: secret_id, secret: secret do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.create_secret ::Google::Cloud::SecretManager::V1::CreateSecretRequest.new(parent: parent, secret_id: secret_id, secret: secret) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use hash object with options + client.create_secret({ parent: parent, secret_id: secret_id, secret: secret }, grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object with options + client.create_secret(::Google::Cloud::SecretManager::V1::CreateSecretRequest.new(parent: parent, secret_id: secret_id, secret: secret), grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Verify method calls + assert_equal 5, create_secret_client_stub.call_rpc_count + end + end + + def test_add_secret_version + # Create GRPC objects. + grpc_response = ::Google::Cloud::SecretManager::V1::SecretVersion.new + grpc_operation = GRPC::ActiveCall::Operation.new nil + grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + grpc_options = {} + + # Create request parameters for a unary method. + parent = "hello world" + payload = {} + + add_secret_version_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :add_secret_version, name + assert_kind_of ::Google::Cloud::SecretManager::V1::AddSecretVersionRequest, request + assert_equal "hello world", request["parent"] + assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::SecretManager::V1::SecretPayload), request["payload"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, add_secret_version_client_stub do + # Create client + client = ::Google::Cloud::SecretManager::V1::SecretManagerService::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.add_secret_version({ parent: parent, payload: payload }) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use named arguments + client.add_secret_version parent: parent, payload: payload do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.add_secret_version ::Google::Cloud::SecretManager::V1::AddSecretVersionRequest.new(parent: parent, payload: payload) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use hash object with options + client.add_secret_version({ parent: parent, payload: payload }, grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object with options + client.add_secret_version(::Google::Cloud::SecretManager::V1::AddSecretVersionRequest.new(parent: parent, payload: payload), grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Verify method calls + assert_equal 5, add_secret_version_client_stub.call_rpc_count + end + end + + def test_get_secret + # Create GRPC objects. + grpc_response = ::Google::Cloud::SecretManager::V1::Secret.new + grpc_operation = GRPC::ActiveCall::Operation.new nil + grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + grpc_options = {} + + # Create request parameters for a unary method. + name = "hello world" + + get_secret_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :get_secret, name + assert_kind_of ::Google::Cloud::SecretManager::V1::GetSecretRequest, request + assert_equal "hello world", request["name"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, get_secret_client_stub do + # Create client + client = ::Google::Cloud::SecretManager::V1::SecretManagerService::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.get_secret({ name: name }) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use named arguments + client.get_secret name: name do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.get_secret ::Google::Cloud::SecretManager::V1::GetSecretRequest.new(name: name) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use hash object with options + client.get_secret({ name: name }, grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object with options + client.get_secret(::Google::Cloud::SecretManager::V1::GetSecretRequest.new(name: name), grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Verify method calls + assert_equal 5, get_secret_client_stub.call_rpc_count + end + end + + def test_update_secret + # Create GRPC objects. + grpc_response = ::Google::Cloud::SecretManager::V1::Secret.new + grpc_operation = GRPC::ActiveCall::Operation.new nil + grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + grpc_options = {} + + # Create request parameters for a unary method. + secret = {} + update_mask = {} + + update_secret_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :update_secret, name + assert_kind_of ::Google::Cloud::SecretManager::V1::UpdateSecretRequest, request + assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::SecretManager::V1::Secret), request["secret"] + assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Protobuf::FieldMask), request["update_mask"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, update_secret_client_stub do + # Create client + client = ::Google::Cloud::SecretManager::V1::SecretManagerService::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.update_secret({ secret: secret, update_mask: update_mask }) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use named arguments + client.update_secret secret: secret, update_mask: update_mask do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.update_secret ::Google::Cloud::SecretManager::V1::UpdateSecretRequest.new(secret: secret, update_mask: update_mask) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use hash object with options + client.update_secret({ secret: secret, update_mask: update_mask }, grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object with options + client.update_secret(::Google::Cloud::SecretManager::V1::UpdateSecretRequest.new(secret: secret, update_mask: update_mask), grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Verify method calls + assert_equal 5, update_secret_client_stub.call_rpc_count + end + end + + def test_delete_secret + # Create GRPC objects. + grpc_response = ::Google::Protobuf::Empty.new + grpc_operation = GRPC::ActiveCall::Operation.new nil + grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + grpc_options = {} + + # Create request parameters for a unary method. + name = "hello world" + etag = "hello world" + + delete_secret_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :delete_secret, name + assert_kind_of ::Google::Cloud::SecretManager::V1::DeleteSecretRequest, request + assert_equal "hello world", request["name"] + assert_equal "hello world", request["etag"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, delete_secret_client_stub do + # Create client + client = ::Google::Cloud::SecretManager::V1::SecretManagerService::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.delete_secret({ name: name, etag: etag }) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use named arguments + client.delete_secret name: name, etag: etag do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.delete_secret ::Google::Cloud::SecretManager::V1::DeleteSecretRequest.new(name: name, etag: etag) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use hash object with options + client.delete_secret({ name: name, etag: etag }, grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object with options + client.delete_secret(::Google::Cloud::SecretManager::V1::DeleteSecretRequest.new(name: name, etag: etag), grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Verify method calls + assert_equal 5, delete_secret_client_stub.call_rpc_count + end + end + + def test_list_secret_versions + # Create GRPC objects. + grpc_response = ::Google::Cloud::SecretManager::V1::ListSecretVersionsResponse.new + grpc_operation = GRPC::ActiveCall::Operation.new nil + grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + grpc_options = {} + + # Create request parameters for a unary method. + parent = "hello world" + page_size = 42 + page_token = "hello world" + filter = "hello world" + + list_secret_versions_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :list_secret_versions, name + assert_kind_of ::Google::Cloud::SecretManager::V1::ListSecretVersionsRequest, request + assert_equal "hello world", request["parent"] + assert_equal 42, request["page_size"] + assert_equal "hello world", request["page_token"] + assert_equal "hello world", request["filter"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, list_secret_versions_client_stub do + # Create client + client = ::Google::Cloud::SecretManager::V1::SecretManagerService::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.list_secret_versions({ parent: parent, page_size: page_size, page_token: page_token, filter: filter }) do |response, operation| + assert_kind_of Gapic::PagedEnumerable, response + assert_equal grpc_response, response.response + assert_equal grpc_operation, operation + end + + # Use named arguments + client.list_secret_versions parent: parent, page_size: page_size, page_token: page_token, filter: filter do |response, operation| + assert_kind_of Gapic::PagedEnumerable, response + assert_equal grpc_response, response.response + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.list_secret_versions ::Google::Cloud::SecretManager::V1::ListSecretVersionsRequest.new(parent: parent, page_size: page_size, page_token: page_token, filter: filter) do |response, operation| + assert_kind_of Gapic::PagedEnumerable, response + assert_equal grpc_response, response.response + assert_equal grpc_operation, operation + end + + # Use hash object with options + client.list_secret_versions({ parent: parent, page_size: page_size, page_token: page_token, filter: filter }, grpc_options) do |response, operation| + assert_kind_of Gapic::PagedEnumerable, response + assert_equal grpc_response, response.response + assert_equal grpc_operation, operation + end + + # Use protobuf object with options + client.list_secret_versions(::Google::Cloud::SecretManager::V1::ListSecretVersionsRequest.new(parent: parent, page_size: page_size, page_token: page_token, filter: filter), grpc_options) do |response, operation| + assert_kind_of Gapic::PagedEnumerable, response + assert_equal grpc_response, response.response + assert_equal grpc_operation, operation + end + + # Verify method calls + assert_equal 5, list_secret_versions_client_stub.call_rpc_count + end + end + + def test_get_secret_version + # Create GRPC objects. + grpc_response = ::Google::Cloud::SecretManager::V1::SecretVersion.new + grpc_operation = GRPC::ActiveCall::Operation.new nil + grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + grpc_options = {} + + # Create request parameters for a unary method. + name = "hello world" + + get_secret_version_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :get_secret_version, name + assert_kind_of ::Google::Cloud::SecretManager::V1::GetSecretVersionRequest, request + assert_equal "hello world", request["name"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, get_secret_version_client_stub do + # Create client + client = ::Google::Cloud::SecretManager::V1::SecretManagerService::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.get_secret_version({ name: name }) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use named arguments + client.get_secret_version name: name do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.get_secret_version ::Google::Cloud::SecretManager::V1::GetSecretVersionRequest.new(name: name) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use hash object with options + client.get_secret_version({ name: name }, grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object with options + client.get_secret_version(::Google::Cloud::SecretManager::V1::GetSecretVersionRequest.new(name: name), grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Verify method calls + assert_equal 5, get_secret_version_client_stub.call_rpc_count + end + end + + def test_access_secret_version + # Create GRPC objects. + grpc_response = ::Google::Cloud::SecretManager::V1::AccessSecretVersionResponse.new + grpc_operation = GRPC::ActiveCall::Operation.new nil + grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + grpc_options = {} + + # Create request parameters for a unary method. + name = "hello world" + + access_secret_version_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :access_secret_version, name + assert_kind_of ::Google::Cloud::SecretManager::V1::AccessSecretVersionRequest, request + assert_equal "hello world", request["name"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, access_secret_version_client_stub do + # Create client + client = ::Google::Cloud::SecretManager::V1::SecretManagerService::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.access_secret_version({ name: name }) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use named arguments + client.access_secret_version name: name do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.access_secret_version ::Google::Cloud::SecretManager::V1::AccessSecretVersionRequest.new(name: name) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use hash object with options + client.access_secret_version({ name: name }, grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object with options + client.access_secret_version(::Google::Cloud::SecretManager::V1::AccessSecretVersionRequest.new(name: name), grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Verify method calls + assert_equal 5, access_secret_version_client_stub.call_rpc_count + end + end + + def test_disable_secret_version + # Create GRPC objects. + grpc_response = ::Google::Cloud::SecretManager::V1::SecretVersion.new + grpc_operation = GRPC::ActiveCall::Operation.new nil + grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + grpc_options = {} + + # Create request parameters for a unary method. + name = "hello world" + etag = "hello world" + + disable_secret_version_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :disable_secret_version, name + assert_kind_of ::Google::Cloud::SecretManager::V1::DisableSecretVersionRequest, request + assert_equal "hello world", request["name"] + assert_equal "hello world", request["etag"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, disable_secret_version_client_stub do + # Create client + client = ::Google::Cloud::SecretManager::V1::SecretManagerService::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.disable_secret_version({ name: name, etag: etag }) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use named arguments + client.disable_secret_version name: name, etag: etag do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.disable_secret_version ::Google::Cloud::SecretManager::V1::DisableSecretVersionRequest.new(name: name, etag: etag) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use hash object with options + client.disable_secret_version({ name: name, etag: etag }, grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object with options + client.disable_secret_version(::Google::Cloud::SecretManager::V1::DisableSecretVersionRequest.new(name: name, etag: etag), grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Verify method calls + assert_equal 5, disable_secret_version_client_stub.call_rpc_count + end + end + + def test_enable_secret_version + # Create GRPC objects. + grpc_response = ::Google::Cloud::SecretManager::V1::SecretVersion.new + grpc_operation = GRPC::ActiveCall::Operation.new nil + grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + grpc_options = {} + + # Create request parameters for a unary method. + name = "hello world" + etag = "hello world" + + enable_secret_version_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :enable_secret_version, name + assert_kind_of ::Google::Cloud::SecretManager::V1::EnableSecretVersionRequest, request + assert_equal "hello world", request["name"] + assert_equal "hello world", request["etag"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, enable_secret_version_client_stub do + # Create client + client = ::Google::Cloud::SecretManager::V1::SecretManagerService::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.enable_secret_version({ name: name, etag: etag }) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use named arguments + client.enable_secret_version name: name, etag: etag do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.enable_secret_version ::Google::Cloud::SecretManager::V1::EnableSecretVersionRequest.new(name: name, etag: etag) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use hash object with options + client.enable_secret_version({ name: name, etag: etag }, grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object with options + client.enable_secret_version(::Google::Cloud::SecretManager::V1::EnableSecretVersionRequest.new(name: name, etag: etag), grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Verify method calls + assert_equal 5, enable_secret_version_client_stub.call_rpc_count + end + end + + def test_destroy_secret_version + # Create GRPC objects. + grpc_response = ::Google::Cloud::SecretManager::V1::SecretVersion.new + grpc_operation = GRPC::ActiveCall::Operation.new nil + grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + grpc_options = {} + + # Create request parameters for a unary method. + name = "hello world" + etag = "hello world" + + destroy_secret_version_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :destroy_secret_version, name + assert_kind_of ::Google::Cloud::SecretManager::V1::DestroySecretVersionRequest, request + assert_equal "hello world", request["name"] + assert_equal "hello world", request["etag"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, destroy_secret_version_client_stub do + # Create client + client = ::Google::Cloud::SecretManager::V1::SecretManagerService::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.destroy_secret_version({ name: name, etag: etag }) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use named arguments + client.destroy_secret_version name: name, etag: etag do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.destroy_secret_version ::Google::Cloud::SecretManager::V1::DestroySecretVersionRequest.new(name: name, etag: etag) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use hash object with options + client.destroy_secret_version({ name: name, etag: etag }, grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object with options + client.destroy_secret_version(::Google::Cloud::SecretManager::V1::DestroySecretVersionRequest.new(name: name, etag: etag), grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Verify method calls + assert_equal 5, destroy_secret_version_client_stub.call_rpc_count + end + end + + def test_set_iam_policy + # Create GRPC objects. + grpc_response = ::Google::Iam::V1::Policy.new + grpc_operation = GRPC::ActiveCall::Operation.new nil + grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + grpc_options = {} + + # Create request parameters for a unary method. + resource = "hello world" + policy = {} + update_mask = {} + + set_iam_policy_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :set_iam_policy, name + assert_kind_of ::Google::Iam::V1::SetIamPolicyRequest, request + assert_equal "hello world", request["resource"] + assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Iam::V1::Policy), request["policy"] + assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Protobuf::FieldMask), request["update_mask"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, set_iam_policy_client_stub do + # Create client + client = ::Google::Cloud::SecretManager::V1::SecretManagerService::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.set_iam_policy({ resource: resource, policy: policy, update_mask: update_mask }) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use named arguments + client.set_iam_policy resource: resource, policy: policy, update_mask: update_mask do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.set_iam_policy ::Google::Iam::V1::SetIamPolicyRequest.new(resource: resource, policy: policy, update_mask: update_mask) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use hash object with options + client.set_iam_policy({ resource: resource, policy: policy, update_mask: update_mask }, grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object with options + client.set_iam_policy(::Google::Iam::V1::SetIamPolicyRequest.new(resource: resource, policy: policy, update_mask: update_mask), grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Verify method calls + assert_equal 5, set_iam_policy_client_stub.call_rpc_count + end + end + + def test_get_iam_policy + # Create GRPC objects. + grpc_response = ::Google::Iam::V1::Policy.new + grpc_operation = GRPC::ActiveCall::Operation.new nil + grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + grpc_options = {} + + # Create request parameters for a unary method. + resource = "hello world" + options = {} + + get_iam_policy_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :get_iam_policy, name + assert_kind_of ::Google::Iam::V1::GetIamPolicyRequest, request + assert_equal "hello world", request["resource"] + assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Iam::V1::GetPolicyOptions), request["options"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, get_iam_policy_client_stub do + # Create client + client = ::Google::Cloud::SecretManager::V1::SecretManagerService::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.get_iam_policy({ resource: resource, options: options }) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use named arguments + client.get_iam_policy resource: resource, options: options do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.get_iam_policy ::Google::Iam::V1::GetIamPolicyRequest.new(resource: resource, options: options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use hash object with options + client.get_iam_policy({ resource: resource, options: options }, grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object with options + client.get_iam_policy(::Google::Iam::V1::GetIamPolicyRequest.new(resource: resource, options: options), grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Verify method calls + assert_equal 5, get_iam_policy_client_stub.call_rpc_count + end + end + + def test_test_iam_permissions + # Create GRPC objects. + grpc_response = ::Google::Iam::V1::TestIamPermissionsResponse.new + grpc_operation = GRPC::ActiveCall::Operation.new nil + grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + grpc_options = {} + + # Create request parameters for a unary method. + resource = "hello world" + permissions = ["hello world"] + + test_iam_permissions_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :test_iam_permissions, name + assert_kind_of ::Google::Iam::V1::TestIamPermissionsRequest, request + assert_equal "hello world", request["resource"] + assert_equal ["hello world"], request["permissions"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, test_iam_permissions_client_stub do + # Create client + client = ::Google::Cloud::SecretManager::V1::SecretManagerService::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.test_iam_permissions({ resource: resource, permissions: permissions }) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use named arguments + client.test_iam_permissions resource: resource, permissions: permissions do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.test_iam_permissions ::Google::Iam::V1::TestIamPermissionsRequest.new(resource: resource, permissions: permissions) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use hash object with options + client.test_iam_permissions({ resource: resource, permissions: permissions }, grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object with options + client.test_iam_permissions(::Google::Iam::V1::TestIamPermissionsRequest.new(resource: resource, permissions: permissions), grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Verify method calls + assert_equal 5, test_iam_permissions_client_stub.call_rpc_count + end + end + + def test_configure + grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + + client = block_config = config = nil + dummy_stub = ClientStub.new nil, nil + Gapic::ServiceStub.stub :new, dummy_stub do + client = ::Google::Cloud::SecretManager::V1::SecretManagerService::Client.new do |config| + config.credentials = grpc_channel + end + end + + config = client.configure do |c| + block_config = c + end + + assert_same block_config, config + assert_kind_of ::Google::Cloud::SecretManager::V1::SecretManagerService::Client::Configuration, config + end + + def test_credentials + key = OpenSSL::PKey::RSA.new 2048 + cred_json = { + "private_key" => key.to_pem, + "client_email" => "app@developer.gserviceaccount.com", + "type" => "service_account" + } + key_file = StringIO.new cred_json.to_json + creds = Google::Auth::ServiceAccountCredentials.make_creds({ json_key_io: key_file }) + + dummy_stub = ClientStub.new nil, nil + Gapic::ServiceStub.stub :new, dummy_stub do + client = ::Google::Cloud::SecretManager::V1::SecretManagerService::Client.new do |config| + config.credentials = creds + end + assert_kind_of ::Google::Cloud::SecretManager::V1::SecretManagerService::Client, client + assert_equal creds, client.configure.credentials + end + end +end diff --git a/owl-bot-staging/google-cloud-secret_manager-v1/test/helper.rb b/owl-bot-staging/google-cloud-secret_manager-v1/test/helper.rb new file mode 100644 index 000000000000..672b337030e7 --- /dev/null +++ b/owl-bot-staging/google-cloud-secret_manager-v1/test/helper.rb @@ -0,0 +1,26 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +require "minitest/autorun" +require "minitest/focus" +require "minitest/mock" +require "minitest/rg" + +require "grpc" + +require "ostruct" diff --git a/owl-bot-staging/google-cloud-secret_manager-v1beta1/.gitignore b/owl-bot-staging/google-cloud-secret_manager-v1beta1/.gitignore new file mode 100644 index 000000000000..0135b6bc6cfc --- /dev/null +++ b/owl-bot-staging/google-cloud-secret_manager-v1beta1/.gitignore @@ -0,0 +1,22 @@ +# Ignore bundler lockfiles +Gemfile.lock +gems.locked + +# Ignore documentation output +doc/* +.yardoc/* + +# Ignore test output +coverage/* + +# Ignore build artifacts +pkg/* + +# Ignore files commonly present in certain dev environments +.vagrant +.DS_STORE +.idea +*.iml + +# Ignore synth output +__pycache__ diff --git a/owl-bot-staging/google-cloud-secret_manager-v1beta1/.repo-metadata.json b/owl-bot-staging/google-cloud-secret_manager-v1beta1/.repo-metadata.json new file mode 100644 index 000000000000..bae754636e19 --- /dev/null +++ b/owl-bot-staging/google-cloud-secret_manager-v1beta1/.repo-metadata.json @@ -0,0 +1,18 @@ +{ + "api_id": "secretmanager.googleapis.com", + "api_shortname": "secretmanager", + "client_documentation": "https://cloud.google.com/ruby/docs/reference/google-cloud-secret_manager-v1beta1/latest", + "distribution_name": "google-cloud-secret_manager-v1beta1", + "is_cloud": true, + "language": "ruby", + "name": "secretmanager", + "name_pretty": "Secret Manager V1beta1 API", + "product_documentation": "https://cloud.google.com/secret-manager", + "release_level": "unreleased", + "repo": "googleapis/google-cloud-ruby", + "requires_billing": true, + "ruby-cloud-description": "Secret Manager is a secure and convenient storage system for API keys, passwords, certificates, and other sensitive data. Secret Manager provides a central place and single source of truth to manage, access, and audit secrets across Google Cloud. Note that google-cloud-secret_manager-v1beta1 is a version-specific client library. For most uses, we recommend installing the main client library google-cloud-secret_manager instead. See the readme for more details.", + "ruby-cloud-env-prefix": "SECRET_MANAGER", + "ruby-cloud-product-url": "https://cloud.google.com/secret-manager", + "library_type": "GAPIC_AUTO" +} diff --git a/owl-bot-staging/google-cloud-secret_manager-v1beta1/.rubocop.yml b/owl-bot-staging/google-cloud-secret_manager-v1beta1/.rubocop.yml new file mode 100644 index 000000000000..7f3f3a64f5cf --- /dev/null +++ b/owl-bot-staging/google-cloud-secret_manager-v1beta1/.rubocop.yml @@ -0,0 +1,33 @@ +inherit_gem: + google-style: google-style.yml + +AllCops: + Exclude: + - "google-cloud-secret_manager-v1beta1.gemspec" + - "lib/**/*_pb.rb" + - "proto_docs/**/*" + - "test/**/*" + - "acceptance/**/*" + - "samples/acceptance/**/*" + - "Rakefile" + +Layout/LineLength: + Enabled: false +Metrics/AbcSize: + Enabled: false +Metrics/ClassLength: + Enabled: false +Metrics/CyclomaticComplexity: + Enabled: false +Metrics/MethodLength: + Enabled: false +Metrics/ModuleLength: + Enabled: false +Metrics/PerceivedComplexity: + Enabled: false +Naming/AccessorMethodName: + Exclude: + - "snippets/**/*.rb" +Naming/FileName: + Exclude: + - "lib/google-cloud-secret_manager-v1beta1.rb" diff --git a/owl-bot-staging/google-cloud-secret_manager-v1beta1/.toys.rb b/owl-bot-staging/google-cloud-secret_manager-v1beta1/.toys.rb new file mode 100644 index 000000000000..177e22456e8a --- /dev/null +++ b/owl-bot-staging/google-cloud-secret_manager-v1beta1/.toys.rb @@ -0,0 +1,28 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +toys_version! ">= 0.15.3" + +if ENV["RUBY_COMMON_TOOLS"] + common_tools_dir = File.expand_path ENV["RUBY_COMMON_TOOLS"] + load File.join(common_tools_dir, "toys", "gapic") +else + load_git remote: "https://github.com/googleapis/ruby-common-tools.git", + path: "toys/gapic", + update: true +end diff --git a/owl-bot-staging/google-cloud-secret_manager-v1beta1/.yardopts b/owl-bot-staging/google-cloud-secret_manager-v1beta1/.yardopts new file mode 100644 index 000000000000..78441fd84b43 --- /dev/null +++ b/owl-bot-staging/google-cloud-secret_manager-v1beta1/.yardopts @@ -0,0 +1,12 @@ +--no-private +--title="Secret Manager V1beta1 API" +--exclude _pb\.rb$ +--markup markdown +--markup-provider redcarpet + +./lib/**/*.rb +./proto_docs/**/*.rb +- +README.md +LICENSE.md +AUTHENTICATION.md diff --git a/owl-bot-staging/google-cloud-secret_manager-v1beta1/AUTHENTICATION.md b/owl-bot-staging/google-cloud-secret_manager-v1beta1/AUTHENTICATION.md new file mode 100644 index 000000000000..755a69b7bf72 --- /dev/null +++ b/owl-bot-staging/google-cloud-secret_manager-v1beta1/AUTHENTICATION.md @@ -0,0 +1,122 @@ +# Authentication + +The recommended way to authenticate to the google-cloud-secret_manager-v1beta1 library is to use +[Application Default Credentials (ADC)](https://cloud.google.com/docs/authentication/application-default-credentials). +To review all of your authentication options, see [Credentials lookup](#credential-lookup). + +## Quickstart + +The following example shows how to set up authentication for a local development +environment with your user credentials. + +**NOTE:** This method is _not_ recommended for running in production. User credentials +should be used only during development. + +1. [Download and install the Google Cloud CLI](https://cloud.google.com/sdk). +2. Set up a local ADC file with your user credentials: + +```sh +gcloud auth application-default login +``` + +3. Write code as if already authenticated. + +For more information about setting up authentication for a local development environment, see +[Set up Application Default Credentials](https://cloud.google.com/docs/authentication/provide-credentials-adc#local-dev). + +## Credential Lookup + +The google-cloud-secret_manager-v1beta1 library provides several mechanisms to configure your system. +Generally, using Application Default Credentials to facilitate automatic +credentials discovery is the easist method. But if you need to explicitly specify +credentials, there are several methods available to you. + +Credentials are accepted in the following ways, in the following order or precedence: + +1. Credentials specified in method arguments +2. Credentials specified in configuration +3. Credentials pointed to or included in environment variables +4. Credentials found in local ADC file +5. Credentials returned by the metadata server for the attached service account (GCP) + +### Configuration + +You can configure a path to a JSON credentials file, either for an individual client object or +globally, for all client objects. The JSON file can contain credentials created for +[workload identity federation](https://cloud.google.com/iam/docs/workload-identity-federation), +[workforce identity federation](https://cloud.google.com/iam/docs/workforce-identity-federation), or a +[service account key](https://cloud.google.com/docs/authentication/provide-credentials-adc#local-key). + +Note: Service account keys are a security risk if not managed correctly. You should +[choose a more secure alternative to service account keys](https://cloud.google.com/docs/authentication#auth-decision-tree) +whenever possible. + +To configure a credentials file for an individual client initialization: + +```ruby +require "google/cloud/secret_manager/v1beta1" + +client = ::Google::Cloud::SecretManager::V1beta1::SecretManagerService::Client.new do |config| + config.credentials = "path/to/credentialfile.json" +end +``` + +To configure a credentials file globally for all clients: + +```ruby +require "google/cloud/secret_manager/v1beta1" + +::Google::Cloud::SecretManager::V1beta1::SecretManagerService::Client.configure do |config| + config.credentials = "path/to/credentialfile.json" +end + +client = ::Google::Cloud::SecretManager::V1beta1::SecretManagerService::Client.new +``` + +### Environment Variables + +You can also use an environment variable to provide a JSON credentials file. +The environment variable can contain a path to the credentials file or, for +environments such as Docker containers where writing files is not encouraged, +you can include the credentials file itself. + +The JSON file can contain credentials created for +[workload identity federation](https://cloud.google.com/iam/docs/workload-identity-federation), +[workforce identity federation](https://cloud.google.com/iam/docs/workforce-identity-federation), or a +[service account key](https://cloud.google.com/docs/authentication/provide-credentials-adc#local-key). + +Note: Service account keys are a security risk if not managed correctly. You should +[choose a more secure alternative to service account keys](https://cloud.google.com/docs/authentication#auth-decision-tree) +whenever possible. + +The environment variables that google-cloud-secret_manager-v1beta1 +checks for credentials are: + +* `GOOGLE_CLOUD_CREDENTIALS` - Path to JSON file, or JSON contents +* `GOOGLE_APPLICATION_CREDENTIALS` - Path to JSON file + +```ruby +require "google/cloud/secret_manager/v1beta1" + +ENV["GOOGLE_APPLICATION_CREDENTIALS"] = "path/to/credentialfile.json" + +client = ::Google::Cloud::SecretManager::V1beta1::SecretManagerService::Client.new +``` + +### Local ADC file + +You can set up a local ADC file with your user credentials for authentication during +development. If credentials are not provided in code or in environment variables, +then the local ADC credentials are discovered. + +Follow the steps in [Quickstart](#quickstart) to set up a local ADC file. + +### Google Cloud Platform environments + +When running on Google Cloud Platform (GCP), including Google Compute Engine +(GCE), Google Kubernetes Engine (GKE), Google App Engine (GAE), Google Cloud +Functions (GCF) and Cloud Run, credentials are retrieved from the attached +service account automatically. Code should be written as if already authenticated. + +For more information, see +[Set up ADC for Google Cloud services](https://cloud.google.com/docs/authentication/provide-credentials-adc#attached-sa). diff --git a/owl-bot-staging/google-cloud-secret_manager-v1beta1/CHANGELOG.md b/owl-bot-staging/google-cloud-secret_manager-v1beta1/CHANGELOG.md new file mode 100644 index 000000000000..f88957a62ba2 --- /dev/null +++ b/owl-bot-staging/google-cloud-secret_manager-v1beta1/CHANGELOG.md @@ -0,0 +1,2 @@ +# Release History + diff --git a/owl-bot-staging/google-cloud-secret_manager-v1beta1/Gemfile b/owl-bot-staging/google-cloud-secret_manager-v1beta1/Gemfile new file mode 100644 index 000000000000..1d08558908d8 --- /dev/null +++ b/owl-bot-staging/google-cloud-secret_manager-v1beta1/Gemfile @@ -0,0 +1,14 @@ +source "https://rubygems.org" + +gemspec + +gem "google-style", "~> 1.32.0" +gem "irb", "~> 1.17" +gem "minitest", "~> 6.0.2" +gem "minitest-focus", "~> 1.4" +gem "minitest-mock", "~> 5.27" +gem "minitest-rg", "~> 5.3" +gem "ostruct", "~> 0.5.5" +gem "rake", ">= 13.0" +gem "redcarpet", "~> 3.6" +gem "yard", "~> 0.9" diff --git a/owl-bot-staging/google-cloud-secret_manager-v1beta1/LICENSE.md b/owl-bot-staging/google-cloud-secret_manager-v1beta1/LICENSE.md new file mode 100644 index 000000000000..c261857ba6ad --- /dev/null +++ b/owl-bot-staging/google-cloud-secret_manager-v1beta1/LICENSE.md @@ -0,0 +1,201 @@ + Apache License + Version 2.0, January 2004 + http://www.apache.org/licenses/ + + TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION + + 1. Definitions. + + "License" shall mean the terms and conditions for use, reproduction, + and distribution as defined by Sections 1 through 9 of this document. + + "Licensor" shall mean the copyright owner or entity authorized by + the copyright owner that is granting the License. + + "Legal Entity" shall mean the union of the acting entity and all + other entities that control, are controlled by, or are under common + control with that entity. For the purposes of this definition, + "control" means (i) the power, direct or indirect, to cause the + direction or management of such entity, whether by contract or + otherwise, or (ii) ownership of fifty percent (50%) or more of the + outstanding shares, or (iii) beneficial ownership of such entity. + + "You" (or "Your") shall mean an individual or Legal Entity + exercising permissions granted by this License. + + "Source" form shall mean the preferred form for making modifications, + including but not limited to software source code, documentation + source, and configuration files. + + "Object" form shall mean any form resulting from mechanical + transformation or translation of a Source form, including but + not limited to compiled object code, generated documentation, + and conversions to other media types. + + "Work" shall mean the work of authorship, whether in Source or + Object form, made available under the License, as indicated by a + copyright notice that is included in or attached to the work + (an example is provided in the Appendix below). + + "Derivative Works" shall mean any work, whether in Source or Object + form, that is based on (or derived from) the Work and for which the + editorial revisions, annotations, elaborations, or other modifications + represent, as a whole, an original work of authorship. For the purposes + of this License, Derivative Works shall not include works that remain + separable from, or merely link (or bind by name) to the interfaces of, + the Work and Derivative Works thereof. + + "Contribution" shall mean any work of authorship, including + the original version of the Work and any modifications or additions + to that Work or Derivative Works thereof, that is intentionally + submitted to Licensor for inclusion in the Work by the copyright owner + or by an individual or Legal Entity authorized to submit on behalf of + the copyright owner. For the purposes of this definition, "submitted" + means any form of electronic, verbal, or written communication sent + to the Licensor or its representatives, including but not limited to + communication on electronic mailing lists, source code control systems, + and issue tracking systems that are managed by, or on behalf of, the + Licensor for the purpose of discussing and improving the Work, but + excluding communication that is conspicuously marked or otherwise + designated in writing by the copyright owner as "Not a Contribution." + + "Contributor" shall mean Licensor and any individual or Legal Entity + on behalf of whom a Contribution has been received by Licensor and + subsequently incorporated within the Work. + + 2. Grant of Copyright License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + copyright license to reproduce, prepare Derivative Works of, + publicly display, publicly perform, sublicense, and distribute the + Work and such Derivative Works in Source or Object form. + + 3. Grant of Patent License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + (except as stated in this section) patent license to make, have made, + use, offer to sell, sell, import, and otherwise transfer the Work, + where such license applies only to those patent claims licensable + by such Contributor that are necessarily infringed by their + Contribution(s) alone or by combination of their Contribution(s) + with the Work to which such Contribution(s) was submitted. If You + institute patent litigation against any entity (including a + cross-claim or counterclaim in a lawsuit) alleging that the Work + or a Contribution incorporated within the Work constitutes direct + or contributory patent infringement, then any patent licenses + granted to You under this License for that Work shall terminate + as of the date such litigation is filed. + + 4. Redistribution. You may reproduce and distribute copies of the + Work or Derivative Works thereof in any medium, with or without + modifications, and in Source or Object form, provided that You + meet the following conditions: + + (a) You must give any other recipients of the Work or + Derivative Works a copy of this License; and + + (b) You must cause any modified files to carry prominent notices + stating that You changed the files; and + + (c) You must retain, in the Source form of any Derivative Works + that You distribute, all copyright, patent, trademark, and + attribution notices from the Source form of the Work, + excluding those notices that do not pertain to any part of + the Derivative Works; and + + (d) If the Work includes a "NOTICE" text file as part of its + distribution, then any Derivative Works that You distribute must + include a readable copy of the attribution notices contained + within such NOTICE file, excluding those notices that do not + pertain to any part of the Derivative Works, in at least one + of the following places: within a NOTICE text file distributed + as part of the Derivative Works; within the Source form or + documentation, if provided along with the Derivative Works; or, + within a display generated by the Derivative Works, if and + wherever such third-party notices normally appear. The contents + of the NOTICE file are for informational purposes only and + do not modify the License. You may add Your own attribution + notices within Derivative Works that You distribute, alongside + or as an addendum to the NOTICE text from the Work, provided + that such additional attribution notices cannot be construed + as modifying the License. + + You may add Your own copyright statement to Your modifications and + may provide additional or different license terms and conditions + for use, reproduction, or distribution of Your modifications, or + for any such Derivative Works as a whole, provided Your use, + reproduction, and distribution of the Work otherwise complies with + the conditions stated in this License. + + 5. Submission of Contributions. Unless You explicitly state otherwise, + any Contribution intentionally submitted for inclusion in the Work + by You to the Licensor shall be under the terms and conditions of + this License, without any additional terms or conditions. + Notwithstanding the above, nothing herein shall supersede or modify + the terms of any separate license agreement you may have executed + with Licensor regarding such Contributions. + + 6. Trademarks. This License does not grant permission to use the trade + names, trademarks, service marks, or product names of the Licensor, + except as required for reasonable and customary use in describing the + origin of the Work and reproducing the content of the NOTICE file. + + 7. Disclaimer of Warranty. Unless required by applicable law or + agreed to in writing, Licensor provides the Work (and each + Contributor provides its Contributions) on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or + implied, including, without limitation, any warranties or conditions + of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A + PARTICULAR PURPOSE. You are solely responsible for determining the + appropriateness of using or redistributing the Work and assume any + risks associated with Your exercise of permissions under this License. + + 8. Limitation of Liability. In no event and under no legal theory, + whether in tort (including negligence), contract, or otherwise, + unless required by applicable law (such as deliberate and grossly + negligent acts) or agreed to in writing, shall any Contributor be + liable to You for damages, including any direct, indirect, special, + incidental, or consequential damages of any character arising as a + result of this License or out of the use or inability to use the + Work (including but not limited to damages for loss of goodwill, + work stoppage, computer failure or malfunction, or any and all + other commercial damages or losses), even if such Contributor + has been advised of the possibility of such damages. + + 9. Accepting Warranty or Additional Liability. While redistributing + the Work or Derivative Works thereof, You may choose to offer, + and charge a fee for, acceptance of support, warranty, indemnity, + or other liability obligations and/or rights consistent with this + License. However, in accepting such obligations, You may act only + on Your own behalf and on Your sole responsibility, not on behalf + of any other Contributor, and only if You agree to indemnify, + defend, and hold each Contributor harmless for any liability + incurred by, or claims asserted against, such Contributor by reason + of your accepting any such warranty or additional liability. + + END OF TERMS AND CONDITIONS + + APPENDIX: How to apply the Apache License to your work. + + To apply the Apache License to your work, attach the following + boilerplate notice, with the fields enclosed by brackets "[]" + replaced with your own identifying information. (Don't include + the brackets!) The text should be enclosed in the appropriate + comment syntax for the file format. We also recommend that a + file or class name and description of purpose be included on the + same "printed page" as the copyright notice for easier + identification within third-party archives. + + Copyright [yyyy] [name of copyright owner] + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. diff --git a/owl-bot-staging/google-cloud-secret_manager-v1beta1/README.md b/owl-bot-staging/google-cloud-secret_manager-v1beta1/README.md new file mode 100644 index 000000000000..c14793642535 --- /dev/null +++ b/owl-bot-staging/google-cloud-secret_manager-v1beta1/README.md @@ -0,0 +1,154 @@ +# Ruby Client for the Secret Manager V1beta1 API + +Stores sensitive data such as API keys, passwords, and certificates. Provides convenience while improving security. + +Secret Manager is a secure and convenient storage system for API keys, passwords, certificates, and other sensitive data. Secret Manager provides a central place and single source of truth to manage, access, and audit secrets across Google Cloud. + +https://github.com/googleapis/google-cloud-ruby + +This gem is a _versioned_ client. It provides basic client classes for a +specific version of the Secret Manager V1beta1 API. Most users should consider using +the main client gem, +[google-cloud-secret_manager](https://rubygems.org/gems/google-cloud-secret_manager). +See the section below titled *Which client should I use?* for more information. + +## Installation + +``` +$ gem install google-cloud-secret_manager-v1beta1 +``` + +## Before You Begin + +In order to use this library, you first need to go through the following steps: + +1. [Select or create a Cloud Platform project.](https://console.cloud.google.com/project) +1. [Enable billing for your project.](https://cloud.google.com/billing/docs/how-to/modify-project#enable_billing_for_a_project) +1. [Enable the API.](https://console.cloud.google.com/apis/library/secretmanager.googleapis.com) +1. [Set up authentication.](AUTHENTICATION.md) + +## Quick Start + +```ruby +require "google/cloud/secret_manager/v1beta1" + +client = ::Google::Cloud::SecretManager::V1beta1::SecretManagerService::Client.new +request = ::Google::Cloud::SecretManager::V1beta1::ListSecretsRequest.new # (request fields as keyword arguments...) +response = client.list_secrets request +``` + +View the [Client Library Documentation](https://cloud.google.com/ruby/docs/reference/google-cloud-secret_manager-v1beta1/latest) +for class and method documentation. + +See also the [Product Documentation](https://cloud.google.com/secret-manager) +for general usage information. + +## Debug Logging + +This library comes with opt-in Debug Logging that can help you troubleshoot +your application's integration with the API. When logging is activated, key +events such as requests and responses, along with data payloads and metadata +such as headers and client configuration, are logged to the standard error +stream. + +**WARNING:** Client Library Debug Logging includes your data payloads in +plaintext, which could include sensitive data such as PII for yourself or your +customers, private keys, or other security data that could be compromising if +leaked. Always practice good data hygiene with your application logs, and follow +the principle of least access. Google also recommends that Client Library Debug +Logging be enabled only temporarily during active debugging, and not used +permanently in production. + +To enable logging, set the environment variable `GOOGLE_SDK_RUBY_LOGGING_GEMS` +to the value `all`. Alternatively, you can set the value to a comma-delimited +list of client library gem names. This will select the default logging behavior, +which writes logs to the standard error stream. On a local workstation, this may +result in logs appearing on the console. When running on a Google Cloud hosting +service such as [Google Cloud Run](https://cloud.google.com/run), this generally +results in logs appearing alongside your application logs in the +[Google Cloud Logging](https://cloud.google.com/logging/) service. + +You can customize logging by modifying the `logger` configuration when +constructing a client object. For example: + +```ruby +require "google/cloud/secret_manager/v1beta1" +require "logger" + +client = ::Google::Cloud::SecretManager::V1beta1::SecretManagerService::Client.new do |config| + config.logger = Logger.new "my-app.log" +end +``` + +## Google Cloud Samples + +To browse ready to use code samples check [Google Cloud Samples](https://cloud.google.com/docs/samples). + +## Supported Ruby Versions + +This library is supported on Ruby 3.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-secret_manager`, +and lower-level _versioned_ client libraries with names such as +`google-cloud-secret_manager-v1beta1`. +_In most cases, you should install the main client._ + +### What's the difference between the main client and a versioned client? + +A _versioned client_ provides a basic set of data types and client classes for +a _single version_ of a specific service. (That is, for a service with multiple +versions, there might be a separate versioned client for each service version.) +Most versioned clients are written and maintained by a code generator. + +The _main client_ is designed to provide you with the _recommended_ client +interfaces for the service. There will be only one main client for any given +service, even a service with multiple versions. The main client includes +factory methods for constructing the client objects we recommend for most +users. In some cases, those will be classes provided by an underlying versioned +client; in other cases, they will be handwritten higher-level client objects +with additional capabilities, convenience methods, or best practices built in. +Generally, the main client will default to a recommended service version, +although in some cases you can override this if you need to talk to a specific +service version. + +### Why would I want to use the main client? + +We recommend that most users install the main client gem for a service. You can +identify this gem as the one _without_ a version in its name, e.g. +`google-cloud-secret_manager`. +The main client is recommended because it will embody the best practices for +accessing the service, and may also provide more convenient interfaces or +tighter integration into frameworks and third-party libraries. In addition, the +documentation and samples published by Google will generally demonstrate use of +the main client. + +### Why would I want to use a versioned client? + +You can use a versioned client if you are content with a possibly lower-level +class interface, you explicitly want to avoid features provided by the main +client, or you want to access a specific service version not be covered by the +main client. You can identify versioned client gems because the service version +is part of the name, e.g. `google-cloud-secret_manager-v1beta1`. + +### What about the google-apis- clients? + +Client library gems with names that begin with `google-apis-` are based on an +older code generation technology. They talk to a REST/JSON backend (whereas +most modern clients talk to a [gRPC](https://grpc.io/) backend) and they may +not offer the same performance, features, and ease of use provided by more +modern clients. + +The `google-apis-` clients have wide coverage across Google services, so you +might need to use one if there is no modern client available for the service. +However, if a modern client is available, we generally recommend it over the +older `google-apis-` clients. diff --git a/owl-bot-staging/google-cloud-secret_manager-v1beta1/Rakefile b/owl-bot-staging/google-cloud-secret_manager-v1beta1/Rakefile new file mode 100644 index 000000000000..48d5c1256eec --- /dev/null +++ b/owl-bot-staging/google-cloud-secret_manager-v1beta1/Rakefile @@ -0,0 +1,169 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +require "bundler/setup" +require "bundler/gem_tasks" + +require "rubocop/rake_task" +RuboCop::RakeTask.new + +require "rake/testtask" +desc "Run tests." +Rake::TestTask.new do |t| + t.libs << "test" + t.test_files = FileList["test/**/*_test.rb"] + t.warning = false +end + +desc "Runs the smoke tests." +Rake::TestTask.new :smoke_test do |t| + t.test_files = FileList["acceptance/**/*smoke_test.rb"] + t.warning = false +end + +# Acceptance tests +desc "Run the google-cloud-secret_manager-v1beta1 acceptance tests." +task :acceptance, :project, :keyfile do |t, args| + project = args[:project] + project ||= + ENV["SECRET_MANAGER_TEST_PROJECT"] || + ENV["GCLOUD_TEST_PROJECT"] + keyfile = args[:keyfile] + keyfile ||= + ENV["SECRET_MANAGER_TEST_KEYFILE"] || + ENV["GCLOUD_TEST_KEYFILE"] + if keyfile + keyfile = File.read keyfile + else + keyfile ||= + ENV["SECRET_MANAGER_TEST_KEYFILE_JSON"] || + ENV["GCLOUD_TEST_KEYFILE_JSON"] + end + if project.nil? || keyfile.nil? + fail "You must provide a project and keyfile. e.g. rake acceptance[test123, /path/to/keyfile.json] or SECRET_MANAGER_TEST_PROJECT=test123 SECRET_MANAGER_TEST_KEYFILE=/path/to/keyfile.json rake acceptance" + end + require "google/cloud/secret_manager/v1beta1/secret_manager_service/credentials" + ::Google::Cloud::SecretManager::V1beta1::SecretManagerService::Credentials.env_vars.each do |path| + ENV[path] = nil + end + ENV["SECRET_MANAGER_PROJECT"] = project + ENV["SECRET_MANAGER_TEST_PROJECT"] = project + ENV["SECRET_MANAGER_KEYFILE_JSON"] = keyfile + + Rake::Task["acceptance:run"].invoke +end + +namespace :acceptance do + task :run do + if File.directory? "acceptance" + Rake::Task[:smoke_test].invoke + else + puts "The google-cloud-secret_manager-v1beta1 gem has no acceptance tests." + end + end + + desc "Run acceptance cleanup." + task :cleanup do + end +end + +task :samples do + Rake::Task["samples:latest"].invoke +end + +namespace :samples do + task :latest do + if File.directory? "samples" + Dir.chdir "samples" do + Bundler.with_clean_env do + ENV["GOOGLE_CLOUD_SAMPLES_TEST"] = "not_master" + sh "bundle update" + sh "bundle exec rake test" + end + end + else + puts "The google-cloud-secret_manager-v1beta1 gem has no samples to test." + end + end + + task :master do + if File.directory? "samples" + Dir.chdir "samples" do + Bundler.with_clean_env do + ENV["GOOGLE_CLOUD_SAMPLES_TEST"] = "master" + sh "bundle update" + sh "bundle exec rake test" + end + end + else + puts "The google-cloud-secret_manager-v1beta1 gem has no samples to test." + end + end +end + +require "yard" +require "yard/rake/yardoc_task" +YARD::Rake::YardocTask.new do |y| + y.options << "--fail-on-warning" +end + +desc "Run yard-doctest example tests." +task :doctest do + puts "The google-cloud-secret_manager-v1beta1 gem does not have doctest tests." +end + +desc "Run the CI build" +task :ci do + header "BUILDING google-cloud-secret_manager-v1beta1" + header "google-cloud-secret_manager-v1beta1 rubocop", "*" + Rake::Task[:rubocop].invoke + header "google-cloud-secret_manager-v1beta1 yard", "*" + Rake::Task[:yard].invoke + header "google-cloud-secret_manager-v1beta1 test", "*" + Rake::Task[:test].invoke +end + +namespace :ci do + desc "Run the CI build, with smoke tests." + task :smoke_test do + Rake::Task[:ci].invoke + header "google-cloud-secret_manager-v1beta1 smoke_test", "*" + Rake::Task[:smoke_test].invoke + end + desc "Run the CI build, with acceptance tests." + task :acceptance do + Rake::Task[:ci].invoke + header "google-cloud-secret_manager-v1beta1 acceptance", "*" + Rake::Task[:acceptance].invoke + end + task :a do + # This is a handy shortcut to save typing + Rake::Task["ci:acceptance"].invoke + end +end + +task default: :test + +def header str, token = "#" + line_length = str.length + 8 + puts "" + puts token * line_length + puts "#{token * 3} #{str} #{token * 3}" + puts token * line_length + puts "" +end diff --git a/owl-bot-staging/google-cloud-secret_manager-v1beta1/gapic_metadata.json b/owl-bot-staging/google-cloud-secret_manager-v1beta1/gapic_metadata.json new file mode 100644 index 000000000000..baf3eab359db --- /dev/null +++ b/owl-bot-staging/google-cloud-secret_manager-v1beta1/gapic_metadata.json @@ -0,0 +1,93 @@ +{ + "schema": "1.0", + "comment": "This file maps proto services/RPCs to the corresponding library clients/methods", + "language": "ruby", + "protoPackage": "google.cloud.secrets.v1beta1", + "libraryPackage": "::Google::Cloud::SecretManager::V1beta1", + "services": { + "SecretManagerService": { + "clients": { + "grpc": { + "libraryClient": "::Google::Cloud::SecretManager::V1beta1::SecretManagerService::Client", + "rpcs": { + "ListSecrets": { + "methods": [ + "list_secrets" + ] + }, + "CreateSecret": { + "methods": [ + "create_secret" + ] + }, + "AddSecretVersion": { + "methods": [ + "add_secret_version" + ] + }, + "GetSecret": { + "methods": [ + "get_secret" + ] + }, + "UpdateSecret": { + "methods": [ + "update_secret" + ] + }, + "DeleteSecret": { + "methods": [ + "delete_secret" + ] + }, + "ListSecretVersions": { + "methods": [ + "list_secret_versions" + ] + }, + "GetSecretVersion": { + "methods": [ + "get_secret_version" + ] + }, + "AccessSecretVersion": { + "methods": [ + "access_secret_version" + ] + }, + "DisableSecretVersion": { + "methods": [ + "disable_secret_version" + ] + }, + "EnableSecretVersion": { + "methods": [ + "enable_secret_version" + ] + }, + "DestroySecretVersion": { + "methods": [ + "destroy_secret_version" + ] + }, + "SetIamPolicy": { + "methods": [ + "set_iam_policy" + ] + }, + "GetIamPolicy": { + "methods": [ + "get_iam_policy" + ] + }, + "TestIamPermissions": { + "methods": [ + "test_iam_permissions" + ] + } + } + } + } + } + } +} diff --git a/owl-bot-staging/google-cloud-secret_manager-v1beta1/google-cloud-secret_manager-v1beta1.gemspec b/owl-bot-staging/google-cloud-secret_manager-v1beta1/google-cloud-secret_manager-v1beta1.gemspec new file mode 100644 index 000000000000..eac065289beb --- /dev/null +++ b/owl-bot-staging/google-cloud-secret_manager-v1beta1/google-cloud-secret_manager-v1beta1.gemspec @@ -0,0 +1,30 @@ +# -*- ruby -*- +# encoding: utf-8 + +require File.expand_path("lib/google/cloud/secret_manager/v1beta1/version", __dir__) + +Gem::Specification.new do |gem| + gem.name = "google-cloud-secret_manager-v1beta1" + gem.version = Google::Cloud::SecretManager::V1beta1::VERSION + + gem.authors = ["Google LLC"] + gem.email = "googleapis-packages@google.com" + gem.description = "Secret Manager is a secure and convenient storage system for API keys, passwords, certificates, and other sensitive data. Secret Manager provides a central place and single source of truth to manage, access, and audit secrets across Google Cloud. Note that google-cloud-secret_manager-v1beta1 is a version-specific client library. For most uses, we recommend installing the main client library google-cloud-secret_manager instead. See the readme for more details." + gem.summary = "Stores sensitive data such as API keys, passwords, and certificates. Provides convenience while improving security." + gem.homepage = "https://github.com/googleapis/google-cloud-ruby" + gem.license = "Apache-2.0" + + gem.platform = Gem::Platform::RUBY + + gem.files = `git ls-files -- lib/*`.split("\n") + + `git ls-files -- proto_docs/*`.split("\n") + + ["README.md", "LICENSE.md", "AUTHENTICATION.md", ".yardopts"] + gem.require_paths = ["lib"] + + gem.required_ruby_version = ">= 3.2" + + gem.add_dependency "gapic-common", "~> 1.2" + gem.add_dependency "google-cloud-errors", "~> 1.0" + gem.add_dependency "google-cloud-location", "~> 1.0" + gem.add_dependency "grpc-google-iam-v1", "~> 1.11" +end diff --git a/owl-bot-staging/google-cloud-secret_manager-v1beta1/lib/google-cloud-secret_manager-v1beta1.rb b/owl-bot-staging/google-cloud-secret_manager-v1beta1/lib/google-cloud-secret_manager-v1beta1.rb new file mode 100644 index 000000000000..5e930f08a7d9 --- /dev/null +++ b/owl-bot-staging/google-cloud-secret_manager-v1beta1/lib/google-cloud-secret_manager-v1beta1.rb @@ -0,0 +1,21 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +# This gem does not autoload during Bundler.require. To load this gem, +# issue explicit require statements for the packages desired, e.g.: +# require "google/cloud/secret_manager/v1beta1" diff --git a/owl-bot-staging/google-cloud-secret_manager-v1beta1/lib/google/cloud/secret_manager/v1beta1.rb b/owl-bot-staging/google-cloud-secret_manager-v1beta1/lib/google/cloud/secret_manager/v1beta1.rb new file mode 100644 index 000000000000..c73914ce8c82 --- /dev/null +++ b/owl-bot-staging/google-cloud-secret_manager-v1beta1/lib/google/cloud/secret_manager/v1beta1.rb @@ -0,0 +1,45 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +require "google/cloud/secret_manager/v1beta1/secret_manager_service" +require "google/cloud/secret_manager/v1beta1/version" + +module Google + module Cloud + module SecretManager + ## + # API client module. + # + # @example Load this package, including all its services, and instantiate a gRPC client + # + # require "google/cloud/secret_manager/v1beta1" + # client = ::Google::Cloud::SecretManager::V1beta1::SecretManagerService::Client.new + # + # @example Load this package, including all its services, and instantiate a REST client + # + # require "google/cloud/secret_manager/v1beta1" + # client = ::Google::Cloud::SecretManager::V1beta1::SecretManagerService::Rest::Client.new + # + module V1beta1 + end + end + end +end + +helper_path = ::File.join __dir__, "v1beta1", "_helpers.rb" +require "google/cloud/secret_manager/v1beta1/_helpers" if ::File.file? helper_path diff --git a/owl-bot-staging/google-cloud-secret_manager-v1beta1/lib/google/cloud/secret_manager/v1beta1/bindings_override.rb b/owl-bot-staging/google-cloud-secret_manager-v1beta1/lib/google/cloud/secret_manager/v1beta1/bindings_override.rb new file mode 100644 index 000000000000..0fadf3d51c06 --- /dev/null +++ b/owl-bot-staging/google-cloud-secret_manager-v1beta1/lib/google/cloud/secret_manager/v1beta1/bindings_override.rb @@ -0,0 +1,75 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +require "gapic/rest" + +module Google + module Cloud + module SecretManager + ## + # @example Loading just the REST part of this package, including all its services, and instantiating a REST client + # + # require "google/cloud/secret_manager/v1beta1/rest" + # client = ::Google::Cloud::SecretManager::V1beta1::SecretManagerService::Rest::Client.new + # + module V1beta1 + ## + # @private + # Initialize the mixin bindings configuration + # + def self.configure + @configure ||= begin + namespace = ["Google", "Cloud", "SecretManager"] + parent_config = while namespace.any? + parent_name = namespace.join "::" + parent_const = const_get parent_name + break parent_const.configure if parent_const.respond_to? :configure + namespace.pop + end + + default_config = ::Gapic::Rest::HttpBindingOverrideConfiguration.new parent_config + default_config.bindings_override["google.cloud.location.Locations.GetLocation"] = [ + Gapic::Rest::GrpcTranscoder::HttpBinding.create_with_validation( + uri_method: :get, + uri_template: "/v1beta1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/?$}, false] + ], + body: nil + ) + ] + default_config.bindings_override["google.cloud.location.Locations.ListLocations"] = [ + + Gapic::Rest::GrpcTranscoder::HttpBinding.create_with_validation( + uri_method: :get, + uri_template: "/v1beta1/{name}/locations", + matches: [ + ["name", %r{^projects/[^/]+/?$}, false] + ], + body: nil + ) + ] + default_config + end + yield @configure if block_given? + @configure + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-secret_manager-v1beta1/lib/google/cloud/secret_manager/v1beta1/rest.rb b/owl-bot-staging/google-cloud-secret_manager-v1beta1/lib/google/cloud/secret_manager/v1beta1/rest.rb new file mode 100644 index 000000000000..c97fa6acb0d9 --- /dev/null +++ b/owl-bot-staging/google-cloud-secret_manager-v1beta1/lib/google/cloud/secret_manager/v1beta1/rest.rb @@ -0,0 +1,38 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +require "google/cloud/secret_manager/v1beta1/secret_manager_service/rest" +require "google/cloud/secret_manager/v1beta1/bindings_override" +require "google/cloud/secret_manager/v1beta1/version" + +module Google + module Cloud + module SecretManager + ## + # To load just the REST part of this package, including all its services, and instantiate a REST client: + # + # @example + # + # require "google/cloud/secret_manager/v1beta1/rest" + # client = ::Google::Cloud::SecretManager::V1beta1::SecretManagerService::Rest::Client.new + # + module V1beta1 + end + end + end +end diff --git a/owl-bot-staging/google-cloud-secret_manager-v1beta1/lib/google/cloud/secret_manager/v1beta1/secret_manager_service.rb b/owl-bot-staging/google-cloud-secret_manager-v1beta1/lib/google/cloud/secret_manager/v1beta1/secret_manager_service.rb new file mode 100644 index 000000000000..7973da8d921f --- /dev/null +++ b/owl-bot-staging/google-cloud-secret_manager-v1beta1/lib/google/cloud/secret_manager/v1beta1/secret_manager_service.rb @@ -0,0 +1,61 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +require "gapic/common" +require "gapic/config" +require "gapic/config/method" + +require "google/cloud/secret_manager/v1beta1/version" + +require "google/cloud/secret_manager/v1beta1/secret_manager_service/credentials" +require "google/cloud/secret_manager/v1beta1/secret_manager_service/paths" +require "google/cloud/secret_manager/v1beta1/secret_manager_service/client" +require "google/cloud/secret_manager/v1beta1/secret_manager_service/rest" + +module Google + module Cloud + module SecretManager + module V1beta1 + ## + # Secret Manager Service + # + # Manages secrets and operations using those secrets. Implements a REST + # model with the following objects: + # + # * {::Google::Cloud::SecretManager::V1beta1::Secret Secret} + # * {::Google::Cloud::SecretManager::V1beta1::SecretVersion SecretVersion} + # + # @example Load this service and instantiate a gRPC client + # + # require "google/cloud/secret_manager/v1beta1/secret_manager_service" + # client = ::Google::Cloud::SecretManager::V1beta1::SecretManagerService::Client.new + # + # @example Load this service and instantiate a REST client + # + # require "google/cloud/secret_manager/v1beta1/secret_manager_service/rest" + # client = ::Google::Cloud::SecretManager::V1beta1::SecretManagerService::Rest::Client.new + # + module SecretManagerService + end + end + end + end +end + +helper_path = ::File.join __dir__, "secret_manager_service", "helpers.rb" +require "google/cloud/secret_manager/v1beta1/secret_manager_service/helpers" if ::File.file? helper_path diff --git a/owl-bot-staging/google-cloud-secret_manager-v1beta1/lib/google/cloud/secret_manager/v1beta1/secret_manager_service/client.rb b/owl-bot-staging/google-cloud-secret_manager-v1beta1/lib/google/cloud/secret_manager/v1beta1/secret_manager_service/client.rb new file mode 100644 index 000000000000..d8401f45108d --- /dev/null +++ b/owl-bot-staging/google-cloud-secret_manager-v1beta1/lib/google/cloud/secret_manager/v1beta1/secret_manager_service/client.rb @@ -0,0 +1,1942 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +require "google/cloud/errors" +require "google/cloud/secrets/v1beta1/service_pb" +require "google/cloud/location" + +module Google + module Cloud + module SecretManager + module V1beta1 + module SecretManagerService + ## + # Client for the SecretManagerService service. + # + # Secret Manager Service + # + # Manages secrets and operations using those secrets. Implements a REST + # model with the following objects: + # + # * {::Google::Cloud::SecretManager::V1beta1::Secret Secret} + # * {::Google::Cloud::SecretManager::V1beta1::SecretVersion SecretVersion} + # + class Client + # @private + API_VERSION = "" + + # @private + DEFAULT_ENDPOINT_TEMPLATE = "secretmanager.$UNIVERSE_DOMAIN$" + + include Paths + + # @private + attr_reader :secret_manager_service_stub + + ## + # Configure the SecretManagerService Client class. + # + # See {::Google::Cloud::SecretManager::V1beta1::SecretManagerService::Client::Configuration} + # for a description of the configuration fields. + # + # @example + # + # # Modify the configuration for all SecretManagerService clients + # ::Google::Cloud::SecretManager::V1beta1::SecretManagerService::Client.configure do |config| + # config.timeout = 10.0 + # end + # + # @yield [config] Configure the Client client. + # @yieldparam config [Client::Configuration] + # + # @return [Client::Configuration] + # + def self.configure + @configure ||= begin + namespace = ["Google", "Cloud", "SecretManager", "V1beta1"] + parent_config = while namespace.any? + parent_name = namespace.join "::" + parent_const = const_get parent_name + break parent_const.configure if parent_const.respond_to? :configure + namespace.pop + end + default_config = Client::Configuration.new parent_config + + default_config.rpcs.list_secrets.timeout = 60.0 + + default_config.rpcs.create_secret.timeout = 60.0 + + default_config.rpcs.add_secret_version.timeout = 60.0 + + default_config.rpcs.get_secret.timeout = 60.0 + + default_config.rpcs.update_secret.timeout = 60.0 + + default_config.rpcs.delete_secret.timeout = 60.0 + + default_config.rpcs.list_secret_versions.timeout = 60.0 + + default_config.rpcs.get_secret_version.timeout = 60.0 + + default_config.rpcs.access_secret_version.timeout = 60.0 + default_config.rpcs.access_secret_version.retry_policy = { + initial_delay: 1.0, max_delay: 60.0, multiplier: 1.3, retry_codes: [14, 2] + } + + default_config.rpcs.disable_secret_version.timeout = 60.0 + + default_config.rpcs.enable_secret_version.timeout = 60.0 + + default_config.rpcs.destroy_secret_version.timeout = 60.0 + + default_config.rpcs.set_iam_policy.timeout = 60.0 + + default_config.rpcs.get_iam_policy.timeout = 60.0 + + default_config.rpcs.test_iam_permissions.timeout = 60.0 + + default_config + end + yield @configure if block_given? + @configure + end + + ## + # Configure the SecretManagerService Client instance. + # + # The configuration is set to the derived mode, meaning that values can be changed, + # but structural changes (adding new fields, etc.) are not allowed. Structural changes + # should be made on {Client.configure}. + # + # See {::Google::Cloud::SecretManager::V1beta1::SecretManagerService::Client::Configuration} + # for a description of the configuration fields. + # + # @yield [config] Configure the Client client. + # @yieldparam config [Client::Configuration] + # + # @return [Client::Configuration] + # + def configure + yield @config if block_given? + @config + end + + ## + # The effective universe domain + # + # @return [String] + # + def universe_domain + @secret_manager_service_stub.universe_domain + end + + ## + # Create a new SecretManagerService client object. + # + # @example + # + # # Create a client using the default configuration + # client = ::Google::Cloud::SecretManager::V1beta1::SecretManagerService::Client.new + # + # # Create a client using a custom configuration + # client = ::Google::Cloud::SecretManager::V1beta1::SecretManagerService::Client.new do |config| + # config.timeout = 10.0 + # end + # + # @yield [config] Configure the SecretManagerService client. + # @yieldparam config [Client::Configuration] + # + def initialize + # These require statements are intentionally placed here to initialize + # the gRPC module only when it's required. + # See https://github.com/googleapis/toolkit/issues/446 + require "gapic/grpc" + require "google/cloud/secrets/v1beta1/service_services_pb" + + # Create the configuration object + @config = Configuration.new Client.configure + + # Yield the configuration if needed + yield @config if block_given? + + # Create credentials + credentials = @config.credentials + # Use self-signed JWT if the endpoint is unchanged from default, + # but only if the default endpoint does not have a region prefix. + enable_self_signed_jwt = @config.endpoint.nil? || + (@config.endpoint == Configuration::DEFAULT_ENDPOINT && + !@config.endpoint.split(".").first.include?("-")) + credentials ||= Credentials.default scope: @config.scope, + enable_self_signed_jwt: enable_self_signed_jwt + if credentials.is_a?(::String) || credentials.is_a?(::Hash) + credentials = Credentials.new credentials, scope: @config.scope + end + @quota_project_id = @config.quota_project + @quota_project_id ||= credentials.quota_project_id if credentials.respond_to? :quota_project_id + + @secret_manager_service_stub = ::Gapic::ServiceStub.new( + ::Google::Cloud::SecretManager::V1beta1::SecretManagerService::Stub, + credentials: credentials, + endpoint: @config.endpoint, + endpoint_template: DEFAULT_ENDPOINT_TEMPLATE, + universe_domain: @config.universe_domain, + channel_args: @config.channel_args, + interceptors: @config.interceptors, + channel_pool_config: @config.channel_pool, + logger: @config.logger + ) + + @secret_manager_service_stub.stub_logger&.info do |entry| + entry.set_system_name + entry.set_service + entry.message = "Created client for #{entry.service}" + entry.set_credentials_fields credentials + entry.set "customEndpoint", @config.endpoint if @config.endpoint + entry.set "defaultTimeout", @config.timeout if @config.timeout + entry.set "quotaProject", @quota_project_id if @quota_project_id + end + + @location_client = Google::Cloud::Location::Locations::Client.new do |config| + config.credentials = credentials + config.quota_project = @quota_project_id + config.endpoint = @secret_manager_service_stub.endpoint + config.universe_domain = @secret_manager_service_stub.universe_domain + config.logger = @secret_manager_service_stub.logger if config.respond_to? :logger= + end + end + + ## + # Get the associated client for mix-in of the Locations. + # + # @return [Google::Cloud::Location::Locations::Client] + # + attr_reader :location_client + + ## + # The logger used for request/response debug logging. + # + # @return [Logger] + # + def logger + @secret_manager_service_stub.logger + end + + # Service calls + + ## + # Lists {::Google::Cloud::SecretManager::V1beta1::Secret Secrets}. + # + # @overload list_secrets(request, options = nil) + # Pass arguments to `list_secrets` via a request object, either of type + # {::Google::Cloud::SecretManager::V1beta1::ListSecretsRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::SecretManager::V1beta1::ListSecretsRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. + # + # @overload list_secrets(parent: nil, page_size: nil, page_token: nil) + # Pass arguments to `list_secrets` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param parent [::String] + # Required. The resource name of the project associated with the + # {::Google::Cloud::SecretManager::V1beta1::Secret Secrets}, in the format `projects/*`. + # @param page_size [::Integer] + # Optional. The maximum number of results to be returned in a single page. If + # set to 0, the server decides the number of results to return. If the + # number is greater than 25000, it is capped at 25000. + # @param page_token [::String] + # Optional. Pagination token, returned earlier via + # {::Google::Cloud::SecretManager::V1beta1::ListSecretsResponse#next_page_token ListSecretsResponse.next_page_token}. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Gapic::PagedEnumerable<::Google::Cloud::SecretManager::V1beta1::Secret>] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Gapic::PagedEnumerable<::Google::Cloud::SecretManager::V1beta1::Secret>] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/secret_manager/v1beta1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::SecretManager::V1beta1::SecretManagerService::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::SecretManager::V1beta1::ListSecretsRequest.new + # + # # Call the list_secrets method. + # result = client.list_secrets request + # + # # The returned object is of type Gapic::PagedEnumerable. You can iterate + # # over elements, and API calls will be issued to fetch pages as needed. + # result.each do |item| + # # Each element is of type ::Google::Cloud::SecretManager::V1beta1::Secret. + # p item + # end + # + def list_secrets request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::SecretManager::V1beta1::ListSecretsRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + metadata = @config.rpcs.list_secrets.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::SecretManager::V1beta1::VERSION + metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.parent + header_params["parent"] = request.parent + end + + request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") + metadata[:"x-goog-request-params"] ||= request_params_header + + options.apply_defaults timeout: @config.rpcs.list_secrets.timeout, + metadata: metadata, + retry_policy: @config.rpcs.list_secrets.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @secret_manager_service_stub.call_rpc :list_secrets, request, options: options do |response, operation| + response = ::Gapic::PagedEnumerable.new @secret_manager_service_stub, :list_secrets, request, response, operation, options + yield response, operation if block_given? + throw :response, response + end + rescue ::GRPC::BadStatus => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Creates a new {::Google::Cloud::SecretManager::V1beta1::Secret Secret} containing no + # {::Google::Cloud::SecretManager::V1beta1::SecretVersion SecretVersions}. + # + # @overload create_secret(request, options = nil) + # Pass arguments to `create_secret` via a request object, either of type + # {::Google::Cloud::SecretManager::V1beta1::CreateSecretRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::SecretManager::V1beta1::CreateSecretRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. + # + # @overload create_secret(parent: nil, secret_id: nil, secret: nil) + # Pass arguments to `create_secret` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param parent [::String] + # Required. The resource name of the project to associate with the + # {::Google::Cloud::SecretManager::V1beta1::Secret Secret}, in the format `projects/*`. + # @param secret_id [::String] + # Required. This must be unique within the project. + # + # A secret ID is a string with a maximum length of 255 characters and can + # contain uppercase and lowercase letters, numerals, and the hyphen (`-`) and + # underscore (`_`) characters. + # @param secret [::Google::Cloud::SecretManager::V1beta1::Secret, ::Hash] + # Required. A {::Google::Cloud::SecretManager::V1beta1::Secret Secret} with initial + # field values. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Google::Cloud::SecretManager::V1beta1::Secret] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Google::Cloud::SecretManager::V1beta1::Secret] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/secret_manager/v1beta1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::SecretManager::V1beta1::SecretManagerService::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::SecretManager::V1beta1::CreateSecretRequest.new + # + # # Call the create_secret method. + # result = client.create_secret request + # + # # The returned object is of type Google::Cloud::SecretManager::V1beta1::Secret. + # p result + # + def create_secret request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::SecretManager::V1beta1::CreateSecretRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + metadata = @config.rpcs.create_secret.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::SecretManager::V1beta1::VERSION + metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.parent + header_params["parent"] = request.parent + end + + request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") + metadata[:"x-goog-request-params"] ||= request_params_header + + options.apply_defaults timeout: @config.rpcs.create_secret.timeout, + metadata: metadata, + retry_policy: @config.rpcs.create_secret.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @secret_manager_service_stub.call_rpc :create_secret, request, options: options do |response, operation| + yield response, operation if block_given? + end + rescue ::GRPC::BadStatus => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Creates a new {::Google::Cloud::SecretManager::V1beta1::SecretVersion SecretVersion} + # containing secret data and attaches it to an existing + # {::Google::Cloud::SecretManager::V1beta1::Secret Secret}. + # + # @overload add_secret_version(request, options = nil) + # Pass arguments to `add_secret_version` via a request object, either of type + # {::Google::Cloud::SecretManager::V1beta1::AddSecretVersionRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::SecretManager::V1beta1::AddSecretVersionRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. + # + # @overload add_secret_version(parent: nil, payload: nil) + # Pass arguments to `add_secret_version` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param parent [::String] + # Required. The resource name of the + # {::Google::Cloud::SecretManager::V1beta1::Secret Secret} to associate with the + # {::Google::Cloud::SecretManager::V1beta1::SecretVersion SecretVersion} in the format + # `projects/*/secrets/*`. + # @param payload [::Google::Cloud::SecretManager::V1beta1::SecretPayload, ::Hash] + # Required. The secret payload of the + # {::Google::Cloud::SecretManager::V1beta1::SecretVersion SecretVersion}. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Google::Cloud::SecretManager::V1beta1::SecretVersion] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Google::Cloud::SecretManager::V1beta1::SecretVersion] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/secret_manager/v1beta1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::SecretManager::V1beta1::SecretManagerService::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::SecretManager::V1beta1::AddSecretVersionRequest.new + # + # # Call the add_secret_version method. + # result = client.add_secret_version request + # + # # The returned object is of type Google::Cloud::SecretManager::V1beta1::SecretVersion. + # p result + # + def add_secret_version request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::SecretManager::V1beta1::AddSecretVersionRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + metadata = @config.rpcs.add_secret_version.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::SecretManager::V1beta1::VERSION + metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.parent + header_params["parent"] = request.parent + end + + request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") + metadata[:"x-goog-request-params"] ||= request_params_header + + options.apply_defaults timeout: @config.rpcs.add_secret_version.timeout, + metadata: metadata, + retry_policy: @config.rpcs.add_secret_version.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @secret_manager_service_stub.call_rpc :add_secret_version, request, options: options do |response, operation| + yield response, operation if block_given? + end + rescue ::GRPC::BadStatus => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Gets metadata for a given {::Google::Cloud::SecretManager::V1beta1::Secret Secret}. + # + # @overload get_secret(request, options = nil) + # Pass arguments to `get_secret` via a request object, either of type + # {::Google::Cloud::SecretManager::V1beta1::GetSecretRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::SecretManager::V1beta1::GetSecretRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. + # + # @overload get_secret(name: nil) + # Pass arguments to `get_secret` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param name [::String] + # Required. The resource name of the + # {::Google::Cloud::SecretManager::V1beta1::Secret Secret}, in the format + # `projects/*/secrets/*`. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Google::Cloud::SecretManager::V1beta1::Secret] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Google::Cloud::SecretManager::V1beta1::Secret] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/secret_manager/v1beta1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::SecretManager::V1beta1::SecretManagerService::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::SecretManager::V1beta1::GetSecretRequest.new + # + # # Call the get_secret method. + # result = client.get_secret request + # + # # The returned object is of type Google::Cloud::SecretManager::V1beta1::Secret. + # p result + # + def get_secret request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::SecretManager::V1beta1::GetSecretRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + metadata = @config.rpcs.get_secret.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::SecretManager::V1beta1::VERSION + metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.name + header_params["name"] = request.name + end + + request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") + metadata[:"x-goog-request-params"] ||= request_params_header + + options.apply_defaults timeout: @config.rpcs.get_secret.timeout, + metadata: metadata, + retry_policy: @config.rpcs.get_secret.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @secret_manager_service_stub.call_rpc :get_secret, request, options: options do |response, operation| + yield response, operation if block_given? + end + rescue ::GRPC::BadStatus => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Updates metadata of an existing + # {::Google::Cloud::SecretManager::V1beta1::Secret Secret}. + # + # @overload update_secret(request, options = nil) + # Pass arguments to `update_secret` via a request object, either of type + # {::Google::Cloud::SecretManager::V1beta1::UpdateSecretRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::SecretManager::V1beta1::UpdateSecretRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. + # + # @overload update_secret(secret: nil, update_mask: nil) + # Pass arguments to `update_secret` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param secret [::Google::Cloud::SecretManager::V1beta1::Secret, ::Hash] + # Required. {::Google::Cloud::SecretManager::V1beta1::Secret Secret} with updated field + # values. + # @param update_mask [::Google::Protobuf::FieldMask, ::Hash] + # Required. Specifies the fields to be updated. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Google::Cloud::SecretManager::V1beta1::Secret] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Google::Cloud::SecretManager::V1beta1::Secret] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/secret_manager/v1beta1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::SecretManager::V1beta1::SecretManagerService::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::SecretManager::V1beta1::UpdateSecretRequest.new + # + # # Call the update_secret method. + # result = client.update_secret request + # + # # The returned object is of type Google::Cloud::SecretManager::V1beta1::Secret. + # p result + # + def update_secret request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::SecretManager::V1beta1::UpdateSecretRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + metadata = @config.rpcs.update_secret.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::SecretManager::V1beta1::VERSION + metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.secret&.name + header_params["secret.name"] = request.secret.name + end + + request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") + metadata[:"x-goog-request-params"] ||= request_params_header + + options.apply_defaults timeout: @config.rpcs.update_secret.timeout, + metadata: metadata, + retry_policy: @config.rpcs.update_secret.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @secret_manager_service_stub.call_rpc :update_secret, request, options: options do |response, operation| + yield response, operation if block_given? + end + rescue ::GRPC::BadStatus => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Deletes a {::Google::Cloud::SecretManager::V1beta1::Secret Secret}. + # + # @overload delete_secret(request, options = nil) + # Pass arguments to `delete_secret` via a request object, either of type + # {::Google::Cloud::SecretManager::V1beta1::DeleteSecretRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::SecretManager::V1beta1::DeleteSecretRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. + # + # @overload delete_secret(name: nil) + # Pass arguments to `delete_secret` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param name [::String] + # Required. The resource name of the + # {::Google::Cloud::SecretManager::V1beta1::Secret Secret} to delete in the format + # `projects/*/secrets/*`. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Google::Protobuf::Empty] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Google::Protobuf::Empty] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/secret_manager/v1beta1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::SecretManager::V1beta1::SecretManagerService::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::SecretManager::V1beta1::DeleteSecretRequest.new + # + # # Call the delete_secret method. + # result = client.delete_secret request + # + # # The returned object is of type Google::Protobuf::Empty. + # p result + # + def delete_secret request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::SecretManager::V1beta1::DeleteSecretRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + metadata = @config.rpcs.delete_secret.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::SecretManager::V1beta1::VERSION + metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.name + header_params["name"] = request.name + end + + request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") + metadata[:"x-goog-request-params"] ||= request_params_header + + options.apply_defaults timeout: @config.rpcs.delete_secret.timeout, + metadata: metadata, + retry_policy: @config.rpcs.delete_secret.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @secret_manager_service_stub.call_rpc :delete_secret, request, options: options do |response, operation| + yield response, operation if block_given? + end + rescue ::GRPC::BadStatus => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Lists {::Google::Cloud::SecretManager::V1beta1::SecretVersion SecretVersions}. This + # call does not return secret data. + # + # @overload list_secret_versions(request, options = nil) + # Pass arguments to `list_secret_versions` via a request object, either of type + # {::Google::Cloud::SecretManager::V1beta1::ListSecretVersionsRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::SecretManager::V1beta1::ListSecretVersionsRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. + # + # @overload list_secret_versions(parent: nil, page_size: nil, page_token: nil) + # Pass arguments to `list_secret_versions` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param parent [::String] + # Required. The resource name of the + # {::Google::Cloud::SecretManager::V1beta1::Secret Secret} associated with the + # {::Google::Cloud::SecretManager::V1beta1::SecretVersion SecretVersions} to list, in + # the format `projects/*/secrets/*`. + # @param page_size [::Integer] + # Optional. The maximum number of results to be returned in a single page. If + # set to 0, the server decides the number of results to return. If the + # number is greater than 25000, it is capped at 25000. + # @param page_token [::String] + # Optional. Pagination token, returned earlier via + # ListSecretVersionsResponse.next_page_token][]. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Gapic::PagedEnumerable<::Google::Cloud::SecretManager::V1beta1::SecretVersion>] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Gapic::PagedEnumerable<::Google::Cloud::SecretManager::V1beta1::SecretVersion>] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/secret_manager/v1beta1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::SecretManager::V1beta1::SecretManagerService::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::SecretManager::V1beta1::ListSecretVersionsRequest.new + # + # # Call the list_secret_versions method. + # result = client.list_secret_versions request + # + # # The returned object is of type Gapic::PagedEnumerable. You can iterate + # # over elements, and API calls will be issued to fetch pages as needed. + # result.each do |item| + # # Each element is of type ::Google::Cloud::SecretManager::V1beta1::SecretVersion. + # p item + # end + # + def list_secret_versions request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::SecretManager::V1beta1::ListSecretVersionsRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + metadata = @config.rpcs.list_secret_versions.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::SecretManager::V1beta1::VERSION + metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.parent + header_params["parent"] = request.parent + end + + request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") + metadata[:"x-goog-request-params"] ||= request_params_header + + options.apply_defaults timeout: @config.rpcs.list_secret_versions.timeout, + metadata: metadata, + retry_policy: @config.rpcs.list_secret_versions.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @secret_manager_service_stub.call_rpc :list_secret_versions, request, options: options do |response, operation| + response = ::Gapic::PagedEnumerable.new @secret_manager_service_stub, :list_secret_versions, request, response, operation, options + yield response, operation if block_given? + throw :response, response + end + rescue ::GRPC::BadStatus => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Gets metadata for a + # {::Google::Cloud::SecretManager::V1beta1::SecretVersion SecretVersion}. + # + # `projects/*/secrets/*/versions/latest` is an alias to the `latest` + # {::Google::Cloud::SecretManager::V1beta1::SecretVersion SecretVersion}. + # + # @overload get_secret_version(request, options = nil) + # Pass arguments to `get_secret_version` via a request object, either of type + # {::Google::Cloud::SecretManager::V1beta1::GetSecretVersionRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::SecretManager::V1beta1::GetSecretVersionRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. + # + # @overload get_secret_version(name: nil) + # Pass arguments to `get_secret_version` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param name [::String] + # Required. The resource name of the + # {::Google::Cloud::SecretManager::V1beta1::SecretVersion SecretVersion} in the format + # `projects/*/secrets/*/versions/*`. + # `projects/*/secrets/*/versions/latest` is an alias to the `latest` + # {::Google::Cloud::SecretManager::V1beta1::SecretVersion SecretVersion}. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Google::Cloud::SecretManager::V1beta1::SecretVersion] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Google::Cloud::SecretManager::V1beta1::SecretVersion] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/secret_manager/v1beta1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::SecretManager::V1beta1::SecretManagerService::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::SecretManager::V1beta1::GetSecretVersionRequest.new + # + # # Call the get_secret_version method. + # result = client.get_secret_version request + # + # # The returned object is of type Google::Cloud::SecretManager::V1beta1::SecretVersion. + # p result + # + def get_secret_version request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::SecretManager::V1beta1::GetSecretVersionRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + metadata = @config.rpcs.get_secret_version.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::SecretManager::V1beta1::VERSION + metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.name + header_params["name"] = request.name + end + + request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") + metadata[:"x-goog-request-params"] ||= request_params_header + + options.apply_defaults timeout: @config.rpcs.get_secret_version.timeout, + metadata: metadata, + retry_policy: @config.rpcs.get_secret_version.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @secret_manager_service_stub.call_rpc :get_secret_version, request, options: options do |response, operation| + yield response, operation if block_given? + end + rescue ::GRPC::BadStatus => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Accesses a {::Google::Cloud::SecretManager::V1beta1::SecretVersion SecretVersion}. + # This call returns the secret data. + # + # `projects/*/secrets/*/versions/latest` is an alias to the `latest` + # {::Google::Cloud::SecretManager::V1beta1::SecretVersion SecretVersion}. + # + # @overload access_secret_version(request, options = nil) + # Pass arguments to `access_secret_version` via a request object, either of type + # {::Google::Cloud::SecretManager::V1beta1::AccessSecretVersionRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::SecretManager::V1beta1::AccessSecretVersionRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. + # + # @overload access_secret_version(name: nil) + # Pass arguments to `access_secret_version` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param name [::String] + # Required. The resource name of the + # {::Google::Cloud::SecretManager::V1beta1::SecretVersion SecretVersion} in the format + # `projects/*/secrets/*/versions/*`. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Google::Cloud::SecretManager::V1beta1::AccessSecretVersionResponse] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Google::Cloud::SecretManager::V1beta1::AccessSecretVersionResponse] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/secret_manager/v1beta1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::SecretManager::V1beta1::SecretManagerService::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::SecretManager::V1beta1::AccessSecretVersionRequest.new + # + # # Call the access_secret_version method. + # result = client.access_secret_version request + # + # # The returned object is of type Google::Cloud::SecretManager::V1beta1::AccessSecretVersionResponse. + # p result + # + def access_secret_version request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::SecretManager::V1beta1::AccessSecretVersionRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + metadata = @config.rpcs.access_secret_version.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::SecretManager::V1beta1::VERSION + metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.name + header_params["name"] = request.name + end + + request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") + metadata[:"x-goog-request-params"] ||= request_params_header + + options.apply_defaults timeout: @config.rpcs.access_secret_version.timeout, + metadata: metadata, + retry_policy: @config.rpcs.access_secret_version.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @secret_manager_service_stub.call_rpc :access_secret_version, request, options: options do |response, operation| + yield response, operation if block_given? + end + rescue ::GRPC::BadStatus => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Disables a {::Google::Cloud::SecretManager::V1beta1::SecretVersion SecretVersion}. + # + # Sets the {::Google::Cloud::SecretManager::V1beta1::SecretVersion#state state} of the + # {::Google::Cloud::SecretManager::V1beta1::SecretVersion SecretVersion} to + # {::Google::Cloud::SecretManager::V1beta1::SecretVersion::State::DISABLED DISABLED}. + # + # @overload disable_secret_version(request, options = nil) + # Pass arguments to `disable_secret_version` via a request object, either of type + # {::Google::Cloud::SecretManager::V1beta1::DisableSecretVersionRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::SecretManager::V1beta1::DisableSecretVersionRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. + # + # @overload disable_secret_version(name: nil) + # Pass arguments to `disable_secret_version` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param name [::String] + # Required. The resource name of the + # {::Google::Cloud::SecretManager::V1beta1::SecretVersion SecretVersion} to disable in + # the format `projects/*/secrets/*/versions/*`. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Google::Cloud::SecretManager::V1beta1::SecretVersion] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Google::Cloud::SecretManager::V1beta1::SecretVersion] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/secret_manager/v1beta1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::SecretManager::V1beta1::SecretManagerService::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::SecretManager::V1beta1::DisableSecretVersionRequest.new + # + # # Call the disable_secret_version method. + # result = client.disable_secret_version request + # + # # The returned object is of type Google::Cloud::SecretManager::V1beta1::SecretVersion. + # p result + # + def disable_secret_version request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::SecretManager::V1beta1::DisableSecretVersionRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + metadata = @config.rpcs.disable_secret_version.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::SecretManager::V1beta1::VERSION + metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.name + header_params["name"] = request.name + end + + request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") + metadata[:"x-goog-request-params"] ||= request_params_header + + options.apply_defaults timeout: @config.rpcs.disable_secret_version.timeout, + metadata: metadata, + retry_policy: @config.rpcs.disable_secret_version.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @secret_manager_service_stub.call_rpc :disable_secret_version, request, options: options do |response, operation| + yield response, operation if block_given? + end + rescue ::GRPC::BadStatus => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Enables a {::Google::Cloud::SecretManager::V1beta1::SecretVersion SecretVersion}. + # + # Sets the {::Google::Cloud::SecretManager::V1beta1::SecretVersion#state state} of the + # {::Google::Cloud::SecretManager::V1beta1::SecretVersion SecretVersion} to + # {::Google::Cloud::SecretManager::V1beta1::SecretVersion::State::ENABLED ENABLED}. + # + # @overload enable_secret_version(request, options = nil) + # Pass arguments to `enable_secret_version` via a request object, either of type + # {::Google::Cloud::SecretManager::V1beta1::EnableSecretVersionRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::SecretManager::V1beta1::EnableSecretVersionRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. + # + # @overload enable_secret_version(name: nil) + # Pass arguments to `enable_secret_version` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param name [::String] + # Required. The resource name of the + # {::Google::Cloud::SecretManager::V1beta1::SecretVersion SecretVersion} to enable in + # the format `projects/*/secrets/*/versions/*`. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Google::Cloud::SecretManager::V1beta1::SecretVersion] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Google::Cloud::SecretManager::V1beta1::SecretVersion] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/secret_manager/v1beta1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::SecretManager::V1beta1::SecretManagerService::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::SecretManager::V1beta1::EnableSecretVersionRequest.new + # + # # Call the enable_secret_version method. + # result = client.enable_secret_version request + # + # # The returned object is of type Google::Cloud::SecretManager::V1beta1::SecretVersion. + # p result + # + def enable_secret_version request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::SecretManager::V1beta1::EnableSecretVersionRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + metadata = @config.rpcs.enable_secret_version.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::SecretManager::V1beta1::VERSION + metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.name + header_params["name"] = request.name + end + + request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") + metadata[:"x-goog-request-params"] ||= request_params_header + + options.apply_defaults timeout: @config.rpcs.enable_secret_version.timeout, + metadata: metadata, + retry_policy: @config.rpcs.enable_secret_version.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @secret_manager_service_stub.call_rpc :enable_secret_version, request, options: options do |response, operation| + yield response, operation if block_given? + end + rescue ::GRPC::BadStatus => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Destroys a {::Google::Cloud::SecretManager::V1beta1::SecretVersion SecretVersion}. + # + # Sets the {::Google::Cloud::SecretManager::V1beta1::SecretVersion#state state} of the + # {::Google::Cloud::SecretManager::V1beta1::SecretVersion SecretVersion} to + # {::Google::Cloud::SecretManager::V1beta1::SecretVersion::State::DESTROYED DESTROYED} and + # irrevocably destroys the secret data. + # + # @overload destroy_secret_version(request, options = nil) + # Pass arguments to `destroy_secret_version` via a request object, either of type + # {::Google::Cloud::SecretManager::V1beta1::DestroySecretVersionRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::SecretManager::V1beta1::DestroySecretVersionRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. + # + # @overload destroy_secret_version(name: nil) + # Pass arguments to `destroy_secret_version` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param name [::String] + # Required. The resource name of the + # {::Google::Cloud::SecretManager::V1beta1::SecretVersion SecretVersion} to destroy in + # the format `projects/*/secrets/*/versions/*`. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Google::Cloud::SecretManager::V1beta1::SecretVersion] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Google::Cloud::SecretManager::V1beta1::SecretVersion] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/secret_manager/v1beta1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::SecretManager::V1beta1::SecretManagerService::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::SecretManager::V1beta1::DestroySecretVersionRequest.new + # + # # Call the destroy_secret_version method. + # result = client.destroy_secret_version request + # + # # The returned object is of type Google::Cloud::SecretManager::V1beta1::SecretVersion. + # p result + # + def destroy_secret_version request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::SecretManager::V1beta1::DestroySecretVersionRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + metadata = @config.rpcs.destroy_secret_version.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::SecretManager::V1beta1::VERSION + metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.name + header_params["name"] = request.name + end + + request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") + metadata[:"x-goog-request-params"] ||= request_params_header + + options.apply_defaults timeout: @config.rpcs.destroy_secret_version.timeout, + metadata: metadata, + retry_policy: @config.rpcs.destroy_secret_version.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @secret_manager_service_stub.call_rpc :destroy_secret_version, request, options: options do |response, operation| + yield response, operation if block_given? + end + rescue ::GRPC::BadStatus => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Sets the access control policy on the specified secret. Replaces any + # existing policy. + # + # Permissions on {::Google::Cloud::SecretManager::V1beta1::SecretVersion SecretVersions} + # are enforced according to the policy set on the associated + # {::Google::Cloud::SecretManager::V1beta1::Secret Secret}. + # + # @overload set_iam_policy(request, options = nil) + # Pass arguments to `set_iam_policy` via a request object, either of type + # {::Google::Iam::V1::SetIamPolicyRequest} or an equivalent Hash. + # + # @param request [::Google::Iam::V1::SetIamPolicyRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. + # + # @overload set_iam_policy(resource: nil, policy: nil, update_mask: nil) + # Pass arguments to `set_iam_policy` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param resource [::String] + # REQUIRED: The resource for which the policy is being specified. + # See the operation documentation for the appropriate value for this field. + # @param policy [::Google::Iam::V1::Policy, ::Hash] + # REQUIRED: The complete policy to be applied to the `resource`. The size of + # the policy is limited to a few 10s of KB. An empty policy is a + # valid policy but certain Cloud Platform services (such as Projects) + # might reject them. + # @param update_mask [::Google::Protobuf::FieldMask, ::Hash] + # OPTIONAL: A FieldMask specifying which fields of the policy to modify. Only + # the fields in the mask will be modified. If no mask is provided, the + # following default mask is used: + # + # `paths: "bindings, etag"` + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Google::Iam::V1::Policy] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Google::Iam::V1::Policy] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/secret_manager/v1beta1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::SecretManager::V1beta1::SecretManagerService::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Iam::V1::SetIamPolicyRequest.new + # + # # Call the set_iam_policy method. + # result = client.set_iam_policy request + # + # # The returned object is of type Google::Iam::V1::Policy. + # p result + # + def set_iam_policy request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Iam::V1::SetIamPolicyRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + metadata = @config.rpcs.set_iam_policy.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::SecretManager::V1beta1::VERSION + metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.resource + header_params["resource"] = request.resource + end + + request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") + metadata[:"x-goog-request-params"] ||= request_params_header + + options.apply_defaults timeout: @config.rpcs.set_iam_policy.timeout, + metadata: metadata, + retry_policy: @config.rpcs.set_iam_policy.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @secret_manager_service_stub.call_rpc :set_iam_policy, request, options: options do |response, operation| + yield response, operation if block_given? + end + rescue ::GRPC::BadStatus => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Gets the access control policy for a secret. + # Returns empty policy if the secret exists and does not have a policy set. + # + # @overload get_iam_policy(request, options = nil) + # Pass arguments to `get_iam_policy` via a request object, either of type + # {::Google::Iam::V1::GetIamPolicyRequest} or an equivalent Hash. + # + # @param request [::Google::Iam::V1::GetIamPolicyRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. + # + # @overload get_iam_policy(resource: nil, options: nil) + # Pass arguments to `get_iam_policy` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param resource [::String] + # REQUIRED: The resource for which the policy is being requested. + # See the operation documentation for the appropriate value for this field. + # @param options [::Google::Iam::V1::GetPolicyOptions, ::Hash] + # OPTIONAL: A `GetPolicyOptions` object for specifying options to + # `GetIamPolicy`. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Google::Iam::V1::Policy] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Google::Iam::V1::Policy] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/secret_manager/v1beta1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::SecretManager::V1beta1::SecretManagerService::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Iam::V1::GetIamPolicyRequest.new + # + # # Call the get_iam_policy method. + # result = client.get_iam_policy request + # + # # The returned object is of type Google::Iam::V1::Policy. + # p result + # + def get_iam_policy request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Iam::V1::GetIamPolicyRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + metadata = @config.rpcs.get_iam_policy.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::SecretManager::V1beta1::VERSION + metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.resource + header_params["resource"] = request.resource + end + + request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") + metadata[:"x-goog-request-params"] ||= request_params_header + + options.apply_defaults timeout: @config.rpcs.get_iam_policy.timeout, + metadata: metadata, + retry_policy: @config.rpcs.get_iam_policy.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @secret_manager_service_stub.call_rpc :get_iam_policy, request, options: options do |response, operation| + yield response, operation if block_given? + end + rescue ::GRPC::BadStatus => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Returns permissions that a caller has for the specified secret. + # If the secret does not exist, this call returns an empty set of + # permissions, not a NOT_FOUND error. + # + # Note: This operation is designed to be used for building permission-aware + # UIs and command-line tools, not for authorization checking. This operation + # may "fail open" without warning. + # + # @overload test_iam_permissions(request, options = nil) + # Pass arguments to `test_iam_permissions` via a request object, either of type + # {::Google::Iam::V1::TestIamPermissionsRequest} or an equivalent Hash. + # + # @param request [::Google::Iam::V1::TestIamPermissionsRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. + # + # @overload test_iam_permissions(resource: nil, permissions: nil) + # Pass arguments to `test_iam_permissions` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param resource [::String] + # REQUIRED: The resource for which the policy detail is being requested. + # See the operation documentation for the appropriate value for this field. + # @param permissions [::Array<::String>] + # The set of permissions to check for the `resource`. Permissions with + # wildcards (such as '*' or 'storage.*') are not allowed. For more + # information see + # [IAM Overview](https://cloud.google.com/iam/docs/overview#permissions). + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Google::Iam::V1::TestIamPermissionsResponse] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Google::Iam::V1::TestIamPermissionsResponse] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/secret_manager/v1beta1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::SecretManager::V1beta1::SecretManagerService::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Iam::V1::TestIamPermissionsRequest.new + # + # # Call the test_iam_permissions method. + # result = client.test_iam_permissions request + # + # # The returned object is of type Google::Iam::V1::TestIamPermissionsResponse. + # p result + # + def test_iam_permissions request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Iam::V1::TestIamPermissionsRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + metadata = @config.rpcs.test_iam_permissions.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::SecretManager::V1beta1::VERSION + metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.resource + header_params["resource"] = request.resource + end + + request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") + metadata[:"x-goog-request-params"] ||= request_params_header + + options.apply_defaults timeout: @config.rpcs.test_iam_permissions.timeout, + metadata: metadata, + retry_policy: @config.rpcs.test_iam_permissions.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @secret_manager_service_stub.call_rpc :test_iam_permissions, request, options: options do |response, operation| + yield response, operation if block_given? + end + rescue ::GRPC::BadStatus => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Configuration class for the SecretManagerService API. + # + # This class represents the configuration for SecretManagerService, + # providing control over timeouts, retry behavior, logging, transport + # parameters, and other low-level controls. Certain parameters can also be + # applied individually to specific RPCs. See + # {::Google::Cloud::SecretManager::V1beta1::SecretManagerService::Client::Configuration::Rpcs} + # for a list of RPCs that can be configured independently. + # + # Configuration can be applied globally to all clients, or to a single client + # on construction. + # + # @example + # + # # Modify the global config, setting the timeout for + # # list_secrets to 20 seconds, + # # and all remaining timeouts to 10 seconds. + # ::Google::Cloud::SecretManager::V1beta1::SecretManagerService::Client.configure do |config| + # config.timeout = 10.0 + # config.rpcs.list_secrets.timeout = 20.0 + # end + # + # # Apply the above configuration only to a new client. + # client = ::Google::Cloud::SecretManager::V1beta1::SecretManagerService::Client.new do |config| + # config.timeout = 10.0 + # config.rpcs.list_secrets.timeout = 20.0 + # end + # + # @!attribute [rw] endpoint + # A custom service endpoint, as a hostname or hostname:port. The default is + # nil, indicating to use the default endpoint in the current universe domain. + # @return [::String,nil] + # @!attribute [rw] credentials + # Credentials to send with calls. You may provide any of the following types: + # * (`Google::Auth::Credentials`) A googleauth credentials object + # (see the [googleauth docs](https://rubydoc.info/gems/googleauth/Google/Auth/Credentials)) + # * (`Signet::OAuth2::Client`) A signet oauth2 client object + # (see the [signet docs](https://rubydoc.info/gems/signet/Signet/OAuth2/Client)) + # * (`GRPC::Core::Channel`) a gRPC channel with included credentials + # * (`GRPC::Core::ChannelCredentials`) a gRPC credentails object + # * (`nil`) indicating no credentials + # + # @note Warning: Passing a `String` to a keyfile path or a `Hash` of credentials + # is deprecated. Providing an unvalidated credential configuration to + # Google APIs can compromise the security of your systems and data. + # + # @example + # + # # The recommended way to provide credentials is to use the `make_creds` method + # # on the appropriate credentials class for your environment. + # + # require "googleauth" + # + # credentials = ::Google::Auth::ServiceAccountCredentials.make_creds( + # json_key_io: ::File.open("/path/to/keyfile.json") + # ) + # + # client = ::Google::Cloud::SecretManager::V1beta1::SecretManagerService::Client.new do |config| + # config.credentials = credentials + # end + # + # @note Warning: If you accept a credential configuration (JSON file or Hash) from an + # external source for authentication to Google Cloud, you must validate it before + # providing it to a Google API client library. Providing an unvalidated credential + # configuration to Google APIs can compromise the security of your systems and data. + # For more information, refer to [Validate credential configurations from external + # sources](https://cloud.google.com/docs/authentication/external/externally-sourced-credentials). + # @return [::Object] + # @!attribute [rw] scope + # The OAuth scopes + # @return [::Array<::String>] + # @!attribute [rw] lib_name + # The library name as recorded in instrumentation and logging + # @return [::String] + # @!attribute [rw] lib_version + # The library version as recorded in instrumentation and logging + # @return [::String] + # @!attribute [rw] channel_args + # Extra parameters passed to the gRPC channel. Note: this is ignored if a + # `GRPC::Core::Channel` object is provided as the credential. + # @return [::Hash] + # @!attribute [rw] interceptors + # An array of interceptors that are run before calls are executed. + # @return [::Array<::GRPC::ClientInterceptor>] + # @!attribute [rw] timeout + # The call timeout in seconds. + # @return [::Numeric] + # @!attribute [rw] metadata + # Additional gRPC headers to be sent with the call. + # @return [::Hash{::Symbol=>::String}] + # @!attribute [rw] retry_policy + # The retry policy. The value is a hash with the following keys: + # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds. + # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds. + # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier. + # * `:retry_codes` (*type:* `Array`) - The error codes that should + # trigger a retry. + # @return [::Hash] + # @!attribute [rw] quota_project + # A separate project against which to charge quota. + # @return [::String] + # @!attribute [rw] universe_domain + # The universe domain within which to make requests. This determines the + # default endpoint URL. The default value of nil uses the environment + # universe (usually the default "googleapis.com" universe). + # @return [::String,nil] + # @!attribute [rw] logger + # A custom logger to use for request/response debug logging, or the value + # `:default` (the default) to construct a default logger, or `nil` to + # explicitly disable logging. + # @return [::Logger,:default,nil] + # + class Configuration + extend ::Gapic::Config + + # @private + # The endpoint specific to the default "googleapis.com" universe. Deprecated. + DEFAULT_ENDPOINT = "secretmanager.googleapis.com" + + config_attr :endpoint, nil, ::String, nil + config_attr :credentials, nil do |value| + allowed = [::String, ::Hash, ::Proc, ::Symbol, ::Google::Auth::Credentials, ::Google::Auth::BaseClient, ::Signet::OAuth2::Client, nil] + allowed += [::GRPC::Core::Channel, ::GRPC::Core::ChannelCredentials] if defined? ::GRPC::Core::Channel + allowed.any? { |klass| klass === value } + end + config_attr :scope, nil, ::String, ::Array, nil + config_attr :lib_name, nil, ::String, nil + config_attr :lib_version, nil, ::String, nil + config_attr(:channel_args, { "grpc.service_config_disable_resolution" => 1 }, ::Hash, nil) + config_attr :interceptors, nil, ::Array, nil + config_attr :timeout, nil, ::Numeric, nil + config_attr :metadata, nil, ::Hash, nil + config_attr :retry_policy, nil, ::Hash, ::Proc, nil + config_attr :quota_project, nil, ::String, nil + config_attr :universe_domain, nil, ::String, nil + config_attr :logger, :default, ::Logger, nil, :default + + # @private + def initialize parent_config = nil + @parent_config = parent_config unless parent_config.nil? + + yield self if block_given? + end + + ## + # Configurations for individual RPCs + # @return [Rpcs] + # + def rpcs + @rpcs ||= begin + parent_rpcs = nil + parent_rpcs = @parent_config.rpcs if defined?(@parent_config) && @parent_config.respond_to?(:rpcs) + Rpcs.new parent_rpcs + end + end + + ## + # Configuration for the channel pool + # @return [::Gapic::ServiceStub::ChannelPool::Configuration] + # + def channel_pool + @channel_pool ||= ::Gapic::ServiceStub::ChannelPool::Configuration.new + end + + ## + # Configuration RPC class for the SecretManagerService API. + # + # Includes fields providing the configuration for each RPC in this service. + # Each configuration object is of type `Gapic::Config::Method` and includes + # the following configuration fields: + # + # * `timeout` (*type:* `Numeric`) - The call timeout in seconds + # * `metadata` (*type:* `Hash{Symbol=>String}`) - Additional gRPC headers + # * `retry_policy (*type:* `Hash`) - The retry policy. The policy fields + # include the following keys: + # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds. + # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds. + # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier. + # * `:retry_codes` (*type:* `Array`) - The error codes that should + # trigger a retry. + # + class Rpcs + ## + # RPC-specific configuration for `list_secrets` + # @return [::Gapic::Config::Method] + # + attr_reader :list_secrets + ## + # RPC-specific configuration for `create_secret` + # @return [::Gapic::Config::Method] + # + attr_reader :create_secret + ## + # RPC-specific configuration for `add_secret_version` + # @return [::Gapic::Config::Method] + # + attr_reader :add_secret_version + ## + # RPC-specific configuration for `get_secret` + # @return [::Gapic::Config::Method] + # + attr_reader :get_secret + ## + # RPC-specific configuration for `update_secret` + # @return [::Gapic::Config::Method] + # + attr_reader :update_secret + ## + # RPC-specific configuration for `delete_secret` + # @return [::Gapic::Config::Method] + # + attr_reader :delete_secret + ## + # RPC-specific configuration for `list_secret_versions` + # @return [::Gapic::Config::Method] + # + attr_reader :list_secret_versions + ## + # RPC-specific configuration for `get_secret_version` + # @return [::Gapic::Config::Method] + # + attr_reader :get_secret_version + ## + # RPC-specific configuration for `access_secret_version` + # @return [::Gapic::Config::Method] + # + attr_reader :access_secret_version + ## + # RPC-specific configuration for `disable_secret_version` + # @return [::Gapic::Config::Method] + # + attr_reader :disable_secret_version + ## + # RPC-specific configuration for `enable_secret_version` + # @return [::Gapic::Config::Method] + # + attr_reader :enable_secret_version + ## + # RPC-specific configuration for `destroy_secret_version` + # @return [::Gapic::Config::Method] + # + attr_reader :destroy_secret_version + ## + # RPC-specific configuration for `set_iam_policy` + # @return [::Gapic::Config::Method] + # + attr_reader :set_iam_policy + ## + # RPC-specific configuration for `get_iam_policy` + # @return [::Gapic::Config::Method] + # + attr_reader :get_iam_policy + ## + # RPC-specific configuration for `test_iam_permissions` + # @return [::Gapic::Config::Method] + # + attr_reader :test_iam_permissions + + # @private + def initialize parent_rpcs = nil + list_secrets_config = parent_rpcs.list_secrets if parent_rpcs.respond_to? :list_secrets + @list_secrets = ::Gapic::Config::Method.new list_secrets_config + create_secret_config = parent_rpcs.create_secret if parent_rpcs.respond_to? :create_secret + @create_secret = ::Gapic::Config::Method.new create_secret_config + add_secret_version_config = parent_rpcs.add_secret_version if parent_rpcs.respond_to? :add_secret_version + @add_secret_version = ::Gapic::Config::Method.new add_secret_version_config + get_secret_config = parent_rpcs.get_secret if parent_rpcs.respond_to? :get_secret + @get_secret = ::Gapic::Config::Method.new get_secret_config + update_secret_config = parent_rpcs.update_secret if parent_rpcs.respond_to? :update_secret + @update_secret = ::Gapic::Config::Method.new update_secret_config + delete_secret_config = parent_rpcs.delete_secret if parent_rpcs.respond_to? :delete_secret + @delete_secret = ::Gapic::Config::Method.new delete_secret_config + list_secret_versions_config = parent_rpcs.list_secret_versions if parent_rpcs.respond_to? :list_secret_versions + @list_secret_versions = ::Gapic::Config::Method.new list_secret_versions_config + get_secret_version_config = parent_rpcs.get_secret_version if parent_rpcs.respond_to? :get_secret_version + @get_secret_version = ::Gapic::Config::Method.new get_secret_version_config + access_secret_version_config = parent_rpcs.access_secret_version if parent_rpcs.respond_to? :access_secret_version + @access_secret_version = ::Gapic::Config::Method.new access_secret_version_config + disable_secret_version_config = parent_rpcs.disable_secret_version if parent_rpcs.respond_to? :disable_secret_version + @disable_secret_version = ::Gapic::Config::Method.new disable_secret_version_config + enable_secret_version_config = parent_rpcs.enable_secret_version if parent_rpcs.respond_to? :enable_secret_version + @enable_secret_version = ::Gapic::Config::Method.new enable_secret_version_config + destroy_secret_version_config = parent_rpcs.destroy_secret_version if parent_rpcs.respond_to? :destroy_secret_version + @destroy_secret_version = ::Gapic::Config::Method.new destroy_secret_version_config + set_iam_policy_config = parent_rpcs.set_iam_policy if parent_rpcs.respond_to? :set_iam_policy + @set_iam_policy = ::Gapic::Config::Method.new set_iam_policy_config + get_iam_policy_config = parent_rpcs.get_iam_policy if parent_rpcs.respond_to? :get_iam_policy + @get_iam_policy = ::Gapic::Config::Method.new get_iam_policy_config + test_iam_permissions_config = parent_rpcs.test_iam_permissions if parent_rpcs.respond_to? :test_iam_permissions + @test_iam_permissions = ::Gapic::Config::Method.new test_iam_permissions_config + + yield self if block_given? + end + end + end + end + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-secret_manager-v1beta1/lib/google/cloud/secret_manager/v1beta1/secret_manager_service/credentials.rb b/owl-bot-staging/google-cloud-secret_manager-v1beta1/lib/google/cloud/secret_manager/v1beta1/secret_manager_service/credentials.rb new file mode 100644 index 000000000000..3fe96f0aee79 --- /dev/null +++ b/owl-bot-staging/google-cloud-secret_manager-v1beta1/lib/google/cloud/secret_manager/v1beta1/secret_manager_service/credentials.rb @@ -0,0 +1,51 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +require "googleauth" + +module Google + module Cloud + module SecretManager + module V1beta1 + module SecretManagerService + # Credentials for the SecretManagerService API. + class Credentials < ::Google::Auth::Credentials + self.scope = [ + "https://www.googleapis.com/auth/cloud-platform" + ] + self.env_vars = [ + "SECRET_MANAGER_CREDENTIALS", + "SECRET_MANAGER_KEYFILE", + "GOOGLE_CLOUD_CREDENTIALS", + "GOOGLE_CLOUD_KEYFILE", + "GCLOUD_KEYFILE", + "SECRET_MANAGER_CREDENTIALS_JSON", + "SECRET_MANAGER_KEYFILE_JSON", + "GOOGLE_CLOUD_CREDENTIALS_JSON", + "GOOGLE_CLOUD_KEYFILE_JSON", + "GCLOUD_KEYFILE_JSON" + ] + self.paths = [ + "~/.config/google_cloud/application_default_credentials.json" + ] + end + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-secret_manager-v1beta1/lib/google/cloud/secret_manager/v1beta1/secret_manager_service/paths.rb b/owl-bot-staging/google-cloud-secret_manager-v1beta1/lib/google/cloud/secret_manager/v1beta1/secret_manager_service/paths.rb new file mode 100644 index 000000000000..504b57a7a147 --- /dev/null +++ b/owl-bot-staging/google-cloud-secret_manager-v1beta1/lib/google/cloud/secret_manager/v1beta1/secret_manager_service/paths.rb @@ -0,0 +1,83 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + + +module Google + module Cloud + module SecretManager + module V1beta1 + module SecretManagerService + # Path helper methods for the SecretManagerService API. + module Paths + ## + # Create a fully-qualified Project resource string. + # + # The resource will be in the following format: + # + # `projects/{project}` + # + # @param project [String] + # + # @return [::String] + def project_path project: + "projects/#{project}" + end + + ## + # Create a fully-qualified Secret resource string. + # + # The resource will be in the following format: + # + # `projects/{project}/secrets/{secret}` + # + # @param project [String] + # @param secret [String] + # + # @return [::String] + def secret_path project:, secret: + raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" + + "projects/#{project}/secrets/#{secret}" + end + + ## + # Create a fully-qualified SecretVersion resource string. + # + # The resource will be in the following format: + # + # `projects/{project}/secrets/{secret}/versions/{secret_version}` + # + # @param project [String] + # @param secret [String] + # @param secret_version [String] + # + # @return [::String] + def secret_version_path project:, secret:, secret_version: + raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" + raise ::ArgumentError, "secret cannot contain /" if secret.to_s.include? "/" + + "projects/#{project}/secrets/#{secret}/versions/#{secret_version}" + end + + extend self + end + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-secret_manager-v1beta1/lib/google/cloud/secret_manager/v1beta1/secret_manager_service/rest.rb b/owl-bot-staging/google-cloud-secret_manager-v1beta1/lib/google/cloud/secret_manager/v1beta1/secret_manager_service/rest.rb new file mode 100644 index 000000000000..06dc1cced025 --- /dev/null +++ b/owl-bot-staging/google-cloud-secret_manager-v1beta1/lib/google/cloud/secret_manager/v1beta1/secret_manager_service/rest.rb @@ -0,0 +1,59 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +require "gapic/rest" +require "gapic/config" +require "gapic/config/method" + +require "google/cloud/secret_manager/v1beta1/version" +require "google/cloud/secret_manager/v1beta1/bindings_override" + +require "google/cloud/secret_manager/v1beta1/secret_manager_service/credentials" +require "google/cloud/secret_manager/v1beta1/secret_manager_service/paths" +require "google/cloud/secret_manager/v1beta1/secret_manager_service/rest/client" + +module Google + module Cloud + module SecretManager + module V1beta1 + ## + # Secret Manager Service + # + # Manages secrets and operations using those secrets. Implements a REST + # model with the following objects: + # + # * {::Google::Cloud::SecretManager::V1beta1::Secret Secret} + # * {::Google::Cloud::SecretManager::V1beta1::SecretVersion SecretVersion} + # + # To load this service and instantiate a REST client: + # + # require "google/cloud/secret_manager/v1beta1/secret_manager_service/rest" + # client = ::Google::Cloud::SecretManager::V1beta1::SecretManagerService::Rest::Client.new + # + module SecretManagerService + # Client for the REST transport + module Rest + end + end + end + end + end +end + +helper_path = ::File.join __dir__, "rest", "helpers.rb" +require "google/cloud/secret_manager/v1beta1/secret_manager_service/rest/helpers" if ::File.file? helper_path diff --git a/owl-bot-staging/google-cloud-secret_manager-v1beta1/lib/google/cloud/secret_manager/v1beta1/secret_manager_service/rest/client.rb b/owl-bot-staging/google-cloud-secret_manager-v1beta1/lib/google/cloud/secret_manager/v1beta1/secret_manager_service/rest/client.rb new file mode 100644 index 000000000000..ca13388815e1 --- /dev/null +++ b/owl-bot-staging/google-cloud-secret_manager-v1beta1/lib/google/cloud/secret_manager/v1beta1/secret_manager_service/rest/client.rb @@ -0,0 +1,1802 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +require "google/cloud/errors" +require "google/cloud/secrets/v1beta1/service_pb" +require "google/cloud/secret_manager/v1beta1/secret_manager_service/rest/service_stub" +require "google/cloud/location/rest" + +module Google + module Cloud + module SecretManager + module V1beta1 + module SecretManagerService + module Rest + ## + # REST client for the SecretManagerService service. + # + # Secret Manager Service + # + # Manages secrets and operations using those secrets. Implements a REST + # model with the following objects: + # + # * {::Google::Cloud::SecretManager::V1beta1::Secret Secret} + # * {::Google::Cloud::SecretManager::V1beta1::SecretVersion SecretVersion} + # + class Client + # @private + API_VERSION = "" + + # @private + DEFAULT_ENDPOINT_TEMPLATE = "secretmanager.$UNIVERSE_DOMAIN$" + + include Paths + + # @private + attr_reader :secret_manager_service_stub + + ## + # Configure the SecretManagerService Client class. + # + # See {::Google::Cloud::SecretManager::V1beta1::SecretManagerService::Rest::Client::Configuration} + # for a description of the configuration fields. + # + # @example + # + # # Modify the configuration for all SecretManagerService clients + # ::Google::Cloud::SecretManager::V1beta1::SecretManagerService::Rest::Client.configure do |config| + # config.timeout = 10.0 + # end + # + # @yield [config] Configure the Client client. + # @yieldparam config [Client::Configuration] + # + # @return [Client::Configuration] + # + def self.configure + @configure ||= begin + namespace = ["Google", "Cloud", "SecretManager", "V1beta1"] + parent_config = while namespace.any? + parent_name = namespace.join "::" + parent_const = const_get parent_name + break parent_const.configure if parent_const.respond_to? :configure + namespace.pop + end + default_config = Client::Configuration.new parent_config + + default_config.rpcs.list_secrets.timeout = 60.0 + + default_config.rpcs.create_secret.timeout = 60.0 + + default_config.rpcs.add_secret_version.timeout = 60.0 + + default_config.rpcs.get_secret.timeout = 60.0 + + default_config.rpcs.update_secret.timeout = 60.0 + + default_config.rpcs.delete_secret.timeout = 60.0 + + default_config.rpcs.list_secret_versions.timeout = 60.0 + + default_config.rpcs.get_secret_version.timeout = 60.0 + + default_config.rpcs.access_secret_version.timeout = 60.0 + default_config.rpcs.access_secret_version.retry_policy = { + initial_delay: 1.0, max_delay: 60.0, multiplier: 1.3, retry_codes: [14, 2] + } + + default_config.rpcs.disable_secret_version.timeout = 60.0 + + default_config.rpcs.enable_secret_version.timeout = 60.0 + + default_config.rpcs.destroy_secret_version.timeout = 60.0 + + default_config.rpcs.set_iam_policy.timeout = 60.0 + + default_config.rpcs.get_iam_policy.timeout = 60.0 + + default_config.rpcs.test_iam_permissions.timeout = 60.0 + + default_config + end + yield @configure if block_given? + @configure + end + + ## + # Configure the SecretManagerService Client instance. + # + # The configuration is set to the derived mode, meaning that values can be changed, + # but structural changes (adding new fields, etc.) are not allowed. Structural changes + # should be made on {Client.configure}. + # + # See {::Google::Cloud::SecretManager::V1beta1::SecretManagerService::Rest::Client::Configuration} + # for a description of the configuration fields. + # + # @yield [config] Configure the Client client. + # @yieldparam config [Client::Configuration] + # + # @return [Client::Configuration] + # + def configure + yield @config if block_given? + @config + end + + ## + # The effective universe domain + # + # @return [String] + # + def universe_domain + @secret_manager_service_stub.universe_domain + end + + ## + # Create a new SecretManagerService REST client object. + # + # @example + # + # # Create a client using the default configuration + # client = ::Google::Cloud::SecretManager::V1beta1::SecretManagerService::Rest::Client.new + # + # # Create a client using a custom configuration + # client = ::Google::Cloud::SecretManager::V1beta1::SecretManagerService::Rest::Client.new do |config| + # config.timeout = 10.0 + # end + # + # @yield [config] Configure the SecretManagerService client. + # @yieldparam config [Client::Configuration] + # + def initialize + # Create the configuration object + @config = Configuration.new Client.configure + + # Yield the configuration if needed + yield @config if block_given? + + # Create credentials + credentials = @config.credentials + # Use self-signed JWT if the endpoint is unchanged from default, + # but only if the default endpoint does not have a region prefix. + enable_self_signed_jwt = @config.endpoint.nil? || + (@config.endpoint == Configuration::DEFAULT_ENDPOINT && + !@config.endpoint.split(".").first.include?("-")) + credentials ||= Credentials.default scope: @config.scope, + enable_self_signed_jwt: enable_self_signed_jwt + if credentials.is_a?(::String) || credentials.is_a?(::Hash) + credentials = Credentials.new credentials, scope: @config.scope + end + + @quota_project_id = @config.quota_project + @quota_project_id ||= credentials.quota_project_id if credentials.respond_to? :quota_project_id + + @secret_manager_service_stub = ::Google::Cloud::SecretManager::V1beta1::SecretManagerService::Rest::ServiceStub.new( + endpoint: @config.endpoint, + endpoint_template: DEFAULT_ENDPOINT_TEMPLATE, + universe_domain: @config.universe_domain, + credentials: credentials, + logger: @config.logger + ) + + @secret_manager_service_stub.logger(stub: true)&.info do |entry| + entry.set_system_name + entry.set_service + entry.message = "Created client for #{entry.service}" + entry.set_credentials_fields credentials + entry.set "customEndpoint", @config.endpoint if @config.endpoint + entry.set "defaultTimeout", @config.timeout if @config.timeout + entry.set "quotaProject", @quota_project_id if @quota_project_id + end + + @location_client = Google::Cloud::Location::Locations::Rest::Client.new do |config| + config.credentials = credentials + config.quota_project = @quota_project_id + config.endpoint = @secret_manager_service_stub.endpoint + config.universe_domain = @secret_manager_service_stub.universe_domain + config.bindings_override = @config.bindings_override + config.logger = @secret_manager_service_stub.logger if config.respond_to? :logger= + end + end + + ## + # Get the associated client for mix-in of the Locations. + # + # @return [Google::Cloud::Location::Locations::Rest::Client] + # + attr_reader :location_client + + ## + # The logger used for request/response debug logging. + # + # @return [Logger] + # + def logger + @secret_manager_service_stub.logger + end + + # Service calls + + ## + # Lists {::Google::Cloud::SecretManager::V1beta1::Secret Secrets}. + # + # @overload list_secrets(request, options = nil) + # Pass arguments to `list_secrets` via a request object, either of type + # {::Google::Cloud::SecretManager::V1beta1::ListSecretsRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::SecretManager::V1beta1::ListSecretsRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @overload list_secrets(parent: nil, page_size: nil, page_token: nil) + # Pass arguments to `list_secrets` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param parent [::String] + # Required. The resource name of the project associated with the + # {::Google::Cloud::SecretManager::V1beta1::Secret Secrets}, in the format `projects/*`. + # @param page_size [::Integer] + # Optional. The maximum number of results to be returned in a single page. If + # set to 0, the server decides the number of results to return. If the + # number is greater than 25000, it is capped at 25000. + # @param page_token [::String] + # Optional. Pagination token, returned earlier via + # {::Google::Cloud::SecretManager::V1beta1::ListSecretsResponse#next_page_token ListSecretsResponse.next_page_token}. + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Gapic::Rest::PagedEnumerable<::Google::Cloud::SecretManager::V1beta1::Secret>] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Gapic::Rest::PagedEnumerable<::Google::Cloud::SecretManager::V1beta1::Secret>] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/secret_manager/v1beta1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::SecretManager::V1beta1::SecretManagerService::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::SecretManager::V1beta1::ListSecretsRequest.new + # + # # Call the list_secrets method. + # result = client.list_secrets request + # + # # The returned object is of type Gapic::PagedEnumerable. You can iterate + # # over elements, and API calls will be issued to fetch pages as needed. + # result.each do |item| + # # Each element is of type ::Google::Cloud::SecretManager::V1beta1::Secret. + # p item + # end + # + def list_secrets request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::SecretManager::V1beta1::ListSecretsRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + call_metadata = @config.rpcs.list_secrets.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::SecretManager::V1beta1::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + options.apply_defaults timeout: @config.rpcs.list_secrets.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.list_secrets.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @secret_manager_service_stub.list_secrets request, options do |result, operation| + result = ::Gapic::Rest::PagedEnumerable.new @secret_manager_service_stub, :list_secrets, "secrets", request, result, options + yield result, operation if block_given? + throw :response, result + end + rescue ::Gapic::Rest::Error => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Creates a new {::Google::Cloud::SecretManager::V1beta1::Secret Secret} containing no + # {::Google::Cloud::SecretManager::V1beta1::SecretVersion SecretVersions}. + # + # @overload create_secret(request, options = nil) + # Pass arguments to `create_secret` via a request object, either of type + # {::Google::Cloud::SecretManager::V1beta1::CreateSecretRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::SecretManager::V1beta1::CreateSecretRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @overload create_secret(parent: nil, secret_id: nil, secret: nil) + # Pass arguments to `create_secret` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param parent [::String] + # Required. The resource name of the project to associate with the + # {::Google::Cloud::SecretManager::V1beta1::Secret Secret}, in the format `projects/*`. + # @param secret_id [::String] + # Required. This must be unique within the project. + # + # A secret ID is a string with a maximum length of 255 characters and can + # contain uppercase and lowercase letters, numerals, and the hyphen (`-`) and + # underscore (`_`) characters. + # @param secret [::Google::Cloud::SecretManager::V1beta1::Secret, ::Hash] + # Required. A {::Google::Cloud::SecretManager::V1beta1::Secret Secret} with initial + # field values. + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Cloud::SecretManager::V1beta1::Secret] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::SecretManager::V1beta1::Secret] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/secret_manager/v1beta1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::SecretManager::V1beta1::SecretManagerService::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::SecretManager::V1beta1::CreateSecretRequest.new + # + # # Call the create_secret method. + # result = client.create_secret request + # + # # The returned object is of type Google::Cloud::SecretManager::V1beta1::Secret. + # p result + # + def create_secret request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::SecretManager::V1beta1::CreateSecretRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + call_metadata = @config.rpcs.create_secret.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::SecretManager::V1beta1::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + options.apply_defaults timeout: @config.rpcs.create_secret.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.create_secret.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @secret_manager_service_stub.create_secret request, options do |result, operation| + yield result, operation if block_given? + end + rescue ::Gapic::Rest::Error => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Creates a new {::Google::Cloud::SecretManager::V1beta1::SecretVersion SecretVersion} + # containing secret data and attaches it to an existing + # {::Google::Cloud::SecretManager::V1beta1::Secret Secret}. + # + # @overload add_secret_version(request, options = nil) + # Pass arguments to `add_secret_version` via a request object, either of type + # {::Google::Cloud::SecretManager::V1beta1::AddSecretVersionRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::SecretManager::V1beta1::AddSecretVersionRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @overload add_secret_version(parent: nil, payload: nil) + # Pass arguments to `add_secret_version` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param parent [::String] + # Required. The resource name of the + # {::Google::Cloud::SecretManager::V1beta1::Secret Secret} to associate with the + # {::Google::Cloud::SecretManager::V1beta1::SecretVersion SecretVersion} in the format + # `projects/*/secrets/*`. + # @param payload [::Google::Cloud::SecretManager::V1beta1::SecretPayload, ::Hash] + # Required. The secret payload of the + # {::Google::Cloud::SecretManager::V1beta1::SecretVersion SecretVersion}. + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Cloud::SecretManager::V1beta1::SecretVersion] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::SecretManager::V1beta1::SecretVersion] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/secret_manager/v1beta1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::SecretManager::V1beta1::SecretManagerService::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::SecretManager::V1beta1::AddSecretVersionRequest.new + # + # # Call the add_secret_version method. + # result = client.add_secret_version request + # + # # The returned object is of type Google::Cloud::SecretManager::V1beta1::SecretVersion. + # p result + # + def add_secret_version request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::SecretManager::V1beta1::AddSecretVersionRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + call_metadata = @config.rpcs.add_secret_version.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::SecretManager::V1beta1::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + options.apply_defaults timeout: @config.rpcs.add_secret_version.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.add_secret_version.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @secret_manager_service_stub.add_secret_version request, options do |result, operation| + yield result, operation if block_given? + end + rescue ::Gapic::Rest::Error => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Gets metadata for a given {::Google::Cloud::SecretManager::V1beta1::Secret Secret}. + # + # @overload get_secret(request, options = nil) + # Pass arguments to `get_secret` via a request object, either of type + # {::Google::Cloud::SecretManager::V1beta1::GetSecretRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::SecretManager::V1beta1::GetSecretRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @overload get_secret(name: nil) + # Pass arguments to `get_secret` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param name [::String] + # Required. The resource name of the + # {::Google::Cloud::SecretManager::V1beta1::Secret Secret}, in the format + # `projects/*/secrets/*`. + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Cloud::SecretManager::V1beta1::Secret] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::SecretManager::V1beta1::Secret] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/secret_manager/v1beta1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::SecretManager::V1beta1::SecretManagerService::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::SecretManager::V1beta1::GetSecretRequest.new + # + # # Call the get_secret method. + # result = client.get_secret request + # + # # The returned object is of type Google::Cloud::SecretManager::V1beta1::Secret. + # p result + # + def get_secret request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::SecretManager::V1beta1::GetSecretRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + call_metadata = @config.rpcs.get_secret.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::SecretManager::V1beta1::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + options.apply_defaults timeout: @config.rpcs.get_secret.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.get_secret.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @secret_manager_service_stub.get_secret request, options do |result, operation| + yield result, operation if block_given? + end + rescue ::Gapic::Rest::Error => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Updates metadata of an existing + # {::Google::Cloud::SecretManager::V1beta1::Secret Secret}. + # + # @overload update_secret(request, options = nil) + # Pass arguments to `update_secret` via a request object, either of type + # {::Google::Cloud::SecretManager::V1beta1::UpdateSecretRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::SecretManager::V1beta1::UpdateSecretRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @overload update_secret(secret: nil, update_mask: nil) + # Pass arguments to `update_secret` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param secret [::Google::Cloud::SecretManager::V1beta1::Secret, ::Hash] + # Required. {::Google::Cloud::SecretManager::V1beta1::Secret Secret} with updated field + # values. + # @param update_mask [::Google::Protobuf::FieldMask, ::Hash] + # Required. Specifies the fields to be updated. + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Cloud::SecretManager::V1beta1::Secret] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::SecretManager::V1beta1::Secret] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/secret_manager/v1beta1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::SecretManager::V1beta1::SecretManagerService::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::SecretManager::V1beta1::UpdateSecretRequest.new + # + # # Call the update_secret method. + # result = client.update_secret request + # + # # The returned object is of type Google::Cloud::SecretManager::V1beta1::Secret. + # p result + # + def update_secret request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::SecretManager::V1beta1::UpdateSecretRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + call_metadata = @config.rpcs.update_secret.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::SecretManager::V1beta1::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + options.apply_defaults timeout: @config.rpcs.update_secret.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.update_secret.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @secret_manager_service_stub.update_secret request, options do |result, operation| + yield result, operation if block_given? + end + rescue ::Gapic::Rest::Error => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Deletes a {::Google::Cloud::SecretManager::V1beta1::Secret Secret}. + # + # @overload delete_secret(request, options = nil) + # Pass arguments to `delete_secret` via a request object, either of type + # {::Google::Cloud::SecretManager::V1beta1::DeleteSecretRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::SecretManager::V1beta1::DeleteSecretRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @overload delete_secret(name: nil) + # Pass arguments to `delete_secret` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param name [::String] + # Required. The resource name of the + # {::Google::Cloud::SecretManager::V1beta1::Secret Secret} to delete in the format + # `projects/*/secrets/*`. + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Protobuf::Empty] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Protobuf::Empty] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/secret_manager/v1beta1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::SecretManager::V1beta1::SecretManagerService::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::SecretManager::V1beta1::DeleteSecretRequest.new + # + # # Call the delete_secret method. + # result = client.delete_secret request + # + # # The returned object is of type Google::Protobuf::Empty. + # p result + # + def delete_secret request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::SecretManager::V1beta1::DeleteSecretRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + call_metadata = @config.rpcs.delete_secret.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::SecretManager::V1beta1::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + options.apply_defaults timeout: @config.rpcs.delete_secret.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.delete_secret.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @secret_manager_service_stub.delete_secret request, options do |result, operation| + yield result, operation if block_given? + end + rescue ::Gapic::Rest::Error => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Lists {::Google::Cloud::SecretManager::V1beta1::SecretVersion SecretVersions}. This + # call does not return secret data. + # + # @overload list_secret_versions(request, options = nil) + # Pass arguments to `list_secret_versions` via a request object, either of type + # {::Google::Cloud::SecretManager::V1beta1::ListSecretVersionsRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::SecretManager::V1beta1::ListSecretVersionsRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @overload list_secret_versions(parent: nil, page_size: nil, page_token: nil) + # Pass arguments to `list_secret_versions` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param parent [::String] + # Required. The resource name of the + # {::Google::Cloud::SecretManager::V1beta1::Secret Secret} associated with the + # {::Google::Cloud::SecretManager::V1beta1::SecretVersion SecretVersions} to list, in + # the format `projects/*/secrets/*`. + # @param page_size [::Integer] + # Optional. The maximum number of results to be returned in a single page. If + # set to 0, the server decides the number of results to return. If the + # number is greater than 25000, it is capped at 25000. + # @param page_token [::String] + # Optional. Pagination token, returned earlier via + # ListSecretVersionsResponse.next_page_token][]. + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Gapic::Rest::PagedEnumerable<::Google::Cloud::SecretManager::V1beta1::SecretVersion>] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Gapic::Rest::PagedEnumerable<::Google::Cloud::SecretManager::V1beta1::SecretVersion>] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/secret_manager/v1beta1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::SecretManager::V1beta1::SecretManagerService::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::SecretManager::V1beta1::ListSecretVersionsRequest.new + # + # # Call the list_secret_versions method. + # result = client.list_secret_versions request + # + # # The returned object is of type Gapic::PagedEnumerable. You can iterate + # # over elements, and API calls will be issued to fetch pages as needed. + # result.each do |item| + # # Each element is of type ::Google::Cloud::SecretManager::V1beta1::SecretVersion. + # p item + # end + # + def list_secret_versions request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::SecretManager::V1beta1::ListSecretVersionsRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + call_metadata = @config.rpcs.list_secret_versions.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::SecretManager::V1beta1::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + options.apply_defaults timeout: @config.rpcs.list_secret_versions.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.list_secret_versions.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @secret_manager_service_stub.list_secret_versions request, options do |result, operation| + result = ::Gapic::Rest::PagedEnumerable.new @secret_manager_service_stub, :list_secret_versions, "versions", request, result, options + yield result, operation if block_given? + throw :response, result + end + rescue ::Gapic::Rest::Error => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Gets metadata for a + # {::Google::Cloud::SecretManager::V1beta1::SecretVersion SecretVersion}. + # + # `projects/*/secrets/*/versions/latest` is an alias to the `latest` + # {::Google::Cloud::SecretManager::V1beta1::SecretVersion SecretVersion}. + # + # @overload get_secret_version(request, options = nil) + # Pass arguments to `get_secret_version` via a request object, either of type + # {::Google::Cloud::SecretManager::V1beta1::GetSecretVersionRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::SecretManager::V1beta1::GetSecretVersionRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @overload get_secret_version(name: nil) + # Pass arguments to `get_secret_version` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param name [::String] + # Required. The resource name of the + # {::Google::Cloud::SecretManager::V1beta1::SecretVersion SecretVersion} in the format + # `projects/*/secrets/*/versions/*`. + # `projects/*/secrets/*/versions/latest` is an alias to the `latest` + # {::Google::Cloud::SecretManager::V1beta1::SecretVersion SecretVersion}. + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Cloud::SecretManager::V1beta1::SecretVersion] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::SecretManager::V1beta1::SecretVersion] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/secret_manager/v1beta1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::SecretManager::V1beta1::SecretManagerService::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::SecretManager::V1beta1::GetSecretVersionRequest.new + # + # # Call the get_secret_version method. + # result = client.get_secret_version request + # + # # The returned object is of type Google::Cloud::SecretManager::V1beta1::SecretVersion. + # p result + # + def get_secret_version request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::SecretManager::V1beta1::GetSecretVersionRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + call_metadata = @config.rpcs.get_secret_version.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::SecretManager::V1beta1::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + options.apply_defaults timeout: @config.rpcs.get_secret_version.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.get_secret_version.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @secret_manager_service_stub.get_secret_version request, options do |result, operation| + yield result, operation if block_given? + end + rescue ::Gapic::Rest::Error => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Accesses a {::Google::Cloud::SecretManager::V1beta1::SecretVersion SecretVersion}. + # This call returns the secret data. + # + # `projects/*/secrets/*/versions/latest` is an alias to the `latest` + # {::Google::Cloud::SecretManager::V1beta1::SecretVersion SecretVersion}. + # + # @overload access_secret_version(request, options = nil) + # Pass arguments to `access_secret_version` via a request object, either of type + # {::Google::Cloud::SecretManager::V1beta1::AccessSecretVersionRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::SecretManager::V1beta1::AccessSecretVersionRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @overload access_secret_version(name: nil) + # Pass arguments to `access_secret_version` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param name [::String] + # Required. The resource name of the + # {::Google::Cloud::SecretManager::V1beta1::SecretVersion SecretVersion} in the format + # `projects/*/secrets/*/versions/*`. + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Cloud::SecretManager::V1beta1::AccessSecretVersionResponse] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::SecretManager::V1beta1::AccessSecretVersionResponse] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/secret_manager/v1beta1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::SecretManager::V1beta1::SecretManagerService::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::SecretManager::V1beta1::AccessSecretVersionRequest.new + # + # # Call the access_secret_version method. + # result = client.access_secret_version request + # + # # The returned object is of type Google::Cloud::SecretManager::V1beta1::AccessSecretVersionResponse. + # p result + # + def access_secret_version request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::SecretManager::V1beta1::AccessSecretVersionRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + call_metadata = @config.rpcs.access_secret_version.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::SecretManager::V1beta1::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + options.apply_defaults timeout: @config.rpcs.access_secret_version.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.access_secret_version.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @secret_manager_service_stub.access_secret_version request, options do |result, operation| + yield result, operation if block_given? + end + rescue ::Gapic::Rest::Error => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Disables a {::Google::Cloud::SecretManager::V1beta1::SecretVersion SecretVersion}. + # + # Sets the {::Google::Cloud::SecretManager::V1beta1::SecretVersion#state state} of the + # {::Google::Cloud::SecretManager::V1beta1::SecretVersion SecretVersion} to + # {::Google::Cloud::SecretManager::V1beta1::SecretVersion::State::DISABLED DISABLED}. + # + # @overload disable_secret_version(request, options = nil) + # Pass arguments to `disable_secret_version` via a request object, either of type + # {::Google::Cloud::SecretManager::V1beta1::DisableSecretVersionRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::SecretManager::V1beta1::DisableSecretVersionRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @overload disable_secret_version(name: nil) + # Pass arguments to `disable_secret_version` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param name [::String] + # Required. The resource name of the + # {::Google::Cloud::SecretManager::V1beta1::SecretVersion SecretVersion} to disable in + # the format `projects/*/secrets/*/versions/*`. + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Cloud::SecretManager::V1beta1::SecretVersion] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::SecretManager::V1beta1::SecretVersion] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/secret_manager/v1beta1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::SecretManager::V1beta1::SecretManagerService::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::SecretManager::V1beta1::DisableSecretVersionRequest.new + # + # # Call the disable_secret_version method. + # result = client.disable_secret_version request + # + # # The returned object is of type Google::Cloud::SecretManager::V1beta1::SecretVersion. + # p result + # + def disable_secret_version request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::SecretManager::V1beta1::DisableSecretVersionRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + call_metadata = @config.rpcs.disable_secret_version.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::SecretManager::V1beta1::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + options.apply_defaults timeout: @config.rpcs.disable_secret_version.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.disable_secret_version.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @secret_manager_service_stub.disable_secret_version request, options do |result, operation| + yield result, operation if block_given? + end + rescue ::Gapic::Rest::Error => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Enables a {::Google::Cloud::SecretManager::V1beta1::SecretVersion SecretVersion}. + # + # Sets the {::Google::Cloud::SecretManager::V1beta1::SecretVersion#state state} of the + # {::Google::Cloud::SecretManager::V1beta1::SecretVersion SecretVersion} to + # {::Google::Cloud::SecretManager::V1beta1::SecretVersion::State::ENABLED ENABLED}. + # + # @overload enable_secret_version(request, options = nil) + # Pass arguments to `enable_secret_version` via a request object, either of type + # {::Google::Cloud::SecretManager::V1beta1::EnableSecretVersionRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::SecretManager::V1beta1::EnableSecretVersionRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @overload enable_secret_version(name: nil) + # Pass arguments to `enable_secret_version` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param name [::String] + # Required. The resource name of the + # {::Google::Cloud::SecretManager::V1beta1::SecretVersion SecretVersion} to enable in + # the format `projects/*/secrets/*/versions/*`. + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Cloud::SecretManager::V1beta1::SecretVersion] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::SecretManager::V1beta1::SecretVersion] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/secret_manager/v1beta1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::SecretManager::V1beta1::SecretManagerService::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::SecretManager::V1beta1::EnableSecretVersionRequest.new + # + # # Call the enable_secret_version method. + # result = client.enable_secret_version request + # + # # The returned object is of type Google::Cloud::SecretManager::V1beta1::SecretVersion. + # p result + # + def enable_secret_version request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::SecretManager::V1beta1::EnableSecretVersionRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + call_metadata = @config.rpcs.enable_secret_version.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::SecretManager::V1beta1::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + options.apply_defaults timeout: @config.rpcs.enable_secret_version.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.enable_secret_version.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @secret_manager_service_stub.enable_secret_version request, options do |result, operation| + yield result, operation if block_given? + end + rescue ::Gapic::Rest::Error => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Destroys a {::Google::Cloud::SecretManager::V1beta1::SecretVersion SecretVersion}. + # + # Sets the {::Google::Cloud::SecretManager::V1beta1::SecretVersion#state state} of the + # {::Google::Cloud::SecretManager::V1beta1::SecretVersion SecretVersion} to + # {::Google::Cloud::SecretManager::V1beta1::SecretVersion::State::DESTROYED DESTROYED} and + # irrevocably destroys the secret data. + # + # @overload destroy_secret_version(request, options = nil) + # Pass arguments to `destroy_secret_version` via a request object, either of type + # {::Google::Cloud::SecretManager::V1beta1::DestroySecretVersionRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::SecretManager::V1beta1::DestroySecretVersionRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @overload destroy_secret_version(name: nil) + # Pass arguments to `destroy_secret_version` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param name [::String] + # Required. The resource name of the + # {::Google::Cloud::SecretManager::V1beta1::SecretVersion SecretVersion} to destroy in + # the format `projects/*/secrets/*/versions/*`. + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Cloud::SecretManager::V1beta1::SecretVersion] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::SecretManager::V1beta1::SecretVersion] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/secret_manager/v1beta1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::SecretManager::V1beta1::SecretManagerService::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::SecretManager::V1beta1::DestroySecretVersionRequest.new + # + # # Call the destroy_secret_version method. + # result = client.destroy_secret_version request + # + # # The returned object is of type Google::Cloud::SecretManager::V1beta1::SecretVersion. + # p result + # + def destroy_secret_version request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::SecretManager::V1beta1::DestroySecretVersionRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + call_metadata = @config.rpcs.destroy_secret_version.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::SecretManager::V1beta1::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + options.apply_defaults timeout: @config.rpcs.destroy_secret_version.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.destroy_secret_version.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @secret_manager_service_stub.destroy_secret_version request, options do |result, operation| + yield result, operation if block_given? + end + rescue ::Gapic::Rest::Error => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Sets the access control policy on the specified secret. Replaces any + # existing policy. + # + # Permissions on {::Google::Cloud::SecretManager::V1beta1::SecretVersion SecretVersions} + # are enforced according to the policy set on the associated + # {::Google::Cloud::SecretManager::V1beta1::Secret Secret}. + # + # @overload set_iam_policy(request, options = nil) + # Pass arguments to `set_iam_policy` via a request object, either of type + # {::Google::Iam::V1::SetIamPolicyRequest} or an equivalent Hash. + # + # @param request [::Google::Iam::V1::SetIamPolicyRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @overload set_iam_policy(resource: nil, policy: nil, update_mask: nil) + # Pass arguments to `set_iam_policy` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param resource [::String] + # REQUIRED: The resource for which the policy is being specified. + # See the operation documentation for the appropriate value for this field. + # @param policy [::Google::Iam::V1::Policy, ::Hash] + # REQUIRED: The complete policy to be applied to the `resource`. The size of + # the policy is limited to a few 10s of KB. An empty policy is a + # valid policy but certain Cloud Platform services (such as Projects) + # might reject them. + # @param update_mask [::Google::Protobuf::FieldMask, ::Hash] + # OPTIONAL: A FieldMask specifying which fields of the policy to modify. Only + # the fields in the mask will be modified. If no mask is provided, the + # following default mask is used: + # + # `paths: "bindings, etag"` + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Iam::V1::Policy] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Iam::V1::Policy] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/secret_manager/v1beta1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::SecretManager::V1beta1::SecretManagerService::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Iam::V1::SetIamPolicyRequest.new + # + # # Call the set_iam_policy method. + # result = client.set_iam_policy request + # + # # The returned object is of type Google::Iam::V1::Policy. + # p result + # + def set_iam_policy request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Iam::V1::SetIamPolicyRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + call_metadata = @config.rpcs.set_iam_policy.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::SecretManager::V1beta1::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + options.apply_defaults timeout: @config.rpcs.set_iam_policy.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.set_iam_policy.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @secret_manager_service_stub.set_iam_policy request, options do |result, operation| + yield result, operation if block_given? + end + rescue ::Gapic::Rest::Error => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Gets the access control policy for a secret. + # Returns empty policy if the secret exists and does not have a policy set. + # + # @overload get_iam_policy(request, options = nil) + # Pass arguments to `get_iam_policy` via a request object, either of type + # {::Google::Iam::V1::GetIamPolicyRequest} or an equivalent Hash. + # + # @param request [::Google::Iam::V1::GetIamPolicyRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @overload get_iam_policy(resource: nil, options: nil) + # Pass arguments to `get_iam_policy` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param resource [::String] + # REQUIRED: The resource for which the policy is being requested. + # See the operation documentation for the appropriate value for this field. + # @param options [::Google::Iam::V1::GetPolicyOptions, ::Hash] + # OPTIONAL: A `GetPolicyOptions` object for specifying options to + # `GetIamPolicy`. + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Iam::V1::Policy] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Iam::V1::Policy] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/secret_manager/v1beta1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::SecretManager::V1beta1::SecretManagerService::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Iam::V1::GetIamPolicyRequest.new + # + # # Call the get_iam_policy method. + # result = client.get_iam_policy request + # + # # The returned object is of type Google::Iam::V1::Policy. + # p result + # + def get_iam_policy request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Iam::V1::GetIamPolicyRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + call_metadata = @config.rpcs.get_iam_policy.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::SecretManager::V1beta1::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + options.apply_defaults timeout: @config.rpcs.get_iam_policy.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.get_iam_policy.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @secret_manager_service_stub.get_iam_policy request, options do |result, operation| + yield result, operation if block_given? + end + rescue ::Gapic::Rest::Error => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Returns permissions that a caller has for the specified secret. + # If the secret does not exist, this call returns an empty set of + # permissions, not a NOT_FOUND error. + # + # Note: This operation is designed to be used for building permission-aware + # UIs and command-line tools, not for authorization checking. This operation + # may "fail open" without warning. + # + # @overload test_iam_permissions(request, options = nil) + # Pass arguments to `test_iam_permissions` via a request object, either of type + # {::Google::Iam::V1::TestIamPermissionsRequest} or an equivalent Hash. + # + # @param request [::Google::Iam::V1::TestIamPermissionsRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @overload test_iam_permissions(resource: nil, permissions: nil) + # Pass arguments to `test_iam_permissions` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param resource [::String] + # REQUIRED: The resource for which the policy detail is being requested. + # See the operation documentation for the appropriate value for this field. + # @param permissions [::Array<::String>] + # The set of permissions to check for the `resource`. Permissions with + # wildcards (such as '*' or 'storage.*') are not allowed. For more + # information see + # [IAM Overview](https://cloud.google.com/iam/docs/overview#permissions). + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Iam::V1::TestIamPermissionsResponse] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Iam::V1::TestIamPermissionsResponse] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/secret_manager/v1beta1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::SecretManager::V1beta1::SecretManagerService::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Iam::V1::TestIamPermissionsRequest.new + # + # # Call the test_iam_permissions method. + # result = client.test_iam_permissions request + # + # # The returned object is of type Google::Iam::V1::TestIamPermissionsResponse. + # p result + # + def test_iam_permissions request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Iam::V1::TestIamPermissionsRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + call_metadata = @config.rpcs.test_iam_permissions.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::SecretManager::V1beta1::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + options.apply_defaults timeout: @config.rpcs.test_iam_permissions.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.test_iam_permissions.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @secret_manager_service_stub.test_iam_permissions request, options do |result, operation| + yield result, operation if block_given? + end + rescue ::Gapic::Rest::Error => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Configuration class for the SecretManagerService REST API. + # + # This class represents the configuration for SecretManagerService REST, + # providing control over timeouts, retry behavior, logging, transport + # parameters, and other low-level controls. Certain parameters can also be + # applied individually to specific RPCs. See + # {::Google::Cloud::SecretManager::V1beta1::SecretManagerService::Rest::Client::Configuration::Rpcs} + # for a list of RPCs that can be configured independently. + # + # Configuration can be applied globally to all clients, or to a single client + # on construction. + # + # @example + # + # # Modify the global config, setting the timeout for + # # list_secrets to 20 seconds, + # # and all remaining timeouts to 10 seconds. + # ::Google::Cloud::SecretManager::V1beta1::SecretManagerService::Rest::Client.configure do |config| + # config.timeout = 10.0 + # config.rpcs.list_secrets.timeout = 20.0 + # end + # + # # Apply the above configuration only to a new client. + # client = ::Google::Cloud::SecretManager::V1beta1::SecretManagerService::Rest::Client.new do |config| + # config.timeout = 10.0 + # config.rpcs.list_secrets.timeout = 20.0 + # end + # + # @!attribute [rw] endpoint + # A custom service endpoint, as a hostname or hostname:port. The default is + # nil, indicating to use the default endpoint in the current universe domain. + # @return [::String,nil] + # @!attribute [rw] credentials + # Credentials to send with calls. You may provide any of the following types: + # * (`String`) The path to a service account key file in JSON format + # * (`Hash`) A service account key as a Hash + # * (`Google::Auth::Credentials`) A googleauth credentials object + # (see the [googleauth docs](https://rubydoc.info/gems/googleauth/Google/Auth/Credentials)) + # * (`Signet::OAuth2::Client`) A signet oauth2 client object + # (see the [signet docs](https://rubydoc.info/gems/signet/Signet/OAuth2/Client)) + # * (`nil`) indicating no credentials + # + # Warning: If you accept a credential configuration (JSON file or Hash) from an + # external source for authentication to Google Cloud, you must validate it before + # providing it to a Google API client library. Providing an unvalidated credential + # configuration to Google APIs can compromise the security of your systems and data. + # For more information, refer to [Validate credential configurations from external + # sources](https://cloud.google.com/docs/authentication/external/externally-sourced-credentials). + # @return [::Object] + # @!attribute [rw] scope + # The OAuth scopes + # @return [::Array<::String>] + # @!attribute [rw] lib_name + # The library name as recorded in instrumentation and logging + # @return [::String] + # @!attribute [rw] lib_version + # The library version as recorded in instrumentation and logging + # @return [::String] + # @!attribute [rw] timeout + # The call timeout in seconds. + # @return [::Numeric] + # @!attribute [rw] metadata + # Additional headers to be sent with the call. + # @return [::Hash{::Symbol=>::String}] + # @!attribute [rw] retry_policy + # The retry policy. The value is a hash with the following keys: + # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds. + # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds. + # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier. + # * `:retry_codes` (*type:* `Array`) - The error codes that should + # trigger a retry. + # @return [::Hash] + # @!attribute [rw] quota_project + # A separate project against which to charge quota. + # @return [::String] + # @!attribute [rw] universe_domain + # The universe domain within which to make requests. This determines the + # default endpoint URL. The default value of nil uses the environment + # universe (usually the default "googleapis.com" universe). + # @return [::String,nil] + # @!attribute [rw] logger + # A custom logger to use for request/response debug logging, or the value + # `:default` (the default) to construct a default logger, or `nil` to + # explicitly disable logging. + # @return [::Logger,:default,nil] + # + class Configuration + extend ::Gapic::Config + + # @private + # The endpoint specific to the default "googleapis.com" universe. Deprecated. + DEFAULT_ENDPOINT = "secretmanager.googleapis.com" + + config_attr :endpoint, nil, ::String, nil + config_attr :credentials, nil do |value| + allowed = [::String, ::Hash, ::Proc, ::Symbol, ::Google::Auth::Credentials, ::Google::Auth::BaseClient, ::Signet::OAuth2::Client, nil] + allowed.any? { |klass| klass === value } + end + config_attr :scope, nil, ::String, ::Array, nil + config_attr :lib_name, nil, ::String, nil + config_attr :lib_version, nil, ::String, nil + config_attr :timeout, nil, ::Numeric, nil + config_attr :metadata, nil, ::Hash, nil + config_attr :retry_policy, nil, ::Hash, ::Proc, nil + config_attr :quota_project, nil, ::String, nil + config_attr :universe_domain, nil, ::String, nil + + # @private + # Overrides for http bindings for the RPCs of this service + # are only used when this service is used as mixin, and only + # by the host service. + # @return [::Hash{::Symbol=>::Array<::Gapic::Rest::GrpcTranscoder::HttpBinding>}] + config_attr :bindings_override, {}, ::Hash, nil + config_attr :logger, :default, ::Logger, nil, :default + + # @private + def initialize parent_config = nil + @parent_config = parent_config unless parent_config.nil? + + yield self if block_given? + end + + ## + # Configurations for individual RPCs + # @return [Rpcs] + # + def rpcs + @rpcs ||= begin + parent_rpcs = nil + parent_rpcs = @parent_config.rpcs if defined?(@parent_config) && @parent_config.respond_to?(:rpcs) + Rpcs.new parent_rpcs + end + end + + ## + # Configuration RPC class for the SecretManagerService API. + # + # Includes fields providing the configuration for each RPC in this service. + # Each configuration object is of type `Gapic::Config::Method` and includes + # the following configuration fields: + # + # * `timeout` (*type:* `Numeric`) - The call timeout in seconds + # * `metadata` (*type:* `Hash{Symbol=>String}`) - Additional headers + # * `retry_policy (*type:* `Hash`) - The retry policy. The policy fields + # include the following keys: + # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds. + # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds. + # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier. + # * `:retry_codes` (*type:* `Array`) - The error codes that should + # trigger a retry. + # + class Rpcs + ## + # RPC-specific configuration for `list_secrets` + # @return [::Gapic::Config::Method] + # + attr_reader :list_secrets + ## + # RPC-specific configuration for `create_secret` + # @return [::Gapic::Config::Method] + # + attr_reader :create_secret + ## + # RPC-specific configuration for `add_secret_version` + # @return [::Gapic::Config::Method] + # + attr_reader :add_secret_version + ## + # RPC-specific configuration for `get_secret` + # @return [::Gapic::Config::Method] + # + attr_reader :get_secret + ## + # RPC-specific configuration for `update_secret` + # @return [::Gapic::Config::Method] + # + attr_reader :update_secret + ## + # RPC-specific configuration for `delete_secret` + # @return [::Gapic::Config::Method] + # + attr_reader :delete_secret + ## + # RPC-specific configuration for `list_secret_versions` + # @return [::Gapic::Config::Method] + # + attr_reader :list_secret_versions + ## + # RPC-specific configuration for `get_secret_version` + # @return [::Gapic::Config::Method] + # + attr_reader :get_secret_version + ## + # RPC-specific configuration for `access_secret_version` + # @return [::Gapic::Config::Method] + # + attr_reader :access_secret_version + ## + # RPC-specific configuration for `disable_secret_version` + # @return [::Gapic::Config::Method] + # + attr_reader :disable_secret_version + ## + # RPC-specific configuration for `enable_secret_version` + # @return [::Gapic::Config::Method] + # + attr_reader :enable_secret_version + ## + # RPC-specific configuration for `destroy_secret_version` + # @return [::Gapic::Config::Method] + # + attr_reader :destroy_secret_version + ## + # RPC-specific configuration for `set_iam_policy` + # @return [::Gapic::Config::Method] + # + attr_reader :set_iam_policy + ## + # RPC-specific configuration for `get_iam_policy` + # @return [::Gapic::Config::Method] + # + attr_reader :get_iam_policy + ## + # RPC-specific configuration for `test_iam_permissions` + # @return [::Gapic::Config::Method] + # + attr_reader :test_iam_permissions + + # @private + def initialize parent_rpcs = nil + list_secrets_config = parent_rpcs.list_secrets if parent_rpcs.respond_to? :list_secrets + @list_secrets = ::Gapic::Config::Method.new list_secrets_config + create_secret_config = parent_rpcs.create_secret if parent_rpcs.respond_to? :create_secret + @create_secret = ::Gapic::Config::Method.new create_secret_config + add_secret_version_config = parent_rpcs.add_secret_version if parent_rpcs.respond_to? :add_secret_version + @add_secret_version = ::Gapic::Config::Method.new add_secret_version_config + get_secret_config = parent_rpcs.get_secret if parent_rpcs.respond_to? :get_secret + @get_secret = ::Gapic::Config::Method.new get_secret_config + update_secret_config = parent_rpcs.update_secret if parent_rpcs.respond_to? :update_secret + @update_secret = ::Gapic::Config::Method.new update_secret_config + delete_secret_config = parent_rpcs.delete_secret if parent_rpcs.respond_to? :delete_secret + @delete_secret = ::Gapic::Config::Method.new delete_secret_config + list_secret_versions_config = parent_rpcs.list_secret_versions if parent_rpcs.respond_to? :list_secret_versions + @list_secret_versions = ::Gapic::Config::Method.new list_secret_versions_config + get_secret_version_config = parent_rpcs.get_secret_version if parent_rpcs.respond_to? :get_secret_version + @get_secret_version = ::Gapic::Config::Method.new get_secret_version_config + access_secret_version_config = parent_rpcs.access_secret_version if parent_rpcs.respond_to? :access_secret_version + @access_secret_version = ::Gapic::Config::Method.new access_secret_version_config + disable_secret_version_config = parent_rpcs.disable_secret_version if parent_rpcs.respond_to? :disable_secret_version + @disable_secret_version = ::Gapic::Config::Method.new disable_secret_version_config + enable_secret_version_config = parent_rpcs.enable_secret_version if parent_rpcs.respond_to? :enable_secret_version + @enable_secret_version = ::Gapic::Config::Method.new enable_secret_version_config + destroy_secret_version_config = parent_rpcs.destroy_secret_version if parent_rpcs.respond_to? :destroy_secret_version + @destroy_secret_version = ::Gapic::Config::Method.new destroy_secret_version_config + set_iam_policy_config = parent_rpcs.set_iam_policy if parent_rpcs.respond_to? :set_iam_policy + @set_iam_policy = ::Gapic::Config::Method.new set_iam_policy_config + get_iam_policy_config = parent_rpcs.get_iam_policy if parent_rpcs.respond_to? :get_iam_policy + @get_iam_policy = ::Gapic::Config::Method.new get_iam_policy_config + test_iam_permissions_config = parent_rpcs.test_iam_permissions if parent_rpcs.respond_to? :test_iam_permissions + @test_iam_permissions = ::Gapic::Config::Method.new test_iam_permissions_config + + yield self if block_given? + end + end + end + end + end + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-secret_manager-v1beta1/lib/google/cloud/secret_manager/v1beta1/secret_manager_service/rest/service_stub.rb b/owl-bot-staging/google-cloud-secret_manager-v1beta1/lib/google/cloud/secret_manager/v1beta1/secret_manager_service/rest/service_stub.rb new file mode 100644 index 000000000000..968f6c2a4fd6 --- /dev/null +++ b/owl-bot-staging/google-cloud-secret_manager-v1beta1/lib/google/cloud/secret_manager/v1beta1/secret_manager_service/rest/service_stub.rb @@ -0,0 +1,1004 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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/secrets/v1beta1/service_pb" + +module Google + module Cloud + module SecretManager + module V1beta1 + module SecretManagerService + module Rest + ## + # REST service stub for the SecretManagerService service. + # Service stub contains baseline method implementations + # including transcoding, making the REST call, and deserialing the response. + # + class ServiceStub + # @private + def initialize endpoint:, endpoint_template:, universe_domain:, credentials:, logger: + # These require statements are intentionally placed here to initialize + # the REST modules only when it's required. + require "gapic/rest" + + @client_stub = ::Gapic::Rest::ClientStub.new endpoint: endpoint, + endpoint_template: endpoint_template, + universe_domain: universe_domain, + credentials: credentials, + numeric_enums: true, + service_name: self.class, + raise_faraday_errors: false, + logger: logger + end + + ## + # The effective universe domain + # + # @return [String] + # + def universe_domain + @client_stub.universe_domain + end + + ## + # The effective endpoint + # + # @return [String] + # + def endpoint + @client_stub.endpoint + end + + ## + # The logger used for request/response debug logging. + # + # @return [Logger] + # + def logger stub: false + stub ? @client_stub.stub_logger : @client_stub.logger + end + + ## + # Baseline implementation for the list_secrets REST call + # + # @param request_pb [::Google::Cloud::SecretManager::V1beta1::ListSecretsRequest] + # A request object representing the call parameters. Required. + # @param options [::Gapic::CallOptions] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Cloud::SecretManager::V1beta1::ListSecretsResponse] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::SecretManager::V1beta1::ListSecretsResponse] + # A result object deserialized from the server's reply + def list_secrets request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_list_secrets_request request_pb + query_string_params = if query_string_params.any? + query_string_params.to_h { |p| p.split "=", 2 } + else + {} + end + + response = @client_stub.make_http_request( + verb, + uri: uri, + body: body || "", + params: query_string_params, + method_name: "list_secrets", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Cloud::SecretManager::V1beta1::ListSecretsResponse.decode_json response.body, ignore_unknown_fields: true + catch :response do + yield result, operation if block_given? + result + end + end + + ## + # Baseline implementation for the create_secret REST call + # + # @param request_pb [::Google::Cloud::SecretManager::V1beta1::CreateSecretRequest] + # A request object representing the call parameters. Required. + # @param options [::Gapic::CallOptions] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Cloud::SecretManager::V1beta1::Secret] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::SecretManager::V1beta1::Secret] + # A result object deserialized from the server's reply + def create_secret request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_create_secret_request request_pb + query_string_params = if query_string_params.any? + query_string_params.to_h { |p| p.split "=", 2 } + else + {} + end + + response = @client_stub.make_http_request( + verb, + uri: uri, + body: body || "", + params: query_string_params, + method_name: "create_secret", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Cloud::SecretManager::V1beta1::Secret.decode_json response.body, ignore_unknown_fields: true + catch :response do + yield result, operation if block_given? + result + end + end + + ## + # Baseline implementation for the add_secret_version REST call + # + # @param request_pb [::Google::Cloud::SecretManager::V1beta1::AddSecretVersionRequest] + # A request object representing the call parameters. Required. + # @param options [::Gapic::CallOptions] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Cloud::SecretManager::V1beta1::SecretVersion] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::SecretManager::V1beta1::SecretVersion] + # A result object deserialized from the server's reply + def add_secret_version request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_add_secret_version_request request_pb + query_string_params = if query_string_params.any? + query_string_params.to_h { |p| p.split "=", 2 } + else + {} + end + + response = @client_stub.make_http_request( + verb, + uri: uri, + body: body || "", + params: query_string_params, + method_name: "add_secret_version", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Cloud::SecretManager::V1beta1::SecretVersion.decode_json response.body, ignore_unknown_fields: true + catch :response do + yield result, operation if block_given? + result + end + end + + ## + # Baseline implementation for the get_secret REST call + # + # @param request_pb [::Google::Cloud::SecretManager::V1beta1::GetSecretRequest] + # A request object representing the call parameters. Required. + # @param options [::Gapic::CallOptions] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Cloud::SecretManager::V1beta1::Secret] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::SecretManager::V1beta1::Secret] + # A result object deserialized from the server's reply + def get_secret request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_get_secret_request request_pb + query_string_params = if query_string_params.any? + query_string_params.to_h { |p| p.split "=", 2 } + else + {} + end + + response = @client_stub.make_http_request( + verb, + uri: uri, + body: body || "", + params: query_string_params, + method_name: "get_secret", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Cloud::SecretManager::V1beta1::Secret.decode_json response.body, ignore_unknown_fields: true + catch :response do + yield result, operation if block_given? + result + end + end + + ## + # Baseline implementation for the update_secret REST call + # + # @param request_pb [::Google::Cloud::SecretManager::V1beta1::UpdateSecretRequest] + # A request object representing the call parameters. Required. + # @param options [::Gapic::CallOptions] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Cloud::SecretManager::V1beta1::Secret] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::SecretManager::V1beta1::Secret] + # A result object deserialized from the server's reply + def update_secret request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_update_secret_request request_pb + query_string_params = if query_string_params.any? + query_string_params.to_h { |p| p.split "=", 2 } + else + {} + end + + response = @client_stub.make_http_request( + verb, + uri: uri, + body: body || "", + params: query_string_params, + method_name: "update_secret", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Cloud::SecretManager::V1beta1::Secret.decode_json response.body, ignore_unknown_fields: true + catch :response do + yield result, operation if block_given? + result + end + end + + ## + # Baseline implementation for the delete_secret REST call + # + # @param request_pb [::Google::Cloud::SecretManager::V1beta1::DeleteSecretRequest] + # A request object representing the call parameters. Required. + # @param options [::Gapic::CallOptions] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Protobuf::Empty] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Protobuf::Empty] + # A result object deserialized from the server's reply + def delete_secret request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_delete_secret_request request_pb + query_string_params = if query_string_params.any? + query_string_params.to_h { |p| p.split "=", 2 } + else + {} + end + + response = @client_stub.make_http_request( + verb, + uri: uri, + body: body || "", + params: query_string_params, + method_name: "delete_secret", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Protobuf::Empty.decode_json response.body, ignore_unknown_fields: true + catch :response do + yield result, operation if block_given? + result + end + end + + ## + # Baseline implementation for the list_secret_versions REST call + # + # @param request_pb [::Google::Cloud::SecretManager::V1beta1::ListSecretVersionsRequest] + # A request object representing the call parameters. Required. + # @param options [::Gapic::CallOptions] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Cloud::SecretManager::V1beta1::ListSecretVersionsResponse] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::SecretManager::V1beta1::ListSecretVersionsResponse] + # A result object deserialized from the server's reply + def list_secret_versions request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_list_secret_versions_request request_pb + query_string_params = if query_string_params.any? + query_string_params.to_h { |p| p.split "=", 2 } + else + {} + end + + response = @client_stub.make_http_request( + verb, + uri: uri, + body: body || "", + params: query_string_params, + method_name: "list_secret_versions", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Cloud::SecretManager::V1beta1::ListSecretVersionsResponse.decode_json response.body, ignore_unknown_fields: true + catch :response do + yield result, operation if block_given? + result + end + end + + ## + # Baseline implementation for the get_secret_version REST call + # + # @param request_pb [::Google::Cloud::SecretManager::V1beta1::GetSecretVersionRequest] + # A request object representing the call parameters. Required. + # @param options [::Gapic::CallOptions] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Cloud::SecretManager::V1beta1::SecretVersion] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::SecretManager::V1beta1::SecretVersion] + # A result object deserialized from the server's reply + def get_secret_version request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_get_secret_version_request request_pb + query_string_params = if query_string_params.any? + query_string_params.to_h { |p| p.split "=", 2 } + else + {} + end + + response = @client_stub.make_http_request( + verb, + uri: uri, + body: body || "", + params: query_string_params, + method_name: "get_secret_version", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Cloud::SecretManager::V1beta1::SecretVersion.decode_json response.body, ignore_unknown_fields: true + catch :response do + yield result, operation if block_given? + result + end + end + + ## + # Baseline implementation for the access_secret_version REST call + # + # @param request_pb [::Google::Cloud::SecretManager::V1beta1::AccessSecretVersionRequest] + # A request object representing the call parameters. Required. + # @param options [::Gapic::CallOptions] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Cloud::SecretManager::V1beta1::AccessSecretVersionResponse] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::SecretManager::V1beta1::AccessSecretVersionResponse] + # A result object deserialized from the server's reply + def access_secret_version request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_access_secret_version_request request_pb + query_string_params = if query_string_params.any? + query_string_params.to_h { |p| p.split "=", 2 } + else + {} + end + + response = @client_stub.make_http_request( + verb, + uri: uri, + body: body || "", + params: query_string_params, + method_name: "access_secret_version", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Cloud::SecretManager::V1beta1::AccessSecretVersionResponse.decode_json response.body, ignore_unknown_fields: true + catch :response do + yield result, operation if block_given? + result + end + end + + ## + # Baseline implementation for the disable_secret_version REST call + # + # @param request_pb [::Google::Cloud::SecretManager::V1beta1::DisableSecretVersionRequest] + # A request object representing the call parameters. Required. + # @param options [::Gapic::CallOptions] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Cloud::SecretManager::V1beta1::SecretVersion] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::SecretManager::V1beta1::SecretVersion] + # A result object deserialized from the server's reply + def disable_secret_version request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_disable_secret_version_request request_pb + query_string_params = if query_string_params.any? + query_string_params.to_h { |p| p.split "=", 2 } + else + {} + end + + response = @client_stub.make_http_request( + verb, + uri: uri, + body: body || "", + params: query_string_params, + method_name: "disable_secret_version", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Cloud::SecretManager::V1beta1::SecretVersion.decode_json response.body, ignore_unknown_fields: true + catch :response do + yield result, operation if block_given? + result + end + end + + ## + # Baseline implementation for the enable_secret_version REST call + # + # @param request_pb [::Google::Cloud::SecretManager::V1beta1::EnableSecretVersionRequest] + # A request object representing the call parameters. Required. + # @param options [::Gapic::CallOptions] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Cloud::SecretManager::V1beta1::SecretVersion] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::SecretManager::V1beta1::SecretVersion] + # A result object deserialized from the server's reply + def enable_secret_version request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_enable_secret_version_request request_pb + query_string_params = if query_string_params.any? + query_string_params.to_h { |p| p.split "=", 2 } + else + {} + end + + response = @client_stub.make_http_request( + verb, + uri: uri, + body: body || "", + params: query_string_params, + method_name: "enable_secret_version", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Cloud::SecretManager::V1beta1::SecretVersion.decode_json response.body, ignore_unknown_fields: true + catch :response do + yield result, operation if block_given? + result + end + end + + ## + # Baseline implementation for the destroy_secret_version REST call + # + # @param request_pb [::Google::Cloud::SecretManager::V1beta1::DestroySecretVersionRequest] + # A request object representing the call parameters. Required. + # @param options [::Gapic::CallOptions] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Cloud::SecretManager::V1beta1::SecretVersion] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::SecretManager::V1beta1::SecretVersion] + # A result object deserialized from the server's reply + def destroy_secret_version request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_destroy_secret_version_request request_pb + query_string_params = if query_string_params.any? + query_string_params.to_h { |p| p.split "=", 2 } + else + {} + end + + response = @client_stub.make_http_request( + verb, + uri: uri, + body: body || "", + params: query_string_params, + method_name: "destroy_secret_version", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Cloud::SecretManager::V1beta1::SecretVersion.decode_json response.body, ignore_unknown_fields: true + catch :response do + yield result, operation if block_given? + result + end + end + + ## + # Baseline implementation for the set_iam_policy REST call + # + # @param request_pb [::Google::Iam::V1::SetIamPolicyRequest] + # A request object representing the call parameters. Required. + # @param options [::Gapic::CallOptions] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Iam::V1::Policy] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Iam::V1::Policy] + # A result object deserialized from the server's reply + def set_iam_policy request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_set_iam_policy_request request_pb + query_string_params = if query_string_params.any? + query_string_params.to_h { |p| p.split "=", 2 } + else + {} + end + + response = @client_stub.make_http_request( + verb, + uri: uri, + body: body || "", + params: query_string_params, + method_name: "set_iam_policy", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Iam::V1::Policy.decode_json response.body, ignore_unknown_fields: true + catch :response do + yield result, operation if block_given? + result + end + end + + ## + # Baseline implementation for the get_iam_policy REST call + # + # @param request_pb [::Google::Iam::V1::GetIamPolicyRequest] + # A request object representing the call parameters. Required. + # @param options [::Gapic::CallOptions] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Iam::V1::Policy] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Iam::V1::Policy] + # A result object deserialized from the server's reply + def get_iam_policy request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_get_iam_policy_request request_pb + query_string_params = if query_string_params.any? + query_string_params.to_h { |p| p.split "=", 2 } + else + {} + end + + response = @client_stub.make_http_request( + verb, + uri: uri, + body: body || "", + params: query_string_params, + method_name: "get_iam_policy", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Iam::V1::Policy.decode_json response.body, ignore_unknown_fields: true + catch :response do + yield result, operation if block_given? + result + end + end + + ## + # Baseline implementation for the test_iam_permissions REST call + # + # @param request_pb [::Google::Iam::V1::TestIamPermissionsRequest] + # A request object representing the call parameters. Required. + # @param options [::Gapic::CallOptions] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Iam::V1::TestIamPermissionsResponse] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Iam::V1::TestIamPermissionsResponse] + # A result object deserialized from the server's reply + def test_iam_permissions request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_test_iam_permissions_request request_pb + query_string_params = if query_string_params.any? + query_string_params.to_h { |p| p.split "=", 2 } + else + {} + end + + response = @client_stub.make_http_request( + verb, + uri: uri, + body: body || "", + params: query_string_params, + method_name: "test_iam_permissions", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Iam::V1::TestIamPermissionsResponse.decode_json response.body, ignore_unknown_fields: true + catch :response do + yield result, operation if block_given? + result + end + end + + ## + # @private + # + # GRPC transcoding helper method for the list_secrets REST call + # + # @param request_pb [::Google::Cloud::SecretManager::V1beta1::ListSecretsRequest] + # A request object representing the call parameters. Required. + # @return [Array(String, [String, nil], Hash{String => String})] + # Uri, Body, Query string parameters + def self.transcode_list_secrets_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :get, + uri_template: "/v1beta1/{parent}/secrets", + matches: [ + ["parent", %r{^projects/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the create_secret REST call + # + # @param request_pb [::Google::Cloud::SecretManager::V1beta1::CreateSecretRequest] + # A request object representing the call parameters. Required. + # @return [Array(String, [String, nil], Hash{String => String})] + # Uri, Body, Query string parameters + def self.transcode_create_secret_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :post, + uri_template: "/v1beta1/{parent}/secrets", + body: "secret", + matches: [ + ["parent", %r{^projects/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the add_secret_version REST call + # + # @param request_pb [::Google::Cloud::SecretManager::V1beta1::AddSecretVersionRequest] + # A request object representing the call parameters. Required. + # @return [Array(String, [String, nil], Hash{String => String})] + # Uri, Body, Query string parameters + def self.transcode_add_secret_version_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :post, + uri_template: "/v1beta1/{parent}:addVersion", + body: "*", + matches: [ + ["parent", %r{^projects/[^/]+/secrets/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the get_secret REST call + # + # @param request_pb [::Google::Cloud::SecretManager::V1beta1::GetSecretRequest] + # A request object representing the call parameters. Required. + # @return [Array(String, [String, nil], Hash{String => String})] + # Uri, Body, Query string parameters + def self.transcode_get_secret_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :get, + uri_template: "/v1beta1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/secrets/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the update_secret REST call + # + # @param request_pb [::Google::Cloud::SecretManager::V1beta1::UpdateSecretRequest] + # A request object representing the call parameters. Required. + # @return [Array(String, [String, nil], Hash{String => String})] + # Uri, Body, Query string parameters + def self.transcode_update_secret_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :patch, + uri_template: "/v1beta1/{secret.name}", + body: "secret", + matches: [ + ["secret.name", %r{^projects/[^/]+/secrets/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the delete_secret REST call + # + # @param request_pb [::Google::Cloud::SecretManager::V1beta1::DeleteSecretRequest] + # A request object representing the call parameters. Required. + # @return [Array(String, [String, nil], Hash{String => String})] + # Uri, Body, Query string parameters + def self.transcode_delete_secret_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :delete, + uri_template: "/v1beta1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/secrets/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the list_secret_versions REST call + # + # @param request_pb [::Google::Cloud::SecretManager::V1beta1::ListSecretVersionsRequest] + # A request object representing the call parameters. Required. + # @return [Array(String, [String, nil], Hash{String => String})] + # Uri, Body, Query string parameters + def self.transcode_list_secret_versions_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :get, + uri_template: "/v1beta1/{parent}/versions", + matches: [ + ["parent", %r{^projects/[^/]+/secrets/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the get_secret_version REST call + # + # @param request_pb [::Google::Cloud::SecretManager::V1beta1::GetSecretVersionRequest] + # A request object representing the call parameters. Required. + # @return [Array(String, [String, nil], Hash{String => String})] + # Uri, Body, Query string parameters + def self.transcode_get_secret_version_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :get, + uri_template: "/v1beta1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/secrets/[^/]+/versions/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the access_secret_version REST call + # + # @param request_pb [::Google::Cloud::SecretManager::V1beta1::AccessSecretVersionRequest] + # A request object representing the call parameters. Required. + # @return [Array(String, [String, nil], Hash{String => String})] + # Uri, Body, Query string parameters + def self.transcode_access_secret_version_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :get, + uri_template: "/v1beta1/{name}:access", + matches: [ + ["name", %r{^projects/[^/]+/secrets/[^/]+/versions/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the disable_secret_version REST call + # + # @param request_pb [::Google::Cloud::SecretManager::V1beta1::DisableSecretVersionRequest] + # A request object representing the call parameters. Required. + # @return [Array(String, [String, nil], Hash{String => String})] + # Uri, Body, Query string parameters + def self.transcode_disable_secret_version_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :post, + uri_template: "/v1beta1/{name}:disable", + body: "*", + matches: [ + ["name", %r{^projects/[^/]+/secrets/[^/]+/versions/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the enable_secret_version REST call + # + # @param request_pb [::Google::Cloud::SecretManager::V1beta1::EnableSecretVersionRequest] + # A request object representing the call parameters. Required. + # @return [Array(String, [String, nil], Hash{String => String})] + # Uri, Body, Query string parameters + def self.transcode_enable_secret_version_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :post, + uri_template: "/v1beta1/{name}:enable", + body: "*", + matches: [ + ["name", %r{^projects/[^/]+/secrets/[^/]+/versions/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the destroy_secret_version REST call + # + # @param request_pb [::Google::Cloud::SecretManager::V1beta1::DestroySecretVersionRequest] + # A request object representing the call parameters. Required. + # @return [Array(String, [String, nil], Hash{String => String})] + # Uri, Body, Query string parameters + def self.transcode_destroy_secret_version_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :post, + uri_template: "/v1beta1/{name}:destroy", + body: "*", + matches: [ + ["name", %r{^projects/[^/]+/secrets/[^/]+/versions/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the set_iam_policy REST call + # + # @param request_pb [::Google::Iam::V1::SetIamPolicyRequest] + # A request object representing the call parameters. Required. + # @return [Array(String, [String, nil], Hash{String => String})] + # Uri, Body, Query string parameters + def self.transcode_set_iam_policy_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :post, + uri_template: "/v1beta1/{resource}:setIamPolicy", + body: "*", + matches: [ + ["resource", %r{^projects/[^/]+/secrets/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the get_iam_policy REST call + # + # @param request_pb [::Google::Iam::V1::GetIamPolicyRequest] + # A request object representing the call parameters. Required. + # @return [Array(String, [String, nil], Hash{String => String})] + # Uri, Body, Query string parameters + def self.transcode_get_iam_policy_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :get, + uri_template: "/v1beta1/{resource}:getIamPolicy", + matches: [ + ["resource", %r{^projects/[^/]+/secrets/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the test_iam_permissions REST call + # + # @param request_pb [::Google::Iam::V1::TestIamPermissionsRequest] + # A request object representing the call parameters. Required. + # @return [Array(String, [String, nil], Hash{String => String})] + # Uri, Body, Query string parameters + def self.transcode_test_iam_permissions_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :post, + uri_template: "/v1beta1/{resource}:testIamPermissions", + body: "*", + matches: [ + ["resource", %r{^projects/[^/]+/secrets/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + end + end + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-secret_manager-v1beta1/lib/google/cloud/secret_manager/v1beta1/version.rb b/owl-bot-staging/google-cloud-secret_manager-v1beta1/lib/google/cloud/secret_manager/v1beta1/version.rb new file mode 100644 index 000000000000..9b5192150b89 --- /dev/null +++ b/owl-bot-staging/google-cloud-secret_manager-v1beta1/lib/google/cloud/secret_manager/v1beta1/version.rb @@ -0,0 +1,28 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + + +module Google + module Cloud + module SecretManager + module V1beta1 + VERSION = "0.0.1" + end + end + end +end diff --git a/owl-bot-staging/google-cloud-secret_manager-v1beta1/lib/google/cloud/secrets/v1beta1/resources_pb.rb b/owl-bot-staging/google-cloud-secret_manager-v1beta1/lib/google/cloud/secrets/v1beta1/resources_pb.rb new file mode 100644 index 000000000000..0bc06c21b282 --- /dev/null +++ b/owl-bot-staging/google-cloud-secret_manager-v1beta1/lib/google/cloud/secrets/v1beta1/resources_pb.rb @@ -0,0 +1,32 @@ +# frozen_string_literal: true +# Generated by the protocol buffer compiler. DO NOT EDIT! +# source: google/cloud/secrets/v1beta1/resources.proto + +require 'google/protobuf' + +require 'google/api/field_behavior_pb' +require 'google/api/resource_pb' +require 'google/protobuf/timestamp_pb' + + +descriptor_data = "\n,google/cloud/secrets/v1beta1/resources.proto\x12\x1cgoogle.cloud.secrets.v1beta1\x1a\x1fgoogle/api/field_behavior.proto\x1a\x19google/api/resource.proto\x1a\x1fgoogle/protobuf/timestamp.proto\"\xd9\x02\n\x06Secret\x12\x11\n\x04name\x18\x01 \x01(\tB\x03\xe0\x41\x03\x12\x46\n\x0breplication\x18\x02 \x01(\x0b\x32).google.cloud.secrets.v1beta1.ReplicationB\x06\xe0\x41\x05\xe0\x41\x02\x12\x34\n\x0b\x63reate_time\x18\x03 \x01(\x0b\x32\x1a.google.protobuf.TimestampB\x03\xe0\x41\x03\x12@\n\x06labels\x18\x04 \x03(\x0b\x32\x30.google.cloud.secrets.v1beta1.Secret.LabelsEntry\x1a-\n\x0bLabelsEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12\r\n\x05value\x18\x02 \x01(\t:\x02\x38\x01:M\xea\x41J\n#secretmanager.googleapis.com/Secret\x12#projects/{project}/secrets/{secret}\"\x90\x03\n\rSecretVersion\x12\x11\n\x04name\x18\x01 \x01(\tB\x03\xe0\x41\x03\x12\x34\n\x0b\x63reate_time\x18\x02 \x01(\x0b\x32\x1a.google.protobuf.TimestampB\x03\xe0\x41\x03\x12\x35\n\x0c\x64\x65stroy_time\x18\x03 \x01(\x0b\x32\x1a.google.protobuf.TimestampB\x03\xe0\x41\x03\x12\x45\n\x05state\x18\x04 \x01(\x0e\x32\x31.google.cloud.secrets.v1beta1.SecretVersion.StateB\x03\xe0\x41\x03\"H\n\x05State\x12\x15\n\x11STATE_UNSPECIFIED\x10\x00\x12\x0b\n\x07\x45NABLED\x10\x01\x12\x0c\n\x08\x44ISABLED\x10\x02\x12\r\n\tDESTROYED\x10\x03:n\xea\x41k\n*secretmanager.googleapis.com/SecretVersion\x12=projects/{project}/secrets/{secret}/versions/{secret_version}\"\xc5\x02\n\x0bReplication\x12H\n\tautomatic\x18\x01 \x01(\x0b\x32\x33.google.cloud.secrets.v1beta1.Replication.AutomaticH\x00\x12M\n\x0cuser_managed\x18\x02 \x01(\x0b\x32\x35.google.cloud.secrets.v1beta1.Replication.UserManagedH\x00\x1a\x0b\n\tAutomatic\x1a\x80\x01\n\x0bUserManaged\x12T\n\x08replicas\x18\x01 \x03(\x0b\x32=.google.cloud.secrets.v1beta1.Replication.UserManaged.ReplicaB\x03\xe0\x41\x02\x1a\x1b\n\x07Replica\x12\x10\n\x08location\x18\x01 \x01(\tB\r\n\x0breplication\"\x1d\n\rSecretPayload\x12\x0c\n\x04\x64\x61ta\x18\x01 \x01(\x0c\x42\xee\x01\n&com.google.cloud.secretmanager.v1beta1B\x0eResourcesProtoP\x01Z:cloud.google.com/go/secrets/apiv1beta1/secretspb;secretspb\xa2\x02\x03GSM\xaa\x02\"Google.Cloud.SecretManager.V1Beta1\xca\x02\"Google\\Cloud\\SecretManager\\V1beta1\xea\x02%Google::Cloud::SecretManager::V1beta1b\x06proto3" + +pool = ::Google::Protobuf::DescriptorPool.generated_pool +pool.add_serialized_file(descriptor_data) + +module Google + module Cloud + module SecretManager + module V1beta1 + Secret = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.secrets.v1beta1.Secret").msgclass + SecretVersion = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.secrets.v1beta1.SecretVersion").msgclass + SecretVersion::State = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.secrets.v1beta1.SecretVersion.State").enummodule + Replication = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.secrets.v1beta1.Replication").msgclass + Replication::Automatic = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.secrets.v1beta1.Replication.Automatic").msgclass + Replication::UserManaged = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.secrets.v1beta1.Replication.UserManaged").msgclass + Replication::UserManaged::Replica = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.secrets.v1beta1.Replication.UserManaged.Replica").msgclass + SecretPayload = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.secrets.v1beta1.SecretPayload").msgclass + end + end + end +end diff --git a/owl-bot-staging/google-cloud-secret_manager-v1beta1/lib/google/cloud/secrets/v1beta1/service_pb.rb b/owl-bot-staging/google-cloud-secret_manager-v1beta1/lib/google/cloud/secrets/v1beta1/service_pb.rb new file mode 100644 index 000000000000..af5986516c2c --- /dev/null +++ b/owl-bot-staging/google-cloud-secret_manager-v1beta1/lib/google/cloud/secrets/v1beta1/service_pb.rb @@ -0,0 +1,45 @@ +# frozen_string_literal: true +# Generated by the protocol buffer compiler. DO NOT EDIT! +# source: google/cloud/secrets/v1beta1/service.proto + +require 'google/protobuf' + +require 'google/api/annotations_pb' +require 'google/api/client_pb' +require 'google/api/field_behavior_pb' +require 'google/api/resource_pb' +require 'google/cloud/secrets/v1beta1/resources_pb' +require 'google/iam/v1/iam_policy_pb' +require 'google/iam/v1/policy_pb' +require 'google/protobuf/empty_pb' +require 'google/protobuf/field_mask_pb' + + +descriptor_data = "\n*google/cloud/secrets/v1beta1/service.proto\x12\x1cgoogle.cloud.secrets.v1beta1\x1a\x1cgoogle/api/annotations.proto\x1a\x17google/api/client.proto\x1a\x1fgoogle/api/field_behavior.proto\x1a\x19google/api/resource.proto\x1a,google/cloud/secrets/v1beta1/resources.proto\x1a\x1egoogle/iam/v1/iam_policy.proto\x1a\x1agoogle/iam/v1/policy.proto\x1a\x1bgoogle/protobuf/empty.proto\x1a google/protobuf/field_mask.proto\"\x8a\x01\n\x12ListSecretsRequest\x12\x43\n\x06parent\x18\x01 \x01(\tB3\xe0\x41\x02\xfa\x41-\n+cloudresourcemanager.googleapis.com/Project\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\"y\n\x13ListSecretsResponse\x12\x35\n\x07secrets\x18\x01 \x03(\x0b\x32$.google.cloud.secrets.v1beta1.Secret\x12\x17\n\x0fnext_page_token\x18\x02 \x01(\t\x12\x12\n\ntotal_size\x18\x03 \x01(\x05\"\xad\x01\n\x13\x43reateSecretRequest\x12\x43\n\x06parent\x18\x01 \x01(\tB3\xe0\x41\x02\xfa\x41-\n+cloudresourcemanager.googleapis.com/Project\x12\x16\n\tsecret_id\x18\x02 \x01(\tB\x03\xe0\x41\x02\x12\x39\n\x06secret\x18\x03 \x01(\x0b\x32$.google.cloud.secrets.v1beta1.SecretB\x03\xe0\x41\x02\"\x99\x01\n\x17\x41\x64\x64SecretVersionRequest\x12;\n\x06parent\x18\x01 \x01(\tB+\xe0\x41\x02\xfa\x41%\n#secretmanager.googleapis.com/Secret\x12\x41\n\x07payload\x18\x02 \x01(\x0b\x32+.google.cloud.secrets.v1beta1.SecretPayloadB\x03\xe0\x41\x02\"M\n\x10GetSecretRequest\x12\x39\n\x04name\x18\x01 \x01(\tB+\xe0\x41\x02\xfa\x41%\n#secretmanager.googleapis.com/Secret\"\x89\x01\n\x19ListSecretVersionsRequest\x12;\n\x06parent\x18\x01 \x01(\tB+\xe0\x41\x02\xfa\x41%\n#secretmanager.googleapis.com/Secret\x12\x16\n\tpage_size\x18\x02 \x01(\x05\x42\x03\xe0\x41\x01\x12\x17\n\npage_token\x18\x03 \x01(\tB\x03\xe0\x41\x01\"\x88\x01\n\x1aListSecretVersionsResponse\x12=\n\x08versions\x18\x01 \x03(\x0b\x32+.google.cloud.secrets.v1beta1.SecretVersion\x12\x17\n\x0fnext_page_token\x18\x02 \x01(\t\x12\x12\n\ntotal_size\x18\x03 \x01(\x05\"[\n\x17GetSecretVersionRequest\x12@\n\x04name\x18\x01 \x01(\tB2\xe0\x41\x02\xfa\x41,\n*secretmanager.googleapis.com/SecretVersion\"\x86\x01\n\x13UpdateSecretRequest\x12\x39\n\x06secret\x18\x01 \x01(\x0b\x32$.google.cloud.secrets.v1beta1.SecretB\x03\xe0\x41\x02\x12\x34\n\x0bupdate_mask\x18\x02 \x01(\x0b\x32\x1a.google.protobuf.FieldMaskB\x03\xe0\x41\x02\"^\n\x1a\x41\x63\x63\x65ssSecretVersionRequest\x12@\n\x04name\x18\x01 \x01(\tB2\xe0\x41\x02\xfa\x41,\n*secretmanager.googleapis.com/SecretVersion\"\x9a\x01\n\x1b\x41\x63\x63\x65ssSecretVersionResponse\x12=\n\x04name\x18\x01 \x01(\tB/\xfa\x41,\n*secretmanager.googleapis.com/SecretVersion\x12<\n\x07payload\x18\x02 \x01(\x0b\x32+.google.cloud.secrets.v1beta1.SecretPayload\"P\n\x13\x44\x65leteSecretRequest\x12\x39\n\x04name\x18\x01 \x01(\tB+\xe0\x41\x02\xfa\x41%\n#secretmanager.googleapis.com/Secret\"_\n\x1b\x44isableSecretVersionRequest\x12@\n\x04name\x18\x01 \x01(\tB2\xe0\x41\x02\xfa\x41,\n*secretmanager.googleapis.com/SecretVersion\"^\n\x1a\x45nableSecretVersionRequest\x12@\n\x04name\x18\x01 \x01(\tB2\xe0\x41\x02\xfa\x41,\n*secretmanager.googleapis.com/SecretVersion\"_\n\x1b\x44\x65stroySecretVersionRequest\x12@\n\x04name\x18\x01 \x01(\tB2\xe0\x41\x02\xfa\x41,\n*secretmanager.googleapis.com/SecretVersion2\x83\x16\n\x14SecretManagerService\x12\xa9\x01\n\x0bListSecrets\x12\x30.google.cloud.secrets.v1beta1.ListSecretsRequest\x1a\x31.google.cloud.secrets.v1beta1.ListSecretsResponse\"5\xda\x41\x06parent\x82\xd3\xe4\x93\x02&\x12$/v1beta1/{parent=projects/*}/secrets\x12\xb7\x01\n\x0c\x43reateSecret\x12\x31.google.cloud.secrets.v1beta1.CreateSecretRequest\x1a$.google.cloud.secrets.v1beta1.Secret\"N\xda\x41\x17parent,secret_id,secret\x82\xd3\xe4\x93\x02.\"$/v1beta1/{parent=projects/*}/secrets:\x06secret\x12\xc5\x01\n\x10\x41\x64\x64SecretVersion\x12\x35.google.cloud.secrets.v1beta1.AddSecretVersionRequest\x1a+.google.cloud.secrets.v1beta1.SecretVersion\"M\xda\x41\x0eparent,payload\x82\xd3\xe4\x93\x02\x36\"1/v1beta1/{parent=projects/*/secrets/*}:addVersion:\x01*\x12\x96\x01\n\tGetSecret\x12..google.cloud.secrets.v1beta1.GetSecretRequest\x1a$.google.cloud.secrets.v1beta1.Secret\"3\xda\x41\x04name\x82\xd3\xe4\x93\x02&\x12$/v1beta1/{name=projects/*/secrets/*}\x12\xb9\x01\n\x0cUpdateSecret\x12\x31.google.cloud.secrets.v1beta1.UpdateSecretRequest\x1a$.google.cloud.secrets.v1beta1.Secret\"P\xda\x41\x12secret,update_mask\x82\xd3\xe4\x93\x02\x35\x32+/v1beta1/{secret.name=projects/*/secrets/*}:\x06secret\x12\x8e\x01\n\x0c\x44\x65leteSecret\x12\x31.google.cloud.secrets.v1beta1.DeleteSecretRequest\x1a\x16.google.protobuf.Empty\"3\xda\x41\x04name\x82\xd3\xe4\x93\x02&*$/v1beta1/{name=projects/*/secrets/*}\x12\xc9\x01\n\x12ListSecretVersions\x12\x37.google.cloud.secrets.v1beta1.ListSecretVersionsRequest\x1a\x38.google.cloud.secrets.v1beta1.ListSecretVersionsResponse\"@\xda\x41\x06parent\x82\xd3\xe4\x93\x02\x31\x12//v1beta1/{parent=projects/*/secrets/*}/versions\x12\xb6\x01\n\x10GetSecretVersion\x12\x35.google.cloud.secrets.v1beta1.GetSecretVersionRequest\x1a+.google.cloud.secrets.v1beta1.SecretVersion\">\xda\x41\x04name\x82\xd3\xe4\x93\x02\x31\x12//v1beta1/{name=projects/*/secrets/*/versions/*}\x12\xd1\x01\n\x13\x41\x63\x63\x65ssSecretVersion\x12\x38.google.cloud.secrets.v1beta1.AccessSecretVersionRequest\x1a\x39.google.cloud.secrets.v1beta1.AccessSecretVersionResponse\"E\xda\x41\x04name\x82\xd3\xe4\x93\x02\x38\x12\x36/v1beta1/{name=projects/*/secrets/*/versions/*}:access\x12\xc9\x01\n\x14\x44isableSecretVersion\x12\x39.google.cloud.secrets.v1beta1.DisableSecretVersionRequest\x1a+.google.cloud.secrets.v1beta1.SecretVersion\"I\xda\x41\x04name\x82\xd3\xe4\x93\x02<\"7/v1beta1/{name=projects/*/secrets/*/versions/*}:disable:\x01*\x12\xc6\x01\n\x13\x45nableSecretVersion\x12\x38.google.cloud.secrets.v1beta1.EnableSecretVersionRequest\x1a+.google.cloud.secrets.v1beta1.SecretVersion\"H\xda\x41\x04name\x82\xd3\xe4\x93\x02;\"6/v1beta1/{name=projects/*/secrets/*/versions/*}:enable:\x01*\x12\xc9\x01\n\x14\x44\x65stroySecretVersion\x12\x39.google.cloud.secrets.v1beta1.DestroySecretVersionRequest\x1a+.google.cloud.secrets.v1beta1.SecretVersion\"I\xda\x41\x04name\x82\xd3\xe4\x93\x02<\"7/v1beta1/{name=projects/*/secrets/*/versions/*}:destroy:\x01*\x12\x8b\x01\n\x0cSetIamPolicy\x12\".google.iam.v1.SetIamPolicyRequest\x1a\x15.google.iam.v1.Policy\"@\x82\xd3\xe4\x93\x02:\"5/v1beta1/{resource=projects/*/secrets/*}:setIamPolicy:\x01*\x12\x88\x01\n\x0cGetIamPolicy\x12\".google.iam.v1.GetIamPolicyRequest\x1a\x15.google.iam.v1.Policy\"=\x82\xd3\xe4\x93\x02\x37\x12\x35/v1beta1/{resource=projects/*/secrets/*}:getIamPolicy\x12\xb1\x01\n\x12TestIamPermissions\x12(.google.iam.v1.TestIamPermissionsRequest\x1a).google.iam.v1.TestIamPermissionsResponse\"F\x82\xd3\xe4\x93\x02@\";/v1beta1/{resource=projects/*/secrets/*}:testIamPermissions:\x01*\x1aP\xca\x41\x1csecretmanager.googleapis.com\xd2\x41.https://www.googleapis.com/auth/cloud-platformB\xec\x01\n&com.google.cloud.secretmanager.v1beta1B\x0cServiceProtoP\x01Z:cloud.google.com/go/secrets/apiv1beta1/secretspb;secretspb\xa2\x02\x03GSM\xaa\x02\"Google.Cloud.SecretManager.V1Beta1\xca\x02\"Google\\Cloud\\SecretManager\\V1beta1\xea\x02%Google::Cloud::SecretManager::V1beta1b\x06proto3" + +pool = ::Google::Protobuf::DescriptorPool.generated_pool +pool.add_serialized_file(descriptor_data) + +module Google + module Cloud + module SecretManager + module V1beta1 + ListSecretsRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.secrets.v1beta1.ListSecretsRequest").msgclass + ListSecretsResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.secrets.v1beta1.ListSecretsResponse").msgclass + CreateSecretRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.secrets.v1beta1.CreateSecretRequest").msgclass + AddSecretVersionRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.secrets.v1beta1.AddSecretVersionRequest").msgclass + GetSecretRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.secrets.v1beta1.GetSecretRequest").msgclass + ListSecretVersionsRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.secrets.v1beta1.ListSecretVersionsRequest").msgclass + ListSecretVersionsResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.secrets.v1beta1.ListSecretVersionsResponse").msgclass + GetSecretVersionRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.secrets.v1beta1.GetSecretVersionRequest").msgclass + UpdateSecretRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.secrets.v1beta1.UpdateSecretRequest").msgclass + AccessSecretVersionRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.secrets.v1beta1.AccessSecretVersionRequest").msgclass + AccessSecretVersionResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.secrets.v1beta1.AccessSecretVersionResponse").msgclass + DeleteSecretRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.secrets.v1beta1.DeleteSecretRequest").msgclass + DisableSecretVersionRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.secrets.v1beta1.DisableSecretVersionRequest").msgclass + EnableSecretVersionRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.secrets.v1beta1.EnableSecretVersionRequest").msgclass + DestroySecretVersionRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.secrets.v1beta1.DestroySecretVersionRequest").msgclass + end + end + end +end diff --git a/owl-bot-staging/google-cloud-secret_manager-v1beta1/lib/google/cloud/secrets/v1beta1/service_services_pb.rb b/owl-bot-staging/google-cloud-secret_manager-v1beta1/lib/google/cloud/secrets/v1beta1/service_services_pb.rb new file mode 100644 index 000000000000..3ffb62db71bb --- /dev/null +++ b/owl-bot-staging/google-cloud-secret_manager-v1beta1/lib/google/cloud/secrets/v1beta1/service_services_pb.rb @@ -0,0 +1,117 @@ +# Generated by the protocol buffer compiler. DO NOT EDIT! +# Source: google/cloud/secrets/v1beta1/service.proto for package 'Google.Cloud.SecretManager.V1beta1' +# Original file comments: +# 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 +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# + +require 'grpc' +require 'google/cloud/secrets/v1beta1/service_pb' + +module Google + module Cloud + module SecretManager + module V1beta1 + module SecretManagerService + # Secret Manager Service + # + # Manages secrets and operations using those secrets. Implements a REST + # model with the following objects: + # + # * [Secret][google.cloud.secrets.v1beta1.Secret] + # * [SecretVersion][google.cloud.secrets.v1beta1.SecretVersion] + class Service + + include ::GRPC::GenericService + + self.marshal_class_method = :encode + self.unmarshal_class_method = :decode + self.service_name = 'google.cloud.secrets.v1beta1.SecretManagerService' + + # Lists [Secrets][google.cloud.secrets.v1beta1.Secret]. + rpc :ListSecrets, ::Google::Cloud::SecretManager::V1beta1::ListSecretsRequest, ::Google::Cloud::SecretManager::V1beta1::ListSecretsResponse + # Creates a new [Secret][google.cloud.secrets.v1beta1.Secret] containing no + # [SecretVersions][google.cloud.secrets.v1beta1.SecretVersion]. + rpc :CreateSecret, ::Google::Cloud::SecretManager::V1beta1::CreateSecretRequest, ::Google::Cloud::SecretManager::V1beta1::Secret + # Creates a new [SecretVersion][google.cloud.secrets.v1beta1.SecretVersion] + # containing secret data and attaches it to an existing + # [Secret][google.cloud.secrets.v1beta1.Secret]. + rpc :AddSecretVersion, ::Google::Cloud::SecretManager::V1beta1::AddSecretVersionRequest, ::Google::Cloud::SecretManager::V1beta1::SecretVersion + # Gets metadata for a given [Secret][google.cloud.secrets.v1beta1.Secret]. + rpc :GetSecret, ::Google::Cloud::SecretManager::V1beta1::GetSecretRequest, ::Google::Cloud::SecretManager::V1beta1::Secret + # Updates metadata of an existing + # [Secret][google.cloud.secrets.v1beta1.Secret]. + rpc :UpdateSecret, ::Google::Cloud::SecretManager::V1beta1::UpdateSecretRequest, ::Google::Cloud::SecretManager::V1beta1::Secret + # Deletes a [Secret][google.cloud.secrets.v1beta1.Secret]. + rpc :DeleteSecret, ::Google::Cloud::SecretManager::V1beta1::DeleteSecretRequest, ::Google::Protobuf::Empty + # Lists [SecretVersions][google.cloud.secrets.v1beta1.SecretVersion]. This + # call does not return secret data. + rpc :ListSecretVersions, ::Google::Cloud::SecretManager::V1beta1::ListSecretVersionsRequest, ::Google::Cloud::SecretManager::V1beta1::ListSecretVersionsResponse + # Gets metadata for a + # [SecretVersion][google.cloud.secrets.v1beta1.SecretVersion]. + # + # `projects/*/secrets/*/versions/latest` is an alias to the `latest` + # [SecretVersion][google.cloud.secrets.v1beta1.SecretVersion]. + rpc :GetSecretVersion, ::Google::Cloud::SecretManager::V1beta1::GetSecretVersionRequest, ::Google::Cloud::SecretManager::V1beta1::SecretVersion + # Accesses a [SecretVersion][google.cloud.secrets.v1beta1.SecretVersion]. + # This call returns the secret data. + # + # `projects/*/secrets/*/versions/latest` is an alias to the `latest` + # [SecretVersion][google.cloud.secrets.v1beta1.SecretVersion]. + rpc :AccessSecretVersion, ::Google::Cloud::SecretManager::V1beta1::AccessSecretVersionRequest, ::Google::Cloud::SecretManager::V1beta1::AccessSecretVersionResponse + # Disables a [SecretVersion][google.cloud.secrets.v1beta1.SecretVersion]. + # + # Sets the [state][google.cloud.secrets.v1beta1.SecretVersion.state] of the + # [SecretVersion][google.cloud.secrets.v1beta1.SecretVersion] to + # [DISABLED][google.cloud.secrets.v1beta1.SecretVersion.State.DISABLED]. + rpc :DisableSecretVersion, ::Google::Cloud::SecretManager::V1beta1::DisableSecretVersionRequest, ::Google::Cloud::SecretManager::V1beta1::SecretVersion + # Enables a [SecretVersion][google.cloud.secrets.v1beta1.SecretVersion]. + # + # Sets the [state][google.cloud.secrets.v1beta1.SecretVersion.state] of the + # [SecretVersion][google.cloud.secrets.v1beta1.SecretVersion] to + # [ENABLED][google.cloud.secrets.v1beta1.SecretVersion.State.ENABLED]. + rpc :EnableSecretVersion, ::Google::Cloud::SecretManager::V1beta1::EnableSecretVersionRequest, ::Google::Cloud::SecretManager::V1beta1::SecretVersion + # Destroys a [SecretVersion][google.cloud.secrets.v1beta1.SecretVersion]. + # + # Sets the [state][google.cloud.secrets.v1beta1.SecretVersion.state] of the + # [SecretVersion][google.cloud.secrets.v1beta1.SecretVersion] to + # [DESTROYED][google.cloud.secrets.v1beta1.SecretVersion.State.DESTROYED] and + # irrevocably destroys the secret data. + rpc :DestroySecretVersion, ::Google::Cloud::SecretManager::V1beta1::DestroySecretVersionRequest, ::Google::Cloud::SecretManager::V1beta1::SecretVersion + # Sets the access control policy on the specified secret. Replaces any + # existing policy. + # + # Permissions on [SecretVersions][google.cloud.secrets.v1beta1.SecretVersion] + # are enforced according to the policy set on the associated + # [Secret][google.cloud.secrets.v1beta1.Secret]. + rpc :SetIamPolicy, ::Google::Iam::V1::SetIamPolicyRequest, ::Google::Iam::V1::Policy + # Gets the access control policy for a secret. + # Returns empty policy if the secret exists and does not have a policy set. + rpc :GetIamPolicy, ::Google::Iam::V1::GetIamPolicyRequest, ::Google::Iam::V1::Policy + # Returns permissions that a caller has for the specified secret. + # If the secret does not exist, this call returns an empty set of + # permissions, not a NOT_FOUND error. + # + # Note: This operation is designed to be used for building permission-aware + # UIs and command-line tools, not for authorization checking. This operation + # may "fail open" without warning. + rpc :TestIamPermissions, ::Google::Iam::V1::TestIamPermissionsRequest, ::Google::Iam::V1::TestIamPermissionsResponse + end + + Stub = Service.rpc_stub_class + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-secret_manager-v1beta1/proto_docs/README.md b/owl-bot-staging/google-cloud-secret_manager-v1beta1/proto_docs/README.md new file mode 100644 index 000000000000..0040e72113a2 --- /dev/null +++ b/owl-bot-staging/google-cloud-secret_manager-v1beta1/proto_docs/README.md @@ -0,0 +1,4 @@ +# Secret Manager V1beta1 Protocol Buffer Documentation + +These files are for the YARD documentation of the generated protobuf files. +They are not intended to be required or loaded at runtime. diff --git a/owl-bot-staging/google-cloud-secret_manager-v1beta1/proto_docs/google/api/client.rb b/owl-bot-staging/google-cloud-secret_manager-v1beta1/proto_docs/google/api/client.rb new file mode 100644 index 000000000000..5089551e9ea4 --- /dev/null +++ b/owl-bot-staging/google-cloud-secret_manager-v1beta1/proto_docs/google/api/client.rb @@ -0,0 +1,589 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + + +module Google + module Api + # Required information for every language. + # @!attribute [rw] reference_docs_uri + # @deprecated This field is deprecated and may be removed in the next major version update. + # @return [::String] + # Link to automatically generated reference documentation. Example: + # https://cloud.google.com/nodejs/docs/reference/asset/latest + # @!attribute [rw] destinations + # @return [::Array<::Google::Api::ClientLibraryDestination>] + # The destination where API teams want this client library to be published. + # @!attribute [rw] selective_gapic_generation + # @return [::Google::Api::SelectiveGapicGeneration] + # Configuration for which RPCs should be generated in the GAPIC client. + class CommonLanguageSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Details about how and where to publish client libraries. + # @!attribute [rw] version + # @return [::String] + # Version of the API to apply these settings to. This is the full protobuf + # package for the API, ending in the version element. + # Examples: "google.cloud.speech.v1" and "google.spanner.admin.database.v1". + # @!attribute [rw] launch_stage + # @return [::Google::Api::LaunchStage] + # Launch stage of this version of the API. + # @!attribute [rw] rest_numeric_enums + # @return [::Boolean] + # When using transport=rest, the client request will encode enums as + # numbers rather than strings. + # @!attribute [rw] java_settings + # @return [::Google::Api::JavaSettings] + # Settings for legacy Java features, supported in the Service YAML. + # @!attribute [rw] cpp_settings + # @return [::Google::Api::CppSettings] + # Settings for C++ client libraries. + # @!attribute [rw] php_settings + # @return [::Google::Api::PhpSettings] + # Settings for PHP client libraries. + # @!attribute [rw] python_settings + # @return [::Google::Api::PythonSettings] + # Settings for Python client libraries. + # @!attribute [rw] node_settings + # @return [::Google::Api::NodeSettings] + # Settings for Node client libraries. + # @!attribute [rw] dotnet_settings + # @return [::Google::Api::DotnetSettings] + # Settings for .NET client libraries. + # @!attribute [rw] ruby_settings + # @return [::Google::Api::RubySettings] + # Settings for Ruby client libraries. + # @!attribute [rw] go_settings + # @return [::Google::Api::GoSettings] + # Settings for Go client libraries. + class ClientLibrarySettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # This message configures the settings for publishing [Google Cloud Client + # libraries](https://cloud.google.com/apis/docs/cloud-client-libraries) + # generated from the service config. + # @!attribute [rw] method_settings + # @return [::Array<::Google::Api::MethodSettings>] + # A list of API method settings, e.g. the behavior for methods that use the + # long-running operation pattern. + # @!attribute [rw] new_issue_uri + # @return [::String] + # Link to a *public* URI where users can report issues. Example: + # https://issuetracker.google.com/issues/new?component=190865&template=1161103 + # @!attribute [rw] documentation_uri + # @return [::String] + # Link to product home page. Example: + # https://cloud.google.com/asset-inventory/docs/overview + # @!attribute [rw] api_short_name + # @return [::String] + # Used as a tracking tag when collecting data about the APIs developer + # relations artifacts like docs, packages delivered to package managers, + # etc. Example: "speech". + # @!attribute [rw] github_label + # @return [::String] + # GitHub label to apply to issues and pull requests opened for this API. + # @!attribute [rw] codeowner_github_teams + # @return [::Array<::String>] + # GitHub teams to be added to CODEOWNERS in the directory in GitHub + # containing source code for the client libraries for this API. + # @!attribute [rw] doc_tag_prefix + # @return [::String] + # A prefix used in sample code when demarking regions to be included in + # documentation. + # @!attribute [rw] organization + # @return [::Google::Api::ClientLibraryOrganization] + # For whom the client library is being published. + # @!attribute [rw] library_settings + # @return [::Array<::Google::Api::ClientLibrarySettings>] + # Client library settings. If the same version string appears multiple + # times in this list, then the last one wins. Settings from earlier + # settings with the same version string are discarded. + # @!attribute [rw] proto_reference_documentation_uri + # @return [::String] + # Optional link to proto reference documentation. Example: + # https://cloud.google.com/pubsub/lite/docs/reference/rpc + # @!attribute [rw] rest_reference_documentation_uri + # @return [::String] + # Optional link to REST reference documentation. Example: + # https://cloud.google.com/pubsub/lite/docs/reference/rest + class Publishing + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Settings for Java client libraries. + # @!attribute [rw] library_package + # @return [::String] + # The package name to use in Java. Clobbers the java_package option + # set in the protobuf. This should be used **only** by APIs + # who have already set the language_settings.java.package_name" field + # in gapic.yaml. API teams should use the protobuf java_package option + # where possible. + # + # Example of a YAML configuration:: + # + # publishing: + # 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. + # @!attribute [rw] methods + # @return [::Array<::String>] + # An allowlist of the fully qualified names of RPCs that should be included + # on public client surfaces. + # @!attribute [rw] generate_omitted_as_internal + # @return [::Boolean] + # Setting this to true indicates to the client generators that methods + # that would be excluded from the generation should instead be generated + # in a way that indicates these methods should not be consumed by + # end users. How this is expressed is up to individual language + # implementations to decide. Some examples may be: added annotations, + # obfuscated identifiers, or other language idiomatic patterns. + class SelectiveGapicGeneration + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # `BatchingConfigProto` defines the batching configuration for an API method. + # @!attribute [rw] thresholds + # @return [::Google::Api::BatchingSettingsProto] + # The thresholds which trigger a batched request to be sent. + # @!attribute [rw] batch_descriptor + # @return [::Google::Api::BatchingDescriptorProto] + # The request and response fields used in batching. + class BatchingConfigProto + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # `BatchingSettingsProto` specifies a set of batching thresholds, each of + # which acts as a trigger to send a batch of messages as a request. At least + # one threshold must be positive nonzero. + # @!attribute [rw] element_count_threshold + # @return [::Integer] + # The number of elements of a field collected into a batch which, if + # exceeded, causes the batch to be sent. + # @!attribute [rw] request_byte_threshold + # @return [::Integer] + # The aggregated size of the batched field which, if exceeded, causes the + # batch to be sent. This size is computed by aggregating the sizes of the + # request field to be batched, not of the entire request message. + # @!attribute [rw] delay_threshold + # @return [::Google::Protobuf::Duration] + # The duration after which a batch should be sent, starting from the addition + # of the first message to that batch. + # @!attribute [rw] element_count_limit + # @return [::Integer] + # The maximum number of elements collected in a batch that could be accepted + # by server. + # @!attribute [rw] request_byte_limit + # @return [::Integer] + # The maximum size of the request that could be accepted by server. + # @!attribute [rw] flow_control_element_limit + # @return [::Integer] + # The maximum number of elements allowed by flow control. + # @!attribute [rw] flow_control_byte_limit + # @return [::Integer] + # The maximum size of data allowed by flow control. + # @!attribute [rw] flow_control_limit_exceeded_behavior + # @return [::Google::Api::FlowControlLimitExceededBehaviorProto] + # The behavior to take when the flow control limit is exceeded. + class BatchingSettingsProto + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # `BatchingDescriptorProto` specifies the fields of the request message to be + # used for batching, and, optionally, the fields of the response message to be + # used for demultiplexing. + # @!attribute [rw] batched_field + # @return [::String] + # The repeated field in the request message to be aggregated by batching. + # @!attribute [rw] discriminator_fields + # @return [::Array<::String>] + # A list of the fields in the request message. Two requests will be batched + # together only if the values of every field specified in + # `request_discriminator_fields` is equal between the two requests. + # @!attribute [rw] subresponse_field + # @return [::String] + # Optional. When present, indicates the field in the response message to be + # used to demultiplex the response into multiple response messages, in + # correspondence with the multiple request messages originally batched + # together. + class BatchingDescriptorProto + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # The organization for which the client libraries are being published. + # Affects the url where generated docs are published, etc. + module ClientLibraryOrganization + # Not useful. + CLIENT_LIBRARY_ORGANIZATION_UNSPECIFIED = 0 + + # Google Cloud Platform Org. + CLOUD = 1 + + # Ads (Advertising) Org. + ADS = 2 + + # Photos Org. + PHOTOS = 3 + + # Street View Org. + STREET_VIEW = 4 + + # Shopping Org. + SHOPPING = 5 + + # Geo Org. + GEO = 6 + + # Generative AI - https://developers.generativeai.google + GENERATIVE_AI = 7 + end + + # To where should client libraries be published? + module ClientLibraryDestination + # Client libraries will neither be generated nor published to package + # managers. + CLIENT_LIBRARY_DESTINATION_UNSPECIFIED = 0 + + # Generate the client library in a repo under github.com/googleapis, + # but don't publish it to package managers. + GITHUB = 10 + + # Publish the library to package managers like nuget.org and npmjs.com. + PACKAGE_MANAGER = 20 + end + + # The behavior to take when the flow control limit is exceeded. + module FlowControlLimitExceededBehaviorProto + # Default behavior, system-defined. + UNSET_BEHAVIOR = 0 + + # Stop operation, raise error. + THROW_EXCEPTION = 1 + + # Pause operation until limit clears. + BLOCK = 2 + + # Continue operation, disregard limit. + IGNORE = 3 + end + end +end diff --git a/owl-bot-staging/google-cloud-secret_manager-v1beta1/proto_docs/google/api/field_behavior.rb b/owl-bot-staging/google-cloud-secret_manager-v1beta1/proto_docs/google/api/field_behavior.rb new file mode 100644 index 000000000000..582be187d115 --- /dev/null +++ b/owl-bot-staging/google-cloud-secret_manager-v1beta1/proto_docs/google/api/field_behavior.rb @@ -0,0 +1,85 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + + +module Google + module Api + # An indicator of the behavior of a given field (for example, that a field + # is required in requests, or given as output but ignored as input). + # This **does not** change the behavior in protocol buffers itself; it only + # denotes the behavior and may affect how API tooling handles the field. + # + # Note: This enum **may** receive new values in the future. + module FieldBehavior + # Conventional default for enums. Do not use this. + FIELD_BEHAVIOR_UNSPECIFIED = 0 + + # Specifically denotes a field as optional. + # While all fields in protocol buffers are optional, this may be specified + # for emphasis if appropriate. + OPTIONAL = 1 + + # Denotes a field as required. + # This indicates that the field **must** be provided as part of the request, + # and failure to do so will cause an error (usually `INVALID_ARGUMENT`). + REQUIRED = 2 + + # Denotes a field as output only. + # This indicates that the field is provided in responses, but including the + # field in a request does nothing (the server *must* ignore it and + # *must not* throw an error as a result of the field's presence). + OUTPUT_ONLY = 3 + + # Denotes a field as input only. + # This indicates that the field is provided in requests, and the + # corresponding field is not included in output. + INPUT_ONLY = 4 + + # Denotes a field as immutable. + # This indicates that the field may be set once in a request to create a + # resource, but may not be changed thereafter. + IMMUTABLE = 5 + + # Denotes that a (repeated) field is an unordered list. + # This indicates that the service may provide the elements of the list + # in any arbitrary order, rather than the order the user originally + # provided. Additionally, the list's order may or may not be stable. + UNORDERED_LIST = 6 + + # Denotes that this field returns a non-empty default value if not set. + # This indicates that if the user provides the empty value in a request, + # a non-empty value will be returned. The user will not be aware of what + # non-empty value to expect. + NON_EMPTY_DEFAULT = 7 + + # Denotes that the field in a resource (a message annotated with + # google.api.resource) is used in the resource name to uniquely identify the + # resource. For AIP-compliant APIs, this should only be applied to the + # `name` field on the resource. + # + # This behavior should not be applied to references to other resources within + # the message. + # + # The identifier field of resources often have different field behavior + # depending on the request it is embedded in (e.g. for Create methods name + # is optional and unused, while for Update methods it is required). Instead + # of method-specific annotations, only `IDENTIFIER` is required. + IDENTIFIER = 8 + end + end +end diff --git a/owl-bot-staging/google-cloud-secret_manager-v1beta1/proto_docs/google/api/launch_stage.rb b/owl-bot-staging/google-cloud-secret_manager-v1beta1/proto_docs/google/api/launch_stage.rb new file mode 100644 index 000000000000..9392a413fb1b --- /dev/null +++ b/owl-bot-staging/google-cloud-secret_manager-v1beta1/proto_docs/google/api/launch_stage.rb @@ -0,0 +1,71 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + + +module Google + module Api + # The launch stage as defined by [Google Cloud Platform + # Launch Stages](https://cloud.google.com/terms/launch-stages). + module LaunchStage + # Do not use this default value. + LAUNCH_STAGE_UNSPECIFIED = 0 + + # The feature is not yet implemented. Users can not use it. + UNIMPLEMENTED = 6 + + # Prelaunch features are hidden from users and are only visible internally. + PRELAUNCH = 7 + + # Early Access features are limited to a closed group of testers. To use + # these features, you must sign up in advance and sign a Trusted Tester + # agreement (which includes confidentiality provisions). These features may + # be unstable, changed in backward-incompatible ways, and are not + # guaranteed to be released. + EARLY_ACCESS = 1 + + # Alpha is a limited availability test for releases before they are cleared + # for widespread use. By Alpha, all significant design issues are resolved + # and we are in the process of verifying functionality. Alpha customers + # need to apply for access, agree to applicable terms, and have their + # projects allowlisted. Alpha releases don't have to be feature complete, + # no SLAs are provided, and there are no technical support obligations, but + # they will be far enough along that customers can actually use them in + # test environments or for limited-use tests -- just like they would in + # normal production cases. + ALPHA = 2 + + # Beta is the point at which we are ready to open a release for any + # customer to use. There are no SLA or technical support obligations in a + # Beta release. Products will be complete from a feature perspective, but + # may have some open outstanding issues. Beta releases are suitable for + # limited production use cases. + BETA = 3 + + # GA features are open to all developers and are considered stable and + # fully qualified for production use. + GA = 4 + + # Deprecated features are scheduled to be shut down and removed. For more + # information, see the "Deprecation Policy" section of our [Terms of + # Service](https://cloud.google.com/terms/) + # and the [Google Cloud Platform Subject to the Deprecation + # Policy](https://cloud.google.com/terms/deprecation) documentation. + DEPRECATED = 5 + end + end +end diff --git a/owl-bot-staging/google-cloud-secret_manager-v1beta1/proto_docs/google/api/resource.rb b/owl-bot-staging/google-cloud-secret_manager-v1beta1/proto_docs/google/api/resource.rb new file mode 100644 index 000000000000..25dec4847ac1 --- /dev/null +++ b/owl-bot-staging/google-cloud-secret_manager-v1beta1/proto_docs/google/api/resource.rb @@ -0,0 +1,227 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + + +module Google + module Api + # A simple descriptor of a resource type. + # + # ResourceDescriptor annotates a resource message (either by means of a + # protobuf annotation or use in the service config), and associates the + # resource's schema, the resource type, and the pattern of the resource name. + # + # Example: + # + # message Topic { + # // Indicates this message defines a resource schema. + # // Declares the resource type in the format of {service}/{kind}. + # // For Kubernetes resources, the format is {api group}/{kind}. + # option (google.api.resource) = { + # type: "pubsub.googleapis.com/Topic" + # pattern: "projects/{project}/topics/{topic}" + # }; + # } + # + # The ResourceDescriptor Yaml config will look like: + # + # resources: + # - type: "pubsub.googleapis.com/Topic" + # pattern: "projects/{project}/topics/{topic}" + # + # Sometimes, resources have multiple patterns, typically because they can + # live under multiple parents. + # + # Example: + # + # message LogEntry { + # option (google.api.resource) = { + # type: "logging.googleapis.com/LogEntry" + # pattern: "projects/{project}/logs/{log}" + # pattern: "folders/{folder}/logs/{log}" + # pattern: "organizations/{organization}/logs/{log}" + # pattern: "billingAccounts/{billing_account}/logs/{log}" + # }; + # } + # + # The ResourceDescriptor Yaml config will look like: + # + # resources: + # - type: 'logging.googleapis.com/LogEntry' + # pattern: "projects/{project}/logs/{log}" + # pattern: "folders/{folder}/logs/{log}" + # pattern: "organizations/{organization}/logs/{log}" + # pattern: "billingAccounts/{billing_account}/logs/{log}" + # @!attribute [rw] type + # @return [::String] + # The resource type. It must be in the format of + # \\{service_name}/\\{resource_type_kind}. The `resource_type_kind` must be + # singular and must not include version numbers. + # + # Example: `storage.googleapis.com/Bucket` + # + # The value of the resource_type_kind must follow the regular expression + # /[A-Za-z][a-zA-Z0-9]+/. It should start with an upper case character and + # should use PascalCase (UpperCamelCase). The maximum number of + # characters allowed for the `resource_type_kind` is 100. + # @!attribute [rw] pattern + # @return [::Array<::String>] + # Optional. The relative resource name pattern associated with this resource + # type. The DNS prefix of the full resource name shouldn't be specified here. + # + # The path pattern must follow the syntax, which aligns with HTTP binding + # syntax: + # + # Template = Segment { "/" Segment } ; + # Segment = LITERAL | Variable ; + # Variable = "{" LITERAL "}" ; + # + # Examples: + # + # - "projects/\\{project}/topics/\\{topic}" + # - "projects/\\{project}/knowledgeBases/\\{knowledge_base}" + # + # The components in braces correspond to the IDs for each resource in the + # hierarchy. It is expected that, if multiple patterns are provided, + # the same component name (e.g. "project") refers to IDs of the same + # type of resource. + # @!attribute [rw] name_field + # @return [::String] + # Optional. The field on the resource that designates the resource name + # field. If omitted, this is assumed to be "name". + # @!attribute [rw] history + # @return [::Google::Api::ResourceDescriptor::History] + # Optional. The historical or future-looking state of the resource pattern. + # + # Example: + # + # // The InspectTemplate message originally only supported resource + # // names with organization, and project was added later. + # message InspectTemplate { + # option (google.api.resource) = { + # type: "dlp.googleapis.com/InspectTemplate" + # pattern: + # "organizations/{organization}/inspectTemplates/{inspect_template}" + # pattern: "projects/{project}/inspectTemplates/{inspect_template}" + # history: ORIGINALLY_SINGLE_PATTERN + # }; + # } + # @!attribute [rw] plural + # @return [::String] + # The plural name used in the resource name and permission names, such as + # 'projects' for the resource name of 'projects/\\{project}' and the permission + # name of 'cloudresourcemanager.googleapis.com/projects.get'. One exception + # to this is for Nested Collections that have stuttering names, as defined + # in [AIP-122](https://google.aip.dev/122#nested-collections), where the + # collection ID in the resource name pattern does not necessarily directly + # match the `plural` value. + # + # It is the same concept of the `plural` field in k8s CRD spec + # https://kubernetes.io/docs/tasks/access-kubernetes-api/custom-resources/custom-resource-definitions/ + # + # Note: The plural form is required even for singleton resources. See + # https://aip.dev/156 + # @!attribute [rw] singular + # @return [::String] + # The same concept of the `singular` field in k8s CRD spec + # https://kubernetes.io/docs/tasks/access-kubernetes-api/custom-resources/custom-resource-definitions/ + # Such as "project" for the `resourcemanager.googleapis.com/Project` type. + # @!attribute [rw] style + # @return [::Array<::Google::Api::ResourceDescriptor::Style>] + # Style flag(s) for this resource. + # These indicate that a resource is expected to conform to a given + # style. See the specific style flags for additional information. + class ResourceDescriptor + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # A description of the historical or future-looking state of the + # resource pattern. + module History + # The "unset" value. + HISTORY_UNSPECIFIED = 0 + + # The resource originally had one pattern and launched as such, and + # additional patterns were added later. + ORIGINALLY_SINGLE_PATTERN = 1 + + # The resource has one pattern, but the API owner expects to add more + # later. (This is the inverse of ORIGINALLY_SINGLE_PATTERN, and prevents + # that from being necessary once there are multiple patterns.) + FUTURE_MULTI_PATTERN = 2 + end + + # A flag representing a specific style that a resource claims to conform to. + module Style + # The unspecified value. Do not use. + STYLE_UNSPECIFIED = 0 + + # This resource is intended to be "declarative-friendly". + # + # Declarative-friendly resources must be more strictly consistent, and + # setting this to true communicates to tools that this resource should + # adhere to declarative-friendly expectations. + # + # Note: This is used by the API linter (linter.aip.dev) to enable + # additional checks. + DECLARATIVE_FRIENDLY = 1 + end + end + + # Defines a proto annotation that describes a string field that refers to + # an API resource. + # @!attribute [rw] type + # @return [::String] + # The resource type that the annotated field references. + # + # Example: + # + # message Subscription { + # string topic = 2 [(google.api.resource_reference) = { + # type: "pubsub.googleapis.com/Topic" + # }]; + # } + # + # Occasionally, a field may reference an arbitrary resource. In this case, + # APIs use the special value * in their resource reference. + # + # Example: + # + # message GetIamPolicyRequest { + # string resource = 2 [(google.api.resource_reference) = { + # type: "*" + # }]; + # } + # @!attribute [rw] child_type + # @return [::String] + # The resource type of a child collection that the annotated field + # references. This is useful for annotating the `parent` field that + # doesn't have a fixed resource type. + # + # Example: + # + # message ListLogEntriesRequest { + # string parent = 1 [(google.api.resource_reference) = { + # child_type: "logging.googleapis.com/LogEntry" + # }; + # } + class ResourceReference + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end +end diff --git a/owl-bot-staging/google-cloud-secret_manager-v1beta1/proto_docs/google/cloud/secrets/v1beta1/resources.rb b/owl-bot-staging/google-cloud-secret_manager-v1beta1/proto_docs/google/cloud/secrets/v1beta1/resources.rb new file mode 100644 index 000000000000..ad2f4fa25e44 --- /dev/null +++ b/owl-bot-staging/google-cloud-secret_manager-v1beta1/proto_docs/google/cloud/secrets/v1beta1/resources.rb @@ -0,0 +1,189 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + + +module Google + module Cloud + module SecretManager + module V1beta1 + # A {::Google::Cloud::SecretManager::V1beta1::Secret Secret} is a logical secret whose + # value and versions can be accessed. + # + # A {::Google::Cloud::SecretManager::V1beta1::Secret Secret} is made up of zero or more + # {::Google::Cloud::SecretManager::V1beta1::SecretVersion SecretVersions} that represent + # the secret data. + # @!attribute [r] name + # @return [::String] + # Output only. The resource name of the + # {::Google::Cloud::SecretManager::V1beta1::Secret Secret} in the format + # `projects/*/secrets/*`. + # @!attribute [rw] replication + # @return [::Google::Cloud::SecretManager::V1beta1::Replication] + # Required. Immutable. The replication policy of the secret data attached to + # the {::Google::Cloud::SecretManager::V1beta1::Secret Secret}. + # + # The replication policy cannot be changed after the Secret has been created. + # @!attribute [r] create_time + # @return [::Google::Protobuf::Timestamp] + # Output only. The time at which the + # {::Google::Cloud::SecretManager::V1beta1::Secret Secret} was created. + # @!attribute [rw] labels + # @return [::Google::Protobuf::Map{::String => ::String}] + # The labels assigned to this Secret. + # + # Label keys must be between 1 and 63 characters long, have a UTF-8 encoding + # of maximum 128 bytes, and must conform to the following PCRE regular + # expression: `[\p{Ll}\p{Lo}][\p{Ll}\p{Lo}\p{N}_-]{0,62}` + # + # Label values must be between 0 and 63 characters long, have a UTF-8 + # encoding of maximum 128 bytes, and must conform to the following PCRE + # regular expression: `[\p{Ll}\p{Lo}\p{N}_-]{0,63}` + # + # No more than 64 labels can be assigned to a given resource. + class Secret + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # @!attribute [rw] key + # @return [::String] + # @!attribute [rw] value + # @return [::String] + class LabelsEntry + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end + + # A secret version resource in the Secret Manager API. + # @!attribute [r] name + # @return [::String] + # Output only. The resource name of the + # {::Google::Cloud::SecretManager::V1beta1::SecretVersion SecretVersion} in the format + # `projects/*/secrets/*/versions/*`. + # + # {::Google::Cloud::SecretManager::V1beta1::SecretVersion SecretVersion} IDs in a + # {::Google::Cloud::SecretManager::V1beta1::Secret Secret} start at 1 and are + # incremented for each subsequent version of the secret. + # @!attribute [r] create_time + # @return [::Google::Protobuf::Timestamp] + # Output only. The time at which the + # {::Google::Cloud::SecretManager::V1beta1::SecretVersion SecretVersion} was created. + # @!attribute [r] destroy_time + # @return [::Google::Protobuf::Timestamp] + # Output only. The time this + # {::Google::Cloud::SecretManager::V1beta1::SecretVersion SecretVersion} was destroyed. + # Only present if {::Google::Cloud::SecretManager::V1beta1::SecretVersion#state state} + # is {::Google::Cloud::SecretManager::V1beta1::SecretVersion::State::DESTROYED DESTROYED}. + # @!attribute [r] state + # @return [::Google::Cloud::SecretManager::V1beta1::SecretVersion::State] + # Output only. The current state of the + # {::Google::Cloud::SecretManager::V1beta1::SecretVersion SecretVersion}. + class SecretVersion + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # The state of a {::Google::Cloud::SecretManager::V1beta1::SecretVersion SecretVersion}, + # indicating if it can be accessed. + module State + # Not specified. This value is unused and invalid. + STATE_UNSPECIFIED = 0 + + # The {::Google::Cloud::SecretManager::V1beta1::SecretVersion SecretVersion} may be + # accessed. + ENABLED = 1 + + # The {::Google::Cloud::SecretManager::V1beta1::SecretVersion SecretVersion} may not + # be accessed, but the secret data is still available and can be placed + # back into the + # {::Google::Cloud::SecretManager::V1beta1::SecretVersion::State::ENABLED ENABLED} + # state. + DISABLED = 2 + + # The {::Google::Cloud::SecretManager::V1beta1::SecretVersion SecretVersion} is + # destroyed and the secret data is no longer stored. A version may not + # leave this state once entered. + DESTROYED = 3 + end + end + + # A policy that defines the replication configuration of data. + # @!attribute [rw] automatic + # @return [::Google::Cloud::SecretManager::V1beta1::Replication::Automatic] + # The {::Google::Cloud::SecretManager::V1beta1::Secret Secret} will automatically be + # replicated without any restrictions. + # + # Note: The following fields are mutually exclusive: `automatic`, `user_managed`. If a field in that set is populated, all other fields in the set will automatically be cleared. + # @!attribute [rw] user_managed + # @return [::Google::Cloud::SecretManager::V1beta1::Replication::UserManaged] + # The {::Google::Cloud::SecretManager::V1beta1::Secret Secret} will only be replicated + # into the locations specified. + # + # Note: The following fields are mutually exclusive: `user_managed`, `automatic`. If a field in that set is populated, all other fields in the set will automatically be cleared. + class Replication + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # A replication policy that replicates the + # {::Google::Cloud::SecretManager::V1beta1::Secret Secret} payload without any + # restrictions. + class Automatic + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # A replication policy that replicates the + # {::Google::Cloud::SecretManager::V1beta1::Secret Secret} payload into the locations + # specified in + # {::Google::Cloud::SecretManager::V1beta1::Replication::UserManaged#replicas Replication.UserManaged.replicas} + # @!attribute [rw] replicas + # @return [::Array<::Google::Cloud::SecretManager::V1beta1::Replication::UserManaged::Replica>] + # Required. The list of Replicas for this + # {::Google::Cloud::SecretManager::V1beta1::Secret Secret}. + # + # Cannot be empty. + class UserManaged + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # Represents a Replica for this + # {::Google::Cloud::SecretManager::V1beta1::Secret Secret}. + # @!attribute [rw] location + # @return [::String] + # The canonical IDs of the location to replicate data. + # For example: `"us-east1"`. + class Replica + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end + end + + # A secret payload resource in the Secret Manager API. This contains the + # sensitive secret data that is associated with a + # {::Google::Cloud::SecretManager::V1beta1::SecretVersion SecretVersion}. + # @!attribute [rw] data + # @return [::String] + # The secret data. Must be no larger than 64KiB. + class SecretPayload + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-secret_manager-v1beta1/proto_docs/google/cloud/secrets/v1beta1/service.rb b/owl-bot-staging/google-cloud-secret_manager-v1beta1/proto_docs/google/cloud/secrets/v1beta1/service.rb new file mode 100644 index 000000000000..dc304a41b777 --- /dev/null +++ b/owl-bot-staging/google-cloud-secret_manager-v1beta1/proto_docs/google/cloud/secrets/v1beta1/service.rb @@ -0,0 +1,261 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + + +module Google + module Cloud + module SecretManager + module V1beta1 + # Request message for + # {::Google::Cloud::SecretManager::V1beta1::SecretManagerService::Client#list_secrets SecretManagerService.ListSecrets}. + # @!attribute [rw] parent + # @return [::String] + # Required. The resource name of the project associated with the + # {::Google::Cloud::SecretManager::V1beta1::Secret Secrets}, in the format `projects/*`. + # @!attribute [rw] page_size + # @return [::Integer] + # Optional. The maximum number of results to be returned in a single page. If + # set to 0, the server decides the number of results to return. If the + # number is greater than 25000, it is capped at 25000. + # @!attribute [rw] page_token + # @return [::String] + # Optional. Pagination token, returned earlier via + # {::Google::Cloud::SecretManager::V1beta1::ListSecretsResponse#next_page_token ListSecretsResponse.next_page_token}. + class ListSecretsRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Response message for + # {::Google::Cloud::SecretManager::V1beta1::SecretManagerService::Client#list_secrets SecretManagerService.ListSecrets}. + # @!attribute [rw] secrets + # @return [::Array<::Google::Cloud::SecretManager::V1beta1::Secret>] + # The list of {::Google::Cloud::SecretManager::V1beta1::Secret Secrets} sorted in + # reverse by create_time (newest first). + # @!attribute [rw] next_page_token + # @return [::String] + # A token to retrieve the next page of results. Pass this value in + # {::Google::Cloud::SecretManager::V1beta1::ListSecretsRequest#page_token ListSecretsRequest.page_token} + # to retrieve the next page. + # @!attribute [rw] total_size + # @return [::Integer] + # The total number of {::Google::Cloud::SecretManager::V1beta1::Secret Secrets}. + class ListSecretsResponse + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Request message for + # {::Google::Cloud::SecretManager::V1beta1::SecretManagerService::Client#create_secret SecretManagerService.CreateSecret}. + # @!attribute [rw] parent + # @return [::String] + # Required. The resource name of the project to associate with the + # {::Google::Cloud::SecretManager::V1beta1::Secret Secret}, in the format `projects/*`. + # @!attribute [rw] secret_id + # @return [::String] + # Required. This must be unique within the project. + # + # A secret ID is a string with a maximum length of 255 characters and can + # contain uppercase and lowercase letters, numerals, and the hyphen (`-`) and + # underscore (`_`) characters. + # @!attribute [rw] secret + # @return [::Google::Cloud::SecretManager::V1beta1::Secret] + # Required. A {::Google::Cloud::SecretManager::V1beta1::Secret Secret} with initial + # field values. + class CreateSecretRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Request message for + # {::Google::Cloud::SecretManager::V1beta1::SecretManagerService::Client#add_secret_version SecretManagerService.AddSecretVersion}. + # @!attribute [rw] parent + # @return [::String] + # Required. The resource name of the + # {::Google::Cloud::SecretManager::V1beta1::Secret Secret} to associate with the + # {::Google::Cloud::SecretManager::V1beta1::SecretVersion SecretVersion} in the format + # `projects/*/secrets/*`. + # @!attribute [rw] payload + # @return [::Google::Cloud::SecretManager::V1beta1::SecretPayload] + # Required. The secret payload of the + # {::Google::Cloud::SecretManager::V1beta1::SecretVersion SecretVersion}. + class AddSecretVersionRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Request message for + # {::Google::Cloud::SecretManager::V1beta1::SecretManagerService::Client#get_secret SecretManagerService.GetSecret}. + # @!attribute [rw] name + # @return [::String] + # Required. The resource name of the + # {::Google::Cloud::SecretManager::V1beta1::Secret Secret}, in the format + # `projects/*/secrets/*`. + class GetSecretRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Request message for + # {::Google::Cloud::SecretManager::V1beta1::SecretManagerService::Client#list_secret_versions SecretManagerService.ListSecretVersions}. + # @!attribute [rw] parent + # @return [::String] + # Required. The resource name of the + # {::Google::Cloud::SecretManager::V1beta1::Secret Secret} associated with the + # {::Google::Cloud::SecretManager::V1beta1::SecretVersion SecretVersions} to list, in + # the format `projects/*/secrets/*`. + # @!attribute [rw] page_size + # @return [::Integer] + # Optional. The maximum number of results to be returned in a single page. If + # set to 0, the server decides the number of results to return. If the + # number is greater than 25000, it is capped at 25000. + # @!attribute [rw] page_token + # @return [::String] + # Optional. Pagination token, returned earlier via + # ListSecretVersionsResponse.next_page_token][]. + class ListSecretVersionsRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Response message for + # {::Google::Cloud::SecretManager::V1beta1::SecretManagerService::Client#list_secret_versions SecretManagerService.ListSecretVersions}. + # @!attribute [rw] versions + # @return [::Array<::Google::Cloud::SecretManager::V1beta1::SecretVersion>] + # The list of {::Google::Cloud::SecretManager::V1beta1::SecretVersion SecretVersions} + # sorted in reverse by create_time (newest first). + # @!attribute [rw] next_page_token + # @return [::String] + # A token to retrieve the next page of results. Pass this value in + # {::Google::Cloud::SecretManager::V1beta1::ListSecretVersionsRequest#page_token ListSecretVersionsRequest.page_token} + # to retrieve the next page. + # @!attribute [rw] total_size + # @return [::Integer] + # The total number of + # {::Google::Cloud::SecretManager::V1beta1::SecretVersion SecretVersions}. + class ListSecretVersionsResponse + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Request message for + # {::Google::Cloud::SecretManager::V1beta1::SecretManagerService::Client#get_secret_version SecretManagerService.GetSecretVersion}. + # @!attribute [rw] name + # @return [::String] + # Required. The resource name of the + # {::Google::Cloud::SecretManager::V1beta1::SecretVersion SecretVersion} in the format + # `projects/*/secrets/*/versions/*`. + # `projects/*/secrets/*/versions/latest` is an alias to the `latest` + # {::Google::Cloud::SecretManager::V1beta1::SecretVersion SecretVersion}. + class GetSecretVersionRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Request message for + # {::Google::Cloud::SecretManager::V1beta1::SecretManagerService::Client#update_secret SecretManagerService.UpdateSecret}. + # @!attribute [rw] secret + # @return [::Google::Cloud::SecretManager::V1beta1::Secret] + # Required. {::Google::Cloud::SecretManager::V1beta1::Secret Secret} with updated field + # values. + # @!attribute [rw] update_mask + # @return [::Google::Protobuf::FieldMask] + # Required. Specifies the fields to be updated. + class UpdateSecretRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Request message for + # {::Google::Cloud::SecretManager::V1beta1::SecretManagerService::Client#access_secret_version SecretManagerService.AccessSecretVersion}. + # @!attribute [rw] name + # @return [::String] + # Required. The resource name of the + # {::Google::Cloud::SecretManager::V1beta1::SecretVersion SecretVersion} in the format + # `projects/*/secrets/*/versions/*`. + class AccessSecretVersionRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Response message for + # {::Google::Cloud::SecretManager::V1beta1::SecretManagerService::Client#access_secret_version SecretManagerService.AccessSecretVersion}. + # @!attribute [rw] name + # @return [::String] + # The resource name of the + # {::Google::Cloud::SecretManager::V1beta1::SecretVersion SecretVersion} in the format + # `projects/*/secrets/*/versions/*`. + # @!attribute [rw] payload + # @return [::Google::Cloud::SecretManager::V1beta1::SecretPayload] + # Secret payload + class AccessSecretVersionResponse + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Request message for + # {::Google::Cloud::SecretManager::V1beta1::SecretManagerService::Client#delete_secret SecretManagerService.DeleteSecret}. + # @!attribute [rw] name + # @return [::String] + # Required. The resource name of the + # {::Google::Cloud::SecretManager::V1beta1::Secret Secret} to delete in the format + # `projects/*/secrets/*`. + class DeleteSecretRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Request message for + # {::Google::Cloud::SecretManager::V1beta1::SecretManagerService::Client#disable_secret_version SecretManagerService.DisableSecretVersion}. + # @!attribute [rw] name + # @return [::String] + # Required. The resource name of the + # {::Google::Cloud::SecretManager::V1beta1::SecretVersion SecretVersion} to disable in + # the format `projects/*/secrets/*/versions/*`. + class DisableSecretVersionRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Request message for + # {::Google::Cloud::SecretManager::V1beta1::SecretManagerService::Client#enable_secret_version SecretManagerService.EnableSecretVersion}. + # @!attribute [rw] name + # @return [::String] + # Required. The resource name of the + # {::Google::Cloud::SecretManager::V1beta1::SecretVersion SecretVersion} to enable in + # the format `projects/*/secrets/*/versions/*`. + class EnableSecretVersionRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Request message for + # {::Google::Cloud::SecretManager::V1beta1::SecretManagerService::Client#destroy_secret_version SecretManagerService.DestroySecretVersion}. + # @!attribute [rw] name + # @return [::String] + # Required. The resource name of the + # {::Google::Cloud::SecretManager::V1beta1::SecretVersion SecretVersion} to destroy in + # the format `projects/*/secrets/*/versions/*`. + class DestroySecretVersionRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-secret_manager-v1beta1/proto_docs/google/iam/v1/iam_policy.rb b/owl-bot-staging/google-cloud-secret_manager-v1beta1/proto_docs/google/iam/v1/iam_policy.rb new file mode 100644 index 000000000000..5445c77f8258 --- /dev/null +++ b/owl-bot-staging/google-cloud-secret_manager-v1beta1/proto_docs/google/iam/v1/iam_policy.rb @@ -0,0 +1,87 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + + +module Google + module Iam + module V1 + # Request message for `SetIamPolicy` method. + # @!attribute [rw] resource + # @return [::String] + # REQUIRED: The resource for which the policy is being specified. + # See the operation documentation for the appropriate value for this field. + # @!attribute [rw] policy + # @return [::Google::Iam::V1::Policy] + # REQUIRED: The complete policy to be applied to the `resource`. The size of + # the policy is limited to a few 10s of KB. An empty policy is a + # valid policy but certain Cloud Platform services (such as Projects) + # might reject them. + # @!attribute [rw] update_mask + # @return [::Google::Protobuf::FieldMask] + # OPTIONAL: A FieldMask specifying which fields of the policy to modify. Only + # the fields in the mask will be modified. If no mask is provided, the + # following default mask is used: + # + # `paths: "bindings, etag"` + class SetIamPolicyRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Request message for `GetIamPolicy` method. + # @!attribute [rw] resource + # @return [::String] + # REQUIRED: The resource for which the policy is being requested. + # See the operation documentation for the appropriate value for this field. + # @!attribute [rw] options + # @return [::Google::Iam::V1::GetPolicyOptions] + # OPTIONAL: A `GetPolicyOptions` object for specifying options to + # `GetIamPolicy`. + class GetIamPolicyRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Request message for `TestIamPermissions` method. + # @!attribute [rw] resource + # @return [::String] + # REQUIRED: The resource for which the policy detail is being requested. + # See the operation documentation for the appropriate value for this field. + # @!attribute [rw] permissions + # @return [::Array<::String>] + # The set of permissions to check for the `resource`. Permissions with + # wildcards (such as '*' or 'storage.*') are not allowed. For more + # information see + # [IAM Overview](https://cloud.google.com/iam/docs/overview#permissions). + class TestIamPermissionsRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Response message for `TestIamPermissions` method. + # @!attribute [rw] permissions + # @return [::Array<::String>] + # A subset of `TestPermissionsRequest.permissions` that the caller is + # allowed. + class TestIamPermissionsResponse + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end + end +end diff --git a/owl-bot-staging/google-cloud-secret_manager-v1beta1/proto_docs/google/iam/v1/options.rb b/owl-bot-staging/google-cloud-secret_manager-v1beta1/proto_docs/google/iam/v1/options.rb new file mode 100644 index 000000000000..60713d995b86 --- /dev/null +++ b/owl-bot-staging/google-cloud-secret_manager-v1beta1/proto_docs/google/iam/v1/options.rb @@ -0,0 +1,50 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + + +module Google + module Iam + module V1 + # Encapsulates settings provided to GetIamPolicy. + # @!attribute [rw] requested_policy_version + # @return [::Integer] + # Optional. The maximum policy version that will be used to format the + # policy. + # + # Valid values are 0, 1, and 3. Requests specifying an invalid value will be + # rejected. + # + # Requests for policies with any conditional role bindings must specify + # version 3. Policies with no conditional role bindings may specify any valid + # value or leave the field unset. + # + # The policy in the response might use the policy version that you specified, + # or it might use a lower policy version. For example, if you specify version + # 3, but the policy has no conditional role bindings, the response uses + # version 1. + # + # To learn which resources support conditions in their IAM policies, see the + # [IAM + # documentation](https://cloud.google.com/iam/help/conditions/resource-policies). + class GetPolicyOptions + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end + end +end diff --git a/owl-bot-staging/google-cloud-secret_manager-v1beta1/proto_docs/google/iam/v1/policy.rb b/owl-bot-staging/google-cloud-secret_manager-v1beta1/proto_docs/google/iam/v1/policy.rb new file mode 100644 index 000000000000..999575b797df --- /dev/null +++ b/owl-bot-staging/google-cloud-secret_manager-v1beta1/proto_docs/google/iam/v1/policy.rb @@ -0,0 +1,426 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + + +module Google + module Iam + module V1 + # An Identity and Access Management (IAM) policy, which specifies access + # controls for Google Cloud resources. + # + # + # A `Policy` is a collection of `bindings`. A `binding` binds one or more + # `members`, or principals, to a single `role`. Principals can be user + # accounts, service accounts, Google groups, and domains (such as G Suite). A + # `role` is a named list of permissions; each `role` can be an IAM predefined + # role or a user-created custom role. + # + # For some types of Google Cloud resources, a `binding` can also specify a + # `condition`, which is a logical expression that allows access to a resource + # only if the expression evaluates to `true`. A condition can add constraints + # based on attributes of the request, the resource, or both. To learn which + # resources support conditions in their IAM policies, see the + # [IAM + # documentation](https://cloud.google.com/iam/help/conditions/resource-policies). + # + # **JSON example:** + # + # ``` + # { + # "bindings": [ + # { + # "role": "roles/resourcemanager.organizationAdmin", + # "members": [ + # "user:mike@example.com", + # "group:admins@example.com", + # "domain:google.com", + # "serviceAccount:my-project-id@appspot.gserviceaccount.com" + # ] + # }, + # { + # "role": "roles/resourcemanager.organizationViewer", + # "members": [ + # "user:eve@example.com" + # ], + # "condition": { + # "title": "expirable access", + # "description": "Does not grant access after Sep 2020", + # "expression": "request.time < + # timestamp('2020-10-01T00:00:00.000Z')", + # } + # } + # ], + # "etag": "BwWWja0YfJA=", + # "version": 3 + # } + # ``` + # + # **YAML example:** + # + # ``` + # bindings: + # - members: + # - user:mike@example.com + # - group:admins@example.com + # - domain:google.com + # - serviceAccount:my-project-id@appspot.gserviceaccount.com + # role: roles/resourcemanager.organizationAdmin + # - members: + # - user:eve@example.com + # role: roles/resourcemanager.organizationViewer + # condition: + # title: expirable access + # description: Does not grant access after Sep 2020 + # expression: request.time < timestamp('2020-10-01T00:00:00.000Z') + # etag: BwWWja0YfJA= + # version: 3 + # ``` + # + # For a description of IAM and its features, see the + # [IAM documentation](https://cloud.google.com/iam/docs/). + # @!attribute [rw] version + # @return [::Integer] + # Specifies the format of the policy. + # + # Valid values are `0`, `1`, and `3`. Requests that specify an invalid value + # are rejected. + # + # Any operation that affects conditional role bindings must specify version + # `3`. This requirement applies to the following operations: + # + # * Getting a policy that includes a conditional role binding + # * Adding a conditional role binding to a policy + # * Changing a conditional role binding in a policy + # * Removing any role binding, with or without a condition, from a policy + # that includes conditions + # + # **Important:** If you use IAM Conditions, you must include the `etag` field + # whenever you call `setIamPolicy`. If you omit this field, then IAM allows + # you to overwrite a version `3` policy with a version `1` policy, and all of + # the conditions in the version `3` policy are lost. + # + # If a policy does not include any conditions, operations on that policy may + # specify any valid version or leave the field unset. + # + # To learn which resources support conditions in their IAM policies, see the + # [IAM + # documentation](https://cloud.google.com/iam/help/conditions/resource-policies). + # @!attribute [rw] bindings + # @return [::Array<::Google::Iam::V1::Binding>] + # Associates a list of `members`, or principals, with a `role`. Optionally, + # may specify a `condition` that determines how and when the `bindings` are + # applied. Each of the `bindings` must contain at least one principal. + # + # The `bindings` in a `Policy` can refer to up to 1,500 principals; up to 250 + # of these principals can be Google groups. Each occurrence of a principal + # counts towards these limits. For example, if the `bindings` grant 50 + # different roles to `user:alice@example.com`, and not to any other + # principal, then you can add another 1,450 principals to the `bindings` in + # the `Policy`. + # @!attribute [rw] audit_configs + # @return [::Array<::Google::Iam::V1::AuditConfig>] + # Specifies cloud audit logging configuration for this policy. + # @!attribute [rw] etag + # @return [::String] + # `etag` is used for optimistic concurrency control as a way to help + # prevent simultaneous updates of a policy from overwriting each other. + # It is strongly suggested that systems make use of the `etag` in the + # read-modify-write cycle to perform policy updates in order to avoid race + # conditions: An `etag` is returned in the response to `getIamPolicy`, and + # systems are expected to put that etag in the request to `setIamPolicy` to + # ensure that their change will be applied to the same version of the policy. + # + # **Important:** If you use IAM Conditions, you must include the `etag` field + # whenever you call `setIamPolicy`. If you omit this field, then IAM allows + # you to overwrite a version `3` policy with a version `1` policy, and all of + # the conditions in the version `3` policy are lost. + class Policy + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Associates `members`, or principals, with a `role`. + # @!attribute [rw] role + # @return [::String] + # Role that is assigned to the list of `members`, or principals. + # For example, `roles/viewer`, `roles/editor`, or `roles/owner`. + # @!attribute [rw] members + # @return [::Array<::String>] + # Specifies the principals requesting access for a Google Cloud resource. + # `members` can have the following values: + # + # * `allUsers`: A special identifier that represents anyone who is + # on the internet; with or without a Google account. + # + # * `allAuthenticatedUsers`: A special identifier that represents anyone + # who is authenticated with a Google account or a service account. + # + # * `user:{emailid}`: An email address that represents a specific Google + # account. For example, `alice@example.com` . + # + # + # * `serviceAccount:{emailid}`: An email address that represents a service + # account. For example, `my-other-app@appspot.gserviceaccount.com`. + # + # * `group:{emailid}`: An email address that represents a Google group. + # For example, `admins@example.com`. + # + # * `deleted:user:{emailid}?uid={uniqueid}`: An email address (plus unique + # identifier) representing a user that has been recently deleted. For + # example, `alice@example.com?uid=123456789012345678901`. If the user is + # recovered, this value reverts to `user:{emailid}` and the recovered user + # retains the role in the binding. + # + # * `deleted:serviceAccount:{emailid}?uid={uniqueid}`: An email address (plus + # unique identifier) representing a service account that has been recently + # deleted. For example, + # `my-other-app@appspot.gserviceaccount.com?uid=123456789012345678901`. + # If the service account is undeleted, this value reverts to + # `serviceAccount:{emailid}` and the undeleted service account retains the + # role in the binding. + # + # * `deleted:group:{emailid}?uid={uniqueid}`: An email address (plus unique + # identifier) representing a Google group that has been recently + # deleted. For example, `admins@example.com?uid=123456789012345678901`. If + # the group is recovered, this value reverts to `group:{emailid}` and the + # recovered group retains the role in the binding. + # + # + # * `domain:{domain}`: The G Suite domain (primary) that represents all the + # users of that domain. For example, `google.com` or `example.com`. + # @!attribute [rw] condition + # @return [::Google::Type::Expr] + # The condition that is associated with this binding. + # + # If the condition evaluates to `true`, then this binding applies to the + # current request. + # + # If the condition evaluates to `false`, then this binding does not apply to + # the current request. However, a different role binding might grant the same + # role to one or more of the principals in this binding. + # + # To learn which resources support conditions in their IAM policies, see the + # [IAM + # documentation](https://cloud.google.com/iam/help/conditions/resource-policies). + class Binding + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Specifies the audit configuration for a service. + # The configuration determines which permission types are logged, and what + # identities, if any, are exempted from logging. + # An AuditConfig must have one or more AuditLogConfigs. + # + # If there are AuditConfigs for both `allServices` and a specific service, + # the union of the two AuditConfigs is used for that service: the log_types + # specified in each AuditConfig are enabled, and the exempted_members in each + # AuditLogConfig are exempted. + # + # Example Policy with multiple AuditConfigs: + # + # { + # "audit_configs": [ + # { + # "service": "allServices", + # "audit_log_configs": [ + # { + # "log_type": "DATA_READ", + # "exempted_members": [ + # "user:jose@example.com" + # ] + # }, + # { + # "log_type": "DATA_WRITE" + # }, + # { + # "log_type": "ADMIN_READ" + # } + # ] + # }, + # { + # "service": "sampleservice.googleapis.com", + # "audit_log_configs": [ + # { + # "log_type": "DATA_READ" + # }, + # { + # "log_type": "DATA_WRITE", + # "exempted_members": [ + # "user:aliya@example.com" + # ] + # } + # ] + # } + # ] + # } + # + # For sampleservice, this policy enables DATA_READ, DATA_WRITE and ADMIN_READ + # logging. It also exempts `jose@example.com` from DATA_READ logging, and + # `aliya@example.com` from DATA_WRITE logging. + # @!attribute [rw] service + # @return [::String] + # Specifies a service that will be enabled for audit logging. + # For example, `storage.googleapis.com`, `cloudsql.googleapis.com`. + # `allServices` is a special value that covers all services. + # @!attribute [rw] audit_log_configs + # @return [::Array<::Google::Iam::V1::AuditLogConfig>] + # The configuration for logging of each type of permission. + class AuditConfig + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Provides the configuration for logging a type of permissions. + # Example: + # + # { + # "audit_log_configs": [ + # { + # "log_type": "DATA_READ", + # "exempted_members": [ + # "user:jose@example.com" + # ] + # }, + # { + # "log_type": "DATA_WRITE" + # } + # ] + # } + # + # This enables 'DATA_READ' and 'DATA_WRITE' logging, while exempting + # jose@example.com from DATA_READ logging. + # @!attribute [rw] log_type + # @return [::Google::Iam::V1::AuditLogConfig::LogType] + # The log type that this config enables. + # @!attribute [rw] exempted_members + # @return [::Array<::String>] + # Specifies the identities that do not cause logging for this type of + # permission. + # Follows the same format of + # [Binding.members][google.iam.v1.Binding.members]. + class AuditLogConfig + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # The list of valid permission types for which logging can be configured. + # Admin writes are always logged, and are not configurable. + module LogType + # Default case. Should never be this. + LOG_TYPE_UNSPECIFIED = 0 + + # Admin reads. Example: CloudIAM getIamPolicy + ADMIN_READ = 1 + + # Data writes. Example: CloudSQL Users create + DATA_WRITE = 2 + + # Data reads. Example: CloudSQL Users list + DATA_READ = 3 + end + end + + # The difference delta between two policies. + # @!attribute [rw] binding_deltas + # @return [::Array<::Google::Iam::V1::BindingDelta>] + # The delta for Bindings between two policies. + # @!attribute [rw] audit_config_deltas + # @return [::Array<::Google::Iam::V1::AuditConfigDelta>] + # The delta for AuditConfigs between two policies. + class PolicyDelta + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # One delta entry for Binding. Each individual change (only one member in each + # entry) to a binding will be a separate entry. + # @!attribute [rw] action + # @return [::Google::Iam::V1::BindingDelta::Action] + # The action that was performed on a Binding. + # Required + # @!attribute [rw] role + # @return [::String] + # Role that is assigned to `members`. + # For example, `roles/viewer`, `roles/editor`, or `roles/owner`. + # Required + # @!attribute [rw] member + # @return [::String] + # A single identity requesting access for a Google Cloud resource. + # Follows the same format of Binding.members. + # Required + # @!attribute [rw] condition + # @return [::Google::Type::Expr] + # The condition that is associated with this binding. + class BindingDelta + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # The type of action performed on a Binding in a policy. + module Action + # Unspecified. + ACTION_UNSPECIFIED = 0 + + # Addition of a Binding. + ADD = 1 + + # Removal of a Binding. + REMOVE = 2 + end + end + + # One delta entry for AuditConfig. Each individual change (only one + # exempted_member in each entry) to a AuditConfig will be a separate entry. + # @!attribute [rw] action + # @return [::Google::Iam::V1::AuditConfigDelta::Action] + # The action that was performed on an audit configuration in a policy. + # Required + # @!attribute [rw] service + # @return [::String] + # Specifies a service that was configured for Cloud Audit Logging. + # For example, `storage.googleapis.com`, `cloudsql.googleapis.com`. + # `allServices` is a special value that covers all services. + # Required + # @!attribute [rw] exempted_member + # @return [::String] + # A single identity that is exempted from "data access" audit + # logging for the `service` specified above. + # Follows the same format of Binding.members. + # @!attribute [rw] log_type + # @return [::String] + # Specifies the log_type that was be enabled. ADMIN_ACTIVITY is always + # enabled, and cannot be configured. + # Required + class AuditConfigDelta + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # The type of action performed on an audit configuration in a policy. + module Action + # Unspecified. + ACTION_UNSPECIFIED = 0 + + # Addition of an audit configuration. + ADD = 1 + + # Removal of an audit configuration. + REMOVE = 2 + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-secret_manager-v1beta1/proto_docs/google/protobuf/any.rb b/owl-bot-staging/google-cloud-secret_manager-v1beta1/proto_docs/google/protobuf/any.rb new file mode 100644 index 000000000000..58691995f02e --- /dev/null +++ b/owl-bot-staging/google-cloud-secret_manager-v1beta1/proto_docs/google/protobuf/any.rb @@ -0,0 +1,145 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + + +module Google + module Protobuf + # `Any` contains an arbitrary serialized protocol buffer message along with a + # URL that describes the type of the serialized message. + # + # Protobuf library provides support to pack/unpack Any values in the form + # of utility functions or additional generated methods of the Any type. + # + # Example 1: Pack and unpack a message in C++. + # + # Foo foo = ...; + # Any any; + # any.PackFrom(foo); + # ... + # if (any.UnpackTo(&foo)) { + # ... + # } + # + # Example 2: Pack and unpack a message in Java. + # + # Foo foo = ...; + # Any any = Any.pack(foo); + # ... + # if (any.is(Foo.class)) { + # foo = any.unpack(Foo.class); + # } + # // or ... + # if (any.isSameTypeAs(Foo.getDefaultInstance())) { + # foo = any.unpack(Foo.getDefaultInstance()); + # } + # + # Example 3: Pack and unpack a message in Python. + # + # foo = Foo(...) + # any = Any() + # any.Pack(foo) + # ... + # if any.Is(Foo.DESCRIPTOR): + # any.Unpack(foo) + # ... + # + # Example 4: Pack and unpack a message in Go + # + # foo := &pb.Foo{...} + # any, err := anypb.New(foo) + # if err != nil { + # ... + # } + # ... + # foo := &pb.Foo{} + # if err := any.UnmarshalTo(foo); err != nil { + # ... + # } + # + # The pack methods provided by protobuf library will by default use + # 'type.googleapis.com/full.type.name' as the type URL and the unpack + # methods only use the fully qualified type name after the last '/' + # in the type URL, for example "foo.bar.com/x/y.z" will yield type + # name "y.z". + # + # JSON + # ==== + # The JSON representation of an `Any` value uses the regular + # representation of the deserialized, embedded message, with an + # additional field `@type` which contains the type URL. Example: + # + # package google.profile; + # message Person { + # string first_name = 1; + # string last_name = 2; + # } + # + # { + # "@type": "type.googleapis.com/google.profile.Person", + # "firstName": , + # "lastName": + # } + # + # If the embedded message type is well-known and has a custom JSON + # representation, that representation will be embedded adding a field + # `value` which holds the custom JSON in addition to the `@type` + # field. Example (for message [google.protobuf.Duration][]): + # + # { + # "@type": "type.googleapis.com/google.protobuf.Duration", + # "value": "1.212s" + # } + # @!attribute [rw] type_url + # @return [::String] + # A URL/resource name that uniquely identifies the type of the serialized + # protocol buffer message. This string must contain at least + # one "/" character. The last segment of the URL's path must represent + # the fully qualified name of the type (as in + # `path/google.protobuf.Duration`). The name should be in a canonical form + # (e.g., leading "." is not accepted). + # + # In practice, teams usually precompile into the binary all types that they + # expect it to use in the context of Any. However, for URLs which use the + # scheme `http`, `https`, or no scheme, one can optionally set up a type + # server that maps type URLs to message definitions as follows: + # + # * If no scheme is provided, `https` is assumed. + # * An HTTP GET on the URL must yield a [google.protobuf.Type][] + # value in binary format, or produce an error. + # * Applications are allowed to cache lookup results based on the + # URL, or have them precompiled into a binary to avoid any + # lookup. Therefore, binary compatibility needs to be preserved + # on changes to types. (Use versioned type names to manage + # breaking changes.) + # + # Note: this functionality is not currently available in the official + # protobuf release, and it is not used for type URLs beginning with + # type.googleapis.com. As of May 2023, there are no widely used type server + # implementations and no plans to implement one. + # + # Schemes other than `http`, `https` (or the empty scheme) might be + # used with implementation specific semantics. + # @!attribute [rw] value + # @return [::String] + # Must be a valid serialized protocol buffer of the above specified type. + class Any + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end +end diff --git a/owl-bot-staging/google-cloud-secret_manager-v1beta1/proto_docs/google/protobuf/duration.rb b/owl-bot-staging/google-cloud-secret_manager-v1beta1/proto_docs/google/protobuf/duration.rb new file mode 100644 index 000000000000..ea59f1f91daf --- /dev/null +++ b/owl-bot-staging/google-cloud-secret_manager-v1beta1/proto_docs/google/protobuf/duration.rb @@ -0,0 +1,98 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + + +module Google + module Protobuf + # A Duration represents a signed, fixed-length span of time represented + # as a count of seconds and fractions of seconds at nanosecond + # resolution. It is independent of any calendar and concepts like "day" + # or "month". It is related to Timestamp in that the difference between + # two Timestamp values is a Duration and it can be added or subtracted + # from a Timestamp. Range is approximately +-10,000 years. + # + # # Examples + # + # Example 1: Compute Duration from two Timestamps in pseudo code. + # + # Timestamp start = ...; + # Timestamp end = ...; + # Duration duration = ...; + # + # duration.seconds = end.seconds - start.seconds; + # duration.nanos = end.nanos - start.nanos; + # + # if (duration.seconds < 0 && duration.nanos > 0) { + # duration.seconds += 1; + # duration.nanos -= 1000000000; + # } else if (duration.seconds > 0 && duration.nanos < 0) { + # duration.seconds -= 1; + # duration.nanos += 1000000000; + # } + # + # Example 2: Compute Timestamp from Timestamp + Duration in pseudo code. + # + # Timestamp start = ...; + # Duration duration = ...; + # Timestamp end = ...; + # + # end.seconds = start.seconds + duration.seconds; + # end.nanos = start.nanos + duration.nanos; + # + # if (end.nanos < 0) { + # end.seconds -= 1; + # end.nanos += 1000000000; + # } else if (end.nanos >= 1000000000) { + # end.seconds += 1; + # end.nanos -= 1000000000; + # } + # + # Example 3: Compute Duration from datetime.timedelta in Python. + # + # td = datetime.timedelta(days=3, minutes=10) + # duration = Duration() + # duration.FromTimedelta(td) + # + # # JSON Mapping + # + # In JSON format, the Duration type is encoded as a string rather than an + # object, where the string ends in the suffix "s" (indicating seconds) and + # is preceded by the number of seconds, with nanoseconds expressed as + # fractional seconds. For example, 3 seconds with 0 nanoseconds should be + # encoded in JSON format as "3s", while 3 seconds and 1 nanosecond should + # be expressed in JSON format as "3.000000001s", and 3 seconds and 1 + # microsecond should be expressed in JSON format as "3.000001s". + # @!attribute [rw] seconds + # @return [::Integer] + # Signed seconds of the span of time. Must be from -315,576,000,000 + # to +315,576,000,000 inclusive. Note: these bounds are computed from: + # 60 sec/min * 60 min/hr * 24 hr/day * 365.25 days/year * 10000 years + # @!attribute [rw] nanos + # @return [::Integer] + # Signed fractions of a second at nanosecond resolution of the span + # of time. Durations less than one second are represented with a 0 + # `seconds` field and a positive or negative `nanos` field. For durations + # of one second or more, a non-zero value for the `nanos` field must be + # of the same sign as the `seconds` field. Must be from -999,999,999 + # to +999,999,999 inclusive. + class Duration + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end +end diff --git a/owl-bot-staging/google-cloud-secret_manager-v1beta1/proto_docs/google/protobuf/empty.rb b/owl-bot-staging/google-cloud-secret_manager-v1beta1/proto_docs/google/protobuf/empty.rb new file mode 100644 index 000000000000..83e4481834a6 --- /dev/null +++ b/owl-bot-staging/google-cloud-secret_manager-v1beta1/proto_docs/google/protobuf/empty.rb @@ -0,0 +1,34 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + + +module Google + module Protobuf + # A generic empty message that you can re-use to avoid defining duplicated + # empty messages in your APIs. A typical example is to use it as the request + # or the response type of an API method. For instance: + # + # service Foo { + # rpc Bar(google.protobuf.Empty) returns (google.protobuf.Empty); + # } + class Empty + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end +end diff --git a/owl-bot-staging/google-cloud-secret_manager-v1beta1/proto_docs/google/protobuf/field_mask.rb b/owl-bot-staging/google-cloud-secret_manager-v1beta1/proto_docs/google/protobuf/field_mask.rb new file mode 100644 index 000000000000..7f3ffc78601a --- /dev/null +++ b/owl-bot-staging/google-cloud-secret_manager-v1beta1/proto_docs/google/protobuf/field_mask.rb @@ -0,0 +1,229 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + + +module Google + module Protobuf + # `FieldMask` represents a set of symbolic field paths, for example: + # + # paths: "f.a" + # paths: "f.b.d" + # + # Here `f` represents a field in some root message, `a` and `b` + # fields in the message found in `f`, and `d` a field found in the + # message in `f.b`. + # + # Field masks are used to specify a subset of fields that should be + # returned by a get operation or modified by an update operation. + # Field masks also have a custom JSON encoding (see below). + # + # # Field Masks in Projections + # + # When used in the context of a projection, a response message or + # sub-message is filtered by the API to only contain those fields as + # specified in the mask. For example, if the mask in the previous + # example is applied to a response message as follows: + # + # f { + # a : 22 + # b { + # d : 1 + # x : 2 + # } + # y : 13 + # } + # z: 8 + # + # The result will not contain specific values for fields x,y and z + # (their value will be set to the default, and omitted in proto text + # output): + # + # + # f { + # a : 22 + # b { + # d : 1 + # } + # } + # + # A repeated field is not allowed except at the last position of a + # paths string. + # + # If a FieldMask object is not present in a get operation, the + # operation applies to all fields (as if a FieldMask of all fields + # had been specified). + # + # Note that a field mask does not necessarily apply to the + # top-level response message. In case of a REST get operation, the + # field mask applies directly to the response, but in case of a REST + # list operation, the mask instead applies to each individual message + # in the returned resource list. In case of a REST custom method, + # other definitions may be used. Where the mask applies will be + # clearly documented together with its declaration in the API. In + # any case, the effect on the returned resource/resources is required + # behavior for APIs. + # + # # Field Masks in Update Operations + # + # A field mask in update operations specifies which fields of the + # targeted resource are going to be updated. The API is required + # to only change the values of the fields as specified in the mask + # and leave the others untouched. If a resource is passed in to + # describe the updated values, the API ignores the values of all + # fields not covered by the mask. + # + # If a repeated field is specified for an update operation, new values will + # be appended to the existing repeated field in the target resource. Note that + # a repeated field is only allowed in the last position of a `paths` string. + # + # If a sub-message is specified in the last position of the field mask for an + # update operation, then new value will be merged into the existing sub-message + # in the target resource. + # + # For example, given the target message: + # + # f { + # b { + # d: 1 + # x: 2 + # } + # c: [1] + # } + # + # And an update message: + # + # f { + # b { + # d: 10 + # } + # c: [2] + # } + # + # then if the field mask is: + # + # paths: ["f.b", "f.c"] + # + # then the result will be: + # + # f { + # b { + # d: 10 + # x: 2 + # } + # c: [1, 2] + # } + # + # An implementation may provide options to override this default behavior for + # repeated and message fields. + # + # In order to reset a field's value to the default, the field must + # be in the mask and set to the default value in the provided resource. + # Hence, in order to reset all fields of a resource, provide a default + # instance of the resource and set all fields in the mask, or do + # not provide a mask as described below. + # + # If a field mask is not present on update, the operation applies to + # all fields (as if a field mask of all fields has been specified). + # Note that in the presence of schema evolution, this may mean that + # fields the client does not know and has therefore not filled into + # the request will be reset to their default. If this is unwanted + # behavior, a specific service may require a client to always specify + # a field mask, producing an error if not. + # + # As with get operations, the location of the resource which + # describes the updated values in the request message depends on the + # operation kind. In any case, the effect of the field mask is + # required to be honored by the API. + # + # ## Considerations for HTTP REST + # + # The HTTP kind of an update operation which uses a field mask must + # be set to PATCH instead of PUT in order to satisfy HTTP semantics + # (PUT must only be used for full updates). + # + # # JSON Encoding of Field Masks + # + # In JSON, a field mask is encoded as a single string where paths are + # separated by a comma. Fields name in each path are converted + # to/from lower-camel naming conventions. + # + # As an example, consider the following message declarations: + # + # message Profile { + # User user = 1; + # Photo photo = 2; + # } + # message User { + # string display_name = 1; + # string address = 2; + # } + # + # In proto a field mask for `Profile` may look as such: + # + # mask { + # paths: "user.display_name" + # paths: "photo" + # } + # + # In JSON, the same mask is represented as below: + # + # { + # mask: "user.displayName,photo" + # } + # + # # Field Masks and Oneof Fields + # + # Field masks treat fields in oneofs just as regular fields. Consider the + # following message: + # + # message SampleMessage { + # oneof test_oneof { + # string name = 4; + # SubMessage sub_message = 9; + # } + # } + # + # The field mask can be: + # + # mask { + # paths: "name" + # } + # + # Or: + # + # mask { + # paths: "sub_message" + # } + # + # Note that oneof type names ("test_oneof" in this case) cannot be used in + # paths. + # + # ## Field Mask Verification + # + # The implementation of any API method which has a FieldMask type field in the + # request should verify the included field paths, and return an + # `INVALID_ARGUMENT` error if any path is unmappable. + # @!attribute [rw] paths + # @return [::Array<::String>] + # The set of field mask paths. + class FieldMask + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end +end diff --git a/owl-bot-staging/google-cloud-secret_manager-v1beta1/proto_docs/google/protobuf/timestamp.rb b/owl-bot-staging/google-cloud-secret_manager-v1beta1/proto_docs/google/protobuf/timestamp.rb new file mode 100644 index 000000000000..74352be9c58c --- /dev/null +++ b/owl-bot-staging/google-cloud-secret_manager-v1beta1/proto_docs/google/protobuf/timestamp.rb @@ -0,0 +1,127 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + + +module Google + module Protobuf + # A Timestamp represents a point in time independent of any time zone or local + # calendar, encoded as a count of seconds and fractions of seconds at + # nanosecond resolution. The count is relative to an epoch at UTC midnight on + # January 1, 1970, in the proleptic Gregorian calendar which extends the + # Gregorian calendar backwards to year one. + # + # All minutes are 60 seconds long. Leap seconds are "smeared" so that no leap + # second table is needed for interpretation, using a [24-hour linear + # smear](https://developers.google.com/time/smear). + # + # The range is from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59.999999999Z. By + # restricting to that range, we ensure that we can convert to and from [RFC + # 3339](https://www.ietf.org/rfc/rfc3339.txt) date strings. + # + # # Examples + # + # Example 1: Compute Timestamp from POSIX `time()`. + # + # Timestamp timestamp; + # timestamp.set_seconds(time(NULL)); + # timestamp.set_nanos(0); + # + # Example 2: Compute Timestamp from POSIX `gettimeofday()`. + # + # struct timeval tv; + # gettimeofday(&tv, NULL); + # + # Timestamp timestamp; + # timestamp.set_seconds(tv.tv_sec); + # timestamp.set_nanos(tv.tv_usec * 1000); + # + # Example 3: Compute Timestamp from Win32 `GetSystemTimeAsFileTime()`. + # + # FILETIME ft; + # GetSystemTimeAsFileTime(&ft); + # UINT64 ticks = (((UINT64)ft.dwHighDateTime) << 32) | ft.dwLowDateTime; + # + # // A Windows tick is 100 nanoseconds. Windows epoch 1601-01-01T00:00:00Z + # // is 11644473600 seconds before Unix epoch 1970-01-01T00:00:00Z. + # Timestamp timestamp; + # timestamp.set_seconds((INT64) ((ticks / 10000000) - 11644473600LL)); + # timestamp.set_nanos((INT32) ((ticks % 10000000) * 100)); + # + # Example 4: Compute Timestamp from Java `System.currentTimeMillis()`. + # + # long millis = System.currentTimeMillis(); + # + # Timestamp timestamp = Timestamp.newBuilder().setSeconds(millis / 1000) + # .setNanos((int) ((millis % 1000) * 1000000)).build(); + # + # Example 5: Compute Timestamp from Java `Instant.now()`. + # + # Instant now = Instant.now(); + # + # Timestamp timestamp = + # Timestamp.newBuilder().setSeconds(now.getEpochSecond()) + # .setNanos(now.getNano()).build(); + # + # Example 6: Compute Timestamp from current time in Python. + # + # timestamp = Timestamp() + # timestamp.GetCurrentTime() + # + # # JSON Mapping + # + # In JSON format, the Timestamp type is encoded as a string in the + # [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format. That is, the + # format is "\\{year}-\\{month}-\\{day}T\\{hour}:\\{min}:\\{sec}[.\\{frac_sec}]Z" + # where \\{year} is always expressed using four digits while \\{month}, \\{day}, + # \\{hour}, \\{min}, and \\{sec} are zero-padded to two digits each. The fractional + # seconds, which can go up to 9 digits (i.e. up to 1 nanosecond resolution), + # are optional. The "Z" suffix indicates the timezone ("UTC"); the timezone + # is required. A proto3 JSON serializer should always use UTC (as indicated by + # "Z") when printing the Timestamp type and a proto3 JSON parser should be + # able to accept both UTC and other timezones (as indicated by an offset). + # + # For example, "2017-01-15T01:30:15.01Z" encodes 15.01 seconds past + # 01:30 UTC on January 15, 2017. + # + # In JavaScript, one can convert a Date object to this format using the + # standard + # [toISOString()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toISOString) + # method. In Python, a standard `datetime.datetime` object can be converted + # to this format using + # [`strftime`](https://docs.python.org/2/library/time.html#time.strftime) with + # the time format spec '%Y-%m-%dT%H:%M:%S.%fZ'. Likewise, in Java, one can use + # the Joda Time's [`ISODateTimeFormat.dateTime()`]( + # http://joda-time.sourceforge.net/apidocs/org/joda/time/format/ISODateTimeFormat.html#dateTime() + # ) to obtain a formatter capable of generating timestamps in this format. + # @!attribute [rw] seconds + # @return [::Integer] + # Represents seconds of UTC time since Unix epoch + # 1970-01-01T00:00:00Z. Must be from 0001-01-01T00:00:00Z to + # 9999-12-31T23:59:59Z inclusive. + # @!attribute [rw] nanos + # @return [::Integer] + # Non-negative fractions of a second at nanosecond resolution. Negative + # second values with fractions must still have non-negative nanos values + # that count forward in time. Must be from 0 to 999,999,999 + # inclusive. + class Timestamp + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end +end diff --git a/owl-bot-staging/google-cloud-secret_manager-v1beta1/proto_docs/google/type/expr.rb b/owl-bot-staging/google-cloud-secret_manager-v1beta1/proto_docs/google/type/expr.rb new file mode 100644 index 000000000000..53e7733b6592 --- /dev/null +++ b/owl-bot-staging/google-cloud-secret_manager-v1beta1/proto_docs/google/type/expr.rb @@ -0,0 +1,75 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + + +module Google + module Type + # Represents a textual expression in the Common Expression Language (CEL) + # syntax. CEL is a C-like expression language. The syntax and semantics of CEL + # are documented at https://github.com/google/cel-spec. + # + # Example (Comparison): + # + # title: "Summary size limit" + # description: "Determines if a summary is less than 100 chars" + # expression: "document.summary.size() < 100" + # + # Example (Equality): + # + # title: "Requestor is owner" + # description: "Determines if requestor is the document owner" + # expression: "document.owner == request.auth.claims.email" + # + # Example (Logic): + # + # title: "Public documents" + # description: "Determine whether the document should be publicly visible" + # expression: "document.type != 'private' && document.type != 'internal'" + # + # Example (Data Manipulation): + # + # title: "Notification string" + # description: "Create a notification string with a timestamp." + # expression: "'New message received at ' + string(document.create_time)" + # + # The exact variables and functions that may be referenced within an expression + # are determined by the service that evaluates it. See the service + # documentation for additional information. + # @!attribute [rw] expression + # @return [::String] + # Textual representation of an expression in Common Expression Language + # syntax. + # @!attribute [rw] title + # @return [::String] + # Optional. Title for the expression, i.e. a short string describing + # its purpose. This can be used e.g. in UIs which allow to enter the + # expression. + # @!attribute [rw] description + # @return [::String] + # Optional. Description of the expression. This is a longer text which + # describes the expression, e.g. when hovered over it in a UI. + # @!attribute [rw] location + # @return [::String] + # Optional. String indicating the location of the expression for error + # reporting, e.g. a file name and a position in the file. + class Expr + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end +end diff --git a/owl-bot-staging/google-cloud-secret_manager-v1beta1/snippets/Gemfile b/owl-bot-staging/google-cloud-secret_manager-v1beta1/snippets/Gemfile new file mode 100644 index 000000000000..7d0b3f462848 --- /dev/null +++ b/owl-bot-staging/google-cloud-secret_manager-v1beta1/snippets/Gemfile @@ -0,0 +1,32 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +source "https://rubygems.org" + +if ENV["GOOGLE_CLOUD_SAMPLES_TEST"] == "master" + gem "google-cloud-secret_manager-v1beta1", path: "../" +else + gem "google-cloud-secret_manager-v1beta1" +end + +group :test do + gem "google-style", "~> 1.26.1" + gem "minitest", "~> 5.16" + gem "minitest-focus", "~> 1.1" + gem "minitest-hooks", "~> 1.5" +end diff --git a/owl-bot-staging/google-cloud-secret_manager-v1beta1/snippets/secret_manager_service/access_secret_version.rb b/owl-bot-staging/google-cloud-secret_manager-v1beta1/snippets/secret_manager_service/access_secret_version.rb new file mode 100644 index 000000000000..ac6df7b6e662 --- /dev/null +++ b/owl-bot-staging/google-cloud-secret_manager-v1beta1/snippets/secret_manager_service/access_secret_version.rb @@ -0,0 +1,47 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +# [START secretmanager_v1beta1_generated_SecretManagerService_AccessSecretVersion_sync] +require "google/cloud/secret_manager/v1beta1" + +## +# Snippet for the access_secret_version call in the SecretManagerService service +# +# This snippet has been automatically generated and should be regarded as a code +# template only. It will require modifications to work: +# - It may require correct/in-range values for request initialization. +# - It may require specifying regional endpoints when creating the service +# client as shown in https://cloud.google.com/ruby/docs/reference. +# +# This is an auto-generated example demonstrating basic usage of +# Google::Cloud::SecretManager::V1beta1::SecretManagerService::Client#access_secret_version. +# +def access_secret_version + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::SecretManager::V1beta1::SecretManagerService::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::SecretManager::V1beta1::AccessSecretVersionRequest.new + + # Call the access_secret_version method. + result = client.access_secret_version request + + # The returned object is of type Google::Cloud::SecretManager::V1beta1::AccessSecretVersionResponse. + p result +end +# [END secretmanager_v1beta1_generated_SecretManagerService_AccessSecretVersion_sync] diff --git a/owl-bot-staging/google-cloud-secret_manager-v1beta1/snippets/secret_manager_service/add_secret_version.rb b/owl-bot-staging/google-cloud-secret_manager-v1beta1/snippets/secret_manager_service/add_secret_version.rb new file mode 100644 index 000000000000..2a913b556c14 --- /dev/null +++ b/owl-bot-staging/google-cloud-secret_manager-v1beta1/snippets/secret_manager_service/add_secret_version.rb @@ -0,0 +1,47 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +# [START secretmanager_v1beta1_generated_SecretManagerService_AddSecretVersion_sync] +require "google/cloud/secret_manager/v1beta1" + +## +# Snippet for the add_secret_version call in the SecretManagerService service +# +# This snippet has been automatically generated and should be regarded as a code +# template only. It will require modifications to work: +# - It may require correct/in-range values for request initialization. +# - It may require specifying regional endpoints when creating the service +# client as shown in https://cloud.google.com/ruby/docs/reference. +# +# This is an auto-generated example demonstrating basic usage of +# Google::Cloud::SecretManager::V1beta1::SecretManagerService::Client#add_secret_version. +# +def add_secret_version + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::SecretManager::V1beta1::SecretManagerService::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::SecretManager::V1beta1::AddSecretVersionRequest.new + + # Call the add_secret_version method. + result = client.add_secret_version request + + # The returned object is of type Google::Cloud::SecretManager::V1beta1::SecretVersion. + p result +end +# [END secretmanager_v1beta1_generated_SecretManagerService_AddSecretVersion_sync] diff --git a/owl-bot-staging/google-cloud-secret_manager-v1beta1/snippets/secret_manager_service/create_secret.rb b/owl-bot-staging/google-cloud-secret_manager-v1beta1/snippets/secret_manager_service/create_secret.rb new file mode 100644 index 000000000000..b0fd1bcbba4a --- /dev/null +++ b/owl-bot-staging/google-cloud-secret_manager-v1beta1/snippets/secret_manager_service/create_secret.rb @@ -0,0 +1,47 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +# [START secretmanager_v1beta1_generated_SecretManagerService_CreateSecret_sync] +require "google/cloud/secret_manager/v1beta1" + +## +# Snippet for the create_secret call in the SecretManagerService service +# +# This snippet has been automatically generated and should be regarded as a code +# template only. It will require modifications to work: +# - It may require correct/in-range values for request initialization. +# - It may require specifying regional endpoints when creating the service +# client as shown in https://cloud.google.com/ruby/docs/reference. +# +# This is an auto-generated example demonstrating basic usage of +# Google::Cloud::SecretManager::V1beta1::SecretManagerService::Client#create_secret. +# +def create_secret + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::SecretManager::V1beta1::SecretManagerService::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::SecretManager::V1beta1::CreateSecretRequest.new + + # Call the create_secret method. + result = client.create_secret request + + # The returned object is of type Google::Cloud::SecretManager::V1beta1::Secret. + p result +end +# [END secretmanager_v1beta1_generated_SecretManagerService_CreateSecret_sync] diff --git a/owl-bot-staging/google-cloud-secret_manager-v1beta1/snippets/secret_manager_service/delete_secret.rb b/owl-bot-staging/google-cloud-secret_manager-v1beta1/snippets/secret_manager_service/delete_secret.rb new file mode 100644 index 000000000000..7148292e6d60 --- /dev/null +++ b/owl-bot-staging/google-cloud-secret_manager-v1beta1/snippets/secret_manager_service/delete_secret.rb @@ -0,0 +1,47 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +# [START secretmanager_v1beta1_generated_SecretManagerService_DeleteSecret_sync] +require "google/cloud/secret_manager/v1beta1" + +## +# Snippet for the delete_secret call in the SecretManagerService service +# +# This snippet has been automatically generated and should be regarded as a code +# template only. It will require modifications to work: +# - It may require correct/in-range values for request initialization. +# - It may require specifying regional endpoints when creating the service +# client as shown in https://cloud.google.com/ruby/docs/reference. +# +# This is an auto-generated example demonstrating basic usage of +# Google::Cloud::SecretManager::V1beta1::SecretManagerService::Client#delete_secret. +# +def delete_secret + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::SecretManager::V1beta1::SecretManagerService::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::SecretManager::V1beta1::DeleteSecretRequest.new + + # Call the delete_secret method. + result = client.delete_secret request + + # The returned object is of type Google::Protobuf::Empty. + p result +end +# [END secretmanager_v1beta1_generated_SecretManagerService_DeleteSecret_sync] diff --git a/owl-bot-staging/google-cloud-secret_manager-v1beta1/snippets/secret_manager_service/destroy_secret_version.rb b/owl-bot-staging/google-cloud-secret_manager-v1beta1/snippets/secret_manager_service/destroy_secret_version.rb new file mode 100644 index 000000000000..a2ce12dcbae7 --- /dev/null +++ b/owl-bot-staging/google-cloud-secret_manager-v1beta1/snippets/secret_manager_service/destroy_secret_version.rb @@ -0,0 +1,47 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +# [START secretmanager_v1beta1_generated_SecretManagerService_DestroySecretVersion_sync] +require "google/cloud/secret_manager/v1beta1" + +## +# Snippet for the destroy_secret_version call in the SecretManagerService service +# +# This snippet has been automatically generated and should be regarded as a code +# template only. It will require modifications to work: +# - It may require correct/in-range values for request initialization. +# - It may require specifying regional endpoints when creating the service +# client as shown in https://cloud.google.com/ruby/docs/reference. +# +# This is an auto-generated example demonstrating basic usage of +# Google::Cloud::SecretManager::V1beta1::SecretManagerService::Client#destroy_secret_version. +# +def destroy_secret_version + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::SecretManager::V1beta1::SecretManagerService::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::SecretManager::V1beta1::DestroySecretVersionRequest.new + + # Call the destroy_secret_version method. + result = client.destroy_secret_version request + + # The returned object is of type Google::Cloud::SecretManager::V1beta1::SecretVersion. + p result +end +# [END secretmanager_v1beta1_generated_SecretManagerService_DestroySecretVersion_sync] diff --git a/owl-bot-staging/google-cloud-secret_manager-v1beta1/snippets/secret_manager_service/disable_secret_version.rb b/owl-bot-staging/google-cloud-secret_manager-v1beta1/snippets/secret_manager_service/disable_secret_version.rb new file mode 100644 index 000000000000..c578b0471ea7 --- /dev/null +++ b/owl-bot-staging/google-cloud-secret_manager-v1beta1/snippets/secret_manager_service/disable_secret_version.rb @@ -0,0 +1,47 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +# [START secretmanager_v1beta1_generated_SecretManagerService_DisableSecretVersion_sync] +require "google/cloud/secret_manager/v1beta1" + +## +# Snippet for the disable_secret_version call in the SecretManagerService service +# +# This snippet has been automatically generated and should be regarded as a code +# template only. It will require modifications to work: +# - It may require correct/in-range values for request initialization. +# - It may require specifying regional endpoints when creating the service +# client as shown in https://cloud.google.com/ruby/docs/reference. +# +# This is an auto-generated example demonstrating basic usage of +# Google::Cloud::SecretManager::V1beta1::SecretManagerService::Client#disable_secret_version. +# +def disable_secret_version + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::SecretManager::V1beta1::SecretManagerService::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::SecretManager::V1beta1::DisableSecretVersionRequest.new + + # Call the disable_secret_version method. + result = client.disable_secret_version request + + # The returned object is of type Google::Cloud::SecretManager::V1beta1::SecretVersion. + p result +end +# [END secretmanager_v1beta1_generated_SecretManagerService_DisableSecretVersion_sync] diff --git a/owl-bot-staging/google-cloud-secret_manager-v1beta1/snippets/secret_manager_service/enable_secret_version.rb b/owl-bot-staging/google-cloud-secret_manager-v1beta1/snippets/secret_manager_service/enable_secret_version.rb new file mode 100644 index 000000000000..728070e800a2 --- /dev/null +++ b/owl-bot-staging/google-cloud-secret_manager-v1beta1/snippets/secret_manager_service/enable_secret_version.rb @@ -0,0 +1,47 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +# [START secretmanager_v1beta1_generated_SecretManagerService_EnableSecretVersion_sync] +require "google/cloud/secret_manager/v1beta1" + +## +# Snippet for the enable_secret_version call in the SecretManagerService service +# +# This snippet has been automatically generated and should be regarded as a code +# template only. It will require modifications to work: +# - It may require correct/in-range values for request initialization. +# - It may require specifying regional endpoints when creating the service +# client as shown in https://cloud.google.com/ruby/docs/reference. +# +# This is an auto-generated example demonstrating basic usage of +# Google::Cloud::SecretManager::V1beta1::SecretManagerService::Client#enable_secret_version. +# +def enable_secret_version + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::SecretManager::V1beta1::SecretManagerService::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::SecretManager::V1beta1::EnableSecretVersionRequest.new + + # Call the enable_secret_version method. + result = client.enable_secret_version request + + # The returned object is of type Google::Cloud::SecretManager::V1beta1::SecretVersion. + p result +end +# [END secretmanager_v1beta1_generated_SecretManagerService_EnableSecretVersion_sync] diff --git a/owl-bot-staging/google-cloud-secret_manager-v1beta1/snippets/secret_manager_service/get_iam_policy.rb b/owl-bot-staging/google-cloud-secret_manager-v1beta1/snippets/secret_manager_service/get_iam_policy.rb new file mode 100644 index 000000000000..2fcae7265e71 --- /dev/null +++ b/owl-bot-staging/google-cloud-secret_manager-v1beta1/snippets/secret_manager_service/get_iam_policy.rb @@ -0,0 +1,47 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +# [START secretmanager_v1beta1_generated_SecretManagerService_GetIamPolicy_sync] +require "google/cloud/secret_manager/v1beta1" + +## +# Snippet for the get_iam_policy call in the SecretManagerService service +# +# This snippet has been automatically generated and should be regarded as a code +# template only. It will require modifications to work: +# - It may require correct/in-range values for request initialization. +# - It may require specifying regional endpoints when creating the service +# client as shown in https://cloud.google.com/ruby/docs/reference. +# +# This is an auto-generated example demonstrating basic usage of +# Google::Cloud::SecretManager::V1beta1::SecretManagerService::Client#get_iam_policy. +# +def get_iam_policy + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::SecretManager::V1beta1::SecretManagerService::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Iam::V1::GetIamPolicyRequest.new + + # Call the get_iam_policy method. + result = client.get_iam_policy request + + # The returned object is of type Google::Iam::V1::Policy. + p result +end +# [END secretmanager_v1beta1_generated_SecretManagerService_GetIamPolicy_sync] diff --git a/owl-bot-staging/google-cloud-secret_manager-v1beta1/snippets/secret_manager_service/get_secret.rb b/owl-bot-staging/google-cloud-secret_manager-v1beta1/snippets/secret_manager_service/get_secret.rb new file mode 100644 index 000000000000..75619ce72ae8 --- /dev/null +++ b/owl-bot-staging/google-cloud-secret_manager-v1beta1/snippets/secret_manager_service/get_secret.rb @@ -0,0 +1,47 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +# [START secretmanager_v1beta1_generated_SecretManagerService_GetSecret_sync] +require "google/cloud/secret_manager/v1beta1" + +## +# Snippet for the get_secret call in the SecretManagerService service +# +# This snippet has been automatically generated and should be regarded as a code +# template only. It will require modifications to work: +# - It may require correct/in-range values for request initialization. +# - It may require specifying regional endpoints when creating the service +# client as shown in https://cloud.google.com/ruby/docs/reference. +# +# This is an auto-generated example demonstrating basic usage of +# Google::Cloud::SecretManager::V1beta1::SecretManagerService::Client#get_secret. +# +def get_secret + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::SecretManager::V1beta1::SecretManagerService::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::SecretManager::V1beta1::GetSecretRequest.new + + # Call the get_secret method. + result = client.get_secret request + + # The returned object is of type Google::Cloud::SecretManager::V1beta1::Secret. + p result +end +# [END secretmanager_v1beta1_generated_SecretManagerService_GetSecret_sync] diff --git a/owl-bot-staging/google-cloud-secret_manager-v1beta1/snippets/secret_manager_service/get_secret_version.rb b/owl-bot-staging/google-cloud-secret_manager-v1beta1/snippets/secret_manager_service/get_secret_version.rb new file mode 100644 index 000000000000..5c6734cf2a67 --- /dev/null +++ b/owl-bot-staging/google-cloud-secret_manager-v1beta1/snippets/secret_manager_service/get_secret_version.rb @@ -0,0 +1,47 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +# [START secretmanager_v1beta1_generated_SecretManagerService_GetSecretVersion_sync] +require "google/cloud/secret_manager/v1beta1" + +## +# Snippet for the get_secret_version call in the SecretManagerService service +# +# This snippet has been automatically generated and should be regarded as a code +# template only. It will require modifications to work: +# - It may require correct/in-range values for request initialization. +# - It may require specifying regional endpoints when creating the service +# client as shown in https://cloud.google.com/ruby/docs/reference. +# +# This is an auto-generated example demonstrating basic usage of +# Google::Cloud::SecretManager::V1beta1::SecretManagerService::Client#get_secret_version. +# +def get_secret_version + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::SecretManager::V1beta1::SecretManagerService::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::SecretManager::V1beta1::GetSecretVersionRequest.new + + # Call the get_secret_version method. + result = client.get_secret_version request + + # The returned object is of type Google::Cloud::SecretManager::V1beta1::SecretVersion. + p result +end +# [END secretmanager_v1beta1_generated_SecretManagerService_GetSecretVersion_sync] diff --git a/owl-bot-staging/google-cloud-secret_manager-v1beta1/snippets/secret_manager_service/list_secret_versions.rb b/owl-bot-staging/google-cloud-secret_manager-v1beta1/snippets/secret_manager_service/list_secret_versions.rb new file mode 100644 index 000000000000..3beb998ea346 --- /dev/null +++ b/owl-bot-staging/google-cloud-secret_manager-v1beta1/snippets/secret_manager_service/list_secret_versions.rb @@ -0,0 +1,51 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +# [START secretmanager_v1beta1_generated_SecretManagerService_ListSecretVersions_sync] +require "google/cloud/secret_manager/v1beta1" + +## +# Snippet for the list_secret_versions call in the SecretManagerService service +# +# This snippet has been automatically generated and should be regarded as a code +# template only. It will require modifications to work: +# - It may require correct/in-range values for request initialization. +# - It may require specifying regional endpoints when creating the service +# client as shown in https://cloud.google.com/ruby/docs/reference. +# +# This is an auto-generated example demonstrating basic usage of +# Google::Cloud::SecretManager::V1beta1::SecretManagerService::Client#list_secret_versions. +# +def list_secret_versions + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::SecretManager::V1beta1::SecretManagerService::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::SecretManager::V1beta1::ListSecretVersionsRequest.new + + # Call the list_secret_versions method. + result = client.list_secret_versions request + + # The returned object is of type Gapic::PagedEnumerable. You can iterate + # over elements, and API calls will be issued to fetch pages as needed. + result.each do |item| + # Each element is of type ::Google::Cloud::SecretManager::V1beta1::SecretVersion. + p item + end +end +# [END secretmanager_v1beta1_generated_SecretManagerService_ListSecretVersions_sync] diff --git a/owl-bot-staging/google-cloud-secret_manager-v1beta1/snippets/secret_manager_service/list_secrets.rb b/owl-bot-staging/google-cloud-secret_manager-v1beta1/snippets/secret_manager_service/list_secrets.rb new file mode 100644 index 000000000000..d29981383e36 --- /dev/null +++ b/owl-bot-staging/google-cloud-secret_manager-v1beta1/snippets/secret_manager_service/list_secrets.rb @@ -0,0 +1,51 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +# [START secretmanager_v1beta1_generated_SecretManagerService_ListSecrets_sync] +require "google/cloud/secret_manager/v1beta1" + +## +# Snippet for the list_secrets call in the SecretManagerService service +# +# This snippet has been automatically generated and should be regarded as a code +# template only. It will require modifications to work: +# - It may require correct/in-range values for request initialization. +# - It may require specifying regional endpoints when creating the service +# client as shown in https://cloud.google.com/ruby/docs/reference. +# +# This is an auto-generated example demonstrating basic usage of +# Google::Cloud::SecretManager::V1beta1::SecretManagerService::Client#list_secrets. +# +def list_secrets + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::SecretManager::V1beta1::SecretManagerService::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::SecretManager::V1beta1::ListSecretsRequest.new + + # Call the list_secrets method. + result = client.list_secrets request + + # The returned object is of type Gapic::PagedEnumerable. You can iterate + # over elements, and API calls will be issued to fetch pages as needed. + result.each do |item| + # Each element is of type ::Google::Cloud::SecretManager::V1beta1::Secret. + p item + end +end +# [END secretmanager_v1beta1_generated_SecretManagerService_ListSecrets_sync] diff --git a/owl-bot-staging/google-cloud-secret_manager-v1beta1/snippets/secret_manager_service/set_iam_policy.rb b/owl-bot-staging/google-cloud-secret_manager-v1beta1/snippets/secret_manager_service/set_iam_policy.rb new file mode 100644 index 000000000000..0d96d5ef3a67 --- /dev/null +++ b/owl-bot-staging/google-cloud-secret_manager-v1beta1/snippets/secret_manager_service/set_iam_policy.rb @@ -0,0 +1,47 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +# [START secretmanager_v1beta1_generated_SecretManagerService_SetIamPolicy_sync] +require "google/cloud/secret_manager/v1beta1" + +## +# Snippet for the set_iam_policy call in the SecretManagerService service +# +# This snippet has been automatically generated and should be regarded as a code +# template only. It will require modifications to work: +# - It may require correct/in-range values for request initialization. +# - It may require specifying regional endpoints when creating the service +# client as shown in https://cloud.google.com/ruby/docs/reference. +# +# This is an auto-generated example demonstrating basic usage of +# Google::Cloud::SecretManager::V1beta1::SecretManagerService::Client#set_iam_policy. +# +def set_iam_policy + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::SecretManager::V1beta1::SecretManagerService::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Iam::V1::SetIamPolicyRequest.new + + # Call the set_iam_policy method. + result = client.set_iam_policy request + + # The returned object is of type Google::Iam::V1::Policy. + p result +end +# [END secretmanager_v1beta1_generated_SecretManagerService_SetIamPolicy_sync] diff --git a/owl-bot-staging/google-cloud-secret_manager-v1beta1/snippets/secret_manager_service/test_iam_permissions.rb b/owl-bot-staging/google-cloud-secret_manager-v1beta1/snippets/secret_manager_service/test_iam_permissions.rb new file mode 100644 index 000000000000..855968413f63 --- /dev/null +++ b/owl-bot-staging/google-cloud-secret_manager-v1beta1/snippets/secret_manager_service/test_iam_permissions.rb @@ -0,0 +1,47 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +# [START secretmanager_v1beta1_generated_SecretManagerService_TestIamPermissions_sync] +require "google/cloud/secret_manager/v1beta1" + +## +# Snippet for the test_iam_permissions call in the SecretManagerService service +# +# This snippet has been automatically generated and should be regarded as a code +# template only. It will require modifications to work: +# - It may require correct/in-range values for request initialization. +# - It may require specifying regional endpoints when creating the service +# client as shown in https://cloud.google.com/ruby/docs/reference. +# +# This is an auto-generated example demonstrating basic usage of +# Google::Cloud::SecretManager::V1beta1::SecretManagerService::Client#test_iam_permissions. +# +def test_iam_permissions + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::SecretManager::V1beta1::SecretManagerService::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Iam::V1::TestIamPermissionsRequest.new + + # Call the test_iam_permissions method. + result = client.test_iam_permissions request + + # The returned object is of type Google::Iam::V1::TestIamPermissionsResponse. + p result +end +# [END secretmanager_v1beta1_generated_SecretManagerService_TestIamPermissions_sync] diff --git a/owl-bot-staging/google-cloud-secret_manager-v1beta1/snippets/secret_manager_service/update_secret.rb b/owl-bot-staging/google-cloud-secret_manager-v1beta1/snippets/secret_manager_service/update_secret.rb new file mode 100644 index 000000000000..7979fa334732 --- /dev/null +++ b/owl-bot-staging/google-cloud-secret_manager-v1beta1/snippets/secret_manager_service/update_secret.rb @@ -0,0 +1,47 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +# [START secretmanager_v1beta1_generated_SecretManagerService_UpdateSecret_sync] +require "google/cloud/secret_manager/v1beta1" + +## +# Snippet for the update_secret call in the SecretManagerService service +# +# This snippet has been automatically generated and should be regarded as a code +# template only. It will require modifications to work: +# - It may require correct/in-range values for request initialization. +# - It may require specifying regional endpoints when creating the service +# client as shown in https://cloud.google.com/ruby/docs/reference. +# +# This is an auto-generated example demonstrating basic usage of +# Google::Cloud::SecretManager::V1beta1::SecretManagerService::Client#update_secret. +# +def update_secret + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::SecretManager::V1beta1::SecretManagerService::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::SecretManager::V1beta1::UpdateSecretRequest.new + + # Call the update_secret method. + result = client.update_secret request + + # The returned object is of type Google::Cloud::SecretManager::V1beta1::Secret. + p result +end +# [END secretmanager_v1beta1_generated_SecretManagerService_UpdateSecret_sync] diff --git a/owl-bot-staging/google-cloud-secret_manager-v1beta1/snippets/snippet_metadata_google.cloud.secrets.v1beta1.json b/owl-bot-staging/google-cloud-secret_manager-v1beta1/snippets/snippet_metadata_google.cloud.secrets.v1beta1.json new file mode 100644 index 000000000000..e3e0f532e34a --- /dev/null +++ b/owl-bot-staging/google-cloud-secret_manager-v1beta1/snippets/snippet_metadata_google.cloud.secrets.v1beta1.json @@ -0,0 +1,615 @@ +{ + "client_library": { + "name": "google-cloud-secret_manager-v1beta1", + "version": "", + "language": "RUBY", + "apis": [ + { + "id": "google.cloud.secrets.v1beta1", + "version": "v1beta1" + } + ] + }, + "snippets": [ + { + "region_tag": "secretmanager_v1beta1_generated_SecretManagerService_ListSecrets_sync", + "title": "Snippet for the list_secrets call in the SecretManagerService service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::SecretManager::V1beta1::SecretManagerService::Client#list_secrets.", + "file": "secret_manager_service/list_secrets.rb", + "language": "RUBY", + "client_method": { + "short_name": "list_secrets", + "full_name": "::Google::Cloud::SecretManager::V1beta1::SecretManagerService::Client#list_secrets", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::SecretManager::V1beta1::ListSecretsRequest", + "name": "request" + } + ], + "result_type": "::Google::Cloud::SecretManager::V1beta1::ListSecretsResponse", + "client": { + "short_name": "SecretManagerService::Client", + "full_name": "::Google::Cloud::SecretManager::V1beta1::SecretManagerService::Client" + }, + "method": { + "short_name": "ListSecrets", + "full_name": "google.cloud.secrets.v1beta1.SecretManagerService.ListSecrets", + "service": { + "short_name": "SecretManagerService", + "full_name": "google.cloud.secrets.v1beta1.SecretManagerService" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 50, + "type": "FULL" + } + ] + }, + { + "region_tag": "secretmanager_v1beta1_generated_SecretManagerService_CreateSecret_sync", + "title": "Snippet for the create_secret call in the SecretManagerService service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::SecretManager::V1beta1::SecretManagerService::Client#create_secret.", + "file": "secret_manager_service/create_secret.rb", + "language": "RUBY", + "client_method": { + "short_name": "create_secret", + "full_name": "::Google::Cloud::SecretManager::V1beta1::SecretManagerService::Client#create_secret", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::SecretManager::V1beta1::CreateSecretRequest", + "name": "request" + } + ], + "result_type": "::Google::Cloud::SecretManager::V1beta1::Secret", + "client": { + "short_name": "SecretManagerService::Client", + "full_name": "::Google::Cloud::SecretManager::V1beta1::SecretManagerService::Client" + }, + "method": { + "short_name": "CreateSecret", + "full_name": "google.cloud.secrets.v1beta1.SecretManagerService.CreateSecret", + "service": { + "short_name": "SecretManagerService", + "full_name": "google.cloud.secrets.v1beta1.SecretManagerService" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 46, + "type": "FULL" + } + ] + }, + { + "region_tag": "secretmanager_v1beta1_generated_SecretManagerService_AddSecretVersion_sync", + "title": "Snippet for the add_secret_version call in the SecretManagerService service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::SecretManager::V1beta1::SecretManagerService::Client#add_secret_version.", + "file": "secret_manager_service/add_secret_version.rb", + "language": "RUBY", + "client_method": { + "short_name": "add_secret_version", + "full_name": "::Google::Cloud::SecretManager::V1beta1::SecretManagerService::Client#add_secret_version", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::SecretManager::V1beta1::AddSecretVersionRequest", + "name": "request" + } + ], + "result_type": "::Google::Cloud::SecretManager::V1beta1::SecretVersion", + "client": { + "short_name": "SecretManagerService::Client", + "full_name": "::Google::Cloud::SecretManager::V1beta1::SecretManagerService::Client" + }, + "method": { + "short_name": "AddSecretVersion", + "full_name": "google.cloud.secrets.v1beta1.SecretManagerService.AddSecretVersion", + "service": { + "short_name": "SecretManagerService", + "full_name": "google.cloud.secrets.v1beta1.SecretManagerService" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 46, + "type": "FULL" + } + ] + }, + { + "region_tag": "secretmanager_v1beta1_generated_SecretManagerService_GetSecret_sync", + "title": "Snippet for the get_secret call in the SecretManagerService service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::SecretManager::V1beta1::SecretManagerService::Client#get_secret.", + "file": "secret_manager_service/get_secret.rb", + "language": "RUBY", + "client_method": { + "short_name": "get_secret", + "full_name": "::Google::Cloud::SecretManager::V1beta1::SecretManagerService::Client#get_secret", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::SecretManager::V1beta1::GetSecretRequest", + "name": "request" + } + ], + "result_type": "::Google::Cloud::SecretManager::V1beta1::Secret", + "client": { + "short_name": "SecretManagerService::Client", + "full_name": "::Google::Cloud::SecretManager::V1beta1::SecretManagerService::Client" + }, + "method": { + "short_name": "GetSecret", + "full_name": "google.cloud.secrets.v1beta1.SecretManagerService.GetSecret", + "service": { + "short_name": "SecretManagerService", + "full_name": "google.cloud.secrets.v1beta1.SecretManagerService" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 46, + "type": "FULL" + } + ] + }, + { + "region_tag": "secretmanager_v1beta1_generated_SecretManagerService_UpdateSecret_sync", + "title": "Snippet for the update_secret call in the SecretManagerService service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::SecretManager::V1beta1::SecretManagerService::Client#update_secret.", + "file": "secret_manager_service/update_secret.rb", + "language": "RUBY", + "client_method": { + "short_name": "update_secret", + "full_name": "::Google::Cloud::SecretManager::V1beta1::SecretManagerService::Client#update_secret", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::SecretManager::V1beta1::UpdateSecretRequest", + "name": "request" + } + ], + "result_type": "::Google::Cloud::SecretManager::V1beta1::Secret", + "client": { + "short_name": "SecretManagerService::Client", + "full_name": "::Google::Cloud::SecretManager::V1beta1::SecretManagerService::Client" + }, + "method": { + "short_name": "UpdateSecret", + "full_name": "google.cloud.secrets.v1beta1.SecretManagerService.UpdateSecret", + "service": { + "short_name": "SecretManagerService", + "full_name": "google.cloud.secrets.v1beta1.SecretManagerService" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 46, + "type": "FULL" + } + ] + }, + { + "region_tag": "secretmanager_v1beta1_generated_SecretManagerService_DeleteSecret_sync", + "title": "Snippet for the delete_secret call in the SecretManagerService service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::SecretManager::V1beta1::SecretManagerService::Client#delete_secret.", + "file": "secret_manager_service/delete_secret.rb", + "language": "RUBY", + "client_method": { + "short_name": "delete_secret", + "full_name": "::Google::Cloud::SecretManager::V1beta1::SecretManagerService::Client#delete_secret", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::SecretManager::V1beta1::DeleteSecretRequest", + "name": "request" + } + ], + "result_type": "::Google::Protobuf::Empty", + "client": { + "short_name": "SecretManagerService::Client", + "full_name": "::Google::Cloud::SecretManager::V1beta1::SecretManagerService::Client" + }, + "method": { + "short_name": "DeleteSecret", + "full_name": "google.cloud.secrets.v1beta1.SecretManagerService.DeleteSecret", + "service": { + "short_name": "SecretManagerService", + "full_name": "google.cloud.secrets.v1beta1.SecretManagerService" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 46, + "type": "FULL" + } + ] + }, + { + "region_tag": "secretmanager_v1beta1_generated_SecretManagerService_ListSecretVersions_sync", + "title": "Snippet for the list_secret_versions call in the SecretManagerService service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::SecretManager::V1beta1::SecretManagerService::Client#list_secret_versions.", + "file": "secret_manager_service/list_secret_versions.rb", + "language": "RUBY", + "client_method": { + "short_name": "list_secret_versions", + "full_name": "::Google::Cloud::SecretManager::V1beta1::SecretManagerService::Client#list_secret_versions", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::SecretManager::V1beta1::ListSecretVersionsRequest", + "name": "request" + } + ], + "result_type": "::Google::Cloud::SecretManager::V1beta1::ListSecretVersionsResponse", + "client": { + "short_name": "SecretManagerService::Client", + "full_name": "::Google::Cloud::SecretManager::V1beta1::SecretManagerService::Client" + }, + "method": { + "short_name": "ListSecretVersions", + "full_name": "google.cloud.secrets.v1beta1.SecretManagerService.ListSecretVersions", + "service": { + "short_name": "SecretManagerService", + "full_name": "google.cloud.secrets.v1beta1.SecretManagerService" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 50, + "type": "FULL" + } + ] + }, + { + "region_tag": "secretmanager_v1beta1_generated_SecretManagerService_GetSecretVersion_sync", + "title": "Snippet for the get_secret_version call in the SecretManagerService service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::SecretManager::V1beta1::SecretManagerService::Client#get_secret_version.", + "file": "secret_manager_service/get_secret_version.rb", + "language": "RUBY", + "client_method": { + "short_name": "get_secret_version", + "full_name": "::Google::Cloud::SecretManager::V1beta1::SecretManagerService::Client#get_secret_version", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::SecretManager::V1beta1::GetSecretVersionRequest", + "name": "request" + } + ], + "result_type": "::Google::Cloud::SecretManager::V1beta1::SecretVersion", + "client": { + "short_name": "SecretManagerService::Client", + "full_name": "::Google::Cloud::SecretManager::V1beta1::SecretManagerService::Client" + }, + "method": { + "short_name": "GetSecretVersion", + "full_name": "google.cloud.secrets.v1beta1.SecretManagerService.GetSecretVersion", + "service": { + "short_name": "SecretManagerService", + "full_name": "google.cloud.secrets.v1beta1.SecretManagerService" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 46, + "type": "FULL" + } + ] + }, + { + "region_tag": "secretmanager_v1beta1_generated_SecretManagerService_AccessSecretVersion_sync", + "title": "Snippet for the access_secret_version call in the SecretManagerService service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::SecretManager::V1beta1::SecretManagerService::Client#access_secret_version.", + "file": "secret_manager_service/access_secret_version.rb", + "language": "RUBY", + "client_method": { + "short_name": "access_secret_version", + "full_name": "::Google::Cloud::SecretManager::V1beta1::SecretManagerService::Client#access_secret_version", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::SecretManager::V1beta1::AccessSecretVersionRequest", + "name": "request" + } + ], + "result_type": "::Google::Cloud::SecretManager::V1beta1::AccessSecretVersionResponse", + "client": { + "short_name": "SecretManagerService::Client", + "full_name": "::Google::Cloud::SecretManager::V1beta1::SecretManagerService::Client" + }, + "method": { + "short_name": "AccessSecretVersion", + "full_name": "google.cloud.secrets.v1beta1.SecretManagerService.AccessSecretVersion", + "service": { + "short_name": "SecretManagerService", + "full_name": "google.cloud.secrets.v1beta1.SecretManagerService" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 46, + "type": "FULL" + } + ] + }, + { + "region_tag": "secretmanager_v1beta1_generated_SecretManagerService_DisableSecretVersion_sync", + "title": "Snippet for the disable_secret_version call in the SecretManagerService service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::SecretManager::V1beta1::SecretManagerService::Client#disable_secret_version.", + "file": "secret_manager_service/disable_secret_version.rb", + "language": "RUBY", + "client_method": { + "short_name": "disable_secret_version", + "full_name": "::Google::Cloud::SecretManager::V1beta1::SecretManagerService::Client#disable_secret_version", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::SecretManager::V1beta1::DisableSecretVersionRequest", + "name": "request" + } + ], + "result_type": "::Google::Cloud::SecretManager::V1beta1::SecretVersion", + "client": { + "short_name": "SecretManagerService::Client", + "full_name": "::Google::Cloud::SecretManager::V1beta1::SecretManagerService::Client" + }, + "method": { + "short_name": "DisableSecretVersion", + "full_name": "google.cloud.secrets.v1beta1.SecretManagerService.DisableSecretVersion", + "service": { + "short_name": "SecretManagerService", + "full_name": "google.cloud.secrets.v1beta1.SecretManagerService" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 46, + "type": "FULL" + } + ] + }, + { + "region_tag": "secretmanager_v1beta1_generated_SecretManagerService_EnableSecretVersion_sync", + "title": "Snippet for the enable_secret_version call in the SecretManagerService service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::SecretManager::V1beta1::SecretManagerService::Client#enable_secret_version.", + "file": "secret_manager_service/enable_secret_version.rb", + "language": "RUBY", + "client_method": { + "short_name": "enable_secret_version", + "full_name": "::Google::Cloud::SecretManager::V1beta1::SecretManagerService::Client#enable_secret_version", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::SecretManager::V1beta1::EnableSecretVersionRequest", + "name": "request" + } + ], + "result_type": "::Google::Cloud::SecretManager::V1beta1::SecretVersion", + "client": { + "short_name": "SecretManagerService::Client", + "full_name": "::Google::Cloud::SecretManager::V1beta1::SecretManagerService::Client" + }, + "method": { + "short_name": "EnableSecretVersion", + "full_name": "google.cloud.secrets.v1beta1.SecretManagerService.EnableSecretVersion", + "service": { + "short_name": "SecretManagerService", + "full_name": "google.cloud.secrets.v1beta1.SecretManagerService" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 46, + "type": "FULL" + } + ] + }, + { + "region_tag": "secretmanager_v1beta1_generated_SecretManagerService_DestroySecretVersion_sync", + "title": "Snippet for the destroy_secret_version call in the SecretManagerService service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::SecretManager::V1beta1::SecretManagerService::Client#destroy_secret_version.", + "file": "secret_manager_service/destroy_secret_version.rb", + "language": "RUBY", + "client_method": { + "short_name": "destroy_secret_version", + "full_name": "::Google::Cloud::SecretManager::V1beta1::SecretManagerService::Client#destroy_secret_version", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::SecretManager::V1beta1::DestroySecretVersionRequest", + "name": "request" + } + ], + "result_type": "::Google::Cloud::SecretManager::V1beta1::SecretVersion", + "client": { + "short_name": "SecretManagerService::Client", + "full_name": "::Google::Cloud::SecretManager::V1beta1::SecretManagerService::Client" + }, + "method": { + "short_name": "DestroySecretVersion", + "full_name": "google.cloud.secrets.v1beta1.SecretManagerService.DestroySecretVersion", + "service": { + "short_name": "SecretManagerService", + "full_name": "google.cloud.secrets.v1beta1.SecretManagerService" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 46, + "type": "FULL" + } + ] + }, + { + "region_tag": "secretmanager_v1beta1_generated_SecretManagerService_SetIamPolicy_sync", + "title": "Snippet for the set_iam_policy call in the SecretManagerService service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::SecretManager::V1beta1::SecretManagerService::Client#set_iam_policy.", + "file": "secret_manager_service/set_iam_policy.rb", + "language": "RUBY", + "client_method": { + "short_name": "set_iam_policy", + "full_name": "::Google::Cloud::SecretManager::V1beta1::SecretManagerService::Client#set_iam_policy", + "async": false, + "parameters": [ + { + "type": "::Google::Iam::V1::SetIamPolicyRequest", + "name": "request" + } + ], + "result_type": "::Google::Iam::V1::Policy", + "client": { + "short_name": "SecretManagerService::Client", + "full_name": "::Google::Cloud::SecretManager::V1beta1::SecretManagerService::Client" + }, + "method": { + "short_name": "SetIamPolicy", + "full_name": "google.cloud.secrets.v1beta1.SecretManagerService.SetIamPolicy", + "service": { + "short_name": "SecretManagerService", + "full_name": "google.cloud.secrets.v1beta1.SecretManagerService" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 46, + "type": "FULL" + } + ] + }, + { + "region_tag": "secretmanager_v1beta1_generated_SecretManagerService_GetIamPolicy_sync", + "title": "Snippet for the get_iam_policy call in the SecretManagerService service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::SecretManager::V1beta1::SecretManagerService::Client#get_iam_policy.", + "file": "secret_manager_service/get_iam_policy.rb", + "language": "RUBY", + "client_method": { + "short_name": "get_iam_policy", + "full_name": "::Google::Cloud::SecretManager::V1beta1::SecretManagerService::Client#get_iam_policy", + "async": false, + "parameters": [ + { + "type": "::Google::Iam::V1::GetIamPolicyRequest", + "name": "request" + } + ], + "result_type": "::Google::Iam::V1::Policy", + "client": { + "short_name": "SecretManagerService::Client", + "full_name": "::Google::Cloud::SecretManager::V1beta1::SecretManagerService::Client" + }, + "method": { + "short_name": "GetIamPolicy", + "full_name": "google.cloud.secrets.v1beta1.SecretManagerService.GetIamPolicy", + "service": { + "short_name": "SecretManagerService", + "full_name": "google.cloud.secrets.v1beta1.SecretManagerService" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 46, + "type": "FULL" + } + ] + }, + { + "region_tag": "secretmanager_v1beta1_generated_SecretManagerService_TestIamPermissions_sync", + "title": "Snippet for the test_iam_permissions call in the SecretManagerService service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::SecretManager::V1beta1::SecretManagerService::Client#test_iam_permissions.", + "file": "secret_manager_service/test_iam_permissions.rb", + "language": "RUBY", + "client_method": { + "short_name": "test_iam_permissions", + "full_name": "::Google::Cloud::SecretManager::V1beta1::SecretManagerService::Client#test_iam_permissions", + "async": false, + "parameters": [ + { + "type": "::Google::Iam::V1::TestIamPermissionsRequest", + "name": "request" + } + ], + "result_type": "::Google::Iam::V1::TestIamPermissionsResponse", + "client": { + "short_name": "SecretManagerService::Client", + "full_name": "::Google::Cloud::SecretManager::V1beta1::SecretManagerService::Client" + }, + "method": { + "short_name": "TestIamPermissions", + "full_name": "google.cloud.secrets.v1beta1.SecretManagerService.TestIamPermissions", + "service": { + "short_name": "SecretManagerService", + "full_name": "google.cloud.secrets.v1beta1.SecretManagerService" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 46, + "type": "FULL" + } + ] + } + ] +} \ No newline at end of file diff --git a/owl-bot-staging/google-cloud-secret_manager-v1beta1/test/google/cloud/secret_manager/v1beta1/secret_manager_service_paths_test.rb b/owl-bot-staging/google-cloud-secret_manager-v1beta1/test/google/cloud/secret_manager/v1beta1/secret_manager_service_paths_test.rb new file mode 100644 index 000000000000..8b03d0133770 --- /dev/null +++ b/owl-bot-staging/google-cloud-secret_manager-v1beta1/test/google/cloud/secret_manager/v1beta1/secret_manager_service_paths_test.rb @@ -0,0 +1,79 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +require "helper" + +require "gapic/grpc/service_stub" + +require "google/cloud/secret_manager/v1beta1/secret_manager_service" + +class ::Google::Cloud::SecretManager::V1beta1::SecretManagerService::ClientPathsTest < Minitest::Test + class DummyStub + def endpoint + "endpoint.example.com" + end + + def universe_domain + "example.com" + end + + def stub_logger + nil + end + + def logger + nil + end + end + + def test_project_path + grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + ::Gapic::ServiceStub.stub :new, DummyStub.new do + client = ::Google::Cloud::SecretManager::V1beta1::SecretManagerService::Client.new do |config| + config.credentials = grpc_channel + end + + path = client.project_path project: "value0" + assert_equal "projects/value0", path + end + end + + def test_secret_path + grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + ::Gapic::ServiceStub.stub :new, DummyStub.new do + client = ::Google::Cloud::SecretManager::V1beta1::SecretManagerService::Client.new do |config| + config.credentials = grpc_channel + end + + path = client.secret_path project: "value0", secret: "value1" + assert_equal "projects/value0/secrets/value1", path + end + end + + def test_secret_version_path + grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + ::Gapic::ServiceStub.stub :new, DummyStub.new do + client = ::Google::Cloud::SecretManager::V1beta1::SecretManagerService::Client.new do |config| + config.credentials = grpc_channel + end + + path = client.secret_version_path project: "value0", secret: "value1", secret_version: "value2" + assert_equal "projects/value0/secrets/value1/versions/value2", path + end + end +end diff --git a/owl-bot-staging/google-cloud-secret_manager-v1beta1/test/google/cloud/secret_manager/v1beta1/secret_manager_service_rest_test.rb b/owl-bot-staging/google-cloud-secret_manager-v1beta1/test/google/cloud/secret_manager/v1beta1/secret_manager_service_rest_test.rb new file mode 100644 index 000000000000..ec39c96e4e46 --- /dev/null +++ b/owl-bot-staging/google-cloud-secret_manager-v1beta1/test/google/cloud/secret_manager/v1beta1/secret_manager_service_rest_test.rb @@ -0,0 +1,921 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +require "helper" +require "gapic/rest" +require "google/cloud/secrets/v1beta1/service_pb" +require "google/cloud/secret_manager/v1beta1/secret_manager_service/rest" + + +class ::Google::Cloud::SecretManager::V1beta1::SecretManagerService::Rest::ClientTest < Minitest::Test + class ClientStub + attr_accessor :call_count, :requests + + def initialize response, &block + @response = response + @block = block + @call_count = 0 + @requests = [] + end + + def make_get_request uri:, params: {}, options: {}, method_name: nil + make_http_request :get, uri: uri, body: nil, params: params, options: options, method_name: method_name + end + + def make_delete_request uri:, params: {}, options: {}, method_name: nil + make_http_request :delete, uri: uri, body: nil, params: params, options: options, method_name: method_name + end + + def make_post_request uri:, body: nil, params: {}, options: {}, method_name: nil + make_http_request :post, uri: uri, body: body, params: params, options: options, method_name: method_name + end + + def make_patch_request uri:, body:, params: {}, options: {}, method_name: nil + make_http_request :patch, uri: uri, body: body, params: params, options: options, method_name: method_name + end + + def make_put_request uri:, body:, params: {}, options: {}, method_name: nil + make_http_request :put, uri: uri, body: body, params: params, options: options, method_name: method_name + end + + def make_http_request *args, **kwargs + @call_count += 1 + + @requests << @block&.call(*args, **kwargs) + + @response + end + + def endpoint + "endpoint.example.com" + end + + def universe_domain + "example.com" + end + + def stub_logger + nil + end + + def logger + nil + end + end + + def test_list_secrets + # Create test objects. + client_result = ::Google::Cloud::SecretManager::V1beta1::ListSecretsResponse.new + http_response = OpenStruct.new body: client_result.to_json + + call_options = {} + + # Create request parameters for a unary method. + parent = "hello world" + page_size = 42 + page_token = "hello world" + + list_secrets_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| + assert options.metadata.key? :"x-goog-api-client" + assert options.metadata[:"x-goog-api-client"].include? "rest" + refute options.metadata[:"x-goog-api-client"].include? "grpc" + end + + ::Google::Cloud::SecretManager::V1beta1::SecretManagerService::Rest::ServiceStub.stub :transcode_list_secrets_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, list_secrets_client_stub do + # Create client + client = ::Google::Cloud::SecretManager::V1beta1::SecretManagerService::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.list_secrets({ 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_secrets 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_secrets ::Google::Cloud::SecretManager::V1beta1::ListSecretsRequest.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_secrets({ 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_secrets(::Google::Cloud::SecretManager::V1beta1::ListSecretsRequest.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_secrets_client_stub.call_count + end + end + end + + def test_create_secret + # Create test objects. + client_result = ::Google::Cloud::SecretManager::V1beta1::Secret.new + http_response = OpenStruct.new body: client_result.to_json + + call_options = {} + + # Create request parameters for a unary method. + parent = "hello world" + secret_id = "hello world" + secret = {} + + create_secret_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| + assert options.metadata.key? :"x-goog-api-client" + assert options.metadata[:"x-goog-api-client"].include? "rest" + refute options.metadata[:"x-goog-api-client"].include? "grpc" + end + + ::Google::Cloud::SecretManager::V1beta1::SecretManagerService::Rest::ServiceStub.stub :transcode_create_secret_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, create_secret_client_stub do + # Create client + client = ::Google::Cloud::SecretManager::V1beta1::SecretManagerService::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.create_secret({ parent: parent, secret_id: secret_id, secret: secret }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.create_secret parent: parent, secret_id: secret_id, secret: secret do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.create_secret ::Google::Cloud::SecretManager::V1beta1::CreateSecretRequest.new(parent: parent, secret_id: secret_id, secret: secret) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + client.create_secret({ parent: parent, secret_id: secret_id, secret: secret }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + client.create_secret(::Google::Cloud::SecretManager::V1beta1::CreateSecretRequest.new(parent: parent, secret_id: secret_id, secret: secret), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, create_secret_client_stub.call_count + end + end + end + + def test_add_secret_version + # Create test objects. + client_result = ::Google::Cloud::SecretManager::V1beta1::SecretVersion.new + http_response = OpenStruct.new body: client_result.to_json + + call_options = {} + + # Create request parameters for a unary method. + parent = "hello world" + payload = {} + + add_secret_version_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| + assert options.metadata.key? :"x-goog-api-client" + assert options.metadata[:"x-goog-api-client"].include? "rest" + refute options.metadata[:"x-goog-api-client"].include? "grpc" + end + + ::Google::Cloud::SecretManager::V1beta1::SecretManagerService::Rest::ServiceStub.stub :transcode_add_secret_version_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, add_secret_version_client_stub do + # Create client + client = ::Google::Cloud::SecretManager::V1beta1::SecretManagerService::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.add_secret_version({ parent: parent, payload: payload }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.add_secret_version parent: parent, payload: payload do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.add_secret_version ::Google::Cloud::SecretManager::V1beta1::AddSecretVersionRequest.new(parent: parent, payload: payload) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + client.add_secret_version({ parent: parent, payload: payload }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + client.add_secret_version(::Google::Cloud::SecretManager::V1beta1::AddSecretVersionRequest.new(parent: parent, payload: payload), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, add_secret_version_client_stub.call_count + end + end + end + + def test_get_secret + # Create test objects. + client_result = ::Google::Cloud::SecretManager::V1beta1::Secret.new + http_response = OpenStruct.new body: client_result.to_json + + call_options = {} + + # Create request parameters for a unary method. + name = "hello world" + + get_secret_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| + assert options.metadata.key? :"x-goog-api-client" + assert options.metadata[:"x-goog-api-client"].include? "rest" + refute options.metadata[:"x-goog-api-client"].include? "grpc" + end + + ::Google::Cloud::SecretManager::V1beta1::SecretManagerService::Rest::ServiceStub.stub :transcode_get_secret_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, get_secret_client_stub do + # Create client + client = ::Google::Cloud::SecretManager::V1beta1::SecretManagerService::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.get_secret({ name: name }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.get_secret name: name do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.get_secret ::Google::Cloud::SecretManager::V1beta1::GetSecretRequest.new(name: name) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + client.get_secret({ name: name }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + client.get_secret(::Google::Cloud::SecretManager::V1beta1::GetSecretRequest.new(name: name), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, get_secret_client_stub.call_count + end + end + end + + def test_update_secret + # Create test objects. + client_result = ::Google::Cloud::SecretManager::V1beta1::Secret.new + http_response = OpenStruct.new body: client_result.to_json + + call_options = {} + + # Create request parameters for a unary method. + secret = {} + update_mask = {} + + update_secret_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| + assert options.metadata.key? :"x-goog-api-client" + assert options.metadata[:"x-goog-api-client"].include? "rest" + refute options.metadata[:"x-goog-api-client"].include? "grpc" + end + + ::Google::Cloud::SecretManager::V1beta1::SecretManagerService::Rest::ServiceStub.stub :transcode_update_secret_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, update_secret_client_stub do + # Create client + client = ::Google::Cloud::SecretManager::V1beta1::SecretManagerService::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.update_secret({ secret: secret, update_mask: update_mask }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.update_secret secret: secret, update_mask: update_mask do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.update_secret ::Google::Cloud::SecretManager::V1beta1::UpdateSecretRequest.new(secret: secret, update_mask: update_mask) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + client.update_secret({ secret: secret, update_mask: update_mask }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + client.update_secret(::Google::Cloud::SecretManager::V1beta1::UpdateSecretRequest.new(secret: secret, update_mask: update_mask), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, update_secret_client_stub.call_count + end + end + end + + def test_delete_secret + # Create test objects. + client_result = ::Google::Protobuf::Empty.new + http_response = OpenStruct.new body: client_result.to_json + + call_options = {} + + # Create request parameters for a unary method. + name = "hello world" + + delete_secret_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| + assert options.metadata.key? :"x-goog-api-client" + assert options.metadata[:"x-goog-api-client"].include? "rest" + refute options.metadata[:"x-goog-api-client"].include? "grpc" + end + + ::Google::Cloud::SecretManager::V1beta1::SecretManagerService::Rest::ServiceStub.stub :transcode_delete_secret_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, delete_secret_client_stub do + # Create client + client = ::Google::Cloud::SecretManager::V1beta1::SecretManagerService::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.delete_secret({ name: name }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.delete_secret name: name do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.delete_secret ::Google::Cloud::SecretManager::V1beta1::DeleteSecretRequest.new(name: name) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + client.delete_secret({ name: name }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + client.delete_secret(::Google::Cloud::SecretManager::V1beta1::DeleteSecretRequest.new(name: name), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, delete_secret_client_stub.call_count + end + end + end + + def test_list_secret_versions + # Create test objects. + client_result = ::Google::Cloud::SecretManager::V1beta1::ListSecretVersionsResponse.new + http_response = OpenStruct.new body: client_result.to_json + + call_options = {} + + # Create request parameters for a unary method. + parent = "hello world" + page_size = 42 + page_token = "hello world" + + list_secret_versions_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| + assert options.metadata.key? :"x-goog-api-client" + assert options.metadata[:"x-goog-api-client"].include? "rest" + refute options.metadata[:"x-goog-api-client"].include? "grpc" + end + + ::Google::Cloud::SecretManager::V1beta1::SecretManagerService::Rest::ServiceStub.stub :transcode_list_secret_versions_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, list_secret_versions_client_stub do + # Create client + client = ::Google::Cloud::SecretManager::V1beta1::SecretManagerService::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.list_secret_versions({ 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_secret_versions 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_secret_versions ::Google::Cloud::SecretManager::V1beta1::ListSecretVersionsRequest.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_secret_versions({ 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_secret_versions(::Google::Cloud::SecretManager::V1beta1::ListSecretVersionsRequest.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_secret_versions_client_stub.call_count + end + end + end + + def test_get_secret_version + # Create test objects. + client_result = ::Google::Cloud::SecretManager::V1beta1::SecretVersion.new + http_response = OpenStruct.new body: client_result.to_json + + call_options = {} + + # Create request parameters for a unary method. + name = "hello world" + + get_secret_version_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| + assert options.metadata.key? :"x-goog-api-client" + assert options.metadata[:"x-goog-api-client"].include? "rest" + refute options.metadata[:"x-goog-api-client"].include? "grpc" + end + + ::Google::Cloud::SecretManager::V1beta1::SecretManagerService::Rest::ServiceStub.stub :transcode_get_secret_version_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, get_secret_version_client_stub do + # Create client + client = ::Google::Cloud::SecretManager::V1beta1::SecretManagerService::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.get_secret_version({ name: name }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.get_secret_version name: name do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.get_secret_version ::Google::Cloud::SecretManager::V1beta1::GetSecretVersionRequest.new(name: name) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + client.get_secret_version({ name: name }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + client.get_secret_version(::Google::Cloud::SecretManager::V1beta1::GetSecretVersionRequest.new(name: name), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, get_secret_version_client_stub.call_count + end + end + end + + def test_access_secret_version + # Create test objects. + client_result = ::Google::Cloud::SecretManager::V1beta1::AccessSecretVersionResponse.new + http_response = OpenStruct.new body: client_result.to_json + + call_options = {} + + # Create request parameters for a unary method. + name = "hello world" + + access_secret_version_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| + assert options.metadata.key? :"x-goog-api-client" + assert options.metadata[:"x-goog-api-client"].include? "rest" + refute options.metadata[:"x-goog-api-client"].include? "grpc" + end + + ::Google::Cloud::SecretManager::V1beta1::SecretManagerService::Rest::ServiceStub.stub :transcode_access_secret_version_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, access_secret_version_client_stub do + # Create client + client = ::Google::Cloud::SecretManager::V1beta1::SecretManagerService::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.access_secret_version({ name: name }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.access_secret_version name: name do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.access_secret_version ::Google::Cloud::SecretManager::V1beta1::AccessSecretVersionRequest.new(name: name) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + client.access_secret_version({ name: name }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + client.access_secret_version(::Google::Cloud::SecretManager::V1beta1::AccessSecretVersionRequest.new(name: name), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, access_secret_version_client_stub.call_count + end + end + end + + def test_disable_secret_version + # Create test objects. + client_result = ::Google::Cloud::SecretManager::V1beta1::SecretVersion.new + http_response = OpenStruct.new body: client_result.to_json + + call_options = {} + + # Create request parameters for a unary method. + name = "hello world" + + disable_secret_version_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| + assert options.metadata.key? :"x-goog-api-client" + assert options.metadata[:"x-goog-api-client"].include? "rest" + refute options.metadata[:"x-goog-api-client"].include? "grpc" + end + + ::Google::Cloud::SecretManager::V1beta1::SecretManagerService::Rest::ServiceStub.stub :transcode_disable_secret_version_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, disable_secret_version_client_stub do + # Create client + client = ::Google::Cloud::SecretManager::V1beta1::SecretManagerService::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.disable_secret_version({ name: name }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.disable_secret_version name: name do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.disable_secret_version ::Google::Cloud::SecretManager::V1beta1::DisableSecretVersionRequest.new(name: name) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + client.disable_secret_version({ name: name }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + client.disable_secret_version(::Google::Cloud::SecretManager::V1beta1::DisableSecretVersionRequest.new(name: name), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, disable_secret_version_client_stub.call_count + end + end + end + + def test_enable_secret_version + # Create test objects. + client_result = ::Google::Cloud::SecretManager::V1beta1::SecretVersion.new + http_response = OpenStruct.new body: client_result.to_json + + call_options = {} + + # Create request parameters for a unary method. + name = "hello world" + + enable_secret_version_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| + assert options.metadata.key? :"x-goog-api-client" + assert options.metadata[:"x-goog-api-client"].include? "rest" + refute options.metadata[:"x-goog-api-client"].include? "grpc" + end + + ::Google::Cloud::SecretManager::V1beta1::SecretManagerService::Rest::ServiceStub.stub :transcode_enable_secret_version_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, enable_secret_version_client_stub do + # Create client + client = ::Google::Cloud::SecretManager::V1beta1::SecretManagerService::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.enable_secret_version({ name: name }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.enable_secret_version name: name do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.enable_secret_version ::Google::Cloud::SecretManager::V1beta1::EnableSecretVersionRequest.new(name: name) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + client.enable_secret_version({ name: name }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + client.enable_secret_version(::Google::Cloud::SecretManager::V1beta1::EnableSecretVersionRequest.new(name: name), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, enable_secret_version_client_stub.call_count + end + end + end + + def test_destroy_secret_version + # Create test objects. + client_result = ::Google::Cloud::SecretManager::V1beta1::SecretVersion.new + http_response = OpenStruct.new body: client_result.to_json + + call_options = {} + + # Create request parameters for a unary method. + name = "hello world" + + destroy_secret_version_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| + assert options.metadata.key? :"x-goog-api-client" + assert options.metadata[:"x-goog-api-client"].include? "rest" + refute options.metadata[:"x-goog-api-client"].include? "grpc" + end + + ::Google::Cloud::SecretManager::V1beta1::SecretManagerService::Rest::ServiceStub.stub :transcode_destroy_secret_version_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, destroy_secret_version_client_stub do + # Create client + client = ::Google::Cloud::SecretManager::V1beta1::SecretManagerService::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.destroy_secret_version({ name: name }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.destroy_secret_version name: name do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.destroy_secret_version ::Google::Cloud::SecretManager::V1beta1::DestroySecretVersionRequest.new(name: name) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + client.destroy_secret_version({ name: name }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + client.destroy_secret_version(::Google::Cloud::SecretManager::V1beta1::DestroySecretVersionRequest.new(name: name), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, destroy_secret_version_client_stub.call_count + end + end + end + + def test_set_iam_policy + # Create test objects. + client_result = ::Google::Iam::V1::Policy.new + http_response = OpenStruct.new body: client_result.to_json + + call_options = {} + + # Create request parameters for a unary method. + resource = "hello world" + policy = {} + update_mask = {} + + set_iam_policy_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| + assert options.metadata.key? :"x-goog-api-client" + assert options.metadata[:"x-goog-api-client"].include? "rest" + refute options.metadata[:"x-goog-api-client"].include? "grpc" + end + + ::Google::Cloud::SecretManager::V1beta1::SecretManagerService::Rest::ServiceStub.stub :transcode_set_iam_policy_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, set_iam_policy_client_stub do + # Create client + client = ::Google::Cloud::SecretManager::V1beta1::SecretManagerService::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.set_iam_policy({ resource: resource, policy: policy, update_mask: update_mask }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.set_iam_policy resource: resource, policy: policy, update_mask: update_mask do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.set_iam_policy ::Google::Iam::V1::SetIamPolicyRequest.new(resource: resource, policy: policy, update_mask: update_mask) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + client.set_iam_policy({ resource: resource, policy: policy, update_mask: update_mask }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + client.set_iam_policy(::Google::Iam::V1::SetIamPolicyRequest.new(resource: resource, policy: policy, update_mask: update_mask), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, set_iam_policy_client_stub.call_count + end + end + end + + def test_get_iam_policy + # Create test objects. + client_result = ::Google::Iam::V1::Policy.new + http_response = OpenStruct.new body: client_result.to_json + + call_options = {} + + # Create request parameters for a unary method. + resource = "hello world" + options = {} + + get_iam_policy_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| + assert options.metadata.key? :"x-goog-api-client" + assert options.metadata[:"x-goog-api-client"].include? "rest" + refute options.metadata[:"x-goog-api-client"].include? "grpc" + end + + ::Google::Cloud::SecretManager::V1beta1::SecretManagerService::Rest::ServiceStub.stub :transcode_get_iam_policy_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, get_iam_policy_client_stub do + # Create client + client = ::Google::Cloud::SecretManager::V1beta1::SecretManagerService::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.get_iam_policy({ resource: resource, options: options }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.get_iam_policy resource: resource, options: options do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.get_iam_policy ::Google::Iam::V1::GetIamPolicyRequest.new(resource: resource, options: options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + client.get_iam_policy({ resource: resource, options: options }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + client.get_iam_policy(::Google::Iam::V1::GetIamPolicyRequest.new(resource: resource, options: options), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, get_iam_policy_client_stub.call_count + end + end + end + + def test_test_iam_permissions + # Create test objects. + client_result = ::Google::Iam::V1::TestIamPermissionsResponse.new + http_response = OpenStruct.new body: client_result.to_json + + call_options = {} + + # Create request parameters for a unary method. + resource = "hello world" + permissions = ["hello world"] + + test_iam_permissions_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| + assert options.metadata.key? :"x-goog-api-client" + assert options.metadata[:"x-goog-api-client"].include? "rest" + refute options.metadata[:"x-goog-api-client"].include? "grpc" + end + + ::Google::Cloud::SecretManager::V1beta1::SecretManagerService::Rest::ServiceStub.stub :transcode_test_iam_permissions_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, test_iam_permissions_client_stub do + # Create client + client = ::Google::Cloud::SecretManager::V1beta1::SecretManagerService::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.test_iam_permissions({ resource: resource, permissions: permissions }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.test_iam_permissions resource: resource, permissions: permissions do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.test_iam_permissions ::Google::Iam::V1::TestIamPermissionsRequest.new(resource: resource, permissions: permissions) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + client.test_iam_permissions({ resource: resource, permissions: permissions }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + client.test_iam_permissions(::Google::Iam::V1::TestIamPermissionsRequest.new(resource: resource, permissions: permissions), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, test_iam_permissions_client_stub.call_count + end + end + end + + def test_configure + credentials_token = :dummy_value + + client = block_config = config = nil + dummy_stub = ClientStub.new nil + Gapic::Rest::ClientStub.stub :new, dummy_stub do + client = ::Google::Cloud::SecretManager::V1beta1::SecretManagerService::Rest::Client.new do |config| + config.credentials = credentials_token + end + end + + config = client.configure do |c| + block_config = c + end + + assert_same block_config, config + assert_kind_of ::Google::Cloud::SecretManager::V1beta1::SecretManagerService::Rest::Client::Configuration, config + end +end diff --git a/owl-bot-staging/google-cloud-secret_manager-v1beta1/test/google/cloud/secret_manager/v1beta1/secret_manager_service_test.rb b/owl-bot-staging/google-cloud-secret_manager-v1beta1/test/google/cloud/secret_manager/v1beta1/secret_manager_service_test.rb new file mode 100644 index 000000000000..79c7c3611d7b --- /dev/null +++ b/owl-bot-staging/google-cloud-secret_manager-v1beta1/test/google/cloud/secret_manager/v1beta1/secret_manager_service_test.rb @@ -0,0 +1,1008 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +require "helper" + +require "gapic/grpc/service_stub" + +require "google/cloud/secrets/v1beta1/service_pb" +require "google/cloud/secret_manager/v1beta1/secret_manager_service" + +class ::Google::Cloud::SecretManager::V1beta1::SecretManagerService::ClientTest < Minitest::Test + class ClientStub + attr_accessor :call_rpc_count, :requests + + def initialize response, operation, &block + @response = response + @operation = operation + @block = block + @call_rpc_count = 0 + @requests = [] + end + + def call_rpc *args, **kwargs + @call_rpc_count += 1 + + @requests << @block&.call(*args, **kwargs) + + catch :response do + yield @response, @operation if block_given? + @response + end + end + + def endpoint + "endpoint.example.com" + end + + def universe_domain + "example.com" + end + + def stub_logger + nil + end + + def logger + nil + end + end + + def test_list_secrets + # Create GRPC objects. + grpc_response = ::Google::Cloud::SecretManager::V1beta1::ListSecretsResponse.new + grpc_operation = GRPC::ActiveCall::Operation.new nil + grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + grpc_options = {} + + # Create request parameters for a unary method. + parent = "hello world" + page_size = 42 + page_token = "hello world" + + list_secrets_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :list_secrets, name + assert_kind_of ::Google::Cloud::SecretManager::V1beta1::ListSecretsRequest, 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_secrets_client_stub do + # Create client + client = ::Google::Cloud::SecretManager::V1beta1::SecretManagerService::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.list_secrets({ 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_secrets 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_secrets ::Google::Cloud::SecretManager::V1beta1::ListSecretsRequest.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_secrets({ 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_secrets(::Google::Cloud::SecretManager::V1beta1::ListSecretsRequest.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_secrets_client_stub.call_rpc_count + end + end + + def test_create_secret + # Create GRPC objects. + grpc_response = ::Google::Cloud::SecretManager::V1beta1::Secret.new + grpc_operation = GRPC::ActiveCall::Operation.new nil + grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + grpc_options = {} + + # Create request parameters for a unary method. + parent = "hello world" + secret_id = "hello world" + secret = {} + + create_secret_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :create_secret, name + assert_kind_of ::Google::Cloud::SecretManager::V1beta1::CreateSecretRequest, request + assert_equal "hello world", request["parent"] + assert_equal "hello world", request["secret_id"] + assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::SecretManager::V1beta1::Secret), request["secret"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, create_secret_client_stub do + # Create client + client = ::Google::Cloud::SecretManager::V1beta1::SecretManagerService::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.create_secret({ parent: parent, secret_id: secret_id, secret: secret }) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use named arguments + client.create_secret parent: parent, secret_id: secret_id, secret: secret do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.create_secret ::Google::Cloud::SecretManager::V1beta1::CreateSecretRequest.new(parent: parent, secret_id: secret_id, secret: secret) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use hash object with options + client.create_secret({ parent: parent, secret_id: secret_id, secret: secret }, grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object with options + client.create_secret(::Google::Cloud::SecretManager::V1beta1::CreateSecretRequest.new(parent: parent, secret_id: secret_id, secret: secret), grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Verify method calls + assert_equal 5, create_secret_client_stub.call_rpc_count + end + end + + def test_add_secret_version + # Create GRPC objects. + grpc_response = ::Google::Cloud::SecretManager::V1beta1::SecretVersion.new + grpc_operation = GRPC::ActiveCall::Operation.new nil + grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + grpc_options = {} + + # Create request parameters for a unary method. + parent = "hello world" + payload = {} + + add_secret_version_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :add_secret_version, name + assert_kind_of ::Google::Cloud::SecretManager::V1beta1::AddSecretVersionRequest, request + assert_equal "hello world", request["parent"] + assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::SecretManager::V1beta1::SecretPayload), request["payload"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, add_secret_version_client_stub do + # Create client + client = ::Google::Cloud::SecretManager::V1beta1::SecretManagerService::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.add_secret_version({ parent: parent, payload: payload }) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use named arguments + client.add_secret_version parent: parent, payload: payload do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.add_secret_version ::Google::Cloud::SecretManager::V1beta1::AddSecretVersionRequest.new(parent: parent, payload: payload) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use hash object with options + client.add_secret_version({ parent: parent, payload: payload }, grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object with options + client.add_secret_version(::Google::Cloud::SecretManager::V1beta1::AddSecretVersionRequest.new(parent: parent, payload: payload), grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Verify method calls + assert_equal 5, add_secret_version_client_stub.call_rpc_count + end + end + + def test_get_secret + # Create GRPC objects. + grpc_response = ::Google::Cloud::SecretManager::V1beta1::Secret.new + grpc_operation = GRPC::ActiveCall::Operation.new nil + grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + grpc_options = {} + + # Create request parameters for a unary method. + name = "hello world" + + get_secret_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :get_secret, name + assert_kind_of ::Google::Cloud::SecretManager::V1beta1::GetSecretRequest, request + assert_equal "hello world", request["name"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, get_secret_client_stub do + # Create client + client = ::Google::Cloud::SecretManager::V1beta1::SecretManagerService::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.get_secret({ name: name }) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use named arguments + client.get_secret name: name do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.get_secret ::Google::Cloud::SecretManager::V1beta1::GetSecretRequest.new(name: name) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use hash object with options + client.get_secret({ name: name }, grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object with options + client.get_secret(::Google::Cloud::SecretManager::V1beta1::GetSecretRequest.new(name: name), grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Verify method calls + assert_equal 5, get_secret_client_stub.call_rpc_count + end + end + + def test_update_secret + # Create GRPC objects. + grpc_response = ::Google::Cloud::SecretManager::V1beta1::Secret.new + grpc_operation = GRPC::ActiveCall::Operation.new nil + grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + grpc_options = {} + + # Create request parameters for a unary method. + secret = {} + update_mask = {} + + update_secret_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :update_secret, name + assert_kind_of ::Google::Cloud::SecretManager::V1beta1::UpdateSecretRequest, request + assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::SecretManager::V1beta1::Secret), request["secret"] + assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Protobuf::FieldMask), request["update_mask"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, update_secret_client_stub do + # Create client + client = ::Google::Cloud::SecretManager::V1beta1::SecretManagerService::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.update_secret({ secret: secret, update_mask: update_mask }) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use named arguments + client.update_secret secret: secret, update_mask: update_mask do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.update_secret ::Google::Cloud::SecretManager::V1beta1::UpdateSecretRequest.new(secret: secret, update_mask: update_mask) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use hash object with options + client.update_secret({ secret: secret, update_mask: update_mask }, grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object with options + client.update_secret(::Google::Cloud::SecretManager::V1beta1::UpdateSecretRequest.new(secret: secret, update_mask: update_mask), grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Verify method calls + assert_equal 5, update_secret_client_stub.call_rpc_count + end + end + + def test_delete_secret + # Create GRPC objects. + grpc_response = ::Google::Protobuf::Empty.new + grpc_operation = GRPC::ActiveCall::Operation.new nil + grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + grpc_options = {} + + # Create request parameters for a unary method. + name = "hello world" + + delete_secret_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :delete_secret, name + assert_kind_of ::Google::Cloud::SecretManager::V1beta1::DeleteSecretRequest, request + assert_equal "hello world", request["name"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, delete_secret_client_stub do + # Create client + client = ::Google::Cloud::SecretManager::V1beta1::SecretManagerService::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.delete_secret({ name: name }) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use named arguments + client.delete_secret name: name do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.delete_secret ::Google::Cloud::SecretManager::V1beta1::DeleteSecretRequest.new(name: name) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use hash object with options + client.delete_secret({ 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_secret(::Google::Cloud::SecretManager::V1beta1::DeleteSecretRequest.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_secret_client_stub.call_rpc_count + end + end + + def test_list_secret_versions + # Create GRPC objects. + grpc_response = ::Google::Cloud::SecretManager::V1beta1::ListSecretVersionsResponse.new + grpc_operation = GRPC::ActiveCall::Operation.new nil + grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + grpc_options = {} + + # Create request parameters for a unary method. + parent = "hello world" + page_size = 42 + page_token = "hello world" + + list_secret_versions_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :list_secret_versions, name + assert_kind_of ::Google::Cloud::SecretManager::V1beta1::ListSecretVersionsRequest, 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_secret_versions_client_stub do + # Create client + client = ::Google::Cloud::SecretManager::V1beta1::SecretManagerService::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.list_secret_versions({ 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_secret_versions 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_secret_versions ::Google::Cloud::SecretManager::V1beta1::ListSecretVersionsRequest.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_secret_versions({ 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_secret_versions(::Google::Cloud::SecretManager::V1beta1::ListSecretVersionsRequest.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_secret_versions_client_stub.call_rpc_count + end + end + + def test_get_secret_version + # Create GRPC objects. + grpc_response = ::Google::Cloud::SecretManager::V1beta1::SecretVersion.new + grpc_operation = GRPC::ActiveCall::Operation.new nil + grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + grpc_options = {} + + # Create request parameters for a unary method. + name = "hello world" + + get_secret_version_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :get_secret_version, name + assert_kind_of ::Google::Cloud::SecretManager::V1beta1::GetSecretVersionRequest, request + assert_equal "hello world", request["name"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, get_secret_version_client_stub do + # Create client + client = ::Google::Cloud::SecretManager::V1beta1::SecretManagerService::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.get_secret_version({ name: name }) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use named arguments + client.get_secret_version name: name do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.get_secret_version ::Google::Cloud::SecretManager::V1beta1::GetSecretVersionRequest.new(name: name) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use hash object with options + client.get_secret_version({ name: name }, grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object with options + client.get_secret_version(::Google::Cloud::SecretManager::V1beta1::GetSecretVersionRequest.new(name: name), grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Verify method calls + assert_equal 5, get_secret_version_client_stub.call_rpc_count + end + end + + def test_access_secret_version + # Create GRPC objects. + grpc_response = ::Google::Cloud::SecretManager::V1beta1::AccessSecretVersionResponse.new + grpc_operation = GRPC::ActiveCall::Operation.new nil + grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + grpc_options = {} + + # Create request parameters for a unary method. + name = "hello world" + + access_secret_version_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :access_secret_version, name + assert_kind_of ::Google::Cloud::SecretManager::V1beta1::AccessSecretVersionRequest, request + assert_equal "hello world", request["name"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, access_secret_version_client_stub do + # Create client + client = ::Google::Cloud::SecretManager::V1beta1::SecretManagerService::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.access_secret_version({ name: name }) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use named arguments + client.access_secret_version name: name do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.access_secret_version ::Google::Cloud::SecretManager::V1beta1::AccessSecretVersionRequest.new(name: name) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use hash object with options + client.access_secret_version({ name: name }, grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object with options + client.access_secret_version(::Google::Cloud::SecretManager::V1beta1::AccessSecretVersionRequest.new(name: name), grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Verify method calls + assert_equal 5, access_secret_version_client_stub.call_rpc_count + end + end + + def test_disable_secret_version + # Create GRPC objects. + grpc_response = ::Google::Cloud::SecretManager::V1beta1::SecretVersion.new + grpc_operation = GRPC::ActiveCall::Operation.new nil + grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + grpc_options = {} + + # Create request parameters for a unary method. + name = "hello world" + + disable_secret_version_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :disable_secret_version, name + assert_kind_of ::Google::Cloud::SecretManager::V1beta1::DisableSecretVersionRequest, request + assert_equal "hello world", request["name"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, disable_secret_version_client_stub do + # Create client + client = ::Google::Cloud::SecretManager::V1beta1::SecretManagerService::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.disable_secret_version({ name: name }) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use named arguments + client.disable_secret_version name: name do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.disable_secret_version ::Google::Cloud::SecretManager::V1beta1::DisableSecretVersionRequest.new(name: name) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use hash object with options + client.disable_secret_version({ name: name }, grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object with options + client.disable_secret_version(::Google::Cloud::SecretManager::V1beta1::DisableSecretVersionRequest.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, disable_secret_version_client_stub.call_rpc_count + end + end + + def test_enable_secret_version + # Create GRPC objects. + grpc_response = ::Google::Cloud::SecretManager::V1beta1::SecretVersion.new + grpc_operation = GRPC::ActiveCall::Operation.new nil + grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + grpc_options = {} + + # Create request parameters for a unary method. + name = "hello world" + + enable_secret_version_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :enable_secret_version, name + assert_kind_of ::Google::Cloud::SecretManager::V1beta1::EnableSecretVersionRequest, request + assert_equal "hello world", request["name"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, enable_secret_version_client_stub do + # Create client + client = ::Google::Cloud::SecretManager::V1beta1::SecretManagerService::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.enable_secret_version({ name: name }) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use named arguments + client.enable_secret_version name: name do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.enable_secret_version ::Google::Cloud::SecretManager::V1beta1::EnableSecretVersionRequest.new(name: name) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use hash object with options + client.enable_secret_version({ name: name }, grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object with options + client.enable_secret_version(::Google::Cloud::SecretManager::V1beta1::EnableSecretVersionRequest.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, enable_secret_version_client_stub.call_rpc_count + end + end + + def test_destroy_secret_version + # Create GRPC objects. + grpc_response = ::Google::Cloud::SecretManager::V1beta1::SecretVersion.new + grpc_operation = GRPC::ActiveCall::Operation.new nil + grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + grpc_options = {} + + # Create request parameters for a unary method. + name = "hello world" + + destroy_secret_version_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :destroy_secret_version, name + assert_kind_of ::Google::Cloud::SecretManager::V1beta1::DestroySecretVersionRequest, request + assert_equal "hello world", request["name"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, destroy_secret_version_client_stub do + # Create client + client = ::Google::Cloud::SecretManager::V1beta1::SecretManagerService::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.destroy_secret_version({ name: name }) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use named arguments + client.destroy_secret_version name: name do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.destroy_secret_version ::Google::Cloud::SecretManager::V1beta1::DestroySecretVersionRequest.new(name: name) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use hash object with options + client.destroy_secret_version({ name: name }, grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object with options + client.destroy_secret_version(::Google::Cloud::SecretManager::V1beta1::DestroySecretVersionRequest.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, destroy_secret_version_client_stub.call_rpc_count + end + end + + def test_set_iam_policy + # Create GRPC objects. + grpc_response = ::Google::Iam::V1::Policy.new + grpc_operation = GRPC::ActiveCall::Operation.new nil + grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + grpc_options = {} + + # Create request parameters for a unary method. + resource = "hello world" + policy = {} + update_mask = {} + + set_iam_policy_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :set_iam_policy, name + assert_kind_of ::Google::Iam::V1::SetIamPolicyRequest, request + assert_equal "hello world", request["resource"] + assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Iam::V1::Policy), request["policy"] + assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Protobuf::FieldMask), request["update_mask"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, set_iam_policy_client_stub do + # Create client + client = ::Google::Cloud::SecretManager::V1beta1::SecretManagerService::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.set_iam_policy({ resource: resource, policy: policy, update_mask: update_mask }) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use named arguments + client.set_iam_policy resource: resource, policy: policy, update_mask: update_mask do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.set_iam_policy ::Google::Iam::V1::SetIamPolicyRequest.new(resource: resource, policy: policy, update_mask: update_mask) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use hash object with options + client.set_iam_policy({ resource: resource, policy: policy, update_mask: update_mask }, grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object with options + client.set_iam_policy(::Google::Iam::V1::SetIamPolicyRequest.new(resource: resource, policy: policy, update_mask: update_mask), grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Verify method calls + assert_equal 5, set_iam_policy_client_stub.call_rpc_count + end + end + + def test_get_iam_policy + # Create GRPC objects. + grpc_response = ::Google::Iam::V1::Policy.new + grpc_operation = GRPC::ActiveCall::Operation.new nil + grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + grpc_options = {} + + # Create request parameters for a unary method. + resource = "hello world" + options = {} + + get_iam_policy_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :get_iam_policy, name + assert_kind_of ::Google::Iam::V1::GetIamPolicyRequest, request + assert_equal "hello world", request["resource"] + assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Iam::V1::GetPolicyOptions), request["options"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, get_iam_policy_client_stub do + # Create client + client = ::Google::Cloud::SecretManager::V1beta1::SecretManagerService::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.get_iam_policy({ resource: resource, options: options }) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use named arguments + client.get_iam_policy resource: resource, options: options do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.get_iam_policy ::Google::Iam::V1::GetIamPolicyRequest.new(resource: resource, options: options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use hash object with options + client.get_iam_policy({ resource: resource, options: options }, grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object with options + client.get_iam_policy(::Google::Iam::V1::GetIamPolicyRequest.new(resource: resource, options: options), grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Verify method calls + assert_equal 5, get_iam_policy_client_stub.call_rpc_count + end + end + + def test_test_iam_permissions + # Create GRPC objects. + grpc_response = ::Google::Iam::V1::TestIamPermissionsResponse.new + grpc_operation = GRPC::ActiveCall::Operation.new nil + grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + grpc_options = {} + + # Create request parameters for a unary method. + resource = "hello world" + permissions = ["hello world"] + + test_iam_permissions_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :test_iam_permissions, name + assert_kind_of ::Google::Iam::V1::TestIamPermissionsRequest, request + assert_equal "hello world", request["resource"] + assert_equal ["hello world"], request["permissions"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, test_iam_permissions_client_stub do + # Create client + client = ::Google::Cloud::SecretManager::V1beta1::SecretManagerService::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.test_iam_permissions({ resource: resource, permissions: permissions }) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use named arguments + client.test_iam_permissions resource: resource, permissions: permissions do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.test_iam_permissions ::Google::Iam::V1::TestIamPermissionsRequest.new(resource: resource, permissions: permissions) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use hash object with options + client.test_iam_permissions({ resource: resource, permissions: permissions }, grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object with options + client.test_iam_permissions(::Google::Iam::V1::TestIamPermissionsRequest.new(resource: resource, permissions: permissions), grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Verify method calls + assert_equal 5, test_iam_permissions_client_stub.call_rpc_count + end + end + + def test_configure + grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + + client = block_config = config = nil + dummy_stub = ClientStub.new nil, nil + Gapic::ServiceStub.stub :new, dummy_stub do + client = ::Google::Cloud::SecretManager::V1beta1::SecretManagerService::Client.new do |config| + config.credentials = grpc_channel + end + end + + config = client.configure do |c| + block_config = c + end + + assert_same block_config, config + assert_kind_of ::Google::Cloud::SecretManager::V1beta1::SecretManagerService::Client::Configuration, config + end + + def test_credentials + key = OpenSSL::PKey::RSA.new 2048 + cred_json = { + "private_key" => key.to_pem, + "client_email" => "app@developer.gserviceaccount.com", + "type" => "service_account" + } + key_file = StringIO.new cred_json.to_json + creds = Google::Auth::ServiceAccountCredentials.make_creds({ json_key_io: key_file }) + + dummy_stub = ClientStub.new nil, nil + Gapic::ServiceStub.stub :new, dummy_stub do + client = ::Google::Cloud::SecretManager::V1beta1::SecretManagerService::Client.new do |config| + config.credentials = creds + end + assert_kind_of ::Google::Cloud::SecretManager::V1beta1::SecretManagerService::Client, client + assert_equal creds, client.configure.credentials + end + end +end diff --git a/owl-bot-staging/google-cloud-secret_manager-v1beta1/test/helper.rb b/owl-bot-staging/google-cloud-secret_manager-v1beta1/test/helper.rb new file mode 100644 index 000000000000..672b337030e7 --- /dev/null +++ b/owl-bot-staging/google-cloud-secret_manager-v1beta1/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" diff --git a/owl-bot-staging/google-cloud-secret_manager-v1beta2/.gitignore b/owl-bot-staging/google-cloud-secret_manager-v1beta2/.gitignore new file mode 100644 index 000000000000..0135b6bc6cfc --- /dev/null +++ b/owl-bot-staging/google-cloud-secret_manager-v1beta2/.gitignore @@ -0,0 +1,22 @@ +# Ignore bundler lockfiles +Gemfile.lock +gems.locked + +# Ignore documentation output +doc/* +.yardoc/* + +# Ignore test output +coverage/* + +# Ignore build artifacts +pkg/* + +# Ignore files commonly present in certain dev environments +.vagrant +.DS_STORE +.idea +*.iml + +# Ignore synth output +__pycache__ diff --git a/owl-bot-staging/google-cloud-secret_manager-v1beta2/.repo-metadata.json b/owl-bot-staging/google-cloud-secret_manager-v1beta2/.repo-metadata.json new file mode 100644 index 000000000000..14c52f056019 --- /dev/null +++ b/owl-bot-staging/google-cloud-secret_manager-v1beta2/.repo-metadata.json @@ -0,0 +1,18 @@ +{ + "api_id": "secretmanager.googleapis.com", + "api_shortname": "secretmanager", + "client_documentation": "https://cloud.google.com/ruby/docs/reference/google-cloud-secret_manager-v1beta2/latest", + "distribution_name": "google-cloud-secret_manager-v1beta2", + "is_cloud": true, + "language": "ruby", + "name": "secretmanager", + "name_pretty": "Secret Manager V1BETA2 API", + "product_documentation": "https://cloud.google.com/secret-manager", + "release_level": "unreleased", + "repo": "googleapis/google-cloud-ruby", + "requires_billing": true, + "ruby-cloud-description": "Secret Manager Overview. Note that google-cloud-secret_manager-v1beta2 is a version-specific client library. For most uses, we recommend installing the main client library google-cloud-secret_manager instead. See the readme for more details.", + "ruby-cloud-env-prefix": "SECRET_MANAGER", + "ruby-cloud-product-url": "https://cloud.google.com/secret-manager", + "library_type": "GAPIC_AUTO" +} diff --git a/owl-bot-staging/google-cloud-secret_manager-v1beta2/.rubocop.yml b/owl-bot-staging/google-cloud-secret_manager-v1beta2/.rubocop.yml new file mode 100644 index 000000000000..734c385c1bd1 --- /dev/null +++ b/owl-bot-staging/google-cloud-secret_manager-v1beta2/.rubocop.yml @@ -0,0 +1,33 @@ +inherit_gem: + google-style: google-style.yml + +AllCops: + Exclude: + - "google-cloud-secret_manager-v1beta2.gemspec" + - "lib/**/*_pb.rb" + - "proto_docs/**/*" + - "test/**/*" + - "acceptance/**/*" + - "samples/acceptance/**/*" + - "Rakefile" + +Layout/LineLength: + Enabled: false +Metrics/AbcSize: + Enabled: false +Metrics/ClassLength: + Enabled: false +Metrics/CyclomaticComplexity: + Enabled: false +Metrics/MethodLength: + Enabled: false +Metrics/ModuleLength: + Enabled: false +Metrics/PerceivedComplexity: + Enabled: false +Naming/AccessorMethodName: + Exclude: + - "snippets/**/*.rb" +Naming/FileName: + Exclude: + - "lib/google-cloud-secret_manager-v1beta2.rb" diff --git a/owl-bot-staging/google-cloud-secret_manager-v1beta2/.toys.rb b/owl-bot-staging/google-cloud-secret_manager-v1beta2/.toys.rb new file mode 100644 index 000000000000..177e22456e8a --- /dev/null +++ b/owl-bot-staging/google-cloud-secret_manager-v1beta2/.toys.rb @@ -0,0 +1,28 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +toys_version! ">= 0.15.3" + +if ENV["RUBY_COMMON_TOOLS"] + common_tools_dir = File.expand_path ENV["RUBY_COMMON_TOOLS"] + load File.join(common_tools_dir, "toys", "gapic") +else + load_git remote: "https://github.com/googleapis/ruby-common-tools.git", + path: "toys/gapic", + update: true +end diff --git a/owl-bot-staging/google-cloud-secret_manager-v1beta2/.yardopts b/owl-bot-staging/google-cloud-secret_manager-v1beta2/.yardopts new file mode 100644 index 000000000000..ac280e88bebc --- /dev/null +++ b/owl-bot-staging/google-cloud-secret_manager-v1beta2/.yardopts @@ -0,0 +1,12 @@ +--no-private +--title="Secret Manager V1BETA2 API" +--exclude _pb\.rb$ +--markup markdown +--markup-provider redcarpet + +./lib/**/*.rb +./proto_docs/**/*.rb +- +README.md +LICENSE.md +AUTHENTICATION.md diff --git a/owl-bot-staging/google-cloud-secret_manager-v1beta2/AUTHENTICATION.md b/owl-bot-staging/google-cloud-secret_manager-v1beta2/AUTHENTICATION.md new file mode 100644 index 000000000000..15838bd69def --- /dev/null +++ b/owl-bot-staging/google-cloud-secret_manager-v1beta2/AUTHENTICATION.md @@ -0,0 +1,122 @@ +# Authentication + +The recommended way to authenticate to the google-cloud-secret_manager-v1beta2 library is to use +[Application Default Credentials (ADC)](https://cloud.google.com/docs/authentication/application-default-credentials). +To review all of your authentication options, see [Credentials lookup](#credential-lookup). + +## Quickstart + +The following example shows how to set up authentication for a local development +environment with your user credentials. + +**NOTE:** This method is _not_ recommended for running in production. User credentials +should be used only during development. + +1. [Download and install the Google Cloud CLI](https://cloud.google.com/sdk). +2. Set up a local ADC file with your user credentials: + +```sh +gcloud auth application-default login +``` + +3. Write code as if already authenticated. + +For more information about setting up authentication for a local development environment, see +[Set up Application Default Credentials](https://cloud.google.com/docs/authentication/provide-credentials-adc#local-dev). + +## Credential Lookup + +The google-cloud-secret_manager-v1beta2 library provides several mechanisms to configure your system. +Generally, using Application Default Credentials to facilitate automatic +credentials discovery is the easist method. But if you need to explicitly specify +credentials, there are several methods available to you. + +Credentials are accepted in the following ways, in the following order or precedence: + +1. Credentials specified in method arguments +2. Credentials specified in configuration +3. Credentials pointed to or included in environment variables +4. Credentials found in local ADC file +5. Credentials returned by the metadata server for the attached service account (GCP) + +### Configuration + +You can configure a path to a JSON credentials file, either for an individual client object or +globally, for all client objects. The JSON file can contain credentials created for +[workload identity federation](https://cloud.google.com/iam/docs/workload-identity-federation), +[workforce identity federation](https://cloud.google.com/iam/docs/workforce-identity-federation), or a +[service account key](https://cloud.google.com/docs/authentication/provide-credentials-adc#local-key). + +Note: Service account keys are a security risk if not managed correctly. You should +[choose a more secure alternative to service account keys](https://cloud.google.com/docs/authentication#auth-decision-tree) +whenever possible. + +To configure a credentials file for an individual client initialization: + +```ruby +require "google/cloud/secret_manager/v1beta2" + +client = ::Google::Cloud::SecretManager::V1beta2::SecretManagerService::Client.new do |config| + config.credentials = "path/to/credentialfile.json" +end +``` + +To configure a credentials file globally for all clients: + +```ruby +require "google/cloud/secret_manager/v1beta2" + +::Google::Cloud::SecretManager::V1beta2::SecretManagerService::Client.configure do |config| + config.credentials = "path/to/credentialfile.json" +end + +client = ::Google::Cloud::SecretManager::V1beta2::SecretManagerService::Client.new +``` + +### Environment Variables + +You can also use an environment variable to provide a JSON credentials file. +The environment variable can contain a path to the credentials file or, for +environments such as Docker containers where writing files is not encouraged, +you can include the credentials file itself. + +The JSON file can contain credentials created for +[workload identity federation](https://cloud.google.com/iam/docs/workload-identity-federation), +[workforce identity federation](https://cloud.google.com/iam/docs/workforce-identity-federation), or a +[service account key](https://cloud.google.com/docs/authentication/provide-credentials-adc#local-key). + +Note: Service account keys are a security risk if not managed correctly. You should +[choose a more secure alternative to service account keys](https://cloud.google.com/docs/authentication#auth-decision-tree) +whenever possible. + +The environment variables that google-cloud-secret_manager-v1beta2 +checks for credentials are: + +* `GOOGLE_CLOUD_CREDENTIALS` - Path to JSON file, or JSON contents +* `GOOGLE_APPLICATION_CREDENTIALS` - Path to JSON file + +```ruby +require "google/cloud/secret_manager/v1beta2" + +ENV["GOOGLE_APPLICATION_CREDENTIALS"] = "path/to/credentialfile.json" + +client = ::Google::Cloud::SecretManager::V1beta2::SecretManagerService::Client.new +``` + +### Local ADC file + +You can set up a local ADC file with your user credentials for authentication during +development. If credentials are not provided in code or in environment variables, +then the local ADC credentials are discovered. + +Follow the steps in [Quickstart](#quickstart) to set up a local ADC file. + +### Google Cloud Platform environments + +When running on Google Cloud Platform (GCP), including Google Compute Engine +(GCE), Google Kubernetes Engine (GKE), Google App Engine (GAE), Google Cloud +Functions (GCF) and Cloud Run, credentials are retrieved from the attached +service account automatically. Code should be written as if already authenticated. + +For more information, see +[Set up ADC for Google Cloud services](https://cloud.google.com/docs/authentication/provide-credentials-adc#attached-sa). diff --git a/owl-bot-staging/google-cloud-secret_manager-v1beta2/CHANGELOG.md b/owl-bot-staging/google-cloud-secret_manager-v1beta2/CHANGELOG.md new file mode 100644 index 000000000000..f88957a62ba2 --- /dev/null +++ b/owl-bot-staging/google-cloud-secret_manager-v1beta2/CHANGELOG.md @@ -0,0 +1,2 @@ +# Release History + diff --git a/owl-bot-staging/google-cloud-secret_manager-v1beta2/Gemfile b/owl-bot-staging/google-cloud-secret_manager-v1beta2/Gemfile new file mode 100644 index 000000000000..1d08558908d8 --- /dev/null +++ b/owl-bot-staging/google-cloud-secret_manager-v1beta2/Gemfile @@ -0,0 +1,14 @@ +source "https://rubygems.org" + +gemspec + +gem "google-style", "~> 1.32.0" +gem "irb", "~> 1.17" +gem "minitest", "~> 6.0.2" +gem "minitest-focus", "~> 1.4" +gem "minitest-mock", "~> 5.27" +gem "minitest-rg", "~> 5.3" +gem "ostruct", "~> 0.5.5" +gem "rake", ">= 13.0" +gem "redcarpet", "~> 3.6" +gem "yard", "~> 0.9" diff --git a/owl-bot-staging/google-cloud-secret_manager-v1beta2/LICENSE.md b/owl-bot-staging/google-cloud-secret_manager-v1beta2/LICENSE.md new file mode 100644 index 000000000000..c261857ba6ad --- /dev/null +++ b/owl-bot-staging/google-cloud-secret_manager-v1beta2/LICENSE.md @@ -0,0 +1,201 @@ + Apache License + Version 2.0, January 2004 + http://www.apache.org/licenses/ + + TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION + + 1. Definitions. + + "License" shall mean the terms and conditions for use, reproduction, + and distribution as defined by Sections 1 through 9 of this document. + + "Licensor" shall mean the copyright owner or entity authorized by + the copyright owner that is granting the License. + + "Legal Entity" shall mean the union of the acting entity and all + other entities that control, are controlled by, or are under common + control with that entity. For the purposes of this definition, + "control" means (i) the power, direct or indirect, to cause the + direction or management of such entity, whether by contract or + otherwise, or (ii) ownership of fifty percent (50%) or more of the + outstanding shares, or (iii) beneficial ownership of such entity. + + "You" (or "Your") shall mean an individual or Legal Entity + exercising permissions granted by this License. + + "Source" form shall mean the preferred form for making modifications, + including but not limited to software source code, documentation + source, and configuration files. + + "Object" form shall mean any form resulting from mechanical + transformation or translation of a Source form, including but + not limited to compiled object code, generated documentation, + and conversions to other media types. + + "Work" shall mean the work of authorship, whether in Source or + Object form, made available under the License, as indicated by a + copyright notice that is included in or attached to the work + (an example is provided in the Appendix below). + + "Derivative Works" shall mean any work, whether in Source or Object + form, that is based on (or derived from) the Work and for which the + editorial revisions, annotations, elaborations, or other modifications + represent, as a whole, an original work of authorship. For the purposes + of this License, Derivative Works shall not include works that remain + separable from, or merely link (or bind by name) to the interfaces of, + the Work and Derivative Works thereof. + + "Contribution" shall mean any work of authorship, including + the original version of the Work and any modifications or additions + to that Work or Derivative Works thereof, that is intentionally + submitted to Licensor for inclusion in the Work by the copyright owner + or by an individual or Legal Entity authorized to submit on behalf of + the copyright owner. For the purposes of this definition, "submitted" + means any form of electronic, verbal, or written communication sent + to the Licensor or its representatives, including but not limited to + communication on electronic mailing lists, source code control systems, + and issue tracking systems that are managed by, or on behalf of, the + Licensor for the purpose of discussing and improving the Work, but + excluding communication that is conspicuously marked or otherwise + designated in writing by the copyright owner as "Not a Contribution." + + "Contributor" shall mean Licensor and any individual or Legal Entity + on behalf of whom a Contribution has been received by Licensor and + subsequently incorporated within the Work. + + 2. Grant of Copyright License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + copyright license to reproduce, prepare Derivative Works of, + publicly display, publicly perform, sublicense, and distribute the + Work and such Derivative Works in Source or Object form. + + 3. Grant of Patent License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + (except as stated in this section) patent license to make, have made, + use, offer to sell, sell, import, and otherwise transfer the Work, + where such license applies only to those patent claims licensable + by such Contributor that are necessarily infringed by their + Contribution(s) alone or by combination of their Contribution(s) + with the Work to which such Contribution(s) was submitted. If You + institute patent litigation against any entity (including a + cross-claim or counterclaim in a lawsuit) alleging that the Work + or a Contribution incorporated within the Work constitutes direct + or contributory patent infringement, then any patent licenses + granted to You under this License for that Work shall terminate + as of the date such litigation is filed. + + 4. Redistribution. You may reproduce and distribute copies of the + Work or Derivative Works thereof in any medium, with or without + modifications, and in Source or Object form, provided that You + meet the following conditions: + + (a) You must give any other recipients of the Work or + Derivative Works a copy of this License; and + + (b) You must cause any modified files to carry prominent notices + stating that You changed the files; and + + (c) You must retain, in the Source form of any Derivative Works + that You distribute, all copyright, patent, trademark, and + attribution notices from the Source form of the Work, + excluding those notices that do not pertain to any part of + the Derivative Works; and + + (d) If the Work includes a "NOTICE" text file as part of its + distribution, then any Derivative Works that You distribute must + include a readable copy of the attribution notices contained + within such NOTICE file, excluding those notices that do not + pertain to any part of the Derivative Works, in at least one + of the following places: within a NOTICE text file distributed + as part of the Derivative Works; within the Source form or + documentation, if provided along with the Derivative Works; or, + within a display generated by the Derivative Works, if and + wherever such third-party notices normally appear. The contents + of the NOTICE file are for informational purposes only and + do not modify the License. You may add Your own attribution + notices within Derivative Works that You distribute, alongside + or as an addendum to the NOTICE text from the Work, provided + that such additional attribution notices cannot be construed + as modifying the License. + + You may add Your own copyright statement to Your modifications and + may provide additional or different license terms and conditions + for use, reproduction, or distribution of Your modifications, or + for any such Derivative Works as a whole, provided Your use, + reproduction, and distribution of the Work otherwise complies with + the conditions stated in this License. + + 5. Submission of Contributions. Unless You explicitly state otherwise, + any Contribution intentionally submitted for inclusion in the Work + by You to the Licensor shall be under the terms and conditions of + this License, without any additional terms or conditions. + Notwithstanding the above, nothing herein shall supersede or modify + the terms of any separate license agreement you may have executed + with Licensor regarding such Contributions. + + 6. Trademarks. This License does not grant permission to use the trade + names, trademarks, service marks, or product names of the Licensor, + except as required for reasonable and customary use in describing the + origin of the Work and reproducing the content of the NOTICE file. + + 7. Disclaimer of Warranty. Unless required by applicable law or + agreed to in writing, Licensor provides the Work (and each + Contributor provides its Contributions) on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or + implied, including, without limitation, any warranties or conditions + of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A + PARTICULAR PURPOSE. You are solely responsible for determining the + appropriateness of using or redistributing the Work and assume any + risks associated with Your exercise of permissions under this License. + + 8. Limitation of Liability. In no event and under no legal theory, + whether in tort (including negligence), contract, or otherwise, + unless required by applicable law (such as deliberate and grossly + negligent acts) or agreed to in writing, shall any Contributor be + liable to You for damages, including any direct, indirect, special, + incidental, or consequential damages of any character arising as a + result of this License or out of the use or inability to use the + Work (including but not limited to damages for loss of goodwill, + work stoppage, computer failure or malfunction, or any and all + other commercial damages or losses), even if such Contributor + has been advised of the possibility of such damages. + + 9. Accepting Warranty or Additional Liability. While redistributing + the Work or Derivative Works thereof, You may choose to offer, + and charge a fee for, acceptance of support, warranty, indemnity, + or other liability obligations and/or rights consistent with this + License. However, in accepting such obligations, You may act only + on Your own behalf and on Your sole responsibility, not on behalf + of any other Contributor, and only if You agree to indemnify, + defend, and hold each Contributor harmless for any liability + incurred by, or claims asserted against, such Contributor by reason + of your accepting any such warranty or additional liability. + + END OF TERMS AND CONDITIONS + + APPENDIX: How to apply the Apache License to your work. + + To apply the Apache License to your work, attach the following + boilerplate notice, with the fields enclosed by brackets "[]" + replaced with your own identifying information. (Don't include + the brackets!) The text should be enclosed in the appropriate + comment syntax for the file format. We also recommend that a + file or class name and description of purpose be included on the + same "printed page" as the copyright notice for easier + identification within third-party archives. + + Copyright [yyyy] [name of copyright owner] + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. diff --git a/owl-bot-staging/google-cloud-secret_manager-v1beta2/README.md b/owl-bot-staging/google-cloud-secret_manager-v1beta2/README.md new file mode 100644 index 000000000000..cd878fb849e0 --- /dev/null +++ b/owl-bot-staging/google-cloud-secret_manager-v1beta2/README.md @@ -0,0 +1,154 @@ +# Ruby Client for the Secret Manager V1BETA2 API + +Stores sensitive data such as API keys, passwords, and certificates. Provides convenience while improving security. + +Secret Manager Overview. + +https://github.com/googleapis/google-cloud-ruby + +This gem is a _versioned_ client. It provides basic client classes for a +specific version of the Secret Manager V1BETA2 API. Most users should consider using +the main client gem, +[google-cloud-secret_manager](https://rubygems.org/gems/google-cloud-secret_manager). +See the section below titled *Which client should I use?* for more information. + +## Installation + +``` +$ gem install google-cloud-secret_manager-v1beta2 +``` + +## Before You Begin + +In order to use this library, you first need to go through the following steps: + +1. [Select or create a Cloud Platform project.](https://console.cloud.google.com/project) +1. [Enable billing for your project.](https://cloud.google.com/billing/docs/how-to/modify-project#enable_billing_for_a_project) +1. [Enable the API.](https://console.cloud.google.com/apis/library/secretmanager.googleapis.com) +1. [Set up authentication.](AUTHENTICATION.md) + +## Quick Start + +```ruby +require "google/cloud/secret_manager/v1beta2" + +client = ::Google::Cloud::SecretManager::V1beta2::SecretManagerService::Client.new +request = ::Google::Cloud::SecretManager::V1beta2::ListSecretsRequest.new # (request fields as keyword arguments...) +response = client.list_secrets request +``` + +View the [Client Library Documentation](https://cloud.google.com/ruby/docs/reference/google-cloud-secret_manager-v1beta2/latest) +for class and method documentation. + +See also the [Product Documentation](https://cloud.google.com/secret-manager) +for general usage information. + +## Debug Logging + +This library comes with opt-in Debug Logging that can help you troubleshoot +your application's integration with the API. When logging is activated, key +events such as requests and responses, along with data payloads and metadata +such as headers and client configuration, are logged to the standard error +stream. + +**WARNING:** Client Library Debug Logging includes your data payloads in +plaintext, which could include sensitive data such as PII for yourself or your +customers, private keys, or other security data that could be compromising if +leaked. Always practice good data hygiene with your application logs, and follow +the principle of least access. Google also recommends that Client Library Debug +Logging be enabled only temporarily during active debugging, and not used +permanently in production. + +To enable logging, set the environment variable `GOOGLE_SDK_RUBY_LOGGING_GEMS` +to the value `all`. Alternatively, you can set the value to a comma-delimited +list of client library gem names. This will select the default logging behavior, +which writes logs to the standard error stream. On a local workstation, this may +result in logs appearing on the console. When running on a Google Cloud hosting +service such as [Google Cloud Run](https://cloud.google.com/run), this generally +results in logs appearing alongside your application logs in the +[Google Cloud Logging](https://cloud.google.com/logging/) service. + +You can customize logging by modifying the `logger` configuration when +constructing a client object. For example: + +```ruby +require "google/cloud/secret_manager/v1beta2" +require "logger" + +client = ::Google::Cloud::SecretManager::V1beta2::SecretManagerService::Client.new do |config| + config.logger = Logger.new "my-app.log" +end +``` + +## Google Cloud Samples + +To browse ready to use code samples check [Google Cloud Samples](https://cloud.google.com/docs/samples). + +## Supported Ruby Versions + +This library is supported on Ruby 3.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-secret_manager`, +and lower-level _versioned_ client libraries with names such as +`google-cloud-secret_manager-v1beta2`. +_In most cases, you should install the main client._ + +### What's the difference between the main client and a versioned client? + +A _versioned client_ provides a basic set of data types and client classes for +a _single version_ of a specific service. (That is, for a service with multiple +versions, there might be a separate versioned client for each service version.) +Most versioned clients are written and maintained by a code generator. + +The _main client_ is designed to provide you with the _recommended_ client +interfaces for the service. There will be only one main client for any given +service, even a service with multiple versions. The main client includes +factory methods for constructing the client objects we recommend for most +users. In some cases, those will be classes provided by an underlying versioned +client; in other cases, they will be handwritten higher-level client objects +with additional capabilities, convenience methods, or best practices built in. +Generally, the main client will default to a recommended service version, +although in some cases you can override this if you need to talk to a specific +service version. + +### Why would I want to use the main client? + +We recommend that most users install the main client gem for a service. You can +identify this gem as the one _without_ a version in its name, e.g. +`google-cloud-secret_manager`. +The main client is recommended because it will embody the best practices for +accessing the service, and may also provide more convenient interfaces or +tighter integration into frameworks and third-party libraries. In addition, the +documentation and samples published by Google will generally demonstrate use of +the main client. + +### Why would I want to use a versioned client? + +You can use a versioned client if you are content with a possibly lower-level +class interface, you explicitly want to avoid features provided by the main +client, or you want to access a specific service version not be covered by the +main client. You can identify versioned client gems because the service version +is part of the name, e.g. `google-cloud-secret_manager-v1beta2`. + +### What about the google-apis- clients? + +Client library gems with names that begin with `google-apis-` are based on an +older code generation technology. They talk to a REST/JSON backend (whereas +most modern clients talk to a [gRPC](https://grpc.io/) backend) and they may +not offer the same performance, features, and ease of use provided by more +modern clients. + +The `google-apis-` clients have wide coverage across Google services, so you +might need to use one if there is no modern client available for the service. +However, if a modern client is available, we generally recommend it over the +older `google-apis-` clients. diff --git a/owl-bot-staging/google-cloud-secret_manager-v1beta2/Rakefile b/owl-bot-staging/google-cloud-secret_manager-v1beta2/Rakefile new file mode 100644 index 000000000000..b1cfc54cac77 --- /dev/null +++ b/owl-bot-staging/google-cloud-secret_manager-v1beta2/Rakefile @@ -0,0 +1,169 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +require "bundler/setup" +require "bundler/gem_tasks" + +require "rubocop/rake_task" +RuboCop::RakeTask.new + +require "rake/testtask" +desc "Run tests." +Rake::TestTask.new do |t| + t.libs << "test" + t.test_files = FileList["test/**/*_test.rb"] + t.warning = false +end + +desc "Runs the smoke tests." +Rake::TestTask.new :smoke_test do |t| + t.test_files = FileList["acceptance/**/*smoke_test.rb"] + t.warning = false +end + +# Acceptance tests +desc "Run the google-cloud-secret_manager-v1beta2 acceptance tests." +task :acceptance, :project, :keyfile do |t, args| + project = args[:project] + project ||= + ENV["SECRET_MANAGER_TEST_PROJECT"] || + ENV["GCLOUD_TEST_PROJECT"] + keyfile = args[:keyfile] + keyfile ||= + ENV["SECRET_MANAGER_TEST_KEYFILE"] || + ENV["GCLOUD_TEST_KEYFILE"] + if keyfile + keyfile = File.read keyfile + else + keyfile ||= + ENV["SECRET_MANAGER_TEST_KEYFILE_JSON"] || + ENV["GCLOUD_TEST_KEYFILE_JSON"] + end + if project.nil? || keyfile.nil? + fail "You must provide a project and keyfile. e.g. rake acceptance[test123, /path/to/keyfile.json] or SECRET_MANAGER_TEST_PROJECT=test123 SECRET_MANAGER_TEST_KEYFILE=/path/to/keyfile.json rake acceptance" + end + require "google/cloud/secret_manager/v1beta2/secret_manager_service/credentials" + ::Google::Cloud::SecretManager::V1beta2::SecretManagerService::Credentials.env_vars.each do |path| + ENV[path] = nil + end + ENV["SECRET_MANAGER_PROJECT"] = project + ENV["SECRET_MANAGER_TEST_PROJECT"] = project + ENV["SECRET_MANAGER_KEYFILE_JSON"] = keyfile + + Rake::Task["acceptance:run"].invoke +end + +namespace :acceptance do + task :run do + if File.directory? "acceptance" + Rake::Task[:smoke_test].invoke + else + puts "The google-cloud-secret_manager-v1beta2 gem has no acceptance tests." + end + end + + desc "Run acceptance cleanup." + task :cleanup do + end +end + +task :samples do + Rake::Task["samples:latest"].invoke +end + +namespace :samples do + task :latest do + if File.directory? "samples" + Dir.chdir "samples" do + Bundler.with_clean_env do + ENV["GOOGLE_CLOUD_SAMPLES_TEST"] = "not_master" + sh "bundle update" + sh "bundle exec rake test" + end + end + else + puts "The google-cloud-secret_manager-v1beta2 gem has no samples to test." + end + end + + task :master do + if File.directory? "samples" + Dir.chdir "samples" do + Bundler.with_clean_env do + ENV["GOOGLE_CLOUD_SAMPLES_TEST"] = "master" + sh "bundle update" + sh "bundle exec rake test" + end + end + else + puts "The google-cloud-secret_manager-v1beta2 gem has no samples to test." + end + end +end + +require "yard" +require "yard/rake/yardoc_task" +YARD::Rake::YardocTask.new do |y| + y.options << "--fail-on-warning" +end + +desc "Run yard-doctest example tests." +task :doctest do + puts "The google-cloud-secret_manager-v1beta2 gem does not have doctest tests." +end + +desc "Run the CI build" +task :ci do + header "BUILDING google-cloud-secret_manager-v1beta2" + header "google-cloud-secret_manager-v1beta2 rubocop", "*" + Rake::Task[:rubocop].invoke + header "google-cloud-secret_manager-v1beta2 yard", "*" + Rake::Task[:yard].invoke + header "google-cloud-secret_manager-v1beta2 test", "*" + Rake::Task[:test].invoke +end + +namespace :ci do + desc "Run the CI build, with smoke tests." + task :smoke_test do + Rake::Task[:ci].invoke + header "google-cloud-secret_manager-v1beta2 smoke_test", "*" + Rake::Task[:smoke_test].invoke + end + desc "Run the CI build, with acceptance tests." + task :acceptance do + Rake::Task[:ci].invoke + header "google-cloud-secret_manager-v1beta2 acceptance", "*" + Rake::Task[:acceptance].invoke + end + task :a do + # This is a handy shortcut to save typing + Rake::Task["ci:acceptance"].invoke + end +end + +task default: :test + +def header str, token = "#" + line_length = str.length + 8 + puts "" + puts token * line_length + puts "#{token * 3} #{str} #{token * 3}" + puts token * line_length + puts "" +end diff --git a/owl-bot-staging/google-cloud-secret_manager-v1beta2/gapic_metadata.json b/owl-bot-staging/google-cloud-secret_manager-v1beta2/gapic_metadata.json new file mode 100644 index 000000000000..fd910a3daa8c --- /dev/null +++ b/owl-bot-staging/google-cloud-secret_manager-v1beta2/gapic_metadata.json @@ -0,0 +1,93 @@ +{ + "schema": "1.0", + "comment": "This file maps proto services/RPCs to the corresponding library clients/methods", + "language": "ruby", + "protoPackage": "google.cloud.secretmanager.v1beta2", + "libraryPackage": "::Google::Cloud::SecretManager::V1beta2", + "services": { + "SecretManagerService": { + "clients": { + "grpc": { + "libraryClient": "::Google::Cloud::SecretManager::V1beta2::SecretManagerService::Client", + "rpcs": { + "ListSecrets": { + "methods": [ + "list_secrets" + ] + }, + "CreateSecret": { + "methods": [ + "create_secret" + ] + }, + "AddSecretVersion": { + "methods": [ + "add_secret_version" + ] + }, + "GetSecret": { + "methods": [ + "get_secret" + ] + }, + "UpdateSecret": { + "methods": [ + "update_secret" + ] + }, + "DeleteSecret": { + "methods": [ + "delete_secret" + ] + }, + "ListSecretVersions": { + "methods": [ + "list_secret_versions" + ] + }, + "GetSecretVersion": { + "methods": [ + "get_secret_version" + ] + }, + "AccessSecretVersion": { + "methods": [ + "access_secret_version" + ] + }, + "DisableSecretVersion": { + "methods": [ + "disable_secret_version" + ] + }, + "EnableSecretVersion": { + "methods": [ + "enable_secret_version" + ] + }, + "DestroySecretVersion": { + "methods": [ + "destroy_secret_version" + ] + }, + "SetIamPolicy": { + "methods": [ + "set_iam_policy" + ] + }, + "GetIamPolicy": { + "methods": [ + "get_iam_policy" + ] + }, + "TestIamPermissions": { + "methods": [ + "test_iam_permissions" + ] + } + } + } + } + } + } +} diff --git a/owl-bot-staging/google-cloud-secret_manager-v1beta2/google-cloud-secret_manager-v1beta2.gemspec b/owl-bot-staging/google-cloud-secret_manager-v1beta2/google-cloud-secret_manager-v1beta2.gemspec new file mode 100644 index 000000000000..f091f7cde6d0 --- /dev/null +++ b/owl-bot-staging/google-cloud-secret_manager-v1beta2/google-cloud-secret_manager-v1beta2.gemspec @@ -0,0 +1,30 @@ +# -*- ruby -*- +# encoding: utf-8 + +require File.expand_path("lib/google/cloud/secret_manager/v1beta2/version", __dir__) + +Gem::Specification.new do |gem| + gem.name = "google-cloud-secret_manager-v1beta2" + gem.version = Google::Cloud::SecretManager::V1beta2::VERSION + + gem.authors = ["Google LLC"] + gem.email = "googleapis-packages@google.com" + gem.description = "Secret Manager Overview. Note that google-cloud-secret_manager-v1beta2 is a version-specific client library. For most uses, we recommend installing the main client library google-cloud-secret_manager instead. See the readme for more details." + gem.summary = "Stores sensitive data such as API keys, passwords, and certificates. Provides convenience while improving security." + gem.homepage = "https://github.com/googleapis/google-cloud-ruby" + gem.license = "Apache-2.0" + + gem.platform = Gem::Platform::RUBY + + gem.files = `git ls-files -- lib/*`.split("\n") + + `git ls-files -- proto_docs/*`.split("\n") + + ["README.md", "LICENSE.md", "AUTHENTICATION.md", ".yardopts"] + gem.require_paths = ["lib"] + + gem.required_ruby_version = ">= 3.2" + + gem.add_dependency "gapic-common", "~> 1.2" + gem.add_dependency "google-cloud-errors", "~> 1.0" + gem.add_dependency "google-cloud-location", "~> 1.0" + gem.add_dependency "grpc-google-iam-v1", "~> 1.11" +end diff --git a/owl-bot-staging/google-cloud-secret_manager-v1beta2/lib/google-cloud-secret_manager-v1beta2.rb b/owl-bot-staging/google-cloud-secret_manager-v1beta2/lib/google-cloud-secret_manager-v1beta2.rb new file mode 100644 index 000000000000..4fa698942ce3 --- /dev/null +++ b/owl-bot-staging/google-cloud-secret_manager-v1beta2/lib/google-cloud-secret_manager-v1beta2.rb @@ -0,0 +1,21 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +# This gem does not autoload during Bundler.require. To load this gem, +# issue explicit require statements for the packages desired, e.g.: +# require "google/cloud/secret_manager/v1beta2" diff --git a/owl-bot-staging/google-cloud-secret_manager-v1beta2/lib/google/cloud/secret_manager/v1beta2.rb b/owl-bot-staging/google-cloud-secret_manager-v1beta2/lib/google/cloud/secret_manager/v1beta2.rb new file mode 100644 index 000000000000..094bfb8e6d20 --- /dev/null +++ b/owl-bot-staging/google-cloud-secret_manager-v1beta2/lib/google/cloud/secret_manager/v1beta2.rb @@ -0,0 +1,45 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +require "google/cloud/secret_manager/v1beta2/secret_manager_service" +require "google/cloud/secret_manager/v1beta2/version" + +module Google + module Cloud + module SecretManager + ## + # API client module. + # + # @example Load this package, including all its services, and instantiate a gRPC client + # + # require "google/cloud/secret_manager/v1beta2" + # client = ::Google::Cloud::SecretManager::V1beta2::SecretManagerService::Client.new + # + # @example Load this package, including all its services, and instantiate a REST client + # + # require "google/cloud/secret_manager/v1beta2" + # client = ::Google::Cloud::SecretManager::V1beta2::SecretManagerService::Rest::Client.new + # + module V1beta2 + end + end + end +end + +helper_path = ::File.join __dir__, "v1beta2", "_helpers.rb" +require "google/cloud/secret_manager/v1beta2/_helpers" if ::File.file? helper_path diff --git a/owl-bot-staging/google-cloud-secret_manager-v1beta2/lib/google/cloud/secret_manager/v1beta2/bindings_override.rb b/owl-bot-staging/google-cloud-secret_manager-v1beta2/lib/google/cloud/secret_manager/v1beta2/bindings_override.rb new file mode 100644 index 000000000000..2cb21f372d4d --- /dev/null +++ b/owl-bot-staging/google-cloud-secret_manager-v1beta2/lib/google/cloud/secret_manager/v1beta2/bindings_override.rb @@ -0,0 +1,75 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +require "gapic/rest" + +module Google + module Cloud + module SecretManager + ## + # @example Loading just the REST part of this package, including all its services, and instantiating a REST client + # + # require "google/cloud/secret_manager/v1beta2/rest" + # client = ::Google::Cloud::SecretManager::V1beta2::SecretManagerService::Rest::Client.new + # + module V1beta2 + ## + # @private + # Initialize the mixin bindings configuration + # + def self.configure + @configure ||= begin + namespace = ["Google", "Cloud", "SecretManager"] + parent_config = while namespace.any? + parent_name = namespace.join "::" + parent_const = const_get parent_name + break parent_const.configure if parent_const.respond_to? :configure + namespace.pop + end + + default_config = ::Gapic::Rest::HttpBindingOverrideConfiguration.new parent_config + default_config.bindings_override["google.cloud.location.Locations.GetLocation"] = [ + Gapic::Rest::GrpcTranscoder::HttpBinding.create_with_validation( + uri_method: :get, + uri_template: "/v1beta2/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/?$}, false] + ], + body: nil + ) + ] + default_config.bindings_override["google.cloud.location.Locations.ListLocations"] = [ + + Gapic::Rest::GrpcTranscoder::HttpBinding.create_with_validation( + uri_method: :get, + uri_template: "/v1beta2/{name}/locations", + matches: [ + ["name", %r{^projects/[^/]+/?$}, false] + ], + body: nil + ) + ] + default_config + end + yield @configure if block_given? + @configure + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-secret_manager-v1beta2/lib/google/cloud/secret_manager/v1beta2/rest.rb b/owl-bot-staging/google-cloud-secret_manager-v1beta2/lib/google/cloud/secret_manager/v1beta2/rest.rb new file mode 100644 index 000000000000..4581b5c14be0 --- /dev/null +++ b/owl-bot-staging/google-cloud-secret_manager-v1beta2/lib/google/cloud/secret_manager/v1beta2/rest.rb @@ -0,0 +1,38 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +require "google/cloud/secret_manager/v1beta2/secret_manager_service/rest" +require "google/cloud/secret_manager/v1beta2/bindings_override" +require "google/cloud/secret_manager/v1beta2/version" + +module Google + module Cloud + module SecretManager + ## + # To load just the REST part of this package, including all its services, and instantiate a REST client: + # + # @example + # + # require "google/cloud/secret_manager/v1beta2/rest" + # client = ::Google::Cloud::SecretManager::V1beta2::SecretManagerService::Rest::Client.new + # + module V1beta2 + end + end + end +end diff --git a/owl-bot-staging/google-cloud-secret_manager-v1beta2/lib/google/cloud/secret_manager/v1beta2/secret_manager_service.rb b/owl-bot-staging/google-cloud-secret_manager-v1beta2/lib/google/cloud/secret_manager/v1beta2/secret_manager_service.rb new file mode 100644 index 000000000000..5200a70afe3b --- /dev/null +++ b/owl-bot-staging/google-cloud-secret_manager-v1beta2/lib/google/cloud/secret_manager/v1beta2/secret_manager_service.rb @@ -0,0 +1,61 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +require "gapic/common" +require "gapic/config" +require "gapic/config/method" + +require "google/cloud/secret_manager/v1beta2/version" + +require "google/cloud/secret_manager/v1beta2/secret_manager_service/credentials" +require "google/cloud/secret_manager/v1beta2/secret_manager_service/paths" +require "google/cloud/secret_manager/v1beta2/secret_manager_service/client" +require "google/cloud/secret_manager/v1beta2/secret_manager_service/rest" + +module Google + module Cloud + module SecretManager + module V1beta2 + ## + # Secret Manager Service + # + # Manages secrets and operations using those secrets. Implements a REST + # model with the following objects: + # + # * {::Google::Cloud::SecretManager::V1beta2::Secret Secret} + # * {::Google::Cloud::SecretManager::V1beta2::SecretVersion SecretVersion} + # + # @example Load this service and instantiate a gRPC client + # + # require "google/cloud/secret_manager/v1beta2/secret_manager_service" + # client = ::Google::Cloud::SecretManager::V1beta2::SecretManagerService::Client.new + # + # @example Load this service and instantiate a REST client + # + # require "google/cloud/secret_manager/v1beta2/secret_manager_service/rest" + # client = ::Google::Cloud::SecretManager::V1beta2::SecretManagerService::Rest::Client.new + # + module SecretManagerService + end + end + end + end +end + +helper_path = ::File.join __dir__, "secret_manager_service", "helpers.rb" +require "google/cloud/secret_manager/v1beta2/secret_manager_service/helpers" if ::File.file? helper_path diff --git a/owl-bot-staging/google-cloud-secret_manager-v1beta2/lib/google/cloud/secret_manager/v1beta2/secret_manager_service/client.rb b/owl-bot-staging/google-cloud-secret_manager-v1beta2/lib/google/cloud/secret_manager/v1beta2/secret_manager_service/client.rb new file mode 100644 index 000000000000..88688702fcb1 --- /dev/null +++ b/owl-bot-staging/google-cloud-secret_manager-v1beta2/lib/google/cloud/secret_manager/v1beta2/secret_manager_service/client.rb @@ -0,0 +1,1996 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +require "google/cloud/errors" +require "google/cloud/secretmanager/v1beta2/service_pb" +require "google/cloud/location" + +module Google + module Cloud + module SecretManager + module V1beta2 + module SecretManagerService + ## + # Client for the SecretManagerService service. + # + # Secret Manager Service + # + # Manages secrets and operations using those secrets. Implements a REST + # model with the following objects: + # + # * {::Google::Cloud::SecretManager::V1beta2::Secret Secret} + # * {::Google::Cloud::SecretManager::V1beta2::SecretVersion SecretVersion} + # + class Client + # @private + API_VERSION = "" + + # @private + DEFAULT_ENDPOINT_TEMPLATE = "secretmanager.$UNIVERSE_DOMAIN$" + + include Paths + + # @private + attr_reader :secret_manager_service_stub + + ## + # Configure the SecretManagerService Client class. + # + # See {::Google::Cloud::SecretManager::V1beta2::SecretManagerService::Client::Configuration} + # for a description of the configuration fields. + # + # @example + # + # # Modify the configuration for all SecretManagerService clients + # ::Google::Cloud::SecretManager::V1beta2::SecretManagerService::Client.configure do |config| + # config.timeout = 10.0 + # end + # + # @yield [config] Configure the Client client. + # @yieldparam config [Client::Configuration] + # + # @return [Client::Configuration] + # + def self.configure + @configure ||= begin + namespace = ["Google", "Cloud", "SecretManager", "V1beta2"] + parent_config = while namespace.any? + parent_name = namespace.join "::" + parent_const = const_get parent_name + break parent_const.configure if parent_const.respond_to? :configure + namespace.pop + end + default_config = Client::Configuration.new parent_config + + default_config.rpcs.list_secrets.timeout = 60.0 + + default_config.rpcs.create_secret.timeout = 60.0 + + default_config.rpcs.add_secret_version.timeout = 60.0 + + default_config.rpcs.get_secret.timeout = 60.0 + + default_config.rpcs.update_secret.timeout = 60.0 + + default_config.rpcs.delete_secret.timeout = 60.0 + + default_config.rpcs.list_secret_versions.timeout = 60.0 + + default_config.rpcs.get_secret_version.timeout = 60.0 + + default_config.rpcs.access_secret_version.timeout = 60.0 + default_config.rpcs.access_secret_version.retry_policy = { + initial_delay: 2.0, max_delay: 60.0, multiplier: 2.0, retry_codes: [14, 8] + } + + default_config.rpcs.disable_secret_version.timeout = 60.0 + + default_config.rpcs.enable_secret_version.timeout = 60.0 + + default_config.rpcs.destroy_secret_version.timeout = 60.0 + + default_config.rpcs.set_iam_policy.timeout = 60.0 + + default_config.rpcs.get_iam_policy.timeout = 60.0 + + default_config.rpcs.test_iam_permissions.timeout = 60.0 + + default_config + end + yield @configure if block_given? + @configure + end + + ## + # Configure the SecretManagerService Client instance. + # + # The configuration is set to the derived mode, meaning that values can be changed, + # but structural changes (adding new fields, etc.) are not allowed. Structural changes + # should be made on {Client.configure}. + # + # See {::Google::Cloud::SecretManager::V1beta2::SecretManagerService::Client::Configuration} + # for a description of the configuration fields. + # + # @yield [config] Configure the Client client. + # @yieldparam config [Client::Configuration] + # + # @return [Client::Configuration] + # + def configure + yield @config if block_given? + @config + end + + ## + # The effective universe domain + # + # @return [String] + # + def universe_domain + @secret_manager_service_stub.universe_domain + end + + ## + # Create a new SecretManagerService client object. + # + # @example + # + # # Create a client using the default configuration + # client = ::Google::Cloud::SecretManager::V1beta2::SecretManagerService::Client.new + # + # # Create a client using a custom configuration + # client = ::Google::Cloud::SecretManager::V1beta2::SecretManagerService::Client.new do |config| + # config.timeout = 10.0 + # end + # + # @yield [config] Configure the SecretManagerService client. + # @yieldparam config [Client::Configuration] + # + def initialize + # These require statements are intentionally placed here to initialize + # the gRPC module only when it's required. + # See https://github.com/googleapis/toolkit/issues/446 + require "gapic/grpc" + require "google/cloud/secretmanager/v1beta2/service_services_pb" + + # Create the configuration object + @config = Configuration.new Client.configure + + # Yield the configuration if needed + yield @config if block_given? + + # Create credentials + credentials = @config.credentials + # Use self-signed JWT if the endpoint is unchanged from default, + # but only if the default endpoint does not have a region prefix. + enable_self_signed_jwt = @config.endpoint.nil? || + (@config.endpoint == Configuration::DEFAULT_ENDPOINT && + !@config.endpoint.split(".").first.include?("-")) + credentials ||= Credentials.default scope: @config.scope, + enable_self_signed_jwt: enable_self_signed_jwt + if credentials.is_a?(::String) || credentials.is_a?(::Hash) + credentials = Credentials.new credentials, scope: @config.scope + end + @quota_project_id = @config.quota_project + @quota_project_id ||= credentials.quota_project_id if credentials.respond_to? :quota_project_id + + @secret_manager_service_stub = ::Gapic::ServiceStub.new( + ::Google::Cloud::SecretManager::V1beta2::SecretManagerService::Stub, + credentials: credentials, + endpoint: @config.endpoint, + endpoint_template: DEFAULT_ENDPOINT_TEMPLATE, + universe_domain: @config.universe_domain, + channel_args: @config.channel_args, + interceptors: @config.interceptors, + channel_pool_config: @config.channel_pool, + logger: @config.logger + ) + + @secret_manager_service_stub.stub_logger&.info do |entry| + entry.set_system_name + entry.set_service + entry.message = "Created client for #{entry.service}" + entry.set_credentials_fields credentials + entry.set "customEndpoint", @config.endpoint if @config.endpoint + entry.set "defaultTimeout", @config.timeout if @config.timeout + entry.set "quotaProject", @quota_project_id if @quota_project_id + end + + @location_client = Google::Cloud::Location::Locations::Client.new do |config| + config.credentials = credentials + config.quota_project = @quota_project_id + config.endpoint = @secret_manager_service_stub.endpoint + config.universe_domain = @secret_manager_service_stub.universe_domain + config.logger = @secret_manager_service_stub.logger if config.respond_to? :logger= + end + end + + ## + # Get the associated client for mix-in of the Locations. + # + # @return [Google::Cloud::Location::Locations::Client] + # + attr_reader :location_client + + ## + # The logger used for request/response debug logging. + # + # @return [Logger] + # + def logger + @secret_manager_service_stub.logger + end + + # Service calls + + ## + # Lists {::Google::Cloud::SecretManager::V1beta2::Secret Secrets}. + # + # @overload list_secrets(request, options = nil) + # Pass arguments to `list_secrets` via a request object, either of type + # {::Google::Cloud::SecretManager::V1beta2::ListSecretsRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::SecretManager::V1beta2::ListSecretsRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. + # + # @overload list_secrets(parent: nil, page_size: nil, page_token: nil, filter: nil) + # Pass arguments to `list_secrets` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param parent [::String] + # Required. The resource name of the project associated with the + # {::Google::Cloud::SecretManager::V1beta2::Secret Secrets}, in the format + # `projects/*` or `projects/*/locations/*` + # @param page_size [::Integer] + # Optional. The maximum number of results to be returned in a single page. If + # set to 0, the server decides the number of results to return. If the + # number is greater than 25000, it is capped at 25000. + # @param page_token [::String] + # Optional. Pagination token, returned earlier via + # {::Google::Cloud::SecretManager::V1beta2::ListSecretsResponse#next_page_token ListSecretsResponse.next_page_token}. + # @param filter [::String] + # Optional. Filter string, adhering to the rules in + # [List-operation + # filtering](https://cloud.google.com/secret-manager/docs/filtering). List + # only secrets matching the filter. If filter is empty, all secrets are + # listed. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Gapic::PagedEnumerable<::Google::Cloud::SecretManager::V1beta2::Secret>] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Gapic::PagedEnumerable<::Google::Cloud::SecretManager::V1beta2::Secret>] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/secret_manager/v1beta2" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::SecretManager::V1beta2::SecretManagerService::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::SecretManager::V1beta2::ListSecretsRequest.new + # + # # Call the list_secrets method. + # result = client.list_secrets request + # + # # The returned object is of type Gapic::PagedEnumerable. You can iterate + # # over elements, and API calls will be issued to fetch pages as needed. + # result.each do |item| + # # Each element is of type ::Google::Cloud::SecretManager::V1beta2::Secret. + # p item + # end + # + def list_secrets request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::SecretManager::V1beta2::ListSecretsRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + metadata = @config.rpcs.list_secrets.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::SecretManager::V1beta2::VERSION + metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.parent + header_params["parent"] = request.parent + end + + request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") + metadata[:"x-goog-request-params"] ||= request_params_header + + options.apply_defaults timeout: @config.rpcs.list_secrets.timeout, + metadata: metadata, + retry_policy: @config.rpcs.list_secrets.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @secret_manager_service_stub.call_rpc :list_secrets, request, options: options do |response, operation| + response = ::Gapic::PagedEnumerable.new @secret_manager_service_stub, :list_secrets, request, response, operation, options + yield response, operation if block_given? + throw :response, response + end + rescue ::GRPC::BadStatus => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Creates a new {::Google::Cloud::SecretManager::V1beta2::Secret Secret} + # containing no + # {::Google::Cloud::SecretManager::V1beta2::SecretVersion SecretVersions}. + # + # @overload create_secret(request, options = nil) + # Pass arguments to `create_secret` via a request object, either of type + # {::Google::Cloud::SecretManager::V1beta2::CreateSecretRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::SecretManager::V1beta2::CreateSecretRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. + # + # @overload create_secret(parent: nil, secret_id: nil, secret: nil) + # Pass arguments to `create_secret` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param parent [::String] + # Required. The resource name of the project to associate with the + # {::Google::Cloud::SecretManager::V1beta2::Secret Secret}, in the format + # `projects/*` or `projects/*/locations/*`. + # @param secret_id [::String] + # Required. This must be unique within the project. + # + # A secret ID is a string with a maximum length of 255 characters and can + # contain uppercase and lowercase letters, numerals, and the hyphen (`-`) and + # underscore (`_`) characters. + # @param secret [::Google::Cloud::SecretManager::V1beta2::Secret, ::Hash] + # Required. A {::Google::Cloud::SecretManager::V1beta2::Secret Secret} with + # initial field values. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Google::Cloud::SecretManager::V1beta2::Secret] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Google::Cloud::SecretManager::V1beta2::Secret] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/secret_manager/v1beta2" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::SecretManager::V1beta2::SecretManagerService::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::SecretManager::V1beta2::CreateSecretRequest.new + # + # # Call the create_secret method. + # result = client.create_secret request + # + # # The returned object is of type Google::Cloud::SecretManager::V1beta2::Secret. + # p result + # + def create_secret request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::SecretManager::V1beta2::CreateSecretRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + metadata = @config.rpcs.create_secret.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::SecretManager::V1beta2::VERSION + metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.parent + header_params["parent"] = request.parent + end + + request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") + metadata[:"x-goog-request-params"] ||= request_params_header + + options.apply_defaults timeout: @config.rpcs.create_secret.timeout, + metadata: metadata, + retry_policy: @config.rpcs.create_secret.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @secret_manager_service_stub.call_rpc :create_secret, request, options: options do |response, operation| + yield response, operation if block_given? + end + rescue ::GRPC::BadStatus => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Creates a new + # {::Google::Cloud::SecretManager::V1beta2::SecretVersion SecretVersion} + # containing secret data and attaches it to an existing + # {::Google::Cloud::SecretManager::V1beta2::Secret Secret}. + # + # @overload add_secret_version(request, options = nil) + # Pass arguments to `add_secret_version` via a request object, either of type + # {::Google::Cloud::SecretManager::V1beta2::AddSecretVersionRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::SecretManager::V1beta2::AddSecretVersionRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. + # + # @overload add_secret_version(parent: nil, payload: nil) + # Pass arguments to `add_secret_version` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param parent [::String] + # Required. The resource name of the + # {::Google::Cloud::SecretManager::V1beta2::Secret Secret} to associate with the + # {::Google::Cloud::SecretManager::V1beta2::SecretVersion SecretVersion} in the + # format `projects/*/secrets/*` or `projects/*/locations/*/secrets/*`. + # @param payload [::Google::Cloud::SecretManager::V1beta2::SecretPayload, ::Hash] + # Required. The secret payload of the + # {::Google::Cloud::SecretManager::V1beta2::SecretVersion SecretVersion}. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Google::Cloud::SecretManager::V1beta2::SecretVersion] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Google::Cloud::SecretManager::V1beta2::SecretVersion] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/secret_manager/v1beta2" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::SecretManager::V1beta2::SecretManagerService::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::SecretManager::V1beta2::AddSecretVersionRequest.new + # + # # Call the add_secret_version method. + # result = client.add_secret_version request + # + # # The returned object is of type Google::Cloud::SecretManager::V1beta2::SecretVersion. + # p result + # + def add_secret_version request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::SecretManager::V1beta2::AddSecretVersionRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + metadata = @config.rpcs.add_secret_version.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::SecretManager::V1beta2::VERSION + metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.parent + header_params["parent"] = request.parent + end + + request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") + metadata[:"x-goog-request-params"] ||= request_params_header + + options.apply_defaults timeout: @config.rpcs.add_secret_version.timeout, + metadata: metadata, + retry_policy: @config.rpcs.add_secret_version.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @secret_manager_service_stub.call_rpc :add_secret_version, request, options: options do |response, operation| + yield response, operation if block_given? + end + rescue ::GRPC::BadStatus => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Gets metadata for a given + # {::Google::Cloud::SecretManager::V1beta2::Secret Secret}. + # + # @overload get_secret(request, options = nil) + # Pass arguments to `get_secret` via a request object, either of type + # {::Google::Cloud::SecretManager::V1beta2::GetSecretRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::SecretManager::V1beta2::GetSecretRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. + # + # @overload get_secret(name: nil) + # Pass arguments to `get_secret` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param name [::String] + # Required. The resource name of the + # {::Google::Cloud::SecretManager::V1beta2::Secret Secret}, in the format + # `projects/*/secrets/*` or `projects/*/locations/*/secrets/*`. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Google::Cloud::SecretManager::V1beta2::Secret] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Google::Cloud::SecretManager::V1beta2::Secret] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/secret_manager/v1beta2" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::SecretManager::V1beta2::SecretManagerService::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::SecretManager::V1beta2::GetSecretRequest.new + # + # # Call the get_secret method. + # result = client.get_secret request + # + # # The returned object is of type Google::Cloud::SecretManager::V1beta2::Secret. + # p result + # + def get_secret request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::SecretManager::V1beta2::GetSecretRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + metadata = @config.rpcs.get_secret.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::SecretManager::V1beta2::VERSION + metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.name + header_params["name"] = request.name + end + + request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") + metadata[:"x-goog-request-params"] ||= request_params_header + + options.apply_defaults timeout: @config.rpcs.get_secret.timeout, + metadata: metadata, + retry_policy: @config.rpcs.get_secret.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @secret_manager_service_stub.call_rpc :get_secret, request, options: options do |response, operation| + yield response, operation if block_given? + end + rescue ::GRPC::BadStatus => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Updates metadata of an existing + # {::Google::Cloud::SecretManager::V1beta2::Secret Secret}. + # + # @overload update_secret(request, options = nil) + # Pass arguments to `update_secret` via a request object, either of type + # {::Google::Cloud::SecretManager::V1beta2::UpdateSecretRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::SecretManager::V1beta2::UpdateSecretRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. + # + # @overload update_secret(secret: nil, update_mask: nil) + # Pass arguments to `update_secret` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param secret [::Google::Cloud::SecretManager::V1beta2::Secret, ::Hash] + # Required. {::Google::Cloud::SecretManager::V1beta2::Secret Secret} with updated + # field values. + # @param update_mask [::Google::Protobuf::FieldMask, ::Hash] + # Required. Specifies the fields to be updated. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Google::Cloud::SecretManager::V1beta2::Secret] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Google::Cloud::SecretManager::V1beta2::Secret] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/secret_manager/v1beta2" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::SecretManager::V1beta2::SecretManagerService::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::SecretManager::V1beta2::UpdateSecretRequest.new + # + # # Call the update_secret method. + # result = client.update_secret request + # + # # The returned object is of type Google::Cloud::SecretManager::V1beta2::Secret. + # p result + # + def update_secret request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::SecretManager::V1beta2::UpdateSecretRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + metadata = @config.rpcs.update_secret.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::SecretManager::V1beta2::VERSION + metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.secret&.name + header_params["secret.name"] = request.secret.name + end + + request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") + metadata[:"x-goog-request-params"] ||= request_params_header + + options.apply_defaults timeout: @config.rpcs.update_secret.timeout, + metadata: metadata, + retry_policy: @config.rpcs.update_secret.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @secret_manager_service_stub.call_rpc :update_secret, request, options: options do |response, operation| + yield response, operation if block_given? + end + rescue ::GRPC::BadStatus => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Deletes a {::Google::Cloud::SecretManager::V1beta2::Secret Secret}. + # + # @overload delete_secret(request, options = nil) + # Pass arguments to `delete_secret` via a request object, either of type + # {::Google::Cloud::SecretManager::V1beta2::DeleteSecretRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::SecretManager::V1beta2::DeleteSecretRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. + # + # @overload delete_secret(name: nil, etag: nil) + # Pass arguments to `delete_secret` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param name [::String] + # Required. The resource name of the + # {::Google::Cloud::SecretManager::V1beta2::Secret Secret} to delete in the format + # `projects/*/secrets/*`. + # @param etag [::String] + # Optional. Etag of the {::Google::Cloud::SecretManager::V1beta2::Secret Secret}. + # The request succeeds if it matches the etag of the currently stored secret + # object. If the etag is omitted, the request succeeds. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Google::Protobuf::Empty] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Google::Protobuf::Empty] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/secret_manager/v1beta2" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::SecretManager::V1beta2::SecretManagerService::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::SecretManager::V1beta2::DeleteSecretRequest.new + # + # # Call the delete_secret method. + # result = client.delete_secret request + # + # # The returned object is of type Google::Protobuf::Empty. + # p result + # + def delete_secret request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::SecretManager::V1beta2::DeleteSecretRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + metadata = @config.rpcs.delete_secret.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::SecretManager::V1beta2::VERSION + metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.name + header_params["name"] = request.name + end + + request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") + metadata[:"x-goog-request-params"] ||= request_params_header + + options.apply_defaults timeout: @config.rpcs.delete_secret.timeout, + metadata: metadata, + retry_policy: @config.rpcs.delete_secret.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @secret_manager_service_stub.call_rpc :delete_secret, request, options: options do |response, operation| + yield response, operation if block_given? + end + rescue ::GRPC::BadStatus => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Lists {::Google::Cloud::SecretManager::V1beta2::SecretVersion SecretVersions}. + # This call does not return secret data. + # + # @overload list_secret_versions(request, options = nil) + # Pass arguments to `list_secret_versions` via a request object, either of type + # {::Google::Cloud::SecretManager::V1beta2::ListSecretVersionsRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::SecretManager::V1beta2::ListSecretVersionsRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. + # + # @overload list_secret_versions(parent: nil, page_size: nil, page_token: nil, filter: nil) + # Pass arguments to `list_secret_versions` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param parent [::String] + # Required. The resource name of the + # {::Google::Cloud::SecretManager::V1beta2::Secret Secret} associated with the + # {::Google::Cloud::SecretManager::V1beta2::SecretVersion SecretVersions} to list, + # in the format `projects/*/secrets/*` or `projects/*/locations/*/secrets/*`. + # @param page_size [::Integer] + # Optional. The maximum number of results to be returned in a single page. If + # set to 0, the server decides the number of results to return. If the + # number is greater than 25000, it is capped at 25000. + # @param page_token [::String] + # Optional. Pagination token, returned earlier via + # ListSecretVersionsResponse.next_page_token][]. + # @param filter [::String] + # Optional. Filter string, adhering to the rules in + # [List-operation + # filtering](https://cloud.google.com/secret-manager/docs/filtering). List + # only secret versions matching the filter. If filter is empty, all secret + # versions are listed. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Gapic::PagedEnumerable<::Google::Cloud::SecretManager::V1beta2::SecretVersion>] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Gapic::PagedEnumerable<::Google::Cloud::SecretManager::V1beta2::SecretVersion>] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/secret_manager/v1beta2" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::SecretManager::V1beta2::SecretManagerService::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::SecretManager::V1beta2::ListSecretVersionsRequest.new + # + # # Call the list_secret_versions method. + # result = client.list_secret_versions request + # + # # The returned object is of type Gapic::PagedEnumerable. You can iterate + # # over elements, and API calls will be issued to fetch pages as needed. + # result.each do |item| + # # Each element is of type ::Google::Cloud::SecretManager::V1beta2::SecretVersion. + # p item + # end + # + def list_secret_versions request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::SecretManager::V1beta2::ListSecretVersionsRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + metadata = @config.rpcs.list_secret_versions.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::SecretManager::V1beta2::VERSION + metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.parent + header_params["parent"] = request.parent + end + + request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") + metadata[:"x-goog-request-params"] ||= request_params_header + + options.apply_defaults timeout: @config.rpcs.list_secret_versions.timeout, + metadata: metadata, + retry_policy: @config.rpcs.list_secret_versions.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @secret_manager_service_stub.call_rpc :list_secret_versions, request, options: options do |response, operation| + response = ::Gapic::PagedEnumerable.new @secret_manager_service_stub, :list_secret_versions, request, response, operation, options + yield response, operation if block_given? + throw :response, response + end + rescue ::GRPC::BadStatus => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Gets metadata for a + # {::Google::Cloud::SecretManager::V1beta2::SecretVersion SecretVersion}. + # + # `projects/*/secrets/*/versions/latest` is an alias to the most recently + # created {::Google::Cloud::SecretManager::V1beta2::SecretVersion SecretVersion}. + # + # @overload get_secret_version(request, options = nil) + # Pass arguments to `get_secret_version` via a request object, either of type + # {::Google::Cloud::SecretManager::V1beta2::GetSecretVersionRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::SecretManager::V1beta2::GetSecretVersionRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. + # + # @overload get_secret_version(name: nil) + # Pass arguments to `get_secret_version` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param name [::String] + # Required. The resource name of the + # {::Google::Cloud::SecretManager::V1beta2::SecretVersion SecretVersion} in the + # format `projects/*/secrets/*/versions/*` or + # `projects/*/locations/*/secrets/*/versions/*`. + # + # `projects/*/secrets/*/versions/latest` or + # `projects/*/locations/*/secrets/*/versions/latest` is an alias to the most + # recently created + # {::Google::Cloud::SecretManager::V1beta2::SecretVersion SecretVersion}. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Google::Cloud::SecretManager::V1beta2::SecretVersion] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Google::Cloud::SecretManager::V1beta2::SecretVersion] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/secret_manager/v1beta2" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::SecretManager::V1beta2::SecretManagerService::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::SecretManager::V1beta2::GetSecretVersionRequest.new + # + # # Call the get_secret_version method. + # result = client.get_secret_version request + # + # # The returned object is of type Google::Cloud::SecretManager::V1beta2::SecretVersion. + # p result + # + def get_secret_version request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::SecretManager::V1beta2::GetSecretVersionRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + metadata = @config.rpcs.get_secret_version.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::SecretManager::V1beta2::VERSION + metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.name + header_params["name"] = request.name + end + + request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") + metadata[:"x-goog-request-params"] ||= request_params_header + + options.apply_defaults timeout: @config.rpcs.get_secret_version.timeout, + metadata: metadata, + retry_policy: @config.rpcs.get_secret_version.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @secret_manager_service_stub.call_rpc :get_secret_version, request, options: options do |response, operation| + yield response, operation if block_given? + end + rescue ::GRPC::BadStatus => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Accesses a + # {::Google::Cloud::SecretManager::V1beta2::SecretVersion SecretVersion}. This + # call returns the secret data. + # + # `projects/*/secrets/*/versions/latest` is an alias to the most recently + # created {::Google::Cloud::SecretManager::V1beta2::SecretVersion SecretVersion}. + # + # @overload access_secret_version(request, options = nil) + # Pass arguments to `access_secret_version` via a request object, either of type + # {::Google::Cloud::SecretManager::V1beta2::AccessSecretVersionRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::SecretManager::V1beta2::AccessSecretVersionRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. + # + # @overload access_secret_version(name: nil) + # Pass arguments to `access_secret_version` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param name [::String] + # Required. The resource name of the + # {::Google::Cloud::SecretManager::V1beta2::SecretVersion SecretVersion} in the + # format `projects/*/secrets/*/versions/*` or + # `projects/*/locations/*/secrets/*/versions/*`. + # + # `projects/*/secrets/*/versions/latest` or + # `projects/*/locations/*/secrets/*/versions/latest` is an alias to the most + # recently created + # {::Google::Cloud::SecretManager::V1beta2::SecretVersion SecretVersion}. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Google::Cloud::SecretManager::V1beta2::AccessSecretVersionResponse] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Google::Cloud::SecretManager::V1beta2::AccessSecretVersionResponse] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/secret_manager/v1beta2" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::SecretManager::V1beta2::SecretManagerService::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::SecretManager::V1beta2::AccessSecretVersionRequest.new + # + # # Call the access_secret_version method. + # result = client.access_secret_version request + # + # # The returned object is of type Google::Cloud::SecretManager::V1beta2::AccessSecretVersionResponse. + # p result + # + def access_secret_version request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::SecretManager::V1beta2::AccessSecretVersionRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + metadata = @config.rpcs.access_secret_version.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::SecretManager::V1beta2::VERSION + metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.name + header_params["name"] = request.name + end + + request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") + metadata[:"x-goog-request-params"] ||= request_params_header + + options.apply_defaults timeout: @config.rpcs.access_secret_version.timeout, + metadata: metadata, + retry_policy: @config.rpcs.access_secret_version.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @secret_manager_service_stub.call_rpc :access_secret_version, request, options: options do |response, operation| + yield response, operation if block_given? + end + rescue ::GRPC::BadStatus => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Disables a + # {::Google::Cloud::SecretManager::V1beta2::SecretVersion SecretVersion}. + # + # Sets the {::Google::Cloud::SecretManager::V1beta2::SecretVersion#state state} of + # the {::Google::Cloud::SecretManager::V1beta2::SecretVersion SecretVersion} to + # {::Google::Cloud::SecretManager::V1beta2::SecretVersion::State::DISABLED DISABLED}. + # + # @overload disable_secret_version(request, options = nil) + # Pass arguments to `disable_secret_version` via a request object, either of type + # {::Google::Cloud::SecretManager::V1beta2::DisableSecretVersionRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::SecretManager::V1beta2::DisableSecretVersionRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. + # + # @overload disable_secret_version(name: nil, etag: nil) + # Pass arguments to `disable_secret_version` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param name [::String] + # Required. The resource name of the + # {::Google::Cloud::SecretManager::V1beta2::SecretVersion SecretVersion} to + # disable in the format `projects/*/secrets/*/versions/*` or + # `projects/*/locations/*/secrets/*/versions/*`. + # @param etag [::String] + # Optional. Etag of the + # {::Google::Cloud::SecretManager::V1beta2::SecretVersion SecretVersion}. The + # request succeeds if it matches the etag of the currently stored secret + # version object. If the etag is omitted, the request succeeds. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Google::Cloud::SecretManager::V1beta2::SecretVersion] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Google::Cloud::SecretManager::V1beta2::SecretVersion] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/secret_manager/v1beta2" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::SecretManager::V1beta2::SecretManagerService::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::SecretManager::V1beta2::DisableSecretVersionRequest.new + # + # # Call the disable_secret_version method. + # result = client.disable_secret_version request + # + # # The returned object is of type Google::Cloud::SecretManager::V1beta2::SecretVersion. + # p result + # + def disable_secret_version request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::SecretManager::V1beta2::DisableSecretVersionRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + metadata = @config.rpcs.disable_secret_version.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::SecretManager::V1beta2::VERSION + metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.name + header_params["name"] = request.name + end + + request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") + metadata[:"x-goog-request-params"] ||= request_params_header + + options.apply_defaults timeout: @config.rpcs.disable_secret_version.timeout, + metadata: metadata, + retry_policy: @config.rpcs.disable_secret_version.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @secret_manager_service_stub.call_rpc :disable_secret_version, request, options: options do |response, operation| + yield response, operation if block_given? + end + rescue ::GRPC::BadStatus => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Enables a + # {::Google::Cloud::SecretManager::V1beta2::SecretVersion SecretVersion}. + # + # Sets the {::Google::Cloud::SecretManager::V1beta2::SecretVersion#state state} of + # the {::Google::Cloud::SecretManager::V1beta2::SecretVersion SecretVersion} to + # {::Google::Cloud::SecretManager::V1beta2::SecretVersion::State::ENABLED ENABLED}. + # + # @overload enable_secret_version(request, options = nil) + # Pass arguments to `enable_secret_version` via a request object, either of type + # {::Google::Cloud::SecretManager::V1beta2::EnableSecretVersionRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::SecretManager::V1beta2::EnableSecretVersionRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. + # + # @overload enable_secret_version(name: nil, etag: nil) + # Pass arguments to `enable_secret_version` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param name [::String] + # Required. The resource name of the + # {::Google::Cloud::SecretManager::V1beta2::SecretVersion SecretVersion} to enable + # in the format `projects/*/secrets/*/versions/*` or + # `projects/*/locations/*/secrets/*/versions/*`. + # @param etag [::String] + # Optional. Etag of the + # {::Google::Cloud::SecretManager::V1beta2::SecretVersion SecretVersion}. The + # request succeeds if it matches the etag of the currently stored secret + # version object. If the etag is omitted, the request succeeds. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Google::Cloud::SecretManager::V1beta2::SecretVersion] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Google::Cloud::SecretManager::V1beta2::SecretVersion] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/secret_manager/v1beta2" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::SecretManager::V1beta2::SecretManagerService::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::SecretManager::V1beta2::EnableSecretVersionRequest.new + # + # # Call the enable_secret_version method. + # result = client.enable_secret_version request + # + # # The returned object is of type Google::Cloud::SecretManager::V1beta2::SecretVersion. + # p result + # + def enable_secret_version request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::SecretManager::V1beta2::EnableSecretVersionRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + metadata = @config.rpcs.enable_secret_version.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::SecretManager::V1beta2::VERSION + metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.name + header_params["name"] = request.name + end + + request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") + metadata[:"x-goog-request-params"] ||= request_params_header + + options.apply_defaults timeout: @config.rpcs.enable_secret_version.timeout, + metadata: metadata, + retry_policy: @config.rpcs.enable_secret_version.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @secret_manager_service_stub.call_rpc :enable_secret_version, request, options: options do |response, operation| + yield response, operation if block_given? + end + rescue ::GRPC::BadStatus => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Destroys a + # {::Google::Cloud::SecretManager::V1beta2::SecretVersion SecretVersion}. + # + # Sets the {::Google::Cloud::SecretManager::V1beta2::SecretVersion#state state} of + # the {::Google::Cloud::SecretManager::V1beta2::SecretVersion SecretVersion} to + # {::Google::Cloud::SecretManager::V1beta2::SecretVersion::State::DESTROYED DESTROYED} + # and irrevocably destroys the secret data. + # + # @overload destroy_secret_version(request, options = nil) + # Pass arguments to `destroy_secret_version` via a request object, either of type + # {::Google::Cloud::SecretManager::V1beta2::DestroySecretVersionRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::SecretManager::V1beta2::DestroySecretVersionRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. + # + # @overload destroy_secret_version(name: nil, etag: nil) + # Pass arguments to `destroy_secret_version` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param name [::String] + # Required. The resource name of the + # {::Google::Cloud::SecretManager::V1beta2::SecretVersion SecretVersion} to + # destroy in the format `projects/*/secrets/*/versions/*` or + # `projects/*/locations/*/secrets/*/versions/*`. + # @param etag [::String] + # Optional. Etag of the + # {::Google::Cloud::SecretManager::V1beta2::SecretVersion SecretVersion}. The + # request succeeds if it matches the etag of the currently stored secret + # version object. If the etag is omitted, the request succeeds. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Google::Cloud::SecretManager::V1beta2::SecretVersion] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Google::Cloud::SecretManager::V1beta2::SecretVersion] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/secret_manager/v1beta2" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::SecretManager::V1beta2::SecretManagerService::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::SecretManager::V1beta2::DestroySecretVersionRequest.new + # + # # Call the destroy_secret_version method. + # result = client.destroy_secret_version request + # + # # The returned object is of type Google::Cloud::SecretManager::V1beta2::SecretVersion. + # p result + # + def destroy_secret_version request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::SecretManager::V1beta2::DestroySecretVersionRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + metadata = @config.rpcs.destroy_secret_version.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::SecretManager::V1beta2::VERSION + metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.name + header_params["name"] = request.name + end + + request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") + metadata[:"x-goog-request-params"] ||= request_params_header + + options.apply_defaults timeout: @config.rpcs.destroy_secret_version.timeout, + metadata: metadata, + retry_policy: @config.rpcs.destroy_secret_version.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @secret_manager_service_stub.call_rpc :destroy_secret_version, request, options: options do |response, operation| + yield response, operation if block_given? + end + rescue ::GRPC::BadStatus => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Sets the access control policy on the specified secret. Replaces any + # existing policy. + # + # Permissions on + # {::Google::Cloud::SecretManager::V1beta2::SecretVersion SecretVersions} are + # enforced according to the policy set on the associated + # {::Google::Cloud::SecretManager::V1beta2::Secret Secret}. + # + # @overload set_iam_policy(request, options = nil) + # Pass arguments to `set_iam_policy` via a request object, either of type + # {::Google::Iam::V1::SetIamPolicyRequest} or an equivalent Hash. + # + # @param request [::Google::Iam::V1::SetIamPolicyRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. + # + # @overload set_iam_policy(resource: nil, policy: nil, update_mask: nil) + # Pass arguments to `set_iam_policy` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param resource [::String] + # REQUIRED: The resource for which the policy is being specified. + # See the operation documentation for the appropriate value for this field. + # @param policy [::Google::Iam::V1::Policy, ::Hash] + # REQUIRED: The complete policy to be applied to the `resource`. The size of + # the policy is limited to a few 10s of KB. An empty policy is a + # valid policy but certain Cloud Platform services (such as Projects) + # might reject them. + # @param update_mask [::Google::Protobuf::FieldMask, ::Hash] + # OPTIONAL: A FieldMask specifying which fields of the policy to modify. Only + # the fields in the mask will be modified. If no mask is provided, the + # following default mask is used: + # + # `paths: "bindings, etag"` + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Google::Iam::V1::Policy] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Google::Iam::V1::Policy] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/secret_manager/v1beta2" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::SecretManager::V1beta2::SecretManagerService::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Iam::V1::SetIamPolicyRequest.new + # + # # Call the set_iam_policy method. + # result = client.set_iam_policy request + # + # # The returned object is of type Google::Iam::V1::Policy. + # p result + # + def set_iam_policy request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Iam::V1::SetIamPolicyRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + metadata = @config.rpcs.set_iam_policy.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::SecretManager::V1beta2::VERSION + metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.resource + header_params["resource"] = request.resource + end + + request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") + metadata[:"x-goog-request-params"] ||= request_params_header + + options.apply_defaults timeout: @config.rpcs.set_iam_policy.timeout, + metadata: metadata, + retry_policy: @config.rpcs.set_iam_policy.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @secret_manager_service_stub.call_rpc :set_iam_policy, request, options: options do |response, operation| + yield response, operation if block_given? + end + rescue ::GRPC::BadStatus => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Gets the access control policy for a secret. + # Returns empty policy if the secret exists and does not have a policy set. + # + # @overload get_iam_policy(request, options = nil) + # Pass arguments to `get_iam_policy` via a request object, either of type + # {::Google::Iam::V1::GetIamPolicyRequest} or an equivalent Hash. + # + # @param request [::Google::Iam::V1::GetIamPolicyRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. + # + # @overload get_iam_policy(resource: nil, options: nil) + # Pass arguments to `get_iam_policy` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param resource [::String] + # REQUIRED: The resource for which the policy is being requested. + # See the operation documentation for the appropriate value for this field. + # @param options [::Google::Iam::V1::GetPolicyOptions, ::Hash] + # OPTIONAL: A `GetPolicyOptions` object for specifying options to + # `GetIamPolicy`. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Google::Iam::V1::Policy] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Google::Iam::V1::Policy] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/secret_manager/v1beta2" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::SecretManager::V1beta2::SecretManagerService::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Iam::V1::GetIamPolicyRequest.new + # + # # Call the get_iam_policy method. + # result = client.get_iam_policy request + # + # # The returned object is of type Google::Iam::V1::Policy. + # p result + # + def get_iam_policy request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Iam::V1::GetIamPolicyRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + metadata = @config.rpcs.get_iam_policy.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::SecretManager::V1beta2::VERSION + metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.resource + header_params["resource"] = request.resource + end + + request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") + metadata[:"x-goog-request-params"] ||= request_params_header + + options.apply_defaults timeout: @config.rpcs.get_iam_policy.timeout, + metadata: metadata, + retry_policy: @config.rpcs.get_iam_policy.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @secret_manager_service_stub.call_rpc :get_iam_policy, request, options: options do |response, operation| + yield response, operation if block_given? + end + rescue ::GRPC::BadStatus => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Returns permissions that a caller has for the specified secret. + # If the secret does not exist, this call returns an empty set of + # permissions, not a NOT_FOUND error. + # + # Note: This operation is designed to be used for building permission-aware + # UIs and command-line tools, not for authorization checking. This operation + # may "fail open" without warning. + # + # @overload test_iam_permissions(request, options = nil) + # Pass arguments to `test_iam_permissions` via a request object, either of type + # {::Google::Iam::V1::TestIamPermissionsRequest} or an equivalent Hash. + # + # @param request [::Google::Iam::V1::TestIamPermissionsRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. + # + # @overload test_iam_permissions(resource: nil, permissions: nil) + # Pass arguments to `test_iam_permissions` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param resource [::String] + # REQUIRED: The resource for which the policy detail is being requested. + # See the operation documentation for the appropriate value for this field. + # @param permissions [::Array<::String>] + # The set of permissions to check for the `resource`. Permissions with + # wildcards (such as '*' or 'storage.*') are not allowed. For more + # information see + # [IAM Overview](https://cloud.google.com/iam/docs/overview#permissions). + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Google::Iam::V1::TestIamPermissionsResponse] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Google::Iam::V1::TestIamPermissionsResponse] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/secret_manager/v1beta2" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::SecretManager::V1beta2::SecretManagerService::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Iam::V1::TestIamPermissionsRequest.new + # + # # Call the test_iam_permissions method. + # result = client.test_iam_permissions request + # + # # The returned object is of type Google::Iam::V1::TestIamPermissionsResponse. + # p result + # + def test_iam_permissions request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Iam::V1::TestIamPermissionsRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + metadata = @config.rpcs.test_iam_permissions.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::SecretManager::V1beta2::VERSION + metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.resource + header_params["resource"] = request.resource + end + + request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") + metadata[:"x-goog-request-params"] ||= request_params_header + + options.apply_defaults timeout: @config.rpcs.test_iam_permissions.timeout, + metadata: metadata, + retry_policy: @config.rpcs.test_iam_permissions.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @secret_manager_service_stub.call_rpc :test_iam_permissions, request, options: options do |response, operation| + yield response, operation if block_given? + end + rescue ::GRPC::BadStatus => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Configuration class for the SecretManagerService API. + # + # This class represents the configuration for SecretManagerService, + # providing control over timeouts, retry behavior, logging, transport + # parameters, and other low-level controls. Certain parameters can also be + # applied individually to specific RPCs. See + # {::Google::Cloud::SecretManager::V1beta2::SecretManagerService::Client::Configuration::Rpcs} + # for a list of RPCs that can be configured independently. + # + # Configuration can be applied globally to all clients, or to a single client + # on construction. + # + # @example + # + # # Modify the global config, setting the timeout for + # # list_secrets to 20 seconds, + # # and all remaining timeouts to 10 seconds. + # ::Google::Cloud::SecretManager::V1beta2::SecretManagerService::Client.configure do |config| + # config.timeout = 10.0 + # config.rpcs.list_secrets.timeout = 20.0 + # end + # + # # Apply the above configuration only to a new client. + # client = ::Google::Cloud::SecretManager::V1beta2::SecretManagerService::Client.new do |config| + # config.timeout = 10.0 + # config.rpcs.list_secrets.timeout = 20.0 + # end + # + # @!attribute [rw] endpoint + # A custom service endpoint, as a hostname or hostname:port. The default is + # nil, indicating to use the default endpoint in the current universe domain. + # @return [::String,nil] + # @!attribute [rw] credentials + # Credentials to send with calls. You may provide any of the following types: + # * (`Google::Auth::Credentials`) A googleauth credentials object + # (see the [googleauth docs](https://rubydoc.info/gems/googleauth/Google/Auth/Credentials)) + # * (`Signet::OAuth2::Client`) A signet oauth2 client object + # (see the [signet docs](https://rubydoc.info/gems/signet/Signet/OAuth2/Client)) + # * (`GRPC::Core::Channel`) a gRPC channel with included credentials + # * (`GRPC::Core::ChannelCredentials`) a gRPC credentails object + # * (`nil`) indicating no credentials + # + # @note Warning: Passing a `String` to a keyfile path or a `Hash` of credentials + # is deprecated. Providing an unvalidated credential configuration to + # Google APIs can compromise the security of your systems and data. + # + # @example + # + # # The recommended way to provide credentials is to use the `make_creds` method + # # on the appropriate credentials class for your environment. + # + # require "googleauth" + # + # credentials = ::Google::Auth::ServiceAccountCredentials.make_creds( + # json_key_io: ::File.open("/path/to/keyfile.json") + # ) + # + # client = ::Google::Cloud::SecretManager::V1beta2::SecretManagerService::Client.new do |config| + # config.credentials = credentials + # end + # + # @note Warning: If you accept a credential configuration (JSON file or Hash) from an + # external source for authentication to Google Cloud, you must validate it before + # providing it to a Google API client library. Providing an unvalidated credential + # configuration to Google APIs can compromise the security of your systems and data. + # For more information, refer to [Validate credential configurations from external + # sources](https://cloud.google.com/docs/authentication/external/externally-sourced-credentials). + # @return [::Object] + # @!attribute [rw] scope + # The OAuth scopes + # @return [::Array<::String>] + # @!attribute [rw] lib_name + # The library name as recorded in instrumentation and logging + # @return [::String] + # @!attribute [rw] lib_version + # The library version as recorded in instrumentation and logging + # @return [::String] + # @!attribute [rw] channel_args + # Extra parameters passed to the gRPC channel. Note: this is ignored if a + # `GRPC::Core::Channel` object is provided as the credential. + # @return [::Hash] + # @!attribute [rw] interceptors + # An array of interceptors that are run before calls are executed. + # @return [::Array<::GRPC::ClientInterceptor>] + # @!attribute [rw] timeout + # The call timeout in seconds. + # @return [::Numeric] + # @!attribute [rw] metadata + # Additional gRPC headers to be sent with the call. + # @return [::Hash{::Symbol=>::String}] + # @!attribute [rw] retry_policy + # The retry policy. The value is a hash with the following keys: + # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds. + # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds. + # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier. + # * `:retry_codes` (*type:* `Array`) - The error codes that should + # trigger a retry. + # @return [::Hash] + # @!attribute [rw] quota_project + # A separate project against which to charge quota. + # @return [::String] + # @!attribute [rw] universe_domain + # The universe domain within which to make requests. This determines the + # default endpoint URL. The default value of nil uses the environment + # universe (usually the default "googleapis.com" universe). + # @return [::String,nil] + # @!attribute [rw] logger + # A custom logger to use for request/response debug logging, or the value + # `:default` (the default) to construct a default logger, or `nil` to + # explicitly disable logging. + # @return [::Logger,:default,nil] + # + class Configuration + extend ::Gapic::Config + + # @private + # The endpoint specific to the default "googleapis.com" universe. Deprecated. + DEFAULT_ENDPOINT = "secretmanager.googleapis.com" + + config_attr :endpoint, nil, ::String, nil + config_attr :credentials, nil do |value| + allowed = [::String, ::Hash, ::Proc, ::Symbol, ::Google::Auth::Credentials, ::Google::Auth::BaseClient, ::Signet::OAuth2::Client, nil] + allowed += [::GRPC::Core::Channel, ::GRPC::Core::ChannelCredentials] if defined? ::GRPC::Core::Channel + allowed.any? { |klass| klass === value } + end + config_attr :scope, nil, ::String, ::Array, nil + config_attr :lib_name, nil, ::String, nil + config_attr :lib_version, nil, ::String, nil + config_attr(:channel_args, { "grpc.service_config_disable_resolution" => 1 }, ::Hash, nil) + config_attr :interceptors, nil, ::Array, nil + config_attr :timeout, nil, ::Numeric, nil + config_attr :metadata, nil, ::Hash, nil + config_attr :retry_policy, nil, ::Hash, ::Proc, nil + config_attr :quota_project, nil, ::String, nil + config_attr :universe_domain, nil, ::String, nil + config_attr :logger, :default, ::Logger, nil, :default + + # @private + def initialize parent_config = nil + @parent_config = parent_config unless parent_config.nil? + + yield self if block_given? + end + + ## + # Configurations for individual RPCs + # @return [Rpcs] + # + def rpcs + @rpcs ||= begin + parent_rpcs = nil + parent_rpcs = @parent_config.rpcs if defined?(@parent_config) && @parent_config.respond_to?(:rpcs) + Rpcs.new parent_rpcs + end + end + + ## + # Configuration for the channel pool + # @return [::Gapic::ServiceStub::ChannelPool::Configuration] + # + def channel_pool + @channel_pool ||= ::Gapic::ServiceStub::ChannelPool::Configuration.new + end + + ## + # Configuration RPC class for the SecretManagerService API. + # + # Includes fields providing the configuration for each RPC in this service. + # Each configuration object is of type `Gapic::Config::Method` and includes + # the following configuration fields: + # + # * `timeout` (*type:* `Numeric`) - The call timeout in seconds + # * `metadata` (*type:* `Hash{Symbol=>String}`) - Additional gRPC headers + # * `retry_policy (*type:* `Hash`) - The retry policy. The policy fields + # include the following keys: + # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds. + # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds. + # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier. + # * `:retry_codes` (*type:* `Array`) - The error codes that should + # trigger a retry. + # + class Rpcs + ## + # RPC-specific configuration for `list_secrets` + # @return [::Gapic::Config::Method] + # + attr_reader :list_secrets + ## + # RPC-specific configuration for `create_secret` + # @return [::Gapic::Config::Method] + # + attr_reader :create_secret + ## + # RPC-specific configuration for `add_secret_version` + # @return [::Gapic::Config::Method] + # + attr_reader :add_secret_version + ## + # RPC-specific configuration for `get_secret` + # @return [::Gapic::Config::Method] + # + attr_reader :get_secret + ## + # RPC-specific configuration for `update_secret` + # @return [::Gapic::Config::Method] + # + attr_reader :update_secret + ## + # RPC-specific configuration for `delete_secret` + # @return [::Gapic::Config::Method] + # + attr_reader :delete_secret + ## + # RPC-specific configuration for `list_secret_versions` + # @return [::Gapic::Config::Method] + # + attr_reader :list_secret_versions + ## + # RPC-specific configuration for `get_secret_version` + # @return [::Gapic::Config::Method] + # + attr_reader :get_secret_version + ## + # RPC-specific configuration for `access_secret_version` + # @return [::Gapic::Config::Method] + # + attr_reader :access_secret_version + ## + # RPC-specific configuration for `disable_secret_version` + # @return [::Gapic::Config::Method] + # + attr_reader :disable_secret_version + ## + # RPC-specific configuration for `enable_secret_version` + # @return [::Gapic::Config::Method] + # + attr_reader :enable_secret_version + ## + # RPC-specific configuration for `destroy_secret_version` + # @return [::Gapic::Config::Method] + # + attr_reader :destroy_secret_version + ## + # RPC-specific configuration for `set_iam_policy` + # @return [::Gapic::Config::Method] + # + attr_reader :set_iam_policy + ## + # RPC-specific configuration for `get_iam_policy` + # @return [::Gapic::Config::Method] + # + attr_reader :get_iam_policy + ## + # RPC-specific configuration for `test_iam_permissions` + # @return [::Gapic::Config::Method] + # + attr_reader :test_iam_permissions + + # @private + def initialize parent_rpcs = nil + list_secrets_config = parent_rpcs.list_secrets if parent_rpcs.respond_to? :list_secrets + @list_secrets = ::Gapic::Config::Method.new list_secrets_config + create_secret_config = parent_rpcs.create_secret if parent_rpcs.respond_to? :create_secret + @create_secret = ::Gapic::Config::Method.new create_secret_config + add_secret_version_config = parent_rpcs.add_secret_version if parent_rpcs.respond_to? :add_secret_version + @add_secret_version = ::Gapic::Config::Method.new add_secret_version_config + get_secret_config = parent_rpcs.get_secret if parent_rpcs.respond_to? :get_secret + @get_secret = ::Gapic::Config::Method.new get_secret_config + update_secret_config = parent_rpcs.update_secret if parent_rpcs.respond_to? :update_secret + @update_secret = ::Gapic::Config::Method.new update_secret_config + delete_secret_config = parent_rpcs.delete_secret if parent_rpcs.respond_to? :delete_secret + @delete_secret = ::Gapic::Config::Method.new delete_secret_config + list_secret_versions_config = parent_rpcs.list_secret_versions if parent_rpcs.respond_to? :list_secret_versions + @list_secret_versions = ::Gapic::Config::Method.new list_secret_versions_config + get_secret_version_config = parent_rpcs.get_secret_version if parent_rpcs.respond_to? :get_secret_version + @get_secret_version = ::Gapic::Config::Method.new get_secret_version_config + access_secret_version_config = parent_rpcs.access_secret_version if parent_rpcs.respond_to? :access_secret_version + @access_secret_version = ::Gapic::Config::Method.new access_secret_version_config + disable_secret_version_config = parent_rpcs.disable_secret_version if parent_rpcs.respond_to? :disable_secret_version + @disable_secret_version = ::Gapic::Config::Method.new disable_secret_version_config + enable_secret_version_config = parent_rpcs.enable_secret_version if parent_rpcs.respond_to? :enable_secret_version + @enable_secret_version = ::Gapic::Config::Method.new enable_secret_version_config + destroy_secret_version_config = parent_rpcs.destroy_secret_version if parent_rpcs.respond_to? :destroy_secret_version + @destroy_secret_version = ::Gapic::Config::Method.new destroy_secret_version_config + set_iam_policy_config = parent_rpcs.set_iam_policy if parent_rpcs.respond_to? :set_iam_policy + @set_iam_policy = ::Gapic::Config::Method.new set_iam_policy_config + get_iam_policy_config = parent_rpcs.get_iam_policy if parent_rpcs.respond_to? :get_iam_policy + @get_iam_policy = ::Gapic::Config::Method.new get_iam_policy_config + test_iam_permissions_config = parent_rpcs.test_iam_permissions if parent_rpcs.respond_to? :test_iam_permissions + @test_iam_permissions = ::Gapic::Config::Method.new test_iam_permissions_config + + yield self if block_given? + end + end + end + end + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-secret_manager-v1beta2/lib/google/cloud/secret_manager/v1beta2/secret_manager_service/credentials.rb b/owl-bot-staging/google-cloud-secret_manager-v1beta2/lib/google/cloud/secret_manager/v1beta2/secret_manager_service/credentials.rb new file mode 100644 index 000000000000..42d6ada8e23f --- /dev/null +++ b/owl-bot-staging/google-cloud-secret_manager-v1beta2/lib/google/cloud/secret_manager/v1beta2/secret_manager_service/credentials.rb @@ -0,0 +1,51 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +require "googleauth" + +module Google + module Cloud + module SecretManager + module V1beta2 + module SecretManagerService + # Credentials for the SecretManagerService API. + class Credentials < ::Google::Auth::Credentials + self.scope = [ + "https://www.googleapis.com/auth/cloud-platform" + ] + self.env_vars = [ + "SECRET_MANAGER_CREDENTIALS", + "SECRET_MANAGER_KEYFILE", + "GOOGLE_CLOUD_CREDENTIALS", + "GOOGLE_CLOUD_KEYFILE", + "GCLOUD_KEYFILE", + "SECRET_MANAGER_CREDENTIALS_JSON", + "SECRET_MANAGER_KEYFILE_JSON", + "GOOGLE_CLOUD_CREDENTIALS_JSON", + "GOOGLE_CLOUD_KEYFILE_JSON", + "GCLOUD_KEYFILE_JSON" + ] + self.paths = [ + "~/.config/google_cloud/application_default_credentials.json" + ] + end + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-secret_manager-v1beta2/lib/google/cloud/secret_manager/v1beta2/secret_manager_service/paths.rb b/owl-bot-staging/google-cloud-secret_manager-v1beta2/lib/google/cloud/secret_manager/v1beta2/secret_manager_service/paths.rb new file mode 100644 index 000000000000..a3810d469c8f --- /dev/null +++ b/owl-bot-staging/google-cloud-secret_manager-v1beta2/lib/google/cloud/secret_manager/v1beta2/secret_manager_service/paths.rb @@ -0,0 +1,167 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + + +module Google + module Cloud + module SecretManager + module V1beta2 + module SecretManagerService + # Path helper methods for the SecretManagerService API. + module Paths + ## + # Create a fully-qualified Location resource string. + # + # The resource will be in the following format: + # + # `projects/{project}/locations/{location}` + # + # @param project [String] + # @param location [String] + # + # @return [::String] + def location_path project:, location: + raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" + + "projects/#{project}/locations/#{location}" + end + + ## + # Create a fully-qualified Project resource string. + # + # The resource will be in the following format: + # + # `projects/{project}` + # + # @param project [String] + # + # @return [::String] + def project_path project: + "projects/#{project}" + end + + ## + # Create a fully-qualified Secret resource string. + # + # @overload secret_path(project:, secret:) + # The resource will be in the following format: + # + # `projects/{project}/secrets/{secret}` + # + # @param project [String] + # @param secret [String] + # + # @overload secret_path(project:, location:, secret:) + # The resource will be in the following format: + # + # `projects/{project}/locations/{location}/secrets/{secret}` + # + # @param project [String] + # @param location [String] + # @param secret [String] + # + # @return [::String] + def secret_path **args + resources = { + "project:secret" => (proc do |project:, secret:| + raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" + + "projects/#{project}/secrets/#{secret}" + end), + "location:project:secret" => (proc do |project:, location:, secret:| + raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" + raise ::ArgumentError, "location cannot contain /" if location.to_s.include? "/" + + "projects/#{project}/locations/#{location}/secrets/#{secret}" + end) + } + + resource = resources[args.keys.sort.join(":")] + raise ::ArgumentError, "no resource found for values #{args.keys}" if resource.nil? + resource.call(**args) + end + + ## + # Create a fully-qualified SecretVersion resource string. + # + # @overload secret_version_path(project:, secret:, secret_version:) + # The resource will be in the following format: + # + # `projects/{project}/secrets/{secret}/versions/{secret_version}` + # + # @param project [String] + # @param secret [String] + # @param secret_version [String] + # + # @overload secret_version_path(project:, location:, secret:, secret_version:) + # The resource will be in the following format: + # + # `projects/{project}/locations/{location}/secrets/{secret}/versions/{secret_version}` + # + # @param project [String] + # @param location [String] + # @param secret [String] + # @param secret_version [String] + # + # @return [::String] + def secret_version_path **args + resources = { + "project:secret:secret_version" => (proc do |project:, secret:, secret_version:| + raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" + raise ::ArgumentError, "secret cannot contain /" if secret.to_s.include? "/" + + "projects/#{project}/secrets/#{secret}/versions/#{secret_version}" + end), + "location:project:secret:secret_version" => (proc do |project:, location:, secret:, secret_version:| + raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" + raise ::ArgumentError, "location cannot contain /" if location.to_s.include? "/" + raise ::ArgumentError, "secret cannot contain /" if secret.to_s.include? "/" + + "projects/#{project}/locations/#{location}/secrets/#{secret}/versions/#{secret_version}" + end) + } + + resource = resources[args.keys.sort.join(":")] + raise ::ArgumentError, "no resource found for values #{args.keys}" if resource.nil? + resource.call(**args) + end + + ## + # Create a fully-qualified Topic resource string. + # + # The resource will be in the following format: + # + # `projects/{project}/topics/{topic}` + # + # @param project [String] + # @param topic [String] + # + # @return [::String] + def topic_path project:, topic: + raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" + + "projects/#{project}/topics/#{topic}" + end + + extend self + end + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-secret_manager-v1beta2/lib/google/cloud/secret_manager/v1beta2/secret_manager_service/rest.rb b/owl-bot-staging/google-cloud-secret_manager-v1beta2/lib/google/cloud/secret_manager/v1beta2/secret_manager_service/rest.rb new file mode 100644 index 000000000000..0f60f9b3fd09 --- /dev/null +++ b/owl-bot-staging/google-cloud-secret_manager-v1beta2/lib/google/cloud/secret_manager/v1beta2/secret_manager_service/rest.rb @@ -0,0 +1,59 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +require "gapic/rest" +require "gapic/config" +require "gapic/config/method" + +require "google/cloud/secret_manager/v1beta2/version" +require "google/cloud/secret_manager/v1beta2/bindings_override" + +require "google/cloud/secret_manager/v1beta2/secret_manager_service/credentials" +require "google/cloud/secret_manager/v1beta2/secret_manager_service/paths" +require "google/cloud/secret_manager/v1beta2/secret_manager_service/rest/client" + +module Google + module Cloud + module SecretManager + module V1beta2 + ## + # Secret Manager Service + # + # Manages secrets and operations using those secrets. Implements a REST + # model with the following objects: + # + # * {::Google::Cloud::SecretManager::V1beta2::Secret Secret} + # * {::Google::Cloud::SecretManager::V1beta2::SecretVersion SecretVersion} + # + # To load this service and instantiate a REST client: + # + # require "google/cloud/secret_manager/v1beta2/secret_manager_service/rest" + # client = ::Google::Cloud::SecretManager::V1beta2::SecretManagerService::Rest::Client.new + # + module SecretManagerService + # Client for the REST transport + module Rest + end + end + end + end + end +end + +helper_path = ::File.join __dir__, "rest", "helpers.rb" +require "google/cloud/secret_manager/v1beta2/secret_manager_service/rest/helpers" if ::File.file? helper_path diff --git a/owl-bot-staging/google-cloud-secret_manager-v1beta2/lib/google/cloud/secret_manager/v1beta2/secret_manager_service/rest/client.rb b/owl-bot-staging/google-cloud-secret_manager-v1beta2/lib/google/cloud/secret_manager/v1beta2/secret_manager_service/rest/client.rb new file mode 100644 index 000000000000..037aac866ca6 --- /dev/null +++ b/owl-bot-staging/google-cloud-secret_manager-v1beta2/lib/google/cloud/secret_manager/v1beta2/secret_manager_service/rest/client.rb @@ -0,0 +1,1856 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +require "google/cloud/errors" +require "google/cloud/secretmanager/v1beta2/service_pb" +require "google/cloud/secret_manager/v1beta2/secret_manager_service/rest/service_stub" +require "google/cloud/location/rest" + +module Google + module Cloud + module SecretManager + module V1beta2 + module SecretManagerService + module Rest + ## + # REST client for the SecretManagerService service. + # + # Secret Manager Service + # + # Manages secrets and operations using those secrets. Implements a REST + # model with the following objects: + # + # * {::Google::Cloud::SecretManager::V1beta2::Secret Secret} + # * {::Google::Cloud::SecretManager::V1beta2::SecretVersion SecretVersion} + # + class Client + # @private + API_VERSION = "" + + # @private + DEFAULT_ENDPOINT_TEMPLATE = "secretmanager.$UNIVERSE_DOMAIN$" + + include Paths + + # @private + attr_reader :secret_manager_service_stub + + ## + # Configure the SecretManagerService Client class. + # + # See {::Google::Cloud::SecretManager::V1beta2::SecretManagerService::Rest::Client::Configuration} + # for a description of the configuration fields. + # + # @example + # + # # Modify the configuration for all SecretManagerService clients + # ::Google::Cloud::SecretManager::V1beta2::SecretManagerService::Rest::Client.configure do |config| + # config.timeout = 10.0 + # end + # + # @yield [config] Configure the Client client. + # @yieldparam config [Client::Configuration] + # + # @return [Client::Configuration] + # + def self.configure + @configure ||= begin + namespace = ["Google", "Cloud", "SecretManager", "V1beta2"] + parent_config = while namespace.any? + parent_name = namespace.join "::" + parent_const = const_get parent_name + break parent_const.configure if parent_const.respond_to? :configure + namespace.pop + end + default_config = Client::Configuration.new parent_config + + default_config.rpcs.list_secrets.timeout = 60.0 + + default_config.rpcs.create_secret.timeout = 60.0 + + default_config.rpcs.add_secret_version.timeout = 60.0 + + default_config.rpcs.get_secret.timeout = 60.0 + + default_config.rpcs.update_secret.timeout = 60.0 + + default_config.rpcs.delete_secret.timeout = 60.0 + + default_config.rpcs.list_secret_versions.timeout = 60.0 + + default_config.rpcs.get_secret_version.timeout = 60.0 + + default_config.rpcs.access_secret_version.timeout = 60.0 + default_config.rpcs.access_secret_version.retry_policy = { + initial_delay: 2.0, max_delay: 60.0, multiplier: 2.0, retry_codes: [14, 8] + } + + default_config.rpcs.disable_secret_version.timeout = 60.0 + + default_config.rpcs.enable_secret_version.timeout = 60.0 + + default_config.rpcs.destroy_secret_version.timeout = 60.0 + + default_config.rpcs.set_iam_policy.timeout = 60.0 + + default_config.rpcs.get_iam_policy.timeout = 60.0 + + default_config.rpcs.test_iam_permissions.timeout = 60.0 + + default_config + end + yield @configure if block_given? + @configure + end + + ## + # Configure the SecretManagerService Client instance. + # + # The configuration is set to the derived mode, meaning that values can be changed, + # but structural changes (adding new fields, etc.) are not allowed. Structural changes + # should be made on {Client.configure}. + # + # See {::Google::Cloud::SecretManager::V1beta2::SecretManagerService::Rest::Client::Configuration} + # for a description of the configuration fields. + # + # @yield [config] Configure the Client client. + # @yieldparam config [Client::Configuration] + # + # @return [Client::Configuration] + # + def configure + yield @config if block_given? + @config + end + + ## + # The effective universe domain + # + # @return [String] + # + def universe_domain + @secret_manager_service_stub.universe_domain + end + + ## + # Create a new SecretManagerService REST client object. + # + # @example + # + # # Create a client using the default configuration + # client = ::Google::Cloud::SecretManager::V1beta2::SecretManagerService::Rest::Client.new + # + # # Create a client using a custom configuration + # client = ::Google::Cloud::SecretManager::V1beta2::SecretManagerService::Rest::Client.new do |config| + # config.timeout = 10.0 + # end + # + # @yield [config] Configure the SecretManagerService client. + # @yieldparam config [Client::Configuration] + # + def initialize + # Create the configuration object + @config = Configuration.new Client.configure + + # Yield the configuration if needed + yield @config if block_given? + + # Create credentials + credentials = @config.credentials + # Use self-signed JWT if the endpoint is unchanged from default, + # but only if the default endpoint does not have a region prefix. + enable_self_signed_jwt = @config.endpoint.nil? || + (@config.endpoint == Configuration::DEFAULT_ENDPOINT && + !@config.endpoint.split(".").first.include?("-")) + credentials ||= Credentials.default scope: @config.scope, + enable_self_signed_jwt: enable_self_signed_jwt + if credentials.is_a?(::String) || credentials.is_a?(::Hash) + credentials = Credentials.new credentials, scope: @config.scope + end + + @quota_project_id = @config.quota_project + @quota_project_id ||= credentials.quota_project_id if credentials.respond_to? :quota_project_id + + @secret_manager_service_stub = ::Google::Cloud::SecretManager::V1beta2::SecretManagerService::Rest::ServiceStub.new( + endpoint: @config.endpoint, + endpoint_template: DEFAULT_ENDPOINT_TEMPLATE, + universe_domain: @config.universe_domain, + credentials: credentials, + logger: @config.logger + ) + + @secret_manager_service_stub.logger(stub: true)&.info do |entry| + entry.set_system_name + entry.set_service + entry.message = "Created client for #{entry.service}" + entry.set_credentials_fields credentials + entry.set "customEndpoint", @config.endpoint if @config.endpoint + entry.set "defaultTimeout", @config.timeout if @config.timeout + entry.set "quotaProject", @quota_project_id if @quota_project_id + end + + @location_client = Google::Cloud::Location::Locations::Rest::Client.new do |config| + config.credentials = credentials + config.quota_project = @quota_project_id + config.endpoint = @secret_manager_service_stub.endpoint + config.universe_domain = @secret_manager_service_stub.universe_domain + config.bindings_override = @config.bindings_override + config.logger = @secret_manager_service_stub.logger if config.respond_to? :logger= + end + end + + ## + # Get the associated client for mix-in of the Locations. + # + # @return [Google::Cloud::Location::Locations::Rest::Client] + # + attr_reader :location_client + + ## + # The logger used for request/response debug logging. + # + # @return [Logger] + # + def logger + @secret_manager_service_stub.logger + end + + # Service calls + + ## + # Lists {::Google::Cloud::SecretManager::V1beta2::Secret Secrets}. + # + # @overload list_secrets(request, options = nil) + # Pass arguments to `list_secrets` via a request object, either of type + # {::Google::Cloud::SecretManager::V1beta2::ListSecretsRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::SecretManager::V1beta2::ListSecretsRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @overload list_secrets(parent: nil, page_size: nil, page_token: nil, filter: nil) + # Pass arguments to `list_secrets` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param parent [::String] + # Required. The resource name of the project associated with the + # {::Google::Cloud::SecretManager::V1beta2::Secret Secrets}, in the format + # `projects/*` or `projects/*/locations/*` + # @param page_size [::Integer] + # Optional. The maximum number of results to be returned in a single page. If + # set to 0, the server decides the number of results to return. If the + # number is greater than 25000, it is capped at 25000. + # @param page_token [::String] + # Optional. Pagination token, returned earlier via + # {::Google::Cloud::SecretManager::V1beta2::ListSecretsResponse#next_page_token ListSecretsResponse.next_page_token}. + # @param filter [::String] + # Optional. Filter string, adhering to the rules in + # [List-operation + # filtering](https://cloud.google.com/secret-manager/docs/filtering). List + # only secrets matching the filter. If filter is empty, all secrets are + # listed. + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Gapic::Rest::PagedEnumerable<::Google::Cloud::SecretManager::V1beta2::Secret>] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Gapic::Rest::PagedEnumerable<::Google::Cloud::SecretManager::V1beta2::Secret>] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/secret_manager/v1beta2" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::SecretManager::V1beta2::SecretManagerService::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::SecretManager::V1beta2::ListSecretsRequest.new + # + # # Call the list_secrets method. + # result = client.list_secrets request + # + # # The returned object is of type Gapic::PagedEnumerable. You can iterate + # # over elements, and API calls will be issued to fetch pages as needed. + # result.each do |item| + # # Each element is of type ::Google::Cloud::SecretManager::V1beta2::Secret. + # p item + # end + # + def list_secrets request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::SecretManager::V1beta2::ListSecretsRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + call_metadata = @config.rpcs.list_secrets.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::SecretManager::V1beta2::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + options.apply_defaults timeout: @config.rpcs.list_secrets.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.list_secrets.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @secret_manager_service_stub.list_secrets request, options do |result, operation| + result = ::Gapic::Rest::PagedEnumerable.new @secret_manager_service_stub, :list_secrets, "secrets", request, result, options + yield result, operation if block_given? + throw :response, result + end + rescue ::Gapic::Rest::Error => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Creates a new {::Google::Cloud::SecretManager::V1beta2::Secret Secret} + # containing no + # {::Google::Cloud::SecretManager::V1beta2::SecretVersion SecretVersions}. + # + # @overload create_secret(request, options = nil) + # Pass arguments to `create_secret` via a request object, either of type + # {::Google::Cloud::SecretManager::V1beta2::CreateSecretRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::SecretManager::V1beta2::CreateSecretRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @overload create_secret(parent: nil, secret_id: nil, secret: nil) + # Pass arguments to `create_secret` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param parent [::String] + # Required. The resource name of the project to associate with the + # {::Google::Cloud::SecretManager::V1beta2::Secret Secret}, in the format + # `projects/*` or `projects/*/locations/*`. + # @param secret_id [::String] + # Required. This must be unique within the project. + # + # A secret ID is a string with a maximum length of 255 characters and can + # contain uppercase and lowercase letters, numerals, and the hyphen (`-`) and + # underscore (`_`) characters. + # @param secret [::Google::Cloud::SecretManager::V1beta2::Secret, ::Hash] + # Required. A {::Google::Cloud::SecretManager::V1beta2::Secret Secret} with + # initial field values. + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Cloud::SecretManager::V1beta2::Secret] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::SecretManager::V1beta2::Secret] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/secret_manager/v1beta2" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::SecretManager::V1beta2::SecretManagerService::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::SecretManager::V1beta2::CreateSecretRequest.new + # + # # Call the create_secret method. + # result = client.create_secret request + # + # # The returned object is of type Google::Cloud::SecretManager::V1beta2::Secret. + # p result + # + def create_secret request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::SecretManager::V1beta2::CreateSecretRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + call_metadata = @config.rpcs.create_secret.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::SecretManager::V1beta2::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + options.apply_defaults timeout: @config.rpcs.create_secret.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.create_secret.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @secret_manager_service_stub.create_secret request, options do |result, operation| + yield result, operation if block_given? + end + rescue ::Gapic::Rest::Error => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Creates a new + # {::Google::Cloud::SecretManager::V1beta2::SecretVersion SecretVersion} + # containing secret data and attaches it to an existing + # {::Google::Cloud::SecretManager::V1beta2::Secret Secret}. + # + # @overload add_secret_version(request, options = nil) + # Pass arguments to `add_secret_version` via a request object, either of type + # {::Google::Cloud::SecretManager::V1beta2::AddSecretVersionRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::SecretManager::V1beta2::AddSecretVersionRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @overload add_secret_version(parent: nil, payload: nil) + # Pass arguments to `add_secret_version` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param parent [::String] + # Required. The resource name of the + # {::Google::Cloud::SecretManager::V1beta2::Secret Secret} to associate with the + # {::Google::Cloud::SecretManager::V1beta2::SecretVersion SecretVersion} in the + # format `projects/*/secrets/*` or `projects/*/locations/*/secrets/*`. + # @param payload [::Google::Cloud::SecretManager::V1beta2::SecretPayload, ::Hash] + # Required. The secret payload of the + # {::Google::Cloud::SecretManager::V1beta2::SecretVersion SecretVersion}. + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Cloud::SecretManager::V1beta2::SecretVersion] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::SecretManager::V1beta2::SecretVersion] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/secret_manager/v1beta2" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::SecretManager::V1beta2::SecretManagerService::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::SecretManager::V1beta2::AddSecretVersionRequest.new + # + # # Call the add_secret_version method. + # result = client.add_secret_version request + # + # # The returned object is of type Google::Cloud::SecretManager::V1beta2::SecretVersion. + # p result + # + def add_secret_version request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::SecretManager::V1beta2::AddSecretVersionRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + call_metadata = @config.rpcs.add_secret_version.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::SecretManager::V1beta2::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + options.apply_defaults timeout: @config.rpcs.add_secret_version.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.add_secret_version.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @secret_manager_service_stub.add_secret_version request, options do |result, operation| + yield result, operation if block_given? + end + rescue ::Gapic::Rest::Error => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Gets metadata for a given + # {::Google::Cloud::SecretManager::V1beta2::Secret Secret}. + # + # @overload get_secret(request, options = nil) + # Pass arguments to `get_secret` via a request object, either of type + # {::Google::Cloud::SecretManager::V1beta2::GetSecretRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::SecretManager::V1beta2::GetSecretRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @overload get_secret(name: nil) + # Pass arguments to `get_secret` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param name [::String] + # Required. The resource name of the + # {::Google::Cloud::SecretManager::V1beta2::Secret Secret}, in the format + # `projects/*/secrets/*` or `projects/*/locations/*/secrets/*`. + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Cloud::SecretManager::V1beta2::Secret] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::SecretManager::V1beta2::Secret] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/secret_manager/v1beta2" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::SecretManager::V1beta2::SecretManagerService::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::SecretManager::V1beta2::GetSecretRequest.new + # + # # Call the get_secret method. + # result = client.get_secret request + # + # # The returned object is of type Google::Cloud::SecretManager::V1beta2::Secret. + # p result + # + def get_secret request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::SecretManager::V1beta2::GetSecretRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + call_metadata = @config.rpcs.get_secret.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::SecretManager::V1beta2::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + options.apply_defaults timeout: @config.rpcs.get_secret.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.get_secret.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @secret_manager_service_stub.get_secret request, options do |result, operation| + yield result, operation if block_given? + end + rescue ::Gapic::Rest::Error => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Updates metadata of an existing + # {::Google::Cloud::SecretManager::V1beta2::Secret Secret}. + # + # @overload update_secret(request, options = nil) + # Pass arguments to `update_secret` via a request object, either of type + # {::Google::Cloud::SecretManager::V1beta2::UpdateSecretRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::SecretManager::V1beta2::UpdateSecretRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @overload update_secret(secret: nil, update_mask: nil) + # Pass arguments to `update_secret` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param secret [::Google::Cloud::SecretManager::V1beta2::Secret, ::Hash] + # Required. {::Google::Cloud::SecretManager::V1beta2::Secret Secret} with updated + # field values. + # @param update_mask [::Google::Protobuf::FieldMask, ::Hash] + # Required. Specifies the fields to be updated. + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Cloud::SecretManager::V1beta2::Secret] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::SecretManager::V1beta2::Secret] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/secret_manager/v1beta2" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::SecretManager::V1beta2::SecretManagerService::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::SecretManager::V1beta2::UpdateSecretRequest.new + # + # # Call the update_secret method. + # result = client.update_secret request + # + # # The returned object is of type Google::Cloud::SecretManager::V1beta2::Secret. + # p result + # + def update_secret request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::SecretManager::V1beta2::UpdateSecretRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + call_metadata = @config.rpcs.update_secret.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::SecretManager::V1beta2::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + options.apply_defaults timeout: @config.rpcs.update_secret.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.update_secret.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @secret_manager_service_stub.update_secret request, options do |result, operation| + yield result, operation if block_given? + end + rescue ::Gapic::Rest::Error => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Deletes a {::Google::Cloud::SecretManager::V1beta2::Secret Secret}. + # + # @overload delete_secret(request, options = nil) + # Pass arguments to `delete_secret` via a request object, either of type + # {::Google::Cloud::SecretManager::V1beta2::DeleteSecretRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::SecretManager::V1beta2::DeleteSecretRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @overload delete_secret(name: nil, etag: nil) + # Pass arguments to `delete_secret` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param name [::String] + # Required. The resource name of the + # {::Google::Cloud::SecretManager::V1beta2::Secret Secret} to delete in the format + # `projects/*/secrets/*`. + # @param etag [::String] + # Optional. Etag of the {::Google::Cloud::SecretManager::V1beta2::Secret Secret}. + # The request succeeds if it matches the etag of the currently stored secret + # object. If the etag is omitted, the request succeeds. + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Protobuf::Empty] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Protobuf::Empty] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/secret_manager/v1beta2" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::SecretManager::V1beta2::SecretManagerService::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::SecretManager::V1beta2::DeleteSecretRequest.new + # + # # Call the delete_secret method. + # result = client.delete_secret request + # + # # The returned object is of type Google::Protobuf::Empty. + # p result + # + def delete_secret request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::SecretManager::V1beta2::DeleteSecretRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + call_metadata = @config.rpcs.delete_secret.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::SecretManager::V1beta2::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + options.apply_defaults timeout: @config.rpcs.delete_secret.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.delete_secret.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @secret_manager_service_stub.delete_secret request, options do |result, operation| + yield result, operation if block_given? + end + rescue ::Gapic::Rest::Error => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Lists {::Google::Cloud::SecretManager::V1beta2::SecretVersion SecretVersions}. + # This call does not return secret data. + # + # @overload list_secret_versions(request, options = nil) + # Pass arguments to `list_secret_versions` via a request object, either of type + # {::Google::Cloud::SecretManager::V1beta2::ListSecretVersionsRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::SecretManager::V1beta2::ListSecretVersionsRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @overload list_secret_versions(parent: nil, page_size: nil, page_token: nil, filter: nil) + # Pass arguments to `list_secret_versions` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param parent [::String] + # Required. The resource name of the + # {::Google::Cloud::SecretManager::V1beta2::Secret Secret} associated with the + # {::Google::Cloud::SecretManager::V1beta2::SecretVersion SecretVersions} to list, + # in the format `projects/*/secrets/*` or `projects/*/locations/*/secrets/*`. + # @param page_size [::Integer] + # Optional. The maximum number of results to be returned in a single page. If + # set to 0, the server decides the number of results to return. If the + # number is greater than 25000, it is capped at 25000. + # @param page_token [::String] + # Optional. Pagination token, returned earlier via + # ListSecretVersionsResponse.next_page_token][]. + # @param filter [::String] + # Optional. Filter string, adhering to the rules in + # [List-operation + # filtering](https://cloud.google.com/secret-manager/docs/filtering). List + # only secret versions matching the filter. If filter is empty, all secret + # versions are listed. + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Gapic::Rest::PagedEnumerable<::Google::Cloud::SecretManager::V1beta2::SecretVersion>] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Gapic::Rest::PagedEnumerable<::Google::Cloud::SecretManager::V1beta2::SecretVersion>] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/secret_manager/v1beta2" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::SecretManager::V1beta2::SecretManagerService::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::SecretManager::V1beta2::ListSecretVersionsRequest.new + # + # # Call the list_secret_versions method. + # result = client.list_secret_versions request + # + # # The returned object is of type Gapic::PagedEnumerable. You can iterate + # # over elements, and API calls will be issued to fetch pages as needed. + # result.each do |item| + # # Each element is of type ::Google::Cloud::SecretManager::V1beta2::SecretVersion. + # p item + # end + # + def list_secret_versions request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::SecretManager::V1beta2::ListSecretVersionsRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + call_metadata = @config.rpcs.list_secret_versions.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::SecretManager::V1beta2::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + options.apply_defaults timeout: @config.rpcs.list_secret_versions.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.list_secret_versions.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @secret_manager_service_stub.list_secret_versions request, options do |result, operation| + result = ::Gapic::Rest::PagedEnumerable.new @secret_manager_service_stub, :list_secret_versions, "versions", request, result, options + yield result, operation if block_given? + throw :response, result + end + rescue ::Gapic::Rest::Error => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Gets metadata for a + # {::Google::Cloud::SecretManager::V1beta2::SecretVersion SecretVersion}. + # + # `projects/*/secrets/*/versions/latest` is an alias to the most recently + # created {::Google::Cloud::SecretManager::V1beta2::SecretVersion SecretVersion}. + # + # @overload get_secret_version(request, options = nil) + # Pass arguments to `get_secret_version` via a request object, either of type + # {::Google::Cloud::SecretManager::V1beta2::GetSecretVersionRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::SecretManager::V1beta2::GetSecretVersionRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @overload get_secret_version(name: nil) + # Pass arguments to `get_secret_version` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param name [::String] + # Required. The resource name of the + # {::Google::Cloud::SecretManager::V1beta2::SecretVersion SecretVersion} in the + # format `projects/*/secrets/*/versions/*` or + # `projects/*/locations/*/secrets/*/versions/*`. + # + # `projects/*/secrets/*/versions/latest` or + # `projects/*/locations/*/secrets/*/versions/latest` is an alias to the most + # recently created + # {::Google::Cloud::SecretManager::V1beta2::SecretVersion SecretVersion}. + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Cloud::SecretManager::V1beta2::SecretVersion] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::SecretManager::V1beta2::SecretVersion] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/secret_manager/v1beta2" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::SecretManager::V1beta2::SecretManagerService::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::SecretManager::V1beta2::GetSecretVersionRequest.new + # + # # Call the get_secret_version method. + # result = client.get_secret_version request + # + # # The returned object is of type Google::Cloud::SecretManager::V1beta2::SecretVersion. + # p result + # + def get_secret_version request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::SecretManager::V1beta2::GetSecretVersionRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + call_metadata = @config.rpcs.get_secret_version.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::SecretManager::V1beta2::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + options.apply_defaults timeout: @config.rpcs.get_secret_version.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.get_secret_version.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @secret_manager_service_stub.get_secret_version request, options do |result, operation| + yield result, operation if block_given? + end + rescue ::Gapic::Rest::Error => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Accesses a + # {::Google::Cloud::SecretManager::V1beta2::SecretVersion SecretVersion}. This + # call returns the secret data. + # + # `projects/*/secrets/*/versions/latest` is an alias to the most recently + # created {::Google::Cloud::SecretManager::V1beta2::SecretVersion SecretVersion}. + # + # @overload access_secret_version(request, options = nil) + # Pass arguments to `access_secret_version` via a request object, either of type + # {::Google::Cloud::SecretManager::V1beta2::AccessSecretVersionRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::SecretManager::V1beta2::AccessSecretVersionRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @overload access_secret_version(name: nil) + # Pass arguments to `access_secret_version` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param name [::String] + # Required. The resource name of the + # {::Google::Cloud::SecretManager::V1beta2::SecretVersion SecretVersion} in the + # format `projects/*/secrets/*/versions/*` or + # `projects/*/locations/*/secrets/*/versions/*`. + # + # `projects/*/secrets/*/versions/latest` or + # `projects/*/locations/*/secrets/*/versions/latest` is an alias to the most + # recently created + # {::Google::Cloud::SecretManager::V1beta2::SecretVersion SecretVersion}. + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Cloud::SecretManager::V1beta2::AccessSecretVersionResponse] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::SecretManager::V1beta2::AccessSecretVersionResponse] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/secret_manager/v1beta2" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::SecretManager::V1beta2::SecretManagerService::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::SecretManager::V1beta2::AccessSecretVersionRequest.new + # + # # Call the access_secret_version method. + # result = client.access_secret_version request + # + # # The returned object is of type Google::Cloud::SecretManager::V1beta2::AccessSecretVersionResponse. + # p result + # + def access_secret_version request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::SecretManager::V1beta2::AccessSecretVersionRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + call_metadata = @config.rpcs.access_secret_version.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::SecretManager::V1beta2::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + options.apply_defaults timeout: @config.rpcs.access_secret_version.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.access_secret_version.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @secret_manager_service_stub.access_secret_version request, options do |result, operation| + yield result, operation if block_given? + end + rescue ::Gapic::Rest::Error => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Disables a + # {::Google::Cloud::SecretManager::V1beta2::SecretVersion SecretVersion}. + # + # Sets the {::Google::Cloud::SecretManager::V1beta2::SecretVersion#state state} of + # the {::Google::Cloud::SecretManager::V1beta2::SecretVersion SecretVersion} to + # {::Google::Cloud::SecretManager::V1beta2::SecretVersion::State::DISABLED DISABLED}. + # + # @overload disable_secret_version(request, options = nil) + # Pass arguments to `disable_secret_version` via a request object, either of type + # {::Google::Cloud::SecretManager::V1beta2::DisableSecretVersionRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::SecretManager::V1beta2::DisableSecretVersionRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @overload disable_secret_version(name: nil, etag: nil) + # Pass arguments to `disable_secret_version` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param name [::String] + # Required. The resource name of the + # {::Google::Cloud::SecretManager::V1beta2::SecretVersion SecretVersion} to + # disable in the format `projects/*/secrets/*/versions/*` or + # `projects/*/locations/*/secrets/*/versions/*`. + # @param etag [::String] + # Optional. Etag of the + # {::Google::Cloud::SecretManager::V1beta2::SecretVersion SecretVersion}. The + # request succeeds if it matches the etag of the currently stored secret + # version object. If the etag is omitted, the request succeeds. + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Cloud::SecretManager::V1beta2::SecretVersion] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::SecretManager::V1beta2::SecretVersion] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/secret_manager/v1beta2" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::SecretManager::V1beta2::SecretManagerService::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::SecretManager::V1beta2::DisableSecretVersionRequest.new + # + # # Call the disable_secret_version method. + # result = client.disable_secret_version request + # + # # The returned object is of type Google::Cloud::SecretManager::V1beta2::SecretVersion. + # p result + # + def disable_secret_version request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::SecretManager::V1beta2::DisableSecretVersionRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + call_metadata = @config.rpcs.disable_secret_version.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::SecretManager::V1beta2::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + options.apply_defaults timeout: @config.rpcs.disable_secret_version.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.disable_secret_version.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @secret_manager_service_stub.disable_secret_version request, options do |result, operation| + yield result, operation if block_given? + end + rescue ::Gapic::Rest::Error => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Enables a + # {::Google::Cloud::SecretManager::V1beta2::SecretVersion SecretVersion}. + # + # Sets the {::Google::Cloud::SecretManager::V1beta2::SecretVersion#state state} of + # the {::Google::Cloud::SecretManager::V1beta2::SecretVersion SecretVersion} to + # {::Google::Cloud::SecretManager::V1beta2::SecretVersion::State::ENABLED ENABLED}. + # + # @overload enable_secret_version(request, options = nil) + # Pass arguments to `enable_secret_version` via a request object, either of type + # {::Google::Cloud::SecretManager::V1beta2::EnableSecretVersionRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::SecretManager::V1beta2::EnableSecretVersionRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @overload enable_secret_version(name: nil, etag: nil) + # Pass arguments to `enable_secret_version` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param name [::String] + # Required. The resource name of the + # {::Google::Cloud::SecretManager::V1beta2::SecretVersion SecretVersion} to enable + # in the format `projects/*/secrets/*/versions/*` or + # `projects/*/locations/*/secrets/*/versions/*`. + # @param etag [::String] + # Optional. Etag of the + # {::Google::Cloud::SecretManager::V1beta2::SecretVersion SecretVersion}. The + # request succeeds if it matches the etag of the currently stored secret + # version object. If the etag is omitted, the request succeeds. + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Cloud::SecretManager::V1beta2::SecretVersion] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::SecretManager::V1beta2::SecretVersion] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/secret_manager/v1beta2" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::SecretManager::V1beta2::SecretManagerService::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::SecretManager::V1beta2::EnableSecretVersionRequest.new + # + # # Call the enable_secret_version method. + # result = client.enable_secret_version request + # + # # The returned object is of type Google::Cloud::SecretManager::V1beta2::SecretVersion. + # p result + # + def enable_secret_version request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::SecretManager::V1beta2::EnableSecretVersionRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + call_metadata = @config.rpcs.enable_secret_version.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::SecretManager::V1beta2::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + options.apply_defaults timeout: @config.rpcs.enable_secret_version.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.enable_secret_version.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @secret_manager_service_stub.enable_secret_version request, options do |result, operation| + yield result, operation if block_given? + end + rescue ::Gapic::Rest::Error => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Destroys a + # {::Google::Cloud::SecretManager::V1beta2::SecretVersion SecretVersion}. + # + # Sets the {::Google::Cloud::SecretManager::V1beta2::SecretVersion#state state} of + # the {::Google::Cloud::SecretManager::V1beta2::SecretVersion SecretVersion} to + # {::Google::Cloud::SecretManager::V1beta2::SecretVersion::State::DESTROYED DESTROYED} + # and irrevocably destroys the secret data. + # + # @overload destroy_secret_version(request, options = nil) + # Pass arguments to `destroy_secret_version` via a request object, either of type + # {::Google::Cloud::SecretManager::V1beta2::DestroySecretVersionRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::SecretManager::V1beta2::DestroySecretVersionRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @overload destroy_secret_version(name: nil, etag: nil) + # Pass arguments to `destroy_secret_version` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param name [::String] + # Required. The resource name of the + # {::Google::Cloud::SecretManager::V1beta2::SecretVersion SecretVersion} to + # destroy in the format `projects/*/secrets/*/versions/*` or + # `projects/*/locations/*/secrets/*/versions/*`. + # @param etag [::String] + # Optional. Etag of the + # {::Google::Cloud::SecretManager::V1beta2::SecretVersion SecretVersion}. The + # request succeeds if it matches the etag of the currently stored secret + # version object. If the etag is omitted, the request succeeds. + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Cloud::SecretManager::V1beta2::SecretVersion] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::SecretManager::V1beta2::SecretVersion] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/secret_manager/v1beta2" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::SecretManager::V1beta2::SecretManagerService::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::SecretManager::V1beta2::DestroySecretVersionRequest.new + # + # # Call the destroy_secret_version method. + # result = client.destroy_secret_version request + # + # # The returned object is of type Google::Cloud::SecretManager::V1beta2::SecretVersion. + # p result + # + def destroy_secret_version request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::SecretManager::V1beta2::DestroySecretVersionRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + call_metadata = @config.rpcs.destroy_secret_version.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::SecretManager::V1beta2::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + options.apply_defaults timeout: @config.rpcs.destroy_secret_version.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.destroy_secret_version.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @secret_manager_service_stub.destroy_secret_version request, options do |result, operation| + yield result, operation if block_given? + end + rescue ::Gapic::Rest::Error => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Sets the access control policy on the specified secret. Replaces any + # existing policy. + # + # Permissions on + # {::Google::Cloud::SecretManager::V1beta2::SecretVersion SecretVersions} are + # enforced according to the policy set on the associated + # {::Google::Cloud::SecretManager::V1beta2::Secret Secret}. + # + # @overload set_iam_policy(request, options = nil) + # Pass arguments to `set_iam_policy` via a request object, either of type + # {::Google::Iam::V1::SetIamPolicyRequest} or an equivalent Hash. + # + # @param request [::Google::Iam::V1::SetIamPolicyRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @overload set_iam_policy(resource: nil, policy: nil, update_mask: nil) + # Pass arguments to `set_iam_policy` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param resource [::String] + # REQUIRED: The resource for which the policy is being specified. + # See the operation documentation for the appropriate value for this field. + # @param policy [::Google::Iam::V1::Policy, ::Hash] + # REQUIRED: The complete policy to be applied to the `resource`. The size of + # the policy is limited to a few 10s of KB. An empty policy is a + # valid policy but certain Cloud Platform services (such as Projects) + # might reject them. + # @param update_mask [::Google::Protobuf::FieldMask, ::Hash] + # OPTIONAL: A FieldMask specifying which fields of the policy to modify. Only + # the fields in the mask will be modified. If no mask is provided, the + # following default mask is used: + # + # `paths: "bindings, etag"` + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Iam::V1::Policy] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Iam::V1::Policy] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/secret_manager/v1beta2" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::SecretManager::V1beta2::SecretManagerService::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Iam::V1::SetIamPolicyRequest.new + # + # # Call the set_iam_policy method. + # result = client.set_iam_policy request + # + # # The returned object is of type Google::Iam::V1::Policy. + # p result + # + def set_iam_policy request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Iam::V1::SetIamPolicyRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + call_metadata = @config.rpcs.set_iam_policy.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::SecretManager::V1beta2::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + options.apply_defaults timeout: @config.rpcs.set_iam_policy.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.set_iam_policy.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @secret_manager_service_stub.set_iam_policy request, options do |result, operation| + yield result, operation if block_given? + end + rescue ::Gapic::Rest::Error => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Gets the access control policy for a secret. + # Returns empty policy if the secret exists and does not have a policy set. + # + # @overload get_iam_policy(request, options = nil) + # Pass arguments to `get_iam_policy` via a request object, either of type + # {::Google::Iam::V1::GetIamPolicyRequest} or an equivalent Hash. + # + # @param request [::Google::Iam::V1::GetIamPolicyRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @overload get_iam_policy(resource: nil, options: nil) + # Pass arguments to `get_iam_policy` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param resource [::String] + # REQUIRED: The resource for which the policy is being requested. + # See the operation documentation for the appropriate value for this field. + # @param options [::Google::Iam::V1::GetPolicyOptions, ::Hash] + # OPTIONAL: A `GetPolicyOptions` object for specifying options to + # `GetIamPolicy`. + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Iam::V1::Policy] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Iam::V1::Policy] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/secret_manager/v1beta2" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::SecretManager::V1beta2::SecretManagerService::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Iam::V1::GetIamPolicyRequest.new + # + # # Call the get_iam_policy method. + # result = client.get_iam_policy request + # + # # The returned object is of type Google::Iam::V1::Policy. + # p result + # + def get_iam_policy request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Iam::V1::GetIamPolicyRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + call_metadata = @config.rpcs.get_iam_policy.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::SecretManager::V1beta2::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + options.apply_defaults timeout: @config.rpcs.get_iam_policy.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.get_iam_policy.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @secret_manager_service_stub.get_iam_policy request, options do |result, operation| + yield result, operation if block_given? + end + rescue ::Gapic::Rest::Error => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Returns permissions that a caller has for the specified secret. + # If the secret does not exist, this call returns an empty set of + # permissions, not a NOT_FOUND error. + # + # Note: This operation is designed to be used for building permission-aware + # UIs and command-line tools, not for authorization checking. This operation + # may "fail open" without warning. + # + # @overload test_iam_permissions(request, options = nil) + # Pass arguments to `test_iam_permissions` via a request object, either of type + # {::Google::Iam::V1::TestIamPermissionsRequest} or an equivalent Hash. + # + # @param request [::Google::Iam::V1::TestIamPermissionsRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @overload test_iam_permissions(resource: nil, permissions: nil) + # Pass arguments to `test_iam_permissions` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param resource [::String] + # REQUIRED: The resource for which the policy detail is being requested. + # See the operation documentation for the appropriate value for this field. + # @param permissions [::Array<::String>] + # The set of permissions to check for the `resource`. Permissions with + # wildcards (such as '*' or 'storage.*') are not allowed. For more + # information see + # [IAM Overview](https://cloud.google.com/iam/docs/overview#permissions). + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Iam::V1::TestIamPermissionsResponse] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Iam::V1::TestIamPermissionsResponse] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/secret_manager/v1beta2" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::SecretManager::V1beta2::SecretManagerService::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Iam::V1::TestIamPermissionsRequest.new + # + # # Call the test_iam_permissions method. + # result = client.test_iam_permissions request + # + # # The returned object is of type Google::Iam::V1::TestIamPermissionsResponse. + # p result + # + def test_iam_permissions request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Iam::V1::TestIamPermissionsRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + call_metadata = @config.rpcs.test_iam_permissions.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::SecretManager::V1beta2::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + options.apply_defaults timeout: @config.rpcs.test_iam_permissions.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.test_iam_permissions.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @secret_manager_service_stub.test_iam_permissions request, options do |result, operation| + yield result, operation if block_given? + end + rescue ::Gapic::Rest::Error => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Configuration class for the SecretManagerService REST API. + # + # This class represents the configuration for SecretManagerService REST, + # providing control over timeouts, retry behavior, logging, transport + # parameters, and other low-level controls. Certain parameters can also be + # applied individually to specific RPCs. See + # {::Google::Cloud::SecretManager::V1beta2::SecretManagerService::Rest::Client::Configuration::Rpcs} + # for a list of RPCs that can be configured independently. + # + # Configuration can be applied globally to all clients, or to a single client + # on construction. + # + # @example + # + # # Modify the global config, setting the timeout for + # # list_secrets to 20 seconds, + # # and all remaining timeouts to 10 seconds. + # ::Google::Cloud::SecretManager::V1beta2::SecretManagerService::Rest::Client.configure do |config| + # config.timeout = 10.0 + # config.rpcs.list_secrets.timeout = 20.0 + # end + # + # # Apply the above configuration only to a new client. + # client = ::Google::Cloud::SecretManager::V1beta2::SecretManagerService::Rest::Client.new do |config| + # config.timeout = 10.0 + # config.rpcs.list_secrets.timeout = 20.0 + # end + # + # @!attribute [rw] endpoint + # A custom service endpoint, as a hostname or hostname:port. The default is + # nil, indicating to use the default endpoint in the current universe domain. + # @return [::String,nil] + # @!attribute [rw] credentials + # Credentials to send with calls. You may provide any of the following types: + # * (`String`) The path to a service account key file in JSON format + # * (`Hash`) A service account key as a Hash + # * (`Google::Auth::Credentials`) A googleauth credentials object + # (see the [googleauth docs](https://rubydoc.info/gems/googleauth/Google/Auth/Credentials)) + # * (`Signet::OAuth2::Client`) A signet oauth2 client object + # (see the [signet docs](https://rubydoc.info/gems/signet/Signet/OAuth2/Client)) + # * (`nil`) indicating no credentials + # + # Warning: If you accept a credential configuration (JSON file or Hash) from an + # external source for authentication to Google Cloud, you must validate it before + # providing it to a Google API client library. Providing an unvalidated credential + # configuration to Google APIs can compromise the security of your systems and data. + # For more information, refer to [Validate credential configurations from external + # sources](https://cloud.google.com/docs/authentication/external/externally-sourced-credentials). + # @return [::Object] + # @!attribute [rw] scope + # The OAuth scopes + # @return [::Array<::String>] + # @!attribute [rw] lib_name + # The library name as recorded in instrumentation and logging + # @return [::String] + # @!attribute [rw] lib_version + # The library version as recorded in instrumentation and logging + # @return [::String] + # @!attribute [rw] timeout + # The call timeout in seconds. + # @return [::Numeric] + # @!attribute [rw] metadata + # Additional headers to be sent with the call. + # @return [::Hash{::Symbol=>::String}] + # @!attribute [rw] retry_policy + # The retry policy. The value is a hash with the following keys: + # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds. + # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds. + # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier. + # * `:retry_codes` (*type:* `Array`) - The error codes that should + # trigger a retry. + # @return [::Hash] + # @!attribute [rw] quota_project + # A separate project against which to charge quota. + # @return [::String] + # @!attribute [rw] universe_domain + # The universe domain within which to make requests. This determines the + # default endpoint URL. The default value of nil uses the environment + # universe (usually the default "googleapis.com" universe). + # @return [::String,nil] + # @!attribute [rw] logger + # A custom logger to use for request/response debug logging, or the value + # `:default` (the default) to construct a default logger, or `nil` to + # explicitly disable logging. + # @return [::Logger,:default,nil] + # + class Configuration + extend ::Gapic::Config + + # @private + # The endpoint specific to the default "googleapis.com" universe. Deprecated. + DEFAULT_ENDPOINT = "secretmanager.googleapis.com" + + config_attr :endpoint, nil, ::String, nil + config_attr :credentials, nil do |value| + allowed = [::String, ::Hash, ::Proc, ::Symbol, ::Google::Auth::Credentials, ::Google::Auth::BaseClient, ::Signet::OAuth2::Client, nil] + allowed.any? { |klass| klass === value } + end + config_attr :scope, nil, ::String, ::Array, nil + config_attr :lib_name, nil, ::String, nil + config_attr :lib_version, nil, ::String, nil + config_attr :timeout, nil, ::Numeric, nil + config_attr :metadata, nil, ::Hash, nil + config_attr :retry_policy, nil, ::Hash, ::Proc, nil + config_attr :quota_project, nil, ::String, nil + config_attr :universe_domain, nil, ::String, nil + + # @private + # Overrides for http bindings for the RPCs of this service + # are only used when this service is used as mixin, and only + # by the host service. + # @return [::Hash{::Symbol=>::Array<::Gapic::Rest::GrpcTranscoder::HttpBinding>}] + config_attr :bindings_override, {}, ::Hash, nil + config_attr :logger, :default, ::Logger, nil, :default + + # @private + def initialize parent_config = nil + @parent_config = parent_config unless parent_config.nil? + + yield self if block_given? + end + + ## + # Configurations for individual RPCs + # @return [Rpcs] + # + def rpcs + @rpcs ||= begin + parent_rpcs = nil + parent_rpcs = @parent_config.rpcs if defined?(@parent_config) && @parent_config.respond_to?(:rpcs) + Rpcs.new parent_rpcs + end + end + + ## + # Configuration RPC class for the SecretManagerService API. + # + # Includes fields providing the configuration for each RPC in this service. + # Each configuration object is of type `Gapic::Config::Method` and includes + # the following configuration fields: + # + # * `timeout` (*type:* `Numeric`) - The call timeout in seconds + # * `metadata` (*type:* `Hash{Symbol=>String}`) - Additional headers + # * `retry_policy (*type:* `Hash`) - The retry policy. The policy fields + # include the following keys: + # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds. + # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds. + # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier. + # * `:retry_codes` (*type:* `Array`) - The error codes that should + # trigger a retry. + # + class Rpcs + ## + # RPC-specific configuration for `list_secrets` + # @return [::Gapic::Config::Method] + # + attr_reader :list_secrets + ## + # RPC-specific configuration for `create_secret` + # @return [::Gapic::Config::Method] + # + attr_reader :create_secret + ## + # RPC-specific configuration for `add_secret_version` + # @return [::Gapic::Config::Method] + # + attr_reader :add_secret_version + ## + # RPC-specific configuration for `get_secret` + # @return [::Gapic::Config::Method] + # + attr_reader :get_secret + ## + # RPC-specific configuration for `update_secret` + # @return [::Gapic::Config::Method] + # + attr_reader :update_secret + ## + # RPC-specific configuration for `delete_secret` + # @return [::Gapic::Config::Method] + # + attr_reader :delete_secret + ## + # RPC-specific configuration for `list_secret_versions` + # @return [::Gapic::Config::Method] + # + attr_reader :list_secret_versions + ## + # RPC-specific configuration for `get_secret_version` + # @return [::Gapic::Config::Method] + # + attr_reader :get_secret_version + ## + # RPC-specific configuration for `access_secret_version` + # @return [::Gapic::Config::Method] + # + attr_reader :access_secret_version + ## + # RPC-specific configuration for `disable_secret_version` + # @return [::Gapic::Config::Method] + # + attr_reader :disable_secret_version + ## + # RPC-specific configuration for `enable_secret_version` + # @return [::Gapic::Config::Method] + # + attr_reader :enable_secret_version + ## + # RPC-specific configuration for `destroy_secret_version` + # @return [::Gapic::Config::Method] + # + attr_reader :destroy_secret_version + ## + # RPC-specific configuration for `set_iam_policy` + # @return [::Gapic::Config::Method] + # + attr_reader :set_iam_policy + ## + # RPC-specific configuration for `get_iam_policy` + # @return [::Gapic::Config::Method] + # + attr_reader :get_iam_policy + ## + # RPC-specific configuration for `test_iam_permissions` + # @return [::Gapic::Config::Method] + # + attr_reader :test_iam_permissions + + # @private + def initialize parent_rpcs = nil + list_secrets_config = parent_rpcs.list_secrets if parent_rpcs.respond_to? :list_secrets + @list_secrets = ::Gapic::Config::Method.new list_secrets_config + create_secret_config = parent_rpcs.create_secret if parent_rpcs.respond_to? :create_secret + @create_secret = ::Gapic::Config::Method.new create_secret_config + add_secret_version_config = parent_rpcs.add_secret_version if parent_rpcs.respond_to? :add_secret_version + @add_secret_version = ::Gapic::Config::Method.new add_secret_version_config + get_secret_config = parent_rpcs.get_secret if parent_rpcs.respond_to? :get_secret + @get_secret = ::Gapic::Config::Method.new get_secret_config + update_secret_config = parent_rpcs.update_secret if parent_rpcs.respond_to? :update_secret + @update_secret = ::Gapic::Config::Method.new update_secret_config + delete_secret_config = parent_rpcs.delete_secret if parent_rpcs.respond_to? :delete_secret + @delete_secret = ::Gapic::Config::Method.new delete_secret_config + list_secret_versions_config = parent_rpcs.list_secret_versions if parent_rpcs.respond_to? :list_secret_versions + @list_secret_versions = ::Gapic::Config::Method.new list_secret_versions_config + get_secret_version_config = parent_rpcs.get_secret_version if parent_rpcs.respond_to? :get_secret_version + @get_secret_version = ::Gapic::Config::Method.new get_secret_version_config + access_secret_version_config = parent_rpcs.access_secret_version if parent_rpcs.respond_to? :access_secret_version + @access_secret_version = ::Gapic::Config::Method.new access_secret_version_config + disable_secret_version_config = parent_rpcs.disable_secret_version if parent_rpcs.respond_to? :disable_secret_version + @disable_secret_version = ::Gapic::Config::Method.new disable_secret_version_config + enable_secret_version_config = parent_rpcs.enable_secret_version if parent_rpcs.respond_to? :enable_secret_version + @enable_secret_version = ::Gapic::Config::Method.new enable_secret_version_config + destroy_secret_version_config = parent_rpcs.destroy_secret_version if parent_rpcs.respond_to? :destroy_secret_version + @destroy_secret_version = ::Gapic::Config::Method.new destroy_secret_version_config + set_iam_policy_config = parent_rpcs.set_iam_policy if parent_rpcs.respond_to? :set_iam_policy + @set_iam_policy = ::Gapic::Config::Method.new set_iam_policy_config + get_iam_policy_config = parent_rpcs.get_iam_policy if parent_rpcs.respond_to? :get_iam_policy + @get_iam_policy = ::Gapic::Config::Method.new get_iam_policy_config + test_iam_permissions_config = parent_rpcs.test_iam_permissions if parent_rpcs.respond_to? :test_iam_permissions + @test_iam_permissions = ::Gapic::Config::Method.new test_iam_permissions_config + + yield self if block_given? + end + end + end + end + end + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-secret_manager-v1beta2/lib/google/cloud/secret_manager/v1beta2/secret_manager_service/rest/service_stub.rb b/owl-bot-staging/google-cloud-secret_manager-v1beta2/lib/google/cloud/secret_manager/v1beta2/secret_manager_service/rest/service_stub.rb new file mode 100644 index 000000000000..6975b7911fd6 --- /dev/null +++ b/owl-bot-staging/google-cloud-secret_manager-v1beta2/lib/google/cloud/secret_manager/v1beta2/secret_manager_service/rest/service_stub.rb @@ -0,0 +1,1117 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +require "google/cloud/secretmanager/v1beta2/service_pb" + +module Google + module Cloud + module SecretManager + module V1beta2 + module SecretManagerService + module Rest + ## + # REST service stub for the SecretManagerService service. + # Service stub contains baseline method implementations + # including transcoding, making the REST call, and deserialing the response. + # + class ServiceStub + # @private + def initialize endpoint:, endpoint_template:, universe_domain:, credentials:, logger: + # These require statements are intentionally placed here to initialize + # the REST modules only when it's required. + require "gapic/rest" + + @client_stub = ::Gapic::Rest::ClientStub.new endpoint: endpoint, + endpoint_template: endpoint_template, + universe_domain: universe_domain, + credentials: credentials, + numeric_enums: true, + service_name: self.class, + raise_faraday_errors: false, + logger: logger + end + + ## + # The effective universe domain + # + # @return [String] + # + def universe_domain + @client_stub.universe_domain + end + + ## + # The effective endpoint + # + # @return [String] + # + def endpoint + @client_stub.endpoint + end + + ## + # The logger used for request/response debug logging. + # + # @return [Logger] + # + def logger stub: false + stub ? @client_stub.stub_logger : @client_stub.logger + end + + ## + # Baseline implementation for the list_secrets REST call + # + # @param request_pb [::Google::Cloud::SecretManager::V1beta2::ListSecretsRequest] + # A request object representing the call parameters. Required. + # @param options [::Gapic::CallOptions] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Cloud::SecretManager::V1beta2::ListSecretsResponse] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::SecretManager::V1beta2::ListSecretsResponse] + # A result object deserialized from the server's reply + def list_secrets request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_list_secrets_request request_pb + query_string_params = if query_string_params.any? + query_string_params.to_h { |p| p.split "=", 2 } + else + {} + end + + response = @client_stub.make_http_request( + verb, + uri: uri, + body: body || "", + params: query_string_params, + method_name: "list_secrets", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Cloud::SecretManager::V1beta2::ListSecretsResponse.decode_json response.body, ignore_unknown_fields: true + catch :response do + yield result, operation if block_given? + result + end + end + + ## + # Baseline implementation for the create_secret REST call + # + # @param request_pb [::Google::Cloud::SecretManager::V1beta2::CreateSecretRequest] + # A request object representing the call parameters. Required. + # @param options [::Gapic::CallOptions] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Cloud::SecretManager::V1beta2::Secret] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::SecretManager::V1beta2::Secret] + # A result object deserialized from the server's reply + def create_secret request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_create_secret_request request_pb + query_string_params = if query_string_params.any? + query_string_params.to_h { |p| p.split "=", 2 } + else + {} + end + + response = @client_stub.make_http_request( + verb, + uri: uri, + body: body || "", + params: query_string_params, + method_name: "create_secret", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Cloud::SecretManager::V1beta2::Secret.decode_json response.body, ignore_unknown_fields: true + catch :response do + yield result, operation if block_given? + result + end + end + + ## + # Baseline implementation for the add_secret_version REST call + # + # @param request_pb [::Google::Cloud::SecretManager::V1beta2::AddSecretVersionRequest] + # A request object representing the call parameters. Required. + # @param options [::Gapic::CallOptions] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Cloud::SecretManager::V1beta2::SecretVersion] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::SecretManager::V1beta2::SecretVersion] + # A result object deserialized from the server's reply + def add_secret_version request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_add_secret_version_request request_pb + query_string_params = if query_string_params.any? + query_string_params.to_h { |p| p.split "=", 2 } + else + {} + end + + response = @client_stub.make_http_request( + verb, + uri: uri, + body: body || "", + params: query_string_params, + method_name: "add_secret_version", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Cloud::SecretManager::V1beta2::SecretVersion.decode_json response.body, ignore_unknown_fields: true + catch :response do + yield result, operation if block_given? + result + end + end + + ## + # Baseline implementation for the get_secret REST call + # + # @param request_pb [::Google::Cloud::SecretManager::V1beta2::GetSecretRequest] + # A request object representing the call parameters. Required. + # @param options [::Gapic::CallOptions] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Cloud::SecretManager::V1beta2::Secret] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::SecretManager::V1beta2::Secret] + # A result object deserialized from the server's reply + def get_secret request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_get_secret_request request_pb + query_string_params = if query_string_params.any? + query_string_params.to_h { |p| p.split "=", 2 } + else + {} + end + + response = @client_stub.make_http_request( + verb, + uri: uri, + body: body || "", + params: query_string_params, + method_name: "get_secret", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Cloud::SecretManager::V1beta2::Secret.decode_json response.body, ignore_unknown_fields: true + catch :response do + yield result, operation if block_given? + result + end + end + + ## + # Baseline implementation for the update_secret REST call + # + # @param request_pb [::Google::Cloud::SecretManager::V1beta2::UpdateSecretRequest] + # A request object representing the call parameters. Required. + # @param options [::Gapic::CallOptions] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Cloud::SecretManager::V1beta2::Secret] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::SecretManager::V1beta2::Secret] + # A result object deserialized from the server's reply + def update_secret request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_update_secret_request request_pb + query_string_params = if query_string_params.any? + query_string_params.to_h { |p| p.split "=", 2 } + else + {} + end + + response = @client_stub.make_http_request( + verb, + uri: uri, + body: body || "", + params: query_string_params, + method_name: "update_secret", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Cloud::SecretManager::V1beta2::Secret.decode_json response.body, ignore_unknown_fields: true + catch :response do + yield result, operation if block_given? + result + end + end + + ## + # Baseline implementation for the delete_secret REST call + # + # @param request_pb [::Google::Cloud::SecretManager::V1beta2::DeleteSecretRequest] + # A request object representing the call parameters. Required. + # @param options [::Gapic::CallOptions] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Protobuf::Empty] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Protobuf::Empty] + # A result object deserialized from the server's reply + def delete_secret request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_delete_secret_request request_pb + query_string_params = if query_string_params.any? + query_string_params.to_h { |p| p.split "=", 2 } + else + {} + end + + response = @client_stub.make_http_request( + verb, + uri: uri, + body: body || "", + params: query_string_params, + method_name: "delete_secret", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Protobuf::Empty.decode_json response.body, ignore_unknown_fields: true + catch :response do + yield result, operation if block_given? + result + end + end + + ## + # Baseline implementation for the list_secret_versions REST call + # + # @param request_pb [::Google::Cloud::SecretManager::V1beta2::ListSecretVersionsRequest] + # A request object representing the call parameters. Required. + # @param options [::Gapic::CallOptions] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Cloud::SecretManager::V1beta2::ListSecretVersionsResponse] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::SecretManager::V1beta2::ListSecretVersionsResponse] + # A result object deserialized from the server's reply + def list_secret_versions request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_list_secret_versions_request request_pb + query_string_params = if query_string_params.any? + query_string_params.to_h { |p| p.split "=", 2 } + else + {} + end + + response = @client_stub.make_http_request( + verb, + uri: uri, + body: body || "", + params: query_string_params, + method_name: "list_secret_versions", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Cloud::SecretManager::V1beta2::ListSecretVersionsResponse.decode_json response.body, ignore_unknown_fields: true + catch :response do + yield result, operation if block_given? + result + end + end + + ## + # Baseline implementation for the get_secret_version REST call + # + # @param request_pb [::Google::Cloud::SecretManager::V1beta2::GetSecretVersionRequest] + # A request object representing the call parameters. Required. + # @param options [::Gapic::CallOptions] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Cloud::SecretManager::V1beta2::SecretVersion] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::SecretManager::V1beta2::SecretVersion] + # A result object deserialized from the server's reply + def get_secret_version request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_get_secret_version_request request_pb + query_string_params = if query_string_params.any? + query_string_params.to_h { |p| p.split "=", 2 } + else + {} + end + + response = @client_stub.make_http_request( + verb, + uri: uri, + body: body || "", + params: query_string_params, + method_name: "get_secret_version", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Cloud::SecretManager::V1beta2::SecretVersion.decode_json response.body, ignore_unknown_fields: true + catch :response do + yield result, operation if block_given? + result + end + end + + ## + # Baseline implementation for the access_secret_version REST call + # + # @param request_pb [::Google::Cloud::SecretManager::V1beta2::AccessSecretVersionRequest] + # A request object representing the call parameters. Required. + # @param options [::Gapic::CallOptions] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Cloud::SecretManager::V1beta2::AccessSecretVersionResponse] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::SecretManager::V1beta2::AccessSecretVersionResponse] + # A result object deserialized from the server's reply + def access_secret_version request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_access_secret_version_request request_pb + query_string_params = if query_string_params.any? + query_string_params.to_h { |p| p.split "=", 2 } + else + {} + end + + response = @client_stub.make_http_request( + verb, + uri: uri, + body: body || "", + params: query_string_params, + method_name: "access_secret_version", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Cloud::SecretManager::V1beta2::AccessSecretVersionResponse.decode_json response.body, ignore_unknown_fields: true + catch :response do + yield result, operation if block_given? + result + end + end + + ## + # Baseline implementation for the disable_secret_version REST call + # + # @param request_pb [::Google::Cloud::SecretManager::V1beta2::DisableSecretVersionRequest] + # A request object representing the call parameters. Required. + # @param options [::Gapic::CallOptions] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Cloud::SecretManager::V1beta2::SecretVersion] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::SecretManager::V1beta2::SecretVersion] + # A result object deserialized from the server's reply + def disable_secret_version request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_disable_secret_version_request request_pb + query_string_params = if query_string_params.any? + query_string_params.to_h { |p| p.split "=", 2 } + else + {} + end + + response = @client_stub.make_http_request( + verb, + uri: uri, + body: body || "", + params: query_string_params, + method_name: "disable_secret_version", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Cloud::SecretManager::V1beta2::SecretVersion.decode_json response.body, ignore_unknown_fields: true + catch :response do + yield result, operation if block_given? + result + end + end + + ## + # Baseline implementation for the enable_secret_version REST call + # + # @param request_pb [::Google::Cloud::SecretManager::V1beta2::EnableSecretVersionRequest] + # A request object representing the call parameters. Required. + # @param options [::Gapic::CallOptions] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Cloud::SecretManager::V1beta2::SecretVersion] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::SecretManager::V1beta2::SecretVersion] + # A result object deserialized from the server's reply + def enable_secret_version request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_enable_secret_version_request request_pb + query_string_params = if query_string_params.any? + query_string_params.to_h { |p| p.split "=", 2 } + else + {} + end + + response = @client_stub.make_http_request( + verb, + uri: uri, + body: body || "", + params: query_string_params, + method_name: "enable_secret_version", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Cloud::SecretManager::V1beta2::SecretVersion.decode_json response.body, ignore_unknown_fields: true + catch :response do + yield result, operation if block_given? + result + end + end + + ## + # Baseline implementation for the destroy_secret_version REST call + # + # @param request_pb [::Google::Cloud::SecretManager::V1beta2::DestroySecretVersionRequest] + # A request object representing the call parameters. Required. + # @param options [::Gapic::CallOptions] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Cloud::SecretManager::V1beta2::SecretVersion] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::SecretManager::V1beta2::SecretVersion] + # A result object deserialized from the server's reply + def destroy_secret_version request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_destroy_secret_version_request request_pb + query_string_params = if query_string_params.any? + query_string_params.to_h { |p| p.split "=", 2 } + else + {} + end + + response = @client_stub.make_http_request( + verb, + uri: uri, + body: body || "", + params: query_string_params, + method_name: "destroy_secret_version", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Cloud::SecretManager::V1beta2::SecretVersion.decode_json response.body, ignore_unknown_fields: true + catch :response do + yield result, operation if block_given? + result + end + end + + ## + # Baseline implementation for the set_iam_policy REST call + # + # @param request_pb [::Google::Iam::V1::SetIamPolicyRequest] + # A request object representing the call parameters. Required. + # @param options [::Gapic::CallOptions] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Iam::V1::Policy] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Iam::V1::Policy] + # A result object deserialized from the server's reply + def set_iam_policy request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_set_iam_policy_request request_pb + query_string_params = if query_string_params.any? + query_string_params.to_h { |p| p.split "=", 2 } + else + {} + end + + response = @client_stub.make_http_request( + verb, + uri: uri, + body: body || "", + params: query_string_params, + method_name: "set_iam_policy", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Iam::V1::Policy.decode_json response.body, ignore_unknown_fields: true + catch :response do + yield result, operation if block_given? + result + end + end + + ## + # Baseline implementation for the get_iam_policy REST call + # + # @param request_pb [::Google::Iam::V1::GetIamPolicyRequest] + # A request object representing the call parameters. Required. + # @param options [::Gapic::CallOptions] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Iam::V1::Policy] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Iam::V1::Policy] + # A result object deserialized from the server's reply + def get_iam_policy request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_get_iam_policy_request request_pb + query_string_params = if query_string_params.any? + query_string_params.to_h { |p| p.split "=", 2 } + else + {} + end + + response = @client_stub.make_http_request( + verb, + uri: uri, + body: body || "", + params: query_string_params, + method_name: "get_iam_policy", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Iam::V1::Policy.decode_json response.body, ignore_unknown_fields: true + catch :response do + yield result, operation if block_given? + result + end + end + + ## + # Baseline implementation for the test_iam_permissions REST call + # + # @param request_pb [::Google::Iam::V1::TestIamPermissionsRequest] + # A request object representing the call parameters. Required. + # @param options [::Gapic::CallOptions] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Iam::V1::TestIamPermissionsResponse] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Iam::V1::TestIamPermissionsResponse] + # A result object deserialized from the server's reply + def test_iam_permissions request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_test_iam_permissions_request request_pb + query_string_params = if query_string_params.any? + query_string_params.to_h { |p| p.split "=", 2 } + else + {} + end + + response = @client_stub.make_http_request( + verb, + uri: uri, + body: body || "", + params: query_string_params, + method_name: "test_iam_permissions", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Iam::V1::TestIamPermissionsResponse.decode_json response.body, ignore_unknown_fields: true + catch :response do + yield result, operation if block_given? + result + end + end + + ## + # @private + # + # GRPC transcoding helper method for the list_secrets REST call + # + # @param request_pb [::Google::Cloud::SecretManager::V1beta2::ListSecretsRequest] + # A request object representing the call parameters. Required. + # @return [Array(String, [String, nil], Hash{String => String})] + # Uri, Body, Query string parameters + def self.transcode_list_secrets_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :get, + uri_template: "/v1beta2/{parent}/secrets", + matches: [ + ["parent", %r{^projects/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1beta2/{parent}/secrets", + matches: [ + ["parent", %r{^projects/[^/]+/locations/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the create_secret REST call + # + # @param request_pb [::Google::Cloud::SecretManager::V1beta2::CreateSecretRequest] + # A request object representing the call parameters. Required. + # @return [Array(String, [String, nil], Hash{String => String})] + # Uri, Body, Query string parameters + def self.transcode_create_secret_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :post, + uri_template: "/v1beta2/{parent}/secrets", + body: "secret", + matches: [ + ["parent", %r{^projects/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1beta2/{parent}/secrets", + body: "secret", + matches: [ + ["parent", %r{^projects/[^/]+/locations/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the add_secret_version REST call + # + # @param request_pb [::Google::Cloud::SecretManager::V1beta2::AddSecretVersionRequest] + # A request object representing the call parameters. Required. + # @return [Array(String, [String, nil], Hash{String => String})] + # Uri, Body, Query string parameters + def self.transcode_add_secret_version_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :post, + uri_template: "/v1beta2/{parent}:addVersion", + body: "*", + matches: [ + ["parent", %r{^projects/[^/]+/secrets/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1beta2/{parent}:addVersion", + body: "*", + matches: [ + ["parent", %r{^projects/[^/]+/locations/[^/]+/secrets/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the get_secret REST call + # + # @param request_pb [::Google::Cloud::SecretManager::V1beta2::GetSecretRequest] + # A request object representing the call parameters. Required. + # @return [Array(String, [String, nil], Hash{String => String})] + # Uri, Body, Query string parameters + def self.transcode_get_secret_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :get, + uri_template: "/v1beta2/{name}", + matches: [ + ["name", %r{^projects/[^/]+/secrets/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1beta2/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/secrets/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the update_secret REST call + # + # @param request_pb [::Google::Cloud::SecretManager::V1beta2::UpdateSecretRequest] + # A request object representing the call parameters. Required. + # @return [Array(String, [String, nil], Hash{String => String})] + # Uri, Body, Query string parameters + def self.transcode_update_secret_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :patch, + uri_template: "/v1beta2/{secret.name}", + body: "secret", + matches: [ + ["secret.name", %r{^projects/[^/]+/secrets/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :patch, + uri_template: "/v1beta2/{secret.name}", + body: "secret", + matches: [ + ["secret.name", %r{^projects/[^/]+/locations/[^/]+/secrets/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the delete_secret REST call + # + # @param request_pb [::Google::Cloud::SecretManager::V1beta2::DeleteSecretRequest] + # A request object representing the call parameters. Required. + # @return [Array(String, [String, nil], Hash{String => String})] + # Uri, Body, Query string parameters + def self.transcode_delete_secret_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :delete, + uri_template: "/v1beta2/{name}", + matches: [ + ["name", %r{^projects/[^/]+/secrets/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/v1beta2/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/secrets/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the list_secret_versions REST call + # + # @param request_pb [::Google::Cloud::SecretManager::V1beta2::ListSecretVersionsRequest] + # A request object representing the call parameters. Required. + # @return [Array(String, [String, nil], Hash{String => String})] + # Uri, Body, Query string parameters + def self.transcode_list_secret_versions_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :get, + uri_template: "/v1beta2/{parent}/versions", + matches: [ + ["parent", %r{^projects/[^/]+/secrets/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1beta2/{parent}/versions", + matches: [ + ["parent", %r{^projects/[^/]+/locations/[^/]+/secrets/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the get_secret_version REST call + # + # @param request_pb [::Google::Cloud::SecretManager::V1beta2::GetSecretVersionRequest] + # A request object representing the call parameters. Required. + # @return [Array(String, [String, nil], Hash{String => String})] + # Uri, Body, Query string parameters + def self.transcode_get_secret_version_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :get, + uri_template: "/v1beta2/{name}", + matches: [ + ["name", %r{^projects/[^/]+/secrets/[^/]+/versions/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1beta2/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/secrets/[^/]+/versions/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the access_secret_version REST call + # + # @param request_pb [::Google::Cloud::SecretManager::V1beta2::AccessSecretVersionRequest] + # A request object representing the call parameters. Required. + # @return [Array(String, [String, nil], Hash{String => String})] + # Uri, Body, Query string parameters + def self.transcode_access_secret_version_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :get, + uri_template: "/v1beta2/{name}:access", + matches: [ + ["name", %r{^projects/[^/]+/secrets/[^/]+/versions/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1beta2/{name}:access", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/secrets/[^/]+/versions/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the disable_secret_version REST call + # + # @param request_pb [::Google::Cloud::SecretManager::V1beta2::DisableSecretVersionRequest] + # A request object representing the call parameters. Required. + # @return [Array(String, [String, nil], Hash{String => String})] + # Uri, Body, Query string parameters + def self.transcode_disable_secret_version_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :post, + uri_template: "/v1beta2/{name}:disable", + body: "*", + matches: [ + ["name", %r{^projects/[^/]+/secrets/[^/]+/versions/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1beta2/{name}:disable", + body: "*", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/secrets/[^/]+/versions/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the enable_secret_version REST call + # + # @param request_pb [::Google::Cloud::SecretManager::V1beta2::EnableSecretVersionRequest] + # A request object representing the call parameters. Required. + # @return [Array(String, [String, nil], Hash{String => String})] + # Uri, Body, Query string parameters + def self.transcode_enable_secret_version_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :post, + uri_template: "/v1beta2/{name}:enable", + body: "*", + matches: [ + ["name", %r{^projects/[^/]+/secrets/[^/]+/versions/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1beta2/{name}:enable", + body: "*", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/secrets/[^/]+/versions/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the destroy_secret_version REST call + # + # @param request_pb [::Google::Cloud::SecretManager::V1beta2::DestroySecretVersionRequest] + # A request object representing the call parameters. Required. + # @return [Array(String, [String, nil], Hash{String => String})] + # Uri, Body, Query string parameters + def self.transcode_destroy_secret_version_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :post, + uri_template: "/v1beta2/{name}:destroy", + body: "*", + matches: [ + ["name", %r{^projects/[^/]+/secrets/[^/]+/versions/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1beta2/{name}:destroy", + body: "*", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/secrets/[^/]+/versions/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the set_iam_policy REST call + # + # @param request_pb [::Google::Iam::V1::SetIamPolicyRequest] + # A request object representing the call parameters. Required. + # @return [Array(String, [String, nil], Hash{String => String})] + # Uri, Body, Query string parameters + def self.transcode_set_iam_policy_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :post, + uri_template: "/v1beta2/{resource}:setIamPolicy", + body: "*", + matches: [ + ["resource", %r{^projects/[^/]+/secrets/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1beta2/{resource}:setIamPolicy", + body: "*", + matches: [ + ["resource", %r{^projects/[^/]+/locations/[^/]+/secrets/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the get_iam_policy REST call + # + # @param request_pb [::Google::Iam::V1::GetIamPolicyRequest] + # A request object representing the call parameters. Required. + # @return [Array(String, [String, nil], Hash{String => String})] + # Uri, Body, Query string parameters + def self.transcode_get_iam_policy_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :get, + uri_template: "/v1beta2/{resource}:getIamPolicy", + matches: [ + ["resource", %r{^projects/[^/]+/secrets/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1beta2/{resource}:getIamPolicy", + matches: [ + ["resource", %r{^projects/[^/]+/locations/[^/]+/secrets/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the test_iam_permissions REST call + # + # @param request_pb [::Google::Iam::V1::TestIamPermissionsRequest] + # A request object representing the call parameters. Required. + # @return [Array(String, [String, nil], Hash{String => String})] + # Uri, Body, Query string parameters + def self.transcode_test_iam_permissions_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :post, + uri_template: "/v1beta2/{resource}:testIamPermissions", + body: "*", + matches: [ + ["resource", %r{^projects/[^/]+/secrets/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1beta2/{resource}:testIamPermissions", + body: "*", + matches: [ + ["resource", %r{^projects/[^/]+/locations/[^/]+/secrets/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + end + end + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-secret_manager-v1beta2/lib/google/cloud/secret_manager/v1beta2/version.rb b/owl-bot-staging/google-cloud-secret_manager-v1beta2/lib/google/cloud/secret_manager/v1beta2/version.rb new file mode 100644 index 000000000000..256dc4e50205 --- /dev/null +++ b/owl-bot-staging/google-cloud-secret_manager-v1beta2/lib/google/cloud/secret_manager/v1beta2/version.rb @@ -0,0 +1,28 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + + +module Google + module Cloud + module SecretManager + module V1beta2 + VERSION = "0.0.1" + end + end + end +end diff --git a/owl-bot-staging/google-cloud-secret_manager-v1beta2/lib/google/cloud/secretmanager/v1beta2/resources_pb.rb b/owl-bot-staging/google-cloud-secret_manager-v1beta2/lib/google/cloud/secretmanager/v1beta2/resources_pb.rb new file mode 100644 index 000000000000..3c6f0ebe8af9 --- /dev/null +++ b/owl-bot-staging/google-cloud-secret_manager-v1beta2/lib/google/cloud/secretmanager/v1beta2/resources_pb.rb @@ -0,0 +1,41 @@ +# frozen_string_literal: true +# Generated by the protocol buffer compiler. DO NOT EDIT! +# source: google/cloud/secretmanager/v1beta2/resources.proto + +require 'google/protobuf' + +require 'google/api/field_behavior_pb' +require 'google/api/resource_pb' +require 'google/protobuf/duration_pb' +require 'google/protobuf/timestamp_pb' + + +descriptor_data = "\n2google/cloud/secretmanager/v1beta2/resources.proto\x12\"google.cloud.secretmanager.v1beta2\x1a\x1fgoogle/api/field_behavior.proto\x1a\x19google/api/resource.proto\x1a\x1egoogle/protobuf/duration.proto\x1a\x1fgoogle/protobuf/timestamp.proto\"\x85\t\n\x06Secret\x12\x11\n\x04name\x18\x01 \x01(\tB\x03\xe0\x41\x03\x12L\n\x0breplication\x18\x02 \x01(\x0b\x32/.google.cloud.secretmanager.v1beta2.ReplicationB\x06\xe0\x41\x05\xe0\x41\x01\x12\x34\n\x0b\x63reate_time\x18\x03 \x01(\x0b\x32\x1a.google.protobuf.TimestampB\x03\xe0\x41\x03\x12\x46\n\x06labels\x18\x04 \x03(\x0b\x32\x36.google.cloud.secretmanager.v1beta2.Secret.LabelsEntry\x12>\n\x06topics\x18\x05 \x03(\x0b\x32).google.cloud.secretmanager.v1beta2.TopicB\x03\xe0\x41\x01\x12\x36\n\x0b\x65xpire_time\x18\x06 \x01(\x0b\x32\x1a.google.protobuf.TimestampB\x03\xe0\x41\x01H\x00\x12-\n\x03ttl\x18\x07 \x01(\x0b\x32\x19.google.protobuf.DurationB\x03\xe0\x41\x04H\x00\x12\x11\n\x04\x65tag\x18\x08 \x01(\tB\x03\xe0\x41\x01\x12\x43\n\x08rotation\x18\t \x01(\x0b\x32,.google.cloud.secretmanager.v1beta2.RotationB\x03\xe0\x41\x01\x12\\\n\x0fversion_aliases\x18\x0b \x03(\x0b\x32>.google.cloud.secretmanager.v1beta2.Secret.VersionAliasesEntryB\x03\xe0\x41\x01\x12U\n\x0b\x61nnotations\x18\r \x03(\x0b\x32;.google.cloud.secretmanager.v1beta2.Secret.AnnotationsEntryB\x03\xe0\x41\x01\x12;\n\x13version_destroy_ttl\x18\x0e \x01(\x0b\x32\x19.google.protobuf.DurationB\x03\xe0\x41\x01\x12g\n\x1b\x63ustomer_managed_encryption\x18\x0f \x01(\x0b\x32=.google.cloud.secretmanager.v1beta2.CustomerManagedEncryptionB\x03\xe0\x41\x01\x1a-\n\x0bLabelsEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12\r\n\x05value\x18\x02 \x01(\t:\x02\x38\x01\x1a\x35\n\x13VersionAliasesEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12\r\n\x05value\x18\x02 \x01(\x03:\x02\x38\x01\x1a\x32\n\x10\x41nnotationsEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12\r\n\x05value\x18\x02 \x01(\t:\x02\x38\x01:\x99\x01\xea\x41\x95\x01\n#secretmanager.googleapis.com/Secret\x12#projects/{project}/secrets/{secret}\x12\x38projects/{project}/locations/{location}/secrets/{secret}*\x07secrets2\x06secretB\x0c\n\nexpiration\"\xd1\x06\n\rSecretVersion\x12\x11\n\x04name\x18\x01 \x01(\tB\x03\xe0\x41\x03\x12\x34\n\x0b\x63reate_time\x18\x02 \x01(\x0b\x32\x1a.google.protobuf.TimestampB\x03\xe0\x41\x03\x12\x35\n\x0c\x64\x65stroy_time\x18\x03 \x01(\x0b\x32\x1a.google.protobuf.TimestampB\x03\xe0\x41\x03\x12K\n\x05state\x18\x04 \x01(\x0e\x32\x37.google.cloud.secretmanager.v1beta2.SecretVersion.StateB\x03\xe0\x41\x03\x12Q\n\x12replication_status\x18\x05 \x01(\x0b\x32\x35.google.cloud.secretmanager.v1beta2.ReplicationStatus\x12\x11\n\x04\x65tag\x18\x06 \x01(\tB\x03\xe0\x41\x03\x12.\n!client_specified_payload_checksum\x18\x07 \x01(\x08\x42\x03\xe0\x41\x03\x12?\n\x16scheduled_destroy_time\x18\x08 \x01(\x0b\x32\x1a.google.protobuf.TimestampB\x03\xe0\x41\x03\x12m\n\x1b\x63ustomer_managed_encryption\x18\t \x01(\x0b\x32\x43.google.cloud.secretmanager.v1beta2.CustomerManagedEncryptionStatusB\x03\xe0\x41\x03\"H\n\x05State\x12\x15\n\x11STATE_UNSPECIFIED\x10\x00\x12\x0b\n\x07\x45NABLED\x10\x01\x12\x0c\n\x08\x44ISABLED\x10\x02\x12\r\n\tDESTROYED\x10\x03:\xe2\x01\xea\x41\xde\x01\n*secretmanager.googleapis.com/SecretVersion\x12=projects/{project}/secrets/{secret}/versions/{secret_version}\x12Rprojects/{project}/locations/{location}/secrets/{secret}/versions/{secret_version}*\x0esecretVersions2\rsecretVersion\"\xaa\x04\n\x0bReplication\x12N\n\tautomatic\x18\x01 \x01(\x0b\x32\x39.google.cloud.secretmanager.v1beta2.Replication.AutomaticH\x00\x12S\n\x0cuser_managed\x18\x02 \x01(\x0b\x32;.google.cloud.secretmanager.v1beta2.Replication.UserManagedH\x00\x1at\n\tAutomatic\x12g\n\x1b\x63ustomer_managed_encryption\x18\x01 \x01(\x0b\x32=.google.cloud.secretmanager.v1beta2.CustomerManagedEncryptionB\x03\xe0\x41\x01\x1a\xf0\x01\n\x0bUserManaged\x12Z\n\x08replicas\x18\x01 \x03(\x0b\x32\x43.google.cloud.secretmanager.v1beta2.Replication.UserManaged.ReplicaB\x03\xe0\x41\x02\x1a\x84\x01\n\x07Replica\x12\x10\n\x08location\x18\x01 \x01(\t\x12g\n\x1b\x63ustomer_managed_encryption\x18\x02 \x01(\x0b\x32=.google.cloud.secretmanager.v1beta2.CustomerManagedEncryptionB\x03\xe0\x41\x01\x42\r\n\x0breplication\"6\n\x19\x43ustomerManagedEncryption\x12\x19\n\x0ckms_key_name\x18\x01 \x01(\tB\x03\xe0\x41\x02\"\x85\x05\n\x11ReplicationStatus\x12Z\n\tautomatic\x18\x01 \x01(\x0b\x32\x45.google.cloud.secretmanager.v1beta2.ReplicationStatus.AutomaticStatusH\x00\x12_\n\x0cuser_managed\x18\x02 \x01(\x0b\x32G.google.cloud.secretmanager.v1beta2.ReplicationStatus.UserManagedStatusH\x00\x1a\x80\x01\n\x0f\x41utomaticStatus\x12m\n\x1b\x63ustomer_managed_encryption\x18\x01 \x01(\x0b\x32\x43.google.cloud.secretmanager.v1beta2.CustomerManagedEncryptionStatusB\x03\xe0\x41\x03\x1a\x99\x02\n\x11UserManagedStatus\x12l\n\x08replicas\x18\x01 \x03(\x0b\x32U.google.cloud.secretmanager.v1beta2.ReplicationStatus.UserManagedStatus.ReplicaStatusB\x03\xe0\x41\x03\x1a\x95\x01\n\rReplicaStatus\x12\x15\n\x08location\x18\x01 \x01(\tB\x03\xe0\x41\x03\x12m\n\x1b\x63ustomer_managed_encryption\x18\x02 \x01(\x0b\x32\x43.google.cloud.secretmanager.v1beta2.CustomerManagedEncryptionStatusB\x03\xe0\x41\x03\x42\x14\n\x12replication_status\"D\n\x1f\x43ustomerManagedEncryptionStatus\x12!\n\x14kms_key_version_name\x18\x01 \x01(\tB\x03\xe0\x41\x02\"_\n\x05Topic\x12\x11\n\x04name\x18\x01 \x01(\tB\x03\xe0\x41\x02:C\xea\x41@\n\x1bpubsub.googleapis.com/Topic\x12!projects/{project}/topics/{topic}\"\x80\x01\n\x08Rotation\x12;\n\x12next_rotation_time\x18\x01 \x01(\x0b\x32\x1a.google.protobuf.TimestampB\x03\xe0\x41\x01\x12\x37\n\x0frotation_period\x18\x02 \x01(\x0b\x32\x19.google.protobuf.DurationB\x03\xe0\x41\x04\"L\n\rSecretPayload\x12\x0c\n\x04\x64\x61ta\x18\x01 \x01(\x0c\x12\x1d\n\x0b\x64\x61ta_crc32c\x18\x02 \x01(\x03\x42\x03\xe0\x41\x01H\x00\x88\x01\x01\x42\x0e\n\x0c_data_crc32cB\x80\x02\n&com.google.cloud.secretmanager.v1beta2B\x0eResourcesProtoP\x01ZLcloud.google.com/go/secretmanager/apiv1beta2/secretmanagerpb;secretmanagerpb\xa2\x02\x03GSM\xaa\x02\"Google.Cloud.SecretManager.V1Beta2\xca\x02\"Google\\Cloud\\SecretManager\\V1beta2\xea\x02%Google::Cloud::SecretManager::V1beta2b\x06proto3" + +pool = ::Google::Protobuf::DescriptorPool.generated_pool +pool.add_serialized_file(descriptor_data) + +module Google + module Cloud + module SecretManager + module V1beta2 + Secret = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.secretmanager.v1beta2.Secret").msgclass + SecretVersion = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.secretmanager.v1beta2.SecretVersion").msgclass + SecretVersion::State = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.secretmanager.v1beta2.SecretVersion.State").enummodule + Replication = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.secretmanager.v1beta2.Replication").msgclass + Replication::Automatic = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.secretmanager.v1beta2.Replication.Automatic").msgclass + Replication::UserManaged = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.secretmanager.v1beta2.Replication.UserManaged").msgclass + Replication::UserManaged::Replica = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.secretmanager.v1beta2.Replication.UserManaged.Replica").msgclass + CustomerManagedEncryption = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.secretmanager.v1beta2.CustomerManagedEncryption").msgclass + ReplicationStatus = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.secretmanager.v1beta2.ReplicationStatus").msgclass + ReplicationStatus::AutomaticStatus = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.secretmanager.v1beta2.ReplicationStatus.AutomaticStatus").msgclass + ReplicationStatus::UserManagedStatus = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.secretmanager.v1beta2.ReplicationStatus.UserManagedStatus").msgclass + ReplicationStatus::UserManagedStatus::ReplicaStatus = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.secretmanager.v1beta2.ReplicationStatus.UserManagedStatus.ReplicaStatus").msgclass + CustomerManagedEncryptionStatus = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.secretmanager.v1beta2.CustomerManagedEncryptionStatus").msgclass + Topic = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.secretmanager.v1beta2.Topic").msgclass + Rotation = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.secretmanager.v1beta2.Rotation").msgclass + SecretPayload = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.secretmanager.v1beta2.SecretPayload").msgclass + end + end + end +end diff --git a/owl-bot-staging/google-cloud-secret_manager-v1beta2/lib/google/cloud/secretmanager/v1beta2/service_pb.rb b/owl-bot-staging/google-cloud-secret_manager-v1beta2/lib/google/cloud/secretmanager/v1beta2/service_pb.rb new file mode 100644 index 000000000000..36eb635dcf02 --- /dev/null +++ b/owl-bot-staging/google-cloud-secret_manager-v1beta2/lib/google/cloud/secretmanager/v1beta2/service_pb.rb @@ -0,0 +1,45 @@ +# frozen_string_literal: true +# Generated by the protocol buffer compiler. DO NOT EDIT! +# source: google/cloud/secretmanager/v1beta2/service.proto + +require 'google/protobuf' + +require 'google/api/annotations_pb' +require 'google/api/client_pb' +require 'google/api/field_behavior_pb' +require 'google/api/resource_pb' +require 'google/cloud/secretmanager/v1beta2/resources_pb' +require 'google/iam/v1/iam_policy_pb' +require 'google/iam/v1/policy_pb' +require 'google/protobuf/empty_pb' +require 'google/protobuf/field_mask_pb' + + +descriptor_data = "\n0google/cloud/secretmanager/v1beta2/service.proto\x12\"google.cloud.secretmanager.v1beta2\x1a\x1cgoogle/api/annotations.proto\x1a\x17google/api/client.proto\x1a\x1fgoogle/api/field_behavior.proto\x1a\x19google/api/resource.proto\x1a\x32google/cloud/secretmanager/v1beta2/resources.proto\x1a\x1egoogle/iam/v1/iam_policy.proto\x1a\x1agoogle/iam/v1/policy.proto\x1a\x1bgoogle/protobuf/empty.proto\x1a google/protobuf/field_mask.proto\"\x97\x01\n\x12ListSecretsRequest\x12;\n\x06parent\x18\x01 \x01(\tB+\xe0\x41\x02\xfa\x41%\x12#secretmanager.googleapis.com/Secret\x12\x16\n\tpage_size\x18\x02 \x01(\x05\x42\x03\xe0\x41\x01\x12\x17\n\npage_token\x18\x03 \x01(\tB\x03\xe0\x41\x01\x12\x13\n\x06\x66ilter\x18\x04 \x01(\tB\x03\xe0\x41\x01\"\x7f\n\x13ListSecretsResponse\x12;\n\x07secrets\x18\x01 \x03(\x0b\x32*.google.cloud.secretmanager.v1beta2.Secret\x12\x17\n\x0fnext_page_token\x18\x02 \x01(\t\x12\x12\n\ntotal_size\x18\x03 \x01(\x05\"\xab\x01\n\x13\x43reateSecretRequest\x12;\n\x06parent\x18\x01 \x01(\tB+\xe0\x41\x02\xfa\x41%\x12#secretmanager.googleapis.com/Secret\x12\x16\n\tsecret_id\x18\x02 \x01(\tB\x03\xe0\x41\x02\x12?\n\x06secret\x18\x03 \x01(\x0b\x32*.google.cloud.secretmanager.v1beta2.SecretB\x03\xe0\x41\x02\"\x9f\x01\n\x17\x41\x64\x64SecretVersionRequest\x12;\n\x06parent\x18\x01 \x01(\tB+\xe0\x41\x02\xfa\x41%\n#secretmanager.googleapis.com/Secret\x12G\n\x07payload\x18\x02 \x01(\x0b\x32\x31.google.cloud.secretmanager.v1beta2.SecretPayloadB\x03\xe0\x41\x02\"M\n\x10GetSecretRequest\x12\x39\n\x04name\x18\x01 \x01(\tB+\xe0\x41\x02\xfa\x41%\n#secretmanager.googleapis.com/Secret\"\x9e\x01\n\x19ListSecretVersionsRequest\x12;\n\x06parent\x18\x01 \x01(\tB+\xe0\x41\x02\xfa\x41%\n#secretmanager.googleapis.com/Secret\x12\x16\n\tpage_size\x18\x02 \x01(\x05\x42\x03\xe0\x41\x01\x12\x17\n\npage_token\x18\x03 \x01(\tB\x03\xe0\x41\x01\x12\x13\n\x06\x66ilter\x18\x04 \x01(\tB\x03\xe0\x41\x01\"\x8e\x01\n\x1aListSecretVersionsResponse\x12\x43\n\x08versions\x18\x01 \x03(\x0b\x32\x31.google.cloud.secretmanager.v1beta2.SecretVersion\x12\x17\n\x0fnext_page_token\x18\x02 \x01(\t\x12\x12\n\ntotal_size\x18\x03 \x01(\x05\"[\n\x17GetSecretVersionRequest\x12@\n\x04name\x18\x01 \x01(\tB2\xe0\x41\x02\xfa\x41,\n*secretmanager.googleapis.com/SecretVersion\"\x8c\x01\n\x13UpdateSecretRequest\x12?\n\x06secret\x18\x01 \x01(\x0b\x32*.google.cloud.secretmanager.v1beta2.SecretB\x03\xe0\x41\x02\x12\x34\n\x0bupdate_mask\x18\x02 \x01(\x0b\x32\x1a.google.protobuf.FieldMaskB\x03\xe0\x41\x02\"^\n\x1a\x41\x63\x63\x65ssSecretVersionRequest\x12@\n\x04name\x18\x01 \x01(\tB2\xe0\x41\x02\xfa\x41,\n*secretmanager.googleapis.com/SecretVersion\"\xa0\x01\n\x1b\x41\x63\x63\x65ssSecretVersionResponse\x12=\n\x04name\x18\x01 \x01(\tB/\xfa\x41,\n*secretmanager.googleapis.com/SecretVersion\x12\x42\n\x07payload\x18\x02 \x01(\x0b\x32\x31.google.cloud.secretmanager.v1beta2.SecretPayload\"c\n\x13\x44\x65leteSecretRequest\x12\x39\n\x04name\x18\x01 \x01(\tB+\xe0\x41\x02\xfa\x41%\n#secretmanager.googleapis.com/Secret\x12\x11\n\x04\x65tag\x18\x02 \x01(\tB\x03\xe0\x41\x01\"r\n\x1b\x44isableSecretVersionRequest\x12@\n\x04name\x18\x01 \x01(\tB2\xe0\x41\x02\xfa\x41,\n*secretmanager.googleapis.com/SecretVersion\x12\x11\n\x04\x65tag\x18\x02 \x01(\tB\x03\xe0\x41\x01\"q\n\x1a\x45nableSecretVersionRequest\x12@\n\x04name\x18\x01 \x01(\tB2\xe0\x41\x02\xfa\x41,\n*secretmanager.googleapis.com/SecretVersion\x12\x11\n\x04\x65tag\x18\x02 \x01(\tB\x03\xe0\x41\x01\"r\n\x1b\x44\x65stroySecretVersionRequest\x12@\n\x04name\x18\x01 \x01(\tB2\xe0\x41\x02\xfa\x41,\n*secretmanager.googleapis.com/SecretVersion\x12\x11\n\x04\x65tag\x18\x02 \x01(\tB\x03\xe0\x41\x01\x32\xf7\x1e\n\x14SecretManagerService\x12\xe9\x01\n\x0bListSecrets\x12\x36.google.cloud.secretmanager.v1beta2.ListSecretsRequest\x1a\x37.google.cloud.secretmanager.v1beta2.ListSecretsResponse\"i\xda\x41\x06parent\x82\xd3\xe4\x93\x02Z\x12$/v1beta2/{parent=projects/*}/secretsZ2\x12\x30/v1beta2/{parent=projects/*/locations/*}/secrets\x12\x80\x02\n\x0c\x43reateSecret\x12\x37.google.cloud.secretmanager.v1beta2.CreateSecretRequest\x1a*.google.cloud.secretmanager.v1beta2.Secret\"\x8a\x01\xda\x41\x17parent,secret_id,secret\x82\xd3\xe4\x93\x02j\"$/v1beta2/{parent=projects/*}/secrets:\x06secretZ:\"0/v1beta2/{parent=projects/*/locations/*}/secrets:\x06secret\x12\x96\x02\n\x10\x41\x64\x64SecretVersion\x12;.google.cloud.secretmanager.v1beta2.AddSecretVersionRequest\x1a\x31.google.cloud.secretmanager.v1beta2.SecretVersion\"\x91\x01\xda\x41\x0eparent,payload\x82\xd3\xe4\x93\x02z\"1/v1beta2/{parent=projects/*/secrets/*}:addVersion:\x01*ZB\"=/v1beta2/{parent=projects/*/locations/*/secrets/*}:addVersion:\x01*\x12\xd6\x01\n\tGetSecret\x12\x34.google.cloud.secretmanager.v1beta2.GetSecretRequest\x1a*.google.cloud.secretmanager.v1beta2.Secret\"g\xda\x41\x04name\x82\xd3\xe4\x93\x02Z\x12$/v1beta2/{name=projects/*/secrets/*}Z2\x12\x30/v1beta2/{name=projects/*/locations/*/secrets/*}\x12\x89\x02\n\x0cUpdateSecret\x12\x37.google.cloud.secretmanager.v1beta2.UpdateSecretRequest\x1a*.google.cloud.secretmanager.v1beta2.Secret\"\x93\x01\xda\x41\x12secret,update_mask\x82\xd3\xe4\x93\x02x2+/v1beta2/{secret.name=projects/*/secrets/*}:\x06secretZA27/v1beta2/{secret.name=projects/*/locations/*/secrets/*}:\x06secret\x12\xc8\x01\n\x0c\x44\x65leteSecret\x12\x37.google.cloud.secretmanager.v1beta2.DeleteSecretRequest\x1a\x16.google.protobuf.Empty\"g\xda\x41\x04name\x82\xd3\xe4\x93\x02Z*$/v1beta2/{name=projects/*/secrets/*}Z2*0/v1beta2/{name=projects/*/locations/*/secrets/*}\x12\x94\x02\n\x12ListSecretVersions\x12=.google.cloud.secretmanager.v1beta2.ListSecretVersionsRequest\x1a>.google.cloud.secretmanager.v1beta2.ListSecretVersionsResponse\"\x7f\xda\x41\x06parent\x82\xd3\xe4\x93\x02p\x12//v1beta2/{parent=projects/*/secrets/*}/versionsZ=\x12;/v1beta2/{parent=projects/*/locations/*/secrets/*}/versions\x12\x81\x02\n\x10GetSecretVersion\x12;.google.cloud.secretmanager.v1beta2.GetSecretVersionRequest\x1a\x31.google.cloud.secretmanager.v1beta2.SecretVersion\"}\xda\x41\x04name\x82\xd3\xe4\x93\x02p\x12//v1beta2/{name=projects/*/secrets/*/versions/*}Z=\x12;/v1beta2/{name=projects/*/locations/*/secrets/*/versions/*}\x12\xa4\x02\n\x13\x41\x63\x63\x65ssSecretVersion\x12>.google.cloud.secretmanager.v1beta2.AccessSecretVersionRequest\x1a?.google.cloud.secretmanager.v1beta2.AccessSecretVersionResponse\"\x8b\x01\xda\x41\x04name\x82\xd3\xe4\x93\x02~\x12\x36/v1beta2/{name=projects/*/secrets/*/versions/*}:accessZD\x12\x42/v1beta2/{name=projects/*/locations/*/secrets/*/versions/*}:access\x12\xa1\x02\n\x14\x44isableSecretVersion\x12?.google.cloud.secretmanager.v1beta2.DisableSecretVersionRequest\x1a\x31.google.cloud.secretmanager.v1beta2.SecretVersion\"\x94\x01\xda\x41\x04name\x82\xd3\xe4\x93\x02\x86\x01\"7/v1beta2/{name=projects/*/secrets/*/versions/*}:disable:\x01*ZH\"C/v1beta2/{name=projects/*/locations/*/secrets/*/versions/*}:disable:\x01*\x12\x9d\x02\n\x13\x45nableSecretVersion\x12>.google.cloud.secretmanager.v1beta2.EnableSecretVersionRequest\x1a\x31.google.cloud.secretmanager.v1beta2.SecretVersion\"\x92\x01\xda\x41\x04name\x82\xd3\xe4\x93\x02\x84\x01\"6/v1beta2/{name=projects/*/secrets/*/versions/*}:enable:\x01*ZG\"B/v1beta2/{name=projects/*/locations/*/secrets/*/versions/*}:enable:\x01*\x12\xa1\x02\n\x14\x44\x65stroySecretVersion\x12?.google.cloud.secretmanager.v1beta2.DestroySecretVersionRequest\x1a\x31.google.cloud.secretmanager.v1beta2.SecretVersion\"\x94\x01\xda\x41\x04name\x82\xd3\xe4\x93\x02\x86\x01\"7/v1beta2/{name=projects/*/secrets/*/versions/*}:destroy:\x01*ZH\"C/v1beta2/{name=projects/*/locations/*/secrets/*/versions/*}:destroy:\x01*\x12\xd5\x01\n\x0cSetIamPolicy\x12\".google.iam.v1.SetIamPolicyRequest\x1a\x15.google.iam.v1.Policy\"\x89\x01\x82\xd3\xe4\x93\x02\x82\x01\"5/v1beta2/{resource=projects/*/secrets/*}:setIamPolicy:\x01*ZF\"A/v1beta2/{resource=projects/*/locations/*/secrets/*}:setIamPolicy:\x01*\x12\xce\x01\n\x0cGetIamPolicy\x12\".google.iam.v1.GetIamPolicyRequest\x1a\x15.google.iam.v1.Policy\"\x82\x01\x82\xd3\xe4\x93\x02|\x12\x35/v1beta2/{resource=projects/*/secrets/*}:getIamPolicyZC\x12\x41/v1beta2/{resource=projects/*/locations/*/secrets/*}:getIamPolicy\x12\x81\x02\n\x12TestIamPermissions\x12(.google.iam.v1.TestIamPermissionsRequest\x1a).google.iam.v1.TestIamPermissionsResponse\"\x95\x01\x82\xd3\xe4\x93\x02\x8e\x01\";/v1beta2/{resource=projects/*/secrets/*}:testIamPermissions:\x01*ZL\"G/v1beta2/{resource=projects/*/locations/*/secrets/*}:testIamPermissions:\x01*\x1aP\xca\x41\x1csecretmanager.googleapis.com\xd2\x41.https://www.googleapis.com/auth/cloud-platformB\xfe\x01\n&com.google.cloud.secretmanager.v1beta2B\x0cServiceProtoP\x01ZLcloud.google.com/go/secretmanager/apiv1beta2/secretmanagerpb;secretmanagerpb\xa2\x02\x03GSM\xaa\x02\"Google.Cloud.SecretManager.V1Beta2\xca\x02\"Google\\Cloud\\SecretManager\\V1beta2\xea\x02%Google::Cloud::SecretManager::V1beta2b\x06proto3" + +pool = ::Google::Protobuf::DescriptorPool.generated_pool +pool.add_serialized_file(descriptor_data) + +module Google + module Cloud + module SecretManager + module V1beta2 + ListSecretsRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.secretmanager.v1beta2.ListSecretsRequest").msgclass + ListSecretsResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.secretmanager.v1beta2.ListSecretsResponse").msgclass + CreateSecretRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.secretmanager.v1beta2.CreateSecretRequest").msgclass + AddSecretVersionRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.secretmanager.v1beta2.AddSecretVersionRequest").msgclass + GetSecretRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.secretmanager.v1beta2.GetSecretRequest").msgclass + ListSecretVersionsRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.secretmanager.v1beta2.ListSecretVersionsRequest").msgclass + ListSecretVersionsResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.secretmanager.v1beta2.ListSecretVersionsResponse").msgclass + GetSecretVersionRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.secretmanager.v1beta2.GetSecretVersionRequest").msgclass + UpdateSecretRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.secretmanager.v1beta2.UpdateSecretRequest").msgclass + AccessSecretVersionRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.secretmanager.v1beta2.AccessSecretVersionRequest").msgclass + AccessSecretVersionResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.secretmanager.v1beta2.AccessSecretVersionResponse").msgclass + DeleteSecretRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.secretmanager.v1beta2.DeleteSecretRequest").msgclass + DisableSecretVersionRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.secretmanager.v1beta2.DisableSecretVersionRequest").msgclass + EnableSecretVersionRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.secretmanager.v1beta2.EnableSecretVersionRequest").msgclass + DestroySecretVersionRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.secretmanager.v1beta2.DestroySecretVersionRequest").msgclass + end + end + end +end diff --git a/owl-bot-staging/google-cloud-secret_manager-v1beta2/lib/google/cloud/secretmanager/v1beta2/service_services_pb.rb b/owl-bot-staging/google-cloud-secret_manager-v1beta2/lib/google/cloud/secretmanager/v1beta2/service_services_pb.rb new file mode 100644 index 000000000000..86d8147e919d --- /dev/null +++ b/owl-bot-staging/google-cloud-secret_manager-v1beta2/lib/google/cloud/secretmanager/v1beta2/service_services_pb.rb @@ -0,0 +1,125 @@ +# Generated by the protocol buffer compiler. DO NOT EDIT! +# Source: google/cloud/secretmanager/v1beta2/service.proto for package 'Google.Cloud.SecretManager.V1beta2' +# Original file comments: +# 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 +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# + +require 'grpc' +require 'google/cloud/secretmanager/v1beta2/service_pb' + +module Google + module Cloud + module SecretManager + module V1beta2 + module SecretManagerService + # Secret Manager Service + # + # Manages secrets and operations using those secrets. Implements a REST + # model with the following objects: + # + # * [Secret][google.cloud.secretmanager.v1beta2.Secret] + # * [SecretVersion][google.cloud.secretmanager.v1beta2.SecretVersion] + class Service + + include ::GRPC::GenericService + + self.marshal_class_method = :encode + self.unmarshal_class_method = :decode + self.service_name = 'google.cloud.secretmanager.v1beta2.SecretManagerService' + + # Lists [Secrets][google.cloud.secretmanager.v1beta2.Secret]. + rpc :ListSecrets, ::Google::Cloud::SecretManager::V1beta2::ListSecretsRequest, ::Google::Cloud::SecretManager::V1beta2::ListSecretsResponse + # Creates a new [Secret][google.cloud.secretmanager.v1beta2.Secret] + # containing no + # [SecretVersions][google.cloud.secretmanager.v1beta2.SecretVersion]. + rpc :CreateSecret, ::Google::Cloud::SecretManager::V1beta2::CreateSecretRequest, ::Google::Cloud::SecretManager::V1beta2::Secret + # Creates a new + # [SecretVersion][google.cloud.secretmanager.v1beta2.SecretVersion] + # containing secret data and attaches it to an existing + # [Secret][google.cloud.secretmanager.v1beta2.Secret]. + rpc :AddSecretVersion, ::Google::Cloud::SecretManager::V1beta2::AddSecretVersionRequest, ::Google::Cloud::SecretManager::V1beta2::SecretVersion + # Gets metadata for a given + # [Secret][google.cloud.secretmanager.v1beta2.Secret]. + rpc :GetSecret, ::Google::Cloud::SecretManager::V1beta2::GetSecretRequest, ::Google::Cloud::SecretManager::V1beta2::Secret + # Updates metadata of an existing + # [Secret][google.cloud.secretmanager.v1beta2.Secret]. + rpc :UpdateSecret, ::Google::Cloud::SecretManager::V1beta2::UpdateSecretRequest, ::Google::Cloud::SecretManager::V1beta2::Secret + # Deletes a [Secret][google.cloud.secretmanager.v1beta2.Secret]. + rpc :DeleteSecret, ::Google::Cloud::SecretManager::V1beta2::DeleteSecretRequest, ::Google::Protobuf::Empty + # Lists [SecretVersions][google.cloud.secretmanager.v1beta2.SecretVersion]. + # This call does not return secret data. + rpc :ListSecretVersions, ::Google::Cloud::SecretManager::V1beta2::ListSecretVersionsRequest, ::Google::Cloud::SecretManager::V1beta2::ListSecretVersionsResponse + # Gets metadata for a + # [SecretVersion][google.cloud.secretmanager.v1beta2.SecretVersion]. + # + # `projects/*/secrets/*/versions/latest` is an alias to the most recently + # created [SecretVersion][google.cloud.secretmanager.v1beta2.SecretVersion]. + rpc :GetSecretVersion, ::Google::Cloud::SecretManager::V1beta2::GetSecretVersionRequest, ::Google::Cloud::SecretManager::V1beta2::SecretVersion + # Accesses a + # [SecretVersion][google.cloud.secretmanager.v1beta2.SecretVersion]. This + # call returns the secret data. + # + # `projects/*/secrets/*/versions/latest` is an alias to the most recently + # created [SecretVersion][google.cloud.secretmanager.v1beta2.SecretVersion]. + rpc :AccessSecretVersion, ::Google::Cloud::SecretManager::V1beta2::AccessSecretVersionRequest, ::Google::Cloud::SecretManager::V1beta2::AccessSecretVersionResponse + # Disables a + # [SecretVersion][google.cloud.secretmanager.v1beta2.SecretVersion]. + # + # Sets the [state][google.cloud.secretmanager.v1beta2.SecretVersion.state] of + # the [SecretVersion][google.cloud.secretmanager.v1beta2.SecretVersion] to + # [DISABLED][google.cloud.secretmanager.v1beta2.SecretVersion.State.DISABLED]. + rpc :DisableSecretVersion, ::Google::Cloud::SecretManager::V1beta2::DisableSecretVersionRequest, ::Google::Cloud::SecretManager::V1beta2::SecretVersion + # Enables a + # [SecretVersion][google.cloud.secretmanager.v1beta2.SecretVersion]. + # + # Sets the [state][google.cloud.secretmanager.v1beta2.SecretVersion.state] of + # the [SecretVersion][google.cloud.secretmanager.v1beta2.SecretVersion] to + # [ENABLED][google.cloud.secretmanager.v1beta2.SecretVersion.State.ENABLED]. + rpc :EnableSecretVersion, ::Google::Cloud::SecretManager::V1beta2::EnableSecretVersionRequest, ::Google::Cloud::SecretManager::V1beta2::SecretVersion + # Destroys a + # [SecretVersion][google.cloud.secretmanager.v1beta2.SecretVersion]. + # + # Sets the [state][google.cloud.secretmanager.v1beta2.SecretVersion.state] of + # the [SecretVersion][google.cloud.secretmanager.v1beta2.SecretVersion] to + # [DESTROYED][google.cloud.secretmanager.v1beta2.SecretVersion.State.DESTROYED] + # and irrevocably destroys the secret data. + rpc :DestroySecretVersion, ::Google::Cloud::SecretManager::V1beta2::DestroySecretVersionRequest, ::Google::Cloud::SecretManager::V1beta2::SecretVersion + # Sets the access control policy on the specified secret. Replaces any + # existing policy. + # + # Permissions on + # [SecretVersions][google.cloud.secretmanager.v1beta2.SecretVersion] are + # enforced according to the policy set on the associated + # [Secret][google.cloud.secretmanager.v1beta2.Secret]. + rpc :SetIamPolicy, ::Google::Iam::V1::SetIamPolicyRequest, ::Google::Iam::V1::Policy + # Gets the access control policy for a secret. + # Returns empty policy if the secret exists and does not have a policy set. + rpc :GetIamPolicy, ::Google::Iam::V1::GetIamPolicyRequest, ::Google::Iam::V1::Policy + # Returns permissions that a caller has for the specified secret. + # If the secret does not exist, this call returns an empty set of + # permissions, not a NOT_FOUND error. + # + # Note: This operation is designed to be used for building permission-aware + # UIs and command-line tools, not for authorization checking. This operation + # may "fail open" without warning. + rpc :TestIamPermissions, ::Google::Iam::V1::TestIamPermissionsRequest, ::Google::Iam::V1::TestIamPermissionsResponse + end + + Stub = Service.rpc_stub_class + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-secret_manager-v1beta2/proto_docs/README.md b/owl-bot-staging/google-cloud-secret_manager-v1beta2/proto_docs/README.md new file mode 100644 index 000000000000..397e964dde26 --- /dev/null +++ b/owl-bot-staging/google-cloud-secret_manager-v1beta2/proto_docs/README.md @@ -0,0 +1,4 @@ +# Secret Manager V1BETA2 Protocol Buffer Documentation + +These files are for the YARD documentation of the generated protobuf files. +They are not intended to be required or loaded at runtime. diff --git a/owl-bot-staging/google-cloud-secret_manager-v1beta2/proto_docs/google/api/client.rb b/owl-bot-staging/google-cloud-secret_manager-v1beta2/proto_docs/google/api/client.rb new file mode 100644 index 000000000000..5089551e9ea4 --- /dev/null +++ b/owl-bot-staging/google-cloud-secret_manager-v1beta2/proto_docs/google/api/client.rb @@ -0,0 +1,589 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + + +module Google + module Api + # Required information for every language. + # @!attribute [rw] reference_docs_uri + # @deprecated This field is deprecated and may be removed in the next major version update. + # @return [::String] + # Link to automatically generated reference documentation. Example: + # https://cloud.google.com/nodejs/docs/reference/asset/latest + # @!attribute [rw] destinations + # @return [::Array<::Google::Api::ClientLibraryDestination>] + # The destination where API teams want this client library to be published. + # @!attribute [rw] selective_gapic_generation + # @return [::Google::Api::SelectiveGapicGeneration] + # Configuration for which RPCs should be generated in the GAPIC client. + class CommonLanguageSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Details about how and where to publish client libraries. + # @!attribute [rw] version + # @return [::String] + # Version of the API to apply these settings to. This is the full protobuf + # package for the API, ending in the version element. + # Examples: "google.cloud.speech.v1" and "google.spanner.admin.database.v1". + # @!attribute [rw] launch_stage + # @return [::Google::Api::LaunchStage] + # Launch stage of this version of the API. + # @!attribute [rw] rest_numeric_enums + # @return [::Boolean] + # When using transport=rest, the client request will encode enums as + # numbers rather than strings. + # @!attribute [rw] java_settings + # @return [::Google::Api::JavaSettings] + # Settings for legacy Java features, supported in the Service YAML. + # @!attribute [rw] cpp_settings + # @return [::Google::Api::CppSettings] + # Settings for C++ client libraries. + # @!attribute [rw] php_settings + # @return [::Google::Api::PhpSettings] + # Settings for PHP client libraries. + # @!attribute [rw] python_settings + # @return [::Google::Api::PythonSettings] + # Settings for Python client libraries. + # @!attribute [rw] node_settings + # @return [::Google::Api::NodeSettings] + # Settings for Node client libraries. + # @!attribute [rw] dotnet_settings + # @return [::Google::Api::DotnetSettings] + # Settings for .NET client libraries. + # @!attribute [rw] ruby_settings + # @return [::Google::Api::RubySettings] + # Settings for Ruby client libraries. + # @!attribute [rw] go_settings + # @return [::Google::Api::GoSettings] + # Settings for Go client libraries. + class ClientLibrarySettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # This message configures the settings for publishing [Google Cloud Client + # libraries](https://cloud.google.com/apis/docs/cloud-client-libraries) + # generated from the service config. + # @!attribute [rw] method_settings + # @return [::Array<::Google::Api::MethodSettings>] + # A list of API method settings, e.g. the behavior for methods that use the + # long-running operation pattern. + # @!attribute [rw] new_issue_uri + # @return [::String] + # Link to a *public* URI where users can report issues. Example: + # https://issuetracker.google.com/issues/new?component=190865&template=1161103 + # @!attribute [rw] documentation_uri + # @return [::String] + # Link to product home page. Example: + # https://cloud.google.com/asset-inventory/docs/overview + # @!attribute [rw] api_short_name + # @return [::String] + # Used as a tracking tag when collecting data about the APIs developer + # relations artifacts like docs, packages delivered to package managers, + # etc. Example: "speech". + # @!attribute [rw] github_label + # @return [::String] + # GitHub label to apply to issues and pull requests opened for this API. + # @!attribute [rw] codeowner_github_teams + # @return [::Array<::String>] + # GitHub teams to be added to CODEOWNERS in the directory in GitHub + # containing source code for the client libraries for this API. + # @!attribute [rw] doc_tag_prefix + # @return [::String] + # A prefix used in sample code when demarking regions to be included in + # documentation. + # @!attribute [rw] organization + # @return [::Google::Api::ClientLibraryOrganization] + # For whom the client library is being published. + # @!attribute [rw] library_settings + # @return [::Array<::Google::Api::ClientLibrarySettings>] + # Client library settings. If the same version string appears multiple + # times in this list, then the last one wins. Settings from earlier + # settings with the same version string are discarded. + # @!attribute [rw] proto_reference_documentation_uri + # @return [::String] + # Optional link to proto reference documentation. Example: + # https://cloud.google.com/pubsub/lite/docs/reference/rpc + # @!attribute [rw] rest_reference_documentation_uri + # @return [::String] + # Optional link to REST reference documentation. Example: + # https://cloud.google.com/pubsub/lite/docs/reference/rest + class Publishing + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Settings for Java client libraries. + # @!attribute [rw] library_package + # @return [::String] + # The package name to use in Java. Clobbers the java_package option + # set in the protobuf. This should be used **only** by APIs + # who have already set the language_settings.java.package_name" field + # in gapic.yaml. API teams should use the protobuf java_package option + # where possible. + # + # Example of a YAML configuration:: + # + # publishing: + # 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. + # @!attribute [rw] methods + # @return [::Array<::String>] + # An allowlist of the fully qualified names of RPCs that should be included + # on public client surfaces. + # @!attribute [rw] generate_omitted_as_internal + # @return [::Boolean] + # Setting this to true indicates to the client generators that methods + # that would be excluded from the generation should instead be generated + # in a way that indicates these methods should not be consumed by + # end users. How this is expressed is up to individual language + # implementations to decide. Some examples may be: added annotations, + # obfuscated identifiers, or other language idiomatic patterns. + class SelectiveGapicGeneration + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # `BatchingConfigProto` defines the batching configuration for an API method. + # @!attribute [rw] thresholds + # @return [::Google::Api::BatchingSettingsProto] + # The thresholds which trigger a batched request to be sent. + # @!attribute [rw] batch_descriptor + # @return [::Google::Api::BatchingDescriptorProto] + # The request and response fields used in batching. + class BatchingConfigProto + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # `BatchingSettingsProto` specifies a set of batching thresholds, each of + # which acts as a trigger to send a batch of messages as a request. At least + # one threshold must be positive nonzero. + # @!attribute [rw] element_count_threshold + # @return [::Integer] + # The number of elements of a field collected into a batch which, if + # exceeded, causes the batch to be sent. + # @!attribute [rw] request_byte_threshold + # @return [::Integer] + # The aggregated size of the batched field which, if exceeded, causes the + # batch to be sent. This size is computed by aggregating the sizes of the + # request field to be batched, not of the entire request message. + # @!attribute [rw] delay_threshold + # @return [::Google::Protobuf::Duration] + # The duration after which a batch should be sent, starting from the addition + # of the first message to that batch. + # @!attribute [rw] element_count_limit + # @return [::Integer] + # The maximum number of elements collected in a batch that could be accepted + # by server. + # @!attribute [rw] request_byte_limit + # @return [::Integer] + # The maximum size of the request that could be accepted by server. + # @!attribute [rw] flow_control_element_limit + # @return [::Integer] + # The maximum number of elements allowed by flow control. + # @!attribute [rw] flow_control_byte_limit + # @return [::Integer] + # The maximum size of data allowed by flow control. + # @!attribute [rw] flow_control_limit_exceeded_behavior + # @return [::Google::Api::FlowControlLimitExceededBehaviorProto] + # The behavior to take when the flow control limit is exceeded. + class BatchingSettingsProto + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # `BatchingDescriptorProto` specifies the fields of the request message to be + # used for batching, and, optionally, the fields of the response message to be + # used for demultiplexing. + # @!attribute [rw] batched_field + # @return [::String] + # The repeated field in the request message to be aggregated by batching. + # @!attribute [rw] discriminator_fields + # @return [::Array<::String>] + # A list of the fields in the request message. Two requests will be batched + # together only if the values of every field specified in + # `request_discriminator_fields` is equal between the two requests. + # @!attribute [rw] subresponse_field + # @return [::String] + # Optional. When present, indicates the field in the response message to be + # used to demultiplex the response into multiple response messages, in + # correspondence with the multiple request messages originally batched + # together. + class BatchingDescriptorProto + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # The organization for which the client libraries are being published. + # Affects the url where generated docs are published, etc. + module ClientLibraryOrganization + # Not useful. + CLIENT_LIBRARY_ORGANIZATION_UNSPECIFIED = 0 + + # Google Cloud Platform Org. + CLOUD = 1 + + # Ads (Advertising) Org. + ADS = 2 + + # Photos Org. + PHOTOS = 3 + + # Street View Org. + STREET_VIEW = 4 + + # Shopping Org. + SHOPPING = 5 + + # Geo Org. + GEO = 6 + + # Generative AI - https://developers.generativeai.google + GENERATIVE_AI = 7 + end + + # To where should client libraries be published? + module ClientLibraryDestination + # Client libraries will neither be generated nor published to package + # managers. + CLIENT_LIBRARY_DESTINATION_UNSPECIFIED = 0 + + # Generate the client library in a repo under github.com/googleapis, + # but don't publish it to package managers. + GITHUB = 10 + + # Publish the library to package managers like nuget.org and npmjs.com. + PACKAGE_MANAGER = 20 + end + + # The behavior to take when the flow control limit is exceeded. + module FlowControlLimitExceededBehaviorProto + # Default behavior, system-defined. + UNSET_BEHAVIOR = 0 + + # Stop operation, raise error. + THROW_EXCEPTION = 1 + + # Pause operation until limit clears. + BLOCK = 2 + + # Continue operation, disregard limit. + IGNORE = 3 + end + end +end diff --git a/owl-bot-staging/google-cloud-secret_manager-v1beta2/proto_docs/google/api/field_behavior.rb b/owl-bot-staging/google-cloud-secret_manager-v1beta2/proto_docs/google/api/field_behavior.rb new file mode 100644 index 000000000000..582be187d115 --- /dev/null +++ b/owl-bot-staging/google-cloud-secret_manager-v1beta2/proto_docs/google/api/field_behavior.rb @@ -0,0 +1,85 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + + +module Google + module Api + # An indicator of the behavior of a given field (for example, that a field + # is required in requests, or given as output but ignored as input). + # This **does not** change the behavior in protocol buffers itself; it only + # denotes the behavior and may affect how API tooling handles the field. + # + # Note: This enum **may** receive new values in the future. + module FieldBehavior + # Conventional default for enums. Do not use this. + FIELD_BEHAVIOR_UNSPECIFIED = 0 + + # Specifically denotes a field as optional. + # While all fields in protocol buffers are optional, this may be specified + # for emphasis if appropriate. + OPTIONAL = 1 + + # Denotes a field as required. + # This indicates that the field **must** be provided as part of the request, + # and failure to do so will cause an error (usually `INVALID_ARGUMENT`). + REQUIRED = 2 + + # Denotes a field as output only. + # This indicates that the field is provided in responses, but including the + # field in a request does nothing (the server *must* ignore it and + # *must not* throw an error as a result of the field's presence). + OUTPUT_ONLY = 3 + + # Denotes a field as input only. + # This indicates that the field is provided in requests, and the + # corresponding field is not included in output. + INPUT_ONLY = 4 + + # Denotes a field as immutable. + # This indicates that the field may be set once in a request to create a + # resource, but may not be changed thereafter. + IMMUTABLE = 5 + + # Denotes that a (repeated) field is an unordered list. + # This indicates that the service may provide the elements of the list + # in any arbitrary order, rather than the order the user originally + # provided. Additionally, the list's order may or may not be stable. + UNORDERED_LIST = 6 + + # Denotes that this field returns a non-empty default value if not set. + # This indicates that if the user provides the empty value in a request, + # a non-empty value will be returned. The user will not be aware of what + # non-empty value to expect. + NON_EMPTY_DEFAULT = 7 + + # Denotes that the field in a resource (a message annotated with + # google.api.resource) is used in the resource name to uniquely identify the + # resource. For AIP-compliant APIs, this should only be applied to the + # `name` field on the resource. + # + # This behavior should not be applied to references to other resources within + # the message. + # + # The identifier field of resources often have different field behavior + # depending on the request it is embedded in (e.g. for Create methods name + # is optional and unused, while for Update methods it is required). Instead + # of method-specific annotations, only `IDENTIFIER` is required. + IDENTIFIER = 8 + end + end +end diff --git a/owl-bot-staging/google-cloud-secret_manager-v1beta2/proto_docs/google/api/launch_stage.rb b/owl-bot-staging/google-cloud-secret_manager-v1beta2/proto_docs/google/api/launch_stage.rb new file mode 100644 index 000000000000..9392a413fb1b --- /dev/null +++ b/owl-bot-staging/google-cloud-secret_manager-v1beta2/proto_docs/google/api/launch_stage.rb @@ -0,0 +1,71 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + + +module Google + module Api + # The launch stage as defined by [Google Cloud Platform + # Launch Stages](https://cloud.google.com/terms/launch-stages). + module LaunchStage + # Do not use this default value. + LAUNCH_STAGE_UNSPECIFIED = 0 + + # The feature is not yet implemented. Users can not use it. + UNIMPLEMENTED = 6 + + # Prelaunch features are hidden from users and are only visible internally. + PRELAUNCH = 7 + + # Early Access features are limited to a closed group of testers. To use + # these features, you must sign up in advance and sign a Trusted Tester + # agreement (which includes confidentiality provisions). These features may + # be unstable, changed in backward-incompatible ways, and are not + # guaranteed to be released. + EARLY_ACCESS = 1 + + # Alpha is a limited availability test for releases before they are cleared + # for widespread use. By Alpha, all significant design issues are resolved + # and we are in the process of verifying functionality. Alpha customers + # need to apply for access, agree to applicable terms, and have their + # projects allowlisted. Alpha releases don't have to be feature complete, + # no SLAs are provided, and there are no technical support obligations, but + # they will be far enough along that customers can actually use them in + # test environments or for limited-use tests -- just like they would in + # normal production cases. + ALPHA = 2 + + # Beta is the point at which we are ready to open a release for any + # customer to use. There are no SLA or technical support obligations in a + # Beta release. Products will be complete from a feature perspective, but + # may have some open outstanding issues. Beta releases are suitable for + # limited production use cases. + BETA = 3 + + # GA features are open to all developers and are considered stable and + # fully qualified for production use. + GA = 4 + + # Deprecated features are scheduled to be shut down and removed. For more + # information, see the "Deprecation Policy" section of our [Terms of + # Service](https://cloud.google.com/terms/) + # and the [Google Cloud Platform Subject to the Deprecation + # Policy](https://cloud.google.com/terms/deprecation) documentation. + DEPRECATED = 5 + end + end +end diff --git a/owl-bot-staging/google-cloud-secret_manager-v1beta2/proto_docs/google/api/resource.rb b/owl-bot-staging/google-cloud-secret_manager-v1beta2/proto_docs/google/api/resource.rb new file mode 100644 index 000000000000..25dec4847ac1 --- /dev/null +++ b/owl-bot-staging/google-cloud-secret_manager-v1beta2/proto_docs/google/api/resource.rb @@ -0,0 +1,227 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + + +module Google + module Api + # A simple descriptor of a resource type. + # + # ResourceDescriptor annotates a resource message (either by means of a + # protobuf annotation or use in the service config), and associates the + # resource's schema, the resource type, and the pattern of the resource name. + # + # Example: + # + # message Topic { + # // Indicates this message defines a resource schema. + # // Declares the resource type in the format of {service}/{kind}. + # // For Kubernetes resources, the format is {api group}/{kind}. + # option (google.api.resource) = { + # type: "pubsub.googleapis.com/Topic" + # pattern: "projects/{project}/topics/{topic}" + # }; + # } + # + # The ResourceDescriptor Yaml config will look like: + # + # resources: + # - type: "pubsub.googleapis.com/Topic" + # pattern: "projects/{project}/topics/{topic}" + # + # Sometimes, resources have multiple patterns, typically because they can + # live under multiple parents. + # + # Example: + # + # message LogEntry { + # option (google.api.resource) = { + # type: "logging.googleapis.com/LogEntry" + # pattern: "projects/{project}/logs/{log}" + # pattern: "folders/{folder}/logs/{log}" + # pattern: "organizations/{organization}/logs/{log}" + # pattern: "billingAccounts/{billing_account}/logs/{log}" + # }; + # } + # + # The ResourceDescriptor Yaml config will look like: + # + # resources: + # - type: 'logging.googleapis.com/LogEntry' + # pattern: "projects/{project}/logs/{log}" + # pattern: "folders/{folder}/logs/{log}" + # pattern: "organizations/{organization}/logs/{log}" + # pattern: "billingAccounts/{billing_account}/logs/{log}" + # @!attribute [rw] type + # @return [::String] + # The resource type. It must be in the format of + # \\{service_name}/\\{resource_type_kind}. The `resource_type_kind` must be + # singular and must not include version numbers. + # + # Example: `storage.googleapis.com/Bucket` + # + # The value of the resource_type_kind must follow the regular expression + # /[A-Za-z][a-zA-Z0-9]+/. It should start with an upper case character and + # should use PascalCase (UpperCamelCase). The maximum number of + # characters allowed for the `resource_type_kind` is 100. + # @!attribute [rw] pattern + # @return [::Array<::String>] + # Optional. The relative resource name pattern associated with this resource + # type. The DNS prefix of the full resource name shouldn't be specified here. + # + # The path pattern must follow the syntax, which aligns with HTTP binding + # syntax: + # + # Template = Segment { "/" Segment } ; + # Segment = LITERAL | Variable ; + # Variable = "{" LITERAL "}" ; + # + # Examples: + # + # - "projects/\\{project}/topics/\\{topic}" + # - "projects/\\{project}/knowledgeBases/\\{knowledge_base}" + # + # The components in braces correspond to the IDs for each resource in the + # hierarchy. It is expected that, if multiple patterns are provided, + # the same component name (e.g. "project") refers to IDs of the same + # type of resource. + # @!attribute [rw] name_field + # @return [::String] + # Optional. The field on the resource that designates the resource name + # field. If omitted, this is assumed to be "name". + # @!attribute [rw] history + # @return [::Google::Api::ResourceDescriptor::History] + # Optional. The historical or future-looking state of the resource pattern. + # + # Example: + # + # // The InspectTemplate message originally only supported resource + # // names with organization, and project was added later. + # message InspectTemplate { + # option (google.api.resource) = { + # type: "dlp.googleapis.com/InspectTemplate" + # pattern: + # "organizations/{organization}/inspectTemplates/{inspect_template}" + # pattern: "projects/{project}/inspectTemplates/{inspect_template}" + # history: ORIGINALLY_SINGLE_PATTERN + # }; + # } + # @!attribute [rw] plural + # @return [::String] + # The plural name used in the resource name and permission names, such as + # 'projects' for the resource name of 'projects/\\{project}' and the permission + # name of 'cloudresourcemanager.googleapis.com/projects.get'. One exception + # to this is for Nested Collections that have stuttering names, as defined + # in [AIP-122](https://google.aip.dev/122#nested-collections), where the + # collection ID in the resource name pattern does not necessarily directly + # match the `plural` value. + # + # It is the same concept of the `plural` field in k8s CRD spec + # https://kubernetes.io/docs/tasks/access-kubernetes-api/custom-resources/custom-resource-definitions/ + # + # Note: The plural form is required even for singleton resources. See + # https://aip.dev/156 + # @!attribute [rw] singular + # @return [::String] + # The same concept of the `singular` field in k8s CRD spec + # https://kubernetes.io/docs/tasks/access-kubernetes-api/custom-resources/custom-resource-definitions/ + # Such as "project" for the `resourcemanager.googleapis.com/Project` type. + # @!attribute [rw] style + # @return [::Array<::Google::Api::ResourceDescriptor::Style>] + # Style flag(s) for this resource. + # These indicate that a resource is expected to conform to a given + # style. See the specific style flags for additional information. + class ResourceDescriptor + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # A description of the historical or future-looking state of the + # resource pattern. + module History + # The "unset" value. + HISTORY_UNSPECIFIED = 0 + + # The resource originally had one pattern and launched as such, and + # additional patterns were added later. + ORIGINALLY_SINGLE_PATTERN = 1 + + # The resource has one pattern, but the API owner expects to add more + # later. (This is the inverse of ORIGINALLY_SINGLE_PATTERN, and prevents + # that from being necessary once there are multiple patterns.) + FUTURE_MULTI_PATTERN = 2 + end + + # A flag representing a specific style that a resource claims to conform to. + module Style + # The unspecified value. Do not use. + STYLE_UNSPECIFIED = 0 + + # This resource is intended to be "declarative-friendly". + # + # Declarative-friendly resources must be more strictly consistent, and + # setting this to true communicates to tools that this resource should + # adhere to declarative-friendly expectations. + # + # Note: This is used by the API linter (linter.aip.dev) to enable + # additional checks. + DECLARATIVE_FRIENDLY = 1 + end + end + + # Defines a proto annotation that describes a string field that refers to + # an API resource. + # @!attribute [rw] type + # @return [::String] + # The resource type that the annotated field references. + # + # Example: + # + # message Subscription { + # string topic = 2 [(google.api.resource_reference) = { + # type: "pubsub.googleapis.com/Topic" + # }]; + # } + # + # Occasionally, a field may reference an arbitrary resource. In this case, + # APIs use the special value * in their resource reference. + # + # Example: + # + # message GetIamPolicyRequest { + # string resource = 2 [(google.api.resource_reference) = { + # type: "*" + # }]; + # } + # @!attribute [rw] child_type + # @return [::String] + # The resource type of a child collection that the annotated field + # references. This is useful for annotating the `parent` field that + # doesn't have a fixed resource type. + # + # Example: + # + # message ListLogEntriesRequest { + # string parent = 1 [(google.api.resource_reference) = { + # child_type: "logging.googleapis.com/LogEntry" + # }; + # } + class ResourceReference + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end +end diff --git a/owl-bot-staging/google-cloud-secret_manager-v1beta2/proto_docs/google/cloud/secretmanager/v1beta2/resources.rb b/owl-bot-staging/google-cloud-secret_manager-v1beta2/proto_docs/google/cloud/secretmanager/v1beta2/resources.rb new file mode 100644 index 000000000000..67caed18595b --- /dev/null +++ b/owl-bot-staging/google-cloud-secret_manager-v1beta2/proto_docs/google/cloud/secretmanager/v1beta2/resources.rb @@ -0,0 +1,512 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + + +module Google + module Cloud + module SecretManager + module V1beta2 + # A {::Google::Cloud::SecretManager::V1beta2::Secret Secret} is a logical secret + # whose value and versions can be accessed. + # + # A {::Google::Cloud::SecretManager::V1beta2::Secret Secret} is made up of zero or + # more {::Google::Cloud::SecretManager::V1beta2::SecretVersion SecretVersions} that + # represent the secret data. + # @!attribute [r] name + # @return [::String] + # Output only. The resource name of the + # {::Google::Cloud::SecretManager::V1beta2::Secret Secret} in the format + # `projects/*/secrets/*`. + # @!attribute [rw] replication + # @return [::Google::Cloud::SecretManager::V1beta2::Replication] + # Optional. Immutable. The replication policy of the secret data attached to + # the {::Google::Cloud::SecretManager::V1beta2::Secret Secret}. + # + # The replication policy cannot be changed after the Secret has been created. + # @!attribute [r] create_time + # @return [::Google::Protobuf::Timestamp] + # Output only. The time at which the + # {::Google::Cloud::SecretManager::V1beta2::Secret Secret} was created. + # @!attribute [rw] labels + # @return [::Google::Protobuf::Map{::String => ::String}] + # The labels assigned to this Secret. + # + # Label keys must be between 1 and 63 characters long, have a UTF-8 encoding + # of maximum 128 bytes, and must conform to the following PCRE regular + # expression: `[\p{Ll}\p{Lo}][\p{Ll}\p{Lo}\p{N}_-]{0,62}` + # + # Label values must be between 0 and 63 characters long, have a UTF-8 + # encoding of maximum 128 bytes, and must conform to the following PCRE + # regular expression: `[\p{Ll}\p{Lo}\p{N}_-]{0,63}` + # + # No more than 64 labels can be assigned to a given resource. + # @!attribute [rw] topics + # @return [::Array<::Google::Cloud::SecretManager::V1beta2::Topic>] + # Optional. A list of up to 10 Pub/Sub topics to which messages are published + # when control plane operations are called on the secret or its versions. + # @!attribute [rw] expire_time + # @return [::Google::Protobuf::Timestamp] + # Optional. Timestamp in UTC when the + # {::Google::Cloud::SecretManager::V1beta2::Secret Secret} is scheduled to + # expire. This is always provided on output, regardless of what was sent on + # input. + # + # Note: The following fields are mutually exclusive: `expire_time`, `ttl`. If a field in that set is populated, all other fields in the set will automatically be cleared. + # @!attribute [rw] ttl + # @return [::Google::Protobuf::Duration] + # Input only. The TTL for the + # {::Google::Cloud::SecretManager::V1beta2::Secret Secret}. + # + # Note: The following fields are mutually exclusive: `ttl`, `expire_time`. If a field in that set is populated, all other fields in the set will automatically be cleared. + # @!attribute [rw] etag + # @return [::String] + # Optional. Etag of the currently stored + # {::Google::Cloud::SecretManager::V1beta2::Secret Secret}. + # @!attribute [rw] rotation + # @return [::Google::Cloud::SecretManager::V1beta2::Rotation] + # Optional. Rotation policy attached to the + # {::Google::Cloud::SecretManager::V1beta2::Secret Secret}. May be excluded if + # there is no rotation policy. + # @!attribute [rw] version_aliases + # @return [::Google::Protobuf::Map{::String => ::Integer}] + # Optional. Mapping from version alias to version name. + # + # A version alias is a string with a maximum length of 63 characters and can + # contain uppercase and lowercase letters, numerals, and the hyphen (`-`) + # and underscore ('_') characters. An alias string must start with a + # letter and cannot be the string 'latest' or 'NEW'. + # No more than 50 aliases can be assigned to a given secret. + # + # Version-Alias pairs will be viewable via GetSecret and modifiable via + # UpdateSecret. Access by alias is only supported for + # GetSecretVersion and AccessSecretVersion. + # @!attribute [rw] annotations + # @return [::Google::Protobuf::Map{::String => ::String}] + # Optional. Custom metadata about the secret. + # + # Annotations are distinct from various forms of labels. + # Annotations exist to allow client tools to store their own state + # information without requiring a database. + # + # Annotation keys must be between 1 and 63 characters long, have a UTF-8 + # encoding of maximum 128 bytes, begin and end with an alphanumeric character + # ([a-z0-9A-Z]), and may have dashes (-), underscores (_), dots (.), and + # alphanumerics in between these symbols. + # + # The total size of annotation keys and values must be less than 16KiB. + # @!attribute [rw] version_destroy_ttl + # @return [::Google::Protobuf::Duration] + # Optional. Secret Version TTL after destruction request + # + # This is a part of the Delayed secret version destroy feature. + # For secret with TTL>0, version destruction doesn't happen immediately + # on calling destroy instead the version goes to a disabled state and + # destruction happens after the TTL expires. + # @!attribute [rw] customer_managed_encryption + # @return [::Google::Cloud::SecretManager::V1beta2::CustomerManagedEncryption] + # Optional. The customer-managed encryption configuration of the Regionalised + # Secrets. If no configuration is provided, Google-managed default encryption + # is used. + # + # Updates to the {::Google::Cloud::SecretManager::V1beta2::Secret Secret} + # encryption configuration only apply to + # {::Google::Cloud::SecretManager::V1beta2::SecretVersion SecretVersions} added + # afterwards. They do not apply retroactively to existing + # {::Google::Cloud::SecretManager::V1beta2::SecretVersion SecretVersions}. + class Secret + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # @!attribute [rw] key + # @return [::String] + # @!attribute [rw] value + # @return [::String] + class LabelsEntry + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # @!attribute [rw] key + # @return [::String] + # @!attribute [rw] value + # @return [::Integer] + class VersionAliasesEntry + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # @!attribute [rw] key + # @return [::String] + # @!attribute [rw] value + # @return [::String] + class AnnotationsEntry + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end + + # A secret version resource in the Secret Manager API. + # @!attribute [r] name + # @return [::String] + # Output only. The resource name of the + # {::Google::Cloud::SecretManager::V1beta2::SecretVersion SecretVersion} in the + # format `projects/*/secrets/*/versions/*`. + # + # {::Google::Cloud::SecretManager::V1beta2::SecretVersion SecretVersion} IDs in a + # {::Google::Cloud::SecretManager::V1beta2::Secret Secret} start at 1 and are + # incremented for each subsequent version of the secret. + # @!attribute [r] create_time + # @return [::Google::Protobuf::Timestamp] + # Output only. The time at which the + # {::Google::Cloud::SecretManager::V1beta2::SecretVersion SecretVersion} was + # created. + # @!attribute [r] destroy_time + # @return [::Google::Protobuf::Timestamp] + # Output only. The time this + # {::Google::Cloud::SecretManager::V1beta2::SecretVersion SecretVersion} was + # destroyed. Only present if + # {::Google::Cloud::SecretManager::V1beta2::SecretVersion#state state} is + # {::Google::Cloud::SecretManager::V1beta2::SecretVersion::State::DESTROYED DESTROYED}. + # @!attribute [r] state + # @return [::Google::Cloud::SecretManager::V1beta2::SecretVersion::State] + # Output only. The current state of the + # {::Google::Cloud::SecretManager::V1beta2::SecretVersion SecretVersion}. + # @!attribute [rw] replication_status + # @return [::Google::Cloud::SecretManager::V1beta2::ReplicationStatus] + # The replication status of the + # {::Google::Cloud::SecretManager::V1beta2::SecretVersion SecretVersion}. + # @!attribute [r] etag + # @return [::String] + # Output only. Etag of the currently stored + # {::Google::Cloud::SecretManager::V1beta2::SecretVersion SecretVersion}. + # @!attribute [r] client_specified_payload_checksum + # @return [::Boolean] + # Output only. True if payload checksum specified in + # {::Google::Cloud::SecretManager::V1beta2::SecretPayload SecretPayload} object + # has been received by + # {::Google::Cloud::SecretManager::V1beta2::SecretManagerService::Client SecretManagerService} + # on + # {::Google::Cloud::SecretManager::V1beta2::SecretManagerService::Client#add_secret_version SecretManagerService.AddSecretVersion}. + # @!attribute [r] scheduled_destroy_time + # @return [::Google::Protobuf::Timestamp] + # Optional. Output only. Scheduled destroy time for secret version. + # This is a part of the Delayed secret version destroy feature. For a + # Secret with a valid version destroy TTL, when a secert version is + # destroyed, version is moved to disabled state and it is scheduled for + # destruction Version is destroyed only after the scheduled_destroy_time. + # @!attribute [r] customer_managed_encryption + # @return [::Google::Cloud::SecretManager::V1beta2::CustomerManagedEncryptionStatus] + # Output only. The customer-managed encryption status of the + # {::Google::Cloud::SecretManager::V1beta2::SecretVersion SecretVersion}. Only + # populated if customer-managed encryption is used and + # {::Google::Cloud::SecretManager::V1beta2::Secret Secret} is a Regionalised + # Secret. + class SecretVersion + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # The state of a + # {::Google::Cloud::SecretManager::V1beta2::SecretVersion SecretVersion}, + # indicating if it can be accessed. + module State + # Not specified. This value is unused and invalid. + STATE_UNSPECIFIED = 0 + + # The {::Google::Cloud::SecretManager::V1beta2::SecretVersion SecretVersion} may + # be accessed. + ENABLED = 1 + + # The {::Google::Cloud::SecretManager::V1beta2::SecretVersion SecretVersion} may + # not be accessed, but the secret data is still available and can be placed + # back into the + # {::Google::Cloud::SecretManager::V1beta2::SecretVersion::State::ENABLED ENABLED} + # state. + DISABLED = 2 + + # The {::Google::Cloud::SecretManager::V1beta2::SecretVersion SecretVersion} is + # destroyed and the secret data is no longer stored. A version may not + # leave this state once entered. + DESTROYED = 3 + end + end + + # A policy that defines the replication and encryption configuration of data. + # @!attribute [rw] automatic + # @return [::Google::Cloud::SecretManager::V1beta2::Replication::Automatic] + # The {::Google::Cloud::SecretManager::V1beta2::Secret Secret} will + # automatically be replicated without any restrictions. + # + # Note: The following fields are mutually exclusive: `automatic`, `user_managed`. If a field in that set is populated, all other fields in the set will automatically be cleared. + # @!attribute [rw] user_managed + # @return [::Google::Cloud::SecretManager::V1beta2::Replication::UserManaged] + # The {::Google::Cloud::SecretManager::V1beta2::Secret Secret} will only be + # replicated into the locations specified. + # + # Note: The following fields are mutually exclusive: `user_managed`, `automatic`. If a field in that set is populated, all other fields in the set will automatically be cleared. + class Replication + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # A replication policy that replicates the + # {::Google::Cloud::SecretManager::V1beta2::Secret Secret} payload without any + # restrictions. + # @!attribute [rw] customer_managed_encryption + # @return [::Google::Cloud::SecretManager::V1beta2::CustomerManagedEncryption] + # Optional. The customer-managed encryption configuration of the + # {::Google::Cloud::SecretManager::V1beta2::Secret Secret}. If no configuration + # is provided, Google-managed default encryption is used. + # + # Updates to the {::Google::Cloud::SecretManager::V1beta2::Secret Secret} + # encryption configuration only apply to + # {::Google::Cloud::SecretManager::V1beta2::SecretVersion SecretVersions} added + # afterwards. They do not apply retroactively to existing + # {::Google::Cloud::SecretManager::V1beta2::SecretVersion SecretVersions}. + class Automatic + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # A replication policy that replicates the + # {::Google::Cloud::SecretManager::V1beta2::Secret Secret} payload into the + # locations specified in + # {::Google::Cloud::SecretManager::V1beta2::Replication::UserManaged#replicas Replication.UserManaged.replicas} + # @!attribute [rw] replicas + # @return [::Array<::Google::Cloud::SecretManager::V1beta2::Replication::UserManaged::Replica>] + # Required. The list of Replicas for this + # {::Google::Cloud::SecretManager::V1beta2::Secret Secret}. + # + # Cannot be empty. + class UserManaged + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # Represents a Replica for this + # {::Google::Cloud::SecretManager::V1beta2::Secret Secret}. + # @!attribute [rw] location + # @return [::String] + # The canonical IDs of the location to replicate data. + # For example: `"us-east1"`. + # @!attribute [rw] customer_managed_encryption + # @return [::Google::Cloud::SecretManager::V1beta2::CustomerManagedEncryption] + # Optional. The customer-managed encryption configuration of the + # [User-Managed Replica][Replication.UserManaged.Replica]. If no + # configuration is provided, Google-managed default encryption is used. + # + # Updates to the {::Google::Cloud::SecretManager::V1beta2::Secret Secret} + # encryption configuration only apply to + # {::Google::Cloud::SecretManager::V1beta2::SecretVersion SecretVersions} + # added afterwards. They do not apply retroactively to existing + # {::Google::Cloud::SecretManager::V1beta2::SecretVersion SecretVersions}. + class Replica + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end + end + + # Configuration for encrypting secret payloads using customer-managed + # encryption keys (CMEK). + # @!attribute [rw] kms_key_name + # @return [::String] + # Required. The resource name of the Cloud KMS CryptoKey used to encrypt + # secret payloads. + # + # For secrets using the + # {::Google::Cloud::SecretManager::V1beta2::Replication::UserManaged UserManaged} + # replication policy type, Cloud KMS CryptoKeys must reside in the same + # location as the [replica location][Secret.UserManaged.Replica.location]. + # + # For secrets using the + # {::Google::Cloud::SecretManager::V1beta2::Replication::Automatic Automatic} + # replication policy type, Cloud KMS CryptoKeys must reside in `global`. + # + # The expected format is `projects/*/locations/*/keyRings/*/cryptoKeys/*`. + class CustomerManagedEncryption + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # The replication status of a + # {::Google::Cloud::SecretManager::V1beta2::SecretVersion SecretVersion}. + # @!attribute [rw] automatic + # @return [::Google::Cloud::SecretManager::V1beta2::ReplicationStatus::AutomaticStatus] + # Describes the replication status of a + # {::Google::Cloud::SecretManager::V1beta2::SecretVersion SecretVersion} with + # automatic replication. + # + # Only populated if the parent + # {::Google::Cloud::SecretManager::V1beta2::Secret Secret} has an automatic + # replication policy. + # + # Note: The following fields are mutually exclusive: `automatic`, `user_managed`. If a field in that set is populated, all other fields in the set will automatically be cleared. + # @!attribute [rw] user_managed + # @return [::Google::Cloud::SecretManager::V1beta2::ReplicationStatus::UserManagedStatus] + # Describes the replication status of a + # {::Google::Cloud::SecretManager::V1beta2::SecretVersion SecretVersion} with + # user-managed replication. + # + # Only populated if the parent + # {::Google::Cloud::SecretManager::V1beta2::Secret Secret} has a user-managed + # replication policy. + # + # Note: The following fields are mutually exclusive: `user_managed`, `automatic`. If a field in that set is populated, all other fields in the set will automatically be cleared. + class ReplicationStatus + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # The replication status of a + # {::Google::Cloud::SecretManager::V1beta2::SecretVersion SecretVersion} using + # automatic replication. + # + # Only populated if the parent + # {::Google::Cloud::SecretManager::V1beta2::Secret Secret} has an automatic + # replication policy. + # @!attribute [r] customer_managed_encryption + # @return [::Google::Cloud::SecretManager::V1beta2::CustomerManagedEncryptionStatus] + # Output only. The customer-managed encryption status of the + # {::Google::Cloud::SecretManager::V1beta2::SecretVersion SecretVersion}. Only + # populated if customer-managed encryption is used. + class AutomaticStatus + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # The replication status of a + # {::Google::Cloud::SecretManager::V1beta2::SecretVersion SecretVersion} using + # user-managed replication. + # + # Only populated if the parent + # {::Google::Cloud::SecretManager::V1beta2::Secret Secret} has a user-managed + # replication policy. + # @!attribute [r] replicas + # @return [::Array<::Google::Cloud::SecretManager::V1beta2::ReplicationStatus::UserManagedStatus::ReplicaStatus>] + # Output only. The list of replica statuses for the + # {::Google::Cloud::SecretManager::V1beta2::SecretVersion SecretVersion}. + class UserManagedStatus + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # Describes the status of a user-managed replica for the + # {::Google::Cloud::SecretManager::V1beta2::SecretVersion SecretVersion}. + # @!attribute [r] location + # @return [::String] + # Output only. The canonical ID of the replica location. + # For example: `"us-east1"`. + # @!attribute [r] customer_managed_encryption + # @return [::Google::Cloud::SecretManager::V1beta2::CustomerManagedEncryptionStatus] + # Output only. The customer-managed encryption status of the + # {::Google::Cloud::SecretManager::V1beta2::SecretVersion SecretVersion}. Only + # populated if customer-managed encryption is used. + class ReplicaStatus + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end + end + + # Describes the status of customer-managed encryption. + # @!attribute [rw] kms_key_version_name + # @return [::String] + # Required. The resource name of the Cloud KMS CryptoKeyVersion used to + # encrypt the secret payload, in the following format: + # `projects/*/locations/*/keyRings/*/cryptoKeys/*/versions/*`. + class CustomerManagedEncryptionStatus + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # A Pub/Sub topic which Secret Manager will publish to when control plane + # events occur on this secret. + # @!attribute [rw] name + # @return [::String] + # Required. The resource name of the Pub/Sub topic that will be published to, + # in the following format: `projects/*/topics/*`. For publication to succeed, + # the Secret Manager service agent must have the `pubsub.topic.publish` + # permission on the topic. The Pub/Sub Publisher role + # (`roles/pubsub.publisher`) includes this permission. + class Topic + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # The rotation time and period for a + # {::Google::Cloud::SecretManager::V1beta2::Secret Secret}. At next_rotation_time, + # Secret Manager will send a Pub/Sub notification to the topics configured on + # the Secret. {::Google::Cloud::SecretManager::V1beta2::Secret#topics Secret.topics} + # must be set to configure rotation. + # @!attribute [rw] next_rotation_time + # @return [::Google::Protobuf::Timestamp] + # Optional. Timestamp in UTC at which the + # {::Google::Cloud::SecretManager::V1beta2::Secret Secret} is scheduled to rotate. + # Cannot be set to less than 300s (5 min) in the future and at most + # 3153600000s (100 years). + # + # {::Google::Cloud::SecretManager::V1beta2::Rotation#next_rotation_time next_rotation_time} + # MUST be set if + # {::Google::Cloud::SecretManager::V1beta2::Rotation#rotation_period rotation_period} + # is set. + # @!attribute [rw] rotation_period + # @return [::Google::Protobuf::Duration] + # Input only. The Duration between rotation notifications. Must be in seconds + # and at least 3600s (1h) and at most 3153600000s (100 years). + # + # If + # {::Google::Cloud::SecretManager::V1beta2::Rotation#rotation_period rotation_period} + # is set, + # {::Google::Cloud::SecretManager::V1beta2::Rotation#next_rotation_time next_rotation_time} + # must be set. + # {::Google::Cloud::SecretManager::V1beta2::Rotation#next_rotation_time next_rotation_time} + # will be advanced by this period when the service automatically sends + # rotation notifications. + class Rotation + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # A secret payload resource in the Secret Manager API. This contains the + # sensitive secret payload that is associated with a + # {::Google::Cloud::SecretManager::V1beta2::SecretVersion SecretVersion}. + # @!attribute [rw] data + # @return [::String] + # The secret data. Must be no larger than 64KiB. + # @!attribute [rw] data_crc32c + # @return [::Integer] + # Optional. If specified, + # {::Google::Cloud::SecretManager::V1beta2::SecretManagerService::Client SecretManagerService} + # will verify the integrity of the received + # {::Google::Cloud::SecretManager::V1beta2::SecretPayload#data data} on + # {::Google::Cloud::SecretManager::V1beta2::SecretManagerService::Client#add_secret_version SecretManagerService.AddSecretVersion} + # calls using the crc32c checksum and store it to include in future + # {::Google::Cloud::SecretManager::V1beta2::SecretManagerService::Client#access_secret_version SecretManagerService.AccessSecretVersion} + # responses. If a checksum is not provided in the + # {::Google::Cloud::SecretManager::V1beta2::SecretManagerService::Client#add_secret_version SecretManagerService.AddSecretVersion} + # request, the + # {::Google::Cloud::SecretManager::V1beta2::SecretManagerService::Client SecretManagerService} + # will generate and store one for you. + # + # The CRC32C value is encoded as a Int64 for compatibility, and can be + # safely downconverted to uint32 in languages that support this type. + # https://cloud.google.com/apis/design/design_patterns#integer_types + class SecretPayload + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-secret_manager-v1beta2/proto_docs/google/cloud/secretmanager/v1beta2/service.rb b/owl-bot-staging/google-cloud-secret_manager-v1beta2/proto_docs/google/cloud/secretmanager/v1beta2/service.rb new file mode 100644 index 000000000000..9df94e60b5d9 --- /dev/null +++ b/owl-bot-staging/google-cloud-secret_manager-v1beta2/proto_docs/google/cloud/secretmanager/v1beta2/service.rb @@ -0,0 +1,321 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + + +module Google + module Cloud + module SecretManager + module V1beta2 + # Request message for + # {::Google::Cloud::SecretManager::V1beta2::SecretManagerService::Client#list_secrets SecretManagerService.ListSecrets}. + # @!attribute [rw] parent + # @return [::String] + # Required. The resource name of the project associated with the + # {::Google::Cloud::SecretManager::V1beta2::Secret Secrets}, in the format + # `projects/*` or `projects/*/locations/*` + # @!attribute [rw] page_size + # @return [::Integer] + # Optional. The maximum number of results to be returned in a single page. If + # set to 0, the server decides the number of results to return. If the + # number is greater than 25000, it is capped at 25000. + # @!attribute [rw] page_token + # @return [::String] + # Optional. Pagination token, returned earlier via + # {::Google::Cloud::SecretManager::V1beta2::ListSecretsResponse#next_page_token ListSecretsResponse.next_page_token}. + # @!attribute [rw] filter + # @return [::String] + # Optional. Filter string, adhering to the rules in + # [List-operation + # filtering](https://cloud.google.com/secret-manager/docs/filtering). List + # only secrets matching the filter. If filter is empty, all secrets are + # listed. + class ListSecretsRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Response message for + # {::Google::Cloud::SecretManager::V1beta2::SecretManagerService::Client#list_secrets SecretManagerService.ListSecrets}. + # @!attribute [rw] secrets + # @return [::Array<::Google::Cloud::SecretManager::V1beta2::Secret>] + # The list of {::Google::Cloud::SecretManager::V1beta2::Secret Secrets} sorted in + # reverse by create_time (newest first). + # @!attribute [rw] next_page_token + # @return [::String] + # A token to retrieve the next page of results. Pass this value in + # {::Google::Cloud::SecretManager::V1beta2::ListSecretsRequest#page_token ListSecretsRequest.page_token} + # to retrieve the next page. + # @!attribute [rw] total_size + # @return [::Integer] + # The total number of {::Google::Cloud::SecretManager::V1beta2::Secret Secrets} + # but 0 when the + # {::Google::Cloud::SecretManager::V1beta2::ListSecretsRequest#filter ListSecretsRequest.filter} + # field is set. + class ListSecretsResponse + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Request message for + # {::Google::Cloud::SecretManager::V1beta2::SecretManagerService::Client#create_secret SecretManagerService.CreateSecret}. + # @!attribute [rw] parent + # @return [::String] + # Required. The resource name of the project to associate with the + # {::Google::Cloud::SecretManager::V1beta2::Secret Secret}, in the format + # `projects/*` or `projects/*/locations/*`. + # @!attribute [rw] secret_id + # @return [::String] + # Required. This must be unique within the project. + # + # A secret ID is a string with a maximum length of 255 characters and can + # contain uppercase and lowercase letters, numerals, and the hyphen (`-`) and + # underscore (`_`) characters. + # @!attribute [rw] secret + # @return [::Google::Cloud::SecretManager::V1beta2::Secret] + # Required. A {::Google::Cloud::SecretManager::V1beta2::Secret Secret} with + # initial field values. + class CreateSecretRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Request message for + # {::Google::Cloud::SecretManager::V1beta2::SecretManagerService::Client#add_secret_version SecretManagerService.AddSecretVersion}. + # @!attribute [rw] parent + # @return [::String] + # Required. The resource name of the + # {::Google::Cloud::SecretManager::V1beta2::Secret Secret} to associate with the + # {::Google::Cloud::SecretManager::V1beta2::SecretVersion SecretVersion} in the + # format `projects/*/secrets/*` or `projects/*/locations/*/secrets/*`. + # @!attribute [rw] payload + # @return [::Google::Cloud::SecretManager::V1beta2::SecretPayload] + # Required. The secret payload of the + # {::Google::Cloud::SecretManager::V1beta2::SecretVersion SecretVersion}. + class AddSecretVersionRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Request message for + # {::Google::Cloud::SecretManager::V1beta2::SecretManagerService::Client#get_secret SecretManagerService.GetSecret}. + # @!attribute [rw] name + # @return [::String] + # Required. The resource name of the + # {::Google::Cloud::SecretManager::V1beta2::Secret Secret}, in the format + # `projects/*/secrets/*` or `projects/*/locations/*/secrets/*`. + class GetSecretRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Request message for + # {::Google::Cloud::SecretManager::V1beta2::SecretManagerService::Client#list_secret_versions SecretManagerService.ListSecretVersions}. + # @!attribute [rw] parent + # @return [::String] + # Required. The resource name of the + # {::Google::Cloud::SecretManager::V1beta2::Secret Secret} associated with the + # {::Google::Cloud::SecretManager::V1beta2::SecretVersion SecretVersions} to list, + # in the format `projects/*/secrets/*` or `projects/*/locations/*/secrets/*`. + # @!attribute [rw] page_size + # @return [::Integer] + # Optional. The maximum number of results to be returned in a single page. If + # set to 0, the server decides the number of results to return. If the + # number is greater than 25000, it is capped at 25000. + # @!attribute [rw] page_token + # @return [::String] + # Optional. Pagination token, returned earlier via + # ListSecretVersionsResponse.next_page_token][]. + # @!attribute [rw] filter + # @return [::String] + # Optional. Filter string, adhering to the rules in + # [List-operation + # filtering](https://cloud.google.com/secret-manager/docs/filtering). List + # only secret versions matching the filter. If filter is empty, all secret + # versions are listed. + class ListSecretVersionsRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Response message for + # {::Google::Cloud::SecretManager::V1beta2::SecretManagerService::Client#list_secret_versions SecretManagerService.ListSecretVersions}. + # @!attribute [rw] versions + # @return [::Array<::Google::Cloud::SecretManager::V1beta2::SecretVersion>] + # The list of + # {::Google::Cloud::SecretManager::V1beta2::SecretVersion SecretVersions} sorted + # in reverse by create_time (newest first). + # @!attribute [rw] next_page_token + # @return [::String] + # A token to retrieve the next page of results. Pass this value in + # {::Google::Cloud::SecretManager::V1beta2::ListSecretVersionsRequest#page_token ListSecretVersionsRequest.page_token} + # to retrieve the next page. + # @!attribute [rw] total_size + # @return [::Integer] + # The total number of + # {::Google::Cloud::SecretManager::V1beta2::SecretVersion SecretVersions} but 0 + # when the + # {::Google::Cloud::SecretManager::V1beta2::ListSecretsRequest#filter ListSecretsRequest.filter} + # field is set. + class ListSecretVersionsResponse + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Request message for + # {::Google::Cloud::SecretManager::V1beta2::SecretManagerService::Client#get_secret_version SecretManagerService.GetSecretVersion}. + # @!attribute [rw] name + # @return [::String] + # Required. The resource name of the + # {::Google::Cloud::SecretManager::V1beta2::SecretVersion SecretVersion} in the + # format `projects/*/secrets/*/versions/*` or + # `projects/*/locations/*/secrets/*/versions/*`. + # + # `projects/*/secrets/*/versions/latest` or + # `projects/*/locations/*/secrets/*/versions/latest` is an alias to the most + # recently created + # {::Google::Cloud::SecretManager::V1beta2::SecretVersion SecretVersion}. + class GetSecretVersionRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Request message for + # {::Google::Cloud::SecretManager::V1beta2::SecretManagerService::Client#update_secret SecretManagerService.UpdateSecret}. + # @!attribute [rw] secret + # @return [::Google::Cloud::SecretManager::V1beta2::Secret] + # Required. {::Google::Cloud::SecretManager::V1beta2::Secret Secret} with updated + # field values. + # @!attribute [rw] update_mask + # @return [::Google::Protobuf::FieldMask] + # Required. Specifies the fields to be updated. + class UpdateSecretRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Request message for + # {::Google::Cloud::SecretManager::V1beta2::SecretManagerService::Client#access_secret_version SecretManagerService.AccessSecretVersion}. + # @!attribute [rw] name + # @return [::String] + # Required. The resource name of the + # {::Google::Cloud::SecretManager::V1beta2::SecretVersion SecretVersion} in the + # format `projects/*/secrets/*/versions/*` or + # `projects/*/locations/*/secrets/*/versions/*`. + # + # `projects/*/secrets/*/versions/latest` or + # `projects/*/locations/*/secrets/*/versions/latest` is an alias to the most + # recently created + # {::Google::Cloud::SecretManager::V1beta2::SecretVersion SecretVersion}. + class AccessSecretVersionRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Response message for + # {::Google::Cloud::SecretManager::V1beta2::SecretManagerService::Client#access_secret_version SecretManagerService.AccessSecretVersion}. + # @!attribute [rw] name + # @return [::String] + # The resource name of the + # {::Google::Cloud::SecretManager::V1beta2::SecretVersion SecretVersion} in the + # format `projects/*/secrets/*/versions/*` or + # `projects/*/locations/*/secrets/*/versions/*`. + # @!attribute [rw] payload + # @return [::Google::Cloud::SecretManager::V1beta2::SecretPayload] + # Secret payload + class AccessSecretVersionResponse + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Request message for + # {::Google::Cloud::SecretManager::V1beta2::SecretManagerService::Client#delete_secret SecretManagerService.DeleteSecret}. + # @!attribute [rw] name + # @return [::String] + # Required. The resource name of the + # {::Google::Cloud::SecretManager::V1beta2::Secret Secret} to delete in the format + # `projects/*/secrets/*`. + # @!attribute [rw] etag + # @return [::String] + # Optional. Etag of the {::Google::Cloud::SecretManager::V1beta2::Secret Secret}. + # The request succeeds if it matches the etag of the currently stored secret + # object. If the etag is omitted, the request succeeds. + class DeleteSecretRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Request message for + # {::Google::Cloud::SecretManager::V1beta2::SecretManagerService::Client#disable_secret_version SecretManagerService.DisableSecretVersion}. + # @!attribute [rw] name + # @return [::String] + # Required. The resource name of the + # {::Google::Cloud::SecretManager::V1beta2::SecretVersion SecretVersion} to + # disable in the format `projects/*/secrets/*/versions/*` or + # `projects/*/locations/*/secrets/*/versions/*`. + # @!attribute [rw] etag + # @return [::String] + # Optional. Etag of the + # {::Google::Cloud::SecretManager::V1beta2::SecretVersion SecretVersion}. The + # request succeeds if it matches the etag of the currently stored secret + # version object. If the etag is omitted, the request succeeds. + class DisableSecretVersionRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Request message for + # {::Google::Cloud::SecretManager::V1beta2::SecretManagerService::Client#enable_secret_version SecretManagerService.EnableSecretVersion}. + # @!attribute [rw] name + # @return [::String] + # Required. The resource name of the + # {::Google::Cloud::SecretManager::V1beta2::SecretVersion SecretVersion} to enable + # in the format `projects/*/secrets/*/versions/*` or + # `projects/*/locations/*/secrets/*/versions/*`. + # @!attribute [rw] etag + # @return [::String] + # Optional. Etag of the + # {::Google::Cloud::SecretManager::V1beta2::SecretVersion SecretVersion}. The + # request succeeds if it matches the etag of the currently stored secret + # version object. If the etag is omitted, the request succeeds. + class EnableSecretVersionRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Request message for + # {::Google::Cloud::SecretManager::V1beta2::SecretManagerService::Client#destroy_secret_version SecretManagerService.DestroySecretVersion}. + # @!attribute [rw] name + # @return [::String] + # Required. The resource name of the + # {::Google::Cloud::SecretManager::V1beta2::SecretVersion SecretVersion} to + # destroy in the format `projects/*/secrets/*/versions/*` or + # `projects/*/locations/*/secrets/*/versions/*`. + # @!attribute [rw] etag + # @return [::String] + # Optional. Etag of the + # {::Google::Cloud::SecretManager::V1beta2::SecretVersion SecretVersion}. The + # request succeeds if it matches the etag of the currently stored secret + # version object. If the etag is omitted, the request succeeds. + class DestroySecretVersionRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-secret_manager-v1beta2/proto_docs/google/iam/v1/iam_policy.rb b/owl-bot-staging/google-cloud-secret_manager-v1beta2/proto_docs/google/iam/v1/iam_policy.rb new file mode 100644 index 000000000000..5445c77f8258 --- /dev/null +++ b/owl-bot-staging/google-cloud-secret_manager-v1beta2/proto_docs/google/iam/v1/iam_policy.rb @@ -0,0 +1,87 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + + +module Google + module Iam + module V1 + # Request message for `SetIamPolicy` method. + # @!attribute [rw] resource + # @return [::String] + # REQUIRED: The resource for which the policy is being specified. + # See the operation documentation for the appropriate value for this field. + # @!attribute [rw] policy + # @return [::Google::Iam::V1::Policy] + # REQUIRED: The complete policy to be applied to the `resource`. The size of + # the policy is limited to a few 10s of KB. An empty policy is a + # valid policy but certain Cloud Platform services (such as Projects) + # might reject them. + # @!attribute [rw] update_mask + # @return [::Google::Protobuf::FieldMask] + # OPTIONAL: A FieldMask specifying which fields of the policy to modify. Only + # the fields in the mask will be modified. If no mask is provided, the + # following default mask is used: + # + # `paths: "bindings, etag"` + class SetIamPolicyRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Request message for `GetIamPolicy` method. + # @!attribute [rw] resource + # @return [::String] + # REQUIRED: The resource for which the policy is being requested. + # See the operation documentation for the appropriate value for this field. + # @!attribute [rw] options + # @return [::Google::Iam::V1::GetPolicyOptions] + # OPTIONAL: A `GetPolicyOptions` object for specifying options to + # `GetIamPolicy`. + class GetIamPolicyRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Request message for `TestIamPermissions` method. + # @!attribute [rw] resource + # @return [::String] + # REQUIRED: The resource for which the policy detail is being requested. + # See the operation documentation for the appropriate value for this field. + # @!attribute [rw] permissions + # @return [::Array<::String>] + # The set of permissions to check for the `resource`. Permissions with + # wildcards (such as '*' or 'storage.*') are not allowed. For more + # information see + # [IAM Overview](https://cloud.google.com/iam/docs/overview#permissions). + class TestIamPermissionsRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Response message for `TestIamPermissions` method. + # @!attribute [rw] permissions + # @return [::Array<::String>] + # A subset of `TestPermissionsRequest.permissions` that the caller is + # allowed. + class TestIamPermissionsResponse + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end + end +end diff --git a/owl-bot-staging/google-cloud-secret_manager-v1beta2/proto_docs/google/iam/v1/options.rb b/owl-bot-staging/google-cloud-secret_manager-v1beta2/proto_docs/google/iam/v1/options.rb new file mode 100644 index 000000000000..60713d995b86 --- /dev/null +++ b/owl-bot-staging/google-cloud-secret_manager-v1beta2/proto_docs/google/iam/v1/options.rb @@ -0,0 +1,50 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + + +module Google + module Iam + module V1 + # Encapsulates settings provided to GetIamPolicy. + # @!attribute [rw] requested_policy_version + # @return [::Integer] + # Optional. The maximum policy version that will be used to format the + # policy. + # + # Valid values are 0, 1, and 3. Requests specifying an invalid value will be + # rejected. + # + # Requests for policies with any conditional role bindings must specify + # version 3. Policies with no conditional role bindings may specify any valid + # value or leave the field unset. + # + # The policy in the response might use the policy version that you specified, + # or it might use a lower policy version. For example, if you specify version + # 3, but the policy has no conditional role bindings, the response uses + # version 1. + # + # To learn which resources support conditions in their IAM policies, see the + # [IAM + # documentation](https://cloud.google.com/iam/help/conditions/resource-policies). + class GetPolicyOptions + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end + end +end diff --git a/owl-bot-staging/google-cloud-secret_manager-v1beta2/proto_docs/google/iam/v1/policy.rb b/owl-bot-staging/google-cloud-secret_manager-v1beta2/proto_docs/google/iam/v1/policy.rb new file mode 100644 index 000000000000..999575b797df --- /dev/null +++ b/owl-bot-staging/google-cloud-secret_manager-v1beta2/proto_docs/google/iam/v1/policy.rb @@ -0,0 +1,426 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + + +module Google + module Iam + module V1 + # An Identity and Access Management (IAM) policy, which specifies access + # controls for Google Cloud resources. + # + # + # A `Policy` is a collection of `bindings`. A `binding` binds one or more + # `members`, or principals, to a single `role`. Principals can be user + # accounts, service accounts, Google groups, and domains (such as G Suite). A + # `role` is a named list of permissions; each `role` can be an IAM predefined + # role or a user-created custom role. + # + # For some types of Google Cloud resources, a `binding` can also specify a + # `condition`, which is a logical expression that allows access to a resource + # only if the expression evaluates to `true`. A condition can add constraints + # based on attributes of the request, the resource, or both. To learn which + # resources support conditions in their IAM policies, see the + # [IAM + # documentation](https://cloud.google.com/iam/help/conditions/resource-policies). + # + # **JSON example:** + # + # ``` + # { + # "bindings": [ + # { + # "role": "roles/resourcemanager.organizationAdmin", + # "members": [ + # "user:mike@example.com", + # "group:admins@example.com", + # "domain:google.com", + # "serviceAccount:my-project-id@appspot.gserviceaccount.com" + # ] + # }, + # { + # "role": "roles/resourcemanager.organizationViewer", + # "members": [ + # "user:eve@example.com" + # ], + # "condition": { + # "title": "expirable access", + # "description": "Does not grant access after Sep 2020", + # "expression": "request.time < + # timestamp('2020-10-01T00:00:00.000Z')", + # } + # } + # ], + # "etag": "BwWWja0YfJA=", + # "version": 3 + # } + # ``` + # + # **YAML example:** + # + # ``` + # bindings: + # - members: + # - user:mike@example.com + # - group:admins@example.com + # - domain:google.com + # - serviceAccount:my-project-id@appspot.gserviceaccount.com + # role: roles/resourcemanager.organizationAdmin + # - members: + # - user:eve@example.com + # role: roles/resourcemanager.organizationViewer + # condition: + # title: expirable access + # description: Does not grant access after Sep 2020 + # expression: request.time < timestamp('2020-10-01T00:00:00.000Z') + # etag: BwWWja0YfJA= + # version: 3 + # ``` + # + # For a description of IAM and its features, see the + # [IAM documentation](https://cloud.google.com/iam/docs/). + # @!attribute [rw] version + # @return [::Integer] + # Specifies the format of the policy. + # + # Valid values are `0`, `1`, and `3`. Requests that specify an invalid value + # are rejected. + # + # Any operation that affects conditional role bindings must specify version + # `3`. This requirement applies to the following operations: + # + # * Getting a policy that includes a conditional role binding + # * Adding a conditional role binding to a policy + # * Changing a conditional role binding in a policy + # * Removing any role binding, with or without a condition, from a policy + # that includes conditions + # + # **Important:** If you use IAM Conditions, you must include the `etag` field + # whenever you call `setIamPolicy`. If you omit this field, then IAM allows + # you to overwrite a version `3` policy with a version `1` policy, and all of + # the conditions in the version `3` policy are lost. + # + # If a policy does not include any conditions, operations on that policy may + # specify any valid version or leave the field unset. + # + # To learn which resources support conditions in their IAM policies, see the + # [IAM + # documentation](https://cloud.google.com/iam/help/conditions/resource-policies). + # @!attribute [rw] bindings + # @return [::Array<::Google::Iam::V1::Binding>] + # Associates a list of `members`, or principals, with a `role`. Optionally, + # may specify a `condition` that determines how and when the `bindings` are + # applied. Each of the `bindings` must contain at least one principal. + # + # The `bindings` in a `Policy` can refer to up to 1,500 principals; up to 250 + # of these principals can be Google groups. Each occurrence of a principal + # counts towards these limits. For example, if the `bindings` grant 50 + # different roles to `user:alice@example.com`, and not to any other + # principal, then you can add another 1,450 principals to the `bindings` in + # the `Policy`. + # @!attribute [rw] audit_configs + # @return [::Array<::Google::Iam::V1::AuditConfig>] + # Specifies cloud audit logging configuration for this policy. + # @!attribute [rw] etag + # @return [::String] + # `etag` is used for optimistic concurrency control as a way to help + # prevent simultaneous updates of a policy from overwriting each other. + # It is strongly suggested that systems make use of the `etag` in the + # read-modify-write cycle to perform policy updates in order to avoid race + # conditions: An `etag` is returned in the response to `getIamPolicy`, and + # systems are expected to put that etag in the request to `setIamPolicy` to + # ensure that their change will be applied to the same version of the policy. + # + # **Important:** If you use IAM Conditions, you must include the `etag` field + # whenever you call `setIamPolicy`. If you omit this field, then IAM allows + # you to overwrite a version `3` policy with a version `1` policy, and all of + # the conditions in the version `3` policy are lost. + class Policy + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Associates `members`, or principals, with a `role`. + # @!attribute [rw] role + # @return [::String] + # Role that is assigned to the list of `members`, or principals. + # For example, `roles/viewer`, `roles/editor`, or `roles/owner`. + # @!attribute [rw] members + # @return [::Array<::String>] + # Specifies the principals requesting access for a Google Cloud resource. + # `members` can have the following values: + # + # * `allUsers`: A special identifier that represents anyone who is + # on the internet; with or without a Google account. + # + # * `allAuthenticatedUsers`: A special identifier that represents anyone + # who is authenticated with a Google account or a service account. + # + # * `user:{emailid}`: An email address that represents a specific Google + # account. For example, `alice@example.com` . + # + # + # * `serviceAccount:{emailid}`: An email address that represents a service + # account. For example, `my-other-app@appspot.gserviceaccount.com`. + # + # * `group:{emailid}`: An email address that represents a Google group. + # For example, `admins@example.com`. + # + # * `deleted:user:{emailid}?uid={uniqueid}`: An email address (plus unique + # identifier) representing a user that has been recently deleted. For + # example, `alice@example.com?uid=123456789012345678901`. If the user is + # recovered, this value reverts to `user:{emailid}` and the recovered user + # retains the role in the binding. + # + # * `deleted:serviceAccount:{emailid}?uid={uniqueid}`: An email address (plus + # unique identifier) representing a service account that has been recently + # deleted. For example, + # `my-other-app@appspot.gserviceaccount.com?uid=123456789012345678901`. + # If the service account is undeleted, this value reverts to + # `serviceAccount:{emailid}` and the undeleted service account retains the + # role in the binding. + # + # * `deleted:group:{emailid}?uid={uniqueid}`: An email address (plus unique + # identifier) representing a Google group that has been recently + # deleted. For example, `admins@example.com?uid=123456789012345678901`. If + # the group is recovered, this value reverts to `group:{emailid}` and the + # recovered group retains the role in the binding. + # + # + # * `domain:{domain}`: The G Suite domain (primary) that represents all the + # users of that domain. For example, `google.com` or `example.com`. + # @!attribute [rw] condition + # @return [::Google::Type::Expr] + # The condition that is associated with this binding. + # + # If the condition evaluates to `true`, then this binding applies to the + # current request. + # + # If the condition evaluates to `false`, then this binding does not apply to + # the current request. However, a different role binding might grant the same + # role to one or more of the principals in this binding. + # + # To learn which resources support conditions in their IAM policies, see the + # [IAM + # documentation](https://cloud.google.com/iam/help/conditions/resource-policies). + class Binding + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Specifies the audit configuration for a service. + # The configuration determines which permission types are logged, and what + # identities, if any, are exempted from logging. + # An AuditConfig must have one or more AuditLogConfigs. + # + # If there are AuditConfigs for both `allServices` and a specific service, + # the union of the two AuditConfigs is used for that service: the log_types + # specified in each AuditConfig are enabled, and the exempted_members in each + # AuditLogConfig are exempted. + # + # Example Policy with multiple AuditConfigs: + # + # { + # "audit_configs": [ + # { + # "service": "allServices", + # "audit_log_configs": [ + # { + # "log_type": "DATA_READ", + # "exempted_members": [ + # "user:jose@example.com" + # ] + # }, + # { + # "log_type": "DATA_WRITE" + # }, + # { + # "log_type": "ADMIN_READ" + # } + # ] + # }, + # { + # "service": "sampleservice.googleapis.com", + # "audit_log_configs": [ + # { + # "log_type": "DATA_READ" + # }, + # { + # "log_type": "DATA_WRITE", + # "exempted_members": [ + # "user:aliya@example.com" + # ] + # } + # ] + # } + # ] + # } + # + # For sampleservice, this policy enables DATA_READ, DATA_WRITE and ADMIN_READ + # logging. It also exempts `jose@example.com` from DATA_READ logging, and + # `aliya@example.com` from DATA_WRITE logging. + # @!attribute [rw] service + # @return [::String] + # Specifies a service that will be enabled for audit logging. + # For example, `storage.googleapis.com`, `cloudsql.googleapis.com`. + # `allServices` is a special value that covers all services. + # @!attribute [rw] audit_log_configs + # @return [::Array<::Google::Iam::V1::AuditLogConfig>] + # The configuration for logging of each type of permission. + class AuditConfig + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Provides the configuration for logging a type of permissions. + # Example: + # + # { + # "audit_log_configs": [ + # { + # "log_type": "DATA_READ", + # "exempted_members": [ + # "user:jose@example.com" + # ] + # }, + # { + # "log_type": "DATA_WRITE" + # } + # ] + # } + # + # This enables 'DATA_READ' and 'DATA_WRITE' logging, while exempting + # jose@example.com from DATA_READ logging. + # @!attribute [rw] log_type + # @return [::Google::Iam::V1::AuditLogConfig::LogType] + # The log type that this config enables. + # @!attribute [rw] exempted_members + # @return [::Array<::String>] + # Specifies the identities that do not cause logging for this type of + # permission. + # Follows the same format of + # [Binding.members][google.iam.v1.Binding.members]. + class AuditLogConfig + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # The list of valid permission types for which logging can be configured. + # Admin writes are always logged, and are not configurable. + module LogType + # Default case. Should never be this. + LOG_TYPE_UNSPECIFIED = 0 + + # Admin reads. Example: CloudIAM getIamPolicy + ADMIN_READ = 1 + + # Data writes. Example: CloudSQL Users create + DATA_WRITE = 2 + + # Data reads. Example: CloudSQL Users list + DATA_READ = 3 + end + end + + # The difference delta between two policies. + # @!attribute [rw] binding_deltas + # @return [::Array<::Google::Iam::V1::BindingDelta>] + # The delta for Bindings between two policies. + # @!attribute [rw] audit_config_deltas + # @return [::Array<::Google::Iam::V1::AuditConfigDelta>] + # The delta for AuditConfigs between two policies. + class PolicyDelta + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # One delta entry for Binding. Each individual change (only one member in each + # entry) to a binding will be a separate entry. + # @!attribute [rw] action + # @return [::Google::Iam::V1::BindingDelta::Action] + # The action that was performed on a Binding. + # Required + # @!attribute [rw] role + # @return [::String] + # Role that is assigned to `members`. + # For example, `roles/viewer`, `roles/editor`, or `roles/owner`. + # Required + # @!attribute [rw] member + # @return [::String] + # A single identity requesting access for a Google Cloud resource. + # Follows the same format of Binding.members. + # Required + # @!attribute [rw] condition + # @return [::Google::Type::Expr] + # The condition that is associated with this binding. + class BindingDelta + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # The type of action performed on a Binding in a policy. + module Action + # Unspecified. + ACTION_UNSPECIFIED = 0 + + # Addition of a Binding. + ADD = 1 + + # Removal of a Binding. + REMOVE = 2 + end + end + + # One delta entry for AuditConfig. Each individual change (only one + # exempted_member in each entry) to a AuditConfig will be a separate entry. + # @!attribute [rw] action + # @return [::Google::Iam::V1::AuditConfigDelta::Action] + # The action that was performed on an audit configuration in a policy. + # Required + # @!attribute [rw] service + # @return [::String] + # Specifies a service that was configured for Cloud Audit Logging. + # For example, `storage.googleapis.com`, `cloudsql.googleapis.com`. + # `allServices` is a special value that covers all services. + # Required + # @!attribute [rw] exempted_member + # @return [::String] + # A single identity that is exempted from "data access" audit + # logging for the `service` specified above. + # Follows the same format of Binding.members. + # @!attribute [rw] log_type + # @return [::String] + # Specifies the log_type that was be enabled. ADMIN_ACTIVITY is always + # enabled, and cannot be configured. + # Required + class AuditConfigDelta + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # The type of action performed on an audit configuration in a policy. + module Action + # Unspecified. + ACTION_UNSPECIFIED = 0 + + # Addition of an audit configuration. + ADD = 1 + + # Removal of an audit configuration. + REMOVE = 2 + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-secret_manager-v1beta2/proto_docs/google/protobuf/any.rb b/owl-bot-staging/google-cloud-secret_manager-v1beta2/proto_docs/google/protobuf/any.rb new file mode 100644 index 000000000000..58691995f02e --- /dev/null +++ b/owl-bot-staging/google-cloud-secret_manager-v1beta2/proto_docs/google/protobuf/any.rb @@ -0,0 +1,145 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + + +module Google + module Protobuf + # `Any` contains an arbitrary serialized protocol buffer message along with a + # URL that describes the type of the serialized message. + # + # Protobuf library provides support to pack/unpack Any values in the form + # of utility functions or additional generated methods of the Any type. + # + # Example 1: Pack and unpack a message in C++. + # + # Foo foo = ...; + # Any any; + # any.PackFrom(foo); + # ... + # if (any.UnpackTo(&foo)) { + # ... + # } + # + # Example 2: Pack and unpack a message in Java. + # + # Foo foo = ...; + # Any any = Any.pack(foo); + # ... + # if (any.is(Foo.class)) { + # foo = any.unpack(Foo.class); + # } + # // or ... + # if (any.isSameTypeAs(Foo.getDefaultInstance())) { + # foo = any.unpack(Foo.getDefaultInstance()); + # } + # + # Example 3: Pack and unpack a message in Python. + # + # foo = Foo(...) + # any = Any() + # any.Pack(foo) + # ... + # if any.Is(Foo.DESCRIPTOR): + # any.Unpack(foo) + # ... + # + # Example 4: Pack and unpack a message in Go + # + # foo := &pb.Foo{...} + # any, err := anypb.New(foo) + # if err != nil { + # ... + # } + # ... + # foo := &pb.Foo{} + # if err := any.UnmarshalTo(foo); err != nil { + # ... + # } + # + # The pack methods provided by protobuf library will by default use + # 'type.googleapis.com/full.type.name' as the type URL and the unpack + # methods only use the fully qualified type name after the last '/' + # in the type URL, for example "foo.bar.com/x/y.z" will yield type + # name "y.z". + # + # JSON + # ==== + # The JSON representation of an `Any` value uses the regular + # representation of the deserialized, embedded message, with an + # additional field `@type` which contains the type URL. Example: + # + # package google.profile; + # message Person { + # string first_name = 1; + # string last_name = 2; + # } + # + # { + # "@type": "type.googleapis.com/google.profile.Person", + # "firstName": , + # "lastName": + # } + # + # If the embedded message type is well-known and has a custom JSON + # representation, that representation will be embedded adding a field + # `value` which holds the custom JSON in addition to the `@type` + # field. Example (for message [google.protobuf.Duration][]): + # + # { + # "@type": "type.googleapis.com/google.protobuf.Duration", + # "value": "1.212s" + # } + # @!attribute [rw] type_url + # @return [::String] + # A URL/resource name that uniquely identifies the type of the serialized + # protocol buffer message. This string must contain at least + # one "/" character. The last segment of the URL's path must represent + # the fully qualified name of the type (as in + # `path/google.protobuf.Duration`). The name should be in a canonical form + # (e.g., leading "." is not accepted). + # + # In practice, teams usually precompile into the binary all types that they + # expect it to use in the context of Any. However, for URLs which use the + # scheme `http`, `https`, or no scheme, one can optionally set up a type + # server that maps type URLs to message definitions as follows: + # + # * If no scheme is provided, `https` is assumed. + # * An HTTP GET on the URL must yield a [google.protobuf.Type][] + # value in binary format, or produce an error. + # * Applications are allowed to cache lookup results based on the + # URL, or have them precompiled into a binary to avoid any + # lookup. Therefore, binary compatibility needs to be preserved + # on changes to types. (Use versioned type names to manage + # breaking changes.) + # + # Note: this functionality is not currently available in the official + # protobuf release, and it is not used for type URLs beginning with + # type.googleapis.com. As of May 2023, there are no widely used type server + # implementations and no plans to implement one. + # + # Schemes other than `http`, `https` (or the empty scheme) might be + # used with implementation specific semantics. + # @!attribute [rw] value + # @return [::String] + # Must be a valid serialized protocol buffer of the above specified type. + class Any + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end +end diff --git a/owl-bot-staging/google-cloud-secret_manager-v1beta2/proto_docs/google/protobuf/duration.rb b/owl-bot-staging/google-cloud-secret_manager-v1beta2/proto_docs/google/protobuf/duration.rb new file mode 100644 index 000000000000..ea59f1f91daf --- /dev/null +++ b/owl-bot-staging/google-cloud-secret_manager-v1beta2/proto_docs/google/protobuf/duration.rb @@ -0,0 +1,98 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + + +module Google + module Protobuf + # A Duration represents a signed, fixed-length span of time represented + # as a count of seconds and fractions of seconds at nanosecond + # resolution. It is independent of any calendar and concepts like "day" + # or "month". It is related to Timestamp in that the difference between + # two Timestamp values is a Duration and it can be added or subtracted + # from a Timestamp. Range is approximately +-10,000 years. + # + # # Examples + # + # Example 1: Compute Duration from two Timestamps in pseudo code. + # + # Timestamp start = ...; + # Timestamp end = ...; + # Duration duration = ...; + # + # duration.seconds = end.seconds - start.seconds; + # duration.nanos = end.nanos - start.nanos; + # + # if (duration.seconds < 0 && duration.nanos > 0) { + # duration.seconds += 1; + # duration.nanos -= 1000000000; + # } else if (duration.seconds > 0 && duration.nanos < 0) { + # duration.seconds -= 1; + # duration.nanos += 1000000000; + # } + # + # Example 2: Compute Timestamp from Timestamp + Duration in pseudo code. + # + # Timestamp start = ...; + # Duration duration = ...; + # Timestamp end = ...; + # + # end.seconds = start.seconds + duration.seconds; + # end.nanos = start.nanos + duration.nanos; + # + # if (end.nanos < 0) { + # end.seconds -= 1; + # end.nanos += 1000000000; + # } else if (end.nanos >= 1000000000) { + # end.seconds += 1; + # end.nanos -= 1000000000; + # } + # + # Example 3: Compute Duration from datetime.timedelta in Python. + # + # td = datetime.timedelta(days=3, minutes=10) + # duration = Duration() + # duration.FromTimedelta(td) + # + # # JSON Mapping + # + # In JSON format, the Duration type is encoded as a string rather than an + # object, where the string ends in the suffix "s" (indicating seconds) and + # is preceded by the number of seconds, with nanoseconds expressed as + # fractional seconds. For example, 3 seconds with 0 nanoseconds should be + # encoded in JSON format as "3s", while 3 seconds and 1 nanosecond should + # be expressed in JSON format as "3.000000001s", and 3 seconds and 1 + # microsecond should be expressed in JSON format as "3.000001s". + # @!attribute [rw] seconds + # @return [::Integer] + # Signed seconds of the span of time. Must be from -315,576,000,000 + # to +315,576,000,000 inclusive. Note: these bounds are computed from: + # 60 sec/min * 60 min/hr * 24 hr/day * 365.25 days/year * 10000 years + # @!attribute [rw] nanos + # @return [::Integer] + # Signed fractions of a second at nanosecond resolution of the span + # of time. Durations less than one second are represented with a 0 + # `seconds` field and a positive or negative `nanos` field. For durations + # of one second or more, a non-zero value for the `nanos` field must be + # of the same sign as the `seconds` field. Must be from -999,999,999 + # to +999,999,999 inclusive. + class Duration + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end +end diff --git a/owl-bot-staging/google-cloud-secret_manager-v1beta2/proto_docs/google/protobuf/empty.rb b/owl-bot-staging/google-cloud-secret_manager-v1beta2/proto_docs/google/protobuf/empty.rb new file mode 100644 index 000000000000..83e4481834a6 --- /dev/null +++ b/owl-bot-staging/google-cloud-secret_manager-v1beta2/proto_docs/google/protobuf/empty.rb @@ -0,0 +1,34 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + + +module Google + module Protobuf + # A generic empty message that you can re-use to avoid defining duplicated + # empty messages in your APIs. A typical example is to use it as the request + # or the response type of an API method. For instance: + # + # service Foo { + # rpc Bar(google.protobuf.Empty) returns (google.protobuf.Empty); + # } + class Empty + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end +end diff --git a/owl-bot-staging/google-cloud-secret_manager-v1beta2/proto_docs/google/protobuf/field_mask.rb b/owl-bot-staging/google-cloud-secret_manager-v1beta2/proto_docs/google/protobuf/field_mask.rb new file mode 100644 index 000000000000..7f3ffc78601a --- /dev/null +++ b/owl-bot-staging/google-cloud-secret_manager-v1beta2/proto_docs/google/protobuf/field_mask.rb @@ -0,0 +1,229 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + + +module Google + module Protobuf + # `FieldMask` represents a set of symbolic field paths, for example: + # + # paths: "f.a" + # paths: "f.b.d" + # + # Here `f` represents a field in some root message, `a` and `b` + # fields in the message found in `f`, and `d` a field found in the + # message in `f.b`. + # + # Field masks are used to specify a subset of fields that should be + # returned by a get operation or modified by an update operation. + # Field masks also have a custom JSON encoding (see below). + # + # # Field Masks in Projections + # + # When used in the context of a projection, a response message or + # sub-message is filtered by the API to only contain those fields as + # specified in the mask. For example, if the mask in the previous + # example is applied to a response message as follows: + # + # f { + # a : 22 + # b { + # d : 1 + # x : 2 + # } + # y : 13 + # } + # z: 8 + # + # The result will not contain specific values for fields x,y and z + # (their value will be set to the default, and omitted in proto text + # output): + # + # + # f { + # a : 22 + # b { + # d : 1 + # } + # } + # + # A repeated field is not allowed except at the last position of a + # paths string. + # + # If a FieldMask object is not present in a get operation, the + # operation applies to all fields (as if a FieldMask of all fields + # had been specified). + # + # Note that a field mask does not necessarily apply to the + # top-level response message. In case of a REST get operation, the + # field mask applies directly to the response, but in case of a REST + # list operation, the mask instead applies to each individual message + # in the returned resource list. In case of a REST custom method, + # other definitions may be used. Where the mask applies will be + # clearly documented together with its declaration in the API. In + # any case, the effect on the returned resource/resources is required + # behavior for APIs. + # + # # Field Masks in Update Operations + # + # A field mask in update operations specifies which fields of the + # targeted resource are going to be updated. The API is required + # to only change the values of the fields as specified in the mask + # and leave the others untouched. If a resource is passed in to + # describe the updated values, the API ignores the values of all + # fields not covered by the mask. + # + # If a repeated field is specified for an update operation, new values will + # be appended to the existing repeated field in the target resource. Note that + # a repeated field is only allowed in the last position of a `paths` string. + # + # If a sub-message is specified in the last position of the field mask for an + # update operation, then new value will be merged into the existing sub-message + # in the target resource. + # + # For example, given the target message: + # + # f { + # b { + # d: 1 + # x: 2 + # } + # c: [1] + # } + # + # And an update message: + # + # f { + # b { + # d: 10 + # } + # c: [2] + # } + # + # then if the field mask is: + # + # paths: ["f.b", "f.c"] + # + # then the result will be: + # + # f { + # b { + # d: 10 + # x: 2 + # } + # c: [1, 2] + # } + # + # An implementation may provide options to override this default behavior for + # repeated and message fields. + # + # In order to reset a field's value to the default, the field must + # be in the mask and set to the default value in the provided resource. + # Hence, in order to reset all fields of a resource, provide a default + # instance of the resource and set all fields in the mask, or do + # not provide a mask as described below. + # + # If a field mask is not present on update, the operation applies to + # all fields (as if a field mask of all fields has been specified). + # Note that in the presence of schema evolution, this may mean that + # fields the client does not know and has therefore not filled into + # the request will be reset to their default. If this is unwanted + # behavior, a specific service may require a client to always specify + # a field mask, producing an error if not. + # + # As with get operations, the location of the resource which + # describes the updated values in the request message depends on the + # operation kind. In any case, the effect of the field mask is + # required to be honored by the API. + # + # ## Considerations for HTTP REST + # + # The HTTP kind of an update operation which uses a field mask must + # be set to PATCH instead of PUT in order to satisfy HTTP semantics + # (PUT must only be used for full updates). + # + # # JSON Encoding of Field Masks + # + # In JSON, a field mask is encoded as a single string where paths are + # separated by a comma. Fields name in each path are converted + # to/from lower-camel naming conventions. + # + # As an example, consider the following message declarations: + # + # message Profile { + # User user = 1; + # Photo photo = 2; + # } + # message User { + # string display_name = 1; + # string address = 2; + # } + # + # In proto a field mask for `Profile` may look as such: + # + # mask { + # paths: "user.display_name" + # paths: "photo" + # } + # + # In JSON, the same mask is represented as below: + # + # { + # mask: "user.displayName,photo" + # } + # + # # Field Masks and Oneof Fields + # + # Field masks treat fields in oneofs just as regular fields. Consider the + # following message: + # + # message SampleMessage { + # oneof test_oneof { + # string name = 4; + # SubMessage sub_message = 9; + # } + # } + # + # The field mask can be: + # + # mask { + # paths: "name" + # } + # + # Or: + # + # mask { + # paths: "sub_message" + # } + # + # Note that oneof type names ("test_oneof" in this case) cannot be used in + # paths. + # + # ## Field Mask Verification + # + # The implementation of any API method which has a FieldMask type field in the + # request should verify the included field paths, and return an + # `INVALID_ARGUMENT` error if any path is unmappable. + # @!attribute [rw] paths + # @return [::Array<::String>] + # The set of field mask paths. + class FieldMask + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end +end diff --git a/owl-bot-staging/google-cloud-secret_manager-v1beta2/proto_docs/google/protobuf/timestamp.rb b/owl-bot-staging/google-cloud-secret_manager-v1beta2/proto_docs/google/protobuf/timestamp.rb new file mode 100644 index 000000000000..74352be9c58c --- /dev/null +++ b/owl-bot-staging/google-cloud-secret_manager-v1beta2/proto_docs/google/protobuf/timestamp.rb @@ -0,0 +1,127 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + + +module Google + module Protobuf + # A Timestamp represents a point in time independent of any time zone or local + # calendar, encoded as a count of seconds and fractions of seconds at + # nanosecond resolution. The count is relative to an epoch at UTC midnight on + # January 1, 1970, in the proleptic Gregorian calendar which extends the + # Gregorian calendar backwards to year one. + # + # All minutes are 60 seconds long. Leap seconds are "smeared" so that no leap + # second table is needed for interpretation, using a [24-hour linear + # smear](https://developers.google.com/time/smear). + # + # The range is from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59.999999999Z. By + # restricting to that range, we ensure that we can convert to and from [RFC + # 3339](https://www.ietf.org/rfc/rfc3339.txt) date strings. + # + # # Examples + # + # Example 1: Compute Timestamp from POSIX `time()`. + # + # Timestamp timestamp; + # timestamp.set_seconds(time(NULL)); + # timestamp.set_nanos(0); + # + # Example 2: Compute Timestamp from POSIX `gettimeofday()`. + # + # struct timeval tv; + # gettimeofday(&tv, NULL); + # + # Timestamp timestamp; + # timestamp.set_seconds(tv.tv_sec); + # timestamp.set_nanos(tv.tv_usec * 1000); + # + # Example 3: Compute Timestamp from Win32 `GetSystemTimeAsFileTime()`. + # + # FILETIME ft; + # GetSystemTimeAsFileTime(&ft); + # UINT64 ticks = (((UINT64)ft.dwHighDateTime) << 32) | ft.dwLowDateTime; + # + # // A Windows tick is 100 nanoseconds. Windows epoch 1601-01-01T00:00:00Z + # // is 11644473600 seconds before Unix epoch 1970-01-01T00:00:00Z. + # Timestamp timestamp; + # timestamp.set_seconds((INT64) ((ticks / 10000000) - 11644473600LL)); + # timestamp.set_nanos((INT32) ((ticks % 10000000) * 100)); + # + # Example 4: Compute Timestamp from Java `System.currentTimeMillis()`. + # + # long millis = System.currentTimeMillis(); + # + # Timestamp timestamp = Timestamp.newBuilder().setSeconds(millis / 1000) + # .setNanos((int) ((millis % 1000) * 1000000)).build(); + # + # Example 5: Compute Timestamp from Java `Instant.now()`. + # + # Instant now = Instant.now(); + # + # Timestamp timestamp = + # Timestamp.newBuilder().setSeconds(now.getEpochSecond()) + # .setNanos(now.getNano()).build(); + # + # Example 6: Compute Timestamp from current time in Python. + # + # timestamp = Timestamp() + # timestamp.GetCurrentTime() + # + # # JSON Mapping + # + # In JSON format, the Timestamp type is encoded as a string in the + # [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format. That is, the + # format is "\\{year}-\\{month}-\\{day}T\\{hour}:\\{min}:\\{sec}[.\\{frac_sec}]Z" + # where \\{year} is always expressed using four digits while \\{month}, \\{day}, + # \\{hour}, \\{min}, and \\{sec} are zero-padded to two digits each. The fractional + # seconds, which can go up to 9 digits (i.e. up to 1 nanosecond resolution), + # are optional. The "Z" suffix indicates the timezone ("UTC"); the timezone + # is required. A proto3 JSON serializer should always use UTC (as indicated by + # "Z") when printing the Timestamp type and a proto3 JSON parser should be + # able to accept both UTC and other timezones (as indicated by an offset). + # + # For example, "2017-01-15T01:30:15.01Z" encodes 15.01 seconds past + # 01:30 UTC on January 15, 2017. + # + # In JavaScript, one can convert a Date object to this format using the + # standard + # [toISOString()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toISOString) + # method. In Python, a standard `datetime.datetime` object can be converted + # to this format using + # [`strftime`](https://docs.python.org/2/library/time.html#time.strftime) with + # the time format spec '%Y-%m-%dT%H:%M:%S.%fZ'. Likewise, in Java, one can use + # the Joda Time's [`ISODateTimeFormat.dateTime()`]( + # http://joda-time.sourceforge.net/apidocs/org/joda/time/format/ISODateTimeFormat.html#dateTime() + # ) to obtain a formatter capable of generating timestamps in this format. + # @!attribute [rw] seconds + # @return [::Integer] + # Represents seconds of UTC time since Unix epoch + # 1970-01-01T00:00:00Z. Must be from 0001-01-01T00:00:00Z to + # 9999-12-31T23:59:59Z inclusive. + # @!attribute [rw] nanos + # @return [::Integer] + # Non-negative fractions of a second at nanosecond resolution. Negative + # second values with fractions must still have non-negative nanos values + # that count forward in time. Must be from 0 to 999,999,999 + # inclusive. + class Timestamp + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end +end diff --git a/owl-bot-staging/google-cloud-secret_manager-v1beta2/proto_docs/google/type/expr.rb b/owl-bot-staging/google-cloud-secret_manager-v1beta2/proto_docs/google/type/expr.rb new file mode 100644 index 000000000000..53e7733b6592 --- /dev/null +++ b/owl-bot-staging/google-cloud-secret_manager-v1beta2/proto_docs/google/type/expr.rb @@ -0,0 +1,75 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + + +module Google + module Type + # Represents a textual expression in the Common Expression Language (CEL) + # syntax. CEL is a C-like expression language. The syntax and semantics of CEL + # are documented at https://github.com/google/cel-spec. + # + # Example (Comparison): + # + # title: "Summary size limit" + # description: "Determines if a summary is less than 100 chars" + # expression: "document.summary.size() < 100" + # + # Example (Equality): + # + # title: "Requestor is owner" + # description: "Determines if requestor is the document owner" + # expression: "document.owner == request.auth.claims.email" + # + # Example (Logic): + # + # title: "Public documents" + # description: "Determine whether the document should be publicly visible" + # expression: "document.type != 'private' && document.type != 'internal'" + # + # Example (Data Manipulation): + # + # title: "Notification string" + # description: "Create a notification string with a timestamp." + # expression: "'New message received at ' + string(document.create_time)" + # + # The exact variables and functions that may be referenced within an expression + # are determined by the service that evaluates it. See the service + # documentation for additional information. + # @!attribute [rw] expression + # @return [::String] + # Textual representation of an expression in Common Expression Language + # syntax. + # @!attribute [rw] title + # @return [::String] + # Optional. Title for the expression, i.e. a short string describing + # its purpose. This can be used e.g. in UIs which allow to enter the + # expression. + # @!attribute [rw] description + # @return [::String] + # Optional. Description of the expression. This is a longer text which + # describes the expression, e.g. when hovered over it in a UI. + # @!attribute [rw] location + # @return [::String] + # Optional. String indicating the location of the expression for error + # reporting, e.g. a file name and a position in the file. + class Expr + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end +end diff --git a/owl-bot-staging/google-cloud-secret_manager-v1beta2/snippets/Gemfile b/owl-bot-staging/google-cloud-secret_manager-v1beta2/snippets/Gemfile new file mode 100644 index 000000000000..dbb02f1e7509 --- /dev/null +++ b/owl-bot-staging/google-cloud-secret_manager-v1beta2/snippets/Gemfile @@ -0,0 +1,32 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +source "https://rubygems.org" + +if ENV["GOOGLE_CLOUD_SAMPLES_TEST"] == "master" + gem "google-cloud-secret_manager-v1beta2", path: "../" +else + gem "google-cloud-secret_manager-v1beta2" +end + +group :test do + gem "google-style", "~> 1.26.1" + gem "minitest", "~> 5.16" + gem "minitest-focus", "~> 1.1" + gem "minitest-hooks", "~> 1.5" +end diff --git a/owl-bot-staging/google-cloud-secret_manager-v1beta2/snippets/secret_manager_service/access_secret_version.rb b/owl-bot-staging/google-cloud-secret_manager-v1beta2/snippets/secret_manager_service/access_secret_version.rb new file mode 100644 index 000000000000..d0d080ffd38d --- /dev/null +++ b/owl-bot-staging/google-cloud-secret_manager-v1beta2/snippets/secret_manager_service/access_secret_version.rb @@ -0,0 +1,47 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +# [START secretmanager_v1beta2_generated_SecretManagerService_AccessSecretVersion_sync] +require "google/cloud/secret_manager/v1beta2" + +## +# Snippet for the access_secret_version call in the SecretManagerService service +# +# This snippet has been automatically generated and should be regarded as a code +# template only. It will require modifications to work: +# - It may require correct/in-range values for request initialization. +# - It may require specifying regional endpoints when creating the service +# client as shown in https://cloud.google.com/ruby/docs/reference. +# +# This is an auto-generated example demonstrating basic usage of +# Google::Cloud::SecretManager::V1beta2::SecretManagerService::Client#access_secret_version. +# +def access_secret_version + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::SecretManager::V1beta2::SecretManagerService::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::SecretManager::V1beta2::AccessSecretVersionRequest.new + + # Call the access_secret_version method. + result = client.access_secret_version request + + # The returned object is of type Google::Cloud::SecretManager::V1beta2::AccessSecretVersionResponse. + p result +end +# [END secretmanager_v1beta2_generated_SecretManagerService_AccessSecretVersion_sync] diff --git a/owl-bot-staging/google-cloud-secret_manager-v1beta2/snippets/secret_manager_service/add_secret_version.rb b/owl-bot-staging/google-cloud-secret_manager-v1beta2/snippets/secret_manager_service/add_secret_version.rb new file mode 100644 index 000000000000..e80ead1cc007 --- /dev/null +++ b/owl-bot-staging/google-cloud-secret_manager-v1beta2/snippets/secret_manager_service/add_secret_version.rb @@ -0,0 +1,47 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +# [START secretmanager_v1beta2_generated_SecretManagerService_AddSecretVersion_sync] +require "google/cloud/secret_manager/v1beta2" + +## +# Snippet for the add_secret_version call in the SecretManagerService service +# +# This snippet has been automatically generated and should be regarded as a code +# template only. It will require modifications to work: +# - It may require correct/in-range values for request initialization. +# - It may require specifying regional endpoints when creating the service +# client as shown in https://cloud.google.com/ruby/docs/reference. +# +# This is an auto-generated example demonstrating basic usage of +# Google::Cloud::SecretManager::V1beta2::SecretManagerService::Client#add_secret_version. +# +def add_secret_version + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::SecretManager::V1beta2::SecretManagerService::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::SecretManager::V1beta2::AddSecretVersionRequest.new + + # Call the add_secret_version method. + result = client.add_secret_version request + + # The returned object is of type Google::Cloud::SecretManager::V1beta2::SecretVersion. + p result +end +# [END secretmanager_v1beta2_generated_SecretManagerService_AddSecretVersion_sync] diff --git a/owl-bot-staging/google-cloud-secret_manager-v1beta2/snippets/secret_manager_service/create_secret.rb b/owl-bot-staging/google-cloud-secret_manager-v1beta2/snippets/secret_manager_service/create_secret.rb new file mode 100644 index 000000000000..e3bad58b58f1 --- /dev/null +++ b/owl-bot-staging/google-cloud-secret_manager-v1beta2/snippets/secret_manager_service/create_secret.rb @@ -0,0 +1,47 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +# [START secretmanager_v1beta2_generated_SecretManagerService_CreateSecret_sync] +require "google/cloud/secret_manager/v1beta2" + +## +# Snippet for the create_secret call in the SecretManagerService service +# +# This snippet has been automatically generated and should be regarded as a code +# template only. It will require modifications to work: +# - It may require correct/in-range values for request initialization. +# - It may require specifying regional endpoints when creating the service +# client as shown in https://cloud.google.com/ruby/docs/reference. +# +# This is an auto-generated example demonstrating basic usage of +# Google::Cloud::SecretManager::V1beta2::SecretManagerService::Client#create_secret. +# +def create_secret + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::SecretManager::V1beta2::SecretManagerService::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::SecretManager::V1beta2::CreateSecretRequest.new + + # Call the create_secret method. + result = client.create_secret request + + # The returned object is of type Google::Cloud::SecretManager::V1beta2::Secret. + p result +end +# [END secretmanager_v1beta2_generated_SecretManagerService_CreateSecret_sync] diff --git a/owl-bot-staging/google-cloud-secret_manager-v1beta2/snippets/secret_manager_service/delete_secret.rb b/owl-bot-staging/google-cloud-secret_manager-v1beta2/snippets/secret_manager_service/delete_secret.rb new file mode 100644 index 000000000000..13e175a049e9 --- /dev/null +++ b/owl-bot-staging/google-cloud-secret_manager-v1beta2/snippets/secret_manager_service/delete_secret.rb @@ -0,0 +1,47 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +# [START secretmanager_v1beta2_generated_SecretManagerService_DeleteSecret_sync] +require "google/cloud/secret_manager/v1beta2" + +## +# Snippet for the delete_secret call in the SecretManagerService service +# +# This snippet has been automatically generated and should be regarded as a code +# template only. It will require modifications to work: +# - It may require correct/in-range values for request initialization. +# - It may require specifying regional endpoints when creating the service +# client as shown in https://cloud.google.com/ruby/docs/reference. +# +# This is an auto-generated example demonstrating basic usage of +# Google::Cloud::SecretManager::V1beta2::SecretManagerService::Client#delete_secret. +# +def delete_secret + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::SecretManager::V1beta2::SecretManagerService::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::SecretManager::V1beta2::DeleteSecretRequest.new + + # Call the delete_secret method. + result = client.delete_secret request + + # The returned object is of type Google::Protobuf::Empty. + p result +end +# [END secretmanager_v1beta2_generated_SecretManagerService_DeleteSecret_sync] diff --git a/owl-bot-staging/google-cloud-secret_manager-v1beta2/snippets/secret_manager_service/destroy_secret_version.rb b/owl-bot-staging/google-cloud-secret_manager-v1beta2/snippets/secret_manager_service/destroy_secret_version.rb new file mode 100644 index 000000000000..d806c328f332 --- /dev/null +++ b/owl-bot-staging/google-cloud-secret_manager-v1beta2/snippets/secret_manager_service/destroy_secret_version.rb @@ -0,0 +1,47 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +# [START secretmanager_v1beta2_generated_SecretManagerService_DestroySecretVersion_sync] +require "google/cloud/secret_manager/v1beta2" + +## +# Snippet for the destroy_secret_version call in the SecretManagerService service +# +# This snippet has been automatically generated and should be regarded as a code +# template only. It will require modifications to work: +# - It may require correct/in-range values for request initialization. +# - It may require specifying regional endpoints when creating the service +# client as shown in https://cloud.google.com/ruby/docs/reference. +# +# This is an auto-generated example demonstrating basic usage of +# Google::Cloud::SecretManager::V1beta2::SecretManagerService::Client#destroy_secret_version. +# +def destroy_secret_version + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::SecretManager::V1beta2::SecretManagerService::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::SecretManager::V1beta2::DestroySecretVersionRequest.new + + # Call the destroy_secret_version method. + result = client.destroy_secret_version request + + # The returned object is of type Google::Cloud::SecretManager::V1beta2::SecretVersion. + p result +end +# [END secretmanager_v1beta2_generated_SecretManagerService_DestroySecretVersion_sync] diff --git a/owl-bot-staging/google-cloud-secret_manager-v1beta2/snippets/secret_manager_service/disable_secret_version.rb b/owl-bot-staging/google-cloud-secret_manager-v1beta2/snippets/secret_manager_service/disable_secret_version.rb new file mode 100644 index 000000000000..b5c83f8366d2 --- /dev/null +++ b/owl-bot-staging/google-cloud-secret_manager-v1beta2/snippets/secret_manager_service/disable_secret_version.rb @@ -0,0 +1,47 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +# [START secretmanager_v1beta2_generated_SecretManagerService_DisableSecretVersion_sync] +require "google/cloud/secret_manager/v1beta2" + +## +# Snippet for the disable_secret_version call in the SecretManagerService service +# +# This snippet has been automatically generated and should be regarded as a code +# template only. It will require modifications to work: +# - It may require correct/in-range values for request initialization. +# - It may require specifying regional endpoints when creating the service +# client as shown in https://cloud.google.com/ruby/docs/reference. +# +# This is an auto-generated example demonstrating basic usage of +# Google::Cloud::SecretManager::V1beta2::SecretManagerService::Client#disable_secret_version. +# +def disable_secret_version + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::SecretManager::V1beta2::SecretManagerService::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::SecretManager::V1beta2::DisableSecretVersionRequest.new + + # Call the disable_secret_version method. + result = client.disable_secret_version request + + # The returned object is of type Google::Cloud::SecretManager::V1beta2::SecretVersion. + p result +end +# [END secretmanager_v1beta2_generated_SecretManagerService_DisableSecretVersion_sync] diff --git a/owl-bot-staging/google-cloud-secret_manager-v1beta2/snippets/secret_manager_service/enable_secret_version.rb b/owl-bot-staging/google-cloud-secret_manager-v1beta2/snippets/secret_manager_service/enable_secret_version.rb new file mode 100644 index 000000000000..25e18d630f29 --- /dev/null +++ b/owl-bot-staging/google-cloud-secret_manager-v1beta2/snippets/secret_manager_service/enable_secret_version.rb @@ -0,0 +1,47 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +# [START secretmanager_v1beta2_generated_SecretManagerService_EnableSecretVersion_sync] +require "google/cloud/secret_manager/v1beta2" + +## +# Snippet for the enable_secret_version call in the SecretManagerService service +# +# This snippet has been automatically generated and should be regarded as a code +# template only. It will require modifications to work: +# - It may require correct/in-range values for request initialization. +# - It may require specifying regional endpoints when creating the service +# client as shown in https://cloud.google.com/ruby/docs/reference. +# +# This is an auto-generated example demonstrating basic usage of +# Google::Cloud::SecretManager::V1beta2::SecretManagerService::Client#enable_secret_version. +# +def enable_secret_version + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::SecretManager::V1beta2::SecretManagerService::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::SecretManager::V1beta2::EnableSecretVersionRequest.new + + # Call the enable_secret_version method. + result = client.enable_secret_version request + + # The returned object is of type Google::Cloud::SecretManager::V1beta2::SecretVersion. + p result +end +# [END secretmanager_v1beta2_generated_SecretManagerService_EnableSecretVersion_sync] diff --git a/owl-bot-staging/google-cloud-secret_manager-v1beta2/snippets/secret_manager_service/get_iam_policy.rb b/owl-bot-staging/google-cloud-secret_manager-v1beta2/snippets/secret_manager_service/get_iam_policy.rb new file mode 100644 index 000000000000..27c9a36d2f37 --- /dev/null +++ b/owl-bot-staging/google-cloud-secret_manager-v1beta2/snippets/secret_manager_service/get_iam_policy.rb @@ -0,0 +1,47 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +# [START secretmanager_v1beta2_generated_SecretManagerService_GetIamPolicy_sync] +require "google/cloud/secret_manager/v1beta2" + +## +# Snippet for the get_iam_policy call in the SecretManagerService service +# +# This snippet has been automatically generated and should be regarded as a code +# template only. It will require modifications to work: +# - It may require correct/in-range values for request initialization. +# - It may require specifying regional endpoints when creating the service +# client as shown in https://cloud.google.com/ruby/docs/reference. +# +# This is an auto-generated example demonstrating basic usage of +# Google::Cloud::SecretManager::V1beta2::SecretManagerService::Client#get_iam_policy. +# +def get_iam_policy + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::SecretManager::V1beta2::SecretManagerService::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Iam::V1::GetIamPolicyRequest.new + + # Call the get_iam_policy method. + result = client.get_iam_policy request + + # The returned object is of type Google::Iam::V1::Policy. + p result +end +# [END secretmanager_v1beta2_generated_SecretManagerService_GetIamPolicy_sync] diff --git a/owl-bot-staging/google-cloud-secret_manager-v1beta2/snippets/secret_manager_service/get_secret.rb b/owl-bot-staging/google-cloud-secret_manager-v1beta2/snippets/secret_manager_service/get_secret.rb new file mode 100644 index 000000000000..85d7b4256e33 --- /dev/null +++ b/owl-bot-staging/google-cloud-secret_manager-v1beta2/snippets/secret_manager_service/get_secret.rb @@ -0,0 +1,47 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +# [START secretmanager_v1beta2_generated_SecretManagerService_GetSecret_sync] +require "google/cloud/secret_manager/v1beta2" + +## +# Snippet for the get_secret call in the SecretManagerService service +# +# This snippet has been automatically generated and should be regarded as a code +# template only. It will require modifications to work: +# - It may require correct/in-range values for request initialization. +# - It may require specifying regional endpoints when creating the service +# client as shown in https://cloud.google.com/ruby/docs/reference. +# +# This is an auto-generated example demonstrating basic usage of +# Google::Cloud::SecretManager::V1beta2::SecretManagerService::Client#get_secret. +# +def get_secret + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::SecretManager::V1beta2::SecretManagerService::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::SecretManager::V1beta2::GetSecretRequest.new + + # Call the get_secret method. + result = client.get_secret request + + # The returned object is of type Google::Cloud::SecretManager::V1beta2::Secret. + p result +end +# [END secretmanager_v1beta2_generated_SecretManagerService_GetSecret_sync] diff --git a/owl-bot-staging/google-cloud-secret_manager-v1beta2/snippets/secret_manager_service/get_secret_version.rb b/owl-bot-staging/google-cloud-secret_manager-v1beta2/snippets/secret_manager_service/get_secret_version.rb new file mode 100644 index 000000000000..20072c84fd22 --- /dev/null +++ b/owl-bot-staging/google-cloud-secret_manager-v1beta2/snippets/secret_manager_service/get_secret_version.rb @@ -0,0 +1,47 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +# [START secretmanager_v1beta2_generated_SecretManagerService_GetSecretVersion_sync] +require "google/cloud/secret_manager/v1beta2" + +## +# Snippet for the get_secret_version call in the SecretManagerService service +# +# This snippet has been automatically generated and should be regarded as a code +# template only. It will require modifications to work: +# - It may require correct/in-range values for request initialization. +# - It may require specifying regional endpoints when creating the service +# client as shown in https://cloud.google.com/ruby/docs/reference. +# +# This is an auto-generated example demonstrating basic usage of +# Google::Cloud::SecretManager::V1beta2::SecretManagerService::Client#get_secret_version. +# +def get_secret_version + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::SecretManager::V1beta2::SecretManagerService::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::SecretManager::V1beta2::GetSecretVersionRequest.new + + # Call the get_secret_version method. + result = client.get_secret_version request + + # The returned object is of type Google::Cloud::SecretManager::V1beta2::SecretVersion. + p result +end +# [END secretmanager_v1beta2_generated_SecretManagerService_GetSecretVersion_sync] diff --git a/owl-bot-staging/google-cloud-secret_manager-v1beta2/snippets/secret_manager_service/list_secret_versions.rb b/owl-bot-staging/google-cloud-secret_manager-v1beta2/snippets/secret_manager_service/list_secret_versions.rb new file mode 100644 index 000000000000..7742f1a55a7d --- /dev/null +++ b/owl-bot-staging/google-cloud-secret_manager-v1beta2/snippets/secret_manager_service/list_secret_versions.rb @@ -0,0 +1,51 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +# [START secretmanager_v1beta2_generated_SecretManagerService_ListSecretVersions_sync] +require "google/cloud/secret_manager/v1beta2" + +## +# Snippet for the list_secret_versions call in the SecretManagerService service +# +# This snippet has been automatically generated and should be regarded as a code +# template only. It will require modifications to work: +# - It may require correct/in-range values for request initialization. +# - It may require specifying regional endpoints when creating the service +# client as shown in https://cloud.google.com/ruby/docs/reference. +# +# This is an auto-generated example demonstrating basic usage of +# Google::Cloud::SecretManager::V1beta2::SecretManagerService::Client#list_secret_versions. +# +def list_secret_versions + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::SecretManager::V1beta2::SecretManagerService::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::SecretManager::V1beta2::ListSecretVersionsRequest.new + + # Call the list_secret_versions method. + result = client.list_secret_versions request + + # The returned object is of type Gapic::PagedEnumerable. You can iterate + # over elements, and API calls will be issued to fetch pages as needed. + result.each do |item| + # Each element is of type ::Google::Cloud::SecretManager::V1beta2::SecretVersion. + p item + end +end +# [END secretmanager_v1beta2_generated_SecretManagerService_ListSecretVersions_sync] diff --git a/owl-bot-staging/google-cloud-secret_manager-v1beta2/snippets/secret_manager_service/list_secrets.rb b/owl-bot-staging/google-cloud-secret_manager-v1beta2/snippets/secret_manager_service/list_secrets.rb new file mode 100644 index 000000000000..fd2e425d30c3 --- /dev/null +++ b/owl-bot-staging/google-cloud-secret_manager-v1beta2/snippets/secret_manager_service/list_secrets.rb @@ -0,0 +1,51 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +# [START secretmanager_v1beta2_generated_SecretManagerService_ListSecrets_sync] +require "google/cloud/secret_manager/v1beta2" + +## +# Snippet for the list_secrets call in the SecretManagerService service +# +# This snippet has been automatically generated and should be regarded as a code +# template only. It will require modifications to work: +# - It may require correct/in-range values for request initialization. +# - It may require specifying regional endpoints when creating the service +# client as shown in https://cloud.google.com/ruby/docs/reference. +# +# This is an auto-generated example demonstrating basic usage of +# Google::Cloud::SecretManager::V1beta2::SecretManagerService::Client#list_secrets. +# +def list_secrets + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::SecretManager::V1beta2::SecretManagerService::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::SecretManager::V1beta2::ListSecretsRequest.new + + # Call the list_secrets method. + result = client.list_secrets request + + # The returned object is of type Gapic::PagedEnumerable. You can iterate + # over elements, and API calls will be issued to fetch pages as needed. + result.each do |item| + # Each element is of type ::Google::Cloud::SecretManager::V1beta2::Secret. + p item + end +end +# [END secretmanager_v1beta2_generated_SecretManagerService_ListSecrets_sync] diff --git a/owl-bot-staging/google-cloud-secret_manager-v1beta2/snippets/secret_manager_service/set_iam_policy.rb b/owl-bot-staging/google-cloud-secret_manager-v1beta2/snippets/secret_manager_service/set_iam_policy.rb new file mode 100644 index 000000000000..30030038e28f --- /dev/null +++ b/owl-bot-staging/google-cloud-secret_manager-v1beta2/snippets/secret_manager_service/set_iam_policy.rb @@ -0,0 +1,47 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +# [START secretmanager_v1beta2_generated_SecretManagerService_SetIamPolicy_sync] +require "google/cloud/secret_manager/v1beta2" + +## +# Snippet for the set_iam_policy call in the SecretManagerService service +# +# This snippet has been automatically generated and should be regarded as a code +# template only. It will require modifications to work: +# - It may require correct/in-range values for request initialization. +# - It may require specifying regional endpoints when creating the service +# client as shown in https://cloud.google.com/ruby/docs/reference. +# +# This is an auto-generated example demonstrating basic usage of +# Google::Cloud::SecretManager::V1beta2::SecretManagerService::Client#set_iam_policy. +# +def set_iam_policy + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::SecretManager::V1beta2::SecretManagerService::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Iam::V1::SetIamPolicyRequest.new + + # Call the set_iam_policy method. + result = client.set_iam_policy request + + # The returned object is of type Google::Iam::V1::Policy. + p result +end +# [END secretmanager_v1beta2_generated_SecretManagerService_SetIamPolicy_sync] diff --git a/owl-bot-staging/google-cloud-secret_manager-v1beta2/snippets/secret_manager_service/test_iam_permissions.rb b/owl-bot-staging/google-cloud-secret_manager-v1beta2/snippets/secret_manager_service/test_iam_permissions.rb new file mode 100644 index 000000000000..52ad7f6d8e08 --- /dev/null +++ b/owl-bot-staging/google-cloud-secret_manager-v1beta2/snippets/secret_manager_service/test_iam_permissions.rb @@ -0,0 +1,47 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +# [START secretmanager_v1beta2_generated_SecretManagerService_TestIamPermissions_sync] +require "google/cloud/secret_manager/v1beta2" + +## +# Snippet for the test_iam_permissions call in the SecretManagerService service +# +# This snippet has been automatically generated and should be regarded as a code +# template only. It will require modifications to work: +# - It may require correct/in-range values for request initialization. +# - It may require specifying regional endpoints when creating the service +# client as shown in https://cloud.google.com/ruby/docs/reference. +# +# This is an auto-generated example demonstrating basic usage of +# Google::Cloud::SecretManager::V1beta2::SecretManagerService::Client#test_iam_permissions. +# +def test_iam_permissions + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::SecretManager::V1beta2::SecretManagerService::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Iam::V1::TestIamPermissionsRequest.new + + # Call the test_iam_permissions method. + result = client.test_iam_permissions request + + # The returned object is of type Google::Iam::V1::TestIamPermissionsResponse. + p result +end +# [END secretmanager_v1beta2_generated_SecretManagerService_TestIamPermissions_sync] diff --git a/owl-bot-staging/google-cloud-secret_manager-v1beta2/snippets/secret_manager_service/update_secret.rb b/owl-bot-staging/google-cloud-secret_manager-v1beta2/snippets/secret_manager_service/update_secret.rb new file mode 100644 index 000000000000..74eec379aa18 --- /dev/null +++ b/owl-bot-staging/google-cloud-secret_manager-v1beta2/snippets/secret_manager_service/update_secret.rb @@ -0,0 +1,47 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +# [START secretmanager_v1beta2_generated_SecretManagerService_UpdateSecret_sync] +require "google/cloud/secret_manager/v1beta2" + +## +# Snippet for the update_secret call in the SecretManagerService service +# +# This snippet has been automatically generated and should be regarded as a code +# template only. It will require modifications to work: +# - It may require correct/in-range values for request initialization. +# - It may require specifying regional endpoints when creating the service +# client as shown in https://cloud.google.com/ruby/docs/reference. +# +# This is an auto-generated example demonstrating basic usage of +# Google::Cloud::SecretManager::V1beta2::SecretManagerService::Client#update_secret. +# +def update_secret + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::SecretManager::V1beta2::SecretManagerService::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::SecretManager::V1beta2::UpdateSecretRequest.new + + # Call the update_secret method. + result = client.update_secret request + + # The returned object is of type Google::Cloud::SecretManager::V1beta2::Secret. + p result +end +# [END secretmanager_v1beta2_generated_SecretManagerService_UpdateSecret_sync] diff --git a/owl-bot-staging/google-cloud-secret_manager-v1beta2/snippets/snippet_metadata_google.cloud.secretmanager.v1beta2.json b/owl-bot-staging/google-cloud-secret_manager-v1beta2/snippets/snippet_metadata_google.cloud.secretmanager.v1beta2.json new file mode 100644 index 000000000000..8628979bdc17 --- /dev/null +++ b/owl-bot-staging/google-cloud-secret_manager-v1beta2/snippets/snippet_metadata_google.cloud.secretmanager.v1beta2.json @@ -0,0 +1,615 @@ +{ + "client_library": { + "name": "google-cloud-secret_manager-v1beta2", + "version": "", + "language": "RUBY", + "apis": [ + { + "id": "google.cloud.secretmanager.v1beta2", + "version": "v1beta2" + } + ] + }, + "snippets": [ + { + "region_tag": "secretmanager_v1beta2_generated_SecretManagerService_ListSecrets_sync", + "title": "Snippet for the list_secrets call in the SecretManagerService service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::SecretManager::V1beta2::SecretManagerService::Client#list_secrets.", + "file": "secret_manager_service/list_secrets.rb", + "language": "RUBY", + "client_method": { + "short_name": "list_secrets", + "full_name": "::Google::Cloud::SecretManager::V1beta2::SecretManagerService::Client#list_secrets", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::SecretManager::V1beta2::ListSecretsRequest", + "name": "request" + } + ], + "result_type": "::Google::Cloud::SecretManager::V1beta2::ListSecretsResponse", + "client": { + "short_name": "SecretManagerService::Client", + "full_name": "::Google::Cloud::SecretManager::V1beta2::SecretManagerService::Client" + }, + "method": { + "short_name": "ListSecrets", + "full_name": "google.cloud.secretmanager.v1beta2.SecretManagerService.ListSecrets", + "service": { + "short_name": "SecretManagerService", + "full_name": "google.cloud.secretmanager.v1beta2.SecretManagerService" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 50, + "type": "FULL" + } + ] + }, + { + "region_tag": "secretmanager_v1beta2_generated_SecretManagerService_CreateSecret_sync", + "title": "Snippet for the create_secret call in the SecretManagerService service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::SecretManager::V1beta2::SecretManagerService::Client#create_secret.", + "file": "secret_manager_service/create_secret.rb", + "language": "RUBY", + "client_method": { + "short_name": "create_secret", + "full_name": "::Google::Cloud::SecretManager::V1beta2::SecretManagerService::Client#create_secret", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::SecretManager::V1beta2::CreateSecretRequest", + "name": "request" + } + ], + "result_type": "::Google::Cloud::SecretManager::V1beta2::Secret", + "client": { + "short_name": "SecretManagerService::Client", + "full_name": "::Google::Cloud::SecretManager::V1beta2::SecretManagerService::Client" + }, + "method": { + "short_name": "CreateSecret", + "full_name": "google.cloud.secretmanager.v1beta2.SecretManagerService.CreateSecret", + "service": { + "short_name": "SecretManagerService", + "full_name": "google.cloud.secretmanager.v1beta2.SecretManagerService" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 46, + "type": "FULL" + } + ] + }, + { + "region_tag": "secretmanager_v1beta2_generated_SecretManagerService_AddSecretVersion_sync", + "title": "Snippet for the add_secret_version call in the SecretManagerService service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::SecretManager::V1beta2::SecretManagerService::Client#add_secret_version.", + "file": "secret_manager_service/add_secret_version.rb", + "language": "RUBY", + "client_method": { + "short_name": "add_secret_version", + "full_name": "::Google::Cloud::SecretManager::V1beta2::SecretManagerService::Client#add_secret_version", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::SecretManager::V1beta2::AddSecretVersionRequest", + "name": "request" + } + ], + "result_type": "::Google::Cloud::SecretManager::V1beta2::SecretVersion", + "client": { + "short_name": "SecretManagerService::Client", + "full_name": "::Google::Cloud::SecretManager::V1beta2::SecretManagerService::Client" + }, + "method": { + "short_name": "AddSecretVersion", + "full_name": "google.cloud.secretmanager.v1beta2.SecretManagerService.AddSecretVersion", + "service": { + "short_name": "SecretManagerService", + "full_name": "google.cloud.secretmanager.v1beta2.SecretManagerService" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 46, + "type": "FULL" + } + ] + }, + { + "region_tag": "secretmanager_v1beta2_generated_SecretManagerService_GetSecret_sync", + "title": "Snippet for the get_secret call in the SecretManagerService service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::SecretManager::V1beta2::SecretManagerService::Client#get_secret.", + "file": "secret_manager_service/get_secret.rb", + "language": "RUBY", + "client_method": { + "short_name": "get_secret", + "full_name": "::Google::Cloud::SecretManager::V1beta2::SecretManagerService::Client#get_secret", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::SecretManager::V1beta2::GetSecretRequest", + "name": "request" + } + ], + "result_type": "::Google::Cloud::SecretManager::V1beta2::Secret", + "client": { + "short_name": "SecretManagerService::Client", + "full_name": "::Google::Cloud::SecretManager::V1beta2::SecretManagerService::Client" + }, + "method": { + "short_name": "GetSecret", + "full_name": "google.cloud.secretmanager.v1beta2.SecretManagerService.GetSecret", + "service": { + "short_name": "SecretManagerService", + "full_name": "google.cloud.secretmanager.v1beta2.SecretManagerService" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 46, + "type": "FULL" + } + ] + }, + { + "region_tag": "secretmanager_v1beta2_generated_SecretManagerService_UpdateSecret_sync", + "title": "Snippet for the update_secret call in the SecretManagerService service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::SecretManager::V1beta2::SecretManagerService::Client#update_secret.", + "file": "secret_manager_service/update_secret.rb", + "language": "RUBY", + "client_method": { + "short_name": "update_secret", + "full_name": "::Google::Cloud::SecretManager::V1beta2::SecretManagerService::Client#update_secret", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::SecretManager::V1beta2::UpdateSecretRequest", + "name": "request" + } + ], + "result_type": "::Google::Cloud::SecretManager::V1beta2::Secret", + "client": { + "short_name": "SecretManagerService::Client", + "full_name": "::Google::Cloud::SecretManager::V1beta2::SecretManagerService::Client" + }, + "method": { + "short_name": "UpdateSecret", + "full_name": "google.cloud.secretmanager.v1beta2.SecretManagerService.UpdateSecret", + "service": { + "short_name": "SecretManagerService", + "full_name": "google.cloud.secretmanager.v1beta2.SecretManagerService" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 46, + "type": "FULL" + } + ] + }, + { + "region_tag": "secretmanager_v1beta2_generated_SecretManagerService_DeleteSecret_sync", + "title": "Snippet for the delete_secret call in the SecretManagerService service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::SecretManager::V1beta2::SecretManagerService::Client#delete_secret.", + "file": "secret_manager_service/delete_secret.rb", + "language": "RUBY", + "client_method": { + "short_name": "delete_secret", + "full_name": "::Google::Cloud::SecretManager::V1beta2::SecretManagerService::Client#delete_secret", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::SecretManager::V1beta2::DeleteSecretRequest", + "name": "request" + } + ], + "result_type": "::Google::Protobuf::Empty", + "client": { + "short_name": "SecretManagerService::Client", + "full_name": "::Google::Cloud::SecretManager::V1beta2::SecretManagerService::Client" + }, + "method": { + "short_name": "DeleteSecret", + "full_name": "google.cloud.secretmanager.v1beta2.SecretManagerService.DeleteSecret", + "service": { + "short_name": "SecretManagerService", + "full_name": "google.cloud.secretmanager.v1beta2.SecretManagerService" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 46, + "type": "FULL" + } + ] + }, + { + "region_tag": "secretmanager_v1beta2_generated_SecretManagerService_ListSecretVersions_sync", + "title": "Snippet for the list_secret_versions call in the SecretManagerService service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::SecretManager::V1beta2::SecretManagerService::Client#list_secret_versions.", + "file": "secret_manager_service/list_secret_versions.rb", + "language": "RUBY", + "client_method": { + "short_name": "list_secret_versions", + "full_name": "::Google::Cloud::SecretManager::V1beta2::SecretManagerService::Client#list_secret_versions", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::SecretManager::V1beta2::ListSecretVersionsRequest", + "name": "request" + } + ], + "result_type": "::Google::Cloud::SecretManager::V1beta2::ListSecretVersionsResponse", + "client": { + "short_name": "SecretManagerService::Client", + "full_name": "::Google::Cloud::SecretManager::V1beta2::SecretManagerService::Client" + }, + "method": { + "short_name": "ListSecretVersions", + "full_name": "google.cloud.secretmanager.v1beta2.SecretManagerService.ListSecretVersions", + "service": { + "short_name": "SecretManagerService", + "full_name": "google.cloud.secretmanager.v1beta2.SecretManagerService" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 50, + "type": "FULL" + } + ] + }, + { + "region_tag": "secretmanager_v1beta2_generated_SecretManagerService_GetSecretVersion_sync", + "title": "Snippet for the get_secret_version call in the SecretManagerService service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::SecretManager::V1beta2::SecretManagerService::Client#get_secret_version.", + "file": "secret_manager_service/get_secret_version.rb", + "language": "RUBY", + "client_method": { + "short_name": "get_secret_version", + "full_name": "::Google::Cloud::SecretManager::V1beta2::SecretManagerService::Client#get_secret_version", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::SecretManager::V1beta2::GetSecretVersionRequest", + "name": "request" + } + ], + "result_type": "::Google::Cloud::SecretManager::V1beta2::SecretVersion", + "client": { + "short_name": "SecretManagerService::Client", + "full_name": "::Google::Cloud::SecretManager::V1beta2::SecretManagerService::Client" + }, + "method": { + "short_name": "GetSecretVersion", + "full_name": "google.cloud.secretmanager.v1beta2.SecretManagerService.GetSecretVersion", + "service": { + "short_name": "SecretManagerService", + "full_name": "google.cloud.secretmanager.v1beta2.SecretManagerService" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 46, + "type": "FULL" + } + ] + }, + { + "region_tag": "secretmanager_v1beta2_generated_SecretManagerService_AccessSecretVersion_sync", + "title": "Snippet for the access_secret_version call in the SecretManagerService service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::SecretManager::V1beta2::SecretManagerService::Client#access_secret_version.", + "file": "secret_manager_service/access_secret_version.rb", + "language": "RUBY", + "client_method": { + "short_name": "access_secret_version", + "full_name": "::Google::Cloud::SecretManager::V1beta2::SecretManagerService::Client#access_secret_version", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::SecretManager::V1beta2::AccessSecretVersionRequest", + "name": "request" + } + ], + "result_type": "::Google::Cloud::SecretManager::V1beta2::AccessSecretVersionResponse", + "client": { + "short_name": "SecretManagerService::Client", + "full_name": "::Google::Cloud::SecretManager::V1beta2::SecretManagerService::Client" + }, + "method": { + "short_name": "AccessSecretVersion", + "full_name": "google.cloud.secretmanager.v1beta2.SecretManagerService.AccessSecretVersion", + "service": { + "short_name": "SecretManagerService", + "full_name": "google.cloud.secretmanager.v1beta2.SecretManagerService" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 46, + "type": "FULL" + } + ] + }, + { + "region_tag": "secretmanager_v1beta2_generated_SecretManagerService_DisableSecretVersion_sync", + "title": "Snippet for the disable_secret_version call in the SecretManagerService service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::SecretManager::V1beta2::SecretManagerService::Client#disable_secret_version.", + "file": "secret_manager_service/disable_secret_version.rb", + "language": "RUBY", + "client_method": { + "short_name": "disable_secret_version", + "full_name": "::Google::Cloud::SecretManager::V1beta2::SecretManagerService::Client#disable_secret_version", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::SecretManager::V1beta2::DisableSecretVersionRequest", + "name": "request" + } + ], + "result_type": "::Google::Cloud::SecretManager::V1beta2::SecretVersion", + "client": { + "short_name": "SecretManagerService::Client", + "full_name": "::Google::Cloud::SecretManager::V1beta2::SecretManagerService::Client" + }, + "method": { + "short_name": "DisableSecretVersion", + "full_name": "google.cloud.secretmanager.v1beta2.SecretManagerService.DisableSecretVersion", + "service": { + "short_name": "SecretManagerService", + "full_name": "google.cloud.secretmanager.v1beta2.SecretManagerService" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 46, + "type": "FULL" + } + ] + }, + { + "region_tag": "secretmanager_v1beta2_generated_SecretManagerService_EnableSecretVersion_sync", + "title": "Snippet for the enable_secret_version call in the SecretManagerService service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::SecretManager::V1beta2::SecretManagerService::Client#enable_secret_version.", + "file": "secret_manager_service/enable_secret_version.rb", + "language": "RUBY", + "client_method": { + "short_name": "enable_secret_version", + "full_name": "::Google::Cloud::SecretManager::V1beta2::SecretManagerService::Client#enable_secret_version", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::SecretManager::V1beta2::EnableSecretVersionRequest", + "name": "request" + } + ], + "result_type": "::Google::Cloud::SecretManager::V1beta2::SecretVersion", + "client": { + "short_name": "SecretManagerService::Client", + "full_name": "::Google::Cloud::SecretManager::V1beta2::SecretManagerService::Client" + }, + "method": { + "short_name": "EnableSecretVersion", + "full_name": "google.cloud.secretmanager.v1beta2.SecretManagerService.EnableSecretVersion", + "service": { + "short_name": "SecretManagerService", + "full_name": "google.cloud.secretmanager.v1beta2.SecretManagerService" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 46, + "type": "FULL" + } + ] + }, + { + "region_tag": "secretmanager_v1beta2_generated_SecretManagerService_DestroySecretVersion_sync", + "title": "Snippet for the destroy_secret_version call in the SecretManagerService service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::SecretManager::V1beta2::SecretManagerService::Client#destroy_secret_version.", + "file": "secret_manager_service/destroy_secret_version.rb", + "language": "RUBY", + "client_method": { + "short_name": "destroy_secret_version", + "full_name": "::Google::Cloud::SecretManager::V1beta2::SecretManagerService::Client#destroy_secret_version", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::SecretManager::V1beta2::DestroySecretVersionRequest", + "name": "request" + } + ], + "result_type": "::Google::Cloud::SecretManager::V1beta2::SecretVersion", + "client": { + "short_name": "SecretManagerService::Client", + "full_name": "::Google::Cloud::SecretManager::V1beta2::SecretManagerService::Client" + }, + "method": { + "short_name": "DestroySecretVersion", + "full_name": "google.cloud.secretmanager.v1beta2.SecretManagerService.DestroySecretVersion", + "service": { + "short_name": "SecretManagerService", + "full_name": "google.cloud.secretmanager.v1beta2.SecretManagerService" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 46, + "type": "FULL" + } + ] + }, + { + "region_tag": "secretmanager_v1beta2_generated_SecretManagerService_SetIamPolicy_sync", + "title": "Snippet for the set_iam_policy call in the SecretManagerService service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::SecretManager::V1beta2::SecretManagerService::Client#set_iam_policy.", + "file": "secret_manager_service/set_iam_policy.rb", + "language": "RUBY", + "client_method": { + "short_name": "set_iam_policy", + "full_name": "::Google::Cloud::SecretManager::V1beta2::SecretManagerService::Client#set_iam_policy", + "async": false, + "parameters": [ + { + "type": "::Google::Iam::V1::SetIamPolicyRequest", + "name": "request" + } + ], + "result_type": "::Google::Iam::V1::Policy", + "client": { + "short_name": "SecretManagerService::Client", + "full_name": "::Google::Cloud::SecretManager::V1beta2::SecretManagerService::Client" + }, + "method": { + "short_name": "SetIamPolicy", + "full_name": "google.cloud.secretmanager.v1beta2.SecretManagerService.SetIamPolicy", + "service": { + "short_name": "SecretManagerService", + "full_name": "google.cloud.secretmanager.v1beta2.SecretManagerService" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 46, + "type": "FULL" + } + ] + }, + { + "region_tag": "secretmanager_v1beta2_generated_SecretManagerService_GetIamPolicy_sync", + "title": "Snippet for the get_iam_policy call in the SecretManagerService service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::SecretManager::V1beta2::SecretManagerService::Client#get_iam_policy.", + "file": "secret_manager_service/get_iam_policy.rb", + "language": "RUBY", + "client_method": { + "short_name": "get_iam_policy", + "full_name": "::Google::Cloud::SecretManager::V1beta2::SecretManagerService::Client#get_iam_policy", + "async": false, + "parameters": [ + { + "type": "::Google::Iam::V1::GetIamPolicyRequest", + "name": "request" + } + ], + "result_type": "::Google::Iam::V1::Policy", + "client": { + "short_name": "SecretManagerService::Client", + "full_name": "::Google::Cloud::SecretManager::V1beta2::SecretManagerService::Client" + }, + "method": { + "short_name": "GetIamPolicy", + "full_name": "google.cloud.secretmanager.v1beta2.SecretManagerService.GetIamPolicy", + "service": { + "short_name": "SecretManagerService", + "full_name": "google.cloud.secretmanager.v1beta2.SecretManagerService" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 46, + "type": "FULL" + } + ] + }, + { + "region_tag": "secretmanager_v1beta2_generated_SecretManagerService_TestIamPermissions_sync", + "title": "Snippet for the test_iam_permissions call in the SecretManagerService service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::SecretManager::V1beta2::SecretManagerService::Client#test_iam_permissions.", + "file": "secret_manager_service/test_iam_permissions.rb", + "language": "RUBY", + "client_method": { + "short_name": "test_iam_permissions", + "full_name": "::Google::Cloud::SecretManager::V1beta2::SecretManagerService::Client#test_iam_permissions", + "async": false, + "parameters": [ + { + "type": "::Google::Iam::V1::TestIamPermissionsRequest", + "name": "request" + } + ], + "result_type": "::Google::Iam::V1::TestIamPermissionsResponse", + "client": { + "short_name": "SecretManagerService::Client", + "full_name": "::Google::Cloud::SecretManager::V1beta2::SecretManagerService::Client" + }, + "method": { + "short_name": "TestIamPermissions", + "full_name": "google.cloud.secretmanager.v1beta2.SecretManagerService.TestIamPermissions", + "service": { + "short_name": "SecretManagerService", + "full_name": "google.cloud.secretmanager.v1beta2.SecretManagerService" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 46, + "type": "FULL" + } + ] + } + ] +} \ No newline at end of file diff --git a/owl-bot-staging/google-cloud-secret_manager-v1beta2/test/google/cloud/secret_manager/v1beta2/secret_manager_service_paths_test.rb b/owl-bot-staging/google-cloud-secret_manager-v1beta2/test/google/cloud/secret_manager/v1beta2/secret_manager_service_paths_test.rb new file mode 100644 index 000000000000..f28501a34bc5 --- /dev/null +++ b/owl-bot-staging/google-cloud-secret_manager-v1beta2/test/google/cloud/secret_manager/v1beta2/secret_manager_service_paths_test.rb @@ -0,0 +1,109 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +require "helper" + +require "gapic/grpc/service_stub" + +require "google/cloud/secret_manager/v1beta2/secret_manager_service" + +class ::Google::Cloud::SecretManager::V1beta2::SecretManagerService::ClientPathsTest < Minitest::Test + class DummyStub + def endpoint + "endpoint.example.com" + end + + def universe_domain + "example.com" + end + + def stub_logger + nil + end + + def logger + nil + end + end + + def test_location_path + grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + ::Gapic::ServiceStub.stub :new, DummyStub.new do + client = ::Google::Cloud::SecretManager::V1beta2::SecretManagerService::Client.new do |config| + config.credentials = grpc_channel + end + + path = client.location_path project: "value0", location: "value1" + assert_equal "projects/value0/locations/value1", path + end + end + + def test_project_path + grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + ::Gapic::ServiceStub.stub :new, DummyStub.new do + client = ::Google::Cloud::SecretManager::V1beta2::SecretManagerService::Client.new do |config| + config.credentials = grpc_channel + end + + path = client.project_path project: "value0" + assert_equal "projects/value0", path + end + end + + def test_secret_path + grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + ::Gapic::ServiceStub.stub :new, DummyStub.new do + client = ::Google::Cloud::SecretManager::V1beta2::SecretManagerService::Client.new do |config| + config.credentials = grpc_channel + end + + path = client.secret_path project: "value0", secret: "value1" + assert_equal "projects/value0/secrets/value1", path + + path = client.secret_path project: "value0", location: "value1", secret: "value2" + assert_equal "projects/value0/locations/value1/secrets/value2", path + end + end + + def test_secret_version_path + grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + ::Gapic::ServiceStub.stub :new, DummyStub.new do + client = ::Google::Cloud::SecretManager::V1beta2::SecretManagerService::Client.new do |config| + config.credentials = grpc_channel + end + + path = client.secret_version_path project: "value0", secret: "value1", secret_version: "value2" + assert_equal "projects/value0/secrets/value1/versions/value2", path + + path = client.secret_version_path project: "value0", location: "value1", secret: "value2", secret_version: "value3" + assert_equal "projects/value0/locations/value1/secrets/value2/versions/value3", path + end + end + + def test_topic_path + grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + ::Gapic::ServiceStub.stub :new, DummyStub.new do + client = ::Google::Cloud::SecretManager::V1beta2::SecretManagerService::Client.new do |config| + config.credentials = grpc_channel + end + + path = client.topic_path project: "value0", topic: "value1" + assert_equal "projects/value0/topics/value1", path + end + end +end diff --git a/owl-bot-staging/google-cloud-secret_manager-v1beta2/test/google/cloud/secret_manager/v1beta2/secret_manager_service_rest_test.rb b/owl-bot-staging/google-cloud-secret_manager-v1beta2/test/google/cloud/secret_manager/v1beta2/secret_manager_service_rest_test.rb new file mode 100644 index 000000000000..610fe8a951da --- /dev/null +++ b/owl-bot-staging/google-cloud-secret_manager-v1beta2/test/google/cloud/secret_manager/v1beta2/secret_manager_service_rest_test.rb @@ -0,0 +1,927 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +require "helper" +require "gapic/rest" +require "google/cloud/secretmanager/v1beta2/service_pb" +require "google/cloud/secret_manager/v1beta2/secret_manager_service/rest" + + +class ::Google::Cloud::SecretManager::V1beta2::SecretManagerService::Rest::ClientTest < Minitest::Test + class ClientStub + attr_accessor :call_count, :requests + + def initialize response, &block + @response = response + @block = block + @call_count = 0 + @requests = [] + end + + def make_get_request uri:, params: {}, options: {}, method_name: nil + make_http_request :get, uri: uri, body: nil, params: params, options: options, method_name: method_name + end + + def make_delete_request uri:, params: {}, options: {}, method_name: nil + make_http_request :delete, uri: uri, body: nil, params: params, options: options, method_name: method_name + end + + def make_post_request uri:, body: nil, params: {}, options: {}, method_name: nil + make_http_request :post, uri: uri, body: body, params: params, options: options, method_name: method_name + end + + def make_patch_request uri:, body:, params: {}, options: {}, method_name: nil + make_http_request :patch, uri: uri, body: body, params: params, options: options, method_name: method_name + end + + def make_put_request uri:, body:, params: {}, options: {}, method_name: nil + make_http_request :put, uri: uri, body: body, params: params, options: options, method_name: method_name + end + + def make_http_request *args, **kwargs + @call_count += 1 + + @requests << @block&.call(*args, **kwargs) + + @response + end + + def endpoint + "endpoint.example.com" + end + + def universe_domain + "example.com" + end + + def stub_logger + nil + end + + def logger + nil + end + end + + def test_list_secrets + # Create test objects. + client_result = ::Google::Cloud::SecretManager::V1beta2::ListSecretsResponse.new + http_response = OpenStruct.new body: client_result.to_json + + call_options = {} + + # Create request parameters for a unary method. + parent = "hello world" + page_size = 42 + page_token = "hello world" + filter = "hello world" + + list_secrets_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| + assert options.metadata.key? :"x-goog-api-client" + assert options.metadata[:"x-goog-api-client"].include? "rest" + refute options.metadata[:"x-goog-api-client"].include? "grpc" + end + + ::Google::Cloud::SecretManager::V1beta2::SecretManagerService::Rest::ServiceStub.stub :transcode_list_secrets_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, list_secrets_client_stub do + # Create client + client = ::Google::Cloud::SecretManager::V1beta2::SecretManagerService::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.list_secrets({ parent: parent, page_size: page_size, page_token: page_token, filter: filter }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.list_secrets parent: parent, page_size: page_size, page_token: page_token, filter: filter do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.list_secrets ::Google::Cloud::SecretManager::V1beta2::ListSecretsRequest.new(parent: parent, page_size: page_size, page_token: page_token, filter: filter) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + client.list_secrets({ parent: parent, page_size: page_size, page_token: page_token, filter: filter }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + client.list_secrets(::Google::Cloud::SecretManager::V1beta2::ListSecretsRequest.new(parent: parent, page_size: page_size, page_token: page_token, filter: filter), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, list_secrets_client_stub.call_count + end + end + end + + def test_create_secret + # Create test objects. + client_result = ::Google::Cloud::SecretManager::V1beta2::Secret.new + http_response = OpenStruct.new body: client_result.to_json + + call_options = {} + + # Create request parameters for a unary method. + parent = "hello world" + secret_id = "hello world" + secret = {} + + create_secret_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| + assert options.metadata.key? :"x-goog-api-client" + assert options.metadata[:"x-goog-api-client"].include? "rest" + refute options.metadata[:"x-goog-api-client"].include? "grpc" + end + + ::Google::Cloud::SecretManager::V1beta2::SecretManagerService::Rest::ServiceStub.stub :transcode_create_secret_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, create_secret_client_stub do + # Create client + client = ::Google::Cloud::SecretManager::V1beta2::SecretManagerService::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.create_secret({ parent: parent, secret_id: secret_id, secret: secret }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.create_secret parent: parent, secret_id: secret_id, secret: secret do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.create_secret ::Google::Cloud::SecretManager::V1beta2::CreateSecretRequest.new(parent: parent, secret_id: secret_id, secret: secret) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + client.create_secret({ parent: parent, secret_id: secret_id, secret: secret }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + client.create_secret(::Google::Cloud::SecretManager::V1beta2::CreateSecretRequest.new(parent: parent, secret_id: secret_id, secret: secret), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, create_secret_client_stub.call_count + end + end + end + + def test_add_secret_version + # Create test objects. + client_result = ::Google::Cloud::SecretManager::V1beta2::SecretVersion.new + http_response = OpenStruct.new body: client_result.to_json + + call_options = {} + + # Create request parameters for a unary method. + parent = "hello world" + payload = {} + + add_secret_version_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| + assert options.metadata.key? :"x-goog-api-client" + assert options.metadata[:"x-goog-api-client"].include? "rest" + refute options.metadata[:"x-goog-api-client"].include? "grpc" + end + + ::Google::Cloud::SecretManager::V1beta2::SecretManagerService::Rest::ServiceStub.stub :transcode_add_secret_version_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, add_secret_version_client_stub do + # Create client + client = ::Google::Cloud::SecretManager::V1beta2::SecretManagerService::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.add_secret_version({ parent: parent, payload: payload }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.add_secret_version parent: parent, payload: payload do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.add_secret_version ::Google::Cloud::SecretManager::V1beta2::AddSecretVersionRequest.new(parent: parent, payload: payload) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + client.add_secret_version({ parent: parent, payload: payload }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + client.add_secret_version(::Google::Cloud::SecretManager::V1beta2::AddSecretVersionRequest.new(parent: parent, payload: payload), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, add_secret_version_client_stub.call_count + end + end + end + + def test_get_secret + # Create test objects. + client_result = ::Google::Cloud::SecretManager::V1beta2::Secret.new + http_response = OpenStruct.new body: client_result.to_json + + call_options = {} + + # Create request parameters for a unary method. + name = "hello world" + + get_secret_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| + assert options.metadata.key? :"x-goog-api-client" + assert options.metadata[:"x-goog-api-client"].include? "rest" + refute options.metadata[:"x-goog-api-client"].include? "grpc" + end + + ::Google::Cloud::SecretManager::V1beta2::SecretManagerService::Rest::ServiceStub.stub :transcode_get_secret_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, get_secret_client_stub do + # Create client + client = ::Google::Cloud::SecretManager::V1beta2::SecretManagerService::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.get_secret({ name: name }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.get_secret name: name do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.get_secret ::Google::Cloud::SecretManager::V1beta2::GetSecretRequest.new(name: name) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + client.get_secret({ name: name }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + client.get_secret(::Google::Cloud::SecretManager::V1beta2::GetSecretRequest.new(name: name), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, get_secret_client_stub.call_count + end + end + end + + def test_update_secret + # Create test objects. + client_result = ::Google::Cloud::SecretManager::V1beta2::Secret.new + http_response = OpenStruct.new body: client_result.to_json + + call_options = {} + + # Create request parameters for a unary method. + secret = {} + update_mask = {} + + update_secret_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| + assert options.metadata.key? :"x-goog-api-client" + assert options.metadata[:"x-goog-api-client"].include? "rest" + refute options.metadata[:"x-goog-api-client"].include? "grpc" + end + + ::Google::Cloud::SecretManager::V1beta2::SecretManagerService::Rest::ServiceStub.stub :transcode_update_secret_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, update_secret_client_stub do + # Create client + client = ::Google::Cloud::SecretManager::V1beta2::SecretManagerService::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.update_secret({ secret: secret, update_mask: update_mask }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.update_secret secret: secret, update_mask: update_mask do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.update_secret ::Google::Cloud::SecretManager::V1beta2::UpdateSecretRequest.new(secret: secret, update_mask: update_mask) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + client.update_secret({ secret: secret, update_mask: update_mask }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + client.update_secret(::Google::Cloud::SecretManager::V1beta2::UpdateSecretRequest.new(secret: secret, update_mask: update_mask), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, update_secret_client_stub.call_count + end + end + end + + def test_delete_secret + # Create test objects. + client_result = ::Google::Protobuf::Empty.new + http_response = OpenStruct.new body: client_result.to_json + + call_options = {} + + # Create request parameters for a unary method. + name = "hello world" + etag = "hello world" + + delete_secret_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| + assert options.metadata.key? :"x-goog-api-client" + assert options.metadata[:"x-goog-api-client"].include? "rest" + refute options.metadata[:"x-goog-api-client"].include? "grpc" + end + + ::Google::Cloud::SecretManager::V1beta2::SecretManagerService::Rest::ServiceStub.stub :transcode_delete_secret_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, delete_secret_client_stub do + # Create client + client = ::Google::Cloud::SecretManager::V1beta2::SecretManagerService::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.delete_secret({ name: name, etag: etag }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.delete_secret name: name, etag: etag do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.delete_secret ::Google::Cloud::SecretManager::V1beta2::DeleteSecretRequest.new(name: name, etag: etag) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + client.delete_secret({ name: name, etag: etag }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + client.delete_secret(::Google::Cloud::SecretManager::V1beta2::DeleteSecretRequest.new(name: name, etag: etag), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, delete_secret_client_stub.call_count + end + end + end + + def test_list_secret_versions + # Create test objects. + client_result = ::Google::Cloud::SecretManager::V1beta2::ListSecretVersionsResponse.new + http_response = OpenStruct.new body: client_result.to_json + + call_options = {} + + # Create request parameters for a unary method. + parent = "hello world" + page_size = 42 + page_token = "hello world" + filter = "hello world" + + list_secret_versions_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| + assert options.metadata.key? :"x-goog-api-client" + assert options.metadata[:"x-goog-api-client"].include? "rest" + refute options.metadata[:"x-goog-api-client"].include? "grpc" + end + + ::Google::Cloud::SecretManager::V1beta2::SecretManagerService::Rest::ServiceStub.stub :transcode_list_secret_versions_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, list_secret_versions_client_stub do + # Create client + client = ::Google::Cloud::SecretManager::V1beta2::SecretManagerService::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.list_secret_versions({ parent: parent, page_size: page_size, page_token: page_token, filter: filter }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.list_secret_versions parent: parent, page_size: page_size, page_token: page_token, filter: filter do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.list_secret_versions ::Google::Cloud::SecretManager::V1beta2::ListSecretVersionsRequest.new(parent: parent, page_size: page_size, page_token: page_token, filter: filter) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + client.list_secret_versions({ parent: parent, page_size: page_size, page_token: page_token, filter: filter }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + client.list_secret_versions(::Google::Cloud::SecretManager::V1beta2::ListSecretVersionsRequest.new(parent: parent, page_size: page_size, page_token: page_token, filter: filter), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, list_secret_versions_client_stub.call_count + end + end + end + + def test_get_secret_version + # Create test objects. + client_result = ::Google::Cloud::SecretManager::V1beta2::SecretVersion.new + http_response = OpenStruct.new body: client_result.to_json + + call_options = {} + + # Create request parameters for a unary method. + name = "hello world" + + get_secret_version_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| + assert options.metadata.key? :"x-goog-api-client" + assert options.metadata[:"x-goog-api-client"].include? "rest" + refute options.metadata[:"x-goog-api-client"].include? "grpc" + end + + ::Google::Cloud::SecretManager::V1beta2::SecretManagerService::Rest::ServiceStub.stub :transcode_get_secret_version_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, get_secret_version_client_stub do + # Create client + client = ::Google::Cloud::SecretManager::V1beta2::SecretManagerService::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.get_secret_version({ name: name }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.get_secret_version name: name do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.get_secret_version ::Google::Cloud::SecretManager::V1beta2::GetSecretVersionRequest.new(name: name) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + client.get_secret_version({ name: name }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + client.get_secret_version(::Google::Cloud::SecretManager::V1beta2::GetSecretVersionRequest.new(name: name), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, get_secret_version_client_stub.call_count + end + end + end + + def test_access_secret_version + # Create test objects. + client_result = ::Google::Cloud::SecretManager::V1beta2::AccessSecretVersionResponse.new + http_response = OpenStruct.new body: client_result.to_json + + call_options = {} + + # Create request parameters for a unary method. + name = "hello world" + + access_secret_version_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| + assert options.metadata.key? :"x-goog-api-client" + assert options.metadata[:"x-goog-api-client"].include? "rest" + refute options.metadata[:"x-goog-api-client"].include? "grpc" + end + + ::Google::Cloud::SecretManager::V1beta2::SecretManagerService::Rest::ServiceStub.stub :transcode_access_secret_version_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, access_secret_version_client_stub do + # Create client + client = ::Google::Cloud::SecretManager::V1beta2::SecretManagerService::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.access_secret_version({ name: name }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.access_secret_version name: name do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.access_secret_version ::Google::Cloud::SecretManager::V1beta2::AccessSecretVersionRequest.new(name: name) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + client.access_secret_version({ name: name }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + client.access_secret_version(::Google::Cloud::SecretManager::V1beta2::AccessSecretVersionRequest.new(name: name), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, access_secret_version_client_stub.call_count + end + end + end + + def test_disable_secret_version + # Create test objects. + client_result = ::Google::Cloud::SecretManager::V1beta2::SecretVersion.new + http_response = OpenStruct.new body: client_result.to_json + + call_options = {} + + # Create request parameters for a unary method. + name = "hello world" + etag = "hello world" + + disable_secret_version_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| + assert options.metadata.key? :"x-goog-api-client" + assert options.metadata[:"x-goog-api-client"].include? "rest" + refute options.metadata[:"x-goog-api-client"].include? "grpc" + end + + ::Google::Cloud::SecretManager::V1beta2::SecretManagerService::Rest::ServiceStub.stub :transcode_disable_secret_version_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, disable_secret_version_client_stub do + # Create client + client = ::Google::Cloud::SecretManager::V1beta2::SecretManagerService::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.disable_secret_version({ name: name, etag: etag }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.disable_secret_version name: name, etag: etag do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.disable_secret_version ::Google::Cloud::SecretManager::V1beta2::DisableSecretVersionRequest.new(name: name, etag: etag) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + client.disable_secret_version({ name: name, etag: etag }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + client.disable_secret_version(::Google::Cloud::SecretManager::V1beta2::DisableSecretVersionRequest.new(name: name, etag: etag), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, disable_secret_version_client_stub.call_count + end + end + end + + def test_enable_secret_version + # Create test objects. + client_result = ::Google::Cloud::SecretManager::V1beta2::SecretVersion.new + http_response = OpenStruct.new body: client_result.to_json + + call_options = {} + + # Create request parameters for a unary method. + name = "hello world" + etag = "hello world" + + enable_secret_version_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| + assert options.metadata.key? :"x-goog-api-client" + assert options.metadata[:"x-goog-api-client"].include? "rest" + refute options.metadata[:"x-goog-api-client"].include? "grpc" + end + + ::Google::Cloud::SecretManager::V1beta2::SecretManagerService::Rest::ServiceStub.stub :transcode_enable_secret_version_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, enable_secret_version_client_stub do + # Create client + client = ::Google::Cloud::SecretManager::V1beta2::SecretManagerService::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.enable_secret_version({ name: name, etag: etag }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.enable_secret_version name: name, etag: etag do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.enable_secret_version ::Google::Cloud::SecretManager::V1beta2::EnableSecretVersionRequest.new(name: name, etag: etag) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + client.enable_secret_version({ name: name, etag: etag }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + client.enable_secret_version(::Google::Cloud::SecretManager::V1beta2::EnableSecretVersionRequest.new(name: name, etag: etag), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, enable_secret_version_client_stub.call_count + end + end + end + + def test_destroy_secret_version + # Create test objects. + client_result = ::Google::Cloud::SecretManager::V1beta2::SecretVersion.new + http_response = OpenStruct.new body: client_result.to_json + + call_options = {} + + # Create request parameters for a unary method. + name = "hello world" + etag = "hello world" + + destroy_secret_version_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| + assert options.metadata.key? :"x-goog-api-client" + assert options.metadata[:"x-goog-api-client"].include? "rest" + refute options.metadata[:"x-goog-api-client"].include? "grpc" + end + + ::Google::Cloud::SecretManager::V1beta2::SecretManagerService::Rest::ServiceStub.stub :transcode_destroy_secret_version_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, destroy_secret_version_client_stub do + # Create client + client = ::Google::Cloud::SecretManager::V1beta2::SecretManagerService::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.destroy_secret_version({ name: name, etag: etag }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.destroy_secret_version name: name, etag: etag do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.destroy_secret_version ::Google::Cloud::SecretManager::V1beta2::DestroySecretVersionRequest.new(name: name, etag: etag) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + client.destroy_secret_version({ name: name, etag: etag }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + client.destroy_secret_version(::Google::Cloud::SecretManager::V1beta2::DestroySecretVersionRequest.new(name: name, etag: etag), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, destroy_secret_version_client_stub.call_count + end + end + end + + def test_set_iam_policy + # Create test objects. + client_result = ::Google::Iam::V1::Policy.new + http_response = OpenStruct.new body: client_result.to_json + + call_options = {} + + # Create request parameters for a unary method. + resource = "hello world" + policy = {} + update_mask = {} + + set_iam_policy_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| + assert options.metadata.key? :"x-goog-api-client" + assert options.metadata[:"x-goog-api-client"].include? "rest" + refute options.metadata[:"x-goog-api-client"].include? "grpc" + end + + ::Google::Cloud::SecretManager::V1beta2::SecretManagerService::Rest::ServiceStub.stub :transcode_set_iam_policy_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, set_iam_policy_client_stub do + # Create client + client = ::Google::Cloud::SecretManager::V1beta2::SecretManagerService::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.set_iam_policy({ resource: resource, policy: policy, update_mask: update_mask }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.set_iam_policy resource: resource, policy: policy, update_mask: update_mask do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.set_iam_policy ::Google::Iam::V1::SetIamPolicyRequest.new(resource: resource, policy: policy, update_mask: update_mask) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + client.set_iam_policy({ resource: resource, policy: policy, update_mask: update_mask }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + client.set_iam_policy(::Google::Iam::V1::SetIamPolicyRequest.new(resource: resource, policy: policy, update_mask: update_mask), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, set_iam_policy_client_stub.call_count + end + end + end + + def test_get_iam_policy + # Create test objects. + client_result = ::Google::Iam::V1::Policy.new + http_response = OpenStruct.new body: client_result.to_json + + call_options = {} + + # Create request parameters for a unary method. + resource = "hello world" + options = {} + + get_iam_policy_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| + assert options.metadata.key? :"x-goog-api-client" + assert options.metadata[:"x-goog-api-client"].include? "rest" + refute options.metadata[:"x-goog-api-client"].include? "grpc" + end + + ::Google::Cloud::SecretManager::V1beta2::SecretManagerService::Rest::ServiceStub.stub :transcode_get_iam_policy_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, get_iam_policy_client_stub do + # Create client + client = ::Google::Cloud::SecretManager::V1beta2::SecretManagerService::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.get_iam_policy({ resource: resource, options: options }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.get_iam_policy resource: resource, options: options do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.get_iam_policy ::Google::Iam::V1::GetIamPolicyRequest.new(resource: resource, options: options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + client.get_iam_policy({ resource: resource, options: options }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + client.get_iam_policy(::Google::Iam::V1::GetIamPolicyRequest.new(resource: resource, options: options), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, get_iam_policy_client_stub.call_count + end + end + end + + def test_test_iam_permissions + # Create test objects. + client_result = ::Google::Iam::V1::TestIamPermissionsResponse.new + http_response = OpenStruct.new body: client_result.to_json + + call_options = {} + + # Create request parameters for a unary method. + resource = "hello world" + permissions = ["hello world"] + + test_iam_permissions_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| + assert options.metadata.key? :"x-goog-api-client" + assert options.metadata[:"x-goog-api-client"].include? "rest" + refute options.metadata[:"x-goog-api-client"].include? "grpc" + end + + ::Google::Cloud::SecretManager::V1beta2::SecretManagerService::Rest::ServiceStub.stub :transcode_test_iam_permissions_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, test_iam_permissions_client_stub do + # Create client + client = ::Google::Cloud::SecretManager::V1beta2::SecretManagerService::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.test_iam_permissions({ resource: resource, permissions: permissions }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.test_iam_permissions resource: resource, permissions: permissions do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.test_iam_permissions ::Google::Iam::V1::TestIamPermissionsRequest.new(resource: resource, permissions: permissions) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + client.test_iam_permissions({ resource: resource, permissions: permissions }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + client.test_iam_permissions(::Google::Iam::V1::TestIamPermissionsRequest.new(resource: resource, permissions: permissions), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, test_iam_permissions_client_stub.call_count + end + end + end + + def test_configure + credentials_token = :dummy_value + + client = block_config = config = nil + dummy_stub = ClientStub.new nil + Gapic::Rest::ClientStub.stub :new, dummy_stub do + client = ::Google::Cloud::SecretManager::V1beta2::SecretManagerService::Rest::Client.new do |config| + config.credentials = credentials_token + end + end + + config = client.configure do |c| + block_config = c + end + + assert_same block_config, config + assert_kind_of ::Google::Cloud::SecretManager::V1beta2::SecretManagerService::Rest::Client::Configuration, config + end +end diff --git a/owl-bot-staging/google-cloud-secret_manager-v1beta2/test/google/cloud/secret_manager/v1beta2/secret_manager_service_test.rb b/owl-bot-staging/google-cloud-secret_manager-v1beta2/test/google/cloud/secret_manager/v1beta2/secret_manager_service_test.rb new file mode 100644 index 000000000000..e091b2dc2fc8 --- /dev/null +++ b/owl-bot-staging/google-cloud-secret_manager-v1beta2/test/google/cloud/secret_manager/v1beta2/secret_manager_service_test.rb @@ -0,0 +1,1020 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +require "helper" + +require "gapic/grpc/service_stub" + +require "google/cloud/secretmanager/v1beta2/service_pb" +require "google/cloud/secret_manager/v1beta2/secret_manager_service" + +class ::Google::Cloud::SecretManager::V1beta2::SecretManagerService::ClientTest < Minitest::Test + class ClientStub + attr_accessor :call_rpc_count, :requests + + def initialize response, operation, &block + @response = response + @operation = operation + @block = block + @call_rpc_count = 0 + @requests = [] + end + + def call_rpc *args, **kwargs + @call_rpc_count += 1 + + @requests << @block&.call(*args, **kwargs) + + catch :response do + yield @response, @operation if block_given? + @response + end + end + + def endpoint + "endpoint.example.com" + end + + def universe_domain + "example.com" + end + + def stub_logger + nil + end + + def logger + nil + end + end + + def test_list_secrets + # Create GRPC objects. + grpc_response = ::Google::Cloud::SecretManager::V1beta2::ListSecretsResponse.new + grpc_operation = GRPC::ActiveCall::Operation.new nil + grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + grpc_options = {} + + # Create request parameters for a unary method. + parent = "hello world" + page_size = 42 + page_token = "hello world" + filter = "hello world" + + list_secrets_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :list_secrets, name + assert_kind_of ::Google::Cloud::SecretManager::V1beta2::ListSecretsRequest, request + assert_equal "hello world", request["parent"] + assert_equal 42, request["page_size"] + assert_equal "hello world", request["page_token"] + assert_equal "hello world", request["filter"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, list_secrets_client_stub do + # Create client + client = ::Google::Cloud::SecretManager::V1beta2::SecretManagerService::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.list_secrets({ parent: parent, page_size: page_size, page_token: page_token, filter: filter }) do |response, operation| + assert_kind_of Gapic::PagedEnumerable, response + assert_equal grpc_response, response.response + assert_equal grpc_operation, operation + end + + # Use named arguments + client.list_secrets parent: parent, page_size: page_size, page_token: page_token, filter: filter do |response, operation| + assert_kind_of Gapic::PagedEnumerable, response + assert_equal grpc_response, response.response + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.list_secrets ::Google::Cloud::SecretManager::V1beta2::ListSecretsRequest.new(parent: parent, page_size: page_size, page_token: page_token, filter: filter) do |response, operation| + assert_kind_of Gapic::PagedEnumerable, response + assert_equal grpc_response, response.response + assert_equal grpc_operation, operation + end + + # Use hash object with options + client.list_secrets({ parent: parent, page_size: page_size, page_token: page_token, filter: filter }, grpc_options) do |response, operation| + assert_kind_of Gapic::PagedEnumerable, response + assert_equal grpc_response, response.response + assert_equal grpc_operation, operation + end + + # Use protobuf object with options + client.list_secrets(::Google::Cloud::SecretManager::V1beta2::ListSecretsRequest.new(parent: parent, page_size: page_size, page_token: page_token, filter: filter), grpc_options) do |response, operation| + assert_kind_of Gapic::PagedEnumerable, response + assert_equal grpc_response, response.response + assert_equal grpc_operation, operation + end + + # Verify method calls + assert_equal 5, list_secrets_client_stub.call_rpc_count + end + end + + def test_create_secret + # Create GRPC objects. + grpc_response = ::Google::Cloud::SecretManager::V1beta2::Secret.new + grpc_operation = GRPC::ActiveCall::Operation.new nil + grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + grpc_options = {} + + # Create request parameters for a unary method. + parent = "hello world" + secret_id = "hello world" + secret = {} + + create_secret_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :create_secret, name + assert_kind_of ::Google::Cloud::SecretManager::V1beta2::CreateSecretRequest, request + assert_equal "hello world", request["parent"] + assert_equal "hello world", request["secret_id"] + assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::SecretManager::V1beta2::Secret), request["secret"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, create_secret_client_stub do + # Create client + client = ::Google::Cloud::SecretManager::V1beta2::SecretManagerService::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.create_secret({ parent: parent, secret_id: secret_id, secret: secret }) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use named arguments + client.create_secret parent: parent, secret_id: secret_id, secret: secret do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.create_secret ::Google::Cloud::SecretManager::V1beta2::CreateSecretRequest.new(parent: parent, secret_id: secret_id, secret: secret) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use hash object with options + client.create_secret({ parent: parent, secret_id: secret_id, secret: secret }, grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object with options + client.create_secret(::Google::Cloud::SecretManager::V1beta2::CreateSecretRequest.new(parent: parent, secret_id: secret_id, secret: secret), grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Verify method calls + assert_equal 5, create_secret_client_stub.call_rpc_count + end + end + + def test_add_secret_version + # Create GRPC objects. + grpc_response = ::Google::Cloud::SecretManager::V1beta2::SecretVersion.new + grpc_operation = GRPC::ActiveCall::Operation.new nil + grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + grpc_options = {} + + # Create request parameters for a unary method. + parent = "hello world" + payload = {} + + add_secret_version_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :add_secret_version, name + assert_kind_of ::Google::Cloud::SecretManager::V1beta2::AddSecretVersionRequest, request + assert_equal "hello world", request["parent"] + assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::SecretManager::V1beta2::SecretPayload), request["payload"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, add_secret_version_client_stub do + # Create client + client = ::Google::Cloud::SecretManager::V1beta2::SecretManagerService::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.add_secret_version({ parent: parent, payload: payload }) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use named arguments + client.add_secret_version parent: parent, payload: payload do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.add_secret_version ::Google::Cloud::SecretManager::V1beta2::AddSecretVersionRequest.new(parent: parent, payload: payload) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use hash object with options + client.add_secret_version({ parent: parent, payload: payload }, grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object with options + client.add_secret_version(::Google::Cloud::SecretManager::V1beta2::AddSecretVersionRequest.new(parent: parent, payload: payload), grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Verify method calls + assert_equal 5, add_secret_version_client_stub.call_rpc_count + end + end + + def test_get_secret + # Create GRPC objects. + grpc_response = ::Google::Cloud::SecretManager::V1beta2::Secret.new + grpc_operation = GRPC::ActiveCall::Operation.new nil + grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + grpc_options = {} + + # Create request parameters for a unary method. + name = "hello world" + + get_secret_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :get_secret, name + assert_kind_of ::Google::Cloud::SecretManager::V1beta2::GetSecretRequest, request + assert_equal "hello world", request["name"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, get_secret_client_stub do + # Create client + client = ::Google::Cloud::SecretManager::V1beta2::SecretManagerService::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.get_secret({ name: name }) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use named arguments + client.get_secret name: name do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.get_secret ::Google::Cloud::SecretManager::V1beta2::GetSecretRequest.new(name: name) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use hash object with options + client.get_secret({ name: name }, grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object with options + client.get_secret(::Google::Cloud::SecretManager::V1beta2::GetSecretRequest.new(name: name), grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Verify method calls + assert_equal 5, get_secret_client_stub.call_rpc_count + end + end + + def test_update_secret + # Create GRPC objects. + grpc_response = ::Google::Cloud::SecretManager::V1beta2::Secret.new + grpc_operation = GRPC::ActiveCall::Operation.new nil + grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + grpc_options = {} + + # Create request parameters for a unary method. + secret = {} + update_mask = {} + + update_secret_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :update_secret, name + assert_kind_of ::Google::Cloud::SecretManager::V1beta2::UpdateSecretRequest, request + assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::SecretManager::V1beta2::Secret), request["secret"] + assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Protobuf::FieldMask), request["update_mask"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, update_secret_client_stub do + # Create client + client = ::Google::Cloud::SecretManager::V1beta2::SecretManagerService::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.update_secret({ secret: secret, update_mask: update_mask }) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use named arguments + client.update_secret secret: secret, update_mask: update_mask do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.update_secret ::Google::Cloud::SecretManager::V1beta2::UpdateSecretRequest.new(secret: secret, update_mask: update_mask) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use hash object with options + client.update_secret({ secret: secret, update_mask: update_mask }, grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object with options + client.update_secret(::Google::Cloud::SecretManager::V1beta2::UpdateSecretRequest.new(secret: secret, update_mask: update_mask), grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Verify method calls + assert_equal 5, update_secret_client_stub.call_rpc_count + end + end + + def test_delete_secret + # Create GRPC objects. + grpc_response = ::Google::Protobuf::Empty.new + grpc_operation = GRPC::ActiveCall::Operation.new nil + grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + grpc_options = {} + + # Create request parameters for a unary method. + name = "hello world" + etag = "hello world" + + delete_secret_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :delete_secret, name + assert_kind_of ::Google::Cloud::SecretManager::V1beta2::DeleteSecretRequest, request + assert_equal "hello world", request["name"] + assert_equal "hello world", request["etag"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, delete_secret_client_stub do + # Create client + client = ::Google::Cloud::SecretManager::V1beta2::SecretManagerService::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.delete_secret({ name: name, etag: etag }) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use named arguments + client.delete_secret name: name, etag: etag do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.delete_secret ::Google::Cloud::SecretManager::V1beta2::DeleteSecretRequest.new(name: name, etag: etag) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use hash object with options + client.delete_secret({ name: name, etag: etag }, grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object with options + client.delete_secret(::Google::Cloud::SecretManager::V1beta2::DeleteSecretRequest.new(name: name, etag: etag), grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Verify method calls + assert_equal 5, delete_secret_client_stub.call_rpc_count + end + end + + def test_list_secret_versions + # Create GRPC objects. + grpc_response = ::Google::Cloud::SecretManager::V1beta2::ListSecretVersionsResponse.new + grpc_operation = GRPC::ActiveCall::Operation.new nil + grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + grpc_options = {} + + # Create request parameters for a unary method. + parent = "hello world" + page_size = 42 + page_token = "hello world" + filter = "hello world" + + list_secret_versions_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :list_secret_versions, name + assert_kind_of ::Google::Cloud::SecretManager::V1beta2::ListSecretVersionsRequest, request + assert_equal "hello world", request["parent"] + assert_equal 42, request["page_size"] + assert_equal "hello world", request["page_token"] + assert_equal "hello world", request["filter"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, list_secret_versions_client_stub do + # Create client + client = ::Google::Cloud::SecretManager::V1beta2::SecretManagerService::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.list_secret_versions({ parent: parent, page_size: page_size, page_token: page_token, filter: filter }) do |response, operation| + assert_kind_of Gapic::PagedEnumerable, response + assert_equal grpc_response, response.response + assert_equal grpc_operation, operation + end + + # Use named arguments + client.list_secret_versions parent: parent, page_size: page_size, page_token: page_token, filter: filter do |response, operation| + assert_kind_of Gapic::PagedEnumerable, response + assert_equal grpc_response, response.response + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.list_secret_versions ::Google::Cloud::SecretManager::V1beta2::ListSecretVersionsRequest.new(parent: parent, page_size: page_size, page_token: page_token, filter: filter) do |response, operation| + assert_kind_of Gapic::PagedEnumerable, response + assert_equal grpc_response, response.response + assert_equal grpc_operation, operation + end + + # Use hash object with options + client.list_secret_versions({ parent: parent, page_size: page_size, page_token: page_token, filter: filter }, grpc_options) do |response, operation| + assert_kind_of Gapic::PagedEnumerable, response + assert_equal grpc_response, response.response + assert_equal grpc_operation, operation + end + + # Use protobuf object with options + client.list_secret_versions(::Google::Cloud::SecretManager::V1beta2::ListSecretVersionsRequest.new(parent: parent, page_size: page_size, page_token: page_token, filter: filter), grpc_options) do |response, operation| + assert_kind_of Gapic::PagedEnumerable, response + assert_equal grpc_response, response.response + assert_equal grpc_operation, operation + end + + # Verify method calls + assert_equal 5, list_secret_versions_client_stub.call_rpc_count + end + end + + def test_get_secret_version + # Create GRPC objects. + grpc_response = ::Google::Cloud::SecretManager::V1beta2::SecretVersion.new + grpc_operation = GRPC::ActiveCall::Operation.new nil + grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + grpc_options = {} + + # Create request parameters for a unary method. + name = "hello world" + + get_secret_version_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :get_secret_version, name + assert_kind_of ::Google::Cloud::SecretManager::V1beta2::GetSecretVersionRequest, request + assert_equal "hello world", request["name"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, get_secret_version_client_stub do + # Create client + client = ::Google::Cloud::SecretManager::V1beta2::SecretManagerService::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.get_secret_version({ name: name }) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use named arguments + client.get_secret_version name: name do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.get_secret_version ::Google::Cloud::SecretManager::V1beta2::GetSecretVersionRequest.new(name: name) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use hash object with options + client.get_secret_version({ name: name }, grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object with options + client.get_secret_version(::Google::Cloud::SecretManager::V1beta2::GetSecretVersionRequest.new(name: name), grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Verify method calls + assert_equal 5, get_secret_version_client_stub.call_rpc_count + end + end + + def test_access_secret_version + # Create GRPC objects. + grpc_response = ::Google::Cloud::SecretManager::V1beta2::AccessSecretVersionResponse.new + grpc_operation = GRPC::ActiveCall::Operation.new nil + grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + grpc_options = {} + + # Create request parameters for a unary method. + name = "hello world" + + access_secret_version_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :access_secret_version, name + assert_kind_of ::Google::Cloud::SecretManager::V1beta2::AccessSecretVersionRequest, request + assert_equal "hello world", request["name"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, access_secret_version_client_stub do + # Create client + client = ::Google::Cloud::SecretManager::V1beta2::SecretManagerService::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.access_secret_version({ name: name }) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use named arguments + client.access_secret_version name: name do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.access_secret_version ::Google::Cloud::SecretManager::V1beta2::AccessSecretVersionRequest.new(name: name) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use hash object with options + client.access_secret_version({ name: name }, grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object with options + client.access_secret_version(::Google::Cloud::SecretManager::V1beta2::AccessSecretVersionRequest.new(name: name), grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Verify method calls + assert_equal 5, access_secret_version_client_stub.call_rpc_count + end + end + + def test_disable_secret_version + # Create GRPC objects. + grpc_response = ::Google::Cloud::SecretManager::V1beta2::SecretVersion.new + grpc_operation = GRPC::ActiveCall::Operation.new nil + grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + grpc_options = {} + + # Create request parameters for a unary method. + name = "hello world" + etag = "hello world" + + disable_secret_version_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :disable_secret_version, name + assert_kind_of ::Google::Cloud::SecretManager::V1beta2::DisableSecretVersionRequest, request + assert_equal "hello world", request["name"] + assert_equal "hello world", request["etag"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, disable_secret_version_client_stub do + # Create client + client = ::Google::Cloud::SecretManager::V1beta2::SecretManagerService::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.disable_secret_version({ name: name, etag: etag }) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use named arguments + client.disable_secret_version name: name, etag: etag do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.disable_secret_version ::Google::Cloud::SecretManager::V1beta2::DisableSecretVersionRequest.new(name: name, etag: etag) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use hash object with options + client.disable_secret_version({ name: name, etag: etag }, grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object with options + client.disable_secret_version(::Google::Cloud::SecretManager::V1beta2::DisableSecretVersionRequest.new(name: name, etag: etag), grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Verify method calls + assert_equal 5, disable_secret_version_client_stub.call_rpc_count + end + end + + def test_enable_secret_version + # Create GRPC objects. + grpc_response = ::Google::Cloud::SecretManager::V1beta2::SecretVersion.new + grpc_operation = GRPC::ActiveCall::Operation.new nil + grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + grpc_options = {} + + # Create request parameters for a unary method. + name = "hello world" + etag = "hello world" + + enable_secret_version_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :enable_secret_version, name + assert_kind_of ::Google::Cloud::SecretManager::V1beta2::EnableSecretVersionRequest, request + assert_equal "hello world", request["name"] + assert_equal "hello world", request["etag"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, enable_secret_version_client_stub do + # Create client + client = ::Google::Cloud::SecretManager::V1beta2::SecretManagerService::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.enable_secret_version({ name: name, etag: etag }) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use named arguments + client.enable_secret_version name: name, etag: etag do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.enable_secret_version ::Google::Cloud::SecretManager::V1beta2::EnableSecretVersionRequest.new(name: name, etag: etag) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use hash object with options + client.enable_secret_version({ name: name, etag: etag }, grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object with options + client.enable_secret_version(::Google::Cloud::SecretManager::V1beta2::EnableSecretVersionRequest.new(name: name, etag: etag), grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Verify method calls + assert_equal 5, enable_secret_version_client_stub.call_rpc_count + end + end + + def test_destroy_secret_version + # Create GRPC objects. + grpc_response = ::Google::Cloud::SecretManager::V1beta2::SecretVersion.new + grpc_operation = GRPC::ActiveCall::Operation.new nil + grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + grpc_options = {} + + # Create request parameters for a unary method. + name = "hello world" + etag = "hello world" + + destroy_secret_version_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :destroy_secret_version, name + assert_kind_of ::Google::Cloud::SecretManager::V1beta2::DestroySecretVersionRequest, request + assert_equal "hello world", request["name"] + assert_equal "hello world", request["etag"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, destroy_secret_version_client_stub do + # Create client + client = ::Google::Cloud::SecretManager::V1beta2::SecretManagerService::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.destroy_secret_version({ name: name, etag: etag }) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use named arguments + client.destroy_secret_version name: name, etag: etag do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.destroy_secret_version ::Google::Cloud::SecretManager::V1beta2::DestroySecretVersionRequest.new(name: name, etag: etag) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use hash object with options + client.destroy_secret_version({ name: name, etag: etag }, grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object with options + client.destroy_secret_version(::Google::Cloud::SecretManager::V1beta2::DestroySecretVersionRequest.new(name: name, etag: etag), grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Verify method calls + assert_equal 5, destroy_secret_version_client_stub.call_rpc_count + end + end + + def test_set_iam_policy + # Create GRPC objects. + grpc_response = ::Google::Iam::V1::Policy.new + grpc_operation = GRPC::ActiveCall::Operation.new nil + grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + grpc_options = {} + + # Create request parameters for a unary method. + resource = "hello world" + policy = {} + update_mask = {} + + set_iam_policy_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :set_iam_policy, name + assert_kind_of ::Google::Iam::V1::SetIamPolicyRequest, request + assert_equal "hello world", request["resource"] + assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Iam::V1::Policy), request["policy"] + assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Protobuf::FieldMask), request["update_mask"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, set_iam_policy_client_stub do + # Create client + client = ::Google::Cloud::SecretManager::V1beta2::SecretManagerService::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.set_iam_policy({ resource: resource, policy: policy, update_mask: update_mask }) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use named arguments + client.set_iam_policy resource: resource, policy: policy, update_mask: update_mask do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.set_iam_policy ::Google::Iam::V1::SetIamPolicyRequest.new(resource: resource, policy: policy, update_mask: update_mask) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use hash object with options + client.set_iam_policy({ resource: resource, policy: policy, update_mask: update_mask }, grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object with options + client.set_iam_policy(::Google::Iam::V1::SetIamPolicyRequest.new(resource: resource, policy: policy, update_mask: update_mask), grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Verify method calls + assert_equal 5, set_iam_policy_client_stub.call_rpc_count + end + end + + def test_get_iam_policy + # Create GRPC objects. + grpc_response = ::Google::Iam::V1::Policy.new + grpc_operation = GRPC::ActiveCall::Operation.new nil + grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + grpc_options = {} + + # Create request parameters for a unary method. + resource = "hello world" + options = {} + + get_iam_policy_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :get_iam_policy, name + assert_kind_of ::Google::Iam::V1::GetIamPolicyRequest, request + assert_equal "hello world", request["resource"] + assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Iam::V1::GetPolicyOptions), request["options"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, get_iam_policy_client_stub do + # Create client + client = ::Google::Cloud::SecretManager::V1beta2::SecretManagerService::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.get_iam_policy({ resource: resource, options: options }) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use named arguments + client.get_iam_policy resource: resource, options: options do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.get_iam_policy ::Google::Iam::V1::GetIamPolicyRequest.new(resource: resource, options: options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use hash object with options + client.get_iam_policy({ resource: resource, options: options }, grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object with options + client.get_iam_policy(::Google::Iam::V1::GetIamPolicyRequest.new(resource: resource, options: options), grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Verify method calls + assert_equal 5, get_iam_policy_client_stub.call_rpc_count + end + end + + def test_test_iam_permissions + # Create GRPC objects. + grpc_response = ::Google::Iam::V1::TestIamPermissionsResponse.new + grpc_operation = GRPC::ActiveCall::Operation.new nil + grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + grpc_options = {} + + # Create request parameters for a unary method. + resource = "hello world" + permissions = ["hello world"] + + test_iam_permissions_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :test_iam_permissions, name + assert_kind_of ::Google::Iam::V1::TestIamPermissionsRequest, request + assert_equal "hello world", request["resource"] + assert_equal ["hello world"], request["permissions"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, test_iam_permissions_client_stub do + # Create client + client = ::Google::Cloud::SecretManager::V1beta2::SecretManagerService::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.test_iam_permissions({ resource: resource, permissions: permissions }) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use named arguments + client.test_iam_permissions resource: resource, permissions: permissions do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.test_iam_permissions ::Google::Iam::V1::TestIamPermissionsRequest.new(resource: resource, permissions: permissions) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use hash object with options + client.test_iam_permissions({ resource: resource, permissions: permissions }, grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object with options + client.test_iam_permissions(::Google::Iam::V1::TestIamPermissionsRequest.new(resource: resource, permissions: permissions), grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Verify method calls + assert_equal 5, test_iam_permissions_client_stub.call_rpc_count + end + end + + def test_configure + grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + + client = block_config = config = nil + dummy_stub = ClientStub.new nil, nil + Gapic::ServiceStub.stub :new, dummy_stub do + client = ::Google::Cloud::SecretManager::V1beta2::SecretManagerService::Client.new do |config| + config.credentials = grpc_channel + end + end + + config = client.configure do |c| + block_config = c + end + + assert_same block_config, config + assert_kind_of ::Google::Cloud::SecretManager::V1beta2::SecretManagerService::Client::Configuration, config + end + + def test_credentials + key = OpenSSL::PKey::RSA.new 2048 + cred_json = { + "private_key" => key.to_pem, + "client_email" => "app@developer.gserviceaccount.com", + "type" => "service_account" + } + key_file = StringIO.new cred_json.to_json + creds = Google::Auth::ServiceAccountCredentials.make_creds({ json_key_io: key_file }) + + dummy_stub = ClientStub.new nil, nil + Gapic::ServiceStub.stub :new, dummy_stub do + client = ::Google::Cloud::SecretManager::V1beta2::SecretManagerService::Client.new do |config| + config.credentials = creds + end + assert_kind_of ::Google::Cloud::SecretManager::V1beta2::SecretManagerService::Client, client + assert_equal creds, client.configure.credentials + end + end +end diff --git a/owl-bot-staging/google-cloud-secret_manager-v1beta2/test/helper.rb b/owl-bot-staging/google-cloud-secret_manager-v1beta2/test/helper.rb new file mode 100644 index 000000000000..672b337030e7 --- /dev/null +++ b/owl-bot-staging/google-cloud-secret_manager-v1beta2/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" diff --git a/owl-bot-staging/google-cloud-secure_source_manager-v1/.gitignore b/owl-bot-staging/google-cloud-secure_source_manager-v1/.gitignore new file mode 100644 index 000000000000..0135b6bc6cfc --- /dev/null +++ b/owl-bot-staging/google-cloud-secure_source_manager-v1/.gitignore @@ -0,0 +1,22 @@ +# Ignore bundler lockfiles +Gemfile.lock +gems.locked + +# Ignore documentation output +doc/* +.yardoc/* + +# Ignore test output +coverage/* + +# Ignore build artifacts +pkg/* + +# Ignore files commonly present in certain dev environments +.vagrant +.DS_STORE +.idea +*.iml + +# Ignore synth output +__pycache__ diff --git a/owl-bot-staging/google-cloud-secure_source_manager-v1/.repo-metadata.json b/owl-bot-staging/google-cloud-secure_source_manager-v1/.repo-metadata.json new file mode 100644 index 000000000000..8301929ac8fd --- /dev/null +++ b/owl-bot-staging/google-cloud-secure_source_manager-v1/.repo-metadata.json @@ -0,0 +1,17 @@ +{ + "api_id": "securesourcemanager.googleapis.com", + "api_shortname": "securesourcemanager", + "client_documentation": "https://cloud.google.com/ruby/docs/reference/google-cloud-secure_source_manager-v1/latest", + "distribution_name": "google-cloud-secure_source_manager-v1", + "is_cloud": true, + "language": "ruby", + "name": "securesourcemanager", + "name_pretty": "Secure Source Manager V1 API", + "product_documentation": "https://cloud.google.com/secure-source-manager/docs/overview", + "release_level": "unreleased", + "repo": "googleapis/google-cloud-ruby", + "requires_billing": true, + "ruby-cloud-description": "Regionally deployed, single-tenant managed source code repository hosted on Google Cloud. Note that google-cloud-secure_source_manager-v1 is a version-specific client library. For most uses, we recommend installing the main client library google-cloud-secure_source_manager instead. See the readme for more details.", + "ruby-cloud-product-url": "https://cloud.google.com/secure-source-manager/docs/overview", + "library_type": "GAPIC_AUTO" +} diff --git a/owl-bot-staging/google-cloud-secure_source_manager-v1/.rubocop.yml b/owl-bot-staging/google-cloud-secure_source_manager-v1/.rubocop.yml new file mode 100644 index 000000000000..93adabe4f472 --- /dev/null +++ b/owl-bot-staging/google-cloud-secure_source_manager-v1/.rubocop.yml @@ -0,0 +1,33 @@ +inherit_gem: + google-style: google-style.yml + +AllCops: + Exclude: + - "google-cloud-secure_source_manager-v1.gemspec" + - "lib/**/*_pb.rb" + - "proto_docs/**/*" + - "test/**/*" + - "acceptance/**/*" + - "samples/acceptance/**/*" + - "Rakefile" + +Layout/LineLength: + Enabled: false +Metrics/AbcSize: + Enabled: false +Metrics/ClassLength: + Enabled: false +Metrics/CyclomaticComplexity: + Enabled: false +Metrics/MethodLength: + Enabled: false +Metrics/ModuleLength: + Enabled: false +Metrics/PerceivedComplexity: + Enabled: false +Naming/AccessorMethodName: + Exclude: + - "snippets/**/*.rb" +Naming/FileName: + Exclude: + - "lib/google-cloud-secure_source_manager-v1.rb" diff --git a/owl-bot-staging/google-cloud-secure_source_manager-v1/.toys.rb b/owl-bot-staging/google-cloud-secure_source_manager-v1/.toys.rb new file mode 100644 index 000000000000..177e22456e8a --- /dev/null +++ b/owl-bot-staging/google-cloud-secure_source_manager-v1/.toys.rb @@ -0,0 +1,28 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +toys_version! ">= 0.15.3" + +if ENV["RUBY_COMMON_TOOLS"] + common_tools_dir = File.expand_path ENV["RUBY_COMMON_TOOLS"] + load File.join(common_tools_dir, "toys", "gapic") +else + load_git remote: "https://github.com/googleapis/ruby-common-tools.git", + path: "toys/gapic", + update: true +end diff --git a/owl-bot-staging/google-cloud-secure_source_manager-v1/.yardopts b/owl-bot-staging/google-cloud-secure_source_manager-v1/.yardopts new file mode 100644 index 000000000000..6adcda101376 --- /dev/null +++ b/owl-bot-staging/google-cloud-secure_source_manager-v1/.yardopts @@ -0,0 +1,12 @@ +--no-private +--title="Secure Source Manager V1 API" +--exclude _pb\.rb$ +--markup markdown +--markup-provider redcarpet + +./lib/**/*.rb +./proto_docs/**/*.rb +- +README.md +LICENSE.md +AUTHENTICATION.md diff --git a/owl-bot-staging/google-cloud-secure_source_manager-v1/AUTHENTICATION.md b/owl-bot-staging/google-cloud-secure_source_manager-v1/AUTHENTICATION.md new file mode 100644 index 000000000000..32e59d3cbbea --- /dev/null +++ b/owl-bot-staging/google-cloud-secure_source_manager-v1/AUTHENTICATION.md @@ -0,0 +1,122 @@ +# Authentication + +The recommended way to authenticate to the google-cloud-secure_source_manager-v1 library is to use +[Application Default Credentials (ADC)](https://cloud.google.com/docs/authentication/application-default-credentials). +To review all of your authentication options, see [Credentials lookup](#credential-lookup). + +## Quickstart + +The following example shows how to set up authentication for a local development +environment with your user credentials. + +**NOTE:** This method is _not_ recommended for running in production. User credentials +should be used only during development. + +1. [Download and install the Google Cloud CLI](https://cloud.google.com/sdk). +2. Set up a local ADC file with your user credentials: + +```sh +gcloud auth application-default login +``` + +3. Write code as if already authenticated. + +For more information about setting up authentication for a local development environment, see +[Set up Application Default Credentials](https://cloud.google.com/docs/authentication/provide-credentials-adc#local-dev). + +## Credential Lookup + +The google-cloud-secure_source_manager-v1 library provides several mechanisms to configure your system. +Generally, using Application Default Credentials to facilitate automatic +credentials discovery is the easist method. But if you need to explicitly specify +credentials, there are several methods available to you. + +Credentials are accepted in the following ways, in the following order or precedence: + +1. Credentials specified in method arguments +2. Credentials specified in configuration +3. Credentials pointed to or included in environment variables +4. Credentials found in local ADC file +5. Credentials returned by the metadata server for the attached service account (GCP) + +### Configuration + +You can configure a path to a JSON credentials file, either for an individual client object or +globally, for all client objects. The JSON file can contain credentials created for +[workload identity federation](https://cloud.google.com/iam/docs/workload-identity-federation), +[workforce identity federation](https://cloud.google.com/iam/docs/workforce-identity-federation), or a +[service account key](https://cloud.google.com/docs/authentication/provide-credentials-adc#local-key). + +Note: Service account keys are a security risk if not managed correctly. You should +[choose a more secure alternative to service account keys](https://cloud.google.com/docs/authentication#auth-decision-tree) +whenever possible. + +To configure a credentials file for an individual client initialization: + +```ruby +require "google/cloud/secure_source_manager/v1" + +client = ::Google::Cloud::SecureSourceManager::V1::SecureSourceManager::Client.new do |config| + config.credentials = "path/to/credentialfile.json" +end +``` + +To configure a credentials file globally for all clients: + +```ruby +require "google/cloud/secure_source_manager/v1" + +::Google::Cloud::SecureSourceManager::V1::SecureSourceManager::Client.configure do |config| + config.credentials = "path/to/credentialfile.json" +end + +client = ::Google::Cloud::SecureSourceManager::V1::SecureSourceManager::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-secure_source_manager-v1 +checks for credentials are: + +* `GOOGLE_CLOUD_CREDENTIALS` - Path to JSON file, or JSON contents +* `GOOGLE_APPLICATION_CREDENTIALS` - Path to JSON file + +```ruby +require "google/cloud/secure_source_manager/v1" + +ENV["GOOGLE_APPLICATION_CREDENTIALS"] = "path/to/credentialfile.json" + +client = ::Google::Cloud::SecureSourceManager::V1::SecureSourceManager::Client.new +``` + +### Local ADC file + +You can set up a local ADC file with your user credentials for authentication during +development. If credentials are not provided in code or in environment variables, +then the local ADC credentials are discovered. + +Follow the steps in [Quickstart](#quickstart) to set up a local ADC file. + +### Google Cloud Platform environments + +When running on Google Cloud Platform (GCP), including Google Compute Engine +(GCE), Google Kubernetes Engine (GKE), Google App Engine (GAE), Google Cloud +Functions (GCF) and Cloud Run, credentials are retrieved from the attached +service account automatically. Code should be written as if already authenticated. + +For more information, see +[Set up ADC for Google Cloud services](https://cloud.google.com/docs/authentication/provide-credentials-adc#attached-sa). diff --git a/owl-bot-staging/google-cloud-secure_source_manager-v1/CHANGELOG.md b/owl-bot-staging/google-cloud-secure_source_manager-v1/CHANGELOG.md new file mode 100644 index 000000000000..f88957a62ba2 --- /dev/null +++ b/owl-bot-staging/google-cloud-secure_source_manager-v1/CHANGELOG.md @@ -0,0 +1,2 @@ +# Release History + diff --git a/owl-bot-staging/google-cloud-secure_source_manager-v1/Gemfile b/owl-bot-staging/google-cloud-secure_source_manager-v1/Gemfile new file mode 100644 index 000000000000..1d08558908d8 --- /dev/null +++ b/owl-bot-staging/google-cloud-secure_source_manager-v1/Gemfile @@ -0,0 +1,14 @@ +source "https://rubygems.org" + +gemspec + +gem "google-style", "~> 1.32.0" +gem "irb", "~> 1.17" +gem "minitest", "~> 6.0.2" +gem "minitest-focus", "~> 1.4" +gem "minitest-mock", "~> 5.27" +gem "minitest-rg", "~> 5.3" +gem "ostruct", "~> 0.5.5" +gem "rake", ">= 13.0" +gem "redcarpet", "~> 3.6" +gem "yard", "~> 0.9" diff --git a/owl-bot-staging/google-cloud-secure_source_manager-v1/LICENSE.md b/owl-bot-staging/google-cloud-secure_source_manager-v1/LICENSE.md new file mode 100644 index 000000000000..c261857ba6ad --- /dev/null +++ b/owl-bot-staging/google-cloud-secure_source_manager-v1/LICENSE.md @@ -0,0 +1,201 @@ + Apache License + Version 2.0, January 2004 + http://www.apache.org/licenses/ + + TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION + + 1. Definitions. + + "License" shall mean the terms and conditions for use, reproduction, + and distribution as defined by Sections 1 through 9 of this document. + + "Licensor" shall mean the copyright owner or entity authorized by + the copyright owner that is granting the License. + + "Legal Entity" shall mean the union of the acting entity and all + other entities that control, are controlled by, or are under common + control with that entity. For the purposes of this definition, + "control" means (i) the power, direct or indirect, to cause the + direction or management of such entity, whether by contract or + otherwise, or (ii) ownership of fifty percent (50%) or more of the + outstanding shares, or (iii) beneficial ownership of such entity. + + "You" (or "Your") shall mean an individual or Legal Entity + exercising permissions granted by this License. + + "Source" form shall mean the preferred form for making modifications, + including but not limited to software source code, documentation + source, and configuration files. + + "Object" form shall mean any form resulting from mechanical + transformation or translation of a Source form, including but + not limited to compiled object code, generated documentation, + and conversions to other media types. + + "Work" shall mean the work of authorship, whether in Source or + Object form, made available under the License, as indicated by a + copyright notice that is included in or attached to the work + (an example is provided in the Appendix below). + + "Derivative Works" shall mean any work, whether in Source or Object + form, that is based on (or derived from) the Work and for which the + editorial revisions, annotations, elaborations, or other modifications + represent, as a whole, an original work of authorship. For the purposes + of this License, Derivative Works shall not include works that remain + separable from, or merely link (or bind by name) to the interfaces of, + the Work and Derivative Works thereof. + + "Contribution" shall mean any work of authorship, including + the original version of the Work and any modifications or additions + to that Work or Derivative Works thereof, that is intentionally + submitted to Licensor for inclusion in the Work by the copyright owner + or by an individual or Legal Entity authorized to submit on behalf of + the copyright owner. For the purposes of this definition, "submitted" + means any form of electronic, verbal, or written communication sent + to the Licensor or its representatives, including but not limited to + communication on electronic mailing lists, source code control systems, + and issue tracking systems that are managed by, or on behalf of, the + Licensor for the purpose of discussing and improving the Work, but + excluding communication that is conspicuously marked or otherwise + designated in writing by the copyright owner as "Not a Contribution." + + "Contributor" shall mean Licensor and any individual or Legal Entity + on behalf of whom a Contribution has been received by Licensor and + subsequently incorporated within the Work. + + 2. Grant of Copyright License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + copyright license to reproduce, prepare Derivative Works of, + publicly display, publicly perform, sublicense, and distribute the + Work and such Derivative Works in Source or Object form. + + 3. Grant of Patent License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + (except as stated in this section) patent license to make, have made, + use, offer to sell, sell, import, and otherwise transfer the Work, + where such license applies only to those patent claims licensable + by such Contributor that are necessarily infringed by their + Contribution(s) alone or by combination of their Contribution(s) + with the Work to which such Contribution(s) was submitted. If You + institute patent litigation against any entity (including a + cross-claim or counterclaim in a lawsuit) alleging that the Work + or a Contribution incorporated within the Work constitutes direct + or contributory patent infringement, then any patent licenses + granted to You under this License for that Work shall terminate + as of the date such litigation is filed. + + 4. Redistribution. You may reproduce and distribute copies of the + Work or Derivative Works thereof in any medium, with or without + modifications, and in Source or Object form, provided that You + meet the following conditions: + + (a) You must give any other recipients of the Work or + Derivative Works a copy of this License; and + + (b) You must cause any modified files to carry prominent notices + stating that You changed the files; and + + (c) You must retain, in the Source form of any Derivative Works + that You distribute, all copyright, patent, trademark, and + attribution notices from the Source form of the Work, + excluding those notices that do not pertain to any part of + the Derivative Works; and + + (d) If the Work includes a "NOTICE" text file as part of its + distribution, then any Derivative Works that You distribute must + include a readable copy of the attribution notices contained + within such NOTICE file, excluding those notices that do not + pertain to any part of the Derivative Works, in at least one + of the following places: within a NOTICE text file distributed + as part of the Derivative Works; within the Source form or + documentation, if provided along with the Derivative Works; or, + within a display generated by the Derivative Works, if and + wherever such third-party notices normally appear. The contents + of the NOTICE file are for informational purposes only and + do not modify the License. You may add Your own attribution + notices within Derivative Works that You distribute, alongside + or as an addendum to the NOTICE text from the Work, provided + that such additional attribution notices cannot be construed + as modifying the License. + + You may add Your own copyright statement to Your modifications and + may provide additional or different license terms and conditions + for use, reproduction, or distribution of Your modifications, or + for any such Derivative Works as a whole, provided Your use, + reproduction, and distribution of the Work otherwise complies with + the conditions stated in this License. + + 5. Submission of Contributions. Unless You explicitly state otherwise, + any Contribution intentionally submitted for inclusion in the Work + by You to the Licensor shall be under the terms and conditions of + this License, without any additional terms or conditions. + Notwithstanding the above, nothing herein shall supersede or modify + the terms of any separate license agreement you may have executed + with Licensor regarding such Contributions. + + 6. Trademarks. This License does not grant permission to use the trade + names, trademarks, service marks, or product names of the Licensor, + except as required for reasonable and customary use in describing the + origin of the Work and reproducing the content of the NOTICE file. + + 7. Disclaimer of Warranty. Unless required by applicable law or + agreed to in writing, Licensor provides the Work (and each + Contributor provides its Contributions) on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or + implied, including, without limitation, any warranties or conditions + of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A + PARTICULAR PURPOSE. You are solely responsible for determining the + appropriateness of using or redistributing the Work and assume any + risks associated with Your exercise of permissions under this License. + + 8. Limitation of Liability. In no event and under no legal theory, + whether in tort (including negligence), contract, or otherwise, + unless required by applicable law (such as deliberate and grossly + negligent acts) or agreed to in writing, shall any Contributor be + liable to You for damages, including any direct, indirect, special, + incidental, or consequential damages of any character arising as a + result of this License or out of the use or inability to use the + Work (including but not limited to damages for loss of goodwill, + work stoppage, computer failure or malfunction, or any and all + other commercial damages or losses), even if such Contributor + has been advised of the possibility of such damages. + + 9. Accepting Warranty or Additional Liability. While redistributing + the Work or Derivative Works thereof, You may choose to offer, + and charge a fee for, acceptance of support, warranty, indemnity, + or other liability obligations and/or rights consistent with this + License. However, in accepting such obligations, You may act only + on Your own behalf and on Your sole responsibility, not on behalf + of any other Contributor, and only if You agree to indemnify, + defend, and hold each Contributor harmless for any liability + incurred by, or claims asserted against, such Contributor by reason + of your accepting any such warranty or additional liability. + + END OF TERMS AND CONDITIONS + + APPENDIX: How to apply the Apache License to your work. + + To apply the Apache License to your work, attach the following + boilerplate notice, with the fields enclosed by brackets "[]" + replaced with your own identifying information. (Don't include + the brackets!) The text should be enclosed in the appropriate + comment syntax for the file format. We also recommend that a + file or class name and description of purpose be included on the + same "printed page" as the copyright notice for easier + identification within third-party archives. + + Copyright [yyyy] [name of copyright owner] + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. diff --git a/owl-bot-staging/google-cloud-secure_source_manager-v1/README.md b/owl-bot-staging/google-cloud-secure_source_manager-v1/README.md new file mode 100644 index 000000000000..f1c2f10d7f10 --- /dev/null +++ b/owl-bot-staging/google-cloud-secure_source_manager-v1/README.md @@ -0,0 +1,154 @@ +# Ruby Client for the Secure Source Manager V1 API + +Regionally deployed, single-tenant managed source code repository hosted on Google Cloud. + +Regionally deployed, single-tenant managed source code repository hosted on Google Cloud. + +https://github.com/googleapis/google-cloud-ruby + +This gem is a _versioned_ client. It provides basic client classes for a +specific version of the Secure Source Manager V1 API. Most users should consider using +the main client gem, +[google-cloud-secure_source_manager](https://rubygems.org/gems/google-cloud-secure_source_manager). +See the section below titled *Which client should I use?* for more information. + +## Installation + +``` +$ gem install google-cloud-secure_source_manager-v1 +``` + +## Before You Begin + +In order to use this library, you first need to go through the following steps: + +1. [Select or create a Cloud Platform project.](https://console.cloud.google.com/project) +1. [Enable billing for your project.](https://cloud.google.com/billing/docs/how-to/modify-project#enable_billing_for_a_project) +1. [Enable the API.](https://console.cloud.google.com/apis/library/securesourcemanager.googleapis.com) +1. [Set up authentication.](AUTHENTICATION.md) + +## Quick Start + +```ruby +require "google/cloud/secure_source_manager/v1" + +client = ::Google::Cloud::SecureSourceManager::V1::SecureSourceManager::Client.new +request = ::Google::Cloud::SecureSourceManager::V1::ListInstancesRequest.new # (request fields as keyword arguments...) +response = client.list_instances request +``` + +View the [Client Library Documentation](https://cloud.google.com/ruby/docs/reference/google-cloud-secure_source_manager-v1/latest) +for class and method documentation. + +See also the [Product Documentation](https://cloud.google.com/secure-source-manager/docs/overview) +for general usage information. + +## Debug Logging + +This library comes with opt-in Debug Logging that can help you troubleshoot +your application's integration with the API. When logging is activated, key +events such as requests and responses, along with data payloads and metadata +such as headers and client configuration, are logged to the standard error +stream. + +**WARNING:** Client Library Debug Logging includes your data payloads in +plaintext, which could include sensitive data such as PII for yourself or your +customers, private keys, or other security data that could be compromising if +leaked. Always practice good data hygiene with your application logs, and follow +the principle of least access. Google also recommends that Client Library Debug +Logging be enabled only temporarily during active debugging, and not used +permanently in production. + +To enable logging, set the environment variable `GOOGLE_SDK_RUBY_LOGGING_GEMS` +to the value `all`. Alternatively, you can set the value to a comma-delimited +list of client library gem names. This will select the default logging behavior, +which writes logs to the standard error stream. On a local workstation, this may +result in logs appearing on the console. When running on a Google Cloud hosting +service such as [Google Cloud Run](https://cloud.google.com/run), this generally +results in logs appearing alongside your application logs in the +[Google Cloud Logging](https://cloud.google.com/logging/) service. + +You can customize logging by modifying the `logger` configuration when +constructing a client object. For example: + +```ruby +require "google/cloud/secure_source_manager/v1" +require "logger" + +client = ::Google::Cloud::SecureSourceManager::V1::SecureSourceManager::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-secure_source_manager`, +and lower-level _versioned_ client libraries with names such as +`google-cloud-secure_source_manager-v1`. +_In most cases, you should install the main client._ + +### What's the difference between the main client and a versioned client? + +A _versioned client_ provides a basic set of data types and client classes for +a _single version_ of a specific service. (That is, for a service with multiple +versions, there might be a separate versioned client for each service version.) +Most versioned clients are written and maintained by a code generator. + +The _main client_ is designed to provide you with the _recommended_ client +interfaces for the service. There will be only one main client for any given +service, even a service with multiple versions. The main client includes +factory methods for constructing the client objects we recommend for most +users. In some cases, those will be classes provided by an underlying versioned +client; in other cases, they will be handwritten higher-level client objects +with additional capabilities, convenience methods, or best practices built in. +Generally, the main client will default to a recommended service version, +although in some cases you can override this if you need to talk to a specific +service version. + +### Why would I want to use the main client? + +We recommend that most users install the main client gem for a service. You can +identify this gem as the one _without_ a version in its name, e.g. +`google-cloud-secure_source_manager`. +The main client is recommended because it will embody the best practices for +accessing the service, and may also provide more convenient interfaces or +tighter integration into frameworks and third-party libraries. In addition, the +documentation and samples published by Google will generally demonstrate use of +the main client. + +### Why would I want to use a versioned client? + +You can use a versioned client if you are content with a possibly lower-level +class interface, you explicitly want to avoid features provided by the main +client, or you want to access a specific service version not be covered by the +main client. You can identify versioned client gems because the service version +is part of the name, e.g. `google-cloud-secure_source_manager-v1`. + +### What about the google-apis- clients? + +Client library gems with names that begin with `google-apis-` are based on an +older code generation technology. They talk to a REST/JSON backend (whereas +most modern clients talk to a [gRPC](https://grpc.io/) backend) and they may +not offer the same performance, features, and ease of use provided by more +modern clients. + +The `google-apis-` clients have wide coverage across Google services, so you +might need to use one if there is no modern client available for the service. +However, if a modern client is available, we generally recommend it over the +older `google-apis-` clients. diff --git a/owl-bot-staging/google-cloud-secure_source_manager-v1/Rakefile b/owl-bot-staging/google-cloud-secure_source_manager-v1/Rakefile new file mode 100644 index 000000000000..9fd2e0c76cc0 --- /dev/null +++ b/owl-bot-staging/google-cloud-secure_source_manager-v1/Rakefile @@ -0,0 +1,169 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +require "bundler/setup" +require "bundler/gem_tasks" + +require "rubocop/rake_task" +RuboCop::RakeTask.new + +require "rake/testtask" +desc "Run tests." +Rake::TestTask.new do |t| + t.libs << "test" + t.test_files = FileList["test/**/*_test.rb"] + t.warning = false +end + +desc "Runs the smoke tests." +Rake::TestTask.new :smoke_test do |t| + t.test_files = FileList["acceptance/**/*smoke_test.rb"] + t.warning = false +end + +# Acceptance tests +desc "Run the google-cloud-secure_source_manager-v1 acceptance tests." +task :acceptance, :project, :keyfile do |t, args| + project = args[:project] + project ||= + ENV["GOOGLE_CLOUD_TEST_PROJECT"] || + ENV["GCLOUD_TEST_PROJECT"] + keyfile = args[:keyfile] + keyfile ||= + ENV["GOOGLE_CLOUD_TEST_KEYFILE"] || + ENV["GCLOUD_TEST_KEYFILE"] + if keyfile + keyfile = File.read keyfile + else + keyfile ||= + ENV["GOOGLE_CLOUD_TEST_KEYFILE_JSON"] || + ENV["GCLOUD_TEST_KEYFILE_JSON"] + end + if project.nil? || keyfile.nil? + fail "You must provide a project and keyfile. e.g. rake acceptance[test123, /path/to/keyfile.json] or GOOGLE_CLOUD_TEST_PROJECT=test123 GOOGLE_CLOUD_TEST_KEYFILE=/path/to/keyfile.json rake acceptance" + end + require "google/cloud/secure_source_manager/v1/secure_source_manager/credentials" + ::Google::Cloud::SecureSourceManager::V1::SecureSourceManager::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-secure_source_manager-v1 gem has no acceptance tests." + end + end + + desc "Run acceptance cleanup." + task :cleanup do + end +end + +task :samples do + Rake::Task["samples:latest"].invoke +end + +namespace :samples do + task :latest do + if File.directory? "samples" + Dir.chdir "samples" do + Bundler.with_clean_env do + ENV["GOOGLE_CLOUD_SAMPLES_TEST"] = "not_master" + sh "bundle update" + sh "bundle exec rake test" + end + end + else + puts "The google-cloud-secure_source_manager-v1 gem has no samples to test." + end + end + + task :master do + if File.directory? "samples" + Dir.chdir "samples" do + Bundler.with_clean_env do + ENV["GOOGLE_CLOUD_SAMPLES_TEST"] = "master" + sh "bundle update" + sh "bundle exec rake test" + end + end + else + puts "The google-cloud-secure_source_manager-v1 gem has no samples to test." + end + end +end + +require "yard" +require "yard/rake/yardoc_task" +YARD::Rake::YardocTask.new do |y| + y.options << "--fail-on-warning" +end + +desc "Run yard-doctest example tests." +task :doctest do + puts "The google-cloud-secure_source_manager-v1 gem does not have doctest tests." +end + +desc "Run the CI build" +task :ci do + header "BUILDING google-cloud-secure_source_manager-v1" + header "google-cloud-secure_source_manager-v1 rubocop", "*" + Rake::Task[:rubocop].invoke + header "google-cloud-secure_source_manager-v1 yard", "*" + Rake::Task[:yard].invoke + header "google-cloud-secure_source_manager-v1 test", "*" + Rake::Task[:test].invoke +end + +namespace :ci do + desc "Run the CI build, with smoke tests." + task :smoke_test do + Rake::Task[:ci].invoke + header "google-cloud-secure_source_manager-v1 smoke_test", "*" + Rake::Task[:smoke_test].invoke + end + desc "Run the CI build, with acceptance tests." + task :acceptance do + Rake::Task[:ci].invoke + header "google-cloud-secure_source_manager-v1 acceptance", "*" + Rake::Task[:acceptance].invoke + end + task :a do + # This is a handy shortcut to save typing + Rake::Task["ci:acceptance"].invoke + end +end + +task default: :test + +def header str, token = "#" + line_length = str.length + 8 + puts "" + puts token * line_length + puts "#{token * 3} #{str} #{token * 3}" + puts token * line_length + puts "" +end diff --git a/owl-bot-staging/google-cloud-secure_source_manager-v1/gapic_metadata.json b/owl-bot-staging/google-cloud-secure_source_manager-v1/gapic_metadata.json new file mode 100644 index 000000000000..cb4bf595a281 --- /dev/null +++ b/owl-bot-staging/google-cloud-secure_source_manager-v1/gapic_metadata.json @@ -0,0 +1,278 @@ +{ + "schema": "1.0", + "comment": "This file maps proto services/RPCs to the corresponding library clients/methods", + "language": "ruby", + "protoPackage": "google.cloud.securesourcemanager.v1", + "libraryPackage": "::Google::Cloud::SecureSourceManager::V1", + "services": { + "SecureSourceManager": { + "clients": { + "grpc": { + "libraryClient": "::Google::Cloud::SecureSourceManager::V1::SecureSourceManager::Client", + "rpcs": { + "ListInstances": { + "methods": [ + "list_instances" + ] + }, + "GetInstance": { + "methods": [ + "get_instance" + ] + }, + "CreateInstance": { + "methods": [ + "create_instance" + ] + }, + "DeleteInstance": { + "methods": [ + "delete_instance" + ] + }, + "ListRepositories": { + "methods": [ + "list_repositories" + ] + }, + "GetRepository": { + "methods": [ + "get_repository" + ] + }, + "CreateRepository": { + "methods": [ + "create_repository" + ] + }, + "UpdateRepository": { + "methods": [ + "update_repository" + ] + }, + "DeleteRepository": { + "methods": [ + "delete_repository" + ] + }, + "ListHooks": { + "methods": [ + "list_hooks" + ] + }, + "GetHook": { + "methods": [ + "get_hook" + ] + }, + "CreateHook": { + "methods": [ + "create_hook" + ] + }, + "UpdateHook": { + "methods": [ + "update_hook" + ] + }, + "DeleteHook": { + "methods": [ + "delete_hook" + ] + }, + "GetIamPolicyRepo": { + "methods": [ + "get_iam_policy_repo" + ] + }, + "SetIamPolicyRepo": { + "methods": [ + "set_iam_policy_repo" + ] + }, + "TestIamPermissionsRepo": { + "methods": [ + "test_iam_permissions_repo" + ] + }, + "CreateBranchRule": { + "methods": [ + "create_branch_rule" + ] + }, + "ListBranchRules": { + "methods": [ + "list_branch_rules" + ] + }, + "GetBranchRule": { + "methods": [ + "get_branch_rule" + ] + }, + "UpdateBranchRule": { + "methods": [ + "update_branch_rule" + ] + }, + "DeleteBranchRule": { + "methods": [ + "delete_branch_rule" + ] + }, + "CreatePullRequest": { + "methods": [ + "create_pull_request" + ] + }, + "GetPullRequest": { + "methods": [ + "get_pull_request" + ] + }, + "ListPullRequests": { + "methods": [ + "list_pull_requests" + ] + }, + "UpdatePullRequest": { + "methods": [ + "update_pull_request" + ] + }, + "MergePullRequest": { + "methods": [ + "merge_pull_request" + ] + }, + "OpenPullRequest": { + "methods": [ + "open_pull_request" + ] + }, + "ClosePullRequest": { + "methods": [ + "close_pull_request" + ] + }, + "ListPullRequestFileDiffs": { + "methods": [ + "list_pull_request_file_diffs" + ] + }, + "FetchTree": { + "methods": [ + "fetch_tree" + ] + }, + "FetchBlob": { + "methods": [ + "fetch_blob" + ] + }, + "CreateIssue": { + "methods": [ + "create_issue" + ] + }, + "GetIssue": { + "methods": [ + "get_issue" + ] + }, + "ListIssues": { + "methods": [ + "list_issues" + ] + }, + "UpdateIssue": { + "methods": [ + "update_issue" + ] + }, + "DeleteIssue": { + "methods": [ + "delete_issue" + ] + }, + "OpenIssue": { + "methods": [ + "open_issue" + ] + }, + "CloseIssue": { + "methods": [ + "close_issue" + ] + }, + "GetPullRequestComment": { + "methods": [ + "get_pull_request_comment" + ] + }, + "ListPullRequestComments": { + "methods": [ + "list_pull_request_comments" + ] + }, + "CreatePullRequestComment": { + "methods": [ + "create_pull_request_comment" + ] + }, + "UpdatePullRequestComment": { + "methods": [ + "update_pull_request_comment" + ] + }, + "DeletePullRequestComment": { + "methods": [ + "delete_pull_request_comment" + ] + }, + "BatchCreatePullRequestComments": { + "methods": [ + "batch_create_pull_request_comments" + ] + }, + "ResolvePullRequestComments": { + "methods": [ + "resolve_pull_request_comments" + ] + }, + "UnresolvePullRequestComments": { + "methods": [ + "unresolve_pull_request_comments" + ] + }, + "CreateIssueComment": { + "methods": [ + "create_issue_comment" + ] + }, + "GetIssueComment": { + "methods": [ + "get_issue_comment" + ] + }, + "ListIssueComments": { + "methods": [ + "list_issue_comments" + ] + }, + "UpdateIssueComment": { + "methods": [ + "update_issue_comment" + ] + }, + "DeleteIssueComment": { + "methods": [ + "delete_issue_comment" + ] + } + } + } + } + } + } +} diff --git a/owl-bot-staging/google-cloud-secure_source_manager-v1/google-cloud-secure_source_manager-v1.gemspec b/owl-bot-staging/google-cloud-secure_source_manager-v1/google-cloud-secure_source_manager-v1.gemspec new file mode 100644 index 000000000000..fc9c70a2668c --- /dev/null +++ b/owl-bot-staging/google-cloud-secure_source_manager-v1/google-cloud-secure_source_manager-v1.gemspec @@ -0,0 +1,30 @@ +# -*- ruby -*- +# encoding: utf-8 + +require File.expand_path("lib/google/cloud/secure_source_manager/v1/version", __dir__) + +Gem::Specification.new do |gem| + gem.name = "google-cloud-secure_source_manager-v1" + gem.version = Google::Cloud::SecureSourceManager::V1::VERSION + + gem.authors = ["Google LLC"] + gem.email = "googleapis-packages@google.com" + gem.description = "Regionally deployed, single-tenant managed source code repository hosted on Google Cloud. Note that google-cloud-secure_source_manager-v1 is a version-specific client library. For most uses, we recommend installing the main client library google-cloud-secure_source_manager instead. See the readme for more details." + gem.summary = "Regionally deployed, single-tenant managed source code repository hosted on Google Cloud." + 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" + gem.add_dependency "google-iam-v1", "~> 1.3" +end diff --git a/owl-bot-staging/google-cloud-secure_source_manager-v1/lib/google-cloud-secure_source_manager-v1.rb b/owl-bot-staging/google-cloud-secure_source_manager-v1/lib/google-cloud-secure_source_manager-v1.rb new file mode 100644 index 000000000000..0de64e27e2a1 --- /dev/null +++ b/owl-bot-staging/google-cloud-secure_source_manager-v1/lib/google-cloud-secure_source_manager-v1.rb @@ -0,0 +1,21 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +# This gem does not autoload during Bundler.require. To load this gem, +# issue explicit require statements for the packages desired, e.g.: +# require "google/cloud/secure_source_manager/v1" diff --git a/owl-bot-staging/google-cloud-secure_source_manager-v1/lib/google/cloud/secure_source_manager/v1.rb b/owl-bot-staging/google-cloud-secure_source_manager-v1/lib/google/cloud/secure_source_manager/v1.rb new file mode 100644 index 000000000000..34a35e7b08eb --- /dev/null +++ b/owl-bot-staging/google-cloud-secure_source_manager-v1/lib/google/cloud/secure_source_manager/v1.rb @@ -0,0 +1,45 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +require "google/cloud/secure_source_manager/v1/secure_source_manager" +require "google/cloud/secure_source_manager/v1/version" + +module Google + module Cloud + module SecureSourceManager + ## + # API client module. + # + # @example Load this package, including all its services, and instantiate a gRPC client + # + # require "google/cloud/secure_source_manager/v1" + # client = ::Google::Cloud::SecureSourceManager::V1::SecureSourceManager::Client.new + # + # @example Load this package, including all its services, and instantiate a REST client + # + # require "google/cloud/secure_source_manager/v1" + # client = ::Google::Cloud::SecureSourceManager::V1::SecureSourceManager::Rest::Client.new + # + module V1 + end + end + end +end + +helper_path = ::File.join __dir__, "v1", "_helpers.rb" +require "google/cloud/secure_source_manager/v1/_helpers" if ::File.file? helper_path diff --git a/owl-bot-staging/google-cloud-secure_source_manager-v1/lib/google/cloud/secure_source_manager/v1/bindings_override.rb b/owl-bot-staging/google-cloud-secure_source_manager-v1/lib/google/cloud/secure_source_manager/v1/bindings_override.rb new file mode 100644 index 000000000000..31599cbdad14 --- /dev/null +++ b/owl-bot-staging/google-cloud-secure_source_manager-v1/lib/google/cloud/secure_source_manager/v1/bindings_override.rb @@ -0,0 +1,108 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +require "gapic/rest" + +module Google + module Cloud + module SecureSourceManager + ## + # @example Loading just the REST part of this package, including all its services, and instantiating a REST client + # + # require "google/cloud/secure_source_manager/v1/rest" + # client = ::Google::Cloud::SecureSourceManager::V1::SecureSourceManager::Rest::Client.new + # + module V1 + ## + # @private + # Initialize the mixin bindings configuration + # + def self.configure + @configure ||= begin + namespace = ["Google", "Cloud", "SecureSourceManager"] + parent_config = while namespace.any? + parent_name = namespace.join "::" + parent_const = const_get parent_name + break parent_const.configure if parent_const.respond_to? :configure + namespace.pop + end + + default_config = ::Gapic::Rest::HttpBindingOverrideConfiguration.new parent_config + default_config.bindings_override["google.cloud.location.Locations.GetLocation"] = [ + Gapic::Rest::GrpcTranscoder::HttpBinding.create_with_validation( + uri_method: :get, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/?$}, false] + ], + body: nil + ) + ] + default_config.bindings_override["google.cloud.location.Locations.ListLocations"] = [ + + Gapic::Rest::GrpcTranscoder::HttpBinding.create_with_validation( + uri_method: :get, + uri_template: "/v1/{name}/locations", + matches: [ + ["name", %r{^projects/[^/]+/?$}, false] + ], + body: nil + ) + ] + default_config.bindings_override["google.iam.v1.IAMPolicy.GetIamPolicy"] = [ + + Gapic::Rest::GrpcTranscoder::HttpBinding.create_with_validation( + uri_method: :get, + uri_template: "/v1/{resource}:getIamPolicy", + matches: [ + ["resource", %r{^projects/[^/]+/locations/[^/]+/instances/[^/]+/?$}, false] + ], + body: nil + ) + ] + default_config.bindings_override["google.iam.v1.IAMPolicy.SetIamPolicy"] = [ + + Gapic::Rest::GrpcTranscoder::HttpBinding.create_with_validation( + uri_method: :post, + uri_template: "/v1/{resource}:setIamPolicy", + matches: [ + ["resource", %r{^projects/[^/]+/locations/[^/]+/instances/[^/]+/?$}, false] + ], + body: "*" + ) + ] + default_config.bindings_override["google.iam.v1.IAMPolicy.TestIamPermissions"] = [ + + Gapic::Rest::GrpcTranscoder::HttpBinding.create_with_validation( + uri_method: :post, + uri_template: "/v1/{resource}:testIamPermissions", + matches: [ + ["resource", %r{^projects/[^/]+/locations/[^/]+/instances/[^/]+/?$}, false] + ], + body: "*" + ) + ] + default_config + end + yield @configure if block_given? + @configure + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-secure_source_manager-v1/lib/google/cloud/secure_source_manager/v1/rest.rb b/owl-bot-staging/google-cloud-secure_source_manager-v1/lib/google/cloud/secure_source_manager/v1/rest.rb new file mode 100644 index 000000000000..8696eba4fdff --- /dev/null +++ b/owl-bot-staging/google-cloud-secure_source_manager-v1/lib/google/cloud/secure_source_manager/v1/rest.rb @@ -0,0 +1,38 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +require "google/cloud/secure_source_manager/v1/secure_source_manager/rest" +require "google/cloud/secure_source_manager/v1/bindings_override" +require "google/cloud/secure_source_manager/v1/version" + +module Google + module Cloud + module SecureSourceManager + ## + # To load just the REST part of this package, including all its services, and instantiate a REST client: + # + # @example + # + # require "google/cloud/secure_source_manager/v1/rest" + # client = ::Google::Cloud::SecureSourceManager::V1::SecureSourceManager::Rest::Client.new + # + module V1 + end + end + end +end diff --git a/owl-bot-staging/google-cloud-secure_source_manager-v1/lib/google/cloud/secure_source_manager/v1/secure_source_manager.rb b/owl-bot-staging/google-cloud-secure_source_manager-v1/lib/google/cloud/secure_source_manager/v1/secure_source_manager.rb new file mode 100644 index 000000000000..b4982af54739 --- /dev/null +++ b/owl-bot-staging/google-cloud-secure_source_manager-v1/lib/google/cloud/secure_source_manager/v1/secure_source_manager.rb @@ -0,0 +1,58 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +require "gapic/common" +require "gapic/config" +require "gapic/config/method" + +require "google/cloud/secure_source_manager/v1/version" + +require "google/cloud/secure_source_manager/v1/secure_source_manager/credentials" +require "google/cloud/secure_source_manager/v1/secure_source_manager/paths" +require "google/cloud/secure_source_manager/v1/secure_source_manager/operations" +require "google/cloud/secure_source_manager/v1/secure_source_manager/client" +require "google/cloud/secure_source_manager/v1/secure_source_manager/rest" + +module Google + module Cloud + module SecureSourceManager + module V1 + ## + # Secure Source Manager API + # + # Access Secure Source Manager instances, resources, and repositories. + # + # @example Load this service and instantiate a gRPC client + # + # require "google/cloud/secure_source_manager/v1/secure_source_manager" + # client = ::Google::Cloud::SecureSourceManager::V1::SecureSourceManager::Client.new + # + # @example Load this service and instantiate a REST client + # + # require "google/cloud/secure_source_manager/v1/secure_source_manager/rest" + # client = ::Google::Cloud::SecureSourceManager::V1::SecureSourceManager::Rest::Client.new + # + module SecureSourceManager + end + end + end + end +end + +helper_path = ::File.join __dir__, "secure_source_manager", "helpers.rb" +require "google/cloud/secure_source_manager/v1/secure_source_manager/helpers" if ::File.file? helper_path diff --git a/owl-bot-staging/google-cloud-secure_source_manager-v1/lib/google/cloud/secure_source_manager/v1/secure_source_manager/client.rb b/owl-bot-staging/google-cloud-secure_source_manager-v1/lib/google/cloud/secure_source_manager/v1/secure_source_manager/client.rb new file mode 100644 index 000000000000..d9d6be8b3d2d --- /dev/null +++ b/owl-bot-staging/google-cloud-secure_source_manager-v1/lib/google/cloud/secure_source_manager/v1/secure_source_manager/client.rb @@ -0,0 +1,5877 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +require "google/cloud/errors" +require "google/cloud/securesourcemanager/v1/secure_source_manager_pb" +require "google/cloud/location" +require "google/iam/v1" + +module Google + module Cloud + module SecureSourceManager + module V1 + module SecureSourceManager + ## + # Client for the SecureSourceManager service. + # + # Secure Source Manager API + # + # Access Secure Source Manager instances, resources, and repositories. + # + class Client + # @private + API_VERSION = "" + + # @private + DEFAULT_ENDPOINT_TEMPLATE = "securesourcemanager.$UNIVERSE_DOMAIN$" + + include Paths + + # @private + attr_reader :secure_source_manager_stub + + ## + # Configure the SecureSourceManager Client class. + # + # See {::Google::Cloud::SecureSourceManager::V1::SecureSourceManager::Client::Configuration} + # for a description of the configuration fields. + # + # @example + # + # # Modify the configuration for all SecureSourceManager clients + # ::Google::Cloud::SecureSourceManager::V1::SecureSourceManager::Client.configure do |config| + # config.timeout = 10.0 + # end + # + # @yield [config] Configure the Client client. + # @yieldparam config [Client::Configuration] + # + # @return [Client::Configuration] + # + def self.configure + @configure ||= begin + namespace = ["Google", "Cloud", "SecureSourceManager", "V1"] + parent_config = while namespace.any? + parent_name = namespace.join "::" + parent_const = const_get parent_name + break parent_const.configure if parent_const.respond_to? :configure + namespace.pop + end + default_config = Client::Configuration.new parent_config + + default_config.rpcs.list_instances.timeout = 60.0 + default_config.rpcs.list_instances.retry_policy = { + initial_delay: 1.0, max_delay: 10.0, multiplier: 1.3, retry_codes: [14] + } + + default_config.rpcs.get_instance.timeout = 60.0 + default_config.rpcs.get_instance.retry_policy = { + initial_delay: 1.0, max_delay: 10.0, multiplier: 1.3, retry_codes: [14] + } + + default_config.rpcs.list_repositories.timeout = 60.0 + default_config.rpcs.list_repositories.retry_policy = { + initial_delay: 1.0, max_delay: 10.0, multiplier: 1.3, retry_codes: [14] + } + + default_config.rpcs.get_repository.timeout = 60.0 + default_config.rpcs.get_repository.retry_policy = { + initial_delay: 1.0, max_delay: 10.0, multiplier: 1.3, retry_codes: [14] + } + + default_config.rpcs.get_iam_policy_repo.timeout = 60.0 + default_config.rpcs.get_iam_policy_repo.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 SecureSourceManager Client instance. + # + # The configuration is set to the derived mode, meaning that values can be changed, + # but structural changes (adding new fields, etc.) are not allowed. Structural changes + # should be made on {Client.configure}. + # + # See {::Google::Cloud::SecureSourceManager::V1::SecureSourceManager::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 + @secure_source_manager_stub.universe_domain + end + + ## + # Create a new SecureSourceManager client object. + # + # @example + # + # # Create a client using the default configuration + # client = ::Google::Cloud::SecureSourceManager::V1::SecureSourceManager::Client.new + # + # # Create a client using a custom configuration + # client = ::Google::Cloud::SecureSourceManager::V1::SecureSourceManager::Client.new do |config| + # config.timeout = 10.0 + # end + # + # @yield [config] Configure the SecureSourceManager client. + # @yieldparam config [Client::Configuration] + # + def initialize + # These require statements are intentionally placed here to initialize + # the gRPC module only when it's required. + # See https://github.com/googleapis/toolkit/issues/446 + require "gapic/grpc" + require "google/cloud/securesourcemanager/v1/secure_source_manager_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 + + @secure_source_manager_stub = ::Gapic::ServiceStub.new( + ::Google::Cloud::SecureSourceManager::V1::SecureSourceManager::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 + ) + + @secure_source_manager_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 = @secure_source_manager_stub.endpoint + config.universe_domain = @secure_source_manager_stub.universe_domain + config.logger = @secure_source_manager_stub.logger if config.respond_to? :logger= + end + + @iam_policy_client = Google::Iam::V1::IAMPolicy::Client.new do |config| + config.credentials = credentials + config.quota_project = @quota_project_id + config.endpoint = @secure_source_manager_stub.endpoint + config.universe_domain = @secure_source_manager_stub.universe_domain + config.logger = @secure_source_manager_stub.logger if config.respond_to? :logger= + end + end + + ## + # Get the associated client for long-running operations. + # + # @return [::Google::Cloud::SecureSourceManager::V1::SecureSourceManager::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 + + ## + # Get the associated client for mix-in of the IAMPolicy. + # + # @return [Google::Iam::V1::IAMPolicy::Client] + # + attr_reader :iam_policy_client + + ## + # The logger used for request/response debug logging. + # + # @return [Logger] + # + def logger + @secure_source_manager_stub.logger + end + + # Service calls + + ## + # Lists Instances in a given project and location. + # + # @overload list_instances(request, options = nil) + # Pass arguments to `list_instances` via a request object, either of type + # {::Google::Cloud::SecureSourceManager::V1::ListInstancesRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::SecureSourceManager::V1::ListInstancesRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_instances(parent: nil, page_size: nil, page_token: nil, filter: nil, order_by: nil) + # Pass arguments to `list_instances` via keyword arguments. Note that at + # least one keyword argument is 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. Parent value for ListInstancesRequest. + # @param page_size [::Integer] + # Requested page size. Server may return fewer items than requested. + # If unspecified, server will pick an appropriate default. + # @param page_token [::String] + # A token identifying a page of results the server should return. + # @param filter [::String] + # Filter for filtering results. + # @param order_by [::String] + # Hint for how to order the results. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Gapic::PagedEnumerable<::Google::Cloud::SecureSourceManager::V1::Instance>] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Gapic::PagedEnumerable<::Google::Cloud::SecureSourceManager::V1::Instance>] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/secure_source_manager/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::SecureSourceManager::V1::SecureSourceManager::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::SecureSourceManager::V1::ListInstancesRequest.new + # + # # Call the list_instances method. + # result = client.list_instances request + # + # # The returned object is of type Gapic::PagedEnumerable. You can iterate + # # over elements, and API calls will be issued to fetch pages as needed. + # result.each do |item| + # # Each element is of type ::Google::Cloud::SecureSourceManager::V1::Instance. + # p item + # end + # + def list_instances request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::SecureSourceManager::V1::ListInstancesRequest + + # Converts hash 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_instances.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::SecureSourceManager::V1::VERSION + metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.parent + header_params["parent"] = request.parent + end + + request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") + metadata[:"x-goog-request-params"] ||= request_params_header + + options.apply_defaults timeout: @config.rpcs.list_instances.timeout, + metadata: metadata, + retry_policy: @config.rpcs.list_instances.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @secure_source_manager_stub.call_rpc :list_instances, request, options: options do |response, operation| + response = ::Gapic::PagedEnumerable.new @secure_source_manager_stub, :list_instances, request, response, operation, options + yield response, operation if block_given? + throw :response, response + end + rescue ::GRPC::BadStatus => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Gets details of a single instance. + # + # @overload get_instance(request, options = nil) + # Pass arguments to `get_instance` via a request object, either of type + # {::Google::Cloud::SecureSourceManager::V1::GetInstanceRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::SecureSourceManager::V1::GetInstanceRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_instance(name: nil) + # Pass arguments to `get_instance` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param name [::String] + # Required. Name of the resource. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Google::Cloud::SecureSourceManager::V1::Instance] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Google::Cloud::SecureSourceManager::V1::Instance] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/secure_source_manager/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::SecureSourceManager::V1::SecureSourceManager::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::SecureSourceManager::V1::GetInstanceRequest.new + # + # # Call the get_instance method. + # result = client.get_instance request + # + # # The returned object is of type Google::Cloud::SecureSourceManager::V1::Instance. + # p result + # + def get_instance request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::SecureSourceManager::V1::GetInstanceRequest + + # Converts hash 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_instance.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::SecureSourceManager::V1::VERSION + metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.name + header_params["name"] = request.name + end + + request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") + metadata[:"x-goog-request-params"] ||= request_params_header + + options.apply_defaults timeout: @config.rpcs.get_instance.timeout, + metadata: metadata, + retry_policy: @config.rpcs.get_instance.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @secure_source_manager_stub.call_rpc :get_instance, request, options: options do |response, operation| + yield response, operation if block_given? + end + rescue ::GRPC::BadStatus => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Creates a new instance in a given project and location. + # + # @overload create_instance(request, options = nil) + # Pass arguments to `create_instance` via a request object, either of type + # {::Google::Cloud::SecureSourceManager::V1::CreateInstanceRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::SecureSourceManager::V1::CreateInstanceRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_instance(parent: nil, instance_id: nil, instance: nil, request_id: nil) + # Pass arguments to `create_instance` via keyword arguments. Note that at + # least one keyword argument is 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. Value for parent. + # @param instance_id [::String] + # Required. ID of the instance to be created. + # @param instance [::Google::Cloud::SecureSourceManager::V1::Instance, ::Hash] + # Required. The resource being created. + # @param request_id [::String] + # Optional. An optional request ID to identify requests. Specify a unique + # request ID so that if you must retry your request, the server will know to + # ignore the request if it has already been completed. The server will + # guarantee that for at least 60 minutes since the first request. + # + # For example, consider a situation where you make an initial request and + # the request times out. If you make the request again with the same request + # ID, the server can check if original operation with the same request ID + # was received, and if so, will ignore the second request. This prevents + # clients from accidentally creating duplicate commitments. + # + # The request ID must be a valid UUID with the exception that zero UUID is + # not supported (00000000-0000-0000-0000-000000000000). + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Gapic::Operation] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Gapic::Operation] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/secure_source_manager/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::SecureSourceManager::V1::SecureSourceManager::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::SecureSourceManager::V1::CreateInstanceRequest.new + # + # # Call the create_instance method. + # result = client.create_instance 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_instance request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::SecureSourceManager::V1::CreateInstanceRequest + + # Converts hash 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_instance.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::SecureSourceManager::V1::VERSION + metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.parent + header_params["parent"] = request.parent + end + + request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") + metadata[:"x-goog-request-params"] ||= request_params_header + + options.apply_defaults timeout: @config.rpcs.create_instance.timeout, + metadata: metadata, + retry_policy: @config.rpcs.create_instance.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @secure_source_manager_stub.call_rpc :create_instance, 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 single instance. + # + # @overload delete_instance(request, options = nil) + # Pass arguments to `delete_instance` via a request object, either of type + # {::Google::Cloud::SecureSourceManager::V1::DeleteInstanceRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::SecureSourceManager::V1::DeleteInstanceRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_instance(name: nil, request_id: nil) + # Pass arguments to `delete_instance` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param name [::String] + # Required. Name of the resource. + # @param request_id [::String] + # Optional. An optional request ID to identify requests. Specify a unique + # request ID so that if you must retry your request, the server will know to + # ignore the request if it has already been completed. The server will + # guarantee that for at least 60 minutes after the first request. + # + # For example, consider a situation where you make an initial request and + # the request times out. If you make the request again with the same request + # ID, the server can check if original operation with the same request ID + # was received, and if so, will ignore the second request. This prevents + # clients from accidentally creating duplicate commitments. + # + # The request ID must be a valid UUID with the exception that zero UUID is + # not supported (00000000-0000-0000-0000-000000000000). + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Gapic::Operation] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Gapic::Operation] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/secure_source_manager/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::SecureSourceManager::V1::SecureSourceManager::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::SecureSourceManager::V1::DeleteInstanceRequest.new + # + # # Call the delete_instance method. + # result = client.delete_instance 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_instance request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::SecureSourceManager::V1::DeleteInstanceRequest + + # Converts hash 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_instance.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::SecureSourceManager::V1::VERSION + metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.name + header_params["name"] = request.name + end + + request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") + metadata[:"x-goog-request-params"] ||= request_params_header + + options.apply_defaults timeout: @config.rpcs.delete_instance.timeout, + metadata: metadata, + retry_policy: @config.rpcs.delete_instance.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @secure_source_manager_stub.call_rpc :delete_instance, 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 Repositories in a given project and location. + # + # The instance field is required in the query parameter for requests using + # the securesourcemanager.googleapis.com endpoint. + # + # @overload list_repositories(request, options = nil) + # Pass arguments to `list_repositories` via a request object, either of type + # {::Google::Cloud::SecureSourceManager::V1::ListRepositoriesRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::SecureSourceManager::V1::ListRepositoriesRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_repositories(parent: nil, page_size: nil, page_token: nil, filter: nil, instance: nil) + # Pass arguments to `list_repositories` via keyword arguments. Note that at + # least one keyword argument is 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. Parent value for ListRepositoriesRequest. + # @param page_size [::Integer] + # Optional. Requested page size. Server may return fewer items than + # requested. If unspecified, server will pick an appropriate default. + # @param page_token [::String] + # A token identifying a page of results the server should return. + # @param filter [::String] + # Optional. Filter results. + # @param instance [::String] + # Optional. The name of the instance in which the repository is hosted, + # formatted as + # `projects/{project_number}/locations/{location_id}/instances/{instance_id}`. + # When listing repositories via securesourcemanager.googleapis.com, this + # field is required. When listing repositories via *.sourcemanager.dev, this + # field is ignored. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Gapic::PagedEnumerable<::Google::Cloud::SecureSourceManager::V1::Repository>] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Gapic::PagedEnumerable<::Google::Cloud::SecureSourceManager::V1::Repository>] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/secure_source_manager/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::SecureSourceManager::V1::SecureSourceManager::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::SecureSourceManager::V1::ListRepositoriesRequest.new + # + # # Call the list_repositories method. + # result = client.list_repositories request + # + # # The returned object is of type Gapic::PagedEnumerable. You can iterate + # # over elements, and API calls will be issued to fetch pages as needed. + # result.each do |item| + # # Each element is of type ::Google::Cloud::SecureSourceManager::V1::Repository. + # p item + # end + # + def list_repositories request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::SecureSourceManager::V1::ListRepositoriesRequest + + # Converts hash 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_repositories.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::SecureSourceManager::V1::VERSION + metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.parent + header_params["parent"] = request.parent + end + + request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") + metadata[:"x-goog-request-params"] ||= request_params_header + + options.apply_defaults timeout: @config.rpcs.list_repositories.timeout, + metadata: metadata, + retry_policy: @config.rpcs.list_repositories.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @secure_source_manager_stub.call_rpc :list_repositories, request, options: options do |response, operation| + response = ::Gapic::PagedEnumerable.new @secure_source_manager_stub, :list_repositories, request, response, operation, options + yield response, operation if block_given? + throw :response, response + end + rescue ::GRPC::BadStatus => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Gets metadata of a repository. + # + # @overload get_repository(request, options = nil) + # Pass arguments to `get_repository` via a request object, either of type + # {::Google::Cloud::SecureSourceManager::V1::GetRepositoryRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::SecureSourceManager::V1::GetRepositoryRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_repository(name: nil) + # Pass arguments to `get_repository` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param name [::String] + # Required. Name of the repository to retrieve. + # The format is + # `projects/{project_number}/locations/{location_id}/repositories/{repository_id}`. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Google::Cloud::SecureSourceManager::V1::Repository] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Google::Cloud::SecureSourceManager::V1::Repository] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/secure_source_manager/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::SecureSourceManager::V1::SecureSourceManager::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::SecureSourceManager::V1::GetRepositoryRequest.new + # + # # Call the get_repository method. + # result = client.get_repository request + # + # # The returned object is of type Google::Cloud::SecureSourceManager::V1::Repository. + # p result + # + def get_repository request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::SecureSourceManager::V1::GetRepositoryRequest + + # Converts hash 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_repository.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::SecureSourceManager::V1::VERSION + metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.name + header_params["name"] = request.name + end + + request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") + metadata[:"x-goog-request-params"] ||= request_params_header + + options.apply_defaults timeout: @config.rpcs.get_repository.timeout, + metadata: metadata, + retry_policy: @config.rpcs.get_repository.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @secure_source_manager_stub.call_rpc :get_repository, request, options: options do |response, operation| + yield response, operation if block_given? + end + rescue ::GRPC::BadStatus => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Creates a new repository in a given project and location. + # + # The Repository.Instance field is required in the request body for requests + # using the securesourcemanager.googleapis.com endpoint. + # + # @overload create_repository(request, options = nil) + # Pass arguments to `create_repository` via a request object, either of type + # {::Google::Cloud::SecureSourceManager::V1::CreateRepositoryRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::SecureSourceManager::V1::CreateRepositoryRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_repository(parent: nil, repository: nil, repository_id: nil) + # Pass arguments to `create_repository` via keyword arguments. Note that at + # least one keyword argument is 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 project in which to create the repository. Values are of the + # form `projects/{project_number}/locations/{location_id}` + # @param repository [::Google::Cloud::SecureSourceManager::V1::Repository, ::Hash] + # Required. The resource being created. + # @param repository_id [::String] + # Required. The ID to use for the repository, which will become the final + # component of the repository's resource name. This value should be 4-63 + # characters, and valid characters are /[a-z][0-9]-/. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Gapic::Operation] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Gapic::Operation] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/secure_source_manager/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::SecureSourceManager::V1::SecureSourceManager::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::SecureSourceManager::V1::CreateRepositoryRequest.new + # + # # Call the create_repository method. + # result = client.create_repository 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_repository request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::SecureSourceManager::V1::CreateRepositoryRequest + + # Converts hash 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_repository.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::SecureSourceManager::V1::VERSION + metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.parent + header_params["parent"] = request.parent + end + + request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") + metadata[:"x-goog-request-params"] ||= request_params_header + + options.apply_defaults timeout: @config.rpcs.create_repository.timeout, + metadata: metadata, + retry_policy: @config.rpcs.create_repository.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @secure_source_manager_stub.call_rpc :create_repository, request, options: options do |response, operation| + response = ::Gapic::Operation.new response, @operations_client, options: options + yield response, operation if block_given? + throw :response, response + end + rescue ::GRPC::BadStatus => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Updates the metadata of a repository. + # + # @overload update_repository(request, options = nil) + # Pass arguments to `update_repository` via a request object, either of type + # {::Google::Cloud::SecureSourceManager::V1::UpdateRepositoryRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::SecureSourceManager::V1::UpdateRepositoryRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_repository(update_mask: nil, repository: nil, validate_only: nil) + # Pass arguments to `update_repository` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param update_mask [::Google::Protobuf::FieldMask, ::Hash] + # Optional. Field mask is used to specify the fields to be overwritten in the + # repository resource by the update. + # The fields specified in the update_mask are relative to the resource, not + # the full request. A field will be overwritten if it is in the mask. If the + # user does not provide a mask then all fields will be overwritten. + # @param repository [::Google::Cloud::SecureSourceManager::V1::Repository, ::Hash] + # Required. The repository being updated. + # @param validate_only [::Boolean] + # Optional. False by default. If set to true, the request is validated and + # the user is provided with an expected result, but no actual change is made. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Gapic::Operation] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Gapic::Operation] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/secure_source_manager/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::SecureSourceManager::V1::SecureSourceManager::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::SecureSourceManager::V1::UpdateRepositoryRequest.new + # + # # Call the update_repository method. + # result = client.update_repository 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_repository request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::SecureSourceManager::V1::UpdateRepositoryRequest + + # Converts hash 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_repository.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::SecureSourceManager::V1::VERSION + metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.repository&.name + header_params["repository.name"] = request.repository.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_repository.timeout, + metadata: metadata, + retry_policy: @config.rpcs.update_repository.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @secure_source_manager_stub.call_rpc :update_repository, 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 Repository. + # + # @overload delete_repository(request, options = nil) + # Pass arguments to `delete_repository` via a request object, either of type + # {::Google::Cloud::SecureSourceManager::V1::DeleteRepositoryRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::SecureSourceManager::V1::DeleteRepositoryRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_repository(name: nil, allow_missing: nil) + # Pass arguments to `delete_repository` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param name [::String] + # Required. Name of the repository to delete. + # The format is + # `projects/{project_number}/locations/{location_id}/repositories/{repository_id}`. + # @param allow_missing [::Boolean] + # Optional. If set to true, and the repository is not found, the request will + # succeed but no action will be taken on the server. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Gapic::Operation] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Gapic::Operation] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/secure_source_manager/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::SecureSourceManager::V1::SecureSourceManager::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::SecureSourceManager::V1::DeleteRepositoryRequest.new + # + # # Call the delete_repository method. + # result = client.delete_repository 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_repository request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::SecureSourceManager::V1::DeleteRepositoryRequest + + # Converts hash 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_repository.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::SecureSourceManager::V1::VERSION + metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.name + header_params["name"] = request.name + end + + request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") + metadata[:"x-goog-request-params"] ||= request_params_header + + options.apply_defaults timeout: @config.rpcs.delete_repository.timeout, + metadata: metadata, + retry_policy: @config.rpcs.delete_repository.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @secure_source_manager_stub.call_rpc :delete_repository, 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 hooks in a given repository. + # + # @overload list_hooks(request, options = nil) + # Pass arguments to `list_hooks` via a request object, either of type + # {::Google::Cloud::SecureSourceManager::V1::ListHooksRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::SecureSourceManager::V1::ListHooksRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_hooks(parent: nil, page_size: nil, page_token: nil) + # Pass arguments to `list_hooks` via keyword arguments. Note that at + # least one keyword argument is 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. Parent value for ListHooksRequest. + # @param page_size [::Integer] + # Optional. Requested page size. Server may return fewer items than + # requested. If unspecified, server will pick an appropriate default. + # @param page_token [::String] + # Optional. A token identifying a page of results the server should return. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Gapic::PagedEnumerable<::Google::Cloud::SecureSourceManager::V1::Hook>] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Gapic::PagedEnumerable<::Google::Cloud::SecureSourceManager::V1::Hook>] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/secure_source_manager/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::SecureSourceManager::V1::SecureSourceManager::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::SecureSourceManager::V1::ListHooksRequest.new + # + # # Call the list_hooks method. + # result = client.list_hooks request + # + # # The returned object is of type Gapic::PagedEnumerable. You can iterate + # # over elements, and API calls will be issued to fetch pages as needed. + # result.each do |item| + # # Each element is of type ::Google::Cloud::SecureSourceManager::V1::Hook. + # p item + # end + # + def list_hooks request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::SecureSourceManager::V1::ListHooksRequest + + # Converts hash 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_hooks.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::SecureSourceManager::V1::VERSION + metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.parent + header_params["parent"] = request.parent + end + + request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") + metadata[:"x-goog-request-params"] ||= request_params_header + + options.apply_defaults timeout: @config.rpcs.list_hooks.timeout, + metadata: metadata, + retry_policy: @config.rpcs.list_hooks.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @secure_source_manager_stub.call_rpc :list_hooks, request, options: options do |response, operation| + response = ::Gapic::PagedEnumerable.new @secure_source_manager_stub, :list_hooks, request, response, operation, options + yield response, operation if block_given? + throw :response, response + end + rescue ::GRPC::BadStatus => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Gets metadata of a hook. + # + # @overload get_hook(request, options = nil) + # Pass arguments to `get_hook` via a request object, either of type + # {::Google::Cloud::SecureSourceManager::V1::GetHookRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::SecureSourceManager::V1::GetHookRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_hook(name: nil) + # Pass arguments to `get_hook` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param name [::String] + # Required. Name of the hook to retrieve. + # The format is + # `projects/{project_number}/locations/{location_id}/repositories/{repository_id}/hooks/{hook_id}`. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Google::Cloud::SecureSourceManager::V1::Hook] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Google::Cloud::SecureSourceManager::V1::Hook] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/secure_source_manager/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::SecureSourceManager::V1::SecureSourceManager::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::SecureSourceManager::V1::GetHookRequest.new + # + # # Call the get_hook method. + # result = client.get_hook request + # + # # The returned object is of type Google::Cloud::SecureSourceManager::V1::Hook. + # p result + # + def get_hook request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::SecureSourceManager::V1::GetHookRequest + + # Converts hash 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_hook.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::SecureSourceManager::V1::VERSION + metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.name + header_params["name"] = request.name + end + + request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") + metadata[:"x-goog-request-params"] ||= request_params_header + + options.apply_defaults timeout: @config.rpcs.get_hook.timeout, + metadata: metadata, + retry_policy: @config.rpcs.get_hook.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @secure_source_manager_stub.call_rpc :get_hook, request, options: options do |response, operation| + yield response, operation if block_given? + end + rescue ::GRPC::BadStatus => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Creates a new hook in a given repository. + # + # @overload create_hook(request, options = nil) + # Pass arguments to `create_hook` via a request object, either of type + # {::Google::Cloud::SecureSourceManager::V1::CreateHookRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::SecureSourceManager::V1::CreateHookRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_hook(parent: nil, hook: nil, hook_id: nil) + # Pass arguments to `create_hook` via keyword arguments. Note that at + # least one keyword argument is 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 repository in which to create the hook. Values are of the + # form + # `projects/{project_number}/locations/{location_id}/repositories/{repository_id}` + # @param hook [::Google::Cloud::SecureSourceManager::V1::Hook, ::Hash] + # Required. The resource being created. + # @param hook_id [::String] + # Required. The ID to use for the hook, which will become the final component + # of the hook's resource name. This value restricts to lower-case letters, + # numbers, and hyphen, with the first character a letter, the last a letter + # or a number, and a 63 character maximum. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Gapic::Operation] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Gapic::Operation] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/secure_source_manager/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::SecureSourceManager::V1::SecureSourceManager::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::SecureSourceManager::V1::CreateHookRequest.new + # + # # Call the create_hook method. + # result = client.create_hook 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_hook request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::SecureSourceManager::V1::CreateHookRequest + + # Converts hash 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_hook.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::SecureSourceManager::V1::VERSION + metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.parent + header_params["parent"] = request.parent + end + + request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") + metadata[:"x-goog-request-params"] ||= request_params_header + + options.apply_defaults timeout: @config.rpcs.create_hook.timeout, + metadata: metadata, + retry_policy: @config.rpcs.create_hook.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @secure_source_manager_stub.call_rpc :create_hook, request, options: options do |response, operation| + response = ::Gapic::Operation.new response, @operations_client, options: options + yield response, operation if block_given? + throw :response, response + end + rescue ::GRPC::BadStatus => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Updates the metadata of a hook. + # + # @overload update_hook(request, options = nil) + # Pass arguments to `update_hook` via a request object, either of type + # {::Google::Cloud::SecureSourceManager::V1::UpdateHookRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::SecureSourceManager::V1::UpdateHookRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_hook(update_mask: nil, hook: nil) + # Pass arguments to `update_hook` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param update_mask [::Google::Protobuf::FieldMask, ::Hash] + # Required. Field mask is used to specify the fields to be overwritten in the + # hook resource by the update. + # The fields specified in the update_mask are relative to the resource, not + # the full request. A field will be overwritten if it is in the mask. + # The special value "*" means full replacement. + # @param hook [::Google::Cloud::SecureSourceManager::V1::Hook, ::Hash] + # Required. The hook being updated. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Gapic::Operation] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Gapic::Operation] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/secure_source_manager/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::SecureSourceManager::V1::SecureSourceManager::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::SecureSourceManager::V1::UpdateHookRequest.new + # + # # Call the update_hook method. + # result = client.update_hook 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_hook request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::SecureSourceManager::V1::UpdateHookRequest + + # Converts hash 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_hook.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::SecureSourceManager::V1::VERSION + metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.hook&.name + header_params["hook.name"] = request.hook.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_hook.timeout, + metadata: metadata, + retry_policy: @config.rpcs.update_hook.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @secure_source_manager_stub.call_rpc :update_hook, 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 Hook. + # + # @overload delete_hook(request, options = nil) + # Pass arguments to `delete_hook` via a request object, either of type + # {::Google::Cloud::SecureSourceManager::V1::DeleteHookRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::SecureSourceManager::V1::DeleteHookRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_hook(name: nil) + # Pass arguments to `delete_hook` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param name [::String] + # Required. Name of the hook to delete. + # The format is + # `projects/{project_number}/locations/{location_id}/repositories/{repository_id}/hooks/{hook_id}`. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Gapic::Operation] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Gapic::Operation] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/secure_source_manager/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::SecureSourceManager::V1::SecureSourceManager::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::SecureSourceManager::V1::DeleteHookRequest.new + # + # # Call the delete_hook method. + # result = client.delete_hook 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_hook request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::SecureSourceManager::V1::DeleteHookRequest + + # Converts hash 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_hook.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::SecureSourceManager::V1::VERSION + metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.name + header_params["name"] = request.name + end + + request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") + metadata[:"x-goog-request-params"] ||= request_params_header + + options.apply_defaults timeout: @config.rpcs.delete_hook.timeout, + metadata: metadata, + retry_policy: @config.rpcs.delete_hook.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @secure_source_manager_stub.call_rpc :delete_hook, 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 + + ## + # Get IAM policy for a repository. + # + # @overload get_iam_policy_repo(request, options = nil) + # Pass arguments to `get_iam_policy_repo` via a request object, either of type + # {::Google::Iam::V1::GetIamPolicyRequest} or an equivalent Hash. + # + # @param request [::Google::Iam::V1::GetIamPolicyRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. + # + # @overload get_iam_policy_repo(resource: nil, options: nil) + # Pass arguments to `get_iam_policy_repo` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param resource [::String] + # REQUIRED: The resource for which the policy is being requested. + # See the operation documentation for the appropriate value for this field. + # @param options [::Google::Iam::V1::GetPolicyOptions, ::Hash] + # OPTIONAL: A `GetPolicyOptions` object for specifying options to + # `GetIamPolicy`. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Google::Iam::V1::Policy] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Google::Iam::V1::Policy] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/secure_source_manager/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::SecureSourceManager::V1::SecureSourceManager::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Iam::V1::GetIamPolicyRequest.new + # + # # Call the get_iam_policy_repo method. + # result = client.get_iam_policy_repo request + # + # # The returned object is of type Google::Iam::V1::Policy. + # p result + # + def get_iam_policy_repo request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Iam::V1::GetIamPolicyRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + metadata = @config.rpcs.get_iam_policy_repo.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::SecureSourceManager::V1::VERSION + metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.resource + header_params["resource"] = request.resource + end + + request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") + metadata[:"x-goog-request-params"] ||= request_params_header + + options.apply_defaults timeout: @config.rpcs.get_iam_policy_repo.timeout, + metadata: metadata, + retry_policy: @config.rpcs.get_iam_policy_repo.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @secure_source_manager_stub.call_rpc :get_iam_policy_repo, 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 + + ## + # Set IAM policy on a repository. + # + # @overload set_iam_policy_repo(request, options = nil) + # Pass arguments to `set_iam_policy_repo` via a request object, either of type + # {::Google::Iam::V1::SetIamPolicyRequest} or an equivalent Hash. + # + # @param request [::Google::Iam::V1::SetIamPolicyRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. + # + # @overload set_iam_policy_repo(resource: nil, policy: nil, update_mask: nil) + # Pass arguments to `set_iam_policy_repo` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param resource [::String] + # REQUIRED: The resource for which the policy is being specified. + # See the operation documentation for the appropriate value for this field. + # @param policy [::Google::Iam::V1::Policy, ::Hash] + # REQUIRED: The complete policy to be applied to the `resource`. The size of + # the policy is limited to a few 10s of KB. An empty policy is a + # valid policy but certain Cloud Platform services (such as Projects) + # might reject them. + # @param update_mask [::Google::Protobuf::FieldMask, ::Hash] + # OPTIONAL: A FieldMask specifying which fields of the policy to modify. Only + # the fields in the mask will be modified. If no mask is provided, the + # following default mask is used: + # + # `paths: "bindings, etag"` + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Google::Iam::V1::Policy] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Google::Iam::V1::Policy] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/secure_source_manager/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::SecureSourceManager::V1::SecureSourceManager::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Iam::V1::SetIamPolicyRequest.new + # + # # Call the set_iam_policy_repo method. + # result = client.set_iam_policy_repo request + # + # # The returned object is of type Google::Iam::V1::Policy. + # p result + # + def set_iam_policy_repo request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Iam::V1::SetIamPolicyRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + metadata = @config.rpcs.set_iam_policy_repo.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::SecureSourceManager::V1::VERSION + metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.resource + header_params["resource"] = request.resource + end + + request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") + metadata[:"x-goog-request-params"] ||= request_params_header + + options.apply_defaults timeout: @config.rpcs.set_iam_policy_repo.timeout, + metadata: metadata, + retry_policy: @config.rpcs.set_iam_policy_repo.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @secure_source_manager_stub.call_rpc :set_iam_policy_repo, 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 + + ## + # Test IAM permissions on a repository. + # IAM permission checks are not required on this method. + # + # @overload test_iam_permissions_repo(request, options = nil) + # Pass arguments to `test_iam_permissions_repo` via a request object, either of type + # {::Google::Iam::V1::TestIamPermissionsRequest} or an equivalent Hash. + # + # @param request [::Google::Iam::V1::TestIamPermissionsRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. + # + # @overload test_iam_permissions_repo(resource: nil, permissions: nil) + # Pass arguments to `test_iam_permissions_repo` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param resource [::String] + # REQUIRED: The resource for which the policy detail is being requested. + # See the operation documentation for the appropriate value for this field. + # @param permissions [::Array<::String>] + # The set of permissions to check for the `resource`. Permissions with + # wildcards (such as '*' or 'storage.*') are not allowed. For more + # information see + # [IAM Overview](https://cloud.google.com/iam/docs/overview#permissions). + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Google::Iam::V1::TestIamPermissionsResponse] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Google::Iam::V1::TestIamPermissionsResponse] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/secure_source_manager/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::SecureSourceManager::V1::SecureSourceManager::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Iam::V1::TestIamPermissionsRequest.new + # + # # Call the test_iam_permissions_repo method. + # result = client.test_iam_permissions_repo request + # + # # The returned object is of type Google::Iam::V1::TestIamPermissionsResponse. + # p result + # + def test_iam_permissions_repo request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Iam::V1::TestIamPermissionsRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + metadata = @config.rpcs.test_iam_permissions_repo.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::SecureSourceManager::V1::VERSION + metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.resource + header_params["resource"] = request.resource + end + + request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") + metadata[:"x-goog-request-params"] ||= request_params_header + + options.apply_defaults timeout: @config.rpcs.test_iam_permissions_repo.timeout, + metadata: metadata, + retry_policy: @config.rpcs.test_iam_permissions_repo.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @secure_source_manager_stub.call_rpc :test_iam_permissions_repo, 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 + + ## + # CreateBranchRule creates a branch rule in a given repository. + # + # @overload create_branch_rule(request, options = nil) + # Pass arguments to `create_branch_rule` via a request object, either of type + # {::Google::Cloud::SecureSourceManager::V1::CreateBranchRuleRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::SecureSourceManager::V1::CreateBranchRuleRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_branch_rule(parent: nil, branch_rule: nil, branch_rule_id: nil) + # Pass arguments to `create_branch_rule` via keyword arguments. Note that at + # least one keyword argument is 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] + # @param branch_rule [::Google::Cloud::SecureSourceManager::V1::BranchRule, ::Hash] + # @param branch_rule_id [::String] + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Gapic::Operation] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Gapic::Operation] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/secure_source_manager/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::SecureSourceManager::V1::SecureSourceManager::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::SecureSourceManager::V1::CreateBranchRuleRequest.new + # + # # Call the create_branch_rule method. + # result = client.create_branch_rule 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_branch_rule request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::SecureSourceManager::V1::CreateBranchRuleRequest + + # Converts hash 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_branch_rule.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::SecureSourceManager::V1::VERSION + metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.parent + header_params["parent"] = request.parent + end + + request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") + metadata[:"x-goog-request-params"] ||= request_params_header + + options.apply_defaults timeout: @config.rpcs.create_branch_rule.timeout, + metadata: metadata, + retry_policy: @config.rpcs.create_branch_rule.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @secure_source_manager_stub.call_rpc :create_branch_rule, 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 + + ## + # ListBranchRules lists branch rules in a given repository. + # + # @overload list_branch_rules(request, options = nil) + # Pass arguments to `list_branch_rules` via a request object, either of type + # {::Google::Cloud::SecureSourceManager::V1::ListBranchRulesRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::SecureSourceManager::V1::ListBranchRulesRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_branch_rules(parent: nil, page_size: nil, page_token: nil) + # Pass arguments to `list_branch_rules` via keyword arguments. Note that at + # least one keyword argument is 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] + # @param page_size [::Integer] + # @param page_token [::String] + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Gapic::PagedEnumerable<::Google::Cloud::SecureSourceManager::V1::BranchRule>] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Gapic::PagedEnumerable<::Google::Cloud::SecureSourceManager::V1::BranchRule>] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/secure_source_manager/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::SecureSourceManager::V1::SecureSourceManager::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::SecureSourceManager::V1::ListBranchRulesRequest.new + # + # # Call the list_branch_rules method. + # result = client.list_branch_rules request + # + # # The returned object is of type Gapic::PagedEnumerable. You can iterate + # # over elements, and API calls will be issued to fetch pages as needed. + # result.each do |item| + # # Each element is of type ::Google::Cloud::SecureSourceManager::V1::BranchRule. + # p item + # end + # + def list_branch_rules request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::SecureSourceManager::V1::ListBranchRulesRequest + + # Converts hash 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_branch_rules.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::SecureSourceManager::V1::VERSION + metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.parent + header_params["parent"] = request.parent + end + + request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") + metadata[:"x-goog-request-params"] ||= request_params_header + + options.apply_defaults timeout: @config.rpcs.list_branch_rules.timeout, + metadata: metadata, + retry_policy: @config.rpcs.list_branch_rules.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @secure_source_manager_stub.call_rpc :list_branch_rules, request, options: options do |response, operation| + response = ::Gapic::PagedEnumerable.new @secure_source_manager_stub, :list_branch_rules, 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 + + ## + # GetBranchRule gets a branch rule. + # + # @overload get_branch_rule(request, options = nil) + # Pass arguments to `get_branch_rule` via a request object, either of type + # {::Google::Cloud::SecureSourceManager::V1::GetBranchRuleRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::SecureSourceManager::V1::GetBranchRuleRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_branch_rule(name: nil) + # Pass arguments to `get_branch_rule` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param name [::String] + # Required. Name of the repository to retrieve. + # The format is + # `projects/{project}/locations/{location}/repositories/{repository}/branchRules/{branch_rule}`. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Google::Cloud::SecureSourceManager::V1::BranchRule] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Google::Cloud::SecureSourceManager::V1::BranchRule] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/secure_source_manager/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::SecureSourceManager::V1::SecureSourceManager::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::SecureSourceManager::V1::GetBranchRuleRequest.new + # + # # Call the get_branch_rule method. + # result = client.get_branch_rule request + # + # # The returned object is of type Google::Cloud::SecureSourceManager::V1::BranchRule. + # p result + # + def get_branch_rule request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::SecureSourceManager::V1::GetBranchRuleRequest + + # Converts hash 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_branch_rule.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::SecureSourceManager::V1::VERSION + metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.name + header_params["name"] = request.name + end + + request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") + metadata[:"x-goog-request-params"] ||= request_params_header + + options.apply_defaults timeout: @config.rpcs.get_branch_rule.timeout, + metadata: metadata, + retry_policy: @config.rpcs.get_branch_rule.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @secure_source_manager_stub.call_rpc :get_branch_rule, 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 + + ## + # UpdateBranchRule updates a branch rule. + # + # @overload update_branch_rule(request, options = nil) + # Pass arguments to `update_branch_rule` via a request object, either of type + # {::Google::Cloud::SecureSourceManager::V1::UpdateBranchRuleRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::SecureSourceManager::V1::UpdateBranchRuleRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_branch_rule(branch_rule: nil, validate_only: nil, update_mask: nil) + # Pass arguments to `update_branch_rule` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param branch_rule [::Google::Cloud::SecureSourceManager::V1::BranchRule, ::Hash] + # @param validate_only [::Boolean] + # Optional. If set, validate the request and preview the review, but do not + # actually post it. (https://google.aip.dev/163, for declarative friendly) + # @param update_mask [::Google::Protobuf::FieldMask, ::Hash] + # Required. Field mask is used to specify the fields to be overwritten in the + # branchRule resource by the update. + # The fields specified in the update_mask are relative to the resource, not + # the full request. A field will be overwritten if it is in the mask. + # The special value "*" means full replacement. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Gapic::Operation] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Gapic::Operation] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/secure_source_manager/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::SecureSourceManager::V1::SecureSourceManager::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::SecureSourceManager::V1::UpdateBranchRuleRequest.new + # + # # Call the update_branch_rule method. + # result = client.update_branch_rule 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_branch_rule request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::SecureSourceManager::V1::UpdateBranchRuleRequest + + # Converts hash 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_branch_rule.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::SecureSourceManager::V1::VERSION + metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.branch_rule&.name + header_params["branch_rule.name"] = request.branch_rule.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_branch_rule.timeout, + metadata: metadata, + retry_policy: @config.rpcs.update_branch_rule.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @secure_source_manager_stub.call_rpc :update_branch_rule, 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 + + ## + # DeleteBranchRule deletes a branch rule. + # + # @overload delete_branch_rule(request, options = nil) + # Pass arguments to `delete_branch_rule` via a request object, either of type + # {::Google::Cloud::SecureSourceManager::V1::DeleteBranchRuleRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::SecureSourceManager::V1::DeleteBranchRuleRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_branch_rule(name: nil, allow_missing: nil) + # Pass arguments to `delete_branch_rule` via keyword arguments. Note that at + # least one keyword argument is 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] + # @param allow_missing [::Boolean] + # Optional. If set to true, and the branch rule is not found, the request + # will succeed but no action will be taken on the server. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Gapic::Operation] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Gapic::Operation] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/secure_source_manager/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::SecureSourceManager::V1::SecureSourceManager::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::SecureSourceManager::V1::DeleteBranchRuleRequest.new + # + # # Call the delete_branch_rule method. + # result = client.delete_branch_rule 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_branch_rule request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::SecureSourceManager::V1::DeleteBranchRuleRequest + + # Converts hash 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_branch_rule.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::SecureSourceManager::V1::VERSION + metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.name + header_params["name"] = request.name + end + + request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") + metadata[:"x-goog-request-params"] ||= request_params_header + + options.apply_defaults timeout: @config.rpcs.delete_branch_rule.timeout, + metadata: metadata, + retry_policy: @config.rpcs.delete_branch_rule.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @secure_source_manager_stub.call_rpc :delete_branch_rule, 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 + + ## + # Creates a pull request. + # + # @overload create_pull_request(request, options = nil) + # Pass arguments to `create_pull_request` via a request object, either of type + # {::Google::Cloud::SecureSourceManager::V1::CreatePullRequestRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::SecureSourceManager::V1::CreatePullRequestRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_pull_request(parent: nil, pull_request: nil) + # Pass arguments to `create_pull_request` via keyword arguments. Note that at + # least one keyword argument is 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 repository that the pull request is created from. Format: + # `projects/{project_number}/locations/{location_id}/repositories/{repository_id}` + # @param pull_request [::Google::Cloud::SecureSourceManager::V1::PullRequest, ::Hash] + # Required. The pull request to create. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Gapic::Operation] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Gapic::Operation] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/secure_source_manager/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::SecureSourceManager::V1::SecureSourceManager::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::SecureSourceManager::V1::CreatePullRequestRequest.new + # + # # Call the create_pull_request method. + # result = client.create_pull_request 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_pull_request request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::SecureSourceManager::V1::CreatePullRequestRequest + + # Converts hash 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_pull_request.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::SecureSourceManager::V1::VERSION + metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.parent + header_params["parent"] = request.parent + end + + request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") + metadata[:"x-goog-request-params"] ||= request_params_header + + options.apply_defaults timeout: @config.rpcs.create_pull_request.timeout, + metadata: metadata, + retry_policy: @config.rpcs.create_pull_request.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @secure_source_manager_stub.call_rpc :create_pull_request, 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 pull request. + # + # @overload get_pull_request(request, options = nil) + # Pass arguments to `get_pull_request` via a request object, either of type + # {::Google::Cloud::SecureSourceManager::V1::GetPullRequestRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::SecureSourceManager::V1::GetPullRequestRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_pull_request(name: nil) + # Pass arguments to `get_pull_request` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param name [::String] + # Required. Name of the pull request to retrieve. + # The format is + # `projects/{project}/locations/{location}/repositories/{repository}/pullRequests/{pull_request}`. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Google::Cloud::SecureSourceManager::V1::PullRequest] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Google::Cloud::SecureSourceManager::V1::PullRequest] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/secure_source_manager/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::SecureSourceManager::V1::SecureSourceManager::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::SecureSourceManager::V1::GetPullRequestRequest.new + # + # # Call the get_pull_request method. + # result = client.get_pull_request request + # + # # The returned object is of type Google::Cloud::SecureSourceManager::V1::PullRequest. + # p result + # + def get_pull_request request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::SecureSourceManager::V1::GetPullRequestRequest + + # Converts hash 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_pull_request.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::SecureSourceManager::V1::VERSION + metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.name + header_params["name"] = request.name + end + + request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") + metadata[:"x-goog-request-params"] ||= request_params_header + + options.apply_defaults timeout: @config.rpcs.get_pull_request.timeout, + metadata: metadata, + retry_policy: @config.rpcs.get_pull_request.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @secure_source_manager_stub.call_rpc :get_pull_request, request, options: options do |response, operation| + yield response, operation if block_given? + end + rescue ::GRPC::BadStatus => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Lists pull requests in a repository. + # + # @overload list_pull_requests(request, options = nil) + # Pass arguments to `list_pull_requests` via a request object, either of type + # {::Google::Cloud::SecureSourceManager::V1::ListPullRequestsRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::SecureSourceManager::V1::ListPullRequestsRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_pull_requests(parent: nil, page_size: nil, page_token: nil) + # Pass arguments to `list_pull_requests` via keyword arguments. Note that at + # least one keyword argument is 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 repository in which to list pull requests. Format: + # `projects/{project_number}/locations/{location_id}/repositories/{repository_id}` + # @param page_size [::Integer] + # Optional. Requested page size. Server may return fewer items than + # requested. If unspecified, server will pick an appropriate default. + # @param page_token [::String] + # Optional. A token identifying a page of results the server should return. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Gapic::PagedEnumerable<::Google::Cloud::SecureSourceManager::V1::PullRequest>] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Gapic::PagedEnumerable<::Google::Cloud::SecureSourceManager::V1::PullRequest>] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/secure_source_manager/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::SecureSourceManager::V1::SecureSourceManager::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::SecureSourceManager::V1::ListPullRequestsRequest.new + # + # # Call the list_pull_requests method. + # result = client.list_pull_requests request + # + # # The returned object is of type Gapic::PagedEnumerable. You can iterate + # # over elements, and API calls will be issued to fetch pages as needed. + # result.each do |item| + # # Each element is of type ::Google::Cloud::SecureSourceManager::V1::PullRequest. + # p item + # end + # + def list_pull_requests request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::SecureSourceManager::V1::ListPullRequestsRequest + + # Converts hash 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_pull_requests.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::SecureSourceManager::V1::VERSION + metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.parent + header_params["parent"] = request.parent + end + + request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") + metadata[:"x-goog-request-params"] ||= request_params_header + + options.apply_defaults timeout: @config.rpcs.list_pull_requests.timeout, + metadata: metadata, + retry_policy: @config.rpcs.list_pull_requests.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @secure_source_manager_stub.call_rpc :list_pull_requests, request, options: options do |response, operation| + response = ::Gapic::PagedEnumerable.new @secure_source_manager_stub, :list_pull_requests, 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 + + ## + # Updates a pull request. + # + # @overload update_pull_request(request, options = nil) + # Pass arguments to `update_pull_request` via a request object, either of type + # {::Google::Cloud::SecureSourceManager::V1::UpdatePullRequestRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::SecureSourceManager::V1::UpdatePullRequestRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_pull_request(pull_request: nil, update_mask: nil) + # Pass arguments to `update_pull_request` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param pull_request [::Google::Cloud::SecureSourceManager::V1::PullRequest, ::Hash] + # Required. The pull request to update. + # @param update_mask [::Google::Protobuf::FieldMask, ::Hash] + # Optional. Field mask is used to specify the fields to be overwritten in the + # pull request resource by the update. + # The fields specified in the update_mask are relative to the resource, not + # the full request. A field will be overwritten if it is in the mask. + # The special value "*" means full replacement. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Gapic::Operation] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Gapic::Operation] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/secure_source_manager/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::SecureSourceManager::V1::SecureSourceManager::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::SecureSourceManager::V1::UpdatePullRequestRequest.new + # + # # Call the update_pull_request method. + # result = client.update_pull_request 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_pull_request request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::SecureSourceManager::V1::UpdatePullRequestRequest + + # Converts hash 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_pull_request.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::SecureSourceManager::V1::VERSION + metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.pull_request&.name + header_params["pull_request.name"] = request.pull_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.update_pull_request.timeout, + metadata: metadata, + retry_policy: @config.rpcs.update_pull_request.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @secure_source_manager_stub.call_rpc :update_pull_request, 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 + + ## + # Merges a pull request. + # + # @overload merge_pull_request(request, options = nil) + # Pass arguments to `merge_pull_request` via a request object, either of type + # {::Google::Cloud::SecureSourceManager::V1::MergePullRequestRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::SecureSourceManager::V1::MergePullRequestRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. + # + # @overload merge_pull_request(name: nil) + # Pass arguments to `merge_pull_request` via keyword arguments. Note that at + # least one keyword argument is 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 pull request to merge. + # Format: + # `projects/{project_number}/locations/{location_id}/repositories/{repository_id}/pullRequests/{pull_request_id}` + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Gapic::Operation] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Gapic::Operation] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/secure_source_manager/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::SecureSourceManager::V1::SecureSourceManager::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::SecureSourceManager::V1::MergePullRequestRequest.new + # + # # Call the merge_pull_request method. + # result = client.merge_pull_request 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 merge_pull_request request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::SecureSourceManager::V1::MergePullRequestRequest + + # Converts hash 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.merge_pull_request.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::SecureSourceManager::V1::VERSION + metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.name + header_params["name"] = request.name + end + + request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") + metadata[:"x-goog-request-params"] ||= request_params_header + + options.apply_defaults timeout: @config.rpcs.merge_pull_request.timeout, + metadata: metadata, + retry_policy: @config.rpcs.merge_pull_request.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @secure_source_manager_stub.call_rpc :merge_pull_request, 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 + + ## + # Opens a pull request. + # + # @overload open_pull_request(request, options = nil) + # Pass arguments to `open_pull_request` via a request object, either of type + # {::Google::Cloud::SecureSourceManager::V1::OpenPullRequestRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::SecureSourceManager::V1::OpenPullRequestRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. + # + # @overload open_pull_request(name: nil) + # Pass arguments to `open_pull_request` via keyword arguments. Note that at + # least one keyword argument is 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 pull request to open. + # Format: + # `projects/{project_number}/locations/{location_id}/repositories/{repository_id}/pullRequests/{pull_request_id}` + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Gapic::Operation] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Gapic::Operation] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/secure_source_manager/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::SecureSourceManager::V1::SecureSourceManager::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::SecureSourceManager::V1::OpenPullRequestRequest.new + # + # # Call the open_pull_request method. + # result = client.open_pull_request 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 open_pull_request request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::SecureSourceManager::V1::OpenPullRequestRequest + + # Converts hash 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.open_pull_request.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::SecureSourceManager::V1::VERSION + metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.name + header_params["name"] = request.name + end + + request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") + metadata[:"x-goog-request-params"] ||= request_params_header + + options.apply_defaults timeout: @config.rpcs.open_pull_request.timeout, + metadata: metadata, + retry_policy: @config.rpcs.open_pull_request.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @secure_source_manager_stub.call_rpc :open_pull_request, 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 + + ## + # Closes a pull request without merging. + # + # @overload close_pull_request(request, options = nil) + # Pass arguments to `close_pull_request` via a request object, either of type + # {::Google::Cloud::SecureSourceManager::V1::ClosePullRequestRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::SecureSourceManager::V1::ClosePullRequestRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. + # + # @overload close_pull_request(name: nil) + # Pass arguments to `close_pull_request` via keyword arguments. Note that at + # least one keyword argument is 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 pull request to close. + # Format: + # `projects/{project_number}/locations/{location_id}/repositories/{repository_id}/pullRequests/{pull_request_id}` + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Gapic::Operation] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Gapic::Operation] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/secure_source_manager/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::SecureSourceManager::V1::SecureSourceManager::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::SecureSourceManager::V1::ClosePullRequestRequest.new + # + # # Call the close_pull_request method. + # result = client.close_pull_request 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 close_pull_request request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::SecureSourceManager::V1::ClosePullRequestRequest + + # Converts hash 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.close_pull_request.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::SecureSourceManager::V1::VERSION + metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.name + header_params["name"] = request.name + end + + request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") + metadata[:"x-goog-request-params"] ||= request_params_header + + options.apply_defaults timeout: @config.rpcs.close_pull_request.timeout, + metadata: metadata, + retry_policy: @config.rpcs.close_pull_request.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @secure_source_manager_stub.call_rpc :close_pull_request, 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 a pull request's file diffs. + # + # @overload list_pull_request_file_diffs(request, options = nil) + # Pass arguments to `list_pull_request_file_diffs` via a request object, either of type + # {::Google::Cloud::SecureSourceManager::V1::ListPullRequestFileDiffsRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::SecureSourceManager::V1::ListPullRequestFileDiffsRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_pull_request_file_diffs(name: nil, page_size: nil, page_token: nil) + # Pass arguments to `list_pull_request_file_diffs` via keyword arguments. Note that at + # least one keyword argument is 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 pull request to list file diffs for. + # Format: + # `projects/{project_number}/locations/{location_id}/repositories/{repository_id}/pullRequests/{pull_request_id}` + # @param page_size [::Integer] + # Optional. Requested page size. Server may return fewer items than + # requested. If unspecified, server will pick an appropriate default. + # @param page_token [::String] + # Optional. A token identifying a page of results the server should return. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Gapic::PagedEnumerable<::Google::Cloud::SecureSourceManager::V1::FileDiff>] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Gapic::PagedEnumerable<::Google::Cloud::SecureSourceManager::V1::FileDiff>] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/secure_source_manager/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::SecureSourceManager::V1::SecureSourceManager::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::SecureSourceManager::V1::ListPullRequestFileDiffsRequest.new + # + # # Call the list_pull_request_file_diffs method. + # result = client.list_pull_request_file_diffs request + # + # # The returned object is of type Gapic::PagedEnumerable. You can iterate + # # over elements, and API calls will be issued to fetch pages as needed. + # result.each do |item| + # # Each element is of type ::Google::Cloud::SecureSourceManager::V1::FileDiff. + # p item + # end + # + def list_pull_request_file_diffs request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::SecureSourceManager::V1::ListPullRequestFileDiffsRequest + + # Converts hash 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_pull_request_file_diffs.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::SecureSourceManager::V1::VERSION + metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.name + header_params["name"] = request.name + end + + request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") + metadata[:"x-goog-request-params"] ||= request_params_header + + options.apply_defaults timeout: @config.rpcs.list_pull_request_file_diffs.timeout, + metadata: metadata, + retry_policy: @config.rpcs.list_pull_request_file_diffs.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @secure_source_manager_stub.call_rpc :list_pull_request_file_diffs, request, options: options do |response, operation| + response = ::Gapic::PagedEnumerable.new @secure_source_manager_stub, :list_pull_request_file_diffs, 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 + + ## + # Fetches a tree from a repository. + # + # @overload fetch_tree(request, options = nil) + # Pass arguments to `fetch_tree` via a request object, either of type + # {::Google::Cloud::SecureSourceManager::V1::FetchTreeRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::SecureSourceManager::V1::FetchTreeRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. + # + # @overload fetch_tree(repository: nil, ref: nil, recursive: nil, page_size: nil, page_token: nil) + # Pass arguments to `fetch_tree` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param repository [::String] + # Required. The format is + # `projects/{project_number}/locations/{location_id}/repositories/{repository_id}`. + # Specifies the repository to fetch the tree from. + # @param ref [::String] + # Optional. `ref` can be a SHA-1 hash, a branch name, or a tag. Specifies + # which tree to fetch. If not specified, the default branch will be used. + # @param recursive [::Boolean] + # Optional. If true, include all subfolders and their files in the response. + # If false, only the immediate children are returned. + # @param page_size [::Integer] + # Optional. Requested page size. Server may return fewer items than + # requested. If unspecified, at most 10,000 items will be returned. + # @param page_token [::String] + # Optional. A token identifying a page of results the server should return. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Gapic::PagedEnumerable<::Google::Cloud::SecureSourceManager::V1::TreeEntry>] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Gapic::PagedEnumerable<::Google::Cloud::SecureSourceManager::V1::TreeEntry>] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/secure_source_manager/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::SecureSourceManager::V1::SecureSourceManager::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::SecureSourceManager::V1::FetchTreeRequest.new + # + # # Call the fetch_tree method. + # result = client.fetch_tree request + # + # # The returned object is of type Gapic::PagedEnumerable. You can iterate + # # over elements, and API calls will be issued to fetch pages as needed. + # result.each do |item| + # # Each element is of type ::Google::Cloud::SecureSourceManager::V1::TreeEntry. + # p item + # end + # + def fetch_tree request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::SecureSourceManager::V1::FetchTreeRequest + + # Converts hash 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.fetch_tree.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::SecureSourceManager::V1::VERSION + metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.repository + header_params["repository"] = request.repository + 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.fetch_tree.timeout, + metadata: metadata, + retry_policy: @config.rpcs.fetch_tree.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @secure_source_manager_stub.call_rpc :fetch_tree, request, options: options do |response, operation| + response = ::Gapic::PagedEnumerable.new @secure_source_manager_stub, :fetch_tree, 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 + + ## + # Fetches a blob from a repository. + # + # @overload fetch_blob(request, options = nil) + # Pass arguments to `fetch_blob` via a request object, either of type + # {::Google::Cloud::SecureSourceManager::V1::FetchBlobRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::SecureSourceManager::V1::FetchBlobRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. + # + # @overload fetch_blob(repository: nil, sha: nil) + # Pass arguments to `fetch_blob` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param repository [::String] + # Required. The format is + # `projects/{project_number}/locations/{location_id}/repositories/{repository_id}`. + # Specifies the repository containing the blob. + # @param sha [::String] + # Required. The SHA-1 hash of the blob to retrieve. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Google::Cloud::SecureSourceManager::V1::FetchBlobResponse] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Google::Cloud::SecureSourceManager::V1::FetchBlobResponse] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/secure_source_manager/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::SecureSourceManager::V1::SecureSourceManager::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::SecureSourceManager::V1::FetchBlobRequest.new + # + # # Call the fetch_blob method. + # result = client.fetch_blob request + # + # # The returned object is of type Google::Cloud::SecureSourceManager::V1::FetchBlobResponse. + # p result + # + def fetch_blob request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::SecureSourceManager::V1::FetchBlobRequest + + # Converts hash 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.fetch_blob.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::SecureSourceManager::V1::VERSION + metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.repository + header_params["repository"] = request.repository + 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.fetch_blob.timeout, + metadata: metadata, + retry_policy: @config.rpcs.fetch_blob.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @secure_source_manager_stub.call_rpc :fetch_blob, request, options: options do |response, operation| + yield response, operation if block_given? + end + rescue ::GRPC::BadStatus => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Creates an issue. + # + # @overload create_issue(request, options = nil) + # Pass arguments to `create_issue` via a request object, either of type + # {::Google::Cloud::SecureSourceManager::V1::CreateIssueRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::SecureSourceManager::V1::CreateIssueRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_issue(parent: nil, issue: nil) + # Pass arguments to `create_issue` via keyword arguments. Note that at + # least one keyword argument is 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 repository in which to create the issue. Format: + # `projects/{project_number}/locations/{location_id}/repositories/{repository_id}` + # @param issue [::Google::Cloud::SecureSourceManager::V1::Issue, ::Hash] + # Required. The issue to create. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Gapic::Operation] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Gapic::Operation] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/secure_source_manager/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::SecureSourceManager::V1::SecureSourceManager::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::SecureSourceManager::V1::CreateIssueRequest.new + # + # # Call the create_issue method. + # result = client.create_issue 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_issue request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::SecureSourceManager::V1::CreateIssueRequest + + # Converts hash 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_issue.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::SecureSourceManager::V1::VERSION + metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.parent + header_params["parent"] = request.parent + end + + request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") + metadata[:"x-goog-request-params"] ||= request_params_header + + options.apply_defaults timeout: @config.rpcs.create_issue.timeout, + metadata: metadata, + retry_policy: @config.rpcs.create_issue.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @secure_source_manager_stub.call_rpc :create_issue, 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 issue. + # + # @overload get_issue(request, options = nil) + # Pass arguments to `get_issue` via a request object, either of type + # {::Google::Cloud::SecureSourceManager::V1::GetIssueRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::SecureSourceManager::V1::GetIssueRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_issue(name: nil) + # Pass arguments to `get_issue` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param name [::String] + # Required. Name of the issue to retrieve. + # The format is + # `projects/{project}/locations/{location}/repositories/{repository}/issues/{issue_id}`. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Google::Cloud::SecureSourceManager::V1::Issue] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Google::Cloud::SecureSourceManager::V1::Issue] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/secure_source_manager/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::SecureSourceManager::V1::SecureSourceManager::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::SecureSourceManager::V1::GetIssueRequest.new + # + # # Call the get_issue method. + # result = client.get_issue request + # + # # The returned object is of type Google::Cloud::SecureSourceManager::V1::Issue. + # p result + # + def get_issue request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::SecureSourceManager::V1::GetIssueRequest + + # Converts hash 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_issue.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::SecureSourceManager::V1::VERSION + metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.name + header_params["name"] = request.name + end + + request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") + metadata[:"x-goog-request-params"] ||= request_params_header + + options.apply_defaults timeout: @config.rpcs.get_issue.timeout, + metadata: metadata, + retry_policy: @config.rpcs.get_issue.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @secure_source_manager_stub.call_rpc :get_issue, request, options: options do |response, operation| + yield response, operation if block_given? + end + rescue ::GRPC::BadStatus => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Lists issues in a repository. + # + # @overload list_issues(request, options = nil) + # Pass arguments to `list_issues` via a request object, either of type + # {::Google::Cloud::SecureSourceManager::V1::ListIssuesRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::SecureSourceManager::V1::ListIssuesRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_issues(parent: nil, page_size: nil, page_token: nil, filter: nil) + # Pass arguments to `list_issues` via keyword arguments. Note that at + # least one keyword argument is 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 repository in which to list issues. Format: + # `projects/{project_number}/locations/{location_id}/repositories/{repository_id}` + # @param page_size [::Integer] + # Optional. Requested page size. Server may return fewer items than + # requested. If unspecified, server will pick an appropriate default. + # @param page_token [::String] + # Optional. A token identifying a page of results the server should return. + # @param filter [::String] + # Optional. Used to filter the resulting issues list. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Gapic::PagedEnumerable<::Google::Cloud::SecureSourceManager::V1::Issue>] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Gapic::PagedEnumerable<::Google::Cloud::SecureSourceManager::V1::Issue>] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/secure_source_manager/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::SecureSourceManager::V1::SecureSourceManager::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::SecureSourceManager::V1::ListIssuesRequest.new + # + # # Call the list_issues method. + # result = client.list_issues request + # + # # The returned object is of type Gapic::PagedEnumerable. You can iterate + # # over elements, and API calls will be issued to fetch pages as needed. + # result.each do |item| + # # Each element is of type ::Google::Cloud::SecureSourceManager::V1::Issue. + # p item + # end + # + def list_issues request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::SecureSourceManager::V1::ListIssuesRequest + + # Converts hash 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_issues.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::SecureSourceManager::V1::VERSION + metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.parent + header_params["parent"] = request.parent + end + + request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") + metadata[:"x-goog-request-params"] ||= request_params_header + + options.apply_defaults timeout: @config.rpcs.list_issues.timeout, + metadata: metadata, + retry_policy: @config.rpcs.list_issues.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @secure_source_manager_stub.call_rpc :list_issues, request, options: options do |response, operation| + response = ::Gapic::PagedEnumerable.new @secure_source_manager_stub, :list_issues, 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 + + ## + # Updates a issue. + # + # @overload update_issue(request, options = nil) + # Pass arguments to `update_issue` via a request object, either of type + # {::Google::Cloud::SecureSourceManager::V1::UpdateIssueRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::SecureSourceManager::V1::UpdateIssueRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_issue(issue: nil, update_mask: nil) + # Pass arguments to `update_issue` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param issue [::Google::Cloud::SecureSourceManager::V1::Issue, ::Hash] + # Required. The issue to update. + # @param update_mask [::Google::Protobuf::FieldMask, ::Hash] + # Optional. Field mask is used to specify the fields to be overwritten in the + # issue resource by the update. + # The fields specified in the update_mask are relative to the resource, not + # the full request. A field will be overwritten if it is in the mask. + # The special value "*" means full replacement. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Gapic::Operation] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Gapic::Operation] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/secure_source_manager/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::SecureSourceManager::V1::SecureSourceManager::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::SecureSourceManager::V1::UpdateIssueRequest.new + # + # # Call the update_issue method. + # result = client.update_issue 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_issue request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::SecureSourceManager::V1::UpdateIssueRequest + + # Converts hash 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_issue.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::SecureSourceManager::V1::VERSION + metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.issue&.name + header_params["issue.name"] = request.issue.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_issue.timeout, + metadata: metadata, + retry_policy: @config.rpcs.update_issue.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @secure_source_manager_stub.call_rpc :update_issue, 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 issue. + # + # @overload delete_issue(request, options = nil) + # Pass arguments to `delete_issue` via a request object, either of type + # {::Google::Cloud::SecureSourceManager::V1::DeleteIssueRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::SecureSourceManager::V1::DeleteIssueRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_issue(name: nil, etag: nil) + # Pass arguments to `delete_issue` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param name [::String] + # Required. Name of the issue to delete. + # The format is + # `projects/{project_number}/locations/{location_id}/repositories/{repository_id}/issues/{issue_id}`. + # @param etag [::String] + # Optional. The current etag of the issue. + # If the etag is provided and does not match the current etag of the issue, + # deletion will be blocked and an ABORTED error will be returned. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Gapic::Operation] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Gapic::Operation] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/secure_source_manager/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::SecureSourceManager::V1::SecureSourceManager::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::SecureSourceManager::V1::DeleteIssueRequest.new + # + # # Call the delete_issue method. + # result = client.delete_issue 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_issue request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::SecureSourceManager::V1::DeleteIssueRequest + + # Converts hash 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_issue.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::SecureSourceManager::V1::VERSION + metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.name + header_params["name"] = request.name + end + + request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") + metadata[:"x-goog-request-params"] ||= request_params_header + + options.apply_defaults timeout: @config.rpcs.delete_issue.timeout, + metadata: metadata, + retry_policy: @config.rpcs.delete_issue.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @secure_source_manager_stub.call_rpc :delete_issue, 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 + + ## + # Opens an issue. + # + # @overload open_issue(request, options = nil) + # Pass arguments to `open_issue` via a request object, either of type + # {::Google::Cloud::SecureSourceManager::V1::OpenIssueRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::SecureSourceManager::V1::OpenIssueRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. + # + # @overload open_issue(name: nil, etag: nil) + # Pass arguments to `open_issue` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param name [::String] + # Required. Name of the issue to open. + # The format is + # `projects/{project_number}/locations/{location_id}/repositories/{repository_id}/issues/{issue_id}`. + # @param etag [::String] + # Optional. The current etag of the issue. + # If the etag is provided and does not match the current etag of the issue, + # opening will be blocked and an ABORTED error will be returned. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Gapic::Operation] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Gapic::Operation] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/secure_source_manager/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::SecureSourceManager::V1::SecureSourceManager::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::SecureSourceManager::V1::OpenIssueRequest.new + # + # # Call the open_issue method. + # result = client.open_issue 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 open_issue request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::SecureSourceManager::V1::OpenIssueRequest + + # Converts hash 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.open_issue.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::SecureSourceManager::V1::VERSION + metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.name + header_params["name"] = request.name + end + + request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") + metadata[:"x-goog-request-params"] ||= request_params_header + + options.apply_defaults timeout: @config.rpcs.open_issue.timeout, + metadata: metadata, + retry_policy: @config.rpcs.open_issue.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @secure_source_manager_stub.call_rpc :open_issue, 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 + + ## + # Closes an issue. + # + # @overload close_issue(request, options = nil) + # Pass arguments to `close_issue` via a request object, either of type + # {::Google::Cloud::SecureSourceManager::V1::CloseIssueRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::SecureSourceManager::V1::CloseIssueRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. + # + # @overload close_issue(name: nil, etag: nil) + # Pass arguments to `close_issue` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param name [::String] + # Required. Name of the issue to close. + # The format is + # `projects/{project_number}/locations/{location_id}/repositories/{repository_id}/issues/{issue_id}`. + # @param etag [::String] + # Optional. The current etag of the issue. + # If the etag is provided and does not match the current etag of the issue, + # closing will be blocked and an ABORTED error will be returned. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Gapic::Operation] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Gapic::Operation] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/secure_source_manager/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::SecureSourceManager::V1::SecureSourceManager::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::SecureSourceManager::V1::CloseIssueRequest.new + # + # # Call the close_issue method. + # result = client.close_issue 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 close_issue request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::SecureSourceManager::V1::CloseIssueRequest + + # Converts hash 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.close_issue.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::SecureSourceManager::V1::VERSION + metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.name + header_params["name"] = request.name + end + + request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") + metadata[:"x-goog-request-params"] ||= request_params_header + + options.apply_defaults timeout: @config.rpcs.close_issue.timeout, + metadata: metadata, + retry_policy: @config.rpcs.close_issue.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @secure_source_manager_stub.call_rpc :close_issue, 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 pull request comment. + # + # @overload get_pull_request_comment(request, options = nil) + # Pass arguments to `get_pull_request_comment` via a request object, either of type + # {::Google::Cloud::SecureSourceManager::V1::GetPullRequestCommentRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::SecureSourceManager::V1::GetPullRequestCommentRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_pull_request_comment(name: nil) + # Pass arguments to `get_pull_request_comment` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param name [::String] + # Required. Name of the pull request comment to retrieve. + # The format is + # `projects/{project_number}/locations/{location_id}/repositories/{repository_id}/pullRequests/{pull_request_id}/pullRequestComments/{comment_id}`. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Google::Cloud::SecureSourceManager::V1::PullRequestComment] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Google::Cloud::SecureSourceManager::V1::PullRequestComment] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/secure_source_manager/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::SecureSourceManager::V1::SecureSourceManager::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::SecureSourceManager::V1::GetPullRequestCommentRequest.new + # + # # Call the get_pull_request_comment method. + # result = client.get_pull_request_comment request + # + # # The returned object is of type Google::Cloud::SecureSourceManager::V1::PullRequestComment. + # p result + # + def get_pull_request_comment request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::SecureSourceManager::V1::GetPullRequestCommentRequest + + # Converts hash 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_pull_request_comment.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::SecureSourceManager::V1::VERSION + metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.name + header_params["name"] = request.name + end + + request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") + metadata[:"x-goog-request-params"] ||= request_params_header + + options.apply_defaults timeout: @config.rpcs.get_pull_request_comment.timeout, + metadata: metadata, + retry_policy: @config.rpcs.get_pull_request_comment.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @secure_source_manager_stub.call_rpc :get_pull_request_comment, request, options: options do |response, operation| + yield response, operation if block_given? + end + rescue ::GRPC::BadStatus => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Lists pull request comments. + # + # @overload list_pull_request_comments(request, options = nil) + # Pass arguments to `list_pull_request_comments` via a request object, either of type + # {::Google::Cloud::SecureSourceManager::V1::ListPullRequestCommentsRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::SecureSourceManager::V1::ListPullRequestCommentsRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_pull_request_comments(parent: nil, page_size: nil, page_token: nil) + # Pass arguments to `list_pull_request_comments` via keyword arguments. Note that at + # least one keyword argument is 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 pull request in which to list pull request comments. Format: + # `projects/{project_number}/locations/{location_id}/repositories/{repository_id}/pullRequests/{pull_request_id}` + # @param page_size [::Integer] + # Optional. Requested page size. If unspecified, at most 100 pull request + # comments will be returned. The maximum value is 100; values above 100 will + # be coerced to 100. + # @param page_token [::String] + # Optional. A token identifying a page of results the server should return. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Gapic::PagedEnumerable<::Google::Cloud::SecureSourceManager::V1::PullRequestComment>] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Gapic::PagedEnumerable<::Google::Cloud::SecureSourceManager::V1::PullRequestComment>] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/secure_source_manager/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::SecureSourceManager::V1::SecureSourceManager::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::SecureSourceManager::V1::ListPullRequestCommentsRequest.new + # + # # Call the list_pull_request_comments method. + # result = client.list_pull_request_comments request + # + # # The returned object is of type Gapic::PagedEnumerable. You can iterate + # # over elements, and API calls will be issued to fetch pages as needed. + # result.each do |item| + # # Each element is of type ::Google::Cloud::SecureSourceManager::V1::PullRequestComment. + # p item + # end + # + def list_pull_request_comments request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::SecureSourceManager::V1::ListPullRequestCommentsRequest + + # Converts hash 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_pull_request_comments.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::SecureSourceManager::V1::VERSION + metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.parent + header_params["parent"] = request.parent + end + + request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") + metadata[:"x-goog-request-params"] ||= request_params_header + + options.apply_defaults timeout: @config.rpcs.list_pull_request_comments.timeout, + metadata: metadata, + retry_policy: @config.rpcs.list_pull_request_comments.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @secure_source_manager_stub.call_rpc :list_pull_request_comments, request, options: options do |response, operation| + response = ::Gapic::PagedEnumerable.new @secure_source_manager_stub, :list_pull_request_comments, request, response, operation, options + yield response, operation if block_given? + throw :response, response + end + rescue ::GRPC::BadStatus => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Creates a pull request comment. This function is used to create a single + # PullRequestComment of type Comment, or a single PullRequestComment of type + # Code that's replying to another PullRequestComment of type Code. Use + # BatchCreatePullRequestComments to create multiple PullRequestComments for + # code reviews. + # + # @overload create_pull_request_comment(request, options = nil) + # Pass arguments to `create_pull_request_comment` via a request object, either of type + # {::Google::Cloud::SecureSourceManager::V1::CreatePullRequestCommentRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::SecureSourceManager::V1::CreatePullRequestCommentRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_pull_request_comment(parent: nil, pull_request_comment: nil) + # Pass arguments to `create_pull_request_comment` via keyword arguments. Note that at + # least one keyword argument is 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 pull request in which to create the pull request comment. + # Format: + # `projects/{project_number}/locations/{location_id}/repositories/{repository_id}/pullRequests/{pull_request_id}` + # @param pull_request_comment [::Google::Cloud::SecureSourceManager::V1::PullRequestComment, ::Hash] + # Required. The pull request comment to create. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Gapic::Operation] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Gapic::Operation] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/secure_source_manager/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::SecureSourceManager::V1::SecureSourceManager::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::SecureSourceManager::V1::CreatePullRequestCommentRequest.new + # + # # Call the create_pull_request_comment method. + # result = client.create_pull_request_comment 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_pull_request_comment request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::SecureSourceManager::V1::CreatePullRequestCommentRequest + + # Converts hash 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_pull_request_comment.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::SecureSourceManager::V1::VERSION + metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.parent + header_params["parent"] = request.parent + end + + request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") + metadata[:"x-goog-request-params"] ||= request_params_header + + options.apply_defaults timeout: @config.rpcs.create_pull_request_comment.timeout, + metadata: metadata, + retry_policy: @config.rpcs.create_pull_request_comment.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @secure_source_manager_stub.call_rpc :create_pull_request_comment, request, options: options do |response, operation| + response = ::Gapic::Operation.new response, @operations_client, options: options + yield response, operation if block_given? + throw :response, response + end + rescue ::GRPC::BadStatus => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Updates a pull request comment. + # + # @overload update_pull_request_comment(request, options = nil) + # Pass arguments to `update_pull_request_comment` via a request object, either of type + # {::Google::Cloud::SecureSourceManager::V1::UpdatePullRequestCommentRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::SecureSourceManager::V1::UpdatePullRequestCommentRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_pull_request_comment(pull_request_comment: nil, update_mask: nil) + # Pass arguments to `update_pull_request_comment` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param pull_request_comment [::Google::Cloud::SecureSourceManager::V1::PullRequestComment, ::Hash] + # Required. The pull request comment to update. + # @param update_mask [::Google::Protobuf::FieldMask, ::Hash] + # Optional. Field mask is used to specify the fields to be overwritten in the + # pull request comment resource by the update. Updatable fields are + # `body`. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Gapic::Operation] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Gapic::Operation] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/secure_source_manager/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::SecureSourceManager::V1::SecureSourceManager::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::SecureSourceManager::V1::UpdatePullRequestCommentRequest.new + # + # # Call the update_pull_request_comment method. + # result = client.update_pull_request_comment 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_pull_request_comment request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::SecureSourceManager::V1::UpdatePullRequestCommentRequest + + # Converts hash 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_pull_request_comment.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::SecureSourceManager::V1::VERSION + metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.pull_request_comment&.name + header_params["pull_request_comment.name"] = request.pull_request_comment.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_pull_request_comment.timeout, + metadata: metadata, + retry_policy: @config.rpcs.update_pull_request_comment.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @secure_source_manager_stub.call_rpc :update_pull_request_comment, 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 pull request comment. + # + # @overload delete_pull_request_comment(request, options = nil) + # Pass arguments to `delete_pull_request_comment` via a request object, either of type + # {::Google::Cloud::SecureSourceManager::V1::DeletePullRequestCommentRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::SecureSourceManager::V1::DeletePullRequestCommentRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_pull_request_comment(name: nil) + # Pass arguments to `delete_pull_request_comment` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param name [::String] + # Required. Name of the pull request comment to delete. + # The format is + # `projects/{project_number}/locations/{location_id}/repositories/{repository_id}/pullRequests/{pull_request_id}/pullRequestComments/{comment_id}`. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Gapic::Operation] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Gapic::Operation] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/secure_source_manager/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::SecureSourceManager::V1::SecureSourceManager::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::SecureSourceManager::V1::DeletePullRequestCommentRequest.new + # + # # Call the delete_pull_request_comment method. + # result = client.delete_pull_request_comment 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_pull_request_comment request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::SecureSourceManager::V1::DeletePullRequestCommentRequest + + # Converts hash 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_pull_request_comment.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::SecureSourceManager::V1::VERSION + metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.name + header_params["name"] = request.name + end + + request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") + metadata[:"x-goog-request-params"] ||= request_params_header + + options.apply_defaults timeout: @config.rpcs.delete_pull_request_comment.timeout, + metadata: metadata, + retry_policy: @config.rpcs.delete_pull_request_comment.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @secure_source_manager_stub.call_rpc :delete_pull_request_comment, 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 + + ## + # Batch creates pull request comments. This function is used to create + # multiple PullRequestComments for code review. There needs to be exactly one + # PullRequestComment of type Review, and at most 100 PullRequestComments of + # type Code per request. The Postition of the code comments must be unique + # within the request. + # + # @overload batch_create_pull_request_comments(request, options = nil) + # Pass arguments to `batch_create_pull_request_comments` via a request object, either of type + # {::Google::Cloud::SecureSourceManager::V1::BatchCreatePullRequestCommentsRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::SecureSourceManager::V1::BatchCreatePullRequestCommentsRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. + # + # @overload batch_create_pull_request_comments(parent: nil, requests: nil) + # Pass arguments to `batch_create_pull_request_comments` via keyword arguments. Note that at + # least one keyword argument is 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 pull request in which to create the pull request comments. + # Format: + # `projects/{project_number}/locations/{location_id}/repositories/{repository_id}/pullRequests/{pull_request_id}` + # @param requests [::Array<::Google::Cloud::SecureSourceManager::V1::CreatePullRequestCommentRequest, ::Hash>] + # Required. The request message specifying the resources to create. There + # should be exactly one CreatePullRequestCommentRequest with CommentDetail + # being REVIEW in the list, and no more than 100 + # CreatePullRequestCommentRequests with CommentDetail being CODE in the list + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Gapic::Operation] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Gapic::Operation] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/secure_source_manager/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::SecureSourceManager::V1::SecureSourceManager::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::SecureSourceManager::V1::BatchCreatePullRequestCommentsRequest.new + # + # # Call the batch_create_pull_request_comments method. + # result = client.batch_create_pull_request_comments 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 batch_create_pull_request_comments request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::SecureSourceManager::V1::BatchCreatePullRequestCommentsRequest + + # Converts hash 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.batch_create_pull_request_comments.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::SecureSourceManager::V1::VERSION + metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.parent + header_params["parent"] = request.parent + end + + request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") + metadata[:"x-goog-request-params"] ||= request_params_header + + options.apply_defaults timeout: @config.rpcs.batch_create_pull_request_comments.timeout, + metadata: metadata, + retry_policy: @config.rpcs.batch_create_pull_request_comments.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @secure_source_manager_stub.call_rpc :batch_create_pull_request_comments, 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 + + ## + # Resolves pull request comments. A list of PullRequestComment names must be + # provided. The PullRequestComment names must be in the same conversation + # thread. If auto_fill is set, all comments in the conversation thread will + # be resolved. + # + # @overload resolve_pull_request_comments(request, options = nil) + # Pass arguments to `resolve_pull_request_comments` via a request object, either of type + # {::Google::Cloud::SecureSourceManager::V1::ResolvePullRequestCommentsRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::SecureSourceManager::V1::ResolvePullRequestCommentsRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. + # + # @overload resolve_pull_request_comments(parent: nil, names: nil, auto_fill: nil) + # Pass arguments to `resolve_pull_request_comments` via keyword arguments. Note that at + # least one keyword argument is 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 pull request in which to resolve the pull request comments. + # Format: + # `projects/{project_number}/locations/{location_id}/repositories/{repository_id}/pullRequests/{pull_request_id}` + # @param names [::Array<::String>] + # Required. The names of the pull request comments to resolve. Format: + # `projects/{project_number}/locations/{location_id}/repositories/{repository_id}/pullRequests/{pull_request_id}/pullRequestComments/{comment_id}` + # Only comments from the same threads are allowed in the same request. + # @param auto_fill [::Boolean] + # Optional. If set, at least one comment in a thread is required, rest of the + # comments in the same thread will be automatically updated to resolved. If + # unset, all comments in the same thread need be present. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Gapic::Operation] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Gapic::Operation] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/secure_source_manager/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::SecureSourceManager::V1::SecureSourceManager::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::SecureSourceManager::V1::ResolvePullRequestCommentsRequest.new + # + # # Call the resolve_pull_request_comments method. + # result = client.resolve_pull_request_comments 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 resolve_pull_request_comments request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::SecureSourceManager::V1::ResolvePullRequestCommentsRequest + + # Converts hash 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.resolve_pull_request_comments.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::SecureSourceManager::V1::VERSION + metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.parent + header_params["parent"] = request.parent + end + + request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") + metadata[:"x-goog-request-params"] ||= request_params_header + + options.apply_defaults timeout: @config.rpcs.resolve_pull_request_comments.timeout, + metadata: metadata, + retry_policy: @config.rpcs.resolve_pull_request_comments.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @secure_source_manager_stub.call_rpc :resolve_pull_request_comments, 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 + + ## + # Unresolves pull request comments. A list of PullRequestComment names must + # be provided. The PullRequestComment names must be in the same conversation + # thread. If auto_fill is set, all comments in the conversation thread will + # be unresolved. + # + # @overload unresolve_pull_request_comments(request, options = nil) + # Pass arguments to `unresolve_pull_request_comments` via a request object, either of type + # {::Google::Cloud::SecureSourceManager::V1::UnresolvePullRequestCommentsRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::SecureSourceManager::V1::UnresolvePullRequestCommentsRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. + # + # @overload unresolve_pull_request_comments(parent: nil, names: nil, auto_fill: nil) + # Pass arguments to `unresolve_pull_request_comments` via keyword arguments. Note that at + # least one keyword argument is 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 pull request in which to resolve the pull request comments. + # Format: + # `projects/{project_number}/locations/{location_id}/repositories/{repository_id}/pullRequests/{pull_request_id}` + # @param names [::Array<::String>] + # Required. The names of the pull request comments to unresolve. Format: + # `projects/{project_number}/locations/{location_id}/repositories/{repository_id}/pullRequests/{pull_request_id}/pullRequestComments/{comment_id}` + # Only comments from the same threads are allowed in the same request. + # @param auto_fill [::Boolean] + # Optional. If set, at least one comment in a thread is required, rest of the + # comments in the same thread will be automatically updated to unresolved. If + # unset, all comments in the same thread need be present. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Gapic::Operation] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Gapic::Operation] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/secure_source_manager/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::SecureSourceManager::V1::SecureSourceManager::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::SecureSourceManager::V1::UnresolvePullRequestCommentsRequest.new + # + # # Call the unresolve_pull_request_comments method. + # result = client.unresolve_pull_request_comments 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 unresolve_pull_request_comments request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::SecureSourceManager::V1::UnresolvePullRequestCommentsRequest + + # Converts hash 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.unresolve_pull_request_comments.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::SecureSourceManager::V1::VERSION + metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.parent + header_params["parent"] = request.parent + end + + request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") + metadata[:"x-goog-request-params"] ||= request_params_header + + options.apply_defaults timeout: @config.rpcs.unresolve_pull_request_comments.timeout, + metadata: metadata, + retry_policy: @config.rpcs.unresolve_pull_request_comments.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @secure_source_manager_stub.call_rpc :unresolve_pull_request_comments, 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 + + ## + # Creates an issue comment. + # + # @overload create_issue_comment(request, options = nil) + # Pass arguments to `create_issue_comment` via a request object, either of type + # {::Google::Cloud::SecureSourceManager::V1::CreateIssueCommentRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::SecureSourceManager::V1::CreateIssueCommentRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_issue_comment(parent: nil, issue_comment: nil) + # Pass arguments to `create_issue_comment` via keyword arguments. Note that at + # least one keyword argument is 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 issue in which to create the issue comment. Format: + # `projects/{project_number}/locations/{location_id}/repositories/{repository_id}/issues/{issue_id}` + # @param issue_comment [::Google::Cloud::SecureSourceManager::V1::IssueComment, ::Hash] + # Required. The issue comment to create. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Gapic::Operation] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Gapic::Operation] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/secure_source_manager/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::SecureSourceManager::V1::SecureSourceManager::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::SecureSourceManager::V1::CreateIssueCommentRequest.new + # + # # Call the create_issue_comment method. + # result = client.create_issue_comment 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_issue_comment request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::SecureSourceManager::V1::CreateIssueCommentRequest + + # Converts hash 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_issue_comment.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::SecureSourceManager::V1::VERSION + metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.parent + header_params["parent"] = request.parent + end + + request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") + metadata[:"x-goog-request-params"] ||= request_params_header + + options.apply_defaults timeout: @config.rpcs.create_issue_comment.timeout, + metadata: metadata, + retry_policy: @config.rpcs.create_issue_comment.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @secure_source_manager_stub.call_rpc :create_issue_comment, 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 issue comment. + # + # @overload get_issue_comment(request, options = nil) + # Pass arguments to `get_issue_comment` via a request object, either of type + # {::Google::Cloud::SecureSourceManager::V1::GetIssueCommentRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::SecureSourceManager::V1::GetIssueCommentRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_issue_comment(name: nil) + # Pass arguments to `get_issue_comment` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param name [::String] + # Required. Name of the issue comment to retrieve. + # The format is + # `projects/{project}/locations/{location}/repositories/{repository}/issues/{issue_id}/issueComments/{comment_id}`. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Google::Cloud::SecureSourceManager::V1::IssueComment] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Google::Cloud::SecureSourceManager::V1::IssueComment] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/secure_source_manager/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::SecureSourceManager::V1::SecureSourceManager::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::SecureSourceManager::V1::GetIssueCommentRequest.new + # + # # Call the get_issue_comment method. + # result = client.get_issue_comment request + # + # # The returned object is of type Google::Cloud::SecureSourceManager::V1::IssueComment. + # p result + # + def get_issue_comment request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::SecureSourceManager::V1::GetIssueCommentRequest + + # Converts hash 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_issue_comment.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::SecureSourceManager::V1::VERSION + metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.name + header_params["name"] = request.name + end + + request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") + metadata[:"x-goog-request-params"] ||= request_params_header + + options.apply_defaults timeout: @config.rpcs.get_issue_comment.timeout, + metadata: metadata, + retry_policy: @config.rpcs.get_issue_comment.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @secure_source_manager_stub.call_rpc :get_issue_comment, request, options: options do |response, operation| + yield response, operation if block_given? + end + rescue ::GRPC::BadStatus => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Lists comments in an issue. + # + # @overload list_issue_comments(request, options = nil) + # Pass arguments to `list_issue_comments` via a request object, either of type + # {::Google::Cloud::SecureSourceManager::V1::ListIssueCommentsRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::SecureSourceManager::V1::ListIssueCommentsRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_issue_comments(parent: nil, page_size: nil, page_token: nil) + # Pass arguments to `list_issue_comments` via keyword arguments. Note that at + # least one keyword argument is 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 issue in which to list the comments. Format: + # `projects/{project_number}/locations/{location_id}/repositories/{repository_id}/issues/{issue_id}` + # @param page_size [::Integer] + # Optional. Requested page size. Server may return fewer items than + # requested. If unspecified, server will pick an appropriate default. + # @param page_token [::String] + # Optional. A token identifying a page of results the server should return. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Gapic::PagedEnumerable<::Google::Cloud::SecureSourceManager::V1::IssueComment>] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Gapic::PagedEnumerable<::Google::Cloud::SecureSourceManager::V1::IssueComment>] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/secure_source_manager/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::SecureSourceManager::V1::SecureSourceManager::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::SecureSourceManager::V1::ListIssueCommentsRequest.new + # + # # Call the list_issue_comments method. + # result = client.list_issue_comments request + # + # # The returned object is of type Gapic::PagedEnumerable. You can iterate + # # over elements, and API calls will be issued to fetch pages as needed. + # result.each do |item| + # # Each element is of type ::Google::Cloud::SecureSourceManager::V1::IssueComment. + # p item + # end + # + def list_issue_comments request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::SecureSourceManager::V1::ListIssueCommentsRequest + + # Converts hash 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_issue_comments.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::SecureSourceManager::V1::VERSION + metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.parent + header_params["parent"] = request.parent + end + + request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") + metadata[:"x-goog-request-params"] ||= request_params_header + + options.apply_defaults timeout: @config.rpcs.list_issue_comments.timeout, + metadata: metadata, + retry_policy: @config.rpcs.list_issue_comments.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @secure_source_manager_stub.call_rpc :list_issue_comments, request, options: options do |response, operation| + response = ::Gapic::PagedEnumerable.new @secure_source_manager_stub, :list_issue_comments, 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 + + ## + # Updates an issue comment. + # + # @overload update_issue_comment(request, options = nil) + # Pass arguments to `update_issue_comment` via a request object, either of type + # {::Google::Cloud::SecureSourceManager::V1::UpdateIssueCommentRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::SecureSourceManager::V1::UpdateIssueCommentRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_issue_comment(issue_comment: nil, update_mask: nil) + # Pass arguments to `update_issue_comment` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param issue_comment [::Google::Cloud::SecureSourceManager::V1::IssueComment, ::Hash] + # Required. The issue comment to update. + # @param update_mask [::Google::Protobuf::FieldMask, ::Hash] + # Optional. Field mask is used to specify the fields to be overwritten in the + # issue comment resource by the update. + # The fields specified in the update_mask are relative to the resource, not + # the full request. A field will be overwritten if it is in the mask. + # The special value "*" means full replacement. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Gapic::Operation] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Gapic::Operation] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/secure_source_manager/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::SecureSourceManager::V1::SecureSourceManager::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::SecureSourceManager::V1::UpdateIssueCommentRequest.new + # + # # Call the update_issue_comment method. + # result = client.update_issue_comment 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_issue_comment request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::SecureSourceManager::V1::UpdateIssueCommentRequest + + # Converts hash 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_issue_comment.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::SecureSourceManager::V1::VERSION + metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.issue_comment&.name + header_params["issue_comment.name"] = request.issue_comment.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_issue_comment.timeout, + metadata: metadata, + retry_policy: @config.rpcs.update_issue_comment.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @secure_source_manager_stub.call_rpc :update_issue_comment, 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 issue comment. + # + # @overload delete_issue_comment(request, options = nil) + # Pass arguments to `delete_issue_comment` via a request object, either of type + # {::Google::Cloud::SecureSourceManager::V1::DeleteIssueCommentRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::SecureSourceManager::V1::DeleteIssueCommentRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_issue_comment(name: nil) + # Pass arguments to `delete_issue_comment` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param name [::String] + # Required. Name of the issue comment to delete. + # The format is + # `projects/{project_number}/locations/{location_id}/repositories/{repository_id}/issues/{issue_id}/issueComments/{comment_id}`. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Gapic::Operation] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Gapic::Operation] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/secure_source_manager/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::SecureSourceManager::V1::SecureSourceManager::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::SecureSourceManager::V1::DeleteIssueCommentRequest.new + # + # # Call the delete_issue_comment method. + # result = client.delete_issue_comment 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_issue_comment request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::SecureSourceManager::V1::DeleteIssueCommentRequest + + # Converts hash 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_issue_comment.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::SecureSourceManager::V1::VERSION + metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.name + header_params["name"] = request.name + end + + request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") + metadata[:"x-goog-request-params"] ||= request_params_header + + options.apply_defaults timeout: @config.rpcs.delete_issue_comment.timeout, + metadata: metadata, + retry_policy: @config.rpcs.delete_issue_comment.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @secure_source_manager_stub.call_rpc :delete_issue_comment, 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 SecureSourceManager API. + # + # This class represents the configuration for SecureSourceManager, + # providing control over timeouts, retry behavior, logging, transport + # parameters, and other low-level controls. Certain parameters can also be + # applied individually to specific RPCs. See + # {::Google::Cloud::SecureSourceManager::V1::SecureSourceManager::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_instances to 20 seconds, + # # and all remaining timeouts to 10 seconds. + # ::Google::Cloud::SecureSourceManager::V1::SecureSourceManager::Client.configure do |config| + # config.timeout = 10.0 + # config.rpcs.list_instances.timeout = 20.0 + # end + # + # # Apply the above configuration only to a new client. + # client = ::Google::Cloud::SecureSourceManager::V1::SecureSourceManager::Client.new do |config| + # config.timeout = 10.0 + # config.rpcs.list_instances.timeout = 20.0 + # end + # + # @!attribute [rw] endpoint + # A custom service endpoint, as a hostname or hostname:port. The default is + # nil, indicating to use the default endpoint in the current universe domain. + # @return [::String,nil] + # @!attribute [rw] credentials + # Credentials to send with calls. You may provide any of the following types: + # * (`Google::Auth::Credentials`) A googleauth credentials object + # (see the [googleauth docs](https://rubydoc.info/gems/googleauth/Google/Auth/Credentials)) + # * (`Signet::OAuth2::Client`) A signet oauth2 client object + # (see the [signet docs](https://rubydoc.info/gems/signet/Signet/OAuth2/Client)) + # * (`GRPC::Core::Channel`) a gRPC channel with included credentials + # * (`GRPC::Core::ChannelCredentials`) a gRPC credentails object + # * (`nil`) indicating no credentials + # + # @note Warning: Passing a `String` to a keyfile path or a `Hash` of credentials + # is deprecated. Providing an unvalidated credential configuration to + # Google APIs can compromise the security of your systems and data. + # + # @example + # + # # The recommended way to provide credentials is to use the `make_creds` method + # # on the appropriate credentials class for your environment. + # + # require "googleauth" + # + # credentials = ::Google::Auth::ServiceAccountCredentials.make_creds( + # json_key_io: ::File.open("/path/to/keyfile.json") + # ) + # + # client = ::Google::Cloud::SecureSourceManager::V1::SecureSourceManager::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 = "securesourcemanager.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 SecureSourceManager 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_instances` + # @return [::Gapic::Config::Method] + # + attr_reader :list_instances + ## + # RPC-specific configuration for `get_instance` + # @return [::Gapic::Config::Method] + # + attr_reader :get_instance + ## + # RPC-specific configuration for `create_instance` + # @return [::Gapic::Config::Method] + # + attr_reader :create_instance + ## + # RPC-specific configuration for `delete_instance` + # @return [::Gapic::Config::Method] + # + attr_reader :delete_instance + ## + # RPC-specific configuration for `list_repositories` + # @return [::Gapic::Config::Method] + # + attr_reader :list_repositories + ## + # RPC-specific configuration for `get_repository` + # @return [::Gapic::Config::Method] + # + attr_reader :get_repository + ## + # RPC-specific configuration for `create_repository` + # @return [::Gapic::Config::Method] + # + attr_reader :create_repository + ## + # RPC-specific configuration for `update_repository` + # @return [::Gapic::Config::Method] + # + attr_reader :update_repository + ## + # RPC-specific configuration for `delete_repository` + # @return [::Gapic::Config::Method] + # + attr_reader :delete_repository + ## + # RPC-specific configuration for `list_hooks` + # @return [::Gapic::Config::Method] + # + attr_reader :list_hooks + ## + # RPC-specific configuration for `get_hook` + # @return [::Gapic::Config::Method] + # + attr_reader :get_hook + ## + # RPC-specific configuration for `create_hook` + # @return [::Gapic::Config::Method] + # + attr_reader :create_hook + ## + # RPC-specific configuration for `update_hook` + # @return [::Gapic::Config::Method] + # + attr_reader :update_hook + ## + # RPC-specific configuration for `delete_hook` + # @return [::Gapic::Config::Method] + # + attr_reader :delete_hook + ## + # RPC-specific configuration for `get_iam_policy_repo` + # @return [::Gapic::Config::Method] + # + attr_reader :get_iam_policy_repo + ## + # RPC-specific configuration for `set_iam_policy_repo` + # @return [::Gapic::Config::Method] + # + attr_reader :set_iam_policy_repo + ## + # RPC-specific configuration for `test_iam_permissions_repo` + # @return [::Gapic::Config::Method] + # + attr_reader :test_iam_permissions_repo + ## + # RPC-specific configuration for `create_branch_rule` + # @return [::Gapic::Config::Method] + # + attr_reader :create_branch_rule + ## + # RPC-specific configuration for `list_branch_rules` + # @return [::Gapic::Config::Method] + # + attr_reader :list_branch_rules + ## + # RPC-specific configuration for `get_branch_rule` + # @return [::Gapic::Config::Method] + # + attr_reader :get_branch_rule + ## + # RPC-specific configuration for `update_branch_rule` + # @return [::Gapic::Config::Method] + # + attr_reader :update_branch_rule + ## + # RPC-specific configuration for `delete_branch_rule` + # @return [::Gapic::Config::Method] + # + attr_reader :delete_branch_rule + ## + # RPC-specific configuration for `create_pull_request` + # @return [::Gapic::Config::Method] + # + attr_reader :create_pull_request + ## + # RPC-specific configuration for `get_pull_request` + # @return [::Gapic::Config::Method] + # + attr_reader :get_pull_request + ## + # RPC-specific configuration for `list_pull_requests` + # @return [::Gapic::Config::Method] + # + attr_reader :list_pull_requests + ## + # RPC-specific configuration for `update_pull_request` + # @return [::Gapic::Config::Method] + # + attr_reader :update_pull_request + ## + # RPC-specific configuration for `merge_pull_request` + # @return [::Gapic::Config::Method] + # + attr_reader :merge_pull_request + ## + # RPC-specific configuration for `open_pull_request` + # @return [::Gapic::Config::Method] + # + attr_reader :open_pull_request + ## + # RPC-specific configuration for `close_pull_request` + # @return [::Gapic::Config::Method] + # + attr_reader :close_pull_request + ## + # RPC-specific configuration for `list_pull_request_file_diffs` + # @return [::Gapic::Config::Method] + # + attr_reader :list_pull_request_file_diffs + ## + # RPC-specific configuration for `fetch_tree` + # @return [::Gapic::Config::Method] + # + attr_reader :fetch_tree + ## + # RPC-specific configuration for `fetch_blob` + # @return [::Gapic::Config::Method] + # + attr_reader :fetch_blob + ## + # RPC-specific configuration for `create_issue` + # @return [::Gapic::Config::Method] + # + attr_reader :create_issue + ## + # RPC-specific configuration for `get_issue` + # @return [::Gapic::Config::Method] + # + attr_reader :get_issue + ## + # RPC-specific configuration for `list_issues` + # @return [::Gapic::Config::Method] + # + attr_reader :list_issues + ## + # RPC-specific configuration for `update_issue` + # @return [::Gapic::Config::Method] + # + attr_reader :update_issue + ## + # RPC-specific configuration for `delete_issue` + # @return [::Gapic::Config::Method] + # + attr_reader :delete_issue + ## + # RPC-specific configuration for `open_issue` + # @return [::Gapic::Config::Method] + # + attr_reader :open_issue + ## + # RPC-specific configuration for `close_issue` + # @return [::Gapic::Config::Method] + # + attr_reader :close_issue + ## + # RPC-specific configuration for `get_pull_request_comment` + # @return [::Gapic::Config::Method] + # + attr_reader :get_pull_request_comment + ## + # RPC-specific configuration for `list_pull_request_comments` + # @return [::Gapic::Config::Method] + # + attr_reader :list_pull_request_comments + ## + # RPC-specific configuration for `create_pull_request_comment` + # @return [::Gapic::Config::Method] + # + attr_reader :create_pull_request_comment + ## + # RPC-specific configuration for `update_pull_request_comment` + # @return [::Gapic::Config::Method] + # + attr_reader :update_pull_request_comment + ## + # RPC-specific configuration for `delete_pull_request_comment` + # @return [::Gapic::Config::Method] + # + attr_reader :delete_pull_request_comment + ## + # RPC-specific configuration for `batch_create_pull_request_comments` + # @return [::Gapic::Config::Method] + # + attr_reader :batch_create_pull_request_comments + ## + # RPC-specific configuration for `resolve_pull_request_comments` + # @return [::Gapic::Config::Method] + # + attr_reader :resolve_pull_request_comments + ## + # RPC-specific configuration for `unresolve_pull_request_comments` + # @return [::Gapic::Config::Method] + # + attr_reader :unresolve_pull_request_comments + ## + # RPC-specific configuration for `create_issue_comment` + # @return [::Gapic::Config::Method] + # + attr_reader :create_issue_comment + ## + # RPC-specific configuration for `get_issue_comment` + # @return [::Gapic::Config::Method] + # + attr_reader :get_issue_comment + ## + # RPC-specific configuration for `list_issue_comments` + # @return [::Gapic::Config::Method] + # + attr_reader :list_issue_comments + ## + # RPC-specific configuration for `update_issue_comment` + # @return [::Gapic::Config::Method] + # + attr_reader :update_issue_comment + ## + # RPC-specific configuration for `delete_issue_comment` + # @return [::Gapic::Config::Method] + # + attr_reader :delete_issue_comment + + # @private + def initialize parent_rpcs = nil + list_instances_config = parent_rpcs.list_instances if parent_rpcs.respond_to? :list_instances + @list_instances = ::Gapic::Config::Method.new list_instances_config + get_instance_config = parent_rpcs.get_instance if parent_rpcs.respond_to? :get_instance + @get_instance = ::Gapic::Config::Method.new get_instance_config + create_instance_config = parent_rpcs.create_instance if parent_rpcs.respond_to? :create_instance + @create_instance = ::Gapic::Config::Method.new create_instance_config + delete_instance_config = parent_rpcs.delete_instance if parent_rpcs.respond_to? :delete_instance + @delete_instance = ::Gapic::Config::Method.new delete_instance_config + list_repositories_config = parent_rpcs.list_repositories if parent_rpcs.respond_to? :list_repositories + @list_repositories = ::Gapic::Config::Method.new list_repositories_config + get_repository_config = parent_rpcs.get_repository if parent_rpcs.respond_to? :get_repository + @get_repository = ::Gapic::Config::Method.new get_repository_config + create_repository_config = parent_rpcs.create_repository if parent_rpcs.respond_to? :create_repository + @create_repository = ::Gapic::Config::Method.new create_repository_config + update_repository_config = parent_rpcs.update_repository if parent_rpcs.respond_to? :update_repository + @update_repository = ::Gapic::Config::Method.new update_repository_config + delete_repository_config = parent_rpcs.delete_repository if parent_rpcs.respond_to? :delete_repository + @delete_repository = ::Gapic::Config::Method.new delete_repository_config + list_hooks_config = parent_rpcs.list_hooks if parent_rpcs.respond_to? :list_hooks + @list_hooks = ::Gapic::Config::Method.new list_hooks_config + get_hook_config = parent_rpcs.get_hook if parent_rpcs.respond_to? :get_hook + @get_hook = ::Gapic::Config::Method.new get_hook_config + create_hook_config = parent_rpcs.create_hook if parent_rpcs.respond_to? :create_hook + @create_hook = ::Gapic::Config::Method.new create_hook_config + update_hook_config = parent_rpcs.update_hook if parent_rpcs.respond_to? :update_hook + @update_hook = ::Gapic::Config::Method.new update_hook_config + delete_hook_config = parent_rpcs.delete_hook if parent_rpcs.respond_to? :delete_hook + @delete_hook = ::Gapic::Config::Method.new delete_hook_config + get_iam_policy_repo_config = parent_rpcs.get_iam_policy_repo if parent_rpcs.respond_to? :get_iam_policy_repo + @get_iam_policy_repo = ::Gapic::Config::Method.new get_iam_policy_repo_config + set_iam_policy_repo_config = parent_rpcs.set_iam_policy_repo if parent_rpcs.respond_to? :set_iam_policy_repo + @set_iam_policy_repo = ::Gapic::Config::Method.new set_iam_policy_repo_config + test_iam_permissions_repo_config = parent_rpcs.test_iam_permissions_repo if parent_rpcs.respond_to? :test_iam_permissions_repo + @test_iam_permissions_repo = ::Gapic::Config::Method.new test_iam_permissions_repo_config + create_branch_rule_config = parent_rpcs.create_branch_rule if parent_rpcs.respond_to? :create_branch_rule + @create_branch_rule = ::Gapic::Config::Method.new create_branch_rule_config + list_branch_rules_config = parent_rpcs.list_branch_rules if parent_rpcs.respond_to? :list_branch_rules + @list_branch_rules = ::Gapic::Config::Method.new list_branch_rules_config + get_branch_rule_config = parent_rpcs.get_branch_rule if parent_rpcs.respond_to? :get_branch_rule + @get_branch_rule = ::Gapic::Config::Method.new get_branch_rule_config + update_branch_rule_config = parent_rpcs.update_branch_rule if parent_rpcs.respond_to? :update_branch_rule + @update_branch_rule = ::Gapic::Config::Method.new update_branch_rule_config + delete_branch_rule_config = parent_rpcs.delete_branch_rule if parent_rpcs.respond_to? :delete_branch_rule + @delete_branch_rule = ::Gapic::Config::Method.new delete_branch_rule_config + create_pull_request_config = parent_rpcs.create_pull_request if parent_rpcs.respond_to? :create_pull_request + @create_pull_request = ::Gapic::Config::Method.new create_pull_request_config + get_pull_request_config = parent_rpcs.get_pull_request if parent_rpcs.respond_to? :get_pull_request + @get_pull_request = ::Gapic::Config::Method.new get_pull_request_config + list_pull_requests_config = parent_rpcs.list_pull_requests if parent_rpcs.respond_to? :list_pull_requests + @list_pull_requests = ::Gapic::Config::Method.new list_pull_requests_config + update_pull_request_config = parent_rpcs.update_pull_request if parent_rpcs.respond_to? :update_pull_request + @update_pull_request = ::Gapic::Config::Method.new update_pull_request_config + merge_pull_request_config = parent_rpcs.merge_pull_request if parent_rpcs.respond_to? :merge_pull_request + @merge_pull_request = ::Gapic::Config::Method.new merge_pull_request_config + open_pull_request_config = parent_rpcs.open_pull_request if parent_rpcs.respond_to? :open_pull_request + @open_pull_request = ::Gapic::Config::Method.new open_pull_request_config + close_pull_request_config = parent_rpcs.close_pull_request if parent_rpcs.respond_to? :close_pull_request + @close_pull_request = ::Gapic::Config::Method.new close_pull_request_config + list_pull_request_file_diffs_config = parent_rpcs.list_pull_request_file_diffs if parent_rpcs.respond_to? :list_pull_request_file_diffs + @list_pull_request_file_diffs = ::Gapic::Config::Method.new list_pull_request_file_diffs_config + fetch_tree_config = parent_rpcs.fetch_tree if parent_rpcs.respond_to? :fetch_tree + @fetch_tree = ::Gapic::Config::Method.new fetch_tree_config + fetch_blob_config = parent_rpcs.fetch_blob if parent_rpcs.respond_to? :fetch_blob + @fetch_blob = ::Gapic::Config::Method.new fetch_blob_config + create_issue_config = parent_rpcs.create_issue if parent_rpcs.respond_to? :create_issue + @create_issue = ::Gapic::Config::Method.new create_issue_config + get_issue_config = parent_rpcs.get_issue if parent_rpcs.respond_to? :get_issue + @get_issue = ::Gapic::Config::Method.new get_issue_config + list_issues_config = parent_rpcs.list_issues if parent_rpcs.respond_to? :list_issues + @list_issues = ::Gapic::Config::Method.new list_issues_config + update_issue_config = parent_rpcs.update_issue if parent_rpcs.respond_to? :update_issue + @update_issue = ::Gapic::Config::Method.new update_issue_config + delete_issue_config = parent_rpcs.delete_issue if parent_rpcs.respond_to? :delete_issue + @delete_issue = ::Gapic::Config::Method.new delete_issue_config + open_issue_config = parent_rpcs.open_issue if parent_rpcs.respond_to? :open_issue + @open_issue = ::Gapic::Config::Method.new open_issue_config + close_issue_config = parent_rpcs.close_issue if parent_rpcs.respond_to? :close_issue + @close_issue = ::Gapic::Config::Method.new close_issue_config + get_pull_request_comment_config = parent_rpcs.get_pull_request_comment if parent_rpcs.respond_to? :get_pull_request_comment + @get_pull_request_comment = ::Gapic::Config::Method.new get_pull_request_comment_config + list_pull_request_comments_config = parent_rpcs.list_pull_request_comments if parent_rpcs.respond_to? :list_pull_request_comments + @list_pull_request_comments = ::Gapic::Config::Method.new list_pull_request_comments_config + create_pull_request_comment_config = parent_rpcs.create_pull_request_comment if parent_rpcs.respond_to? :create_pull_request_comment + @create_pull_request_comment = ::Gapic::Config::Method.new create_pull_request_comment_config + update_pull_request_comment_config = parent_rpcs.update_pull_request_comment if parent_rpcs.respond_to? :update_pull_request_comment + @update_pull_request_comment = ::Gapic::Config::Method.new update_pull_request_comment_config + delete_pull_request_comment_config = parent_rpcs.delete_pull_request_comment if parent_rpcs.respond_to? :delete_pull_request_comment + @delete_pull_request_comment = ::Gapic::Config::Method.new delete_pull_request_comment_config + batch_create_pull_request_comments_config = parent_rpcs.batch_create_pull_request_comments if parent_rpcs.respond_to? :batch_create_pull_request_comments + @batch_create_pull_request_comments = ::Gapic::Config::Method.new batch_create_pull_request_comments_config + resolve_pull_request_comments_config = parent_rpcs.resolve_pull_request_comments if parent_rpcs.respond_to? :resolve_pull_request_comments + @resolve_pull_request_comments = ::Gapic::Config::Method.new resolve_pull_request_comments_config + unresolve_pull_request_comments_config = parent_rpcs.unresolve_pull_request_comments if parent_rpcs.respond_to? :unresolve_pull_request_comments + @unresolve_pull_request_comments = ::Gapic::Config::Method.new unresolve_pull_request_comments_config + create_issue_comment_config = parent_rpcs.create_issue_comment if parent_rpcs.respond_to? :create_issue_comment + @create_issue_comment = ::Gapic::Config::Method.new create_issue_comment_config + get_issue_comment_config = parent_rpcs.get_issue_comment if parent_rpcs.respond_to? :get_issue_comment + @get_issue_comment = ::Gapic::Config::Method.new get_issue_comment_config + list_issue_comments_config = parent_rpcs.list_issue_comments if parent_rpcs.respond_to? :list_issue_comments + @list_issue_comments = ::Gapic::Config::Method.new list_issue_comments_config + update_issue_comment_config = parent_rpcs.update_issue_comment if parent_rpcs.respond_to? :update_issue_comment + @update_issue_comment = ::Gapic::Config::Method.new update_issue_comment_config + delete_issue_comment_config = parent_rpcs.delete_issue_comment if parent_rpcs.respond_to? :delete_issue_comment + @delete_issue_comment = ::Gapic::Config::Method.new delete_issue_comment_config + + yield self if block_given? + end + end + end + end + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-secure_source_manager-v1/lib/google/cloud/secure_source_manager/v1/secure_source_manager/credentials.rb b/owl-bot-staging/google-cloud-secure_source_manager-v1/lib/google/cloud/secure_source_manager/v1/secure_source_manager/credentials.rb new file mode 100644 index 000000000000..514b539ee5fe --- /dev/null +++ b/owl-bot-staging/google-cloud-secure_source_manager-v1/lib/google/cloud/secure_source_manager/v1/secure_source_manager/credentials.rb @@ -0,0 +1,47 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +require "googleauth" + +module Google + module Cloud + module SecureSourceManager + module V1 + module SecureSourceManager + # Credentials for the SecureSourceManager API. + class Credentials < ::Google::Auth::Credentials + self.scope = [ + "https://www.googleapis.com/auth/cloud-platform" + ] + self.env_vars = [ + "GOOGLE_CLOUD_CREDENTIALS", + "GOOGLE_CLOUD_KEYFILE", + "GCLOUD_KEYFILE", + "GOOGLE_CLOUD_CREDENTIALS_JSON", + "GOOGLE_CLOUD_KEYFILE_JSON", + "GCLOUD_KEYFILE_JSON" + ] + self.paths = [ + "~/.config/google_cloud/application_default_credentials.json" + ] + end + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-secure_source_manager-v1/lib/google/cloud/secure_source_manager/v1/secure_source_manager/operations.rb b/owl-bot-staging/google-cloud-secure_source_manager-v1/lib/google/cloud/secure_source_manager/v1/secure_source_manager/operations.rb new file mode 100644 index 000000000000..3ed4a0a851c2 --- /dev/null +++ b/owl-bot-staging/google-cloud-secure_source_manager-v1/lib/google/cloud/secure_source_manager/v1/secure_source_manager/operations.rb @@ -0,0 +1,841 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +require "gapic/operation" +require "google/longrunning/operations_pb" + +module Google + module Cloud + module SecureSourceManager + module V1 + module SecureSourceManager + # Service that implements Longrunning Operations API. + class Operations + # @private + API_VERSION = "" + + # @private + DEFAULT_ENDPOINT_TEMPLATE = "securesourcemanager.$UNIVERSE_DOMAIN$" + + # @private + attr_reader :operations_stub + + ## + # Configuration for the SecureSourceManager 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 SecureSourceManager 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::SecureSourceManager::V1::VERSION + metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.name + header_params["name"] = request.name + end + + request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") + metadata[:"x-goog-request-params"] ||= request_params_header + + options.apply_defaults timeout: @config.rpcs.list_operations.timeout, + metadata: metadata, + retry_policy: @config.rpcs.list_operations.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @operations_stub.call_rpc :list_operations, request, options: options do |response, operation| + wrap_lro_operation = ->(op_response) { ::Gapic::Operation.new op_response, @operations_client } + response = ::Gapic::PagedEnumerable.new @operations_stub, :list_operations, request, response, operation, options, format_resource: wrap_lro_operation + yield response, operation if block_given? + 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::SecureSourceManager::V1::VERSION + metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.name + header_params["name"] = request.name + end + + request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") + metadata[:"x-goog-request-params"] ||= request_params_header + + options.apply_defaults timeout: @config.rpcs.get_operation.timeout, + metadata: metadata, + retry_policy: @config.rpcs.get_operation.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @operations_stub.call_rpc :get_operation, request, options: options do |response, operation| + response = ::Gapic::Operation.new response, @operations_client, options: options + yield response, operation if block_given? + 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::SecureSourceManager::V1::VERSION + metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.name + header_params["name"] = request.name + end + + request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") + metadata[:"x-goog-request-params"] ||= request_params_header + + options.apply_defaults timeout: @config.rpcs.delete_operation.timeout, + metadata: metadata, + retry_policy: @config.rpcs.delete_operation.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @operations_stub.call_rpc :delete_operation, request, options: options do |response, operation| + yield response, operation if block_given? + 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::SecureSourceManager::V1::VERSION + metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.name + header_params["name"] = request.name + end + + request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") + metadata[:"x-goog-request-params"] ||= request_params_header + + options.apply_defaults timeout: @config.rpcs.cancel_operation.timeout, + metadata: metadata, + retry_policy: @config.rpcs.cancel_operation.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @operations_stub.call_rpc :cancel_operation, request, options: options do |response, operation| + yield response, operation if block_given? + 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::SecureSourceManager::V1::VERSION + metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + options.apply_defaults timeout: @config.rpcs.wait_operation.timeout, + metadata: metadata, + retry_policy: @config.rpcs.wait_operation.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @operations_stub.call_rpc :wait_operation, request, options: options do |response, operation| + response = ::Gapic::Operation.new response, @operations_client, options: options + yield response, operation if block_given? + 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 = "securesourcemanager.googleapis.com" + + config_attr :endpoint, nil, ::String, nil + config_attr :credentials, nil do |value| + allowed = [::String, ::Hash, ::Proc, ::Symbol, ::Google::Auth::Credentials, ::Google::Auth::BaseClient, ::Signet::OAuth2::Client, nil] + allowed += [::GRPC::Core::Channel, ::GRPC::Core::ChannelCredentials] if defined? ::GRPC::Core::Channel + allowed.any? { |klass| klass === value } + end + config_attr :scope, nil, ::String, ::Array, nil + config_attr :lib_name, nil, ::String, nil + config_attr :lib_version, nil, ::String, nil + config_attr(:channel_args, { "grpc.service_config_disable_resolution" => 1 }, ::Hash, nil) + config_attr :interceptors, nil, ::Array, nil + config_attr :timeout, nil, ::Numeric, nil + config_attr :metadata, nil, ::Hash, nil + config_attr :retry_policy, nil, ::Hash, ::Proc, nil + config_attr :quota_project, nil, ::String, nil + config_attr :universe_domain, nil, ::String, nil + config_attr :logger, :default, ::Logger, nil, :default + + # @private + def initialize parent_config = nil + @parent_config = parent_config unless parent_config.nil? + + yield self if block_given? + end + + ## + # Configurations for individual RPCs + # @return [Rpcs] + # + def rpcs + @rpcs ||= begin + parent_rpcs = nil + parent_rpcs = @parent_config.rpcs if defined?(@parent_config) && @parent_config.respond_to?(:rpcs) + Rpcs.new parent_rpcs + end + end + + ## + # Configuration for the channel pool + # @return [::Gapic::ServiceStub::ChannelPool::Configuration] + # + def channel_pool + @channel_pool ||= ::Gapic::ServiceStub::ChannelPool::Configuration.new + end + + ## + # Configuration RPC class for the Operations API. + # + # Includes fields providing the configuration for each RPC in this service. + # Each configuration object is of type `Gapic::Config::Method` and includes + # the following configuration fields: + # + # * `timeout` (*type:* `Numeric`) - The call timeout in seconds + # * `metadata` (*type:* `Hash{Symbol=>String}`) - Additional gRPC headers + # * `retry_policy (*type:* `Hash`) - The retry policy. The policy fields + # include the following keys: + # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds. + # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds. + # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier. + # * `:retry_codes` (*type:* `Array`) - The error codes that should + # trigger a retry. + # + class Rpcs + ## + # RPC-specific configuration for `list_operations` + # @return [::Gapic::Config::Method] + # + attr_reader :list_operations + ## + # RPC-specific configuration for `get_operation` + # @return [::Gapic::Config::Method] + # + attr_reader :get_operation + ## + # RPC-specific configuration for `delete_operation` + # @return [::Gapic::Config::Method] + # + attr_reader :delete_operation + ## + # RPC-specific configuration for `cancel_operation` + # @return [::Gapic::Config::Method] + # + attr_reader :cancel_operation + ## + # RPC-specific configuration for `wait_operation` + # @return [::Gapic::Config::Method] + # + attr_reader :wait_operation + + # @private + def initialize parent_rpcs = nil + list_operations_config = parent_rpcs.list_operations if parent_rpcs.respond_to? :list_operations + @list_operations = ::Gapic::Config::Method.new list_operations_config + get_operation_config = parent_rpcs.get_operation if parent_rpcs.respond_to? :get_operation + @get_operation = ::Gapic::Config::Method.new get_operation_config + delete_operation_config = parent_rpcs.delete_operation if parent_rpcs.respond_to? :delete_operation + @delete_operation = ::Gapic::Config::Method.new delete_operation_config + cancel_operation_config = parent_rpcs.cancel_operation if parent_rpcs.respond_to? :cancel_operation + @cancel_operation = ::Gapic::Config::Method.new cancel_operation_config + wait_operation_config = parent_rpcs.wait_operation if parent_rpcs.respond_to? :wait_operation + @wait_operation = ::Gapic::Config::Method.new wait_operation_config + + yield self if block_given? + end + end + end + end + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-secure_source_manager-v1/lib/google/cloud/secure_source_manager/v1/secure_source_manager/paths.rb b/owl-bot-staging/google-cloud-secure_source_manager-v1/lib/google/cloud/secure_source_manager/v1/secure_source_manager/paths.rb new file mode 100644 index 000000000000..a4119462008a --- /dev/null +++ b/owl-bot-staging/google-cloud-secure_source_manager-v1/lib/google/cloud/secure_source_manager/v1/secure_source_manager/paths.rb @@ -0,0 +1,277 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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 SecureSourceManager + module V1 + module SecureSourceManager + # Path helper methods for the SecureSourceManager API. + module Paths + ## + # Create a fully-qualified BranchRule resource string. + # + # The resource will be in the following format: + # + # `projects/{project}/locations/{location}/repositories/{repository}/branchRules/{branch_rule}` + # + # @param project [String] + # @param location [String] + # @param repository [String] + # @param branch_rule [String] + # + # @return [::String] + def branch_rule_path project:, location:, repository:, branch_rule: + raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" + raise ::ArgumentError, "location cannot contain /" if location.to_s.include? "/" + raise ::ArgumentError, "repository cannot contain /" if repository.to_s.include? "/" + + "projects/#{project}/locations/#{location}/repositories/#{repository}/branchRules/#{branch_rule}" + end + + ## + # Create a fully-qualified CaPool resource string. + # + # The resource will be in the following format: + # + # `projects/{project}/locations/{location}/caPools/{ca_pool}` + # + # @param project [String] + # @param location [String] + # @param ca_pool [String] + # + # @return [::String] + def ca_pool_path project:, location:, ca_pool: + raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" + raise ::ArgumentError, "location cannot contain /" if location.to_s.include? "/" + + "projects/#{project}/locations/#{location}/caPools/#{ca_pool}" + end + + ## + # Create a fully-qualified CryptoKey resource string. + # + # The resource will be in the following format: + # + # `projects/{project}/locations/{location}/keyRings/{key_ring}/cryptoKeys/{crypto_key}` + # + # @param project [String] + # @param location [String] + # @param key_ring [String] + # @param crypto_key [String] + # + # @return [::String] + def crypto_key_path project:, location:, key_ring:, crypto_key: + raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" + raise ::ArgumentError, "location cannot contain /" if location.to_s.include? "/" + raise ::ArgumentError, "key_ring cannot contain /" if key_ring.to_s.include? "/" + + "projects/#{project}/locations/#{location}/keyRings/#{key_ring}/cryptoKeys/#{crypto_key}" + end + + ## + # Create a fully-qualified Hook resource string. + # + # The resource will be in the following format: + # + # `projects/{project}/locations/{location}/repositories/{repository}/hooks/{hook}` + # + # @param project [String] + # @param location [String] + # @param repository [String] + # @param hook [String] + # + # @return [::String] + def hook_path project:, location:, repository:, hook: + raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" + raise ::ArgumentError, "location cannot contain /" if location.to_s.include? "/" + raise ::ArgumentError, "repository cannot contain /" if repository.to_s.include? "/" + + "projects/#{project}/locations/#{location}/repositories/#{repository}/hooks/#{hook}" + end + + ## + # Create a fully-qualified Instance resource string. + # + # The resource will be in the following format: + # + # `projects/{project}/locations/{location}/instances/{instance}` + # + # @param project [String] + # @param location [String] + # @param instance [String] + # + # @return [::String] + def instance_path project:, location:, instance: + raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" + raise ::ArgumentError, "location cannot contain /" if location.to_s.include? "/" + + "projects/#{project}/locations/#{location}/instances/#{instance}" + end + + ## + # Create a fully-qualified Issue resource string. + # + # The resource will be in the following format: + # + # `projects/{project}/locations/{location}/repositories/{repository}/issues/{issue}` + # + # @param project [String] + # @param location [String] + # @param repository [String] + # @param issue [String] + # + # @return [::String] + def issue_path project:, location:, repository:, issue: + raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" + raise ::ArgumentError, "location cannot contain /" if location.to_s.include? "/" + raise ::ArgumentError, "repository cannot contain /" if repository.to_s.include? "/" + + "projects/#{project}/locations/#{location}/repositories/#{repository}/issues/#{issue}" + end + + ## + # Create a fully-qualified IssueComment resource string. + # + # The resource will be in the following format: + # + # `projects/{project}/locations/{location}/repositories/{repository}/issues/{issue}/issueComments/{comment}` + # + # @param project [String] + # @param location [String] + # @param repository [String] + # @param issue [String] + # @param comment [String] + # + # @return [::String] + def issue_comment_path project:, location:, repository:, issue:, comment: + raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" + raise ::ArgumentError, "location cannot contain /" if location.to_s.include? "/" + raise ::ArgumentError, "repository cannot contain /" if repository.to_s.include? "/" + raise ::ArgumentError, "issue cannot contain /" if issue.to_s.include? "/" + + "projects/#{project}/locations/#{location}/repositories/#{repository}/issues/#{issue}/issueComments/#{comment}" + 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 PullRequest resource string. + # + # The resource will be in the following format: + # + # `projects/{project}/locations/{location}/repositories/{repository}/pullRequests/{pull_request}` + # + # @param project [String] + # @param location [String] + # @param repository [String] + # @param pull_request [String] + # + # @return [::String] + def pull_request_path project:, location:, repository:, pull_request: + raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" + raise ::ArgumentError, "location cannot contain /" if location.to_s.include? "/" + raise ::ArgumentError, "repository cannot contain /" if repository.to_s.include? "/" + + "projects/#{project}/locations/#{location}/repositories/#{repository}/pullRequests/#{pull_request}" + end + + ## + # Create a fully-qualified PullRequestComment resource string. + # + # The resource will be in the following format: + # + # `projects/{project}/locations/{location}/repositories/{repository}/pullRequests/{pull_request}/pullRequestComments/{comment}` + # + # @param project [String] + # @param location [String] + # @param repository [String] + # @param pull_request [String] + # @param comment [String] + # + # @return [::String] + def pull_request_comment_path project:, location:, repository:, pull_request:, comment: + raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" + raise ::ArgumentError, "location cannot contain /" if location.to_s.include? "/" + raise ::ArgumentError, "repository cannot contain /" if repository.to_s.include? "/" + raise ::ArgumentError, "pull_request cannot contain /" if pull_request.to_s.include? "/" + + "projects/#{project}/locations/#{location}/repositories/#{repository}/pullRequests/#{pull_request}/pullRequestComments/#{comment}" + end + + ## + # Create a fully-qualified Repository resource string. + # + # The resource will be in the following format: + # + # `projects/{project}/locations/{location}/repositories/{repository}` + # + # @param project [String] + # @param location [String] + # @param repository [String] + # + # @return [::String] + def repository_path project:, location:, repository: + raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" + raise ::ArgumentError, "location cannot contain /" if location.to_s.include? "/" + + "projects/#{project}/locations/#{location}/repositories/#{repository}" + end + + ## + # Create a fully-qualified ServiceAttachment resource string. + # + # The resource will be in the following format: + # + # `projects/{project}/regions/{region}/serviceAttachments/{service_attachment}` + # + # @param project [String] + # @param region [String] + # @param service_attachment [String] + # + # @return [::String] + def service_attachment_path project:, region:, service_attachment: + raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" + raise ::ArgumentError, "region cannot contain /" if region.to_s.include? "/" + + "projects/#{project}/regions/#{region}/serviceAttachments/#{service_attachment}" + end + + extend self + end + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-secure_source_manager-v1/lib/google/cloud/secure_source_manager/v1/secure_source_manager/rest.rb b/owl-bot-staging/google-cloud-secure_source_manager-v1/lib/google/cloud/secure_source_manager/v1/secure_source_manager/rest.rb new file mode 100644 index 000000000000..1d049bd8ad6d --- /dev/null +++ b/owl-bot-staging/google-cloud-secure_source_manager-v1/lib/google/cloud/secure_source_manager/v1/secure_source_manager/rest.rb @@ -0,0 +1,56 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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/secure_source_manager/v1/version" +require "google/cloud/secure_source_manager/v1/bindings_override" + +require "google/cloud/secure_source_manager/v1/secure_source_manager/credentials" +require "google/cloud/secure_source_manager/v1/secure_source_manager/paths" +require "google/cloud/secure_source_manager/v1/secure_source_manager/rest/operations" +require "google/cloud/secure_source_manager/v1/secure_source_manager/rest/client" + +module Google + module Cloud + module SecureSourceManager + module V1 + ## + # Secure Source Manager API + # + # Access Secure Source Manager instances, resources, and repositories. + # + # To load this service and instantiate a REST client: + # + # require "google/cloud/secure_source_manager/v1/secure_source_manager/rest" + # client = ::Google::Cloud::SecureSourceManager::V1::SecureSourceManager::Rest::Client.new + # + module SecureSourceManager + # Client for the REST transport + module Rest + end + end + end + end + end +end + +helper_path = ::File.join __dir__, "rest", "helpers.rb" +require "google/cloud/secure_source_manager/v1/secure_source_manager/rest/helpers" if ::File.file? helper_path diff --git a/owl-bot-staging/google-cloud-secure_source_manager-v1/lib/google/cloud/secure_source_manager/v1/secure_source_manager/rest/client.rb b/owl-bot-staging/google-cloud-secure_source_manager-v1/lib/google/cloud/secure_source_manager/v1/secure_source_manager/rest/client.rb new file mode 100644 index 000000000000..739aa1fb974a --- /dev/null +++ b/owl-bot-staging/google-cloud-secure_source_manager-v1/lib/google/cloud/secure_source_manager/v1/secure_source_manager/rest/client.rb @@ -0,0 +1,5479 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +require "google/cloud/errors" +require "google/cloud/securesourcemanager/v1/secure_source_manager_pb" +require "google/cloud/secure_source_manager/v1/secure_source_manager/rest/service_stub" +require "google/cloud/location/rest" +require "google/iam/v1/rest" + +module Google + module Cloud + module SecureSourceManager + module V1 + module SecureSourceManager + module Rest + ## + # REST client for the SecureSourceManager service. + # + # Secure Source Manager API + # + # Access Secure Source Manager instances, resources, and repositories. + # + class Client + # @private + API_VERSION = "" + + # @private + DEFAULT_ENDPOINT_TEMPLATE = "securesourcemanager.$UNIVERSE_DOMAIN$" + + include Paths + + # @private + attr_reader :secure_source_manager_stub + + ## + # Configure the SecureSourceManager Client class. + # + # See {::Google::Cloud::SecureSourceManager::V1::SecureSourceManager::Rest::Client::Configuration} + # for a description of the configuration fields. + # + # @example + # + # # Modify the configuration for all SecureSourceManager clients + # ::Google::Cloud::SecureSourceManager::V1::SecureSourceManager::Rest::Client.configure do |config| + # config.timeout = 10.0 + # end + # + # @yield [config] Configure the Client client. + # @yieldparam config [Client::Configuration] + # + # @return [Client::Configuration] + # + def self.configure + @configure ||= begin + namespace = ["Google", "Cloud", "SecureSourceManager", "V1"] + parent_config = while namespace.any? + parent_name = namespace.join "::" + parent_const = const_get parent_name + break parent_const.configure if parent_const.respond_to? :configure + namespace.pop + end + default_config = Client::Configuration.new parent_config + + default_config.rpcs.list_instances.timeout = 60.0 + default_config.rpcs.list_instances.retry_policy = { + initial_delay: 1.0, max_delay: 10.0, multiplier: 1.3, retry_codes: [14] + } + + default_config.rpcs.get_instance.timeout = 60.0 + default_config.rpcs.get_instance.retry_policy = { + initial_delay: 1.0, max_delay: 10.0, multiplier: 1.3, retry_codes: [14] + } + + default_config.rpcs.list_repositories.timeout = 60.0 + default_config.rpcs.list_repositories.retry_policy = { + initial_delay: 1.0, max_delay: 10.0, multiplier: 1.3, retry_codes: [14] + } + + default_config.rpcs.get_repository.timeout = 60.0 + default_config.rpcs.get_repository.retry_policy = { + initial_delay: 1.0, max_delay: 10.0, multiplier: 1.3, retry_codes: [14] + } + + default_config.rpcs.get_iam_policy_repo.timeout = 60.0 + default_config.rpcs.get_iam_policy_repo.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 SecureSourceManager Client instance. + # + # The configuration is set to the derived mode, meaning that values can be changed, + # but structural changes (adding new fields, etc.) are not allowed. Structural changes + # should be made on {Client.configure}. + # + # See {::Google::Cloud::SecureSourceManager::V1::SecureSourceManager::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 + @secure_source_manager_stub.universe_domain + end + + ## + # Create a new SecureSourceManager REST client object. + # + # @example + # + # # Create a client using the default configuration + # client = ::Google::Cloud::SecureSourceManager::V1::SecureSourceManager::Rest::Client.new + # + # # Create a client using a custom configuration + # client = ::Google::Cloud::SecureSourceManager::V1::SecureSourceManager::Rest::Client.new do |config| + # config.timeout = 10.0 + # end + # + # @yield [config] Configure the SecureSourceManager client. + # @yieldparam config [Client::Configuration] + # + def initialize + # Create the configuration object + @config = Configuration.new Client.configure + + # Yield the configuration if needed + yield @config if block_given? + + # Create credentials + credentials = @config.credentials + # Use self-signed JWT if the endpoint is unchanged from default, + # but only if the default endpoint does not have a region prefix. + enable_self_signed_jwt = @config.endpoint.nil? || + (@config.endpoint == Configuration::DEFAULT_ENDPOINT && + !@config.endpoint.split(".").first.include?("-")) + credentials ||= Credentials.default scope: @config.scope, + enable_self_signed_jwt: enable_self_signed_jwt + if credentials.is_a?(::String) || credentials.is_a?(::Hash) + credentials = Credentials.new credentials, scope: @config.scope + end + + @quota_project_id = @config.quota_project + @quota_project_id ||= credentials.quota_project_id if credentials.respond_to? :quota_project_id + + @operations_client = ::Google::Cloud::SecureSourceManager::V1::SecureSourceManager::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 + + @secure_source_manager_stub = ::Google::Cloud::SecureSourceManager::V1::SecureSourceManager::Rest::ServiceStub.new( + endpoint: @config.endpoint, + endpoint_template: DEFAULT_ENDPOINT_TEMPLATE, + universe_domain: @config.universe_domain, + credentials: credentials, + logger: @config.logger + ) + + @secure_source_manager_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 = @secure_source_manager_stub.endpoint + config.universe_domain = @secure_source_manager_stub.universe_domain + config.bindings_override = @config.bindings_override + config.logger = @secure_source_manager_stub.logger if config.respond_to? :logger= + end + + @iam_policy_client = Google::Iam::V1::IAMPolicy::Rest::Client.new do |config| + config.credentials = credentials + config.quota_project = @quota_project_id + config.endpoint = @secure_source_manager_stub.endpoint + config.universe_domain = @secure_source_manager_stub.universe_domain + config.bindings_override = @config.bindings_override + config.logger = @secure_source_manager_stub.logger if config.respond_to? :logger= + end + end + + ## + # Get the associated client for long-running operations. + # + # @return [::Google::Cloud::SecureSourceManager::V1::SecureSourceManager::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 + + ## + # Get the associated client for mix-in of the IAMPolicy. + # + # @return [Google::Iam::V1::IAMPolicy::Rest::Client] + # + attr_reader :iam_policy_client + + ## + # The logger used for request/response debug logging. + # + # @return [Logger] + # + def logger + @secure_source_manager_stub.logger + end + + # Service calls + + ## + # Lists Instances in a given project and location. + # + # @overload list_instances(request, options = nil) + # Pass arguments to `list_instances` via a request object, either of type + # {::Google::Cloud::SecureSourceManager::V1::ListInstancesRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::SecureSourceManager::V1::ListInstancesRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_instances(parent: nil, page_size: nil, page_token: nil, filter: nil, order_by: nil) + # Pass arguments to `list_instances` via keyword arguments. Note that at + # least one keyword argument is 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. Parent value for ListInstancesRequest. + # @param page_size [::Integer] + # Requested page size. Server may return fewer items than requested. + # If unspecified, server will pick an appropriate default. + # @param page_token [::String] + # A token identifying a page of results the server should return. + # @param filter [::String] + # Filter for filtering results. + # @param order_by [::String] + # Hint for how to order the results. + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Gapic::Rest::PagedEnumerable<::Google::Cloud::SecureSourceManager::V1::Instance>] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Gapic::Rest::PagedEnumerable<::Google::Cloud::SecureSourceManager::V1::Instance>] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/secure_source_manager/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::SecureSourceManager::V1::SecureSourceManager::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::SecureSourceManager::V1::ListInstancesRequest.new + # + # # Call the list_instances method. + # result = client.list_instances request + # + # # The returned object is of type Gapic::PagedEnumerable. You can iterate + # # over elements, and API calls will be issued to fetch pages as needed. + # result.each do |item| + # # Each element is of type ::Google::Cloud::SecureSourceManager::V1::Instance. + # p item + # end + # + def list_instances request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::SecureSourceManager::V1::ListInstancesRequest + + # Converts hash 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_instances.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::SecureSourceManager::V1::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + options.apply_defaults timeout: @config.rpcs.list_instances.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.list_instances.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @secure_source_manager_stub.list_instances request, options do |result, operation| + result = ::Gapic::Rest::PagedEnumerable.new @secure_source_manager_stub, :list_instances, "instances", 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 details of a single instance. + # + # @overload get_instance(request, options = nil) + # Pass arguments to `get_instance` via a request object, either of type + # {::Google::Cloud::SecureSourceManager::V1::GetInstanceRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::SecureSourceManager::V1::GetInstanceRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_instance(name: nil) + # Pass arguments to `get_instance` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param name [::String] + # Required. Name of the resource. + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Cloud::SecureSourceManager::V1::Instance] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::SecureSourceManager::V1::Instance] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/secure_source_manager/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::SecureSourceManager::V1::SecureSourceManager::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::SecureSourceManager::V1::GetInstanceRequest.new + # + # # Call the get_instance method. + # result = client.get_instance request + # + # # The returned object is of type Google::Cloud::SecureSourceManager::V1::Instance. + # p result + # + def get_instance request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::SecureSourceManager::V1::GetInstanceRequest + + # Converts hash 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_instance.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::SecureSourceManager::V1::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + options.apply_defaults timeout: @config.rpcs.get_instance.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.get_instance.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @secure_source_manager_stub.get_instance request, options do |result, operation| + yield result, operation if block_given? + end + rescue ::Gapic::Rest::Error => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Creates a new instance in a given project and location. + # + # @overload create_instance(request, options = nil) + # Pass arguments to `create_instance` via a request object, either of type + # {::Google::Cloud::SecureSourceManager::V1::CreateInstanceRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::SecureSourceManager::V1::CreateInstanceRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_instance(parent: nil, instance_id: nil, instance: nil, request_id: nil) + # Pass arguments to `create_instance` via keyword arguments. Note that at + # least one keyword argument is 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. Value for parent. + # @param instance_id [::String] + # Required. ID of the instance to be created. + # @param instance [::Google::Cloud::SecureSourceManager::V1::Instance, ::Hash] + # Required. The resource being created. + # @param request_id [::String] + # Optional. An optional request ID to identify requests. Specify a unique + # request ID so that if you must retry your request, the server will know to + # ignore the request if it has already been completed. The server will + # guarantee that for at least 60 minutes since the first request. + # + # For example, consider a situation where you make an initial request and + # the request times out. If you make the request again with the same request + # ID, the server can check if original operation with the same request ID + # was received, and if so, will ignore the second request. This prevents + # clients from accidentally creating duplicate commitments. + # + # The request ID must be a valid UUID with the exception that zero UUID is + # not supported (00000000-0000-0000-0000-000000000000). + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Gapic::Operation] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Gapic::Operation] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/secure_source_manager/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::SecureSourceManager::V1::SecureSourceManager::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::SecureSourceManager::V1::CreateInstanceRequest.new + # + # # Call the create_instance method. + # result = client.create_instance 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_instance request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::SecureSourceManager::V1::CreateInstanceRequest + + # Converts hash 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_instance.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::SecureSourceManager::V1::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + options.apply_defaults timeout: @config.rpcs.create_instance.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.create_instance.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @secure_source_manager_stub.create_instance 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 single instance. + # + # @overload delete_instance(request, options = nil) + # Pass arguments to `delete_instance` via a request object, either of type + # {::Google::Cloud::SecureSourceManager::V1::DeleteInstanceRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::SecureSourceManager::V1::DeleteInstanceRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_instance(name: nil, request_id: nil) + # Pass arguments to `delete_instance` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param name [::String] + # Required. Name of the resource. + # @param request_id [::String] + # Optional. An optional request ID to identify requests. Specify a unique + # request ID so that if you must retry your request, the server will know to + # ignore the request if it has already been completed. The server will + # guarantee that for at least 60 minutes after the first request. + # + # For example, consider a situation where you make an initial request and + # the request times out. If you make the request again with the same request + # ID, the server can check if original operation with the same request ID + # was received, and if so, will ignore the second request. This prevents + # clients from accidentally creating duplicate commitments. + # + # The request ID must be a valid UUID with the exception that zero UUID is + # not supported (00000000-0000-0000-0000-000000000000). + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Gapic::Operation] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Gapic::Operation] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/secure_source_manager/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::SecureSourceManager::V1::SecureSourceManager::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::SecureSourceManager::V1::DeleteInstanceRequest.new + # + # # Call the delete_instance method. + # result = client.delete_instance 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_instance request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::SecureSourceManager::V1::DeleteInstanceRequest + + # Converts hash 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_instance.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::SecureSourceManager::V1::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + options.apply_defaults timeout: @config.rpcs.delete_instance.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.delete_instance.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @secure_source_manager_stub.delete_instance 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 Repositories in a given project and location. + # + # The instance field is required in the query parameter for requests using + # the securesourcemanager.googleapis.com endpoint. + # + # @overload list_repositories(request, options = nil) + # Pass arguments to `list_repositories` via a request object, either of type + # {::Google::Cloud::SecureSourceManager::V1::ListRepositoriesRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::SecureSourceManager::V1::ListRepositoriesRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_repositories(parent: nil, page_size: nil, page_token: nil, filter: nil, instance: nil) + # Pass arguments to `list_repositories` via keyword arguments. Note that at + # least one keyword argument is 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. Parent value for ListRepositoriesRequest. + # @param page_size [::Integer] + # Optional. Requested page size. Server may return fewer items than + # requested. If unspecified, server will pick an appropriate default. + # @param page_token [::String] + # A token identifying a page of results the server should return. + # @param filter [::String] + # Optional. Filter results. + # @param instance [::String] + # Optional. The name of the instance in which the repository is hosted, + # formatted as + # `projects/{project_number}/locations/{location_id}/instances/{instance_id}`. + # When listing repositories via securesourcemanager.googleapis.com, this + # field is required. When listing repositories via *.sourcemanager.dev, this + # field is ignored. + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Gapic::Rest::PagedEnumerable<::Google::Cloud::SecureSourceManager::V1::Repository>] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Gapic::Rest::PagedEnumerable<::Google::Cloud::SecureSourceManager::V1::Repository>] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/secure_source_manager/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::SecureSourceManager::V1::SecureSourceManager::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::SecureSourceManager::V1::ListRepositoriesRequest.new + # + # # Call the list_repositories method. + # result = client.list_repositories request + # + # # The returned object is of type Gapic::PagedEnumerable. You can iterate + # # over elements, and API calls will be issued to fetch pages as needed. + # result.each do |item| + # # Each element is of type ::Google::Cloud::SecureSourceManager::V1::Repository. + # p item + # end + # + def list_repositories request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::SecureSourceManager::V1::ListRepositoriesRequest + + # Converts hash 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_repositories.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::SecureSourceManager::V1::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + options.apply_defaults timeout: @config.rpcs.list_repositories.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.list_repositories.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @secure_source_manager_stub.list_repositories request, options do |result, operation| + result = ::Gapic::Rest::PagedEnumerable.new @secure_source_manager_stub, :list_repositories, "repositories", request, result, options + yield result, operation if block_given? + throw :response, result + end + rescue ::Gapic::Rest::Error => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Gets metadata of a repository. + # + # @overload get_repository(request, options = nil) + # Pass arguments to `get_repository` via a request object, either of type + # {::Google::Cloud::SecureSourceManager::V1::GetRepositoryRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::SecureSourceManager::V1::GetRepositoryRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_repository(name: nil) + # Pass arguments to `get_repository` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param name [::String] + # Required. Name of the repository to retrieve. + # The format is + # `projects/{project_number}/locations/{location_id}/repositories/{repository_id}`. + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Cloud::SecureSourceManager::V1::Repository] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::SecureSourceManager::V1::Repository] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/secure_source_manager/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::SecureSourceManager::V1::SecureSourceManager::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::SecureSourceManager::V1::GetRepositoryRequest.new + # + # # Call the get_repository method. + # result = client.get_repository request + # + # # The returned object is of type Google::Cloud::SecureSourceManager::V1::Repository. + # p result + # + def get_repository request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::SecureSourceManager::V1::GetRepositoryRequest + + # Converts hash 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_repository.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::SecureSourceManager::V1::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + options.apply_defaults timeout: @config.rpcs.get_repository.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.get_repository.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @secure_source_manager_stub.get_repository request, options do |result, operation| + yield result, operation if block_given? + end + rescue ::Gapic::Rest::Error => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Creates a new repository in a given project and location. + # + # The Repository.Instance field is required in the request body for requests + # using the securesourcemanager.googleapis.com endpoint. + # + # @overload create_repository(request, options = nil) + # Pass arguments to `create_repository` via a request object, either of type + # {::Google::Cloud::SecureSourceManager::V1::CreateRepositoryRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::SecureSourceManager::V1::CreateRepositoryRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_repository(parent: nil, repository: nil, repository_id: nil) + # Pass arguments to `create_repository` via keyword arguments. Note that at + # least one keyword argument is 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 project in which to create the repository. Values are of the + # form `projects/{project_number}/locations/{location_id}` + # @param repository [::Google::Cloud::SecureSourceManager::V1::Repository, ::Hash] + # Required. The resource being created. + # @param repository_id [::String] + # Required. The ID to use for the repository, which will become the final + # component of the repository's resource name. This value should be 4-63 + # characters, and valid characters are /[a-z][0-9]-/. + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Gapic::Operation] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Gapic::Operation] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/secure_source_manager/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::SecureSourceManager::V1::SecureSourceManager::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::SecureSourceManager::V1::CreateRepositoryRequest.new + # + # # Call the create_repository method. + # result = client.create_repository 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_repository request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::SecureSourceManager::V1::CreateRepositoryRequest + + # Converts hash 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_repository.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::SecureSourceManager::V1::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + options.apply_defaults timeout: @config.rpcs.create_repository.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.create_repository.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @secure_source_manager_stub.create_repository 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 + + ## + # Updates the metadata of a repository. + # + # @overload update_repository(request, options = nil) + # Pass arguments to `update_repository` via a request object, either of type + # {::Google::Cloud::SecureSourceManager::V1::UpdateRepositoryRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::SecureSourceManager::V1::UpdateRepositoryRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_repository(update_mask: nil, repository: nil, validate_only: nil) + # Pass arguments to `update_repository` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param update_mask [::Google::Protobuf::FieldMask, ::Hash] + # Optional. Field mask is used to specify the fields to be overwritten in the + # repository resource by the update. + # The fields specified in the update_mask are relative to the resource, not + # the full request. A field will be overwritten if it is in the mask. If the + # user does not provide a mask then all fields will be overwritten. + # @param repository [::Google::Cloud::SecureSourceManager::V1::Repository, ::Hash] + # Required. The repository being updated. + # @param validate_only [::Boolean] + # Optional. False by default. If set to true, the request is validated and + # the user is provided with an expected result, but no actual change is made. + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Gapic::Operation] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Gapic::Operation] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/secure_source_manager/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::SecureSourceManager::V1::SecureSourceManager::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::SecureSourceManager::V1::UpdateRepositoryRequest.new + # + # # Call the update_repository method. + # result = client.update_repository 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_repository request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::SecureSourceManager::V1::UpdateRepositoryRequest + + # Converts hash 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_repository.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::SecureSourceManager::V1::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + options.apply_defaults timeout: @config.rpcs.update_repository.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.update_repository.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @secure_source_manager_stub.update_repository 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 Repository. + # + # @overload delete_repository(request, options = nil) + # Pass arguments to `delete_repository` via a request object, either of type + # {::Google::Cloud::SecureSourceManager::V1::DeleteRepositoryRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::SecureSourceManager::V1::DeleteRepositoryRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_repository(name: nil, allow_missing: nil) + # Pass arguments to `delete_repository` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param name [::String] + # Required. Name of the repository to delete. + # The format is + # `projects/{project_number}/locations/{location_id}/repositories/{repository_id}`. + # @param allow_missing [::Boolean] + # Optional. If set to true, and the repository is not found, the request will + # succeed but no action will be taken on the server. + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Gapic::Operation] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Gapic::Operation] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/secure_source_manager/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::SecureSourceManager::V1::SecureSourceManager::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::SecureSourceManager::V1::DeleteRepositoryRequest.new + # + # # Call the delete_repository method. + # result = client.delete_repository 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_repository request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::SecureSourceManager::V1::DeleteRepositoryRequest + + # Converts hash 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_repository.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::SecureSourceManager::V1::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + options.apply_defaults timeout: @config.rpcs.delete_repository.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.delete_repository.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @secure_source_manager_stub.delete_repository 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 hooks in a given repository. + # + # @overload list_hooks(request, options = nil) + # Pass arguments to `list_hooks` via a request object, either of type + # {::Google::Cloud::SecureSourceManager::V1::ListHooksRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::SecureSourceManager::V1::ListHooksRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_hooks(parent: nil, page_size: nil, page_token: nil) + # Pass arguments to `list_hooks` via keyword arguments. Note that at + # least one keyword argument is 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. Parent value for ListHooksRequest. + # @param page_size [::Integer] + # Optional. Requested page size. Server may return fewer items than + # requested. If unspecified, server will pick an appropriate default. + # @param page_token [::String] + # Optional. A token identifying a page of results the server should return. + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Gapic::Rest::PagedEnumerable<::Google::Cloud::SecureSourceManager::V1::Hook>] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Gapic::Rest::PagedEnumerable<::Google::Cloud::SecureSourceManager::V1::Hook>] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/secure_source_manager/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::SecureSourceManager::V1::SecureSourceManager::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::SecureSourceManager::V1::ListHooksRequest.new + # + # # Call the list_hooks method. + # result = client.list_hooks request + # + # # The returned object is of type Gapic::PagedEnumerable. You can iterate + # # over elements, and API calls will be issued to fetch pages as needed. + # result.each do |item| + # # Each element is of type ::Google::Cloud::SecureSourceManager::V1::Hook. + # p item + # end + # + def list_hooks request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::SecureSourceManager::V1::ListHooksRequest + + # Converts hash 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_hooks.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::SecureSourceManager::V1::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + options.apply_defaults timeout: @config.rpcs.list_hooks.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.list_hooks.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @secure_source_manager_stub.list_hooks request, options do |result, operation| + result = ::Gapic::Rest::PagedEnumerable.new @secure_source_manager_stub, :list_hooks, "hooks", request, result, options + yield result, operation if block_given? + throw :response, result + end + rescue ::Gapic::Rest::Error => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Gets metadata of a hook. + # + # @overload get_hook(request, options = nil) + # Pass arguments to `get_hook` via a request object, either of type + # {::Google::Cloud::SecureSourceManager::V1::GetHookRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::SecureSourceManager::V1::GetHookRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_hook(name: nil) + # Pass arguments to `get_hook` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param name [::String] + # Required. Name of the hook to retrieve. + # The format is + # `projects/{project_number}/locations/{location_id}/repositories/{repository_id}/hooks/{hook_id}`. + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Cloud::SecureSourceManager::V1::Hook] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::SecureSourceManager::V1::Hook] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/secure_source_manager/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::SecureSourceManager::V1::SecureSourceManager::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::SecureSourceManager::V1::GetHookRequest.new + # + # # Call the get_hook method. + # result = client.get_hook request + # + # # The returned object is of type Google::Cloud::SecureSourceManager::V1::Hook. + # p result + # + def get_hook request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::SecureSourceManager::V1::GetHookRequest + + # Converts hash 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_hook.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::SecureSourceManager::V1::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + options.apply_defaults timeout: @config.rpcs.get_hook.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.get_hook.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @secure_source_manager_stub.get_hook request, options do |result, operation| + yield result, operation if block_given? + end + rescue ::Gapic::Rest::Error => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Creates a new hook in a given repository. + # + # @overload create_hook(request, options = nil) + # Pass arguments to `create_hook` via a request object, either of type + # {::Google::Cloud::SecureSourceManager::V1::CreateHookRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::SecureSourceManager::V1::CreateHookRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_hook(parent: nil, hook: nil, hook_id: nil) + # Pass arguments to `create_hook` via keyword arguments. Note that at + # least one keyword argument is 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 repository in which to create the hook. Values are of the + # form + # `projects/{project_number}/locations/{location_id}/repositories/{repository_id}` + # @param hook [::Google::Cloud::SecureSourceManager::V1::Hook, ::Hash] + # Required. The resource being created. + # @param hook_id [::String] + # Required. The ID to use for the hook, which will become the final component + # of the hook's resource name. This value restricts to lower-case letters, + # numbers, and hyphen, with the first character a letter, the last a letter + # or a number, and a 63 character maximum. + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Gapic::Operation] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Gapic::Operation] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/secure_source_manager/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::SecureSourceManager::V1::SecureSourceManager::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::SecureSourceManager::V1::CreateHookRequest.new + # + # # Call the create_hook method. + # result = client.create_hook 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_hook request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::SecureSourceManager::V1::CreateHookRequest + + # Converts hash 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_hook.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::SecureSourceManager::V1::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + options.apply_defaults timeout: @config.rpcs.create_hook.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.create_hook.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @secure_source_manager_stub.create_hook 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 + + ## + # Updates the metadata of a hook. + # + # @overload update_hook(request, options = nil) + # Pass arguments to `update_hook` via a request object, either of type + # {::Google::Cloud::SecureSourceManager::V1::UpdateHookRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::SecureSourceManager::V1::UpdateHookRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_hook(update_mask: nil, hook: nil) + # Pass arguments to `update_hook` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param update_mask [::Google::Protobuf::FieldMask, ::Hash] + # Required. Field mask is used to specify the fields to be overwritten in the + # hook resource by the update. + # The fields specified in the update_mask are relative to the resource, not + # the full request. A field will be overwritten if it is in the mask. + # The special value "*" means full replacement. + # @param hook [::Google::Cloud::SecureSourceManager::V1::Hook, ::Hash] + # Required. The hook being updated. + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Gapic::Operation] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Gapic::Operation] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/secure_source_manager/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::SecureSourceManager::V1::SecureSourceManager::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::SecureSourceManager::V1::UpdateHookRequest.new + # + # # Call the update_hook method. + # result = client.update_hook 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_hook request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::SecureSourceManager::V1::UpdateHookRequest + + # Converts hash 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_hook.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::SecureSourceManager::V1::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + options.apply_defaults timeout: @config.rpcs.update_hook.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.update_hook.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @secure_source_manager_stub.update_hook 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 Hook. + # + # @overload delete_hook(request, options = nil) + # Pass arguments to `delete_hook` via a request object, either of type + # {::Google::Cloud::SecureSourceManager::V1::DeleteHookRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::SecureSourceManager::V1::DeleteHookRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_hook(name: nil) + # Pass arguments to `delete_hook` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param name [::String] + # Required. Name of the hook to delete. + # The format is + # `projects/{project_number}/locations/{location_id}/repositories/{repository_id}/hooks/{hook_id}`. + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Gapic::Operation] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Gapic::Operation] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/secure_source_manager/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::SecureSourceManager::V1::SecureSourceManager::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::SecureSourceManager::V1::DeleteHookRequest.new + # + # # Call the delete_hook method. + # result = client.delete_hook 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_hook request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::SecureSourceManager::V1::DeleteHookRequest + + # Converts hash 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_hook.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::SecureSourceManager::V1::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + options.apply_defaults timeout: @config.rpcs.delete_hook.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.delete_hook.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @secure_source_manager_stub.delete_hook 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 + + ## + # Get IAM policy for a repository. + # + # @overload get_iam_policy_repo(request, options = nil) + # Pass arguments to `get_iam_policy_repo` via a request object, either of type + # {::Google::Iam::V1::GetIamPolicyRequest} or an equivalent Hash. + # + # @param request [::Google::Iam::V1::GetIamPolicyRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @overload get_iam_policy_repo(resource: nil, options: nil) + # Pass arguments to `get_iam_policy_repo` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param resource [::String] + # REQUIRED: The resource for which the policy is being requested. + # See the operation documentation for the appropriate value for this field. + # @param options [::Google::Iam::V1::GetPolicyOptions, ::Hash] + # OPTIONAL: A `GetPolicyOptions` object for specifying options to + # `GetIamPolicy`. + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Iam::V1::Policy] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Iam::V1::Policy] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/secure_source_manager/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::SecureSourceManager::V1::SecureSourceManager::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Iam::V1::GetIamPolicyRequest.new + # + # # Call the get_iam_policy_repo method. + # result = client.get_iam_policy_repo request + # + # # The returned object is of type Google::Iam::V1::Policy. + # p result + # + def get_iam_policy_repo request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Iam::V1::GetIamPolicyRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + call_metadata = @config.rpcs.get_iam_policy_repo.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::SecureSourceManager::V1::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + options.apply_defaults timeout: @config.rpcs.get_iam_policy_repo.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.get_iam_policy_repo.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @secure_source_manager_stub.get_iam_policy_repo 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 + + ## + # Set IAM policy on a repository. + # + # @overload set_iam_policy_repo(request, options = nil) + # Pass arguments to `set_iam_policy_repo` via a request object, either of type + # {::Google::Iam::V1::SetIamPolicyRequest} or an equivalent Hash. + # + # @param request [::Google::Iam::V1::SetIamPolicyRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @overload set_iam_policy_repo(resource: nil, policy: nil, update_mask: nil) + # Pass arguments to `set_iam_policy_repo` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param resource [::String] + # REQUIRED: The resource for which the policy is being specified. + # See the operation documentation for the appropriate value for this field. + # @param policy [::Google::Iam::V1::Policy, ::Hash] + # REQUIRED: The complete policy to be applied to the `resource`. The size of + # the policy is limited to a few 10s of KB. An empty policy is a + # valid policy but certain Cloud Platform services (such as Projects) + # might reject them. + # @param update_mask [::Google::Protobuf::FieldMask, ::Hash] + # OPTIONAL: A FieldMask specifying which fields of the policy to modify. Only + # the fields in the mask will be modified. If no mask is provided, the + # following default mask is used: + # + # `paths: "bindings, etag"` + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Iam::V1::Policy] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Iam::V1::Policy] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/secure_source_manager/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::SecureSourceManager::V1::SecureSourceManager::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Iam::V1::SetIamPolicyRequest.new + # + # # Call the set_iam_policy_repo method. + # result = client.set_iam_policy_repo request + # + # # The returned object is of type Google::Iam::V1::Policy. + # p result + # + def set_iam_policy_repo request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Iam::V1::SetIamPolicyRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + call_metadata = @config.rpcs.set_iam_policy_repo.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::SecureSourceManager::V1::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + options.apply_defaults timeout: @config.rpcs.set_iam_policy_repo.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.set_iam_policy_repo.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @secure_source_manager_stub.set_iam_policy_repo 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 + + ## + # Test IAM permissions on a repository. + # IAM permission checks are not required on this method. + # + # @overload test_iam_permissions_repo(request, options = nil) + # Pass arguments to `test_iam_permissions_repo` via a request object, either of type + # {::Google::Iam::V1::TestIamPermissionsRequest} or an equivalent Hash. + # + # @param request [::Google::Iam::V1::TestIamPermissionsRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @overload test_iam_permissions_repo(resource: nil, permissions: nil) + # Pass arguments to `test_iam_permissions_repo` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param resource [::String] + # REQUIRED: The resource for which the policy detail is being requested. + # See the operation documentation for the appropriate value for this field. + # @param permissions [::Array<::String>] + # The set of permissions to check for the `resource`. Permissions with + # wildcards (such as '*' or 'storage.*') are not allowed. For more + # information see + # [IAM Overview](https://cloud.google.com/iam/docs/overview#permissions). + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Iam::V1::TestIamPermissionsResponse] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Iam::V1::TestIamPermissionsResponse] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/secure_source_manager/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::SecureSourceManager::V1::SecureSourceManager::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Iam::V1::TestIamPermissionsRequest.new + # + # # Call the test_iam_permissions_repo method. + # result = client.test_iam_permissions_repo request + # + # # The returned object is of type Google::Iam::V1::TestIamPermissionsResponse. + # p result + # + def test_iam_permissions_repo request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Iam::V1::TestIamPermissionsRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + call_metadata = @config.rpcs.test_iam_permissions_repo.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::SecureSourceManager::V1::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + options.apply_defaults timeout: @config.rpcs.test_iam_permissions_repo.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.test_iam_permissions_repo.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @secure_source_manager_stub.test_iam_permissions_repo 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 + + ## + # CreateBranchRule creates a branch rule in a given repository. + # + # @overload create_branch_rule(request, options = nil) + # Pass arguments to `create_branch_rule` via a request object, either of type + # {::Google::Cloud::SecureSourceManager::V1::CreateBranchRuleRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::SecureSourceManager::V1::CreateBranchRuleRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_branch_rule(parent: nil, branch_rule: nil, branch_rule_id: nil) + # Pass arguments to `create_branch_rule` via keyword arguments. Note that at + # least one keyword argument is 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] + # @param branch_rule [::Google::Cloud::SecureSourceManager::V1::BranchRule, ::Hash] + # @param branch_rule_id [::String] + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Gapic::Operation] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Gapic::Operation] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/secure_source_manager/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::SecureSourceManager::V1::SecureSourceManager::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::SecureSourceManager::V1::CreateBranchRuleRequest.new + # + # # Call the create_branch_rule method. + # result = client.create_branch_rule 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_branch_rule request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::SecureSourceManager::V1::CreateBranchRuleRequest + + # Converts hash 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_branch_rule.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::SecureSourceManager::V1::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + options.apply_defaults timeout: @config.rpcs.create_branch_rule.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.create_branch_rule.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @secure_source_manager_stub.create_branch_rule 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 + + ## + # ListBranchRules lists branch rules in a given repository. + # + # @overload list_branch_rules(request, options = nil) + # Pass arguments to `list_branch_rules` via a request object, either of type + # {::Google::Cloud::SecureSourceManager::V1::ListBranchRulesRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::SecureSourceManager::V1::ListBranchRulesRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_branch_rules(parent: nil, page_size: nil, page_token: nil) + # Pass arguments to `list_branch_rules` via keyword arguments. Note that at + # least one keyword argument is 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] + # @param page_size [::Integer] + # @param page_token [::String] + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Gapic::Rest::PagedEnumerable<::Google::Cloud::SecureSourceManager::V1::BranchRule>] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Gapic::Rest::PagedEnumerable<::Google::Cloud::SecureSourceManager::V1::BranchRule>] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/secure_source_manager/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::SecureSourceManager::V1::SecureSourceManager::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::SecureSourceManager::V1::ListBranchRulesRequest.new + # + # # Call the list_branch_rules method. + # result = client.list_branch_rules request + # + # # The returned object is of type Gapic::PagedEnumerable. You can iterate + # # over elements, and API calls will be issued to fetch pages as needed. + # result.each do |item| + # # Each element is of type ::Google::Cloud::SecureSourceManager::V1::BranchRule. + # p item + # end + # + def list_branch_rules request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::SecureSourceManager::V1::ListBranchRulesRequest + + # Converts hash 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_branch_rules.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::SecureSourceManager::V1::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + options.apply_defaults timeout: @config.rpcs.list_branch_rules.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.list_branch_rules.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @secure_source_manager_stub.list_branch_rules request, options do |result, operation| + result = ::Gapic::Rest::PagedEnumerable.new @secure_source_manager_stub, :list_branch_rules, "branch_rules", 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 + + ## + # GetBranchRule gets a branch rule. + # + # @overload get_branch_rule(request, options = nil) + # Pass arguments to `get_branch_rule` via a request object, either of type + # {::Google::Cloud::SecureSourceManager::V1::GetBranchRuleRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::SecureSourceManager::V1::GetBranchRuleRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_branch_rule(name: nil) + # Pass arguments to `get_branch_rule` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param name [::String] + # Required. Name of the repository to retrieve. + # The format is + # `projects/{project}/locations/{location}/repositories/{repository}/branchRules/{branch_rule}`. + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Cloud::SecureSourceManager::V1::BranchRule] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::SecureSourceManager::V1::BranchRule] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/secure_source_manager/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::SecureSourceManager::V1::SecureSourceManager::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::SecureSourceManager::V1::GetBranchRuleRequest.new + # + # # Call the get_branch_rule method. + # result = client.get_branch_rule request + # + # # The returned object is of type Google::Cloud::SecureSourceManager::V1::BranchRule. + # p result + # + def get_branch_rule request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::SecureSourceManager::V1::GetBranchRuleRequest + + # Converts hash 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_branch_rule.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::SecureSourceManager::V1::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + options.apply_defaults timeout: @config.rpcs.get_branch_rule.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.get_branch_rule.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @secure_source_manager_stub.get_branch_rule 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 + + ## + # UpdateBranchRule updates a branch rule. + # + # @overload update_branch_rule(request, options = nil) + # Pass arguments to `update_branch_rule` via a request object, either of type + # {::Google::Cloud::SecureSourceManager::V1::UpdateBranchRuleRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::SecureSourceManager::V1::UpdateBranchRuleRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_branch_rule(branch_rule: nil, validate_only: nil, update_mask: nil) + # Pass arguments to `update_branch_rule` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param branch_rule [::Google::Cloud::SecureSourceManager::V1::BranchRule, ::Hash] + # @param validate_only [::Boolean] + # Optional. If set, validate the request and preview the review, but do not + # actually post it. (https://google.aip.dev/163, for declarative friendly) + # @param update_mask [::Google::Protobuf::FieldMask, ::Hash] + # Required. Field mask is used to specify the fields to be overwritten in the + # branchRule resource by the update. + # The fields specified in the update_mask are relative to the resource, not + # the full request. A field will be overwritten if it is in the mask. + # The special value "*" means full replacement. + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Gapic::Operation] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Gapic::Operation] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/secure_source_manager/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::SecureSourceManager::V1::SecureSourceManager::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::SecureSourceManager::V1::UpdateBranchRuleRequest.new + # + # # Call the update_branch_rule method. + # result = client.update_branch_rule 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_branch_rule request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::SecureSourceManager::V1::UpdateBranchRuleRequest + + # Converts hash 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_branch_rule.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::SecureSourceManager::V1::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + options.apply_defaults timeout: @config.rpcs.update_branch_rule.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.update_branch_rule.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @secure_source_manager_stub.update_branch_rule 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 + + ## + # DeleteBranchRule deletes a branch rule. + # + # @overload delete_branch_rule(request, options = nil) + # Pass arguments to `delete_branch_rule` via a request object, either of type + # {::Google::Cloud::SecureSourceManager::V1::DeleteBranchRuleRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::SecureSourceManager::V1::DeleteBranchRuleRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_branch_rule(name: nil, allow_missing: nil) + # Pass arguments to `delete_branch_rule` via keyword arguments. Note that at + # least one keyword argument is 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] + # @param allow_missing [::Boolean] + # Optional. If set to true, and the branch rule is not found, the request + # will succeed but no action will be taken on the server. + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Gapic::Operation] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Gapic::Operation] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/secure_source_manager/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::SecureSourceManager::V1::SecureSourceManager::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::SecureSourceManager::V1::DeleteBranchRuleRequest.new + # + # # Call the delete_branch_rule method. + # result = client.delete_branch_rule 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_branch_rule request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::SecureSourceManager::V1::DeleteBranchRuleRequest + + # Converts hash 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_branch_rule.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::SecureSourceManager::V1::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + options.apply_defaults timeout: @config.rpcs.delete_branch_rule.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.delete_branch_rule.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @secure_source_manager_stub.delete_branch_rule 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 + + ## + # Creates a pull request. + # + # @overload create_pull_request(request, options = nil) + # Pass arguments to `create_pull_request` via a request object, either of type + # {::Google::Cloud::SecureSourceManager::V1::CreatePullRequestRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::SecureSourceManager::V1::CreatePullRequestRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_pull_request(parent: nil, pull_request: nil) + # Pass arguments to `create_pull_request` via keyword arguments. Note that at + # least one keyword argument is 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 repository that the pull request is created from. Format: + # `projects/{project_number}/locations/{location_id}/repositories/{repository_id}` + # @param pull_request [::Google::Cloud::SecureSourceManager::V1::PullRequest, ::Hash] + # Required. The pull request to create. + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Gapic::Operation] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Gapic::Operation] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/secure_source_manager/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::SecureSourceManager::V1::SecureSourceManager::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::SecureSourceManager::V1::CreatePullRequestRequest.new + # + # # Call the create_pull_request method. + # result = client.create_pull_request 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_pull_request request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::SecureSourceManager::V1::CreatePullRequestRequest + + # Converts hash 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_pull_request.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::SecureSourceManager::V1::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + options.apply_defaults timeout: @config.rpcs.create_pull_request.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.create_pull_request.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @secure_source_manager_stub.create_pull_request 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 pull request. + # + # @overload get_pull_request(request, options = nil) + # Pass arguments to `get_pull_request` via a request object, either of type + # {::Google::Cloud::SecureSourceManager::V1::GetPullRequestRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::SecureSourceManager::V1::GetPullRequestRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_pull_request(name: nil) + # Pass arguments to `get_pull_request` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param name [::String] + # Required. Name of the pull request to retrieve. + # The format is + # `projects/{project}/locations/{location}/repositories/{repository}/pullRequests/{pull_request}`. + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Cloud::SecureSourceManager::V1::PullRequest] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::SecureSourceManager::V1::PullRequest] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/secure_source_manager/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::SecureSourceManager::V1::SecureSourceManager::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::SecureSourceManager::V1::GetPullRequestRequest.new + # + # # Call the get_pull_request method. + # result = client.get_pull_request request + # + # # The returned object is of type Google::Cloud::SecureSourceManager::V1::PullRequest. + # p result + # + def get_pull_request request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::SecureSourceManager::V1::GetPullRequestRequest + + # Converts hash 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_pull_request.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::SecureSourceManager::V1::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + options.apply_defaults timeout: @config.rpcs.get_pull_request.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.get_pull_request.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @secure_source_manager_stub.get_pull_request request, options do |result, operation| + yield result, operation if block_given? + end + rescue ::Gapic::Rest::Error => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Lists pull requests in a repository. + # + # @overload list_pull_requests(request, options = nil) + # Pass arguments to `list_pull_requests` via a request object, either of type + # {::Google::Cloud::SecureSourceManager::V1::ListPullRequestsRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::SecureSourceManager::V1::ListPullRequestsRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_pull_requests(parent: nil, page_size: nil, page_token: nil) + # Pass arguments to `list_pull_requests` via keyword arguments. Note that at + # least one keyword argument is 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 repository in which to list pull requests. Format: + # `projects/{project_number}/locations/{location_id}/repositories/{repository_id}` + # @param page_size [::Integer] + # Optional. Requested page size. Server may return fewer items than + # requested. If unspecified, server will pick an appropriate default. + # @param page_token [::String] + # Optional. A token identifying a page of results the server should return. + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Gapic::Rest::PagedEnumerable<::Google::Cloud::SecureSourceManager::V1::PullRequest>] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Gapic::Rest::PagedEnumerable<::Google::Cloud::SecureSourceManager::V1::PullRequest>] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/secure_source_manager/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::SecureSourceManager::V1::SecureSourceManager::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::SecureSourceManager::V1::ListPullRequestsRequest.new + # + # # Call the list_pull_requests method. + # result = client.list_pull_requests request + # + # # The returned object is of type Gapic::PagedEnumerable. You can iterate + # # over elements, and API calls will be issued to fetch pages as needed. + # result.each do |item| + # # Each element is of type ::Google::Cloud::SecureSourceManager::V1::PullRequest. + # p item + # end + # + def list_pull_requests request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::SecureSourceManager::V1::ListPullRequestsRequest + + # Converts hash 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_pull_requests.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::SecureSourceManager::V1::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + options.apply_defaults timeout: @config.rpcs.list_pull_requests.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.list_pull_requests.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @secure_source_manager_stub.list_pull_requests request, options do |result, operation| + result = ::Gapic::Rest::PagedEnumerable.new @secure_source_manager_stub, :list_pull_requests, "pull_requests", 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 + + ## + # Updates a pull request. + # + # @overload update_pull_request(request, options = nil) + # Pass arguments to `update_pull_request` via a request object, either of type + # {::Google::Cloud::SecureSourceManager::V1::UpdatePullRequestRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::SecureSourceManager::V1::UpdatePullRequestRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_pull_request(pull_request: nil, update_mask: nil) + # Pass arguments to `update_pull_request` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param pull_request [::Google::Cloud::SecureSourceManager::V1::PullRequest, ::Hash] + # Required. The pull request to update. + # @param update_mask [::Google::Protobuf::FieldMask, ::Hash] + # Optional. Field mask is used to specify the fields to be overwritten in the + # pull request resource by the update. + # The fields specified in the update_mask are relative to the resource, not + # the full request. A field will be overwritten if it is in the mask. + # The special value "*" means full replacement. + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Gapic::Operation] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Gapic::Operation] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/secure_source_manager/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::SecureSourceManager::V1::SecureSourceManager::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::SecureSourceManager::V1::UpdatePullRequestRequest.new + # + # # Call the update_pull_request method. + # result = client.update_pull_request 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_pull_request request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::SecureSourceManager::V1::UpdatePullRequestRequest + + # Converts hash 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_pull_request.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::SecureSourceManager::V1::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + options.apply_defaults timeout: @config.rpcs.update_pull_request.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.update_pull_request.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @secure_source_manager_stub.update_pull_request 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 + + ## + # Merges a pull request. + # + # @overload merge_pull_request(request, options = nil) + # Pass arguments to `merge_pull_request` via a request object, either of type + # {::Google::Cloud::SecureSourceManager::V1::MergePullRequestRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::SecureSourceManager::V1::MergePullRequestRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @overload merge_pull_request(name: nil) + # Pass arguments to `merge_pull_request` via keyword arguments. Note that at + # least one keyword argument is 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 pull request to merge. + # Format: + # `projects/{project_number}/locations/{location_id}/repositories/{repository_id}/pullRequests/{pull_request_id}` + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Gapic::Operation] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Gapic::Operation] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/secure_source_manager/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::SecureSourceManager::V1::SecureSourceManager::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::SecureSourceManager::V1::MergePullRequestRequest.new + # + # # Call the merge_pull_request method. + # result = client.merge_pull_request 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 merge_pull_request request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::SecureSourceManager::V1::MergePullRequestRequest + + # Converts hash 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.merge_pull_request.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::SecureSourceManager::V1::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + options.apply_defaults timeout: @config.rpcs.merge_pull_request.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.merge_pull_request.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @secure_source_manager_stub.merge_pull_request 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 + + ## + # Opens a pull request. + # + # @overload open_pull_request(request, options = nil) + # Pass arguments to `open_pull_request` via a request object, either of type + # {::Google::Cloud::SecureSourceManager::V1::OpenPullRequestRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::SecureSourceManager::V1::OpenPullRequestRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @overload open_pull_request(name: nil) + # Pass arguments to `open_pull_request` via keyword arguments. Note that at + # least one keyword argument is 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 pull request to open. + # Format: + # `projects/{project_number}/locations/{location_id}/repositories/{repository_id}/pullRequests/{pull_request_id}` + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Gapic::Operation] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Gapic::Operation] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/secure_source_manager/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::SecureSourceManager::V1::SecureSourceManager::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::SecureSourceManager::V1::OpenPullRequestRequest.new + # + # # Call the open_pull_request method. + # result = client.open_pull_request 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 open_pull_request request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::SecureSourceManager::V1::OpenPullRequestRequest + + # Converts hash 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.open_pull_request.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::SecureSourceManager::V1::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + options.apply_defaults timeout: @config.rpcs.open_pull_request.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.open_pull_request.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @secure_source_manager_stub.open_pull_request 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 + + ## + # Closes a pull request without merging. + # + # @overload close_pull_request(request, options = nil) + # Pass arguments to `close_pull_request` via a request object, either of type + # {::Google::Cloud::SecureSourceManager::V1::ClosePullRequestRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::SecureSourceManager::V1::ClosePullRequestRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @overload close_pull_request(name: nil) + # Pass arguments to `close_pull_request` via keyword arguments. Note that at + # least one keyword argument is 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 pull request to close. + # Format: + # `projects/{project_number}/locations/{location_id}/repositories/{repository_id}/pullRequests/{pull_request_id}` + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Gapic::Operation] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Gapic::Operation] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/secure_source_manager/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::SecureSourceManager::V1::SecureSourceManager::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::SecureSourceManager::V1::ClosePullRequestRequest.new + # + # # Call the close_pull_request method. + # result = client.close_pull_request 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 close_pull_request request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::SecureSourceManager::V1::ClosePullRequestRequest + + # Converts hash 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.close_pull_request.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::SecureSourceManager::V1::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + options.apply_defaults timeout: @config.rpcs.close_pull_request.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.close_pull_request.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @secure_source_manager_stub.close_pull_request 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 a pull request's file diffs. + # + # @overload list_pull_request_file_diffs(request, options = nil) + # Pass arguments to `list_pull_request_file_diffs` via a request object, either of type + # {::Google::Cloud::SecureSourceManager::V1::ListPullRequestFileDiffsRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::SecureSourceManager::V1::ListPullRequestFileDiffsRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_pull_request_file_diffs(name: nil, page_size: nil, page_token: nil) + # Pass arguments to `list_pull_request_file_diffs` via keyword arguments. Note that at + # least one keyword argument is 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 pull request to list file diffs for. + # Format: + # `projects/{project_number}/locations/{location_id}/repositories/{repository_id}/pullRequests/{pull_request_id}` + # @param page_size [::Integer] + # Optional. Requested page size. Server may return fewer items than + # requested. If unspecified, server will pick an appropriate default. + # @param page_token [::String] + # Optional. A token identifying a page of results the server should return. + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Gapic::Rest::PagedEnumerable<::Google::Cloud::SecureSourceManager::V1::FileDiff>] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Gapic::Rest::PagedEnumerable<::Google::Cloud::SecureSourceManager::V1::FileDiff>] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/secure_source_manager/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::SecureSourceManager::V1::SecureSourceManager::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::SecureSourceManager::V1::ListPullRequestFileDiffsRequest.new + # + # # Call the list_pull_request_file_diffs method. + # result = client.list_pull_request_file_diffs request + # + # # The returned object is of type Gapic::PagedEnumerable. You can iterate + # # over elements, and API calls will be issued to fetch pages as needed. + # result.each do |item| + # # Each element is of type ::Google::Cloud::SecureSourceManager::V1::FileDiff. + # p item + # end + # + def list_pull_request_file_diffs request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::SecureSourceManager::V1::ListPullRequestFileDiffsRequest + + # Converts hash 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_pull_request_file_diffs.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::SecureSourceManager::V1::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + options.apply_defaults timeout: @config.rpcs.list_pull_request_file_diffs.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.list_pull_request_file_diffs.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @secure_source_manager_stub.list_pull_request_file_diffs request, options do |result, operation| + result = ::Gapic::Rest::PagedEnumerable.new @secure_source_manager_stub, :list_pull_request_file_diffs, "file_diffs", 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 + + ## + # Fetches a tree from a repository. + # + # @overload fetch_tree(request, options = nil) + # Pass arguments to `fetch_tree` via a request object, either of type + # {::Google::Cloud::SecureSourceManager::V1::FetchTreeRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::SecureSourceManager::V1::FetchTreeRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @overload fetch_tree(repository: nil, ref: nil, recursive: nil, page_size: nil, page_token: nil) + # Pass arguments to `fetch_tree` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param repository [::String] + # Required. The format is + # `projects/{project_number}/locations/{location_id}/repositories/{repository_id}`. + # Specifies the repository to fetch the tree from. + # @param ref [::String] + # Optional. `ref` can be a SHA-1 hash, a branch name, or a tag. Specifies + # which tree to fetch. If not specified, the default branch will be used. + # @param recursive [::Boolean] + # Optional. If true, include all subfolders and their files in the response. + # If false, only the immediate children are returned. + # @param page_size [::Integer] + # Optional. Requested page size. Server may return fewer items than + # requested. If unspecified, at most 10,000 items will be returned. + # @param page_token [::String] + # Optional. A token identifying a page of results the server should return. + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Gapic::Rest::PagedEnumerable<::Google::Cloud::SecureSourceManager::V1::TreeEntry>] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Gapic::Rest::PagedEnumerable<::Google::Cloud::SecureSourceManager::V1::TreeEntry>] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/secure_source_manager/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::SecureSourceManager::V1::SecureSourceManager::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::SecureSourceManager::V1::FetchTreeRequest.new + # + # # Call the fetch_tree method. + # result = client.fetch_tree request + # + # # The returned object is of type Gapic::PagedEnumerable. You can iterate + # # over elements, and API calls will be issued to fetch pages as needed. + # result.each do |item| + # # Each element is of type ::Google::Cloud::SecureSourceManager::V1::TreeEntry. + # p item + # end + # + def fetch_tree request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::SecureSourceManager::V1::FetchTreeRequest + + # Converts hash 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.fetch_tree.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::SecureSourceManager::V1::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + options.apply_defaults timeout: @config.rpcs.fetch_tree.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.fetch_tree.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @secure_source_manager_stub.fetch_tree request, options do |result, operation| + result = ::Gapic::Rest::PagedEnumerable.new @secure_source_manager_stub, :fetch_tree, "tree_entries", 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 + + ## + # Fetches a blob from a repository. + # + # @overload fetch_blob(request, options = nil) + # Pass arguments to `fetch_blob` via a request object, either of type + # {::Google::Cloud::SecureSourceManager::V1::FetchBlobRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::SecureSourceManager::V1::FetchBlobRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @overload fetch_blob(repository: nil, sha: nil) + # Pass arguments to `fetch_blob` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param repository [::String] + # Required. The format is + # `projects/{project_number}/locations/{location_id}/repositories/{repository_id}`. + # Specifies the repository containing the blob. + # @param sha [::String] + # Required. The SHA-1 hash of the blob to retrieve. + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Cloud::SecureSourceManager::V1::FetchBlobResponse] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::SecureSourceManager::V1::FetchBlobResponse] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/secure_source_manager/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::SecureSourceManager::V1::SecureSourceManager::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::SecureSourceManager::V1::FetchBlobRequest.new + # + # # Call the fetch_blob method. + # result = client.fetch_blob request + # + # # The returned object is of type Google::Cloud::SecureSourceManager::V1::FetchBlobResponse. + # p result + # + def fetch_blob request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::SecureSourceManager::V1::FetchBlobRequest + + # Converts hash 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.fetch_blob.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::SecureSourceManager::V1::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + options.apply_defaults timeout: @config.rpcs.fetch_blob.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.fetch_blob.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @secure_source_manager_stub.fetch_blob request, options do |result, operation| + yield result, operation if block_given? + end + rescue ::Gapic::Rest::Error => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Creates an issue. + # + # @overload create_issue(request, options = nil) + # Pass arguments to `create_issue` via a request object, either of type + # {::Google::Cloud::SecureSourceManager::V1::CreateIssueRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::SecureSourceManager::V1::CreateIssueRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_issue(parent: nil, issue: nil) + # Pass arguments to `create_issue` via keyword arguments. Note that at + # least one keyword argument is 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 repository in which to create the issue. Format: + # `projects/{project_number}/locations/{location_id}/repositories/{repository_id}` + # @param issue [::Google::Cloud::SecureSourceManager::V1::Issue, ::Hash] + # Required. The issue to create. + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Gapic::Operation] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Gapic::Operation] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/secure_source_manager/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::SecureSourceManager::V1::SecureSourceManager::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::SecureSourceManager::V1::CreateIssueRequest.new + # + # # Call the create_issue method. + # result = client.create_issue 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_issue request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::SecureSourceManager::V1::CreateIssueRequest + + # Converts hash 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_issue.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::SecureSourceManager::V1::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + options.apply_defaults timeout: @config.rpcs.create_issue.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.create_issue.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @secure_source_manager_stub.create_issue 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 issue. + # + # @overload get_issue(request, options = nil) + # Pass arguments to `get_issue` via a request object, either of type + # {::Google::Cloud::SecureSourceManager::V1::GetIssueRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::SecureSourceManager::V1::GetIssueRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_issue(name: nil) + # Pass arguments to `get_issue` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param name [::String] + # Required. Name of the issue to retrieve. + # The format is + # `projects/{project}/locations/{location}/repositories/{repository}/issues/{issue_id}`. + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Cloud::SecureSourceManager::V1::Issue] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::SecureSourceManager::V1::Issue] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/secure_source_manager/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::SecureSourceManager::V1::SecureSourceManager::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::SecureSourceManager::V1::GetIssueRequest.new + # + # # Call the get_issue method. + # result = client.get_issue request + # + # # The returned object is of type Google::Cloud::SecureSourceManager::V1::Issue. + # p result + # + def get_issue request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::SecureSourceManager::V1::GetIssueRequest + + # Converts hash 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_issue.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::SecureSourceManager::V1::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + options.apply_defaults timeout: @config.rpcs.get_issue.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.get_issue.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @secure_source_manager_stub.get_issue request, options do |result, operation| + yield result, operation if block_given? + end + rescue ::Gapic::Rest::Error => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Lists issues in a repository. + # + # @overload list_issues(request, options = nil) + # Pass arguments to `list_issues` via a request object, either of type + # {::Google::Cloud::SecureSourceManager::V1::ListIssuesRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::SecureSourceManager::V1::ListIssuesRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_issues(parent: nil, page_size: nil, page_token: nil, filter: nil) + # Pass arguments to `list_issues` via keyword arguments. Note that at + # least one keyword argument is 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 repository in which to list issues. Format: + # `projects/{project_number}/locations/{location_id}/repositories/{repository_id}` + # @param page_size [::Integer] + # Optional. Requested page size. Server may return fewer items than + # requested. If unspecified, server will pick an appropriate default. + # @param page_token [::String] + # Optional. A token identifying a page of results the server should return. + # @param filter [::String] + # Optional. Used to filter the resulting issues list. + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Gapic::Rest::PagedEnumerable<::Google::Cloud::SecureSourceManager::V1::Issue>] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Gapic::Rest::PagedEnumerable<::Google::Cloud::SecureSourceManager::V1::Issue>] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/secure_source_manager/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::SecureSourceManager::V1::SecureSourceManager::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::SecureSourceManager::V1::ListIssuesRequest.new + # + # # Call the list_issues method. + # result = client.list_issues request + # + # # The returned object is of type Gapic::PagedEnumerable. You can iterate + # # over elements, and API calls will be issued to fetch pages as needed. + # result.each do |item| + # # Each element is of type ::Google::Cloud::SecureSourceManager::V1::Issue. + # p item + # end + # + def list_issues request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::SecureSourceManager::V1::ListIssuesRequest + + # Converts hash 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_issues.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::SecureSourceManager::V1::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + options.apply_defaults timeout: @config.rpcs.list_issues.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.list_issues.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @secure_source_manager_stub.list_issues request, options do |result, operation| + result = ::Gapic::Rest::PagedEnumerable.new @secure_source_manager_stub, :list_issues, "issues", 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 + + ## + # Updates a issue. + # + # @overload update_issue(request, options = nil) + # Pass arguments to `update_issue` via a request object, either of type + # {::Google::Cloud::SecureSourceManager::V1::UpdateIssueRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::SecureSourceManager::V1::UpdateIssueRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_issue(issue: nil, update_mask: nil) + # Pass arguments to `update_issue` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param issue [::Google::Cloud::SecureSourceManager::V1::Issue, ::Hash] + # Required. The issue to update. + # @param update_mask [::Google::Protobuf::FieldMask, ::Hash] + # Optional. Field mask is used to specify the fields to be overwritten in the + # issue resource by the update. + # The fields specified in the update_mask are relative to the resource, not + # the full request. A field will be overwritten if it is in the mask. + # The special value "*" means full replacement. + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Gapic::Operation] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Gapic::Operation] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/secure_source_manager/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::SecureSourceManager::V1::SecureSourceManager::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::SecureSourceManager::V1::UpdateIssueRequest.new + # + # # Call the update_issue method. + # result = client.update_issue 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_issue request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::SecureSourceManager::V1::UpdateIssueRequest + + # Converts hash 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_issue.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::SecureSourceManager::V1::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + options.apply_defaults timeout: @config.rpcs.update_issue.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.update_issue.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @secure_source_manager_stub.update_issue 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 issue. + # + # @overload delete_issue(request, options = nil) + # Pass arguments to `delete_issue` via a request object, either of type + # {::Google::Cloud::SecureSourceManager::V1::DeleteIssueRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::SecureSourceManager::V1::DeleteIssueRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_issue(name: nil, etag: nil) + # Pass arguments to `delete_issue` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param name [::String] + # Required. Name of the issue to delete. + # The format is + # `projects/{project_number}/locations/{location_id}/repositories/{repository_id}/issues/{issue_id}`. + # @param etag [::String] + # Optional. The current etag of the issue. + # If the etag is provided and does not match the current etag of the issue, + # deletion will be blocked and an ABORTED error will be returned. + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Gapic::Operation] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Gapic::Operation] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/secure_source_manager/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::SecureSourceManager::V1::SecureSourceManager::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::SecureSourceManager::V1::DeleteIssueRequest.new + # + # # Call the delete_issue method. + # result = client.delete_issue 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_issue request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::SecureSourceManager::V1::DeleteIssueRequest + + # Converts hash 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_issue.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::SecureSourceManager::V1::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + options.apply_defaults timeout: @config.rpcs.delete_issue.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.delete_issue.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @secure_source_manager_stub.delete_issue 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 + + ## + # Opens an issue. + # + # @overload open_issue(request, options = nil) + # Pass arguments to `open_issue` via a request object, either of type + # {::Google::Cloud::SecureSourceManager::V1::OpenIssueRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::SecureSourceManager::V1::OpenIssueRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @overload open_issue(name: nil, etag: nil) + # Pass arguments to `open_issue` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param name [::String] + # Required. Name of the issue to open. + # The format is + # `projects/{project_number}/locations/{location_id}/repositories/{repository_id}/issues/{issue_id}`. + # @param etag [::String] + # Optional. The current etag of the issue. + # If the etag is provided and does not match the current etag of the issue, + # opening will be blocked and an ABORTED error will be returned. + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Gapic::Operation] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Gapic::Operation] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/secure_source_manager/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::SecureSourceManager::V1::SecureSourceManager::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::SecureSourceManager::V1::OpenIssueRequest.new + # + # # Call the open_issue method. + # result = client.open_issue 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 open_issue request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::SecureSourceManager::V1::OpenIssueRequest + + # Converts hash 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.open_issue.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::SecureSourceManager::V1::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + options.apply_defaults timeout: @config.rpcs.open_issue.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.open_issue.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @secure_source_manager_stub.open_issue 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 + + ## + # Closes an issue. + # + # @overload close_issue(request, options = nil) + # Pass arguments to `close_issue` via a request object, either of type + # {::Google::Cloud::SecureSourceManager::V1::CloseIssueRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::SecureSourceManager::V1::CloseIssueRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @overload close_issue(name: nil, etag: nil) + # Pass arguments to `close_issue` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param name [::String] + # Required. Name of the issue to close. + # The format is + # `projects/{project_number}/locations/{location_id}/repositories/{repository_id}/issues/{issue_id}`. + # @param etag [::String] + # Optional. The current etag of the issue. + # If the etag is provided and does not match the current etag of the issue, + # closing will be blocked and an ABORTED error will be returned. + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Gapic::Operation] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Gapic::Operation] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/secure_source_manager/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::SecureSourceManager::V1::SecureSourceManager::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::SecureSourceManager::V1::CloseIssueRequest.new + # + # # Call the close_issue method. + # result = client.close_issue 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 close_issue request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::SecureSourceManager::V1::CloseIssueRequest + + # Converts hash 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.close_issue.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::SecureSourceManager::V1::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + options.apply_defaults timeout: @config.rpcs.close_issue.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.close_issue.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @secure_source_manager_stub.close_issue 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 pull request comment. + # + # @overload get_pull_request_comment(request, options = nil) + # Pass arguments to `get_pull_request_comment` via a request object, either of type + # {::Google::Cloud::SecureSourceManager::V1::GetPullRequestCommentRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::SecureSourceManager::V1::GetPullRequestCommentRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_pull_request_comment(name: nil) + # Pass arguments to `get_pull_request_comment` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param name [::String] + # Required. Name of the pull request comment to retrieve. + # The format is + # `projects/{project_number}/locations/{location_id}/repositories/{repository_id}/pullRequests/{pull_request_id}/pullRequestComments/{comment_id}`. + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Cloud::SecureSourceManager::V1::PullRequestComment] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::SecureSourceManager::V1::PullRequestComment] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/secure_source_manager/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::SecureSourceManager::V1::SecureSourceManager::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::SecureSourceManager::V1::GetPullRequestCommentRequest.new + # + # # Call the get_pull_request_comment method. + # result = client.get_pull_request_comment request + # + # # The returned object is of type Google::Cloud::SecureSourceManager::V1::PullRequestComment. + # p result + # + def get_pull_request_comment request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::SecureSourceManager::V1::GetPullRequestCommentRequest + + # Converts hash 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_pull_request_comment.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::SecureSourceManager::V1::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + options.apply_defaults timeout: @config.rpcs.get_pull_request_comment.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.get_pull_request_comment.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @secure_source_manager_stub.get_pull_request_comment request, options do |result, operation| + yield result, operation if block_given? + end + rescue ::Gapic::Rest::Error => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Lists pull request comments. + # + # @overload list_pull_request_comments(request, options = nil) + # Pass arguments to `list_pull_request_comments` via a request object, either of type + # {::Google::Cloud::SecureSourceManager::V1::ListPullRequestCommentsRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::SecureSourceManager::V1::ListPullRequestCommentsRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_pull_request_comments(parent: nil, page_size: nil, page_token: nil) + # Pass arguments to `list_pull_request_comments` via keyword arguments. Note that at + # least one keyword argument is 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 pull request in which to list pull request comments. Format: + # `projects/{project_number}/locations/{location_id}/repositories/{repository_id}/pullRequests/{pull_request_id}` + # @param page_size [::Integer] + # Optional. Requested page size. If unspecified, at most 100 pull request + # comments will be returned. The maximum value is 100; values above 100 will + # be coerced to 100. + # @param page_token [::String] + # Optional. A token identifying a page of results the server should return. + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Gapic::Rest::PagedEnumerable<::Google::Cloud::SecureSourceManager::V1::PullRequestComment>] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Gapic::Rest::PagedEnumerable<::Google::Cloud::SecureSourceManager::V1::PullRequestComment>] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/secure_source_manager/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::SecureSourceManager::V1::SecureSourceManager::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::SecureSourceManager::V1::ListPullRequestCommentsRequest.new + # + # # Call the list_pull_request_comments method. + # result = client.list_pull_request_comments request + # + # # The returned object is of type Gapic::PagedEnumerable. You can iterate + # # over elements, and API calls will be issued to fetch pages as needed. + # result.each do |item| + # # Each element is of type ::Google::Cloud::SecureSourceManager::V1::PullRequestComment. + # p item + # end + # + def list_pull_request_comments request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::SecureSourceManager::V1::ListPullRequestCommentsRequest + + # Converts hash 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_pull_request_comments.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::SecureSourceManager::V1::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + options.apply_defaults timeout: @config.rpcs.list_pull_request_comments.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.list_pull_request_comments.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @secure_source_manager_stub.list_pull_request_comments request, options do |result, operation| + result = ::Gapic::Rest::PagedEnumerable.new @secure_source_manager_stub, :list_pull_request_comments, "pull_request_comments", request, result, options + yield result, operation if block_given? + throw :response, result + end + rescue ::Gapic::Rest::Error => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Creates a pull request comment. This function is used to create a single + # PullRequestComment of type Comment, or a single PullRequestComment of type + # Code that's replying to another PullRequestComment of type Code. Use + # BatchCreatePullRequestComments to create multiple PullRequestComments for + # code reviews. + # + # @overload create_pull_request_comment(request, options = nil) + # Pass arguments to `create_pull_request_comment` via a request object, either of type + # {::Google::Cloud::SecureSourceManager::V1::CreatePullRequestCommentRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::SecureSourceManager::V1::CreatePullRequestCommentRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_pull_request_comment(parent: nil, pull_request_comment: nil) + # Pass arguments to `create_pull_request_comment` via keyword arguments. Note that at + # least one keyword argument is 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 pull request in which to create the pull request comment. + # Format: + # `projects/{project_number}/locations/{location_id}/repositories/{repository_id}/pullRequests/{pull_request_id}` + # @param pull_request_comment [::Google::Cloud::SecureSourceManager::V1::PullRequestComment, ::Hash] + # Required. The pull request comment to create. + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Gapic::Operation] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Gapic::Operation] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/secure_source_manager/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::SecureSourceManager::V1::SecureSourceManager::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::SecureSourceManager::V1::CreatePullRequestCommentRequest.new + # + # # Call the create_pull_request_comment method. + # result = client.create_pull_request_comment 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_pull_request_comment request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::SecureSourceManager::V1::CreatePullRequestCommentRequest + + # Converts hash 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_pull_request_comment.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::SecureSourceManager::V1::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + options.apply_defaults timeout: @config.rpcs.create_pull_request_comment.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.create_pull_request_comment.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @secure_source_manager_stub.create_pull_request_comment 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 + + ## + # Updates a pull request comment. + # + # @overload update_pull_request_comment(request, options = nil) + # Pass arguments to `update_pull_request_comment` via a request object, either of type + # {::Google::Cloud::SecureSourceManager::V1::UpdatePullRequestCommentRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::SecureSourceManager::V1::UpdatePullRequestCommentRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_pull_request_comment(pull_request_comment: nil, update_mask: nil) + # Pass arguments to `update_pull_request_comment` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param pull_request_comment [::Google::Cloud::SecureSourceManager::V1::PullRequestComment, ::Hash] + # Required. The pull request comment to update. + # @param update_mask [::Google::Protobuf::FieldMask, ::Hash] + # Optional. Field mask is used to specify the fields to be overwritten in the + # pull request comment resource by the update. Updatable fields are + # `body`. + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Gapic::Operation] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Gapic::Operation] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/secure_source_manager/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::SecureSourceManager::V1::SecureSourceManager::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::SecureSourceManager::V1::UpdatePullRequestCommentRequest.new + # + # # Call the update_pull_request_comment method. + # result = client.update_pull_request_comment 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_pull_request_comment request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::SecureSourceManager::V1::UpdatePullRequestCommentRequest + + # Converts hash 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_pull_request_comment.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::SecureSourceManager::V1::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + options.apply_defaults timeout: @config.rpcs.update_pull_request_comment.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.update_pull_request_comment.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @secure_source_manager_stub.update_pull_request_comment 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 pull request comment. + # + # @overload delete_pull_request_comment(request, options = nil) + # Pass arguments to `delete_pull_request_comment` via a request object, either of type + # {::Google::Cloud::SecureSourceManager::V1::DeletePullRequestCommentRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::SecureSourceManager::V1::DeletePullRequestCommentRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_pull_request_comment(name: nil) + # Pass arguments to `delete_pull_request_comment` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param name [::String] + # Required. Name of the pull request comment to delete. + # The format is + # `projects/{project_number}/locations/{location_id}/repositories/{repository_id}/pullRequests/{pull_request_id}/pullRequestComments/{comment_id}`. + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Gapic::Operation] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Gapic::Operation] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/secure_source_manager/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::SecureSourceManager::V1::SecureSourceManager::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::SecureSourceManager::V1::DeletePullRequestCommentRequest.new + # + # # Call the delete_pull_request_comment method. + # result = client.delete_pull_request_comment 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_pull_request_comment request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::SecureSourceManager::V1::DeletePullRequestCommentRequest + + # Converts hash 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_pull_request_comment.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::SecureSourceManager::V1::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + options.apply_defaults timeout: @config.rpcs.delete_pull_request_comment.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.delete_pull_request_comment.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @secure_source_manager_stub.delete_pull_request_comment 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 + + ## + # Batch creates pull request comments. This function is used to create + # multiple PullRequestComments for code review. There needs to be exactly one + # PullRequestComment of type Review, and at most 100 PullRequestComments of + # type Code per request. The Postition of the code comments must be unique + # within the request. + # + # @overload batch_create_pull_request_comments(request, options = nil) + # Pass arguments to `batch_create_pull_request_comments` via a request object, either of type + # {::Google::Cloud::SecureSourceManager::V1::BatchCreatePullRequestCommentsRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::SecureSourceManager::V1::BatchCreatePullRequestCommentsRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @overload batch_create_pull_request_comments(parent: nil, requests: nil) + # Pass arguments to `batch_create_pull_request_comments` via keyword arguments. Note that at + # least one keyword argument is 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 pull request in which to create the pull request comments. + # Format: + # `projects/{project_number}/locations/{location_id}/repositories/{repository_id}/pullRequests/{pull_request_id}` + # @param requests [::Array<::Google::Cloud::SecureSourceManager::V1::CreatePullRequestCommentRequest, ::Hash>] + # Required. The request message specifying the resources to create. There + # should be exactly one CreatePullRequestCommentRequest with CommentDetail + # being REVIEW in the list, and no more than 100 + # CreatePullRequestCommentRequests with CommentDetail being CODE in the list + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Gapic::Operation] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Gapic::Operation] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/secure_source_manager/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::SecureSourceManager::V1::SecureSourceManager::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::SecureSourceManager::V1::BatchCreatePullRequestCommentsRequest.new + # + # # Call the batch_create_pull_request_comments method. + # result = client.batch_create_pull_request_comments 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 batch_create_pull_request_comments request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::SecureSourceManager::V1::BatchCreatePullRequestCommentsRequest + + # Converts hash 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.batch_create_pull_request_comments.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::SecureSourceManager::V1::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + options.apply_defaults timeout: @config.rpcs.batch_create_pull_request_comments.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.batch_create_pull_request_comments.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @secure_source_manager_stub.batch_create_pull_request_comments 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 + + ## + # Resolves pull request comments. A list of PullRequestComment names must be + # provided. The PullRequestComment names must be in the same conversation + # thread. If auto_fill is set, all comments in the conversation thread will + # be resolved. + # + # @overload resolve_pull_request_comments(request, options = nil) + # Pass arguments to `resolve_pull_request_comments` via a request object, either of type + # {::Google::Cloud::SecureSourceManager::V1::ResolvePullRequestCommentsRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::SecureSourceManager::V1::ResolvePullRequestCommentsRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @overload resolve_pull_request_comments(parent: nil, names: nil, auto_fill: nil) + # Pass arguments to `resolve_pull_request_comments` via keyword arguments. Note that at + # least one keyword argument is 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 pull request in which to resolve the pull request comments. + # Format: + # `projects/{project_number}/locations/{location_id}/repositories/{repository_id}/pullRequests/{pull_request_id}` + # @param names [::Array<::String>] + # Required. The names of the pull request comments to resolve. Format: + # `projects/{project_number}/locations/{location_id}/repositories/{repository_id}/pullRequests/{pull_request_id}/pullRequestComments/{comment_id}` + # Only comments from the same threads are allowed in the same request. + # @param auto_fill [::Boolean] + # Optional. If set, at least one comment in a thread is required, rest of the + # comments in the same thread will be automatically updated to resolved. If + # unset, all comments in the same thread need be present. + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Gapic::Operation] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Gapic::Operation] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/secure_source_manager/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::SecureSourceManager::V1::SecureSourceManager::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::SecureSourceManager::V1::ResolvePullRequestCommentsRequest.new + # + # # Call the resolve_pull_request_comments method. + # result = client.resolve_pull_request_comments 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 resolve_pull_request_comments request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::SecureSourceManager::V1::ResolvePullRequestCommentsRequest + + # Converts hash 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.resolve_pull_request_comments.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::SecureSourceManager::V1::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + options.apply_defaults timeout: @config.rpcs.resolve_pull_request_comments.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.resolve_pull_request_comments.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @secure_source_manager_stub.resolve_pull_request_comments 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 + + ## + # Unresolves pull request comments. A list of PullRequestComment names must + # be provided. The PullRequestComment names must be in the same conversation + # thread. If auto_fill is set, all comments in the conversation thread will + # be unresolved. + # + # @overload unresolve_pull_request_comments(request, options = nil) + # Pass arguments to `unresolve_pull_request_comments` via a request object, either of type + # {::Google::Cloud::SecureSourceManager::V1::UnresolvePullRequestCommentsRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::SecureSourceManager::V1::UnresolvePullRequestCommentsRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @overload unresolve_pull_request_comments(parent: nil, names: nil, auto_fill: nil) + # Pass arguments to `unresolve_pull_request_comments` via keyword arguments. Note that at + # least one keyword argument is 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 pull request in which to resolve the pull request comments. + # Format: + # `projects/{project_number}/locations/{location_id}/repositories/{repository_id}/pullRequests/{pull_request_id}` + # @param names [::Array<::String>] + # Required. The names of the pull request comments to unresolve. Format: + # `projects/{project_number}/locations/{location_id}/repositories/{repository_id}/pullRequests/{pull_request_id}/pullRequestComments/{comment_id}` + # Only comments from the same threads are allowed in the same request. + # @param auto_fill [::Boolean] + # Optional. If set, at least one comment in a thread is required, rest of the + # comments in the same thread will be automatically updated to unresolved. If + # unset, all comments in the same thread need be present. + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Gapic::Operation] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Gapic::Operation] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/secure_source_manager/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::SecureSourceManager::V1::SecureSourceManager::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::SecureSourceManager::V1::UnresolvePullRequestCommentsRequest.new + # + # # Call the unresolve_pull_request_comments method. + # result = client.unresolve_pull_request_comments 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 unresolve_pull_request_comments request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::SecureSourceManager::V1::UnresolvePullRequestCommentsRequest + + # Converts hash 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.unresolve_pull_request_comments.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::SecureSourceManager::V1::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + options.apply_defaults timeout: @config.rpcs.unresolve_pull_request_comments.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.unresolve_pull_request_comments.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @secure_source_manager_stub.unresolve_pull_request_comments 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 + + ## + # Creates an issue comment. + # + # @overload create_issue_comment(request, options = nil) + # Pass arguments to `create_issue_comment` via a request object, either of type + # {::Google::Cloud::SecureSourceManager::V1::CreateIssueCommentRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::SecureSourceManager::V1::CreateIssueCommentRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_issue_comment(parent: nil, issue_comment: nil) + # Pass arguments to `create_issue_comment` via keyword arguments. Note that at + # least one keyword argument is 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 issue in which to create the issue comment. Format: + # `projects/{project_number}/locations/{location_id}/repositories/{repository_id}/issues/{issue_id}` + # @param issue_comment [::Google::Cloud::SecureSourceManager::V1::IssueComment, ::Hash] + # Required. The issue comment to create. + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Gapic::Operation] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Gapic::Operation] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/secure_source_manager/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::SecureSourceManager::V1::SecureSourceManager::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::SecureSourceManager::V1::CreateIssueCommentRequest.new + # + # # Call the create_issue_comment method. + # result = client.create_issue_comment 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_issue_comment request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::SecureSourceManager::V1::CreateIssueCommentRequest + + # Converts hash 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_issue_comment.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::SecureSourceManager::V1::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + options.apply_defaults timeout: @config.rpcs.create_issue_comment.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.create_issue_comment.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @secure_source_manager_stub.create_issue_comment 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 issue comment. + # + # @overload get_issue_comment(request, options = nil) + # Pass arguments to `get_issue_comment` via a request object, either of type + # {::Google::Cloud::SecureSourceManager::V1::GetIssueCommentRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::SecureSourceManager::V1::GetIssueCommentRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_issue_comment(name: nil) + # Pass arguments to `get_issue_comment` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param name [::String] + # Required. Name of the issue comment to retrieve. + # The format is + # `projects/{project}/locations/{location}/repositories/{repository}/issues/{issue_id}/issueComments/{comment_id}`. + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Cloud::SecureSourceManager::V1::IssueComment] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::SecureSourceManager::V1::IssueComment] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/secure_source_manager/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::SecureSourceManager::V1::SecureSourceManager::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::SecureSourceManager::V1::GetIssueCommentRequest.new + # + # # Call the get_issue_comment method. + # result = client.get_issue_comment request + # + # # The returned object is of type Google::Cloud::SecureSourceManager::V1::IssueComment. + # p result + # + def get_issue_comment request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::SecureSourceManager::V1::GetIssueCommentRequest + + # Converts hash 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_issue_comment.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::SecureSourceManager::V1::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + options.apply_defaults timeout: @config.rpcs.get_issue_comment.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.get_issue_comment.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @secure_source_manager_stub.get_issue_comment request, options do |result, operation| + yield result, operation if block_given? + end + rescue ::Gapic::Rest::Error => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Lists comments in an issue. + # + # @overload list_issue_comments(request, options = nil) + # Pass arguments to `list_issue_comments` via a request object, either of type + # {::Google::Cloud::SecureSourceManager::V1::ListIssueCommentsRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::SecureSourceManager::V1::ListIssueCommentsRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_issue_comments(parent: nil, page_size: nil, page_token: nil) + # Pass arguments to `list_issue_comments` via keyword arguments. Note that at + # least one keyword argument is 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 issue in which to list the comments. Format: + # `projects/{project_number}/locations/{location_id}/repositories/{repository_id}/issues/{issue_id}` + # @param page_size [::Integer] + # Optional. Requested page size. Server may return fewer items than + # requested. If unspecified, server will pick an appropriate default. + # @param page_token [::String] + # Optional. A token identifying a page of results the server should return. + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Gapic::Rest::PagedEnumerable<::Google::Cloud::SecureSourceManager::V1::IssueComment>] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Gapic::Rest::PagedEnumerable<::Google::Cloud::SecureSourceManager::V1::IssueComment>] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/secure_source_manager/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::SecureSourceManager::V1::SecureSourceManager::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::SecureSourceManager::V1::ListIssueCommentsRequest.new + # + # # Call the list_issue_comments method. + # result = client.list_issue_comments request + # + # # The returned object is of type Gapic::PagedEnumerable. You can iterate + # # over elements, and API calls will be issued to fetch pages as needed. + # result.each do |item| + # # Each element is of type ::Google::Cloud::SecureSourceManager::V1::IssueComment. + # p item + # end + # + def list_issue_comments request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::SecureSourceManager::V1::ListIssueCommentsRequest + + # Converts hash 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_issue_comments.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::SecureSourceManager::V1::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + options.apply_defaults timeout: @config.rpcs.list_issue_comments.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.list_issue_comments.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @secure_source_manager_stub.list_issue_comments request, options do |result, operation| + result = ::Gapic::Rest::PagedEnumerable.new @secure_source_manager_stub, :list_issue_comments, "issue_comments", 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 + + ## + # Updates an issue comment. + # + # @overload update_issue_comment(request, options = nil) + # Pass arguments to `update_issue_comment` via a request object, either of type + # {::Google::Cloud::SecureSourceManager::V1::UpdateIssueCommentRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::SecureSourceManager::V1::UpdateIssueCommentRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_issue_comment(issue_comment: nil, update_mask: nil) + # Pass arguments to `update_issue_comment` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param issue_comment [::Google::Cloud::SecureSourceManager::V1::IssueComment, ::Hash] + # Required. The issue comment to update. + # @param update_mask [::Google::Protobuf::FieldMask, ::Hash] + # Optional. Field mask is used to specify the fields to be overwritten in the + # issue comment resource by the update. + # The fields specified in the update_mask are relative to the resource, not + # the full request. A field will be overwritten if it is in the mask. + # The special value "*" means full replacement. + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Gapic::Operation] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Gapic::Operation] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/secure_source_manager/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::SecureSourceManager::V1::SecureSourceManager::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::SecureSourceManager::V1::UpdateIssueCommentRequest.new + # + # # Call the update_issue_comment method. + # result = client.update_issue_comment 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_issue_comment request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::SecureSourceManager::V1::UpdateIssueCommentRequest + + # Converts hash 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_issue_comment.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::SecureSourceManager::V1::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + options.apply_defaults timeout: @config.rpcs.update_issue_comment.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.update_issue_comment.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @secure_source_manager_stub.update_issue_comment 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 issue comment. + # + # @overload delete_issue_comment(request, options = nil) + # Pass arguments to `delete_issue_comment` via a request object, either of type + # {::Google::Cloud::SecureSourceManager::V1::DeleteIssueCommentRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::SecureSourceManager::V1::DeleteIssueCommentRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_issue_comment(name: nil) + # Pass arguments to `delete_issue_comment` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param name [::String] + # Required. Name of the issue comment to delete. + # The format is + # `projects/{project_number}/locations/{location_id}/repositories/{repository_id}/issues/{issue_id}/issueComments/{comment_id}`. + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Gapic::Operation] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Gapic::Operation] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/secure_source_manager/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::SecureSourceManager::V1::SecureSourceManager::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::SecureSourceManager::V1::DeleteIssueCommentRequest.new + # + # # Call the delete_issue_comment method. + # result = client.delete_issue_comment 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_issue_comment request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::SecureSourceManager::V1::DeleteIssueCommentRequest + + # Converts hash 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_issue_comment.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::SecureSourceManager::V1::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + options.apply_defaults timeout: @config.rpcs.delete_issue_comment.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.delete_issue_comment.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @secure_source_manager_stub.delete_issue_comment 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 + + ## + # Configuration class for the SecureSourceManager REST API. + # + # This class represents the configuration for SecureSourceManager REST, + # providing control over timeouts, retry behavior, logging, transport + # parameters, and other low-level controls. Certain parameters can also be + # applied individually to specific RPCs. See + # {::Google::Cloud::SecureSourceManager::V1::SecureSourceManager::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_instances to 20 seconds, + # # and all remaining timeouts to 10 seconds. + # ::Google::Cloud::SecureSourceManager::V1::SecureSourceManager::Rest::Client.configure do |config| + # config.timeout = 10.0 + # config.rpcs.list_instances.timeout = 20.0 + # end + # + # # Apply the above configuration only to a new client. + # client = ::Google::Cloud::SecureSourceManager::V1::SecureSourceManager::Rest::Client.new do |config| + # config.timeout = 10.0 + # config.rpcs.list_instances.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 = "securesourcemanager.googleapis.com" + + config_attr :endpoint, nil, ::String, nil + config_attr :credentials, nil do |value| + allowed = [::String, ::Hash, ::Proc, ::Symbol, ::Google::Auth::Credentials, ::Google::Auth::BaseClient, ::Signet::OAuth2::Client, nil] + allowed.any? { |klass| klass === value } + end + config_attr :scope, nil, ::String, ::Array, nil + config_attr :lib_name, nil, ::String, nil + config_attr :lib_version, nil, ::String, nil + config_attr :timeout, nil, ::Numeric, nil + config_attr :metadata, nil, ::Hash, nil + config_attr :retry_policy, nil, ::Hash, ::Proc, nil + config_attr :quota_project, nil, ::String, nil + config_attr :universe_domain, nil, ::String, nil + + # @private + # Overrides for http bindings for the RPCs of this service + # are only used when this service is used as mixin, and only + # by the host service. + # @return [::Hash{::Symbol=>::Array<::Gapic::Rest::GrpcTranscoder::HttpBinding>}] + config_attr :bindings_override, {}, ::Hash, nil + config_attr :logger, :default, ::Logger, nil, :default + + # @private + def initialize parent_config = nil + @parent_config = parent_config unless parent_config.nil? + + yield self if block_given? + end + + ## + # Configurations for individual RPCs + # @return [Rpcs] + # + def rpcs + @rpcs ||= begin + parent_rpcs = nil + parent_rpcs = @parent_config.rpcs if defined?(@parent_config) && @parent_config.respond_to?(:rpcs) + Rpcs.new parent_rpcs + end + end + + ## + # Configuration RPC class for the SecureSourceManager 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_instances` + # @return [::Gapic::Config::Method] + # + attr_reader :list_instances + ## + # RPC-specific configuration for `get_instance` + # @return [::Gapic::Config::Method] + # + attr_reader :get_instance + ## + # RPC-specific configuration for `create_instance` + # @return [::Gapic::Config::Method] + # + attr_reader :create_instance + ## + # RPC-specific configuration for `delete_instance` + # @return [::Gapic::Config::Method] + # + attr_reader :delete_instance + ## + # RPC-specific configuration for `list_repositories` + # @return [::Gapic::Config::Method] + # + attr_reader :list_repositories + ## + # RPC-specific configuration for `get_repository` + # @return [::Gapic::Config::Method] + # + attr_reader :get_repository + ## + # RPC-specific configuration for `create_repository` + # @return [::Gapic::Config::Method] + # + attr_reader :create_repository + ## + # RPC-specific configuration for `update_repository` + # @return [::Gapic::Config::Method] + # + attr_reader :update_repository + ## + # RPC-specific configuration for `delete_repository` + # @return [::Gapic::Config::Method] + # + attr_reader :delete_repository + ## + # RPC-specific configuration for `list_hooks` + # @return [::Gapic::Config::Method] + # + attr_reader :list_hooks + ## + # RPC-specific configuration for `get_hook` + # @return [::Gapic::Config::Method] + # + attr_reader :get_hook + ## + # RPC-specific configuration for `create_hook` + # @return [::Gapic::Config::Method] + # + attr_reader :create_hook + ## + # RPC-specific configuration for `update_hook` + # @return [::Gapic::Config::Method] + # + attr_reader :update_hook + ## + # RPC-specific configuration for `delete_hook` + # @return [::Gapic::Config::Method] + # + attr_reader :delete_hook + ## + # RPC-specific configuration for `get_iam_policy_repo` + # @return [::Gapic::Config::Method] + # + attr_reader :get_iam_policy_repo + ## + # RPC-specific configuration for `set_iam_policy_repo` + # @return [::Gapic::Config::Method] + # + attr_reader :set_iam_policy_repo + ## + # RPC-specific configuration for `test_iam_permissions_repo` + # @return [::Gapic::Config::Method] + # + attr_reader :test_iam_permissions_repo + ## + # RPC-specific configuration for `create_branch_rule` + # @return [::Gapic::Config::Method] + # + attr_reader :create_branch_rule + ## + # RPC-specific configuration for `list_branch_rules` + # @return [::Gapic::Config::Method] + # + attr_reader :list_branch_rules + ## + # RPC-specific configuration for `get_branch_rule` + # @return [::Gapic::Config::Method] + # + attr_reader :get_branch_rule + ## + # RPC-specific configuration for `update_branch_rule` + # @return [::Gapic::Config::Method] + # + attr_reader :update_branch_rule + ## + # RPC-specific configuration for `delete_branch_rule` + # @return [::Gapic::Config::Method] + # + attr_reader :delete_branch_rule + ## + # RPC-specific configuration for `create_pull_request` + # @return [::Gapic::Config::Method] + # + attr_reader :create_pull_request + ## + # RPC-specific configuration for `get_pull_request` + # @return [::Gapic::Config::Method] + # + attr_reader :get_pull_request + ## + # RPC-specific configuration for `list_pull_requests` + # @return [::Gapic::Config::Method] + # + attr_reader :list_pull_requests + ## + # RPC-specific configuration for `update_pull_request` + # @return [::Gapic::Config::Method] + # + attr_reader :update_pull_request + ## + # RPC-specific configuration for `merge_pull_request` + # @return [::Gapic::Config::Method] + # + attr_reader :merge_pull_request + ## + # RPC-specific configuration for `open_pull_request` + # @return [::Gapic::Config::Method] + # + attr_reader :open_pull_request + ## + # RPC-specific configuration for `close_pull_request` + # @return [::Gapic::Config::Method] + # + attr_reader :close_pull_request + ## + # RPC-specific configuration for `list_pull_request_file_diffs` + # @return [::Gapic::Config::Method] + # + attr_reader :list_pull_request_file_diffs + ## + # RPC-specific configuration for `fetch_tree` + # @return [::Gapic::Config::Method] + # + attr_reader :fetch_tree + ## + # RPC-specific configuration for `fetch_blob` + # @return [::Gapic::Config::Method] + # + attr_reader :fetch_blob + ## + # RPC-specific configuration for `create_issue` + # @return [::Gapic::Config::Method] + # + attr_reader :create_issue + ## + # RPC-specific configuration for `get_issue` + # @return [::Gapic::Config::Method] + # + attr_reader :get_issue + ## + # RPC-specific configuration for `list_issues` + # @return [::Gapic::Config::Method] + # + attr_reader :list_issues + ## + # RPC-specific configuration for `update_issue` + # @return [::Gapic::Config::Method] + # + attr_reader :update_issue + ## + # RPC-specific configuration for `delete_issue` + # @return [::Gapic::Config::Method] + # + attr_reader :delete_issue + ## + # RPC-specific configuration for `open_issue` + # @return [::Gapic::Config::Method] + # + attr_reader :open_issue + ## + # RPC-specific configuration for `close_issue` + # @return [::Gapic::Config::Method] + # + attr_reader :close_issue + ## + # RPC-specific configuration for `get_pull_request_comment` + # @return [::Gapic::Config::Method] + # + attr_reader :get_pull_request_comment + ## + # RPC-specific configuration for `list_pull_request_comments` + # @return [::Gapic::Config::Method] + # + attr_reader :list_pull_request_comments + ## + # RPC-specific configuration for `create_pull_request_comment` + # @return [::Gapic::Config::Method] + # + attr_reader :create_pull_request_comment + ## + # RPC-specific configuration for `update_pull_request_comment` + # @return [::Gapic::Config::Method] + # + attr_reader :update_pull_request_comment + ## + # RPC-specific configuration for `delete_pull_request_comment` + # @return [::Gapic::Config::Method] + # + attr_reader :delete_pull_request_comment + ## + # RPC-specific configuration for `batch_create_pull_request_comments` + # @return [::Gapic::Config::Method] + # + attr_reader :batch_create_pull_request_comments + ## + # RPC-specific configuration for `resolve_pull_request_comments` + # @return [::Gapic::Config::Method] + # + attr_reader :resolve_pull_request_comments + ## + # RPC-specific configuration for `unresolve_pull_request_comments` + # @return [::Gapic::Config::Method] + # + attr_reader :unresolve_pull_request_comments + ## + # RPC-specific configuration for `create_issue_comment` + # @return [::Gapic::Config::Method] + # + attr_reader :create_issue_comment + ## + # RPC-specific configuration for `get_issue_comment` + # @return [::Gapic::Config::Method] + # + attr_reader :get_issue_comment + ## + # RPC-specific configuration for `list_issue_comments` + # @return [::Gapic::Config::Method] + # + attr_reader :list_issue_comments + ## + # RPC-specific configuration for `update_issue_comment` + # @return [::Gapic::Config::Method] + # + attr_reader :update_issue_comment + ## + # RPC-specific configuration for `delete_issue_comment` + # @return [::Gapic::Config::Method] + # + attr_reader :delete_issue_comment + + # @private + def initialize parent_rpcs = nil + list_instances_config = parent_rpcs.list_instances if parent_rpcs.respond_to? :list_instances + @list_instances = ::Gapic::Config::Method.new list_instances_config + get_instance_config = parent_rpcs.get_instance if parent_rpcs.respond_to? :get_instance + @get_instance = ::Gapic::Config::Method.new get_instance_config + create_instance_config = parent_rpcs.create_instance if parent_rpcs.respond_to? :create_instance + @create_instance = ::Gapic::Config::Method.new create_instance_config + delete_instance_config = parent_rpcs.delete_instance if parent_rpcs.respond_to? :delete_instance + @delete_instance = ::Gapic::Config::Method.new delete_instance_config + list_repositories_config = parent_rpcs.list_repositories if parent_rpcs.respond_to? :list_repositories + @list_repositories = ::Gapic::Config::Method.new list_repositories_config + get_repository_config = parent_rpcs.get_repository if parent_rpcs.respond_to? :get_repository + @get_repository = ::Gapic::Config::Method.new get_repository_config + create_repository_config = parent_rpcs.create_repository if parent_rpcs.respond_to? :create_repository + @create_repository = ::Gapic::Config::Method.new create_repository_config + update_repository_config = parent_rpcs.update_repository if parent_rpcs.respond_to? :update_repository + @update_repository = ::Gapic::Config::Method.new update_repository_config + delete_repository_config = parent_rpcs.delete_repository if parent_rpcs.respond_to? :delete_repository + @delete_repository = ::Gapic::Config::Method.new delete_repository_config + list_hooks_config = parent_rpcs.list_hooks if parent_rpcs.respond_to? :list_hooks + @list_hooks = ::Gapic::Config::Method.new list_hooks_config + get_hook_config = parent_rpcs.get_hook if parent_rpcs.respond_to? :get_hook + @get_hook = ::Gapic::Config::Method.new get_hook_config + create_hook_config = parent_rpcs.create_hook if parent_rpcs.respond_to? :create_hook + @create_hook = ::Gapic::Config::Method.new create_hook_config + update_hook_config = parent_rpcs.update_hook if parent_rpcs.respond_to? :update_hook + @update_hook = ::Gapic::Config::Method.new update_hook_config + delete_hook_config = parent_rpcs.delete_hook if parent_rpcs.respond_to? :delete_hook + @delete_hook = ::Gapic::Config::Method.new delete_hook_config + get_iam_policy_repo_config = parent_rpcs.get_iam_policy_repo if parent_rpcs.respond_to? :get_iam_policy_repo + @get_iam_policy_repo = ::Gapic::Config::Method.new get_iam_policy_repo_config + set_iam_policy_repo_config = parent_rpcs.set_iam_policy_repo if parent_rpcs.respond_to? :set_iam_policy_repo + @set_iam_policy_repo = ::Gapic::Config::Method.new set_iam_policy_repo_config + test_iam_permissions_repo_config = parent_rpcs.test_iam_permissions_repo if parent_rpcs.respond_to? :test_iam_permissions_repo + @test_iam_permissions_repo = ::Gapic::Config::Method.new test_iam_permissions_repo_config + create_branch_rule_config = parent_rpcs.create_branch_rule if parent_rpcs.respond_to? :create_branch_rule + @create_branch_rule = ::Gapic::Config::Method.new create_branch_rule_config + list_branch_rules_config = parent_rpcs.list_branch_rules if parent_rpcs.respond_to? :list_branch_rules + @list_branch_rules = ::Gapic::Config::Method.new list_branch_rules_config + get_branch_rule_config = parent_rpcs.get_branch_rule if parent_rpcs.respond_to? :get_branch_rule + @get_branch_rule = ::Gapic::Config::Method.new get_branch_rule_config + update_branch_rule_config = parent_rpcs.update_branch_rule if parent_rpcs.respond_to? :update_branch_rule + @update_branch_rule = ::Gapic::Config::Method.new update_branch_rule_config + delete_branch_rule_config = parent_rpcs.delete_branch_rule if parent_rpcs.respond_to? :delete_branch_rule + @delete_branch_rule = ::Gapic::Config::Method.new delete_branch_rule_config + create_pull_request_config = parent_rpcs.create_pull_request if parent_rpcs.respond_to? :create_pull_request + @create_pull_request = ::Gapic::Config::Method.new create_pull_request_config + get_pull_request_config = parent_rpcs.get_pull_request if parent_rpcs.respond_to? :get_pull_request + @get_pull_request = ::Gapic::Config::Method.new get_pull_request_config + list_pull_requests_config = parent_rpcs.list_pull_requests if parent_rpcs.respond_to? :list_pull_requests + @list_pull_requests = ::Gapic::Config::Method.new list_pull_requests_config + update_pull_request_config = parent_rpcs.update_pull_request if parent_rpcs.respond_to? :update_pull_request + @update_pull_request = ::Gapic::Config::Method.new update_pull_request_config + merge_pull_request_config = parent_rpcs.merge_pull_request if parent_rpcs.respond_to? :merge_pull_request + @merge_pull_request = ::Gapic::Config::Method.new merge_pull_request_config + open_pull_request_config = parent_rpcs.open_pull_request if parent_rpcs.respond_to? :open_pull_request + @open_pull_request = ::Gapic::Config::Method.new open_pull_request_config + close_pull_request_config = parent_rpcs.close_pull_request if parent_rpcs.respond_to? :close_pull_request + @close_pull_request = ::Gapic::Config::Method.new close_pull_request_config + list_pull_request_file_diffs_config = parent_rpcs.list_pull_request_file_diffs if parent_rpcs.respond_to? :list_pull_request_file_diffs + @list_pull_request_file_diffs = ::Gapic::Config::Method.new list_pull_request_file_diffs_config + fetch_tree_config = parent_rpcs.fetch_tree if parent_rpcs.respond_to? :fetch_tree + @fetch_tree = ::Gapic::Config::Method.new fetch_tree_config + fetch_blob_config = parent_rpcs.fetch_blob if parent_rpcs.respond_to? :fetch_blob + @fetch_blob = ::Gapic::Config::Method.new fetch_blob_config + create_issue_config = parent_rpcs.create_issue if parent_rpcs.respond_to? :create_issue + @create_issue = ::Gapic::Config::Method.new create_issue_config + get_issue_config = parent_rpcs.get_issue if parent_rpcs.respond_to? :get_issue + @get_issue = ::Gapic::Config::Method.new get_issue_config + list_issues_config = parent_rpcs.list_issues if parent_rpcs.respond_to? :list_issues + @list_issues = ::Gapic::Config::Method.new list_issues_config + update_issue_config = parent_rpcs.update_issue if parent_rpcs.respond_to? :update_issue + @update_issue = ::Gapic::Config::Method.new update_issue_config + delete_issue_config = parent_rpcs.delete_issue if parent_rpcs.respond_to? :delete_issue + @delete_issue = ::Gapic::Config::Method.new delete_issue_config + open_issue_config = parent_rpcs.open_issue if parent_rpcs.respond_to? :open_issue + @open_issue = ::Gapic::Config::Method.new open_issue_config + close_issue_config = parent_rpcs.close_issue if parent_rpcs.respond_to? :close_issue + @close_issue = ::Gapic::Config::Method.new close_issue_config + get_pull_request_comment_config = parent_rpcs.get_pull_request_comment if parent_rpcs.respond_to? :get_pull_request_comment + @get_pull_request_comment = ::Gapic::Config::Method.new get_pull_request_comment_config + list_pull_request_comments_config = parent_rpcs.list_pull_request_comments if parent_rpcs.respond_to? :list_pull_request_comments + @list_pull_request_comments = ::Gapic::Config::Method.new list_pull_request_comments_config + create_pull_request_comment_config = parent_rpcs.create_pull_request_comment if parent_rpcs.respond_to? :create_pull_request_comment + @create_pull_request_comment = ::Gapic::Config::Method.new create_pull_request_comment_config + update_pull_request_comment_config = parent_rpcs.update_pull_request_comment if parent_rpcs.respond_to? :update_pull_request_comment + @update_pull_request_comment = ::Gapic::Config::Method.new update_pull_request_comment_config + delete_pull_request_comment_config = parent_rpcs.delete_pull_request_comment if parent_rpcs.respond_to? :delete_pull_request_comment + @delete_pull_request_comment = ::Gapic::Config::Method.new delete_pull_request_comment_config + batch_create_pull_request_comments_config = parent_rpcs.batch_create_pull_request_comments if parent_rpcs.respond_to? :batch_create_pull_request_comments + @batch_create_pull_request_comments = ::Gapic::Config::Method.new batch_create_pull_request_comments_config + resolve_pull_request_comments_config = parent_rpcs.resolve_pull_request_comments if parent_rpcs.respond_to? :resolve_pull_request_comments + @resolve_pull_request_comments = ::Gapic::Config::Method.new resolve_pull_request_comments_config + unresolve_pull_request_comments_config = parent_rpcs.unresolve_pull_request_comments if parent_rpcs.respond_to? :unresolve_pull_request_comments + @unresolve_pull_request_comments = ::Gapic::Config::Method.new unresolve_pull_request_comments_config + create_issue_comment_config = parent_rpcs.create_issue_comment if parent_rpcs.respond_to? :create_issue_comment + @create_issue_comment = ::Gapic::Config::Method.new create_issue_comment_config + get_issue_comment_config = parent_rpcs.get_issue_comment if parent_rpcs.respond_to? :get_issue_comment + @get_issue_comment = ::Gapic::Config::Method.new get_issue_comment_config + list_issue_comments_config = parent_rpcs.list_issue_comments if parent_rpcs.respond_to? :list_issue_comments + @list_issue_comments = ::Gapic::Config::Method.new list_issue_comments_config + update_issue_comment_config = parent_rpcs.update_issue_comment if parent_rpcs.respond_to? :update_issue_comment + @update_issue_comment = ::Gapic::Config::Method.new update_issue_comment_config + delete_issue_comment_config = parent_rpcs.delete_issue_comment if parent_rpcs.respond_to? :delete_issue_comment + @delete_issue_comment = ::Gapic::Config::Method.new delete_issue_comment_config + + yield self if block_given? + end + end + end + end + end + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-secure_source_manager-v1/lib/google/cloud/secure_source_manager/v1/secure_source_manager/rest/operations.rb b/owl-bot-staging/google-cloud-secure_source_manager-v1/lib/google/cloud/secure_source_manager/v1/secure_source_manager/rest/operations.rb new file mode 100644 index 000000000000..df0e22afe0d1 --- /dev/null +++ b/owl-bot-staging/google-cloud-secure_source_manager-v1/lib/google/cloud/secure_source_manager/v1/secure_source_manager/rest/operations.rb @@ -0,0 +1,925 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +require "gapic/operation" + +module Google + module Cloud + module SecureSourceManager + module V1 + module SecureSourceManager + module Rest + # Service that implements Longrunning Operations API. + class Operations + # @private + API_VERSION = "" + + # @private + DEFAULT_ENDPOINT_TEMPLATE = "securesourcemanager.$UNIVERSE_DOMAIN$" + + # @private + attr_reader :operations_stub + + ## + # Configuration for the SecureSourceManager 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 SecureSourceManager 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::SecureSourceManager::V1::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + options.apply_defaults timeout: @config.rpcs.list_operations.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.list_operations.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @operations_stub.list_operations request, options do |result, operation| + result = ::Gapic::Rest::PagedEnumerable.new @operations_stub, :list_operations, "operations", request, result, options + yield result, operation if block_given? + 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::SecureSourceManager::V1::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + options.apply_defaults timeout: @config.rpcs.get_operation.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.get_operation.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @operations_stub.get_operation request, options do |result, operation| + result = ::Gapic::Operation.new result, @operations_client, options: options + yield result, operation if block_given? + 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::SecureSourceManager::V1::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + options.apply_defaults timeout: @config.rpcs.delete_operation.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.delete_operation.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @operations_stub.delete_operation request, options do |result, operation| + yield result, operation if block_given? + 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::SecureSourceManager::V1::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + options.apply_defaults timeout: @config.rpcs.cancel_operation.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.cancel_operation.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @operations_stub.cancel_operation request, options do |result, operation| + yield result, operation if block_given? + 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 = "securesourcemanager.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}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the get_operation REST call + # + # @param request_pb [::Google::Longrunning::GetOperationRequest] + # A request object representing the call parameters. Required. + # @return [Array(String, [String, nil], Hash{String => String})] + # Uri, Body, Query string parameters + def self.transcode_get_operation_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/operations/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the delete_operation REST call + # + # @param request_pb [::Google::Longrunning::DeleteOperationRequest] + # A request object representing the call parameters. Required. + # @return [Array(String, [String, nil], Hash{String => String})] + # Uri, Body, Query string parameters + def self.transcode_delete_operation_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :delete, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/operations/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the cancel_operation REST call + # + # @param request_pb [::Google::Longrunning::CancelOperationRequest] + # A request object representing the call parameters. Required. + # @return [Array(String, [String, nil], Hash{String => String})] + # Uri, Body, Query string parameters + def self.transcode_cancel_operation_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:cancel", + body: "*", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/operations/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + end + end + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-secure_source_manager-v1/lib/google/cloud/secure_source_manager/v1/secure_source_manager/rest/service_stub.rb b/owl-bot-staging/google-cloud-secure_source_manager-v1/lib/google/cloud/secure_source_manager/v1/secure_source_manager/rest/service_stub.rb new file mode 100644 index 000000000000..f85cddd65669 --- /dev/null +++ b/owl-bot-staging/google-cloud-secure_source_manager-v1/lib/google/cloud/secure_source_manager/v1/secure_source_manager/rest/service_stub.rb @@ -0,0 +1,3278 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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/securesourcemanager/v1/secure_source_manager_pb" + +module Google + module Cloud + module SecureSourceManager + module V1 + module SecureSourceManager + module Rest + ## + # REST service stub for the SecureSourceManager service. + # Service stub contains baseline method implementations + # including transcoding, making the REST call, and deserialing the response. + # + class ServiceStub + # @private + def initialize endpoint:, endpoint_template:, universe_domain:, credentials:, logger: + # These require statements are intentionally placed here to initialize + # the REST modules only when it's required. + require "gapic/rest" + + @client_stub = ::Gapic::Rest::ClientStub.new endpoint: endpoint, + endpoint_template: endpoint_template, + universe_domain: universe_domain, + credentials: credentials, + numeric_enums: true, + service_name: self.class, + raise_faraday_errors: false, + logger: logger + end + + ## + # The effective universe domain + # + # @return [String] + # + def universe_domain + @client_stub.universe_domain + end + + ## + # The effective endpoint + # + # @return [String] + # + def endpoint + @client_stub.endpoint + end + + ## + # The logger used for request/response debug logging. + # + # @return [Logger] + # + def logger stub: false + stub ? @client_stub.stub_logger : @client_stub.logger + end + + ## + # Baseline implementation for the list_instances REST call + # + # @param request_pb [::Google::Cloud::SecureSourceManager::V1::ListInstancesRequest] + # A request object representing the call parameters. Required. + # @param options [::Gapic::CallOptions] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Cloud::SecureSourceManager::V1::ListInstancesResponse] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::SecureSourceManager::V1::ListInstancesResponse] + # A result object deserialized from the server's reply + def list_instances request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_list_instances_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_instances", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Cloud::SecureSourceManager::V1::ListInstancesResponse.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_instance REST call + # + # @param request_pb [::Google::Cloud::SecureSourceManager::V1::GetInstanceRequest] + # A request object representing the call parameters. Required. + # @param options [::Gapic::CallOptions] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Cloud::SecureSourceManager::V1::Instance] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::SecureSourceManager::V1::Instance] + # A result object deserialized from the server's reply + def get_instance request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_get_instance_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_instance", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Cloud::SecureSourceManager::V1::Instance.decode_json response.body, ignore_unknown_fields: true + catch :response do + yield result, operation if block_given? + result + end + end + + ## + # Baseline implementation for the create_instance REST call + # + # @param request_pb [::Google::Cloud::SecureSourceManager::V1::CreateInstanceRequest] + # 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_instance request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_create_instance_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_instance", + 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_instance REST call + # + # @param request_pb [::Google::Cloud::SecureSourceManager::V1::DeleteInstanceRequest] + # 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_instance request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_delete_instance_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_instance", + 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_repositories REST call + # + # @param request_pb [::Google::Cloud::SecureSourceManager::V1::ListRepositoriesRequest] + # A request object representing the call parameters. Required. + # @param options [::Gapic::CallOptions] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Cloud::SecureSourceManager::V1::ListRepositoriesResponse] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::SecureSourceManager::V1::ListRepositoriesResponse] + # A result object deserialized from the server's reply + def list_repositories request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_list_repositories_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_repositories", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Cloud::SecureSourceManager::V1::ListRepositoriesResponse.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_repository REST call + # + # @param request_pb [::Google::Cloud::SecureSourceManager::V1::GetRepositoryRequest] + # A request object representing the call parameters. Required. + # @param options [::Gapic::CallOptions] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Cloud::SecureSourceManager::V1::Repository] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::SecureSourceManager::V1::Repository] + # A result object deserialized from the server's reply + def get_repository request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_get_repository_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_repository", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Cloud::SecureSourceManager::V1::Repository.decode_json response.body, ignore_unknown_fields: true + catch :response do + yield result, operation if block_given? + result + end + end + + ## + # Baseline implementation for the create_repository REST call + # + # @param request_pb [::Google::Cloud::SecureSourceManager::V1::CreateRepositoryRequest] + # 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_repository request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_create_repository_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_repository", + 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 update_repository REST call + # + # @param request_pb [::Google::Cloud::SecureSourceManager::V1::UpdateRepositoryRequest] + # 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_repository request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_update_repository_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_repository", + 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_repository REST call + # + # @param request_pb [::Google::Cloud::SecureSourceManager::V1::DeleteRepositoryRequest] + # 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_repository request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_delete_repository_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_repository", + 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_hooks REST call + # + # @param request_pb [::Google::Cloud::SecureSourceManager::V1::ListHooksRequest] + # A request object representing the call parameters. Required. + # @param options [::Gapic::CallOptions] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Cloud::SecureSourceManager::V1::ListHooksResponse] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::SecureSourceManager::V1::ListHooksResponse] + # A result object deserialized from the server's reply + def list_hooks request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_list_hooks_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_hooks", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Cloud::SecureSourceManager::V1::ListHooksResponse.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_hook REST call + # + # @param request_pb [::Google::Cloud::SecureSourceManager::V1::GetHookRequest] + # A request object representing the call parameters. Required. + # @param options [::Gapic::CallOptions] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Cloud::SecureSourceManager::V1::Hook] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::SecureSourceManager::V1::Hook] + # A result object deserialized from the server's reply + def get_hook request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_get_hook_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_hook", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Cloud::SecureSourceManager::V1::Hook.decode_json response.body, ignore_unknown_fields: true + catch :response do + yield result, operation if block_given? + result + end + end + + ## + # Baseline implementation for the create_hook REST call + # + # @param request_pb [::Google::Cloud::SecureSourceManager::V1::CreateHookRequest] + # 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_hook request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_create_hook_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_hook", + 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 update_hook REST call + # + # @param request_pb [::Google::Cloud::SecureSourceManager::V1::UpdateHookRequest] + # 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_hook request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_update_hook_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_hook", + 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_hook REST call + # + # @param request_pb [::Google::Cloud::SecureSourceManager::V1::DeleteHookRequest] + # 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_hook request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_delete_hook_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_hook", + 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_iam_policy_repo REST call + # + # @param request_pb [::Google::Iam::V1::GetIamPolicyRequest] + # A request object representing the call parameters. Required. + # @param options [::Gapic::CallOptions] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Iam::V1::Policy] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Iam::V1::Policy] + # A result object deserialized from the server's reply + def get_iam_policy_repo request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_get_iam_policy_repo_request request_pb + query_string_params = if query_string_params.any? + query_string_params.to_h { |p| p.split "=", 2 } + else + {} + end + + response = @client_stub.make_http_request( + verb, + uri: uri, + body: body || "", + params: query_string_params, + method_name: "get_iam_policy_repo", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Iam::V1::Policy.decode_json response.body, ignore_unknown_fields: true + catch :response do + yield result, operation if block_given? + result + end + end + + ## + # Baseline implementation for the set_iam_policy_repo REST call + # + # @param request_pb [::Google::Iam::V1::SetIamPolicyRequest] + # A request object representing the call parameters. Required. + # @param options [::Gapic::CallOptions] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Iam::V1::Policy] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Iam::V1::Policy] + # A result object deserialized from the server's reply + def set_iam_policy_repo request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_set_iam_policy_repo_request request_pb + query_string_params = if query_string_params.any? + query_string_params.to_h { |p| p.split "=", 2 } + else + {} + end + + response = @client_stub.make_http_request( + verb, + uri: uri, + body: body || "", + params: query_string_params, + method_name: "set_iam_policy_repo", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Iam::V1::Policy.decode_json response.body, ignore_unknown_fields: true + catch :response do + yield result, operation if block_given? + result + end + end + + ## + # Baseline implementation for the test_iam_permissions_repo REST call + # + # @param request_pb [::Google::Iam::V1::TestIamPermissionsRequest] + # A request object representing the call parameters. Required. + # @param options [::Gapic::CallOptions] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Iam::V1::TestIamPermissionsResponse] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Iam::V1::TestIamPermissionsResponse] + # A result object deserialized from the server's reply + def test_iam_permissions_repo request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_test_iam_permissions_repo_request request_pb + query_string_params = if query_string_params.any? + query_string_params.to_h { |p| p.split "=", 2 } + else + {} + end + + response = @client_stub.make_http_request( + verb, + uri: uri, + body: body || "", + params: query_string_params, + method_name: "test_iam_permissions_repo", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Iam::V1::TestIamPermissionsResponse.decode_json response.body, ignore_unknown_fields: true + catch :response do + yield result, operation if block_given? + result + end + end + + ## + # Baseline implementation for the create_branch_rule REST call + # + # @param request_pb [::Google::Cloud::SecureSourceManager::V1::CreateBranchRuleRequest] + # 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_branch_rule request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_create_branch_rule_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_branch_rule", + 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_branch_rules REST call + # + # @param request_pb [::Google::Cloud::SecureSourceManager::V1::ListBranchRulesRequest] + # A request object representing the call parameters. Required. + # @param options [::Gapic::CallOptions] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Cloud::SecureSourceManager::V1::ListBranchRulesResponse] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::SecureSourceManager::V1::ListBranchRulesResponse] + # A result object deserialized from the server's reply + def list_branch_rules request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_list_branch_rules_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_branch_rules", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Cloud::SecureSourceManager::V1::ListBranchRulesResponse.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_branch_rule REST call + # + # @param request_pb [::Google::Cloud::SecureSourceManager::V1::GetBranchRuleRequest] + # A request object representing the call parameters. Required. + # @param options [::Gapic::CallOptions] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Cloud::SecureSourceManager::V1::BranchRule] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::SecureSourceManager::V1::BranchRule] + # A result object deserialized from the server's reply + def get_branch_rule request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_get_branch_rule_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_branch_rule", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Cloud::SecureSourceManager::V1::BranchRule.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_branch_rule REST call + # + # @param request_pb [::Google::Cloud::SecureSourceManager::V1::UpdateBranchRuleRequest] + # 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_branch_rule request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_update_branch_rule_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_branch_rule", + 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_branch_rule REST call + # + # @param request_pb [::Google::Cloud::SecureSourceManager::V1::DeleteBranchRuleRequest] + # 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_branch_rule request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_delete_branch_rule_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_branch_rule", + 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 create_pull_request REST call + # + # @param request_pb [::Google::Cloud::SecureSourceManager::V1::CreatePullRequestRequest] + # 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_pull_request request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_create_pull_request_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_pull_request", + 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_pull_request REST call + # + # @param request_pb [::Google::Cloud::SecureSourceManager::V1::GetPullRequestRequest] + # A request object representing the call parameters. Required. + # @param options [::Gapic::CallOptions] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Cloud::SecureSourceManager::V1::PullRequest] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::SecureSourceManager::V1::PullRequest] + # A result object deserialized from the server's reply + def get_pull_request request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_get_pull_request_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_pull_request", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Cloud::SecureSourceManager::V1::PullRequest.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_pull_requests REST call + # + # @param request_pb [::Google::Cloud::SecureSourceManager::V1::ListPullRequestsRequest] + # A request object representing the call parameters. Required. + # @param options [::Gapic::CallOptions] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Cloud::SecureSourceManager::V1::ListPullRequestsResponse] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::SecureSourceManager::V1::ListPullRequestsResponse] + # A result object deserialized from the server's reply + def list_pull_requests request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_list_pull_requests_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_pull_requests", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Cloud::SecureSourceManager::V1::ListPullRequestsResponse.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_pull_request REST call + # + # @param request_pb [::Google::Cloud::SecureSourceManager::V1::UpdatePullRequestRequest] + # 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_pull_request request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_update_pull_request_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_pull_request", + 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 merge_pull_request REST call + # + # @param request_pb [::Google::Cloud::SecureSourceManager::V1::MergePullRequestRequest] + # 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 merge_pull_request request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_merge_pull_request_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: "merge_pull_request", + 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 open_pull_request REST call + # + # @param request_pb [::Google::Cloud::SecureSourceManager::V1::OpenPullRequestRequest] + # 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 open_pull_request request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_open_pull_request_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: "open_pull_request", + 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 close_pull_request REST call + # + # @param request_pb [::Google::Cloud::SecureSourceManager::V1::ClosePullRequestRequest] + # 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 close_pull_request request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_close_pull_request_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: "close_pull_request", + 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_pull_request_file_diffs REST call + # + # @param request_pb [::Google::Cloud::SecureSourceManager::V1::ListPullRequestFileDiffsRequest] + # A request object representing the call parameters. Required. + # @param options [::Gapic::CallOptions] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Cloud::SecureSourceManager::V1::ListPullRequestFileDiffsResponse] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::SecureSourceManager::V1::ListPullRequestFileDiffsResponse] + # A result object deserialized from the server's reply + def list_pull_request_file_diffs request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_list_pull_request_file_diffs_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_pull_request_file_diffs", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Cloud::SecureSourceManager::V1::ListPullRequestFileDiffsResponse.decode_json response.body, ignore_unknown_fields: true + catch :response do + yield result, operation if block_given? + result + end + end + + ## + # Baseline implementation for the fetch_tree REST call + # + # @param request_pb [::Google::Cloud::SecureSourceManager::V1::FetchTreeRequest] + # A request object representing the call parameters. Required. + # @param options [::Gapic::CallOptions] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Cloud::SecureSourceManager::V1::FetchTreeResponse] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::SecureSourceManager::V1::FetchTreeResponse] + # A result object deserialized from the server's reply + def fetch_tree request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_fetch_tree_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: "fetch_tree", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Cloud::SecureSourceManager::V1::FetchTreeResponse.decode_json response.body, ignore_unknown_fields: true + catch :response do + yield result, operation if block_given? + result + end + end + + ## + # Baseline implementation for the fetch_blob REST call + # + # @param request_pb [::Google::Cloud::SecureSourceManager::V1::FetchBlobRequest] + # A request object representing the call parameters. Required. + # @param options [::Gapic::CallOptions] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Cloud::SecureSourceManager::V1::FetchBlobResponse] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::SecureSourceManager::V1::FetchBlobResponse] + # A result object deserialized from the server's reply + def fetch_blob request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_fetch_blob_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: "fetch_blob", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Cloud::SecureSourceManager::V1::FetchBlobResponse.decode_json response.body, ignore_unknown_fields: true + catch :response do + yield result, operation if block_given? + result + end + end + + ## + # Baseline implementation for the create_issue REST call + # + # @param request_pb [::Google::Cloud::SecureSourceManager::V1::CreateIssueRequest] + # 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_issue request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_create_issue_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_issue", + 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_issue REST call + # + # @param request_pb [::Google::Cloud::SecureSourceManager::V1::GetIssueRequest] + # A request object representing the call parameters. Required. + # @param options [::Gapic::CallOptions] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Cloud::SecureSourceManager::V1::Issue] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::SecureSourceManager::V1::Issue] + # A result object deserialized from the server's reply + def get_issue request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_get_issue_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_issue", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Cloud::SecureSourceManager::V1::Issue.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_issues REST call + # + # @param request_pb [::Google::Cloud::SecureSourceManager::V1::ListIssuesRequest] + # A request object representing the call parameters. Required. + # @param options [::Gapic::CallOptions] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Cloud::SecureSourceManager::V1::ListIssuesResponse] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::SecureSourceManager::V1::ListIssuesResponse] + # A result object deserialized from the server's reply + def list_issues request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_list_issues_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_issues", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Cloud::SecureSourceManager::V1::ListIssuesResponse.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_issue REST call + # + # @param request_pb [::Google::Cloud::SecureSourceManager::V1::UpdateIssueRequest] + # 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_issue request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_update_issue_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_issue", + 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_issue REST call + # + # @param request_pb [::Google::Cloud::SecureSourceManager::V1::DeleteIssueRequest] + # 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_issue request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_delete_issue_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_issue", + 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 open_issue REST call + # + # @param request_pb [::Google::Cloud::SecureSourceManager::V1::OpenIssueRequest] + # 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 open_issue request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_open_issue_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: "open_issue", + 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 close_issue REST call + # + # @param request_pb [::Google::Cloud::SecureSourceManager::V1::CloseIssueRequest] + # 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 close_issue request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_close_issue_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: "close_issue", + 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_pull_request_comment REST call + # + # @param request_pb [::Google::Cloud::SecureSourceManager::V1::GetPullRequestCommentRequest] + # A request object representing the call parameters. Required. + # @param options [::Gapic::CallOptions] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Cloud::SecureSourceManager::V1::PullRequestComment] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::SecureSourceManager::V1::PullRequestComment] + # A result object deserialized from the server's reply + def get_pull_request_comment request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_get_pull_request_comment_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_pull_request_comment", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Cloud::SecureSourceManager::V1::PullRequestComment.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_pull_request_comments REST call + # + # @param request_pb [::Google::Cloud::SecureSourceManager::V1::ListPullRequestCommentsRequest] + # A request object representing the call parameters. Required. + # @param options [::Gapic::CallOptions] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Cloud::SecureSourceManager::V1::ListPullRequestCommentsResponse] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::SecureSourceManager::V1::ListPullRequestCommentsResponse] + # A result object deserialized from the server's reply + def list_pull_request_comments request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_list_pull_request_comments_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_pull_request_comments", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Cloud::SecureSourceManager::V1::ListPullRequestCommentsResponse.decode_json response.body, ignore_unknown_fields: true + catch :response do + yield result, operation if block_given? + result + end + end + + ## + # Baseline implementation for the create_pull_request_comment REST call + # + # @param request_pb [::Google::Cloud::SecureSourceManager::V1::CreatePullRequestCommentRequest] + # 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_pull_request_comment request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_create_pull_request_comment_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_pull_request_comment", + 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 update_pull_request_comment REST call + # + # @param request_pb [::Google::Cloud::SecureSourceManager::V1::UpdatePullRequestCommentRequest] + # 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_pull_request_comment request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_update_pull_request_comment_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_pull_request_comment", + 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_pull_request_comment REST call + # + # @param request_pb [::Google::Cloud::SecureSourceManager::V1::DeletePullRequestCommentRequest] + # 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_pull_request_comment request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_delete_pull_request_comment_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_pull_request_comment", + 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 batch_create_pull_request_comments REST call + # + # @param request_pb [::Google::Cloud::SecureSourceManager::V1::BatchCreatePullRequestCommentsRequest] + # 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 batch_create_pull_request_comments request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_batch_create_pull_request_comments_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: "batch_create_pull_request_comments", + 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 resolve_pull_request_comments REST call + # + # @param request_pb [::Google::Cloud::SecureSourceManager::V1::ResolvePullRequestCommentsRequest] + # 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 resolve_pull_request_comments request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_resolve_pull_request_comments_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: "resolve_pull_request_comments", + 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 unresolve_pull_request_comments REST call + # + # @param request_pb [::Google::Cloud::SecureSourceManager::V1::UnresolvePullRequestCommentsRequest] + # 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 unresolve_pull_request_comments request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_unresolve_pull_request_comments_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: "unresolve_pull_request_comments", + 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 create_issue_comment REST call + # + # @param request_pb [::Google::Cloud::SecureSourceManager::V1::CreateIssueCommentRequest] + # 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_issue_comment request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_create_issue_comment_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_issue_comment", + 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_issue_comment REST call + # + # @param request_pb [::Google::Cloud::SecureSourceManager::V1::GetIssueCommentRequest] + # A request object representing the call parameters. Required. + # @param options [::Gapic::CallOptions] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Cloud::SecureSourceManager::V1::IssueComment] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::SecureSourceManager::V1::IssueComment] + # A result object deserialized from the server's reply + def get_issue_comment request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_get_issue_comment_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_issue_comment", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Cloud::SecureSourceManager::V1::IssueComment.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_issue_comments REST call + # + # @param request_pb [::Google::Cloud::SecureSourceManager::V1::ListIssueCommentsRequest] + # A request object representing the call parameters. Required. + # @param options [::Gapic::CallOptions] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Cloud::SecureSourceManager::V1::ListIssueCommentsResponse] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::SecureSourceManager::V1::ListIssueCommentsResponse] + # A result object deserialized from the server's reply + def list_issue_comments request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_list_issue_comments_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_issue_comments", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Cloud::SecureSourceManager::V1::ListIssueCommentsResponse.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_issue_comment REST call + # + # @param request_pb [::Google::Cloud::SecureSourceManager::V1::UpdateIssueCommentRequest] + # 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_issue_comment request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_update_issue_comment_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_issue_comment", + 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_issue_comment REST call + # + # @param request_pb [::Google::Cloud::SecureSourceManager::V1::DeleteIssueCommentRequest] + # 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_issue_comment request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_delete_issue_comment_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_issue_comment", + 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 + + ## + # @private + # + # GRPC transcoding helper method for the list_instances REST call + # + # @param request_pb [::Google::Cloud::SecureSourceManager::V1::ListInstancesRequest] + # 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_instances_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :get, + uri_template: "/v1/{parent}/instances", + matches: [ + ["parent", %r{^projects/[^/]+/locations/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the get_instance REST call + # + # @param request_pb [::Google::Cloud::SecureSourceManager::V1::GetInstanceRequest] + # 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_instance_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/instances/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the create_instance REST call + # + # @param request_pb [::Google::Cloud::SecureSourceManager::V1::CreateInstanceRequest] + # 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_instance_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :post, + uri_template: "/v1/{parent}/instances", + body: "instance", + matches: [ + ["parent", %r{^projects/[^/]+/locations/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the delete_instance REST call + # + # @param request_pb [::Google::Cloud::SecureSourceManager::V1::DeleteInstanceRequest] + # 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_instance_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :delete, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/instances/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the list_repositories REST call + # + # @param request_pb [::Google::Cloud::SecureSourceManager::V1::ListRepositoriesRequest] + # 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_repositories_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :get, + uri_template: "/v1/{parent}/repositories", + matches: [ + ["parent", %r{^projects/[^/]+/locations/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the get_repository REST call + # + # @param request_pb [::Google::Cloud::SecureSourceManager::V1::GetRepositoryRequest] + # 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_repository_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/repositories/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the create_repository REST call + # + # @param request_pb [::Google::Cloud::SecureSourceManager::V1::CreateRepositoryRequest] + # 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_repository_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :post, + uri_template: "/v1/{parent}/repositories", + body: "repository", + matches: [ + ["parent", %r{^projects/[^/]+/locations/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the update_repository REST call + # + # @param request_pb [::Google::Cloud::SecureSourceManager::V1::UpdateRepositoryRequest] + # 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_repository_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :patch, + uri_template: "/v1/{repository.name}", + body: "repository", + matches: [ + ["repository.name", %r{^projects/[^/]+/locations/[^/]+/repositories/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the delete_repository REST call + # + # @param request_pb [::Google::Cloud::SecureSourceManager::V1::DeleteRepositoryRequest] + # 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_repository_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :delete, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/repositories/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the list_hooks REST call + # + # @param request_pb [::Google::Cloud::SecureSourceManager::V1::ListHooksRequest] + # 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_hooks_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :get, + uri_template: "/v1/{parent}/hooks", + matches: [ + ["parent", %r{^projects/[^/]+/locations/[^/]+/repositories/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the get_hook REST call + # + # @param request_pb [::Google::Cloud::SecureSourceManager::V1::GetHookRequest] + # 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_hook_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/repositories/[^/]+/hooks/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the create_hook REST call + # + # @param request_pb [::Google::Cloud::SecureSourceManager::V1::CreateHookRequest] + # 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_hook_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :post, + uri_template: "/v1/{parent}/hooks", + body: "hook", + matches: [ + ["parent", %r{^projects/[^/]+/locations/[^/]+/repositories/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the update_hook REST call + # + # @param request_pb [::Google::Cloud::SecureSourceManager::V1::UpdateHookRequest] + # 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_hook_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :patch, + uri_template: "/v1/{hook.name}", + body: "hook", + matches: [ + ["hook.name", %r{^projects/[^/]+/locations/[^/]+/repositories/[^/]+/hooks/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the delete_hook REST call + # + # @param request_pb [::Google::Cloud::SecureSourceManager::V1::DeleteHookRequest] + # 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_hook_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :delete, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/repositories/[^/]+/hooks/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the get_iam_policy_repo REST call + # + # @param request_pb [::Google::Iam::V1::GetIamPolicyRequest] + # A request object representing the call parameters. Required. + # @return [Array(String, [String, nil], Hash{String => String})] + # Uri, Body, Query string parameters + def self.transcode_get_iam_policy_repo_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :get, + uri_template: "/v1/{resource}:getIamPolicy", + matches: [ + ["resource", %r{^projects/[^/]+/locations/[^/]+/repositories/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the set_iam_policy_repo REST call + # + # @param request_pb [::Google::Iam::V1::SetIamPolicyRequest] + # A request object representing the call parameters. Required. + # @return [Array(String, [String, nil], Hash{String => String})] + # Uri, Body, Query string parameters + def self.transcode_set_iam_policy_repo_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :post, + uri_template: "/v1/{resource}:setIamPolicy", + body: "*", + matches: [ + ["resource", %r{^projects/[^/]+/locations/[^/]+/repositories/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the test_iam_permissions_repo REST call + # + # @param request_pb [::Google::Iam::V1::TestIamPermissionsRequest] + # A request object representing the call parameters. Required. + # @return [Array(String, [String, nil], Hash{String => String})] + # Uri, Body, Query string parameters + def self.transcode_test_iam_permissions_repo_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :post, + uri_template: "/v1/{resource}:testIamPermissions", + body: "*", + matches: [ + ["resource", %r{^projects/[^/]+/locations/[^/]+/repositories/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the create_branch_rule REST call + # + # @param request_pb [::Google::Cloud::SecureSourceManager::V1::CreateBranchRuleRequest] + # 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_branch_rule_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :post, + uri_template: "/v1/{parent}/branchRules", + body: "branch_rule", + matches: [ + ["parent", %r{^projects/[^/]+/locations/[^/]+/repositories/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the list_branch_rules REST call + # + # @param request_pb [::Google::Cloud::SecureSourceManager::V1::ListBranchRulesRequest] + # 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_branch_rules_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :get, + uri_template: "/v1/{parent}/branchRules", + matches: [ + ["parent", %r{^projects/[^/]+/locations/[^/]+/repositories/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the get_branch_rule REST call + # + # @param request_pb [::Google::Cloud::SecureSourceManager::V1::GetBranchRuleRequest] + # 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_branch_rule_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/repositories/[^/]+/branchRules/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the update_branch_rule REST call + # + # @param request_pb [::Google::Cloud::SecureSourceManager::V1::UpdateBranchRuleRequest] + # 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_branch_rule_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :patch, + uri_template: "/v1/{branch_rule.name}", + body: "branch_rule", + matches: [ + ["branch_rule.name", %r{^projects/[^/]+/locations/[^/]+/repositories/[^/]+/branchRules/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the delete_branch_rule REST call + # + # @param request_pb [::Google::Cloud::SecureSourceManager::V1::DeleteBranchRuleRequest] + # 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_branch_rule_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :delete, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/repositories/[^/]+/branchRules/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the create_pull_request REST call + # + # @param request_pb [::Google::Cloud::SecureSourceManager::V1::CreatePullRequestRequest] + # 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_pull_request_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :post, + uri_template: "/v1/{parent}/pullRequests", + body: "pull_request", + matches: [ + ["parent", %r{^projects/[^/]+/locations/[^/]+/repositories/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the get_pull_request REST call + # + # @param request_pb [::Google::Cloud::SecureSourceManager::V1::GetPullRequestRequest] + # 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_pull_request_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/repositories/[^/]+/pullRequests/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the list_pull_requests REST call + # + # @param request_pb [::Google::Cloud::SecureSourceManager::V1::ListPullRequestsRequest] + # 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_pull_requests_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :get, + uri_template: "/v1/{parent}/pullRequests", + matches: [ + ["parent", %r{^projects/[^/]+/locations/[^/]+/repositories/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the update_pull_request REST call + # + # @param request_pb [::Google::Cloud::SecureSourceManager::V1::UpdatePullRequestRequest] + # 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_pull_request_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :patch, + uri_template: "/v1/{pull_request.name}", + body: "pull_request", + matches: [ + ["pull_request.name", %r{^projects/[^/]+/locations/[^/]+/repositories/[^/]+/pullRequests/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the merge_pull_request REST call + # + # @param request_pb [::Google::Cloud::SecureSourceManager::V1::MergePullRequestRequest] + # A request object representing the call parameters. Required. + # @return [Array(String, [String, nil], Hash{String => String})] + # Uri, Body, Query string parameters + def self.transcode_merge_pull_request_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:merge", + body: "*", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/repositories/[^/]+/pullRequests/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the open_pull_request REST call + # + # @param request_pb [::Google::Cloud::SecureSourceManager::V1::OpenPullRequestRequest] + # A request object representing the call parameters. Required. + # @return [Array(String, [String, nil], Hash{String => String})] + # Uri, Body, Query string parameters + def self.transcode_open_pull_request_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:open", + body: "*", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/repositories/[^/]+/pullRequests/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the close_pull_request REST call + # + # @param request_pb [::Google::Cloud::SecureSourceManager::V1::ClosePullRequestRequest] + # A request object representing the call parameters. Required. + # @return [Array(String, [String, nil], Hash{String => String})] + # Uri, Body, Query string parameters + def self.transcode_close_pull_request_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:close", + body: "*", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/repositories/[^/]+/pullRequests/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the list_pull_request_file_diffs REST call + # + # @param request_pb [::Google::Cloud::SecureSourceManager::V1::ListPullRequestFileDiffsRequest] + # 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_pull_request_file_diffs_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}:listFileDiffs", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/repositories/[^/]+/pullRequests/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the fetch_tree REST call + # + # @param request_pb [::Google::Cloud::SecureSourceManager::V1::FetchTreeRequest] + # A request object representing the call parameters. Required. + # @return [Array(String, [String, nil], Hash{String => String})] + # Uri, Body, Query string parameters + def self.transcode_fetch_tree_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :get, + uri_template: "/v1/{repository}:fetchTree", + matches: [ + ["repository", %r{^projects/[^/]+/locations/[^/]+/repositories/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the fetch_blob REST call + # + # @param request_pb [::Google::Cloud::SecureSourceManager::V1::FetchBlobRequest] + # A request object representing the call parameters. Required. + # @return [Array(String, [String, nil], Hash{String => String})] + # Uri, Body, Query string parameters + def self.transcode_fetch_blob_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :get, + uri_template: "/v1/{repository}:fetchBlob", + matches: [ + ["repository", %r{^projects/[^/]+/locations/[^/]+/repositories/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the create_issue REST call + # + # @param request_pb [::Google::Cloud::SecureSourceManager::V1::CreateIssueRequest] + # 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_issue_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :post, + uri_template: "/v1/{parent}/issues", + body: "issue", + matches: [ + ["parent", %r{^projects/[^/]+/locations/[^/]+/repositories/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the get_issue REST call + # + # @param request_pb [::Google::Cloud::SecureSourceManager::V1::GetIssueRequest] + # 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_issue_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/repositories/[^/]+/issues/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the list_issues REST call + # + # @param request_pb [::Google::Cloud::SecureSourceManager::V1::ListIssuesRequest] + # 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_issues_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :get, + uri_template: "/v1/{parent}/issues", + matches: [ + ["parent", %r{^projects/[^/]+/locations/[^/]+/repositories/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the update_issue REST call + # + # @param request_pb [::Google::Cloud::SecureSourceManager::V1::UpdateIssueRequest] + # 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_issue_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :patch, + uri_template: "/v1/{issue.name}", + body: "issue", + matches: [ + ["issue.name", %r{^projects/[^/]+/locations/[^/]+/repositories/[^/]+/issues/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the delete_issue REST call + # + # @param request_pb [::Google::Cloud::SecureSourceManager::V1::DeleteIssueRequest] + # 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_issue_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :delete, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/repositories/[^/]+/issues/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the open_issue REST call + # + # @param request_pb [::Google::Cloud::SecureSourceManager::V1::OpenIssueRequest] + # A request object representing the call parameters. Required. + # @return [Array(String, [String, nil], Hash{String => String})] + # Uri, Body, Query string parameters + def self.transcode_open_issue_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:open", + body: "*", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/repositories/[^/]+/issues/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the close_issue REST call + # + # @param request_pb [::Google::Cloud::SecureSourceManager::V1::CloseIssueRequest] + # A request object representing the call parameters. Required. + # @return [Array(String, [String, nil], Hash{String => String})] + # Uri, Body, Query string parameters + def self.transcode_close_issue_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:close", + body: "*", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/repositories/[^/]+/issues/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the get_pull_request_comment REST call + # + # @param request_pb [::Google::Cloud::SecureSourceManager::V1::GetPullRequestCommentRequest] + # 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_pull_request_comment_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/repositories/[^/]+/pullRequests/[^/]+/pullRequestComments/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the list_pull_request_comments REST call + # + # @param request_pb [::Google::Cloud::SecureSourceManager::V1::ListPullRequestCommentsRequest] + # 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_pull_request_comments_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :get, + uri_template: "/v1/{parent}/pullRequestComments", + matches: [ + ["parent", %r{^projects/[^/]+/locations/[^/]+/repositories/[^/]+/pullRequests/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the create_pull_request_comment REST call + # + # @param request_pb [::Google::Cloud::SecureSourceManager::V1::CreatePullRequestCommentRequest] + # 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_pull_request_comment_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :post, + uri_template: "/v1/{parent}/pullRequestComments", + body: "pull_request_comment", + matches: [ + ["parent", %r{^projects/[^/]+/locations/[^/]+/repositories/[^/]+/pullRequests/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the update_pull_request_comment REST call + # + # @param request_pb [::Google::Cloud::SecureSourceManager::V1::UpdatePullRequestCommentRequest] + # 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_pull_request_comment_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :patch, + uri_template: "/v1/{pull_request_comment.name}", + body: "pull_request_comment", + matches: [ + ["pull_request_comment.name", %r{^projects/[^/]+/locations/[^/]+/repositories/[^/]+/pullRequests/[^/]+/pullRequestComments/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the delete_pull_request_comment REST call + # + # @param request_pb [::Google::Cloud::SecureSourceManager::V1::DeletePullRequestCommentRequest] + # 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_pull_request_comment_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :delete, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/repositories/[^/]+/pullRequests/[^/]+/pullRequestComments/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the batch_create_pull_request_comments REST call + # + # @param request_pb [::Google::Cloud::SecureSourceManager::V1::BatchCreatePullRequestCommentsRequest] + # A request object representing the call parameters. Required. + # @return [Array(String, [String, nil], Hash{String => String})] + # Uri, Body, Query string parameters + def self.transcode_batch_create_pull_request_comments_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :post, + uri_template: "/v1/{parent}/pullRequestComments:batchCreate", + body: "*", + matches: [ + ["parent", %r{^projects/[^/]+/locations/[^/]+/repositories/[^/]+/pullRequests/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the resolve_pull_request_comments REST call + # + # @param request_pb [::Google::Cloud::SecureSourceManager::V1::ResolvePullRequestCommentsRequest] + # A request object representing the call parameters. Required. + # @return [Array(String, [String, nil], Hash{String => String})] + # Uri, Body, Query string parameters + def self.transcode_resolve_pull_request_comments_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :post, + uri_template: "/v1/{parent}/pullRequestComments:resolve", + body: "*", + matches: [ + ["parent", %r{^projects/[^/]+/locations/[^/]+/repositories/[^/]+/pullRequests/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the unresolve_pull_request_comments REST call + # + # @param request_pb [::Google::Cloud::SecureSourceManager::V1::UnresolvePullRequestCommentsRequest] + # A request object representing the call parameters. Required. + # @return [Array(String, [String, nil], Hash{String => String})] + # Uri, Body, Query string parameters + def self.transcode_unresolve_pull_request_comments_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :post, + uri_template: "/v1/{parent}/pullRequestComments:unresolve", + body: "*", + matches: [ + ["parent", %r{^projects/[^/]+/locations/[^/]+/repositories/[^/]+/pullRequests/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the create_issue_comment REST call + # + # @param request_pb [::Google::Cloud::SecureSourceManager::V1::CreateIssueCommentRequest] + # 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_issue_comment_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :post, + uri_template: "/v1/{parent}/issueComments", + body: "issue_comment", + matches: [ + ["parent", %r{^projects/[^/]+/locations/[^/]+/repositories/[^/]+/issues/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the get_issue_comment REST call + # + # @param request_pb [::Google::Cloud::SecureSourceManager::V1::GetIssueCommentRequest] + # 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_issue_comment_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/repositories/[^/]+/issues/[^/]+/issueComments/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the list_issue_comments REST call + # + # @param request_pb [::Google::Cloud::SecureSourceManager::V1::ListIssueCommentsRequest] + # 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_issue_comments_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :get, + uri_template: "/v1/{parent}/issueComments", + matches: [ + ["parent", %r{^projects/[^/]+/locations/[^/]+/repositories/[^/]+/issues/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the update_issue_comment REST call + # + # @param request_pb [::Google::Cloud::SecureSourceManager::V1::UpdateIssueCommentRequest] + # 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_issue_comment_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :patch, + uri_template: "/v1/{issue_comment.name}", + body: "issue_comment", + matches: [ + ["issue_comment.name", %r{^projects/[^/]+/locations/[^/]+/repositories/[^/]+/issues/[^/]+/issueComments/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the delete_issue_comment REST call + # + # @param request_pb [::Google::Cloud::SecureSourceManager::V1::DeleteIssueCommentRequest] + # 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_issue_comment_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :delete, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/repositories/[^/]+/issues/[^/]+/issueComments/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + end + end + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-secure_source_manager-v1/lib/google/cloud/secure_source_manager/v1/version.rb b/owl-bot-staging/google-cloud-secure_source_manager-v1/lib/google/cloud/secure_source_manager/v1/version.rb new file mode 100644 index 000000000000..aa5823b1716e --- /dev/null +++ b/owl-bot-staging/google-cloud-secure_source_manager-v1/lib/google/cloud/secure_source_manager/v1/version.rb @@ -0,0 +1,28 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + + +module Google + module Cloud + module SecureSourceManager + module V1 + VERSION = "0.0.1" + end + end + end +end diff --git a/owl-bot-staging/google-cloud-secure_source_manager-v1/lib/google/cloud/securesourcemanager/v1/secure_source_manager_pb.rb b/owl-bot-staging/google-cloud-secure_source_manager-v1/lib/google/cloud/securesourcemanager/v1/secure_source_manager_pb.rb new file mode 100644 index 000000000000..af6a8aaab689 --- /dev/null +++ b/owl-bot-staging/google-cloud-secure_source_manager-v1/lib/google/cloud/securesourcemanager/v1/secure_source_manager_pb.rb @@ -0,0 +1,125 @@ +# frozen_string_literal: true +# Generated by the protocol buffer compiler. DO NOT EDIT! +# source: google/cloud/securesourcemanager/v1/secure_source_manager.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/v1/iam_policy_pb' +require 'google/iam/v1/policy_pb' +require 'google/longrunning/operations_pb' +require 'google/protobuf/empty_pb' +require 'google/protobuf/field_mask_pb' +require 'google/protobuf/timestamp_pb' + + +descriptor_data = "\n?google/cloud/securesourcemanager/v1/secure_source_manager.proto\x12#google.cloud.securesourcemanager.v1\x1a\x1cgoogle/api/annotations.proto\x1a\x17google/api/client.proto\x1a\x1fgoogle/api/field_behavior.proto\x1a\x19google/api/resource.proto\x1a\x1egoogle/iam/v1/iam_policy.proto\x1a\x1agoogle/iam/v1/policy.proto\x1a#google/longrunning/operations.proto\x1a\x1bgoogle/protobuf/empty.proto\x1a google/protobuf/field_mask.proto\x1a\x1fgoogle/protobuf/timestamp.proto\"\x98\x0c\n\x08Instance\x12\x11\n\x04name\x18\x01 \x01(\tB\x03\xe0\x41\x01\x12\x34\n\x0b\x63reate_time\x18\x02 \x01(\x0b\x32\x1a.google.protobuf.TimestampB\x03\xe0\x41\x03\x12\x34\n\x0bupdate_time\x18\x03 \x01(\x0b\x32\x1a.google.protobuf.TimestampB\x03\xe0\x41\x03\x12N\n\x06labels\x18\x04 \x03(\x0b\x32\x39.google.cloud.securesourcemanager.v1.Instance.LabelsEntryB\x03\xe0\x41\x01\x12X\n\x0eprivate_config\x18\r \x01(\x0b\x32;.google.cloud.securesourcemanager.v1.Instance.PrivateConfigB\x03\xe0\x41\x01\x12G\n\x05state\x18\x05 \x01(\x0e\x32\x33.google.cloud.securesourcemanager.v1.Instance.StateB\x03\xe0\x41\x03\x12P\n\nstate_note\x18\n \x01(\x0e\x32\x37.google.cloud.securesourcemanager.v1.Instance.StateNoteB\x03\xe0\x41\x03\x12:\n\x07kms_key\x18\x0b \x01(\tB)\xe0\x41\x05\xfa\x41#\n!cloudkms.googleapis.com/CryptoKey\x12R\n\x0bhost_config\x18\t \x01(\x0b\x32\x38.google.cloud.securesourcemanager.v1.Instance.HostConfigB\x03\xe0\x41\x03\x12\x82\x01\n$workforce_identity_federation_config\x18\x0e \x01(\x0b\x32O.google.cloud.securesourcemanager.v1.Instance.WorkforceIdentityFederationConfigB\x03\xe0\x41\x01\x1a^\n\nHostConfig\x12\x11\n\x04html\x18\x01 \x01(\tB\x03\xe0\x41\x03\x12\x10\n\x03\x61pi\x18\x02 \x01(\tB\x03\xe0\x41\x03\x12\x15\n\x08git_http\x18\x03 \x01(\tB\x03\xe0\x41\x03\x12\x14\n\x07git_ssh\x18\x04 \x01(\tB\x03\xe0\x41\x03\x1a\xb0\x02\n\rPrivateConfig\x12\x1a\n\nis_private\x18\x01 \x01(\x08\x42\x06\xe0\x41\x05\xe0\x41\x02\x12;\n\x07\x63\x61_pool\x18\x02 \x01(\tB*\xe0\x41\x05\xe0\x41\x01\xfa\x41!\n\x1fprivateca.googleapis.com/CaPool\x12Q\n\x17http_service_attachment\x18\x03 \x01(\tB0\xe0\x41\x03\xfa\x41*\n(compute.googleapis.com/ServiceAttachment\x12P\n\x16ssh_service_attachment\x18\x04 \x01(\tB0\xe0\x41\x03\xfa\x41*\n(compute.googleapis.com/ServiceAttachment\x12!\n\x14psc_allowed_projects\x18\x06 \x03(\tB\x03\xe0\x41\x01\x1a<\n!WorkforceIdentityFederationConfig\x12\x17\n\x07\x65nabled\x18\x01 \x01(\x08\x42\x06\xe0\x41\x05\xe0\x41\x01\x1a-\n\x0bLabelsEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12\r\n\x05value\x18\x02 \x01(\t:\x02\x38\x01\"_\n\x05State\x12\x15\n\x11STATE_UNSPECIFIED\x10\x00\x12\x0c\n\x08\x43REATING\x10\x01\x12\n\n\x06\x41\x43TIVE\x10\x02\x12\x0c\n\x08\x44\x45LETING\x10\x03\x12\n\n\x06PAUSED\x10\x04\x12\x0b\n\x07UNKNOWN\x10\x06\"_\n\tStateNote\x12\x1a\n\x16STATE_NOTE_UNSPECIFIED\x10\x00\x12\x1b\n\x17PAUSED_CMEK_UNAVAILABLE\x10\x01\x12\x19\n\x11INSTANCE_RESUMING\x10\x02\x1a\x02\x08\x01:q\xea\x41n\n+securesourcemanager.googleapis.com/Instance\x12.google.cloud.securesourcemanager.v1.PullRequestComment.ReviewB\x03\xe0\x41\x01H\x00\x12W\n\x07\x63omment\x18\x05 \x01(\x0b\x32?.google.cloud.securesourcemanager.v1.PullRequestComment.CommentB\x03\xe0\x41\x01H\x00\x12Q\n\x04\x63ode\x18\x06 \x01(\x0b\x32<.google.cloud.securesourcemanager.v1.PullRequestComment.CodeB\x03\xe0\x41\x01H\x00\x1a\xff\x01\n\x06Review\x12\x63\n\x0b\x61\x63tion_type\x18\x01 \x01(\x0e\x32I.google.cloud.securesourcemanager.v1.PullRequestComment.Review.ActionTypeB\x03\xe0\x41\x02\x12\x11\n\x04\x62ody\x18\x02 \x01(\tB\x03\xe0\x41\x01\x12!\n\x14\x65\x66\x66\x65\x63tive_commit_sha\x18\x04 \x01(\tB\x03\xe0\x41\x03\"Z\n\nActionType\x12\x1b\n\x17\x41\x43TION_TYPE_UNSPECIFIED\x10\x00\x12\x0b\n\x07\x43OMMENT\x10\x01\x12\x14\n\x10\x43HANGE_REQUESTED\x10\x02\x12\x0c\n\x08\x41PPROVED\x10\x03\x1a\x1c\n\x07\x43omment\x12\x11\n\x04\x62ody\x18\x01 \x01(\tB\x03\xe0\x41\x02\x1a\xe8\x01\n\x04\x43ode\x12\x11\n\x04\x62ody\x18\x01 \x01(\tB\x03\xe0\x41\x02\x12\x15\n\x05reply\x18\x02 \x01(\tB\x06\xe0\x41\x01\xe0\x41\x04\x12W\n\x08position\x18\x03 \x01(\x0b\x32@.google.cloud.securesourcemanager.v1.PullRequestComment.PositionB\x03\xe0\x41\x01\x12#\n\x16\x65\x66\x66\x65\x63tive_root_comment\x18\x04 \x01(\tB\x03\xe0\x41\x03\x12\x15\n\x08resolved\x18\x05 \x01(\x08\x42\x03\xe0\x41\x03\x12!\n\x14\x65\x66\x66\x65\x63tive_commit_sha\x18\x07 \x01(\tB\x03\xe0\x41\x03\x1a\x30\n\x08Position\x12\x11\n\x04path\x18\x01 \x01(\tB\x03\xe0\x41\x02\x12\x11\n\x04line\x18\x02 \x01(\x03\x42\x03\xe0\x41\x02:\xb8\x01\xea\x41\xb4\x01\n5securesourcemanager.googleapis.com/PullRequestComment\x12{projects/{project}/locations/{location}/repositories/{repository}/pullRequests/{pull_request}/pullRequestComments/{comment}B\x10\n\x0e\x63omment_detail\"\xa4\x01\n\x14ListInstancesRequest\x12\x43\n\x06parent\x18\x01 \x01(\tB3\xe0\x41\x02\xfa\x41-\x12+securesourcemanager.googleapis.com/Instance\x12\x11\n\tpage_size\x18\x02 \x01(\x05\x12\x12\n\npage_token\x18\x03 \x01(\t\x12\x0e\n\x06\x66ilter\x18\x04 \x01(\t\x12\x10\n\x08order_by\x18\x05 \x01(\t\"\x87\x01\n\x15ListInstancesResponse\x12@\n\tinstances\x18\x01 \x03(\x0b\x32-.google.cloud.securesourcemanager.v1.Instance\x12\x17\n\x0fnext_page_token\x18\x02 \x01(\t\x12\x13\n\x0bunreachable\x18\x03 \x03(\t\"W\n\x12GetInstanceRequest\x12\x41\n\x04name\x18\x01 \x01(\tB3\xe0\x41\x02\xfa\x41-\n+securesourcemanager.googleapis.com/Instance\"\xd5\x01\n\x15\x43reateInstanceRequest\x12\x43\n\x06parent\x18\x01 \x01(\tB3\xe0\x41\x02\xfa\x41-\x12+securesourcemanager.googleapis.com/Instance\x12\x18\n\x0binstance_id\x18\x02 \x01(\tB\x03\xe0\x41\x02\x12\x44\n\x08instance\x18\x03 \x01(\x0b\x32-.google.cloud.securesourcemanager.v1.InstanceB\x03\xe0\x41\x02\x12\x17\n\nrequest_id\x18\x04 \x01(\tB\x03\xe0\x41\x01\"s\n\x15\x44\x65leteInstanceRequest\x12\x41\n\x04name\x18\x01 \x01(\tB3\xe0\x41\x02\xfa\x41-\n+securesourcemanager.googleapis.com/Instance\x12\x17\n\nrequest_id\x18\x02 \x01(\tB\x03\xe0\x41\x01\"\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\"\xe8\x01\n\x17ListRepositoriesRequest\x12\x45\n\x06parent\x18\x01 \x01(\tB5\xe0\x41\x02\xfa\x41/\x12-securesourcemanager.googleapis.com/Repository\x12\x16\n\tpage_size\x18\x02 \x01(\x05\x42\x03\xe0\x41\x01\x12\x12\n\npage_token\x18\x03 \x01(\t\x12\x13\n\x06\x66ilter\x18\x04 \x01(\tB\x03\xe0\x41\x01\x12\x45\n\x08instance\x18\x05 \x01(\tB3\xe0\x41\x01\xfa\x41-\n+securesourcemanager.googleapis.com/Instance\"z\n\x18ListRepositoriesResponse\x12\x45\n\x0crepositories\x18\x01 \x03(\x0b\x32/.google.cloud.securesourcemanager.v1.Repository\x12\x17\n\x0fnext_page_token\x18\x02 \x01(\t\"[\n\x14GetRepositoryRequest\x12\x43\n\x04name\x18\x01 \x01(\tB5\xe0\x41\x02\xfa\x41/\n-securesourcemanager.googleapis.com/Repository\"\xc6\x01\n\x17\x43reateRepositoryRequest\x12\x45\n\x06parent\x18\x01 \x01(\tB5\xe0\x41\x02\xfa\x41/\x12-securesourcemanager.googleapis.com/Repository\x12H\n\nrepository\x18\x02 \x01(\x0b\x32/.google.cloud.securesourcemanager.v1.RepositoryB\x03\xe0\x41\x02\x12\x1a\n\rrepository_id\x18\x03 \x01(\tB\x03\xe0\x41\x02\"\xb5\x01\n\x17UpdateRepositoryRequest\x12\x34\n\x0bupdate_mask\x18\x01 \x01(\x0b\x32\x1a.google.protobuf.FieldMaskB\x03\xe0\x41\x01\x12H\n\nrepository\x18\x02 \x01(\x0b\x32/.google.cloud.securesourcemanager.v1.RepositoryB\x03\xe0\x41\x02\x12\x1a\n\rvalidate_only\x18\x03 \x01(\x08\x42\x03\xe0\x41\x01\"z\n\x17\x44\x65leteRepositoryRequest\x12\x43\n\x04name\x18\x01 \x01(\tB5\xe0\x41\x02\xfa\x41/\n-securesourcemanager.googleapis.com/Repository\x12\x1a\n\rallow_missing\x18\x02 \x01(\x08\x42\x03\xe0\x41\x01\"\x84\x01\n\x10ListHooksRequest\x12?\n\x06parent\x18\x01 \x01(\tB/\xe0\x41\x02\xfa\x41)\x12\'securesourcemanager.googleapis.com/Hook\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\"f\n\x11ListHooksResponse\x12\x38\n\x05hooks\x18\x01 \x03(\x0b\x32).google.cloud.securesourcemanager.v1.Hook\x12\x17\n\x0fnext_page_token\x18\x02 \x01(\t\"O\n\x0eGetHookRequest\x12=\n\x04name\x18\x01 \x01(\tB/\xe0\x41\x02\xfa\x41)\n\'securesourcemanager.googleapis.com/Hook\"\xae\x01\n\x11\x43reateHookRequest\x12\x45\n\x06parent\x18\x01 \x01(\tB5\xe0\x41\x02\xfa\x41/\n-securesourcemanager.googleapis.com/Repository\x12<\n\x04hook\x18\x02 \x01(\x0b\x32).google.cloud.securesourcemanager.v1.HookB\x03\xe0\x41\x02\x12\x14\n\x07hook_id\x18\x03 \x01(\tB\x03\xe0\x41\x02\"\x87\x01\n\x11UpdateHookRequest\x12\x34\n\x0bupdate_mask\x18\x01 \x01(\x0b\x32\x1a.google.protobuf.FieldMaskB\x03\xe0\x41\x02\x12<\n\x04hook\x18\x02 \x01(\x0b\x32).google.cloud.securesourcemanager.v1.HookB\x03\xe0\x41\x02\"R\n\x11\x44\x65leteHookRequest\x12=\n\x04name\x18\x01 \x01(\tB/\xe0\x41\x02\xfa\x41)\n\'securesourcemanager.googleapis.com/Hook\"[\n\x14GetBranchRuleRequest\x12\x43\n\x04name\x18\x01 \x01(\tB5\xe0\x41\x02\xfa\x41/\n-securesourcemanager.googleapis.com/BranchRule\"\xc8\x01\n\x17\x43reateBranchRuleRequest\x12\x45\n\x06parent\x18\x01 \x01(\tB5\xe0\x41\x02\xfa\x41/\x12-securesourcemanager.googleapis.com/BranchRule\x12I\n\x0b\x62ranch_rule\x18\x02 \x01(\x0b\x32/.google.cloud.securesourcemanager.v1.BranchRuleB\x03\xe0\x41\x02\x12\x1b\n\x0e\x62ranch_rule_id\x18\x03 \x01(\tB\x03\xe0\x41\x02\"\x90\x01\n\x16ListBranchRulesRequest\x12\x45\n\x06parent\x18\x01 \x01(\tB5\xe0\x41\x02\xfa\x41/\x12-securesourcemanager.googleapis.com/BranchRule\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\"z\n\x17\x44\x65leteBranchRuleRequest\x12\x43\n\x04name\x18\x01 \x01(\tB5\xe0\x41\x02\xfa\x41/\n-securesourcemanager.googleapis.com/BranchRule\x12\x1a\n\rallow_missing\x18\x02 \x01(\x08\x42\x03\xe0\x41\x01\"\xb6\x01\n\x17UpdateBranchRuleRequest\x12I\n\x0b\x62ranch_rule\x18\x01 \x01(\x0b\x32/.google.cloud.securesourcemanager.v1.BranchRuleB\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\x02\"y\n\x17ListBranchRulesResponse\x12\x45\n\x0c\x62ranch_rules\x18\x01 \x03(\x0b\x32/.google.cloud.securesourcemanager.v1.BranchRule\x12\x17\n\x0fnext_page_token\x18\x02 \x01(\t\"\xae\x01\n\x18\x43reatePullRequestRequest\x12\x45\n\x06parent\x18\x01 \x01(\tB5\xe0\x41\x02\xfa\x41/\n-securesourcemanager.googleapis.com/Repository\x12K\n\x0cpull_request\x18\x02 \x01(\x0b\x32\x30.google.cloud.securesourcemanager.v1.PullRequestB\x03\xe0\x41\x02\"]\n\x15GetPullRequestRequest\x12\x44\n\x04name\x18\x01 \x01(\tB6\xe0\x41\x02\xfa\x41\x30\n.securesourcemanager.googleapis.com/PullRequest\"\x91\x01\n\x17ListPullRequestsRequest\x12\x45\n\x06parent\x18\x01 \x01(\tB5\xe0\x41\x02\xfa\x41/\n-securesourcemanager.googleapis.com/Repository\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\x18ListPullRequestsResponse\x12G\n\rpull_requests\x18\x01 \x03(\x0b\x32\x30.google.cloud.securesourcemanager.v1.PullRequest\x12\x17\n\x0fnext_page_token\x18\x02 \x01(\t\"\x9d\x01\n\x18UpdatePullRequestRequest\x12K\n\x0cpull_request\x18\x01 \x01(\x0b\x32\x30.google.cloud.securesourcemanager.v1.PullRequestB\x03\xe0\x41\x02\x12\x34\n\x0bupdate_mask\x18\x02 \x01(\x0b\x32\x1a.google.protobuf.FieldMaskB\x03\xe0\x41\x01\"_\n\x17MergePullRequestRequest\x12\x44\n\x04name\x18\x01 \x01(\tB6\xe0\x41\x02\xfa\x41\x30\n.securesourcemanager.googleapis.com/PullRequest\"^\n\x16OpenPullRequestRequest\x12\x44\n\x04name\x18\x01 \x01(\tB6\xe0\x41\x02\xfa\x41\x30\n.securesourcemanager.googleapis.com/PullRequest\"_\n\x17\x43losePullRequestRequest\x12\x44\n\x04name\x18\x01 \x01(\tB6\xe0\x41\x02\xfa\x41\x30\n.securesourcemanager.googleapis.com/PullRequest\"\x98\x01\n\x1fListPullRequestFileDiffsRequest\x12\x44\n\x04name\x18\x01 \x01(\tB6\xe0\x41\x02\xfa\x41\x30\n.securesourcemanager.googleapis.com/PullRequest\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 ListPullRequestFileDiffsResponse\x12\x41\n\nfile_diffs\x18\x01 \x03(\x0b\x32-.google.cloud.securesourcemanager.v1.FileDiff\x12\x17\n\x0fnext_page_token\x18\x02 \x01(\t\"\x9b\x01\n\x12\x43reateIssueRequest\x12\x45\n\x06parent\x18\x01 \x01(\tB5\xe0\x41\x02\xfa\x41/\n-securesourcemanager.googleapis.com/Repository\x12>\n\x05issue\x18\x02 \x01(\x0b\x32*.google.cloud.securesourcemanager.v1.IssueB\x03\xe0\x41\x02\"Q\n\x0fGetIssueRequest\x12>\n\x04name\x18\x01 \x01(\tB0\xe0\x41\x02\xfa\x41*\n(securesourcemanager.googleapis.com/Issue\"\x9b\x01\n\x11ListIssuesRequest\x12@\n\x06parent\x18\x01 \x01(\tB0\xe0\x41\x02\xfa\x41*\x12(securesourcemanager.googleapis.com/Issue\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\"i\n\x12ListIssuesResponse\x12:\n\x06issues\x18\x01 \x03(\x0b\x32*.google.cloud.securesourcemanager.v1.Issue\x12\x17\n\x0fnext_page_token\x18\x02 \x01(\t\"\x8a\x01\n\x12UpdateIssueRequest\x12>\n\x05issue\x18\x01 \x01(\x0b\x32*.google.cloud.securesourcemanager.v1.IssueB\x03\xe0\x41\x02\x12\x34\n\x0bupdate_mask\x18\x02 \x01(\x0b\x32\x1a.google.protobuf.FieldMaskB\x03\xe0\x41\x01\"g\n\x12\x44\x65leteIssueRequest\x12>\n\x04name\x18\x01 \x01(\tB0\xe0\x41\x02\xfa\x41*\n(securesourcemanager.googleapis.com/Issue\x12\x11\n\x04\x65tag\x18\x02 \x01(\tB\x03\xe0\x41\x01\"f\n\x11\x43loseIssueRequest\x12>\n\x04name\x18\x01 \x01(\tB0\xe0\x41\x02\xfa\x41*\n(securesourcemanager.googleapis.com/Issue\x12\x11\n\x04\x65tag\x18\x02 \x01(\tB\x03\xe0\x41\x01\"e\n\x10OpenIssueRequest\x12>\n\x04name\x18\x01 \x01(\tB0\xe0\x41\x02\xfa\x41*\n(securesourcemanager.googleapis.com/Issue\x12\x11\n\x04\x65tag\x18\x02 \x01(\tB\x03\xe0\x41\x01\"\xef\x01\n\tTreeEntry\x12L\n\x04type\x18\x01 \x01(\x0e\x32\x39.google.cloud.securesourcemanager.v1.TreeEntry.ObjectTypeB\x03\xe0\x41\x03\x12\x10\n\x03sha\x18\x02 \x01(\tB\x03\xe0\x41\x03\x12\x11\n\x04path\x18\x03 \x01(\tB\x03\xe0\x41\x03\x12\x11\n\x04mode\x18\x04 \x01(\tB\x03\xe0\x41\x03\x12\x11\n\x04size\x18\x05 \x01(\x03\x42\x03\xe0\x41\x03\"I\n\nObjectType\x12\x1b\n\x17OBJECT_TYPE_UNSPECIFIED\x10\x00\x12\x08\n\x04TREE\x10\x01\x12\x08\n\x04\x42LOB\x10\x02\x12\n\n\x06\x43OMMIT\x10\x03\"\xb8\x01\n\x10\x46\x65tchTreeRequest\x12I\n\nrepository\x18\x01 \x01(\tB5\xe0\x41\x02\xfa\x41/\n-securesourcemanager.googleapis.com/Repository\x12\x10\n\x03ref\x18\x02 \x01(\tB\x03\xe0\x41\x01\x12\x16\n\trecursive\x18\x03 \x01(\x08\x42\x03\xe0\x41\x01\x12\x16\n\tpage_size\x18\x04 \x01(\x05\x42\x03\xe0\x41\x01\x12\x17\n\npage_token\x18\x05 \x01(\tB\x03\xe0\x41\x01\"r\n\x11\x46\x65tchTreeResponse\x12\x44\n\x0ctree_entries\x18\x01 \x03(\x0b\x32..google.cloud.securesourcemanager.v1.TreeEntry\x12\x17\n\x0fnext_page_token\x18\x02 \x01(\t\"o\n\x10\x46\x65tchBlobRequest\x12I\n\nrepository\x18\x01 \x01(\tB5\xe0\x41\x02\xfa\x41/\n-securesourcemanager.googleapis.com/Repository\x12\x10\n\x03sha\x18\x02 \x01(\tB\x03\xe0\x41\x02\"1\n\x11\x46\x65tchBlobResponse\x12\x0b\n\x03sha\x18\x01 \x01(\t\x12\x0f\n\x07\x63ontent\x18\x02 \x01(\t\"\xa0\x01\n\x1eListPullRequestCommentsRequest\x12M\n\x06parent\x18\x01 \x01(\tB=\xe0\x41\x02\xfa\x41\x37\x12\x35securesourcemanager.googleapis.com/PullRequestComment\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\"\x92\x01\n\x1fListPullRequestCommentsResponse\x12V\n\x15pull_request_comments\x18\x01 \x03(\x0b\x32\x37.google.cloud.securesourcemanager.v1.PullRequestComment\x12\x17\n\x0fnext_page_token\x18\x02 \x01(\t\"\xcc\x01\n\x1f\x43reatePullRequestCommentRequest\x12M\n\x06parent\x18\x01 \x01(\tB=\xe0\x41\x02\xfa\x41\x37\x12\x35securesourcemanager.googleapis.com/PullRequestComment\x12Z\n\x14pull_request_comment\x18\x02 \x01(\x0b\x32\x37.google.cloud.securesourcemanager.v1.PullRequestCommentB\x03\xe0\x41\x02\"\xd3\x01\n%BatchCreatePullRequestCommentsRequest\x12M\n\x06parent\x18\x01 \x01(\tB=\xe0\x41\x02\xfa\x41\x37\x12\x35securesourcemanager.googleapis.com/PullRequestComment\x12[\n\x08requests\x18\x02 \x03(\x0b\x32\x44.google.cloud.securesourcemanager.v1.CreatePullRequestCommentRequestB\x03\xe0\x41\x02\"\x80\x01\n&BatchCreatePullRequestCommentsResponse\x12V\n\x15pull_request_comments\x18\x01 \x03(\x0b\x32\x37.google.cloud.securesourcemanager.v1.PullRequestComment\"\xb3\x01\n\x1fUpdatePullRequestCommentRequest\x12Z\n\x14pull_request_comment\x18\x01 \x01(\x0b\x32\x37.google.cloud.securesourcemanager.v1.PullRequestCommentB\x03\xe0\x41\x02\x12\x34\n\x0bupdate_mask\x18\x02 \x01(\x0b\x32\x1a.google.protobuf.FieldMaskB\x03\xe0\x41\x01\"n\n\x1f\x44\x65letePullRequestCommentRequest\x12K\n\x04name\x18\x01 \x01(\tB=\xe0\x41\x02\xfa\x41\x37\n5securesourcemanager.googleapis.com/PullRequestComment\"k\n\x1cGetPullRequestCommentRequest\x12K\n\x04name\x18\x01 \x01(\tB=\xe0\x41\x02\xfa\x41\x37\n5securesourcemanager.googleapis.com/PullRequestComment\"\xd8\x01\n!ResolvePullRequestCommentsRequest\x12M\n\x06parent\x18\x01 \x01(\tB=\xe0\x41\x02\xfa\x41\x37\x12\x35securesourcemanager.googleapis.com/PullRequestComment\x12L\n\x05names\x18\x02 \x03(\tB=\xe0\x41\x02\xfa\x41\x37\n5securesourcemanager.googleapis.com/PullRequestComment\x12\x16\n\tauto_fill\x18\x03 \x01(\x08\x42\x03\xe0\x41\x01\"|\n\"ResolvePullRequestCommentsResponse\x12V\n\x15pull_request_comments\x18\x01 \x03(\x0b\x32\x37.google.cloud.securesourcemanager.v1.PullRequestComment\"\xda\x01\n#UnresolvePullRequestCommentsRequest\x12M\n\x06parent\x18\x01 \x01(\tB=\xe0\x41\x02\xfa\x41\x37\x12\x35securesourcemanager.googleapis.com/PullRequestComment\x12L\n\x05names\x18\x02 \x03(\tB=\xe0\x41\x02\xfa\x41\x37\n5securesourcemanager.googleapis.com/PullRequestComment\x12\x16\n\tauto_fill\x18\x03 \x01(\x08\x42\x03\xe0\x41\x01\"~\n$UnresolvePullRequestCommentsResponse\x12V\n\x15pull_request_comments\x18\x01 \x03(\x0b\x32\x37.google.cloud.securesourcemanager.v1.PullRequestComment\"\xac\x01\n\x19\x43reateIssueCommentRequest\x12@\n\x06parent\x18\x01 \x01(\tB0\xe0\x41\x02\xfa\x41*\n(securesourcemanager.googleapis.com/Issue\x12M\n\rissue_comment\x18\x02 \x01(\x0b\x32\x31.google.cloud.securesourcemanager.v1.IssueCommentB\x03\xe0\x41\x02\"_\n\x16GetIssueCommentRequest\x12\x45\n\x04name\x18\x01 \x01(\tB7\xe0\x41\x02\xfa\x41\x31\n/securesourcemanager.googleapis.com/IssueComment\"\x94\x01\n\x18ListIssueCommentsRequest\x12G\n\x06parent\x18\x01 \x01(\tB7\xe0\x41\x02\xfa\x41\x31\x12/securesourcemanager.googleapis.com/IssueComment\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\"\x7f\n\x19ListIssueCommentsResponse\x12I\n\x0eissue_comments\x18\x01 \x03(\x0b\x32\x31.google.cloud.securesourcemanager.v1.IssueComment\x12\x17\n\x0fnext_page_token\x18\x02 \x01(\t\"\xa0\x01\n\x19UpdateIssueCommentRequest\x12M\n\rissue_comment\x18\x01 \x01(\x0b\x32\x31.google.cloud.securesourcemanager.v1.IssueCommentB\x03\xe0\x41\x02\x12\x34\n\x0bupdate_mask\x18\x02 \x01(\x0b\x32\x1a.google.protobuf.FieldMaskB\x03\xe0\x41\x01\"b\n\x19\x44\x65leteIssueCommentRequest\x12\x45\n\x04name\x18\x01 \x01(\tB7\xe0\x41\x02\xfa\x41\x31\n/securesourcemanager.googleapis.com/IssueComment2\xfe\x64\n\x13SecureSourceManager\x12\xc6\x01\n\rListInstances\x12\x39.google.cloud.securesourcemanager.v1.ListInstancesRequest\x1a:.google.cloud.securesourcemanager.v1.ListInstancesResponse\">\xda\x41\x06parent\x82\xd3\xe4\x93\x02/\x12-/v1/{parent=projects/*/locations/*}/instances\x12\xb3\x01\n\x0bGetInstance\x12\x37.google.cloud.securesourcemanager.v1.GetInstanceRequest\x1a-.google.cloud.securesourcemanager.v1.Instance\"<\xda\x41\x04name\x82\xd3\xe4\x93\x02/\x12-/v1/{name=projects/*/locations/*/instances/*}\x12\xea\x01\n\x0e\x43reateInstance\x12:.google.cloud.securesourcemanager.v1.CreateInstanceRequest\x1a\x1d.google.longrunning.Operation\"}\xca\x41\x1d\n\x08Instance\x12\x11OperationMetadata\xda\x41\x1bparent,instance,instance_id\x82\xd3\xe4\x93\x02\x39\"-/v1/{parent=projects/*/locations/*}/instances:\x08instance\x12\xd6\x01\n\x0e\x44\x65leteInstance\x12:.google.cloud.securesourcemanager.v1.DeleteInstanceRequest\x1a\x1d.google.longrunning.Operation\"i\xca\x41*\n\x15google.protobuf.Empty\x12\x11OperationMetadata\xda\x41\x04name\x82\xd3\xe4\x93\x02/*-/v1/{name=projects/*/locations/*/instances/*}\x12\xd2\x01\n\x10ListRepositories\x12<.google.cloud.securesourcemanager.v1.ListRepositoriesRequest\x1a=.google.cloud.securesourcemanager.v1.ListRepositoriesResponse\"A\xda\x41\x06parent\x82\xd3\xe4\x93\x02\x32\x12\x30/v1/{parent=projects/*/locations/*}/repositories\x12\xbc\x01\n\rGetRepository\x12\x39.google.cloud.securesourcemanager.v1.GetRepositoryRequest\x1a/.google.cloud.securesourcemanager.v1.Repository\"?\xda\x41\x04name\x82\xd3\xe4\x93\x02\x32\x12\x30/v1/{name=projects/*/locations/*/repositories/*}\x12\xfa\x01\n\x10\x43reateRepository\x12<.google.cloud.securesourcemanager.v1.CreateRepositoryRequest\x1a\x1d.google.longrunning.Operation\"\x88\x01\xca\x41\x1f\n\nRepository\x12\x11OperationMetadata\xda\x41\x1fparent,repository,repository_id\x82\xd3\xe4\x93\x02>\"0/v1/{parent=projects/*/locations/*}/repositories:\nrepository\x12\xfc\x01\n\x10UpdateRepository\x12<.google.cloud.securesourcemanager.v1.UpdateRepositoryRequest\x1a\x1d.google.longrunning.Operation\"\x8a\x01\xca\x41\x1f\n\nRepository\x12\x11OperationMetadata\xda\x41\x16repository,update_mask\x82\xd3\xe4\x93\x02I2;/v1/{repository.name=projects/*/locations/*/repositories/*}:\nrepository\x12\xdd\x01\n\x10\x44\x65leteRepository\x12<.google.cloud.securesourcemanager.v1.DeleteRepositoryRequest\x1a\x1d.google.longrunning.Operation\"l\xca\x41*\n\x15google.protobuf.Empty\x12\x11OperationMetadata\xda\x41\x04name\x82\xd3\xe4\x93\x02\x32*0/v1/{name=projects/*/locations/*/repositories/*}\x12\xc5\x01\n\tListHooks\x12\x35.google.cloud.securesourcemanager.v1.ListHooksRequest\x1a\x36.google.cloud.securesourcemanager.v1.ListHooksResponse\"I\xda\x41\x06parent\x82\xd3\xe4\x93\x02:\x12\x38/v1/{parent=projects/*/locations/*/repositories/*}/hooks\x12\xb2\x01\n\x07GetHook\x12\x33.google.cloud.securesourcemanager.v1.GetHookRequest\x1a).google.cloud.securesourcemanager.v1.Hook\"G\xda\x41\x04name\x82\xd3\xe4\x93\x02:\x12\x38/v1/{name=projects/*/locations/*/repositories/*/hooks/*}\x12\xdd\x01\n\nCreateHook\x12\x36.google.cloud.securesourcemanager.v1.CreateHookRequest\x1a\x1d.google.longrunning.Operation\"x\xca\x41\x19\n\x04Hook\x12\x11OperationMetadata\xda\x41\x13parent,hook,hook_id\x82\xd3\xe4\x93\x02@\"8/v1/{parent=projects/*/locations/*/repositories/*}/hooks:\x04hook\x12\xdf\x01\n\nUpdateHook\x12\x36.google.cloud.securesourcemanager.v1.UpdateHookRequest\x1a\x1d.google.longrunning.Operation\"z\xca\x41\x19\n\x04Hook\x12\x11OperationMetadata\xda\x41\x10hook,update_mask\x82\xd3\xe4\x93\x02\x45\x32=/v1/{hook.name=projects/*/locations/*/repositories/*/hooks/*}:\x04hook\x12\xd9\x01\n\nDeleteHook\x12\x36.google.cloud.securesourcemanager.v1.DeleteHookRequest\x1a\x1d.google.longrunning.Operation\"t\xca\x41*\n\x15google.protobuf.Empty\x12\x11OperationMetadata\xda\x41\x04name\x82\xd3\xe4\x93\x02:*8/v1/{name=projects/*/locations/*/repositories/*/hooks/*}\x12\xa3\x01\n\x10GetIamPolicyRepo\x12\".google.iam.v1.GetIamPolicyRequest\x1a\x15.google.iam.v1.Policy\"T\xda\x41\x08resource\x82\xd3\xe4\x93\x02\x43\x12\x41/v1/{resource=projects/*/locations/*/repositories/*}:getIamPolicy\x12\xa6\x01\n\x10SetIamPolicyRepo\x12\".google.iam.v1.SetIamPolicyRequest\x1a\x15.google.iam.v1.Policy\"W\xda\x41\x08resource\x82\xd3\xe4\x93\x02\x46\"A/v1/{resource=projects/*/locations/*/repositories/*}:setIamPolicy:\x01*\x12\xcc\x01\n\x16TestIamPermissionsRepo\x12(.google.iam.v1.TestIamPermissionsRequest\x1a).google.iam.v1.TestIamPermissionsResponse\"]\xda\x41\x08resource\x82\xd3\xe4\x93\x02L\"G/v1/{resource=projects/*/locations/*/repositories/*}:testIamPermissions:\x01*\x12\x8b\x02\n\x10\x43reateBranchRule\x12<.google.cloud.securesourcemanager.v1.CreateBranchRuleRequest\x1a\x1d.google.longrunning.Operation\"\x99\x01\xca\x41\x1f\n\nBranchRule\x12\x11OperationMetadata\xda\x41!parent,branch_rule,branch_rule_id\x82\xd3\xe4\x93\x02M\">/v1/{parent=projects/*/locations/*/repositories/*}/branchRules:\x0b\x62ranch_rule\x12\xdd\x01\n\x0fListBranchRules\x12;.google.cloud.securesourcemanager.v1.ListBranchRulesRequest\x1a<.google.cloud.securesourcemanager.v1.ListBranchRulesResponse\"O\xda\x41\x06parent\x82\xd3\xe4\x93\x02@\x12>/v1/{parent=projects/*/locations/*/repositories/*}/branchRules\x12\xca\x01\n\rGetBranchRule\x12\x39.google.cloud.securesourcemanager.v1.GetBranchRuleRequest\x1a/.google.cloud.securesourcemanager.v1.BranchRule\"M\xda\x41\x04name\x82\xd3\xe4\x93\x02@\x12>/v1/{name=projects/*/locations/*/repositories/*/branchRules/*}\x12\x8d\x02\n\x10UpdateBranchRule\x12<.google.cloud.securesourcemanager.v1.UpdateBranchRuleRequest\x1a\x1d.google.longrunning.Operation\"\x9b\x01\xca\x41\x1f\n\nBranchRule\x12\x11OperationMetadata\xda\x41\x17\x62ranch_rule,update_mask\x82\xd3\xe4\x93\x02Y2J/v1/{branch_rule.name=projects/*/locations/*/repositories/*/branchRules/*}:\x0b\x62ranch_rule\x12\xeb\x01\n\x10\x44\x65leteBranchRule\x12<.google.cloud.securesourcemanager.v1.DeleteBranchRuleRequest\x1a\x1d.google.longrunning.Operation\"z\xca\x41*\n\x15google.protobuf.Empty\x12\x11OperationMetadata\xda\x41\x04name\x82\xd3\xe4\x93\x02@*>/v1/{name=projects/*/locations/*/repositories/*/branchRules/*}\x12\xa6\x02\n\x11\x43reatePullRequest\x12=.google.cloud.securesourcemanager.v1.CreatePullRequestRequest\x1a\x1d.google.longrunning.Operation\"\xb2\x01\xca\x41\x44\n/google.cloud.securesourcemanager.v1.PullRequest\x12\x11OperationMetadata\xda\x41\x13parent,pull_request\x82\xd3\xe4\x93\x02O\"?/v1/{parent=projects/*/locations/*/repositories/*}/pullRequests:\x0cpull_request\x12\xce\x01\n\x0eGetPullRequest\x12:.google.cloud.securesourcemanager.v1.GetPullRequestRequest\x1a\x30.google.cloud.securesourcemanager.v1.PullRequest\"N\xda\x41\x04name\x82\xd3\xe4\x93\x02\x41\x12?/v1/{name=projects/*/locations/*/repositories/*/pullRequests/*}\x12\xe1\x01\n\x10ListPullRequests\x12<.google.cloud.securesourcemanager.v1.ListPullRequestsRequest\x1a=.google.cloud.securesourcemanager.v1.ListPullRequestsResponse\"P\xda\x41\x06parent\x82\xd3\xe4\x93\x02\x41\x12?/v1/{parent=projects/*/locations/*/repositories/*}/pullRequests\x12\xb8\x02\n\x11UpdatePullRequest\x12=.google.cloud.securesourcemanager.v1.UpdatePullRequestRequest\x1a\x1d.google.longrunning.Operation\"\xc4\x01\xca\x41\x44\n/google.cloud.securesourcemanager.v1.PullRequest\x12\x11OperationMetadata\xda\x41\x18pull_request,update_mask\x82\xd3\xe4\x93\x02\\2L/v1/{pull_request.name=projects/*/locations/*/repositories/*/pullRequests/*}:\x0cpull_request\x12\x90\x02\n\x10MergePullRequest\x12<.google.cloud.securesourcemanager.v1.MergePullRequestRequest\x1a\x1d.google.longrunning.Operation\"\x9e\x01\xca\x41\x44\n/google.cloud.securesourcemanager.v1.PullRequest\x12\x11OperationMetadata\xda\x41\x04name\x82\xd3\xe4\x93\x02J\"E/v1/{name=projects/*/locations/*/repositories/*/pullRequests/*}:merge:\x01*\x12\x8d\x02\n\x0fOpenPullRequest\x12;.google.cloud.securesourcemanager.v1.OpenPullRequestRequest\x1a\x1d.google.longrunning.Operation\"\x9d\x01\xca\x41\x44\n/google.cloud.securesourcemanager.v1.PullRequest\x12\x11OperationMetadata\xda\x41\x04name\x82\xd3\xe4\x93\x02I\"D/v1/{name=projects/*/locations/*/repositories/*/pullRequests/*}:open:\x01*\x12\x90\x02\n\x10\x43losePullRequest\x12<.google.cloud.securesourcemanager.v1.ClosePullRequestRequest\x1a\x1d.google.longrunning.Operation\"\x9e\x01\xca\x41\x44\n/google.cloud.securesourcemanager.v1.PullRequest\x12\x11OperationMetadata\xda\x41\x04name\x82\xd3\xe4\x93\x02J\"E/v1/{name=projects/*/locations/*/repositories/*/pullRequests/*}:close:\x01*\x12\x85\x02\n\x18ListPullRequestFileDiffs\x12\x44.google.cloud.securesourcemanager.v1.ListPullRequestFileDiffsRequest\x1a\x45.google.cloud.securesourcemanager.v1.ListPullRequestFileDiffsResponse\"\\\xda\x41\x04name\x82\xd3\xe4\x93\x02O\x12M/v1/{name=projects/*/locations/*/repositories/*/pullRequests/*}:listFileDiffs\x12\xc4\x01\n\tFetchTree\x12\x35.google.cloud.securesourcemanager.v1.FetchTreeRequest\x1a\x36.google.cloud.securesourcemanager.v1.FetchTreeResponse\"H\x82\xd3\xe4\x93\x02\x42\x12@/v1/{repository=projects/*/locations/*/repositories/*}:fetchTree\x12\xc4\x01\n\tFetchBlob\x12\x35.google.cloud.securesourcemanager.v1.FetchBlobRequest\x1a\x36.google.cloud.securesourcemanager.v1.FetchBlobResponse\"H\x82\xd3\xe4\x93\x02\x42\x12@/v1/{repository=projects/*/locations/*/repositories/*}:fetchBlob\x12\x80\x02\n\x0b\x43reateIssue\x12\x37.google.cloud.securesourcemanager.v1.CreateIssueRequest\x1a\x1d.google.longrunning.Operation\"\x98\x01\xca\x41>\n)google.cloud.securesourcemanager.v1.Issue\x12\x11OperationMetadata\xda\x41\x0cparent,issue\x82\xd3\xe4\x93\x02\x42\"9/v1/{parent=projects/*/locations/*/repositories/*}/issues:\x05issue\x12\xb6\x01\n\x08GetIssue\x12\x34.google.cloud.securesourcemanager.v1.GetIssueRequest\x1a*.google.cloud.securesourcemanager.v1.Issue\"H\xda\x41\x04name\x82\xd3\xe4\x93\x02;\x12\x39/v1/{name=projects/*/locations/*/repositories/*/issues/*}\x12\xc9\x01\n\nListIssues\x12\x36.google.cloud.securesourcemanager.v1.ListIssuesRequest\x1a\x37.google.cloud.securesourcemanager.v1.ListIssuesResponse\"J\xda\x41\x06parent\x82\xd3\xe4\x93\x02;\x12\x39/v1/{parent=projects/*/locations/*/repositories/*}/issues\x12\x8b\x02\n\x0bUpdateIssue\x12\x37.google.cloud.securesourcemanager.v1.UpdateIssueRequest\x1a\x1d.google.longrunning.Operation\"\xa3\x01\xca\x41>\n)google.cloud.securesourcemanager.v1.Issue\x12\x11OperationMetadata\xda\x41\x11issue,update_mask\x82\xd3\xe4\x93\x02H2?/v1/{issue.name=projects/*/locations/*/repositories/*/issues/*}:\x05issue\x12\xdc\x01\n\x0b\x44\x65leteIssue\x12\x37.google.cloud.securesourcemanager.v1.DeleteIssueRequest\x1a\x1d.google.longrunning.Operation\"u\xca\x41*\n\x15google.protobuf.Empty\x12\x11OperationMetadata\xda\x41\x04name\x82\xd3\xe4\x93\x02;*9/v1/{name=projects/*/locations/*/repositories/*/issues/*}\x12\xf5\x01\n\tOpenIssue\x12\x35.google.cloud.securesourcemanager.v1.OpenIssueRequest\x1a\x1d.google.longrunning.Operation\"\x91\x01\xca\x41>\n)google.cloud.securesourcemanager.v1.Issue\x12\x11OperationMetadata\xda\x41\x04name\x82\xd3\xe4\x93\x02\x43\">/v1/{name=projects/*/locations/*/repositories/*/issues/*}:open:\x01*\x12\xf8\x01\n\nCloseIssue\x12\x36.google.cloud.securesourcemanager.v1.CloseIssueRequest\x1a\x1d.google.longrunning.Operation\"\x92\x01\xca\x41>\n)google.cloud.securesourcemanager.v1.Issue\x12\x11OperationMetadata\xda\x41\x04name\x82\xd3\xe4\x93\x02\x44\"?/v1/{name=projects/*/locations/*/repositories/*/issues/*}:close:\x01*\x12\xf9\x01\n\x15GetPullRequestComment\x12\x41.google.cloud.securesourcemanager.v1.GetPullRequestCommentRequest\x1a\x37.google.cloud.securesourcemanager.v1.PullRequestComment\"d\xda\x41\x04name\x82\xd3\xe4\x93\x02W\x12U/v1/{name=projects/*/locations/*/repositories/*/pullRequests/*/pullRequestComments/*}\x12\x8c\x02\n\x17ListPullRequestComments\x12\x43.google.cloud.securesourcemanager.v1.ListPullRequestCommentsRequest\x1a\x44.google.cloud.securesourcemanager.v1.ListPullRequestCommentsResponse\"f\xda\x41\x06parent\x82\xd3\xe4\x93\x02W\x12U/v1/{parent=projects/*/locations/*/repositories/*/pullRequests/*}/pullRequestComments\x12\xe1\x02\n\x18\x43reatePullRequestComment\x12\x44.google.cloud.securesourcemanager.v1.CreatePullRequestCommentRequest\x1a\x1d.google.longrunning.Operation\"\xdf\x01\xca\x41K\n6google.cloud.securesourcemanager.v1.PullRequestComment\x12\x11OperationMetadata\xda\x41\x1bparent,pull_request_comment\x82\xd3\xe4\x93\x02m\"U/v1/{parent=projects/*/locations/*/repositories/*/pullRequests/*}/pullRequestComments:\x14pull_request_comment\x12\xfc\x02\n\x18UpdatePullRequestComment\x12\x44.google.cloud.securesourcemanager.v1.UpdatePullRequestCommentRequest\x1a\x1d.google.longrunning.Operation\"\xfa\x01\xca\x41K\n6google.cloud.securesourcemanager.v1.PullRequestComment\x12\x11OperationMetadata\xda\x41 pull_request_comment,update_mask\x82\xd3\xe4\x93\x02\x82\x01\x32j/v1/{pull_request_comment.name=projects/*/locations/*/repositories/*/pullRequests/*/pullRequestComments/*}:\x14pull_request_comment\x12\x93\x02\n\x18\x44\x65letePullRequestComment\x12\x44.google.cloud.securesourcemanager.v1.DeletePullRequestCommentRequest\x1a\x1d.google.longrunning.Operation\"\x91\x01\xca\x41*\n\x15google.protobuf.Empty\x12\x11OperationMetadata\xda\x41\x04name\x82\xd3\xe4\x93\x02W*U/v1/{name=projects/*/locations/*/repositories/*/pullRequests/*/pullRequestComments/*}\x12\xca\x02\n\x1e\x42\x61tchCreatePullRequestComments\x12J.google.cloud.securesourcemanager.v1.BatchCreatePullRequestCommentsRequest\x1a\x1d.google.longrunning.Operation\"\xbc\x01\xca\x41;\n&BatchCreatePullRequestCommentsResponse\x12\x11OperationMetadata\xda\x41\x0fparent,requests\x82\xd3\xe4\x93\x02\x66\"a/v1/{parent=projects/*/locations/*/repositories/*/pullRequests/*}/pullRequestComments:batchCreate:\x01*\x12\xb7\x02\n\x1aResolvePullRequestComments\x12\x46.google.cloud.securesourcemanager.v1.ResolvePullRequestCommentsRequest\x1a\x1d.google.longrunning.Operation\"\xb1\x01\xca\x41\x37\n\"ResolvePullRequestCommentsResponse\x12\x11OperationMetadata\xda\x41\x0cparent,names\x82\xd3\xe4\x93\x02\x62\"]/v1/{parent=projects/*/locations/*/repositories/*/pullRequests/*}/pullRequestComments:resolve:\x01*\x12\xbf\x02\n\x1cUnresolvePullRequestComments\x12H.google.cloud.securesourcemanager.v1.UnresolvePullRequestCommentsRequest\x1a\x1d.google.longrunning.Operation\"\xb5\x01\xca\x41\x39\n$UnresolvePullRequestCommentsResponse\x12\x11OperationMetadata\xda\x41\x0cparent,names\x82\xd3\xe4\x93\x02\x64\"_/v1/{parent=projects/*/locations/*/repositories/*/pullRequests/*}/pullRequestComments:unresolve:\x01*\x12\xb5\x02\n\x12\x43reateIssueComment\x12>.google.cloud.securesourcemanager.v1.CreateIssueCommentRequest\x1a\x1d.google.longrunning.Operation\"\xbf\x01\xca\x41\x45\n0google.cloud.securesourcemanager.v1.IssueComment\x12\x11OperationMetadata\xda\x41\x14parent,issue_comment\x82\xd3\xe4\x93\x02Z\"I/v1/{parent=projects/*/locations/*/repositories/*/issues/*}/issueComments:\rissue_comment\x12\xdb\x01\n\x0fGetIssueComment\x12;.google.cloud.securesourcemanager.v1.GetIssueCommentRequest\x1a\x31.google.cloud.securesourcemanager.v1.IssueComment\"X\xda\x41\x04name\x82\xd3\xe4\x93\x02K\x12I/v1/{name=projects/*/locations/*/repositories/*/issues/*/issueComments/*}\x12\xee\x01\n\x11ListIssueComments\x12=.google.cloud.securesourcemanager.v1.ListIssueCommentsRequest\x1a>.google.cloud.securesourcemanager.v1.ListIssueCommentsResponse\"Z\xda\x41\x06parent\x82\xd3\xe4\x93\x02K\x12I/v1/{parent=projects/*/locations/*/repositories/*/issues/*}/issueComments\x12\xc8\x02\n\x12UpdateIssueComment\x12>.google.cloud.securesourcemanager.v1.UpdateIssueCommentRequest\x1a\x1d.google.longrunning.Operation\"\xd2\x01\xca\x41\x45\n0google.cloud.securesourcemanager.v1.IssueComment\x12\x11OperationMetadata\xda\x41\x19issue_comment,update_mask\x82\xd3\xe4\x93\x02h2W/v1/{issue_comment.name=projects/*/locations/*/repositories/*/issues/*/issueComments/*}:\rissue_comment\x12\xfb\x01\n\x12\x44\x65leteIssueComment\x12>.google.cloud.securesourcemanager.v1.DeleteIssueCommentRequest\x1a\x1d.google.longrunning.Operation\"\x85\x01\xca\x41*\n\x15google.protobuf.Empty\x12\x11OperationMetadata\xda\x41\x04name\x82\xd3\xe4\x93\x02K*I/v1/{name=projects/*/locations/*/repositories/*/issues/*/issueComments/*}\x1aV\xca\x41\"securesourcemanager.googleapis.com\xd2\x41.https://www.googleapis.com/auth/cloud-platformB\xe9\x04\n\'com.google.cloud.securesourcemanager.v1B\x18SecureSourceManagerProtoP\x01ZYcloud.google.com/go/securesourcemanager/apiv1/securesourcemanagerpb;securesourcemanagerpb\xaa\x02#Google.Cloud.SecureSourceManager.V1\xca\x02#Google\\Cloud\\SecureSourceManager\\V1\xea\x02&Google::Cloud::SecureSourceManager::V1\xea\x41x\n!cloudkms.googleapis.com/CryptoKey\x12Sprojects/{project}/locations/{location}/keyRings/{key_ring}/cryptoKeys/{crypto_key}\xea\x41\\\n\x1fprivateca.googleapis.com/CaPool\x12\x39projects/{project}/locations/{location}/caPools/{ca_pool}\xea\x41w\n(compute.googleapis.com/ServiceAttachment\x12Kprojects/{project}/regions/{region}/serviceAttachments/{service_attachment}b\x06proto3" + +pool = ::Google::Protobuf::DescriptorPool.generated_pool +pool.add_serialized_file(descriptor_data) + +module Google + module Cloud + module SecureSourceManager + module V1 + Instance = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.securesourcemanager.v1.Instance").msgclass + Instance::HostConfig = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.securesourcemanager.v1.Instance.HostConfig").msgclass + Instance::PrivateConfig = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.securesourcemanager.v1.Instance.PrivateConfig").msgclass + Instance::WorkforceIdentityFederationConfig = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.securesourcemanager.v1.Instance.WorkforceIdentityFederationConfig").msgclass + Instance::State = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.securesourcemanager.v1.Instance.State").enummodule + Instance::StateNote = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.securesourcemanager.v1.Instance.StateNote").enummodule + Repository = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.securesourcemanager.v1.Repository").msgclass + Repository::URIs = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.securesourcemanager.v1.Repository.URIs").msgclass + Repository::InitialConfig = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.securesourcemanager.v1.Repository.InitialConfig").msgclass + Hook = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.securesourcemanager.v1.Hook").msgclass + Hook::PushOption = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.securesourcemanager.v1.Hook.PushOption").msgclass + Hook::HookEventType = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.securesourcemanager.v1.Hook.HookEventType").enummodule + BranchRule = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.securesourcemanager.v1.BranchRule").msgclass + BranchRule::Check = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.securesourcemanager.v1.BranchRule.Check").msgclass + PullRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.securesourcemanager.v1.PullRequest").msgclass + PullRequest::Branch = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.securesourcemanager.v1.PullRequest.Branch").msgclass + PullRequest::State = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.securesourcemanager.v1.PullRequest.State").enummodule + FileDiff = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.securesourcemanager.v1.FileDiff").msgclass + FileDiff::Action = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.securesourcemanager.v1.FileDiff.Action").enummodule + Issue = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.securesourcemanager.v1.Issue").msgclass + Issue::State = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.securesourcemanager.v1.Issue.State").enummodule + IssueComment = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.securesourcemanager.v1.IssueComment").msgclass + PullRequestComment = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.securesourcemanager.v1.PullRequestComment").msgclass + PullRequestComment::Review = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.securesourcemanager.v1.PullRequestComment.Review").msgclass + PullRequestComment::Review::ActionType = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.securesourcemanager.v1.PullRequestComment.Review.ActionType").enummodule + PullRequestComment::Comment = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.securesourcemanager.v1.PullRequestComment.Comment").msgclass + PullRequestComment::Code = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.securesourcemanager.v1.PullRequestComment.Code").msgclass + PullRequestComment::Position = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.securesourcemanager.v1.PullRequestComment.Position").msgclass + ListInstancesRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.securesourcemanager.v1.ListInstancesRequest").msgclass + ListInstancesResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.securesourcemanager.v1.ListInstancesResponse").msgclass + GetInstanceRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.securesourcemanager.v1.GetInstanceRequest").msgclass + CreateInstanceRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.securesourcemanager.v1.CreateInstanceRequest").msgclass + DeleteInstanceRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.securesourcemanager.v1.DeleteInstanceRequest").msgclass + OperationMetadata = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.securesourcemanager.v1.OperationMetadata").msgclass + ListRepositoriesRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.securesourcemanager.v1.ListRepositoriesRequest").msgclass + ListRepositoriesResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.securesourcemanager.v1.ListRepositoriesResponse").msgclass + GetRepositoryRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.securesourcemanager.v1.GetRepositoryRequest").msgclass + CreateRepositoryRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.securesourcemanager.v1.CreateRepositoryRequest").msgclass + UpdateRepositoryRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.securesourcemanager.v1.UpdateRepositoryRequest").msgclass + DeleteRepositoryRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.securesourcemanager.v1.DeleteRepositoryRequest").msgclass + ListHooksRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.securesourcemanager.v1.ListHooksRequest").msgclass + ListHooksResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.securesourcemanager.v1.ListHooksResponse").msgclass + GetHookRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.securesourcemanager.v1.GetHookRequest").msgclass + CreateHookRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.securesourcemanager.v1.CreateHookRequest").msgclass + UpdateHookRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.securesourcemanager.v1.UpdateHookRequest").msgclass + DeleteHookRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.securesourcemanager.v1.DeleteHookRequest").msgclass + GetBranchRuleRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.securesourcemanager.v1.GetBranchRuleRequest").msgclass + CreateBranchRuleRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.securesourcemanager.v1.CreateBranchRuleRequest").msgclass + ListBranchRulesRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.securesourcemanager.v1.ListBranchRulesRequest").msgclass + DeleteBranchRuleRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.securesourcemanager.v1.DeleteBranchRuleRequest").msgclass + UpdateBranchRuleRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.securesourcemanager.v1.UpdateBranchRuleRequest").msgclass + ListBranchRulesResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.securesourcemanager.v1.ListBranchRulesResponse").msgclass + CreatePullRequestRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.securesourcemanager.v1.CreatePullRequestRequest").msgclass + GetPullRequestRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.securesourcemanager.v1.GetPullRequestRequest").msgclass + ListPullRequestsRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.securesourcemanager.v1.ListPullRequestsRequest").msgclass + ListPullRequestsResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.securesourcemanager.v1.ListPullRequestsResponse").msgclass + UpdatePullRequestRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.securesourcemanager.v1.UpdatePullRequestRequest").msgclass + MergePullRequestRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.securesourcemanager.v1.MergePullRequestRequest").msgclass + OpenPullRequestRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.securesourcemanager.v1.OpenPullRequestRequest").msgclass + ClosePullRequestRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.securesourcemanager.v1.ClosePullRequestRequest").msgclass + ListPullRequestFileDiffsRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.securesourcemanager.v1.ListPullRequestFileDiffsRequest").msgclass + ListPullRequestFileDiffsResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.securesourcemanager.v1.ListPullRequestFileDiffsResponse").msgclass + CreateIssueRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.securesourcemanager.v1.CreateIssueRequest").msgclass + GetIssueRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.securesourcemanager.v1.GetIssueRequest").msgclass + ListIssuesRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.securesourcemanager.v1.ListIssuesRequest").msgclass + ListIssuesResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.securesourcemanager.v1.ListIssuesResponse").msgclass + UpdateIssueRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.securesourcemanager.v1.UpdateIssueRequest").msgclass + DeleteIssueRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.securesourcemanager.v1.DeleteIssueRequest").msgclass + CloseIssueRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.securesourcemanager.v1.CloseIssueRequest").msgclass + OpenIssueRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.securesourcemanager.v1.OpenIssueRequest").msgclass + TreeEntry = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.securesourcemanager.v1.TreeEntry").msgclass + TreeEntry::ObjectType = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.securesourcemanager.v1.TreeEntry.ObjectType").enummodule + FetchTreeRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.securesourcemanager.v1.FetchTreeRequest").msgclass + FetchTreeResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.securesourcemanager.v1.FetchTreeResponse").msgclass + FetchBlobRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.securesourcemanager.v1.FetchBlobRequest").msgclass + FetchBlobResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.securesourcemanager.v1.FetchBlobResponse").msgclass + ListPullRequestCommentsRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.securesourcemanager.v1.ListPullRequestCommentsRequest").msgclass + ListPullRequestCommentsResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.securesourcemanager.v1.ListPullRequestCommentsResponse").msgclass + CreatePullRequestCommentRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.securesourcemanager.v1.CreatePullRequestCommentRequest").msgclass + BatchCreatePullRequestCommentsRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.securesourcemanager.v1.BatchCreatePullRequestCommentsRequest").msgclass + BatchCreatePullRequestCommentsResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.securesourcemanager.v1.BatchCreatePullRequestCommentsResponse").msgclass + UpdatePullRequestCommentRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.securesourcemanager.v1.UpdatePullRequestCommentRequest").msgclass + DeletePullRequestCommentRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.securesourcemanager.v1.DeletePullRequestCommentRequest").msgclass + GetPullRequestCommentRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.securesourcemanager.v1.GetPullRequestCommentRequest").msgclass + ResolvePullRequestCommentsRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.securesourcemanager.v1.ResolvePullRequestCommentsRequest").msgclass + ResolvePullRequestCommentsResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.securesourcemanager.v1.ResolvePullRequestCommentsResponse").msgclass + UnresolvePullRequestCommentsRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.securesourcemanager.v1.UnresolvePullRequestCommentsRequest").msgclass + UnresolvePullRequestCommentsResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.securesourcemanager.v1.UnresolvePullRequestCommentsResponse").msgclass + CreateIssueCommentRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.securesourcemanager.v1.CreateIssueCommentRequest").msgclass + GetIssueCommentRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.securesourcemanager.v1.GetIssueCommentRequest").msgclass + ListIssueCommentsRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.securesourcemanager.v1.ListIssueCommentsRequest").msgclass + ListIssueCommentsResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.securesourcemanager.v1.ListIssueCommentsResponse").msgclass + UpdateIssueCommentRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.securesourcemanager.v1.UpdateIssueCommentRequest").msgclass + DeleteIssueCommentRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.securesourcemanager.v1.DeleteIssueCommentRequest").msgclass + end + end + end +end diff --git a/owl-bot-staging/google-cloud-secure_source_manager-v1/lib/google/cloud/securesourcemanager/v1/secure_source_manager_services_pb.rb b/owl-bot-staging/google-cloud-secure_source_manager-v1/lib/google/cloud/securesourcemanager/v1/secure_source_manager_services_pb.rb new file mode 100644 index 000000000000..53c79d77f2f6 --- /dev/null +++ b/owl-bot-staging/google-cloud-secure_source_manager-v1/lib/google/cloud/securesourcemanager/v1/secure_source_manager_services_pb.rb @@ -0,0 +1,170 @@ +# Generated by the protocol buffer compiler. DO NOT EDIT! +# Source: google/cloud/securesourcemanager/v1/secure_source_manager.proto for package 'Google.Cloud.SecureSourceManager.V1' +# Original file comments: +# 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 +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# + +require 'grpc' +require 'google/cloud/securesourcemanager/v1/secure_source_manager_pb' + +module Google + module Cloud + module SecureSourceManager + module V1 + module SecureSourceManager + # Secure Source Manager API + # + # Access Secure Source Manager instances, resources, and repositories. + class Service + + include ::GRPC::GenericService + + self.marshal_class_method = :encode + self.unmarshal_class_method = :decode + self.service_name = 'google.cloud.securesourcemanager.v1.SecureSourceManager' + + # Lists Instances in a given project and location. + rpc :ListInstances, ::Google::Cloud::SecureSourceManager::V1::ListInstancesRequest, ::Google::Cloud::SecureSourceManager::V1::ListInstancesResponse + # Gets details of a single instance. + rpc :GetInstance, ::Google::Cloud::SecureSourceManager::V1::GetInstanceRequest, ::Google::Cloud::SecureSourceManager::V1::Instance + # Creates a new instance in a given project and location. + rpc :CreateInstance, ::Google::Cloud::SecureSourceManager::V1::CreateInstanceRequest, ::Google::Longrunning::Operation + # Deletes a single instance. + rpc :DeleteInstance, ::Google::Cloud::SecureSourceManager::V1::DeleteInstanceRequest, ::Google::Longrunning::Operation + # Lists Repositories in a given project and location. + # + # The instance field is required in the query parameter for requests using + # the securesourcemanager.googleapis.com endpoint. + rpc :ListRepositories, ::Google::Cloud::SecureSourceManager::V1::ListRepositoriesRequest, ::Google::Cloud::SecureSourceManager::V1::ListRepositoriesResponse + # Gets metadata of a repository. + rpc :GetRepository, ::Google::Cloud::SecureSourceManager::V1::GetRepositoryRequest, ::Google::Cloud::SecureSourceManager::V1::Repository + # Creates a new repository in a given project and location. + # + # The Repository.Instance field is required in the request body for requests + # using the securesourcemanager.googleapis.com endpoint. + rpc :CreateRepository, ::Google::Cloud::SecureSourceManager::V1::CreateRepositoryRequest, ::Google::Longrunning::Operation + # Updates the metadata of a repository. + rpc :UpdateRepository, ::Google::Cloud::SecureSourceManager::V1::UpdateRepositoryRequest, ::Google::Longrunning::Operation + # Deletes a Repository. + rpc :DeleteRepository, ::Google::Cloud::SecureSourceManager::V1::DeleteRepositoryRequest, ::Google::Longrunning::Operation + # Lists hooks in a given repository. + rpc :ListHooks, ::Google::Cloud::SecureSourceManager::V1::ListHooksRequest, ::Google::Cloud::SecureSourceManager::V1::ListHooksResponse + # Gets metadata of a hook. + rpc :GetHook, ::Google::Cloud::SecureSourceManager::V1::GetHookRequest, ::Google::Cloud::SecureSourceManager::V1::Hook + # Creates a new hook in a given repository. + rpc :CreateHook, ::Google::Cloud::SecureSourceManager::V1::CreateHookRequest, ::Google::Longrunning::Operation + # Updates the metadata of a hook. + rpc :UpdateHook, ::Google::Cloud::SecureSourceManager::V1::UpdateHookRequest, ::Google::Longrunning::Operation + # Deletes a Hook. + rpc :DeleteHook, ::Google::Cloud::SecureSourceManager::V1::DeleteHookRequest, ::Google::Longrunning::Operation + # Get IAM policy for a repository. + rpc :GetIamPolicyRepo, ::Google::Iam::V1::GetIamPolicyRequest, ::Google::Iam::V1::Policy + # Set IAM policy on a repository. + rpc :SetIamPolicyRepo, ::Google::Iam::V1::SetIamPolicyRequest, ::Google::Iam::V1::Policy + # Test IAM permissions on a repository. + # IAM permission checks are not required on this method. + rpc :TestIamPermissionsRepo, ::Google::Iam::V1::TestIamPermissionsRequest, ::Google::Iam::V1::TestIamPermissionsResponse + # CreateBranchRule creates a branch rule in a given repository. + rpc :CreateBranchRule, ::Google::Cloud::SecureSourceManager::V1::CreateBranchRuleRequest, ::Google::Longrunning::Operation + # ListBranchRules lists branch rules in a given repository. + rpc :ListBranchRules, ::Google::Cloud::SecureSourceManager::V1::ListBranchRulesRequest, ::Google::Cloud::SecureSourceManager::V1::ListBranchRulesResponse + # GetBranchRule gets a branch rule. + rpc :GetBranchRule, ::Google::Cloud::SecureSourceManager::V1::GetBranchRuleRequest, ::Google::Cloud::SecureSourceManager::V1::BranchRule + # UpdateBranchRule updates a branch rule. + rpc :UpdateBranchRule, ::Google::Cloud::SecureSourceManager::V1::UpdateBranchRuleRequest, ::Google::Longrunning::Operation + # DeleteBranchRule deletes a branch rule. + rpc :DeleteBranchRule, ::Google::Cloud::SecureSourceManager::V1::DeleteBranchRuleRequest, ::Google::Longrunning::Operation + # Creates a pull request. + rpc :CreatePullRequest, ::Google::Cloud::SecureSourceManager::V1::CreatePullRequestRequest, ::Google::Longrunning::Operation + # Gets a pull request. + rpc :GetPullRequest, ::Google::Cloud::SecureSourceManager::V1::GetPullRequestRequest, ::Google::Cloud::SecureSourceManager::V1::PullRequest + # Lists pull requests in a repository. + rpc :ListPullRequests, ::Google::Cloud::SecureSourceManager::V1::ListPullRequestsRequest, ::Google::Cloud::SecureSourceManager::V1::ListPullRequestsResponse + # Updates a pull request. + rpc :UpdatePullRequest, ::Google::Cloud::SecureSourceManager::V1::UpdatePullRequestRequest, ::Google::Longrunning::Operation + # Merges a pull request. + rpc :MergePullRequest, ::Google::Cloud::SecureSourceManager::V1::MergePullRequestRequest, ::Google::Longrunning::Operation + # Opens a pull request. + rpc :OpenPullRequest, ::Google::Cloud::SecureSourceManager::V1::OpenPullRequestRequest, ::Google::Longrunning::Operation + # Closes a pull request without merging. + rpc :ClosePullRequest, ::Google::Cloud::SecureSourceManager::V1::ClosePullRequestRequest, ::Google::Longrunning::Operation + # Lists a pull request's file diffs. + rpc :ListPullRequestFileDiffs, ::Google::Cloud::SecureSourceManager::V1::ListPullRequestFileDiffsRequest, ::Google::Cloud::SecureSourceManager::V1::ListPullRequestFileDiffsResponse + # Fetches a tree from a repository. + rpc :FetchTree, ::Google::Cloud::SecureSourceManager::V1::FetchTreeRequest, ::Google::Cloud::SecureSourceManager::V1::FetchTreeResponse + # Fetches a blob from a repository. + rpc :FetchBlob, ::Google::Cloud::SecureSourceManager::V1::FetchBlobRequest, ::Google::Cloud::SecureSourceManager::V1::FetchBlobResponse + # Creates an issue. + rpc :CreateIssue, ::Google::Cloud::SecureSourceManager::V1::CreateIssueRequest, ::Google::Longrunning::Operation + # Gets an issue. + rpc :GetIssue, ::Google::Cloud::SecureSourceManager::V1::GetIssueRequest, ::Google::Cloud::SecureSourceManager::V1::Issue + # Lists issues in a repository. + rpc :ListIssues, ::Google::Cloud::SecureSourceManager::V1::ListIssuesRequest, ::Google::Cloud::SecureSourceManager::V1::ListIssuesResponse + # Updates a issue. + rpc :UpdateIssue, ::Google::Cloud::SecureSourceManager::V1::UpdateIssueRequest, ::Google::Longrunning::Operation + # Deletes an issue. + rpc :DeleteIssue, ::Google::Cloud::SecureSourceManager::V1::DeleteIssueRequest, ::Google::Longrunning::Operation + # Opens an issue. + rpc :OpenIssue, ::Google::Cloud::SecureSourceManager::V1::OpenIssueRequest, ::Google::Longrunning::Operation + # Closes an issue. + rpc :CloseIssue, ::Google::Cloud::SecureSourceManager::V1::CloseIssueRequest, ::Google::Longrunning::Operation + # Gets a pull request comment. + rpc :GetPullRequestComment, ::Google::Cloud::SecureSourceManager::V1::GetPullRequestCommentRequest, ::Google::Cloud::SecureSourceManager::V1::PullRequestComment + # Lists pull request comments. + rpc :ListPullRequestComments, ::Google::Cloud::SecureSourceManager::V1::ListPullRequestCommentsRequest, ::Google::Cloud::SecureSourceManager::V1::ListPullRequestCommentsResponse + # Creates a pull request comment. This function is used to create a single + # PullRequestComment of type Comment, or a single PullRequestComment of type + # Code that's replying to another PullRequestComment of type Code. Use + # BatchCreatePullRequestComments to create multiple PullRequestComments for + # code reviews. + rpc :CreatePullRequestComment, ::Google::Cloud::SecureSourceManager::V1::CreatePullRequestCommentRequest, ::Google::Longrunning::Operation + # Updates a pull request comment. + rpc :UpdatePullRequestComment, ::Google::Cloud::SecureSourceManager::V1::UpdatePullRequestCommentRequest, ::Google::Longrunning::Operation + # Deletes a pull request comment. + rpc :DeletePullRequestComment, ::Google::Cloud::SecureSourceManager::V1::DeletePullRequestCommentRequest, ::Google::Longrunning::Operation + # Batch creates pull request comments. This function is used to create + # multiple PullRequestComments for code review. There needs to be exactly one + # PullRequestComment of type Review, and at most 100 PullRequestComments of + # type Code per request. The Postition of the code comments must be unique + # within the request. + rpc :BatchCreatePullRequestComments, ::Google::Cloud::SecureSourceManager::V1::BatchCreatePullRequestCommentsRequest, ::Google::Longrunning::Operation + # Resolves pull request comments. A list of PullRequestComment names must be + # provided. The PullRequestComment names must be in the same conversation + # thread. If auto_fill is set, all comments in the conversation thread will + # be resolved. + rpc :ResolvePullRequestComments, ::Google::Cloud::SecureSourceManager::V1::ResolvePullRequestCommentsRequest, ::Google::Longrunning::Operation + # Unresolves pull request comments. A list of PullRequestComment names must + # be provided. The PullRequestComment names must be in the same conversation + # thread. If auto_fill is set, all comments in the conversation thread will + # be unresolved. + rpc :UnresolvePullRequestComments, ::Google::Cloud::SecureSourceManager::V1::UnresolvePullRequestCommentsRequest, ::Google::Longrunning::Operation + # Creates an issue comment. + rpc :CreateIssueComment, ::Google::Cloud::SecureSourceManager::V1::CreateIssueCommentRequest, ::Google::Longrunning::Operation + # Gets an issue comment. + rpc :GetIssueComment, ::Google::Cloud::SecureSourceManager::V1::GetIssueCommentRequest, ::Google::Cloud::SecureSourceManager::V1::IssueComment + # Lists comments in an issue. + rpc :ListIssueComments, ::Google::Cloud::SecureSourceManager::V1::ListIssueCommentsRequest, ::Google::Cloud::SecureSourceManager::V1::ListIssueCommentsResponse + # Updates an issue comment. + rpc :UpdateIssueComment, ::Google::Cloud::SecureSourceManager::V1::UpdateIssueCommentRequest, ::Google::Longrunning::Operation + # Deletes an issue comment. + rpc :DeleteIssueComment, ::Google::Cloud::SecureSourceManager::V1::DeleteIssueCommentRequest, ::Google::Longrunning::Operation + end + + Stub = Service.rpc_stub_class + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-secure_source_manager-v1/proto_docs/README.md b/owl-bot-staging/google-cloud-secure_source_manager-v1/proto_docs/README.md new file mode 100644 index 000000000000..993b0230a7dc --- /dev/null +++ b/owl-bot-staging/google-cloud-secure_source_manager-v1/proto_docs/README.md @@ -0,0 +1,4 @@ +# Secure Source Manager V1 Protocol Buffer Documentation + +These files are for the YARD documentation of the generated protobuf files. +They are not intended to be required or loaded at runtime. diff --git a/owl-bot-staging/google-cloud-secure_source_manager-v1/proto_docs/google/api/client.rb b/owl-bot-staging/google-cloud-secure_source_manager-v1/proto_docs/google/api/client.rb new file mode 100644 index 000000000000..5089551e9ea4 --- /dev/null +++ b/owl-bot-staging/google-cloud-secure_source_manager-v1/proto_docs/google/api/client.rb @@ -0,0 +1,589 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + + +module Google + module Api + # Required information for every language. + # @!attribute [rw] reference_docs_uri + # @deprecated This field is deprecated and may be removed in the next major version update. + # @return [::String] + # Link to automatically generated reference documentation. Example: + # https://cloud.google.com/nodejs/docs/reference/asset/latest + # @!attribute [rw] destinations + # @return [::Array<::Google::Api::ClientLibraryDestination>] + # The destination where API teams want this client library to be published. + # @!attribute [rw] selective_gapic_generation + # @return [::Google::Api::SelectiveGapicGeneration] + # Configuration for which RPCs should be generated in the GAPIC client. + class CommonLanguageSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Details about how and where to publish client libraries. + # @!attribute [rw] version + # @return [::String] + # Version of the API to apply these settings to. This is the full protobuf + # package for the API, ending in the version element. + # Examples: "google.cloud.speech.v1" and "google.spanner.admin.database.v1". + # @!attribute [rw] launch_stage + # @return [::Google::Api::LaunchStage] + # Launch stage of this version of the API. + # @!attribute [rw] rest_numeric_enums + # @return [::Boolean] + # When using transport=rest, the client request will encode enums as + # numbers rather than strings. + # @!attribute [rw] java_settings + # @return [::Google::Api::JavaSettings] + # Settings for legacy Java features, supported in the Service YAML. + # @!attribute [rw] cpp_settings + # @return [::Google::Api::CppSettings] + # Settings for C++ client libraries. + # @!attribute [rw] php_settings + # @return [::Google::Api::PhpSettings] + # Settings for PHP client libraries. + # @!attribute [rw] python_settings + # @return [::Google::Api::PythonSettings] + # Settings for Python client libraries. + # @!attribute [rw] node_settings + # @return [::Google::Api::NodeSettings] + # Settings for Node client libraries. + # @!attribute [rw] dotnet_settings + # @return [::Google::Api::DotnetSettings] + # Settings for .NET client libraries. + # @!attribute [rw] ruby_settings + # @return [::Google::Api::RubySettings] + # Settings for Ruby client libraries. + # @!attribute [rw] go_settings + # @return [::Google::Api::GoSettings] + # Settings for Go client libraries. + class ClientLibrarySettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # This message configures the settings for publishing [Google Cloud Client + # libraries](https://cloud.google.com/apis/docs/cloud-client-libraries) + # generated from the service config. + # @!attribute [rw] method_settings + # @return [::Array<::Google::Api::MethodSettings>] + # A list of API method settings, e.g. the behavior for methods that use the + # long-running operation pattern. + # @!attribute [rw] new_issue_uri + # @return [::String] + # Link to a *public* URI where users can report issues. Example: + # https://issuetracker.google.com/issues/new?component=190865&template=1161103 + # @!attribute [rw] documentation_uri + # @return [::String] + # Link to product home page. Example: + # https://cloud.google.com/asset-inventory/docs/overview + # @!attribute [rw] api_short_name + # @return [::String] + # Used as a tracking tag when collecting data about the APIs developer + # relations artifacts like docs, packages delivered to package managers, + # etc. Example: "speech". + # @!attribute [rw] github_label + # @return [::String] + # GitHub label to apply to issues and pull requests opened for this API. + # @!attribute [rw] codeowner_github_teams + # @return [::Array<::String>] + # GitHub teams to be added to CODEOWNERS in the directory in GitHub + # containing source code for the client libraries for this API. + # @!attribute [rw] doc_tag_prefix + # @return [::String] + # A prefix used in sample code when demarking regions to be included in + # documentation. + # @!attribute [rw] organization + # @return [::Google::Api::ClientLibraryOrganization] + # For whom the client library is being published. + # @!attribute [rw] library_settings + # @return [::Array<::Google::Api::ClientLibrarySettings>] + # Client library settings. If the same version string appears multiple + # times in this list, then the last one wins. Settings from earlier + # settings with the same version string are discarded. + # @!attribute [rw] proto_reference_documentation_uri + # @return [::String] + # Optional link to proto reference documentation. Example: + # https://cloud.google.com/pubsub/lite/docs/reference/rpc + # @!attribute [rw] rest_reference_documentation_uri + # @return [::String] + # Optional link to REST reference documentation. Example: + # https://cloud.google.com/pubsub/lite/docs/reference/rest + class Publishing + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Settings for Java client libraries. + # @!attribute [rw] library_package + # @return [::String] + # The package name to use in Java. Clobbers the java_package option + # set in the protobuf. This should be used **only** by APIs + # who have already set the language_settings.java.package_name" field + # in gapic.yaml. API teams should use the protobuf java_package option + # where possible. + # + # Example of a YAML configuration:: + # + # publishing: + # 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. + # @!attribute [rw] methods + # @return [::Array<::String>] + # An allowlist of the fully qualified names of RPCs that should be included + # on public client surfaces. + # @!attribute [rw] generate_omitted_as_internal + # @return [::Boolean] + # Setting this to true indicates to the client generators that methods + # that would be excluded from the generation should instead be generated + # in a way that indicates these methods should not be consumed by + # end users. How this is expressed is up to individual language + # implementations to decide. Some examples may be: added annotations, + # obfuscated identifiers, or other language idiomatic patterns. + class SelectiveGapicGeneration + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # `BatchingConfigProto` defines the batching configuration for an API method. + # @!attribute [rw] thresholds + # @return [::Google::Api::BatchingSettingsProto] + # The thresholds which trigger a batched request to be sent. + # @!attribute [rw] batch_descriptor + # @return [::Google::Api::BatchingDescriptorProto] + # The request and response fields used in batching. + class BatchingConfigProto + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # `BatchingSettingsProto` specifies a set of batching thresholds, each of + # which acts as a trigger to send a batch of messages as a request. At least + # one threshold must be positive nonzero. + # @!attribute [rw] element_count_threshold + # @return [::Integer] + # The number of elements of a field collected into a batch which, if + # exceeded, causes the batch to be sent. + # @!attribute [rw] request_byte_threshold + # @return [::Integer] + # The aggregated size of the batched field which, if exceeded, causes the + # batch to be sent. This size is computed by aggregating the sizes of the + # request field to be batched, not of the entire request message. + # @!attribute [rw] delay_threshold + # @return [::Google::Protobuf::Duration] + # The duration after which a batch should be sent, starting from the addition + # of the first message to that batch. + # @!attribute [rw] element_count_limit + # @return [::Integer] + # The maximum number of elements collected in a batch that could be accepted + # by server. + # @!attribute [rw] request_byte_limit + # @return [::Integer] + # The maximum size of the request that could be accepted by server. + # @!attribute [rw] flow_control_element_limit + # @return [::Integer] + # The maximum number of elements allowed by flow control. + # @!attribute [rw] flow_control_byte_limit + # @return [::Integer] + # The maximum size of data allowed by flow control. + # @!attribute [rw] flow_control_limit_exceeded_behavior + # @return [::Google::Api::FlowControlLimitExceededBehaviorProto] + # The behavior to take when the flow control limit is exceeded. + class BatchingSettingsProto + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # `BatchingDescriptorProto` specifies the fields of the request message to be + # used for batching, and, optionally, the fields of the response message to be + # used for demultiplexing. + # @!attribute [rw] batched_field + # @return [::String] + # The repeated field in the request message to be aggregated by batching. + # @!attribute [rw] discriminator_fields + # @return [::Array<::String>] + # A list of the fields in the request message. Two requests will be batched + # together only if the values of every field specified in + # `request_discriminator_fields` is equal between the two requests. + # @!attribute [rw] subresponse_field + # @return [::String] + # Optional. When present, indicates the field in the response message to be + # used to demultiplex the response into multiple response messages, in + # correspondence with the multiple request messages originally batched + # together. + class BatchingDescriptorProto + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # The organization for which the client libraries are being published. + # Affects the url where generated docs are published, etc. + module ClientLibraryOrganization + # Not useful. + CLIENT_LIBRARY_ORGANIZATION_UNSPECIFIED = 0 + + # Google Cloud Platform Org. + CLOUD = 1 + + # Ads (Advertising) Org. + ADS = 2 + + # Photos Org. + PHOTOS = 3 + + # Street View Org. + STREET_VIEW = 4 + + # Shopping Org. + SHOPPING = 5 + + # Geo Org. + GEO = 6 + + # Generative AI - https://developers.generativeai.google + GENERATIVE_AI = 7 + end + + # To where should client libraries be published? + module ClientLibraryDestination + # Client libraries will neither be generated nor published to package + # managers. + CLIENT_LIBRARY_DESTINATION_UNSPECIFIED = 0 + + # Generate the client library in a repo under github.com/googleapis, + # but don't publish it to package managers. + GITHUB = 10 + + # Publish the library to package managers like nuget.org and npmjs.com. + PACKAGE_MANAGER = 20 + end + + # The behavior to take when the flow control limit is exceeded. + module FlowControlLimitExceededBehaviorProto + # Default behavior, system-defined. + UNSET_BEHAVIOR = 0 + + # Stop operation, raise error. + THROW_EXCEPTION = 1 + + # Pause operation until limit clears. + BLOCK = 2 + + # Continue operation, disregard limit. + IGNORE = 3 + end + end +end diff --git a/owl-bot-staging/google-cloud-secure_source_manager-v1/proto_docs/google/api/field_behavior.rb b/owl-bot-staging/google-cloud-secure_source_manager-v1/proto_docs/google/api/field_behavior.rb new file mode 100644 index 000000000000..582be187d115 --- /dev/null +++ b/owl-bot-staging/google-cloud-secure_source_manager-v1/proto_docs/google/api/field_behavior.rb @@ -0,0 +1,85 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + + +module Google + module Api + # An indicator of the behavior of a given field (for example, that a field + # is required in requests, or given as output but ignored as input). + # This **does not** change the behavior in protocol buffers itself; it only + # denotes the behavior and may affect how API tooling handles the field. + # + # Note: This enum **may** receive new values in the future. + module FieldBehavior + # Conventional default for enums. Do not use this. + FIELD_BEHAVIOR_UNSPECIFIED = 0 + + # Specifically denotes a field as optional. + # While all fields in protocol buffers are optional, this may be specified + # for emphasis if appropriate. + OPTIONAL = 1 + + # Denotes a field as required. + # This indicates that the field **must** be provided as part of the request, + # and failure to do so will cause an error (usually `INVALID_ARGUMENT`). + REQUIRED = 2 + + # Denotes a field as output only. + # This indicates that the field is provided in responses, but including the + # field in a request does nothing (the server *must* ignore it and + # *must not* throw an error as a result of the field's presence). + OUTPUT_ONLY = 3 + + # Denotes a field as input only. + # This indicates that the field is provided in requests, and the + # corresponding field is not included in output. + INPUT_ONLY = 4 + + # Denotes a field as immutable. + # This indicates that the field may be set once in a request to create a + # resource, but may not be changed thereafter. + IMMUTABLE = 5 + + # Denotes that a (repeated) field is an unordered list. + # This indicates that the service may provide the elements of the list + # in any arbitrary order, rather than the order the user originally + # provided. Additionally, the list's order may or may not be stable. + UNORDERED_LIST = 6 + + # Denotes that this field returns a non-empty default value if not set. + # This indicates that if the user provides the empty value in a request, + # a non-empty value will be returned. The user will not be aware of what + # non-empty value to expect. + NON_EMPTY_DEFAULT = 7 + + # Denotes that the field in a resource (a message annotated with + # google.api.resource) is used in the resource name to uniquely identify the + # resource. For AIP-compliant APIs, this should only be applied to the + # `name` field on the resource. + # + # This behavior should not be applied to references to other resources within + # the message. + # + # The identifier field of resources often have different field behavior + # depending on the request it is embedded in (e.g. for Create methods name + # is optional and unused, while for Update methods it is required). Instead + # of method-specific annotations, only `IDENTIFIER` is required. + IDENTIFIER = 8 + end + end +end diff --git a/owl-bot-staging/google-cloud-secure_source_manager-v1/proto_docs/google/api/launch_stage.rb b/owl-bot-staging/google-cloud-secure_source_manager-v1/proto_docs/google/api/launch_stage.rb new file mode 100644 index 000000000000..9392a413fb1b --- /dev/null +++ b/owl-bot-staging/google-cloud-secure_source_manager-v1/proto_docs/google/api/launch_stage.rb @@ -0,0 +1,71 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + + +module Google + module Api + # The launch stage as defined by [Google Cloud Platform + # Launch Stages](https://cloud.google.com/terms/launch-stages). + module LaunchStage + # Do not use this default value. + LAUNCH_STAGE_UNSPECIFIED = 0 + + # The feature is not yet implemented. Users can not use it. + UNIMPLEMENTED = 6 + + # Prelaunch features are hidden from users and are only visible internally. + PRELAUNCH = 7 + + # Early Access features are limited to a closed group of testers. To use + # these features, you must sign up in advance and sign a Trusted Tester + # agreement (which includes confidentiality provisions). These features may + # be unstable, changed in backward-incompatible ways, and are not + # guaranteed to be released. + EARLY_ACCESS = 1 + + # Alpha is a limited availability test for releases before they are cleared + # for widespread use. By Alpha, all significant design issues are resolved + # and we are in the process of verifying functionality. Alpha customers + # need to apply for access, agree to applicable terms, and have their + # projects allowlisted. Alpha releases don't have to be feature complete, + # no SLAs are provided, and there are no technical support obligations, but + # they will be far enough along that customers can actually use them in + # test environments or for limited-use tests -- just like they would in + # normal production cases. + ALPHA = 2 + + # Beta is the point at which we are ready to open a release for any + # customer to use. There are no SLA or technical support obligations in a + # Beta release. Products will be complete from a feature perspective, but + # may have some open outstanding issues. Beta releases are suitable for + # limited production use cases. + BETA = 3 + + # GA features are open to all developers and are considered stable and + # fully qualified for production use. + GA = 4 + + # Deprecated features are scheduled to be shut down and removed. For more + # information, see the "Deprecation Policy" section of our [Terms of + # Service](https://cloud.google.com/terms/) + # and the [Google Cloud Platform Subject to the Deprecation + # Policy](https://cloud.google.com/terms/deprecation) documentation. + DEPRECATED = 5 + end + end +end diff --git a/owl-bot-staging/google-cloud-secure_source_manager-v1/proto_docs/google/api/resource.rb b/owl-bot-staging/google-cloud-secure_source_manager-v1/proto_docs/google/api/resource.rb new file mode 100644 index 000000000000..25dec4847ac1 --- /dev/null +++ b/owl-bot-staging/google-cloud-secure_source_manager-v1/proto_docs/google/api/resource.rb @@ -0,0 +1,227 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + + +module Google + module Api + # A simple descriptor of a resource type. + # + # ResourceDescriptor annotates a resource message (either by means of a + # protobuf annotation or use in the service config), and associates the + # resource's schema, the resource type, and the pattern of the resource name. + # + # Example: + # + # message Topic { + # // Indicates this message defines a resource schema. + # // Declares the resource type in the format of {service}/{kind}. + # // For Kubernetes resources, the format is {api group}/{kind}. + # option (google.api.resource) = { + # type: "pubsub.googleapis.com/Topic" + # pattern: "projects/{project}/topics/{topic}" + # }; + # } + # + # The ResourceDescriptor Yaml config will look like: + # + # resources: + # - type: "pubsub.googleapis.com/Topic" + # pattern: "projects/{project}/topics/{topic}" + # + # Sometimes, resources have multiple patterns, typically because they can + # live under multiple parents. + # + # Example: + # + # message LogEntry { + # option (google.api.resource) = { + # type: "logging.googleapis.com/LogEntry" + # pattern: "projects/{project}/logs/{log}" + # pattern: "folders/{folder}/logs/{log}" + # pattern: "organizations/{organization}/logs/{log}" + # pattern: "billingAccounts/{billing_account}/logs/{log}" + # }; + # } + # + # The ResourceDescriptor Yaml config will look like: + # + # resources: + # - type: 'logging.googleapis.com/LogEntry' + # pattern: "projects/{project}/logs/{log}" + # pattern: "folders/{folder}/logs/{log}" + # pattern: "organizations/{organization}/logs/{log}" + # pattern: "billingAccounts/{billing_account}/logs/{log}" + # @!attribute [rw] type + # @return [::String] + # The resource type. It must be in the format of + # \\{service_name}/\\{resource_type_kind}. The `resource_type_kind` must be + # singular and must not include version numbers. + # + # Example: `storage.googleapis.com/Bucket` + # + # The value of the resource_type_kind must follow the regular expression + # /[A-Za-z][a-zA-Z0-9]+/. It should start with an upper case character and + # should use PascalCase (UpperCamelCase). The maximum number of + # characters allowed for the `resource_type_kind` is 100. + # @!attribute [rw] pattern + # @return [::Array<::String>] + # Optional. The relative resource name pattern associated with this resource + # type. The DNS prefix of the full resource name shouldn't be specified here. + # + # The path pattern must follow the syntax, which aligns with HTTP binding + # syntax: + # + # Template = Segment { "/" Segment } ; + # Segment = LITERAL | Variable ; + # Variable = "{" LITERAL "}" ; + # + # Examples: + # + # - "projects/\\{project}/topics/\\{topic}" + # - "projects/\\{project}/knowledgeBases/\\{knowledge_base}" + # + # The components in braces correspond to the IDs for each resource in the + # hierarchy. It is expected that, if multiple patterns are provided, + # the same component name (e.g. "project") refers to IDs of the same + # type of resource. + # @!attribute [rw] name_field + # @return [::String] + # Optional. The field on the resource that designates the resource name + # field. If omitted, this is assumed to be "name". + # @!attribute [rw] history + # @return [::Google::Api::ResourceDescriptor::History] + # Optional. The historical or future-looking state of the resource pattern. + # + # Example: + # + # // The InspectTemplate message originally only supported resource + # // names with organization, and project was added later. + # message InspectTemplate { + # option (google.api.resource) = { + # type: "dlp.googleapis.com/InspectTemplate" + # pattern: + # "organizations/{organization}/inspectTemplates/{inspect_template}" + # pattern: "projects/{project}/inspectTemplates/{inspect_template}" + # history: ORIGINALLY_SINGLE_PATTERN + # }; + # } + # @!attribute [rw] plural + # @return [::String] + # The plural name used in the resource name and permission names, such as + # 'projects' for the resource name of 'projects/\\{project}' and the permission + # name of 'cloudresourcemanager.googleapis.com/projects.get'. One exception + # to this is for Nested Collections that have stuttering names, as defined + # in [AIP-122](https://google.aip.dev/122#nested-collections), where the + # collection ID in the resource name pattern does not necessarily directly + # match the `plural` value. + # + # It is the same concept of the `plural` field in k8s CRD spec + # https://kubernetes.io/docs/tasks/access-kubernetes-api/custom-resources/custom-resource-definitions/ + # + # Note: The plural form is required even for singleton resources. See + # https://aip.dev/156 + # @!attribute [rw] singular + # @return [::String] + # The same concept of the `singular` field in k8s CRD spec + # https://kubernetes.io/docs/tasks/access-kubernetes-api/custom-resources/custom-resource-definitions/ + # Such as "project" for the `resourcemanager.googleapis.com/Project` type. + # @!attribute [rw] style + # @return [::Array<::Google::Api::ResourceDescriptor::Style>] + # Style flag(s) for this resource. + # These indicate that a resource is expected to conform to a given + # style. See the specific style flags for additional information. + class ResourceDescriptor + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # A description of the historical or future-looking state of the + # resource pattern. + module History + # The "unset" value. + HISTORY_UNSPECIFIED = 0 + + # The resource originally had one pattern and launched as such, and + # additional patterns were added later. + ORIGINALLY_SINGLE_PATTERN = 1 + + # The resource has one pattern, but the API owner expects to add more + # later. (This is the inverse of ORIGINALLY_SINGLE_PATTERN, and prevents + # that from being necessary once there are multiple patterns.) + FUTURE_MULTI_PATTERN = 2 + end + + # A flag representing a specific style that a resource claims to conform to. + module Style + # The unspecified value. Do not use. + STYLE_UNSPECIFIED = 0 + + # This resource is intended to be "declarative-friendly". + # + # Declarative-friendly resources must be more strictly consistent, and + # setting this to true communicates to tools that this resource should + # adhere to declarative-friendly expectations. + # + # Note: This is used by the API linter (linter.aip.dev) to enable + # additional checks. + DECLARATIVE_FRIENDLY = 1 + end + end + + # Defines a proto annotation that describes a string field that refers to + # an API resource. + # @!attribute [rw] type + # @return [::String] + # The resource type that the annotated field references. + # + # Example: + # + # message Subscription { + # string topic = 2 [(google.api.resource_reference) = { + # type: "pubsub.googleapis.com/Topic" + # }]; + # } + # + # Occasionally, a field may reference an arbitrary resource. In this case, + # APIs use the special value * in their resource reference. + # + # Example: + # + # message GetIamPolicyRequest { + # string resource = 2 [(google.api.resource_reference) = { + # type: "*" + # }]; + # } + # @!attribute [rw] child_type + # @return [::String] + # The resource type of a child collection that the annotated field + # references. This is useful for annotating the `parent` field that + # doesn't have a fixed resource type. + # + # Example: + # + # message ListLogEntriesRequest { + # string parent = 1 [(google.api.resource_reference) = { + # child_type: "logging.googleapis.com/LogEntry" + # }; + # } + class ResourceReference + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end +end diff --git a/owl-bot-staging/google-cloud-secure_source_manager-v1/proto_docs/google/cloud/securesourcemanager/v1/secure_source_manager.rb b/owl-bot-staging/google-cloud-secure_source_manager-v1/proto_docs/google/cloud/securesourcemanager/v1/secure_source_manager.rb new file mode 100644 index 000000000000..a66817ea6ebc --- /dev/null +++ b/owl-bot-staging/google-cloud-secure_source_manager-v1/proto_docs/google/cloud/securesourcemanager/v1/secure_source_manager.rb @@ -0,0 +1,1792 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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 SecureSourceManager + module V1 + # A resource that represents a Secure Source Manager instance. + # @!attribute [rw] name + # @return [::String] + # Optional. A unique identifier for an instance. The name should be of the + # format: + # `projects/{project_number}/locations/{location_id}/instances/{instance_id}` + # + # `project_number`: Maps to a unique int64 id assigned to each project. + # + # `location_id`: Refers to the region where the instance will be deployed. + # Since Secure Source Manager is a regional service, it must be one of the + # valid GCP regions. + # + # `instance_id`: User provided name for the instance, must be unique for a + # project_number and location_id combination. + # @!attribute [r] create_time + # @return [::Google::Protobuf::Timestamp] + # Output only. Create timestamp. + # @!attribute [r] update_time + # @return [::Google::Protobuf::Timestamp] + # Output only. Update timestamp. + # @!attribute [rw] labels + # @return [::Google::Protobuf::Map{::String => ::String}] + # Optional. Labels as key value pairs. + # @!attribute [rw] private_config + # @return [::Google::Cloud::SecureSourceManager::V1::Instance::PrivateConfig] + # Optional. Private settings for private instance. + # @!attribute [r] state + # @return [::Google::Cloud::SecureSourceManager::V1::Instance::State] + # Output only. Current state of the instance. + # @!attribute [r] state_note + # @return [::Google::Cloud::SecureSourceManager::V1::Instance::StateNote] + # Output only. An optional field providing information about the current + # instance state. + # @!attribute [rw] kms_key + # @return [::String] + # Optional. Immutable. Customer-managed encryption key name, in the format + # projects/*/locations/*/keyRings/*/cryptoKeys/*. + # @!attribute [r] host_config + # @return [::Google::Cloud::SecureSourceManager::V1::Instance::HostConfig] + # Output only. A list of hostnames for this instance. + # @!attribute [rw] workforce_identity_federation_config + # @return [::Google::Cloud::SecureSourceManager::V1::Instance::WorkforceIdentityFederationConfig] + # Optional. Configuration for Workforce Identity Federation to support + # third party identity provider. If unset, defaults to the Google OIDC IdP. + class Instance + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # HostConfig has different instance endpoints. + # @!attribute [r] html + # @return [::String] + # Output only. HTML hostname. + # @!attribute [r] api + # @return [::String] + # Output only. API hostname. + # @!attribute [r] git_http + # @return [::String] + # Output only. Git HTTP hostname. + # @!attribute [r] git_ssh + # @return [::String] + # Output only. Git SSH hostname. + class HostConfig + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # PrivateConfig includes settings for private instance. + # @!attribute [rw] is_private + # @return [::Boolean] + # Required. Immutable. Indicate if it's private instance. + # @!attribute [rw] ca_pool + # @return [::String] + # Optional. Immutable. CA pool resource, resource must in the format of + # `projects/{project}/locations/{location}/caPools/{ca_pool}`. + # @!attribute [r] http_service_attachment + # @return [::String] + # Output only. Service Attachment for HTTP, resource is in the format of + # `projects/{project}/regions/{region}/serviceAttachments/{service_attachment}`. + # @!attribute [r] ssh_service_attachment + # @return [::String] + # Output only. Service Attachment for SSH, resource is in the format of + # `projects/{project}/regions/{region}/serviceAttachments/{service_attachment}`. + # @!attribute [rw] psc_allowed_projects + # @return [::Array<::String>] + # Optional. Additional allowed projects for setting up PSC connections. + # Instance host project is automatically allowed and does not need to be + # included in this list. + class PrivateConfig + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # WorkforceIdentityFederationConfig allows this instance to support users + # from external identity providers. + # @!attribute [rw] enabled + # @return [::Boolean] + # Optional. Immutable. Whether Workforce Identity Federation is enabled. + class WorkforceIdentityFederationConfig + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # @!attribute [rw] key + # @return [::String] + # @!attribute [rw] value + # @return [::String] + class LabelsEntry + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Secure Source Manager instance state. + module State + # Not set. This should only be the case for incoming requests. + STATE_UNSPECIFIED = 0 + + # Instance is being created. + CREATING = 1 + + # Instance is ready. + ACTIVE = 2 + + # Instance is being deleted. + DELETING = 3 + + # Instance is paused. + PAUSED = 4 + + # Instance is unknown, we are not sure if it's functioning. + UNKNOWN = 6 + end + + # Provides information about the current instance state. + module StateNote + # STATE_NOTE_UNSPECIFIED as the first value of State. + STATE_NOTE_UNSPECIFIED = 0 + + # CMEK access is unavailable. + PAUSED_CMEK_UNAVAILABLE = 1 + + # INSTANCE_RESUMING indicates that the instance was previously paused + # and is under the process of being brought back. + INSTANCE_RESUMING = 2 + end + end + + # Metadata of a Secure Source Manager repository. + # @!attribute [rw] name + # @return [::String] + # Optional. A unique identifier for a repository. The name should be of the + # format: + # `projects/{project}/locations/{location_id}/repositories/{repository_id}` + # @!attribute [rw] description + # @return [::String] + # Optional. Description of the repository, which cannot exceed 500 + # characters. + # @!attribute [rw] instance + # @return [::String] + # Optional. The name of the instance in which the repository is hosted, + # formatted as + # `projects/{project_number}/locations/{location_id}/instances/{instance_id}` + # When creating repository via securesourcemanager.googleapis.com, this field + # is used as input. When creating repository via *.sourcemanager.dev, this + # field is output only. + # @!attribute [r] uid + # @return [::String] + # Output only. Unique identifier of the repository. + # @!attribute [r] create_time + # @return [::Google::Protobuf::Timestamp] + # Output only. Create timestamp. + # @!attribute [r] update_time + # @return [::Google::Protobuf::Timestamp] + # Output only. Update timestamp. + # @!attribute [rw] etag + # @return [::String] + # Optional. This checksum is computed by the server based on the value of + # other fields, and may be sent on update and delete requests to ensure the + # client has an up-to-date value before proceeding. + # @!attribute [r] uris + # @return [::Google::Cloud::SecureSourceManager::V1::Repository::URIs] + # Output only. URIs for the repository. + # @!attribute [rw] initial_config + # @return [::Google::Cloud::SecureSourceManager::V1::Repository::InitialConfig] + # Input only. Initial configurations for the repository. + class Repository + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # URIs for the repository. + # @!attribute [r] html + # @return [::String] + # Output only. HTML is the URI for user to view the repository in a + # browser. + # @!attribute [r] git_https + # @return [::String] + # Output only. git_https is the git HTTPS URI for git operations. + # @!attribute [r] api + # @return [::String] + # Output only. API is the URI for API access. + class URIs + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Repository initialization configuration. + # @!attribute [rw] default_branch + # @return [::String] + # Default branch name of the repository. + # @!attribute [rw] gitignores + # @return [::Array<::String>] + # List of gitignore template names user can choose from. + # Valid values: actionscript, ada, agda, android, + # anjuta, ansible, appcelerator-titanium, app-engine, archives, + # arch-linux-packages, atmel-studio, autotools, backup, bazaar, bazel, + # bitrix, bricx-cc, c, cake-php, calabash, cf-wheels, chef-cookbook, + # clojure, cloud9, c-make, code-igniter, code-kit, code-sniffer, + # common-lisp, composer, concrete5, coq, cordova, cpp, craft-cms, cuda, + # cvs, d, dart, dart-editor, delphi, diff, dm, dreamweaver, dropbox, + # drupal, drupal-7, eagle, eclipse, eiffel-studio, elisp, elixir, elm, + # emacs, ensime, epi-server, erlang, esp-idf, espresso, exercism, + # expression-engine, ext-js, fancy, finale, flex-builder, force-dot-com, + # fortran, fuel-php, gcov, git-book, gnome-shell-extension, go, godot, gpg, + # gradle, grails, gwt, haskell, hugo, iar-ewarm, idris, igor-pro, images, + # infor-cms, java, jboss, jboss-4, jboss-6, jdeveloper, jekyll, + # jenkins-home, jenv, jet-brains, jigsaw, joomla, julia, jupyter-notebooks, + # kate, kdevelop4, kentico, ki-cad, kohana, kotlin, lab-view, laravel, + # lazarus, leiningen, lemon-stand, libre-office, lilypond, linux, lithium, + # logtalk, lua, lyx, mac-os, magento, magento-1, magento-2, matlab, maven, + # mercurial, mercury, metals, meta-programming-system, meteor, + # microsoft-office, model-sim, momentics, mono-develop, nanoc, net-beans, + # nikola, nim, ninja, node, notepad-pp, nwjs, objective--c, ocaml, octave, + # opa, open-cart, openssl, oracle-forms, otto, packer, patch, perl, perl6, + # phalcon, phoenix, pimcore, play-framework, plone, prestashop, processing, + # psoc-creator, puppet, pure-script, putty, python, qooxdoo, qt, r, racket, + # rails, raku, red, redcar, redis, rhodes-rhomobile, ros, ruby, rust, sam, + # sass, sbt, scala, scheme, scons, scrivener, sdcc, seam-gen, sketch-up, + # slick-edit, smalltalk, snap, splunk, stata, stella, sublime-text, + # sugar-crm, svn, swift, symfony, symphony-cms, synopsys-vcs, tags, + # terraform, tex, text-mate, textpattern, think-php, tortoise-git, + # turbo-gears-2, typo3, umbraco, unity, unreal-engine, vagrant, vim, + # virtual-env, virtuoso, visual-studio, visual-studio-code, vue, vvvv, waf, + # web-methods, windows, word-press, xcode, xilinx, xilinx-ise, xojo, + # yeoman, yii, zend-framework, zephir. + # @!attribute [rw] license + # @return [::String] + # License template name user can choose from. + # Valid values: license-0bsd, license-389-exception, aal, abstyles, + # adobe-2006, adobe-glyph, adsl, afl-1-1, afl-1-2, afl-2-0, afl-2-1, + # afl-3-0, afmparse, agpl-1-0, agpl-1-0-only, agpl-1-0-or-later, + # agpl-3-0-only, agpl-3-0-or-later, aladdin, amdplpa, aml, ampas, antlr-pd, + # antlr-pd-fallback, apache-1-0, apache-1-1, apache-2-0, apafml, apl-1-0, + # apsl-1-0, apsl-1-1, apsl-1-2, apsl-2-0, artistic-1-0, artistic-1-0-cl8, + # artistic-1-0-perl, artistic-2-0, autoconf-exception-2-0, + # autoconf-exception-3-0, bahyph, barr, beerware, bison-exception-2-2, + # bittorrent-1-0, bittorrent-1-1, blessing, blueoak-1-0-0, + # bootloader-exception, borceux, bsd-1-clause, bsd-2-clause, + # bsd-2-clause-freebsd, bsd-2-clause-netbsd, bsd-2-clause-patent, + # bsd-2-clause-views, bsd-3-clause, bsd-3-clause-attribution, + # bsd-3-clause-clear, bsd-3-clause-lbnl, bsd-3-clause-modification, + # bsd-3-clause-no-nuclear-license, bsd-3-clause-no-nuclear-license-2014, + # bsd-3-clause-no-nuclear-warranty, bsd-3-clause-open-mpi, bsd-4-clause, + # bsd-4-clause-shortened, bsd-4-clause-uc, bsd-protection, bsd-source-code, + # bsl-1-0, busl-1-1, cal-1-0, cal-1-0-combined-work-exception, caldera, + # catosl-1-1, cc0-1-0, cc-by-1-0, cc-by-2-0, cc-by-3-0, cc-by-3-0-at, + # cc-by-3-0-us, cc-by-4-0, cc-by-nc-1-0, cc-by-nc-2-0, cc-by-nc-3-0, + # cc-by-nc-4-0, cc-by-nc-nd-1-0, cc-by-nc-nd-2-0, cc-by-nc-nd-3-0, + # cc-by-nc-nd-3-0-igo, cc-by-nc-nd-4-0, cc-by-nc-sa-1-0, cc-by-nc-sa-2-0, + # cc-by-nc-sa-3-0, cc-by-nc-sa-4-0, cc-by-nd-1-0, cc-by-nd-2-0, + # cc-by-nd-3-0, cc-by-nd-4-0, cc-by-sa-1-0, cc-by-sa-2-0, cc-by-sa-2-0-uk, + # cc-by-sa-2-1-jp, cc-by-sa-3-0, cc-by-sa-3-0-at, cc-by-sa-4-0, cc-pddc, + # cddl-1-0, cddl-1-1, cdla-permissive-1-0, cdla-sharing-1-0, cecill-1-0, + # cecill-1-1, cecill-2-0, cecill-2-1, cecill-b, cecill-c, cern-ohl-1-1, + # cern-ohl-1-2, cern-ohl-p-2-0, cern-ohl-s-2-0, cern-ohl-w-2-0, clartistic, + # classpath-exception-2-0, clisp-exception-2-0, cnri-jython, cnri-python, + # cnri-python-gpl-compatible, condor-1-1, copyleft-next-0-3-0, + # copyleft-next-0-3-1, cpal-1-0, cpl-1-0, cpol-1-02, crossword, + # crystal-stacker, cua-opl-1-0, cube, c-uda-1-0, curl, d-fsl-1-0, diffmark, + # digirule-foss-exception, doc, dotseqn, drl-1-0, dsdp, dvipdfm, ecl-1-0, + # ecl-2-0, ecos-exception-2-0, efl-1-0, efl-2-0, egenix, entessa, epics, + # epl-1-0, epl-2-0, erlpl-1-1, etalab-2-0, eu-datagrid, eupl-1-0, eupl-1-1, + # eupl-1-2, eurosym, fair, fawkes-runtime-exception, fltk-exception, + # font-exception-2-0, frameworx-1-0, freebsd-doc, freeimage, + # freertos-exception-2-0, fsfap, fsful, fsfullr, ftl, gcc-exception-2-0, + # gcc-exception-3-1, gd, gfdl-1-1-invariants-only, + # gfdl-1-1-invariants-or-later, gfdl-1-1-no-invariants-only, + # gfdl-1-1-no-invariants-or-later, gfdl-1-1-only, gfdl-1-1-or-later, + # gfdl-1-2-invariants-only, gfdl-1-2-invariants-or-later, + # gfdl-1-2-no-invariants-only, gfdl-1-2-no-invariants-or-later, + # gfdl-1-2-only, gfdl-1-2-or-later, gfdl-1-3-invariants-only, + # gfdl-1-3-invariants-or-later, gfdl-1-3-no-invariants-only, + # gfdl-1-3-no-invariants-or-later, gfdl-1-3-only, gfdl-1-3-or-later, + # giftware, gl2ps, glide, glulxe, glwtpl, gnu-javamail-exception, gnuplot, + # gpl-1-0-only, gpl-1-0-or-later, gpl-2-0-only, gpl-2-0-or-later, + # gpl-3-0-linking-exception, gpl-3-0-linking-source-exception, + # gpl-3-0-only, gpl-3-0-or-later, gpl-cc-1-0, gsoap-1-3b, haskell-report, + # hippocratic-2-1, hpnd, hpnd-sell-variant, htmltidy, + # i2p-gpl-java-exception, ibm-pibs, icu, ijg, image-magick, imatix, imlib2, + # info-zip, intel, intel-acpi, interbase-1-0, ipa, ipl-1-0, isc, + # jasper-2-0, jpnic, json, lal-1-2, lal-1-3, latex2e, leptonica, + # lgpl-2-0-only, lgpl-2-0-or-later, lgpl-2-1-only, lgpl-2-1-or-later, + # lgpl-3-0-linking-exception, lgpl-3-0-only, lgpl-3-0-or-later, lgpllr, + # libpng, libpng-2-0, libselinux-1-0, libtiff, libtool-exception, + # liliq-p-1-1, liliq-r-1-1, liliq-rplus-1-1, linux-openib, + # linux-syscall-note, llvm-exception, lpl-1-0, lpl-1-02, lppl-1-0, + # lppl-1-1, lppl-1-2, lppl-1-3a, lppl-1-3c, lzma-exception, make-index, + # mif-exception, miros, mit, mit-0, mit-advertising, mit-cmu, mit-enna, + # mit-feh, mit-modern-variant, mitnfa, mit-open-group, motosoto, mpich2, + # mpl-1-0, mpl-1-1, mpl-2-0, mpl-2-0-no-copyleft-exception, ms-pl, ms-rl, + # mtll, mulanpsl-1-0, mulanpsl-2-0, multics, mup, naist-2003, nasa-1-3, + # naumen, nbpl-1-0, ncgl-uk-2-0, ncsa, netcdf, net-snmp, newsletr, ngpl, + # nist-pd, nist-pd-fallback, nlod-1-0, nlpl, nokia, nokia-qt-exception-1-1, + # nosl, noweb, npl-1-0, npl-1-1, nposl-3-0, nrl, ntp, ntp-0, + # ocaml-lgpl-linking-exception, occt-exception-1-0, occt-pl, oclc-2-0, + # odbl-1-0, odc-by-1-0, ofl-1-0, ofl-1-0-no-rfn, ofl-1-0-rfn, ofl-1-1, + # ofl-1-1-no-rfn, ofl-1-1-rfn, ogc-1-0, ogdl-taiwan-1-0, ogl-canada-2-0, + # ogl-uk-1-0, ogl-uk-2-0, ogl-uk-3-0, ogtsl, oldap-1-1, oldap-1-2, + # oldap-1-3, oldap-1-4, oldap-2-0, oldap-2-0-1, oldap-2-1, oldap-2-2, + # oldap-2-2-1, oldap-2-2-2, oldap-2-3, oldap-2-4, oldap-2-7, oml, + # openjdk-assembly-exception-1-0, openssl, openvpn-openssl-exception, + # opl-1-0, oset-pl-2-1, osl-1-0, osl-1-1, osl-2-0, osl-2-1, osl-3-0, + # o-uda-1-0, parity-6-0-0, parity-7-0-0, pddl-1-0, php-3-0, php-3-01, + # plexus, polyform-noncommercial-1-0-0, polyform-small-business-1-0-0, + # postgresql, psf-2-0, psfrag, ps-or-pdf-font-exception-20170817, psutils, + # python-2-0, qhull, qpl-1-0, qt-gpl-exception-1-0, qt-lgpl-exception-1-1, + # qwt-exception-1-0, rdisc, rhecos-1-1, rpl-1-1, rpsl-1-0, rsa-md, rscpl, + # ruby, saxpath, sax-pd, scea, sendmail, sendmail-8-23, sgi-b-1-0, + # sgi-b-1-1, sgi-b-2-0, shl-0-51, shl-2-0, shl-2-1, simpl-2-0, sissl, + # sissl-1-2, sleepycat, smlnj, smppl, snia, spencer-86, spencer-94, + # spencer-99, spl-1-0, ssh-openssh, ssh-short, sspl-1-0, sugarcrm-1-1-3, + # swift-exception, swl, tapr-ohl-1-0, tcl, tcp-wrappers, tmate, torque-1-1, + # tosl, tu-berlin-1-0, tu-berlin-2-0, u-boot-exception-2-0, ucl-1-0, + # unicode-dfs-2015, unicode-dfs-2016, unicode-tou, + # universal-foss-exception-1-0, unlicense, upl-1-0, vim, vostrom, vsl-1-0, + # w3c, w3c-19980720, w3c-20150513, watcom-1-0, wsuipa, wtfpl, + # wxwindows-exception-3-1, x11, xerox, xfree86-1-1, xinetd, xnet, xpp, + # xskat, ypl-1-0, ypl-1-1, zed, zend-2-0, zimbra-1-3, zimbra-1-4, zlib, + # zlib-acknowledgement, zpl-1-1, zpl-2-0, zpl-2-1. + # @!attribute [rw] readme + # @return [::String] + # README template name. + # Valid template name(s) are: default. + class InitialConfig + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end + + # Metadata of a Secure Source Manager Hook. + # @!attribute [rw] name + # @return [::String] + # Identifier. A unique identifier for a Hook. The name should be of the + # format: + # `projects/{project}/locations/{location_id}/repositories/{repository_id}/hooks/{hook_id}` + # @!attribute [rw] target_uri + # @return [::String] + # Required. The target URI to which the payloads will be delivered. + # @!attribute [rw] disabled + # @return [::Boolean] + # Optional. Determines if the hook disabled or not. + # Set to true to stop sending traffic. + # @!attribute [rw] events + # @return [::Array<::Google::Cloud::SecureSourceManager::V1::Hook::HookEventType>] + # Optional. The events that trigger hook on. + # @!attribute [r] create_time + # @return [::Google::Protobuf::Timestamp] + # Output only. Create timestamp. + # @!attribute [r] update_time + # @return [::Google::Protobuf::Timestamp] + # Output only. Update timestamp. + # @!attribute [r] uid + # @return [::String] + # Output only. Unique identifier of the hook. + # @!attribute [rw] push_option + # @return [::Google::Cloud::SecureSourceManager::V1::Hook::PushOption] + # Optional. The trigger option for push events. + # @!attribute [rw] sensitive_query_string + # @return [::String] + # Optional. The sensitive query string to be appended to the target URI. + class Hook + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # @!attribute [rw] branch_filter + # @return [::String] + # Optional. Trigger hook for matching branches only. + # Specified as glob pattern. If empty or *, events for all branches are + # reported. Examples: main, \\{main,release*}. + # See https://pkg.go.dev/github.com/gobwas/glob documentation. + class PushOption + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + module HookEventType + # Unspecified. + UNSPECIFIED = 0 + + # Push events are triggered when pushing to the repository. + PUSH = 1 + + # Pull request events are triggered when a pull request is opened, closed, + # reopened, or edited. + PULL_REQUEST = 2 + end + end + + # Metadata of a BranchRule. BranchRule is the protection rule to enforce + # pre-defined rules on designated branches within a repository. + # @!attribute [rw] name + # @return [::String] + # Optional. A unique identifier for a BranchRule. The name should be of the + # format: + # `projects/{project}/locations/{location}/repositories/{repository}/branchRules/{branch_rule}` + # @!attribute [r] uid + # @return [::String] + # Output only. Unique identifier of the repository. + # @!attribute [r] create_time + # @return [::Google::Protobuf::Timestamp] + # Output only. Create timestamp. + # @!attribute [r] update_time + # @return [::Google::Protobuf::Timestamp] + # Output only. Update timestamp. + # @!attribute [rw] annotations + # @return [::Google::Protobuf::Map{::String => ::String}] + # Optional. User annotations. These attributes can only be set and used by + # the user. See https://google.aip.dev/128#annotations for more details such + # as format and size limitations. + # @!attribute [rw] etag + # @return [::String] + # Optional. This checksum is computed by the server based on the value of + # other fields, and may be sent on update and delete requests to ensure the + # client has an up-to-date value before proceeding. + # @!attribute [rw] include_pattern + # @return [::String] + # Optional. The pattern of the branch that can match to this BranchRule. + # Specified as regex. + # .* for all branches. Examples: main, (main|release.*). + # Current MVP phase only support `.*` for wildcard. + # @!attribute [rw] disabled + # @return [::Boolean] + # Optional. Determines if the branch rule is disabled or not. + # @!attribute [rw] require_pull_request + # @return [::Boolean] + # Optional. Determines if the branch rule requires a pull request or not. + # @!attribute [rw] minimum_reviews_count + # @return [::Integer] + # Optional. The minimum number of reviews required for the branch rule to be + # matched. + # @!attribute [rw] minimum_approvals_count + # @return [::Integer] + # Optional. The minimum number of approvals required for the branch rule to + # be matched. + # @!attribute [rw] require_comments_resolved + # @return [::Boolean] + # Optional. Determines if require comments resolved before merging to the + # branch. + # @!attribute [rw] allow_stale_reviews + # @return [::Boolean] + # Optional. Determines if allow stale reviews or approvals before merging to + # the branch. + # @!attribute [rw] require_linear_history + # @return [::Boolean] + # Optional. Determines if require linear history before merging to the + # branch. + # @!attribute [rw] required_status_checks + # @return [::Array<::Google::Cloud::SecureSourceManager::V1::BranchRule::Check>] + # Optional. List of required status checks before merging to the branch. + class BranchRule + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # Check is a type for status check. + # @!attribute [rw] context + # @return [::String] + # Required. The context of the check. + class Check + 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 + end + + # Metadata of a PullRequest. PullRequest is the request + # from a user to merge a branch (head) into another branch (base). + # @!attribute [r] name + # @return [::String] + # Output only. A unique identifier for a PullRequest. The number appended at + # the end is generated by the server. Format: + # `projects/{project}/locations/{location}/repositories/{repository}/pullRequests/{pull_request_id}` + # @!attribute [rw] title + # @return [::String] + # Required. The pull request title. + # @!attribute [rw] body + # @return [::String] + # Optional. The pull request body. Provides a detailed description of the + # changes. + # @!attribute [rw] base + # @return [::Google::Cloud::SecureSourceManager::V1::PullRequest::Branch] + # Required. The branch to merge changes in. + # @!attribute [rw] head + # @return [::Google::Cloud::SecureSourceManager::V1::PullRequest::Branch] + # Immutable. The branch containing the changes to be merged. + # @!attribute [r] state + # @return [::Google::Cloud::SecureSourceManager::V1::PullRequest::State] + # Output only. State of the pull request (open, closed or merged). + # @!attribute [r] create_time + # @return [::Google::Protobuf::Timestamp] + # Output only. Creation timestamp. + # @!attribute [r] update_time + # @return [::Google::Protobuf::Timestamp] + # Output only. Last updated timestamp. + # @!attribute [r] close_time + # @return [::Google::Protobuf::Timestamp] + # Output only. Close timestamp (if closed or merged). Cleared when pull + # request is re-opened. + class PullRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # Branch represents a branch involved in a pull request. + # @!attribute [rw] ref + # @return [::String] + # Required. Name of the branch. + # @!attribute [r] sha + # @return [::String] + # Output only. The commit at the tip of the branch. + class Branch + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # State of the pull request. + module State + # Unspecified. + STATE_UNSPECIFIED = 0 + + # An open pull request. + OPEN = 1 + + # A closed pull request. + CLOSED = 2 + + # A merged pull request. + MERGED = 3 + end + end + + # Metadata of a FileDiff. FileDiff represents a single file diff in a pull + # request. + # @!attribute [r] name + # @return [::String] + # Output only. The name of the file. + # @!attribute [r] action + # @return [::Google::Cloud::SecureSourceManager::V1::FileDiff::Action] + # Output only. The action taken on the file (eg. added, modified, deleted). + # @!attribute [r] sha + # @return [::String] + # Output only. The commit pointing to the file changes. + # @!attribute [r] patch + # @return [::String] + # Output only. The git patch containing the file changes. + class FileDiff + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # Action taken on the file. + module Action + # Unspecified. + ACTION_UNSPECIFIED = 0 + + # The file was added. + ADDED = 1 + + # The file was modified. + MODIFIED = 2 + + # The file was deleted. + DELETED = 3 + end + end + + # Metadata of an Issue. + # @!attribute [rw] name + # @return [::String] + # Identifier. Unique identifier for an issue. The issue id is generated by + # the server. Format: + # `projects/{project}/locations/{location}/repositories/{repository}/issues/{issue_id}` + # @!attribute [rw] title + # @return [::String] + # Required. Issue title. + # @!attribute [rw] body + # @return [::String] + # Optional. Issue body. Provides a detailed description of the issue. + # @!attribute [r] state + # @return [::Google::Cloud::SecureSourceManager::V1::Issue::State] + # Output only. State of the issue. + # @!attribute [r] create_time + # @return [::Google::Protobuf::Timestamp] + # Output only. Creation timestamp. + # @!attribute [r] update_time + # @return [::Google::Protobuf::Timestamp] + # Output only. Last updated timestamp. + # @!attribute [r] close_time + # @return [::Google::Protobuf::Timestamp] + # Output only. Close timestamp (if closed). Cleared when is re-opened. + # @!attribute [rw] etag + # @return [::String] + # Optional. This checksum is computed by the server based on the value of + # other fields, and may be sent on update and delete requests to ensure the + # client has an up-to-date value before proceeding. + class Issue + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # Possible states of an issue. + module State + # Unspecified. + STATE_UNSPECIFIED = 0 + + # An open issue. + OPEN = 1 + + # A closed issue. + CLOSED = 2 + end + end + + # IssueComment represents a comment on an issue. + # @!attribute [rw] name + # @return [::String] + # Identifier. Unique identifier for an issue comment. The comment id is + # generated by the server. Format: + # `projects/{project}/locations/{location}/repositories/{repository}/issues/{issue}/issueComments/{comment_id}` + # @!attribute [rw] body + # @return [::String] + # Required. The comment body. + # @!attribute [r] create_time + # @return [::Google::Protobuf::Timestamp] + # Output only. Creation timestamp. + # @!attribute [r] update_time + # @return [::Google::Protobuf::Timestamp] + # Output only. Last updated timestamp. + class IssueComment + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # PullRequestComment represents a comment on a pull request. + # @!attribute [rw] name + # @return [::String] + # Identifier. Unique identifier for the pull request comment. The comment id + # is generated by the server. Format: + # `projects/{project}/locations/{location}/repositories/{repository}/pullRequests/{pull_request}/pullRequestComments/{comment_id}` + # @!attribute [r] create_time + # @return [::Google::Protobuf::Timestamp] + # Output only. Creation timestamp. + # @!attribute [r] update_time + # @return [::Google::Protobuf::Timestamp] + # Output only. Last updated timestamp. + # @!attribute [rw] review + # @return [::Google::Cloud::SecureSourceManager::V1::PullRequestComment::Review] + # Optional. The review summary comment. + # + # Note: The following fields are mutually exclusive: `review`, `comment`, `code`. If a field in that set is populated, all other fields in the set will automatically be cleared. + # @!attribute [rw] comment + # @return [::Google::Cloud::SecureSourceManager::V1::PullRequestComment::Comment] + # Optional. The general pull request comment. + # + # Note: The following fields are mutually exclusive: `comment`, `review`, `code`. If a field in that set is populated, all other fields in the set will automatically be cleared. + # @!attribute [rw] code + # @return [::Google::Cloud::SecureSourceManager::V1::PullRequestComment::Code] + # Optional. The comment on a code line. + # + # Note: The following fields are mutually exclusive: `code`, `review`, `comment`. If a field in that set is populated, all other fields in the set will automatically be cleared. + class PullRequestComment + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # The review summary comment. + # @!attribute [rw] action_type + # @return [::Google::Cloud::SecureSourceManager::V1::PullRequestComment::Review::ActionType] + # Required. The review action type. + # @!attribute [rw] body + # @return [::String] + # Optional. The comment body. + # @!attribute [r] effective_commit_sha + # @return [::String] + # Output only. The effective commit sha this review is pointing to. + class Review + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # The review action type. + module ActionType + # Unspecified. + ACTION_TYPE_UNSPECIFIED = 0 + + # A general review comment. + COMMENT = 1 + + # Change required from this review. + CHANGE_REQUESTED = 2 + + # Change approved from this review. + APPROVED = 3 + end + end + + # The general pull request comment. + # @!attribute [rw] body + # @return [::String] + # Required. The comment body. + class Comment + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # The comment on a code line. + # @!attribute [rw] body + # @return [::String] + # Required. The comment body. + # @!attribute [rw] reply + # @return [::String] + # Optional. Input only. The PullRequestComment resource name that this + # comment is replying to. + # @!attribute [rw] position + # @return [::Google::Cloud::SecureSourceManager::V1::PullRequestComment::Position] + # Optional. The position of the comment. + # @!attribute [r] effective_root_comment + # @return [::String] + # Output only. The root comment of the conversation, derived from the reply + # field. + # @!attribute [r] resolved + # @return [::Boolean] + # Output only. Boolean indicator if the comment is resolved. + # @!attribute [r] effective_commit_sha + # @return [::String] + # Output only. The effective commit sha this code comment is pointing to. + class Code + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # The position of the code comment. + # @!attribute [rw] path + # @return [::String] + # Required. The path of the file. + # @!attribute [rw] line + # @return [::Integer] + # Required. The line number of the comment. Positive value means it's on + # the new side of the diff, negative value means it's on the old side. + class Position + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end + + # ListInstancesRequest is the request to list instances. + # @!attribute [rw] parent + # @return [::String] + # Required. Parent value for ListInstancesRequest. + # @!attribute [rw] page_size + # @return [::Integer] + # Requested page size. Server may return fewer items than requested. + # If unspecified, server will pick an appropriate default. + # @!attribute [rw] page_token + # @return [::String] + # A token identifying a page of results the server should return. + # @!attribute [rw] filter + # @return [::String] + # Filter for filtering results. + # @!attribute [rw] order_by + # @return [::String] + # Hint for how to order the results. + class ListInstancesRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # @!attribute [rw] instances + # @return [::Array<::Google::Cloud::SecureSourceManager::V1::Instance>] + # The list of instances. + # @!attribute [rw] next_page_token + # @return [::String] + # A token identifying a page of results the server should return. + # @!attribute [rw] unreachable + # @return [::Array<::String>] + # Locations that could not be reached. + class ListInstancesResponse + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # GetInstanceRequest is the request for getting an instance. + # @!attribute [rw] name + # @return [::String] + # Required. Name of the resource. + class GetInstanceRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # CreateInstanceRequest is the request for creating an instance. + # @!attribute [rw] parent + # @return [::String] + # Required. Value for parent. + # @!attribute [rw] instance_id + # @return [::String] + # Required. ID of the instance to be created. + # @!attribute [rw] instance + # @return [::Google::Cloud::SecureSourceManager::V1::Instance] + # Required. The resource being created. + # @!attribute [rw] request_id + # @return [::String] + # Optional. An optional request ID to identify requests. Specify a unique + # request ID so that if you must retry your request, the server will know to + # ignore the request if it has already been completed. The server will + # guarantee that for at least 60 minutes since the first request. + # + # For example, consider a situation where you make an initial request and + # the request times out. If you make the request again with the same request + # ID, the server can check if original operation with the same request ID + # was received, and if so, will ignore the second request. This prevents + # clients from accidentally creating duplicate commitments. + # + # The request ID must be a valid UUID with the exception that zero UUID is + # not supported (00000000-0000-0000-0000-000000000000). + class CreateInstanceRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # DeleteInstanceRequest is the request for deleting an instance. + # @!attribute [rw] name + # @return [::String] + # Required. Name of the resource. + # @!attribute [rw] request_id + # @return [::String] + # Optional. An optional request ID to identify requests. Specify a unique + # request ID so that if you must retry your request, the server will know to + # ignore the request if it has already been completed. The server will + # guarantee that for at least 60 minutes after the first request. + # + # For example, consider a situation where you make an initial request and + # the request times out. If you make the request again with the same request + # ID, the server can check if original operation with the same request ID + # was received, and if so, will ignore the second request. This prevents + # clients from accidentally creating duplicate commitments. + # + # The request ID must be a valid UUID with the exception that zero UUID is + # not supported (00000000-0000-0000-0000-000000000000). + class DeleteInstanceRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Represents the metadata of the long-running operation. + # @!attribute [r] create_time + # @return [::Google::Protobuf::Timestamp] + # Output only. The time the operation was created. + # @!attribute [r] end_time + # @return [::Google::Protobuf::Timestamp] + # Output only. The time the operation finished running. + # @!attribute [r] target + # @return [::String] + # Output only. Server-defined resource path for the target of the operation. + # @!attribute [r] verb + # @return [::String] + # Output only. Name of the verb executed by the operation. + # @!attribute [r] status_message + # @return [::String] + # Output only. Human-readable status of the operation, if any. + # @!attribute [r] requested_cancellation + # @return [::Boolean] + # Output only. Identifies whether the user has requested cancellation + # of the operation. Operations that have successfully been cancelled + # have {::Google::Longrunning::Operation#error 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 + + # ListRepositoriesRequest is request to list repositories. + # @!attribute [rw] parent + # @return [::String] + # Required. Parent value for ListRepositoriesRequest. + # @!attribute [rw] page_size + # @return [::Integer] + # Optional. Requested page size. Server may return fewer items than + # requested. If unspecified, server will pick an appropriate default. + # @!attribute [rw] page_token + # @return [::String] + # A token identifying a page of results the server should return. + # @!attribute [rw] filter + # @return [::String] + # Optional. Filter results. + # @!attribute [rw] instance + # @return [::String] + # Optional. The name of the instance in which the repository is hosted, + # formatted as + # `projects/{project_number}/locations/{location_id}/instances/{instance_id}`. + # When listing repositories via securesourcemanager.googleapis.com, this + # field is required. When listing repositories via *.sourcemanager.dev, this + # field is ignored. + class ListRepositoriesRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # @!attribute [rw] repositories + # @return [::Array<::Google::Cloud::SecureSourceManager::V1::Repository>] + # The list of repositories. + # @!attribute [rw] next_page_token + # @return [::String] + # A token identifying a page of results the server should return. + class ListRepositoriesResponse + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # GetRepositoryRequest is the request for getting a repository. + # @!attribute [rw] name + # @return [::String] + # Required. Name of the repository to retrieve. + # The format is + # `projects/{project_number}/locations/{location_id}/repositories/{repository_id}`. + class GetRepositoryRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # CreateRepositoryRequest is the request for creating a repository. + # @!attribute [rw] parent + # @return [::String] + # Required. The project in which to create the repository. Values are of the + # form `projects/{project_number}/locations/{location_id}` + # @!attribute [rw] repository + # @return [::Google::Cloud::SecureSourceManager::V1::Repository] + # Required. The resource being created. + # @!attribute [rw] repository_id + # @return [::String] + # Required. The ID to use for the repository, which will become the final + # component of the repository's resource name. This value should be 4-63 + # characters, and valid characters are /[a-z][0-9]-/. + class CreateRepositoryRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # UpdateRepositoryRequest is the request to update a repository. + # @!attribute [rw] update_mask + # @return [::Google::Protobuf::FieldMask] + # Optional. Field mask is used to specify the fields to be overwritten in the + # repository resource by the update. + # The fields specified in the update_mask are relative to the resource, not + # the full request. A field will be overwritten if it is in the mask. If the + # user does not provide a mask then all fields will be overwritten. + # @!attribute [rw] repository + # @return [::Google::Cloud::SecureSourceManager::V1::Repository] + # Required. The repository being updated. + # @!attribute [rw] validate_only + # @return [::Boolean] + # Optional. False by default. If set to true, the request is validated and + # the user is provided with an expected result, but no actual change is made. + class UpdateRepositoryRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # DeleteRepositoryRequest is the request to delete a repository. + # @!attribute [rw] name + # @return [::String] + # Required. Name of the repository to delete. + # The format is + # `projects/{project_number}/locations/{location_id}/repositories/{repository_id}`. + # @!attribute [rw] allow_missing + # @return [::Boolean] + # Optional. If set to true, and the repository is not found, the request will + # succeed but no action will be taken on the server. + class DeleteRepositoryRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # ListHooksRequest is request to list hooks. + # @!attribute [rw] parent + # @return [::String] + # Required. Parent value for ListHooksRequest. + # @!attribute [rw] page_size + # @return [::Integer] + # Optional. Requested page size. Server may return fewer items than + # requested. If unspecified, server will pick an appropriate default. + # @!attribute [rw] page_token + # @return [::String] + # Optional. A token identifying a page of results the server should return. + class ListHooksRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # ListHooksResponse is response to list hooks. + # @!attribute [rw] hooks + # @return [::Array<::Google::Cloud::SecureSourceManager::V1::Hook>] + # The list of hooks. + # @!attribute [rw] next_page_token + # @return [::String] + # A token identifying a page of results the server should return. + class ListHooksResponse + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # GetHookRequest is the request for getting a hook. + # @!attribute [rw] name + # @return [::String] + # Required. Name of the hook to retrieve. + # The format is + # `projects/{project_number}/locations/{location_id}/repositories/{repository_id}/hooks/{hook_id}`. + class GetHookRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # CreateHookRequest is the request for creating a hook. + # @!attribute [rw] parent + # @return [::String] + # Required. The repository in which to create the hook. Values are of the + # form + # `projects/{project_number}/locations/{location_id}/repositories/{repository_id}` + # @!attribute [rw] hook + # @return [::Google::Cloud::SecureSourceManager::V1::Hook] + # Required. The resource being created. + # @!attribute [rw] hook_id + # @return [::String] + # Required. The ID to use for the hook, which will become the final component + # of the hook's resource name. This value restricts to lower-case letters, + # numbers, and hyphen, with the first character a letter, the last a letter + # or a number, and a 63 character maximum. + class CreateHookRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # UpdateHookRequest is the request to update a hook. + # @!attribute [rw] update_mask + # @return [::Google::Protobuf::FieldMask] + # Required. Field mask is used to specify the fields to be overwritten in the + # hook resource by the update. + # The fields specified in the update_mask are relative to the resource, not + # the full request. A field will be overwritten if it is in the mask. + # The special value "*" means full replacement. + # @!attribute [rw] hook + # @return [::Google::Cloud::SecureSourceManager::V1::Hook] + # Required. The hook being updated. + class UpdateHookRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # DeleteHookRequest is the request to delete a hook. + # @!attribute [rw] name + # @return [::String] + # Required. Name of the hook to delete. + # The format is + # `projects/{project_number}/locations/{location_id}/repositories/{repository_id}/hooks/{hook_id}`. + class DeleteHookRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # GetBranchRuleRequest is the request for getting a branch rule. + # @!attribute [rw] name + # @return [::String] + # Required. Name of the repository to retrieve. + # The format is + # `projects/{project}/locations/{location}/repositories/{repository}/branchRules/{branch_rule}`. + class GetBranchRuleRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # CreateBranchRuleRequest is the request to create a branch rule. + # @!attribute [rw] parent + # @return [::String] + # @!attribute [rw] branch_rule + # @return [::Google::Cloud::SecureSourceManager::V1::BranchRule] + # @!attribute [rw] branch_rule_id + # @return [::String] + class CreateBranchRuleRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # ListBranchRulesRequest is the request to list branch rules. + # @!attribute [rw] parent + # @return [::String] + # @!attribute [rw] page_size + # @return [::Integer] + # @!attribute [rw] page_token + # @return [::String] + class ListBranchRulesRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # DeleteBranchRuleRequest is the request to delete a branch rule. + # @!attribute [rw] name + # @return [::String] + # @!attribute [rw] allow_missing + # @return [::Boolean] + # Optional. If set to true, and the branch rule is not found, the request + # will succeed but no action will be taken on the server. + class DeleteBranchRuleRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # UpdateBranchRuleRequest is the request to update a branchRule. + # @!attribute [rw] branch_rule + # @return [::Google::Cloud::SecureSourceManager::V1::BranchRule] + # @!attribute [rw] validate_only + # @return [::Boolean] + # Optional. If set, validate the request and preview the review, but do not + # actually post it. (https://google.aip.dev/163, for declarative friendly) + # @!attribute [rw] update_mask + # @return [::Google::Protobuf::FieldMask] + # Required. Field mask is used to specify the fields to be overwritten in the + # branchRule resource by the update. + # The fields specified in the update_mask are relative to the resource, not + # the full request. A field will be overwritten if it is in the mask. + # The special value "*" means full replacement. + class UpdateBranchRuleRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # ListBranchRulesResponse is the response to listing branchRules. + # @!attribute [rw] branch_rules + # @return [::Array<::Google::Cloud::SecureSourceManager::V1::BranchRule>] + # The list of branch rules. + # @!attribute [rw] next_page_token + # @return [::String] + # A token identifying a page of results the server should return. + class ListBranchRulesResponse + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # CreatePullRequestRequest is the request to create a pull request. + # @!attribute [rw] parent + # @return [::String] + # Required. The repository that the pull request is created from. Format: + # `projects/{project_number}/locations/{location_id}/repositories/{repository_id}` + # @!attribute [rw] pull_request + # @return [::Google::Cloud::SecureSourceManager::V1::PullRequest] + # Required. The pull request to create. + class CreatePullRequestRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # GetPullRequestRequest is the request to get a pull request. + # @!attribute [rw] name + # @return [::String] + # Required. Name of the pull request to retrieve. + # The format is + # `projects/{project}/locations/{location}/repositories/{repository}/pullRequests/{pull_request}`. + class GetPullRequestRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # ListPullRequestsRequest is the request to list pull requests. + # @!attribute [rw] parent + # @return [::String] + # Required. The repository in which to list pull requests. Format: + # `projects/{project_number}/locations/{location_id}/repositories/{repository_id}` + # @!attribute [rw] page_size + # @return [::Integer] + # Optional. Requested page size. Server may return fewer items than + # requested. If unspecified, server will pick an appropriate default. + # @!attribute [rw] page_token + # @return [::String] + # Optional. A token identifying a page of results the server should return. + class ListPullRequestsRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # ListPullRequestsResponse is the response to list pull requests. + # @!attribute [rw] pull_requests + # @return [::Array<::Google::Cloud::SecureSourceManager::V1::PullRequest>] + # The list of pull requests. + # @!attribute [rw] next_page_token + # @return [::String] + # A token identifying a page of results the server should return. + class ListPullRequestsResponse + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # UpdatePullRequestRequest is the request to update a pull request. + # @!attribute [rw] pull_request + # @return [::Google::Cloud::SecureSourceManager::V1::PullRequest] + # Required. The pull request to update. + # @!attribute [rw] update_mask + # @return [::Google::Protobuf::FieldMask] + # Optional. Field mask is used to specify the fields to be overwritten in the + # pull request resource by the update. + # The fields specified in the update_mask are relative to the resource, not + # the full request. A field will be overwritten if it is in the mask. + # The special value "*" means full replacement. + class UpdatePullRequestRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # MergePullRequestRequest is the request to merge a pull request. + # @!attribute [rw] name + # @return [::String] + # Required. The pull request to merge. + # Format: + # `projects/{project_number}/locations/{location_id}/repositories/{repository_id}/pullRequests/{pull_request_id}` + class MergePullRequestRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # OpenPullRequestRequest is the request to open a pull request. + # @!attribute [rw] name + # @return [::String] + # Required. The pull request to open. + # Format: + # `projects/{project_number}/locations/{location_id}/repositories/{repository_id}/pullRequests/{pull_request_id}` + class OpenPullRequestRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # ClosePullRequestRequest is the request to close a pull request. + # @!attribute [rw] name + # @return [::String] + # Required. The pull request to close. + # Format: + # `projects/{project_number}/locations/{location_id}/repositories/{repository_id}/pullRequests/{pull_request_id}` + class ClosePullRequestRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # ListPullRequestFileDiffsRequest is the request to list pull request file + # diffs. + # @!attribute [rw] name + # @return [::String] + # Required. The pull request to list file diffs for. + # Format: + # `projects/{project_number}/locations/{location_id}/repositories/{repository_id}/pullRequests/{pull_request_id}` + # @!attribute [rw] page_size + # @return [::Integer] + # Optional. Requested page size. Server may return fewer items than + # requested. If unspecified, server will pick an appropriate default. + # @!attribute [rw] page_token + # @return [::String] + # Optional. A token identifying a page of results the server should return. + class ListPullRequestFileDiffsRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # ListPullRequestFileDiffsResponse is the response containing file diffs + # returned from ListPullRequestFileDiffs. + # @!attribute [rw] file_diffs + # @return [::Array<::Google::Cloud::SecureSourceManager::V1::FileDiff>] + # The list of pull request file diffs. + # @!attribute [rw] next_page_token + # @return [::String] + # A token identifying a page of results the server should return. + class ListPullRequestFileDiffsResponse + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # The request to create an issue. + # @!attribute [rw] parent + # @return [::String] + # Required. The repository in which to create the issue. Format: + # `projects/{project_number}/locations/{location_id}/repositories/{repository_id}` + # @!attribute [rw] issue + # @return [::Google::Cloud::SecureSourceManager::V1::Issue] + # Required. The issue to create. + class CreateIssueRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # The request to get an issue. + # @!attribute [rw] name + # @return [::String] + # Required. Name of the issue to retrieve. + # The format is + # `projects/{project}/locations/{location}/repositories/{repository}/issues/{issue_id}`. + class GetIssueRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # The request to list issues. + # @!attribute [rw] parent + # @return [::String] + # Required. The repository in which to list issues. Format: + # `projects/{project_number}/locations/{location_id}/repositories/{repository_id}` + # @!attribute [rw] page_size + # @return [::Integer] + # Optional. Requested page size. Server may return fewer items than + # requested. If unspecified, server will pick an appropriate default. + # @!attribute [rw] page_token + # @return [::String] + # Optional. A token identifying a page of results the server should return. + # @!attribute [rw] filter + # @return [::String] + # Optional. Used to filter the resulting issues list. + class ListIssuesRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # The response to list issues. + # @!attribute [rw] issues + # @return [::Array<::Google::Cloud::SecureSourceManager::V1::Issue>] + # The list of issues. + # @!attribute [rw] next_page_token + # @return [::String] + # A token identifying a page of results the server should return. + class ListIssuesResponse + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # The request to update an issue. + # @!attribute [rw] issue + # @return [::Google::Cloud::SecureSourceManager::V1::Issue] + # Required. The issue to update. + # @!attribute [rw] update_mask + # @return [::Google::Protobuf::FieldMask] + # Optional. Field mask is used to specify the fields to be overwritten in the + # issue resource by the update. + # The fields specified in the update_mask are relative to the resource, not + # the full request. A field will be overwritten if it is in the mask. + # The special value "*" means full replacement. + class UpdateIssueRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # The request to delete an issue. + # @!attribute [rw] name + # @return [::String] + # Required. Name of the issue to delete. + # The format is + # `projects/{project_number}/locations/{location_id}/repositories/{repository_id}/issues/{issue_id}`. + # @!attribute [rw] etag + # @return [::String] + # Optional. The current etag of the issue. + # If the etag is provided and does not match the current etag of the issue, + # deletion will be blocked and an ABORTED error will be returned. + class DeleteIssueRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # The request to close an issue. + # @!attribute [rw] name + # @return [::String] + # Required. Name of the issue to close. + # The format is + # `projects/{project_number}/locations/{location_id}/repositories/{repository_id}/issues/{issue_id}`. + # @!attribute [rw] etag + # @return [::String] + # Optional. The current etag of the issue. + # If the etag is provided and does not match the current etag of the issue, + # closing will be blocked and an ABORTED error will be returned. + class CloseIssueRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # The request to open an issue. + # @!attribute [rw] name + # @return [::String] + # Required. Name of the issue to open. + # The format is + # `projects/{project_number}/locations/{location_id}/repositories/{repository_id}/issues/{issue_id}`. + # @!attribute [rw] etag + # @return [::String] + # Optional. The current etag of the issue. + # If the etag is provided and does not match the current etag of the issue, + # opening will be blocked and an ABORTED error will be returned. + class OpenIssueRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Represents an entry within a tree structure (like a Git tree). + # @!attribute [r] type + # @return [::Google::Cloud::SecureSourceManager::V1::TreeEntry::ObjectType] + # Output only. The type of the object (TREE, BLOB, COMMIT). Output-only. + # @!attribute [r] sha + # @return [::String] + # Output only. The SHA-1 hash of the object (unique identifier). Output-only. + # @!attribute [r] path + # @return [::String] + # Output only. The path of the file or directory within the tree (e.g., + # "src/main/java/MyClass.java"). Output-only. + # @!attribute [r] mode + # @return [::String] + # Output only. The file mode as a string (e.g., "100644"). Indicates file + # type. Output-only. + # @!attribute [r] size + # @return [::Integer] + # Output only. The size of the object in bytes (only for blobs). Output-only. + class TreeEntry + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # Defines the type of object the TreeEntry represents. + module ObjectType + # Default value, indicating the object type is unspecified. + OBJECT_TYPE_UNSPECIFIED = 0 + + # Represents a directory (folder). + TREE = 1 + + # Represents a file (contains file data). + BLOB = 2 + + # Represents a pointer to another repository (submodule). + COMMIT = 3 + end + end + + # Request message for fetching a tree structure from a repository. + # @!attribute [rw] repository + # @return [::String] + # Required. The format is + # `projects/{project_number}/locations/{location_id}/repositories/{repository_id}`. + # Specifies the repository to fetch the tree from. + # @!attribute [rw] ref + # @return [::String] + # Optional. `ref` can be a SHA-1 hash, a branch name, or a tag. Specifies + # which tree to fetch. If not specified, the default branch will be used. + # @!attribute [rw] recursive + # @return [::Boolean] + # Optional. If true, include all subfolders and their files in the response. + # If false, only the immediate children are returned. + # @!attribute [rw] page_size + # @return [::Integer] + # Optional. Requested page size. Server may return fewer items than + # requested. If unspecified, at most 10,000 items will be returned. + # @!attribute [rw] page_token + # @return [::String] + # Optional. A token identifying a page of results the server should return. + class FetchTreeRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Response message containing a list of TreeEntry objects. + # @!attribute [rw] tree_entries + # @return [::Array<::Google::Cloud::SecureSourceManager::V1::TreeEntry>] + # The list of TreeEntry objects. + # @!attribute [rw] next_page_token + # @return [::String] + # A token identifying a page of results the server should return. + class FetchTreeResponse + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Request message for fetching a blob (file content) from a repository. + # @!attribute [rw] repository + # @return [::String] + # Required. The format is + # `projects/{project_number}/locations/{location_id}/repositories/{repository_id}`. + # Specifies the repository containing the blob. + # @!attribute [rw] sha + # @return [::String] + # Required. The SHA-1 hash of the blob to retrieve. + class FetchBlobRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Response message containing the content of a blob. + # @!attribute [rw] sha + # @return [::String] + # The SHA-1 hash of the blob. + # @!attribute [rw] content + # @return [::String] + # The content of the blob, encoded as base64. + class FetchBlobResponse + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # The request to list pull request comments. + # @!attribute [rw] parent + # @return [::String] + # Required. The pull request in which to list pull request comments. Format: + # `projects/{project_number}/locations/{location_id}/repositories/{repository_id}/pullRequests/{pull_request_id}` + # @!attribute [rw] page_size + # @return [::Integer] + # Optional. Requested page size. If unspecified, at most 100 pull request + # comments will be returned. The maximum value is 100; values above 100 will + # be coerced to 100. + # @!attribute [rw] page_token + # @return [::String] + # Optional. A token identifying a page of results the server should return. + class ListPullRequestCommentsRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # The response to list pull request comments. + # @!attribute [rw] pull_request_comments + # @return [::Array<::Google::Cloud::SecureSourceManager::V1::PullRequestComment>] + # The list of pull request comments. + # @!attribute [rw] next_page_token + # @return [::String] + # A token to set as page_token to retrieve the next page. If this field is + # omitted, there are no subsequent pages. + class ListPullRequestCommentsResponse + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # The request to create a pull request comment. + # @!attribute [rw] parent + # @return [::String] + # Required. The pull request in which to create the pull request comment. + # Format: + # `projects/{project_number}/locations/{location_id}/repositories/{repository_id}/pullRequests/{pull_request_id}` + # @!attribute [rw] pull_request_comment + # @return [::Google::Cloud::SecureSourceManager::V1::PullRequestComment] + # Required. The pull request comment to create. + class CreatePullRequestCommentRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # The request to batch create pull request comments. + # @!attribute [rw] parent + # @return [::String] + # Required. The pull request in which to create the pull request comments. + # Format: + # `projects/{project_number}/locations/{location_id}/repositories/{repository_id}/pullRequests/{pull_request_id}` + # @!attribute [rw] requests + # @return [::Array<::Google::Cloud::SecureSourceManager::V1::CreatePullRequestCommentRequest>] + # Required. The request message specifying the resources to create. There + # should be exactly one CreatePullRequestCommentRequest with CommentDetail + # being REVIEW in the list, and no more than 100 + # CreatePullRequestCommentRequests with CommentDetail being CODE in the list + class BatchCreatePullRequestCommentsRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # The response to batch create pull request comments. + # @!attribute [rw] pull_request_comments + # @return [::Array<::Google::Cloud::SecureSourceManager::V1::PullRequestComment>] + # The list of pull request comments created. + class BatchCreatePullRequestCommentsResponse + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # The request to update a pull request comment. + # @!attribute [rw] pull_request_comment + # @return [::Google::Cloud::SecureSourceManager::V1::PullRequestComment] + # Required. The pull request comment to update. + # @!attribute [rw] update_mask + # @return [::Google::Protobuf::FieldMask] + # Optional. Field mask is used to specify the fields to be overwritten in the + # pull request comment resource by the update. Updatable fields are + # `body`. + class UpdatePullRequestCommentRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # The request to delete a pull request comment. A Review PullRequestComment + # cannot be deleted. + # @!attribute [rw] name + # @return [::String] + # Required. Name of the pull request comment to delete. + # The format is + # `projects/{project_number}/locations/{location_id}/repositories/{repository_id}/pullRequests/{pull_request_id}/pullRequestComments/{comment_id}`. + class DeletePullRequestCommentRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # The request to get a pull request comment. + # @!attribute [rw] name + # @return [::String] + # Required. Name of the pull request comment to retrieve. + # The format is + # `projects/{project_number}/locations/{location_id}/repositories/{repository_id}/pullRequests/{pull_request_id}/pullRequestComments/{comment_id}`. + class GetPullRequestCommentRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # The request to resolve multiple pull request comments. + # @!attribute [rw] parent + # @return [::String] + # Required. The pull request in which to resolve the pull request comments. + # Format: + # `projects/{project_number}/locations/{location_id}/repositories/{repository_id}/pullRequests/{pull_request_id}` + # @!attribute [rw] names + # @return [::Array<::String>] + # Required. The names of the pull request comments to resolve. Format: + # `projects/{project_number}/locations/{location_id}/repositories/{repository_id}/pullRequests/{pull_request_id}/pullRequestComments/{comment_id}` + # Only comments from the same threads are allowed in the same request. + # @!attribute [rw] auto_fill + # @return [::Boolean] + # Optional. If set, at least one comment in a thread is required, rest of the + # comments in the same thread will be automatically updated to resolved. If + # unset, all comments in the same thread need be present. + class ResolvePullRequestCommentsRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # The response to resolve multiple pull request comments. + # @!attribute [rw] pull_request_comments + # @return [::Array<::Google::Cloud::SecureSourceManager::V1::PullRequestComment>] + # The list of pull request comments resolved. + class ResolvePullRequestCommentsResponse + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # The request to unresolve multiple pull request comments. + # @!attribute [rw] parent + # @return [::String] + # Required. The pull request in which to resolve the pull request comments. + # Format: + # `projects/{project_number}/locations/{location_id}/repositories/{repository_id}/pullRequests/{pull_request_id}` + # @!attribute [rw] names + # @return [::Array<::String>] + # Required. The names of the pull request comments to unresolve. Format: + # `projects/{project_number}/locations/{location_id}/repositories/{repository_id}/pullRequests/{pull_request_id}/pullRequestComments/{comment_id}` + # Only comments from the same threads are allowed in the same request. + # @!attribute [rw] auto_fill + # @return [::Boolean] + # Optional. If set, at least one comment in a thread is required, rest of the + # comments in the same thread will be automatically updated to unresolved. If + # unset, all comments in the same thread need be present. + class UnresolvePullRequestCommentsRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # The response to unresolve multiple pull request comments. + # @!attribute [rw] pull_request_comments + # @return [::Array<::Google::Cloud::SecureSourceManager::V1::PullRequestComment>] + # The list of pull request comments unresolved. + class UnresolvePullRequestCommentsResponse + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # The request to create an issue comment. + # @!attribute [rw] parent + # @return [::String] + # Required. The issue in which to create the issue comment. Format: + # `projects/{project_number}/locations/{location_id}/repositories/{repository_id}/issues/{issue_id}` + # @!attribute [rw] issue_comment + # @return [::Google::Cloud::SecureSourceManager::V1::IssueComment] + # Required. The issue comment to create. + class CreateIssueCommentRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # The request to get an issue comment. + # @!attribute [rw] name + # @return [::String] + # Required. Name of the issue comment to retrieve. + # The format is + # `projects/{project}/locations/{location}/repositories/{repository}/issues/{issue_id}/issueComments/{comment_id}`. + class GetIssueCommentRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # The request to list issue comments. + # @!attribute [rw] parent + # @return [::String] + # Required. The issue in which to list the comments. Format: + # `projects/{project_number}/locations/{location_id}/repositories/{repository_id}/issues/{issue_id}` + # @!attribute [rw] page_size + # @return [::Integer] + # Optional. Requested page size. Server may return fewer items than + # requested. If unspecified, server will pick an appropriate default. + # @!attribute [rw] page_token + # @return [::String] + # Optional. A token identifying a page of results the server should return. + class ListIssueCommentsRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # The response to list issue comments. + # @!attribute [rw] issue_comments + # @return [::Array<::Google::Cloud::SecureSourceManager::V1::IssueComment>] + # The list of issue comments. + # @!attribute [rw] next_page_token + # @return [::String] + # A token identifying a page of results the server should return. + class ListIssueCommentsResponse + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # The request to update an issue comment. + # @!attribute [rw] issue_comment + # @return [::Google::Cloud::SecureSourceManager::V1::IssueComment] + # Required. The issue comment to update. + # @!attribute [rw] update_mask + # @return [::Google::Protobuf::FieldMask] + # Optional. Field mask is used to specify the fields to be overwritten in the + # issue comment resource by the update. + # The fields specified in the update_mask are relative to the resource, not + # the full request. A field will be overwritten if it is in the mask. + # The special value "*" means full replacement. + class UpdateIssueCommentRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # The request to delete an issue comment. + # @!attribute [rw] name + # @return [::String] + # Required. Name of the issue comment to delete. + # The format is + # `projects/{project_number}/locations/{location_id}/repositories/{repository_id}/issues/{issue_id}/issueComments/{comment_id}`. + class DeleteIssueCommentRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-secure_source_manager-v1/proto_docs/google/longrunning/operations.rb b/owl-bot-staging/google-cloud-secure_source_manager-v1/proto_docs/google/longrunning/operations.rb new file mode 100644 index 000000000000..7a757f512165 --- /dev/null +++ b/owl-bot-staging/google-cloud-secure_source_manager-v1/proto_docs/google/longrunning/operations.rb @@ -0,0 +1,191 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + + +module Google + module Longrunning + # This resource represents a long-running operation that is the result of a + # network API call. + # @!attribute [rw] name + # @return [::String] + # The server-assigned name, which is only unique within the same service that + # originally returns it. If you use the default HTTP mapping, the + # `name` should be a resource name ending with `operations/{unique_id}`. + # @!attribute [rw] metadata + # @return [::Google::Protobuf::Any] + # Service-specific metadata associated with the operation. It typically + # contains progress information and common metadata such as create time. + # Some services might not provide such metadata. Any method that returns a + # long-running operation should document the metadata type, if any. + # @!attribute [rw] done + # @return [::Boolean] + # If the value is `false`, it means the operation is still in progress. + # If `true`, the operation is completed, and either `error` or `response` is + # available. + # @!attribute [rw] error + # @return [::Google::Rpc::Status] + # The error result of the operation in case of failure or cancellation. + # + # Note: The following fields are mutually exclusive: `error`, `response`. If a field in that set is populated, all other fields in the set will automatically be cleared. + # @!attribute [rw] response + # @return [::Google::Protobuf::Any] + # The normal, successful response of the operation. If the original + # method returns no data on success, such as `Delete`, the response is + # `google.protobuf.Empty`. If the original method is standard + # `Get`/`Create`/`Update`, the response should be the resource. For other + # methods, the response should have the type `XxxResponse`, where `Xxx` + # is the original method name. For example, if the original method name + # is `TakeSnapshot()`, the inferred response type is + # `TakeSnapshotResponse`. + # + # Note: The following fields are mutually exclusive: `response`, `error`. If a field in that set is populated, all other fields in the set will automatically be cleared. + class Operation + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # The request message for + # Operations.GetOperation. + # @!attribute [rw] name + # @return [::String] + # The name of the operation resource. + class GetOperationRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # The request message for + # Operations.ListOperations. + # @!attribute [rw] name + # @return [::String] + # The name of the operation's parent resource. + # @!attribute [rw] filter + # @return [::String] + # The standard list filter. + # @!attribute [rw] page_size + # @return [::Integer] + # The standard list page size. + # @!attribute [rw] page_token + # @return [::String] + # The standard list page token. + # @!attribute [rw] return_partial_success + # @return [::Boolean] + # When set to `true`, operations that are reachable are returned as normal, + # and those that are unreachable are returned in the + # [ListOperationsResponse.unreachable] field. + # + # This can only be `true` when reading across collections e.g. when `parent` + # is set to `"projects/example/locations/-"`. + # + # This field is not by default supported and will result in an + # `UNIMPLEMENTED` error if set unless explicitly documented otherwise in + # service or product specific documentation. + class ListOperationsRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # The response message for + # Operations.ListOperations. + # @!attribute [rw] operations + # @return [::Array<::Google::Longrunning::Operation>] + # A list of operations that matches the specified filter in the request. + # @!attribute [rw] next_page_token + # @return [::String] + # The standard List next-page token. + # @!attribute [rw] unreachable + # @return [::Array<::String>] + # Unordered list. Unreachable resources. Populated when the request sets + # `ListOperationsRequest.return_partial_success` and reads across + # collections e.g. when attempting to list all resources across all supported + # locations. + class ListOperationsResponse + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # The request message for + # Operations.CancelOperation. + # @!attribute [rw] name + # @return [::String] + # The name of the operation resource to be cancelled. + class CancelOperationRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # The request message for + # Operations.DeleteOperation. + # @!attribute [rw] name + # @return [::String] + # The name of the operation resource to be deleted. + class DeleteOperationRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # The request message for + # Operations.WaitOperation. + # @!attribute [rw] name + # @return [::String] + # The name of the operation resource to wait on. + # @!attribute [rw] timeout + # @return [::Google::Protobuf::Duration] + # The maximum duration to wait before timing out. If left blank, the wait + # will be at most the time permitted by the underlying HTTP/RPC protocol. + # If RPC context deadline is also specified, the shorter one will be used. + class WaitOperationRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # A message representing the message types used by a long-running operation. + # + # Example: + # + # rpc Export(ExportRequest) returns (google.longrunning.Operation) { + # option (google.longrunning.operation_info) = { + # response_type: "ExportResponse" + # metadata_type: "ExportMetadata" + # }; + # } + # @!attribute [rw] response_type + # @return [::String] + # Required. The message name of the primary return type for this + # long-running operation. + # This type will be used to deserialize the LRO's response. + # + # If the response is in a different package from the rpc, a fully-qualified + # message name must be used (e.g. `google.protobuf.Struct`). + # + # Note: Altering this value constitutes a breaking change. + # @!attribute [rw] metadata_type + # @return [::String] + # Required. The message name of the metadata type for this long-running + # operation. + # + # If the response is in a different package from the rpc, a fully-qualified + # message name must be used (e.g. `google.protobuf.Struct`). + # + # Note: Altering this value constitutes a breaking change. + class OperationInfo + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end +end diff --git a/owl-bot-staging/google-cloud-secure_source_manager-v1/proto_docs/google/protobuf/any.rb b/owl-bot-staging/google-cloud-secure_source_manager-v1/proto_docs/google/protobuf/any.rb new file mode 100644 index 000000000000..58691995f02e --- /dev/null +++ b/owl-bot-staging/google-cloud-secure_source_manager-v1/proto_docs/google/protobuf/any.rb @@ -0,0 +1,145 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + + +module Google + module Protobuf + # `Any` contains an arbitrary serialized protocol buffer message along with a + # URL that describes the type of the serialized message. + # + # Protobuf library provides support to pack/unpack Any values in the form + # of utility functions or additional generated methods of the Any type. + # + # Example 1: Pack and unpack a message in C++. + # + # Foo foo = ...; + # Any any; + # any.PackFrom(foo); + # ... + # if (any.UnpackTo(&foo)) { + # ... + # } + # + # Example 2: Pack and unpack a message in Java. + # + # Foo foo = ...; + # Any any = Any.pack(foo); + # ... + # if (any.is(Foo.class)) { + # foo = any.unpack(Foo.class); + # } + # // or ... + # if (any.isSameTypeAs(Foo.getDefaultInstance())) { + # foo = any.unpack(Foo.getDefaultInstance()); + # } + # + # Example 3: Pack and unpack a message in Python. + # + # foo = Foo(...) + # any = Any() + # any.Pack(foo) + # ... + # if any.Is(Foo.DESCRIPTOR): + # any.Unpack(foo) + # ... + # + # Example 4: Pack and unpack a message in Go + # + # foo := &pb.Foo{...} + # any, err := anypb.New(foo) + # if err != nil { + # ... + # } + # ... + # foo := &pb.Foo{} + # if err := any.UnmarshalTo(foo); err != nil { + # ... + # } + # + # The pack methods provided by protobuf library will by default use + # 'type.googleapis.com/full.type.name' as the type URL and the unpack + # methods only use the fully qualified type name after the last '/' + # in the type URL, for example "foo.bar.com/x/y.z" will yield type + # name "y.z". + # + # JSON + # ==== + # The JSON representation of an `Any` value uses the regular + # representation of the deserialized, embedded message, with an + # additional field `@type` which contains the type URL. Example: + # + # package google.profile; + # message Person { + # string first_name = 1; + # string last_name = 2; + # } + # + # { + # "@type": "type.googleapis.com/google.profile.Person", + # "firstName": , + # "lastName": + # } + # + # If the embedded message type is well-known and has a custom JSON + # representation, that representation will be embedded adding a field + # `value` which holds the custom JSON in addition to the `@type` + # field. Example (for message [google.protobuf.Duration][]): + # + # { + # "@type": "type.googleapis.com/google.protobuf.Duration", + # "value": "1.212s" + # } + # @!attribute [rw] type_url + # @return [::String] + # A URL/resource name that uniquely identifies the type of the serialized + # protocol buffer message. This string must contain at least + # one "/" character. The last segment of the URL's path must represent + # the fully qualified name of the type (as in + # `path/google.protobuf.Duration`). The name should be in a canonical form + # (e.g., leading "." is not accepted). + # + # In practice, teams usually precompile into the binary all types that they + # expect it to use in the context of Any. However, for URLs which use the + # scheme `http`, `https`, or no scheme, one can optionally set up a type + # server that maps type URLs to message definitions as follows: + # + # * If no scheme is provided, `https` is assumed. + # * An HTTP GET on the URL must yield a [google.protobuf.Type][] + # value in binary format, or produce an error. + # * Applications are allowed to cache lookup results based on the + # URL, or have them precompiled into a binary to avoid any + # lookup. Therefore, binary compatibility needs to be preserved + # on changes to types. (Use versioned type names to manage + # breaking changes.) + # + # Note: this functionality is not currently available in the official + # protobuf release, and it is not used for type URLs beginning with + # type.googleapis.com. As of May 2023, there are no widely used type server + # implementations and no plans to implement one. + # + # Schemes other than `http`, `https` (or the empty scheme) might be + # used with implementation specific semantics. + # @!attribute [rw] value + # @return [::String] + # Must be a valid serialized protocol buffer of the above specified type. + class Any + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end +end diff --git a/owl-bot-staging/google-cloud-secure_source_manager-v1/proto_docs/google/protobuf/duration.rb b/owl-bot-staging/google-cloud-secure_source_manager-v1/proto_docs/google/protobuf/duration.rb new file mode 100644 index 000000000000..ea59f1f91daf --- /dev/null +++ b/owl-bot-staging/google-cloud-secure_source_manager-v1/proto_docs/google/protobuf/duration.rb @@ -0,0 +1,98 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + + +module Google + module Protobuf + # A Duration represents a signed, fixed-length span of time represented + # as a count of seconds and fractions of seconds at nanosecond + # resolution. It is independent of any calendar and concepts like "day" + # or "month". It is related to Timestamp in that the difference between + # two Timestamp values is a Duration and it can be added or subtracted + # from a Timestamp. Range is approximately +-10,000 years. + # + # # Examples + # + # Example 1: Compute Duration from two Timestamps in pseudo code. + # + # Timestamp start = ...; + # Timestamp end = ...; + # Duration duration = ...; + # + # duration.seconds = end.seconds - start.seconds; + # duration.nanos = end.nanos - start.nanos; + # + # if (duration.seconds < 0 && duration.nanos > 0) { + # duration.seconds += 1; + # duration.nanos -= 1000000000; + # } else if (duration.seconds > 0 && duration.nanos < 0) { + # duration.seconds -= 1; + # duration.nanos += 1000000000; + # } + # + # Example 2: Compute Timestamp from Timestamp + Duration in pseudo code. + # + # Timestamp start = ...; + # Duration duration = ...; + # Timestamp end = ...; + # + # end.seconds = start.seconds + duration.seconds; + # end.nanos = start.nanos + duration.nanos; + # + # if (end.nanos < 0) { + # end.seconds -= 1; + # end.nanos += 1000000000; + # } else if (end.nanos >= 1000000000) { + # end.seconds += 1; + # end.nanos -= 1000000000; + # } + # + # Example 3: Compute Duration from datetime.timedelta in Python. + # + # td = datetime.timedelta(days=3, minutes=10) + # duration = Duration() + # duration.FromTimedelta(td) + # + # # JSON Mapping + # + # In JSON format, the Duration type is encoded as a string rather than an + # object, where the string ends in the suffix "s" (indicating seconds) and + # is preceded by the number of seconds, with nanoseconds expressed as + # fractional seconds. For example, 3 seconds with 0 nanoseconds should be + # encoded in JSON format as "3s", while 3 seconds and 1 nanosecond should + # be expressed in JSON format as "3.000000001s", and 3 seconds and 1 + # microsecond should be expressed in JSON format as "3.000001s". + # @!attribute [rw] seconds + # @return [::Integer] + # Signed seconds of the span of time. Must be from -315,576,000,000 + # to +315,576,000,000 inclusive. Note: these bounds are computed from: + # 60 sec/min * 60 min/hr * 24 hr/day * 365.25 days/year * 10000 years + # @!attribute [rw] nanos + # @return [::Integer] + # Signed fractions of a second at nanosecond resolution of the span + # of time. Durations less than one second are represented with a 0 + # `seconds` field and a positive or negative `nanos` field. For durations + # of one second or more, a non-zero value for the `nanos` field must be + # of the same sign as the `seconds` field. Must be from -999,999,999 + # to +999,999,999 inclusive. + class Duration + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end +end diff --git a/owl-bot-staging/google-cloud-secure_source_manager-v1/proto_docs/google/protobuf/empty.rb b/owl-bot-staging/google-cloud-secure_source_manager-v1/proto_docs/google/protobuf/empty.rb new file mode 100644 index 000000000000..83e4481834a6 --- /dev/null +++ b/owl-bot-staging/google-cloud-secure_source_manager-v1/proto_docs/google/protobuf/empty.rb @@ -0,0 +1,34 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + + +module Google + module Protobuf + # A generic empty message that you can re-use to avoid defining duplicated + # empty messages in your APIs. A typical example is to use it as the request + # or the response type of an API method. For instance: + # + # service Foo { + # rpc Bar(google.protobuf.Empty) returns (google.protobuf.Empty); + # } + class Empty + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end +end diff --git a/owl-bot-staging/google-cloud-secure_source_manager-v1/proto_docs/google/protobuf/field_mask.rb b/owl-bot-staging/google-cloud-secure_source_manager-v1/proto_docs/google/protobuf/field_mask.rb new file mode 100644 index 000000000000..7f3ffc78601a --- /dev/null +++ b/owl-bot-staging/google-cloud-secure_source_manager-v1/proto_docs/google/protobuf/field_mask.rb @@ -0,0 +1,229 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + + +module Google + module Protobuf + # `FieldMask` represents a set of symbolic field paths, for example: + # + # paths: "f.a" + # paths: "f.b.d" + # + # Here `f` represents a field in some root message, `a` and `b` + # fields in the message found in `f`, and `d` a field found in the + # message in `f.b`. + # + # Field masks are used to specify a subset of fields that should be + # returned by a get operation or modified by an update operation. + # Field masks also have a custom JSON encoding (see below). + # + # # Field Masks in Projections + # + # When used in the context of a projection, a response message or + # sub-message is filtered by the API to only contain those fields as + # specified in the mask. For example, if the mask in the previous + # example is applied to a response message as follows: + # + # f { + # a : 22 + # b { + # d : 1 + # x : 2 + # } + # y : 13 + # } + # z: 8 + # + # The result will not contain specific values for fields x,y and z + # (their value will be set to the default, and omitted in proto text + # output): + # + # + # f { + # a : 22 + # b { + # d : 1 + # } + # } + # + # A repeated field is not allowed except at the last position of a + # paths string. + # + # If a FieldMask object is not present in a get operation, the + # operation applies to all fields (as if a FieldMask of all fields + # had been specified). + # + # Note that a field mask does not necessarily apply to the + # top-level response message. In case of a REST get operation, the + # field mask applies directly to the response, but in case of a REST + # list operation, the mask instead applies to each individual message + # in the returned resource list. In case of a REST custom method, + # other definitions may be used. Where the mask applies will be + # clearly documented together with its declaration in the API. In + # any case, the effect on the returned resource/resources is required + # behavior for APIs. + # + # # Field Masks in Update Operations + # + # A field mask in update operations specifies which fields of the + # targeted resource are going to be updated. The API is required + # to only change the values of the fields as specified in the mask + # and leave the others untouched. If a resource is passed in to + # describe the updated values, the API ignores the values of all + # fields not covered by the mask. + # + # If a repeated field is specified for an update operation, new values will + # be appended to the existing repeated field in the target resource. Note that + # a repeated field is only allowed in the last position of a `paths` string. + # + # If a sub-message is specified in the last position of the field mask for an + # update operation, then new value will be merged into the existing sub-message + # in the target resource. + # + # For example, given the target message: + # + # f { + # b { + # d: 1 + # x: 2 + # } + # c: [1] + # } + # + # And an update message: + # + # f { + # b { + # d: 10 + # } + # c: [2] + # } + # + # then if the field mask is: + # + # paths: ["f.b", "f.c"] + # + # then the result will be: + # + # f { + # b { + # d: 10 + # x: 2 + # } + # c: [1, 2] + # } + # + # An implementation may provide options to override this default behavior for + # repeated and message fields. + # + # In order to reset a field's value to the default, the field must + # be in the mask and set to the default value in the provided resource. + # Hence, in order to reset all fields of a resource, provide a default + # instance of the resource and set all fields in the mask, or do + # not provide a mask as described below. + # + # If a field mask is not present on update, the operation applies to + # all fields (as if a field mask of all fields has been specified). + # Note that in the presence of schema evolution, this may mean that + # fields the client does not know and has therefore not filled into + # the request will be reset to their default. If this is unwanted + # behavior, a specific service may require a client to always specify + # a field mask, producing an error if not. + # + # As with get operations, the location of the resource which + # describes the updated values in the request message depends on the + # operation kind. In any case, the effect of the field mask is + # required to be honored by the API. + # + # ## Considerations for HTTP REST + # + # The HTTP kind of an update operation which uses a field mask must + # be set to PATCH instead of PUT in order to satisfy HTTP semantics + # (PUT must only be used for full updates). + # + # # JSON Encoding of Field Masks + # + # In JSON, a field mask is encoded as a single string where paths are + # separated by a comma. Fields name in each path are converted + # to/from lower-camel naming conventions. + # + # As an example, consider the following message declarations: + # + # message Profile { + # User user = 1; + # Photo photo = 2; + # } + # message User { + # string display_name = 1; + # string address = 2; + # } + # + # In proto a field mask for `Profile` may look as such: + # + # mask { + # paths: "user.display_name" + # paths: "photo" + # } + # + # In JSON, the same mask is represented as below: + # + # { + # mask: "user.displayName,photo" + # } + # + # # Field Masks and Oneof Fields + # + # Field masks treat fields in oneofs just as regular fields. Consider the + # following message: + # + # message SampleMessage { + # oneof test_oneof { + # string name = 4; + # SubMessage sub_message = 9; + # } + # } + # + # The field mask can be: + # + # mask { + # paths: "name" + # } + # + # Or: + # + # mask { + # paths: "sub_message" + # } + # + # Note that oneof type names ("test_oneof" in this case) cannot be used in + # paths. + # + # ## Field Mask Verification + # + # The implementation of any API method which has a FieldMask type field in the + # request should verify the included field paths, and return an + # `INVALID_ARGUMENT` error if any path is unmappable. + # @!attribute [rw] paths + # @return [::Array<::String>] + # The set of field mask paths. + class FieldMask + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end +end diff --git a/owl-bot-staging/google-cloud-secure_source_manager-v1/proto_docs/google/protobuf/timestamp.rb b/owl-bot-staging/google-cloud-secure_source_manager-v1/proto_docs/google/protobuf/timestamp.rb new file mode 100644 index 000000000000..74352be9c58c --- /dev/null +++ b/owl-bot-staging/google-cloud-secure_source_manager-v1/proto_docs/google/protobuf/timestamp.rb @@ -0,0 +1,127 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + + +module Google + module Protobuf + # A Timestamp represents a point in time independent of any time zone or local + # calendar, encoded as a count of seconds and fractions of seconds at + # nanosecond resolution. The count is relative to an epoch at UTC midnight on + # January 1, 1970, in the proleptic Gregorian calendar which extends the + # Gregorian calendar backwards to year one. + # + # All minutes are 60 seconds long. Leap seconds are "smeared" so that no leap + # second table is needed for interpretation, using a [24-hour linear + # smear](https://developers.google.com/time/smear). + # + # The range is from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59.999999999Z. By + # restricting to that range, we ensure that we can convert to and from [RFC + # 3339](https://www.ietf.org/rfc/rfc3339.txt) date strings. + # + # # Examples + # + # Example 1: Compute Timestamp from POSIX `time()`. + # + # Timestamp timestamp; + # timestamp.set_seconds(time(NULL)); + # timestamp.set_nanos(0); + # + # Example 2: Compute Timestamp from POSIX `gettimeofday()`. + # + # struct timeval tv; + # gettimeofday(&tv, NULL); + # + # Timestamp timestamp; + # timestamp.set_seconds(tv.tv_sec); + # timestamp.set_nanos(tv.tv_usec * 1000); + # + # Example 3: Compute Timestamp from Win32 `GetSystemTimeAsFileTime()`. + # + # FILETIME ft; + # GetSystemTimeAsFileTime(&ft); + # UINT64 ticks = (((UINT64)ft.dwHighDateTime) << 32) | ft.dwLowDateTime; + # + # // A Windows tick is 100 nanoseconds. Windows epoch 1601-01-01T00:00:00Z + # // is 11644473600 seconds before Unix epoch 1970-01-01T00:00:00Z. + # Timestamp timestamp; + # timestamp.set_seconds((INT64) ((ticks / 10000000) - 11644473600LL)); + # timestamp.set_nanos((INT32) ((ticks % 10000000) * 100)); + # + # Example 4: Compute Timestamp from Java `System.currentTimeMillis()`. + # + # long millis = System.currentTimeMillis(); + # + # Timestamp timestamp = Timestamp.newBuilder().setSeconds(millis / 1000) + # .setNanos((int) ((millis % 1000) * 1000000)).build(); + # + # Example 5: Compute Timestamp from Java `Instant.now()`. + # + # Instant now = Instant.now(); + # + # Timestamp timestamp = + # Timestamp.newBuilder().setSeconds(now.getEpochSecond()) + # .setNanos(now.getNano()).build(); + # + # Example 6: Compute Timestamp from current time in Python. + # + # timestamp = Timestamp() + # timestamp.GetCurrentTime() + # + # # JSON Mapping + # + # In JSON format, the Timestamp type is encoded as a string in the + # [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format. That is, the + # format is "\\{year}-\\{month}-\\{day}T\\{hour}:\\{min}:\\{sec}[.\\{frac_sec}]Z" + # where \\{year} is always expressed using four digits while \\{month}, \\{day}, + # \\{hour}, \\{min}, and \\{sec} are zero-padded to two digits each. The fractional + # seconds, which can go up to 9 digits (i.e. up to 1 nanosecond resolution), + # are optional. The "Z" suffix indicates the timezone ("UTC"); the timezone + # is required. A proto3 JSON serializer should always use UTC (as indicated by + # "Z") when printing the Timestamp type and a proto3 JSON parser should be + # able to accept both UTC and other timezones (as indicated by an offset). + # + # For example, "2017-01-15T01:30:15.01Z" encodes 15.01 seconds past + # 01:30 UTC on January 15, 2017. + # + # In JavaScript, one can convert a Date object to this format using the + # standard + # [toISOString()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toISOString) + # method. In Python, a standard `datetime.datetime` object can be converted + # to this format using + # [`strftime`](https://docs.python.org/2/library/time.html#time.strftime) with + # the time format spec '%Y-%m-%dT%H:%M:%S.%fZ'. Likewise, in Java, one can use + # the Joda Time's [`ISODateTimeFormat.dateTime()`]( + # http://joda-time.sourceforge.net/apidocs/org/joda/time/format/ISODateTimeFormat.html#dateTime() + # ) to obtain a formatter capable of generating timestamps in this format. + # @!attribute [rw] seconds + # @return [::Integer] + # Represents seconds of UTC time since Unix epoch + # 1970-01-01T00:00:00Z. Must be from 0001-01-01T00:00:00Z to + # 9999-12-31T23:59:59Z inclusive. + # @!attribute [rw] nanos + # @return [::Integer] + # Non-negative fractions of a second at nanosecond resolution. Negative + # second values with fractions must still have non-negative nanos values + # that count forward in time. Must be from 0 to 999,999,999 + # inclusive. + class Timestamp + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end +end diff --git a/owl-bot-staging/google-cloud-secure_source_manager-v1/proto_docs/google/rpc/status.rb b/owl-bot-staging/google-cloud-secure_source_manager-v1/proto_docs/google/rpc/status.rb new file mode 100644 index 000000000000..c1a1c07eb2db --- /dev/null +++ b/owl-bot-staging/google-cloud-secure_source_manager-v1/proto_docs/google/rpc/status.rb @@ -0,0 +1,48 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + + +module Google + module Rpc + # The `Status` type defines a logical error model that is suitable for + # different programming environments, including REST APIs and RPC APIs. It is + # used by [gRPC](https://github.com/grpc). Each `Status` message contains + # three pieces of data: error code, error message, and error details. + # + # You can find out more about this error model and how to work with it in the + # [API Design Guide](https://cloud.google.com/apis/design/errors). + # @!attribute [rw] code + # @return [::Integer] + # The status code, which should be an enum value of + # [google.rpc.Code][google.rpc.Code]. + # @!attribute [rw] message + # @return [::String] + # A developer-facing error message, which should be in English. Any + # user-facing error message should be localized and sent in the + # {::Google::Rpc::Status#details google.rpc.Status.details} field, or localized + # by the client. + # @!attribute [rw] details + # @return [::Array<::Google::Protobuf::Any>] + # A list of messages that carry the error details. There is a common set of + # message types for APIs to use. + class Status + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end +end diff --git a/owl-bot-staging/google-cloud-secure_source_manager-v1/proto_docs/google/type/expr.rb b/owl-bot-staging/google-cloud-secure_source_manager-v1/proto_docs/google/type/expr.rb new file mode 100644 index 000000000000..53e7733b6592 --- /dev/null +++ b/owl-bot-staging/google-cloud-secure_source_manager-v1/proto_docs/google/type/expr.rb @@ -0,0 +1,75 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + + +module Google + module Type + # Represents a textual expression in the Common Expression Language (CEL) + # syntax. CEL is a C-like expression language. The syntax and semantics of CEL + # are documented at https://github.com/google/cel-spec. + # + # Example (Comparison): + # + # title: "Summary size limit" + # description: "Determines if a summary is less than 100 chars" + # expression: "document.summary.size() < 100" + # + # Example (Equality): + # + # title: "Requestor is owner" + # description: "Determines if requestor is the document owner" + # expression: "document.owner == request.auth.claims.email" + # + # Example (Logic): + # + # title: "Public documents" + # description: "Determine whether the document should be publicly visible" + # expression: "document.type != 'private' && document.type != 'internal'" + # + # Example (Data Manipulation): + # + # title: "Notification string" + # description: "Create a notification string with a timestamp." + # expression: "'New message received at ' + string(document.create_time)" + # + # The exact variables and functions that may be referenced within an expression + # are determined by the service that evaluates it. See the service + # documentation for additional information. + # @!attribute [rw] expression + # @return [::String] + # Textual representation of an expression in Common Expression Language + # syntax. + # @!attribute [rw] title + # @return [::String] + # Optional. Title for the expression, i.e. a short string describing + # its purpose. This can be used e.g. in UIs which allow to enter the + # expression. + # @!attribute [rw] description + # @return [::String] + # Optional. Description of the expression. This is a longer text which + # describes the expression, e.g. when hovered over it in a UI. + # @!attribute [rw] location + # @return [::String] + # Optional. String indicating the location of the expression for error + # reporting, e.g. a file name and a position in the file. + class Expr + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end +end diff --git a/owl-bot-staging/google-cloud-secure_source_manager-v1/snippets/Gemfile b/owl-bot-staging/google-cloud-secure_source_manager-v1/snippets/Gemfile new file mode 100644 index 000000000000..c02a8c6ffa97 --- /dev/null +++ b/owl-bot-staging/google-cloud-secure_source_manager-v1/snippets/Gemfile @@ -0,0 +1,32 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +source "https://rubygems.org" + +if ENV["GOOGLE_CLOUD_SAMPLES_TEST"] == "master" + gem "google-cloud-secure_source_manager-v1", path: "../" +else + gem "google-cloud-secure_source_manager-v1" +end + +group :test do + gem "google-style", "~> 1.26.1" + gem "minitest", "~> 5.16" + gem "minitest-focus", "~> 1.1" + gem "minitest-hooks", "~> 1.5" +end diff --git a/owl-bot-staging/google-cloud-secure_source_manager-v1/snippets/secure_source_manager/batch_create_pull_request_comments.rb b/owl-bot-staging/google-cloud-secure_source_manager-v1/snippets/secure_source_manager/batch_create_pull_request_comments.rb new file mode 100644 index 000000000000..6aeca4d125fe --- /dev/null +++ b/owl-bot-staging/google-cloud-secure_source_manager-v1/snippets/secure_source_manager/batch_create_pull_request_comments.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 securesourcemanager_v1_generated_SecureSourceManager_BatchCreatePullRequestComments_sync] +require "google/cloud/secure_source_manager/v1" + +## +# Snippet for the batch_create_pull_request_comments call in the SecureSourceManager service +# +# This snippet has been automatically generated and should be regarded as a code +# template only. It will require modifications to work: +# - It may require correct/in-range values for request initialization. +# - It may require specifying regional endpoints when creating the service +# client as shown in https://cloud.google.com/ruby/docs/reference. +# +# This is an auto-generated example demonstrating basic usage of +# Google::Cloud::SecureSourceManager::V1::SecureSourceManager::Client#batch_create_pull_request_comments. +# +def batch_create_pull_request_comments + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::SecureSourceManager::V1::SecureSourceManager::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::SecureSourceManager::V1::BatchCreatePullRequestCommentsRequest.new + + # Call the batch_create_pull_request_comments method. + result = client.batch_create_pull_request_comments 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 securesourcemanager_v1_generated_SecureSourceManager_BatchCreatePullRequestComments_sync] diff --git a/owl-bot-staging/google-cloud-secure_source_manager-v1/snippets/secure_source_manager/close_issue.rb b/owl-bot-staging/google-cloud-secure_source_manager-v1/snippets/secure_source_manager/close_issue.rb new file mode 100644 index 000000000000..b2ba82ae6d45 --- /dev/null +++ b/owl-bot-staging/google-cloud-secure_source_manager-v1/snippets/secure_source_manager/close_issue.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 securesourcemanager_v1_generated_SecureSourceManager_CloseIssue_sync] +require "google/cloud/secure_source_manager/v1" + +## +# Snippet for the close_issue call in the SecureSourceManager service +# +# This snippet has been automatically generated and should be regarded as a code +# template only. It will require modifications to work: +# - It may require correct/in-range values for request initialization. +# - It may require specifying regional endpoints when creating the service +# client as shown in https://cloud.google.com/ruby/docs/reference. +# +# This is an auto-generated example demonstrating basic usage of +# Google::Cloud::SecureSourceManager::V1::SecureSourceManager::Client#close_issue. +# +def close_issue + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::SecureSourceManager::V1::SecureSourceManager::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::SecureSourceManager::V1::CloseIssueRequest.new + + # Call the close_issue method. + result = client.close_issue 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 securesourcemanager_v1_generated_SecureSourceManager_CloseIssue_sync] diff --git a/owl-bot-staging/google-cloud-secure_source_manager-v1/snippets/secure_source_manager/close_pull_request.rb b/owl-bot-staging/google-cloud-secure_source_manager-v1/snippets/secure_source_manager/close_pull_request.rb new file mode 100644 index 000000000000..38c1ced837e0 --- /dev/null +++ b/owl-bot-staging/google-cloud-secure_source_manager-v1/snippets/secure_source_manager/close_pull_request.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 securesourcemanager_v1_generated_SecureSourceManager_ClosePullRequest_sync] +require "google/cloud/secure_source_manager/v1" + +## +# Snippet for the close_pull_request call in the SecureSourceManager service +# +# This snippet has been automatically generated and should be regarded as a code +# template only. It will require modifications to work: +# - It may require correct/in-range values for request initialization. +# - It may require specifying regional endpoints when creating the service +# client as shown in https://cloud.google.com/ruby/docs/reference. +# +# This is an auto-generated example demonstrating basic usage of +# Google::Cloud::SecureSourceManager::V1::SecureSourceManager::Client#close_pull_request. +# +def close_pull_request + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::SecureSourceManager::V1::SecureSourceManager::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::SecureSourceManager::V1::ClosePullRequestRequest.new + + # Call the close_pull_request method. + result = client.close_pull_request 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 securesourcemanager_v1_generated_SecureSourceManager_ClosePullRequest_sync] diff --git a/owl-bot-staging/google-cloud-secure_source_manager-v1/snippets/secure_source_manager/create_branch_rule.rb b/owl-bot-staging/google-cloud-secure_source_manager-v1/snippets/secure_source_manager/create_branch_rule.rb new file mode 100644 index 000000000000..81740887a0f5 --- /dev/null +++ b/owl-bot-staging/google-cloud-secure_source_manager-v1/snippets/secure_source_manager/create_branch_rule.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 securesourcemanager_v1_generated_SecureSourceManager_CreateBranchRule_sync] +require "google/cloud/secure_source_manager/v1" + +## +# Snippet for the create_branch_rule call in the SecureSourceManager service +# +# This snippet has been automatically generated and should be regarded as a code +# template only. It will require modifications to work: +# - It may require correct/in-range values for request initialization. +# - It may require specifying regional endpoints when creating the service +# client as shown in https://cloud.google.com/ruby/docs/reference. +# +# This is an auto-generated example demonstrating basic usage of +# Google::Cloud::SecureSourceManager::V1::SecureSourceManager::Client#create_branch_rule. +# +def create_branch_rule + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::SecureSourceManager::V1::SecureSourceManager::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::SecureSourceManager::V1::CreateBranchRuleRequest.new + + # Call the create_branch_rule method. + result = client.create_branch_rule 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 securesourcemanager_v1_generated_SecureSourceManager_CreateBranchRule_sync] diff --git a/owl-bot-staging/google-cloud-secure_source_manager-v1/snippets/secure_source_manager/create_hook.rb b/owl-bot-staging/google-cloud-secure_source_manager-v1/snippets/secure_source_manager/create_hook.rb new file mode 100644 index 000000000000..9ebf7f19e4b0 --- /dev/null +++ b/owl-bot-staging/google-cloud-secure_source_manager-v1/snippets/secure_source_manager/create_hook.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 securesourcemanager_v1_generated_SecureSourceManager_CreateHook_sync] +require "google/cloud/secure_source_manager/v1" + +## +# Snippet for the create_hook call in the SecureSourceManager service +# +# This snippet has been automatically generated and should be regarded as a code +# template only. It will require modifications to work: +# - It may require correct/in-range values for request initialization. +# - It may require specifying regional endpoints when creating the service +# client as shown in https://cloud.google.com/ruby/docs/reference. +# +# This is an auto-generated example demonstrating basic usage of +# Google::Cloud::SecureSourceManager::V1::SecureSourceManager::Client#create_hook. +# +def create_hook + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::SecureSourceManager::V1::SecureSourceManager::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::SecureSourceManager::V1::CreateHookRequest.new + + # Call the create_hook method. + result = client.create_hook 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 securesourcemanager_v1_generated_SecureSourceManager_CreateHook_sync] diff --git a/owl-bot-staging/google-cloud-secure_source_manager-v1/snippets/secure_source_manager/create_instance.rb b/owl-bot-staging/google-cloud-secure_source_manager-v1/snippets/secure_source_manager/create_instance.rb new file mode 100644 index 000000000000..d7e6ebc48aea --- /dev/null +++ b/owl-bot-staging/google-cloud-secure_source_manager-v1/snippets/secure_source_manager/create_instance.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 securesourcemanager_v1_generated_SecureSourceManager_CreateInstance_sync] +require "google/cloud/secure_source_manager/v1" + +## +# Snippet for the create_instance call in the SecureSourceManager service +# +# This snippet has been automatically generated and should be regarded as a code +# template only. It will require modifications to work: +# - It may require correct/in-range values for request initialization. +# - It may require specifying regional endpoints when creating the service +# client as shown in https://cloud.google.com/ruby/docs/reference. +# +# This is an auto-generated example demonstrating basic usage of +# Google::Cloud::SecureSourceManager::V1::SecureSourceManager::Client#create_instance. +# +def create_instance + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::SecureSourceManager::V1::SecureSourceManager::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::SecureSourceManager::V1::CreateInstanceRequest.new + + # Call the create_instance method. + result = client.create_instance 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 securesourcemanager_v1_generated_SecureSourceManager_CreateInstance_sync] diff --git a/owl-bot-staging/google-cloud-secure_source_manager-v1/snippets/secure_source_manager/create_issue.rb b/owl-bot-staging/google-cloud-secure_source_manager-v1/snippets/secure_source_manager/create_issue.rb new file mode 100644 index 000000000000..c7ecf6b65771 --- /dev/null +++ b/owl-bot-staging/google-cloud-secure_source_manager-v1/snippets/secure_source_manager/create_issue.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 securesourcemanager_v1_generated_SecureSourceManager_CreateIssue_sync] +require "google/cloud/secure_source_manager/v1" + +## +# Snippet for the create_issue call in the SecureSourceManager service +# +# This snippet has been automatically generated and should be regarded as a code +# template only. It will require modifications to work: +# - It may require correct/in-range values for request initialization. +# - It may require specifying regional endpoints when creating the service +# client as shown in https://cloud.google.com/ruby/docs/reference. +# +# This is an auto-generated example demonstrating basic usage of +# Google::Cloud::SecureSourceManager::V1::SecureSourceManager::Client#create_issue. +# +def create_issue + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::SecureSourceManager::V1::SecureSourceManager::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::SecureSourceManager::V1::CreateIssueRequest.new + + # Call the create_issue method. + result = client.create_issue 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 securesourcemanager_v1_generated_SecureSourceManager_CreateIssue_sync] diff --git a/owl-bot-staging/google-cloud-secure_source_manager-v1/snippets/secure_source_manager/create_issue_comment.rb b/owl-bot-staging/google-cloud-secure_source_manager-v1/snippets/secure_source_manager/create_issue_comment.rb new file mode 100644 index 000000000000..9a392c0b40e5 --- /dev/null +++ b/owl-bot-staging/google-cloud-secure_source_manager-v1/snippets/secure_source_manager/create_issue_comment.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 securesourcemanager_v1_generated_SecureSourceManager_CreateIssueComment_sync] +require "google/cloud/secure_source_manager/v1" + +## +# Snippet for the create_issue_comment call in the SecureSourceManager service +# +# This snippet has been automatically generated and should be regarded as a code +# template only. It will require modifications to work: +# - It may require correct/in-range values for request initialization. +# - It may require specifying regional endpoints when creating the service +# client as shown in https://cloud.google.com/ruby/docs/reference. +# +# This is an auto-generated example demonstrating basic usage of +# Google::Cloud::SecureSourceManager::V1::SecureSourceManager::Client#create_issue_comment. +# +def create_issue_comment + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::SecureSourceManager::V1::SecureSourceManager::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::SecureSourceManager::V1::CreateIssueCommentRequest.new + + # Call the create_issue_comment method. + result = client.create_issue_comment 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 securesourcemanager_v1_generated_SecureSourceManager_CreateIssueComment_sync] diff --git a/owl-bot-staging/google-cloud-secure_source_manager-v1/snippets/secure_source_manager/create_pull_request.rb b/owl-bot-staging/google-cloud-secure_source_manager-v1/snippets/secure_source_manager/create_pull_request.rb new file mode 100644 index 000000000000..96f9276bb3ad --- /dev/null +++ b/owl-bot-staging/google-cloud-secure_source_manager-v1/snippets/secure_source_manager/create_pull_request.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 securesourcemanager_v1_generated_SecureSourceManager_CreatePullRequest_sync] +require "google/cloud/secure_source_manager/v1" + +## +# Snippet for the create_pull_request call in the SecureSourceManager service +# +# This snippet has been automatically generated and should be regarded as a code +# template only. It will require modifications to work: +# - It may require correct/in-range values for request initialization. +# - It may require specifying regional endpoints when creating the service +# client as shown in https://cloud.google.com/ruby/docs/reference. +# +# This is an auto-generated example demonstrating basic usage of +# Google::Cloud::SecureSourceManager::V1::SecureSourceManager::Client#create_pull_request. +# +def create_pull_request + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::SecureSourceManager::V1::SecureSourceManager::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::SecureSourceManager::V1::CreatePullRequestRequest.new + + # Call the create_pull_request method. + result = client.create_pull_request 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 securesourcemanager_v1_generated_SecureSourceManager_CreatePullRequest_sync] diff --git a/owl-bot-staging/google-cloud-secure_source_manager-v1/snippets/secure_source_manager/create_pull_request_comment.rb b/owl-bot-staging/google-cloud-secure_source_manager-v1/snippets/secure_source_manager/create_pull_request_comment.rb new file mode 100644 index 000000000000..42a6943f1657 --- /dev/null +++ b/owl-bot-staging/google-cloud-secure_source_manager-v1/snippets/secure_source_manager/create_pull_request_comment.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 securesourcemanager_v1_generated_SecureSourceManager_CreatePullRequestComment_sync] +require "google/cloud/secure_source_manager/v1" + +## +# Snippet for the create_pull_request_comment call in the SecureSourceManager service +# +# This snippet has been automatically generated and should be regarded as a code +# template only. It will require modifications to work: +# - It may require correct/in-range values for request initialization. +# - It may require specifying regional endpoints when creating the service +# client as shown in https://cloud.google.com/ruby/docs/reference. +# +# This is an auto-generated example demonstrating basic usage of +# Google::Cloud::SecureSourceManager::V1::SecureSourceManager::Client#create_pull_request_comment. +# +def create_pull_request_comment + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::SecureSourceManager::V1::SecureSourceManager::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::SecureSourceManager::V1::CreatePullRequestCommentRequest.new + + # Call the create_pull_request_comment method. + result = client.create_pull_request_comment 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 securesourcemanager_v1_generated_SecureSourceManager_CreatePullRequestComment_sync] diff --git a/owl-bot-staging/google-cloud-secure_source_manager-v1/snippets/secure_source_manager/create_repository.rb b/owl-bot-staging/google-cloud-secure_source_manager-v1/snippets/secure_source_manager/create_repository.rb new file mode 100644 index 000000000000..8a5c6b9f1c9c --- /dev/null +++ b/owl-bot-staging/google-cloud-secure_source_manager-v1/snippets/secure_source_manager/create_repository.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 securesourcemanager_v1_generated_SecureSourceManager_CreateRepository_sync] +require "google/cloud/secure_source_manager/v1" + +## +# Snippet for the create_repository call in the SecureSourceManager service +# +# This snippet has been automatically generated and should be regarded as a code +# template only. It will require modifications to work: +# - It may require correct/in-range values for request initialization. +# - It may require specifying regional endpoints when creating the service +# client as shown in https://cloud.google.com/ruby/docs/reference. +# +# This is an auto-generated example demonstrating basic usage of +# Google::Cloud::SecureSourceManager::V1::SecureSourceManager::Client#create_repository. +# +def create_repository + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::SecureSourceManager::V1::SecureSourceManager::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::SecureSourceManager::V1::CreateRepositoryRequest.new + + # Call the create_repository method. + result = client.create_repository 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 securesourcemanager_v1_generated_SecureSourceManager_CreateRepository_sync] diff --git a/owl-bot-staging/google-cloud-secure_source_manager-v1/snippets/secure_source_manager/delete_branch_rule.rb b/owl-bot-staging/google-cloud-secure_source_manager-v1/snippets/secure_source_manager/delete_branch_rule.rb new file mode 100644 index 000000000000..7be487c5cd28 --- /dev/null +++ b/owl-bot-staging/google-cloud-secure_source_manager-v1/snippets/secure_source_manager/delete_branch_rule.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 securesourcemanager_v1_generated_SecureSourceManager_DeleteBranchRule_sync] +require "google/cloud/secure_source_manager/v1" + +## +# Snippet for the delete_branch_rule call in the SecureSourceManager service +# +# This snippet has been automatically generated and should be regarded as a code +# template only. It will require modifications to work: +# - It may require correct/in-range values for request initialization. +# - It may require specifying regional endpoints when creating the service +# client as shown in https://cloud.google.com/ruby/docs/reference. +# +# This is an auto-generated example demonstrating basic usage of +# Google::Cloud::SecureSourceManager::V1::SecureSourceManager::Client#delete_branch_rule. +# +def delete_branch_rule + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::SecureSourceManager::V1::SecureSourceManager::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::SecureSourceManager::V1::DeleteBranchRuleRequest.new + + # Call the delete_branch_rule method. + result = client.delete_branch_rule 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 securesourcemanager_v1_generated_SecureSourceManager_DeleteBranchRule_sync] diff --git a/owl-bot-staging/google-cloud-secure_source_manager-v1/snippets/secure_source_manager/delete_hook.rb b/owl-bot-staging/google-cloud-secure_source_manager-v1/snippets/secure_source_manager/delete_hook.rb new file mode 100644 index 000000000000..bb832a22960e --- /dev/null +++ b/owl-bot-staging/google-cloud-secure_source_manager-v1/snippets/secure_source_manager/delete_hook.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 securesourcemanager_v1_generated_SecureSourceManager_DeleteHook_sync] +require "google/cloud/secure_source_manager/v1" + +## +# Snippet for the delete_hook call in the SecureSourceManager service +# +# This snippet has been automatically generated and should be regarded as a code +# template only. It will require modifications to work: +# - It may require correct/in-range values for request initialization. +# - It may require specifying regional endpoints when creating the service +# client as shown in https://cloud.google.com/ruby/docs/reference. +# +# This is an auto-generated example demonstrating basic usage of +# Google::Cloud::SecureSourceManager::V1::SecureSourceManager::Client#delete_hook. +# +def delete_hook + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::SecureSourceManager::V1::SecureSourceManager::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::SecureSourceManager::V1::DeleteHookRequest.new + + # Call the delete_hook method. + result = client.delete_hook 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 securesourcemanager_v1_generated_SecureSourceManager_DeleteHook_sync] diff --git a/owl-bot-staging/google-cloud-secure_source_manager-v1/snippets/secure_source_manager/delete_instance.rb b/owl-bot-staging/google-cloud-secure_source_manager-v1/snippets/secure_source_manager/delete_instance.rb new file mode 100644 index 000000000000..3846d75b48de --- /dev/null +++ b/owl-bot-staging/google-cloud-secure_source_manager-v1/snippets/secure_source_manager/delete_instance.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 securesourcemanager_v1_generated_SecureSourceManager_DeleteInstance_sync] +require "google/cloud/secure_source_manager/v1" + +## +# Snippet for the delete_instance call in the SecureSourceManager service +# +# This snippet has been automatically generated and should be regarded as a code +# template only. It will require modifications to work: +# - It may require correct/in-range values for request initialization. +# - It may require specifying regional endpoints when creating the service +# client as shown in https://cloud.google.com/ruby/docs/reference. +# +# This is an auto-generated example demonstrating basic usage of +# Google::Cloud::SecureSourceManager::V1::SecureSourceManager::Client#delete_instance. +# +def delete_instance + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::SecureSourceManager::V1::SecureSourceManager::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::SecureSourceManager::V1::DeleteInstanceRequest.new + + # Call the delete_instance method. + result = client.delete_instance 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 securesourcemanager_v1_generated_SecureSourceManager_DeleteInstance_sync] diff --git a/owl-bot-staging/google-cloud-secure_source_manager-v1/snippets/secure_source_manager/delete_issue.rb b/owl-bot-staging/google-cloud-secure_source_manager-v1/snippets/secure_source_manager/delete_issue.rb new file mode 100644 index 000000000000..97ae38f29b45 --- /dev/null +++ b/owl-bot-staging/google-cloud-secure_source_manager-v1/snippets/secure_source_manager/delete_issue.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 securesourcemanager_v1_generated_SecureSourceManager_DeleteIssue_sync] +require "google/cloud/secure_source_manager/v1" + +## +# Snippet for the delete_issue call in the SecureSourceManager service +# +# This snippet has been automatically generated and should be regarded as a code +# template only. It will require modifications to work: +# - It may require correct/in-range values for request initialization. +# - It may require specifying regional endpoints when creating the service +# client as shown in https://cloud.google.com/ruby/docs/reference. +# +# This is an auto-generated example demonstrating basic usage of +# Google::Cloud::SecureSourceManager::V1::SecureSourceManager::Client#delete_issue. +# +def delete_issue + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::SecureSourceManager::V1::SecureSourceManager::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::SecureSourceManager::V1::DeleteIssueRequest.new + + # Call the delete_issue method. + result = client.delete_issue 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 securesourcemanager_v1_generated_SecureSourceManager_DeleteIssue_sync] diff --git a/owl-bot-staging/google-cloud-secure_source_manager-v1/snippets/secure_source_manager/delete_issue_comment.rb b/owl-bot-staging/google-cloud-secure_source_manager-v1/snippets/secure_source_manager/delete_issue_comment.rb new file mode 100644 index 000000000000..7d4cf8df2226 --- /dev/null +++ b/owl-bot-staging/google-cloud-secure_source_manager-v1/snippets/secure_source_manager/delete_issue_comment.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 securesourcemanager_v1_generated_SecureSourceManager_DeleteIssueComment_sync] +require "google/cloud/secure_source_manager/v1" + +## +# Snippet for the delete_issue_comment call in the SecureSourceManager service +# +# This snippet has been automatically generated and should be regarded as a code +# template only. It will require modifications to work: +# - It may require correct/in-range values for request initialization. +# - It may require specifying regional endpoints when creating the service +# client as shown in https://cloud.google.com/ruby/docs/reference. +# +# This is an auto-generated example demonstrating basic usage of +# Google::Cloud::SecureSourceManager::V1::SecureSourceManager::Client#delete_issue_comment. +# +def delete_issue_comment + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::SecureSourceManager::V1::SecureSourceManager::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::SecureSourceManager::V1::DeleteIssueCommentRequest.new + + # Call the delete_issue_comment method. + result = client.delete_issue_comment 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 securesourcemanager_v1_generated_SecureSourceManager_DeleteIssueComment_sync] diff --git a/owl-bot-staging/google-cloud-secure_source_manager-v1/snippets/secure_source_manager/delete_pull_request_comment.rb b/owl-bot-staging/google-cloud-secure_source_manager-v1/snippets/secure_source_manager/delete_pull_request_comment.rb new file mode 100644 index 000000000000..9b109842de87 --- /dev/null +++ b/owl-bot-staging/google-cloud-secure_source_manager-v1/snippets/secure_source_manager/delete_pull_request_comment.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 securesourcemanager_v1_generated_SecureSourceManager_DeletePullRequestComment_sync] +require "google/cloud/secure_source_manager/v1" + +## +# Snippet for the delete_pull_request_comment call in the SecureSourceManager service +# +# This snippet has been automatically generated and should be regarded as a code +# template only. It will require modifications to work: +# - It may require correct/in-range values for request initialization. +# - It may require specifying regional endpoints when creating the service +# client as shown in https://cloud.google.com/ruby/docs/reference. +# +# This is an auto-generated example demonstrating basic usage of +# Google::Cloud::SecureSourceManager::V1::SecureSourceManager::Client#delete_pull_request_comment. +# +def delete_pull_request_comment + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::SecureSourceManager::V1::SecureSourceManager::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::SecureSourceManager::V1::DeletePullRequestCommentRequest.new + + # Call the delete_pull_request_comment method. + result = client.delete_pull_request_comment 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 securesourcemanager_v1_generated_SecureSourceManager_DeletePullRequestComment_sync] diff --git a/owl-bot-staging/google-cloud-secure_source_manager-v1/snippets/secure_source_manager/delete_repository.rb b/owl-bot-staging/google-cloud-secure_source_manager-v1/snippets/secure_source_manager/delete_repository.rb new file mode 100644 index 000000000000..5ac51c078de8 --- /dev/null +++ b/owl-bot-staging/google-cloud-secure_source_manager-v1/snippets/secure_source_manager/delete_repository.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 securesourcemanager_v1_generated_SecureSourceManager_DeleteRepository_sync] +require "google/cloud/secure_source_manager/v1" + +## +# Snippet for the delete_repository call in the SecureSourceManager service +# +# This snippet has been automatically generated and should be regarded as a code +# template only. It will require modifications to work: +# - It may require correct/in-range values for request initialization. +# - It may require specifying regional endpoints when creating the service +# client as shown in https://cloud.google.com/ruby/docs/reference. +# +# This is an auto-generated example demonstrating basic usage of +# Google::Cloud::SecureSourceManager::V1::SecureSourceManager::Client#delete_repository. +# +def delete_repository + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::SecureSourceManager::V1::SecureSourceManager::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::SecureSourceManager::V1::DeleteRepositoryRequest.new + + # Call the delete_repository method. + result = client.delete_repository 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 securesourcemanager_v1_generated_SecureSourceManager_DeleteRepository_sync] diff --git a/owl-bot-staging/google-cloud-secure_source_manager-v1/snippets/secure_source_manager/fetch_blob.rb b/owl-bot-staging/google-cloud-secure_source_manager-v1/snippets/secure_source_manager/fetch_blob.rb new file mode 100644 index 000000000000..cf6d2c9e3b39 --- /dev/null +++ b/owl-bot-staging/google-cloud-secure_source_manager-v1/snippets/secure_source_manager/fetch_blob.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 securesourcemanager_v1_generated_SecureSourceManager_FetchBlob_sync] +require "google/cloud/secure_source_manager/v1" + +## +# Snippet for the fetch_blob call in the SecureSourceManager service +# +# This snippet has been automatically generated and should be regarded as a code +# template only. It will require modifications to work: +# - It may require correct/in-range values for request initialization. +# - It may require specifying regional endpoints when creating the service +# client as shown in https://cloud.google.com/ruby/docs/reference. +# +# This is an auto-generated example demonstrating basic usage of +# Google::Cloud::SecureSourceManager::V1::SecureSourceManager::Client#fetch_blob. +# +def fetch_blob + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::SecureSourceManager::V1::SecureSourceManager::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::SecureSourceManager::V1::FetchBlobRequest.new + + # Call the fetch_blob method. + result = client.fetch_blob request + + # The returned object is of type Google::Cloud::SecureSourceManager::V1::FetchBlobResponse. + p result +end +# [END securesourcemanager_v1_generated_SecureSourceManager_FetchBlob_sync] diff --git a/owl-bot-staging/google-cloud-secure_source_manager-v1/snippets/secure_source_manager/fetch_tree.rb b/owl-bot-staging/google-cloud-secure_source_manager-v1/snippets/secure_source_manager/fetch_tree.rb new file mode 100644 index 000000000000..f44b00813d69 --- /dev/null +++ b/owl-bot-staging/google-cloud-secure_source_manager-v1/snippets/secure_source_manager/fetch_tree.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 securesourcemanager_v1_generated_SecureSourceManager_FetchTree_sync] +require "google/cloud/secure_source_manager/v1" + +## +# Snippet for the fetch_tree call in the SecureSourceManager service +# +# This snippet has been automatically generated and should be regarded as a code +# template only. It will require modifications to work: +# - It may require correct/in-range values for request initialization. +# - It may require specifying regional endpoints when creating the service +# client as shown in https://cloud.google.com/ruby/docs/reference. +# +# This is an auto-generated example demonstrating basic usage of +# Google::Cloud::SecureSourceManager::V1::SecureSourceManager::Client#fetch_tree. +# +def fetch_tree + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::SecureSourceManager::V1::SecureSourceManager::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::SecureSourceManager::V1::FetchTreeRequest.new + + # Call the fetch_tree method. + result = client.fetch_tree request + + # The returned object is of type Gapic::PagedEnumerable. You can iterate + # over elements, and API calls will be issued to fetch pages as needed. + result.each do |item| + # Each element is of type ::Google::Cloud::SecureSourceManager::V1::TreeEntry. + p item + end +end +# [END securesourcemanager_v1_generated_SecureSourceManager_FetchTree_sync] diff --git a/owl-bot-staging/google-cloud-secure_source_manager-v1/snippets/secure_source_manager/get_branch_rule.rb b/owl-bot-staging/google-cloud-secure_source_manager-v1/snippets/secure_source_manager/get_branch_rule.rb new file mode 100644 index 000000000000..f34587a87d48 --- /dev/null +++ b/owl-bot-staging/google-cloud-secure_source_manager-v1/snippets/secure_source_manager/get_branch_rule.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 securesourcemanager_v1_generated_SecureSourceManager_GetBranchRule_sync] +require "google/cloud/secure_source_manager/v1" + +## +# Snippet for the get_branch_rule call in the SecureSourceManager service +# +# This snippet has been automatically generated and should be regarded as a code +# template only. It will require modifications to work: +# - It may require correct/in-range values for request initialization. +# - It may require specifying regional endpoints when creating the service +# client as shown in https://cloud.google.com/ruby/docs/reference. +# +# This is an auto-generated example demonstrating basic usage of +# Google::Cloud::SecureSourceManager::V1::SecureSourceManager::Client#get_branch_rule. +# +def get_branch_rule + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::SecureSourceManager::V1::SecureSourceManager::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::SecureSourceManager::V1::GetBranchRuleRequest.new + + # Call the get_branch_rule method. + result = client.get_branch_rule request + + # The returned object is of type Google::Cloud::SecureSourceManager::V1::BranchRule. + p result +end +# [END securesourcemanager_v1_generated_SecureSourceManager_GetBranchRule_sync] diff --git a/owl-bot-staging/google-cloud-secure_source_manager-v1/snippets/secure_source_manager/get_hook.rb b/owl-bot-staging/google-cloud-secure_source_manager-v1/snippets/secure_source_manager/get_hook.rb new file mode 100644 index 000000000000..7e6782e5a4ad --- /dev/null +++ b/owl-bot-staging/google-cloud-secure_source_manager-v1/snippets/secure_source_manager/get_hook.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 securesourcemanager_v1_generated_SecureSourceManager_GetHook_sync] +require "google/cloud/secure_source_manager/v1" + +## +# Snippet for the get_hook call in the SecureSourceManager service +# +# This snippet has been automatically generated and should be regarded as a code +# template only. It will require modifications to work: +# - It may require correct/in-range values for request initialization. +# - It may require specifying regional endpoints when creating the service +# client as shown in https://cloud.google.com/ruby/docs/reference. +# +# This is an auto-generated example demonstrating basic usage of +# Google::Cloud::SecureSourceManager::V1::SecureSourceManager::Client#get_hook. +# +def get_hook + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::SecureSourceManager::V1::SecureSourceManager::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::SecureSourceManager::V1::GetHookRequest.new + + # Call the get_hook method. + result = client.get_hook request + + # The returned object is of type Google::Cloud::SecureSourceManager::V1::Hook. + p result +end +# [END securesourcemanager_v1_generated_SecureSourceManager_GetHook_sync] diff --git a/owl-bot-staging/google-cloud-secure_source_manager-v1/snippets/secure_source_manager/get_iam_policy_repo.rb b/owl-bot-staging/google-cloud-secure_source_manager-v1/snippets/secure_source_manager/get_iam_policy_repo.rb new file mode 100644 index 000000000000..e9ce8413832f --- /dev/null +++ b/owl-bot-staging/google-cloud-secure_source_manager-v1/snippets/secure_source_manager/get_iam_policy_repo.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 securesourcemanager_v1_generated_SecureSourceManager_GetIamPolicyRepo_sync] +require "google/cloud/secure_source_manager/v1" + +## +# Snippet for the get_iam_policy_repo call in the SecureSourceManager service +# +# This snippet has been automatically generated and should be regarded as a code +# template only. It will require modifications to work: +# - It may require correct/in-range values for request initialization. +# - It may require specifying regional endpoints when creating the service +# client as shown in https://cloud.google.com/ruby/docs/reference. +# +# This is an auto-generated example demonstrating basic usage of +# Google::Cloud::SecureSourceManager::V1::SecureSourceManager::Client#get_iam_policy_repo. +# +def get_iam_policy_repo + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::SecureSourceManager::V1::SecureSourceManager::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Iam::V1::GetIamPolicyRequest.new + + # Call the get_iam_policy_repo method. + result = client.get_iam_policy_repo request + + # The returned object is of type Google::Iam::V1::Policy. + p result +end +# [END securesourcemanager_v1_generated_SecureSourceManager_GetIamPolicyRepo_sync] diff --git a/owl-bot-staging/google-cloud-secure_source_manager-v1/snippets/secure_source_manager/get_instance.rb b/owl-bot-staging/google-cloud-secure_source_manager-v1/snippets/secure_source_manager/get_instance.rb new file mode 100644 index 000000000000..36213b70cd2b --- /dev/null +++ b/owl-bot-staging/google-cloud-secure_source_manager-v1/snippets/secure_source_manager/get_instance.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 securesourcemanager_v1_generated_SecureSourceManager_GetInstance_sync] +require "google/cloud/secure_source_manager/v1" + +## +# Snippet for the get_instance call in the SecureSourceManager service +# +# This snippet has been automatically generated and should be regarded as a code +# template only. It will require modifications to work: +# - It may require correct/in-range values for request initialization. +# - It may require specifying regional endpoints when creating the service +# client as shown in https://cloud.google.com/ruby/docs/reference. +# +# This is an auto-generated example demonstrating basic usage of +# Google::Cloud::SecureSourceManager::V1::SecureSourceManager::Client#get_instance. +# +def get_instance + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::SecureSourceManager::V1::SecureSourceManager::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::SecureSourceManager::V1::GetInstanceRequest.new + + # Call the get_instance method. + result = client.get_instance request + + # The returned object is of type Google::Cloud::SecureSourceManager::V1::Instance. + p result +end +# [END securesourcemanager_v1_generated_SecureSourceManager_GetInstance_sync] diff --git a/owl-bot-staging/google-cloud-secure_source_manager-v1/snippets/secure_source_manager/get_issue.rb b/owl-bot-staging/google-cloud-secure_source_manager-v1/snippets/secure_source_manager/get_issue.rb new file mode 100644 index 000000000000..a00d369904cc --- /dev/null +++ b/owl-bot-staging/google-cloud-secure_source_manager-v1/snippets/secure_source_manager/get_issue.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 securesourcemanager_v1_generated_SecureSourceManager_GetIssue_sync] +require "google/cloud/secure_source_manager/v1" + +## +# Snippet for the get_issue call in the SecureSourceManager service +# +# This snippet has been automatically generated and should be regarded as a code +# template only. It will require modifications to work: +# - It may require correct/in-range values for request initialization. +# - It may require specifying regional endpoints when creating the service +# client as shown in https://cloud.google.com/ruby/docs/reference. +# +# This is an auto-generated example demonstrating basic usage of +# Google::Cloud::SecureSourceManager::V1::SecureSourceManager::Client#get_issue. +# +def get_issue + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::SecureSourceManager::V1::SecureSourceManager::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::SecureSourceManager::V1::GetIssueRequest.new + + # Call the get_issue method. + result = client.get_issue request + + # The returned object is of type Google::Cloud::SecureSourceManager::V1::Issue. + p result +end +# [END securesourcemanager_v1_generated_SecureSourceManager_GetIssue_sync] diff --git a/owl-bot-staging/google-cloud-secure_source_manager-v1/snippets/secure_source_manager/get_issue_comment.rb b/owl-bot-staging/google-cloud-secure_source_manager-v1/snippets/secure_source_manager/get_issue_comment.rb new file mode 100644 index 000000000000..d72bb362175a --- /dev/null +++ b/owl-bot-staging/google-cloud-secure_source_manager-v1/snippets/secure_source_manager/get_issue_comment.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 securesourcemanager_v1_generated_SecureSourceManager_GetIssueComment_sync] +require "google/cloud/secure_source_manager/v1" + +## +# Snippet for the get_issue_comment call in the SecureSourceManager service +# +# This snippet has been automatically generated and should be regarded as a code +# template only. It will require modifications to work: +# - It may require correct/in-range values for request initialization. +# - It may require specifying regional endpoints when creating the service +# client as shown in https://cloud.google.com/ruby/docs/reference. +# +# This is an auto-generated example demonstrating basic usage of +# Google::Cloud::SecureSourceManager::V1::SecureSourceManager::Client#get_issue_comment. +# +def get_issue_comment + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::SecureSourceManager::V1::SecureSourceManager::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::SecureSourceManager::V1::GetIssueCommentRequest.new + + # Call the get_issue_comment method. + result = client.get_issue_comment request + + # The returned object is of type Google::Cloud::SecureSourceManager::V1::IssueComment. + p result +end +# [END securesourcemanager_v1_generated_SecureSourceManager_GetIssueComment_sync] diff --git a/owl-bot-staging/google-cloud-secure_source_manager-v1/snippets/secure_source_manager/get_pull_request.rb b/owl-bot-staging/google-cloud-secure_source_manager-v1/snippets/secure_source_manager/get_pull_request.rb new file mode 100644 index 000000000000..99294fe78a70 --- /dev/null +++ b/owl-bot-staging/google-cloud-secure_source_manager-v1/snippets/secure_source_manager/get_pull_request.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 securesourcemanager_v1_generated_SecureSourceManager_GetPullRequest_sync] +require "google/cloud/secure_source_manager/v1" + +## +# Snippet for the get_pull_request call in the SecureSourceManager service +# +# This snippet has been automatically generated and should be regarded as a code +# template only. It will require modifications to work: +# - It may require correct/in-range values for request initialization. +# - It may require specifying regional endpoints when creating the service +# client as shown in https://cloud.google.com/ruby/docs/reference. +# +# This is an auto-generated example demonstrating basic usage of +# Google::Cloud::SecureSourceManager::V1::SecureSourceManager::Client#get_pull_request. +# +def get_pull_request + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::SecureSourceManager::V1::SecureSourceManager::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::SecureSourceManager::V1::GetPullRequestRequest.new + + # Call the get_pull_request method. + result = client.get_pull_request request + + # The returned object is of type Google::Cloud::SecureSourceManager::V1::PullRequest. + p result +end +# [END securesourcemanager_v1_generated_SecureSourceManager_GetPullRequest_sync] diff --git a/owl-bot-staging/google-cloud-secure_source_manager-v1/snippets/secure_source_manager/get_pull_request_comment.rb b/owl-bot-staging/google-cloud-secure_source_manager-v1/snippets/secure_source_manager/get_pull_request_comment.rb new file mode 100644 index 000000000000..b353146f2611 --- /dev/null +++ b/owl-bot-staging/google-cloud-secure_source_manager-v1/snippets/secure_source_manager/get_pull_request_comment.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 securesourcemanager_v1_generated_SecureSourceManager_GetPullRequestComment_sync] +require "google/cloud/secure_source_manager/v1" + +## +# Snippet for the get_pull_request_comment call in the SecureSourceManager service +# +# This snippet has been automatically generated and should be regarded as a code +# template only. It will require modifications to work: +# - It may require correct/in-range values for request initialization. +# - It may require specifying regional endpoints when creating the service +# client as shown in https://cloud.google.com/ruby/docs/reference. +# +# This is an auto-generated example demonstrating basic usage of +# Google::Cloud::SecureSourceManager::V1::SecureSourceManager::Client#get_pull_request_comment. +# +def get_pull_request_comment + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::SecureSourceManager::V1::SecureSourceManager::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::SecureSourceManager::V1::GetPullRequestCommentRequest.new + + # Call the get_pull_request_comment method. + result = client.get_pull_request_comment request + + # The returned object is of type Google::Cloud::SecureSourceManager::V1::PullRequestComment. + p result +end +# [END securesourcemanager_v1_generated_SecureSourceManager_GetPullRequestComment_sync] diff --git a/owl-bot-staging/google-cloud-secure_source_manager-v1/snippets/secure_source_manager/get_repository.rb b/owl-bot-staging/google-cloud-secure_source_manager-v1/snippets/secure_source_manager/get_repository.rb new file mode 100644 index 000000000000..c061ef825149 --- /dev/null +++ b/owl-bot-staging/google-cloud-secure_source_manager-v1/snippets/secure_source_manager/get_repository.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 securesourcemanager_v1_generated_SecureSourceManager_GetRepository_sync] +require "google/cloud/secure_source_manager/v1" + +## +# Snippet for the get_repository call in the SecureSourceManager service +# +# This snippet has been automatically generated and should be regarded as a code +# template only. It will require modifications to work: +# - It may require correct/in-range values for request initialization. +# - It may require specifying regional endpoints when creating the service +# client as shown in https://cloud.google.com/ruby/docs/reference. +# +# This is an auto-generated example demonstrating basic usage of +# Google::Cloud::SecureSourceManager::V1::SecureSourceManager::Client#get_repository. +# +def get_repository + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::SecureSourceManager::V1::SecureSourceManager::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::SecureSourceManager::V1::GetRepositoryRequest.new + + # Call the get_repository method. + result = client.get_repository request + + # The returned object is of type Google::Cloud::SecureSourceManager::V1::Repository. + p result +end +# [END securesourcemanager_v1_generated_SecureSourceManager_GetRepository_sync] diff --git a/owl-bot-staging/google-cloud-secure_source_manager-v1/snippets/secure_source_manager/list_branch_rules.rb b/owl-bot-staging/google-cloud-secure_source_manager-v1/snippets/secure_source_manager/list_branch_rules.rb new file mode 100644 index 000000000000..00499c4f7fe8 --- /dev/null +++ b/owl-bot-staging/google-cloud-secure_source_manager-v1/snippets/secure_source_manager/list_branch_rules.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 securesourcemanager_v1_generated_SecureSourceManager_ListBranchRules_sync] +require "google/cloud/secure_source_manager/v1" + +## +# Snippet for the list_branch_rules call in the SecureSourceManager service +# +# This snippet has been automatically generated and should be regarded as a code +# template only. It will require modifications to work: +# - It may require correct/in-range values for request initialization. +# - It may require specifying regional endpoints when creating the service +# client as shown in https://cloud.google.com/ruby/docs/reference. +# +# This is an auto-generated example demonstrating basic usage of +# Google::Cloud::SecureSourceManager::V1::SecureSourceManager::Client#list_branch_rules. +# +def list_branch_rules + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::SecureSourceManager::V1::SecureSourceManager::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::SecureSourceManager::V1::ListBranchRulesRequest.new + + # Call the list_branch_rules method. + result = client.list_branch_rules request + + # The returned object is of type Gapic::PagedEnumerable. You can iterate + # over elements, and API calls will be issued to fetch pages as needed. + result.each do |item| + # Each element is of type ::Google::Cloud::SecureSourceManager::V1::BranchRule. + p item + end +end +# [END securesourcemanager_v1_generated_SecureSourceManager_ListBranchRules_sync] diff --git a/owl-bot-staging/google-cloud-secure_source_manager-v1/snippets/secure_source_manager/list_hooks.rb b/owl-bot-staging/google-cloud-secure_source_manager-v1/snippets/secure_source_manager/list_hooks.rb new file mode 100644 index 000000000000..bdd7fcb4c869 --- /dev/null +++ b/owl-bot-staging/google-cloud-secure_source_manager-v1/snippets/secure_source_manager/list_hooks.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 securesourcemanager_v1_generated_SecureSourceManager_ListHooks_sync] +require "google/cloud/secure_source_manager/v1" + +## +# Snippet for the list_hooks call in the SecureSourceManager service +# +# This snippet has been automatically generated and should be regarded as a code +# template only. It will require modifications to work: +# - It may require correct/in-range values for request initialization. +# - It may require specifying regional endpoints when creating the service +# client as shown in https://cloud.google.com/ruby/docs/reference. +# +# This is an auto-generated example demonstrating basic usage of +# Google::Cloud::SecureSourceManager::V1::SecureSourceManager::Client#list_hooks. +# +def list_hooks + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::SecureSourceManager::V1::SecureSourceManager::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::SecureSourceManager::V1::ListHooksRequest.new + + # Call the list_hooks method. + result = client.list_hooks request + + # The returned object is of type Gapic::PagedEnumerable. You can iterate + # over elements, and API calls will be issued to fetch pages as needed. + result.each do |item| + # Each element is of type ::Google::Cloud::SecureSourceManager::V1::Hook. + p item + end +end +# [END securesourcemanager_v1_generated_SecureSourceManager_ListHooks_sync] diff --git a/owl-bot-staging/google-cloud-secure_source_manager-v1/snippets/secure_source_manager/list_instances.rb b/owl-bot-staging/google-cloud-secure_source_manager-v1/snippets/secure_source_manager/list_instances.rb new file mode 100644 index 000000000000..a0635c75ef14 --- /dev/null +++ b/owl-bot-staging/google-cloud-secure_source_manager-v1/snippets/secure_source_manager/list_instances.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 securesourcemanager_v1_generated_SecureSourceManager_ListInstances_sync] +require "google/cloud/secure_source_manager/v1" + +## +# Snippet for the list_instances call in the SecureSourceManager service +# +# This snippet has been automatically generated and should be regarded as a code +# template only. It will require modifications to work: +# - It may require correct/in-range values for request initialization. +# - It may require specifying regional endpoints when creating the service +# client as shown in https://cloud.google.com/ruby/docs/reference. +# +# This is an auto-generated example demonstrating basic usage of +# Google::Cloud::SecureSourceManager::V1::SecureSourceManager::Client#list_instances. +# +def list_instances + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::SecureSourceManager::V1::SecureSourceManager::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::SecureSourceManager::V1::ListInstancesRequest.new + + # Call the list_instances method. + result = client.list_instances request + + # The returned object is of type Gapic::PagedEnumerable. You can iterate + # over elements, and API calls will be issued to fetch pages as needed. + result.each do |item| + # Each element is of type ::Google::Cloud::SecureSourceManager::V1::Instance. + p item + end +end +# [END securesourcemanager_v1_generated_SecureSourceManager_ListInstances_sync] diff --git a/owl-bot-staging/google-cloud-secure_source_manager-v1/snippets/secure_source_manager/list_issue_comments.rb b/owl-bot-staging/google-cloud-secure_source_manager-v1/snippets/secure_source_manager/list_issue_comments.rb new file mode 100644 index 000000000000..c67d4b141f75 --- /dev/null +++ b/owl-bot-staging/google-cloud-secure_source_manager-v1/snippets/secure_source_manager/list_issue_comments.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 securesourcemanager_v1_generated_SecureSourceManager_ListIssueComments_sync] +require "google/cloud/secure_source_manager/v1" + +## +# Snippet for the list_issue_comments call in the SecureSourceManager service +# +# This snippet has been automatically generated and should be regarded as a code +# template only. It will require modifications to work: +# - It may require correct/in-range values for request initialization. +# - It may require specifying regional endpoints when creating the service +# client as shown in https://cloud.google.com/ruby/docs/reference. +# +# This is an auto-generated example demonstrating basic usage of +# Google::Cloud::SecureSourceManager::V1::SecureSourceManager::Client#list_issue_comments. +# +def list_issue_comments + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::SecureSourceManager::V1::SecureSourceManager::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::SecureSourceManager::V1::ListIssueCommentsRequest.new + + # Call the list_issue_comments method. + result = client.list_issue_comments request + + # The returned object is of type Gapic::PagedEnumerable. You can iterate + # over elements, and API calls will be issued to fetch pages as needed. + result.each do |item| + # Each element is of type ::Google::Cloud::SecureSourceManager::V1::IssueComment. + p item + end +end +# [END securesourcemanager_v1_generated_SecureSourceManager_ListIssueComments_sync] diff --git a/owl-bot-staging/google-cloud-secure_source_manager-v1/snippets/secure_source_manager/list_issues.rb b/owl-bot-staging/google-cloud-secure_source_manager-v1/snippets/secure_source_manager/list_issues.rb new file mode 100644 index 000000000000..1d06ffba7fd6 --- /dev/null +++ b/owl-bot-staging/google-cloud-secure_source_manager-v1/snippets/secure_source_manager/list_issues.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 securesourcemanager_v1_generated_SecureSourceManager_ListIssues_sync] +require "google/cloud/secure_source_manager/v1" + +## +# Snippet for the list_issues call in the SecureSourceManager service +# +# This snippet has been automatically generated and should be regarded as a code +# template only. It will require modifications to work: +# - It may require correct/in-range values for request initialization. +# - It may require specifying regional endpoints when creating the service +# client as shown in https://cloud.google.com/ruby/docs/reference. +# +# This is an auto-generated example demonstrating basic usage of +# Google::Cloud::SecureSourceManager::V1::SecureSourceManager::Client#list_issues. +# +def list_issues + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::SecureSourceManager::V1::SecureSourceManager::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::SecureSourceManager::V1::ListIssuesRequest.new + + # Call the list_issues method. + result = client.list_issues request + + # The returned object is of type Gapic::PagedEnumerable. You can iterate + # over elements, and API calls will be issued to fetch pages as needed. + result.each do |item| + # Each element is of type ::Google::Cloud::SecureSourceManager::V1::Issue. + p item + end +end +# [END securesourcemanager_v1_generated_SecureSourceManager_ListIssues_sync] diff --git a/owl-bot-staging/google-cloud-secure_source_manager-v1/snippets/secure_source_manager/list_pull_request_comments.rb b/owl-bot-staging/google-cloud-secure_source_manager-v1/snippets/secure_source_manager/list_pull_request_comments.rb new file mode 100644 index 000000000000..e27942c2285c --- /dev/null +++ b/owl-bot-staging/google-cloud-secure_source_manager-v1/snippets/secure_source_manager/list_pull_request_comments.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 securesourcemanager_v1_generated_SecureSourceManager_ListPullRequestComments_sync] +require "google/cloud/secure_source_manager/v1" + +## +# Snippet for the list_pull_request_comments call in the SecureSourceManager service +# +# This snippet has been automatically generated and should be regarded as a code +# template only. It will require modifications to work: +# - It may require correct/in-range values for request initialization. +# - It may require specifying regional endpoints when creating the service +# client as shown in https://cloud.google.com/ruby/docs/reference. +# +# This is an auto-generated example demonstrating basic usage of +# Google::Cloud::SecureSourceManager::V1::SecureSourceManager::Client#list_pull_request_comments. +# +def list_pull_request_comments + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::SecureSourceManager::V1::SecureSourceManager::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::SecureSourceManager::V1::ListPullRequestCommentsRequest.new + + # Call the list_pull_request_comments method. + result = client.list_pull_request_comments request + + # The returned object is of type Gapic::PagedEnumerable. You can iterate + # over elements, and API calls will be issued to fetch pages as needed. + result.each do |item| + # Each element is of type ::Google::Cloud::SecureSourceManager::V1::PullRequestComment. + p item + end +end +# [END securesourcemanager_v1_generated_SecureSourceManager_ListPullRequestComments_sync] diff --git a/owl-bot-staging/google-cloud-secure_source_manager-v1/snippets/secure_source_manager/list_pull_request_file_diffs.rb b/owl-bot-staging/google-cloud-secure_source_manager-v1/snippets/secure_source_manager/list_pull_request_file_diffs.rb new file mode 100644 index 000000000000..ee7f1fb85eee --- /dev/null +++ b/owl-bot-staging/google-cloud-secure_source_manager-v1/snippets/secure_source_manager/list_pull_request_file_diffs.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 securesourcemanager_v1_generated_SecureSourceManager_ListPullRequestFileDiffs_sync] +require "google/cloud/secure_source_manager/v1" + +## +# Snippet for the list_pull_request_file_diffs call in the SecureSourceManager service +# +# This snippet has been automatically generated and should be regarded as a code +# template only. It will require modifications to work: +# - It may require correct/in-range values for request initialization. +# - It may require specifying regional endpoints when creating the service +# client as shown in https://cloud.google.com/ruby/docs/reference. +# +# This is an auto-generated example demonstrating basic usage of +# Google::Cloud::SecureSourceManager::V1::SecureSourceManager::Client#list_pull_request_file_diffs. +# +def list_pull_request_file_diffs + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::SecureSourceManager::V1::SecureSourceManager::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::SecureSourceManager::V1::ListPullRequestFileDiffsRequest.new + + # Call the list_pull_request_file_diffs method. + result = client.list_pull_request_file_diffs request + + # The returned object is of type Gapic::PagedEnumerable. You can iterate + # over elements, and API calls will be issued to fetch pages as needed. + result.each do |item| + # Each element is of type ::Google::Cloud::SecureSourceManager::V1::FileDiff. + p item + end +end +# [END securesourcemanager_v1_generated_SecureSourceManager_ListPullRequestFileDiffs_sync] diff --git a/owl-bot-staging/google-cloud-secure_source_manager-v1/snippets/secure_source_manager/list_pull_requests.rb b/owl-bot-staging/google-cloud-secure_source_manager-v1/snippets/secure_source_manager/list_pull_requests.rb new file mode 100644 index 000000000000..7d7b6c3956a6 --- /dev/null +++ b/owl-bot-staging/google-cloud-secure_source_manager-v1/snippets/secure_source_manager/list_pull_requests.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 securesourcemanager_v1_generated_SecureSourceManager_ListPullRequests_sync] +require "google/cloud/secure_source_manager/v1" + +## +# Snippet for the list_pull_requests call in the SecureSourceManager service +# +# This snippet has been automatically generated and should be regarded as a code +# template only. It will require modifications to work: +# - It may require correct/in-range values for request initialization. +# - It may require specifying regional endpoints when creating the service +# client as shown in https://cloud.google.com/ruby/docs/reference. +# +# This is an auto-generated example demonstrating basic usage of +# Google::Cloud::SecureSourceManager::V1::SecureSourceManager::Client#list_pull_requests. +# +def list_pull_requests + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::SecureSourceManager::V1::SecureSourceManager::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::SecureSourceManager::V1::ListPullRequestsRequest.new + + # Call the list_pull_requests method. + result = client.list_pull_requests request + + # The returned object is of type Gapic::PagedEnumerable. You can iterate + # over elements, and API calls will be issued to fetch pages as needed. + result.each do |item| + # Each element is of type ::Google::Cloud::SecureSourceManager::V1::PullRequest. + p item + end +end +# [END securesourcemanager_v1_generated_SecureSourceManager_ListPullRequests_sync] diff --git a/owl-bot-staging/google-cloud-secure_source_manager-v1/snippets/secure_source_manager/list_repositories.rb b/owl-bot-staging/google-cloud-secure_source_manager-v1/snippets/secure_source_manager/list_repositories.rb new file mode 100644 index 000000000000..bed32be0efe7 --- /dev/null +++ b/owl-bot-staging/google-cloud-secure_source_manager-v1/snippets/secure_source_manager/list_repositories.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 securesourcemanager_v1_generated_SecureSourceManager_ListRepositories_sync] +require "google/cloud/secure_source_manager/v1" + +## +# Snippet for the list_repositories call in the SecureSourceManager service +# +# This snippet has been automatically generated and should be regarded as a code +# template only. It will require modifications to work: +# - It may require correct/in-range values for request initialization. +# - It may require specifying regional endpoints when creating the service +# client as shown in https://cloud.google.com/ruby/docs/reference. +# +# This is an auto-generated example demonstrating basic usage of +# Google::Cloud::SecureSourceManager::V1::SecureSourceManager::Client#list_repositories. +# +def list_repositories + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::SecureSourceManager::V1::SecureSourceManager::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::SecureSourceManager::V1::ListRepositoriesRequest.new + + # Call the list_repositories method. + result = client.list_repositories request + + # The returned object is of type Gapic::PagedEnumerable. You can iterate + # over elements, and API calls will be issued to fetch pages as needed. + result.each do |item| + # Each element is of type ::Google::Cloud::SecureSourceManager::V1::Repository. + p item + end +end +# [END securesourcemanager_v1_generated_SecureSourceManager_ListRepositories_sync] diff --git a/owl-bot-staging/google-cloud-secure_source_manager-v1/snippets/secure_source_manager/merge_pull_request.rb b/owl-bot-staging/google-cloud-secure_source_manager-v1/snippets/secure_source_manager/merge_pull_request.rb new file mode 100644 index 000000000000..a561bbc1483f --- /dev/null +++ b/owl-bot-staging/google-cloud-secure_source_manager-v1/snippets/secure_source_manager/merge_pull_request.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 securesourcemanager_v1_generated_SecureSourceManager_MergePullRequest_sync] +require "google/cloud/secure_source_manager/v1" + +## +# Snippet for the merge_pull_request call in the SecureSourceManager service +# +# This snippet has been automatically generated and should be regarded as a code +# template only. It will require modifications to work: +# - It may require correct/in-range values for request initialization. +# - It may require specifying regional endpoints when creating the service +# client as shown in https://cloud.google.com/ruby/docs/reference. +# +# This is an auto-generated example demonstrating basic usage of +# Google::Cloud::SecureSourceManager::V1::SecureSourceManager::Client#merge_pull_request. +# +def merge_pull_request + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::SecureSourceManager::V1::SecureSourceManager::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::SecureSourceManager::V1::MergePullRequestRequest.new + + # Call the merge_pull_request method. + result = client.merge_pull_request 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 securesourcemanager_v1_generated_SecureSourceManager_MergePullRequest_sync] diff --git a/owl-bot-staging/google-cloud-secure_source_manager-v1/snippets/secure_source_manager/open_issue.rb b/owl-bot-staging/google-cloud-secure_source_manager-v1/snippets/secure_source_manager/open_issue.rb new file mode 100644 index 000000000000..aac118b714ec --- /dev/null +++ b/owl-bot-staging/google-cloud-secure_source_manager-v1/snippets/secure_source_manager/open_issue.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 securesourcemanager_v1_generated_SecureSourceManager_OpenIssue_sync] +require "google/cloud/secure_source_manager/v1" + +## +# Snippet for the open_issue call in the SecureSourceManager service +# +# This snippet has been automatically generated and should be regarded as a code +# template only. It will require modifications to work: +# - It may require correct/in-range values for request initialization. +# - It may require specifying regional endpoints when creating the service +# client as shown in https://cloud.google.com/ruby/docs/reference. +# +# This is an auto-generated example demonstrating basic usage of +# Google::Cloud::SecureSourceManager::V1::SecureSourceManager::Client#open_issue. +# +def open_issue + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::SecureSourceManager::V1::SecureSourceManager::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::SecureSourceManager::V1::OpenIssueRequest.new + + # Call the open_issue method. + result = client.open_issue 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 securesourcemanager_v1_generated_SecureSourceManager_OpenIssue_sync] diff --git a/owl-bot-staging/google-cloud-secure_source_manager-v1/snippets/secure_source_manager/open_pull_request.rb b/owl-bot-staging/google-cloud-secure_source_manager-v1/snippets/secure_source_manager/open_pull_request.rb new file mode 100644 index 000000000000..e144b045570d --- /dev/null +++ b/owl-bot-staging/google-cloud-secure_source_manager-v1/snippets/secure_source_manager/open_pull_request.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 securesourcemanager_v1_generated_SecureSourceManager_OpenPullRequest_sync] +require "google/cloud/secure_source_manager/v1" + +## +# Snippet for the open_pull_request call in the SecureSourceManager service +# +# This snippet has been automatically generated and should be regarded as a code +# template only. It will require modifications to work: +# - It may require correct/in-range values for request initialization. +# - It may require specifying regional endpoints when creating the service +# client as shown in https://cloud.google.com/ruby/docs/reference. +# +# This is an auto-generated example demonstrating basic usage of +# Google::Cloud::SecureSourceManager::V1::SecureSourceManager::Client#open_pull_request. +# +def open_pull_request + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::SecureSourceManager::V1::SecureSourceManager::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::SecureSourceManager::V1::OpenPullRequestRequest.new + + # Call the open_pull_request method. + result = client.open_pull_request 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 securesourcemanager_v1_generated_SecureSourceManager_OpenPullRequest_sync] diff --git a/owl-bot-staging/google-cloud-secure_source_manager-v1/snippets/secure_source_manager/resolve_pull_request_comments.rb b/owl-bot-staging/google-cloud-secure_source_manager-v1/snippets/secure_source_manager/resolve_pull_request_comments.rb new file mode 100644 index 000000000000..7a9e2ed11b6c --- /dev/null +++ b/owl-bot-staging/google-cloud-secure_source_manager-v1/snippets/secure_source_manager/resolve_pull_request_comments.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 securesourcemanager_v1_generated_SecureSourceManager_ResolvePullRequestComments_sync] +require "google/cloud/secure_source_manager/v1" + +## +# Snippet for the resolve_pull_request_comments call in the SecureSourceManager service +# +# This snippet has been automatically generated and should be regarded as a code +# template only. It will require modifications to work: +# - It may require correct/in-range values for request initialization. +# - It may require specifying regional endpoints when creating the service +# client as shown in https://cloud.google.com/ruby/docs/reference. +# +# This is an auto-generated example demonstrating basic usage of +# Google::Cloud::SecureSourceManager::V1::SecureSourceManager::Client#resolve_pull_request_comments. +# +def resolve_pull_request_comments + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::SecureSourceManager::V1::SecureSourceManager::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::SecureSourceManager::V1::ResolvePullRequestCommentsRequest.new + + # Call the resolve_pull_request_comments method. + result = client.resolve_pull_request_comments 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 securesourcemanager_v1_generated_SecureSourceManager_ResolvePullRequestComments_sync] diff --git a/owl-bot-staging/google-cloud-secure_source_manager-v1/snippets/secure_source_manager/set_iam_policy_repo.rb b/owl-bot-staging/google-cloud-secure_source_manager-v1/snippets/secure_source_manager/set_iam_policy_repo.rb new file mode 100644 index 000000000000..9eaf3ef13717 --- /dev/null +++ b/owl-bot-staging/google-cloud-secure_source_manager-v1/snippets/secure_source_manager/set_iam_policy_repo.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 securesourcemanager_v1_generated_SecureSourceManager_SetIamPolicyRepo_sync] +require "google/cloud/secure_source_manager/v1" + +## +# Snippet for the set_iam_policy_repo call in the SecureSourceManager service +# +# This snippet has been automatically generated and should be regarded as a code +# template only. It will require modifications to work: +# - It may require correct/in-range values for request initialization. +# - It may require specifying regional endpoints when creating the service +# client as shown in https://cloud.google.com/ruby/docs/reference. +# +# This is an auto-generated example demonstrating basic usage of +# Google::Cloud::SecureSourceManager::V1::SecureSourceManager::Client#set_iam_policy_repo. +# +def set_iam_policy_repo + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::SecureSourceManager::V1::SecureSourceManager::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Iam::V1::SetIamPolicyRequest.new + + # Call the set_iam_policy_repo method. + result = client.set_iam_policy_repo request + + # The returned object is of type Google::Iam::V1::Policy. + p result +end +# [END securesourcemanager_v1_generated_SecureSourceManager_SetIamPolicyRepo_sync] diff --git a/owl-bot-staging/google-cloud-secure_source_manager-v1/snippets/secure_source_manager/test_iam_permissions_repo.rb b/owl-bot-staging/google-cloud-secure_source_manager-v1/snippets/secure_source_manager/test_iam_permissions_repo.rb new file mode 100644 index 000000000000..73012017a1b3 --- /dev/null +++ b/owl-bot-staging/google-cloud-secure_source_manager-v1/snippets/secure_source_manager/test_iam_permissions_repo.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 securesourcemanager_v1_generated_SecureSourceManager_TestIamPermissionsRepo_sync] +require "google/cloud/secure_source_manager/v1" + +## +# Snippet for the test_iam_permissions_repo call in the SecureSourceManager service +# +# This snippet has been automatically generated and should be regarded as a code +# template only. It will require modifications to work: +# - It may require correct/in-range values for request initialization. +# - It may require specifying regional endpoints when creating the service +# client as shown in https://cloud.google.com/ruby/docs/reference. +# +# This is an auto-generated example demonstrating basic usage of +# Google::Cloud::SecureSourceManager::V1::SecureSourceManager::Client#test_iam_permissions_repo. +# +def test_iam_permissions_repo + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::SecureSourceManager::V1::SecureSourceManager::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Iam::V1::TestIamPermissionsRequest.new + + # Call the test_iam_permissions_repo method. + result = client.test_iam_permissions_repo request + + # The returned object is of type Google::Iam::V1::TestIamPermissionsResponse. + p result +end +# [END securesourcemanager_v1_generated_SecureSourceManager_TestIamPermissionsRepo_sync] diff --git a/owl-bot-staging/google-cloud-secure_source_manager-v1/snippets/secure_source_manager/unresolve_pull_request_comments.rb b/owl-bot-staging/google-cloud-secure_source_manager-v1/snippets/secure_source_manager/unresolve_pull_request_comments.rb new file mode 100644 index 000000000000..d8c323b516f2 --- /dev/null +++ b/owl-bot-staging/google-cloud-secure_source_manager-v1/snippets/secure_source_manager/unresolve_pull_request_comments.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 securesourcemanager_v1_generated_SecureSourceManager_UnresolvePullRequestComments_sync] +require "google/cloud/secure_source_manager/v1" + +## +# Snippet for the unresolve_pull_request_comments call in the SecureSourceManager service +# +# This snippet has been automatically generated and should be regarded as a code +# template only. It will require modifications to work: +# - It may require correct/in-range values for request initialization. +# - It may require specifying regional endpoints when creating the service +# client as shown in https://cloud.google.com/ruby/docs/reference. +# +# This is an auto-generated example demonstrating basic usage of +# Google::Cloud::SecureSourceManager::V1::SecureSourceManager::Client#unresolve_pull_request_comments. +# +def unresolve_pull_request_comments + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::SecureSourceManager::V1::SecureSourceManager::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::SecureSourceManager::V1::UnresolvePullRequestCommentsRequest.new + + # Call the unresolve_pull_request_comments method. + result = client.unresolve_pull_request_comments 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 securesourcemanager_v1_generated_SecureSourceManager_UnresolvePullRequestComments_sync] diff --git a/owl-bot-staging/google-cloud-secure_source_manager-v1/snippets/secure_source_manager/update_branch_rule.rb b/owl-bot-staging/google-cloud-secure_source_manager-v1/snippets/secure_source_manager/update_branch_rule.rb new file mode 100644 index 000000000000..bd2c0fd99ca4 --- /dev/null +++ b/owl-bot-staging/google-cloud-secure_source_manager-v1/snippets/secure_source_manager/update_branch_rule.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 securesourcemanager_v1_generated_SecureSourceManager_UpdateBranchRule_sync] +require "google/cloud/secure_source_manager/v1" + +## +# Snippet for the update_branch_rule call in the SecureSourceManager service +# +# This snippet has been automatically generated and should be regarded as a code +# template only. It will require modifications to work: +# - It may require correct/in-range values for request initialization. +# - It may require specifying regional endpoints when creating the service +# client as shown in https://cloud.google.com/ruby/docs/reference. +# +# This is an auto-generated example demonstrating basic usage of +# Google::Cloud::SecureSourceManager::V1::SecureSourceManager::Client#update_branch_rule. +# +def update_branch_rule + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::SecureSourceManager::V1::SecureSourceManager::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::SecureSourceManager::V1::UpdateBranchRuleRequest.new + + # Call the update_branch_rule method. + result = client.update_branch_rule 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 securesourcemanager_v1_generated_SecureSourceManager_UpdateBranchRule_sync] diff --git a/owl-bot-staging/google-cloud-secure_source_manager-v1/snippets/secure_source_manager/update_hook.rb b/owl-bot-staging/google-cloud-secure_source_manager-v1/snippets/secure_source_manager/update_hook.rb new file mode 100644 index 000000000000..724f047f2413 --- /dev/null +++ b/owl-bot-staging/google-cloud-secure_source_manager-v1/snippets/secure_source_manager/update_hook.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 securesourcemanager_v1_generated_SecureSourceManager_UpdateHook_sync] +require "google/cloud/secure_source_manager/v1" + +## +# Snippet for the update_hook call in the SecureSourceManager service +# +# This snippet has been automatically generated and should be regarded as a code +# template only. It will require modifications to work: +# - It may require correct/in-range values for request initialization. +# - It may require specifying regional endpoints when creating the service +# client as shown in https://cloud.google.com/ruby/docs/reference. +# +# This is an auto-generated example demonstrating basic usage of +# Google::Cloud::SecureSourceManager::V1::SecureSourceManager::Client#update_hook. +# +def update_hook + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::SecureSourceManager::V1::SecureSourceManager::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::SecureSourceManager::V1::UpdateHookRequest.new + + # Call the update_hook method. + result = client.update_hook 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 securesourcemanager_v1_generated_SecureSourceManager_UpdateHook_sync] diff --git a/owl-bot-staging/google-cloud-secure_source_manager-v1/snippets/secure_source_manager/update_issue.rb b/owl-bot-staging/google-cloud-secure_source_manager-v1/snippets/secure_source_manager/update_issue.rb new file mode 100644 index 000000000000..4de76feb6560 --- /dev/null +++ b/owl-bot-staging/google-cloud-secure_source_manager-v1/snippets/secure_source_manager/update_issue.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 securesourcemanager_v1_generated_SecureSourceManager_UpdateIssue_sync] +require "google/cloud/secure_source_manager/v1" + +## +# Snippet for the update_issue call in the SecureSourceManager service +# +# This snippet has been automatically generated and should be regarded as a code +# template only. It will require modifications to work: +# - It may require correct/in-range values for request initialization. +# - It may require specifying regional endpoints when creating the service +# client as shown in https://cloud.google.com/ruby/docs/reference. +# +# This is an auto-generated example demonstrating basic usage of +# Google::Cloud::SecureSourceManager::V1::SecureSourceManager::Client#update_issue. +# +def update_issue + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::SecureSourceManager::V1::SecureSourceManager::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::SecureSourceManager::V1::UpdateIssueRequest.new + + # Call the update_issue method. + result = client.update_issue 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 securesourcemanager_v1_generated_SecureSourceManager_UpdateIssue_sync] diff --git a/owl-bot-staging/google-cloud-secure_source_manager-v1/snippets/secure_source_manager/update_issue_comment.rb b/owl-bot-staging/google-cloud-secure_source_manager-v1/snippets/secure_source_manager/update_issue_comment.rb new file mode 100644 index 000000000000..f19c0a363e5b --- /dev/null +++ b/owl-bot-staging/google-cloud-secure_source_manager-v1/snippets/secure_source_manager/update_issue_comment.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 securesourcemanager_v1_generated_SecureSourceManager_UpdateIssueComment_sync] +require "google/cloud/secure_source_manager/v1" + +## +# Snippet for the update_issue_comment call in the SecureSourceManager service +# +# This snippet has been automatically generated and should be regarded as a code +# template only. It will require modifications to work: +# - It may require correct/in-range values for request initialization. +# - It may require specifying regional endpoints when creating the service +# client as shown in https://cloud.google.com/ruby/docs/reference. +# +# This is an auto-generated example demonstrating basic usage of +# Google::Cloud::SecureSourceManager::V1::SecureSourceManager::Client#update_issue_comment. +# +def update_issue_comment + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::SecureSourceManager::V1::SecureSourceManager::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::SecureSourceManager::V1::UpdateIssueCommentRequest.new + + # Call the update_issue_comment method. + result = client.update_issue_comment 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 securesourcemanager_v1_generated_SecureSourceManager_UpdateIssueComment_sync] diff --git a/owl-bot-staging/google-cloud-secure_source_manager-v1/snippets/secure_source_manager/update_pull_request.rb b/owl-bot-staging/google-cloud-secure_source_manager-v1/snippets/secure_source_manager/update_pull_request.rb new file mode 100644 index 000000000000..caea95463f77 --- /dev/null +++ b/owl-bot-staging/google-cloud-secure_source_manager-v1/snippets/secure_source_manager/update_pull_request.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 securesourcemanager_v1_generated_SecureSourceManager_UpdatePullRequest_sync] +require "google/cloud/secure_source_manager/v1" + +## +# Snippet for the update_pull_request call in the SecureSourceManager service +# +# This snippet has been automatically generated and should be regarded as a code +# template only. It will require modifications to work: +# - It may require correct/in-range values for request initialization. +# - It may require specifying regional endpoints when creating the service +# client as shown in https://cloud.google.com/ruby/docs/reference. +# +# This is an auto-generated example demonstrating basic usage of +# Google::Cloud::SecureSourceManager::V1::SecureSourceManager::Client#update_pull_request. +# +def update_pull_request + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::SecureSourceManager::V1::SecureSourceManager::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::SecureSourceManager::V1::UpdatePullRequestRequest.new + + # Call the update_pull_request method. + result = client.update_pull_request 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 securesourcemanager_v1_generated_SecureSourceManager_UpdatePullRequest_sync] diff --git a/owl-bot-staging/google-cloud-secure_source_manager-v1/snippets/secure_source_manager/update_pull_request_comment.rb b/owl-bot-staging/google-cloud-secure_source_manager-v1/snippets/secure_source_manager/update_pull_request_comment.rb new file mode 100644 index 000000000000..902089aa57c5 --- /dev/null +++ b/owl-bot-staging/google-cloud-secure_source_manager-v1/snippets/secure_source_manager/update_pull_request_comment.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 securesourcemanager_v1_generated_SecureSourceManager_UpdatePullRequestComment_sync] +require "google/cloud/secure_source_manager/v1" + +## +# Snippet for the update_pull_request_comment call in the SecureSourceManager service +# +# This snippet has been automatically generated and should be regarded as a code +# template only. It will require modifications to work: +# - It may require correct/in-range values for request initialization. +# - It may require specifying regional endpoints when creating the service +# client as shown in https://cloud.google.com/ruby/docs/reference. +# +# This is an auto-generated example demonstrating basic usage of +# Google::Cloud::SecureSourceManager::V1::SecureSourceManager::Client#update_pull_request_comment. +# +def update_pull_request_comment + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::SecureSourceManager::V1::SecureSourceManager::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::SecureSourceManager::V1::UpdatePullRequestCommentRequest.new + + # Call the update_pull_request_comment method. + result = client.update_pull_request_comment 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 securesourcemanager_v1_generated_SecureSourceManager_UpdatePullRequestComment_sync] diff --git a/owl-bot-staging/google-cloud-secure_source_manager-v1/snippets/secure_source_manager/update_repository.rb b/owl-bot-staging/google-cloud-secure_source_manager-v1/snippets/secure_source_manager/update_repository.rb new file mode 100644 index 000000000000..fa3df85ca997 --- /dev/null +++ b/owl-bot-staging/google-cloud-secure_source_manager-v1/snippets/secure_source_manager/update_repository.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 securesourcemanager_v1_generated_SecureSourceManager_UpdateRepository_sync] +require "google/cloud/secure_source_manager/v1" + +## +# Snippet for the update_repository call in the SecureSourceManager service +# +# This snippet has been automatically generated and should be regarded as a code +# template only. It will require modifications to work: +# - It may require correct/in-range values for request initialization. +# - It may require specifying regional endpoints when creating the service +# client as shown in https://cloud.google.com/ruby/docs/reference. +# +# This is an auto-generated example demonstrating basic usage of +# Google::Cloud::SecureSourceManager::V1::SecureSourceManager::Client#update_repository. +# +def update_repository + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::SecureSourceManager::V1::SecureSourceManager::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::SecureSourceManager::V1::UpdateRepositoryRequest.new + + # Call the update_repository method. + result = client.update_repository 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 securesourcemanager_v1_generated_SecureSourceManager_UpdateRepository_sync] diff --git a/owl-bot-staging/google-cloud-secure_source_manager-v1/snippets/snippet_metadata_google.cloud.securesourcemanager.v1.json b/owl-bot-staging/google-cloud-secure_source_manager-v1/snippets/snippet_metadata_google.cloud.securesourcemanager.v1.json new file mode 100644 index 000000000000..98391cb30a6e --- /dev/null +++ b/owl-bot-staging/google-cloud-secure_source_manager-v1/snippets/snippet_metadata_google.cloud.securesourcemanager.v1.json @@ -0,0 +1,2095 @@ +{ + "client_library": { + "name": "google-cloud-secure_source_manager-v1", + "version": "", + "language": "RUBY", + "apis": [ + { + "id": "google.cloud.securesourcemanager.v1", + "version": "v1" + } + ] + }, + "snippets": [ + { + "region_tag": "securesourcemanager_v1_generated_SecureSourceManager_ListInstances_sync", + "title": "Snippet for the list_instances call in the SecureSourceManager service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::SecureSourceManager::V1::SecureSourceManager::Client#list_instances.", + "file": "secure_source_manager/list_instances.rb", + "language": "RUBY", + "client_method": { + "short_name": "list_instances", + "full_name": "::Google::Cloud::SecureSourceManager::V1::SecureSourceManager::Client#list_instances", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::SecureSourceManager::V1::ListInstancesRequest", + "name": "request" + } + ], + "result_type": "::Google::Cloud::SecureSourceManager::V1::ListInstancesResponse", + "client": { + "short_name": "SecureSourceManager::Client", + "full_name": "::Google::Cloud::SecureSourceManager::V1::SecureSourceManager::Client" + }, + "method": { + "short_name": "ListInstances", + "full_name": "google.cloud.securesourcemanager.v1.SecureSourceManager.ListInstances", + "service": { + "short_name": "SecureSourceManager", + "full_name": "google.cloud.securesourcemanager.v1.SecureSourceManager" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 50, + "type": "FULL" + } + ] + }, + { + "region_tag": "securesourcemanager_v1_generated_SecureSourceManager_GetInstance_sync", + "title": "Snippet for the get_instance call in the SecureSourceManager service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::SecureSourceManager::V1::SecureSourceManager::Client#get_instance.", + "file": "secure_source_manager/get_instance.rb", + "language": "RUBY", + "client_method": { + "short_name": "get_instance", + "full_name": "::Google::Cloud::SecureSourceManager::V1::SecureSourceManager::Client#get_instance", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::SecureSourceManager::V1::GetInstanceRequest", + "name": "request" + } + ], + "result_type": "::Google::Cloud::SecureSourceManager::V1::Instance", + "client": { + "short_name": "SecureSourceManager::Client", + "full_name": "::Google::Cloud::SecureSourceManager::V1::SecureSourceManager::Client" + }, + "method": { + "short_name": "GetInstance", + "full_name": "google.cloud.securesourcemanager.v1.SecureSourceManager.GetInstance", + "service": { + "short_name": "SecureSourceManager", + "full_name": "google.cloud.securesourcemanager.v1.SecureSourceManager" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 46, + "type": "FULL" + } + ] + }, + { + "region_tag": "securesourcemanager_v1_generated_SecureSourceManager_CreateInstance_sync", + "title": "Snippet for the create_instance call in the SecureSourceManager service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::SecureSourceManager::V1::SecureSourceManager::Client#create_instance.", + "file": "secure_source_manager/create_instance.rb", + "language": "RUBY", + "client_method": { + "short_name": "create_instance", + "full_name": "::Google::Cloud::SecureSourceManager::V1::SecureSourceManager::Client#create_instance", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::SecureSourceManager::V1::CreateInstanceRequest", + "name": "request" + } + ], + "result_type": "::Google::Longrunning::Operation", + "client": { + "short_name": "SecureSourceManager::Client", + "full_name": "::Google::Cloud::SecureSourceManager::V1::SecureSourceManager::Client" + }, + "method": { + "short_name": "CreateInstance", + "full_name": "google.cloud.securesourcemanager.v1.SecureSourceManager.CreateInstance", + "service": { + "short_name": "SecureSourceManager", + "full_name": "google.cloud.securesourcemanager.v1.SecureSourceManager" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 53, + "type": "FULL" + } + ] + }, + { + "region_tag": "securesourcemanager_v1_generated_SecureSourceManager_DeleteInstance_sync", + "title": "Snippet for the delete_instance call in the SecureSourceManager service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::SecureSourceManager::V1::SecureSourceManager::Client#delete_instance.", + "file": "secure_source_manager/delete_instance.rb", + "language": "RUBY", + "client_method": { + "short_name": "delete_instance", + "full_name": "::Google::Cloud::SecureSourceManager::V1::SecureSourceManager::Client#delete_instance", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::SecureSourceManager::V1::DeleteInstanceRequest", + "name": "request" + } + ], + "result_type": "::Google::Longrunning::Operation", + "client": { + "short_name": "SecureSourceManager::Client", + "full_name": "::Google::Cloud::SecureSourceManager::V1::SecureSourceManager::Client" + }, + "method": { + "short_name": "DeleteInstance", + "full_name": "google.cloud.securesourcemanager.v1.SecureSourceManager.DeleteInstance", + "service": { + "short_name": "SecureSourceManager", + "full_name": "google.cloud.securesourcemanager.v1.SecureSourceManager" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 53, + "type": "FULL" + } + ] + }, + { + "region_tag": "securesourcemanager_v1_generated_SecureSourceManager_ListRepositories_sync", + "title": "Snippet for the list_repositories call in the SecureSourceManager service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::SecureSourceManager::V1::SecureSourceManager::Client#list_repositories.", + "file": "secure_source_manager/list_repositories.rb", + "language": "RUBY", + "client_method": { + "short_name": "list_repositories", + "full_name": "::Google::Cloud::SecureSourceManager::V1::SecureSourceManager::Client#list_repositories", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::SecureSourceManager::V1::ListRepositoriesRequest", + "name": "request" + } + ], + "result_type": "::Google::Cloud::SecureSourceManager::V1::ListRepositoriesResponse", + "client": { + "short_name": "SecureSourceManager::Client", + "full_name": "::Google::Cloud::SecureSourceManager::V1::SecureSourceManager::Client" + }, + "method": { + "short_name": "ListRepositories", + "full_name": "google.cloud.securesourcemanager.v1.SecureSourceManager.ListRepositories", + "service": { + "short_name": "SecureSourceManager", + "full_name": "google.cloud.securesourcemanager.v1.SecureSourceManager" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 50, + "type": "FULL" + } + ] + }, + { + "region_tag": "securesourcemanager_v1_generated_SecureSourceManager_GetRepository_sync", + "title": "Snippet for the get_repository call in the SecureSourceManager service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::SecureSourceManager::V1::SecureSourceManager::Client#get_repository.", + "file": "secure_source_manager/get_repository.rb", + "language": "RUBY", + "client_method": { + "short_name": "get_repository", + "full_name": "::Google::Cloud::SecureSourceManager::V1::SecureSourceManager::Client#get_repository", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::SecureSourceManager::V1::GetRepositoryRequest", + "name": "request" + } + ], + "result_type": "::Google::Cloud::SecureSourceManager::V1::Repository", + "client": { + "short_name": "SecureSourceManager::Client", + "full_name": "::Google::Cloud::SecureSourceManager::V1::SecureSourceManager::Client" + }, + "method": { + "short_name": "GetRepository", + "full_name": "google.cloud.securesourcemanager.v1.SecureSourceManager.GetRepository", + "service": { + "short_name": "SecureSourceManager", + "full_name": "google.cloud.securesourcemanager.v1.SecureSourceManager" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 46, + "type": "FULL" + } + ] + }, + { + "region_tag": "securesourcemanager_v1_generated_SecureSourceManager_CreateRepository_sync", + "title": "Snippet for the create_repository call in the SecureSourceManager service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::SecureSourceManager::V1::SecureSourceManager::Client#create_repository.", + "file": "secure_source_manager/create_repository.rb", + "language": "RUBY", + "client_method": { + "short_name": "create_repository", + "full_name": "::Google::Cloud::SecureSourceManager::V1::SecureSourceManager::Client#create_repository", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::SecureSourceManager::V1::CreateRepositoryRequest", + "name": "request" + } + ], + "result_type": "::Google::Longrunning::Operation", + "client": { + "short_name": "SecureSourceManager::Client", + "full_name": "::Google::Cloud::SecureSourceManager::V1::SecureSourceManager::Client" + }, + "method": { + "short_name": "CreateRepository", + "full_name": "google.cloud.securesourcemanager.v1.SecureSourceManager.CreateRepository", + "service": { + "short_name": "SecureSourceManager", + "full_name": "google.cloud.securesourcemanager.v1.SecureSourceManager" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 53, + "type": "FULL" + } + ] + }, + { + "region_tag": "securesourcemanager_v1_generated_SecureSourceManager_UpdateRepository_sync", + "title": "Snippet for the update_repository call in the SecureSourceManager service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::SecureSourceManager::V1::SecureSourceManager::Client#update_repository.", + "file": "secure_source_manager/update_repository.rb", + "language": "RUBY", + "client_method": { + "short_name": "update_repository", + "full_name": "::Google::Cloud::SecureSourceManager::V1::SecureSourceManager::Client#update_repository", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::SecureSourceManager::V1::UpdateRepositoryRequest", + "name": "request" + } + ], + "result_type": "::Google::Longrunning::Operation", + "client": { + "short_name": "SecureSourceManager::Client", + "full_name": "::Google::Cloud::SecureSourceManager::V1::SecureSourceManager::Client" + }, + "method": { + "short_name": "UpdateRepository", + "full_name": "google.cloud.securesourcemanager.v1.SecureSourceManager.UpdateRepository", + "service": { + "short_name": "SecureSourceManager", + "full_name": "google.cloud.securesourcemanager.v1.SecureSourceManager" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 53, + "type": "FULL" + } + ] + }, + { + "region_tag": "securesourcemanager_v1_generated_SecureSourceManager_DeleteRepository_sync", + "title": "Snippet for the delete_repository call in the SecureSourceManager service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::SecureSourceManager::V1::SecureSourceManager::Client#delete_repository.", + "file": "secure_source_manager/delete_repository.rb", + "language": "RUBY", + "client_method": { + "short_name": "delete_repository", + "full_name": "::Google::Cloud::SecureSourceManager::V1::SecureSourceManager::Client#delete_repository", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::SecureSourceManager::V1::DeleteRepositoryRequest", + "name": "request" + } + ], + "result_type": "::Google::Longrunning::Operation", + "client": { + "short_name": "SecureSourceManager::Client", + "full_name": "::Google::Cloud::SecureSourceManager::V1::SecureSourceManager::Client" + }, + "method": { + "short_name": "DeleteRepository", + "full_name": "google.cloud.securesourcemanager.v1.SecureSourceManager.DeleteRepository", + "service": { + "short_name": "SecureSourceManager", + "full_name": "google.cloud.securesourcemanager.v1.SecureSourceManager" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 53, + "type": "FULL" + } + ] + }, + { + "region_tag": "securesourcemanager_v1_generated_SecureSourceManager_ListHooks_sync", + "title": "Snippet for the list_hooks call in the SecureSourceManager service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::SecureSourceManager::V1::SecureSourceManager::Client#list_hooks.", + "file": "secure_source_manager/list_hooks.rb", + "language": "RUBY", + "client_method": { + "short_name": "list_hooks", + "full_name": "::Google::Cloud::SecureSourceManager::V1::SecureSourceManager::Client#list_hooks", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::SecureSourceManager::V1::ListHooksRequest", + "name": "request" + } + ], + "result_type": "::Google::Cloud::SecureSourceManager::V1::ListHooksResponse", + "client": { + "short_name": "SecureSourceManager::Client", + "full_name": "::Google::Cloud::SecureSourceManager::V1::SecureSourceManager::Client" + }, + "method": { + "short_name": "ListHooks", + "full_name": "google.cloud.securesourcemanager.v1.SecureSourceManager.ListHooks", + "service": { + "short_name": "SecureSourceManager", + "full_name": "google.cloud.securesourcemanager.v1.SecureSourceManager" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 50, + "type": "FULL" + } + ] + }, + { + "region_tag": "securesourcemanager_v1_generated_SecureSourceManager_GetHook_sync", + "title": "Snippet for the get_hook call in the SecureSourceManager service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::SecureSourceManager::V1::SecureSourceManager::Client#get_hook.", + "file": "secure_source_manager/get_hook.rb", + "language": "RUBY", + "client_method": { + "short_name": "get_hook", + "full_name": "::Google::Cloud::SecureSourceManager::V1::SecureSourceManager::Client#get_hook", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::SecureSourceManager::V1::GetHookRequest", + "name": "request" + } + ], + "result_type": "::Google::Cloud::SecureSourceManager::V1::Hook", + "client": { + "short_name": "SecureSourceManager::Client", + "full_name": "::Google::Cloud::SecureSourceManager::V1::SecureSourceManager::Client" + }, + "method": { + "short_name": "GetHook", + "full_name": "google.cloud.securesourcemanager.v1.SecureSourceManager.GetHook", + "service": { + "short_name": "SecureSourceManager", + "full_name": "google.cloud.securesourcemanager.v1.SecureSourceManager" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 46, + "type": "FULL" + } + ] + }, + { + "region_tag": "securesourcemanager_v1_generated_SecureSourceManager_CreateHook_sync", + "title": "Snippet for the create_hook call in the SecureSourceManager service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::SecureSourceManager::V1::SecureSourceManager::Client#create_hook.", + "file": "secure_source_manager/create_hook.rb", + "language": "RUBY", + "client_method": { + "short_name": "create_hook", + "full_name": "::Google::Cloud::SecureSourceManager::V1::SecureSourceManager::Client#create_hook", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::SecureSourceManager::V1::CreateHookRequest", + "name": "request" + } + ], + "result_type": "::Google::Longrunning::Operation", + "client": { + "short_name": "SecureSourceManager::Client", + "full_name": "::Google::Cloud::SecureSourceManager::V1::SecureSourceManager::Client" + }, + "method": { + "short_name": "CreateHook", + "full_name": "google.cloud.securesourcemanager.v1.SecureSourceManager.CreateHook", + "service": { + "short_name": "SecureSourceManager", + "full_name": "google.cloud.securesourcemanager.v1.SecureSourceManager" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 53, + "type": "FULL" + } + ] + }, + { + "region_tag": "securesourcemanager_v1_generated_SecureSourceManager_UpdateHook_sync", + "title": "Snippet for the update_hook call in the SecureSourceManager service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::SecureSourceManager::V1::SecureSourceManager::Client#update_hook.", + "file": "secure_source_manager/update_hook.rb", + "language": "RUBY", + "client_method": { + "short_name": "update_hook", + "full_name": "::Google::Cloud::SecureSourceManager::V1::SecureSourceManager::Client#update_hook", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::SecureSourceManager::V1::UpdateHookRequest", + "name": "request" + } + ], + "result_type": "::Google::Longrunning::Operation", + "client": { + "short_name": "SecureSourceManager::Client", + "full_name": "::Google::Cloud::SecureSourceManager::V1::SecureSourceManager::Client" + }, + "method": { + "short_name": "UpdateHook", + "full_name": "google.cloud.securesourcemanager.v1.SecureSourceManager.UpdateHook", + "service": { + "short_name": "SecureSourceManager", + "full_name": "google.cloud.securesourcemanager.v1.SecureSourceManager" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 53, + "type": "FULL" + } + ] + }, + { + "region_tag": "securesourcemanager_v1_generated_SecureSourceManager_DeleteHook_sync", + "title": "Snippet for the delete_hook call in the SecureSourceManager service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::SecureSourceManager::V1::SecureSourceManager::Client#delete_hook.", + "file": "secure_source_manager/delete_hook.rb", + "language": "RUBY", + "client_method": { + "short_name": "delete_hook", + "full_name": "::Google::Cloud::SecureSourceManager::V1::SecureSourceManager::Client#delete_hook", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::SecureSourceManager::V1::DeleteHookRequest", + "name": "request" + } + ], + "result_type": "::Google::Longrunning::Operation", + "client": { + "short_name": "SecureSourceManager::Client", + "full_name": "::Google::Cloud::SecureSourceManager::V1::SecureSourceManager::Client" + }, + "method": { + "short_name": "DeleteHook", + "full_name": "google.cloud.securesourcemanager.v1.SecureSourceManager.DeleteHook", + "service": { + "short_name": "SecureSourceManager", + "full_name": "google.cloud.securesourcemanager.v1.SecureSourceManager" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 53, + "type": "FULL" + } + ] + }, + { + "region_tag": "securesourcemanager_v1_generated_SecureSourceManager_GetIamPolicyRepo_sync", + "title": "Snippet for the get_iam_policy_repo call in the SecureSourceManager service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::SecureSourceManager::V1::SecureSourceManager::Client#get_iam_policy_repo.", + "file": "secure_source_manager/get_iam_policy_repo.rb", + "language": "RUBY", + "client_method": { + "short_name": "get_iam_policy_repo", + "full_name": "::Google::Cloud::SecureSourceManager::V1::SecureSourceManager::Client#get_iam_policy_repo", + "async": false, + "parameters": [ + { + "type": "::Google::Iam::V1::GetIamPolicyRequest", + "name": "request" + } + ], + "result_type": "::Google::Iam::V1::Policy", + "client": { + "short_name": "SecureSourceManager::Client", + "full_name": "::Google::Cloud::SecureSourceManager::V1::SecureSourceManager::Client" + }, + "method": { + "short_name": "GetIamPolicyRepo", + "full_name": "google.cloud.securesourcemanager.v1.SecureSourceManager.GetIamPolicyRepo", + "service": { + "short_name": "SecureSourceManager", + "full_name": "google.cloud.securesourcemanager.v1.SecureSourceManager" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 46, + "type": "FULL" + } + ] + }, + { + "region_tag": "securesourcemanager_v1_generated_SecureSourceManager_SetIamPolicyRepo_sync", + "title": "Snippet for the set_iam_policy_repo call in the SecureSourceManager service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::SecureSourceManager::V1::SecureSourceManager::Client#set_iam_policy_repo.", + "file": "secure_source_manager/set_iam_policy_repo.rb", + "language": "RUBY", + "client_method": { + "short_name": "set_iam_policy_repo", + "full_name": "::Google::Cloud::SecureSourceManager::V1::SecureSourceManager::Client#set_iam_policy_repo", + "async": false, + "parameters": [ + { + "type": "::Google::Iam::V1::SetIamPolicyRequest", + "name": "request" + } + ], + "result_type": "::Google::Iam::V1::Policy", + "client": { + "short_name": "SecureSourceManager::Client", + "full_name": "::Google::Cloud::SecureSourceManager::V1::SecureSourceManager::Client" + }, + "method": { + "short_name": "SetIamPolicyRepo", + "full_name": "google.cloud.securesourcemanager.v1.SecureSourceManager.SetIamPolicyRepo", + "service": { + "short_name": "SecureSourceManager", + "full_name": "google.cloud.securesourcemanager.v1.SecureSourceManager" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 46, + "type": "FULL" + } + ] + }, + { + "region_tag": "securesourcemanager_v1_generated_SecureSourceManager_TestIamPermissionsRepo_sync", + "title": "Snippet for the test_iam_permissions_repo call in the SecureSourceManager service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::SecureSourceManager::V1::SecureSourceManager::Client#test_iam_permissions_repo.", + "file": "secure_source_manager/test_iam_permissions_repo.rb", + "language": "RUBY", + "client_method": { + "short_name": "test_iam_permissions_repo", + "full_name": "::Google::Cloud::SecureSourceManager::V1::SecureSourceManager::Client#test_iam_permissions_repo", + "async": false, + "parameters": [ + { + "type": "::Google::Iam::V1::TestIamPermissionsRequest", + "name": "request" + } + ], + "result_type": "::Google::Iam::V1::TestIamPermissionsResponse", + "client": { + "short_name": "SecureSourceManager::Client", + "full_name": "::Google::Cloud::SecureSourceManager::V1::SecureSourceManager::Client" + }, + "method": { + "short_name": "TestIamPermissionsRepo", + "full_name": "google.cloud.securesourcemanager.v1.SecureSourceManager.TestIamPermissionsRepo", + "service": { + "short_name": "SecureSourceManager", + "full_name": "google.cloud.securesourcemanager.v1.SecureSourceManager" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 46, + "type": "FULL" + } + ] + }, + { + "region_tag": "securesourcemanager_v1_generated_SecureSourceManager_CreateBranchRule_sync", + "title": "Snippet for the create_branch_rule call in the SecureSourceManager service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::SecureSourceManager::V1::SecureSourceManager::Client#create_branch_rule.", + "file": "secure_source_manager/create_branch_rule.rb", + "language": "RUBY", + "client_method": { + "short_name": "create_branch_rule", + "full_name": "::Google::Cloud::SecureSourceManager::V1::SecureSourceManager::Client#create_branch_rule", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::SecureSourceManager::V1::CreateBranchRuleRequest", + "name": "request" + } + ], + "result_type": "::Google::Longrunning::Operation", + "client": { + "short_name": "SecureSourceManager::Client", + "full_name": "::Google::Cloud::SecureSourceManager::V1::SecureSourceManager::Client" + }, + "method": { + "short_name": "CreateBranchRule", + "full_name": "google.cloud.securesourcemanager.v1.SecureSourceManager.CreateBranchRule", + "service": { + "short_name": "SecureSourceManager", + "full_name": "google.cloud.securesourcemanager.v1.SecureSourceManager" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 53, + "type": "FULL" + } + ] + }, + { + "region_tag": "securesourcemanager_v1_generated_SecureSourceManager_ListBranchRules_sync", + "title": "Snippet for the list_branch_rules call in the SecureSourceManager service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::SecureSourceManager::V1::SecureSourceManager::Client#list_branch_rules.", + "file": "secure_source_manager/list_branch_rules.rb", + "language": "RUBY", + "client_method": { + "short_name": "list_branch_rules", + "full_name": "::Google::Cloud::SecureSourceManager::V1::SecureSourceManager::Client#list_branch_rules", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::SecureSourceManager::V1::ListBranchRulesRequest", + "name": "request" + } + ], + "result_type": "::Google::Cloud::SecureSourceManager::V1::ListBranchRulesResponse", + "client": { + "short_name": "SecureSourceManager::Client", + "full_name": "::Google::Cloud::SecureSourceManager::V1::SecureSourceManager::Client" + }, + "method": { + "short_name": "ListBranchRules", + "full_name": "google.cloud.securesourcemanager.v1.SecureSourceManager.ListBranchRules", + "service": { + "short_name": "SecureSourceManager", + "full_name": "google.cloud.securesourcemanager.v1.SecureSourceManager" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 50, + "type": "FULL" + } + ] + }, + { + "region_tag": "securesourcemanager_v1_generated_SecureSourceManager_GetBranchRule_sync", + "title": "Snippet for the get_branch_rule call in the SecureSourceManager service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::SecureSourceManager::V1::SecureSourceManager::Client#get_branch_rule.", + "file": "secure_source_manager/get_branch_rule.rb", + "language": "RUBY", + "client_method": { + "short_name": "get_branch_rule", + "full_name": "::Google::Cloud::SecureSourceManager::V1::SecureSourceManager::Client#get_branch_rule", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::SecureSourceManager::V1::GetBranchRuleRequest", + "name": "request" + } + ], + "result_type": "::Google::Cloud::SecureSourceManager::V1::BranchRule", + "client": { + "short_name": "SecureSourceManager::Client", + "full_name": "::Google::Cloud::SecureSourceManager::V1::SecureSourceManager::Client" + }, + "method": { + "short_name": "GetBranchRule", + "full_name": "google.cloud.securesourcemanager.v1.SecureSourceManager.GetBranchRule", + "service": { + "short_name": "SecureSourceManager", + "full_name": "google.cloud.securesourcemanager.v1.SecureSourceManager" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 46, + "type": "FULL" + } + ] + }, + { + "region_tag": "securesourcemanager_v1_generated_SecureSourceManager_UpdateBranchRule_sync", + "title": "Snippet for the update_branch_rule call in the SecureSourceManager service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::SecureSourceManager::V1::SecureSourceManager::Client#update_branch_rule.", + "file": "secure_source_manager/update_branch_rule.rb", + "language": "RUBY", + "client_method": { + "short_name": "update_branch_rule", + "full_name": "::Google::Cloud::SecureSourceManager::V1::SecureSourceManager::Client#update_branch_rule", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::SecureSourceManager::V1::UpdateBranchRuleRequest", + "name": "request" + } + ], + "result_type": "::Google::Longrunning::Operation", + "client": { + "short_name": "SecureSourceManager::Client", + "full_name": "::Google::Cloud::SecureSourceManager::V1::SecureSourceManager::Client" + }, + "method": { + "short_name": "UpdateBranchRule", + "full_name": "google.cloud.securesourcemanager.v1.SecureSourceManager.UpdateBranchRule", + "service": { + "short_name": "SecureSourceManager", + "full_name": "google.cloud.securesourcemanager.v1.SecureSourceManager" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 53, + "type": "FULL" + } + ] + }, + { + "region_tag": "securesourcemanager_v1_generated_SecureSourceManager_DeleteBranchRule_sync", + "title": "Snippet for the delete_branch_rule call in the SecureSourceManager service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::SecureSourceManager::V1::SecureSourceManager::Client#delete_branch_rule.", + "file": "secure_source_manager/delete_branch_rule.rb", + "language": "RUBY", + "client_method": { + "short_name": "delete_branch_rule", + "full_name": "::Google::Cloud::SecureSourceManager::V1::SecureSourceManager::Client#delete_branch_rule", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::SecureSourceManager::V1::DeleteBranchRuleRequest", + "name": "request" + } + ], + "result_type": "::Google::Longrunning::Operation", + "client": { + "short_name": "SecureSourceManager::Client", + "full_name": "::Google::Cloud::SecureSourceManager::V1::SecureSourceManager::Client" + }, + "method": { + "short_name": "DeleteBranchRule", + "full_name": "google.cloud.securesourcemanager.v1.SecureSourceManager.DeleteBranchRule", + "service": { + "short_name": "SecureSourceManager", + "full_name": "google.cloud.securesourcemanager.v1.SecureSourceManager" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 53, + "type": "FULL" + } + ] + }, + { + "region_tag": "securesourcemanager_v1_generated_SecureSourceManager_CreatePullRequest_sync", + "title": "Snippet for the create_pull_request call in the SecureSourceManager service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::SecureSourceManager::V1::SecureSourceManager::Client#create_pull_request.", + "file": "secure_source_manager/create_pull_request.rb", + "language": "RUBY", + "client_method": { + "short_name": "create_pull_request", + "full_name": "::Google::Cloud::SecureSourceManager::V1::SecureSourceManager::Client#create_pull_request", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::SecureSourceManager::V1::CreatePullRequestRequest", + "name": "request" + } + ], + "result_type": "::Google::Longrunning::Operation", + "client": { + "short_name": "SecureSourceManager::Client", + "full_name": "::Google::Cloud::SecureSourceManager::V1::SecureSourceManager::Client" + }, + "method": { + "short_name": "CreatePullRequest", + "full_name": "google.cloud.securesourcemanager.v1.SecureSourceManager.CreatePullRequest", + "service": { + "short_name": "SecureSourceManager", + "full_name": "google.cloud.securesourcemanager.v1.SecureSourceManager" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 53, + "type": "FULL" + } + ] + }, + { + "region_tag": "securesourcemanager_v1_generated_SecureSourceManager_GetPullRequest_sync", + "title": "Snippet for the get_pull_request call in the SecureSourceManager service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::SecureSourceManager::V1::SecureSourceManager::Client#get_pull_request.", + "file": "secure_source_manager/get_pull_request.rb", + "language": "RUBY", + "client_method": { + "short_name": "get_pull_request", + "full_name": "::Google::Cloud::SecureSourceManager::V1::SecureSourceManager::Client#get_pull_request", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::SecureSourceManager::V1::GetPullRequestRequest", + "name": "request" + } + ], + "result_type": "::Google::Cloud::SecureSourceManager::V1::PullRequest", + "client": { + "short_name": "SecureSourceManager::Client", + "full_name": "::Google::Cloud::SecureSourceManager::V1::SecureSourceManager::Client" + }, + "method": { + "short_name": "GetPullRequest", + "full_name": "google.cloud.securesourcemanager.v1.SecureSourceManager.GetPullRequest", + "service": { + "short_name": "SecureSourceManager", + "full_name": "google.cloud.securesourcemanager.v1.SecureSourceManager" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 46, + "type": "FULL" + } + ] + }, + { + "region_tag": "securesourcemanager_v1_generated_SecureSourceManager_ListPullRequests_sync", + "title": "Snippet for the list_pull_requests call in the SecureSourceManager service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::SecureSourceManager::V1::SecureSourceManager::Client#list_pull_requests.", + "file": "secure_source_manager/list_pull_requests.rb", + "language": "RUBY", + "client_method": { + "short_name": "list_pull_requests", + "full_name": "::Google::Cloud::SecureSourceManager::V1::SecureSourceManager::Client#list_pull_requests", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::SecureSourceManager::V1::ListPullRequestsRequest", + "name": "request" + } + ], + "result_type": "::Google::Cloud::SecureSourceManager::V1::ListPullRequestsResponse", + "client": { + "short_name": "SecureSourceManager::Client", + "full_name": "::Google::Cloud::SecureSourceManager::V1::SecureSourceManager::Client" + }, + "method": { + "short_name": "ListPullRequests", + "full_name": "google.cloud.securesourcemanager.v1.SecureSourceManager.ListPullRequests", + "service": { + "short_name": "SecureSourceManager", + "full_name": "google.cloud.securesourcemanager.v1.SecureSourceManager" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 50, + "type": "FULL" + } + ] + }, + { + "region_tag": "securesourcemanager_v1_generated_SecureSourceManager_UpdatePullRequest_sync", + "title": "Snippet for the update_pull_request call in the SecureSourceManager service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::SecureSourceManager::V1::SecureSourceManager::Client#update_pull_request.", + "file": "secure_source_manager/update_pull_request.rb", + "language": "RUBY", + "client_method": { + "short_name": "update_pull_request", + "full_name": "::Google::Cloud::SecureSourceManager::V1::SecureSourceManager::Client#update_pull_request", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::SecureSourceManager::V1::UpdatePullRequestRequest", + "name": "request" + } + ], + "result_type": "::Google::Longrunning::Operation", + "client": { + "short_name": "SecureSourceManager::Client", + "full_name": "::Google::Cloud::SecureSourceManager::V1::SecureSourceManager::Client" + }, + "method": { + "short_name": "UpdatePullRequest", + "full_name": "google.cloud.securesourcemanager.v1.SecureSourceManager.UpdatePullRequest", + "service": { + "short_name": "SecureSourceManager", + "full_name": "google.cloud.securesourcemanager.v1.SecureSourceManager" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 53, + "type": "FULL" + } + ] + }, + { + "region_tag": "securesourcemanager_v1_generated_SecureSourceManager_MergePullRequest_sync", + "title": "Snippet for the merge_pull_request call in the SecureSourceManager service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::SecureSourceManager::V1::SecureSourceManager::Client#merge_pull_request.", + "file": "secure_source_manager/merge_pull_request.rb", + "language": "RUBY", + "client_method": { + "short_name": "merge_pull_request", + "full_name": "::Google::Cloud::SecureSourceManager::V1::SecureSourceManager::Client#merge_pull_request", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::SecureSourceManager::V1::MergePullRequestRequest", + "name": "request" + } + ], + "result_type": "::Google::Longrunning::Operation", + "client": { + "short_name": "SecureSourceManager::Client", + "full_name": "::Google::Cloud::SecureSourceManager::V1::SecureSourceManager::Client" + }, + "method": { + "short_name": "MergePullRequest", + "full_name": "google.cloud.securesourcemanager.v1.SecureSourceManager.MergePullRequest", + "service": { + "short_name": "SecureSourceManager", + "full_name": "google.cloud.securesourcemanager.v1.SecureSourceManager" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 53, + "type": "FULL" + } + ] + }, + { + "region_tag": "securesourcemanager_v1_generated_SecureSourceManager_OpenPullRequest_sync", + "title": "Snippet for the open_pull_request call in the SecureSourceManager service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::SecureSourceManager::V1::SecureSourceManager::Client#open_pull_request.", + "file": "secure_source_manager/open_pull_request.rb", + "language": "RUBY", + "client_method": { + "short_name": "open_pull_request", + "full_name": "::Google::Cloud::SecureSourceManager::V1::SecureSourceManager::Client#open_pull_request", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::SecureSourceManager::V1::OpenPullRequestRequest", + "name": "request" + } + ], + "result_type": "::Google::Longrunning::Operation", + "client": { + "short_name": "SecureSourceManager::Client", + "full_name": "::Google::Cloud::SecureSourceManager::V1::SecureSourceManager::Client" + }, + "method": { + "short_name": "OpenPullRequest", + "full_name": "google.cloud.securesourcemanager.v1.SecureSourceManager.OpenPullRequest", + "service": { + "short_name": "SecureSourceManager", + "full_name": "google.cloud.securesourcemanager.v1.SecureSourceManager" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 53, + "type": "FULL" + } + ] + }, + { + "region_tag": "securesourcemanager_v1_generated_SecureSourceManager_ClosePullRequest_sync", + "title": "Snippet for the close_pull_request call in the SecureSourceManager service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::SecureSourceManager::V1::SecureSourceManager::Client#close_pull_request.", + "file": "secure_source_manager/close_pull_request.rb", + "language": "RUBY", + "client_method": { + "short_name": "close_pull_request", + "full_name": "::Google::Cloud::SecureSourceManager::V1::SecureSourceManager::Client#close_pull_request", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::SecureSourceManager::V1::ClosePullRequestRequest", + "name": "request" + } + ], + "result_type": "::Google::Longrunning::Operation", + "client": { + "short_name": "SecureSourceManager::Client", + "full_name": "::Google::Cloud::SecureSourceManager::V1::SecureSourceManager::Client" + }, + "method": { + "short_name": "ClosePullRequest", + "full_name": "google.cloud.securesourcemanager.v1.SecureSourceManager.ClosePullRequest", + "service": { + "short_name": "SecureSourceManager", + "full_name": "google.cloud.securesourcemanager.v1.SecureSourceManager" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 53, + "type": "FULL" + } + ] + }, + { + "region_tag": "securesourcemanager_v1_generated_SecureSourceManager_ListPullRequestFileDiffs_sync", + "title": "Snippet for the list_pull_request_file_diffs call in the SecureSourceManager service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::SecureSourceManager::V1::SecureSourceManager::Client#list_pull_request_file_diffs.", + "file": "secure_source_manager/list_pull_request_file_diffs.rb", + "language": "RUBY", + "client_method": { + "short_name": "list_pull_request_file_diffs", + "full_name": "::Google::Cloud::SecureSourceManager::V1::SecureSourceManager::Client#list_pull_request_file_diffs", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::SecureSourceManager::V1::ListPullRequestFileDiffsRequest", + "name": "request" + } + ], + "result_type": "::Google::Cloud::SecureSourceManager::V1::ListPullRequestFileDiffsResponse", + "client": { + "short_name": "SecureSourceManager::Client", + "full_name": "::Google::Cloud::SecureSourceManager::V1::SecureSourceManager::Client" + }, + "method": { + "short_name": "ListPullRequestFileDiffs", + "full_name": "google.cloud.securesourcemanager.v1.SecureSourceManager.ListPullRequestFileDiffs", + "service": { + "short_name": "SecureSourceManager", + "full_name": "google.cloud.securesourcemanager.v1.SecureSourceManager" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 50, + "type": "FULL" + } + ] + }, + { + "region_tag": "securesourcemanager_v1_generated_SecureSourceManager_FetchTree_sync", + "title": "Snippet for the fetch_tree call in the SecureSourceManager service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::SecureSourceManager::V1::SecureSourceManager::Client#fetch_tree.", + "file": "secure_source_manager/fetch_tree.rb", + "language": "RUBY", + "client_method": { + "short_name": "fetch_tree", + "full_name": "::Google::Cloud::SecureSourceManager::V1::SecureSourceManager::Client#fetch_tree", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::SecureSourceManager::V1::FetchTreeRequest", + "name": "request" + } + ], + "result_type": "::Google::Cloud::SecureSourceManager::V1::FetchTreeResponse", + "client": { + "short_name": "SecureSourceManager::Client", + "full_name": "::Google::Cloud::SecureSourceManager::V1::SecureSourceManager::Client" + }, + "method": { + "short_name": "FetchTree", + "full_name": "google.cloud.securesourcemanager.v1.SecureSourceManager.FetchTree", + "service": { + "short_name": "SecureSourceManager", + "full_name": "google.cloud.securesourcemanager.v1.SecureSourceManager" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 50, + "type": "FULL" + } + ] + }, + { + "region_tag": "securesourcemanager_v1_generated_SecureSourceManager_FetchBlob_sync", + "title": "Snippet for the fetch_blob call in the SecureSourceManager service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::SecureSourceManager::V1::SecureSourceManager::Client#fetch_blob.", + "file": "secure_source_manager/fetch_blob.rb", + "language": "RUBY", + "client_method": { + "short_name": "fetch_blob", + "full_name": "::Google::Cloud::SecureSourceManager::V1::SecureSourceManager::Client#fetch_blob", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::SecureSourceManager::V1::FetchBlobRequest", + "name": "request" + } + ], + "result_type": "::Google::Cloud::SecureSourceManager::V1::FetchBlobResponse", + "client": { + "short_name": "SecureSourceManager::Client", + "full_name": "::Google::Cloud::SecureSourceManager::V1::SecureSourceManager::Client" + }, + "method": { + "short_name": "FetchBlob", + "full_name": "google.cloud.securesourcemanager.v1.SecureSourceManager.FetchBlob", + "service": { + "short_name": "SecureSourceManager", + "full_name": "google.cloud.securesourcemanager.v1.SecureSourceManager" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 46, + "type": "FULL" + } + ] + }, + { + "region_tag": "securesourcemanager_v1_generated_SecureSourceManager_CreateIssue_sync", + "title": "Snippet for the create_issue call in the SecureSourceManager service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::SecureSourceManager::V1::SecureSourceManager::Client#create_issue.", + "file": "secure_source_manager/create_issue.rb", + "language": "RUBY", + "client_method": { + "short_name": "create_issue", + "full_name": "::Google::Cloud::SecureSourceManager::V1::SecureSourceManager::Client#create_issue", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::SecureSourceManager::V1::CreateIssueRequest", + "name": "request" + } + ], + "result_type": "::Google::Longrunning::Operation", + "client": { + "short_name": "SecureSourceManager::Client", + "full_name": "::Google::Cloud::SecureSourceManager::V1::SecureSourceManager::Client" + }, + "method": { + "short_name": "CreateIssue", + "full_name": "google.cloud.securesourcemanager.v1.SecureSourceManager.CreateIssue", + "service": { + "short_name": "SecureSourceManager", + "full_name": "google.cloud.securesourcemanager.v1.SecureSourceManager" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 53, + "type": "FULL" + } + ] + }, + { + "region_tag": "securesourcemanager_v1_generated_SecureSourceManager_GetIssue_sync", + "title": "Snippet for the get_issue call in the SecureSourceManager service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::SecureSourceManager::V1::SecureSourceManager::Client#get_issue.", + "file": "secure_source_manager/get_issue.rb", + "language": "RUBY", + "client_method": { + "short_name": "get_issue", + "full_name": "::Google::Cloud::SecureSourceManager::V1::SecureSourceManager::Client#get_issue", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::SecureSourceManager::V1::GetIssueRequest", + "name": "request" + } + ], + "result_type": "::Google::Cloud::SecureSourceManager::V1::Issue", + "client": { + "short_name": "SecureSourceManager::Client", + "full_name": "::Google::Cloud::SecureSourceManager::V1::SecureSourceManager::Client" + }, + "method": { + "short_name": "GetIssue", + "full_name": "google.cloud.securesourcemanager.v1.SecureSourceManager.GetIssue", + "service": { + "short_name": "SecureSourceManager", + "full_name": "google.cloud.securesourcemanager.v1.SecureSourceManager" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 46, + "type": "FULL" + } + ] + }, + { + "region_tag": "securesourcemanager_v1_generated_SecureSourceManager_ListIssues_sync", + "title": "Snippet for the list_issues call in the SecureSourceManager service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::SecureSourceManager::V1::SecureSourceManager::Client#list_issues.", + "file": "secure_source_manager/list_issues.rb", + "language": "RUBY", + "client_method": { + "short_name": "list_issues", + "full_name": "::Google::Cloud::SecureSourceManager::V1::SecureSourceManager::Client#list_issues", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::SecureSourceManager::V1::ListIssuesRequest", + "name": "request" + } + ], + "result_type": "::Google::Cloud::SecureSourceManager::V1::ListIssuesResponse", + "client": { + "short_name": "SecureSourceManager::Client", + "full_name": "::Google::Cloud::SecureSourceManager::V1::SecureSourceManager::Client" + }, + "method": { + "short_name": "ListIssues", + "full_name": "google.cloud.securesourcemanager.v1.SecureSourceManager.ListIssues", + "service": { + "short_name": "SecureSourceManager", + "full_name": "google.cloud.securesourcemanager.v1.SecureSourceManager" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 50, + "type": "FULL" + } + ] + }, + { + "region_tag": "securesourcemanager_v1_generated_SecureSourceManager_UpdateIssue_sync", + "title": "Snippet for the update_issue call in the SecureSourceManager service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::SecureSourceManager::V1::SecureSourceManager::Client#update_issue.", + "file": "secure_source_manager/update_issue.rb", + "language": "RUBY", + "client_method": { + "short_name": "update_issue", + "full_name": "::Google::Cloud::SecureSourceManager::V1::SecureSourceManager::Client#update_issue", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::SecureSourceManager::V1::UpdateIssueRequest", + "name": "request" + } + ], + "result_type": "::Google::Longrunning::Operation", + "client": { + "short_name": "SecureSourceManager::Client", + "full_name": "::Google::Cloud::SecureSourceManager::V1::SecureSourceManager::Client" + }, + "method": { + "short_name": "UpdateIssue", + "full_name": "google.cloud.securesourcemanager.v1.SecureSourceManager.UpdateIssue", + "service": { + "short_name": "SecureSourceManager", + "full_name": "google.cloud.securesourcemanager.v1.SecureSourceManager" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 53, + "type": "FULL" + } + ] + }, + { + "region_tag": "securesourcemanager_v1_generated_SecureSourceManager_DeleteIssue_sync", + "title": "Snippet for the delete_issue call in the SecureSourceManager service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::SecureSourceManager::V1::SecureSourceManager::Client#delete_issue.", + "file": "secure_source_manager/delete_issue.rb", + "language": "RUBY", + "client_method": { + "short_name": "delete_issue", + "full_name": "::Google::Cloud::SecureSourceManager::V1::SecureSourceManager::Client#delete_issue", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::SecureSourceManager::V1::DeleteIssueRequest", + "name": "request" + } + ], + "result_type": "::Google::Longrunning::Operation", + "client": { + "short_name": "SecureSourceManager::Client", + "full_name": "::Google::Cloud::SecureSourceManager::V1::SecureSourceManager::Client" + }, + "method": { + "short_name": "DeleteIssue", + "full_name": "google.cloud.securesourcemanager.v1.SecureSourceManager.DeleteIssue", + "service": { + "short_name": "SecureSourceManager", + "full_name": "google.cloud.securesourcemanager.v1.SecureSourceManager" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 53, + "type": "FULL" + } + ] + }, + { + "region_tag": "securesourcemanager_v1_generated_SecureSourceManager_OpenIssue_sync", + "title": "Snippet for the open_issue call in the SecureSourceManager service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::SecureSourceManager::V1::SecureSourceManager::Client#open_issue.", + "file": "secure_source_manager/open_issue.rb", + "language": "RUBY", + "client_method": { + "short_name": "open_issue", + "full_name": "::Google::Cloud::SecureSourceManager::V1::SecureSourceManager::Client#open_issue", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::SecureSourceManager::V1::OpenIssueRequest", + "name": "request" + } + ], + "result_type": "::Google::Longrunning::Operation", + "client": { + "short_name": "SecureSourceManager::Client", + "full_name": "::Google::Cloud::SecureSourceManager::V1::SecureSourceManager::Client" + }, + "method": { + "short_name": "OpenIssue", + "full_name": "google.cloud.securesourcemanager.v1.SecureSourceManager.OpenIssue", + "service": { + "short_name": "SecureSourceManager", + "full_name": "google.cloud.securesourcemanager.v1.SecureSourceManager" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 53, + "type": "FULL" + } + ] + }, + { + "region_tag": "securesourcemanager_v1_generated_SecureSourceManager_CloseIssue_sync", + "title": "Snippet for the close_issue call in the SecureSourceManager service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::SecureSourceManager::V1::SecureSourceManager::Client#close_issue.", + "file": "secure_source_manager/close_issue.rb", + "language": "RUBY", + "client_method": { + "short_name": "close_issue", + "full_name": "::Google::Cloud::SecureSourceManager::V1::SecureSourceManager::Client#close_issue", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::SecureSourceManager::V1::CloseIssueRequest", + "name": "request" + } + ], + "result_type": "::Google::Longrunning::Operation", + "client": { + "short_name": "SecureSourceManager::Client", + "full_name": "::Google::Cloud::SecureSourceManager::V1::SecureSourceManager::Client" + }, + "method": { + "short_name": "CloseIssue", + "full_name": "google.cloud.securesourcemanager.v1.SecureSourceManager.CloseIssue", + "service": { + "short_name": "SecureSourceManager", + "full_name": "google.cloud.securesourcemanager.v1.SecureSourceManager" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 53, + "type": "FULL" + } + ] + }, + { + "region_tag": "securesourcemanager_v1_generated_SecureSourceManager_GetPullRequestComment_sync", + "title": "Snippet for the get_pull_request_comment call in the SecureSourceManager service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::SecureSourceManager::V1::SecureSourceManager::Client#get_pull_request_comment.", + "file": "secure_source_manager/get_pull_request_comment.rb", + "language": "RUBY", + "client_method": { + "short_name": "get_pull_request_comment", + "full_name": "::Google::Cloud::SecureSourceManager::V1::SecureSourceManager::Client#get_pull_request_comment", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::SecureSourceManager::V1::GetPullRequestCommentRequest", + "name": "request" + } + ], + "result_type": "::Google::Cloud::SecureSourceManager::V1::PullRequestComment", + "client": { + "short_name": "SecureSourceManager::Client", + "full_name": "::Google::Cloud::SecureSourceManager::V1::SecureSourceManager::Client" + }, + "method": { + "short_name": "GetPullRequestComment", + "full_name": "google.cloud.securesourcemanager.v1.SecureSourceManager.GetPullRequestComment", + "service": { + "short_name": "SecureSourceManager", + "full_name": "google.cloud.securesourcemanager.v1.SecureSourceManager" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 46, + "type": "FULL" + } + ] + }, + { + "region_tag": "securesourcemanager_v1_generated_SecureSourceManager_ListPullRequestComments_sync", + "title": "Snippet for the list_pull_request_comments call in the SecureSourceManager service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::SecureSourceManager::V1::SecureSourceManager::Client#list_pull_request_comments.", + "file": "secure_source_manager/list_pull_request_comments.rb", + "language": "RUBY", + "client_method": { + "short_name": "list_pull_request_comments", + "full_name": "::Google::Cloud::SecureSourceManager::V1::SecureSourceManager::Client#list_pull_request_comments", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::SecureSourceManager::V1::ListPullRequestCommentsRequest", + "name": "request" + } + ], + "result_type": "::Google::Cloud::SecureSourceManager::V1::ListPullRequestCommentsResponse", + "client": { + "short_name": "SecureSourceManager::Client", + "full_name": "::Google::Cloud::SecureSourceManager::V1::SecureSourceManager::Client" + }, + "method": { + "short_name": "ListPullRequestComments", + "full_name": "google.cloud.securesourcemanager.v1.SecureSourceManager.ListPullRequestComments", + "service": { + "short_name": "SecureSourceManager", + "full_name": "google.cloud.securesourcemanager.v1.SecureSourceManager" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 50, + "type": "FULL" + } + ] + }, + { + "region_tag": "securesourcemanager_v1_generated_SecureSourceManager_CreatePullRequestComment_sync", + "title": "Snippet for the create_pull_request_comment call in the SecureSourceManager service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::SecureSourceManager::V1::SecureSourceManager::Client#create_pull_request_comment.", + "file": "secure_source_manager/create_pull_request_comment.rb", + "language": "RUBY", + "client_method": { + "short_name": "create_pull_request_comment", + "full_name": "::Google::Cloud::SecureSourceManager::V1::SecureSourceManager::Client#create_pull_request_comment", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::SecureSourceManager::V1::CreatePullRequestCommentRequest", + "name": "request" + } + ], + "result_type": "::Google::Longrunning::Operation", + "client": { + "short_name": "SecureSourceManager::Client", + "full_name": "::Google::Cloud::SecureSourceManager::V1::SecureSourceManager::Client" + }, + "method": { + "short_name": "CreatePullRequestComment", + "full_name": "google.cloud.securesourcemanager.v1.SecureSourceManager.CreatePullRequestComment", + "service": { + "short_name": "SecureSourceManager", + "full_name": "google.cloud.securesourcemanager.v1.SecureSourceManager" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 53, + "type": "FULL" + } + ] + }, + { + "region_tag": "securesourcemanager_v1_generated_SecureSourceManager_UpdatePullRequestComment_sync", + "title": "Snippet for the update_pull_request_comment call in the SecureSourceManager service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::SecureSourceManager::V1::SecureSourceManager::Client#update_pull_request_comment.", + "file": "secure_source_manager/update_pull_request_comment.rb", + "language": "RUBY", + "client_method": { + "short_name": "update_pull_request_comment", + "full_name": "::Google::Cloud::SecureSourceManager::V1::SecureSourceManager::Client#update_pull_request_comment", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::SecureSourceManager::V1::UpdatePullRequestCommentRequest", + "name": "request" + } + ], + "result_type": "::Google::Longrunning::Operation", + "client": { + "short_name": "SecureSourceManager::Client", + "full_name": "::Google::Cloud::SecureSourceManager::V1::SecureSourceManager::Client" + }, + "method": { + "short_name": "UpdatePullRequestComment", + "full_name": "google.cloud.securesourcemanager.v1.SecureSourceManager.UpdatePullRequestComment", + "service": { + "short_name": "SecureSourceManager", + "full_name": "google.cloud.securesourcemanager.v1.SecureSourceManager" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 53, + "type": "FULL" + } + ] + }, + { + "region_tag": "securesourcemanager_v1_generated_SecureSourceManager_DeletePullRequestComment_sync", + "title": "Snippet for the delete_pull_request_comment call in the SecureSourceManager service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::SecureSourceManager::V1::SecureSourceManager::Client#delete_pull_request_comment.", + "file": "secure_source_manager/delete_pull_request_comment.rb", + "language": "RUBY", + "client_method": { + "short_name": "delete_pull_request_comment", + "full_name": "::Google::Cloud::SecureSourceManager::V1::SecureSourceManager::Client#delete_pull_request_comment", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::SecureSourceManager::V1::DeletePullRequestCommentRequest", + "name": "request" + } + ], + "result_type": "::Google::Longrunning::Operation", + "client": { + "short_name": "SecureSourceManager::Client", + "full_name": "::Google::Cloud::SecureSourceManager::V1::SecureSourceManager::Client" + }, + "method": { + "short_name": "DeletePullRequestComment", + "full_name": "google.cloud.securesourcemanager.v1.SecureSourceManager.DeletePullRequestComment", + "service": { + "short_name": "SecureSourceManager", + "full_name": "google.cloud.securesourcemanager.v1.SecureSourceManager" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 53, + "type": "FULL" + } + ] + }, + { + "region_tag": "securesourcemanager_v1_generated_SecureSourceManager_BatchCreatePullRequestComments_sync", + "title": "Snippet for the batch_create_pull_request_comments call in the SecureSourceManager service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::SecureSourceManager::V1::SecureSourceManager::Client#batch_create_pull_request_comments.", + "file": "secure_source_manager/batch_create_pull_request_comments.rb", + "language": "RUBY", + "client_method": { + "short_name": "batch_create_pull_request_comments", + "full_name": "::Google::Cloud::SecureSourceManager::V1::SecureSourceManager::Client#batch_create_pull_request_comments", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::SecureSourceManager::V1::BatchCreatePullRequestCommentsRequest", + "name": "request" + } + ], + "result_type": "::Google::Longrunning::Operation", + "client": { + "short_name": "SecureSourceManager::Client", + "full_name": "::Google::Cloud::SecureSourceManager::V1::SecureSourceManager::Client" + }, + "method": { + "short_name": "BatchCreatePullRequestComments", + "full_name": "google.cloud.securesourcemanager.v1.SecureSourceManager.BatchCreatePullRequestComments", + "service": { + "short_name": "SecureSourceManager", + "full_name": "google.cloud.securesourcemanager.v1.SecureSourceManager" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 53, + "type": "FULL" + } + ] + }, + { + "region_tag": "securesourcemanager_v1_generated_SecureSourceManager_ResolvePullRequestComments_sync", + "title": "Snippet for the resolve_pull_request_comments call in the SecureSourceManager service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::SecureSourceManager::V1::SecureSourceManager::Client#resolve_pull_request_comments.", + "file": "secure_source_manager/resolve_pull_request_comments.rb", + "language": "RUBY", + "client_method": { + "short_name": "resolve_pull_request_comments", + "full_name": "::Google::Cloud::SecureSourceManager::V1::SecureSourceManager::Client#resolve_pull_request_comments", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::SecureSourceManager::V1::ResolvePullRequestCommentsRequest", + "name": "request" + } + ], + "result_type": "::Google::Longrunning::Operation", + "client": { + "short_name": "SecureSourceManager::Client", + "full_name": "::Google::Cloud::SecureSourceManager::V1::SecureSourceManager::Client" + }, + "method": { + "short_name": "ResolvePullRequestComments", + "full_name": "google.cloud.securesourcemanager.v1.SecureSourceManager.ResolvePullRequestComments", + "service": { + "short_name": "SecureSourceManager", + "full_name": "google.cloud.securesourcemanager.v1.SecureSourceManager" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 53, + "type": "FULL" + } + ] + }, + { + "region_tag": "securesourcemanager_v1_generated_SecureSourceManager_UnresolvePullRequestComments_sync", + "title": "Snippet for the unresolve_pull_request_comments call in the SecureSourceManager service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::SecureSourceManager::V1::SecureSourceManager::Client#unresolve_pull_request_comments.", + "file": "secure_source_manager/unresolve_pull_request_comments.rb", + "language": "RUBY", + "client_method": { + "short_name": "unresolve_pull_request_comments", + "full_name": "::Google::Cloud::SecureSourceManager::V1::SecureSourceManager::Client#unresolve_pull_request_comments", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::SecureSourceManager::V1::UnresolvePullRequestCommentsRequest", + "name": "request" + } + ], + "result_type": "::Google::Longrunning::Operation", + "client": { + "short_name": "SecureSourceManager::Client", + "full_name": "::Google::Cloud::SecureSourceManager::V1::SecureSourceManager::Client" + }, + "method": { + "short_name": "UnresolvePullRequestComments", + "full_name": "google.cloud.securesourcemanager.v1.SecureSourceManager.UnresolvePullRequestComments", + "service": { + "short_name": "SecureSourceManager", + "full_name": "google.cloud.securesourcemanager.v1.SecureSourceManager" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 53, + "type": "FULL" + } + ] + }, + { + "region_tag": "securesourcemanager_v1_generated_SecureSourceManager_CreateIssueComment_sync", + "title": "Snippet for the create_issue_comment call in the SecureSourceManager service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::SecureSourceManager::V1::SecureSourceManager::Client#create_issue_comment.", + "file": "secure_source_manager/create_issue_comment.rb", + "language": "RUBY", + "client_method": { + "short_name": "create_issue_comment", + "full_name": "::Google::Cloud::SecureSourceManager::V1::SecureSourceManager::Client#create_issue_comment", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::SecureSourceManager::V1::CreateIssueCommentRequest", + "name": "request" + } + ], + "result_type": "::Google::Longrunning::Operation", + "client": { + "short_name": "SecureSourceManager::Client", + "full_name": "::Google::Cloud::SecureSourceManager::V1::SecureSourceManager::Client" + }, + "method": { + "short_name": "CreateIssueComment", + "full_name": "google.cloud.securesourcemanager.v1.SecureSourceManager.CreateIssueComment", + "service": { + "short_name": "SecureSourceManager", + "full_name": "google.cloud.securesourcemanager.v1.SecureSourceManager" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 53, + "type": "FULL" + } + ] + }, + { + "region_tag": "securesourcemanager_v1_generated_SecureSourceManager_GetIssueComment_sync", + "title": "Snippet for the get_issue_comment call in the SecureSourceManager service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::SecureSourceManager::V1::SecureSourceManager::Client#get_issue_comment.", + "file": "secure_source_manager/get_issue_comment.rb", + "language": "RUBY", + "client_method": { + "short_name": "get_issue_comment", + "full_name": "::Google::Cloud::SecureSourceManager::V1::SecureSourceManager::Client#get_issue_comment", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::SecureSourceManager::V1::GetIssueCommentRequest", + "name": "request" + } + ], + "result_type": "::Google::Cloud::SecureSourceManager::V1::IssueComment", + "client": { + "short_name": "SecureSourceManager::Client", + "full_name": "::Google::Cloud::SecureSourceManager::V1::SecureSourceManager::Client" + }, + "method": { + "short_name": "GetIssueComment", + "full_name": "google.cloud.securesourcemanager.v1.SecureSourceManager.GetIssueComment", + "service": { + "short_name": "SecureSourceManager", + "full_name": "google.cloud.securesourcemanager.v1.SecureSourceManager" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 46, + "type": "FULL" + } + ] + }, + { + "region_tag": "securesourcemanager_v1_generated_SecureSourceManager_ListIssueComments_sync", + "title": "Snippet for the list_issue_comments call in the SecureSourceManager service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::SecureSourceManager::V1::SecureSourceManager::Client#list_issue_comments.", + "file": "secure_source_manager/list_issue_comments.rb", + "language": "RUBY", + "client_method": { + "short_name": "list_issue_comments", + "full_name": "::Google::Cloud::SecureSourceManager::V1::SecureSourceManager::Client#list_issue_comments", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::SecureSourceManager::V1::ListIssueCommentsRequest", + "name": "request" + } + ], + "result_type": "::Google::Cloud::SecureSourceManager::V1::ListIssueCommentsResponse", + "client": { + "short_name": "SecureSourceManager::Client", + "full_name": "::Google::Cloud::SecureSourceManager::V1::SecureSourceManager::Client" + }, + "method": { + "short_name": "ListIssueComments", + "full_name": "google.cloud.securesourcemanager.v1.SecureSourceManager.ListIssueComments", + "service": { + "short_name": "SecureSourceManager", + "full_name": "google.cloud.securesourcemanager.v1.SecureSourceManager" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 50, + "type": "FULL" + } + ] + }, + { + "region_tag": "securesourcemanager_v1_generated_SecureSourceManager_UpdateIssueComment_sync", + "title": "Snippet for the update_issue_comment call in the SecureSourceManager service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::SecureSourceManager::V1::SecureSourceManager::Client#update_issue_comment.", + "file": "secure_source_manager/update_issue_comment.rb", + "language": "RUBY", + "client_method": { + "short_name": "update_issue_comment", + "full_name": "::Google::Cloud::SecureSourceManager::V1::SecureSourceManager::Client#update_issue_comment", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::SecureSourceManager::V1::UpdateIssueCommentRequest", + "name": "request" + } + ], + "result_type": "::Google::Longrunning::Operation", + "client": { + "short_name": "SecureSourceManager::Client", + "full_name": "::Google::Cloud::SecureSourceManager::V1::SecureSourceManager::Client" + }, + "method": { + "short_name": "UpdateIssueComment", + "full_name": "google.cloud.securesourcemanager.v1.SecureSourceManager.UpdateIssueComment", + "service": { + "short_name": "SecureSourceManager", + "full_name": "google.cloud.securesourcemanager.v1.SecureSourceManager" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 53, + "type": "FULL" + } + ] + }, + { + "region_tag": "securesourcemanager_v1_generated_SecureSourceManager_DeleteIssueComment_sync", + "title": "Snippet for the delete_issue_comment call in the SecureSourceManager service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::SecureSourceManager::V1::SecureSourceManager::Client#delete_issue_comment.", + "file": "secure_source_manager/delete_issue_comment.rb", + "language": "RUBY", + "client_method": { + "short_name": "delete_issue_comment", + "full_name": "::Google::Cloud::SecureSourceManager::V1::SecureSourceManager::Client#delete_issue_comment", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::SecureSourceManager::V1::DeleteIssueCommentRequest", + "name": "request" + } + ], + "result_type": "::Google::Longrunning::Operation", + "client": { + "short_name": "SecureSourceManager::Client", + "full_name": "::Google::Cloud::SecureSourceManager::V1::SecureSourceManager::Client" + }, + "method": { + "short_name": "DeleteIssueComment", + "full_name": "google.cloud.securesourcemanager.v1.SecureSourceManager.DeleteIssueComment", + "service": { + "short_name": "SecureSourceManager", + "full_name": "google.cloud.securesourcemanager.v1.SecureSourceManager" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 53, + "type": "FULL" + } + ] + } + ] +} \ No newline at end of file diff --git a/owl-bot-staging/google-cloud-secure_source_manager-v1/test/google/cloud/secure_source_manager/v1/secure_source_manager_operations_test.rb b/owl-bot-staging/google-cloud-secure_source_manager-v1/test/google/cloud/secure_source_manager/v1/secure_source_manager_operations_test.rb new file mode 100644 index 000000000000..1698cd8fc998 --- /dev/null +++ b/owl-bot-staging/google-cloud-secure_source_manager-v1/test/google/cloud/secure_source_manager/v1/secure_source_manager_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/cloud/securesourcemanager/v1/secure_source_manager_pb" +require "google/cloud/securesourcemanager/v1/secure_source_manager_services_pb" +require "google/cloud/secure_source_manager/v1/secure_source_manager" + +class ::Google::Cloud::SecureSourceManager::V1::SecureSourceManager::OperationsTest < Minitest::Test + class ClientStub + attr_accessor :call_rpc_count, :requests + + def initialize response, operation, &block + @response = response + @operation = operation + @block = block + @call_rpc_count = 0 + @requests = [] + end + + def call_rpc *args, **kwargs + @call_rpc_count += 1 + + @requests << @block&.call(*args, **kwargs) + + catch :response do + yield @response, @operation if block_given? + @response + end + end + + def endpoint + "endpoint.example.com" + end + + def universe_domain + "example.com" + end + + def stub_logger + nil + end + + def logger + nil + end + end + + def test_list_operations + # Create GRPC objects. + grpc_response = ::Google::Longrunning::ListOperationsResponse.new + grpc_operation = GRPC::ActiveCall::Operation.new nil + grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + grpc_options = {} + + # Create request parameters for a unary method. + name = "hello world" + filter = "hello world" + page_size = 42 + page_token = "hello world" + return_partial_success = true + + list_operations_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :list_operations, name + assert_kind_of ::Google::Longrunning::ListOperationsRequest, request + assert_equal "hello world", request["name"] + assert_equal "hello world", request["filter"] + assert_equal 42, request["page_size"] + assert_equal "hello world", request["page_token"] + assert_equal true, request["return_partial_success"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, list_operations_client_stub do + # Create client + client = ::Google::Cloud::SecureSourceManager::V1::SecureSourceManager::Operations.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.list_operations({ name: name, filter: filter, page_size: page_size, page_token: page_token, return_partial_success: return_partial_success }) do |response, operation| + assert_kind_of Gapic::PagedEnumerable, response + assert_equal grpc_response, response.response + assert_equal grpc_operation, operation + end + + # Use named arguments + client.list_operations name: name, filter: filter, page_size: page_size, page_token: page_token, return_partial_success: return_partial_success do |response, operation| + assert_kind_of Gapic::PagedEnumerable, response + assert_equal grpc_response, response.response + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.list_operations ::Google::Longrunning::ListOperationsRequest.new(name: name, filter: filter, page_size: page_size, page_token: page_token, return_partial_success: return_partial_success) do |response, operation| + assert_kind_of Gapic::PagedEnumerable, response + assert_equal grpc_response, response.response + assert_equal grpc_operation, operation + end + + # Use hash object with options + client.list_operations({ name: name, filter: filter, page_size: page_size, page_token: page_token, return_partial_success: return_partial_success }, grpc_options) do |response, operation| + assert_kind_of Gapic::PagedEnumerable, response + assert_equal grpc_response, response.response + assert_equal grpc_operation, operation + end + + # Use protobuf object with options + client.list_operations(::Google::Longrunning::ListOperationsRequest.new(name: name, filter: filter, page_size: page_size, page_token: page_token, return_partial_success: return_partial_success), grpc_options) do |response, operation| + assert_kind_of Gapic::PagedEnumerable, response + assert_equal grpc_response, response.response + assert_equal grpc_operation, operation + end + + # Verify method calls + assert_equal 5, list_operations_client_stub.call_rpc_count + end + end + + def test_get_operation + # Create GRPC objects. + grpc_response = ::Google::Longrunning::Operation.new + grpc_operation = GRPC::ActiveCall::Operation.new nil + grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + grpc_options = {} + + # Create request parameters for a unary method. + name = "hello world" + + get_operation_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :get_operation, name + assert_kind_of ::Google::Longrunning::GetOperationRequest, request + assert_equal "hello world", request["name"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, get_operation_client_stub do + # Create client + client = ::Google::Cloud::SecureSourceManager::V1::SecureSourceManager::Operations.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.get_operation({ name: name }) do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Use named arguments + client.get_operation name: name do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.get_operation ::Google::Longrunning::GetOperationRequest.new(name: name) do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Use hash object with options + client.get_operation({ name: name }, grpc_options) do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Use protobuf object with options + client.get_operation(::Google::Longrunning::GetOperationRequest.new(name: name), grpc_options) do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Verify method calls + assert_equal 5, get_operation_client_stub.call_rpc_count + end + end + + def test_delete_operation + # Create GRPC objects. + grpc_response = ::Google::Protobuf::Empty.new + grpc_operation = GRPC::ActiveCall::Operation.new nil + grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + grpc_options = {} + + # Create request parameters for a unary method. + name = "hello world" + + delete_operation_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :delete_operation, name + assert_kind_of ::Google::Longrunning::DeleteOperationRequest, request + assert_equal "hello world", request["name"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, delete_operation_client_stub do + # Create client + client = ::Google::Cloud::SecureSourceManager::V1::SecureSourceManager::Operations.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.delete_operation({ name: name }) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use named arguments + client.delete_operation name: name do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.delete_operation ::Google::Longrunning::DeleteOperationRequest.new(name: name) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use hash object with options + client.delete_operation({ name: name }, grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object with options + client.delete_operation(::Google::Longrunning::DeleteOperationRequest.new(name: name), grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Verify method calls + assert_equal 5, delete_operation_client_stub.call_rpc_count + end + end + + def test_cancel_operation + # Create GRPC objects. + grpc_response = ::Google::Protobuf::Empty.new + grpc_operation = GRPC::ActiveCall::Operation.new nil + grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + grpc_options = {} + + # Create request parameters for a unary method. + name = "hello world" + + cancel_operation_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :cancel_operation, name + assert_kind_of ::Google::Longrunning::CancelOperationRequest, request + assert_equal "hello world", request["name"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, cancel_operation_client_stub do + # Create client + client = ::Google::Cloud::SecureSourceManager::V1::SecureSourceManager::Operations.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.cancel_operation({ name: name }) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use named arguments + client.cancel_operation name: name do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.cancel_operation ::Google::Longrunning::CancelOperationRequest.new(name: name) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use hash object with options + client.cancel_operation({ name: name }, grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object with options + client.cancel_operation(::Google::Longrunning::CancelOperationRequest.new(name: name), grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Verify method calls + assert_equal 5, cancel_operation_client_stub.call_rpc_count + end + end + + def test_wait_operation + # Create GRPC objects. + grpc_response = ::Google::Longrunning::Operation.new + grpc_operation = GRPC::ActiveCall::Operation.new nil + grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + grpc_options = {} + + # Create request parameters for a unary method. + name = "hello world" + timeout = {} + + wait_operation_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :wait_operation, name + assert_kind_of ::Google::Longrunning::WaitOperationRequest, request + assert_equal "hello world", request["name"] + assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Protobuf::Duration), request["timeout"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, wait_operation_client_stub do + # Create client + client = ::Google::Cloud::SecureSourceManager::V1::SecureSourceManager::Operations.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.wait_operation({ name: name, timeout: timeout }) do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Use named arguments + client.wait_operation name: name, timeout: timeout do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.wait_operation ::Google::Longrunning::WaitOperationRequest.new(name: name, timeout: timeout) do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Use hash object with options + client.wait_operation({ name: name, timeout: timeout }, grpc_options) do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Use protobuf object with options + client.wait_operation(::Google::Longrunning::WaitOperationRequest.new(name: name, timeout: timeout), grpc_options) do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Verify method calls + assert_equal 5, wait_operation_client_stub.call_rpc_count + end + end + + def test_configure + grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + + client = block_config = config = nil + dummy_stub = ClientStub.new nil, nil + Gapic::ServiceStub.stub :new, dummy_stub do + client = ::Google::Cloud::SecureSourceManager::V1::SecureSourceManager::Operations.new do |config| + config.credentials = grpc_channel + end + end + + config = client.configure do |c| + block_config = c + end + + assert_same block_config, config + assert_kind_of ::Google::Cloud::SecureSourceManager::V1::SecureSourceManager::Operations::Configuration, config + end +end diff --git a/owl-bot-staging/google-cloud-secure_source_manager-v1/test/google/cloud/secure_source_manager/v1/secure_source_manager_paths_test.rb b/owl-bot-staging/google-cloud-secure_source_manager-v1/test/google/cloud/secure_source_manager/v1/secure_source_manager_paths_test.rb new file mode 100644 index 000000000000..1a01ca3ccdef --- /dev/null +++ b/owl-bot-staging/google-cloud-secure_source_manager-v1/test/google/cloud/secure_source_manager/v1/secure_source_manager_paths_test.rb @@ -0,0 +1,187 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +require "helper" + +require "gapic/grpc/service_stub" + +require "google/cloud/secure_source_manager/v1/secure_source_manager" + +class ::Google::Cloud::SecureSourceManager::V1::SecureSourceManager::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_branch_rule_path + grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + ::Gapic::ServiceStub.stub :new, DummyStub.new do + client = ::Google::Cloud::SecureSourceManager::V1::SecureSourceManager::Client.new do |config| + config.credentials = grpc_channel + end + + path = client.branch_rule_path project: "value0", location: "value1", repository: "value2", branch_rule: "value3" + assert_equal "projects/value0/locations/value1/repositories/value2/branchRules/value3", path + end + end + + def test_ca_pool_path + grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + ::Gapic::ServiceStub.stub :new, DummyStub.new do + client = ::Google::Cloud::SecureSourceManager::V1::SecureSourceManager::Client.new do |config| + config.credentials = grpc_channel + end + + path = client.ca_pool_path project: "value0", location: "value1", ca_pool: "value2" + assert_equal "projects/value0/locations/value1/caPools/value2", path + end + end + + def test_crypto_key_path + grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + ::Gapic::ServiceStub.stub :new, DummyStub.new do + client = ::Google::Cloud::SecureSourceManager::V1::SecureSourceManager::Client.new do |config| + config.credentials = grpc_channel + end + + path = client.crypto_key_path project: "value0", location: "value1", key_ring: "value2", crypto_key: "value3" + assert_equal "projects/value0/locations/value1/keyRings/value2/cryptoKeys/value3", path + end + end + + def test_hook_path + grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + ::Gapic::ServiceStub.stub :new, DummyStub.new do + client = ::Google::Cloud::SecureSourceManager::V1::SecureSourceManager::Client.new do |config| + config.credentials = grpc_channel + end + + path = client.hook_path project: "value0", location: "value1", repository: "value2", hook: "value3" + assert_equal "projects/value0/locations/value1/repositories/value2/hooks/value3", path + end + end + + def test_instance_path + grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + ::Gapic::ServiceStub.stub :new, DummyStub.new do + client = ::Google::Cloud::SecureSourceManager::V1::SecureSourceManager::Client.new do |config| + config.credentials = grpc_channel + end + + path = client.instance_path project: "value0", location: "value1", instance: "value2" + assert_equal "projects/value0/locations/value1/instances/value2", path + end + end + + def test_issue_path + grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + ::Gapic::ServiceStub.stub :new, DummyStub.new do + client = ::Google::Cloud::SecureSourceManager::V1::SecureSourceManager::Client.new do |config| + config.credentials = grpc_channel + end + + path = client.issue_path project: "value0", location: "value1", repository: "value2", issue: "value3" + assert_equal "projects/value0/locations/value1/repositories/value2/issues/value3", path + end + end + + def test_issue_comment_path + grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + ::Gapic::ServiceStub.stub :new, DummyStub.new do + client = ::Google::Cloud::SecureSourceManager::V1::SecureSourceManager::Client.new do |config| + config.credentials = grpc_channel + end + + path = client.issue_comment_path project: "value0", location: "value1", repository: "value2", issue: "value3", comment: "value4" + assert_equal "projects/value0/locations/value1/repositories/value2/issues/value3/issueComments/value4", path + end + end + + def test_location_path + grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + ::Gapic::ServiceStub.stub :new, DummyStub.new do + client = ::Google::Cloud::SecureSourceManager::V1::SecureSourceManager::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_pull_request_path + grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + ::Gapic::ServiceStub.stub :new, DummyStub.new do + client = ::Google::Cloud::SecureSourceManager::V1::SecureSourceManager::Client.new do |config| + config.credentials = grpc_channel + end + + path = client.pull_request_path project: "value0", location: "value1", repository: "value2", pull_request: "value3" + assert_equal "projects/value0/locations/value1/repositories/value2/pullRequests/value3", path + end + end + + def test_pull_request_comment_path + grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + ::Gapic::ServiceStub.stub :new, DummyStub.new do + client = ::Google::Cloud::SecureSourceManager::V1::SecureSourceManager::Client.new do |config| + config.credentials = grpc_channel + end + + path = client.pull_request_comment_path project: "value0", location: "value1", repository: "value2", pull_request: "value3", comment: "value4" + assert_equal "projects/value0/locations/value1/repositories/value2/pullRequests/value3/pullRequestComments/value4", path + end + end + + def test_repository_path + grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + ::Gapic::ServiceStub.stub :new, DummyStub.new do + client = ::Google::Cloud::SecureSourceManager::V1::SecureSourceManager::Client.new do |config| + config.credentials = grpc_channel + end + + path = client.repository_path project: "value0", location: "value1", repository: "value2" + assert_equal "projects/value0/locations/value1/repositories/value2", path + end + end + + def test_service_attachment_path + grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + ::Gapic::ServiceStub.stub :new, DummyStub.new do + client = ::Google::Cloud::SecureSourceManager::V1::SecureSourceManager::Client.new do |config| + config.credentials = grpc_channel + end + + path = client.service_attachment_path project: "value0", region: "value1", service_attachment: "value2" + assert_equal "projects/value0/regions/value1/serviceAttachments/value2", path + end + end +end diff --git a/owl-bot-staging/google-cloud-secure_source_manager-v1/test/google/cloud/secure_source_manager/v1/secure_source_manager_rest_test.rb b/owl-bot-staging/google-cloud-secure_source_manager-v1/test/google/cloud/secure_source_manager/v1/secure_source_manager_rest_test.rb new file mode 100644 index 000000000000..e8b27d62697e --- /dev/null +++ b/owl-bot-staging/google-cloud-secure_source_manager-v1/test/google/cloud/secure_source_manager/v1/secure_source_manager_rest_test.rb @@ -0,0 +1,2972 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +require "helper" +require "gapic/rest" +require "google/cloud/securesourcemanager/v1/secure_source_manager_pb" +require "google/cloud/secure_source_manager/v1/secure_source_manager/rest" + + +class ::Google::Cloud::SecureSourceManager::V1::SecureSourceManager::Rest::ClientTest < Minitest::Test + class ClientStub + attr_accessor :call_count, :requests + + def initialize response, &block + @response = response + @block = block + @call_count = 0 + @requests = [] + end + + def make_get_request uri:, params: {}, options: {}, method_name: nil + make_http_request :get, uri: uri, body: nil, params: params, options: options, method_name: method_name + end + + def make_delete_request uri:, params: {}, options: {}, method_name: nil + make_http_request :delete, uri: uri, body: nil, params: params, options: options, method_name: method_name + end + + def make_post_request uri:, body: nil, params: {}, options: {}, method_name: nil + make_http_request :post, uri: uri, body: body, params: params, options: options, method_name: method_name + end + + def make_patch_request uri:, body:, params: {}, options: {}, method_name: nil + make_http_request :patch, uri: uri, body: body, params: params, options: options, method_name: method_name + end + + def make_put_request uri:, body:, params: {}, options: {}, method_name: nil + make_http_request :put, uri: uri, body: body, params: params, options: options, method_name: method_name + end + + def make_http_request *args, **kwargs + @call_count += 1 + + @requests << @block&.call(*args, **kwargs) + + @response + end + + def endpoint + "endpoint.example.com" + end + + def universe_domain + "example.com" + end + + def stub_logger + nil + end + + def logger + nil + end + end + + def test_list_instances + # Create test objects. + client_result = ::Google::Cloud::SecureSourceManager::V1::ListInstancesResponse.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" + order_by = "hello world" + + list_instances_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| + assert options.metadata.key? :"x-goog-api-client" + assert options.metadata[:"x-goog-api-client"].include? "rest" + refute options.metadata[:"x-goog-api-client"].include? "grpc" + end + + ::Google::Cloud::SecureSourceManager::V1::SecureSourceManager::Rest::ServiceStub.stub :transcode_list_instances_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, list_instances_client_stub do + # Create client + client = ::Google::Cloud::SecureSourceManager::V1::SecureSourceManager::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.list_instances({ parent: parent, page_size: page_size, page_token: page_token, filter: filter, order_by: order_by }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.list_instances parent: parent, page_size: page_size, page_token: page_token, filter: filter, order_by: order_by do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.list_instances ::Google::Cloud::SecureSourceManager::V1::ListInstancesRequest.new(parent: parent, page_size: page_size, page_token: page_token, filter: filter, order_by: order_by) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + client.list_instances({ parent: parent, page_size: page_size, page_token: page_token, filter: filter, order_by: order_by }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + client.list_instances(::Google::Cloud::SecureSourceManager::V1::ListInstancesRequest.new(parent: parent, page_size: page_size, page_token: page_token, filter: filter, order_by: order_by), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, list_instances_client_stub.call_count + end + end + end + + def test_get_instance + # Create test objects. + client_result = ::Google::Cloud::SecureSourceManager::V1::Instance.new + http_response = OpenStruct.new body: client_result.to_json + + call_options = {} + + # Create request parameters for a unary method. + name = "hello world" + + get_instance_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| + assert options.metadata.key? :"x-goog-api-client" + assert options.metadata[:"x-goog-api-client"].include? "rest" + refute options.metadata[:"x-goog-api-client"].include? "grpc" + end + + ::Google::Cloud::SecureSourceManager::V1::SecureSourceManager::Rest::ServiceStub.stub :transcode_get_instance_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, get_instance_client_stub do + # Create client + client = ::Google::Cloud::SecureSourceManager::V1::SecureSourceManager::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.get_instance({ name: name }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.get_instance name: name do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.get_instance ::Google::Cloud::SecureSourceManager::V1::GetInstanceRequest.new(name: name) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + client.get_instance({ name: name }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + client.get_instance(::Google::Cloud::SecureSourceManager::V1::GetInstanceRequest.new(name: name), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, get_instance_client_stub.call_count + end + end + end + + def test_create_instance + # 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" + instance_id = "hello world" + instance = {} + request_id = "hello world" + + create_instance_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| + assert options.metadata.key? :"x-goog-api-client" + assert options.metadata[:"x-goog-api-client"].include? "rest" + refute options.metadata[:"x-goog-api-client"].include? "grpc" + end + + ::Google::Cloud::SecureSourceManager::V1::SecureSourceManager::Rest::ServiceStub.stub :transcode_create_instance_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, create_instance_client_stub do + # Create client + client = ::Google::Cloud::SecureSourceManager::V1::SecureSourceManager::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.create_instance({ parent: parent, instance_id: instance_id, instance: instance, request_id: request_id }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.create_instance parent: parent, instance_id: instance_id, instance: instance, request_id: request_id do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.create_instance ::Google::Cloud::SecureSourceManager::V1::CreateInstanceRequest.new(parent: parent, instance_id: instance_id, instance: instance, request_id: request_id) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + client.create_instance({ parent: parent, instance_id: instance_id, instance: instance, request_id: request_id }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + client.create_instance(::Google::Cloud::SecureSourceManager::V1::CreateInstanceRequest.new(parent: parent, instance_id: instance_id, instance: instance, request_id: request_id), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, create_instance_client_stub.call_count + end + end + end + + def test_delete_instance + # 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" + request_id = "hello world" + + delete_instance_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| + assert options.metadata.key? :"x-goog-api-client" + assert options.metadata[:"x-goog-api-client"].include? "rest" + refute options.metadata[:"x-goog-api-client"].include? "grpc" + end + + ::Google::Cloud::SecureSourceManager::V1::SecureSourceManager::Rest::ServiceStub.stub :transcode_delete_instance_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, delete_instance_client_stub do + # Create client + client = ::Google::Cloud::SecureSourceManager::V1::SecureSourceManager::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.delete_instance({ name: name, request_id: request_id }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.delete_instance name: name, request_id: request_id do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.delete_instance ::Google::Cloud::SecureSourceManager::V1::DeleteInstanceRequest.new(name: name, request_id: request_id) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + client.delete_instance({ name: name, request_id: request_id }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + client.delete_instance(::Google::Cloud::SecureSourceManager::V1::DeleteInstanceRequest.new(name: name, request_id: request_id), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, delete_instance_client_stub.call_count + end + end + end + + def test_list_repositories + # Create test objects. + client_result = ::Google::Cloud::SecureSourceManager::V1::ListRepositoriesResponse.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" + instance = "hello world" + + list_repositories_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| + assert options.metadata.key? :"x-goog-api-client" + assert options.metadata[:"x-goog-api-client"].include? "rest" + refute options.metadata[:"x-goog-api-client"].include? "grpc" + end + + ::Google::Cloud::SecureSourceManager::V1::SecureSourceManager::Rest::ServiceStub.stub :transcode_list_repositories_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, list_repositories_client_stub do + # Create client + client = ::Google::Cloud::SecureSourceManager::V1::SecureSourceManager::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.list_repositories({ parent: parent, page_size: page_size, page_token: page_token, filter: filter, instance: instance }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.list_repositories parent: parent, page_size: page_size, page_token: page_token, filter: filter, instance: instance do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.list_repositories ::Google::Cloud::SecureSourceManager::V1::ListRepositoriesRequest.new(parent: parent, page_size: page_size, page_token: page_token, filter: filter, instance: instance) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + client.list_repositories({ parent: parent, page_size: page_size, page_token: page_token, filter: filter, instance: instance }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + client.list_repositories(::Google::Cloud::SecureSourceManager::V1::ListRepositoriesRequest.new(parent: parent, page_size: page_size, page_token: page_token, filter: filter, instance: instance), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, list_repositories_client_stub.call_count + end + end + end + + def test_get_repository + # Create test objects. + client_result = ::Google::Cloud::SecureSourceManager::V1::Repository.new + http_response = OpenStruct.new body: client_result.to_json + + call_options = {} + + # Create request parameters for a unary method. + name = "hello world" + + get_repository_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| + assert options.metadata.key? :"x-goog-api-client" + assert options.metadata[:"x-goog-api-client"].include? "rest" + refute options.metadata[:"x-goog-api-client"].include? "grpc" + end + + ::Google::Cloud::SecureSourceManager::V1::SecureSourceManager::Rest::ServiceStub.stub :transcode_get_repository_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, get_repository_client_stub do + # Create client + client = ::Google::Cloud::SecureSourceManager::V1::SecureSourceManager::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.get_repository({ name: name }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.get_repository name: name do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.get_repository ::Google::Cloud::SecureSourceManager::V1::GetRepositoryRequest.new(name: name) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + client.get_repository({ name: name }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + client.get_repository(::Google::Cloud::SecureSourceManager::V1::GetRepositoryRequest.new(name: name), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, get_repository_client_stub.call_count + end + end + end + + def test_create_repository + # 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" + repository = {} + repository_id = "hello world" + + create_repository_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| + assert options.metadata.key? :"x-goog-api-client" + assert options.metadata[:"x-goog-api-client"].include? "rest" + refute options.metadata[:"x-goog-api-client"].include? "grpc" + end + + ::Google::Cloud::SecureSourceManager::V1::SecureSourceManager::Rest::ServiceStub.stub :transcode_create_repository_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, create_repository_client_stub do + # Create client + client = ::Google::Cloud::SecureSourceManager::V1::SecureSourceManager::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.create_repository({ parent: parent, repository: repository, repository_id: repository_id }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.create_repository parent: parent, repository: repository, repository_id: repository_id do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.create_repository ::Google::Cloud::SecureSourceManager::V1::CreateRepositoryRequest.new(parent: parent, repository: repository, repository_id: repository_id) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + client.create_repository({ parent: parent, repository: repository, repository_id: repository_id }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + client.create_repository(::Google::Cloud::SecureSourceManager::V1::CreateRepositoryRequest.new(parent: parent, repository: repository, repository_id: repository_id), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, create_repository_client_stub.call_count + end + end + end + + def test_update_repository + # 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. + update_mask = {} + repository = {} + validate_only = true + + update_repository_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| + assert options.metadata.key? :"x-goog-api-client" + assert options.metadata[:"x-goog-api-client"].include? "rest" + refute options.metadata[:"x-goog-api-client"].include? "grpc" + end + + ::Google::Cloud::SecureSourceManager::V1::SecureSourceManager::Rest::ServiceStub.stub :transcode_update_repository_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, update_repository_client_stub do + # Create client + client = ::Google::Cloud::SecureSourceManager::V1::SecureSourceManager::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.update_repository({ update_mask: update_mask, repository: repository, validate_only: validate_only }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.update_repository update_mask: update_mask, repository: repository, validate_only: validate_only do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.update_repository ::Google::Cloud::SecureSourceManager::V1::UpdateRepositoryRequest.new(update_mask: update_mask, repository: repository, validate_only: validate_only) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + client.update_repository({ update_mask: update_mask, repository: repository, validate_only: validate_only }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + client.update_repository(::Google::Cloud::SecureSourceManager::V1::UpdateRepositoryRequest.new(update_mask: update_mask, repository: repository, validate_only: validate_only), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, update_repository_client_stub.call_count + end + end + end + + def test_delete_repository + # 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" + allow_missing = true + + delete_repository_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| + assert options.metadata.key? :"x-goog-api-client" + assert options.metadata[:"x-goog-api-client"].include? "rest" + refute options.metadata[:"x-goog-api-client"].include? "grpc" + end + + ::Google::Cloud::SecureSourceManager::V1::SecureSourceManager::Rest::ServiceStub.stub :transcode_delete_repository_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, delete_repository_client_stub do + # Create client + client = ::Google::Cloud::SecureSourceManager::V1::SecureSourceManager::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.delete_repository({ name: name, allow_missing: allow_missing }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.delete_repository name: name, allow_missing: allow_missing do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.delete_repository ::Google::Cloud::SecureSourceManager::V1::DeleteRepositoryRequest.new(name: name, allow_missing: allow_missing) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + client.delete_repository({ name: name, allow_missing: allow_missing }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + client.delete_repository(::Google::Cloud::SecureSourceManager::V1::DeleteRepositoryRequest.new(name: name, allow_missing: allow_missing), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, delete_repository_client_stub.call_count + end + end + end + + def test_list_hooks + # Create test objects. + client_result = ::Google::Cloud::SecureSourceManager::V1::ListHooksResponse.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_hooks_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| + assert options.metadata.key? :"x-goog-api-client" + assert options.metadata[:"x-goog-api-client"].include? "rest" + refute options.metadata[:"x-goog-api-client"].include? "grpc" + end + + ::Google::Cloud::SecureSourceManager::V1::SecureSourceManager::Rest::ServiceStub.stub :transcode_list_hooks_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, list_hooks_client_stub do + # Create client + client = ::Google::Cloud::SecureSourceManager::V1::SecureSourceManager::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.list_hooks({ 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_hooks 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_hooks ::Google::Cloud::SecureSourceManager::V1::ListHooksRequest.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_hooks({ 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_hooks(::Google::Cloud::SecureSourceManager::V1::ListHooksRequest.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_hooks_client_stub.call_count + end + end + end + + def test_get_hook + # Create test objects. + client_result = ::Google::Cloud::SecureSourceManager::V1::Hook.new + http_response = OpenStruct.new body: client_result.to_json + + call_options = {} + + # Create request parameters for a unary method. + name = "hello world" + + get_hook_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| + assert options.metadata.key? :"x-goog-api-client" + assert options.metadata[:"x-goog-api-client"].include? "rest" + refute options.metadata[:"x-goog-api-client"].include? "grpc" + end + + ::Google::Cloud::SecureSourceManager::V1::SecureSourceManager::Rest::ServiceStub.stub :transcode_get_hook_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, get_hook_client_stub do + # Create client + client = ::Google::Cloud::SecureSourceManager::V1::SecureSourceManager::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.get_hook({ name: name }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.get_hook name: name do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.get_hook ::Google::Cloud::SecureSourceManager::V1::GetHookRequest.new(name: name) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + client.get_hook({ name: name }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + client.get_hook(::Google::Cloud::SecureSourceManager::V1::GetHookRequest.new(name: name), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, get_hook_client_stub.call_count + end + end + end + + def test_create_hook + # 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" + hook = {} + hook_id = "hello world" + + create_hook_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| + assert options.metadata.key? :"x-goog-api-client" + assert options.metadata[:"x-goog-api-client"].include? "rest" + refute options.metadata[:"x-goog-api-client"].include? "grpc" + end + + ::Google::Cloud::SecureSourceManager::V1::SecureSourceManager::Rest::ServiceStub.stub :transcode_create_hook_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, create_hook_client_stub do + # Create client + client = ::Google::Cloud::SecureSourceManager::V1::SecureSourceManager::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.create_hook({ parent: parent, hook: hook, hook_id: hook_id }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.create_hook parent: parent, hook: hook, hook_id: hook_id do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.create_hook ::Google::Cloud::SecureSourceManager::V1::CreateHookRequest.new(parent: parent, hook: hook, hook_id: hook_id) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + client.create_hook({ parent: parent, hook: hook, hook_id: hook_id }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + client.create_hook(::Google::Cloud::SecureSourceManager::V1::CreateHookRequest.new(parent: parent, hook: hook, hook_id: hook_id), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, create_hook_client_stub.call_count + end + end + end + + def test_update_hook + # 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. + update_mask = {} + hook = {} + + update_hook_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| + assert options.metadata.key? :"x-goog-api-client" + assert options.metadata[:"x-goog-api-client"].include? "rest" + refute options.metadata[:"x-goog-api-client"].include? "grpc" + end + + ::Google::Cloud::SecureSourceManager::V1::SecureSourceManager::Rest::ServiceStub.stub :transcode_update_hook_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, update_hook_client_stub do + # Create client + client = ::Google::Cloud::SecureSourceManager::V1::SecureSourceManager::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.update_hook({ update_mask: update_mask, hook: hook }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.update_hook update_mask: update_mask, hook: hook do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.update_hook ::Google::Cloud::SecureSourceManager::V1::UpdateHookRequest.new(update_mask: update_mask, hook: hook) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + client.update_hook({ update_mask: update_mask, hook: hook }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + client.update_hook(::Google::Cloud::SecureSourceManager::V1::UpdateHookRequest.new(update_mask: update_mask, hook: hook), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, update_hook_client_stub.call_count + end + end + end + + def test_delete_hook + # 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" + + delete_hook_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| + assert options.metadata.key? :"x-goog-api-client" + assert options.metadata[:"x-goog-api-client"].include? "rest" + refute options.metadata[:"x-goog-api-client"].include? "grpc" + end + + ::Google::Cloud::SecureSourceManager::V1::SecureSourceManager::Rest::ServiceStub.stub :transcode_delete_hook_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, delete_hook_client_stub do + # Create client + client = ::Google::Cloud::SecureSourceManager::V1::SecureSourceManager::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.delete_hook({ name: name }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.delete_hook name: name do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.delete_hook ::Google::Cloud::SecureSourceManager::V1::DeleteHookRequest.new(name: name) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + client.delete_hook({ name: name }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + client.delete_hook(::Google::Cloud::SecureSourceManager::V1::DeleteHookRequest.new(name: name), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, delete_hook_client_stub.call_count + end + end + end + + def test_get_iam_policy_repo + # Create test objects. + client_result = ::Google::Iam::V1::Policy.new + http_response = OpenStruct.new body: client_result.to_json + + call_options = {} + + # Create request parameters for a unary method. + resource = "hello world" + options = {} + + get_iam_policy_repo_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| + assert options.metadata.key? :"x-goog-api-client" + assert options.metadata[:"x-goog-api-client"].include? "rest" + refute options.metadata[:"x-goog-api-client"].include? "grpc" + end + + ::Google::Cloud::SecureSourceManager::V1::SecureSourceManager::Rest::ServiceStub.stub :transcode_get_iam_policy_repo_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, get_iam_policy_repo_client_stub do + # Create client + client = ::Google::Cloud::SecureSourceManager::V1::SecureSourceManager::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.get_iam_policy_repo({ resource: resource, options: options }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.get_iam_policy_repo resource: resource, options: options do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.get_iam_policy_repo ::Google::Iam::V1::GetIamPolicyRequest.new(resource: resource, options: options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + client.get_iam_policy_repo({ resource: resource, options: options }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + client.get_iam_policy_repo(::Google::Iam::V1::GetIamPolicyRequest.new(resource: resource, options: options), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, get_iam_policy_repo_client_stub.call_count + end + end + end + + def test_set_iam_policy_repo + # Create test objects. + client_result = ::Google::Iam::V1::Policy.new + http_response = OpenStruct.new body: client_result.to_json + + call_options = {} + + # Create request parameters for a unary method. + resource = "hello world" + policy = {} + update_mask = {} + + set_iam_policy_repo_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| + assert options.metadata.key? :"x-goog-api-client" + assert options.metadata[:"x-goog-api-client"].include? "rest" + refute options.metadata[:"x-goog-api-client"].include? "grpc" + end + + ::Google::Cloud::SecureSourceManager::V1::SecureSourceManager::Rest::ServiceStub.stub :transcode_set_iam_policy_repo_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, set_iam_policy_repo_client_stub do + # Create client + client = ::Google::Cloud::SecureSourceManager::V1::SecureSourceManager::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.set_iam_policy_repo({ resource: resource, policy: policy, update_mask: update_mask }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.set_iam_policy_repo resource: resource, policy: policy, update_mask: update_mask do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.set_iam_policy_repo ::Google::Iam::V1::SetIamPolicyRequest.new(resource: resource, policy: policy, update_mask: update_mask) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + client.set_iam_policy_repo({ resource: resource, policy: policy, update_mask: update_mask }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + client.set_iam_policy_repo(::Google::Iam::V1::SetIamPolicyRequest.new(resource: resource, policy: policy, update_mask: update_mask), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, set_iam_policy_repo_client_stub.call_count + end + end + end + + def test_test_iam_permissions_repo + # Create test objects. + client_result = ::Google::Iam::V1::TestIamPermissionsResponse.new + http_response = OpenStruct.new body: client_result.to_json + + call_options = {} + + # Create request parameters for a unary method. + resource = "hello world" + permissions = ["hello world"] + + test_iam_permissions_repo_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| + assert options.metadata.key? :"x-goog-api-client" + assert options.metadata[:"x-goog-api-client"].include? "rest" + refute options.metadata[:"x-goog-api-client"].include? "grpc" + end + + ::Google::Cloud::SecureSourceManager::V1::SecureSourceManager::Rest::ServiceStub.stub :transcode_test_iam_permissions_repo_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, test_iam_permissions_repo_client_stub do + # Create client + client = ::Google::Cloud::SecureSourceManager::V1::SecureSourceManager::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.test_iam_permissions_repo({ resource: resource, permissions: permissions }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.test_iam_permissions_repo resource: resource, permissions: permissions do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.test_iam_permissions_repo ::Google::Iam::V1::TestIamPermissionsRequest.new(resource: resource, permissions: permissions) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + client.test_iam_permissions_repo({ resource: resource, permissions: permissions }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + client.test_iam_permissions_repo(::Google::Iam::V1::TestIamPermissionsRequest.new(resource: resource, permissions: permissions), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, test_iam_permissions_repo_client_stub.call_count + end + end + end + + def test_create_branch_rule + # 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" + branch_rule = {} + branch_rule_id = "hello world" + + create_branch_rule_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| + assert options.metadata.key? :"x-goog-api-client" + assert options.metadata[:"x-goog-api-client"].include? "rest" + refute options.metadata[:"x-goog-api-client"].include? "grpc" + end + + ::Google::Cloud::SecureSourceManager::V1::SecureSourceManager::Rest::ServiceStub.stub :transcode_create_branch_rule_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, create_branch_rule_client_stub do + # Create client + client = ::Google::Cloud::SecureSourceManager::V1::SecureSourceManager::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.create_branch_rule({ parent: parent, branch_rule: branch_rule, branch_rule_id: branch_rule_id }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.create_branch_rule parent: parent, branch_rule: branch_rule, branch_rule_id: branch_rule_id do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.create_branch_rule ::Google::Cloud::SecureSourceManager::V1::CreateBranchRuleRequest.new(parent: parent, branch_rule: branch_rule, branch_rule_id: branch_rule_id) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + client.create_branch_rule({ parent: parent, branch_rule: branch_rule, branch_rule_id: branch_rule_id }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + client.create_branch_rule(::Google::Cloud::SecureSourceManager::V1::CreateBranchRuleRequest.new(parent: parent, branch_rule: branch_rule, branch_rule_id: branch_rule_id), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, create_branch_rule_client_stub.call_count + end + end + end + + def test_list_branch_rules + # Create test objects. + client_result = ::Google::Cloud::SecureSourceManager::V1::ListBranchRulesResponse.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_branch_rules_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| + assert options.metadata.key? :"x-goog-api-client" + assert options.metadata[:"x-goog-api-client"].include? "rest" + refute options.metadata[:"x-goog-api-client"].include? "grpc" + end + + ::Google::Cloud::SecureSourceManager::V1::SecureSourceManager::Rest::ServiceStub.stub :transcode_list_branch_rules_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, list_branch_rules_client_stub do + # Create client + client = ::Google::Cloud::SecureSourceManager::V1::SecureSourceManager::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.list_branch_rules({ 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_branch_rules 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_branch_rules ::Google::Cloud::SecureSourceManager::V1::ListBranchRulesRequest.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_branch_rules({ 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_branch_rules(::Google::Cloud::SecureSourceManager::V1::ListBranchRulesRequest.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_branch_rules_client_stub.call_count + end + end + end + + def test_get_branch_rule + # Create test objects. + client_result = ::Google::Cloud::SecureSourceManager::V1::BranchRule.new + http_response = OpenStruct.new body: client_result.to_json + + call_options = {} + + # Create request parameters for a unary method. + name = "hello world" + + get_branch_rule_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| + assert options.metadata.key? :"x-goog-api-client" + assert options.metadata[:"x-goog-api-client"].include? "rest" + refute options.metadata[:"x-goog-api-client"].include? "grpc" + end + + ::Google::Cloud::SecureSourceManager::V1::SecureSourceManager::Rest::ServiceStub.stub :transcode_get_branch_rule_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, get_branch_rule_client_stub do + # Create client + client = ::Google::Cloud::SecureSourceManager::V1::SecureSourceManager::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.get_branch_rule({ name: name }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.get_branch_rule name: name do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.get_branch_rule ::Google::Cloud::SecureSourceManager::V1::GetBranchRuleRequest.new(name: name) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + client.get_branch_rule({ name: name }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + client.get_branch_rule(::Google::Cloud::SecureSourceManager::V1::GetBranchRuleRequest.new(name: name), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, get_branch_rule_client_stub.call_count + end + end + end + + def test_update_branch_rule + # 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. + branch_rule = {} + validate_only = true + update_mask = {} + + update_branch_rule_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| + assert options.metadata.key? :"x-goog-api-client" + assert options.metadata[:"x-goog-api-client"].include? "rest" + refute options.metadata[:"x-goog-api-client"].include? "grpc" + end + + ::Google::Cloud::SecureSourceManager::V1::SecureSourceManager::Rest::ServiceStub.stub :transcode_update_branch_rule_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, update_branch_rule_client_stub do + # Create client + client = ::Google::Cloud::SecureSourceManager::V1::SecureSourceManager::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.update_branch_rule({ branch_rule: branch_rule, validate_only: validate_only, update_mask: update_mask }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.update_branch_rule branch_rule: branch_rule, validate_only: validate_only, update_mask: update_mask do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.update_branch_rule ::Google::Cloud::SecureSourceManager::V1::UpdateBranchRuleRequest.new(branch_rule: branch_rule, 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_branch_rule({ branch_rule: branch_rule, 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_branch_rule(::Google::Cloud::SecureSourceManager::V1::UpdateBranchRuleRequest.new(branch_rule: branch_rule, 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_branch_rule_client_stub.call_count + end + end + end + + def test_delete_branch_rule + # 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" + allow_missing = true + + delete_branch_rule_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| + assert options.metadata.key? :"x-goog-api-client" + assert options.metadata[:"x-goog-api-client"].include? "rest" + refute options.metadata[:"x-goog-api-client"].include? "grpc" + end + + ::Google::Cloud::SecureSourceManager::V1::SecureSourceManager::Rest::ServiceStub.stub :transcode_delete_branch_rule_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, delete_branch_rule_client_stub do + # Create client + client = ::Google::Cloud::SecureSourceManager::V1::SecureSourceManager::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.delete_branch_rule({ name: name, allow_missing: allow_missing }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.delete_branch_rule name: name, allow_missing: allow_missing do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.delete_branch_rule ::Google::Cloud::SecureSourceManager::V1::DeleteBranchRuleRequest.new(name: name, allow_missing: allow_missing) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + client.delete_branch_rule({ name: name, allow_missing: allow_missing }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + client.delete_branch_rule(::Google::Cloud::SecureSourceManager::V1::DeleteBranchRuleRequest.new(name: name, allow_missing: allow_missing), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, delete_branch_rule_client_stub.call_count + end + end + end + + def test_create_pull_request + # 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" + pull_request = {} + + create_pull_request_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| + assert options.metadata.key? :"x-goog-api-client" + assert options.metadata[:"x-goog-api-client"].include? "rest" + refute options.metadata[:"x-goog-api-client"].include? "grpc" + end + + ::Google::Cloud::SecureSourceManager::V1::SecureSourceManager::Rest::ServiceStub.stub :transcode_create_pull_request_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, create_pull_request_client_stub do + # Create client + client = ::Google::Cloud::SecureSourceManager::V1::SecureSourceManager::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.create_pull_request({ parent: parent, pull_request: pull_request }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.create_pull_request parent: parent, pull_request: pull_request do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.create_pull_request ::Google::Cloud::SecureSourceManager::V1::CreatePullRequestRequest.new(parent: parent, pull_request: pull_request) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + client.create_pull_request({ parent: parent, pull_request: pull_request }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + client.create_pull_request(::Google::Cloud::SecureSourceManager::V1::CreatePullRequestRequest.new(parent: parent, pull_request: pull_request), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, create_pull_request_client_stub.call_count + end + end + end + + def test_get_pull_request + # Create test objects. + client_result = ::Google::Cloud::SecureSourceManager::V1::PullRequest.new + http_response = OpenStruct.new body: client_result.to_json + + call_options = {} + + # Create request parameters for a unary method. + name = "hello world" + + get_pull_request_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| + assert options.metadata.key? :"x-goog-api-client" + assert options.metadata[:"x-goog-api-client"].include? "rest" + refute options.metadata[:"x-goog-api-client"].include? "grpc" + end + + ::Google::Cloud::SecureSourceManager::V1::SecureSourceManager::Rest::ServiceStub.stub :transcode_get_pull_request_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, get_pull_request_client_stub do + # Create client + client = ::Google::Cloud::SecureSourceManager::V1::SecureSourceManager::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.get_pull_request({ name: name }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.get_pull_request name: name do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.get_pull_request ::Google::Cloud::SecureSourceManager::V1::GetPullRequestRequest.new(name: name) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + client.get_pull_request({ name: name }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + client.get_pull_request(::Google::Cloud::SecureSourceManager::V1::GetPullRequestRequest.new(name: name), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, get_pull_request_client_stub.call_count + end + end + end + + def test_list_pull_requests + # Create test objects. + client_result = ::Google::Cloud::SecureSourceManager::V1::ListPullRequestsResponse.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_pull_requests_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| + assert options.metadata.key? :"x-goog-api-client" + assert options.metadata[:"x-goog-api-client"].include? "rest" + refute options.metadata[:"x-goog-api-client"].include? "grpc" + end + + ::Google::Cloud::SecureSourceManager::V1::SecureSourceManager::Rest::ServiceStub.stub :transcode_list_pull_requests_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, list_pull_requests_client_stub do + # Create client + client = ::Google::Cloud::SecureSourceManager::V1::SecureSourceManager::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.list_pull_requests({ 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_pull_requests 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_pull_requests ::Google::Cloud::SecureSourceManager::V1::ListPullRequestsRequest.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_pull_requests({ 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_pull_requests(::Google::Cloud::SecureSourceManager::V1::ListPullRequestsRequest.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_pull_requests_client_stub.call_count + end + end + end + + def test_update_pull_request + # 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. + pull_request = {} + update_mask = {} + + update_pull_request_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| + assert options.metadata.key? :"x-goog-api-client" + assert options.metadata[:"x-goog-api-client"].include? "rest" + refute options.metadata[:"x-goog-api-client"].include? "grpc" + end + + ::Google::Cloud::SecureSourceManager::V1::SecureSourceManager::Rest::ServiceStub.stub :transcode_update_pull_request_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, update_pull_request_client_stub do + # Create client + client = ::Google::Cloud::SecureSourceManager::V1::SecureSourceManager::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.update_pull_request({ pull_request: pull_request, update_mask: update_mask }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.update_pull_request pull_request: pull_request, update_mask: update_mask do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.update_pull_request ::Google::Cloud::SecureSourceManager::V1::UpdatePullRequestRequest.new(pull_request: pull_request, update_mask: update_mask) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + client.update_pull_request({ pull_request: pull_request, update_mask: update_mask }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + client.update_pull_request(::Google::Cloud::SecureSourceManager::V1::UpdatePullRequestRequest.new(pull_request: pull_request, update_mask: update_mask), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, update_pull_request_client_stub.call_count + end + end + end + + def test_merge_pull_request + # 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" + + merge_pull_request_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| + assert options.metadata.key? :"x-goog-api-client" + assert options.metadata[:"x-goog-api-client"].include? "rest" + refute options.metadata[:"x-goog-api-client"].include? "grpc" + end + + ::Google::Cloud::SecureSourceManager::V1::SecureSourceManager::Rest::ServiceStub.stub :transcode_merge_pull_request_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, merge_pull_request_client_stub do + # Create client + client = ::Google::Cloud::SecureSourceManager::V1::SecureSourceManager::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.merge_pull_request({ name: name }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.merge_pull_request name: name do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.merge_pull_request ::Google::Cloud::SecureSourceManager::V1::MergePullRequestRequest.new(name: name) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + client.merge_pull_request({ name: name }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + client.merge_pull_request(::Google::Cloud::SecureSourceManager::V1::MergePullRequestRequest.new(name: name), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, merge_pull_request_client_stub.call_count + end + end + end + + def test_open_pull_request + # 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" + + open_pull_request_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| + assert options.metadata.key? :"x-goog-api-client" + assert options.metadata[:"x-goog-api-client"].include? "rest" + refute options.metadata[:"x-goog-api-client"].include? "grpc" + end + + ::Google::Cloud::SecureSourceManager::V1::SecureSourceManager::Rest::ServiceStub.stub :transcode_open_pull_request_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, open_pull_request_client_stub do + # Create client + client = ::Google::Cloud::SecureSourceManager::V1::SecureSourceManager::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.open_pull_request({ name: name }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.open_pull_request name: name do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.open_pull_request ::Google::Cloud::SecureSourceManager::V1::OpenPullRequestRequest.new(name: name) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + client.open_pull_request({ name: name }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + client.open_pull_request(::Google::Cloud::SecureSourceManager::V1::OpenPullRequestRequest.new(name: name), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, open_pull_request_client_stub.call_count + end + end + end + + def test_close_pull_request + # 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" + + close_pull_request_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| + assert options.metadata.key? :"x-goog-api-client" + assert options.metadata[:"x-goog-api-client"].include? "rest" + refute options.metadata[:"x-goog-api-client"].include? "grpc" + end + + ::Google::Cloud::SecureSourceManager::V1::SecureSourceManager::Rest::ServiceStub.stub :transcode_close_pull_request_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, close_pull_request_client_stub do + # Create client + client = ::Google::Cloud::SecureSourceManager::V1::SecureSourceManager::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.close_pull_request({ name: name }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.close_pull_request name: name do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.close_pull_request ::Google::Cloud::SecureSourceManager::V1::ClosePullRequestRequest.new(name: name) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + client.close_pull_request({ name: name }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + client.close_pull_request(::Google::Cloud::SecureSourceManager::V1::ClosePullRequestRequest.new(name: name), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, close_pull_request_client_stub.call_count + end + end + end + + def test_list_pull_request_file_diffs + # Create test objects. + client_result = ::Google::Cloud::SecureSourceManager::V1::ListPullRequestFileDiffsResponse.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" + + list_pull_request_file_diffs_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| + assert options.metadata.key? :"x-goog-api-client" + assert options.metadata[:"x-goog-api-client"].include? "rest" + refute options.metadata[:"x-goog-api-client"].include? "grpc" + end + + ::Google::Cloud::SecureSourceManager::V1::SecureSourceManager::Rest::ServiceStub.stub :transcode_list_pull_request_file_diffs_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, list_pull_request_file_diffs_client_stub do + # Create client + client = ::Google::Cloud::SecureSourceManager::V1::SecureSourceManager::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.list_pull_request_file_diffs({ 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.list_pull_request_file_diffs 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.list_pull_request_file_diffs ::Google::Cloud::SecureSourceManager::V1::ListPullRequestFileDiffsRequest.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.list_pull_request_file_diffs({ 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.list_pull_request_file_diffs(::Google::Cloud::SecureSourceManager::V1::ListPullRequestFileDiffsRequest.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, list_pull_request_file_diffs_client_stub.call_count + end + end + end + + def test_fetch_tree + # Create test objects. + client_result = ::Google::Cloud::SecureSourceManager::V1::FetchTreeResponse.new + http_response = OpenStruct.new body: client_result.to_json + + call_options = {} + + # Create request parameters for a unary method. + repository = "hello world" + ref = "hello world" + recursive = true + page_size = 42 + page_token = "hello world" + + fetch_tree_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| + assert options.metadata.key? :"x-goog-api-client" + assert options.metadata[:"x-goog-api-client"].include? "rest" + refute options.metadata[:"x-goog-api-client"].include? "grpc" + end + + ::Google::Cloud::SecureSourceManager::V1::SecureSourceManager::Rest::ServiceStub.stub :transcode_fetch_tree_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, fetch_tree_client_stub do + # Create client + client = ::Google::Cloud::SecureSourceManager::V1::SecureSourceManager::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.fetch_tree({ repository: repository, ref: ref, recursive: recursive, page_size: page_size, page_token: page_token }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.fetch_tree repository: repository, ref: ref, recursive: recursive, page_size: page_size, page_token: page_token do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.fetch_tree ::Google::Cloud::SecureSourceManager::V1::FetchTreeRequest.new(repository: repository, ref: ref, recursive: recursive, 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.fetch_tree({ repository: repository, ref: ref, recursive: recursive, 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.fetch_tree(::Google::Cloud::SecureSourceManager::V1::FetchTreeRequest.new(repository: repository, ref: ref, recursive: recursive, 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, fetch_tree_client_stub.call_count + end + end + end + + def test_fetch_blob + # Create test objects. + client_result = ::Google::Cloud::SecureSourceManager::V1::FetchBlobResponse.new + http_response = OpenStruct.new body: client_result.to_json + + call_options = {} + + # Create request parameters for a unary method. + repository = "hello world" + sha = "hello world" + + fetch_blob_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| + assert options.metadata.key? :"x-goog-api-client" + assert options.metadata[:"x-goog-api-client"].include? "rest" + refute options.metadata[:"x-goog-api-client"].include? "grpc" + end + + ::Google::Cloud::SecureSourceManager::V1::SecureSourceManager::Rest::ServiceStub.stub :transcode_fetch_blob_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, fetch_blob_client_stub do + # Create client + client = ::Google::Cloud::SecureSourceManager::V1::SecureSourceManager::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.fetch_blob({ repository: repository, sha: sha }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.fetch_blob repository: repository, sha: sha do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.fetch_blob ::Google::Cloud::SecureSourceManager::V1::FetchBlobRequest.new(repository: repository, sha: sha) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + client.fetch_blob({ repository: repository, sha: sha }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + client.fetch_blob(::Google::Cloud::SecureSourceManager::V1::FetchBlobRequest.new(repository: repository, sha: sha), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, fetch_blob_client_stub.call_count + end + end + end + + def test_create_issue + # 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" + issue = {} + + create_issue_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| + assert options.metadata.key? :"x-goog-api-client" + assert options.metadata[:"x-goog-api-client"].include? "rest" + refute options.metadata[:"x-goog-api-client"].include? "grpc" + end + + ::Google::Cloud::SecureSourceManager::V1::SecureSourceManager::Rest::ServiceStub.stub :transcode_create_issue_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, create_issue_client_stub do + # Create client + client = ::Google::Cloud::SecureSourceManager::V1::SecureSourceManager::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.create_issue({ parent: parent, issue: issue }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.create_issue parent: parent, issue: issue do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.create_issue ::Google::Cloud::SecureSourceManager::V1::CreateIssueRequest.new(parent: parent, issue: issue) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + client.create_issue({ parent: parent, issue: issue }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + client.create_issue(::Google::Cloud::SecureSourceManager::V1::CreateIssueRequest.new(parent: parent, issue: issue), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, create_issue_client_stub.call_count + end + end + end + + def test_get_issue + # Create test objects. + client_result = ::Google::Cloud::SecureSourceManager::V1::Issue.new + http_response = OpenStruct.new body: client_result.to_json + + call_options = {} + + # Create request parameters for a unary method. + name = "hello world" + + get_issue_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| + assert options.metadata.key? :"x-goog-api-client" + assert options.metadata[:"x-goog-api-client"].include? "rest" + refute options.metadata[:"x-goog-api-client"].include? "grpc" + end + + ::Google::Cloud::SecureSourceManager::V1::SecureSourceManager::Rest::ServiceStub.stub :transcode_get_issue_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, get_issue_client_stub do + # Create client + client = ::Google::Cloud::SecureSourceManager::V1::SecureSourceManager::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.get_issue({ name: name }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.get_issue name: name do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.get_issue ::Google::Cloud::SecureSourceManager::V1::GetIssueRequest.new(name: name) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + client.get_issue({ name: name }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + client.get_issue(::Google::Cloud::SecureSourceManager::V1::GetIssueRequest.new(name: name), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, get_issue_client_stub.call_count + end + end + end + + def test_list_issues + # Create test objects. + client_result = ::Google::Cloud::SecureSourceManager::V1::ListIssuesResponse.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_issues_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| + assert options.metadata.key? :"x-goog-api-client" + assert options.metadata[:"x-goog-api-client"].include? "rest" + refute options.metadata[:"x-goog-api-client"].include? "grpc" + end + + ::Google::Cloud::SecureSourceManager::V1::SecureSourceManager::Rest::ServiceStub.stub :transcode_list_issues_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, list_issues_client_stub do + # Create client + client = ::Google::Cloud::SecureSourceManager::V1::SecureSourceManager::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.list_issues({ 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_issues 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_issues ::Google::Cloud::SecureSourceManager::V1::ListIssuesRequest.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_issues({ 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_issues(::Google::Cloud::SecureSourceManager::V1::ListIssuesRequest.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_issues_client_stub.call_count + end + end + end + + def test_update_issue + # 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. + issue = {} + update_mask = {} + + update_issue_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| + assert options.metadata.key? :"x-goog-api-client" + assert options.metadata[:"x-goog-api-client"].include? "rest" + refute options.metadata[:"x-goog-api-client"].include? "grpc" + end + + ::Google::Cloud::SecureSourceManager::V1::SecureSourceManager::Rest::ServiceStub.stub :transcode_update_issue_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, update_issue_client_stub do + # Create client + client = ::Google::Cloud::SecureSourceManager::V1::SecureSourceManager::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.update_issue({ issue: issue, update_mask: update_mask }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.update_issue issue: issue, update_mask: update_mask do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.update_issue ::Google::Cloud::SecureSourceManager::V1::UpdateIssueRequest.new(issue: issue, update_mask: update_mask) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + client.update_issue({ issue: issue, update_mask: update_mask }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + client.update_issue(::Google::Cloud::SecureSourceManager::V1::UpdateIssueRequest.new(issue: issue, update_mask: update_mask), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, update_issue_client_stub.call_count + end + end + end + + def test_delete_issue + # 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" + + delete_issue_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| + assert options.metadata.key? :"x-goog-api-client" + assert options.metadata[:"x-goog-api-client"].include? "rest" + refute options.metadata[:"x-goog-api-client"].include? "grpc" + end + + ::Google::Cloud::SecureSourceManager::V1::SecureSourceManager::Rest::ServiceStub.stub :transcode_delete_issue_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, delete_issue_client_stub do + # Create client + client = ::Google::Cloud::SecureSourceManager::V1::SecureSourceManager::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.delete_issue({ name: name, etag: etag }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.delete_issue name: name, etag: etag do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.delete_issue ::Google::Cloud::SecureSourceManager::V1::DeleteIssueRequest.new(name: name, etag: etag) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + client.delete_issue({ name: name, etag: etag }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + client.delete_issue(::Google::Cloud::SecureSourceManager::V1::DeleteIssueRequest.new(name: name, etag: etag), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, delete_issue_client_stub.call_count + end + end + end + + def test_open_issue + # 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" + + open_issue_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| + assert options.metadata.key? :"x-goog-api-client" + assert options.metadata[:"x-goog-api-client"].include? "rest" + refute options.metadata[:"x-goog-api-client"].include? "grpc" + end + + ::Google::Cloud::SecureSourceManager::V1::SecureSourceManager::Rest::ServiceStub.stub :transcode_open_issue_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, open_issue_client_stub do + # Create client + client = ::Google::Cloud::SecureSourceManager::V1::SecureSourceManager::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.open_issue({ name: name, etag: etag }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.open_issue name: name, etag: etag do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.open_issue ::Google::Cloud::SecureSourceManager::V1::OpenIssueRequest.new(name: name, etag: etag) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + client.open_issue({ name: name, etag: etag }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + client.open_issue(::Google::Cloud::SecureSourceManager::V1::OpenIssueRequest.new(name: name, etag: etag), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, open_issue_client_stub.call_count + end + end + end + + def test_close_issue + # 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" + + close_issue_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| + assert options.metadata.key? :"x-goog-api-client" + assert options.metadata[:"x-goog-api-client"].include? "rest" + refute options.metadata[:"x-goog-api-client"].include? "grpc" + end + + ::Google::Cloud::SecureSourceManager::V1::SecureSourceManager::Rest::ServiceStub.stub :transcode_close_issue_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, close_issue_client_stub do + # Create client + client = ::Google::Cloud::SecureSourceManager::V1::SecureSourceManager::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.close_issue({ name: name, etag: etag }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.close_issue name: name, etag: etag do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.close_issue ::Google::Cloud::SecureSourceManager::V1::CloseIssueRequest.new(name: name, etag: etag) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + client.close_issue({ name: name, etag: etag }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + client.close_issue(::Google::Cloud::SecureSourceManager::V1::CloseIssueRequest.new(name: name, etag: etag), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, close_issue_client_stub.call_count + end + end + end + + def test_get_pull_request_comment + # Create test objects. + client_result = ::Google::Cloud::SecureSourceManager::V1::PullRequestComment.new + http_response = OpenStruct.new body: client_result.to_json + + call_options = {} + + # Create request parameters for a unary method. + name = "hello world" + + get_pull_request_comment_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| + assert options.metadata.key? :"x-goog-api-client" + assert options.metadata[:"x-goog-api-client"].include? "rest" + refute options.metadata[:"x-goog-api-client"].include? "grpc" + end + + ::Google::Cloud::SecureSourceManager::V1::SecureSourceManager::Rest::ServiceStub.stub :transcode_get_pull_request_comment_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, get_pull_request_comment_client_stub do + # Create client + client = ::Google::Cloud::SecureSourceManager::V1::SecureSourceManager::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.get_pull_request_comment({ name: name }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.get_pull_request_comment name: name do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.get_pull_request_comment ::Google::Cloud::SecureSourceManager::V1::GetPullRequestCommentRequest.new(name: name) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + client.get_pull_request_comment({ name: name }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + client.get_pull_request_comment(::Google::Cloud::SecureSourceManager::V1::GetPullRequestCommentRequest.new(name: name), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, get_pull_request_comment_client_stub.call_count + end + end + end + + def test_list_pull_request_comments + # Create test objects. + client_result = ::Google::Cloud::SecureSourceManager::V1::ListPullRequestCommentsResponse.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_pull_request_comments_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| + assert options.metadata.key? :"x-goog-api-client" + assert options.metadata[:"x-goog-api-client"].include? "rest" + refute options.metadata[:"x-goog-api-client"].include? "grpc" + end + + ::Google::Cloud::SecureSourceManager::V1::SecureSourceManager::Rest::ServiceStub.stub :transcode_list_pull_request_comments_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, list_pull_request_comments_client_stub do + # Create client + client = ::Google::Cloud::SecureSourceManager::V1::SecureSourceManager::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.list_pull_request_comments({ 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_pull_request_comments 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_pull_request_comments ::Google::Cloud::SecureSourceManager::V1::ListPullRequestCommentsRequest.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_pull_request_comments({ 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_pull_request_comments(::Google::Cloud::SecureSourceManager::V1::ListPullRequestCommentsRequest.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_pull_request_comments_client_stub.call_count + end + end + end + + def test_create_pull_request_comment + # 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" + pull_request_comment = {} + + create_pull_request_comment_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| + assert options.metadata.key? :"x-goog-api-client" + assert options.metadata[:"x-goog-api-client"].include? "rest" + refute options.metadata[:"x-goog-api-client"].include? "grpc" + end + + ::Google::Cloud::SecureSourceManager::V1::SecureSourceManager::Rest::ServiceStub.stub :transcode_create_pull_request_comment_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, create_pull_request_comment_client_stub do + # Create client + client = ::Google::Cloud::SecureSourceManager::V1::SecureSourceManager::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.create_pull_request_comment({ parent: parent, pull_request_comment: pull_request_comment }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.create_pull_request_comment parent: parent, pull_request_comment: pull_request_comment do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.create_pull_request_comment ::Google::Cloud::SecureSourceManager::V1::CreatePullRequestCommentRequest.new(parent: parent, pull_request_comment: pull_request_comment) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + client.create_pull_request_comment({ parent: parent, pull_request_comment: pull_request_comment }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + client.create_pull_request_comment(::Google::Cloud::SecureSourceManager::V1::CreatePullRequestCommentRequest.new(parent: parent, pull_request_comment: pull_request_comment), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, create_pull_request_comment_client_stub.call_count + end + end + end + + def test_update_pull_request_comment + # 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. + pull_request_comment = {} + update_mask = {} + + update_pull_request_comment_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| + assert options.metadata.key? :"x-goog-api-client" + assert options.metadata[:"x-goog-api-client"].include? "rest" + refute options.metadata[:"x-goog-api-client"].include? "grpc" + end + + ::Google::Cloud::SecureSourceManager::V1::SecureSourceManager::Rest::ServiceStub.stub :transcode_update_pull_request_comment_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, update_pull_request_comment_client_stub do + # Create client + client = ::Google::Cloud::SecureSourceManager::V1::SecureSourceManager::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.update_pull_request_comment({ pull_request_comment: pull_request_comment, update_mask: update_mask }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.update_pull_request_comment pull_request_comment: pull_request_comment, update_mask: update_mask do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.update_pull_request_comment ::Google::Cloud::SecureSourceManager::V1::UpdatePullRequestCommentRequest.new(pull_request_comment: pull_request_comment, update_mask: update_mask) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + client.update_pull_request_comment({ pull_request_comment: pull_request_comment, update_mask: update_mask }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + client.update_pull_request_comment(::Google::Cloud::SecureSourceManager::V1::UpdatePullRequestCommentRequest.new(pull_request_comment: pull_request_comment, update_mask: update_mask), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, update_pull_request_comment_client_stub.call_count + end + end + end + + def test_delete_pull_request_comment + # 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" + + delete_pull_request_comment_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| + assert options.metadata.key? :"x-goog-api-client" + assert options.metadata[:"x-goog-api-client"].include? "rest" + refute options.metadata[:"x-goog-api-client"].include? "grpc" + end + + ::Google::Cloud::SecureSourceManager::V1::SecureSourceManager::Rest::ServiceStub.stub :transcode_delete_pull_request_comment_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, delete_pull_request_comment_client_stub do + # Create client + client = ::Google::Cloud::SecureSourceManager::V1::SecureSourceManager::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.delete_pull_request_comment({ name: name }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.delete_pull_request_comment name: name do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.delete_pull_request_comment ::Google::Cloud::SecureSourceManager::V1::DeletePullRequestCommentRequest.new(name: name) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + client.delete_pull_request_comment({ name: name }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + client.delete_pull_request_comment(::Google::Cloud::SecureSourceManager::V1::DeletePullRequestCommentRequest.new(name: name), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, delete_pull_request_comment_client_stub.call_count + end + end + end + + def test_batch_create_pull_request_comments + # 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" + requests = [{}] + + batch_create_pull_request_comments_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| + assert options.metadata.key? :"x-goog-api-client" + assert options.metadata[:"x-goog-api-client"].include? "rest" + refute options.metadata[:"x-goog-api-client"].include? "grpc" + end + + ::Google::Cloud::SecureSourceManager::V1::SecureSourceManager::Rest::ServiceStub.stub :transcode_batch_create_pull_request_comments_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, batch_create_pull_request_comments_client_stub do + # Create client + client = ::Google::Cloud::SecureSourceManager::V1::SecureSourceManager::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.batch_create_pull_request_comments({ parent: parent, requests: requests }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.batch_create_pull_request_comments parent: parent, requests: requests do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.batch_create_pull_request_comments ::Google::Cloud::SecureSourceManager::V1::BatchCreatePullRequestCommentsRequest.new(parent: parent, requests: requests) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + client.batch_create_pull_request_comments({ parent: parent, requests: requests }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + client.batch_create_pull_request_comments(::Google::Cloud::SecureSourceManager::V1::BatchCreatePullRequestCommentsRequest.new(parent: parent, requests: requests), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, batch_create_pull_request_comments_client_stub.call_count + end + end + end + + def test_resolve_pull_request_comments + # 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" + names = ["hello world"] + auto_fill = true + + resolve_pull_request_comments_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| + assert options.metadata.key? :"x-goog-api-client" + assert options.metadata[:"x-goog-api-client"].include? "rest" + refute options.metadata[:"x-goog-api-client"].include? "grpc" + end + + ::Google::Cloud::SecureSourceManager::V1::SecureSourceManager::Rest::ServiceStub.stub :transcode_resolve_pull_request_comments_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, resolve_pull_request_comments_client_stub do + # Create client + client = ::Google::Cloud::SecureSourceManager::V1::SecureSourceManager::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.resolve_pull_request_comments({ parent: parent, names: names, auto_fill: auto_fill }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.resolve_pull_request_comments parent: parent, names: names, auto_fill: auto_fill do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.resolve_pull_request_comments ::Google::Cloud::SecureSourceManager::V1::ResolvePullRequestCommentsRequest.new(parent: parent, names: names, auto_fill: auto_fill) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + client.resolve_pull_request_comments({ parent: parent, names: names, auto_fill: auto_fill }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + client.resolve_pull_request_comments(::Google::Cloud::SecureSourceManager::V1::ResolvePullRequestCommentsRequest.new(parent: parent, names: names, auto_fill: auto_fill), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, resolve_pull_request_comments_client_stub.call_count + end + end + end + + def test_unresolve_pull_request_comments + # 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" + names = ["hello world"] + auto_fill = true + + unresolve_pull_request_comments_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| + assert options.metadata.key? :"x-goog-api-client" + assert options.metadata[:"x-goog-api-client"].include? "rest" + refute options.metadata[:"x-goog-api-client"].include? "grpc" + end + + ::Google::Cloud::SecureSourceManager::V1::SecureSourceManager::Rest::ServiceStub.stub :transcode_unresolve_pull_request_comments_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, unresolve_pull_request_comments_client_stub do + # Create client + client = ::Google::Cloud::SecureSourceManager::V1::SecureSourceManager::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.unresolve_pull_request_comments({ parent: parent, names: names, auto_fill: auto_fill }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.unresolve_pull_request_comments parent: parent, names: names, auto_fill: auto_fill do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.unresolve_pull_request_comments ::Google::Cloud::SecureSourceManager::V1::UnresolvePullRequestCommentsRequest.new(parent: parent, names: names, auto_fill: auto_fill) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + client.unresolve_pull_request_comments({ parent: parent, names: names, auto_fill: auto_fill }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + client.unresolve_pull_request_comments(::Google::Cloud::SecureSourceManager::V1::UnresolvePullRequestCommentsRequest.new(parent: parent, names: names, auto_fill: auto_fill), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, unresolve_pull_request_comments_client_stub.call_count + end + end + end + + def test_create_issue_comment + # 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" + issue_comment = {} + + create_issue_comment_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| + assert options.metadata.key? :"x-goog-api-client" + assert options.metadata[:"x-goog-api-client"].include? "rest" + refute options.metadata[:"x-goog-api-client"].include? "grpc" + end + + ::Google::Cloud::SecureSourceManager::V1::SecureSourceManager::Rest::ServiceStub.stub :transcode_create_issue_comment_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, create_issue_comment_client_stub do + # Create client + client = ::Google::Cloud::SecureSourceManager::V1::SecureSourceManager::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.create_issue_comment({ parent: parent, issue_comment: issue_comment }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.create_issue_comment parent: parent, issue_comment: issue_comment do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.create_issue_comment ::Google::Cloud::SecureSourceManager::V1::CreateIssueCommentRequest.new(parent: parent, issue_comment: issue_comment) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + client.create_issue_comment({ parent: parent, issue_comment: issue_comment }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + client.create_issue_comment(::Google::Cloud::SecureSourceManager::V1::CreateIssueCommentRequest.new(parent: parent, issue_comment: issue_comment), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, create_issue_comment_client_stub.call_count + end + end + end + + def test_get_issue_comment + # Create test objects. + client_result = ::Google::Cloud::SecureSourceManager::V1::IssueComment.new + http_response = OpenStruct.new body: client_result.to_json + + call_options = {} + + # Create request parameters for a unary method. + name = "hello world" + + get_issue_comment_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| + assert options.metadata.key? :"x-goog-api-client" + assert options.metadata[:"x-goog-api-client"].include? "rest" + refute options.metadata[:"x-goog-api-client"].include? "grpc" + end + + ::Google::Cloud::SecureSourceManager::V1::SecureSourceManager::Rest::ServiceStub.stub :transcode_get_issue_comment_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, get_issue_comment_client_stub do + # Create client + client = ::Google::Cloud::SecureSourceManager::V1::SecureSourceManager::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.get_issue_comment({ name: name }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.get_issue_comment name: name do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.get_issue_comment ::Google::Cloud::SecureSourceManager::V1::GetIssueCommentRequest.new(name: name) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + client.get_issue_comment({ name: name }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + client.get_issue_comment(::Google::Cloud::SecureSourceManager::V1::GetIssueCommentRequest.new(name: name), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, get_issue_comment_client_stub.call_count + end + end + end + + def test_list_issue_comments + # Create test objects. + client_result = ::Google::Cloud::SecureSourceManager::V1::ListIssueCommentsResponse.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_issue_comments_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| + assert options.metadata.key? :"x-goog-api-client" + assert options.metadata[:"x-goog-api-client"].include? "rest" + refute options.metadata[:"x-goog-api-client"].include? "grpc" + end + + ::Google::Cloud::SecureSourceManager::V1::SecureSourceManager::Rest::ServiceStub.stub :transcode_list_issue_comments_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, list_issue_comments_client_stub do + # Create client + client = ::Google::Cloud::SecureSourceManager::V1::SecureSourceManager::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.list_issue_comments({ 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_issue_comments 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_issue_comments ::Google::Cloud::SecureSourceManager::V1::ListIssueCommentsRequest.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_issue_comments({ 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_issue_comments(::Google::Cloud::SecureSourceManager::V1::ListIssueCommentsRequest.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_issue_comments_client_stub.call_count + end + end + end + + def test_update_issue_comment + # 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. + issue_comment = {} + update_mask = {} + + update_issue_comment_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| + assert options.metadata.key? :"x-goog-api-client" + assert options.metadata[:"x-goog-api-client"].include? "rest" + refute options.metadata[:"x-goog-api-client"].include? "grpc" + end + + ::Google::Cloud::SecureSourceManager::V1::SecureSourceManager::Rest::ServiceStub.stub :transcode_update_issue_comment_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, update_issue_comment_client_stub do + # Create client + client = ::Google::Cloud::SecureSourceManager::V1::SecureSourceManager::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.update_issue_comment({ issue_comment: issue_comment, update_mask: update_mask }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.update_issue_comment issue_comment: issue_comment, update_mask: update_mask do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.update_issue_comment ::Google::Cloud::SecureSourceManager::V1::UpdateIssueCommentRequest.new(issue_comment: issue_comment, update_mask: update_mask) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + client.update_issue_comment({ issue_comment: issue_comment, update_mask: update_mask }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + client.update_issue_comment(::Google::Cloud::SecureSourceManager::V1::UpdateIssueCommentRequest.new(issue_comment: issue_comment, update_mask: update_mask), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, update_issue_comment_client_stub.call_count + end + end + end + + def test_delete_issue_comment + # 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" + + delete_issue_comment_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| + assert options.metadata.key? :"x-goog-api-client" + assert options.metadata[:"x-goog-api-client"].include? "rest" + refute options.metadata[:"x-goog-api-client"].include? "grpc" + end + + ::Google::Cloud::SecureSourceManager::V1::SecureSourceManager::Rest::ServiceStub.stub :transcode_delete_issue_comment_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, delete_issue_comment_client_stub do + # Create client + client = ::Google::Cloud::SecureSourceManager::V1::SecureSourceManager::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.delete_issue_comment({ name: name }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.delete_issue_comment name: name do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.delete_issue_comment ::Google::Cloud::SecureSourceManager::V1::DeleteIssueCommentRequest.new(name: name) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + client.delete_issue_comment({ name: name }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + client.delete_issue_comment(::Google::Cloud::SecureSourceManager::V1::DeleteIssueCommentRequest.new(name: name), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, delete_issue_comment_client_stub.call_count + end + end + end + + def test_configure + credentials_token = :dummy_value + + client = block_config = config = nil + dummy_stub = ClientStub.new nil + Gapic::Rest::ClientStub.stub :new, dummy_stub do + client = ::Google::Cloud::SecureSourceManager::V1::SecureSourceManager::Rest::Client.new do |config| + config.credentials = credentials_token + end + end + + config = client.configure do |c| + block_config = c + end + + assert_same block_config, config + assert_kind_of ::Google::Cloud::SecureSourceManager::V1::SecureSourceManager::Rest::Client::Configuration, config + end +end diff --git a/owl-bot-staging/google-cloud-secure_source_manager-v1/test/google/cloud/secure_source_manager/v1/secure_source_manager_test.rb b/owl-bot-staging/google-cloud-secure_source_manager-v1/test/google/cloud/secure_source_manager/v1/secure_source_manager_test.rb new file mode 100644 index 000000000000..af65a5393465 --- /dev/null +++ b/owl-bot-staging/google-cloud-secure_source_manager-v1/test/google/cloud/secure_source_manager/v1/secure_source_manager_test.rb @@ -0,0 +1,3464 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +require "helper" + +require "gapic/grpc/service_stub" + +require "google/cloud/securesourcemanager/v1/secure_source_manager_pb" +require "google/cloud/secure_source_manager/v1/secure_source_manager" + +class ::Google::Cloud::SecureSourceManager::V1::SecureSourceManager::ClientTest < Minitest::Test + class ClientStub + attr_accessor :call_rpc_count, :requests + + def initialize response, operation, &block + @response = response + @operation = operation + @block = block + @call_rpc_count = 0 + @requests = [] + end + + def call_rpc *args, **kwargs + @call_rpc_count += 1 + + @requests << @block&.call(*args, **kwargs) + + catch :response do + yield @response, @operation if block_given? + @response + end + end + + def endpoint + "endpoint.example.com" + end + + def universe_domain + "example.com" + end + + def stub_logger + nil + end + + def logger + nil + end + end + + def test_list_instances + # Create GRPC objects. + grpc_response = ::Google::Cloud::SecureSourceManager::V1::ListInstancesResponse.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" + order_by = "hello world" + + list_instances_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :list_instances, name + assert_kind_of ::Google::Cloud::SecureSourceManager::V1::ListInstancesRequest, 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"] + assert_equal "hello world", request["order_by"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, list_instances_client_stub do + # Create client + client = ::Google::Cloud::SecureSourceManager::V1::SecureSourceManager::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.list_instances({ parent: parent, page_size: page_size, page_token: page_token, filter: filter, order_by: order_by }) 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_instances parent: parent, page_size: page_size, page_token: page_token, filter: filter, order_by: order_by 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_instances ::Google::Cloud::SecureSourceManager::V1::ListInstancesRequest.new(parent: parent, page_size: page_size, page_token: page_token, filter: filter, order_by: order_by) 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_instances({ parent: parent, page_size: page_size, page_token: page_token, filter: filter, order_by: order_by }, 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_instances(::Google::Cloud::SecureSourceManager::V1::ListInstancesRequest.new(parent: parent, page_size: page_size, page_token: page_token, filter: filter, order_by: order_by), 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_instances_client_stub.call_rpc_count + end + end + + def test_get_instance + # Create GRPC objects. + grpc_response = ::Google::Cloud::SecureSourceManager::V1::Instance.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_instance_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :get_instance, name + assert_kind_of ::Google::Cloud::SecureSourceManager::V1::GetInstanceRequest, request + assert_equal "hello world", request["name"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, get_instance_client_stub do + # Create client + client = ::Google::Cloud::SecureSourceManager::V1::SecureSourceManager::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.get_instance({ name: name }) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use named arguments + client.get_instance name: name do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.get_instance ::Google::Cloud::SecureSourceManager::V1::GetInstanceRequest.new(name: name) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use hash object with options + client.get_instance({ 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_instance(::Google::Cloud::SecureSourceManager::V1::GetInstanceRequest.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_instance_client_stub.call_rpc_count + end + end + + def test_create_instance + # 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" + instance_id = "hello world" + instance = {} + request_id = "hello world" + + create_instance_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :create_instance, name + assert_kind_of ::Google::Cloud::SecureSourceManager::V1::CreateInstanceRequest, request + assert_equal "hello world", request["parent"] + assert_equal "hello world", request["instance_id"] + assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::SecureSourceManager::V1::Instance), request["instance"] + assert_equal "hello world", request["request_id"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, create_instance_client_stub do + # Create client + client = ::Google::Cloud::SecureSourceManager::V1::SecureSourceManager::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.create_instance({ parent: parent, instance_id: instance_id, instance: instance, request_id: request_id }) do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Use named arguments + client.create_instance parent: parent, instance_id: instance_id, instance: instance, request_id: request_id do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.create_instance ::Google::Cloud::SecureSourceManager::V1::CreateInstanceRequest.new(parent: parent, instance_id: instance_id, instance: instance, request_id: request_id) do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Use hash object with options + client.create_instance({ parent: parent, instance_id: instance_id, instance: instance, request_id: request_id }, grpc_options) do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Use protobuf object with options + client.create_instance(::Google::Cloud::SecureSourceManager::V1::CreateInstanceRequest.new(parent: parent, instance_id: instance_id, instance: instance, request_id: request_id), grpc_options) do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Verify method calls + assert_equal 5, create_instance_client_stub.call_rpc_count + end + end + + def test_delete_instance + # 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" + request_id = "hello world" + + delete_instance_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :delete_instance, name + assert_kind_of ::Google::Cloud::SecureSourceManager::V1::DeleteInstanceRequest, request + assert_equal "hello world", request["name"] + assert_equal "hello world", request["request_id"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, delete_instance_client_stub do + # Create client + client = ::Google::Cloud::SecureSourceManager::V1::SecureSourceManager::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.delete_instance({ name: name, request_id: request_id }) do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Use named arguments + client.delete_instance name: name, request_id: request_id do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.delete_instance ::Google::Cloud::SecureSourceManager::V1::DeleteInstanceRequest.new(name: name, request_id: request_id) do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Use hash object with options + client.delete_instance({ name: name, request_id: request_id }, grpc_options) do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Use protobuf object with options + client.delete_instance(::Google::Cloud::SecureSourceManager::V1::DeleteInstanceRequest.new(name: name, request_id: request_id), grpc_options) do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Verify method calls + assert_equal 5, delete_instance_client_stub.call_rpc_count + end + end + + def test_list_repositories + # Create GRPC objects. + grpc_response = ::Google::Cloud::SecureSourceManager::V1::ListRepositoriesResponse.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" + instance = "hello world" + + list_repositories_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :list_repositories, name + assert_kind_of ::Google::Cloud::SecureSourceManager::V1::ListRepositoriesRequest, 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"] + assert_equal "hello world", request["instance"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, list_repositories_client_stub do + # Create client + client = ::Google::Cloud::SecureSourceManager::V1::SecureSourceManager::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.list_repositories({ parent: parent, page_size: page_size, page_token: page_token, filter: filter, instance: instance }) 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_repositories parent: parent, page_size: page_size, page_token: page_token, filter: filter, instance: instance 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_repositories ::Google::Cloud::SecureSourceManager::V1::ListRepositoriesRequest.new(parent: parent, page_size: page_size, page_token: page_token, filter: filter, instance: instance) 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_repositories({ parent: parent, page_size: page_size, page_token: page_token, filter: filter, instance: instance }, 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_repositories(::Google::Cloud::SecureSourceManager::V1::ListRepositoriesRequest.new(parent: parent, page_size: page_size, page_token: page_token, filter: filter, instance: instance), 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_repositories_client_stub.call_rpc_count + end + end + + def test_get_repository + # Create GRPC objects. + grpc_response = ::Google::Cloud::SecureSourceManager::V1::Repository.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_repository_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :get_repository, name + assert_kind_of ::Google::Cloud::SecureSourceManager::V1::GetRepositoryRequest, request + assert_equal "hello world", request["name"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, get_repository_client_stub do + # Create client + client = ::Google::Cloud::SecureSourceManager::V1::SecureSourceManager::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.get_repository({ name: name }) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use named arguments + client.get_repository name: name do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.get_repository ::Google::Cloud::SecureSourceManager::V1::GetRepositoryRequest.new(name: name) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use hash object with options + client.get_repository({ 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_repository(::Google::Cloud::SecureSourceManager::V1::GetRepositoryRequest.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_repository_client_stub.call_rpc_count + end + end + + def test_create_repository + # 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" + repository = {} + repository_id = "hello world" + + create_repository_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :create_repository, name + assert_kind_of ::Google::Cloud::SecureSourceManager::V1::CreateRepositoryRequest, request + assert_equal "hello world", request["parent"] + assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::SecureSourceManager::V1::Repository), request["repository"] + assert_equal "hello world", request["repository_id"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, create_repository_client_stub do + # Create client + client = ::Google::Cloud::SecureSourceManager::V1::SecureSourceManager::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.create_repository({ parent: parent, repository: repository, repository_id: repository_id }) do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Use named arguments + client.create_repository parent: parent, repository: repository, repository_id: repository_id do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.create_repository ::Google::Cloud::SecureSourceManager::V1::CreateRepositoryRequest.new(parent: parent, repository: repository, repository_id: repository_id) do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Use hash object with options + client.create_repository({ parent: parent, repository: repository, repository_id: repository_id }, grpc_options) do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Use protobuf object with options + client.create_repository(::Google::Cloud::SecureSourceManager::V1::CreateRepositoryRequest.new(parent: parent, repository: repository, repository_id: repository_id), grpc_options) do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Verify method calls + assert_equal 5, create_repository_client_stub.call_rpc_count + end + end + + def test_update_repository + # 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. + update_mask = {} + repository = {} + validate_only = true + + update_repository_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :update_repository, name + assert_kind_of ::Google::Cloud::SecureSourceManager::V1::UpdateRepositoryRequest, request + assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Protobuf::FieldMask), request["update_mask"] + assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::SecureSourceManager::V1::Repository), request["repository"] + assert_equal true, request["validate_only"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, update_repository_client_stub do + # Create client + client = ::Google::Cloud::SecureSourceManager::V1::SecureSourceManager::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.update_repository({ update_mask: update_mask, repository: repository, 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_repository update_mask: update_mask, repository: repository, 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_repository ::Google::Cloud::SecureSourceManager::V1::UpdateRepositoryRequest.new(update_mask: update_mask, repository: repository, 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_repository({ update_mask: update_mask, repository: repository, 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_repository(::Google::Cloud::SecureSourceManager::V1::UpdateRepositoryRequest.new(update_mask: update_mask, repository: repository, 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_repository_client_stub.call_rpc_count + end + end + + def test_delete_repository + # 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" + allow_missing = true + + delete_repository_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :delete_repository, name + assert_kind_of ::Google::Cloud::SecureSourceManager::V1::DeleteRepositoryRequest, request + assert_equal "hello world", request["name"] + assert_equal true, request["allow_missing"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, delete_repository_client_stub do + # Create client + client = ::Google::Cloud::SecureSourceManager::V1::SecureSourceManager::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.delete_repository({ name: name, allow_missing: allow_missing }) 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_repository name: name, allow_missing: allow_missing 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_repository ::Google::Cloud::SecureSourceManager::V1::DeleteRepositoryRequest.new(name: name, allow_missing: allow_missing) 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_repository({ name: name, allow_missing: allow_missing }, 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_repository(::Google::Cloud::SecureSourceManager::V1::DeleteRepositoryRequest.new(name: name, allow_missing: allow_missing), 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_repository_client_stub.call_rpc_count + end + end + + def test_list_hooks + # Create GRPC objects. + grpc_response = ::Google::Cloud::SecureSourceManager::V1::ListHooksResponse.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_hooks_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :list_hooks, name + assert_kind_of ::Google::Cloud::SecureSourceManager::V1::ListHooksRequest, 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_hooks_client_stub do + # Create client + client = ::Google::Cloud::SecureSourceManager::V1::SecureSourceManager::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.list_hooks({ 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_hooks 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_hooks ::Google::Cloud::SecureSourceManager::V1::ListHooksRequest.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_hooks({ 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_hooks(::Google::Cloud::SecureSourceManager::V1::ListHooksRequest.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_hooks_client_stub.call_rpc_count + end + end + + def test_get_hook + # Create GRPC objects. + grpc_response = ::Google::Cloud::SecureSourceManager::V1::Hook.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_hook_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :get_hook, name + assert_kind_of ::Google::Cloud::SecureSourceManager::V1::GetHookRequest, request + assert_equal "hello world", request["name"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, get_hook_client_stub do + # Create client + client = ::Google::Cloud::SecureSourceManager::V1::SecureSourceManager::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.get_hook({ name: name }) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use named arguments + client.get_hook name: name do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.get_hook ::Google::Cloud::SecureSourceManager::V1::GetHookRequest.new(name: name) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use hash object with options + client.get_hook({ 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_hook(::Google::Cloud::SecureSourceManager::V1::GetHookRequest.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_hook_client_stub.call_rpc_count + end + end + + def test_create_hook + # 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" + hook = {} + hook_id = "hello world" + + create_hook_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :create_hook, name + assert_kind_of ::Google::Cloud::SecureSourceManager::V1::CreateHookRequest, request + assert_equal "hello world", request["parent"] + assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::SecureSourceManager::V1::Hook), request["hook"] + assert_equal "hello world", request["hook_id"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, create_hook_client_stub do + # Create client + client = ::Google::Cloud::SecureSourceManager::V1::SecureSourceManager::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.create_hook({ parent: parent, hook: hook, hook_id: hook_id }) do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Use named arguments + client.create_hook parent: parent, hook: hook, hook_id: hook_id do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.create_hook ::Google::Cloud::SecureSourceManager::V1::CreateHookRequest.new(parent: parent, hook: hook, hook_id: hook_id) do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Use hash object with options + client.create_hook({ parent: parent, hook: hook, hook_id: hook_id }, grpc_options) do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Use protobuf object with options + client.create_hook(::Google::Cloud::SecureSourceManager::V1::CreateHookRequest.new(parent: parent, hook: hook, hook_id: hook_id), grpc_options) do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Verify method calls + assert_equal 5, create_hook_client_stub.call_rpc_count + end + end + + def test_update_hook + # 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. + update_mask = {} + hook = {} + + update_hook_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :update_hook, name + assert_kind_of ::Google::Cloud::SecureSourceManager::V1::UpdateHookRequest, request + assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Protobuf::FieldMask), request["update_mask"] + assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::SecureSourceManager::V1::Hook), request["hook"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, update_hook_client_stub do + # Create client + client = ::Google::Cloud::SecureSourceManager::V1::SecureSourceManager::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.update_hook({ update_mask: update_mask, hook: hook }) 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_hook update_mask: update_mask, hook: hook 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_hook ::Google::Cloud::SecureSourceManager::V1::UpdateHookRequest.new(update_mask: update_mask, hook: hook) 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_hook({ update_mask: update_mask, hook: hook }, 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_hook(::Google::Cloud::SecureSourceManager::V1::UpdateHookRequest.new(update_mask: update_mask, hook: hook), 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_hook_client_stub.call_rpc_count + end + end + + def test_delete_hook + # 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" + + delete_hook_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :delete_hook, name + assert_kind_of ::Google::Cloud::SecureSourceManager::V1::DeleteHookRequest, request + assert_equal "hello world", request["name"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, delete_hook_client_stub do + # Create client + client = ::Google::Cloud::SecureSourceManager::V1::SecureSourceManager::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.delete_hook({ 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.delete_hook 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.delete_hook ::Google::Cloud::SecureSourceManager::V1::DeleteHookRequest.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.delete_hook({ 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.delete_hook(::Google::Cloud::SecureSourceManager::V1::DeleteHookRequest.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, delete_hook_client_stub.call_rpc_count + end + end + + def test_get_iam_policy_repo + # Create GRPC objects. + grpc_response = ::Google::Iam::V1::Policy.new + grpc_operation = GRPC::ActiveCall::Operation.new nil + grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + grpc_options = {} + + # Create request parameters for a unary method. + resource = "hello world" + options = {} + + get_iam_policy_repo_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :get_iam_policy_repo, name + assert_kind_of ::Google::Iam::V1::GetIamPolicyRequest, request + assert_equal "hello world", request["resource"] + assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Iam::V1::GetPolicyOptions), request["options"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, get_iam_policy_repo_client_stub do + # Create client + client = ::Google::Cloud::SecureSourceManager::V1::SecureSourceManager::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.get_iam_policy_repo({ resource: resource, options: options }) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use named arguments + client.get_iam_policy_repo resource: resource, options: options do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.get_iam_policy_repo ::Google::Iam::V1::GetIamPolicyRequest.new(resource: resource, options: options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use hash object with options + client.get_iam_policy_repo({ resource: resource, options: options }, grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object with options + client.get_iam_policy_repo(::Google::Iam::V1::GetIamPolicyRequest.new(resource: resource, options: options), grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Verify method calls + assert_equal 5, get_iam_policy_repo_client_stub.call_rpc_count + end + end + + def test_set_iam_policy_repo + # Create GRPC objects. + grpc_response = ::Google::Iam::V1::Policy.new + grpc_operation = GRPC::ActiveCall::Operation.new nil + grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + grpc_options = {} + + # Create request parameters for a unary method. + resource = "hello world" + policy = {} + update_mask = {} + + set_iam_policy_repo_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :set_iam_policy_repo, name + assert_kind_of ::Google::Iam::V1::SetIamPolicyRequest, request + assert_equal "hello world", request["resource"] + assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Iam::V1::Policy), request["policy"] + assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Protobuf::FieldMask), request["update_mask"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, set_iam_policy_repo_client_stub do + # Create client + client = ::Google::Cloud::SecureSourceManager::V1::SecureSourceManager::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.set_iam_policy_repo({ resource: resource, policy: policy, update_mask: update_mask }) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use named arguments + client.set_iam_policy_repo resource: resource, policy: policy, update_mask: update_mask do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.set_iam_policy_repo ::Google::Iam::V1::SetIamPolicyRequest.new(resource: resource, policy: policy, update_mask: update_mask) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use hash object with options + client.set_iam_policy_repo({ resource: resource, policy: policy, update_mask: update_mask }, grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object with options + client.set_iam_policy_repo(::Google::Iam::V1::SetIamPolicyRequest.new(resource: resource, policy: policy, update_mask: update_mask), grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Verify method calls + assert_equal 5, set_iam_policy_repo_client_stub.call_rpc_count + end + end + + def test_test_iam_permissions_repo + # Create GRPC objects. + grpc_response = ::Google::Iam::V1::TestIamPermissionsResponse.new + grpc_operation = GRPC::ActiveCall::Operation.new nil + grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + grpc_options = {} + + # Create request parameters for a unary method. + resource = "hello world" + permissions = ["hello world"] + + test_iam_permissions_repo_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :test_iam_permissions_repo, name + assert_kind_of ::Google::Iam::V1::TestIamPermissionsRequest, request + assert_equal "hello world", request["resource"] + assert_equal ["hello world"], request["permissions"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, test_iam_permissions_repo_client_stub do + # Create client + client = ::Google::Cloud::SecureSourceManager::V1::SecureSourceManager::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.test_iam_permissions_repo({ resource: resource, permissions: permissions }) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use named arguments + client.test_iam_permissions_repo resource: resource, permissions: permissions do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.test_iam_permissions_repo ::Google::Iam::V1::TestIamPermissionsRequest.new(resource: resource, permissions: permissions) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use hash object with options + client.test_iam_permissions_repo({ resource: resource, permissions: permissions }, grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object with options + client.test_iam_permissions_repo(::Google::Iam::V1::TestIamPermissionsRequest.new(resource: resource, permissions: permissions), grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Verify method calls + assert_equal 5, test_iam_permissions_repo_client_stub.call_rpc_count + end + end + + def test_create_branch_rule + # 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" + branch_rule = {} + branch_rule_id = "hello world" + + create_branch_rule_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :create_branch_rule, name + assert_kind_of ::Google::Cloud::SecureSourceManager::V1::CreateBranchRuleRequest, request + assert_equal "hello world", request["parent"] + assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::SecureSourceManager::V1::BranchRule), request["branch_rule"] + assert_equal "hello world", request["branch_rule_id"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, create_branch_rule_client_stub do + # Create client + client = ::Google::Cloud::SecureSourceManager::V1::SecureSourceManager::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.create_branch_rule({ parent: parent, branch_rule: branch_rule, branch_rule_id: branch_rule_id }) do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Use named arguments + client.create_branch_rule parent: parent, branch_rule: branch_rule, branch_rule_id: branch_rule_id do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.create_branch_rule ::Google::Cloud::SecureSourceManager::V1::CreateBranchRuleRequest.new(parent: parent, branch_rule: branch_rule, branch_rule_id: branch_rule_id) do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Use hash object with options + client.create_branch_rule({ parent: parent, branch_rule: branch_rule, branch_rule_id: branch_rule_id }, grpc_options) do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Use protobuf object with options + client.create_branch_rule(::Google::Cloud::SecureSourceManager::V1::CreateBranchRuleRequest.new(parent: parent, branch_rule: branch_rule, branch_rule_id: branch_rule_id), grpc_options) do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Verify method calls + assert_equal 5, create_branch_rule_client_stub.call_rpc_count + end + end + + def test_list_branch_rules + # Create GRPC objects. + grpc_response = ::Google::Cloud::SecureSourceManager::V1::ListBranchRulesResponse.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_branch_rules_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :list_branch_rules, name + assert_kind_of ::Google::Cloud::SecureSourceManager::V1::ListBranchRulesRequest, 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_branch_rules_client_stub do + # Create client + client = ::Google::Cloud::SecureSourceManager::V1::SecureSourceManager::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.list_branch_rules({ 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_branch_rules 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_branch_rules ::Google::Cloud::SecureSourceManager::V1::ListBranchRulesRequest.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_branch_rules({ 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_branch_rules(::Google::Cloud::SecureSourceManager::V1::ListBranchRulesRequest.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_branch_rules_client_stub.call_rpc_count + end + end + + def test_get_branch_rule + # Create GRPC objects. + grpc_response = ::Google::Cloud::SecureSourceManager::V1::BranchRule.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_branch_rule_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :get_branch_rule, name + assert_kind_of ::Google::Cloud::SecureSourceManager::V1::GetBranchRuleRequest, request + assert_equal "hello world", request["name"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, get_branch_rule_client_stub do + # Create client + client = ::Google::Cloud::SecureSourceManager::V1::SecureSourceManager::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.get_branch_rule({ name: name }) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use named arguments + client.get_branch_rule name: name do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.get_branch_rule ::Google::Cloud::SecureSourceManager::V1::GetBranchRuleRequest.new(name: name) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use hash object with options + client.get_branch_rule({ 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_branch_rule(::Google::Cloud::SecureSourceManager::V1::GetBranchRuleRequest.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_branch_rule_client_stub.call_rpc_count + end + end + + def test_update_branch_rule + # 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. + branch_rule = {} + validate_only = true + update_mask = {} + + update_branch_rule_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :update_branch_rule, name + assert_kind_of ::Google::Cloud::SecureSourceManager::V1::UpdateBranchRuleRequest, request + assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::SecureSourceManager::V1::BranchRule), request["branch_rule"] + 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_branch_rule_client_stub do + # Create client + client = ::Google::Cloud::SecureSourceManager::V1::SecureSourceManager::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.update_branch_rule({ branch_rule: branch_rule, 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_branch_rule branch_rule: branch_rule, 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_branch_rule ::Google::Cloud::SecureSourceManager::V1::UpdateBranchRuleRequest.new(branch_rule: branch_rule, 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_branch_rule({ branch_rule: branch_rule, 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_branch_rule(::Google::Cloud::SecureSourceManager::V1::UpdateBranchRuleRequest.new(branch_rule: branch_rule, 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_branch_rule_client_stub.call_rpc_count + end + end + + def test_delete_branch_rule + # 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" + allow_missing = true + + delete_branch_rule_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :delete_branch_rule, name + assert_kind_of ::Google::Cloud::SecureSourceManager::V1::DeleteBranchRuleRequest, request + assert_equal "hello world", request["name"] + assert_equal true, request["allow_missing"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, delete_branch_rule_client_stub do + # Create client + client = ::Google::Cloud::SecureSourceManager::V1::SecureSourceManager::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.delete_branch_rule({ name: name, allow_missing: allow_missing }) 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_branch_rule name: name, allow_missing: allow_missing 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_branch_rule ::Google::Cloud::SecureSourceManager::V1::DeleteBranchRuleRequest.new(name: name, allow_missing: allow_missing) 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_branch_rule({ name: name, allow_missing: allow_missing }, 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_branch_rule(::Google::Cloud::SecureSourceManager::V1::DeleteBranchRuleRequest.new(name: name, allow_missing: allow_missing), 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_branch_rule_client_stub.call_rpc_count + end + end + + def test_create_pull_request + # 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" + pull_request = {} + + create_pull_request_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :create_pull_request, name + assert_kind_of ::Google::Cloud::SecureSourceManager::V1::CreatePullRequestRequest, request + assert_equal "hello world", request["parent"] + assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::SecureSourceManager::V1::PullRequest), request["pull_request"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, create_pull_request_client_stub do + # Create client + client = ::Google::Cloud::SecureSourceManager::V1::SecureSourceManager::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.create_pull_request({ parent: parent, pull_request: pull_request }) 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_pull_request parent: parent, pull_request: pull_request 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_pull_request ::Google::Cloud::SecureSourceManager::V1::CreatePullRequestRequest.new(parent: parent, pull_request: pull_request) 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_pull_request({ parent: parent, pull_request: pull_request }, 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_pull_request(::Google::Cloud::SecureSourceManager::V1::CreatePullRequestRequest.new(parent: parent, pull_request: pull_request), 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_pull_request_client_stub.call_rpc_count + end + end + + def test_get_pull_request + # Create GRPC objects. + grpc_response = ::Google::Cloud::SecureSourceManager::V1::PullRequest.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_pull_request_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :get_pull_request, name + assert_kind_of ::Google::Cloud::SecureSourceManager::V1::GetPullRequestRequest, request + assert_equal "hello world", request["name"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, get_pull_request_client_stub do + # Create client + client = ::Google::Cloud::SecureSourceManager::V1::SecureSourceManager::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.get_pull_request({ name: name }) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use named arguments + client.get_pull_request name: name do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.get_pull_request ::Google::Cloud::SecureSourceManager::V1::GetPullRequestRequest.new(name: name) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use hash object with options + client.get_pull_request({ 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_pull_request(::Google::Cloud::SecureSourceManager::V1::GetPullRequestRequest.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_pull_request_client_stub.call_rpc_count + end + end + + def test_list_pull_requests + # Create GRPC objects. + grpc_response = ::Google::Cloud::SecureSourceManager::V1::ListPullRequestsResponse.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_pull_requests_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :list_pull_requests, name + assert_kind_of ::Google::Cloud::SecureSourceManager::V1::ListPullRequestsRequest, 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_pull_requests_client_stub do + # Create client + client = ::Google::Cloud::SecureSourceManager::V1::SecureSourceManager::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.list_pull_requests({ 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_pull_requests 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_pull_requests ::Google::Cloud::SecureSourceManager::V1::ListPullRequestsRequest.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_pull_requests({ 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_pull_requests(::Google::Cloud::SecureSourceManager::V1::ListPullRequestsRequest.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_pull_requests_client_stub.call_rpc_count + end + end + + def test_update_pull_request + # 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. + pull_request = {} + update_mask = {} + + update_pull_request_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :update_pull_request, name + assert_kind_of ::Google::Cloud::SecureSourceManager::V1::UpdatePullRequestRequest, request + assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::SecureSourceManager::V1::PullRequest), request["pull_request"] + assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Protobuf::FieldMask), request["update_mask"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, update_pull_request_client_stub do + # Create client + client = ::Google::Cloud::SecureSourceManager::V1::SecureSourceManager::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.update_pull_request({ pull_request: pull_request, 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_pull_request pull_request: pull_request, 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_pull_request ::Google::Cloud::SecureSourceManager::V1::UpdatePullRequestRequest.new(pull_request: pull_request, 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_pull_request({ pull_request: pull_request, 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_pull_request(::Google::Cloud::SecureSourceManager::V1::UpdatePullRequestRequest.new(pull_request: pull_request, 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_pull_request_client_stub.call_rpc_count + end + end + + def test_merge_pull_request + # 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" + + merge_pull_request_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :merge_pull_request, name + assert_kind_of ::Google::Cloud::SecureSourceManager::V1::MergePullRequestRequest, request + assert_equal "hello world", request["name"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, merge_pull_request_client_stub do + # Create client + client = ::Google::Cloud::SecureSourceManager::V1::SecureSourceManager::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.merge_pull_request({ 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.merge_pull_request 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.merge_pull_request ::Google::Cloud::SecureSourceManager::V1::MergePullRequestRequest.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.merge_pull_request({ 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.merge_pull_request(::Google::Cloud::SecureSourceManager::V1::MergePullRequestRequest.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, merge_pull_request_client_stub.call_rpc_count + end + end + + def test_open_pull_request + # 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" + + open_pull_request_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :open_pull_request, name + assert_kind_of ::Google::Cloud::SecureSourceManager::V1::OpenPullRequestRequest, request + assert_equal "hello world", request["name"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, open_pull_request_client_stub do + # Create client + client = ::Google::Cloud::SecureSourceManager::V1::SecureSourceManager::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.open_pull_request({ 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.open_pull_request 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.open_pull_request ::Google::Cloud::SecureSourceManager::V1::OpenPullRequestRequest.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.open_pull_request({ 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.open_pull_request(::Google::Cloud::SecureSourceManager::V1::OpenPullRequestRequest.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, open_pull_request_client_stub.call_rpc_count + end + end + + def test_close_pull_request + # 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" + + close_pull_request_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :close_pull_request, name + assert_kind_of ::Google::Cloud::SecureSourceManager::V1::ClosePullRequestRequest, request + assert_equal "hello world", request["name"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, close_pull_request_client_stub do + # Create client + client = ::Google::Cloud::SecureSourceManager::V1::SecureSourceManager::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.close_pull_request({ 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.close_pull_request 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.close_pull_request ::Google::Cloud::SecureSourceManager::V1::ClosePullRequestRequest.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.close_pull_request({ 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.close_pull_request(::Google::Cloud::SecureSourceManager::V1::ClosePullRequestRequest.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, close_pull_request_client_stub.call_rpc_count + end + end + + def test_list_pull_request_file_diffs + # Create GRPC objects. + grpc_response = ::Google::Cloud::SecureSourceManager::V1::ListPullRequestFileDiffsResponse.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" + + list_pull_request_file_diffs_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :list_pull_request_file_diffs, name + assert_kind_of ::Google::Cloud::SecureSourceManager::V1::ListPullRequestFileDiffsRequest, 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, list_pull_request_file_diffs_client_stub do + # Create client + client = ::Google::Cloud::SecureSourceManager::V1::SecureSourceManager::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.list_pull_request_file_diffs({ 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.list_pull_request_file_diffs 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.list_pull_request_file_diffs ::Google::Cloud::SecureSourceManager::V1::ListPullRequestFileDiffsRequest.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.list_pull_request_file_diffs({ 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.list_pull_request_file_diffs(::Google::Cloud::SecureSourceManager::V1::ListPullRequestFileDiffsRequest.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, list_pull_request_file_diffs_client_stub.call_rpc_count + end + end + + def test_fetch_tree + # Create GRPC objects. + grpc_response = ::Google::Cloud::SecureSourceManager::V1::FetchTreeResponse.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. + repository = "hello world" + ref = "hello world" + recursive = true + page_size = 42 + page_token = "hello world" + + fetch_tree_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :fetch_tree, name + assert_kind_of ::Google::Cloud::SecureSourceManager::V1::FetchTreeRequest, request + assert_equal "hello world", request["repository"] + assert_equal "hello world", request["ref"] + assert_equal true, request["recursive"] + assert_equal 42, request["page_size"] + assert_equal "hello world", request["page_token"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, fetch_tree_client_stub do + # Create client + client = ::Google::Cloud::SecureSourceManager::V1::SecureSourceManager::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.fetch_tree({ repository: repository, ref: ref, recursive: recursive, 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.fetch_tree repository: repository, ref: ref, recursive: recursive, 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.fetch_tree ::Google::Cloud::SecureSourceManager::V1::FetchTreeRequest.new(repository: repository, ref: ref, recursive: recursive, 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.fetch_tree({ repository: repository, ref: ref, recursive: recursive, 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.fetch_tree(::Google::Cloud::SecureSourceManager::V1::FetchTreeRequest.new(repository: repository, ref: ref, recursive: recursive, 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, fetch_tree_client_stub.call_rpc_count + end + end + + def test_fetch_blob + # Create GRPC objects. + grpc_response = ::Google::Cloud::SecureSourceManager::V1::FetchBlobResponse.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. + repository = "hello world" + sha = "hello world" + + fetch_blob_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :fetch_blob, name + assert_kind_of ::Google::Cloud::SecureSourceManager::V1::FetchBlobRequest, request + assert_equal "hello world", request["repository"] + assert_equal "hello world", request["sha"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, fetch_blob_client_stub do + # Create client + client = ::Google::Cloud::SecureSourceManager::V1::SecureSourceManager::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.fetch_blob({ repository: repository, sha: sha }) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use named arguments + client.fetch_blob repository: repository, sha: sha do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.fetch_blob ::Google::Cloud::SecureSourceManager::V1::FetchBlobRequest.new(repository: repository, sha: sha) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use hash object with options + client.fetch_blob({ repository: repository, sha: sha }, grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object with options + client.fetch_blob(::Google::Cloud::SecureSourceManager::V1::FetchBlobRequest.new(repository: repository, sha: sha), grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Verify method calls + assert_equal 5, fetch_blob_client_stub.call_rpc_count + end + end + + def test_create_issue + # 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" + issue = {} + + create_issue_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :create_issue, name + assert_kind_of ::Google::Cloud::SecureSourceManager::V1::CreateIssueRequest, request + assert_equal "hello world", request["parent"] + assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::SecureSourceManager::V1::Issue), request["issue"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, create_issue_client_stub do + # Create client + client = ::Google::Cloud::SecureSourceManager::V1::SecureSourceManager::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.create_issue({ parent: parent, issue: issue }) 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_issue parent: parent, issue: issue 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_issue ::Google::Cloud::SecureSourceManager::V1::CreateIssueRequest.new(parent: parent, issue: issue) 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_issue({ parent: parent, issue: issue }, 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_issue(::Google::Cloud::SecureSourceManager::V1::CreateIssueRequest.new(parent: parent, issue: issue), 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_issue_client_stub.call_rpc_count + end + end + + def test_get_issue + # Create GRPC objects. + grpc_response = ::Google::Cloud::SecureSourceManager::V1::Issue.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_issue_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :get_issue, name + assert_kind_of ::Google::Cloud::SecureSourceManager::V1::GetIssueRequest, request + assert_equal "hello world", request["name"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, get_issue_client_stub do + # Create client + client = ::Google::Cloud::SecureSourceManager::V1::SecureSourceManager::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.get_issue({ name: name }) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use named arguments + client.get_issue name: name do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.get_issue ::Google::Cloud::SecureSourceManager::V1::GetIssueRequest.new(name: name) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use hash object with options + client.get_issue({ 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_issue(::Google::Cloud::SecureSourceManager::V1::GetIssueRequest.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_issue_client_stub.call_rpc_count + end + end + + def test_list_issues + # Create GRPC objects. + grpc_response = ::Google::Cloud::SecureSourceManager::V1::ListIssuesResponse.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_issues_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :list_issues, name + assert_kind_of ::Google::Cloud::SecureSourceManager::V1::ListIssuesRequest, 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_issues_client_stub do + # Create client + client = ::Google::Cloud::SecureSourceManager::V1::SecureSourceManager::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.list_issues({ 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_issues 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_issues ::Google::Cloud::SecureSourceManager::V1::ListIssuesRequest.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_issues({ 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_issues(::Google::Cloud::SecureSourceManager::V1::ListIssuesRequest.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_issues_client_stub.call_rpc_count + end + end + + def test_update_issue + # 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. + issue = {} + update_mask = {} + + update_issue_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :update_issue, name + assert_kind_of ::Google::Cloud::SecureSourceManager::V1::UpdateIssueRequest, request + assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::SecureSourceManager::V1::Issue), request["issue"] + assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Protobuf::FieldMask), request["update_mask"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, update_issue_client_stub do + # Create client + client = ::Google::Cloud::SecureSourceManager::V1::SecureSourceManager::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.update_issue({ issue: issue, 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_issue issue: issue, 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_issue ::Google::Cloud::SecureSourceManager::V1::UpdateIssueRequest.new(issue: issue, 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_issue({ issue: issue, 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_issue(::Google::Cloud::SecureSourceManager::V1::UpdateIssueRequest.new(issue: issue, 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_issue_client_stub.call_rpc_count + end + end + + def test_delete_issue + # 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" + + delete_issue_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :delete_issue, name + assert_kind_of ::Google::Cloud::SecureSourceManager::V1::DeleteIssueRequest, request + assert_equal "hello world", request["name"] + assert_equal "hello world", request["etag"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, delete_issue_client_stub do + # Create client + client = ::Google::Cloud::SecureSourceManager::V1::SecureSourceManager::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.delete_issue({ name: name, etag: etag }) 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_issue name: name, etag: etag 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_issue ::Google::Cloud::SecureSourceManager::V1::DeleteIssueRequest.new(name: name, etag: etag) 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_issue({ name: name, etag: etag }, 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_issue(::Google::Cloud::SecureSourceManager::V1::DeleteIssueRequest.new(name: name, etag: etag), 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_issue_client_stub.call_rpc_count + end + end + + def test_open_issue + # 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" + + open_issue_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :open_issue, name + assert_kind_of ::Google::Cloud::SecureSourceManager::V1::OpenIssueRequest, request + assert_equal "hello world", request["name"] + assert_equal "hello world", request["etag"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, open_issue_client_stub do + # Create client + client = ::Google::Cloud::SecureSourceManager::V1::SecureSourceManager::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.open_issue({ name: name, etag: etag }) 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.open_issue name: name, etag: etag 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.open_issue ::Google::Cloud::SecureSourceManager::V1::OpenIssueRequest.new(name: name, etag: etag) 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.open_issue({ name: name, etag: etag }, 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.open_issue(::Google::Cloud::SecureSourceManager::V1::OpenIssueRequest.new(name: name, etag: etag), 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, open_issue_client_stub.call_rpc_count + end + end + + def test_close_issue + # 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" + + close_issue_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :close_issue, name + assert_kind_of ::Google::Cloud::SecureSourceManager::V1::CloseIssueRequest, request + assert_equal "hello world", request["name"] + assert_equal "hello world", request["etag"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, close_issue_client_stub do + # Create client + client = ::Google::Cloud::SecureSourceManager::V1::SecureSourceManager::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.close_issue({ name: name, etag: etag }) 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.close_issue name: name, etag: etag 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.close_issue ::Google::Cloud::SecureSourceManager::V1::CloseIssueRequest.new(name: name, etag: etag) 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.close_issue({ name: name, etag: etag }, 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.close_issue(::Google::Cloud::SecureSourceManager::V1::CloseIssueRequest.new(name: name, etag: etag), 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, close_issue_client_stub.call_rpc_count + end + end + + def test_get_pull_request_comment + # Create GRPC objects. + grpc_response = ::Google::Cloud::SecureSourceManager::V1::PullRequestComment.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_pull_request_comment_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :get_pull_request_comment, name + assert_kind_of ::Google::Cloud::SecureSourceManager::V1::GetPullRequestCommentRequest, request + assert_equal "hello world", request["name"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, get_pull_request_comment_client_stub do + # Create client + client = ::Google::Cloud::SecureSourceManager::V1::SecureSourceManager::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.get_pull_request_comment({ name: name }) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use named arguments + client.get_pull_request_comment name: name do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.get_pull_request_comment ::Google::Cloud::SecureSourceManager::V1::GetPullRequestCommentRequest.new(name: name) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use hash object with options + client.get_pull_request_comment({ 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_pull_request_comment(::Google::Cloud::SecureSourceManager::V1::GetPullRequestCommentRequest.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_pull_request_comment_client_stub.call_rpc_count + end + end + + def test_list_pull_request_comments + # Create GRPC objects. + grpc_response = ::Google::Cloud::SecureSourceManager::V1::ListPullRequestCommentsResponse.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_pull_request_comments_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :list_pull_request_comments, name + assert_kind_of ::Google::Cloud::SecureSourceManager::V1::ListPullRequestCommentsRequest, 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_pull_request_comments_client_stub do + # Create client + client = ::Google::Cloud::SecureSourceManager::V1::SecureSourceManager::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.list_pull_request_comments({ 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_pull_request_comments 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_pull_request_comments ::Google::Cloud::SecureSourceManager::V1::ListPullRequestCommentsRequest.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_pull_request_comments({ 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_pull_request_comments(::Google::Cloud::SecureSourceManager::V1::ListPullRequestCommentsRequest.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_pull_request_comments_client_stub.call_rpc_count + end + end + + def test_create_pull_request_comment + # 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" + pull_request_comment = {} + + create_pull_request_comment_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :create_pull_request_comment, name + assert_kind_of ::Google::Cloud::SecureSourceManager::V1::CreatePullRequestCommentRequest, request + assert_equal "hello world", request["parent"] + assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::SecureSourceManager::V1::PullRequestComment), request["pull_request_comment"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, create_pull_request_comment_client_stub do + # Create client + client = ::Google::Cloud::SecureSourceManager::V1::SecureSourceManager::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.create_pull_request_comment({ parent: parent, pull_request_comment: pull_request_comment }) 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_pull_request_comment parent: parent, pull_request_comment: pull_request_comment 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_pull_request_comment ::Google::Cloud::SecureSourceManager::V1::CreatePullRequestCommentRequest.new(parent: parent, pull_request_comment: pull_request_comment) 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_pull_request_comment({ parent: parent, pull_request_comment: pull_request_comment }, 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_pull_request_comment(::Google::Cloud::SecureSourceManager::V1::CreatePullRequestCommentRequest.new(parent: parent, pull_request_comment: pull_request_comment), 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_pull_request_comment_client_stub.call_rpc_count + end + end + + def test_update_pull_request_comment + # 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. + pull_request_comment = {} + update_mask = {} + + update_pull_request_comment_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :update_pull_request_comment, name + assert_kind_of ::Google::Cloud::SecureSourceManager::V1::UpdatePullRequestCommentRequest, request + assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::SecureSourceManager::V1::PullRequestComment), request["pull_request_comment"] + assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Protobuf::FieldMask), request["update_mask"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, update_pull_request_comment_client_stub do + # Create client + client = ::Google::Cloud::SecureSourceManager::V1::SecureSourceManager::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.update_pull_request_comment({ pull_request_comment: pull_request_comment, 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_pull_request_comment pull_request_comment: pull_request_comment, 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_pull_request_comment ::Google::Cloud::SecureSourceManager::V1::UpdatePullRequestCommentRequest.new(pull_request_comment: pull_request_comment, 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_pull_request_comment({ pull_request_comment: pull_request_comment, 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_pull_request_comment(::Google::Cloud::SecureSourceManager::V1::UpdatePullRequestCommentRequest.new(pull_request_comment: pull_request_comment, 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_pull_request_comment_client_stub.call_rpc_count + end + end + + def test_delete_pull_request_comment + # 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" + + delete_pull_request_comment_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :delete_pull_request_comment, name + assert_kind_of ::Google::Cloud::SecureSourceManager::V1::DeletePullRequestCommentRequest, request + assert_equal "hello world", request["name"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, delete_pull_request_comment_client_stub do + # Create client + client = ::Google::Cloud::SecureSourceManager::V1::SecureSourceManager::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.delete_pull_request_comment({ 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.delete_pull_request_comment 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.delete_pull_request_comment ::Google::Cloud::SecureSourceManager::V1::DeletePullRequestCommentRequest.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.delete_pull_request_comment({ 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.delete_pull_request_comment(::Google::Cloud::SecureSourceManager::V1::DeletePullRequestCommentRequest.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, delete_pull_request_comment_client_stub.call_rpc_count + end + end + + def test_batch_create_pull_request_comments + # 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" + requests = [{}] + + batch_create_pull_request_comments_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :batch_create_pull_request_comments, name + assert_kind_of ::Google::Cloud::SecureSourceManager::V1::BatchCreatePullRequestCommentsRequest, request + assert_equal "hello world", request["parent"] + assert_kind_of ::Google::Cloud::SecureSourceManager::V1::CreatePullRequestCommentRequest, request["requests"].first + refute_nil options + end + + Gapic::ServiceStub.stub :new, batch_create_pull_request_comments_client_stub do + # Create client + client = ::Google::Cloud::SecureSourceManager::V1::SecureSourceManager::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.batch_create_pull_request_comments({ parent: parent, requests: requests }) 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.batch_create_pull_request_comments parent: parent, requests: requests 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.batch_create_pull_request_comments ::Google::Cloud::SecureSourceManager::V1::BatchCreatePullRequestCommentsRequest.new(parent: parent, requests: requests) 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.batch_create_pull_request_comments({ parent: parent, requests: requests }, 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.batch_create_pull_request_comments(::Google::Cloud::SecureSourceManager::V1::BatchCreatePullRequestCommentsRequest.new(parent: parent, requests: requests), 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, batch_create_pull_request_comments_client_stub.call_rpc_count + end + end + + def test_resolve_pull_request_comments + # 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" + names = ["hello world"] + auto_fill = true + + resolve_pull_request_comments_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :resolve_pull_request_comments, name + assert_kind_of ::Google::Cloud::SecureSourceManager::V1::ResolvePullRequestCommentsRequest, request + assert_equal "hello world", request["parent"] + assert_equal ["hello world"], request["names"] + assert_equal true, request["auto_fill"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, resolve_pull_request_comments_client_stub do + # Create client + client = ::Google::Cloud::SecureSourceManager::V1::SecureSourceManager::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.resolve_pull_request_comments({ parent: parent, names: names, auto_fill: auto_fill }) 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.resolve_pull_request_comments parent: parent, names: names, auto_fill: auto_fill 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.resolve_pull_request_comments ::Google::Cloud::SecureSourceManager::V1::ResolvePullRequestCommentsRequest.new(parent: parent, names: names, auto_fill: auto_fill) 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.resolve_pull_request_comments({ parent: parent, names: names, auto_fill: auto_fill }, 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.resolve_pull_request_comments(::Google::Cloud::SecureSourceManager::V1::ResolvePullRequestCommentsRequest.new(parent: parent, names: names, auto_fill: auto_fill), 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, resolve_pull_request_comments_client_stub.call_rpc_count + end + end + + def test_unresolve_pull_request_comments + # 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" + names = ["hello world"] + auto_fill = true + + unresolve_pull_request_comments_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :unresolve_pull_request_comments, name + assert_kind_of ::Google::Cloud::SecureSourceManager::V1::UnresolvePullRequestCommentsRequest, request + assert_equal "hello world", request["parent"] + assert_equal ["hello world"], request["names"] + assert_equal true, request["auto_fill"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, unresolve_pull_request_comments_client_stub do + # Create client + client = ::Google::Cloud::SecureSourceManager::V1::SecureSourceManager::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.unresolve_pull_request_comments({ parent: parent, names: names, auto_fill: auto_fill }) 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.unresolve_pull_request_comments parent: parent, names: names, auto_fill: auto_fill 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.unresolve_pull_request_comments ::Google::Cloud::SecureSourceManager::V1::UnresolvePullRequestCommentsRequest.new(parent: parent, names: names, auto_fill: auto_fill) 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.unresolve_pull_request_comments({ parent: parent, names: names, auto_fill: auto_fill }, 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.unresolve_pull_request_comments(::Google::Cloud::SecureSourceManager::V1::UnresolvePullRequestCommentsRequest.new(parent: parent, names: names, auto_fill: auto_fill), 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, unresolve_pull_request_comments_client_stub.call_rpc_count + end + end + + def test_create_issue_comment + # 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" + issue_comment = {} + + create_issue_comment_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :create_issue_comment, name + assert_kind_of ::Google::Cloud::SecureSourceManager::V1::CreateIssueCommentRequest, request + assert_equal "hello world", request["parent"] + assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::SecureSourceManager::V1::IssueComment), request["issue_comment"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, create_issue_comment_client_stub do + # Create client + client = ::Google::Cloud::SecureSourceManager::V1::SecureSourceManager::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.create_issue_comment({ parent: parent, issue_comment: issue_comment }) 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_issue_comment parent: parent, issue_comment: issue_comment 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_issue_comment ::Google::Cloud::SecureSourceManager::V1::CreateIssueCommentRequest.new(parent: parent, issue_comment: issue_comment) 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_issue_comment({ parent: parent, issue_comment: issue_comment }, 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_issue_comment(::Google::Cloud::SecureSourceManager::V1::CreateIssueCommentRequest.new(parent: parent, issue_comment: issue_comment), 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_issue_comment_client_stub.call_rpc_count + end + end + + def test_get_issue_comment + # Create GRPC objects. + grpc_response = ::Google::Cloud::SecureSourceManager::V1::IssueComment.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_issue_comment_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :get_issue_comment, name + assert_kind_of ::Google::Cloud::SecureSourceManager::V1::GetIssueCommentRequest, request + assert_equal "hello world", request["name"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, get_issue_comment_client_stub do + # Create client + client = ::Google::Cloud::SecureSourceManager::V1::SecureSourceManager::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.get_issue_comment({ name: name }) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use named arguments + client.get_issue_comment name: name do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.get_issue_comment ::Google::Cloud::SecureSourceManager::V1::GetIssueCommentRequest.new(name: name) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use hash object with options + client.get_issue_comment({ 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_issue_comment(::Google::Cloud::SecureSourceManager::V1::GetIssueCommentRequest.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_issue_comment_client_stub.call_rpc_count + end + end + + def test_list_issue_comments + # Create GRPC objects. + grpc_response = ::Google::Cloud::SecureSourceManager::V1::ListIssueCommentsResponse.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_issue_comments_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :list_issue_comments, name + assert_kind_of ::Google::Cloud::SecureSourceManager::V1::ListIssueCommentsRequest, 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_issue_comments_client_stub do + # Create client + client = ::Google::Cloud::SecureSourceManager::V1::SecureSourceManager::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.list_issue_comments({ 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_issue_comments 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_issue_comments ::Google::Cloud::SecureSourceManager::V1::ListIssueCommentsRequest.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_issue_comments({ 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_issue_comments(::Google::Cloud::SecureSourceManager::V1::ListIssueCommentsRequest.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_issue_comments_client_stub.call_rpc_count + end + end + + def test_update_issue_comment + # 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. + issue_comment = {} + update_mask = {} + + update_issue_comment_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :update_issue_comment, name + assert_kind_of ::Google::Cloud::SecureSourceManager::V1::UpdateIssueCommentRequest, request + assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::SecureSourceManager::V1::IssueComment), request["issue_comment"] + assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Protobuf::FieldMask), request["update_mask"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, update_issue_comment_client_stub do + # Create client + client = ::Google::Cloud::SecureSourceManager::V1::SecureSourceManager::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.update_issue_comment({ issue_comment: issue_comment, 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_issue_comment issue_comment: issue_comment, 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_issue_comment ::Google::Cloud::SecureSourceManager::V1::UpdateIssueCommentRequest.new(issue_comment: issue_comment, 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_issue_comment({ issue_comment: issue_comment, 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_issue_comment(::Google::Cloud::SecureSourceManager::V1::UpdateIssueCommentRequest.new(issue_comment: issue_comment, 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_issue_comment_client_stub.call_rpc_count + end + end + + def test_delete_issue_comment + # 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" + + delete_issue_comment_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :delete_issue_comment, name + assert_kind_of ::Google::Cloud::SecureSourceManager::V1::DeleteIssueCommentRequest, request + assert_equal "hello world", request["name"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, delete_issue_comment_client_stub do + # Create client + client = ::Google::Cloud::SecureSourceManager::V1::SecureSourceManager::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.delete_issue_comment({ 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.delete_issue_comment 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.delete_issue_comment ::Google::Cloud::SecureSourceManager::V1::DeleteIssueCommentRequest.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.delete_issue_comment({ 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.delete_issue_comment(::Google::Cloud::SecureSourceManager::V1::DeleteIssueCommentRequest.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, delete_issue_comment_client_stub.call_rpc_count + end + end + + def test_configure + grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + + client = block_config = config = nil + dummy_stub = ClientStub.new nil, nil + Gapic::ServiceStub.stub :new, dummy_stub do + client = ::Google::Cloud::SecureSourceManager::V1::SecureSourceManager::Client.new do |config| + config.credentials = grpc_channel + end + end + + config = client.configure do |c| + block_config = c + end + + assert_same block_config, config + assert_kind_of ::Google::Cloud::SecureSourceManager::V1::SecureSourceManager::Client::Configuration, config + end + + def test_credentials + key = OpenSSL::PKey::RSA.new 2048 + cred_json = { + "private_key" => key.to_pem, + "client_email" => "app@developer.gserviceaccount.com", + "type" => "service_account" + } + key_file = StringIO.new cred_json.to_json + creds = Google::Auth::ServiceAccountCredentials.make_creds({ json_key_io: key_file }) + + dummy_stub = ClientStub.new nil, nil + Gapic::ServiceStub.stub :new, dummy_stub do + client = ::Google::Cloud::SecureSourceManager::V1::SecureSourceManager::Client.new do |config| + config.credentials = creds + end + assert_kind_of ::Google::Cloud::SecureSourceManager::V1::SecureSourceManager::Client, client + assert_equal creds, client.configure.credentials + end + end + + def test_operations_client + grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + + client = nil + dummy_stub = ClientStub.new nil, nil + Gapic::ServiceStub.stub :new, dummy_stub do + client = ::Google::Cloud::SecureSourceManager::V1::SecureSourceManager::Client.new do |config| + config.credentials = grpc_channel + end + end + + assert_kind_of ::Google::Cloud::SecureSourceManager::V1::SecureSourceManager::Operations, client.operations_client + end +end diff --git a/owl-bot-staging/google-cloud-secure_source_manager-v1/test/helper.rb b/owl-bot-staging/google-cloud-secure_source_manager-v1/test/helper.rb new file mode 100644 index 000000000000..672b337030e7 --- /dev/null +++ b/owl-bot-staging/google-cloud-secure_source_manager-v1/test/helper.rb @@ -0,0 +1,26 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +require "minitest/autorun" +require "minitest/focus" +require "minitest/mock" +require "minitest/rg" + +require "grpc" + +require "ostruct" diff --git a/owl-bot-staging/google-cloud-security-private_ca-v1/.gitignore b/owl-bot-staging/google-cloud-security-private_ca-v1/.gitignore new file mode 100644 index 000000000000..0135b6bc6cfc --- /dev/null +++ b/owl-bot-staging/google-cloud-security-private_ca-v1/.gitignore @@ -0,0 +1,22 @@ +# Ignore bundler lockfiles +Gemfile.lock +gems.locked + +# Ignore documentation output +doc/* +.yardoc/* + +# Ignore test output +coverage/* + +# Ignore build artifacts +pkg/* + +# Ignore files commonly present in certain dev environments +.vagrant +.DS_STORE +.idea +*.iml + +# Ignore synth output +__pycache__ diff --git a/owl-bot-staging/google-cloud-security-private_ca-v1/.repo-metadata.json b/owl-bot-staging/google-cloud-security-private_ca-v1/.repo-metadata.json new file mode 100644 index 000000000000..f7ac3d34f8c4 --- /dev/null +++ b/owl-bot-staging/google-cloud-security-private_ca-v1/.repo-metadata.json @@ -0,0 +1,18 @@ +{ + "api_id": "privateca.googleapis.com", + "api_shortname": "privateca", + "client_documentation": "https://cloud.google.com/ruby/docs/reference/google-cloud-security-private_ca-v1/latest", + "distribution_name": "google-cloud-security-private_ca-v1", + "is_cloud": true, + "language": "ruby", + "name": "privateca", + "name_pretty": "Certificate Authority Service V1 API", + "product_documentation": "https://cloud.google.com/certificate-authority-service/", + "release_level": "unreleased", + "repo": "googleapis/google-cloud-ruby", + "requires_billing": true, + "ruby-cloud-description": "Certificate Authority Service is a highly available, scalable Google Cloud service that enables you to simplify, automate, and customize the deployment, management, and security of private certificate authorities (CA). Note that google-cloud-security-private_ca-v1 is a version-specific client library. For most uses, we recommend installing the main client library google-cloud-security-private_ca instead. See the readme for more details.", + "ruby-cloud-env-prefix": "PRIVATE_CA", + "ruby-cloud-product-url": "https://cloud.google.com/certificate-authority-service/", + "library_type": "GAPIC_AUTO" +} diff --git a/owl-bot-staging/google-cloud-security-private_ca-v1/.rubocop.yml b/owl-bot-staging/google-cloud-security-private_ca-v1/.rubocop.yml new file mode 100644 index 000000000000..f143186a635f --- /dev/null +++ b/owl-bot-staging/google-cloud-security-private_ca-v1/.rubocop.yml @@ -0,0 +1,33 @@ +inherit_gem: + google-style: google-style.yml + +AllCops: + Exclude: + - "google-cloud-security-private_ca-v1.gemspec" + - "lib/**/*_pb.rb" + - "proto_docs/**/*" + - "test/**/*" + - "acceptance/**/*" + - "samples/acceptance/**/*" + - "Rakefile" + +Layout/LineLength: + Enabled: false +Metrics/AbcSize: + Enabled: false +Metrics/ClassLength: + Enabled: false +Metrics/CyclomaticComplexity: + Enabled: false +Metrics/MethodLength: + Enabled: false +Metrics/ModuleLength: + Enabled: false +Metrics/PerceivedComplexity: + Enabled: false +Naming/AccessorMethodName: + Exclude: + - "snippets/**/*.rb" +Naming/FileName: + Exclude: + - "lib/google-cloud-security-private_ca-v1.rb" diff --git a/owl-bot-staging/google-cloud-security-private_ca-v1/.toys.rb b/owl-bot-staging/google-cloud-security-private_ca-v1/.toys.rb new file mode 100644 index 000000000000..177e22456e8a --- /dev/null +++ b/owl-bot-staging/google-cloud-security-private_ca-v1/.toys.rb @@ -0,0 +1,28 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +toys_version! ">= 0.15.3" + +if ENV["RUBY_COMMON_TOOLS"] + common_tools_dir = File.expand_path ENV["RUBY_COMMON_TOOLS"] + load File.join(common_tools_dir, "toys", "gapic") +else + load_git remote: "https://github.com/googleapis/ruby-common-tools.git", + path: "toys/gapic", + update: true +end diff --git a/owl-bot-staging/google-cloud-security-private_ca-v1/.yardopts b/owl-bot-staging/google-cloud-security-private_ca-v1/.yardopts new file mode 100644 index 000000000000..4cd4bdadd755 --- /dev/null +++ b/owl-bot-staging/google-cloud-security-private_ca-v1/.yardopts @@ -0,0 +1,12 @@ +--no-private +--title="Certificate Authority Service V1 API" +--exclude _pb\.rb$ +--markup markdown +--markup-provider redcarpet + +./lib/**/*.rb +./proto_docs/**/*.rb +- +README.md +LICENSE.md +AUTHENTICATION.md diff --git a/owl-bot-staging/google-cloud-security-private_ca-v1/AUTHENTICATION.md b/owl-bot-staging/google-cloud-security-private_ca-v1/AUTHENTICATION.md new file mode 100644 index 000000000000..b0dc4d853281 --- /dev/null +++ b/owl-bot-staging/google-cloud-security-private_ca-v1/AUTHENTICATION.md @@ -0,0 +1,122 @@ +# Authentication + +The recommended way to authenticate to the google-cloud-security-private_ca-v1 library is to use +[Application Default Credentials (ADC)](https://cloud.google.com/docs/authentication/application-default-credentials). +To review all of your authentication options, see [Credentials lookup](#credential-lookup). + +## Quickstart + +The following example shows how to set up authentication for a local development +environment with your user credentials. + +**NOTE:** This method is _not_ recommended for running in production. User credentials +should be used only during development. + +1. [Download and install the Google Cloud CLI](https://cloud.google.com/sdk). +2. Set up a local ADC file with your user credentials: + +```sh +gcloud auth application-default login +``` + +3. Write code as if already authenticated. + +For more information about setting up authentication for a local development environment, see +[Set up Application Default Credentials](https://cloud.google.com/docs/authentication/provide-credentials-adc#local-dev). + +## Credential Lookup + +The google-cloud-security-private_ca-v1 library provides several mechanisms to configure your system. +Generally, using Application Default Credentials to facilitate automatic +credentials discovery is the easist method. But if you need to explicitly specify +credentials, there are several methods available to you. + +Credentials are accepted in the following ways, in the following order or precedence: + +1. Credentials specified in method arguments +2. Credentials specified in configuration +3. Credentials pointed to or included in environment variables +4. Credentials found in local ADC file +5. Credentials returned by the metadata server for the attached service account (GCP) + +### Configuration + +You can configure a path to a JSON credentials file, either for an individual client object or +globally, for all client objects. The JSON file can contain credentials created for +[workload identity federation](https://cloud.google.com/iam/docs/workload-identity-federation), +[workforce identity federation](https://cloud.google.com/iam/docs/workforce-identity-federation), or a +[service account key](https://cloud.google.com/docs/authentication/provide-credentials-adc#local-key). + +Note: Service account keys are a security risk if not managed correctly. You should +[choose a more secure alternative to service account keys](https://cloud.google.com/docs/authentication#auth-decision-tree) +whenever possible. + +To configure a credentials file for an individual client initialization: + +```ruby +require "google/cloud/security/private_ca/v1" + +client = ::Google::Cloud::Security::PrivateCA::V1::CertificateAuthorityService::Client.new do |config| + config.credentials = "path/to/credentialfile.json" +end +``` + +To configure a credentials file globally for all clients: + +```ruby +require "google/cloud/security/private_ca/v1" + +::Google::Cloud::Security::PrivateCA::V1::CertificateAuthorityService::Client.configure do |config| + config.credentials = "path/to/credentialfile.json" +end + +client = ::Google::Cloud::Security::PrivateCA::V1::CertificateAuthorityService::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-security-private_ca-v1 +checks for credentials are: + +* `GOOGLE_CLOUD_CREDENTIALS` - Path to JSON file, or JSON contents +* `GOOGLE_APPLICATION_CREDENTIALS` - Path to JSON file + +```ruby +require "google/cloud/security/private_ca/v1" + +ENV["GOOGLE_APPLICATION_CREDENTIALS"] = "path/to/credentialfile.json" + +client = ::Google::Cloud::Security::PrivateCA::V1::CertificateAuthorityService::Client.new +``` + +### Local ADC file + +You can set up a local ADC file with your user credentials for authentication during +development. If credentials are not provided in code or in environment variables, +then the local ADC credentials are discovered. + +Follow the steps in [Quickstart](#quickstart) to set up a local ADC file. + +### Google Cloud Platform environments + +When running on Google Cloud Platform (GCP), including Google Compute Engine +(GCE), Google Kubernetes Engine (GKE), Google App Engine (GAE), Google Cloud +Functions (GCF) and Cloud Run, credentials are retrieved from the attached +service account automatically. Code should be written as if already authenticated. + +For more information, see +[Set up ADC for Google Cloud services](https://cloud.google.com/docs/authentication/provide-credentials-adc#attached-sa). diff --git a/owl-bot-staging/google-cloud-security-private_ca-v1/CHANGELOG.md b/owl-bot-staging/google-cloud-security-private_ca-v1/CHANGELOG.md new file mode 100644 index 000000000000..f88957a62ba2 --- /dev/null +++ b/owl-bot-staging/google-cloud-security-private_ca-v1/CHANGELOG.md @@ -0,0 +1,2 @@ +# Release History + diff --git a/owl-bot-staging/google-cloud-security-private_ca-v1/Gemfile b/owl-bot-staging/google-cloud-security-private_ca-v1/Gemfile new file mode 100644 index 000000000000..1d08558908d8 --- /dev/null +++ b/owl-bot-staging/google-cloud-security-private_ca-v1/Gemfile @@ -0,0 +1,14 @@ +source "https://rubygems.org" + +gemspec + +gem "google-style", "~> 1.32.0" +gem "irb", "~> 1.17" +gem "minitest", "~> 6.0.2" +gem "minitest-focus", "~> 1.4" +gem "minitest-mock", "~> 5.27" +gem "minitest-rg", "~> 5.3" +gem "ostruct", "~> 0.5.5" +gem "rake", ">= 13.0" +gem "redcarpet", "~> 3.6" +gem "yard", "~> 0.9" diff --git a/owl-bot-staging/google-cloud-security-private_ca-v1/LICENSE.md b/owl-bot-staging/google-cloud-security-private_ca-v1/LICENSE.md new file mode 100644 index 000000000000..c261857ba6ad --- /dev/null +++ b/owl-bot-staging/google-cloud-security-private_ca-v1/LICENSE.md @@ -0,0 +1,201 @@ + Apache License + Version 2.0, January 2004 + http://www.apache.org/licenses/ + + TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION + + 1. Definitions. + + "License" shall mean the terms and conditions for use, reproduction, + and distribution as defined by Sections 1 through 9 of this document. + + "Licensor" shall mean the copyright owner or entity authorized by + the copyright owner that is granting the License. + + "Legal Entity" shall mean the union of the acting entity and all + other entities that control, are controlled by, or are under common + control with that entity. For the purposes of this definition, + "control" means (i) the power, direct or indirect, to cause the + direction or management of such entity, whether by contract or + otherwise, or (ii) ownership of fifty percent (50%) or more of the + outstanding shares, or (iii) beneficial ownership of such entity. + + "You" (or "Your") shall mean an individual or Legal Entity + exercising permissions granted by this License. + + "Source" form shall mean the preferred form for making modifications, + including but not limited to software source code, documentation + source, and configuration files. + + "Object" form shall mean any form resulting from mechanical + transformation or translation of a Source form, including but + not limited to compiled object code, generated documentation, + and conversions to other media types. + + "Work" shall mean the work of authorship, whether in Source or + Object form, made available under the License, as indicated by a + copyright notice that is included in or attached to the work + (an example is provided in the Appendix below). + + "Derivative Works" shall mean any work, whether in Source or Object + form, that is based on (or derived from) the Work and for which the + editorial revisions, annotations, elaborations, or other modifications + represent, as a whole, an original work of authorship. For the purposes + of this License, Derivative Works shall not include works that remain + separable from, or merely link (or bind by name) to the interfaces of, + the Work and Derivative Works thereof. + + "Contribution" shall mean any work of authorship, including + the original version of the Work and any modifications or additions + to that Work or Derivative Works thereof, that is intentionally + submitted to Licensor for inclusion in the Work by the copyright owner + or by an individual or Legal Entity authorized to submit on behalf of + the copyright owner. For the purposes of this definition, "submitted" + means any form of electronic, verbal, or written communication sent + to the Licensor or its representatives, including but not limited to + communication on electronic mailing lists, source code control systems, + and issue tracking systems that are managed by, or on behalf of, the + Licensor for the purpose of discussing and improving the Work, but + excluding communication that is conspicuously marked or otherwise + designated in writing by the copyright owner as "Not a Contribution." + + "Contributor" shall mean Licensor and any individual or Legal Entity + on behalf of whom a Contribution has been received by Licensor and + subsequently incorporated within the Work. + + 2. Grant of Copyright License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + copyright license to reproduce, prepare Derivative Works of, + publicly display, publicly perform, sublicense, and distribute the + Work and such Derivative Works in Source or Object form. + + 3. Grant of Patent License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + (except as stated in this section) patent license to make, have made, + use, offer to sell, sell, import, and otherwise transfer the Work, + where such license applies only to those patent claims licensable + by such Contributor that are necessarily infringed by their + Contribution(s) alone or by combination of their Contribution(s) + with the Work to which such Contribution(s) was submitted. If You + institute patent litigation against any entity (including a + cross-claim or counterclaim in a lawsuit) alleging that the Work + or a Contribution incorporated within the Work constitutes direct + or contributory patent infringement, then any patent licenses + granted to You under this License for that Work shall terminate + as of the date such litigation is filed. + + 4. Redistribution. You may reproduce and distribute copies of the + Work or Derivative Works thereof in any medium, with or without + modifications, and in Source or Object form, provided that You + meet the following conditions: + + (a) You must give any other recipients of the Work or + Derivative Works a copy of this License; and + + (b) You must cause any modified files to carry prominent notices + stating that You changed the files; and + + (c) You must retain, in the Source form of any Derivative Works + that You distribute, all copyright, patent, trademark, and + attribution notices from the Source form of the Work, + excluding those notices that do not pertain to any part of + the Derivative Works; and + + (d) If the Work includes a "NOTICE" text file as part of its + distribution, then any Derivative Works that You distribute must + include a readable copy of the attribution notices contained + within such NOTICE file, excluding those notices that do not + pertain to any part of the Derivative Works, in at least one + of the following places: within a NOTICE text file distributed + as part of the Derivative Works; within the Source form or + documentation, if provided along with the Derivative Works; or, + within a display generated by the Derivative Works, if and + wherever such third-party notices normally appear. The contents + of the NOTICE file are for informational purposes only and + do not modify the License. You may add Your own attribution + notices within Derivative Works that You distribute, alongside + or as an addendum to the NOTICE text from the Work, provided + that such additional attribution notices cannot be construed + as modifying the License. + + You may add Your own copyright statement to Your modifications and + may provide additional or different license terms and conditions + for use, reproduction, or distribution of Your modifications, or + for any such Derivative Works as a whole, provided Your use, + reproduction, and distribution of the Work otherwise complies with + the conditions stated in this License. + + 5. Submission of Contributions. Unless You explicitly state otherwise, + any Contribution intentionally submitted for inclusion in the Work + by You to the Licensor shall be under the terms and conditions of + this License, without any additional terms or conditions. + Notwithstanding the above, nothing herein shall supersede or modify + the terms of any separate license agreement you may have executed + with Licensor regarding such Contributions. + + 6. Trademarks. This License does not grant permission to use the trade + names, trademarks, service marks, or product names of the Licensor, + except as required for reasonable and customary use in describing the + origin of the Work and reproducing the content of the NOTICE file. + + 7. Disclaimer of Warranty. Unless required by applicable law or + agreed to in writing, Licensor provides the Work (and each + Contributor provides its Contributions) on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or + implied, including, without limitation, any warranties or conditions + of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A + PARTICULAR PURPOSE. You are solely responsible for determining the + appropriateness of using or redistributing the Work and assume any + risks associated with Your exercise of permissions under this License. + + 8. Limitation of Liability. In no event and under no legal theory, + whether in tort (including negligence), contract, or otherwise, + unless required by applicable law (such as deliberate and grossly + negligent acts) or agreed to in writing, shall any Contributor be + liable to You for damages, including any direct, indirect, special, + incidental, or consequential damages of any character arising as a + result of this License or out of the use or inability to use the + Work (including but not limited to damages for loss of goodwill, + work stoppage, computer failure or malfunction, or any and all + other commercial damages or losses), even if such Contributor + has been advised of the possibility of such damages. + + 9. Accepting Warranty or Additional Liability. While redistributing + the Work or Derivative Works thereof, You may choose to offer, + and charge a fee for, acceptance of support, warranty, indemnity, + or other liability obligations and/or rights consistent with this + License. However, in accepting such obligations, You may act only + on Your own behalf and on Your sole responsibility, not on behalf + of any other Contributor, and only if You agree to indemnify, + defend, and hold each Contributor harmless for any liability + incurred by, or claims asserted against, such Contributor by reason + of your accepting any such warranty or additional liability. + + END OF TERMS AND CONDITIONS + + APPENDIX: How to apply the Apache License to your work. + + To apply the Apache License to your work, attach the following + boilerplate notice, with the fields enclosed by brackets "[]" + replaced with your own identifying information. (Don't include + the brackets!) The text should be enclosed in the appropriate + comment syntax for the file format. We also recommend that a + file or class name and description of purpose be included on the + same "printed page" as the copyright notice for easier + identification within third-party archives. + + Copyright [yyyy] [name of copyright owner] + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. diff --git a/owl-bot-staging/google-cloud-security-private_ca-v1/README.md b/owl-bot-staging/google-cloud-security-private_ca-v1/README.md new file mode 100644 index 000000000000..778488e6a233 --- /dev/null +++ b/owl-bot-staging/google-cloud-security-private_ca-v1/README.md @@ -0,0 +1,154 @@ +# Ruby Client for the Certificate Authority Service V1 API + +The Certificate Authority Service API is a highly-available, scalable service that enables you to simplify and automate the management of private certificate authorities (CAs) while staying in control of your private keys. + +Certificate Authority Service is a highly available, scalable Google Cloud service that enables you to simplify, automate, and customize the deployment, management, and security of private certificate authorities (CA). + +https://github.com/googleapis/google-cloud-ruby + +This gem is a _versioned_ client. It provides basic client classes for a +specific version of the Certificate Authority Service V1 API. Most users should consider using +the main client gem, +[google-cloud-security-private_ca](https://rubygems.org/gems/google-cloud-security-private_ca). +See the section below titled *Which client should I use?* for more information. + +## Installation + +``` +$ gem install google-cloud-security-private_ca-v1 +``` + +## Before You Begin + +In order to use this library, you first need to go through the following steps: + +1. [Select or create a Cloud Platform project.](https://console.cloud.google.com/project) +1. [Enable billing for your project.](https://cloud.google.com/billing/docs/how-to/modify-project#enable_billing_for_a_project) +1. [Enable the API.](https://console.cloud.google.com/apis/library/privateca.googleapis.com) +1. [Set up authentication.](AUTHENTICATION.md) + +## Quick Start + +```ruby +require "google/cloud/security/private_ca/v1" + +client = ::Google::Cloud::Security::PrivateCA::V1::CertificateAuthorityService::Client.new +request = ::Google::Cloud::Security::PrivateCA::V1::CreateCertificateRequest.new # (request fields as keyword arguments...) +response = client.create_certificate request +``` + +View the [Client Library Documentation](https://cloud.google.com/ruby/docs/reference/google-cloud-security-private_ca-v1/latest) +for class and method documentation. + +See also the [Product Documentation](https://cloud.google.com/certificate-authority-service/) +for general usage information. + +## Debug Logging + +This library comes with opt-in Debug Logging that can help you troubleshoot +your application's integration with the API. When logging is activated, key +events such as requests and responses, along with data payloads and metadata +such as headers and client configuration, are logged to the standard error +stream. + +**WARNING:** Client Library Debug Logging includes your data payloads in +plaintext, which could include sensitive data such as PII for yourself or your +customers, private keys, or other security data that could be compromising if +leaked. Always practice good data hygiene with your application logs, and follow +the principle of least access. Google also recommends that Client Library Debug +Logging be enabled only temporarily during active debugging, and not used +permanently in production. + +To enable logging, set the environment variable `GOOGLE_SDK_RUBY_LOGGING_GEMS` +to the value `all`. Alternatively, you can set the value to a comma-delimited +list of client library gem names. This will select the default logging behavior, +which writes logs to the standard error stream. On a local workstation, this may +result in logs appearing on the console. When running on a Google Cloud hosting +service such as [Google Cloud Run](https://cloud.google.com/run), this generally +results in logs appearing alongside your application logs in the +[Google Cloud Logging](https://cloud.google.com/logging/) service. + +You can customize logging by modifying the `logger` configuration when +constructing a client object. For example: + +```ruby +require "google/cloud/security/private_ca/v1" +require "logger" + +client = ::Google::Cloud::Security::PrivateCA::V1::CertificateAuthorityService::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-security-private_ca`, +and lower-level _versioned_ client libraries with names such as +`google-cloud-security-private_ca-v1`. +_In most cases, you should install the main client._ + +### What's the difference between the main client and a versioned client? + +A _versioned client_ provides a basic set of data types and client classes for +a _single version_ of a specific service. (That is, for a service with multiple +versions, there might be a separate versioned client for each service version.) +Most versioned clients are written and maintained by a code generator. + +The _main client_ is designed to provide you with the _recommended_ client +interfaces for the service. There will be only one main client for any given +service, even a service with multiple versions. The main client includes +factory methods for constructing the client objects we recommend for most +users. In some cases, those will be classes provided by an underlying versioned +client; in other cases, they will be handwritten higher-level client objects +with additional capabilities, convenience methods, or best practices built in. +Generally, the main client will default to a recommended service version, +although in some cases you can override this if you need to talk to a specific +service version. + +### Why would I want to use the main client? + +We recommend that most users install the main client gem for a service. You can +identify this gem as the one _without_ a version in its name, e.g. +`google-cloud-security-private_ca`. +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-security-private_ca-v1`. + +### What about the google-apis- clients? + +Client library gems with names that begin with `google-apis-` are based on an +older code generation technology. They talk to a REST/JSON backend (whereas +most modern clients talk to a [gRPC](https://grpc.io/) backend) and they may +not offer the same performance, features, and ease of use provided by more +modern clients. + +The `google-apis-` clients have wide coverage across Google services, so you +might need to use one if there is no modern client available for the service. +However, if a modern client is available, we generally recommend it over the +older `google-apis-` clients. diff --git a/owl-bot-staging/google-cloud-security-private_ca-v1/Rakefile b/owl-bot-staging/google-cloud-security-private_ca-v1/Rakefile new file mode 100644 index 000000000000..bb7b3d9c8032 --- /dev/null +++ b/owl-bot-staging/google-cloud-security-private_ca-v1/Rakefile @@ -0,0 +1,169 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +require "bundler/setup" +require "bundler/gem_tasks" + +require "rubocop/rake_task" +RuboCop::RakeTask.new + +require "rake/testtask" +desc "Run tests." +Rake::TestTask.new do |t| + t.libs << "test" + t.test_files = FileList["test/**/*_test.rb"] + t.warning = false +end + +desc "Runs the smoke tests." +Rake::TestTask.new :smoke_test do |t| + t.test_files = FileList["acceptance/**/*smoke_test.rb"] + t.warning = false +end + +# Acceptance tests +desc "Run the google-cloud-security-private_ca-v1 acceptance tests." +task :acceptance, :project, :keyfile do |t, args| + project = args[:project] + project ||= + ENV["PRIVATE_CA_TEST_PROJECT"] || + ENV["GCLOUD_TEST_PROJECT"] + keyfile = args[:keyfile] + keyfile ||= + ENV["PRIVATE_CA_TEST_KEYFILE"] || + ENV["GCLOUD_TEST_KEYFILE"] + if keyfile + keyfile = File.read keyfile + else + keyfile ||= + ENV["PRIVATE_CA_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 PRIVATE_CA_TEST_PROJECT=test123 PRIVATE_CA_TEST_KEYFILE=/path/to/keyfile.json rake acceptance" + end + require "google/cloud/security/private_ca/v1/certificate_authority_service/credentials" + ::Google::Cloud::Security::PrivateCA::V1::CertificateAuthorityService::Credentials.env_vars.each do |path| + ENV[path] = nil + end + ENV["PRIVATE_CA_PROJECT"] = project + ENV["PRIVATE_CA_TEST_PROJECT"] = project + ENV["PRIVATE_CA_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-security-private_ca-v1 gem has no acceptance tests." + end + end + + desc "Run acceptance cleanup." + task :cleanup do + end +end + +task :samples do + Rake::Task["samples:latest"].invoke +end + +namespace :samples do + task :latest do + if File.directory? "samples" + Dir.chdir "samples" do + Bundler.with_clean_env do + ENV["GOOGLE_CLOUD_SAMPLES_TEST"] = "not_master" + sh "bundle update" + sh "bundle exec rake test" + end + end + else + puts "The google-cloud-security-private_ca-v1 gem has no samples to test." + end + end + + task :master do + if File.directory? "samples" + Dir.chdir "samples" do + Bundler.with_clean_env do + ENV["GOOGLE_CLOUD_SAMPLES_TEST"] = "master" + sh "bundle update" + sh "bundle exec rake test" + end + end + else + puts "The google-cloud-security-private_ca-v1 gem has no samples to test." + end + end +end + +require "yard" +require "yard/rake/yardoc_task" +YARD::Rake::YardocTask.new do |y| + y.options << "--fail-on-warning" +end + +desc "Run yard-doctest example tests." +task :doctest do + puts "The google-cloud-security-private_ca-v1 gem does not have doctest tests." +end + +desc "Run the CI build" +task :ci do + header "BUILDING google-cloud-security-private_ca-v1" + header "google-cloud-security-private_ca-v1 rubocop", "*" + Rake::Task[:rubocop].invoke + header "google-cloud-security-private_ca-v1 yard", "*" + Rake::Task[:yard].invoke + header "google-cloud-security-private_ca-v1 test", "*" + Rake::Task[:test].invoke +end + +namespace :ci do + desc "Run the CI build, with smoke tests." + task :smoke_test do + Rake::Task[:ci].invoke + header "google-cloud-security-private_ca-v1 smoke_test", "*" + Rake::Task[:smoke_test].invoke + end + desc "Run the CI build, with acceptance tests." + task :acceptance do + Rake::Task[:ci].invoke + header "google-cloud-security-private_ca-v1 acceptance", "*" + Rake::Task[:acceptance].invoke + end + task :a do + # This is a handy shortcut to save typing + Rake::Task["ci:acceptance"].invoke + end +end + +task default: :test + +def header str, token = "#" + line_length = str.length + 8 + puts "" + puts token * line_length + puts "#{token * 3} #{str} #{token * 3}" + puts token * line_length + puts "" +end diff --git a/owl-bot-staging/google-cloud-security-private_ca-v1/gapic_metadata.json b/owl-bot-staging/google-cloud-security-private_ca-v1/gapic_metadata.json new file mode 100644 index 000000000000..a3ae1a7a8d29 --- /dev/null +++ b/owl-bot-staging/google-cloud-security-private_ca-v1/gapic_metadata.json @@ -0,0 +1,163 @@ +{ + "schema": "1.0", + "comment": "This file maps proto services/RPCs to the corresponding library clients/methods", + "language": "ruby", + "protoPackage": "google.cloud.security.privateca.v1", + "libraryPackage": "::Google::Cloud::Security::PrivateCA::V1", + "services": { + "CertificateAuthorityService": { + "clients": { + "grpc": { + "libraryClient": "::Google::Cloud::Security::PrivateCA::V1::CertificateAuthorityService::Client", + "rpcs": { + "CreateCertificate": { + "methods": [ + "create_certificate" + ] + }, + "GetCertificate": { + "methods": [ + "get_certificate" + ] + }, + "ListCertificates": { + "methods": [ + "list_certificates" + ] + }, + "RevokeCertificate": { + "methods": [ + "revoke_certificate" + ] + }, + "UpdateCertificate": { + "methods": [ + "update_certificate" + ] + }, + "ActivateCertificateAuthority": { + "methods": [ + "activate_certificate_authority" + ] + }, + "CreateCertificateAuthority": { + "methods": [ + "create_certificate_authority" + ] + }, + "DisableCertificateAuthority": { + "methods": [ + "disable_certificate_authority" + ] + }, + "EnableCertificateAuthority": { + "methods": [ + "enable_certificate_authority" + ] + }, + "FetchCertificateAuthorityCsr": { + "methods": [ + "fetch_certificate_authority_csr" + ] + }, + "GetCertificateAuthority": { + "methods": [ + "get_certificate_authority" + ] + }, + "ListCertificateAuthorities": { + "methods": [ + "list_certificate_authorities" + ] + }, + "UndeleteCertificateAuthority": { + "methods": [ + "undelete_certificate_authority" + ] + }, + "DeleteCertificateAuthority": { + "methods": [ + "delete_certificate_authority" + ] + }, + "UpdateCertificateAuthority": { + "methods": [ + "update_certificate_authority" + ] + }, + "CreateCaPool": { + "methods": [ + "create_ca_pool" + ] + }, + "UpdateCaPool": { + "methods": [ + "update_ca_pool" + ] + }, + "GetCaPool": { + "methods": [ + "get_ca_pool" + ] + }, + "ListCaPools": { + "methods": [ + "list_ca_pools" + ] + }, + "DeleteCaPool": { + "methods": [ + "delete_ca_pool" + ] + }, + "FetchCaCerts": { + "methods": [ + "fetch_ca_certs" + ] + }, + "GetCertificateRevocationList": { + "methods": [ + "get_certificate_revocation_list" + ] + }, + "ListCertificateRevocationLists": { + "methods": [ + "list_certificate_revocation_lists" + ] + }, + "UpdateCertificateRevocationList": { + "methods": [ + "update_certificate_revocation_list" + ] + }, + "CreateCertificateTemplate": { + "methods": [ + "create_certificate_template" + ] + }, + "DeleteCertificateTemplate": { + "methods": [ + "delete_certificate_template" + ] + }, + "GetCertificateTemplate": { + "methods": [ + "get_certificate_template" + ] + }, + "ListCertificateTemplates": { + "methods": [ + "list_certificate_templates" + ] + }, + "UpdateCertificateTemplate": { + "methods": [ + "update_certificate_template" + ] + } + } + } + } + } + } +} diff --git a/owl-bot-staging/google-cloud-security-private_ca-v1/google-cloud-security-private_ca-v1.gemspec b/owl-bot-staging/google-cloud-security-private_ca-v1/google-cloud-security-private_ca-v1.gemspec new file mode 100644 index 000000000000..a513bf2bd80e --- /dev/null +++ b/owl-bot-staging/google-cloud-security-private_ca-v1/google-cloud-security-private_ca-v1.gemspec @@ -0,0 +1,30 @@ +# -*- ruby -*- +# encoding: utf-8 + +require File.expand_path("lib/google/cloud/security/private_ca/v1/version", __dir__) + +Gem::Specification.new do |gem| + gem.name = "google-cloud-security-private_ca-v1" + gem.version = Google::Cloud::Security::PrivateCA::V1::VERSION + + gem.authors = ["Google LLC"] + gem.email = "googleapis-packages@google.com" + gem.description = "Certificate Authority Service is a highly available, scalable Google Cloud service that enables you to simplify, automate, and customize the deployment, management, and security of private certificate authorities (CA). Note that google-cloud-security-private_ca-v1 is a version-specific client library. For most uses, we recommend installing the main client library google-cloud-security-private_ca instead. See the readme for more details." + gem.summary = "The Certificate Authority Service API is a highly-available, scalable service that enables you to simplify and automate the management of private certificate authorities (CAs) while staying in control of your private keys." + 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" + gem.add_dependency "google-iam-v1", "~> 1.3" +end diff --git a/owl-bot-staging/google-cloud-security-private_ca-v1/lib/google-cloud-security-private_ca-v1.rb b/owl-bot-staging/google-cloud-security-private_ca-v1/lib/google-cloud-security-private_ca-v1.rb new file mode 100644 index 000000000000..ec80d7546971 --- /dev/null +++ b/owl-bot-staging/google-cloud-security-private_ca-v1/lib/google-cloud-security-private_ca-v1.rb @@ -0,0 +1,21 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +# This gem does not autoload during Bundler.require. To load this gem, +# issue explicit require statements for the packages desired, e.g.: +# require "google/cloud/security/private_ca/v1" diff --git a/owl-bot-staging/google-cloud-security-private_ca-v1/lib/google/cloud/security/private_ca/v1.rb b/owl-bot-staging/google-cloud-security-private_ca-v1/lib/google/cloud/security/private_ca/v1.rb new file mode 100644 index 000000000000..2dcf3038bbe3 --- /dev/null +++ b/owl-bot-staging/google-cloud-security-private_ca-v1/lib/google/cloud/security/private_ca/v1.rb @@ -0,0 +1,47 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +require "google/cloud/security/private_ca/v1/certificate_authority_service" +require "google/cloud/security/private_ca/v1/version" + +module Google + module Cloud + module Security + module PrivateCA + ## + # API client module. + # + # @example Load this package, including all its services, and instantiate a gRPC client + # + # require "google/cloud/security/private_ca/v1" + # client = ::Google::Cloud::Security::PrivateCA::V1::CertificateAuthorityService::Client.new + # + # @example Load this package, including all its services, and instantiate a REST client + # + # require "google/cloud/security/private_ca/v1" + # client = ::Google::Cloud::Security::PrivateCA::V1::CertificateAuthorityService::Rest::Client.new + # + module V1 + end + end + end + end +end + +helper_path = ::File.join __dir__, "v1", "_helpers.rb" +require "google/cloud/security/private_ca/v1/_helpers" if ::File.file? helper_path diff --git a/owl-bot-staging/google-cloud-security-private_ca-v1/lib/google/cloud/security/private_ca/v1/bindings_override.rb b/owl-bot-staging/google-cloud-security-private_ca-v1/lib/google/cloud/security/private_ca/v1/bindings_override.rb new file mode 100644 index 000000000000..f9fc3eab4e89 --- /dev/null +++ b/owl-bot-staging/google-cloud-security-private_ca-v1/lib/google/cloud/security/private_ca/v1/bindings_override.rb @@ -0,0 +1,158 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +require "gapic/rest" + +module Google + module Cloud + module Security + module PrivateCA + ## + # @example Loading just the REST part of this package, including all its services, and instantiating a REST client + # + # require "google/cloud/security/private_ca/v1/rest" + # client = ::Google::Cloud::Security::PrivateCA::V1::CertificateAuthorityService::Rest::Client.new + # + module V1 + ## + # @private + # Initialize the mixin bindings configuration + # + def self.configure + @configure ||= begin + namespace = ["Google", "Cloud", "Security", "PrivateCA"] + parent_config = while namespace.any? + parent_name = namespace.join "::" + parent_const = const_get parent_name + break parent_const.configure if parent_const.respond_to? :configure + namespace.pop + end + + default_config = ::Gapic::Rest::HttpBindingOverrideConfiguration.new parent_config + default_config.bindings_override["google.cloud.location.Locations.GetLocation"] = [ + Gapic::Rest::GrpcTranscoder::HttpBinding.create_with_validation( + uri_method: :get, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/?$}, false] + ], + body: nil + ) + ] + default_config.bindings_override["google.cloud.location.Locations.ListLocations"] = [ + + Gapic::Rest::GrpcTranscoder::HttpBinding.create_with_validation( + uri_method: :get, + uri_template: "/v1/{name}/locations", + matches: [ + ["name", %r{^projects/[^/]+/?$}, false] + ], + body: nil + ) + ] + default_config.bindings_override["google.iam.v1.IAMPolicy.GetIamPolicy"] = [ + + Gapic::Rest::GrpcTranscoder::HttpBinding.create_with_validation( + uri_method: :get, + uri_template: "/v1/{resource}:getIamPolicy", + matches: [ + ["resource", %r{^projects/[^/]+/locations/[^/]+/caPools/[^/]+/?$}, false] + ], + body: nil + ), + Gapic::Rest::GrpcTranscoder::HttpBinding.create_with_validation( + uri_method: :get, + uri_template: "/v1/{resource}:getIamPolicy", + matches: [ + ["resource", %r{^projects/[^/]+/locations/[^/]+/certificateTemplates/[^/]+/?$}, false] + ], + body: nil + ), + Gapic::Rest::GrpcTranscoder::HttpBinding.create_with_validation( + uri_method: :get, + uri_template: "/v1/{resource}:getIamPolicy", + matches: [ + ["resource", %r{^projects/[^/]+/locations/[^/]+/caPools/[^/]+/certificateAuthorities/[^/]+/certificateRevocationLists/[^/]+/?$}, false] + ], + body: nil + ) + ] + default_config.bindings_override["google.iam.v1.IAMPolicy.SetIamPolicy"] = [ + + Gapic::Rest::GrpcTranscoder::HttpBinding.create_with_validation( + uri_method: :post, + uri_template: "/v1/{resource}:setIamPolicy", + matches: [ + ["resource", %r{^projects/[^/]+/locations/[^/]+/caPools/[^/]+/?$}, false] + ], + body: "*" + ), + Gapic::Rest::GrpcTranscoder::HttpBinding.create_with_validation( + uri_method: :post, + uri_template: "/v1/{resource}:setIamPolicy", + matches: [ + ["resource", %r{^projects/[^/]+/locations/[^/]+/certificateTemplates/[^/]+/?$}, false] + ], + body: "*" + ), + Gapic::Rest::GrpcTranscoder::HttpBinding.create_with_validation( + uri_method: :post, + uri_template: "/v1/{resource}:setIamPolicy", + matches: [ + ["resource", %r{^projects/[^/]+/locations/[^/]+/caPools/[^/]+/certificateAuthorities/[^/]+/certificateRevocationLists/[^/]+/?$}, false] + ], + body: "*" + ) + ] + default_config.bindings_override["google.iam.v1.IAMPolicy.TestIamPermissions"] = [ + + Gapic::Rest::GrpcTranscoder::HttpBinding.create_with_validation( + uri_method: :post, + uri_template: "/v1/{resource}:testIamPermissions", + matches: [ + ["resource", %r{^projects/[^/]+/locations/[^/]+/caPools/[^/]+/?$}, false] + ], + body: "*" + ), + Gapic::Rest::GrpcTranscoder::HttpBinding.create_with_validation( + uri_method: :post, + uri_template: "/v1/{resource}:testIamPermissions", + matches: [ + ["resource", %r{^projects/[^/]+/locations/[^/]+/certificateTemplates/[^/]+/?$}, false] + ], + body: "*" + ), + Gapic::Rest::GrpcTranscoder::HttpBinding.create_with_validation( + uri_method: :post, + uri_template: "/v1/{resource}:testIamPermissions", + matches: [ + ["resource", %r{^projects/[^/]+/locations/[^/]+/caPools/[^/]+/certificateAuthorities/[^/]+/certificateRevocationLists/[^/]+/?$}, false] + ], + body: "*" + ) + ] + default_config + end + yield @configure if block_given? + @configure + end + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-security-private_ca-v1/lib/google/cloud/security/private_ca/v1/certificate_authority_service.rb b/owl-bot-staging/google-cloud-security-private_ca-v1/lib/google/cloud/security/private_ca/v1/certificate_authority_service.rb new file mode 100644 index 000000000000..780346978920 --- /dev/null +++ b/owl-bot-staging/google-cloud-security-private_ca-v1/lib/google/cloud/security/private_ca/v1/certificate_authority_service.rb @@ -0,0 +1,60 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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/security/private_ca/v1/version" + +require "google/cloud/security/private_ca/v1/certificate_authority_service/credentials" +require "google/cloud/security/private_ca/v1/certificate_authority_service/paths" +require "google/cloud/security/private_ca/v1/certificate_authority_service/operations" +require "google/cloud/security/private_ca/v1/certificate_authority_service/client" +require "google/cloud/security/private_ca/v1/certificate_authority_service/rest" + +module Google + module Cloud + module Security + module PrivateCA + module V1 + ## + # [Certificate Authority + # Service][google.cloud.security.privateca.v1.CertificateAuthorityService] + # manages private certificate authorities and issued certificates. + # + # @example Load this service and instantiate a gRPC client + # + # require "google/cloud/security/private_ca/v1/certificate_authority_service" + # client = ::Google::Cloud::Security::PrivateCA::V1::CertificateAuthorityService::Client.new + # + # @example Load this service and instantiate a REST client + # + # require "google/cloud/security/private_ca/v1/certificate_authority_service/rest" + # client = ::Google::Cloud::Security::PrivateCA::V1::CertificateAuthorityService::Rest::Client.new + # + module CertificateAuthorityService + end + end + end + end + end +end + +helper_path = ::File.join __dir__, "certificate_authority_service", "helpers.rb" +require "google/cloud/security/private_ca/v1/certificate_authority_service/helpers" if ::File.file? helper_path diff --git a/owl-bot-staging/google-cloud-security-private_ca-v1/lib/google/cloud/security/private_ca/v1/certificate_authority_service/client.rb b/owl-bot-staging/google-cloud-security-private_ca-v1/lib/google/cloud/security/private_ca/v1/certificate_authority_service/client.rb new file mode 100644 index 000000000000..bdfabc4f78a3 --- /dev/null +++ b/owl-bot-staging/google-cloud-security-private_ca-v1/lib/google/cloud/security/private_ca/v1/certificate_authority_service/client.rb @@ -0,0 +1,3804 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +require "google/cloud/errors" +require "google/cloud/security/privateca/v1/service_pb" +require "google/cloud/location" +require "google/iam/v1" + +module Google + module Cloud + module Security + module PrivateCA + module V1 + module CertificateAuthorityService + ## + # Client for the CertificateAuthorityService service. + # + # [Certificate Authority + # Service][google.cloud.security.privateca.v1.CertificateAuthorityService] + # manages private certificate authorities and issued certificates. + # + class Client + # @private + API_VERSION = "" + + # @private + DEFAULT_ENDPOINT_TEMPLATE = "privateca.$UNIVERSE_DOMAIN$" + + include Paths + + # @private + attr_reader :certificate_authority_service_stub + + ## + # Configure the CertificateAuthorityService Client class. + # + # See {::Google::Cloud::Security::PrivateCA::V1::CertificateAuthorityService::Client::Configuration} + # for a description of the configuration fields. + # + # @example + # + # # Modify the configuration for all CertificateAuthorityService clients + # ::Google::Cloud::Security::PrivateCA::V1::CertificateAuthorityService::Client.configure do |config| + # config.timeout = 10.0 + # end + # + # @yield [config] Configure the Client client. + # @yieldparam config [Client::Configuration] + # + # @return [Client::Configuration] + # + def self.configure + @configure ||= begin + namespace = ["Google", "Cloud", "Security", "PrivateCA", "V1"] + parent_config = while namespace.any? + parent_name = namespace.join "::" + parent_const = const_get parent_name + break parent_const.configure if parent_const.respond_to? :configure + namespace.pop + end + default_config = Client::Configuration.new parent_config + + default_config.timeout = 60.0 + default_config.retry_policy = { + initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [2, 14, 4] + } + + default_config + end + yield @configure if block_given? + @configure + end + + ## + # Configure the CertificateAuthorityService Client instance. + # + # The configuration is set to the derived mode, meaning that values can be changed, + # but structural changes (adding new fields, etc.) are not allowed. Structural changes + # should be made on {Client.configure}. + # + # See {::Google::Cloud::Security::PrivateCA::V1::CertificateAuthorityService::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 + @certificate_authority_service_stub.universe_domain + end + + ## + # Create a new CertificateAuthorityService client object. + # + # @example + # + # # Create a client using the default configuration + # client = ::Google::Cloud::Security::PrivateCA::V1::CertificateAuthorityService::Client.new + # + # # Create a client using a custom configuration + # client = ::Google::Cloud::Security::PrivateCA::V1::CertificateAuthorityService::Client.new do |config| + # config.timeout = 10.0 + # end + # + # @yield [config] Configure the CertificateAuthorityService client. + # @yieldparam config [Client::Configuration] + # + def initialize + # These require statements are intentionally placed here to initialize + # the gRPC module only when it's required. + # See https://github.com/googleapis/toolkit/issues/446 + require "gapic/grpc" + require "google/cloud/security/privateca/v1/service_services_pb" + + # Create the configuration object + @config = Configuration.new Client.configure + + # Yield the configuration if needed + yield @config if block_given? + + # Create credentials + credentials = @config.credentials + # Use self-signed JWT if the endpoint is unchanged from default, + # but only if the default endpoint does not have a region prefix. + enable_self_signed_jwt = @config.endpoint.nil? || + (@config.endpoint == Configuration::DEFAULT_ENDPOINT && + !@config.endpoint.split(".").first.include?("-")) + credentials ||= Credentials.default scope: @config.scope, + enable_self_signed_jwt: enable_self_signed_jwt + if credentials.is_a?(::String) || credentials.is_a?(::Hash) + credentials = Credentials.new credentials, scope: @config.scope + end + @quota_project_id = @config.quota_project + @quota_project_id ||= credentials.quota_project_id if credentials.respond_to? :quota_project_id + + @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 + + @certificate_authority_service_stub = ::Gapic::ServiceStub.new( + ::Google::Cloud::Security::PrivateCA::V1::CertificateAuthorityService::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 + ) + + @certificate_authority_service_stub.stub_logger&.info do |entry| + entry.set_system_name + entry.set_service + entry.message = "Created client for #{entry.service}" + entry.set_credentials_fields credentials + entry.set "customEndpoint", @config.endpoint if @config.endpoint + entry.set "defaultTimeout", @config.timeout if @config.timeout + entry.set "quotaProject", @quota_project_id if @quota_project_id + end + + @location_client = Google::Cloud::Location::Locations::Client.new do |config| + config.credentials = credentials + config.quota_project = @quota_project_id + config.endpoint = @certificate_authority_service_stub.endpoint + config.universe_domain = @certificate_authority_service_stub.universe_domain + config.logger = @certificate_authority_service_stub.logger if config.respond_to? :logger= + end + + @iam_policy_client = Google::Iam::V1::IAMPolicy::Client.new do |config| + config.credentials = credentials + config.quota_project = @quota_project_id + config.endpoint = @certificate_authority_service_stub.endpoint + config.universe_domain = @certificate_authority_service_stub.universe_domain + config.logger = @certificate_authority_service_stub.logger if config.respond_to? :logger= + end + end + + ## + # Get the associated client for long-running operations. + # + # @return [::Google::Cloud::Security::PrivateCA::V1::CertificateAuthorityService::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 + + ## + # Get the associated client for mix-in of the IAMPolicy. + # + # @return [Google::Iam::V1::IAMPolicy::Client] + # + attr_reader :iam_policy_client + + ## + # The logger used for request/response debug logging. + # + # @return [Logger] + # + def logger + @certificate_authority_service_stub.logger + end + + # Service calls + + ## + # Create a new {::Google::Cloud::Security::PrivateCA::V1::Certificate Certificate} + # in a given Project, Location from a particular + # {::Google::Cloud::Security::PrivateCA::V1::CaPool CaPool}. + # + # @overload create_certificate(request, options = nil) + # Pass arguments to `create_certificate` via a request object, either of type + # {::Google::Cloud::Security::PrivateCA::V1::CreateCertificateRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Security::PrivateCA::V1::CreateCertificateRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_certificate(parent: nil, certificate_id: nil, certificate: nil, request_id: nil, validate_only: nil, issuing_certificate_authority_id: nil) + # Pass arguments to `create_certificate` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param parent [::String] + # Required. The resource name of the + # {::Google::Cloud::Security::PrivateCA::V1::CaPool CaPool} associated with the + # {::Google::Cloud::Security::PrivateCA::V1::Certificate Certificate}, in the + # format `projects/*/locations/*/caPools/*`. + # @param certificate_id [::String] + # Optional. It must be unique within a location and match the regular + # expression `[a-zA-Z0-9_-]{1,63}`. This field is required when using a + # {::Google::Cloud::Security::PrivateCA::V1::CertificateAuthority CertificateAuthority} + # in the Enterprise + # {::Google::Cloud::Security::PrivateCA::V1::CertificateAuthority#tier CertificateAuthority.tier}, + # but is optional and its value is ignored otherwise. + # @param certificate [::Google::Cloud::Security::PrivateCA::V1::Certificate, ::Hash] + # Required. A {::Google::Cloud::Security::PrivateCA::V1::Certificate Certificate} + # with initial field values. + # @param request_id [::String] + # Optional. An ID to identify requests. Specify a unique request ID so that + # if you must retry your request, the server will know to ignore the request + # if it has already been completed. The server will guarantee that for at + # least 60 minutes since the first request. + # + # For example, consider a situation where you make an initial request and the + # request times out. If you make the request again with the same request ID, + # the server can check if original operation with the same request ID was + # received, and if so, will ignore the second request. This prevents clients + # from accidentally creating duplicate commitments. + # + # The request ID must be a valid UUID with the exception that zero UUID is + # not supported (00000000-0000-0000-0000-000000000000). + # @param validate_only [::Boolean] + # Optional. If this is true, no + # {::Google::Cloud::Security::PrivateCA::V1::Certificate Certificate} resource will + # be persisted regardless of the + # {::Google::Cloud::Security::PrivateCA::V1::CaPool CaPool}'s + # {::Google::Cloud::Security::PrivateCA::V1::CaPool#tier tier}, and the returned + # {::Google::Cloud::Security::PrivateCA::V1::Certificate Certificate} will not + # contain the + # {::Google::Cloud::Security::PrivateCA::V1::Certificate#pem_certificate pem_certificate} + # field. + # @param issuing_certificate_authority_id [::String] + # Optional. The resource ID of the + # {::Google::Cloud::Security::PrivateCA::V1::CertificateAuthority CertificateAuthority} + # that should issue the certificate. This optional field will ignore the + # load-balancing scheme of the Pool and directly issue the certificate from + # the CA with the specified ID, contained in the same + # {::Google::Cloud::Security::PrivateCA::V1::CaPool CaPool} referenced by `parent`. + # Per-CA quota rules apply. If left empty, a + # {::Google::Cloud::Security::PrivateCA::V1::CertificateAuthority CertificateAuthority} + # will be chosen from the {::Google::Cloud::Security::PrivateCA::V1::CaPool CaPool} + # by the service. For example, to issue a + # {::Google::Cloud::Security::PrivateCA::V1::Certificate Certificate} from a + # Certificate Authority with resource name + # "projects/my-project/locations/us-central1/caPools/my-pool/certificateAuthorities/my-ca", + # you can set the + # {::Google::Cloud::Security::PrivateCA::V1::CreateCertificateRequest#parent parent} + # to "projects/my-project/locations/us-central1/caPools/my-pool" and the + # {::Google::Cloud::Security::PrivateCA::V1::CreateCertificateRequest#issuing_certificate_authority_id issuing_certificate_authority_id} + # to "my-ca". + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Google::Cloud::Security::PrivateCA::V1::Certificate] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Google::Cloud::Security::PrivateCA::V1::Certificate] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/security/private_ca/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Security::PrivateCA::V1::CertificateAuthorityService::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Security::PrivateCA::V1::CreateCertificateRequest.new + # + # # Call the create_certificate method. + # result = client.create_certificate request + # + # # The returned object is of type Google::Cloud::Security::PrivateCA::V1::Certificate. + # p result + # + def create_certificate request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Security::PrivateCA::V1::CreateCertificateRequest + + # Converts hash 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_certificate.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::Security::PrivateCA::V1::VERSION + metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.parent + header_params["parent"] = request.parent + end + + request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") + metadata[:"x-goog-request-params"] ||= request_params_header + + options.apply_defaults timeout: @config.rpcs.create_certificate.timeout, + metadata: metadata, + retry_policy: @config.rpcs.create_certificate.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @certificate_authority_service_stub.call_rpc :create_certificate, request, options: options do |response, operation| + yield response, operation if block_given? + end + rescue ::GRPC::BadStatus => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Returns a {::Google::Cloud::Security::PrivateCA::V1::Certificate Certificate}. + # + # @overload get_certificate(request, options = nil) + # Pass arguments to `get_certificate` via a request object, either of type + # {::Google::Cloud::Security::PrivateCA::V1::GetCertificateRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Security::PrivateCA::V1::GetCertificateRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_certificate(name: nil) + # Pass arguments to `get_certificate` via keyword arguments. Note that at + # least one keyword argument is 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 {::Google::Cloud::Security::PrivateCA::V1::Certificate#name name} + # of the {::Google::Cloud::Security::PrivateCA::V1::Certificate Certificate} to + # get. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Google::Cloud::Security::PrivateCA::V1::Certificate] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Google::Cloud::Security::PrivateCA::V1::Certificate] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/security/private_ca/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Security::PrivateCA::V1::CertificateAuthorityService::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Security::PrivateCA::V1::GetCertificateRequest.new + # + # # Call the get_certificate method. + # result = client.get_certificate request + # + # # The returned object is of type Google::Cloud::Security::PrivateCA::V1::Certificate. + # p result + # + def get_certificate request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Security::PrivateCA::V1::GetCertificateRequest + + # Converts hash 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_certificate.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::Security::PrivateCA::V1::VERSION + metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.name + header_params["name"] = request.name + end + + request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") + metadata[:"x-goog-request-params"] ||= request_params_header + + options.apply_defaults timeout: @config.rpcs.get_certificate.timeout, + metadata: metadata, + retry_policy: @config.rpcs.get_certificate.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @certificate_authority_service_stub.call_rpc :get_certificate, request, options: options do |response, operation| + yield response, operation if block_given? + end + rescue ::GRPC::BadStatus => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Lists {::Google::Cloud::Security::PrivateCA::V1::Certificate Certificates}. + # + # @overload list_certificates(request, options = nil) + # Pass arguments to `list_certificates` via a request object, either of type + # {::Google::Cloud::Security::PrivateCA::V1::ListCertificatesRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Security::PrivateCA::V1::ListCertificatesRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_certificates(parent: nil, page_size: nil, page_token: nil, filter: nil, order_by: nil) + # Pass arguments to `list_certificates` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param parent [::String] + # Required. The resource name of the location associated with the + # {::Google::Cloud::Security::PrivateCA::V1::Certificate Certificates}, in the + # format `projects/*/locations/*/caPools/*`. + # @param page_size [::Integer] + # Optional. Limit on the number of + # {::Google::Cloud::Security::PrivateCA::V1::Certificate Certificates} to include + # in the response. Further + # {::Google::Cloud::Security::PrivateCA::V1::Certificate Certificates} can + # subsequently be obtained by including the + # {::Google::Cloud::Security::PrivateCA::V1::ListCertificatesResponse#next_page_token ListCertificatesResponse.next_page_token} + # in a subsequent request. If unspecified, the server will pick an + # appropriate default. + # @param page_token [::String] + # Optional. Pagination token, returned earlier via + # {::Google::Cloud::Security::PrivateCA::V1::ListCertificatesResponse#next_page_token ListCertificatesResponse.next_page_token}. + # @param filter [::String] + # Optional. Only include resources that match the filter in the response. For + # details on supported filters and syntax, see [Certificates Filtering + # documentation](https://cloud.google.com/certificate-authority-service/docs/sorting-filtering-certificates#filtering_support). + # @param order_by [::String] + # Optional. Specify how the results should be sorted. For details on + # supported fields and syntax, see [Certificates Sorting + # documentation](https://cloud.google.com/certificate-authority-service/docs/sorting-filtering-certificates#sorting_support). + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Gapic::PagedEnumerable<::Google::Cloud::Security::PrivateCA::V1::Certificate>] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Gapic::PagedEnumerable<::Google::Cloud::Security::PrivateCA::V1::Certificate>] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/security/private_ca/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Security::PrivateCA::V1::CertificateAuthorityService::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Security::PrivateCA::V1::ListCertificatesRequest.new + # + # # Call the list_certificates method. + # result = client.list_certificates request + # + # # The returned object is of type Gapic::PagedEnumerable. You can iterate + # # over elements, and API calls will be issued to fetch pages as needed. + # result.each do |item| + # # Each element is of type ::Google::Cloud::Security::PrivateCA::V1::Certificate. + # p item + # end + # + def list_certificates request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Security::PrivateCA::V1::ListCertificatesRequest + + # Converts hash 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_certificates.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::Security::PrivateCA::V1::VERSION + metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.parent + header_params["parent"] = request.parent + end + + request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") + metadata[:"x-goog-request-params"] ||= request_params_header + + options.apply_defaults timeout: @config.rpcs.list_certificates.timeout, + metadata: metadata, + retry_policy: @config.rpcs.list_certificates.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @certificate_authority_service_stub.call_rpc :list_certificates, request, options: options do |response, operation| + response = ::Gapic::PagedEnumerable.new @certificate_authority_service_stub, :list_certificates, 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 + + ## + # Revoke a {::Google::Cloud::Security::PrivateCA::V1::Certificate Certificate}. + # + # @overload revoke_certificate(request, options = nil) + # Pass arguments to `revoke_certificate` via a request object, either of type + # {::Google::Cloud::Security::PrivateCA::V1::RevokeCertificateRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Security::PrivateCA::V1::RevokeCertificateRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. + # + # @overload revoke_certificate(name: nil, reason: nil, request_id: nil) + # Pass arguments to `revoke_certificate` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param name [::String] + # Required. The resource name for this + # {::Google::Cloud::Security::PrivateCA::V1::Certificate Certificate} in the format + # `projects/*/locations/*/caPools/*/certificates/*`. + # @param reason [::Google::Cloud::Security::PrivateCA::V1::RevocationReason] + # Required. The + # {::Google::Cloud::Security::PrivateCA::V1::RevocationReason RevocationReason} for + # revoking this certificate. + # @param request_id [::String] + # Optional. An ID to identify requests. Specify a unique request ID so that + # if you must retry your request, the server will know to ignore the request + # if it has already been completed. The server will guarantee that for at + # least 60 minutes since the first request. + # + # For example, consider a situation where you make an initial request and + # the request times out. If you make the request again with the same request + # ID, the server can check if original operation with the same request ID + # was received, and if so, will ignore the second request. This prevents + # clients from accidentally creating duplicate commitments. + # + # The request ID must be a valid UUID with the exception that zero UUID is + # not supported (00000000-0000-0000-0000-000000000000). + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Google::Cloud::Security::PrivateCA::V1::Certificate] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Google::Cloud::Security::PrivateCA::V1::Certificate] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/security/private_ca/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Security::PrivateCA::V1::CertificateAuthorityService::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Security::PrivateCA::V1::RevokeCertificateRequest.new + # + # # Call the revoke_certificate method. + # result = client.revoke_certificate request + # + # # The returned object is of type Google::Cloud::Security::PrivateCA::V1::Certificate. + # p result + # + def revoke_certificate request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Security::PrivateCA::V1::RevokeCertificateRequest + + # Converts hash 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.revoke_certificate.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::Security::PrivateCA::V1::VERSION + metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.name + header_params["name"] = request.name + end + + request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") + metadata[:"x-goog-request-params"] ||= request_params_header + + options.apply_defaults timeout: @config.rpcs.revoke_certificate.timeout, + metadata: metadata, + retry_policy: @config.rpcs.revoke_certificate.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @certificate_authority_service_stub.call_rpc :revoke_certificate, 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 + + ## + # Update a {::Google::Cloud::Security::PrivateCA::V1::Certificate Certificate}. + # Currently, the only field you can update is the + # {::Google::Cloud::Security::PrivateCA::V1::Certificate#labels labels} field. + # + # @overload update_certificate(request, options = nil) + # Pass arguments to `update_certificate` via a request object, either of type + # {::Google::Cloud::Security::PrivateCA::V1::UpdateCertificateRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Security::PrivateCA::V1::UpdateCertificateRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_certificate(certificate: nil, update_mask: nil, request_id: nil) + # Pass arguments to `update_certificate` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param certificate [::Google::Cloud::Security::PrivateCA::V1::Certificate, ::Hash] + # Required. {::Google::Cloud::Security::PrivateCA::V1::Certificate Certificate} + # with updated values. + # @param update_mask [::Google::Protobuf::FieldMask, ::Hash] + # Required. A list of fields to be updated in this request. + # @param request_id [::String] + # Optional. An ID to identify requests. Specify a unique request ID so that + # if you must retry your request, the server will know to ignore the request + # if it has already been completed. The server will guarantee that for at + # least 60 minutes since the first request. + # + # For example, consider a situation where you make an initial request and + # the request times out. If you make the request again with the same request + # ID, the server can check if original operation with the same request ID + # was received, and if so, will ignore the second request. This prevents + # clients from accidentally creating duplicate commitments. + # + # The request ID must be a valid UUID with the exception that zero UUID is + # not supported (00000000-0000-0000-0000-000000000000). + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Google::Cloud::Security::PrivateCA::V1::Certificate] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Google::Cloud::Security::PrivateCA::V1::Certificate] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/security/private_ca/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Security::PrivateCA::V1::CertificateAuthorityService::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Security::PrivateCA::V1::UpdateCertificateRequest.new + # + # # Call the update_certificate method. + # result = client.update_certificate request + # + # # The returned object is of type Google::Cloud::Security::PrivateCA::V1::Certificate. + # p result + # + def update_certificate request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Security::PrivateCA::V1::UpdateCertificateRequest + + # Converts hash 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_certificate.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::Security::PrivateCA::V1::VERSION + metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.certificate&.name + header_params["certificate.name"] = request.certificate.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_certificate.timeout, + metadata: metadata, + retry_policy: @config.rpcs.update_certificate.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @certificate_authority_service_stub.call_rpc :update_certificate, 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 + + ## + # Activate a + # {::Google::Cloud::Security::PrivateCA::V1::CertificateAuthority CertificateAuthority} + # that is in state + # {::Google::Cloud::Security::PrivateCA::V1::CertificateAuthority::State::AWAITING_USER_ACTIVATION AWAITING_USER_ACTIVATION} + # and is of type + # {::Google::Cloud::Security::PrivateCA::V1::CertificateAuthority::Type::SUBORDINATE SUBORDINATE}. + # After the parent Certificate Authority signs a certificate signing request + # from + # {::Google::Cloud::Security::PrivateCA::V1::CertificateAuthorityService::Client#fetch_certificate_authority_csr FetchCertificateAuthorityCsr}, + # this method can complete the activation process. + # + # @overload activate_certificate_authority(request, options = nil) + # Pass arguments to `activate_certificate_authority` via a request object, either of type + # {::Google::Cloud::Security::PrivateCA::V1::ActivateCertificateAuthorityRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Security::PrivateCA::V1::ActivateCertificateAuthorityRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. + # + # @overload activate_certificate_authority(name: nil, pem_ca_certificate: nil, subordinate_config: nil, request_id: nil) + # Pass arguments to `activate_certificate_authority` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param name [::String] + # Required. The resource name for this + # {::Google::Cloud::Security::PrivateCA::V1::CertificateAuthority CertificateAuthority} + # in the format `projects/*/locations/*/caPools/*/certificateAuthorities/*`. + # @param pem_ca_certificate [::String] + # Required. The signed CA certificate issued from + # {::Google::Cloud::Security::PrivateCA::V1::FetchCertificateAuthorityCsrResponse#pem_csr FetchCertificateAuthorityCsrResponse.pem_csr}. + # @param subordinate_config [::Google::Cloud::Security::PrivateCA::V1::SubordinateConfig, ::Hash] + # Required. Must include information about the issuer of + # 'pem_ca_certificate', and any further issuers until the self-signed CA. + # @param request_id [::String] + # Optional. An ID to identify requests. Specify a unique request ID so that + # if you must retry your request, the server will know to ignore the request + # if it has already been completed. The server will guarantee that for at + # least 60 minutes since the first request. + # + # For example, consider a situation where you make an initial request and + # the request times out. If you make the request again with the same request + # ID, the server can check if original operation with the same request ID + # was received, and if so, will ignore the second request. This prevents + # clients from accidentally creating duplicate commitments. + # + # The request ID must be a valid UUID with the exception that zero UUID is + # not supported (00000000-0000-0000-0000-000000000000). + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Gapic::Operation] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Gapic::Operation] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/security/private_ca/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Security::PrivateCA::V1::CertificateAuthorityService::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Security::PrivateCA::V1::ActivateCertificateAuthorityRequest.new + # + # # Call the activate_certificate_authority method. + # result = client.activate_certificate_authority 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 activate_certificate_authority request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Security::PrivateCA::V1::ActivateCertificateAuthorityRequest + + # Converts hash 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.activate_certificate_authority.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::Security::PrivateCA::V1::VERSION + metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.name + header_params["name"] = request.name + end + + request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") + metadata[:"x-goog-request-params"] ||= request_params_header + + options.apply_defaults timeout: @config.rpcs.activate_certificate_authority.timeout, + metadata: metadata, + retry_policy: @config.rpcs.activate_certificate_authority.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @certificate_authority_service_stub.call_rpc :activate_certificate_authority, 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 + + ## + # Create a new + # {::Google::Cloud::Security::PrivateCA::V1::CertificateAuthority CertificateAuthority} + # in a given Project and Location. + # + # @overload create_certificate_authority(request, options = nil) + # Pass arguments to `create_certificate_authority` via a request object, either of type + # {::Google::Cloud::Security::PrivateCA::V1::CreateCertificateAuthorityRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Security::PrivateCA::V1::CreateCertificateAuthorityRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_certificate_authority(parent: nil, certificate_authority_id: nil, certificate_authority: nil, request_id: nil) + # Pass arguments to `create_certificate_authority` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param parent [::String] + # Required. The resource name of the + # {::Google::Cloud::Security::PrivateCA::V1::CaPool CaPool} associated with the + # {::Google::Cloud::Security::PrivateCA::V1::CertificateAuthority CertificateAuthorities}, + # in the format `projects/*/locations/*/caPools/*`. + # @param certificate_authority_id [::String] + # Required. It must be unique within a location and match the regular + # expression `[a-zA-Z0-9_-]{1,63}` + # @param certificate_authority [::Google::Cloud::Security::PrivateCA::V1::CertificateAuthority, ::Hash] + # Required. A + # {::Google::Cloud::Security::PrivateCA::V1::CertificateAuthority CertificateAuthority} + # with initial field values. + # @param request_id [::String] + # Optional. An ID to identify requests. Specify a unique request ID so that + # if you must retry your request, the server will know to ignore the request + # if it has already been completed. The server will guarantee that for at + # least 60 minutes since the first request. + # + # For example, consider a situation where you make an initial request and + # the request times out. If you make the request again with the same request + # ID, the server can check if original operation with the same request ID + # was received, and if so, will ignore the second request. This prevents + # clients from accidentally creating duplicate commitments. + # + # The request ID must be a valid UUID with the exception that zero UUID is + # not supported (00000000-0000-0000-0000-000000000000). + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Gapic::Operation] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Gapic::Operation] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/security/private_ca/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Security::PrivateCA::V1::CertificateAuthorityService::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Security::PrivateCA::V1::CreateCertificateAuthorityRequest.new + # + # # Call the create_certificate_authority method. + # result = client.create_certificate_authority 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_certificate_authority request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Security::PrivateCA::V1::CreateCertificateAuthorityRequest + + # Converts hash 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_certificate_authority.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::Security::PrivateCA::V1::VERSION + metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.parent + header_params["parent"] = request.parent + end + + request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") + metadata[:"x-goog-request-params"] ||= request_params_header + + options.apply_defaults timeout: @config.rpcs.create_certificate_authority.timeout, + metadata: metadata, + retry_policy: @config.rpcs.create_certificate_authority.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @certificate_authority_service_stub.call_rpc :create_certificate_authority, 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 + + ## + # Disable a + # {::Google::Cloud::Security::PrivateCA::V1::CertificateAuthority CertificateAuthority}. + # + # @overload disable_certificate_authority(request, options = nil) + # Pass arguments to `disable_certificate_authority` via a request object, either of type + # {::Google::Cloud::Security::PrivateCA::V1::DisableCertificateAuthorityRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Security::PrivateCA::V1::DisableCertificateAuthorityRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. + # + # @overload disable_certificate_authority(name: nil, request_id: nil, ignore_dependent_resources: nil) + # Pass arguments to `disable_certificate_authority` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param name [::String] + # Required. The resource name for this + # {::Google::Cloud::Security::PrivateCA::V1::CertificateAuthority CertificateAuthority} + # in the format `projects/*/locations/*/caPools/*/certificateAuthorities/*`. + # @param request_id [::String] + # Optional. An ID to identify requests. Specify a unique request ID so that + # if you must retry your request, the server will know to ignore the request + # if it has already been completed. The server will guarantee that for at + # least 60 minutes since the first request. + # + # For example, consider a situation where you make an initial request and + # the request times out. If you make the request again with the same request + # ID, the server can check if original operation with the same request ID + # was received, and if so, will ignore the second request. This prevents + # clients from accidentally creating duplicate commitments. + # + # The request ID must be a valid UUID with the exception that zero UUID is + # not supported (00000000-0000-0000-0000-000000000000). + # @param ignore_dependent_resources [::Boolean] + # Optional. This field allows this CA to be disabled even if it's being + # depended on by another resource. However, doing so may result in unintended + # and unrecoverable effects on any dependent resources since the CA will + # no longer be able to issue certificates. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Gapic::Operation] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Gapic::Operation] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/security/private_ca/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Security::PrivateCA::V1::CertificateAuthorityService::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Security::PrivateCA::V1::DisableCertificateAuthorityRequest.new + # + # # Call the disable_certificate_authority method. + # result = client.disable_certificate_authority 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 disable_certificate_authority request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Security::PrivateCA::V1::DisableCertificateAuthorityRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + metadata = @config.rpcs.disable_certificate_authority.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::Security::PrivateCA::V1::VERSION + metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.name + header_params["name"] = request.name + end + + request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") + metadata[:"x-goog-request-params"] ||= request_params_header + + options.apply_defaults timeout: @config.rpcs.disable_certificate_authority.timeout, + metadata: metadata, + retry_policy: @config.rpcs.disable_certificate_authority.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @certificate_authority_service_stub.call_rpc :disable_certificate_authority, 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 + + ## + # Enable a + # {::Google::Cloud::Security::PrivateCA::V1::CertificateAuthority CertificateAuthority}. + # + # @overload enable_certificate_authority(request, options = nil) + # Pass arguments to `enable_certificate_authority` via a request object, either of type + # {::Google::Cloud::Security::PrivateCA::V1::EnableCertificateAuthorityRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Security::PrivateCA::V1::EnableCertificateAuthorityRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. + # + # @overload enable_certificate_authority(name: nil, request_id: nil) + # Pass arguments to `enable_certificate_authority` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param name [::String] + # Required. The resource name for this + # {::Google::Cloud::Security::PrivateCA::V1::CertificateAuthority CertificateAuthority} + # in the format `projects/*/locations/*/caPools/*/certificateAuthorities/*`. + # @param request_id [::String] + # Optional. An ID to identify requests. Specify a unique request ID so that + # if you must retry your request, the server will know to ignore the request + # if it has already been completed. The server will guarantee that for at + # least 60 minutes since the first request. + # + # For example, consider a situation where you make an initial request and + # the request times out. If you make the request again with the same request + # ID, the server can check if original operation with the same request ID + # was received, and if so, will ignore the second request. This prevents + # clients from accidentally creating duplicate commitments. + # + # The request ID must be a valid UUID with the exception that zero UUID is + # not supported (00000000-0000-0000-0000-000000000000). + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Gapic::Operation] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Gapic::Operation] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/security/private_ca/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Security::PrivateCA::V1::CertificateAuthorityService::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Security::PrivateCA::V1::EnableCertificateAuthorityRequest.new + # + # # Call the enable_certificate_authority method. + # result = client.enable_certificate_authority 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 enable_certificate_authority request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Security::PrivateCA::V1::EnableCertificateAuthorityRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + metadata = @config.rpcs.enable_certificate_authority.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::Security::PrivateCA::V1::VERSION + metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.name + header_params["name"] = request.name + end + + request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") + metadata[:"x-goog-request-params"] ||= request_params_header + + options.apply_defaults timeout: @config.rpcs.enable_certificate_authority.timeout, + metadata: metadata, + retry_policy: @config.rpcs.enable_certificate_authority.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @certificate_authority_service_stub.call_rpc :enable_certificate_authority, 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 + + ## + # Fetch a certificate signing request (CSR) from a + # {::Google::Cloud::Security::PrivateCA::V1::CertificateAuthority CertificateAuthority} + # that is in state + # {::Google::Cloud::Security::PrivateCA::V1::CertificateAuthority::State::AWAITING_USER_ACTIVATION AWAITING_USER_ACTIVATION} + # and is of type + # {::Google::Cloud::Security::PrivateCA::V1::CertificateAuthority::Type::SUBORDINATE SUBORDINATE}. + # The CSR must then be signed by the desired parent Certificate Authority, + # which could be another + # {::Google::Cloud::Security::PrivateCA::V1::CertificateAuthority CertificateAuthority} + # resource, or could be an on-prem certificate authority. See also + # {::Google::Cloud::Security::PrivateCA::V1::CertificateAuthorityService::Client#activate_certificate_authority ActivateCertificateAuthority}. + # + # @overload fetch_certificate_authority_csr(request, options = nil) + # Pass arguments to `fetch_certificate_authority_csr` via a request object, either of type + # {::Google::Cloud::Security::PrivateCA::V1::FetchCertificateAuthorityCsrRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Security::PrivateCA::V1::FetchCertificateAuthorityCsrRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. + # + # @overload fetch_certificate_authority_csr(name: nil) + # Pass arguments to `fetch_certificate_authority_csr` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param name [::String] + # Required. The resource name for this + # {::Google::Cloud::Security::PrivateCA::V1::CertificateAuthority CertificateAuthority} + # in the format `projects/*/locations/*/caPools/*/certificateAuthorities/*`. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Google::Cloud::Security::PrivateCA::V1::FetchCertificateAuthorityCsrResponse] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Google::Cloud::Security::PrivateCA::V1::FetchCertificateAuthorityCsrResponse] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/security/private_ca/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Security::PrivateCA::V1::CertificateAuthorityService::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Security::PrivateCA::V1::FetchCertificateAuthorityCsrRequest.new + # + # # Call the fetch_certificate_authority_csr method. + # result = client.fetch_certificate_authority_csr request + # + # # The returned object is of type Google::Cloud::Security::PrivateCA::V1::FetchCertificateAuthorityCsrResponse. + # p result + # + def fetch_certificate_authority_csr request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Security::PrivateCA::V1::FetchCertificateAuthorityCsrRequest + + # Converts hash 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.fetch_certificate_authority_csr.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::Security::PrivateCA::V1::VERSION + metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.name + header_params["name"] = request.name + end + + request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") + metadata[:"x-goog-request-params"] ||= request_params_header + + options.apply_defaults timeout: @config.rpcs.fetch_certificate_authority_csr.timeout, + metadata: metadata, + retry_policy: @config.rpcs.fetch_certificate_authority_csr.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @certificate_authority_service_stub.call_rpc :fetch_certificate_authority_csr, request, options: options do |response, operation| + yield response, operation if block_given? + end + rescue ::GRPC::BadStatus => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Returns a + # {::Google::Cloud::Security::PrivateCA::V1::CertificateAuthority CertificateAuthority}. + # + # @overload get_certificate_authority(request, options = nil) + # Pass arguments to `get_certificate_authority` via a request object, either of type + # {::Google::Cloud::Security::PrivateCA::V1::GetCertificateAuthorityRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Security::PrivateCA::V1::GetCertificateAuthorityRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_certificate_authority(name: nil) + # Pass arguments to `get_certificate_authority` via keyword arguments. Note that at + # least one keyword argument is 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 + # {::Google::Cloud::Security::PrivateCA::V1::CertificateAuthority#name name} of the + # {::Google::Cloud::Security::PrivateCA::V1::CertificateAuthority CertificateAuthority} + # to get. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Google::Cloud::Security::PrivateCA::V1::CertificateAuthority] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Google::Cloud::Security::PrivateCA::V1::CertificateAuthority] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/security/private_ca/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Security::PrivateCA::V1::CertificateAuthorityService::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Security::PrivateCA::V1::GetCertificateAuthorityRequest.new + # + # # Call the get_certificate_authority method. + # result = client.get_certificate_authority request + # + # # The returned object is of type Google::Cloud::Security::PrivateCA::V1::CertificateAuthority. + # p result + # + def get_certificate_authority request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Security::PrivateCA::V1::GetCertificateAuthorityRequest + + # Converts hash 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_certificate_authority.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::Security::PrivateCA::V1::VERSION + metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.name + header_params["name"] = request.name + end + + request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") + metadata[:"x-goog-request-params"] ||= request_params_header + + options.apply_defaults timeout: @config.rpcs.get_certificate_authority.timeout, + metadata: metadata, + retry_policy: @config.rpcs.get_certificate_authority.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @certificate_authority_service_stub.call_rpc :get_certificate_authority, request, options: options do |response, operation| + yield response, operation if block_given? + end + rescue ::GRPC::BadStatus => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Lists + # {::Google::Cloud::Security::PrivateCA::V1::CertificateAuthority CertificateAuthorities}. + # + # @overload list_certificate_authorities(request, options = nil) + # Pass arguments to `list_certificate_authorities` via a request object, either of type + # {::Google::Cloud::Security::PrivateCA::V1::ListCertificateAuthoritiesRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Security::PrivateCA::V1::ListCertificateAuthoritiesRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_certificate_authorities(parent: nil, page_size: nil, page_token: nil, filter: nil, order_by: nil) + # Pass arguments to `list_certificate_authorities` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param parent [::String] + # Required. The resource name of the + # {::Google::Cloud::Security::PrivateCA::V1::CaPool CaPool} associated with the + # {::Google::Cloud::Security::PrivateCA::V1::CertificateAuthority CertificateAuthorities}, + # in the format `projects/*/locations/*/caPools/*`. + # @param page_size [::Integer] + # Optional. Limit on the number of + # {::Google::Cloud::Security::PrivateCA::V1::CertificateAuthority CertificateAuthorities} + # to include in the response. Further + # {::Google::Cloud::Security::PrivateCA::V1::CertificateAuthority CertificateAuthorities} + # can subsequently be obtained by including the + # {::Google::Cloud::Security::PrivateCA::V1::ListCertificateAuthoritiesResponse#next_page_token ListCertificateAuthoritiesResponse.next_page_token} + # in a subsequent request. If unspecified, the server will pick an + # appropriate default. + # @param page_token [::String] + # Optional. Pagination token, returned earlier via + # {::Google::Cloud::Security::PrivateCA::V1::ListCertificateAuthoritiesResponse#next_page_token ListCertificateAuthoritiesResponse.next_page_token}. + # @param filter [::String] + # Optional. Only include resources that match the filter in the response. + # @param order_by [::String] + # Optional. Specify how the results should be sorted. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Gapic::PagedEnumerable<::Google::Cloud::Security::PrivateCA::V1::CertificateAuthority>] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Gapic::PagedEnumerable<::Google::Cloud::Security::PrivateCA::V1::CertificateAuthority>] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/security/private_ca/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Security::PrivateCA::V1::CertificateAuthorityService::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Security::PrivateCA::V1::ListCertificateAuthoritiesRequest.new + # + # # Call the list_certificate_authorities method. + # result = client.list_certificate_authorities request + # + # # The returned object is of type Gapic::PagedEnumerable. You can iterate + # # over elements, and API calls will be issued to fetch pages as needed. + # result.each do |item| + # # Each element is of type ::Google::Cloud::Security::PrivateCA::V1::CertificateAuthority. + # p item + # end + # + def list_certificate_authorities request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Security::PrivateCA::V1::ListCertificateAuthoritiesRequest + + # Converts hash 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_certificate_authorities.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::Security::PrivateCA::V1::VERSION + metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.parent + header_params["parent"] = request.parent + end + + request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") + metadata[:"x-goog-request-params"] ||= request_params_header + + options.apply_defaults timeout: @config.rpcs.list_certificate_authorities.timeout, + metadata: metadata, + retry_policy: @config.rpcs.list_certificate_authorities.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @certificate_authority_service_stub.call_rpc :list_certificate_authorities, request, options: options do |response, operation| + response = ::Gapic::PagedEnumerable.new @certificate_authority_service_stub, :list_certificate_authorities, 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 + + ## + # Undelete a + # {::Google::Cloud::Security::PrivateCA::V1::CertificateAuthority CertificateAuthority} + # that has been deleted. + # + # @overload undelete_certificate_authority(request, options = nil) + # Pass arguments to `undelete_certificate_authority` via a request object, either of type + # {::Google::Cloud::Security::PrivateCA::V1::UndeleteCertificateAuthorityRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Security::PrivateCA::V1::UndeleteCertificateAuthorityRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. + # + # @overload undelete_certificate_authority(name: nil, request_id: nil) + # Pass arguments to `undelete_certificate_authority` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param name [::String] + # Required. The resource name for this + # {::Google::Cloud::Security::PrivateCA::V1::CertificateAuthority CertificateAuthority} + # in the format `projects/*/locations/*/caPools/*/certificateAuthorities/*`. + # @param request_id [::String] + # Optional. An ID to identify requests. Specify a unique request ID so that + # if you must retry your request, the server will know to ignore the request + # if it has already been completed. The server will guarantee that for at + # least 60 minutes since the first request. + # + # For example, consider a situation where you make an initial request and + # the request times out. If you make the request again with the same request + # ID, the server can check if original operation with the same request ID + # was received, and if so, will ignore the second request. This prevents + # clients from accidentally creating duplicate commitments. + # + # The request ID must be a valid UUID with the exception that zero UUID is + # not supported (00000000-0000-0000-0000-000000000000). + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Gapic::Operation] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Gapic::Operation] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/security/private_ca/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Security::PrivateCA::V1::CertificateAuthorityService::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Security::PrivateCA::V1::UndeleteCertificateAuthorityRequest.new + # + # # Call the undelete_certificate_authority method. + # result = client.undelete_certificate_authority 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 undelete_certificate_authority request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Security::PrivateCA::V1::UndeleteCertificateAuthorityRequest + + # Converts hash 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.undelete_certificate_authority.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::Security::PrivateCA::V1::VERSION + metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.name + header_params["name"] = request.name + end + + request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") + metadata[:"x-goog-request-params"] ||= request_params_header + + options.apply_defaults timeout: @config.rpcs.undelete_certificate_authority.timeout, + metadata: metadata, + retry_policy: @config.rpcs.undelete_certificate_authority.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @certificate_authority_service_stub.call_rpc :undelete_certificate_authority, 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 + + ## + # Delete a + # {::Google::Cloud::Security::PrivateCA::V1::CertificateAuthority CertificateAuthority}. + # + # @overload delete_certificate_authority(request, options = nil) + # Pass arguments to `delete_certificate_authority` via a request object, either of type + # {::Google::Cloud::Security::PrivateCA::V1::DeleteCertificateAuthorityRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Security::PrivateCA::V1::DeleteCertificateAuthorityRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_certificate_authority(name: nil, request_id: nil, ignore_active_certificates: nil, skip_grace_period: nil, ignore_dependent_resources: nil) + # Pass arguments to `delete_certificate_authority` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param name [::String] + # Required. The resource name for this + # {::Google::Cloud::Security::PrivateCA::V1::CertificateAuthority CertificateAuthority} + # in the format `projects/*/locations/*/caPools/*/certificateAuthorities/*`. + # @param request_id [::String] + # Optional. An ID to identify requests. Specify a unique request ID so that + # if you must retry your request, the server will know to ignore the request + # if it has already been completed. The server will guarantee that for at + # least 60 minutes since the first request. + # + # For example, consider a situation where you make an initial request and + # the request times out. If you make the request again with the same request + # ID, the server can check if original operation with the same request ID + # was received, and if so, will ignore the second request. This prevents + # clients from accidentally creating duplicate commitments. + # + # The request ID must be a valid UUID with the exception that zero UUID is + # not supported (00000000-0000-0000-0000-000000000000). + # @param ignore_active_certificates [::Boolean] + # Optional. This field allows the CA to be deleted even if the CA has + # active certs. Active certs include both unrevoked and unexpired certs. + # @param skip_grace_period [::Boolean] + # Optional. If this flag is set, the Certificate Authority will be deleted as + # soon as possible without a 30-day grace period where undeletion would have + # been allowed. If you proceed, there will be no way to recover this CA. + # @param ignore_dependent_resources [::Boolean] + # Optional. This field allows this CA to be deleted even if it's being + # depended on by another resource. However, doing so may result in unintended + # and unrecoverable effects on any dependent resources since the CA will + # no longer be able to issue certificates. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Gapic::Operation] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Gapic::Operation] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/security/private_ca/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Security::PrivateCA::V1::CertificateAuthorityService::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Security::PrivateCA::V1::DeleteCertificateAuthorityRequest.new + # + # # Call the delete_certificate_authority method. + # result = client.delete_certificate_authority 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_certificate_authority request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Security::PrivateCA::V1::DeleteCertificateAuthorityRequest + + # Converts hash 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_certificate_authority.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::Security::PrivateCA::V1::VERSION + metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.name + header_params["name"] = request.name + end + + request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") + metadata[:"x-goog-request-params"] ||= request_params_header + + options.apply_defaults timeout: @config.rpcs.delete_certificate_authority.timeout, + metadata: metadata, + retry_policy: @config.rpcs.delete_certificate_authority.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @certificate_authority_service_stub.call_rpc :delete_certificate_authority, 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 + + ## + # Update a + # {::Google::Cloud::Security::PrivateCA::V1::CertificateAuthority CertificateAuthority}. + # + # @overload update_certificate_authority(request, options = nil) + # Pass arguments to `update_certificate_authority` via a request object, either of type + # {::Google::Cloud::Security::PrivateCA::V1::UpdateCertificateAuthorityRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Security::PrivateCA::V1::UpdateCertificateAuthorityRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_certificate_authority(certificate_authority: nil, update_mask: nil, request_id: nil) + # Pass arguments to `update_certificate_authority` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param certificate_authority [::Google::Cloud::Security::PrivateCA::V1::CertificateAuthority, ::Hash] + # Required. + # {::Google::Cloud::Security::PrivateCA::V1::CertificateAuthority CertificateAuthority} + # with updated values. + # @param update_mask [::Google::Protobuf::FieldMask, ::Hash] + # Required. A list of fields to be updated in this request. + # @param request_id [::String] + # Optional. An ID to identify requests. Specify a unique request ID so that + # if you must retry your request, the server will know to ignore the request + # if it has already been completed. The server will guarantee that for at + # least 60 minutes since the first request. + # + # For example, consider a situation where you make an initial request and + # the request times out. If you make the request again with the same request + # ID, the server can check if original operation with the same request ID + # was received, and if so, will ignore the second request. This prevents + # clients from accidentally creating duplicate commitments. + # + # The request ID must be a valid UUID with the exception that zero UUID is + # not supported (00000000-0000-0000-0000-000000000000). + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Gapic::Operation] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Gapic::Operation] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/security/private_ca/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Security::PrivateCA::V1::CertificateAuthorityService::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Security::PrivateCA::V1::UpdateCertificateAuthorityRequest.new + # + # # Call the update_certificate_authority method. + # result = client.update_certificate_authority 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_certificate_authority request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Security::PrivateCA::V1::UpdateCertificateAuthorityRequest + + # Converts hash 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_certificate_authority.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::Security::PrivateCA::V1::VERSION + metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.certificate_authority&.name + header_params["certificate_authority.name"] = request.certificate_authority.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_certificate_authority.timeout, + metadata: metadata, + retry_policy: @config.rpcs.update_certificate_authority.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @certificate_authority_service_stub.call_rpc :update_certificate_authority, 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 + + ## + # Create a {::Google::Cloud::Security::PrivateCA::V1::CaPool CaPool}. + # + # @overload create_ca_pool(request, options = nil) + # Pass arguments to `create_ca_pool` via a request object, either of type + # {::Google::Cloud::Security::PrivateCA::V1::CreateCaPoolRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Security::PrivateCA::V1::CreateCaPoolRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_ca_pool(parent: nil, ca_pool_id: nil, ca_pool: nil, request_id: nil) + # Pass arguments to `create_ca_pool` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param parent [::String] + # Required. The resource name of the location associated with the + # {::Google::Cloud::Security::PrivateCA::V1::CaPool CaPool}, in the format + # `projects/*/locations/*`. + # @param ca_pool_id [::String] + # Required. It must be unique within a location and match the regular + # expression `[a-zA-Z0-9_-]{1,63}` + # @param ca_pool [::Google::Cloud::Security::PrivateCA::V1::CaPool, ::Hash] + # Required. A {::Google::Cloud::Security::PrivateCA::V1::CaPool CaPool} with + # initial field values. + # @param request_id [::String] + # Optional. An ID to identify requests. Specify a unique request ID so that + # if you must retry your request, the server will know to ignore the request + # if it has already been completed. The server will guarantee that for at + # least 60 minutes since the first request. + # + # For example, consider a situation where you make an initial request and + # the request times out. If you make the request again with the same request + # ID, the server can check if original operation with the same request ID + # was received, and if so, will ignore the second request. This prevents + # clients from accidentally creating duplicate commitments. + # + # The request ID must be a valid UUID with the exception that zero UUID is + # not supported (00000000-0000-0000-0000-000000000000). + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Gapic::Operation] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Gapic::Operation] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/security/private_ca/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Security::PrivateCA::V1::CertificateAuthorityService::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Security::PrivateCA::V1::CreateCaPoolRequest.new + # + # # Call the create_ca_pool method. + # result = client.create_ca_pool 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_ca_pool request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Security::PrivateCA::V1::CreateCaPoolRequest + + # Converts hash 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_ca_pool.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::Security::PrivateCA::V1::VERSION + metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.parent + header_params["parent"] = request.parent + end + + request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") + metadata[:"x-goog-request-params"] ||= request_params_header + + options.apply_defaults timeout: @config.rpcs.create_ca_pool.timeout, + metadata: metadata, + retry_policy: @config.rpcs.create_ca_pool.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @certificate_authority_service_stub.call_rpc :create_ca_pool, 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 + + ## + # Update a {::Google::Cloud::Security::PrivateCA::V1::CaPool CaPool}. + # + # @overload update_ca_pool(request, options = nil) + # Pass arguments to `update_ca_pool` via a request object, either of type + # {::Google::Cloud::Security::PrivateCA::V1::UpdateCaPoolRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Security::PrivateCA::V1::UpdateCaPoolRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_ca_pool(ca_pool: nil, update_mask: nil, request_id: nil) + # Pass arguments to `update_ca_pool` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param ca_pool [::Google::Cloud::Security::PrivateCA::V1::CaPool, ::Hash] + # Required. {::Google::Cloud::Security::PrivateCA::V1::CaPool CaPool} with updated + # values. + # @param update_mask [::Google::Protobuf::FieldMask, ::Hash] + # Required. A list of fields to be updated in this request. + # @param request_id [::String] + # Optional. An ID to identify requests. Specify a unique request ID so that + # if you must retry your request, the server will know to ignore the request + # if it has already been completed. The server will guarantee that for at + # least 60 minutes since the first request. + # + # For example, consider a situation where you make an initial request and + # the request times out. If you make the request again with the same request + # ID, the server can check if original operation with the same request ID + # was received, and if so, will ignore the second request. This prevents + # clients from accidentally creating duplicate commitments. + # + # The request ID must be a valid UUID with the exception that zero UUID is + # not supported (00000000-0000-0000-0000-000000000000). + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Gapic::Operation] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Gapic::Operation] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/security/private_ca/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Security::PrivateCA::V1::CertificateAuthorityService::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Security::PrivateCA::V1::UpdateCaPoolRequest.new + # + # # Call the update_ca_pool method. + # result = client.update_ca_pool 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_ca_pool request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Security::PrivateCA::V1::UpdateCaPoolRequest + + # Converts hash 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_ca_pool.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::Security::PrivateCA::V1::VERSION + metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.ca_pool&.name + header_params["ca_pool.name"] = request.ca_pool.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_ca_pool.timeout, + metadata: metadata, + retry_policy: @config.rpcs.update_ca_pool.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @certificate_authority_service_stub.call_rpc :update_ca_pool, request, options: options do |response, operation| + response = ::Gapic::Operation.new response, @operations_client, options: options + yield response, operation if block_given? + throw :response, response + end + rescue ::GRPC::BadStatus => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Returns a {::Google::Cloud::Security::PrivateCA::V1::CaPool CaPool}. + # + # @overload get_ca_pool(request, options = nil) + # Pass arguments to `get_ca_pool` via a request object, either of type + # {::Google::Cloud::Security::PrivateCA::V1::GetCaPoolRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Security::PrivateCA::V1::GetCaPoolRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_ca_pool(name: nil) + # Pass arguments to `get_ca_pool` via keyword arguments. Note that at + # least one keyword argument is 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 {::Google::Cloud::Security::PrivateCA::V1::CaPool#name name} of the + # {::Google::Cloud::Security::PrivateCA::V1::CaPool CaPool} to get. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Google::Cloud::Security::PrivateCA::V1::CaPool] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Google::Cloud::Security::PrivateCA::V1::CaPool] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/security/private_ca/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Security::PrivateCA::V1::CertificateAuthorityService::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Security::PrivateCA::V1::GetCaPoolRequest.new + # + # # Call the get_ca_pool method. + # result = client.get_ca_pool request + # + # # The returned object is of type Google::Cloud::Security::PrivateCA::V1::CaPool. + # p result + # + def get_ca_pool request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Security::PrivateCA::V1::GetCaPoolRequest + + # Converts hash 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_ca_pool.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::Security::PrivateCA::V1::VERSION + metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.name + header_params["name"] = request.name + end + + request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") + metadata[:"x-goog-request-params"] ||= request_params_header + + options.apply_defaults timeout: @config.rpcs.get_ca_pool.timeout, + metadata: metadata, + retry_policy: @config.rpcs.get_ca_pool.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @certificate_authority_service_stub.call_rpc :get_ca_pool, request, options: options do |response, operation| + yield response, operation if block_given? + end + rescue ::GRPC::BadStatus => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Lists {::Google::Cloud::Security::PrivateCA::V1::CaPool CaPools}. + # + # @overload list_ca_pools(request, options = nil) + # Pass arguments to `list_ca_pools` via a request object, either of type + # {::Google::Cloud::Security::PrivateCA::V1::ListCaPoolsRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Security::PrivateCA::V1::ListCaPoolsRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_ca_pools(parent: nil, page_size: nil, page_token: nil, filter: nil, order_by: nil) + # Pass arguments to `list_ca_pools` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param parent [::String] + # Required. The resource name of the location associated with the + # {::Google::Cloud::Security::PrivateCA::V1::CaPool CaPools}, in the format + # `projects/*/locations/*`. + # @param page_size [::Integer] + # Optional. Limit on the number of + # {::Google::Cloud::Security::PrivateCA::V1::CaPool CaPools} to include in the + # response. Further {::Google::Cloud::Security::PrivateCA::V1::CaPool CaPools} can + # subsequently be obtained by including the + # {::Google::Cloud::Security::PrivateCA::V1::ListCaPoolsResponse#next_page_token ListCaPoolsResponse.next_page_token} + # in a subsequent request. If unspecified, the server will pick an + # appropriate default. + # @param page_token [::String] + # Optional. Pagination token, returned earlier via + # {::Google::Cloud::Security::PrivateCA::V1::ListCaPoolsResponse#next_page_token ListCaPoolsResponse.next_page_token}. + # @param filter [::String] + # Optional. Only include resources that match the filter in the response. + # @param order_by [::String] + # Optional. Specify how the results should be sorted. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Gapic::PagedEnumerable<::Google::Cloud::Security::PrivateCA::V1::CaPool>] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Gapic::PagedEnumerable<::Google::Cloud::Security::PrivateCA::V1::CaPool>] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/security/private_ca/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Security::PrivateCA::V1::CertificateAuthorityService::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Security::PrivateCA::V1::ListCaPoolsRequest.new + # + # # Call the list_ca_pools method. + # result = client.list_ca_pools request + # + # # The returned object is of type Gapic::PagedEnumerable. You can iterate + # # over elements, and API calls will be issued to fetch pages as needed. + # result.each do |item| + # # Each element is of type ::Google::Cloud::Security::PrivateCA::V1::CaPool. + # p item + # end + # + def list_ca_pools request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Security::PrivateCA::V1::ListCaPoolsRequest + + # Converts hash 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_ca_pools.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::Security::PrivateCA::V1::VERSION + metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.parent + header_params["parent"] = request.parent + end + + request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") + metadata[:"x-goog-request-params"] ||= request_params_header + + options.apply_defaults timeout: @config.rpcs.list_ca_pools.timeout, + metadata: metadata, + retry_policy: @config.rpcs.list_ca_pools.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @certificate_authority_service_stub.call_rpc :list_ca_pools, request, options: options do |response, operation| + response = ::Gapic::PagedEnumerable.new @certificate_authority_service_stub, :list_ca_pools, 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 + + ## + # Delete a {::Google::Cloud::Security::PrivateCA::V1::CaPool CaPool}. + # + # @overload delete_ca_pool(request, options = nil) + # Pass arguments to `delete_ca_pool` via a request object, either of type + # {::Google::Cloud::Security::PrivateCA::V1::DeleteCaPoolRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Security::PrivateCA::V1::DeleteCaPoolRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_ca_pool(name: nil, request_id: nil, ignore_dependent_resources: nil) + # Pass arguments to `delete_ca_pool` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param name [::String] + # Required. The resource name for this + # {::Google::Cloud::Security::PrivateCA::V1::CaPool CaPool} in the format + # `projects/*/locations/*/caPools/*`. + # @param request_id [::String] + # Optional. An ID to identify requests. Specify a unique request ID so that + # if you must retry your request, the server will know to ignore the request + # if it has already been completed. The server will guarantee that for at + # least 60 minutes since the first request. + # + # For example, consider a situation where you make an initial request and + # the request times out. If you make the request again with the same request + # ID, the server can check if original operation with the same request ID + # was received, and if so, will ignore the second request. This prevents + # clients from accidentally creating duplicate commitments. + # + # The request ID must be a valid UUID with the exception that zero UUID is + # not supported (00000000-0000-0000-0000-000000000000). + # @param ignore_dependent_resources [::Boolean] + # Optional. This field allows this pool to be deleted even if it's being + # depended on by another resource. However, doing so may result in unintended + # and unrecoverable effects on any dependent resources since the pool will + # no longer be able to issue certificates. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Gapic::Operation] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Gapic::Operation] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/security/private_ca/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Security::PrivateCA::V1::CertificateAuthorityService::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Security::PrivateCA::V1::DeleteCaPoolRequest.new + # + # # Call the delete_ca_pool method. + # result = client.delete_ca_pool 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_ca_pool request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Security::PrivateCA::V1::DeleteCaPoolRequest + + # Converts hash 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_ca_pool.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::Security::PrivateCA::V1::VERSION + metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.name + header_params["name"] = request.name + end + + request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") + metadata[:"x-goog-request-params"] ||= request_params_header + + options.apply_defaults timeout: @config.rpcs.delete_ca_pool.timeout, + metadata: metadata, + retry_policy: @config.rpcs.delete_ca_pool.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @certificate_authority_service_stub.call_rpc :delete_ca_pool, 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 + + ## + # FetchCaCerts returns the current trust anchor for the + # {::Google::Cloud::Security::PrivateCA::V1::CaPool CaPool}. This will include CA + # certificate chains for all certificate authorities in the ENABLED, + # DISABLED, or STAGED states. + # + # @overload fetch_ca_certs(request, options = nil) + # Pass arguments to `fetch_ca_certs` via a request object, either of type + # {::Google::Cloud::Security::PrivateCA::V1::FetchCaCertsRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Security::PrivateCA::V1::FetchCaCertsRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. + # + # @overload fetch_ca_certs(ca_pool: nil, request_id: nil) + # Pass arguments to `fetch_ca_certs` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param ca_pool [::String] + # Required. The resource name for the + # {::Google::Cloud::Security::PrivateCA::V1::CaPool CaPool} in the format + # `projects/*/locations/*/caPools/*`. + # @param request_id [::String] + # Optional. An ID to identify requests. Specify a unique request ID so that + # if you must retry your request, the server will know to ignore the request + # if it has already been completed. The server will guarantee that for at + # least 60 minutes since the first request. + # + # For example, consider a situation where you make an initial request and + # the request times out. If you make the request again with the same request + # ID, the server can check if original operation with the same request ID + # was received, and if so, will ignore the second request. This prevents + # clients from accidentally creating duplicate commitments. + # + # The request ID must be a valid UUID with the exception that zero UUID is + # not supported (00000000-0000-0000-0000-000000000000). + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Google::Cloud::Security::PrivateCA::V1::FetchCaCertsResponse] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Google::Cloud::Security::PrivateCA::V1::FetchCaCertsResponse] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/security/private_ca/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Security::PrivateCA::V1::CertificateAuthorityService::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Security::PrivateCA::V1::FetchCaCertsRequest.new + # + # # Call the fetch_ca_certs method. + # result = client.fetch_ca_certs request + # + # # The returned object is of type Google::Cloud::Security::PrivateCA::V1::FetchCaCertsResponse. + # p result + # + def fetch_ca_certs request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Security::PrivateCA::V1::FetchCaCertsRequest + + # Converts hash 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.fetch_ca_certs.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::Security::PrivateCA::V1::VERSION + metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.ca_pool + header_params["ca_pool"] = request.ca_pool + 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.fetch_ca_certs.timeout, + metadata: metadata, + retry_policy: @config.rpcs.fetch_ca_certs.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @certificate_authority_service_stub.call_rpc :fetch_ca_certs, request, options: options do |response, operation| + yield response, operation if block_given? + end + rescue ::GRPC::BadStatus => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Returns a + # {::Google::Cloud::Security::PrivateCA::V1::CertificateRevocationList CertificateRevocationList}. + # + # @overload get_certificate_revocation_list(request, options = nil) + # Pass arguments to `get_certificate_revocation_list` via a request object, either of type + # {::Google::Cloud::Security::PrivateCA::V1::GetCertificateRevocationListRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Security::PrivateCA::V1::GetCertificateRevocationListRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_certificate_revocation_list(name: nil) + # Pass arguments to `get_certificate_revocation_list` via keyword arguments. Note that at + # least one keyword argument is 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 + # {::Google::Cloud::Security::PrivateCA::V1::CertificateRevocationList#name name} + # of the + # {::Google::Cloud::Security::PrivateCA::V1::CertificateRevocationList CertificateRevocationList} + # to get. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Google::Cloud::Security::PrivateCA::V1::CertificateRevocationList] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Google::Cloud::Security::PrivateCA::V1::CertificateRevocationList] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/security/private_ca/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Security::PrivateCA::V1::CertificateAuthorityService::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Security::PrivateCA::V1::GetCertificateRevocationListRequest.new + # + # # Call the get_certificate_revocation_list method. + # result = client.get_certificate_revocation_list request + # + # # The returned object is of type Google::Cloud::Security::PrivateCA::V1::CertificateRevocationList. + # p result + # + def get_certificate_revocation_list request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Security::PrivateCA::V1::GetCertificateRevocationListRequest + + # Converts hash 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_certificate_revocation_list.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::Security::PrivateCA::V1::VERSION + metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.name + header_params["name"] = request.name + end + + request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") + metadata[:"x-goog-request-params"] ||= request_params_header + + options.apply_defaults timeout: @config.rpcs.get_certificate_revocation_list.timeout, + metadata: metadata, + retry_policy: @config.rpcs.get_certificate_revocation_list.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @certificate_authority_service_stub.call_rpc :get_certificate_revocation_list, request, options: options do |response, operation| + yield response, operation if block_given? + end + rescue ::GRPC::BadStatus => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Lists + # {::Google::Cloud::Security::PrivateCA::V1::CertificateRevocationList CertificateRevocationLists}. + # + # @overload list_certificate_revocation_lists(request, options = nil) + # Pass arguments to `list_certificate_revocation_lists` via a request object, either of type + # {::Google::Cloud::Security::PrivateCA::V1::ListCertificateRevocationListsRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Security::PrivateCA::V1::ListCertificateRevocationListsRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_certificate_revocation_lists(parent: nil, page_size: nil, page_token: nil, filter: nil, order_by: nil) + # Pass arguments to `list_certificate_revocation_lists` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param parent [::String] + # Required. The resource name of the location associated with the + # {::Google::Cloud::Security::PrivateCA::V1::CertificateRevocationList CertificateRevocationLists}, + # in the format `projects/*/locations/*/caPools/*/certificateAuthorities/*`. + # @param page_size [::Integer] + # Optional. Limit on the number of + # {::Google::Cloud::Security::PrivateCA::V1::CertificateRevocationList CertificateRevocationLists} + # to include in the response. Further + # {::Google::Cloud::Security::PrivateCA::V1::CertificateRevocationList CertificateRevocationLists} + # can subsequently be obtained by including the + # {::Google::Cloud::Security::PrivateCA::V1::ListCertificateRevocationListsResponse#next_page_token ListCertificateRevocationListsResponse.next_page_token} + # in a subsequent request. If unspecified, the server will pick an + # appropriate default. + # @param page_token [::String] + # Optional. Pagination token, returned earlier via + # {::Google::Cloud::Security::PrivateCA::V1::ListCertificateRevocationListsResponse#next_page_token ListCertificateRevocationListsResponse.next_page_token}. + # @param filter [::String] + # Optional. Only include resources that match the filter in the response. + # @param order_by [::String] + # Optional. Specify how the results should be sorted. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Gapic::PagedEnumerable<::Google::Cloud::Security::PrivateCA::V1::CertificateRevocationList>] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Gapic::PagedEnumerable<::Google::Cloud::Security::PrivateCA::V1::CertificateRevocationList>] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/security/private_ca/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Security::PrivateCA::V1::CertificateAuthorityService::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Security::PrivateCA::V1::ListCertificateRevocationListsRequest.new + # + # # Call the list_certificate_revocation_lists method. + # result = client.list_certificate_revocation_lists request + # + # # The returned object is of type Gapic::PagedEnumerable. You can iterate + # # over elements, and API calls will be issued to fetch pages as needed. + # result.each do |item| + # # Each element is of type ::Google::Cloud::Security::PrivateCA::V1::CertificateRevocationList. + # p item + # end + # + def list_certificate_revocation_lists request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Security::PrivateCA::V1::ListCertificateRevocationListsRequest + + # Converts hash 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_certificate_revocation_lists.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::Security::PrivateCA::V1::VERSION + metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.parent + header_params["parent"] = request.parent + end + + request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") + metadata[:"x-goog-request-params"] ||= request_params_header + + options.apply_defaults timeout: @config.rpcs.list_certificate_revocation_lists.timeout, + metadata: metadata, + retry_policy: @config.rpcs.list_certificate_revocation_lists.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @certificate_authority_service_stub.call_rpc :list_certificate_revocation_lists, request, options: options do |response, operation| + response = ::Gapic::PagedEnumerable.new @certificate_authority_service_stub, :list_certificate_revocation_lists, 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 + + ## + # Update a + # {::Google::Cloud::Security::PrivateCA::V1::CertificateRevocationList CertificateRevocationList}. + # + # @overload update_certificate_revocation_list(request, options = nil) + # Pass arguments to `update_certificate_revocation_list` via a request object, either of type + # {::Google::Cloud::Security::PrivateCA::V1::UpdateCertificateRevocationListRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Security::PrivateCA::V1::UpdateCertificateRevocationListRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_certificate_revocation_list(certificate_revocation_list: nil, update_mask: nil, request_id: nil) + # Pass arguments to `update_certificate_revocation_list` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param certificate_revocation_list [::Google::Cloud::Security::PrivateCA::V1::CertificateRevocationList, ::Hash] + # Required. + # {::Google::Cloud::Security::PrivateCA::V1::CertificateRevocationList CertificateRevocationList} + # with updated values. + # @param update_mask [::Google::Protobuf::FieldMask, ::Hash] + # Required. A list of fields to be updated in this request. + # @param request_id [::String] + # Optional. An ID to identify requests. Specify a unique request ID so that + # if you must retry your request, the server will know to ignore the request + # if it has already been completed. The server will guarantee that for at + # least 60 minutes since the first request. + # + # For example, consider a situation where you make an initial request and + # the request times out. If you make the request again with the same request + # ID, the server can check if original operation with the same request ID + # was received, and if so, will ignore the second request. This prevents + # clients from accidentally creating duplicate commitments. + # + # The request ID must be a valid UUID with the exception that zero UUID is + # not supported (00000000-0000-0000-0000-000000000000). + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Gapic::Operation] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Gapic::Operation] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/security/private_ca/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Security::PrivateCA::V1::CertificateAuthorityService::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Security::PrivateCA::V1::UpdateCertificateRevocationListRequest.new + # + # # Call the update_certificate_revocation_list method. + # result = client.update_certificate_revocation_list 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_certificate_revocation_list request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Security::PrivateCA::V1::UpdateCertificateRevocationListRequest + + # Converts hash 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_certificate_revocation_list.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::Security::PrivateCA::V1::VERSION + metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.certificate_revocation_list&.name + header_params["certificate_revocation_list.name"] = request.certificate_revocation_list.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_certificate_revocation_list.timeout, + metadata: metadata, + retry_policy: @config.rpcs.update_certificate_revocation_list.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @certificate_authority_service_stub.call_rpc :update_certificate_revocation_list, 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 + + ## + # Create a new + # {::Google::Cloud::Security::PrivateCA::V1::CertificateTemplate CertificateTemplate} + # in a given Project and Location. + # + # @overload create_certificate_template(request, options = nil) + # Pass arguments to `create_certificate_template` via a request object, either of type + # {::Google::Cloud::Security::PrivateCA::V1::CreateCertificateTemplateRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Security::PrivateCA::V1::CreateCertificateTemplateRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_certificate_template(parent: nil, certificate_template_id: nil, certificate_template: nil, request_id: nil) + # Pass arguments to `create_certificate_template` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param parent [::String] + # Required. The resource name of the location associated with the + # {::Google::Cloud::Security::PrivateCA::V1::CertificateTemplate CertificateTemplate}, + # in the format `projects/*/locations/*`. + # @param certificate_template_id [::String] + # Required. It must be unique within a location and match the regular + # expression `[a-zA-Z0-9_-]{1,63}` + # @param certificate_template [::Google::Cloud::Security::PrivateCA::V1::CertificateTemplate, ::Hash] + # Required. A + # {::Google::Cloud::Security::PrivateCA::V1::CertificateTemplate CertificateTemplate} + # with initial field values. + # @param request_id [::String] + # Optional. An ID to identify requests. Specify a unique request ID so that + # if you must retry your request, the server will know to ignore the request + # if it has already been completed. The server will guarantee that for at + # least 60 minutes since the first request. + # + # For example, consider a situation where you make an initial request and + # the request times out. If you make the request again with the same request + # ID, the server can check if original operation with the same request ID + # was received, and if so, will ignore the second request. This prevents + # clients from accidentally creating duplicate commitments. + # + # The request ID must be a valid UUID with the exception that zero UUID is + # not supported (00000000-0000-0000-0000-000000000000). + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Gapic::Operation] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Gapic::Operation] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/security/private_ca/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Security::PrivateCA::V1::CertificateAuthorityService::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Security::PrivateCA::V1::CreateCertificateTemplateRequest.new + # + # # Call the create_certificate_template method. + # result = client.create_certificate_template 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_certificate_template request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Security::PrivateCA::V1::CreateCertificateTemplateRequest + + # Converts hash 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_certificate_template.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::Security::PrivateCA::V1::VERSION + metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.parent + header_params["parent"] = request.parent + end + + request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") + metadata[:"x-goog-request-params"] ||= request_params_header + + options.apply_defaults timeout: @config.rpcs.create_certificate_template.timeout, + metadata: metadata, + retry_policy: @config.rpcs.create_certificate_template.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @certificate_authority_service_stub.call_rpc :create_certificate_template, 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 + + ## + # DeleteCertificateTemplate deletes a + # {::Google::Cloud::Security::PrivateCA::V1::CertificateTemplate CertificateTemplate}. + # + # @overload delete_certificate_template(request, options = nil) + # Pass arguments to `delete_certificate_template` via a request object, either of type + # {::Google::Cloud::Security::PrivateCA::V1::DeleteCertificateTemplateRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Security::PrivateCA::V1::DeleteCertificateTemplateRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_certificate_template(name: nil, request_id: nil) + # Pass arguments to `delete_certificate_template` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param name [::String] + # Required. The resource name for this + # {::Google::Cloud::Security::PrivateCA::V1::CertificateTemplate CertificateTemplate} + # in the format `projects/*/locations/*/certificateTemplates/*`. + # @param request_id [::String] + # Optional. An ID to identify requests. Specify a unique request ID so that + # if you must retry your request, the server will know to ignore the request + # if it has already been completed. The server will guarantee that for at + # least 60 minutes since the first request. + # + # For example, consider a situation where you make an initial request and + # the request times out. If you make the request again with the same request + # ID, the server can check if original operation with the same request ID + # was received, and if so, will ignore the second request. This prevents + # clients from accidentally creating duplicate commitments. + # + # The request ID must be a valid UUID with the exception that zero UUID is + # not supported (00000000-0000-0000-0000-000000000000). + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Gapic::Operation] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Gapic::Operation] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/security/private_ca/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Security::PrivateCA::V1::CertificateAuthorityService::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Security::PrivateCA::V1::DeleteCertificateTemplateRequest.new + # + # # Call the delete_certificate_template method. + # result = client.delete_certificate_template 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_certificate_template request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Security::PrivateCA::V1::DeleteCertificateTemplateRequest + + # Converts hash 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_certificate_template.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::Security::PrivateCA::V1::VERSION + metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.name + header_params["name"] = request.name + end + + request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") + metadata[:"x-goog-request-params"] ||= request_params_header + + options.apply_defaults timeout: @config.rpcs.delete_certificate_template.timeout, + metadata: metadata, + retry_policy: @config.rpcs.delete_certificate_template.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @certificate_authority_service_stub.call_rpc :delete_certificate_template, request, options: options do |response, operation| + response = ::Gapic::Operation.new response, @operations_client, options: options + yield response, operation if block_given? + throw :response, response + end + rescue ::GRPC::BadStatus => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Returns a + # {::Google::Cloud::Security::PrivateCA::V1::CertificateTemplate CertificateTemplate}. + # + # @overload get_certificate_template(request, options = nil) + # Pass arguments to `get_certificate_template` via a request object, either of type + # {::Google::Cloud::Security::PrivateCA::V1::GetCertificateTemplateRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Security::PrivateCA::V1::GetCertificateTemplateRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_certificate_template(name: nil) + # Pass arguments to `get_certificate_template` via keyword arguments. Note that at + # least one keyword argument is 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 + # {::Google::Cloud::Security::PrivateCA::V1::CertificateTemplate#name name} of the + # {::Google::Cloud::Security::PrivateCA::V1::CertificateTemplate CertificateTemplate} + # to get. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Google::Cloud::Security::PrivateCA::V1::CertificateTemplate] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Google::Cloud::Security::PrivateCA::V1::CertificateTemplate] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/security/private_ca/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Security::PrivateCA::V1::CertificateAuthorityService::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Security::PrivateCA::V1::GetCertificateTemplateRequest.new + # + # # Call the get_certificate_template method. + # result = client.get_certificate_template request + # + # # The returned object is of type Google::Cloud::Security::PrivateCA::V1::CertificateTemplate. + # p result + # + def get_certificate_template request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Security::PrivateCA::V1::GetCertificateTemplateRequest + + # Converts hash 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_certificate_template.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::Security::PrivateCA::V1::VERSION + metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.name + header_params["name"] = request.name + end + + request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") + metadata[:"x-goog-request-params"] ||= request_params_header + + options.apply_defaults timeout: @config.rpcs.get_certificate_template.timeout, + metadata: metadata, + retry_policy: @config.rpcs.get_certificate_template.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @certificate_authority_service_stub.call_rpc :get_certificate_template, request, options: options do |response, operation| + yield response, operation if block_given? + end + rescue ::GRPC::BadStatus => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Lists + # {::Google::Cloud::Security::PrivateCA::V1::CertificateTemplate CertificateTemplates}. + # + # @overload list_certificate_templates(request, options = nil) + # Pass arguments to `list_certificate_templates` via a request object, either of type + # {::Google::Cloud::Security::PrivateCA::V1::ListCertificateTemplatesRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Security::PrivateCA::V1::ListCertificateTemplatesRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_certificate_templates(parent: nil, page_size: nil, page_token: nil, filter: nil, order_by: nil) + # Pass arguments to `list_certificate_templates` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param parent [::String] + # Required. The resource name of the location associated with the + # {::Google::Cloud::Security::PrivateCA::V1::CertificateTemplate CertificateTemplates}, + # in the format `projects/*/locations/*`. + # @param page_size [::Integer] + # Optional. Limit on the number of + # {::Google::Cloud::Security::PrivateCA::V1::CertificateTemplate CertificateTemplates} + # to include in the response. Further + # {::Google::Cloud::Security::PrivateCA::V1::CertificateTemplate CertificateTemplates} + # can subsequently be obtained by including the + # {::Google::Cloud::Security::PrivateCA::V1::ListCertificateTemplatesResponse#next_page_token ListCertificateTemplatesResponse.next_page_token} + # in a subsequent request. If unspecified, the server will pick an + # appropriate default. + # @param page_token [::String] + # Optional. Pagination token, returned earlier via + # {::Google::Cloud::Security::PrivateCA::V1::ListCertificateTemplatesResponse#next_page_token ListCertificateTemplatesResponse.next_page_token}. + # @param filter [::String] + # Optional. Only include resources that match the filter in the response. + # @param order_by [::String] + # Optional. Specify how the results should be sorted. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Gapic::PagedEnumerable<::Google::Cloud::Security::PrivateCA::V1::CertificateTemplate>] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Gapic::PagedEnumerable<::Google::Cloud::Security::PrivateCA::V1::CertificateTemplate>] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/security/private_ca/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Security::PrivateCA::V1::CertificateAuthorityService::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Security::PrivateCA::V1::ListCertificateTemplatesRequest.new + # + # # Call the list_certificate_templates method. + # result = client.list_certificate_templates request + # + # # The returned object is of type Gapic::PagedEnumerable. You can iterate + # # over elements, and API calls will be issued to fetch pages as needed. + # result.each do |item| + # # Each element is of type ::Google::Cloud::Security::PrivateCA::V1::CertificateTemplate. + # p item + # end + # + def list_certificate_templates request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Security::PrivateCA::V1::ListCertificateTemplatesRequest + + # Converts hash 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_certificate_templates.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::Security::PrivateCA::V1::VERSION + metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.parent + header_params["parent"] = request.parent + end + + request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") + metadata[:"x-goog-request-params"] ||= request_params_header + + options.apply_defaults timeout: @config.rpcs.list_certificate_templates.timeout, + metadata: metadata, + retry_policy: @config.rpcs.list_certificate_templates.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @certificate_authority_service_stub.call_rpc :list_certificate_templates, request, options: options do |response, operation| + response = ::Gapic::PagedEnumerable.new @certificate_authority_service_stub, :list_certificate_templates, 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 + + ## + # Update a + # {::Google::Cloud::Security::PrivateCA::V1::CertificateTemplate CertificateTemplate}. + # + # @overload update_certificate_template(request, options = nil) + # Pass arguments to `update_certificate_template` via a request object, either of type + # {::Google::Cloud::Security::PrivateCA::V1::UpdateCertificateTemplateRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Security::PrivateCA::V1::UpdateCertificateTemplateRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_certificate_template(certificate_template: nil, update_mask: nil, request_id: nil) + # Pass arguments to `update_certificate_template` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param certificate_template [::Google::Cloud::Security::PrivateCA::V1::CertificateTemplate, ::Hash] + # Required. + # {::Google::Cloud::Security::PrivateCA::V1::CertificateTemplate CertificateTemplate} + # with updated values. + # @param update_mask [::Google::Protobuf::FieldMask, ::Hash] + # Required. A list of fields to be updated in this request. + # @param request_id [::String] + # Optional. An ID to identify requests. Specify a unique request ID so that + # if you must retry your request, the server will know to ignore the request + # if it has already been completed. The server will guarantee that for at + # least 60 minutes since the first request. + # + # For example, consider a situation where you make an initial request and + # the request times out. If you make the request again with the same request + # ID, the server can check if original operation with the same request ID + # was received, and if so, will ignore the second request. This prevents + # clients from accidentally creating duplicate commitments. + # + # The request ID must be a valid UUID with the exception that zero UUID is + # not supported (00000000-0000-0000-0000-000000000000). + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Gapic::Operation] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Gapic::Operation] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/security/private_ca/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Security::PrivateCA::V1::CertificateAuthorityService::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Security::PrivateCA::V1::UpdateCertificateTemplateRequest.new + # + # # Call the update_certificate_template method. + # result = client.update_certificate_template 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_certificate_template request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Security::PrivateCA::V1::UpdateCertificateTemplateRequest + + # Converts hash 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_certificate_template.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::Security::PrivateCA::V1::VERSION + metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.certificate_template&.name + header_params["certificate_template.name"] = request.certificate_template.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_certificate_template.timeout, + metadata: metadata, + retry_policy: @config.rpcs.update_certificate_template.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @certificate_authority_service_stub.call_rpc :update_certificate_template, 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 CertificateAuthorityService API. + # + # This class represents the configuration for CertificateAuthorityService, + # providing control over timeouts, retry behavior, logging, transport + # parameters, and other low-level controls. Certain parameters can also be + # applied individually to specific RPCs. See + # {::Google::Cloud::Security::PrivateCA::V1::CertificateAuthorityService::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_certificate to 20 seconds, + # # and all remaining timeouts to 10 seconds. + # ::Google::Cloud::Security::PrivateCA::V1::CertificateAuthorityService::Client.configure do |config| + # config.timeout = 10.0 + # config.rpcs.create_certificate.timeout = 20.0 + # end + # + # # Apply the above configuration only to a new client. + # client = ::Google::Cloud::Security::PrivateCA::V1::CertificateAuthorityService::Client.new do |config| + # config.timeout = 10.0 + # config.rpcs.create_certificate.timeout = 20.0 + # end + # + # @!attribute [rw] endpoint + # A custom service endpoint, as a hostname or hostname:port. The default is + # nil, indicating to use the default endpoint in the current universe domain. + # @return [::String,nil] + # @!attribute [rw] credentials + # Credentials to send with calls. You may provide any of the following types: + # * (`Google::Auth::Credentials`) A googleauth credentials object + # (see the [googleauth docs](https://rubydoc.info/gems/googleauth/Google/Auth/Credentials)) + # * (`Signet::OAuth2::Client`) A signet oauth2 client object + # (see the [signet docs](https://rubydoc.info/gems/signet/Signet/OAuth2/Client)) + # * (`GRPC::Core::Channel`) a gRPC channel with included credentials + # * (`GRPC::Core::ChannelCredentials`) a gRPC credentails object + # * (`nil`) indicating no credentials + # + # @note Warning: Passing a `String` to a keyfile path or a `Hash` of credentials + # is deprecated. Providing an unvalidated credential configuration to + # Google APIs can compromise the security of your systems and data. + # + # @example + # + # # The recommended way to provide credentials is to use the `make_creds` method + # # on the appropriate credentials class for your environment. + # + # require "googleauth" + # + # credentials = ::Google::Auth::ServiceAccountCredentials.make_creds( + # json_key_io: ::File.open("/path/to/keyfile.json") + # ) + # + # client = ::Google::Cloud::Security::PrivateCA::V1::CertificateAuthorityService::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 = "privateca.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 CertificateAuthorityService 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_certificate` + # @return [::Gapic::Config::Method] + # + attr_reader :create_certificate + ## + # RPC-specific configuration for `get_certificate` + # @return [::Gapic::Config::Method] + # + attr_reader :get_certificate + ## + # RPC-specific configuration for `list_certificates` + # @return [::Gapic::Config::Method] + # + attr_reader :list_certificates + ## + # RPC-specific configuration for `revoke_certificate` + # @return [::Gapic::Config::Method] + # + attr_reader :revoke_certificate + ## + # RPC-specific configuration for `update_certificate` + # @return [::Gapic::Config::Method] + # + attr_reader :update_certificate + ## + # RPC-specific configuration for `activate_certificate_authority` + # @return [::Gapic::Config::Method] + # + attr_reader :activate_certificate_authority + ## + # RPC-specific configuration for `create_certificate_authority` + # @return [::Gapic::Config::Method] + # + attr_reader :create_certificate_authority + ## + # RPC-specific configuration for `disable_certificate_authority` + # @return [::Gapic::Config::Method] + # + attr_reader :disable_certificate_authority + ## + # RPC-specific configuration for `enable_certificate_authority` + # @return [::Gapic::Config::Method] + # + attr_reader :enable_certificate_authority + ## + # RPC-specific configuration for `fetch_certificate_authority_csr` + # @return [::Gapic::Config::Method] + # + attr_reader :fetch_certificate_authority_csr + ## + # RPC-specific configuration for `get_certificate_authority` + # @return [::Gapic::Config::Method] + # + attr_reader :get_certificate_authority + ## + # RPC-specific configuration for `list_certificate_authorities` + # @return [::Gapic::Config::Method] + # + attr_reader :list_certificate_authorities + ## + # RPC-specific configuration for `undelete_certificate_authority` + # @return [::Gapic::Config::Method] + # + attr_reader :undelete_certificate_authority + ## + # RPC-specific configuration for `delete_certificate_authority` + # @return [::Gapic::Config::Method] + # + attr_reader :delete_certificate_authority + ## + # RPC-specific configuration for `update_certificate_authority` + # @return [::Gapic::Config::Method] + # + attr_reader :update_certificate_authority + ## + # RPC-specific configuration for `create_ca_pool` + # @return [::Gapic::Config::Method] + # + attr_reader :create_ca_pool + ## + # RPC-specific configuration for `update_ca_pool` + # @return [::Gapic::Config::Method] + # + attr_reader :update_ca_pool + ## + # RPC-specific configuration for `get_ca_pool` + # @return [::Gapic::Config::Method] + # + attr_reader :get_ca_pool + ## + # RPC-specific configuration for `list_ca_pools` + # @return [::Gapic::Config::Method] + # + attr_reader :list_ca_pools + ## + # RPC-specific configuration for `delete_ca_pool` + # @return [::Gapic::Config::Method] + # + attr_reader :delete_ca_pool + ## + # RPC-specific configuration for `fetch_ca_certs` + # @return [::Gapic::Config::Method] + # + attr_reader :fetch_ca_certs + ## + # RPC-specific configuration for `get_certificate_revocation_list` + # @return [::Gapic::Config::Method] + # + attr_reader :get_certificate_revocation_list + ## + # RPC-specific configuration for `list_certificate_revocation_lists` + # @return [::Gapic::Config::Method] + # + attr_reader :list_certificate_revocation_lists + ## + # RPC-specific configuration for `update_certificate_revocation_list` + # @return [::Gapic::Config::Method] + # + attr_reader :update_certificate_revocation_list + ## + # RPC-specific configuration for `create_certificate_template` + # @return [::Gapic::Config::Method] + # + attr_reader :create_certificate_template + ## + # RPC-specific configuration for `delete_certificate_template` + # @return [::Gapic::Config::Method] + # + attr_reader :delete_certificate_template + ## + # RPC-specific configuration for `get_certificate_template` + # @return [::Gapic::Config::Method] + # + attr_reader :get_certificate_template + ## + # RPC-specific configuration for `list_certificate_templates` + # @return [::Gapic::Config::Method] + # + attr_reader :list_certificate_templates + ## + # RPC-specific configuration for `update_certificate_template` + # @return [::Gapic::Config::Method] + # + attr_reader :update_certificate_template + + # @private + def initialize parent_rpcs = nil + create_certificate_config = parent_rpcs.create_certificate if parent_rpcs.respond_to? :create_certificate + @create_certificate = ::Gapic::Config::Method.new create_certificate_config + get_certificate_config = parent_rpcs.get_certificate if parent_rpcs.respond_to? :get_certificate + @get_certificate = ::Gapic::Config::Method.new get_certificate_config + list_certificates_config = parent_rpcs.list_certificates if parent_rpcs.respond_to? :list_certificates + @list_certificates = ::Gapic::Config::Method.new list_certificates_config + revoke_certificate_config = parent_rpcs.revoke_certificate if parent_rpcs.respond_to? :revoke_certificate + @revoke_certificate = ::Gapic::Config::Method.new revoke_certificate_config + update_certificate_config = parent_rpcs.update_certificate if parent_rpcs.respond_to? :update_certificate + @update_certificate = ::Gapic::Config::Method.new update_certificate_config + activate_certificate_authority_config = parent_rpcs.activate_certificate_authority if parent_rpcs.respond_to? :activate_certificate_authority + @activate_certificate_authority = ::Gapic::Config::Method.new activate_certificate_authority_config + create_certificate_authority_config = parent_rpcs.create_certificate_authority if parent_rpcs.respond_to? :create_certificate_authority + @create_certificate_authority = ::Gapic::Config::Method.new create_certificate_authority_config + disable_certificate_authority_config = parent_rpcs.disable_certificate_authority if parent_rpcs.respond_to? :disable_certificate_authority + @disable_certificate_authority = ::Gapic::Config::Method.new disable_certificate_authority_config + enable_certificate_authority_config = parent_rpcs.enable_certificate_authority if parent_rpcs.respond_to? :enable_certificate_authority + @enable_certificate_authority = ::Gapic::Config::Method.new enable_certificate_authority_config + fetch_certificate_authority_csr_config = parent_rpcs.fetch_certificate_authority_csr if parent_rpcs.respond_to? :fetch_certificate_authority_csr + @fetch_certificate_authority_csr = ::Gapic::Config::Method.new fetch_certificate_authority_csr_config + get_certificate_authority_config = parent_rpcs.get_certificate_authority if parent_rpcs.respond_to? :get_certificate_authority + @get_certificate_authority = ::Gapic::Config::Method.new get_certificate_authority_config + list_certificate_authorities_config = parent_rpcs.list_certificate_authorities if parent_rpcs.respond_to? :list_certificate_authorities + @list_certificate_authorities = ::Gapic::Config::Method.new list_certificate_authorities_config + undelete_certificate_authority_config = parent_rpcs.undelete_certificate_authority if parent_rpcs.respond_to? :undelete_certificate_authority + @undelete_certificate_authority = ::Gapic::Config::Method.new undelete_certificate_authority_config + delete_certificate_authority_config = parent_rpcs.delete_certificate_authority if parent_rpcs.respond_to? :delete_certificate_authority + @delete_certificate_authority = ::Gapic::Config::Method.new delete_certificate_authority_config + update_certificate_authority_config = parent_rpcs.update_certificate_authority if parent_rpcs.respond_to? :update_certificate_authority + @update_certificate_authority = ::Gapic::Config::Method.new update_certificate_authority_config + create_ca_pool_config = parent_rpcs.create_ca_pool if parent_rpcs.respond_to? :create_ca_pool + @create_ca_pool = ::Gapic::Config::Method.new create_ca_pool_config + update_ca_pool_config = parent_rpcs.update_ca_pool if parent_rpcs.respond_to? :update_ca_pool + @update_ca_pool = ::Gapic::Config::Method.new update_ca_pool_config + get_ca_pool_config = parent_rpcs.get_ca_pool if parent_rpcs.respond_to? :get_ca_pool + @get_ca_pool = ::Gapic::Config::Method.new get_ca_pool_config + list_ca_pools_config = parent_rpcs.list_ca_pools if parent_rpcs.respond_to? :list_ca_pools + @list_ca_pools = ::Gapic::Config::Method.new list_ca_pools_config + delete_ca_pool_config = parent_rpcs.delete_ca_pool if parent_rpcs.respond_to? :delete_ca_pool + @delete_ca_pool = ::Gapic::Config::Method.new delete_ca_pool_config + fetch_ca_certs_config = parent_rpcs.fetch_ca_certs if parent_rpcs.respond_to? :fetch_ca_certs + @fetch_ca_certs = ::Gapic::Config::Method.new fetch_ca_certs_config + get_certificate_revocation_list_config = parent_rpcs.get_certificate_revocation_list if parent_rpcs.respond_to? :get_certificate_revocation_list + @get_certificate_revocation_list = ::Gapic::Config::Method.new get_certificate_revocation_list_config + list_certificate_revocation_lists_config = parent_rpcs.list_certificate_revocation_lists if parent_rpcs.respond_to? :list_certificate_revocation_lists + @list_certificate_revocation_lists = ::Gapic::Config::Method.new list_certificate_revocation_lists_config + update_certificate_revocation_list_config = parent_rpcs.update_certificate_revocation_list if parent_rpcs.respond_to? :update_certificate_revocation_list + @update_certificate_revocation_list = ::Gapic::Config::Method.new update_certificate_revocation_list_config + create_certificate_template_config = parent_rpcs.create_certificate_template if parent_rpcs.respond_to? :create_certificate_template + @create_certificate_template = ::Gapic::Config::Method.new create_certificate_template_config + delete_certificate_template_config = parent_rpcs.delete_certificate_template if parent_rpcs.respond_to? :delete_certificate_template + @delete_certificate_template = ::Gapic::Config::Method.new delete_certificate_template_config + get_certificate_template_config = parent_rpcs.get_certificate_template if parent_rpcs.respond_to? :get_certificate_template + @get_certificate_template = ::Gapic::Config::Method.new get_certificate_template_config + list_certificate_templates_config = parent_rpcs.list_certificate_templates if parent_rpcs.respond_to? :list_certificate_templates + @list_certificate_templates = ::Gapic::Config::Method.new list_certificate_templates_config + update_certificate_template_config = parent_rpcs.update_certificate_template if parent_rpcs.respond_to? :update_certificate_template + @update_certificate_template = ::Gapic::Config::Method.new update_certificate_template_config + + yield self if block_given? + end + end + end + end + end + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-security-private_ca-v1/lib/google/cloud/security/private_ca/v1/certificate_authority_service/credentials.rb b/owl-bot-staging/google-cloud-security-private_ca-v1/lib/google/cloud/security/private_ca/v1/certificate_authority_service/credentials.rb new file mode 100644 index 000000000000..47ad11aa913e --- /dev/null +++ b/owl-bot-staging/google-cloud-security-private_ca-v1/lib/google/cloud/security/private_ca/v1/certificate_authority_service/credentials.rb @@ -0,0 +1,53 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +require "googleauth" + +module Google + module Cloud + module Security + module PrivateCA + module V1 + module CertificateAuthorityService + # Credentials for the CertificateAuthorityService API. + class Credentials < ::Google::Auth::Credentials + self.scope = [ + "https://www.googleapis.com/auth/cloud-platform" + ] + self.env_vars = [ + "PRIVATE_CA_CREDENTIALS", + "PRIVATE_CA_KEYFILE", + "GOOGLE_CLOUD_CREDENTIALS", + "GOOGLE_CLOUD_KEYFILE", + "GCLOUD_KEYFILE", + "PRIVATE_CA_CREDENTIALS_JSON", + "PRIVATE_CA_KEYFILE_JSON", + "GOOGLE_CLOUD_CREDENTIALS_JSON", + "GOOGLE_CLOUD_KEYFILE_JSON", + "GCLOUD_KEYFILE_JSON" + ] + self.paths = [ + "~/.config/google_cloud/application_default_credentials.json" + ] + end + end + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-security-private_ca-v1/lib/google/cloud/security/private_ca/v1/certificate_authority_service/operations.rb b/owl-bot-staging/google-cloud-security-private_ca-v1/lib/google/cloud/security/private_ca/v1/certificate_authority_service/operations.rb new file mode 100644 index 000000000000..c1947a1cadbd --- /dev/null +++ b/owl-bot-staging/google-cloud-security-private_ca-v1/lib/google/cloud/security/private_ca/v1/certificate_authority_service/operations.rb @@ -0,0 +1,843 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +require "gapic/operation" +require "google/longrunning/operations_pb" + +module Google + module Cloud + module Security + module PrivateCA + module V1 + module CertificateAuthorityService + # Service that implements Longrunning Operations API. + class Operations + # @private + API_VERSION = "" + + # @private + DEFAULT_ENDPOINT_TEMPLATE = "privateca.$UNIVERSE_DOMAIN$" + + # @private + attr_reader :operations_stub + + ## + # Configuration for the CertificateAuthorityService 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 CertificateAuthorityService 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::Security::PrivateCA::V1::VERSION + metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.name + header_params["name"] = request.name + end + + request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") + metadata[:"x-goog-request-params"] ||= request_params_header + + options.apply_defaults timeout: @config.rpcs.list_operations.timeout, + metadata: metadata, + retry_policy: @config.rpcs.list_operations.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @operations_stub.call_rpc :list_operations, request, options: options do |response, operation| + wrap_lro_operation = ->(op_response) { ::Gapic::Operation.new op_response, @operations_client } + response = ::Gapic::PagedEnumerable.new @operations_stub, :list_operations, request, response, operation, options, format_resource: wrap_lro_operation + yield response, operation if block_given? + 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::Security::PrivateCA::V1::VERSION + metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.name + header_params["name"] = request.name + end + + request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") + metadata[:"x-goog-request-params"] ||= request_params_header + + options.apply_defaults timeout: @config.rpcs.get_operation.timeout, + metadata: metadata, + retry_policy: @config.rpcs.get_operation.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @operations_stub.call_rpc :get_operation, request, options: options do |response, operation| + response = ::Gapic::Operation.new response, @operations_client, options: options + yield response, operation if block_given? + 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::Security::PrivateCA::V1::VERSION + metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.name + header_params["name"] = request.name + end + + request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") + metadata[:"x-goog-request-params"] ||= request_params_header + + options.apply_defaults timeout: @config.rpcs.delete_operation.timeout, + metadata: metadata, + retry_policy: @config.rpcs.delete_operation.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @operations_stub.call_rpc :delete_operation, request, options: options do |response, operation| + yield response, operation if block_given? + 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::Security::PrivateCA::V1::VERSION + metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.name + header_params["name"] = request.name + end + + request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") + metadata[:"x-goog-request-params"] ||= request_params_header + + options.apply_defaults timeout: @config.rpcs.cancel_operation.timeout, + metadata: metadata, + retry_policy: @config.rpcs.cancel_operation.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @operations_stub.call_rpc :cancel_operation, request, options: options do |response, operation| + yield response, operation if block_given? + 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::Security::PrivateCA::V1::VERSION + metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + options.apply_defaults timeout: @config.rpcs.wait_operation.timeout, + metadata: metadata, + retry_policy: @config.rpcs.wait_operation.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @operations_stub.call_rpc :wait_operation, request, options: options do |response, operation| + response = ::Gapic::Operation.new response, @operations_client, options: options + yield response, operation if block_given? + 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 = "privateca.googleapis.com" + + config_attr :endpoint, nil, ::String, nil + config_attr :credentials, nil do |value| + allowed = [::String, ::Hash, ::Proc, ::Symbol, ::Google::Auth::Credentials, ::Google::Auth::BaseClient, ::Signet::OAuth2::Client, nil] + allowed += [::GRPC::Core::Channel, ::GRPC::Core::ChannelCredentials] if defined? ::GRPC::Core::Channel + allowed.any? { |klass| klass === value } + end + config_attr :scope, nil, ::String, ::Array, nil + config_attr :lib_name, nil, ::String, nil + config_attr :lib_version, nil, ::String, nil + config_attr(:channel_args, { "grpc.service_config_disable_resolution" => 1 }, ::Hash, nil) + config_attr :interceptors, nil, ::Array, nil + config_attr :timeout, nil, ::Numeric, nil + config_attr :metadata, nil, ::Hash, nil + config_attr :retry_policy, nil, ::Hash, ::Proc, nil + config_attr :quota_project, nil, ::String, nil + config_attr :universe_domain, nil, ::String, nil + config_attr :logger, :default, ::Logger, nil, :default + + # @private + def initialize parent_config = nil + @parent_config = parent_config unless parent_config.nil? + + yield self if block_given? + end + + ## + # Configurations for individual RPCs + # @return [Rpcs] + # + def rpcs + @rpcs ||= begin + parent_rpcs = nil + parent_rpcs = @parent_config.rpcs if defined?(@parent_config) && @parent_config.respond_to?(:rpcs) + Rpcs.new parent_rpcs + end + end + + ## + # Configuration for the channel pool + # @return [::Gapic::ServiceStub::ChannelPool::Configuration] + # + def channel_pool + @channel_pool ||= ::Gapic::ServiceStub::ChannelPool::Configuration.new + end + + ## + # Configuration RPC class for the Operations API. + # + # Includes fields providing the configuration for each RPC in this service. + # Each configuration object is of type `Gapic::Config::Method` and includes + # the following configuration fields: + # + # * `timeout` (*type:* `Numeric`) - The call timeout in seconds + # * `metadata` (*type:* `Hash{Symbol=>String}`) - Additional gRPC headers + # * `retry_policy (*type:* `Hash`) - The retry policy. The policy fields + # include the following keys: + # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds. + # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds. + # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier. + # * `:retry_codes` (*type:* `Array`) - The error codes that should + # trigger a retry. + # + class Rpcs + ## + # RPC-specific configuration for `list_operations` + # @return [::Gapic::Config::Method] + # + attr_reader :list_operations + ## + # RPC-specific configuration for `get_operation` + # @return [::Gapic::Config::Method] + # + attr_reader :get_operation + ## + # RPC-specific configuration for `delete_operation` + # @return [::Gapic::Config::Method] + # + attr_reader :delete_operation + ## + # RPC-specific configuration for `cancel_operation` + # @return [::Gapic::Config::Method] + # + attr_reader :cancel_operation + ## + # RPC-specific configuration for `wait_operation` + # @return [::Gapic::Config::Method] + # + attr_reader :wait_operation + + # @private + def initialize parent_rpcs = nil + list_operations_config = parent_rpcs.list_operations if parent_rpcs.respond_to? :list_operations + @list_operations = ::Gapic::Config::Method.new list_operations_config + get_operation_config = parent_rpcs.get_operation if parent_rpcs.respond_to? :get_operation + @get_operation = ::Gapic::Config::Method.new get_operation_config + delete_operation_config = parent_rpcs.delete_operation if parent_rpcs.respond_to? :delete_operation + @delete_operation = ::Gapic::Config::Method.new delete_operation_config + cancel_operation_config = parent_rpcs.cancel_operation if parent_rpcs.respond_to? :cancel_operation + @cancel_operation = ::Gapic::Config::Method.new cancel_operation_config + wait_operation_config = parent_rpcs.wait_operation if parent_rpcs.respond_to? :wait_operation + @wait_operation = ::Gapic::Config::Method.new wait_operation_config + + yield self if block_given? + end + end + end + end + end + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-security-private_ca-v1/lib/google/cloud/security/private_ca/v1/certificate_authority_service/paths.rb b/owl-bot-staging/google-cloud-security-private_ca-v1/lib/google/cloud/security/private_ca/v1/certificate_authority_service/paths.rb new file mode 100644 index 000000000000..57c61d556fb1 --- /dev/null +++ b/owl-bot-staging/google-cloud-security-private_ca-v1/lib/google/cloud/security/private_ca/v1/certificate_authority_service/paths.rb @@ -0,0 +1,155 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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 Security + module PrivateCA + module V1 + module CertificateAuthorityService + # Path helper methods for the CertificateAuthorityService API. + module Paths + ## + # Create a fully-qualified CaPool resource string. + # + # The resource will be in the following format: + # + # `projects/{project}/locations/{location}/caPools/{ca_pool}` + # + # @param project [String] + # @param location [String] + # @param ca_pool [String] + # + # @return [::String] + def ca_pool_path project:, location:, ca_pool: + raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" + raise ::ArgumentError, "location cannot contain /" if location.to_s.include? "/" + + "projects/#{project}/locations/#{location}/caPools/#{ca_pool}" + end + + ## + # Create a fully-qualified Certificate resource string. + # + # The resource will be in the following format: + # + # `projects/{project}/locations/{location}/caPools/{ca_pool}/certificates/{certificate}` + # + # @param project [String] + # @param location [String] + # @param ca_pool [String] + # @param certificate [String] + # + # @return [::String] + def certificate_path project:, location:, ca_pool:, certificate: + raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" + raise ::ArgumentError, "location cannot contain /" if location.to_s.include? "/" + raise ::ArgumentError, "ca_pool cannot contain /" if ca_pool.to_s.include? "/" + + "projects/#{project}/locations/#{location}/caPools/#{ca_pool}/certificates/#{certificate}" + end + + ## + # Create a fully-qualified CertificateAuthority resource string. + # + # The resource will be in the following format: + # + # `projects/{project}/locations/{location}/caPools/{ca_pool}/certificateAuthorities/{certificate_authority}` + # + # @param project [String] + # @param location [String] + # @param ca_pool [String] + # @param certificate_authority [String] + # + # @return [::String] + def certificate_authority_path project:, location:, ca_pool:, certificate_authority: + raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" + raise ::ArgumentError, "location cannot contain /" if location.to_s.include? "/" + raise ::ArgumentError, "ca_pool cannot contain /" if ca_pool.to_s.include? "/" + + "projects/#{project}/locations/#{location}/caPools/#{ca_pool}/certificateAuthorities/#{certificate_authority}" + end + + ## + # Create a fully-qualified CertificateRevocationList resource string. + # + # The resource will be in the following format: + # + # `projects/{project}/locations/{location}/caPools/{ca_pool}/certificateAuthorities/{certificate_authority}/certificateRevocationLists/{certificate_revocation_list}` + # + # @param project [String] + # @param location [String] + # @param ca_pool [String] + # @param certificate_authority [String] + # @param certificate_revocation_list [String] + # + # @return [::String] + def certificate_revocation_list_path project:, location:, ca_pool:, certificate_authority:, certificate_revocation_list: + raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" + raise ::ArgumentError, "location cannot contain /" if location.to_s.include? "/" + raise ::ArgumentError, "ca_pool cannot contain /" if ca_pool.to_s.include? "/" + raise ::ArgumentError, "certificate_authority cannot contain /" if certificate_authority.to_s.include? "/" + + "projects/#{project}/locations/#{location}/caPools/#{ca_pool}/certificateAuthorities/#{certificate_authority}/certificateRevocationLists/#{certificate_revocation_list}" + end + + ## + # Create a fully-qualified CertificateTemplate resource string. + # + # The resource will be in the following format: + # + # `projects/{project}/locations/{location}/certificateTemplates/{certificate_template}` + # + # @param project [String] + # @param location [String] + # @param certificate_template [String] + # + # @return [::String] + def certificate_template_path project:, location:, certificate_template: + raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" + raise ::ArgumentError, "location cannot contain /" if location.to_s.include? "/" + + "projects/#{project}/locations/#{location}/certificateTemplates/#{certificate_template}" + 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 + + extend self + end + end + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-security-private_ca-v1/lib/google/cloud/security/private_ca/v1/certificate_authority_service/rest.rb b/owl-bot-staging/google-cloud-security-private_ca-v1/lib/google/cloud/security/private_ca/v1/certificate_authority_service/rest.rb new file mode 100644 index 000000000000..04c2876adc55 --- /dev/null +++ b/owl-bot-staging/google-cloud-security-private_ca-v1/lib/google/cloud/security/private_ca/v1/certificate_authority_service/rest.rb @@ -0,0 +1,58 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +require "gapic/rest" +require "gapic/config" +require "gapic/config/method" + +require "google/cloud/security/private_ca/v1/version" +require "google/cloud/security/private_ca/v1/bindings_override" + +require "google/cloud/security/private_ca/v1/certificate_authority_service/credentials" +require "google/cloud/security/private_ca/v1/certificate_authority_service/paths" +require "google/cloud/security/private_ca/v1/certificate_authority_service/rest/operations" +require "google/cloud/security/private_ca/v1/certificate_authority_service/rest/client" + +module Google + module Cloud + module Security + module PrivateCA + module V1 + ## + # [Certificate Authority + # Service][google.cloud.security.privateca.v1.CertificateAuthorityService] + # manages private certificate authorities and issued certificates. + # + # To load this service and instantiate a REST client: + # + # require "google/cloud/security/private_ca/v1/certificate_authority_service/rest" + # client = ::Google::Cloud::Security::PrivateCA::V1::CertificateAuthorityService::Rest::Client.new + # + module CertificateAuthorityService + # Client for the REST transport + module Rest + end + end + end + end + end + end +end + +helper_path = ::File.join __dir__, "rest", "helpers.rb" +require "google/cloud/security/private_ca/v1/certificate_authority_service/rest/helpers" if ::File.file? helper_path diff --git a/owl-bot-staging/google-cloud-security-private_ca-v1/lib/google/cloud/security/private_ca/v1/certificate_authority_service/rest/client.rb b/owl-bot-staging/google-cloud-security-private_ca-v1/lib/google/cloud/security/private_ca/v1/certificate_authority_service/rest/client.rb new file mode 100644 index 000000000000..ece5850c8a47 --- /dev/null +++ b/owl-bot-staging/google-cloud-security-private_ca-v1/lib/google/cloud/security/private_ca/v1/certificate_authority_service/rest/client.rb @@ -0,0 +1,3567 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +require "google/cloud/errors" +require "google/cloud/security/privateca/v1/service_pb" +require "google/cloud/security/private_ca/v1/certificate_authority_service/rest/service_stub" +require "google/cloud/location/rest" +require "google/iam/v1/rest" + +module Google + module Cloud + module Security + module PrivateCA + module V1 + module CertificateAuthorityService + module Rest + ## + # REST client for the CertificateAuthorityService service. + # + # [Certificate Authority + # Service][google.cloud.security.privateca.v1.CertificateAuthorityService] + # manages private certificate authorities and issued certificates. + # + class Client + # @private + API_VERSION = "" + + # @private + DEFAULT_ENDPOINT_TEMPLATE = "privateca.$UNIVERSE_DOMAIN$" + + include Paths + + # @private + attr_reader :certificate_authority_service_stub + + ## + # Configure the CertificateAuthorityService Client class. + # + # See {::Google::Cloud::Security::PrivateCA::V1::CertificateAuthorityService::Rest::Client::Configuration} + # for a description of the configuration fields. + # + # @example + # + # # Modify the configuration for all CertificateAuthorityService clients + # ::Google::Cloud::Security::PrivateCA::V1::CertificateAuthorityService::Rest::Client.configure do |config| + # config.timeout = 10.0 + # end + # + # @yield [config] Configure the Client client. + # @yieldparam config [Client::Configuration] + # + # @return [Client::Configuration] + # + def self.configure + @configure ||= begin + namespace = ["Google", "Cloud", "Security", "PrivateCA", "V1"] + parent_config = while namespace.any? + parent_name = namespace.join "::" + parent_const = const_get parent_name + break parent_const.configure if parent_const.respond_to? :configure + namespace.pop + end + default_config = Client::Configuration.new parent_config + + default_config.timeout = 60.0 + default_config.retry_policy = { + initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [2, 14, 4] + } + + default_config + end + yield @configure if block_given? + @configure + end + + ## + # Configure the CertificateAuthorityService Client instance. + # + # The configuration is set to the derived mode, meaning that values can be changed, + # but structural changes (adding new fields, etc.) are not allowed. Structural changes + # should be made on {Client.configure}. + # + # See {::Google::Cloud::Security::PrivateCA::V1::CertificateAuthorityService::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 + @certificate_authority_service_stub.universe_domain + end + + ## + # Create a new CertificateAuthorityService REST client object. + # + # @example + # + # # Create a client using the default configuration + # client = ::Google::Cloud::Security::PrivateCA::V1::CertificateAuthorityService::Rest::Client.new + # + # # Create a client using a custom configuration + # client = ::Google::Cloud::Security::PrivateCA::V1::CertificateAuthorityService::Rest::Client.new do |config| + # config.timeout = 10.0 + # end + # + # @yield [config] Configure the CertificateAuthorityService client. + # @yieldparam config [Client::Configuration] + # + def initialize + # Create the configuration object + @config = Configuration.new Client.configure + + # Yield the configuration if needed + yield @config if block_given? + + # Create credentials + credentials = @config.credentials + # Use self-signed JWT if the endpoint is unchanged from default, + # but only if the default endpoint does not have a region prefix. + enable_self_signed_jwt = @config.endpoint.nil? || + (@config.endpoint == Configuration::DEFAULT_ENDPOINT && + !@config.endpoint.split(".").first.include?("-")) + credentials ||= Credentials.default scope: @config.scope, + enable_self_signed_jwt: enable_self_signed_jwt + if credentials.is_a?(::String) || credentials.is_a?(::Hash) + credentials = Credentials.new credentials, scope: @config.scope + end + + @quota_project_id = @config.quota_project + @quota_project_id ||= credentials.quota_project_id if credentials.respond_to? :quota_project_id + + @operations_client = ::Google::Cloud::Security::PrivateCA::V1::CertificateAuthorityService::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 + + @certificate_authority_service_stub = ::Google::Cloud::Security::PrivateCA::V1::CertificateAuthorityService::Rest::ServiceStub.new( + endpoint: @config.endpoint, + endpoint_template: DEFAULT_ENDPOINT_TEMPLATE, + universe_domain: @config.universe_domain, + credentials: credentials, + logger: @config.logger + ) + + @certificate_authority_service_stub.logger(stub: true)&.info do |entry| + entry.set_system_name + entry.set_service + entry.message = "Created client for #{entry.service}" + entry.set_credentials_fields credentials + entry.set "customEndpoint", @config.endpoint if @config.endpoint + entry.set "defaultTimeout", @config.timeout if @config.timeout + entry.set "quotaProject", @quota_project_id if @quota_project_id + end + + @location_client = Google::Cloud::Location::Locations::Rest::Client.new do |config| + config.credentials = credentials + config.quota_project = @quota_project_id + config.endpoint = @certificate_authority_service_stub.endpoint + config.universe_domain = @certificate_authority_service_stub.universe_domain + config.bindings_override = @config.bindings_override + config.logger = @certificate_authority_service_stub.logger if config.respond_to? :logger= + end + + @iam_policy_client = Google::Iam::V1::IAMPolicy::Rest::Client.new do |config| + config.credentials = credentials + config.quota_project = @quota_project_id + config.endpoint = @certificate_authority_service_stub.endpoint + config.universe_domain = @certificate_authority_service_stub.universe_domain + config.bindings_override = @config.bindings_override + config.logger = @certificate_authority_service_stub.logger if config.respond_to? :logger= + end + end + + ## + # Get the associated client for long-running operations. + # + # @return [::Google::Cloud::Security::PrivateCA::V1::CertificateAuthorityService::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 + + ## + # Get the associated client for mix-in of the IAMPolicy. + # + # @return [Google::Iam::V1::IAMPolicy::Rest::Client] + # + attr_reader :iam_policy_client + + ## + # The logger used for request/response debug logging. + # + # @return [Logger] + # + def logger + @certificate_authority_service_stub.logger + end + + # Service calls + + ## + # Create a new {::Google::Cloud::Security::PrivateCA::V1::Certificate Certificate} + # in a given Project, Location from a particular + # {::Google::Cloud::Security::PrivateCA::V1::CaPool CaPool}. + # + # @overload create_certificate(request, options = nil) + # Pass arguments to `create_certificate` via a request object, either of type + # {::Google::Cloud::Security::PrivateCA::V1::CreateCertificateRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Security::PrivateCA::V1::CreateCertificateRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_certificate(parent: nil, certificate_id: nil, certificate: nil, request_id: nil, validate_only: nil, issuing_certificate_authority_id: nil) + # Pass arguments to `create_certificate` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param parent [::String] + # Required. The resource name of the + # {::Google::Cloud::Security::PrivateCA::V1::CaPool CaPool} associated with the + # {::Google::Cloud::Security::PrivateCA::V1::Certificate Certificate}, in the + # format `projects/*/locations/*/caPools/*`. + # @param certificate_id [::String] + # Optional. It must be unique within a location and match the regular + # expression `[a-zA-Z0-9_-]{1,63}`. This field is required when using a + # {::Google::Cloud::Security::PrivateCA::V1::CertificateAuthority CertificateAuthority} + # in the Enterprise + # {::Google::Cloud::Security::PrivateCA::V1::CertificateAuthority#tier CertificateAuthority.tier}, + # but is optional and its value is ignored otherwise. + # @param certificate [::Google::Cloud::Security::PrivateCA::V1::Certificate, ::Hash] + # Required. A {::Google::Cloud::Security::PrivateCA::V1::Certificate Certificate} + # with initial field values. + # @param request_id [::String] + # Optional. An ID to identify requests. Specify a unique request ID so that + # if you must retry your request, the server will know to ignore the request + # if it has already been completed. The server will guarantee that for at + # least 60 minutes since the first request. + # + # For example, consider a situation where you make an initial request and the + # request times out. If you make the request again with the same request ID, + # the server can check if original operation with the same request ID was + # received, and if so, will ignore the second request. This prevents clients + # from accidentally creating duplicate commitments. + # + # The request ID must be a valid UUID with the exception that zero UUID is + # not supported (00000000-0000-0000-0000-000000000000). + # @param validate_only [::Boolean] + # Optional. If this is true, no + # {::Google::Cloud::Security::PrivateCA::V1::Certificate Certificate} resource will + # be persisted regardless of the + # {::Google::Cloud::Security::PrivateCA::V1::CaPool CaPool}'s + # {::Google::Cloud::Security::PrivateCA::V1::CaPool#tier tier}, and the returned + # {::Google::Cloud::Security::PrivateCA::V1::Certificate Certificate} will not + # contain the + # {::Google::Cloud::Security::PrivateCA::V1::Certificate#pem_certificate pem_certificate} + # field. + # @param issuing_certificate_authority_id [::String] + # Optional. The resource ID of the + # {::Google::Cloud::Security::PrivateCA::V1::CertificateAuthority CertificateAuthority} + # that should issue the certificate. This optional field will ignore the + # load-balancing scheme of the Pool and directly issue the certificate from + # the CA with the specified ID, contained in the same + # {::Google::Cloud::Security::PrivateCA::V1::CaPool CaPool} referenced by `parent`. + # Per-CA quota rules apply. If left empty, a + # {::Google::Cloud::Security::PrivateCA::V1::CertificateAuthority CertificateAuthority} + # will be chosen from the {::Google::Cloud::Security::PrivateCA::V1::CaPool CaPool} + # by the service. For example, to issue a + # {::Google::Cloud::Security::PrivateCA::V1::Certificate Certificate} from a + # Certificate Authority with resource name + # "projects/my-project/locations/us-central1/caPools/my-pool/certificateAuthorities/my-ca", + # you can set the + # {::Google::Cloud::Security::PrivateCA::V1::CreateCertificateRequest#parent parent} + # to "projects/my-project/locations/us-central1/caPools/my-pool" and the + # {::Google::Cloud::Security::PrivateCA::V1::CreateCertificateRequest#issuing_certificate_authority_id issuing_certificate_authority_id} + # to "my-ca". + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Cloud::Security::PrivateCA::V1::Certificate] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::Security::PrivateCA::V1::Certificate] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/security/private_ca/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Security::PrivateCA::V1::CertificateAuthorityService::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Security::PrivateCA::V1::CreateCertificateRequest.new + # + # # Call the create_certificate method. + # result = client.create_certificate request + # + # # The returned object is of type Google::Cloud::Security::PrivateCA::V1::Certificate. + # p result + # + def create_certificate request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Security::PrivateCA::V1::CreateCertificateRequest + + # Converts hash 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_certificate.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::Security::PrivateCA::V1::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + options.apply_defaults timeout: @config.rpcs.create_certificate.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.create_certificate.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @certificate_authority_service_stub.create_certificate request, options do |result, operation| + yield result, operation if block_given? + end + rescue ::Gapic::Rest::Error => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Returns a {::Google::Cloud::Security::PrivateCA::V1::Certificate Certificate}. + # + # @overload get_certificate(request, options = nil) + # Pass arguments to `get_certificate` via a request object, either of type + # {::Google::Cloud::Security::PrivateCA::V1::GetCertificateRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Security::PrivateCA::V1::GetCertificateRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_certificate(name: nil) + # Pass arguments to `get_certificate` via keyword arguments. Note that at + # least one keyword argument is 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 {::Google::Cloud::Security::PrivateCA::V1::Certificate#name name} + # of the {::Google::Cloud::Security::PrivateCA::V1::Certificate Certificate} to + # get. + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Cloud::Security::PrivateCA::V1::Certificate] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::Security::PrivateCA::V1::Certificate] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/security/private_ca/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Security::PrivateCA::V1::CertificateAuthorityService::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Security::PrivateCA::V1::GetCertificateRequest.new + # + # # Call the get_certificate method. + # result = client.get_certificate request + # + # # The returned object is of type Google::Cloud::Security::PrivateCA::V1::Certificate. + # p result + # + def get_certificate request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Security::PrivateCA::V1::GetCertificateRequest + + # Converts hash 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_certificate.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::Security::PrivateCA::V1::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + options.apply_defaults timeout: @config.rpcs.get_certificate.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.get_certificate.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @certificate_authority_service_stub.get_certificate request, options do |result, operation| + yield result, operation if block_given? + end + rescue ::Gapic::Rest::Error => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Lists {::Google::Cloud::Security::PrivateCA::V1::Certificate Certificates}. + # + # @overload list_certificates(request, options = nil) + # Pass arguments to `list_certificates` via a request object, either of type + # {::Google::Cloud::Security::PrivateCA::V1::ListCertificatesRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Security::PrivateCA::V1::ListCertificatesRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_certificates(parent: nil, page_size: nil, page_token: nil, filter: nil, order_by: nil) + # Pass arguments to `list_certificates` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param parent [::String] + # Required. The resource name of the location associated with the + # {::Google::Cloud::Security::PrivateCA::V1::Certificate Certificates}, in the + # format `projects/*/locations/*/caPools/*`. + # @param page_size [::Integer] + # Optional. Limit on the number of + # {::Google::Cloud::Security::PrivateCA::V1::Certificate Certificates} to include + # in the response. Further + # {::Google::Cloud::Security::PrivateCA::V1::Certificate Certificates} can + # subsequently be obtained by including the + # {::Google::Cloud::Security::PrivateCA::V1::ListCertificatesResponse#next_page_token ListCertificatesResponse.next_page_token} + # in a subsequent request. If unspecified, the server will pick an + # appropriate default. + # @param page_token [::String] + # Optional. Pagination token, returned earlier via + # {::Google::Cloud::Security::PrivateCA::V1::ListCertificatesResponse#next_page_token ListCertificatesResponse.next_page_token}. + # @param filter [::String] + # Optional. Only include resources that match the filter in the response. For + # details on supported filters and syntax, see [Certificates Filtering + # documentation](https://cloud.google.com/certificate-authority-service/docs/sorting-filtering-certificates#filtering_support). + # @param order_by [::String] + # Optional. Specify how the results should be sorted. For details on + # supported fields and syntax, see [Certificates Sorting + # documentation](https://cloud.google.com/certificate-authority-service/docs/sorting-filtering-certificates#sorting_support). + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Gapic::Rest::PagedEnumerable<::Google::Cloud::Security::PrivateCA::V1::Certificate>] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Gapic::Rest::PagedEnumerable<::Google::Cloud::Security::PrivateCA::V1::Certificate>] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/security/private_ca/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Security::PrivateCA::V1::CertificateAuthorityService::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Security::PrivateCA::V1::ListCertificatesRequest.new + # + # # Call the list_certificates method. + # result = client.list_certificates request + # + # # The returned object is of type Gapic::PagedEnumerable. You can iterate + # # over elements, and API calls will be issued to fetch pages as needed. + # result.each do |item| + # # Each element is of type ::Google::Cloud::Security::PrivateCA::V1::Certificate. + # p item + # end + # + def list_certificates request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Security::PrivateCA::V1::ListCertificatesRequest + + # Converts hash 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_certificates.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::Security::PrivateCA::V1::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + options.apply_defaults timeout: @config.rpcs.list_certificates.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.list_certificates.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @certificate_authority_service_stub.list_certificates request, options do |result, operation| + result = ::Gapic::Rest::PagedEnumerable.new @certificate_authority_service_stub, :list_certificates, "certificates", 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 + + ## + # Revoke a {::Google::Cloud::Security::PrivateCA::V1::Certificate Certificate}. + # + # @overload revoke_certificate(request, options = nil) + # Pass arguments to `revoke_certificate` via a request object, either of type + # {::Google::Cloud::Security::PrivateCA::V1::RevokeCertificateRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Security::PrivateCA::V1::RevokeCertificateRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @overload revoke_certificate(name: nil, reason: nil, request_id: nil) + # Pass arguments to `revoke_certificate` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param name [::String] + # Required. The resource name for this + # {::Google::Cloud::Security::PrivateCA::V1::Certificate Certificate} in the format + # `projects/*/locations/*/caPools/*/certificates/*`. + # @param reason [::Google::Cloud::Security::PrivateCA::V1::RevocationReason] + # Required. The + # {::Google::Cloud::Security::PrivateCA::V1::RevocationReason RevocationReason} for + # revoking this certificate. + # @param request_id [::String] + # Optional. An ID to identify requests. Specify a unique request ID so that + # if you must retry your request, the server will know to ignore the request + # if it has already been completed. The server will guarantee that for at + # least 60 minutes since the first request. + # + # For example, consider a situation where you make an initial request and + # the request times out. If you make the request again with the same request + # ID, the server can check if original operation with the same request ID + # was received, and if so, will ignore the second request. This prevents + # clients from accidentally creating duplicate commitments. + # + # The request ID must be a valid UUID with the exception that zero UUID is + # not supported (00000000-0000-0000-0000-000000000000). + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Cloud::Security::PrivateCA::V1::Certificate] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::Security::PrivateCA::V1::Certificate] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/security/private_ca/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Security::PrivateCA::V1::CertificateAuthorityService::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Security::PrivateCA::V1::RevokeCertificateRequest.new + # + # # Call the revoke_certificate method. + # result = client.revoke_certificate request + # + # # The returned object is of type Google::Cloud::Security::PrivateCA::V1::Certificate. + # p result + # + def revoke_certificate request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Security::PrivateCA::V1::RevokeCertificateRequest + + # Converts hash 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.revoke_certificate.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::Security::PrivateCA::V1::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + options.apply_defaults timeout: @config.rpcs.revoke_certificate.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.revoke_certificate.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @certificate_authority_service_stub.revoke_certificate 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 + + ## + # Update a {::Google::Cloud::Security::PrivateCA::V1::Certificate Certificate}. + # Currently, the only field you can update is the + # {::Google::Cloud::Security::PrivateCA::V1::Certificate#labels labels} field. + # + # @overload update_certificate(request, options = nil) + # Pass arguments to `update_certificate` via a request object, either of type + # {::Google::Cloud::Security::PrivateCA::V1::UpdateCertificateRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Security::PrivateCA::V1::UpdateCertificateRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_certificate(certificate: nil, update_mask: nil, request_id: nil) + # Pass arguments to `update_certificate` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param certificate [::Google::Cloud::Security::PrivateCA::V1::Certificate, ::Hash] + # Required. {::Google::Cloud::Security::PrivateCA::V1::Certificate Certificate} + # with updated values. + # @param update_mask [::Google::Protobuf::FieldMask, ::Hash] + # Required. A list of fields to be updated in this request. + # @param request_id [::String] + # Optional. An ID to identify requests. Specify a unique request ID so that + # if you must retry your request, the server will know to ignore the request + # if it has already been completed. The server will guarantee that for at + # least 60 minutes since the first request. + # + # For example, consider a situation where you make an initial request and + # the request times out. If you make the request again with the same request + # ID, the server can check if original operation with the same request ID + # was received, and if so, will ignore the second request. This prevents + # clients from accidentally creating duplicate commitments. + # + # The request ID must be a valid UUID with the exception that zero UUID is + # not supported (00000000-0000-0000-0000-000000000000). + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Cloud::Security::PrivateCA::V1::Certificate] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::Security::PrivateCA::V1::Certificate] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/security/private_ca/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Security::PrivateCA::V1::CertificateAuthorityService::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Security::PrivateCA::V1::UpdateCertificateRequest.new + # + # # Call the update_certificate method. + # result = client.update_certificate request + # + # # The returned object is of type Google::Cloud::Security::PrivateCA::V1::Certificate. + # p result + # + def update_certificate request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Security::PrivateCA::V1::UpdateCertificateRequest + + # Converts hash 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_certificate.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::Security::PrivateCA::V1::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + options.apply_defaults timeout: @config.rpcs.update_certificate.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.update_certificate.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @certificate_authority_service_stub.update_certificate 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 + + ## + # Activate a + # {::Google::Cloud::Security::PrivateCA::V1::CertificateAuthority CertificateAuthority} + # that is in state + # {::Google::Cloud::Security::PrivateCA::V1::CertificateAuthority::State::AWAITING_USER_ACTIVATION AWAITING_USER_ACTIVATION} + # and is of type + # {::Google::Cloud::Security::PrivateCA::V1::CertificateAuthority::Type::SUBORDINATE SUBORDINATE}. + # After the parent Certificate Authority signs a certificate signing request + # from + # {::Google::Cloud::Security::PrivateCA::V1::CertificateAuthorityService::Rest::Client#fetch_certificate_authority_csr FetchCertificateAuthorityCsr}, + # this method can complete the activation process. + # + # @overload activate_certificate_authority(request, options = nil) + # Pass arguments to `activate_certificate_authority` via a request object, either of type + # {::Google::Cloud::Security::PrivateCA::V1::ActivateCertificateAuthorityRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Security::PrivateCA::V1::ActivateCertificateAuthorityRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @overload activate_certificate_authority(name: nil, pem_ca_certificate: nil, subordinate_config: nil, request_id: nil) + # Pass arguments to `activate_certificate_authority` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param name [::String] + # Required. The resource name for this + # {::Google::Cloud::Security::PrivateCA::V1::CertificateAuthority CertificateAuthority} + # in the format `projects/*/locations/*/caPools/*/certificateAuthorities/*`. + # @param pem_ca_certificate [::String] + # Required. The signed CA certificate issued from + # {::Google::Cloud::Security::PrivateCA::V1::FetchCertificateAuthorityCsrResponse#pem_csr FetchCertificateAuthorityCsrResponse.pem_csr}. + # @param subordinate_config [::Google::Cloud::Security::PrivateCA::V1::SubordinateConfig, ::Hash] + # Required. Must include information about the issuer of + # 'pem_ca_certificate', and any further issuers until the self-signed CA. + # @param request_id [::String] + # Optional. An ID to identify requests. Specify a unique request ID so that + # if you must retry your request, the server will know to ignore the request + # if it has already been completed. The server will guarantee that for at + # least 60 minutes since the first request. + # + # For example, consider a situation where you make an initial request and + # the request times out. If you make the request again with the same request + # ID, the server can check if original operation with the same request ID + # was received, and if so, will ignore the second request. This prevents + # clients from accidentally creating duplicate commitments. + # + # The request ID must be a valid UUID with the exception that zero UUID is + # not supported (00000000-0000-0000-0000-000000000000). + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Gapic::Operation] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Gapic::Operation] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/security/private_ca/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Security::PrivateCA::V1::CertificateAuthorityService::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Security::PrivateCA::V1::ActivateCertificateAuthorityRequest.new + # + # # Call the activate_certificate_authority method. + # result = client.activate_certificate_authority 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 activate_certificate_authority request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Security::PrivateCA::V1::ActivateCertificateAuthorityRequest + + # Converts hash 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.activate_certificate_authority.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::Security::PrivateCA::V1::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + options.apply_defaults timeout: @config.rpcs.activate_certificate_authority.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.activate_certificate_authority.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @certificate_authority_service_stub.activate_certificate_authority 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 + + ## + # Create a new + # {::Google::Cloud::Security::PrivateCA::V1::CertificateAuthority CertificateAuthority} + # in a given Project and Location. + # + # @overload create_certificate_authority(request, options = nil) + # Pass arguments to `create_certificate_authority` via a request object, either of type + # {::Google::Cloud::Security::PrivateCA::V1::CreateCertificateAuthorityRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Security::PrivateCA::V1::CreateCertificateAuthorityRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_certificate_authority(parent: nil, certificate_authority_id: nil, certificate_authority: nil, request_id: nil) + # Pass arguments to `create_certificate_authority` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param parent [::String] + # Required. The resource name of the + # {::Google::Cloud::Security::PrivateCA::V1::CaPool CaPool} associated with the + # {::Google::Cloud::Security::PrivateCA::V1::CertificateAuthority CertificateAuthorities}, + # in the format `projects/*/locations/*/caPools/*`. + # @param certificate_authority_id [::String] + # Required. It must be unique within a location and match the regular + # expression `[a-zA-Z0-9_-]{1,63}` + # @param certificate_authority [::Google::Cloud::Security::PrivateCA::V1::CertificateAuthority, ::Hash] + # Required. A + # {::Google::Cloud::Security::PrivateCA::V1::CertificateAuthority CertificateAuthority} + # with initial field values. + # @param request_id [::String] + # Optional. An ID to identify requests. Specify a unique request ID so that + # if you must retry your request, the server will know to ignore the request + # if it has already been completed. The server will guarantee that for at + # least 60 minutes since the first request. + # + # For example, consider a situation where you make an initial request and + # the request times out. If you make the request again with the same request + # ID, the server can check if original operation with the same request ID + # was received, and if so, will ignore the second request. This prevents + # clients from accidentally creating duplicate commitments. + # + # The request ID must be a valid UUID with the exception that zero UUID is + # not supported (00000000-0000-0000-0000-000000000000). + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Gapic::Operation] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Gapic::Operation] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/security/private_ca/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Security::PrivateCA::V1::CertificateAuthorityService::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Security::PrivateCA::V1::CreateCertificateAuthorityRequest.new + # + # # Call the create_certificate_authority method. + # result = client.create_certificate_authority 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_certificate_authority request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Security::PrivateCA::V1::CreateCertificateAuthorityRequest + + # Converts hash 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_certificate_authority.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::Security::PrivateCA::V1::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + options.apply_defaults timeout: @config.rpcs.create_certificate_authority.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.create_certificate_authority.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @certificate_authority_service_stub.create_certificate_authority 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 + + ## + # Disable a + # {::Google::Cloud::Security::PrivateCA::V1::CertificateAuthority CertificateAuthority}. + # + # @overload disable_certificate_authority(request, options = nil) + # Pass arguments to `disable_certificate_authority` via a request object, either of type + # {::Google::Cloud::Security::PrivateCA::V1::DisableCertificateAuthorityRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Security::PrivateCA::V1::DisableCertificateAuthorityRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @overload disable_certificate_authority(name: nil, request_id: nil, ignore_dependent_resources: nil) + # Pass arguments to `disable_certificate_authority` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param name [::String] + # Required. The resource name for this + # {::Google::Cloud::Security::PrivateCA::V1::CertificateAuthority CertificateAuthority} + # in the format `projects/*/locations/*/caPools/*/certificateAuthorities/*`. + # @param request_id [::String] + # Optional. An ID to identify requests. Specify a unique request ID so that + # if you must retry your request, the server will know to ignore the request + # if it has already been completed. The server will guarantee that for at + # least 60 minutes since the first request. + # + # For example, consider a situation where you make an initial request and + # the request times out. If you make the request again with the same request + # ID, the server can check if original operation with the same request ID + # was received, and if so, will ignore the second request. This prevents + # clients from accidentally creating duplicate commitments. + # + # The request ID must be a valid UUID with the exception that zero UUID is + # not supported (00000000-0000-0000-0000-000000000000). + # @param ignore_dependent_resources [::Boolean] + # Optional. This field allows this CA to be disabled even if it's being + # depended on by another resource. However, doing so may result in unintended + # and unrecoverable effects on any dependent resources since the CA will + # no longer be able to issue certificates. + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Gapic::Operation] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Gapic::Operation] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/security/private_ca/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Security::PrivateCA::V1::CertificateAuthorityService::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Security::PrivateCA::V1::DisableCertificateAuthorityRequest.new + # + # # Call the disable_certificate_authority method. + # result = client.disable_certificate_authority 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 disable_certificate_authority request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Security::PrivateCA::V1::DisableCertificateAuthorityRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + call_metadata = @config.rpcs.disable_certificate_authority.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::Security::PrivateCA::V1::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + options.apply_defaults timeout: @config.rpcs.disable_certificate_authority.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.disable_certificate_authority.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @certificate_authority_service_stub.disable_certificate_authority 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 + + ## + # Enable a + # {::Google::Cloud::Security::PrivateCA::V1::CertificateAuthority CertificateAuthority}. + # + # @overload enable_certificate_authority(request, options = nil) + # Pass arguments to `enable_certificate_authority` via a request object, either of type + # {::Google::Cloud::Security::PrivateCA::V1::EnableCertificateAuthorityRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Security::PrivateCA::V1::EnableCertificateAuthorityRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @overload enable_certificate_authority(name: nil, request_id: nil) + # Pass arguments to `enable_certificate_authority` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param name [::String] + # Required. The resource name for this + # {::Google::Cloud::Security::PrivateCA::V1::CertificateAuthority CertificateAuthority} + # in the format `projects/*/locations/*/caPools/*/certificateAuthorities/*`. + # @param request_id [::String] + # Optional. An ID to identify requests. Specify a unique request ID so that + # if you must retry your request, the server will know to ignore the request + # if it has already been completed. The server will guarantee that for at + # least 60 minutes since the first request. + # + # For example, consider a situation where you make an initial request and + # the request times out. If you make the request again with the same request + # ID, the server can check if original operation with the same request ID + # was received, and if so, will ignore the second request. This prevents + # clients from accidentally creating duplicate commitments. + # + # The request ID must be a valid UUID with the exception that zero UUID is + # not supported (00000000-0000-0000-0000-000000000000). + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Gapic::Operation] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Gapic::Operation] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/security/private_ca/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Security::PrivateCA::V1::CertificateAuthorityService::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Security::PrivateCA::V1::EnableCertificateAuthorityRequest.new + # + # # Call the enable_certificate_authority method. + # result = client.enable_certificate_authority 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 enable_certificate_authority request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Security::PrivateCA::V1::EnableCertificateAuthorityRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + call_metadata = @config.rpcs.enable_certificate_authority.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::Security::PrivateCA::V1::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + options.apply_defaults timeout: @config.rpcs.enable_certificate_authority.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.enable_certificate_authority.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @certificate_authority_service_stub.enable_certificate_authority 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 + + ## + # Fetch a certificate signing request (CSR) from a + # {::Google::Cloud::Security::PrivateCA::V1::CertificateAuthority CertificateAuthority} + # that is in state + # {::Google::Cloud::Security::PrivateCA::V1::CertificateAuthority::State::AWAITING_USER_ACTIVATION AWAITING_USER_ACTIVATION} + # and is of type + # {::Google::Cloud::Security::PrivateCA::V1::CertificateAuthority::Type::SUBORDINATE SUBORDINATE}. + # The CSR must then be signed by the desired parent Certificate Authority, + # which could be another + # {::Google::Cloud::Security::PrivateCA::V1::CertificateAuthority CertificateAuthority} + # resource, or could be an on-prem certificate authority. See also + # {::Google::Cloud::Security::PrivateCA::V1::CertificateAuthorityService::Rest::Client#activate_certificate_authority ActivateCertificateAuthority}. + # + # @overload fetch_certificate_authority_csr(request, options = nil) + # Pass arguments to `fetch_certificate_authority_csr` via a request object, either of type + # {::Google::Cloud::Security::PrivateCA::V1::FetchCertificateAuthorityCsrRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Security::PrivateCA::V1::FetchCertificateAuthorityCsrRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @overload fetch_certificate_authority_csr(name: nil) + # Pass arguments to `fetch_certificate_authority_csr` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param name [::String] + # Required. The resource name for this + # {::Google::Cloud::Security::PrivateCA::V1::CertificateAuthority CertificateAuthority} + # in the format `projects/*/locations/*/caPools/*/certificateAuthorities/*`. + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Cloud::Security::PrivateCA::V1::FetchCertificateAuthorityCsrResponse] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::Security::PrivateCA::V1::FetchCertificateAuthorityCsrResponse] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/security/private_ca/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Security::PrivateCA::V1::CertificateAuthorityService::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Security::PrivateCA::V1::FetchCertificateAuthorityCsrRequest.new + # + # # Call the fetch_certificate_authority_csr method. + # result = client.fetch_certificate_authority_csr request + # + # # The returned object is of type Google::Cloud::Security::PrivateCA::V1::FetchCertificateAuthorityCsrResponse. + # p result + # + def fetch_certificate_authority_csr request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Security::PrivateCA::V1::FetchCertificateAuthorityCsrRequest + + # Converts hash 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.fetch_certificate_authority_csr.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::Security::PrivateCA::V1::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + options.apply_defaults timeout: @config.rpcs.fetch_certificate_authority_csr.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.fetch_certificate_authority_csr.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @certificate_authority_service_stub.fetch_certificate_authority_csr request, options do |result, operation| + yield result, operation if block_given? + end + rescue ::Gapic::Rest::Error => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Returns a + # {::Google::Cloud::Security::PrivateCA::V1::CertificateAuthority CertificateAuthority}. + # + # @overload get_certificate_authority(request, options = nil) + # Pass arguments to `get_certificate_authority` via a request object, either of type + # {::Google::Cloud::Security::PrivateCA::V1::GetCertificateAuthorityRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Security::PrivateCA::V1::GetCertificateAuthorityRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_certificate_authority(name: nil) + # Pass arguments to `get_certificate_authority` via keyword arguments. Note that at + # least one keyword argument is 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 + # {::Google::Cloud::Security::PrivateCA::V1::CertificateAuthority#name name} of the + # {::Google::Cloud::Security::PrivateCA::V1::CertificateAuthority CertificateAuthority} + # to get. + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Cloud::Security::PrivateCA::V1::CertificateAuthority] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::Security::PrivateCA::V1::CertificateAuthority] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/security/private_ca/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Security::PrivateCA::V1::CertificateAuthorityService::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Security::PrivateCA::V1::GetCertificateAuthorityRequest.new + # + # # Call the get_certificate_authority method. + # result = client.get_certificate_authority request + # + # # The returned object is of type Google::Cloud::Security::PrivateCA::V1::CertificateAuthority. + # p result + # + def get_certificate_authority request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Security::PrivateCA::V1::GetCertificateAuthorityRequest + + # Converts hash 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_certificate_authority.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::Security::PrivateCA::V1::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + options.apply_defaults timeout: @config.rpcs.get_certificate_authority.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.get_certificate_authority.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @certificate_authority_service_stub.get_certificate_authority request, options do |result, operation| + yield result, operation if block_given? + end + rescue ::Gapic::Rest::Error => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Lists + # {::Google::Cloud::Security::PrivateCA::V1::CertificateAuthority CertificateAuthorities}. + # + # @overload list_certificate_authorities(request, options = nil) + # Pass arguments to `list_certificate_authorities` via a request object, either of type + # {::Google::Cloud::Security::PrivateCA::V1::ListCertificateAuthoritiesRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Security::PrivateCA::V1::ListCertificateAuthoritiesRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_certificate_authorities(parent: nil, page_size: nil, page_token: nil, filter: nil, order_by: nil) + # Pass arguments to `list_certificate_authorities` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param parent [::String] + # Required. The resource name of the + # {::Google::Cloud::Security::PrivateCA::V1::CaPool CaPool} associated with the + # {::Google::Cloud::Security::PrivateCA::V1::CertificateAuthority CertificateAuthorities}, + # in the format `projects/*/locations/*/caPools/*`. + # @param page_size [::Integer] + # Optional. Limit on the number of + # {::Google::Cloud::Security::PrivateCA::V1::CertificateAuthority CertificateAuthorities} + # to include in the response. Further + # {::Google::Cloud::Security::PrivateCA::V1::CertificateAuthority CertificateAuthorities} + # can subsequently be obtained by including the + # {::Google::Cloud::Security::PrivateCA::V1::ListCertificateAuthoritiesResponse#next_page_token ListCertificateAuthoritiesResponse.next_page_token} + # in a subsequent request. If unspecified, the server will pick an + # appropriate default. + # @param page_token [::String] + # Optional. Pagination token, returned earlier via + # {::Google::Cloud::Security::PrivateCA::V1::ListCertificateAuthoritiesResponse#next_page_token ListCertificateAuthoritiesResponse.next_page_token}. + # @param filter [::String] + # Optional. Only include resources that match the filter in the response. + # @param order_by [::String] + # Optional. Specify how the results should be sorted. + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Gapic::Rest::PagedEnumerable<::Google::Cloud::Security::PrivateCA::V1::CertificateAuthority>] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Gapic::Rest::PagedEnumerable<::Google::Cloud::Security::PrivateCA::V1::CertificateAuthority>] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/security/private_ca/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Security::PrivateCA::V1::CertificateAuthorityService::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Security::PrivateCA::V1::ListCertificateAuthoritiesRequest.new + # + # # Call the list_certificate_authorities method. + # result = client.list_certificate_authorities request + # + # # The returned object is of type Gapic::PagedEnumerable. You can iterate + # # over elements, and API calls will be issued to fetch pages as needed. + # result.each do |item| + # # Each element is of type ::Google::Cloud::Security::PrivateCA::V1::CertificateAuthority. + # p item + # end + # + def list_certificate_authorities request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Security::PrivateCA::V1::ListCertificateAuthoritiesRequest + + # Converts hash 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_certificate_authorities.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::Security::PrivateCA::V1::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + options.apply_defaults timeout: @config.rpcs.list_certificate_authorities.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.list_certificate_authorities.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @certificate_authority_service_stub.list_certificate_authorities request, options do |result, operation| + result = ::Gapic::Rest::PagedEnumerable.new @certificate_authority_service_stub, :list_certificate_authorities, "certificate_authorities", 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 + + ## + # Undelete a + # {::Google::Cloud::Security::PrivateCA::V1::CertificateAuthority CertificateAuthority} + # that has been deleted. + # + # @overload undelete_certificate_authority(request, options = nil) + # Pass arguments to `undelete_certificate_authority` via a request object, either of type + # {::Google::Cloud::Security::PrivateCA::V1::UndeleteCertificateAuthorityRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Security::PrivateCA::V1::UndeleteCertificateAuthorityRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @overload undelete_certificate_authority(name: nil, request_id: nil) + # Pass arguments to `undelete_certificate_authority` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param name [::String] + # Required. The resource name for this + # {::Google::Cloud::Security::PrivateCA::V1::CertificateAuthority CertificateAuthority} + # in the format `projects/*/locations/*/caPools/*/certificateAuthorities/*`. + # @param request_id [::String] + # Optional. An ID to identify requests. Specify a unique request ID so that + # if you must retry your request, the server will know to ignore the request + # if it has already been completed. The server will guarantee that for at + # least 60 minutes since the first request. + # + # For example, consider a situation where you make an initial request and + # the request times out. If you make the request again with the same request + # ID, the server can check if original operation with the same request ID + # was received, and if so, will ignore the second request. This prevents + # clients from accidentally creating duplicate commitments. + # + # The request ID must be a valid UUID with the exception that zero UUID is + # not supported (00000000-0000-0000-0000-000000000000). + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Gapic::Operation] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Gapic::Operation] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/security/private_ca/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Security::PrivateCA::V1::CertificateAuthorityService::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Security::PrivateCA::V1::UndeleteCertificateAuthorityRequest.new + # + # # Call the undelete_certificate_authority method. + # result = client.undelete_certificate_authority 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 undelete_certificate_authority request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Security::PrivateCA::V1::UndeleteCertificateAuthorityRequest + + # Converts hash 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.undelete_certificate_authority.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::Security::PrivateCA::V1::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + options.apply_defaults timeout: @config.rpcs.undelete_certificate_authority.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.undelete_certificate_authority.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @certificate_authority_service_stub.undelete_certificate_authority 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 + + ## + # Delete a + # {::Google::Cloud::Security::PrivateCA::V1::CertificateAuthority CertificateAuthority}. + # + # @overload delete_certificate_authority(request, options = nil) + # Pass arguments to `delete_certificate_authority` via a request object, either of type + # {::Google::Cloud::Security::PrivateCA::V1::DeleteCertificateAuthorityRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Security::PrivateCA::V1::DeleteCertificateAuthorityRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_certificate_authority(name: nil, request_id: nil, ignore_active_certificates: nil, skip_grace_period: nil, ignore_dependent_resources: nil) + # Pass arguments to `delete_certificate_authority` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param name [::String] + # Required. The resource name for this + # {::Google::Cloud::Security::PrivateCA::V1::CertificateAuthority CertificateAuthority} + # in the format `projects/*/locations/*/caPools/*/certificateAuthorities/*`. + # @param request_id [::String] + # Optional. An ID to identify requests. Specify a unique request ID so that + # if you must retry your request, the server will know to ignore the request + # if it has already been completed. The server will guarantee that for at + # least 60 minutes since the first request. + # + # For example, consider a situation where you make an initial request and + # the request times out. If you make the request again with the same request + # ID, the server can check if original operation with the same request ID + # was received, and if so, will ignore the second request. This prevents + # clients from accidentally creating duplicate commitments. + # + # The request ID must be a valid UUID with the exception that zero UUID is + # not supported (00000000-0000-0000-0000-000000000000). + # @param ignore_active_certificates [::Boolean] + # Optional. This field allows the CA to be deleted even if the CA has + # active certs. Active certs include both unrevoked and unexpired certs. + # @param skip_grace_period [::Boolean] + # Optional. If this flag is set, the Certificate Authority will be deleted as + # soon as possible without a 30-day grace period where undeletion would have + # been allowed. If you proceed, there will be no way to recover this CA. + # @param ignore_dependent_resources [::Boolean] + # Optional. This field allows this CA to be deleted even if it's being + # depended on by another resource. However, doing so may result in unintended + # and unrecoverable effects on any dependent resources since the CA will + # no longer be able to issue certificates. + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Gapic::Operation] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Gapic::Operation] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/security/private_ca/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Security::PrivateCA::V1::CertificateAuthorityService::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Security::PrivateCA::V1::DeleteCertificateAuthorityRequest.new + # + # # Call the delete_certificate_authority method. + # result = client.delete_certificate_authority 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_certificate_authority request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Security::PrivateCA::V1::DeleteCertificateAuthorityRequest + + # Converts hash 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_certificate_authority.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::Security::PrivateCA::V1::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + options.apply_defaults timeout: @config.rpcs.delete_certificate_authority.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.delete_certificate_authority.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @certificate_authority_service_stub.delete_certificate_authority 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 + + ## + # Update a + # {::Google::Cloud::Security::PrivateCA::V1::CertificateAuthority CertificateAuthority}. + # + # @overload update_certificate_authority(request, options = nil) + # Pass arguments to `update_certificate_authority` via a request object, either of type + # {::Google::Cloud::Security::PrivateCA::V1::UpdateCertificateAuthorityRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Security::PrivateCA::V1::UpdateCertificateAuthorityRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_certificate_authority(certificate_authority: nil, update_mask: nil, request_id: nil) + # Pass arguments to `update_certificate_authority` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param certificate_authority [::Google::Cloud::Security::PrivateCA::V1::CertificateAuthority, ::Hash] + # Required. + # {::Google::Cloud::Security::PrivateCA::V1::CertificateAuthority CertificateAuthority} + # with updated values. + # @param update_mask [::Google::Protobuf::FieldMask, ::Hash] + # Required. A list of fields to be updated in this request. + # @param request_id [::String] + # Optional. An ID to identify requests. Specify a unique request ID so that + # if you must retry your request, the server will know to ignore the request + # if it has already been completed. The server will guarantee that for at + # least 60 minutes since the first request. + # + # For example, consider a situation where you make an initial request and + # the request times out. If you make the request again with the same request + # ID, the server can check if original operation with the same request ID + # was received, and if so, will ignore the second request. This prevents + # clients from accidentally creating duplicate commitments. + # + # The request ID must be a valid UUID with the exception that zero UUID is + # not supported (00000000-0000-0000-0000-000000000000). + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Gapic::Operation] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Gapic::Operation] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/security/private_ca/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Security::PrivateCA::V1::CertificateAuthorityService::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Security::PrivateCA::V1::UpdateCertificateAuthorityRequest.new + # + # # Call the update_certificate_authority method. + # result = client.update_certificate_authority 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_certificate_authority request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Security::PrivateCA::V1::UpdateCertificateAuthorityRequest + + # Converts hash 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_certificate_authority.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::Security::PrivateCA::V1::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + options.apply_defaults timeout: @config.rpcs.update_certificate_authority.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.update_certificate_authority.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @certificate_authority_service_stub.update_certificate_authority 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 + + ## + # Create a {::Google::Cloud::Security::PrivateCA::V1::CaPool CaPool}. + # + # @overload create_ca_pool(request, options = nil) + # Pass arguments to `create_ca_pool` via a request object, either of type + # {::Google::Cloud::Security::PrivateCA::V1::CreateCaPoolRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Security::PrivateCA::V1::CreateCaPoolRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_ca_pool(parent: nil, ca_pool_id: nil, ca_pool: nil, request_id: nil) + # Pass arguments to `create_ca_pool` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param parent [::String] + # Required. The resource name of the location associated with the + # {::Google::Cloud::Security::PrivateCA::V1::CaPool CaPool}, in the format + # `projects/*/locations/*`. + # @param ca_pool_id [::String] + # Required. It must be unique within a location and match the regular + # expression `[a-zA-Z0-9_-]{1,63}` + # @param ca_pool [::Google::Cloud::Security::PrivateCA::V1::CaPool, ::Hash] + # Required. A {::Google::Cloud::Security::PrivateCA::V1::CaPool CaPool} with + # initial field values. + # @param request_id [::String] + # Optional. An ID to identify requests. Specify a unique request ID so that + # if you must retry your request, the server will know to ignore the request + # if it has already been completed. The server will guarantee that for at + # least 60 minutes since the first request. + # + # For example, consider a situation where you make an initial request and + # the request times out. If you make the request again with the same request + # ID, the server can check if original operation with the same request ID + # was received, and if so, will ignore the second request. This prevents + # clients from accidentally creating duplicate commitments. + # + # The request ID must be a valid UUID with the exception that zero UUID is + # not supported (00000000-0000-0000-0000-000000000000). + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Gapic::Operation] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Gapic::Operation] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/security/private_ca/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Security::PrivateCA::V1::CertificateAuthorityService::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Security::PrivateCA::V1::CreateCaPoolRequest.new + # + # # Call the create_ca_pool method. + # result = client.create_ca_pool 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_ca_pool request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Security::PrivateCA::V1::CreateCaPoolRequest + + # Converts hash 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_ca_pool.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::Security::PrivateCA::V1::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + options.apply_defaults timeout: @config.rpcs.create_ca_pool.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.create_ca_pool.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @certificate_authority_service_stub.create_ca_pool 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 + + ## + # Update a {::Google::Cloud::Security::PrivateCA::V1::CaPool CaPool}. + # + # @overload update_ca_pool(request, options = nil) + # Pass arguments to `update_ca_pool` via a request object, either of type + # {::Google::Cloud::Security::PrivateCA::V1::UpdateCaPoolRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Security::PrivateCA::V1::UpdateCaPoolRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_ca_pool(ca_pool: nil, update_mask: nil, request_id: nil) + # Pass arguments to `update_ca_pool` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param ca_pool [::Google::Cloud::Security::PrivateCA::V1::CaPool, ::Hash] + # Required. {::Google::Cloud::Security::PrivateCA::V1::CaPool CaPool} with updated + # values. + # @param update_mask [::Google::Protobuf::FieldMask, ::Hash] + # Required. A list of fields to be updated in this request. + # @param request_id [::String] + # Optional. An ID to identify requests. Specify a unique request ID so that + # if you must retry your request, the server will know to ignore the request + # if it has already been completed. The server will guarantee that for at + # least 60 minutes since the first request. + # + # For example, consider a situation where you make an initial request and + # the request times out. If you make the request again with the same request + # ID, the server can check if original operation with the same request ID + # was received, and if so, will ignore the second request. This prevents + # clients from accidentally creating duplicate commitments. + # + # The request ID must be a valid UUID with the exception that zero UUID is + # not supported (00000000-0000-0000-0000-000000000000). + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Gapic::Operation] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Gapic::Operation] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/security/private_ca/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Security::PrivateCA::V1::CertificateAuthorityService::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Security::PrivateCA::V1::UpdateCaPoolRequest.new + # + # # Call the update_ca_pool method. + # result = client.update_ca_pool 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_ca_pool request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Security::PrivateCA::V1::UpdateCaPoolRequest + + # Converts hash 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_ca_pool.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::Security::PrivateCA::V1::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + options.apply_defaults timeout: @config.rpcs.update_ca_pool.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.update_ca_pool.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @certificate_authority_service_stub.update_ca_pool 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 + + ## + # Returns a {::Google::Cloud::Security::PrivateCA::V1::CaPool CaPool}. + # + # @overload get_ca_pool(request, options = nil) + # Pass arguments to `get_ca_pool` via a request object, either of type + # {::Google::Cloud::Security::PrivateCA::V1::GetCaPoolRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Security::PrivateCA::V1::GetCaPoolRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_ca_pool(name: nil) + # Pass arguments to `get_ca_pool` via keyword arguments. Note that at + # least one keyword argument is 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 {::Google::Cloud::Security::PrivateCA::V1::CaPool#name name} of the + # {::Google::Cloud::Security::PrivateCA::V1::CaPool CaPool} to get. + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Cloud::Security::PrivateCA::V1::CaPool] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::Security::PrivateCA::V1::CaPool] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/security/private_ca/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Security::PrivateCA::V1::CertificateAuthorityService::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Security::PrivateCA::V1::GetCaPoolRequest.new + # + # # Call the get_ca_pool method. + # result = client.get_ca_pool request + # + # # The returned object is of type Google::Cloud::Security::PrivateCA::V1::CaPool. + # p result + # + def get_ca_pool request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Security::PrivateCA::V1::GetCaPoolRequest + + # Converts hash 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_ca_pool.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::Security::PrivateCA::V1::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + options.apply_defaults timeout: @config.rpcs.get_ca_pool.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.get_ca_pool.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @certificate_authority_service_stub.get_ca_pool request, options do |result, operation| + yield result, operation if block_given? + end + rescue ::Gapic::Rest::Error => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Lists {::Google::Cloud::Security::PrivateCA::V1::CaPool CaPools}. + # + # @overload list_ca_pools(request, options = nil) + # Pass arguments to `list_ca_pools` via a request object, either of type + # {::Google::Cloud::Security::PrivateCA::V1::ListCaPoolsRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Security::PrivateCA::V1::ListCaPoolsRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_ca_pools(parent: nil, page_size: nil, page_token: nil, filter: nil, order_by: nil) + # Pass arguments to `list_ca_pools` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param parent [::String] + # Required. The resource name of the location associated with the + # {::Google::Cloud::Security::PrivateCA::V1::CaPool CaPools}, in the format + # `projects/*/locations/*`. + # @param page_size [::Integer] + # Optional. Limit on the number of + # {::Google::Cloud::Security::PrivateCA::V1::CaPool CaPools} to include in the + # response. Further {::Google::Cloud::Security::PrivateCA::V1::CaPool CaPools} can + # subsequently be obtained by including the + # {::Google::Cloud::Security::PrivateCA::V1::ListCaPoolsResponse#next_page_token ListCaPoolsResponse.next_page_token} + # in a subsequent request. If unspecified, the server will pick an + # appropriate default. + # @param page_token [::String] + # Optional. Pagination token, returned earlier via + # {::Google::Cloud::Security::PrivateCA::V1::ListCaPoolsResponse#next_page_token ListCaPoolsResponse.next_page_token}. + # @param filter [::String] + # Optional. Only include resources that match the filter in the response. + # @param order_by [::String] + # Optional. Specify how the results should be sorted. + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Gapic::Rest::PagedEnumerable<::Google::Cloud::Security::PrivateCA::V1::CaPool>] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Gapic::Rest::PagedEnumerable<::Google::Cloud::Security::PrivateCA::V1::CaPool>] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/security/private_ca/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Security::PrivateCA::V1::CertificateAuthorityService::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Security::PrivateCA::V1::ListCaPoolsRequest.new + # + # # Call the list_ca_pools method. + # result = client.list_ca_pools request + # + # # The returned object is of type Gapic::PagedEnumerable. You can iterate + # # over elements, and API calls will be issued to fetch pages as needed. + # result.each do |item| + # # Each element is of type ::Google::Cloud::Security::PrivateCA::V1::CaPool. + # p item + # end + # + def list_ca_pools request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Security::PrivateCA::V1::ListCaPoolsRequest + + # Converts hash 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_ca_pools.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::Security::PrivateCA::V1::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + options.apply_defaults timeout: @config.rpcs.list_ca_pools.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.list_ca_pools.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @certificate_authority_service_stub.list_ca_pools request, options do |result, operation| + result = ::Gapic::Rest::PagedEnumerable.new @certificate_authority_service_stub, :list_ca_pools, "ca_pools", 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 + + ## + # Delete a {::Google::Cloud::Security::PrivateCA::V1::CaPool CaPool}. + # + # @overload delete_ca_pool(request, options = nil) + # Pass arguments to `delete_ca_pool` via a request object, either of type + # {::Google::Cloud::Security::PrivateCA::V1::DeleteCaPoolRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Security::PrivateCA::V1::DeleteCaPoolRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_ca_pool(name: nil, request_id: nil, ignore_dependent_resources: nil) + # Pass arguments to `delete_ca_pool` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param name [::String] + # Required. The resource name for this + # {::Google::Cloud::Security::PrivateCA::V1::CaPool CaPool} in the format + # `projects/*/locations/*/caPools/*`. + # @param request_id [::String] + # Optional. An ID to identify requests. Specify a unique request ID so that + # if you must retry your request, the server will know to ignore the request + # if it has already been completed. The server will guarantee that for at + # least 60 minutes since the first request. + # + # For example, consider a situation where you make an initial request and + # the request times out. If you make the request again with the same request + # ID, the server can check if original operation with the same request ID + # was received, and if so, will ignore the second request. This prevents + # clients from accidentally creating duplicate commitments. + # + # The request ID must be a valid UUID with the exception that zero UUID is + # not supported (00000000-0000-0000-0000-000000000000). + # @param ignore_dependent_resources [::Boolean] + # Optional. This field allows this pool to be deleted even if it's being + # depended on by another resource. However, doing so may result in unintended + # and unrecoverable effects on any dependent resources since the pool will + # no longer be able to issue certificates. + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Gapic::Operation] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Gapic::Operation] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/security/private_ca/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Security::PrivateCA::V1::CertificateAuthorityService::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Security::PrivateCA::V1::DeleteCaPoolRequest.new + # + # # Call the delete_ca_pool method. + # result = client.delete_ca_pool 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_ca_pool request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Security::PrivateCA::V1::DeleteCaPoolRequest + + # Converts hash 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_ca_pool.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::Security::PrivateCA::V1::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + options.apply_defaults timeout: @config.rpcs.delete_ca_pool.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.delete_ca_pool.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @certificate_authority_service_stub.delete_ca_pool 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 + + ## + # FetchCaCerts returns the current trust anchor for the + # {::Google::Cloud::Security::PrivateCA::V1::CaPool CaPool}. This will include CA + # certificate chains for all certificate authorities in the ENABLED, + # DISABLED, or STAGED states. + # + # @overload fetch_ca_certs(request, options = nil) + # Pass arguments to `fetch_ca_certs` via a request object, either of type + # {::Google::Cloud::Security::PrivateCA::V1::FetchCaCertsRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Security::PrivateCA::V1::FetchCaCertsRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @overload fetch_ca_certs(ca_pool: nil, request_id: nil) + # Pass arguments to `fetch_ca_certs` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param ca_pool [::String] + # Required. The resource name for the + # {::Google::Cloud::Security::PrivateCA::V1::CaPool CaPool} in the format + # `projects/*/locations/*/caPools/*`. + # @param request_id [::String] + # Optional. An ID to identify requests. Specify a unique request ID so that + # if you must retry your request, the server will know to ignore the request + # if it has already been completed. The server will guarantee that for at + # least 60 minutes since the first request. + # + # For example, consider a situation where you make an initial request and + # the request times out. If you make the request again with the same request + # ID, the server can check if original operation with the same request ID + # was received, and if so, will ignore the second request. This prevents + # clients from accidentally creating duplicate commitments. + # + # The request ID must be a valid UUID with the exception that zero UUID is + # not supported (00000000-0000-0000-0000-000000000000). + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Cloud::Security::PrivateCA::V1::FetchCaCertsResponse] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::Security::PrivateCA::V1::FetchCaCertsResponse] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/security/private_ca/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Security::PrivateCA::V1::CertificateAuthorityService::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Security::PrivateCA::V1::FetchCaCertsRequest.new + # + # # Call the fetch_ca_certs method. + # result = client.fetch_ca_certs request + # + # # The returned object is of type Google::Cloud::Security::PrivateCA::V1::FetchCaCertsResponse. + # p result + # + def fetch_ca_certs request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Security::PrivateCA::V1::FetchCaCertsRequest + + # Converts hash 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.fetch_ca_certs.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::Security::PrivateCA::V1::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + options.apply_defaults timeout: @config.rpcs.fetch_ca_certs.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.fetch_ca_certs.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @certificate_authority_service_stub.fetch_ca_certs request, options do |result, operation| + yield result, operation if block_given? + end + rescue ::Gapic::Rest::Error => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Returns a + # {::Google::Cloud::Security::PrivateCA::V1::CertificateRevocationList CertificateRevocationList}. + # + # @overload get_certificate_revocation_list(request, options = nil) + # Pass arguments to `get_certificate_revocation_list` via a request object, either of type + # {::Google::Cloud::Security::PrivateCA::V1::GetCertificateRevocationListRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Security::PrivateCA::V1::GetCertificateRevocationListRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_certificate_revocation_list(name: nil) + # Pass arguments to `get_certificate_revocation_list` via keyword arguments. Note that at + # least one keyword argument is 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 + # {::Google::Cloud::Security::PrivateCA::V1::CertificateRevocationList#name name} + # of the + # {::Google::Cloud::Security::PrivateCA::V1::CertificateRevocationList CertificateRevocationList} + # to get. + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Cloud::Security::PrivateCA::V1::CertificateRevocationList] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::Security::PrivateCA::V1::CertificateRevocationList] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/security/private_ca/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Security::PrivateCA::V1::CertificateAuthorityService::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Security::PrivateCA::V1::GetCertificateRevocationListRequest.new + # + # # Call the get_certificate_revocation_list method. + # result = client.get_certificate_revocation_list request + # + # # The returned object is of type Google::Cloud::Security::PrivateCA::V1::CertificateRevocationList. + # p result + # + def get_certificate_revocation_list request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Security::PrivateCA::V1::GetCertificateRevocationListRequest + + # Converts hash 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_certificate_revocation_list.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::Security::PrivateCA::V1::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + options.apply_defaults timeout: @config.rpcs.get_certificate_revocation_list.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.get_certificate_revocation_list.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @certificate_authority_service_stub.get_certificate_revocation_list request, options do |result, operation| + yield result, operation if block_given? + end + rescue ::Gapic::Rest::Error => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Lists + # {::Google::Cloud::Security::PrivateCA::V1::CertificateRevocationList CertificateRevocationLists}. + # + # @overload list_certificate_revocation_lists(request, options = nil) + # Pass arguments to `list_certificate_revocation_lists` via a request object, either of type + # {::Google::Cloud::Security::PrivateCA::V1::ListCertificateRevocationListsRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Security::PrivateCA::V1::ListCertificateRevocationListsRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_certificate_revocation_lists(parent: nil, page_size: nil, page_token: nil, filter: nil, order_by: nil) + # Pass arguments to `list_certificate_revocation_lists` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param parent [::String] + # Required. The resource name of the location associated with the + # {::Google::Cloud::Security::PrivateCA::V1::CertificateRevocationList CertificateRevocationLists}, + # in the format `projects/*/locations/*/caPools/*/certificateAuthorities/*`. + # @param page_size [::Integer] + # Optional. Limit on the number of + # {::Google::Cloud::Security::PrivateCA::V1::CertificateRevocationList CertificateRevocationLists} + # to include in the response. Further + # {::Google::Cloud::Security::PrivateCA::V1::CertificateRevocationList CertificateRevocationLists} + # can subsequently be obtained by including the + # {::Google::Cloud::Security::PrivateCA::V1::ListCertificateRevocationListsResponse#next_page_token ListCertificateRevocationListsResponse.next_page_token} + # in a subsequent request. If unspecified, the server will pick an + # appropriate default. + # @param page_token [::String] + # Optional. Pagination token, returned earlier via + # {::Google::Cloud::Security::PrivateCA::V1::ListCertificateRevocationListsResponse#next_page_token ListCertificateRevocationListsResponse.next_page_token}. + # @param filter [::String] + # Optional. Only include resources that match the filter in the response. + # @param order_by [::String] + # Optional. Specify how the results should be sorted. + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Gapic::Rest::PagedEnumerable<::Google::Cloud::Security::PrivateCA::V1::CertificateRevocationList>] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Gapic::Rest::PagedEnumerable<::Google::Cloud::Security::PrivateCA::V1::CertificateRevocationList>] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/security/private_ca/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Security::PrivateCA::V1::CertificateAuthorityService::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Security::PrivateCA::V1::ListCertificateRevocationListsRequest.new + # + # # Call the list_certificate_revocation_lists method. + # result = client.list_certificate_revocation_lists request + # + # # The returned object is of type Gapic::PagedEnumerable. You can iterate + # # over elements, and API calls will be issued to fetch pages as needed. + # result.each do |item| + # # Each element is of type ::Google::Cloud::Security::PrivateCA::V1::CertificateRevocationList. + # p item + # end + # + def list_certificate_revocation_lists request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Security::PrivateCA::V1::ListCertificateRevocationListsRequest + + # Converts hash 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_certificate_revocation_lists.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::Security::PrivateCA::V1::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + options.apply_defaults timeout: @config.rpcs.list_certificate_revocation_lists.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.list_certificate_revocation_lists.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @certificate_authority_service_stub.list_certificate_revocation_lists request, options do |result, operation| + result = ::Gapic::Rest::PagedEnumerable.new @certificate_authority_service_stub, :list_certificate_revocation_lists, "certificate_revocation_lists", 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 + + ## + # Update a + # {::Google::Cloud::Security::PrivateCA::V1::CertificateRevocationList CertificateRevocationList}. + # + # @overload update_certificate_revocation_list(request, options = nil) + # Pass arguments to `update_certificate_revocation_list` via a request object, either of type + # {::Google::Cloud::Security::PrivateCA::V1::UpdateCertificateRevocationListRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Security::PrivateCA::V1::UpdateCertificateRevocationListRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_certificate_revocation_list(certificate_revocation_list: nil, update_mask: nil, request_id: nil) + # Pass arguments to `update_certificate_revocation_list` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param certificate_revocation_list [::Google::Cloud::Security::PrivateCA::V1::CertificateRevocationList, ::Hash] + # Required. + # {::Google::Cloud::Security::PrivateCA::V1::CertificateRevocationList CertificateRevocationList} + # with updated values. + # @param update_mask [::Google::Protobuf::FieldMask, ::Hash] + # Required. A list of fields to be updated in this request. + # @param request_id [::String] + # Optional. An ID to identify requests. Specify a unique request ID so that + # if you must retry your request, the server will know to ignore the request + # if it has already been completed. The server will guarantee that for at + # least 60 minutes since the first request. + # + # For example, consider a situation where you make an initial request and + # the request times out. If you make the request again with the same request + # ID, the server can check if original operation with the same request ID + # was received, and if so, will ignore the second request. This prevents + # clients from accidentally creating duplicate commitments. + # + # The request ID must be a valid UUID with the exception that zero UUID is + # not supported (00000000-0000-0000-0000-000000000000). + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Gapic::Operation] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Gapic::Operation] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/security/private_ca/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Security::PrivateCA::V1::CertificateAuthorityService::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Security::PrivateCA::V1::UpdateCertificateRevocationListRequest.new + # + # # Call the update_certificate_revocation_list method. + # result = client.update_certificate_revocation_list 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_certificate_revocation_list request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Security::PrivateCA::V1::UpdateCertificateRevocationListRequest + + # Converts hash 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_certificate_revocation_list.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::Security::PrivateCA::V1::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + options.apply_defaults timeout: @config.rpcs.update_certificate_revocation_list.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.update_certificate_revocation_list.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @certificate_authority_service_stub.update_certificate_revocation_list 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 + + ## + # Create a new + # {::Google::Cloud::Security::PrivateCA::V1::CertificateTemplate CertificateTemplate} + # in a given Project and Location. + # + # @overload create_certificate_template(request, options = nil) + # Pass arguments to `create_certificate_template` via a request object, either of type + # {::Google::Cloud::Security::PrivateCA::V1::CreateCertificateTemplateRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Security::PrivateCA::V1::CreateCertificateTemplateRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_certificate_template(parent: nil, certificate_template_id: nil, certificate_template: nil, request_id: nil) + # Pass arguments to `create_certificate_template` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param parent [::String] + # Required. The resource name of the location associated with the + # {::Google::Cloud::Security::PrivateCA::V1::CertificateTemplate CertificateTemplate}, + # in the format `projects/*/locations/*`. + # @param certificate_template_id [::String] + # Required. It must be unique within a location and match the regular + # expression `[a-zA-Z0-9_-]{1,63}` + # @param certificate_template [::Google::Cloud::Security::PrivateCA::V1::CertificateTemplate, ::Hash] + # Required. A + # {::Google::Cloud::Security::PrivateCA::V1::CertificateTemplate CertificateTemplate} + # with initial field values. + # @param request_id [::String] + # Optional. An ID to identify requests. Specify a unique request ID so that + # if you must retry your request, the server will know to ignore the request + # if it has already been completed. The server will guarantee that for at + # least 60 minutes since the first request. + # + # For example, consider a situation where you make an initial request and + # the request times out. If you make the request again with the same request + # ID, the server can check if original operation with the same request ID + # was received, and if so, will ignore the second request. This prevents + # clients from accidentally creating duplicate commitments. + # + # The request ID must be a valid UUID with the exception that zero UUID is + # not supported (00000000-0000-0000-0000-000000000000). + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Gapic::Operation] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Gapic::Operation] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/security/private_ca/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Security::PrivateCA::V1::CertificateAuthorityService::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Security::PrivateCA::V1::CreateCertificateTemplateRequest.new + # + # # Call the create_certificate_template method. + # result = client.create_certificate_template 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_certificate_template request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Security::PrivateCA::V1::CreateCertificateTemplateRequest + + # Converts hash 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_certificate_template.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::Security::PrivateCA::V1::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + options.apply_defaults timeout: @config.rpcs.create_certificate_template.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.create_certificate_template.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @certificate_authority_service_stub.create_certificate_template 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 + + ## + # DeleteCertificateTemplate deletes a + # {::Google::Cloud::Security::PrivateCA::V1::CertificateTemplate CertificateTemplate}. + # + # @overload delete_certificate_template(request, options = nil) + # Pass arguments to `delete_certificate_template` via a request object, either of type + # {::Google::Cloud::Security::PrivateCA::V1::DeleteCertificateTemplateRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Security::PrivateCA::V1::DeleteCertificateTemplateRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_certificate_template(name: nil, request_id: nil) + # Pass arguments to `delete_certificate_template` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param name [::String] + # Required. The resource name for this + # {::Google::Cloud::Security::PrivateCA::V1::CertificateTemplate CertificateTemplate} + # in the format `projects/*/locations/*/certificateTemplates/*`. + # @param request_id [::String] + # Optional. An ID to identify requests. Specify a unique request ID so that + # if you must retry your request, the server will know to ignore the request + # if it has already been completed. The server will guarantee that for at + # least 60 minutes since the first request. + # + # For example, consider a situation where you make an initial request and + # the request times out. If you make the request again with the same request + # ID, the server can check if original operation with the same request ID + # was received, and if so, will ignore the second request. This prevents + # clients from accidentally creating duplicate commitments. + # + # The request ID must be a valid UUID with the exception that zero UUID is + # not supported (00000000-0000-0000-0000-000000000000). + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Gapic::Operation] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Gapic::Operation] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/security/private_ca/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Security::PrivateCA::V1::CertificateAuthorityService::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Security::PrivateCA::V1::DeleteCertificateTemplateRequest.new + # + # # Call the delete_certificate_template method. + # result = client.delete_certificate_template 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_certificate_template request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Security::PrivateCA::V1::DeleteCertificateTemplateRequest + + # Converts hash 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_certificate_template.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::Security::PrivateCA::V1::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + options.apply_defaults timeout: @config.rpcs.delete_certificate_template.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.delete_certificate_template.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @certificate_authority_service_stub.delete_certificate_template 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 + + ## + # Returns a + # {::Google::Cloud::Security::PrivateCA::V1::CertificateTemplate CertificateTemplate}. + # + # @overload get_certificate_template(request, options = nil) + # Pass arguments to `get_certificate_template` via a request object, either of type + # {::Google::Cloud::Security::PrivateCA::V1::GetCertificateTemplateRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Security::PrivateCA::V1::GetCertificateTemplateRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_certificate_template(name: nil) + # Pass arguments to `get_certificate_template` via keyword arguments. Note that at + # least one keyword argument is 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 + # {::Google::Cloud::Security::PrivateCA::V1::CertificateTemplate#name name} of the + # {::Google::Cloud::Security::PrivateCA::V1::CertificateTemplate CertificateTemplate} + # to get. + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Cloud::Security::PrivateCA::V1::CertificateTemplate] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::Security::PrivateCA::V1::CertificateTemplate] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/security/private_ca/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Security::PrivateCA::V1::CertificateAuthorityService::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Security::PrivateCA::V1::GetCertificateTemplateRequest.new + # + # # Call the get_certificate_template method. + # result = client.get_certificate_template request + # + # # The returned object is of type Google::Cloud::Security::PrivateCA::V1::CertificateTemplate. + # p result + # + def get_certificate_template request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Security::PrivateCA::V1::GetCertificateTemplateRequest + + # Converts hash 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_certificate_template.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::Security::PrivateCA::V1::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + options.apply_defaults timeout: @config.rpcs.get_certificate_template.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.get_certificate_template.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @certificate_authority_service_stub.get_certificate_template request, options do |result, operation| + yield result, operation if block_given? + end + rescue ::Gapic::Rest::Error => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Lists + # {::Google::Cloud::Security::PrivateCA::V1::CertificateTemplate CertificateTemplates}. + # + # @overload list_certificate_templates(request, options = nil) + # Pass arguments to `list_certificate_templates` via a request object, either of type + # {::Google::Cloud::Security::PrivateCA::V1::ListCertificateTemplatesRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Security::PrivateCA::V1::ListCertificateTemplatesRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_certificate_templates(parent: nil, page_size: nil, page_token: nil, filter: nil, order_by: nil) + # Pass arguments to `list_certificate_templates` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param parent [::String] + # Required. The resource name of the location associated with the + # {::Google::Cloud::Security::PrivateCA::V1::CertificateTemplate CertificateTemplates}, + # in the format `projects/*/locations/*`. + # @param page_size [::Integer] + # Optional. Limit on the number of + # {::Google::Cloud::Security::PrivateCA::V1::CertificateTemplate CertificateTemplates} + # to include in the response. Further + # {::Google::Cloud::Security::PrivateCA::V1::CertificateTemplate CertificateTemplates} + # can subsequently be obtained by including the + # {::Google::Cloud::Security::PrivateCA::V1::ListCertificateTemplatesResponse#next_page_token ListCertificateTemplatesResponse.next_page_token} + # in a subsequent request. If unspecified, the server will pick an + # appropriate default. + # @param page_token [::String] + # Optional. Pagination token, returned earlier via + # {::Google::Cloud::Security::PrivateCA::V1::ListCertificateTemplatesResponse#next_page_token ListCertificateTemplatesResponse.next_page_token}. + # @param filter [::String] + # Optional. Only include resources that match the filter in the response. + # @param order_by [::String] + # Optional. Specify how the results should be sorted. + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Gapic::Rest::PagedEnumerable<::Google::Cloud::Security::PrivateCA::V1::CertificateTemplate>] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Gapic::Rest::PagedEnumerable<::Google::Cloud::Security::PrivateCA::V1::CertificateTemplate>] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/security/private_ca/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Security::PrivateCA::V1::CertificateAuthorityService::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Security::PrivateCA::V1::ListCertificateTemplatesRequest.new + # + # # Call the list_certificate_templates method. + # result = client.list_certificate_templates request + # + # # The returned object is of type Gapic::PagedEnumerable. You can iterate + # # over elements, and API calls will be issued to fetch pages as needed. + # result.each do |item| + # # Each element is of type ::Google::Cloud::Security::PrivateCA::V1::CertificateTemplate. + # p item + # end + # + def list_certificate_templates request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Security::PrivateCA::V1::ListCertificateTemplatesRequest + + # Converts hash 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_certificate_templates.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::Security::PrivateCA::V1::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + options.apply_defaults timeout: @config.rpcs.list_certificate_templates.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.list_certificate_templates.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @certificate_authority_service_stub.list_certificate_templates request, options do |result, operation| + result = ::Gapic::Rest::PagedEnumerable.new @certificate_authority_service_stub, :list_certificate_templates, "certificate_templates", 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 + + ## + # Update a + # {::Google::Cloud::Security::PrivateCA::V1::CertificateTemplate CertificateTemplate}. + # + # @overload update_certificate_template(request, options = nil) + # Pass arguments to `update_certificate_template` via a request object, either of type + # {::Google::Cloud::Security::PrivateCA::V1::UpdateCertificateTemplateRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Security::PrivateCA::V1::UpdateCertificateTemplateRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_certificate_template(certificate_template: nil, update_mask: nil, request_id: nil) + # Pass arguments to `update_certificate_template` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param certificate_template [::Google::Cloud::Security::PrivateCA::V1::CertificateTemplate, ::Hash] + # Required. + # {::Google::Cloud::Security::PrivateCA::V1::CertificateTemplate CertificateTemplate} + # with updated values. + # @param update_mask [::Google::Protobuf::FieldMask, ::Hash] + # Required. A list of fields to be updated in this request. + # @param request_id [::String] + # Optional. An ID to identify requests. Specify a unique request ID so that + # if you must retry your request, the server will know to ignore the request + # if it has already been completed. The server will guarantee that for at + # least 60 minutes since the first request. + # + # For example, consider a situation where you make an initial request and + # the request times out. If you make the request again with the same request + # ID, the server can check if original operation with the same request ID + # was received, and if so, will ignore the second request. This prevents + # clients from accidentally creating duplicate commitments. + # + # The request ID must be a valid UUID with the exception that zero UUID is + # not supported (00000000-0000-0000-0000-000000000000). + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Gapic::Operation] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Gapic::Operation] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/security/private_ca/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Security::PrivateCA::V1::CertificateAuthorityService::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Security::PrivateCA::V1::UpdateCertificateTemplateRequest.new + # + # # Call the update_certificate_template method. + # result = client.update_certificate_template 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_certificate_template request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Security::PrivateCA::V1::UpdateCertificateTemplateRequest + + # Converts hash 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_certificate_template.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::Security::PrivateCA::V1::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + options.apply_defaults timeout: @config.rpcs.update_certificate_template.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.update_certificate_template.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @certificate_authority_service_stub.update_certificate_template 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 + + ## + # Configuration class for the CertificateAuthorityService REST API. + # + # This class represents the configuration for CertificateAuthorityService REST, + # providing control over timeouts, retry behavior, logging, transport + # parameters, and other low-level controls. Certain parameters can also be + # applied individually to specific RPCs. See + # {::Google::Cloud::Security::PrivateCA::V1::CertificateAuthorityService::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_certificate to 20 seconds, + # # and all remaining timeouts to 10 seconds. + # ::Google::Cloud::Security::PrivateCA::V1::CertificateAuthorityService::Rest::Client.configure do |config| + # config.timeout = 10.0 + # config.rpcs.create_certificate.timeout = 20.0 + # end + # + # # Apply the above configuration only to a new client. + # client = ::Google::Cloud::Security::PrivateCA::V1::CertificateAuthorityService::Rest::Client.new do |config| + # config.timeout = 10.0 + # config.rpcs.create_certificate.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 = "privateca.googleapis.com" + + config_attr :endpoint, nil, ::String, nil + config_attr :credentials, nil do |value| + allowed = [::String, ::Hash, ::Proc, ::Symbol, ::Google::Auth::Credentials, ::Google::Auth::BaseClient, ::Signet::OAuth2::Client, nil] + allowed.any? { |klass| klass === value } + end + config_attr :scope, nil, ::String, ::Array, nil + config_attr :lib_name, nil, ::String, nil + config_attr :lib_version, nil, ::String, nil + config_attr :timeout, nil, ::Numeric, nil + config_attr :metadata, nil, ::Hash, nil + config_attr :retry_policy, nil, ::Hash, ::Proc, nil + config_attr :quota_project, nil, ::String, nil + config_attr :universe_domain, nil, ::String, nil + + # @private + # Overrides for http bindings for the RPCs of this service + # are only used when this service is used as mixin, and only + # by the host service. + # @return [::Hash{::Symbol=>::Array<::Gapic::Rest::GrpcTranscoder::HttpBinding>}] + config_attr :bindings_override, {}, ::Hash, nil + config_attr :logger, :default, ::Logger, nil, :default + + # @private + def initialize parent_config = nil + @parent_config = parent_config unless parent_config.nil? + + yield self if block_given? + end + + ## + # Configurations for individual RPCs + # @return [Rpcs] + # + def rpcs + @rpcs ||= begin + parent_rpcs = nil + parent_rpcs = @parent_config.rpcs if defined?(@parent_config) && @parent_config.respond_to?(:rpcs) + Rpcs.new parent_rpcs + end + end + + ## + # Configuration RPC class for the CertificateAuthorityService 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_certificate` + # @return [::Gapic::Config::Method] + # + attr_reader :create_certificate + ## + # RPC-specific configuration for `get_certificate` + # @return [::Gapic::Config::Method] + # + attr_reader :get_certificate + ## + # RPC-specific configuration for `list_certificates` + # @return [::Gapic::Config::Method] + # + attr_reader :list_certificates + ## + # RPC-specific configuration for `revoke_certificate` + # @return [::Gapic::Config::Method] + # + attr_reader :revoke_certificate + ## + # RPC-specific configuration for `update_certificate` + # @return [::Gapic::Config::Method] + # + attr_reader :update_certificate + ## + # RPC-specific configuration for `activate_certificate_authority` + # @return [::Gapic::Config::Method] + # + attr_reader :activate_certificate_authority + ## + # RPC-specific configuration for `create_certificate_authority` + # @return [::Gapic::Config::Method] + # + attr_reader :create_certificate_authority + ## + # RPC-specific configuration for `disable_certificate_authority` + # @return [::Gapic::Config::Method] + # + attr_reader :disable_certificate_authority + ## + # RPC-specific configuration for `enable_certificate_authority` + # @return [::Gapic::Config::Method] + # + attr_reader :enable_certificate_authority + ## + # RPC-specific configuration for `fetch_certificate_authority_csr` + # @return [::Gapic::Config::Method] + # + attr_reader :fetch_certificate_authority_csr + ## + # RPC-specific configuration for `get_certificate_authority` + # @return [::Gapic::Config::Method] + # + attr_reader :get_certificate_authority + ## + # RPC-specific configuration for `list_certificate_authorities` + # @return [::Gapic::Config::Method] + # + attr_reader :list_certificate_authorities + ## + # RPC-specific configuration for `undelete_certificate_authority` + # @return [::Gapic::Config::Method] + # + attr_reader :undelete_certificate_authority + ## + # RPC-specific configuration for `delete_certificate_authority` + # @return [::Gapic::Config::Method] + # + attr_reader :delete_certificate_authority + ## + # RPC-specific configuration for `update_certificate_authority` + # @return [::Gapic::Config::Method] + # + attr_reader :update_certificate_authority + ## + # RPC-specific configuration for `create_ca_pool` + # @return [::Gapic::Config::Method] + # + attr_reader :create_ca_pool + ## + # RPC-specific configuration for `update_ca_pool` + # @return [::Gapic::Config::Method] + # + attr_reader :update_ca_pool + ## + # RPC-specific configuration for `get_ca_pool` + # @return [::Gapic::Config::Method] + # + attr_reader :get_ca_pool + ## + # RPC-specific configuration for `list_ca_pools` + # @return [::Gapic::Config::Method] + # + attr_reader :list_ca_pools + ## + # RPC-specific configuration for `delete_ca_pool` + # @return [::Gapic::Config::Method] + # + attr_reader :delete_ca_pool + ## + # RPC-specific configuration for `fetch_ca_certs` + # @return [::Gapic::Config::Method] + # + attr_reader :fetch_ca_certs + ## + # RPC-specific configuration for `get_certificate_revocation_list` + # @return [::Gapic::Config::Method] + # + attr_reader :get_certificate_revocation_list + ## + # RPC-specific configuration for `list_certificate_revocation_lists` + # @return [::Gapic::Config::Method] + # + attr_reader :list_certificate_revocation_lists + ## + # RPC-specific configuration for `update_certificate_revocation_list` + # @return [::Gapic::Config::Method] + # + attr_reader :update_certificate_revocation_list + ## + # RPC-specific configuration for `create_certificate_template` + # @return [::Gapic::Config::Method] + # + attr_reader :create_certificate_template + ## + # RPC-specific configuration for `delete_certificate_template` + # @return [::Gapic::Config::Method] + # + attr_reader :delete_certificate_template + ## + # RPC-specific configuration for `get_certificate_template` + # @return [::Gapic::Config::Method] + # + attr_reader :get_certificate_template + ## + # RPC-specific configuration for `list_certificate_templates` + # @return [::Gapic::Config::Method] + # + attr_reader :list_certificate_templates + ## + # RPC-specific configuration for `update_certificate_template` + # @return [::Gapic::Config::Method] + # + attr_reader :update_certificate_template + + # @private + def initialize parent_rpcs = nil + create_certificate_config = parent_rpcs.create_certificate if parent_rpcs.respond_to? :create_certificate + @create_certificate = ::Gapic::Config::Method.new create_certificate_config + get_certificate_config = parent_rpcs.get_certificate if parent_rpcs.respond_to? :get_certificate + @get_certificate = ::Gapic::Config::Method.new get_certificate_config + list_certificates_config = parent_rpcs.list_certificates if parent_rpcs.respond_to? :list_certificates + @list_certificates = ::Gapic::Config::Method.new list_certificates_config + revoke_certificate_config = parent_rpcs.revoke_certificate if parent_rpcs.respond_to? :revoke_certificate + @revoke_certificate = ::Gapic::Config::Method.new revoke_certificate_config + update_certificate_config = parent_rpcs.update_certificate if parent_rpcs.respond_to? :update_certificate + @update_certificate = ::Gapic::Config::Method.new update_certificate_config + activate_certificate_authority_config = parent_rpcs.activate_certificate_authority if parent_rpcs.respond_to? :activate_certificate_authority + @activate_certificate_authority = ::Gapic::Config::Method.new activate_certificate_authority_config + create_certificate_authority_config = parent_rpcs.create_certificate_authority if parent_rpcs.respond_to? :create_certificate_authority + @create_certificate_authority = ::Gapic::Config::Method.new create_certificate_authority_config + disable_certificate_authority_config = parent_rpcs.disable_certificate_authority if parent_rpcs.respond_to? :disable_certificate_authority + @disable_certificate_authority = ::Gapic::Config::Method.new disable_certificate_authority_config + enable_certificate_authority_config = parent_rpcs.enable_certificate_authority if parent_rpcs.respond_to? :enable_certificate_authority + @enable_certificate_authority = ::Gapic::Config::Method.new enable_certificate_authority_config + fetch_certificate_authority_csr_config = parent_rpcs.fetch_certificate_authority_csr if parent_rpcs.respond_to? :fetch_certificate_authority_csr + @fetch_certificate_authority_csr = ::Gapic::Config::Method.new fetch_certificate_authority_csr_config + get_certificate_authority_config = parent_rpcs.get_certificate_authority if parent_rpcs.respond_to? :get_certificate_authority + @get_certificate_authority = ::Gapic::Config::Method.new get_certificate_authority_config + list_certificate_authorities_config = parent_rpcs.list_certificate_authorities if parent_rpcs.respond_to? :list_certificate_authorities + @list_certificate_authorities = ::Gapic::Config::Method.new list_certificate_authorities_config + undelete_certificate_authority_config = parent_rpcs.undelete_certificate_authority if parent_rpcs.respond_to? :undelete_certificate_authority + @undelete_certificate_authority = ::Gapic::Config::Method.new undelete_certificate_authority_config + delete_certificate_authority_config = parent_rpcs.delete_certificate_authority if parent_rpcs.respond_to? :delete_certificate_authority + @delete_certificate_authority = ::Gapic::Config::Method.new delete_certificate_authority_config + update_certificate_authority_config = parent_rpcs.update_certificate_authority if parent_rpcs.respond_to? :update_certificate_authority + @update_certificate_authority = ::Gapic::Config::Method.new update_certificate_authority_config + create_ca_pool_config = parent_rpcs.create_ca_pool if parent_rpcs.respond_to? :create_ca_pool + @create_ca_pool = ::Gapic::Config::Method.new create_ca_pool_config + update_ca_pool_config = parent_rpcs.update_ca_pool if parent_rpcs.respond_to? :update_ca_pool + @update_ca_pool = ::Gapic::Config::Method.new update_ca_pool_config + get_ca_pool_config = parent_rpcs.get_ca_pool if parent_rpcs.respond_to? :get_ca_pool + @get_ca_pool = ::Gapic::Config::Method.new get_ca_pool_config + list_ca_pools_config = parent_rpcs.list_ca_pools if parent_rpcs.respond_to? :list_ca_pools + @list_ca_pools = ::Gapic::Config::Method.new list_ca_pools_config + delete_ca_pool_config = parent_rpcs.delete_ca_pool if parent_rpcs.respond_to? :delete_ca_pool + @delete_ca_pool = ::Gapic::Config::Method.new delete_ca_pool_config + fetch_ca_certs_config = parent_rpcs.fetch_ca_certs if parent_rpcs.respond_to? :fetch_ca_certs + @fetch_ca_certs = ::Gapic::Config::Method.new fetch_ca_certs_config + get_certificate_revocation_list_config = parent_rpcs.get_certificate_revocation_list if parent_rpcs.respond_to? :get_certificate_revocation_list + @get_certificate_revocation_list = ::Gapic::Config::Method.new get_certificate_revocation_list_config + list_certificate_revocation_lists_config = parent_rpcs.list_certificate_revocation_lists if parent_rpcs.respond_to? :list_certificate_revocation_lists + @list_certificate_revocation_lists = ::Gapic::Config::Method.new list_certificate_revocation_lists_config + update_certificate_revocation_list_config = parent_rpcs.update_certificate_revocation_list if parent_rpcs.respond_to? :update_certificate_revocation_list + @update_certificate_revocation_list = ::Gapic::Config::Method.new update_certificate_revocation_list_config + create_certificate_template_config = parent_rpcs.create_certificate_template if parent_rpcs.respond_to? :create_certificate_template + @create_certificate_template = ::Gapic::Config::Method.new create_certificate_template_config + delete_certificate_template_config = parent_rpcs.delete_certificate_template if parent_rpcs.respond_to? :delete_certificate_template + @delete_certificate_template = ::Gapic::Config::Method.new delete_certificate_template_config + get_certificate_template_config = parent_rpcs.get_certificate_template if parent_rpcs.respond_to? :get_certificate_template + @get_certificate_template = ::Gapic::Config::Method.new get_certificate_template_config + list_certificate_templates_config = parent_rpcs.list_certificate_templates if parent_rpcs.respond_to? :list_certificate_templates + @list_certificate_templates = ::Gapic::Config::Method.new list_certificate_templates_config + update_certificate_template_config = parent_rpcs.update_certificate_template if parent_rpcs.respond_to? :update_certificate_template + @update_certificate_template = ::Gapic::Config::Method.new update_certificate_template_config + + yield self if block_given? + end + end + end + end + end + end + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-security-private_ca-v1/lib/google/cloud/security/private_ca/v1/certificate_authority_service/rest/operations.rb b/owl-bot-staging/google-cloud-security-private_ca-v1/lib/google/cloud/security/private_ca/v1/certificate_authority_service/rest/operations.rb new file mode 100644 index 000000000000..16b00060e07e --- /dev/null +++ b/owl-bot-staging/google-cloud-security-private_ca-v1/lib/google/cloud/security/private_ca/v1/certificate_authority_service/rest/operations.rb @@ -0,0 +1,927 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +require "gapic/operation" + +module Google + module Cloud + module Security + module PrivateCA + module V1 + module CertificateAuthorityService + module Rest + # Service that implements Longrunning Operations API. + class Operations + # @private + API_VERSION = "" + + # @private + DEFAULT_ENDPOINT_TEMPLATE = "privateca.$UNIVERSE_DOMAIN$" + + # @private + attr_reader :operations_stub + + ## + # Configuration for the CertificateAuthorityService 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 CertificateAuthorityService 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::Security::PrivateCA::V1::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + options.apply_defaults timeout: @config.rpcs.list_operations.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.list_operations.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @operations_stub.list_operations request, options do |result, operation| + result = ::Gapic::Rest::PagedEnumerable.new @operations_stub, :list_operations, "operations", request, result, options + yield result, operation if block_given? + 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::Security::PrivateCA::V1::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + options.apply_defaults timeout: @config.rpcs.get_operation.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.get_operation.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @operations_stub.get_operation request, options do |result, operation| + result = ::Gapic::Operation.new result, @operations_client, options: options + yield result, operation if block_given? + 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::Security::PrivateCA::V1::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + options.apply_defaults timeout: @config.rpcs.delete_operation.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.delete_operation.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @operations_stub.delete_operation request, options do |result, operation| + yield result, operation if block_given? + 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::Security::PrivateCA::V1::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + options.apply_defaults timeout: @config.rpcs.cancel_operation.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.cancel_operation.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @operations_stub.cancel_operation request, options do |result, operation| + yield result, operation if block_given? + 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 = "privateca.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}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the get_operation REST call + # + # @param request_pb [::Google::Longrunning::GetOperationRequest] + # A request object representing the call parameters. Required. + # @return [Array(String, [String, nil], Hash{String => String})] + # Uri, Body, Query string parameters + def self.transcode_get_operation_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/operations/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the delete_operation REST call + # + # @param request_pb [::Google::Longrunning::DeleteOperationRequest] + # A request object representing the call parameters. Required. + # @return [Array(String, [String, nil], Hash{String => String})] + # Uri, Body, Query string parameters + def self.transcode_delete_operation_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :delete, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/operations/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the cancel_operation REST call + # + # @param request_pb [::Google::Longrunning::CancelOperationRequest] + # A request object representing the call parameters. Required. + # @return [Array(String, [String, nil], Hash{String => String})] + # Uri, Body, Query string parameters + def self.transcode_cancel_operation_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:cancel", + body: "*", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/operations/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + end + end + end + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-security-private_ca-v1/lib/google/cloud/security/private_ca/v1/certificate_authority_service/rest/service_stub.rb b/owl-bot-staging/google-cloud-security-private_ca-v1/lib/google/cloud/security/private_ca/v1/certificate_authority_service/rest/service_stub.rb new file mode 100644 index 000000000000..1665c56a8de6 --- /dev/null +++ b/owl-bot-staging/google-cloud-security-private_ca-v1/lib/google/cloud/security/private_ca/v1/certificate_authority_service/rest/service_stub.rb @@ -0,0 +1,1867 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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/security/privateca/v1/service_pb" + +module Google + module Cloud + module Security + module PrivateCA + module V1 + module CertificateAuthorityService + module Rest + ## + # REST service stub for the CertificateAuthorityService 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_certificate REST call + # + # @param request_pb [::Google::Cloud::Security::PrivateCA::V1::CreateCertificateRequest] + # A request object representing the call parameters. Required. + # @param options [::Gapic::CallOptions] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Cloud::Security::PrivateCA::V1::Certificate] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::Security::PrivateCA::V1::Certificate] + # A result object deserialized from the server's reply + def create_certificate request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_create_certificate_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_certificate", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Cloud::Security::PrivateCA::V1::Certificate.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_certificate REST call + # + # @param request_pb [::Google::Cloud::Security::PrivateCA::V1::GetCertificateRequest] + # A request object representing the call parameters. Required. + # @param options [::Gapic::CallOptions] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Cloud::Security::PrivateCA::V1::Certificate] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::Security::PrivateCA::V1::Certificate] + # A result object deserialized from the server's reply + def get_certificate request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_get_certificate_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_certificate", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Cloud::Security::PrivateCA::V1::Certificate.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_certificates REST call + # + # @param request_pb [::Google::Cloud::Security::PrivateCA::V1::ListCertificatesRequest] + # A request object representing the call parameters. Required. + # @param options [::Gapic::CallOptions] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Cloud::Security::PrivateCA::V1::ListCertificatesResponse] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::Security::PrivateCA::V1::ListCertificatesResponse] + # A result object deserialized from the server's reply + def list_certificates request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_list_certificates_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_certificates", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Cloud::Security::PrivateCA::V1::ListCertificatesResponse.decode_json response.body, ignore_unknown_fields: true + catch :response do + yield result, operation if block_given? + result + end + end + + ## + # Baseline implementation for the revoke_certificate REST call + # + # @param request_pb [::Google::Cloud::Security::PrivateCA::V1::RevokeCertificateRequest] + # A request object representing the call parameters. Required. + # @param options [::Gapic::CallOptions] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Cloud::Security::PrivateCA::V1::Certificate] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::Security::PrivateCA::V1::Certificate] + # A result object deserialized from the server's reply + def revoke_certificate request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_revoke_certificate_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: "revoke_certificate", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Cloud::Security::PrivateCA::V1::Certificate.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_certificate REST call + # + # @param request_pb [::Google::Cloud::Security::PrivateCA::V1::UpdateCertificateRequest] + # A request object representing the call parameters. Required. + # @param options [::Gapic::CallOptions] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Cloud::Security::PrivateCA::V1::Certificate] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::Security::PrivateCA::V1::Certificate] + # A result object deserialized from the server's reply + def update_certificate request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_update_certificate_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_certificate", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Cloud::Security::PrivateCA::V1::Certificate.decode_json response.body, ignore_unknown_fields: true + catch :response do + yield result, operation if block_given? + result + end + end + + ## + # Baseline implementation for the activate_certificate_authority REST call + # + # @param request_pb [::Google::Cloud::Security::PrivateCA::V1::ActivateCertificateAuthorityRequest] + # 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 activate_certificate_authority request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_activate_certificate_authority_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: "activate_certificate_authority", + 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 create_certificate_authority REST call + # + # @param request_pb [::Google::Cloud::Security::PrivateCA::V1::CreateCertificateAuthorityRequest] + # 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_certificate_authority request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_create_certificate_authority_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_certificate_authority", + 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 disable_certificate_authority REST call + # + # @param request_pb [::Google::Cloud::Security::PrivateCA::V1::DisableCertificateAuthorityRequest] + # 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 disable_certificate_authority request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_disable_certificate_authority_request request_pb + query_string_params = if query_string_params.any? + query_string_params.to_h { |p| p.split "=", 2 } + else + {} + end + + response = @client_stub.make_http_request( + verb, + uri: uri, + body: body || "", + params: query_string_params, + method_name: "disable_certificate_authority", + 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 enable_certificate_authority REST call + # + # @param request_pb [::Google::Cloud::Security::PrivateCA::V1::EnableCertificateAuthorityRequest] + # 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 enable_certificate_authority request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_enable_certificate_authority_request request_pb + query_string_params = if query_string_params.any? + query_string_params.to_h { |p| p.split "=", 2 } + else + {} + end + + response = @client_stub.make_http_request( + verb, + uri: uri, + body: body || "", + params: query_string_params, + method_name: "enable_certificate_authority", + 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 fetch_certificate_authority_csr REST call + # + # @param request_pb [::Google::Cloud::Security::PrivateCA::V1::FetchCertificateAuthorityCsrRequest] + # A request object representing the call parameters. Required. + # @param options [::Gapic::CallOptions] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Cloud::Security::PrivateCA::V1::FetchCertificateAuthorityCsrResponse] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::Security::PrivateCA::V1::FetchCertificateAuthorityCsrResponse] + # A result object deserialized from the server's reply + def fetch_certificate_authority_csr request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_fetch_certificate_authority_csr_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: "fetch_certificate_authority_csr", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Cloud::Security::PrivateCA::V1::FetchCertificateAuthorityCsrResponse.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_certificate_authority REST call + # + # @param request_pb [::Google::Cloud::Security::PrivateCA::V1::GetCertificateAuthorityRequest] + # A request object representing the call parameters. Required. + # @param options [::Gapic::CallOptions] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Cloud::Security::PrivateCA::V1::CertificateAuthority] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::Security::PrivateCA::V1::CertificateAuthority] + # A result object deserialized from the server's reply + def get_certificate_authority request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_get_certificate_authority_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_certificate_authority", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Cloud::Security::PrivateCA::V1::CertificateAuthority.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_certificate_authorities REST call + # + # @param request_pb [::Google::Cloud::Security::PrivateCA::V1::ListCertificateAuthoritiesRequest] + # A request object representing the call parameters. Required. + # @param options [::Gapic::CallOptions] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Cloud::Security::PrivateCA::V1::ListCertificateAuthoritiesResponse] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::Security::PrivateCA::V1::ListCertificateAuthoritiesResponse] + # A result object deserialized from the server's reply + def list_certificate_authorities request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_list_certificate_authorities_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_certificate_authorities", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Cloud::Security::PrivateCA::V1::ListCertificateAuthoritiesResponse.decode_json response.body, ignore_unknown_fields: true + catch :response do + yield result, operation if block_given? + result + end + end + + ## + # Baseline implementation for the undelete_certificate_authority REST call + # + # @param request_pb [::Google::Cloud::Security::PrivateCA::V1::UndeleteCertificateAuthorityRequest] + # 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 undelete_certificate_authority request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_undelete_certificate_authority_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: "undelete_certificate_authority", + 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_certificate_authority REST call + # + # @param request_pb [::Google::Cloud::Security::PrivateCA::V1::DeleteCertificateAuthorityRequest] + # 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_certificate_authority request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_delete_certificate_authority_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_certificate_authority", + 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 update_certificate_authority REST call + # + # @param request_pb [::Google::Cloud::Security::PrivateCA::V1::UpdateCertificateAuthorityRequest] + # 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_certificate_authority request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_update_certificate_authority_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_certificate_authority", + 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 create_ca_pool REST call + # + # @param request_pb [::Google::Cloud::Security::PrivateCA::V1::CreateCaPoolRequest] + # 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_ca_pool request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_create_ca_pool_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_ca_pool", + 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 update_ca_pool REST call + # + # @param request_pb [::Google::Cloud::Security::PrivateCA::V1::UpdateCaPoolRequest] + # 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_ca_pool request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_update_ca_pool_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_ca_pool", + 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_ca_pool REST call + # + # @param request_pb [::Google::Cloud::Security::PrivateCA::V1::GetCaPoolRequest] + # A request object representing the call parameters. Required. + # @param options [::Gapic::CallOptions] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Cloud::Security::PrivateCA::V1::CaPool] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::Security::PrivateCA::V1::CaPool] + # A result object deserialized from the server's reply + def get_ca_pool request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_get_ca_pool_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_ca_pool", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Cloud::Security::PrivateCA::V1::CaPool.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_ca_pools REST call + # + # @param request_pb [::Google::Cloud::Security::PrivateCA::V1::ListCaPoolsRequest] + # A request object representing the call parameters. Required. + # @param options [::Gapic::CallOptions] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Cloud::Security::PrivateCA::V1::ListCaPoolsResponse] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::Security::PrivateCA::V1::ListCaPoolsResponse] + # A result object deserialized from the server's reply + def list_ca_pools request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_list_ca_pools_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_ca_pools", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Cloud::Security::PrivateCA::V1::ListCaPoolsResponse.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_ca_pool REST call + # + # @param request_pb [::Google::Cloud::Security::PrivateCA::V1::DeleteCaPoolRequest] + # 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_ca_pool request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_delete_ca_pool_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_ca_pool", + 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 fetch_ca_certs REST call + # + # @param request_pb [::Google::Cloud::Security::PrivateCA::V1::FetchCaCertsRequest] + # A request object representing the call parameters. Required. + # @param options [::Gapic::CallOptions] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Cloud::Security::PrivateCA::V1::FetchCaCertsResponse] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::Security::PrivateCA::V1::FetchCaCertsResponse] + # A result object deserialized from the server's reply + def fetch_ca_certs request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_fetch_ca_certs_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: "fetch_ca_certs", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Cloud::Security::PrivateCA::V1::FetchCaCertsResponse.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_certificate_revocation_list REST call + # + # @param request_pb [::Google::Cloud::Security::PrivateCA::V1::GetCertificateRevocationListRequest] + # A request object representing the call parameters. Required. + # @param options [::Gapic::CallOptions] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Cloud::Security::PrivateCA::V1::CertificateRevocationList] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::Security::PrivateCA::V1::CertificateRevocationList] + # A result object deserialized from the server's reply + def get_certificate_revocation_list request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_get_certificate_revocation_list_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_certificate_revocation_list", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Cloud::Security::PrivateCA::V1::CertificateRevocationList.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_certificate_revocation_lists REST call + # + # @param request_pb [::Google::Cloud::Security::PrivateCA::V1::ListCertificateRevocationListsRequest] + # A request object representing the call parameters. Required. + # @param options [::Gapic::CallOptions] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Cloud::Security::PrivateCA::V1::ListCertificateRevocationListsResponse] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::Security::PrivateCA::V1::ListCertificateRevocationListsResponse] + # A result object deserialized from the server's reply + def list_certificate_revocation_lists request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_list_certificate_revocation_lists_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_certificate_revocation_lists", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Cloud::Security::PrivateCA::V1::ListCertificateRevocationListsResponse.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_certificate_revocation_list REST call + # + # @param request_pb [::Google::Cloud::Security::PrivateCA::V1::UpdateCertificateRevocationListRequest] + # 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_certificate_revocation_list request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_update_certificate_revocation_list_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_certificate_revocation_list", + 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 create_certificate_template REST call + # + # @param request_pb [::Google::Cloud::Security::PrivateCA::V1::CreateCertificateTemplateRequest] + # 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_certificate_template request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_create_certificate_template_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_certificate_template", + 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_certificate_template REST call + # + # @param request_pb [::Google::Cloud::Security::PrivateCA::V1::DeleteCertificateTemplateRequest] + # 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_certificate_template request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_delete_certificate_template_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_certificate_template", + 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_certificate_template REST call + # + # @param request_pb [::Google::Cloud::Security::PrivateCA::V1::GetCertificateTemplateRequest] + # A request object representing the call parameters. Required. + # @param options [::Gapic::CallOptions] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Cloud::Security::PrivateCA::V1::CertificateTemplate] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::Security::PrivateCA::V1::CertificateTemplate] + # A result object deserialized from the server's reply + def get_certificate_template request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_get_certificate_template_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_certificate_template", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Cloud::Security::PrivateCA::V1::CertificateTemplate.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_certificate_templates REST call + # + # @param request_pb [::Google::Cloud::Security::PrivateCA::V1::ListCertificateTemplatesRequest] + # A request object representing the call parameters. Required. + # @param options [::Gapic::CallOptions] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Cloud::Security::PrivateCA::V1::ListCertificateTemplatesResponse] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::Security::PrivateCA::V1::ListCertificateTemplatesResponse] + # A result object deserialized from the server's reply + def list_certificate_templates request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_list_certificate_templates_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_certificate_templates", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Cloud::Security::PrivateCA::V1::ListCertificateTemplatesResponse.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_certificate_template REST call + # + # @param request_pb [::Google::Cloud::Security::PrivateCA::V1::UpdateCertificateTemplateRequest] + # 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_certificate_template request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_update_certificate_template_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_certificate_template", + 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 + + ## + # @private + # + # GRPC transcoding helper method for the create_certificate REST call + # + # @param request_pb [::Google::Cloud::Security::PrivateCA::V1::CreateCertificateRequest] + # 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_certificate_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :post, + uri_template: "/v1/{parent}/certificates", + body: "certificate", + matches: [ + ["parent", %r{^projects/[^/]+/locations/[^/]+/caPools/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the get_certificate REST call + # + # @param request_pb [::Google::Cloud::Security::PrivateCA::V1::GetCertificateRequest] + # 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_certificate_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/caPools/[^/]+/certificates/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the list_certificates REST call + # + # @param request_pb [::Google::Cloud::Security::PrivateCA::V1::ListCertificatesRequest] + # 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_certificates_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :get, + uri_template: "/v1/{parent}/certificates", + matches: [ + ["parent", %r{^projects/[^/]+/locations/[^/]+/caPools/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the revoke_certificate REST call + # + # @param request_pb [::Google::Cloud::Security::PrivateCA::V1::RevokeCertificateRequest] + # A request object representing the call parameters. Required. + # @return [Array(String, [String, nil], Hash{String => String})] + # Uri, Body, Query string parameters + def self.transcode_revoke_certificate_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:revoke", + body: "*", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/caPools/[^/]+/certificates/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the update_certificate REST call + # + # @param request_pb [::Google::Cloud::Security::PrivateCA::V1::UpdateCertificateRequest] + # 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_certificate_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :patch, + uri_template: "/v1/{certificate.name}", + body: "certificate", + matches: [ + ["certificate.name", %r{^projects/[^/]+/locations/[^/]+/caPools/[^/]+/certificates/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the activate_certificate_authority REST call + # + # @param request_pb [::Google::Cloud::Security::PrivateCA::V1::ActivateCertificateAuthorityRequest] + # A request object representing the call parameters. Required. + # @return [Array(String, [String, nil], Hash{String => String})] + # Uri, Body, Query string parameters + def self.transcode_activate_certificate_authority_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:activate", + body: "*", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/caPools/[^/]+/certificateAuthorities/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the create_certificate_authority REST call + # + # @param request_pb [::Google::Cloud::Security::PrivateCA::V1::CreateCertificateAuthorityRequest] + # 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_certificate_authority_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :post, + uri_template: "/v1/{parent}/certificateAuthorities", + body: "certificate_authority", + matches: [ + ["parent", %r{^projects/[^/]+/locations/[^/]+/caPools/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the disable_certificate_authority REST call + # + # @param request_pb [::Google::Cloud::Security::PrivateCA::V1::DisableCertificateAuthorityRequest] + # A request object representing the call parameters. Required. + # @return [Array(String, [String, nil], Hash{String => String})] + # Uri, Body, Query string parameters + def self.transcode_disable_certificate_authority_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:disable", + body: "*", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/caPools/[^/]+/certificateAuthorities/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the enable_certificate_authority REST call + # + # @param request_pb [::Google::Cloud::Security::PrivateCA::V1::EnableCertificateAuthorityRequest] + # A request object representing the call parameters. Required. + # @return [Array(String, [String, nil], Hash{String => String})] + # Uri, Body, Query string parameters + def self.transcode_enable_certificate_authority_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:enable", + body: "*", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/caPools/[^/]+/certificateAuthorities/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the fetch_certificate_authority_csr REST call + # + # @param request_pb [::Google::Cloud::Security::PrivateCA::V1::FetchCertificateAuthorityCsrRequest] + # A request object representing the call parameters. Required. + # @return [Array(String, [String, nil], Hash{String => String})] + # Uri, Body, Query string parameters + def self.transcode_fetch_certificate_authority_csr_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}:fetch", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/caPools/[^/]+/certificateAuthorities/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the get_certificate_authority REST call + # + # @param request_pb [::Google::Cloud::Security::PrivateCA::V1::GetCertificateAuthorityRequest] + # 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_certificate_authority_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/caPools/[^/]+/certificateAuthorities/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the list_certificate_authorities REST call + # + # @param request_pb [::Google::Cloud::Security::PrivateCA::V1::ListCertificateAuthoritiesRequest] + # 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_certificate_authorities_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :get, + uri_template: "/v1/{parent}/certificateAuthorities", + matches: [ + ["parent", %r{^projects/[^/]+/locations/[^/]+/caPools/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the undelete_certificate_authority REST call + # + # @param request_pb [::Google::Cloud::Security::PrivateCA::V1::UndeleteCertificateAuthorityRequest] + # A request object representing the call parameters. Required. + # @return [Array(String, [String, nil], Hash{String => String})] + # Uri, Body, Query string parameters + def self.transcode_undelete_certificate_authority_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:undelete", + body: "*", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/caPools/[^/]+/certificateAuthorities/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the delete_certificate_authority REST call + # + # @param request_pb [::Google::Cloud::Security::PrivateCA::V1::DeleteCertificateAuthorityRequest] + # 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_certificate_authority_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :delete, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/caPools/[^/]+/certificateAuthorities/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the update_certificate_authority REST call + # + # @param request_pb [::Google::Cloud::Security::PrivateCA::V1::UpdateCertificateAuthorityRequest] + # 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_certificate_authority_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :patch, + uri_template: "/v1/{certificate_authority.name}", + body: "certificate_authority", + matches: [ + ["certificate_authority.name", %r{^projects/[^/]+/locations/[^/]+/caPools/[^/]+/certificateAuthorities/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the create_ca_pool REST call + # + # @param request_pb [::Google::Cloud::Security::PrivateCA::V1::CreateCaPoolRequest] + # 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_ca_pool_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :post, + uri_template: "/v1/{parent}/caPools", + body: "ca_pool", + matches: [ + ["parent", %r{^projects/[^/]+/locations/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the update_ca_pool REST call + # + # @param request_pb [::Google::Cloud::Security::PrivateCA::V1::UpdateCaPoolRequest] + # 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_ca_pool_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :patch, + uri_template: "/v1/{ca_pool.name}", + body: "ca_pool", + matches: [ + ["ca_pool.name", %r{^projects/[^/]+/locations/[^/]+/caPools/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the get_ca_pool REST call + # + # @param request_pb [::Google::Cloud::Security::PrivateCA::V1::GetCaPoolRequest] + # 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_ca_pool_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/caPools/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the list_ca_pools REST call + # + # @param request_pb [::Google::Cloud::Security::PrivateCA::V1::ListCaPoolsRequest] + # 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_ca_pools_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :get, + uri_template: "/v1/{parent}/caPools", + matches: [ + ["parent", %r{^projects/[^/]+/locations/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the delete_ca_pool REST call + # + # @param request_pb [::Google::Cloud::Security::PrivateCA::V1::DeleteCaPoolRequest] + # 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_ca_pool_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :delete, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/caPools/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the fetch_ca_certs REST call + # + # @param request_pb [::Google::Cloud::Security::PrivateCA::V1::FetchCaCertsRequest] + # A request object representing the call parameters. Required. + # @return [Array(String, [String, nil], Hash{String => String})] + # Uri, Body, Query string parameters + def self.transcode_fetch_ca_certs_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :post, + uri_template: "/v1/{ca_pool}:fetchCaCerts", + body: "*", + matches: [ + ["ca_pool", %r{^projects/[^/]+/locations/[^/]+/caPools/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the get_certificate_revocation_list REST call + # + # @param request_pb [::Google::Cloud::Security::PrivateCA::V1::GetCertificateRevocationListRequest] + # 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_certificate_revocation_list_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/caPools/[^/]+/certificateAuthorities/[^/]+/certificateRevocationLists/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the list_certificate_revocation_lists REST call + # + # @param request_pb [::Google::Cloud::Security::PrivateCA::V1::ListCertificateRevocationListsRequest] + # 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_certificate_revocation_lists_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :get, + uri_template: "/v1/{parent}/certificateRevocationLists", + matches: [ + ["parent", %r{^projects/[^/]+/locations/[^/]+/caPools/[^/]+/certificateAuthorities/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the update_certificate_revocation_list REST call + # + # @param request_pb [::Google::Cloud::Security::PrivateCA::V1::UpdateCertificateRevocationListRequest] + # 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_certificate_revocation_list_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :patch, + uri_template: "/v1/{certificate_revocation_list.name}", + body: "certificate_revocation_list", + matches: [ + ["certificate_revocation_list.name", %r{^projects/[^/]+/locations/[^/]+/caPools/[^/]+/certificateAuthorities/[^/]+/certificateRevocationLists/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the create_certificate_template REST call + # + # @param request_pb [::Google::Cloud::Security::PrivateCA::V1::CreateCertificateTemplateRequest] + # 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_certificate_template_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :post, + uri_template: "/v1/{parent}/certificateTemplates", + body: "certificate_template", + matches: [ + ["parent", %r{^projects/[^/]+/locations/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the delete_certificate_template REST call + # + # @param request_pb [::Google::Cloud::Security::PrivateCA::V1::DeleteCertificateTemplateRequest] + # 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_certificate_template_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :delete, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/certificateTemplates/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the get_certificate_template REST call + # + # @param request_pb [::Google::Cloud::Security::PrivateCA::V1::GetCertificateTemplateRequest] + # 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_certificate_template_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/certificateTemplates/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the list_certificate_templates REST call + # + # @param request_pb [::Google::Cloud::Security::PrivateCA::V1::ListCertificateTemplatesRequest] + # 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_certificate_templates_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :get, + uri_template: "/v1/{parent}/certificateTemplates", + matches: [ + ["parent", %r{^projects/[^/]+/locations/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the update_certificate_template REST call + # + # @param request_pb [::Google::Cloud::Security::PrivateCA::V1::UpdateCertificateTemplateRequest] + # 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_certificate_template_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :patch, + uri_template: "/v1/{certificate_template.name}", + body: "certificate_template", + matches: [ + ["certificate_template.name", %r{^projects/[^/]+/locations/[^/]+/certificateTemplates/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + end + end + end + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-security-private_ca-v1/lib/google/cloud/security/private_ca/v1/rest.rb b/owl-bot-staging/google-cloud-security-private_ca-v1/lib/google/cloud/security/private_ca/v1/rest.rb new file mode 100644 index 000000000000..32ff1bdaacad --- /dev/null +++ b/owl-bot-staging/google-cloud-security-private_ca-v1/lib/google/cloud/security/private_ca/v1/rest.rb @@ -0,0 +1,40 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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/security/private_ca/v1/certificate_authority_service/rest" +require "google/cloud/security/private_ca/v1/bindings_override" +require "google/cloud/security/private_ca/v1/version" + +module Google + module Cloud + module Security + module PrivateCA + ## + # To load just the REST part of this package, including all its services, and instantiate a REST client: + # + # @example + # + # require "google/cloud/security/private_ca/v1/rest" + # client = ::Google::Cloud::Security::PrivateCA::V1::CertificateAuthorityService::Rest::Client.new + # + module V1 + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-security-private_ca-v1/lib/google/cloud/security/private_ca/v1/version.rb b/owl-bot-staging/google-cloud-security-private_ca-v1/lib/google/cloud/security/private_ca/v1/version.rb new file mode 100644 index 000000000000..c9a5e76697ad --- /dev/null +++ b/owl-bot-staging/google-cloud-security-private_ca-v1/lib/google/cloud/security/private_ca/v1/version.rb @@ -0,0 +1,30 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + + +module Google + module Cloud + module Security + module PrivateCA + module V1 + VERSION = "0.0.1" + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-security-private_ca-v1/lib/google/cloud/security/privateca/v1/resources_pb.rb b/owl-bot-staging/google-cloud-security-private_ca-v1/lib/google/cloud/security/privateca/v1/resources_pb.rb new file mode 100644 index 000000000000..127b639f665e --- /dev/null +++ b/owl-bot-staging/google-cloud-security-private_ca-v1/lib/google/cloud/security/privateca/v1/resources_pb.rb @@ -0,0 +1,80 @@ +# frozen_string_literal: true +# Generated by the protocol buffer compiler. DO NOT EDIT! +# source: google/cloud/security/privateca/v1/resources.proto + +require 'google/protobuf' + +require 'google/api/field_behavior_pb' +require 'google/api/resource_pb' +require 'google/protobuf/duration_pb' +require 'google/protobuf/timestamp_pb' +require 'google/type/expr_pb' + + +descriptor_data = "\n2google/cloud/security/privateca/v1/resources.proto\x12\"google.cloud.security.privateca.v1\x1a\x1fgoogle/api/field_behavior.proto\x1a\x19google/api/resource.proto\x1a\x1egoogle/protobuf/duration.proto\x1a\x1fgoogle/protobuf/timestamp.proto\x1a\x16google/type/expr.proto\"\x86\x12\n\x14\x43\x65rtificateAuthority\x12\x11\n\x04name\x18\x01 \x01(\tB\x03\xe0\x41\x08\x12S\n\x04type\x18\x02 \x01(\x0e\x32=.google.cloud.security.privateca.v1.CertificateAuthority.TypeB\x06\xe0\x41\x02\xe0\x41\x05\x12M\n\x06\x63onfig\x18\x03 \x01(\x0b\x32\x35.google.cloud.security.privateca.v1.CertificateConfigB\x06\xe0\x41\x02\xe0\x41\x05\x12\x33\n\x08lifetime\x18\x04 \x01(\x0b\x32\x19.google.protobuf.DurationB\x06\xe0\x41\x02\xe0\x41\x05\x12\x61\n\x08key_spec\x18\x05 \x01(\x0b\x32G.google.cloud.security.privateca.v1.CertificateAuthority.KeyVersionSpecB\x06\xe0\x41\x02\xe0\x41\x05\x12V\n\x12subordinate_config\x18\x06 \x01(\x0b\x32\x35.google.cloud.security.privateca.v1.SubordinateConfigB\x03\xe0\x41\x01\x12\x42\n\x04tier\x18\x07 \x01(\x0e\x32/.google.cloud.security.privateca.v1.CaPool.TierB\x03\xe0\x41\x03\x12R\n\x05state\x18\x08 \x01(\x0e\x32>.google.cloud.security.privateca.v1.CertificateAuthority.StateB\x03\xe0\x41\x03\x12 \n\x13pem_ca_certificates\x18\t \x03(\tB\x03\xe0\x41\x03\x12\x64\n\x1b\x63\x61_certificate_descriptions\x18\n \x03(\x0b\x32:.google.cloud.security.privateca.v1.CertificateDescriptionB\x03\xe0\x41\x03\x12\x17\n\ngcs_bucket\x18\x0b \x01(\tB\x03\xe0\x41\x05\x12]\n\x0b\x61\x63\x63\x65ss_urls\x18\x0c \x01(\x0b\x32\x43.google.cloud.security.privateca.v1.CertificateAuthority.AccessUrlsB\x03\xe0\x41\x03\x12\x34\n\x0b\x63reate_time\x18\r \x01(\x0b\x32\x1a.google.protobuf.TimestampB\x03\xe0\x41\x03\x12\x34\n\x0bupdate_time\x18\x0e \x01(\x0b\x32\x1a.google.protobuf.TimestampB\x03\xe0\x41\x03\x12\x34\n\x0b\x64\x65lete_time\x18\x0f \x01(\x0b\x32\x1a.google.protobuf.TimestampB\x03\xe0\x41\x03\x12\x34\n\x0b\x65xpire_time\x18\x10 \x01(\x0b\x32\x1a.google.protobuf.TimestampB\x03\xe0\x41\x03\x12Y\n\x06labels\x18\x11 \x03(\x0b\x32\x44.google.cloud.security.privateca.v1.CertificateAuthority.LabelsEntryB\x03\xe0\x41\x01\x12u\n\x18user_defined_access_urls\x18\x12 \x01(\x0b\x32N.google.cloud.security.privateca.v1.CertificateAuthority.UserDefinedAccessUrlsB\x03\xe0\x41\x01\x12\x1a\n\rsatisfies_pzs\x18\x13 \x01(\x08\x42\x03\xe0\x41\x03\x12\x1a\n\rsatisfies_pzi\x18\x14 \x01(\x08\x42\x03\xe0\x41\x03\x1aH\n\nAccessUrls\x12!\n\x19\x63\x61_certificate_access_url\x18\x01 \x01(\t\x12\x17\n\x0f\x63rl_access_urls\x18\x02 \x03(\t\x1a\xa0\x01\n\x0eKeyVersionSpec\x12\x1f\n\x15\x63loud_kms_key_version\x18\x01 \x01(\tH\x00\x12_\n\talgorithm\x18\x02 \x01(\x0e\x32J.google.cloud.security.privateca.v1.CertificateAuthority.SignHashAlgorithmH\x00\x42\x0c\n\nKeyVersion\x1a`\n\x15UserDefinedAccessUrls\x12)\n\x1c\x61ia_issuing_certificate_urls\x18\x01 \x03(\tB\x03\xe0\x41\x01\x12\x1c\n\x0f\x63rl_access_urls\x18\x02 \x03(\tB\x03\xe0\x41\x01\x1a-\n\x0bLabelsEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12\r\n\x05value\x18\x02 \x01(\t:\x02\x38\x01\">\n\x04Type\x12\x14\n\x10TYPE_UNSPECIFIED\x10\x00\x12\x0f\n\x0bSELF_SIGNED\x10\x01\x12\x0f\n\x0bSUBORDINATE\x10\x02\"p\n\x05State\x12\x15\n\x11STATE_UNSPECIFIED\x10\x00\x12\x0b\n\x07\x45NABLED\x10\x01\x12\x0c\n\x08\x44ISABLED\x10\x02\x12\n\n\x06STAGED\x10\x03\x12\x1c\n\x18\x41WAITING_USER_ACTIVATION\x10\x04\x12\x0b\n\x07\x44\x45LETED\x10\x05\"\xfc\x01\n\x11SignHashAlgorithm\x12#\n\x1fSIGN_HASH_ALGORITHM_UNSPECIFIED\x10\x00\x12\x17\n\x13RSA_PSS_2048_SHA256\x10\x01\x12\x17\n\x13RSA_PSS_3072_SHA256\x10\x02\x12\x17\n\x13RSA_PSS_4096_SHA256\x10\x03\x12\x19\n\x15RSA_PKCS1_2048_SHA256\x10\x06\x12\x19\n\x15RSA_PKCS1_3072_SHA256\x10\x07\x12\x19\n\x15RSA_PKCS1_4096_SHA256\x10\x08\x12\x12\n\x0e\x45\x43_P256_SHA256\x10\x04\x12\x12\n\x0e\x45\x43_P384_SHA384\x10\x05:\x9d\x01\xea\x41\x99\x01\n-privateca.googleapis.com/CertificateAuthority\x12hprojects/{project}/locations/{location}/caPools/{ca_pool}/certificateAuthorities/{certificate_authority}\"\xdc\x10\n\x06\x43\x61Pool\x12\x11\n\x04name\x18\x01 \x01(\tB\x03\xe0\x41\x08\x12\x45\n\x04tier\x18\x02 \x01(\x0e\x32/.google.cloud.security.privateca.v1.CaPool.TierB\x06\xe0\x41\x02\xe0\x41\x05\x12W\n\x0fissuance_policy\x18\x03 \x01(\x0b\x32\x39.google.cloud.security.privateca.v1.CaPool.IssuancePolicyB\x03\xe0\x41\x01\x12]\n\x12publishing_options\x18\x04 \x01(\x0b\x32<.google.cloud.security.privateca.v1.CaPool.PublishingOptionsB\x03\xe0\x41\x01\x12K\n\x06labels\x18\x05 \x03(\x0b\x32\x36.google.cloud.security.privateca.v1.CaPool.LabelsEntryB\x03\xe0\x41\x01\x1a\xfb\x01\n\x11PublishingOptions\x12\x1c\n\x0fpublish_ca_cert\x18\x01 \x01(\x08\x42\x03\xe0\x41\x01\x12\x18\n\x0bpublish_crl\x18\x02 \x01(\x08\x42\x03\xe0\x41\x01\x12i\n\x0f\x65ncoding_format\x18\x03 \x01(\x0e\x32K.google.cloud.security.privateca.v1.CaPool.PublishingOptions.EncodingFormatB\x03\xe0\x41\x01\"C\n\x0e\x45ncodingFormat\x12\x1f\n\x1b\x45NCODING_FORMAT_UNSPECIFIED\x10\x00\x12\x07\n\x03PEM\x10\x01\x12\x07\n\x03\x44\x45R\x10\x02\x1a\xaa\n\n\x0eIssuancePolicy\x12h\n\x11\x61llowed_key_types\x18\x01 \x03(\x0b\x32H.google.cloud.security.privateca.v1.CaPool.IssuancePolicy.AllowedKeyTypeB\x03\xe0\x41\x01\x12\x39\n\x11\x62\x61\x63kdate_duration\x18\x07 \x01(\x0b\x32\x19.google.protobuf.DurationB\x03\xe0\x41\x01\x12\x38\n\x10maximum_lifetime\x18\x02 \x01(\x0b\x32\x19.google.protobuf.DurationB\x03\xe0\x41\x01\x12l\n\x16\x61llowed_issuance_modes\x18\x03 \x01(\x0b\x32G.google.cloud.security.privateca.v1.CaPool.IssuancePolicy.IssuanceModesB\x03\xe0\x41\x01\x12P\n\x0f\x62\x61seline_values\x18\x04 \x01(\x0b\x32\x32.google.cloud.security.privateca.v1.X509ParametersB\x03\xe0\x41\x01\x12\x65\n\x14identity_constraints\x18\x05 \x01(\x0b\x32\x42.google.cloud.security.privateca.v1.CertificateIdentityConstraintsB\x03\xe0\x41\x01\x12h\n\x16passthrough_extensions\x18\x06 \x01(\x0b\x32\x43.google.cloud.security.privateca.v1.CertificateExtensionConstraintsB\x03\xe0\x41\x01\x1a\xc5\x04\n\x0e\x41llowedKeyType\x12\x62\n\x03rsa\x18\x01 \x01(\x0b\x32S.google.cloud.security.privateca.v1.CaPool.IssuancePolicy.AllowedKeyType.RsaKeyTypeH\x00\x12l\n\x0e\x65lliptic_curve\x18\x02 \x01(\x0b\x32R.google.cloud.security.privateca.v1.CaPool.IssuancePolicy.AllowedKeyType.EcKeyTypeH\x00\x1aJ\n\nRsaKeyType\x12\x1d\n\x10min_modulus_size\x18\x01 \x01(\x03\x42\x03\xe0\x41\x01\x12\x1d\n\x10max_modulus_size\x18\x02 \x01(\x03\x42\x03\xe0\x41\x01\x1a\x88\x02\n\tEcKeyType\x12\x89\x01\n\x13signature_algorithm\x18\x01 \x01(\x0e\x32g.google.cloud.security.privateca.v1.CaPool.IssuancePolicy.AllowedKeyType.EcKeyType.EcSignatureAlgorithmB\x03\xe0\x41\x01\"o\n\x14\x45\x63SignatureAlgorithm\x12&\n\"EC_SIGNATURE_ALGORITHM_UNSPECIFIED\x10\x00\x12\x0e\n\nECDSA_P256\x10\x01\x12\x0e\n\nECDSA_P384\x10\x02\x12\x0f\n\x0b\x45\x44\x44SA_25519\x10\x03\x42\n\n\x08key_type\x1a`\n\rIssuanceModes\x12%\n\x18\x61llow_csr_based_issuance\x18\x01 \x01(\x08\x42\x03\xe0\x41\x01\x12(\n\x1b\x61llow_config_based_issuance\x18\x02 \x01(\x08\x42\x03\xe0\x41\x01\x1a-\n\x0bLabelsEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12\r\n\x05value\x18\x02 \x01(\t:\x02\x38\x01\"8\n\x04Tier\x12\x14\n\x10TIER_UNSPECIFIED\x10\x00\x12\x0e\n\nENTERPRISE\x10\x01\x12\n\n\x06\x44\x45VOPS\x10\x02:_\xea\x41\\\n\x1fprivateca.googleapis.com/CaPool\x12\x39projects/{project}/locations/{location}/caPools/{ca_pool}\"\xbc\x08\n\x19\x43\x65rtificateRevocationList\x12\x11\n\x04name\x18\x01 \x01(\tB\x03\xe0\x41\x08\x12\x1c\n\x0fsequence_number\x18\x02 \x01(\x03\x42\x03\xe0\x41\x03\x12s\n\x14revoked_certificates\x18\x03 \x03(\x0b\x32P.google.cloud.security.privateca.v1.CertificateRevocationList.RevokedCertificateB\x03\xe0\x41\x03\x12\x14\n\x07pem_crl\x18\x04 \x01(\tB\x03\xe0\x41\x03\x12\x17\n\naccess_url\x18\x05 \x01(\tB\x03\xe0\x41\x03\x12W\n\x05state\x18\x06 \x01(\x0e\x32\x43.google.cloud.security.privateca.v1.CertificateRevocationList.StateB\x03\xe0\x41\x03\x12\x34\n\x0b\x63reate_time\x18\x07 \x01(\x0b\x32\x1a.google.protobuf.TimestampB\x03\xe0\x41\x03\x12\x34\n\x0bupdate_time\x18\x08 \x01(\x0b\x32\x1a.google.protobuf.TimestampB\x03\xe0\x41\x03\x12\x18\n\x0brevision_id\x18\t \x01(\tB\x03\xe0\x41\x03\x12^\n\x06labels\x18\n \x03(\x0b\x32I.google.cloud.security.privateca.v1.CertificateRevocationList.LabelsEntryB\x03\xe0\x41\x01\x1a\xc0\x01\n\x12RevokedCertificate\x12>\n\x0b\x63\x65rtificate\x18\x01 \x01(\tB)\xfa\x41&\n$privateca.googleapis.com/Certificate\x12\x19\n\x11hex_serial_number\x18\x02 \x01(\t\x12O\n\x11revocation_reason\x18\x03 \x01(\x0e\x32\x34.google.cloud.security.privateca.v1.RevocationReason\x1a-\n\x0bLabelsEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12\r\n\x05value\x18\x02 \x01(\t:\x02\x38\x01\":\n\x05State\x12\x15\n\x11STATE_UNSPECIFIED\x10\x00\x12\n\n\x06\x41\x43TIVE\x10\x01\x12\x0e\n\nSUPERSEDED\x10\x02:\xdc\x01\xea\x41\xd8\x01\n2privateca.googleapis.com/CertificateRevocationList\x12\xa1\x01projects/{project}/locations/{location}/caPools/{ca_pool}/certificateAuthorities/{certificate_authority}/certificateRevocationLists/{certificate_revocation_list}\"\xe6\t\n\x0b\x43\x65rtificate\x12\x11\n\x04name\x18\x01 \x01(\tB\x03\xe0\x41\x08\x12\x16\n\x07pem_csr\x18\x02 \x01(\tB\x03\xe0\x41\x05H\x00\x12L\n\x06\x63onfig\x18\x03 \x01(\x0b\x32\x35.google.cloud.security.privateca.v1.CertificateConfigB\x03\xe0\x41\x05H\x00\x12[\n\x1cissuer_certificate_authority\x18\x04 \x01(\tB5\xe0\x41\x03\xfa\x41/\n-privateca.googleapis.com/CertificateAuthority\x12\x33\n\x08lifetime\x18\x05 \x01(\x0b\x32\x19.google.protobuf.DurationB\x06\xe0\x41\x02\xe0\x41\x05\x12R\n\x14\x63\x65rtificate_template\x18\x06 \x01(\tB4\xe0\x41\x05\xfa\x41.\n,privateca.googleapis.com/CertificateTemplate\x12Q\n\x0csubject_mode\x18\x07 \x01(\x0e\x32\x36.google.cloud.security.privateca.v1.SubjectRequestModeB\x03\xe0\x41\x05\x12\x62\n\x12revocation_details\x18\x08 \x01(\x0b\x32\x41.google.cloud.security.privateca.v1.Certificate.RevocationDetailsB\x03\xe0\x41\x03\x12\x1c\n\x0fpem_certificate\x18\t \x01(\tB\x03\xe0\x41\x03\x12`\n\x17\x63\x65rtificate_description\x18\n \x01(\x0b\x32:.google.cloud.security.privateca.v1.CertificateDescriptionB\x03\xe0\x41\x03\x12\"\n\x15pem_certificate_chain\x18\x0b \x03(\tB\x03\xe0\x41\x03\x12\x34\n\x0b\x63reate_time\x18\x0c \x01(\x0b\x32\x1a.google.protobuf.TimestampB\x03\xe0\x41\x03\x12\x34\n\x0bupdate_time\x18\r \x01(\x0b\x32\x1a.google.protobuf.TimestampB\x03\xe0\x41\x03\x12P\n\x06labels\x18\x0e \x03(\x0b\x32;.google.cloud.security.privateca.v1.Certificate.LabelsEntryB\x03\xe0\x41\x01\x1a\x98\x01\n\x11RevocationDetails\x12N\n\x10revocation_state\x18\x01 \x01(\x0e\x32\x34.google.cloud.security.privateca.v1.RevocationReason\x12\x33\n\x0frevocation_time\x18\x02 \x01(\x0b\x32\x1a.google.protobuf.Timestamp\x1a-\n\x0bLabelsEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12\r\n\x05value\x18\x02 \x01(\t:\x02\x38\x01:\x7f\xea\x41|\n$privateca.googleapis.com/Certificate\x12Tprojects/{project}/locations/{location}/caPools/{ca_pool}/certificates/{certificate}B\x14\n\x12\x63\x65rtificate_config\"\xa0\x06\n\x13\x43\x65rtificateTemplate\x12\x11\n\x04name\x18\x01 \x01(\tB\x03\xe0\x41\x08\x12\x38\n\x10maximum_lifetime\x18\t \x01(\x0b\x32\x19.google.protobuf.DurationB\x03\xe0\x41\x01\x12R\n\x11predefined_values\x18\x02 \x01(\x0b\x32\x32.google.cloud.security.privateca.v1.X509ParametersB\x03\xe0\x41\x01\x12\x65\n\x14identity_constraints\x18\x03 \x01(\x0b\x32\x42.google.cloud.security.privateca.v1.CertificateIdentityConstraintsB\x03\xe0\x41\x01\x12h\n\x16passthrough_extensions\x18\x04 \x01(\x0b\x32\x43.google.cloud.security.privateca.v1.CertificateExtensionConstraintsB\x03\xe0\x41\x01\x12\x18\n\x0b\x64\x65scription\x18\x05 \x01(\tB\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\x12X\n\x06labels\x18\x08 \x03(\x0b\x32\x43.google.cloud.security.privateca.v1.CertificateTemplate.LabelsEntryB\x03\xe0\x41\x01\x1a-\n\x0bLabelsEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12\r\n\x05value\x18\x02 \x01(\t:\x02\x38\x01:\x87\x01\xea\x41\x83\x01\n,privateca.googleapis.com/CertificateTemplate\x12Sprojects/{project}/locations/{location}/certificateTemplates/{certificate_template}\"\xce\x06\n\x0eX509Parameters\x12\x44\n\tkey_usage\x18\x01 \x01(\x0b\x32,.google.cloud.security.privateca.v1.KeyUsageB\x03\xe0\x41\x01\x12U\n\nca_options\x18\x02 \x01(\x0b\x32<.google.cloud.security.privateca.v1.X509Parameters.CaOptionsB\x03\xe0\x41\x01\x12\x45\n\npolicy_ids\x18\x03 \x03(\x0b\x32,.google.cloud.security.privateca.v1.ObjectIdB\x03\xe0\x41\x01\x12\x1d\n\x10\x61ia_ocsp_servers\x18\x04 \x03(\tB\x03\xe0\x41\x01\x12\x61\n\x10name_constraints\x18\x06 \x01(\x0b\x32\x42.google.cloud.security.privateca.v1.X509Parameters.NameConstraintsB\x03\xe0\x41\x01\x12U\n\x15\x61\x64\x64itional_extensions\x18\x05 \x03(\x0b\x32\x31.google.cloud.security.privateca.v1.X509ExtensionB\x03\xe0\x41\x01\x1as\n\tCaOptions\x12\x17\n\x05is_ca\x18\x01 \x01(\x08\x42\x03\xe0\x41\x01H\x00\x88\x01\x01\x12(\n\x16max_issuer_path_length\x18\x02 \x01(\x05\x42\x03\xe0\x41\x01H\x01\x88\x01\x01\x42\x08\n\x06_is_caB\x19\n\x17_max_issuer_path_length\x1a\x89\x02\n\x0fNameConstraints\x12\x10\n\x08\x63ritical\x18\x01 \x01(\x08\x12\x1b\n\x13permitted_dns_names\x18\x02 \x03(\t\x12\x1a\n\x12\x65xcluded_dns_names\x18\x03 \x03(\t\x12\x1b\n\x13permitted_ip_ranges\x18\x04 \x03(\t\x12\x1a\n\x12\x65xcluded_ip_ranges\x18\x05 \x03(\t\x12!\n\x19permitted_email_addresses\x18\x06 \x03(\t\x12 \n\x18\x65xcluded_email_addresses\x18\x07 \x03(\t\x12\x16\n\x0epermitted_uris\x18\x08 \x03(\t\x12\x15\n\rexcluded_uris\x18\t \x03(\t\"\xa9\x02\n\x11SubordinateConfig\x12V\n\x15\x63\x65rtificate_authority\x18\x01 \x01(\tB5\xe0\x41\x02\xfa\x41/\n-privateca.googleapis.com/CertificateAuthorityH\x00\x12m\n\x10pem_issuer_chain\x18\x02 \x01(\x0b\x32L.google.cloud.security.privateca.v1.SubordinateConfig.SubordinateConfigChainB\x03\xe0\x41\x02H\x00\x1a\x37\n\x16SubordinateConfigChain\x12\x1d\n\x10pem_certificates\x18\x01 \x03(\tB\x03\xe0\x41\x02\x42\x14\n\x12subordinate_config\"\x9d\x01\n\tPublicKey\x12\x10\n\x03key\x18\x01 \x01(\x0c\x42\x03\xe0\x41\x02\x12L\n\x06\x66ormat\x18\x02 \x01(\x0e\x32\x37.google.cloud.security.privateca.v1.PublicKey.KeyFormatB\x03\xe0\x41\x02\"0\n\tKeyFormat\x12\x1a\n\x16KEY_FORMAT_UNSPECIFIED\x10\x00\x12\x07\n\x03PEM\x10\x01\"\xac\x04\n\x11\x43\x65rtificateConfig\x12`\n\x0esubject_config\x18\x01 \x01(\x0b\x32\x43.google.cloud.security.privateca.v1.CertificateConfig.SubjectConfigB\x03\xe0\x41\x02\x12L\n\x0bx509_config\x18\x02 \x01(\x0b\x32\x32.google.cloud.security.privateca.v1.X509ParametersB\x03\xe0\x41\x02\x12\x46\n\npublic_key\x18\x03 \x01(\x0b\x32-.google.cloud.security.privateca.v1.PublicKeyB\x03\xe0\x41\x01\x12X\n\x0esubject_key_id\x18\x04 \x01(\x0b\x32;.google.cloud.security.privateca.v1.CertificateConfig.KeyIdB\x03\xe0\x41\x01\x1a\xa6\x01\n\rSubjectConfig\x12\x41\n\x07subject\x18\x01 \x01(\x0b\x32+.google.cloud.security.privateca.v1.SubjectB\x03\xe0\x41\x01\x12R\n\x10subject_alt_name\x18\x02 \x01(\x0b\x32\x33.google.cloud.security.privateca.v1.SubjectAltNamesB\x03\xe0\x41\x01\x1a\x1c\n\x05KeyId\x12\x13\n\x06key_id\x18\x01 \x01(\tB\x03\xe0\x41\x02\"\xc1\x08\n\x16\x43\x65rtificateDescription\x12j\n\x13subject_description\x18\x01 \x01(\x0b\x32M.google.cloud.security.privateca.v1.CertificateDescription.SubjectDescription\x12L\n\x10x509_description\x18\x02 \x01(\x0b\x32\x32.google.cloud.security.privateca.v1.X509Parameters\x12\x41\n\npublic_key\x18\x03 \x01(\x0b\x32-.google.cloud.security.privateca.v1.PublicKey\x12X\n\x0esubject_key_id\x18\x04 \x01(\x0b\x32@.google.cloud.security.privateca.v1.CertificateDescription.KeyId\x12Z\n\x10\x61uthority_key_id\x18\x05 \x01(\x0b\x32@.google.cloud.security.privateca.v1.CertificateDescription.KeyId\x12\x1f\n\x17\x63rl_distribution_points\x18\x06 \x03(\t\x12$\n\x1c\x61ia_issuing_certificate_urls\x18\x07 \x03(\t\x12k\n\x10\x63\x65rt_fingerprint\x18\x08 \x01(\x0b\x32Q.google.cloud.security.privateca.v1.CertificateDescription.CertificateFingerprint\x12\x1e\n\x16tbs_certificate_digest\x18\t \x01(\t\x1a\xd2\x02\n\x12SubjectDescription\x12<\n\x07subject\x18\x01 \x01(\x0b\x32+.google.cloud.security.privateca.v1.Subject\x12M\n\x10subject_alt_name\x18\x02 \x01(\x0b\x32\x33.google.cloud.security.privateca.v1.SubjectAltNames\x12\x19\n\x11hex_serial_number\x18\x03 \x01(\t\x12+\n\x08lifetime\x18\x04 \x01(\x0b\x32\x19.google.protobuf.Duration\x12\x33\n\x0fnot_before_time\x18\x05 \x01(\x0b\x32\x1a.google.protobuf.Timestamp\x12\x32\n\x0enot_after_time\x18\x06 \x01(\x0b\x32\x1a.google.protobuf.Timestamp\x1a\x1c\n\x05KeyId\x12\x13\n\x06key_id\x18\x01 \x01(\tB\x03\xe0\x41\x01\x1a-\n\x16\x43\x65rtificateFingerprint\x12\x13\n\x0bsha256_hash\x18\x01 \x01(\t\"\'\n\x08ObjectId\x12\x1b\n\x0eobject_id_path\x18\x01 \x03(\x05\x42\x03\xe0\x41\x02\"\x80\x01\n\rX509Extension\x12\x44\n\tobject_id\x18\x01 \x01(\x0b\x32,.google.cloud.security.privateca.v1.ObjectIdB\x03\xe0\x41\x02\x12\x15\n\x08\x63ritical\x18\x02 \x01(\x08\x42\x03\xe0\x41\x01\x12\x12\n\x05value\x18\x03 \x01(\x0c\x42\x03\xe0\x41\x02\"\xa2\x05\n\x08KeyUsage\x12T\n\x0e\x62\x61se_key_usage\x18\x01 \x01(\x0b\x32<.google.cloud.security.privateca.v1.KeyUsage.KeyUsageOptions\x12`\n\x12\x65xtended_key_usage\x18\x02 \x01(\x0b\x32\x44.google.cloud.security.privateca.v1.KeyUsage.ExtendedKeyUsageOptions\x12Q\n\x1bunknown_extended_key_usages\x18\x03 \x03(\x0b\x32,.google.cloud.security.privateca.v1.ObjectId\x1a\xe7\x01\n\x0fKeyUsageOptions\x12\x19\n\x11\x64igital_signature\x18\x01 \x01(\x08\x12\x1a\n\x12\x63ontent_commitment\x18\x02 \x01(\x08\x12\x18\n\x10key_encipherment\x18\x03 \x01(\x08\x12\x19\n\x11\x64\x61ta_encipherment\x18\x04 \x01(\x08\x12\x15\n\rkey_agreement\x18\x05 \x01(\x08\x12\x11\n\tcert_sign\x18\x06 \x01(\x08\x12\x10\n\x08\x63rl_sign\x18\x07 \x01(\x08\x12\x15\n\rencipher_only\x18\x08 \x01(\x08\x12\x15\n\rdecipher_only\x18\t \x01(\x08\x1a\xa0\x01\n\x17\x45xtendedKeyUsageOptions\x12\x13\n\x0bserver_auth\x18\x01 \x01(\x08\x12\x13\n\x0b\x63lient_auth\x18\x02 \x01(\x08\x12\x14\n\x0c\x63ode_signing\x18\x03 \x01(\x08\x12\x18\n\x10\x65mail_protection\x18\x04 \x01(\x08\x12\x15\n\rtime_stamping\x18\x05 \x01(\x08\x12\x14\n\x0cocsp_signing\x18\x06 \x01(\x08\"\xbe\x01\n\x15\x41ttributeTypeAndValue\x12\x41\n\x04type\x18\x01 \x01(\x0e\x32\x31.google.cloud.security.privateca.v1.AttributeTypeH\x00\x12\x41\n\tobject_id\x18\x02 \x01(\x0b\x32,.google.cloud.security.privateca.v1.ObjectIdH\x00\x12\r\n\x05value\x18\x03 \x01(\tB\x10\n\x0e\x61ttribute_type\"j\n\x19RelativeDistinguishedName\x12M\n\nattributes\x18\x01 \x03(\x0b\x32\x39.google.cloud.security.privateca.v1.AttributeTypeAndValue\"\x8d\x02\n\x07Subject\x12\x13\n\x0b\x63ommon_name\x18\x01 \x01(\t\x12\x14\n\x0c\x63ountry_code\x18\x02 \x01(\t\x12\x14\n\x0corganization\x18\x03 \x01(\t\x12\x1b\n\x13organizational_unit\x18\x04 \x01(\t\x12\x10\n\x08locality\x18\x05 \x01(\t\x12\x10\n\x08province\x18\x06 \x01(\t\x12\x16\n\x0estreet_address\x18\x07 \x01(\t\x12\x13\n\x0bpostal_code\x18\x08 \x01(\t\x12S\n\x0crdn_sequence\x18\t \x03(\x0b\x32=.google.cloud.security.privateca.v1.RelativeDistinguishedName\"\xa9\x01\n\x0fSubjectAltNames\x12\x11\n\tdns_names\x18\x01 \x03(\t\x12\x0c\n\x04uris\x18\x02 \x03(\t\x12\x17\n\x0f\x65mail_addresses\x18\x03 \x03(\t\x12\x14\n\x0cip_addresses\x18\x04 \x03(\t\x12\x46\n\x0b\x63ustom_sans\x18\x05 \x03(\x0b\x32\x31.google.cloud.security.privateca.v1.X509Extension\"\xfa\x01\n\x1e\x43\x65rtificateIdentityConstraints\x12.\n\x0e\x63\x65l_expression\x18\x01 \x01(\x0b\x32\x11.google.type.ExprB\x03\xe0\x41\x01\x12+\n\x19\x61llow_subject_passthrough\x18\x02 \x01(\x08\x42\x03\xe0\x41\x02H\x00\x88\x01\x01\x12\x35\n#allow_subject_alt_names_passthrough\x18\x03 \x01(\x08\x42\x03\xe0\x41\x02H\x01\x88\x01\x01\x42\x1c\n\x1a_allow_subject_passthroughB&\n$_allow_subject_alt_names_passthrough\"\xb4\x03\n\x1f\x43\x65rtificateExtensionConstraints\x12|\n\x10known_extensions\x18\x01 \x03(\x0e\x32].google.cloud.security.privateca.v1.CertificateExtensionConstraints.KnownCertificateExtensionB\x03\xe0\x41\x01\x12P\n\x15\x61\x64\x64itional_extensions\x18\x02 \x03(\x0b\x32,.google.cloud.security.privateca.v1.ObjectIdB\x03\xe0\x41\x01\"\xc0\x01\n\x19KnownCertificateExtension\x12+\n\'KNOWN_CERTIFICATE_EXTENSION_UNSPECIFIED\x10\x00\x12\x12\n\x0e\x42\x41SE_KEY_USAGE\x10\x01\x12\x16\n\x12\x45XTENDED_KEY_USAGE\x10\x02\x12\x0e\n\nCA_OPTIONS\x10\x03\x12\x0e\n\nPOLICY_IDS\x10\x04\x12\x14\n\x10\x41IA_OCSP_SERVERS\x10\x05\x12\x14\n\x10NAME_CONSTRAINTS\x10\x06*\xbe\x01\n\rAttributeType\x12\x1e\n\x1a\x41TTRIBUTE_TYPE_UNSPECIFIED\x10\x00\x12\x0f\n\x0b\x43OMMON_NAME\x10\x01\x12\x10\n\x0c\x43OUNTRY_CODE\x10\x02\x12\x10\n\x0cORGANIZATION\x10\x03\x12\x17\n\x13ORGANIZATIONAL_UNIT\x10\x04\x12\x0c\n\x08LOCALITY\x10\x05\x12\x0c\n\x08PROVINCE\x10\x06\x12\x12\n\x0eSTREET_ADDRESS\x10\x07\x12\x0f\n\x0bPOSTAL_CODE\x10\x08*\x87\x02\n\x10RevocationReason\x12!\n\x1dREVOCATION_REASON_UNSPECIFIED\x10\x00\x12\x12\n\x0eKEY_COMPROMISE\x10\x01\x12$\n CERTIFICATE_AUTHORITY_COMPROMISE\x10\x02\x12\x17\n\x13\x41\x46\x46ILIATION_CHANGED\x10\x03\x12\x0e\n\nSUPERSEDED\x10\x04\x12\x1a\n\x16\x43\x45SSATION_OF_OPERATION\x10\x05\x12\x14\n\x10\x43\x45RTIFICATE_HOLD\x10\x06\x12\x17\n\x13PRIVILEGE_WITHDRAWN\x10\x07\x12\"\n\x1e\x41TTRIBUTE_AUTHORITY_COMPROMISE\x10\x08*o\n\x12SubjectRequestMode\x12$\n SUBJECT_REQUEST_MODE_UNSPECIFIED\x10\x00\x12\x0b\n\x07\x44\x45\x46\x41ULT\x10\x01\x12\x10\n\x0cRDN_SEQUENCE\x10\x03\x12\x14\n\x10REFLECTED_SPIFFE\x10\x02\x42\xfc\x01\n&com.google.cloud.security.privateca.v1B\x17PrivateCaResourcesProtoP\x01ZDcloud.google.com/go/security/privateca/apiv1/privatecapb;privatecapb\xaa\x02\"Google.Cloud.Security.PrivateCA.V1\xca\x02\"Google\\Cloud\\Security\\PrivateCA\\V1\xea\x02&Google::Cloud::Security::PrivateCA::V1b\x06proto3" + +pool = ::Google::Protobuf::DescriptorPool.generated_pool +pool.add_serialized_file(descriptor_data) + +module Google + module Cloud + module Security + module PrivateCA + module V1 + CertificateAuthority = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.security.privateca.v1.CertificateAuthority").msgclass + CertificateAuthority::AccessUrls = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.security.privateca.v1.CertificateAuthority.AccessUrls").msgclass + CertificateAuthority::KeyVersionSpec = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.security.privateca.v1.CertificateAuthority.KeyVersionSpec").msgclass + CertificateAuthority::UserDefinedAccessUrls = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.security.privateca.v1.CertificateAuthority.UserDefinedAccessUrls").msgclass + CertificateAuthority::Type = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.security.privateca.v1.CertificateAuthority.Type").enummodule + CertificateAuthority::State = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.security.privateca.v1.CertificateAuthority.State").enummodule + CertificateAuthority::SignHashAlgorithm = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.security.privateca.v1.CertificateAuthority.SignHashAlgorithm").enummodule + CaPool = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.security.privateca.v1.CaPool").msgclass + CaPool::PublishingOptions = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.security.privateca.v1.CaPool.PublishingOptions").msgclass + CaPool::PublishingOptions::EncodingFormat = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.security.privateca.v1.CaPool.PublishingOptions.EncodingFormat").enummodule + CaPool::IssuancePolicy = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.security.privateca.v1.CaPool.IssuancePolicy").msgclass + CaPool::IssuancePolicy::AllowedKeyType = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.security.privateca.v1.CaPool.IssuancePolicy.AllowedKeyType").msgclass + CaPool::IssuancePolicy::AllowedKeyType::RsaKeyType = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.security.privateca.v1.CaPool.IssuancePolicy.AllowedKeyType.RsaKeyType").msgclass + CaPool::IssuancePolicy::AllowedKeyType::EcKeyType = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.security.privateca.v1.CaPool.IssuancePolicy.AllowedKeyType.EcKeyType").msgclass + CaPool::IssuancePolicy::AllowedKeyType::EcKeyType::EcSignatureAlgorithm = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.security.privateca.v1.CaPool.IssuancePolicy.AllowedKeyType.EcKeyType.EcSignatureAlgorithm").enummodule + CaPool::IssuancePolicy::IssuanceModes = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.security.privateca.v1.CaPool.IssuancePolicy.IssuanceModes").msgclass + CaPool::Tier = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.security.privateca.v1.CaPool.Tier").enummodule + CertificateRevocationList = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.security.privateca.v1.CertificateRevocationList").msgclass + CertificateRevocationList::RevokedCertificate = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.security.privateca.v1.CertificateRevocationList.RevokedCertificate").msgclass + CertificateRevocationList::State = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.security.privateca.v1.CertificateRevocationList.State").enummodule + Certificate = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.security.privateca.v1.Certificate").msgclass + Certificate::RevocationDetails = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.security.privateca.v1.Certificate.RevocationDetails").msgclass + CertificateTemplate = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.security.privateca.v1.CertificateTemplate").msgclass + X509Parameters = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.security.privateca.v1.X509Parameters").msgclass + X509Parameters::CaOptions = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.security.privateca.v1.X509Parameters.CaOptions").msgclass + X509Parameters::NameConstraints = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.security.privateca.v1.X509Parameters.NameConstraints").msgclass + SubordinateConfig = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.security.privateca.v1.SubordinateConfig").msgclass + SubordinateConfig::SubordinateConfigChain = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.security.privateca.v1.SubordinateConfig.SubordinateConfigChain").msgclass + PublicKey = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.security.privateca.v1.PublicKey").msgclass + PublicKey::KeyFormat = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.security.privateca.v1.PublicKey.KeyFormat").enummodule + CertificateConfig = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.security.privateca.v1.CertificateConfig").msgclass + CertificateConfig::SubjectConfig = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.security.privateca.v1.CertificateConfig.SubjectConfig").msgclass + CertificateConfig::KeyId = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.security.privateca.v1.CertificateConfig.KeyId").msgclass + CertificateDescription = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.security.privateca.v1.CertificateDescription").msgclass + CertificateDescription::SubjectDescription = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.security.privateca.v1.CertificateDescription.SubjectDescription").msgclass + CertificateDescription::KeyId = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.security.privateca.v1.CertificateDescription.KeyId").msgclass + CertificateDescription::CertificateFingerprint = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.security.privateca.v1.CertificateDescription.CertificateFingerprint").msgclass + ObjectId = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.security.privateca.v1.ObjectId").msgclass + X509Extension = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.security.privateca.v1.X509Extension").msgclass + KeyUsage = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.security.privateca.v1.KeyUsage").msgclass + KeyUsage::KeyUsageOptions = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.security.privateca.v1.KeyUsage.KeyUsageOptions").msgclass + KeyUsage::ExtendedKeyUsageOptions = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.security.privateca.v1.KeyUsage.ExtendedKeyUsageOptions").msgclass + AttributeTypeAndValue = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.security.privateca.v1.AttributeTypeAndValue").msgclass + RelativeDistinguishedName = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.security.privateca.v1.RelativeDistinguishedName").msgclass + Subject = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.security.privateca.v1.Subject").msgclass + SubjectAltNames = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.security.privateca.v1.SubjectAltNames").msgclass + CertificateIdentityConstraints = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.security.privateca.v1.CertificateIdentityConstraints").msgclass + CertificateExtensionConstraints = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.security.privateca.v1.CertificateExtensionConstraints").msgclass + CertificateExtensionConstraints::KnownCertificateExtension = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.security.privateca.v1.CertificateExtensionConstraints.KnownCertificateExtension").enummodule + AttributeType = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.security.privateca.v1.AttributeType").enummodule + RevocationReason = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.security.privateca.v1.RevocationReason").enummodule + SubjectRequestMode = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.security.privateca.v1.SubjectRequestMode").enummodule + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-security-private_ca-v1/lib/google/cloud/security/privateca/v1/service_pb.rb b/owl-bot-staging/google-cloud-security-private_ca-v1/lib/google/cloud/security/privateca/v1/service_pb.rb new file mode 100644 index 000000000000..f329659efa1f --- /dev/null +++ b/owl-bot-staging/google-cloud-security-private_ca-v1/lib/google/cloud/security/privateca/v1/service_pb.rb @@ -0,0 +1,71 @@ +# frozen_string_literal: true +# Generated by the protocol buffer compiler. DO NOT EDIT! +# source: google/cloud/security/privateca/v1/service.proto + +require 'google/protobuf' + +require 'google/api/annotations_pb' +require 'google/api/client_pb' +require 'google/api/field_behavior_pb' +require 'google/api/field_info_pb' +require 'google/api/resource_pb' +require 'google/cloud/security/privateca/v1/resources_pb' +require 'google/longrunning/operations_pb' +require 'google/protobuf/empty_pb' +require 'google/protobuf/field_mask_pb' +require 'google/protobuf/timestamp_pb' + + +descriptor_data = "\n0google/cloud/security/privateca/v1/service.proto\x12\"google.cloud.security.privateca.v1\x1a\x1cgoogle/api/annotations.proto\x1a\x17google/api/client.proto\x1a\x1fgoogle/api/field_behavior.proto\x1a\x1bgoogle/api/field_info.proto\x1a\x19google/api/resource.proto\x1a\x32google/cloud/security/privateca/v1/resources.proto\x1a#google/longrunning/operations.proto\x1a\x1bgoogle/protobuf/empty.proto\x1a google/protobuf/field_mask.proto\x1a\x1fgoogle/protobuf/timestamp.proto\"\x9f\x02\n\x18\x43reateCertificateRequest\x12\x37\n\x06parent\x18\x01 \x01(\tB\'\xe0\x41\x02\xfa\x41!\n\x1fprivateca.googleapis.com/CaPool\x12\x1b\n\x0e\x63\x65rtificate_id\x18\x02 \x01(\tB\x03\xe0\x41\x01\x12I\n\x0b\x63\x65rtificate\x18\x03 \x01(\x0b\x32/.google.cloud.security.privateca.v1.CertificateB\x03\xe0\x41\x02\x12\x17\n\nrequest_id\x18\x04 \x01(\tB\x03\xe0\x41\x01\x12\x1a\n\rvalidate_only\x18\x05 \x01(\x08\x42\x03\xe0\x41\x01\x12-\n issuing_certificate_authority_id\x18\x06 \x01(\tB\x03\xe0\x41\x01\"S\n\x15GetCertificateRequest\x12:\n\x04name\x18\x01 \x01(\tB,\xe0\x41\x02\xfa\x41&\n$privateca.googleapis.com/Certificate\"\xaf\x01\n\x17ListCertificatesRequest\x12\x37\n\x06parent\x18\x01 \x01(\tB\'\xe0\x41\x02\xfa\x41!\n\x1fprivateca.googleapis.com/CaPool\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\x12\x15\n\x08order_by\x18\x05 \x01(\tB\x03\xe0\x41\x01\"\x8f\x01\n\x18ListCertificatesResponse\x12\x45\n\x0c\x63\x65rtificates\x18\x01 \x03(\x0b\x32/.google.cloud.security.privateca.v1.Certificate\x12\x17\n\x0fnext_page_token\x18\x02 \x01(\t\x12\x13\n\x0bunreachable\x18\x03 \x03(\t\"\xba\x01\n\x18RevokeCertificateRequest\x12:\n\x04name\x18\x01 \x01(\tB,\xe0\x41\x02\xfa\x41&\n$privateca.googleapis.com/Certificate\x12I\n\x06reason\x18\x02 \x01(\x0e\x32\x34.google.cloud.security.privateca.v1.RevocationReasonB\x03\xe0\x41\x02\x12\x17\n\nrequest_id\x18\x03 \x01(\tB\x03\xe0\x41\x01\"\xb4\x01\n\x18UpdateCertificateRequest\x12I\n\x0b\x63\x65rtificate\x18\x01 \x01(\x0b\x32/.google.cloud.security.privateca.v1.CertificateB\x03\xe0\x41\x02\x12\x34\n\x0bupdate_mask\x18\x02 \x01(\x0b\x32\x1a.google.protobuf.FieldMaskB\x03\xe0\x41\x02\x12\x17\n\nrequest_id\x18\x03 \x01(\tB\x03\xe0\x41\x01\"\x84\x02\n#ActivateCertificateAuthorityRequest\x12\x43\n\x04name\x18\x01 \x01(\tB5\xe0\x41\x02\xfa\x41/\n-privateca.googleapis.com/CertificateAuthority\x12\x1f\n\x12pem_ca_certificate\x18\x02 \x01(\tB\x03\xe0\x41\x02\x12V\n\x12subordinate_config\x18\x03 \x01(\x0b\x32\x35.google.cloud.security.privateca.v1.SubordinateConfigB\x03\xe0\x41\x02\x12\x1f\n\nrequest_id\x18\x04 \x01(\tB\x0b\xe0\x41\x01\xe2\x8c\xcf\xd7\x08\x02\x08\x01\"\xfa\x01\n!CreateCertificateAuthorityRequest\x12\x37\n\x06parent\x18\x01 \x01(\tB\'\xe0\x41\x02\xfa\x41!\n\x1fprivateca.googleapis.com/CaPool\x12%\n\x18\x63\x65rtificate_authority_id\x18\x02 \x01(\tB\x03\xe0\x41\x02\x12\\\n\x15\x63\x65rtificate_authority\x18\x03 \x01(\x0b\x32\x38.google.cloud.security.privateca.v1.CertificateAuthorityB\x03\xe0\x41\x02\x12\x17\n\nrequest_id\x18\x04 \x01(\tB\x03\xe0\x41\x01\"\xb3\x01\n\"DisableCertificateAuthorityRequest\x12\x43\n\x04name\x18\x01 \x01(\tB5\xe0\x41\x02\xfa\x41/\n-privateca.googleapis.com/CertificateAuthority\x12\x1f\n\nrequest_id\x18\x02 \x01(\tB\x0b\xe0\x41\x01\xe2\x8c\xcf\xd7\x08\x02\x08\x01\x12\'\n\x1aignore_dependent_resources\x18\x03 \x01(\x08\x42\x03\xe0\x41\x01\"\x89\x01\n!EnableCertificateAuthorityRequest\x12\x43\n\x04name\x18\x01 \x01(\tB5\xe0\x41\x02\xfa\x41/\n-privateca.googleapis.com/CertificateAuthority\x12\x1f\n\nrequest_id\x18\x02 \x01(\tB\x0b\xe0\x41\x01\xe2\x8c\xcf\xd7\x08\x02\x08\x01\"j\n#FetchCertificateAuthorityCsrRequest\x12\x43\n\x04name\x18\x01 \x01(\tB5\xe0\x41\x02\xfa\x41/\n-privateca.googleapis.com/CertificateAuthority\"<\n$FetchCertificateAuthorityCsrResponse\x12\x14\n\x07pem_csr\x18\x01 \x01(\tB\x03\xe0\x41\x03\"e\n\x1eGetCertificateAuthorityRequest\x12\x43\n\x04name\x18\x01 \x01(\tB5\xe0\x41\x02\xfa\x41/\n-privateca.googleapis.com/CertificateAuthority\"\xb9\x01\n!ListCertificateAuthoritiesRequest\x12\x37\n\x06parent\x18\x01 \x01(\tB\'\xe0\x41\x02\xfa\x41!\n\x1fprivateca.googleapis.com/CaPool\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\x12\x15\n\x08order_by\x18\x05 \x01(\tB\x03\xe0\x41\x01\"\xad\x01\n\"ListCertificateAuthoritiesResponse\x12Y\n\x17\x63\x65rtificate_authorities\x18\x01 \x03(\x0b\x32\x38.google.cloud.security.privateca.v1.CertificateAuthority\x12\x17\n\x0fnext_page_token\x18\x02 \x01(\t\x12\x13\n\x0bunreachable\x18\x03 \x03(\t\"\x8b\x01\n#UndeleteCertificateAuthorityRequest\x12\x43\n\x04name\x18\x01 \x01(\tB5\xe0\x41\x02\xfa\x41/\n-privateca.googleapis.com/CertificateAuthority\x12\x1f\n\nrequest_id\x18\x02 \x01(\tB\x0b\xe0\x41\x01\xe2\x8c\xcf\xd7\x08\x02\x08\x01\"\xfb\x01\n!DeleteCertificateAuthorityRequest\x12\x43\n\x04name\x18\x01 \x01(\tB5\xe0\x41\x02\xfa\x41/\n-privateca.googleapis.com/CertificateAuthority\x12\x1f\n\nrequest_id\x18\x02 \x01(\tB\x0b\xe0\x41\x01\xe2\x8c\xcf\xd7\x08\x02\x08\x01\x12\'\n\x1aignore_active_certificates\x18\x04 \x01(\x08\x42\x03\xe0\x41\x01\x12\x1e\n\x11skip_grace_period\x18\x05 \x01(\x08\x42\x03\xe0\x41\x01\x12\'\n\x1aignore_dependent_resources\x18\x06 \x01(\x08\x42\x03\xe0\x41\x01\"\xd8\x01\n!UpdateCertificateAuthorityRequest\x12\\\n\x15\x63\x65rtificate_authority\x18\x01 \x01(\x0b\x32\x38.google.cloud.security.privateca.v1.CertificateAuthorityB\x03\xe0\x41\x02\x12\x34\n\x0bupdate_mask\x18\x02 \x01(\x0b\x32\x1a.google.protobuf.FieldMaskB\x03\xe0\x41\x02\x12\x1f\n\nrequest_id\x18\x03 \x01(\tB\x0b\xe0\x41\x01\xe2\x8c\xcf\xd7\x08\x02\x08\x01\"\xcc\x01\n\x13\x43reateCaPoolRequest\x12\x39\n\x06parent\x18\x01 \x01(\tB)\xe0\x41\x02\xfa\x41#\n!locations.googleapis.com/Location\x12\x17\n\nca_pool_id\x18\x02 \x01(\tB\x03\xe0\x41\x02\x12@\n\x07\x63\x61_pool\x18\x03 \x01(\x0b\x32*.google.cloud.security.privateca.v1.CaPoolB\x03\xe0\x41\x02\x12\x1f\n\nrequest_id\x18\x04 \x01(\tB\x0b\xe0\x41\x01\xe2\x8c\xcf\xd7\x08\x02\x08\x01\"\xae\x01\n\x13UpdateCaPoolRequest\x12@\n\x07\x63\x61_pool\x18\x01 \x01(\x0b\x32*.google.cloud.security.privateca.v1.CaPoolB\x03\xe0\x41\x02\x12\x34\n\x0bupdate_mask\x18\x02 \x01(\x0b\x32\x1a.google.protobuf.FieldMaskB\x03\xe0\x41\x02\x12\x1f\n\nrequest_id\x18\x03 \x01(\tB\x0b\xe0\x41\x01\xe2\x8c\xcf\xd7\x08\x02\x08\x01\"\x96\x01\n\x13\x44\x65leteCaPoolRequest\x12\x35\n\x04name\x18\x01 \x01(\tB\'\xe0\x41\x02\xfa\x41!\n\x1fprivateca.googleapis.com/CaPool\x12\x1f\n\nrequest_id\x18\x02 \x01(\tB\x0b\xe0\x41\x01\xe2\x8c\xcf\xd7\x08\x02\x08\x01\x12\'\n\x1aignore_dependent_resources\x18\x04 \x01(\x08\x42\x03\xe0\x41\x01\"h\n\x13\x46\x65tchCaCertsRequest\x12\x38\n\x07\x63\x61_pool\x18\x01 \x01(\tB\'\xe0\x41\x02\xfa\x41!\n\x1fprivateca.googleapis.com/CaPool\x12\x17\n\nrequest_id\x18\x02 \x01(\tB\x03\xe0\x41\x01\"\x8f\x01\n\x14\x46\x65tchCaCertsResponse\x12T\n\x08\x63\x61_certs\x18\x01 \x03(\x0b\x32\x42.google.cloud.security.privateca.v1.FetchCaCertsResponse.CertChain\x1a!\n\tCertChain\x12\x14\n\x0c\x63\x65rtificates\x18\x01 \x03(\t\"I\n\x10GetCaPoolRequest\x12\x35\n\x04name\x18\x01 \x01(\tB\'\xe0\x41\x02\xfa\x41!\n\x1fprivateca.googleapis.com/CaPool\"\xac\x01\n\x12ListCaPoolsRequest\x12\x39\n\x06parent\x18\x01 \x01(\tB)\xe0\x41\x02\xfa\x41#\n!locations.googleapis.com/Location\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\x12\x15\n\x08order_by\x18\x05 \x01(\tB\x03\xe0\x41\x01\"\x81\x01\n\x13ListCaPoolsResponse\x12<\n\x08\x63\x61_pools\x18\x01 \x03(\x0b\x32*.google.cloud.security.privateca.v1.CaPool\x12\x17\n\x0fnext_page_token\x18\x02 \x01(\t\x12\x13\n\x0bunreachable\x18\x03 \x03(\t\"o\n#GetCertificateRevocationListRequest\x12H\n\x04name\x18\x01 \x01(\tB:\xe0\x41\x02\xfa\x41\x34\n2privateca.googleapis.com/CertificateRevocationList\"\xcb\x01\n%ListCertificateRevocationListsRequest\x12\x45\n\x06parent\x18\x01 \x01(\tB5\xe0\x41\x02\xfa\x41/\n-privateca.googleapis.com/CertificateAuthority\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\x12\x15\n\x08order_by\x18\x05 \x01(\tB\x03\xe0\x41\x01\"\xbb\x01\n&ListCertificateRevocationListsResponse\x12\x63\n\x1c\x63\x65rtificate_revocation_lists\x18\x01 \x03(\x0b\x32=.google.cloud.security.privateca.v1.CertificateRevocationList\x12\x17\n\x0fnext_page_token\x18\x02 \x01(\t\x12\x13\n\x0bunreachable\x18\x03 \x03(\t\"\xe0\x01\n&UpdateCertificateRevocationListRequest\x12g\n\x1b\x63\x65rtificate_revocation_list\x18\x01 \x01(\x0b\x32=.google.cloud.security.privateca.v1.CertificateRevocationListB\x03\xe0\x41\x02\x12\x34\n\x0bupdate_mask\x18\x02 \x01(\x0b\x32\x1a.google.protobuf.FieldMaskB\x03\xe0\x41\x02\x12\x17\n\nrequest_id\x18\x03 \x01(\tB\x03\xe0\x41\x01\"\x80\x02\n CreateCertificateTemplateRequest\x12\x39\n\x06parent\x18\x01 \x01(\tB)\xe0\x41\x02\xfa\x41#\n!locations.googleapis.com/Location\x12$\n\x17\x63\x65rtificate_template_id\x18\x02 \x01(\tB\x03\xe0\x41\x02\x12Z\n\x14\x63\x65rtificate_template\x18\x03 \x01(\x0b\x32\x37.google.cloud.security.privateca.v1.CertificateTemplateB\x03\xe0\x41\x02\x12\x1f\n\nrequest_id\x18\x04 \x01(\tB\x0b\xe0\x41\x01\xe2\x8c\xcf\xd7\x08\x02\x08\x01\"\x87\x01\n DeleteCertificateTemplateRequest\x12\x42\n\x04name\x18\x01 \x01(\tB4\xe0\x41\x02\xfa\x41.\n,privateca.googleapis.com/CertificateTemplate\x12\x1f\n\nrequest_id\x18\x02 \x01(\tB\x0b\xe0\x41\x01\xe2\x8c\xcf\xd7\x08\x02\x08\x01\"c\n\x1dGetCertificateTemplateRequest\x12\x42\n\x04name\x18\x01 \x01(\tB4\xe0\x41\x02\xfa\x41.\n,privateca.googleapis.com/CertificateTemplate\"\xb9\x01\n\x1fListCertificateTemplatesRequest\x12\x39\n\x06parent\x18\x01 \x01(\tB)\xe0\x41\x02\xfa\x41#\n!locations.googleapis.com/Location\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\x12\x15\n\x08order_by\x18\x05 \x01(\tB\x03\xe0\x41\x01\"\xa8\x01\n ListCertificateTemplatesResponse\x12V\n\x15\x63\x65rtificate_templates\x18\x01 \x03(\x0b\x32\x37.google.cloud.security.privateca.v1.CertificateTemplate\x12\x17\n\x0fnext_page_token\x18\x02 \x01(\t\x12\x13\n\x0bunreachable\x18\x03 \x03(\t\"\xd5\x01\n UpdateCertificateTemplateRequest\x12Z\n\x14\x63\x65rtificate_template\x18\x01 \x01(\x0b\x32\x37.google.cloud.security.privateca.v1.CertificateTemplateB\x03\xe0\x41\x02\x12\x34\n\x0bupdate_mask\x18\x02 \x01(\x0b\x32\x1a.google.protobuf.FieldMaskB\x03\xe0\x41\x02\x12\x1f\n\nrequest_id\x18\x03 \x01(\tB\x0b\xe0\x41\x01\xe2\x8c\xcf\xd7\x08\x02\x08\x01\"\x80\x02\n\x11OperationMetadata\x12\x34\n\x0b\x63reate_time\x18\x01 \x01(\x0b\x32\x1a.google.protobuf.TimestampB\x03\xe0\x41\x03\x12\x31\n\x08\x65nd_time\x18\x02 \x01(\x0b\x32\x1a.google.protobuf.TimestampB\x03\xe0\x41\x03\x12\x13\n\x06target\x18\x03 \x01(\tB\x03\xe0\x41\x03\x12\x11\n\x04verb\x18\x04 \x01(\tB\x03\xe0\x41\x03\x12\x1b\n\x0estatus_message\x18\x05 \x01(\tB\x03\xe0\x41\x03\x12#\n\x16requested_cancellation\x18\x06 \x01(\x08\x42\x03\xe0\x41\x03\x12\x18\n\x0b\x61pi_version\x18\x07 \x01(\tB\x03\xe0\x41\x03\x32\xfa;\n\x1b\x43\x65rtificateAuthorityService\x12\xf7\x01\n\x11\x43reateCertificate\x12<.google.cloud.security.privateca.v1.CreateCertificateRequest\x1a/.google.cloud.security.privateca.v1.Certificate\"s\xda\x41!parent,certificate,certificate_id\x82\xd3\xe4\x93\x02I\":/v1/{parent=projects/*/locations/*/caPools/*}/certificates:\x0b\x63\x65rtificate\x12\xc7\x01\n\x0eGetCertificate\x12\x39.google.cloud.security.privateca.v1.GetCertificateRequest\x1a/.google.cloud.security.privateca.v1.Certificate\"I\xda\x41\x04name\x82\xd3\xe4\x93\x02<\x12:/v1/{name=projects/*/locations/*/caPools/*/certificates/*}\x12\xda\x01\n\x10ListCertificates\x12;.google.cloud.security.privateca.v1.ListCertificatesRequest\x1a<.google.cloud.security.privateca.v1.ListCertificatesResponse\"K\xda\x41\x06parent\x82\xd3\xe4\x93\x02<\x12:/v1/{parent=projects/*/locations/*/caPools/*}/certificates\x12\xd7\x01\n\x11RevokeCertificate\x12<.google.cloud.security.privateca.v1.RevokeCertificateRequest\x1a/.google.cloud.security.privateca.v1.Certificate\"S\xda\x41\x04name\x82\xd3\xe4\x93\x02\x46\"A/v1/{name=projects/*/locations/*/caPools/*/certificates/*}:revoke:\x01*\x12\xf9\x01\n\x11UpdateCertificate\x12<.google.cloud.security.privateca.v1.UpdateCertificateRequest\x1a/.google.cloud.security.privateca.v1.Certificate\"u\xda\x41\x17\x63\x65rtificate,update_mask\x82\xd3\xe4\x93\x02U2F/v1/{certificate.name=projects/*/locations/*/caPools/*/certificates/*}:\x0b\x63\x65rtificate\x12\x94\x02\n\x1c\x41\x63tivateCertificateAuthority\x12G.google.cloud.security.privateca.v1.ActivateCertificateAuthorityRequest\x1a\x1d.google.longrunning.Operation\"\x8b\x01\xca\x41)\n\x14\x43\x65rtificateAuthority\x12\x11OperationMetadata\xda\x41\x04name\x82\xd3\xe4\x93\x02R\"M/v1/{name=projects/*/locations/*/caPools/*/certificateAuthorities/*}:activate:\x01*\x12\xcc\x02\n\x1a\x43reateCertificateAuthority\x12\x45.google.cloud.security.privateca.v1.CreateCertificateAuthorityRequest\x1a\x1d.google.longrunning.Operation\"\xc7\x01\xca\x41)\n\x14\x43\x65rtificateAuthority\x12\x11OperationMetadata\xda\x41\x35parent,certificate_authority,certificate_authority_id\x82\xd3\xe4\x93\x02]\"D/v1/{parent=projects/*/locations/*/caPools/*}/certificateAuthorities:\x15\x63\x65rtificate_authority\x12\x91\x02\n\x1b\x44isableCertificateAuthority\x12\x46.google.cloud.security.privateca.v1.DisableCertificateAuthorityRequest\x1a\x1d.google.longrunning.Operation\"\x8a\x01\xca\x41)\n\x14\x43\x65rtificateAuthority\x12\x11OperationMetadata\xda\x41\x04name\x82\xd3\xe4\x93\x02Q\"L/v1/{name=projects/*/locations/*/caPools/*/certificateAuthorities/*}:disable:\x01*\x12\x8e\x02\n\x1a\x45nableCertificateAuthority\x12\x45.google.cloud.security.privateca.v1.EnableCertificateAuthorityRequest\x1a\x1d.google.longrunning.Operation\"\x89\x01\xca\x41)\n\x14\x43\x65rtificateAuthority\x12\x11OperationMetadata\xda\x41\x04name\x82\xd3\xe4\x93\x02P\"K/v1/{name=projects/*/locations/*/caPools/*/certificateAuthorities/*}:enable:\x01*\x12\x8c\x02\n\x1c\x46\x65tchCertificateAuthorityCsr\x12G.google.cloud.security.privateca.v1.FetchCertificateAuthorityCsrRequest\x1aH.google.cloud.security.privateca.v1.FetchCertificateAuthorityCsrResponse\"Y\xda\x41\x04name\x82\xd3\xe4\x93\x02L\x12J/v1/{name=projects/*/locations/*/caPools/*/certificateAuthorities/*}:fetch\x12\xec\x01\n\x17GetCertificateAuthority\x12\x42.google.cloud.security.privateca.v1.GetCertificateAuthorityRequest\x1a\x38.google.cloud.security.privateca.v1.CertificateAuthority\"S\xda\x41\x04name\x82\xd3\xe4\x93\x02\x46\x12\x44/v1/{name=projects/*/locations/*/caPools/*/certificateAuthorities/*}\x12\x82\x02\n\x1aListCertificateAuthorities\x12\x45.google.cloud.security.privateca.v1.ListCertificateAuthoritiesRequest\x1a\x46.google.cloud.security.privateca.v1.ListCertificateAuthoritiesResponse\"U\xda\x41\x06parent\x82\xd3\xe4\x93\x02\x46\x12\x44/v1/{parent=projects/*/locations/*/caPools/*}/certificateAuthorities\x12\x94\x02\n\x1cUndeleteCertificateAuthority\x12G.google.cloud.security.privateca.v1.UndeleteCertificateAuthorityRequest\x1a\x1d.google.longrunning.Operation\"\x8b\x01\xca\x41)\n\x14\x43\x65rtificateAuthority\x12\x11OperationMetadata\xda\x41\x04name\x82\xd3\xe4\x93\x02R\"M/v1/{name=projects/*/locations/*/caPools/*/certificateAuthorities/*}:undelete:\x01*\x12\x83\x02\n\x1a\x44\x65leteCertificateAuthority\x12\x45.google.cloud.security.privateca.v1.DeleteCertificateAuthorityRequest\x1a\x1d.google.longrunning.Operation\"\x7f\xca\x41)\n\x14\x43\x65rtificateAuthority\x12\x11OperationMetadata\xda\x41\x04name\x82\xd3\xe4\x93\x02\x46*D/v1/{name=projects/*/locations/*/caPools/*/certificateAuthorities/*}\x12\xce\x02\n\x1aUpdateCertificateAuthority\x12\x45.google.cloud.security.privateca.v1.UpdateCertificateAuthorityRequest\x1a\x1d.google.longrunning.Operation\"\xc9\x01\xca\x41)\n\x14\x43\x65rtificateAuthority\x12\x11OperationMetadata\xda\x41!certificate_authority,update_mask\x82\xd3\xe4\x93\x02s2Z/v1/{certificate_authority.name=projects/*/locations/*/caPools/*/certificateAuthorities/*}:\x15\x63\x65rtificate_authority\x12\xde\x01\n\x0c\x43reateCaPool\x12\x37.google.cloud.security.privateca.v1.CreateCaPoolRequest\x1a\x1d.google.longrunning.Operation\"v\xca\x41\x1b\n\x06\x43\x61Pool\x12\x11OperationMetadata\xda\x41\x19parent,ca_pool,ca_pool_id\x82\xd3\xe4\x93\x02\x36\"+/v1/{parent=projects/*/locations/*}/caPools:\x07\x63\x61_pool\x12\xe0\x01\n\x0cUpdateCaPool\x12\x37.google.cloud.security.privateca.v1.UpdateCaPoolRequest\x1a\x1d.google.longrunning.Operation\"x\xca\x41\x1b\n\x06\x43\x61Pool\x12\x11OperationMetadata\xda\x41\x13\x63\x61_pool,update_mask\x82\xd3\xe4\x93\x02>23/v1/{ca_pool.name=projects/*/locations/*/caPools/*}:\x07\x63\x61_pool\x12\xa9\x01\n\tGetCaPool\x12\x34.google.cloud.security.privateca.v1.GetCaPoolRequest\x1a*.google.cloud.security.privateca.v1.CaPool\":\xda\x41\x04name\x82\xd3\xe4\x93\x02-\x12+/v1/{name=projects/*/locations/*/caPools/*}\x12\xbc\x01\n\x0bListCaPools\x12\x36.google.cloud.security.privateca.v1.ListCaPoolsRequest\x1a\x37.google.cloud.security.privateca.v1.ListCaPoolsResponse\"<\xda\x41\x06parent\x82\xd3\xe4\x93\x02-\x12+/v1/{parent=projects/*/locations/*}/caPools\x12\xcf\x01\n\x0c\x44\x65leteCaPool\x12\x37.google.cloud.security.privateca.v1.DeleteCaPoolRequest\x1a\x1d.google.longrunning.Operation\"g\xca\x41*\n\x15google.protobuf.Empty\x12\x11OperationMetadata\xda\x41\x04name\x82\xd3\xe4\x93\x02-*+/v1/{name=projects/*/locations/*/caPools/*}\x12\xd3\x01\n\x0c\x46\x65tchCaCerts\x12\x37.google.cloud.security.privateca.v1.FetchCaCertsRequest\x1a\x38.google.cloud.security.privateca.v1.FetchCaCertsResponse\"P\xda\x41\x07\x63\x61_pool\x82\xd3\xe4\x93\x02@\";/v1/{ca_pool=projects/*/locations/*/caPools/*}:fetchCaCerts:\x01*\x12\x98\x02\n\x1cGetCertificateRevocationList\x12G.google.cloud.security.privateca.v1.GetCertificateRevocationListRequest\x1a=.google.cloud.security.privateca.v1.CertificateRevocationList\"p\xda\x41\x04name\x82\xd3\xe4\x93\x02\x63\x12\x61/v1/{name=projects/*/locations/*/caPools/*/certificateAuthorities/*/certificateRevocationLists/*}\x12\xab\x02\n\x1eListCertificateRevocationLists\x12I.google.cloud.security.privateca.v1.ListCertificateRevocationListsRequest\x1aJ.google.cloud.security.privateca.v1.ListCertificateRevocationListsResponse\"r\xda\x41\x06parent\x82\xd3\xe4\x93\x02\x63\x12\x61/v1/{parent=projects/*/locations/*/caPools/*/certificateAuthorities/*}/certificateRevocationLists\x12\x8d\x03\n\x1fUpdateCertificateRevocationList\x12J.google.cloud.security.privateca.v1.UpdateCertificateRevocationListRequest\x1a\x1d.google.longrunning.Operation\"\xfe\x01\xca\x41.\n\x19\x43\x65rtificateRevocationList\x12\x11OperationMetadata\xda\x41\'certificate_revocation_list,update_mask\x82\xd3\xe4\x93\x02\x9c\x01\x32}/v1/{certificate_revocation_list.name=projects/*/locations/*/caPools/*/certificateAuthorities/*/certificateRevocationLists/*}:\x1b\x63\x65rtificate_revocation_list\x12\xba\x02\n\x19\x43reateCertificateTemplate\x12\x44.google.cloud.security.privateca.v1.CreateCertificateTemplateRequest\x1a\x1d.google.longrunning.Operation\"\xb7\x01\xca\x41(\n\x13\x43\x65rtificateTemplate\x12\x11OperationMetadata\xda\x41\x33parent,certificate_template,certificate_template_id\x82\xd3\xe4\x93\x02P\"8/v1/{parent=projects/*/locations/*}/certificateTemplates:\x14\x63\x65rtificate_template\x12\x9a\x02\n\x19\x44\x65leteCertificateTemplate\x12\x44.google.cloud.security.privateca.v1.DeleteCertificateTemplateRequest\x1a\x1d.google.longrunning.Operation\"\x97\x01\xca\x41M\n\x15google.protobuf.Empty\x12\x34google.cloud.security.privateca.v1.OperationMetadata\xda\x41\x04name\x82\xd3\xe4\x93\x02:*8/v1/{name=projects/*/locations/*/certificateTemplates/*}\x12\xdd\x01\n\x16GetCertificateTemplate\x12\x41.google.cloud.security.privateca.v1.GetCertificateTemplateRequest\x1a\x37.google.cloud.security.privateca.v1.CertificateTemplate\"G\xda\x41\x04name\x82\xd3\xe4\x93\x02:\x12\x38/v1/{name=projects/*/locations/*/certificateTemplates/*}\x12\xf0\x01\n\x18ListCertificateTemplates\x12\x43.google.cloud.security.privateca.v1.ListCertificateTemplatesRequest\x1a\x44.google.cloud.security.privateca.v1.ListCertificateTemplatesResponse\"I\xda\x41\x06parent\x82\xd3\xe4\x93\x02:\x12\x38/v1/{parent=projects/*/locations/*}/certificateTemplates\x12\xbc\x02\n\x19UpdateCertificateTemplate\x12\x44.google.cloud.security.privateca.v1.UpdateCertificateTemplateRequest\x1a\x1d.google.longrunning.Operation\"\xb9\x01\xca\x41(\n\x13\x43\x65rtificateTemplate\x12\x11OperationMetadata\xda\x41 certificate_template,update_mask\x82\xd3\xe4\x93\x02\x65\x32M/v1/{certificate_template.name=projects/*/locations/*/certificateTemplates/*}:\x14\x63\x65rtificate_template\x1aL\xca\x41\x18privateca.googleapis.com\xd2\x41.https://www.googleapis.com/auth/cloud-platformB\xf3\x01\n&com.google.cloud.security.privateca.v1B\x0ePrivateCaProtoP\x01ZDcloud.google.com/go/security/privateca/apiv1/privatecapb;privatecapb\xaa\x02\"Google.Cloud.Security.PrivateCA.V1\xca\x02\"Google\\Cloud\\Security\\PrivateCA\\V1\xea\x02&Google::Cloud::Security::PrivateCA::V1b\x06proto3" + +pool = ::Google::Protobuf::DescriptorPool.generated_pool +pool.add_serialized_file(descriptor_data) + +module Google + module Cloud + module Security + module PrivateCA + module V1 + CreateCertificateRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.security.privateca.v1.CreateCertificateRequest").msgclass + GetCertificateRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.security.privateca.v1.GetCertificateRequest").msgclass + ListCertificatesRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.security.privateca.v1.ListCertificatesRequest").msgclass + ListCertificatesResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.security.privateca.v1.ListCertificatesResponse").msgclass + RevokeCertificateRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.security.privateca.v1.RevokeCertificateRequest").msgclass + UpdateCertificateRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.security.privateca.v1.UpdateCertificateRequest").msgclass + ActivateCertificateAuthorityRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.security.privateca.v1.ActivateCertificateAuthorityRequest").msgclass + CreateCertificateAuthorityRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.security.privateca.v1.CreateCertificateAuthorityRequest").msgclass + DisableCertificateAuthorityRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.security.privateca.v1.DisableCertificateAuthorityRequest").msgclass + EnableCertificateAuthorityRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.security.privateca.v1.EnableCertificateAuthorityRequest").msgclass + FetchCertificateAuthorityCsrRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.security.privateca.v1.FetchCertificateAuthorityCsrRequest").msgclass + FetchCertificateAuthorityCsrResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.security.privateca.v1.FetchCertificateAuthorityCsrResponse").msgclass + GetCertificateAuthorityRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.security.privateca.v1.GetCertificateAuthorityRequest").msgclass + ListCertificateAuthoritiesRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.security.privateca.v1.ListCertificateAuthoritiesRequest").msgclass + ListCertificateAuthoritiesResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.security.privateca.v1.ListCertificateAuthoritiesResponse").msgclass + UndeleteCertificateAuthorityRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.security.privateca.v1.UndeleteCertificateAuthorityRequest").msgclass + DeleteCertificateAuthorityRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.security.privateca.v1.DeleteCertificateAuthorityRequest").msgclass + UpdateCertificateAuthorityRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.security.privateca.v1.UpdateCertificateAuthorityRequest").msgclass + CreateCaPoolRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.security.privateca.v1.CreateCaPoolRequest").msgclass + UpdateCaPoolRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.security.privateca.v1.UpdateCaPoolRequest").msgclass + DeleteCaPoolRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.security.privateca.v1.DeleteCaPoolRequest").msgclass + FetchCaCertsRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.security.privateca.v1.FetchCaCertsRequest").msgclass + FetchCaCertsResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.security.privateca.v1.FetchCaCertsResponse").msgclass + FetchCaCertsResponse::CertChain = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.security.privateca.v1.FetchCaCertsResponse.CertChain").msgclass + GetCaPoolRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.security.privateca.v1.GetCaPoolRequest").msgclass + ListCaPoolsRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.security.privateca.v1.ListCaPoolsRequest").msgclass + ListCaPoolsResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.security.privateca.v1.ListCaPoolsResponse").msgclass + GetCertificateRevocationListRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.security.privateca.v1.GetCertificateRevocationListRequest").msgclass + ListCertificateRevocationListsRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.security.privateca.v1.ListCertificateRevocationListsRequest").msgclass + ListCertificateRevocationListsResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.security.privateca.v1.ListCertificateRevocationListsResponse").msgclass + UpdateCertificateRevocationListRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.security.privateca.v1.UpdateCertificateRevocationListRequest").msgclass + CreateCertificateTemplateRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.security.privateca.v1.CreateCertificateTemplateRequest").msgclass + DeleteCertificateTemplateRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.security.privateca.v1.DeleteCertificateTemplateRequest").msgclass + GetCertificateTemplateRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.security.privateca.v1.GetCertificateTemplateRequest").msgclass + ListCertificateTemplatesRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.security.privateca.v1.ListCertificateTemplatesRequest").msgclass + ListCertificateTemplatesResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.security.privateca.v1.ListCertificateTemplatesResponse").msgclass + UpdateCertificateTemplateRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.security.privateca.v1.UpdateCertificateTemplateRequest").msgclass + OperationMetadata = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.security.privateca.v1.OperationMetadata").msgclass + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-security-private_ca-v1/lib/google/cloud/security/privateca/v1/service_services_pb.rb b/owl-bot-staging/google-cloud-security-private_ca-v1/lib/google/cloud/security/privateca/v1/service_services_pb.rb new file mode 100644 index 000000000000..b7d70569cc84 --- /dev/null +++ b/owl-bot-staging/google-cloud-security-private_ca-v1/lib/google/cloud/security/privateca/v1/service_services_pb.rb @@ -0,0 +1,150 @@ +# Generated by the protocol buffer compiler. DO NOT EDIT! +# Source: google/cloud/security/privateca/v1/service.proto for package 'Google.Cloud.Security.PrivateCA.V1' +# Original file comments: +# 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 +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# + +require 'grpc' +require 'google/cloud/security/privateca/v1/service_pb' + +module Google + module Cloud + module Security + module PrivateCA + module V1 + module CertificateAuthorityService + # [Certificate Authority + # Service][google.cloud.security.privateca.v1.CertificateAuthorityService] + # manages private certificate authorities and issued certificates. + class Service + + include ::GRPC::GenericService + + self.marshal_class_method = :encode + self.unmarshal_class_method = :decode + self.service_name = 'google.cloud.security.privateca.v1.CertificateAuthorityService' + + # Create a new [Certificate][google.cloud.security.privateca.v1.Certificate] + # in a given Project, Location from a particular + # [CaPool][google.cloud.security.privateca.v1.CaPool]. + rpc :CreateCertificate, ::Google::Cloud::Security::PrivateCA::V1::CreateCertificateRequest, ::Google::Cloud::Security::PrivateCA::V1::Certificate + # Returns a [Certificate][google.cloud.security.privateca.v1.Certificate]. + rpc :GetCertificate, ::Google::Cloud::Security::PrivateCA::V1::GetCertificateRequest, ::Google::Cloud::Security::PrivateCA::V1::Certificate + # Lists [Certificates][google.cloud.security.privateca.v1.Certificate]. + rpc :ListCertificates, ::Google::Cloud::Security::PrivateCA::V1::ListCertificatesRequest, ::Google::Cloud::Security::PrivateCA::V1::ListCertificatesResponse + # Revoke a [Certificate][google.cloud.security.privateca.v1.Certificate]. + rpc :RevokeCertificate, ::Google::Cloud::Security::PrivateCA::V1::RevokeCertificateRequest, ::Google::Cloud::Security::PrivateCA::V1::Certificate + # Update a [Certificate][google.cloud.security.privateca.v1.Certificate]. + # Currently, the only field you can update is the + # [labels][google.cloud.security.privateca.v1.Certificate.labels] field. + rpc :UpdateCertificate, ::Google::Cloud::Security::PrivateCA::V1::UpdateCertificateRequest, ::Google::Cloud::Security::PrivateCA::V1::Certificate + # Activate a + # [CertificateAuthority][google.cloud.security.privateca.v1.CertificateAuthority] + # that is in state + # [AWAITING_USER_ACTIVATION][google.cloud.security.privateca.v1.CertificateAuthority.State.AWAITING_USER_ACTIVATION] + # and is of type + # [SUBORDINATE][google.cloud.security.privateca.v1.CertificateAuthority.Type.SUBORDINATE]. + # After the parent Certificate Authority signs a certificate signing request + # from + # [FetchCertificateAuthorityCsr][google.cloud.security.privateca.v1.CertificateAuthorityService.FetchCertificateAuthorityCsr], + # this method can complete the activation process. + rpc :ActivateCertificateAuthority, ::Google::Cloud::Security::PrivateCA::V1::ActivateCertificateAuthorityRequest, ::Google::Longrunning::Operation + # Create a new + # [CertificateAuthority][google.cloud.security.privateca.v1.CertificateAuthority] + # in a given Project and Location. + rpc :CreateCertificateAuthority, ::Google::Cloud::Security::PrivateCA::V1::CreateCertificateAuthorityRequest, ::Google::Longrunning::Operation + # Disable a + # [CertificateAuthority][google.cloud.security.privateca.v1.CertificateAuthority]. + rpc :DisableCertificateAuthority, ::Google::Cloud::Security::PrivateCA::V1::DisableCertificateAuthorityRequest, ::Google::Longrunning::Operation + # Enable a + # [CertificateAuthority][google.cloud.security.privateca.v1.CertificateAuthority]. + rpc :EnableCertificateAuthority, ::Google::Cloud::Security::PrivateCA::V1::EnableCertificateAuthorityRequest, ::Google::Longrunning::Operation + # Fetch a certificate signing request (CSR) from a + # [CertificateAuthority][google.cloud.security.privateca.v1.CertificateAuthority] + # that is in state + # [AWAITING_USER_ACTIVATION][google.cloud.security.privateca.v1.CertificateAuthority.State.AWAITING_USER_ACTIVATION] + # and is of type + # [SUBORDINATE][google.cloud.security.privateca.v1.CertificateAuthority.Type.SUBORDINATE]. + # The CSR must then be signed by the desired parent Certificate Authority, + # which could be another + # [CertificateAuthority][google.cloud.security.privateca.v1.CertificateAuthority] + # resource, or could be an on-prem certificate authority. See also + # [ActivateCertificateAuthority][google.cloud.security.privateca.v1.CertificateAuthorityService.ActivateCertificateAuthority]. + rpc :FetchCertificateAuthorityCsr, ::Google::Cloud::Security::PrivateCA::V1::FetchCertificateAuthorityCsrRequest, ::Google::Cloud::Security::PrivateCA::V1::FetchCertificateAuthorityCsrResponse + # Returns a + # [CertificateAuthority][google.cloud.security.privateca.v1.CertificateAuthority]. + rpc :GetCertificateAuthority, ::Google::Cloud::Security::PrivateCA::V1::GetCertificateAuthorityRequest, ::Google::Cloud::Security::PrivateCA::V1::CertificateAuthority + # Lists + # [CertificateAuthorities][google.cloud.security.privateca.v1.CertificateAuthority]. + rpc :ListCertificateAuthorities, ::Google::Cloud::Security::PrivateCA::V1::ListCertificateAuthoritiesRequest, ::Google::Cloud::Security::PrivateCA::V1::ListCertificateAuthoritiesResponse + # Undelete a + # [CertificateAuthority][google.cloud.security.privateca.v1.CertificateAuthority] + # that has been deleted. + rpc :UndeleteCertificateAuthority, ::Google::Cloud::Security::PrivateCA::V1::UndeleteCertificateAuthorityRequest, ::Google::Longrunning::Operation + # Delete a + # [CertificateAuthority][google.cloud.security.privateca.v1.CertificateAuthority]. + rpc :DeleteCertificateAuthority, ::Google::Cloud::Security::PrivateCA::V1::DeleteCertificateAuthorityRequest, ::Google::Longrunning::Operation + # Update a + # [CertificateAuthority][google.cloud.security.privateca.v1.CertificateAuthority]. + rpc :UpdateCertificateAuthority, ::Google::Cloud::Security::PrivateCA::V1::UpdateCertificateAuthorityRequest, ::Google::Longrunning::Operation + # Create a [CaPool][google.cloud.security.privateca.v1.CaPool]. + rpc :CreateCaPool, ::Google::Cloud::Security::PrivateCA::V1::CreateCaPoolRequest, ::Google::Longrunning::Operation + # Update a [CaPool][google.cloud.security.privateca.v1.CaPool]. + rpc :UpdateCaPool, ::Google::Cloud::Security::PrivateCA::V1::UpdateCaPoolRequest, ::Google::Longrunning::Operation + # Returns a [CaPool][google.cloud.security.privateca.v1.CaPool]. + rpc :GetCaPool, ::Google::Cloud::Security::PrivateCA::V1::GetCaPoolRequest, ::Google::Cloud::Security::PrivateCA::V1::CaPool + # Lists [CaPools][google.cloud.security.privateca.v1.CaPool]. + rpc :ListCaPools, ::Google::Cloud::Security::PrivateCA::V1::ListCaPoolsRequest, ::Google::Cloud::Security::PrivateCA::V1::ListCaPoolsResponse + # Delete a [CaPool][google.cloud.security.privateca.v1.CaPool]. + rpc :DeleteCaPool, ::Google::Cloud::Security::PrivateCA::V1::DeleteCaPoolRequest, ::Google::Longrunning::Operation + # FetchCaCerts returns the current trust anchor for the + # [CaPool][google.cloud.security.privateca.v1.CaPool]. This will include CA + # certificate chains for all certificate authorities in the ENABLED, + # DISABLED, or STAGED states. + rpc :FetchCaCerts, ::Google::Cloud::Security::PrivateCA::V1::FetchCaCertsRequest, ::Google::Cloud::Security::PrivateCA::V1::FetchCaCertsResponse + # Returns a + # [CertificateRevocationList][google.cloud.security.privateca.v1.CertificateRevocationList]. + rpc :GetCertificateRevocationList, ::Google::Cloud::Security::PrivateCA::V1::GetCertificateRevocationListRequest, ::Google::Cloud::Security::PrivateCA::V1::CertificateRevocationList + # Lists + # [CertificateRevocationLists][google.cloud.security.privateca.v1.CertificateRevocationList]. + rpc :ListCertificateRevocationLists, ::Google::Cloud::Security::PrivateCA::V1::ListCertificateRevocationListsRequest, ::Google::Cloud::Security::PrivateCA::V1::ListCertificateRevocationListsResponse + # Update a + # [CertificateRevocationList][google.cloud.security.privateca.v1.CertificateRevocationList]. + rpc :UpdateCertificateRevocationList, ::Google::Cloud::Security::PrivateCA::V1::UpdateCertificateRevocationListRequest, ::Google::Longrunning::Operation + # Create a new + # [CertificateTemplate][google.cloud.security.privateca.v1.CertificateTemplate] + # in a given Project and Location. + rpc :CreateCertificateTemplate, ::Google::Cloud::Security::PrivateCA::V1::CreateCertificateTemplateRequest, ::Google::Longrunning::Operation + # DeleteCertificateTemplate deletes a + # [CertificateTemplate][google.cloud.security.privateca.v1.CertificateTemplate]. + rpc :DeleteCertificateTemplate, ::Google::Cloud::Security::PrivateCA::V1::DeleteCertificateTemplateRequest, ::Google::Longrunning::Operation + # Returns a + # [CertificateTemplate][google.cloud.security.privateca.v1.CertificateTemplate]. + rpc :GetCertificateTemplate, ::Google::Cloud::Security::PrivateCA::V1::GetCertificateTemplateRequest, ::Google::Cloud::Security::PrivateCA::V1::CertificateTemplate + # Lists + # [CertificateTemplates][google.cloud.security.privateca.v1.CertificateTemplate]. + rpc :ListCertificateTemplates, ::Google::Cloud::Security::PrivateCA::V1::ListCertificateTemplatesRequest, ::Google::Cloud::Security::PrivateCA::V1::ListCertificateTemplatesResponse + # Update a + # [CertificateTemplate][google.cloud.security.privateca.v1.CertificateTemplate]. + rpc :UpdateCertificateTemplate, ::Google::Cloud::Security::PrivateCA::V1::UpdateCertificateTemplateRequest, ::Google::Longrunning::Operation + end + + Stub = Service.rpc_stub_class + end + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-security-private_ca-v1/proto_docs/README.md b/owl-bot-staging/google-cloud-security-private_ca-v1/proto_docs/README.md new file mode 100644 index 000000000000..c573f864e64a --- /dev/null +++ b/owl-bot-staging/google-cloud-security-private_ca-v1/proto_docs/README.md @@ -0,0 +1,4 @@ +# Certificate Authority Service V1 Protocol Buffer Documentation + +These files are for the YARD documentation of the generated protobuf files. +They are not intended to be required or loaded at runtime. diff --git a/owl-bot-staging/google-cloud-security-private_ca-v1/proto_docs/google/api/client.rb b/owl-bot-staging/google-cloud-security-private_ca-v1/proto_docs/google/api/client.rb new file mode 100644 index 000000000000..5089551e9ea4 --- /dev/null +++ b/owl-bot-staging/google-cloud-security-private_ca-v1/proto_docs/google/api/client.rb @@ -0,0 +1,589 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + + +module Google + module Api + # Required information for every language. + # @!attribute [rw] reference_docs_uri + # @deprecated This field is deprecated and may be removed in the next major version update. + # @return [::String] + # Link to automatically generated reference documentation. Example: + # https://cloud.google.com/nodejs/docs/reference/asset/latest + # @!attribute [rw] destinations + # @return [::Array<::Google::Api::ClientLibraryDestination>] + # The destination where API teams want this client library to be published. + # @!attribute [rw] selective_gapic_generation + # @return [::Google::Api::SelectiveGapicGeneration] + # Configuration for which RPCs should be generated in the GAPIC client. + class CommonLanguageSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Details about how and where to publish client libraries. + # @!attribute [rw] version + # @return [::String] + # Version of the API to apply these settings to. This is the full protobuf + # package for the API, ending in the version element. + # Examples: "google.cloud.speech.v1" and "google.spanner.admin.database.v1". + # @!attribute [rw] launch_stage + # @return [::Google::Api::LaunchStage] + # Launch stage of this version of the API. + # @!attribute [rw] rest_numeric_enums + # @return [::Boolean] + # When using transport=rest, the client request will encode enums as + # numbers rather than strings. + # @!attribute [rw] java_settings + # @return [::Google::Api::JavaSettings] + # Settings for legacy Java features, supported in the Service YAML. + # @!attribute [rw] cpp_settings + # @return [::Google::Api::CppSettings] + # Settings for C++ client libraries. + # @!attribute [rw] php_settings + # @return [::Google::Api::PhpSettings] + # Settings for PHP client libraries. + # @!attribute [rw] python_settings + # @return [::Google::Api::PythonSettings] + # Settings for Python client libraries. + # @!attribute [rw] node_settings + # @return [::Google::Api::NodeSettings] + # Settings for Node client libraries. + # @!attribute [rw] dotnet_settings + # @return [::Google::Api::DotnetSettings] + # Settings for .NET client libraries. + # @!attribute [rw] ruby_settings + # @return [::Google::Api::RubySettings] + # Settings for Ruby client libraries. + # @!attribute [rw] go_settings + # @return [::Google::Api::GoSettings] + # Settings for Go client libraries. + class ClientLibrarySettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # This message configures the settings for publishing [Google Cloud Client + # libraries](https://cloud.google.com/apis/docs/cloud-client-libraries) + # generated from the service config. + # @!attribute [rw] method_settings + # @return [::Array<::Google::Api::MethodSettings>] + # A list of API method settings, e.g. the behavior for methods that use the + # long-running operation pattern. + # @!attribute [rw] new_issue_uri + # @return [::String] + # Link to a *public* URI where users can report issues. Example: + # https://issuetracker.google.com/issues/new?component=190865&template=1161103 + # @!attribute [rw] documentation_uri + # @return [::String] + # Link to product home page. Example: + # https://cloud.google.com/asset-inventory/docs/overview + # @!attribute [rw] api_short_name + # @return [::String] + # Used as a tracking tag when collecting data about the APIs developer + # relations artifacts like docs, packages delivered to package managers, + # etc. Example: "speech". + # @!attribute [rw] github_label + # @return [::String] + # GitHub label to apply to issues and pull requests opened for this API. + # @!attribute [rw] codeowner_github_teams + # @return [::Array<::String>] + # GitHub teams to be added to CODEOWNERS in the directory in GitHub + # containing source code for the client libraries for this API. + # @!attribute [rw] doc_tag_prefix + # @return [::String] + # A prefix used in sample code when demarking regions to be included in + # documentation. + # @!attribute [rw] organization + # @return [::Google::Api::ClientLibraryOrganization] + # For whom the client library is being published. + # @!attribute [rw] library_settings + # @return [::Array<::Google::Api::ClientLibrarySettings>] + # Client library settings. If the same version string appears multiple + # times in this list, then the last one wins. Settings from earlier + # settings with the same version string are discarded. + # @!attribute [rw] proto_reference_documentation_uri + # @return [::String] + # Optional link to proto reference documentation. Example: + # https://cloud.google.com/pubsub/lite/docs/reference/rpc + # @!attribute [rw] rest_reference_documentation_uri + # @return [::String] + # Optional link to REST reference documentation. Example: + # https://cloud.google.com/pubsub/lite/docs/reference/rest + class Publishing + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Settings for Java client libraries. + # @!attribute [rw] library_package + # @return [::String] + # The package name to use in Java. Clobbers the java_package option + # set in the protobuf. This should be used **only** by APIs + # who have already set the language_settings.java.package_name" field + # in gapic.yaml. API teams should use the protobuf java_package option + # where possible. + # + # Example of a YAML configuration:: + # + # publishing: + # 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. + # @!attribute [rw] methods + # @return [::Array<::String>] + # An allowlist of the fully qualified names of RPCs that should be included + # on public client surfaces. + # @!attribute [rw] generate_omitted_as_internal + # @return [::Boolean] + # Setting this to true indicates to the client generators that methods + # that would be excluded from the generation should instead be generated + # in a way that indicates these methods should not be consumed by + # end users. How this is expressed is up to individual language + # implementations to decide. Some examples may be: added annotations, + # obfuscated identifiers, or other language idiomatic patterns. + class SelectiveGapicGeneration + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # `BatchingConfigProto` defines the batching configuration for an API method. + # @!attribute [rw] thresholds + # @return [::Google::Api::BatchingSettingsProto] + # The thresholds which trigger a batched request to be sent. + # @!attribute [rw] batch_descriptor + # @return [::Google::Api::BatchingDescriptorProto] + # The request and response fields used in batching. + class BatchingConfigProto + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # `BatchingSettingsProto` specifies a set of batching thresholds, each of + # which acts as a trigger to send a batch of messages as a request. At least + # one threshold must be positive nonzero. + # @!attribute [rw] element_count_threshold + # @return [::Integer] + # The number of elements of a field collected into a batch which, if + # exceeded, causes the batch to be sent. + # @!attribute [rw] request_byte_threshold + # @return [::Integer] + # The aggregated size of the batched field which, if exceeded, causes the + # batch to be sent. This size is computed by aggregating the sizes of the + # request field to be batched, not of the entire request message. + # @!attribute [rw] delay_threshold + # @return [::Google::Protobuf::Duration] + # The duration after which a batch should be sent, starting from the addition + # of the first message to that batch. + # @!attribute [rw] element_count_limit + # @return [::Integer] + # The maximum number of elements collected in a batch that could be accepted + # by server. + # @!attribute [rw] request_byte_limit + # @return [::Integer] + # The maximum size of the request that could be accepted by server. + # @!attribute [rw] flow_control_element_limit + # @return [::Integer] + # The maximum number of elements allowed by flow control. + # @!attribute [rw] flow_control_byte_limit + # @return [::Integer] + # The maximum size of data allowed by flow control. + # @!attribute [rw] flow_control_limit_exceeded_behavior + # @return [::Google::Api::FlowControlLimitExceededBehaviorProto] + # The behavior to take when the flow control limit is exceeded. + class BatchingSettingsProto + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # `BatchingDescriptorProto` specifies the fields of the request message to be + # used for batching, and, optionally, the fields of the response message to be + # used for demultiplexing. + # @!attribute [rw] batched_field + # @return [::String] + # The repeated field in the request message to be aggregated by batching. + # @!attribute [rw] discriminator_fields + # @return [::Array<::String>] + # A list of the fields in the request message. Two requests will be batched + # together only if the values of every field specified in + # `request_discriminator_fields` is equal between the two requests. + # @!attribute [rw] subresponse_field + # @return [::String] + # Optional. When present, indicates the field in the response message to be + # used to demultiplex the response into multiple response messages, in + # correspondence with the multiple request messages originally batched + # together. + class BatchingDescriptorProto + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # The organization for which the client libraries are being published. + # Affects the url where generated docs are published, etc. + module ClientLibraryOrganization + # Not useful. + CLIENT_LIBRARY_ORGANIZATION_UNSPECIFIED = 0 + + # Google Cloud Platform Org. + CLOUD = 1 + + # Ads (Advertising) Org. + ADS = 2 + + # Photos Org. + PHOTOS = 3 + + # Street View Org. + STREET_VIEW = 4 + + # Shopping Org. + SHOPPING = 5 + + # Geo Org. + GEO = 6 + + # Generative AI - https://developers.generativeai.google + GENERATIVE_AI = 7 + end + + # To where should client libraries be published? + module ClientLibraryDestination + # Client libraries will neither be generated nor published to package + # managers. + CLIENT_LIBRARY_DESTINATION_UNSPECIFIED = 0 + + # Generate the client library in a repo under github.com/googleapis, + # but don't publish it to package managers. + GITHUB = 10 + + # Publish the library to package managers like nuget.org and npmjs.com. + PACKAGE_MANAGER = 20 + end + + # The behavior to take when the flow control limit is exceeded. + module FlowControlLimitExceededBehaviorProto + # Default behavior, system-defined. + UNSET_BEHAVIOR = 0 + + # Stop operation, raise error. + THROW_EXCEPTION = 1 + + # Pause operation until limit clears. + BLOCK = 2 + + # Continue operation, disregard limit. + IGNORE = 3 + end + end +end diff --git a/owl-bot-staging/google-cloud-security-private_ca-v1/proto_docs/google/api/field_behavior.rb b/owl-bot-staging/google-cloud-security-private_ca-v1/proto_docs/google/api/field_behavior.rb new file mode 100644 index 000000000000..582be187d115 --- /dev/null +++ b/owl-bot-staging/google-cloud-security-private_ca-v1/proto_docs/google/api/field_behavior.rb @@ -0,0 +1,85 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + + +module Google + module Api + # An indicator of the behavior of a given field (for example, that a field + # is required in requests, or given as output but ignored as input). + # This **does not** change the behavior in protocol buffers itself; it only + # denotes the behavior and may affect how API tooling handles the field. + # + # Note: This enum **may** receive new values in the future. + module FieldBehavior + # Conventional default for enums. Do not use this. + FIELD_BEHAVIOR_UNSPECIFIED = 0 + + # Specifically denotes a field as optional. + # While all fields in protocol buffers are optional, this may be specified + # for emphasis if appropriate. + OPTIONAL = 1 + + # Denotes a field as required. + # This indicates that the field **must** be provided as part of the request, + # and failure to do so will cause an error (usually `INVALID_ARGUMENT`). + REQUIRED = 2 + + # Denotes a field as output only. + # This indicates that the field is provided in responses, but including the + # field in a request does nothing (the server *must* ignore it and + # *must not* throw an error as a result of the field's presence). + OUTPUT_ONLY = 3 + + # Denotes a field as input only. + # This indicates that the field is provided in requests, and the + # corresponding field is not included in output. + INPUT_ONLY = 4 + + # Denotes a field as immutable. + # This indicates that the field may be set once in a request to create a + # resource, but may not be changed thereafter. + IMMUTABLE = 5 + + # Denotes that a (repeated) field is an unordered list. + # This indicates that the service may provide the elements of the list + # in any arbitrary order, rather than the order the user originally + # provided. Additionally, the list's order may or may not be stable. + UNORDERED_LIST = 6 + + # Denotes that this field returns a non-empty default value if not set. + # This indicates that if the user provides the empty value in a request, + # a non-empty value will be returned. The user will not be aware of what + # non-empty value to expect. + NON_EMPTY_DEFAULT = 7 + + # Denotes that the field in a resource (a message annotated with + # google.api.resource) is used in the resource name to uniquely identify the + # resource. For AIP-compliant APIs, this should only be applied to the + # `name` field on the resource. + # + # This behavior should not be applied to references to other resources within + # the message. + # + # The identifier field of resources often have different field behavior + # depending on the request it is embedded in (e.g. for Create methods name + # is optional and unused, while for Update methods it is required). Instead + # of method-specific annotations, only `IDENTIFIER` is required. + IDENTIFIER = 8 + end + end +end diff --git a/owl-bot-staging/google-cloud-security-private_ca-v1/proto_docs/google/api/field_info.rb b/owl-bot-staging/google-cloud-security-private_ca-v1/proto_docs/google/api/field_info.rb new file mode 100644 index 000000000000..0f5acf0a5538 --- /dev/null +++ b/owl-bot-staging/google-cloud-security-private_ca-v1/proto_docs/google/api/field_info.rb @@ -0,0 +1,88 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + + +module Google + module Api + # Rich semantic information of an API field beyond basic typing. + # @!attribute [rw] format + # @return [::Google::Api::FieldInfo::Format] + # The standard format of a field value. This does not explicitly configure + # any API consumer, just documents the API's format for the field it is + # applied to. + # @!attribute [rw] referenced_types + # @return [::Array<::Google::Api::TypeReference>] + # The type(s) that the annotated, generic field may represent. + # + # Currently, this must only be used on fields of type `google.protobuf.Any`. + # Supporting other generic types may be considered in the future. + class FieldInfo + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # The standard format of a field value. The supported formats are all backed + # by either an RFC defined by the IETF or a Google-defined AIP. + module Format + # Default, unspecified value. + FORMAT_UNSPECIFIED = 0 + + # Universally Unique Identifier, version 4, value as defined by + # https://datatracker.ietf.org/doc/html/rfc4122. The value may be + # normalized to entirely lowercase letters. For example, the value + # `F47AC10B-58CC-0372-8567-0E02B2C3D479` would be normalized to + # `f47ac10b-58cc-0372-8567-0e02b2c3d479`. + UUID4 = 1 + + # Internet Protocol v4 value as defined by [RFC + # 791](https://datatracker.ietf.org/doc/html/rfc791). The value may be + # condensed, with leading zeros in each octet stripped. For example, + # `001.022.233.040` would be condensed to `1.22.233.40`. + IPV4 = 2 + + # Internet Protocol v6 value as defined by [RFC + # 2460](https://datatracker.ietf.org/doc/html/rfc2460). The value may be + # normalized to entirely lowercase letters with zeros compressed, following + # [RFC 5952](https://datatracker.ietf.org/doc/html/rfc5952). For example, + # the value `2001:0DB8:0::0` would be normalized to `2001:db8::`. + IPV6 = 3 + + # An IP address in either v4 or v6 format as described by the individual + # values defined herein. See the comments on the IPV4 and IPV6 types for + # allowed normalizations of each. + IPV4_OR_IPV6 = 4 + end + end + + # A reference to a message type, for use in {::Google::Api::FieldInfo FieldInfo}. + # @!attribute [rw] type_name + # @return [::String] + # The name of the type that the annotated, generic field may represent. + # If the type is in the same protobuf package, the value can be the simple + # message name e.g., `"MyMessage"`. Otherwise, the value must be the + # fully-qualified message name e.g., `"google.library.v1.Book"`. + # + # If the type(s) are unknown to the service (e.g. the field accepts generic + # user input), use the wildcard `"*"` to denote this behavior. + # + # See [AIP-202](https://google.aip.dev/202#type-references) for more details. + class TypeReference + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end +end diff --git a/owl-bot-staging/google-cloud-security-private_ca-v1/proto_docs/google/api/launch_stage.rb b/owl-bot-staging/google-cloud-security-private_ca-v1/proto_docs/google/api/launch_stage.rb new file mode 100644 index 000000000000..9392a413fb1b --- /dev/null +++ b/owl-bot-staging/google-cloud-security-private_ca-v1/proto_docs/google/api/launch_stage.rb @@ -0,0 +1,71 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + + +module Google + module Api + # The launch stage as defined by [Google Cloud Platform + # Launch Stages](https://cloud.google.com/terms/launch-stages). + module LaunchStage + # Do not use this default value. + LAUNCH_STAGE_UNSPECIFIED = 0 + + # The feature is not yet implemented. Users can not use it. + UNIMPLEMENTED = 6 + + # Prelaunch features are hidden from users and are only visible internally. + PRELAUNCH = 7 + + # Early Access features are limited to a closed group of testers. To use + # these features, you must sign up in advance and sign a Trusted Tester + # agreement (which includes confidentiality provisions). These features may + # be unstable, changed in backward-incompatible ways, and are not + # guaranteed to be released. + EARLY_ACCESS = 1 + + # Alpha is a limited availability test for releases before they are cleared + # for widespread use. By Alpha, all significant design issues are resolved + # and we are in the process of verifying functionality. Alpha customers + # need to apply for access, agree to applicable terms, and have their + # projects allowlisted. Alpha releases don't have to be feature complete, + # no SLAs are provided, and there are no technical support obligations, but + # they will be far enough along that customers can actually use them in + # test environments or for limited-use tests -- just like they would in + # normal production cases. + ALPHA = 2 + + # Beta is the point at which we are ready to open a release for any + # customer to use. There are no SLA or technical support obligations in a + # Beta release. Products will be complete from a feature perspective, but + # may have some open outstanding issues. Beta releases are suitable for + # limited production use cases. + BETA = 3 + + # GA features are open to all developers and are considered stable and + # fully qualified for production use. + GA = 4 + + # Deprecated features are scheduled to be shut down and removed. For more + # information, see the "Deprecation Policy" section of our [Terms of + # Service](https://cloud.google.com/terms/) + # and the [Google Cloud Platform Subject to the Deprecation + # Policy](https://cloud.google.com/terms/deprecation) documentation. + DEPRECATED = 5 + end + end +end diff --git a/owl-bot-staging/google-cloud-security-private_ca-v1/proto_docs/google/api/resource.rb b/owl-bot-staging/google-cloud-security-private_ca-v1/proto_docs/google/api/resource.rb new file mode 100644 index 000000000000..25dec4847ac1 --- /dev/null +++ b/owl-bot-staging/google-cloud-security-private_ca-v1/proto_docs/google/api/resource.rb @@ -0,0 +1,227 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + + +module Google + module Api + # A simple descriptor of a resource type. + # + # ResourceDescriptor annotates a resource message (either by means of a + # protobuf annotation or use in the service config), and associates the + # resource's schema, the resource type, and the pattern of the resource name. + # + # Example: + # + # message Topic { + # // Indicates this message defines a resource schema. + # // Declares the resource type in the format of {service}/{kind}. + # // For Kubernetes resources, the format is {api group}/{kind}. + # option (google.api.resource) = { + # type: "pubsub.googleapis.com/Topic" + # pattern: "projects/{project}/topics/{topic}" + # }; + # } + # + # The ResourceDescriptor Yaml config will look like: + # + # resources: + # - type: "pubsub.googleapis.com/Topic" + # pattern: "projects/{project}/topics/{topic}" + # + # Sometimes, resources have multiple patterns, typically because they can + # live under multiple parents. + # + # Example: + # + # message LogEntry { + # option (google.api.resource) = { + # type: "logging.googleapis.com/LogEntry" + # pattern: "projects/{project}/logs/{log}" + # pattern: "folders/{folder}/logs/{log}" + # pattern: "organizations/{organization}/logs/{log}" + # pattern: "billingAccounts/{billing_account}/logs/{log}" + # }; + # } + # + # The ResourceDescriptor Yaml config will look like: + # + # resources: + # - type: 'logging.googleapis.com/LogEntry' + # pattern: "projects/{project}/logs/{log}" + # pattern: "folders/{folder}/logs/{log}" + # pattern: "organizations/{organization}/logs/{log}" + # pattern: "billingAccounts/{billing_account}/logs/{log}" + # @!attribute [rw] type + # @return [::String] + # The resource type. It must be in the format of + # \\{service_name}/\\{resource_type_kind}. The `resource_type_kind` must be + # singular and must not include version numbers. + # + # Example: `storage.googleapis.com/Bucket` + # + # The value of the resource_type_kind must follow the regular expression + # /[A-Za-z][a-zA-Z0-9]+/. It should start with an upper case character and + # should use PascalCase (UpperCamelCase). The maximum number of + # characters allowed for the `resource_type_kind` is 100. + # @!attribute [rw] pattern + # @return [::Array<::String>] + # Optional. The relative resource name pattern associated with this resource + # type. The DNS prefix of the full resource name shouldn't be specified here. + # + # The path pattern must follow the syntax, which aligns with HTTP binding + # syntax: + # + # Template = Segment { "/" Segment } ; + # Segment = LITERAL | Variable ; + # Variable = "{" LITERAL "}" ; + # + # Examples: + # + # - "projects/\\{project}/topics/\\{topic}" + # - "projects/\\{project}/knowledgeBases/\\{knowledge_base}" + # + # The components in braces correspond to the IDs for each resource in the + # hierarchy. It is expected that, if multiple patterns are provided, + # the same component name (e.g. "project") refers to IDs of the same + # type of resource. + # @!attribute [rw] name_field + # @return [::String] + # Optional. The field on the resource that designates the resource name + # field. If omitted, this is assumed to be "name". + # @!attribute [rw] history + # @return [::Google::Api::ResourceDescriptor::History] + # Optional. The historical or future-looking state of the resource pattern. + # + # Example: + # + # // The InspectTemplate message originally only supported resource + # // names with organization, and project was added later. + # message InspectTemplate { + # option (google.api.resource) = { + # type: "dlp.googleapis.com/InspectTemplate" + # pattern: + # "organizations/{organization}/inspectTemplates/{inspect_template}" + # pattern: "projects/{project}/inspectTemplates/{inspect_template}" + # history: ORIGINALLY_SINGLE_PATTERN + # }; + # } + # @!attribute [rw] plural + # @return [::String] + # The plural name used in the resource name and permission names, such as + # 'projects' for the resource name of 'projects/\\{project}' and the permission + # name of 'cloudresourcemanager.googleapis.com/projects.get'. One exception + # to this is for Nested Collections that have stuttering names, as defined + # in [AIP-122](https://google.aip.dev/122#nested-collections), where the + # collection ID in the resource name pattern does not necessarily directly + # match the `plural` value. + # + # It is the same concept of the `plural` field in k8s CRD spec + # https://kubernetes.io/docs/tasks/access-kubernetes-api/custom-resources/custom-resource-definitions/ + # + # Note: The plural form is required even for singleton resources. See + # https://aip.dev/156 + # @!attribute [rw] singular + # @return [::String] + # The same concept of the `singular` field in k8s CRD spec + # https://kubernetes.io/docs/tasks/access-kubernetes-api/custom-resources/custom-resource-definitions/ + # Such as "project" for the `resourcemanager.googleapis.com/Project` type. + # @!attribute [rw] style + # @return [::Array<::Google::Api::ResourceDescriptor::Style>] + # Style flag(s) for this resource. + # These indicate that a resource is expected to conform to a given + # style. See the specific style flags for additional information. + class ResourceDescriptor + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # A description of the historical or future-looking state of the + # resource pattern. + module History + # The "unset" value. + HISTORY_UNSPECIFIED = 0 + + # The resource originally had one pattern and launched as such, and + # additional patterns were added later. + ORIGINALLY_SINGLE_PATTERN = 1 + + # The resource has one pattern, but the API owner expects to add more + # later. (This is the inverse of ORIGINALLY_SINGLE_PATTERN, and prevents + # that from being necessary once there are multiple patterns.) + FUTURE_MULTI_PATTERN = 2 + end + + # A flag representing a specific style that a resource claims to conform to. + module Style + # The unspecified value. Do not use. + STYLE_UNSPECIFIED = 0 + + # This resource is intended to be "declarative-friendly". + # + # Declarative-friendly resources must be more strictly consistent, and + # setting this to true communicates to tools that this resource should + # adhere to declarative-friendly expectations. + # + # Note: This is used by the API linter (linter.aip.dev) to enable + # additional checks. + DECLARATIVE_FRIENDLY = 1 + end + end + + # Defines a proto annotation that describes a string field that refers to + # an API resource. + # @!attribute [rw] type + # @return [::String] + # The resource type that the annotated field references. + # + # Example: + # + # message Subscription { + # string topic = 2 [(google.api.resource_reference) = { + # type: "pubsub.googleapis.com/Topic" + # }]; + # } + # + # Occasionally, a field may reference an arbitrary resource. In this case, + # APIs use the special value * in their resource reference. + # + # Example: + # + # message GetIamPolicyRequest { + # string resource = 2 [(google.api.resource_reference) = { + # type: "*" + # }]; + # } + # @!attribute [rw] child_type + # @return [::String] + # The resource type of a child collection that the annotated field + # references. This is useful for annotating the `parent` field that + # doesn't have a fixed resource type. + # + # Example: + # + # message ListLogEntriesRequest { + # string parent = 1 [(google.api.resource_reference) = { + # child_type: "logging.googleapis.com/LogEntry" + # }; + # } + class ResourceReference + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end +end diff --git a/owl-bot-staging/google-cloud-security-private_ca-v1/proto_docs/google/cloud/security/privateca/v1/resources.rb b/owl-bot-staging/google-cloud-security-private_ca-v1/proto_docs/google/cloud/security/privateca/v1/resources.rb new file mode 100644 index 000000000000..11ccb21b09f2 --- /dev/null +++ b/owl-bot-staging/google-cloud-security-private_ca-v1/proto_docs/google/cloud/security/privateca/v1/resources.rb @@ -0,0 +1,1676 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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 Security + module PrivateCA + module V1 + # A + # {::Google::Cloud::Security::PrivateCA::V1::CertificateAuthority CertificateAuthority} + # represents an individual Certificate Authority. A + # {::Google::Cloud::Security::PrivateCA::V1::CertificateAuthority CertificateAuthority} + # can be used to create + # {::Google::Cloud::Security::PrivateCA::V1::Certificate Certificates}. + # @!attribute [rw] name + # @return [::String] + # Identifier. The resource name for this + # {::Google::Cloud::Security::PrivateCA::V1::CertificateAuthority CertificateAuthority} + # in the format `projects/*/locations/*/caPools/*/certificateAuthorities/*`. + # @!attribute [rw] type + # @return [::Google::Cloud::Security::PrivateCA::V1::CertificateAuthority::Type] + # Required. Immutable. The + # {::Google::Cloud::Security::PrivateCA::V1::CertificateAuthority::Type Type} of + # this + # {::Google::Cloud::Security::PrivateCA::V1::CertificateAuthority CertificateAuthority}. + # @!attribute [rw] config + # @return [::Google::Cloud::Security::PrivateCA::V1::CertificateConfig] + # Required. Immutable. The config used to create a self-signed X.509 + # certificate or CSR. + # @!attribute [rw] lifetime + # @return [::Google::Protobuf::Duration] + # Required. Immutable. The desired lifetime of the CA certificate. Used to + # create the "not_before_time" and "not_after_time" fields inside an X.509 + # certificate. + # @!attribute [rw] key_spec + # @return [::Google::Cloud::Security::PrivateCA::V1::CertificateAuthority::KeyVersionSpec] + # Required. Immutable. Used when issuing certificates for this + # {::Google::Cloud::Security::PrivateCA::V1::CertificateAuthority CertificateAuthority}. + # If this + # {::Google::Cloud::Security::PrivateCA::V1::CertificateAuthority CertificateAuthority} + # is a self-signed CertificateAuthority, this key is also used to sign the + # self-signed CA certificate. Otherwise, it is used to sign a CSR. + # @!attribute [rw] subordinate_config + # @return [::Google::Cloud::Security::PrivateCA::V1::SubordinateConfig] + # Optional. If this is a subordinate + # {::Google::Cloud::Security::PrivateCA::V1::CertificateAuthority CertificateAuthority}, + # this field will be set with the subordinate configuration, which describes + # its issuers. This may be updated, but this + # {::Google::Cloud::Security::PrivateCA::V1::CertificateAuthority CertificateAuthority} + # must continue to validate. + # @!attribute [r] tier + # @return [::Google::Cloud::Security::PrivateCA::V1::CaPool::Tier] + # Output only. The + # {::Google::Cloud::Security::PrivateCA::V1::CaPool::Tier CaPool.Tier} of the + # {::Google::Cloud::Security::PrivateCA::V1::CaPool CaPool} that includes this + # {::Google::Cloud::Security::PrivateCA::V1::CertificateAuthority CertificateAuthority}. + # @!attribute [r] state + # @return [::Google::Cloud::Security::PrivateCA::V1::CertificateAuthority::State] + # Output only. The + # {::Google::Cloud::Security::PrivateCA::V1::CertificateAuthority::State State} for + # this + # {::Google::Cloud::Security::PrivateCA::V1::CertificateAuthority CertificateAuthority}. + # @!attribute [r] pem_ca_certificates + # @return [::Array<::String>] + # Output only. This + # {::Google::Cloud::Security::PrivateCA::V1::CertificateAuthority CertificateAuthority}'s + # certificate chain, including the current + # {::Google::Cloud::Security::PrivateCA::V1::CertificateAuthority CertificateAuthority}'s + # certificate. Ordered such that the root issuer is the final element + # (consistent with RFC 5246). For a self-signed CA, this will only list the + # current + # {::Google::Cloud::Security::PrivateCA::V1::CertificateAuthority CertificateAuthority}'s + # certificate. + # @!attribute [r] ca_certificate_descriptions + # @return [::Array<::Google::Cloud::Security::PrivateCA::V1::CertificateDescription>] + # Output only. A structured description of this + # {::Google::Cloud::Security::PrivateCA::V1::CertificateAuthority CertificateAuthority}'s + # CA certificate and its issuers. Ordered as self-to-root. + # @!attribute [rw] gcs_bucket + # @return [::String] + # Immutable. The name of a Cloud Storage bucket where this + # {::Google::Cloud::Security::PrivateCA::V1::CertificateAuthority CertificateAuthority} + # will publish content, such as the CA certificate and CRLs. This must be a + # bucket name, without any prefixes (such as `gs://`) or suffixes (such as + # `.googleapis.com`). For example, to use a bucket named `my-bucket`, you + # would simply specify `my-bucket`. If not specified, a managed bucket will + # be created. + # @!attribute [r] access_urls + # @return [::Google::Cloud::Security::PrivateCA::V1::CertificateAuthority::AccessUrls] + # Output only. URLs for accessing content published by this CA, such as the + # CA certificate and CRLs. + # @!attribute [r] create_time + # @return [::Google::Protobuf::Timestamp] + # Output only. The time at which this + # {::Google::Cloud::Security::PrivateCA::V1::CertificateAuthority CertificateAuthority} + # was created. + # @!attribute [r] update_time + # @return [::Google::Protobuf::Timestamp] + # Output only. The time at which this + # {::Google::Cloud::Security::PrivateCA::V1::CertificateAuthority CertificateAuthority} + # was last updated. + # @!attribute [r] delete_time + # @return [::Google::Protobuf::Timestamp] + # Output only. The time at which this + # {::Google::Cloud::Security::PrivateCA::V1::CertificateAuthority CertificateAuthority} + # was soft deleted, if it is in the + # {::Google::Cloud::Security::PrivateCA::V1::CertificateAuthority::State::DELETED DELETED} + # state. + # @!attribute [r] expire_time + # @return [::Google::Protobuf::Timestamp] + # Output only. The time at which this + # {::Google::Cloud::Security::PrivateCA::V1::CertificateAuthority CertificateAuthority} + # will be permanently purged, if it is in the + # {::Google::Cloud::Security::PrivateCA::V1::CertificateAuthority::State::DELETED DELETED} + # state. + # @!attribute [rw] labels + # @return [::Google::Protobuf::Map{::String => ::String}] + # Optional. Labels with user-defined metadata. + # @!attribute [rw] user_defined_access_urls + # @return [::Google::Cloud::Security::PrivateCA::V1::CertificateAuthority::UserDefinedAccessUrls] + # Optional. User-defined URLs for CA certificate and CRLs. The service does + # not publish content to these URLs. It is up to the user to mirror content + # to these URLs. + # @!attribute [r] satisfies_pzs + # @return [::Boolean] + # Output only. Reserved for future use. + # @!attribute [r] satisfies_pzi + # @return [::Boolean] + # Output only. Reserved for future use. + class CertificateAuthority + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # URLs where a + # {::Google::Cloud::Security::PrivateCA::V1::CertificateAuthority CertificateAuthority} + # will publish content. + # @!attribute [rw] ca_certificate_access_url + # @return [::String] + # The URL where this + # {::Google::Cloud::Security::PrivateCA::V1::CertificateAuthority CertificateAuthority}'s + # CA certificate is published. This will only be set for CAs that have been + # activated. + # @!attribute [rw] crl_access_urls + # @return [::Array<::String>] + # The URLs where this + # {::Google::Cloud::Security::PrivateCA::V1::CertificateAuthority CertificateAuthority}'s + # CRLs are published. This will only be set for CAs that have been + # activated. + class AccessUrls + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # A Cloud KMS key configuration that a + # {::Google::Cloud::Security::PrivateCA::V1::CertificateAuthority CertificateAuthority} + # will use. + # @!attribute [rw] cloud_kms_key_version + # @return [::String] + # The resource name for an existing Cloud KMS CryptoKeyVersion in the + # format + # `projects/*/locations/*/keyRings/*/cryptoKeys/*/cryptoKeyVersions/*`. + # This option enables full flexibility in the key's capabilities and + # properties. + # + # Note: The following fields are mutually exclusive: `cloud_kms_key_version`, `algorithm`. If a field in that set is populated, all other fields in the set will automatically be cleared. + # @!attribute [rw] algorithm + # @return [::Google::Cloud::Security::PrivateCA::V1::CertificateAuthority::SignHashAlgorithm] + # The algorithm to use for creating a managed Cloud KMS key for a for a + # simplified experience. All managed keys will be have their + # [ProtectionLevel][google.cloud.kms.v1.ProtectionLevel] as `HSM`. + # + # Note: The following fields are mutually exclusive: `algorithm`, `cloud_kms_key_version`. If a field in that set is populated, all other fields in the set will automatically be cleared. + class KeyVersionSpec + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # User-defined URLs for accessing content published by this + # {::Google::Cloud::Security::PrivateCA::V1::CertificateAuthority CertificateAuthority}. + # @!attribute [rw] aia_issuing_certificate_urls + # @return [::Array<::String>] + # Optional. A list of URLs where the issuer CA certificate may be + # downloaded, which appears in the "Authority Information Access" extension + # in the certificate. If specified, the default [Cloud Storage + # URLs][google.cloud.security.privateca.v1.CertificateAuthority.AccessUrls.ca_certificate_access_url] + # will be omitted. + # @!attribute [rw] crl_access_urls + # @return [::Array<::String>] + # Optional. A list of URLs where to obtain CRL information, i.e. + # the DistributionPoint.fullName described by + # https://tools.ietf.org/html/rfc5280#section-4.2.1.13. + # If specified, the default + # [Cloud Storage + # URLs][google.cloud.security.privateca.v1.CertificateAuthority.AccessUrls.crl_access_urls] + # will be omitted. + class UserDefinedAccessUrls + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # @!attribute [rw] key + # @return [::String] + # @!attribute [rw] value + # @return [::String] + class LabelsEntry + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # The type of a + # {::Google::Cloud::Security::PrivateCA::V1::CertificateAuthority CertificateAuthority}, + # indicating its issuing chain. + module Type + # Not specified. + TYPE_UNSPECIFIED = 0 + + # Self-signed CA. + SELF_SIGNED = 1 + + # Subordinate CA. Could be issued by a Private CA + # {::Google::Cloud::Security::PrivateCA::V1::CertificateAuthority CertificateAuthority} + # or an unmanaged CA. + SUBORDINATE = 2 + end + + # The state of a + # {::Google::Cloud::Security::PrivateCA::V1::CertificateAuthority CertificateAuthority}, + # indicating if it can be used. + module State + # Not specified. + STATE_UNSPECIFIED = 0 + + # Certificates can be issued from this CA. CRLs will be generated for this + # CA. The CA will be part of the + # {::Google::Cloud::Security::PrivateCA::V1::CaPool CaPool}'s trust anchor, and + # will be used to issue certificates from the + # {::Google::Cloud::Security::PrivateCA::V1::CaPool CaPool}. + ENABLED = 1 + + # Certificates cannot be issued from this CA. CRLs will still be generated. + # The CA will be part of the + # {::Google::Cloud::Security::PrivateCA::V1::CaPool CaPool}'s trust anchor, but + # will not be used to issue certificates from the + # {::Google::Cloud::Security::PrivateCA::V1::CaPool CaPool}. + DISABLED = 2 + + # Certificates can be issued from this CA. CRLs will be generated for this + # CA. The CA will be part of the + # {::Google::Cloud::Security::PrivateCA::V1::CaPool CaPool}'s trust anchor, but + # will not be used to issue certificates from the + # {::Google::Cloud::Security::PrivateCA::V1::CaPool CaPool}. + STAGED = 3 + + # Certificates cannot be issued from this CA. CRLs will not be generated. + # The CA will not be part of the + # {::Google::Cloud::Security::PrivateCA::V1::CaPool CaPool}'s trust anchor, and + # will not be used to issue certificates from the + # {::Google::Cloud::Security::PrivateCA::V1::CaPool CaPool}. + AWAITING_USER_ACTIVATION = 4 + + # Certificates cannot be issued from this CA. CRLs will not be generated. + # The CA may still be recovered by calling + # {::Google::Cloud::Security::PrivateCA::V1::CertificateAuthorityService::Client#undelete_certificate_authority CertificateAuthorityService.UndeleteCertificateAuthority} + # before + # {::Google::Cloud::Security::PrivateCA::V1::CertificateAuthority#expire_time expire_time}. + # The CA will not be part of the + # {::Google::Cloud::Security::PrivateCA::V1::CaPool CaPool}'s trust anchor, and + # will not be used to issue certificates from the + # {::Google::Cloud::Security::PrivateCA::V1::CaPool CaPool}. + DELETED = 5 + end + + # The algorithm of a Cloud KMS CryptoKeyVersion of a + # [CryptoKey][google.cloud.kms.v1.CryptoKey] with the + # [CryptoKeyPurpose][google.cloud.kms.v1.CryptoKey.CryptoKeyPurpose] value + # `ASYMMETRIC_SIGN`. These values correspond to the + # [CryptoKeyVersionAlgorithm][google.cloud.kms.v1.CryptoKeyVersion.CryptoKeyVersionAlgorithm] + # values. For RSA signing algorithms, the PSS algorithms should be preferred, + # use PKCS1 algorithms if required for compatibility. For further + # recommendations, see + # https://cloud.google.com/kms/docs/algorithms#algorithm_recommendations. + module SignHashAlgorithm + # Not specified. + SIGN_HASH_ALGORITHM_UNSPECIFIED = 0 + + # maps to CryptoKeyVersionAlgorithm.RSA_SIGN_PSS_2048_SHA256 + RSA_PSS_2048_SHA256 = 1 + + # maps to CryptoKeyVersionAlgorithm. RSA_SIGN_PSS_3072_SHA256 + RSA_PSS_3072_SHA256 = 2 + + # maps to CryptoKeyVersionAlgorithm.RSA_SIGN_PSS_4096_SHA256 + RSA_PSS_4096_SHA256 = 3 + + # maps to CryptoKeyVersionAlgorithm.RSA_SIGN_PKCS1_2048_SHA256 + RSA_PKCS1_2048_SHA256 = 6 + + # maps to CryptoKeyVersionAlgorithm.RSA_SIGN_PKCS1_3072_SHA256 + RSA_PKCS1_3072_SHA256 = 7 + + # maps to CryptoKeyVersionAlgorithm.RSA_SIGN_PKCS1_4096_SHA256 + RSA_PKCS1_4096_SHA256 = 8 + + # maps to CryptoKeyVersionAlgorithm.EC_SIGN_P256_SHA256 + EC_P256_SHA256 = 4 + + # maps to CryptoKeyVersionAlgorithm.EC_SIGN_P384_SHA384 + EC_P384_SHA384 = 5 + end + end + + # A {::Google::Cloud::Security::PrivateCA::V1::CaPool CaPool} represents a group of + # {::Google::Cloud::Security::PrivateCA::V1::CertificateAuthority CertificateAuthorities} + # that form a trust anchor. A + # {::Google::Cloud::Security::PrivateCA::V1::CaPool CaPool} can be used to manage + # issuance policies for one or more + # {::Google::Cloud::Security::PrivateCA::V1::CertificateAuthority CertificateAuthority} + # resources and to rotate CA certificates in and out of the trust anchor. + # @!attribute [rw] name + # @return [::String] + # Identifier. The resource name for this + # {::Google::Cloud::Security::PrivateCA::V1::CaPool CaPool} in the format + # `projects/*/locations/*/caPools/*`. + # @!attribute [rw] tier + # @return [::Google::Cloud::Security::PrivateCA::V1::CaPool::Tier] + # Required. Immutable. The + # {::Google::Cloud::Security::PrivateCA::V1::CaPool::Tier Tier} of this + # {::Google::Cloud::Security::PrivateCA::V1::CaPool CaPool}. + # @!attribute [rw] issuance_policy + # @return [::Google::Cloud::Security::PrivateCA::V1::CaPool::IssuancePolicy] + # Optional. The + # {::Google::Cloud::Security::PrivateCA::V1::CaPool::IssuancePolicy IssuancePolicy} + # to control how + # {::Google::Cloud::Security::PrivateCA::V1::Certificate Certificates} will be + # issued from this {::Google::Cloud::Security::PrivateCA::V1::CaPool CaPool}. + # @!attribute [rw] publishing_options + # @return [::Google::Cloud::Security::PrivateCA::V1::CaPool::PublishingOptions] + # Optional. The + # {::Google::Cloud::Security::PrivateCA::V1::CaPool::PublishingOptions PublishingOptions} + # to follow when issuing + # {::Google::Cloud::Security::PrivateCA::V1::Certificate Certificates} from any + # {::Google::Cloud::Security::PrivateCA::V1::CertificateAuthority CertificateAuthority} + # in this {::Google::Cloud::Security::PrivateCA::V1::CaPool CaPool}. + # @!attribute [rw] labels + # @return [::Google::Protobuf::Map{::String => ::String}] + # Optional. Labels with user-defined metadata. + class CaPool + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # Options relating to the publication of each + # {::Google::Cloud::Security::PrivateCA::V1::CertificateAuthority CertificateAuthority}'s + # CA certificate and CRLs and their inclusion as extensions in issued + # {::Google::Cloud::Security::PrivateCA::V1::Certificate Certificates}. The options + # set here apply to certificates issued by any + # {::Google::Cloud::Security::PrivateCA::V1::CertificateAuthority CertificateAuthority} + # in the {::Google::Cloud::Security::PrivateCA::V1::CaPool CaPool}. + # @!attribute [rw] publish_ca_cert + # @return [::Boolean] + # Optional. When true, publishes each + # {::Google::Cloud::Security::PrivateCA::V1::CertificateAuthority CertificateAuthority}'s + # CA certificate and includes its URL in the "Authority Information Access" + # X.509 extension in all issued + # {::Google::Cloud::Security::PrivateCA::V1::Certificate Certificates}. If this + # is false, the CA certificate will not be published and the corresponding + # X.509 extension will not be written in issued certificates. + # @!attribute [rw] publish_crl + # @return [::Boolean] + # Optional. When true, publishes each + # {::Google::Cloud::Security::PrivateCA::V1::CertificateAuthority CertificateAuthority}'s + # CRL and includes its URL in the "CRL Distribution Points" X.509 extension + # in all issued + # {::Google::Cloud::Security::PrivateCA::V1::Certificate Certificates}. If this + # is false, CRLs will not be published and the corresponding X.509 + # extension will not be written in issued certificates. CRLs will expire 7 + # days from their creation. However, we will rebuild daily. CRLs are also + # rebuilt shortly after a certificate is revoked. + # @!attribute [rw] encoding_format + # @return [::Google::Cloud::Security::PrivateCA::V1::CaPool::PublishingOptions::EncodingFormat] + # Optional. Specifies the encoding format of each + # {::Google::Cloud::Security::PrivateCA::V1::CertificateAuthority CertificateAuthority} + # resource's CA certificate and CRLs. If this is omitted, CA certificates + # and CRLs will be published in PEM. + class PublishingOptions + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # Supported encoding formats for publishing. + module EncodingFormat + # Not specified. By default, PEM format will be used. + ENCODING_FORMAT_UNSPECIFIED = 0 + + # The + # {::Google::Cloud::Security::PrivateCA::V1::CertificateAuthority CertificateAuthority}'s + # CA certificate and CRLs will be published in PEM format. + PEM = 1 + + # The + # {::Google::Cloud::Security::PrivateCA::V1::CertificateAuthority CertificateAuthority}'s + # CA certificate and CRLs will be published in DER format. + DER = 2 + end + end + + # Defines controls over all certificate issuance within a + # {::Google::Cloud::Security::PrivateCA::V1::CaPool CaPool}. + # @!attribute [rw] allowed_key_types + # @return [::Array<::Google::Cloud::Security::PrivateCA::V1::CaPool::IssuancePolicy::AllowedKeyType>] + # Optional. If any + # {::Google::Cloud::Security::PrivateCA::V1::CaPool::IssuancePolicy::AllowedKeyType AllowedKeyType} + # is specified, then the certificate request's public key must match one of + # the key types listed here. Otherwise, any key may be used. + # @!attribute [rw] backdate_duration + # @return [::Google::Protobuf::Duration] + # Optional. The duration to backdate all certificates issued from this + # {::Google::Cloud::Security::PrivateCA::V1::CaPool CaPool}. If not set, the + # certificates will be issued with a not_before_time of the issuance time + # (i.e. the current time). If set, the certificates will be issued with a + # not_before_time of the issuance time minus the backdate_duration. The + # not_after_time will be adjusted to preserve the requested lifetime. The + # backdate_duration must be less than or equal to 48 hours. + # @!attribute [rw] maximum_lifetime + # @return [::Google::Protobuf::Duration] + # Optional. The maximum lifetime allowed for issued + # {::Google::Cloud::Security::PrivateCA::V1::Certificate Certificates}. Note that + # if the issuing + # {::Google::Cloud::Security::PrivateCA::V1::CertificateAuthority CertificateAuthority} + # expires before a + # {::Google::Cloud::Security::PrivateCA::V1::Certificate Certificate} resource's + # requested maximum_lifetime, the effective lifetime will be explicitly + # truncated to match it. + # @!attribute [rw] allowed_issuance_modes + # @return [::Google::Cloud::Security::PrivateCA::V1::CaPool::IssuancePolicy::IssuanceModes] + # Optional. If specified, then only methods allowed in the + # {::Google::Cloud::Security::PrivateCA::V1::CaPool::IssuancePolicy::IssuanceModes IssuanceModes} + # may be used to issue + # {::Google::Cloud::Security::PrivateCA::V1::Certificate Certificates}. + # @!attribute [rw] baseline_values + # @return [::Google::Cloud::Security::PrivateCA::V1::X509Parameters] + # Optional. A set of X.509 values that will be applied to all certificates + # issued through this {::Google::Cloud::Security::PrivateCA::V1::CaPool CaPool}. + # If a certificate request includes conflicting values for the same + # properties, they will be overwritten by the values defined here. If a + # certificate request uses a + # {::Google::Cloud::Security::PrivateCA::V1::CertificateTemplate CertificateTemplate} + # that defines conflicting + # {::Google::Cloud::Security::PrivateCA::V1::CertificateTemplate#predefined_values predefined_values} + # for the same properties, the certificate issuance request will fail. + # @!attribute [rw] identity_constraints + # @return [::Google::Cloud::Security::PrivateCA::V1::CertificateIdentityConstraints] + # Optional. Describes constraints on identities that may appear in + # {::Google::Cloud::Security::PrivateCA::V1::Certificate Certificates} issued + # through this {::Google::Cloud::Security::PrivateCA::V1::CaPool CaPool}. If this + # is omitted, then this {::Google::Cloud::Security::PrivateCA::V1::CaPool CaPool} + # will not add restrictions on a certificate's identity. + # @!attribute [rw] passthrough_extensions + # @return [::Google::Cloud::Security::PrivateCA::V1::CertificateExtensionConstraints] + # Optional. Describes the set of X.509 extensions that may appear in a + # {::Google::Cloud::Security::PrivateCA::V1::Certificate Certificate} issued + # through this {::Google::Cloud::Security::PrivateCA::V1::CaPool CaPool}. If a + # certificate request sets extensions that don't appear in the + # {::Google::Cloud::Security::PrivateCA::V1::CaPool::IssuancePolicy#passthrough_extensions passthrough_extensions}, + # those extensions will be dropped. If a certificate request uses a + # {::Google::Cloud::Security::PrivateCA::V1::CertificateTemplate CertificateTemplate} + # with + # {::Google::Cloud::Security::PrivateCA::V1::CertificateTemplate#predefined_values predefined_values} + # that don't appear here, the certificate issuance request will fail. If + # this is omitted, then this + # {::Google::Cloud::Security::PrivateCA::V1::CaPool CaPool} will not add + # restrictions on a certificate's X.509 extensions. These constraints do + # not apply to X.509 extensions set in this + # {::Google::Cloud::Security::PrivateCA::V1::CaPool CaPool}'s + # {::Google::Cloud::Security::PrivateCA::V1::CaPool::IssuancePolicy#baseline_values baseline_values}. + class IssuancePolicy + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # Describes a "type" of key that may be used in a + # {::Google::Cloud::Security::PrivateCA::V1::Certificate Certificate} issued from + # a {::Google::Cloud::Security::PrivateCA::V1::CaPool CaPool}. Note that a single + # {::Google::Cloud::Security::PrivateCA::V1::CaPool::IssuancePolicy::AllowedKeyType AllowedKeyType} + # may refer to either a fully-qualified key algorithm, such as RSA 4096, or + # a family of key algorithms, such as any RSA key. + # @!attribute [rw] rsa + # @return [::Google::Cloud::Security::PrivateCA::V1::CaPool::IssuancePolicy::AllowedKeyType::RsaKeyType] + # Represents an allowed RSA key type. + # + # Note: The following fields are mutually exclusive: `rsa`, `elliptic_curve`. If a field in that set is populated, all other fields in the set will automatically be cleared. + # @!attribute [rw] elliptic_curve + # @return [::Google::Cloud::Security::PrivateCA::V1::CaPool::IssuancePolicy::AllowedKeyType::EcKeyType] + # Represents an allowed Elliptic Curve key type. + # + # Note: The following fields are mutually exclusive: `elliptic_curve`, `rsa`. If a field in that set is populated, all other fields in the set will automatically be cleared. + class AllowedKeyType + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # Describes an RSA key that may be used in a + # {::Google::Cloud::Security::PrivateCA::V1::Certificate Certificate} issued + # from a {::Google::Cloud::Security::PrivateCA::V1::CaPool CaPool}. + # @!attribute [rw] min_modulus_size + # @return [::Integer] + # Optional. The minimum allowed RSA modulus size (inclusive), in bits. + # If this is not set, or if set to zero, the service-level min RSA + # modulus size will continue to apply. + # @!attribute [rw] max_modulus_size + # @return [::Integer] + # Optional. The maximum allowed RSA modulus size (inclusive), in bits. + # If this is not set, or if set to zero, the service will not enforce + # an explicit upper bound on RSA modulus sizes. + class RsaKeyType + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Describes an Elliptic Curve key that may be used in a + # {::Google::Cloud::Security::PrivateCA::V1::Certificate Certificate} issued + # from a {::Google::Cloud::Security::PrivateCA::V1::CaPool CaPool}. + # @!attribute [rw] signature_algorithm + # @return [::Google::Cloud::Security::PrivateCA::V1::CaPool::IssuancePolicy::AllowedKeyType::EcKeyType::EcSignatureAlgorithm] + # Optional. A signature algorithm that must be used. If this is + # omitted, any EC-based signature algorithm will be allowed. + class EcKeyType + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # Describes an elliptic curve-based signature algorithm that may be + # used in a + # {::Google::Cloud::Security::PrivateCA::V1::Certificate Certificate} issued + # from a {::Google::Cloud::Security::PrivateCA::V1::CaPool CaPool}. + module EcSignatureAlgorithm + # Not specified. Signifies that any signature algorithm may be used. + EC_SIGNATURE_ALGORITHM_UNSPECIFIED = 0 + + # Refers to the Elliptic Curve Digital Signature Algorithm over the + # NIST P-256 curve. + ECDSA_P256 = 1 + + # Refers to the Elliptic Curve Digital Signature Algorithm over the + # NIST P-384 curve. + ECDSA_P384 = 2 + + # Refers to the Edwards-curve Digital Signature Algorithm over curve + # 25519, as described in RFC 8410. + EDDSA_25519 = 3 + end + end + end + + # {::Google::Cloud::Security::PrivateCA::V1::CaPool::IssuancePolicy::IssuanceModes IssuanceModes} + # specifies the allowed ways in which + # {::Google::Cloud::Security::PrivateCA::V1::Certificate Certificates} may be + # requested from this {::Google::Cloud::Security::PrivateCA::V1::CaPool CaPool}. + # @!attribute [rw] allow_csr_based_issuance + # @return [::Boolean] + # Optional. When true, allows callers to create + # {::Google::Cloud::Security::PrivateCA::V1::Certificate Certificates} by + # specifying a CSR. + # @!attribute [rw] allow_config_based_issuance + # @return [::Boolean] + # Optional. When true, allows callers to create + # {::Google::Cloud::Security::PrivateCA::V1::Certificate Certificates} by + # specifying a + # {::Google::Cloud::Security::PrivateCA::V1::CertificateConfig CertificateConfig}. + class IssuanceModes + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end + + # @!attribute [rw] key + # @return [::String] + # @!attribute [rw] value + # @return [::String] + class LabelsEntry + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # The tier of a {::Google::Cloud::Security::PrivateCA::V1::CaPool CaPool}, + # indicating its supported functionality and/or billing SKU. + module Tier + # Not specified. + TIER_UNSPECIFIED = 0 + + # Enterprise tier. + ENTERPRISE = 1 + + # DevOps tier. + DEVOPS = 2 + end + end + + # A + # {::Google::Cloud::Security::PrivateCA::V1::CertificateRevocationList CertificateRevocationList} + # corresponds to a signed X.509 certificate Revocation List (CRL). A CRL + # contains the serial numbers of certificates that should no longer be trusted. + # @!attribute [rw] name + # @return [::String] + # Identifier. The resource name for this + # {::Google::Cloud::Security::PrivateCA::V1::CertificateRevocationList CertificateRevocationList} + # in the format `projects/*/locations/*/caPools/*certificateAuthorities/*/ + # certificateRevocationLists/*`. + # @!attribute [r] sequence_number + # @return [::Integer] + # Output only. The CRL sequence number that appears in pem_crl. + # @!attribute [r] revoked_certificates + # @return [::Array<::Google::Cloud::Security::PrivateCA::V1::CertificateRevocationList::RevokedCertificate>] + # Output only. The revoked serial numbers that appear in pem_crl. + # @!attribute [r] pem_crl + # @return [::String] + # Output only. The PEM-encoded X.509 CRL. + # @!attribute [r] access_url + # @return [::String] + # Output only. The location where 'pem_crl' can be accessed. + # @!attribute [r] state + # @return [::Google::Cloud::Security::PrivateCA::V1::CertificateRevocationList::State] + # Output only. The + # {::Google::Cloud::Security::PrivateCA::V1::CertificateRevocationList::State State} + # for this + # {::Google::Cloud::Security::PrivateCA::V1::CertificateRevocationList CertificateRevocationList}. + # @!attribute [r] create_time + # @return [::Google::Protobuf::Timestamp] + # Output only. The time at which this + # {::Google::Cloud::Security::PrivateCA::V1::CertificateRevocationList CertificateRevocationList} + # was created. + # @!attribute [r] update_time + # @return [::Google::Protobuf::Timestamp] + # Output only. The time at which this + # {::Google::Cloud::Security::PrivateCA::V1::CertificateRevocationList CertificateRevocationList} + # was updated. + # @!attribute [r] revision_id + # @return [::String] + # Output only. The revision ID of this + # {::Google::Cloud::Security::PrivateCA::V1::CertificateRevocationList CertificateRevocationList}. + # A new revision is committed whenever a new CRL is published. The format is + # an 8-character hexadecimal string. + # @!attribute [rw] labels + # @return [::Google::Protobuf::Map{::String => ::String}] + # Optional. Labels with user-defined metadata. + class CertificateRevocationList + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # Describes a revoked + # {::Google::Cloud::Security::PrivateCA::V1::Certificate Certificate}. + # @!attribute [rw] certificate + # @return [::String] + # The resource name for the + # {::Google::Cloud::Security::PrivateCA::V1::Certificate Certificate} in the + # format `projects/*/locations/*/caPools/*/certificates/*`. + # @!attribute [rw] hex_serial_number + # @return [::String] + # The serial number of the + # {::Google::Cloud::Security::PrivateCA::V1::Certificate Certificate}. + # @!attribute [rw] revocation_reason + # @return [::Google::Cloud::Security::PrivateCA::V1::RevocationReason] + # The reason the + # {::Google::Cloud::Security::PrivateCA::V1::Certificate Certificate} was + # revoked. + class RevokedCertificate + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # @!attribute [rw] key + # @return [::String] + # @!attribute [rw] value + # @return [::String] + class LabelsEntry + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # The state of a + # {::Google::Cloud::Security::PrivateCA::V1::CertificateRevocationList CertificateRevocationList}, + # indicating if it is current. + module State + # Not specified. + STATE_UNSPECIFIED = 0 + + # The + # {::Google::Cloud::Security::PrivateCA::V1::CertificateRevocationList CertificateRevocationList} + # is up to date. + ACTIVE = 1 + + # The + # {::Google::Cloud::Security::PrivateCA::V1::CertificateRevocationList CertificateRevocationList} + # is no longer current. + SUPERSEDED = 2 + end + end + + # A {::Google::Cloud::Security::PrivateCA::V1::Certificate Certificate} corresponds + # to a signed X.509 certificate issued by a + # {::Google::Cloud::Security::PrivateCA::V1::CertificateAuthority CertificateAuthority}. + # @!attribute [rw] name + # @return [::String] + # Identifier. The resource name for this + # {::Google::Cloud::Security::PrivateCA::V1::Certificate Certificate} in the format + # `projects/*/locations/*/caPools/*/certificates/*`. + # @!attribute [rw] pem_csr + # @return [::String] + # Immutable. A pem-encoded X.509 certificate signing request (CSR). + # + # Note: The following fields are mutually exclusive: `pem_csr`, `config`. If a field in that set is populated, all other fields in the set will automatically be cleared. + # @!attribute [rw] config + # @return [::Google::Cloud::Security::PrivateCA::V1::CertificateConfig] + # Immutable. A description of the certificate and key that does not require + # X.509 or ASN.1. + # + # Note: The following fields are mutually exclusive: `config`, `pem_csr`. If a field in that set is populated, all other fields in the set will automatically be cleared. + # @!attribute [r] issuer_certificate_authority + # @return [::String] + # Output only. The resource name of the issuing + # {::Google::Cloud::Security::PrivateCA::V1::CertificateAuthority CertificateAuthority} + # in the format `projects/*/locations/*/caPools/*/certificateAuthorities/*`. + # @!attribute [rw] lifetime + # @return [::Google::Protobuf::Duration] + # Required. Immutable. The desired lifetime of a certificate. Used to create + # the "not_before_time" and "not_after_time" fields inside an X.509 + # certificate. Note that the lifetime may be truncated if it would extend + # past the life of any certificate authority in the issuing chain. + # @!attribute [rw] certificate_template + # @return [::String] + # Immutable. The resource name for a + # {::Google::Cloud::Security::PrivateCA::V1::CertificateTemplate CertificateTemplate} + # used to issue this certificate, in the format + # `projects/*/locations/*/certificateTemplates/*`. + # If this is specified, the caller must have the necessary permission to + # use this template. If this is omitted, no template will be used. + # This template must be in the same location as the + # {::Google::Cloud::Security::PrivateCA::V1::Certificate Certificate}. + # @!attribute [rw] subject_mode + # @return [::Google::Cloud::Security::PrivateCA::V1::SubjectRequestMode] + # Immutable. Specifies how the + # {::Google::Cloud::Security::PrivateCA::V1::Certificate Certificate}'s identity + # fields are to be decided. If this is omitted, the `DEFAULT` subject mode + # will be used. + # @!attribute [r] revocation_details + # @return [::Google::Cloud::Security::PrivateCA::V1::Certificate::RevocationDetails] + # Output only. Details regarding the revocation of this + # {::Google::Cloud::Security::PrivateCA::V1::Certificate Certificate}. This + # {::Google::Cloud::Security::PrivateCA::V1::Certificate Certificate} is considered + # revoked if and only if this field is present. + # @!attribute [r] pem_certificate + # @return [::String] + # Output only. The pem-encoded, signed X.509 certificate. + # @!attribute [r] certificate_description + # @return [::Google::Cloud::Security::PrivateCA::V1::CertificateDescription] + # Output only. A structured description of the issued X.509 certificate. + # @!attribute [r] pem_certificate_chain + # @return [::Array<::String>] + # Output only. The chain that may be used to verify the X.509 certificate. + # Expected to be in issuer-to-root order according to RFC 5246. + # @!attribute [r] create_time + # @return [::Google::Protobuf::Timestamp] + # Output only. The time at which this + # {::Google::Cloud::Security::PrivateCA::V1::Certificate Certificate} was created. + # @!attribute [r] update_time + # @return [::Google::Protobuf::Timestamp] + # Output only. The time at which this + # {::Google::Cloud::Security::PrivateCA::V1::Certificate Certificate} was updated. + # @!attribute [rw] labels + # @return [::Google::Protobuf::Map{::String => ::String}] + # Optional. Labels with user-defined metadata. + class Certificate + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # Describes fields that are relavent to the revocation of a + # {::Google::Cloud::Security::PrivateCA::V1::Certificate Certificate}. + # @!attribute [rw] revocation_state + # @return [::Google::Cloud::Security::PrivateCA::V1::RevocationReason] + # Indicates why a + # {::Google::Cloud::Security::PrivateCA::V1::Certificate Certificate} was + # revoked. + # @!attribute [rw] revocation_time + # @return [::Google::Protobuf::Timestamp] + # The time at which this + # {::Google::Cloud::Security::PrivateCA::V1::Certificate Certificate} was + # revoked. + class RevocationDetails + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # @!attribute [rw] key + # @return [::String] + # @!attribute [rw] value + # @return [::String] + class LabelsEntry + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end + + # A + # {::Google::Cloud::Security::PrivateCA::V1::CertificateTemplate CertificateTemplate} + # refers to a managed template for certificate issuance. + # @!attribute [rw] name + # @return [::String] + # Identifier. The resource name for this + # {::Google::Cloud::Security::PrivateCA::V1::CertificateTemplate CertificateTemplate} + # in the format `projects/*/locations/*/certificateTemplates/*`. + # @!attribute [rw] maximum_lifetime + # @return [::Google::Protobuf::Duration] + # Optional. The maximum lifetime allowed for issued + # {::Google::Cloud::Security::PrivateCA::V1::Certificate Certificates} that use + # this template. If the issuing + # {::Google::Cloud::Security::PrivateCA::V1::CaPool CaPool} resource's + # {::Google::Cloud::Security::PrivateCA::V1::CaPool::IssuancePolicy IssuancePolicy} + # specifies a + # {::Google::Cloud::Security::PrivateCA::V1::CaPool::IssuancePolicy#maximum_lifetime maximum_lifetime} + # the minimum of the two durations will be the maximum lifetime for issued + # {::Google::Cloud::Security::PrivateCA::V1::Certificate Certificates}. Note that + # if the issuing + # {::Google::Cloud::Security::PrivateCA::V1::CertificateAuthority CertificateAuthority} + # expires before a + # {::Google::Cloud::Security::PrivateCA::V1::Certificate Certificate}'s requested + # maximum_lifetime, the effective lifetime will be explicitly truncated + # to match it. + # @!attribute [rw] predefined_values + # @return [::Google::Cloud::Security::PrivateCA::V1::X509Parameters] + # Optional. A set of X.509 values that will be applied to all issued + # certificates that use this template. If the certificate request includes + # conflicting values for the same properties, they will be overwritten by the + # values defined here. If the issuing + # {::Google::Cloud::Security::PrivateCA::V1::CaPool CaPool}'s + # {::Google::Cloud::Security::PrivateCA::V1::CaPool::IssuancePolicy IssuancePolicy} + # defines conflicting + # {::Google::Cloud::Security::PrivateCA::V1::CaPool::IssuancePolicy#baseline_values baseline_values} + # for the same properties, the certificate issuance request will fail. + # @!attribute [rw] identity_constraints + # @return [::Google::Cloud::Security::PrivateCA::V1::CertificateIdentityConstraints] + # Optional. Describes constraints on identities that may be appear in + # {::Google::Cloud::Security::PrivateCA::V1::Certificate Certificates} issued using + # this template. If this is omitted, then this template will not add + # restrictions on a certificate's identity. + # @!attribute [rw] passthrough_extensions + # @return [::Google::Cloud::Security::PrivateCA::V1::CertificateExtensionConstraints] + # Optional. Describes the set of X.509 extensions that may appear in a + # {::Google::Cloud::Security::PrivateCA::V1::Certificate Certificate} issued using + # this + # {::Google::Cloud::Security::PrivateCA::V1::CertificateTemplate CertificateTemplate}. + # If a certificate request sets extensions that don't appear in the + # {::Google::Cloud::Security::PrivateCA::V1::CertificateTemplate#passthrough_extensions passthrough_extensions}, + # those extensions will be dropped. If the issuing + # {::Google::Cloud::Security::PrivateCA::V1::CaPool CaPool}'s + # {::Google::Cloud::Security::PrivateCA::V1::CaPool::IssuancePolicy IssuancePolicy} + # defines + # {::Google::Cloud::Security::PrivateCA::V1::CaPool::IssuancePolicy#baseline_values baseline_values} + # that don't appear here, the certificate issuance request will fail. If this + # is omitted, then this template will not add restrictions on a certificate's + # X.509 extensions. These constraints do not apply to X.509 extensions set in + # this + # {::Google::Cloud::Security::PrivateCA::V1::CertificateTemplate CertificateTemplate}'s + # {::Google::Cloud::Security::PrivateCA::V1::CertificateTemplate#predefined_values predefined_values}. + # @!attribute [rw] description + # @return [::String] + # Optional. A human-readable description of scenarios this template is + # intended for. + # @!attribute [r] create_time + # @return [::Google::Protobuf::Timestamp] + # Output only. The time at which this + # {::Google::Cloud::Security::PrivateCA::V1::CertificateTemplate CertificateTemplate} + # was created. + # @!attribute [r] update_time + # @return [::Google::Protobuf::Timestamp] + # Output only. The time at which this + # {::Google::Cloud::Security::PrivateCA::V1::CertificateTemplate CertificateTemplate} + # was updated. + # @!attribute [rw] labels + # @return [::Google::Protobuf::Map{::String => ::String}] + # Optional. Labels with user-defined metadata. + class CertificateTemplate + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # @!attribute [rw] key + # @return [::String] + # @!attribute [rw] value + # @return [::String] + class LabelsEntry + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end + + # An {::Google::Cloud::Security::PrivateCA::V1::X509Parameters X509Parameters} is + # used to describe certain fields of an X.509 certificate, such as the key + # usage fields, fields specific to CA certificates, certificate policy + # extensions and custom extensions. + # @!attribute [rw] key_usage + # @return [::Google::Cloud::Security::PrivateCA::V1::KeyUsage] + # Optional. Indicates the intended use for keys that correspond to a + # certificate. + # @!attribute [rw] ca_options + # @return [::Google::Cloud::Security::PrivateCA::V1::X509Parameters::CaOptions] + # Optional. Describes options in this + # {::Google::Cloud::Security::PrivateCA::V1::X509Parameters X509Parameters} that + # are relevant in a CA certificate. If not specified, a default basic + # constraints extension with `is_ca=false` will be added for leaf + # certificates. + # @!attribute [rw] policy_ids + # @return [::Array<::Google::Cloud::Security::PrivateCA::V1::ObjectId>] + # Optional. Describes the X.509 certificate policy object identifiers, per + # https://tools.ietf.org/html/rfc5280#section-4.2.1.4. + # @!attribute [rw] aia_ocsp_servers + # @return [::Array<::String>] + # Optional. Describes Online Certificate Status Protocol (OCSP) endpoint + # addresses that appear in the "Authority Information Access" extension in + # the certificate. + # @!attribute [rw] name_constraints + # @return [::Google::Cloud::Security::PrivateCA::V1::X509Parameters::NameConstraints] + # Optional. Describes the X.509 name constraints extension. + # @!attribute [rw] additional_extensions + # @return [::Array<::Google::Cloud::Security::PrivateCA::V1::X509Extension>] + # Optional. Describes custom X.509 extensions. + class X509Parameters + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # Describes the X.509 basic constraints extension, per [RFC 5280 + # section 4.2.1.9](https://tools.ietf.org/html/rfc5280#section-4.2.1.9) + # @!attribute [rw] is_ca + # @return [::Boolean] + # Optional. Refers to the "CA" boolean field in the X.509 extension. + # When this value is missing, the basic constraints extension will be + # omitted from the certificate. + # @!attribute [rw] max_issuer_path_length + # @return [::Integer] + # Optional. Refers to the path length constraint field in the X.509 + # extension. For a CA certificate, this value describes the depth of + # subordinate CA certificates that are allowed. If this value is less than + # 0, the request will fail. If this value is missing, the max path length + # will be omitted from the certificate. + class CaOptions + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Describes the X.509 name constraints extension, per + # https://tools.ietf.org/html/rfc5280#section-4.2.1.10 + # @!attribute [rw] critical + # @return [::Boolean] + # Indicates whether or not the name constraints are marked critical. + # @!attribute [rw] permitted_dns_names + # @return [::Array<::String>] + # Contains permitted DNS names. Any DNS name that can be + # constructed by simply adding zero or more labels to + # the left-hand side of the name satisfies the name constraint. + # For example, `example.com`, `www.example.com`, `www.sub.example.com` + # would satisfy `example.com` while `example1.com` does not. + # @!attribute [rw] excluded_dns_names + # @return [::Array<::String>] + # Contains excluded DNS names. Any DNS name that can be + # constructed by simply adding zero or more labels to + # the left-hand side of the name satisfies the name constraint. + # For example, `example.com`, `www.example.com`, `www.sub.example.com` + # would satisfy `example.com` while `example1.com` does not. + # @!attribute [rw] permitted_ip_ranges + # @return [::Array<::String>] + # Contains the permitted IP ranges. For IPv4 addresses, the ranges + # are expressed using CIDR notation as specified in RFC 4632. + # For IPv6 addresses, the ranges are expressed in similar encoding as IPv4 + # addresses. + # @!attribute [rw] excluded_ip_ranges + # @return [::Array<::String>] + # Contains the excluded IP ranges. For IPv4 addresses, the ranges + # are expressed using CIDR notation as specified in RFC 4632. + # For IPv6 addresses, the ranges are expressed in similar encoding as IPv4 + # addresses. + # @!attribute [rw] permitted_email_addresses + # @return [::Array<::String>] + # Contains the permitted email addresses. The value can be a particular + # email address, a hostname to indicate all email addresses on that host or + # a domain with a leading period (e.g. `.example.com`) to indicate + # all email addresses in that domain. + # @!attribute [rw] excluded_email_addresses + # @return [::Array<::String>] + # Contains the excluded email addresses. The value can be a particular + # email address, a hostname to indicate all email addresses on that host or + # a domain with a leading period (e.g. `.example.com`) to indicate + # all email addresses in that domain. + # @!attribute [rw] permitted_uris + # @return [::Array<::String>] + # Contains the permitted URIs that apply to the host part of the name. + # The value can be a hostname or a domain with a + # leading period (like `.example.com`) + # @!attribute [rw] excluded_uris + # @return [::Array<::String>] + # Contains the excluded URIs that apply to the host part of the name. + # The value can be a hostname or a domain with a + # leading period (like `.example.com`) + class NameConstraints + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end + + # Describes a subordinate CA's issuers. This is either a resource name to a + # known issuing + # {::Google::Cloud::Security::PrivateCA::V1::CertificateAuthority CertificateAuthority}, + # or a PEM issuer certificate chain. + # @!attribute [rw] certificate_authority + # @return [::String] + # Required. This can refer to a + # {::Google::Cloud::Security::PrivateCA::V1::CertificateAuthority CertificateAuthority} + # that was used to create a subordinate + # {::Google::Cloud::Security::PrivateCA::V1::CertificateAuthority CertificateAuthority}. + # This field is used for information and usability purposes only. The + # resource name is in the format + # `projects/*/locations/*/caPools/*/certificateAuthorities/*`. + # + # Note: The following fields are mutually exclusive: `certificate_authority`, `pem_issuer_chain`. If a field in that set is populated, all other fields in the set will automatically be cleared. + # @!attribute [rw] pem_issuer_chain + # @return [::Google::Cloud::Security::PrivateCA::V1::SubordinateConfig::SubordinateConfigChain] + # Required. Contains the PEM certificate chain for the issuers of this + # {::Google::Cloud::Security::PrivateCA::V1::CertificateAuthority CertificateAuthority}, + # but not pem certificate for this CA itself. + # + # Note: The following fields are mutually exclusive: `pem_issuer_chain`, `certificate_authority`. If a field in that set is populated, all other fields in the set will automatically be cleared. + class SubordinateConfig + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # This message describes a subordinate CA's issuer certificate chain. This + # wrapper exists for compatibility reasons. + # @!attribute [rw] pem_certificates + # @return [::Array<::String>] + # Required. Expected to be in leaf-to-root order according to RFC 5246. + class SubordinateConfigChain + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end + + # A {::Google::Cloud::Security::PrivateCA::V1::PublicKey PublicKey} describes a + # public key. + # @!attribute [rw] key + # @return [::String] + # Required. A public key. The padding and encoding + # must match with the `KeyFormat` value specified for the `format` field. + # @!attribute [rw] format + # @return [::Google::Cloud::Security::PrivateCA::V1::PublicKey::KeyFormat] + # Required. The format of the public key. + class PublicKey + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # Types of public keys formats that are supported. Currently, only `PEM` + # format is supported. + module KeyFormat + # Default unspecified value. + KEY_FORMAT_UNSPECIFIED = 0 + + # The key is PEM-encoded as defined in [RFC + # 7468](https://tools.ietf.org/html/rfc7468). It can be any of the + # following: a PEM-encoded PKCS#1/RFC 3447 RSAPublicKey + # structure, an RFC 5280 + # [SubjectPublicKeyInfo](https://tools.ietf.org/html/rfc5280#section-4.1) + # or a PEM-encoded X.509 certificate signing request (CSR). If a + # [SubjectPublicKeyInfo](https://tools.ietf.org/html/rfc5280#section-4.1) + # is specified, it can contain a A PEM-encoded PKCS#1/RFC 3447 RSAPublicKey + # or a NIST P-256/secp256r1/prime256v1 or P-384 key. If a CSR is specified, + # it will used solely for the purpose of extracting the public key. When + # generated by the service, it will always be an RFC 5280 + # [SubjectPublicKeyInfo](https://tools.ietf.org/html/rfc5280#section-4.1) + # structure containing an algorithm identifier and a key. + PEM = 1 + end + end + + # A {::Google::Cloud::Security::PrivateCA::V1::CertificateConfig CertificateConfig} + # describes an X.509 certificate or CSR that is to be created, as an + # alternative to using ASN.1. + # @!attribute [rw] subject_config + # @return [::Google::Cloud::Security::PrivateCA::V1::CertificateConfig::SubjectConfig] + # Required. Specifies some of the values in a certificate that are related to + # the subject. + # @!attribute [rw] x509_config + # @return [::Google::Cloud::Security::PrivateCA::V1::X509Parameters] + # Required. Describes how some of the technical X.509 fields in a certificate + # should be populated. + # @!attribute [rw] public_key + # @return [::Google::Cloud::Security::PrivateCA::V1::PublicKey] + # Optional. The public key that corresponds to this config. This is, for + # example, used when issuing + # {::Google::Cloud::Security::PrivateCA::V1::Certificate Certificates}, but not + # when creating a self-signed + # {::Google::Cloud::Security::PrivateCA::V1::CertificateAuthority CertificateAuthority} + # or + # {::Google::Cloud::Security::PrivateCA::V1::CertificateAuthority CertificateAuthority} + # CSR. + # @!attribute [rw] subject_key_id + # @return [::Google::Cloud::Security::PrivateCA::V1::CertificateConfig::KeyId] + # Optional. When specified this provides a custom SKI to be used in the + # certificate. This should only be used to maintain a SKI of an existing CA + # originally created outside CA service, which was not generated using method + # (1) described in RFC 5280 section 4.2.1.2. + class CertificateConfig + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # These values are used to create the distinguished name and subject + # alternative name fields in an X.509 certificate. + # @!attribute [rw] subject + # @return [::Google::Cloud::Security::PrivateCA::V1::Subject] + # Optional. Contains distinguished name fields such as the common name, + # location and organization. + # @!attribute [rw] subject_alt_name + # @return [::Google::Cloud::Security::PrivateCA::V1::SubjectAltNames] + # Optional. The subject alternative name fields. + class SubjectConfig + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # A KeyId identifies a specific public key, usually by hashing the public + # key. + # @!attribute [rw] key_id + # @return [::String] + # Required. The value of this KeyId encoded in lowercase hexadecimal. This + # is most likely the 160 bit SHA-1 hash of the public key. + class KeyId + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end + + # A + # {::Google::Cloud::Security::PrivateCA::V1::CertificateDescription CertificateDescription} + # describes an X.509 certificate or CSR that has been issued, as an alternative + # to using ASN.1 / X.509. + # @!attribute [rw] subject_description + # @return [::Google::Cloud::Security::PrivateCA::V1::CertificateDescription::SubjectDescription] + # Describes some of the values in a certificate that are related to the + # subject and lifetime. + # @!attribute [rw] x509_description + # @return [::Google::Cloud::Security::PrivateCA::V1::X509Parameters] + # Describes some of the technical X.509 fields in a certificate. + # @!attribute [rw] public_key + # @return [::Google::Cloud::Security::PrivateCA::V1::PublicKey] + # The public key that corresponds to an issued certificate. + # @!attribute [rw] subject_key_id + # @return [::Google::Cloud::Security::PrivateCA::V1::CertificateDescription::KeyId] + # Provides a means of identifiying certificates that contain a particular + # public key, per https://tools.ietf.org/html/rfc5280#section-4.2.1.2. + # @!attribute [rw] authority_key_id + # @return [::Google::Cloud::Security::PrivateCA::V1::CertificateDescription::KeyId] + # Identifies the subject_key_id of the parent certificate, per + # https://tools.ietf.org/html/rfc5280#section-4.2.1.1 + # @!attribute [rw] crl_distribution_points + # @return [::Array<::String>] + # Describes a list of locations to obtain CRL information, i.e. + # the DistributionPoint.fullName described by + # https://tools.ietf.org/html/rfc5280#section-4.2.1.13 + # @!attribute [rw] aia_issuing_certificate_urls + # @return [::Array<::String>] + # Describes lists of issuer CA certificate URLs that appear in the + # "Authority Information Access" extension in the certificate. + # @!attribute [rw] cert_fingerprint + # @return [::Google::Cloud::Security::PrivateCA::V1::CertificateDescription::CertificateFingerprint] + # The hash of the x.509 certificate. + # @!attribute [rw] tbs_certificate_digest + # @return [::String] + # The hash of the pre-signed certificate, which will be signed by the CA. + # Corresponds to the TBS Certificate in + # https://tools.ietf.org/html/rfc5280#section-4.1.2. The field will always be + # populated. + class CertificateDescription + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # These values describe fields in an issued X.509 certificate such as the + # distinguished name, subject alternative names, serial number, and lifetime. + # @!attribute [rw] subject + # @return [::Google::Cloud::Security::PrivateCA::V1::Subject] + # Contains distinguished name fields such as the common name, location and + # / organization. + # @!attribute [rw] subject_alt_name + # @return [::Google::Cloud::Security::PrivateCA::V1::SubjectAltNames] + # The subject alternative name fields. + # @!attribute [rw] hex_serial_number + # @return [::String] + # The serial number encoded in lowercase hexadecimal. + # @!attribute [rw] lifetime + # @return [::Google::Protobuf::Duration] + # For convenience, the actual lifetime of an issued certificate. + # @!attribute [rw] not_before_time + # @return [::Google::Protobuf::Timestamp] + # The time at which the certificate becomes valid. + # @!attribute [rw] not_after_time + # @return [::Google::Protobuf::Timestamp] + # The time after which the certificate is expired. + # Per RFC 5280, the validity period for a certificate is the period of time + # from not_before_time through not_after_time, inclusive. + # Corresponds to 'not_before_time' + 'lifetime' - 1 second. + class SubjectDescription + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # A KeyId identifies a specific public key, usually by hashing the public + # key. + # @!attribute [rw] key_id + # @return [::String] + # Optional. The value of this KeyId encoded in lowercase hexadecimal. This + # is most likely the 160 bit SHA-1 hash of the public key. + class KeyId + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # A group of fingerprints for the x509 certificate. + # @!attribute [rw] sha256_hash + # @return [::String] + # The SHA 256 hash, encoded in hexadecimal, of the DER x509 certificate. + class CertificateFingerprint + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end + + # An {::Google::Cloud::Security::PrivateCA::V1::ObjectId ObjectId} specifies an + # object identifier (OID). These provide context and describe types in ASN.1 + # messages. + # @!attribute [rw] object_id_path + # @return [::Array<::Integer>] + # Required. The parts of an OID path. The most significant parts of the path + # come first. + class ObjectId + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # An {::Google::Cloud::Security::PrivateCA::V1::X509Extension X509Extension} + # specifies an X.509 extension, which may be used in different parts of X.509 + # objects like certificates, CSRs, and CRLs. + # @!attribute [rw] object_id + # @return [::Google::Cloud::Security::PrivateCA::V1::ObjectId] + # Required. The OID for this X.509 extension. + # @!attribute [rw] critical + # @return [::Boolean] + # Optional. Indicates whether or not this extension is critical (i.e., if the + # client does not know how to handle this extension, the client should + # consider this to be an error). + # @!attribute [rw] value + # @return [::String] + # Required. The value of this X.509 extension. + class X509Extension + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # A {::Google::Cloud::Security::PrivateCA::V1::KeyUsage KeyUsage} describes key usage + # values that may appear in an X.509 certificate. + # @!attribute [rw] base_key_usage + # @return [::Google::Cloud::Security::PrivateCA::V1::KeyUsage::KeyUsageOptions] + # Describes high-level ways in which a key may be used. + # @!attribute [rw] extended_key_usage + # @return [::Google::Cloud::Security::PrivateCA::V1::KeyUsage::ExtendedKeyUsageOptions] + # Detailed scenarios in which a key may be used. + # @!attribute [rw] unknown_extended_key_usages + # @return [::Array<::Google::Cloud::Security::PrivateCA::V1::ObjectId>] + # Used to describe extended key usages that are not listed in the + # {::Google::Cloud::Security::PrivateCA::V1::KeyUsage::ExtendedKeyUsageOptions KeyUsage.ExtendedKeyUsageOptions} + # message. + class KeyUsage + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # {::Google::Cloud::Security::PrivateCA::V1::KeyUsage::KeyUsageOptions KeyUsage.KeyUsageOptions} + # corresponds to the key usage values described in + # https://tools.ietf.org/html/rfc5280#section-4.2.1.3. + # @!attribute [rw] digital_signature + # @return [::Boolean] + # The key may be used for digital signatures. + # @!attribute [rw] content_commitment + # @return [::Boolean] + # The key may be used for cryptographic commitments. Note that this may + # also be referred to as "non-repudiation". + # @!attribute [rw] key_encipherment + # @return [::Boolean] + # The key may be used to encipher other keys. + # @!attribute [rw] data_encipherment + # @return [::Boolean] + # The key may be used to encipher data. + # @!attribute [rw] key_agreement + # @return [::Boolean] + # The key may be used in a key agreement protocol. + # @!attribute [rw] cert_sign + # @return [::Boolean] + # The key may be used to sign certificates. + # @!attribute [rw] crl_sign + # @return [::Boolean] + # The key may be used sign certificate revocation lists. + # @!attribute [rw] encipher_only + # @return [::Boolean] + # The key may be used to encipher only. + # @!attribute [rw] decipher_only + # @return [::Boolean] + # The key may be used to decipher only. + class KeyUsageOptions + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # {::Google::Cloud::Security::PrivateCA::V1::KeyUsage::ExtendedKeyUsageOptions KeyUsage.ExtendedKeyUsageOptions} + # has fields that correspond to certain common OIDs that could be specified + # as an extended key usage value. + # @!attribute [rw] server_auth + # @return [::Boolean] + # Corresponds to OID 1.3.6.1.5.5.7.3.1. Officially described as "TLS WWW + # server authentication", though regularly used for non-WWW TLS. + # @!attribute [rw] client_auth + # @return [::Boolean] + # Corresponds to OID 1.3.6.1.5.5.7.3.2. Officially described as "TLS WWW + # client authentication", though regularly used for non-WWW TLS. + # @!attribute [rw] code_signing + # @return [::Boolean] + # Corresponds to OID 1.3.6.1.5.5.7.3.3. Officially described as "Signing of + # downloadable executable code client authentication". + # @!attribute [rw] email_protection + # @return [::Boolean] + # Corresponds to OID 1.3.6.1.5.5.7.3.4. Officially described as "Email + # protection". + # @!attribute [rw] time_stamping + # @return [::Boolean] + # Corresponds to OID 1.3.6.1.5.5.7.3.8. Officially described as "Binding + # the hash of an object to a time". + # @!attribute [rw] ocsp_signing + # @return [::Boolean] + # Corresponds to OID 1.3.6.1.5.5.7.3.9. Officially described as "Signing + # OCSP responses". + class ExtendedKeyUsageOptions + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end + + # {::Google::Cloud::Security::PrivateCA::V1::AttributeTypeAndValue AttributeTypeAndValue} + # specifies an attribute type and value. It can use either a OID or enum value + # to specify the attribute type. + # @!attribute [rw] type + # @return [::Google::Cloud::Security::PrivateCA::V1::AttributeType] + # The attribute type of the attribute and value pair. + # + # Note: The following fields are mutually exclusive: `type`, `object_id`. If a field in that set is populated, all other fields in the set will automatically be cleared. + # @!attribute [rw] object_id + # @return [::Google::Cloud::Security::PrivateCA::V1::ObjectId] + # Object ID for an attribute type of an attribute and value pair. + # + # Note: The following fields are mutually exclusive: `object_id`, `type`. If a field in that set is populated, all other fields in the set will automatically be cleared. + # @!attribute [rw] value + # @return [::String] + # The value for the attribute type. + class AttributeTypeAndValue + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # {::Google::Cloud::Security::PrivateCA::V1::RelativeDistinguishedName RelativeDistinguishedName} + # specifies a relative distinguished name which will be used to build a + # distinguished name. + # @!attribute [rw] attributes + # @return [::Array<::Google::Cloud::Security::PrivateCA::V1::AttributeTypeAndValue>] + # Attributes describes the attribute value assertions in the RDN. + class RelativeDistinguishedName + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # {::Google::Cloud::Security::PrivateCA::V1::Subject Subject} describes parts of a + # distinguished name that, in turn, describes the subject of the certificate. + # @!attribute [rw] common_name + # @return [::String] + # The "common name" of the subject. + # @!attribute [rw] country_code + # @return [::String] + # The country code of the subject. + # @!attribute [rw] organization + # @return [::String] + # The organization of the subject. + # @!attribute [rw] organizational_unit + # @return [::String] + # The organizational_unit of the subject. + # @!attribute [rw] locality + # @return [::String] + # The locality or city of the subject. + # @!attribute [rw] province + # @return [::String] + # The province, territory, or regional state of the subject. + # @!attribute [rw] street_address + # @return [::String] + # The street address of the subject. + # @!attribute [rw] postal_code + # @return [::String] + # The postal code of the subject. + # @!attribute [rw] rdn_sequence + # @return [::Array<::Google::Cloud::Security::PrivateCA::V1::RelativeDistinguishedName>] + # This field can be used in place of the named subject fields. + class Subject + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # {::Google::Cloud::Security::PrivateCA::V1::SubjectAltNames SubjectAltNames} + # corresponds to a more modern way of listing what the asserted identity is in + # a certificate (i.e., compared to the "common name" in the distinguished + # name). + # @!attribute [rw] dns_names + # @return [::Array<::String>] + # Contains only valid, fully-qualified host names. + # @!attribute [rw] uris + # @return [::Array<::String>] + # Contains only valid RFC 3986 URIs. + # @!attribute [rw] email_addresses + # @return [::Array<::String>] + # Contains only valid RFC 2822 E-mail addresses. + # @!attribute [rw] ip_addresses + # @return [::Array<::String>] + # Contains only valid 32-bit IPv4 addresses or RFC 4291 IPv6 addresses. + # @!attribute [rw] custom_sans + # @return [::Array<::Google::Cloud::Security::PrivateCA::V1::X509Extension>] + # Contains additional subject alternative name values. + # For each custom_san, the `value` field must contain an ASN.1 encoded + # UTF8String. + class SubjectAltNames + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Describes constraints on a + # {::Google::Cloud::Security::PrivateCA::V1::Certificate Certificate}'s + # {::Google::Cloud::Security::PrivateCA::V1::Subject Subject} and + # {::Google::Cloud::Security::PrivateCA::V1::SubjectAltNames SubjectAltNames}. + # @!attribute [rw] cel_expression + # @return [::Google::Type::Expr] + # Optional. A CEL expression that may be used to validate the resolved X.509 + # Subject and/or Subject Alternative Name before a certificate is signed. To + # see the full allowed syntax and some examples, see + # https://cloud.google.com/certificate-authority-service/docs/using-cel + # @!attribute [rw] allow_subject_passthrough + # @return [::Boolean] + # Required. If this is true, the + # {::Google::Cloud::Security::PrivateCA::V1::Subject Subject} field may be copied + # from a certificate request into the signed certificate. Otherwise, the + # requested {::Google::Cloud::Security::PrivateCA::V1::Subject Subject} will be + # discarded. + # @!attribute [rw] allow_subject_alt_names_passthrough + # @return [::Boolean] + # Required. If this is true, the + # {::Google::Cloud::Security::PrivateCA::V1::SubjectAltNames SubjectAltNames} + # extension may be copied from a certificate request into the signed + # certificate. Otherwise, the requested + # {::Google::Cloud::Security::PrivateCA::V1::SubjectAltNames SubjectAltNames} will + # be discarded. + class CertificateIdentityConstraints + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Describes a set of X.509 extensions that may be part of some certificate + # issuance controls. + # @!attribute [rw] known_extensions + # @return [::Array<::Google::Cloud::Security::PrivateCA::V1::CertificateExtensionConstraints::KnownCertificateExtension>] + # Optional. A set of named X.509 extensions. Will be combined with + # {::Google::Cloud::Security::PrivateCA::V1::CertificateExtensionConstraints#additional_extensions additional_extensions} + # to determine the full set of X.509 extensions. + # @!attribute [rw] additional_extensions + # @return [::Array<::Google::Cloud::Security::PrivateCA::V1::ObjectId>] + # Optional. A set of {::Google::Cloud::Security::PrivateCA::V1::ObjectId ObjectIds} + # identifying custom X.509 extensions. Will be combined with + # {::Google::Cloud::Security::PrivateCA::V1::CertificateExtensionConstraints#known_extensions known_extensions} + # to determine the full set of X.509 extensions. + class CertificateExtensionConstraints + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # Describes well-known X.509 extensions that can appear in a + # {::Google::Cloud::Security::PrivateCA::V1::Certificate Certificate}, not + # including the + # {::Google::Cloud::Security::PrivateCA::V1::SubjectAltNames SubjectAltNames} + # extension. + module KnownCertificateExtension + # Not specified. + KNOWN_CERTIFICATE_EXTENSION_UNSPECIFIED = 0 + + # Refers to a certificate's Key Usage extension, as described in [RFC 5280 + # section 4.2.1.3](https://tools.ietf.org/html/rfc5280#section-4.2.1.3). + # This corresponds to the + # {::Google::Cloud::Security::PrivateCA::V1::KeyUsage#base_key_usage KeyUsage.base_key_usage} + # field. + BASE_KEY_USAGE = 1 + + # Refers to a certificate's Extended Key Usage extension, as described in + # [RFC 5280 + # section 4.2.1.12](https://tools.ietf.org/html/rfc5280#section-4.2.1.12). + # This corresponds to the + # {::Google::Cloud::Security::PrivateCA::V1::KeyUsage#extended_key_usage KeyUsage.extended_key_usage} + # message. + EXTENDED_KEY_USAGE = 2 + + # Refers to a certificate's Basic Constraints extension, as described in + # [RFC 5280 + # section 4.2.1.9](https://tools.ietf.org/html/rfc5280#section-4.2.1.9). + # This corresponds to the + # {::Google::Cloud::Security::PrivateCA::V1::X509Parameters#ca_options X509Parameters.ca_options} + # field. + CA_OPTIONS = 3 + + # Refers to a certificate's Policy object identifiers, as described in + # [RFC 5280 + # section 4.2.1.4](https://tools.ietf.org/html/rfc5280#section-4.2.1.4). + # This corresponds to the + # {::Google::Cloud::Security::PrivateCA::V1::X509Parameters#policy_ids X509Parameters.policy_ids} + # field. + POLICY_IDS = 4 + + # Refers to OCSP servers in a certificate's Authority Information Access + # extension, as described in + # [RFC 5280 + # section 4.2.2.1](https://tools.ietf.org/html/rfc5280#section-4.2.2.1), + # This corresponds to the + # {::Google::Cloud::Security::PrivateCA::V1::X509Parameters#aia_ocsp_servers X509Parameters.aia_ocsp_servers} + # field. + AIA_OCSP_SERVERS = 5 + + # Refers to Name Constraints extension as described in + # [RFC 5280 + # section 4.2.1.10](https://tools.ietf.org/html/rfc5280#section-4.2.1.10) + NAME_CONSTRAINTS = 6 + end + end + + # {::Google::Cloud::Security::PrivateCA::V1::AttributeType AttributeType} specifies + # the type of Attribute in a relative distinguished name. + module AttributeType + # Attribute type is unspecified. + ATTRIBUTE_TYPE_UNSPECIFIED = 0 + + # The "common name" of the subject. + COMMON_NAME = 1 + + # The country code of the subject. + COUNTRY_CODE = 2 + + # The organization of the subject. + ORGANIZATION = 3 + + # The organizational unit of the subject. + ORGANIZATIONAL_UNIT = 4 + + # The locality or city of the subject. + LOCALITY = 5 + + # The province, territory, or regional state of the subject. + PROVINCE = 6 + + # The street address of the subject. + STREET_ADDRESS = 7 + + # The postal code of the subject. + POSTAL_CODE = 8 + end + + # A {::Google::Cloud::Security::PrivateCA::V1::RevocationReason RevocationReason} + # indicates whether a + # {::Google::Cloud::Security::PrivateCA::V1::Certificate Certificate} has been + # revoked, and the reason for revocation. These correspond to standard + # revocation reasons from RFC 5280. Note that the enum labels and values in + # this definition are not the same ASN.1 values defined in RFC 5280. These + # values will be translated to the correct ASN.1 values when a CRL is created. + module RevocationReason + # Default unspecified value. This value does indicate that a + # {::Google::Cloud::Security::PrivateCA::V1::Certificate Certificate} has been + # revoked, but that a reason has not been recorded. + REVOCATION_REASON_UNSPECIFIED = 0 + + # Key material for this + # {::Google::Cloud::Security::PrivateCA::V1::Certificate Certificate} may have + # leaked. + KEY_COMPROMISE = 1 + + # The key material for a certificate authority in the issuing path may have + # leaked. + CERTIFICATE_AUTHORITY_COMPROMISE = 2 + + # The subject or other attributes in this + # {::Google::Cloud::Security::PrivateCA::V1::Certificate Certificate} have changed. + AFFILIATION_CHANGED = 3 + + # This {::Google::Cloud::Security::PrivateCA::V1::Certificate Certificate} has been + # superseded. + SUPERSEDED = 4 + + # This {::Google::Cloud::Security::PrivateCA::V1::Certificate Certificate} or + # entities in the issuing path have ceased to operate. + CESSATION_OF_OPERATION = 5 + + # This {::Google::Cloud::Security::PrivateCA::V1::Certificate Certificate} should + # not be considered valid, it is expected that it may become valid in the + # future. + CERTIFICATE_HOLD = 6 + + # This {::Google::Cloud::Security::PrivateCA::V1::Certificate Certificate} no + # longer has permission to assert the listed attributes. + PRIVILEGE_WITHDRAWN = 7 + + # The authority which determines appropriate attributes for a + # {::Google::Cloud::Security::PrivateCA::V1::Certificate Certificate} may have been + # compromised. + ATTRIBUTE_AUTHORITY_COMPROMISE = 8 + end + + # Describes the way in which a + # {::Google::Cloud::Security::PrivateCA::V1::Certificate Certificate}'s + # {::Google::Cloud::Security::PrivateCA::V1::Subject Subject} and/or + # {::Google::Cloud::Security::PrivateCA::V1::SubjectAltNames SubjectAltNames} will be + # resolved. + module SubjectRequestMode + # Not specified. + SUBJECT_REQUEST_MODE_UNSPECIFIED = 0 + + # The default mode used in most cases. Indicates that the certificate's + # {::Google::Cloud::Security::PrivateCA::V1::Subject Subject} and/or + # {::Google::Cloud::Security::PrivateCA::V1::SubjectAltNames SubjectAltNames} are + # specified in the certificate request. This mode requires the caller to have + # the `privateca.certificates.create` permission. + DEFAULT = 1 + + # A mode used to get an accurate representation of the Subject + # field's distinguished name. Indicates that the certificate's + # {::Google::Cloud::Security::PrivateCA::V1::Subject Subject} and/or + # {::Google::Cloud::Security::PrivateCA::V1::SubjectAltNames SubjectAltNames} are + # specified in the certificate request. When parsing a PEM CSR this mode will + # maintain the sequence of RDNs found in the CSR's subject field in the + # issued {::Google::Cloud::Security::PrivateCA::V1::Certificate Certificate}. This + # mode requires the caller to have the `privateca.certificates.create` + # permission. + RDN_SEQUENCE = 3 + + # A mode reserved for special cases. Indicates that the certificate should + # have one SPIFFE + # {::Google::Cloud::Security::PrivateCA::V1::SubjectAltNames SubjectAltNames} set + # by the service based on the caller's identity. This mode will ignore any + # explicitly specified {::Google::Cloud::Security::PrivateCA::V1::Subject Subject} + # and/or + # {::Google::Cloud::Security::PrivateCA::V1::SubjectAltNames SubjectAltNames} in + # the certificate request. This mode requires the caller to have the + # `privateca.certificates.createForSelf` permission. + REFLECTED_SPIFFE = 2 + end + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-security-private_ca-v1/proto_docs/google/cloud/security/privateca/v1/service.rb b/owl-bot-staging/google-cloud-security-private_ca-v1/proto_docs/google/cloud/security/privateca/v1/service.rb new file mode 100644 index 000000000000..10d9dbfcc739 --- /dev/null +++ b/owl-bot-staging/google-cloud-security-private_ca-v1/proto_docs/google/cloud/security/privateca/v1/service.rb @@ -0,0 +1,1032 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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 Security + module PrivateCA + module V1 + # Request message for + # {::Google::Cloud::Security::PrivateCA::V1::CertificateAuthorityService::Client#create_certificate CertificateAuthorityService.CreateCertificate}. + # @!attribute [rw] parent + # @return [::String] + # Required. The resource name of the + # {::Google::Cloud::Security::PrivateCA::V1::CaPool CaPool} associated with the + # {::Google::Cloud::Security::PrivateCA::V1::Certificate Certificate}, in the + # format `projects/*/locations/*/caPools/*`. + # @!attribute [rw] certificate_id + # @return [::String] + # Optional. It must be unique within a location and match the regular + # expression `[a-zA-Z0-9_-]{1,63}`. This field is required when using a + # {::Google::Cloud::Security::PrivateCA::V1::CertificateAuthority CertificateAuthority} + # in the Enterprise + # {::Google::Cloud::Security::PrivateCA::V1::CertificateAuthority#tier CertificateAuthority.tier}, + # but is optional and its value is ignored otherwise. + # @!attribute [rw] certificate + # @return [::Google::Cloud::Security::PrivateCA::V1::Certificate] + # Required. A {::Google::Cloud::Security::PrivateCA::V1::Certificate Certificate} + # with initial field values. + # @!attribute [rw] request_id + # @return [::String] + # Optional. An ID to identify requests. Specify a unique request ID so that + # if you must retry your request, the server will know to ignore the request + # if it has already been completed. The server will guarantee that for at + # least 60 minutes since the first request. + # + # For example, consider a situation where you make an initial request and the + # request times out. If you make the request again with the same request ID, + # the server can check if original operation with the same request ID was + # received, and if so, will ignore the second request. This prevents clients + # from accidentally creating duplicate commitments. + # + # The request ID must be a valid UUID with the exception that zero UUID is + # not supported (00000000-0000-0000-0000-000000000000). + # @!attribute [rw] validate_only + # @return [::Boolean] + # Optional. If this is true, no + # {::Google::Cloud::Security::PrivateCA::V1::Certificate Certificate} resource will + # be persisted regardless of the + # {::Google::Cloud::Security::PrivateCA::V1::CaPool CaPool}'s + # {::Google::Cloud::Security::PrivateCA::V1::CaPool#tier tier}, and the returned + # {::Google::Cloud::Security::PrivateCA::V1::Certificate Certificate} will not + # contain the + # {::Google::Cloud::Security::PrivateCA::V1::Certificate#pem_certificate pem_certificate} + # field. + # @!attribute [rw] issuing_certificate_authority_id + # @return [::String] + # Optional. The resource ID of the + # {::Google::Cloud::Security::PrivateCA::V1::CertificateAuthority CertificateAuthority} + # that should issue the certificate. This optional field will ignore the + # load-balancing scheme of the Pool and directly issue the certificate from + # the CA with the specified ID, contained in the same + # {::Google::Cloud::Security::PrivateCA::V1::CaPool CaPool} referenced by `parent`. + # Per-CA quota rules apply. If left empty, a + # {::Google::Cloud::Security::PrivateCA::V1::CertificateAuthority CertificateAuthority} + # will be chosen from the {::Google::Cloud::Security::PrivateCA::V1::CaPool CaPool} + # by the service. For example, to issue a + # {::Google::Cloud::Security::PrivateCA::V1::Certificate Certificate} from a + # Certificate Authority with resource name + # "projects/my-project/locations/us-central1/caPools/my-pool/certificateAuthorities/my-ca", + # you can set the + # {::Google::Cloud::Security::PrivateCA::V1::CreateCertificateRequest#parent parent} + # to "projects/my-project/locations/us-central1/caPools/my-pool" and the + # {::Google::Cloud::Security::PrivateCA::V1::CreateCertificateRequest#issuing_certificate_authority_id issuing_certificate_authority_id} + # to "my-ca". + class CreateCertificateRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Request message for + # {::Google::Cloud::Security::PrivateCA::V1::CertificateAuthorityService::Client#get_certificate CertificateAuthorityService.GetCertificate}. + # @!attribute [rw] name + # @return [::String] + # Required. The {::Google::Cloud::Security::PrivateCA::V1::Certificate#name name} + # of the {::Google::Cloud::Security::PrivateCA::V1::Certificate Certificate} to + # get. + class GetCertificateRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Request message for + # {::Google::Cloud::Security::PrivateCA::V1::CertificateAuthorityService::Client#list_certificates CertificateAuthorityService.ListCertificates}. + # @!attribute [rw] parent + # @return [::String] + # Required. The resource name of the location associated with the + # {::Google::Cloud::Security::PrivateCA::V1::Certificate Certificates}, in the + # format `projects/*/locations/*/caPools/*`. + # @!attribute [rw] page_size + # @return [::Integer] + # Optional. Limit on the number of + # {::Google::Cloud::Security::PrivateCA::V1::Certificate Certificates} to include + # in the response. Further + # {::Google::Cloud::Security::PrivateCA::V1::Certificate Certificates} can + # subsequently be obtained by including the + # {::Google::Cloud::Security::PrivateCA::V1::ListCertificatesResponse#next_page_token ListCertificatesResponse.next_page_token} + # in a subsequent request. If unspecified, the server will pick an + # appropriate default. + # @!attribute [rw] page_token + # @return [::String] + # Optional. Pagination token, returned earlier via + # {::Google::Cloud::Security::PrivateCA::V1::ListCertificatesResponse#next_page_token ListCertificatesResponse.next_page_token}. + # @!attribute [rw] filter + # @return [::String] + # Optional. Only include resources that match the filter in the response. For + # details on supported filters and syntax, see [Certificates Filtering + # documentation](https://cloud.google.com/certificate-authority-service/docs/sorting-filtering-certificates#filtering_support). + # @!attribute [rw] order_by + # @return [::String] + # Optional. Specify how the results should be sorted. For details on + # supported fields and syntax, see [Certificates Sorting + # documentation](https://cloud.google.com/certificate-authority-service/docs/sorting-filtering-certificates#sorting_support). + class ListCertificatesRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Response message for + # {::Google::Cloud::Security::PrivateCA::V1::CertificateAuthorityService::Client#list_certificates CertificateAuthorityService.ListCertificates}. + # @!attribute [rw] certificates + # @return [::Array<::Google::Cloud::Security::PrivateCA::V1::Certificate>] + # The list of {::Google::Cloud::Security::PrivateCA::V1::Certificate Certificates}. + # @!attribute [rw] next_page_token + # @return [::String] + # A token to retrieve next page of results. Pass this value in + # {::Google::Cloud::Security::PrivateCA::V1::ListCertificatesRequest#page_token ListCertificatesRequest.page_token} + # to retrieve the next page of results. + # @!attribute [rw] unreachable + # @return [::Array<::String>] + # A list of locations (e.g. "us-west1") that could not be reached. + class ListCertificatesResponse + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Request message for + # {::Google::Cloud::Security::PrivateCA::V1::CertificateAuthorityService::Client#revoke_certificate CertificateAuthorityService.RevokeCertificate}. + # @!attribute [rw] name + # @return [::String] + # Required. The resource name for this + # {::Google::Cloud::Security::PrivateCA::V1::Certificate Certificate} in the format + # `projects/*/locations/*/caPools/*/certificates/*`. + # @!attribute [rw] reason + # @return [::Google::Cloud::Security::PrivateCA::V1::RevocationReason] + # Required. The + # {::Google::Cloud::Security::PrivateCA::V1::RevocationReason RevocationReason} for + # revoking this certificate. + # @!attribute [rw] request_id + # @return [::String] + # Optional. An ID to identify requests. Specify a unique request ID so that + # if you must retry your request, the server will know to ignore the request + # if it has already been completed. The server will guarantee that for at + # least 60 minutes since the first request. + # + # For example, consider a situation where you make an initial request and + # the request times out. If you make the request again with the same request + # ID, the server can check if original operation with the same request ID + # was received, and if so, will ignore the second request. This prevents + # clients from accidentally creating duplicate commitments. + # + # The request ID must be a valid UUID with the exception that zero UUID is + # not supported (00000000-0000-0000-0000-000000000000). + class RevokeCertificateRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Request message for + # {::Google::Cloud::Security::PrivateCA::V1::CertificateAuthorityService::Client#update_certificate CertificateAuthorityService.UpdateCertificate}. + # @!attribute [rw] certificate + # @return [::Google::Cloud::Security::PrivateCA::V1::Certificate] + # Required. {::Google::Cloud::Security::PrivateCA::V1::Certificate Certificate} + # with updated values. + # @!attribute [rw] update_mask + # @return [::Google::Protobuf::FieldMask] + # Required. A list of fields to be updated in this request. + # @!attribute [rw] request_id + # @return [::String] + # Optional. An ID to identify requests. Specify a unique request ID so that + # if you must retry your request, the server will know to ignore the request + # if it has already been completed. The server will guarantee that for at + # least 60 minutes since the first request. + # + # For example, consider a situation where you make an initial request and + # the request times out. If you make the request again with the same request + # ID, the server can check if original operation with the same request ID + # was received, and if so, will ignore the second request. This prevents + # clients from accidentally creating duplicate commitments. + # + # The request ID must be a valid UUID with the exception that zero UUID is + # not supported (00000000-0000-0000-0000-000000000000). + class UpdateCertificateRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Request message for + # {::Google::Cloud::Security::PrivateCA::V1::CertificateAuthorityService::Client#activate_certificate_authority CertificateAuthorityService.ActivateCertificateAuthority}. + # @!attribute [rw] name + # @return [::String] + # Required. The resource name for this + # {::Google::Cloud::Security::PrivateCA::V1::CertificateAuthority CertificateAuthority} + # in the format `projects/*/locations/*/caPools/*/certificateAuthorities/*`. + # @!attribute [rw] pem_ca_certificate + # @return [::String] + # Required. The signed CA certificate issued from + # {::Google::Cloud::Security::PrivateCA::V1::FetchCertificateAuthorityCsrResponse#pem_csr FetchCertificateAuthorityCsrResponse.pem_csr}. + # @!attribute [rw] subordinate_config + # @return [::Google::Cloud::Security::PrivateCA::V1::SubordinateConfig] + # Required. Must include information about the issuer of + # 'pem_ca_certificate', and any further issuers until the self-signed CA. + # @!attribute [rw] request_id + # @return [::String] + # Optional. An ID to identify requests. Specify a unique request ID so that + # if you must retry your request, the server will know to ignore the request + # if it has already been completed. The server will guarantee that for at + # least 60 minutes since the first request. + # + # For example, consider a situation where you make an initial request and + # the request times out. If you make the request again with the same request + # ID, the server can check if original operation with the same request ID + # was received, and if so, will ignore the second request. This prevents + # clients from accidentally creating duplicate commitments. + # + # The request ID must be a valid UUID with the exception that zero UUID is + # not supported (00000000-0000-0000-0000-000000000000). + class ActivateCertificateAuthorityRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Request message for + # {::Google::Cloud::Security::PrivateCA::V1::CertificateAuthorityService::Client#create_certificate_authority CertificateAuthorityService.CreateCertificateAuthority}. + # @!attribute [rw] parent + # @return [::String] + # Required. The resource name of the + # {::Google::Cloud::Security::PrivateCA::V1::CaPool CaPool} associated with the + # {::Google::Cloud::Security::PrivateCA::V1::CertificateAuthority CertificateAuthorities}, + # in the format `projects/*/locations/*/caPools/*`. + # @!attribute [rw] certificate_authority_id + # @return [::String] + # Required. It must be unique within a location and match the regular + # expression `[a-zA-Z0-9_-]{1,63}` + # @!attribute [rw] certificate_authority + # @return [::Google::Cloud::Security::PrivateCA::V1::CertificateAuthority] + # Required. A + # {::Google::Cloud::Security::PrivateCA::V1::CertificateAuthority CertificateAuthority} + # with initial field values. + # @!attribute [rw] request_id + # @return [::String] + # Optional. An ID to identify requests. Specify a unique request ID so that + # if you must retry your request, the server will know to ignore the request + # if it has already been completed. The server will guarantee that for at + # least 60 minutes since the first request. + # + # For example, consider a situation where you make an initial request and + # the request times out. If you make the request again with the same request + # ID, the server can check if original operation with the same request ID + # was received, and if so, will ignore the second request. This prevents + # clients from accidentally creating duplicate commitments. + # + # The request ID must be a valid UUID with the exception that zero UUID is + # not supported (00000000-0000-0000-0000-000000000000). + class CreateCertificateAuthorityRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Request message for + # {::Google::Cloud::Security::PrivateCA::V1::CertificateAuthorityService::Client#disable_certificate_authority CertificateAuthorityService.DisableCertificateAuthority}. + # @!attribute [rw] name + # @return [::String] + # Required. The resource name for this + # {::Google::Cloud::Security::PrivateCA::V1::CertificateAuthority CertificateAuthority} + # in the format `projects/*/locations/*/caPools/*/certificateAuthorities/*`. + # @!attribute [rw] request_id + # @return [::String] + # Optional. An ID to identify requests. Specify a unique request ID so that + # if you must retry your request, the server will know to ignore the request + # if it has already been completed. The server will guarantee that for at + # least 60 minutes since the first request. + # + # For example, consider a situation where you make an initial request and + # the request times out. If you make the request again with the same request + # ID, the server can check if original operation with the same request ID + # was received, and if so, will ignore the second request. This prevents + # clients from accidentally creating duplicate commitments. + # + # The request ID must be a valid UUID with the exception that zero UUID is + # not supported (00000000-0000-0000-0000-000000000000). + # @!attribute [rw] ignore_dependent_resources + # @return [::Boolean] + # Optional. This field allows this CA to be disabled even if it's being + # depended on by another resource. However, doing so may result in unintended + # and unrecoverable effects on any dependent resources since the CA will + # no longer be able to issue certificates. + class DisableCertificateAuthorityRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Request message for + # {::Google::Cloud::Security::PrivateCA::V1::CertificateAuthorityService::Client#enable_certificate_authority CertificateAuthorityService.EnableCertificateAuthority}. + # @!attribute [rw] name + # @return [::String] + # Required. The resource name for this + # {::Google::Cloud::Security::PrivateCA::V1::CertificateAuthority CertificateAuthority} + # in the format `projects/*/locations/*/caPools/*/certificateAuthorities/*`. + # @!attribute [rw] request_id + # @return [::String] + # Optional. An ID to identify requests. Specify a unique request ID so that + # if you must retry your request, the server will know to ignore the request + # if it has already been completed. The server will guarantee that for at + # least 60 minutes since the first request. + # + # For example, consider a situation where you make an initial request and + # the request times out. If you make the request again with the same request + # ID, the server can check if original operation with the same request ID + # was received, and if so, will ignore the second request. This prevents + # clients from accidentally creating duplicate commitments. + # + # The request ID must be a valid UUID with the exception that zero UUID is + # not supported (00000000-0000-0000-0000-000000000000). + class EnableCertificateAuthorityRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Request message for + # {::Google::Cloud::Security::PrivateCA::V1::CertificateAuthorityService::Client#fetch_certificate_authority_csr CertificateAuthorityService.FetchCertificateAuthorityCsr}. + # @!attribute [rw] name + # @return [::String] + # Required. The resource name for this + # {::Google::Cloud::Security::PrivateCA::V1::CertificateAuthority CertificateAuthority} + # in the format `projects/*/locations/*/caPools/*/certificateAuthorities/*`. + class FetchCertificateAuthorityCsrRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Response message for + # {::Google::Cloud::Security::PrivateCA::V1::CertificateAuthorityService::Client#fetch_certificate_authority_csr CertificateAuthorityService.FetchCertificateAuthorityCsr}. + # @!attribute [r] pem_csr + # @return [::String] + # Output only. The PEM-encoded signed certificate signing request (CSR). + class FetchCertificateAuthorityCsrResponse + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Request message for + # {::Google::Cloud::Security::PrivateCA::V1::CertificateAuthorityService::Client#get_certificate_authority CertificateAuthorityService.GetCertificateAuthority}. + # @!attribute [rw] name + # @return [::String] + # Required. The + # {::Google::Cloud::Security::PrivateCA::V1::CertificateAuthority#name name} of the + # {::Google::Cloud::Security::PrivateCA::V1::CertificateAuthority CertificateAuthority} + # to get. + class GetCertificateAuthorityRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Request message for + # {::Google::Cloud::Security::PrivateCA::V1::CertificateAuthorityService::Client#list_certificate_authorities CertificateAuthorityService.ListCertificateAuthorities}. + # @!attribute [rw] parent + # @return [::String] + # Required. The resource name of the + # {::Google::Cloud::Security::PrivateCA::V1::CaPool CaPool} associated with the + # {::Google::Cloud::Security::PrivateCA::V1::CertificateAuthority CertificateAuthorities}, + # in the format `projects/*/locations/*/caPools/*`. + # @!attribute [rw] page_size + # @return [::Integer] + # Optional. Limit on the number of + # {::Google::Cloud::Security::PrivateCA::V1::CertificateAuthority CertificateAuthorities} + # to include in the response. Further + # {::Google::Cloud::Security::PrivateCA::V1::CertificateAuthority CertificateAuthorities} + # can subsequently be obtained by including the + # {::Google::Cloud::Security::PrivateCA::V1::ListCertificateAuthoritiesResponse#next_page_token ListCertificateAuthoritiesResponse.next_page_token} + # in a subsequent request. If unspecified, the server will pick an + # appropriate default. + # @!attribute [rw] page_token + # @return [::String] + # Optional. Pagination token, returned earlier via + # {::Google::Cloud::Security::PrivateCA::V1::ListCertificateAuthoritiesResponse#next_page_token ListCertificateAuthoritiesResponse.next_page_token}. + # @!attribute [rw] filter + # @return [::String] + # Optional. Only include resources that match the filter in the response. + # @!attribute [rw] order_by + # @return [::String] + # Optional. Specify how the results should be sorted. + class ListCertificateAuthoritiesRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Response message for + # {::Google::Cloud::Security::PrivateCA::V1::CertificateAuthorityService::Client#list_certificate_authorities CertificateAuthorityService.ListCertificateAuthorities}. + # @!attribute [rw] certificate_authorities + # @return [::Array<::Google::Cloud::Security::PrivateCA::V1::CertificateAuthority>] + # The list of + # {::Google::Cloud::Security::PrivateCA::V1::CertificateAuthority CertificateAuthorities}. + # @!attribute [rw] next_page_token + # @return [::String] + # A token to retrieve next page of results. Pass this value in + # {::Google::Cloud::Security::PrivateCA::V1::ListCertificateAuthoritiesRequest#page_token ListCertificateAuthoritiesRequest.page_token} + # to retrieve the next page of results. + # @!attribute [rw] unreachable + # @return [::Array<::String>] + # A list of locations (e.g. "us-west1") that could not be reached. + class ListCertificateAuthoritiesResponse + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Request message for + # {::Google::Cloud::Security::PrivateCA::V1::CertificateAuthorityService::Client#undelete_certificate_authority CertificateAuthorityService.UndeleteCertificateAuthority}. + # @!attribute [rw] name + # @return [::String] + # Required. The resource name for this + # {::Google::Cloud::Security::PrivateCA::V1::CertificateAuthority CertificateAuthority} + # in the format `projects/*/locations/*/caPools/*/certificateAuthorities/*`. + # @!attribute [rw] request_id + # @return [::String] + # Optional. An ID to identify requests. Specify a unique request ID so that + # if you must retry your request, the server will know to ignore the request + # if it has already been completed. The server will guarantee that for at + # least 60 minutes since the first request. + # + # For example, consider a situation where you make an initial request and + # the request times out. If you make the request again with the same request + # ID, the server can check if original operation with the same request ID + # was received, and if so, will ignore the second request. This prevents + # clients from accidentally creating duplicate commitments. + # + # The request ID must be a valid UUID with the exception that zero UUID is + # not supported (00000000-0000-0000-0000-000000000000). + class UndeleteCertificateAuthorityRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Request message for + # {::Google::Cloud::Security::PrivateCA::V1::CertificateAuthorityService::Client#delete_certificate_authority CertificateAuthorityService.DeleteCertificateAuthority}. + # @!attribute [rw] name + # @return [::String] + # Required. The resource name for this + # {::Google::Cloud::Security::PrivateCA::V1::CertificateAuthority CertificateAuthority} + # in the format `projects/*/locations/*/caPools/*/certificateAuthorities/*`. + # @!attribute [rw] request_id + # @return [::String] + # Optional. An ID to identify requests. Specify a unique request ID so that + # if you must retry your request, the server will know to ignore the request + # if it has already been completed. The server will guarantee that for at + # least 60 minutes since the first request. + # + # For example, consider a situation where you make an initial request and + # the request times out. If you make the request again with the same request + # ID, the server can check if original operation with the same request ID + # was received, and if so, will ignore the second request. This prevents + # clients from accidentally creating duplicate commitments. + # + # The request ID must be a valid UUID with the exception that zero UUID is + # not supported (00000000-0000-0000-0000-000000000000). + # @!attribute [rw] ignore_active_certificates + # @return [::Boolean] + # Optional. This field allows the CA to be deleted even if the CA has + # active certs. Active certs include both unrevoked and unexpired certs. + # @!attribute [rw] skip_grace_period + # @return [::Boolean] + # Optional. If this flag is set, the Certificate Authority will be deleted as + # soon as possible without a 30-day grace period where undeletion would have + # been allowed. If you proceed, there will be no way to recover this CA. + # @!attribute [rw] ignore_dependent_resources + # @return [::Boolean] + # Optional. This field allows this CA to be deleted even if it's being + # depended on by another resource. However, doing so may result in unintended + # and unrecoverable effects on any dependent resources since the CA will + # no longer be able to issue certificates. + class DeleteCertificateAuthorityRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Request message for + # {::Google::Cloud::Security::PrivateCA::V1::CertificateAuthorityService::Client#update_certificate_authority CertificateAuthorityService.UpdateCertificateAuthority}. + # @!attribute [rw] certificate_authority + # @return [::Google::Cloud::Security::PrivateCA::V1::CertificateAuthority] + # Required. + # {::Google::Cloud::Security::PrivateCA::V1::CertificateAuthority CertificateAuthority} + # with updated values. + # @!attribute [rw] update_mask + # @return [::Google::Protobuf::FieldMask] + # Required. A list of fields to be updated in this request. + # @!attribute [rw] request_id + # @return [::String] + # Optional. An ID to identify requests. Specify a unique request ID so that + # if you must retry your request, the server will know to ignore the request + # if it has already been completed. The server will guarantee that for at + # least 60 minutes since the first request. + # + # For example, consider a situation where you make an initial request and + # the request times out. If you make the request again with the same request + # ID, the server can check if original operation with the same request ID + # was received, and if so, will ignore the second request. This prevents + # clients from accidentally creating duplicate commitments. + # + # The request ID must be a valid UUID with the exception that zero UUID is + # not supported (00000000-0000-0000-0000-000000000000). + class UpdateCertificateAuthorityRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Request message for + # {::Google::Cloud::Security::PrivateCA::V1::CertificateAuthorityService::Client#create_ca_pool CertificateAuthorityService.CreateCaPool}. + # @!attribute [rw] parent + # @return [::String] + # Required. The resource name of the location associated with the + # {::Google::Cloud::Security::PrivateCA::V1::CaPool CaPool}, in the format + # `projects/*/locations/*`. + # @!attribute [rw] ca_pool_id + # @return [::String] + # Required. It must be unique within a location and match the regular + # expression `[a-zA-Z0-9_-]{1,63}` + # @!attribute [rw] ca_pool + # @return [::Google::Cloud::Security::PrivateCA::V1::CaPool] + # Required. A {::Google::Cloud::Security::PrivateCA::V1::CaPool CaPool} with + # initial field values. + # @!attribute [rw] request_id + # @return [::String] + # Optional. An ID to identify requests. Specify a unique request ID so that + # if you must retry your request, the server will know to ignore the request + # if it has already been completed. The server will guarantee that for at + # least 60 minutes since the first request. + # + # For example, consider a situation where you make an initial request and + # the request times out. If you make the request again with the same request + # ID, the server can check if original operation with the same request ID + # was received, and if so, will ignore the second request. This prevents + # clients from accidentally creating duplicate commitments. + # + # The request ID must be a valid UUID with the exception that zero UUID is + # not supported (00000000-0000-0000-0000-000000000000). + class CreateCaPoolRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Request message for + # {::Google::Cloud::Security::PrivateCA::V1::CertificateAuthorityService::Client#update_ca_pool CertificateAuthorityService.UpdateCaPool}. + # @!attribute [rw] ca_pool + # @return [::Google::Cloud::Security::PrivateCA::V1::CaPool] + # Required. {::Google::Cloud::Security::PrivateCA::V1::CaPool CaPool} with updated + # values. + # @!attribute [rw] update_mask + # @return [::Google::Protobuf::FieldMask] + # Required. A list of fields to be updated in this request. + # @!attribute [rw] request_id + # @return [::String] + # Optional. An ID to identify requests. Specify a unique request ID so that + # if you must retry your request, the server will know to ignore the request + # if it has already been completed. The server will guarantee that for at + # least 60 minutes since the first request. + # + # For example, consider a situation where you make an initial request and + # the request times out. If you make the request again with the same request + # ID, the server can check if original operation with the same request ID + # was received, and if so, will ignore the second request. This prevents + # clients from accidentally creating duplicate commitments. + # + # The request ID must be a valid UUID with the exception that zero UUID is + # not supported (00000000-0000-0000-0000-000000000000). + class UpdateCaPoolRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Request message for + # {::Google::Cloud::Security::PrivateCA::V1::CertificateAuthorityService::Client#delete_ca_pool CertificateAuthorityService.DeleteCaPool}. + # @!attribute [rw] name + # @return [::String] + # Required. The resource name for this + # {::Google::Cloud::Security::PrivateCA::V1::CaPool CaPool} in the format + # `projects/*/locations/*/caPools/*`. + # @!attribute [rw] request_id + # @return [::String] + # Optional. An ID to identify requests. Specify a unique request ID so that + # if you must retry your request, the server will know to ignore the request + # if it has already been completed. The server will guarantee that for at + # least 60 minutes since the first request. + # + # For example, consider a situation where you make an initial request and + # the request times out. If you make the request again with the same request + # ID, the server can check if original operation with the same request ID + # was received, and if so, will ignore the second request. This prevents + # clients from accidentally creating duplicate commitments. + # + # The request ID must be a valid UUID with the exception that zero UUID is + # not supported (00000000-0000-0000-0000-000000000000). + # @!attribute [rw] ignore_dependent_resources + # @return [::Boolean] + # Optional. This field allows this pool to be deleted even if it's being + # depended on by another resource. However, doing so may result in unintended + # and unrecoverable effects on any dependent resources since the pool will + # no longer be able to issue certificates. + class DeleteCaPoolRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Request message for + # {::Google::Cloud::Security::PrivateCA::V1::CertificateAuthorityService::Client#fetch_ca_certs CertificateAuthorityService.FetchCaCerts}. + # @!attribute [rw] ca_pool + # @return [::String] + # Required. The resource name for the + # {::Google::Cloud::Security::PrivateCA::V1::CaPool CaPool} in the format + # `projects/*/locations/*/caPools/*`. + # @!attribute [rw] request_id + # @return [::String] + # Optional. An ID to identify requests. Specify a unique request ID so that + # if you must retry your request, the server will know to ignore the request + # if it has already been completed. The server will guarantee that for at + # least 60 minutes since the first request. + # + # For example, consider a situation where you make an initial request and + # the request times out. If you make the request again with the same request + # ID, the server can check if original operation with the same request ID + # was received, and if so, will ignore the second request. This prevents + # clients from accidentally creating duplicate commitments. + # + # The request ID must be a valid UUID with the exception that zero UUID is + # not supported (00000000-0000-0000-0000-000000000000). + class FetchCaCertsRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Response message for + # {::Google::Cloud::Security::PrivateCA::V1::CertificateAuthorityService::Client#fetch_ca_certs CertificateAuthorityService.FetchCaCerts}. + # @!attribute [rw] ca_certs + # @return [::Array<::Google::Cloud::Security::PrivateCA::V1::FetchCaCertsResponse::CertChain>] + # The PEM encoded CA certificate chains of all certificate authorities in + # this {::Google::Cloud::Security::PrivateCA::V1::CaPool CaPool} in the ENABLED, + # DISABLED, or STAGED states. + class FetchCaCertsResponse + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # @!attribute [rw] certificates + # @return [::Array<::String>] + # The certificates that form the CA chain, from leaf to root order. + class CertChain + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end + + # Request message for + # {::Google::Cloud::Security::PrivateCA::V1::CertificateAuthorityService::Client#get_ca_pool CertificateAuthorityService.GetCaPool}. + # @!attribute [rw] name + # @return [::String] + # Required. The {::Google::Cloud::Security::PrivateCA::V1::CaPool#name name} of the + # {::Google::Cloud::Security::PrivateCA::V1::CaPool CaPool} to get. + class GetCaPoolRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Request message for + # {::Google::Cloud::Security::PrivateCA::V1::CertificateAuthorityService::Client#list_ca_pools CertificateAuthorityService.ListCaPools}. + # @!attribute [rw] parent + # @return [::String] + # Required. The resource name of the location associated with the + # {::Google::Cloud::Security::PrivateCA::V1::CaPool CaPools}, in the format + # `projects/*/locations/*`. + # @!attribute [rw] page_size + # @return [::Integer] + # Optional. Limit on the number of + # {::Google::Cloud::Security::PrivateCA::V1::CaPool CaPools} to include in the + # response. Further {::Google::Cloud::Security::PrivateCA::V1::CaPool CaPools} can + # subsequently be obtained by including the + # {::Google::Cloud::Security::PrivateCA::V1::ListCaPoolsResponse#next_page_token ListCaPoolsResponse.next_page_token} + # in a subsequent request. If unspecified, the server will pick an + # appropriate default. + # @!attribute [rw] page_token + # @return [::String] + # Optional. Pagination token, returned earlier via + # {::Google::Cloud::Security::PrivateCA::V1::ListCaPoolsResponse#next_page_token ListCaPoolsResponse.next_page_token}. + # @!attribute [rw] filter + # @return [::String] + # Optional. Only include resources that match the filter in the response. + # @!attribute [rw] order_by + # @return [::String] + # Optional. Specify how the results should be sorted. + class ListCaPoolsRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Response message for + # {::Google::Cloud::Security::PrivateCA::V1::CertificateAuthorityService::Client#list_ca_pools CertificateAuthorityService.ListCaPools}. + # @!attribute [rw] ca_pools + # @return [::Array<::Google::Cloud::Security::PrivateCA::V1::CaPool>] + # The list of {::Google::Cloud::Security::PrivateCA::V1::CaPool CaPools}. + # @!attribute [rw] next_page_token + # @return [::String] + # A token to retrieve next page of results. Pass this value in + # {::Google::Cloud::Security::PrivateCA::V1::ListCertificateAuthoritiesRequest#page_token ListCertificateAuthoritiesRequest.page_token} + # to retrieve the next page of results. + # @!attribute [rw] unreachable + # @return [::Array<::String>] + # A list of locations (e.g. "us-west1") that could not be reached. + class ListCaPoolsResponse + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Request message for + # {::Google::Cloud::Security::PrivateCA::V1::CertificateAuthorityService::Client#get_certificate_revocation_list CertificateAuthorityService.GetCertificateRevocationList}. + # @!attribute [rw] name + # @return [::String] + # Required. The + # {::Google::Cloud::Security::PrivateCA::V1::CertificateRevocationList#name name} + # of the + # {::Google::Cloud::Security::PrivateCA::V1::CertificateRevocationList CertificateRevocationList} + # to get. + class GetCertificateRevocationListRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Request message for + # {::Google::Cloud::Security::PrivateCA::V1::CertificateAuthorityService::Client#list_certificate_revocation_lists CertificateAuthorityService.ListCertificateRevocationLists}. + # @!attribute [rw] parent + # @return [::String] + # Required. The resource name of the location associated with the + # {::Google::Cloud::Security::PrivateCA::V1::CertificateRevocationList CertificateRevocationLists}, + # in the format `projects/*/locations/*/caPools/*/certificateAuthorities/*`. + # @!attribute [rw] page_size + # @return [::Integer] + # Optional. Limit on the number of + # {::Google::Cloud::Security::PrivateCA::V1::CertificateRevocationList CertificateRevocationLists} + # to include in the response. Further + # {::Google::Cloud::Security::PrivateCA::V1::CertificateRevocationList CertificateRevocationLists} + # can subsequently be obtained by including the + # {::Google::Cloud::Security::PrivateCA::V1::ListCertificateRevocationListsResponse#next_page_token ListCertificateRevocationListsResponse.next_page_token} + # in a subsequent request. If unspecified, the server will pick an + # appropriate default. + # @!attribute [rw] page_token + # @return [::String] + # Optional. Pagination token, returned earlier via + # {::Google::Cloud::Security::PrivateCA::V1::ListCertificateRevocationListsResponse#next_page_token ListCertificateRevocationListsResponse.next_page_token}. + # @!attribute [rw] filter + # @return [::String] + # Optional. Only include resources that match the filter in the response. + # @!attribute [rw] order_by + # @return [::String] + # Optional. Specify how the results should be sorted. + class ListCertificateRevocationListsRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Response message for + # {::Google::Cloud::Security::PrivateCA::V1::CertificateAuthorityService::Client#list_certificate_revocation_lists CertificateAuthorityService.ListCertificateRevocationLists}. + # @!attribute [rw] certificate_revocation_lists + # @return [::Array<::Google::Cloud::Security::PrivateCA::V1::CertificateRevocationList>] + # The list of + # {::Google::Cloud::Security::PrivateCA::V1::CertificateRevocationList CertificateRevocationLists}. + # @!attribute [rw] next_page_token + # @return [::String] + # A token to retrieve next page of results. Pass this value in + # {::Google::Cloud::Security::PrivateCA::V1::ListCertificateRevocationListsRequest#page_token ListCertificateRevocationListsRequest.page_token} + # to retrieve the next page of results. + # @!attribute [rw] unreachable + # @return [::Array<::String>] + # A list of locations (e.g. "us-west1") that could not be reached. + class ListCertificateRevocationListsResponse + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Request message for + # {::Google::Cloud::Security::PrivateCA::V1::CertificateAuthorityService::Client#update_certificate_revocation_list CertificateAuthorityService.UpdateCertificateRevocationList}. + # @!attribute [rw] certificate_revocation_list + # @return [::Google::Cloud::Security::PrivateCA::V1::CertificateRevocationList] + # Required. + # {::Google::Cloud::Security::PrivateCA::V1::CertificateRevocationList CertificateRevocationList} + # with updated values. + # @!attribute [rw] update_mask + # @return [::Google::Protobuf::FieldMask] + # Required. A list of fields to be updated in this request. + # @!attribute [rw] request_id + # @return [::String] + # Optional. An ID to identify requests. Specify a unique request ID so that + # if you must retry your request, the server will know to ignore the request + # if it has already been completed. The server will guarantee that for at + # least 60 minutes since the first request. + # + # For example, consider a situation where you make an initial request and + # the request times out. If you make the request again with the same request + # ID, the server can check if original operation with the same request ID + # was received, and if so, will ignore the second request. This prevents + # clients from accidentally creating duplicate commitments. + # + # The request ID must be a valid UUID with the exception that zero UUID is + # not supported (00000000-0000-0000-0000-000000000000). + class UpdateCertificateRevocationListRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Request message for + # {::Google::Cloud::Security::PrivateCA::V1::CertificateAuthorityService::Client#create_certificate_template CertificateAuthorityService.CreateCertificateTemplate}. + # @!attribute [rw] parent + # @return [::String] + # Required. The resource name of the location associated with the + # {::Google::Cloud::Security::PrivateCA::V1::CertificateTemplate CertificateTemplate}, + # in the format `projects/*/locations/*`. + # @!attribute [rw] certificate_template_id + # @return [::String] + # Required. It must be unique within a location and match the regular + # expression `[a-zA-Z0-9_-]{1,63}` + # @!attribute [rw] certificate_template + # @return [::Google::Cloud::Security::PrivateCA::V1::CertificateTemplate] + # Required. A + # {::Google::Cloud::Security::PrivateCA::V1::CertificateTemplate CertificateTemplate} + # with initial field values. + # @!attribute [rw] request_id + # @return [::String] + # Optional. An ID to identify requests. Specify a unique request ID so that + # if you must retry your request, the server will know to ignore the request + # if it has already been completed. The server will guarantee that for at + # least 60 minutes since the first request. + # + # For example, consider a situation where you make an initial request and + # the request times out. If you make the request again with the same request + # ID, the server can check if original operation with the same request ID + # was received, and if so, will ignore the second request. This prevents + # clients from accidentally creating duplicate commitments. + # + # The request ID must be a valid UUID with the exception that zero UUID is + # not supported (00000000-0000-0000-0000-000000000000). + class CreateCertificateTemplateRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Request message for + # {::Google::Cloud::Security::PrivateCA::V1::CertificateAuthorityService::Client#delete_certificate_template CertificateAuthorityService.DeleteCertificateTemplate}. + # @!attribute [rw] name + # @return [::String] + # Required. The resource name for this + # {::Google::Cloud::Security::PrivateCA::V1::CertificateTemplate CertificateTemplate} + # in the format `projects/*/locations/*/certificateTemplates/*`. + # @!attribute [rw] request_id + # @return [::String] + # Optional. An ID to identify requests. Specify a unique request ID so that + # if you must retry your request, the server will know to ignore the request + # if it has already been completed. The server will guarantee that for at + # least 60 minutes since the first request. + # + # For example, consider a situation where you make an initial request and + # the request times out. If you make the request again with the same request + # ID, the server can check if original operation with the same request ID + # was received, and if so, will ignore the second request. This prevents + # clients from accidentally creating duplicate commitments. + # + # The request ID must be a valid UUID with the exception that zero UUID is + # not supported (00000000-0000-0000-0000-000000000000). + class DeleteCertificateTemplateRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Request message for + # {::Google::Cloud::Security::PrivateCA::V1::CertificateAuthorityService::Client#get_certificate_template CertificateAuthorityService.GetCertificateTemplate}. + # @!attribute [rw] name + # @return [::String] + # Required. The + # {::Google::Cloud::Security::PrivateCA::V1::CertificateTemplate#name name} of the + # {::Google::Cloud::Security::PrivateCA::V1::CertificateTemplate CertificateTemplate} + # to get. + class GetCertificateTemplateRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Request message for + # {::Google::Cloud::Security::PrivateCA::V1::CertificateAuthorityService::Client#list_certificate_templates CertificateAuthorityService.ListCertificateTemplates}. + # @!attribute [rw] parent + # @return [::String] + # Required. The resource name of the location associated with the + # {::Google::Cloud::Security::PrivateCA::V1::CertificateTemplate CertificateTemplates}, + # in the format `projects/*/locations/*`. + # @!attribute [rw] page_size + # @return [::Integer] + # Optional. Limit on the number of + # {::Google::Cloud::Security::PrivateCA::V1::CertificateTemplate CertificateTemplates} + # to include in the response. Further + # {::Google::Cloud::Security::PrivateCA::V1::CertificateTemplate CertificateTemplates} + # can subsequently be obtained by including the + # {::Google::Cloud::Security::PrivateCA::V1::ListCertificateTemplatesResponse#next_page_token ListCertificateTemplatesResponse.next_page_token} + # in a subsequent request. If unspecified, the server will pick an + # appropriate default. + # @!attribute [rw] page_token + # @return [::String] + # Optional. Pagination token, returned earlier via + # {::Google::Cloud::Security::PrivateCA::V1::ListCertificateTemplatesResponse#next_page_token ListCertificateTemplatesResponse.next_page_token}. + # @!attribute [rw] filter + # @return [::String] + # Optional. Only include resources that match the filter in the response. + # @!attribute [rw] order_by + # @return [::String] + # Optional. Specify how the results should be sorted. + class ListCertificateTemplatesRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Response message for + # {::Google::Cloud::Security::PrivateCA::V1::CertificateAuthorityService::Client#list_certificate_templates CertificateAuthorityService.ListCertificateTemplates}. + # @!attribute [rw] certificate_templates + # @return [::Array<::Google::Cloud::Security::PrivateCA::V1::CertificateTemplate>] + # The list of + # {::Google::Cloud::Security::PrivateCA::V1::CertificateTemplate CertificateTemplates}. + # @!attribute [rw] next_page_token + # @return [::String] + # A token to retrieve next page of results. Pass this value in + # {::Google::Cloud::Security::PrivateCA::V1::ListCertificateTemplatesRequest#page_token ListCertificateTemplatesRequest.page_token} + # to retrieve the next page of results. + # @!attribute [rw] unreachable + # @return [::Array<::String>] + # A list of locations (e.g. "us-west1") that could not be reached. + class ListCertificateTemplatesResponse + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Request message for + # {::Google::Cloud::Security::PrivateCA::V1::CertificateAuthorityService::Client#update_certificate_template CertificateAuthorityService.UpdateCertificateTemplate}. + # @!attribute [rw] certificate_template + # @return [::Google::Cloud::Security::PrivateCA::V1::CertificateTemplate] + # Required. + # {::Google::Cloud::Security::PrivateCA::V1::CertificateTemplate CertificateTemplate} + # with updated values. + # @!attribute [rw] update_mask + # @return [::Google::Protobuf::FieldMask] + # Required. A list of fields to be updated in this request. + # @!attribute [rw] request_id + # @return [::String] + # Optional. An ID to identify requests. Specify a unique request ID so that + # if you must retry your request, the server will know to ignore the request + # if it has already been completed. The server will guarantee that for at + # least 60 minutes since the first request. + # + # For example, consider a situation where you make an initial request and + # the request times out. If you make the request again with the same request + # ID, the server can check if original operation with the same request ID + # was received, and if so, will ignore the second request. This prevents + # clients from accidentally creating duplicate commitments. + # + # The request ID must be a valid UUID with the exception that zero UUID is + # not supported (00000000-0000-0000-0000-000000000000). + class UpdateCertificateTemplateRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Represents the metadata of the long-running operation. + # @!attribute [r] create_time + # @return [::Google::Protobuf::Timestamp] + # Output only. The time the operation was created. + # @!attribute [r] end_time + # @return [::Google::Protobuf::Timestamp] + # Output only. The time the operation finished running. + # @!attribute [r] target + # @return [::String] + # Output only. Server-defined resource path for the target of the operation. + # @!attribute [r] verb + # @return [::String] + # Output only. Name of the verb executed by the operation. + # @!attribute [r] status_message + # @return [::String] + # Output only. Human-readable status of the operation, if any. + # @!attribute [r] requested_cancellation + # @return [::Boolean] + # Output only. Identifies whether the user has requested cancellation + # of the operation. Operations that have successfully been cancelled + # have + # {::Google::Longrunning::Operation#error google.longrunning.Operation.error} + # value with a {::Google::Rpc::Status#code google.rpc.Status.code} of 1, + # corresponding to `Code.CANCELLED`. + # @!attribute [r] api_version + # @return [::String] + # Output only. API version used to start the operation. + class OperationMetadata + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-security-private_ca-v1/proto_docs/google/longrunning/operations.rb b/owl-bot-staging/google-cloud-security-private_ca-v1/proto_docs/google/longrunning/operations.rb new file mode 100644 index 000000000000..7a757f512165 --- /dev/null +++ b/owl-bot-staging/google-cloud-security-private_ca-v1/proto_docs/google/longrunning/operations.rb @@ -0,0 +1,191 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + + +module Google + module Longrunning + # This resource represents a long-running operation that is the result of a + # network API call. + # @!attribute [rw] name + # @return [::String] + # The server-assigned name, which is only unique within the same service that + # originally returns it. If you use the default HTTP mapping, the + # `name` should be a resource name ending with `operations/{unique_id}`. + # @!attribute [rw] metadata + # @return [::Google::Protobuf::Any] + # Service-specific metadata associated with the operation. It typically + # contains progress information and common metadata such as create time. + # Some services might not provide such metadata. Any method that returns a + # long-running operation should document the metadata type, if any. + # @!attribute [rw] done + # @return [::Boolean] + # If the value is `false`, it means the operation is still in progress. + # If `true`, the operation is completed, and either `error` or `response` is + # available. + # @!attribute [rw] error + # @return [::Google::Rpc::Status] + # The error result of the operation in case of failure or cancellation. + # + # Note: The following fields are mutually exclusive: `error`, `response`. If a field in that set is populated, all other fields in the set will automatically be cleared. + # @!attribute [rw] response + # @return [::Google::Protobuf::Any] + # The normal, successful response of the operation. If the original + # method returns no data on success, such as `Delete`, the response is + # `google.protobuf.Empty`. If the original method is standard + # `Get`/`Create`/`Update`, the response should be the resource. For other + # methods, the response should have the type `XxxResponse`, where `Xxx` + # is the original method name. For example, if the original method name + # is `TakeSnapshot()`, the inferred response type is + # `TakeSnapshotResponse`. + # + # Note: The following fields are mutually exclusive: `response`, `error`. If a field in that set is populated, all other fields in the set will automatically be cleared. + class Operation + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # The request message for + # Operations.GetOperation. + # @!attribute [rw] name + # @return [::String] + # The name of the operation resource. + class GetOperationRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # The request message for + # Operations.ListOperations. + # @!attribute [rw] name + # @return [::String] + # The name of the operation's parent resource. + # @!attribute [rw] filter + # @return [::String] + # The standard list filter. + # @!attribute [rw] page_size + # @return [::Integer] + # The standard list page size. + # @!attribute [rw] page_token + # @return [::String] + # The standard list page token. + # @!attribute [rw] return_partial_success + # @return [::Boolean] + # When set to `true`, operations that are reachable are returned as normal, + # and those that are unreachable are returned in the + # [ListOperationsResponse.unreachable] field. + # + # This can only be `true` when reading across collections e.g. when `parent` + # is set to `"projects/example/locations/-"`. + # + # This field is not by default supported and will result in an + # `UNIMPLEMENTED` error if set unless explicitly documented otherwise in + # service or product specific documentation. + class ListOperationsRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # The response message for + # Operations.ListOperations. + # @!attribute [rw] operations + # @return [::Array<::Google::Longrunning::Operation>] + # A list of operations that matches the specified filter in the request. + # @!attribute [rw] next_page_token + # @return [::String] + # The standard List next-page token. + # @!attribute [rw] unreachable + # @return [::Array<::String>] + # Unordered list. Unreachable resources. Populated when the request sets + # `ListOperationsRequest.return_partial_success` and reads across + # collections e.g. when attempting to list all resources across all supported + # locations. + class ListOperationsResponse + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # The request message for + # Operations.CancelOperation. + # @!attribute [rw] name + # @return [::String] + # The name of the operation resource to be cancelled. + class CancelOperationRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # The request message for + # Operations.DeleteOperation. + # @!attribute [rw] name + # @return [::String] + # The name of the operation resource to be deleted. + class DeleteOperationRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # The request message for + # Operations.WaitOperation. + # @!attribute [rw] name + # @return [::String] + # The name of the operation resource to wait on. + # @!attribute [rw] timeout + # @return [::Google::Protobuf::Duration] + # The maximum duration to wait before timing out. If left blank, the wait + # will be at most the time permitted by the underlying HTTP/RPC protocol. + # If RPC context deadline is also specified, the shorter one will be used. + class WaitOperationRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # A message representing the message types used by a long-running operation. + # + # Example: + # + # rpc Export(ExportRequest) returns (google.longrunning.Operation) { + # option (google.longrunning.operation_info) = { + # response_type: "ExportResponse" + # metadata_type: "ExportMetadata" + # }; + # } + # @!attribute [rw] response_type + # @return [::String] + # Required. The message name of the primary return type for this + # long-running operation. + # This type will be used to deserialize the LRO's response. + # + # If the response is in a different package from the rpc, a fully-qualified + # message name must be used (e.g. `google.protobuf.Struct`). + # + # Note: Altering this value constitutes a breaking change. + # @!attribute [rw] metadata_type + # @return [::String] + # Required. The message name of the metadata type for this long-running + # operation. + # + # If the response is in a different package from the rpc, a fully-qualified + # message name must be used (e.g. `google.protobuf.Struct`). + # + # Note: Altering this value constitutes a breaking change. + class OperationInfo + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end +end diff --git a/owl-bot-staging/google-cloud-security-private_ca-v1/proto_docs/google/protobuf/any.rb b/owl-bot-staging/google-cloud-security-private_ca-v1/proto_docs/google/protobuf/any.rb new file mode 100644 index 000000000000..58691995f02e --- /dev/null +++ b/owl-bot-staging/google-cloud-security-private_ca-v1/proto_docs/google/protobuf/any.rb @@ -0,0 +1,145 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + + +module Google + module Protobuf + # `Any` contains an arbitrary serialized protocol buffer message along with a + # URL that describes the type of the serialized message. + # + # Protobuf library provides support to pack/unpack Any values in the form + # of utility functions or additional generated methods of the Any type. + # + # Example 1: Pack and unpack a message in C++. + # + # Foo foo = ...; + # Any any; + # any.PackFrom(foo); + # ... + # if (any.UnpackTo(&foo)) { + # ... + # } + # + # Example 2: Pack and unpack a message in Java. + # + # Foo foo = ...; + # Any any = Any.pack(foo); + # ... + # if (any.is(Foo.class)) { + # foo = any.unpack(Foo.class); + # } + # // or ... + # if (any.isSameTypeAs(Foo.getDefaultInstance())) { + # foo = any.unpack(Foo.getDefaultInstance()); + # } + # + # Example 3: Pack and unpack a message in Python. + # + # foo = Foo(...) + # any = Any() + # any.Pack(foo) + # ... + # if any.Is(Foo.DESCRIPTOR): + # any.Unpack(foo) + # ... + # + # Example 4: Pack and unpack a message in Go + # + # foo := &pb.Foo{...} + # any, err := anypb.New(foo) + # if err != nil { + # ... + # } + # ... + # foo := &pb.Foo{} + # if err := any.UnmarshalTo(foo); err != nil { + # ... + # } + # + # The pack methods provided by protobuf library will by default use + # 'type.googleapis.com/full.type.name' as the type URL and the unpack + # methods only use the fully qualified type name after the last '/' + # in the type URL, for example "foo.bar.com/x/y.z" will yield type + # name "y.z". + # + # JSON + # ==== + # The JSON representation of an `Any` value uses the regular + # representation of the deserialized, embedded message, with an + # additional field `@type` which contains the type URL. Example: + # + # package google.profile; + # message Person { + # string first_name = 1; + # string last_name = 2; + # } + # + # { + # "@type": "type.googleapis.com/google.profile.Person", + # "firstName": , + # "lastName": + # } + # + # If the embedded message type is well-known and has a custom JSON + # representation, that representation will be embedded adding a field + # `value` which holds the custom JSON in addition to the `@type` + # field. Example (for message [google.protobuf.Duration][]): + # + # { + # "@type": "type.googleapis.com/google.protobuf.Duration", + # "value": "1.212s" + # } + # @!attribute [rw] type_url + # @return [::String] + # A URL/resource name that uniquely identifies the type of the serialized + # protocol buffer message. This string must contain at least + # one "/" character. The last segment of the URL's path must represent + # the fully qualified name of the type (as in + # `path/google.protobuf.Duration`). The name should be in a canonical form + # (e.g., leading "." is not accepted). + # + # In practice, teams usually precompile into the binary all types that they + # expect it to use in the context of Any. However, for URLs which use the + # scheme `http`, `https`, or no scheme, one can optionally set up a type + # server that maps type URLs to message definitions as follows: + # + # * If no scheme is provided, `https` is assumed. + # * An HTTP GET on the URL must yield a [google.protobuf.Type][] + # value in binary format, or produce an error. + # * Applications are allowed to cache lookup results based on the + # URL, or have them precompiled into a binary to avoid any + # lookup. Therefore, binary compatibility needs to be preserved + # on changes to types. (Use versioned type names to manage + # breaking changes.) + # + # Note: this functionality is not currently available in the official + # protobuf release, and it is not used for type URLs beginning with + # type.googleapis.com. As of May 2023, there are no widely used type server + # implementations and no plans to implement one. + # + # Schemes other than `http`, `https` (or the empty scheme) might be + # used with implementation specific semantics. + # @!attribute [rw] value + # @return [::String] + # Must be a valid serialized protocol buffer of the above specified type. + class Any + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end +end diff --git a/owl-bot-staging/google-cloud-security-private_ca-v1/proto_docs/google/protobuf/duration.rb b/owl-bot-staging/google-cloud-security-private_ca-v1/proto_docs/google/protobuf/duration.rb new file mode 100644 index 000000000000..ea59f1f91daf --- /dev/null +++ b/owl-bot-staging/google-cloud-security-private_ca-v1/proto_docs/google/protobuf/duration.rb @@ -0,0 +1,98 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + + +module Google + module Protobuf + # A Duration represents a signed, fixed-length span of time represented + # as a count of seconds and fractions of seconds at nanosecond + # resolution. It is independent of any calendar and concepts like "day" + # or "month". It is related to Timestamp in that the difference between + # two Timestamp values is a Duration and it can be added or subtracted + # from a Timestamp. Range is approximately +-10,000 years. + # + # # Examples + # + # Example 1: Compute Duration from two Timestamps in pseudo code. + # + # Timestamp start = ...; + # Timestamp end = ...; + # Duration duration = ...; + # + # duration.seconds = end.seconds - start.seconds; + # duration.nanos = end.nanos - start.nanos; + # + # if (duration.seconds < 0 && duration.nanos > 0) { + # duration.seconds += 1; + # duration.nanos -= 1000000000; + # } else if (duration.seconds > 0 && duration.nanos < 0) { + # duration.seconds -= 1; + # duration.nanos += 1000000000; + # } + # + # Example 2: Compute Timestamp from Timestamp + Duration in pseudo code. + # + # Timestamp start = ...; + # Duration duration = ...; + # Timestamp end = ...; + # + # end.seconds = start.seconds + duration.seconds; + # end.nanos = start.nanos + duration.nanos; + # + # if (end.nanos < 0) { + # end.seconds -= 1; + # end.nanos += 1000000000; + # } else if (end.nanos >= 1000000000) { + # end.seconds += 1; + # end.nanos -= 1000000000; + # } + # + # Example 3: Compute Duration from datetime.timedelta in Python. + # + # td = datetime.timedelta(days=3, minutes=10) + # duration = Duration() + # duration.FromTimedelta(td) + # + # # JSON Mapping + # + # In JSON format, the Duration type is encoded as a string rather than an + # object, where the string ends in the suffix "s" (indicating seconds) and + # is preceded by the number of seconds, with nanoseconds expressed as + # fractional seconds. For example, 3 seconds with 0 nanoseconds should be + # encoded in JSON format as "3s", while 3 seconds and 1 nanosecond should + # be expressed in JSON format as "3.000000001s", and 3 seconds and 1 + # microsecond should be expressed in JSON format as "3.000001s". + # @!attribute [rw] seconds + # @return [::Integer] + # Signed seconds of the span of time. Must be from -315,576,000,000 + # to +315,576,000,000 inclusive. Note: these bounds are computed from: + # 60 sec/min * 60 min/hr * 24 hr/day * 365.25 days/year * 10000 years + # @!attribute [rw] nanos + # @return [::Integer] + # Signed fractions of a second at nanosecond resolution of the span + # of time. Durations less than one second are represented with a 0 + # `seconds` field and a positive or negative `nanos` field. For durations + # of one second or more, a non-zero value for the `nanos` field must be + # of the same sign as the `seconds` field. Must be from -999,999,999 + # to +999,999,999 inclusive. + class Duration + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end +end diff --git a/owl-bot-staging/google-cloud-security-private_ca-v1/proto_docs/google/protobuf/empty.rb b/owl-bot-staging/google-cloud-security-private_ca-v1/proto_docs/google/protobuf/empty.rb new file mode 100644 index 000000000000..83e4481834a6 --- /dev/null +++ b/owl-bot-staging/google-cloud-security-private_ca-v1/proto_docs/google/protobuf/empty.rb @@ -0,0 +1,34 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + + +module Google + module Protobuf + # A generic empty message that you can re-use to avoid defining duplicated + # empty messages in your APIs. A typical example is to use it as the request + # or the response type of an API method. For instance: + # + # service Foo { + # rpc Bar(google.protobuf.Empty) returns (google.protobuf.Empty); + # } + class Empty + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end +end diff --git a/owl-bot-staging/google-cloud-security-private_ca-v1/proto_docs/google/protobuf/field_mask.rb b/owl-bot-staging/google-cloud-security-private_ca-v1/proto_docs/google/protobuf/field_mask.rb new file mode 100644 index 000000000000..7f3ffc78601a --- /dev/null +++ b/owl-bot-staging/google-cloud-security-private_ca-v1/proto_docs/google/protobuf/field_mask.rb @@ -0,0 +1,229 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + + +module Google + module Protobuf + # `FieldMask` represents a set of symbolic field paths, for example: + # + # paths: "f.a" + # paths: "f.b.d" + # + # Here `f` represents a field in some root message, `a` and `b` + # fields in the message found in `f`, and `d` a field found in the + # message in `f.b`. + # + # Field masks are used to specify a subset of fields that should be + # returned by a get operation or modified by an update operation. + # Field masks also have a custom JSON encoding (see below). + # + # # Field Masks in Projections + # + # When used in the context of a projection, a response message or + # sub-message is filtered by the API to only contain those fields as + # specified in the mask. For example, if the mask in the previous + # example is applied to a response message as follows: + # + # f { + # a : 22 + # b { + # d : 1 + # x : 2 + # } + # y : 13 + # } + # z: 8 + # + # The result will not contain specific values for fields x,y and z + # (their value will be set to the default, and omitted in proto text + # output): + # + # + # f { + # a : 22 + # b { + # d : 1 + # } + # } + # + # A repeated field is not allowed except at the last position of a + # paths string. + # + # If a FieldMask object is not present in a get operation, the + # operation applies to all fields (as if a FieldMask of all fields + # had been specified). + # + # Note that a field mask does not necessarily apply to the + # top-level response message. In case of a REST get operation, the + # field mask applies directly to the response, but in case of a REST + # list operation, the mask instead applies to each individual message + # in the returned resource list. In case of a REST custom method, + # other definitions may be used. Where the mask applies will be + # clearly documented together with its declaration in the API. In + # any case, the effect on the returned resource/resources is required + # behavior for APIs. + # + # # Field Masks in Update Operations + # + # A field mask in update operations specifies which fields of the + # targeted resource are going to be updated. The API is required + # to only change the values of the fields as specified in the mask + # and leave the others untouched. If a resource is passed in to + # describe the updated values, the API ignores the values of all + # fields not covered by the mask. + # + # If a repeated field is specified for an update operation, new values will + # be appended to the existing repeated field in the target resource. Note that + # a repeated field is only allowed in the last position of a `paths` string. + # + # If a sub-message is specified in the last position of the field mask for an + # update operation, then new value will be merged into the existing sub-message + # in the target resource. + # + # For example, given the target message: + # + # f { + # b { + # d: 1 + # x: 2 + # } + # c: [1] + # } + # + # And an update message: + # + # f { + # b { + # d: 10 + # } + # c: [2] + # } + # + # then if the field mask is: + # + # paths: ["f.b", "f.c"] + # + # then the result will be: + # + # f { + # b { + # d: 10 + # x: 2 + # } + # c: [1, 2] + # } + # + # An implementation may provide options to override this default behavior for + # repeated and message fields. + # + # In order to reset a field's value to the default, the field must + # be in the mask and set to the default value in the provided resource. + # Hence, in order to reset all fields of a resource, provide a default + # instance of the resource and set all fields in the mask, or do + # not provide a mask as described below. + # + # If a field mask is not present on update, the operation applies to + # all fields (as if a field mask of all fields has been specified). + # Note that in the presence of schema evolution, this may mean that + # fields the client does not know and has therefore not filled into + # the request will be reset to their default. If this is unwanted + # behavior, a specific service may require a client to always specify + # a field mask, producing an error if not. + # + # As with get operations, the location of the resource which + # describes the updated values in the request message depends on the + # operation kind. In any case, the effect of the field mask is + # required to be honored by the API. + # + # ## Considerations for HTTP REST + # + # The HTTP kind of an update operation which uses a field mask must + # be set to PATCH instead of PUT in order to satisfy HTTP semantics + # (PUT must only be used for full updates). + # + # # JSON Encoding of Field Masks + # + # In JSON, a field mask is encoded as a single string where paths are + # separated by a comma. Fields name in each path are converted + # to/from lower-camel naming conventions. + # + # As an example, consider the following message declarations: + # + # message Profile { + # User user = 1; + # Photo photo = 2; + # } + # message User { + # string display_name = 1; + # string address = 2; + # } + # + # In proto a field mask for `Profile` may look as such: + # + # mask { + # paths: "user.display_name" + # paths: "photo" + # } + # + # In JSON, the same mask is represented as below: + # + # { + # mask: "user.displayName,photo" + # } + # + # # Field Masks and Oneof Fields + # + # Field masks treat fields in oneofs just as regular fields. Consider the + # following message: + # + # message SampleMessage { + # oneof test_oneof { + # string name = 4; + # SubMessage sub_message = 9; + # } + # } + # + # The field mask can be: + # + # mask { + # paths: "name" + # } + # + # Or: + # + # mask { + # paths: "sub_message" + # } + # + # Note that oneof type names ("test_oneof" in this case) cannot be used in + # paths. + # + # ## Field Mask Verification + # + # The implementation of any API method which has a FieldMask type field in the + # request should verify the included field paths, and return an + # `INVALID_ARGUMENT` error if any path is unmappable. + # @!attribute [rw] paths + # @return [::Array<::String>] + # The set of field mask paths. + class FieldMask + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end +end diff --git a/owl-bot-staging/google-cloud-security-private_ca-v1/proto_docs/google/protobuf/timestamp.rb b/owl-bot-staging/google-cloud-security-private_ca-v1/proto_docs/google/protobuf/timestamp.rb new file mode 100644 index 000000000000..74352be9c58c --- /dev/null +++ b/owl-bot-staging/google-cloud-security-private_ca-v1/proto_docs/google/protobuf/timestamp.rb @@ -0,0 +1,127 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + + +module Google + module Protobuf + # A Timestamp represents a point in time independent of any time zone or local + # calendar, encoded as a count of seconds and fractions of seconds at + # nanosecond resolution. The count is relative to an epoch at UTC midnight on + # January 1, 1970, in the proleptic Gregorian calendar which extends the + # Gregorian calendar backwards to year one. + # + # All minutes are 60 seconds long. Leap seconds are "smeared" so that no leap + # second table is needed for interpretation, using a [24-hour linear + # smear](https://developers.google.com/time/smear). + # + # The range is from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59.999999999Z. By + # restricting to that range, we ensure that we can convert to and from [RFC + # 3339](https://www.ietf.org/rfc/rfc3339.txt) date strings. + # + # # Examples + # + # Example 1: Compute Timestamp from POSIX `time()`. + # + # Timestamp timestamp; + # timestamp.set_seconds(time(NULL)); + # timestamp.set_nanos(0); + # + # Example 2: Compute Timestamp from POSIX `gettimeofday()`. + # + # struct timeval tv; + # gettimeofday(&tv, NULL); + # + # Timestamp timestamp; + # timestamp.set_seconds(tv.tv_sec); + # timestamp.set_nanos(tv.tv_usec * 1000); + # + # Example 3: Compute Timestamp from Win32 `GetSystemTimeAsFileTime()`. + # + # FILETIME ft; + # GetSystemTimeAsFileTime(&ft); + # UINT64 ticks = (((UINT64)ft.dwHighDateTime) << 32) | ft.dwLowDateTime; + # + # // A Windows tick is 100 nanoseconds. Windows epoch 1601-01-01T00:00:00Z + # // is 11644473600 seconds before Unix epoch 1970-01-01T00:00:00Z. + # Timestamp timestamp; + # timestamp.set_seconds((INT64) ((ticks / 10000000) - 11644473600LL)); + # timestamp.set_nanos((INT32) ((ticks % 10000000) * 100)); + # + # Example 4: Compute Timestamp from Java `System.currentTimeMillis()`. + # + # long millis = System.currentTimeMillis(); + # + # Timestamp timestamp = Timestamp.newBuilder().setSeconds(millis / 1000) + # .setNanos((int) ((millis % 1000) * 1000000)).build(); + # + # Example 5: Compute Timestamp from Java `Instant.now()`. + # + # Instant now = Instant.now(); + # + # Timestamp timestamp = + # Timestamp.newBuilder().setSeconds(now.getEpochSecond()) + # .setNanos(now.getNano()).build(); + # + # Example 6: Compute Timestamp from current time in Python. + # + # timestamp = Timestamp() + # timestamp.GetCurrentTime() + # + # # JSON Mapping + # + # In JSON format, the Timestamp type is encoded as a string in the + # [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format. That is, the + # format is "\\{year}-\\{month}-\\{day}T\\{hour}:\\{min}:\\{sec}[.\\{frac_sec}]Z" + # where \\{year} is always expressed using four digits while \\{month}, \\{day}, + # \\{hour}, \\{min}, and \\{sec} are zero-padded to two digits each. The fractional + # seconds, which can go up to 9 digits (i.e. up to 1 nanosecond resolution), + # are optional. The "Z" suffix indicates the timezone ("UTC"); the timezone + # is required. A proto3 JSON serializer should always use UTC (as indicated by + # "Z") when printing the Timestamp type and a proto3 JSON parser should be + # able to accept both UTC and other timezones (as indicated by an offset). + # + # For example, "2017-01-15T01:30:15.01Z" encodes 15.01 seconds past + # 01:30 UTC on January 15, 2017. + # + # In JavaScript, one can convert a Date object to this format using the + # standard + # [toISOString()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toISOString) + # method. In Python, a standard `datetime.datetime` object can be converted + # to this format using + # [`strftime`](https://docs.python.org/2/library/time.html#time.strftime) with + # the time format spec '%Y-%m-%dT%H:%M:%S.%fZ'. Likewise, in Java, one can use + # the Joda Time's [`ISODateTimeFormat.dateTime()`]( + # http://joda-time.sourceforge.net/apidocs/org/joda/time/format/ISODateTimeFormat.html#dateTime() + # ) to obtain a formatter capable of generating timestamps in this format. + # @!attribute [rw] seconds + # @return [::Integer] + # Represents seconds of UTC time since Unix epoch + # 1970-01-01T00:00:00Z. Must be from 0001-01-01T00:00:00Z to + # 9999-12-31T23:59:59Z inclusive. + # @!attribute [rw] nanos + # @return [::Integer] + # Non-negative fractions of a second at nanosecond resolution. Negative + # second values with fractions must still have non-negative nanos values + # that count forward in time. Must be from 0 to 999,999,999 + # inclusive. + class Timestamp + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end +end diff --git a/owl-bot-staging/google-cloud-security-private_ca-v1/proto_docs/google/rpc/status.rb b/owl-bot-staging/google-cloud-security-private_ca-v1/proto_docs/google/rpc/status.rb new file mode 100644 index 000000000000..c1a1c07eb2db --- /dev/null +++ b/owl-bot-staging/google-cloud-security-private_ca-v1/proto_docs/google/rpc/status.rb @@ -0,0 +1,48 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + + +module Google + module Rpc + # The `Status` type defines a logical error model that is suitable for + # different programming environments, including REST APIs and RPC APIs. It is + # used by [gRPC](https://github.com/grpc). Each `Status` message contains + # three pieces of data: error code, error message, and error details. + # + # You can find out more about this error model and how to work with it in the + # [API Design Guide](https://cloud.google.com/apis/design/errors). + # @!attribute [rw] code + # @return [::Integer] + # The status code, which should be an enum value of + # [google.rpc.Code][google.rpc.Code]. + # @!attribute [rw] message + # @return [::String] + # A developer-facing error message, which should be in English. Any + # user-facing error message should be localized and sent in the + # {::Google::Rpc::Status#details google.rpc.Status.details} field, or localized + # by the client. + # @!attribute [rw] details + # @return [::Array<::Google::Protobuf::Any>] + # A list of messages that carry the error details. There is a common set of + # message types for APIs to use. + class Status + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end +end diff --git a/owl-bot-staging/google-cloud-security-private_ca-v1/proto_docs/google/type/expr.rb b/owl-bot-staging/google-cloud-security-private_ca-v1/proto_docs/google/type/expr.rb new file mode 100644 index 000000000000..53e7733b6592 --- /dev/null +++ b/owl-bot-staging/google-cloud-security-private_ca-v1/proto_docs/google/type/expr.rb @@ -0,0 +1,75 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + + +module Google + module Type + # Represents a textual expression in the Common Expression Language (CEL) + # syntax. CEL is a C-like expression language. The syntax and semantics of CEL + # are documented at https://github.com/google/cel-spec. + # + # Example (Comparison): + # + # title: "Summary size limit" + # description: "Determines if a summary is less than 100 chars" + # expression: "document.summary.size() < 100" + # + # Example (Equality): + # + # title: "Requestor is owner" + # description: "Determines if requestor is the document owner" + # expression: "document.owner == request.auth.claims.email" + # + # Example (Logic): + # + # title: "Public documents" + # description: "Determine whether the document should be publicly visible" + # expression: "document.type != 'private' && document.type != 'internal'" + # + # Example (Data Manipulation): + # + # title: "Notification string" + # description: "Create a notification string with a timestamp." + # expression: "'New message received at ' + string(document.create_time)" + # + # The exact variables and functions that may be referenced within an expression + # are determined by the service that evaluates it. See the service + # documentation for additional information. + # @!attribute [rw] expression + # @return [::String] + # Textual representation of an expression in Common Expression Language + # syntax. + # @!attribute [rw] title + # @return [::String] + # Optional. Title for the expression, i.e. a short string describing + # its purpose. This can be used e.g. in UIs which allow to enter the + # expression. + # @!attribute [rw] description + # @return [::String] + # Optional. Description of the expression. This is a longer text which + # describes the expression, e.g. when hovered over it in a UI. + # @!attribute [rw] location + # @return [::String] + # Optional. String indicating the location of the expression for error + # reporting, e.g. a file name and a position in the file. + class Expr + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end +end diff --git a/owl-bot-staging/google-cloud-security-private_ca-v1/snippets/Gemfile b/owl-bot-staging/google-cloud-security-private_ca-v1/snippets/Gemfile new file mode 100644 index 000000000000..15d0144fd102 --- /dev/null +++ b/owl-bot-staging/google-cloud-security-private_ca-v1/snippets/Gemfile @@ -0,0 +1,32 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +source "https://rubygems.org" + +if ENV["GOOGLE_CLOUD_SAMPLES_TEST"] == "master" + gem "google-cloud-security-private_ca-v1", path: "../" +else + gem "google-cloud-security-private_ca-v1" +end + +group :test do + gem "google-style", "~> 1.26.1" + gem "minitest", "~> 5.16" + gem "minitest-focus", "~> 1.1" + gem "minitest-hooks", "~> 1.5" +end diff --git a/owl-bot-staging/google-cloud-security-private_ca-v1/snippets/certificate_authority_service/activate_certificate_authority.rb b/owl-bot-staging/google-cloud-security-private_ca-v1/snippets/certificate_authority_service/activate_certificate_authority.rb new file mode 100644 index 000000000000..2ca2884e3cdb --- /dev/null +++ b/owl-bot-staging/google-cloud-security-private_ca-v1/snippets/certificate_authority_service/activate_certificate_authority.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 privateca_v1_generated_CertificateAuthorityService_ActivateCertificateAuthority_sync] +require "google/cloud/security/private_ca/v1" + +## +# Snippet for the activate_certificate_authority call in the CertificateAuthorityService service +# +# This snippet has been automatically generated and should be regarded as a code +# template only. It will require modifications to work: +# - It may require correct/in-range values for request initialization. +# - It may require specifying regional endpoints when creating the service +# client as shown in https://cloud.google.com/ruby/docs/reference. +# +# This is an auto-generated example demonstrating basic usage of +# Google::Cloud::Security::PrivateCA::V1::CertificateAuthorityService::Client#activate_certificate_authority. +# +def activate_certificate_authority + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Security::PrivateCA::V1::CertificateAuthorityService::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Security::PrivateCA::V1::ActivateCertificateAuthorityRequest.new + + # Call the activate_certificate_authority method. + result = client.activate_certificate_authority 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 privateca_v1_generated_CertificateAuthorityService_ActivateCertificateAuthority_sync] diff --git a/owl-bot-staging/google-cloud-security-private_ca-v1/snippets/certificate_authority_service/create_ca_pool.rb b/owl-bot-staging/google-cloud-security-private_ca-v1/snippets/certificate_authority_service/create_ca_pool.rb new file mode 100644 index 000000000000..2086f329dd24 --- /dev/null +++ b/owl-bot-staging/google-cloud-security-private_ca-v1/snippets/certificate_authority_service/create_ca_pool.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 privateca_v1_generated_CertificateAuthorityService_CreateCaPool_sync] +require "google/cloud/security/private_ca/v1" + +## +# Snippet for the create_ca_pool call in the CertificateAuthorityService service +# +# This snippet has been automatically generated and should be regarded as a code +# template only. It will require modifications to work: +# - It may require correct/in-range values for request initialization. +# - It may require specifying regional endpoints when creating the service +# client as shown in https://cloud.google.com/ruby/docs/reference. +# +# This is an auto-generated example demonstrating basic usage of +# Google::Cloud::Security::PrivateCA::V1::CertificateAuthorityService::Client#create_ca_pool. +# +def create_ca_pool + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Security::PrivateCA::V1::CertificateAuthorityService::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Security::PrivateCA::V1::CreateCaPoolRequest.new + + # Call the create_ca_pool method. + result = client.create_ca_pool 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 privateca_v1_generated_CertificateAuthorityService_CreateCaPool_sync] diff --git a/owl-bot-staging/google-cloud-security-private_ca-v1/snippets/certificate_authority_service/create_certificate.rb b/owl-bot-staging/google-cloud-security-private_ca-v1/snippets/certificate_authority_service/create_certificate.rb new file mode 100644 index 000000000000..02ba1cd69a00 --- /dev/null +++ b/owl-bot-staging/google-cloud-security-private_ca-v1/snippets/certificate_authority_service/create_certificate.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 privateca_v1_generated_CertificateAuthorityService_CreateCertificate_sync] +require "google/cloud/security/private_ca/v1" + +## +# Snippet for the create_certificate call in the CertificateAuthorityService service +# +# This snippet has been automatically generated and should be regarded as a code +# template only. It will require modifications to work: +# - It may require correct/in-range values for request initialization. +# - It may require specifying regional endpoints when creating the service +# client as shown in https://cloud.google.com/ruby/docs/reference. +# +# This is an auto-generated example demonstrating basic usage of +# Google::Cloud::Security::PrivateCA::V1::CertificateAuthorityService::Client#create_certificate. +# +def create_certificate + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Security::PrivateCA::V1::CertificateAuthorityService::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Security::PrivateCA::V1::CreateCertificateRequest.new + + # Call the create_certificate method. + result = client.create_certificate request + + # The returned object is of type Google::Cloud::Security::PrivateCA::V1::Certificate. + p result +end +# [END privateca_v1_generated_CertificateAuthorityService_CreateCertificate_sync] diff --git a/owl-bot-staging/google-cloud-security-private_ca-v1/snippets/certificate_authority_service/create_certificate_authority.rb b/owl-bot-staging/google-cloud-security-private_ca-v1/snippets/certificate_authority_service/create_certificate_authority.rb new file mode 100644 index 000000000000..837bf4f5e52b --- /dev/null +++ b/owl-bot-staging/google-cloud-security-private_ca-v1/snippets/certificate_authority_service/create_certificate_authority.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 privateca_v1_generated_CertificateAuthorityService_CreateCertificateAuthority_sync] +require "google/cloud/security/private_ca/v1" + +## +# Snippet for the create_certificate_authority call in the CertificateAuthorityService service +# +# This snippet has been automatically generated and should be regarded as a code +# template only. It will require modifications to work: +# - It may require correct/in-range values for request initialization. +# - It may require specifying regional endpoints when creating the service +# client as shown in https://cloud.google.com/ruby/docs/reference. +# +# This is an auto-generated example demonstrating basic usage of +# Google::Cloud::Security::PrivateCA::V1::CertificateAuthorityService::Client#create_certificate_authority. +# +def create_certificate_authority + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Security::PrivateCA::V1::CertificateAuthorityService::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Security::PrivateCA::V1::CreateCertificateAuthorityRequest.new + + # Call the create_certificate_authority method. + result = client.create_certificate_authority 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 privateca_v1_generated_CertificateAuthorityService_CreateCertificateAuthority_sync] diff --git a/owl-bot-staging/google-cloud-security-private_ca-v1/snippets/certificate_authority_service/create_certificate_template.rb b/owl-bot-staging/google-cloud-security-private_ca-v1/snippets/certificate_authority_service/create_certificate_template.rb new file mode 100644 index 000000000000..04864381efcf --- /dev/null +++ b/owl-bot-staging/google-cloud-security-private_ca-v1/snippets/certificate_authority_service/create_certificate_template.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 privateca_v1_generated_CertificateAuthorityService_CreateCertificateTemplate_sync] +require "google/cloud/security/private_ca/v1" + +## +# Snippet for the create_certificate_template call in the CertificateAuthorityService service +# +# This snippet has been automatically generated and should be regarded as a code +# template only. It will require modifications to work: +# - It may require correct/in-range values for request initialization. +# - It may require specifying regional endpoints when creating the service +# client as shown in https://cloud.google.com/ruby/docs/reference. +# +# This is an auto-generated example demonstrating basic usage of +# Google::Cloud::Security::PrivateCA::V1::CertificateAuthorityService::Client#create_certificate_template. +# +def create_certificate_template + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Security::PrivateCA::V1::CertificateAuthorityService::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Security::PrivateCA::V1::CreateCertificateTemplateRequest.new + + # Call the create_certificate_template method. + result = client.create_certificate_template 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 privateca_v1_generated_CertificateAuthorityService_CreateCertificateTemplate_sync] diff --git a/owl-bot-staging/google-cloud-security-private_ca-v1/snippets/certificate_authority_service/delete_ca_pool.rb b/owl-bot-staging/google-cloud-security-private_ca-v1/snippets/certificate_authority_service/delete_ca_pool.rb new file mode 100644 index 000000000000..d83ae4819dc9 --- /dev/null +++ b/owl-bot-staging/google-cloud-security-private_ca-v1/snippets/certificate_authority_service/delete_ca_pool.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 privateca_v1_generated_CertificateAuthorityService_DeleteCaPool_sync] +require "google/cloud/security/private_ca/v1" + +## +# Snippet for the delete_ca_pool call in the CertificateAuthorityService service +# +# This snippet has been automatically generated and should be regarded as a code +# template only. It will require modifications to work: +# - It may require correct/in-range values for request initialization. +# - It may require specifying regional endpoints when creating the service +# client as shown in https://cloud.google.com/ruby/docs/reference. +# +# This is an auto-generated example demonstrating basic usage of +# Google::Cloud::Security::PrivateCA::V1::CertificateAuthorityService::Client#delete_ca_pool. +# +def delete_ca_pool + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Security::PrivateCA::V1::CertificateAuthorityService::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Security::PrivateCA::V1::DeleteCaPoolRequest.new + + # Call the delete_ca_pool method. + result = client.delete_ca_pool 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 privateca_v1_generated_CertificateAuthorityService_DeleteCaPool_sync] diff --git a/owl-bot-staging/google-cloud-security-private_ca-v1/snippets/certificate_authority_service/delete_certificate_authority.rb b/owl-bot-staging/google-cloud-security-private_ca-v1/snippets/certificate_authority_service/delete_certificate_authority.rb new file mode 100644 index 000000000000..25db9c72707e --- /dev/null +++ b/owl-bot-staging/google-cloud-security-private_ca-v1/snippets/certificate_authority_service/delete_certificate_authority.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 privateca_v1_generated_CertificateAuthorityService_DeleteCertificateAuthority_sync] +require "google/cloud/security/private_ca/v1" + +## +# Snippet for the delete_certificate_authority call in the CertificateAuthorityService service +# +# This snippet has been automatically generated and should be regarded as a code +# template only. It will require modifications to work: +# - It may require correct/in-range values for request initialization. +# - It may require specifying regional endpoints when creating the service +# client as shown in https://cloud.google.com/ruby/docs/reference. +# +# This is an auto-generated example demonstrating basic usage of +# Google::Cloud::Security::PrivateCA::V1::CertificateAuthorityService::Client#delete_certificate_authority. +# +def delete_certificate_authority + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Security::PrivateCA::V1::CertificateAuthorityService::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Security::PrivateCA::V1::DeleteCertificateAuthorityRequest.new + + # Call the delete_certificate_authority method. + result = client.delete_certificate_authority 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 privateca_v1_generated_CertificateAuthorityService_DeleteCertificateAuthority_sync] diff --git a/owl-bot-staging/google-cloud-security-private_ca-v1/snippets/certificate_authority_service/delete_certificate_template.rb b/owl-bot-staging/google-cloud-security-private_ca-v1/snippets/certificate_authority_service/delete_certificate_template.rb new file mode 100644 index 000000000000..ffd2b9603f86 --- /dev/null +++ b/owl-bot-staging/google-cloud-security-private_ca-v1/snippets/certificate_authority_service/delete_certificate_template.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 privateca_v1_generated_CertificateAuthorityService_DeleteCertificateTemplate_sync] +require "google/cloud/security/private_ca/v1" + +## +# Snippet for the delete_certificate_template call in the CertificateAuthorityService service +# +# This snippet has been automatically generated and should be regarded as a code +# template only. It will require modifications to work: +# - It may require correct/in-range values for request initialization. +# - It may require specifying regional endpoints when creating the service +# client as shown in https://cloud.google.com/ruby/docs/reference. +# +# This is an auto-generated example demonstrating basic usage of +# Google::Cloud::Security::PrivateCA::V1::CertificateAuthorityService::Client#delete_certificate_template. +# +def delete_certificate_template + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Security::PrivateCA::V1::CertificateAuthorityService::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Security::PrivateCA::V1::DeleteCertificateTemplateRequest.new + + # Call the delete_certificate_template method. + result = client.delete_certificate_template 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 privateca_v1_generated_CertificateAuthorityService_DeleteCertificateTemplate_sync] diff --git a/owl-bot-staging/google-cloud-security-private_ca-v1/snippets/certificate_authority_service/disable_certificate_authority.rb b/owl-bot-staging/google-cloud-security-private_ca-v1/snippets/certificate_authority_service/disable_certificate_authority.rb new file mode 100644 index 000000000000..cf6fffe863ae --- /dev/null +++ b/owl-bot-staging/google-cloud-security-private_ca-v1/snippets/certificate_authority_service/disable_certificate_authority.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 privateca_v1_generated_CertificateAuthorityService_DisableCertificateAuthority_sync] +require "google/cloud/security/private_ca/v1" + +## +# Snippet for the disable_certificate_authority call in the CertificateAuthorityService service +# +# This snippet has been automatically generated and should be regarded as a code +# template only. It will require modifications to work: +# - It may require correct/in-range values for request initialization. +# - It may require specifying regional endpoints when creating the service +# client as shown in https://cloud.google.com/ruby/docs/reference. +# +# This is an auto-generated example demonstrating basic usage of +# Google::Cloud::Security::PrivateCA::V1::CertificateAuthorityService::Client#disable_certificate_authority. +# +def disable_certificate_authority + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Security::PrivateCA::V1::CertificateAuthorityService::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Security::PrivateCA::V1::DisableCertificateAuthorityRequest.new + + # Call the disable_certificate_authority method. + result = client.disable_certificate_authority 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 privateca_v1_generated_CertificateAuthorityService_DisableCertificateAuthority_sync] diff --git a/owl-bot-staging/google-cloud-security-private_ca-v1/snippets/certificate_authority_service/enable_certificate_authority.rb b/owl-bot-staging/google-cloud-security-private_ca-v1/snippets/certificate_authority_service/enable_certificate_authority.rb new file mode 100644 index 000000000000..66ab672c075a --- /dev/null +++ b/owl-bot-staging/google-cloud-security-private_ca-v1/snippets/certificate_authority_service/enable_certificate_authority.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 privateca_v1_generated_CertificateAuthorityService_EnableCertificateAuthority_sync] +require "google/cloud/security/private_ca/v1" + +## +# Snippet for the enable_certificate_authority call in the CertificateAuthorityService service +# +# This snippet has been automatically generated and should be regarded as a code +# template only. It will require modifications to work: +# - It may require correct/in-range values for request initialization. +# - It may require specifying regional endpoints when creating the service +# client as shown in https://cloud.google.com/ruby/docs/reference. +# +# This is an auto-generated example demonstrating basic usage of +# Google::Cloud::Security::PrivateCA::V1::CertificateAuthorityService::Client#enable_certificate_authority. +# +def enable_certificate_authority + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Security::PrivateCA::V1::CertificateAuthorityService::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Security::PrivateCA::V1::EnableCertificateAuthorityRequest.new + + # Call the enable_certificate_authority method. + result = client.enable_certificate_authority 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 privateca_v1_generated_CertificateAuthorityService_EnableCertificateAuthority_sync] diff --git a/owl-bot-staging/google-cloud-security-private_ca-v1/snippets/certificate_authority_service/fetch_ca_certs.rb b/owl-bot-staging/google-cloud-security-private_ca-v1/snippets/certificate_authority_service/fetch_ca_certs.rb new file mode 100644 index 000000000000..939e386615d0 --- /dev/null +++ b/owl-bot-staging/google-cloud-security-private_ca-v1/snippets/certificate_authority_service/fetch_ca_certs.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 privateca_v1_generated_CertificateAuthorityService_FetchCaCerts_sync] +require "google/cloud/security/private_ca/v1" + +## +# Snippet for the fetch_ca_certs call in the CertificateAuthorityService service +# +# This snippet has been automatically generated and should be regarded as a code +# template only. It will require modifications to work: +# - It may require correct/in-range values for request initialization. +# - It may require specifying regional endpoints when creating the service +# client as shown in https://cloud.google.com/ruby/docs/reference. +# +# This is an auto-generated example demonstrating basic usage of +# Google::Cloud::Security::PrivateCA::V1::CertificateAuthorityService::Client#fetch_ca_certs. +# +def fetch_ca_certs + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Security::PrivateCA::V1::CertificateAuthorityService::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Security::PrivateCA::V1::FetchCaCertsRequest.new + + # Call the fetch_ca_certs method. + result = client.fetch_ca_certs request + + # The returned object is of type Google::Cloud::Security::PrivateCA::V1::FetchCaCertsResponse. + p result +end +# [END privateca_v1_generated_CertificateAuthorityService_FetchCaCerts_sync] diff --git a/owl-bot-staging/google-cloud-security-private_ca-v1/snippets/certificate_authority_service/fetch_certificate_authority_csr.rb b/owl-bot-staging/google-cloud-security-private_ca-v1/snippets/certificate_authority_service/fetch_certificate_authority_csr.rb new file mode 100644 index 000000000000..f51e0bff99ab --- /dev/null +++ b/owl-bot-staging/google-cloud-security-private_ca-v1/snippets/certificate_authority_service/fetch_certificate_authority_csr.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 privateca_v1_generated_CertificateAuthorityService_FetchCertificateAuthorityCsr_sync] +require "google/cloud/security/private_ca/v1" + +## +# Snippet for the fetch_certificate_authority_csr call in the CertificateAuthorityService service +# +# This snippet has been automatically generated and should be regarded as a code +# template only. It will require modifications to work: +# - It may require correct/in-range values for request initialization. +# - It may require specifying regional endpoints when creating the service +# client as shown in https://cloud.google.com/ruby/docs/reference. +# +# This is an auto-generated example demonstrating basic usage of +# Google::Cloud::Security::PrivateCA::V1::CertificateAuthorityService::Client#fetch_certificate_authority_csr. +# +def fetch_certificate_authority_csr + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Security::PrivateCA::V1::CertificateAuthorityService::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Security::PrivateCA::V1::FetchCertificateAuthorityCsrRequest.new + + # Call the fetch_certificate_authority_csr method. + result = client.fetch_certificate_authority_csr request + + # The returned object is of type Google::Cloud::Security::PrivateCA::V1::FetchCertificateAuthorityCsrResponse. + p result +end +# [END privateca_v1_generated_CertificateAuthorityService_FetchCertificateAuthorityCsr_sync] diff --git a/owl-bot-staging/google-cloud-security-private_ca-v1/snippets/certificate_authority_service/get_ca_pool.rb b/owl-bot-staging/google-cloud-security-private_ca-v1/snippets/certificate_authority_service/get_ca_pool.rb new file mode 100644 index 000000000000..c82b3ce69063 --- /dev/null +++ b/owl-bot-staging/google-cloud-security-private_ca-v1/snippets/certificate_authority_service/get_ca_pool.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 privateca_v1_generated_CertificateAuthorityService_GetCaPool_sync] +require "google/cloud/security/private_ca/v1" + +## +# Snippet for the get_ca_pool call in the CertificateAuthorityService service +# +# This snippet has been automatically generated and should be regarded as a code +# template only. It will require modifications to work: +# - It may require correct/in-range values for request initialization. +# - It may require specifying regional endpoints when creating the service +# client as shown in https://cloud.google.com/ruby/docs/reference. +# +# This is an auto-generated example demonstrating basic usage of +# Google::Cloud::Security::PrivateCA::V1::CertificateAuthorityService::Client#get_ca_pool. +# +def get_ca_pool + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Security::PrivateCA::V1::CertificateAuthorityService::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Security::PrivateCA::V1::GetCaPoolRequest.new + + # Call the get_ca_pool method. + result = client.get_ca_pool request + + # The returned object is of type Google::Cloud::Security::PrivateCA::V1::CaPool. + p result +end +# [END privateca_v1_generated_CertificateAuthorityService_GetCaPool_sync] diff --git a/owl-bot-staging/google-cloud-security-private_ca-v1/snippets/certificate_authority_service/get_certificate.rb b/owl-bot-staging/google-cloud-security-private_ca-v1/snippets/certificate_authority_service/get_certificate.rb new file mode 100644 index 000000000000..ce87f3b91296 --- /dev/null +++ b/owl-bot-staging/google-cloud-security-private_ca-v1/snippets/certificate_authority_service/get_certificate.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 privateca_v1_generated_CertificateAuthorityService_GetCertificate_sync] +require "google/cloud/security/private_ca/v1" + +## +# Snippet for the get_certificate call in the CertificateAuthorityService service +# +# This snippet has been automatically generated and should be regarded as a code +# template only. It will require modifications to work: +# - It may require correct/in-range values for request initialization. +# - It may require specifying regional endpoints when creating the service +# client as shown in https://cloud.google.com/ruby/docs/reference. +# +# This is an auto-generated example demonstrating basic usage of +# Google::Cloud::Security::PrivateCA::V1::CertificateAuthorityService::Client#get_certificate. +# +def get_certificate + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Security::PrivateCA::V1::CertificateAuthorityService::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Security::PrivateCA::V1::GetCertificateRequest.new + + # Call the get_certificate method. + result = client.get_certificate request + + # The returned object is of type Google::Cloud::Security::PrivateCA::V1::Certificate. + p result +end +# [END privateca_v1_generated_CertificateAuthorityService_GetCertificate_sync] diff --git a/owl-bot-staging/google-cloud-security-private_ca-v1/snippets/certificate_authority_service/get_certificate_authority.rb b/owl-bot-staging/google-cloud-security-private_ca-v1/snippets/certificate_authority_service/get_certificate_authority.rb new file mode 100644 index 000000000000..0fb13b1d62ac --- /dev/null +++ b/owl-bot-staging/google-cloud-security-private_ca-v1/snippets/certificate_authority_service/get_certificate_authority.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 privateca_v1_generated_CertificateAuthorityService_GetCertificateAuthority_sync] +require "google/cloud/security/private_ca/v1" + +## +# Snippet for the get_certificate_authority call in the CertificateAuthorityService service +# +# This snippet has been automatically generated and should be regarded as a code +# template only. It will require modifications to work: +# - It may require correct/in-range values for request initialization. +# - It may require specifying regional endpoints when creating the service +# client as shown in https://cloud.google.com/ruby/docs/reference. +# +# This is an auto-generated example demonstrating basic usage of +# Google::Cloud::Security::PrivateCA::V1::CertificateAuthorityService::Client#get_certificate_authority. +# +def get_certificate_authority + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Security::PrivateCA::V1::CertificateAuthorityService::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Security::PrivateCA::V1::GetCertificateAuthorityRequest.new + + # Call the get_certificate_authority method. + result = client.get_certificate_authority request + + # The returned object is of type Google::Cloud::Security::PrivateCA::V1::CertificateAuthority. + p result +end +# [END privateca_v1_generated_CertificateAuthorityService_GetCertificateAuthority_sync] diff --git a/owl-bot-staging/google-cloud-security-private_ca-v1/snippets/certificate_authority_service/get_certificate_revocation_list.rb b/owl-bot-staging/google-cloud-security-private_ca-v1/snippets/certificate_authority_service/get_certificate_revocation_list.rb new file mode 100644 index 000000000000..e840b4be9acc --- /dev/null +++ b/owl-bot-staging/google-cloud-security-private_ca-v1/snippets/certificate_authority_service/get_certificate_revocation_list.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 privateca_v1_generated_CertificateAuthorityService_GetCertificateRevocationList_sync] +require "google/cloud/security/private_ca/v1" + +## +# Snippet for the get_certificate_revocation_list call in the CertificateAuthorityService service +# +# This snippet has been automatically generated and should be regarded as a code +# template only. It will require modifications to work: +# - It may require correct/in-range values for request initialization. +# - It may require specifying regional endpoints when creating the service +# client as shown in https://cloud.google.com/ruby/docs/reference. +# +# This is an auto-generated example demonstrating basic usage of +# Google::Cloud::Security::PrivateCA::V1::CertificateAuthorityService::Client#get_certificate_revocation_list. +# +def get_certificate_revocation_list + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Security::PrivateCA::V1::CertificateAuthorityService::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Security::PrivateCA::V1::GetCertificateRevocationListRequest.new + + # Call the get_certificate_revocation_list method. + result = client.get_certificate_revocation_list request + + # The returned object is of type Google::Cloud::Security::PrivateCA::V1::CertificateRevocationList. + p result +end +# [END privateca_v1_generated_CertificateAuthorityService_GetCertificateRevocationList_sync] diff --git a/owl-bot-staging/google-cloud-security-private_ca-v1/snippets/certificate_authority_service/get_certificate_template.rb b/owl-bot-staging/google-cloud-security-private_ca-v1/snippets/certificate_authority_service/get_certificate_template.rb new file mode 100644 index 000000000000..d084f7fa5d49 --- /dev/null +++ b/owl-bot-staging/google-cloud-security-private_ca-v1/snippets/certificate_authority_service/get_certificate_template.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 privateca_v1_generated_CertificateAuthorityService_GetCertificateTemplate_sync] +require "google/cloud/security/private_ca/v1" + +## +# Snippet for the get_certificate_template call in the CertificateAuthorityService service +# +# This snippet has been automatically generated and should be regarded as a code +# template only. It will require modifications to work: +# - It may require correct/in-range values for request initialization. +# - It may require specifying regional endpoints when creating the service +# client as shown in https://cloud.google.com/ruby/docs/reference. +# +# This is an auto-generated example demonstrating basic usage of +# Google::Cloud::Security::PrivateCA::V1::CertificateAuthorityService::Client#get_certificate_template. +# +def get_certificate_template + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Security::PrivateCA::V1::CertificateAuthorityService::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Security::PrivateCA::V1::GetCertificateTemplateRequest.new + + # Call the get_certificate_template method. + result = client.get_certificate_template request + + # The returned object is of type Google::Cloud::Security::PrivateCA::V1::CertificateTemplate. + p result +end +# [END privateca_v1_generated_CertificateAuthorityService_GetCertificateTemplate_sync] diff --git a/owl-bot-staging/google-cloud-security-private_ca-v1/snippets/certificate_authority_service/list_ca_pools.rb b/owl-bot-staging/google-cloud-security-private_ca-v1/snippets/certificate_authority_service/list_ca_pools.rb new file mode 100644 index 000000000000..0de634246136 --- /dev/null +++ b/owl-bot-staging/google-cloud-security-private_ca-v1/snippets/certificate_authority_service/list_ca_pools.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 privateca_v1_generated_CertificateAuthorityService_ListCaPools_sync] +require "google/cloud/security/private_ca/v1" + +## +# Snippet for the list_ca_pools call in the CertificateAuthorityService service +# +# This snippet has been automatically generated and should be regarded as a code +# template only. It will require modifications to work: +# - It may require correct/in-range values for request initialization. +# - It may require specifying regional endpoints when creating the service +# client as shown in https://cloud.google.com/ruby/docs/reference. +# +# This is an auto-generated example demonstrating basic usage of +# Google::Cloud::Security::PrivateCA::V1::CertificateAuthorityService::Client#list_ca_pools. +# +def list_ca_pools + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Security::PrivateCA::V1::CertificateAuthorityService::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Security::PrivateCA::V1::ListCaPoolsRequest.new + + # Call the list_ca_pools method. + result = client.list_ca_pools request + + # The returned object is of type Gapic::PagedEnumerable. You can iterate + # over elements, and API calls will be issued to fetch pages as needed. + result.each do |item| + # Each element is of type ::Google::Cloud::Security::PrivateCA::V1::CaPool. + p item + end +end +# [END privateca_v1_generated_CertificateAuthorityService_ListCaPools_sync] diff --git a/owl-bot-staging/google-cloud-security-private_ca-v1/snippets/certificate_authority_service/list_certificate_authorities.rb b/owl-bot-staging/google-cloud-security-private_ca-v1/snippets/certificate_authority_service/list_certificate_authorities.rb new file mode 100644 index 000000000000..c2e06a669891 --- /dev/null +++ b/owl-bot-staging/google-cloud-security-private_ca-v1/snippets/certificate_authority_service/list_certificate_authorities.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 privateca_v1_generated_CertificateAuthorityService_ListCertificateAuthorities_sync] +require "google/cloud/security/private_ca/v1" + +## +# Snippet for the list_certificate_authorities call in the CertificateAuthorityService service +# +# This snippet has been automatically generated and should be regarded as a code +# template only. It will require modifications to work: +# - It may require correct/in-range values for request initialization. +# - It may require specifying regional endpoints when creating the service +# client as shown in https://cloud.google.com/ruby/docs/reference. +# +# This is an auto-generated example demonstrating basic usage of +# Google::Cloud::Security::PrivateCA::V1::CertificateAuthorityService::Client#list_certificate_authorities. +# +def list_certificate_authorities + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Security::PrivateCA::V1::CertificateAuthorityService::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Security::PrivateCA::V1::ListCertificateAuthoritiesRequest.new + + # Call the list_certificate_authorities method. + result = client.list_certificate_authorities request + + # The returned object is of type Gapic::PagedEnumerable. You can iterate + # over elements, and API calls will be issued to fetch pages as needed. + result.each do |item| + # Each element is of type ::Google::Cloud::Security::PrivateCA::V1::CertificateAuthority. + p item + end +end +# [END privateca_v1_generated_CertificateAuthorityService_ListCertificateAuthorities_sync] diff --git a/owl-bot-staging/google-cloud-security-private_ca-v1/snippets/certificate_authority_service/list_certificate_revocation_lists.rb b/owl-bot-staging/google-cloud-security-private_ca-v1/snippets/certificate_authority_service/list_certificate_revocation_lists.rb new file mode 100644 index 000000000000..32d72bf58c5c --- /dev/null +++ b/owl-bot-staging/google-cloud-security-private_ca-v1/snippets/certificate_authority_service/list_certificate_revocation_lists.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 privateca_v1_generated_CertificateAuthorityService_ListCertificateRevocationLists_sync] +require "google/cloud/security/private_ca/v1" + +## +# Snippet for the list_certificate_revocation_lists call in the CertificateAuthorityService service +# +# This snippet has been automatically generated and should be regarded as a code +# template only. It will require modifications to work: +# - It may require correct/in-range values for request initialization. +# - It may require specifying regional endpoints when creating the service +# client as shown in https://cloud.google.com/ruby/docs/reference. +# +# This is an auto-generated example demonstrating basic usage of +# Google::Cloud::Security::PrivateCA::V1::CertificateAuthorityService::Client#list_certificate_revocation_lists. +# +def list_certificate_revocation_lists + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Security::PrivateCA::V1::CertificateAuthorityService::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Security::PrivateCA::V1::ListCertificateRevocationListsRequest.new + + # Call the list_certificate_revocation_lists method. + result = client.list_certificate_revocation_lists request + + # The returned object is of type Gapic::PagedEnumerable. You can iterate + # over elements, and API calls will be issued to fetch pages as needed. + result.each do |item| + # Each element is of type ::Google::Cloud::Security::PrivateCA::V1::CertificateRevocationList. + p item + end +end +# [END privateca_v1_generated_CertificateAuthorityService_ListCertificateRevocationLists_sync] diff --git a/owl-bot-staging/google-cloud-security-private_ca-v1/snippets/certificate_authority_service/list_certificate_templates.rb b/owl-bot-staging/google-cloud-security-private_ca-v1/snippets/certificate_authority_service/list_certificate_templates.rb new file mode 100644 index 000000000000..269ed16695f8 --- /dev/null +++ b/owl-bot-staging/google-cloud-security-private_ca-v1/snippets/certificate_authority_service/list_certificate_templates.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 privateca_v1_generated_CertificateAuthorityService_ListCertificateTemplates_sync] +require "google/cloud/security/private_ca/v1" + +## +# Snippet for the list_certificate_templates call in the CertificateAuthorityService service +# +# This snippet has been automatically generated and should be regarded as a code +# template only. It will require modifications to work: +# - It may require correct/in-range values for request initialization. +# - It may require specifying regional endpoints when creating the service +# client as shown in https://cloud.google.com/ruby/docs/reference. +# +# This is an auto-generated example demonstrating basic usage of +# Google::Cloud::Security::PrivateCA::V1::CertificateAuthorityService::Client#list_certificate_templates. +# +def list_certificate_templates + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Security::PrivateCA::V1::CertificateAuthorityService::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Security::PrivateCA::V1::ListCertificateTemplatesRequest.new + + # Call the list_certificate_templates method. + result = client.list_certificate_templates request + + # The returned object is of type Gapic::PagedEnumerable. You can iterate + # over elements, and API calls will be issued to fetch pages as needed. + result.each do |item| + # Each element is of type ::Google::Cloud::Security::PrivateCA::V1::CertificateTemplate. + p item + end +end +# [END privateca_v1_generated_CertificateAuthorityService_ListCertificateTemplates_sync] diff --git a/owl-bot-staging/google-cloud-security-private_ca-v1/snippets/certificate_authority_service/list_certificates.rb b/owl-bot-staging/google-cloud-security-private_ca-v1/snippets/certificate_authority_service/list_certificates.rb new file mode 100644 index 000000000000..dfdcae76c14f --- /dev/null +++ b/owl-bot-staging/google-cloud-security-private_ca-v1/snippets/certificate_authority_service/list_certificates.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 privateca_v1_generated_CertificateAuthorityService_ListCertificates_sync] +require "google/cloud/security/private_ca/v1" + +## +# Snippet for the list_certificates call in the CertificateAuthorityService service +# +# This snippet has been automatically generated and should be regarded as a code +# template only. It will require modifications to work: +# - It may require correct/in-range values for request initialization. +# - It may require specifying regional endpoints when creating the service +# client as shown in https://cloud.google.com/ruby/docs/reference. +# +# This is an auto-generated example demonstrating basic usage of +# Google::Cloud::Security::PrivateCA::V1::CertificateAuthorityService::Client#list_certificates. +# +def list_certificates + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Security::PrivateCA::V1::CertificateAuthorityService::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Security::PrivateCA::V1::ListCertificatesRequest.new + + # Call the list_certificates method. + result = client.list_certificates request + + # The returned object is of type Gapic::PagedEnumerable. You can iterate + # over elements, and API calls will be issued to fetch pages as needed. + result.each do |item| + # Each element is of type ::Google::Cloud::Security::PrivateCA::V1::Certificate. + p item + end +end +# [END privateca_v1_generated_CertificateAuthorityService_ListCertificates_sync] diff --git a/owl-bot-staging/google-cloud-security-private_ca-v1/snippets/certificate_authority_service/revoke_certificate.rb b/owl-bot-staging/google-cloud-security-private_ca-v1/snippets/certificate_authority_service/revoke_certificate.rb new file mode 100644 index 000000000000..85e6363d58ac --- /dev/null +++ b/owl-bot-staging/google-cloud-security-private_ca-v1/snippets/certificate_authority_service/revoke_certificate.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 privateca_v1_generated_CertificateAuthorityService_RevokeCertificate_sync] +require "google/cloud/security/private_ca/v1" + +## +# Snippet for the revoke_certificate call in the CertificateAuthorityService service +# +# This snippet has been automatically generated and should be regarded as a code +# template only. It will require modifications to work: +# - It may require correct/in-range values for request initialization. +# - It may require specifying regional endpoints when creating the service +# client as shown in https://cloud.google.com/ruby/docs/reference. +# +# This is an auto-generated example demonstrating basic usage of +# Google::Cloud::Security::PrivateCA::V1::CertificateAuthorityService::Client#revoke_certificate. +# +def revoke_certificate + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Security::PrivateCA::V1::CertificateAuthorityService::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Security::PrivateCA::V1::RevokeCertificateRequest.new + + # Call the revoke_certificate method. + result = client.revoke_certificate request + + # The returned object is of type Google::Cloud::Security::PrivateCA::V1::Certificate. + p result +end +# [END privateca_v1_generated_CertificateAuthorityService_RevokeCertificate_sync] diff --git a/owl-bot-staging/google-cloud-security-private_ca-v1/snippets/certificate_authority_service/undelete_certificate_authority.rb b/owl-bot-staging/google-cloud-security-private_ca-v1/snippets/certificate_authority_service/undelete_certificate_authority.rb new file mode 100644 index 000000000000..0aaba870e26d --- /dev/null +++ b/owl-bot-staging/google-cloud-security-private_ca-v1/snippets/certificate_authority_service/undelete_certificate_authority.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 privateca_v1_generated_CertificateAuthorityService_UndeleteCertificateAuthority_sync] +require "google/cloud/security/private_ca/v1" + +## +# Snippet for the undelete_certificate_authority call in the CertificateAuthorityService service +# +# This snippet has been automatically generated and should be regarded as a code +# template only. It will require modifications to work: +# - It may require correct/in-range values for request initialization. +# - It may require specifying regional endpoints when creating the service +# client as shown in https://cloud.google.com/ruby/docs/reference. +# +# This is an auto-generated example demonstrating basic usage of +# Google::Cloud::Security::PrivateCA::V1::CertificateAuthorityService::Client#undelete_certificate_authority. +# +def undelete_certificate_authority + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Security::PrivateCA::V1::CertificateAuthorityService::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Security::PrivateCA::V1::UndeleteCertificateAuthorityRequest.new + + # Call the undelete_certificate_authority method. + result = client.undelete_certificate_authority 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 privateca_v1_generated_CertificateAuthorityService_UndeleteCertificateAuthority_sync] diff --git a/owl-bot-staging/google-cloud-security-private_ca-v1/snippets/certificate_authority_service/update_ca_pool.rb b/owl-bot-staging/google-cloud-security-private_ca-v1/snippets/certificate_authority_service/update_ca_pool.rb new file mode 100644 index 000000000000..ff687e1efbc2 --- /dev/null +++ b/owl-bot-staging/google-cloud-security-private_ca-v1/snippets/certificate_authority_service/update_ca_pool.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 privateca_v1_generated_CertificateAuthorityService_UpdateCaPool_sync] +require "google/cloud/security/private_ca/v1" + +## +# Snippet for the update_ca_pool call in the CertificateAuthorityService service +# +# This snippet has been automatically generated and should be regarded as a code +# template only. It will require modifications to work: +# - It may require correct/in-range values for request initialization. +# - It may require specifying regional endpoints when creating the service +# client as shown in https://cloud.google.com/ruby/docs/reference. +# +# This is an auto-generated example demonstrating basic usage of +# Google::Cloud::Security::PrivateCA::V1::CertificateAuthorityService::Client#update_ca_pool. +# +def update_ca_pool + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Security::PrivateCA::V1::CertificateAuthorityService::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Security::PrivateCA::V1::UpdateCaPoolRequest.new + + # Call the update_ca_pool method. + result = client.update_ca_pool 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 privateca_v1_generated_CertificateAuthorityService_UpdateCaPool_sync] diff --git a/owl-bot-staging/google-cloud-security-private_ca-v1/snippets/certificate_authority_service/update_certificate.rb b/owl-bot-staging/google-cloud-security-private_ca-v1/snippets/certificate_authority_service/update_certificate.rb new file mode 100644 index 000000000000..82e041db102b --- /dev/null +++ b/owl-bot-staging/google-cloud-security-private_ca-v1/snippets/certificate_authority_service/update_certificate.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 privateca_v1_generated_CertificateAuthorityService_UpdateCertificate_sync] +require "google/cloud/security/private_ca/v1" + +## +# Snippet for the update_certificate call in the CertificateAuthorityService service +# +# This snippet has been automatically generated and should be regarded as a code +# template only. It will require modifications to work: +# - It may require correct/in-range values for request initialization. +# - It may require specifying regional endpoints when creating the service +# client as shown in https://cloud.google.com/ruby/docs/reference. +# +# This is an auto-generated example demonstrating basic usage of +# Google::Cloud::Security::PrivateCA::V1::CertificateAuthorityService::Client#update_certificate. +# +def update_certificate + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Security::PrivateCA::V1::CertificateAuthorityService::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Security::PrivateCA::V1::UpdateCertificateRequest.new + + # Call the update_certificate method. + result = client.update_certificate request + + # The returned object is of type Google::Cloud::Security::PrivateCA::V1::Certificate. + p result +end +# [END privateca_v1_generated_CertificateAuthorityService_UpdateCertificate_sync] diff --git a/owl-bot-staging/google-cloud-security-private_ca-v1/snippets/certificate_authority_service/update_certificate_authority.rb b/owl-bot-staging/google-cloud-security-private_ca-v1/snippets/certificate_authority_service/update_certificate_authority.rb new file mode 100644 index 000000000000..4f4aacbc82f0 --- /dev/null +++ b/owl-bot-staging/google-cloud-security-private_ca-v1/snippets/certificate_authority_service/update_certificate_authority.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 privateca_v1_generated_CertificateAuthorityService_UpdateCertificateAuthority_sync] +require "google/cloud/security/private_ca/v1" + +## +# Snippet for the update_certificate_authority call in the CertificateAuthorityService service +# +# This snippet has been automatically generated and should be regarded as a code +# template only. It will require modifications to work: +# - It may require correct/in-range values for request initialization. +# - It may require specifying regional endpoints when creating the service +# client as shown in https://cloud.google.com/ruby/docs/reference. +# +# This is an auto-generated example demonstrating basic usage of +# Google::Cloud::Security::PrivateCA::V1::CertificateAuthorityService::Client#update_certificate_authority. +# +def update_certificate_authority + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Security::PrivateCA::V1::CertificateAuthorityService::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Security::PrivateCA::V1::UpdateCertificateAuthorityRequest.new + + # Call the update_certificate_authority method. + result = client.update_certificate_authority 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 privateca_v1_generated_CertificateAuthorityService_UpdateCertificateAuthority_sync] diff --git a/owl-bot-staging/google-cloud-security-private_ca-v1/snippets/certificate_authority_service/update_certificate_revocation_list.rb b/owl-bot-staging/google-cloud-security-private_ca-v1/snippets/certificate_authority_service/update_certificate_revocation_list.rb new file mode 100644 index 000000000000..3f573ab17f29 --- /dev/null +++ b/owl-bot-staging/google-cloud-security-private_ca-v1/snippets/certificate_authority_service/update_certificate_revocation_list.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 privateca_v1_generated_CertificateAuthorityService_UpdateCertificateRevocationList_sync] +require "google/cloud/security/private_ca/v1" + +## +# Snippet for the update_certificate_revocation_list call in the CertificateAuthorityService service +# +# This snippet has been automatically generated and should be regarded as a code +# template only. It will require modifications to work: +# - It may require correct/in-range values for request initialization. +# - It may require specifying regional endpoints when creating the service +# client as shown in https://cloud.google.com/ruby/docs/reference. +# +# This is an auto-generated example demonstrating basic usage of +# Google::Cloud::Security::PrivateCA::V1::CertificateAuthorityService::Client#update_certificate_revocation_list. +# +def update_certificate_revocation_list + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Security::PrivateCA::V1::CertificateAuthorityService::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Security::PrivateCA::V1::UpdateCertificateRevocationListRequest.new + + # Call the update_certificate_revocation_list method. + result = client.update_certificate_revocation_list 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 privateca_v1_generated_CertificateAuthorityService_UpdateCertificateRevocationList_sync] diff --git a/owl-bot-staging/google-cloud-security-private_ca-v1/snippets/certificate_authority_service/update_certificate_template.rb b/owl-bot-staging/google-cloud-security-private_ca-v1/snippets/certificate_authority_service/update_certificate_template.rb new file mode 100644 index 000000000000..037307454cb4 --- /dev/null +++ b/owl-bot-staging/google-cloud-security-private_ca-v1/snippets/certificate_authority_service/update_certificate_template.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 privateca_v1_generated_CertificateAuthorityService_UpdateCertificateTemplate_sync] +require "google/cloud/security/private_ca/v1" + +## +# Snippet for the update_certificate_template call in the CertificateAuthorityService service +# +# This snippet has been automatically generated and should be regarded as a code +# template only. It will require modifications to work: +# - It may require correct/in-range values for request initialization. +# - It may require specifying regional endpoints when creating the service +# client as shown in https://cloud.google.com/ruby/docs/reference. +# +# This is an auto-generated example demonstrating basic usage of +# Google::Cloud::Security::PrivateCA::V1::CertificateAuthorityService::Client#update_certificate_template. +# +def update_certificate_template + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Security::PrivateCA::V1::CertificateAuthorityService::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Security::PrivateCA::V1::UpdateCertificateTemplateRequest.new + + # Call the update_certificate_template method. + result = client.update_certificate_template 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 privateca_v1_generated_CertificateAuthorityService_UpdateCertificateTemplate_sync] diff --git a/owl-bot-staging/google-cloud-security-private_ca-v1/snippets/snippet_metadata_google.cloud.security.privateca.v1.json b/owl-bot-staging/google-cloud-security-private_ca-v1/snippets/snippet_metadata_google.cloud.security.privateca.v1.json new file mode 100644 index 000000000000..9534d7bc3fea --- /dev/null +++ b/owl-bot-staging/google-cloud-security-private_ca-v1/snippets/snippet_metadata_google.cloud.security.privateca.v1.json @@ -0,0 +1,1175 @@ +{ + "client_library": { + "name": "google-cloud-security-private_ca-v1", + "version": "", + "language": "RUBY", + "apis": [ + { + "id": "google.cloud.security.privateca.v1", + "version": "v1" + } + ] + }, + "snippets": [ + { + "region_tag": "privateca_v1_generated_CertificateAuthorityService_CreateCertificate_sync", + "title": "Snippet for the create_certificate call in the CertificateAuthorityService service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Security::PrivateCA::V1::CertificateAuthorityService::Client#create_certificate.", + "file": "certificate_authority_service/create_certificate.rb", + "language": "RUBY", + "client_method": { + "short_name": "create_certificate", + "full_name": "::Google::Cloud::Security::PrivateCA::V1::CertificateAuthorityService::Client#create_certificate", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::Security::PrivateCA::V1::CreateCertificateRequest", + "name": "request" + } + ], + "result_type": "::Google::Cloud::Security::PrivateCA::V1::Certificate", + "client": { + "short_name": "CertificateAuthorityService::Client", + "full_name": "::Google::Cloud::Security::PrivateCA::V1::CertificateAuthorityService::Client" + }, + "method": { + "short_name": "CreateCertificate", + "full_name": "google.cloud.security.privateca.v1.CertificateAuthorityService.CreateCertificate", + "service": { + "short_name": "CertificateAuthorityService", + "full_name": "google.cloud.security.privateca.v1.CertificateAuthorityService" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 46, + "type": "FULL" + } + ] + }, + { + "region_tag": "privateca_v1_generated_CertificateAuthorityService_GetCertificate_sync", + "title": "Snippet for the get_certificate call in the CertificateAuthorityService service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Security::PrivateCA::V1::CertificateAuthorityService::Client#get_certificate.", + "file": "certificate_authority_service/get_certificate.rb", + "language": "RUBY", + "client_method": { + "short_name": "get_certificate", + "full_name": "::Google::Cloud::Security::PrivateCA::V1::CertificateAuthorityService::Client#get_certificate", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::Security::PrivateCA::V1::GetCertificateRequest", + "name": "request" + } + ], + "result_type": "::Google::Cloud::Security::PrivateCA::V1::Certificate", + "client": { + "short_name": "CertificateAuthorityService::Client", + "full_name": "::Google::Cloud::Security::PrivateCA::V1::CertificateAuthorityService::Client" + }, + "method": { + "short_name": "GetCertificate", + "full_name": "google.cloud.security.privateca.v1.CertificateAuthorityService.GetCertificate", + "service": { + "short_name": "CertificateAuthorityService", + "full_name": "google.cloud.security.privateca.v1.CertificateAuthorityService" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 46, + "type": "FULL" + } + ] + }, + { + "region_tag": "privateca_v1_generated_CertificateAuthorityService_ListCertificates_sync", + "title": "Snippet for the list_certificates call in the CertificateAuthorityService service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Security::PrivateCA::V1::CertificateAuthorityService::Client#list_certificates.", + "file": "certificate_authority_service/list_certificates.rb", + "language": "RUBY", + "client_method": { + "short_name": "list_certificates", + "full_name": "::Google::Cloud::Security::PrivateCA::V1::CertificateAuthorityService::Client#list_certificates", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::Security::PrivateCA::V1::ListCertificatesRequest", + "name": "request" + } + ], + "result_type": "::Google::Cloud::Security::PrivateCA::V1::ListCertificatesResponse", + "client": { + "short_name": "CertificateAuthorityService::Client", + "full_name": "::Google::Cloud::Security::PrivateCA::V1::CertificateAuthorityService::Client" + }, + "method": { + "short_name": "ListCertificates", + "full_name": "google.cloud.security.privateca.v1.CertificateAuthorityService.ListCertificates", + "service": { + "short_name": "CertificateAuthorityService", + "full_name": "google.cloud.security.privateca.v1.CertificateAuthorityService" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 50, + "type": "FULL" + } + ] + }, + { + "region_tag": "privateca_v1_generated_CertificateAuthorityService_RevokeCertificate_sync", + "title": "Snippet for the revoke_certificate call in the CertificateAuthorityService service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Security::PrivateCA::V1::CertificateAuthorityService::Client#revoke_certificate.", + "file": "certificate_authority_service/revoke_certificate.rb", + "language": "RUBY", + "client_method": { + "short_name": "revoke_certificate", + "full_name": "::Google::Cloud::Security::PrivateCA::V1::CertificateAuthorityService::Client#revoke_certificate", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::Security::PrivateCA::V1::RevokeCertificateRequest", + "name": "request" + } + ], + "result_type": "::Google::Cloud::Security::PrivateCA::V1::Certificate", + "client": { + "short_name": "CertificateAuthorityService::Client", + "full_name": "::Google::Cloud::Security::PrivateCA::V1::CertificateAuthorityService::Client" + }, + "method": { + "short_name": "RevokeCertificate", + "full_name": "google.cloud.security.privateca.v1.CertificateAuthorityService.RevokeCertificate", + "service": { + "short_name": "CertificateAuthorityService", + "full_name": "google.cloud.security.privateca.v1.CertificateAuthorityService" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 46, + "type": "FULL" + } + ] + }, + { + "region_tag": "privateca_v1_generated_CertificateAuthorityService_UpdateCertificate_sync", + "title": "Snippet for the update_certificate call in the CertificateAuthorityService service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Security::PrivateCA::V1::CertificateAuthorityService::Client#update_certificate.", + "file": "certificate_authority_service/update_certificate.rb", + "language": "RUBY", + "client_method": { + "short_name": "update_certificate", + "full_name": "::Google::Cloud::Security::PrivateCA::V1::CertificateAuthorityService::Client#update_certificate", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::Security::PrivateCA::V1::UpdateCertificateRequest", + "name": "request" + } + ], + "result_type": "::Google::Cloud::Security::PrivateCA::V1::Certificate", + "client": { + "short_name": "CertificateAuthorityService::Client", + "full_name": "::Google::Cloud::Security::PrivateCA::V1::CertificateAuthorityService::Client" + }, + "method": { + "short_name": "UpdateCertificate", + "full_name": "google.cloud.security.privateca.v1.CertificateAuthorityService.UpdateCertificate", + "service": { + "short_name": "CertificateAuthorityService", + "full_name": "google.cloud.security.privateca.v1.CertificateAuthorityService" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 46, + "type": "FULL" + } + ] + }, + { + "region_tag": "privateca_v1_generated_CertificateAuthorityService_ActivateCertificateAuthority_sync", + "title": "Snippet for the activate_certificate_authority call in the CertificateAuthorityService service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Security::PrivateCA::V1::CertificateAuthorityService::Client#activate_certificate_authority.", + "file": "certificate_authority_service/activate_certificate_authority.rb", + "language": "RUBY", + "client_method": { + "short_name": "activate_certificate_authority", + "full_name": "::Google::Cloud::Security::PrivateCA::V1::CertificateAuthorityService::Client#activate_certificate_authority", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::Security::PrivateCA::V1::ActivateCertificateAuthorityRequest", + "name": "request" + } + ], + "result_type": "::Google::Longrunning::Operation", + "client": { + "short_name": "CertificateAuthorityService::Client", + "full_name": "::Google::Cloud::Security::PrivateCA::V1::CertificateAuthorityService::Client" + }, + "method": { + "short_name": "ActivateCertificateAuthority", + "full_name": "google.cloud.security.privateca.v1.CertificateAuthorityService.ActivateCertificateAuthority", + "service": { + "short_name": "CertificateAuthorityService", + "full_name": "google.cloud.security.privateca.v1.CertificateAuthorityService" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 53, + "type": "FULL" + } + ] + }, + { + "region_tag": "privateca_v1_generated_CertificateAuthorityService_CreateCertificateAuthority_sync", + "title": "Snippet for the create_certificate_authority call in the CertificateAuthorityService service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Security::PrivateCA::V1::CertificateAuthorityService::Client#create_certificate_authority.", + "file": "certificate_authority_service/create_certificate_authority.rb", + "language": "RUBY", + "client_method": { + "short_name": "create_certificate_authority", + "full_name": "::Google::Cloud::Security::PrivateCA::V1::CertificateAuthorityService::Client#create_certificate_authority", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::Security::PrivateCA::V1::CreateCertificateAuthorityRequest", + "name": "request" + } + ], + "result_type": "::Google::Longrunning::Operation", + "client": { + "short_name": "CertificateAuthorityService::Client", + "full_name": "::Google::Cloud::Security::PrivateCA::V1::CertificateAuthorityService::Client" + }, + "method": { + "short_name": "CreateCertificateAuthority", + "full_name": "google.cloud.security.privateca.v1.CertificateAuthorityService.CreateCertificateAuthority", + "service": { + "short_name": "CertificateAuthorityService", + "full_name": "google.cloud.security.privateca.v1.CertificateAuthorityService" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 53, + "type": "FULL" + } + ] + }, + { + "region_tag": "privateca_v1_generated_CertificateAuthorityService_DisableCertificateAuthority_sync", + "title": "Snippet for the disable_certificate_authority call in the CertificateAuthorityService service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Security::PrivateCA::V1::CertificateAuthorityService::Client#disable_certificate_authority.", + "file": "certificate_authority_service/disable_certificate_authority.rb", + "language": "RUBY", + "client_method": { + "short_name": "disable_certificate_authority", + "full_name": "::Google::Cloud::Security::PrivateCA::V1::CertificateAuthorityService::Client#disable_certificate_authority", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::Security::PrivateCA::V1::DisableCertificateAuthorityRequest", + "name": "request" + } + ], + "result_type": "::Google::Longrunning::Operation", + "client": { + "short_name": "CertificateAuthorityService::Client", + "full_name": "::Google::Cloud::Security::PrivateCA::V1::CertificateAuthorityService::Client" + }, + "method": { + "short_name": "DisableCertificateAuthority", + "full_name": "google.cloud.security.privateca.v1.CertificateAuthorityService.DisableCertificateAuthority", + "service": { + "short_name": "CertificateAuthorityService", + "full_name": "google.cloud.security.privateca.v1.CertificateAuthorityService" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 53, + "type": "FULL" + } + ] + }, + { + "region_tag": "privateca_v1_generated_CertificateAuthorityService_EnableCertificateAuthority_sync", + "title": "Snippet for the enable_certificate_authority call in the CertificateAuthorityService service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Security::PrivateCA::V1::CertificateAuthorityService::Client#enable_certificate_authority.", + "file": "certificate_authority_service/enable_certificate_authority.rb", + "language": "RUBY", + "client_method": { + "short_name": "enable_certificate_authority", + "full_name": "::Google::Cloud::Security::PrivateCA::V1::CertificateAuthorityService::Client#enable_certificate_authority", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::Security::PrivateCA::V1::EnableCertificateAuthorityRequest", + "name": "request" + } + ], + "result_type": "::Google::Longrunning::Operation", + "client": { + "short_name": "CertificateAuthorityService::Client", + "full_name": "::Google::Cloud::Security::PrivateCA::V1::CertificateAuthorityService::Client" + }, + "method": { + "short_name": "EnableCertificateAuthority", + "full_name": "google.cloud.security.privateca.v1.CertificateAuthorityService.EnableCertificateAuthority", + "service": { + "short_name": "CertificateAuthorityService", + "full_name": "google.cloud.security.privateca.v1.CertificateAuthorityService" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 53, + "type": "FULL" + } + ] + }, + { + "region_tag": "privateca_v1_generated_CertificateAuthorityService_FetchCertificateAuthorityCsr_sync", + "title": "Snippet for the fetch_certificate_authority_csr call in the CertificateAuthorityService service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Security::PrivateCA::V1::CertificateAuthorityService::Client#fetch_certificate_authority_csr.", + "file": "certificate_authority_service/fetch_certificate_authority_csr.rb", + "language": "RUBY", + "client_method": { + "short_name": "fetch_certificate_authority_csr", + "full_name": "::Google::Cloud::Security::PrivateCA::V1::CertificateAuthorityService::Client#fetch_certificate_authority_csr", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::Security::PrivateCA::V1::FetchCertificateAuthorityCsrRequest", + "name": "request" + } + ], + "result_type": "::Google::Cloud::Security::PrivateCA::V1::FetchCertificateAuthorityCsrResponse", + "client": { + "short_name": "CertificateAuthorityService::Client", + "full_name": "::Google::Cloud::Security::PrivateCA::V1::CertificateAuthorityService::Client" + }, + "method": { + "short_name": "FetchCertificateAuthorityCsr", + "full_name": "google.cloud.security.privateca.v1.CertificateAuthorityService.FetchCertificateAuthorityCsr", + "service": { + "short_name": "CertificateAuthorityService", + "full_name": "google.cloud.security.privateca.v1.CertificateAuthorityService" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 46, + "type": "FULL" + } + ] + }, + { + "region_tag": "privateca_v1_generated_CertificateAuthorityService_GetCertificateAuthority_sync", + "title": "Snippet for the get_certificate_authority call in the CertificateAuthorityService service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Security::PrivateCA::V1::CertificateAuthorityService::Client#get_certificate_authority.", + "file": "certificate_authority_service/get_certificate_authority.rb", + "language": "RUBY", + "client_method": { + "short_name": "get_certificate_authority", + "full_name": "::Google::Cloud::Security::PrivateCA::V1::CertificateAuthorityService::Client#get_certificate_authority", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::Security::PrivateCA::V1::GetCertificateAuthorityRequest", + "name": "request" + } + ], + "result_type": "::Google::Cloud::Security::PrivateCA::V1::CertificateAuthority", + "client": { + "short_name": "CertificateAuthorityService::Client", + "full_name": "::Google::Cloud::Security::PrivateCA::V1::CertificateAuthorityService::Client" + }, + "method": { + "short_name": "GetCertificateAuthority", + "full_name": "google.cloud.security.privateca.v1.CertificateAuthorityService.GetCertificateAuthority", + "service": { + "short_name": "CertificateAuthorityService", + "full_name": "google.cloud.security.privateca.v1.CertificateAuthorityService" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 46, + "type": "FULL" + } + ] + }, + { + "region_tag": "privateca_v1_generated_CertificateAuthorityService_ListCertificateAuthorities_sync", + "title": "Snippet for the list_certificate_authorities call in the CertificateAuthorityService service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Security::PrivateCA::V1::CertificateAuthorityService::Client#list_certificate_authorities.", + "file": "certificate_authority_service/list_certificate_authorities.rb", + "language": "RUBY", + "client_method": { + "short_name": "list_certificate_authorities", + "full_name": "::Google::Cloud::Security::PrivateCA::V1::CertificateAuthorityService::Client#list_certificate_authorities", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::Security::PrivateCA::V1::ListCertificateAuthoritiesRequest", + "name": "request" + } + ], + "result_type": "::Google::Cloud::Security::PrivateCA::V1::ListCertificateAuthoritiesResponse", + "client": { + "short_name": "CertificateAuthorityService::Client", + "full_name": "::Google::Cloud::Security::PrivateCA::V1::CertificateAuthorityService::Client" + }, + "method": { + "short_name": "ListCertificateAuthorities", + "full_name": "google.cloud.security.privateca.v1.CertificateAuthorityService.ListCertificateAuthorities", + "service": { + "short_name": "CertificateAuthorityService", + "full_name": "google.cloud.security.privateca.v1.CertificateAuthorityService" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 50, + "type": "FULL" + } + ] + }, + { + "region_tag": "privateca_v1_generated_CertificateAuthorityService_UndeleteCertificateAuthority_sync", + "title": "Snippet for the undelete_certificate_authority call in the CertificateAuthorityService service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Security::PrivateCA::V1::CertificateAuthorityService::Client#undelete_certificate_authority.", + "file": "certificate_authority_service/undelete_certificate_authority.rb", + "language": "RUBY", + "client_method": { + "short_name": "undelete_certificate_authority", + "full_name": "::Google::Cloud::Security::PrivateCA::V1::CertificateAuthorityService::Client#undelete_certificate_authority", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::Security::PrivateCA::V1::UndeleteCertificateAuthorityRequest", + "name": "request" + } + ], + "result_type": "::Google::Longrunning::Operation", + "client": { + "short_name": "CertificateAuthorityService::Client", + "full_name": "::Google::Cloud::Security::PrivateCA::V1::CertificateAuthorityService::Client" + }, + "method": { + "short_name": "UndeleteCertificateAuthority", + "full_name": "google.cloud.security.privateca.v1.CertificateAuthorityService.UndeleteCertificateAuthority", + "service": { + "short_name": "CertificateAuthorityService", + "full_name": "google.cloud.security.privateca.v1.CertificateAuthorityService" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 53, + "type": "FULL" + } + ] + }, + { + "region_tag": "privateca_v1_generated_CertificateAuthorityService_DeleteCertificateAuthority_sync", + "title": "Snippet for the delete_certificate_authority call in the CertificateAuthorityService service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Security::PrivateCA::V1::CertificateAuthorityService::Client#delete_certificate_authority.", + "file": "certificate_authority_service/delete_certificate_authority.rb", + "language": "RUBY", + "client_method": { + "short_name": "delete_certificate_authority", + "full_name": "::Google::Cloud::Security::PrivateCA::V1::CertificateAuthorityService::Client#delete_certificate_authority", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::Security::PrivateCA::V1::DeleteCertificateAuthorityRequest", + "name": "request" + } + ], + "result_type": "::Google::Longrunning::Operation", + "client": { + "short_name": "CertificateAuthorityService::Client", + "full_name": "::Google::Cloud::Security::PrivateCA::V1::CertificateAuthorityService::Client" + }, + "method": { + "short_name": "DeleteCertificateAuthority", + "full_name": "google.cloud.security.privateca.v1.CertificateAuthorityService.DeleteCertificateAuthority", + "service": { + "short_name": "CertificateAuthorityService", + "full_name": "google.cloud.security.privateca.v1.CertificateAuthorityService" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 53, + "type": "FULL" + } + ] + }, + { + "region_tag": "privateca_v1_generated_CertificateAuthorityService_UpdateCertificateAuthority_sync", + "title": "Snippet for the update_certificate_authority call in the CertificateAuthorityService service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Security::PrivateCA::V1::CertificateAuthorityService::Client#update_certificate_authority.", + "file": "certificate_authority_service/update_certificate_authority.rb", + "language": "RUBY", + "client_method": { + "short_name": "update_certificate_authority", + "full_name": "::Google::Cloud::Security::PrivateCA::V1::CertificateAuthorityService::Client#update_certificate_authority", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::Security::PrivateCA::V1::UpdateCertificateAuthorityRequest", + "name": "request" + } + ], + "result_type": "::Google::Longrunning::Operation", + "client": { + "short_name": "CertificateAuthorityService::Client", + "full_name": "::Google::Cloud::Security::PrivateCA::V1::CertificateAuthorityService::Client" + }, + "method": { + "short_name": "UpdateCertificateAuthority", + "full_name": "google.cloud.security.privateca.v1.CertificateAuthorityService.UpdateCertificateAuthority", + "service": { + "short_name": "CertificateAuthorityService", + "full_name": "google.cloud.security.privateca.v1.CertificateAuthorityService" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 53, + "type": "FULL" + } + ] + }, + { + "region_tag": "privateca_v1_generated_CertificateAuthorityService_CreateCaPool_sync", + "title": "Snippet for the create_ca_pool call in the CertificateAuthorityService service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Security::PrivateCA::V1::CertificateAuthorityService::Client#create_ca_pool.", + "file": "certificate_authority_service/create_ca_pool.rb", + "language": "RUBY", + "client_method": { + "short_name": "create_ca_pool", + "full_name": "::Google::Cloud::Security::PrivateCA::V1::CertificateAuthorityService::Client#create_ca_pool", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::Security::PrivateCA::V1::CreateCaPoolRequest", + "name": "request" + } + ], + "result_type": "::Google::Longrunning::Operation", + "client": { + "short_name": "CertificateAuthorityService::Client", + "full_name": "::Google::Cloud::Security::PrivateCA::V1::CertificateAuthorityService::Client" + }, + "method": { + "short_name": "CreateCaPool", + "full_name": "google.cloud.security.privateca.v1.CertificateAuthorityService.CreateCaPool", + "service": { + "short_name": "CertificateAuthorityService", + "full_name": "google.cloud.security.privateca.v1.CertificateAuthorityService" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 53, + "type": "FULL" + } + ] + }, + { + "region_tag": "privateca_v1_generated_CertificateAuthorityService_UpdateCaPool_sync", + "title": "Snippet for the update_ca_pool call in the CertificateAuthorityService service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Security::PrivateCA::V1::CertificateAuthorityService::Client#update_ca_pool.", + "file": "certificate_authority_service/update_ca_pool.rb", + "language": "RUBY", + "client_method": { + "short_name": "update_ca_pool", + "full_name": "::Google::Cloud::Security::PrivateCA::V1::CertificateAuthorityService::Client#update_ca_pool", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::Security::PrivateCA::V1::UpdateCaPoolRequest", + "name": "request" + } + ], + "result_type": "::Google::Longrunning::Operation", + "client": { + "short_name": "CertificateAuthorityService::Client", + "full_name": "::Google::Cloud::Security::PrivateCA::V1::CertificateAuthorityService::Client" + }, + "method": { + "short_name": "UpdateCaPool", + "full_name": "google.cloud.security.privateca.v1.CertificateAuthorityService.UpdateCaPool", + "service": { + "short_name": "CertificateAuthorityService", + "full_name": "google.cloud.security.privateca.v1.CertificateAuthorityService" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 53, + "type": "FULL" + } + ] + }, + { + "region_tag": "privateca_v1_generated_CertificateAuthorityService_GetCaPool_sync", + "title": "Snippet for the get_ca_pool call in the CertificateAuthorityService service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Security::PrivateCA::V1::CertificateAuthorityService::Client#get_ca_pool.", + "file": "certificate_authority_service/get_ca_pool.rb", + "language": "RUBY", + "client_method": { + "short_name": "get_ca_pool", + "full_name": "::Google::Cloud::Security::PrivateCA::V1::CertificateAuthorityService::Client#get_ca_pool", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::Security::PrivateCA::V1::GetCaPoolRequest", + "name": "request" + } + ], + "result_type": "::Google::Cloud::Security::PrivateCA::V1::CaPool", + "client": { + "short_name": "CertificateAuthorityService::Client", + "full_name": "::Google::Cloud::Security::PrivateCA::V1::CertificateAuthorityService::Client" + }, + "method": { + "short_name": "GetCaPool", + "full_name": "google.cloud.security.privateca.v1.CertificateAuthorityService.GetCaPool", + "service": { + "short_name": "CertificateAuthorityService", + "full_name": "google.cloud.security.privateca.v1.CertificateAuthorityService" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 46, + "type": "FULL" + } + ] + }, + { + "region_tag": "privateca_v1_generated_CertificateAuthorityService_ListCaPools_sync", + "title": "Snippet for the list_ca_pools call in the CertificateAuthorityService service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Security::PrivateCA::V1::CertificateAuthorityService::Client#list_ca_pools.", + "file": "certificate_authority_service/list_ca_pools.rb", + "language": "RUBY", + "client_method": { + "short_name": "list_ca_pools", + "full_name": "::Google::Cloud::Security::PrivateCA::V1::CertificateAuthorityService::Client#list_ca_pools", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::Security::PrivateCA::V1::ListCaPoolsRequest", + "name": "request" + } + ], + "result_type": "::Google::Cloud::Security::PrivateCA::V1::ListCaPoolsResponse", + "client": { + "short_name": "CertificateAuthorityService::Client", + "full_name": "::Google::Cloud::Security::PrivateCA::V1::CertificateAuthorityService::Client" + }, + "method": { + "short_name": "ListCaPools", + "full_name": "google.cloud.security.privateca.v1.CertificateAuthorityService.ListCaPools", + "service": { + "short_name": "CertificateAuthorityService", + "full_name": "google.cloud.security.privateca.v1.CertificateAuthorityService" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 50, + "type": "FULL" + } + ] + }, + { + "region_tag": "privateca_v1_generated_CertificateAuthorityService_DeleteCaPool_sync", + "title": "Snippet for the delete_ca_pool call in the CertificateAuthorityService service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Security::PrivateCA::V1::CertificateAuthorityService::Client#delete_ca_pool.", + "file": "certificate_authority_service/delete_ca_pool.rb", + "language": "RUBY", + "client_method": { + "short_name": "delete_ca_pool", + "full_name": "::Google::Cloud::Security::PrivateCA::V1::CertificateAuthorityService::Client#delete_ca_pool", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::Security::PrivateCA::V1::DeleteCaPoolRequest", + "name": "request" + } + ], + "result_type": "::Google::Longrunning::Operation", + "client": { + "short_name": "CertificateAuthorityService::Client", + "full_name": "::Google::Cloud::Security::PrivateCA::V1::CertificateAuthorityService::Client" + }, + "method": { + "short_name": "DeleteCaPool", + "full_name": "google.cloud.security.privateca.v1.CertificateAuthorityService.DeleteCaPool", + "service": { + "short_name": "CertificateAuthorityService", + "full_name": "google.cloud.security.privateca.v1.CertificateAuthorityService" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 53, + "type": "FULL" + } + ] + }, + { + "region_tag": "privateca_v1_generated_CertificateAuthorityService_FetchCaCerts_sync", + "title": "Snippet for the fetch_ca_certs call in the CertificateAuthorityService service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Security::PrivateCA::V1::CertificateAuthorityService::Client#fetch_ca_certs.", + "file": "certificate_authority_service/fetch_ca_certs.rb", + "language": "RUBY", + "client_method": { + "short_name": "fetch_ca_certs", + "full_name": "::Google::Cloud::Security::PrivateCA::V1::CertificateAuthorityService::Client#fetch_ca_certs", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::Security::PrivateCA::V1::FetchCaCertsRequest", + "name": "request" + } + ], + "result_type": "::Google::Cloud::Security::PrivateCA::V1::FetchCaCertsResponse", + "client": { + "short_name": "CertificateAuthorityService::Client", + "full_name": "::Google::Cloud::Security::PrivateCA::V1::CertificateAuthorityService::Client" + }, + "method": { + "short_name": "FetchCaCerts", + "full_name": "google.cloud.security.privateca.v1.CertificateAuthorityService.FetchCaCerts", + "service": { + "short_name": "CertificateAuthorityService", + "full_name": "google.cloud.security.privateca.v1.CertificateAuthorityService" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 46, + "type": "FULL" + } + ] + }, + { + "region_tag": "privateca_v1_generated_CertificateAuthorityService_GetCertificateRevocationList_sync", + "title": "Snippet for the get_certificate_revocation_list call in the CertificateAuthorityService service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Security::PrivateCA::V1::CertificateAuthorityService::Client#get_certificate_revocation_list.", + "file": "certificate_authority_service/get_certificate_revocation_list.rb", + "language": "RUBY", + "client_method": { + "short_name": "get_certificate_revocation_list", + "full_name": "::Google::Cloud::Security::PrivateCA::V1::CertificateAuthorityService::Client#get_certificate_revocation_list", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::Security::PrivateCA::V1::GetCertificateRevocationListRequest", + "name": "request" + } + ], + "result_type": "::Google::Cloud::Security::PrivateCA::V1::CertificateRevocationList", + "client": { + "short_name": "CertificateAuthorityService::Client", + "full_name": "::Google::Cloud::Security::PrivateCA::V1::CertificateAuthorityService::Client" + }, + "method": { + "short_name": "GetCertificateRevocationList", + "full_name": "google.cloud.security.privateca.v1.CertificateAuthorityService.GetCertificateRevocationList", + "service": { + "short_name": "CertificateAuthorityService", + "full_name": "google.cloud.security.privateca.v1.CertificateAuthorityService" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 46, + "type": "FULL" + } + ] + }, + { + "region_tag": "privateca_v1_generated_CertificateAuthorityService_ListCertificateRevocationLists_sync", + "title": "Snippet for the list_certificate_revocation_lists call in the CertificateAuthorityService service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Security::PrivateCA::V1::CertificateAuthorityService::Client#list_certificate_revocation_lists.", + "file": "certificate_authority_service/list_certificate_revocation_lists.rb", + "language": "RUBY", + "client_method": { + "short_name": "list_certificate_revocation_lists", + "full_name": "::Google::Cloud::Security::PrivateCA::V1::CertificateAuthorityService::Client#list_certificate_revocation_lists", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::Security::PrivateCA::V1::ListCertificateRevocationListsRequest", + "name": "request" + } + ], + "result_type": "::Google::Cloud::Security::PrivateCA::V1::ListCertificateRevocationListsResponse", + "client": { + "short_name": "CertificateAuthorityService::Client", + "full_name": "::Google::Cloud::Security::PrivateCA::V1::CertificateAuthorityService::Client" + }, + "method": { + "short_name": "ListCertificateRevocationLists", + "full_name": "google.cloud.security.privateca.v1.CertificateAuthorityService.ListCertificateRevocationLists", + "service": { + "short_name": "CertificateAuthorityService", + "full_name": "google.cloud.security.privateca.v1.CertificateAuthorityService" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 50, + "type": "FULL" + } + ] + }, + { + "region_tag": "privateca_v1_generated_CertificateAuthorityService_UpdateCertificateRevocationList_sync", + "title": "Snippet for the update_certificate_revocation_list call in the CertificateAuthorityService service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Security::PrivateCA::V1::CertificateAuthorityService::Client#update_certificate_revocation_list.", + "file": "certificate_authority_service/update_certificate_revocation_list.rb", + "language": "RUBY", + "client_method": { + "short_name": "update_certificate_revocation_list", + "full_name": "::Google::Cloud::Security::PrivateCA::V1::CertificateAuthorityService::Client#update_certificate_revocation_list", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::Security::PrivateCA::V1::UpdateCertificateRevocationListRequest", + "name": "request" + } + ], + "result_type": "::Google::Longrunning::Operation", + "client": { + "short_name": "CertificateAuthorityService::Client", + "full_name": "::Google::Cloud::Security::PrivateCA::V1::CertificateAuthorityService::Client" + }, + "method": { + "short_name": "UpdateCertificateRevocationList", + "full_name": "google.cloud.security.privateca.v1.CertificateAuthorityService.UpdateCertificateRevocationList", + "service": { + "short_name": "CertificateAuthorityService", + "full_name": "google.cloud.security.privateca.v1.CertificateAuthorityService" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 53, + "type": "FULL" + } + ] + }, + { + "region_tag": "privateca_v1_generated_CertificateAuthorityService_CreateCertificateTemplate_sync", + "title": "Snippet for the create_certificate_template call in the CertificateAuthorityService service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Security::PrivateCA::V1::CertificateAuthorityService::Client#create_certificate_template.", + "file": "certificate_authority_service/create_certificate_template.rb", + "language": "RUBY", + "client_method": { + "short_name": "create_certificate_template", + "full_name": "::Google::Cloud::Security::PrivateCA::V1::CertificateAuthorityService::Client#create_certificate_template", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::Security::PrivateCA::V1::CreateCertificateTemplateRequest", + "name": "request" + } + ], + "result_type": "::Google::Longrunning::Operation", + "client": { + "short_name": "CertificateAuthorityService::Client", + "full_name": "::Google::Cloud::Security::PrivateCA::V1::CertificateAuthorityService::Client" + }, + "method": { + "short_name": "CreateCertificateTemplate", + "full_name": "google.cloud.security.privateca.v1.CertificateAuthorityService.CreateCertificateTemplate", + "service": { + "short_name": "CertificateAuthorityService", + "full_name": "google.cloud.security.privateca.v1.CertificateAuthorityService" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 53, + "type": "FULL" + } + ] + }, + { + "region_tag": "privateca_v1_generated_CertificateAuthorityService_DeleteCertificateTemplate_sync", + "title": "Snippet for the delete_certificate_template call in the CertificateAuthorityService service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Security::PrivateCA::V1::CertificateAuthorityService::Client#delete_certificate_template.", + "file": "certificate_authority_service/delete_certificate_template.rb", + "language": "RUBY", + "client_method": { + "short_name": "delete_certificate_template", + "full_name": "::Google::Cloud::Security::PrivateCA::V1::CertificateAuthorityService::Client#delete_certificate_template", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::Security::PrivateCA::V1::DeleteCertificateTemplateRequest", + "name": "request" + } + ], + "result_type": "::Google::Longrunning::Operation", + "client": { + "short_name": "CertificateAuthorityService::Client", + "full_name": "::Google::Cloud::Security::PrivateCA::V1::CertificateAuthorityService::Client" + }, + "method": { + "short_name": "DeleteCertificateTemplate", + "full_name": "google.cloud.security.privateca.v1.CertificateAuthorityService.DeleteCertificateTemplate", + "service": { + "short_name": "CertificateAuthorityService", + "full_name": "google.cloud.security.privateca.v1.CertificateAuthorityService" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 53, + "type": "FULL" + } + ] + }, + { + "region_tag": "privateca_v1_generated_CertificateAuthorityService_GetCertificateTemplate_sync", + "title": "Snippet for the get_certificate_template call in the CertificateAuthorityService service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Security::PrivateCA::V1::CertificateAuthorityService::Client#get_certificate_template.", + "file": "certificate_authority_service/get_certificate_template.rb", + "language": "RUBY", + "client_method": { + "short_name": "get_certificate_template", + "full_name": "::Google::Cloud::Security::PrivateCA::V1::CertificateAuthorityService::Client#get_certificate_template", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::Security::PrivateCA::V1::GetCertificateTemplateRequest", + "name": "request" + } + ], + "result_type": "::Google::Cloud::Security::PrivateCA::V1::CertificateTemplate", + "client": { + "short_name": "CertificateAuthorityService::Client", + "full_name": "::Google::Cloud::Security::PrivateCA::V1::CertificateAuthorityService::Client" + }, + "method": { + "short_name": "GetCertificateTemplate", + "full_name": "google.cloud.security.privateca.v1.CertificateAuthorityService.GetCertificateTemplate", + "service": { + "short_name": "CertificateAuthorityService", + "full_name": "google.cloud.security.privateca.v1.CertificateAuthorityService" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 46, + "type": "FULL" + } + ] + }, + { + "region_tag": "privateca_v1_generated_CertificateAuthorityService_ListCertificateTemplates_sync", + "title": "Snippet for the list_certificate_templates call in the CertificateAuthorityService service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Security::PrivateCA::V1::CertificateAuthorityService::Client#list_certificate_templates.", + "file": "certificate_authority_service/list_certificate_templates.rb", + "language": "RUBY", + "client_method": { + "short_name": "list_certificate_templates", + "full_name": "::Google::Cloud::Security::PrivateCA::V1::CertificateAuthorityService::Client#list_certificate_templates", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::Security::PrivateCA::V1::ListCertificateTemplatesRequest", + "name": "request" + } + ], + "result_type": "::Google::Cloud::Security::PrivateCA::V1::ListCertificateTemplatesResponse", + "client": { + "short_name": "CertificateAuthorityService::Client", + "full_name": "::Google::Cloud::Security::PrivateCA::V1::CertificateAuthorityService::Client" + }, + "method": { + "short_name": "ListCertificateTemplates", + "full_name": "google.cloud.security.privateca.v1.CertificateAuthorityService.ListCertificateTemplates", + "service": { + "short_name": "CertificateAuthorityService", + "full_name": "google.cloud.security.privateca.v1.CertificateAuthorityService" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 50, + "type": "FULL" + } + ] + }, + { + "region_tag": "privateca_v1_generated_CertificateAuthorityService_UpdateCertificateTemplate_sync", + "title": "Snippet for the update_certificate_template call in the CertificateAuthorityService service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Security::PrivateCA::V1::CertificateAuthorityService::Client#update_certificate_template.", + "file": "certificate_authority_service/update_certificate_template.rb", + "language": "RUBY", + "client_method": { + "short_name": "update_certificate_template", + "full_name": "::Google::Cloud::Security::PrivateCA::V1::CertificateAuthorityService::Client#update_certificate_template", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::Security::PrivateCA::V1::UpdateCertificateTemplateRequest", + "name": "request" + } + ], + "result_type": "::Google::Longrunning::Operation", + "client": { + "short_name": "CertificateAuthorityService::Client", + "full_name": "::Google::Cloud::Security::PrivateCA::V1::CertificateAuthorityService::Client" + }, + "method": { + "short_name": "UpdateCertificateTemplate", + "full_name": "google.cloud.security.privateca.v1.CertificateAuthorityService.UpdateCertificateTemplate", + "service": { + "short_name": "CertificateAuthorityService", + "full_name": "google.cloud.security.privateca.v1.CertificateAuthorityService" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 53, + "type": "FULL" + } + ] + } + ] +} \ No newline at end of file diff --git a/owl-bot-staging/google-cloud-security-private_ca-v1/test/google/cloud/security/private_ca/v1/certificate_authority_service_operations_test.rb b/owl-bot-staging/google-cloud-security-private_ca-v1/test/google/cloud/security/private_ca/v1/certificate_authority_service_operations_test.rb new file mode 100644 index 000000000000..fe6266d30538 --- /dev/null +++ b/owl-bot-staging/google-cloud-security-private_ca-v1/test/google/cloud/security/private_ca/v1/certificate_authority_service_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/cloud/security/privateca/v1/service_pb" +require "google/cloud/security/privateca/v1/service_services_pb" +require "google/cloud/security/private_ca/v1/certificate_authority_service" + +class ::Google::Cloud::Security::PrivateCA::V1::CertificateAuthorityService::OperationsTest < Minitest::Test + class ClientStub + attr_accessor :call_rpc_count, :requests + + def initialize response, operation, &block + @response = response + @operation = operation + @block = block + @call_rpc_count = 0 + @requests = [] + end + + def call_rpc *args, **kwargs + @call_rpc_count += 1 + + @requests << @block&.call(*args, **kwargs) + + catch :response do + yield @response, @operation if block_given? + @response + end + end + + def endpoint + "endpoint.example.com" + end + + def universe_domain + "example.com" + end + + def stub_logger + nil + end + + def logger + nil + end + end + + def test_list_operations + # Create GRPC objects. + grpc_response = ::Google::Longrunning::ListOperationsResponse.new + grpc_operation = GRPC::ActiveCall::Operation.new nil + grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + grpc_options = {} + + # Create request parameters for a unary method. + name = "hello world" + filter = "hello world" + page_size = 42 + page_token = "hello world" + return_partial_success = true + + list_operations_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :list_operations, name + assert_kind_of ::Google::Longrunning::ListOperationsRequest, request + assert_equal "hello world", request["name"] + assert_equal "hello world", request["filter"] + assert_equal 42, request["page_size"] + assert_equal "hello world", request["page_token"] + assert_equal true, request["return_partial_success"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, list_operations_client_stub do + # Create client + client = ::Google::Cloud::Security::PrivateCA::V1::CertificateAuthorityService::Operations.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.list_operations({ name: name, filter: filter, page_size: page_size, page_token: page_token, return_partial_success: return_partial_success }) do |response, operation| + assert_kind_of Gapic::PagedEnumerable, response + assert_equal grpc_response, response.response + assert_equal grpc_operation, operation + end + + # Use named arguments + client.list_operations name: name, filter: filter, page_size: page_size, page_token: page_token, return_partial_success: return_partial_success do |response, operation| + assert_kind_of Gapic::PagedEnumerable, response + assert_equal grpc_response, response.response + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.list_operations ::Google::Longrunning::ListOperationsRequest.new(name: name, filter: filter, page_size: page_size, page_token: page_token, return_partial_success: return_partial_success) do |response, operation| + assert_kind_of Gapic::PagedEnumerable, response + assert_equal grpc_response, response.response + assert_equal grpc_operation, operation + end + + # Use hash object with options + client.list_operations({ name: name, filter: filter, page_size: page_size, page_token: page_token, return_partial_success: return_partial_success }, grpc_options) do |response, operation| + assert_kind_of Gapic::PagedEnumerable, response + assert_equal grpc_response, response.response + assert_equal grpc_operation, operation + end + + # Use protobuf object with options + client.list_operations(::Google::Longrunning::ListOperationsRequest.new(name: name, filter: filter, page_size: page_size, page_token: page_token, return_partial_success: return_partial_success), grpc_options) do |response, operation| + assert_kind_of Gapic::PagedEnumerable, response + assert_equal grpc_response, response.response + assert_equal grpc_operation, operation + end + + # Verify method calls + assert_equal 5, list_operations_client_stub.call_rpc_count + end + end + + def test_get_operation + # Create GRPC objects. + grpc_response = ::Google::Longrunning::Operation.new + grpc_operation = GRPC::ActiveCall::Operation.new nil + grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + grpc_options = {} + + # Create request parameters for a unary method. + name = "hello world" + + get_operation_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :get_operation, name + assert_kind_of ::Google::Longrunning::GetOperationRequest, request + assert_equal "hello world", request["name"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, get_operation_client_stub do + # Create client + client = ::Google::Cloud::Security::PrivateCA::V1::CertificateAuthorityService::Operations.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.get_operation({ name: name }) do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Use named arguments + client.get_operation name: name do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.get_operation ::Google::Longrunning::GetOperationRequest.new(name: name) do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Use hash object with options + client.get_operation({ name: name }, grpc_options) do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Use protobuf object with options + client.get_operation(::Google::Longrunning::GetOperationRequest.new(name: name), grpc_options) do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Verify method calls + assert_equal 5, get_operation_client_stub.call_rpc_count + end + end + + def test_delete_operation + # Create GRPC objects. + grpc_response = ::Google::Protobuf::Empty.new + grpc_operation = GRPC::ActiveCall::Operation.new nil + grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + grpc_options = {} + + # Create request parameters for a unary method. + name = "hello world" + + delete_operation_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :delete_operation, name + assert_kind_of ::Google::Longrunning::DeleteOperationRequest, request + assert_equal "hello world", request["name"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, delete_operation_client_stub do + # Create client + client = ::Google::Cloud::Security::PrivateCA::V1::CertificateAuthorityService::Operations.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.delete_operation({ name: name }) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use named arguments + client.delete_operation name: name do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.delete_operation ::Google::Longrunning::DeleteOperationRequest.new(name: name) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use hash object with options + client.delete_operation({ name: name }, grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object with options + client.delete_operation(::Google::Longrunning::DeleteOperationRequest.new(name: name), grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Verify method calls + assert_equal 5, delete_operation_client_stub.call_rpc_count + end + end + + def test_cancel_operation + # Create GRPC objects. + grpc_response = ::Google::Protobuf::Empty.new + grpc_operation = GRPC::ActiveCall::Operation.new nil + grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + grpc_options = {} + + # Create request parameters for a unary method. + name = "hello world" + + cancel_operation_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :cancel_operation, name + assert_kind_of ::Google::Longrunning::CancelOperationRequest, request + assert_equal "hello world", request["name"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, cancel_operation_client_stub do + # Create client + client = ::Google::Cloud::Security::PrivateCA::V1::CertificateAuthorityService::Operations.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.cancel_operation({ name: name }) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use named arguments + client.cancel_operation name: name do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.cancel_operation ::Google::Longrunning::CancelOperationRequest.new(name: name) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use hash object with options + client.cancel_operation({ name: name }, grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object with options + client.cancel_operation(::Google::Longrunning::CancelOperationRequest.new(name: name), grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Verify method calls + assert_equal 5, cancel_operation_client_stub.call_rpc_count + end + end + + def test_wait_operation + # Create GRPC objects. + grpc_response = ::Google::Longrunning::Operation.new + grpc_operation = GRPC::ActiveCall::Operation.new nil + grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + grpc_options = {} + + # Create request parameters for a unary method. + name = "hello world" + timeout = {} + + wait_operation_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :wait_operation, name + assert_kind_of ::Google::Longrunning::WaitOperationRequest, request + assert_equal "hello world", request["name"] + assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Protobuf::Duration), request["timeout"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, wait_operation_client_stub do + # Create client + client = ::Google::Cloud::Security::PrivateCA::V1::CertificateAuthorityService::Operations.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.wait_operation({ name: name, timeout: timeout }) do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Use named arguments + client.wait_operation name: name, timeout: timeout do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.wait_operation ::Google::Longrunning::WaitOperationRequest.new(name: name, timeout: timeout) do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Use hash object with options + client.wait_operation({ name: name, timeout: timeout }, grpc_options) do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Use protobuf object with options + client.wait_operation(::Google::Longrunning::WaitOperationRequest.new(name: name, timeout: timeout), grpc_options) do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Verify method calls + assert_equal 5, wait_operation_client_stub.call_rpc_count + end + end + + def test_configure + grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + + client = block_config = config = nil + dummy_stub = ClientStub.new nil, nil + Gapic::ServiceStub.stub :new, dummy_stub do + client = ::Google::Cloud::Security::PrivateCA::V1::CertificateAuthorityService::Operations.new do |config| + config.credentials = grpc_channel + end + end + + config = client.configure do |c| + block_config = c + end + + assert_same block_config, config + assert_kind_of ::Google::Cloud::Security::PrivateCA::V1::CertificateAuthorityService::Operations::Configuration, config + end +end diff --git a/owl-bot-staging/google-cloud-security-private_ca-v1/test/google/cloud/security/private_ca/v1/certificate_authority_service_paths_test.rb b/owl-bot-staging/google-cloud-security-private_ca-v1/test/google/cloud/security/private_ca/v1/certificate_authority_service_paths_test.rb new file mode 100644 index 000000000000..b5b52911b307 --- /dev/null +++ b/owl-bot-staging/google-cloud-security-private_ca-v1/test/google/cloud/security/private_ca/v1/certificate_authority_service_paths_test.rb @@ -0,0 +1,115 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +require "helper" + +require "gapic/grpc/service_stub" + +require "google/cloud/security/private_ca/v1/certificate_authority_service" + +class ::Google::Cloud::Security::PrivateCA::V1::CertificateAuthorityService::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_ca_pool_path + grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + ::Gapic::ServiceStub.stub :new, DummyStub.new do + client = ::Google::Cloud::Security::PrivateCA::V1::CertificateAuthorityService::Client.new do |config| + config.credentials = grpc_channel + end + + path = client.ca_pool_path project: "value0", location: "value1", ca_pool: "value2" + assert_equal "projects/value0/locations/value1/caPools/value2", path + end + end + + def test_certificate_path + grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + ::Gapic::ServiceStub.stub :new, DummyStub.new do + client = ::Google::Cloud::Security::PrivateCA::V1::CertificateAuthorityService::Client.new do |config| + config.credentials = grpc_channel + end + + path = client.certificate_path project: "value0", location: "value1", ca_pool: "value2", certificate: "value3" + assert_equal "projects/value0/locations/value1/caPools/value2/certificates/value3", path + end + end + + def test_certificate_authority_path + grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + ::Gapic::ServiceStub.stub :new, DummyStub.new do + client = ::Google::Cloud::Security::PrivateCA::V1::CertificateAuthorityService::Client.new do |config| + config.credentials = grpc_channel + end + + path = client.certificate_authority_path project: "value0", location: "value1", ca_pool: "value2", certificate_authority: "value3" + assert_equal "projects/value0/locations/value1/caPools/value2/certificateAuthorities/value3", path + end + end + + def test_certificate_revocation_list_path + grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + ::Gapic::ServiceStub.stub :new, DummyStub.new do + client = ::Google::Cloud::Security::PrivateCA::V1::CertificateAuthorityService::Client.new do |config| + config.credentials = grpc_channel + end + + path = client.certificate_revocation_list_path project: "value0", location: "value1", ca_pool: "value2", certificate_authority: "value3", certificate_revocation_list: "value4" + assert_equal "projects/value0/locations/value1/caPools/value2/certificateAuthorities/value3/certificateRevocationLists/value4", path + end + end + + def test_certificate_template_path + grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + ::Gapic::ServiceStub.stub :new, DummyStub.new do + client = ::Google::Cloud::Security::PrivateCA::V1::CertificateAuthorityService::Client.new do |config| + config.credentials = grpc_channel + end + + path = client.certificate_template_path project: "value0", location: "value1", certificate_template: "value2" + assert_equal "projects/value0/locations/value1/certificateTemplates/value2", path + end + end + + def test_location_path + grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + ::Gapic::ServiceStub.stub :new, DummyStub.new do + client = ::Google::Cloud::Security::PrivateCA::V1::CertificateAuthorityService::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 +end diff --git a/owl-bot-staging/google-cloud-security-private_ca-v1/test/google/cloud/security/private_ca/v1/certificate_authority_service_rest_test.rb b/owl-bot-staging/google-cloud-security-private_ca-v1/test/google/cloud/security/private_ca/v1/certificate_authority_service_rest_test.rb new file mode 100644 index 000000000000..43086e9a3a4a --- /dev/null +++ b/owl-bot-staging/google-cloud-security-private_ca-v1/test/google/cloud/security/private_ca/v1/certificate_authority_service_rest_test.rb @@ -0,0 +1,1726 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +require "helper" +require "gapic/rest" +require "google/cloud/security/privateca/v1/service_pb" +require "google/cloud/security/private_ca/v1/certificate_authority_service/rest" + + +class ::Google::Cloud::Security::PrivateCA::V1::CertificateAuthorityService::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_certificate + # Create test objects. + client_result = ::Google::Cloud::Security::PrivateCA::V1::Certificate.new + http_response = OpenStruct.new body: client_result.to_json + + call_options = {} + + # Create request parameters for a unary method. + parent = "hello world" + certificate_id = "hello world" + certificate = {} + request_id = "hello world" + validate_only = true + issuing_certificate_authority_id = "hello world" + + create_certificate_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| + assert options.metadata.key? :"x-goog-api-client" + assert options.metadata[:"x-goog-api-client"].include? "rest" + refute options.metadata[:"x-goog-api-client"].include? "grpc" + end + + ::Google::Cloud::Security::PrivateCA::V1::CertificateAuthorityService::Rest::ServiceStub.stub :transcode_create_certificate_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, create_certificate_client_stub do + # Create client + client = ::Google::Cloud::Security::PrivateCA::V1::CertificateAuthorityService::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.create_certificate({ parent: parent, certificate_id: certificate_id, certificate: certificate, request_id: request_id, validate_only: validate_only, issuing_certificate_authority_id: issuing_certificate_authority_id }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.create_certificate parent: parent, certificate_id: certificate_id, certificate: certificate, request_id: request_id, validate_only: validate_only, issuing_certificate_authority_id: issuing_certificate_authority_id do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.create_certificate ::Google::Cloud::Security::PrivateCA::V1::CreateCertificateRequest.new(parent: parent, certificate_id: certificate_id, certificate: certificate, request_id: request_id, validate_only: validate_only, issuing_certificate_authority_id: issuing_certificate_authority_id) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + client.create_certificate({ parent: parent, certificate_id: certificate_id, certificate: certificate, request_id: request_id, validate_only: validate_only, issuing_certificate_authority_id: issuing_certificate_authority_id }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + client.create_certificate(::Google::Cloud::Security::PrivateCA::V1::CreateCertificateRequest.new(parent: parent, certificate_id: certificate_id, certificate: certificate, request_id: request_id, validate_only: validate_only, issuing_certificate_authority_id: issuing_certificate_authority_id), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, create_certificate_client_stub.call_count + end + end + end + + def test_get_certificate + # Create test objects. + client_result = ::Google::Cloud::Security::PrivateCA::V1::Certificate.new + http_response = OpenStruct.new body: client_result.to_json + + call_options = {} + + # Create request parameters for a unary method. + name = "hello world" + + get_certificate_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| + assert options.metadata.key? :"x-goog-api-client" + assert options.metadata[:"x-goog-api-client"].include? "rest" + refute options.metadata[:"x-goog-api-client"].include? "grpc" + end + + ::Google::Cloud::Security::PrivateCA::V1::CertificateAuthorityService::Rest::ServiceStub.stub :transcode_get_certificate_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, get_certificate_client_stub do + # Create client + client = ::Google::Cloud::Security::PrivateCA::V1::CertificateAuthorityService::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.get_certificate({ name: name }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.get_certificate name: name do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.get_certificate ::Google::Cloud::Security::PrivateCA::V1::GetCertificateRequest.new(name: name) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + client.get_certificate({ name: name }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + client.get_certificate(::Google::Cloud::Security::PrivateCA::V1::GetCertificateRequest.new(name: name), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, get_certificate_client_stub.call_count + end + end + end + + def test_list_certificates + # Create test objects. + client_result = ::Google::Cloud::Security::PrivateCA::V1::ListCertificatesResponse.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" + order_by = "hello world" + + list_certificates_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| + assert options.metadata.key? :"x-goog-api-client" + assert options.metadata[:"x-goog-api-client"].include? "rest" + refute options.metadata[:"x-goog-api-client"].include? "grpc" + end + + ::Google::Cloud::Security::PrivateCA::V1::CertificateAuthorityService::Rest::ServiceStub.stub :transcode_list_certificates_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, list_certificates_client_stub do + # Create client + client = ::Google::Cloud::Security::PrivateCA::V1::CertificateAuthorityService::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.list_certificates({ parent: parent, page_size: page_size, page_token: page_token, filter: filter, order_by: order_by }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.list_certificates parent: parent, page_size: page_size, page_token: page_token, filter: filter, order_by: order_by do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.list_certificates ::Google::Cloud::Security::PrivateCA::V1::ListCertificatesRequest.new(parent: parent, page_size: page_size, page_token: page_token, filter: filter, order_by: order_by) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + client.list_certificates({ parent: parent, page_size: page_size, page_token: page_token, filter: filter, order_by: order_by }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + client.list_certificates(::Google::Cloud::Security::PrivateCA::V1::ListCertificatesRequest.new(parent: parent, page_size: page_size, page_token: page_token, filter: filter, order_by: order_by), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, list_certificates_client_stub.call_count + end + end + end + + def test_revoke_certificate + # Create test objects. + client_result = ::Google::Cloud::Security::PrivateCA::V1::Certificate.new + http_response = OpenStruct.new body: client_result.to_json + + call_options = {} + + # Create request parameters for a unary method. + name = "hello world" + reason = :REVOCATION_REASON_UNSPECIFIED + request_id = "hello world" + + revoke_certificate_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| + assert options.metadata.key? :"x-goog-api-client" + assert options.metadata[:"x-goog-api-client"].include? "rest" + refute options.metadata[:"x-goog-api-client"].include? "grpc" + end + + ::Google::Cloud::Security::PrivateCA::V1::CertificateAuthorityService::Rest::ServiceStub.stub :transcode_revoke_certificate_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, revoke_certificate_client_stub do + # Create client + client = ::Google::Cloud::Security::PrivateCA::V1::CertificateAuthorityService::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.revoke_certificate({ name: name, reason: reason, request_id: request_id }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.revoke_certificate name: name, reason: reason, request_id: request_id do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.revoke_certificate ::Google::Cloud::Security::PrivateCA::V1::RevokeCertificateRequest.new(name: name, reason: reason, request_id: request_id) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + client.revoke_certificate({ name: name, reason: reason, request_id: request_id }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + client.revoke_certificate(::Google::Cloud::Security::PrivateCA::V1::RevokeCertificateRequest.new(name: name, reason: reason, request_id: request_id), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, revoke_certificate_client_stub.call_count + end + end + end + + def test_update_certificate + # Create test objects. + client_result = ::Google::Cloud::Security::PrivateCA::V1::Certificate.new + http_response = OpenStruct.new body: client_result.to_json + + call_options = {} + + # Create request parameters for a unary method. + certificate = {} + update_mask = {} + request_id = "hello world" + + update_certificate_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| + assert options.metadata.key? :"x-goog-api-client" + assert options.metadata[:"x-goog-api-client"].include? "rest" + refute options.metadata[:"x-goog-api-client"].include? "grpc" + end + + ::Google::Cloud::Security::PrivateCA::V1::CertificateAuthorityService::Rest::ServiceStub.stub :transcode_update_certificate_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, update_certificate_client_stub do + # Create client + client = ::Google::Cloud::Security::PrivateCA::V1::CertificateAuthorityService::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.update_certificate({ certificate: certificate, update_mask: update_mask, request_id: request_id }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.update_certificate certificate: certificate, update_mask: update_mask, request_id: request_id do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.update_certificate ::Google::Cloud::Security::PrivateCA::V1::UpdateCertificateRequest.new(certificate: certificate, update_mask: update_mask, request_id: request_id) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + client.update_certificate({ certificate: certificate, update_mask: update_mask, request_id: request_id }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + client.update_certificate(::Google::Cloud::Security::PrivateCA::V1::UpdateCertificateRequest.new(certificate: certificate, update_mask: update_mask, request_id: request_id), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, update_certificate_client_stub.call_count + end + end + end + + def test_activate_certificate_authority + # 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" + pem_ca_certificate = "hello world" + subordinate_config = {} + request_id = "hello world" + + activate_certificate_authority_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| + assert options.metadata.key? :"x-goog-api-client" + assert options.metadata[:"x-goog-api-client"].include? "rest" + refute options.metadata[:"x-goog-api-client"].include? "grpc" + end + + ::Google::Cloud::Security::PrivateCA::V1::CertificateAuthorityService::Rest::ServiceStub.stub :transcode_activate_certificate_authority_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, activate_certificate_authority_client_stub do + # Create client + client = ::Google::Cloud::Security::PrivateCA::V1::CertificateAuthorityService::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.activate_certificate_authority({ name: name, pem_ca_certificate: pem_ca_certificate, subordinate_config: subordinate_config, request_id: request_id }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.activate_certificate_authority name: name, pem_ca_certificate: pem_ca_certificate, subordinate_config: subordinate_config, request_id: request_id do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.activate_certificate_authority ::Google::Cloud::Security::PrivateCA::V1::ActivateCertificateAuthorityRequest.new(name: name, pem_ca_certificate: pem_ca_certificate, subordinate_config: subordinate_config, request_id: request_id) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + client.activate_certificate_authority({ name: name, pem_ca_certificate: pem_ca_certificate, subordinate_config: subordinate_config, request_id: request_id }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + client.activate_certificate_authority(::Google::Cloud::Security::PrivateCA::V1::ActivateCertificateAuthorityRequest.new(name: name, pem_ca_certificate: pem_ca_certificate, subordinate_config: subordinate_config, request_id: request_id), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, activate_certificate_authority_client_stub.call_count + end + end + end + + def test_create_certificate_authority + # 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" + certificate_authority_id = "hello world" + certificate_authority = {} + request_id = "hello world" + + create_certificate_authority_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| + assert options.metadata.key? :"x-goog-api-client" + assert options.metadata[:"x-goog-api-client"].include? "rest" + refute options.metadata[:"x-goog-api-client"].include? "grpc" + end + + ::Google::Cloud::Security::PrivateCA::V1::CertificateAuthorityService::Rest::ServiceStub.stub :transcode_create_certificate_authority_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, create_certificate_authority_client_stub do + # Create client + client = ::Google::Cloud::Security::PrivateCA::V1::CertificateAuthorityService::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.create_certificate_authority({ parent: parent, certificate_authority_id: certificate_authority_id, certificate_authority: certificate_authority, request_id: request_id }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.create_certificate_authority parent: parent, certificate_authority_id: certificate_authority_id, certificate_authority: certificate_authority, request_id: request_id do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.create_certificate_authority ::Google::Cloud::Security::PrivateCA::V1::CreateCertificateAuthorityRequest.new(parent: parent, certificate_authority_id: certificate_authority_id, certificate_authority: certificate_authority, request_id: request_id) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + client.create_certificate_authority({ parent: parent, certificate_authority_id: certificate_authority_id, certificate_authority: certificate_authority, request_id: request_id }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + client.create_certificate_authority(::Google::Cloud::Security::PrivateCA::V1::CreateCertificateAuthorityRequest.new(parent: parent, certificate_authority_id: certificate_authority_id, certificate_authority: certificate_authority, request_id: request_id), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, create_certificate_authority_client_stub.call_count + end + end + end + + def test_disable_certificate_authority + # 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" + request_id = "hello world" + ignore_dependent_resources = true + + disable_certificate_authority_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| + assert options.metadata.key? :"x-goog-api-client" + assert options.metadata[:"x-goog-api-client"].include? "rest" + refute options.metadata[:"x-goog-api-client"].include? "grpc" + end + + ::Google::Cloud::Security::PrivateCA::V1::CertificateAuthorityService::Rest::ServiceStub.stub :transcode_disable_certificate_authority_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, disable_certificate_authority_client_stub do + # Create client + client = ::Google::Cloud::Security::PrivateCA::V1::CertificateAuthorityService::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.disable_certificate_authority({ name: name, request_id: request_id, ignore_dependent_resources: ignore_dependent_resources }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.disable_certificate_authority name: name, request_id: request_id, ignore_dependent_resources: ignore_dependent_resources do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.disable_certificate_authority ::Google::Cloud::Security::PrivateCA::V1::DisableCertificateAuthorityRequest.new(name: name, request_id: request_id, ignore_dependent_resources: ignore_dependent_resources) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + client.disable_certificate_authority({ name: name, request_id: request_id, ignore_dependent_resources: ignore_dependent_resources }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + client.disable_certificate_authority(::Google::Cloud::Security::PrivateCA::V1::DisableCertificateAuthorityRequest.new(name: name, request_id: request_id, ignore_dependent_resources: ignore_dependent_resources), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, disable_certificate_authority_client_stub.call_count + end + end + end + + def test_enable_certificate_authority + # 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" + request_id = "hello world" + + enable_certificate_authority_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| + assert options.metadata.key? :"x-goog-api-client" + assert options.metadata[:"x-goog-api-client"].include? "rest" + refute options.metadata[:"x-goog-api-client"].include? "grpc" + end + + ::Google::Cloud::Security::PrivateCA::V1::CertificateAuthorityService::Rest::ServiceStub.stub :transcode_enable_certificate_authority_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, enable_certificate_authority_client_stub do + # Create client + client = ::Google::Cloud::Security::PrivateCA::V1::CertificateAuthorityService::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.enable_certificate_authority({ name: name, request_id: request_id }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.enable_certificate_authority name: name, request_id: request_id do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.enable_certificate_authority ::Google::Cloud::Security::PrivateCA::V1::EnableCertificateAuthorityRequest.new(name: name, request_id: request_id) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + client.enable_certificate_authority({ name: name, request_id: request_id }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + client.enable_certificate_authority(::Google::Cloud::Security::PrivateCA::V1::EnableCertificateAuthorityRequest.new(name: name, request_id: request_id), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, enable_certificate_authority_client_stub.call_count + end + end + end + + def test_fetch_certificate_authority_csr + # Create test objects. + client_result = ::Google::Cloud::Security::PrivateCA::V1::FetchCertificateAuthorityCsrResponse.new + http_response = OpenStruct.new body: client_result.to_json + + call_options = {} + + # Create request parameters for a unary method. + name = "hello world" + + fetch_certificate_authority_csr_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| + assert options.metadata.key? :"x-goog-api-client" + assert options.metadata[:"x-goog-api-client"].include? "rest" + refute options.metadata[:"x-goog-api-client"].include? "grpc" + end + + ::Google::Cloud::Security::PrivateCA::V1::CertificateAuthorityService::Rest::ServiceStub.stub :transcode_fetch_certificate_authority_csr_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, fetch_certificate_authority_csr_client_stub do + # Create client + client = ::Google::Cloud::Security::PrivateCA::V1::CertificateAuthorityService::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.fetch_certificate_authority_csr({ name: name }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.fetch_certificate_authority_csr name: name do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.fetch_certificate_authority_csr ::Google::Cloud::Security::PrivateCA::V1::FetchCertificateAuthorityCsrRequest.new(name: name) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + client.fetch_certificate_authority_csr({ name: name }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + client.fetch_certificate_authority_csr(::Google::Cloud::Security::PrivateCA::V1::FetchCertificateAuthorityCsrRequest.new(name: name), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, fetch_certificate_authority_csr_client_stub.call_count + end + end + end + + def test_get_certificate_authority + # Create test objects. + client_result = ::Google::Cloud::Security::PrivateCA::V1::CertificateAuthority.new + http_response = OpenStruct.new body: client_result.to_json + + call_options = {} + + # Create request parameters for a unary method. + name = "hello world" + + get_certificate_authority_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| + assert options.metadata.key? :"x-goog-api-client" + assert options.metadata[:"x-goog-api-client"].include? "rest" + refute options.metadata[:"x-goog-api-client"].include? "grpc" + end + + ::Google::Cloud::Security::PrivateCA::V1::CertificateAuthorityService::Rest::ServiceStub.stub :transcode_get_certificate_authority_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, get_certificate_authority_client_stub do + # Create client + client = ::Google::Cloud::Security::PrivateCA::V1::CertificateAuthorityService::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.get_certificate_authority({ name: name }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.get_certificate_authority name: name do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.get_certificate_authority ::Google::Cloud::Security::PrivateCA::V1::GetCertificateAuthorityRequest.new(name: name) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + client.get_certificate_authority({ name: name }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + client.get_certificate_authority(::Google::Cloud::Security::PrivateCA::V1::GetCertificateAuthorityRequest.new(name: name), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, get_certificate_authority_client_stub.call_count + end + end + end + + def test_list_certificate_authorities + # Create test objects. + client_result = ::Google::Cloud::Security::PrivateCA::V1::ListCertificateAuthoritiesResponse.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" + order_by = "hello world" + + list_certificate_authorities_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| + assert options.metadata.key? :"x-goog-api-client" + assert options.metadata[:"x-goog-api-client"].include? "rest" + refute options.metadata[:"x-goog-api-client"].include? "grpc" + end + + ::Google::Cloud::Security::PrivateCA::V1::CertificateAuthorityService::Rest::ServiceStub.stub :transcode_list_certificate_authorities_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, list_certificate_authorities_client_stub do + # Create client + client = ::Google::Cloud::Security::PrivateCA::V1::CertificateAuthorityService::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.list_certificate_authorities({ parent: parent, page_size: page_size, page_token: page_token, filter: filter, order_by: order_by }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.list_certificate_authorities parent: parent, page_size: page_size, page_token: page_token, filter: filter, order_by: order_by do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.list_certificate_authorities ::Google::Cloud::Security::PrivateCA::V1::ListCertificateAuthoritiesRequest.new(parent: parent, page_size: page_size, page_token: page_token, filter: filter, order_by: order_by) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + client.list_certificate_authorities({ parent: parent, page_size: page_size, page_token: page_token, filter: filter, order_by: order_by }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + client.list_certificate_authorities(::Google::Cloud::Security::PrivateCA::V1::ListCertificateAuthoritiesRequest.new(parent: parent, page_size: page_size, page_token: page_token, filter: filter, order_by: order_by), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, list_certificate_authorities_client_stub.call_count + end + end + end + + def test_undelete_certificate_authority + # 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" + request_id = "hello world" + + undelete_certificate_authority_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| + assert options.metadata.key? :"x-goog-api-client" + assert options.metadata[:"x-goog-api-client"].include? "rest" + refute options.metadata[:"x-goog-api-client"].include? "grpc" + end + + ::Google::Cloud::Security::PrivateCA::V1::CertificateAuthorityService::Rest::ServiceStub.stub :transcode_undelete_certificate_authority_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, undelete_certificate_authority_client_stub do + # Create client + client = ::Google::Cloud::Security::PrivateCA::V1::CertificateAuthorityService::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.undelete_certificate_authority({ name: name, request_id: request_id }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.undelete_certificate_authority name: name, request_id: request_id do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.undelete_certificate_authority ::Google::Cloud::Security::PrivateCA::V1::UndeleteCertificateAuthorityRequest.new(name: name, request_id: request_id) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + client.undelete_certificate_authority({ name: name, request_id: request_id }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + client.undelete_certificate_authority(::Google::Cloud::Security::PrivateCA::V1::UndeleteCertificateAuthorityRequest.new(name: name, request_id: request_id), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, undelete_certificate_authority_client_stub.call_count + end + end + end + + def test_delete_certificate_authority + # 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" + request_id = "hello world" + ignore_active_certificates = true + skip_grace_period = true + ignore_dependent_resources = true + + delete_certificate_authority_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| + assert options.metadata.key? :"x-goog-api-client" + assert options.metadata[:"x-goog-api-client"].include? "rest" + refute options.metadata[:"x-goog-api-client"].include? "grpc" + end + + ::Google::Cloud::Security::PrivateCA::V1::CertificateAuthorityService::Rest::ServiceStub.stub :transcode_delete_certificate_authority_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, delete_certificate_authority_client_stub do + # Create client + client = ::Google::Cloud::Security::PrivateCA::V1::CertificateAuthorityService::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.delete_certificate_authority({ name: name, request_id: request_id, ignore_active_certificates: ignore_active_certificates, skip_grace_period: skip_grace_period, ignore_dependent_resources: ignore_dependent_resources }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.delete_certificate_authority name: name, request_id: request_id, ignore_active_certificates: ignore_active_certificates, skip_grace_period: skip_grace_period, ignore_dependent_resources: ignore_dependent_resources do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.delete_certificate_authority ::Google::Cloud::Security::PrivateCA::V1::DeleteCertificateAuthorityRequest.new(name: name, request_id: request_id, ignore_active_certificates: ignore_active_certificates, skip_grace_period: skip_grace_period, ignore_dependent_resources: ignore_dependent_resources) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + client.delete_certificate_authority({ name: name, request_id: request_id, ignore_active_certificates: ignore_active_certificates, skip_grace_period: skip_grace_period, ignore_dependent_resources: ignore_dependent_resources }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + client.delete_certificate_authority(::Google::Cloud::Security::PrivateCA::V1::DeleteCertificateAuthorityRequest.new(name: name, request_id: request_id, ignore_active_certificates: ignore_active_certificates, skip_grace_period: skip_grace_period, ignore_dependent_resources: ignore_dependent_resources), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, delete_certificate_authority_client_stub.call_count + end + end + end + + def test_update_certificate_authority + # 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. + certificate_authority = {} + update_mask = {} + request_id = "hello world" + + update_certificate_authority_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| + assert options.metadata.key? :"x-goog-api-client" + assert options.metadata[:"x-goog-api-client"].include? "rest" + refute options.metadata[:"x-goog-api-client"].include? "grpc" + end + + ::Google::Cloud::Security::PrivateCA::V1::CertificateAuthorityService::Rest::ServiceStub.stub :transcode_update_certificate_authority_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, update_certificate_authority_client_stub do + # Create client + client = ::Google::Cloud::Security::PrivateCA::V1::CertificateAuthorityService::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.update_certificate_authority({ certificate_authority: certificate_authority, update_mask: update_mask, request_id: request_id }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.update_certificate_authority certificate_authority: certificate_authority, update_mask: update_mask, request_id: request_id do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.update_certificate_authority ::Google::Cloud::Security::PrivateCA::V1::UpdateCertificateAuthorityRequest.new(certificate_authority: certificate_authority, update_mask: update_mask, request_id: request_id) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + client.update_certificate_authority({ certificate_authority: certificate_authority, update_mask: update_mask, request_id: request_id }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + client.update_certificate_authority(::Google::Cloud::Security::PrivateCA::V1::UpdateCertificateAuthorityRequest.new(certificate_authority: certificate_authority, update_mask: update_mask, request_id: request_id), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, update_certificate_authority_client_stub.call_count + end + end + end + + def test_create_ca_pool + # 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" + ca_pool_id = "hello world" + ca_pool = {} + request_id = "hello world" + + create_ca_pool_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| + assert options.metadata.key? :"x-goog-api-client" + assert options.metadata[:"x-goog-api-client"].include? "rest" + refute options.metadata[:"x-goog-api-client"].include? "grpc" + end + + ::Google::Cloud::Security::PrivateCA::V1::CertificateAuthorityService::Rest::ServiceStub.stub :transcode_create_ca_pool_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, create_ca_pool_client_stub do + # Create client + client = ::Google::Cloud::Security::PrivateCA::V1::CertificateAuthorityService::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.create_ca_pool({ parent: parent, ca_pool_id: ca_pool_id, ca_pool: ca_pool, request_id: request_id }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.create_ca_pool parent: parent, ca_pool_id: ca_pool_id, ca_pool: ca_pool, request_id: request_id do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.create_ca_pool ::Google::Cloud::Security::PrivateCA::V1::CreateCaPoolRequest.new(parent: parent, ca_pool_id: ca_pool_id, ca_pool: ca_pool, request_id: request_id) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + client.create_ca_pool({ parent: parent, ca_pool_id: ca_pool_id, ca_pool: ca_pool, request_id: request_id }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + client.create_ca_pool(::Google::Cloud::Security::PrivateCA::V1::CreateCaPoolRequest.new(parent: parent, ca_pool_id: ca_pool_id, ca_pool: ca_pool, request_id: request_id), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, create_ca_pool_client_stub.call_count + end + end + end + + def test_update_ca_pool + # 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. + ca_pool = {} + update_mask = {} + request_id = "hello world" + + update_ca_pool_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| + assert options.metadata.key? :"x-goog-api-client" + assert options.metadata[:"x-goog-api-client"].include? "rest" + refute options.metadata[:"x-goog-api-client"].include? "grpc" + end + + ::Google::Cloud::Security::PrivateCA::V1::CertificateAuthorityService::Rest::ServiceStub.stub :transcode_update_ca_pool_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, update_ca_pool_client_stub do + # Create client + client = ::Google::Cloud::Security::PrivateCA::V1::CertificateAuthorityService::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.update_ca_pool({ ca_pool: ca_pool, update_mask: update_mask, request_id: request_id }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.update_ca_pool ca_pool: ca_pool, update_mask: update_mask, request_id: request_id do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.update_ca_pool ::Google::Cloud::Security::PrivateCA::V1::UpdateCaPoolRequest.new(ca_pool: ca_pool, update_mask: update_mask, request_id: request_id) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + client.update_ca_pool({ ca_pool: ca_pool, update_mask: update_mask, request_id: request_id }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + client.update_ca_pool(::Google::Cloud::Security::PrivateCA::V1::UpdateCaPoolRequest.new(ca_pool: ca_pool, update_mask: update_mask, request_id: request_id), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, update_ca_pool_client_stub.call_count + end + end + end + + def test_get_ca_pool + # Create test objects. + client_result = ::Google::Cloud::Security::PrivateCA::V1::CaPool.new + http_response = OpenStruct.new body: client_result.to_json + + call_options = {} + + # Create request parameters for a unary method. + name = "hello world" + + get_ca_pool_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| + assert options.metadata.key? :"x-goog-api-client" + assert options.metadata[:"x-goog-api-client"].include? "rest" + refute options.metadata[:"x-goog-api-client"].include? "grpc" + end + + ::Google::Cloud::Security::PrivateCA::V1::CertificateAuthorityService::Rest::ServiceStub.stub :transcode_get_ca_pool_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, get_ca_pool_client_stub do + # Create client + client = ::Google::Cloud::Security::PrivateCA::V1::CertificateAuthorityService::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.get_ca_pool({ name: name }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.get_ca_pool name: name do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.get_ca_pool ::Google::Cloud::Security::PrivateCA::V1::GetCaPoolRequest.new(name: name) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + client.get_ca_pool({ name: name }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + client.get_ca_pool(::Google::Cloud::Security::PrivateCA::V1::GetCaPoolRequest.new(name: name), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, get_ca_pool_client_stub.call_count + end + end + end + + def test_list_ca_pools + # Create test objects. + client_result = ::Google::Cloud::Security::PrivateCA::V1::ListCaPoolsResponse.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" + order_by = "hello world" + + list_ca_pools_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| + assert options.metadata.key? :"x-goog-api-client" + assert options.metadata[:"x-goog-api-client"].include? "rest" + refute options.metadata[:"x-goog-api-client"].include? "grpc" + end + + ::Google::Cloud::Security::PrivateCA::V1::CertificateAuthorityService::Rest::ServiceStub.stub :transcode_list_ca_pools_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, list_ca_pools_client_stub do + # Create client + client = ::Google::Cloud::Security::PrivateCA::V1::CertificateAuthorityService::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.list_ca_pools({ parent: parent, page_size: page_size, page_token: page_token, filter: filter, order_by: order_by }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.list_ca_pools parent: parent, page_size: page_size, page_token: page_token, filter: filter, order_by: order_by do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.list_ca_pools ::Google::Cloud::Security::PrivateCA::V1::ListCaPoolsRequest.new(parent: parent, page_size: page_size, page_token: page_token, filter: filter, order_by: order_by) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + client.list_ca_pools({ parent: parent, page_size: page_size, page_token: page_token, filter: filter, order_by: order_by }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + client.list_ca_pools(::Google::Cloud::Security::PrivateCA::V1::ListCaPoolsRequest.new(parent: parent, page_size: page_size, page_token: page_token, filter: filter, order_by: order_by), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, list_ca_pools_client_stub.call_count + end + end + end + + def test_delete_ca_pool + # 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" + request_id = "hello world" + ignore_dependent_resources = true + + delete_ca_pool_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| + assert options.metadata.key? :"x-goog-api-client" + assert options.metadata[:"x-goog-api-client"].include? "rest" + refute options.metadata[:"x-goog-api-client"].include? "grpc" + end + + ::Google::Cloud::Security::PrivateCA::V1::CertificateAuthorityService::Rest::ServiceStub.stub :transcode_delete_ca_pool_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, delete_ca_pool_client_stub do + # Create client + client = ::Google::Cloud::Security::PrivateCA::V1::CertificateAuthorityService::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.delete_ca_pool({ name: name, request_id: request_id, ignore_dependent_resources: ignore_dependent_resources }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.delete_ca_pool name: name, request_id: request_id, ignore_dependent_resources: ignore_dependent_resources do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.delete_ca_pool ::Google::Cloud::Security::PrivateCA::V1::DeleteCaPoolRequest.new(name: name, request_id: request_id, ignore_dependent_resources: ignore_dependent_resources) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + client.delete_ca_pool({ name: name, request_id: request_id, ignore_dependent_resources: ignore_dependent_resources }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + client.delete_ca_pool(::Google::Cloud::Security::PrivateCA::V1::DeleteCaPoolRequest.new(name: name, request_id: request_id, ignore_dependent_resources: ignore_dependent_resources), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, delete_ca_pool_client_stub.call_count + end + end + end + + def test_fetch_ca_certs + # Create test objects. + client_result = ::Google::Cloud::Security::PrivateCA::V1::FetchCaCertsResponse.new + http_response = OpenStruct.new body: client_result.to_json + + call_options = {} + + # Create request parameters for a unary method. + ca_pool = "hello world" + request_id = "hello world" + + fetch_ca_certs_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| + assert options.metadata.key? :"x-goog-api-client" + assert options.metadata[:"x-goog-api-client"].include? "rest" + refute options.metadata[:"x-goog-api-client"].include? "grpc" + end + + ::Google::Cloud::Security::PrivateCA::V1::CertificateAuthorityService::Rest::ServiceStub.stub :transcode_fetch_ca_certs_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, fetch_ca_certs_client_stub do + # Create client + client = ::Google::Cloud::Security::PrivateCA::V1::CertificateAuthorityService::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.fetch_ca_certs({ ca_pool: ca_pool, request_id: request_id }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.fetch_ca_certs ca_pool: ca_pool, request_id: request_id do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.fetch_ca_certs ::Google::Cloud::Security::PrivateCA::V1::FetchCaCertsRequest.new(ca_pool: ca_pool, request_id: request_id) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + client.fetch_ca_certs({ ca_pool: ca_pool, request_id: request_id }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + client.fetch_ca_certs(::Google::Cloud::Security::PrivateCA::V1::FetchCaCertsRequest.new(ca_pool: ca_pool, request_id: request_id), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, fetch_ca_certs_client_stub.call_count + end + end + end + + def test_get_certificate_revocation_list + # Create test objects. + client_result = ::Google::Cloud::Security::PrivateCA::V1::CertificateRevocationList.new + http_response = OpenStruct.new body: client_result.to_json + + call_options = {} + + # Create request parameters for a unary method. + name = "hello world" + + get_certificate_revocation_list_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| + assert options.metadata.key? :"x-goog-api-client" + assert options.metadata[:"x-goog-api-client"].include? "rest" + refute options.metadata[:"x-goog-api-client"].include? "grpc" + end + + ::Google::Cloud::Security::PrivateCA::V1::CertificateAuthorityService::Rest::ServiceStub.stub :transcode_get_certificate_revocation_list_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, get_certificate_revocation_list_client_stub do + # Create client + client = ::Google::Cloud::Security::PrivateCA::V1::CertificateAuthorityService::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.get_certificate_revocation_list({ name: name }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.get_certificate_revocation_list name: name do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.get_certificate_revocation_list ::Google::Cloud::Security::PrivateCA::V1::GetCertificateRevocationListRequest.new(name: name) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + client.get_certificate_revocation_list({ name: name }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + client.get_certificate_revocation_list(::Google::Cloud::Security::PrivateCA::V1::GetCertificateRevocationListRequest.new(name: name), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, get_certificate_revocation_list_client_stub.call_count + end + end + end + + def test_list_certificate_revocation_lists + # Create test objects. + client_result = ::Google::Cloud::Security::PrivateCA::V1::ListCertificateRevocationListsResponse.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" + order_by = "hello world" + + list_certificate_revocation_lists_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| + assert options.metadata.key? :"x-goog-api-client" + assert options.metadata[:"x-goog-api-client"].include? "rest" + refute options.metadata[:"x-goog-api-client"].include? "grpc" + end + + ::Google::Cloud::Security::PrivateCA::V1::CertificateAuthorityService::Rest::ServiceStub.stub :transcode_list_certificate_revocation_lists_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, list_certificate_revocation_lists_client_stub do + # Create client + client = ::Google::Cloud::Security::PrivateCA::V1::CertificateAuthorityService::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.list_certificate_revocation_lists({ parent: parent, page_size: page_size, page_token: page_token, filter: filter, order_by: order_by }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.list_certificate_revocation_lists parent: parent, page_size: page_size, page_token: page_token, filter: filter, order_by: order_by do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.list_certificate_revocation_lists ::Google::Cloud::Security::PrivateCA::V1::ListCertificateRevocationListsRequest.new(parent: parent, page_size: page_size, page_token: page_token, filter: filter, order_by: order_by) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + client.list_certificate_revocation_lists({ parent: parent, page_size: page_size, page_token: page_token, filter: filter, order_by: order_by }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + client.list_certificate_revocation_lists(::Google::Cloud::Security::PrivateCA::V1::ListCertificateRevocationListsRequest.new(parent: parent, page_size: page_size, page_token: page_token, filter: filter, order_by: order_by), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, list_certificate_revocation_lists_client_stub.call_count + end + end + end + + def test_update_certificate_revocation_list + # 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. + certificate_revocation_list = {} + update_mask = {} + request_id = "hello world" + + update_certificate_revocation_list_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| + assert options.metadata.key? :"x-goog-api-client" + assert options.metadata[:"x-goog-api-client"].include? "rest" + refute options.metadata[:"x-goog-api-client"].include? "grpc" + end + + ::Google::Cloud::Security::PrivateCA::V1::CertificateAuthorityService::Rest::ServiceStub.stub :transcode_update_certificate_revocation_list_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, update_certificate_revocation_list_client_stub do + # Create client + client = ::Google::Cloud::Security::PrivateCA::V1::CertificateAuthorityService::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.update_certificate_revocation_list({ certificate_revocation_list: certificate_revocation_list, update_mask: update_mask, request_id: request_id }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.update_certificate_revocation_list certificate_revocation_list: certificate_revocation_list, update_mask: update_mask, request_id: request_id do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.update_certificate_revocation_list ::Google::Cloud::Security::PrivateCA::V1::UpdateCertificateRevocationListRequest.new(certificate_revocation_list: certificate_revocation_list, update_mask: update_mask, request_id: request_id) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + client.update_certificate_revocation_list({ certificate_revocation_list: certificate_revocation_list, update_mask: update_mask, request_id: request_id }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + client.update_certificate_revocation_list(::Google::Cloud::Security::PrivateCA::V1::UpdateCertificateRevocationListRequest.new(certificate_revocation_list: certificate_revocation_list, update_mask: update_mask, request_id: request_id), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, update_certificate_revocation_list_client_stub.call_count + end + end + end + + def test_create_certificate_template + # 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" + certificate_template_id = "hello world" + certificate_template = {} + request_id = "hello world" + + create_certificate_template_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| + assert options.metadata.key? :"x-goog-api-client" + assert options.metadata[:"x-goog-api-client"].include? "rest" + refute options.metadata[:"x-goog-api-client"].include? "grpc" + end + + ::Google::Cloud::Security::PrivateCA::V1::CertificateAuthorityService::Rest::ServiceStub.stub :transcode_create_certificate_template_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, create_certificate_template_client_stub do + # Create client + client = ::Google::Cloud::Security::PrivateCA::V1::CertificateAuthorityService::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.create_certificate_template({ parent: parent, certificate_template_id: certificate_template_id, certificate_template: certificate_template, request_id: request_id }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.create_certificate_template parent: parent, certificate_template_id: certificate_template_id, certificate_template: certificate_template, request_id: request_id do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.create_certificate_template ::Google::Cloud::Security::PrivateCA::V1::CreateCertificateTemplateRequest.new(parent: parent, certificate_template_id: certificate_template_id, certificate_template: certificate_template, request_id: request_id) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + client.create_certificate_template({ parent: parent, certificate_template_id: certificate_template_id, certificate_template: certificate_template, request_id: request_id }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + client.create_certificate_template(::Google::Cloud::Security::PrivateCA::V1::CreateCertificateTemplateRequest.new(parent: parent, certificate_template_id: certificate_template_id, certificate_template: certificate_template, request_id: request_id), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, create_certificate_template_client_stub.call_count + end + end + end + + def test_delete_certificate_template + # 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" + request_id = "hello world" + + delete_certificate_template_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| + assert options.metadata.key? :"x-goog-api-client" + assert options.metadata[:"x-goog-api-client"].include? "rest" + refute options.metadata[:"x-goog-api-client"].include? "grpc" + end + + ::Google::Cloud::Security::PrivateCA::V1::CertificateAuthorityService::Rest::ServiceStub.stub :transcode_delete_certificate_template_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, delete_certificate_template_client_stub do + # Create client + client = ::Google::Cloud::Security::PrivateCA::V1::CertificateAuthorityService::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.delete_certificate_template({ name: name, request_id: request_id }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.delete_certificate_template name: name, request_id: request_id do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.delete_certificate_template ::Google::Cloud::Security::PrivateCA::V1::DeleteCertificateTemplateRequest.new(name: name, request_id: request_id) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + client.delete_certificate_template({ name: name, request_id: request_id }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + client.delete_certificate_template(::Google::Cloud::Security::PrivateCA::V1::DeleteCertificateTemplateRequest.new(name: name, request_id: request_id), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, delete_certificate_template_client_stub.call_count + end + end + end + + def test_get_certificate_template + # Create test objects. + client_result = ::Google::Cloud::Security::PrivateCA::V1::CertificateTemplate.new + http_response = OpenStruct.new body: client_result.to_json + + call_options = {} + + # Create request parameters for a unary method. + name = "hello world" + + get_certificate_template_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| + assert options.metadata.key? :"x-goog-api-client" + assert options.metadata[:"x-goog-api-client"].include? "rest" + refute options.metadata[:"x-goog-api-client"].include? "grpc" + end + + ::Google::Cloud::Security::PrivateCA::V1::CertificateAuthorityService::Rest::ServiceStub.stub :transcode_get_certificate_template_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, get_certificate_template_client_stub do + # Create client + client = ::Google::Cloud::Security::PrivateCA::V1::CertificateAuthorityService::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.get_certificate_template({ name: name }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.get_certificate_template name: name do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.get_certificate_template ::Google::Cloud::Security::PrivateCA::V1::GetCertificateTemplateRequest.new(name: name) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + client.get_certificate_template({ name: name }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + client.get_certificate_template(::Google::Cloud::Security::PrivateCA::V1::GetCertificateTemplateRequest.new(name: name), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, get_certificate_template_client_stub.call_count + end + end + end + + def test_list_certificate_templates + # Create test objects. + client_result = ::Google::Cloud::Security::PrivateCA::V1::ListCertificateTemplatesResponse.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" + order_by = "hello world" + + list_certificate_templates_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| + assert options.metadata.key? :"x-goog-api-client" + assert options.metadata[:"x-goog-api-client"].include? "rest" + refute options.metadata[:"x-goog-api-client"].include? "grpc" + end + + ::Google::Cloud::Security::PrivateCA::V1::CertificateAuthorityService::Rest::ServiceStub.stub :transcode_list_certificate_templates_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, list_certificate_templates_client_stub do + # Create client + client = ::Google::Cloud::Security::PrivateCA::V1::CertificateAuthorityService::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.list_certificate_templates({ parent: parent, page_size: page_size, page_token: page_token, filter: filter, order_by: order_by }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.list_certificate_templates parent: parent, page_size: page_size, page_token: page_token, filter: filter, order_by: order_by do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.list_certificate_templates ::Google::Cloud::Security::PrivateCA::V1::ListCertificateTemplatesRequest.new(parent: parent, page_size: page_size, page_token: page_token, filter: filter, order_by: order_by) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + client.list_certificate_templates({ parent: parent, page_size: page_size, page_token: page_token, filter: filter, order_by: order_by }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + client.list_certificate_templates(::Google::Cloud::Security::PrivateCA::V1::ListCertificateTemplatesRequest.new(parent: parent, page_size: page_size, page_token: page_token, filter: filter, order_by: order_by), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, list_certificate_templates_client_stub.call_count + end + end + end + + def test_update_certificate_template + # 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. + certificate_template = {} + update_mask = {} + request_id = "hello world" + + update_certificate_template_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| + assert options.metadata.key? :"x-goog-api-client" + assert options.metadata[:"x-goog-api-client"].include? "rest" + refute options.metadata[:"x-goog-api-client"].include? "grpc" + end + + ::Google::Cloud::Security::PrivateCA::V1::CertificateAuthorityService::Rest::ServiceStub.stub :transcode_update_certificate_template_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, update_certificate_template_client_stub do + # Create client + client = ::Google::Cloud::Security::PrivateCA::V1::CertificateAuthorityService::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.update_certificate_template({ certificate_template: certificate_template, update_mask: update_mask, request_id: request_id }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.update_certificate_template certificate_template: certificate_template, update_mask: update_mask, request_id: request_id do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.update_certificate_template ::Google::Cloud::Security::PrivateCA::V1::UpdateCertificateTemplateRequest.new(certificate_template: certificate_template, update_mask: update_mask, request_id: request_id) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + client.update_certificate_template({ certificate_template: certificate_template, update_mask: update_mask, request_id: request_id }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + client.update_certificate_template(::Google::Cloud::Security::PrivateCA::V1::UpdateCertificateTemplateRequest.new(certificate_template: certificate_template, update_mask: update_mask, request_id: request_id), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, update_certificate_template_client_stub.call_count + end + end + end + + def test_configure + credentials_token = :dummy_value + + client = block_config = config = nil + dummy_stub = ClientStub.new nil + Gapic::Rest::ClientStub.stub :new, dummy_stub do + client = ::Google::Cloud::Security::PrivateCA::V1::CertificateAuthorityService::Rest::Client.new do |config| + config.credentials = credentials_token + end + end + + config = client.configure do |c| + block_config = c + end + + assert_same block_config, config + assert_kind_of ::Google::Cloud::Security::PrivateCA::V1::CertificateAuthorityService::Rest::Client::Configuration, config + end +end diff --git a/owl-bot-staging/google-cloud-security-private_ca-v1/test/google/cloud/security/private_ca/v1/certificate_authority_service_test.rb b/owl-bot-staging/google-cloud-security-private_ca-v1/test/google/cloud/security/private_ca/v1/certificate_authority_service_test.rb new file mode 100644 index 000000000000..85e8ca47f9dc --- /dev/null +++ b/owl-bot-staging/google-cloud-security-private_ca-v1/test/google/cloud/security/private_ca/v1/certificate_authority_service_test.rb @@ -0,0 +1,2017 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +require "helper" + +require "gapic/grpc/service_stub" + +require "google/cloud/security/privateca/v1/service_pb" +require "google/cloud/security/private_ca/v1/certificate_authority_service" + +class ::Google::Cloud::Security::PrivateCA::V1::CertificateAuthorityService::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_certificate + # Create GRPC objects. + grpc_response = ::Google::Cloud::Security::PrivateCA::V1::Certificate.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" + certificate_id = "hello world" + certificate = {} + request_id = "hello world" + validate_only = true + issuing_certificate_authority_id = "hello world" + + create_certificate_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :create_certificate, name + assert_kind_of ::Google::Cloud::Security::PrivateCA::V1::CreateCertificateRequest, request + assert_equal "hello world", request["parent"] + assert_equal "hello world", request["certificate_id"] + assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::Security::PrivateCA::V1::Certificate), request["certificate"] + assert_equal "hello world", request["request_id"] + assert_equal true, request["validate_only"] + assert_equal "hello world", request["issuing_certificate_authority_id"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, create_certificate_client_stub do + # Create client + client = ::Google::Cloud::Security::PrivateCA::V1::CertificateAuthorityService::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.create_certificate({ parent: parent, certificate_id: certificate_id, certificate: certificate, request_id: request_id, validate_only: validate_only, issuing_certificate_authority_id: issuing_certificate_authority_id }) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use named arguments + client.create_certificate parent: parent, certificate_id: certificate_id, certificate: certificate, request_id: request_id, validate_only: validate_only, issuing_certificate_authority_id: issuing_certificate_authority_id do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.create_certificate ::Google::Cloud::Security::PrivateCA::V1::CreateCertificateRequest.new(parent: parent, certificate_id: certificate_id, certificate: certificate, request_id: request_id, validate_only: validate_only, issuing_certificate_authority_id: issuing_certificate_authority_id) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use hash object with options + client.create_certificate({ parent: parent, certificate_id: certificate_id, certificate: certificate, request_id: request_id, validate_only: validate_only, issuing_certificate_authority_id: issuing_certificate_authority_id }, grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object with options + client.create_certificate(::Google::Cloud::Security::PrivateCA::V1::CreateCertificateRequest.new(parent: parent, certificate_id: certificate_id, certificate: certificate, request_id: request_id, validate_only: validate_only, issuing_certificate_authority_id: issuing_certificate_authority_id), grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Verify method calls + assert_equal 5, create_certificate_client_stub.call_rpc_count + end + end + + def test_get_certificate + # Create GRPC objects. + grpc_response = ::Google::Cloud::Security::PrivateCA::V1::Certificate.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_certificate_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :get_certificate, name + assert_kind_of ::Google::Cloud::Security::PrivateCA::V1::GetCertificateRequest, request + assert_equal "hello world", request["name"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, get_certificate_client_stub do + # Create client + client = ::Google::Cloud::Security::PrivateCA::V1::CertificateAuthorityService::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.get_certificate({ name: name }) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use named arguments + client.get_certificate name: name do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.get_certificate ::Google::Cloud::Security::PrivateCA::V1::GetCertificateRequest.new(name: name) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use hash object with options + client.get_certificate({ 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_certificate(::Google::Cloud::Security::PrivateCA::V1::GetCertificateRequest.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_certificate_client_stub.call_rpc_count + end + end + + def test_list_certificates + # Create GRPC objects. + grpc_response = ::Google::Cloud::Security::PrivateCA::V1::ListCertificatesResponse.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" + order_by = "hello world" + + list_certificates_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :list_certificates, name + assert_kind_of ::Google::Cloud::Security::PrivateCA::V1::ListCertificatesRequest, 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"] + assert_equal "hello world", request["order_by"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, list_certificates_client_stub do + # Create client + client = ::Google::Cloud::Security::PrivateCA::V1::CertificateAuthorityService::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.list_certificates({ parent: parent, page_size: page_size, page_token: page_token, filter: filter, order_by: order_by }) 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_certificates parent: parent, page_size: page_size, page_token: page_token, filter: filter, order_by: order_by 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_certificates ::Google::Cloud::Security::PrivateCA::V1::ListCertificatesRequest.new(parent: parent, page_size: page_size, page_token: page_token, filter: filter, order_by: order_by) 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_certificates({ parent: parent, page_size: page_size, page_token: page_token, filter: filter, order_by: order_by }, 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_certificates(::Google::Cloud::Security::PrivateCA::V1::ListCertificatesRequest.new(parent: parent, page_size: page_size, page_token: page_token, filter: filter, order_by: order_by), 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_certificates_client_stub.call_rpc_count + end + end + + def test_revoke_certificate + # Create GRPC objects. + grpc_response = ::Google::Cloud::Security::PrivateCA::V1::Certificate.new + grpc_operation = GRPC::ActiveCall::Operation.new nil + grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + grpc_options = {} + + # Create request parameters for a unary method. + name = "hello world" + reason = :REVOCATION_REASON_UNSPECIFIED + request_id = "hello world" + + revoke_certificate_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :revoke_certificate, name + assert_kind_of ::Google::Cloud::Security::PrivateCA::V1::RevokeCertificateRequest, request + assert_equal "hello world", request["name"] + assert_equal :REVOCATION_REASON_UNSPECIFIED, request["reason"] + assert_equal "hello world", request["request_id"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, revoke_certificate_client_stub do + # Create client + client = ::Google::Cloud::Security::PrivateCA::V1::CertificateAuthorityService::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.revoke_certificate({ name: name, reason: reason, request_id: request_id }) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use named arguments + client.revoke_certificate name: name, reason: reason, request_id: request_id do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.revoke_certificate ::Google::Cloud::Security::PrivateCA::V1::RevokeCertificateRequest.new(name: name, reason: reason, request_id: request_id) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use hash object with options + client.revoke_certificate({ name: name, reason: reason, request_id: request_id }, grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object with options + client.revoke_certificate(::Google::Cloud::Security::PrivateCA::V1::RevokeCertificateRequest.new(name: name, reason: reason, request_id: request_id), grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Verify method calls + assert_equal 5, revoke_certificate_client_stub.call_rpc_count + end + end + + def test_update_certificate + # Create GRPC objects. + grpc_response = ::Google::Cloud::Security::PrivateCA::V1::Certificate.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. + certificate = {} + update_mask = {} + request_id = "hello world" + + update_certificate_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :update_certificate, name + assert_kind_of ::Google::Cloud::Security::PrivateCA::V1::UpdateCertificateRequest, request + assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::Security::PrivateCA::V1::Certificate), request["certificate"] + assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Protobuf::FieldMask), request["update_mask"] + assert_equal "hello world", request["request_id"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, update_certificate_client_stub do + # Create client + client = ::Google::Cloud::Security::PrivateCA::V1::CertificateAuthorityService::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.update_certificate({ certificate: certificate, update_mask: update_mask, request_id: request_id }) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use named arguments + client.update_certificate certificate: certificate, update_mask: update_mask, request_id: request_id do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.update_certificate ::Google::Cloud::Security::PrivateCA::V1::UpdateCertificateRequest.new(certificate: certificate, update_mask: update_mask, request_id: request_id) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use hash object with options + client.update_certificate({ certificate: certificate, update_mask: update_mask, request_id: request_id }, grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object with options + client.update_certificate(::Google::Cloud::Security::PrivateCA::V1::UpdateCertificateRequest.new(certificate: certificate, update_mask: update_mask, request_id: request_id), grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Verify method calls + assert_equal 5, update_certificate_client_stub.call_rpc_count + end + end + + def test_activate_certificate_authority + # 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" + pem_ca_certificate = "hello world" + subordinate_config = {} + request_id = "hello world" + + activate_certificate_authority_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :activate_certificate_authority, name + assert_kind_of ::Google::Cloud::Security::PrivateCA::V1::ActivateCertificateAuthorityRequest, request + assert_equal "hello world", request["name"] + assert_equal "hello world", request["pem_ca_certificate"] + assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::Security::PrivateCA::V1::SubordinateConfig), request["subordinate_config"] + assert_equal "hello world", request["request_id"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, activate_certificate_authority_client_stub do + # Create client + client = ::Google::Cloud::Security::PrivateCA::V1::CertificateAuthorityService::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.activate_certificate_authority({ name: name, pem_ca_certificate: pem_ca_certificate, subordinate_config: subordinate_config, request_id: request_id }) do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Use named arguments + client.activate_certificate_authority name: name, pem_ca_certificate: pem_ca_certificate, subordinate_config: subordinate_config, request_id: request_id do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.activate_certificate_authority ::Google::Cloud::Security::PrivateCA::V1::ActivateCertificateAuthorityRequest.new(name: name, pem_ca_certificate: pem_ca_certificate, subordinate_config: subordinate_config, request_id: request_id) do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Use hash object with options + client.activate_certificate_authority({ name: name, pem_ca_certificate: pem_ca_certificate, subordinate_config: subordinate_config, request_id: request_id }, grpc_options) do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Use protobuf object with options + client.activate_certificate_authority(::Google::Cloud::Security::PrivateCA::V1::ActivateCertificateAuthorityRequest.new(name: name, pem_ca_certificate: pem_ca_certificate, subordinate_config: subordinate_config, request_id: request_id), grpc_options) do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Verify method calls + assert_equal 5, activate_certificate_authority_client_stub.call_rpc_count + end + end + + def test_create_certificate_authority + # 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" + certificate_authority_id = "hello world" + certificate_authority = {} + request_id = "hello world" + + create_certificate_authority_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :create_certificate_authority, name + assert_kind_of ::Google::Cloud::Security::PrivateCA::V1::CreateCertificateAuthorityRequest, request + assert_equal "hello world", request["parent"] + assert_equal "hello world", request["certificate_authority_id"] + assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::Security::PrivateCA::V1::CertificateAuthority), request["certificate_authority"] + assert_equal "hello world", request["request_id"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, create_certificate_authority_client_stub do + # Create client + client = ::Google::Cloud::Security::PrivateCA::V1::CertificateAuthorityService::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.create_certificate_authority({ parent: parent, certificate_authority_id: certificate_authority_id, certificate_authority: certificate_authority, request_id: request_id }) do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Use named arguments + client.create_certificate_authority parent: parent, certificate_authority_id: certificate_authority_id, certificate_authority: certificate_authority, request_id: request_id do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.create_certificate_authority ::Google::Cloud::Security::PrivateCA::V1::CreateCertificateAuthorityRequest.new(parent: parent, certificate_authority_id: certificate_authority_id, certificate_authority: certificate_authority, request_id: request_id) do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Use hash object with options + client.create_certificate_authority({ parent: parent, certificate_authority_id: certificate_authority_id, certificate_authority: certificate_authority, request_id: request_id }, grpc_options) do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Use protobuf object with options + client.create_certificate_authority(::Google::Cloud::Security::PrivateCA::V1::CreateCertificateAuthorityRequest.new(parent: parent, certificate_authority_id: certificate_authority_id, certificate_authority: certificate_authority, request_id: request_id), grpc_options) do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Verify method calls + assert_equal 5, create_certificate_authority_client_stub.call_rpc_count + end + end + + def test_disable_certificate_authority + # 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" + request_id = "hello world" + ignore_dependent_resources = true + + disable_certificate_authority_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :disable_certificate_authority, name + assert_kind_of ::Google::Cloud::Security::PrivateCA::V1::DisableCertificateAuthorityRequest, request + assert_equal "hello world", request["name"] + assert_equal "hello world", request["request_id"] + assert_equal true, request["ignore_dependent_resources"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, disable_certificate_authority_client_stub do + # Create client + client = ::Google::Cloud::Security::PrivateCA::V1::CertificateAuthorityService::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.disable_certificate_authority({ name: name, request_id: request_id, ignore_dependent_resources: ignore_dependent_resources }) 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.disable_certificate_authority name: name, request_id: request_id, ignore_dependent_resources: ignore_dependent_resources 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.disable_certificate_authority ::Google::Cloud::Security::PrivateCA::V1::DisableCertificateAuthorityRequest.new(name: name, request_id: request_id, ignore_dependent_resources: ignore_dependent_resources) 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.disable_certificate_authority({ name: name, request_id: request_id, ignore_dependent_resources: ignore_dependent_resources }, 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.disable_certificate_authority(::Google::Cloud::Security::PrivateCA::V1::DisableCertificateAuthorityRequest.new(name: name, request_id: request_id, ignore_dependent_resources: ignore_dependent_resources), 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, disable_certificate_authority_client_stub.call_rpc_count + end + end + + def test_enable_certificate_authority + # 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" + request_id = "hello world" + + enable_certificate_authority_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :enable_certificate_authority, name + assert_kind_of ::Google::Cloud::Security::PrivateCA::V1::EnableCertificateAuthorityRequest, request + assert_equal "hello world", request["name"] + assert_equal "hello world", request["request_id"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, enable_certificate_authority_client_stub do + # Create client + client = ::Google::Cloud::Security::PrivateCA::V1::CertificateAuthorityService::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.enable_certificate_authority({ name: name, request_id: request_id }) do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Use named arguments + client.enable_certificate_authority name: name, request_id: request_id do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.enable_certificate_authority ::Google::Cloud::Security::PrivateCA::V1::EnableCertificateAuthorityRequest.new(name: name, request_id: request_id) do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Use hash object with options + client.enable_certificate_authority({ name: name, request_id: request_id }, grpc_options) do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Use protobuf object with options + client.enable_certificate_authority(::Google::Cloud::Security::PrivateCA::V1::EnableCertificateAuthorityRequest.new(name: name, request_id: request_id), grpc_options) do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Verify method calls + assert_equal 5, enable_certificate_authority_client_stub.call_rpc_count + end + end + + def test_fetch_certificate_authority_csr + # Create GRPC objects. + grpc_response = ::Google::Cloud::Security::PrivateCA::V1::FetchCertificateAuthorityCsrResponse.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" + + fetch_certificate_authority_csr_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :fetch_certificate_authority_csr, name + assert_kind_of ::Google::Cloud::Security::PrivateCA::V1::FetchCertificateAuthorityCsrRequest, request + assert_equal "hello world", request["name"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, fetch_certificate_authority_csr_client_stub do + # Create client + client = ::Google::Cloud::Security::PrivateCA::V1::CertificateAuthorityService::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.fetch_certificate_authority_csr({ name: name }) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use named arguments + client.fetch_certificate_authority_csr name: name do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.fetch_certificate_authority_csr ::Google::Cloud::Security::PrivateCA::V1::FetchCertificateAuthorityCsrRequest.new(name: name) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use hash object with options + client.fetch_certificate_authority_csr({ name: name }, grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object with options + client.fetch_certificate_authority_csr(::Google::Cloud::Security::PrivateCA::V1::FetchCertificateAuthorityCsrRequest.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, fetch_certificate_authority_csr_client_stub.call_rpc_count + end + end + + def test_get_certificate_authority + # Create GRPC objects. + grpc_response = ::Google::Cloud::Security::PrivateCA::V1::CertificateAuthority.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_certificate_authority_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :get_certificate_authority, name + assert_kind_of ::Google::Cloud::Security::PrivateCA::V1::GetCertificateAuthorityRequest, request + assert_equal "hello world", request["name"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, get_certificate_authority_client_stub do + # Create client + client = ::Google::Cloud::Security::PrivateCA::V1::CertificateAuthorityService::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.get_certificate_authority({ name: name }) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use named arguments + client.get_certificate_authority name: name do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.get_certificate_authority ::Google::Cloud::Security::PrivateCA::V1::GetCertificateAuthorityRequest.new(name: name) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use hash object with options + client.get_certificate_authority({ 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_certificate_authority(::Google::Cloud::Security::PrivateCA::V1::GetCertificateAuthorityRequest.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_certificate_authority_client_stub.call_rpc_count + end + end + + def test_list_certificate_authorities + # Create GRPC objects. + grpc_response = ::Google::Cloud::Security::PrivateCA::V1::ListCertificateAuthoritiesResponse.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" + order_by = "hello world" + + list_certificate_authorities_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :list_certificate_authorities, name + assert_kind_of ::Google::Cloud::Security::PrivateCA::V1::ListCertificateAuthoritiesRequest, 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"] + assert_equal "hello world", request["order_by"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, list_certificate_authorities_client_stub do + # Create client + client = ::Google::Cloud::Security::PrivateCA::V1::CertificateAuthorityService::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.list_certificate_authorities({ parent: parent, page_size: page_size, page_token: page_token, filter: filter, order_by: order_by }) 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_certificate_authorities parent: parent, page_size: page_size, page_token: page_token, filter: filter, order_by: order_by 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_certificate_authorities ::Google::Cloud::Security::PrivateCA::V1::ListCertificateAuthoritiesRequest.new(parent: parent, page_size: page_size, page_token: page_token, filter: filter, order_by: order_by) 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_certificate_authorities({ parent: parent, page_size: page_size, page_token: page_token, filter: filter, order_by: order_by }, 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_certificate_authorities(::Google::Cloud::Security::PrivateCA::V1::ListCertificateAuthoritiesRequest.new(parent: parent, page_size: page_size, page_token: page_token, filter: filter, order_by: order_by), 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_certificate_authorities_client_stub.call_rpc_count + end + end + + def test_undelete_certificate_authority + # 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" + request_id = "hello world" + + undelete_certificate_authority_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :undelete_certificate_authority, name + assert_kind_of ::Google::Cloud::Security::PrivateCA::V1::UndeleteCertificateAuthorityRequest, request + assert_equal "hello world", request["name"] + assert_equal "hello world", request["request_id"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, undelete_certificate_authority_client_stub do + # Create client + client = ::Google::Cloud::Security::PrivateCA::V1::CertificateAuthorityService::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.undelete_certificate_authority({ name: name, request_id: request_id }) do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Use named arguments + client.undelete_certificate_authority name: name, request_id: request_id do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.undelete_certificate_authority ::Google::Cloud::Security::PrivateCA::V1::UndeleteCertificateAuthorityRequest.new(name: name, request_id: request_id) do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Use hash object with options + client.undelete_certificate_authority({ name: name, request_id: request_id }, grpc_options) do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Use protobuf object with options + client.undelete_certificate_authority(::Google::Cloud::Security::PrivateCA::V1::UndeleteCertificateAuthorityRequest.new(name: name, request_id: request_id), grpc_options) do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Verify method calls + assert_equal 5, undelete_certificate_authority_client_stub.call_rpc_count + end + end + + def test_delete_certificate_authority + # 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" + request_id = "hello world" + ignore_active_certificates = true + skip_grace_period = true + ignore_dependent_resources = true + + delete_certificate_authority_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :delete_certificate_authority, name + assert_kind_of ::Google::Cloud::Security::PrivateCA::V1::DeleteCertificateAuthorityRequest, request + assert_equal "hello world", request["name"] + assert_equal "hello world", request["request_id"] + assert_equal true, request["ignore_active_certificates"] + assert_equal true, request["skip_grace_period"] + assert_equal true, request["ignore_dependent_resources"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, delete_certificate_authority_client_stub do + # Create client + client = ::Google::Cloud::Security::PrivateCA::V1::CertificateAuthorityService::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.delete_certificate_authority({ name: name, request_id: request_id, ignore_active_certificates: ignore_active_certificates, skip_grace_period: skip_grace_period, ignore_dependent_resources: ignore_dependent_resources }) 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_certificate_authority name: name, request_id: request_id, ignore_active_certificates: ignore_active_certificates, skip_grace_period: skip_grace_period, ignore_dependent_resources: ignore_dependent_resources 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_certificate_authority ::Google::Cloud::Security::PrivateCA::V1::DeleteCertificateAuthorityRequest.new(name: name, request_id: request_id, ignore_active_certificates: ignore_active_certificates, skip_grace_period: skip_grace_period, ignore_dependent_resources: ignore_dependent_resources) 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_certificate_authority({ name: name, request_id: request_id, ignore_active_certificates: ignore_active_certificates, skip_grace_period: skip_grace_period, ignore_dependent_resources: ignore_dependent_resources }, 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_certificate_authority(::Google::Cloud::Security::PrivateCA::V1::DeleteCertificateAuthorityRequest.new(name: name, request_id: request_id, ignore_active_certificates: ignore_active_certificates, skip_grace_period: skip_grace_period, ignore_dependent_resources: ignore_dependent_resources), 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_certificate_authority_client_stub.call_rpc_count + end + end + + def test_update_certificate_authority + # 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. + certificate_authority = {} + update_mask = {} + request_id = "hello world" + + update_certificate_authority_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :update_certificate_authority, name + assert_kind_of ::Google::Cloud::Security::PrivateCA::V1::UpdateCertificateAuthorityRequest, request + assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::Security::PrivateCA::V1::CertificateAuthority), request["certificate_authority"] + assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Protobuf::FieldMask), request["update_mask"] + assert_equal "hello world", request["request_id"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, update_certificate_authority_client_stub do + # Create client + client = ::Google::Cloud::Security::PrivateCA::V1::CertificateAuthorityService::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.update_certificate_authority({ certificate_authority: certificate_authority, update_mask: update_mask, request_id: request_id }) do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Use named arguments + client.update_certificate_authority certificate_authority: certificate_authority, update_mask: update_mask, request_id: request_id do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.update_certificate_authority ::Google::Cloud::Security::PrivateCA::V1::UpdateCertificateAuthorityRequest.new(certificate_authority: certificate_authority, update_mask: update_mask, request_id: request_id) do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Use hash object with options + client.update_certificate_authority({ certificate_authority: certificate_authority, update_mask: update_mask, request_id: request_id }, grpc_options) do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Use protobuf object with options + client.update_certificate_authority(::Google::Cloud::Security::PrivateCA::V1::UpdateCertificateAuthorityRequest.new(certificate_authority: certificate_authority, update_mask: update_mask, request_id: request_id), grpc_options) do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Verify method calls + assert_equal 5, update_certificate_authority_client_stub.call_rpc_count + end + end + + def test_create_ca_pool + # 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" + ca_pool_id = "hello world" + ca_pool = {} + request_id = "hello world" + + create_ca_pool_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :create_ca_pool, name + assert_kind_of ::Google::Cloud::Security::PrivateCA::V1::CreateCaPoolRequest, request + assert_equal "hello world", request["parent"] + assert_equal "hello world", request["ca_pool_id"] + assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::Security::PrivateCA::V1::CaPool), request["ca_pool"] + assert_equal "hello world", request["request_id"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, create_ca_pool_client_stub do + # Create client + client = ::Google::Cloud::Security::PrivateCA::V1::CertificateAuthorityService::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.create_ca_pool({ parent: parent, ca_pool_id: ca_pool_id, ca_pool: ca_pool, request_id: request_id }) do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Use named arguments + client.create_ca_pool parent: parent, ca_pool_id: ca_pool_id, ca_pool: ca_pool, request_id: request_id do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.create_ca_pool ::Google::Cloud::Security::PrivateCA::V1::CreateCaPoolRequest.new(parent: parent, ca_pool_id: ca_pool_id, ca_pool: ca_pool, request_id: request_id) do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Use hash object with options + client.create_ca_pool({ parent: parent, ca_pool_id: ca_pool_id, ca_pool: ca_pool, request_id: request_id }, grpc_options) do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Use protobuf object with options + client.create_ca_pool(::Google::Cloud::Security::PrivateCA::V1::CreateCaPoolRequest.new(parent: parent, ca_pool_id: ca_pool_id, ca_pool: ca_pool, request_id: request_id), grpc_options) do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Verify method calls + assert_equal 5, create_ca_pool_client_stub.call_rpc_count + end + end + + def test_update_ca_pool + # 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. + ca_pool = {} + update_mask = {} + request_id = "hello world" + + update_ca_pool_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :update_ca_pool, name + assert_kind_of ::Google::Cloud::Security::PrivateCA::V1::UpdateCaPoolRequest, request + assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::Security::PrivateCA::V1::CaPool), request["ca_pool"] + assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Protobuf::FieldMask), request["update_mask"] + assert_equal "hello world", request["request_id"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, update_ca_pool_client_stub do + # Create client + client = ::Google::Cloud::Security::PrivateCA::V1::CertificateAuthorityService::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.update_ca_pool({ ca_pool: ca_pool, update_mask: update_mask, request_id: request_id }) do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Use named arguments + client.update_ca_pool ca_pool: ca_pool, update_mask: update_mask, request_id: request_id do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.update_ca_pool ::Google::Cloud::Security::PrivateCA::V1::UpdateCaPoolRequest.new(ca_pool: ca_pool, update_mask: update_mask, request_id: request_id) do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Use hash object with options + client.update_ca_pool({ ca_pool: ca_pool, update_mask: update_mask, request_id: request_id }, grpc_options) do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Use protobuf object with options + client.update_ca_pool(::Google::Cloud::Security::PrivateCA::V1::UpdateCaPoolRequest.new(ca_pool: ca_pool, update_mask: update_mask, request_id: request_id), grpc_options) do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Verify method calls + assert_equal 5, update_ca_pool_client_stub.call_rpc_count + end + end + + def test_get_ca_pool + # Create GRPC objects. + grpc_response = ::Google::Cloud::Security::PrivateCA::V1::CaPool.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_ca_pool_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :get_ca_pool, name + assert_kind_of ::Google::Cloud::Security::PrivateCA::V1::GetCaPoolRequest, request + assert_equal "hello world", request["name"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, get_ca_pool_client_stub do + # Create client + client = ::Google::Cloud::Security::PrivateCA::V1::CertificateAuthorityService::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.get_ca_pool({ name: name }) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use named arguments + client.get_ca_pool name: name do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.get_ca_pool ::Google::Cloud::Security::PrivateCA::V1::GetCaPoolRequest.new(name: name) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use hash object with options + client.get_ca_pool({ 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_ca_pool(::Google::Cloud::Security::PrivateCA::V1::GetCaPoolRequest.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_ca_pool_client_stub.call_rpc_count + end + end + + def test_list_ca_pools + # Create GRPC objects. + grpc_response = ::Google::Cloud::Security::PrivateCA::V1::ListCaPoolsResponse.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" + order_by = "hello world" + + list_ca_pools_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :list_ca_pools, name + assert_kind_of ::Google::Cloud::Security::PrivateCA::V1::ListCaPoolsRequest, 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"] + assert_equal "hello world", request["order_by"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, list_ca_pools_client_stub do + # Create client + client = ::Google::Cloud::Security::PrivateCA::V1::CertificateAuthorityService::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.list_ca_pools({ parent: parent, page_size: page_size, page_token: page_token, filter: filter, order_by: order_by }) 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_ca_pools parent: parent, page_size: page_size, page_token: page_token, filter: filter, order_by: order_by 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_ca_pools ::Google::Cloud::Security::PrivateCA::V1::ListCaPoolsRequest.new(parent: parent, page_size: page_size, page_token: page_token, filter: filter, order_by: order_by) 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_ca_pools({ parent: parent, page_size: page_size, page_token: page_token, filter: filter, order_by: order_by }, 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_ca_pools(::Google::Cloud::Security::PrivateCA::V1::ListCaPoolsRequest.new(parent: parent, page_size: page_size, page_token: page_token, filter: filter, order_by: order_by), 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_ca_pools_client_stub.call_rpc_count + end + end + + def test_delete_ca_pool + # 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" + request_id = "hello world" + ignore_dependent_resources = true + + delete_ca_pool_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :delete_ca_pool, name + assert_kind_of ::Google::Cloud::Security::PrivateCA::V1::DeleteCaPoolRequest, request + assert_equal "hello world", request["name"] + assert_equal "hello world", request["request_id"] + assert_equal true, request["ignore_dependent_resources"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, delete_ca_pool_client_stub do + # Create client + client = ::Google::Cloud::Security::PrivateCA::V1::CertificateAuthorityService::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.delete_ca_pool({ name: name, request_id: request_id, ignore_dependent_resources: ignore_dependent_resources }) 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_ca_pool name: name, request_id: request_id, ignore_dependent_resources: ignore_dependent_resources 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_ca_pool ::Google::Cloud::Security::PrivateCA::V1::DeleteCaPoolRequest.new(name: name, request_id: request_id, ignore_dependent_resources: ignore_dependent_resources) 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_ca_pool({ name: name, request_id: request_id, ignore_dependent_resources: ignore_dependent_resources }, 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_ca_pool(::Google::Cloud::Security::PrivateCA::V1::DeleteCaPoolRequest.new(name: name, request_id: request_id, ignore_dependent_resources: ignore_dependent_resources), 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_ca_pool_client_stub.call_rpc_count + end + end + + def test_fetch_ca_certs + # Create GRPC objects. + grpc_response = ::Google::Cloud::Security::PrivateCA::V1::FetchCaCertsResponse.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. + ca_pool = "hello world" + request_id = "hello world" + + fetch_ca_certs_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :fetch_ca_certs, name + assert_kind_of ::Google::Cloud::Security::PrivateCA::V1::FetchCaCertsRequest, request + assert_equal "hello world", request["ca_pool"] + assert_equal "hello world", request["request_id"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, fetch_ca_certs_client_stub do + # Create client + client = ::Google::Cloud::Security::PrivateCA::V1::CertificateAuthorityService::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.fetch_ca_certs({ ca_pool: ca_pool, request_id: request_id }) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use named arguments + client.fetch_ca_certs ca_pool: ca_pool, request_id: request_id do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.fetch_ca_certs ::Google::Cloud::Security::PrivateCA::V1::FetchCaCertsRequest.new(ca_pool: ca_pool, request_id: request_id) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use hash object with options + client.fetch_ca_certs({ ca_pool: ca_pool, request_id: request_id }, grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object with options + client.fetch_ca_certs(::Google::Cloud::Security::PrivateCA::V1::FetchCaCertsRequest.new(ca_pool: ca_pool, request_id: request_id), grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Verify method calls + assert_equal 5, fetch_ca_certs_client_stub.call_rpc_count + end + end + + def test_get_certificate_revocation_list + # Create GRPC objects. + grpc_response = ::Google::Cloud::Security::PrivateCA::V1::CertificateRevocationList.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_certificate_revocation_list_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :get_certificate_revocation_list, name + assert_kind_of ::Google::Cloud::Security::PrivateCA::V1::GetCertificateRevocationListRequest, request + assert_equal "hello world", request["name"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, get_certificate_revocation_list_client_stub do + # Create client + client = ::Google::Cloud::Security::PrivateCA::V1::CertificateAuthorityService::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.get_certificate_revocation_list({ name: name }) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use named arguments + client.get_certificate_revocation_list name: name do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.get_certificate_revocation_list ::Google::Cloud::Security::PrivateCA::V1::GetCertificateRevocationListRequest.new(name: name) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use hash object with options + client.get_certificate_revocation_list({ 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_certificate_revocation_list(::Google::Cloud::Security::PrivateCA::V1::GetCertificateRevocationListRequest.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_certificate_revocation_list_client_stub.call_rpc_count + end + end + + def test_list_certificate_revocation_lists + # Create GRPC objects. + grpc_response = ::Google::Cloud::Security::PrivateCA::V1::ListCertificateRevocationListsResponse.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" + order_by = "hello world" + + list_certificate_revocation_lists_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :list_certificate_revocation_lists, name + assert_kind_of ::Google::Cloud::Security::PrivateCA::V1::ListCertificateRevocationListsRequest, 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"] + assert_equal "hello world", request["order_by"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, list_certificate_revocation_lists_client_stub do + # Create client + client = ::Google::Cloud::Security::PrivateCA::V1::CertificateAuthorityService::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.list_certificate_revocation_lists({ parent: parent, page_size: page_size, page_token: page_token, filter: filter, order_by: order_by }) 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_certificate_revocation_lists parent: parent, page_size: page_size, page_token: page_token, filter: filter, order_by: order_by 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_certificate_revocation_lists ::Google::Cloud::Security::PrivateCA::V1::ListCertificateRevocationListsRequest.new(parent: parent, page_size: page_size, page_token: page_token, filter: filter, order_by: order_by) 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_certificate_revocation_lists({ parent: parent, page_size: page_size, page_token: page_token, filter: filter, order_by: order_by }, 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_certificate_revocation_lists(::Google::Cloud::Security::PrivateCA::V1::ListCertificateRevocationListsRequest.new(parent: parent, page_size: page_size, page_token: page_token, filter: filter, order_by: order_by), 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_certificate_revocation_lists_client_stub.call_rpc_count + end + end + + def test_update_certificate_revocation_list + # 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. + certificate_revocation_list = {} + update_mask = {} + request_id = "hello world" + + update_certificate_revocation_list_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :update_certificate_revocation_list, name + assert_kind_of ::Google::Cloud::Security::PrivateCA::V1::UpdateCertificateRevocationListRequest, request + assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::Security::PrivateCA::V1::CertificateRevocationList), request["certificate_revocation_list"] + assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Protobuf::FieldMask), request["update_mask"] + assert_equal "hello world", request["request_id"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, update_certificate_revocation_list_client_stub do + # Create client + client = ::Google::Cloud::Security::PrivateCA::V1::CertificateAuthorityService::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.update_certificate_revocation_list({ certificate_revocation_list: certificate_revocation_list, update_mask: update_mask, request_id: request_id }) do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Use named arguments + client.update_certificate_revocation_list certificate_revocation_list: certificate_revocation_list, update_mask: update_mask, request_id: request_id do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.update_certificate_revocation_list ::Google::Cloud::Security::PrivateCA::V1::UpdateCertificateRevocationListRequest.new(certificate_revocation_list: certificate_revocation_list, update_mask: update_mask, request_id: request_id) do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Use hash object with options + client.update_certificate_revocation_list({ certificate_revocation_list: certificate_revocation_list, update_mask: update_mask, request_id: request_id }, grpc_options) do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Use protobuf object with options + client.update_certificate_revocation_list(::Google::Cloud::Security::PrivateCA::V1::UpdateCertificateRevocationListRequest.new(certificate_revocation_list: certificate_revocation_list, update_mask: update_mask, request_id: request_id), grpc_options) do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Verify method calls + assert_equal 5, update_certificate_revocation_list_client_stub.call_rpc_count + end + end + + def test_create_certificate_template + # 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" + certificate_template_id = "hello world" + certificate_template = {} + request_id = "hello world" + + create_certificate_template_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :create_certificate_template, name + assert_kind_of ::Google::Cloud::Security::PrivateCA::V1::CreateCertificateTemplateRequest, request + assert_equal "hello world", request["parent"] + assert_equal "hello world", request["certificate_template_id"] + assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::Security::PrivateCA::V1::CertificateTemplate), request["certificate_template"] + assert_equal "hello world", request["request_id"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, create_certificate_template_client_stub do + # Create client + client = ::Google::Cloud::Security::PrivateCA::V1::CertificateAuthorityService::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.create_certificate_template({ parent: parent, certificate_template_id: certificate_template_id, certificate_template: certificate_template, request_id: request_id }) do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Use named arguments + client.create_certificate_template parent: parent, certificate_template_id: certificate_template_id, certificate_template: certificate_template, request_id: request_id do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.create_certificate_template ::Google::Cloud::Security::PrivateCA::V1::CreateCertificateTemplateRequest.new(parent: parent, certificate_template_id: certificate_template_id, certificate_template: certificate_template, request_id: request_id) do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Use hash object with options + client.create_certificate_template({ parent: parent, certificate_template_id: certificate_template_id, certificate_template: certificate_template, request_id: request_id }, grpc_options) do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Use protobuf object with options + client.create_certificate_template(::Google::Cloud::Security::PrivateCA::V1::CreateCertificateTemplateRequest.new(parent: parent, certificate_template_id: certificate_template_id, certificate_template: certificate_template, request_id: request_id), grpc_options) do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Verify method calls + assert_equal 5, create_certificate_template_client_stub.call_rpc_count + end + end + + def test_delete_certificate_template + # 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" + request_id = "hello world" + + delete_certificate_template_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :delete_certificate_template, name + assert_kind_of ::Google::Cloud::Security::PrivateCA::V1::DeleteCertificateTemplateRequest, request + assert_equal "hello world", request["name"] + assert_equal "hello world", request["request_id"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, delete_certificate_template_client_stub do + # Create client + client = ::Google::Cloud::Security::PrivateCA::V1::CertificateAuthorityService::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.delete_certificate_template({ name: name, request_id: request_id }) do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Use named arguments + client.delete_certificate_template name: name, request_id: request_id do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.delete_certificate_template ::Google::Cloud::Security::PrivateCA::V1::DeleteCertificateTemplateRequest.new(name: name, request_id: request_id) do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Use hash object with options + client.delete_certificate_template({ name: name, request_id: request_id }, grpc_options) do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Use protobuf object with options + client.delete_certificate_template(::Google::Cloud::Security::PrivateCA::V1::DeleteCertificateTemplateRequest.new(name: name, request_id: request_id), grpc_options) do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Verify method calls + assert_equal 5, delete_certificate_template_client_stub.call_rpc_count + end + end + + def test_get_certificate_template + # Create GRPC objects. + grpc_response = ::Google::Cloud::Security::PrivateCA::V1::CertificateTemplate.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_certificate_template_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :get_certificate_template, name + assert_kind_of ::Google::Cloud::Security::PrivateCA::V1::GetCertificateTemplateRequest, request + assert_equal "hello world", request["name"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, get_certificate_template_client_stub do + # Create client + client = ::Google::Cloud::Security::PrivateCA::V1::CertificateAuthorityService::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.get_certificate_template({ name: name }) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use named arguments + client.get_certificate_template name: name do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.get_certificate_template ::Google::Cloud::Security::PrivateCA::V1::GetCertificateTemplateRequest.new(name: name) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use hash object with options + client.get_certificate_template({ 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_certificate_template(::Google::Cloud::Security::PrivateCA::V1::GetCertificateTemplateRequest.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_certificate_template_client_stub.call_rpc_count + end + end + + def test_list_certificate_templates + # Create GRPC objects. + grpc_response = ::Google::Cloud::Security::PrivateCA::V1::ListCertificateTemplatesResponse.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" + order_by = "hello world" + + list_certificate_templates_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :list_certificate_templates, name + assert_kind_of ::Google::Cloud::Security::PrivateCA::V1::ListCertificateTemplatesRequest, 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"] + assert_equal "hello world", request["order_by"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, list_certificate_templates_client_stub do + # Create client + client = ::Google::Cloud::Security::PrivateCA::V1::CertificateAuthorityService::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.list_certificate_templates({ parent: parent, page_size: page_size, page_token: page_token, filter: filter, order_by: order_by }) 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_certificate_templates parent: parent, page_size: page_size, page_token: page_token, filter: filter, order_by: order_by 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_certificate_templates ::Google::Cloud::Security::PrivateCA::V1::ListCertificateTemplatesRequest.new(parent: parent, page_size: page_size, page_token: page_token, filter: filter, order_by: order_by) 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_certificate_templates({ parent: parent, page_size: page_size, page_token: page_token, filter: filter, order_by: order_by }, 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_certificate_templates(::Google::Cloud::Security::PrivateCA::V1::ListCertificateTemplatesRequest.new(parent: parent, page_size: page_size, page_token: page_token, filter: filter, order_by: order_by), 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_certificate_templates_client_stub.call_rpc_count + end + end + + def test_update_certificate_template + # 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. + certificate_template = {} + update_mask = {} + request_id = "hello world" + + update_certificate_template_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :update_certificate_template, name + assert_kind_of ::Google::Cloud::Security::PrivateCA::V1::UpdateCertificateTemplateRequest, request + assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::Security::PrivateCA::V1::CertificateTemplate), request["certificate_template"] + assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Protobuf::FieldMask), request["update_mask"] + assert_equal "hello world", request["request_id"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, update_certificate_template_client_stub do + # Create client + client = ::Google::Cloud::Security::PrivateCA::V1::CertificateAuthorityService::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.update_certificate_template({ certificate_template: certificate_template, update_mask: update_mask, request_id: request_id }) do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Use named arguments + client.update_certificate_template certificate_template: certificate_template, update_mask: update_mask, request_id: request_id do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.update_certificate_template ::Google::Cloud::Security::PrivateCA::V1::UpdateCertificateTemplateRequest.new(certificate_template: certificate_template, update_mask: update_mask, request_id: request_id) do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Use hash object with options + client.update_certificate_template({ certificate_template: certificate_template, update_mask: update_mask, request_id: request_id }, grpc_options) do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Use protobuf object with options + client.update_certificate_template(::Google::Cloud::Security::PrivateCA::V1::UpdateCertificateTemplateRequest.new(certificate_template: certificate_template, update_mask: update_mask, request_id: request_id), grpc_options) do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Verify method calls + assert_equal 5, update_certificate_template_client_stub.call_rpc_count + end + end + + def test_configure + grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + + client = block_config = config = nil + dummy_stub = ClientStub.new nil, nil + Gapic::ServiceStub.stub :new, dummy_stub do + client = ::Google::Cloud::Security::PrivateCA::V1::CertificateAuthorityService::Client.new do |config| + config.credentials = grpc_channel + end + end + + config = client.configure do |c| + block_config = c + end + + assert_same block_config, config + assert_kind_of ::Google::Cloud::Security::PrivateCA::V1::CertificateAuthorityService::Client::Configuration, config + end + + def test_credentials + key = OpenSSL::PKey::RSA.new 2048 + cred_json = { + "private_key" => key.to_pem, + "client_email" => "app@developer.gserviceaccount.com", + "type" => "service_account" + } + key_file = StringIO.new cred_json.to_json + creds = Google::Auth::ServiceAccountCredentials.make_creds({ json_key_io: key_file }) + + dummy_stub = ClientStub.new nil, nil + Gapic::ServiceStub.stub :new, dummy_stub do + client = ::Google::Cloud::Security::PrivateCA::V1::CertificateAuthorityService::Client.new do |config| + config.credentials = creds + end + assert_kind_of ::Google::Cloud::Security::PrivateCA::V1::CertificateAuthorityService::Client, client + assert_equal creds, client.configure.credentials + end + end + + def test_operations_client + grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + + client = nil + dummy_stub = ClientStub.new nil, nil + Gapic::ServiceStub.stub :new, dummy_stub do + client = ::Google::Cloud::Security::PrivateCA::V1::CertificateAuthorityService::Client.new do |config| + config.credentials = grpc_channel + end + end + + assert_kind_of ::Google::Cloud::Security::PrivateCA::V1::CertificateAuthorityService::Operations, client.operations_client + end +end diff --git a/owl-bot-staging/google-cloud-security-private_ca-v1/test/helper.rb b/owl-bot-staging/google-cloud-security-private_ca-v1/test/helper.rb new file mode 100644 index 000000000000..672b337030e7 --- /dev/null +++ b/owl-bot-staging/google-cloud-security-private_ca-v1/test/helper.rb @@ -0,0 +1,26 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +require "minitest/autorun" +require "minitest/focus" +require "minitest/mock" +require "minitest/rg" + +require "grpc" + +require "ostruct" diff --git a/owl-bot-staging/google-cloud-security-private_ca-v1beta1/.gitignore b/owl-bot-staging/google-cloud-security-private_ca-v1beta1/.gitignore new file mode 100644 index 000000000000..0135b6bc6cfc --- /dev/null +++ b/owl-bot-staging/google-cloud-security-private_ca-v1beta1/.gitignore @@ -0,0 +1,22 @@ +# Ignore bundler lockfiles +Gemfile.lock +gems.locked + +# Ignore documentation output +doc/* +.yardoc/* + +# Ignore test output +coverage/* + +# Ignore build artifacts +pkg/* + +# Ignore files commonly present in certain dev environments +.vagrant +.DS_STORE +.idea +*.iml + +# Ignore synth output +__pycache__ diff --git a/owl-bot-staging/google-cloud-security-private_ca-v1beta1/.repo-metadata.json b/owl-bot-staging/google-cloud-security-private_ca-v1beta1/.repo-metadata.json new file mode 100644 index 000000000000..a2c53d30db17 --- /dev/null +++ b/owl-bot-staging/google-cloud-security-private_ca-v1beta1/.repo-metadata.json @@ -0,0 +1,18 @@ +{ + "api_id": "privateca.googleapis.com", + "api_shortname": "privateca", + "client_documentation": "https://cloud.google.com/ruby/docs/reference/google-cloud-security-private_ca-v1beta1/latest", + "distribution_name": "google-cloud-security-private_ca-v1beta1", + "is_cloud": true, + "language": "ruby", + "name": "privateca", + "name_pretty": "Certificate Authority Service V1beta1 API", + "product_documentation": "https://cloud.google.com/certificate-authority-service/", + "release_level": "unreleased", + "repo": "googleapis/google-cloud-ruby", + "requires_billing": true, + "ruby-cloud-description": "Certificate Authority Service is a highly available, scalable Google Cloud service that enables you to simplify, automate, and customize the deployment, management, and security of private certificate authorities (CA). Note that google-cloud-security-private_ca-v1beta1 is a version-specific client library. For most uses, we recommend installing the main client library google-cloud-security-private_ca instead. See the readme for more details.", + "ruby-cloud-env-prefix": "PRIVATE_CA", + "ruby-cloud-product-url": "https://cloud.google.com/certificate-authority-service/", + "library_type": "GAPIC_AUTO" +} diff --git a/owl-bot-staging/google-cloud-security-private_ca-v1beta1/.rubocop.yml b/owl-bot-staging/google-cloud-security-private_ca-v1beta1/.rubocop.yml new file mode 100644 index 000000000000..fd09dadd27e7 --- /dev/null +++ b/owl-bot-staging/google-cloud-security-private_ca-v1beta1/.rubocop.yml @@ -0,0 +1,33 @@ +inherit_gem: + google-style: google-style.yml + +AllCops: + Exclude: + - "google-cloud-security-private_ca-v1beta1.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-security-private_ca-v1beta1.rb" diff --git a/owl-bot-staging/google-cloud-security-private_ca-v1beta1/.toys.rb b/owl-bot-staging/google-cloud-security-private_ca-v1beta1/.toys.rb new file mode 100644 index 000000000000..177e22456e8a --- /dev/null +++ b/owl-bot-staging/google-cloud-security-private_ca-v1beta1/.toys.rb @@ -0,0 +1,28 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +toys_version! ">= 0.15.3" + +if ENV["RUBY_COMMON_TOOLS"] + common_tools_dir = File.expand_path ENV["RUBY_COMMON_TOOLS"] + load File.join(common_tools_dir, "toys", "gapic") +else + load_git remote: "https://github.com/googleapis/ruby-common-tools.git", + path: "toys/gapic", + update: true +end diff --git a/owl-bot-staging/google-cloud-security-private_ca-v1beta1/.yardopts b/owl-bot-staging/google-cloud-security-private_ca-v1beta1/.yardopts new file mode 100644 index 000000000000..0500d6ab419b --- /dev/null +++ b/owl-bot-staging/google-cloud-security-private_ca-v1beta1/.yardopts @@ -0,0 +1,12 @@ +--no-private +--title="Certificate Authority Service V1beta1 API" +--exclude _pb\.rb$ +--markup markdown +--markup-provider redcarpet + +./lib/**/*.rb +./proto_docs/**/*.rb +- +README.md +LICENSE.md +AUTHENTICATION.md diff --git a/owl-bot-staging/google-cloud-security-private_ca-v1beta1/AUTHENTICATION.md b/owl-bot-staging/google-cloud-security-private_ca-v1beta1/AUTHENTICATION.md new file mode 100644 index 000000000000..af0fea24815e --- /dev/null +++ b/owl-bot-staging/google-cloud-security-private_ca-v1beta1/AUTHENTICATION.md @@ -0,0 +1,122 @@ +# Authentication + +The recommended way to authenticate to the google-cloud-security-private_ca-v1beta1 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-security-private_ca-v1beta1 library provides several mechanisms to configure your system. +Generally, using Application Default Credentials to facilitate automatic +credentials discovery is the easist method. But if you need to explicitly specify +credentials, there are several methods available to you. + +Credentials are accepted in the following ways, in the following order or precedence: + +1. Credentials specified in method arguments +2. Credentials specified in configuration +3. Credentials pointed to or included in environment variables +4. Credentials found in local ADC file +5. Credentials returned by the metadata server for the attached service account (GCP) + +### Configuration + +You can configure a path to a JSON credentials file, either for an individual client object or +globally, for all client objects. The JSON file can contain credentials created for +[workload identity federation](https://cloud.google.com/iam/docs/workload-identity-federation), +[workforce identity federation](https://cloud.google.com/iam/docs/workforce-identity-federation), or a +[service account key](https://cloud.google.com/docs/authentication/provide-credentials-adc#local-key). + +Note: Service account keys are a security risk if not managed correctly. You should +[choose a more secure alternative to service account keys](https://cloud.google.com/docs/authentication#auth-decision-tree) +whenever possible. + +To configure a credentials file for an individual client initialization: + +```ruby +require "google/cloud/security/private_ca/v1beta1" + +client = ::Google::Cloud::Security::PrivateCA::V1beta1::CertificateAuthorityService::Client.new do |config| + config.credentials = "path/to/credentialfile.json" +end +``` + +To configure a credentials file globally for all clients: + +```ruby +require "google/cloud/security/private_ca/v1beta1" + +::Google::Cloud::Security::PrivateCA::V1beta1::CertificateAuthorityService::Client.configure do |config| + config.credentials = "path/to/credentialfile.json" +end + +client = ::Google::Cloud::Security::PrivateCA::V1beta1::CertificateAuthorityService::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-security-private_ca-v1beta1 +checks for credentials are: + +* `GOOGLE_CLOUD_CREDENTIALS` - Path to JSON file, or JSON contents +* `GOOGLE_APPLICATION_CREDENTIALS` - Path to JSON file + +```ruby +require "google/cloud/security/private_ca/v1beta1" + +ENV["GOOGLE_APPLICATION_CREDENTIALS"] = "path/to/credentialfile.json" + +client = ::Google::Cloud::Security::PrivateCA::V1beta1::CertificateAuthorityService::Client.new +``` + +### Local ADC file + +You can set up a local ADC file with your user credentials for authentication during +development. If credentials are not provided in code or in environment variables, +then the local ADC credentials are discovered. + +Follow the steps in [Quickstart](#quickstart) to set up a local ADC file. + +### Google Cloud Platform environments + +When running on Google Cloud Platform (GCP), including Google Compute Engine +(GCE), Google Kubernetes Engine (GKE), Google App Engine (GAE), Google Cloud +Functions (GCF) and Cloud Run, credentials are retrieved from the attached +service account automatically. Code should be written as if already authenticated. + +For more information, see +[Set up ADC for Google Cloud services](https://cloud.google.com/docs/authentication/provide-credentials-adc#attached-sa). diff --git a/owl-bot-staging/google-cloud-security-private_ca-v1beta1/CHANGELOG.md b/owl-bot-staging/google-cloud-security-private_ca-v1beta1/CHANGELOG.md new file mode 100644 index 000000000000..f88957a62ba2 --- /dev/null +++ b/owl-bot-staging/google-cloud-security-private_ca-v1beta1/CHANGELOG.md @@ -0,0 +1,2 @@ +# Release History + diff --git a/owl-bot-staging/google-cloud-security-private_ca-v1beta1/Gemfile b/owl-bot-staging/google-cloud-security-private_ca-v1beta1/Gemfile new file mode 100644 index 000000000000..1d08558908d8 --- /dev/null +++ b/owl-bot-staging/google-cloud-security-private_ca-v1beta1/Gemfile @@ -0,0 +1,14 @@ +source "https://rubygems.org" + +gemspec + +gem "google-style", "~> 1.32.0" +gem "irb", "~> 1.17" +gem "minitest", "~> 6.0.2" +gem "minitest-focus", "~> 1.4" +gem "minitest-mock", "~> 5.27" +gem "minitest-rg", "~> 5.3" +gem "ostruct", "~> 0.5.5" +gem "rake", ">= 13.0" +gem "redcarpet", "~> 3.6" +gem "yard", "~> 0.9" diff --git a/owl-bot-staging/google-cloud-security-private_ca-v1beta1/LICENSE.md b/owl-bot-staging/google-cloud-security-private_ca-v1beta1/LICENSE.md new file mode 100644 index 000000000000..c261857ba6ad --- /dev/null +++ b/owl-bot-staging/google-cloud-security-private_ca-v1beta1/LICENSE.md @@ -0,0 +1,201 @@ + Apache License + Version 2.0, January 2004 + http://www.apache.org/licenses/ + + TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION + + 1. Definitions. + + "License" shall mean the terms and conditions for use, reproduction, + and distribution as defined by Sections 1 through 9 of this document. + + "Licensor" shall mean the copyright owner or entity authorized by + the copyright owner that is granting the License. + + "Legal Entity" shall mean the union of the acting entity and all + other entities that control, are controlled by, or are under common + control with that entity. For the purposes of this definition, + "control" means (i) the power, direct or indirect, to cause the + direction or management of such entity, whether by contract or + otherwise, or (ii) ownership of fifty percent (50%) or more of the + outstanding shares, or (iii) beneficial ownership of such entity. + + "You" (or "Your") shall mean an individual or Legal Entity + exercising permissions granted by this License. + + "Source" form shall mean the preferred form for making modifications, + including but not limited to software source code, documentation + source, and configuration files. + + "Object" form shall mean any form resulting from mechanical + transformation or translation of a Source form, including but + not limited to compiled object code, generated documentation, + and conversions to other media types. + + "Work" shall mean the work of authorship, whether in Source or + Object form, made available under the License, as indicated by a + copyright notice that is included in or attached to the work + (an example is provided in the Appendix below). + + "Derivative Works" shall mean any work, whether in Source or Object + form, that is based on (or derived from) the Work and for which the + editorial revisions, annotations, elaborations, or other modifications + represent, as a whole, an original work of authorship. For the purposes + of this License, Derivative Works shall not include works that remain + separable from, or merely link (or bind by name) to the interfaces of, + the Work and Derivative Works thereof. + + "Contribution" shall mean any work of authorship, including + the original version of the Work and any modifications or additions + to that Work or Derivative Works thereof, that is intentionally + submitted to Licensor for inclusion in the Work by the copyright owner + or by an individual or Legal Entity authorized to submit on behalf of + the copyright owner. For the purposes of this definition, "submitted" + means any form of electronic, verbal, or written communication sent + to the Licensor or its representatives, including but not limited to + communication on electronic mailing lists, source code control systems, + and issue tracking systems that are managed by, or on behalf of, the + Licensor for the purpose of discussing and improving the Work, but + excluding communication that is conspicuously marked or otherwise + designated in writing by the copyright owner as "Not a Contribution." + + "Contributor" shall mean Licensor and any individual or Legal Entity + on behalf of whom a Contribution has been received by Licensor and + subsequently incorporated within the Work. + + 2. Grant of Copyright License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + copyright license to reproduce, prepare Derivative Works of, + publicly display, publicly perform, sublicense, and distribute the + Work and such Derivative Works in Source or Object form. + + 3. Grant of Patent License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + (except as stated in this section) patent license to make, have made, + use, offer to sell, sell, import, and otherwise transfer the Work, + where such license applies only to those patent claims licensable + by such Contributor that are necessarily infringed by their + Contribution(s) alone or by combination of their Contribution(s) + with the Work to which such Contribution(s) was submitted. If You + institute patent litigation against any entity (including a + cross-claim or counterclaim in a lawsuit) alleging that the Work + or a Contribution incorporated within the Work constitutes direct + or contributory patent infringement, then any patent licenses + granted to You under this License for that Work shall terminate + as of the date such litigation is filed. + + 4. Redistribution. You may reproduce and distribute copies of the + Work or Derivative Works thereof in any medium, with or without + modifications, and in Source or Object form, provided that You + meet the following conditions: + + (a) You must give any other recipients of the Work or + Derivative Works a copy of this License; and + + (b) You must cause any modified files to carry prominent notices + stating that You changed the files; and + + (c) You must retain, in the Source form of any Derivative Works + that You distribute, all copyright, patent, trademark, and + attribution notices from the Source form of the Work, + excluding those notices that do not pertain to any part of + the Derivative Works; and + + (d) If the Work includes a "NOTICE" text file as part of its + distribution, then any Derivative Works that You distribute must + include a readable copy of the attribution notices contained + within such NOTICE file, excluding those notices that do not + pertain to any part of the Derivative Works, in at least one + of the following places: within a NOTICE text file distributed + as part of the Derivative Works; within the Source form or + documentation, if provided along with the Derivative Works; or, + within a display generated by the Derivative Works, if and + wherever such third-party notices normally appear. The contents + of the NOTICE file are for informational purposes only and + do not modify the License. You may add Your own attribution + notices within Derivative Works that You distribute, alongside + or as an addendum to the NOTICE text from the Work, provided + that such additional attribution notices cannot be construed + as modifying the License. + + You may add Your own copyright statement to Your modifications and + may provide additional or different license terms and conditions + for use, reproduction, or distribution of Your modifications, or + for any such Derivative Works as a whole, provided Your use, + reproduction, and distribution of the Work otherwise complies with + the conditions stated in this License. + + 5. Submission of Contributions. Unless You explicitly state otherwise, + any Contribution intentionally submitted for inclusion in the Work + by You to the Licensor shall be under the terms and conditions of + this License, without any additional terms or conditions. + Notwithstanding the above, nothing herein shall supersede or modify + the terms of any separate license agreement you may have executed + with Licensor regarding such Contributions. + + 6. Trademarks. This License does not grant permission to use the trade + names, trademarks, service marks, or product names of the Licensor, + except as required for reasonable and customary use in describing the + origin of the Work and reproducing the content of the NOTICE file. + + 7. Disclaimer of Warranty. Unless required by applicable law or + agreed to in writing, Licensor provides the Work (and each + Contributor provides its Contributions) on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or + implied, including, without limitation, any warranties or conditions + of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A + PARTICULAR PURPOSE. You are solely responsible for determining the + appropriateness of using or redistributing the Work and assume any + risks associated with Your exercise of permissions under this License. + + 8. Limitation of Liability. In no event and under no legal theory, + whether in tort (including negligence), contract, or otherwise, + unless required by applicable law (such as deliberate and grossly + negligent acts) or agreed to in writing, shall any Contributor be + liable to You for damages, including any direct, indirect, special, + incidental, or consequential damages of any character arising as a + result of this License or out of the use or inability to use the + Work (including but not limited to damages for loss of goodwill, + work stoppage, computer failure or malfunction, or any and all + other commercial damages or losses), even if such Contributor + has been advised of the possibility of such damages. + + 9. Accepting Warranty or Additional Liability. While redistributing + the Work or Derivative Works thereof, You may choose to offer, + and charge a fee for, acceptance of support, warranty, indemnity, + or other liability obligations and/or rights consistent with this + License. However, in accepting such obligations, You may act only + on Your own behalf and on Your sole responsibility, not on behalf + of any other Contributor, and only if You agree to indemnify, + defend, and hold each Contributor harmless for any liability + incurred by, or claims asserted against, such Contributor by reason + of your accepting any such warranty or additional liability. + + END OF TERMS AND CONDITIONS + + APPENDIX: How to apply the Apache License to your work. + + To apply the Apache License to your work, attach the following + boilerplate notice, with the fields enclosed by brackets "[]" + replaced with your own identifying information. (Don't include + the brackets!) The text should be enclosed in the appropriate + comment syntax for the file format. We also recommend that a + file or class name and description of purpose be included on the + same "printed page" as the copyright notice for easier + identification within third-party archives. + + Copyright [yyyy] [name of copyright owner] + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. diff --git a/owl-bot-staging/google-cloud-security-private_ca-v1beta1/README.md b/owl-bot-staging/google-cloud-security-private_ca-v1beta1/README.md new file mode 100644 index 000000000000..6a08b9d9f604 --- /dev/null +++ b/owl-bot-staging/google-cloud-security-private_ca-v1beta1/README.md @@ -0,0 +1,154 @@ +# Ruby Client for the Certificate Authority Service V1beta1 API + +API Client library for the Certificate Authority Service V1beta1 API + +Certificate Authority Service is a highly available, scalable Google Cloud service that enables you to simplify, automate, and customize the deployment, management, and security of private certificate authorities (CA). + +https://github.com/googleapis/google-cloud-ruby + +This gem is a _versioned_ client. It provides basic client classes for a +specific version of the Certificate Authority Service V1beta1 API. Most users should consider using +the main client gem, +[google-cloud-security-private_ca](https://rubygems.org/gems/google-cloud-security-private_ca). +See the section below titled *Which client should I use?* for more information. + +## Installation + +``` +$ gem install google-cloud-security-private_ca-v1beta1 +``` + +## 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/privateca.googleapis.com) +1. [Set up authentication.](AUTHENTICATION.md) + +## Quick Start + +```ruby +require "google/cloud/security/private_ca/v1beta1" + +client = ::Google::Cloud::Security::PrivateCA::V1beta1::CertificateAuthorityService::Client.new +request = ::Google::Cloud::Security::PrivateCA::V1beta1::CreateCertificateRequest.new # (request fields as keyword arguments...) +response = client.create_certificate request +``` + +View the [Client Library Documentation](https://cloud.google.com/ruby/docs/reference/google-cloud-security-private_ca-v1beta1/latest) +for class and method documentation. + +See also the [Product Documentation](https://cloud.google.com/certificate-authority-service/) +for general usage information. + +## Debug Logging + +This library comes with opt-in Debug Logging that can help you troubleshoot +your application's integration with the API. When logging is activated, key +events such as requests and responses, along with data payloads and metadata +such as headers and client configuration, are logged to the standard error +stream. + +**WARNING:** Client Library Debug Logging includes your data payloads in +plaintext, which could include sensitive data such as PII for yourself or your +customers, private keys, or other security data that could be compromising if +leaked. Always practice good data hygiene with your application logs, and follow +the principle of least access. Google also recommends that Client Library Debug +Logging be enabled only temporarily during active debugging, and not used +permanently in production. + +To enable logging, set the environment variable `GOOGLE_SDK_RUBY_LOGGING_GEMS` +to the value `all`. Alternatively, you can set the value to a comma-delimited +list of client library gem names. This will select the default logging behavior, +which writes logs to the standard error stream. On a local workstation, this may +result in logs appearing on the console. When running on a Google Cloud hosting +service such as [Google Cloud Run](https://cloud.google.com/run), this generally +results in logs appearing alongside your application logs in the +[Google Cloud Logging](https://cloud.google.com/logging/) service. + +You can customize logging by modifying the `logger` configuration when +constructing a client object. For example: + +```ruby +require "google/cloud/security/private_ca/v1beta1" +require "logger" + +client = ::Google::Cloud::Security::PrivateCA::V1beta1::CertificateAuthorityService::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-security-private_ca`, +and lower-level _versioned_ client libraries with names such as +`google-cloud-security-private_ca-v1beta1`. +_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-security-private_ca`. +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-security-private_ca-v1beta1`. + +### What about the google-apis- clients? + +Client library gems with names that begin with `google-apis-` are based on an +older code generation technology. They talk to a REST/JSON backend (whereas +most modern clients talk to a [gRPC](https://grpc.io/) backend) and they may +not offer the same performance, features, and ease of use provided by more +modern clients. + +The `google-apis-` clients have wide coverage across Google services, so you +might need to use one if there is no modern client available for the service. +However, if a modern client is available, we generally recommend it over the +older `google-apis-` clients. diff --git a/owl-bot-staging/google-cloud-security-private_ca-v1beta1/Rakefile b/owl-bot-staging/google-cloud-security-private_ca-v1beta1/Rakefile new file mode 100644 index 000000000000..26402e7d932d --- /dev/null +++ b/owl-bot-staging/google-cloud-security-private_ca-v1beta1/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-security-private_ca-v1beta1 acceptance tests." +task :acceptance, :project, :keyfile do |t, args| + project = args[:project] + project ||= + ENV["PRIVATE_CA_TEST_PROJECT"] || + ENV["GCLOUD_TEST_PROJECT"] + keyfile = args[:keyfile] + keyfile ||= + ENV["PRIVATE_CA_TEST_KEYFILE"] || + ENV["GCLOUD_TEST_KEYFILE"] + if keyfile + keyfile = File.read keyfile + else + keyfile ||= + ENV["PRIVATE_CA_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 PRIVATE_CA_TEST_PROJECT=test123 PRIVATE_CA_TEST_KEYFILE=/path/to/keyfile.json rake acceptance" + end + require "google/cloud/security/private_ca/v1beta1/certificate_authority_service/credentials" + ::Google::Cloud::Security::PrivateCA::V1beta1::CertificateAuthorityService::Credentials.env_vars.each do |path| + ENV[path] = nil + end + ENV["PRIVATE_CA_PROJECT"] = project + ENV["PRIVATE_CA_TEST_PROJECT"] = project + ENV["PRIVATE_CA_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-security-private_ca-v1beta1 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-security-private_ca-v1beta1 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-security-private_ca-v1beta1 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-security-private_ca-v1beta1 gem does not have doctest tests." +end + +desc "Run the CI build" +task :ci do + header "BUILDING google-cloud-security-private_ca-v1beta1" + header "google-cloud-security-private_ca-v1beta1 rubocop", "*" + Rake::Task[:rubocop].invoke + header "google-cloud-security-private_ca-v1beta1 yard", "*" + Rake::Task[:yard].invoke + header "google-cloud-security-private_ca-v1beta1 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-security-private_ca-v1beta1 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-security-private_ca-v1beta1 acceptance", "*" + Rake::Task[:acceptance].invoke + end + task :a do + # This is a handy shortcut to save typing + Rake::Task["ci:acceptance"].invoke + end +end + +task default: :test + +def header str, token = "#" + line_length = str.length + 8 + puts "" + puts token * line_length + puts "#{token * 3} #{str} #{token * 3}" + puts token * line_length + puts "" +end diff --git a/owl-bot-staging/google-cloud-security-private_ca-v1beta1/gapic_metadata.json b/owl-bot-staging/google-cloud-security-private_ca-v1beta1/gapic_metadata.json new file mode 100644 index 000000000000..7a5ef08f6ba7 --- /dev/null +++ b/owl-bot-staging/google-cloud-security-private_ca-v1beta1/gapic_metadata.json @@ -0,0 +1,118 @@ +{ + "schema": "1.0", + "comment": "This file maps proto services/RPCs to the corresponding library clients/methods", + "language": "ruby", + "protoPackage": "google.cloud.security.privateca.v1beta1", + "libraryPackage": "::Google::Cloud::Security::PrivateCA::V1beta1", + "services": { + "CertificateAuthorityService": { + "clients": { + "grpc": { + "libraryClient": "::Google::Cloud::Security::PrivateCA::V1beta1::CertificateAuthorityService::Client", + "rpcs": { + "CreateCertificate": { + "methods": [ + "create_certificate" + ] + }, + "GetCertificate": { + "methods": [ + "get_certificate" + ] + }, + "ListCertificates": { + "methods": [ + "list_certificates" + ] + }, + "RevokeCertificate": { + "methods": [ + "revoke_certificate" + ] + }, + "UpdateCertificate": { + "methods": [ + "update_certificate" + ] + }, + "ActivateCertificateAuthority": { + "methods": [ + "activate_certificate_authority" + ] + }, + "CreateCertificateAuthority": { + "methods": [ + "create_certificate_authority" + ] + }, + "DisableCertificateAuthority": { + "methods": [ + "disable_certificate_authority" + ] + }, + "EnableCertificateAuthority": { + "methods": [ + "enable_certificate_authority" + ] + }, + "FetchCertificateAuthorityCsr": { + "methods": [ + "fetch_certificate_authority_csr" + ] + }, + "GetCertificateAuthority": { + "methods": [ + "get_certificate_authority" + ] + }, + "ListCertificateAuthorities": { + "methods": [ + "list_certificate_authorities" + ] + }, + "RestoreCertificateAuthority": { + "methods": [ + "restore_certificate_authority" + ] + }, + "ScheduleDeleteCertificateAuthority": { + "methods": [ + "schedule_delete_certificate_authority" + ] + }, + "UpdateCertificateAuthority": { + "methods": [ + "update_certificate_authority" + ] + }, + "GetCertificateRevocationList": { + "methods": [ + "get_certificate_revocation_list" + ] + }, + "ListCertificateRevocationLists": { + "methods": [ + "list_certificate_revocation_lists" + ] + }, + "UpdateCertificateRevocationList": { + "methods": [ + "update_certificate_revocation_list" + ] + }, + "GetReusableConfig": { + "methods": [ + "get_reusable_config" + ] + }, + "ListReusableConfigs": { + "methods": [ + "list_reusable_configs" + ] + } + } + } + } + } + } +} diff --git a/owl-bot-staging/google-cloud-security-private_ca-v1beta1/google-cloud-security-private_ca-v1beta1.gemspec b/owl-bot-staging/google-cloud-security-private_ca-v1beta1/google-cloud-security-private_ca-v1beta1.gemspec new file mode 100644 index 000000000000..870ee8c8861b --- /dev/null +++ b/owl-bot-staging/google-cloud-security-private_ca-v1beta1/google-cloud-security-private_ca-v1beta1.gemspec @@ -0,0 +1,28 @@ +# -*- ruby -*- +# encoding: utf-8 + +require File.expand_path("lib/google/cloud/security/private_ca/v1beta1/version", __dir__) + +Gem::Specification.new do |gem| + gem.name = "google-cloud-security-private_ca-v1beta1" + gem.version = Google::Cloud::Security::PrivateCA::V1beta1::VERSION + + gem.authors = ["Google LLC"] + gem.email = "googleapis-packages@google.com" + gem.description = "Certificate Authority Service is a highly available, scalable Google Cloud service that enables you to simplify, automate, and customize the deployment, management, and security of private certificate authorities (CA). Note that google-cloud-security-private_ca-v1beta1 is a version-specific client library. For most uses, we recommend installing the main client library google-cloud-security-private_ca instead. See the readme for more details." + gem.summary = "API Client library for the Certificate Authority Service V1beta1 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" +end diff --git a/owl-bot-staging/google-cloud-security-private_ca-v1beta1/lib/google-cloud-security-private_ca-v1beta1.rb b/owl-bot-staging/google-cloud-security-private_ca-v1beta1/lib/google-cloud-security-private_ca-v1beta1.rb new file mode 100644 index 000000000000..472d24065727 --- /dev/null +++ b/owl-bot-staging/google-cloud-security-private_ca-v1beta1/lib/google-cloud-security-private_ca-v1beta1.rb @@ -0,0 +1,21 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +# This gem does not autoload during Bundler.require. To load this gem, +# issue explicit require statements for the packages desired, e.g.: +# require "google/cloud/security/private_ca/v1beta1" diff --git a/owl-bot-staging/google-cloud-security-private_ca-v1beta1/lib/google/cloud/security/private_ca/v1beta1.rb b/owl-bot-staging/google-cloud-security-private_ca-v1beta1/lib/google/cloud/security/private_ca/v1beta1.rb new file mode 100644 index 000000000000..d311a3538d33 --- /dev/null +++ b/owl-bot-staging/google-cloud-security-private_ca-v1beta1/lib/google/cloud/security/private_ca/v1beta1.rb @@ -0,0 +1,47 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +require "google/cloud/security/private_ca/v1beta1/certificate_authority_service" +require "google/cloud/security/private_ca/v1beta1/version" + +module Google + module Cloud + module Security + module PrivateCA + ## + # API client module. + # + # @example Load this package, including all its services, and instantiate a gRPC client + # + # require "google/cloud/security/private_ca/v1beta1" + # client = ::Google::Cloud::Security::PrivateCA::V1beta1::CertificateAuthorityService::Client.new + # + # @example Load this package, including all its services, and instantiate a REST client + # + # require "google/cloud/security/private_ca/v1beta1" + # client = ::Google::Cloud::Security::PrivateCA::V1beta1::CertificateAuthorityService::Rest::Client.new + # + module V1beta1 + end + end + end + end +end + +helper_path = ::File.join __dir__, "v1beta1", "_helpers.rb" +require "google/cloud/security/private_ca/v1beta1/_helpers" if ::File.file? helper_path diff --git a/owl-bot-staging/google-cloud-security-private_ca-v1beta1/lib/google/cloud/security/private_ca/v1beta1/certificate_authority_service.rb b/owl-bot-staging/google-cloud-security-private_ca-v1beta1/lib/google/cloud/security/private_ca/v1beta1/certificate_authority_service.rb new file mode 100644 index 000000000000..e8e34962137a --- /dev/null +++ b/owl-bot-staging/google-cloud-security-private_ca-v1beta1/lib/google/cloud/security/private_ca/v1beta1/certificate_authority_service.rb @@ -0,0 +1,59 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +require "gapic/common" +require "gapic/config" +require "gapic/config/method" + +require "google/cloud/security/private_ca/v1beta1/version" + +require "google/cloud/security/private_ca/v1beta1/certificate_authority_service/credentials" +require "google/cloud/security/private_ca/v1beta1/certificate_authority_service/paths" +require "google/cloud/security/private_ca/v1beta1/certificate_authority_service/operations" +require "google/cloud/security/private_ca/v1beta1/certificate_authority_service/client" +require "google/cloud/security/private_ca/v1beta1/certificate_authority_service/rest" + +module Google + module Cloud + module Security + module PrivateCA + module V1beta1 + ## + # {::Google::Cloud::Security::PrivateCA::V1beta1::CertificateAuthorityService::Client Certificate Authority Service} manages private + # certificate authorities and issued certificates. + # + # @example Load this service and instantiate a gRPC client + # + # require "google/cloud/security/private_ca/v1beta1/certificate_authority_service" + # client = ::Google::Cloud::Security::PrivateCA::V1beta1::CertificateAuthorityService::Client.new + # + # @example Load this service and instantiate a REST client + # + # require "google/cloud/security/private_ca/v1beta1/certificate_authority_service/rest" + # client = ::Google::Cloud::Security::PrivateCA::V1beta1::CertificateAuthorityService::Rest::Client.new + # + module CertificateAuthorityService + end + end + end + end + end +end + +helper_path = ::File.join __dir__, "certificate_authority_service", "helpers.rb" +require "google/cloud/security/private_ca/v1beta1/certificate_authority_service/helpers" if ::File.file? helper_path diff --git a/owl-bot-staging/google-cloud-security-private_ca-v1beta1/lib/google/cloud/security/private_ca/v1beta1/certificate_authority_service/client.rb b/owl-bot-staging/google-cloud-security-private_ca-v1beta1/lib/google/cloud/security/private_ca/v1beta1/certificate_authority_service/client.rb new file mode 100644 index 000000000000..a3c4dd1f0fce --- /dev/null +++ b/owl-bot-staging/google-cloud-security-private_ca-v1beta1/lib/google/cloud/security/private_ca/v1beta1/certificate_authority_service/client.rb @@ -0,0 +1,2614 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +require "google/cloud/errors" +require "google/cloud/security/privateca/v1beta1/service_pb" + +module Google + module Cloud + module Security + module PrivateCA + module V1beta1 + module CertificateAuthorityService + ## + # Client for the CertificateAuthorityService service. + # + # {::Google::Cloud::Security::PrivateCA::V1beta1::CertificateAuthorityService::Client Certificate Authority Service} manages private + # certificate authorities and issued certificates. + # + class Client + # @private + API_VERSION = "" + + # @private + DEFAULT_ENDPOINT_TEMPLATE = "privateca.$UNIVERSE_DOMAIN$" + + include Paths + + # @private + attr_reader :certificate_authority_service_stub + + ## + # Configure the CertificateAuthorityService Client class. + # + # See {::Google::Cloud::Security::PrivateCA::V1beta1::CertificateAuthorityService::Client::Configuration} + # for a description of the configuration fields. + # + # @example + # + # # Modify the configuration for all CertificateAuthorityService clients + # ::Google::Cloud::Security::PrivateCA::V1beta1::CertificateAuthorityService::Client.configure do |config| + # config.timeout = 10.0 + # end + # + # @yield [config] Configure the Client client. + # @yieldparam config [Client::Configuration] + # + # @return [Client::Configuration] + # + def self.configure + @configure ||= begin + namespace = ["Google", "Cloud", "Security", "PrivateCA", "V1beta1"] + parent_config = while namespace.any? + parent_name = namespace.join "::" + parent_const = const_get parent_name + break parent_const.configure if parent_const.respond_to? :configure + namespace.pop + end + default_config = Client::Configuration.new parent_config + + default_config.timeout = 60.0 + default_config.retry_policy = { + initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [2, 14, 4] + } + + default_config + end + yield @configure if block_given? + @configure + end + + ## + # Configure the CertificateAuthorityService Client instance. + # + # The configuration is set to the derived mode, meaning that values can be changed, + # but structural changes (adding new fields, etc.) are not allowed. Structural changes + # should be made on {Client.configure}. + # + # See {::Google::Cloud::Security::PrivateCA::V1beta1::CertificateAuthorityService::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 + @certificate_authority_service_stub.universe_domain + end + + ## + # Create a new CertificateAuthorityService client object. + # + # @example + # + # # Create a client using the default configuration + # client = ::Google::Cloud::Security::PrivateCA::V1beta1::CertificateAuthorityService::Client.new + # + # # Create a client using a custom configuration + # client = ::Google::Cloud::Security::PrivateCA::V1beta1::CertificateAuthorityService::Client.new do |config| + # config.timeout = 10.0 + # end + # + # @yield [config] Configure the CertificateAuthorityService client. + # @yieldparam config [Client::Configuration] + # + def initialize + # These require statements are intentionally placed here to initialize + # the gRPC module only when it's required. + # See https://github.com/googleapis/toolkit/issues/446 + require "gapic/grpc" + require "google/cloud/security/privateca/v1beta1/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 + + @certificate_authority_service_stub = ::Gapic::ServiceStub.new( + ::Google::Cloud::Security::PrivateCA::V1beta1::CertificateAuthorityService::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 + ) + + @certificate_authority_service_stub.stub_logger&.info do |entry| + entry.set_system_name + entry.set_service + entry.message = "Created client for #{entry.service}" + entry.set_credentials_fields credentials + entry.set "customEndpoint", @config.endpoint if @config.endpoint + entry.set "defaultTimeout", @config.timeout if @config.timeout + entry.set "quotaProject", @quota_project_id if @quota_project_id + end + end + + ## + # Get the associated client for long-running operations. + # + # @return [::Google::Cloud::Security::PrivateCA::V1beta1::CertificateAuthorityService::Operations] + # + attr_reader :operations_client + + ## + # The logger used for request/response debug logging. + # + # @return [Logger] + # + def logger + @certificate_authority_service_stub.logger + end + + # Service calls + + ## + # Create a new {::Google::Cloud::Security::PrivateCA::V1beta1::Certificate Certificate} in a given Project, Location from a particular + # {::Google::Cloud::Security::PrivateCA::V1beta1::CertificateAuthority CertificateAuthority}. + # + # @overload create_certificate(request, options = nil) + # Pass arguments to `create_certificate` via a request object, either of type + # {::Google::Cloud::Security::PrivateCA::V1beta1::CreateCertificateRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Security::PrivateCA::V1beta1::CreateCertificateRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_certificate(parent: nil, certificate_id: nil, certificate: nil, request_id: nil) + # Pass arguments to `create_certificate` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param parent [::String] + # Required. The resource name of the location and {::Google::Cloud::Security::PrivateCA::V1beta1::CertificateAuthority CertificateAuthority} + # associated with the {::Google::Cloud::Security::PrivateCA::V1beta1::Certificate Certificate}, in the format + # `projects/*/locations/*/certificateAuthorities/*`. + # @param certificate_id [::String] + # Optional. It must be unique within a location and match the regular + # expression `[a-zA-Z0-9_-]{1,63}`. This field is required when using a + # {::Google::Cloud::Security::PrivateCA::V1beta1::CertificateAuthority CertificateAuthority} in the Enterprise {::Google::Cloud::Security::PrivateCA::V1beta1::CertificateAuthority::Tier CertificateAuthority.Tier}, + # but is optional and its value is ignored otherwise. + # @param certificate [::Google::Cloud::Security::PrivateCA::V1beta1::Certificate, ::Hash] + # Required. A {::Google::Cloud::Security::PrivateCA::V1beta1::Certificate Certificate} with initial field values. + # @param request_id [::String] + # Optional. An ID to identify requests. Specify a unique request ID so that if you must + # retry your request, the server will know to ignore the request if it has + # already been completed. The server will guarantee that for at least 60 + # minutes since the first request. + # + # For example, consider a situation where you make an initial request and t + # he request times out. If you make the request again with the same request + # ID, the server can check if original operation with the same request ID + # was received, and if so, will ignore the second request. This prevents + # clients from accidentally creating duplicate commitments. + # + # The request ID must be a valid UUID with the exception that zero UUID is + # not supported (00000000-0000-0000-0000-000000000000). + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Google::Cloud::Security::PrivateCA::V1beta1::Certificate] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Google::Cloud::Security::PrivateCA::V1beta1::Certificate] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/security/private_ca/v1beta1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Security::PrivateCA::V1beta1::CertificateAuthorityService::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Security::PrivateCA::V1beta1::CreateCertificateRequest.new + # + # # Call the create_certificate method. + # result = client.create_certificate request + # + # # The returned object is of type Google::Cloud::Security::PrivateCA::V1beta1::Certificate. + # p result + # + def create_certificate request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Security::PrivateCA::V1beta1::CreateCertificateRequest + + # Converts hash 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_certificate.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::Security::PrivateCA::V1beta1::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_certificate.timeout, + metadata: metadata, + retry_policy: @config.rpcs.create_certificate.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @certificate_authority_service_stub.call_rpc :create_certificate, request, options: options do |response, operation| + yield response, operation if block_given? + end + rescue ::GRPC::BadStatus => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Returns a {::Google::Cloud::Security::PrivateCA::V1beta1::Certificate Certificate}. + # + # @overload get_certificate(request, options = nil) + # Pass arguments to `get_certificate` via a request object, either of type + # {::Google::Cloud::Security::PrivateCA::V1beta1::GetCertificateRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Security::PrivateCA::V1beta1::GetCertificateRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_certificate(name: nil) + # Pass arguments to `get_certificate` via keyword arguments. Note that at + # least one keyword argument is 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 {::Google::Cloud::Security::PrivateCA::V1beta1::Certificate#name name} of the {::Google::Cloud::Security::PrivateCA::V1beta1::Certificate Certificate} to get. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Google::Cloud::Security::PrivateCA::V1beta1::Certificate] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Google::Cloud::Security::PrivateCA::V1beta1::Certificate] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/security/private_ca/v1beta1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Security::PrivateCA::V1beta1::CertificateAuthorityService::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Security::PrivateCA::V1beta1::GetCertificateRequest.new + # + # # Call the get_certificate method. + # result = client.get_certificate request + # + # # The returned object is of type Google::Cloud::Security::PrivateCA::V1beta1::Certificate. + # p result + # + def get_certificate request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Security::PrivateCA::V1beta1::GetCertificateRequest + + # Converts hash 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_certificate.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::Security::PrivateCA::V1beta1::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_certificate.timeout, + metadata: metadata, + retry_policy: @config.rpcs.get_certificate.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @certificate_authority_service_stub.call_rpc :get_certificate, request, options: options do |response, operation| + yield response, operation if block_given? + end + rescue ::GRPC::BadStatus => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Lists {::Google::Cloud::Security::PrivateCA::V1beta1::Certificate Certificates}. + # + # @overload list_certificates(request, options = nil) + # Pass arguments to `list_certificates` via a request object, either of type + # {::Google::Cloud::Security::PrivateCA::V1beta1::ListCertificatesRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Security::PrivateCA::V1beta1::ListCertificatesRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_certificates(parent: nil, page_size: nil, page_token: nil, filter: nil, order_by: nil) + # Pass arguments to `list_certificates` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param parent [::String] + # Required. The resource name of the location associated with the + # {::Google::Cloud::Security::PrivateCA::V1beta1::Certificate Certificates}, in the format + # `projects/*/locations/*/certificateauthorities/*`. + # @param page_size [::Integer] + # Optional. Limit on the number of + # {::Google::Cloud::Security::PrivateCA::V1beta1::Certificate Certificates} to include in the + # response. Further {::Google::Cloud::Security::PrivateCA::V1beta1::Certificate Certificates} can subsequently be obtained + # by including the + # {::Google::Cloud::Security::PrivateCA::V1beta1::ListCertificatesResponse#next_page_token ListCertificatesResponse.next_page_token} in a subsequent + # request. If unspecified, the server will pick an appropriate default. + # @param page_token [::String] + # Optional. Pagination token, returned earlier via + # {::Google::Cloud::Security::PrivateCA::V1beta1::ListCertificatesResponse#next_page_token ListCertificatesResponse.next_page_token}. + # @param filter [::String] + # Optional. Only include resources that match the filter in the response. For details + # on supported filters and syntax, see [Certificates Filtering + # documentation](https://cloud.google.com/certificate-authority-service/docs/sorting-filtering-certificates#filtering_support). + # @param order_by [::String] + # Optional. Specify how the results should be sorted. For details on supported fields + # and syntax, see [Certificates Sorting + # documentation](https://cloud.google.com/certificate-authority-service/docs/sorting-filtering-certificates#sorting_support). + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Gapic::PagedEnumerable<::Google::Cloud::Security::PrivateCA::V1beta1::Certificate>] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Gapic::PagedEnumerable<::Google::Cloud::Security::PrivateCA::V1beta1::Certificate>] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/security/private_ca/v1beta1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Security::PrivateCA::V1beta1::CertificateAuthorityService::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Security::PrivateCA::V1beta1::ListCertificatesRequest.new + # + # # Call the list_certificates method. + # result = client.list_certificates request + # + # # The returned object is of type Gapic::PagedEnumerable. You can iterate + # # over elements, and API calls will be issued to fetch pages as needed. + # result.each do |item| + # # Each element is of type ::Google::Cloud::Security::PrivateCA::V1beta1::Certificate. + # p item + # end + # + def list_certificates request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Security::PrivateCA::V1beta1::ListCertificatesRequest + + # Converts hash 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_certificates.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::Security::PrivateCA::V1beta1::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_certificates.timeout, + metadata: metadata, + retry_policy: @config.rpcs.list_certificates.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @certificate_authority_service_stub.call_rpc :list_certificates, request, options: options do |response, operation| + response = ::Gapic::PagedEnumerable.new @certificate_authority_service_stub, :list_certificates, 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 + + ## + # Revoke a {::Google::Cloud::Security::PrivateCA::V1beta1::Certificate Certificate}. + # + # @overload revoke_certificate(request, options = nil) + # Pass arguments to `revoke_certificate` via a request object, either of type + # {::Google::Cloud::Security::PrivateCA::V1beta1::RevokeCertificateRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Security::PrivateCA::V1beta1::RevokeCertificateRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. + # + # @overload revoke_certificate(name: nil, reason: nil, request_id: nil) + # Pass arguments to `revoke_certificate` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param name [::String] + # Required. The resource name for this {::Google::Cloud::Security::PrivateCA::V1beta1::Certificate Certificate} in the + # format `projects/*/locations/*/certificateAuthorities/*/certificates/*`. + # @param reason [::Google::Cloud::Security::PrivateCA::V1beta1::RevocationReason] + # Required. The {::Google::Cloud::Security::PrivateCA::V1beta1::RevocationReason RevocationReason} for revoking this certificate. + # @param request_id [::String] + # Optional. An ID to identify requests. Specify a unique request ID so that if you must + # retry your request, the server will know to ignore the request if it has + # already been completed. The server will guarantee that for at least 60 + # minutes since the first request. + # + # For example, consider a situation where you make an initial request and t + # he request times out. If you make the request again with the same request + # ID, the server can check if original operation with the same request ID + # was received, and if so, will ignore the second request. This prevents + # clients from accidentally creating duplicate commitments. + # + # The request ID must be a valid UUID with the exception that zero UUID is + # not supported (00000000-0000-0000-0000-000000000000). + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Google::Cloud::Security::PrivateCA::V1beta1::Certificate] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Google::Cloud::Security::PrivateCA::V1beta1::Certificate] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/security/private_ca/v1beta1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Security::PrivateCA::V1beta1::CertificateAuthorityService::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Security::PrivateCA::V1beta1::RevokeCertificateRequest.new + # + # # Call the revoke_certificate method. + # result = client.revoke_certificate request + # + # # The returned object is of type Google::Cloud::Security::PrivateCA::V1beta1::Certificate. + # p result + # + def revoke_certificate request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Security::PrivateCA::V1beta1::RevokeCertificateRequest + + # Converts hash 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.revoke_certificate.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::Security::PrivateCA::V1beta1::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.revoke_certificate.timeout, + metadata: metadata, + retry_policy: @config.rpcs.revoke_certificate.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @certificate_authority_service_stub.call_rpc :revoke_certificate, 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 + + ## + # Update a {::Google::Cloud::Security::PrivateCA::V1beta1::Certificate Certificate}. Currently, the only field you can update is the + # {::Google::Cloud::Security::PrivateCA::V1beta1::Certificate#labels labels} field. + # + # @overload update_certificate(request, options = nil) + # Pass arguments to `update_certificate` via a request object, either of type + # {::Google::Cloud::Security::PrivateCA::V1beta1::UpdateCertificateRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Security::PrivateCA::V1beta1::UpdateCertificateRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_certificate(certificate: nil, update_mask: nil, request_id: nil) + # Pass arguments to `update_certificate` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param certificate [::Google::Cloud::Security::PrivateCA::V1beta1::Certificate, ::Hash] + # Required. {::Google::Cloud::Security::PrivateCA::V1beta1::Certificate Certificate} with updated values. + # @param update_mask [::Google::Protobuf::FieldMask, ::Hash] + # Required. A list of fields to be updated in this request. + # @param request_id [::String] + # Optional. An ID to identify requests. Specify a unique request ID so that if you must + # retry your request, the server will know to ignore the request if it has + # already been completed. The server will guarantee that for at least 60 + # minutes since the first request. + # + # For example, consider a situation where you make an initial request and t + # he request times out. If you make the request again with the same request + # ID, the server can check if original operation with the same request ID + # was received, and if so, will ignore the second request. This prevents + # clients from accidentally creating duplicate commitments. + # + # The request ID must be a valid UUID with the exception that zero UUID is + # not supported (00000000-0000-0000-0000-000000000000). + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Google::Cloud::Security::PrivateCA::V1beta1::Certificate] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Google::Cloud::Security::PrivateCA::V1beta1::Certificate] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/security/private_ca/v1beta1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Security::PrivateCA::V1beta1::CertificateAuthorityService::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Security::PrivateCA::V1beta1::UpdateCertificateRequest.new + # + # # Call the update_certificate method. + # result = client.update_certificate request + # + # # The returned object is of type Google::Cloud::Security::PrivateCA::V1beta1::Certificate. + # p result + # + def update_certificate request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Security::PrivateCA::V1beta1::UpdateCertificateRequest + + # Converts hash 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_certificate.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::Security::PrivateCA::V1beta1::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.certificate&.name + header_params["certificate.name"] = request.certificate.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_certificate.timeout, + metadata: metadata, + retry_policy: @config.rpcs.update_certificate.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @certificate_authority_service_stub.call_rpc :update_certificate, 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 + + ## + # Activate a {::Google::Cloud::Security::PrivateCA::V1beta1::CertificateAuthority CertificateAuthority} that is in state + # {::Google::Cloud::Security::PrivateCA::V1beta1::CertificateAuthority::State::PENDING_ACTIVATION PENDING_ACTIVATION} and is + # of type {::Google::Cloud::Security::PrivateCA::V1beta1::CertificateAuthority::Type::SUBORDINATE SUBORDINATE}. After the + # parent Certificate Authority signs a certificate signing request from + # {::Google::Cloud::Security::PrivateCA::V1beta1::CertificateAuthorityService::Client#fetch_certificate_authority_csr FetchCertificateAuthorityCsr}, this method can complete the activation + # process. + # + # @overload activate_certificate_authority(request, options = nil) + # Pass arguments to `activate_certificate_authority` via a request object, either of type + # {::Google::Cloud::Security::PrivateCA::V1beta1::ActivateCertificateAuthorityRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Security::PrivateCA::V1beta1::ActivateCertificateAuthorityRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. + # + # @overload activate_certificate_authority(name: nil, pem_ca_certificate: nil, subordinate_config: nil, request_id: nil) + # Pass arguments to `activate_certificate_authority` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param name [::String] + # Required. The resource name for this {::Google::Cloud::Security::PrivateCA::V1beta1::CertificateAuthority CertificateAuthority} in the + # format `projects/*/locations/*/certificateAuthorities/*`. + # @param pem_ca_certificate [::String] + # Required. The signed CA certificate issued from + # {::Google::Cloud::Security::PrivateCA::V1beta1::FetchCertificateAuthorityCsrResponse#pem_csr FetchCertificateAuthorityCsrResponse.pem_csr}. + # @param subordinate_config [::Google::Cloud::Security::PrivateCA::V1beta1::SubordinateConfig, ::Hash] + # Required. Must include information about the issuer of 'pem_ca_certificate', and any + # further issuers until the self-signed CA. + # @param request_id [::String] + # Optional. An ID to identify requests. Specify a unique request ID so that if you must + # retry your request, the server will know to ignore the request if it has + # already been completed. The server will guarantee that for at least 60 + # minutes since the first request. + # + # For example, consider a situation where you make an initial request and t + # he request times out. If you make the request again with the same request + # ID, the server can check if original operation with the same request ID + # was received, and if so, will ignore the second request. This prevents + # clients from accidentally creating duplicate commitments. + # + # The request ID must be a valid UUID with the exception that zero UUID is + # not supported (00000000-0000-0000-0000-000000000000). + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Gapic::Operation] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Gapic::Operation] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/security/private_ca/v1beta1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Security::PrivateCA::V1beta1::CertificateAuthorityService::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Security::PrivateCA::V1beta1::ActivateCertificateAuthorityRequest.new + # + # # Call the activate_certificate_authority method. + # result = client.activate_certificate_authority 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 activate_certificate_authority request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Security::PrivateCA::V1beta1::ActivateCertificateAuthorityRequest + + # Converts hash 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.activate_certificate_authority.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::Security::PrivateCA::V1beta1::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.activate_certificate_authority.timeout, + metadata: metadata, + retry_policy: @config.rpcs.activate_certificate_authority.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @certificate_authority_service_stub.call_rpc :activate_certificate_authority, 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 + + ## + # Create a new {::Google::Cloud::Security::PrivateCA::V1beta1::CertificateAuthority CertificateAuthority} in a given Project and Location. + # + # @overload create_certificate_authority(request, options = nil) + # Pass arguments to `create_certificate_authority` via a request object, either of type + # {::Google::Cloud::Security::PrivateCA::V1beta1::CreateCertificateAuthorityRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Security::PrivateCA::V1beta1::CreateCertificateAuthorityRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_certificate_authority(parent: nil, certificate_authority_id: nil, certificate_authority: nil, request_id: nil) + # Pass arguments to `create_certificate_authority` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param parent [::String] + # Required. The resource name of the location associated with the + # {::Google::Cloud::Security::PrivateCA::V1beta1::CertificateAuthority CertificateAuthorities}, in the format + # `projects/*/locations/*`. + # @param certificate_authority_id [::String] + # Required. It must be unique within a location and match the regular + # expression `[a-zA-Z0-9_-]{1,63}` + # @param certificate_authority [::Google::Cloud::Security::PrivateCA::V1beta1::CertificateAuthority, ::Hash] + # Required. A {::Google::Cloud::Security::PrivateCA::V1beta1::CertificateAuthority CertificateAuthority} with initial field values. + # @param request_id [::String] + # Optional. An ID to identify requests. Specify a unique request ID so that if you must + # retry your request, the server will know to ignore the request if it has + # already been completed. The server will guarantee that for at least 60 + # minutes since the first request. + # + # For example, consider a situation where you make an initial request and t + # he request times out. If you make the request again with the same request + # ID, the server can check if original operation with the same request ID + # was received, and if so, will ignore the second request. This prevents + # clients from accidentally creating duplicate commitments. + # + # The request ID must be a valid UUID with the exception that zero UUID is + # not supported (00000000-0000-0000-0000-000000000000). + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Gapic::Operation] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Gapic::Operation] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/security/private_ca/v1beta1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Security::PrivateCA::V1beta1::CertificateAuthorityService::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Security::PrivateCA::V1beta1::CreateCertificateAuthorityRequest.new + # + # # Call the create_certificate_authority method. + # result = client.create_certificate_authority 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_certificate_authority request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Security::PrivateCA::V1beta1::CreateCertificateAuthorityRequest + + # Converts hash 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_certificate_authority.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::Security::PrivateCA::V1beta1::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_certificate_authority.timeout, + metadata: metadata, + retry_policy: @config.rpcs.create_certificate_authority.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @certificate_authority_service_stub.call_rpc :create_certificate_authority, 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 + + ## + # Disable a {::Google::Cloud::Security::PrivateCA::V1beta1::CertificateAuthority CertificateAuthority}. + # + # @overload disable_certificate_authority(request, options = nil) + # Pass arguments to `disable_certificate_authority` via a request object, either of type + # {::Google::Cloud::Security::PrivateCA::V1beta1::DisableCertificateAuthorityRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Security::PrivateCA::V1beta1::DisableCertificateAuthorityRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. + # + # @overload disable_certificate_authority(name: nil, request_id: nil) + # Pass arguments to `disable_certificate_authority` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param name [::String] + # Required. The resource name for this {::Google::Cloud::Security::PrivateCA::V1beta1::CertificateAuthority CertificateAuthority} in the + # format `projects/*/locations/*/certificateAuthorities/*`. + # @param request_id [::String] + # Optional. An ID to identify requests. Specify a unique request ID so that if you must + # retry your request, the server will know to ignore the request if it has + # already been completed. The server will guarantee that for at least 60 + # minutes since the first request. + # + # For example, consider a situation where you make an initial request and t + # he request times out. If you make the request again with the same request + # ID, the server can check if original operation with the same request ID + # was received, and if so, will ignore the second request. This prevents + # clients from accidentally creating duplicate commitments. + # + # The request ID must be a valid UUID with the exception that zero UUID is + # not supported (00000000-0000-0000-0000-000000000000). + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Gapic::Operation] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Gapic::Operation] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/security/private_ca/v1beta1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Security::PrivateCA::V1beta1::CertificateAuthorityService::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Security::PrivateCA::V1beta1::DisableCertificateAuthorityRequest.new + # + # # Call the disable_certificate_authority method. + # result = client.disable_certificate_authority 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 disable_certificate_authority request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Security::PrivateCA::V1beta1::DisableCertificateAuthorityRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + metadata = @config.rpcs.disable_certificate_authority.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::Security::PrivateCA::V1beta1::VERSION + metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.name + header_params["name"] = request.name + end + + request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") + metadata[:"x-goog-request-params"] ||= request_params_header + + options.apply_defaults timeout: @config.rpcs.disable_certificate_authority.timeout, + metadata: metadata, + retry_policy: @config.rpcs.disable_certificate_authority.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @certificate_authority_service_stub.call_rpc :disable_certificate_authority, 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 + + ## + # Enable a {::Google::Cloud::Security::PrivateCA::V1beta1::CertificateAuthority CertificateAuthority}. + # + # @overload enable_certificate_authority(request, options = nil) + # Pass arguments to `enable_certificate_authority` via a request object, either of type + # {::Google::Cloud::Security::PrivateCA::V1beta1::EnableCertificateAuthorityRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Security::PrivateCA::V1beta1::EnableCertificateAuthorityRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. + # + # @overload enable_certificate_authority(name: nil, request_id: nil) + # Pass arguments to `enable_certificate_authority` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param name [::String] + # Required. The resource name for this {::Google::Cloud::Security::PrivateCA::V1beta1::CertificateAuthority CertificateAuthority} in the + # format `projects/*/locations/*/certificateAuthorities/*`. + # @param request_id [::String] + # Optional. An ID to identify requests. Specify a unique request ID so that if you must + # retry your request, the server will know to ignore the request if it has + # already been completed. The server will guarantee that for at least 60 + # minutes since the first request. + # + # For example, consider a situation where you make an initial request and t + # he request times out. If you make the request again with the same request + # ID, the server can check if original operation with the same request ID + # was received, and if so, will ignore the second request. This prevents + # clients from accidentally creating duplicate commitments. + # + # The request ID must be a valid UUID with the exception that zero UUID is + # not supported (00000000-0000-0000-0000-000000000000). + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Gapic::Operation] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Gapic::Operation] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/security/private_ca/v1beta1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Security::PrivateCA::V1beta1::CertificateAuthorityService::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Security::PrivateCA::V1beta1::EnableCertificateAuthorityRequest.new + # + # # Call the enable_certificate_authority method. + # result = client.enable_certificate_authority 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 enable_certificate_authority request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Security::PrivateCA::V1beta1::EnableCertificateAuthorityRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + metadata = @config.rpcs.enable_certificate_authority.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::Security::PrivateCA::V1beta1::VERSION + metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.name + header_params["name"] = request.name + end + + request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") + metadata[:"x-goog-request-params"] ||= request_params_header + + options.apply_defaults timeout: @config.rpcs.enable_certificate_authority.timeout, + metadata: metadata, + retry_policy: @config.rpcs.enable_certificate_authority.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @certificate_authority_service_stub.call_rpc :enable_certificate_authority, 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 + + ## + # Fetch a certificate signing request (CSR) from a {::Google::Cloud::Security::PrivateCA::V1beta1::CertificateAuthority CertificateAuthority} + # that is in state + # {::Google::Cloud::Security::PrivateCA::V1beta1::CertificateAuthority::State::PENDING_ACTIVATION PENDING_ACTIVATION} and is + # of type {::Google::Cloud::Security::PrivateCA::V1beta1::CertificateAuthority::Type::SUBORDINATE SUBORDINATE}. The CSR must + # then be signed by the desired parent Certificate Authority, which could be + # another {::Google::Cloud::Security::PrivateCA::V1beta1::CertificateAuthority CertificateAuthority} resource, or could be an on-prem + # certificate authority. See also {::Google::Cloud::Security::PrivateCA::V1beta1::CertificateAuthorityService::Client#activate_certificate_authority ActivateCertificateAuthority}. + # + # @overload fetch_certificate_authority_csr(request, options = nil) + # Pass arguments to `fetch_certificate_authority_csr` via a request object, either of type + # {::Google::Cloud::Security::PrivateCA::V1beta1::FetchCertificateAuthorityCsrRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Security::PrivateCA::V1beta1::FetchCertificateAuthorityCsrRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. + # + # @overload fetch_certificate_authority_csr(name: nil) + # Pass arguments to `fetch_certificate_authority_csr` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param name [::String] + # Required. The resource name for this {::Google::Cloud::Security::PrivateCA::V1beta1::CertificateAuthority CertificateAuthority} in the + # format `projects/*/locations/*/certificateAuthorities/*`. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Google::Cloud::Security::PrivateCA::V1beta1::FetchCertificateAuthorityCsrResponse] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Google::Cloud::Security::PrivateCA::V1beta1::FetchCertificateAuthorityCsrResponse] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/security/private_ca/v1beta1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Security::PrivateCA::V1beta1::CertificateAuthorityService::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Security::PrivateCA::V1beta1::FetchCertificateAuthorityCsrRequest.new + # + # # Call the fetch_certificate_authority_csr method. + # result = client.fetch_certificate_authority_csr request + # + # # The returned object is of type Google::Cloud::Security::PrivateCA::V1beta1::FetchCertificateAuthorityCsrResponse. + # p result + # + def fetch_certificate_authority_csr request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Security::PrivateCA::V1beta1::FetchCertificateAuthorityCsrRequest + + # Converts hash 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.fetch_certificate_authority_csr.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::Security::PrivateCA::V1beta1::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.fetch_certificate_authority_csr.timeout, + metadata: metadata, + retry_policy: @config.rpcs.fetch_certificate_authority_csr.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @certificate_authority_service_stub.call_rpc :fetch_certificate_authority_csr, request, options: options do |response, operation| + yield response, operation if block_given? + end + rescue ::GRPC::BadStatus => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Returns a {::Google::Cloud::Security::PrivateCA::V1beta1::CertificateAuthority CertificateAuthority}. + # + # @overload get_certificate_authority(request, options = nil) + # Pass arguments to `get_certificate_authority` via a request object, either of type + # {::Google::Cloud::Security::PrivateCA::V1beta1::GetCertificateAuthorityRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Security::PrivateCA::V1beta1::GetCertificateAuthorityRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_certificate_authority(name: nil) + # Pass arguments to `get_certificate_authority` via keyword arguments. Note that at + # least one keyword argument is 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 {::Google::Cloud::Security::PrivateCA::V1beta1::CertificateAuthority#name name} of the {::Google::Cloud::Security::PrivateCA::V1beta1::CertificateAuthority CertificateAuthority} to + # get. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Google::Cloud::Security::PrivateCA::V1beta1::CertificateAuthority] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Google::Cloud::Security::PrivateCA::V1beta1::CertificateAuthority] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/security/private_ca/v1beta1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Security::PrivateCA::V1beta1::CertificateAuthorityService::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Security::PrivateCA::V1beta1::GetCertificateAuthorityRequest.new + # + # # Call the get_certificate_authority method. + # result = client.get_certificate_authority request + # + # # The returned object is of type Google::Cloud::Security::PrivateCA::V1beta1::CertificateAuthority. + # p result + # + def get_certificate_authority request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Security::PrivateCA::V1beta1::GetCertificateAuthorityRequest + + # Converts hash 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_certificate_authority.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::Security::PrivateCA::V1beta1::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_certificate_authority.timeout, + metadata: metadata, + retry_policy: @config.rpcs.get_certificate_authority.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @certificate_authority_service_stub.call_rpc :get_certificate_authority, request, options: options do |response, operation| + yield response, operation if block_given? + end + rescue ::GRPC::BadStatus => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Lists {::Google::Cloud::Security::PrivateCA::V1beta1::CertificateAuthority CertificateAuthorities}. + # + # @overload list_certificate_authorities(request, options = nil) + # Pass arguments to `list_certificate_authorities` via a request object, either of type + # {::Google::Cloud::Security::PrivateCA::V1beta1::ListCertificateAuthoritiesRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Security::PrivateCA::V1beta1::ListCertificateAuthoritiesRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_certificate_authorities(parent: nil, page_size: nil, page_token: nil, filter: nil, order_by: nil) + # Pass arguments to `list_certificate_authorities` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param parent [::String] + # Required. The resource name of the location associated with the + # {::Google::Cloud::Security::PrivateCA::V1beta1::CertificateAuthority CertificateAuthorities}, in the format + # `projects/*/locations/*`. + # @param page_size [::Integer] + # Optional. Limit on the number of {::Google::Cloud::Security::PrivateCA::V1beta1::CertificateAuthority CertificateAuthorities} to + # include in the response. + # Further {::Google::Cloud::Security::PrivateCA::V1beta1::CertificateAuthority CertificateAuthorities} can subsequently be + # obtained by including the + # {::Google::Cloud::Security::PrivateCA::V1beta1::ListCertificateAuthoritiesResponse#next_page_token ListCertificateAuthoritiesResponse.next_page_token} in a subsequent + # request. If unspecified, the server will pick an appropriate default. + # @param page_token [::String] + # Optional. Pagination token, returned earlier via + # {::Google::Cloud::Security::PrivateCA::V1beta1::ListCertificateAuthoritiesResponse#next_page_token ListCertificateAuthoritiesResponse.next_page_token}. + # @param filter [::String] + # Optional. Only include resources that match the filter in the response. + # @param order_by [::String] + # Optional. Specify how the results should be sorted. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Gapic::PagedEnumerable<::Google::Cloud::Security::PrivateCA::V1beta1::CertificateAuthority>] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Gapic::PagedEnumerable<::Google::Cloud::Security::PrivateCA::V1beta1::CertificateAuthority>] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/security/private_ca/v1beta1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Security::PrivateCA::V1beta1::CertificateAuthorityService::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Security::PrivateCA::V1beta1::ListCertificateAuthoritiesRequest.new + # + # # Call the list_certificate_authorities method. + # result = client.list_certificate_authorities request + # + # # The returned object is of type Gapic::PagedEnumerable. You can iterate + # # over elements, and API calls will be issued to fetch pages as needed. + # result.each do |item| + # # Each element is of type ::Google::Cloud::Security::PrivateCA::V1beta1::CertificateAuthority. + # p item + # end + # + def list_certificate_authorities request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Security::PrivateCA::V1beta1::ListCertificateAuthoritiesRequest + + # Converts hash 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_certificate_authorities.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::Security::PrivateCA::V1beta1::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_certificate_authorities.timeout, + metadata: metadata, + retry_policy: @config.rpcs.list_certificate_authorities.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @certificate_authority_service_stub.call_rpc :list_certificate_authorities, request, options: options do |response, operation| + response = ::Gapic::PagedEnumerable.new @certificate_authority_service_stub, :list_certificate_authorities, 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 + + ## + # Restore a {::Google::Cloud::Security::PrivateCA::V1beta1::CertificateAuthority CertificateAuthority} that is scheduled for deletion. + # + # @overload restore_certificate_authority(request, options = nil) + # Pass arguments to `restore_certificate_authority` via a request object, either of type + # {::Google::Cloud::Security::PrivateCA::V1beta1::RestoreCertificateAuthorityRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Security::PrivateCA::V1beta1::RestoreCertificateAuthorityRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. + # + # @overload restore_certificate_authority(name: nil, request_id: nil) + # Pass arguments to `restore_certificate_authority` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param name [::String] + # Required. The resource name for this {::Google::Cloud::Security::PrivateCA::V1beta1::CertificateAuthority CertificateAuthority} in the + # format `projects/*/locations/*/certificateAuthorities/*`. + # @param request_id [::String] + # Optional. An ID to identify requests. Specify a unique request ID so that if you must + # retry your request, the server will know to ignore the request if it has + # already been completed. The server will guarantee that for at least 60 + # minutes since the first request. + # + # For example, consider a situation where you make an initial request and t + # he request times out. If you make the request again with the same request + # ID, the server can check if original operation with the same request ID + # was received, and if so, will ignore the second request. This prevents + # clients from accidentally creating duplicate commitments. + # + # The request ID must be a valid UUID with the exception that zero UUID is + # not supported (00000000-0000-0000-0000-000000000000). + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Gapic::Operation] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Gapic::Operation] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/security/private_ca/v1beta1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Security::PrivateCA::V1beta1::CertificateAuthorityService::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Security::PrivateCA::V1beta1::RestoreCertificateAuthorityRequest.new + # + # # Call the restore_certificate_authority method. + # result = client.restore_certificate_authority 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 restore_certificate_authority request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Security::PrivateCA::V1beta1::RestoreCertificateAuthorityRequest + + # Converts hash 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.restore_certificate_authority.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::Security::PrivateCA::V1beta1::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.restore_certificate_authority.timeout, + metadata: metadata, + retry_policy: @config.rpcs.restore_certificate_authority.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @certificate_authority_service_stub.call_rpc :restore_certificate_authority, 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 + + ## + # Schedule a {::Google::Cloud::Security::PrivateCA::V1beta1::CertificateAuthority CertificateAuthority} for deletion. + # + # @overload schedule_delete_certificate_authority(request, options = nil) + # Pass arguments to `schedule_delete_certificate_authority` via a request object, either of type + # {::Google::Cloud::Security::PrivateCA::V1beta1::ScheduleDeleteCertificateAuthorityRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Security::PrivateCA::V1beta1::ScheduleDeleteCertificateAuthorityRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. + # + # @overload schedule_delete_certificate_authority(name: nil, request_id: nil) + # Pass arguments to `schedule_delete_certificate_authority` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param name [::String] + # Required. The resource name for this {::Google::Cloud::Security::PrivateCA::V1beta1::CertificateAuthority CertificateAuthority} in the + # format `projects/*/locations/*/certificateAuthorities/*`. + # @param request_id [::String] + # Optional. An ID to identify requests. Specify a unique request ID so that if you must + # retry your request, the server will know to ignore the request if it has + # already been completed. The server will guarantee that for at least 60 + # minutes since the first request. + # + # For example, consider a situation where you make an initial request and t + # he request times out. If you make the request again with the same request + # ID, the server can check if original operation with the same request ID + # was received, and if so, will ignore the second request. This prevents + # clients from accidentally creating duplicate commitments. + # + # The request ID must be a valid UUID with the exception that zero UUID is + # not supported (00000000-0000-0000-0000-000000000000). + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Gapic::Operation] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Gapic::Operation] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/security/private_ca/v1beta1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Security::PrivateCA::V1beta1::CertificateAuthorityService::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Security::PrivateCA::V1beta1::ScheduleDeleteCertificateAuthorityRequest.new + # + # # Call the schedule_delete_certificate_authority method. + # result = client.schedule_delete_certificate_authority 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 schedule_delete_certificate_authority request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Security::PrivateCA::V1beta1::ScheduleDeleteCertificateAuthorityRequest + + # Converts hash 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.schedule_delete_certificate_authority.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::Security::PrivateCA::V1beta1::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.schedule_delete_certificate_authority.timeout, + metadata: metadata, + retry_policy: @config.rpcs.schedule_delete_certificate_authority.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @certificate_authority_service_stub.call_rpc :schedule_delete_certificate_authority, 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 + + ## + # Update a {::Google::Cloud::Security::PrivateCA::V1beta1::CertificateAuthority CertificateAuthority}. + # + # @overload update_certificate_authority(request, options = nil) + # Pass arguments to `update_certificate_authority` via a request object, either of type + # {::Google::Cloud::Security::PrivateCA::V1beta1::UpdateCertificateAuthorityRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Security::PrivateCA::V1beta1::UpdateCertificateAuthorityRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_certificate_authority(certificate_authority: nil, update_mask: nil, request_id: nil) + # Pass arguments to `update_certificate_authority` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param certificate_authority [::Google::Cloud::Security::PrivateCA::V1beta1::CertificateAuthority, ::Hash] + # Required. {::Google::Cloud::Security::PrivateCA::V1beta1::CertificateAuthority CertificateAuthority} with updated values. + # @param update_mask [::Google::Protobuf::FieldMask, ::Hash] + # Required. A list of fields to be updated in this request. + # @param request_id [::String] + # Optional. An ID to identify requests. Specify a unique request ID so that if you must + # retry your request, the server will know to ignore the request if it has + # already been completed. The server will guarantee that for at least 60 + # minutes since the first request. + # + # For example, consider a situation where you make an initial request and t + # he request times out. If you make the request again with the same request + # ID, the server can check if original operation with the same request ID + # was received, and if so, will ignore the second request. This prevents + # clients from accidentally creating duplicate commitments. + # + # The request ID must be a valid UUID with the exception that zero UUID is + # not supported (00000000-0000-0000-0000-000000000000). + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Gapic::Operation] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Gapic::Operation] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/security/private_ca/v1beta1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Security::PrivateCA::V1beta1::CertificateAuthorityService::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Security::PrivateCA::V1beta1::UpdateCertificateAuthorityRequest.new + # + # # Call the update_certificate_authority method. + # result = client.update_certificate_authority 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_certificate_authority request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Security::PrivateCA::V1beta1::UpdateCertificateAuthorityRequest + + # Converts hash 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_certificate_authority.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::Security::PrivateCA::V1beta1::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.certificate_authority&.name + header_params["certificate_authority.name"] = request.certificate_authority.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_certificate_authority.timeout, + metadata: metadata, + retry_policy: @config.rpcs.update_certificate_authority.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @certificate_authority_service_stub.call_rpc :update_certificate_authority, request, options: options do |response, operation| + response = ::Gapic::Operation.new response, @operations_client, options: options + yield response, operation if block_given? + throw :response, response + end + rescue ::GRPC::BadStatus => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Returns a {::Google::Cloud::Security::PrivateCA::V1beta1::CertificateRevocationList CertificateRevocationList}. + # + # @overload get_certificate_revocation_list(request, options = nil) + # Pass arguments to `get_certificate_revocation_list` via a request object, either of type + # {::Google::Cloud::Security::PrivateCA::V1beta1::GetCertificateRevocationListRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Security::PrivateCA::V1beta1::GetCertificateRevocationListRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_certificate_revocation_list(name: nil) + # Pass arguments to `get_certificate_revocation_list` via keyword arguments. Note that at + # least one keyword argument is 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 {::Google::Cloud::Security::PrivateCA::V1beta1::CertificateRevocationList#name name} of the + # {::Google::Cloud::Security::PrivateCA::V1beta1::CertificateRevocationList CertificateRevocationList} to get. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Google::Cloud::Security::PrivateCA::V1beta1::CertificateRevocationList] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Google::Cloud::Security::PrivateCA::V1beta1::CertificateRevocationList] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/security/private_ca/v1beta1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Security::PrivateCA::V1beta1::CertificateAuthorityService::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Security::PrivateCA::V1beta1::GetCertificateRevocationListRequest.new + # + # # Call the get_certificate_revocation_list method. + # result = client.get_certificate_revocation_list request + # + # # The returned object is of type Google::Cloud::Security::PrivateCA::V1beta1::CertificateRevocationList. + # p result + # + def get_certificate_revocation_list request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Security::PrivateCA::V1beta1::GetCertificateRevocationListRequest + + # Converts hash 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_certificate_revocation_list.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::Security::PrivateCA::V1beta1::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_certificate_revocation_list.timeout, + metadata: metadata, + retry_policy: @config.rpcs.get_certificate_revocation_list.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @certificate_authority_service_stub.call_rpc :get_certificate_revocation_list, request, options: options do |response, operation| + yield response, operation if block_given? + end + rescue ::GRPC::BadStatus => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Lists {::Google::Cloud::Security::PrivateCA::V1beta1::CertificateRevocationList CertificateRevocationLists}. + # + # @overload list_certificate_revocation_lists(request, options = nil) + # Pass arguments to `list_certificate_revocation_lists` via a request object, either of type + # {::Google::Cloud::Security::PrivateCA::V1beta1::ListCertificateRevocationListsRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Security::PrivateCA::V1beta1::ListCertificateRevocationListsRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_certificate_revocation_lists(parent: nil, page_size: nil, page_token: nil, filter: nil, order_by: nil) + # Pass arguments to `list_certificate_revocation_lists` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param parent [::String] + # Required. The resource name of the location associated with the + # {::Google::Cloud::Security::PrivateCA::V1beta1::CertificateRevocationList CertificateRevocationLists}, in the format + # `projects/*/locations/*/certificateauthorities/*`. + # @param page_size [::Integer] + # Optional. Limit on the number of + # {::Google::Cloud::Security::PrivateCA::V1beta1::CertificateRevocationList CertificateRevocationLists} to include in the + # response. Further {::Google::Cloud::Security::PrivateCA::V1beta1::CertificateRevocationList CertificateRevocationLists} + # can subsequently be obtained by including the + # {::Google::Cloud::Security::PrivateCA::V1beta1::ListCertificateRevocationListsResponse#next_page_token ListCertificateRevocationListsResponse.next_page_token} in a subsequent + # request. If unspecified, the server will pick an appropriate default. + # @param page_token [::String] + # Optional. Pagination token, returned earlier via + # {::Google::Cloud::Security::PrivateCA::V1beta1::ListCertificateRevocationListsResponse#next_page_token ListCertificateRevocationListsResponse.next_page_token}. + # @param filter [::String] + # Optional. Only include resources that match the filter in the response. + # @param order_by [::String] + # Optional. Specify how the results should be sorted. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Gapic::PagedEnumerable<::Google::Cloud::Security::PrivateCA::V1beta1::CertificateRevocationList>] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Gapic::PagedEnumerable<::Google::Cloud::Security::PrivateCA::V1beta1::CertificateRevocationList>] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/security/private_ca/v1beta1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Security::PrivateCA::V1beta1::CertificateAuthorityService::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Security::PrivateCA::V1beta1::ListCertificateRevocationListsRequest.new + # + # # Call the list_certificate_revocation_lists method. + # result = client.list_certificate_revocation_lists request + # + # # The returned object is of type Gapic::PagedEnumerable. You can iterate + # # over elements, and API calls will be issued to fetch pages as needed. + # result.each do |item| + # # Each element is of type ::Google::Cloud::Security::PrivateCA::V1beta1::CertificateRevocationList. + # p item + # end + # + def list_certificate_revocation_lists request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Security::PrivateCA::V1beta1::ListCertificateRevocationListsRequest + + # Converts hash 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_certificate_revocation_lists.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::Security::PrivateCA::V1beta1::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_certificate_revocation_lists.timeout, + metadata: metadata, + retry_policy: @config.rpcs.list_certificate_revocation_lists.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @certificate_authority_service_stub.call_rpc :list_certificate_revocation_lists, request, options: options do |response, operation| + response = ::Gapic::PagedEnumerable.new @certificate_authority_service_stub, :list_certificate_revocation_lists, 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 + + ## + # Update a {::Google::Cloud::Security::PrivateCA::V1beta1::CertificateRevocationList CertificateRevocationList}. + # + # @overload update_certificate_revocation_list(request, options = nil) + # Pass arguments to `update_certificate_revocation_list` via a request object, either of type + # {::Google::Cloud::Security::PrivateCA::V1beta1::UpdateCertificateRevocationListRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Security::PrivateCA::V1beta1::UpdateCertificateRevocationListRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_certificate_revocation_list(certificate_revocation_list: nil, update_mask: nil, request_id: nil) + # Pass arguments to `update_certificate_revocation_list` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param certificate_revocation_list [::Google::Cloud::Security::PrivateCA::V1beta1::CertificateRevocationList, ::Hash] + # Required. {::Google::Cloud::Security::PrivateCA::V1beta1::CertificateRevocationList CertificateRevocationList} with updated values. + # @param update_mask [::Google::Protobuf::FieldMask, ::Hash] + # Required. A list of fields to be updated in this request. + # @param request_id [::String] + # Optional. An ID to identify requests. Specify a unique request ID so that if you must + # retry your request, the server will know to ignore the request if it has + # already been completed. The server will guarantee that for at least 60 + # minutes since the first request. + # + # For example, consider a situation where you make an initial request and t + # he request times out. If you make the request again with the same request + # ID, the server can check if original operation with the same request ID + # was received, and if so, will ignore the second request. This prevents + # clients from accidentally creating duplicate commitments. + # + # The request ID must be a valid UUID with the exception that zero UUID is + # not supported (00000000-0000-0000-0000-000000000000). + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Gapic::Operation] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Gapic::Operation] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/security/private_ca/v1beta1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Security::PrivateCA::V1beta1::CertificateAuthorityService::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Security::PrivateCA::V1beta1::UpdateCertificateRevocationListRequest.new + # + # # Call the update_certificate_revocation_list method. + # result = client.update_certificate_revocation_list 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_certificate_revocation_list request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Security::PrivateCA::V1beta1::UpdateCertificateRevocationListRequest + + # Converts hash 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_certificate_revocation_list.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::Security::PrivateCA::V1beta1::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.certificate_revocation_list&.name + header_params["certificate_revocation_list.name"] = request.certificate_revocation_list.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_certificate_revocation_list.timeout, + metadata: metadata, + retry_policy: @config.rpcs.update_certificate_revocation_list.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @certificate_authority_service_stub.call_rpc :update_certificate_revocation_list, request, options: options do |response, operation| + response = ::Gapic::Operation.new response, @operations_client, options: options + yield response, operation if block_given? + throw :response, response + end + rescue ::GRPC::BadStatus => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Returns a {::Google::Cloud::Security::PrivateCA::V1beta1::ReusableConfig ReusableConfig}. + # + # @overload get_reusable_config(request, options = nil) + # Pass arguments to `get_reusable_config` via a request object, either of type + # {::Google::Cloud::Security::PrivateCA::V1beta1::GetReusableConfigRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Security::PrivateCA::V1beta1::GetReusableConfigRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_reusable_config(name: nil) + # Pass arguments to `get_reusable_config` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param name [::String] + # Required. The [name][ReusableConfigs.name] of the [ReusableConfigs][] to get. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Google::Cloud::Security::PrivateCA::V1beta1::ReusableConfig] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Google::Cloud::Security::PrivateCA::V1beta1::ReusableConfig] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/security/private_ca/v1beta1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Security::PrivateCA::V1beta1::CertificateAuthorityService::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Security::PrivateCA::V1beta1::GetReusableConfigRequest.new + # + # # Call the get_reusable_config method. + # result = client.get_reusable_config request + # + # # The returned object is of type Google::Cloud::Security::PrivateCA::V1beta1::ReusableConfig. + # p result + # + def get_reusable_config request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Security::PrivateCA::V1beta1::GetReusableConfigRequest + + # Converts hash 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_reusable_config.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::Security::PrivateCA::V1beta1::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_reusable_config.timeout, + metadata: metadata, + retry_policy: @config.rpcs.get_reusable_config.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @certificate_authority_service_stub.call_rpc :get_reusable_config, request, options: options do |response, operation| + yield response, operation if block_given? + end + rescue ::GRPC::BadStatus => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Lists {::Google::Cloud::Security::PrivateCA::V1beta1::ReusableConfig ReusableConfigs}. + # + # @overload list_reusable_configs(request, options = nil) + # Pass arguments to `list_reusable_configs` via a request object, either of type + # {::Google::Cloud::Security::PrivateCA::V1beta1::ListReusableConfigsRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Security::PrivateCA::V1beta1::ListReusableConfigsRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_reusable_configs(parent: nil, page_size: nil, page_token: nil, filter: nil, order_by: nil) + # Pass arguments to `list_reusable_configs` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param parent [::String] + # Required. The resource name of the location associated with the + # {::Google::Cloud::Security::PrivateCA::V1beta1::ReusableConfig ReusableConfigs}, in the format + # `projects/*/locations/*`. + # @param page_size [::Integer] + # Optional. Limit on the number of + # {::Google::Cloud::Security::PrivateCA::V1beta1::ReusableConfig ReusableConfigs} to include in the response. + # Further {::Google::Cloud::Security::PrivateCA::V1beta1::ReusableConfig ReusableConfigs} can subsequently be + # obtained by including the + # {::Google::Cloud::Security::PrivateCA::V1beta1::ListReusableConfigsResponse#next_page_token ListReusableConfigsResponse.next_page_token} in a subsequent request. If + # unspecified, the server will pick an appropriate default. + # @param page_token [::String] + # Optional. Pagination token, returned earlier via + # {::Google::Cloud::Security::PrivateCA::V1beta1::ListReusableConfigsResponse#next_page_token ListReusableConfigsResponse.next_page_token}. + # @param filter [::String] + # Optional. Only include resources that match the filter in the response. + # @param order_by [::String] + # Optional. Specify how the results should be sorted. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Gapic::PagedEnumerable<::Google::Cloud::Security::PrivateCA::V1beta1::ReusableConfig>] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Gapic::PagedEnumerable<::Google::Cloud::Security::PrivateCA::V1beta1::ReusableConfig>] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/security/private_ca/v1beta1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Security::PrivateCA::V1beta1::CertificateAuthorityService::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Security::PrivateCA::V1beta1::ListReusableConfigsRequest.new + # + # # Call the list_reusable_configs method. + # result = client.list_reusable_configs request + # + # # The returned object is of type Gapic::PagedEnumerable. You can iterate + # # over elements, and API calls will be issued to fetch pages as needed. + # result.each do |item| + # # Each element is of type ::Google::Cloud::Security::PrivateCA::V1beta1::ReusableConfig. + # p item + # end + # + def list_reusable_configs request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Security::PrivateCA::V1beta1::ListReusableConfigsRequest + + # Converts hash 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_reusable_configs.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::Security::PrivateCA::V1beta1::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_reusable_configs.timeout, + metadata: metadata, + retry_policy: @config.rpcs.list_reusable_configs.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @certificate_authority_service_stub.call_rpc :list_reusable_configs, request, options: options do |response, operation| + response = ::Gapic::PagedEnumerable.new @certificate_authority_service_stub, :list_reusable_configs, 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 CertificateAuthorityService API. + # + # This class represents the configuration for CertificateAuthorityService, + # providing control over timeouts, retry behavior, logging, transport + # parameters, and other low-level controls. Certain parameters can also be + # applied individually to specific RPCs. See + # {::Google::Cloud::Security::PrivateCA::V1beta1::CertificateAuthorityService::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_certificate to 20 seconds, + # # and all remaining timeouts to 10 seconds. + # ::Google::Cloud::Security::PrivateCA::V1beta1::CertificateAuthorityService::Client.configure do |config| + # config.timeout = 10.0 + # config.rpcs.create_certificate.timeout = 20.0 + # end + # + # # Apply the above configuration only to a new client. + # client = ::Google::Cloud::Security::PrivateCA::V1beta1::CertificateAuthorityService::Client.new do |config| + # config.timeout = 10.0 + # config.rpcs.create_certificate.timeout = 20.0 + # end + # + # @!attribute [rw] endpoint + # A custom service endpoint, as a hostname or hostname:port. The default is + # nil, indicating to use the default endpoint in the current universe domain. + # @return [::String,nil] + # @!attribute [rw] credentials + # Credentials to send with calls. You may provide any of the following types: + # * (`Google::Auth::Credentials`) A googleauth credentials object + # (see the [googleauth docs](https://rubydoc.info/gems/googleauth/Google/Auth/Credentials)) + # * (`Signet::OAuth2::Client`) A signet oauth2 client object + # (see the [signet docs](https://rubydoc.info/gems/signet/Signet/OAuth2/Client)) + # * (`GRPC::Core::Channel`) a gRPC channel with included credentials + # * (`GRPC::Core::ChannelCredentials`) a gRPC credentails object + # * (`nil`) indicating no credentials + # + # @note Warning: Passing a `String` to a keyfile path or a `Hash` of credentials + # is deprecated. Providing an unvalidated credential configuration to + # Google APIs can compromise the security of your systems and data. + # + # @example + # + # # The recommended way to provide credentials is to use the `make_creds` method + # # on the appropriate credentials class for your environment. + # + # require "googleauth" + # + # credentials = ::Google::Auth::ServiceAccountCredentials.make_creds( + # json_key_io: ::File.open("/path/to/keyfile.json") + # ) + # + # client = ::Google::Cloud::Security::PrivateCA::V1beta1::CertificateAuthorityService::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 = "privateca.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 CertificateAuthorityService 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_certificate` + # @return [::Gapic::Config::Method] + # + attr_reader :create_certificate + ## + # RPC-specific configuration for `get_certificate` + # @return [::Gapic::Config::Method] + # + attr_reader :get_certificate + ## + # RPC-specific configuration for `list_certificates` + # @return [::Gapic::Config::Method] + # + attr_reader :list_certificates + ## + # RPC-specific configuration for `revoke_certificate` + # @return [::Gapic::Config::Method] + # + attr_reader :revoke_certificate + ## + # RPC-specific configuration for `update_certificate` + # @return [::Gapic::Config::Method] + # + attr_reader :update_certificate + ## + # RPC-specific configuration for `activate_certificate_authority` + # @return [::Gapic::Config::Method] + # + attr_reader :activate_certificate_authority + ## + # RPC-specific configuration for `create_certificate_authority` + # @return [::Gapic::Config::Method] + # + attr_reader :create_certificate_authority + ## + # RPC-specific configuration for `disable_certificate_authority` + # @return [::Gapic::Config::Method] + # + attr_reader :disable_certificate_authority + ## + # RPC-specific configuration for `enable_certificate_authority` + # @return [::Gapic::Config::Method] + # + attr_reader :enable_certificate_authority + ## + # RPC-specific configuration for `fetch_certificate_authority_csr` + # @return [::Gapic::Config::Method] + # + attr_reader :fetch_certificate_authority_csr + ## + # RPC-specific configuration for `get_certificate_authority` + # @return [::Gapic::Config::Method] + # + attr_reader :get_certificate_authority + ## + # RPC-specific configuration for `list_certificate_authorities` + # @return [::Gapic::Config::Method] + # + attr_reader :list_certificate_authorities + ## + # RPC-specific configuration for `restore_certificate_authority` + # @return [::Gapic::Config::Method] + # + attr_reader :restore_certificate_authority + ## + # RPC-specific configuration for `schedule_delete_certificate_authority` + # @return [::Gapic::Config::Method] + # + attr_reader :schedule_delete_certificate_authority + ## + # RPC-specific configuration for `update_certificate_authority` + # @return [::Gapic::Config::Method] + # + attr_reader :update_certificate_authority + ## + # RPC-specific configuration for `get_certificate_revocation_list` + # @return [::Gapic::Config::Method] + # + attr_reader :get_certificate_revocation_list + ## + # RPC-specific configuration for `list_certificate_revocation_lists` + # @return [::Gapic::Config::Method] + # + attr_reader :list_certificate_revocation_lists + ## + # RPC-specific configuration for `update_certificate_revocation_list` + # @return [::Gapic::Config::Method] + # + attr_reader :update_certificate_revocation_list + ## + # RPC-specific configuration for `get_reusable_config` + # @return [::Gapic::Config::Method] + # + attr_reader :get_reusable_config + ## + # RPC-specific configuration for `list_reusable_configs` + # @return [::Gapic::Config::Method] + # + attr_reader :list_reusable_configs + + # @private + def initialize parent_rpcs = nil + create_certificate_config = parent_rpcs.create_certificate if parent_rpcs.respond_to? :create_certificate + @create_certificate = ::Gapic::Config::Method.new create_certificate_config + get_certificate_config = parent_rpcs.get_certificate if parent_rpcs.respond_to? :get_certificate + @get_certificate = ::Gapic::Config::Method.new get_certificate_config + list_certificates_config = parent_rpcs.list_certificates if parent_rpcs.respond_to? :list_certificates + @list_certificates = ::Gapic::Config::Method.new list_certificates_config + revoke_certificate_config = parent_rpcs.revoke_certificate if parent_rpcs.respond_to? :revoke_certificate + @revoke_certificate = ::Gapic::Config::Method.new revoke_certificate_config + update_certificate_config = parent_rpcs.update_certificate if parent_rpcs.respond_to? :update_certificate + @update_certificate = ::Gapic::Config::Method.new update_certificate_config + activate_certificate_authority_config = parent_rpcs.activate_certificate_authority if parent_rpcs.respond_to? :activate_certificate_authority + @activate_certificate_authority = ::Gapic::Config::Method.new activate_certificate_authority_config + create_certificate_authority_config = parent_rpcs.create_certificate_authority if parent_rpcs.respond_to? :create_certificate_authority + @create_certificate_authority = ::Gapic::Config::Method.new create_certificate_authority_config + disable_certificate_authority_config = parent_rpcs.disable_certificate_authority if parent_rpcs.respond_to? :disable_certificate_authority + @disable_certificate_authority = ::Gapic::Config::Method.new disable_certificate_authority_config + enable_certificate_authority_config = parent_rpcs.enable_certificate_authority if parent_rpcs.respond_to? :enable_certificate_authority + @enable_certificate_authority = ::Gapic::Config::Method.new enable_certificate_authority_config + fetch_certificate_authority_csr_config = parent_rpcs.fetch_certificate_authority_csr if parent_rpcs.respond_to? :fetch_certificate_authority_csr + @fetch_certificate_authority_csr = ::Gapic::Config::Method.new fetch_certificate_authority_csr_config + get_certificate_authority_config = parent_rpcs.get_certificate_authority if parent_rpcs.respond_to? :get_certificate_authority + @get_certificate_authority = ::Gapic::Config::Method.new get_certificate_authority_config + list_certificate_authorities_config = parent_rpcs.list_certificate_authorities if parent_rpcs.respond_to? :list_certificate_authorities + @list_certificate_authorities = ::Gapic::Config::Method.new list_certificate_authorities_config + restore_certificate_authority_config = parent_rpcs.restore_certificate_authority if parent_rpcs.respond_to? :restore_certificate_authority + @restore_certificate_authority = ::Gapic::Config::Method.new restore_certificate_authority_config + schedule_delete_certificate_authority_config = parent_rpcs.schedule_delete_certificate_authority if parent_rpcs.respond_to? :schedule_delete_certificate_authority + @schedule_delete_certificate_authority = ::Gapic::Config::Method.new schedule_delete_certificate_authority_config + update_certificate_authority_config = parent_rpcs.update_certificate_authority if parent_rpcs.respond_to? :update_certificate_authority + @update_certificate_authority = ::Gapic::Config::Method.new update_certificate_authority_config + get_certificate_revocation_list_config = parent_rpcs.get_certificate_revocation_list if parent_rpcs.respond_to? :get_certificate_revocation_list + @get_certificate_revocation_list = ::Gapic::Config::Method.new get_certificate_revocation_list_config + list_certificate_revocation_lists_config = parent_rpcs.list_certificate_revocation_lists if parent_rpcs.respond_to? :list_certificate_revocation_lists + @list_certificate_revocation_lists = ::Gapic::Config::Method.new list_certificate_revocation_lists_config + update_certificate_revocation_list_config = parent_rpcs.update_certificate_revocation_list if parent_rpcs.respond_to? :update_certificate_revocation_list + @update_certificate_revocation_list = ::Gapic::Config::Method.new update_certificate_revocation_list_config + get_reusable_config_config = parent_rpcs.get_reusable_config if parent_rpcs.respond_to? :get_reusable_config + @get_reusable_config = ::Gapic::Config::Method.new get_reusable_config_config + list_reusable_configs_config = parent_rpcs.list_reusable_configs if parent_rpcs.respond_to? :list_reusable_configs + @list_reusable_configs = ::Gapic::Config::Method.new list_reusable_configs_config + + yield self if block_given? + end + end + end + end + end + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-security-private_ca-v1beta1/lib/google/cloud/security/private_ca/v1beta1/certificate_authority_service/credentials.rb b/owl-bot-staging/google-cloud-security-private_ca-v1beta1/lib/google/cloud/security/private_ca/v1beta1/certificate_authority_service/credentials.rb new file mode 100644 index 000000000000..4790c8bbb309 --- /dev/null +++ b/owl-bot-staging/google-cloud-security-private_ca-v1beta1/lib/google/cloud/security/private_ca/v1beta1/certificate_authority_service/credentials.rb @@ -0,0 +1,53 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +require "googleauth" + +module Google + module Cloud + module Security + module PrivateCA + module V1beta1 + module CertificateAuthorityService + # Credentials for the CertificateAuthorityService API. + class Credentials < ::Google::Auth::Credentials + self.scope = [ + "https://www.googleapis.com/auth/cloud-platform" + ] + self.env_vars = [ + "PRIVATE_CA_CREDENTIALS", + "PRIVATE_CA_KEYFILE", + "GOOGLE_CLOUD_CREDENTIALS", + "GOOGLE_CLOUD_KEYFILE", + "GCLOUD_KEYFILE", + "PRIVATE_CA_CREDENTIALS_JSON", + "PRIVATE_CA_KEYFILE_JSON", + "GOOGLE_CLOUD_CREDENTIALS_JSON", + "GOOGLE_CLOUD_KEYFILE_JSON", + "GCLOUD_KEYFILE_JSON" + ] + self.paths = [ + "~/.config/google_cloud/application_default_credentials.json" + ] + end + end + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-security-private_ca-v1beta1/lib/google/cloud/security/private_ca/v1beta1/certificate_authority_service/operations.rb b/owl-bot-staging/google-cloud-security-private_ca-v1beta1/lib/google/cloud/security/private_ca/v1beta1/certificate_authority_service/operations.rb new file mode 100644 index 000000000000..867569d9291a --- /dev/null +++ b/owl-bot-staging/google-cloud-security-private_ca-v1beta1/lib/google/cloud/security/private_ca/v1beta1/certificate_authority_service/operations.rb @@ -0,0 +1,843 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +require "gapic/operation" +require "google/longrunning/operations_pb" + +module Google + module Cloud + module Security + module PrivateCA + module V1beta1 + module CertificateAuthorityService + # Service that implements Longrunning Operations API. + class Operations + # @private + API_VERSION = "" + + # @private + DEFAULT_ENDPOINT_TEMPLATE = "privateca.$UNIVERSE_DOMAIN$" + + # @private + attr_reader :operations_stub + + ## + # Configuration for the CertificateAuthorityService 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 CertificateAuthorityService 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::Security::PrivateCA::V1beta1::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::Security::PrivateCA::V1beta1::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::Security::PrivateCA::V1beta1::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::Security::PrivateCA::V1beta1::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::Security::PrivateCA::V1beta1::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 = "privateca.googleapis.com" + + config_attr :endpoint, nil, ::String, nil + config_attr :credentials, nil do |value| + allowed = [::String, ::Hash, ::Proc, ::Symbol, ::Google::Auth::Credentials, ::Google::Auth::BaseClient, ::Signet::OAuth2::Client, nil] + allowed += [::GRPC::Core::Channel, ::GRPC::Core::ChannelCredentials] if defined? ::GRPC::Core::Channel + allowed.any? { |klass| klass === value } + end + config_attr :scope, nil, ::String, ::Array, nil + config_attr :lib_name, nil, ::String, nil + config_attr :lib_version, nil, ::String, nil + config_attr(:channel_args, { "grpc.service_config_disable_resolution" => 1 }, ::Hash, nil) + config_attr :interceptors, nil, ::Array, nil + config_attr :timeout, nil, ::Numeric, nil + config_attr :metadata, nil, ::Hash, nil + config_attr :retry_policy, nil, ::Hash, ::Proc, nil + config_attr :quota_project, nil, ::String, nil + config_attr :universe_domain, nil, ::String, nil + config_attr :logger, :default, ::Logger, nil, :default + + # @private + def initialize parent_config = nil + @parent_config = parent_config unless parent_config.nil? + + yield self if block_given? + end + + ## + # Configurations for individual RPCs + # @return [Rpcs] + # + def rpcs + @rpcs ||= begin + parent_rpcs = nil + parent_rpcs = @parent_config.rpcs if defined?(@parent_config) && @parent_config.respond_to?(:rpcs) + Rpcs.new parent_rpcs + end + end + + ## + # Configuration for the channel pool + # @return [::Gapic::ServiceStub::ChannelPool::Configuration] + # + def channel_pool + @channel_pool ||= ::Gapic::ServiceStub::ChannelPool::Configuration.new + end + + ## + # Configuration RPC class for the Operations API. + # + # Includes fields providing the configuration for each RPC in this service. + # Each configuration object is of type `Gapic::Config::Method` and includes + # the following configuration fields: + # + # * `timeout` (*type:* `Numeric`) - The call timeout in seconds + # * `metadata` (*type:* `Hash{Symbol=>String}`) - Additional gRPC headers + # * `retry_policy (*type:* `Hash`) - The retry policy. The policy fields + # include the following keys: + # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds. + # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds. + # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier. + # * `:retry_codes` (*type:* `Array`) - The error codes that should + # trigger a retry. + # + class Rpcs + ## + # RPC-specific configuration for `list_operations` + # @return [::Gapic::Config::Method] + # + attr_reader :list_operations + ## + # RPC-specific configuration for `get_operation` + # @return [::Gapic::Config::Method] + # + attr_reader :get_operation + ## + # RPC-specific configuration for `delete_operation` + # @return [::Gapic::Config::Method] + # + attr_reader :delete_operation + ## + # RPC-specific configuration for `cancel_operation` + # @return [::Gapic::Config::Method] + # + attr_reader :cancel_operation + ## + # RPC-specific configuration for `wait_operation` + # @return [::Gapic::Config::Method] + # + attr_reader :wait_operation + + # @private + def initialize parent_rpcs = nil + list_operations_config = parent_rpcs.list_operations if parent_rpcs.respond_to? :list_operations + @list_operations = ::Gapic::Config::Method.new list_operations_config + get_operation_config = parent_rpcs.get_operation if parent_rpcs.respond_to? :get_operation + @get_operation = ::Gapic::Config::Method.new get_operation_config + delete_operation_config = parent_rpcs.delete_operation if parent_rpcs.respond_to? :delete_operation + @delete_operation = ::Gapic::Config::Method.new delete_operation_config + cancel_operation_config = parent_rpcs.cancel_operation if parent_rpcs.respond_to? :cancel_operation + @cancel_operation = ::Gapic::Config::Method.new cancel_operation_config + wait_operation_config = parent_rpcs.wait_operation if parent_rpcs.respond_to? :wait_operation + @wait_operation = ::Gapic::Config::Method.new wait_operation_config + + yield self if block_given? + end + end + end + end + end + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-security-private_ca-v1beta1/lib/google/cloud/security/private_ca/v1beta1/certificate_authority_service/paths.rb b/owl-bot-staging/google-cloud-security-private_ca-v1beta1/lib/google/cloud/security/private_ca/v1beta1/certificate_authority_service/paths.rb new file mode 100644 index 000000000000..ba157f7e9c6d --- /dev/null +++ b/owl-bot-staging/google-cloud-security-private_ca-v1beta1/lib/google/cloud/security/private_ca/v1beta1/certificate_authority_service/paths.rb @@ -0,0 +1,132 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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 Security + module PrivateCA + module V1beta1 + module CertificateAuthorityService + # Path helper methods for the CertificateAuthorityService API. + module Paths + ## + # Create a fully-qualified Certificate resource string. + # + # The resource will be in the following format: + # + # `projects/{project}/locations/{location}/certificateAuthorities/{certificate_authority}/certificates/{certificate}` + # + # @param project [String] + # @param location [String] + # @param certificate_authority [String] + # @param certificate [String] + # + # @return [::String] + def certificate_path project:, location:, certificate_authority:, certificate: + raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" + raise ::ArgumentError, "location cannot contain /" if location.to_s.include? "/" + raise ::ArgumentError, "certificate_authority cannot contain /" if certificate_authority.to_s.include? "/" + + "projects/#{project}/locations/#{location}/certificateAuthorities/#{certificate_authority}/certificates/#{certificate}" + end + + ## + # Create a fully-qualified CertificateAuthority resource string. + # + # The resource will be in the following format: + # + # `projects/{project}/locations/{location}/certificateAuthorities/{certificate_authority}` + # + # @param project [String] + # @param location [String] + # @param certificate_authority [String] + # + # @return [::String] + def certificate_authority_path project:, location:, certificate_authority: + raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" + raise ::ArgumentError, "location cannot contain /" if location.to_s.include? "/" + + "projects/#{project}/locations/#{location}/certificateAuthorities/#{certificate_authority}" + end + + ## + # Create a fully-qualified CertificateRevocationList resource string. + # + # The resource will be in the following format: + # + # `projects/{project}/locations/{location}/certificateAuthorities/{certificate_authority}/certificateRevocationLists/{certificate_revocation_list}` + # + # @param project [String] + # @param location [String] + # @param certificate_authority [String] + # @param certificate_revocation_list [String] + # + # @return [::String] + def certificate_revocation_list_path project:, location:, certificate_authority:, certificate_revocation_list: + raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" + raise ::ArgumentError, "location cannot contain /" if location.to_s.include? "/" + raise ::ArgumentError, "certificate_authority cannot contain /" if certificate_authority.to_s.include? "/" + + "projects/#{project}/locations/#{location}/certificateAuthorities/#{certificate_authority}/certificateRevocationLists/#{certificate_revocation_list}" + 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 ReusableConfig resource string. + # + # The resource will be in the following format: + # + # `projects/{project}/locations/{location}/reusableConfigs/{reusable_config}` + # + # @param project [String] + # @param location [String] + # @param reusable_config [String] + # + # @return [::String] + def reusable_config_path project:, location:, reusable_config: + raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" + raise ::ArgumentError, "location cannot contain /" if location.to_s.include? "/" + + "projects/#{project}/locations/#{location}/reusableConfigs/#{reusable_config}" + end + + extend self + end + end + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-security-private_ca-v1beta1/lib/google/cloud/security/private_ca/v1beta1/certificate_authority_service/rest.rb b/owl-bot-staging/google-cloud-security-private_ca-v1beta1/lib/google/cloud/security/private_ca/v1beta1/certificate_authority_service/rest.rb new file mode 100644 index 000000000000..8e50943b6059 --- /dev/null +++ b/owl-bot-staging/google-cloud-security-private_ca-v1beta1/lib/google/cloud/security/private_ca/v1beta1/certificate_authority_service/rest.rb @@ -0,0 +1,56 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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/security/private_ca/v1beta1/version" + +require "google/cloud/security/private_ca/v1beta1/certificate_authority_service/credentials" +require "google/cloud/security/private_ca/v1beta1/certificate_authority_service/paths" +require "google/cloud/security/private_ca/v1beta1/certificate_authority_service/rest/operations" +require "google/cloud/security/private_ca/v1beta1/certificate_authority_service/rest/client" + +module Google + module Cloud + module Security + module PrivateCA + module V1beta1 + ## + # {::Google::Cloud::Security::PrivateCA::V1beta1::CertificateAuthorityService::Client Certificate Authority Service} manages private + # certificate authorities and issued certificates. + # + # To load this service and instantiate a REST client: + # + # require "google/cloud/security/private_ca/v1beta1/certificate_authority_service/rest" + # client = ::Google::Cloud::Security::PrivateCA::V1beta1::CertificateAuthorityService::Rest::Client.new + # + module CertificateAuthorityService + # Client for the REST transport + module Rest + end + end + end + end + end + end +end + +helper_path = ::File.join __dir__, "rest", "helpers.rb" +require "google/cloud/security/private_ca/v1beta1/certificate_authority_service/rest/helpers" if ::File.file? helper_path diff --git a/owl-bot-staging/google-cloud-security-private_ca-v1beta1/lib/google/cloud/security/private_ca/v1beta1/certificate_authority_service/rest/client.rb b/owl-bot-staging/google-cloud-security-private_ca-v1beta1/lib/google/cloud/security/private_ca/v1beta1/certificate_authority_service/rest/client.rb new file mode 100644 index 000000000000..1f02af1b5446 --- /dev/null +++ b/owl-bot-staging/google-cloud-security-private_ca-v1beta1/lib/google/cloud/security/private_ca/v1beta1/certificate_authority_service/rest/client.rb @@ -0,0 +1,2431 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +require "google/cloud/errors" +require "google/cloud/security/privateca/v1beta1/service_pb" +require "google/cloud/security/private_ca/v1beta1/certificate_authority_service/rest/service_stub" + +module Google + module Cloud + module Security + module PrivateCA + module V1beta1 + module CertificateAuthorityService + module Rest + ## + # REST client for the CertificateAuthorityService service. + # + # {::Google::Cloud::Security::PrivateCA::V1beta1::CertificateAuthorityService::Rest::Client Certificate Authority Service} manages private + # certificate authorities and issued certificates. + # + class Client + # @private + API_VERSION = "" + + # @private + DEFAULT_ENDPOINT_TEMPLATE = "privateca.$UNIVERSE_DOMAIN$" + + include Paths + + # @private + attr_reader :certificate_authority_service_stub + + ## + # Configure the CertificateAuthorityService Client class. + # + # See {::Google::Cloud::Security::PrivateCA::V1beta1::CertificateAuthorityService::Rest::Client::Configuration} + # for a description of the configuration fields. + # + # @example + # + # # Modify the configuration for all CertificateAuthorityService clients + # ::Google::Cloud::Security::PrivateCA::V1beta1::CertificateAuthorityService::Rest::Client.configure do |config| + # config.timeout = 10.0 + # end + # + # @yield [config] Configure the Client client. + # @yieldparam config [Client::Configuration] + # + # @return [Client::Configuration] + # + def self.configure + @configure ||= begin + namespace = ["Google", "Cloud", "Security", "PrivateCA", "V1beta1"] + parent_config = while namespace.any? + parent_name = namespace.join "::" + parent_const = const_get parent_name + break parent_const.configure if parent_const.respond_to? :configure + namespace.pop + end + default_config = Client::Configuration.new parent_config + + default_config.timeout = 60.0 + default_config.retry_policy = { + initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [2, 14, 4] + } + + default_config + end + yield @configure if block_given? + @configure + end + + ## + # Configure the CertificateAuthorityService Client instance. + # + # The configuration is set to the derived mode, meaning that values can be changed, + # but structural changes (adding new fields, etc.) are not allowed. Structural changes + # should be made on {Client.configure}. + # + # See {::Google::Cloud::Security::PrivateCA::V1beta1::CertificateAuthorityService::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 + @certificate_authority_service_stub.universe_domain + end + + ## + # Create a new CertificateAuthorityService REST client object. + # + # @example + # + # # Create a client using the default configuration + # client = ::Google::Cloud::Security::PrivateCA::V1beta1::CertificateAuthorityService::Rest::Client.new + # + # # Create a client using a custom configuration + # client = ::Google::Cloud::Security::PrivateCA::V1beta1::CertificateAuthorityService::Rest::Client.new do |config| + # config.timeout = 10.0 + # end + # + # @yield [config] Configure the CertificateAuthorityService client. + # @yieldparam config [Client::Configuration] + # + def initialize + # Create the configuration object + @config = Configuration.new Client.configure + + # Yield the configuration if needed + yield @config if block_given? + + # Create credentials + credentials = @config.credentials + # Use self-signed JWT if the endpoint is unchanged from default, + # but only if the default endpoint does not have a region prefix. + enable_self_signed_jwt = @config.endpoint.nil? || + (@config.endpoint == Configuration::DEFAULT_ENDPOINT && + !@config.endpoint.split(".").first.include?("-")) + credentials ||= Credentials.default scope: @config.scope, + enable_self_signed_jwt: enable_self_signed_jwt + if credentials.is_a?(::String) || credentials.is_a?(::Hash) + credentials = Credentials.new credentials, scope: @config.scope + end + + @quota_project_id = @config.quota_project + @quota_project_id ||= credentials.quota_project_id if credentials.respond_to? :quota_project_id + + @operations_client = ::Google::Cloud::Security::PrivateCA::V1beta1::CertificateAuthorityService::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 + + @certificate_authority_service_stub = ::Google::Cloud::Security::PrivateCA::V1beta1::CertificateAuthorityService::Rest::ServiceStub.new( + endpoint: @config.endpoint, + endpoint_template: DEFAULT_ENDPOINT_TEMPLATE, + universe_domain: @config.universe_domain, + credentials: credentials, + logger: @config.logger + ) + + @certificate_authority_service_stub.logger(stub: true)&.info do |entry| + entry.set_system_name + entry.set_service + entry.message = "Created client for #{entry.service}" + entry.set_credentials_fields credentials + entry.set "customEndpoint", @config.endpoint if @config.endpoint + entry.set "defaultTimeout", @config.timeout if @config.timeout + entry.set "quotaProject", @quota_project_id if @quota_project_id + end + end + + ## + # Get the associated client for long-running operations. + # + # @return [::Google::Cloud::Security::PrivateCA::V1beta1::CertificateAuthorityService::Rest::Operations] + # + attr_reader :operations_client + + ## + # The logger used for request/response debug logging. + # + # @return [Logger] + # + def logger + @certificate_authority_service_stub.logger + end + + # Service calls + + ## + # Create a new {::Google::Cloud::Security::PrivateCA::V1beta1::Certificate Certificate} in a given Project, Location from a particular + # {::Google::Cloud::Security::PrivateCA::V1beta1::CertificateAuthority CertificateAuthority}. + # + # @overload create_certificate(request, options = nil) + # Pass arguments to `create_certificate` via a request object, either of type + # {::Google::Cloud::Security::PrivateCA::V1beta1::CreateCertificateRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Security::PrivateCA::V1beta1::CreateCertificateRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_certificate(parent: nil, certificate_id: nil, certificate: nil, request_id: nil) + # Pass arguments to `create_certificate` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param parent [::String] + # Required. The resource name of the location and {::Google::Cloud::Security::PrivateCA::V1beta1::CertificateAuthority CertificateAuthority} + # associated with the {::Google::Cloud::Security::PrivateCA::V1beta1::Certificate Certificate}, in the format + # `projects/*/locations/*/certificateAuthorities/*`. + # @param certificate_id [::String] + # Optional. It must be unique within a location and match the regular + # expression `[a-zA-Z0-9_-]{1,63}`. This field is required when using a + # {::Google::Cloud::Security::PrivateCA::V1beta1::CertificateAuthority CertificateAuthority} in the Enterprise {::Google::Cloud::Security::PrivateCA::V1beta1::CertificateAuthority::Tier CertificateAuthority.Tier}, + # but is optional and its value is ignored otherwise. + # @param certificate [::Google::Cloud::Security::PrivateCA::V1beta1::Certificate, ::Hash] + # Required. A {::Google::Cloud::Security::PrivateCA::V1beta1::Certificate Certificate} with initial field values. + # @param request_id [::String] + # Optional. An ID to identify requests. Specify a unique request ID so that if you must + # retry your request, the server will know to ignore the request if it has + # already been completed. The server will guarantee that for at least 60 + # minutes since the first request. + # + # For example, consider a situation where you make an initial request and t + # he request times out. If you make the request again with the same request + # ID, the server can check if original operation with the same request ID + # was received, and if so, will ignore the second request. This prevents + # clients from accidentally creating duplicate commitments. + # + # The request ID must be a valid UUID with the exception that zero UUID is + # not supported (00000000-0000-0000-0000-000000000000). + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Cloud::Security::PrivateCA::V1beta1::Certificate] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::Security::PrivateCA::V1beta1::Certificate] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/security/private_ca/v1beta1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Security::PrivateCA::V1beta1::CertificateAuthorityService::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Security::PrivateCA::V1beta1::CreateCertificateRequest.new + # + # # Call the create_certificate method. + # result = client.create_certificate request + # + # # The returned object is of type Google::Cloud::Security::PrivateCA::V1beta1::Certificate. + # p result + # + def create_certificate request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Security::PrivateCA::V1beta1::CreateCertificateRequest + + # Converts hash 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_certificate.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::Security::PrivateCA::V1beta1::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_certificate.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.create_certificate.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @certificate_authority_service_stub.create_certificate request, options do |result, operation| + yield result, operation if block_given? + end + rescue ::Gapic::Rest::Error => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Returns a {::Google::Cloud::Security::PrivateCA::V1beta1::Certificate Certificate}. + # + # @overload get_certificate(request, options = nil) + # Pass arguments to `get_certificate` via a request object, either of type + # {::Google::Cloud::Security::PrivateCA::V1beta1::GetCertificateRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Security::PrivateCA::V1beta1::GetCertificateRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_certificate(name: nil) + # Pass arguments to `get_certificate` via keyword arguments. Note that at + # least one keyword argument is 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 {::Google::Cloud::Security::PrivateCA::V1beta1::Certificate#name name} of the {::Google::Cloud::Security::PrivateCA::V1beta1::Certificate Certificate} to get. + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Cloud::Security::PrivateCA::V1beta1::Certificate] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::Security::PrivateCA::V1beta1::Certificate] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/security/private_ca/v1beta1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Security::PrivateCA::V1beta1::CertificateAuthorityService::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Security::PrivateCA::V1beta1::GetCertificateRequest.new + # + # # Call the get_certificate method. + # result = client.get_certificate request + # + # # The returned object is of type Google::Cloud::Security::PrivateCA::V1beta1::Certificate. + # p result + # + def get_certificate request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Security::PrivateCA::V1beta1::GetCertificateRequest + + # Converts hash 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_certificate.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::Security::PrivateCA::V1beta1::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_certificate.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.get_certificate.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @certificate_authority_service_stub.get_certificate request, options do |result, operation| + yield result, operation if block_given? + end + rescue ::Gapic::Rest::Error => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Lists {::Google::Cloud::Security::PrivateCA::V1beta1::Certificate Certificates}. + # + # @overload list_certificates(request, options = nil) + # Pass arguments to `list_certificates` via a request object, either of type + # {::Google::Cloud::Security::PrivateCA::V1beta1::ListCertificatesRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Security::PrivateCA::V1beta1::ListCertificatesRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_certificates(parent: nil, page_size: nil, page_token: nil, filter: nil, order_by: nil) + # Pass arguments to `list_certificates` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param parent [::String] + # Required. The resource name of the location associated with the + # {::Google::Cloud::Security::PrivateCA::V1beta1::Certificate Certificates}, in the format + # `projects/*/locations/*/certificateauthorities/*`. + # @param page_size [::Integer] + # Optional. Limit on the number of + # {::Google::Cloud::Security::PrivateCA::V1beta1::Certificate Certificates} to include in the + # response. Further {::Google::Cloud::Security::PrivateCA::V1beta1::Certificate Certificates} can subsequently be obtained + # by including the + # {::Google::Cloud::Security::PrivateCA::V1beta1::ListCertificatesResponse#next_page_token ListCertificatesResponse.next_page_token} in a subsequent + # request. If unspecified, the server will pick an appropriate default. + # @param page_token [::String] + # Optional. Pagination token, returned earlier via + # {::Google::Cloud::Security::PrivateCA::V1beta1::ListCertificatesResponse#next_page_token ListCertificatesResponse.next_page_token}. + # @param filter [::String] + # Optional. Only include resources that match the filter in the response. For details + # on supported filters and syntax, see [Certificates Filtering + # documentation](https://cloud.google.com/certificate-authority-service/docs/sorting-filtering-certificates#filtering_support). + # @param order_by [::String] + # Optional. Specify how the results should be sorted. For details on supported fields + # and syntax, see [Certificates Sorting + # documentation](https://cloud.google.com/certificate-authority-service/docs/sorting-filtering-certificates#sorting_support). + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Gapic::Rest::PagedEnumerable<::Google::Cloud::Security::PrivateCA::V1beta1::Certificate>] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Gapic::Rest::PagedEnumerable<::Google::Cloud::Security::PrivateCA::V1beta1::Certificate>] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/security/private_ca/v1beta1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Security::PrivateCA::V1beta1::CertificateAuthorityService::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Security::PrivateCA::V1beta1::ListCertificatesRequest.new + # + # # Call the list_certificates method. + # result = client.list_certificates request + # + # # The returned object is of type Gapic::PagedEnumerable. You can iterate + # # over elements, and API calls will be issued to fetch pages as needed. + # result.each do |item| + # # Each element is of type ::Google::Cloud::Security::PrivateCA::V1beta1::Certificate. + # p item + # end + # + def list_certificates request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Security::PrivateCA::V1beta1::ListCertificatesRequest + + # Converts hash 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_certificates.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::Security::PrivateCA::V1beta1::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_certificates.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.list_certificates.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @certificate_authority_service_stub.list_certificates request, options do |result, operation| + result = ::Gapic::Rest::PagedEnumerable.new @certificate_authority_service_stub, :list_certificates, "certificates", 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 + + ## + # Revoke a {::Google::Cloud::Security::PrivateCA::V1beta1::Certificate Certificate}. + # + # @overload revoke_certificate(request, options = nil) + # Pass arguments to `revoke_certificate` via a request object, either of type + # {::Google::Cloud::Security::PrivateCA::V1beta1::RevokeCertificateRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Security::PrivateCA::V1beta1::RevokeCertificateRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @overload revoke_certificate(name: nil, reason: nil, request_id: nil) + # Pass arguments to `revoke_certificate` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param name [::String] + # Required. The resource name for this {::Google::Cloud::Security::PrivateCA::V1beta1::Certificate Certificate} in the + # format `projects/*/locations/*/certificateAuthorities/*/certificates/*`. + # @param reason [::Google::Cloud::Security::PrivateCA::V1beta1::RevocationReason] + # Required. The {::Google::Cloud::Security::PrivateCA::V1beta1::RevocationReason RevocationReason} for revoking this certificate. + # @param request_id [::String] + # Optional. An ID to identify requests. Specify a unique request ID so that if you must + # retry your request, the server will know to ignore the request if it has + # already been completed. The server will guarantee that for at least 60 + # minutes since the first request. + # + # For example, consider a situation where you make an initial request and t + # he request times out. If you make the request again with the same request + # ID, the server can check if original operation with the same request ID + # was received, and if so, will ignore the second request. This prevents + # clients from accidentally creating duplicate commitments. + # + # The request ID must be a valid UUID with the exception that zero UUID is + # not supported (00000000-0000-0000-0000-000000000000). + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Cloud::Security::PrivateCA::V1beta1::Certificate] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::Security::PrivateCA::V1beta1::Certificate] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/security/private_ca/v1beta1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Security::PrivateCA::V1beta1::CertificateAuthorityService::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Security::PrivateCA::V1beta1::RevokeCertificateRequest.new + # + # # Call the revoke_certificate method. + # result = client.revoke_certificate request + # + # # The returned object is of type Google::Cloud::Security::PrivateCA::V1beta1::Certificate. + # p result + # + def revoke_certificate request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Security::PrivateCA::V1beta1::RevokeCertificateRequest + + # Converts hash 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.revoke_certificate.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::Security::PrivateCA::V1beta1::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.revoke_certificate.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.revoke_certificate.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @certificate_authority_service_stub.revoke_certificate 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 + + ## + # Update a {::Google::Cloud::Security::PrivateCA::V1beta1::Certificate Certificate}. Currently, the only field you can update is the + # {::Google::Cloud::Security::PrivateCA::V1beta1::Certificate#labels labels} field. + # + # @overload update_certificate(request, options = nil) + # Pass arguments to `update_certificate` via a request object, either of type + # {::Google::Cloud::Security::PrivateCA::V1beta1::UpdateCertificateRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Security::PrivateCA::V1beta1::UpdateCertificateRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_certificate(certificate: nil, update_mask: nil, request_id: nil) + # Pass arguments to `update_certificate` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param certificate [::Google::Cloud::Security::PrivateCA::V1beta1::Certificate, ::Hash] + # Required. {::Google::Cloud::Security::PrivateCA::V1beta1::Certificate Certificate} with updated values. + # @param update_mask [::Google::Protobuf::FieldMask, ::Hash] + # Required. A list of fields to be updated in this request. + # @param request_id [::String] + # Optional. An ID to identify requests. Specify a unique request ID so that if you must + # retry your request, the server will know to ignore the request if it has + # already been completed. The server will guarantee that for at least 60 + # minutes since the first request. + # + # For example, consider a situation where you make an initial request and t + # he request times out. If you make the request again with the same request + # ID, the server can check if original operation with the same request ID + # was received, and if so, will ignore the second request. This prevents + # clients from accidentally creating duplicate commitments. + # + # The request ID must be a valid UUID with the exception that zero UUID is + # not supported (00000000-0000-0000-0000-000000000000). + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Cloud::Security::PrivateCA::V1beta1::Certificate] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::Security::PrivateCA::V1beta1::Certificate] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/security/private_ca/v1beta1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Security::PrivateCA::V1beta1::CertificateAuthorityService::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Security::PrivateCA::V1beta1::UpdateCertificateRequest.new + # + # # Call the update_certificate method. + # result = client.update_certificate request + # + # # The returned object is of type Google::Cloud::Security::PrivateCA::V1beta1::Certificate. + # p result + # + def update_certificate request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Security::PrivateCA::V1beta1::UpdateCertificateRequest + + # Converts hash 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_certificate.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::Security::PrivateCA::V1beta1::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_certificate.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.update_certificate.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @certificate_authority_service_stub.update_certificate 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 + + ## + # Activate a {::Google::Cloud::Security::PrivateCA::V1beta1::CertificateAuthority CertificateAuthority} that is in state + # {::Google::Cloud::Security::PrivateCA::V1beta1::CertificateAuthority::State::PENDING_ACTIVATION PENDING_ACTIVATION} and is + # of type {::Google::Cloud::Security::PrivateCA::V1beta1::CertificateAuthority::Type::SUBORDINATE SUBORDINATE}. After the + # parent Certificate Authority signs a certificate signing request from + # {::Google::Cloud::Security::PrivateCA::V1beta1::CertificateAuthorityService::Rest::Client#fetch_certificate_authority_csr FetchCertificateAuthorityCsr}, this method can complete the activation + # process. + # + # @overload activate_certificate_authority(request, options = nil) + # Pass arguments to `activate_certificate_authority` via a request object, either of type + # {::Google::Cloud::Security::PrivateCA::V1beta1::ActivateCertificateAuthorityRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Security::PrivateCA::V1beta1::ActivateCertificateAuthorityRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @overload activate_certificate_authority(name: nil, pem_ca_certificate: nil, subordinate_config: nil, request_id: nil) + # Pass arguments to `activate_certificate_authority` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param name [::String] + # Required. The resource name for this {::Google::Cloud::Security::PrivateCA::V1beta1::CertificateAuthority CertificateAuthority} in the + # format `projects/*/locations/*/certificateAuthorities/*`. + # @param pem_ca_certificate [::String] + # Required. The signed CA certificate issued from + # {::Google::Cloud::Security::PrivateCA::V1beta1::FetchCertificateAuthorityCsrResponse#pem_csr FetchCertificateAuthorityCsrResponse.pem_csr}. + # @param subordinate_config [::Google::Cloud::Security::PrivateCA::V1beta1::SubordinateConfig, ::Hash] + # Required. Must include information about the issuer of 'pem_ca_certificate', and any + # further issuers until the self-signed CA. + # @param request_id [::String] + # Optional. An ID to identify requests. Specify a unique request ID so that if you must + # retry your request, the server will know to ignore the request if it has + # already been completed. The server will guarantee that for at least 60 + # minutes since the first request. + # + # For example, consider a situation where you make an initial request and t + # he request times out. If you make the request again with the same request + # ID, the server can check if original operation with the same request ID + # was received, and if so, will ignore the second request. This prevents + # clients from accidentally creating duplicate commitments. + # + # The request ID must be a valid UUID with the exception that zero UUID is + # not supported (00000000-0000-0000-0000-000000000000). + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Gapic::Operation] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Gapic::Operation] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/security/private_ca/v1beta1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Security::PrivateCA::V1beta1::CertificateAuthorityService::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Security::PrivateCA::V1beta1::ActivateCertificateAuthorityRequest.new + # + # # Call the activate_certificate_authority method. + # result = client.activate_certificate_authority 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 activate_certificate_authority request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Security::PrivateCA::V1beta1::ActivateCertificateAuthorityRequest + + # Converts hash 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.activate_certificate_authority.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::Security::PrivateCA::V1beta1::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.activate_certificate_authority.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.activate_certificate_authority.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @certificate_authority_service_stub.activate_certificate_authority 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 + + ## + # Create a new {::Google::Cloud::Security::PrivateCA::V1beta1::CertificateAuthority CertificateAuthority} in a given Project and Location. + # + # @overload create_certificate_authority(request, options = nil) + # Pass arguments to `create_certificate_authority` via a request object, either of type + # {::Google::Cloud::Security::PrivateCA::V1beta1::CreateCertificateAuthorityRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Security::PrivateCA::V1beta1::CreateCertificateAuthorityRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_certificate_authority(parent: nil, certificate_authority_id: nil, certificate_authority: nil, request_id: nil) + # Pass arguments to `create_certificate_authority` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param parent [::String] + # Required. The resource name of the location associated with the + # {::Google::Cloud::Security::PrivateCA::V1beta1::CertificateAuthority CertificateAuthorities}, in the format + # `projects/*/locations/*`. + # @param certificate_authority_id [::String] + # Required. It must be unique within a location and match the regular + # expression `[a-zA-Z0-9_-]{1,63}` + # @param certificate_authority [::Google::Cloud::Security::PrivateCA::V1beta1::CertificateAuthority, ::Hash] + # Required. A {::Google::Cloud::Security::PrivateCA::V1beta1::CertificateAuthority CertificateAuthority} with initial field values. + # @param request_id [::String] + # Optional. An ID to identify requests. Specify a unique request ID so that if you must + # retry your request, the server will know to ignore the request if it has + # already been completed. The server will guarantee that for at least 60 + # minutes since the first request. + # + # For example, consider a situation where you make an initial request and t + # he request times out. If you make the request again with the same request + # ID, the server can check if original operation with the same request ID + # was received, and if so, will ignore the second request. This prevents + # clients from accidentally creating duplicate commitments. + # + # The request ID must be a valid UUID with the exception that zero UUID is + # not supported (00000000-0000-0000-0000-000000000000). + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Gapic::Operation] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Gapic::Operation] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/security/private_ca/v1beta1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Security::PrivateCA::V1beta1::CertificateAuthorityService::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Security::PrivateCA::V1beta1::CreateCertificateAuthorityRequest.new + # + # # Call the create_certificate_authority method. + # result = client.create_certificate_authority 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_certificate_authority request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Security::PrivateCA::V1beta1::CreateCertificateAuthorityRequest + + # Converts hash 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_certificate_authority.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::Security::PrivateCA::V1beta1::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_certificate_authority.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.create_certificate_authority.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @certificate_authority_service_stub.create_certificate_authority 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 + + ## + # Disable a {::Google::Cloud::Security::PrivateCA::V1beta1::CertificateAuthority CertificateAuthority}. + # + # @overload disable_certificate_authority(request, options = nil) + # Pass arguments to `disable_certificate_authority` via a request object, either of type + # {::Google::Cloud::Security::PrivateCA::V1beta1::DisableCertificateAuthorityRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Security::PrivateCA::V1beta1::DisableCertificateAuthorityRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @overload disable_certificate_authority(name: nil, request_id: nil) + # Pass arguments to `disable_certificate_authority` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param name [::String] + # Required. The resource name for this {::Google::Cloud::Security::PrivateCA::V1beta1::CertificateAuthority CertificateAuthority} in the + # format `projects/*/locations/*/certificateAuthorities/*`. + # @param request_id [::String] + # Optional. An ID to identify requests. Specify a unique request ID so that if you must + # retry your request, the server will know to ignore the request if it has + # already been completed. The server will guarantee that for at least 60 + # minutes since the first request. + # + # For example, consider a situation where you make an initial request and t + # he request times out. If you make the request again with the same request + # ID, the server can check if original operation with the same request ID + # was received, and if so, will ignore the second request. This prevents + # clients from accidentally creating duplicate commitments. + # + # The request ID must be a valid UUID with the exception that zero UUID is + # not supported (00000000-0000-0000-0000-000000000000). + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Gapic::Operation] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Gapic::Operation] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/security/private_ca/v1beta1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Security::PrivateCA::V1beta1::CertificateAuthorityService::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Security::PrivateCA::V1beta1::DisableCertificateAuthorityRequest.new + # + # # Call the disable_certificate_authority method. + # result = client.disable_certificate_authority 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 disable_certificate_authority request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Security::PrivateCA::V1beta1::DisableCertificateAuthorityRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + call_metadata = @config.rpcs.disable_certificate_authority.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::Security::PrivateCA::V1beta1::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + options.apply_defaults timeout: @config.rpcs.disable_certificate_authority.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.disable_certificate_authority.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @certificate_authority_service_stub.disable_certificate_authority 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 + + ## + # Enable a {::Google::Cloud::Security::PrivateCA::V1beta1::CertificateAuthority CertificateAuthority}. + # + # @overload enable_certificate_authority(request, options = nil) + # Pass arguments to `enable_certificate_authority` via a request object, either of type + # {::Google::Cloud::Security::PrivateCA::V1beta1::EnableCertificateAuthorityRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Security::PrivateCA::V1beta1::EnableCertificateAuthorityRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @overload enable_certificate_authority(name: nil, request_id: nil) + # Pass arguments to `enable_certificate_authority` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param name [::String] + # Required. The resource name for this {::Google::Cloud::Security::PrivateCA::V1beta1::CertificateAuthority CertificateAuthority} in the + # format `projects/*/locations/*/certificateAuthorities/*`. + # @param request_id [::String] + # Optional. An ID to identify requests. Specify a unique request ID so that if you must + # retry your request, the server will know to ignore the request if it has + # already been completed. The server will guarantee that for at least 60 + # minutes since the first request. + # + # For example, consider a situation where you make an initial request and t + # he request times out. If you make the request again with the same request + # ID, the server can check if original operation with the same request ID + # was received, and if so, will ignore the second request. This prevents + # clients from accidentally creating duplicate commitments. + # + # The request ID must be a valid UUID with the exception that zero UUID is + # not supported (00000000-0000-0000-0000-000000000000). + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Gapic::Operation] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Gapic::Operation] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/security/private_ca/v1beta1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Security::PrivateCA::V1beta1::CertificateAuthorityService::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Security::PrivateCA::V1beta1::EnableCertificateAuthorityRequest.new + # + # # Call the enable_certificate_authority method. + # result = client.enable_certificate_authority 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 enable_certificate_authority request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Security::PrivateCA::V1beta1::EnableCertificateAuthorityRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + call_metadata = @config.rpcs.enable_certificate_authority.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::Security::PrivateCA::V1beta1::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + options.apply_defaults timeout: @config.rpcs.enable_certificate_authority.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.enable_certificate_authority.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @certificate_authority_service_stub.enable_certificate_authority 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 + + ## + # Fetch a certificate signing request (CSR) from a {::Google::Cloud::Security::PrivateCA::V1beta1::CertificateAuthority CertificateAuthority} + # that is in state + # {::Google::Cloud::Security::PrivateCA::V1beta1::CertificateAuthority::State::PENDING_ACTIVATION PENDING_ACTIVATION} and is + # of type {::Google::Cloud::Security::PrivateCA::V1beta1::CertificateAuthority::Type::SUBORDINATE SUBORDINATE}. The CSR must + # then be signed by the desired parent Certificate Authority, which could be + # another {::Google::Cloud::Security::PrivateCA::V1beta1::CertificateAuthority CertificateAuthority} resource, or could be an on-prem + # certificate authority. See also {::Google::Cloud::Security::PrivateCA::V1beta1::CertificateAuthorityService::Rest::Client#activate_certificate_authority ActivateCertificateAuthority}. + # + # @overload fetch_certificate_authority_csr(request, options = nil) + # Pass arguments to `fetch_certificate_authority_csr` via a request object, either of type + # {::Google::Cloud::Security::PrivateCA::V1beta1::FetchCertificateAuthorityCsrRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Security::PrivateCA::V1beta1::FetchCertificateAuthorityCsrRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @overload fetch_certificate_authority_csr(name: nil) + # Pass arguments to `fetch_certificate_authority_csr` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param name [::String] + # Required. The resource name for this {::Google::Cloud::Security::PrivateCA::V1beta1::CertificateAuthority CertificateAuthority} in the + # format `projects/*/locations/*/certificateAuthorities/*`. + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Cloud::Security::PrivateCA::V1beta1::FetchCertificateAuthorityCsrResponse] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::Security::PrivateCA::V1beta1::FetchCertificateAuthorityCsrResponse] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/security/private_ca/v1beta1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Security::PrivateCA::V1beta1::CertificateAuthorityService::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Security::PrivateCA::V1beta1::FetchCertificateAuthorityCsrRequest.new + # + # # Call the fetch_certificate_authority_csr method. + # result = client.fetch_certificate_authority_csr request + # + # # The returned object is of type Google::Cloud::Security::PrivateCA::V1beta1::FetchCertificateAuthorityCsrResponse. + # p result + # + def fetch_certificate_authority_csr request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Security::PrivateCA::V1beta1::FetchCertificateAuthorityCsrRequest + + # Converts hash 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.fetch_certificate_authority_csr.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::Security::PrivateCA::V1beta1::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.fetch_certificate_authority_csr.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.fetch_certificate_authority_csr.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @certificate_authority_service_stub.fetch_certificate_authority_csr request, options do |result, operation| + yield result, operation if block_given? + end + rescue ::Gapic::Rest::Error => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Returns a {::Google::Cloud::Security::PrivateCA::V1beta1::CertificateAuthority CertificateAuthority}. + # + # @overload get_certificate_authority(request, options = nil) + # Pass arguments to `get_certificate_authority` via a request object, either of type + # {::Google::Cloud::Security::PrivateCA::V1beta1::GetCertificateAuthorityRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Security::PrivateCA::V1beta1::GetCertificateAuthorityRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_certificate_authority(name: nil) + # Pass arguments to `get_certificate_authority` via keyword arguments. Note that at + # least one keyword argument is 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 {::Google::Cloud::Security::PrivateCA::V1beta1::CertificateAuthority#name name} of the {::Google::Cloud::Security::PrivateCA::V1beta1::CertificateAuthority CertificateAuthority} to + # get. + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Cloud::Security::PrivateCA::V1beta1::CertificateAuthority] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::Security::PrivateCA::V1beta1::CertificateAuthority] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/security/private_ca/v1beta1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Security::PrivateCA::V1beta1::CertificateAuthorityService::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Security::PrivateCA::V1beta1::GetCertificateAuthorityRequest.new + # + # # Call the get_certificate_authority method. + # result = client.get_certificate_authority request + # + # # The returned object is of type Google::Cloud::Security::PrivateCA::V1beta1::CertificateAuthority. + # p result + # + def get_certificate_authority request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Security::PrivateCA::V1beta1::GetCertificateAuthorityRequest + + # Converts hash 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_certificate_authority.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::Security::PrivateCA::V1beta1::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_certificate_authority.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.get_certificate_authority.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @certificate_authority_service_stub.get_certificate_authority request, options do |result, operation| + yield result, operation if block_given? + end + rescue ::Gapic::Rest::Error => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Lists {::Google::Cloud::Security::PrivateCA::V1beta1::CertificateAuthority CertificateAuthorities}. + # + # @overload list_certificate_authorities(request, options = nil) + # Pass arguments to `list_certificate_authorities` via a request object, either of type + # {::Google::Cloud::Security::PrivateCA::V1beta1::ListCertificateAuthoritiesRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Security::PrivateCA::V1beta1::ListCertificateAuthoritiesRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_certificate_authorities(parent: nil, page_size: nil, page_token: nil, filter: nil, order_by: nil) + # Pass arguments to `list_certificate_authorities` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param parent [::String] + # Required. The resource name of the location associated with the + # {::Google::Cloud::Security::PrivateCA::V1beta1::CertificateAuthority CertificateAuthorities}, in the format + # `projects/*/locations/*`. + # @param page_size [::Integer] + # Optional. Limit on the number of {::Google::Cloud::Security::PrivateCA::V1beta1::CertificateAuthority CertificateAuthorities} to + # include in the response. + # Further {::Google::Cloud::Security::PrivateCA::V1beta1::CertificateAuthority CertificateAuthorities} can subsequently be + # obtained by including the + # {::Google::Cloud::Security::PrivateCA::V1beta1::ListCertificateAuthoritiesResponse#next_page_token ListCertificateAuthoritiesResponse.next_page_token} in a subsequent + # request. If unspecified, the server will pick an appropriate default. + # @param page_token [::String] + # Optional. Pagination token, returned earlier via + # {::Google::Cloud::Security::PrivateCA::V1beta1::ListCertificateAuthoritiesResponse#next_page_token ListCertificateAuthoritiesResponse.next_page_token}. + # @param filter [::String] + # Optional. Only include resources that match the filter in the response. + # @param order_by [::String] + # Optional. Specify how the results should be sorted. + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Gapic::Rest::PagedEnumerable<::Google::Cloud::Security::PrivateCA::V1beta1::CertificateAuthority>] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Gapic::Rest::PagedEnumerable<::Google::Cloud::Security::PrivateCA::V1beta1::CertificateAuthority>] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/security/private_ca/v1beta1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Security::PrivateCA::V1beta1::CertificateAuthorityService::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Security::PrivateCA::V1beta1::ListCertificateAuthoritiesRequest.new + # + # # Call the list_certificate_authorities method. + # result = client.list_certificate_authorities request + # + # # The returned object is of type Gapic::PagedEnumerable. You can iterate + # # over elements, and API calls will be issued to fetch pages as needed. + # result.each do |item| + # # Each element is of type ::Google::Cloud::Security::PrivateCA::V1beta1::CertificateAuthority. + # p item + # end + # + def list_certificate_authorities request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Security::PrivateCA::V1beta1::ListCertificateAuthoritiesRequest + + # Converts hash 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_certificate_authorities.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::Security::PrivateCA::V1beta1::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_certificate_authorities.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.list_certificate_authorities.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @certificate_authority_service_stub.list_certificate_authorities request, options do |result, operation| + result = ::Gapic::Rest::PagedEnumerable.new @certificate_authority_service_stub, :list_certificate_authorities, "certificate_authorities", 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 + + ## + # Restore a {::Google::Cloud::Security::PrivateCA::V1beta1::CertificateAuthority CertificateAuthority} that is scheduled for deletion. + # + # @overload restore_certificate_authority(request, options = nil) + # Pass arguments to `restore_certificate_authority` via a request object, either of type + # {::Google::Cloud::Security::PrivateCA::V1beta1::RestoreCertificateAuthorityRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Security::PrivateCA::V1beta1::RestoreCertificateAuthorityRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @overload restore_certificate_authority(name: nil, request_id: nil) + # Pass arguments to `restore_certificate_authority` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param name [::String] + # Required. The resource name for this {::Google::Cloud::Security::PrivateCA::V1beta1::CertificateAuthority CertificateAuthority} in the + # format `projects/*/locations/*/certificateAuthorities/*`. + # @param request_id [::String] + # Optional. An ID to identify requests. Specify a unique request ID so that if you must + # retry your request, the server will know to ignore the request if it has + # already been completed. The server will guarantee that for at least 60 + # minutes since the first request. + # + # For example, consider a situation where you make an initial request and t + # he request times out. If you make the request again with the same request + # ID, the server can check if original operation with the same request ID + # was received, and if so, will ignore the second request. This prevents + # clients from accidentally creating duplicate commitments. + # + # The request ID must be a valid UUID with the exception that zero UUID is + # not supported (00000000-0000-0000-0000-000000000000). + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Gapic::Operation] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Gapic::Operation] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/security/private_ca/v1beta1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Security::PrivateCA::V1beta1::CertificateAuthorityService::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Security::PrivateCA::V1beta1::RestoreCertificateAuthorityRequest.new + # + # # Call the restore_certificate_authority method. + # result = client.restore_certificate_authority 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 restore_certificate_authority request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Security::PrivateCA::V1beta1::RestoreCertificateAuthorityRequest + + # Converts hash 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.restore_certificate_authority.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::Security::PrivateCA::V1beta1::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.restore_certificate_authority.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.restore_certificate_authority.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @certificate_authority_service_stub.restore_certificate_authority 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 + + ## + # Schedule a {::Google::Cloud::Security::PrivateCA::V1beta1::CertificateAuthority CertificateAuthority} for deletion. + # + # @overload schedule_delete_certificate_authority(request, options = nil) + # Pass arguments to `schedule_delete_certificate_authority` via a request object, either of type + # {::Google::Cloud::Security::PrivateCA::V1beta1::ScheduleDeleteCertificateAuthorityRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Security::PrivateCA::V1beta1::ScheduleDeleteCertificateAuthorityRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @overload schedule_delete_certificate_authority(name: nil, request_id: nil) + # Pass arguments to `schedule_delete_certificate_authority` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param name [::String] + # Required. The resource name for this {::Google::Cloud::Security::PrivateCA::V1beta1::CertificateAuthority CertificateAuthority} in the + # format `projects/*/locations/*/certificateAuthorities/*`. + # @param request_id [::String] + # Optional. An ID to identify requests. Specify a unique request ID so that if you must + # retry your request, the server will know to ignore the request if it has + # already been completed. The server will guarantee that for at least 60 + # minutes since the first request. + # + # For example, consider a situation where you make an initial request and t + # he request times out. If you make the request again with the same request + # ID, the server can check if original operation with the same request ID + # was received, and if so, will ignore the second request. This prevents + # clients from accidentally creating duplicate commitments. + # + # The request ID must be a valid UUID with the exception that zero UUID is + # not supported (00000000-0000-0000-0000-000000000000). + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Gapic::Operation] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Gapic::Operation] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/security/private_ca/v1beta1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Security::PrivateCA::V1beta1::CertificateAuthorityService::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Security::PrivateCA::V1beta1::ScheduleDeleteCertificateAuthorityRequest.new + # + # # Call the schedule_delete_certificate_authority method. + # result = client.schedule_delete_certificate_authority 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 schedule_delete_certificate_authority request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Security::PrivateCA::V1beta1::ScheduleDeleteCertificateAuthorityRequest + + # Converts hash 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.schedule_delete_certificate_authority.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::Security::PrivateCA::V1beta1::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.schedule_delete_certificate_authority.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.schedule_delete_certificate_authority.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @certificate_authority_service_stub.schedule_delete_certificate_authority 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 + + ## + # Update a {::Google::Cloud::Security::PrivateCA::V1beta1::CertificateAuthority CertificateAuthority}. + # + # @overload update_certificate_authority(request, options = nil) + # Pass arguments to `update_certificate_authority` via a request object, either of type + # {::Google::Cloud::Security::PrivateCA::V1beta1::UpdateCertificateAuthorityRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Security::PrivateCA::V1beta1::UpdateCertificateAuthorityRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_certificate_authority(certificate_authority: nil, update_mask: nil, request_id: nil) + # Pass arguments to `update_certificate_authority` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param certificate_authority [::Google::Cloud::Security::PrivateCA::V1beta1::CertificateAuthority, ::Hash] + # Required. {::Google::Cloud::Security::PrivateCA::V1beta1::CertificateAuthority CertificateAuthority} with updated values. + # @param update_mask [::Google::Protobuf::FieldMask, ::Hash] + # Required. A list of fields to be updated in this request. + # @param request_id [::String] + # Optional. An ID to identify requests. Specify a unique request ID so that if you must + # retry your request, the server will know to ignore the request if it has + # already been completed. The server will guarantee that for at least 60 + # minutes since the first request. + # + # For example, consider a situation where you make an initial request and t + # he request times out. If you make the request again with the same request + # ID, the server can check if original operation with the same request ID + # was received, and if so, will ignore the second request. This prevents + # clients from accidentally creating duplicate commitments. + # + # The request ID must be a valid UUID with the exception that zero UUID is + # not supported (00000000-0000-0000-0000-000000000000). + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Gapic::Operation] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Gapic::Operation] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/security/private_ca/v1beta1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Security::PrivateCA::V1beta1::CertificateAuthorityService::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Security::PrivateCA::V1beta1::UpdateCertificateAuthorityRequest.new + # + # # Call the update_certificate_authority method. + # result = client.update_certificate_authority 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_certificate_authority request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Security::PrivateCA::V1beta1::UpdateCertificateAuthorityRequest + + # Converts hash 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_certificate_authority.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::Security::PrivateCA::V1beta1::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_certificate_authority.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.update_certificate_authority.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @certificate_authority_service_stub.update_certificate_authority 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 + + ## + # Returns a {::Google::Cloud::Security::PrivateCA::V1beta1::CertificateRevocationList CertificateRevocationList}. + # + # @overload get_certificate_revocation_list(request, options = nil) + # Pass arguments to `get_certificate_revocation_list` via a request object, either of type + # {::Google::Cloud::Security::PrivateCA::V1beta1::GetCertificateRevocationListRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Security::PrivateCA::V1beta1::GetCertificateRevocationListRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_certificate_revocation_list(name: nil) + # Pass arguments to `get_certificate_revocation_list` via keyword arguments. Note that at + # least one keyword argument is 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 {::Google::Cloud::Security::PrivateCA::V1beta1::CertificateRevocationList#name name} of the + # {::Google::Cloud::Security::PrivateCA::V1beta1::CertificateRevocationList CertificateRevocationList} to get. + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Cloud::Security::PrivateCA::V1beta1::CertificateRevocationList] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::Security::PrivateCA::V1beta1::CertificateRevocationList] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/security/private_ca/v1beta1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Security::PrivateCA::V1beta1::CertificateAuthorityService::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Security::PrivateCA::V1beta1::GetCertificateRevocationListRequest.new + # + # # Call the get_certificate_revocation_list method. + # result = client.get_certificate_revocation_list request + # + # # The returned object is of type Google::Cloud::Security::PrivateCA::V1beta1::CertificateRevocationList. + # p result + # + def get_certificate_revocation_list request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Security::PrivateCA::V1beta1::GetCertificateRevocationListRequest + + # Converts hash 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_certificate_revocation_list.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::Security::PrivateCA::V1beta1::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_certificate_revocation_list.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.get_certificate_revocation_list.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @certificate_authority_service_stub.get_certificate_revocation_list request, options do |result, operation| + yield result, operation if block_given? + end + rescue ::Gapic::Rest::Error => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Lists {::Google::Cloud::Security::PrivateCA::V1beta1::CertificateRevocationList CertificateRevocationLists}. + # + # @overload list_certificate_revocation_lists(request, options = nil) + # Pass arguments to `list_certificate_revocation_lists` via a request object, either of type + # {::Google::Cloud::Security::PrivateCA::V1beta1::ListCertificateRevocationListsRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Security::PrivateCA::V1beta1::ListCertificateRevocationListsRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_certificate_revocation_lists(parent: nil, page_size: nil, page_token: nil, filter: nil, order_by: nil) + # Pass arguments to `list_certificate_revocation_lists` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param parent [::String] + # Required. The resource name of the location associated with the + # {::Google::Cloud::Security::PrivateCA::V1beta1::CertificateRevocationList CertificateRevocationLists}, in the format + # `projects/*/locations/*/certificateauthorities/*`. + # @param page_size [::Integer] + # Optional. Limit on the number of + # {::Google::Cloud::Security::PrivateCA::V1beta1::CertificateRevocationList CertificateRevocationLists} to include in the + # response. Further {::Google::Cloud::Security::PrivateCA::V1beta1::CertificateRevocationList CertificateRevocationLists} + # can subsequently be obtained by including the + # {::Google::Cloud::Security::PrivateCA::V1beta1::ListCertificateRevocationListsResponse#next_page_token ListCertificateRevocationListsResponse.next_page_token} in a subsequent + # request. If unspecified, the server will pick an appropriate default. + # @param page_token [::String] + # Optional. Pagination token, returned earlier via + # {::Google::Cloud::Security::PrivateCA::V1beta1::ListCertificateRevocationListsResponse#next_page_token ListCertificateRevocationListsResponse.next_page_token}. + # @param filter [::String] + # Optional. Only include resources that match the filter in the response. + # @param order_by [::String] + # Optional. Specify how the results should be sorted. + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Gapic::Rest::PagedEnumerable<::Google::Cloud::Security::PrivateCA::V1beta1::CertificateRevocationList>] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Gapic::Rest::PagedEnumerable<::Google::Cloud::Security::PrivateCA::V1beta1::CertificateRevocationList>] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/security/private_ca/v1beta1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Security::PrivateCA::V1beta1::CertificateAuthorityService::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Security::PrivateCA::V1beta1::ListCertificateRevocationListsRequest.new + # + # # Call the list_certificate_revocation_lists method. + # result = client.list_certificate_revocation_lists request + # + # # The returned object is of type Gapic::PagedEnumerable. You can iterate + # # over elements, and API calls will be issued to fetch pages as needed. + # result.each do |item| + # # Each element is of type ::Google::Cloud::Security::PrivateCA::V1beta1::CertificateRevocationList. + # p item + # end + # + def list_certificate_revocation_lists request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Security::PrivateCA::V1beta1::ListCertificateRevocationListsRequest + + # Converts hash 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_certificate_revocation_lists.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::Security::PrivateCA::V1beta1::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_certificate_revocation_lists.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.list_certificate_revocation_lists.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @certificate_authority_service_stub.list_certificate_revocation_lists request, options do |result, operation| + result = ::Gapic::Rest::PagedEnumerable.new @certificate_authority_service_stub, :list_certificate_revocation_lists, "certificate_revocation_lists", 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 + + ## + # Update a {::Google::Cloud::Security::PrivateCA::V1beta1::CertificateRevocationList CertificateRevocationList}. + # + # @overload update_certificate_revocation_list(request, options = nil) + # Pass arguments to `update_certificate_revocation_list` via a request object, either of type + # {::Google::Cloud::Security::PrivateCA::V1beta1::UpdateCertificateRevocationListRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Security::PrivateCA::V1beta1::UpdateCertificateRevocationListRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_certificate_revocation_list(certificate_revocation_list: nil, update_mask: nil, request_id: nil) + # Pass arguments to `update_certificate_revocation_list` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param certificate_revocation_list [::Google::Cloud::Security::PrivateCA::V1beta1::CertificateRevocationList, ::Hash] + # Required. {::Google::Cloud::Security::PrivateCA::V1beta1::CertificateRevocationList CertificateRevocationList} with updated values. + # @param update_mask [::Google::Protobuf::FieldMask, ::Hash] + # Required. A list of fields to be updated in this request. + # @param request_id [::String] + # Optional. An ID to identify requests. Specify a unique request ID so that if you must + # retry your request, the server will know to ignore the request if it has + # already been completed. The server will guarantee that for at least 60 + # minutes since the first request. + # + # For example, consider a situation where you make an initial request and t + # he request times out. If you make the request again with the same request + # ID, the server can check if original operation with the same request ID + # was received, and if so, will ignore the second request. This prevents + # clients from accidentally creating duplicate commitments. + # + # The request ID must be a valid UUID with the exception that zero UUID is + # not supported (00000000-0000-0000-0000-000000000000). + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Gapic::Operation] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Gapic::Operation] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/security/private_ca/v1beta1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Security::PrivateCA::V1beta1::CertificateAuthorityService::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Security::PrivateCA::V1beta1::UpdateCertificateRevocationListRequest.new + # + # # Call the update_certificate_revocation_list method. + # result = client.update_certificate_revocation_list 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_certificate_revocation_list request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Security::PrivateCA::V1beta1::UpdateCertificateRevocationListRequest + + # Converts hash 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_certificate_revocation_list.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::Security::PrivateCA::V1beta1::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_certificate_revocation_list.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.update_certificate_revocation_list.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @certificate_authority_service_stub.update_certificate_revocation_list 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 + + ## + # Returns a {::Google::Cloud::Security::PrivateCA::V1beta1::ReusableConfig ReusableConfig}. + # + # @overload get_reusable_config(request, options = nil) + # Pass arguments to `get_reusable_config` via a request object, either of type + # {::Google::Cloud::Security::PrivateCA::V1beta1::GetReusableConfigRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Security::PrivateCA::V1beta1::GetReusableConfigRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_reusable_config(name: nil) + # Pass arguments to `get_reusable_config` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param name [::String] + # Required. The [name][ReusableConfigs.name] of the [ReusableConfigs][] to get. + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Cloud::Security::PrivateCA::V1beta1::ReusableConfig] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::Security::PrivateCA::V1beta1::ReusableConfig] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/security/private_ca/v1beta1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Security::PrivateCA::V1beta1::CertificateAuthorityService::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Security::PrivateCA::V1beta1::GetReusableConfigRequest.new + # + # # Call the get_reusable_config method. + # result = client.get_reusable_config request + # + # # The returned object is of type Google::Cloud::Security::PrivateCA::V1beta1::ReusableConfig. + # p result + # + def get_reusable_config request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Security::PrivateCA::V1beta1::GetReusableConfigRequest + + # Converts hash 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_reusable_config.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::Security::PrivateCA::V1beta1::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_reusable_config.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.get_reusable_config.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @certificate_authority_service_stub.get_reusable_config request, options do |result, operation| + yield result, operation if block_given? + end + rescue ::Gapic::Rest::Error => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Lists {::Google::Cloud::Security::PrivateCA::V1beta1::ReusableConfig ReusableConfigs}. + # + # @overload list_reusable_configs(request, options = nil) + # Pass arguments to `list_reusable_configs` via a request object, either of type + # {::Google::Cloud::Security::PrivateCA::V1beta1::ListReusableConfigsRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Security::PrivateCA::V1beta1::ListReusableConfigsRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_reusable_configs(parent: nil, page_size: nil, page_token: nil, filter: nil, order_by: nil) + # Pass arguments to `list_reusable_configs` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param parent [::String] + # Required. The resource name of the location associated with the + # {::Google::Cloud::Security::PrivateCA::V1beta1::ReusableConfig ReusableConfigs}, in the format + # `projects/*/locations/*`. + # @param page_size [::Integer] + # Optional. Limit on the number of + # {::Google::Cloud::Security::PrivateCA::V1beta1::ReusableConfig ReusableConfigs} to include in the response. + # Further {::Google::Cloud::Security::PrivateCA::V1beta1::ReusableConfig ReusableConfigs} can subsequently be + # obtained by including the + # {::Google::Cloud::Security::PrivateCA::V1beta1::ListReusableConfigsResponse#next_page_token ListReusableConfigsResponse.next_page_token} in a subsequent request. If + # unspecified, the server will pick an appropriate default. + # @param page_token [::String] + # Optional. Pagination token, returned earlier via + # {::Google::Cloud::Security::PrivateCA::V1beta1::ListReusableConfigsResponse#next_page_token ListReusableConfigsResponse.next_page_token}. + # @param filter [::String] + # Optional. Only include resources that match the filter in the response. + # @param order_by [::String] + # Optional. Specify how the results should be sorted. + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Gapic::Rest::PagedEnumerable<::Google::Cloud::Security::PrivateCA::V1beta1::ReusableConfig>] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Gapic::Rest::PagedEnumerable<::Google::Cloud::Security::PrivateCA::V1beta1::ReusableConfig>] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/security/private_ca/v1beta1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Security::PrivateCA::V1beta1::CertificateAuthorityService::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Security::PrivateCA::V1beta1::ListReusableConfigsRequest.new + # + # # Call the list_reusable_configs method. + # result = client.list_reusable_configs request + # + # # The returned object is of type Gapic::PagedEnumerable. You can iterate + # # over elements, and API calls will be issued to fetch pages as needed. + # result.each do |item| + # # Each element is of type ::Google::Cloud::Security::PrivateCA::V1beta1::ReusableConfig. + # p item + # end + # + def list_reusable_configs request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Security::PrivateCA::V1beta1::ListReusableConfigsRequest + + # Converts hash 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_reusable_configs.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::Security::PrivateCA::V1beta1::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_reusable_configs.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.list_reusable_configs.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @certificate_authority_service_stub.list_reusable_configs request, options do |result, operation| + result = ::Gapic::Rest::PagedEnumerable.new @certificate_authority_service_stub, :list_reusable_configs, "reusable_configs", 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 CertificateAuthorityService REST API. + # + # This class represents the configuration for CertificateAuthorityService REST, + # providing control over timeouts, retry behavior, logging, transport + # parameters, and other low-level controls. Certain parameters can also be + # applied individually to specific RPCs. See + # {::Google::Cloud::Security::PrivateCA::V1beta1::CertificateAuthorityService::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_certificate to 20 seconds, + # # and all remaining timeouts to 10 seconds. + # ::Google::Cloud::Security::PrivateCA::V1beta1::CertificateAuthorityService::Rest::Client.configure do |config| + # config.timeout = 10.0 + # config.rpcs.create_certificate.timeout = 20.0 + # end + # + # # Apply the above configuration only to a new client. + # client = ::Google::Cloud::Security::PrivateCA::V1beta1::CertificateAuthorityService::Rest::Client.new do |config| + # config.timeout = 10.0 + # config.rpcs.create_certificate.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 = "privateca.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 CertificateAuthorityService 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_certificate` + # @return [::Gapic::Config::Method] + # + attr_reader :create_certificate + ## + # RPC-specific configuration for `get_certificate` + # @return [::Gapic::Config::Method] + # + attr_reader :get_certificate + ## + # RPC-specific configuration for `list_certificates` + # @return [::Gapic::Config::Method] + # + attr_reader :list_certificates + ## + # RPC-specific configuration for `revoke_certificate` + # @return [::Gapic::Config::Method] + # + attr_reader :revoke_certificate + ## + # RPC-specific configuration for `update_certificate` + # @return [::Gapic::Config::Method] + # + attr_reader :update_certificate + ## + # RPC-specific configuration for `activate_certificate_authority` + # @return [::Gapic::Config::Method] + # + attr_reader :activate_certificate_authority + ## + # RPC-specific configuration for `create_certificate_authority` + # @return [::Gapic::Config::Method] + # + attr_reader :create_certificate_authority + ## + # RPC-specific configuration for `disable_certificate_authority` + # @return [::Gapic::Config::Method] + # + attr_reader :disable_certificate_authority + ## + # RPC-specific configuration for `enable_certificate_authority` + # @return [::Gapic::Config::Method] + # + attr_reader :enable_certificate_authority + ## + # RPC-specific configuration for `fetch_certificate_authority_csr` + # @return [::Gapic::Config::Method] + # + attr_reader :fetch_certificate_authority_csr + ## + # RPC-specific configuration for `get_certificate_authority` + # @return [::Gapic::Config::Method] + # + attr_reader :get_certificate_authority + ## + # RPC-specific configuration for `list_certificate_authorities` + # @return [::Gapic::Config::Method] + # + attr_reader :list_certificate_authorities + ## + # RPC-specific configuration for `restore_certificate_authority` + # @return [::Gapic::Config::Method] + # + attr_reader :restore_certificate_authority + ## + # RPC-specific configuration for `schedule_delete_certificate_authority` + # @return [::Gapic::Config::Method] + # + attr_reader :schedule_delete_certificate_authority + ## + # RPC-specific configuration for `update_certificate_authority` + # @return [::Gapic::Config::Method] + # + attr_reader :update_certificate_authority + ## + # RPC-specific configuration for `get_certificate_revocation_list` + # @return [::Gapic::Config::Method] + # + attr_reader :get_certificate_revocation_list + ## + # RPC-specific configuration for `list_certificate_revocation_lists` + # @return [::Gapic::Config::Method] + # + attr_reader :list_certificate_revocation_lists + ## + # RPC-specific configuration for `update_certificate_revocation_list` + # @return [::Gapic::Config::Method] + # + attr_reader :update_certificate_revocation_list + ## + # RPC-specific configuration for `get_reusable_config` + # @return [::Gapic::Config::Method] + # + attr_reader :get_reusable_config + ## + # RPC-specific configuration for `list_reusable_configs` + # @return [::Gapic::Config::Method] + # + attr_reader :list_reusable_configs + + # @private + def initialize parent_rpcs = nil + create_certificate_config = parent_rpcs.create_certificate if parent_rpcs.respond_to? :create_certificate + @create_certificate = ::Gapic::Config::Method.new create_certificate_config + get_certificate_config = parent_rpcs.get_certificate if parent_rpcs.respond_to? :get_certificate + @get_certificate = ::Gapic::Config::Method.new get_certificate_config + list_certificates_config = parent_rpcs.list_certificates if parent_rpcs.respond_to? :list_certificates + @list_certificates = ::Gapic::Config::Method.new list_certificates_config + revoke_certificate_config = parent_rpcs.revoke_certificate if parent_rpcs.respond_to? :revoke_certificate + @revoke_certificate = ::Gapic::Config::Method.new revoke_certificate_config + update_certificate_config = parent_rpcs.update_certificate if parent_rpcs.respond_to? :update_certificate + @update_certificate = ::Gapic::Config::Method.new update_certificate_config + activate_certificate_authority_config = parent_rpcs.activate_certificate_authority if parent_rpcs.respond_to? :activate_certificate_authority + @activate_certificate_authority = ::Gapic::Config::Method.new activate_certificate_authority_config + create_certificate_authority_config = parent_rpcs.create_certificate_authority if parent_rpcs.respond_to? :create_certificate_authority + @create_certificate_authority = ::Gapic::Config::Method.new create_certificate_authority_config + disable_certificate_authority_config = parent_rpcs.disable_certificate_authority if parent_rpcs.respond_to? :disable_certificate_authority + @disable_certificate_authority = ::Gapic::Config::Method.new disable_certificate_authority_config + enable_certificate_authority_config = parent_rpcs.enable_certificate_authority if parent_rpcs.respond_to? :enable_certificate_authority + @enable_certificate_authority = ::Gapic::Config::Method.new enable_certificate_authority_config + fetch_certificate_authority_csr_config = parent_rpcs.fetch_certificate_authority_csr if parent_rpcs.respond_to? :fetch_certificate_authority_csr + @fetch_certificate_authority_csr = ::Gapic::Config::Method.new fetch_certificate_authority_csr_config + get_certificate_authority_config = parent_rpcs.get_certificate_authority if parent_rpcs.respond_to? :get_certificate_authority + @get_certificate_authority = ::Gapic::Config::Method.new get_certificate_authority_config + list_certificate_authorities_config = parent_rpcs.list_certificate_authorities if parent_rpcs.respond_to? :list_certificate_authorities + @list_certificate_authorities = ::Gapic::Config::Method.new list_certificate_authorities_config + restore_certificate_authority_config = parent_rpcs.restore_certificate_authority if parent_rpcs.respond_to? :restore_certificate_authority + @restore_certificate_authority = ::Gapic::Config::Method.new restore_certificate_authority_config + schedule_delete_certificate_authority_config = parent_rpcs.schedule_delete_certificate_authority if parent_rpcs.respond_to? :schedule_delete_certificate_authority + @schedule_delete_certificate_authority = ::Gapic::Config::Method.new schedule_delete_certificate_authority_config + update_certificate_authority_config = parent_rpcs.update_certificate_authority if parent_rpcs.respond_to? :update_certificate_authority + @update_certificate_authority = ::Gapic::Config::Method.new update_certificate_authority_config + get_certificate_revocation_list_config = parent_rpcs.get_certificate_revocation_list if parent_rpcs.respond_to? :get_certificate_revocation_list + @get_certificate_revocation_list = ::Gapic::Config::Method.new get_certificate_revocation_list_config + list_certificate_revocation_lists_config = parent_rpcs.list_certificate_revocation_lists if parent_rpcs.respond_to? :list_certificate_revocation_lists + @list_certificate_revocation_lists = ::Gapic::Config::Method.new list_certificate_revocation_lists_config + update_certificate_revocation_list_config = parent_rpcs.update_certificate_revocation_list if parent_rpcs.respond_to? :update_certificate_revocation_list + @update_certificate_revocation_list = ::Gapic::Config::Method.new update_certificate_revocation_list_config + get_reusable_config_config = parent_rpcs.get_reusable_config if parent_rpcs.respond_to? :get_reusable_config + @get_reusable_config = ::Gapic::Config::Method.new get_reusable_config_config + list_reusable_configs_config = parent_rpcs.list_reusable_configs if parent_rpcs.respond_to? :list_reusable_configs + @list_reusable_configs = ::Gapic::Config::Method.new list_reusable_configs_config + + yield self if block_given? + end + end + end + end + end + end + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-security-private_ca-v1beta1/lib/google/cloud/security/private_ca/v1beta1/certificate_authority_service/rest/operations.rb b/owl-bot-staging/google-cloud-security-private_ca-v1beta1/lib/google/cloud/security/private_ca/v1beta1/certificate_authority_service/rest/operations.rb new file mode 100644 index 000000000000..b42b59bde28a --- /dev/null +++ b/owl-bot-staging/google-cloud-security-private_ca-v1beta1/lib/google/cloud/security/private_ca/v1beta1/certificate_authority_service/rest/operations.rb @@ -0,0 +1,927 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +require "gapic/operation" + +module Google + module Cloud + module Security + module PrivateCA + module V1beta1 + module CertificateAuthorityService + module Rest + # Service that implements Longrunning Operations API. + class Operations + # @private + API_VERSION = "" + + # @private + DEFAULT_ENDPOINT_TEMPLATE = "privateca.$UNIVERSE_DOMAIN$" + + # @private + attr_reader :operations_stub + + ## + # Configuration for the CertificateAuthorityService 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 CertificateAuthorityService 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::Security::PrivateCA::V1beta1::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::Security::PrivateCA::V1beta1::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::Security::PrivateCA::V1beta1::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::Security::PrivateCA::V1beta1::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 = "privateca.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: "/v1beta1/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the get_operation REST call + # + # @param request_pb [::Google::Longrunning::GetOperationRequest] + # A request object representing the call parameters. Required. + # @return [Array(String, [String, nil], Hash{String => String})] + # Uri, Body, Query string parameters + def self.transcode_get_operation_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :get, + uri_template: "/v1beta1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/operations/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the delete_operation REST call + # + # @param request_pb [::Google::Longrunning::DeleteOperationRequest] + # A request object representing the call parameters. Required. + # @return [Array(String, [String, nil], Hash{String => String})] + # Uri, Body, Query string parameters + def self.transcode_delete_operation_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :delete, + uri_template: "/v1beta1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/operations/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the cancel_operation REST call + # + # @param request_pb [::Google::Longrunning::CancelOperationRequest] + # A request object representing the call parameters. Required. + # @return [Array(String, [String, nil], Hash{String => String})] + # Uri, Body, Query string parameters + def self.transcode_cancel_operation_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :post, + uri_template: "/v1beta1/{name}:cancel", + body: "*", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/operations/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + end + end + end + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-security-private_ca-v1beta1/lib/google/cloud/security/private_ca/v1beta1/certificate_authority_service/rest/service_stub.rb b/owl-bot-staging/google-cloud-security-private_ca-v1beta1/lib/google/cloud/security/private_ca/v1beta1/certificate_authority_service/rest/service_stub.rb new file mode 100644 index 000000000000..0dd294029796 --- /dev/null +++ b/owl-bot-staging/google-cloud-security-private_ca-v1beta1/lib/google/cloud/security/private_ca/v1beta1/certificate_authority_service/rest/service_stub.rb @@ -0,0 +1,1314 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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/security/privateca/v1beta1/service_pb" + +module Google + module Cloud + module Security + module PrivateCA + module V1beta1 + module CertificateAuthorityService + module Rest + ## + # REST service stub for the CertificateAuthorityService 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_certificate REST call + # + # @param request_pb [::Google::Cloud::Security::PrivateCA::V1beta1::CreateCertificateRequest] + # A request object representing the call parameters. Required. + # @param options [::Gapic::CallOptions] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Cloud::Security::PrivateCA::V1beta1::Certificate] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::Security::PrivateCA::V1beta1::Certificate] + # A result object deserialized from the server's reply + def create_certificate request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_create_certificate_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_certificate", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Cloud::Security::PrivateCA::V1beta1::Certificate.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_certificate REST call + # + # @param request_pb [::Google::Cloud::Security::PrivateCA::V1beta1::GetCertificateRequest] + # A request object representing the call parameters. Required. + # @param options [::Gapic::CallOptions] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Cloud::Security::PrivateCA::V1beta1::Certificate] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::Security::PrivateCA::V1beta1::Certificate] + # A result object deserialized from the server's reply + def get_certificate request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_get_certificate_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_certificate", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Cloud::Security::PrivateCA::V1beta1::Certificate.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_certificates REST call + # + # @param request_pb [::Google::Cloud::Security::PrivateCA::V1beta1::ListCertificatesRequest] + # A request object representing the call parameters. Required. + # @param options [::Gapic::CallOptions] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Cloud::Security::PrivateCA::V1beta1::ListCertificatesResponse] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::Security::PrivateCA::V1beta1::ListCertificatesResponse] + # A result object deserialized from the server's reply + def list_certificates request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_list_certificates_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_certificates", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Cloud::Security::PrivateCA::V1beta1::ListCertificatesResponse.decode_json response.body, ignore_unknown_fields: true + catch :response do + yield result, operation if block_given? + result + end + end + + ## + # Baseline implementation for the revoke_certificate REST call + # + # @param request_pb [::Google::Cloud::Security::PrivateCA::V1beta1::RevokeCertificateRequest] + # A request object representing the call parameters. Required. + # @param options [::Gapic::CallOptions] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Cloud::Security::PrivateCA::V1beta1::Certificate] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::Security::PrivateCA::V1beta1::Certificate] + # A result object deserialized from the server's reply + def revoke_certificate request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_revoke_certificate_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: "revoke_certificate", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Cloud::Security::PrivateCA::V1beta1::Certificate.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_certificate REST call + # + # @param request_pb [::Google::Cloud::Security::PrivateCA::V1beta1::UpdateCertificateRequest] + # A request object representing the call parameters. Required. + # @param options [::Gapic::CallOptions] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Cloud::Security::PrivateCA::V1beta1::Certificate] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::Security::PrivateCA::V1beta1::Certificate] + # A result object deserialized from the server's reply + def update_certificate request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_update_certificate_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_certificate", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Cloud::Security::PrivateCA::V1beta1::Certificate.decode_json response.body, ignore_unknown_fields: true + catch :response do + yield result, operation if block_given? + result + end + end + + ## + # Baseline implementation for the activate_certificate_authority REST call + # + # @param request_pb [::Google::Cloud::Security::PrivateCA::V1beta1::ActivateCertificateAuthorityRequest] + # 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 activate_certificate_authority request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_activate_certificate_authority_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: "activate_certificate_authority", + 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 create_certificate_authority REST call + # + # @param request_pb [::Google::Cloud::Security::PrivateCA::V1beta1::CreateCertificateAuthorityRequest] + # 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_certificate_authority request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_create_certificate_authority_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_certificate_authority", + 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 disable_certificate_authority REST call + # + # @param request_pb [::Google::Cloud::Security::PrivateCA::V1beta1::DisableCertificateAuthorityRequest] + # 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 disable_certificate_authority request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_disable_certificate_authority_request request_pb + query_string_params = if query_string_params.any? + query_string_params.to_h { |p| p.split "=", 2 } + else + {} + end + + response = @client_stub.make_http_request( + verb, + uri: uri, + body: body || "", + params: query_string_params, + method_name: "disable_certificate_authority", + 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 enable_certificate_authority REST call + # + # @param request_pb [::Google::Cloud::Security::PrivateCA::V1beta1::EnableCertificateAuthorityRequest] + # 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 enable_certificate_authority request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_enable_certificate_authority_request request_pb + query_string_params = if query_string_params.any? + query_string_params.to_h { |p| p.split "=", 2 } + else + {} + end + + response = @client_stub.make_http_request( + verb, + uri: uri, + body: body || "", + params: query_string_params, + method_name: "enable_certificate_authority", + 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 fetch_certificate_authority_csr REST call + # + # @param request_pb [::Google::Cloud::Security::PrivateCA::V1beta1::FetchCertificateAuthorityCsrRequest] + # A request object representing the call parameters. Required. + # @param options [::Gapic::CallOptions] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Cloud::Security::PrivateCA::V1beta1::FetchCertificateAuthorityCsrResponse] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::Security::PrivateCA::V1beta1::FetchCertificateAuthorityCsrResponse] + # A result object deserialized from the server's reply + def fetch_certificate_authority_csr request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_fetch_certificate_authority_csr_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: "fetch_certificate_authority_csr", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Cloud::Security::PrivateCA::V1beta1::FetchCertificateAuthorityCsrResponse.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_certificate_authority REST call + # + # @param request_pb [::Google::Cloud::Security::PrivateCA::V1beta1::GetCertificateAuthorityRequest] + # A request object representing the call parameters. Required. + # @param options [::Gapic::CallOptions] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Cloud::Security::PrivateCA::V1beta1::CertificateAuthority] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::Security::PrivateCA::V1beta1::CertificateAuthority] + # A result object deserialized from the server's reply + def get_certificate_authority request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_get_certificate_authority_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_certificate_authority", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Cloud::Security::PrivateCA::V1beta1::CertificateAuthority.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_certificate_authorities REST call + # + # @param request_pb [::Google::Cloud::Security::PrivateCA::V1beta1::ListCertificateAuthoritiesRequest] + # A request object representing the call parameters. Required. + # @param options [::Gapic::CallOptions] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Cloud::Security::PrivateCA::V1beta1::ListCertificateAuthoritiesResponse] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::Security::PrivateCA::V1beta1::ListCertificateAuthoritiesResponse] + # A result object deserialized from the server's reply + def list_certificate_authorities request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_list_certificate_authorities_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_certificate_authorities", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Cloud::Security::PrivateCA::V1beta1::ListCertificateAuthoritiesResponse.decode_json response.body, ignore_unknown_fields: true + catch :response do + yield result, operation if block_given? + result + end + end + + ## + # Baseline implementation for the restore_certificate_authority REST call + # + # @param request_pb [::Google::Cloud::Security::PrivateCA::V1beta1::RestoreCertificateAuthorityRequest] + # 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 restore_certificate_authority request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_restore_certificate_authority_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: "restore_certificate_authority", + 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 schedule_delete_certificate_authority REST call + # + # @param request_pb [::Google::Cloud::Security::PrivateCA::V1beta1::ScheduleDeleteCertificateAuthorityRequest] + # 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 schedule_delete_certificate_authority request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_schedule_delete_certificate_authority_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: "schedule_delete_certificate_authority", + 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 update_certificate_authority REST call + # + # @param request_pb [::Google::Cloud::Security::PrivateCA::V1beta1::UpdateCertificateAuthorityRequest] + # 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_certificate_authority request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_update_certificate_authority_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_certificate_authority", + 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_certificate_revocation_list REST call + # + # @param request_pb [::Google::Cloud::Security::PrivateCA::V1beta1::GetCertificateRevocationListRequest] + # A request object representing the call parameters. Required. + # @param options [::Gapic::CallOptions] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Cloud::Security::PrivateCA::V1beta1::CertificateRevocationList] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::Security::PrivateCA::V1beta1::CertificateRevocationList] + # A result object deserialized from the server's reply + def get_certificate_revocation_list request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_get_certificate_revocation_list_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_certificate_revocation_list", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Cloud::Security::PrivateCA::V1beta1::CertificateRevocationList.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_certificate_revocation_lists REST call + # + # @param request_pb [::Google::Cloud::Security::PrivateCA::V1beta1::ListCertificateRevocationListsRequest] + # A request object representing the call parameters. Required. + # @param options [::Gapic::CallOptions] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Cloud::Security::PrivateCA::V1beta1::ListCertificateRevocationListsResponse] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::Security::PrivateCA::V1beta1::ListCertificateRevocationListsResponse] + # A result object deserialized from the server's reply + def list_certificate_revocation_lists request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_list_certificate_revocation_lists_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_certificate_revocation_lists", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Cloud::Security::PrivateCA::V1beta1::ListCertificateRevocationListsResponse.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_certificate_revocation_list REST call + # + # @param request_pb [::Google::Cloud::Security::PrivateCA::V1beta1::UpdateCertificateRevocationListRequest] + # 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_certificate_revocation_list request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_update_certificate_revocation_list_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_certificate_revocation_list", + 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_reusable_config REST call + # + # @param request_pb [::Google::Cloud::Security::PrivateCA::V1beta1::GetReusableConfigRequest] + # A request object representing the call parameters. Required. + # @param options [::Gapic::CallOptions] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Cloud::Security::PrivateCA::V1beta1::ReusableConfig] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::Security::PrivateCA::V1beta1::ReusableConfig] + # A result object deserialized from the server's reply + def get_reusable_config request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_get_reusable_config_request request_pb + query_string_params = if query_string_params.any? + query_string_params.to_h { |p| p.split "=", 2 } + else + {} + end + + response = @client_stub.make_http_request( + verb, + uri: uri, + body: body || "", + params: query_string_params, + method_name: "get_reusable_config", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Cloud::Security::PrivateCA::V1beta1::ReusableConfig.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_reusable_configs REST call + # + # @param request_pb [::Google::Cloud::Security::PrivateCA::V1beta1::ListReusableConfigsRequest] + # A request object representing the call parameters. Required. + # @param options [::Gapic::CallOptions] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Cloud::Security::PrivateCA::V1beta1::ListReusableConfigsResponse] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::Security::PrivateCA::V1beta1::ListReusableConfigsResponse] + # A result object deserialized from the server's reply + def list_reusable_configs request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_list_reusable_configs_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_reusable_configs", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Cloud::Security::PrivateCA::V1beta1::ListReusableConfigsResponse.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_certificate REST call + # + # @param request_pb [::Google::Cloud::Security::PrivateCA::V1beta1::CreateCertificateRequest] + # 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_certificate_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :post, + uri_template: "/v1beta1/{parent}/certificates", + body: "certificate", + matches: [ + ["parent", %r{^projects/[^/]+/locations/[^/]+/certificateAuthorities/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the get_certificate REST call + # + # @param request_pb [::Google::Cloud::Security::PrivateCA::V1beta1::GetCertificateRequest] + # 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_certificate_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :get, + uri_template: "/v1beta1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/certificateAuthorities/[^/]+/certificates/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the list_certificates REST call + # + # @param request_pb [::Google::Cloud::Security::PrivateCA::V1beta1::ListCertificatesRequest] + # 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_certificates_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :get, + uri_template: "/v1beta1/{parent}/certificates", + matches: [ + ["parent", %r{^projects/[^/]+/locations/[^/]+/certificateAuthorities/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the revoke_certificate REST call + # + # @param request_pb [::Google::Cloud::Security::PrivateCA::V1beta1::RevokeCertificateRequest] + # A request object representing the call parameters. Required. + # @return [Array(String, [String, nil], Hash{String => String})] + # Uri, Body, Query string parameters + def self.transcode_revoke_certificate_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :post, + uri_template: "/v1beta1/{name}:revoke", + body: "*", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/certificateAuthorities/[^/]+/certificates/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the update_certificate REST call + # + # @param request_pb [::Google::Cloud::Security::PrivateCA::V1beta1::UpdateCertificateRequest] + # 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_certificate_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :patch, + uri_template: "/v1beta1/{certificate.name}", + body: "certificate", + matches: [ + ["certificate.name", %r{^projects/[^/]+/locations/[^/]+/certificateAuthorities/[^/]+/certificates/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the activate_certificate_authority REST call + # + # @param request_pb [::Google::Cloud::Security::PrivateCA::V1beta1::ActivateCertificateAuthorityRequest] + # A request object representing the call parameters. Required. + # @return [Array(String, [String, nil], Hash{String => String})] + # Uri, Body, Query string parameters + def self.transcode_activate_certificate_authority_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :post, + uri_template: "/v1beta1/{name}:activate", + body: "*", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/certificateAuthorities/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the create_certificate_authority REST call + # + # @param request_pb [::Google::Cloud::Security::PrivateCA::V1beta1::CreateCertificateAuthorityRequest] + # 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_certificate_authority_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :post, + uri_template: "/v1beta1/{parent}/certificateAuthorities", + body: "certificate_authority", + matches: [ + ["parent", %r{^projects/[^/]+/locations/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the disable_certificate_authority REST call + # + # @param request_pb [::Google::Cloud::Security::PrivateCA::V1beta1::DisableCertificateAuthorityRequest] + # A request object representing the call parameters. Required. + # @return [Array(String, [String, nil], Hash{String => String})] + # Uri, Body, Query string parameters + def self.transcode_disable_certificate_authority_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :post, + uri_template: "/v1beta1/{name}:disable", + body: "*", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/certificateAuthorities/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the enable_certificate_authority REST call + # + # @param request_pb [::Google::Cloud::Security::PrivateCA::V1beta1::EnableCertificateAuthorityRequest] + # A request object representing the call parameters. Required. + # @return [Array(String, [String, nil], Hash{String => String})] + # Uri, Body, Query string parameters + def self.transcode_enable_certificate_authority_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :post, + uri_template: "/v1beta1/{name}:enable", + body: "*", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/certificateAuthorities/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the fetch_certificate_authority_csr REST call + # + # @param request_pb [::Google::Cloud::Security::PrivateCA::V1beta1::FetchCertificateAuthorityCsrRequest] + # A request object representing the call parameters. Required. + # @return [Array(String, [String, nil], Hash{String => String})] + # Uri, Body, Query string parameters + def self.transcode_fetch_certificate_authority_csr_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :get, + uri_template: "/v1beta1/{name}:fetch", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/certificateAuthorities/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the get_certificate_authority REST call + # + # @param request_pb [::Google::Cloud::Security::PrivateCA::V1beta1::GetCertificateAuthorityRequest] + # 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_certificate_authority_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :get, + uri_template: "/v1beta1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/certificateAuthorities/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the list_certificate_authorities REST call + # + # @param request_pb [::Google::Cloud::Security::PrivateCA::V1beta1::ListCertificateAuthoritiesRequest] + # 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_certificate_authorities_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :get, + uri_template: "/v1beta1/{parent}/certificateAuthorities", + matches: [ + ["parent", %r{^projects/[^/]+/locations/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the restore_certificate_authority REST call + # + # @param request_pb [::Google::Cloud::Security::PrivateCA::V1beta1::RestoreCertificateAuthorityRequest] + # A request object representing the call parameters. Required. + # @return [Array(String, [String, nil], Hash{String => String})] + # Uri, Body, Query string parameters + def self.transcode_restore_certificate_authority_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :post, + uri_template: "/v1beta1/{name}:restore", + body: "*", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/certificateAuthorities/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the schedule_delete_certificate_authority REST call + # + # @param request_pb [::Google::Cloud::Security::PrivateCA::V1beta1::ScheduleDeleteCertificateAuthorityRequest] + # A request object representing the call parameters. Required. + # @return [Array(String, [String, nil], Hash{String => String})] + # Uri, Body, Query string parameters + def self.transcode_schedule_delete_certificate_authority_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :post, + uri_template: "/v1beta1/{name}:scheduleDelete", + body: "*", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/certificateAuthorities/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the update_certificate_authority REST call + # + # @param request_pb [::Google::Cloud::Security::PrivateCA::V1beta1::UpdateCertificateAuthorityRequest] + # 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_certificate_authority_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :patch, + uri_template: "/v1beta1/{certificate_authority.name}", + body: "certificate_authority", + matches: [ + ["certificate_authority.name", %r{^projects/[^/]+/locations/[^/]+/certificateAuthorities/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the get_certificate_revocation_list REST call + # + # @param request_pb [::Google::Cloud::Security::PrivateCA::V1beta1::GetCertificateRevocationListRequest] + # 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_certificate_revocation_list_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :get, + uri_template: "/v1beta1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/certificateAuthorities/[^/]+/certificateRevocationLists/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the list_certificate_revocation_lists REST call + # + # @param request_pb [::Google::Cloud::Security::PrivateCA::V1beta1::ListCertificateRevocationListsRequest] + # 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_certificate_revocation_lists_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :get, + uri_template: "/v1beta1/{parent}/certificateRevocationLists", + matches: [ + ["parent", %r{^projects/[^/]+/locations/[^/]+/certificateAuthorities/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the update_certificate_revocation_list REST call + # + # @param request_pb [::Google::Cloud::Security::PrivateCA::V1beta1::UpdateCertificateRevocationListRequest] + # 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_certificate_revocation_list_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :patch, + uri_template: "/v1beta1/{certificate_revocation_list.name}", + body: "certificate_revocation_list", + matches: [ + ["certificate_revocation_list.name", %r{^projects/[^/]+/locations/[^/]+/certificateAuthorities/[^/]+/certificateRevocationLists/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the get_reusable_config REST call + # + # @param request_pb [::Google::Cloud::Security::PrivateCA::V1beta1::GetReusableConfigRequest] + # 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_reusable_config_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :get, + uri_template: "/v1beta1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/reusableConfigs/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the list_reusable_configs REST call + # + # @param request_pb [::Google::Cloud::Security::PrivateCA::V1beta1::ListReusableConfigsRequest] + # 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_reusable_configs_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :get, + uri_template: "/v1beta1/{parent}/reusableConfigs", + matches: [ + ["parent", %r{^projects/[^/]+/locations/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + end + end + end + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-security-private_ca-v1beta1/lib/google/cloud/security/private_ca/v1beta1/rest.rb b/owl-bot-staging/google-cloud-security-private_ca-v1beta1/lib/google/cloud/security/private_ca/v1beta1/rest.rb new file mode 100644 index 000000000000..0edf85a556a2 --- /dev/null +++ b/owl-bot-staging/google-cloud-security-private_ca-v1beta1/lib/google/cloud/security/private_ca/v1beta1/rest.rb @@ -0,0 +1,39 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +require "google/cloud/security/private_ca/v1beta1/certificate_authority_service/rest" +require "google/cloud/security/private_ca/v1beta1/version" + +module Google + module Cloud + module Security + module PrivateCA + ## + # To load just the REST part of this package, including all its services, and instantiate a REST client: + # + # @example + # + # require "google/cloud/security/private_ca/v1beta1/rest" + # client = ::Google::Cloud::Security::PrivateCA::V1beta1::CertificateAuthorityService::Rest::Client.new + # + module V1beta1 + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-security-private_ca-v1beta1/lib/google/cloud/security/private_ca/v1beta1/version.rb b/owl-bot-staging/google-cloud-security-private_ca-v1beta1/lib/google/cloud/security/private_ca/v1beta1/version.rb new file mode 100644 index 000000000000..348951b0ad41 --- /dev/null +++ b/owl-bot-staging/google-cloud-security-private_ca-v1beta1/lib/google/cloud/security/private_ca/v1beta1/version.rb @@ -0,0 +1,30 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + + +module Google + module Cloud + module Security + module PrivateCA + module V1beta1 + VERSION = "0.0.1" + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-security-private_ca-v1beta1/lib/google/cloud/security/privateca/v1beta1/resources_pb.rb b/owl-bot-staging/google-cloud-security-private_ca-v1beta1/lib/google/cloud/security/privateca/v1beta1/resources_pb.rb new file mode 100644 index 000000000000..0a964f805bc2 --- /dev/null +++ b/owl-bot-staging/google-cloud-security-private_ca-v1beta1/lib/google/cloud/security/privateca/v1beta1/resources_pb.rb @@ -0,0 +1,67 @@ +# frozen_string_literal: true +# Generated by the protocol buffer compiler. DO NOT EDIT! +# source: google/cloud/security/privateca/v1beta1/resources.proto + +require 'google/protobuf' + +require 'google/api/field_behavior_pb' +require 'google/api/resource_pb' +require 'google/protobuf/duration_pb' +require 'google/protobuf/timestamp_pb' +require 'google/protobuf/wrappers_pb' + + +descriptor_data = "\n7google/cloud/security/privateca/v1beta1/resources.proto\x12\'google.cloud.security.privateca.v1beta1\x1a\x1fgoogle/api/field_behavior.proto\x1a\x19google/api/resource.proto\x1a\x1egoogle/protobuf/duration.proto\x1a\x1fgoogle/protobuf/timestamp.proto\x1a\x1egoogle/protobuf/wrappers.proto\"\xa8\x1c\n\x14\x43\x65rtificateAuthority\x12\x11\n\x04name\x18\x01 \x01(\tB\x03\xe0\x41\x03\x12X\n\x04type\x18\x02 \x01(\x0e\x32\x42.google.cloud.security.privateca.v1beta1.CertificateAuthority.TypeB\x06\xe0\x41\x02\xe0\x41\x05\x12X\n\x04tier\x18\x03 \x01(\x0e\x32\x42.google.cloud.security.privateca.v1beta1.CertificateAuthority.TierB\x06\xe0\x41\x02\xe0\x41\x05\x12R\n\x06\x63onfig\x18\x04 \x01(\x0b\x32:.google.cloud.security.privateca.v1beta1.CertificateConfigB\x06\xe0\x41\x02\xe0\x41\x05\x12\x30\n\x08lifetime\x18\x05 \x01(\x0b\x32\x19.google.protobuf.DurationB\x03\xe0\x41\x02\x12\x66\n\x08key_spec\x18\x06 \x01(\x0b\x32L.google.cloud.security.privateca.v1beta1.CertificateAuthority.KeyVersionSpecB\x06\xe0\x41\x02\xe0\x41\x05\x12y\n\x12\x63\x65rtificate_policy\x18\x07 \x01(\x0b\x32X.google.cloud.security.privateca.v1beta1.CertificateAuthority.CertificateAuthorityPolicyB\x03\xe0\x41\x01\x12j\n\x0fissuing_options\x18\x08 \x01(\x0b\x32L.google.cloud.security.privateca.v1beta1.CertificateAuthority.IssuingOptionsB\x03\xe0\x41\x01\x12[\n\x12subordinate_config\x18\x13 \x01(\x0b\x32:.google.cloud.security.privateca.v1beta1.SubordinateConfigB\x03\xe0\x41\x01\x12W\n\x05state\x18\n \x01(\x0e\x32\x43.google.cloud.security.privateca.v1beta1.CertificateAuthority.StateB\x03\xe0\x41\x03\x12 \n\x13pem_ca_certificates\x18\t \x03(\tB\x03\xe0\x41\x03\x12i\n\x1b\x63\x61_certificate_descriptions\x18\x0c \x03(\x0b\x32?.google.cloud.security.privateca.v1beta1.CertificateDescriptionB\x03\xe0\x41\x03\x12\x17\n\ngcs_bucket\x18\r \x01(\tB\x03\xe0\x41\x05\x12\x62\n\x0b\x61\x63\x63\x65ss_urls\x18\x0e \x01(\x0b\x32H.google.cloud.security.privateca.v1beta1.CertificateAuthority.AccessUrlsB\x03\xe0\x41\x03\x12\x34\n\x0b\x63reate_time\x18\x0f \x01(\x0b\x32\x1a.google.protobuf.TimestampB\x03\xe0\x41\x03\x12\x34\n\x0bupdate_time\x18\x10 \x01(\x0b\x32\x1a.google.protobuf.TimestampB\x03\xe0\x41\x03\x12\x34\n\x0b\x64\x65lete_time\x18\x11 \x01(\x0b\x32\x1a.google.protobuf.TimestampB\x03\xe0\x41\x03\x12^\n\x06labels\x18\x12 \x03(\x0b\x32I.google.cloud.security.privateca.v1beta1.CertificateAuthority.LabelsEntryB\x03\xe0\x41\x01\x1aW\n\x0eIssuingOptions\x12 \n\x13include_ca_cert_url\x18\x01 \x01(\x08\x42\x03\xe0\x41\x02\x12#\n\x16include_crl_access_url\x18\x02 \x01(\x08\x42\x03\xe0\x41\x02\x1a\xbe\t\n\x1a\x43\x65rtificateAuthorityPolicy\x12\x8e\x01\n\x13\x61llowed_config_list\x18\x01 \x01(\x0b\x32j.google.cloud.security.privateca.v1beta1.CertificateAuthority.CertificateAuthorityPolicy.AllowedConfigListB\x03\xe0\x41\x01H\x00\x12\x66\n\x17overwrite_config_values\x18\x02 \x01(\x0b\x32>.google.cloud.security.privateca.v1beta1.ReusableConfigWrapperB\x03\xe0\x41\x01H\x00\x12\x62\n#allowed_locations_and_organizations\x18\x03 \x03(\x0b\x32\x30.google.cloud.security.privateca.v1beta1.SubjectB\x03\xe0\x41\x01\x12!\n\x14\x61llowed_common_names\x18\x04 \x03(\tB\x03\xe0\x41\x01\x12\x8a\x01\n\x0c\x61llowed_sans\x18\x05 \x01(\x0b\x32o.google.cloud.security.privateca.v1beta1.CertificateAuthority.CertificateAuthorityPolicy.AllowedSubjectAltNamesB\x03\xe0\x41\x01\x12\x38\n\x10maximum_lifetime\x18\x06 \x01(\x0b\x32\x19.google.protobuf.DurationB\x03\xe0\x41\x01\x12\x8b\x01\n\x16\x61llowed_issuance_modes\x18\x08 \x01(\x0b\x32\x66.google.cloud.security.privateca.v1beta1.CertificateAuthority.CertificateAuthorityPolicy.IssuanceModesB\x03\xe0\x41\x01\x1aw\n\x11\x41llowedConfigList\x12\x62\n\x15\x61llowed_config_values\x18\x01 \x03(\x0b\x32>.google.cloud.security.privateca.v1beta1.ReusableConfigWrapperB\x03\xe0\x41\x02\x1a\xde\x01\n\x16\x41llowedSubjectAltNames\x12\x1e\n\x11\x61llowed_dns_names\x18\x01 \x03(\tB\x03\xe0\x41\x01\x12\x19\n\x0c\x61llowed_uris\x18\x02 \x03(\tB\x03\xe0\x41\x01\x12$\n\x17\x61llowed_email_addresses\x18\x03 \x03(\tB\x03\xe0\x41\x01\x12\x18\n\x0b\x61llowed_ips\x18\x04 \x03(\tB\x03\xe0\x41\x01\x12)\n\x1c\x61llow_globbing_dns_wildcards\x18\x05 \x01(\x08\x42\x03\xe0\x41\x01\x12\x1e\n\x11\x61llow_custom_sans\x18\x06 \x01(\x08\x42\x03\xe0\x41\x01\x1a`\n\rIssuanceModes\x12%\n\x18\x61llow_csr_based_issuance\x18\x01 \x01(\x08\x42\x03\xe0\x41\x02\x12(\n\x1b\x61llow_config_based_issuance\x18\x02 \x01(\x08\x42\x03\xe0\x41\x02\x42\x0f\n\rconfig_policy\x1aG\n\nAccessUrls\x12!\n\x19\x63\x61_certificate_access_url\x18\x01 \x01(\t\x12\x16\n\x0e\x63rl_access_url\x18\x02 \x01(\t\x1a\xaf\x01\n\x0eKeyVersionSpec\x12$\n\x15\x63loud_kms_key_version\x18\x01 \x01(\tB\x03\xe0\x41\x02H\x00\x12i\n\talgorithm\x18\x02 \x01(\x0e\x32O.google.cloud.security.privateca.v1beta1.CertificateAuthority.SignHashAlgorithmB\x03\xe0\x41\x02H\x00\x42\x0c\n\nKeyVersion\x1a-\n\x0bLabelsEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12\r\n\x05value\x18\x02 \x01(\t:\x02\x38\x01\">\n\x04Type\x12\x14\n\x10TYPE_UNSPECIFIED\x10\x00\x12\x0f\n\x0bSELF_SIGNED\x10\x01\x12\x0f\n\x0bSUBORDINATE\x10\x02\"8\n\x04Tier\x12\x14\n\x10TIER_UNSPECIFIED\x10\x00\x12\x0e\n\nENTERPRISE\x10\x01\x12\n\n\x06\x44\x45VOPS\x10\x02\"g\n\x05State\x12\x15\n\x11STATE_UNSPECIFIED\x10\x00\x12\x0b\n\x07\x45NABLED\x10\x01\x12\x0c\n\x08\x44ISABLED\x10\x02\x12\x16\n\x12PENDING_ACTIVATION\x10\x03\x12\x14\n\x10PENDING_DELETION\x10\x04\"\xfc\x01\n\x11SignHashAlgorithm\x12#\n\x1fSIGN_HASH_ALGORITHM_UNSPECIFIED\x10\x00\x12\x17\n\x13RSA_PSS_2048_SHA256\x10\x01\x12\x17\n\x13RSA_PSS_3072_SHA256\x10\x02\x12\x17\n\x13RSA_PSS_4096_SHA256\x10\x03\x12\x19\n\x15RSA_PKCS1_2048_SHA256\x10\x06\x12\x19\n\x15RSA_PKCS1_3072_SHA256\x10\x07\x12\x19\n\x15RSA_PKCS1_4096_SHA256\x10\x08\x12\x12\n\x0e\x45\x43_P256_SHA256\x10\x04\x12\x12\n\x0e\x45\x43_P384_SHA384\x10\x05:\x8b\x01\xea\x41\x87\x01\n-privateca.googleapis.com/CertificateAuthority\x12Vprojects/{project}/locations/{location}/certificateAuthorities/{certificate_authority}\"\xf9\x07\n\x19\x43\x65rtificateRevocationList\x12\x11\n\x04name\x18\x01 \x01(\tB\x03\xe0\x41\x03\x12\x1c\n\x0fsequence_number\x18\x02 \x01(\x03\x42\x03\xe0\x41\x03\x12x\n\x14revoked_certificates\x18\x03 \x03(\x0b\x32U.google.cloud.security.privateca.v1beta1.CertificateRevocationList.RevokedCertificateB\x03\xe0\x41\x03\x12\x14\n\x07pem_crl\x18\x04 \x01(\tB\x03\xe0\x41\x03\x12\x17\n\naccess_url\x18\x05 \x01(\tB\x03\xe0\x41\x03\x12\\\n\x05state\x18\x06 \x01(\x0e\x32H.google.cloud.security.privateca.v1beta1.CertificateRevocationList.StateB\x03\xe0\x41\x03\x12\x34\n\x0b\x63reate_time\x18\x07 \x01(\x0b\x32\x1a.google.protobuf.TimestampB\x03\xe0\x41\x03\x12\x34\n\x0bupdate_time\x18\x08 \x01(\x0b\x32\x1a.google.protobuf.TimestampB\x03\xe0\x41\x03\x12\x63\n\x06labels\x18\t \x03(\x0b\x32N.google.cloud.security.privateca.v1beta1.CertificateRevocationList.LabelsEntryB\x03\xe0\x41\x01\x1a\x9a\x01\n\x12RevokedCertificate\x12\x13\n\x0b\x63\x65rtificate\x18\x01 \x01(\t\x12\x19\n\x11hex_serial_number\x18\x02 \x01(\t\x12T\n\x11revocation_reason\x18\x03 \x01(\x0e\x32\x39.google.cloud.security.privateca.v1beta1.RevocationReason\x1a-\n\x0bLabelsEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12\r\n\x05value\x18\x02 \x01(\t:\x02\x38\x01\":\n\x05State\x12\x15\n\x11STATE_UNSPECIFIED\x10\x00\x12\n\n\x06\x41\x43TIVE\x10\x01\x12\x0e\n\nSUPERSEDED\x10\x02:\xca\x01\xea\x41\xc6\x01\n2privateca.googleapis.com/CertificateRevocationList\x12\x8f\x01projects/{project}/locations/{location}/certificateAuthorities/{certificate_authority}/certificateRevocationLists/{certificate_revocation_list}\"\x9a\x08\n\x0b\x43\x65rtificate\x12\x11\n\x04name\x18\x01 \x01(\tB\x03\xe0\x41\x03\x12\x16\n\x07pem_csr\x18\x02 \x01(\tB\x03\xe0\x41\x05H\x00\x12Q\n\x06\x63onfig\x18\x03 \x01(\x0b\x32:.google.cloud.security.privateca.v1beta1.CertificateConfigB\x03\xe0\x41\x05H\x00\x12\x33\n\x08lifetime\x18\x04 \x01(\x0b\x32\x19.google.protobuf.DurationB\x06\xe0\x41\x02\xe0\x41\x05\x12g\n\x12revocation_details\x18\x05 \x01(\x0b\x32\x46.google.cloud.security.privateca.v1beta1.Certificate.RevocationDetailsB\x03\xe0\x41\x03\x12\x1c\n\x0fpem_certificate\x18\x06 \x01(\tB\x03\xe0\x41\x03\x12\x65\n\x17\x63\x65rtificate_description\x18\x07 \x01(\x0b\x32?.google.cloud.security.privateca.v1beta1.CertificateDescriptionB\x03\xe0\x41\x03\x12\"\n\x15pem_certificate_chain\x18\x08 \x03(\tB\x03\xe0\x41\x03\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\x12U\n\x06labels\x18\x0b \x03(\x0b\x32@.google.cloud.security.privateca.v1beta1.Certificate.LabelsEntryB\x03\xe0\x41\x01\x1a\x9d\x01\n\x11RevocationDetails\x12S\n\x10revocation_state\x18\x01 \x01(\x0e\x32\x39.google.cloud.security.privateca.v1beta1.RevocationReason\x12\x33\n\x0frevocation_time\x18\x02 \x01(\x0b\x32\x1a.google.protobuf.Timestamp\x1a-\n\x0bLabelsEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12\r\n\x05value\x18\x02 \x01(\t:\x02\x38\x01:\x9d\x01\xea\x41\x99\x01\n$privateca.googleapis.com/Certificate\x12qprojects/{project}/locations/{location}/certificateAuthorities/{certificate_authority}/certificates/{certificate}B\x14\n\x12\x63\x65rtificate_config\"\xff\x03\n\x0eReusableConfig\x12\x11\n\x04name\x18\x01 \x01(\tB\x03\xe0\x41\x03\x12R\n\x06values\x18\x02 \x01(\x0b\x32=.google.cloud.security.privateca.v1beta1.ReusableConfigValuesB\x03\xe0\x41\x02\x12\x18\n\x0b\x64\x65scription\x18\x03 \x01(\tB\x03\xe0\x41\x01\x12\x34\n\x0b\x63reate_time\x18\x04 \x01(\x0b\x32\x1a.google.protobuf.TimestampB\x03\xe0\x41\x03\x12\x34\n\x0bupdate_time\x18\x05 \x01(\x0b\x32\x1a.google.protobuf.TimestampB\x03\xe0\x41\x03\x12X\n\x06labels\x18\x06 \x03(\x0b\x32\x43.google.cloud.security.privateca.v1beta1.ReusableConfig.LabelsEntryB\x03\xe0\x41\x01\x1a-\n\x0bLabelsEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12\r\n\x05value\x18\x02 \x01(\t:\x02\x38\x01:w\xea\x41t\n\'privateca.googleapis.com/ReusableConfig\x12Iprojects/{project}/locations/{location}/reusableConfigs/{reusable_config}\"\x89\x04\n\x14ReusableConfigValues\x12I\n\tkey_usage\x18\x01 \x01(\x0b\x32\x31.google.cloud.security.privateca.v1beta1.KeyUsageB\x03\xe0\x41\x01\x12`\n\nca_options\x18\x02 \x01(\x0b\x32G.google.cloud.security.privateca.v1beta1.ReusableConfigValues.CaOptionsB\x03\xe0\x41\x01\x12J\n\npolicy_ids\x18\x03 \x03(\x0b\x32\x31.google.cloud.security.privateca.v1beta1.ObjectIdB\x03\xe0\x41\x01\x12\x1d\n\x10\x61ia_ocsp_servers\x18\x04 \x03(\tB\x03\xe0\x41\x01\x12Z\n\x15\x61\x64\x64itional_extensions\x18\x05 \x03(\x0b\x32\x36.google.cloud.security.privateca.v1beta1.X509ExtensionB\x03\xe0\x41\x01\x1a}\n\tCaOptions\x12.\n\x05is_ca\x18\x01 \x01(\x0b\x32\x1a.google.protobuf.BoolValueB\x03\xe0\x41\x01\x12@\n\x16max_issuer_path_length\x18\x02 \x01(\x0b\x32\x1b.google.protobuf.Int32ValueB\x03\xe0\x41\x01\"\xae\x01\n\x15ReusableConfigWrapper\x12\x1e\n\x0freusable_config\x18\x01 \x01(\tB\x03\xe0\x41\x02H\x00\x12\x64\n\x16reusable_config_values\x18\x02 \x01(\x0b\x32=.google.cloud.security.privateca.v1beta1.ReusableConfigValuesB\x03\xe0\x41\x02H\x00\x42\x0f\n\rconfig_values\"\xfc\x01\n\x11SubordinateConfig\x12$\n\x15\x63\x65rtificate_authority\x18\x01 \x01(\tB\x03\xe0\x41\x02H\x00\x12r\n\x10pem_issuer_chain\x18\x02 \x01(\x0b\x32Q.google.cloud.security.privateca.v1beta1.SubordinateConfig.SubordinateConfigChainB\x03\xe0\x41\x02H\x00\x1a\x37\n\x16SubordinateConfigChain\x12\x1d\n\x10pem_certificates\x18\x01 \x03(\tB\x03\xe0\x41\x02\x42\x14\n\x12subordinate_config\"\xb2\x01\n\tPublicKey\x12M\n\x04type\x18\x01 \x01(\x0e\x32:.google.cloud.security.privateca.v1beta1.PublicKey.KeyTypeB\x03\xe0\x41\x02\x12\x10\n\x03key\x18\x02 \x01(\x0c\x42\x03\xe0\x41\x02\"D\n\x07KeyType\x12\x18\n\x14KEY_TYPE_UNSPECIFIED\x10\x00\x12\x0f\n\x0bPEM_RSA_KEY\x10\x01\x12\x0e\n\nPEM_EC_KEY\x10\x02\"\xf2\x03\n\x11\x43\x65rtificateConfig\x12\x65\n\x0esubject_config\x18\x01 \x01(\x0b\x32H.google.cloud.security.privateca.v1beta1.CertificateConfig.SubjectConfigB\x03\xe0\x41\x02\x12\\\n\x0freusable_config\x18\x02 \x01(\x0b\x32>.google.cloud.security.privateca.v1beta1.ReusableConfigWrapperB\x03\xe0\x41\x02\x12K\n\npublic_key\x18\x03 \x01(\x0b\x32\x32.google.cloud.security.privateca.v1beta1.PublicKeyB\x03\xe0\x41\x01\x1a\xca\x01\n\rSubjectConfig\x12\x46\n\x07subject\x18\x01 \x01(\x0b\x32\x30.google.cloud.security.privateca.v1beta1.SubjectB\x03\xe0\x41\x02\x12\x18\n\x0b\x63ommon_name\x18\x02 \x01(\tB\x03\xe0\x41\x01\x12W\n\x10subject_alt_name\x18\x03 \x01(\x0b\x32\x38.google.cloud.security.privateca.v1beta1.SubjectAltNamesB\x03\xe0\x41\x01\"\xe1\x08\n\x16\x43\x65rtificateDescription\x12o\n\x13subject_description\x18\x01 \x01(\x0b\x32R.google.cloud.security.privateca.v1beta1.CertificateDescription.SubjectDescription\x12T\n\rconfig_values\x18\x02 \x01(\x0b\x32=.google.cloud.security.privateca.v1beta1.ReusableConfigValues\x12\x46\n\npublic_key\x18\x03 \x01(\x0b\x32\x32.google.cloud.security.privateca.v1beta1.PublicKey\x12]\n\x0esubject_key_id\x18\x04 \x01(\x0b\x32\x45.google.cloud.security.privateca.v1beta1.CertificateDescription.KeyId\x12_\n\x10\x61uthority_key_id\x18\x05 \x01(\x0b\x32\x45.google.cloud.security.privateca.v1beta1.CertificateDescription.KeyId\x12\x1f\n\x17\x63rl_distribution_points\x18\x06 \x03(\t\x12$\n\x1c\x61ia_issuing_certificate_urls\x18\x07 \x03(\t\x12p\n\x10\x63\x65rt_fingerprint\x18\x08 \x01(\x0b\x32V.google.cloud.security.privateca.v1beta1.CertificateDescription.CertificateFingerprint\x1a\xf1\x02\n\x12SubjectDescription\x12\x41\n\x07subject\x18\x01 \x01(\x0b\x32\x30.google.cloud.security.privateca.v1beta1.Subject\x12\x13\n\x0b\x63ommon_name\x18\x02 \x01(\t\x12R\n\x10subject_alt_name\x18\x03 \x01(\x0b\x32\x38.google.cloud.security.privateca.v1beta1.SubjectAltNames\x12\x19\n\x11hex_serial_number\x18\x04 \x01(\t\x12+\n\x08lifetime\x18\x05 \x01(\x0b\x32\x19.google.protobuf.Duration\x12\x33\n\x0fnot_before_time\x18\x06 \x01(\x0b\x32\x1a.google.protobuf.Timestamp\x12\x32\n\x0enot_after_time\x18\x07 \x01(\x0b\x32\x1a.google.protobuf.Timestamp\x1a\x1c\n\x05KeyId\x12\x13\n\x06key_id\x18\x01 \x01(\tB\x03\xe0\x41\x01\x1a-\n\x16\x43\x65rtificateFingerprint\x12\x13\n\x0bsha256_hash\x18\x01 \x01(\t\"\'\n\x08ObjectId\x12\x1b\n\x0eobject_id_path\x18\x01 \x03(\x05\x42\x03\xe0\x41\x02\"\x85\x01\n\rX509Extension\x12I\n\tobject_id\x18\x01 \x01(\x0b\x32\x31.google.cloud.security.privateca.v1beta1.ObjectIdB\x03\xe0\x41\x02\x12\x15\n\x08\x63ritical\x18\x02 \x01(\x08\x42\x03\xe0\x41\x02\x12\x12\n\x05value\x18\x03 \x01(\x0c\x42\x03\xe0\x41\x02\"\xb1\x05\n\x08KeyUsage\x12Y\n\x0e\x62\x61se_key_usage\x18\x01 \x01(\x0b\x32\x41.google.cloud.security.privateca.v1beta1.KeyUsage.KeyUsageOptions\x12\x65\n\x12\x65xtended_key_usage\x18\x02 \x01(\x0b\x32I.google.cloud.security.privateca.v1beta1.KeyUsage.ExtendedKeyUsageOptions\x12V\n\x1bunknown_extended_key_usages\x18\x03 \x03(\x0b\x32\x31.google.cloud.security.privateca.v1beta1.ObjectId\x1a\xe7\x01\n\x0fKeyUsageOptions\x12\x19\n\x11\x64igital_signature\x18\x01 \x01(\x08\x12\x1a\n\x12\x63ontent_commitment\x18\x02 \x01(\x08\x12\x18\n\x10key_encipherment\x18\x03 \x01(\x08\x12\x19\n\x11\x64\x61ta_encipherment\x18\x04 \x01(\x08\x12\x15\n\rkey_agreement\x18\x05 \x01(\x08\x12\x11\n\tcert_sign\x18\x06 \x01(\x08\x12\x10\n\x08\x63rl_sign\x18\x07 \x01(\x08\x12\x15\n\rencipher_only\x18\x08 \x01(\x08\x12\x15\n\rdecipher_only\x18\t \x01(\x08\x1a\xa0\x01\n\x17\x45xtendedKeyUsageOptions\x12\x13\n\x0bserver_auth\x18\x01 \x01(\x08\x12\x13\n\x0b\x63lient_auth\x18\x02 \x01(\x08\x12\x14\n\x0c\x63ode_signing\x18\x03 \x01(\x08\x12\x18\n\x10\x65mail_protection\x18\x04 \x01(\x08\x12\x15\n\rtime_stamping\x18\x05 \x01(\x08\x12\x14\n\x0cocsp_signing\x18\x06 \x01(\x08\"\xa3\x01\n\x07Subject\x12\x14\n\x0c\x63ountry_code\x18\x01 \x01(\t\x12\x14\n\x0corganization\x18\x02 \x01(\t\x12\x1b\n\x13organizational_unit\x18\x03 \x01(\t\x12\x10\n\x08locality\x18\x04 \x01(\t\x12\x10\n\x08province\x18\x05 \x01(\t\x12\x16\n\x0estreet_address\x18\x06 \x01(\t\x12\x13\n\x0bpostal_code\x18\x07 \x01(\t\"\xae\x01\n\x0fSubjectAltNames\x12\x11\n\tdns_names\x18\x01 \x03(\t\x12\x0c\n\x04uris\x18\x02 \x03(\t\x12\x17\n\x0f\x65mail_addresses\x18\x03 \x03(\t\x12\x14\n\x0cip_addresses\x18\x04 \x03(\t\x12K\n\x0b\x63ustom_sans\x18\x05 \x03(\x0b\x32\x36.google.cloud.security.privateca.v1beta1.X509Extension*\x87\x02\n\x10RevocationReason\x12!\n\x1dREVOCATION_REASON_UNSPECIFIED\x10\x00\x12\x12\n\x0eKEY_COMPROMISE\x10\x01\x12$\n CERTIFICATE_AUTHORITY_COMPROMISE\x10\x02\x12\x17\n\x13\x41\x46\x46ILIATION_CHANGED\x10\x03\x12\x0e\n\nSUPERSEDED\x10\x04\x12\x1a\n\x16\x43\x45SSATION_OF_OPERATION\x10\x05\x12\x14\n\x10\x43\x45RTIFICATE_HOLD\x10\x06\x12\x17\n\x13PRIVILEGE_WITHDRAWN\x10\x07\x12\"\n\x1e\x41TTRIBUTE_AUTHORITY_COMPROMISE\x10\x08\x42\x98\x02\n+com.google.cloud.security.privateca.v1beta1B\x17PrivateCaResourcesProtoP\x01ZIcloud.google.com/go/security/privateca/apiv1beta1/privatecapb;privatecapb\xf8\x01\x01\xaa\x02\'Google.Cloud.Security.PrivateCA.V1Beta1\xca\x02\'Google\\Cloud\\Security\\PrivateCA\\V1beta1\xea\x02+Google::Cloud::Security::PrivateCA::V1beta1b\x06proto3" + +pool = ::Google::Protobuf::DescriptorPool.generated_pool +pool.add_serialized_file(descriptor_data) + +module Google + module Cloud + module Security + module PrivateCA + module V1beta1 + CertificateAuthority = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.security.privateca.v1beta1.CertificateAuthority").msgclass + CertificateAuthority::IssuingOptions = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.security.privateca.v1beta1.CertificateAuthority.IssuingOptions").msgclass + CertificateAuthority::CertificateAuthorityPolicy = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.security.privateca.v1beta1.CertificateAuthority.CertificateAuthorityPolicy").msgclass + CertificateAuthority::CertificateAuthorityPolicy::AllowedConfigList = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.security.privateca.v1beta1.CertificateAuthority.CertificateAuthorityPolicy.AllowedConfigList").msgclass + CertificateAuthority::CertificateAuthorityPolicy::AllowedSubjectAltNames = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.security.privateca.v1beta1.CertificateAuthority.CertificateAuthorityPolicy.AllowedSubjectAltNames").msgclass + CertificateAuthority::CertificateAuthorityPolicy::IssuanceModes = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.security.privateca.v1beta1.CertificateAuthority.CertificateAuthorityPolicy.IssuanceModes").msgclass + CertificateAuthority::AccessUrls = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.security.privateca.v1beta1.CertificateAuthority.AccessUrls").msgclass + CertificateAuthority::KeyVersionSpec = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.security.privateca.v1beta1.CertificateAuthority.KeyVersionSpec").msgclass + CertificateAuthority::Type = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.security.privateca.v1beta1.CertificateAuthority.Type").enummodule + CertificateAuthority::Tier = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.security.privateca.v1beta1.CertificateAuthority.Tier").enummodule + CertificateAuthority::State = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.security.privateca.v1beta1.CertificateAuthority.State").enummodule + CertificateAuthority::SignHashAlgorithm = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.security.privateca.v1beta1.CertificateAuthority.SignHashAlgorithm").enummodule + CertificateRevocationList = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.security.privateca.v1beta1.CertificateRevocationList").msgclass + CertificateRevocationList::RevokedCertificate = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.security.privateca.v1beta1.CertificateRevocationList.RevokedCertificate").msgclass + CertificateRevocationList::State = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.security.privateca.v1beta1.CertificateRevocationList.State").enummodule + Certificate = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.security.privateca.v1beta1.Certificate").msgclass + Certificate::RevocationDetails = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.security.privateca.v1beta1.Certificate.RevocationDetails").msgclass + ReusableConfig = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.security.privateca.v1beta1.ReusableConfig").msgclass + ReusableConfigValues = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.security.privateca.v1beta1.ReusableConfigValues").msgclass + ReusableConfigValues::CaOptions = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.security.privateca.v1beta1.ReusableConfigValues.CaOptions").msgclass + ReusableConfigWrapper = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.security.privateca.v1beta1.ReusableConfigWrapper").msgclass + SubordinateConfig = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.security.privateca.v1beta1.SubordinateConfig").msgclass + SubordinateConfig::SubordinateConfigChain = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.security.privateca.v1beta1.SubordinateConfig.SubordinateConfigChain").msgclass + PublicKey = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.security.privateca.v1beta1.PublicKey").msgclass + PublicKey::KeyType = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.security.privateca.v1beta1.PublicKey.KeyType").enummodule + CertificateConfig = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.security.privateca.v1beta1.CertificateConfig").msgclass + CertificateConfig::SubjectConfig = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.security.privateca.v1beta1.CertificateConfig.SubjectConfig").msgclass + CertificateDescription = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.security.privateca.v1beta1.CertificateDescription").msgclass + CertificateDescription::SubjectDescription = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.security.privateca.v1beta1.CertificateDescription.SubjectDescription").msgclass + CertificateDescription::KeyId = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.security.privateca.v1beta1.CertificateDescription.KeyId").msgclass + CertificateDescription::CertificateFingerprint = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.security.privateca.v1beta1.CertificateDescription.CertificateFingerprint").msgclass + ObjectId = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.security.privateca.v1beta1.ObjectId").msgclass + X509Extension = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.security.privateca.v1beta1.X509Extension").msgclass + KeyUsage = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.security.privateca.v1beta1.KeyUsage").msgclass + KeyUsage::KeyUsageOptions = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.security.privateca.v1beta1.KeyUsage.KeyUsageOptions").msgclass + KeyUsage::ExtendedKeyUsageOptions = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.security.privateca.v1beta1.KeyUsage.ExtendedKeyUsageOptions").msgclass + Subject = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.security.privateca.v1beta1.Subject").msgclass + SubjectAltNames = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.security.privateca.v1beta1.SubjectAltNames").msgclass + RevocationReason = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.security.privateca.v1beta1.RevocationReason").enummodule + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-security-private_ca-v1beta1/lib/google/cloud/security/privateca/v1beta1/service_pb.rb b/owl-bot-staging/google-cloud-security-private_ca-v1beta1/lib/google/cloud/security/privateca/v1beta1/service_pb.rb new file mode 100644 index 000000000000..a760dc678bed --- /dev/null +++ b/owl-bot-staging/google-cloud-security-private_ca-v1beta1/lib/google/cloud/security/privateca/v1beta1/service_pb.rb @@ -0,0 +1,57 @@ +# frozen_string_literal: true +# Generated by the protocol buffer compiler. DO NOT EDIT! +# source: google/cloud/security/privateca/v1beta1/service.proto + +require 'google/protobuf' + +require 'google/api/annotations_pb' +require 'google/api/client_pb' +require 'google/api/field_behavior_pb' +require 'google/api/resource_pb' +require 'google/cloud/security/privateca/v1beta1/resources_pb' +require 'google/longrunning/operations_pb' +require 'google/protobuf/field_mask_pb' +require 'google/protobuf/timestamp_pb' + + +descriptor_data = "\n5google/cloud/security/privateca/v1beta1/service.proto\x12\'google.cloud.security.privateca.v1beta1\x1a\x1cgoogle/api/annotations.proto\x1a\x17google/api/client.proto\x1a\x1fgoogle/api/field_behavior.proto\x1a\x19google/api/resource.proto\x1a\x37google/cloud/security/privateca/v1beta1/resources.proto\x1a#google/longrunning/operations.proto\x1a google/protobuf/field_mask.proto\x1a\x1fgoogle/protobuf/timestamp.proto\"\xe7\x01\n\x18\x43reateCertificateRequest\x12\x45\n\x06parent\x18\x01 \x01(\tB5\xe0\x41\x02\xfa\x41/\n-privateca.googleapis.com/CertificateAuthority\x12\x1b\n\x0e\x63\x65rtificate_id\x18\x02 \x01(\tB\x03\xe0\x41\x01\x12N\n\x0b\x63\x65rtificate\x18\x03 \x01(\x0b\x32\x34.google.cloud.security.privateca.v1beta1.CertificateB\x03\xe0\x41\x02\x12\x17\n\nrequest_id\x18\x04 \x01(\tB\x03\xe0\x41\x01\"S\n\x15GetCertificateRequest\x12:\n\x04name\x18\x01 \x01(\tB,\xe0\x41\x02\xfa\x41&\n$privateca.googleapis.com/Certificate\"\xbd\x01\n\x17ListCertificatesRequest\x12\x45\n\x06parent\x18\x01 \x01(\tB5\xe0\x41\x02\xfa\x41/\n-privateca.googleapis.com/CertificateAuthority\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\x12\x15\n\x08order_by\x18\x05 \x01(\tB\x03\xe0\x41\x01\"\x94\x01\n\x18ListCertificatesResponse\x12J\n\x0c\x63\x65rtificates\x18\x01 \x03(\x0b\x32\x34.google.cloud.security.privateca.v1beta1.Certificate\x12\x17\n\x0fnext_page_token\x18\x02 \x01(\t\x12\x13\n\x0bunreachable\x18\x03 \x03(\t\"\xbf\x01\n\x18RevokeCertificateRequest\x12:\n\x04name\x18\x01 \x01(\tB,\xe0\x41\x02\xfa\x41&\n$privateca.googleapis.com/Certificate\x12N\n\x06reason\x18\x02 \x01(\x0e\x32\x39.google.cloud.security.privateca.v1beta1.RevocationReasonB\x03\xe0\x41\x02\x12\x17\n\nrequest_id\x18\x03 \x01(\tB\x03\xe0\x41\x01\"\xb9\x01\n\x18UpdateCertificateRequest\x12N\n\x0b\x63\x65rtificate\x18\x01 \x01(\x0b\x32\x34.google.cloud.security.privateca.v1beta1.CertificateB\x03\xe0\x41\x02\x12\x34\n\x0bupdate_mask\x18\x02 \x01(\x0b\x32\x1a.google.protobuf.FieldMaskB\x03\xe0\x41\x02\x12\x17\n\nrequest_id\x18\x03 \x01(\tB\x03\xe0\x41\x01\"\x81\x02\n#ActivateCertificateAuthorityRequest\x12\x43\n\x04name\x18\x01 \x01(\tB5\xe0\x41\x02\xfa\x41/\n-privateca.googleapis.com/CertificateAuthority\x12\x1f\n\x12pem_ca_certificate\x18\x02 \x01(\tB\x03\xe0\x41\x02\x12[\n\x12subordinate_config\x18\x03 \x01(\x0b\x32:.google.cloud.security.privateca.v1beta1.SubordinateConfigB\x03\xe0\x41\x02\x12\x17\n\nrequest_id\x18\x04 \x01(\tB\x03\xe0\x41\x01\"\x81\x02\n!CreateCertificateAuthorityRequest\x12\x39\n\x06parent\x18\x01 \x01(\tB)\xe0\x41\x02\xfa\x41#\n!locations.googleapis.com/Location\x12%\n\x18\x63\x65rtificate_authority_id\x18\x02 \x01(\tB\x03\xe0\x41\x02\x12\x61\n\x15\x63\x65rtificate_authority\x18\x03 \x01(\x0b\x32=.google.cloud.security.privateca.v1beta1.CertificateAuthorityB\x03\xe0\x41\x02\x12\x17\n\nrequest_id\x18\x04 \x01(\tB\x03\xe0\x41\x01\"\x82\x01\n\"DisableCertificateAuthorityRequest\x12\x43\n\x04name\x18\x01 \x01(\tB5\xe0\x41\x02\xfa\x41/\n-privateca.googleapis.com/CertificateAuthority\x12\x17\n\nrequest_id\x18\x02 \x01(\tB\x03\xe0\x41\x01\"\x81\x01\n!EnableCertificateAuthorityRequest\x12\x43\n\x04name\x18\x01 \x01(\tB5\xe0\x41\x02\xfa\x41/\n-privateca.googleapis.com/CertificateAuthority\x12\x17\n\nrequest_id\x18\x02 \x01(\tB\x03\xe0\x41\x01\"j\n#FetchCertificateAuthorityCsrRequest\x12\x43\n\x04name\x18\x01 \x01(\tB5\xe0\x41\x02\xfa\x41/\n-privateca.googleapis.com/CertificateAuthority\"<\n$FetchCertificateAuthorityCsrResponse\x12\x14\n\x07pem_csr\x18\x01 \x01(\tB\x03\xe0\x41\x03\"e\n\x1eGetCertificateAuthorityRequest\x12\x43\n\x04name\x18\x01 \x01(\tB5\xe0\x41\x02\xfa\x41/\n-privateca.googleapis.com/CertificateAuthority\"\xbb\x01\n!ListCertificateAuthoritiesRequest\x12\x39\n\x06parent\x18\x01 \x01(\tB)\xe0\x41\x02\xfa\x41#\n!locations.googleapis.com/Location\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\x12\x15\n\x08order_by\x18\x05 \x01(\tB\x03\xe0\x41\x01\"\xb2\x01\n\"ListCertificateAuthoritiesResponse\x12^\n\x17\x63\x65rtificate_authorities\x18\x01 \x03(\x0b\x32=.google.cloud.security.privateca.v1beta1.CertificateAuthority\x12\x17\n\x0fnext_page_token\x18\x02 \x01(\t\x12\x13\n\x0bunreachable\x18\x03 \x03(\t\"\x82\x01\n\"RestoreCertificateAuthorityRequest\x12\x43\n\x04name\x18\x01 \x01(\tB5\xe0\x41\x02\xfa\x41/\n-privateca.googleapis.com/CertificateAuthority\x12\x17\n\nrequest_id\x18\x02 \x01(\tB\x03\xe0\x41\x01\"\x89\x01\n)ScheduleDeleteCertificateAuthorityRequest\x12\x43\n\x04name\x18\x01 \x01(\tB5\xe0\x41\x02\xfa\x41/\n-privateca.googleapis.com/CertificateAuthority\x12\x17\n\nrequest_id\x18\x02 \x01(\tB\x03\xe0\x41\x01\"\xd5\x01\n!UpdateCertificateAuthorityRequest\x12\x61\n\x15\x63\x65rtificate_authority\x18\x01 \x01(\x0b\x32=.google.cloud.security.privateca.v1beta1.CertificateAuthorityB\x03\xe0\x41\x02\x12\x34\n\x0bupdate_mask\x18\x02 \x01(\x0b\x32\x1a.google.protobuf.FieldMaskB\x03\xe0\x41\x02\x12\x17\n\nrequest_id\x18\x03 \x01(\tB\x03\xe0\x41\x01\"o\n#GetCertificateRevocationListRequest\x12H\n\x04name\x18\x01 \x01(\tB:\xe0\x41\x02\xfa\x41\x34\n2privateca.googleapis.com/CertificateRevocationList\"\xcb\x01\n%ListCertificateRevocationListsRequest\x12\x45\n\x06parent\x18\x01 \x01(\tB5\xe0\x41\x02\xfa\x41/\n-privateca.googleapis.com/CertificateAuthority\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\x12\x15\n\x08order_by\x18\x05 \x01(\tB\x03\xe0\x41\x01\"\xc0\x01\n&ListCertificateRevocationListsResponse\x12h\n\x1c\x63\x65rtificate_revocation_lists\x18\x01 \x03(\x0b\x32\x42.google.cloud.security.privateca.v1beta1.CertificateRevocationList\x12\x17\n\x0fnext_page_token\x18\x02 \x01(\t\x12\x13\n\x0bunreachable\x18\x03 \x03(\t\"\xe5\x01\n&UpdateCertificateRevocationListRequest\x12l\n\x1b\x63\x65rtificate_revocation_list\x18\x01 \x01(\x0b\x32\x42.google.cloud.security.privateca.v1beta1.CertificateRevocationListB\x03\xe0\x41\x02\x12\x34\n\x0bupdate_mask\x18\x02 \x01(\x0b\x32\x1a.google.protobuf.FieldMaskB\x03\xe0\x41\x02\x12\x17\n\nrequest_id\x18\x03 \x01(\tB\x03\xe0\x41\x01\"Y\n\x18GetReusableConfigRequest\x12=\n\x04name\x18\x01 \x01(\tB/\xe0\x41\x02\xfa\x41)\n\'privateca.googleapis.com/ReusableConfig\"\xb4\x01\n\x1aListReusableConfigsRequest\x12\x39\n\x06parent\x18\x01 \x01(\tB)\xe0\x41\x02\xfa\x41#\n!locations.googleapis.com/Location\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\x12\x15\n\x08order_by\x18\x05 \x01(\tB\x03\xe0\x41\x01\"\x9e\x01\n\x1bListReusableConfigsResponse\x12Q\n\x10reusable_configs\x18\x01 \x03(\x0b\x32\x37.google.cloud.security.privateca.v1beta1.ReusableConfig\x12\x17\n\x0fnext_page_token\x18\x02 \x01(\t\x12\x13\n\x0bunreachable\x18\x03 \x03(\t\"\x80\x02\n\x11OperationMetadata\x12\x34\n\x0b\x63reate_time\x18\x01 \x01(\x0b\x32\x1a.google.protobuf.TimestampB\x03\xe0\x41\x03\x12\x31\n\x08\x65nd_time\x18\x02 \x01(\x0b\x32\x1a.google.protobuf.TimestampB\x03\xe0\x41\x03\x12\x13\n\x06target\x18\x03 \x01(\tB\x03\xe0\x41\x03\x12\x11\n\x04verb\x18\x04 \x01(\tB\x03\xe0\x41\x03\x12\x1b\n\x0estatus_message\x18\x05 \x01(\tB\x03\xe0\x41\x03\x12#\n\x16requested_cancellation\x18\x06 \x01(\x08\x42\x03\xe0\x41\x03\x12\x18\n\x0b\x61pi_version\x18\x07 \x01(\tB\x03\xe0\x41\x03\x32\xd1,\n\x1b\x43\x65rtificateAuthorityService\x12\x96\x02\n\x11\x43reateCertificate\x12\x41.google.cloud.security.privateca.v1beta1.CreateCertificateRequest\x1a\x34.google.cloud.security.privateca.v1beta1.Certificate\"\x87\x01\xda\x41!parent,certificate,certificate_id\x82\xd3\xe4\x93\x02]\"N/v1beta1/{parent=projects/*/locations/*/certificateAuthorities/*}/certificates:\x0b\x63\x65rtificate\x12\xe5\x01\n\x0eGetCertificate\x12>.google.cloud.security.privateca.v1beta1.GetCertificateRequest\x1a\x34.google.cloud.security.privateca.v1beta1.Certificate\"]\xda\x41\x04name\x82\xd3\xe4\x93\x02P\x12N/v1beta1/{name=projects/*/locations/*/certificateAuthorities/*/certificates/*}\x12\xf8\x01\n\x10ListCertificates\x12@.google.cloud.security.privateca.v1beta1.ListCertificatesRequest\x1a\x41.google.cloud.security.privateca.v1beta1.ListCertificatesResponse\"_\xda\x41\x06parent\x82\xd3\xe4\x93\x02P\x12N/v1beta1/{parent=projects/*/locations/*/certificateAuthorities/*}/certificates\x12\xf5\x01\n\x11RevokeCertificate\x12\x41.google.cloud.security.privateca.v1beta1.RevokeCertificateRequest\x1a\x34.google.cloud.security.privateca.v1beta1.Certificate\"g\xda\x41\x04name\x82\xd3\xe4\x93\x02Z\"U/v1beta1/{name=projects/*/locations/*/certificateAuthorities/*/certificates/*}:revoke:\x01*\x12\x98\x02\n\x11UpdateCertificate\x12\x41.google.cloud.security.privateca.v1beta1.UpdateCertificateRequest\x1a\x34.google.cloud.security.privateca.v1beta1.Certificate\"\x89\x01\xda\x41\x17\x63\x65rtificate,update_mask\x82\xd3\xe4\x93\x02i2Z/v1beta1/{certificate.name=projects/*/locations/*/certificateAuthorities/*/certificates/*}:\x0b\x63\x65rtificate\x12\x94\x02\n\x1c\x41\x63tivateCertificateAuthority\x12L.google.cloud.security.privateca.v1beta1.ActivateCertificateAuthorityRequest\x1a\x1d.google.longrunning.Operation\"\x86\x01\xca\x41)\n\x14\x43\x65rtificateAuthority\x12\x11OperationMetadata\xda\x41\x04name\x82\xd3\xe4\x93\x02M\"H/v1beta1/{name=projects/*/locations/*/certificateAuthorities/*}:activate:\x01*\x12\xcc\x02\n\x1a\x43reateCertificateAuthority\x12J.google.cloud.security.privateca.v1beta1.CreateCertificateAuthorityRequest\x1a\x1d.google.longrunning.Operation\"\xc2\x01\xca\x41)\n\x14\x43\x65rtificateAuthority\x12\x11OperationMetadata\xda\x41\x35parent,certificate_authority,certificate_authority_id\x82\xd3\xe4\x93\x02X\"?/v1beta1/{parent=projects/*/locations/*}/certificateAuthorities:\x15\x63\x65rtificate_authority\x12\x91\x02\n\x1b\x44isableCertificateAuthority\x12K.google.cloud.security.privateca.v1beta1.DisableCertificateAuthorityRequest\x1a\x1d.google.longrunning.Operation\"\x85\x01\xca\x41)\n\x14\x43\x65rtificateAuthority\x12\x11OperationMetadata\xda\x41\x04name\x82\xd3\xe4\x93\x02L\"G/v1beta1/{name=projects/*/locations/*/certificateAuthorities/*}:disable:\x01*\x12\x8e\x02\n\x1a\x45nableCertificateAuthority\x12J.google.cloud.security.privateca.v1beta1.EnableCertificateAuthorityRequest\x1a\x1d.google.longrunning.Operation\"\x84\x01\xca\x41)\n\x14\x43\x65rtificateAuthority\x12\x11OperationMetadata\xda\x41\x04name\x82\xd3\xe4\x93\x02K\"F/v1beta1/{name=projects/*/locations/*/certificateAuthorities/*}:enable:\x01*\x12\x91\x02\n\x1c\x46\x65tchCertificateAuthorityCsr\x12L.google.cloud.security.privateca.v1beta1.FetchCertificateAuthorityCsrRequest\x1aM.google.cloud.security.privateca.v1beta1.FetchCertificateAuthorityCsrResponse\"T\xda\x41\x04name\x82\xd3\xe4\x93\x02G\x12\x45/v1beta1/{name=projects/*/locations/*/certificateAuthorities/*}:fetch\x12\xf1\x01\n\x17GetCertificateAuthority\x12G.google.cloud.security.privateca.v1beta1.GetCertificateAuthorityRequest\x1a=.google.cloud.security.privateca.v1beta1.CertificateAuthority\"N\xda\x41\x04name\x82\xd3\xe4\x93\x02\x41\x12?/v1beta1/{name=projects/*/locations/*/certificateAuthorities/*}\x12\x87\x02\n\x1aListCertificateAuthorities\x12J.google.cloud.security.privateca.v1beta1.ListCertificateAuthoritiesRequest\x1aK.google.cloud.security.privateca.v1beta1.ListCertificateAuthoritiesResponse\"P\xda\x41\x06parent\x82\xd3\xe4\x93\x02\x41\x12?/v1beta1/{parent=projects/*/locations/*}/certificateAuthorities\x12\x91\x02\n\x1bRestoreCertificateAuthority\x12K.google.cloud.security.privateca.v1beta1.RestoreCertificateAuthorityRequest\x1a\x1d.google.longrunning.Operation\"\x85\x01\xca\x41)\n\x14\x43\x65rtificateAuthority\x12\x11OperationMetadata\xda\x41\x04name\x82\xd3\xe4\x93\x02L\"G/v1beta1/{name=projects/*/locations/*/certificateAuthorities/*}:restore:\x01*\x12\xa6\x02\n\"ScheduleDeleteCertificateAuthority\x12R.google.cloud.security.privateca.v1beta1.ScheduleDeleteCertificateAuthorityRequest\x1a\x1d.google.longrunning.Operation\"\x8c\x01\xca\x41)\n\x14\x43\x65rtificateAuthority\x12\x11OperationMetadata\xda\x41\x04name\x82\xd3\xe4\x93\x02S\"N/v1beta1/{name=projects/*/locations/*/certificateAuthorities/*}:scheduleDelete:\x01*\x12\xce\x02\n\x1aUpdateCertificateAuthority\x12J.google.cloud.security.privateca.v1beta1.UpdateCertificateAuthorityRequest\x1a\x1d.google.longrunning.Operation\"\xc4\x01\xca\x41)\n\x14\x43\x65rtificateAuthority\x12\x11OperationMetadata\xda\x41!certificate_authority,update_mask\x82\xd3\xe4\x93\x02n2U/v1beta1/{certificate_authority.name=projects/*/locations/*/certificateAuthorities/*}:\x15\x63\x65rtificate_authority\x12\x9d\x02\n\x1cGetCertificateRevocationList\x12L.google.cloud.security.privateca.v1beta1.GetCertificateRevocationListRequest\x1a\x42.google.cloud.security.privateca.v1beta1.CertificateRevocationList\"k\xda\x41\x04name\x82\xd3\xe4\x93\x02^\x12\\/v1beta1/{name=projects/*/locations/*/certificateAuthorities/*/certificateRevocationLists/*}\x12\xb0\x02\n\x1eListCertificateRevocationLists\x12N.google.cloud.security.privateca.v1beta1.ListCertificateRevocationListsRequest\x1aO.google.cloud.security.privateca.v1beta1.ListCertificateRevocationListsResponse\"m\xda\x41\x06parent\x82\xd3\xe4\x93\x02^\x12\\/v1beta1/{parent=projects/*/locations/*/certificateAuthorities/*}/certificateRevocationLists\x12\x8d\x03\n\x1fUpdateCertificateRevocationList\x12O.google.cloud.security.privateca.v1beta1.UpdateCertificateRevocationListRequest\x1a\x1d.google.longrunning.Operation\"\xf9\x01\xca\x41.\n\x19\x43\x65rtificateRevocationList\x12\x11OperationMetadata\xda\x41\'certificate_revocation_list,update_mask\x82\xd3\xe4\x93\x02\x97\x01\x32x/v1beta1/{certificate_revocation_list.name=projects/*/locations/*/certificateAuthorities/*/certificateRevocationLists/*}:\x1b\x63\x65rtificate_revocation_list\x12\xd8\x01\n\x11GetReusableConfig\x12\x41.google.cloud.security.privateca.v1beta1.GetReusableConfigRequest\x1a\x37.google.cloud.security.privateca.v1beta1.ReusableConfig\"G\xda\x41\x04name\x82\xd3\xe4\x93\x02:\x12\x38/v1beta1/{name=projects/*/locations/*/reusableConfigs/*}\x12\xeb\x01\n\x13ListReusableConfigs\x12\x43.google.cloud.security.privateca.v1beta1.ListReusableConfigsRequest\x1a\x44.google.cloud.security.privateca.v1beta1.ListReusableConfigsResponse\"I\xda\x41\x06parent\x82\xd3\xe4\x93\x02:\x12\x38/v1beta1/{parent=projects/*/locations/*}/reusableConfigs\x1aL\xca\x41\x18privateca.googleapis.com\xd2\x41.https://www.googleapis.com/auth/cloud-platformB\x8f\x02\n+com.google.cloud.security.privateca.v1beta1B\x0ePrivateCaProtoP\x01ZIcloud.google.com/go/security/privateca/apiv1beta1/privatecapb;privatecapb\xf8\x01\x01\xaa\x02\'Google.Cloud.Security.PrivateCA.V1Beta1\xca\x02\'Google\\Cloud\\Security\\PrivateCA\\V1beta1\xea\x02+Google::Cloud::Security::PrivateCA::V1beta1b\x06proto3" + +pool = ::Google::Protobuf::DescriptorPool.generated_pool +pool.add_serialized_file(descriptor_data) + +module Google + module Cloud + module Security + module PrivateCA + module V1beta1 + CreateCertificateRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.security.privateca.v1beta1.CreateCertificateRequest").msgclass + GetCertificateRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.security.privateca.v1beta1.GetCertificateRequest").msgclass + ListCertificatesRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.security.privateca.v1beta1.ListCertificatesRequest").msgclass + ListCertificatesResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.security.privateca.v1beta1.ListCertificatesResponse").msgclass + RevokeCertificateRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.security.privateca.v1beta1.RevokeCertificateRequest").msgclass + UpdateCertificateRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.security.privateca.v1beta1.UpdateCertificateRequest").msgclass + ActivateCertificateAuthorityRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.security.privateca.v1beta1.ActivateCertificateAuthorityRequest").msgclass + CreateCertificateAuthorityRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.security.privateca.v1beta1.CreateCertificateAuthorityRequest").msgclass + DisableCertificateAuthorityRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.security.privateca.v1beta1.DisableCertificateAuthorityRequest").msgclass + EnableCertificateAuthorityRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.security.privateca.v1beta1.EnableCertificateAuthorityRequest").msgclass + FetchCertificateAuthorityCsrRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.security.privateca.v1beta1.FetchCertificateAuthorityCsrRequest").msgclass + FetchCertificateAuthorityCsrResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.security.privateca.v1beta1.FetchCertificateAuthorityCsrResponse").msgclass + GetCertificateAuthorityRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.security.privateca.v1beta1.GetCertificateAuthorityRequest").msgclass + ListCertificateAuthoritiesRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.security.privateca.v1beta1.ListCertificateAuthoritiesRequest").msgclass + ListCertificateAuthoritiesResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.security.privateca.v1beta1.ListCertificateAuthoritiesResponse").msgclass + RestoreCertificateAuthorityRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.security.privateca.v1beta1.RestoreCertificateAuthorityRequest").msgclass + ScheduleDeleteCertificateAuthorityRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.security.privateca.v1beta1.ScheduleDeleteCertificateAuthorityRequest").msgclass + UpdateCertificateAuthorityRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.security.privateca.v1beta1.UpdateCertificateAuthorityRequest").msgclass + GetCertificateRevocationListRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.security.privateca.v1beta1.GetCertificateRevocationListRequest").msgclass + ListCertificateRevocationListsRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.security.privateca.v1beta1.ListCertificateRevocationListsRequest").msgclass + ListCertificateRevocationListsResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.security.privateca.v1beta1.ListCertificateRevocationListsResponse").msgclass + UpdateCertificateRevocationListRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.security.privateca.v1beta1.UpdateCertificateRevocationListRequest").msgclass + GetReusableConfigRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.security.privateca.v1beta1.GetReusableConfigRequest").msgclass + ListReusableConfigsRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.security.privateca.v1beta1.ListReusableConfigsRequest").msgclass + ListReusableConfigsResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.security.privateca.v1beta1.ListReusableConfigsResponse").msgclass + OperationMetadata = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.security.privateca.v1beta1.OperationMetadata").msgclass + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-security-private_ca-v1beta1/lib/google/cloud/security/privateca/v1beta1/service_services_pb.rb b/owl-bot-staging/google-cloud-security-private_ca-v1beta1/lib/google/cloud/security/privateca/v1beta1/service_services_pb.rb new file mode 100644 index 000000000000..5d3942b0c029 --- /dev/null +++ b/owl-bot-staging/google-cloud-security-private_ca-v1beta1/lib/google/cloud/security/privateca/v1beta1/service_services_pb.rb @@ -0,0 +1,99 @@ +# Generated by the protocol buffer compiler. DO NOT EDIT! +# Source: google/cloud/security/privateca/v1beta1/service.proto for package 'Google.Cloud.Security.PrivateCA.V1beta1' +# Original file comments: +# 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 +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# + +require 'grpc' +require 'google/cloud/security/privateca/v1beta1/service_pb' + +module Google + module Cloud + module Security + module PrivateCA + module V1beta1 + module CertificateAuthorityService + # [Certificate Authority Service][google.cloud.security.privateca.v1beta1.CertificateAuthorityService] manages private + # certificate authorities and issued certificates. + class Service + + include ::GRPC::GenericService + + self.marshal_class_method = :encode + self.unmarshal_class_method = :decode + self.service_name = 'google.cloud.security.privateca.v1beta1.CertificateAuthorityService' + + # Create a new [Certificate][google.cloud.security.privateca.v1beta1.Certificate] in a given Project, Location from a particular + # [CertificateAuthority][google.cloud.security.privateca.v1beta1.CertificateAuthority]. + rpc :CreateCertificate, ::Google::Cloud::Security::PrivateCA::V1beta1::CreateCertificateRequest, ::Google::Cloud::Security::PrivateCA::V1beta1::Certificate + # Returns a [Certificate][google.cloud.security.privateca.v1beta1.Certificate]. + rpc :GetCertificate, ::Google::Cloud::Security::PrivateCA::V1beta1::GetCertificateRequest, ::Google::Cloud::Security::PrivateCA::V1beta1::Certificate + # Lists [Certificates][google.cloud.security.privateca.v1beta1.Certificate]. + rpc :ListCertificates, ::Google::Cloud::Security::PrivateCA::V1beta1::ListCertificatesRequest, ::Google::Cloud::Security::PrivateCA::V1beta1::ListCertificatesResponse + # Revoke a [Certificate][google.cloud.security.privateca.v1beta1.Certificate]. + rpc :RevokeCertificate, ::Google::Cloud::Security::PrivateCA::V1beta1::RevokeCertificateRequest, ::Google::Cloud::Security::PrivateCA::V1beta1::Certificate + # Update a [Certificate][google.cloud.security.privateca.v1beta1.Certificate]. Currently, the only field you can update is the + # [labels][google.cloud.security.privateca.v1beta1.Certificate.labels] field. + rpc :UpdateCertificate, ::Google::Cloud::Security::PrivateCA::V1beta1::UpdateCertificateRequest, ::Google::Cloud::Security::PrivateCA::V1beta1::Certificate + # Activate a [CertificateAuthority][google.cloud.security.privateca.v1beta1.CertificateAuthority] that is in state + # [PENDING_ACTIVATION][google.cloud.security.privateca.v1beta1.CertificateAuthority.State.PENDING_ACTIVATION] and is + # of type [SUBORDINATE][google.cloud.security.privateca.v1beta1.CertificateAuthority.Type.SUBORDINATE]. After the + # parent Certificate Authority signs a certificate signing request from + # [FetchCertificateAuthorityCsr][google.cloud.security.privateca.v1beta1.CertificateAuthorityService.FetchCertificateAuthorityCsr], this method can complete the activation + # process. + rpc :ActivateCertificateAuthority, ::Google::Cloud::Security::PrivateCA::V1beta1::ActivateCertificateAuthorityRequest, ::Google::Longrunning::Operation + # Create a new [CertificateAuthority][google.cloud.security.privateca.v1beta1.CertificateAuthority] in a given Project and Location. + rpc :CreateCertificateAuthority, ::Google::Cloud::Security::PrivateCA::V1beta1::CreateCertificateAuthorityRequest, ::Google::Longrunning::Operation + # Disable a [CertificateAuthority][google.cloud.security.privateca.v1beta1.CertificateAuthority]. + rpc :DisableCertificateAuthority, ::Google::Cloud::Security::PrivateCA::V1beta1::DisableCertificateAuthorityRequest, ::Google::Longrunning::Operation + # Enable a [CertificateAuthority][google.cloud.security.privateca.v1beta1.CertificateAuthority]. + rpc :EnableCertificateAuthority, ::Google::Cloud::Security::PrivateCA::V1beta1::EnableCertificateAuthorityRequest, ::Google::Longrunning::Operation + # Fetch a certificate signing request (CSR) from a [CertificateAuthority][google.cloud.security.privateca.v1beta1.CertificateAuthority] + # that is in state + # [PENDING_ACTIVATION][google.cloud.security.privateca.v1beta1.CertificateAuthority.State.PENDING_ACTIVATION] and is + # of type [SUBORDINATE][google.cloud.security.privateca.v1beta1.CertificateAuthority.Type.SUBORDINATE]. The CSR must + # then be signed by the desired parent Certificate Authority, which could be + # another [CertificateAuthority][google.cloud.security.privateca.v1beta1.CertificateAuthority] resource, or could be an on-prem + # certificate authority. See also [ActivateCertificateAuthority][google.cloud.security.privateca.v1beta1.CertificateAuthorityService.ActivateCertificateAuthority]. + rpc :FetchCertificateAuthorityCsr, ::Google::Cloud::Security::PrivateCA::V1beta1::FetchCertificateAuthorityCsrRequest, ::Google::Cloud::Security::PrivateCA::V1beta1::FetchCertificateAuthorityCsrResponse + # Returns a [CertificateAuthority][google.cloud.security.privateca.v1beta1.CertificateAuthority]. + rpc :GetCertificateAuthority, ::Google::Cloud::Security::PrivateCA::V1beta1::GetCertificateAuthorityRequest, ::Google::Cloud::Security::PrivateCA::V1beta1::CertificateAuthority + # Lists [CertificateAuthorities][google.cloud.security.privateca.v1beta1.CertificateAuthority]. + rpc :ListCertificateAuthorities, ::Google::Cloud::Security::PrivateCA::V1beta1::ListCertificateAuthoritiesRequest, ::Google::Cloud::Security::PrivateCA::V1beta1::ListCertificateAuthoritiesResponse + # Restore a [CertificateAuthority][google.cloud.security.privateca.v1beta1.CertificateAuthority] that is scheduled for deletion. + rpc :RestoreCertificateAuthority, ::Google::Cloud::Security::PrivateCA::V1beta1::RestoreCertificateAuthorityRequest, ::Google::Longrunning::Operation + # Schedule a [CertificateAuthority][google.cloud.security.privateca.v1beta1.CertificateAuthority] for deletion. + rpc :ScheduleDeleteCertificateAuthority, ::Google::Cloud::Security::PrivateCA::V1beta1::ScheduleDeleteCertificateAuthorityRequest, ::Google::Longrunning::Operation + # Update a [CertificateAuthority][google.cloud.security.privateca.v1beta1.CertificateAuthority]. + rpc :UpdateCertificateAuthority, ::Google::Cloud::Security::PrivateCA::V1beta1::UpdateCertificateAuthorityRequest, ::Google::Longrunning::Operation + # Returns a [CertificateRevocationList][google.cloud.security.privateca.v1beta1.CertificateRevocationList]. + rpc :GetCertificateRevocationList, ::Google::Cloud::Security::PrivateCA::V1beta1::GetCertificateRevocationListRequest, ::Google::Cloud::Security::PrivateCA::V1beta1::CertificateRevocationList + # Lists [CertificateRevocationLists][google.cloud.security.privateca.v1beta1.CertificateRevocationList]. + rpc :ListCertificateRevocationLists, ::Google::Cloud::Security::PrivateCA::V1beta1::ListCertificateRevocationListsRequest, ::Google::Cloud::Security::PrivateCA::V1beta1::ListCertificateRevocationListsResponse + # Update a [CertificateRevocationList][google.cloud.security.privateca.v1beta1.CertificateRevocationList]. + rpc :UpdateCertificateRevocationList, ::Google::Cloud::Security::PrivateCA::V1beta1::UpdateCertificateRevocationListRequest, ::Google::Longrunning::Operation + # Returns a [ReusableConfig][google.cloud.security.privateca.v1beta1.ReusableConfig]. + rpc :GetReusableConfig, ::Google::Cloud::Security::PrivateCA::V1beta1::GetReusableConfigRequest, ::Google::Cloud::Security::PrivateCA::V1beta1::ReusableConfig + # Lists [ReusableConfigs][google.cloud.security.privateca.v1beta1.ReusableConfig]. + rpc :ListReusableConfigs, ::Google::Cloud::Security::PrivateCA::V1beta1::ListReusableConfigsRequest, ::Google::Cloud::Security::PrivateCA::V1beta1::ListReusableConfigsResponse + end + + Stub = Service.rpc_stub_class + end + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-security-private_ca-v1beta1/proto_docs/README.md b/owl-bot-staging/google-cloud-security-private_ca-v1beta1/proto_docs/README.md new file mode 100644 index 000000000000..3e513ef757bc --- /dev/null +++ b/owl-bot-staging/google-cloud-security-private_ca-v1beta1/proto_docs/README.md @@ -0,0 +1,4 @@ +# Certificate Authority Service V1beta1 Protocol Buffer Documentation + +These files are for the YARD documentation of the generated protobuf files. +They are not intended to be required or loaded at runtime. diff --git a/owl-bot-staging/google-cloud-security-private_ca-v1beta1/proto_docs/google/api/client.rb b/owl-bot-staging/google-cloud-security-private_ca-v1beta1/proto_docs/google/api/client.rb new file mode 100644 index 000000000000..5089551e9ea4 --- /dev/null +++ b/owl-bot-staging/google-cloud-security-private_ca-v1beta1/proto_docs/google/api/client.rb @@ -0,0 +1,589 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + + +module Google + module Api + # Required information for every language. + # @!attribute [rw] reference_docs_uri + # @deprecated This field is deprecated and may be removed in the next major version update. + # @return [::String] + # Link to automatically generated reference documentation. Example: + # https://cloud.google.com/nodejs/docs/reference/asset/latest + # @!attribute [rw] destinations + # @return [::Array<::Google::Api::ClientLibraryDestination>] + # The destination where API teams want this client library to be published. + # @!attribute [rw] selective_gapic_generation + # @return [::Google::Api::SelectiveGapicGeneration] + # Configuration for which RPCs should be generated in the GAPIC client. + class CommonLanguageSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Details about how and where to publish client libraries. + # @!attribute [rw] version + # @return [::String] + # Version of the API to apply these settings to. This is the full protobuf + # package for the API, ending in the version element. + # Examples: "google.cloud.speech.v1" and "google.spanner.admin.database.v1". + # @!attribute [rw] launch_stage + # @return [::Google::Api::LaunchStage] + # Launch stage of this version of the API. + # @!attribute [rw] rest_numeric_enums + # @return [::Boolean] + # When using transport=rest, the client request will encode enums as + # numbers rather than strings. + # @!attribute [rw] java_settings + # @return [::Google::Api::JavaSettings] + # Settings for legacy Java features, supported in the Service YAML. + # @!attribute [rw] cpp_settings + # @return [::Google::Api::CppSettings] + # Settings for C++ client libraries. + # @!attribute [rw] php_settings + # @return [::Google::Api::PhpSettings] + # Settings for PHP client libraries. + # @!attribute [rw] python_settings + # @return [::Google::Api::PythonSettings] + # Settings for Python client libraries. + # @!attribute [rw] node_settings + # @return [::Google::Api::NodeSettings] + # Settings for Node client libraries. + # @!attribute [rw] dotnet_settings + # @return [::Google::Api::DotnetSettings] + # Settings for .NET client libraries. + # @!attribute [rw] ruby_settings + # @return [::Google::Api::RubySettings] + # Settings for Ruby client libraries. + # @!attribute [rw] go_settings + # @return [::Google::Api::GoSettings] + # Settings for Go client libraries. + class ClientLibrarySettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # This message configures the settings for publishing [Google Cloud Client + # libraries](https://cloud.google.com/apis/docs/cloud-client-libraries) + # generated from the service config. + # @!attribute [rw] method_settings + # @return [::Array<::Google::Api::MethodSettings>] + # A list of API method settings, e.g. the behavior for methods that use the + # long-running operation pattern. + # @!attribute [rw] new_issue_uri + # @return [::String] + # Link to a *public* URI where users can report issues. Example: + # https://issuetracker.google.com/issues/new?component=190865&template=1161103 + # @!attribute [rw] documentation_uri + # @return [::String] + # Link to product home page. Example: + # https://cloud.google.com/asset-inventory/docs/overview + # @!attribute [rw] api_short_name + # @return [::String] + # Used as a tracking tag when collecting data about the APIs developer + # relations artifacts like docs, packages delivered to package managers, + # etc. Example: "speech". + # @!attribute [rw] github_label + # @return [::String] + # GitHub label to apply to issues and pull requests opened for this API. + # @!attribute [rw] codeowner_github_teams + # @return [::Array<::String>] + # GitHub teams to be added to CODEOWNERS in the directory in GitHub + # containing source code for the client libraries for this API. + # @!attribute [rw] doc_tag_prefix + # @return [::String] + # A prefix used in sample code when demarking regions to be included in + # documentation. + # @!attribute [rw] organization + # @return [::Google::Api::ClientLibraryOrganization] + # For whom the client library is being published. + # @!attribute [rw] library_settings + # @return [::Array<::Google::Api::ClientLibrarySettings>] + # Client library settings. If the same version string appears multiple + # times in this list, then the last one wins. Settings from earlier + # settings with the same version string are discarded. + # @!attribute [rw] proto_reference_documentation_uri + # @return [::String] + # Optional link to proto reference documentation. Example: + # https://cloud.google.com/pubsub/lite/docs/reference/rpc + # @!attribute [rw] rest_reference_documentation_uri + # @return [::String] + # Optional link to REST reference documentation. Example: + # https://cloud.google.com/pubsub/lite/docs/reference/rest + class Publishing + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Settings for Java client libraries. + # @!attribute [rw] library_package + # @return [::String] + # The package name to use in Java. Clobbers the java_package option + # set in the protobuf. This should be used **only** by APIs + # who have already set the language_settings.java.package_name" field + # in gapic.yaml. API teams should use the protobuf java_package option + # where possible. + # + # Example of a YAML configuration:: + # + # publishing: + # 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. + # @!attribute [rw] methods + # @return [::Array<::String>] + # An allowlist of the fully qualified names of RPCs that should be included + # on public client surfaces. + # @!attribute [rw] generate_omitted_as_internal + # @return [::Boolean] + # Setting this to true indicates to the client generators that methods + # that would be excluded from the generation should instead be generated + # in a way that indicates these methods should not be consumed by + # end users. How this is expressed is up to individual language + # implementations to decide. Some examples may be: added annotations, + # obfuscated identifiers, or other language idiomatic patterns. + class SelectiveGapicGeneration + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # `BatchingConfigProto` defines the batching configuration for an API method. + # @!attribute [rw] thresholds + # @return [::Google::Api::BatchingSettingsProto] + # The thresholds which trigger a batched request to be sent. + # @!attribute [rw] batch_descriptor + # @return [::Google::Api::BatchingDescriptorProto] + # The request and response fields used in batching. + class BatchingConfigProto + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # `BatchingSettingsProto` specifies a set of batching thresholds, each of + # which acts as a trigger to send a batch of messages as a request. At least + # one threshold must be positive nonzero. + # @!attribute [rw] element_count_threshold + # @return [::Integer] + # The number of elements of a field collected into a batch which, if + # exceeded, causes the batch to be sent. + # @!attribute [rw] request_byte_threshold + # @return [::Integer] + # The aggregated size of the batched field which, if exceeded, causes the + # batch to be sent. This size is computed by aggregating the sizes of the + # request field to be batched, not of the entire request message. + # @!attribute [rw] delay_threshold + # @return [::Google::Protobuf::Duration] + # The duration after which a batch should be sent, starting from the addition + # of the first message to that batch. + # @!attribute [rw] element_count_limit + # @return [::Integer] + # The maximum number of elements collected in a batch that could be accepted + # by server. + # @!attribute [rw] request_byte_limit + # @return [::Integer] + # The maximum size of the request that could be accepted by server. + # @!attribute [rw] flow_control_element_limit + # @return [::Integer] + # The maximum number of elements allowed by flow control. + # @!attribute [rw] flow_control_byte_limit + # @return [::Integer] + # The maximum size of data allowed by flow control. + # @!attribute [rw] flow_control_limit_exceeded_behavior + # @return [::Google::Api::FlowControlLimitExceededBehaviorProto] + # The behavior to take when the flow control limit is exceeded. + class BatchingSettingsProto + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # `BatchingDescriptorProto` specifies the fields of the request message to be + # used for batching, and, optionally, the fields of the response message to be + # used for demultiplexing. + # @!attribute [rw] batched_field + # @return [::String] + # The repeated field in the request message to be aggregated by batching. + # @!attribute [rw] discriminator_fields + # @return [::Array<::String>] + # A list of the fields in the request message. Two requests will be batched + # together only if the values of every field specified in + # `request_discriminator_fields` is equal between the two requests. + # @!attribute [rw] subresponse_field + # @return [::String] + # Optional. When present, indicates the field in the response message to be + # used to demultiplex the response into multiple response messages, in + # correspondence with the multiple request messages originally batched + # together. + class BatchingDescriptorProto + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # The organization for which the client libraries are being published. + # Affects the url where generated docs are published, etc. + module ClientLibraryOrganization + # Not useful. + CLIENT_LIBRARY_ORGANIZATION_UNSPECIFIED = 0 + + # Google Cloud Platform Org. + CLOUD = 1 + + # Ads (Advertising) Org. + ADS = 2 + + # Photos Org. + PHOTOS = 3 + + # Street View Org. + STREET_VIEW = 4 + + # Shopping Org. + SHOPPING = 5 + + # Geo Org. + GEO = 6 + + # Generative AI - https://developers.generativeai.google + GENERATIVE_AI = 7 + end + + # To where should client libraries be published? + module ClientLibraryDestination + # Client libraries will neither be generated nor published to package + # managers. + CLIENT_LIBRARY_DESTINATION_UNSPECIFIED = 0 + + # Generate the client library in a repo under github.com/googleapis, + # but don't publish it to package managers. + GITHUB = 10 + + # Publish the library to package managers like nuget.org and npmjs.com. + PACKAGE_MANAGER = 20 + end + + # The behavior to take when the flow control limit is exceeded. + module FlowControlLimitExceededBehaviorProto + # Default behavior, system-defined. + UNSET_BEHAVIOR = 0 + + # Stop operation, raise error. + THROW_EXCEPTION = 1 + + # Pause operation until limit clears. + BLOCK = 2 + + # Continue operation, disregard limit. + IGNORE = 3 + end + end +end diff --git a/owl-bot-staging/google-cloud-security-private_ca-v1beta1/proto_docs/google/api/field_behavior.rb b/owl-bot-staging/google-cloud-security-private_ca-v1beta1/proto_docs/google/api/field_behavior.rb new file mode 100644 index 000000000000..582be187d115 --- /dev/null +++ b/owl-bot-staging/google-cloud-security-private_ca-v1beta1/proto_docs/google/api/field_behavior.rb @@ -0,0 +1,85 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + + +module Google + module Api + # An indicator of the behavior of a given field (for example, that a field + # is required in requests, or given as output but ignored as input). + # This **does not** change the behavior in protocol buffers itself; it only + # denotes the behavior and may affect how API tooling handles the field. + # + # Note: This enum **may** receive new values in the future. + module FieldBehavior + # Conventional default for enums. Do not use this. + FIELD_BEHAVIOR_UNSPECIFIED = 0 + + # Specifically denotes a field as optional. + # While all fields in protocol buffers are optional, this may be specified + # for emphasis if appropriate. + OPTIONAL = 1 + + # Denotes a field as required. + # This indicates that the field **must** be provided as part of the request, + # and failure to do so will cause an error (usually `INVALID_ARGUMENT`). + REQUIRED = 2 + + # Denotes a field as output only. + # This indicates that the field is provided in responses, but including the + # field in a request does nothing (the server *must* ignore it and + # *must not* throw an error as a result of the field's presence). + OUTPUT_ONLY = 3 + + # Denotes a field as input only. + # This indicates that the field is provided in requests, and the + # corresponding field is not included in output. + INPUT_ONLY = 4 + + # Denotes a field as immutable. + # This indicates that the field may be set once in a request to create a + # resource, but may not be changed thereafter. + IMMUTABLE = 5 + + # Denotes that a (repeated) field is an unordered list. + # This indicates that the service may provide the elements of the list + # in any arbitrary order, rather than the order the user originally + # provided. Additionally, the list's order may or may not be stable. + UNORDERED_LIST = 6 + + # Denotes that this field returns a non-empty default value if not set. + # This indicates that if the user provides the empty value in a request, + # a non-empty value will be returned. The user will not be aware of what + # non-empty value to expect. + NON_EMPTY_DEFAULT = 7 + + # Denotes that the field in a resource (a message annotated with + # google.api.resource) is used in the resource name to uniquely identify the + # resource. For AIP-compliant APIs, this should only be applied to the + # `name` field on the resource. + # + # This behavior should not be applied to references to other resources within + # the message. + # + # The identifier field of resources often have different field behavior + # depending on the request it is embedded in (e.g. for Create methods name + # is optional and unused, while for Update methods it is required). Instead + # of method-specific annotations, only `IDENTIFIER` is required. + IDENTIFIER = 8 + end + end +end diff --git a/owl-bot-staging/google-cloud-security-private_ca-v1beta1/proto_docs/google/api/launch_stage.rb b/owl-bot-staging/google-cloud-security-private_ca-v1beta1/proto_docs/google/api/launch_stage.rb new file mode 100644 index 000000000000..9392a413fb1b --- /dev/null +++ b/owl-bot-staging/google-cloud-security-private_ca-v1beta1/proto_docs/google/api/launch_stage.rb @@ -0,0 +1,71 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + + +module Google + module Api + # The launch stage as defined by [Google Cloud Platform + # Launch Stages](https://cloud.google.com/terms/launch-stages). + module LaunchStage + # Do not use this default value. + LAUNCH_STAGE_UNSPECIFIED = 0 + + # The feature is not yet implemented. Users can not use it. + UNIMPLEMENTED = 6 + + # Prelaunch features are hidden from users and are only visible internally. + PRELAUNCH = 7 + + # Early Access features are limited to a closed group of testers. To use + # these features, you must sign up in advance and sign a Trusted Tester + # agreement (which includes confidentiality provisions). These features may + # be unstable, changed in backward-incompatible ways, and are not + # guaranteed to be released. + EARLY_ACCESS = 1 + + # Alpha is a limited availability test for releases before they are cleared + # for widespread use. By Alpha, all significant design issues are resolved + # and we are in the process of verifying functionality. Alpha customers + # need to apply for access, agree to applicable terms, and have their + # projects allowlisted. Alpha releases don't have to be feature complete, + # no SLAs are provided, and there are no technical support obligations, but + # they will be far enough along that customers can actually use them in + # test environments or for limited-use tests -- just like they would in + # normal production cases. + ALPHA = 2 + + # Beta is the point at which we are ready to open a release for any + # customer to use. There are no SLA or technical support obligations in a + # Beta release. Products will be complete from a feature perspective, but + # may have some open outstanding issues. Beta releases are suitable for + # limited production use cases. + BETA = 3 + + # GA features are open to all developers and are considered stable and + # fully qualified for production use. + GA = 4 + + # Deprecated features are scheduled to be shut down and removed. For more + # information, see the "Deprecation Policy" section of our [Terms of + # Service](https://cloud.google.com/terms/) + # and the [Google Cloud Platform Subject to the Deprecation + # Policy](https://cloud.google.com/terms/deprecation) documentation. + DEPRECATED = 5 + end + end +end diff --git a/owl-bot-staging/google-cloud-security-private_ca-v1beta1/proto_docs/google/api/resource.rb b/owl-bot-staging/google-cloud-security-private_ca-v1beta1/proto_docs/google/api/resource.rb new file mode 100644 index 000000000000..25dec4847ac1 --- /dev/null +++ b/owl-bot-staging/google-cloud-security-private_ca-v1beta1/proto_docs/google/api/resource.rb @@ -0,0 +1,227 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + + +module Google + module Api + # A simple descriptor of a resource type. + # + # ResourceDescriptor annotates a resource message (either by means of a + # protobuf annotation or use in the service config), and associates the + # resource's schema, the resource type, and the pattern of the resource name. + # + # Example: + # + # message Topic { + # // Indicates this message defines a resource schema. + # // Declares the resource type in the format of {service}/{kind}. + # // For Kubernetes resources, the format is {api group}/{kind}. + # option (google.api.resource) = { + # type: "pubsub.googleapis.com/Topic" + # pattern: "projects/{project}/topics/{topic}" + # }; + # } + # + # The ResourceDescriptor Yaml config will look like: + # + # resources: + # - type: "pubsub.googleapis.com/Topic" + # pattern: "projects/{project}/topics/{topic}" + # + # Sometimes, resources have multiple patterns, typically because they can + # live under multiple parents. + # + # Example: + # + # message LogEntry { + # option (google.api.resource) = { + # type: "logging.googleapis.com/LogEntry" + # pattern: "projects/{project}/logs/{log}" + # pattern: "folders/{folder}/logs/{log}" + # pattern: "organizations/{organization}/logs/{log}" + # pattern: "billingAccounts/{billing_account}/logs/{log}" + # }; + # } + # + # The ResourceDescriptor Yaml config will look like: + # + # resources: + # - type: 'logging.googleapis.com/LogEntry' + # pattern: "projects/{project}/logs/{log}" + # pattern: "folders/{folder}/logs/{log}" + # pattern: "organizations/{organization}/logs/{log}" + # pattern: "billingAccounts/{billing_account}/logs/{log}" + # @!attribute [rw] type + # @return [::String] + # The resource type. It must be in the format of + # \\{service_name}/\\{resource_type_kind}. The `resource_type_kind` must be + # singular and must not include version numbers. + # + # Example: `storage.googleapis.com/Bucket` + # + # The value of the resource_type_kind must follow the regular expression + # /[A-Za-z][a-zA-Z0-9]+/. It should start with an upper case character and + # should use PascalCase (UpperCamelCase). The maximum number of + # characters allowed for the `resource_type_kind` is 100. + # @!attribute [rw] pattern + # @return [::Array<::String>] + # Optional. The relative resource name pattern associated with this resource + # type. The DNS prefix of the full resource name shouldn't be specified here. + # + # The path pattern must follow the syntax, which aligns with HTTP binding + # syntax: + # + # Template = Segment { "/" Segment } ; + # Segment = LITERAL | Variable ; + # Variable = "{" LITERAL "}" ; + # + # Examples: + # + # - "projects/\\{project}/topics/\\{topic}" + # - "projects/\\{project}/knowledgeBases/\\{knowledge_base}" + # + # The components in braces correspond to the IDs for each resource in the + # hierarchy. It is expected that, if multiple patterns are provided, + # the same component name (e.g. "project") refers to IDs of the same + # type of resource. + # @!attribute [rw] name_field + # @return [::String] + # Optional. The field on the resource that designates the resource name + # field. If omitted, this is assumed to be "name". + # @!attribute [rw] history + # @return [::Google::Api::ResourceDescriptor::History] + # Optional. The historical or future-looking state of the resource pattern. + # + # Example: + # + # // The InspectTemplate message originally only supported resource + # // names with organization, and project was added later. + # message InspectTemplate { + # option (google.api.resource) = { + # type: "dlp.googleapis.com/InspectTemplate" + # pattern: + # "organizations/{organization}/inspectTemplates/{inspect_template}" + # pattern: "projects/{project}/inspectTemplates/{inspect_template}" + # history: ORIGINALLY_SINGLE_PATTERN + # }; + # } + # @!attribute [rw] plural + # @return [::String] + # The plural name used in the resource name and permission names, such as + # 'projects' for the resource name of 'projects/\\{project}' and the permission + # name of 'cloudresourcemanager.googleapis.com/projects.get'. One exception + # to this is for Nested Collections that have stuttering names, as defined + # in [AIP-122](https://google.aip.dev/122#nested-collections), where the + # collection ID in the resource name pattern does not necessarily directly + # match the `plural` value. + # + # It is the same concept of the `plural` field in k8s CRD spec + # https://kubernetes.io/docs/tasks/access-kubernetes-api/custom-resources/custom-resource-definitions/ + # + # Note: The plural form is required even for singleton resources. See + # https://aip.dev/156 + # @!attribute [rw] singular + # @return [::String] + # The same concept of the `singular` field in k8s CRD spec + # https://kubernetes.io/docs/tasks/access-kubernetes-api/custom-resources/custom-resource-definitions/ + # Such as "project" for the `resourcemanager.googleapis.com/Project` type. + # @!attribute [rw] style + # @return [::Array<::Google::Api::ResourceDescriptor::Style>] + # Style flag(s) for this resource. + # These indicate that a resource is expected to conform to a given + # style. See the specific style flags for additional information. + class ResourceDescriptor + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # A description of the historical or future-looking state of the + # resource pattern. + module History + # The "unset" value. + HISTORY_UNSPECIFIED = 0 + + # The resource originally had one pattern and launched as such, and + # additional patterns were added later. + ORIGINALLY_SINGLE_PATTERN = 1 + + # The resource has one pattern, but the API owner expects to add more + # later. (This is the inverse of ORIGINALLY_SINGLE_PATTERN, and prevents + # that from being necessary once there are multiple patterns.) + FUTURE_MULTI_PATTERN = 2 + end + + # A flag representing a specific style that a resource claims to conform to. + module Style + # The unspecified value. Do not use. + STYLE_UNSPECIFIED = 0 + + # This resource is intended to be "declarative-friendly". + # + # Declarative-friendly resources must be more strictly consistent, and + # setting this to true communicates to tools that this resource should + # adhere to declarative-friendly expectations. + # + # Note: This is used by the API linter (linter.aip.dev) to enable + # additional checks. + DECLARATIVE_FRIENDLY = 1 + end + end + + # Defines a proto annotation that describes a string field that refers to + # an API resource. + # @!attribute [rw] type + # @return [::String] + # The resource type that the annotated field references. + # + # Example: + # + # message Subscription { + # string topic = 2 [(google.api.resource_reference) = { + # type: "pubsub.googleapis.com/Topic" + # }]; + # } + # + # Occasionally, a field may reference an arbitrary resource. In this case, + # APIs use the special value * in their resource reference. + # + # Example: + # + # message GetIamPolicyRequest { + # string resource = 2 [(google.api.resource_reference) = { + # type: "*" + # }]; + # } + # @!attribute [rw] child_type + # @return [::String] + # The resource type of a child collection that the annotated field + # references. This is useful for annotating the `parent` field that + # doesn't have a fixed resource type. + # + # Example: + # + # message ListLogEntriesRequest { + # string parent = 1 [(google.api.resource_reference) = { + # child_type: "logging.googleapis.com/LogEntry" + # }; + # } + class ResourceReference + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end +end diff --git a/owl-bot-staging/google-cloud-security-private_ca-v1beta1/proto_docs/google/cloud/security/privateca/v1beta1/resources.rb b/owl-bot-staging/google-cloud-security-private_ca-v1beta1/proto_docs/google/cloud/security/privateca/v1beta1/resources.rb new file mode 100644 index 000000000000..195a33eff695 --- /dev/null +++ b/owl-bot-staging/google-cloud-security-private_ca-v1beta1/proto_docs/google/cloud/security/privateca/v1beta1/resources.rb @@ -0,0 +1,1001 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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 Security + module PrivateCA + module V1beta1 + # A {::Google::Cloud::Security::PrivateCA::V1beta1::CertificateAuthority CertificateAuthority} represents an individual Certificate Authority. + # A {::Google::Cloud::Security::PrivateCA::V1beta1::CertificateAuthority CertificateAuthority} can be used to create {::Google::Cloud::Security::PrivateCA::V1beta1::Certificate Certificates}. + # @!attribute [r] name + # @return [::String] + # Output only. The resource name for this {::Google::Cloud::Security::PrivateCA::V1beta1::CertificateAuthority CertificateAuthority} in the + # format `projects/*/locations/*/certificateAuthorities/*`. + # @!attribute [rw] type + # @return [::Google::Cloud::Security::PrivateCA::V1beta1::CertificateAuthority::Type] + # Required. Immutable. The {::Google::Cloud::Security::PrivateCA::V1beta1::CertificateAuthority::Type Type} of this {::Google::Cloud::Security::PrivateCA::V1beta1::CertificateAuthority CertificateAuthority}. + # @!attribute [rw] tier + # @return [::Google::Cloud::Security::PrivateCA::V1beta1::CertificateAuthority::Tier] + # Required. Immutable. The {::Google::Cloud::Security::PrivateCA::V1beta1::CertificateAuthority::Tier Tier} of this {::Google::Cloud::Security::PrivateCA::V1beta1::CertificateAuthority CertificateAuthority}. + # @!attribute [rw] config + # @return [::Google::Cloud::Security::PrivateCA::V1beta1::CertificateConfig] + # Required. Immutable. The config used to create a self-signed X.509 certificate or CSR. + # @!attribute [rw] lifetime + # @return [::Google::Protobuf::Duration] + # Required. The desired lifetime of the CA certificate. Used to create the + # "not_before_time" and "not_after_time" fields inside an X.509 + # certificate. + # @!attribute [rw] key_spec + # @return [::Google::Cloud::Security::PrivateCA::V1beta1::CertificateAuthority::KeyVersionSpec] + # Required. Immutable. Used when issuing certificates for this {::Google::Cloud::Security::PrivateCA::V1beta1::CertificateAuthority CertificateAuthority}. If this + # {::Google::Cloud::Security::PrivateCA::V1beta1::CertificateAuthority CertificateAuthority} is a self-signed CertificateAuthority, this key + # is also used to sign the self-signed CA certificate. Otherwise, it + # is used to sign a CSR. + # @!attribute [rw] certificate_policy + # @return [::Google::Cloud::Security::PrivateCA::V1beta1::CertificateAuthority::CertificateAuthorityPolicy] + # Optional. The {::Google::Cloud::Security::PrivateCA::V1beta1::CertificateAuthority::CertificateAuthorityPolicy CertificateAuthorityPolicy} to enforce when issuing + # {::Google::Cloud::Security::PrivateCA::V1beta1::Certificate Certificates} from this {::Google::Cloud::Security::PrivateCA::V1beta1::CertificateAuthority CertificateAuthority}. + # @!attribute [rw] issuing_options + # @return [::Google::Cloud::Security::PrivateCA::V1beta1::CertificateAuthority::IssuingOptions] + # Optional. The {::Google::Cloud::Security::PrivateCA::V1beta1::CertificateAuthority::IssuingOptions IssuingOptions} to follow when issuing {::Google::Cloud::Security::PrivateCA::V1beta1::Certificate Certificates} + # from this {::Google::Cloud::Security::PrivateCA::V1beta1::CertificateAuthority CertificateAuthority}. + # @!attribute [rw] subordinate_config + # @return [::Google::Cloud::Security::PrivateCA::V1beta1::SubordinateConfig] + # Optional. If this is a subordinate {::Google::Cloud::Security::PrivateCA::V1beta1::CertificateAuthority CertificateAuthority}, this field will be set + # with the subordinate configuration, which describes its issuers. This may + # be updated, but this {::Google::Cloud::Security::PrivateCA::V1beta1::CertificateAuthority CertificateAuthority} must continue to validate. + # @!attribute [r] state + # @return [::Google::Cloud::Security::PrivateCA::V1beta1::CertificateAuthority::State] + # Output only. The {::Google::Cloud::Security::PrivateCA::V1beta1::CertificateAuthority::State State} for this {::Google::Cloud::Security::PrivateCA::V1beta1::CertificateAuthority CertificateAuthority}. + # @!attribute [r] pem_ca_certificates + # @return [::Array<::String>] + # Output only. This {::Google::Cloud::Security::PrivateCA::V1beta1::CertificateAuthority CertificateAuthority}'s certificate chain, including the current + # {::Google::Cloud::Security::PrivateCA::V1beta1::CertificateAuthority CertificateAuthority}'s certificate. Ordered such that the root issuer + # is the final element (consistent with RFC 5246). For a self-signed CA, this + # will only list the current {::Google::Cloud::Security::PrivateCA::V1beta1::CertificateAuthority CertificateAuthority}'s certificate. + # @!attribute [r] ca_certificate_descriptions + # @return [::Array<::Google::Cloud::Security::PrivateCA::V1beta1::CertificateDescription>] + # Output only. A structured description of this {::Google::Cloud::Security::PrivateCA::V1beta1::CertificateAuthority CertificateAuthority}'s CA certificate + # and its issuers. Ordered as self-to-root. + # @!attribute [rw] gcs_bucket + # @return [::String] + # Immutable. The name of a Cloud Storage bucket where this {::Google::Cloud::Security::PrivateCA::V1beta1::CertificateAuthority CertificateAuthority} will + # publish content, such as the CA certificate and CRLs. This must be a bucket + # name, without any prefixes (such as `gs://`) or suffixes (such as + # `.googleapis.com`). For example, to use a bucket named `my-bucket`, you + # would simply specify `my-bucket`. If not specified, a managed bucket will + # be created. + # @!attribute [r] access_urls + # @return [::Google::Cloud::Security::PrivateCA::V1beta1::CertificateAuthority::AccessUrls] + # Output only. URLs for accessing content published by this CA, such as the CA certificate + # and CRLs. + # @!attribute [r] create_time + # @return [::Google::Protobuf::Timestamp] + # Output only. The time at which this {::Google::Cloud::Security::PrivateCA::V1beta1::CertificateAuthority CertificateAuthority} was created. + # @!attribute [r] update_time + # @return [::Google::Protobuf::Timestamp] + # Output only. The time at which this {::Google::Cloud::Security::PrivateCA::V1beta1::CertificateAuthority CertificateAuthority} was updated. + # @!attribute [r] delete_time + # @return [::Google::Protobuf::Timestamp] + # Output only. The time at which this {::Google::Cloud::Security::PrivateCA::V1beta1::CertificateAuthority CertificateAuthority} will be deleted, if + # scheduled for deletion. + # @!attribute [rw] labels + # @return [::Google::Protobuf::Map{::String => ::String}] + # Optional. Labels with user-defined metadata. + class CertificateAuthority + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # Options that affect all certificates issued by a {::Google::Cloud::Security::PrivateCA::V1beta1::CertificateAuthority CertificateAuthority}. + # @!attribute [rw] include_ca_cert_url + # @return [::Boolean] + # Required. When true, includes a URL to the issuing CA certificate in the + # "authority information access" X.509 extension. + # @!attribute [rw] include_crl_access_url + # @return [::Boolean] + # Required. When true, includes a URL to the CRL corresponding to certificates + # issued from a {::Google::Cloud::Security::PrivateCA::V1beta1::CertificateAuthority CertificateAuthority}. + # CRLs will expire 7 days from their creation. However, we will rebuild + # daily. CRLs are also rebuilt shortly after a certificate is revoked. + class IssuingOptions + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # The issuing policy for a {::Google::Cloud::Security::PrivateCA::V1beta1::CertificateAuthority CertificateAuthority}. + # {::Google::Cloud::Security::PrivateCA::V1beta1::Certificate Certificates} will not be successfully issued from this + # {::Google::Cloud::Security::PrivateCA::V1beta1::CertificateAuthority CertificateAuthority} if they violate the policy. + # @!attribute [rw] allowed_config_list + # @return [::Google::Cloud::Security::PrivateCA::V1beta1::CertificateAuthority::CertificateAuthorityPolicy::AllowedConfigList] + # Optional. All {::Google::Cloud::Security::PrivateCA::V1beta1::Certificate Certificates} issued by the {::Google::Cloud::Security::PrivateCA::V1beta1::CertificateAuthority CertificateAuthority} + # must match at least one listed {::Google::Cloud::Security::PrivateCA::V1beta1::ReusableConfigWrapper ReusableConfigWrapper} in the list. + # + # Note: The following fields are mutually exclusive: `allowed_config_list`, `overwrite_config_values`. If a field in that set is populated, all other fields in the set will automatically be cleared. + # @!attribute [rw] overwrite_config_values + # @return [::Google::Cloud::Security::PrivateCA::V1beta1::ReusableConfigWrapper] + # Optional. All {::Google::Cloud::Security::PrivateCA::V1beta1::Certificate Certificates} issued by the {::Google::Cloud::Security::PrivateCA::V1beta1::CertificateAuthority CertificateAuthority} + # will use the provided configuration values, overwriting any requested + # configuration values. + # + # Note: The following fields are mutually exclusive: `overwrite_config_values`, `allowed_config_list`. If a field in that set is populated, all other fields in the set will automatically be cleared. + # @!attribute [rw] allowed_locations_and_organizations + # @return [::Array<::Google::Cloud::Security::PrivateCA::V1beta1::Subject>] + # Optional. If any {::Google::Cloud::Security::PrivateCA::V1beta1::Subject Subject} is specified here, then all + # {::Google::Cloud::Security::PrivateCA::V1beta1::Certificate Certificates} issued by the {::Google::Cloud::Security::PrivateCA::V1beta1::CertificateAuthority CertificateAuthority} must + # match at least one listed {::Google::Cloud::Security::PrivateCA::V1beta1::Subject Subject}. If a {::Google::Cloud::Security::PrivateCA::V1beta1::Subject Subject} has an empty + # field, any value will be allowed for that field. + # @!attribute [rw] allowed_common_names + # @return [::Array<::String>] + # Optional. If any value is specified here, then all + # {::Google::Cloud::Security::PrivateCA::V1beta1::Certificate Certificates} issued by the {::Google::Cloud::Security::PrivateCA::V1beta1::CertificateAuthority CertificateAuthority} must + # match at least one listed value. If no value is specified, all values + # will be allowed for this fied. Glob patterns are also supported. + # @!attribute [rw] allowed_sans + # @return [::Google::Cloud::Security::PrivateCA::V1beta1::CertificateAuthority::CertificateAuthorityPolicy::AllowedSubjectAltNames] + # Optional. If a {::Google::Cloud::Security::PrivateCA::V1beta1::CertificateAuthority::CertificateAuthorityPolicy::AllowedSubjectAltNames AllowedSubjectAltNames} is specified here, then all + # {::Google::Cloud::Security::PrivateCA::V1beta1::Certificate Certificates} issued by the {::Google::Cloud::Security::PrivateCA::V1beta1::CertificateAuthority CertificateAuthority} must + # match {::Google::Cloud::Security::PrivateCA::V1beta1::CertificateAuthority::CertificateAuthorityPolicy::AllowedSubjectAltNames AllowedSubjectAltNames}. If no value or an empty value + # is specified, any value will be allowed for the {::Google::Cloud::Security::PrivateCA::V1beta1::SubjectAltNames SubjectAltNames} + # field. + # @!attribute [rw] maximum_lifetime + # @return [::Google::Protobuf::Duration] + # Optional. The maximum lifetime allowed by the {::Google::Cloud::Security::PrivateCA::V1beta1::CertificateAuthority CertificateAuthority}. Note that + # if the any part if the issuing chain expires before a {::Google::Cloud::Security::PrivateCA::V1beta1::Certificate Certificate}'s + # requested maximum_lifetime, the effective lifetime will be explicitly + # truncated. + # @!attribute [rw] allowed_issuance_modes + # @return [::Google::Cloud::Security::PrivateCA::V1beta1::CertificateAuthority::CertificateAuthorityPolicy::IssuanceModes] + # Optional. If specified, then only methods allowed in the {::Google::Cloud::Security::PrivateCA::V1beta1::CertificateAuthority::CertificateAuthorityPolicy::IssuanceModes IssuanceModes} may be + # used to issue {::Google::Cloud::Security::PrivateCA::V1beta1::Certificate Certificates}. + class CertificateAuthorityPolicy + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # @!attribute [rw] allowed_config_values + # @return [::Array<::Google::Cloud::Security::PrivateCA::V1beta1::ReusableConfigWrapper>] + # Required. All {::Google::Cloud::Security::PrivateCA::V1beta1::Certificate Certificates} issued by the {::Google::Cloud::Security::PrivateCA::V1beta1::CertificateAuthority CertificateAuthority} + # must match at least one listed {::Google::Cloud::Security::PrivateCA::V1beta1::ReusableConfigWrapper ReusableConfigWrapper}. If a + # {::Google::Cloud::Security::PrivateCA::V1beta1::ReusableConfigWrapper ReusableConfigWrapper} has an empty field, any value will be + # allowed for that field. + class AllowedConfigList + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # {::Google::Cloud::Security::PrivateCA::V1beta1::CertificateAuthority::CertificateAuthorityPolicy::AllowedSubjectAltNames AllowedSubjectAltNames} specifies the allowed values for + # {::Google::Cloud::Security::PrivateCA::V1beta1::SubjectAltNames SubjectAltNames} by the {::Google::Cloud::Security::PrivateCA::V1beta1::CertificateAuthority CertificateAuthority} when issuing + # {::Google::Cloud::Security::PrivateCA::V1beta1::Certificate Certificates}. + # @!attribute [rw] allowed_dns_names + # @return [::Array<::String>] + # Optional. Contains valid, fully-qualified host names. Glob patterns are also + # supported. To allow an explicit wildcard certificate, escape with + # backlash (i.e. `\*`). + # E.g. for globbed entries: `*bar.com` will allow `foo.bar.com`, but not + # `*.bar.com`, unless the {::Google::Cloud::Security::PrivateCA::V1beta1::CertificateAuthority::CertificateAuthorityPolicy::AllowedSubjectAltNames#allow_globbing_dns_wildcards allow_globbing_dns_wildcards} field is set. + # E.g. for wildcard entries: `\*.bar.com` will allow `*.bar.com`, but not + # `foo.bar.com`. + # @!attribute [rw] allowed_uris + # @return [::Array<::String>] + # Optional. Contains valid RFC 3986 URIs. Glob patterns are also supported. To + # match across path seperators (i.e. '/') use the double star glob + # pattern (i.e. '**'). + # @!attribute [rw] allowed_email_addresses + # @return [::Array<::String>] + # Optional. Contains valid RFC 2822 E-mail addresses. Glob patterns are also + # supported. + # @!attribute [rw] allowed_ips + # @return [::Array<::String>] + # Optional. Contains valid 32-bit IPv4 addresses and subnet ranges or RFC 4291 IPv6 + # addresses and subnet ranges. Subnet ranges are specified using the + # '/' notation (e.g. 10.0.0.0/8, 2001:700:300:1800::/64). Glob patterns + # are supported only for ip address entries (i.e. not for subnet ranges). + # @!attribute [rw] allow_globbing_dns_wildcards + # @return [::Boolean] + # Optional. Specifies if glob patterns used for {::Google::Cloud::Security::PrivateCA::V1beta1::CertificateAuthority::CertificateAuthorityPolicy::AllowedSubjectAltNames#allowed_dns_names allowed_dns_names} allows + # wildcard certificates. + # @!attribute [rw] allow_custom_sans + # @return [::Boolean] + # Optional. Specifies if to allow custom X509Extension values. + class AllowedSubjectAltNames + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # {::Google::Cloud::Security::PrivateCA::V1beta1::CertificateAuthority::CertificateAuthorityPolicy::IssuanceModes IssuanceModes} specifies the allowed ways in which + # {::Google::Cloud::Security::PrivateCA::V1beta1::Certificate Certificates} may be requested from this + # {::Google::Cloud::Security::PrivateCA::V1beta1::CertificateAuthority CertificateAuthority}. + # @!attribute [rw] allow_csr_based_issuance + # @return [::Boolean] + # Required. When true, allows callers to create {::Google::Cloud::Security::PrivateCA::V1beta1::Certificate Certificates} by + # specifying a CSR. + # @!attribute [rw] allow_config_based_issuance + # @return [::Boolean] + # Required. When true, allows callers to create {::Google::Cloud::Security::PrivateCA::V1beta1::Certificate Certificates} by + # specifying a {::Google::Cloud::Security::PrivateCA::V1beta1::CertificateConfig CertificateConfig}. + class IssuanceModes + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end + + # URLs where a {::Google::Cloud::Security::PrivateCA::V1beta1::CertificateAuthority CertificateAuthority} will publish content. + # @!attribute [rw] ca_certificate_access_url + # @return [::String] + # The URL where this {::Google::Cloud::Security::PrivateCA::V1beta1::CertificateAuthority CertificateAuthority}'s CA certificate is + # published. This will only be set for CAs that have been activated. + # @!attribute [rw] crl_access_url + # @return [::String] + # The URL where this {::Google::Cloud::Security::PrivateCA::V1beta1::CertificateAuthority CertificateAuthority}'s CRLs are published. This + # will only be set for CAs that have been activated. + class AccessUrls + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # A Cloud KMS key configuration that a {::Google::Cloud::Security::PrivateCA::V1beta1::CertificateAuthority CertificateAuthority} will use. + # @!attribute [rw] cloud_kms_key_version + # @return [::String] + # Required. The resource name for an existing Cloud KMS CryptoKeyVersion in the + # format + # `projects/*/locations/*/keyRings/*/cryptoKeys/*/cryptoKeyVersions/*`. + # This option enables full flexibility in the key's capabilities and + # properties. + # + # Note: The following fields are mutually exclusive: `cloud_kms_key_version`, `algorithm`. If a field in that set is populated, all other fields in the set will automatically be cleared. + # @!attribute [rw] algorithm + # @return [::Google::Cloud::Security::PrivateCA::V1beta1::CertificateAuthority::SignHashAlgorithm] + # Required. The algorithm to use for creating a managed Cloud KMS key for a for a + # simplified experience. All managed keys will be have their + # [ProtectionLevel][google.cloud.kms.v1.ProtectionLevel] as `HSM`. + # + # Note: The following fields are mutually exclusive: `algorithm`, `cloud_kms_key_version`. If a field in that set is populated, all other fields in the set will automatically be cleared. + class KeyVersionSpec + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # @!attribute [rw] key + # @return [::String] + # @!attribute [rw] value + # @return [::String] + class LabelsEntry + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # The type of a {::Google::Cloud::Security::PrivateCA::V1beta1::CertificateAuthority CertificateAuthority}, indicating its issuing chain. + module Type + # Not specified. + TYPE_UNSPECIFIED = 0 + + # Self-signed CA. + SELF_SIGNED = 1 + + # Subordinate CA. Could be issued by a Private CA {::Google::Cloud::Security::PrivateCA::V1beta1::CertificateAuthority CertificateAuthority} + # or an unmanaged CA. + SUBORDINATE = 2 + end + + # The tier of a {::Google::Cloud::Security::PrivateCA::V1beta1::CertificateAuthority CertificateAuthority}, indicating its supported + # functionality and/or billing SKU. + module Tier + # Not specified. + TIER_UNSPECIFIED = 0 + + # Enterprise tier. + ENTERPRISE = 1 + + # DevOps tier. + DEVOPS = 2 + end + + # The state of a {::Google::Cloud::Security::PrivateCA::V1beta1::CertificateAuthority CertificateAuthority}, indicating if it can be used. + module State + # Not specified. + STATE_UNSPECIFIED = 0 + + # Certificates can be issued from this CA. CRLs will be generated for this + # CA. + ENABLED = 1 + + # Certificates cannot be issued from this CA. CRLs will still be generated. + DISABLED = 2 + + # Certificates cannot be issued from this CA. CRLs will not be generated. + PENDING_ACTIVATION = 3 + + # Certificates cannot be issued from this CA. CRLs will not be generated. + PENDING_DELETION = 4 + end + + # The algorithm of a Cloud KMS CryptoKeyVersion of a + # [CryptoKey][google.cloud.kms.v1.CryptoKey] with the + # [CryptoKeyPurpose][google.cloud.kms.v1.CryptoKey.CryptoKeyPurpose] value + # `ASYMMETRIC_SIGN`. These values correspond to the + # [CryptoKeyVersionAlgorithm][google.cloud.kms.v1.CryptoKeyVersion.CryptoKeyVersionAlgorithm] + # values. For RSA signing algorithms, the PSS algorithms should be preferred, + # use PKCS1 algorithms if required for compatibility. For further + # recommandations, see + # https://cloud.google.com/kms/docs/algorithms#algorithm_recommendations. + module SignHashAlgorithm + # Not specified. + SIGN_HASH_ALGORITHM_UNSPECIFIED = 0 + + # maps to CryptoKeyVersionAlgorithm.RSA_SIGN_PSS_2048_SHA256 + RSA_PSS_2048_SHA256 = 1 + + # maps to CryptoKeyVersionAlgorithm. RSA_SIGN_PSS_3072_SHA256 + RSA_PSS_3072_SHA256 = 2 + + # maps to CryptoKeyVersionAlgorithm.RSA_SIGN_PSS_4096_SHA256 + RSA_PSS_4096_SHA256 = 3 + + # maps to CryptoKeyVersionAlgorithm.RSA_SIGN_PKCS1_2048_SHA256 + RSA_PKCS1_2048_SHA256 = 6 + + # maps to CryptoKeyVersionAlgorithm.RSA_SIGN_PKCS1_3072_SHA256 + RSA_PKCS1_3072_SHA256 = 7 + + # maps to CryptoKeyVersionAlgorithm.RSA_SIGN_PKCS1_4096_SHA256 + RSA_PKCS1_4096_SHA256 = 8 + + # maps to CryptoKeyVersionAlgorithm.EC_SIGN_P256_SHA256 + EC_P256_SHA256 = 4 + + # maps to CryptoKeyVersionAlgorithm.EC_SIGN_P384_SHA384 + EC_P384_SHA384 = 5 + end + end + + # A {::Google::Cloud::Security::PrivateCA::V1beta1::CertificateRevocationList CertificateRevocationList} corresponds to a signed X.509 certificate + # Revocation List (CRL). A CRL contains the serial numbers of certificates that + # should no longer be trusted. + # @!attribute [r] name + # @return [::String] + # Output only. The resource path for this {::Google::Cloud::Security::PrivateCA::V1beta1::CertificateRevocationList CertificateRevocationList} in + # the format + # `projects/*/locations/*/certificateAuthorities/*/ + # certificateRevocationLists/*`. + # @!attribute [r] sequence_number + # @return [::Integer] + # Output only. The CRL sequence number that appears in pem_crl. + # @!attribute [r] revoked_certificates + # @return [::Array<::Google::Cloud::Security::PrivateCA::V1beta1::CertificateRevocationList::RevokedCertificate>] + # Output only. The revoked serial numbers that appear in pem_crl. + # @!attribute [r] pem_crl + # @return [::String] + # Output only. The PEM-encoded X.509 CRL. + # @!attribute [r] access_url + # @return [::String] + # Output only. The location where 'pem_crl' can be accessed. + # @!attribute [r] state + # @return [::Google::Cloud::Security::PrivateCA::V1beta1::CertificateRevocationList::State] + # Output only. The {::Google::Cloud::Security::PrivateCA::V1beta1::CertificateRevocationList::State State} for this {::Google::Cloud::Security::PrivateCA::V1beta1::CertificateRevocationList CertificateRevocationList}. + # @!attribute [r] create_time + # @return [::Google::Protobuf::Timestamp] + # Output only. The time at which this {::Google::Cloud::Security::PrivateCA::V1beta1::CertificateRevocationList CertificateRevocationList} was created. + # @!attribute [r] update_time + # @return [::Google::Protobuf::Timestamp] + # Output only. The time at which this {::Google::Cloud::Security::PrivateCA::V1beta1::CertificateRevocationList CertificateRevocationList} was updated. + # @!attribute [rw] labels + # @return [::Google::Protobuf::Map{::String => ::String}] + # Optional. Labels with user-defined metadata. + class CertificateRevocationList + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # Describes a revoked {::Google::Cloud::Security::PrivateCA::V1beta1::Certificate Certificate}. + # @!attribute [rw] certificate + # @return [::String] + # The resource path for the {::Google::Cloud::Security::PrivateCA::V1beta1::Certificate Certificate} in the format + # `projects/*/locations/*/certificateAuthorities/*/certificates/*`. + # @!attribute [rw] hex_serial_number + # @return [::String] + # The serial number of the {::Google::Cloud::Security::PrivateCA::V1beta1::Certificate Certificate}. + # @!attribute [rw] revocation_reason + # @return [::Google::Cloud::Security::PrivateCA::V1beta1::RevocationReason] + # The reason the {::Google::Cloud::Security::PrivateCA::V1beta1::Certificate Certificate} was revoked. + class RevokedCertificate + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # @!attribute [rw] key + # @return [::String] + # @!attribute [rw] value + # @return [::String] + class LabelsEntry + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # The state of a {::Google::Cloud::Security::PrivateCA::V1beta1::CertificateRevocationList CertificateRevocationList}, indicating if it is current. + module State + # Not specified. + STATE_UNSPECIFIED = 0 + + # The {::Google::Cloud::Security::PrivateCA::V1beta1::CertificateRevocationList CertificateRevocationList} is up to date. + ACTIVE = 1 + + # The {::Google::Cloud::Security::PrivateCA::V1beta1::CertificateRevocationList CertificateRevocationList} is no longer current. + SUPERSEDED = 2 + end + end + + # A {::Google::Cloud::Security::PrivateCA::V1beta1::Certificate Certificate} corresponds to a signed X.509 certificate issued by a + # {::Google::Cloud::Security::PrivateCA::V1beta1::CertificateAuthority CertificateAuthority}. + # @!attribute [r] name + # @return [::String] + # Output only. The resource path for this {::Google::Cloud::Security::PrivateCA::V1beta1::Certificate Certificate} in the format + # `projects/*/locations/*/certificateAuthorities/*/certificates/*`. + # @!attribute [rw] pem_csr + # @return [::String] + # Immutable. A pem-encoded X.509 certificate signing request (CSR). + # + # Note: The following fields are mutually exclusive: `pem_csr`, `config`. If a field in that set is populated, all other fields in the set will automatically be cleared. + # @!attribute [rw] config + # @return [::Google::Cloud::Security::PrivateCA::V1beta1::CertificateConfig] + # Immutable. A description of the certificate and key that does not require X.509 or + # ASN.1. + # + # Note: The following fields are mutually exclusive: `config`, `pem_csr`. If a field in that set is populated, all other fields in the set will automatically be cleared. + # @!attribute [rw] lifetime + # @return [::Google::Protobuf::Duration] + # Required. Immutable. The desired lifetime of a certificate. Used to create the + # "not_before_time" and "not_after_time" fields inside an X.509 + # certificate. Note that the lifetime may be truncated if it would extend + # past the life of any certificate authority in the issuing chain. + # @!attribute [r] revocation_details + # @return [::Google::Cloud::Security::PrivateCA::V1beta1::Certificate::RevocationDetails] + # Output only. Details regarding the revocation of this {::Google::Cloud::Security::PrivateCA::V1beta1::Certificate Certificate}. This + # {::Google::Cloud::Security::PrivateCA::V1beta1::Certificate Certificate} is considered revoked if and only if this field is present. + # @!attribute [r] pem_certificate + # @return [::String] + # Output only. The pem-encoded, signed X.509 certificate. + # @!attribute [r] certificate_description + # @return [::Google::Cloud::Security::PrivateCA::V1beta1::CertificateDescription] + # Output only. A structured description of the issued X.509 certificate. + # @!attribute [r] pem_certificate_chain + # @return [::Array<::String>] + # Output only. The chain that may be used to verify the X.509 certificate. Expected to be + # in issuer-to-root order according to RFC 5246. + # @!attribute [r] create_time + # @return [::Google::Protobuf::Timestamp] + # Output only. The time at which this {::Google::Cloud::Security::PrivateCA::V1beta1::Certificate Certificate} was created. + # @!attribute [r] update_time + # @return [::Google::Protobuf::Timestamp] + # Output only. The time at which this {::Google::Cloud::Security::PrivateCA::V1beta1::Certificate Certificate} was updated. + # @!attribute [rw] labels + # @return [::Google::Protobuf::Map{::String => ::String}] + # Optional. Labels with user-defined metadata. + class Certificate + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # Describes fields that are relavent to the revocation of a {::Google::Cloud::Security::PrivateCA::V1beta1::Certificate Certificate}. + # @!attribute [rw] revocation_state + # @return [::Google::Cloud::Security::PrivateCA::V1beta1::RevocationReason] + # Indicates why a {::Google::Cloud::Security::PrivateCA::V1beta1::Certificate Certificate} was revoked. + # @!attribute [rw] revocation_time + # @return [::Google::Protobuf::Timestamp] + # The time at which this {::Google::Cloud::Security::PrivateCA::V1beta1::Certificate Certificate} was revoked. + class RevocationDetails + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # @!attribute [rw] key + # @return [::String] + # @!attribute [rw] value + # @return [::String] + class LabelsEntry + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end + + # A {::Google::Cloud::Security::PrivateCA::V1beta1::ReusableConfig ReusableConfig} refers to a managed {::Google::Cloud::Security::PrivateCA::V1beta1::ReusableConfigValues ReusableConfigValues}. Those, in + # turn, are used to describe certain fields of an X.509 certificate, such as + # the key usage fields, fields specific to CA certificates, certificate policy + # extensions and custom extensions. + # @!attribute [r] name + # @return [::String] + # Output only. The resource path for this {::Google::Cloud::Security::PrivateCA::V1beta1::ReusableConfig ReusableConfig} in the format + # `projects/*/locations/*/reusableConfigs/*`. + # @!attribute [rw] values + # @return [::Google::Cloud::Security::PrivateCA::V1beta1::ReusableConfigValues] + # Required. The config values. + # @!attribute [rw] description + # @return [::String] + # Optional. A human-readable description of scenarios these ReusableConfigValues may be + # compatible with. + # @!attribute [r] create_time + # @return [::Google::Protobuf::Timestamp] + # Output only. The time at which this {::Google::Cloud::Security::PrivateCA::V1beta1::ReusableConfig ReusableConfig} was created. + # @!attribute [r] update_time + # @return [::Google::Protobuf::Timestamp] + # Output only. The time at which this {::Google::Cloud::Security::PrivateCA::V1beta1::ReusableConfig ReusableConfig} was updated. + # @!attribute [rw] labels + # @return [::Google::Protobuf::Map{::String => ::String}] + # Optional. Labels with user-defined metadata. + class ReusableConfig + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # @!attribute [rw] key + # @return [::String] + # @!attribute [rw] value + # @return [::String] + class LabelsEntry + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end + + # A {::Google::Cloud::Security::PrivateCA::V1beta1::ReusableConfigValues ReusableConfigValues} is used to describe certain fields of an + # X.509 certificate, such as the key usage fields, fields specific to CA + # certificates, certificate policy extensions and custom extensions. + # @!attribute [rw] key_usage + # @return [::Google::Cloud::Security::PrivateCA::V1beta1::KeyUsage] + # Optional. Indicates the intended use for keys that correspond to a certificate. + # @!attribute [rw] ca_options + # @return [::Google::Cloud::Security::PrivateCA::V1beta1::ReusableConfigValues::CaOptions] + # Optional. Describes options in this {::Google::Cloud::Security::PrivateCA::V1beta1::ReusableConfigValues ReusableConfigValues} that are + # relevant in a CA certificate. + # @!attribute [rw] policy_ids + # @return [::Array<::Google::Cloud::Security::PrivateCA::V1beta1::ObjectId>] + # Optional. Describes the X.509 certificate policy object identifiers, per + # https://tools.ietf.org/html/rfc5280#section-4.2.1.4. + # @!attribute [rw] aia_ocsp_servers + # @return [::Array<::String>] + # Optional. Describes Online Certificate Status Protocol (OCSP) endpoint addresses + # that appear in the "Authority Information Access" extension in the + # certificate. + # @!attribute [rw] additional_extensions + # @return [::Array<::Google::Cloud::Security::PrivateCA::V1beta1::X509Extension>] + # Optional. Describes custom X.509 extensions. + class ReusableConfigValues + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # Describes values that are relevant in a CA certificate. + # @!attribute [rw] is_ca + # @return [::Google::Protobuf::BoolValue] + # Optional. Refers to the "CA" X.509 extension, which is a boolean value. When this + # value is missing, the extension will be omitted from the CA certificate. + # @!attribute [rw] max_issuer_path_length + # @return [::Google::Protobuf::Int32Value] + # Optional. Refers to the path length restriction X.509 extension. For a CA + # certificate, this value describes the depth of subordinate CA + # certificates that are allowed. + # If this value is less than 0, the request will fail. + # If this value is missing, the max path length will be omitted from the + # CA certificate. + class CaOptions + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end + + # A {::Google::Cloud::Security::PrivateCA::V1beta1::ReusableConfigWrapper ReusableConfigWrapper} describes values that may assist in creating an + # X.509 certificate, or a reference to a pre-defined set of values. + # @!attribute [rw] reusable_config + # @return [::String] + # Required. A resource path to a {::Google::Cloud::Security::PrivateCA::V1beta1::ReusableConfig ReusableConfig} in the format + # `projects/*/locations/*/reusableConfigs/*`. + # + # Note: The following fields are mutually exclusive: `reusable_config`, `reusable_config_values`. If a field in that set is populated, all other fields in the set will automatically be cleared. + # @!attribute [rw] reusable_config_values + # @return [::Google::Cloud::Security::PrivateCA::V1beta1::ReusableConfigValues] + # Required. A user-specified inline {::Google::Cloud::Security::PrivateCA::V1beta1::ReusableConfigValues ReusableConfigValues}. + # + # Note: The following fields are mutually exclusive: `reusable_config_values`, `reusable_config`. If a field in that set is populated, all other fields in the set will automatically be cleared. + class ReusableConfigWrapper + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Describes a subordinate CA's issuers. This is either a resource path to a + # known issuing {::Google::Cloud::Security::PrivateCA::V1beta1::CertificateAuthority CertificateAuthority}, or a PEM issuer certificate chain. + # @!attribute [rw] certificate_authority + # @return [::String] + # Required. This can refer to a {::Google::Cloud::Security::PrivateCA::V1beta1::CertificateAuthority CertificateAuthority} in the same project that + # was used to create a subordinate {::Google::Cloud::Security::PrivateCA::V1beta1::CertificateAuthority CertificateAuthority}. This field + # is used for information and usability purposes only. The resource name + # is in the format `projects/*/locations/*/certificateAuthorities/*`. + # + # Note: The following fields are mutually exclusive: `certificate_authority`, `pem_issuer_chain`. If a field in that set is populated, all other fields in the set will automatically be cleared. + # @!attribute [rw] pem_issuer_chain + # @return [::Google::Cloud::Security::PrivateCA::V1beta1::SubordinateConfig::SubordinateConfigChain] + # Required. Contains the PEM certificate chain for the issuers of this + # {::Google::Cloud::Security::PrivateCA::V1beta1::CertificateAuthority CertificateAuthority}, but not pem certificate for this CA itself. + # + # Note: The following fields are mutually exclusive: `pem_issuer_chain`, `certificate_authority`. If a field in that set is populated, all other fields in the set will automatically be cleared. + class SubordinateConfig + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # This message describes a subordinate CA's issuer certificate chain. This + # wrapper exists for compatibility reasons. + # @!attribute [rw] pem_certificates + # @return [::Array<::String>] + # Required. Expected to be in leaf-to-root order according to RFC 5246. + class SubordinateConfigChain + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end + + # A {::Google::Cloud::Security::PrivateCA::V1beta1::PublicKey PublicKey} describes a public key. + # @!attribute [rw] type + # @return [::Google::Cloud::Security::PrivateCA::V1beta1::PublicKey::KeyType] + # Required. The type of public key. + # @!attribute [rw] key + # @return [::String] + # Required. A public key. Padding and encoding varies by 'KeyType' and is described + # along with the KeyType values. + class PublicKey + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # Types of public keys that are supported. + # At a minimum, we support RSA and ECDSA, for the key sizes or curves listed: + # https://cloud.google.com/kms/docs/algorithms#asymmetric_signing_algorithms + module KeyType + # Default unspecified value. + KEY_TYPE_UNSPECIFIED = 0 + + # A PEM-encoded PKCS#1/RFC 3447 RSAPrivateKey structure. + PEM_RSA_KEY = 1 + + # A PEM-encoded compressed NIST P-256/secp256r1/prime256v1 or P-384 key. + PEM_EC_KEY = 2 + end + end + + # A {::Google::Cloud::Security::PrivateCA::V1beta1::CertificateConfig CertificateConfig} describes an X.509 certificate or CSR that is to be + # created, as an alternative to using ASN.1. + # @!attribute [rw] subject_config + # @return [::Google::Cloud::Security::PrivateCA::V1beta1::CertificateConfig::SubjectConfig] + # Required. Specifies some of the values in a certificate that are related to the + # subject. + # @!attribute [rw] reusable_config + # @return [::Google::Cloud::Security::PrivateCA::V1beta1::ReusableConfigWrapper] + # Required. Describes how some of the technical fields in a certificate should be + # populated. + # @!attribute [rw] public_key + # @return [::Google::Cloud::Security::PrivateCA::V1beta1::PublicKey] + # Optional. The public key that corresponds to this config. This is, for example, used + # when issuing {::Google::Cloud::Security::PrivateCA::V1beta1::Certificate Certificates}, but not when creating a + # self-signed {::Google::Cloud::Security::PrivateCA::V1beta1::CertificateAuthority CertificateAuthority} or {::Google::Cloud::Security::PrivateCA::V1beta1::CertificateAuthority CertificateAuthority} CSR. + class CertificateConfig + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # These values are used to create the distinguished name and subject + # alternative name fields in an X.509 certificate. + # @!attribute [rw] subject + # @return [::Google::Cloud::Security::PrivateCA::V1beta1::Subject] + # Required. Contains distinguished name fields such as the location and organization. + # @!attribute [rw] common_name + # @return [::String] + # Optional. The "common name" of the distinguished name. + # @!attribute [rw] subject_alt_name + # @return [::Google::Cloud::Security::PrivateCA::V1beta1::SubjectAltNames] + # Optional. The subject alternative name fields. + class SubjectConfig + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end + + # A {::Google::Cloud::Security::PrivateCA::V1beta1::CertificateDescription CertificateDescription} describes an X.509 certificate or CSR that has + # been issued, as an alternative to using ASN.1 / X.509. + # @!attribute [rw] subject_description + # @return [::Google::Cloud::Security::PrivateCA::V1beta1::CertificateDescription::SubjectDescription] + # Describes some of the values in a certificate that are related to the + # subject and lifetime. + # @!attribute [rw] config_values + # @return [::Google::Cloud::Security::PrivateCA::V1beta1::ReusableConfigValues] + # Describes some of the technical fields in a certificate. + # @!attribute [rw] public_key + # @return [::Google::Cloud::Security::PrivateCA::V1beta1::PublicKey] + # The public key that corresponds to an issued certificate. + # @!attribute [rw] subject_key_id + # @return [::Google::Cloud::Security::PrivateCA::V1beta1::CertificateDescription::KeyId] + # Provides a means of identifiying certificates that contain a particular + # public key, per https://tools.ietf.org/html/rfc5280#section-4.2.1.2. + # @!attribute [rw] authority_key_id + # @return [::Google::Cloud::Security::PrivateCA::V1beta1::CertificateDescription::KeyId] + # Identifies the subject_key_id of the parent certificate, per + # https://tools.ietf.org/html/rfc5280#section-4.2.1.1 + # @!attribute [rw] crl_distribution_points + # @return [::Array<::String>] + # Describes a list of locations to obtain CRL information, i.e. + # the DistributionPoint.fullName described by + # https://tools.ietf.org/html/rfc5280#section-4.2.1.13 + # @!attribute [rw] aia_issuing_certificate_urls + # @return [::Array<::String>] + # Describes lists of issuer CA certificate URLs that appear in the + # "Authority Information Access" extension in the certificate. + # @!attribute [rw] cert_fingerprint + # @return [::Google::Cloud::Security::PrivateCA::V1beta1::CertificateDescription::CertificateFingerprint] + # The hash of the x.509 certificate. + class CertificateDescription + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # These values describe fields in an issued X.509 certificate such as the + # distinguished name, subject alternative names, serial number, and lifetime. + # @!attribute [rw] subject + # @return [::Google::Cloud::Security::PrivateCA::V1beta1::Subject] + # Contains distinguished name fields such as the location and organization. + # @!attribute [rw] common_name + # @return [::String] + # The "common name" of the distinguished name. + # @!attribute [rw] subject_alt_name + # @return [::Google::Cloud::Security::PrivateCA::V1beta1::SubjectAltNames] + # The subject alternative name fields. + # @!attribute [rw] hex_serial_number + # @return [::String] + # The serial number encoded in lowercase hexadecimal. + # @!attribute [rw] lifetime + # @return [::Google::Protobuf::Duration] + # For convenience, the actual lifetime of an issued certificate. + # Corresponds to 'not_after_time' - 'not_before_time'. + # @!attribute [rw] not_before_time + # @return [::Google::Protobuf::Timestamp] + # The time at which the certificate becomes valid. + # @!attribute [rw] not_after_time + # @return [::Google::Protobuf::Timestamp] + # The time at which the certificate expires. + class SubjectDescription + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # A KeyId identifies a specific public key, usually by hashing the public + # key. + # @!attribute [rw] key_id + # @return [::String] + # Optional. The value of this KeyId encoded in lowercase hexadecimal. This is most + # likely the 160 bit SHA-1 hash of the public key. + class KeyId + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # A group of fingerprints for the x509 certificate. + # @!attribute [rw] sha256_hash + # @return [::String] + # The SHA 256 hash, encoded in hexadecimal, of the DER x509 certificate. + class CertificateFingerprint + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end + + # An {::Google::Cloud::Security::PrivateCA::V1beta1::ObjectId ObjectId} specifies an object identifier (OID). These provide context + # and describe types in ASN.1 messages. + # @!attribute [rw] object_id_path + # @return [::Array<::Integer>] + # Required. The parts of an OID path. The most significant parts of the path come + # first. + class ObjectId + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # An {::Google::Cloud::Security::PrivateCA::V1beta1::X509Extension X509Extension} specifies an X.509 extension, which may be used in + # different parts of X.509 objects like certificates, CSRs, and CRLs. + # @!attribute [rw] object_id + # @return [::Google::Cloud::Security::PrivateCA::V1beta1::ObjectId] + # Required. The OID for this X.509 extension. + # @!attribute [rw] critical + # @return [::Boolean] + # Required. Indicates whether or not this extension is critical (i.e., if the client + # does not know how to handle this extension, the client should consider this + # to be an error). + # @!attribute [rw] value + # @return [::String] + # Required. The value of this X.509 extension. + class X509Extension + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # A {::Google::Cloud::Security::PrivateCA::V1beta1::KeyUsage KeyUsage} describes key usage values that may appear in an X.509 + # certificate. + # @!attribute [rw] base_key_usage + # @return [::Google::Cloud::Security::PrivateCA::V1beta1::KeyUsage::KeyUsageOptions] + # Describes high-level ways in which a key may be used. + # @!attribute [rw] extended_key_usage + # @return [::Google::Cloud::Security::PrivateCA::V1beta1::KeyUsage::ExtendedKeyUsageOptions] + # Detailed scenarios in which a key may be used. + # @!attribute [rw] unknown_extended_key_usages + # @return [::Array<::Google::Cloud::Security::PrivateCA::V1beta1::ObjectId>] + # Used to describe extended key usages that are not listed in the + # {::Google::Cloud::Security::PrivateCA::V1beta1::KeyUsage::ExtendedKeyUsageOptions KeyUsage.ExtendedKeyUsageOptions} message. + class KeyUsage + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # {::Google::Cloud::Security::PrivateCA::V1beta1::KeyUsage::KeyUsageOptions KeyUsage.KeyUsageOptions} corresponds to the key usage values + # described in https://tools.ietf.org/html/rfc5280#section-4.2.1.3. + # @!attribute [rw] digital_signature + # @return [::Boolean] + # The key may be used for digital signatures. + # @!attribute [rw] content_commitment + # @return [::Boolean] + # The key may be used for cryptographic commitments. Note that this may + # also be referred to as "non-repudiation". + # @!attribute [rw] key_encipherment + # @return [::Boolean] + # The key may be used to encipher other keys. + # @!attribute [rw] data_encipherment + # @return [::Boolean] + # The key may be used to encipher data. + # @!attribute [rw] key_agreement + # @return [::Boolean] + # The key may be used in a key agreement protocol. + # @!attribute [rw] cert_sign + # @return [::Boolean] + # The key may be used to sign certificates. + # @!attribute [rw] crl_sign + # @return [::Boolean] + # The key may be used sign certificate revocation lists. + # @!attribute [rw] encipher_only + # @return [::Boolean] + # The key may be used to encipher only. + # @!attribute [rw] decipher_only + # @return [::Boolean] + # The key may be used to decipher only. + class KeyUsageOptions + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # {::Google::Cloud::Security::PrivateCA::V1beta1::KeyUsage::ExtendedKeyUsageOptions KeyUsage.ExtendedKeyUsageOptions} has fields that correspond to + # certain common OIDs that could be specified as an extended key usage value. + # @!attribute [rw] server_auth + # @return [::Boolean] + # Corresponds to OID 1.3.6.1.5.5.7.3.1. Officially described as "TLS WWW + # server authentication", though regularly used for non-WWW TLS. + # @!attribute [rw] client_auth + # @return [::Boolean] + # Corresponds to OID 1.3.6.1.5.5.7.3.2. Officially described as "TLS WWW + # client authentication", though regularly used for non-WWW TLS. + # @!attribute [rw] code_signing + # @return [::Boolean] + # Corresponds to OID 1.3.6.1.5.5.7.3.3. Officially described as "Signing of + # downloadable executable code client authentication". + # @!attribute [rw] email_protection + # @return [::Boolean] + # Corresponds to OID 1.3.6.1.5.5.7.3.4. Officially described as "Email + # protection". + # @!attribute [rw] time_stamping + # @return [::Boolean] + # Corresponds to OID 1.3.6.1.5.5.7.3.8. Officially described as "Binding + # the hash of an object to a time". + # @!attribute [rw] ocsp_signing + # @return [::Boolean] + # Corresponds to OID 1.3.6.1.5.5.7.3.9. Officially described as "Signing + # OCSP responses". + class ExtendedKeyUsageOptions + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end + + # {::Google::Cloud::Security::PrivateCA::V1beta1::Subject Subject} describes parts of a distinguished name that, in turn, + # describes the subject of the certificate. + # @!attribute [rw] country_code + # @return [::String] + # The country code of the subject. + # @!attribute [rw] organization + # @return [::String] + # The organization of the subject. + # @!attribute [rw] organizational_unit + # @return [::String] + # The organizational_unit of the subject. + # @!attribute [rw] locality + # @return [::String] + # The locality or city of the subject. + # @!attribute [rw] province + # @return [::String] + # The province, territory, or regional state of the subject. + # @!attribute [rw] street_address + # @return [::String] + # The street address of the subject. + # @!attribute [rw] postal_code + # @return [::String] + # The postal code of the subject. + class Subject + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # {::Google::Cloud::Security::PrivateCA::V1beta1::SubjectAltNames SubjectAltNames} corresponds to a more modern way of listing what + # the asserted identity is in a certificate (i.e., compared to the "common + # name" in the distinguished name). + # @!attribute [rw] dns_names + # @return [::Array<::String>] + # Contains only valid, fully-qualified host names. + # @!attribute [rw] uris + # @return [::Array<::String>] + # Contains only valid RFC 3986 URIs. + # @!attribute [rw] email_addresses + # @return [::Array<::String>] + # Contains only valid RFC 2822 E-mail addresses. + # @!attribute [rw] ip_addresses + # @return [::Array<::String>] + # Contains only valid 32-bit IPv4 addresses or RFC 4291 IPv6 addresses. + # @!attribute [rw] custom_sans + # @return [::Array<::Google::Cloud::Security::PrivateCA::V1beta1::X509Extension>] + # Contains additional subject alternative name values. + class SubjectAltNames + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # A {::Google::Cloud::Security::PrivateCA::V1beta1::RevocationReason RevocationReason} indicates whether a {::Google::Cloud::Security::PrivateCA::V1beta1::Certificate Certificate} has been revoked, + # and the reason for revocation. These correspond to standard revocation + # reasons from RFC 5280. Note that the enum labels and values in this + # definition are not the same ASN.1 values defined in RFC 5280. These values + # will be translated to the correct ASN.1 values when a CRL is created. + module RevocationReason + # Default unspecified value. This value does indicate that a {::Google::Cloud::Security::PrivateCA::V1beta1::Certificate Certificate} + # has been revoked, but that a reason has not been recorded. + REVOCATION_REASON_UNSPECIFIED = 0 + + # Key material for this {::Google::Cloud::Security::PrivateCA::V1beta1::Certificate Certificate} may have leaked. + KEY_COMPROMISE = 1 + + # The key material for a certificate authority in the issuing path may have + # leaked. + CERTIFICATE_AUTHORITY_COMPROMISE = 2 + + # The subject or other attributes in this {::Google::Cloud::Security::PrivateCA::V1beta1::Certificate Certificate} have changed. + AFFILIATION_CHANGED = 3 + + # This {::Google::Cloud::Security::PrivateCA::V1beta1::Certificate Certificate} has been superseded. + SUPERSEDED = 4 + + # This {::Google::Cloud::Security::PrivateCA::V1beta1::Certificate Certificate} or entities in the issuing path have ceased to + # operate. + CESSATION_OF_OPERATION = 5 + + # This {::Google::Cloud::Security::PrivateCA::V1beta1::Certificate Certificate} should not be considered valid, it is expected that it + # may become valid in the future. + CERTIFICATE_HOLD = 6 + + # This {::Google::Cloud::Security::PrivateCA::V1beta1::Certificate Certificate} no longer has permission to assert the listed + # attributes. + PRIVILEGE_WITHDRAWN = 7 + + # The authority which determines appropriate attributes for a {::Google::Cloud::Security::PrivateCA::V1beta1::Certificate Certificate} + # may have been compromised. + ATTRIBUTE_AUTHORITY_COMPROMISE = 8 + end + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-security-private_ca-v1beta1/proto_docs/google/cloud/security/privateca/v1beta1/service.rb b/owl-bot-staging/google-cloud-security-private_ca-v1beta1/proto_docs/google/cloud/security/privateca/v1beta1/service.rb new file mode 100644 index 000000000000..6a9041ea2415 --- /dev/null +++ b/owl-bot-staging/google-cloud-security-private_ca-v1beta1/proto_docs/google/cloud/security/privateca/v1beta1/service.rb @@ -0,0 +1,633 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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 Security + module PrivateCA + module V1beta1 + # Request message for {::Google::Cloud::Security::PrivateCA::V1beta1::CertificateAuthorityService::Client#create_certificate CertificateAuthorityService.CreateCertificate}. + # @!attribute [rw] parent + # @return [::String] + # Required. The resource name of the location and {::Google::Cloud::Security::PrivateCA::V1beta1::CertificateAuthority CertificateAuthority} + # associated with the {::Google::Cloud::Security::PrivateCA::V1beta1::Certificate Certificate}, in the format + # `projects/*/locations/*/certificateAuthorities/*`. + # @!attribute [rw] certificate_id + # @return [::String] + # Optional. It must be unique within a location and match the regular + # expression `[a-zA-Z0-9_-]{1,63}`. This field is required when using a + # {::Google::Cloud::Security::PrivateCA::V1beta1::CertificateAuthority CertificateAuthority} in the Enterprise {::Google::Cloud::Security::PrivateCA::V1beta1::CertificateAuthority::Tier CertificateAuthority.Tier}, + # but is optional and its value is ignored otherwise. + # @!attribute [rw] certificate + # @return [::Google::Cloud::Security::PrivateCA::V1beta1::Certificate] + # Required. A {::Google::Cloud::Security::PrivateCA::V1beta1::Certificate Certificate} with initial field values. + # @!attribute [rw] request_id + # @return [::String] + # Optional. An ID to identify requests. Specify a unique request ID so that if you must + # retry your request, the server will know to ignore the request if it has + # already been completed. The server will guarantee that for at least 60 + # minutes since the first request. + # + # For example, consider a situation where you make an initial request and t + # he request times out. If you make the request again with the same request + # ID, the server can check if original operation with the same request ID + # was received, and if so, will ignore the second request. This prevents + # clients from accidentally creating duplicate commitments. + # + # The request ID must be a valid UUID with the exception that zero UUID is + # not supported (00000000-0000-0000-0000-000000000000). + class CreateCertificateRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Request message for + # {::Google::Cloud::Security::PrivateCA::V1beta1::CertificateAuthorityService::Client#get_certificate CertificateAuthorityService.GetCertificate}. + # @!attribute [rw] name + # @return [::String] + # Required. The {::Google::Cloud::Security::PrivateCA::V1beta1::Certificate#name name} of the {::Google::Cloud::Security::PrivateCA::V1beta1::Certificate Certificate} to get. + class GetCertificateRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Request message for {::Google::Cloud::Security::PrivateCA::V1beta1::CertificateAuthorityService::Client#list_certificates CertificateAuthorityService.ListCertificates}. + # @!attribute [rw] parent + # @return [::String] + # Required. The resource name of the location associated with the + # {::Google::Cloud::Security::PrivateCA::V1beta1::Certificate Certificates}, in the format + # `projects/*/locations/*/certificateauthorities/*`. + # @!attribute [rw] page_size + # @return [::Integer] + # Optional. Limit on the number of + # {::Google::Cloud::Security::PrivateCA::V1beta1::Certificate Certificates} to include in the + # response. Further {::Google::Cloud::Security::PrivateCA::V1beta1::Certificate Certificates} can subsequently be obtained + # by including the + # {::Google::Cloud::Security::PrivateCA::V1beta1::ListCertificatesResponse#next_page_token ListCertificatesResponse.next_page_token} in a subsequent + # request. If unspecified, the server will pick an appropriate default. + # @!attribute [rw] page_token + # @return [::String] + # Optional. Pagination token, returned earlier via + # {::Google::Cloud::Security::PrivateCA::V1beta1::ListCertificatesResponse#next_page_token ListCertificatesResponse.next_page_token}. + # @!attribute [rw] filter + # @return [::String] + # Optional. Only include resources that match the filter in the response. For details + # on supported filters and syntax, see [Certificates Filtering + # documentation](https://cloud.google.com/certificate-authority-service/docs/sorting-filtering-certificates#filtering_support). + # @!attribute [rw] order_by + # @return [::String] + # Optional. Specify how the results should be sorted. For details on supported fields + # and syntax, see [Certificates Sorting + # documentation](https://cloud.google.com/certificate-authority-service/docs/sorting-filtering-certificates#sorting_support). + class ListCertificatesRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Response message for {::Google::Cloud::Security::PrivateCA::V1beta1::CertificateAuthorityService::Client#list_certificates CertificateAuthorityService.ListCertificates}. + # @!attribute [rw] certificates + # @return [::Array<::Google::Cloud::Security::PrivateCA::V1beta1::Certificate>] + # The list of {::Google::Cloud::Security::PrivateCA::V1beta1::Certificate Certificates}. + # @!attribute [rw] next_page_token + # @return [::String] + # A token to retrieve next page of results. Pass this value in + # [ListCertificatesRequest.next_page_token][] to retrieve the + # next page of results. + # @!attribute [rw] unreachable + # @return [::Array<::String>] + # A list of locations (e.g. "us-west1") that could not be reached. + class ListCertificatesResponse + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Request message for + # {::Google::Cloud::Security::PrivateCA::V1beta1::CertificateAuthorityService::Client#revoke_certificate CertificateAuthorityService.RevokeCertificate}. + # @!attribute [rw] name + # @return [::String] + # Required. The resource name for this {::Google::Cloud::Security::PrivateCA::V1beta1::Certificate Certificate} in the + # format `projects/*/locations/*/certificateAuthorities/*/certificates/*`. + # @!attribute [rw] reason + # @return [::Google::Cloud::Security::PrivateCA::V1beta1::RevocationReason] + # Required. The {::Google::Cloud::Security::PrivateCA::V1beta1::RevocationReason RevocationReason} for revoking this certificate. + # @!attribute [rw] request_id + # @return [::String] + # Optional. An ID to identify requests. Specify a unique request ID so that if you must + # retry your request, the server will know to ignore the request if it has + # already been completed. The server will guarantee that for at least 60 + # minutes since the first request. + # + # For example, consider a situation where you make an initial request and t + # he request times out. If you make the request again with the same request + # ID, the server can check if original operation with the same request ID + # was received, and if so, will ignore the second request. This prevents + # clients from accidentally creating duplicate commitments. + # + # The request ID must be a valid UUID with the exception that zero UUID is + # not supported (00000000-0000-0000-0000-000000000000). + class RevokeCertificateRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Request message for {::Google::Cloud::Security::PrivateCA::V1beta1::CertificateAuthorityService::Client#update_certificate CertificateAuthorityService.UpdateCertificate}. + # @!attribute [rw] certificate + # @return [::Google::Cloud::Security::PrivateCA::V1beta1::Certificate] + # Required. {::Google::Cloud::Security::PrivateCA::V1beta1::Certificate Certificate} with updated values. + # @!attribute [rw] update_mask + # @return [::Google::Protobuf::FieldMask] + # Required. A list of fields to be updated in this request. + # @!attribute [rw] request_id + # @return [::String] + # Optional. An ID to identify requests. Specify a unique request ID so that if you must + # retry your request, the server will know to ignore the request if it has + # already been completed. The server will guarantee that for at least 60 + # minutes since the first request. + # + # For example, consider a situation where you make an initial request and t + # he request times out. If you make the request again with the same request + # ID, the server can check if original operation with the same request ID + # was received, and if so, will ignore the second request. This prevents + # clients from accidentally creating duplicate commitments. + # + # The request ID must be a valid UUID with the exception that zero UUID is + # not supported (00000000-0000-0000-0000-000000000000). + class UpdateCertificateRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Request message for + # {::Google::Cloud::Security::PrivateCA::V1beta1::CertificateAuthorityService::Client#activate_certificate_authority CertificateAuthorityService.ActivateCertificateAuthority}. + # @!attribute [rw] name + # @return [::String] + # Required. The resource name for this {::Google::Cloud::Security::PrivateCA::V1beta1::CertificateAuthority CertificateAuthority} in the + # format `projects/*/locations/*/certificateAuthorities/*`. + # @!attribute [rw] pem_ca_certificate + # @return [::String] + # Required. The signed CA certificate issued from + # {::Google::Cloud::Security::PrivateCA::V1beta1::FetchCertificateAuthorityCsrResponse#pem_csr FetchCertificateAuthorityCsrResponse.pem_csr}. + # @!attribute [rw] subordinate_config + # @return [::Google::Cloud::Security::PrivateCA::V1beta1::SubordinateConfig] + # Required. Must include information about the issuer of 'pem_ca_certificate', and any + # further issuers until the self-signed CA. + # @!attribute [rw] request_id + # @return [::String] + # Optional. An ID to identify requests. Specify a unique request ID so that if you must + # retry your request, the server will know to ignore the request if it has + # already been completed. The server will guarantee that for at least 60 + # minutes since the first request. + # + # For example, consider a situation where you make an initial request and t + # he request times out. If you make the request again with the same request + # ID, the server can check if original operation with the same request ID + # was received, and if so, will ignore the second request. This prevents + # clients from accidentally creating duplicate commitments. + # + # The request ID must be a valid UUID with the exception that zero UUID is + # not supported (00000000-0000-0000-0000-000000000000). + class ActivateCertificateAuthorityRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Request message for + # {::Google::Cloud::Security::PrivateCA::V1beta1::CertificateAuthorityService::Client#create_certificate_authority CertificateAuthorityService.CreateCertificateAuthority}. + # @!attribute [rw] parent + # @return [::String] + # Required. The resource name of the location associated with the + # {::Google::Cloud::Security::PrivateCA::V1beta1::CertificateAuthority CertificateAuthorities}, in the format + # `projects/*/locations/*`. + # @!attribute [rw] certificate_authority_id + # @return [::String] + # Required. It must be unique within a location and match the regular + # expression `[a-zA-Z0-9_-]{1,63}` + # @!attribute [rw] certificate_authority + # @return [::Google::Cloud::Security::PrivateCA::V1beta1::CertificateAuthority] + # Required. A {::Google::Cloud::Security::PrivateCA::V1beta1::CertificateAuthority CertificateAuthority} with initial field values. + # @!attribute [rw] request_id + # @return [::String] + # Optional. An ID to identify requests. Specify a unique request ID so that if you must + # retry your request, the server will know to ignore the request if it has + # already been completed. The server will guarantee that for at least 60 + # minutes since the first request. + # + # For example, consider a situation where you make an initial request and t + # he request times out. If you make the request again with the same request + # ID, the server can check if original operation with the same request ID + # was received, and if so, will ignore the second request. This prevents + # clients from accidentally creating duplicate commitments. + # + # The request ID must be a valid UUID with the exception that zero UUID is + # not supported (00000000-0000-0000-0000-000000000000). + class CreateCertificateAuthorityRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Request message for + # {::Google::Cloud::Security::PrivateCA::V1beta1::CertificateAuthorityService::Client#disable_certificate_authority CertificateAuthorityService.DisableCertificateAuthority}. + # @!attribute [rw] name + # @return [::String] + # Required. The resource name for this {::Google::Cloud::Security::PrivateCA::V1beta1::CertificateAuthority CertificateAuthority} in the + # format `projects/*/locations/*/certificateAuthorities/*`. + # @!attribute [rw] request_id + # @return [::String] + # Optional. An ID to identify requests. Specify a unique request ID so that if you must + # retry your request, the server will know to ignore the request if it has + # already been completed. The server will guarantee that for at least 60 + # minutes since the first request. + # + # For example, consider a situation where you make an initial request and t + # he request times out. If you make the request again with the same request + # ID, the server can check if original operation with the same request ID + # was received, and if so, will ignore the second request. This prevents + # clients from accidentally creating duplicate commitments. + # + # The request ID must be a valid UUID with the exception that zero UUID is + # not supported (00000000-0000-0000-0000-000000000000). + class DisableCertificateAuthorityRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Request message for + # {::Google::Cloud::Security::PrivateCA::V1beta1::CertificateAuthorityService::Client#enable_certificate_authority CertificateAuthorityService.EnableCertificateAuthority}. + # @!attribute [rw] name + # @return [::String] + # Required. The resource name for this {::Google::Cloud::Security::PrivateCA::V1beta1::CertificateAuthority CertificateAuthority} in the + # format `projects/*/locations/*/certificateAuthorities/*`. + # @!attribute [rw] request_id + # @return [::String] + # Optional. An ID to identify requests. Specify a unique request ID so that if you must + # retry your request, the server will know to ignore the request if it has + # already been completed. The server will guarantee that for at least 60 + # minutes since the first request. + # + # For example, consider a situation where you make an initial request and t + # he request times out. If you make the request again with the same request + # ID, the server can check if original operation with the same request ID + # was received, and if so, will ignore the second request. This prevents + # clients from accidentally creating duplicate commitments. + # + # The request ID must be a valid UUID with the exception that zero UUID is + # not supported (00000000-0000-0000-0000-000000000000). + class EnableCertificateAuthorityRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Request message for + # {::Google::Cloud::Security::PrivateCA::V1beta1::CertificateAuthorityService::Client#fetch_certificate_authority_csr CertificateAuthorityService.FetchCertificateAuthorityCsr}. + # @!attribute [rw] name + # @return [::String] + # Required. The resource name for this {::Google::Cloud::Security::PrivateCA::V1beta1::CertificateAuthority CertificateAuthority} in the + # format `projects/*/locations/*/certificateAuthorities/*`. + class FetchCertificateAuthorityCsrRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Response message for + # {::Google::Cloud::Security::PrivateCA::V1beta1::CertificateAuthorityService::Client#fetch_certificate_authority_csr CertificateAuthorityService.FetchCertificateAuthorityCsr}. + # @!attribute [r] pem_csr + # @return [::String] + # Output only. The PEM-encoded signed certificate signing request (CSR). + class FetchCertificateAuthorityCsrResponse + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Request message for {::Google::Cloud::Security::PrivateCA::V1beta1::CertificateAuthorityService::Client#get_certificate_authority CertificateAuthorityService.GetCertificateAuthority}. + # @!attribute [rw] name + # @return [::String] + # Required. The {::Google::Cloud::Security::PrivateCA::V1beta1::CertificateAuthority#name name} of the {::Google::Cloud::Security::PrivateCA::V1beta1::CertificateAuthority CertificateAuthority} to + # get. + class GetCertificateAuthorityRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Request message for + # {::Google::Cloud::Security::PrivateCA::V1beta1::CertificateAuthorityService::Client#list_certificate_authorities CertificateAuthorityService.ListCertificateAuthorities}. + # @!attribute [rw] parent + # @return [::String] + # Required. The resource name of the location associated with the + # {::Google::Cloud::Security::PrivateCA::V1beta1::CertificateAuthority CertificateAuthorities}, in the format + # `projects/*/locations/*`. + # @!attribute [rw] page_size + # @return [::Integer] + # Optional. Limit on the number of {::Google::Cloud::Security::PrivateCA::V1beta1::CertificateAuthority CertificateAuthorities} to + # include in the response. + # Further {::Google::Cloud::Security::PrivateCA::V1beta1::CertificateAuthority CertificateAuthorities} can subsequently be + # obtained by including the + # {::Google::Cloud::Security::PrivateCA::V1beta1::ListCertificateAuthoritiesResponse#next_page_token ListCertificateAuthoritiesResponse.next_page_token} in a subsequent + # request. If unspecified, the server will pick an appropriate default. + # @!attribute [rw] page_token + # @return [::String] + # Optional. Pagination token, returned earlier via + # {::Google::Cloud::Security::PrivateCA::V1beta1::ListCertificateAuthoritiesResponse#next_page_token ListCertificateAuthoritiesResponse.next_page_token}. + # @!attribute [rw] filter + # @return [::String] + # Optional. Only include resources that match the filter in the response. + # @!attribute [rw] order_by + # @return [::String] + # Optional. Specify how the results should be sorted. + class ListCertificateAuthoritiesRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Response message for + # {::Google::Cloud::Security::PrivateCA::V1beta1::CertificateAuthorityService::Client#list_certificate_authorities CertificateAuthorityService.ListCertificateAuthorities}. + # @!attribute [rw] certificate_authorities + # @return [::Array<::Google::Cloud::Security::PrivateCA::V1beta1::CertificateAuthority>] + # The list of {::Google::Cloud::Security::PrivateCA::V1beta1::CertificateAuthority CertificateAuthorities}. + # @!attribute [rw] next_page_token + # @return [::String] + # A token to retrieve next page of results. Pass this value in + # [ListCertificateAuthoritiesRequest.next_page_token][] to retrieve the next + # page of results. + # @!attribute [rw] unreachable + # @return [::Array<::String>] + # A list of locations (e.g. "us-west1") that could not be reached. + class ListCertificateAuthoritiesResponse + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Request message for + # {::Google::Cloud::Security::PrivateCA::V1beta1::CertificateAuthorityService::Client#restore_certificate_authority CertificateAuthorityService.RestoreCertificateAuthority}. + # @!attribute [rw] name + # @return [::String] + # Required. The resource name for this {::Google::Cloud::Security::PrivateCA::V1beta1::CertificateAuthority CertificateAuthority} in the + # format `projects/*/locations/*/certificateAuthorities/*`. + # @!attribute [rw] request_id + # @return [::String] + # Optional. An ID to identify requests. Specify a unique request ID so that if you must + # retry your request, the server will know to ignore the request if it has + # already been completed. The server will guarantee that for at least 60 + # minutes since the first request. + # + # For example, consider a situation where you make an initial request and t + # he request times out. If you make the request again with the same request + # ID, the server can check if original operation with the same request ID + # was received, and if so, will ignore the second request. This prevents + # clients from accidentally creating duplicate commitments. + # + # The request ID must be a valid UUID with the exception that zero UUID is + # not supported (00000000-0000-0000-0000-000000000000). + class RestoreCertificateAuthorityRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Request message for + # {::Google::Cloud::Security::PrivateCA::V1beta1::CertificateAuthorityService::Client#schedule_delete_certificate_authority CertificateAuthorityService.ScheduleDeleteCertificateAuthority}. + # @!attribute [rw] name + # @return [::String] + # Required. The resource name for this {::Google::Cloud::Security::PrivateCA::V1beta1::CertificateAuthority CertificateAuthority} in the + # format `projects/*/locations/*/certificateAuthorities/*`. + # @!attribute [rw] request_id + # @return [::String] + # Optional. An ID to identify requests. Specify a unique request ID so that if you must + # retry your request, the server will know to ignore the request if it has + # already been completed. The server will guarantee that for at least 60 + # minutes since the first request. + # + # For example, consider a situation where you make an initial request and t + # he request times out. If you make the request again with the same request + # ID, the server can check if original operation with the same request ID + # was received, and if so, will ignore the second request. This prevents + # clients from accidentally creating duplicate commitments. + # + # The request ID must be a valid UUID with the exception that zero UUID is + # not supported (00000000-0000-0000-0000-000000000000). + class ScheduleDeleteCertificateAuthorityRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Request message for + # {::Google::Cloud::Security::PrivateCA::V1beta1::CertificateAuthorityService::Client#update_certificate_authority CertificateAuthorityService.UpdateCertificateAuthority}. + # @!attribute [rw] certificate_authority + # @return [::Google::Cloud::Security::PrivateCA::V1beta1::CertificateAuthority] + # Required. {::Google::Cloud::Security::PrivateCA::V1beta1::CertificateAuthority CertificateAuthority} with updated values. + # @!attribute [rw] update_mask + # @return [::Google::Protobuf::FieldMask] + # Required. A list of fields to be updated in this request. + # @!attribute [rw] request_id + # @return [::String] + # Optional. An ID to identify requests. Specify a unique request ID so that if you must + # retry your request, the server will know to ignore the request if it has + # already been completed. The server will guarantee that for at least 60 + # minutes since the first request. + # + # For example, consider a situation where you make an initial request and t + # he request times out. If you make the request again with the same request + # ID, the server can check if original operation with the same request ID + # was received, and if so, will ignore the second request. This prevents + # clients from accidentally creating duplicate commitments. + # + # The request ID must be a valid UUID with the exception that zero UUID is + # not supported (00000000-0000-0000-0000-000000000000). + class UpdateCertificateAuthorityRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Request message for + # {::Google::Cloud::Security::PrivateCA::V1beta1::CertificateAuthorityService::Client#get_certificate_revocation_list CertificateAuthorityService.GetCertificateRevocationList}. + # @!attribute [rw] name + # @return [::String] + # Required. The {::Google::Cloud::Security::PrivateCA::V1beta1::CertificateRevocationList#name name} of the + # {::Google::Cloud::Security::PrivateCA::V1beta1::CertificateRevocationList CertificateRevocationList} to get. + class GetCertificateRevocationListRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Request message for + # {::Google::Cloud::Security::PrivateCA::V1beta1::CertificateAuthorityService::Client#list_certificate_revocation_lists CertificateAuthorityService.ListCertificateRevocationLists}. + # @!attribute [rw] parent + # @return [::String] + # Required. The resource name of the location associated with the + # {::Google::Cloud::Security::PrivateCA::V1beta1::CertificateRevocationList CertificateRevocationLists}, in the format + # `projects/*/locations/*/certificateauthorities/*`. + # @!attribute [rw] page_size + # @return [::Integer] + # Optional. Limit on the number of + # {::Google::Cloud::Security::PrivateCA::V1beta1::CertificateRevocationList CertificateRevocationLists} to include in the + # response. Further {::Google::Cloud::Security::PrivateCA::V1beta1::CertificateRevocationList CertificateRevocationLists} + # can subsequently be obtained by including the + # {::Google::Cloud::Security::PrivateCA::V1beta1::ListCertificateRevocationListsResponse#next_page_token ListCertificateRevocationListsResponse.next_page_token} in a subsequent + # request. If unspecified, the server will pick an appropriate default. + # @!attribute [rw] page_token + # @return [::String] + # Optional. Pagination token, returned earlier via + # {::Google::Cloud::Security::PrivateCA::V1beta1::ListCertificateRevocationListsResponse#next_page_token ListCertificateRevocationListsResponse.next_page_token}. + # @!attribute [rw] filter + # @return [::String] + # Optional. Only include resources that match the filter in the response. + # @!attribute [rw] order_by + # @return [::String] + # Optional. Specify how the results should be sorted. + class ListCertificateRevocationListsRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Response message for + # {::Google::Cloud::Security::PrivateCA::V1beta1::CertificateAuthorityService::Client#list_certificate_revocation_lists CertificateAuthorityService.ListCertificateRevocationLists}. + # @!attribute [rw] certificate_revocation_lists + # @return [::Array<::Google::Cloud::Security::PrivateCA::V1beta1::CertificateRevocationList>] + # The list of {::Google::Cloud::Security::PrivateCA::V1beta1::CertificateRevocationList CertificateRevocationLists}. + # @!attribute [rw] next_page_token + # @return [::String] + # A token to retrieve next page of results. Pass this value in + # [ListCertificateRevocationListsRequest.next_page_token][] to retrieve the + # next page of results. + # @!attribute [rw] unreachable + # @return [::Array<::String>] + # A list of locations (e.g. "us-west1") that could not be reached. + class ListCertificateRevocationListsResponse + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Request message for + # {::Google::Cloud::Security::PrivateCA::V1beta1::CertificateAuthorityService::Client#update_certificate_revocation_list CertificateAuthorityService.UpdateCertificateRevocationList}. + # @!attribute [rw] certificate_revocation_list + # @return [::Google::Cloud::Security::PrivateCA::V1beta1::CertificateRevocationList] + # Required. {::Google::Cloud::Security::PrivateCA::V1beta1::CertificateRevocationList CertificateRevocationList} with updated values. + # @!attribute [rw] update_mask + # @return [::Google::Protobuf::FieldMask] + # Required. A list of fields to be updated in this request. + # @!attribute [rw] request_id + # @return [::String] + # Optional. An ID to identify requests. Specify a unique request ID so that if you must + # retry your request, the server will know to ignore the request if it has + # already been completed. The server will guarantee that for at least 60 + # minutes since the first request. + # + # For example, consider a situation where you make an initial request and t + # he request times out. If you make the request again with the same request + # ID, the server can check if original operation with the same request ID + # was received, and if so, will ignore the second request. This prevents + # clients from accidentally creating duplicate commitments. + # + # The request ID must be a valid UUID with the exception that zero UUID is + # not supported (00000000-0000-0000-0000-000000000000). + class UpdateCertificateRevocationListRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Request message for + # {::Google::Cloud::Security::PrivateCA::V1beta1::CertificateAuthorityService::Client#get_reusable_config CertificateAuthorityService.GetReusableConfig}. + # @!attribute [rw] name + # @return [::String] + # Required. The [name][ReusableConfigs.name] of the [ReusableConfigs][] to get. + class GetReusableConfigRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Request message for + # {::Google::Cloud::Security::PrivateCA::V1beta1::CertificateAuthorityService::Client#list_reusable_configs CertificateAuthorityService.ListReusableConfigs}. + # @!attribute [rw] parent + # @return [::String] + # Required. The resource name of the location associated with the + # {::Google::Cloud::Security::PrivateCA::V1beta1::ReusableConfig ReusableConfigs}, in the format + # `projects/*/locations/*`. + # @!attribute [rw] page_size + # @return [::Integer] + # Optional. Limit on the number of + # {::Google::Cloud::Security::PrivateCA::V1beta1::ReusableConfig ReusableConfigs} to include in the response. + # Further {::Google::Cloud::Security::PrivateCA::V1beta1::ReusableConfig ReusableConfigs} can subsequently be + # obtained by including the + # {::Google::Cloud::Security::PrivateCA::V1beta1::ListReusableConfigsResponse#next_page_token ListReusableConfigsResponse.next_page_token} in a subsequent request. If + # unspecified, the server will pick an appropriate default. + # @!attribute [rw] page_token + # @return [::String] + # Optional. Pagination token, returned earlier via + # {::Google::Cloud::Security::PrivateCA::V1beta1::ListReusableConfigsResponse#next_page_token ListReusableConfigsResponse.next_page_token}. + # @!attribute [rw] filter + # @return [::String] + # Optional. Only include resources that match the filter in the response. + # @!attribute [rw] order_by + # @return [::String] + # Optional. Specify how the results should be sorted. + class ListReusableConfigsRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Response message for + # {::Google::Cloud::Security::PrivateCA::V1beta1::CertificateAuthorityService::Client#list_reusable_configs CertificateAuthorityService.ListReusableConfigs}. + # @!attribute [rw] reusable_configs + # @return [::Array<::Google::Cloud::Security::PrivateCA::V1beta1::ReusableConfig>] + # The list of {::Google::Cloud::Security::PrivateCA::V1beta1::ReusableConfig ReusableConfigs}. + # @!attribute [rw] next_page_token + # @return [::String] + # A token to retrieve next page of results. Pass this value in + # [ListReusableConfigsRequest.next_page_token][] to retrieve + # the next page of results. + # @!attribute [rw] unreachable + # @return [::Array<::String>] + # A list of locations (e.g. "us-west1") that could not be reached. + class ListReusableConfigsResponse + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Represents the metadata of the long-running operation. + # @!attribute [r] create_time + # @return [::Google::Protobuf::Timestamp] + # Output only. The time the operation was created. + # @!attribute [r] end_time + # @return [::Google::Protobuf::Timestamp] + # Output only. The time the operation finished running. + # @!attribute [r] target + # @return [::String] + # Output only. Server-defined resource path for the target of the operation. + # @!attribute [r] verb + # @return [::String] + # Output only. Name of the verb executed by the operation. + # @!attribute [r] status_message + # @return [::String] + # Output only. Human-readable status of the operation, if any. + # @!attribute [r] requested_cancellation + # @return [::Boolean] + # Output only. Identifies whether the user has requested cancellation + # of the operation. Operations that have successfully been cancelled + # have [Operation.error][] value with a {::Google::Rpc::Status#code google.rpc.Status.code} of 1, + # corresponding to `Code.CANCELLED`. + # @!attribute [r] api_version + # @return [::String] + # Output only. API version used to start the operation. + class OperationMetadata + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-security-private_ca-v1beta1/proto_docs/google/longrunning/operations.rb b/owl-bot-staging/google-cloud-security-private_ca-v1beta1/proto_docs/google/longrunning/operations.rb new file mode 100644 index 000000000000..7a757f512165 --- /dev/null +++ b/owl-bot-staging/google-cloud-security-private_ca-v1beta1/proto_docs/google/longrunning/operations.rb @@ -0,0 +1,191 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + + +module Google + module Longrunning + # This resource represents a long-running operation that is the result of a + # network API call. + # @!attribute [rw] name + # @return [::String] + # The server-assigned name, which is only unique within the same service that + # originally returns it. If you use the default HTTP mapping, the + # `name` should be a resource name ending with `operations/{unique_id}`. + # @!attribute [rw] metadata + # @return [::Google::Protobuf::Any] + # Service-specific metadata associated with the operation. It typically + # contains progress information and common metadata such as create time. + # Some services might not provide such metadata. Any method that returns a + # long-running operation should document the metadata type, if any. + # @!attribute [rw] done + # @return [::Boolean] + # If the value is `false`, it means the operation is still in progress. + # If `true`, the operation is completed, and either `error` or `response` is + # available. + # @!attribute [rw] error + # @return [::Google::Rpc::Status] + # The error result of the operation in case of failure or cancellation. + # + # Note: The following fields are mutually exclusive: `error`, `response`. If a field in that set is populated, all other fields in the set will automatically be cleared. + # @!attribute [rw] response + # @return [::Google::Protobuf::Any] + # The normal, successful response of the operation. If the original + # method returns no data on success, such as `Delete`, the response is + # `google.protobuf.Empty`. If the original method is standard + # `Get`/`Create`/`Update`, the response should be the resource. For other + # methods, the response should have the type `XxxResponse`, where `Xxx` + # is the original method name. For example, if the original method name + # is `TakeSnapshot()`, the inferred response type is + # `TakeSnapshotResponse`. + # + # Note: The following fields are mutually exclusive: `response`, `error`. If a field in that set is populated, all other fields in the set will automatically be cleared. + class Operation + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # The request message for + # Operations.GetOperation. + # @!attribute [rw] name + # @return [::String] + # The name of the operation resource. + class GetOperationRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # The request message for + # Operations.ListOperations. + # @!attribute [rw] name + # @return [::String] + # The name of the operation's parent resource. + # @!attribute [rw] filter + # @return [::String] + # The standard list filter. + # @!attribute [rw] page_size + # @return [::Integer] + # The standard list page size. + # @!attribute [rw] page_token + # @return [::String] + # The standard list page token. + # @!attribute [rw] return_partial_success + # @return [::Boolean] + # When set to `true`, operations that are reachable are returned as normal, + # and those that are unreachable are returned in the + # [ListOperationsResponse.unreachable] field. + # + # This can only be `true` when reading across collections e.g. when `parent` + # is set to `"projects/example/locations/-"`. + # + # This field is not by default supported and will result in an + # `UNIMPLEMENTED` error if set unless explicitly documented otherwise in + # service or product specific documentation. + class ListOperationsRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # The response message for + # Operations.ListOperations. + # @!attribute [rw] operations + # @return [::Array<::Google::Longrunning::Operation>] + # A list of operations that matches the specified filter in the request. + # @!attribute [rw] next_page_token + # @return [::String] + # The standard List next-page token. + # @!attribute [rw] unreachable + # @return [::Array<::String>] + # Unordered list. Unreachable resources. Populated when the request sets + # `ListOperationsRequest.return_partial_success` and reads across + # collections e.g. when attempting to list all resources across all supported + # locations. + class ListOperationsResponse + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # The request message for + # Operations.CancelOperation. + # @!attribute [rw] name + # @return [::String] + # The name of the operation resource to be cancelled. + class CancelOperationRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # The request message for + # Operations.DeleteOperation. + # @!attribute [rw] name + # @return [::String] + # The name of the operation resource to be deleted. + class DeleteOperationRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # The request message for + # Operations.WaitOperation. + # @!attribute [rw] name + # @return [::String] + # The name of the operation resource to wait on. + # @!attribute [rw] timeout + # @return [::Google::Protobuf::Duration] + # The maximum duration to wait before timing out. If left blank, the wait + # will be at most the time permitted by the underlying HTTP/RPC protocol. + # If RPC context deadline is also specified, the shorter one will be used. + class WaitOperationRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # A message representing the message types used by a long-running operation. + # + # Example: + # + # rpc Export(ExportRequest) returns (google.longrunning.Operation) { + # option (google.longrunning.operation_info) = { + # response_type: "ExportResponse" + # metadata_type: "ExportMetadata" + # }; + # } + # @!attribute [rw] response_type + # @return [::String] + # Required. The message name of the primary return type for this + # long-running operation. + # This type will be used to deserialize the LRO's response. + # + # If the response is in a different package from the rpc, a fully-qualified + # message name must be used (e.g. `google.protobuf.Struct`). + # + # Note: Altering this value constitutes a breaking change. + # @!attribute [rw] metadata_type + # @return [::String] + # Required. The message name of the metadata type for this long-running + # operation. + # + # If the response is in a different package from the rpc, a fully-qualified + # message name must be used (e.g. `google.protobuf.Struct`). + # + # Note: Altering this value constitutes a breaking change. + class OperationInfo + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end +end diff --git a/owl-bot-staging/google-cloud-security-private_ca-v1beta1/proto_docs/google/protobuf/any.rb b/owl-bot-staging/google-cloud-security-private_ca-v1beta1/proto_docs/google/protobuf/any.rb new file mode 100644 index 000000000000..58691995f02e --- /dev/null +++ b/owl-bot-staging/google-cloud-security-private_ca-v1beta1/proto_docs/google/protobuf/any.rb @@ -0,0 +1,145 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + + +module Google + module Protobuf + # `Any` contains an arbitrary serialized protocol buffer message along with a + # URL that describes the type of the serialized message. + # + # Protobuf library provides support to pack/unpack Any values in the form + # of utility functions or additional generated methods of the Any type. + # + # Example 1: Pack and unpack a message in C++. + # + # Foo foo = ...; + # Any any; + # any.PackFrom(foo); + # ... + # if (any.UnpackTo(&foo)) { + # ... + # } + # + # Example 2: Pack and unpack a message in Java. + # + # Foo foo = ...; + # Any any = Any.pack(foo); + # ... + # if (any.is(Foo.class)) { + # foo = any.unpack(Foo.class); + # } + # // or ... + # if (any.isSameTypeAs(Foo.getDefaultInstance())) { + # foo = any.unpack(Foo.getDefaultInstance()); + # } + # + # Example 3: Pack and unpack a message in Python. + # + # foo = Foo(...) + # any = Any() + # any.Pack(foo) + # ... + # if any.Is(Foo.DESCRIPTOR): + # any.Unpack(foo) + # ... + # + # Example 4: Pack and unpack a message in Go + # + # foo := &pb.Foo{...} + # any, err := anypb.New(foo) + # if err != nil { + # ... + # } + # ... + # foo := &pb.Foo{} + # if err := any.UnmarshalTo(foo); err != nil { + # ... + # } + # + # The pack methods provided by protobuf library will by default use + # 'type.googleapis.com/full.type.name' as the type URL and the unpack + # methods only use the fully qualified type name after the last '/' + # in the type URL, for example "foo.bar.com/x/y.z" will yield type + # name "y.z". + # + # JSON + # ==== + # The JSON representation of an `Any` value uses the regular + # representation of the deserialized, embedded message, with an + # additional field `@type` which contains the type URL. Example: + # + # package google.profile; + # message Person { + # string first_name = 1; + # string last_name = 2; + # } + # + # { + # "@type": "type.googleapis.com/google.profile.Person", + # "firstName": , + # "lastName": + # } + # + # If the embedded message type is well-known and has a custom JSON + # representation, that representation will be embedded adding a field + # `value` which holds the custom JSON in addition to the `@type` + # field. Example (for message [google.protobuf.Duration][]): + # + # { + # "@type": "type.googleapis.com/google.protobuf.Duration", + # "value": "1.212s" + # } + # @!attribute [rw] type_url + # @return [::String] + # A URL/resource name that uniquely identifies the type of the serialized + # protocol buffer message. This string must contain at least + # one "/" character. The last segment of the URL's path must represent + # the fully qualified name of the type (as in + # `path/google.protobuf.Duration`). The name should be in a canonical form + # (e.g., leading "." is not accepted). + # + # In practice, teams usually precompile into the binary all types that they + # expect it to use in the context of Any. However, for URLs which use the + # scheme `http`, `https`, or no scheme, one can optionally set up a type + # server that maps type URLs to message definitions as follows: + # + # * If no scheme is provided, `https` is assumed. + # * An HTTP GET on the URL must yield a [google.protobuf.Type][] + # value in binary format, or produce an error. + # * Applications are allowed to cache lookup results based on the + # URL, or have them precompiled into a binary to avoid any + # lookup. Therefore, binary compatibility needs to be preserved + # on changes to types. (Use versioned type names to manage + # breaking changes.) + # + # Note: this functionality is not currently available in the official + # protobuf release, and it is not used for type URLs beginning with + # type.googleapis.com. As of May 2023, there are no widely used type server + # implementations and no plans to implement one. + # + # Schemes other than `http`, `https` (or the empty scheme) might be + # used with implementation specific semantics. + # @!attribute [rw] value + # @return [::String] + # Must be a valid serialized protocol buffer of the above specified type. + class Any + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end +end diff --git a/owl-bot-staging/google-cloud-security-private_ca-v1beta1/proto_docs/google/protobuf/duration.rb b/owl-bot-staging/google-cloud-security-private_ca-v1beta1/proto_docs/google/protobuf/duration.rb new file mode 100644 index 000000000000..ea59f1f91daf --- /dev/null +++ b/owl-bot-staging/google-cloud-security-private_ca-v1beta1/proto_docs/google/protobuf/duration.rb @@ -0,0 +1,98 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + + +module Google + module Protobuf + # A Duration represents a signed, fixed-length span of time represented + # as a count of seconds and fractions of seconds at nanosecond + # resolution. It is independent of any calendar and concepts like "day" + # or "month". It is related to Timestamp in that the difference between + # two Timestamp values is a Duration and it can be added or subtracted + # from a Timestamp. Range is approximately +-10,000 years. + # + # # Examples + # + # Example 1: Compute Duration from two Timestamps in pseudo code. + # + # Timestamp start = ...; + # Timestamp end = ...; + # Duration duration = ...; + # + # duration.seconds = end.seconds - start.seconds; + # duration.nanos = end.nanos - start.nanos; + # + # if (duration.seconds < 0 && duration.nanos > 0) { + # duration.seconds += 1; + # duration.nanos -= 1000000000; + # } else if (duration.seconds > 0 && duration.nanos < 0) { + # duration.seconds -= 1; + # duration.nanos += 1000000000; + # } + # + # Example 2: Compute Timestamp from Timestamp + Duration in pseudo code. + # + # Timestamp start = ...; + # Duration duration = ...; + # Timestamp end = ...; + # + # end.seconds = start.seconds + duration.seconds; + # end.nanos = start.nanos + duration.nanos; + # + # if (end.nanos < 0) { + # end.seconds -= 1; + # end.nanos += 1000000000; + # } else if (end.nanos >= 1000000000) { + # end.seconds += 1; + # end.nanos -= 1000000000; + # } + # + # Example 3: Compute Duration from datetime.timedelta in Python. + # + # td = datetime.timedelta(days=3, minutes=10) + # duration = Duration() + # duration.FromTimedelta(td) + # + # # JSON Mapping + # + # In JSON format, the Duration type is encoded as a string rather than an + # object, where the string ends in the suffix "s" (indicating seconds) and + # is preceded by the number of seconds, with nanoseconds expressed as + # fractional seconds. For example, 3 seconds with 0 nanoseconds should be + # encoded in JSON format as "3s", while 3 seconds and 1 nanosecond should + # be expressed in JSON format as "3.000000001s", and 3 seconds and 1 + # microsecond should be expressed in JSON format as "3.000001s". + # @!attribute [rw] seconds + # @return [::Integer] + # Signed seconds of the span of time. Must be from -315,576,000,000 + # to +315,576,000,000 inclusive. Note: these bounds are computed from: + # 60 sec/min * 60 min/hr * 24 hr/day * 365.25 days/year * 10000 years + # @!attribute [rw] nanos + # @return [::Integer] + # Signed fractions of a second at nanosecond resolution of the span + # of time. Durations less than one second are represented with a 0 + # `seconds` field and a positive or negative `nanos` field. For durations + # of one second or more, a non-zero value for the `nanos` field must be + # of the same sign as the `seconds` field. Must be from -999,999,999 + # to +999,999,999 inclusive. + class Duration + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end +end diff --git a/owl-bot-staging/google-cloud-security-private_ca-v1beta1/proto_docs/google/protobuf/empty.rb b/owl-bot-staging/google-cloud-security-private_ca-v1beta1/proto_docs/google/protobuf/empty.rb new file mode 100644 index 000000000000..83e4481834a6 --- /dev/null +++ b/owl-bot-staging/google-cloud-security-private_ca-v1beta1/proto_docs/google/protobuf/empty.rb @@ -0,0 +1,34 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + + +module Google + module Protobuf + # A generic empty message that you can re-use to avoid defining duplicated + # empty messages in your APIs. A typical example is to use it as the request + # or the response type of an API method. For instance: + # + # service Foo { + # rpc Bar(google.protobuf.Empty) returns (google.protobuf.Empty); + # } + class Empty + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end +end diff --git a/owl-bot-staging/google-cloud-security-private_ca-v1beta1/proto_docs/google/protobuf/field_mask.rb b/owl-bot-staging/google-cloud-security-private_ca-v1beta1/proto_docs/google/protobuf/field_mask.rb new file mode 100644 index 000000000000..7f3ffc78601a --- /dev/null +++ b/owl-bot-staging/google-cloud-security-private_ca-v1beta1/proto_docs/google/protobuf/field_mask.rb @@ -0,0 +1,229 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + + +module Google + module Protobuf + # `FieldMask` represents a set of symbolic field paths, for example: + # + # paths: "f.a" + # paths: "f.b.d" + # + # Here `f` represents a field in some root message, `a` and `b` + # fields in the message found in `f`, and `d` a field found in the + # message in `f.b`. + # + # Field masks are used to specify a subset of fields that should be + # returned by a get operation or modified by an update operation. + # Field masks also have a custom JSON encoding (see below). + # + # # Field Masks in Projections + # + # When used in the context of a projection, a response message or + # sub-message is filtered by the API to only contain those fields as + # specified in the mask. For example, if the mask in the previous + # example is applied to a response message as follows: + # + # f { + # a : 22 + # b { + # d : 1 + # x : 2 + # } + # y : 13 + # } + # z: 8 + # + # The result will not contain specific values for fields x,y and z + # (their value will be set to the default, and omitted in proto text + # output): + # + # + # f { + # a : 22 + # b { + # d : 1 + # } + # } + # + # A repeated field is not allowed except at the last position of a + # paths string. + # + # If a FieldMask object is not present in a get operation, the + # operation applies to all fields (as if a FieldMask of all fields + # had been specified). + # + # Note that a field mask does not necessarily apply to the + # top-level response message. In case of a REST get operation, the + # field mask applies directly to the response, but in case of a REST + # list operation, the mask instead applies to each individual message + # in the returned resource list. In case of a REST custom method, + # other definitions may be used. Where the mask applies will be + # clearly documented together with its declaration in the API. In + # any case, the effect on the returned resource/resources is required + # behavior for APIs. + # + # # Field Masks in Update Operations + # + # A field mask in update operations specifies which fields of the + # targeted resource are going to be updated. The API is required + # to only change the values of the fields as specified in the mask + # and leave the others untouched. If a resource is passed in to + # describe the updated values, the API ignores the values of all + # fields not covered by the mask. + # + # If a repeated field is specified for an update operation, new values will + # be appended to the existing repeated field in the target resource. Note that + # a repeated field is only allowed in the last position of a `paths` string. + # + # If a sub-message is specified in the last position of the field mask for an + # update operation, then new value will be merged into the existing sub-message + # in the target resource. + # + # For example, given the target message: + # + # f { + # b { + # d: 1 + # x: 2 + # } + # c: [1] + # } + # + # And an update message: + # + # f { + # b { + # d: 10 + # } + # c: [2] + # } + # + # then if the field mask is: + # + # paths: ["f.b", "f.c"] + # + # then the result will be: + # + # f { + # b { + # d: 10 + # x: 2 + # } + # c: [1, 2] + # } + # + # An implementation may provide options to override this default behavior for + # repeated and message fields. + # + # In order to reset a field's value to the default, the field must + # be in the mask and set to the default value in the provided resource. + # Hence, in order to reset all fields of a resource, provide a default + # instance of the resource and set all fields in the mask, or do + # not provide a mask as described below. + # + # If a field mask is not present on update, the operation applies to + # all fields (as if a field mask of all fields has been specified). + # Note that in the presence of schema evolution, this may mean that + # fields the client does not know and has therefore not filled into + # the request will be reset to their default. If this is unwanted + # behavior, a specific service may require a client to always specify + # a field mask, producing an error if not. + # + # As with get operations, the location of the resource which + # describes the updated values in the request message depends on the + # operation kind. In any case, the effect of the field mask is + # required to be honored by the API. + # + # ## Considerations for HTTP REST + # + # The HTTP kind of an update operation which uses a field mask must + # be set to PATCH instead of PUT in order to satisfy HTTP semantics + # (PUT must only be used for full updates). + # + # # JSON Encoding of Field Masks + # + # In JSON, a field mask is encoded as a single string where paths are + # separated by a comma. Fields name in each path are converted + # to/from lower-camel naming conventions. + # + # As an example, consider the following message declarations: + # + # message Profile { + # User user = 1; + # Photo photo = 2; + # } + # message User { + # string display_name = 1; + # string address = 2; + # } + # + # In proto a field mask for `Profile` may look as such: + # + # mask { + # paths: "user.display_name" + # paths: "photo" + # } + # + # In JSON, the same mask is represented as below: + # + # { + # mask: "user.displayName,photo" + # } + # + # # Field Masks and Oneof Fields + # + # Field masks treat fields in oneofs just as regular fields. Consider the + # following message: + # + # message SampleMessage { + # oneof test_oneof { + # string name = 4; + # SubMessage sub_message = 9; + # } + # } + # + # The field mask can be: + # + # mask { + # paths: "name" + # } + # + # Or: + # + # mask { + # paths: "sub_message" + # } + # + # Note that oneof type names ("test_oneof" in this case) cannot be used in + # paths. + # + # ## Field Mask Verification + # + # The implementation of any API method which has a FieldMask type field in the + # request should verify the included field paths, and return an + # `INVALID_ARGUMENT` error if any path is unmappable. + # @!attribute [rw] paths + # @return [::Array<::String>] + # The set of field mask paths. + class FieldMask + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end +end diff --git a/owl-bot-staging/google-cloud-security-private_ca-v1beta1/proto_docs/google/protobuf/timestamp.rb b/owl-bot-staging/google-cloud-security-private_ca-v1beta1/proto_docs/google/protobuf/timestamp.rb new file mode 100644 index 000000000000..74352be9c58c --- /dev/null +++ b/owl-bot-staging/google-cloud-security-private_ca-v1beta1/proto_docs/google/protobuf/timestamp.rb @@ -0,0 +1,127 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + + +module Google + module Protobuf + # A Timestamp represents a point in time independent of any time zone or local + # calendar, encoded as a count of seconds and fractions of seconds at + # nanosecond resolution. The count is relative to an epoch at UTC midnight on + # January 1, 1970, in the proleptic Gregorian calendar which extends the + # Gregorian calendar backwards to year one. + # + # All minutes are 60 seconds long. Leap seconds are "smeared" so that no leap + # second table is needed for interpretation, using a [24-hour linear + # smear](https://developers.google.com/time/smear). + # + # The range is from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59.999999999Z. By + # restricting to that range, we ensure that we can convert to and from [RFC + # 3339](https://www.ietf.org/rfc/rfc3339.txt) date strings. + # + # # Examples + # + # Example 1: Compute Timestamp from POSIX `time()`. + # + # Timestamp timestamp; + # timestamp.set_seconds(time(NULL)); + # timestamp.set_nanos(0); + # + # Example 2: Compute Timestamp from POSIX `gettimeofday()`. + # + # struct timeval tv; + # gettimeofday(&tv, NULL); + # + # Timestamp timestamp; + # timestamp.set_seconds(tv.tv_sec); + # timestamp.set_nanos(tv.tv_usec * 1000); + # + # Example 3: Compute Timestamp from Win32 `GetSystemTimeAsFileTime()`. + # + # FILETIME ft; + # GetSystemTimeAsFileTime(&ft); + # UINT64 ticks = (((UINT64)ft.dwHighDateTime) << 32) | ft.dwLowDateTime; + # + # // A Windows tick is 100 nanoseconds. Windows epoch 1601-01-01T00:00:00Z + # // is 11644473600 seconds before Unix epoch 1970-01-01T00:00:00Z. + # Timestamp timestamp; + # timestamp.set_seconds((INT64) ((ticks / 10000000) - 11644473600LL)); + # timestamp.set_nanos((INT32) ((ticks % 10000000) * 100)); + # + # Example 4: Compute Timestamp from Java `System.currentTimeMillis()`. + # + # long millis = System.currentTimeMillis(); + # + # Timestamp timestamp = Timestamp.newBuilder().setSeconds(millis / 1000) + # .setNanos((int) ((millis % 1000) * 1000000)).build(); + # + # Example 5: Compute Timestamp from Java `Instant.now()`. + # + # Instant now = Instant.now(); + # + # Timestamp timestamp = + # Timestamp.newBuilder().setSeconds(now.getEpochSecond()) + # .setNanos(now.getNano()).build(); + # + # Example 6: Compute Timestamp from current time in Python. + # + # timestamp = Timestamp() + # timestamp.GetCurrentTime() + # + # # JSON Mapping + # + # In JSON format, the Timestamp type is encoded as a string in the + # [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format. That is, the + # format is "\\{year}-\\{month}-\\{day}T\\{hour}:\\{min}:\\{sec}[.\\{frac_sec}]Z" + # where \\{year} is always expressed using four digits while \\{month}, \\{day}, + # \\{hour}, \\{min}, and \\{sec} are zero-padded to two digits each. The fractional + # seconds, which can go up to 9 digits (i.e. up to 1 nanosecond resolution), + # are optional. The "Z" suffix indicates the timezone ("UTC"); the timezone + # is required. A proto3 JSON serializer should always use UTC (as indicated by + # "Z") when printing the Timestamp type and a proto3 JSON parser should be + # able to accept both UTC and other timezones (as indicated by an offset). + # + # For example, "2017-01-15T01:30:15.01Z" encodes 15.01 seconds past + # 01:30 UTC on January 15, 2017. + # + # In JavaScript, one can convert a Date object to this format using the + # standard + # [toISOString()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toISOString) + # method. In Python, a standard `datetime.datetime` object can be converted + # to this format using + # [`strftime`](https://docs.python.org/2/library/time.html#time.strftime) with + # the time format spec '%Y-%m-%dT%H:%M:%S.%fZ'. Likewise, in Java, one can use + # the Joda Time's [`ISODateTimeFormat.dateTime()`]( + # http://joda-time.sourceforge.net/apidocs/org/joda/time/format/ISODateTimeFormat.html#dateTime() + # ) to obtain a formatter capable of generating timestamps in this format. + # @!attribute [rw] seconds + # @return [::Integer] + # Represents seconds of UTC time since Unix epoch + # 1970-01-01T00:00:00Z. Must be from 0001-01-01T00:00:00Z to + # 9999-12-31T23:59:59Z inclusive. + # @!attribute [rw] nanos + # @return [::Integer] + # Non-negative fractions of a second at nanosecond resolution. Negative + # second values with fractions must still have non-negative nanos values + # that count forward in time. Must be from 0 to 999,999,999 + # inclusive. + class Timestamp + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end +end diff --git a/owl-bot-staging/google-cloud-security-private_ca-v1beta1/proto_docs/google/protobuf/wrappers.rb b/owl-bot-staging/google-cloud-security-private_ca-v1beta1/proto_docs/google/protobuf/wrappers.rb new file mode 100644 index 000000000000..9a7c0269fa42 --- /dev/null +++ b/owl-bot-staging/google-cloud-security-private_ca-v1beta1/proto_docs/google/protobuf/wrappers.rb @@ -0,0 +1,148 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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 + # Wrapper message for `double`. + # + # The JSON representation for `DoubleValue` is JSON number. + # + # Not recommended for use in new APIs, but still useful for legacy APIs and + # has no plan to be removed. + # @!attribute [rw] value + # @return [::Float] + # The double value. + class DoubleValue + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Wrapper message for `float`. + # + # The JSON representation for `FloatValue` is JSON number. + # + # Not recommended for use in new APIs, but still useful for legacy APIs and + # has no plan to be removed. + # @!attribute [rw] value + # @return [::Float] + # The float value. + class FloatValue + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Wrapper message for `int64`. + # + # The JSON representation for `Int64Value` is JSON string. + # + # Not recommended for use in new APIs, but still useful for legacy APIs and + # has no plan to be removed. + # @!attribute [rw] value + # @return [::Integer] + # The int64 value. + class Int64Value + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Wrapper message for `uint64`. + # + # The JSON representation for `UInt64Value` is JSON string. + # + # Not recommended for use in new APIs, but still useful for legacy APIs and + # has no plan to be removed. + # @!attribute [rw] value + # @return [::Integer] + # The uint64 value. + class UInt64Value + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Wrapper message for `int32`. + # + # The JSON representation for `Int32Value` is JSON number. + # + # Not recommended for use in new APIs, but still useful for legacy APIs and + # has no plan to be removed. + # @!attribute [rw] value + # @return [::Integer] + # The int32 value. + class Int32Value + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Wrapper message for `uint32`. + # + # The JSON representation for `UInt32Value` is JSON number. + # + # Not recommended for use in new APIs, but still useful for legacy APIs and + # has no plan to be removed. + # @!attribute [rw] value + # @return [::Integer] + # The uint32 value. + class UInt32Value + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Wrapper message for `bool`. + # + # The JSON representation for `BoolValue` is JSON `true` and `false`. + # + # Not recommended for use in new APIs, but still useful for legacy APIs and + # has no plan to be removed. + # @!attribute [rw] value + # @return [::Boolean] + # The bool value. + class BoolValue + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Wrapper message for `string`. + # + # The JSON representation for `StringValue` is JSON string. + # + # Not recommended for use in new APIs, but still useful for legacy APIs and + # has no plan to be removed. + # @!attribute [rw] value + # @return [::String] + # The string value. + class StringValue + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Wrapper message for `bytes`. + # + # The JSON representation for `BytesValue` is JSON string. + # + # Not recommended for use in new APIs, but still useful for legacy APIs and + # has no plan to be removed. + # @!attribute [rw] value + # @return [::String] + # The bytes value. + class BytesValue + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end +end diff --git a/owl-bot-staging/google-cloud-security-private_ca-v1beta1/proto_docs/google/rpc/status.rb b/owl-bot-staging/google-cloud-security-private_ca-v1beta1/proto_docs/google/rpc/status.rb new file mode 100644 index 000000000000..c1a1c07eb2db --- /dev/null +++ b/owl-bot-staging/google-cloud-security-private_ca-v1beta1/proto_docs/google/rpc/status.rb @@ -0,0 +1,48 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + + +module Google + module Rpc + # The `Status` type defines a logical error model that is suitable for + # different programming environments, including REST APIs and RPC APIs. It is + # used by [gRPC](https://github.com/grpc). Each `Status` message contains + # three pieces of data: error code, error message, and error details. + # + # You can find out more about this error model and how to work with it in the + # [API Design Guide](https://cloud.google.com/apis/design/errors). + # @!attribute [rw] code + # @return [::Integer] + # The status code, which should be an enum value of + # [google.rpc.Code][google.rpc.Code]. + # @!attribute [rw] message + # @return [::String] + # A developer-facing error message, which should be in English. Any + # user-facing error message should be localized and sent in the + # {::Google::Rpc::Status#details google.rpc.Status.details} field, or localized + # by the client. + # @!attribute [rw] details + # @return [::Array<::Google::Protobuf::Any>] + # A list of messages that carry the error details. There is a common set of + # message types for APIs to use. + class Status + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end +end diff --git a/owl-bot-staging/google-cloud-security-private_ca-v1beta1/snippets/Gemfile b/owl-bot-staging/google-cloud-security-private_ca-v1beta1/snippets/Gemfile new file mode 100644 index 000000000000..adf37d01f04f --- /dev/null +++ b/owl-bot-staging/google-cloud-security-private_ca-v1beta1/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-security-private_ca-v1beta1", path: "../" +else + gem "google-cloud-security-private_ca-v1beta1" +end + +group :test do + gem "google-style", "~> 1.26.1" + gem "minitest", "~> 5.16" + gem "minitest-focus", "~> 1.1" + gem "minitest-hooks", "~> 1.5" +end diff --git a/owl-bot-staging/google-cloud-security-private_ca-v1beta1/snippets/certificate_authority_service/activate_certificate_authority.rb b/owl-bot-staging/google-cloud-security-private_ca-v1beta1/snippets/certificate_authority_service/activate_certificate_authority.rb new file mode 100644 index 000000000000..ab8a12841445 --- /dev/null +++ b/owl-bot-staging/google-cloud-security-private_ca-v1beta1/snippets/certificate_authority_service/activate_certificate_authority.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 privateca_v1beta1_generated_CertificateAuthorityService_ActivateCertificateAuthority_sync] +require "google/cloud/security/private_ca/v1beta1" + +## +# Snippet for the activate_certificate_authority call in the CertificateAuthorityService service +# +# This snippet has been automatically generated and should be regarded as a code +# template only. It will require modifications to work: +# - It may require correct/in-range values for request initialization. +# - It may require specifying regional endpoints when creating the service +# client as shown in https://cloud.google.com/ruby/docs/reference. +# +# This is an auto-generated example demonstrating basic usage of +# Google::Cloud::Security::PrivateCA::V1beta1::CertificateAuthorityService::Client#activate_certificate_authority. +# +def activate_certificate_authority + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Security::PrivateCA::V1beta1::CertificateAuthorityService::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Security::PrivateCA::V1beta1::ActivateCertificateAuthorityRequest.new + + # Call the activate_certificate_authority method. + result = client.activate_certificate_authority 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 privateca_v1beta1_generated_CertificateAuthorityService_ActivateCertificateAuthority_sync] diff --git a/owl-bot-staging/google-cloud-security-private_ca-v1beta1/snippets/certificate_authority_service/create_certificate.rb b/owl-bot-staging/google-cloud-security-private_ca-v1beta1/snippets/certificate_authority_service/create_certificate.rb new file mode 100644 index 000000000000..f6c5d439434c --- /dev/null +++ b/owl-bot-staging/google-cloud-security-private_ca-v1beta1/snippets/certificate_authority_service/create_certificate.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 privateca_v1beta1_generated_CertificateAuthorityService_CreateCertificate_sync] +require "google/cloud/security/private_ca/v1beta1" + +## +# Snippet for the create_certificate call in the CertificateAuthorityService service +# +# This snippet has been automatically generated and should be regarded as a code +# template only. It will require modifications to work: +# - It may require correct/in-range values for request initialization. +# - It may require specifying regional endpoints when creating the service +# client as shown in https://cloud.google.com/ruby/docs/reference. +# +# This is an auto-generated example demonstrating basic usage of +# Google::Cloud::Security::PrivateCA::V1beta1::CertificateAuthorityService::Client#create_certificate. +# +def create_certificate + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Security::PrivateCA::V1beta1::CertificateAuthorityService::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Security::PrivateCA::V1beta1::CreateCertificateRequest.new + + # Call the create_certificate method. + result = client.create_certificate request + + # The returned object is of type Google::Cloud::Security::PrivateCA::V1beta1::Certificate. + p result +end +# [END privateca_v1beta1_generated_CertificateAuthorityService_CreateCertificate_sync] diff --git a/owl-bot-staging/google-cloud-security-private_ca-v1beta1/snippets/certificate_authority_service/create_certificate_authority.rb b/owl-bot-staging/google-cloud-security-private_ca-v1beta1/snippets/certificate_authority_service/create_certificate_authority.rb new file mode 100644 index 000000000000..b2fe7f84db0b --- /dev/null +++ b/owl-bot-staging/google-cloud-security-private_ca-v1beta1/snippets/certificate_authority_service/create_certificate_authority.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 privateca_v1beta1_generated_CertificateAuthorityService_CreateCertificateAuthority_sync] +require "google/cloud/security/private_ca/v1beta1" + +## +# Snippet for the create_certificate_authority call in the CertificateAuthorityService service +# +# This snippet has been automatically generated and should be regarded as a code +# template only. It will require modifications to work: +# - It may require correct/in-range values for request initialization. +# - It may require specifying regional endpoints when creating the service +# client as shown in https://cloud.google.com/ruby/docs/reference. +# +# This is an auto-generated example demonstrating basic usage of +# Google::Cloud::Security::PrivateCA::V1beta1::CertificateAuthorityService::Client#create_certificate_authority. +# +def create_certificate_authority + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Security::PrivateCA::V1beta1::CertificateAuthorityService::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Security::PrivateCA::V1beta1::CreateCertificateAuthorityRequest.new + + # Call the create_certificate_authority method. + result = client.create_certificate_authority 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 privateca_v1beta1_generated_CertificateAuthorityService_CreateCertificateAuthority_sync] diff --git a/owl-bot-staging/google-cloud-security-private_ca-v1beta1/snippets/certificate_authority_service/disable_certificate_authority.rb b/owl-bot-staging/google-cloud-security-private_ca-v1beta1/snippets/certificate_authority_service/disable_certificate_authority.rb new file mode 100644 index 000000000000..6613651f079c --- /dev/null +++ b/owl-bot-staging/google-cloud-security-private_ca-v1beta1/snippets/certificate_authority_service/disable_certificate_authority.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 privateca_v1beta1_generated_CertificateAuthorityService_DisableCertificateAuthority_sync] +require "google/cloud/security/private_ca/v1beta1" + +## +# Snippet for the disable_certificate_authority call in the CertificateAuthorityService service +# +# This snippet has been automatically generated and should be regarded as a code +# template only. It will require modifications to work: +# - It may require correct/in-range values for request initialization. +# - It may require specifying regional endpoints when creating the service +# client as shown in https://cloud.google.com/ruby/docs/reference. +# +# This is an auto-generated example demonstrating basic usage of +# Google::Cloud::Security::PrivateCA::V1beta1::CertificateAuthorityService::Client#disable_certificate_authority. +# +def disable_certificate_authority + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Security::PrivateCA::V1beta1::CertificateAuthorityService::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Security::PrivateCA::V1beta1::DisableCertificateAuthorityRequest.new + + # Call the disable_certificate_authority method. + result = client.disable_certificate_authority 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 privateca_v1beta1_generated_CertificateAuthorityService_DisableCertificateAuthority_sync] diff --git a/owl-bot-staging/google-cloud-security-private_ca-v1beta1/snippets/certificate_authority_service/enable_certificate_authority.rb b/owl-bot-staging/google-cloud-security-private_ca-v1beta1/snippets/certificate_authority_service/enable_certificate_authority.rb new file mode 100644 index 000000000000..156ab4130e0f --- /dev/null +++ b/owl-bot-staging/google-cloud-security-private_ca-v1beta1/snippets/certificate_authority_service/enable_certificate_authority.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 privateca_v1beta1_generated_CertificateAuthorityService_EnableCertificateAuthority_sync] +require "google/cloud/security/private_ca/v1beta1" + +## +# Snippet for the enable_certificate_authority call in the CertificateAuthorityService service +# +# This snippet has been automatically generated and should be regarded as a code +# template only. It will require modifications to work: +# - It may require correct/in-range values for request initialization. +# - It may require specifying regional endpoints when creating the service +# client as shown in https://cloud.google.com/ruby/docs/reference. +# +# This is an auto-generated example demonstrating basic usage of +# Google::Cloud::Security::PrivateCA::V1beta1::CertificateAuthorityService::Client#enable_certificate_authority. +# +def enable_certificate_authority + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Security::PrivateCA::V1beta1::CertificateAuthorityService::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Security::PrivateCA::V1beta1::EnableCertificateAuthorityRequest.new + + # Call the enable_certificate_authority method. + result = client.enable_certificate_authority 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 privateca_v1beta1_generated_CertificateAuthorityService_EnableCertificateAuthority_sync] diff --git a/owl-bot-staging/google-cloud-security-private_ca-v1beta1/snippets/certificate_authority_service/fetch_certificate_authority_csr.rb b/owl-bot-staging/google-cloud-security-private_ca-v1beta1/snippets/certificate_authority_service/fetch_certificate_authority_csr.rb new file mode 100644 index 000000000000..bce7583a24ab --- /dev/null +++ b/owl-bot-staging/google-cloud-security-private_ca-v1beta1/snippets/certificate_authority_service/fetch_certificate_authority_csr.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 privateca_v1beta1_generated_CertificateAuthorityService_FetchCertificateAuthorityCsr_sync] +require "google/cloud/security/private_ca/v1beta1" + +## +# Snippet for the fetch_certificate_authority_csr call in the CertificateAuthorityService service +# +# This snippet has been automatically generated and should be regarded as a code +# template only. It will require modifications to work: +# - It may require correct/in-range values for request initialization. +# - It may require specifying regional endpoints when creating the service +# client as shown in https://cloud.google.com/ruby/docs/reference. +# +# This is an auto-generated example demonstrating basic usage of +# Google::Cloud::Security::PrivateCA::V1beta1::CertificateAuthorityService::Client#fetch_certificate_authority_csr. +# +def fetch_certificate_authority_csr + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Security::PrivateCA::V1beta1::CertificateAuthorityService::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Security::PrivateCA::V1beta1::FetchCertificateAuthorityCsrRequest.new + + # Call the fetch_certificate_authority_csr method. + result = client.fetch_certificate_authority_csr request + + # The returned object is of type Google::Cloud::Security::PrivateCA::V1beta1::FetchCertificateAuthorityCsrResponse. + p result +end +# [END privateca_v1beta1_generated_CertificateAuthorityService_FetchCertificateAuthorityCsr_sync] diff --git a/owl-bot-staging/google-cloud-security-private_ca-v1beta1/snippets/certificate_authority_service/get_certificate.rb b/owl-bot-staging/google-cloud-security-private_ca-v1beta1/snippets/certificate_authority_service/get_certificate.rb new file mode 100644 index 000000000000..962f824a4495 --- /dev/null +++ b/owl-bot-staging/google-cloud-security-private_ca-v1beta1/snippets/certificate_authority_service/get_certificate.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 privateca_v1beta1_generated_CertificateAuthorityService_GetCertificate_sync] +require "google/cloud/security/private_ca/v1beta1" + +## +# Snippet for the get_certificate call in the CertificateAuthorityService service +# +# This snippet has been automatically generated and should be regarded as a code +# template only. It will require modifications to work: +# - It may require correct/in-range values for request initialization. +# - It may require specifying regional endpoints when creating the service +# client as shown in https://cloud.google.com/ruby/docs/reference. +# +# This is an auto-generated example demonstrating basic usage of +# Google::Cloud::Security::PrivateCA::V1beta1::CertificateAuthorityService::Client#get_certificate. +# +def get_certificate + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Security::PrivateCA::V1beta1::CertificateAuthorityService::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Security::PrivateCA::V1beta1::GetCertificateRequest.new + + # Call the get_certificate method. + result = client.get_certificate request + + # The returned object is of type Google::Cloud::Security::PrivateCA::V1beta1::Certificate. + p result +end +# [END privateca_v1beta1_generated_CertificateAuthorityService_GetCertificate_sync] diff --git a/owl-bot-staging/google-cloud-security-private_ca-v1beta1/snippets/certificate_authority_service/get_certificate_authority.rb b/owl-bot-staging/google-cloud-security-private_ca-v1beta1/snippets/certificate_authority_service/get_certificate_authority.rb new file mode 100644 index 000000000000..b9a58c2a9ff6 --- /dev/null +++ b/owl-bot-staging/google-cloud-security-private_ca-v1beta1/snippets/certificate_authority_service/get_certificate_authority.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 privateca_v1beta1_generated_CertificateAuthorityService_GetCertificateAuthority_sync] +require "google/cloud/security/private_ca/v1beta1" + +## +# Snippet for the get_certificate_authority call in the CertificateAuthorityService service +# +# This snippet has been automatically generated and should be regarded as a code +# template only. It will require modifications to work: +# - It may require correct/in-range values for request initialization. +# - It may require specifying regional endpoints when creating the service +# client as shown in https://cloud.google.com/ruby/docs/reference. +# +# This is an auto-generated example demonstrating basic usage of +# Google::Cloud::Security::PrivateCA::V1beta1::CertificateAuthorityService::Client#get_certificate_authority. +# +def get_certificate_authority + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Security::PrivateCA::V1beta1::CertificateAuthorityService::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Security::PrivateCA::V1beta1::GetCertificateAuthorityRequest.new + + # Call the get_certificate_authority method. + result = client.get_certificate_authority request + + # The returned object is of type Google::Cloud::Security::PrivateCA::V1beta1::CertificateAuthority. + p result +end +# [END privateca_v1beta1_generated_CertificateAuthorityService_GetCertificateAuthority_sync] diff --git a/owl-bot-staging/google-cloud-security-private_ca-v1beta1/snippets/certificate_authority_service/get_certificate_revocation_list.rb b/owl-bot-staging/google-cloud-security-private_ca-v1beta1/snippets/certificate_authority_service/get_certificate_revocation_list.rb new file mode 100644 index 000000000000..a380979a1c64 --- /dev/null +++ b/owl-bot-staging/google-cloud-security-private_ca-v1beta1/snippets/certificate_authority_service/get_certificate_revocation_list.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 privateca_v1beta1_generated_CertificateAuthorityService_GetCertificateRevocationList_sync] +require "google/cloud/security/private_ca/v1beta1" + +## +# Snippet for the get_certificate_revocation_list call in the CertificateAuthorityService service +# +# This snippet has been automatically generated and should be regarded as a code +# template only. It will require modifications to work: +# - It may require correct/in-range values for request initialization. +# - It may require specifying regional endpoints when creating the service +# client as shown in https://cloud.google.com/ruby/docs/reference. +# +# This is an auto-generated example demonstrating basic usage of +# Google::Cloud::Security::PrivateCA::V1beta1::CertificateAuthorityService::Client#get_certificate_revocation_list. +# +def get_certificate_revocation_list + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Security::PrivateCA::V1beta1::CertificateAuthorityService::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Security::PrivateCA::V1beta1::GetCertificateRevocationListRequest.new + + # Call the get_certificate_revocation_list method. + result = client.get_certificate_revocation_list request + + # The returned object is of type Google::Cloud::Security::PrivateCA::V1beta1::CertificateRevocationList. + p result +end +# [END privateca_v1beta1_generated_CertificateAuthorityService_GetCertificateRevocationList_sync] diff --git a/owl-bot-staging/google-cloud-security-private_ca-v1beta1/snippets/certificate_authority_service/get_reusable_config.rb b/owl-bot-staging/google-cloud-security-private_ca-v1beta1/snippets/certificate_authority_service/get_reusable_config.rb new file mode 100644 index 000000000000..6a7a96769e22 --- /dev/null +++ b/owl-bot-staging/google-cloud-security-private_ca-v1beta1/snippets/certificate_authority_service/get_reusable_config.rb @@ -0,0 +1,47 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +# [START privateca_v1beta1_generated_CertificateAuthorityService_GetReusableConfig_sync] +require "google/cloud/security/private_ca/v1beta1" + +## +# Snippet for the get_reusable_config call in the CertificateAuthorityService service +# +# This snippet has been automatically generated and should be regarded as a code +# template only. It will require modifications to work: +# - It may require correct/in-range values for request initialization. +# - It may require specifying regional endpoints when creating the service +# client as shown in https://cloud.google.com/ruby/docs/reference. +# +# This is an auto-generated example demonstrating basic usage of +# Google::Cloud::Security::PrivateCA::V1beta1::CertificateAuthorityService::Client#get_reusable_config. +# +def get_reusable_config + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Security::PrivateCA::V1beta1::CertificateAuthorityService::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Security::PrivateCA::V1beta1::GetReusableConfigRequest.new + + # Call the get_reusable_config method. + result = client.get_reusable_config request + + # The returned object is of type Google::Cloud::Security::PrivateCA::V1beta1::ReusableConfig. + p result +end +# [END privateca_v1beta1_generated_CertificateAuthorityService_GetReusableConfig_sync] diff --git a/owl-bot-staging/google-cloud-security-private_ca-v1beta1/snippets/certificate_authority_service/list_certificate_authorities.rb b/owl-bot-staging/google-cloud-security-private_ca-v1beta1/snippets/certificate_authority_service/list_certificate_authorities.rb new file mode 100644 index 000000000000..fdb7607043c0 --- /dev/null +++ b/owl-bot-staging/google-cloud-security-private_ca-v1beta1/snippets/certificate_authority_service/list_certificate_authorities.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 privateca_v1beta1_generated_CertificateAuthorityService_ListCertificateAuthorities_sync] +require "google/cloud/security/private_ca/v1beta1" + +## +# Snippet for the list_certificate_authorities call in the CertificateAuthorityService service +# +# This snippet has been automatically generated and should be regarded as a code +# template only. It will require modifications to work: +# - It may require correct/in-range values for request initialization. +# - It may require specifying regional endpoints when creating the service +# client as shown in https://cloud.google.com/ruby/docs/reference. +# +# This is an auto-generated example demonstrating basic usage of +# Google::Cloud::Security::PrivateCA::V1beta1::CertificateAuthorityService::Client#list_certificate_authorities. +# +def list_certificate_authorities + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Security::PrivateCA::V1beta1::CertificateAuthorityService::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Security::PrivateCA::V1beta1::ListCertificateAuthoritiesRequest.new + + # Call the list_certificate_authorities method. + result = client.list_certificate_authorities request + + # The returned object is of type Gapic::PagedEnumerable. You can iterate + # over elements, and API calls will be issued to fetch pages as needed. + result.each do |item| + # Each element is of type ::Google::Cloud::Security::PrivateCA::V1beta1::CertificateAuthority. + p item + end +end +# [END privateca_v1beta1_generated_CertificateAuthorityService_ListCertificateAuthorities_sync] diff --git a/owl-bot-staging/google-cloud-security-private_ca-v1beta1/snippets/certificate_authority_service/list_certificate_revocation_lists.rb b/owl-bot-staging/google-cloud-security-private_ca-v1beta1/snippets/certificate_authority_service/list_certificate_revocation_lists.rb new file mode 100644 index 000000000000..158024198454 --- /dev/null +++ b/owl-bot-staging/google-cloud-security-private_ca-v1beta1/snippets/certificate_authority_service/list_certificate_revocation_lists.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 privateca_v1beta1_generated_CertificateAuthorityService_ListCertificateRevocationLists_sync] +require "google/cloud/security/private_ca/v1beta1" + +## +# Snippet for the list_certificate_revocation_lists call in the CertificateAuthorityService service +# +# This snippet has been automatically generated and should be regarded as a code +# template only. It will require modifications to work: +# - It may require correct/in-range values for request initialization. +# - It may require specifying regional endpoints when creating the service +# client as shown in https://cloud.google.com/ruby/docs/reference. +# +# This is an auto-generated example demonstrating basic usage of +# Google::Cloud::Security::PrivateCA::V1beta1::CertificateAuthorityService::Client#list_certificate_revocation_lists. +# +def list_certificate_revocation_lists + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Security::PrivateCA::V1beta1::CertificateAuthorityService::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Security::PrivateCA::V1beta1::ListCertificateRevocationListsRequest.new + + # Call the list_certificate_revocation_lists method. + result = client.list_certificate_revocation_lists request + + # The returned object is of type Gapic::PagedEnumerable. You can iterate + # over elements, and API calls will be issued to fetch pages as needed. + result.each do |item| + # Each element is of type ::Google::Cloud::Security::PrivateCA::V1beta1::CertificateRevocationList. + p item + end +end +# [END privateca_v1beta1_generated_CertificateAuthorityService_ListCertificateRevocationLists_sync] diff --git a/owl-bot-staging/google-cloud-security-private_ca-v1beta1/snippets/certificate_authority_service/list_certificates.rb b/owl-bot-staging/google-cloud-security-private_ca-v1beta1/snippets/certificate_authority_service/list_certificates.rb new file mode 100644 index 000000000000..2b396f505408 --- /dev/null +++ b/owl-bot-staging/google-cloud-security-private_ca-v1beta1/snippets/certificate_authority_service/list_certificates.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 privateca_v1beta1_generated_CertificateAuthorityService_ListCertificates_sync] +require "google/cloud/security/private_ca/v1beta1" + +## +# Snippet for the list_certificates call in the CertificateAuthorityService service +# +# This snippet has been automatically generated and should be regarded as a code +# template only. It will require modifications to work: +# - It may require correct/in-range values for request initialization. +# - It may require specifying regional endpoints when creating the service +# client as shown in https://cloud.google.com/ruby/docs/reference. +# +# This is an auto-generated example demonstrating basic usage of +# Google::Cloud::Security::PrivateCA::V1beta1::CertificateAuthorityService::Client#list_certificates. +# +def list_certificates + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Security::PrivateCA::V1beta1::CertificateAuthorityService::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Security::PrivateCA::V1beta1::ListCertificatesRequest.new + + # Call the list_certificates method. + result = client.list_certificates request + + # The returned object is of type Gapic::PagedEnumerable. You can iterate + # over elements, and API calls will be issued to fetch pages as needed. + result.each do |item| + # Each element is of type ::Google::Cloud::Security::PrivateCA::V1beta1::Certificate. + p item + end +end +# [END privateca_v1beta1_generated_CertificateAuthorityService_ListCertificates_sync] diff --git a/owl-bot-staging/google-cloud-security-private_ca-v1beta1/snippets/certificate_authority_service/list_reusable_configs.rb b/owl-bot-staging/google-cloud-security-private_ca-v1beta1/snippets/certificate_authority_service/list_reusable_configs.rb new file mode 100644 index 000000000000..d437b3c44dc1 --- /dev/null +++ b/owl-bot-staging/google-cloud-security-private_ca-v1beta1/snippets/certificate_authority_service/list_reusable_configs.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 privateca_v1beta1_generated_CertificateAuthorityService_ListReusableConfigs_sync] +require "google/cloud/security/private_ca/v1beta1" + +## +# Snippet for the list_reusable_configs call in the CertificateAuthorityService service +# +# This snippet has been automatically generated and should be regarded as a code +# template only. It will require modifications to work: +# - It may require correct/in-range values for request initialization. +# - It may require specifying regional endpoints when creating the service +# client as shown in https://cloud.google.com/ruby/docs/reference. +# +# This is an auto-generated example demonstrating basic usage of +# Google::Cloud::Security::PrivateCA::V1beta1::CertificateAuthorityService::Client#list_reusable_configs. +# +def list_reusable_configs + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Security::PrivateCA::V1beta1::CertificateAuthorityService::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Security::PrivateCA::V1beta1::ListReusableConfigsRequest.new + + # Call the list_reusable_configs method. + result = client.list_reusable_configs request + + # The returned object is of type Gapic::PagedEnumerable. You can iterate + # over elements, and API calls will be issued to fetch pages as needed. + result.each do |item| + # Each element is of type ::Google::Cloud::Security::PrivateCA::V1beta1::ReusableConfig. + p item + end +end +# [END privateca_v1beta1_generated_CertificateAuthorityService_ListReusableConfigs_sync] diff --git a/owl-bot-staging/google-cloud-security-private_ca-v1beta1/snippets/certificate_authority_service/restore_certificate_authority.rb b/owl-bot-staging/google-cloud-security-private_ca-v1beta1/snippets/certificate_authority_service/restore_certificate_authority.rb new file mode 100644 index 000000000000..e19de799588b --- /dev/null +++ b/owl-bot-staging/google-cloud-security-private_ca-v1beta1/snippets/certificate_authority_service/restore_certificate_authority.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 privateca_v1beta1_generated_CertificateAuthorityService_RestoreCertificateAuthority_sync] +require "google/cloud/security/private_ca/v1beta1" + +## +# Snippet for the restore_certificate_authority call in the CertificateAuthorityService service +# +# This snippet has been automatically generated and should be regarded as a code +# template only. It will require modifications to work: +# - It may require correct/in-range values for request initialization. +# - It may require specifying regional endpoints when creating the service +# client as shown in https://cloud.google.com/ruby/docs/reference. +# +# This is an auto-generated example demonstrating basic usage of +# Google::Cloud::Security::PrivateCA::V1beta1::CertificateAuthorityService::Client#restore_certificate_authority. +# +def restore_certificate_authority + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Security::PrivateCA::V1beta1::CertificateAuthorityService::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Security::PrivateCA::V1beta1::RestoreCertificateAuthorityRequest.new + + # Call the restore_certificate_authority method. + result = client.restore_certificate_authority 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 privateca_v1beta1_generated_CertificateAuthorityService_RestoreCertificateAuthority_sync] diff --git a/owl-bot-staging/google-cloud-security-private_ca-v1beta1/snippets/certificate_authority_service/revoke_certificate.rb b/owl-bot-staging/google-cloud-security-private_ca-v1beta1/snippets/certificate_authority_service/revoke_certificate.rb new file mode 100644 index 000000000000..08d0bd7161b6 --- /dev/null +++ b/owl-bot-staging/google-cloud-security-private_ca-v1beta1/snippets/certificate_authority_service/revoke_certificate.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 privateca_v1beta1_generated_CertificateAuthorityService_RevokeCertificate_sync] +require "google/cloud/security/private_ca/v1beta1" + +## +# Snippet for the revoke_certificate call in the CertificateAuthorityService service +# +# This snippet has been automatically generated and should be regarded as a code +# template only. It will require modifications to work: +# - It may require correct/in-range values for request initialization. +# - It may require specifying regional endpoints when creating the service +# client as shown in https://cloud.google.com/ruby/docs/reference. +# +# This is an auto-generated example demonstrating basic usage of +# Google::Cloud::Security::PrivateCA::V1beta1::CertificateAuthorityService::Client#revoke_certificate. +# +def revoke_certificate + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Security::PrivateCA::V1beta1::CertificateAuthorityService::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Security::PrivateCA::V1beta1::RevokeCertificateRequest.new + + # Call the revoke_certificate method. + result = client.revoke_certificate request + + # The returned object is of type Google::Cloud::Security::PrivateCA::V1beta1::Certificate. + p result +end +# [END privateca_v1beta1_generated_CertificateAuthorityService_RevokeCertificate_sync] diff --git a/owl-bot-staging/google-cloud-security-private_ca-v1beta1/snippets/certificate_authority_service/schedule_delete_certificate_authority.rb b/owl-bot-staging/google-cloud-security-private_ca-v1beta1/snippets/certificate_authority_service/schedule_delete_certificate_authority.rb new file mode 100644 index 000000000000..2b22da6654c9 --- /dev/null +++ b/owl-bot-staging/google-cloud-security-private_ca-v1beta1/snippets/certificate_authority_service/schedule_delete_certificate_authority.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 privateca_v1beta1_generated_CertificateAuthorityService_ScheduleDeleteCertificateAuthority_sync] +require "google/cloud/security/private_ca/v1beta1" + +## +# Snippet for the schedule_delete_certificate_authority call in the CertificateAuthorityService service +# +# This snippet has been automatically generated and should be regarded as a code +# template only. It will require modifications to work: +# - It may require correct/in-range values for request initialization. +# - It may require specifying regional endpoints when creating the service +# client as shown in https://cloud.google.com/ruby/docs/reference. +# +# This is an auto-generated example demonstrating basic usage of +# Google::Cloud::Security::PrivateCA::V1beta1::CertificateAuthorityService::Client#schedule_delete_certificate_authority. +# +def schedule_delete_certificate_authority + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Security::PrivateCA::V1beta1::CertificateAuthorityService::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Security::PrivateCA::V1beta1::ScheduleDeleteCertificateAuthorityRequest.new + + # Call the schedule_delete_certificate_authority method. + result = client.schedule_delete_certificate_authority 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 privateca_v1beta1_generated_CertificateAuthorityService_ScheduleDeleteCertificateAuthority_sync] diff --git a/owl-bot-staging/google-cloud-security-private_ca-v1beta1/snippets/certificate_authority_service/update_certificate.rb b/owl-bot-staging/google-cloud-security-private_ca-v1beta1/snippets/certificate_authority_service/update_certificate.rb new file mode 100644 index 000000000000..eb82a46e2dc6 --- /dev/null +++ b/owl-bot-staging/google-cloud-security-private_ca-v1beta1/snippets/certificate_authority_service/update_certificate.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 privateca_v1beta1_generated_CertificateAuthorityService_UpdateCertificate_sync] +require "google/cloud/security/private_ca/v1beta1" + +## +# Snippet for the update_certificate call in the CertificateAuthorityService service +# +# This snippet has been automatically generated and should be regarded as a code +# template only. It will require modifications to work: +# - It may require correct/in-range values for request initialization. +# - It may require specifying regional endpoints when creating the service +# client as shown in https://cloud.google.com/ruby/docs/reference. +# +# This is an auto-generated example demonstrating basic usage of +# Google::Cloud::Security::PrivateCA::V1beta1::CertificateAuthorityService::Client#update_certificate. +# +def update_certificate + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Security::PrivateCA::V1beta1::CertificateAuthorityService::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Security::PrivateCA::V1beta1::UpdateCertificateRequest.new + + # Call the update_certificate method. + result = client.update_certificate request + + # The returned object is of type Google::Cloud::Security::PrivateCA::V1beta1::Certificate. + p result +end +# [END privateca_v1beta1_generated_CertificateAuthorityService_UpdateCertificate_sync] diff --git a/owl-bot-staging/google-cloud-security-private_ca-v1beta1/snippets/certificate_authority_service/update_certificate_authority.rb b/owl-bot-staging/google-cloud-security-private_ca-v1beta1/snippets/certificate_authority_service/update_certificate_authority.rb new file mode 100644 index 000000000000..62a552d0ae19 --- /dev/null +++ b/owl-bot-staging/google-cloud-security-private_ca-v1beta1/snippets/certificate_authority_service/update_certificate_authority.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 privateca_v1beta1_generated_CertificateAuthorityService_UpdateCertificateAuthority_sync] +require "google/cloud/security/private_ca/v1beta1" + +## +# Snippet for the update_certificate_authority call in the CertificateAuthorityService service +# +# This snippet has been automatically generated and should be regarded as a code +# template only. It will require modifications to work: +# - It may require correct/in-range values for request initialization. +# - It may require specifying regional endpoints when creating the service +# client as shown in https://cloud.google.com/ruby/docs/reference. +# +# This is an auto-generated example demonstrating basic usage of +# Google::Cloud::Security::PrivateCA::V1beta1::CertificateAuthorityService::Client#update_certificate_authority. +# +def update_certificate_authority + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Security::PrivateCA::V1beta1::CertificateAuthorityService::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Security::PrivateCA::V1beta1::UpdateCertificateAuthorityRequest.new + + # Call the update_certificate_authority method. + result = client.update_certificate_authority 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 privateca_v1beta1_generated_CertificateAuthorityService_UpdateCertificateAuthority_sync] diff --git a/owl-bot-staging/google-cloud-security-private_ca-v1beta1/snippets/certificate_authority_service/update_certificate_revocation_list.rb b/owl-bot-staging/google-cloud-security-private_ca-v1beta1/snippets/certificate_authority_service/update_certificate_revocation_list.rb new file mode 100644 index 000000000000..2755200a457d --- /dev/null +++ b/owl-bot-staging/google-cloud-security-private_ca-v1beta1/snippets/certificate_authority_service/update_certificate_revocation_list.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 privateca_v1beta1_generated_CertificateAuthorityService_UpdateCertificateRevocationList_sync] +require "google/cloud/security/private_ca/v1beta1" + +## +# Snippet for the update_certificate_revocation_list call in the CertificateAuthorityService service +# +# This snippet has been automatically generated and should be regarded as a code +# template only. It will require modifications to work: +# - It may require correct/in-range values for request initialization. +# - It may require specifying regional endpoints when creating the service +# client as shown in https://cloud.google.com/ruby/docs/reference. +# +# This is an auto-generated example demonstrating basic usage of +# Google::Cloud::Security::PrivateCA::V1beta1::CertificateAuthorityService::Client#update_certificate_revocation_list. +# +def update_certificate_revocation_list + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Security::PrivateCA::V1beta1::CertificateAuthorityService::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Security::PrivateCA::V1beta1::UpdateCertificateRevocationListRequest.new + + # Call the update_certificate_revocation_list method. + result = client.update_certificate_revocation_list 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 privateca_v1beta1_generated_CertificateAuthorityService_UpdateCertificateRevocationList_sync] diff --git a/owl-bot-staging/google-cloud-security-private_ca-v1beta1/snippets/snippet_metadata_google.cloud.security.privateca.v1beta1.json b/owl-bot-staging/google-cloud-security-private_ca-v1beta1/snippets/snippet_metadata_google.cloud.security.privateca.v1beta1.json new file mode 100644 index 000000000000..78cd94bd4302 --- /dev/null +++ b/owl-bot-staging/google-cloud-security-private_ca-v1beta1/snippets/snippet_metadata_google.cloud.security.privateca.v1beta1.json @@ -0,0 +1,815 @@ +{ + "client_library": { + "name": "google-cloud-security-private_ca-v1beta1", + "version": "", + "language": "RUBY", + "apis": [ + { + "id": "google.cloud.security.privateca.v1beta1", + "version": "v1beta1" + } + ] + }, + "snippets": [ + { + "region_tag": "privateca_v1beta1_generated_CertificateAuthorityService_CreateCertificate_sync", + "title": "Snippet for the create_certificate call in the CertificateAuthorityService service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Security::PrivateCA::V1beta1::CertificateAuthorityService::Client#create_certificate.", + "file": "certificate_authority_service/create_certificate.rb", + "language": "RUBY", + "client_method": { + "short_name": "create_certificate", + "full_name": "::Google::Cloud::Security::PrivateCA::V1beta1::CertificateAuthorityService::Client#create_certificate", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::Security::PrivateCA::V1beta1::CreateCertificateRequest", + "name": "request" + } + ], + "result_type": "::Google::Cloud::Security::PrivateCA::V1beta1::Certificate", + "client": { + "short_name": "CertificateAuthorityService::Client", + "full_name": "::Google::Cloud::Security::PrivateCA::V1beta1::CertificateAuthorityService::Client" + }, + "method": { + "short_name": "CreateCertificate", + "full_name": "google.cloud.security.privateca.v1beta1.CertificateAuthorityService.CreateCertificate", + "service": { + "short_name": "CertificateAuthorityService", + "full_name": "google.cloud.security.privateca.v1beta1.CertificateAuthorityService" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 46, + "type": "FULL" + } + ] + }, + { + "region_tag": "privateca_v1beta1_generated_CertificateAuthorityService_GetCertificate_sync", + "title": "Snippet for the get_certificate call in the CertificateAuthorityService service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Security::PrivateCA::V1beta1::CertificateAuthorityService::Client#get_certificate.", + "file": "certificate_authority_service/get_certificate.rb", + "language": "RUBY", + "client_method": { + "short_name": "get_certificate", + "full_name": "::Google::Cloud::Security::PrivateCA::V1beta1::CertificateAuthorityService::Client#get_certificate", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::Security::PrivateCA::V1beta1::GetCertificateRequest", + "name": "request" + } + ], + "result_type": "::Google::Cloud::Security::PrivateCA::V1beta1::Certificate", + "client": { + "short_name": "CertificateAuthorityService::Client", + "full_name": "::Google::Cloud::Security::PrivateCA::V1beta1::CertificateAuthorityService::Client" + }, + "method": { + "short_name": "GetCertificate", + "full_name": "google.cloud.security.privateca.v1beta1.CertificateAuthorityService.GetCertificate", + "service": { + "short_name": "CertificateAuthorityService", + "full_name": "google.cloud.security.privateca.v1beta1.CertificateAuthorityService" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 46, + "type": "FULL" + } + ] + }, + { + "region_tag": "privateca_v1beta1_generated_CertificateAuthorityService_ListCertificates_sync", + "title": "Snippet for the list_certificates call in the CertificateAuthorityService service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Security::PrivateCA::V1beta1::CertificateAuthorityService::Client#list_certificates.", + "file": "certificate_authority_service/list_certificates.rb", + "language": "RUBY", + "client_method": { + "short_name": "list_certificates", + "full_name": "::Google::Cloud::Security::PrivateCA::V1beta1::CertificateAuthorityService::Client#list_certificates", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::Security::PrivateCA::V1beta1::ListCertificatesRequest", + "name": "request" + } + ], + "result_type": "::Google::Cloud::Security::PrivateCA::V1beta1::ListCertificatesResponse", + "client": { + "short_name": "CertificateAuthorityService::Client", + "full_name": "::Google::Cloud::Security::PrivateCA::V1beta1::CertificateAuthorityService::Client" + }, + "method": { + "short_name": "ListCertificates", + "full_name": "google.cloud.security.privateca.v1beta1.CertificateAuthorityService.ListCertificates", + "service": { + "short_name": "CertificateAuthorityService", + "full_name": "google.cloud.security.privateca.v1beta1.CertificateAuthorityService" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 50, + "type": "FULL" + } + ] + }, + { + "region_tag": "privateca_v1beta1_generated_CertificateAuthorityService_RevokeCertificate_sync", + "title": "Snippet for the revoke_certificate call in the CertificateAuthorityService service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Security::PrivateCA::V1beta1::CertificateAuthorityService::Client#revoke_certificate.", + "file": "certificate_authority_service/revoke_certificate.rb", + "language": "RUBY", + "client_method": { + "short_name": "revoke_certificate", + "full_name": "::Google::Cloud::Security::PrivateCA::V1beta1::CertificateAuthorityService::Client#revoke_certificate", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::Security::PrivateCA::V1beta1::RevokeCertificateRequest", + "name": "request" + } + ], + "result_type": "::Google::Cloud::Security::PrivateCA::V1beta1::Certificate", + "client": { + "short_name": "CertificateAuthorityService::Client", + "full_name": "::Google::Cloud::Security::PrivateCA::V1beta1::CertificateAuthorityService::Client" + }, + "method": { + "short_name": "RevokeCertificate", + "full_name": "google.cloud.security.privateca.v1beta1.CertificateAuthorityService.RevokeCertificate", + "service": { + "short_name": "CertificateAuthorityService", + "full_name": "google.cloud.security.privateca.v1beta1.CertificateAuthorityService" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 46, + "type": "FULL" + } + ] + }, + { + "region_tag": "privateca_v1beta1_generated_CertificateAuthorityService_UpdateCertificate_sync", + "title": "Snippet for the update_certificate call in the CertificateAuthorityService service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Security::PrivateCA::V1beta1::CertificateAuthorityService::Client#update_certificate.", + "file": "certificate_authority_service/update_certificate.rb", + "language": "RUBY", + "client_method": { + "short_name": "update_certificate", + "full_name": "::Google::Cloud::Security::PrivateCA::V1beta1::CertificateAuthorityService::Client#update_certificate", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::Security::PrivateCA::V1beta1::UpdateCertificateRequest", + "name": "request" + } + ], + "result_type": "::Google::Cloud::Security::PrivateCA::V1beta1::Certificate", + "client": { + "short_name": "CertificateAuthorityService::Client", + "full_name": "::Google::Cloud::Security::PrivateCA::V1beta1::CertificateAuthorityService::Client" + }, + "method": { + "short_name": "UpdateCertificate", + "full_name": "google.cloud.security.privateca.v1beta1.CertificateAuthorityService.UpdateCertificate", + "service": { + "short_name": "CertificateAuthorityService", + "full_name": "google.cloud.security.privateca.v1beta1.CertificateAuthorityService" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 46, + "type": "FULL" + } + ] + }, + { + "region_tag": "privateca_v1beta1_generated_CertificateAuthorityService_ActivateCertificateAuthority_sync", + "title": "Snippet for the activate_certificate_authority call in the CertificateAuthorityService service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Security::PrivateCA::V1beta1::CertificateAuthorityService::Client#activate_certificate_authority.", + "file": "certificate_authority_service/activate_certificate_authority.rb", + "language": "RUBY", + "client_method": { + "short_name": "activate_certificate_authority", + "full_name": "::Google::Cloud::Security::PrivateCA::V1beta1::CertificateAuthorityService::Client#activate_certificate_authority", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::Security::PrivateCA::V1beta1::ActivateCertificateAuthorityRequest", + "name": "request" + } + ], + "result_type": "::Google::Longrunning::Operation", + "client": { + "short_name": "CertificateAuthorityService::Client", + "full_name": "::Google::Cloud::Security::PrivateCA::V1beta1::CertificateAuthorityService::Client" + }, + "method": { + "short_name": "ActivateCertificateAuthority", + "full_name": "google.cloud.security.privateca.v1beta1.CertificateAuthorityService.ActivateCertificateAuthority", + "service": { + "short_name": "CertificateAuthorityService", + "full_name": "google.cloud.security.privateca.v1beta1.CertificateAuthorityService" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 53, + "type": "FULL" + } + ] + }, + { + "region_tag": "privateca_v1beta1_generated_CertificateAuthorityService_CreateCertificateAuthority_sync", + "title": "Snippet for the create_certificate_authority call in the CertificateAuthorityService service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Security::PrivateCA::V1beta1::CertificateAuthorityService::Client#create_certificate_authority.", + "file": "certificate_authority_service/create_certificate_authority.rb", + "language": "RUBY", + "client_method": { + "short_name": "create_certificate_authority", + "full_name": "::Google::Cloud::Security::PrivateCA::V1beta1::CertificateAuthorityService::Client#create_certificate_authority", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::Security::PrivateCA::V1beta1::CreateCertificateAuthorityRequest", + "name": "request" + } + ], + "result_type": "::Google::Longrunning::Operation", + "client": { + "short_name": "CertificateAuthorityService::Client", + "full_name": "::Google::Cloud::Security::PrivateCA::V1beta1::CertificateAuthorityService::Client" + }, + "method": { + "short_name": "CreateCertificateAuthority", + "full_name": "google.cloud.security.privateca.v1beta1.CertificateAuthorityService.CreateCertificateAuthority", + "service": { + "short_name": "CertificateAuthorityService", + "full_name": "google.cloud.security.privateca.v1beta1.CertificateAuthorityService" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 53, + "type": "FULL" + } + ] + }, + { + "region_tag": "privateca_v1beta1_generated_CertificateAuthorityService_DisableCertificateAuthority_sync", + "title": "Snippet for the disable_certificate_authority call in the CertificateAuthorityService service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Security::PrivateCA::V1beta1::CertificateAuthorityService::Client#disable_certificate_authority.", + "file": "certificate_authority_service/disable_certificate_authority.rb", + "language": "RUBY", + "client_method": { + "short_name": "disable_certificate_authority", + "full_name": "::Google::Cloud::Security::PrivateCA::V1beta1::CertificateAuthorityService::Client#disable_certificate_authority", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::Security::PrivateCA::V1beta1::DisableCertificateAuthorityRequest", + "name": "request" + } + ], + "result_type": "::Google::Longrunning::Operation", + "client": { + "short_name": "CertificateAuthorityService::Client", + "full_name": "::Google::Cloud::Security::PrivateCA::V1beta1::CertificateAuthorityService::Client" + }, + "method": { + "short_name": "DisableCertificateAuthority", + "full_name": "google.cloud.security.privateca.v1beta1.CertificateAuthorityService.DisableCertificateAuthority", + "service": { + "short_name": "CertificateAuthorityService", + "full_name": "google.cloud.security.privateca.v1beta1.CertificateAuthorityService" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 53, + "type": "FULL" + } + ] + }, + { + "region_tag": "privateca_v1beta1_generated_CertificateAuthorityService_EnableCertificateAuthority_sync", + "title": "Snippet for the enable_certificate_authority call in the CertificateAuthorityService service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Security::PrivateCA::V1beta1::CertificateAuthorityService::Client#enable_certificate_authority.", + "file": "certificate_authority_service/enable_certificate_authority.rb", + "language": "RUBY", + "client_method": { + "short_name": "enable_certificate_authority", + "full_name": "::Google::Cloud::Security::PrivateCA::V1beta1::CertificateAuthorityService::Client#enable_certificate_authority", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::Security::PrivateCA::V1beta1::EnableCertificateAuthorityRequest", + "name": "request" + } + ], + "result_type": "::Google::Longrunning::Operation", + "client": { + "short_name": "CertificateAuthorityService::Client", + "full_name": "::Google::Cloud::Security::PrivateCA::V1beta1::CertificateAuthorityService::Client" + }, + "method": { + "short_name": "EnableCertificateAuthority", + "full_name": "google.cloud.security.privateca.v1beta1.CertificateAuthorityService.EnableCertificateAuthority", + "service": { + "short_name": "CertificateAuthorityService", + "full_name": "google.cloud.security.privateca.v1beta1.CertificateAuthorityService" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 53, + "type": "FULL" + } + ] + }, + { + "region_tag": "privateca_v1beta1_generated_CertificateAuthorityService_FetchCertificateAuthorityCsr_sync", + "title": "Snippet for the fetch_certificate_authority_csr call in the CertificateAuthorityService service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Security::PrivateCA::V1beta1::CertificateAuthorityService::Client#fetch_certificate_authority_csr.", + "file": "certificate_authority_service/fetch_certificate_authority_csr.rb", + "language": "RUBY", + "client_method": { + "short_name": "fetch_certificate_authority_csr", + "full_name": "::Google::Cloud::Security::PrivateCA::V1beta1::CertificateAuthorityService::Client#fetch_certificate_authority_csr", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::Security::PrivateCA::V1beta1::FetchCertificateAuthorityCsrRequest", + "name": "request" + } + ], + "result_type": "::Google::Cloud::Security::PrivateCA::V1beta1::FetchCertificateAuthorityCsrResponse", + "client": { + "short_name": "CertificateAuthorityService::Client", + "full_name": "::Google::Cloud::Security::PrivateCA::V1beta1::CertificateAuthorityService::Client" + }, + "method": { + "short_name": "FetchCertificateAuthorityCsr", + "full_name": "google.cloud.security.privateca.v1beta1.CertificateAuthorityService.FetchCertificateAuthorityCsr", + "service": { + "short_name": "CertificateAuthorityService", + "full_name": "google.cloud.security.privateca.v1beta1.CertificateAuthorityService" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 46, + "type": "FULL" + } + ] + }, + { + "region_tag": "privateca_v1beta1_generated_CertificateAuthorityService_GetCertificateAuthority_sync", + "title": "Snippet for the get_certificate_authority call in the CertificateAuthorityService service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Security::PrivateCA::V1beta1::CertificateAuthorityService::Client#get_certificate_authority.", + "file": "certificate_authority_service/get_certificate_authority.rb", + "language": "RUBY", + "client_method": { + "short_name": "get_certificate_authority", + "full_name": "::Google::Cloud::Security::PrivateCA::V1beta1::CertificateAuthorityService::Client#get_certificate_authority", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::Security::PrivateCA::V1beta1::GetCertificateAuthorityRequest", + "name": "request" + } + ], + "result_type": "::Google::Cloud::Security::PrivateCA::V1beta1::CertificateAuthority", + "client": { + "short_name": "CertificateAuthorityService::Client", + "full_name": "::Google::Cloud::Security::PrivateCA::V1beta1::CertificateAuthorityService::Client" + }, + "method": { + "short_name": "GetCertificateAuthority", + "full_name": "google.cloud.security.privateca.v1beta1.CertificateAuthorityService.GetCertificateAuthority", + "service": { + "short_name": "CertificateAuthorityService", + "full_name": "google.cloud.security.privateca.v1beta1.CertificateAuthorityService" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 46, + "type": "FULL" + } + ] + }, + { + "region_tag": "privateca_v1beta1_generated_CertificateAuthorityService_ListCertificateAuthorities_sync", + "title": "Snippet for the list_certificate_authorities call in the CertificateAuthorityService service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Security::PrivateCA::V1beta1::CertificateAuthorityService::Client#list_certificate_authorities.", + "file": "certificate_authority_service/list_certificate_authorities.rb", + "language": "RUBY", + "client_method": { + "short_name": "list_certificate_authorities", + "full_name": "::Google::Cloud::Security::PrivateCA::V1beta1::CertificateAuthorityService::Client#list_certificate_authorities", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::Security::PrivateCA::V1beta1::ListCertificateAuthoritiesRequest", + "name": "request" + } + ], + "result_type": "::Google::Cloud::Security::PrivateCA::V1beta1::ListCertificateAuthoritiesResponse", + "client": { + "short_name": "CertificateAuthorityService::Client", + "full_name": "::Google::Cloud::Security::PrivateCA::V1beta1::CertificateAuthorityService::Client" + }, + "method": { + "short_name": "ListCertificateAuthorities", + "full_name": "google.cloud.security.privateca.v1beta1.CertificateAuthorityService.ListCertificateAuthorities", + "service": { + "short_name": "CertificateAuthorityService", + "full_name": "google.cloud.security.privateca.v1beta1.CertificateAuthorityService" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 50, + "type": "FULL" + } + ] + }, + { + "region_tag": "privateca_v1beta1_generated_CertificateAuthorityService_RestoreCertificateAuthority_sync", + "title": "Snippet for the restore_certificate_authority call in the CertificateAuthorityService service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Security::PrivateCA::V1beta1::CertificateAuthorityService::Client#restore_certificate_authority.", + "file": "certificate_authority_service/restore_certificate_authority.rb", + "language": "RUBY", + "client_method": { + "short_name": "restore_certificate_authority", + "full_name": "::Google::Cloud::Security::PrivateCA::V1beta1::CertificateAuthorityService::Client#restore_certificate_authority", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::Security::PrivateCA::V1beta1::RestoreCertificateAuthorityRequest", + "name": "request" + } + ], + "result_type": "::Google::Longrunning::Operation", + "client": { + "short_name": "CertificateAuthorityService::Client", + "full_name": "::Google::Cloud::Security::PrivateCA::V1beta1::CertificateAuthorityService::Client" + }, + "method": { + "short_name": "RestoreCertificateAuthority", + "full_name": "google.cloud.security.privateca.v1beta1.CertificateAuthorityService.RestoreCertificateAuthority", + "service": { + "short_name": "CertificateAuthorityService", + "full_name": "google.cloud.security.privateca.v1beta1.CertificateAuthorityService" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 53, + "type": "FULL" + } + ] + }, + { + "region_tag": "privateca_v1beta1_generated_CertificateAuthorityService_ScheduleDeleteCertificateAuthority_sync", + "title": "Snippet for the schedule_delete_certificate_authority call in the CertificateAuthorityService service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Security::PrivateCA::V1beta1::CertificateAuthorityService::Client#schedule_delete_certificate_authority.", + "file": "certificate_authority_service/schedule_delete_certificate_authority.rb", + "language": "RUBY", + "client_method": { + "short_name": "schedule_delete_certificate_authority", + "full_name": "::Google::Cloud::Security::PrivateCA::V1beta1::CertificateAuthorityService::Client#schedule_delete_certificate_authority", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::Security::PrivateCA::V1beta1::ScheduleDeleteCertificateAuthorityRequest", + "name": "request" + } + ], + "result_type": "::Google::Longrunning::Operation", + "client": { + "short_name": "CertificateAuthorityService::Client", + "full_name": "::Google::Cloud::Security::PrivateCA::V1beta1::CertificateAuthorityService::Client" + }, + "method": { + "short_name": "ScheduleDeleteCertificateAuthority", + "full_name": "google.cloud.security.privateca.v1beta1.CertificateAuthorityService.ScheduleDeleteCertificateAuthority", + "service": { + "short_name": "CertificateAuthorityService", + "full_name": "google.cloud.security.privateca.v1beta1.CertificateAuthorityService" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 53, + "type": "FULL" + } + ] + }, + { + "region_tag": "privateca_v1beta1_generated_CertificateAuthorityService_UpdateCertificateAuthority_sync", + "title": "Snippet for the update_certificate_authority call in the CertificateAuthorityService service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Security::PrivateCA::V1beta1::CertificateAuthorityService::Client#update_certificate_authority.", + "file": "certificate_authority_service/update_certificate_authority.rb", + "language": "RUBY", + "client_method": { + "short_name": "update_certificate_authority", + "full_name": "::Google::Cloud::Security::PrivateCA::V1beta1::CertificateAuthorityService::Client#update_certificate_authority", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::Security::PrivateCA::V1beta1::UpdateCertificateAuthorityRequest", + "name": "request" + } + ], + "result_type": "::Google::Longrunning::Operation", + "client": { + "short_name": "CertificateAuthorityService::Client", + "full_name": "::Google::Cloud::Security::PrivateCA::V1beta1::CertificateAuthorityService::Client" + }, + "method": { + "short_name": "UpdateCertificateAuthority", + "full_name": "google.cloud.security.privateca.v1beta1.CertificateAuthorityService.UpdateCertificateAuthority", + "service": { + "short_name": "CertificateAuthorityService", + "full_name": "google.cloud.security.privateca.v1beta1.CertificateAuthorityService" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 53, + "type": "FULL" + } + ] + }, + { + "region_tag": "privateca_v1beta1_generated_CertificateAuthorityService_GetCertificateRevocationList_sync", + "title": "Snippet for the get_certificate_revocation_list call in the CertificateAuthorityService service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Security::PrivateCA::V1beta1::CertificateAuthorityService::Client#get_certificate_revocation_list.", + "file": "certificate_authority_service/get_certificate_revocation_list.rb", + "language": "RUBY", + "client_method": { + "short_name": "get_certificate_revocation_list", + "full_name": "::Google::Cloud::Security::PrivateCA::V1beta1::CertificateAuthorityService::Client#get_certificate_revocation_list", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::Security::PrivateCA::V1beta1::GetCertificateRevocationListRequest", + "name": "request" + } + ], + "result_type": "::Google::Cloud::Security::PrivateCA::V1beta1::CertificateRevocationList", + "client": { + "short_name": "CertificateAuthorityService::Client", + "full_name": "::Google::Cloud::Security::PrivateCA::V1beta1::CertificateAuthorityService::Client" + }, + "method": { + "short_name": "GetCertificateRevocationList", + "full_name": "google.cloud.security.privateca.v1beta1.CertificateAuthorityService.GetCertificateRevocationList", + "service": { + "short_name": "CertificateAuthorityService", + "full_name": "google.cloud.security.privateca.v1beta1.CertificateAuthorityService" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 46, + "type": "FULL" + } + ] + }, + { + "region_tag": "privateca_v1beta1_generated_CertificateAuthorityService_ListCertificateRevocationLists_sync", + "title": "Snippet for the list_certificate_revocation_lists call in the CertificateAuthorityService service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Security::PrivateCA::V1beta1::CertificateAuthorityService::Client#list_certificate_revocation_lists.", + "file": "certificate_authority_service/list_certificate_revocation_lists.rb", + "language": "RUBY", + "client_method": { + "short_name": "list_certificate_revocation_lists", + "full_name": "::Google::Cloud::Security::PrivateCA::V1beta1::CertificateAuthorityService::Client#list_certificate_revocation_lists", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::Security::PrivateCA::V1beta1::ListCertificateRevocationListsRequest", + "name": "request" + } + ], + "result_type": "::Google::Cloud::Security::PrivateCA::V1beta1::ListCertificateRevocationListsResponse", + "client": { + "short_name": "CertificateAuthorityService::Client", + "full_name": "::Google::Cloud::Security::PrivateCA::V1beta1::CertificateAuthorityService::Client" + }, + "method": { + "short_name": "ListCertificateRevocationLists", + "full_name": "google.cloud.security.privateca.v1beta1.CertificateAuthorityService.ListCertificateRevocationLists", + "service": { + "short_name": "CertificateAuthorityService", + "full_name": "google.cloud.security.privateca.v1beta1.CertificateAuthorityService" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 50, + "type": "FULL" + } + ] + }, + { + "region_tag": "privateca_v1beta1_generated_CertificateAuthorityService_UpdateCertificateRevocationList_sync", + "title": "Snippet for the update_certificate_revocation_list call in the CertificateAuthorityService service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Security::PrivateCA::V1beta1::CertificateAuthorityService::Client#update_certificate_revocation_list.", + "file": "certificate_authority_service/update_certificate_revocation_list.rb", + "language": "RUBY", + "client_method": { + "short_name": "update_certificate_revocation_list", + "full_name": "::Google::Cloud::Security::PrivateCA::V1beta1::CertificateAuthorityService::Client#update_certificate_revocation_list", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::Security::PrivateCA::V1beta1::UpdateCertificateRevocationListRequest", + "name": "request" + } + ], + "result_type": "::Google::Longrunning::Operation", + "client": { + "short_name": "CertificateAuthorityService::Client", + "full_name": "::Google::Cloud::Security::PrivateCA::V1beta1::CertificateAuthorityService::Client" + }, + "method": { + "short_name": "UpdateCertificateRevocationList", + "full_name": "google.cloud.security.privateca.v1beta1.CertificateAuthorityService.UpdateCertificateRevocationList", + "service": { + "short_name": "CertificateAuthorityService", + "full_name": "google.cloud.security.privateca.v1beta1.CertificateAuthorityService" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 53, + "type": "FULL" + } + ] + }, + { + "region_tag": "privateca_v1beta1_generated_CertificateAuthorityService_GetReusableConfig_sync", + "title": "Snippet for the get_reusable_config call in the CertificateAuthorityService service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Security::PrivateCA::V1beta1::CertificateAuthorityService::Client#get_reusable_config.", + "file": "certificate_authority_service/get_reusable_config.rb", + "language": "RUBY", + "client_method": { + "short_name": "get_reusable_config", + "full_name": "::Google::Cloud::Security::PrivateCA::V1beta1::CertificateAuthorityService::Client#get_reusable_config", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::Security::PrivateCA::V1beta1::GetReusableConfigRequest", + "name": "request" + } + ], + "result_type": "::Google::Cloud::Security::PrivateCA::V1beta1::ReusableConfig", + "client": { + "short_name": "CertificateAuthorityService::Client", + "full_name": "::Google::Cloud::Security::PrivateCA::V1beta1::CertificateAuthorityService::Client" + }, + "method": { + "short_name": "GetReusableConfig", + "full_name": "google.cloud.security.privateca.v1beta1.CertificateAuthorityService.GetReusableConfig", + "service": { + "short_name": "CertificateAuthorityService", + "full_name": "google.cloud.security.privateca.v1beta1.CertificateAuthorityService" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 46, + "type": "FULL" + } + ] + }, + { + "region_tag": "privateca_v1beta1_generated_CertificateAuthorityService_ListReusableConfigs_sync", + "title": "Snippet for the list_reusable_configs call in the CertificateAuthorityService service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Security::PrivateCA::V1beta1::CertificateAuthorityService::Client#list_reusable_configs.", + "file": "certificate_authority_service/list_reusable_configs.rb", + "language": "RUBY", + "client_method": { + "short_name": "list_reusable_configs", + "full_name": "::Google::Cloud::Security::PrivateCA::V1beta1::CertificateAuthorityService::Client#list_reusable_configs", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::Security::PrivateCA::V1beta1::ListReusableConfigsRequest", + "name": "request" + } + ], + "result_type": "::Google::Cloud::Security::PrivateCA::V1beta1::ListReusableConfigsResponse", + "client": { + "short_name": "CertificateAuthorityService::Client", + "full_name": "::Google::Cloud::Security::PrivateCA::V1beta1::CertificateAuthorityService::Client" + }, + "method": { + "short_name": "ListReusableConfigs", + "full_name": "google.cloud.security.privateca.v1beta1.CertificateAuthorityService.ListReusableConfigs", + "service": { + "short_name": "CertificateAuthorityService", + "full_name": "google.cloud.security.privateca.v1beta1.CertificateAuthorityService" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 50, + "type": "FULL" + } + ] + } + ] +} \ No newline at end of file diff --git a/owl-bot-staging/google-cloud-security-private_ca-v1beta1/test/google/cloud/security/private_ca/v1beta1/certificate_authority_service_operations_test.rb b/owl-bot-staging/google-cloud-security-private_ca-v1beta1/test/google/cloud/security/private_ca/v1beta1/certificate_authority_service_operations_test.rb new file mode 100644 index 000000000000..8004da61f35d --- /dev/null +++ b/owl-bot-staging/google-cloud-security-private_ca-v1beta1/test/google/cloud/security/private_ca/v1beta1/certificate_authority_service_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/cloud/security/privateca/v1beta1/service_pb" +require "google/cloud/security/privateca/v1beta1/service_services_pb" +require "google/cloud/security/private_ca/v1beta1/certificate_authority_service" + +class ::Google::Cloud::Security::PrivateCA::V1beta1::CertificateAuthorityService::OperationsTest < Minitest::Test + class ClientStub + attr_accessor :call_rpc_count, :requests + + def initialize response, operation, &block + @response = response + @operation = operation + @block = block + @call_rpc_count = 0 + @requests = [] + end + + def call_rpc *args, **kwargs + @call_rpc_count += 1 + + @requests << @block&.call(*args, **kwargs) + + catch :response do + yield @response, @operation if block_given? + @response + end + end + + def endpoint + "endpoint.example.com" + end + + def universe_domain + "example.com" + end + + def stub_logger + nil + end + + def logger + nil + end + end + + def test_list_operations + # Create GRPC objects. + grpc_response = ::Google::Longrunning::ListOperationsResponse.new + grpc_operation = GRPC::ActiveCall::Operation.new nil + grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + grpc_options = {} + + # Create request parameters for a unary method. + name = "hello world" + filter = "hello world" + page_size = 42 + page_token = "hello world" + return_partial_success = true + + list_operations_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :list_operations, name + assert_kind_of ::Google::Longrunning::ListOperationsRequest, request + assert_equal "hello world", request["name"] + assert_equal "hello world", request["filter"] + assert_equal 42, request["page_size"] + assert_equal "hello world", request["page_token"] + assert_equal true, request["return_partial_success"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, list_operations_client_stub do + # Create client + client = ::Google::Cloud::Security::PrivateCA::V1beta1::CertificateAuthorityService::Operations.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.list_operations({ name: name, filter: filter, page_size: page_size, page_token: page_token, return_partial_success: return_partial_success }) do |response, operation| + assert_kind_of Gapic::PagedEnumerable, response + assert_equal grpc_response, response.response + assert_equal grpc_operation, operation + end + + # Use named arguments + client.list_operations name: name, filter: filter, page_size: page_size, page_token: page_token, return_partial_success: return_partial_success do |response, operation| + assert_kind_of Gapic::PagedEnumerable, response + assert_equal grpc_response, response.response + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.list_operations ::Google::Longrunning::ListOperationsRequest.new(name: name, filter: filter, page_size: page_size, page_token: page_token, return_partial_success: return_partial_success) do |response, operation| + assert_kind_of Gapic::PagedEnumerable, response + assert_equal grpc_response, response.response + assert_equal grpc_operation, operation + end + + # Use hash object with options + client.list_operations({ name: name, filter: filter, page_size: page_size, page_token: page_token, return_partial_success: return_partial_success }, grpc_options) do |response, operation| + assert_kind_of Gapic::PagedEnumerable, response + assert_equal grpc_response, response.response + assert_equal grpc_operation, operation + end + + # Use protobuf object with options + client.list_operations(::Google::Longrunning::ListOperationsRequest.new(name: name, filter: filter, page_size: page_size, page_token: page_token, return_partial_success: return_partial_success), grpc_options) do |response, operation| + assert_kind_of Gapic::PagedEnumerable, response + assert_equal grpc_response, response.response + assert_equal grpc_operation, operation + end + + # Verify method calls + assert_equal 5, list_operations_client_stub.call_rpc_count + end + end + + def test_get_operation + # Create GRPC objects. + grpc_response = ::Google::Longrunning::Operation.new + grpc_operation = GRPC::ActiveCall::Operation.new nil + grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + grpc_options = {} + + # Create request parameters for a unary method. + name = "hello world" + + get_operation_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :get_operation, name + assert_kind_of ::Google::Longrunning::GetOperationRequest, request + assert_equal "hello world", request["name"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, get_operation_client_stub do + # Create client + client = ::Google::Cloud::Security::PrivateCA::V1beta1::CertificateAuthorityService::Operations.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.get_operation({ name: name }) do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Use named arguments + client.get_operation name: name do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.get_operation ::Google::Longrunning::GetOperationRequest.new(name: name) do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Use hash object with options + client.get_operation({ name: name }, grpc_options) do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Use protobuf object with options + client.get_operation(::Google::Longrunning::GetOperationRequest.new(name: name), grpc_options) do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Verify method calls + assert_equal 5, get_operation_client_stub.call_rpc_count + end + end + + def test_delete_operation + # Create GRPC objects. + grpc_response = ::Google::Protobuf::Empty.new + grpc_operation = GRPC::ActiveCall::Operation.new nil + grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + grpc_options = {} + + # Create request parameters for a unary method. + name = "hello world" + + delete_operation_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :delete_operation, name + assert_kind_of ::Google::Longrunning::DeleteOperationRequest, request + assert_equal "hello world", request["name"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, delete_operation_client_stub do + # Create client + client = ::Google::Cloud::Security::PrivateCA::V1beta1::CertificateAuthorityService::Operations.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.delete_operation({ name: name }) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use named arguments + client.delete_operation name: name do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.delete_operation ::Google::Longrunning::DeleteOperationRequest.new(name: name) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use hash object with options + client.delete_operation({ name: name }, grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object with options + client.delete_operation(::Google::Longrunning::DeleteOperationRequest.new(name: name), grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Verify method calls + assert_equal 5, delete_operation_client_stub.call_rpc_count + end + end + + def test_cancel_operation + # Create GRPC objects. + grpc_response = ::Google::Protobuf::Empty.new + grpc_operation = GRPC::ActiveCall::Operation.new nil + grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + grpc_options = {} + + # Create request parameters for a unary method. + name = "hello world" + + cancel_operation_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :cancel_operation, name + assert_kind_of ::Google::Longrunning::CancelOperationRequest, request + assert_equal "hello world", request["name"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, cancel_operation_client_stub do + # Create client + client = ::Google::Cloud::Security::PrivateCA::V1beta1::CertificateAuthorityService::Operations.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.cancel_operation({ name: name }) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use named arguments + client.cancel_operation name: name do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.cancel_operation ::Google::Longrunning::CancelOperationRequest.new(name: name) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use hash object with options + client.cancel_operation({ name: name }, grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object with options + client.cancel_operation(::Google::Longrunning::CancelOperationRequest.new(name: name), grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Verify method calls + assert_equal 5, cancel_operation_client_stub.call_rpc_count + end + end + + def test_wait_operation + # Create GRPC objects. + grpc_response = ::Google::Longrunning::Operation.new + grpc_operation = GRPC::ActiveCall::Operation.new nil + grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + grpc_options = {} + + # Create request parameters for a unary method. + name = "hello world" + timeout = {} + + wait_operation_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :wait_operation, name + assert_kind_of ::Google::Longrunning::WaitOperationRequest, request + assert_equal "hello world", request["name"] + assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Protobuf::Duration), request["timeout"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, wait_operation_client_stub do + # Create client + client = ::Google::Cloud::Security::PrivateCA::V1beta1::CertificateAuthorityService::Operations.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.wait_operation({ name: name, timeout: timeout }) do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Use named arguments + client.wait_operation name: name, timeout: timeout do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.wait_operation ::Google::Longrunning::WaitOperationRequest.new(name: name, timeout: timeout) do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Use hash object with options + client.wait_operation({ name: name, timeout: timeout }, grpc_options) do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Use protobuf object with options + client.wait_operation(::Google::Longrunning::WaitOperationRequest.new(name: name, timeout: timeout), grpc_options) do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Verify method calls + assert_equal 5, wait_operation_client_stub.call_rpc_count + end + end + + def test_configure + grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + + client = block_config = config = nil + dummy_stub = ClientStub.new nil, nil + Gapic::ServiceStub.stub :new, dummy_stub do + client = ::Google::Cloud::Security::PrivateCA::V1beta1::CertificateAuthorityService::Operations.new do |config| + config.credentials = grpc_channel + end + end + + config = client.configure do |c| + block_config = c + end + + assert_same block_config, config + assert_kind_of ::Google::Cloud::Security::PrivateCA::V1beta1::CertificateAuthorityService::Operations::Configuration, config + end +end diff --git a/owl-bot-staging/google-cloud-security-private_ca-v1beta1/test/google/cloud/security/private_ca/v1beta1/certificate_authority_service_paths_test.rb b/owl-bot-staging/google-cloud-security-private_ca-v1beta1/test/google/cloud/security/private_ca/v1beta1/certificate_authority_service_paths_test.rb new file mode 100644 index 000000000000..7c0d1c542ef3 --- /dev/null +++ b/owl-bot-staging/google-cloud-security-private_ca-v1beta1/test/google/cloud/security/private_ca/v1beta1/certificate_authority_service_paths_test.rb @@ -0,0 +1,103 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +require "helper" + +require "gapic/grpc/service_stub" + +require "google/cloud/security/private_ca/v1beta1/certificate_authority_service" + +class ::Google::Cloud::Security::PrivateCA::V1beta1::CertificateAuthorityService::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_certificate_path + grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + ::Gapic::ServiceStub.stub :new, DummyStub.new do + client = ::Google::Cloud::Security::PrivateCA::V1beta1::CertificateAuthorityService::Client.new do |config| + config.credentials = grpc_channel + end + + path = client.certificate_path project: "value0", location: "value1", certificate_authority: "value2", certificate: "value3" + assert_equal "projects/value0/locations/value1/certificateAuthorities/value2/certificates/value3", path + end + end + + def test_certificate_authority_path + grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + ::Gapic::ServiceStub.stub :new, DummyStub.new do + client = ::Google::Cloud::Security::PrivateCA::V1beta1::CertificateAuthorityService::Client.new do |config| + config.credentials = grpc_channel + end + + path = client.certificate_authority_path project: "value0", location: "value1", certificate_authority: "value2" + assert_equal "projects/value0/locations/value1/certificateAuthorities/value2", path + end + end + + def test_certificate_revocation_list_path + grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + ::Gapic::ServiceStub.stub :new, DummyStub.new do + client = ::Google::Cloud::Security::PrivateCA::V1beta1::CertificateAuthorityService::Client.new do |config| + config.credentials = grpc_channel + end + + path = client.certificate_revocation_list_path project: "value0", location: "value1", certificate_authority: "value2", certificate_revocation_list: "value3" + assert_equal "projects/value0/locations/value1/certificateAuthorities/value2/certificateRevocationLists/value3", path + end + end + + def test_location_path + grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + ::Gapic::ServiceStub.stub :new, DummyStub.new do + client = ::Google::Cloud::Security::PrivateCA::V1beta1::CertificateAuthorityService::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_reusable_config_path + grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + ::Gapic::ServiceStub.stub :new, DummyStub.new do + client = ::Google::Cloud::Security::PrivateCA::V1beta1::CertificateAuthorityService::Client.new do |config| + config.credentials = grpc_channel + end + + path = client.reusable_config_path project: "value0", location: "value1", reusable_config: "value2" + assert_equal "projects/value0/locations/value1/reusableConfigs/value2", path + end + end +end diff --git a/owl-bot-staging/google-cloud-security-private_ca-v1beta1/test/google/cloud/security/private_ca/v1beta1/certificate_authority_service_rest_test.rb b/owl-bot-staging/google-cloud-security-private_ca-v1beta1/test/google/cloud/security/private_ca/v1beta1/certificate_authority_service_rest_test.rb new file mode 100644 index 000000000000..4222ffbc14e5 --- /dev/null +++ b/owl-bot-staging/google-cloud-security-private_ca-v1beta1/test/google/cloud/security/private_ca/v1beta1/certificate_authority_service_rest_test.rb @@ -0,0 +1,1216 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +require "helper" +require "gapic/rest" +require "google/cloud/security/privateca/v1beta1/service_pb" +require "google/cloud/security/private_ca/v1beta1/certificate_authority_service/rest" + + +class ::Google::Cloud::Security::PrivateCA::V1beta1::CertificateAuthorityService::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_certificate + # Create test objects. + client_result = ::Google::Cloud::Security::PrivateCA::V1beta1::Certificate.new + http_response = OpenStruct.new body: client_result.to_json + + call_options = {} + + # Create request parameters for a unary method. + parent = "hello world" + certificate_id = "hello world" + certificate = {} + request_id = "hello world" + + create_certificate_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| + assert options.metadata.key? :"x-goog-api-client" + assert options.metadata[:"x-goog-api-client"].include? "rest" + refute options.metadata[:"x-goog-api-client"].include? "grpc" + end + + ::Google::Cloud::Security::PrivateCA::V1beta1::CertificateAuthorityService::Rest::ServiceStub.stub :transcode_create_certificate_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, create_certificate_client_stub do + # Create client + client = ::Google::Cloud::Security::PrivateCA::V1beta1::CertificateAuthorityService::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.create_certificate({ parent: parent, certificate_id: certificate_id, certificate: certificate, request_id: request_id }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.create_certificate parent: parent, certificate_id: certificate_id, certificate: certificate, request_id: request_id do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.create_certificate ::Google::Cloud::Security::PrivateCA::V1beta1::CreateCertificateRequest.new(parent: parent, certificate_id: certificate_id, certificate: certificate, request_id: request_id) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + client.create_certificate({ parent: parent, certificate_id: certificate_id, certificate: certificate, request_id: request_id }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + client.create_certificate(::Google::Cloud::Security::PrivateCA::V1beta1::CreateCertificateRequest.new(parent: parent, certificate_id: certificate_id, certificate: certificate, request_id: request_id), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, create_certificate_client_stub.call_count + end + end + end + + def test_get_certificate + # Create test objects. + client_result = ::Google::Cloud::Security::PrivateCA::V1beta1::Certificate.new + http_response = OpenStruct.new body: client_result.to_json + + call_options = {} + + # Create request parameters for a unary method. + name = "hello world" + + get_certificate_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| + assert options.metadata.key? :"x-goog-api-client" + assert options.metadata[:"x-goog-api-client"].include? "rest" + refute options.metadata[:"x-goog-api-client"].include? "grpc" + end + + ::Google::Cloud::Security::PrivateCA::V1beta1::CertificateAuthorityService::Rest::ServiceStub.stub :transcode_get_certificate_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, get_certificate_client_stub do + # Create client + client = ::Google::Cloud::Security::PrivateCA::V1beta1::CertificateAuthorityService::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.get_certificate({ name: name }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.get_certificate name: name do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.get_certificate ::Google::Cloud::Security::PrivateCA::V1beta1::GetCertificateRequest.new(name: name) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + client.get_certificate({ name: name }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + client.get_certificate(::Google::Cloud::Security::PrivateCA::V1beta1::GetCertificateRequest.new(name: name), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, get_certificate_client_stub.call_count + end + end + end + + def test_list_certificates + # Create test objects. + client_result = ::Google::Cloud::Security::PrivateCA::V1beta1::ListCertificatesResponse.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" + order_by = "hello world" + + list_certificates_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| + assert options.metadata.key? :"x-goog-api-client" + assert options.metadata[:"x-goog-api-client"].include? "rest" + refute options.metadata[:"x-goog-api-client"].include? "grpc" + end + + ::Google::Cloud::Security::PrivateCA::V1beta1::CertificateAuthorityService::Rest::ServiceStub.stub :transcode_list_certificates_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, list_certificates_client_stub do + # Create client + client = ::Google::Cloud::Security::PrivateCA::V1beta1::CertificateAuthorityService::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.list_certificates({ parent: parent, page_size: page_size, page_token: page_token, filter: filter, order_by: order_by }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.list_certificates parent: parent, page_size: page_size, page_token: page_token, filter: filter, order_by: order_by do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.list_certificates ::Google::Cloud::Security::PrivateCA::V1beta1::ListCertificatesRequest.new(parent: parent, page_size: page_size, page_token: page_token, filter: filter, order_by: order_by) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + client.list_certificates({ parent: parent, page_size: page_size, page_token: page_token, filter: filter, order_by: order_by }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + client.list_certificates(::Google::Cloud::Security::PrivateCA::V1beta1::ListCertificatesRequest.new(parent: parent, page_size: page_size, page_token: page_token, filter: filter, order_by: order_by), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, list_certificates_client_stub.call_count + end + end + end + + def test_revoke_certificate + # Create test objects. + client_result = ::Google::Cloud::Security::PrivateCA::V1beta1::Certificate.new + http_response = OpenStruct.new body: client_result.to_json + + call_options = {} + + # Create request parameters for a unary method. + name = "hello world" + reason = :REVOCATION_REASON_UNSPECIFIED + request_id = "hello world" + + revoke_certificate_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| + assert options.metadata.key? :"x-goog-api-client" + assert options.metadata[:"x-goog-api-client"].include? "rest" + refute options.metadata[:"x-goog-api-client"].include? "grpc" + end + + ::Google::Cloud::Security::PrivateCA::V1beta1::CertificateAuthorityService::Rest::ServiceStub.stub :transcode_revoke_certificate_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, revoke_certificate_client_stub do + # Create client + client = ::Google::Cloud::Security::PrivateCA::V1beta1::CertificateAuthorityService::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.revoke_certificate({ name: name, reason: reason, request_id: request_id }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.revoke_certificate name: name, reason: reason, request_id: request_id do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.revoke_certificate ::Google::Cloud::Security::PrivateCA::V1beta1::RevokeCertificateRequest.new(name: name, reason: reason, request_id: request_id) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + client.revoke_certificate({ name: name, reason: reason, request_id: request_id }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + client.revoke_certificate(::Google::Cloud::Security::PrivateCA::V1beta1::RevokeCertificateRequest.new(name: name, reason: reason, request_id: request_id), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, revoke_certificate_client_stub.call_count + end + end + end + + def test_update_certificate + # Create test objects. + client_result = ::Google::Cloud::Security::PrivateCA::V1beta1::Certificate.new + http_response = OpenStruct.new body: client_result.to_json + + call_options = {} + + # Create request parameters for a unary method. + certificate = {} + update_mask = {} + request_id = "hello world" + + update_certificate_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| + assert options.metadata.key? :"x-goog-api-client" + assert options.metadata[:"x-goog-api-client"].include? "rest" + refute options.metadata[:"x-goog-api-client"].include? "grpc" + end + + ::Google::Cloud::Security::PrivateCA::V1beta1::CertificateAuthorityService::Rest::ServiceStub.stub :transcode_update_certificate_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, update_certificate_client_stub do + # Create client + client = ::Google::Cloud::Security::PrivateCA::V1beta1::CertificateAuthorityService::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.update_certificate({ certificate: certificate, update_mask: update_mask, request_id: request_id }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.update_certificate certificate: certificate, update_mask: update_mask, request_id: request_id do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.update_certificate ::Google::Cloud::Security::PrivateCA::V1beta1::UpdateCertificateRequest.new(certificate: certificate, update_mask: update_mask, request_id: request_id) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + client.update_certificate({ certificate: certificate, update_mask: update_mask, request_id: request_id }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + client.update_certificate(::Google::Cloud::Security::PrivateCA::V1beta1::UpdateCertificateRequest.new(certificate: certificate, update_mask: update_mask, request_id: request_id), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, update_certificate_client_stub.call_count + end + end + end + + def test_activate_certificate_authority + # 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" + pem_ca_certificate = "hello world" + subordinate_config = {} + request_id = "hello world" + + activate_certificate_authority_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| + assert options.metadata.key? :"x-goog-api-client" + assert options.metadata[:"x-goog-api-client"].include? "rest" + refute options.metadata[:"x-goog-api-client"].include? "grpc" + end + + ::Google::Cloud::Security::PrivateCA::V1beta1::CertificateAuthorityService::Rest::ServiceStub.stub :transcode_activate_certificate_authority_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, activate_certificate_authority_client_stub do + # Create client + client = ::Google::Cloud::Security::PrivateCA::V1beta1::CertificateAuthorityService::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.activate_certificate_authority({ name: name, pem_ca_certificate: pem_ca_certificate, subordinate_config: subordinate_config, request_id: request_id }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.activate_certificate_authority name: name, pem_ca_certificate: pem_ca_certificate, subordinate_config: subordinate_config, request_id: request_id do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.activate_certificate_authority ::Google::Cloud::Security::PrivateCA::V1beta1::ActivateCertificateAuthorityRequest.new(name: name, pem_ca_certificate: pem_ca_certificate, subordinate_config: subordinate_config, request_id: request_id) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + client.activate_certificate_authority({ name: name, pem_ca_certificate: pem_ca_certificate, subordinate_config: subordinate_config, request_id: request_id }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + client.activate_certificate_authority(::Google::Cloud::Security::PrivateCA::V1beta1::ActivateCertificateAuthorityRequest.new(name: name, pem_ca_certificate: pem_ca_certificate, subordinate_config: subordinate_config, request_id: request_id), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, activate_certificate_authority_client_stub.call_count + end + end + end + + def test_create_certificate_authority + # 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" + certificate_authority_id = "hello world" + certificate_authority = {} + request_id = "hello world" + + create_certificate_authority_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| + assert options.metadata.key? :"x-goog-api-client" + assert options.metadata[:"x-goog-api-client"].include? "rest" + refute options.metadata[:"x-goog-api-client"].include? "grpc" + end + + ::Google::Cloud::Security::PrivateCA::V1beta1::CertificateAuthorityService::Rest::ServiceStub.stub :transcode_create_certificate_authority_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, create_certificate_authority_client_stub do + # Create client + client = ::Google::Cloud::Security::PrivateCA::V1beta1::CertificateAuthorityService::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.create_certificate_authority({ parent: parent, certificate_authority_id: certificate_authority_id, certificate_authority: certificate_authority, request_id: request_id }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.create_certificate_authority parent: parent, certificate_authority_id: certificate_authority_id, certificate_authority: certificate_authority, request_id: request_id do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.create_certificate_authority ::Google::Cloud::Security::PrivateCA::V1beta1::CreateCertificateAuthorityRequest.new(parent: parent, certificate_authority_id: certificate_authority_id, certificate_authority: certificate_authority, request_id: request_id) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + client.create_certificate_authority({ parent: parent, certificate_authority_id: certificate_authority_id, certificate_authority: certificate_authority, request_id: request_id }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + client.create_certificate_authority(::Google::Cloud::Security::PrivateCA::V1beta1::CreateCertificateAuthorityRequest.new(parent: parent, certificate_authority_id: certificate_authority_id, certificate_authority: certificate_authority, request_id: request_id), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, create_certificate_authority_client_stub.call_count + end + end + end + + def test_disable_certificate_authority + # 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" + request_id = "hello world" + + disable_certificate_authority_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| + assert options.metadata.key? :"x-goog-api-client" + assert options.metadata[:"x-goog-api-client"].include? "rest" + refute options.metadata[:"x-goog-api-client"].include? "grpc" + end + + ::Google::Cloud::Security::PrivateCA::V1beta1::CertificateAuthorityService::Rest::ServiceStub.stub :transcode_disable_certificate_authority_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, disable_certificate_authority_client_stub do + # Create client + client = ::Google::Cloud::Security::PrivateCA::V1beta1::CertificateAuthorityService::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.disable_certificate_authority({ name: name, request_id: request_id }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.disable_certificate_authority name: name, request_id: request_id do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.disable_certificate_authority ::Google::Cloud::Security::PrivateCA::V1beta1::DisableCertificateAuthorityRequest.new(name: name, request_id: request_id) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + client.disable_certificate_authority({ name: name, request_id: request_id }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + client.disable_certificate_authority(::Google::Cloud::Security::PrivateCA::V1beta1::DisableCertificateAuthorityRequest.new(name: name, request_id: request_id), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, disable_certificate_authority_client_stub.call_count + end + end + end + + def test_enable_certificate_authority + # 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" + request_id = "hello world" + + enable_certificate_authority_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| + assert options.metadata.key? :"x-goog-api-client" + assert options.metadata[:"x-goog-api-client"].include? "rest" + refute options.metadata[:"x-goog-api-client"].include? "grpc" + end + + ::Google::Cloud::Security::PrivateCA::V1beta1::CertificateAuthorityService::Rest::ServiceStub.stub :transcode_enable_certificate_authority_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, enable_certificate_authority_client_stub do + # Create client + client = ::Google::Cloud::Security::PrivateCA::V1beta1::CertificateAuthorityService::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.enable_certificate_authority({ name: name, request_id: request_id }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.enable_certificate_authority name: name, request_id: request_id do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.enable_certificate_authority ::Google::Cloud::Security::PrivateCA::V1beta1::EnableCertificateAuthorityRequest.new(name: name, request_id: request_id) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + client.enable_certificate_authority({ name: name, request_id: request_id }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + client.enable_certificate_authority(::Google::Cloud::Security::PrivateCA::V1beta1::EnableCertificateAuthorityRequest.new(name: name, request_id: request_id), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, enable_certificate_authority_client_stub.call_count + end + end + end + + def test_fetch_certificate_authority_csr + # Create test objects. + client_result = ::Google::Cloud::Security::PrivateCA::V1beta1::FetchCertificateAuthorityCsrResponse.new + http_response = OpenStruct.new body: client_result.to_json + + call_options = {} + + # Create request parameters for a unary method. + name = "hello world" + + fetch_certificate_authority_csr_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| + assert options.metadata.key? :"x-goog-api-client" + assert options.metadata[:"x-goog-api-client"].include? "rest" + refute options.metadata[:"x-goog-api-client"].include? "grpc" + end + + ::Google::Cloud::Security::PrivateCA::V1beta1::CertificateAuthorityService::Rest::ServiceStub.stub :transcode_fetch_certificate_authority_csr_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, fetch_certificate_authority_csr_client_stub do + # Create client + client = ::Google::Cloud::Security::PrivateCA::V1beta1::CertificateAuthorityService::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.fetch_certificate_authority_csr({ name: name }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.fetch_certificate_authority_csr name: name do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.fetch_certificate_authority_csr ::Google::Cloud::Security::PrivateCA::V1beta1::FetchCertificateAuthorityCsrRequest.new(name: name) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + client.fetch_certificate_authority_csr({ name: name }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + client.fetch_certificate_authority_csr(::Google::Cloud::Security::PrivateCA::V1beta1::FetchCertificateAuthorityCsrRequest.new(name: name), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, fetch_certificate_authority_csr_client_stub.call_count + end + end + end + + def test_get_certificate_authority + # Create test objects. + client_result = ::Google::Cloud::Security::PrivateCA::V1beta1::CertificateAuthority.new + http_response = OpenStruct.new body: client_result.to_json + + call_options = {} + + # Create request parameters for a unary method. + name = "hello world" + + get_certificate_authority_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| + assert options.metadata.key? :"x-goog-api-client" + assert options.metadata[:"x-goog-api-client"].include? "rest" + refute options.metadata[:"x-goog-api-client"].include? "grpc" + end + + ::Google::Cloud::Security::PrivateCA::V1beta1::CertificateAuthorityService::Rest::ServiceStub.stub :transcode_get_certificate_authority_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, get_certificate_authority_client_stub do + # Create client + client = ::Google::Cloud::Security::PrivateCA::V1beta1::CertificateAuthorityService::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.get_certificate_authority({ name: name }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.get_certificate_authority name: name do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.get_certificate_authority ::Google::Cloud::Security::PrivateCA::V1beta1::GetCertificateAuthorityRequest.new(name: name) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + client.get_certificate_authority({ name: name }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + client.get_certificate_authority(::Google::Cloud::Security::PrivateCA::V1beta1::GetCertificateAuthorityRequest.new(name: name), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, get_certificate_authority_client_stub.call_count + end + end + end + + def test_list_certificate_authorities + # Create test objects. + client_result = ::Google::Cloud::Security::PrivateCA::V1beta1::ListCertificateAuthoritiesResponse.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" + order_by = "hello world" + + list_certificate_authorities_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| + assert options.metadata.key? :"x-goog-api-client" + assert options.metadata[:"x-goog-api-client"].include? "rest" + refute options.metadata[:"x-goog-api-client"].include? "grpc" + end + + ::Google::Cloud::Security::PrivateCA::V1beta1::CertificateAuthorityService::Rest::ServiceStub.stub :transcode_list_certificate_authorities_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, list_certificate_authorities_client_stub do + # Create client + client = ::Google::Cloud::Security::PrivateCA::V1beta1::CertificateAuthorityService::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.list_certificate_authorities({ parent: parent, page_size: page_size, page_token: page_token, filter: filter, order_by: order_by }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.list_certificate_authorities parent: parent, page_size: page_size, page_token: page_token, filter: filter, order_by: order_by do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.list_certificate_authorities ::Google::Cloud::Security::PrivateCA::V1beta1::ListCertificateAuthoritiesRequest.new(parent: parent, page_size: page_size, page_token: page_token, filter: filter, order_by: order_by) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + client.list_certificate_authorities({ parent: parent, page_size: page_size, page_token: page_token, filter: filter, order_by: order_by }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + client.list_certificate_authorities(::Google::Cloud::Security::PrivateCA::V1beta1::ListCertificateAuthoritiesRequest.new(parent: parent, page_size: page_size, page_token: page_token, filter: filter, order_by: order_by), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, list_certificate_authorities_client_stub.call_count + end + end + end + + def test_restore_certificate_authority + # 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" + request_id = "hello world" + + restore_certificate_authority_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| + assert options.metadata.key? :"x-goog-api-client" + assert options.metadata[:"x-goog-api-client"].include? "rest" + refute options.metadata[:"x-goog-api-client"].include? "grpc" + end + + ::Google::Cloud::Security::PrivateCA::V1beta1::CertificateAuthorityService::Rest::ServiceStub.stub :transcode_restore_certificate_authority_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, restore_certificate_authority_client_stub do + # Create client + client = ::Google::Cloud::Security::PrivateCA::V1beta1::CertificateAuthorityService::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.restore_certificate_authority({ name: name, request_id: request_id }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.restore_certificate_authority name: name, request_id: request_id do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.restore_certificate_authority ::Google::Cloud::Security::PrivateCA::V1beta1::RestoreCertificateAuthorityRequest.new(name: name, request_id: request_id) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + client.restore_certificate_authority({ name: name, request_id: request_id }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + client.restore_certificate_authority(::Google::Cloud::Security::PrivateCA::V1beta1::RestoreCertificateAuthorityRequest.new(name: name, request_id: request_id), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, restore_certificate_authority_client_stub.call_count + end + end + end + + def test_schedule_delete_certificate_authority + # 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" + request_id = "hello world" + + schedule_delete_certificate_authority_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| + assert options.metadata.key? :"x-goog-api-client" + assert options.metadata[:"x-goog-api-client"].include? "rest" + refute options.metadata[:"x-goog-api-client"].include? "grpc" + end + + ::Google::Cloud::Security::PrivateCA::V1beta1::CertificateAuthorityService::Rest::ServiceStub.stub :transcode_schedule_delete_certificate_authority_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, schedule_delete_certificate_authority_client_stub do + # Create client + client = ::Google::Cloud::Security::PrivateCA::V1beta1::CertificateAuthorityService::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.schedule_delete_certificate_authority({ name: name, request_id: request_id }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.schedule_delete_certificate_authority name: name, request_id: request_id do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.schedule_delete_certificate_authority ::Google::Cloud::Security::PrivateCA::V1beta1::ScheduleDeleteCertificateAuthorityRequest.new(name: name, request_id: request_id) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + client.schedule_delete_certificate_authority({ name: name, request_id: request_id }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + client.schedule_delete_certificate_authority(::Google::Cloud::Security::PrivateCA::V1beta1::ScheduleDeleteCertificateAuthorityRequest.new(name: name, request_id: request_id), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, schedule_delete_certificate_authority_client_stub.call_count + end + end + end + + def test_update_certificate_authority + # 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. + certificate_authority = {} + update_mask = {} + request_id = "hello world" + + update_certificate_authority_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| + assert options.metadata.key? :"x-goog-api-client" + assert options.metadata[:"x-goog-api-client"].include? "rest" + refute options.metadata[:"x-goog-api-client"].include? "grpc" + end + + ::Google::Cloud::Security::PrivateCA::V1beta1::CertificateAuthorityService::Rest::ServiceStub.stub :transcode_update_certificate_authority_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, update_certificate_authority_client_stub do + # Create client + client = ::Google::Cloud::Security::PrivateCA::V1beta1::CertificateAuthorityService::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.update_certificate_authority({ certificate_authority: certificate_authority, update_mask: update_mask, request_id: request_id }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.update_certificate_authority certificate_authority: certificate_authority, update_mask: update_mask, request_id: request_id do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.update_certificate_authority ::Google::Cloud::Security::PrivateCA::V1beta1::UpdateCertificateAuthorityRequest.new(certificate_authority: certificate_authority, update_mask: update_mask, request_id: request_id) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + client.update_certificate_authority({ certificate_authority: certificate_authority, update_mask: update_mask, request_id: request_id }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + client.update_certificate_authority(::Google::Cloud::Security::PrivateCA::V1beta1::UpdateCertificateAuthorityRequest.new(certificate_authority: certificate_authority, update_mask: update_mask, request_id: request_id), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, update_certificate_authority_client_stub.call_count + end + end + end + + def test_get_certificate_revocation_list + # Create test objects. + client_result = ::Google::Cloud::Security::PrivateCA::V1beta1::CertificateRevocationList.new + http_response = OpenStruct.new body: client_result.to_json + + call_options = {} + + # Create request parameters for a unary method. + name = "hello world" + + get_certificate_revocation_list_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| + assert options.metadata.key? :"x-goog-api-client" + assert options.metadata[:"x-goog-api-client"].include? "rest" + refute options.metadata[:"x-goog-api-client"].include? "grpc" + end + + ::Google::Cloud::Security::PrivateCA::V1beta1::CertificateAuthorityService::Rest::ServiceStub.stub :transcode_get_certificate_revocation_list_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, get_certificate_revocation_list_client_stub do + # Create client + client = ::Google::Cloud::Security::PrivateCA::V1beta1::CertificateAuthorityService::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.get_certificate_revocation_list({ name: name }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.get_certificate_revocation_list name: name do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.get_certificate_revocation_list ::Google::Cloud::Security::PrivateCA::V1beta1::GetCertificateRevocationListRequest.new(name: name) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + client.get_certificate_revocation_list({ name: name }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + client.get_certificate_revocation_list(::Google::Cloud::Security::PrivateCA::V1beta1::GetCertificateRevocationListRequest.new(name: name), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, get_certificate_revocation_list_client_stub.call_count + end + end + end + + def test_list_certificate_revocation_lists + # Create test objects. + client_result = ::Google::Cloud::Security::PrivateCA::V1beta1::ListCertificateRevocationListsResponse.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" + order_by = "hello world" + + list_certificate_revocation_lists_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| + assert options.metadata.key? :"x-goog-api-client" + assert options.metadata[:"x-goog-api-client"].include? "rest" + refute options.metadata[:"x-goog-api-client"].include? "grpc" + end + + ::Google::Cloud::Security::PrivateCA::V1beta1::CertificateAuthorityService::Rest::ServiceStub.stub :transcode_list_certificate_revocation_lists_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, list_certificate_revocation_lists_client_stub do + # Create client + client = ::Google::Cloud::Security::PrivateCA::V1beta1::CertificateAuthorityService::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.list_certificate_revocation_lists({ parent: parent, page_size: page_size, page_token: page_token, filter: filter, order_by: order_by }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.list_certificate_revocation_lists parent: parent, page_size: page_size, page_token: page_token, filter: filter, order_by: order_by do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.list_certificate_revocation_lists ::Google::Cloud::Security::PrivateCA::V1beta1::ListCertificateRevocationListsRequest.new(parent: parent, page_size: page_size, page_token: page_token, filter: filter, order_by: order_by) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + client.list_certificate_revocation_lists({ parent: parent, page_size: page_size, page_token: page_token, filter: filter, order_by: order_by }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + client.list_certificate_revocation_lists(::Google::Cloud::Security::PrivateCA::V1beta1::ListCertificateRevocationListsRequest.new(parent: parent, page_size: page_size, page_token: page_token, filter: filter, order_by: order_by), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, list_certificate_revocation_lists_client_stub.call_count + end + end + end + + def test_update_certificate_revocation_list + # 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. + certificate_revocation_list = {} + update_mask = {} + request_id = "hello world" + + update_certificate_revocation_list_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| + assert options.metadata.key? :"x-goog-api-client" + assert options.metadata[:"x-goog-api-client"].include? "rest" + refute options.metadata[:"x-goog-api-client"].include? "grpc" + end + + ::Google::Cloud::Security::PrivateCA::V1beta1::CertificateAuthorityService::Rest::ServiceStub.stub :transcode_update_certificate_revocation_list_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, update_certificate_revocation_list_client_stub do + # Create client + client = ::Google::Cloud::Security::PrivateCA::V1beta1::CertificateAuthorityService::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.update_certificate_revocation_list({ certificate_revocation_list: certificate_revocation_list, update_mask: update_mask, request_id: request_id }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.update_certificate_revocation_list certificate_revocation_list: certificate_revocation_list, update_mask: update_mask, request_id: request_id do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.update_certificate_revocation_list ::Google::Cloud::Security::PrivateCA::V1beta1::UpdateCertificateRevocationListRequest.new(certificate_revocation_list: certificate_revocation_list, update_mask: update_mask, request_id: request_id) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + client.update_certificate_revocation_list({ certificate_revocation_list: certificate_revocation_list, update_mask: update_mask, request_id: request_id }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + client.update_certificate_revocation_list(::Google::Cloud::Security::PrivateCA::V1beta1::UpdateCertificateRevocationListRequest.new(certificate_revocation_list: certificate_revocation_list, update_mask: update_mask, request_id: request_id), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, update_certificate_revocation_list_client_stub.call_count + end + end + end + + def test_get_reusable_config + # Create test objects. + client_result = ::Google::Cloud::Security::PrivateCA::V1beta1::ReusableConfig.new + http_response = OpenStruct.new body: client_result.to_json + + call_options = {} + + # Create request parameters for a unary method. + name = "hello world" + + get_reusable_config_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| + assert options.metadata.key? :"x-goog-api-client" + assert options.metadata[:"x-goog-api-client"].include? "rest" + refute options.metadata[:"x-goog-api-client"].include? "grpc" + end + + ::Google::Cloud::Security::PrivateCA::V1beta1::CertificateAuthorityService::Rest::ServiceStub.stub :transcode_get_reusable_config_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, get_reusable_config_client_stub do + # Create client + client = ::Google::Cloud::Security::PrivateCA::V1beta1::CertificateAuthorityService::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.get_reusable_config({ name: name }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.get_reusable_config name: name do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.get_reusable_config ::Google::Cloud::Security::PrivateCA::V1beta1::GetReusableConfigRequest.new(name: name) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + client.get_reusable_config({ name: name }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + client.get_reusable_config(::Google::Cloud::Security::PrivateCA::V1beta1::GetReusableConfigRequest.new(name: name), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, get_reusable_config_client_stub.call_count + end + end + end + + def test_list_reusable_configs + # Create test objects. + client_result = ::Google::Cloud::Security::PrivateCA::V1beta1::ListReusableConfigsResponse.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" + order_by = "hello world" + + list_reusable_configs_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| + assert options.metadata.key? :"x-goog-api-client" + assert options.metadata[:"x-goog-api-client"].include? "rest" + refute options.metadata[:"x-goog-api-client"].include? "grpc" + end + + ::Google::Cloud::Security::PrivateCA::V1beta1::CertificateAuthorityService::Rest::ServiceStub.stub :transcode_list_reusable_configs_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, list_reusable_configs_client_stub do + # Create client + client = ::Google::Cloud::Security::PrivateCA::V1beta1::CertificateAuthorityService::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.list_reusable_configs({ parent: parent, page_size: page_size, page_token: page_token, filter: filter, order_by: order_by }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.list_reusable_configs parent: parent, page_size: page_size, page_token: page_token, filter: filter, order_by: order_by do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.list_reusable_configs ::Google::Cloud::Security::PrivateCA::V1beta1::ListReusableConfigsRequest.new(parent: parent, page_size: page_size, page_token: page_token, filter: filter, order_by: order_by) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + client.list_reusable_configs({ parent: parent, page_size: page_size, page_token: page_token, filter: filter, order_by: order_by }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + client.list_reusable_configs(::Google::Cloud::Security::PrivateCA::V1beta1::ListReusableConfigsRequest.new(parent: parent, page_size: page_size, page_token: page_token, filter: filter, order_by: order_by), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, list_reusable_configs_client_stub.call_count + end + end + end + + def test_configure + credentials_token = :dummy_value + + client = block_config = config = nil + dummy_stub = ClientStub.new nil + Gapic::Rest::ClientStub.stub :new, dummy_stub do + client = ::Google::Cloud::Security::PrivateCA::V1beta1::CertificateAuthorityService::Rest::Client.new do |config| + config.credentials = credentials_token + end + end + + config = client.configure do |c| + block_config = c + end + + assert_same block_config, config + assert_kind_of ::Google::Cloud::Security::PrivateCA::V1beta1::CertificateAuthorityService::Rest::Client::Configuration, config + end +end diff --git a/owl-bot-staging/google-cloud-security-private_ca-v1beta1/test/google/cloud/security/private_ca/v1beta1/certificate_authority_service_test.rb b/owl-bot-staging/google-cloud-security-private_ca-v1beta1/test/google/cloud/security/private_ca/v1beta1/certificate_authority_service_test.rb new file mode 100644 index 000000000000..9344cc18168d --- /dev/null +++ b/owl-bot-staging/google-cloud-security-private_ca-v1beta1/test/google/cloud/security/private_ca/v1beta1/certificate_authority_service_test.rb @@ -0,0 +1,1412 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +require "helper" + +require "gapic/grpc/service_stub" + +require "google/cloud/security/privateca/v1beta1/service_pb" +require "google/cloud/security/private_ca/v1beta1/certificate_authority_service" + +class ::Google::Cloud::Security::PrivateCA::V1beta1::CertificateAuthorityService::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_certificate + # Create GRPC objects. + grpc_response = ::Google::Cloud::Security::PrivateCA::V1beta1::Certificate.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" + certificate_id = "hello world" + certificate = {} + request_id = "hello world" + + create_certificate_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :create_certificate, name + assert_kind_of ::Google::Cloud::Security::PrivateCA::V1beta1::CreateCertificateRequest, request + assert_equal "hello world", request["parent"] + assert_equal "hello world", request["certificate_id"] + assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::Security::PrivateCA::V1beta1::Certificate), request["certificate"] + assert_equal "hello world", request["request_id"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, create_certificate_client_stub do + # Create client + client = ::Google::Cloud::Security::PrivateCA::V1beta1::CertificateAuthorityService::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.create_certificate({ parent: parent, certificate_id: certificate_id, certificate: certificate, request_id: request_id }) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use named arguments + client.create_certificate parent: parent, certificate_id: certificate_id, certificate: certificate, request_id: request_id do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.create_certificate ::Google::Cloud::Security::PrivateCA::V1beta1::CreateCertificateRequest.new(parent: parent, certificate_id: certificate_id, certificate: certificate, request_id: request_id) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use hash object with options + client.create_certificate({ parent: parent, certificate_id: certificate_id, certificate: certificate, request_id: request_id }, grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object with options + client.create_certificate(::Google::Cloud::Security::PrivateCA::V1beta1::CreateCertificateRequest.new(parent: parent, certificate_id: certificate_id, certificate: certificate, request_id: request_id), grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Verify method calls + assert_equal 5, create_certificate_client_stub.call_rpc_count + end + end + + def test_get_certificate + # Create GRPC objects. + grpc_response = ::Google::Cloud::Security::PrivateCA::V1beta1::Certificate.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_certificate_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :get_certificate, name + assert_kind_of ::Google::Cloud::Security::PrivateCA::V1beta1::GetCertificateRequest, request + assert_equal "hello world", request["name"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, get_certificate_client_stub do + # Create client + client = ::Google::Cloud::Security::PrivateCA::V1beta1::CertificateAuthorityService::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.get_certificate({ name: name }) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use named arguments + client.get_certificate name: name do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.get_certificate ::Google::Cloud::Security::PrivateCA::V1beta1::GetCertificateRequest.new(name: name) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use hash object with options + client.get_certificate({ 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_certificate(::Google::Cloud::Security::PrivateCA::V1beta1::GetCertificateRequest.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_certificate_client_stub.call_rpc_count + end + end + + def test_list_certificates + # Create GRPC objects. + grpc_response = ::Google::Cloud::Security::PrivateCA::V1beta1::ListCertificatesResponse.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" + order_by = "hello world" + + list_certificates_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :list_certificates, name + assert_kind_of ::Google::Cloud::Security::PrivateCA::V1beta1::ListCertificatesRequest, 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"] + assert_equal "hello world", request["order_by"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, list_certificates_client_stub do + # Create client + client = ::Google::Cloud::Security::PrivateCA::V1beta1::CertificateAuthorityService::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.list_certificates({ parent: parent, page_size: page_size, page_token: page_token, filter: filter, order_by: order_by }) 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_certificates parent: parent, page_size: page_size, page_token: page_token, filter: filter, order_by: order_by 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_certificates ::Google::Cloud::Security::PrivateCA::V1beta1::ListCertificatesRequest.new(parent: parent, page_size: page_size, page_token: page_token, filter: filter, order_by: order_by) 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_certificates({ parent: parent, page_size: page_size, page_token: page_token, filter: filter, order_by: order_by }, 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_certificates(::Google::Cloud::Security::PrivateCA::V1beta1::ListCertificatesRequest.new(parent: parent, page_size: page_size, page_token: page_token, filter: filter, order_by: order_by), 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_certificates_client_stub.call_rpc_count + end + end + + def test_revoke_certificate + # Create GRPC objects. + grpc_response = ::Google::Cloud::Security::PrivateCA::V1beta1::Certificate.new + grpc_operation = GRPC::ActiveCall::Operation.new nil + grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + grpc_options = {} + + # Create request parameters for a unary method. + name = "hello world" + reason = :REVOCATION_REASON_UNSPECIFIED + request_id = "hello world" + + revoke_certificate_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :revoke_certificate, name + assert_kind_of ::Google::Cloud::Security::PrivateCA::V1beta1::RevokeCertificateRequest, request + assert_equal "hello world", request["name"] + assert_equal :REVOCATION_REASON_UNSPECIFIED, request["reason"] + assert_equal "hello world", request["request_id"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, revoke_certificate_client_stub do + # Create client + client = ::Google::Cloud::Security::PrivateCA::V1beta1::CertificateAuthorityService::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.revoke_certificate({ name: name, reason: reason, request_id: request_id }) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use named arguments + client.revoke_certificate name: name, reason: reason, request_id: request_id do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.revoke_certificate ::Google::Cloud::Security::PrivateCA::V1beta1::RevokeCertificateRequest.new(name: name, reason: reason, request_id: request_id) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use hash object with options + client.revoke_certificate({ name: name, reason: reason, request_id: request_id }, grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object with options + client.revoke_certificate(::Google::Cloud::Security::PrivateCA::V1beta1::RevokeCertificateRequest.new(name: name, reason: reason, request_id: request_id), grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Verify method calls + assert_equal 5, revoke_certificate_client_stub.call_rpc_count + end + end + + def test_update_certificate + # Create GRPC objects. + grpc_response = ::Google::Cloud::Security::PrivateCA::V1beta1::Certificate.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. + certificate = {} + update_mask = {} + request_id = "hello world" + + update_certificate_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :update_certificate, name + assert_kind_of ::Google::Cloud::Security::PrivateCA::V1beta1::UpdateCertificateRequest, request + assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::Security::PrivateCA::V1beta1::Certificate), request["certificate"] + assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Protobuf::FieldMask), request["update_mask"] + assert_equal "hello world", request["request_id"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, update_certificate_client_stub do + # Create client + client = ::Google::Cloud::Security::PrivateCA::V1beta1::CertificateAuthorityService::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.update_certificate({ certificate: certificate, update_mask: update_mask, request_id: request_id }) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use named arguments + client.update_certificate certificate: certificate, update_mask: update_mask, request_id: request_id do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.update_certificate ::Google::Cloud::Security::PrivateCA::V1beta1::UpdateCertificateRequest.new(certificate: certificate, update_mask: update_mask, request_id: request_id) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use hash object with options + client.update_certificate({ certificate: certificate, update_mask: update_mask, request_id: request_id }, grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object with options + client.update_certificate(::Google::Cloud::Security::PrivateCA::V1beta1::UpdateCertificateRequest.new(certificate: certificate, update_mask: update_mask, request_id: request_id), grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Verify method calls + assert_equal 5, update_certificate_client_stub.call_rpc_count + end + end + + def test_activate_certificate_authority + # 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" + pem_ca_certificate = "hello world" + subordinate_config = {} + request_id = "hello world" + + activate_certificate_authority_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :activate_certificate_authority, name + assert_kind_of ::Google::Cloud::Security::PrivateCA::V1beta1::ActivateCertificateAuthorityRequest, request + assert_equal "hello world", request["name"] + assert_equal "hello world", request["pem_ca_certificate"] + assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::Security::PrivateCA::V1beta1::SubordinateConfig), request["subordinate_config"] + assert_equal "hello world", request["request_id"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, activate_certificate_authority_client_stub do + # Create client + client = ::Google::Cloud::Security::PrivateCA::V1beta1::CertificateAuthorityService::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.activate_certificate_authority({ name: name, pem_ca_certificate: pem_ca_certificate, subordinate_config: subordinate_config, request_id: request_id }) do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Use named arguments + client.activate_certificate_authority name: name, pem_ca_certificate: pem_ca_certificate, subordinate_config: subordinate_config, request_id: request_id do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.activate_certificate_authority ::Google::Cloud::Security::PrivateCA::V1beta1::ActivateCertificateAuthorityRequest.new(name: name, pem_ca_certificate: pem_ca_certificate, subordinate_config: subordinate_config, request_id: request_id) do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Use hash object with options + client.activate_certificate_authority({ name: name, pem_ca_certificate: pem_ca_certificate, subordinate_config: subordinate_config, request_id: request_id }, grpc_options) do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Use protobuf object with options + client.activate_certificate_authority(::Google::Cloud::Security::PrivateCA::V1beta1::ActivateCertificateAuthorityRequest.new(name: name, pem_ca_certificate: pem_ca_certificate, subordinate_config: subordinate_config, request_id: request_id), grpc_options) do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Verify method calls + assert_equal 5, activate_certificate_authority_client_stub.call_rpc_count + end + end + + def test_create_certificate_authority + # 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" + certificate_authority_id = "hello world" + certificate_authority = {} + request_id = "hello world" + + create_certificate_authority_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :create_certificate_authority, name + assert_kind_of ::Google::Cloud::Security::PrivateCA::V1beta1::CreateCertificateAuthorityRequest, request + assert_equal "hello world", request["parent"] + assert_equal "hello world", request["certificate_authority_id"] + assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::Security::PrivateCA::V1beta1::CertificateAuthority), request["certificate_authority"] + assert_equal "hello world", request["request_id"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, create_certificate_authority_client_stub do + # Create client + client = ::Google::Cloud::Security::PrivateCA::V1beta1::CertificateAuthorityService::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.create_certificate_authority({ parent: parent, certificate_authority_id: certificate_authority_id, certificate_authority: certificate_authority, request_id: request_id }) do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Use named arguments + client.create_certificate_authority parent: parent, certificate_authority_id: certificate_authority_id, certificate_authority: certificate_authority, request_id: request_id do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.create_certificate_authority ::Google::Cloud::Security::PrivateCA::V1beta1::CreateCertificateAuthorityRequest.new(parent: parent, certificate_authority_id: certificate_authority_id, certificate_authority: certificate_authority, request_id: request_id) do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Use hash object with options + client.create_certificate_authority({ parent: parent, certificate_authority_id: certificate_authority_id, certificate_authority: certificate_authority, request_id: request_id }, grpc_options) do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Use protobuf object with options + client.create_certificate_authority(::Google::Cloud::Security::PrivateCA::V1beta1::CreateCertificateAuthorityRequest.new(parent: parent, certificate_authority_id: certificate_authority_id, certificate_authority: certificate_authority, request_id: request_id), grpc_options) do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Verify method calls + assert_equal 5, create_certificate_authority_client_stub.call_rpc_count + end + end + + def test_disable_certificate_authority + # 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" + request_id = "hello world" + + disable_certificate_authority_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :disable_certificate_authority, name + assert_kind_of ::Google::Cloud::Security::PrivateCA::V1beta1::DisableCertificateAuthorityRequest, request + assert_equal "hello world", request["name"] + assert_equal "hello world", request["request_id"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, disable_certificate_authority_client_stub do + # Create client + client = ::Google::Cloud::Security::PrivateCA::V1beta1::CertificateAuthorityService::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.disable_certificate_authority({ name: name, request_id: request_id }) do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Use named arguments + client.disable_certificate_authority name: name, request_id: request_id do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.disable_certificate_authority ::Google::Cloud::Security::PrivateCA::V1beta1::DisableCertificateAuthorityRequest.new(name: name, request_id: request_id) do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Use hash object with options + client.disable_certificate_authority({ name: name, request_id: request_id }, grpc_options) do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Use protobuf object with options + client.disable_certificate_authority(::Google::Cloud::Security::PrivateCA::V1beta1::DisableCertificateAuthorityRequest.new(name: name, request_id: request_id), grpc_options) do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Verify method calls + assert_equal 5, disable_certificate_authority_client_stub.call_rpc_count + end + end + + def test_enable_certificate_authority + # 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" + request_id = "hello world" + + enable_certificate_authority_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :enable_certificate_authority, name + assert_kind_of ::Google::Cloud::Security::PrivateCA::V1beta1::EnableCertificateAuthorityRequest, request + assert_equal "hello world", request["name"] + assert_equal "hello world", request["request_id"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, enable_certificate_authority_client_stub do + # Create client + client = ::Google::Cloud::Security::PrivateCA::V1beta1::CertificateAuthorityService::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.enable_certificate_authority({ name: name, request_id: request_id }) do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Use named arguments + client.enable_certificate_authority name: name, request_id: request_id do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.enable_certificate_authority ::Google::Cloud::Security::PrivateCA::V1beta1::EnableCertificateAuthorityRequest.new(name: name, request_id: request_id) do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Use hash object with options + client.enable_certificate_authority({ name: name, request_id: request_id }, grpc_options) do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Use protobuf object with options + client.enable_certificate_authority(::Google::Cloud::Security::PrivateCA::V1beta1::EnableCertificateAuthorityRequest.new(name: name, request_id: request_id), grpc_options) do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Verify method calls + assert_equal 5, enable_certificate_authority_client_stub.call_rpc_count + end + end + + def test_fetch_certificate_authority_csr + # Create GRPC objects. + grpc_response = ::Google::Cloud::Security::PrivateCA::V1beta1::FetchCertificateAuthorityCsrResponse.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" + + fetch_certificate_authority_csr_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :fetch_certificate_authority_csr, name + assert_kind_of ::Google::Cloud::Security::PrivateCA::V1beta1::FetchCertificateAuthorityCsrRequest, request + assert_equal "hello world", request["name"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, fetch_certificate_authority_csr_client_stub do + # Create client + client = ::Google::Cloud::Security::PrivateCA::V1beta1::CertificateAuthorityService::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.fetch_certificate_authority_csr({ name: name }) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use named arguments + client.fetch_certificate_authority_csr name: name do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.fetch_certificate_authority_csr ::Google::Cloud::Security::PrivateCA::V1beta1::FetchCertificateAuthorityCsrRequest.new(name: name) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use hash object with options + client.fetch_certificate_authority_csr({ name: name }, grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object with options + client.fetch_certificate_authority_csr(::Google::Cloud::Security::PrivateCA::V1beta1::FetchCertificateAuthorityCsrRequest.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, fetch_certificate_authority_csr_client_stub.call_rpc_count + end + end + + def test_get_certificate_authority + # Create GRPC objects. + grpc_response = ::Google::Cloud::Security::PrivateCA::V1beta1::CertificateAuthority.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_certificate_authority_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :get_certificate_authority, name + assert_kind_of ::Google::Cloud::Security::PrivateCA::V1beta1::GetCertificateAuthorityRequest, request + assert_equal "hello world", request["name"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, get_certificate_authority_client_stub do + # Create client + client = ::Google::Cloud::Security::PrivateCA::V1beta1::CertificateAuthorityService::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.get_certificate_authority({ name: name }) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use named arguments + client.get_certificate_authority name: name do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.get_certificate_authority ::Google::Cloud::Security::PrivateCA::V1beta1::GetCertificateAuthorityRequest.new(name: name) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use hash object with options + client.get_certificate_authority({ 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_certificate_authority(::Google::Cloud::Security::PrivateCA::V1beta1::GetCertificateAuthorityRequest.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_certificate_authority_client_stub.call_rpc_count + end + end + + def test_list_certificate_authorities + # Create GRPC objects. + grpc_response = ::Google::Cloud::Security::PrivateCA::V1beta1::ListCertificateAuthoritiesResponse.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" + order_by = "hello world" + + list_certificate_authorities_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :list_certificate_authorities, name + assert_kind_of ::Google::Cloud::Security::PrivateCA::V1beta1::ListCertificateAuthoritiesRequest, 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"] + assert_equal "hello world", request["order_by"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, list_certificate_authorities_client_stub do + # Create client + client = ::Google::Cloud::Security::PrivateCA::V1beta1::CertificateAuthorityService::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.list_certificate_authorities({ parent: parent, page_size: page_size, page_token: page_token, filter: filter, order_by: order_by }) 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_certificate_authorities parent: parent, page_size: page_size, page_token: page_token, filter: filter, order_by: order_by 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_certificate_authorities ::Google::Cloud::Security::PrivateCA::V1beta1::ListCertificateAuthoritiesRequest.new(parent: parent, page_size: page_size, page_token: page_token, filter: filter, order_by: order_by) 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_certificate_authorities({ parent: parent, page_size: page_size, page_token: page_token, filter: filter, order_by: order_by }, 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_certificate_authorities(::Google::Cloud::Security::PrivateCA::V1beta1::ListCertificateAuthoritiesRequest.new(parent: parent, page_size: page_size, page_token: page_token, filter: filter, order_by: order_by), 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_certificate_authorities_client_stub.call_rpc_count + end + end + + def test_restore_certificate_authority + # 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" + request_id = "hello world" + + restore_certificate_authority_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :restore_certificate_authority, name + assert_kind_of ::Google::Cloud::Security::PrivateCA::V1beta1::RestoreCertificateAuthorityRequest, request + assert_equal "hello world", request["name"] + assert_equal "hello world", request["request_id"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, restore_certificate_authority_client_stub do + # Create client + client = ::Google::Cloud::Security::PrivateCA::V1beta1::CertificateAuthorityService::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.restore_certificate_authority({ name: name, request_id: request_id }) do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Use named arguments + client.restore_certificate_authority name: name, request_id: request_id do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.restore_certificate_authority ::Google::Cloud::Security::PrivateCA::V1beta1::RestoreCertificateAuthorityRequest.new(name: name, request_id: request_id) do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Use hash object with options + client.restore_certificate_authority({ name: name, request_id: request_id }, grpc_options) do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Use protobuf object with options + client.restore_certificate_authority(::Google::Cloud::Security::PrivateCA::V1beta1::RestoreCertificateAuthorityRequest.new(name: name, request_id: request_id), grpc_options) do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Verify method calls + assert_equal 5, restore_certificate_authority_client_stub.call_rpc_count + end + end + + def test_schedule_delete_certificate_authority + # 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" + request_id = "hello world" + + schedule_delete_certificate_authority_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :schedule_delete_certificate_authority, name + assert_kind_of ::Google::Cloud::Security::PrivateCA::V1beta1::ScheduleDeleteCertificateAuthorityRequest, request + assert_equal "hello world", request["name"] + assert_equal "hello world", request["request_id"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, schedule_delete_certificate_authority_client_stub do + # Create client + client = ::Google::Cloud::Security::PrivateCA::V1beta1::CertificateAuthorityService::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.schedule_delete_certificate_authority({ name: name, request_id: request_id }) do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Use named arguments + client.schedule_delete_certificate_authority name: name, request_id: request_id do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.schedule_delete_certificate_authority ::Google::Cloud::Security::PrivateCA::V1beta1::ScheduleDeleteCertificateAuthorityRequest.new(name: name, request_id: request_id) do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Use hash object with options + client.schedule_delete_certificate_authority({ name: name, request_id: request_id }, grpc_options) do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Use protobuf object with options + client.schedule_delete_certificate_authority(::Google::Cloud::Security::PrivateCA::V1beta1::ScheduleDeleteCertificateAuthorityRequest.new(name: name, request_id: request_id), grpc_options) do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Verify method calls + assert_equal 5, schedule_delete_certificate_authority_client_stub.call_rpc_count + end + end + + def test_update_certificate_authority + # 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. + certificate_authority = {} + update_mask = {} + request_id = "hello world" + + update_certificate_authority_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :update_certificate_authority, name + assert_kind_of ::Google::Cloud::Security::PrivateCA::V1beta1::UpdateCertificateAuthorityRequest, request + assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::Security::PrivateCA::V1beta1::CertificateAuthority), request["certificate_authority"] + assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Protobuf::FieldMask), request["update_mask"] + assert_equal "hello world", request["request_id"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, update_certificate_authority_client_stub do + # Create client + client = ::Google::Cloud::Security::PrivateCA::V1beta1::CertificateAuthorityService::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.update_certificate_authority({ certificate_authority: certificate_authority, update_mask: update_mask, request_id: request_id }) do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Use named arguments + client.update_certificate_authority certificate_authority: certificate_authority, update_mask: update_mask, request_id: request_id do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.update_certificate_authority ::Google::Cloud::Security::PrivateCA::V1beta1::UpdateCertificateAuthorityRequest.new(certificate_authority: certificate_authority, update_mask: update_mask, request_id: request_id) do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Use hash object with options + client.update_certificate_authority({ certificate_authority: certificate_authority, update_mask: update_mask, request_id: request_id }, grpc_options) do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Use protobuf object with options + client.update_certificate_authority(::Google::Cloud::Security::PrivateCA::V1beta1::UpdateCertificateAuthorityRequest.new(certificate_authority: certificate_authority, update_mask: update_mask, request_id: request_id), grpc_options) do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Verify method calls + assert_equal 5, update_certificate_authority_client_stub.call_rpc_count + end + end + + def test_get_certificate_revocation_list + # Create GRPC objects. + grpc_response = ::Google::Cloud::Security::PrivateCA::V1beta1::CertificateRevocationList.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_certificate_revocation_list_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :get_certificate_revocation_list, name + assert_kind_of ::Google::Cloud::Security::PrivateCA::V1beta1::GetCertificateRevocationListRequest, request + assert_equal "hello world", request["name"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, get_certificate_revocation_list_client_stub do + # Create client + client = ::Google::Cloud::Security::PrivateCA::V1beta1::CertificateAuthorityService::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.get_certificate_revocation_list({ name: name }) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use named arguments + client.get_certificate_revocation_list name: name do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.get_certificate_revocation_list ::Google::Cloud::Security::PrivateCA::V1beta1::GetCertificateRevocationListRequest.new(name: name) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use hash object with options + client.get_certificate_revocation_list({ 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_certificate_revocation_list(::Google::Cloud::Security::PrivateCA::V1beta1::GetCertificateRevocationListRequest.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_certificate_revocation_list_client_stub.call_rpc_count + end + end + + def test_list_certificate_revocation_lists + # Create GRPC objects. + grpc_response = ::Google::Cloud::Security::PrivateCA::V1beta1::ListCertificateRevocationListsResponse.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" + order_by = "hello world" + + list_certificate_revocation_lists_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :list_certificate_revocation_lists, name + assert_kind_of ::Google::Cloud::Security::PrivateCA::V1beta1::ListCertificateRevocationListsRequest, 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"] + assert_equal "hello world", request["order_by"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, list_certificate_revocation_lists_client_stub do + # Create client + client = ::Google::Cloud::Security::PrivateCA::V1beta1::CertificateAuthorityService::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.list_certificate_revocation_lists({ parent: parent, page_size: page_size, page_token: page_token, filter: filter, order_by: order_by }) 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_certificate_revocation_lists parent: parent, page_size: page_size, page_token: page_token, filter: filter, order_by: order_by 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_certificate_revocation_lists ::Google::Cloud::Security::PrivateCA::V1beta1::ListCertificateRevocationListsRequest.new(parent: parent, page_size: page_size, page_token: page_token, filter: filter, order_by: order_by) 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_certificate_revocation_lists({ parent: parent, page_size: page_size, page_token: page_token, filter: filter, order_by: order_by }, 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_certificate_revocation_lists(::Google::Cloud::Security::PrivateCA::V1beta1::ListCertificateRevocationListsRequest.new(parent: parent, page_size: page_size, page_token: page_token, filter: filter, order_by: order_by), 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_certificate_revocation_lists_client_stub.call_rpc_count + end + end + + def test_update_certificate_revocation_list + # 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. + certificate_revocation_list = {} + update_mask = {} + request_id = "hello world" + + update_certificate_revocation_list_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :update_certificate_revocation_list, name + assert_kind_of ::Google::Cloud::Security::PrivateCA::V1beta1::UpdateCertificateRevocationListRequest, request + assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::Security::PrivateCA::V1beta1::CertificateRevocationList), request["certificate_revocation_list"] + assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Protobuf::FieldMask), request["update_mask"] + assert_equal "hello world", request["request_id"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, update_certificate_revocation_list_client_stub do + # Create client + client = ::Google::Cloud::Security::PrivateCA::V1beta1::CertificateAuthorityService::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.update_certificate_revocation_list({ certificate_revocation_list: certificate_revocation_list, update_mask: update_mask, request_id: request_id }) do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Use named arguments + client.update_certificate_revocation_list certificate_revocation_list: certificate_revocation_list, update_mask: update_mask, request_id: request_id do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.update_certificate_revocation_list ::Google::Cloud::Security::PrivateCA::V1beta1::UpdateCertificateRevocationListRequest.new(certificate_revocation_list: certificate_revocation_list, update_mask: update_mask, request_id: request_id) do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Use hash object with options + client.update_certificate_revocation_list({ certificate_revocation_list: certificate_revocation_list, update_mask: update_mask, request_id: request_id }, grpc_options) do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Use protobuf object with options + client.update_certificate_revocation_list(::Google::Cloud::Security::PrivateCA::V1beta1::UpdateCertificateRevocationListRequest.new(certificate_revocation_list: certificate_revocation_list, update_mask: update_mask, request_id: request_id), grpc_options) do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Verify method calls + assert_equal 5, update_certificate_revocation_list_client_stub.call_rpc_count + end + end + + def test_get_reusable_config + # Create GRPC objects. + grpc_response = ::Google::Cloud::Security::PrivateCA::V1beta1::ReusableConfig.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_reusable_config_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :get_reusable_config, name + assert_kind_of ::Google::Cloud::Security::PrivateCA::V1beta1::GetReusableConfigRequest, request + assert_equal "hello world", request["name"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, get_reusable_config_client_stub do + # Create client + client = ::Google::Cloud::Security::PrivateCA::V1beta1::CertificateAuthorityService::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.get_reusable_config({ name: name }) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use named arguments + client.get_reusable_config name: name do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.get_reusable_config ::Google::Cloud::Security::PrivateCA::V1beta1::GetReusableConfigRequest.new(name: name) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use hash object with options + client.get_reusable_config({ name: name }, grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object with options + client.get_reusable_config(::Google::Cloud::Security::PrivateCA::V1beta1::GetReusableConfigRequest.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_reusable_config_client_stub.call_rpc_count + end + end + + def test_list_reusable_configs + # Create GRPC objects. + grpc_response = ::Google::Cloud::Security::PrivateCA::V1beta1::ListReusableConfigsResponse.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" + order_by = "hello world" + + list_reusable_configs_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :list_reusable_configs, name + assert_kind_of ::Google::Cloud::Security::PrivateCA::V1beta1::ListReusableConfigsRequest, 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"] + assert_equal "hello world", request["order_by"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, list_reusable_configs_client_stub do + # Create client + client = ::Google::Cloud::Security::PrivateCA::V1beta1::CertificateAuthorityService::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.list_reusable_configs({ parent: parent, page_size: page_size, page_token: page_token, filter: filter, order_by: order_by }) 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_reusable_configs parent: parent, page_size: page_size, page_token: page_token, filter: filter, order_by: order_by 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_reusable_configs ::Google::Cloud::Security::PrivateCA::V1beta1::ListReusableConfigsRequest.new(parent: parent, page_size: page_size, page_token: page_token, filter: filter, order_by: order_by) 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_reusable_configs({ parent: parent, page_size: page_size, page_token: page_token, filter: filter, order_by: order_by }, 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_reusable_configs(::Google::Cloud::Security::PrivateCA::V1beta1::ListReusableConfigsRequest.new(parent: parent, page_size: page_size, page_token: page_token, filter: filter, order_by: order_by), 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_reusable_configs_client_stub.call_rpc_count + end + end + + def test_configure + grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + + client = block_config = config = nil + dummy_stub = ClientStub.new nil, nil + Gapic::ServiceStub.stub :new, dummy_stub do + client = ::Google::Cloud::Security::PrivateCA::V1beta1::CertificateAuthorityService::Client.new do |config| + config.credentials = grpc_channel + end + end + + config = client.configure do |c| + block_config = c + end + + assert_same block_config, config + assert_kind_of ::Google::Cloud::Security::PrivateCA::V1beta1::CertificateAuthorityService::Client::Configuration, config + end + + def test_credentials + key = OpenSSL::PKey::RSA.new 2048 + cred_json = { + "private_key" => key.to_pem, + "client_email" => "app@developer.gserviceaccount.com", + "type" => "service_account" + } + key_file = StringIO.new cred_json.to_json + creds = Google::Auth::ServiceAccountCredentials.make_creds({ json_key_io: key_file }) + + dummy_stub = ClientStub.new nil, nil + Gapic::ServiceStub.stub :new, dummy_stub do + client = ::Google::Cloud::Security::PrivateCA::V1beta1::CertificateAuthorityService::Client.new do |config| + config.credentials = creds + end + assert_kind_of ::Google::Cloud::Security::PrivateCA::V1beta1::CertificateAuthorityService::Client, client + assert_equal creds, client.configure.credentials + end + end + + def test_operations_client + grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + + client = nil + dummy_stub = ClientStub.new nil, nil + Gapic::ServiceStub.stub :new, dummy_stub do + client = ::Google::Cloud::Security::PrivateCA::V1beta1::CertificateAuthorityService::Client.new do |config| + config.credentials = grpc_channel + end + end + + assert_kind_of ::Google::Cloud::Security::PrivateCA::V1beta1::CertificateAuthorityService::Operations, client.operations_client + end +end diff --git a/owl-bot-staging/google-cloud-security-private_ca-v1beta1/test/helper.rb b/owl-bot-staging/google-cloud-security-private_ca-v1beta1/test/helper.rb new file mode 100644 index 000000000000..672b337030e7 --- /dev/null +++ b/owl-bot-staging/google-cloud-security-private_ca-v1beta1/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" diff --git a/owl-bot-staging/google-cloud-security-public_ca-v1/.gitignore b/owl-bot-staging/google-cloud-security-public_ca-v1/.gitignore new file mode 100644 index 000000000000..0135b6bc6cfc --- /dev/null +++ b/owl-bot-staging/google-cloud-security-public_ca-v1/.gitignore @@ -0,0 +1,22 @@ +# Ignore bundler lockfiles +Gemfile.lock +gems.locked + +# Ignore documentation output +doc/* +.yardoc/* + +# Ignore test output +coverage/* + +# Ignore build artifacts +pkg/* + +# Ignore files commonly present in certain dev environments +.vagrant +.DS_STORE +.idea +*.iml + +# Ignore synth output +__pycache__ diff --git a/owl-bot-staging/google-cloud-security-public_ca-v1/.repo-metadata.json b/owl-bot-staging/google-cloud-security-public_ca-v1/.repo-metadata.json new file mode 100644 index 000000000000..788249a8ed1b --- /dev/null +++ b/owl-bot-staging/google-cloud-security-public_ca-v1/.repo-metadata.json @@ -0,0 +1,17 @@ +{ + "api_id": "publicca.googleapis.com", + "api_shortname": "publicca", + "client_documentation": "https://cloud.google.com/ruby/docs/reference/google-cloud-security-public_ca-v1/latest", + "distribution_name": "google-cloud-security-public_ca-v1", + "is_cloud": true, + "language": "ruby", + "name": "publicca", + "name_pretty": "Public Certificate Authority V1 API", + "product_documentation": "https://cloud.google.com/certificate-manager/docs/public-ca", + "release_level": "unreleased", + "repo": "googleapis/google-cloud-ruby", + "requires_billing": true, + "ruby-cloud-description": "The Public Certificate Authority API may be used to create and manage ACME external account binding keys associated with Google Trust Services' publicly trusted certificate authority. Note that google-cloud-security-public_ca-v1 is a version-specific client library. For most uses, we recommend installing the main client library google-cloud-security-public_ca instead. See the readme for more details.", + "ruby-cloud-product-url": "https://cloud.google.com/certificate-manager/docs/public-ca", + "library_type": "GAPIC_AUTO" +} diff --git a/owl-bot-staging/google-cloud-security-public_ca-v1/.rubocop.yml b/owl-bot-staging/google-cloud-security-public_ca-v1/.rubocop.yml new file mode 100644 index 000000000000..87973206ac40 --- /dev/null +++ b/owl-bot-staging/google-cloud-security-public_ca-v1/.rubocop.yml @@ -0,0 +1,33 @@ +inherit_gem: + google-style: google-style.yml + +AllCops: + Exclude: + - "google-cloud-security-public_ca-v1.gemspec" + - "lib/**/*_pb.rb" + - "proto_docs/**/*" + - "test/**/*" + - "acceptance/**/*" + - "samples/acceptance/**/*" + - "Rakefile" + +Layout/LineLength: + Enabled: false +Metrics/AbcSize: + Enabled: false +Metrics/ClassLength: + Enabled: false +Metrics/CyclomaticComplexity: + Enabled: false +Metrics/MethodLength: + Enabled: false +Metrics/ModuleLength: + Enabled: false +Metrics/PerceivedComplexity: + Enabled: false +Naming/AccessorMethodName: + Exclude: + - "snippets/**/*.rb" +Naming/FileName: + Exclude: + - "lib/google-cloud-security-public_ca-v1.rb" diff --git a/owl-bot-staging/google-cloud-security-public_ca-v1/.toys.rb b/owl-bot-staging/google-cloud-security-public_ca-v1/.toys.rb new file mode 100644 index 000000000000..177e22456e8a --- /dev/null +++ b/owl-bot-staging/google-cloud-security-public_ca-v1/.toys.rb @@ -0,0 +1,28 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +toys_version! ">= 0.15.3" + +if ENV["RUBY_COMMON_TOOLS"] + common_tools_dir = File.expand_path ENV["RUBY_COMMON_TOOLS"] + load File.join(common_tools_dir, "toys", "gapic") +else + load_git remote: "https://github.com/googleapis/ruby-common-tools.git", + path: "toys/gapic", + update: true +end diff --git a/owl-bot-staging/google-cloud-security-public_ca-v1/.yardopts b/owl-bot-staging/google-cloud-security-public_ca-v1/.yardopts new file mode 100644 index 000000000000..70e9c4ada96c --- /dev/null +++ b/owl-bot-staging/google-cloud-security-public_ca-v1/.yardopts @@ -0,0 +1,12 @@ +--no-private +--title="Public Certificate Authority V1 API" +--exclude _pb\.rb$ +--markup markdown +--markup-provider redcarpet + +./lib/**/*.rb +./proto_docs/**/*.rb +- +README.md +LICENSE.md +AUTHENTICATION.md diff --git a/owl-bot-staging/google-cloud-security-public_ca-v1/AUTHENTICATION.md b/owl-bot-staging/google-cloud-security-public_ca-v1/AUTHENTICATION.md new file mode 100644 index 000000000000..e674781ece98 --- /dev/null +++ b/owl-bot-staging/google-cloud-security-public_ca-v1/AUTHENTICATION.md @@ -0,0 +1,122 @@ +# Authentication + +The recommended way to authenticate to the google-cloud-security-public_ca-v1 library is to use +[Application Default Credentials (ADC)](https://cloud.google.com/docs/authentication/application-default-credentials). +To review all of your authentication options, see [Credentials lookup](#credential-lookup). + +## Quickstart + +The following example shows how to set up authentication for a local development +environment with your user credentials. + +**NOTE:** This method is _not_ recommended for running in production. User credentials +should be used only during development. + +1. [Download and install the Google Cloud CLI](https://cloud.google.com/sdk). +2. Set up a local ADC file with your user credentials: + +```sh +gcloud auth application-default login +``` + +3. Write code as if already authenticated. + +For more information about setting up authentication for a local development environment, see +[Set up Application Default Credentials](https://cloud.google.com/docs/authentication/provide-credentials-adc#local-dev). + +## Credential Lookup + +The google-cloud-security-public_ca-v1 library provides several mechanisms to configure your system. +Generally, using Application Default Credentials to facilitate automatic +credentials discovery is the easist method. But if you need to explicitly specify +credentials, there are several methods available to you. + +Credentials are accepted in the following ways, in the following order or precedence: + +1. Credentials specified in method arguments +2. Credentials specified in configuration +3. Credentials pointed to or included in environment variables +4. Credentials found in local ADC file +5. Credentials returned by the metadata server for the attached service account (GCP) + +### Configuration + +You can configure a path to a JSON credentials file, either for an individual client object or +globally, for all client objects. The JSON file can contain credentials created for +[workload identity federation](https://cloud.google.com/iam/docs/workload-identity-federation), +[workforce identity federation](https://cloud.google.com/iam/docs/workforce-identity-federation), or a +[service account key](https://cloud.google.com/docs/authentication/provide-credentials-adc#local-key). + +Note: Service account keys are a security risk if not managed correctly. You should +[choose a more secure alternative to service account keys](https://cloud.google.com/docs/authentication#auth-decision-tree) +whenever possible. + +To configure a credentials file for an individual client initialization: + +```ruby +require "google/cloud/security/public_ca/v1" + +client = ::Google::Cloud::Security::PublicCA::V1::PublicCertificateAuthorityService::Client.new do |config| + config.credentials = "path/to/credentialfile.json" +end +``` + +To configure a credentials file globally for all clients: + +```ruby +require "google/cloud/security/public_ca/v1" + +::Google::Cloud::Security::PublicCA::V1::PublicCertificateAuthorityService::Client.configure do |config| + config.credentials = "path/to/credentialfile.json" +end + +client = ::Google::Cloud::Security::PublicCA::V1::PublicCertificateAuthorityService::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-security-public_ca-v1 +checks for credentials are: + +* `GOOGLE_CLOUD_CREDENTIALS` - Path to JSON file, or JSON contents +* `GOOGLE_APPLICATION_CREDENTIALS` - Path to JSON file + +```ruby +require "google/cloud/security/public_ca/v1" + +ENV["GOOGLE_APPLICATION_CREDENTIALS"] = "path/to/credentialfile.json" + +client = ::Google::Cloud::Security::PublicCA::V1::PublicCertificateAuthorityService::Client.new +``` + +### Local ADC file + +You can set up a local ADC file with your user credentials for authentication during +development. If credentials are not provided in code or in environment variables, +then the local ADC credentials are discovered. + +Follow the steps in [Quickstart](#quickstart) to set up a local ADC file. + +### Google Cloud Platform environments + +When running on Google Cloud Platform (GCP), including Google Compute Engine +(GCE), Google Kubernetes Engine (GKE), Google App Engine (GAE), Google Cloud +Functions (GCF) and Cloud Run, credentials are retrieved from the attached +service account automatically. Code should be written as if already authenticated. + +For more information, see +[Set up ADC for Google Cloud services](https://cloud.google.com/docs/authentication/provide-credentials-adc#attached-sa). diff --git a/owl-bot-staging/google-cloud-security-public_ca-v1/CHANGELOG.md b/owl-bot-staging/google-cloud-security-public_ca-v1/CHANGELOG.md new file mode 100644 index 000000000000..f88957a62ba2 --- /dev/null +++ b/owl-bot-staging/google-cloud-security-public_ca-v1/CHANGELOG.md @@ -0,0 +1,2 @@ +# Release History + diff --git a/owl-bot-staging/google-cloud-security-public_ca-v1/Gemfile b/owl-bot-staging/google-cloud-security-public_ca-v1/Gemfile new file mode 100644 index 000000000000..1d08558908d8 --- /dev/null +++ b/owl-bot-staging/google-cloud-security-public_ca-v1/Gemfile @@ -0,0 +1,14 @@ +source "https://rubygems.org" + +gemspec + +gem "google-style", "~> 1.32.0" +gem "irb", "~> 1.17" +gem "minitest", "~> 6.0.2" +gem "minitest-focus", "~> 1.4" +gem "minitest-mock", "~> 5.27" +gem "minitest-rg", "~> 5.3" +gem "ostruct", "~> 0.5.5" +gem "rake", ">= 13.0" +gem "redcarpet", "~> 3.6" +gem "yard", "~> 0.9" diff --git a/owl-bot-staging/google-cloud-security-public_ca-v1/LICENSE.md b/owl-bot-staging/google-cloud-security-public_ca-v1/LICENSE.md new file mode 100644 index 000000000000..c261857ba6ad --- /dev/null +++ b/owl-bot-staging/google-cloud-security-public_ca-v1/LICENSE.md @@ -0,0 +1,201 @@ + Apache License + Version 2.0, January 2004 + http://www.apache.org/licenses/ + + TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION + + 1. Definitions. + + "License" shall mean the terms and conditions for use, reproduction, + and distribution as defined by Sections 1 through 9 of this document. + + "Licensor" shall mean the copyright owner or entity authorized by + the copyright owner that is granting the License. + + "Legal Entity" shall mean the union of the acting entity and all + other entities that control, are controlled by, or are under common + control with that entity. For the purposes of this definition, + "control" means (i) the power, direct or indirect, to cause the + direction or management of such entity, whether by contract or + otherwise, or (ii) ownership of fifty percent (50%) or more of the + outstanding shares, or (iii) beneficial ownership of such entity. + + "You" (or "Your") shall mean an individual or Legal Entity + exercising permissions granted by this License. + + "Source" form shall mean the preferred form for making modifications, + including but not limited to software source code, documentation + source, and configuration files. + + "Object" form shall mean any form resulting from mechanical + transformation or translation of a Source form, including but + not limited to compiled object code, generated documentation, + and conversions to other media types. + + "Work" shall mean the work of authorship, whether in Source or + Object form, made available under the License, as indicated by a + copyright notice that is included in or attached to the work + (an example is provided in the Appendix below). + + "Derivative Works" shall mean any work, whether in Source or Object + form, that is based on (or derived from) the Work and for which the + editorial revisions, annotations, elaborations, or other modifications + represent, as a whole, an original work of authorship. For the purposes + of this License, Derivative Works shall not include works that remain + separable from, or merely link (or bind by name) to the interfaces of, + the Work and Derivative Works thereof. + + "Contribution" shall mean any work of authorship, including + the original version of the Work and any modifications or additions + to that Work or Derivative Works thereof, that is intentionally + submitted to Licensor for inclusion in the Work by the copyright owner + or by an individual or Legal Entity authorized to submit on behalf of + the copyright owner. For the purposes of this definition, "submitted" + means any form of electronic, verbal, or written communication sent + to the Licensor or its representatives, including but not limited to + communication on electronic mailing lists, source code control systems, + and issue tracking systems that are managed by, or on behalf of, the + Licensor for the purpose of discussing and improving the Work, but + excluding communication that is conspicuously marked or otherwise + designated in writing by the copyright owner as "Not a Contribution." + + "Contributor" shall mean Licensor and any individual or Legal Entity + on behalf of whom a Contribution has been received by Licensor and + subsequently incorporated within the Work. + + 2. Grant of Copyright License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + copyright license to reproduce, prepare Derivative Works of, + publicly display, publicly perform, sublicense, and distribute the + Work and such Derivative Works in Source or Object form. + + 3. Grant of Patent License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + (except as stated in this section) patent license to make, have made, + use, offer to sell, sell, import, and otherwise transfer the Work, + where such license applies only to those patent claims licensable + by such Contributor that are necessarily infringed by their + Contribution(s) alone or by combination of their Contribution(s) + with the Work to which such Contribution(s) was submitted. If You + institute patent litigation against any entity (including a + cross-claim or counterclaim in a lawsuit) alleging that the Work + or a Contribution incorporated within the Work constitutes direct + or contributory patent infringement, then any patent licenses + granted to You under this License for that Work shall terminate + as of the date such litigation is filed. + + 4. Redistribution. You may reproduce and distribute copies of the + Work or Derivative Works thereof in any medium, with or without + modifications, and in Source or Object form, provided that You + meet the following conditions: + + (a) You must give any other recipients of the Work or + Derivative Works a copy of this License; and + + (b) You must cause any modified files to carry prominent notices + stating that You changed the files; and + + (c) You must retain, in the Source form of any Derivative Works + that You distribute, all copyright, patent, trademark, and + attribution notices from the Source form of the Work, + excluding those notices that do not pertain to any part of + the Derivative Works; and + + (d) If the Work includes a "NOTICE" text file as part of its + distribution, then any Derivative Works that You distribute must + include a readable copy of the attribution notices contained + within such NOTICE file, excluding those notices that do not + pertain to any part of the Derivative Works, in at least one + of the following places: within a NOTICE text file distributed + as part of the Derivative Works; within the Source form or + documentation, if provided along with the Derivative Works; or, + within a display generated by the Derivative Works, if and + wherever such third-party notices normally appear. The contents + of the NOTICE file are for informational purposes only and + do not modify the License. You may add Your own attribution + notices within Derivative Works that You distribute, alongside + or as an addendum to the NOTICE text from the Work, provided + that such additional attribution notices cannot be construed + as modifying the License. + + You may add Your own copyright statement to Your modifications and + may provide additional or different license terms and conditions + for use, reproduction, or distribution of Your modifications, or + for any such Derivative Works as a whole, provided Your use, + reproduction, and distribution of the Work otherwise complies with + the conditions stated in this License. + + 5. Submission of Contributions. Unless You explicitly state otherwise, + any Contribution intentionally submitted for inclusion in the Work + by You to the Licensor shall be under the terms and conditions of + this License, without any additional terms or conditions. + Notwithstanding the above, nothing herein shall supersede or modify + the terms of any separate license agreement you may have executed + with Licensor regarding such Contributions. + + 6. Trademarks. This License does not grant permission to use the trade + names, trademarks, service marks, or product names of the Licensor, + except as required for reasonable and customary use in describing the + origin of the Work and reproducing the content of the NOTICE file. + + 7. Disclaimer of Warranty. Unless required by applicable law or + agreed to in writing, Licensor provides the Work (and each + Contributor provides its Contributions) on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or + implied, including, without limitation, any warranties or conditions + of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A + PARTICULAR PURPOSE. You are solely responsible for determining the + appropriateness of using or redistributing the Work and assume any + risks associated with Your exercise of permissions under this License. + + 8. Limitation of Liability. In no event and under no legal theory, + whether in tort (including negligence), contract, or otherwise, + unless required by applicable law (such as deliberate and grossly + negligent acts) or agreed to in writing, shall any Contributor be + liable to You for damages, including any direct, indirect, special, + incidental, or consequential damages of any character arising as a + result of this License or out of the use or inability to use the + Work (including but not limited to damages for loss of goodwill, + work stoppage, computer failure or malfunction, or any and all + other commercial damages or losses), even if such Contributor + has been advised of the possibility of such damages. + + 9. Accepting Warranty or Additional Liability. While redistributing + the Work or Derivative Works thereof, You may choose to offer, + and charge a fee for, acceptance of support, warranty, indemnity, + or other liability obligations and/or rights consistent with this + License. However, in accepting such obligations, You may act only + on Your own behalf and on Your sole responsibility, not on behalf + of any other Contributor, and only if You agree to indemnify, + defend, and hold each Contributor harmless for any liability + incurred by, or claims asserted against, such Contributor by reason + of your accepting any such warranty or additional liability. + + END OF TERMS AND CONDITIONS + + APPENDIX: How to apply the Apache License to your work. + + To apply the Apache License to your work, attach the following + boilerplate notice, with the fields enclosed by brackets "[]" + replaced with your own identifying information. (Don't include + the brackets!) The text should be enclosed in the appropriate + comment syntax for the file format. We also recommend that a + file or class name and description of purpose be included on the + same "printed page" as the copyright notice for easier + identification within third-party archives. + + Copyright [yyyy] [name of copyright owner] + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. diff --git a/owl-bot-staging/google-cloud-security-public_ca-v1/README.md b/owl-bot-staging/google-cloud-security-public_ca-v1/README.md new file mode 100644 index 000000000000..8c67c2b3443d --- /dev/null +++ b/owl-bot-staging/google-cloud-security-public_ca-v1/README.md @@ -0,0 +1,154 @@ +# Ruby Client for the Public Certificate Authority V1 API + +The Public Certificate Authority API may be used to create and manage ACME external account binding keys associated with Google Trust Services' publicly trusted certificate authority. + +The Public Certificate Authority API may be used to create and manage ACME external account binding keys associated with Google Trust Services' publicly trusted certificate authority. + +https://github.com/googleapis/google-cloud-ruby + +This gem is a _versioned_ client. It provides basic client classes for a +specific version of the Public Certificate Authority V1 API. Most users should consider using +the main client gem, +[google-cloud-security-public_ca](https://rubygems.org/gems/google-cloud-security-public_ca). +See the section below titled *Which client should I use?* for more information. + +## Installation + +``` +$ gem install google-cloud-security-public_ca-v1 +``` + +## Before You Begin + +In order to use this library, you first need to go through the following steps: + +1. [Select or create a Cloud Platform project.](https://console.cloud.google.com/project) +1. [Enable billing for your project.](https://cloud.google.com/billing/docs/how-to/modify-project#enable_billing_for_a_project) +1. [Enable the API.](https://console.cloud.google.com/apis/library/publicca.googleapis.com) +1. [Set up authentication.](AUTHENTICATION.md) + +## Quick Start + +```ruby +require "google/cloud/security/public_ca/v1" + +client = ::Google::Cloud::Security::PublicCA::V1::PublicCertificateAuthorityService::Client.new +request = ::Google::Cloud::Security::PublicCA::V1::CreateExternalAccountKeyRequest.new # (request fields as keyword arguments...) +response = client.create_external_account_key request +``` + +View the [Client Library Documentation](https://cloud.google.com/ruby/docs/reference/google-cloud-security-public_ca-v1/latest) +for class and method documentation. + +See also the [Product Documentation](https://cloud.google.com/certificate-manager/docs/public-ca) +for general usage information. + +## Debug Logging + +This library comes with opt-in Debug Logging that can help you troubleshoot +your application's integration with the API. When logging is activated, key +events such as requests and responses, along with data payloads and metadata +such as headers and client configuration, are logged to the standard error +stream. + +**WARNING:** Client Library Debug Logging includes your data payloads in +plaintext, which could include sensitive data such as PII for yourself or your +customers, private keys, or other security data that could be compromising if +leaked. Always practice good data hygiene with your application logs, and follow +the principle of least access. Google also recommends that Client Library Debug +Logging be enabled only temporarily during active debugging, and not used +permanently in production. + +To enable logging, set the environment variable `GOOGLE_SDK_RUBY_LOGGING_GEMS` +to the value `all`. Alternatively, you can set the value to a comma-delimited +list of client library gem names. This will select the default logging behavior, +which writes logs to the standard error stream. On a local workstation, this may +result in logs appearing on the console. When running on a Google Cloud hosting +service such as [Google Cloud Run](https://cloud.google.com/run), this generally +results in logs appearing alongside your application logs in the +[Google Cloud Logging](https://cloud.google.com/logging/) service. + +You can customize logging by modifying the `logger` configuration when +constructing a client object. For example: + +```ruby +require "google/cloud/security/public_ca/v1" +require "logger" + +client = ::Google::Cloud::Security::PublicCA::V1::PublicCertificateAuthorityService::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-security-public_ca`, +and lower-level _versioned_ client libraries with names such as +`google-cloud-security-public_ca-v1`. +_In most cases, you should install the main client._ + +### What's the difference between the main client and a versioned client? + +A _versioned client_ provides a basic set of data types and client classes for +a _single version_ of a specific service. (That is, for a service with multiple +versions, there might be a separate versioned client for each service version.) +Most versioned clients are written and maintained by a code generator. + +The _main client_ is designed to provide you with the _recommended_ client +interfaces for the service. There will be only one main client for any given +service, even a service with multiple versions. The main client includes +factory methods for constructing the client objects we recommend for most +users. In some cases, those will be classes provided by an underlying versioned +client; in other cases, they will be handwritten higher-level client objects +with additional capabilities, convenience methods, or best practices built in. +Generally, the main client will default to a recommended service version, +although in some cases you can override this if you need to talk to a specific +service version. + +### Why would I want to use the main client? + +We recommend that most users install the main client gem for a service. You can +identify this gem as the one _without_ a version in its name, e.g. +`google-cloud-security-public_ca`. +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-security-public_ca-v1`. + +### What about the google-apis- clients? + +Client library gems with names that begin with `google-apis-` are based on an +older code generation technology. They talk to a REST/JSON backend (whereas +most modern clients talk to a [gRPC](https://grpc.io/) backend) and they may +not offer the same performance, features, and ease of use provided by more +modern clients. + +The `google-apis-` clients have wide coverage across Google services, so you +might need to use one if there is no modern client available for the service. +However, if a modern client is available, we generally recommend it over the +older `google-apis-` clients. diff --git a/owl-bot-staging/google-cloud-security-public_ca-v1/Rakefile b/owl-bot-staging/google-cloud-security-public_ca-v1/Rakefile new file mode 100644 index 000000000000..2959daaebab6 --- /dev/null +++ b/owl-bot-staging/google-cloud-security-public_ca-v1/Rakefile @@ -0,0 +1,169 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +require "bundler/setup" +require "bundler/gem_tasks" + +require "rubocop/rake_task" +RuboCop::RakeTask.new + +require "rake/testtask" +desc "Run tests." +Rake::TestTask.new do |t| + t.libs << "test" + t.test_files = FileList["test/**/*_test.rb"] + t.warning = false +end + +desc "Runs the smoke tests." +Rake::TestTask.new :smoke_test do |t| + t.test_files = FileList["acceptance/**/*smoke_test.rb"] + t.warning = false +end + +# Acceptance tests +desc "Run the google-cloud-security-public_ca-v1 acceptance tests." +task :acceptance, :project, :keyfile do |t, args| + project = args[:project] + project ||= + ENV["GOOGLE_CLOUD_TEST_PROJECT"] || + ENV["GCLOUD_TEST_PROJECT"] + keyfile = args[:keyfile] + keyfile ||= + ENV["GOOGLE_CLOUD_TEST_KEYFILE"] || + ENV["GCLOUD_TEST_KEYFILE"] + if keyfile + keyfile = File.read keyfile + else + keyfile ||= + ENV["GOOGLE_CLOUD_TEST_KEYFILE_JSON"] || + ENV["GCLOUD_TEST_KEYFILE_JSON"] + end + if project.nil? || keyfile.nil? + fail "You must provide a project and keyfile. e.g. rake acceptance[test123, /path/to/keyfile.json] or GOOGLE_CLOUD_TEST_PROJECT=test123 GOOGLE_CLOUD_TEST_KEYFILE=/path/to/keyfile.json rake acceptance" + end + require "google/cloud/security/public_ca/v1/public_certificate_authority_service/credentials" + ::Google::Cloud::Security::PublicCA::V1::PublicCertificateAuthorityService::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-security-public_ca-v1 gem has no acceptance tests." + end + end + + desc "Run acceptance cleanup." + task :cleanup do + end +end + +task :samples do + Rake::Task["samples:latest"].invoke +end + +namespace :samples do + task :latest do + if File.directory? "samples" + Dir.chdir "samples" do + Bundler.with_clean_env do + ENV["GOOGLE_CLOUD_SAMPLES_TEST"] = "not_master" + sh "bundle update" + sh "bundle exec rake test" + end + end + else + puts "The google-cloud-security-public_ca-v1 gem has no samples to test." + end + end + + task :master do + if File.directory? "samples" + Dir.chdir "samples" do + Bundler.with_clean_env do + ENV["GOOGLE_CLOUD_SAMPLES_TEST"] = "master" + sh "bundle update" + sh "bundle exec rake test" + end + end + else + puts "The google-cloud-security-public_ca-v1 gem has no samples to test." + end + end +end + +require "yard" +require "yard/rake/yardoc_task" +YARD::Rake::YardocTask.new do |y| + y.options << "--fail-on-warning" +end + +desc "Run yard-doctest example tests." +task :doctest do + puts "The google-cloud-security-public_ca-v1 gem does not have doctest tests." +end + +desc "Run the CI build" +task :ci do + header "BUILDING google-cloud-security-public_ca-v1" + header "google-cloud-security-public_ca-v1 rubocop", "*" + Rake::Task[:rubocop].invoke + header "google-cloud-security-public_ca-v1 yard", "*" + Rake::Task[:yard].invoke + header "google-cloud-security-public_ca-v1 test", "*" + Rake::Task[:test].invoke +end + +namespace :ci do + desc "Run the CI build, with smoke tests." + task :smoke_test do + Rake::Task[:ci].invoke + header "google-cloud-security-public_ca-v1 smoke_test", "*" + Rake::Task[:smoke_test].invoke + end + desc "Run the CI build, with acceptance tests." + task :acceptance do + Rake::Task[:ci].invoke + header "google-cloud-security-public_ca-v1 acceptance", "*" + Rake::Task[:acceptance].invoke + end + task :a do + # This is a handy shortcut to save typing + Rake::Task["ci:acceptance"].invoke + end +end + +task default: :test + +def header str, token = "#" + line_length = str.length + 8 + puts "" + puts token * line_length + puts "#{token * 3} #{str} #{token * 3}" + puts token * line_length + puts "" +end diff --git a/owl-bot-staging/google-cloud-security-public_ca-v1/gapic_metadata.json b/owl-bot-staging/google-cloud-security-public_ca-v1/gapic_metadata.json new file mode 100644 index 000000000000..654c3bdcaf0f --- /dev/null +++ b/owl-bot-staging/google-cloud-security-public_ca-v1/gapic_metadata.json @@ -0,0 +1,23 @@ +{ + "schema": "1.0", + "comment": "This file maps proto services/RPCs to the corresponding library clients/methods", + "language": "ruby", + "protoPackage": "google.cloud.security.publicca.v1", + "libraryPackage": "::Google::Cloud::Security::PublicCA::V1", + "services": { + "PublicCertificateAuthorityService": { + "clients": { + "grpc": { + "libraryClient": "::Google::Cloud::Security::PublicCA::V1::PublicCertificateAuthorityService::Client", + "rpcs": { + "CreateExternalAccountKey": { + "methods": [ + "create_external_account_key" + ] + } + } + } + } + } + } +} diff --git a/owl-bot-staging/google-cloud-security-public_ca-v1/google-cloud-security-public_ca-v1.gemspec b/owl-bot-staging/google-cloud-security-public_ca-v1/google-cloud-security-public_ca-v1.gemspec new file mode 100644 index 000000000000..e28f870af1f5 --- /dev/null +++ b/owl-bot-staging/google-cloud-security-public_ca-v1/google-cloud-security-public_ca-v1.gemspec @@ -0,0 +1,28 @@ +# -*- ruby -*- +# encoding: utf-8 + +require File.expand_path("lib/google/cloud/security/public_ca/v1/version", __dir__) + +Gem::Specification.new do |gem| + gem.name = "google-cloud-security-public_ca-v1" + gem.version = Google::Cloud::Security::PublicCA::V1::VERSION + + gem.authors = ["Google LLC"] + gem.email = "googleapis-packages@google.com" + gem.description = "The Public Certificate Authority API may be used to create and manage ACME external account binding keys associated with Google Trust Services' publicly trusted certificate authority. Note that google-cloud-security-public_ca-v1 is a version-specific client library. For most uses, we recommend installing the main client library google-cloud-security-public_ca instead. See the readme for more details." + gem.summary = "The Public Certificate Authority API may be used to create and manage ACME external account binding keys associated with Google Trust Services' publicly trusted certificate authority." + 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" +end diff --git a/owl-bot-staging/google-cloud-security-public_ca-v1/lib/google-cloud-security-public_ca-v1.rb b/owl-bot-staging/google-cloud-security-public_ca-v1/lib/google-cloud-security-public_ca-v1.rb new file mode 100644 index 000000000000..dc9dd30bc691 --- /dev/null +++ b/owl-bot-staging/google-cloud-security-public_ca-v1/lib/google-cloud-security-public_ca-v1.rb @@ -0,0 +1,21 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +# This gem does not autoload during Bundler.require. To load this gem, +# issue explicit require statements for the packages desired, e.g.: +# require "google/cloud/security/public_ca/v1" diff --git a/owl-bot-staging/google-cloud-security-public_ca-v1/lib/google/cloud/security/public_ca/v1.rb b/owl-bot-staging/google-cloud-security-public_ca-v1/lib/google/cloud/security/public_ca/v1.rb new file mode 100644 index 000000000000..9fa2b063e2b5 --- /dev/null +++ b/owl-bot-staging/google-cloud-security-public_ca-v1/lib/google/cloud/security/public_ca/v1.rb @@ -0,0 +1,47 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +require "google/cloud/security/public_ca/v1/public_certificate_authority_service" +require "google/cloud/security/public_ca/v1/version" + +module Google + module Cloud + module Security + module PublicCA + ## + # API client module. + # + # @example Load this package, including all its services, and instantiate a gRPC client + # + # require "google/cloud/security/public_ca/v1" + # client = ::Google::Cloud::Security::PublicCA::V1::PublicCertificateAuthorityService::Client.new + # + # @example Load this package, including all its services, and instantiate a REST client + # + # require "google/cloud/security/public_ca/v1" + # client = ::Google::Cloud::Security::PublicCA::V1::PublicCertificateAuthorityService::Rest::Client.new + # + module V1 + end + end + end + end +end + +helper_path = ::File.join __dir__, "v1", "_helpers.rb" +require "google/cloud/security/public_ca/v1/_helpers" if ::File.file? helper_path diff --git a/owl-bot-staging/google-cloud-security-public_ca-v1/lib/google/cloud/security/public_ca/v1/public_certificate_authority_service.rb b/owl-bot-staging/google-cloud-security-public_ca-v1/lib/google/cloud/security/public_ca/v1/public_certificate_authority_service.rb new file mode 100644 index 000000000000..31344956f931 --- /dev/null +++ b/owl-bot-staging/google-cloud-security-public_ca-v1/lib/google/cloud/security/public_ca/v1/public_certificate_authority_service.rb @@ -0,0 +1,59 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +require "gapic/common" +require "gapic/config" +require "gapic/config/method" + +require "google/cloud/security/public_ca/v1/version" + +require "google/cloud/security/public_ca/v1/public_certificate_authority_service/credentials" +require "google/cloud/security/public_ca/v1/public_certificate_authority_service/paths" +require "google/cloud/security/public_ca/v1/public_certificate_authority_service/client" +require "google/cloud/security/public_ca/v1/public_certificate_authority_service/rest" + +module Google + module Cloud + module Security + module PublicCA + module V1 + ## + # Manages the resources required for ACME [external account + # binding](https://tools.ietf.org/html/rfc8555#section-7.3.4) for + # the public certificate authority service. + # + # @example Load this service and instantiate a gRPC client + # + # require "google/cloud/security/public_ca/v1/public_certificate_authority_service" + # client = ::Google::Cloud::Security::PublicCA::V1::PublicCertificateAuthorityService::Client.new + # + # @example Load this service and instantiate a REST client + # + # require "google/cloud/security/public_ca/v1/public_certificate_authority_service/rest" + # client = ::Google::Cloud::Security::PublicCA::V1::PublicCertificateAuthorityService::Rest::Client.new + # + module PublicCertificateAuthorityService + end + end + end + end + end +end + +helper_path = ::File.join __dir__, "public_certificate_authority_service", "helpers.rb" +require "google/cloud/security/public_ca/v1/public_certificate_authority_service/helpers" if ::File.file? helper_path diff --git a/owl-bot-staging/google-cloud-security-public_ca-v1/lib/google/cloud/security/public_ca/v1/public_certificate_authority_service/client.rb b/owl-bot-staging/google-cloud-security-public_ca-v1/lib/google/cloud/security/public_ca/v1/public_certificate_authority_service/client.rb new file mode 100644 index 000000000000..04d86a7b153a --- /dev/null +++ b/owl-bot-staging/google-cloud-security-public_ca-v1/lib/google/cloud/security/public_ca/v1/public_certificate_authority_service/client.rb @@ -0,0 +1,492 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +require "google/cloud/errors" +require "google/cloud/security/publicca/v1/service_pb" + +module Google + module Cloud + module Security + module PublicCA + module V1 + module PublicCertificateAuthorityService + ## + # Client for the PublicCertificateAuthorityService service. + # + # Manages the resources required for ACME [external account + # binding](https://tools.ietf.org/html/rfc8555#section-7.3.4) for + # the public certificate authority service. + # + class Client + # @private + API_VERSION = "" + + # @private + DEFAULT_ENDPOINT_TEMPLATE = "publicca.$UNIVERSE_DOMAIN$" + + include Paths + + # @private + attr_reader :public_certificate_authority_service_stub + + ## + # Configure the PublicCertificateAuthorityService Client class. + # + # See {::Google::Cloud::Security::PublicCA::V1::PublicCertificateAuthorityService::Client::Configuration} + # for a description of the configuration fields. + # + # @example + # + # # Modify the configuration for all PublicCertificateAuthorityService clients + # ::Google::Cloud::Security::PublicCA::V1::PublicCertificateAuthorityService::Client.configure do |config| + # config.timeout = 10.0 + # end + # + # @yield [config] Configure the Client client. + # @yieldparam config [Client::Configuration] + # + # @return [Client::Configuration] + # + def self.configure + @configure ||= begin + namespace = ["Google", "Cloud", "Security", "PublicCA", "V1"] + parent_config = while namespace.any? + parent_name = namespace.join "::" + parent_const = const_get parent_name + break parent_const.configure if parent_const.respond_to? :configure + namespace.pop + end + default_config = Client::Configuration.new parent_config + + default_config.timeout = 60.0 + default_config.retry_policy = { + initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [14] + } + + default_config + end + yield @configure if block_given? + @configure + end + + ## + # Configure the PublicCertificateAuthorityService Client instance. + # + # The configuration is set to the derived mode, meaning that values can be changed, + # but structural changes (adding new fields, etc.) are not allowed. Structural changes + # should be made on {Client.configure}. + # + # See {::Google::Cloud::Security::PublicCA::V1::PublicCertificateAuthorityService::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 + @public_certificate_authority_service_stub.universe_domain + end + + ## + # Create a new PublicCertificateAuthorityService client object. + # + # @example + # + # # Create a client using the default configuration + # client = ::Google::Cloud::Security::PublicCA::V1::PublicCertificateAuthorityService::Client.new + # + # # Create a client using a custom configuration + # client = ::Google::Cloud::Security::PublicCA::V1::PublicCertificateAuthorityService::Client.new do |config| + # config.timeout = 10.0 + # end + # + # @yield [config] Configure the PublicCertificateAuthorityService client. + # @yieldparam config [Client::Configuration] + # + def initialize + # These require statements are intentionally placed here to initialize + # the gRPC module only when it's required. + # See https://github.com/googleapis/toolkit/issues/446 + require "gapic/grpc" + require "google/cloud/security/publicca/v1/service_services_pb" + + # Create the configuration object + @config = Configuration.new Client.configure + + # Yield the configuration if needed + yield @config if block_given? + + # Create credentials + credentials = @config.credentials + # Use self-signed JWT if the endpoint is unchanged from default, + # but only if the default endpoint does not have a region prefix. + enable_self_signed_jwt = @config.endpoint.nil? || + (@config.endpoint == Configuration::DEFAULT_ENDPOINT && + !@config.endpoint.split(".").first.include?("-")) + credentials ||= Credentials.default scope: @config.scope, + enable_self_signed_jwt: enable_self_signed_jwt + if credentials.is_a?(::String) || credentials.is_a?(::Hash) + credentials = Credentials.new credentials, scope: @config.scope + end + @quota_project_id = @config.quota_project + @quota_project_id ||= credentials.quota_project_id if credentials.respond_to? :quota_project_id + + @public_certificate_authority_service_stub = ::Gapic::ServiceStub.new( + ::Google::Cloud::Security::PublicCA::V1::PublicCertificateAuthorityService::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 + ) + + @public_certificate_authority_service_stub.stub_logger&.info do |entry| + entry.set_system_name + entry.set_service + entry.message = "Created client for #{entry.service}" + entry.set_credentials_fields credentials + entry.set "customEndpoint", @config.endpoint if @config.endpoint + entry.set "defaultTimeout", @config.timeout if @config.timeout + entry.set "quotaProject", @quota_project_id if @quota_project_id + end + end + + ## + # The logger used for request/response debug logging. + # + # @return [Logger] + # + def logger + @public_certificate_authority_service_stub.logger + end + + # Service calls + + ## + # Creates a new + # {::Google::Cloud::Security::PublicCA::V1::ExternalAccountKey ExternalAccountKey} + # bound to the project. + # + # @overload create_external_account_key(request, options = nil) + # Pass arguments to `create_external_account_key` via a request object, either of type + # {::Google::Cloud::Security::PublicCA::V1::CreateExternalAccountKeyRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Security::PublicCA::V1::CreateExternalAccountKeyRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_external_account_key(parent: nil, external_account_key: nil) + # Pass arguments to `create_external_account_key` via keyword arguments. Note that at + # least one keyword argument is 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 external_account_key will be + # created. Format: projects/[project_id]/locations/[location]. At present + # only the "global" location is supported. + # @param external_account_key [::Google::Cloud::Security::PublicCA::V1::ExternalAccountKey, ::Hash] + # Required. The external account key to create. This field only exists to + # future-proof the API. At present, all fields in ExternalAccountKey are + # output only and all values are ignored. For the purpose of the + # CreateExternalAccountKeyRequest, set it to a default/empty value. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Google::Cloud::Security::PublicCA::V1::ExternalAccountKey] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Google::Cloud::Security::PublicCA::V1::ExternalAccountKey] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/security/public_ca/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Security::PublicCA::V1::PublicCertificateAuthorityService::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Security::PublicCA::V1::CreateExternalAccountKeyRequest.new + # + # # Call the create_external_account_key method. + # result = client.create_external_account_key request + # + # # The returned object is of type Google::Cloud::Security::PublicCA::V1::ExternalAccountKey. + # p result + # + def create_external_account_key request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Security::PublicCA::V1::CreateExternalAccountKeyRequest + + # Converts hash 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_external_account_key.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::Security::PublicCA::V1::VERSION + metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.parent + header_params["parent"] = request.parent + end + + request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") + metadata[:"x-goog-request-params"] ||= request_params_header + + options.apply_defaults timeout: @config.rpcs.create_external_account_key.timeout, + metadata: metadata, + retry_policy: @config.rpcs.create_external_account_key.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @public_certificate_authority_service_stub.call_rpc :create_external_account_key, request, options: options do |response, operation| + yield response, operation if block_given? + end + rescue ::GRPC::BadStatus => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Configuration class for the PublicCertificateAuthorityService API. + # + # This class represents the configuration for PublicCertificateAuthorityService, + # providing control over timeouts, retry behavior, logging, transport + # parameters, and other low-level controls. Certain parameters can also be + # applied individually to specific RPCs. See + # {::Google::Cloud::Security::PublicCA::V1::PublicCertificateAuthorityService::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_external_account_key to 20 seconds, + # # and all remaining timeouts to 10 seconds. + # ::Google::Cloud::Security::PublicCA::V1::PublicCertificateAuthorityService::Client.configure do |config| + # config.timeout = 10.0 + # config.rpcs.create_external_account_key.timeout = 20.0 + # end + # + # # Apply the above configuration only to a new client. + # client = ::Google::Cloud::Security::PublicCA::V1::PublicCertificateAuthorityService::Client.new do |config| + # config.timeout = 10.0 + # config.rpcs.create_external_account_key.timeout = 20.0 + # end + # + # @!attribute [rw] endpoint + # A custom service endpoint, as a hostname or hostname:port. The default is + # nil, indicating to use the default endpoint in the current universe domain. + # @return [::String,nil] + # @!attribute [rw] credentials + # Credentials to send with calls. You may provide any of the following types: + # * (`Google::Auth::Credentials`) A googleauth credentials object + # (see the [googleauth docs](https://rubydoc.info/gems/googleauth/Google/Auth/Credentials)) + # * (`Signet::OAuth2::Client`) A signet oauth2 client object + # (see the [signet docs](https://rubydoc.info/gems/signet/Signet/OAuth2/Client)) + # * (`GRPC::Core::Channel`) a gRPC channel with included credentials + # * (`GRPC::Core::ChannelCredentials`) a gRPC credentails object + # * (`nil`) indicating no credentials + # + # @note Warning: Passing a `String` to a keyfile path or a `Hash` of credentials + # is deprecated. Providing an unvalidated credential configuration to + # Google APIs can compromise the security of your systems and data. + # + # @example + # + # # The recommended way to provide credentials is to use the `make_creds` method + # # on the appropriate credentials class for your environment. + # + # require "googleauth" + # + # credentials = ::Google::Auth::ServiceAccountCredentials.make_creds( + # json_key_io: ::File.open("/path/to/keyfile.json") + # ) + # + # client = ::Google::Cloud::Security::PublicCA::V1::PublicCertificateAuthorityService::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 = "publicca.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 PublicCertificateAuthorityService 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_external_account_key` + # @return [::Gapic::Config::Method] + # + attr_reader :create_external_account_key + + # @private + def initialize parent_rpcs = nil + create_external_account_key_config = parent_rpcs.create_external_account_key if parent_rpcs.respond_to? :create_external_account_key + @create_external_account_key = ::Gapic::Config::Method.new create_external_account_key_config + + yield self if block_given? + end + end + end + end + end + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-security-public_ca-v1/lib/google/cloud/security/public_ca/v1/public_certificate_authority_service/credentials.rb b/owl-bot-staging/google-cloud-security-public_ca-v1/lib/google/cloud/security/public_ca/v1/public_certificate_authority_service/credentials.rb new file mode 100644 index 000000000000..653fd16c5675 --- /dev/null +++ b/owl-bot-staging/google-cloud-security-public_ca-v1/lib/google/cloud/security/public_ca/v1/public_certificate_authority_service/credentials.rb @@ -0,0 +1,49 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +require "googleauth" + +module Google + module Cloud + module Security + module PublicCA + module V1 + module PublicCertificateAuthorityService + # Credentials for the PublicCertificateAuthorityService API. + class Credentials < ::Google::Auth::Credentials + self.scope = [ + "https://www.googleapis.com/auth/cloud-platform" + ] + self.env_vars = [ + "GOOGLE_CLOUD_CREDENTIALS", + "GOOGLE_CLOUD_KEYFILE", + "GCLOUD_KEYFILE", + "GOOGLE_CLOUD_CREDENTIALS_JSON", + "GOOGLE_CLOUD_KEYFILE_JSON", + "GCLOUD_KEYFILE_JSON" + ] + self.paths = [ + "~/.config/google_cloud/application_default_credentials.json" + ] + end + end + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-security-public_ca-v1/lib/google/cloud/security/public_ca/v1/public_certificate_authority_service/paths.rb b/owl-bot-staging/google-cloud-security-public_ca-v1/lib/google/cloud/security/public_ca/v1/public_certificate_authority_service/paths.rb new file mode 100644 index 000000000000..e77bca2284db --- /dev/null +++ b/owl-bot-staging/google-cloud-security-public_ca-v1/lib/google/cloud/security/public_ca/v1/public_certificate_authority_service/paths.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 Cloud + module Security + module PublicCA + module V1 + module PublicCertificateAuthorityService + # Path helper methods for the PublicCertificateAuthorityService API. + module Paths + ## + # Create a fully-qualified ExternalAccountKey resource string. + # + # The resource will be in the following format: + # + # `projects/{project}/locations/{location}/externalAccountKeys/{external_account_key}` + # + # @param project [String] + # @param location [String] + # @param external_account_key [String] + # + # @return [::String] + def external_account_key_path project:, location:, external_account_key: + raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" + raise ::ArgumentError, "location cannot contain /" if location.to_s.include? "/" + + "projects/#{project}/locations/#{location}/externalAccountKeys/#{external_account_key}" + 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 + + extend self + end + end + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-security-public_ca-v1/lib/google/cloud/security/public_ca/v1/public_certificate_authority_service/rest.rb b/owl-bot-staging/google-cloud-security-public_ca-v1/lib/google/cloud/security/public_ca/v1/public_certificate_authority_service/rest.rb new file mode 100644 index 000000000000..5244fb7928e9 --- /dev/null +++ b/owl-bot-staging/google-cloud-security-public_ca-v1/lib/google/cloud/security/public_ca/v1/public_certificate_authority_service/rest.rb @@ -0,0 +1,56 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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/security/public_ca/v1/version" + +require "google/cloud/security/public_ca/v1/public_certificate_authority_service/credentials" +require "google/cloud/security/public_ca/v1/public_certificate_authority_service/paths" +require "google/cloud/security/public_ca/v1/public_certificate_authority_service/rest/client" + +module Google + module Cloud + module Security + module PublicCA + module V1 + ## + # Manages the resources required for ACME [external account + # binding](https://tools.ietf.org/html/rfc8555#section-7.3.4) for + # the public certificate authority service. + # + # To load this service and instantiate a REST client: + # + # require "google/cloud/security/public_ca/v1/public_certificate_authority_service/rest" + # client = ::Google::Cloud::Security::PublicCA::V1::PublicCertificateAuthorityService::Rest::Client.new + # + module PublicCertificateAuthorityService + # Client for the REST transport + module Rest + end + end + end + end + end + end +end + +helper_path = ::File.join __dir__, "rest", "helpers.rb" +require "google/cloud/security/public_ca/v1/public_certificate_authority_service/rest/helpers" if ::File.file? helper_path diff --git a/owl-bot-staging/google-cloud-security-public_ca-v1/lib/google/cloud/security/public_ca/v1/public_certificate_authority_service/rest/client.rb b/owl-bot-staging/google-cloud-security-public_ca-v1/lib/google/cloud/security/public_ca/v1/public_certificate_authority_service/rest/client.rb new file mode 100644 index 000000000000..cb487099325f --- /dev/null +++ b/owl-bot-staging/google-cloud-security-public_ca-v1/lib/google/cloud/security/public_ca/v1/public_certificate_authority_service/rest/client.rb @@ -0,0 +1,442 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +require "google/cloud/errors" +require "google/cloud/security/publicca/v1/service_pb" +require "google/cloud/security/public_ca/v1/public_certificate_authority_service/rest/service_stub" + +module Google + module Cloud + module Security + module PublicCA + module V1 + module PublicCertificateAuthorityService + module Rest + ## + # REST client for the PublicCertificateAuthorityService service. + # + # Manages the resources required for ACME [external account + # binding](https://tools.ietf.org/html/rfc8555#section-7.3.4) for + # the public certificate authority service. + # + class Client + # @private + API_VERSION = "" + + # @private + DEFAULT_ENDPOINT_TEMPLATE = "publicca.$UNIVERSE_DOMAIN$" + + include Paths + + # @private + attr_reader :public_certificate_authority_service_stub + + ## + # Configure the PublicCertificateAuthorityService Client class. + # + # See {::Google::Cloud::Security::PublicCA::V1::PublicCertificateAuthorityService::Rest::Client::Configuration} + # for a description of the configuration fields. + # + # @example + # + # # Modify the configuration for all PublicCertificateAuthorityService clients + # ::Google::Cloud::Security::PublicCA::V1::PublicCertificateAuthorityService::Rest::Client.configure do |config| + # config.timeout = 10.0 + # end + # + # @yield [config] Configure the Client client. + # @yieldparam config [Client::Configuration] + # + # @return [Client::Configuration] + # + def self.configure + @configure ||= begin + namespace = ["Google", "Cloud", "Security", "PublicCA", "V1"] + parent_config = while namespace.any? + parent_name = namespace.join "::" + parent_const = const_get parent_name + break parent_const.configure if parent_const.respond_to? :configure + namespace.pop + end + default_config = Client::Configuration.new parent_config + + default_config.timeout = 60.0 + default_config.retry_policy = { + initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [14] + } + + default_config + end + yield @configure if block_given? + @configure + end + + ## + # Configure the PublicCertificateAuthorityService Client instance. + # + # The configuration is set to the derived mode, meaning that values can be changed, + # but structural changes (adding new fields, etc.) are not allowed. Structural changes + # should be made on {Client.configure}. + # + # See {::Google::Cloud::Security::PublicCA::V1::PublicCertificateAuthorityService::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 + @public_certificate_authority_service_stub.universe_domain + end + + ## + # Create a new PublicCertificateAuthorityService REST client object. + # + # @example + # + # # Create a client using the default configuration + # client = ::Google::Cloud::Security::PublicCA::V1::PublicCertificateAuthorityService::Rest::Client.new + # + # # Create a client using a custom configuration + # client = ::Google::Cloud::Security::PublicCA::V1::PublicCertificateAuthorityService::Rest::Client.new do |config| + # config.timeout = 10.0 + # end + # + # @yield [config] Configure the PublicCertificateAuthorityService 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 + + @public_certificate_authority_service_stub = ::Google::Cloud::Security::PublicCA::V1::PublicCertificateAuthorityService::Rest::ServiceStub.new( + endpoint: @config.endpoint, + endpoint_template: DEFAULT_ENDPOINT_TEMPLATE, + universe_domain: @config.universe_domain, + credentials: credentials, + logger: @config.logger + ) + + @public_certificate_authority_service_stub.logger(stub: true)&.info do |entry| + entry.set_system_name + entry.set_service + entry.message = "Created client for #{entry.service}" + entry.set_credentials_fields credentials + entry.set "customEndpoint", @config.endpoint if @config.endpoint + entry.set "defaultTimeout", @config.timeout if @config.timeout + entry.set "quotaProject", @quota_project_id if @quota_project_id + end + end + + ## + # The logger used for request/response debug logging. + # + # @return [Logger] + # + def logger + @public_certificate_authority_service_stub.logger + end + + # Service calls + + ## + # Creates a new + # {::Google::Cloud::Security::PublicCA::V1::ExternalAccountKey ExternalAccountKey} + # bound to the project. + # + # @overload create_external_account_key(request, options = nil) + # Pass arguments to `create_external_account_key` via a request object, either of type + # {::Google::Cloud::Security::PublicCA::V1::CreateExternalAccountKeyRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Security::PublicCA::V1::CreateExternalAccountKeyRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_external_account_key(parent: nil, external_account_key: nil) + # Pass arguments to `create_external_account_key` via keyword arguments. Note that at + # least one keyword argument is 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 external_account_key will be + # created. Format: projects/[project_id]/locations/[location]. At present + # only the "global" location is supported. + # @param external_account_key [::Google::Cloud::Security::PublicCA::V1::ExternalAccountKey, ::Hash] + # Required. The external account key to create. This field only exists to + # future-proof the API. At present, all fields in ExternalAccountKey are + # output only and all values are ignored. For the purpose of the + # CreateExternalAccountKeyRequest, set it to a default/empty value. + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Cloud::Security::PublicCA::V1::ExternalAccountKey] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::Security::PublicCA::V1::ExternalAccountKey] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/security/public_ca/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Security::PublicCA::V1::PublicCertificateAuthorityService::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Security::PublicCA::V1::CreateExternalAccountKeyRequest.new + # + # # Call the create_external_account_key method. + # result = client.create_external_account_key request + # + # # The returned object is of type Google::Cloud::Security::PublicCA::V1::ExternalAccountKey. + # p result + # + def create_external_account_key request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Security::PublicCA::V1::CreateExternalAccountKeyRequest + + # Converts hash 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_external_account_key.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::Security::PublicCA::V1::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + options.apply_defaults timeout: @config.rpcs.create_external_account_key.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.create_external_account_key.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @public_certificate_authority_service_stub.create_external_account_key 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 PublicCertificateAuthorityService REST API. + # + # This class represents the configuration for PublicCertificateAuthorityService REST, + # providing control over timeouts, retry behavior, logging, transport + # parameters, and other low-level controls. Certain parameters can also be + # applied individually to specific RPCs. See + # {::Google::Cloud::Security::PublicCA::V1::PublicCertificateAuthorityService::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_external_account_key to 20 seconds, + # # and all remaining timeouts to 10 seconds. + # ::Google::Cloud::Security::PublicCA::V1::PublicCertificateAuthorityService::Rest::Client.configure do |config| + # config.timeout = 10.0 + # config.rpcs.create_external_account_key.timeout = 20.0 + # end + # + # # Apply the above configuration only to a new client. + # client = ::Google::Cloud::Security::PublicCA::V1::PublicCertificateAuthorityService::Rest::Client.new do |config| + # config.timeout = 10.0 + # config.rpcs.create_external_account_key.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 = "publicca.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 PublicCertificateAuthorityService 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_external_account_key` + # @return [::Gapic::Config::Method] + # + attr_reader :create_external_account_key + + # @private + def initialize parent_rpcs = nil + create_external_account_key_config = parent_rpcs.create_external_account_key if parent_rpcs.respond_to? :create_external_account_key + @create_external_account_key = ::Gapic::Config::Method.new create_external_account_key_config + + yield self if block_given? + end + end + end + end + end + end + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-security-public_ca-v1/lib/google/cloud/security/public_ca/v1/public_certificate_authority_service/rest/service_stub.rb b/owl-bot-staging/google-cloud-security-public_ca-v1/lib/google/cloud/security/public_ca/v1/public_certificate_authority_service/rest/service_stub.rb new file mode 100644 index 000000000000..2ff54a4784c6 --- /dev/null +++ b/owl-bot-staging/google-cloud-security-public_ca-v1/lib/google/cloud/security/public_ca/v1/public_certificate_authority_service/rest/service_stub.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! + +require "google/cloud/security/publicca/v1/service_pb" + +module Google + module Cloud + module Security + module PublicCA + module V1 + module PublicCertificateAuthorityService + module Rest + ## + # REST service stub for the PublicCertificateAuthorityService 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_external_account_key REST call + # + # @param request_pb [::Google::Cloud::Security::PublicCA::V1::CreateExternalAccountKeyRequest] + # A request object representing the call parameters. Required. + # @param options [::Gapic::CallOptions] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Cloud::Security::PublicCA::V1::ExternalAccountKey] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::Security::PublicCA::V1::ExternalAccountKey] + # A result object deserialized from the server's reply + def create_external_account_key request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_create_external_account_key_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_external_account_key", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Cloud::Security::PublicCA::V1::ExternalAccountKey.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_external_account_key REST call + # + # @param request_pb [::Google::Cloud::Security::PublicCA::V1::CreateExternalAccountKeyRequest] + # 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_external_account_key_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :post, + uri_template: "/v1/{parent}/externalAccountKeys", + body: "external_account_key", + matches: [ + ["parent", %r{^projects/[^/]+/locations/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + end + end + end + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-security-public_ca-v1/lib/google/cloud/security/public_ca/v1/rest.rb b/owl-bot-staging/google-cloud-security-public_ca-v1/lib/google/cloud/security/public_ca/v1/rest.rb new file mode 100644 index 000000000000..6b6fd27d8bc9 --- /dev/null +++ b/owl-bot-staging/google-cloud-security-public_ca-v1/lib/google/cloud/security/public_ca/v1/rest.rb @@ -0,0 +1,39 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +require "google/cloud/security/public_ca/v1/public_certificate_authority_service/rest" +require "google/cloud/security/public_ca/v1/version" + +module Google + module Cloud + module Security + module PublicCA + ## + # To load just the REST part of this package, including all its services, and instantiate a REST client: + # + # @example + # + # require "google/cloud/security/public_ca/v1/rest" + # client = ::Google::Cloud::Security::PublicCA::V1::PublicCertificateAuthorityService::Rest::Client.new + # + module V1 + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-security-public_ca-v1/lib/google/cloud/security/public_ca/v1/version.rb b/owl-bot-staging/google-cloud-security-public_ca-v1/lib/google/cloud/security/public_ca/v1/version.rb new file mode 100644 index 000000000000..2af1514737b4 --- /dev/null +++ b/owl-bot-staging/google-cloud-security-public_ca-v1/lib/google/cloud/security/public_ca/v1/version.rb @@ -0,0 +1,30 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + + +module Google + module Cloud + module Security + module PublicCA + module V1 + VERSION = "0.0.1" + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-security-public_ca-v1/lib/google/cloud/security/publicca/v1/resources_pb.rb b/owl-bot-staging/google-cloud-security-public_ca-v1/lib/google/cloud/security/publicca/v1/resources_pb.rb new file mode 100644 index 000000000000..53a5bd6da1c6 --- /dev/null +++ b/owl-bot-staging/google-cloud-security-public_ca-v1/lib/google/cloud/security/publicca/v1/resources_pb.rb @@ -0,0 +1,26 @@ +# frozen_string_literal: true +# Generated by the protocol buffer compiler. DO NOT EDIT! +# source: google/cloud/security/publicca/v1/resources.proto + +require 'google/protobuf' + +require 'google/api/field_behavior_pb' +require 'google/api/resource_pb' + + +descriptor_data = "\n1google/cloud/security/publicca/v1/resources.proto\x12!google.cloud.security.publicca.v1\x1a\x1fgoogle/api/field_behavior.proto\x1a\x19google/api/resource.proto\"\xdd\x01\n\x12\x45xternalAccountKey\x12\x11\n\x04name\x18\x01 \x01(\tB\x03\xe0\x41\x03\x12\x13\n\x06key_id\x18\x02 \x01(\tB\x03\xe0\x41\x03\x12\x18\n\x0b\x62\x36\x34_mac_key\x18\x03 \x01(\x0c\x42\x03\xe0\x41\x03:\x84\x01\xea\x41\x80\x01\n*publicca.googleapis.com/ExternalAccountKey\x12Rprojects/{project}/locations/{location}/externalAccountKeys/{external_account_key}B\xec\x01\n%com.google.cloud.security.publicca.v1B\x0eResourcesProtoP\x01ZAcloud.google.com/go/security/publicca/apiv1/publiccapb;publiccapb\xaa\x02!Google.Cloud.Security.PublicCA.V1\xca\x02!Google\\Cloud\\Security\\PublicCA\\V1\xea\x02%Google::Cloud::Security::PublicCA::V1b\x06proto3" + +pool = ::Google::Protobuf::DescriptorPool.generated_pool +pool.add_serialized_file(descriptor_data) + +module Google + module Cloud + module Security + module PublicCA + module V1 + ExternalAccountKey = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.security.publicca.v1.ExternalAccountKey").msgclass + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-security-public_ca-v1/lib/google/cloud/security/publicca/v1/service_pb.rb b/owl-bot-staging/google-cloud-security-public_ca-v1/lib/google/cloud/security/publicca/v1/service_pb.rb new file mode 100644 index 000000000000..1634096e4011 --- /dev/null +++ b/owl-bot-staging/google-cloud-security-public_ca-v1/lib/google/cloud/security/publicca/v1/service_pb.rb @@ -0,0 +1,29 @@ +# frozen_string_literal: true +# Generated by the protocol buffer compiler. DO NOT EDIT! +# source: google/cloud/security/publicca/v1/service.proto + +require 'google/protobuf' + +require 'google/api/annotations_pb' +require 'google/api/client_pb' +require 'google/api/field_behavior_pb' +require 'google/api/resource_pb' +require 'google/cloud/security/publicca/v1/resources_pb' + + +descriptor_data = "\n/google/cloud/security/publicca/v1/service.proto\x12!google.cloud.security.publicca.v1\x1a\x1cgoogle/api/annotations.proto\x1a\x17google/api/client.proto\x1a\x1fgoogle/api/field_behavior.proto\x1a\x19google/api/resource.proto\x1a\x31google/cloud/security/publicca/v1/resources.proto\"\xbf\x01\n\x1f\x43reateExternalAccountKeyRequest\x12\x42\n\x06parent\x18\x01 \x01(\tB2\xe0\x41\x02\xfa\x41,\x12*publicca.googleapis.com/ExternalAccountKey\x12X\n\x14\x65xternal_account_key\x18\x02 \x01(\x0b\x32\x35.google.cloud.security.publicca.v1.ExternalAccountKeyB\x03\xe0\x41\x02\x32\xfd\x02\n!PublicCertificateAuthorityService\x12\x8a\x02\n\x18\x43reateExternalAccountKey\x12\x42.google.cloud.security.publicca.v1.CreateExternalAccountKeyRequest\x1a\x35.google.cloud.security.publicca.v1.ExternalAccountKey\"s\xda\x41\x1bparent,external_account_key\x82\xd3\xe4\x93\x02O\"7/v1/{parent=projects/*/locations/*}/externalAccountKeys:\x14\x65xternal_account_key\x1aK\xca\x41\x17publicca.googleapis.com\xd2\x41.https://www.googleapis.com/auth/cloud-platformB\xea\x01\n%com.google.cloud.security.publicca.v1B\x0cServiceProtoP\x01ZAcloud.google.com/go/security/publicca/apiv1/publiccapb;publiccapb\xaa\x02!Google.Cloud.Security.PublicCA.V1\xca\x02!Google\\Cloud\\Security\\PublicCA\\V1\xea\x02%Google::Cloud::Security::PublicCA::V1b\x06proto3" + +pool = ::Google::Protobuf::DescriptorPool.generated_pool +pool.add_serialized_file(descriptor_data) + +module Google + module Cloud + module Security + module PublicCA + module V1 + CreateExternalAccountKeyRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.security.publicca.v1.CreateExternalAccountKeyRequest").msgclass + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-security-public_ca-v1/lib/google/cloud/security/publicca/v1/service_services_pb.rb b/owl-bot-staging/google-cloud-security-public_ca-v1/lib/google/cloud/security/publicca/v1/service_services_pb.rb new file mode 100644 index 000000000000..01e8e7cf5fde --- /dev/null +++ b/owl-bot-staging/google-cloud-security-public_ca-v1/lib/google/cloud/security/publicca/v1/service_services_pb.rb @@ -0,0 +1,51 @@ +# Generated by the protocol buffer compiler. DO NOT EDIT! +# Source: google/cloud/security/publicca/v1/service.proto for package 'Google.Cloud.Security.PublicCA.V1' +# Original file comments: +# 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 +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# + +require 'grpc' +require 'google/cloud/security/publicca/v1/service_pb' + +module Google + module Cloud + module Security + module PublicCA + module V1 + module PublicCertificateAuthorityService + # Manages the resources required for ACME [external account + # binding](https://tools.ietf.org/html/rfc8555#section-7.3.4) for + # the public certificate authority service. + class Service + + include ::GRPC::GenericService + + self.marshal_class_method = :encode + self.unmarshal_class_method = :decode + self.service_name = 'google.cloud.security.publicca.v1.PublicCertificateAuthorityService' + + # Creates a new + # [ExternalAccountKey][google.cloud.security.publicca.v1.ExternalAccountKey] + # bound to the project. + rpc :CreateExternalAccountKey, ::Google::Cloud::Security::PublicCA::V1::CreateExternalAccountKeyRequest, ::Google::Cloud::Security::PublicCA::V1::ExternalAccountKey + end + + Stub = Service.rpc_stub_class + end + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-security-public_ca-v1/proto_docs/README.md b/owl-bot-staging/google-cloud-security-public_ca-v1/proto_docs/README.md new file mode 100644 index 000000000000..dd40054c287f --- /dev/null +++ b/owl-bot-staging/google-cloud-security-public_ca-v1/proto_docs/README.md @@ -0,0 +1,4 @@ +# Public Certificate Authority V1 Protocol Buffer Documentation + +These files are for the YARD documentation of the generated protobuf files. +They are not intended to be required or loaded at runtime. diff --git a/owl-bot-staging/google-cloud-security-public_ca-v1/proto_docs/google/api/client.rb b/owl-bot-staging/google-cloud-security-public_ca-v1/proto_docs/google/api/client.rb new file mode 100644 index 000000000000..5089551e9ea4 --- /dev/null +++ b/owl-bot-staging/google-cloud-security-public_ca-v1/proto_docs/google/api/client.rb @@ -0,0 +1,589 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + + +module Google + module Api + # Required information for every language. + # @!attribute [rw] reference_docs_uri + # @deprecated This field is deprecated and may be removed in the next major version update. + # @return [::String] + # Link to automatically generated reference documentation. Example: + # https://cloud.google.com/nodejs/docs/reference/asset/latest + # @!attribute [rw] destinations + # @return [::Array<::Google::Api::ClientLibraryDestination>] + # The destination where API teams want this client library to be published. + # @!attribute [rw] selective_gapic_generation + # @return [::Google::Api::SelectiveGapicGeneration] + # Configuration for which RPCs should be generated in the GAPIC client. + class CommonLanguageSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Details about how and where to publish client libraries. + # @!attribute [rw] version + # @return [::String] + # Version of the API to apply these settings to. This is the full protobuf + # package for the API, ending in the version element. + # Examples: "google.cloud.speech.v1" and "google.spanner.admin.database.v1". + # @!attribute [rw] launch_stage + # @return [::Google::Api::LaunchStage] + # Launch stage of this version of the API. + # @!attribute [rw] rest_numeric_enums + # @return [::Boolean] + # When using transport=rest, the client request will encode enums as + # numbers rather than strings. + # @!attribute [rw] java_settings + # @return [::Google::Api::JavaSettings] + # Settings for legacy Java features, supported in the Service YAML. + # @!attribute [rw] cpp_settings + # @return [::Google::Api::CppSettings] + # Settings for C++ client libraries. + # @!attribute [rw] php_settings + # @return [::Google::Api::PhpSettings] + # Settings for PHP client libraries. + # @!attribute [rw] python_settings + # @return [::Google::Api::PythonSettings] + # Settings for Python client libraries. + # @!attribute [rw] node_settings + # @return [::Google::Api::NodeSettings] + # Settings for Node client libraries. + # @!attribute [rw] dotnet_settings + # @return [::Google::Api::DotnetSettings] + # Settings for .NET client libraries. + # @!attribute [rw] ruby_settings + # @return [::Google::Api::RubySettings] + # Settings for Ruby client libraries. + # @!attribute [rw] go_settings + # @return [::Google::Api::GoSettings] + # Settings for Go client libraries. + class ClientLibrarySettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # This message configures the settings for publishing [Google Cloud Client + # libraries](https://cloud.google.com/apis/docs/cloud-client-libraries) + # generated from the service config. + # @!attribute [rw] method_settings + # @return [::Array<::Google::Api::MethodSettings>] + # A list of API method settings, e.g. the behavior for methods that use the + # long-running operation pattern. + # @!attribute [rw] new_issue_uri + # @return [::String] + # Link to a *public* URI where users can report issues. Example: + # https://issuetracker.google.com/issues/new?component=190865&template=1161103 + # @!attribute [rw] documentation_uri + # @return [::String] + # Link to product home page. Example: + # https://cloud.google.com/asset-inventory/docs/overview + # @!attribute [rw] api_short_name + # @return [::String] + # Used as a tracking tag when collecting data about the APIs developer + # relations artifacts like docs, packages delivered to package managers, + # etc. Example: "speech". + # @!attribute [rw] github_label + # @return [::String] + # GitHub label to apply to issues and pull requests opened for this API. + # @!attribute [rw] codeowner_github_teams + # @return [::Array<::String>] + # GitHub teams to be added to CODEOWNERS in the directory in GitHub + # containing source code for the client libraries for this API. + # @!attribute [rw] doc_tag_prefix + # @return [::String] + # A prefix used in sample code when demarking regions to be included in + # documentation. + # @!attribute [rw] organization + # @return [::Google::Api::ClientLibraryOrganization] + # For whom the client library is being published. + # @!attribute [rw] library_settings + # @return [::Array<::Google::Api::ClientLibrarySettings>] + # Client library settings. If the same version string appears multiple + # times in this list, then the last one wins. Settings from earlier + # settings with the same version string are discarded. + # @!attribute [rw] proto_reference_documentation_uri + # @return [::String] + # Optional link to proto reference documentation. Example: + # https://cloud.google.com/pubsub/lite/docs/reference/rpc + # @!attribute [rw] rest_reference_documentation_uri + # @return [::String] + # Optional link to REST reference documentation. Example: + # https://cloud.google.com/pubsub/lite/docs/reference/rest + class Publishing + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Settings for Java client libraries. + # @!attribute [rw] library_package + # @return [::String] + # The package name to use in Java. Clobbers the java_package option + # set in the protobuf. This should be used **only** by APIs + # who have already set the language_settings.java.package_name" field + # in gapic.yaml. API teams should use the protobuf java_package option + # where possible. + # + # Example of a YAML configuration:: + # + # publishing: + # 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. + # @!attribute [rw] methods + # @return [::Array<::String>] + # An allowlist of the fully qualified names of RPCs that should be included + # on public client surfaces. + # @!attribute [rw] generate_omitted_as_internal + # @return [::Boolean] + # Setting this to true indicates to the client generators that methods + # that would be excluded from the generation should instead be generated + # in a way that indicates these methods should not be consumed by + # end users. How this is expressed is up to individual language + # implementations to decide. Some examples may be: added annotations, + # obfuscated identifiers, or other language idiomatic patterns. + class SelectiveGapicGeneration + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # `BatchingConfigProto` defines the batching configuration for an API method. + # @!attribute [rw] thresholds + # @return [::Google::Api::BatchingSettingsProto] + # The thresholds which trigger a batched request to be sent. + # @!attribute [rw] batch_descriptor + # @return [::Google::Api::BatchingDescriptorProto] + # The request and response fields used in batching. + class BatchingConfigProto + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # `BatchingSettingsProto` specifies a set of batching thresholds, each of + # which acts as a trigger to send a batch of messages as a request. At least + # one threshold must be positive nonzero. + # @!attribute [rw] element_count_threshold + # @return [::Integer] + # The number of elements of a field collected into a batch which, if + # exceeded, causes the batch to be sent. + # @!attribute [rw] request_byte_threshold + # @return [::Integer] + # The aggregated size of the batched field which, if exceeded, causes the + # batch to be sent. This size is computed by aggregating the sizes of the + # request field to be batched, not of the entire request message. + # @!attribute [rw] delay_threshold + # @return [::Google::Protobuf::Duration] + # The duration after which a batch should be sent, starting from the addition + # of the first message to that batch. + # @!attribute [rw] element_count_limit + # @return [::Integer] + # The maximum number of elements collected in a batch that could be accepted + # by server. + # @!attribute [rw] request_byte_limit + # @return [::Integer] + # The maximum size of the request that could be accepted by server. + # @!attribute [rw] flow_control_element_limit + # @return [::Integer] + # The maximum number of elements allowed by flow control. + # @!attribute [rw] flow_control_byte_limit + # @return [::Integer] + # The maximum size of data allowed by flow control. + # @!attribute [rw] flow_control_limit_exceeded_behavior + # @return [::Google::Api::FlowControlLimitExceededBehaviorProto] + # The behavior to take when the flow control limit is exceeded. + class BatchingSettingsProto + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # `BatchingDescriptorProto` specifies the fields of the request message to be + # used for batching, and, optionally, the fields of the response message to be + # used for demultiplexing. + # @!attribute [rw] batched_field + # @return [::String] + # The repeated field in the request message to be aggregated by batching. + # @!attribute [rw] discriminator_fields + # @return [::Array<::String>] + # A list of the fields in the request message. Two requests will be batched + # together only if the values of every field specified in + # `request_discriminator_fields` is equal between the two requests. + # @!attribute [rw] subresponse_field + # @return [::String] + # Optional. When present, indicates the field in the response message to be + # used to demultiplex the response into multiple response messages, in + # correspondence with the multiple request messages originally batched + # together. + class BatchingDescriptorProto + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # The organization for which the client libraries are being published. + # Affects the url where generated docs are published, etc. + module ClientLibraryOrganization + # Not useful. + CLIENT_LIBRARY_ORGANIZATION_UNSPECIFIED = 0 + + # Google Cloud Platform Org. + CLOUD = 1 + + # Ads (Advertising) Org. + ADS = 2 + + # Photos Org. + PHOTOS = 3 + + # Street View Org. + STREET_VIEW = 4 + + # Shopping Org. + SHOPPING = 5 + + # Geo Org. + GEO = 6 + + # Generative AI - https://developers.generativeai.google + GENERATIVE_AI = 7 + end + + # To where should client libraries be published? + module ClientLibraryDestination + # Client libraries will neither be generated nor published to package + # managers. + CLIENT_LIBRARY_DESTINATION_UNSPECIFIED = 0 + + # Generate the client library in a repo under github.com/googleapis, + # but don't publish it to package managers. + GITHUB = 10 + + # Publish the library to package managers like nuget.org and npmjs.com. + PACKAGE_MANAGER = 20 + end + + # The behavior to take when the flow control limit is exceeded. + module FlowControlLimitExceededBehaviorProto + # Default behavior, system-defined. + UNSET_BEHAVIOR = 0 + + # Stop operation, raise error. + THROW_EXCEPTION = 1 + + # Pause operation until limit clears. + BLOCK = 2 + + # Continue operation, disregard limit. + IGNORE = 3 + end + end +end diff --git a/owl-bot-staging/google-cloud-security-public_ca-v1/proto_docs/google/api/field_behavior.rb b/owl-bot-staging/google-cloud-security-public_ca-v1/proto_docs/google/api/field_behavior.rb new file mode 100644 index 000000000000..582be187d115 --- /dev/null +++ b/owl-bot-staging/google-cloud-security-public_ca-v1/proto_docs/google/api/field_behavior.rb @@ -0,0 +1,85 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + + +module Google + module Api + # An indicator of the behavior of a given field (for example, that a field + # is required in requests, or given as output but ignored as input). + # This **does not** change the behavior in protocol buffers itself; it only + # denotes the behavior and may affect how API tooling handles the field. + # + # Note: This enum **may** receive new values in the future. + module FieldBehavior + # Conventional default for enums. Do not use this. + FIELD_BEHAVIOR_UNSPECIFIED = 0 + + # Specifically denotes a field as optional. + # While all fields in protocol buffers are optional, this may be specified + # for emphasis if appropriate. + OPTIONAL = 1 + + # Denotes a field as required. + # This indicates that the field **must** be provided as part of the request, + # and failure to do so will cause an error (usually `INVALID_ARGUMENT`). + REQUIRED = 2 + + # Denotes a field as output only. + # This indicates that the field is provided in responses, but including the + # field in a request does nothing (the server *must* ignore it and + # *must not* throw an error as a result of the field's presence). + OUTPUT_ONLY = 3 + + # Denotes a field as input only. + # This indicates that the field is provided in requests, and the + # corresponding field is not included in output. + INPUT_ONLY = 4 + + # Denotes a field as immutable. + # This indicates that the field may be set once in a request to create a + # resource, but may not be changed thereafter. + IMMUTABLE = 5 + + # Denotes that a (repeated) field is an unordered list. + # This indicates that the service may provide the elements of the list + # in any arbitrary order, rather than the order the user originally + # provided. Additionally, the list's order may or may not be stable. + UNORDERED_LIST = 6 + + # Denotes that this field returns a non-empty default value if not set. + # This indicates that if the user provides the empty value in a request, + # a non-empty value will be returned. The user will not be aware of what + # non-empty value to expect. + NON_EMPTY_DEFAULT = 7 + + # Denotes that the field in a resource (a message annotated with + # google.api.resource) is used in the resource name to uniquely identify the + # resource. For AIP-compliant APIs, this should only be applied to the + # `name` field on the resource. + # + # This behavior should not be applied to references to other resources within + # the message. + # + # The identifier field of resources often have different field behavior + # depending on the request it is embedded in (e.g. for Create methods name + # is optional and unused, while for Update methods it is required). Instead + # of method-specific annotations, only `IDENTIFIER` is required. + IDENTIFIER = 8 + end + end +end diff --git a/owl-bot-staging/google-cloud-security-public_ca-v1/proto_docs/google/api/launch_stage.rb b/owl-bot-staging/google-cloud-security-public_ca-v1/proto_docs/google/api/launch_stage.rb new file mode 100644 index 000000000000..9392a413fb1b --- /dev/null +++ b/owl-bot-staging/google-cloud-security-public_ca-v1/proto_docs/google/api/launch_stage.rb @@ -0,0 +1,71 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + + +module Google + module Api + # The launch stage as defined by [Google Cloud Platform + # Launch Stages](https://cloud.google.com/terms/launch-stages). + module LaunchStage + # Do not use this default value. + LAUNCH_STAGE_UNSPECIFIED = 0 + + # The feature is not yet implemented. Users can not use it. + UNIMPLEMENTED = 6 + + # Prelaunch features are hidden from users and are only visible internally. + PRELAUNCH = 7 + + # Early Access features are limited to a closed group of testers. To use + # these features, you must sign up in advance and sign a Trusted Tester + # agreement (which includes confidentiality provisions). These features may + # be unstable, changed in backward-incompatible ways, and are not + # guaranteed to be released. + EARLY_ACCESS = 1 + + # Alpha is a limited availability test for releases before they are cleared + # for widespread use. By Alpha, all significant design issues are resolved + # and we are in the process of verifying functionality. Alpha customers + # need to apply for access, agree to applicable terms, and have their + # projects allowlisted. Alpha releases don't have to be feature complete, + # no SLAs are provided, and there are no technical support obligations, but + # they will be far enough along that customers can actually use them in + # test environments or for limited-use tests -- just like they would in + # normal production cases. + ALPHA = 2 + + # Beta is the point at which we are ready to open a release for any + # customer to use. There are no SLA or technical support obligations in a + # Beta release. Products will be complete from a feature perspective, but + # may have some open outstanding issues. Beta releases are suitable for + # limited production use cases. + BETA = 3 + + # GA features are open to all developers and are considered stable and + # fully qualified for production use. + GA = 4 + + # Deprecated features are scheduled to be shut down and removed. For more + # information, see the "Deprecation Policy" section of our [Terms of + # Service](https://cloud.google.com/terms/) + # and the [Google Cloud Platform Subject to the Deprecation + # Policy](https://cloud.google.com/terms/deprecation) documentation. + DEPRECATED = 5 + end + end +end diff --git a/owl-bot-staging/google-cloud-security-public_ca-v1/proto_docs/google/api/resource.rb b/owl-bot-staging/google-cloud-security-public_ca-v1/proto_docs/google/api/resource.rb new file mode 100644 index 000000000000..25dec4847ac1 --- /dev/null +++ b/owl-bot-staging/google-cloud-security-public_ca-v1/proto_docs/google/api/resource.rb @@ -0,0 +1,227 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + + +module Google + module Api + # A simple descriptor of a resource type. + # + # ResourceDescriptor annotates a resource message (either by means of a + # protobuf annotation or use in the service config), and associates the + # resource's schema, the resource type, and the pattern of the resource name. + # + # Example: + # + # message Topic { + # // Indicates this message defines a resource schema. + # // Declares the resource type in the format of {service}/{kind}. + # // For Kubernetes resources, the format is {api group}/{kind}. + # option (google.api.resource) = { + # type: "pubsub.googleapis.com/Topic" + # pattern: "projects/{project}/topics/{topic}" + # }; + # } + # + # The ResourceDescriptor Yaml config will look like: + # + # resources: + # - type: "pubsub.googleapis.com/Topic" + # pattern: "projects/{project}/topics/{topic}" + # + # Sometimes, resources have multiple patterns, typically because they can + # live under multiple parents. + # + # Example: + # + # message LogEntry { + # option (google.api.resource) = { + # type: "logging.googleapis.com/LogEntry" + # pattern: "projects/{project}/logs/{log}" + # pattern: "folders/{folder}/logs/{log}" + # pattern: "organizations/{organization}/logs/{log}" + # pattern: "billingAccounts/{billing_account}/logs/{log}" + # }; + # } + # + # The ResourceDescriptor Yaml config will look like: + # + # resources: + # - type: 'logging.googleapis.com/LogEntry' + # pattern: "projects/{project}/logs/{log}" + # pattern: "folders/{folder}/logs/{log}" + # pattern: "organizations/{organization}/logs/{log}" + # pattern: "billingAccounts/{billing_account}/logs/{log}" + # @!attribute [rw] type + # @return [::String] + # The resource type. It must be in the format of + # \\{service_name}/\\{resource_type_kind}. The `resource_type_kind` must be + # singular and must not include version numbers. + # + # Example: `storage.googleapis.com/Bucket` + # + # The value of the resource_type_kind must follow the regular expression + # /[A-Za-z][a-zA-Z0-9]+/. It should start with an upper case character and + # should use PascalCase (UpperCamelCase). The maximum number of + # characters allowed for the `resource_type_kind` is 100. + # @!attribute [rw] pattern + # @return [::Array<::String>] + # Optional. The relative resource name pattern associated with this resource + # type. The DNS prefix of the full resource name shouldn't be specified here. + # + # The path pattern must follow the syntax, which aligns with HTTP binding + # syntax: + # + # Template = Segment { "/" Segment } ; + # Segment = LITERAL | Variable ; + # Variable = "{" LITERAL "}" ; + # + # Examples: + # + # - "projects/\\{project}/topics/\\{topic}" + # - "projects/\\{project}/knowledgeBases/\\{knowledge_base}" + # + # The components in braces correspond to the IDs for each resource in the + # hierarchy. It is expected that, if multiple patterns are provided, + # the same component name (e.g. "project") refers to IDs of the same + # type of resource. + # @!attribute [rw] name_field + # @return [::String] + # Optional. The field on the resource that designates the resource name + # field. If omitted, this is assumed to be "name". + # @!attribute [rw] history + # @return [::Google::Api::ResourceDescriptor::History] + # Optional. The historical or future-looking state of the resource pattern. + # + # Example: + # + # // The InspectTemplate message originally only supported resource + # // names with organization, and project was added later. + # message InspectTemplate { + # option (google.api.resource) = { + # type: "dlp.googleapis.com/InspectTemplate" + # pattern: + # "organizations/{organization}/inspectTemplates/{inspect_template}" + # pattern: "projects/{project}/inspectTemplates/{inspect_template}" + # history: ORIGINALLY_SINGLE_PATTERN + # }; + # } + # @!attribute [rw] plural + # @return [::String] + # The plural name used in the resource name and permission names, such as + # 'projects' for the resource name of 'projects/\\{project}' and the permission + # name of 'cloudresourcemanager.googleapis.com/projects.get'. One exception + # to this is for Nested Collections that have stuttering names, as defined + # in [AIP-122](https://google.aip.dev/122#nested-collections), where the + # collection ID in the resource name pattern does not necessarily directly + # match the `plural` value. + # + # It is the same concept of the `plural` field in k8s CRD spec + # https://kubernetes.io/docs/tasks/access-kubernetes-api/custom-resources/custom-resource-definitions/ + # + # Note: The plural form is required even for singleton resources. See + # https://aip.dev/156 + # @!attribute [rw] singular + # @return [::String] + # The same concept of the `singular` field in k8s CRD spec + # https://kubernetes.io/docs/tasks/access-kubernetes-api/custom-resources/custom-resource-definitions/ + # Such as "project" for the `resourcemanager.googleapis.com/Project` type. + # @!attribute [rw] style + # @return [::Array<::Google::Api::ResourceDescriptor::Style>] + # Style flag(s) for this resource. + # These indicate that a resource is expected to conform to a given + # style. See the specific style flags for additional information. + class ResourceDescriptor + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # A description of the historical or future-looking state of the + # resource pattern. + module History + # The "unset" value. + HISTORY_UNSPECIFIED = 0 + + # The resource originally had one pattern and launched as such, and + # additional patterns were added later. + ORIGINALLY_SINGLE_PATTERN = 1 + + # The resource has one pattern, but the API owner expects to add more + # later. (This is the inverse of ORIGINALLY_SINGLE_PATTERN, and prevents + # that from being necessary once there are multiple patterns.) + FUTURE_MULTI_PATTERN = 2 + end + + # A flag representing a specific style that a resource claims to conform to. + module Style + # The unspecified value. Do not use. + STYLE_UNSPECIFIED = 0 + + # This resource is intended to be "declarative-friendly". + # + # Declarative-friendly resources must be more strictly consistent, and + # setting this to true communicates to tools that this resource should + # adhere to declarative-friendly expectations. + # + # Note: This is used by the API linter (linter.aip.dev) to enable + # additional checks. + DECLARATIVE_FRIENDLY = 1 + end + end + + # Defines a proto annotation that describes a string field that refers to + # an API resource. + # @!attribute [rw] type + # @return [::String] + # The resource type that the annotated field references. + # + # Example: + # + # message Subscription { + # string topic = 2 [(google.api.resource_reference) = { + # type: "pubsub.googleapis.com/Topic" + # }]; + # } + # + # Occasionally, a field may reference an arbitrary resource. In this case, + # APIs use the special value * in their resource reference. + # + # Example: + # + # message GetIamPolicyRequest { + # string resource = 2 [(google.api.resource_reference) = { + # type: "*" + # }]; + # } + # @!attribute [rw] child_type + # @return [::String] + # The resource type of a child collection that the annotated field + # references. This is useful for annotating the `parent` field that + # doesn't have a fixed resource type. + # + # Example: + # + # message ListLogEntriesRequest { + # string parent = 1 [(google.api.resource_reference) = { + # child_type: "logging.googleapis.com/LogEntry" + # }; + # } + class ResourceReference + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end +end diff --git a/owl-bot-staging/google-cloud-security-public_ca-v1/proto_docs/google/cloud/security/publicca/v1/resources.rb b/owl-bot-staging/google-cloud-security-public_ca-v1/proto_docs/google/cloud/security/publicca/v1/resources.rb new file mode 100644 index 000000000000..e74175a67df7 --- /dev/null +++ b/owl-bot-staging/google-cloud-security-public_ca-v1/proto_docs/google/cloud/security/publicca/v1/resources.rb @@ -0,0 +1,49 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + + +module Google + module Cloud + module Security + module PublicCA + module V1 + # A representation of an ExternalAccountKey used for [external account + # binding](https://tools.ietf.org/html/rfc8555#section-7.3.4) within ACME. + # @!attribute [r] name + # @return [::String] + # Output only. Resource name. + # projects/\\{project}/locations/\\{location}/externalAccountKeys/\\{key_id} + # @!attribute [r] key_id + # @return [::String] + # Output only. Key ID. + # It is generated by the PublicCertificateAuthorityService + # when the ExternalAccountKey is created + # @!attribute [r] b64_mac_key + # @return [::String] + # Output only. Base64-URL-encoded HS256 key. + # It is generated by the PublicCertificateAuthorityService + # when the ExternalAccountKey is created + class ExternalAccountKey + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-security-public_ca-v1/proto_docs/google/cloud/security/publicca/v1/service.rb b/owl-bot-staging/google-cloud-security-public_ca-v1/proto_docs/google/cloud/security/publicca/v1/service.rb new file mode 100644 index 000000000000..75c611fc4533 --- /dev/null +++ b/owl-bot-staging/google-cloud-security-public_ca-v1/proto_docs/google/cloud/security/publicca/v1/service.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! + + +module Google + module Cloud + module Security + module PublicCA + module V1 + # Creates a new + # {::Google::Cloud::Security::PublicCA::V1::ExternalAccountKey ExternalAccountKey} in + # a given project. + # @!attribute [rw] parent + # @return [::String] + # Required. The parent resource where this external_account_key will be + # created. Format: projects/[project_id]/locations/[location]. At present + # only the "global" location is supported. + # @!attribute [rw] external_account_key + # @return [::Google::Cloud::Security::PublicCA::V1::ExternalAccountKey] + # Required. The external account key to create. This field only exists to + # future-proof the API. At present, all fields in ExternalAccountKey are + # output only and all values are ignored. For the purpose of the + # CreateExternalAccountKeyRequest, set it to a default/empty value. + class CreateExternalAccountKeyRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-security-public_ca-v1/proto_docs/google/protobuf/duration.rb b/owl-bot-staging/google-cloud-security-public_ca-v1/proto_docs/google/protobuf/duration.rb new file mode 100644 index 000000000000..ea59f1f91daf --- /dev/null +++ b/owl-bot-staging/google-cloud-security-public_ca-v1/proto_docs/google/protobuf/duration.rb @@ -0,0 +1,98 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + + +module Google + module Protobuf + # A Duration represents a signed, fixed-length span of time represented + # as a count of seconds and fractions of seconds at nanosecond + # resolution. It is independent of any calendar and concepts like "day" + # or "month". It is related to Timestamp in that the difference between + # two Timestamp values is a Duration and it can be added or subtracted + # from a Timestamp. Range is approximately +-10,000 years. + # + # # Examples + # + # Example 1: Compute Duration from two Timestamps in pseudo code. + # + # Timestamp start = ...; + # Timestamp end = ...; + # Duration duration = ...; + # + # duration.seconds = end.seconds - start.seconds; + # duration.nanos = end.nanos - start.nanos; + # + # if (duration.seconds < 0 && duration.nanos > 0) { + # duration.seconds += 1; + # duration.nanos -= 1000000000; + # } else if (duration.seconds > 0 && duration.nanos < 0) { + # duration.seconds -= 1; + # duration.nanos += 1000000000; + # } + # + # Example 2: Compute Timestamp from Timestamp + Duration in pseudo code. + # + # Timestamp start = ...; + # Duration duration = ...; + # Timestamp end = ...; + # + # end.seconds = start.seconds + duration.seconds; + # end.nanos = start.nanos + duration.nanos; + # + # if (end.nanos < 0) { + # end.seconds -= 1; + # end.nanos += 1000000000; + # } else if (end.nanos >= 1000000000) { + # end.seconds += 1; + # end.nanos -= 1000000000; + # } + # + # Example 3: Compute Duration from datetime.timedelta in Python. + # + # td = datetime.timedelta(days=3, minutes=10) + # duration = Duration() + # duration.FromTimedelta(td) + # + # # JSON Mapping + # + # In JSON format, the Duration type is encoded as a string rather than an + # object, where the string ends in the suffix "s" (indicating seconds) and + # is preceded by the number of seconds, with nanoseconds expressed as + # fractional seconds. For example, 3 seconds with 0 nanoseconds should be + # encoded in JSON format as "3s", while 3 seconds and 1 nanosecond should + # be expressed in JSON format as "3.000000001s", and 3 seconds and 1 + # microsecond should be expressed in JSON format as "3.000001s". + # @!attribute [rw] seconds + # @return [::Integer] + # Signed seconds of the span of time. Must be from -315,576,000,000 + # to +315,576,000,000 inclusive. Note: these bounds are computed from: + # 60 sec/min * 60 min/hr * 24 hr/day * 365.25 days/year * 10000 years + # @!attribute [rw] nanos + # @return [::Integer] + # Signed fractions of a second at nanosecond resolution of the span + # of time. Durations less than one second are represented with a 0 + # `seconds` field and a positive or negative `nanos` field. For durations + # of one second or more, a non-zero value for the `nanos` field must be + # of the same sign as the `seconds` field. Must be from -999,999,999 + # to +999,999,999 inclusive. + class Duration + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end +end diff --git a/owl-bot-staging/google-cloud-security-public_ca-v1/snippets/Gemfile b/owl-bot-staging/google-cloud-security-public_ca-v1/snippets/Gemfile new file mode 100644 index 000000000000..11c3ad8913f6 --- /dev/null +++ b/owl-bot-staging/google-cloud-security-public_ca-v1/snippets/Gemfile @@ -0,0 +1,32 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +source "https://rubygems.org" + +if ENV["GOOGLE_CLOUD_SAMPLES_TEST"] == "master" + gem "google-cloud-security-public_ca-v1", path: "../" +else + gem "google-cloud-security-public_ca-v1" +end + +group :test do + gem "google-style", "~> 1.26.1" + gem "minitest", "~> 5.16" + gem "minitest-focus", "~> 1.1" + gem "minitest-hooks", "~> 1.5" +end diff --git a/owl-bot-staging/google-cloud-security-public_ca-v1/snippets/public_certificate_authority_service/create_external_account_key.rb b/owl-bot-staging/google-cloud-security-public_ca-v1/snippets/public_certificate_authority_service/create_external_account_key.rb new file mode 100644 index 000000000000..9cd2edf8d818 --- /dev/null +++ b/owl-bot-staging/google-cloud-security-public_ca-v1/snippets/public_certificate_authority_service/create_external_account_key.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 publicca_v1_generated_PublicCertificateAuthorityService_CreateExternalAccountKey_sync] +require "google/cloud/security/public_ca/v1" + +## +# Snippet for the create_external_account_key call in the PublicCertificateAuthorityService service +# +# This snippet has been automatically generated and should be regarded as a code +# template only. It will require modifications to work: +# - It may require correct/in-range values for request initialization. +# - It may require specifying regional endpoints when creating the service +# client as shown in https://cloud.google.com/ruby/docs/reference. +# +# This is an auto-generated example demonstrating basic usage of +# Google::Cloud::Security::PublicCA::V1::PublicCertificateAuthorityService::Client#create_external_account_key. +# +def create_external_account_key + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Security::PublicCA::V1::PublicCertificateAuthorityService::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Security::PublicCA::V1::CreateExternalAccountKeyRequest.new + + # Call the create_external_account_key method. + result = client.create_external_account_key request + + # The returned object is of type Google::Cloud::Security::PublicCA::V1::ExternalAccountKey. + p result +end +# [END publicca_v1_generated_PublicCertificateAuthorityService_CreateExternalAccountKey_sync] diff --git a/owl-bot-staging/google-cloud-security-public_ca-v1/snippets/snippet_metadata_google.cloud.security.publicca.v1.json b/owl-bot-staging/google-cloud-security-public_ca-v1/snippets/snippet_metadata_google.cloud.security.publicca.v1.json new file mode 100644 index 000000000000..07eaff75255d --- /dev/null +++ b/owl-bot-staging/google-cloud-security-public_ca-v1/snippets/snippet_metadata_google.cloud.security.publicca.v1.json @@ -0,0 +1,55 @@ +{ + "client_library": { + "name": "google-cloud-security-public_ca-v1", + "version": "", + "language": "RUBY", + "apis": [ + { + "id": "google.cloud.security.publicca.v1", + "version": "v1" + } + ] + }, + "snippets": [ + { + "region_tag": "publicca_v1_generated_PublicCertificateAuthorityService_CreateExternalAccountKey_sync", + "title": "Snippet for the create_external_account_key call in the PublicCertificateAuthorityService service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Security::PublicCA::V1::PublicCertificateAuthorityService::Client#create_external_account_key.", + "file": "public_certificate_authority_service/create_external_account_key.rb", + "language": "RUBY", + "client_method": { + "short_name": "create_external_account_key", + "full_name": "::Google::Cloud::Security::PublicCA::V1::PublicCertificateAuthorityService::Client#create_external_account_key", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::Security::PublicCA::V1::CreateExternalAccountKeyRequest", + "name": "request" + } + ], + "result_type": "::Google::Cloud::Security::PublicCA::V1::ExternalAccountKey", + "client": { + "short_name": "PublicCertificateAuthorityService::Client", + "full_name": "::Google::Cloud::Security::PublicCA::V1::PublicCertificateAuthorityService::Client" + }, + "method": { + "short_name": "CreateExternalAccountKey", + "full_name": "google.cloud.security.publicca.v1.PublicCertificateAuthorityService.CreateExternalAccountKey", + "service": { + "short_name": "PublicCertificateAuthorityService", + "full_name": "google.cloud.security.publicca.v1.PublicCertificateAuthorityService" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 46, + "type": "FULL" + } + ] + } + ] +} \ No newline at end of file diff --git a/owl-bot-staging/google-cloud-security-public_ca-v1/test/google/cloud/security/public_ca/v1/public_certificate_authority_service_paths_test.rb b/owl-bot-staging/google-cloud-security-public_ca-v1/test/google/cloud/security/public_ca/v1/public_certificate_authority_service_paths_test.rb new file mode 100644 index 000000000000..34194282dddf --- /dev/null +++ b/owl-bot-staging/google-cloud-security-public_ca-v1/test/google/cloud/security/public_ca/v1/public_certificate_authority_service_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/cloud/security/public_ca/v1/public_certificate_authority_service" + +class ::Google::Cloud::Security::PublicCA::V1::PublicCertificateAuthorityService::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_external_account_key_path + grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + ::Gapic::ServiceStub.stub :new, DummyStub.new do + client = ::Google::Cloud::Security::PublicCA::V1::PublicCertificateAuthorityService::Client.new do |config| + config.credentials = grpc_channel + end + + path = client.external_account_key_path project: "value0", location: "value1", external_account_key: "value2" + assert_equal "projects/value0/locations/value1/externalAccountKeys/value2", path + end + end + + def test_location_path + grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + ::Gapic::ServiceStub.stub :new, DummyStub.new do + client = ::Google::Cloud::Security::PublicCA::V1::PublicCertificateAuthorityService::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 +end diff --git a/owl-bot-staging/google-cloud-security-public_ca-v1/test/google/cloud/security/public_ca/v1/public_certificate_authority_service_rest_test.rb b/owl-bot-staging/google-cloud-security-public_ca-v1/test/google/cloud/security/public_ca/v1/public_certificate_authority_service_rest_test.rb new file mode 100644 index 000000000000..2dc6d34d76b5 --- /dev/null +++ b/owl-bot-staging/google-cloud-security-public_ca-v1/test/google/cloud/security/public_ca/v1/public_certificate_authority_service_rest_test.rb @@ -0,0 +1,154 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +require "helper" +require "gapic/rest" +require "google/cloud/security/publicca/v1/service_pb" +require "google/cloud/security/public_ca/v1/public_certificate_authority_service/rest" + + +class ::Google::Cloud::Security::PublicCA::V1::PublicCertificateAuthorityService::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_external_account_key + # Create test objects. + client_result = ::Google::Cloud::Security::PublicCA::V1::ExternalAccountKey.new + http_response = OpenStruct.new body: client_result.to_json + + call_options = {} + + # Create request parameters for a unary method. + parent = "hello world" + external_account_key = {} + + create_external_account_key_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| + assert options.metadata.key? :"x-goog-api-client" + assert options.metadata[:"x-goog-api-client"].include? "rest" + refute options.metadata[:"x-goog-api-client"].include? "grpc" + end + + ::Google::Cloud::Security::PublicCA::V1::PublicCertificateAuthorityService::Rest::ServiceStub.stub :transcode_create_external_account_key_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, create_external_account_key_client_stub do + # Create client + client = ::Google::Cloud::Security::PublicCA::V1::PublicCertificateAuthorityService::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.create_external_account_key({ parent: parent, external_account_key: external_account_key }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.create_external_account_key parent: parent, external_account_key: external_account_key do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.create_external_account_key ::Google::Cloud::Security::PublicCA::V1::CreateExternalAccountKeyRequest.new(parent: parent, external_account_key: external_account_key) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + client.create_external_account_key({ parent: parent, external_account_key: external_account_key }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + client.create_external_account_key(::Google::Cloud::Security::PublicCA::V1::CreateExternalAccountKeyRequest.new(parent: parent, external_account_key: external_account_key), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, create_external_account_key_client_stub.call_count + end + end + end + + def test_configure + credentials_token = :dummy_value + + client = block_config = config = nil + dummy_stub = ClientStub.new nil + Gapic::Rest::ClientStub.stub :new, dummy_stub do + client = ::Google::Cloud::Security::PublicCA::V1::PublicCertificateAuthorityService::Rest::Client.new do |config| + config.credentials = credentials_token + end + end + + config = client.configure do |c| + block_config = c + end + + assert_same block_config, config + assert_kind_of ::Google::Cloud::Security::PublicCA::V1::PublicCertificateAuthorityService::Rest::Client::Configuration, config + end +end diff --git a/owl-bot-staging/google-cloud-security-public_ca-v1/test/google/cloud/security/public_ca/v1/public_certificate_authority_service_test.rb b/owl-bot-staging/google-cloud-security-public_ca-v1/test/google/cloud/security/public_ca/v1/public_certificate_authority_service_test.rb new file mode 100644 index 000000000000..7f05c7c96849 --- /dev/null +++ b/owl-bot-staging/google-cloud-security-public_ca-v1/test/google/cloud/security/public_ca/v1/public_certificate_authority_service_test.rb @@ -0,0 +1,164 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +require "helper" + +require "gapic/grpc/service_stub" + +require "google/cloud/security/publicca/v1/service_pb" +require "google/cloud/security/public_ca/v1/public_certificate_authority_service" + +class ::Google::Cloud::Security::PublicCA::V1::PublicCertificateAuthorityService::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_external_account_key + # Create GRPC objects. + grpc_response = ::Google::Cloud::Security::PublicCA::V1::ExternalAccountKey.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" + external_account_key = {} + + create_external_account_key_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :create_external_account_key, name + assert_kind_of ::Google::Cloud::Security::PublicCA::V1::CreateExternalAccountKeyRequest, request + assert_equal "hello world", request["parent"] + assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::Security::PublicCA::V1::ExternalAccountKey), request["external_account_key"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, create_external_account_key_client_stub do + # Create client + client = ::Google::Cloud::Security::PublicCA::V1::PublicCertificateAuthorityService::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.create_external_account_key({ parent: parent, external_account_key: external_account_key }) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use named arguments + client.create_external_account_key parent: parent, external_account_key: external_account_key do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.create_external_account_key ::Google::Cloud::Security::PublicCA::V1::CreateExternalAccountKeyRequest.new(parent: parent, external_account_key: external_account_key) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use hash object with options + client.create_external_account_key({ parent: parent, external_account_key: external_account_key }, grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object with options + client.create_external_account_key(::Google::Cloud::Security::PublicCA::V1::CreateExternalAccountKeyRequest.new(parent: parent, external_account_key: external_account_key), grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Verify method calls + assert_equal 5, create_external_account_key_client_stub.call_rpc_count + end + end + + def test_configure + grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + + client = block_config = config = nil + dummy_stub = ClientStub.new nil, nil + Gapic::ServiceStub.stub :new, dummy_stub do + client = ::Google::Cloud::Security::PublicCA::V1::PublicCertificateAuthorityService::Client.new do |config| + config.credentials = grpc_channel + end + end + + config = client.configure do |c| + block_config = c + end + + assert_same block_config, config + assert_kind_of ::Google::Cloud::Security::PublicCA::V1::PublicCertificateAuthorityService::Client::Configuration, config + end + + def test_credentials + key = OpenSSL::PKey::RSA.new 2048 + cred_json = { + "private_key" => key.to_pem, + "client_email" => "app@developer.gserviceaccount.com", + "type" => "service_account" + } + key_file = StringIO.new cred_json.to_json + creds = Google::Auth::ServiceAccountCredentials.make_creds({ json_key_io: key_file }) + + dummy_stub = ClientStub.new nil, nil + Gapic::ServiceStub.stub :new, dummy_stub do + client = ::Google::Cloud::Security::PublicCA::V1::PublicCertificateAuthorityService::Client.new do |config| + config.credentials = creds + end + assert_kind_of ::Google::Cloud::Security::PublicCA::V1::PublicCertificateAuthorityService::Client, client + assert_equal creds, client.configure.credentials + end + end +end diff --git a/owl-bot-staging/google-cloud-security-public_ca-v1/test/helper.rb b/owl-bot-staging/google-cloud-security-public_ca-v1/test/helper.rb new file mode 100644 index 000000000000..672b337030e7 --- /dev/null +++ b/owl-bot-staging/google-cloud-security-public_ca-v1/test/helper.rb @@ -0,0 +1,26 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +require "minitest/autorun" +require "minitest/focus" +require "minitest/mock" +require "minitest/rg" + +require "grpc" + +require "ostruct" diff --git a/owl-bot-staging/google-cloud-security-public_ca-v1beta1/.gitignore b/owl-bot-staging/google-cloud-security-public_ca-v1beta1/.gitignore new file mode 100644 index 000000000000..0135b6bc6cfc --- /dev/null +++ b/owl-bot-staging/google-cloud-security-public_ca-v1beta1/.gitignore @@ -0,0 +1,22 @@ +# Ignore bundler lockfiles +Gemfile.lock +gems.locked + +# Ignore documentation output +doc/* +.yardoc/* + +# Ignore test output +coverage/* + +# Ignore build artifacts +pkg/* + +# Ignore files commonly present in certain dev environments +.vagrant +.DS_STORE +.idea +*.iml + +# Ignore synth output +__pycache__ diff --git a/owl-bot-staging/google-cloud-security-public_ca-v1beta1/.repo-metadata.json b/owl-bot-staging/google-cloud-security-public_ca-v1beta1/.repo-metadata.json new file mode 100644 index 000000000000..1921daa59753 --- /dev/null +++ b/owl-bot-staging/google-cloud-security-public_ca-v1beta1/.repo-metadata.json @@ -0,0 +1,17 @@ +{ + "api_id": "publicca.googleapis.com", + "api_shortname": "publicca", + "client_documentation": "https://cloud.google.com/ruby/docs/reference/google-cloud-security-public_ca-v1beta1/latest", + "distribution_name": "google-cloud-security-public_ca-v1beta1", + "is_cloud": true, + "language": "ruby", + "name": "publicca", + "name_pretty": "Public Certificate Authority V1beta1 API", + "product_documentation": "https://cloud.google.com/certificate-manager/docs/public-ca/", + "release_level": "unreleased", + "repo": "googleapis/google-cloud-ruby", + "requires_billing": true, + "ruby-cloud-description": "Certificate Manager's Public Certificate Authority (CA) functionality allows you to provision and deploy widely trusted X.509 certificates after validating that the certificate requester controls the domains. Certificate Manager lets you directly and programmatically request publicly trusted TLS certificates that are already in the root of trust stores used by major browsers, operating systems, and applications. You can use these TLS certificates to authenticate and encrypt internet traffic. Note that google-cloud-security-public_ca-v1beta1 is a version-specific client library. For most uses, we recommend installing the main client library google-cloud-security-public_ca instead. See the readme for more details.", + "ruby-cloud-product-url": "https://cloud.google.com/certificate-manager/docs/public-ca/", + "library_type": "GAPIC_AUTO" +} diff --git a/owl-bot-staging/google-cloud-security-public_ca-v1beta1/.rubocop.yml b/owl-bot-staging/google-cloud-security-public_ca-v1beta1/.rubocop.yml new file mode 100644 index 000000000000..a101e8d603d8 --- /dev/null +++ b/owl-bot-staging/google-cloud-security-public_ca-v1beta1/.rubocop.yml @@ -0,0 +1,33 @@ +inherit_gem: + google-style: google-style.yml + +AllCops: + Exclude: + - "google-cloud-security-public_ca-v1beta1.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-security-public_ca-v1beta1.rb" diff --git a/owl-bot-staging/google-cloud-security-public_ca-v1beta1/.toys.rb b/owl-bot-staging/google-cloud-security-public_ca-v1beta1/.toys.rb new file mode 100644 index 000000000000..177e22456e8a --- /dev/null +++ b/owl-bot-staging/google-cloud-security-public_ca-v1beta1/.toys.rb @@ -0,0 +1,28 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +toys_version! ">= 0.15.3" + +if ENV["RUBY_COMMON_TOOLS"] + common_tools_dir = File.expand_path ENV["RUBY_COMMON_TOOLS"] + load File.join(common_tools_dir, "toys", "gapic") +else + load_git remote: "https://github.com/googleapis/ruby-common-tools.git", + path: "toys/gapic", + update: true +end diff --git a/owl-bot-staging/google-cloud-security-public_ca-v1beta1/.yardopts b/owl-bot-staging/google-cloud-security-public_ca-v1beta1/.yardopts new file mode 100644 index 000000000000..1bdee498ff8f --- /dev/null +++ b/owl-bot-staging/google-cloud-security-public_ca-v1beta1/.yardopts @@ -0,0 +1,12 @@ +--no-private +--title="Public Certificate Authority V1beta1 API" +--exclude _pb\.rb$ +--markup markdown +--markup-provider redcarpet + +./lib/**/*.rb +./proto_docs/**/*.rb +- +README.md +LICENSE.md +AUTHENTICATION.md diff --git a/owl-bot-staging/google-cloud-security-public_ca-v1beta1/AUTHENTICATION.md b/owl-bot-staging/google-cloud-security-public_ca-v1beta1/AUTHENTICATION.md new file mode 100644 index 000000000000..351b191af971 --- /dev/null +++ b/owl-bot-staging/google-cloud-security-public_ca-v1beta1/AUTHENTICATION.md @@ -0,0 +1,122 @@ +# Authentication + +The recommended way to authenticate to the google-cloud-security-public_ca-v1beta1 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-security-public_ca-v1beta1 library provides several mechanisms to configure your system. +Generally, using Application Default Credentials to facilitate automatic +credentials discovery is the easist method. But if you need to explicitly specify +credentials, there are several methods available to you. + +Credentials are accepted in the following ways, in the following order or precedence: + +1. Credentials specified in method arguments +2. Credentials specified in configuration +3. Credentials pointed to or included in environment variables +4. Credentials found in local ADC file +5. Credentials returned by the metadata server for the attached service account (GCP) + +### Configuration + +You can configure a path to a JSON credentials file, either for an individual client object or +globally, for all client objects. The JSON file can contain credentials created for +[workload identity federation](https://cloud.google.com/iam/docs/workload-identity-federation), +[workforce identity federation](https://cloud.google.com/iam/docs/workforce-identity-federation), or a +[service account key](https://cloud.google.com/docs/authentication/provide-credentials-adc#local-key). + +Note: Service account keys are a security risk if not managed correctly. You should +[choose a more secure alternative to service account keys](https://cloud.google.com/docs/authentication#auth-decision-tree) +whenever possible. + +To configure a credentials file for an individual client initialization: + +```ruby +require "google/cloud/security/public_ca/v1beta1" + +client = ::Google::Cloud::Security::PublicCA::V1beta1::PublicCertificateAuthorityService::Client.new do |config| + config.credentials = "path/to/credentialfile.json" +end +``` + +To configure a credentials file globally for all clients: + +```ruby +require "google/cloud/security/public_ca/v1beta1" + +::Google::Cloud::Security::PublicCA::V1beta1::PublicCertificateAuthorityService::Client.configure do |config| + config.credentials = "path/to/credentialfile.json" +end + +client = ::Google::Cloud::Security::PublicCA::V1beta1::PublicCertificateAuthorityService::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-security-public_ca-v1beta1 +checks for credentials are: + +* `GOOGLE_CLOUD_CREDENTIALS` - Path to JSON file, or JSON contents +* `GOOGLE_APPLICATION_CREDENTIALS` - Path to JSON file + +```ruby +require "google/cloud/security/public_ca/v1beta1" + +ENV["GOOGLE_APPLICATION_CREDENTIALS"] = "path/to/credentialfile.json" + +client = ::Google::Cloud::Security::PublicCA::V1beta1::PublicCertificateAuthorityService::Client.new +``` + +### Local ADC file + +You can set up a local ADC file with your user credentials for authentication during +development. If credentials are not provided in code or in environment variables, +then the local ADC credentials are discovered. + +Follow the steps in [Quickstart](#quickstart) to set up a local ADC file. + +### Google Cloud Platform environments + +When running on Google Cloud Platform (GCP), including Google Compute Engine +(GCE), Google Kubernetes Engine (GKE), Google App Engine (GAE), Google Cloud +Functions (GCF) and Cloud Run, credentials are retrieved from the attached +service account automatically. Code should be written as if already authenticated. + +For more information, see +[Set up ADC for Google Cloud services](https://cloud.google.com/docs/authentication/provide-credentials-adc#attached-sa). diff --git a/owl-bot-staging/google-cloud-security-public_ca-v1beta1/CHANGELOG.md b/owl-bot-staging/google-cloud-security-public_ca-v1beta1/CHANGELOG.md new file mode 100644 index 000000000000..f88957a62ba2 --- /dev/null +++ b/owl-bot-staging/google-cloud-security-public_ca-v1beta1/CHANGELOG.md @@ -0,0 +1,2 @@ +# Release History + diff --git a/owl-bot-staging/google-cloud-security-public_ca-v1beta1/Gemfile b/owl-bot-staging/google-cloud-security-public_ca-v1beta1/Gemfile new file mode 100644 index 000000000000..1d08558908d8 --- /dev/null +++ b/owl-bot-staging/google-cloud-security-public_ca-v1beta1/Gemfile @@ -0,0 +1,14 @@ +source "https://rubygems.org" + +gemspec + +gem "google-style", "~> 1.32.0" +gem "irb", "~> 1.17" +gem "minitest", "~> 6.0.2" +gem "minitest-focus", "~> 1.4" +gem "minitest-mock", "~> 5.27" +gem "minitest-rg", "~> 5.3" +gem "ostruct", "~> 0.5.5" +gem "rake", ">= 13.0" +gem "redcarpet", "~> 3.6" +gem "yard", "~> 0.9" diff --git a/owl-bot-staging/google-cloud-security-public_ca-v1beta1/LICENSE.md b/owl-bot-staging/google-cloud-security-public_ca-v1beta1/LICENSE.md new file mode 100644 index 000000000000..c261857ba6ad --- /dev/null +++ b/owl-bot-staging/google-cloud-security-public_ca-v1beta1/LICENSE.md @@ -0,0 +1,201 @@ + Apache License + Version 2.0, January 2004 + http://www.apache.org/licenses/ + + TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION + + 1. Definitions. + + "License" shall mean the terms and conditions for use, reproduction, + and distribution as defined by Sections 1 through 9 of this document. + + "Licensor" shall mean the copyright owner or entity authorized by + the copyright owner that is granting the License. + + "Legal Entity" shall mean the union of the acting entity and all + other entities that control, are controlled by, or are under common + control with that entity. For the purposes of this definition, + "control" means (i) the power, direct or indirect, to cause the + direction or management of such entity, whether by contract or + otherwise, or (ii) ownership of fifty percent (50%) or more of the + outstanding shares, or (iii) beneficial ownership of such entity. + + "You" (or "Your") shall mean an individual or Legal Entity + exercising permissions granted by this License. + + "Source" form shall mean the preferred form for making modifications, + including but not limited to software source code, documentation + source, and configuration files. + + "Object" form shall mean any form resulting from mechanical + transformation or translation of a Source form, including but + not limited to compiled object code, generated documentation, + and conversions to other media types. + + "Work" shall mean the work of authorship, whether in Source or + Object form, made available under the License, as indicated by a + copyright notice that is included in or attached to the work + (an example is provided in the Appendix below). + + "Derivative Works" shall mean any work, whether in Source or Object + form, that is based on (or derived from) the Work and for which the + editorial revisions, annotations, elaborations, or other modifications + represent, as a whole, an original work of authorship. For the purposes + of this License, Derivative Works shall not include works that remain + separable from, or merely link (or bind by name) to the interfaces of, + the Work and Derivative Works thereof. + + "Contribution" shall mean any work of authorship, including + the original version of the Work and any modifications or additions + to that Work or Derivative Works thereof, that is intentionally + submitted to Licensor for inclusion in the Work by the copyright owner + or by an individual or Legal Entity authorized to submit on behalf of + the copyright owner. For the purposes of this definition, "submitted" + means any form of electronic, verbal, or written communication sent + to the Licensor or its representatives, including but not limited to + communication on electronic mailing lists, source code control systems, + and issue tracking systems that are managed by, or on behalf of, the + Licensor for the purpose of discussing and improving the Work, but + excluding communication that is conspicuously marked or otherwise + designated in writing by the copyright owner as "Not a Contribution." + + "Contributor" shall mean Licensor and any individual or Legal Entity + on behalf of whom a Contribution has been received by Licensor and + subsequently incorporated within the Work. + + 2. Grant of Copyright License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + copyright license to reproduce, prepare Derivative Works of, + publicly display, publicly perform, sublicense, and distribute the + Work and such Derivative Works in Source or Object form. + + 3. Grant of Patent License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + (except as stated in this section) patent license to make, have made, + use, offer to sell, sell, import, and otherwise transfer the Work, + where such license applies only to those patent claims licensable + by such Contributor that are necessarily infringed by their + Contribution(s) alone or by combination of their Contribution(s) + with the Work to which such Contribution(s) was submitted. If You + institute patent litigation against any entity (including a + cross-claim or counterclaim in a lawsuit) alleging that the Work + or a Contribution incorporated within the Work constitutes direct + or contributory patent infringement, then any patent licenses + granted to You under this License for that Work shall terminate + as of the date such litigation is filed. + + 4. Redistribution. You may reproduce and distribute copies of the + Work or Derivative Works thereof in any medium, with or without + modifications, and in Source or Object form, provided that You + meet the following conditions: + + (a) You must give any other recipients of the Work or + Derivative Works a copy of this License; and + + (b) You must cause any modified files to carry prominent notices + stating that You changed the files; and + + (c) You must retain, in the Source form of any Derivative Works + that You distribute, all copyright, patent, trademark, and + attribution notices from the Source form of the Work, + excluding those notices that do not pertain to any part of + the Derivative Works; and + + (d) If the Work includes a "NOTICE" text file as part of its + distribution, then any Derivative Works that You distribute must + include a readable copy of the attribution notices contained + within such NOTICE file, excluding those notices that do not + pertain to any part of the Derivative Works, in at least one + of the following places: within a NOTICE text file distributed + as part of the Derivative Works; within the Source form or + documentation, if provided along with the Derivative Works; or, + within a display generated by the Derivative Works, if and + wherever such third-party notices normally appear. The contents + of the NOTICE file are for informational purposes only and + do not modify the License. You may add Your own attribution + notices within Derivative Works that You distribute, alongside + or as an addendum to the NOTICE text from the Work, provided + that such additional attribution notices cannot be construed + as modifying the License. + + You may add Your own copyright statement to Your modifications and + may provide additional or different license terms and conditions + for use, reproduction, or distribution of Your modifications, or + for any such Derivative Works as a whole, provided Your use, + reproduction, and distribution of the Work otherwise complies with + the conditions stated in this License. + + 5. Submission of Contributions. Unless You explicitly state otherwise, + any Contribution intentionally submitted for inclusion in the Work + by You to the Licensor shall be under the terms and conditions of + this License, without any additional terms or conditions. + Notwithstanding the above, nothing herein shall supersede or modify + the terms of any separate license agreement you may have executed + with Licensor regarding such Contributions. + + 6. Trademarks. This License does not grant permission to use the trade + names, trademarks, service marks, or product names of the Licensor, + except as required for reasonable and customary use in describing the + origin of the Work and reproducing the content of the NOTICE file. + + 7. Disclaimer of Warranty. Unless required by applicable law or + agreed to in writing, Licensor provides the Work (and each + Contributor provides its Contributions) on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or + implied, including, without limitation, any warranties or conditions + of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A + PARTICULAR PURPOSE. You are solely responsible for determining the + appropriateness of using or redistributing the Work and assume any + risks associated with Your exercise of permissions under this License. + + 8. Limitation of Liability. In no event and under no legal theory, + whether in tort (including negligence), contract, or otherwise, + unless required by applicable law (such as deliberate and grossly + negligent acts) or agreed to in writing, shall any Contributor be + liable to You for damages, including any direct, indirect, special, + incidental, or consequential damages of any character arising as a + result of this License or out of the use or inability to use the + Work (including but not limited to damages for loss of goodwill, + work stoppage, computer failure or malfunction, or any and all + other commercial damages or losses), even if such Contributor + has been advised of the possibility of such damages. + + 9. Accepting Warranty or Additional Liability. While redistributing + the Work or Derivative Works thereof, You may choose to offer, + and charge a fee for, acceptance of support, warranty, indemnity, + or other liability obligations and/or rights consistent with this + License. However, in accepting such obligations, You may act only + on Your own behalf and on Your sole responsibility, not on behalf + of any other Contributor, and only if You agree to indemnify, + defend, and hold each Contributor harmless for any liability + incurred by, or claims asserted against, such Contributor by reason + of your accepting any such warranty or additional liability. + + END OF TERMS AND CONDITIONS + + APPENDIX: How to apply the Apache License to your work. + + To apply the Apache License to your work, attach the following + boilerplate notice, with the fields enclosed by brackets "[]" + replaced with your own identifying information. (Don't include + the brackets!) The text should be enclosed in the appropriate + comment syntax for the file format. We also recommend that a + file or class name and description of purpose be included on the + same "printed page" as the copyright notice for easier + identification within third-party archives. + + Copyright [yyyy] [name of copyright owner] + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. diff --git a/owl-bot-staging/google-cloud-security-public_ca-v1beta1/README.md b/owl-bot-staging/google-cloud-security-public_ca-v1beta1/README.md new file mode 100644 index 000000000000..5242eb0ad60b --- /dev/null +++ b/owl-bot-staging/google-cloud-security-public_ca-v1beta1/README.md @@ -0,0 +1,154 @@ +# Ruby Client for the Public Certificate Authority V1beta1 API + +The Public Certificate Authority API may be used to create and manage ACME external account binding keys associated with Google Trust Services' publicly trusted certificate authority. + +Certificate Manager's Public Certificate Authority (CA) functionality allows you to provision and deploy widely trusted X.509 certificates after validating that the certificate requester controls the domains. Certificate Manager lets you directly and programmatically request publicly trusted TLS certificates that are already in the root of trust stores used by major browsers, operating systems, and applications. You can use these TLS certificates to authenticate and encrypt internet traffic. + +https://github.com/googleapis/google-cloud-ruby + +This gem is a _versioned_ client. It provides basic client classes for a +specific version of the Public Certificate Authority V1beta1 API. Most users should consider using +the main client gem, +[google-cloud-security-public_ca](https://rubygems.org/gems/google-cloud-security-public_ca). +See the section below titled *Which client should I use?* for more information. + +## Installation + +``` +$ gem install google-cloud-security-public_ca-v1beta1 +``` + +## 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/publicca.googleapis.com) +1. [Set up authentication.](AUTHENTICATION.md) + +## Quick Start + +```ruby +require "google/cloud/security/public_ca/v1beta1" + +client = ::Google::Cloud::Security::PublicCA::V1beta1::PublicCertificateAuthorityService::Client.new +request = ::Google::Cloud::Security::PublicCA::V1beta1::CreateExternalAccountKeyRequest.new # (request fields as keyword arguments...) +response = client.create_external_account_key request +``` + +View the [Client Library Documentation](https://cloud.google.com/ruby/docs/reference/google-cloud-security-public_ca-v1beta1/latest) +for class and method documentation. + +See also the [Product Documentation](https://cloud.google.com/certificate-manager/docs/public-ca/) +for general usage information. + +## Debug Logging + +This library comes with opt-in Debug Logging that can help you troubleshoot +your application's integration with the API. When logging is activated, key +events such as requests and responses, along with data payloads and metadata +such as headers and client configuration, are logged to the standard error +stream. + +**WARNING:** Client Library Debug Logging includes your data payloads in +plaintext, which could include sensitive data such as PII for yourself or your +customers, private keys, or other security data that could be compromising if +leaked. Always practice good data hygiene with your application logs, and follow +the principle of least access. Google also recommends that Client Library Debug +Logging be enabled only temporarily during active debugging, and not used +permanently in production. + +To enable logging, set the environment variable `GOOGLE_SDK_RUBY_LOGGING_GEMS` +to the value `all`. Alternatively, you can set the value to a comma-delimited +list of client library gem names. This will select the default logging behavior, +which writes logs to the standard error stream. On a local workstation, this may +result in logs appearing on the console. When running on a Google Cloud hosting +service such as [Google Cloud Run](https://cloud.google.com/run), this generally +results in logs appearing alongside your application logs in the +[Google Cloud Logging](https://cloud.google.com/logging/) service. + +You can customize logging by modifying the `logger` configuration when +constructing a client object. For example: + +```ruby +require "google/cloud/security/public_ca/v1beta1" +require "logger" + +client = ::Google::Cloud::Security::PublicCA::V1beta1::PublicCertificateAuthorityService::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-security-public_ca`, +and lower-level _versioned_ client libraries with names such as +`google-cloud-security-public_ca-v1beta1`. +_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-security-public_ca`. +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-security-public_ca-v1beta1`. + +### What about the google-apis- clients? + +Client library gems with names that begin with `google-apis-` are based on an +older code generation technology. They talk to a REST/JSON backend (whereas +most modern clients talk to a [gRPC](https://grpc.io/) backend) and they may +not offer the same performance, features, and ease of use provided by more +modern clients. + +The `google-apis-` clients have wide coverage across Google services, so you +might need to use one if there is no modern client available for the service. +However, if a modern client is available, we generally recommend it over the +older `google-apis-` clients. diff --git a/owl-bot-staging/google-cloud-security-public_ca-v1beta1/Rakefile b/owl-bot-staging/google-cloud-security-public_ca-v1beta1/Rakefile new file mode 100644 index 000000000000..6e756d84cb22 --- /dev/null +++ b/owl-bot-staging/google-cloud-security-public_ca-v1beta1/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-security-public_ca-v1beta1 acceptance tests." +task :acceptance, :project, :keyfile do |t, args| + project = args[:project] + project ||= + ENV["GOOGLE_CLOUD_TEST_PROJECT"] || + ENV["GCLOUD_TEST_PROJECT"] + keyfile = args[:keyfile] + keyfile ||= + ENV["GOOGLE_CLOUD_TEST_KEYFILE"] || + ENV["GCLOUD_TEST_KEYFILE"] + if keyfile + keyfile = File.read keyfile + else + keyfile ||= + ENV["GOOGLE_CLOUD_TEST_KEYFILE_JSON"] || + ENV["GCLOUD_TEST_KEYFILE_JSON"] + end + if project.nil? || keyfile.nil? + fail "You must provide a project and keyfile. e.g. rake acceptance[test123, /path/to/keyfile.json] or GOOGLE_CLOUD_TEST_PROJECT=test123 GOOGLE_CLOUD_TEST_KEYFILE=/path/to/keyfile.json rake acceptance" + end + require "google/cloud/security/public_ca/v1beta1/public_certificate_authority_service/credentials" + ::Google::Cloud::Security::PublicCA::V1beta1::PublicCertificateAuthorityService::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-security-public_ca-v1beta1 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-security-public_ca-v1beta1 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-security-public_ca-v1beta1 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-security-public_ca-v1beta1 gem does not have doctest tests." +end + +desc "Run the CI build" +task :ci do + header "BUILDING google-cloud-security-public_ca-v1beta1" + header "google-cloud-security-public_ca-v1beta1 rubocop", "*" + Rake::Task[:rubocop].invoke + header "google-cloud-security-public_ca-v1beta1 yard", "*" + Rake::Task[:yard].invoke + header "google-cloud-security-public_ca-v1beta1 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-security-public_ca-v1beta1 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-security-public_ca-v1beta1 acceptance", "*" + Rake::Task[:acceptance].invoke + end + task :a do + # This is a handy shortcut to save typing + Rake::Task["ci:acceptance"].invoke + end +end + +task default: :test + +def header str, token = "#" + line_length = str.length + 8 + puts "" + puts token * line_length + puts "#{token * 3} #{str} #{token * 3}" + puts token * line_length + puts "" +end diff --git a/owl-bot-staging/google-cloud-security-public_ca-v1beta1/gapic_metadata.json b/owl-bot-staging/google-cloud-security-public_ca-v1beta1/gapic_metadata.json new file mode 100644 index 000000000000..8797303d6141 --- /dev/null +++ b/owl-bot-staging/google-cloud-security-public_ca-v1beta1/gapic_metadata.json @@ -0,0 +1,23 @@ +{ + "schema": "1.0", + "comment": "This file maps proto services/RPCs to the corresponding library clients/methods", + "language": "ruby", + "protoPackage": "google.cloud.security.publicca.v1beta1", + "libraryPackage": "::Google::Cloud::Security::PublicCA::V1beta1", + "services": { + "PublicCertificateAuthorityService": { + "clients": { + "grpc": { + "libraryClient": "::Google::Cloud::Security::PublicCA::V1beta1::PublicCertificateAuthorityService::Client", + "rpcs": { + "CreateExternalAccountKey": { + "methods": [ + "create_external_account_key" + ] + } + } + } + } + } + } +} diff --git a/owl-bot-staging/google-cloud-security-public_ca-v1beta1/google-cloud-security-public_ca-v1beta1.gemspec b/owl-bot-staging/google-cloud-security-public_ca-v1beta1/google-cloud-security-public_ca-v1beta1.gemspec new file mode 100644 index 000000000000..ff6127e51c1f --- /dev/null +++ b/owl-bot-staging/google-cloud-security-public_ca-v1beta1/google-cloud-security-public_ca-v1beta1.gemspec @@ -0,0 +1,28 @@ +# -*- ruby -*- +# encoding: utf-8 + +require File.expand_path("lib/google/cloud/security/public_ca/v1beta1/version", __dir__) + +Gem::Specification.new do |gem| + gem.name = "google-cloud-security-public_ca-v1beta1" + gem.version = Google::Cloud::Security::PublicCA::V1beta1::VERSION + + gem.authors = ["Google LLC"] + gem.email = "googleapis-packages@google.com" + gem.description = "Certificate Manager's Public Certificate Authority (CA) functionality allows you to provision and deploy widely trusted X.509 certificates after validating that the certificate requester controls the domains. Certificate Manager lets you directly and programmatically request publicly trusted TLS certificates that are already in the root of trust stores used by major browsers, operating systems, and applications. You can use these TLS certificates to authenticate and encrypt internet traffic. Note that google-cloud-security-public_ca-v1beta1 is a version-specific client library. For most uses, we recommend installing the main client library google-cloud-security-public_ca instead. See the readme for more details." + gem.summary = "The Public Certificate Authority API may be used to create and manage ACME external account binding keys associated with Google Trust Services' publicly trusted certificate authority." + 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" +end diff --git a/owl-bot-staging/google-cloud-security-public_ca-v1beta1/lib/google-cloud-security-public_ca-v1beta1.rb b/owl-bot-staging/google-cloud-security-public_ca-v1beta1/lib/google-cloud-security-public_ca-v1beta1.rb new file mode 100644 index 000000000000..d6dee1be9611 --- /dev/null +++ b/owl-bot-staging/google-cloud-security-public_ca-v1beta1/lib/google-cloud-security-public_ca-v1beta1.rb @@ -0,0 +1,21 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +# This gem does not autoload during Bundler.require. To load this gem, +# issue explicit require statements for the packages desired, e.g.: +# require "google/cloud/security/public_ca/v1beta1" diff --git a/owl-bot-staging/google-cloud-security-public_ca-v1beta1/lib/google/cloud/security/public_ca/v1beta1.rb b/owl-bot-staging/google-cloud-security-public_ca-v1beta1/lib/google/cloud/security/public_ca/v1beta1.rb new file mode 100644 index 000000000000..a8f607059a31 --- /dev/null +++ b/owl-bot-staging/google-cloud-security-public_ca-v1beta1/lib/google/cloud/security/public_ca/v1beta1.rb @@ -0,0 +1,47 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +require "google/cloud/security/public_ca/v1beta1/public_certificate_authority_service" +require "google/cloud/security/public_ca/v1beta1/version" + +module Google + module Cloud + module Security + module PublicCA + ## + # API client module. + # + # @example Load this package, including all its services, and instantiate a gRPC client + # + # require "google/cloud/security/public_ca/v1beta1" + # client = ::Google::Cloud::Security::PublicCA::V1beta1::PublicCertificateAuthorityService::Client.new + # + # @example Load this package, including all its services, and instantiate a REST client + # + # require "google/cloud/security/public_ca/v1beta1" + # client = ::Google::Cloud::Security::PublicCA::V1beta1::PublicCertificateAuthorityService::Rest::Client.new + # + module V1beta1 + end + end + end + end +end + +helper_path = ::File.join __dir__, "v1beta1", "_helpers.rb" +require "google/cloud/security/public_ca/v1beta1/_helpers" if ::File.file? helper_path diff --git a/owl-bot-staging/google-cloud-security-public_ca-v1beta1/lib/google/cloud/security/public_ca/v1beta1/public_certificate_authority_service.rb b/owl-bot-staging/google-cloud-security-public_ca-v1beta1/lib/google/cloud/security/public_ca/v1beta1/public_certificate_authority_service.rb new file mode 100644 index 000000000000..745b3f31d4cb --- /dev/null +++ b/owl-bot-staging/google-cloud-security-public_ca-v1beta1/lib/google/cloud/security/public_ca/v1beta1/public_certificate_authority_service.rb @@ -0,0 +1,59 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +require "gapic/common" +require "gapic/config" +require "gapic/config/method" + +require "google/cloud/security/public_ca/v1beta1/version" + +require "google/cloud/security/public_ca/v1beta1/public_certificate_authority_service/credentials" +require "google/cloud/security/public_ca/v1beta1/public_certificate_authority_service/paths" +require "google/cloud/security/public_ca/v1beta1/public_certificate_authority_service/client" +require "google/cloud/security/public_ca/v1beta1/public_certificate_authority_service/rest" + +module Google + module Cloud + module Security + module PublicCA + module V1beta1 + ## + # Manages the resources required for ACME [external account + # binding](https://tools.ietf.org/html/rfc8555#section-7.3.4) for + # the public certificate authority service. + # + # @example Load this service and instantiate a gRPC client + # + # require "google/cloud/security/public_ca/v1beta1/public_certificate_authority_service" + # client = ::Google::Cloud::Security::PublicCA::V1beta1::PublicCertificateAuthorityService::Client.new + # + # @example Load this service and instantiate a REST client + # + # require "google/cloud/security/public_ca/v1beta1/public_certificate_authority_service/rest" + # client = ::Google::Cloud::Security::PublicCA::V1beta1::PublicCertificateAuthorityService::Rest::Client.new + # + module PublicCertificateAuthorityService + end + end + end + end + end +end + +helper_path = ::File.join __dir__, "public_certificate_authority_service", "helpers.rb" +require "google/cloud/security/public_ca/v1beta1/public_certificate_authority_service/helpers" if ::File.file? helper_path diff --git a/owl-bot-staging/google-cloud-security-public_ca-v1beta1/lib/google/cloud/security/public_ca/v1beta1/public_certificate_authority_service/client.rb b/owl-bot-staging/google-cloud-security-public_ca-v1beta1/lib/google/cloud/security/public_ca/v1beta1/public_certificate_authority_service/client.rb new file mode 100644 index 000000000000..dcc1105d93aa --- /dev/null +++ b/owl-bot-staging/google-cloud-security-public_ca-v1beta1/lib/google/cloud/security/public_ca/v1beta1/public_certificate_authority_service/client.rb @@ -0,0 +1,492 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +require "google/cloud/errors" +require "google/cloud/security/publicca/v1beta1/service_pb" + +module Google + module Cloud + module Security + module PublicCA + module V1beta1 + module PublicCertificateAuthorityService + ## + # Client for the PublicCertificateAuthorityService service. + # + # Manages the resources required for ACME [external account + # binding](https://tools.ietf.org/html/rfc8555#section-7.3.4) for + # the public certificate authority service. + # + class Client + # @private + API_VERSION = "" + + # @private + DEFAULT_ENDPOINT_TEMPLATE = "publicca.$UNIVERSE_DOMAIN$" + + include Paths + + # @private + attr_reader :public_certificate_authority_service_stub + + ## + # Configure the PublicCertificateAuthorityService Client class. + # + # See {::Google::Cloud::Security::PublicCA::V1beta1::PublicCertificateAuthorityService::Client::Configuration} + # for a description of the configuration fields. + # + # @example + # + # # Modify the configuration for all PublicCertificateAuthorityService clients + # ::Google::Cloud::Security::PublicCA::V1beta1::PublicCertificateAuthorityService::Client.configure do |config| + # config.timeout = 10.0 + # end + # + # @yield [config] Configure the Client client. + # @yieldparam config [Client::Configuration] + # + # @return [Client::Configuration] + # + def self.configure + @configure ||= begin + namespace = ["Google", "Cloud", "Security", "PublicCA", "V1beta1"] + parent_config = while namespace.any? + parent_name = namespace.join "::" + parent_const = const_get parent_name + break parent_const.configure if parent_const.respond_to? :configure + namespace.pop + end + default_config = Client::Configuration.new parent_config + + default_config.timeout = 60.0 + default_config.retry_policy = { + initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [14] + } + + default_config + end + yield @configure if block_given? + @configure + end + + ## + # Configure the PublicCertificateAuthorityService Client instance. + # + # The configuration is set to the derived mode, meaning that values can be changed, + # but structural changes (adding new fields, etc.) are not allowed. Structural changes + # should be made on {Client.configure}. + # + # See {::Google::Cloud::Security::PublicCA::V1beta1::PublicCertificateAuthorityService::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 + @public_certificate_authority_service_stub.universe_domain + end + + ## + # Create a new PublicCertificateAuthorityService client object. + # + # @example + # + # # Create a client using the default configuration + # client = ::Google::Cloud::Security::PublicCA::V1beta1::PublicCertificateAuthorityService::Client.new + # + # # Create a client using a custom configuration + # client = ::Google::Cloud::Security::PublicCA::V1beta1::PublicCertificateAuthorityService::Client.new do |config| + # config.timeout = 10.0 + # end + # + # @yield [config] Configure the PublicCertificateAuthorityService client. + # @yieldparam config [Client::Configuration] + # + def initialize + # These require statements are intentionally placed here to initialize + # the gRPC module only when it's required. + # See https://github.com/googleapis/toolkit/issues/446 + require "gapic/grpc" + require "google/cloud/security/publicca/v1beta1/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 + + @public_certificate_authority_service_stub = ::Gapic::ServiceStub.new( + ::Google::Cloud::Security::PublicCA::V1beta1::PublicCertificateAuthorityService::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 + ) + + @public_certificate_authority_service_stub.stub_logger&.info do |entry| + entry.set_system_name + entry.set_service + entry.message = "Created client for #{entry.service}" + entry.set_credentials_fields credentials + entry.set "customEndpoint", @config.endpoint if @config.endpoint + entry.set "defaultTimeout", @config.timeout if @config.timeout + entry.set "quotaProject", @quota_project_id if @quota_project_id + end + end + + ## + # The logger used for request/response debug logging. + # + # @return [Logger] + # + def logger + @public_certificate_authority_service_stub.logger + end + + # Service calls + + ## + # Creates a new + # {::Google::Cloud::Security::PublicCA::V1beta1::ExternalAccountKey ExternalAccountKey} + # bound to the project. + # + # @overload create_external_account_key(request, options = nil) + # Pass arguments to `create_external_account_key` via a request object, either of type + # {::Google::Cloud::Security::PublicCA::V1beta1::CreateExternalAccountKeyRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Security::PublicCA::V1beta1::CreateExternalAccountKeyRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_external_account_key(parent: nil, external_account_key: nil) + # Pass arguments to `create_external_account_key` via keyword arguments. Note that at + # least one keyword argument is 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 external_account_key will be + # created. Format: projects/[project_id]/locations/[location]. At present + # only the "global" location is supported. + # @param external_account_key [::Google::Cloud::Security::PublicCA::V1beta1::ExternalAccountKey, ::Hash] + # Required. The external account key to create. This field only exists to + # future-proof the API. At present, all fields in ExternalAccountKey are + # output only and all values are ignored. For the purpose of the + # CreateExternalAccountKeyRequest, set it to a default/empty value. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Google::Cloud::Security::PublicCA::V1beta1::ExternalAccountKey] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Google::Cloud::Security::PublicCA::V1beta1::ExternalAccountKey] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/security/public_ca/v1beta1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Security::PublicCA::V1beta1::PublicCertificateAuthorityService::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Security::PublicCA::V1beta1::CreateExternalAccountKeyRequest.new + # + # # Call the create_external_account_key method. + # result = client.create_external_account_key request + # + # # The returned object is of type Google::Cloud::Security::PublicCA::V1beta1::ExternalAccountKey. + # p result + # + def create_external_account_key request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Security::PublicCA::V1beta1::CreateExternalAccountKeyRequest + + # Converts hash 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_external_account_key.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::Security::PublicCA::V1beta1::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_external_account_key.timeout, + metadata: metadata, + retry_policy: @config.rpcs.create_external_account_key.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @public_certificate_authority_service_stub.call_rpc :create_external_account_key, request, options: options do |response, operation| + yield response, operation if block_given? + end + rescue ::GRPC::BadStatus => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Configuration class for the PublicCertificateAuthorityService API. + # + # This class represents the configuration for PublicCertificateAuthorityService, + # providing control over timeouts, retry behavior, logging, transport + # parameters, and other low-level controls. Certain parameters can also be + # applied individually to specific RPCs. See + # {::Google::Cloud::Security::PublicCA::V1beta1::PublicCertificateAuthorityService::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_external_account_key to 20 seconds, + # # and all remaining timeouts to 10 seconds. + # ::Google::Cloud::Security::PublicCA::V1beta1::PublicCertificateAuthorityService::Client.configure do |config| + # config.timeout = 10.0 + # config.rpcs.create_external_account_key.timeout = 20.0 + # end + # + # # Apply the above configuration only to a new client. + # client = ::Google::Cloud::Security::PublicCA::V1beta1::PublicCertificateAuthorityService::Client.new do |config| + # config.timeout = 10.0 + # config.rpcs.create_external_account_key.timeout = 20.0 + # end + # + # @!attribute [rw] endpoint + # A custom service endpoint, as a hostname or hostname:port. The default is + # nil, indicating to use the default endpoint in the current universe domain. + # @return [::String,nil] + # @!attribute [rw] credentials + # Credentials to send with calls. You may provide any of the following types: + # * (`Google::Auth::Credentials`) A googleauth credentials object + # (see the [googleauth docs](https://rubydoc.info/gems/googleauth/Google/Auth/Credentials)) + # * (`Signet::OAuth2::Client`) A signet oauth2 client object + # (see the [signet docs](https://rubydoc.info/gems/signet/Signet/OAuth2/Client)) + # * (`GRPC::Core::Channel`) a gRPC channel with included credentials + # * (`GRPC::Core::ChannelCredentials`) a gRPC credentails object + # * (`nil`) indicating no credentials + # + # @note Warning: Passing a `String` to a keyfile path or a `Hash` of credentials + # is deprecated. Providing an unvalidated credential configuration to + # Google APIs can compromise the security of your systems and data. + # + # @example + # + # # The recommended way to provide credentials is to use the `make_creds` method + # # on the appropriate credentials class for your environment. + # + # require "googleauth" + # + # credentials = ::Google::Auth::ServiceAccountCredentials.make_creds( + # json_key_io: ::File.open("/path/to/keyfile.json") + # ) + # + # client = ::Google::Cloud::Security::PublicCA::V1beta1::PublicCertificateAuthorityService::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 = "publicca.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 PublicCertificateAuthorityService 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_external_account_key` + # @return [::Gapic::Config::Method] + # + attr_reader :create_external_account_key + + # @private + def initialize parent_rpcs = nil + create_external_account_key_config = parent_rpcs.create_external_account_key if parent_rpcs.respond_to? :create_external_account_key + @create_external_account_key = ::Gapic::Config::Method.new create_external_account_key_config + + yield self if block_given? + end + end + end + end + end + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-security-public_ca-v1beta1/lib/google/cloud/security/public_ca/v1beta1/public_certificate_authority_service/credentials.rb b/owl-bot-staging/google-cloud-security-public_ca-v1beta1/lib/google/cloud/security/public_ca/v1beta1/public_certificate_authority_service/credentials.rb new file mode 100644 index 000000000000..89cb30d53806 --- /dev/null +++ b/owl-bot-staging/google-cloud-security-public_ca-v1beta1/lib/google/cloud/security/public_ca/v1beta1/public_certificate_authority_service/credentials.rb @@ -0,0 +1,49 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +require "googleauth" + +module Google + module Cloud + module Security + module PublicCA + module V1beta1 + module PublicCertificateAuthorityService + # Credentials for the PublicCertificateAuthorityService API. + class Credentials < ::Google::Auth::Credentials + self.scope = [ + "https://www.googleapis.com/auth/cloud-platform" + ] + self.env_vars = [ + "GOOGLE_CLOUD_CREDENTIALS", + "GOOGLE_CLOUD_KEYFILE", + "GCLOUD_KEYFILE", + "GOOGLE_CLOUD_CREDENTIALS_JSON", + "GOOGLE_CLOUD_KEYFILE_JSON", + "GCLOUD_KEYFILE_JSON" + ] + self.paths = [ + "~/.config/google_cloud/application_default_credentials.json" + ] + end + end + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-security-public_ca-v1beta1/lib/google/cloud/security/public_ca/v1beta1/public_certificate_authority_service/paths.rb b/owl-bot-staging/google-cloud-security-public_ca-v1beta1/lib/google/cloud/security/public_ca/v1beta1/public_certificate_authority_service/paths.rb new file mode 100644 index 000000000000..2b60298d5d3f --- /dev/null +++ b/owl-bot-staging/google-cloud-security-public_ca-v1beta1/lib/google/cloud/security/public_ca/v1beta1/public_certificate_authority_service/paths.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 Cloud + module Security + module PublicCA + module V1beta1 + module PublicCertificateAuthorityService + # Path helper methods for the PublicCertificateAuthorityService API. + module Paths + ## + # Create a fully-qualified ExternalAccountKey resource string. + # + # The resource will be in the following format: + # + # `projects/{project}/locations/{location}/externalAccountKeys/{external_account_key}` + # + # @param project [String] + # @param location [String] + # @param external_account_key [String] + # + # @return [::String] + def external_account_key_path project:, location:, external_account_key: + raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" + raise ::ArgumentError, "location cannot contain /" if location.to_s.include? "/" + + "projects/#{project}/locations/#{location}/externalAccountKeys/#{external_account_key}" + 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 + + extend self + end + end + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-security-public_ca-v1beta1/lib/google/cloud/security/public_ca/v1beta1/public_certificate_authority_service/rest.rb b/owl-bot-staging/google-cloud-security-public_ca-v1beta1/lib/google/cloud/security/public_ca/v1beta1/public_certificate_authority_service/rest.rb new file mode 100644 index 000000000000..e022b4af197b --- /dev/null +++ b/owl-bot-staging/google-cloud-security-public_ca-v1beta1/lib/google/cloud/security/public_ca/v1beta1/public_certificate_authority_service/rest.rb @@ -0,0 +1,56 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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/security/public_ca/v1beta1/version" + +require "google/cloud/security/public_ca/v1beta1/public_certificate_authority_service/credentials" +require "google/cloud/security/public_ca/v1beta1/public_certificate_authority_service/paths" +require "google/cloud/security/public_ca/v1beta1/public_certificate_authority_service/rest/client" + +module Google + module Cloud + module Security + module PublicCA + module V1beta1 + ## + # Manages the resources required for ACME [external account + # binding](https://tools.ietf.org/html/rfc8555#section-7.3.4) for + # the public certificate authority service. + # + # To load this service and instantiate a REST client: + # + # require "google/cloud/security/public_ca/v1beta1/public_certificate_authority_service/rest" + # client = ::Google::Cloud::Security::PublicCA::V1beta1::PublicCertificateAuthorityService::Rest::Client.new + # + module PublicCertificateAuthorityService + # Client for the REST transport + module Rest + end + end + end + end + end + end +end + +helper_path = ::File.join __dir__, "rest", "helpers.rb" +require "google/cloud/security/public_ca/v1beta1/public_certificate_authority_service/rest/helpers" if ::File.file? helper_path diff --git a/owl-bot-staging/google-cloud-security-public_ca-v1beta1/lib/google/cloud/security/public_ca/v1beta1/public_certificate_authority_service/rest/client.rb b/owl-bot-staging/google-cloud-security-public_ca-v1beta1/lib/google/cloud/security/public_ca/v1beta1/public_certificate_authority_service/rest/client.rb new file mode 100644 index 000000000000..db98415432a6 --- /dev/null +++ b/owl-bot-staging/google-cloud-security-public_ca-v1beta1/lib/google/cloud/security/public_ca/v1beta1/public_certificate_authority_service/rest/client.rb @@ -0,0 +1,442 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +require "google/cloud/errors" +require "google/cloud/security/publicca/v1beta1/service_pb" +require "google/cloud/security/public_ca/v1beta1/public_certificate_authority_service/rest/service_stub" + +module Google + module Cloud + module Security + module PublicCA + module V1beta1 + module PublicCertificateAuthorityService + module Rest + ## + # REST client for the PublicCertificateAuthorityService service. + # + # Manages the resources required for ACME [external account + # binding](https://tools.ietf.org/html/rfc8555#section-7.3.4) for + # the public certificate authority service. + # + class Client + # @private + API_VERSION = "" + + # @private + DEFAULT_ENDPOINT_TEMPLATE = "publicca.$UNIVERSE_DOMAIN$" + + include Paths + + # @private + attr_reader :public_certificate_authority_service_stub + + ## + # Configure the PublicCertificateAuthorityService Client class. + # + # See {::Google::Cloud::Security::PublicCA::V1beta1::PublicCertificateAuthorityService::Rest::Client::Configuration} + # for a description of the configuration fields. + # + # @example + # + # # Modify the configuration for all PublicCertificateAuthorityService clients + # ::Google::Cloud::Security::PublicCA::V1beta1::PublicCertificateAuthorityService::Rest::Client.configure do |config| + # config.timeout = 10.0 + # end + # + # @yield [config] Configure the Client client. + # @yieldparam config [Client::Configuration] + # + # @return [Client::Configuration] + # + def self.configure + @configure ||= begin + namespace = ["Google", "Cloud", "Security", "PublicCA", "V1beta1"] + parent_config = while namespace.any? + parent_name = namespace.join "::" + parent_const = const_get parent_name + break parent_const.configure if parent_const.respond_to? :configure + namespace.pop + end + default_config = Client::Configuration.new parent_config + + default_config.timeout = 60.0 + default_config.retry_policy = { + initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [14] + } + + default_config + end + yield @configure if block_given? + @configure + end + + ## + # Configure the PublicCertificateAuthorityService Client instance. + # + # The configuration is set to the derived mode, meaning that values can be changed, + # but structural changes (adding new fields, etc.) are not allowed. Structural changes + # should be made on {Client.configure}. + # + # See {::Google::Cloud::Security::PublicCA::V1beta1::PublicCertificateAuthorityService::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 + @public_certificate_authority_service_stub.universe_domain + end + + ## + # Create a new PublicCertificateAuthorityService REST client object. + # + # @example + # + # # Create a client using the default configuration + # client = ::Google::Cloud::Security::PublicCA::V1beta1::PublicCertificateAuthorityService::Rest::Client.new + # + # # Create a client using a custom configuration + # client = ::Google::Cloud::Security::PublicCA::V1beta1::PublicCertificateAuthorityService::Rest::Client.new do |config| + # config.timeout = 10.0 + # end + # + # @yield [config] Configure the PublicCertificateAuthorityService 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 + + @public_certificate_authority_service_stub = ::Google::Cloud::Security::PublicCA::V1beta1::PublicCertificateAuthorityService::Rest::ServiceStub.new( + endpoint: @config.endpoint, + endpoint_template: DEFAULT_ENDPOINT_TEMPLATE, + universe_domain: @config.universe_domain, + credentials: credentials, + logger: @config.logger + ) + + @public_certificate_authority_service_stub.logger(stub: true)&.info do |entry| + entry.set_system_name + entry.set_service + entry.message = "Created client for #{entry.service}" + entry.set_credentials_fields credentials + entry.set "customEndpoint", @config.endpoint if @config.endpoint + entry.set "defaultTimeout", @config.timeout if @config.timeout + entry.set "quotaProject", @quota_project_id if @quota_project_id + end + end + + ## + # The logger used for request/response debug logging. + # + # @return [Logger] + # + def logger + @public_certificate_authority_service_stub.logger + end + + # Service calls + + ## + # Creates a new + # {::Google::Cloud::Security::PublicCA::V1beta1::ExternalAccountKey ExternalAccountKey} + # bound to the project. + # + # @overload create_external_account_key(request, options = nil) + # Pass arguments to `create_external_account_key` via a request object, either of type + # {::Google::Cloud::Security::PublicCA::V1beta1::CreateExternalAccountKeyRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Security::PublicCA::V1beta1::CreateExternalAccountKeyRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_external_account_key(parent: nil, external_account_key: nil) + # Pass arguments to `create_external_account_key` via keyword arguments. Note that at + # least one keyword argument is 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 external_account_key will be + # created. Format: projects/[project_id]/locations/[location]. At present + # only the "global" location is supported. + # @param external_account_key [::Google::Cloud::Security::PublicCA::V1beta1::ExternalAccountKey, ::Hash] + # Required. The external account key to create. This field only exists to + # future-proof the API. At present, all fields in ExternalAccountKey are + # output only and all values are ignored. For the purpose of the + # CreateExternalAccountKeyRequest, set it to a default/empty value. + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Cloud::Security::PublicCA::V1beta1::ExternalAccountKey] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::Security::PublicCA::V1beta1::ExternalAccountKey] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/security/public_ca/v1beta1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Security::PublicCA::V1beta1::PublicCertificateAuthorityService::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Security::PublicCA::V1beta1::CreateExternalAccountKeyRequest.new + # + # # Call the create_external_account_key method. + # result = client.create_external_account_key request + # + # # The returned object is of type Google::Cloud::Security::PublicCA::V1beta1::ExternalAccountKey. + # p result + # + def create_external_account_key request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Security::PublicCA::V1beta1::CreateExternalAccountKeyRequest + + # Converts hash 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_external_account_key.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::Security::PublicCA::V1beta1::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_external_account_key.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.create_external_account_key.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @public_certificate_authority_service_stub.create_external_account_key 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 PublicCertificateAuthorityService REST API. + # + # This class represents the configuration for PublicCertificateAuthorityService REST, + # providing control over timeouts, retry behavior, logging, transport + # parameters, and other low-level controls. Certain parameters can also be + # applied individually to specific RPCs. See + # {::Google::Cloud::Security::PublicCA::V1beta1::PublicCertificateAuthorityService::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_external_account_key to 20 seconds, + # # and all remaining timeouts to 10 seconds. + # ::Google::Cloud::Security::PublicCA::V1beta1::PublicCertificateAuthorityService::Rest::Client.configure do |config| + # config.timeout = 10.0 + # config.rpcs.create_external_account_key.timeout = 20.0 + # end + # + # # Apply the above configuration only to a new client. + # client = ::Google::Cloud::Security::PublicCA::V1beta1::PublicCertificateAuthorityService::Rest::Client.new do |config| + # config.timeout = 10.0 + # config.rpcs.create_external_account_key.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 = "publicca.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 PublicCertificateAuthorityService 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_external_account_key` + # @return [::Gapic::Config::Method] + # + attr_reader :create_external_account_key + + # @private + def initialize parent_rpcs = nil + create_external_account_key_config = parent_rpcs.create_external_account_key if parent_rpcs.respond_to? :create_external_account_key + @create_external_account_key = ::Gapic::Config::Method.new create_external_account_key_config + + yield self if block_given? + end + end + end + end + end + end + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-security-public_ca-v1beta1/lib/google/cloud/security/public_ca/v1beta1/public_certificate_authority_service/rest/service_stub.rb b/owl-bot-staging/google-cloud-security-public_ca-v1beta1/lib/google/cloud/security/public_ca/v1beta1/public_certificate_authority_service/rest/service_stub.rb new file mode 100644 index 000000000000..7ee907e245d0 --- /dev/null +++ b/owl-bot-staging/google-cloud-security-public_ca-v1beta1/lib/google/cloud/security/public_ca/v1beta1/public_certificate_authority_service/rest/service_stub.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! + +require "google/cloud/security/publicca/v1beta1/service_pb" + +module Google + module Cloud + module Security + module PublicCA + module V1beta1 + module PublicCertificateAuthorityService + module Rest + ## + # REST service stub for the PublicCertificateAuthorityService 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_external_account_key REST call + # + # @param request_pb [::Google::Cloud::Security::PublicCA::V1beta1::CreateExternalAccountKeyRequest] + # A request object representing the call parameters. Required. + # @param options [::Gapic::CallOptions] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Cloud::Security::PublicCA::V1beta1::ExternalAccountKey] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::Security::PublicCA::V1beta1::ExternalAccountKey] + # A result object deserialized from the server's reply + def create_external_account_key request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_create_external_account_key_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_external_account_key", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Cloud::Security::PublicCA::V1beta1::ExternalAccountKey.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_external_account_key REST call + # + # @param request_pb [::Google::Cloud::Security::PublicCA::V1beta1::CreateExternalAccountKeyRequest] + # 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_external_account_key_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :post, + uri_template: "/v1beta1/{parent}/externalAccountKeys", + body: "external_account_key", + matches: [ + ["parent", %r{^projects/[^/]+/locations/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + end + end + end + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-security-public_ca-v1beta1/lib/google/cloud/security/public_ca/v1beta1/rest.rb b/owl-bot-staging/google-cloud-security-public_ca-v1beta1/lib/google/cloud/security/public_ca/v1beta1/rest.rb new file mode 100644 index 000000000000..0d388c9d0dd9 --- /dev/null +++ b/owl-bot-staging/google-cloud-security-public_ca-v1beta1/lib/google/cloud/security/public_ca/v1beta1/rest.rb @@ -0,0 +1,39 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +require "google/cloud/security/public_ca/v1beta1/public_certificate_authority_service/rest" +require "google/cloud/security/public_ca/v1beta1/version" + +module Google + module Cloud + module Security + module PublicCA + ## + # To load just the REST part of this package, including all its services, and instantiate a REST client: + # + # @example + # + # require "google/cloud/security/public_ca/v1beta1/rest" + # client = ::Google::Cloud::Security::PublicCA::V1beta1::PublicCertificateAuthorityService::Rest::Client.new + # + module V1beta1 + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-security-public_ca-v1beta1/lib/google/cloud/security/public_ca/v1beta1/version.rb b/owl-bot-staging/google-cloud-security-public_ca-v1beta1/lib/google/cloud/security/public_ca/v1beta1/version.rb new file mode 100644 index 000000000000..f223859cedd7 --- /dev/null +++ b/owl-bot-staging/google-cloud-security-public_ca-v1beta1/lib/google/cloud/security/public_ca/v1beta1/version.rb @@ -0,0 +1,30 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + + +module Google + module Cloud + module Security + module PublicCA + module V1beta1 + VERSION = "0.0.1" + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-security-public_ca-v1beta1/lib/google/cloud/security/publicca/v1beta1/resources_pb.rb b/owl-bot-staging/google-cloud-security-public_ca-v1beta1/lib/google/cloud/security/publicca/v1beta1/resources_pb.rb new file mode 100644 index 000000000000..553386d14371 --- /dev/null +++ b/owl-bot-staging/google-cloud-security-public_ca-v1beta1/lib/google/cloud/security/publicca/v1beta1/resources_pb.rb @@ -0,0 +1,26 @@ +# frozen_string_literal: true +# Generated by the protocol buffer compiler. DO NOT EDIT! +# source: google/cloud/security/publicca/v1beta1/resources.proto + +require 'google/protobuf' + +require 'google/api/field_behavior_pb' +require 'google/api/resource_pb' + + +descriptor_data = "\n6google/cloud/security/publicca/v1beta1/resources.proto\x12&google.cloud.security.publicca.v1beta1\x1a\x1fgoogle/api/field_behavior.proto\x1a\x19google/api/resource.proto\"\xdd\x01\n\x12\x45xternalAccountKey\x12\x11\n\x04name\x18\x01 \x01(\tB\x03\xe0\x41\x03\x12\x13\n\x06key_id\x18\x02 \x01(\tB\x03\xe0\x41\x03\x12\x18\n\x0b\x62\x36\x34_mac_key\x18\x03 \x01(\x0c\x42\x03\xe0\x41\x03:\x84\x01\xea\x41\x80\x01\n*publicca.googleapis.com/ExternalAccountKey\x12Rprojects/{project}/locations/{location}/externalAccountKeys/{external_account_key}B\x85\x02\n*com.google.cloud.security.publicca.v1beta1B\x0eResourcesProtoP\x01ZFcloud.google.com/go/security/publicca/apiv1beta1/publiccapb;publiccapb\xaa\x02&Google.Cloud.Security.PublicCA.V1Beta1\xca\x02&Google\\Cloud\\Security\\PublicCA\\V1beta1\xea\x02*Google::Cloud::Security::PublicCA::V1beta1b\x06proto3" + +pool = ::Google::Protobuf::DescriptorPool.generated_pool +pool.add_serialized_file(descriptor_data) + +module Google + module Cloud + module Security + module PublicCA + module V1beta1 + ExternalAccountKey = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.security.publicca.v1beta1.ExternalAccountKey").msgclass + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-security-public_ca-v1beta1/lib/google/cloud/security/publicca/v1beta1/service_pb.rb b/owl-bot-staging/google-cloud-security-public_ca-v1beta1/lib/google/cloud/security/publicca/v1beta1/service_pb.rb new file mode 100644 index 000000000000..2bc2dd127081 --- /dev/null +++ b/owl-bot-staging/google-cloud-security-public_ca-v1beta1/lib/google/cloud/security/publicca/v1beta1/service_pb.rb @@ -0,0 +1,29 @@ +# frozen_string_literal: true +# Generated by the protocol buffer compiler. DO NOT EDIT! +# source: google/cloud/security/publicca/v1beta1/service.proto + +require 'google/protobuf' + +require 'google/api/annotations_pb' +require 'google/api/client_pb' +require 'google/api/field_behavior_pb' +require 'google/api/resource_pb' +require 'google/cloud/security/publicca/v1beta1/resources_pb' + + +descriptor_data = "\n4google/cloud/security/publicca/v1beta1/service.proto\x12&google.cloud.security.publicca.v1beta1\x1a\x1cgoogle/api/annotations.proto\x1a\x17google/api/client.proto\x1a\x1fgoogle/api/field_behavior.proto\x1a\x19google/api/resource.proto\x1a\x36google/cloud/security/publicca/v1beta1/resources.proto\"\xc4\x01\n\x1f\x43reateExternalAccountKeyRequest\x12\x42\n\x06parent\x18\x01 \x01(\tB2\xe0\x41\x02\xfa\x41,\x12*publicca.googleapis.com/ExternalAccountKey\x12]\n\x14\x65xternal_account_key\x18\x02 \x01(\x0b\x32:.google.cloud.security.publicca.v1beta1.ExternalAccountKeyB\x03\xe0\x41\x02\x32\x8c\x03\n!PublicCertificateAuthorityService\x12\x99\x02\n\x18\x43reateExternalAccountKey\x12G.google.cloud.security.publicca.v1beta1.CreateExternalAccountKeyRequest\x1a:.google.cloud.security.publicca.v1beta1.ExternalAccountKey\"x\xda\x41\x1bparent,external_account_key\x82\xd3\xe4\x93\x02T\"] + # The destination where API teams want this client library to be published. + # @!attribute [rw] selective_gapic_generation + # @return [::Google::Api::SelectiveGapicGeneration] + # Configuration for which RPCs should be generated in the GAPIC client. + class CommonLanguageSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Details about how and where to publish client libraries. + # @!attribute [rw] version + # @return [::String] + # Version of the API to apply these settings to. This is the full protobuf + # package for the API, ending in the version element. + # Examples: "google.cloud.speech.v1" and "google.spanner.admin.database.v1". + # @!attribute [rw] launch_stage + # @return [::Google::Api::LaunchStage] + # Launch stage of this version of the API. + # @!attribute [rw] rest_numeric_enums + # @return [::Boolean] + # When using transport=rest, the client request will encode enums as + # numbers rather than strings. + # @!attribute [rw] java_settings + # @return [::Google::Api::JavaSettings] + # Settings for legacy Java features, supported in the Service YAML. + # @!attribute [rw] cpp_settings + # @return [::Google::Api::CppSettings] + # Settings for C++ client libraries. + # @!attribute [rw] php_settings + # @return [::Google::Api::PhpSettings] + # Settings for PHP client libraries. + # @!attribute [rw] python_settings + # @return [::Google::Api::PythonSettings] + # Settings for Python client libraries. + # @!attribute [rw] node_settings + # @return [::Google::Api::NodeSettings] + # Settings for Node client libraries. + # @!attribute [rw] dotnet_settings + # @return [::Google::Api::DotnetSettings] + # Settings for .NET client libraries. + # @!attribute [rw] ruby_settings + # @return [::Google::Api::RubySettings] + # Settings for Ruby client libraries. + # @!attribute [rw] go_settings + # @return [::Google::Api::GoSettings] + # Settings for Go client libraries. + class ClientLibrarySettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # This message configures the settings for publishing [Google Cloud Client + # libraries](https://cloud.google.com/apis/docs/cloud-client-libraries) + # generated from the service config. + # @!attribute [rw] method_settings + # @return [::Array<::Google::Api::MethodSettings>] + # A list of API method settings, e.g. the behavior for methods that use the + # long-running operation pattern. + # @!attribute [rw] new_issue_uri + # @return [::String] + # Link to a *public* URI where users can report issues. Example: + # https://issuetracker.google.com/issues/new?component=190865&template=1161103 + # @!attribute [rw] documentation_uri + # @return [::String] + # Link to product home page. Example: + # https://cloud.google.com/asset-inventory/docs/overview + # @!attribute [rw] api_short_name + # @return [::String] + # Used as a tracking tag when collecting data about the APIs developer + # relations artifacts like docs, packages delivered to package managers, + # etc. Example: "speech". + # @!attribute [rw] github_label + # @return [::String] + # GitHub label to apply to issues and pull requests opened for this API. + # @!attribute [rw] codeowner_github_teams + # @return [::Array<::String>] + # GitHub teams to be added to CODEOWNERS in the directory in GitHub + # containing source code for the client libraries for this API. + # @!attribute [rw] doc_tag_prefix + # @return [::String] + # A prefix used in sample code when demarking regions to be included in + # documentation. + # @!attribute [rw] organization + # @return [::Google::Api::ClientLibraryOrganization] + # For whom the client library is being published. + # @!attribute [rw] library_settings + # @return [::Array<::Google::Api::ClientLibrarySettings>] + # Client library settings. If the same version string appears multiple + # times in this list, then the last one wins. Settings from earlier + # settings with the same version string are discarded. + # @!attribute [rw] proto_reference_documentation_uri + # @return [::String] + # Optional link to proto reference documentation. Example: + # https://cloud.google.com/pubsub/lite/docs/reference/rpc + # @!attribute [rw] rest_reference_documentation_uri + # @return [::String] + # Optional link to REST reference documentation. Example: + # https://cloud.google.com/pubsub/lite/docs/reference/rest + class Publishing + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Settings for Java client libraries. + # @!attribute [rw] library_package + # @return [::String] + # The package name to use in Java. Clobbers the java_package option + # set in the protobuf. This should be used **only** by APIs + # who have already set the language_settings.java.package_name" field + # in gapic.yaml. API teams should use the protobuf java_package option + # where possible. + # + # Example of a YAML configuration:: + # + # publishing: + # 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. + # @!attribute [rw] methods + # @return [::Array<::String>] + # An allowlist of the fully qualified names of RPCs that should be included + # on public client surfaces. + # @!attribute [rw] generate_omitted_as_internal + # @return [::Boolean] + # Setting this to true indicates to the client generators that methods + # that would be excluded from the generation should instead be generated + # in a way that indicates these methods should not be consumed by + # end users. How this is expressed is up to individual language + # implementations to decide. Some examples may be: added annotations, + # obfuscated identifiers, or other language idiomatic patterns. + class SelectiveGapicGeneration + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # `BatchingConfigProto` defines the batching configuration for an API method. + # @!attribute [rw] thresholds + # @return [::Google::Api::BatchingSettingsProto] + # The thresholds which trigger a batched request to be sent. + # @!attribute [rw] batch_descriptor + # @return [::Google::Api::BatchingDescriptorProto] + # The request and response fields used in batching. + class BatchingConfigProto + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # `BatchingSettingsProto` specifies a set of batching thresholds, each of + # which acts as a trigger to send a batch of messages as a request. At least + # one threshold must be positive nonzero. + # @!attribute [rw] element_count_threshold + # @return [::Integer] + # The number of elements of a field collected into a batch which, if + # exceeded, causes the batch to be sent. + # @!attribute [rw] request_byte_threshold + # @return [::Integer] + # The aggregated size of the batched field which, if exceeded, causes the + # batch to be sent. This size is computed by aggregating the sizes of the + # request field to be batched, not of the entire request message. + # @!attribute [rw] delay_threshold + # @return [::Google::Protobuf::Duration] + # The duration after which a batch should be sent, starting from the addition + # of the first message to that batch. + # @!attribute [rw] element_count_limit + # @return [::Integer] + # The maximum number of elements collected in a batch that could be accepted + # by server. + # @!attribute [rw] request_byte_limit + # @return [::Integer] + # The maximum size of the request that could be accepted by server. + # @!attribute [rw] flow_control_element_limit + # @return [::Integer] + # The maximum number of elements allowed by flow control. + # @!attribute [rw] flow_control_byte_limit + # @return [::Integer] + # The maximum size of data allowed by flow control. + # @!attribute [rw] flow_control_limit_exceeded_behavior + # @return [::Google::Api::FlowControlLimitExceededBehaviorProto] + # The behavior to take when the flow control limit is exceeded. + class BatchingSettingsProto + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # `BatchingDescriptorProto` specifies the fields of the request message to be + # used for batching, and, optionally, the fields of the response message to be + # used for demultiplexing. + # @!attribute [rw] batched_field + # @return [::String] + # The repeated field in the request message to be aggregated by batching. + # @!attribute [rw] discriminator_fields + # @return [::Array<::String>] + # A list of the fields in the request message. Two requests will be batched + # together only if the values of every field specified in + # `request_discriminator_fields` is equal between the two requests. + # @!attribute [rw] subresponse_field + # @return [::String] + # Optional. When present, indicates the field in the response message to be + # used to demultiplex the response into multiple response messages, in + # correspondence with the multiple request messages originally batched + # together. + class BatchingDescriptorProto + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # The organization for which the client libraries are being published. + # Affects the url where generated docs are published, etc. + module ClientLibraryOrganization + # Not useful. + CLIENT_LIBRARY_ORGANIZATION_UNSPECIFIED = 0 + + # Google Cloud Platform Org. + CLOUD = 1 + + # Ads (Advertising) Org. + ADS = 2 + + # Photos Org. + PHOTOS = 3 + + # Street View Org. + STREET_VIEW = 4 + + # Shopping Org. + SHOPPING = 5 + + # Geo Org. + GEO = 6 + + # Generative AI - https://developers.generativeai.google + GENERATIVE_AI = 7 + end + + # To where should client libraries be published? + module ClientLibraryDestination + # Client libraries will neither be generated nor published to package + # managers. + CLIENT_LIBRARY_DESTINATION_UNSPECIFIED = 0 + + # Generate the client library in a repo under github.com/googleapis, + # but don't publish it to package managers. + GITHUB = 10 + + # Publish the library to package managers like nuget.org and npmjs.com. + PACKAGE_MANAGER = 20 + end + + # The behavior to take when the flow control limit is exceeded. + module FlowControlLimitExceededBehaviorProto + # Default behavior, system-defined. + UNSET_BEHAVIOR = 0 + + # Stop operation, raise error. + THROW_EXCEPTION = 1 + + # Pause operation until limit clears. + BLOCK = 2 + + # Continue operation, disregard limit. + IGNORE = 3 + end + end +end diff --git a/owl-bot-staging/google-cloud-security-public_ca-v1beta1/proto_docs/google/api/field_behavior.rb b/owl-bot-staging/google-cloud-security-public_ca-v1beta1/proto_docs/google/api/field_behavior.rb new file mode 100644 index 000000000000..582be187d115 --- /dev/null +++ b/owl-bot-staging/google-cloud-security-public_ca-v1beta1/proto_docs/google/api/field_behavior.rb @@ -0,0 +1,85 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + + +module Google + module Api + # An indicator of the behavior of a given field (for example, that a field + # is required in requests, or given as output but ignored as input). + # This **does not** change the behavior in protocol buffers itself; it only + # denotes the behavior and may affect how API tooling handles the field. + # + # Note: This enum **may** receive new values in the future. + module FieldBehavior + # Conventional default for enums. Do not use this. + FIELD_BEHAVIOR_UNSPECIFIED = 0 + + # Specifically denotes a field as optional. + # While all fields in protocol buffers are optional, this may be specified + # for emphasis if appropriate. + OPTIONAL = 1 + + # Denotes a field as required. + # This indicates that the field **must** be provided as part of the request, + # and failure to do so will cause an error (usually `INVALID_ARGUMENT`). + REQUIRED = 2 + + # Denotes a field as output only. + # This indicates that the field is provided in responses, but including the + # field in a request does nothing (the server *must* ignore it and + # *must not* throw an error as a result of the field's presence). + OUTPUT_ONLY = 3 + + # Denotes a field as input only. + # This indicates that the field is provided in requests, and the + # corresponding field is not included in output. + INPUT_ONLY = 4 + + # Denotes a field as immutable. + # This indicates that the field may be set once in a request to create a + # resource, but may not be changed thereafter. + IMMUTABLE = 5 + + # Denotes that a (repeated) field is an unordered list. + # This indicates that the service may provide the elements of the list + # in any arbitrary order, rather than the order the user originally + # provided. Additionally, the list's order may or may not be stable. + UNORDERED_LIST = 6 + + # Denotes that this field returns a non-empty default value if not set. + # This indicates that if the user provides the empty value in a request, + # a non-empty value will be returned. The user will not be aware of what + # non-empty value to expect. + NON_EMPTY_DEFAULT = 7 + + # Denotes that the field in a resource (a message annotated with + # google.api.resource) is used in the resource name to uniquely identify the + # resource. For AIP-compliant APIs, this should only be applied to the + # `name` field on the resource. + # + # This behavior should not be applied to references to other resources within + # the message. + # + # The identifier field of resources often have different field behavior + # depending on the request it is embedded in (e.g. for Create methods name + # is optional and unused, while for Update methods it is required). Instead + # of method-specific annotations, only `IDENTIFIER` is required. + IDENTIFIER = 8 + end + end +end diff --git a/owl-bot-staging/google-cloud-security-public_ca-v1beta1/proto_docs/google/api/launch_stage.rb b/owl-bot-staging/google-cloud-security-public_ca-v1beta1/proto_docs/google/api/launch_stage.rb new file mode 100644 index 000000000000..9392a413fb1b --- /dev/null +++ b/owl-bot-staging/google-cloud-security-public_ca-v1beta1/proto_docs/google/api/launch_stage.rb @@ -0,0 +1,71 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + + +module Google + module Api + # The launch stage as defined by [Google Cloud Platform + # Launch Stages](https://cloud.google.com/terms/launch-stages). + module LaunchStage + # Do not use this default value. + LAUNCH_STAGE_UNSPECIFIED = 0 + + # The feature is not yet implemented. Users can not use it. + UNIMPLEMENTED = 6 + + # Prelaunch features are hidden from users and are only visible internally. + PRELAUNCH = 7 + + # Early Access features are limited to a closed group of testers. To use + # these features, you must sign up in advance and sign a Trusted Tester + # agreement (which includes confidentiality provisions). These features may + # be unstable, changed in backward-incompatible ways, and are not + # guaranteed to be released. + EARLY_ACCESS = 1 + + # Alpha is a limited availability test for releases before they are cleared + # for widespread use. By Alpha, all significant design issues are resolved + # and we are in the process of verifying functionality. Alpha customers + # need to apply for access, agree to applicable terms, and have their + # projects allowlisted. Alpha releases don't have to be feature complete, + # no SLAs are provided, and there are no technical support obligations, but + # they will be far enough along that customers can actually use them in + # test environments or for limited-use tests -- just like they would in + # normal production cases. + ALPHA = 2 + + # Beta is the point at which we are ready to open a release for any + # customer to use. There are no SLA or technical support obligations in a + # Beta release. Products will be complete from a feature perspective, but + # may have some open outstanding issues. Beta releases are suitable for + # limited production use cases. + BETA = 3 + + # GA features are open to all developers and are considered stable and + # fully qualified for production use. + GA = 4 + + # Deprecated features are scheduled to be shut down and removed. For more + # information, see the "Deprecation Policy" section of our [Terms of + # Service](https://cloud.google.com/terms/) + # and the [Google Cloud Platform Subject to the Deprecation + # Policy](https://cloud.google.com/terms/deprecation) documentation. + DEPRECATED = 5 + end + end +end diff --git a/owl-bot-staging/google-cloud-security-public_ca-v1beta1/proto_docs/google/api/resource.rb b/owl-bot-staging/google-cloud-security-public_ca-v1beta1/proto_docs/google/api/resource.rb new file mode 100644 index 000000000000..25dec4847ac1 --- /dev/null +++ b/owl-bot-staging/google-cloud-security-public_ca-v1beta1/proto_docs/google/api/resource.rb @@ -0,0 +1,227 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + + +module Google + module Api + # A simple descriptor of a resource type. + # + # ResourceDescriptor annotates a resource message (either by means of a + # protobuf annotation or use in the service config), and associates the + # resource's schema, the resource type, and the pattern of the resource name. + # + # Example: + # + # message Topic { + # // Indicates this message defines a resource schema. + # // Declares the resource type in the format of {service}/{kind}. + # // For Kubernetes resources, the format is {api group}/{kind}. + # option (google.api.resource) = { + # type: "pubsub.googleapis.com/Topic" + # pattern: "projects/{project}/topics/{topic}" + # }; + # } + # + # The ResourceDescriptor Yaml config will look like: + # + # resources: + # - type: "pubsub.googleapis.com/Topic" + # pattern: "projects/{project}/topics/{topic}" + # + # Sometimes, resources have multiple patterns, typically because they can + # live under multiple parents. + # + # Example: + # + # message LogEntry { + # option (google.api.resource) = { + # type: "logging.googleapis.com/LogEntry" + # pattern: "projects/{project}/logs/{log}" + # pattern: "folders/{folder}/logs/{log}" + # pattern: "organizations/{organization}/logs/{log}" + # pattern: "billingAccounts/{billing_account}/logs/{log}" + # }; + # } + # + # The ResourceDescriptor Yaml config will look like: + # + # resources: + # - type: 'logging.googleapis.com/LogEntry' + # pattern: "projects/{project}/logs/{log}" + # pattern: "folders/{folder}/logs/{log}" + # pattern: "organizations/{organization}/logs/{log}" + # pattern: "billingAccounts/{billing_account}/logs/{log}" + # @!attribute [rw] type + # @return [::String] + # The resource type. It must be in the format of + # \\{service_name}/\\{resource_type_kind}. The `resource_type_kind` must be + # singular and must not include version numbers. + # + # Example: `storage.googleapis.com/Bucket` + # + # The value of the resource_type_kind must follow the regular expression + # /[A-Za-z][a-zA-Z0-9]+/. It should start with an upper case character and + # should use PascalCase (UpperCamelCase). The maximum number of + # characters allowed for the `resource_type_kind` is 100. + # @!attribute [rw] pattern + # @return [::Array<::String>] + # Optional. The relative resource name pattern associated with this resource + # type. The DNS prefix of the full resource name shouldn't be specified here. + # + # The path pattern must follow the syntax, which aligns with HTTP binding + # syntax: + # + # Template = Segment { "/" Segment } ; + # Segment = LITERAL | Variable ; + # Variable = "{" LITERAL "}" ; + # + # Examples: + # + # - "projects/\\{project}/topics/\\{topic}" + # - "projects/\\{project}/knowledgeBases/\\{knowledge_base}" + # + # The components in braces correspond to the IDs for each resource in the + # hierarchy. It is expected that, if multiple patterns are provided, + # the same component name (e.g. "project") refers to IDs of the same + # type of resource. + # @!attribute [rw] name_field + # @return [::String] + # Optional. The field on the resource that designates the resource name + # field. If omitted, this is assumed to be "name". + # @!attribute [rw] history + # @return [::Google::Api::ResourceDescriptor::History] + # Optional. The historical or future-looking state of the resource pattern. + # + # Example: + # + # // The InspectTemplate message originally only supported resource + # // names with organization, and project was added later. + # message InspectTemplate { + # option (google.api.resource) = { + # type: "dlp.googleapis.com/InspectTemplate" + # pattern: + # "organizations/{organization}/inspectTemplates/{inspect_template}" + # pattern: "projects/{project}/inspectTemplates/{inspect_template}" + # history: ORIGINALLY_SINGLE_PATTERN + # }; + # } + # @!attribute [rw] plural + # @return [::String] + # The plural name used in the resource name and permission names, such as + # 'projects' for the resource name of 'projects/\\{project}' and the permission + # name of 'cloudresourcemanager.googleapis.com/projects.get'. One exception + # to this is for Nested Collections that have stuttering names, as defined + # in [AIP-122](https://google.aip.dev/122#nested-collections), where the + # collection ID in the resource name pattern does not necessarily directly + # match the `plural` value. + # + # It is the same concept of the `plural` field in k8s CRD spec + # https://kubernetes.io/docs/tasks/access-kubernetes-api/custom-resources/custom-resource-definitions/ + # + # Note: The plural form is required even for singleton resources. See + # https://aip.dev/156 + # @!attribute [rw] singular + # @return [::String] + # The same concept of the `singular` field in k8s CRD spec + # https://kubernetes.io/docs/tasks/access-kubernetes-api/custom-resources/custom-resource-definitions/ + # Such as "project" for the `resourcemanager.googleapis.com/Project` type. + # @!attribute [rw] style + # @return [::Array<::Google::Api::ResourceDescriptor::Style>] + # Style flag(s) for this resource. + # These indicate that a resource is expected to conform to a given + # style. See the specific style flags for additional information. + class ResourceDescriptor + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # A description of the historical or future-looking state of the + # resource pattern. + module History + # The "unset" value. + HISTORY_UNSPECIFIED = 0 + + # The resource originally had one pattern and launched as such, and + # additional patterns were added later. + ORIGINALLY_SINGLE_PATTERN = 1 + + # The resource has one pattern, but the API owner expects to add more + # later. (This is the inverse of ORIGINALLY_SINGLE_PATTERN, and prevents + # that from being necessary once there are multiple patterns.) + FUTURE_MULTI_PATTERN = 2 + end + + # A flag representing a specific style that a resource claims to conform to. + module Style + # The unspecified value. Do not use. + STYLE_UNSPECIFIED = 0 + + # This resource is intended to be "declarative-friendly". + # + # Declarative-friendly resources must be more strictly consistent, and + # setting this to true communicates to tools that this resource should + # adhere to declarative-friendly expectations. + # + # Note: This is used by the API linter (linter.aip.dev) to enable + # additional checks. + DECLARATIVE_FRIENDLY = 1 + end + end + + # Defines a proto annotation that describes a string field that refers to + # an API resource. + # @!attribute [rw] type + # @return [::String] + # The resource type that the annotated field references. + # + # Example: + # + # message Subscription { + # string topic = 2 [(google.api.resource_reference) = { + # type: "pubsub.googleapis.com/Topic" + # }]; + # } + # + # Occasionally, a field may reference an arbitrary resource. In this case, + # APIs use the special value * in their resource reference. + # + # Example: + # + # message GetIamPolicyRequest { + # string resource = 2 [(google.api.resource_reference) = { + # type: "*" + # }]; + # } + # @!attribute [rw] child_type + # @return [::String] + # The resource type of a child collection that the annotated field + # references. This is useful for annotating the `parent` field that + # doesn't have a fixed resource type. + # + # Example: + # + # message ListLogEntriesRequest { + # string parent = 1 [(google.api.resource_reference) = { + # child_type: "logging.googleapis.com/LogEntry" + # }; + # } + class ResourceReference + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end +end diff --git a/owl-bot-staging/google-cloud-security-public_ca-v1beta1/proto_docs/google/cloud/security/publicca/v1beta1/resources.rb b/owl-bot-staging/google-cloud-security-public_ca-v1beta1/proto_docs/google/cloud/security/publicca/v1beta1/resources.rb new file mode 100644 index 000000000000..33b7199f7982 --- /dev/null +++ b/owl-bot-staging/google-cloud-security-public_ca-v1beta1/proto_docs/google/cloud/security/publicca/v1beta1/resources.rb @@ -0,0 +1,49 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + + +module Google + module Cloud + module Security + module PublicCA + module V1beta1 + # A representation of an ExternalAccountKey used for [external account + # binding](https://tools.ietf.org/html/rfc8555#section-7.3.4) within ACME. + # @!attribute [r] name + # @return [::String] + # Output only. Resource name. + # projects/\\{project}/locations/\\{location}/externalAccountKeys/\\{key_id} + # @!attribute [r] key_id + # @return [::String] + # Output only. Key ID. + # It is generated by the PublicCertificateAuthorityService + # when the ExternalAccountKey is created + # @!attribute [r] b64_mac_key + # @return [::String] + # Output only. Base64-URL-encoded HS256 key. + # It is generated by the PublicCertificateAuthorityService + # when the ExternalAccountKey is created + class ExternalAccountKey + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-security-public_ca-v1beta1/proto_docs/google/cloud/security/publicca/v1beta1/service.rb b/owl-bot-staging/google-cloud-security-public_ca-v1beta1/proto_docs/google/cloud/security/publicca/v1beta1/service.rb new file mode 100644 index 000000000000..6e3cba96d99a --- /dev/null +++ b/owl-bot-staging/google-cloud-security-public_ca-v1beta1/proto_docs/google/cloud/security/publicca/v1beta1/service.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! + + +module Google + module Cloud + module Security + module PublicCA + module V1beta1 + # Creates a new + # {::Google::Cloud::Security::PublicCA::V1beta1::ExternalAccountKey ExternalAccountKey} + # in a given project. + # @!attribute [rw] parent + # @return [::String] + # Required. The parent resource where this external_account_key will be + # created. Format: projects/[project_id]/locations/[location]. At present + # only the "global" location is supported. + # @!attribute [rw] external_account_key + # @return [::Google::Cloud::Security::PublicCA::V1beta1::ExternalAccountKey] + # Required. The external account key to create. This field only exists to + # future-proof the API. At present, all fields in ExternalAccountKey are + # output only and all values are ignored. For the purpose of the + # CreateExternalAccountKeyRequest, set it to a default/empty value. + class CreateExternalAccountKeyRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-security-public_ca-v1beta1/proto_docs/google/protobuf/duration.rb b/owl-bot-staging/google-cloud-security-public_ca-v1beta1/proto_docs/google/protobuf/duration.rb new file mode 100644 index 000000000000..ea59f1f91daf --- /dev/null +++ b/owl-bot-staging/google-cloud-security-public_ca-v1beta1/proto_docs/google/protobuf/duration.rb @@ -0,0 +1,98 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + + +module Google + module Protobuf + # A Duration represents a signed, fixed-length span of time represented + # as a count of seconds and fractions of seconds at nanosecond + # resolution. It is independent of any calendar and concepts like "day" + # or "month". It is related to Timestamp in that the difference between + # two Timestamp values is a Duration and it can be added or subtracted + # from a Timestamp. Range is approximately +-10,000 years. + # + # # Examples + # + # Example 1: Compute Duration from two Timestamps in pseudo code. + # + # Timestamp start = ...; + # Timestamp end = ...; + # Duration duration = ...; + # + # duration.seconds = end.seconds - start.seconds; + # duration.nanos = end.nanos - start.nanos; + # + # if (duration.seconds < 0 && duration.nanos > 0) { + # duration.seconds += 1; + # duration.nanos -= 1000000000; + # } else if (duration.seconds > 0 && duration.nanos < 0) { + # duration.seconds -= 1; + # duration.nanos += 1000000000; + # } + # + # Example 2: Compute Timestamp from Timestamp + Duration in pseudo code. + # + # Timestamp start = ...; + # Duration duration = ...; + # Timestamp end = ...; + # + # end.seconds = start.seconds + duration.seconds; + # end.nanos = start.nanos + duration.nanos; + # + # if (end.nanos < 0) { + # end.seconds -= 1; + # end.nanos += 1000000000; + # } else if (end.nanos >= 1000000000) { + # end.seconds += 1; + # end.nanos -= 1000000000; + # } + # + # Example 3: Compute Duration from datetime.timedelta in Python. + # + # td = datetime.timedelta(days=3, minutes=10) + # duration = Duration() + # duration.FromTimedelta(td) + # + # # JSON Mapping + # + # In JSON format, the Duration type is encoded as a string rather than an + # object, where the string ends in the suffix "s" (indicating seconds) and + # is preceded by the number of seconds, with nanoseconds expressed as + # fractional seconds. For example, 3 seconds with 0 nanoseconds should be + # encoded in JSON format as "3s", while 3 seconds and 1 nanosecond should + # be expressed in JSON format as "3.000000001s", and 3 seconds and 1 + # microsecond should be expressed in JSON format as "3.000001s". + # @!attribute [rw] seconds + # @return [::Integer] + # Signed seconds of the span of time. Must be from -315,576,000,000 + # to +315,576,000,000 inclusive. Note: these bounds are computed from: + # 60 sec/min * 60 min/hr * 24 hr/day * 365.25 days/year * 10000 years + # @!attribute [rw] nanos + # @return [::Integer] + # Signed fractions of a second at nanosecond resolution of the span + # of time. Durations less than one second are represented with a 0 + # `seconds` field and a positive or negative `nanos` field. For durations + # of one second or more, a non-zero value for the `nanos` field must be + # of the same sign as the `seconds` field. Must be from -999,999,999 + # to +999,999,999 inclusive. + class Duration + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end +end diff --git a/owl-bot-staging/google-cloud-security-public_ca-v1beta1/snippets/Gemfile b/owl-bot-staging/google-cloud-security-public_ca-v1beta1/snippets/Gemfile new file mode 100644 index 000000000000..6a4051095df9 --- /dev/null +++ b/owl-bot-staging/google-cloud-security-public_ca-v1beta1/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-security-public_ca-v1beta1", path: "../" +else + gem "google-cloud-security-public_ca-v1beta1" +end + +group :test do + gem "google-style", "~> 1.26.1" + gem "minitest", "~> 5.16" + gem "minitest-focus", "~> 1.1" + gem "minitest-hooks", "~> 1.5" +end diff --git a/owl-bot-staging/google-cloud-security-public_ca-v1beta1/snippets/public_certificate_authority_service/create_external_account_key.rb b/owl-bot-staging/google-cloud-security-public_ca-v1beta1/snippets/public_certificate_authority_service/create_external_account_key.rb new file mode 100644 index 000000000000..0bb4a0e7e161 --- /dev/null +++ b/owl-bot-staging/google-cloud-security-public_ca-v1beta1/snippets/public_certificate_authority_service/create_external_account_key.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 publicca_v1beta1_generated_PublicCertificateAuthorityService_CreateExternalAccountKey_sync] +require "google/cloud/security/public_ca/v1beta1" + +## +# Snippet for the create_external_account_key call in the PublicCertificateAuthorityService service +# +# This snippet has been automatically generated and should be regarded as a code +# template only. It will require modifications to work: +# - It may require correct/in-range values for request initialization. +# - It may require specifying regional endpoints when creating the service +# client as shown in https://cloud.google.com/ruby/docs/reference. +# +# This is an auto-generated example demonstrating basic usage of +# Google::Cloud::Security::PublicCA::V1beta1::PublicCertificateAuthorityService::Client#create_external_account_key. +# +def create_external_account_key + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Security::PublicCA::V1beta1::PublicCertificateAuthorityService::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Security::PublicCA::V1beta1::CreateExternalAccountKeyRequest.new + + # Call the create_external_account_key method. + result = client.create_external_account_key request + + # The returned object is of type Google::Cloud::Security::PublicCA::V1beta1::ExternalAccountKey. + p result +end +# [END publicca_v1beta1_generated_PublicCertificateAuthorityService_CreateExternalAccountKey_sync] diff --git a/owl-bot-staging/google-cloud-security-public_ca-v1beta1/snippets/snippet_metadata_google.cloud.security.publicca.v1beta1.json b/owl-bot-staging/google-cloud-security-public_ca-v1beta1/snippets/snippet_metadata_google.cloud.security.publicca.v1beta1.json new file mode 100644 index 000000000000..ae2a322a235b --- /dev/null +++ b/owl-bot-staging/google-cloud-security-public_ca-v1beta1/snippets/snippet_metadata_google.cloud.security.publicca.v1beta1.json @@ -0,0 +1,55 @@ +{ + "client_library": { + "name": "google-cloud-security-public_ca-v1beta1", + "version": "", + "language": "RUBY", + "apis": [ + { + "id": "google.cloud.security.publicca.v1beta1", + "version": "v1beta1" + } + ] + }, + "snippets": [ + { + "region_tag": "publicca_v1beta1_generated_PublicCertificateAuthorityService_CreateExternalAccountKey_sync", + "title": "Snippet for the create_external_account_key call in the PublicCertificateAuthorityService service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Security::PublicCA::V1beta1::PublicCertificateAuthorityService::Client#create_external_account_key.", + "file": "public_certificate_authority_service/create_external_account_key.rb", + "language": "RUBY", + "client_method": { + "short_name": "create_external_account_key", + "full_name": "::Google::Cloud::Security::PublicCA::V1beta1::PublicCertificateAuthorityService::Client#create_external_account_key", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::Security::PublicCA::V1beta1::CreateExternalAccountKeyRequest", + "name": "request" + } + ], + "result_type": "::Google::Cloud::Security::PublicCA::V1beta1::ExternalAccountKey", + "client": { + "short_name": "PublicCertificateAuthorityService::Client", + "full_name": "::Google::Cloud::Security::PublicCA::V1beta1::PublicCertificateAuthorityService::Client" + }, + "method": { + "short_name": "CreateExternalAccountKey", + "full_name": "google.cloud.security.publicca.v1beta1.PublicCertificateAuthorityService.CreateExternalAccountKey", + "service": { + "short_name": "PublicCertificateAuthorityService", + "full_name": "google.cloud.security.publicca.v1beta1.PublicCertificateAuthorityService" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 46, + "type": "FULL" + } + ] + } + ] +} \ No newline at end of file diff --git a/owl-bot-staging/google-cloud-security-public_ca-v1beta1/test/google/cloud/security/public_ca/v1beta1/public_certificate_authority_service_paths_test.rb b/owl-bot-staging/google-cloud-security-public_ca-v1beta1/test/google/cloud/security/public_ca/v1beta1/public_certificate_authority_service_paths_test.rb new file mode 100644 index 000000000000..b2b32a19a595 --- /dev/null +++ b/owl-bot-staging/google-cloud-security-public_ca-v1beta1/test/google/cloud/security/public_ca/v1beta1/public_certificate_authority_service_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/cloud/security/public_ca/v1beta1/public_certificate_authority_service" + +class ::Google::Cloud::Security::PublicCA::V1beta1::PublicCertificateAuthorityService::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_external_account_key_path + grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + ::Gapic::ServiceStub.stub :new, DummyStub.new do + client = ::Google::Cloud::Security::PublicCA::V1beta1::PublicCertificateAuthorityService::Client.new do |config| + config.credentials = grpc_channel + end + + path = client.external_account_key_path project: "value0", location: "value1", external_account_key: "value2" + assert_equal "projects/value0/locations/value1/externalAccountKeys/value2", path + end + end + + def test_location_path + grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + ::Gapic::ServiceStub.stub :new, DummyStub.new do + client = ::Google::Cloud::Security::PublicCA::V1beta1::PublicCertificateAuthorityService::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 +end diff --git a/owl-bot-staging/google-cloud-security-public_ca-v1beta1/test/google/cloud/security/public_ca/v1beta1/public_certificate_authority_service_rest_test.rb b/owl-bot-staging/google-cloud-security-public_ca-v1beta1/test/google/cloud/security/public_ca/v1beta1/public_certificate_authority_service_rest_test.rb new file mode 100644 index 000000000000..0edc55e0cce5 --- /dev/null +++ b/owl-bot-staging/google-cloud-security-public_ca-v1beta1/test/google/cloud/security/public_ca/v1beta1/public_certificate_authority_service_rest_test.rb @@ -0,0 +1,154 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +require "helper" +require "gapic/rest" +require "google/cloud/security/publicca/v1beta1/service_pb" +require "google/cloud/security/public_ca/v1beta1/public_certificate_authority_service/rest" + + +class ::Google::Cloud::Security::PublicCA::V1beta1::PublicCertificateAuthorityService::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_external_account_key + # Create test objects. + client_result = ::Google::Cloud::Security::PublicCA::V1beta1::ExternalAccountKey.new + http_response = OpenStruct.new body: client_result.to_json + + call_options = {} + + # Create request parameters for a unary method. + parent = "hello world" + external_account_key = {} + + create_external_account_key_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| + assert options.metadata.key? :"x-goog-api-client" + assert options.metadata[:"x-goog-api-client"].include? "rest" + refute options.metadata[:"x-goog-api-client"].include? "grpc" + end + + ::Google::Cloud::Security::PublicCA::V1beta1::PublicCertificateAuthorityService::Rest::ServiceStub.stub :transcode_create_external_account_key_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, create_external_account_key_client_stub do + # Create client + client = ::Google::Cloud::Security::PublicCA::V1beta1::PublicCertificateAuthorityService::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.create_external_account_key({ parent: parent, external_account_key: external_account_key }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.create_external_account_key parent: parent, external_account_key: external_account_key do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.create_external_account_key ::Google::Cloud::Security::PublicCA::V1beta1::CreateExternalAccountKeyRequest.new(parent: parent, external_account_key: external_account_key) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + client.create_external_account_key({ parent: parent, external_account_key: external_account_key }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + client.create_external_account_key(::Google::Cloud::Security::PublicCA::V1beta1::CreateExternalAccountKeyRequest.new(parent: parent, external_account_key: external_account_key), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, create_external_account_key_client_stub.call_count + end + end + end + + def test_configure + credentials_token = :dummy_value + + client = block_config = config = nil + dummy_stub = ClientStub.new nil + Gapic::Rest::ClientStub.stub :new, dummy_stub do + client = ::Google::Cloud::Security::PublicCA::V1beta1::PublicCertificateAuthorityService::Rest::Client.new do |config| + config.credentials = credentials_token + end + end + + config = client.configure do |c| + block_config = c + end + + assert_same block_config, config + assert_kind_of ::Google::Cloud::Security::PublicCA::V1beta1::PublicCertificateAuthorityService::Rest::Client::Configuration, config + end +end diff --git a/owl-bot-staging/google-cloud-security-public_ca-v1beta1/test/google/cloud/security/public_ca/v1beta1/public_certificate_authority_service_test.rb b/owl-bot-staging/google-cloud-security-public_ca-v1beta1/test/google/cloud/security/public_ca/v1beta1/public_certificate_authority_service_test.rb new file mode 100644 index 000000000000..4c998739d2e0 --- /dev/null +++ b/owl-bot-staging/google-cloud-security-public_ca-v1beta1/test/google/cloud/security/public_ca/v1beta1/public_certificate_authority_service_test.rb @@ -0,0 +1,164 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +require "helper" + +require "gapic/grpc/service_stub" + +require "google/cloud/security/publicca/v1beta1/service_pb" +require "google/cloud/security/public_ca/v1beta1/public_certificate_authority_service" + +class ::Google::Cloud::Security::PublicCA::V1beta1::PublicCertificateAuthorityService::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_external_account_key + # Create GRPC objects. + grpc_response = ::Google::Cloud::Security::PublicCA::V1beta1::ExternalAccountKey.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" + external_account_key = {} + + create_external_account_key_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :create_external_account_key, name + assert_kind_of ::Google::Cloud::Security::PublicCA::V1beta1::CreateExternalAccountKeyRequest, request + assert_equal "hello world", request["parent"] + assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::Security::PublicCA::V1beta1::ExternalAccountKey), request["external_account_key"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, create_external_account_key_client_stub do + # Create client + client = ::Google::Cloud::Security::PublicCA::V1beta1::PublicCertificateAuthorityService::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.create_external_account_key({ parent: parent, external_account_key: external_account_key }) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use named arguments + client.create_external_account_key parent: parent, external_account_key: external_account_key do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.create_external_account_key ::Google::Cloud::Security::PublicCA::V1beta1::CreateExternalAccountKeyRequest.new(parent: parent, external_account_key: external_account_key) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use hash object with options + client.create_external_account_key({ parent: parent, external_account_key: external_account_key }, grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object with options + client.create_external_account_key(::Google::Cloud::Security::PublicCA::V1beta1::CreateExternalAccountKeyRequest.new(parent: parent, external_account_key: external_account_key), grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Verify method calls + assert_equal 5, create_external_account_key_client_stub.call_rpc_count + end + end + + def test_configure + grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + + client = block_config = config = nil + dummy_stub = ClientStub.new nil, nil + Gapic::ServiceStub.stub :new, dummy_stub do + client = ::Google::Cloud::Security::PublicCA::V1beta1::PublicCertificateAuthorityService::Client.new do |config| + config.credentials = grpc_channel + end + end + + config = client.configure do |c| + block_config = c + end + + assert_same block_config, config + assert_kind_of ::Google::Cloud::Security::PublicCA::V1beta1::PublicCertificateAuthorityService::Client::Configuration, config + end + + def test_credentials + key = OpenSSL::PKey::RSA.new 2048 + cred_json = { + "private_key" => key.to_pem, + "client_email" => "app@developer.gserviceaccount.com", + "type" => "service_account" + } + key_file = StringIO.new cred_json.to_json + creds = Google::Auth::ServiceAccountCredentials.make_creds({ json_key_io: key_file }) + + dummy_stub = ClientStub.new nil, nil + Gapic::ServiceStub.stub :new, dummy_stub do + client = ::Google::Cloud::Security::PublicCA::V1beta1::PublicCertificateAuthorityService::Client.new do |config| + config.credentials = creds + end + assert_kind_of ::Google::Cloud::Security::PublicCA::V1beta1::PublicCertificateAuthorityService::Client, client + assert_equal creds, client.configure.credentials + end + end +end diff --git a/owl-bot-staging/google-cloud-security-public_ca-v1beta1/test/helper.rb b/owl-bot-staging/google-cloud-security-public_ca-v1beta1/test/helper.rb new file mode 100644 index 000000000000..672b337030e7 --- /dev/null +++ b/owl-bot-staging/google-cloud-security-public_ca-v1beta1/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" diff --git a/owl-bot-staging/google-cloud-security_center-v1/.gitignore b/owl-bot-staging/google-cloud-security_center-v1/.gitignore new file mode 100644 index 000000000000..0135b6bc6cfc --- /dev/null +++ b/owl-bot-staging/google-cloud-security_center-v1/.gitignore @@ -0,0 +1,22 @@ +# Ignore bundler lockfiles +Gemfile.lock +gems.locked + +# Ignore documentation output +doc/* +.yardoc/* + +# Ignore test output +coverage/* + +# Ignore build artifacts +pkg/* + +# Ignore files commonly present in certain dev environments +.vagrant +.DS_STORE +.idea +*.iml + +# Ignore synth output +__pycache__ diff --git a/owl-bot-staging/google-cloud-security_center-v1/.repo-metadata.json b/owl-bot-staging/google-cloud-security_center-v1/.repo-metadata.json new file mode 100644 index 000000000000..1db7926905f8 --- /dev/null +++ b/owl-bot-staging/google-cloud-security_center-v1/.repo-metadata.json @@ -0,0 +1,18 @@ +{ + "api_id": "securitycenter.googleapis.com", + "api_shortname": "securitycenter", + "client_documentation": "https://cloud.google.com/ruby/docs/reference/google-cloud-security_center-v1/latest", + "distribution_name": "google-cloud-security_center-v1", + "is_cloud": true, + "language": "ruby", + "name": "securitycenter", + "name_pretty": "Cloud Security Command Center V1 API", + "product_documentation": "https://cloud.google.com/security-command-center", + "release_level": "unreleased", + "repo": "googleapis/google-cloud-ruby", + "requires_billing": true, + "ruby-cloud-description": "Security Command Center API provides access to temporal views of assets and findings within an organization. Note that google-cloud-security_center-v1 is a version-specific client library. For most uses, we recommend installing the main client library google-cloud-security_center instead. See the readme for more details.", + "ruby-cloud-env-prefix": "SECURITY_CENTER", + "ruby-cloud-product-url": "https://cloud.google.com/security-command-center", + "library_type": "GAPIC_AUTO" +} diff --git a/owl-bot-staging/google-cloud-security_center-v1/.rubocop.yml b/owl-bot-staging/google-cloud-security_center-v1/.rubocop.yml new file mode 100644 index 000000000000..cd91eea56b45 --- /dev/null +++ b/owl-bot-staging/google-cloud-security_center-v1/.rubocop.yml @@ -0,0 +1,33 @@ +inherit_gem: + google-style: google-style.yml + +AllCops: + Exclude: + - "google-cloud-security_center-v1.gemspec" + - "lib/**/*_pb.rb" + - "proto_docs/**/*" + - "test/**/*" + - "acceptance/**/*" + - "samples/acceptance/**/*" + - "Rakefile" + +Layout/LineLength: + Enabled: false +Metrics/AbcSize: + Enabled: false +Metrics/ClassLength: + Enabled: false +Metrics/CyclomaticComplexity: + Enabled: false +Metrics/MethodLength: + Enabled: false +Metrics/ModuleLength: + Enabled: false +Metrics/PerceivedComplexity: + Enabled: false +Naming/AccessorMethodName: + Exclude: + - "snippets/**/*.rb" +Naming/FileName: + Exclude: + - "lib/google-cloud-security_center-v1.rb" diff --git a/owl-bot-staging/google-cloud-security_center-v1/.toys.rb b/owl-bot-staging/google-cloud-security_center-v1/.toys.rb new file mode 100644 index 000000000000..177e22456e8a --- /dev/null +++ b/owl-bot-staging/google-cloud-security_center-v1/.toys.rb @@ -0,0 +1,28 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +toys_version! ">= 0.15.3" + +if ENV["RUBY_COMMON_TOOLS"] + common_tools_dir = File.expand_path ENV["RUBY_COMMON_TOOLS"] + load File.join(common_tools_dir, "toys", "gapic") +else + load_git remote: "https://github.com/googleapis/ruby-common-tools.git", + path: "toys/gapic", + update: true +end diff --git a/owl-bot-staging/google-cloud-security_center-v1/.yardopts b/owl-bot-staging/google-cloud-security_center-v1/.yardopts new file mode 100644 index 000000000000..1a401945abab --- /dev/null +++ b/owl-bot-staging/google-cloud-security_center-v1/.yardopts @@ -0,0 +1,12 @@ +--no-private +--title="Cloud Security Command Center V1 API" +--exclude _pb\.rb$ +--markup markdown +--markup-provider redcarpet + +./lib/**/*.rb +./proto_docs/**/*.rb +- +README.md +LICENSE.md +AUTHENTICATION.md diff --git a/owl-bot-staging/google-cloud-security_center-v1/AUTHENTICATION.md b/owl-bot-staging/google-cloud-security_center-v1/AUTHENTICATION.md new file mode 100644 index 000000000000..ba9af184f351 --- /dev/null +++ b/owl-bot-staging/google-cloud-security_center-v1/AUTHENTICATION.md @@ -0,0 +1,122 @@ +# Authentication + +The recommended way to authenticate to the google-cloud-security_center-v1 library is to use +[Application Default Credentials (ADC)](https://cloud.google.com/docs/authentication/application-default-credentials). +To review all of your authentication options, see [Credentials lookup](#credential-lookup). + +## Quickstart + +The following example shows how to set up authentication for a local development +environment with your user credentials. + +**NOTE:** This method is _not_ recommended for running in production. User credentials +should be used only during development. + +1. [Download and install the Google Cloud CLI](https://cloud.google.com/sdk). +2. Set up a local ADC file with your user credentials: + +```sh +gcloud auth application-default login +``` + +3. Write code as if already authenticated. + +For more information about setting up authentication for a local development environment, see +[Set up Application Default Credentials](https://cloud.google.com/docs/authentication/provide-credentials-adc#local-dev). + +## Credential Lookup + +The google-cloud-security_center-v1 library provides several mechanisms to configure your system. +Generally, using Application Default Credentials to facilitate automatic +credentials discovery is the easist method. But if you need to explicitly specify +credentials, there are several methods available to you. + +Credentials are accepted in the following ways, in the following order or precedence: + +1. Credentials specified in method arguments +2. Credentials specified in configuration +3. Credentials pointed to or included in environment variables +4. Credentials found in local ADC file +5. Credentials returned by the metadata server for the attached service account (GCP) + +### Configuration + +You can configure a path to a JSON credentials file, either for an individual client object or +globally, for all client objects. The JSON file can contain credentials created for +[workload identity federation](https://cloud.google.com/iam/docs/workload-identity-federation), +[workforce identity federation](https://cloud.google.com/iam/docs/workforce-identity-federation), or a +[service account key](https://cloud.google.com/docs/authentication/provide-credentials-adc#local-key). + +Note: Service account keys are a security risk if not managed correctly. You should +[choose a more secure alternative to service account keys](https://cloud.google.com/docs/authentication#auth-decision-tree) +whenever possible. + +To configure a credentials file for an individual client initialization: + +```ruby +require "google/cloud/security_center/v1" + +client = ::Google::Cloud::SecurityCenter::V1::SecurityCenter::Client.new do |config| + config.credentials = "path/to/credentialfile.json" +end +``` + +To configure a credentials file globally for all clients: + +```ruby +require "google/cloud/security_center/v1" + +::Google::Cloud::SecurityCenter::V1::SecurityCenter::Client.configure do |config| + config.credentials = "path/to/credentialfile.json" +end + +client = ::Google::Cloud::SecurityCenter::V1::SecurityCenter::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-security_center-v1 +checks for credentials are: + +* `GOOGLE_CLOUD_CREDENTIALS` - Path to JSON file, or JSON contents +* `GOOGLE_APPLICATION_CREDENTIALS` - Path to JSON file + +```ruby +require "google/cloud/security_center/v1" + +ENV["GOOGLE_APPLICATION_CREDENTIALS"] = "path/to/credentialfile.json" + +client = ::Google::Cloud::SecurityCenter::V1::SecurityCenter::Client.new +``` + +### Local ADC file + +You can set up a local ADC file with your user credentials for authentication during +development. If credentials are not provided in code or in environment variables, +then the local ADC credentials are discovered. + +Follow the steps in [Quickstart](#quickstart) to set up a local ADC file. + +### Google Cloud Platform environments + +When running on Google Cloud Platform (GCP), including Google Compute Engine +(GCE), Google Kubernetes Engine (GKE), Google App Engine (GAE), Google Cloud +Functions (GCF) and Cloud Run, credentials are retrieved from the attached +service account automatically. Code should be written as if already authenticated. + +For more information, see +[Set up ADC for Google Cloud services](https://cloud.google.com/docs/authentication/provide-credentials-adc#attached-sa). diff --git a/owl-bot-staging/google-cloud-security_center-v1/CHANGELOG.md b/owl-bot-staging/google-cloud-security_center-v1/CHANGELOG.md new file mode 100644 index 000000000000..f88957a62ba2 --- /dev/null +++ b/owl-bot-staging/google-cloud-security_center-v1/CHANGELOG.md @@ -0,0 +1,2 @@ +# Release History + diff --git a/owl-bot-staging/google-cloud-security_center-v1/Gemfile b/owl-bot-staging/google-cloud-security_center-v1/Gemfile new file mode 100644 index 000000000000..1d08558908d8 --- /dev/null +++ b/owl-bot-staging/google-cloud-security_center-v1/Gemfile @@ -0,0 +1,14 @@ +source "https://rubygems.org" + +gemspec + +gem "google-style", "~> 1.32.0" +gem "irb", "~> 1.17" +gem "minitest", "~> 6.0.2" +gem "minitest-focus", "~> 1.4" +gem "minitest-mock", "~> 5.27" +gem "minitest-rg", "~> 5.3" +gem "ostruct", "~> 0.5.5" +gem "rake", ">= 13.0" +gem "redcarpet", "~> 3.6" +gem "yard", "~> 0.9" diff --git a/owl-bot-staging/google-cloud-security_center-v1/LICENSE.md b/owl-bot-staging/google-cloud-security_center-v1/LICENSE.md new file mode 100644 index 000000000000..c261857ba6ad --- /dev/null +++ b/owl-bot-staging/google-cloud-security_center-v1/LICENSE.md @@ -0,0 +1,201 @@ + Apache License + Version 2.0, January 2004 + http://www.apache.org/licenses/ + + TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION + + 1. Definitions. + + "License" shall mean the terms and conditions for use, reproduction, + and distribution as defined by Sections 1 through 9 of this document. + + "Licensor" shall mean the copyright owner or entity authorized by + the copyright owner that is granting the License. + + "Legal Entity" shall mean the union of the acting entity and all + other entities that control, are controlled by, or are under common + control with that entity. For the purposes of this definition, + "control" means (i) the power, direct or indirect, to cause the + direction or management of such entity, whether by contract or + otherwise, or (ii) ownership of fifty percent (50%) or more of the + outstanding shares, or (iii) beneficial ownership of such entity. + + "You" (or "Your") shall mean an individual or Legal Entity + exercising permissions granted by this License. + + "Source" form shall mean the preferred form for making modifications, + including but not limited to software source code, documentation + source, and configuration files. + + "Object" form shall mean any form resulting from mechanical + transformation or translation of a Source form, including but + not limited to compiled object code, generated documentation, + and conversions to other media types. + + "Work" shall mean the work of authorship, whether in Source or + Object form, made available under the License, as indicated by a + copyright notice that is included in or attached to the work + (an example is provided in the Appendix below). + + "Derivative Works" shall mean any work, whether in Source or Object + form, that is based on (or derived from) the Work and for which the + editorial revisions, annotations, elaborations, or other modifications + represent, as a whole, an original work of authorship. For the purposes + of this License, Derivative Works shall not include works that remain + separable from, or merely link (or bind by name) to the interfaces of, + the Work and Derivative Works thereof. + + "Contribution" shall mean any work of authorship, including + the original version of the Work and any modifications or additions + to that Work or Derivative Works thereof, that is intentionally + submitted to Licensor for inclusion in the Work by the copyright owner + or by an individual or Legal Entity authorized to submit on behalf of + the copyright owner. For the purposes of this definition, "submitted" + means any form of electronic, verbal, or written communication sent + to the Licensor or its representatives, including but not limited to + communication on electronic mailing lists, source code control systems, + and issue tracking systems that are managed by, or on behalf of, the + Licensor for the purpose of discussing and improving the Work, but + excluding communication that is conspicuously marked or otherwise + designated in writing by the copyright owner as "Not a Contribution." + + "Contributor" shall mean Licensor and any individual or Legal Entity + on behalf of whom a Contribution has been received by Licensor and + subsequently incorporated within the Work. + + 2. Grant of Copyright License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + copyright license to reproduce, prepare Derivative Works of, + publicly display, publicly perform, sublicense, and distribute the + Work and such Derivative Works in Source or Object form. + + 3. Grant of Patent License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + (except as stated in this section) patent license to make, have made, + use, offer to sell, sell, import, and otherwise transfer the Work, + where such license applies only to those patent claims licensable + by such Contributor that are necessarily infringed by their + Contribution(s) alone or by combination of their Contribution(s) + with the Work to which such Contribution(s) was submitted. If You + institute patent litigation against any entity (including a + cross-claim or counterclaim in a lawsuit) alleging that the Work + or a Contribution incorporated within the Work constitutes direct + or contributory patent infringement, then any patent licenses + granted to You under this License for that Work shall terminate + as of the date such litigation is filed. + + 4. Redistribution. You may reproduce and distribute copies of the + Work or Derivative Works thereof in any medium, with or without + modifications, and in Source or Object form, provided that You + meet the following conditions: + + (a) You must give any other recipients of the Work or + Derivative Works a copy of this License; and + + (b) You must cause any modified files to carry prominent notices + stating that You changed the files; and + + (c) You must retain, in the Source form of any Derivative Works + that You distribute, all copyright, patent, trademark, and + attribution notices from the Source form of the Work, + excluding those notices that do not pertain to any part of + the Derivative Works; and + + (d) If the Work includes a "NOTICE" text file as part of its + distribution, then any Derivative Works that You distribute must + include a readable copy of the attribution notices contained + within such NOTICE file, excluding those notices that do not + pertain to any part of the Derivative Works, in at least one + of the following places: within a NOTICE text file distributed + as part of the Derivative Works; within the Source form or + documentation, if provided along with the Derivative Works; or, + within a display generated by the Derivative Works, if and + wherever such third-party notices normally appear. The contents + of the NOTICE file are for informational purposes only and + do not modify the License. You may add Your own attribution + notices within Derivative Works that You distribute, alongside + or as an addendum to the NOTICE text from the Work, provided + that such additional attribution notices cannot be construed + as modifying the License. + + You may add Your own copyright statement to Your modifications and + may provide additional or different license terms and conditions + for use, reproduction, or distribution of Your modifications, or + for any such Derivative Works as a whole, provided Your use, + reproduction, and distribution of the Work otherwise complies with + the conditions stated in this License. + + 5. Submission of Contributions. Unless You explicitly state otherwise, + any Contribution intentionally submitted for inclusion in the Work + by You to the Licensor shall be under the terms and conditions of + this License, without any additional terms or conditions. + Notwithstanding the above, nothing herein shall supersede or modify + the terms of any separate license agreement you may have executed + with Licensor regarding such Contributions. + + 6. Trademarks. This License does not grant permission to use the trade + names, trademarks, service marks, or product names of the Licensor, + except as required for reasonable and customary use in describing the + origin of the Work and reproducing the content of the NOTICE file. + + 7. Disclaimer of Warranty. Unless required by applicable law or + agreed to in writing, Licensor provides the Work (and each + Contributor provides its Contributions) on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or + implied, including, without limitation, any warranties or conditions + of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A + PARTICULAR PURPOSE. You are solely responsible for determining the + appropriateness of using or redistributing the Work and assume any + risks associated with Your exercise of permissions under this License. + + 8. Limitation of Liability. In no event and under no legal theory, + whether in tort (including negligence), contract, or otherwise, + unless required by applicable law (such as deliberate and grossly + negligent acts) or agreed to in writing, shall any Contributor be + liable to You for damages, including any direct, indirect, special, + incidental, or consequential damages of any character arising as a + result of this License or out of the use or inability to use the + Work (including but not limited to damages for loss of goodwill, + work stoppage, computer failure or malfunction, or any and all + other commercial damages or losses), even if such Contributor + has been advised of the possibility of such damages. + + 9. Accepting Warranty or Additional Liability. While redistributing + the Work or Derivative Works thereof, You may choose to offer, + and charge a fee for, acceptance of support, warranty, indemnity, + or other liability obligations and/or rights consistent with this + License. However, in accepting such obligations, You may act only + on Your own behalf and on Your sole responsibility, not on behalf + of any other Contributor, and only if You agree to indemnify, + defend, and hold each Contributor harmless for any liability + incurred by, or claims asserted against, such Contributor by reason + of your accepting any such warranty or additional liability. + + END OF TERMS AND CONDITIONS + + APPENDIX: How to apply the Apache License to your work. + + To apply the Apache License to your work, attach the following + boilerplate notice, with the fields enclosed by brackets "[]" + replaced with your own identifying information. (Don't include + the brackets!) The text should be enclosed in the appropriate + comment syntax for the file format. We also recommend that a + file or class name and description of purpose be included on the + same "printed page" as the copyright notice for easier + identification within third-party archives. + + Copyright [yyyy] [name of copyright owner] + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. diff --git a/owl-bot-staging/google-cloud-security_center-v1/README.md b/owl-bot-staging/google-cloud-security_center-v1/README.md new file mode 100644 index 000000000000..31112eac75be --- /dev/null +++ b/owl-bot-staging/google-cloud-security_center-v1/README.md @@ -0,0 +1,153 @@ +# Ruby Client for the Cloud Security Command Center V1 API + +Security Command Center API provides access to temporal views of assets and findings within an organization. + + +https://github.com/googleapis/google-cloud-ruby + +This gem is a _versioned_ client. It provides basic client classes for a +specific version of the Cloud Security Command Center V1 API. Most users should consider using +the main client gem, +[google-cloud-security_center](https://rubygems.org/gems/google-cloud-security_center). +See the section below titled *Which client should I use?* for more information. + +## Installation + +``` +$ gem install google-cloud-security_center-v1 +``` + +## Before You Begin + +In order to use this library, you first need to go through the following steps: + +1. [Select or create a Cloud Platform project.](https://console.cloud.google.com/project) +1. [Enable billing for your project.](https://cloud.google.com/billing/docs/how-to/modify-project#enable_billing_for_a_project) +1. [Enable the API.](https://console.cloud.google.com/apis/library/securitycenter.googleapis.com) +1. [Set up authentication.](AUTHENTICATION.md) + +## Quick Start + +```ruby +require "google/cloud/security_center/v1" + +client = ::Google::Cloud::SecurityCenter::V1::SecurityCenter::Client.new +request = ::Google::Cloud::SecurityCenter::V1::BulkMuteFindingsRequest.new # (request fields as keyword arguments...) +response = client.bulk_mute_findings request +``` + +View the [Client Library Documentation](https://cloud.google.com/ruby/docs/reference/google-cloud-security_center-v1/latest) +for class and method documentation. + +See also the [Product Documentation](https://cloud.google.com/security-command-center) +for general usage information. + +## Debug Logging + +This library comes with opt-in Debug Logging that can help you troubleshoot +your application's integration with the API. When logging is activated, key +events such as requests and responses, along with data payloads and metadata +such as headers and client configuration, are logged to the standard error +stream. + +**WARNING:** Client Library Debug Logging includes your data payloads in +plaintext, which could include sensitive data such as PII for yourself or your +customers, private keys, or other security data that could be compromising if +leaked. Always practice good data hygiene with your application logs, and follow +the principle of least access. Google also recommends that Client Library Debug +Logging be enabled only temporarily during active debugging, and not used +permanently in production. + +To enable logging, set the environment variable `GOOGLE_SDK_RUBY_LOGGING_GEMS` +to the value `all`. Alternatively, you can set the value to a comma-delimited +list of client library gem names. This will select the default logging behavior, +which writes logs to the standard error stream. On a local workstation, this may +result in logs appearing on the console. When running on a Google Cloud hosting +service such as [Google Cloud Run](https://cloud.google.com/run), this generally +results in logs appearing alongside your application logs in the +[Google Cloud Logging](https://cloud.google.com/logging/) service. + +You can customize logging by modifying the `logger` configuration when +constructing a client object. For example: + +```ruby +require "google/cloud/security_center/v1" +require "logger" + +client = ::Google::Cloud::SecurityCenter::V1::SecurityCenter::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-security_center`, +and lower-level _versioned_ client libraries with names such as +`google-cloud-security_center-v1`. +_In most cases, you should install the main client._ + +### What's the difference between the main client and a versioned client? + +A _versioned client_ provides a basic set of data types and client classes for +a _single version_ of a specific service. (That is, for a service with multiple +versions, there might be a separate versioned client for each service version.) +Most versioned clients are written and maintained by a code generator. + +The _main client_ is designed to provide you with the _recommended_ client +interfaces for the service. There will be only one main client for any given +service, even a service with multiple versions. The main client includes +factory methods for constructing the client objects we recommend for most +users. In some cases, those will be classes provided by an underlying versioned +client; in other cases, they will be handwritten higher-level client objects +with additional capabilities, convenience methods, or best practices built in. +Generally, the main client will default to a recommended service version, +although in some cases you can override this if you need to talk to a specific +service version. + +### Why would I want to use the main client? + +We recommend that most users install the main client gem for a service. You can +identify this gem as the one _without_ a version in its name, e.g. +`google-cloud-security_center`. +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-security_center-v1`. + +### What about the google-apis- clients? + +Client library gems with names that begin with `google-apis-` are based on an +older code generation technology. They talk to a REST/JSON backend (whereas +most modern clients talk to a [gRPC](https://grpc.io/) backend) and they may +not offer the same performance, features, and ease of use provided by more +modern clients. + +The `google-apis-` clients have wide coverage across Google services, so you +might need to use one if there is no modern client available for the service. +However, if a modern client is available, we generally recommend it over the +older `google-apis-` clients. diff --git a/owl-bot-staging/google-cloud-security_center-v1/Rakefile b/owl-bot-staging/google-cloud-security_center-v1/Rakefile new file mode 100644 index 000000000000..11860dec5013 --- /dev/null +++ b/owl-bot-staging/google-cloud-security_center-v1/Rakefile @@ -0,0 +1,169 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +require "bundler/setup" +require "bundler/gem_tasks" + +require "rubocop/rake_task" +RuboCop::RakeTask.new + +require "rake/testtask" +desc "Run tests." +Rake::TestTask.new do |t| + t.libs << "test" + t.test_files = FileList["test/**/*_test.rb"] + t.warning = false +end + +desc "Runs the smoke tests." +Rake::TestTask.new :smoke_test do |t| + t.test_files = FileList["acceptance/**/*smoke_test.rb"] + t.warning = false +end + +# Acceptance tests +desc "Run the google-cloud-security_center-v1 acceptance tests." +task :acceptance, :project, :keyfile do |t, args| + project = args[:project] + project ||= + ENV["SECURITY_CENTER_TEST_PROJECT"] || + ENV["GCLOUD_TEST_PROJECT"] + keyfile = args[:keyfile] + keyfile ||= + ENV["SECURITY_CENTER_TEST_KEYFILE"] || + ENV["GCLOUD_TEST_KEYFILE"] + if keyfile + keyfile = File.read keyfile + else + keyfile ||= + ENV["SECURITY_CENTER_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 SECURITY_CENTER_TEST_PROJECT=test123 SECURITY_CENTER_TEST_KEYFILE=/path/to/keyfile.json rake acceptance" + end + require "google/cloud/security_center/v1/security_center/credentials" + ::Google::Cloud::SecurityCenter::V1::SecurityCenter::Credentials.env_vars.each do |path| + ENV[path] = nil + end + ENV["SECURITY_CENTER_PROJECT"] = project + ENV["SECURITY_CENTER_TEST_PROJECT"] = project + ENV["SECURITY_CENTER_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-security_center-v1 gem has no acceptance tests." + end + end + + desc "Run acceptance cleanup." + task :cleanup do + end +end + +task :samples do + Rake::Task["samples:latest"].invoke +end + +namespace :samples do + task :latest do + if File.directory? "samples" + Dir.chdir "samples" do + Bundler.with_clean_env do + ENV["GOOGLE_CLOUD_SAMPLES_TEST"] = "not_master" + sh "bundle update" + sh "bundle exec rake test" + end + end + else + puts "The google-cloud-security_center-v1 gem has no samples to test." + end + end + + task :master do + if File.directory? "samples" + Dir.chdir "samples" do + Bundler.with_clean_env do + ENV["GOOGLE_CLOUD_SAMPLES_TEST"] = "master" + sh "bundle update" + sh "bundle exec rake test" + end + end + else + puts "The google-cloud-security_center-v1 gem has no samples to test." + end + end +end + +require "yard" +require "yard/rake/yardoc_task" +YARD::Rake::YardocTask.new do |y| + y.options << "--fail-on-warning" +end + +desc "Run yard-doctest example tests." +task :doctest do + puts "The google-cloud-security_center-v1 gem does not have doctest tests." +end + +desc "Run the CI build" +task :ci do + header "BUILDING google-cloud-security_center-v1" + header "google-cloud-security_center-v1 rubocop", "*" + Rake::Task[:rubocop].invoke + header "google-cloud-security_center-v1 yard", "*" + Rake::Task[:yard].invoke + header "google-cloud-security_center-v1 test", "*" + Rake::Task[:test].invoke +end + +namespace :ci do + desc "Run the CI build, with smoke tests." + task :smoke_test do + Rake::Task[:ci].invoke + header "google-cloud-security_center-v1 smoke_test", "*" + Rake::Task[:smoke_test].invoke + end + desc "Run the CI build, with acceptance tests." + task :acceptance do + Rake::Task[:ci].invoke + header "google-cloud-security_center-v1 acceptance", "*" + Rake::Task[:acceptance].invoke + end + task :a do + # This is a handy shortcut to save typing + Rake::Task["ci:acceptance"].invoke + end +end + +task default: :test + +def header str, token = "#" + line_length = str.length + 8 + puts "" + puts token * line_length + puts "#{token * 3} #{str} #{token * 3}" + puts token * line_length + puts "" +end diff --git a/owl-bot-staging/google-cloud-security_center-v1/gapic_metadata.json b/owl-bot-staging/google-cloud-security_center-v1/gapic_metadata.json new file mode 100644 index 000000000000..2a9d62ebb4ad --- /dev/null +++ b/owl-bot-staging/google-cloud-security_center-v1/gapic_metadata.json @@ -0,0 +1,333 @@ +{ + "schema": "1.0", + "comment": "This file maps proto services/RPCs to the corresponding library clients/methods", + "language": "ruby", + "protoPackage": "google.cloud.securitycenter.v1", + "libraryPackage": "::Google::Cloud::SecurityCenter::V1", + "services": { + "SecurityCenter": { + "clients": { + "grpc": { + "libraryClient": "::Google::Cloud::SecurityCenter::V1::SecurityCenter::Client", + "rpcs": { + "BulkMuteFindings": { + "methods": [ + "bulk_mute_findings" + ] + }, + "CreateSecurityHealthAnalyticsCustomModule": { + "methods": [ + "create_security_health_analytics_custom_module" + ] + }, + "CreateSource": { + "methods": [ + "create_source" + ] + }, + "CreateFinding": { + "methods": [ + "create_finding" + ] + }, + "CreateMuteConfig": { + "methods": [ + "create_mute_config" + ] + }, + "CreateNotificationConfig": { + "methods": [ + "create_notification_config" + ] + }, + "DeleteMuteConfig": { + "methods": [ + "delete_mute_config" + ] + }, + "DeleteNotificationConfig": { + "methods": [ + "delete_notification_config" + ] + }, + "DeleteSecurityHealthAnalyticsCustomModule": { + "methods": [ + "delete_security_health_analytics_custom_module" + ] + }, + "GetSimulation": { + "methods": [ + "get_simulation" + ] + }, + "GetValuedResource": { + "methods": [ + "get_valued_resource" + ] + }, + "GetBigQueryExport": { + "methods": [ + "get_big_query_export" + ] + }, + "GetIamPolicy": { + "methods": [ + "get_iam_policy" + ] + }, + "GetMuteConfig": { + "methods": [ + "get_mute_config" + ] + }, + "GetNotificationConfig": { + "methods": [ + "get_notification_config" + ] + }, + "GetOrganizationSettings": { + "methods": [ + "get_organization_settings" + ] + }, + "GetEffectiveSecurityHealthAnalyticsCustomModule": { + "methods": [ + "get_effective_security_health_analytics_custom_module" + ] + }, + "GetSecurityHealthAnalyticsCustomModule": { + "methods": [ + "get_security_health_analytics_custom_module" + ] + }, + "GetSource": { + "methods": [ + "get_source" + ] + }, + "GroupAssets": { + "methods": [ + "group_assets" + ] + }, + "GroupFindings": { + "methods": [ + "group_findings" + ] + }, + "ListAssets": { + "methods": [ + "list_assets" + ] + }, + "ListDescendantSecurityHealthAnalyticsCustomModules": { + "methods": [ + "list_descendant_security_health_analytics_custom_modules" + ] + }, + "ListFindings": { + "methods": [ + "list_findings" + ] + }, + "ListMuteConfigs": { + "methods": [ + "list_mute_configs" + ] + }, + "ListNotificationConfigs": { + "methods": [ + "list_notification_configs" + ] + }, + "ListEffectiveSecurityHealthAnalyticsCustomModules": { + "methods": [ + "list_effective_security_health_analytics_custom_modules" + ] + }, + "ListSecurityHealthAnalyticsCustomModules": { + "methods": [ + "list_security_health_analytics_custom_modules" + ] + }, + "ListSources": { + "methods": [ + "list_sources" + ] + }, + "RunAssetDiscovery": { + "methods": [ + "run_asset_discovery" + ] + }, + "SetFindingState": { + "methods": [ + "set_finding_state" + ] + }, + "SetMute": { + "methods": [ + "set_mute" + ] + }, + "SetIamPolicy": { + "methods": [ + "set_iam_policy" + ] + }, + "TestIamPermissions": { + "methods": [ + "test_iam_permissions" + ] + }, + "SimulateSecurityHealthAnalyticsCustomModule": { + "methods": [ + "simulate_security_health_analytics_custom_module" + ] + }, + "UpdateExternalSystem": { + "methods": [ + "update_external_system" + ] + }, + "UpdateFinding": { + "methods": [ + "update_finding" + ] + }, + "UpdateMuteConfig": { + "methods": [ + "update_mute_config" + ] + }, + "UpdateNotificationConfig": { + "methods": [ + "update_notification_config" + ] + }, + "UpdateOrganizationSettings": { + "methods": [ + "update_organization_settings" + ] + }, + "UpdateSecurityHealthAnalyticsCustomModule": { + "methods": [ + "update_security_health_analytics_custom_module" + ] + }, + "UpdateSource": { + "methods": [ + "update_source" + ] + }, + "UpdateSecurityMarks": { + "methods": [ + "update_security_marks" + ] + }, + "CreateBigQueryExport": { + "methods": [ + "create_big_query_export" + ] + }, + "DeleteBigQueryExport": { + "methods": [ + "delete_big_query_export" + ] + }, + "UpdateBigQueryExport": { + "methods": [ + "update_big_query_export" + ] + }, + "ListBigQueryExports": { + "methods": [ + "list_big_query_exports" + ] + }, + "CreateEventThreatDetectionCustomModule": { + "methods": [ + "create_event_threat_detection_custom_module" + ] + }, + "DeleteEventThreatDetectionCustomModule": { + "methods": [ + "delete_event_threat_detection_custom_module" + ] + }, + "GetEventThreatDetectionCustomModule": { + "methods": [ + "get_event_threat_detection_custom_module" + ] + }, + "ListDescendantEventThreatDetectionCustomModules": { + "methods": [ + "list_descendant_event_threat_detection_custom_modules" + ] + }, + "ListEventThreatDetectionCustomModules": { + "methods": [ + "list_event_threat_detection_custom_modules" + ] + }, + "UpdateEventThreatDetectionCustomModule": { + "methods": [ + "update_event_threat_detection_custom_module" + ] + }, + "ValidateEventThreatDetectionCustomModule": { + "methods": [ + "validate_event_threat_detection_custom_module" + ] + }, + "GetEffectiveEventThreatDetectionCustomModule": { + "methods": [ + "get_effective_event_threat_detection_custom_module" + ] + }, + "ListEffectiveEventThreatDetectionCustomModules": { + "methods": [ + "list_effective_event_threat_detection_custom_modules" + ] + }, + "BatchCreateResourceValueConfigs": { + "methods": [ + "batch_create_resource_value_configs" + ] + }, + "DeleteResourceValueConfig": { + "methods": [ + "delete_resource_value_config" + ] + }, + "GetResourceValueConfig": { + "methods": [ + "get_resource_value_config" + ] + }, + "ListResourceValueConfigs": { + "methods": [ + "list_resource_value_configs" + ] + }, + "UpdateResourceValueConfig": { + "methods": [ + "update_resource_value_config" + ] + }, + "ListValuedResources": { + "methods": [ + "list_valued_resources" + ] + }, + "ListAttackPaths": { + "methods": [ + "list_attack_paths" + ] + } + } + } + } + } + } +} diff --git a/owl-bot-staging/google-cloud-security_center-v1/google-cloud-security_center-v1.gemspec b/owl-bot-staging/google-cloud-security_center-v1/google-cloud-security_center-v1.gemspec new file mode 100644 index 000000000000..2ea1431c6518 --- /dev/null +++ b/owl-bot-staging/google-cloud-security_center-v1/google-cloud-security_center-v1.gemspec @@ -0,0 +1,29 @@ +# -*- ruby -*- +# encoding: utf-8 + +require File.expand_path("lib/google/cloud/security_center/v1/version", __dir__) + +Gem::Specification.new do |gem| + gem.name = "google-cloud-security_center-v1" + gem.version = Google::Cloud::SecurityCenter::V1::VERSION + + gem.authors = ["Google LLC"] + gem.email = "googleapis-packages@google.com" + gem.description = "Security Command Center API provides access to temporal views of assets and findings within an organization. Note that google-cloud-security_center-v1 is a version-specific client library. For most uses, we recommend installing the main client library google-cloud-security_center instead. See the readme for more details." + gem.summary = "Security Command Center API provides access to temporal views of assets and findings within an organization." + 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 "grpc-google-iam-v1", "~> 1.11" +end diff --git a/owl-bot-staging/google-cloud-security_center-v1/lib/google-cloud-security_center-v1.rb b/owl-bot-staging/google-cloud-security_center-v1/lib/google-cloud-security_center-v1.rb new file mode 100644 index 000000000000..b1f8c90a70d9 --- /dev/null +++ b/owl-bot-staging/google-cloud-security_center-v1/lib/google-cloud-security_center-v1.rb @@ -0,0 +1,21 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +# This gem does not autoload during Bundler.require. To load this gem, +# issue explicit require statements for the packages desired, e.g.: +# require "google/cloud/security_center/v1" diff --git a/owl-bot-staging/google-cloud-security_center-v1/lib/google/cloud/security_center/v1.rb b/owl-bot-staging/google-cloud-security_center-v1/lib/google/cloud/security_center/v1.rb new file mode 100644 index 000000000000..64e25fbd3ded --- /dev/null +++ b/owl-bot-staging/google-cloud-security_center-v1/lib/google/cloud/security_center/v1.rb @@ -0,0 +1,45 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +require "google/cloud/security_center/v1/security_center" +require "google/cloud/security_center/v1/version" + +module Google + module Cloud + module SecurityCenter + ## + # API client module. + # + # @example Load this package, including all its services, and instantiate a gRPC client + # + # require "google/cloud/security_center/v1" + # client = ::Google::Cloud::SecurityCenter::V1::SecurityCenter::Client.new + # + # @example Load this package, including all its services, and instantiate a REST client + # + # require "google/cloud/security_center/v1" + # client = ::Google::Cloud::SecurityCenter::V1::SecurityCenter::Rest::Client.new + # + module V1 + end + end + end +end + +helper_path = ::File.join __dir__, "v1", "_helpers.rb" +require "google/cloud/security_center/v1/_helpers" if ::File.file? helper_path diff --git a/owl-bot-staging/google-cloud-security_center-v1/lib/google/cloud/security_center/v1/rest.rb b/owl-bot-staging/google-cloud-security_center-v1/lib/google/cloud/security_center/v1/rest.rb new file mode 100644 index 000000000000..c11148195761 --- /dev/null +++ b/owl-bot-staging/google-cloud-security_center-v1/lib/google/cloud/security_center/v1/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/cloud/security_center/v1/security_center/rest" +require "google/cloud/security_center/v1/version" + +module Google + module Cloud + module SecurityCenter + ## + # To load just the REST part of this package, including all its services, and instantiate a REST client: + # + # @example + # + # require "google/cloud/security_center/v1/rest" + # client = ::Google::Cloud::SecurityCenter::V1::SecurityCenter::Rest::Client.new + # + module V1 + end + end + end +end diff --git a/owl-bot-staging/google-cloud-security_center-v1/lib/google/cloud/security_center/v1/security_center.rb b/owl-bot-staging/google-cloud-security_center-v1/lib/google/cloud/security_center/v1/security_center.rb new file mode 100644 index 000000000000..20883d6fbc43 --- /dev/null +++ b/owl-bot-staging/google-cloud-security_center-v1/lib/google/cloud/security_center/v1/security_center.rb @@ -0,0 +1,56 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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/security_center/v1/version" + +require "google/cloud/security_center/v1/security_center/credentials" +require "google/cloud/security_center/v1/security_center/paths" +require "google/cloud/security_center/v1/security_center/operations" +require "google/cloud/security_center/v1/security_center/client" +require "google/cloud/security_center/v1/security_center/rest" + +module Google + module Cloud + module SecurityCenter + module V1 + ## + # V1 APIs for Security Center service. + # + # @example Load this service and instantiate a gRPC client + # + # require "google/cloud/security_center/v1/security_center" + # client = ::Google::Cloud::SecurityCenter::V1::SecurityCenter::Client.new + # + # @example Load this service and instantiate a REST client + # + # require "google/cloud/security_center/v1/security_center/rest" + # client = ::Google::Cloud::SecurityCenter::V1::SecurityCenter::Rest::Client.new + # + module SecurityCenter + end + end + end + end +end + +helper_path = ::File.join __dir__, "security_center", "helpers.rb" +require "google/cloud/security_center/v1/security_center/helpers" if ::File.file? helper_path diff --git a/owl-bot-staging/google-cloud-security_center-v1/lib/google/cloud/security_center/v1/security_center/client.rb b/owl-bot-staging/google-cloud-security_center-v1/lib/google/cloud/security_center/v1/security_center/client.rb new file mode 100644 index 000000000000..e616499f5121 --- /dev/null +++ b/owl-bot-staging/google-cloud-security_center-v1/lib/google/cloud/security_center/v1/security_center/client.rb @@ -0,0 +1,7458 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +require "google/cloud/errors" +require "google/cloud/securitycenter/v1/securitycenter_service_pb" + +module Google + module Cloud + module SecurityCenter + module V1 + module SecurityCenter + ## + # Client for the SecurityCenter service. + # + # V1 APIs for Security Center service. + # + class Client + # @private + API_VERSION = "" + + # @private + DEFAULT_ENDPOINT_TEMPLATE = "securitycenter.$UNIVERSE_DOMAIN$" + + include Paths + + # @private + attr_reader :security_center_stub + + ## + # Configure the SecurityCenter Client class. + # + # See {::Google::Cloud::SecurityCenter::V1::SecurityCenter::Client::Configuration} + # for a description of the configuration fields. + # + # @example + # + # # Modify the configuration for all SecurityCenter clients + # ::Google::Cloud::SecurityCenter::V1::SecurityCenter::Client.configure do |config| + # config.timeout = 10.0 + # end + # + # @yield [config] Configure the Client client. + # @yieldparam config [Client::Configuration] + # + # @return [Client::Configuration] + # + def self.configure + @configure ||= begin + namespace = ["Google", "Cloud", "SecurityCenter", "V1"] + parent_config = while namespace.any? + parent_name = namespace.join "::" + parent_const = const_get parent_name + break parent_const.configure if parent_const.respond_to? :configure + namespace.pop + end + default_config = Client::Configuration.new parent_config + + default_config.rpcs.create_security_health_analytics_custom_module.timeout = 60.0 + + default_config.rpcs.create_source.timeout = 60.0 + + default_config.rpcs.create_finding.timeout = 60.0 + + default_config.rpcs.create_notification_config.timeout = 60.0 + + default_config.rpcs.delete_notification_config.timeout = 60.0 + + default_config.rpcs.delete_security_health_analytics_custom_module.timeout = 60.0 + + default_config.rpcs.get_iam_policy.timeout = 60.0 + default_config.rpcs.get_iam_policy.retry_policy = { + initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [4, 14] + } + + default_config.rpcs.get_notification_config.timeout = 60.0 + default_config.rpcs.get_notification_config.retry_policy = { + initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [4, 14] + } + + default_config.rpcs.get_organization_settings.timeout = 60.0 + default_config.rpcs.get_organization_settings.retry_policy = { + initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [4, 14] + } + + default_config.rpcs.get_effective_security_health_analytics_custom_module.timeout = 60.0 + default_config.rpcs.get_effective_security_health_analytics_custom_module.retry_policy = { + initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [4, 14] + } + + default_config.rpcs.get_security_health_analytics_custom_module.timeout = 60.0 + default_config.rpcs.get_security_health_analytics_custom_module.retry_policy = { + initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [4, 14] + } + + default_config.rpcs.get_source.timeout = 60.0 + default_config.rpcs.get_source.retry_policy = { + initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [4, 14] + } + + default_config.rpcs.group_assets.timeout = 480.0 + default_config.rpcs.group_assets.retry_policy = { + initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [4, 14] + } + + default_config.rpcs.group_findings.timeout = 480.0 + default_config.rpcs.group_findings.retry_policy = { + initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [4, 14] + } + + default_config.rpcs.list_assets.timeout = 480.0 + default_config.rpcs.list_assets.retry_policy = { + initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [4, 14] + } + + default_config.rpcs.list_descendant_security_health_analytics_custom_modules.timeout = 60.0 + default_config.rpcs.list_descendant_security_health_analytics_custom_modules.retry_policy = { + initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [4, 14] + } + + default_config.rpcs.list_findings.timeout = 480.0 + default_config.rpcs.list_findings.retry_policy = { + initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [4, 14] + } + + default_config.rpcs.list_notification_configs.timeout = 60.0 + default_config.rpcs.list_notification_configs.retry_policy = { + initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [4, 14] + } + + default_config.rpcs.list_effective_security_health_analytics_custom_modules.timeout = 60.0 + default_config.rpcs.list_effective_security_health_analytics_custom_modules.retry_policy = { + initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [4, 14] + } + + default_config.rpcs.list_security_health_analytics_custom_modules.timeout = 60.0 + default_config.rpcs.list_security_health_analytics_custom_modules.retry_policy = { + initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [4, 14] + } + + default_config.rpcs.list_sources.timeout = 60.0 + default_config.rpcs.list_sources.retry_policy = { + initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [4, 14] + } + + default_config.rpcs.run_asset_discovery.timeout = 60.0 + + default_config.rpcs.set_finding_state.timeout = 60.0 + + default_config.rpcs.set_iam_policy.timeout = 60.0 + + default_config.rpcs.test_iam_permissions.timeout = 60.0 + default_config.rpcs.test_iam_permissions.retry_policy = { + initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [4, 14] + } + + default_config.rpcs.update_finding.timeout = 60.0 + + default_config.rpcs.update_notification_config.timeout = 60.0 + + default_config.rpcs.update_organization_settings.timeout = 60.0 + + default_config.rpcs.update_security_health_analytics_custom_module.timeout = 60.0 + + default_config.rpcs.update_source.timeout = 60.0 + + default_config.rpcs.update_security_marks.timeout = 480.0 + + default_config + end + yield @configure if block_given? + @configure + end + + ## + # Configure the SecurityCenter Client instance. + # + # The configuration is set to the derived mode, meaning that values can be changed, + # but structural changes (adding new fields, etc.) are not allowed. Structural changes + # should be made on {Client.configure}. + # + # See {::Google::Cloud::SecurityCenter::V1::SecurityCenter::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 + @security_center_stub.universe_domain + end + + ## + # Create a new SecurityCenter client object. + # + # @example + # + # # Create a client using the default configuration + # client = ::Google::Cloud::SecurityCenter::V1::SecurityCenter::Client.new + # + # # Create a client using a custom configuration + # client = ::Google::Cloud::SecurityCenter::V1::SecurityCenter::Client.new do |config| + # config.timeout = 10.0 + # end + # + # @yield [config] Configure the SecurityCenter client. + # @yieldparam config [Client::Configuration] + # + def initialize + # These require statements are intentionally placed here to initialize + # the gRPC module only when it's required. + # See https://github.com/googleapis/toolkit/issues/446 + require "gapic/grpc" + require "google/cloud/securitycenter/v1/securitycenter_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 + + @security_center_stub = ::Gapic::ServiceStub.new( + ::Google::Cloud::SecurityCenter::V1::SecurityCenter::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 + ) + + @security_center_stub.stub_logger&.info do |entry| + entry.set_system_name + entry.set_service + entry.message = "Created client for #{entry.service}" + entry.set_credentials_fields credentials + entry.set "customEndpoint", @config.endpoint if @config.endpoint + entry.set "defaultTimeout", @config.timeout if @config.timeout + entry.set "quotaProject", @quota_project_id if @quota_project_id + end + end + + ## + # Get the associated client for long-running operations. + # + # @return [::Google::Cloud::SecurityCenter::V1::SecurityCenter::Operations] + # + attr_reader :operations_client + + ## + # The logger used for request/response debug logging. + # + # @return [Logger] + # + def logger + @security_center_stub.logger + end + + # Service calls + + ## + # Kicks off an LRO to bulk mute findings for a parent based on a filter. The + # parent can be either an organization, folder or project. The findings + # matched by the filter will be muted after the LRO is done. + # + # @overload bulk_mute_findings(request, options = nil) + # Pass arguments to `bulk_mute_findings` via a request object, either of type + # {::Google::Cloud::SecurityCenter::V1::BulkMuteFindingsRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::SecurityCenter::V1::BulkMuteFindingsRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. + # + # @overload bulk_mute_findings(parent: nil, filter: nil, mute_annotation: nil, mute_state: nil) + # Pass arguments to `bulk_mute_findings` via keyword arguments. Note that at + # least one keyword argument is 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, at which bulk action needs to be applied. Its format + # is `organizations/[organization_id]`, `folders/[folder_id]`, + # `projects/[project_id]`. + # @param filter [::String] + # Expression that identifies findings that should be updated. + # The expression is a list of zero or more restrictions combined + # via logical operators `AND` and `OR`. Parentheses are supported, and `OR` + # has higher precedence than `AND`. + # + # Restrictions have the form ` ` and may have a + # `-` character in front of them to indicate negation. The fields map to + # those defined in the corresponding resource. + # + # The supported operators are: + # + # * `=` for all value types. + # * `>`, `<`, `>=`, `<=` for integer values. + # * `:`, meaning substring matching, for strings. + # + # The supported value types are: + # + # * string literals in quotes. + # * integer literals without quotes. + # * boolean literals `true` and `false` without quotes. + # @param mute_annotation [::String] + # This can be a mute configuration name or any identifier for mute/unmute + # of findings based on the filter. + # @param mute_state [::Google::Cloud::SecurityCenter::V1::BulkMuteFindingsRequest::MuteState] + # Optional. All findings matching the given filter will have their mute state + # set to this value. The default value is `MUTED`. Setting this to + # `UNDEFINED` will clear the mute state on all matching findings. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Gapic::Operation] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Gapic::Operation] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/security_center/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::SecurityCenter::V1::SecurityCenter::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::SecurityCenter::V1::BulkMuteFindingsRequest.new + # + # # Call the bulk_mute_findings method. + # result = client.bulk_mute_findings 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 bulk_mute_findings request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::SecurityCenter::V1::BulkMuteFindingsRequest + + # Converts hash 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.bulk_mute_findings.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::SecurityCenter::V1::VERSION + metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.parent + header_params["parent"] = request.parent + end + + request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") + metadata[:"x-goog-request-params"] ||= request_params_header + + options.apply_defaults timeout: @config.rpcs.bulk_mute_findings.timeout, + metadata: metadata, + retry_policy: @config.rpcs.bulk_mute_findings.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @security_center_stub.call_rpc :bulk_mute_findings, 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 + + ## + # Creates a resident SecurityHealthAnalyticsCustomModule at the scope of the + # given CRM parent, and also creates inherited + # SecurityHealthAnalyticsCustomModules for all CRM descendants of the given + # parent. These modules are enabled by default. + # + # @overload create_security_health_analytics_custom_module(request, options = nil) + # Pass arguments to `create_security_health_analytics_custom_module` via a request object, either of type + # {::Google::Cloud::SecurityCenter::V1::CreateSecurityHealthAnalyticsCustomModuleRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::SecurityCenter::V1::CreateSecurityHealthAnalyticsCustomModuleRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_security_health_analytics_custom_module(parent: nil, security_health_analytics_custom_module: nil) + # Pass arguments to `create_security_health_analytics_custom_module` via keyword arguments. Note that at + # least one keyword argument is 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. Resource name of the new custom module's parent. Its format is + # `organizations/{organization}/securityHealthAnalyticsSettings`, + # `folders/{folder}/securityHealthAnalyticsSettings`, or + # `projects/{project}/securityHealthAnalyticsSettings` + # @param security_health_analytics_custom_module [::Google::Cloud::SecurityCenter::V1::SecurityHealthAnalyticsCustomModule, ::Hash] + # Required. SecurityHealthAnalytics custom module to create. The provided + # name is ignored and reset with provided parent information and + # server-generated ID. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Google::Cloud::SecurityCenter::V1::SecurityHealthAnalyticsCustomModule] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Google::Cloud::SecurityCenter::V1::SecurityHealthAnalyticsCustomModule] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/security_center/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::SecurityCenter::V1::SecurityCenter::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::SecurityCenter::V1::CreateSecurityHealthAnalyticsCustomModuleRequest.new + # + # # Call the create_security_health_analytics_custom_module method. + # result = client.create_security_health_analytics_custom_module request + # + # # The returned object is of type Google::Cloud::SecurityCenter::V1::SecurityHealthAnalyticsCustomModule. + # p result + # + def create_security_health_analytics_custom_module request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::SecurityCenter::V1::CreateSecurityHealthAnalyticsCustomModuleRequest + + # Converts hash 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_security_health_analytics_custom_module.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::SecurityCenter::V1::VERSION + metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.parent + header_params["parent"] = request.parent + end + + request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") + metadata[:"x-goog-request-params"] ||= request_params_header + + options.apply_defaults timeout: @config.rpcs.create_security_health_analytics_custom_module.timeout, + metadata: metadata, + retry_policy: @config.rpcs.create_security_health_analytics_custom_module.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @security_center_stub.call_rpc :create_security_health_analytics_custom_module, request, options: options do |response, operation| + yield response, operation if block_given? + end + rescue ::GRPC::BadStatus => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Creates a source. + # + # @overload create_source(request, options = nil) + # Pass arguments to `create_source` via a request object, either of type + # {::Google::Cloud::SecurityCenter::V1::CreateSourceRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::SecurityCenter::V1::CreateSourceRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_source(parent: nil, source: nil) + # Pass arguments to `create_source` via keyword arguments. Note that at + # least one keyword argument is 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. Resource name of the new source's parent. Its format should be + # `organizations/[organization_id]`. + # @param source [::Google::Cloud::SecurityCenter::V1::Source, ::Hash] + # Required. The Source being created, only the display_name and description + # will be used. All other fields will be ignored. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Google::Cloud::SecurityCenter::V1::Source] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Google::Cloud::SecurityCenter::V1::Source] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/security_center/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::SecurityCenter::V1::SecurityCenter::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::SecurityCenter::V1::CreateSourceRequest.new + # + # # Call the create_source method. + # result = client.create_source request + # + # # The returned object is of type Google::Cloud::SecurityCenter::V1::Source. + # p result + # + def create_source request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::SecurityCenter::V1::CreateSourceRequest + + # Converts hash 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_source.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::SecurityCenter::V1::VERSION + metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.parent + header_params["parent"] = request.parent + end + + request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") + metadata[:"x-goog-request-params"] ||= request_params_header + + options.apply_defaults timeout: @config.rpcs.create_source.timeout, + metadata: metadata, + retry_policy: @config.rpcs.create_source.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @security_center_stub.call_rpc :create_source, request, options: options do |response, operation| + yield response, operation if block_given? + end + rescue ::GRPC::BadStatus => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Creates a finding. The corresponding source must exist for finding creation + # to succeed. + # + # @overload create_finding(request, options = nil) + # Pass arguments to `create_finding` via a request object, either of type + # {::Google::Cloud::SecurityCenter::V1::CreateFindingRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::SecurityCenter::V1::CreateFindingRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_finding(parent: nil, finding_id: nil, finding: nil) + # Pass arguments to `create_finding` via keyword arguments. Note that at + # least one keyword argument is 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. Resource name of the new finding's parent. Its format should be + # `organizations/[organization_id]/sources/[source_id]`. + # @param finding_id [::String] + # Required. Unique identifier provided by the client within the parent scope. + # It must be alphanumeric and less than or equal to 32 characters and + # greater than 0 characters in length. + # @param finding [::Google::Cloud::SecurityCenter::V1::Finding, ::Hash] + # Required. The Finding being created. The name and security_marks will be + # ignored as they are both output only fields on this resource. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Google::Cloud::SecurityCenter::V1::Finding] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Google::Cloud::SecurityCenter::V1::Finding] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/security_center/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::SecurityCenter::V1::SecurityCenter::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::SecurityCenter::V1::CreateFindingRequest.new + # + # # Call the create_finding method. + # result = client.create_finding request + # + # # The returned object is of type Google::Cloud::SecurityCenter::V1::Finding. + # p result + # + def create_finding request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::SecurityCenter::V1::CreateFindingRequest + + # Converts hash 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_finding.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::SecurityCenter::V1::VERSION + metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.parent + header_params["parent"] = request.parent + end + + request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") + metadata[:"x-goog-request-params"] ||= request_params_header + + options.apply_defaults timeout: @config.rpcs.create_finding.timeout, + metadata: metadata, + retry_policy: @config.rpcs.create_finding.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @security_center_stub.call_rpc :create_finding, request, options: options do |response, operation| + yield response, operation if block_given? + end + rescue ::GRPC::BadStatus => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Creates a mute config. + # + # @overload create_mute_config(request, options = nil) + # Pass arguments to `create_mute_config` via a request object, either of type + # {::Google::Cloud::SecurityCenter::V1::CreateMuteConfigRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::SecurityCenter::V1::CreateMuteConfigRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_mute_config(parent: nil, mute_config: nil, mute_config_id: nil) + # Pass arguments to `create_mute_config` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param parent [::String] + # Required. Resource name of the new mute configs's parent. Its format is + # `organizations/[organization_id]`, `folders/[folder_id]`, or + # `projects/[project_id]`. + # @param mute_config [::Google::Cloud::SecurityCenter::V1::MuteConfig, ::Hash] + # Required. The mute config being created. + # @param mute_config_id [::String] + # Required. Unique identifier provided by the client within the parent scope. + # It must consist of only lowercase letters, numbers, and hyphens, must start + # with a letter, must end with either a letter or a number, and must be 63 + # characters or less. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Google::Cloud::SecurityCenter::V1::MuteConfig] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Google::Cloud::SecurityCenter::V1::MuteConfig] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/security_center/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::SecurityCenter::V1::SecurityCenter::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::SecurityCenter::V1::CreateMuteConfigRequest.new + # + # # Call the create_mute_config method. + # result = client.create_mute_config request + # + # # The returned object is of type Google::Cloud::SecurityCenter::V1::MuteConfig. + # p result + # + def create_mute_config request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::SecurityCenter::V1::CreateMuteConfigRequest + + # Converts hash 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_mute_config.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::SecurityCenter::V1::VERSION + metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.parent + header_params["parent"] = request.parent + end + + request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") + metadata[:"x-goog-request-params"] ||= request_params_header + + options.apply_defaults timeout: @config.rpcs.create_mute_config.timeout, + metadata: metadata, + retry_policy: @config.rpcs.create_mute_config.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @security_center_stub.call_rpc :create_mute_config, request, options: options do |response, operation| + yield response, operation if block_given? + end + rescue ::GRPC::BadStatus => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Creates a notification config. + # + # @overload create_notification_config(request, options = nil) + # Pass arguments to `create_notification_config` via a request object, either of type + # {::Google::Cloud::SecurityCenter::V1::CreateNotificationConfigRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::SecurityCenter::V1::CreateNotificationConfigRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_notification_config(parent: nil, config_id: nil, notification_config: nil) + # Pass arguments to `create_notification_config` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param parent [::String] + # Required. Resource name of the new notification config's parent. Its format + # is `organizations/[organization_id]`, `folders/[folder_id]`, or + # `projects/[project_id]`. + # @param config_id [::String] + # Required. + # Unique identifier provided by the client within the parent scope. + # It must be between 1 and 128 characters and contain alphanumeric + # characters, underscores, or hyphens only. + # @param notification_config [::Google::Cloud::SecurityCenter::V1::NotificationConfig, ::Hash] + # Required. The notification config being created. The name and the service + # account will be ignored as they are both output only fields on this + # resource. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Google::Cloud::SecurityCenter::V1::NotificationConfig] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Google::Cloud::SecurityCenter::V1::NotificationConfig] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/security_center/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::SecurityCenter::V1::SecurityCenter::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::SecurityCenter::V1::CreateNotificationConfigRequest.new + # + # # Call the create_notification_config method. + # result = client.create_notification_config request + # + # # The returned object is of type Google::Cloud::SecurityCenter::V1::NotificationConfig. + # p result + # + def create_notification_config request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::SecurityCenter::V1::CreateNotificationConfigRequest + + # Converts hash 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_notification_config.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::SecurityCenter::V1::VERSION + metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.parent + header_params["parent"] = request.parent + end + + request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") + metadata[:"x-goog-request-params"] ||= request_params_header + + options.apply_defaults timeout: @config.rpcs.create_notification_config.timeout, + metadata: metadata, + retry_policy: @config.rpcs.create_notification_config.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @security_center_stub.call_rpc :create_notification_config, request, options: options do |response, operation| + yield response, operation if block_given? + end + rescue ::GRPC::BadStatus => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Deletes an existing mute config. + # + # @overload delete_mute_config(request, options = nil) + # Pass arguments to `delete_mute_config` via a request object, either of type + # {::Google::Cloud::SecurityCenter::V1::DeleteMuteConfigRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::SecurityCenter::V1::DeleteMuteConfigRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_mute_config(name: nil) + # Pass arguments to `delete_mute_config` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param name [::String] + # Required. Name of the mute config to delete. Its format is + # `organizations/{organization}/muteConfigs/{config_id}`, + # `folders/{folder}/muteConfigs/{config_id}`, + # `projects/{project}/muteConfigs/{config_id}`, + # `organizations/{organization}/locations/global/muteConfigs/{config_id}`, + # `folders/{folder}/locations/global/muteConfigs/{config_id}`, or + # `projects/{project}/locations/global/muteConfigs/{config_id}`. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Google::Protobuf::Empty] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Google::Protobuf::Empty] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/security_center/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::SecurityCenter::V1::SecurityCenter::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::SecurityCenter::V1::DeleteMuteConfigRequest.new + # + # # Call the delete_mute_config method. + # result = client.delete_mute_config request + # + # # The returned object is of type Google::Protobuf::Empty. + # p result + # + def delete_mute_config request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::SecurityCenter::V1::DeleteMuteConfigRequest + + # Converts hash 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_mute_config.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::SecurityCenter::V1::VERSION + metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.name + header_params["name"] = request.name + end + + request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") + metadata[:"x-goog-request-params"] ||= request_params_header + + options.apply_defaults timeout: @config.rpcs.delete_mute_config.timeout, + metadata: metadata, + retry_policy: @config.rpcs.delete_mute_config.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @security_center_stub.call_rpc :delete_mute_config, request, options: options do |response, operation| + yield response, operation if block_given? + end + rescue ::GRPC::BadStatus => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Deletes a notification config. + # + # @overload delete_notification_config(request, options = nil) + # Pass arguments to `delete_notification_config` via a request object, either of type + # {::Google::Cloud::SecurityCenter::V1::DeleteNotificationConfigRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::SecurityCenter::V1::DeleteNotificationConfigRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_notification_config(name: nil) + # Pass arguments to `delete_notification_config` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param name [::String] + # Required. Name of the notification config to delete. Its format is + # `organizations/[organization_id]/notificationConfigs/[config_id]`, + # `folders/[folder_id]/notificationConfigs/[config_id]`, + # or `projects/[project_id]/notificationConfigs/[config_id]`. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Google::Protobuf::Empty] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Google::Protobuf::Empty] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/security_center/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::SecurityCenter::V1::SecurityCenter::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::SecurityCenter::V1::DeleteNotificationConfigRequest.new + # + # # Call the delete_notification_config method. + # result = client.delete_notification_config request + # + # # The returned object is of type Google::Protobuf::Empty. + # p result + # + def delete_notification_config request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::SecurityCenter::V1::DeleteNotificationConfigRequest + + # Converts hash 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_notification_config.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::SecurityCenter::V1::VERSION + metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.name + header_params["name"] = request.name + end + + request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") + metadata[:"x-goog-request-params"] ||= request_params_header + + options.apply_defaults timeout: @config.rpcs.delete_notification_config.timeout, + metadata: metadata, + retry_policy: @config.rpcs.delete_notification_config.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @security_center_stub.call_rpc :delete_notification_config, request, options: options do |response, operation| + yield response, operation if block_given? + end + rescue ::GRPC::BadStatus => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Deletes the specified SecurityHealthAnalyticsCustomModule and all of its + # descendants in the CRM hierarchy. This method is only supported for + # resident custom modules. + # + # @overload delete_security_health_analytics_custom_module(request, options = nil) + # Pass arguments to `delete_security_health_analytics_custom_module` via a request object, either of type + # {::Google::Cloud::SecurityCenter::V1::DeleteSecurityHealthAnalyticsCustomModuleRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::SecurityCenter::V1::DeleteSecurityHealthAnalyticsCustomModuleRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_security_health_analytics_custom_module(name: nil) + # Pass arguments to `delete_security_health_analytics_custom_module` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param name [::String] + # Required. Name of the custom module to delete. Its format is + # `organizations/{organization}/securityHealthAnalyticsSettings/customModules/{customModule}`, + # `folders/{folder}/securityHealthAnalyticsSettings/customModules/{customModule}`, + # or + # `projects/{project}/securityHealthAnalyticsSettings/customModules/{customModule}` + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Google::Protobuf::Empty] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Google::Protobuf::Empty] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/security_center/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::SecurityCenter::V1::SecurityCenter::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::SecurityCenter::V1::DeleteSecurityHealthAnalyticsCustomModuleRequest.new + # + # # Call the delete_security_health_analytics_custom_module method. + # result = client.delete_security_health_analytics_custom_module request + # + # # The returned object is of type Google::Protobuf::Empty. + # p result + # + def delete_security_health_analytics_custom_module request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::SecurityCenter::V1::DeleteSecurityHealthAnalyticsCustomModuleRequest + + # Converts hash 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_security_health_analytics_custom_module.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::SecurityCenter::V1::VERSION + metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.name + header_params["name"] = request.name + end + + request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") + metadata[:"x-goog-request-params"] ||= request_params_header + + options.apply_defaults timeout: @config.rpcs.delete_security_health_analytics_custom_module.timeout, + metadata: metadata, + retry_policy: @config.rpcs.delete_security_health_analytics_custom_module.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @security_center_stub.call_rpc :delete_security_health_analytics_custom_module, 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 + + ## + # Get the simulation by name or the latest simulation for the given + # organization. + # + # @overload get_simulation(request, options = nil) + # Pass arguments to `get_simulation` via a request object, either of type + # {::Google::Cloud::SecurityCenter::V1::GetSimulationRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::SecurityCenter::V1::GetSimulationRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_simulation(name: nil) + # Pass arguments to `get_simulation` via keyword arguments. Note that at + # least one keyword argument is 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 organization name or simulation name of this simulation + # + # Valid format: + # `organizations/{organization}/simulations/latest` + # `organizations/{organization}/simulations/{simulation}` + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Google::Cloud::SecurityCenter::V1::Simulation] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Google::Cloud::SecurityCenter::V1::Simulation] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/security_center/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::SecurityCenter::V1::SecurityCenter::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::SecurityCenter::V1::GetSimulationRequest.new + # + # # Call the get_simulation method. + # result = client.get_simulation request + # + # # The returned object is of type Google::Cloud::SecurityCenter::V1::Simulation. + # p result + # + def get_simulation request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::SecurityCenter::V1::GetSimulationRequest + + # Converts hash 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_simulation.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::SecurityCenter::V1::VERSION + metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.name + header_params["name"] = request.name + end + + request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") + metadata[:"x-goog-request-params"] ||= request_params_header + + options.apply_defaults timeout: @config.rpcs.get_simulation.timeout, + metadata: metadata, + retry_policy: @config.rpcs.get_simulation.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @security_center_stub.call_rpc :get_simulation, 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 + + ## + # Get the valued resource by name + # + # @overload get_valued_resource(request, options = nil) + # Pass arguments to `get_valued_resource` via a request object, either of type + # {::Google::Cloud::SecurityCenter::V1::GetValuedResourceRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::SecurityCenter::V1::GetValuedResourceRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_valued_resource(name: nil) + # Pass arguments to `get_valued_resource` via keyword arguments. Note that at + # least one keyword argument is 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 this valued resource + # + # Valid format: + # `organizations/{organization}/simulations/{simulation}/valuedResources/{valued_resource}` + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Google::Cloud::SecurityCenter::V1::ValuedResource] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Google::Cloud::SecurityCenter::V1::ValuedResource] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/security_center/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::SecurityCenter::V1::SecurityCenter::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::SecurityCenter::V1::GetValuedResourceRequest.new + # + # # Call the get_valued_resource method. + # result = client.get_valued_resource request + # + # # The returned object is of type Google::Cloud::SecurityCenter::V1::ValuedResource. + # p result + # + def get_valued_resource request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::SecurityCenter::V1::GetValuedResourceRequest + + # Converts hash 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_valued_resource.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::SecurityCenter::V1::VERSION + metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.name + header_params["name"] = request.name + end + + request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") + metadata[:"x-goog-request-params"] ||= request_params_header + + options.apply_defaults timeout: @config.rpcs.get_valued_resource.timeout, + metadata: metadata, + retry_policy: @config.rpcs.get_valued_resource.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @security_center_stub.call_rpc :get_valued_resource, request, options: options do |response, operation| + yield response, operation if block_given? + end + rescue ::GRPC::BadStatus => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Gets a BigQuery export. + # + # @overload get_big_query_export(request, options = nil) + # Pass arguments to `get_big_query_export` via a request object, either of type + # {::Google::Cloud::SecurityCenter::V1::GetBigQueryExportRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::SecurityCenter::V1::GetBigQueryExportRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_big_query_export(name: nil) + # Pass arguments to `get_big_query_export` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param name [::String] + # Required. Name of the BigQuery export to retrieve. Its format is + # `organizations/{organization}/bigQueryExports/{export_id}`, + # `folders/{folder}/bigQueryExports/{export_id}`, or + # `projects/{project}/bigQueryExports/{export_id}` + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Google::Cloud::SecurityCenter::V1::BigQueryExport] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Google::Cloud::SecurityCenter::V1::BigQueryExport] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/security_center/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::SecurityCenter::V1::SecurityCenter::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::SecurityCenter::V1::GetBigQueryExportRequest.new + # + # # Call the get_big_query_export method. + # result = client.get_big_query_export request + # + # # The returned object is of type Google::Cloud::SecurityCenter::V1::BigQueryExport. + # p result + # + def get_big_query_export request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::SecurityCenter::V1::GetBigQueryExportRequest + + # Converts hash 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_big_query_export.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::SecurityCenter::V1::VERSION + metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.name + header_params["name"] = request.name + end + + request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") + metadata[:"x-goog-request-params"] ||= request_params_header + + options.apply_defaults timeout: @config.rpcs.get_big_query_export.timeout, + metadata: metadata, + retry_policy: @config.rpcs.get_big_query_export.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @security_center_stub.call_rpc :get_big_query_export, request, options: options do |response, operation| + yield response, operation if block_given? + end + rescue ::GRPC::BadStatus => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Gets the access control policy on the specified Source. + # + # @overload get_iam_policy(request, options = nil) + # Pass arguments to `get_iam_policy` via a request object, either of type + # {::Google::Iam::V1::GetIamPolicyRequest} or an equivalent Hash. + # + # @param request [::Google::Iam::V1::GetIamPolicyRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. + # + # @overload get_iam_policy(resource: nil, options: nil) + # Pass arguments to `get_iam_policy` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param resource [::String] + # REQUIRED: The resource for which the policy is being requested. + # See the operation documentation for the appropriate value for this field. + # @param options [::Google::Iam::V1::GetPolicyOptions, ::Hash] + # OPTIONAL: A `GetPolicyOptions` object for specifying options to + # `GetIamPolicy`. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Google::Iam::V1::Policy] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Google::Iam::V1::Policy] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/security_center/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::SecurityCenter::V1::SecurityCenter::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Iam::V1::GetIamPolicyRequest.new + # + # # Call the get_iam_policy method. + # result = client.get_iam_policy request + # + # # The returned object is of type Google::Iam::V1::Policy. + # p result + # + def get_iam_policy request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Iam::V1::GetIamPolicyRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + metadata = @config.rpcs.get_iam_policy.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::SecurityCenter::V1::VERSION + metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.resource + header_params["resource"] = request.resource + end + + request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") + metadata[:"x-goog-request-params"] ||= request_params_header + + options.apply_defaults timeout: @config.rpcs.get_iam_policy.timeout, + metadata: metadata, + retry_policy: @config.rpcs.get_iam_policy.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @security_center_stub.call_rpc :get_iam_policy, request, options: options do |response, operation| + yield response, operation if block_given? + end + rescue ::GRPC::BadStatus => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Gets a mute config. + # + # @overload get_mute_config(request, options = nil) + # Pass arguments to `get_mute_config` via a request object, either of type + # {::Google::Cloud::SecurityCenter::V1::GetMuteConfigRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::SecurityCenter::V1::GetMuteConfigRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_mute_config(name: nil) + # Pass arguments to `get_mute_config` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param name [::String] + # Required. Name of the mute config to retrieve. Its format is + # `organizations/{organization}/muteConfigs/{config_id}`, + # `folders/{folder}/muteConfigs/{config_id}`, + # `projects/{project}/muteConfigs/{config_id}`, + # `organizations/{organization}/locations/global/muteConfigs/{config_id}`, + # `folders/{folder}/locations/global/muteConfigs/{config_id}`, or + # `projects/{project}/locations/global/muteConfigs/{config_id}`. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Google::Cloud::SecurityCenter::V1::MuteConfig] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Google::Cloud::SecurityCenter::V1::MuteConfig] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/security_center/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::SecurityCenter::V1::SecurityCenter::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::SecurityCenter::V1::GetMuteConfigRequest.new + # + # # Call the get_mute_config method. + # result = client.get_mute_config request + # + # # The returned object is of type Google::Cloud::SecurityCenter::V1::MuteConfig. + # p result + # + def get_mute_config request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::SecurityCenter::V1::GetMuteConfigRequest + + # Converts hash 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_mute_config.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::SecurityCenter::V1::VERSION + metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.name + header_params["name"] = request.name + end + + request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") + metadata[:"x-goog-request-params"] ||= request_params_header + + options.apply_defaults timeout: @config.rpcs.get_mute_config.timeout, + metadata: metadata, + retry_policy: @config.rpcs.get_mute_config.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @security_center_stub.call_rpc :get_mute_config, request, options: options do |response, operation| + yield response, operation if block_given? + end + rescue ::GRPC::BadStatus => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Gets a notification config. + # + # @overload get_notification_config(request, options = nil) + # Pass arguments to `get_notification_config` via a request object, either of type + # {::Google::Cloud::SecurityCenter::V1::GetNotificationConfigRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::SecurityCenter::V1::GetNotificationConfigRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_notification_config(name: nil) + # Pass arguments to `get_notification_config` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param name [::String] + # Required. Name of the notification config to get. Its format is + # `organizations/[organization_id]/notificationConfigs/[config_id]`, + # `folders/[folder_id]/notificationConfigs/[config_id]`, + # or `projects/[project_id]/notificationConfigs/[config_id]`. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Google::Cloud::SecurityCenter::V1::NotificationConfig] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Google::Cloud::SecurityCenter::V1::NotificationConfig] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/security_center/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::SecurityCenter::V1::SecurityCenter::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::SecurityCenter::V1::GetNotificationConfigRequest.new + # + # # Call the get_notification_config method. + # result = client.get_notification_config request + # + # # The returned object is of type Google::Cloud::SecurityCenter::V1::NotificationConfig. + # p result + # + def get_notification_config request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::SecurityCenter::V1::GetNotificationConfigRequest + + # Converts hash 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_notification_config.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::SecurityCenter::V1::VERSION + metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.name + header_params["name"] = request.name + end + + request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") + metadata[:"x-goog-request-params"] ||= request_params_header + + options.apply_defaults timeout: @config.rpcs.get_notification_config.timeout, + metadata: metadata, + retry_policy: @config.rpcs.get_notification_config.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @security_center_stub.call_rpc :get_notification_config, request, options: options do |response, operation| + yield response, operation if block_given? + end + rescue ::GRPC::BadStatus => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Gets the settings for an organization. + # + # @overload get_organization_settings(request, options = nil) + # Pass arguments to `get_organization_settings` via a request object, either of type + # {::Google::Cloud::SecurityCenter::V1::GetOrganizationSettingsRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::SecurityCenter::V1::GetOrganizationSettingsRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. + # + # @overload get_organization_settings(name: nil) + # Pass arguments to `get_organization_settings` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param name [::String] + # Required. Name of the organization to get organization settings for. Its + # format is `organizations/[organization_id]/organizationSettings`. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Google::Cloud::SecurityCenter::V1::OrganizationSettings] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Google::Cloud::SecurityCenter::V1::OrganizationSettings] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/security_center/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::SecurityCenter::V1::SecurityCenter::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::SecurityCenter::V1::GetOrganizationSettingsRequest.new + # + # # Call the get_organization_settings method. + # result = client.get_organization_settings request + # + # # The returned object is of type Google::Cloud::SecurityCenter::V1::OrganizationSettings. + # p result + # + def get_organization_settings request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::SecurityCenter::V1::GetOrganizationSettingsRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + metadata = @config.rpcs.get_organization_settings.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::SecurityCenter::V1::VERSION + metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.name + header_params["name"] = request.name + end + + request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") + metadata[:"x-goog-request-params"] ||= request_params_header + + options.apply_defaults timeout: @config.rpcs.get_organization_settings.timeout, + metadata: metadata, + retry_policy: @config.rpcs.get_organization_settings.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @security_center_stub.call_rpc :get_organization_settings, request, options: options do |response, operation| + yield response, operation if block_given? + end + rescue ::GRPC::BadStatus => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Retrieves an EffectiveSecurityHealthAnalyticsCustomModule. + # + # @overload get_effective_security_health_analytics_custom_module(request, options = nil) + # Pass arguments to `get_effective_security_health_analytics_custom_module` via a request object, either of type + # {::Google::Cloud::SecurityCenter::V1::GetEffectiveSecurityHealthAnalyticsCustomModuleRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::SecurityCenter::V1::GetEffectiveSecurityHealthAnalyticsCustomModuleRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_effective_security_health_analytics_custom_module(name: nil) + # Pass arguments to `get_effective_security_health_analytics_custom_module` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param name [::String] + # Required. Name of the effective custom module to get. Its format is + # `organizations/{organization}/securityHealthAnalyticsSettings/effectiveCustomModules/{customModule}`, + # `folders/{folder}/securityHealthAnalyticsSettings/effectiveCustomModules/{customModule}`, + # or + # `projects/{project}/securityHealthAnalyticsSettings/effectiveCustomModules/{customModule}` + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Google::Cloud::SecurityCenter::V1::EffectiveSecurityHealthAnalyticsCustomModule] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Google::Cloud::SecurityCenter::V1::EffectiveSecurityHealthAnalyticsCustomModule] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/security_center/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::SecurityCenter::V1::SecurityCenter::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::SecurityCenter::V1::GetEffectiveSecurityHealthAnalyticsCustomModuleRequest.new + # + # # Call the get_effective_security_health_analytics_custom_module method. + # result = client.get_effective_security_health_analytics_custom_module request + # + # # The returned object is of type Google::Cloud::SecurityCenter::V1::EffectiveSecurityHealthAnalyticsCustomModule. + # p result + # + def get_effective_security_health_analytics_custom_module request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::SecurityCenter::V1::GetEffectiveSecurityHealthAnalyticsCustomModuleRequest + + # Converts hash 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_effective_security_health_analytics_custom_module.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::SecurityCenter::V1::VERSION + metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.name + header_params["name"] = request.name + end + + request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") + metadata[:"x-goog-request-params"] ||= request_params_header + + options.apply_defaults timeout: @config.rpcs.get_effective_security_health_analytics_custom_module.timeout, + metadata: metadata, + retry_policy: @config.rpcs.get_effective_security_health_analytics_custom_module.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @security_center_stub.call_rpc :get_effective_security_health_analytics_custom_module, request, options: options do |response, operation| + yield response, operation if block_given? + end + rescue ::GRPC::BadStatus => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Retrieves a SecurityHealthAnalyticsCustomModule. + # + # @overload get_security_health_analytics_custom_module(request, options = nil) + # Pass arguments to `get_security_health_analytics_custom_module` via a request object, either of type + # {::Google::Cloud::SecurityCenter::V1::GetSecurityHealthAnalyticsCustomModuleRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::SecurityCenter::V1::GetSecurityHealthAnalyticsCustomModuleRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_security_health_analytics_custom_module(name: nil) + # Pass arguments to `get_security_health_analytics_custom_module` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param name [::String] + # Required. Name of the custom module to get. Its format is + # `organizations/{organization}/securityHealthAnalyticsSettings/customModules/{customModule}`, + # `folders/{folder}/securityHealthAnalyticsSettings/customModules/{customModule}`, + # or + # `projects/{project}/securityHealthAnalyticsSettings/customModules/{customModule}` + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Google::Cloud::SecurityCenter::V1::SecurityHealthAnalyticsCustomModule] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Google::Cloud::SecurityCenter::V1::SecurityHealthAnalyticsCustomModule] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/security_center/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::SecurityCenter::V1::SecurityCenter::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::SecurityCenter::V1::GetSecurityHealthAnalyticsCustomModuleRequest.new + # + # # Call the get_security_health_analytics_custom_module method. + # result = client.get_security_health_analytics_custom_module request + # + # # The returned object is of type Google::Cloud::SecurityCenter::V1::SecurityHealthAnalyticsCustomModule. + # p result + # + def get_security_health_analytics_custom_module request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::SecurityCenter::V1::GetSecurityHealthAnalyticsCustomModuleRequest + + # Converts hash 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_security_health_analytics_custom_module.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::SecurityCenter::V1::VERSION + metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.name + header_params["name"] = request.name + end + + request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") + metadata[:"x-goog-request-params"] ||= request_params_header + + options.apply_defaults timeout: @config.rpcs.get_security_health_analytics_custom_module.timeout, + metadata: metadata, + retry_policy: @config.rpcs.get_security_health_analytics_custom_module.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @security_center_stub.call_rpc :get_security_health_analytics_custom_module, request, options: options do |response, operation| + yield response, operation if block_given? + end + rescue ::GRPC::BadStatus => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Gets a source. + # + # @overload get_source(request, options = nil) + # Pass arguments to `get_source` via a request object, either of type + # {::Google::Cloud::SecurityCenter::V1::GetSourceRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::SecurityCenter::V1::GetSourceRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_source(name: nil) + # Pass arguments to `get_source` via keyword arguments. Note that at + # least one keyword argument is 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. Relative resource name of the source. Its format is + # `organizations/[organization_id]/source/[source_id]`. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Google::Cloud::SecurityCenter::V1::Source] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Google::Cloud::SecurityCenter::V1::Source] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/security_center/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::SecurityCenter::V1::SecurityCenter::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::SecurityCenter::V1::GetSourceRequest.new + # + # # Call the get_source method. + # result = client.get_source request + # + # # The returned object is of type Google::Cloud::SecurityCenter::V1::Source. + # p result + # + def get_source request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::SecurityCenter::V1::GetSourceRequest + + # Converts hash 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_source.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::SecurityCenter::V1::VERSION + metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.name + header_params["name"] = request.name + end + + request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") + metadata[:"x-goog-request-params"] ||= request_params_header + + options.apply_defaults timeout: @config.rpcs.get_source.timeout, + metadata: metadata, + retry_policy: @config.rpcs.get_source.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @security_center_stub.call_rpc :get_source, 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 + + ## + # Filters an organization's assets and groups them by their specified + # properties. + # + # @deprecated This method is deprecated and may be removed in the next major version update. + # + # @overload group_assets(request, options = nil) + # Pass arguments to `group_assets` via a request object, either of type + # {::Google::Cloud::SecurityCenter::V1::GroupAssetsRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::SecurityCenter::V1::GroupAssetsRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. + # + # @overload group_assets(parent: nil, filter: nil, group_by: nil, compare_duration: nil, read_time: nil, page_token: nil, page_size: nil) + # Pass arguments to `group_assets` via keyword arguments. Note that at + # least one keyword argument is 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 name of the parent to group the assets by. Its format is + # `organizations/[organization_id]`, `folders/[folder_id]`, or + # `projects/[project_id]`. + # @param filter [::String] + # Expression that defines the filter to apply across assets. + # The expression is a list of zero or more restrictions combined via logical + # operators `AND` and `OR`. + # Parentheses are supported, and `OR` has higher precedence than `AND`. + # + # Restrictions have the form ` ` and may have a `-` + # character in front of them to indicate negation. The fields map to those + # defined in the Asset resource. Examples include: + # + # * name + # * security_center_properties.resource_name + # * resource_properties.a_property + # * security_marks.marks.marka + # + # The supported operators are: + # + # * `=` for all value types. + # * `>`, `<`, `>=`, `<=` for integer values. + # * `:`, meaning substring matching, for strings. + # + # The supported value types are: + # + # * string literals in quotes. + # * integer literals without quotes. + # * boolean literals `true` and `false` without quotes. + # + # The following field and operator combinations are supported: + # + # * name: `=` + # * update_time: `=`, `>`, `<`, `>=`, `<=` + # + # Usage: This should be milliseconds since epoch or an RFC3339 string. + # Examples: + # `update_time = "2019-06-10T16:07:18-07:00"` + # `update_time = 1560208038000` + # + # * create_time: `=`, `>`, `<`, `>=`, `<=` + # + # Usage: This should be milliseconds since epoch or an RFC3339 string. + # Examples: + # `create_time = "2019-06-10T16:07:18-07:00"` + # `create_time = 1560208038000` + # + # * iam_policy.policy_blob: `=`, `:` + # * resource_properties: `=`, `:`, `>`, `<`, `>=`, `<=` + # * security_marks.marks: `=`, `:` + # * security_center_properties.resource_name: `=`, `:` + # * security_center_properties.resource_display_name: `=`, `:` + # * security_center_properties.resource_type: `=`, `:` + # * security_center_properties.resource_parent: `=`, `:` + # * security_center_properties.resource_parent_display_name: `=`, `:` + # * security_center_properties.resource_project: `=`, `:` + # * security_center_properties.resource_project_display_name: `=`, `:` + # * security_center_properties.resource_owners: `=`, `:` + # + # For example, `resource_properties.size = 100` is a valid filter string. + # + # Use a partial match on the empty string to filter based on a property + # existing: `resource_properties.my_property : ""` + # + # Use a negated partial match on the empty string to filter based on a + # property not existing: `-resource_properties.my_property : ""` + # @param group_by [::String] + # Required. Expression that defines what assets fields to use for grouping. + # The string value should follow SQL syntax: comma separated list of fields. + # For example: + # "security_center_properties.resource_project,security_center_properties.project". + # + # The following fields are supported when compare_duration is not set: + # + # * security_center_properties.resource_project + # * security_center_properties.resource_project_display_name + # * security_center_properties.resource_type + # * security_center_properties.resource_parent + # * security_center_properties.resource_parent_display_name + # + # The following fields are supported when compare_duration is set: + # + # * security_center_properties.resource_type + # * security_center_properties.resource_project_display_name + # * security_center_properties.resource_parent_display_name + # @param compare_duration [::Google::Protobuf::Duration, ::Hash] + # When compare_duration is set, the GroupResult's "state_change" property is + # updated to indicate whether the asset was added, removed, or remained + # present during the compare_duration period of time that precedes the + # read_time. This is the time between (read_time - compare_duration) and + # read_time. + # + # The state change value is derived based on the presence of the asset at the + # two points in time. Intermediate state changes between the two times don't + # affect the result. For example, the results aren't affected if the asset is + # removed and re-created again. + # + # Possible "state_change" values when compare_duration is specified: + # + # * "ADDED": indicates that the asset was not present at the start of + # compare_duration, but present at reference_time. + # * "REMOVED": indicates that the asset was present at the start of + # compare_duration, but not present at reference_time. + # * "ACTIVE": indicates that the asset was present at both the + # start and the end of the time period defined by + # compare_duration and reference_time. + # + # If compare_duration is not specified, then the only possible state_change + # is "UNUSED", which will be the state_change set for all assets present at + # read_time. + # + # If this field is set then `state_change` must be a specified field in + # `group_by`. + # @param read_time [::Google::Protobuf::Timestamp, ::Hash] + # Time used as a reference point when filtering assets. The filter is limited + # to assets existing at the supplied time and their values are those at that + # specific time. Absence of this field will default to the API's version of + # NOW. + # @param page_token [::String] + # The value returned by the last `GroupAssetsResponse`; indicates + # that this is a continuation of a prior `GroupAssets` call, and that the + # system should return the next page of data. + # @param page_size [::Integer] + # The maximum number of results to return in a single response. Default is + # 10, minimum is 1, maximum is 1000. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Gapic::PagedEnumerable<::Google::Cloud::SecurityCenter::V1::GroupResult>] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Gapic::PagedEnumerable<::Google::Cloud::SecurityCenter::V1::GroupResult>] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/security_center/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::SecurityCenter::V1::SecurityCenter::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::SecurityCenter::V1::GroupAssetsRequest.new + # + # # Call the group_assets method. + # result = client.group_assets request + # + # # The returned object is of type Gapic::PagedEnumerable. You can iterate + # # over elements, and API calls will be issued to fetch pages as needed. + # result.each do |item| + # # Each element is of type ::Google::Cloud::SecurityCenter::V1::GroupResult. + # p item + # end + # + def group_assets request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::SecurityCenter::V1::GroupAssetsRequest + + # Converts hash 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.group_assets.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::SecurityCenter::V1::VERSION + metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.parent + header_params["parent"] = request.parent + end + + request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") + metadata[:"x-goog-request-params"] ||= request_params_header + + options.apply_defaults timeout: @config.rpcs.group_assets.timeout, + metadata: metadata, + retry_policy: @config.rpcs.group_assets.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @security_center_stub.call_rpc :group_assets, request, options: options do |response, operation| + response = ::Gapic::PagedEnumerable.new @security_center_stub, :group_assets, 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 + + ## + # Filters an organization or source's findings and groups them by their + # specified properties. + # + # To group across all sources provide a `-` as the source id. + # Example: /v1/organizations/\\{organization_id}/sources/-/findings, + # /v1/folders/\\{folder_id}/sources/-/findings, + # /v1/projects/\\{project_id}/sources/-/findings + # + # @overload group_findings(request, options = nil) + # Pass arguments to `group_findings` via a request object, either of type + # {::Google::Cloud::SecurityCenter::V1::GroupFindingsRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::SecurityCenter::V1::GroupFindingsRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. + # + # @overload group_findings(parent: nil, filter: nil, group_by: nil, read_time: nil, compare_duration: nil, page_token: nil, page_size: nil) + # Pass arguments to `group_findings` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param parent [::String] + # Required. Name of the source to groupBy. Its format is + # `organizations/[organization_id]/sources/[source_id]`, + # `folders/[folder_id]/sources/[source_id]`, or + # `projects/[project_id]/sources/[source_id]`. To groupBy across all sources + # provide a source_id of `-`. For example: + # `organizations/{organization_id}/sources/-, folders/{folder_id}/sources/-`, + # or `projects/{project_id}/sources/-` + # @param filter [::String] + # Expression that defines the filter to apply across findings. + # The expression is a list of one or more restrictions combined via logical + # operators `AND` and `OR`. + # Parentheses are supported, and `OR` has higher precedence than `AND`. + # + # Restrictions have the form ` ` and may have a `-` + # character in front of them to indicate negation. Examples include: + # + # * name + # * source_properties.a_property + # * security_marks.marks.marka + # + # The supported operators are: + # + # * `=` for all value types. + # * `>`, `<`, `>=`, `<=` for integer values. + # * `:`, meaning substring matching, for strings. + # + # The supported value types are: + # + # * string literals in quotes. + # * integer literals without quotes. + # * boolean literals `true` and `false` without quotes. + # + # The following field and operator combinations are supported: + # + # * name: `=` + # * parent: `=`, `:` + # * resource_name: `=`, `:` + # * state: `=`, `:` + # * category: `=`, `:` + # * external_uri: `=`, `:` + # * event_time: `=`, `>`, `<`, `>=`, `<=` + # + # Usage: This should be milliseconds since epoch or an RFC3339 string. + # Examples: + # `event_time = "2019-06-10T16:07:18-07:00"` + # `event_time = 1560208038000` + # + # * severity: `=`, `:` + # * workflow_state: `=`, `:` + # * security_marks.marks: `=`, `:` + # * source_properties: `=`, `:`, `>`, `<`, `>=`, `<=` + # + # For example, `source_properties.size = 100` is a valid filter string. + # + # Use a partial match on the empty string to filter based on a property + # existing: `source_properties.my_property : ""` + # + # Use a negated partial match on the empty string to filter based on a + # property not existing: `-source_properties.my_property : ""` + # + # * resource: + # * resource.name: `=`, `:` + # * resource.parent_name: `=`, `:` + # * resource.parent_display_name: `=`, `:` + # * resource.project_name: `=`, `:` + # * resource.project_display_name: `=`, `:` + # * resource.type: `=`, `:` + # @param group_by [::String] + # Required. Expression that defines what assets fields to use for grouping + # (including `state_change`). The string value should follow SQL syntax: + # comma separated list of fields. For example: "parent,resource_name". + # + # The following fields are supported when compare_duration is set: + # + # * state_change + # @param read_time [::Google::Protobuf::Timestamp, ::Hash] + # Time used as a reference point when filtering findings. The filter is + # limited to findings existing at the supplied time and their values are + # those at that specific time. Absence of this field will default to the + # API's version of NOW. + # @param compare_duration [::Google::Protobuf::Duration, ::Hash] + # When compare_duration is set, the GroupResult's "state_change" attribute is + # updated to indicate whether the finding had its state changed, the + # finding's state remained unchanged, or if the finding was added during the + # compare_duration period of time that precedes the read_time. This is the + # time between (read_time - compare_duration) and read_time. + # + # The state_change value is derived based on the presence and state of the + # finding at the two points in time. Intermediate state changes between the + # two times don't affect the result. For example, the results aren't affected + # if the finding is made inactive and then active again. + # + # Possible "state_change" values when compare_duration is specified: + # + # * "CHANGED": indicates that the finding was present and matched the given + # filter at the start of compare_duration, but changed its + # state at read_time. + # * "UNCHANGED": indicates that the finding was present and matched the given + # filter at the start of compare_duration and did not change + # state at read_time. + # * "ADDED": indicates that the finding did not match the given filter or + # was not present at the start of compare_duration, but was + # present at read_time. + # * "REMOVED": indicates that the finding was present and matched the + # filter at the start of compare_duration, but did not match + # the filter at read_time. + # + # If compare_duration is not specified, then the only possible state_change + # is "UNUSED", which will be the state_change set for all findings present + # at read_time. + # + # If this field is set then `state_change` must be a specified field in + # `group_by`. + # @param page_token [::String] + # The value returned by the last `GroupFindingsResponse`; indicates + # that this is a continuation of a prior `GroupFindings` call, and + # that the system should return the next page of data. + # @param page_size [::Integer] + # The maximum number of results to return in a single response. Default is + # 10, minimum is 1, maximum is 1000. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Gapic::PagedEnumerable<::Google::Cloud::SecurityCenter::V1::GroupResult>] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Gapic::PagedEnumerable<::Google::Cloud::SecurityCenter::V1::GroupResult>] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/security_center/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::SecurityCenter::V1::SecurityCenter::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::SecurityCenter::V1::GroupFindingsRequest.new + # + # # Call the group_findings method. + # result = client.group_findings request + # + # # The returned object is of type Gapic::PagedEnumerable. You can iterate + # # over elements, and API calls will be issued to fetch pages as needed. + # result.each do |item| + # # Each element is of type ::Google::Cloud::SecurityCenter::V1::GroupResult. + # p item + # end + # + def group_findings request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::SecurityCenter::V1::GroupFindingsRequest + + # Converts hash 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.group_findings.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::SecurityCenter::V1::VERSION + metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.parent + header_params["parent"] = request.parent + end + + request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") + metadata[:"x-goog-request-params"] ||= request_params_header + + options.apply_defaults timeout: @config.rpcs.group_findings.timeout, + metadata: metadata, + retry_policy: @config.rpcs.group_findings.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @security_center_stub.call_rpc :group_findings, request, options: options do |response, operation| + response = ::Gapic::PagedEnumerable.new @security_center_stub, :group_findings, 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 + + ## + # Lists an organization's assets. + # + # @deprecated This method is deprecated and may be removed in the next major version update. + # + # @overload list_assets(request, options = nil) + # Pass arguments to `list_assets` via a request object, either of type + # {::Google::Cloud::SecurityCenter::V1::ListAssetsRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::SecurityCenter::V1::ListAssetsRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_assets(parent: nil, filter: nil, order_by: nil, read_time: nil, compare_duration: nil, field_mask: nil, page_token: nil, page_size: nil) + # Pass arguments to `list_assets` via keyword arguments. Note that at + # least one keyword argument is 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 name of the parent resource that contains the assets. The + # value that you can specify on parent depends on the method in which you + # specify parent. You can specify one of the following values: + # `organizations/[organization_id]`, `folders/[folder_id]`, or + # `projects/[project_id]`. + # @param filter [::String] + # Expression that defines the filter to apply across assets. + # The expression is a list of zero or more restrictions combined via logical + # operators `AND` and `OR`. + # Parentheses are supported, and `OR` has higher precedence than `AND`. + # + # Restrictions have the form ` ` and may have a `-` + # character in front of them to indicate negation. The fields map to those + # defined in the Asset resource. Examples include: + # + # * name + # * security_center_properties.resource_name + # * resource_properties.a_property + # * security_marks.marks.marka + # + # The supported operators are: + # + # * `=` for all value types. + # * `>`, `<`, `>=`, `<=` for integer values. + # * `:`, meaning substring matching, for strings. + # + # The supported value types are: + # + # * string literals in quotes. + # * integer literals without quotes. + # * boolean literals `true` and `false` without quotes. + # + # The following are the allowed field and operator combinations: + # + # * name: `=` + # * update_time: `=`, `>`, `<`, `>=`, `<=` + # + # Usage: This should be milliseconds since epoch or an RFC3339 string. + # Examples: + # `update_time = "2019-06-10T16:07:18-07:00"` + # `update_time = 1560208038000` + # + # * create_time: `=`, `>`, `<`, `>=`, `<=` + # + # Usage: This should be milliseconds since epoch or an RFC3339 string. + # Examples: + # `create_time = "2019-06-10T16:07:18-07:00"` + # `create_time = 1560208038000` + # + # * iam_policy.policy_blob: `=`, `:` + # * resource_properties: `=`, `:`, `>`, `<`, `>=`, `<=` + # * security_marks.marks: `=`, `:` + # * security_center_properties.resource_name: `=`, `:` + # * security_center_properties.resource_display_name: `=`, `:` + # * security_center_properties.resource_type: `=`, `:` + # * security_center_properties.resource_parent: `=`, `:` + # * security_center_properties.resource_parent_display_name: `=`, `:` + # * security_center_properties.resource_project: `=`, `:` + # * security_center_properties.resource_project_display_name: `=`, `:` + # * security_center_properties.resource_owners: `=`, `:` + # + # For example, `resource_properties.size = 100` is a valid filter string. + # + # Use a partial match on the empty string to filter based on a property + # existing: `resource_properties.my_property : ""` + # + # Use a negated partial match on the empty string to filter based on a + # property not existing: `-resource_properties.my_property : ""` + # @param order_by [::String] + # Expression that defines what fields and order to use for sorting. The + # string value should follow SQL syntax: comma separated list of fields. For + # example: "name,resource_properties.a_property". The default sorting order + # is ascending. To specify descending order for a field, a suffix " desc" + # should be appended to the field name. For example: "name + # desc,resource_properties.a_property". Redundant space characters in the + # syntax are insignificant. "name desc,resource_properties.a_property" and " + # name desc , resource_properties.a_property " are equivalent. + # + # The following fields are supported: + # name + # update_time + # resource_properties + # security_marks.marks + # security_center_properties.resource_name + # security_center_properties.resource_display_name + # security_center_properties.resource_parent + # security_center_properties.resource_parent_display_name + # security_center_properties.resource_project + # security_center_properties.resource_project_display_name + # security_center_properties.resource_type + # @param read_time [::Google::Protobuf::Timestamp, ::Hash] + # Time used as a reference point when filtering assets. The filter is limited + # to assets existing at the supplied time and their values are those at that + # specific time. Absence of this field will default to the API's version of + # NOW. + # @param compare_duration [::Google::Protobuf::Duration, ::Hash] + # When compare_duration is set, the ListAssetsResult's "state_change" + # attribute is updated to indicate whether the asset was added, removed, or + # remained present during the compare_duration period of time that precedes + # the read_time. This is the time between (read_time - compare_duration) and + # read_time. + # + # The state_change value is derived based on the presence of the asset at the + # two points in time. Intermediate state changes between the two times don't + # affect the result. For example, the results aren't affected if the asset is + # removed and re-created again. + # + # Possible "state_change" values when compare_duration is specified: + # + # * "ADDED": indicates that the asset was not present at the start of + # compare_duration, but present at read_time. + # * "REMOVED": indicates that the asset was present at the start of + # compare_duration, but not present at read_time. + # * "ACTIVE": indicates that the asset was present at both the + # start and the end of the time period defined by + # compare_duration and read_time. + # + # If compare_duration is not specified, then the only possible state_change + # is "UNUSED", which will be the state_change set for all assets present at + # read_time. + # @param field_mask [::Google::Protobuf::FieldMask, ::Hash] + # A field mask to specify the ListAssetsResult fields to be listed in the + # response. + # An empty field mask will list all fields. + # @param page_token [::String] + # The value returned by the last `ListAssetsResponse`; indicates + # that this is a continuation of a prior `ListAssets` call, and + # that the system should return the next page of data. + # @param page_size [::Integer] + # The maximum number of results to return in a single response. Default is + # 10, minimum is 1, maximum is 1000. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Gapic::PagedEnumerable<::Google::Cloud::SecurityCenter::V1::ListAssetsResponse::ListAssetsResult>] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Gapic::PagedEnumerable<::Google::Cloud::SecurityCenter::V1::ListAssetsResponse::ListAssetsResult>] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/security_center/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::SecurityCenter::V1::SecurityCenter::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::SecurityCenter::V1::ListAssetsRequest.new + # + # # Call the list_assets method. + # result = client.list_assets request + # + # # The returned object is of type Gapic::PagedEnumerable. You can iterate + # # over elements, and API calls will be issued to fetch pages as needed. + # result.each do |item| + # # Each element is of type ::Google::Cloud::SecurityCenter::V1::ListAssetsResponse::ListAssetsResult. + # p item + # end + # + def list_assets request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::SecurityCenter::V1::ListAssetsRequest + + # Converts hash 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_assets.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::SecurityCenter::V1::VERSION + metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.parent + header_params["parent"] = request.parent + end + + request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") + metadata[:"x-goog-request-params"] ||= request_params_header + + options.apply_defaults timeout: @config.rpcs.list_assets.timeout, + metadata: metadata, + retry_policy: @config.rpcs.list_assets.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @security_center_stub.call_rpc :list_assets, request, options: options do |response, operation| + response = ::Gapic::PagedEnumerable.new @security_center_stub, :list_assets, 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 a list of all resident SecurityHealthAnalyticsCustomModules under + # the given CRM parent and all of the parent’s CRM descendants. + # + # @overload list_descendant_security_health_analytics_custom_modules(request, options = nil) + # Pass arguments to `list_descendant_security_health_analytics_custom_modules` via a request object, either of type + # {::Google::Cloud::SecurityCenter::V1::ListDescendantSecurityHealthAnalyticsCustomModulesRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::SecurityCenter::V1::ListDescendantSecurityHealthAnalyticsCustomModulesRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_descendant_security_health_analytics_custom_modules(parent: nil, page_size: nil, page_token: nil) + # Pass arguments to `list_descendant_security_health_analytics_custom_modules` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param parent [::String] + # Required. Name of parent to list descendant custom modules. Its format is + # `organizations/{organization}/securityHealthAnalyticsSettings`, + # `folders/{folder}/securityHealthAnalyticsSettings`, or + # `projects/{project}/securityHealthAnalyticsSettings` + # @param page_size [::Integer] + # The maximum number of results to return in a single response. Default is + # 10, minimum is 1, maximum is 1000. + # @param page_token [::String] + # The value returned by the last call indicating a continuation + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Gapic::PagedEnumerable<::Google::Cloud::SecurityCenter::V1::SecurityHealthAnalyticsCustomModule>] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Gapic::PagedEnumerable<::Google::Cloud::SecurityCenter::V1::SecurityHealthAnalyticsCustomModule>] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/security_center/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::SecurityCenter::V1::SecurityCenter::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::SecurityCenter::V1::ListDescendantSecurityHealthAnalyticsCustomModulesRequest.new + # + # # Call the list_descendant_security_health_analytics_custom_modules method. + # result = client.list_descendant_security_health_analytics_custom_modules request + # + # # The returned object is of type Gapic::PagedEnumerable. You can iterate + # # over elements, and API calls will be issued to fetch pages as needed. + # result.each do |item| + # # Each element is of type ::Google::Cloud::SecurityCenter::V1::SecurityHealthAnalyticsCustomModule. + # p item + # end + # + def list_descendant_security_health_analytics_custom_modules request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::SecurityCenter::V1::ListDescendantSecurityHealthAnalyticsCustomModulesRequest + + # Converts hash 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_descendant_security_health_analytics_custom_modules.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::SecurityCenter::V1::VERSION + metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.parent + header_params["parent"] = request.parent + end + + request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") + metadata[:"x-goog-request-params"] ||= request_params_header + + options.apply_defaults timeout: @config.rpcs.list_descendant_security_health_analytics_custom_modules.timeout, + metadata: metadata, + retry_policy: @config.rpcs.list_descendant_security_health_analytics_custom_modules.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @security_center_stub.call_rpc :list_descendant_security_health_analytics_custom_modules, request, options: options do |response, operation| + response = ::Gapic::PagedEnumerable.new @security_center_stub, :list_descendant_security_health_analytics_custom_modules, 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 + + ## + # Lists an organization or source's findings. + # + # To list across all sources provide a `-` as the source id. + # Example: /v1/organizations/\\{organization_id}/sources/-/findings + # + # @overload list_findings(request, options = nil) + # Pass arguments to `list_findings` via a request object, either of type + # {::Google::Cloud::SecurityCenter::V1::ListFindingsRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::SecurityCenter::V1::ListFindingsRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_findings(parent: nil, filter: nil, order_by: nil, read_time: nil, compare_duration: nil, field_mask: nil, page_token: nil, page_size: nil) + # Pass arguments to `list_findings` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param parent [::String] + # Required. Name of the source the findings belong to. Its format is + # `organizations/[organization_id]/sources/[source_id]`, + # `folders/[folder_id]/sources/[source_id]`, or + # `projects/[project_id]/sources/[source_id]`. To list across all sources + # provide a source_id of `-`. For example: + # `organizations/{organization_id}/sources/-`, + # `folders/{folder_id}/sources/-` or `projects/{projects_id}/sources/-` + # @param filter [::String] + # Expression that defines the filter to apply across findings. + # The expression is a list of one or more restrictions combined via logical + # operators `AND` and `OR`. + # Parentheses are supported, and `OR` has higher precedence than `AND`. + # + # Restrictions have the form ` ` and may have a `-` + # character in front of them to indicate negation. Examples include: + # + # * name + # * source_properties.a_property + # * security_marks.marks.marka + # + # The supported operators are: + # + # * `=` for all value types. + # * `>`, `<`, `>=`, `<=` for integer values. + # * `:`, meaning substring matching, for strings. + # + # The supported value types are: + # + # * string literals in quotes. + # * integer literals without quotes. + # * boolean literals `true` and `false` without quotes. + # + # The following field and operator combinations are supported: + # + # * name: `=` + # * parent: `=`, `:` + # * resource_name: `=`, `:` + # * state: `=`, `:` + # * category: `=`, `:` + # * external_uri: `=`, `:` + # * event_time: `=`, `>`, `<`, `>=`, `<=` + # + # Usage: This should be milliseconds since epoch or an RFC3339 string. + # Examples: + # `event_time = "2019-06-10T16:07:18-07:00"` + # `event_time = 1560208038000` + # + # * severity: `=`, `:` + # * workflow_state: `=`, `:` + # * security_marks.marks: `=`, `:` + # * source_properties: `=`, `:`, `>`, `<`, `>=`, `<=` + # + # For example, `source_properties.size = 100` is a valid filter string. + # + # Use a partial match on the empty string to filter based on a property + # existing: `source_properties.my_property : ""` + # + # Use a negated partial match on the empty string to filter based on a + # property not existing: `-source_properties.my_property : ""` + # + # * resource: + # * resource.name: `=`, `:` + # * resource.parent_name: `=`, `:` + # * resource.parent_display_name: `=`, `:` + # * resource.project_name: `=`, `:` + # * resource.project_display_name: `=`, `:` + # * resource.type: `=`, `:` + # * resource.folders.resource_folder: `=`, `:` + # * resource.display_name: `=`, `:` + # @param order_by [::String] + # Expression that defines what fields and order to use for sorting. The + # string value should follow SQL syntax: comma separated list of fields. For + # example: "name,resource_properties.a_property". The default sorting order + # is ascending. To specify descending order for a field, a suffix " desc" + # should be appended to the field name. For example: "name + # desc,source_properties.a_property". Redundant space characters in the + # syntax are insignificant. "name desc,source_properties.a_property" and " + # name desc , source_properties.a_property " are equivalent. + # + # The following fields are supported: + # name + # parent + # state + # category + # resource_name + # event_time + # source_properties + # security_marks.marks + # @param read_time [::Google::Protobuf::Timestamp, ::Hash] + # Time used as a reference point when filtering findings. The filter is + # limited to findings existing at the supplied time and their values are + # those at that specific time. Absence of this field will default to the + # API's version of NOW. + # @param compare_duration [::Google::Protobuf::Duration, ::Hash] + # When compare_duration is set, the ListFindingsResult's "state_change" + # attribute is updated to indicate whether the finding had its state changed, + # the finding's state remained unchanged, or if the finding was added in any + # state during the compare_duration period of time that precedes the + # read_time. This is the time between (read_time - compare_duration) and + # read_time. + # + # The state_change value is derived based on the presence and state of the + # finding at the two points in time. Intermediate state changes between the + # two times don't affect the result. For example, the results aren't affected + # if the finding is made inactive and then active again. + # + # Possible "state_change" values when compare_duration is specified: + # + # * "CHANGED": indicates that the finding was present and matched the given + # filter at the start of compare_duration, but changed its + # state at read_time. + # * "UNCHANGED": indicates that the finding was present and matched the given + # filter at the start of compare_duration and did not change + # state at read_time. + # * "ADDED": indicates that the finding did not match the given filter or + # was not present at the start of compare_duration, but was + # present at read_time. + # * "REMOVED": indicates that the finding was present and matched the + # filter at the start of compare_duration, but did not match + # the filter at read_time. + # + # If compare_duration is not specified, then the only possible state_change + # is "UNUSED", which will be the state_change set for all findings present at + # read_time. + # @param field_mask [::Google::Protobuf::FieldMask, ::Hash] + # A field mask to specify the Finding fields to be listed in the response. + # An empty field mask will list all fields. + # @param page_token [::String] + # The value returned by the last `ListFindingsResponse`; indicates + # that this is a continuation of a prior `ListFindings` call, and + # that the system should return the next page of data. + # @param page_size [::Integer] + # The maximum number of results to return in a single response. Default is + # 10, minimum is 1, maximum is 1000. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Gapic::PagedEnumerable<::Google::Cloud::SecurityCenter::V1::ListFindingsResponse::ListFindingsResult>] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Gapic::PagedEnumerable<::Google::Cloud::SecurityCenter::V1::ListFindingsResponse::ListFindingsResult>] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/security_center/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::SecurityCenter::V1::SecurityCenter::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::SecurityCenter::V1::ListFindingsRequest.new + # + # # Call the list_findings method. + # result = client.list_findings request + # + # # The returned object is of type Gapic::PagedEnumerable. You can iterate + # # over elements, and API calls will be issued to fetch pages as needed. + # result.each do |item| + # # Each element is of type ::Google::Cloud::SecurityCenter::V1::ListFindingsResponse::ListFindingsResult. + # p item + # end + # + def list_findings request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::SecurityCenter::V1::ListFindingsRequest + + # Converts hash 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_findings.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::SecurityCenter::V1::VERSION + metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.parent + header_params["parent"] = request.parent + end + + request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") + metadata[:"x-goog-request-params"] ||= request_params_header + + options.apply_defaults timeout: @config.rpcs.list_findings.timeout, + metadata: metadata, + retry_policy: @config.rpcs.list_findings.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @security_center_stub.call_rpc :list_findings, request, options: options do |response, operation| + response = ::Gapic::PagedEnumerable.new @security_center_stub, :list_findings, 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 + + ## + # Lists mute configs. + # + # @overload list_mute_configs(request, options = nil) + # Pass arguments to `list_mute_configs` via a request object, either of type + # {::Google::Cloud::SecurityCenter::V1::ListMuteConfigsRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::SecurityCenter::V1::ListMuteConfigsRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_mute_configs(parent: nil, page_size: nil, page_token: nil) + # Pass arguments to `list_mute_configs` via keyword arguments. Note that at + # least one keyword argument is 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, which owns the collection of mute configs. Its format + # is `organizations/[organization_id]`, `folders/[folder_id]`, + # `projects/[project_id]`. + # @param page_size [::Integer] + # The maximum number of configs to return. The service may return fewer than + # this value. + # If unspecified, at most 10 configs will be returned. + # The maximum value is 1000; values above 1000 will be coerced to 1000. + # @param page_token [::String] + # A page token, received from a previous `ListMuteConfigs` call. + # Provide this to retrieve the subsequent page. + # + # When paginating, all other parameters provided to `ListMuteConfigs` 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::Cloud::SecurityCenter::V1::MuteConfig>] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Gapic::PagedEnumerable<::Google::Cloud::SecurityCenter::V1::MuteConfig>] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/security_center/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::SecurityCenter::V1::SecurityCenter::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::SecurityCenter::V1::ListMuteConfigsRequest.new + # + # # Call the list_mute_configs method. + # result = client.list_mute_configs request + # + # # The returned object is of type Gapic::PagedEnumerable. You can iterate + # # over elements, and API calls will be issued to fetch pages as needed. + # result.each do |item| + # # Each element is of type ::Google::Cloud::SecurityCenter::V1::MuteConfig. + # p item + # end + # + def list_mute_configs request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::SecurityCenter::V1::ListMuteConfigsRequest + + # Converts hash 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_mute_configs.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::SecurityCenter::V1::VERSION + metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.parent + header_params["parent"] = request.parent + end + + request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") + metadata[:"x-goog-request-params"] ||= request_params_header + + options.apply_defaults timeout: @config.rpcs.list_mute_configs.timeout, + metadata: metadata, + retry_policy: @config.rpcs.list_mute_configs.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @security_center_stub.call_rpc :list_mute_configs, request, options: options do |response, operation| + response = ::Gapic::PagedEnumerable.new @security_center_stub, :list_mute_configs, 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 + + ## + # Lists notification configs. + # + # @overload list_notification_configs(request, options = nil) + # Pass arguments to `list_notification_configs` via a request object, either of type + # {::Google::Cloud::SecurityCenter::V1::ListNotificationConfigsRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::SecurityCenter::V1::ListNotificationConfigsRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_notification_configs(parent: nil, page_token: nil, page_size: nil) + # Pass arguments to `list_notification_configs` via keyword arguments. Note that at + # least one keyword argument is 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 name of the parent in which to list the notification + # configurations. Its format is "organizations/[organization_id]", + # "folders/[folder_id]", or "projects/[project_id]". + # @param page_token [::String] + # The value returned by the last `ListNotificationConfigsResponse`; indicates + # that this is a continuation of a prior `ListNotificationConfigs` call, and + # that the system should return the next page of data. + # @param page_size [::Integer] + # The maximum number of results to return in a single response. Default is + # 10, minimum is 1, maximum is 1000. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Gapic::PagedEnumerable<::Google::Cloud::SecurityCenter::V1::NotificationConfig>] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Gapic::PagedEnumerable<::Google::Cloud::SecurityCenter::V1::NotificationConfig>] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/security_center/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::SecurityCenter::V1::SecurityCenter::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::SecurityCenter::V1::ListNotificationConfigsRequest.new + # + # # Call the list_notification_configs method. + # result = client.list_notification_configs request + # + # # The returned object is of type Gapic::PagedEnumerable. You can iterate + # # over elements, and API calls will be issued to fetch pages as needed. + # result.each do |item| + # # Each element is of type ::Google::Cloud::SecurityCenter::V1::NotificationConfig. + # p item + # end + # + def list_notification_configs request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::SecurityCenter::V1::ListNotificationConfigsRequest + + # Converts hash 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_notification_configs.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::SecurityCenter::V1::VERSION + metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.parent + header_params["parent"] = request.parent + end + + request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") + metadata[:"x-goog-request-params"] ||= request_params_header + + options.apply_defaults timeout: @config.rpcs.list_notification_configs.timeout, + metadata: metadata, + retry_policy: @config.rpcs.list_notification_configs.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @security_center_stub.call_rpc :list_notification_configs, request, options: options do |response, operation| + response = ::Gapic::PagedEnumerable.new @security_center_stub, :list_notification_configs, 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 a list of all EffectiveSecurityHealthAnalyticsCustomModules for the + # given parent. This includes resident modules defined at the scope of the + # parent, and inherited modules, inherited from CRM ancestors. + # + # @overload list_effective_security_health_analytics_custom_modules(request, options = nil) + # Pass arguments to `list_effective_security_health_analytics_custom_modules` via a request object, either of type + # {::Google::Cloud::SecurityCenter::V1::ListEffectiveSecurityHealthAnalyticsCustomModulesRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::SecurityCenter::V1::ListEffectiveSecurityHealthAnalyticsCustomModulesRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_effective_security_health_analytics_custom_modules(parent: nil, page_size: nil, page_token: nil) + # Pass arguments to `list_effective_security_health_analytics_custom_modules` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param parent [::String] + # Required. Name of parent to list effective custom modules. Its format is + # `organizations/{organization}/securityHealthAnalyticsSettings`, + # `folders/{folder}/securityHealthAnalyticsSettings`, or + # `projects/{project}/securityHealthAnalyticsSettings` + # @param page_size [::Integer] + # The maximum number of results to return in a single response. Default is + # 10, minimum is 1, maximum is 1000. + # @param page_token [::String] + # The value returned by the last call indicating a continuation + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Gapic::PagedEnumerable<::Google::Cloud::SecurityCenter::V1::EffectiveSecurityHealthAnalyticsCustomModule>] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Gapic::PagedEnumerable<::Google::Cloud::SecurityCenter::V1::EffectiveSecurityHealthAnalyticsCustomModule>] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/security_center/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::SecurityCenter::V1::SecurityCenter::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::SecurityCenter::V1::ListEffectiveSecurityHealthAnalyticsCustomModulesRequest.new + # + # # Call the list_effective_security_health_analytics_custom_modules method. + # result = client.list_effective_security_health_analytics_custom_modules request + # + # # The returned object is of type Gapic::PagedEnumerable. You can iterate + # # over elements, and API calls will be issued to fetch pages as needed. + # result.each do |item| + # # Each element is of type ::Google::Cloud::SecurityCenter::V1::EffectiveSecurityHealthAnalyticsCustomModule. + # p item + # end + # + def list_effective_security_health_analytics_custom_modules request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::SecurityCenter::V1::ListEffectiveSecurityHealthAnalyticsCustomModulesRequest + + # Converts hash 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_effective_security_health_analytics_custom_modules.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::SecurityCenter::V1::VERSION + metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.parent + header_params["parent"] = request.parent + end + + request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") + metadata[:"x-goog-request-params"] ||= request_params_header + + options.apply_defaults timeout: @config.rpcs.list_effective_security_health_analytics_custom_modules.timeout, + metadata: metadata, + retry_policy: @config.rpcs.list_effective_security_health_analytics_custom_modules.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @security_center_stub.call_rpc :list_effective_security_health_analytics_custom_modules, request, options: options do |response, operation| + response = ::Gapic::PagedEnumerable.new @security_center_stub, :list_effective_security_health_analytics_custom_modules, 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 a list of all SecurityHealthAnalyticsCustomModules for the given + # parent. This includes resident modules defined at the scope of the parent, + # and inherited modules, inherited from CRM ancestors. + # + # @overload list_security_health_analytics_custom_modules(request, options = nil) + # Pass arguments to `list_security_health_analytics_custom_modules` via a request object, either of type + # {::Google::Cloud::SecurityCenter::V1::ListSecurityHealthAnalyticsCustomModulesRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::SecurityCenter::V1::ListSecurityHealthAnalyticsCustomModulesRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_security_health_analytics_custom_modules(parent: nil, page_size: nil, page_token: nil) + # Pass arguments to `list_security_health_analytics_custom_modules` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param parent [::String] + # Required. Name of parent to list custom modules. Its format is + # `organizations/{organization}/securityHealthAnalyticsSettings`, + # `folders/{folder}/securityHealthAnalyticsSettings`, or + # `projects/{project}/securityHealthAnalyticsSettings` + # @param page_size [::Integer] + # The maximum number of results to return in a single response. Default is + # 10, minimum is 1, maximum is 1000. + # @param page_token [::String] + # The value returned by the last call indicating a continuation + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Gapic::PagedEnumerable<::Google::Cloud::SecurityCenter::V1::SecurityHealthAnalyticsCustomModule>] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Gapic::PagedEnumerable<::Google::Cloud::SecurityCenter::V1::SecurityHealthAnalyticsCustomModule>] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/security_center/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::SecurityCenter::V1::SecurityCenter::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::SecurityCenter::V1::ListSecurityHealthAnalyticsCustomModulesRequest.new + # + # # Call the list_security_health_analytics_custom_modules method. + # result = client.list_security_health_analytics_custom_modules request + # + # # The returned object is of type Gapic::PagedEnumerable. You can iterate + # # over elements, and API calls will be issued to fetch pages as needed. + # result.each do |item| + # # Each element is of type ::Google::Cloud::SecurityCenter::V1::SecurityHealthAnalyticsCustomModule. + # p item + # end + # + def list_security_health_analytics_custom_modules request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::SecurityCenter::V1::ListSecurityHealthAnalyticsCustomModulesRequest + + # Converts hash 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_security_health_analytics_custom_modules.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::SecurityCenter::V1::VERSION + metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.parent + header_params["parent"] = request.parent + end + + request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") + metadata[:"x-goog-request-params"] ||= request_params_header + + options.apply_defaults timeout: @config.rpcs.list_security_health_analytics_custom_modules.timeout, + metadata: metadata, + retry_policy: @config.rpcs.list_security_health_analytics_custom_modules.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @security_center_stub.call_rpc :list_security_health_analytics_custom_modules, request, options: options do |response, operation| + response = ::Gapic::PagedEnumerable.new @security_center_stub, :list_security_health_analytics_custom_modules, 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 + + ## + # Lists all sources belonging to an organization. + # + # @overload list_sources(request, options = nil) + # Pass arguments to `list_sources` via a request object, either of type + # {::Google::Cloud::SecurityCenter::V1::ListSourcesRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::SecurityCenter::V1::ListSourcesRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_sources(parent: nil, page_token: nil, page_size: nil) + # Pass arguments to `list_sources` via keyword arguments. Note that at + # least one keyword argument is 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. Resource name of the parent of sources to list. Its format should + # be `organizations/[organization_id]`, `folders/[folder_id]`, or + # `projects/[project_id]`. + # @param page_token [::String] + # The value returned by the last `ListSourcesResponse`; indicates + # that this is a continuation of a prior `ListSources` call, and + # that the system should return the next page of data. + # @param page_size [::Integer] + # The maximum number of results to return in a single response. Default is + # 10, minimum is 1, maximum is 1000. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Gapic::PagedEnumerable<::Google::Cloud::SecurityCenter::V1::Source>] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Gapic::PagedEnumerable<::Google::Cloud::SecurityCenter::V1::Source>] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/security_center/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::SecurityCenter::V1::SecurityCenter::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::SecurityCenter::V1::ListSourcesRequest.new + # + # # Call the list_sources method. + # result = client.list_sources request + # + # # The returned object is of type Gapic::PagedEnumerable. You can iterate + # # over elements, and API calls will be issued to fetch pages as needed. + # result.each do |item| + # # Each element is of type ::Google::Cloud::SecurityCenter::V1::Source. + # p item + # end + # + def list_sources request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::SecurityCenter::V1::ListSourcesRequest + + # Converts hash 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_sources.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::SecurityCenter::V1::VERSION + metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.parent + header_params["parent"] = request.parent + end + + request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") + metadata[:"x-goog-request-params"] ||= request_params_header + + options.apply_defaults timeout: @config.rpcs.list_sources.timeout, + metadata: metadata, + retry_policy: @config.rpcs.list_sources.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @security_center_stub.call_rpc :list_sources, request, options: options do |response, operation| + response = ::Gapic::PagedEnumerable.new @security_center_stub, :list_sources, 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 + + ## + # Runs asset discovery. The discovery is tracked with a long-running + # operation. + # + # This API can only be called with limited frequency for an organization. If + # it is called too frequently the caller will receive a TOO_MANY_REQUESTS + # error. + # + # @deprecated This method is deprecated and may be removed in the next major version update. + # + # @overload run_asset_discovery(request, options = nil) + # Pass arguments to `run_asset_discovery` via a request object, either of type + # {::Google::Cloud::SecurityCenter::V1::RunAssetDiscoveryRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::SecurityCenter::V1::RunAssetDiscoveryRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. + # + # @overload run_asset_discovery(parent: nil) + # Pass arguments to `run_asset_discovery` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param parent [::String] + # Required. Name of the organization to run asset discovery for. Its format + # is `organizations/[organization_id]`. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Gapic::Operation] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Gapic::Operation] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/security_center/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::SecurityCenter::V1::SecurityCenter::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::SecurityCenter::V1::RunAssetDiscoveryRequest.new + # + # # Call the run_asset_discovery method. + # result = client.run_asset_discovery 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 run_asset_discovery request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::SecurityCenter::V1::RunAssetDiscoveryRequest + + # Converts hash 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.run_asset_discovery.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::SecurityCenter::V1::VERSION + metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.parent + header_params["parent"] = request.parent + end + + request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") + metadata[:"x-goog-request-params"] ||= request_params_header + + options.apply_defaults timeout: @config.rpcs.run_asset_discovery.timeout, + metadata: metadata, + retry_policy: @config.rpcs.run_asset_discovery.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @security_center_stub.call_rpc :run_asset_discovery, request, options: options do |response, operation| + response = ::Gapic::Operation.new response, @operations_client, options: options + yield response, operation if block_given? + throw :response, response + end + rescue ::GRPC::BadStatus => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Updates the state of a finding. + # + # @overload set_finding_state(request, options = nil) + # Pass arguments to `set_finding_state` via a request object, either of type + # {::Google::Cloud::SecurityCenter::V1::SetFindingStateRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::SecurityCenter::V1::SetFindingStateRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. + # + # @overload set_finding_state(name: nil, state: nil, start_time: nil) + # Pass arguments to `set_finding_state` via keyword arguments. Note that at + # least one keyword argument is 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 [relative resource + # name](https://cloud.google.com/apis/design/resource_names#relative_resource_name) + # of the finding. Example: + # `organizations/{organization_id}/sources/{source_id}/findings/{finding_id}`, + # `folders/{folder_id}/sources/{source_id}/findings/{finding_id}`, + # `projects/{project_id}/sources/{source_id}/findings/{finding_id}`. + # @param state [::Google::Cloud::SecurityCenter::V1::Finding::State] + # Required. The desired State of the finding. + # @param start_time [::Google::Protobuf::Timestamp, ::Hash] + # Required. The time at which the updated state takes effect. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Google::Cloud::SecurityCenter::V1::Finding] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Google::Cloud::SecurityCenter::V1::Finding] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/security_center/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::SecurityCenter::V1::SecurityCenter::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::SecurityCenter::V1::SetFindingStateRequest.new + # + # # Call the set_finding_state method. + # result = client.set_finding_state request + # + # # The returned object is of type Google::Cloud::SecurityCenter::V1::Finding. + # p result + # + def set_finding_state request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::SecurityCenter::V1::SetFindingStateRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + metadata = @config.rpcs.set_finding_state.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::SecurityCenter::V1::VERSION + metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.name + header_params["name"] = request.name + end + + request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") + metadata[:"x-goog-request-params"] ||= request_params_header + + options.apply_defaults timeout: @config.rpcs.set_finding_state.timeout, + metadata: metadata, + retry_policy: @config.rpcs.set_finding_state.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @security_center_stub.call_rpc :set_finding_state, request, options: options do |response, operation| + yield response, operation if block_given? + end + rescue ::GRPC::BadStatus => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Updates the mute state of a finding. + # + # @overload set_mute(request, options = nil) + # Pass arguments to `set_mute` via a request object, either of type + # {::Google::Cloud::SecurityCenter::V1::SetMuteRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::SecurityCenter::V1::SetMuteRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. + # + # @overload set_mute(name: nil, mute: nil) + # Pass arguments to `set_mute` via keyword arguments. Note that at + # least one keyword argument is 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 [relative resource + # name](https://cloud.google.com/apis/design/resource_names#relative_resource_name) + # of the finding. Example: + # `organizations/{organization_id}/sources/{source_id}/findings/{finding_id}`, + # `folders/{folder_id}/sources/{source_id}/findings/{finding_id}`, + # `projects/{project_id}/sources/{source_id}/findings/{finding_id}`. + # @param mute [::Google::Cloud::SecurityCenter::V1::Finding::Mute] + # Required. The desired state of the Mute. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Google::Cloud::SecurityCenter::V1::Finding] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Google::Cloud::SecurityCenter::V1::Finding] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/security_center/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::SecurityCenter::V1::SecurityCenter::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::SecurityCenter::V1::SetMuteRequest.new + # + # # Call the set_mute method. + # result = client.set_mute request + # + # # The returned object is of type Google::Cloud::SecurityCenter::V1::Finding. + # p result + # + def set_mute request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::SecurityCenter::V1::SetMuteRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + metadata = @config.rpcs.set_mute.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::SecurityCenter::V1::VERSION + metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.name + header_params["name"] = request.name + end + + request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") + metadata[:"x-goog-request-params"] ||= request_params_header + + options.apply_defaults timeout: @config.rpcs.set_mute.timeout, + metadata: metadata, + retry_policy: @config.rpcs.set_mute.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @security_center_stub.call_rpc :set_mute, request, options: options do |response, operation| + yield response, operation if block_given? + end + rescue ::GRPC::BadStatus => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Sets the access control policy on the specified Source. + # + # @overload set_iam_policy(request, options = nil) + # Pass arguments to `set_iam_policy` via a request object, either of type + # {::Google::Iam::V1::SetIamPolicyRequest} or an equivalent Hash. + # + # @param request [::Google::Iam::V1::SetIamPolicyRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. + # + # @overload set_iam_policy(resource: nil, policy: nil, update_mask: nil) + # Pass arguments to `set_iam_policy` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param resource [::String] + # REQUIRED: The resource for which the policy is being specified. + # See the operation documentation for the appropriate value for this field. + # @param policy [::Google::Iam::V1::Policy, ::Hash] + # REQUIRED: The complete policy to be applied to the `resource`. The size of + # the policy is limited to a few 10s of KB. An empty policy is a + # valid policy but certain Cloud Platform services (such as Projects) + # might reject them. + # @param update_mask [::Google::Protobuf::FieldMask, ::Hash] + # OPTIONAL: A FieldMask specifying which fields of the policy to modify. Only + # the fields in the mask will be modified. If no mask is provided, the + # following default mask is used: + # + # `paths: "bindings, etag"` + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Google::Iam::V1::Policy] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Google::Iam::V1::Policy] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/security_center/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::SecurityCenter::V1::SecurityCenter::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Iam::V1::SetIamPolicyRequest.new + # + # # Call the set_iam_policy method. + # result = client.set_iam_policy request + # + # # The returned object is of type Google::Iam::V1::Policy. + # p result + # + def set_iam_policy request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Iam::V1::SetIamPolicyRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + metadata = @config.rpcs.set_iam_policy.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::SecurityCenter::V1::VERSION + metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.resource + header_params["resource"] = request.resource + end + + request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") + metadata[:"x-goog-request-params"] ||= request_params_header + + options.apply_defaults timeout: @config.rpcs.set_iam_policy.timeout, + metadata: metadata, + retry_policy: @config.rpcs.set_iam_policy.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @security_center_stub.call_rpc :set_iam_policy, request, options: options do |response, operation| + yield response, operation if block_given? + end + rescue ::GRPC::BadStatus => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Returns the permissions that a caller has on the specified source. + # + # @overload test_iam_permissions(request, options = nil) + # Pass arguments to `test_iam_permissions` via a request object, either of type + # {::Google::Iam::V1::TestIamPermissionsRequest} or an equivalent Hash. + # + # @param request [::Google::Iam::V1::TestIamPermissionsRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. + # + # @overload test_iam_permissions(resource: nil, permissions: nil) + # Pass arguments to `test_iam_permissions` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param resource [::String] + # REQUIRED: The resource for which the policy detail is being requested. + # See the operation documentation for the appropriate value for this field. + # @param permissions [::Array<::String>] + # The set of permissions to check for the `resource`. Permissions with + # wildcards (such as '*' or 'storage.*') are not allowed. For more + # information see + # [IAM Overview](https://cloud.google.com/iam/docs/overview#permissions). + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Google::Iam::V1::TestIamPermissionsResponse] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Google::Iam::V1::TestIamPermissionsResponse] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/security_center/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::SecurityCenter::V1::SecurityCenter::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Iam::V1::TestIamPermissionsRequest.new + # + # # Call the test_iam_permissions method. + # result = client.test_iam_permissions request + # + # # The returned object is of type Google::Iam::V1::TestIamPermissionsResponse. + # p result + # + def test_iam_permissions request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Iam::V1::TestIamPermissionsRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + metadata = @config.rpcs.test_iam_permissions.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::SecurityCenter::V1::VERSION + metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.resource + header_params["resource"] = request.resource + end + + request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") + metadata[:"x-goog-request-params"] ||= request_params_header + + options.apply_defaults timeout: @config.rpcs.test_iam_permissions.timeout, + metadata: metadata, + retry_policy: @config.rpcs.test_iam_permissions.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @security_center_stub.call_rpc :test_iam_permissions, request, options: options do |response, operation| + yield response, operation if block_given? + end + rescue ::GRPC::BadStatus => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Simulates a given SecurityHealthAnalyticsCustomModule and Resource. + # + # @overload simulate_security_health_analytics_custom_module(request, options = nil) + # Pass arguments to `simulate_security_health_analytics_custom_module` via a request object, either of type + # {::Google::Cloud::SecurityCenter::V1::SimulateSecurityHealthAnalyticsCustomModuleRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::SecurityCenter::V1::SimulateSecurityHealthAnalyticsCustomModuleRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. + # + # @overload simulate_security_health_analytics_custom_module(parent: nil, custom_config: nil, resource: nil) + # Pass arguments to `simulate_security_health_analytics_custom_module` via keyword arguments. Note that at + # least one keyword argument is 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 relative resource name of the organization, project, or + # folder. For more information about relative resource names, see [Relative + # Resource + # Name](https://cloud.google.com/apis/design/resource_names#relative_resource_name) + # Example: `organizations/{organization_id}` + # @param custom_config [::Google::Cloud::SecurityCenter::V1::CustomConfig, ::Hash] + # Required. The custom configuration that you need to test. + # @param resource [::Google::Cloud::SecurityCenter::V1::SimulateSecurityHealthAnalyticsCustomModuleRequest::SimulatedResource, ::Hash] + # Required. Resource data to simulate custom module against. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Google::Cloud::SecurityCenter::V1::SimulateSecurityHealthAnalyticsCustomModuleResponse] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Google::Cloud::SecurityCenter::V1::SimulateSecurityHealthAnalyticsCustomModuleResponse] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/security_center/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::SecurityCenter::V1::SecurityCenter::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::SecurityCenter::V1::SimulateSecurityHealthAnalyticsCustomModuleRequest.new + # + # # Call the simulate_security_health_analytics_custom_module method. + # result = client.simulate_security_health_analytics_custom_module request + # + # # The returned object is of type Google::Cloud::SecurityCenter::V1::SimulateSecurityHealthAnalyticsCustomModuleResponse. + # p result + # + def simulate_security_health_analytics_custom_module request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::SecurityCenter::V1::SimulateSecurityHealthAnalyticsCustomModuleRequest + + # Converts hash 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.simulate_security_health_analytics_custom_module.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::SecurityCenter::V1::VERSION + metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.parent + header_params["parent"] = request.parent + end + + request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") + metadata[:"x-goog-request-params"] ||= request_params_header + + options.apply_defaults timeout: @config.rpcs.simulate_security_health_analytics_custom_module.timeout, + metadata: metadata, + retry_policy: @config.rpcs.simulate_security_health_analytics_custom_module.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @security_center_stub.call_rpc :simulate_security_health_analytics_custom_module, 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 external system. This is for a given finding. + # + # @overload update_external_system(request, options = nil) + # Pass arguments to `update_external_system` via a request object, either of type + # {::Google::Cloud::SecurityCenter::V1::UpdateExternalSystemRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::SecurityCenter::V1::UpdateExternalSystemRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_external_system(external_system: nil, update_mask: nil) + # Pass arguments to `update_external_system` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param external_system [::Google::Cloud::SecurityCenter::V1::ExternalSystem, ::Hash] + # Required. The external system resource to update. + # @param update_mask [::Google::Protobuf::FieldMask, ::Hash] + # The FieldMask to use when updating the external system resource. + # + # If empty all mutable fields will be updated. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Google::Cloud::SecurityCenter::V1::ExternalSystem] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Google::Cloud::SecurityCenter::V1::ExternalSystem] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/security_center/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::SecurityCenter::V1::SecurityCenter::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::SecurityCenter::V1::UpdateExternalSystemRequest.new + # + # # Call the update_external_system method. + # result = client.update_external_system request + # + # # The returned object is of type Google::Cloud::SecurityCenter::V1::ExternalSystem. + # p result + # + def update_external_system request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::SecurityCenter::V1::UpdateExternalSystemRequest + + # Converts hash 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_external_system.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::SecurityCenter::V1::VERSION + metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.external_system&.name + header_params["external_system.name"] = request.external_system.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_external_system.timeout, + metadata: metadata, + retry_policy: @config.rpcs.update_external_system.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @security_center_stub.call_rpc :update_external_system, request, options: options do |response, operation| + yield response, operation if block_given? + end + rescue ::GRPC::BadStatus => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Creates or updates a finding. The corresponding source must exist for a + # finding creation to succeed. + # + # @overload update_finding(request, options = nil) + # Pass arguments to `update_finding` via a request object, either of type + # {::Google::Cloud::SecurityCenter::V1::UpdateFindingRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::SecurityCenter::V1::UpdateFindingRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_finding(finding: nil, update_mask: nil) + # Pass arguments to `update_finding` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param finding [::Google::Cloud::SecurityCenter::V1::Finding, ::Hash] + # Required. The finding resource to update or create if it does not already + # exist. parent, security_marks, and update_time will be ignored. + # + # In the case of creation, the finding id portion of the name must be + # alphanumeric and less than or equal to 32 characters and greater than 0 + # characters in length. + # @param update_mask [::Google::Protobuf::FieldMask, ::Hash] + # The FieldMask to use when updating the finding resource. This field should + # not be specified when creating a finding. + # + # When updating a finding, an empty mask is treated as updating all mutable + # fields and replacing source_properties. Individual source_properties can + # be added/updated by using "source_properties." in the field + # mask. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Google::Cloud::SecurityCenter::V1::Finding] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Google::Cloud::SecurityCenter::V1::Finding] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/security_center/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::SecurityCenter::V1::SecurityCenter::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::SecurityCenter::V1::UpdateFindingRequest.new + # + # # Call the update_finding method. + # result = client.update_finding request + # + # # The returned object is of type Google::Cloud::SecurityCenter::V1::Finding. + # p result + # + def update_finding request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::SecurityCenter::V1::UpdateFindingRequest + + # Converts hash 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_finding.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::SecurityCenter::V1::VERSION + metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.finding&.name + header_params["finding.name"] = request.finding.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_finding.timeout, + metadata: metadata, + retry_policy: @config.rpcs.update_finding.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @security_center_stub.call_rpc :update_finding, 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 mute config. + # + # @overload update_mute_config(request, options = nil) + # Pass arguments to `update_mute_config` via a request object, either of type + # {::Google::Cloud::SecurityCenter::V1::UpdateMuteConfigRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::SecurityCenter::V1::UpdateMuteConfigRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_mute_config(mute_config: nil, update_mask: nil) + # Pass arguments to `update_mute_config` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param mute_config [::Google::Cloud::SecurityCenter::V1::MuteConfig, ::Hash] + # Required. The mute config being updated. + # @param update_mask [::Google::Protobuf::FieldMask, ::Hash] + # The list of fields to be updated. + # If empty all mutable fields will be updated. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Google::Cloud::SecurityCenter::V1::MuteConfig] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Google::Cloud::SecurityCenter::V1::MuteConfig] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/security_center/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::SecurityCenter::V1::SecurityCenter::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::SecurityCenter::V1::UpdateMuteConfigRequest.new + # + # # Call the update_mute_config method. + # result = client.update_mute_config request + # + # # The returned object is of type Google::Cloud::SecurityCenter::V1::MuteConfig. + # p result + # + def update_mute_config request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::SecurityCenter::V1::UpdateMuteConfigRequest + + # Converts hash 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_mute_config.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::SecurityCenter::V1::VERSION + metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.mute_config&.name + header_params["mute_config.name"] = request.mute_config.name + end + + request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") + metadata[:"x-goog-request-params"] ||= request_params_header + + options.apply_defaults timeout: @config.rpcs.update_mute_config.timeout, + metadata: metadata, + retry_policy: @config.rpcs.update_mute_config.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @security_center_stub.call_rpc :update_mute_config, request, options: options do |response, operation| + yield response, operation if block_given? + end + rescue ::GRPC::BadStatus => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Updates a notification config. The following update + # fields are allowed: description, pubsub_topic, streaming_config.filter + # + # @overload update_notification_config(request, options = nil) + # Pass arguments to `update_notification_config` via a request object, either of type + # {::Google::Cloud::SecurityCenter::V1::UpdateNotificationConfigRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::SecurityCenter::V1::UpdateNotificationConfigRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_notification_config(notification_config: nil, update_mask: nil) + # Pass arguments to `update_notification_config` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param notification_config [::Google::Cloud::SecurityCenter::V1::NotificationConfig, ::Hash] + # Required. The notification config to update. + # @param update_mask [::Google::Protobuf::FieldMask, ::Hash] + # The FieldMask to use when updating the notification config. + # + # If empty all mutable fields will be updated. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Google::Cloud::SecurityCenter::V1::NotificationConfig] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Google::Cloud::SecurityCenter::V1::NotificationConfig] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/security_center/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::SecurityCenter::V1::SecurityCenter::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::SecurityCenter::V1::UpdateNotificationConfigRequest.new + # + # # Call the update_notification_config method. + # result = client.update_notification_config request + # + # # The returned object is of type Google::Cloud::SecurityCenter::V1::NotificationConfig. + # p result + # + def update_notification_config request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::SecurityCenter::V1::UpdateNotificationConfigRequest + + # Converts hash 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_notification_config.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::SecurityCenter::V1::VERSION + metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.notification_config&.name + header_params["notification_config.name"] = request.notification_config.name + end + + request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") + metadata[:"x-goog-request-params"] ||= request_params_header + + options.apply_defaults timeout: @config.rpcs.update_notification_config.timeout, + metadata: metadata, + retry_policy: @config.rpcs.update_notification_config.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @security_center_stub.call_rpc :update_notification_config, request, options: options do |response, operation| + yield response, operation if block_given? + end + rescue ::GRPC::BadStatus => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Updates an organization's settings. + # + # @overload update_organization_settings(request, options = nil) + # Pass arguments to `update_organization_settings` via a request object, either of type + # {::Google::Cloud::SecurityCenter::V1::UpdateOrganizationSettingsRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::SecurityCenter::V1::UpdateOrganizationSettingsRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. + # + # @overload update_organization_settings(organization_settings: nil, update_mask: nil) + # Pass arguments to `update_organization_settings` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param organization_settings [::Google::Cloud::SecurityCenter::V1::OrganizationSettings, ::Hash] + # Required. The organization settings resource to update. + # @param update_mask [::Google::Protobuf::FieldMask, ::Hash] + # The FieldMask to use when updating the settings resource. + # + # If empty all mutable fields will be updated. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Google::Cloud::SecurityCenter::V1::OrganizationSettings] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Google::Cloud::SecurityCenter::V1::OrganizationSettings] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/security_center/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::SecurityCenter::V1::SecurityCenter::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::SecurityCenter::V1::UpdateOrganizationSettingsRequest.new + # + # # Call the update_organization_settings method. + # result = client.update_organization_settings request + # + # # The returned object is of type Google::Cloud::SecurityCenter::V1::OrganizationSettings. + # p result + # + def update_organization_settings request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::SecurityCenter::V1::UpdateOrganizationSettingsRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + metadata = @config.rpcs.update_organization_settings.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::SecurityCenter::V1::VERSION + metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.organization_settings&.name + header_params["organization_settings.name"] = request.organization_settings.name + end + + request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") + metadata[:"x-goog-request-params"] ||= request_params_header + + options.apply_defaults timeout: @config.rpcs.update_organization_settings.timeout, + metadata: metadata, + retry_policy: @config.rpcs.update_organization_settings.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @security_center_stub.call_rpc :update_organization_settings, request, options: options do |response, operation| + yield response, operation if block_given? + end + rescue ::GRPC::BadStatus => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Updates the SecurityHealthAnalyticsCustomModule under the given name based + # on the given update mask. Updating the enablement state is supported on + # both resident and inherited modules (though resident modules cannot have an + # enablement state of "inherited"). Updating the display name and custom + # config of a module is supported on resident modules only. + # + # @overload update_security_health_analytics_custom_module(request, options = nil) + # Pass arguments to `update_security_health_analytics_custom_module` via a request object, either of type + # {::Google::Cloud::SecurityCenter::V1::UpdateSecurityHealthAnalyticsCustomModuleRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::SecurityCenter::V1::UpdateSecurityHealthAnalyticsCustomModuleRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_security_health_analytics_custom_module(security_health_analytics_custom_module: nil, update_mask: nil) + # Pass arguments to `update_security_health_analytics_custom_module` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param security_health_analytics_custom_module [::Google::Cloud::SecurityCenter::V1::SecurityHealthAnalyticsCustomModule, ::Hash] + # Required. The SecurityHealthAnalytics custom module to update. + # @param update_mask [::Google::Protobuf::FieldMask, ::Hash] + # The list of fields to be updated. The only fields that can be updated are + # `enablement_state` and `custom_config`. If empty or set to the wildcard + # value `*`, both `enablement_state` and `custom_config` are updated. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Google::Cloud::SecurityCenter::V1::SecurityHealthAnalyticsCustomModule] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Google::Cloud::SecurityCenter::V1::SecurityHealthAnalyticsCustomModule] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/security_center/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::SecurityCenter::V1::SecurityCenter::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::SecurityCenter::V1::UpdateSecurityHealthAnalyticsCustomModuleRequest.new + # + # # Call the update_security_health_analytics_custom_module method. + # result = client.update_security_health_analytics_custom_module request + # + # # The returned object is of type Google::Cloud::SecurityCenter::V1::SecurityHealthAnalyticsCustomModule. + # p result + # + def update_security_health_analytics_custom_module request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::SecurityCenter::V1::UpdateSecurityHealthAnalyticsCustomModuleRequest + + # Converts hash 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_security_health_analytics_custom_module.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::SecurityCenter::V1::VERSION + metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.security_health_analytics_custom_module&.name + header_params["security_health_analytics_custom_module.name"] = request.security_health_analytics_custom_module.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_security_health_analytics_custom_module.timeout, + metadata: metadata, + retry_policy: @config.rpcs.update_security_health_analytics_custom_module.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @security_center_stub.call_rpc :update_security_health_analytics_custom_module, 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 source. + # + # @overload update_source(request, options = nil) + # Pass arguments to `update_source` via a request object, either of type + # {::Google::Cloud::SecurityCenter::V1::UpdateSourceRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::SecurityCenter::V1::UpdateSourceRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_source(source: nil, update_mask: nil) + # Pass arguments to `update_source` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param source [::Google::Cloud::SecurityCenter::V1::Source, ::Hash] + # Required. The source resource to update. + # @param update_mask [::Google::Protobuf::FieldMask, ::Hash] + # The FieldMask to use when updating the source resource. + # + # If empty all mutable fields will be updated. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Google::Cloud::SecurityCenter::V1::Source] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Google::Cloud::SecurityCenter::V1::Source] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/security_center/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::SecurityCenter::V1::SecurityCenter::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::SecurityCenter::V1::UpdateSourceRequest.new + # + # # Call the update_source method. + # result = client.update_source request + # + # # The returned object is of type Google::Cloud::SecurityCenter::V1::Source. + # p result + # + def update_source request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::SecurityCenter::V1::UpdateSourceRequest + + # Converts hash 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_source.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::SecurityCenter::V1::VERSION + metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.source&.name + header_params["source.name"] = request.source.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_source.timeout, + metadata: metadata, + retry_policy: @config.rpcs.update_source.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @security_center_stub.call_rpc :update_source, 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 security marks. + # + # @overload update_security_marks(request, options = nil) + # Pass arguments to `update_security_marks` via a request object, either of type + # {::Google::Cloud::SecurityCenter::V1::UpdateSecurityMarksRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::SecurityCenter::V1::UpdateSecurityMarksRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_security_marks(security_marks: nil, update_mask: nil, start_time: nil) + # Pass arguments to `update_security_marks` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param security_marks [::Google::Cloud::SecurityCenter::V1::SecurityMarks, ::Hash] + # Required. The security marks resource to update. + # @param update_mask [::Google::Protobuf::FieldMask, ::Hash] + # The FieldMask to use when updating the security marks resource. + # + # The field mask must not contain duplicate fields. + # If empty or set to "marks", all marks will be replaced. Individual + # marks can be updated using "marks.". + # @param start_time [::Google::Protobuf::Timestamp, ::Hash] + # The time at which the updated SecurityMarks take effect. + # If not set uses current server time. Updates will be applied to the + # SecurityMarks that are active immediately preceding this time. Must be + # earlier or equal to the server time. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Google::Cloud::SecurityCenter::V1::SecurityMarks] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Google::Cloud::SecurityCenter::V1::SecurityMarks] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/security_center/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::SecurityCenter::V1::SecurityCenter::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::SecurityCenter::V1::UpdateSecurityMarksRequest.new + # + # # Call the update_security_marks method. + # result = client.update_security_marks request + # + # # The returned object is of type Google::Cloud::SecurityCenter::V1::SecurityMarks. + # p result + # + def update_security_marks request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::SecurityCenter::V1::UpdateSecurityMarksRequest + + # Converts hash 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_security_marks.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::SecurityCenter::V1::VERSION + metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.security_marks&.name + header_params["security_marks.name"] = request.security_marks.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_security_marks.timeout, + metadata: metadata, + retry_policy: @config.rpcs.update_security_marks.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @security_center_stub.call_rpc :update_security_marks, request, options: options do |response, operation| + yield response, operation if block_given? + end + rescue ::GRPC::BadStatus => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Creates a BigQuery export. + # + # @overload create_big_query_export(request, options = nil) + # Pass arguments to `create_big_query_export` via a request object, either of type + # {::Google::Cloud::SecurityCenter::V1::CreateBigQueryExportRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::SecurityCenter::V1::CreateBigQueryExportRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_big_query_export(parent: nil, big_query_export: nil, big_query_export_id: nil) + # Pass arguments to `create_big_query_export` via keyword arguments. Note that at + # least one keyword argument is 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 name of the parent resource of the new BigQuery export. Its + # format is `organizations/[organization_id]`, `folders/[folder_id]`, or + # `projects/[project_id]`. + # @param big_query_export [::Google::Cloud::SecurityCenter::V1::BigQueryExport, ::Hash] + # Required. The BigQuery export being created. + # @param big_query_export_id [::String] + # Required. Unique identifier provided by the client within the parent scope. + # It must consist of only lowercase letters, numbers, and hyphens, must start + # with a letter, must end with either a letter or a number, and must be 63 + # characters or less. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Google::Cloud::SecurityCenter::V1::BigQueryExport] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Google::Cloud::SecurityCenter::V1::BigQueryExport] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/security_center/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::SecurityCenter::V1::SecurityCenter::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::SecurityCenter::V1::CreateBigQueryExportRequest.new + # + # # Call the create_big_query_export method. + # result = client.create_big_query_export request + # + # # The returned object is of type Google::Cloud::SecurityCenter::V1::BigQueryExport. + # p result + # + def create_big_query_export request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::SecurityCenter::V1::CreateBigQueryExportRequest + + # Converts hash 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_big_query_export.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::SecurityCenter::V1::VERSION + metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.parent + header_params["parent"] = request.parent + end + + request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") + metadata[:"x-goog-request-params"] ||= request_params_header + + options.apply_defaults timeout: @config.rpcs.create_big_query_export.timeout, + metadata: metadata, + retry_policy: @config.rpcs.create_big_query_export.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @security_center_stub.call_rpc :create_big_query_export, request, options: options do |response, operation| + yield response, operation if block_given? + end + rescue ::GRPC::BadStatus => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Deletes an existing BigQuery export. + # + # @overload delete_big_query_export(request, options = nil) + # Pass arguments to `delete_big_query_export` via a request object, either of type + # {::Google::Cloud::SecurityCenter::V1::DeleteBigQueryExportRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::SecurityCenter::V1::DeleteBigQueryExportRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_big_query_export(name: nil) + # Pass arguments to `delete_big_query_export` via keyword arguments. Note that at + # least one keyword argument is 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 BigQuery export to delete. Its format is + # `organizations/{organization}/bigQueryExports/{export_id}`, + # `folders/{folder}/bigQueryExports/{export_id}`, or + # `projects/{project}/bigQueryExports/{export_id}` + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Google::Protobuf::Empty] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Google::Protobuf::Empty] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/security_center/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::SecurityCenter::V1::SecurityCenter::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::SecurityCenter::V1::DeleteBigQueryExportRequest.new + # + # # Call the delete_big_query_export method. + # result = client.delete_big_query_export request + # + # # The returned object is of type Google::Protobuf::Empty. + # p result + # + def delete_big_query_export request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::SecurityCenter::V1::DeleteBigQueryExportRequest + + # Converts hash 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_big_query_export.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::SecurityCenter::V1::VERSION + metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.name + header_params["name"] = request.name + end + + request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") + metadata[:"x-goog-request-params"] ||= request_params_header + + options.apply_defaults timeout: @config.rpcs.delete_big_query_export.timeout, + metadata: metadata, + retry_policy: @config.rpcs.delete_big_query_export.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @security_center_stub.call_rpc :delete_big_query_export, 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 BigQuery export. + # + # @overload update_big_query_export(request, options = nil) + # Pass arguments to `update_big_query_export` via a request object, either of type + # {::Google::Cloud::SecurityCenter::V1::UpdateBigQueryExportRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::SecurityCenter::V1::UpdateBigQueryExportRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_big_query_export(big_query_export: nil, update_mask: nil) + # Pass arguments to `update_big_query_export` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param big_query_export [::Google::Cloud::SecurityCenter::V1::BigQueryExport, ::Hash] + # Required. The BigQuery export being updated. + # @param update_mask [::Google::Protobuf::FieldMask, ::Hash] + # The list of fields to be updated. + # If empty all mutable fields will be updated. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Google::Cloud::SecurityCenter::V1::BigQueryExport] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Google::Cloud::SecurityCenter::V1::BigQueryExport] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/security_center/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::SecurityCenter::V1::SecurityCenter::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::SecurityCenter::V1::UpdateBigQueryExportRequest.new + # + # # Call the update_big_query_export method. + # result = client.update_big_query_export request + # + # # The returned object is of type Google::Cloud::SecurityCenter::V1::BigQueryExport. + # p result + # + def update_big_query_export request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::SecurityCenter::V1::UpdateBigQueryExportRequest + + # Converts hash 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_big_query_export.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::SecurityCenter::V1::VERSION + metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.big_query_export&.name + header_params["big_query_export.name"] = request.big_query_export.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_big_query_export.timeout, + metadata: metadata, + retry_policy: @config.rpcs.update_big_query_export.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @security_center_stub.call_rpc :update_big_query_export, request, options: options do |response, operation| + yield response, operation if block_given? + end + rescue ::GRPC::BadStatus => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Lists BigQuery exports. Note that when requesting BigQuery exports at a + # given level all exports under that level are also returned e.g. if + # requesting BigQuery exports under a folder, then all BigQuery exports + # immediately under the folder plus the ones created under the projects + # within the folder are returned. + # + # @overload list_big_query_exports(request, options = nil) + # Pass arguments to `list_big_query_exports` via a request object, either of type + # {::Google::Cloud::SecurityCenter::V1::ListBigQueryExportsRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::SecurityCenter::V1::ListBigQueryExportsRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_big_query_exports(parent: nil, page_size: nil, page_token: nil) + # Pass arguments to `list_big_query_exports` via keyword arguments. Note that at + # least one keyword argument is 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, which owns the collection of BigQuery exports. Its + # format is `organizations/[organization_id]`, `folders/[folder_id]`, + # `projects/[project_id]`. + # @param page_size [::Integer] + # The maximum number of configs to return. The service may return fewer than + # this value. + # If unspecified, at most 10 configs will be returned. + # The maximum value is 1000; values above 1000 will be coerced to 1000. + # @param page_token [::String] + # A page token, received from a previous `ListBigQueryExports` call. + # Provide this to retrieve the subsequent page. + # When paginating, all other parameters provided to `ListBigQueryExports` + # 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::Cloud::SecurityCenter::V1::BigQueryExport>] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Gapic::PagedEnumerable<::Google::Cloud::SecurityCenter::V1::BigQueryExport>] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/security_center/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::SecurityCenter::V1::SecurityCenter::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::SecurityCenter::V1::ListBigQueryExportsRequest.new + # + # # Call the list_big_query_exports method. + # result = client.list_big_query_exports request + # + # # The returned object is of type Gapic::PagedEnumerable. You can iterate + # # over elements, and API calls will be issued to fetch pages as needed. + # result.each do |item| + # # Each element is of type ::Google::Cloud::SecurityCenter::V1::BigQueryExport. + # p item + # end + # + def list_big_query_exports request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::SecurityCenter::V1::ListBigQueryExportsRequest + + # Converts hash 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_big_query_exports.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::SecurityCenter::V1::VERSION + metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.parent + header_params["parent"] = request.parent + end + + request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") + metadata[:"x-goog-request-params"] ||= request_params_header + + options.apply_defaults timeout: @config.rpcs.list_big_query_exports.timeout, + metadata: metadata, + retry_policy: @config.rpcs.list_big_query_exports.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @security_center_stub.call_rpc :list_big_query_exports, request, options: options do |response, operation| + response = ::Gapic::PagedEnumerable.new @security_center_stub, :list_big_query_exports, request, response, operation, options + yield response, operation if block_given? + throw :response, response + end + rescue ::GRPC::BadStatus => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Creates a resident Event Threat Detection custom module at the scope of the + # given Resource Manager parent, and also creates inherited custom modules + # for all descendants of the given parent. These modules are enabled by + # default. + # + # @overload create_event_threat_detection_custom_module(request, options = nil) + # Pass arguments to `create_event_threat_detection_custom_module` via a request object, either of type + # {::Google::Cloud::SecurityCenter::V1::CreateEventThreatDetectionCustomModuleRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::SecurityCenter::V1::CreateEventThreatDetectionCustomModuleRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_event_threat_detection_custom_module(parent: nil, event_threat_detection_custom_module: nil) + # Pass arguments to `create_event_threat_detection_custom_module` via keyword arguments. Note that at + # least one keyword argument is 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 new custom module's parent. + # + # Its format is: + # + # * `organizations/{organization}/eventThreatDetectionSettings`. + # * `folders/{folder}/eventThreatDetectionSettings`. + # * `projects/{project}/eventThreatDetectionSettings`. + # @param event_threat_detection_custom_module [::Google::Cloud::SecurityCenter::V1::EventThreatDetectionCustomModule, ::Hash] + # Required. The module to create. The + # event_threat_detection_custom_module.name will be ignored and server + # generated. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Google::Cloud::SecurityCenter::V1::EventThreatDetectionCustomModule] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Google::Cloud::SecurityCenter::V1::EventThreatDetectionCustomModule] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/security_center/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::SecurityCenter::V1::SecurityCenter::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::SecurityCenter::V1::CreateEventThreatDetectionCustomModuleRequest.new + # + # # Call the create_event_threat_detection_custom_module method. + # result = client.create_event_threat_detection_custom_module request + # + # # The returned object is of type Google::Cloud::SecurityCenter::V1::EventThreatDetectionCustomModule. + # p result + # + def create_event_threat_detection_custom_module request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::SecurityCenter::V1::CreateEventThreatDetectionCustomModuleRequest + + # Converts hash 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_event_threat_detection_custom_module.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::SecurityCenter::V1::VERSION + metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.parent + header_params["parent"] = request.parent + end + + request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") + metadata[:"x-goog-request-params"] ||= request_params_header + + options.apply_defaults timeout: @config.rpcs.create_event_threat_detection_custom_module.timeout, + metadata: metadata, + retry_policy: @config.rpcs.create_event_threat_detection_custom_module.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @security_center_stub.call_rpc :create_event_threat_detection_custom_module, request, options: options do |response, operation| + yield response, operation if block_given? + end + rescue ::GRPC::BadStatus => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Deletes the specified Event Threat Detection custom module and all of its + # descendants in the Resource Manager hierarchy. This method is only + # supported for resident custom modules. + # + # @overload delete_event_threat_detection_custom_module(request, options = nil) + # Pass arguments to `delete_event_threat_detection_custom_module` via a request object, either of type + # {::Google::Cloud::SecurityCenter::V1::DeleteEventThreatDetectionCustomModuleRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::SecurityCenter::V1::DeleteEventThreatDetectionCustomModuleRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_event_threat_detection_custom_module(name: nil) + # Pass arguments to `delete_event_threat_detection_custom_module` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param name [::String] + # Required. Name of the custom module to delete. + # + # Its format is: + # + # * `organizations/{organization}/eventThreatDetectionSettings/customModules/{module}`. + # * `folders/{folder}/eventThreatDetectionSettings/customModules/{module}`. + # * `projects/{project}/eventThreatDetectionSettings/customModules/{module}`. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Google::Protobuf::Empty] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Google::Protobuf::Empty] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/security_center/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::SecurityCenter::V1::SecurityCenter::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::SecurityCenter::V1::DeleteEventThreatDetectionCustomModuleRequest.new + # + # # Call the delete_event_threat_detection_custom_module method. + # result = client.delete_event_threat_detection_custom_module request + # + # # The returned object is of type Google::Protobuf::Empty. + # p result + # + def delete_event_threat_detection_custom_module request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::SecurityCenter::V1::DeleteEventThreatDetectionCustomModuleRequest + + # Converts hash 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_event_threat_detection_custom_module.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::SecurityCenter::V1::VERSION + metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.name + header_params["name"] = request.name + end + + request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") + metadata[:"x-goog-request-params"] ||= request_params_header + + options.apply_defaults timeout: @config.rpcs.delete_event_threat_detection_custom_module.timeout, + metadata: metadata, + retry_policy: @config.rpcs.delete_event_threat_detection_custom_module.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @security_center_stub.call_rpc :delete_event_threat_detection_custom_module, request, options: options do |response, operation| + yield response, operation if block_given? + end + rescue ::GRPC::BadStatus => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Gets an Event Threat Detection custom module. + # + # @overload get_event_threat_detection_custom_module(request, options = nil) + # Pass arguments to `get_event_threat_detection_custom_module` via a request object, either of type + # {::Google::Cloud::SecurityCenter::V1::GetEventThreatDetectionCustomModuleRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::SecurityCenter::V1::GetEventThreatDetectionCustomModuleRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_event_threat_detection_custom_module(name: nil) + # Pass arguments to `get_event_threat_detection_custom_module` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param name [::String] + # Required. Name of the custom module to get. + # + # Its format is: + # + # * `organizations/{organization}/eventThreatDetectionSettings/customModules/{module}`. + # * `folders/{folder}/eventThreatDetectionSettings/customModules/{module}`. + # * `projects/{project}/eventThreatDetectionSettings/customModules/{module}`. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Google::Cloud::SecurityCenter::V1::EventThreatDetectionCustomModule] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Google::Cloud::SecurityCenter::V1::EventThreatDetectionCustomModule] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/security_center/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::SecurityCenter::V1::SecurityCenter::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::SecurityCenter::V1::GetEventThreatDetectionCustomModuleRequest.new + # + # # Call the get_event_threat_detection_custom_module method. + # result = client.get_event_threat_detection_custom_module request + # + # # The returned object is of type Google::Cloud::SecurityCenter::V1::EventThreatDetectionCustomModule. + # p result + # + def get_event_threat_detection_custom_module request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::SecurityCenter::V1::GetEventThreatDetectionCustomModuleRequest + + # Converts hash 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_event_threat_detection_custom_module.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::SecurityCenter::V1::VERSION + metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.name + header_params["name"] = request.name + end + + request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") + metadata[:"x-goog-request-params"] ||= request_params_header + + options.apply_defaults timeout: @config.rpcs.get_event_threat_detection_custom_module.timeout, + metadata: metadata, + retry_policy: @config.rpcs.get_event_threat_detection_custom_module.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @security_center_stub.call_rpc :get_event_threat_detection_custom_module, request, options: options do |response, operation| + yield response, operation if block_given? + end + rescue ::GRPC::BadStatus => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Lists all resident Event Threat Detection custom modules under the + # given Resource Manager parent and its descendants. + # + # @overload list_descendant_event_threat_detection_custom_modules(request, options = nil) + # Pass arguments to `list_descendant_event_threat_detection_custom_modules` via a request object, either of type + # {::Google::Cloud::SecurityCenter::V1::ListDescendantEventThreatDetectionCustomModulesRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::SecurityCenter::V1::ListDescendantEventThreatDetectionCustomModulesRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_descendant_event_threat_detection_custom_modules(parent: nil, page_token: nil, page_size: nil) + # Pass arguments to `list_descendant_event_threat_detection_custom_modules` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param parent [::String] + # Required. Name of the parent to list custom modules under. + # + # Its format is: + # + # * `organizations/{organization}/eventThreatDetectionSettings`. + # * `folders/{folder}/eventThreatDetectionSettings`. + # * `projects/{project}/eventThreatDetectionSettings`. + # @param page_token [::String] + # A page token, received from a previous + # `ListDescendantEventThreatDetectionCustomModules` call. Provide this to + # retrieve the subsequent page. + # + # When paginating, all other parameters provided to + # `ListDescendantEventThreatDetectionCustomModules` must match the call that + # provided the page token. + # @param page_size [::Integer] + # The maximum number of modules to return. The service may return fewer than + # this value. + # If unspecified, at most 10 configs will be returned. + # The maximum value is 1000; values above 1000 will be coerced to 1000. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Gapic::PagedEnumerable<::Google::Cloud::SecurityCenter::V1::EventThreatDetectionCustomModule>] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Gapic::PagedEnumerable<::Google::Cloud::SecurityCenter::V1::EventThreatDetectionCustomModule>] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/security_center/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::SecurityCenter::V1::SecurityCenter::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::SecurityCenter::V1::ListDescendantEventThreatDetectionCustomModulesRequest.new + # + # # Call the list_descendant_event_threat_detection_custom_modules method. + # result = client.list_descendant_event_threat_detection_custom_modules request + # + # # The returned object is of type Gapic::PagedEnumerable. You can iterate + # # over elements, and API calls will be issued to fetch pages as needed. + # result.each do |item| + # # Each element is of type ::Google::Cloud::SecurityCenter::V1::EventThreatDetectionCustomModule. + # p item + # end + # + def list_descendant_event_threat_detection_custom_modules request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::SecurityCenter::V1::ListDescendantEventThreatDetectionCustomModulesRequest + + # Converts hash 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_descendant_event_threat_detection_custom_modules.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::SecurityCenter::V1::VERSION + metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.parent + header_params["parent"] = request.parent + end + + request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") + metadata[:"x-goog-request-params"] ||= request_params_header + + options.apply_defaults timeout: @config.rpcs.list_descendant_event_threat_detection_custom_modules.timeout, + metadata: metadata, + retry_policy: @config.rpcs.list_descendant_event_threat_detection_custom_modules.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @security_center_stub.call_rpc :list_descendant_event_threat_detection_custom_modules, request, options: options do |response, operation| + response = ::Gapic::PagedEnumerable.new @security_center_stub, :list_descendant_event_threat_detection_custom_modules, 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 + + ## + # Lists all Event Threat Detection custom modules for the given + # Resource Manager parent. This includes resident modules defined at the + # scope of the parent along with modules inherited from ancestors. + # + # @overload list_event_threat_detection_custom_modules(request, options = nil) + # Pass arguments to `list_event_threat_detection_custom_modules` via a request object, either of type + # {::Google::Cloud::SecurityCenter::V1::ListEventThreatDetectionCustomModulesRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::SecurityCenter::V1::ListEventThreatDetectionCustomModulesRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_event_threat_detection_custom_modules(parent: nil, page_token: nil, page_size: nil) + # Pass arguments to `list_event_threat_detection_custom_modules` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param parent [::String] + # Required. Name of the parent to list custom modules under. + # + # Its format is: + # + # * `organizations/{organization}/eventThreatDetectionSettings`. + # * `folders/{folder}/eventThreatDetectionSettings`. + # * `projects/{project}/eventThreatDetectionSettings`. + # @param page_token [::String] + # A page token, received from a previous + # `ListEventThreatDetectionCustomModules` call. Provide this to retrieve the + # subsequent page. + # + # When paginating, all other parameters provided to + # `ListEventThreatDetectionCustomModules` must match the call that provided + # the page token. + # @param page_size [::Integer] + # The maximum number of modules to return. The service may return fewer than + # this value. + # If unspecified, at most 10 configs will be returned. + # The maximum value is 1000; values above 1000 will be coerced to 1000. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Gapic::PagedEnumerable<::Google::Cloud::SecurityCenter::V1::EventThreatDetectionCustomModule>] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Gapic::PagedEnumerable<::Google::Cloud::SecurityCenter::V1::EventThreatDetectionCustomModule>] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/security_center/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::SecurityCenter::V1::SecurityCenter::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::SecurityCenter::V1::ListEventThreatDetectionCustomModulesRequest.new + # + # # Call the list_event_threat_detection_custom_modules method. + # result = client.list_event_threat_detection_custom_modules request + # + # # The returned object is of type Gapic::PagedEnumerable. You can iterate + # # over elements, and API calls will be issued to fetch pages as needed. + # result.each do |item| + # # Each element is of type ::Google::Cloud::SecurityCenter::V1::EventThreatDetectionCustomModule. + # p item + # end + # + def list_event_threat_detection_custom_modules request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::SecurityCenter::V1::ListEventThreatDetectionCustomModulesRequest + + # Converts hash 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_event_threat_detection_custom_modules.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::SecurityCenter::V1::VERSION + metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.parent + header_params["parent"] = request.parent + end + + request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") + metadata[:"x-goog-request-params"] ||= request_params_header + + options.apply_defaults timeout: @config.rpcs.list_event_threat_detection_custom_modules.timeout, + metadata: metadata, + retry_policy: @config.rpcs.list_event_threat_detection_custom_modules.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @security_center_stub.call_rpc :list_event_threat_detection_custom_modules, request, options: options do |response, operation| + response = ::Gapic::PagedEnumerable.new @security_center_stub, :list_event_threat_detection_custom_modules, 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 + + ## + # Updates the Event Threat Detection custom module with the given name based + # on the given update mask. Updating the enablement state is supported for + # both resident and inherited modules (though resident modules cannot have an + # enablement state of "inherited"). Updating the display name or + # configuration of a module is supported for resident modules only. The type + # of a module cannot be changed. + # + # @overload update_event_threat_detection_custom_module(request, options = nil) + # Pass arguments to `update_event_threat_detection_custom_module` via a request object, either of type + # {::Google::Cloud::SecurityCenter::V1::UpdateEventThreatDetectionCustomModuleRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::SecurityCenter::V1::UpdateEventThreatDetectionCustomModuleRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_event_threat_detection_custom_module(event_threat_detection_custom_module: nil, update_mask: nil) + # Pass arguments to `update_event_threat_detection_custom_module` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param event_threat_detection_custom_module [::Google::Cloud::SecurityCenter::V1::EventThreatDetectionCustomModule, ::Hash] + # Required. The module being updated. + # @param update_mask [::Google::Protobuf::FieldMask, ::Hash] + # The list of fields to be updated. + # If empty all mutable fields will be updated. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Google::Cloud::SecurityCenter::V1::EventThreatDetectionCustomModule] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Google::Cloud::SecurityCenter::V1::EventThreatDetectionCustomModule] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/security_center/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::SecurityCenter::V1::SecurityCenter::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::SecurityCenter::V1::UpdateEventThreatDetectionCustomModuleRequest.new + # + # # Call the update_event_threat_detection_custom_module method. + # result = client.update_event_threat_detection_custom_module request + # + # # The returned object is of type Google::Cloud::SecurityCenter::V1::EventThreatDetectionCustomModule. + # p result + # + def update_event_threat_detection_custom_module request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::SecurityCenter::V1::UpdateEventThreatDetectionCustomModuleRequest + + # Converts hash 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_event_threat_detection_custom_module.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::SecurityCenter::V1::VERSION + metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.event_threat_detection_custom_module&.name + header_params["event_threat_detection_custom_module.name"] = request.event_threat_detection_custom_module.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_event_threat_detection_custom_module.timeout, + metadata: metadata, + retry_policy: @config.rpcs.update_event_threat_detection_custom_module.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @security_center_stub.call_rpc :update_event_threat_detection_custom_module, 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 + + ## + # Validates the given Event Threat Detection custom module. + # + # @overload validate_event_threat_detection_custom_module(request, options = nil) + # Pass arguments to `validate_event_threat_detection_custom_module` via a request object, either of type + # {::Google::Cloud::SecurityCenter::V1::ValidateEventThreatDetectionCustomModuleRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::SecurityCenter::V1::ValidateEventThreatDetectionCustomModuleRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. + # + # @overload validate_event_threat_detection_custom_module(parent: nil, raw_text: nil, type: nil) + # Pass arguments to `validate_event_threat_detection_custom_module` via keyword arguments. Note that at + # least one keyword argument is 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. Resource name of the parent to validate the Custom Module under. + # + # Its format is: + # + # * `organizations/{organization}/eventThreatDetectionSettings`. + # * `folders/{folder}/eventThreatDetectionSettings`. + # * `projects/{project}/eventThreatDetectionSettings`. + # @param raw_text [::String] + # Required. The raw text of the module's contents. Used to generate error + # messages. + # @param type [::String] + # Required. The type of the module (e.g. CONFIGURABLE_BAD_IP). + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Google::Cloud::SecurityCenter::V1::ValidateEventThreatDetectionCustomModuleResponse] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Google::Cloud::SecurityCenter::V1::ValidateEventThreatDetectionCustomModuleResponse] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/security_center/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::SecurityCenter::V1::SecurityCenter::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::SecurityCenter::V1::ValidateEventThreatDetectionCustomModuleRequest.new + # + # # Call the validate_event_threat_detection_custom_module method. + # result = client.validate_event_threat_detection_custom_module request + # + # # The returned object is of type Google::Cloud::SecurityCenter::V1::ValidateEventThreatDetectionCustomModuleResponse. + # p result + # + def validate_event_threat_detection_custom_module request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::SecurityCenter::V1::ValidateEventThreatDetectionCustomModuleRequest + + # Converts hash 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.validate_event_threat_detection_custom_module.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::SecurityCenter::V1::VERSION + metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.parent + header_params["parent"] = request.parent + end + + request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") + metadata[:"x-goog-request-params"] ||= request_params_header + + options.apply_defaults timeout: @config.rpcs.validate_event_threat_detection_custom_module.timeout, + metadata: metadata, + retry_policy: @config.rpcs.validate_event_threat_detection_custom_module.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @security_center_stub.call_rpc :validate_event_threat_detection_custom_module, request, options: options do |response, operation| + yield response, operation if block_given? + end + rescue ::GRPC::BadStatus => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Gets an effective Event Threat Detection custom module at the given level. + # + # @overload get_effective_event_threat_detection_custom_module(request, options = nil) + # Pass arguments to `get_effective_event_threat_detection_custom_module` via a request object, either of type + # {::Google::Cloud::SecurityCenter::V1::GetEffectiveEventThreatDetectionCustomModuleRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::SecurityCenter::V1::GetEffectiveEventThreatDetectionCustomModuleRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_effective_event_threat_detection_custom_module(name: nil) + # Pass arguments to `get_effective_event_threat_detection_custom_module` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param name [::String] + # Required. The resource name of the effective Event Threat Detection custom + # module. + # + # Its format is: + # + # * `organizations/{organization}/eventThreatDetectionSettings/effectiveCustomModules/{module}`. + # * `folders/{folder}/eventThreatDetectionSettings/effectiveCustomModules/{module}`. + # * `projects/{project}/eventThreatDetectionSettings/effectiveCustomModules/{module}`. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Google::Cloud::SecurityCenter::V1::EffectiveEventThreatDetectionCustomModule] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Google::Cloud::SecurityCenter::V1::EffectiveEventThreatDetectionCustomModule] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/security_center/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::SecurityCenter::V1::SecurityCenter::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::SecurityCenter::V1::GetEffectiveEventThreatDetectionCustomModuleRequest.new + # + # # Call the get_effective_event_threat_detection_custom_module method. + # result = client.get_effective_event_threat_detection_custom_module request + # + # # The returned object is of type Google::Cloud::SecurityCenter::V1::EffectiveEventThreatDetectionCustomModule. + # p result + # + def get_effective_event_threat_detection_custom_module request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::SecurityCenter::V1::GetEffectiveEventThreatDetectionCustomModuleRequest + + # Converts hash 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_effective_event_threat_detection_custom_module.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::SecurityCenter::V1::VERSION + metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.name + header_params["name"] = request.name + end + + request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") + metadata[:"x-goog-request-params"] ||= request_params_header + + options.apply_defaults timeout: @config.rpcs.get_effective_event_threat_detection_custom_module.timeout, + metadata: metadata, + retry_policy: @config.rpcs.get_effective_event_threat_detection_custom_module.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @security_center_stub.call_rpc :get_effective_event_threat_detection_custom_module, request, options: options do |response, operation| + yield response, operation if block_given? + end + rescue ::GRPC::BadStatus => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Lists all effective Event Threat Detection custom modules for the + # given parent. This includes resident modules defined at the scope of the + # parent along with modules inherited from its ancestors. + # + # @overload list_effective_event_threat_detection_custom_modules(request, options = nil) + # Pass arguments to `list_effective_event_threat_detection_custom_modules` via a request object, either of type + # {::Google::Cloud::SecurityCenter::V1::ListEffectiveEventThreatDetectionCustomModulesRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::SecurityCenter::V1::ListEffectiveEventThreatDetectionCustomModulesRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_effective_event_threat_detection_custom_modules(parent: nil, page_token: nil, page_size: nil) + # Pass arguments to `list_effective_event_threat_detection_custom_modules` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param parent [::String] + # Required. Name of the parent to list custom modules for. + # + # Its format is: + # + # * `organizations/{organization}/eventThreatDetectionSettings`. + # * `folders/{folder}/eventThreatDetectionSettings`. + # * `projects/{project}/eventThreatDetectionSettings`. + # @param page_token [::String] + # A page token, received from a previous + # `ListEffectiveEventThreatDetectionCustomModules` call. Provide this to + # retrieve the subsequent page. + # + # When paginating, all other parameters provided to + # `ListEffectiveEventThreatDetectionCustomModules` must match the call that + # provided the page token. + # @param page_size [::Integer] + # The maximum number of modules to return. The service may return fewer than + # this value. + # If unspecified, at most 10 configs will be returned. + # The maximum value is 1000; values above 1000 will be coerced to 1000. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Gapic::PagedEnumerable<::Google::Cloud::SecurityCenter::V1::EffectiveEventThreatDetectionCustomModule>] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Gapic::PagedEnumerable<::Google::Cloud::SecurityCenter::V1::EffectiveEventThreatDetectionCustomModule>] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/security_center/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::SecurityCenter::V1::SecurityCenter::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::SecurityCenter::V1::ListEffectiveEventThreatDetectionCustomModulesRequest.new + # + # # Call the list_effective_event_threat_detection_custom_modules method. + # result = client.list_effective_event_threat_detection_custom_modules request + # + # # The returned object is of type Gapic::PagedEnumerable. You can iterate + # # over elements, and API calls will be issued to fetch pages as needed. + # result.each do |item| + # # Each element is of type ::Google::Cloud::SecurityCenter::V1::EffectiveEventThreatDetectionCustomModule. + # p item + # end + # + def list_effective_event_threat_detection_custom_modules request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::SecurityCenter::V1::ListEffectiveEventThreatDetectionCustomModulesRequest + + # Converts hash 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_effective_event_threat_detection_custom_modules.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::SecurityCenter::V1::VERSION + metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.parent + header_params["parent"] = request.parent + end + + request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") + metadata[:"x-goog-request-params"] ||= request_params_header + + options.apply_defaults timeout: @config.rpcs.list_effective_event_threat_detection_custom_modules.timeout, + metadata: metadata, + retry_policy: @config.rpcs.list_effective_event_threat_detection_custom_modules.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @security_center_stub.call_rpc :list_effective_event_threat_detection_custom_modules, request, options: options do |response, operation| + response = ::Gapic::PagedEnumerable.new @security_center_stub, :list_effective_event_threat_detection_custom_modules, request, response, operation, options + yield response, operation if block_given? + throw :response, response + end + rescue ::GRPC::BadStatus => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Creates a ResourceValueConfig for an organization. Maps user's tags to + # difference resource values for use by the attack path simulation. + # + # @overload batch_create_resource_value_configs(request, options = nil) + # Pass arguments to `batch_create_resource_value_configs` via a request object, either of type + # {::Google::Cloud::SecurityCenter::V1::BatchCreateResourceValueConfigsRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::SecurityCenter::V1::BatchCreateResourceValueConfigsRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. + # + # @overload batch_create_resource_value_configs(parent: nil, requests: nil) + # Pass arguments to `batch_create_resource_value_configs` via keyword arguments. Note that at + # least one keyword argument is 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. Resource name of the new ResourceValueConfig's parent. + # The parent field in the CreateResourceValueConfigRequest + # messages must either be empty or match this field. + # @param requests [::Array<::Google::Cloud::SecurityCenter::V1::CreateResourceValueConfigRequest, ::Hash>] + # Required. The resource value configs to be created. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Google::Cloud::SecurityCenter::V1::BatchCreateResourceValueConfigsResponse] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Google::Cloud::SecurityCenter::V1::BatchCreateResourceValueConfigsResponse] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/security_center/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::SecurityCenter::V1::SecurityCenter::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::SecurityCenter::V1::BatchCreateResourceValueConfigsRequest.new + # + # # Call the batch_create_resource_value_configs method. + # result = client.batch_create_resource_value_configs request + # + # # The returned object is of type Google::Cloud::SecurityCenter::V1::BatchCreateResourceValueConfigsResponse. + # p result + # + def batch_create_resource_value_configs request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::SecurityCenter::V1::BatchCreateResourceValueConfigsRequest + + # Converts hash 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.batch_create_resource_value_configs.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::SecurityCenter::V1::VERSION + metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.parent + header_params["parent"] = request.parent + end + + request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") + metadata[:"x-goog-request-params"] ||= request_params_header + + options.apply_defaults timeout: @config.rpcs.batch_create_resource_value_configs.timeout, + metadata: metadata, + retry_policy: @config.rpcs.batch_create_resource_value_configs.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @security_center_stub.call_rpc :batch_create_resource_value_configs, request, options: options do |response, operation| + yield response, operation if block_given? + end + rescue ::GRPC::BadStatus => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Deletes a ResourceValueConfig. + # + # @overload delete_resource_value_config(request, options = nil) + # Pass arguments to `delete_resource_value_config` via a request object, either of type + # {::Google::Cloud::SecurityCenter::V1::DeleteResourceValueConfigRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::SecurityCenter::V1::DeleteResourceValueConfigRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_resource_value_config(name: nil) + # Pass arguments to `delete_resource_value_config` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param name [::String] + # Required. Name of the ResourceValueConfig to delete + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Google::Protobuf::Empty] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Google::Protobuf::Empty] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/security_center/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::SecurityCenter::V1::SecurityCenter::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::SecurityCenter::V1::DeleteResourceValueConfigRequest.new + # + # # Call the delete_resource_value_config method. + # result = client.delete_resource_value_config request + # + # # The returned object is of type Google::Protobuf::Empty. + # p result + # + def delete_resource_value_config request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::SecurityCenter::V1::DeleteResourceValueConfigRequest + + # Converts hash 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_resource_value_config.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::SecurityCenter::V1::VERSION + metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.name + header_params["name"] = request.name + end + + request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") + metadata[:"x-goog-request-params"] ||= request_params_header + + options.apply_defaults timeout: @config.rpcs.delete_resource_value_config.timeout, + metadata: metadata, + retry_policy: @config.rpcs.delete_resource_value_config.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @security_center_stub.call_rpc :delete_resource_value_config, request, options: options do |response, operation| + yield response, operation if block_given? + end + rescue ::GRPC::BadStatus => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Gets a ResourceValueConfig. + # + # @overload get_resource_value_config(request, options = nil) + # Pass arguments to `get_resource_value_config` via a request object, either of type + # {::Google::Cloud::SecurityCenter::V1::GetResourceValueConfigRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::SecurityCenter::V1::GetResourceValueConfigRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_resource_value_config(name: nil) + # Pass arguments to `get_resource_value_config` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param name [::String] + # Required. Name of the resource value config to retrieve. Its format is + # `organizations/{organization}/resourceValueConfigs/{config_id}`. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Google::Cloud::SecurityCenter::V1::ResourceValueConfig] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Google::Cloud::SecurityCenter::V1::ResourceValueConfig] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/security_center/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::SecurityCenter::V1::SecurityCenter::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::SecurityCenter::V1::GetResourceValueConfigRequest.new + # + # # Call the get_resource_value_config method. + # result = client.get_resource_value_config request + # + # # The returned object is of type Google::Cloud::SecurityCenter::V1::ResourceValueConfig. + # p result + # + def get_resource_value_config request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::SecurityCenter::V1::GetResourceValueConfigRequest + + # Converts hash 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_resource_value_config.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::SecurityCenter::V1::VERSION + metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.name + header_params["name"] = request.name + end + + request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") + metadata[:"x-goog-request-params"] ||= request_params_header + + options.apply_defaults timeout: @config.rpcs.get_resource_value_config.timeout, + metadata: metadata, + retry_policy: @config.rpcs.get_resource_value_config.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @security_center_stub.call_rpc :get_resource_value_config, request, options: options do |response, operation| + yield response, operation if block_given? + end + rescue ::GRPC::BadStatus => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Lists all ResourceValueConfigs. + # + # @overload list_resource_value_configs(request, options = nil) + # Pass arguments to `list_resource_value_configs` via a request object, either of type + # {::Google::Cloud::SecurityCenter::V1::ListResourceValueConfigsRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::SecurityCenter::V1::ListResourceValueConfigsRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_resource_value_configs(parent: nil, page_size: nil, page_token: nil) + # Pass arguments to `list_resource_value_configs` via keyword arguments. Note that at + # least one keyword argument is 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, which owns the collection of resource value configs. + # Its format is + # `organizations/[organization_id]` + # @param page_size [::Integer] + # The number of results to return. The service may return fewer than + # this value. + # If unspecified, at most 10 configs will be returned. + # The maximum value is 1000; values above 1000 will be coerced to 1000. + # @param page_token [::String] + # A page token, received from a previous `ListResourceValueConfigs` call. + # Provide this to retrieve the subsequent page. + # + # When paginating, all other parameters provided to + # `ListResourceValueConfigs` must match the call that provided the + # page token. + # + # page_size can be specified, and the new page_size will be used. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Gapic::PagedEnumerable<::Google::Cloud::SecurityCenter::V1::ResourceValueConfig>] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Gapic::PagedEnumerable<::Google::Cloud::SecurityCenter::V1::ResourceValueConfig>] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/security_center/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::SecurityCenter::V1::SecurityCenter::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::SecurityCenter::V1::ListResourceValueConfigsRequest.new + # + # # Call the list_resource_value_configs method. + # result = client.list_resource_value_configs request + # + # # The returned object is of type Gapic::PagedEnumerable. You can iterate + # # over elements, and API calls will be issued to fetch pages as needed. + # result.each do |item| + # # Each element is of type ::Google::Cloud::SecurityCenter::V1::ResourceValueConfig. + # p item + # end + # + def list_resource_value_configs request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::SecurityCenter::V1::ListResourceValueConfigsRequest + + # Converts hash 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_resource_value_configs.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::SecurityCenter::V1::VERSION + metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.parent + header_params["parent"] = request.parent + end + + request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") + metadata[:"x-goog-request-params"] ||= request_params_header + + options.apply_defaults timeout: @config.rpcs.list_resource_value_configs.timeout, + metadata: metadata, + retry_policy: @config.rpcs.list_resource_value_configs.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @security_center_stub.call_rpc :list_resource_value_configs, request, options: options do |response, operation| + response = ::Gapic::PagedEnumerable.new @security_center_stub, :list_resource_value_configs, 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 + + ## + # Updates an existing ResourceValueConfigs with new rules. + # + # @overload update_resource_value_config(request, options = nil) + # Pass arguments to `update_resource_value_config` via a request object, either of type + # {::Google::Cloud::SecurityCenter::V1::UpdateResourceValueConfigRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::SecurityCenter::V1::UpdateResourceValueConfigRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_resource_value_config(resource_value_config: nil, update_mask: nil) + # Pass arguments to `update_resource_value_config` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param resource_value_config [::Google::Cloud::SecurityCenter::V1::ResourceValueConfig, ::Hash] + # Required. The resource value config being updated. + # @param update_mask [::Google::Protobuf::FieldMask, ::Hash] + # The list of fields to be updated. + # If empty all mutable fields will be updated. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Google::Cloud::SecurityCenter::V1::ResourceValueConfig] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Google::Cloud::SecurityCenter::V1::ResourceValueConfig] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/security_center/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::SecurityCenter::V1::SecurityCenter::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::SecurityCenter::V1::UpdateResourceValueConfigRequest.new + # + # # Call the update_resource_value_config method. + # result = client.update_resource_value_config request + # + # # The returned object is of type Google::Cloud::SecurityCenter::V1::ResourceValueConfig. + # p result + # + def update_resource_value_config request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::SecurityCenter::V1::UpdateResourceValueConfigRequest + + # Converts hash 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_resource_value_config.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::SecurityCenter::V1::VERSION + metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.resource_value_config&.name + header_params["resource_value_config.name"] = request.resource_value_config.name + end + + request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") + metadata[:"x-goog-request-params"] ||= request_params_header + + options.apply_defaults timeout: @config.rpcs.update_resource_value_config.timeout, + metadata: metadata, + retry_policy: @config.rpcs.update_resource_value_config.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @security_center_stub.call_rpc :update_resource_value_config, request, options: options do |response, operation| + yield response, operation if block_given? + end + rescue ::GRPC::BadStatus => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Lists the valued resources for a set of simulation results and filter. + # + # @overload list_valued_resources(request, options = nil) + # Pass arguments to `list_valued_resources` via a request object, either of type + # {::Google::Cloud::SecurityCenter::V1::ListValuedResourcesRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::SecurityCenter::V1::ListValuedResourcesRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_valued_resources(parent: nil, filter: nil, page_token: nil, page_size: nil, order_by: nil) + # Pass arguments to `list_valued_resources` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param parent [::String] + # Required. Name of parent to list valued resources. + # + # Valid formats: + # `organizations/{organization}`, + # `organizations/{organization}/simulations/{simulation}` + # `organizations/{organization}/simulations/{simulation}/attackExposureResults/{attack_exposure_result_v2}` + # @param filter [::String] + # The filter expression that filters the valued resources in the response. + # Supported fields: + # + # * `resource_value` supports = + # * `resource_type` supports = + # @param page_token [::String] + # The value returned by the last `ListValuedResourcesResponse`; indicates + # that this is a continuation of a prior `ListValuedResources` call, and + # that the system should return the next page of data. + # @param page_size [::Integer] + # The maximum number of results to return in a single response. Default is + # 10, minimum is 1, maximum is 1000. + # @param order_by [::String] + # Optional. The fields by which to order the valued resources response. + # + # Supported fields: + # + # * `exposed_score` + # + # * `resource_value` + # + # * `resource_type` + # + # * `resource` + # + # * `display_name` + # + # Values should be a comma separated list of fields. For example: + # `exposed_score,resource_value`. + # + # The default sorting order is descending. To specify ascending or descending + # order for a field, append a ` ASC` or a ` DESC` suffix, respectively; for + # example: `exposed_score DESC`. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Gapic::PagedEnumerable<::Google::Cloud::SecurityCenter::V1::ValuedResource>] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Gapic::PagedEnumerable<::Google::Cloud::SecurityCenter::V1::ValuedResource>] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/security_center/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::SecurityCenter::V1::SecurityCenter::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::SecurityCenter::V1::ListValuedResourcesRequest.new + # + # # Call the list_valued_resources method. + # result = client.list_valued_resources request + # + # # The returned object is of type Gapic::PagedEnumerable. You can iterate + # # over elements, and API calls will be issued to fetch pages as needed. + # result.each do |item| + # # Each element is of type ::Google::Cloud::SecurityCenter::V1::ValuedResource. + # p item + # end + # + def list_valued_resources request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::SecurityCenter::V1::ListValuedResourcesRequest + + # Converts hash 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_valued_resources.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::SecurityCenter::V1::VERSION + metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.parent + header_params["parent"] = request.parent + end + + request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") + metadata[:"x-goog-request-params"] ||= request_params_header + + options.apply_defaults timeout: @config.rpcs.list_valued_resources.timeout, + metadata: metadata, + retry_policy: @config.rpcs.list_valued_resources.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @security_center_stub.call_rpc :list_valued_resources, request, options: options do |response, operation| + response = ::Gapic::PagedEnumerable.new @security_center_stub, :list_valued_resources, 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 + + ## + # Lists the attack paths for a set of simulation results or valued resources + # and filter. + # + # @overload list_attack_paths(request, options = nil) + # Pass arguments to `list_attack_paths` via a request object, either of type + # {::Google::Cloud::SecurityCenter::V1::ListAttackPathsRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::SecurityCenter::V1::ListAttackPathsRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_attack_paths(parent: nil, filter: nil, page_token: nil, page_size: nil) + # Pass arguments to `list_attack_paths` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param parent [::String] + # Required. Name of parent to list attack paths. + # + # Valid formats: + # `organizations/{organization}`, + # `organizations/{organization}/simulations/{simulation}` + # `organizations/{organization}/simulations/{simulation}/attackExposureResults/{attack_exposure_result_v2}` + # `organizations/{organization}/simulations/{simulation}/valuedResources/{valued_resource}` + # @param filter [::String] + # The filter expression that filters the attack path in the response. + # Supported fields: + # + # * `valued_resources` supports = + # @param page_token [::String] + # The value returned by the last `ListAttackPathsResponse`; indicates + # that this is a continuation of a prior `ListAttackPaths` call, and + # that the system should return the next page of data. + # @param page_size [::Integer] + # The maximum number of results to return in a single response. Default is + # 10, minimum is 1, maximum is 1000. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Gapic::PagedEnumerable<::Google::Cloud::SecurityCenter::V1::AttackPath>] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Gapic::PagedEnumerable<::Google::Cloud::SecurityCenter::V1::AttackPath>] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/security_center/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::SecurityCenter::V1::SecurityCenter::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::SecurityCenter::V1::ListAttackPathsRequest.new + # + # # Call the list_attack_paths method. + # result = client.list_attack_paths request + # + # # The returned object is of type Gapic::PagedEnumerable. You can iterate + # # over elements, and API calls will be issued to fetch pages as needed. + # result.each do |item| + # # Each element is of type ::Google::Cloud::SecurityCenter::V1::AttackPath. + # p item + # end + # + def list_attack_paths request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::SecurityCenter::V1::ListAttackPathsRequest + + # Converts hash 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_attack_paths.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::SecurityCenter::V1::VERSION + metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.parent + header_params["parent"] = request.parent + end + + request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") + metadata[:"x-goog-request-params"] ||= request_params_header + + options.apply_defaults timeout: @config.rpcs.list_attack_paths.timeout, + metadata: metadata, + retry_policy: @config.rpcs.list_attack_paths.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @security_center_stub.call_rpc :list_attack_paths, request, options: options do |response, operation| + response = ::Gapic::PagedEnumerable.new @security_center_stub, :list_attack_paths, 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 SecurityCenter API. + # + # This class represents the configuration for SecurityCenter, + # providing control over timeouts, retry behavior, logging, transport + # parameters, and other low-level controls. Certain parameters can also be + # applied individually to specific RPCs. See + # {::Google::Cloud::SecurityCenter::V1::SecurityCenter::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 + # # bulk_mute_findings to 20 seconds, + # # and all remaining timeouts to 10 seconds. + # ::Google::Cloud::SecurityCenter::V1::SecurityCenter::Client.configure do |config| + # config.timeout = 10.0 + # config.rpcs.bulk_mute_findings.timeout = 20.0 + # end + # + # # Apply the above configuration only to a new client. + # client = ::Google::Cloud::SecurityCenter::V1::SecurityCenter::Client.new do |config| + # config.timeout = 10.0 + # config.rpcs.bulk_mute_findings.timeout = 20.0 + # end + # + # @!attribute [rw] endpoint + # A custom service endpoint, as a hostname or hostname:port. The default is + # nil, indicating to use the default endpoint in the current universe domain. + # @return [::String,nil] + # @!attribute [rw] credentials + # Credentials to send with calls. You may provide any of the following types: + # * (`Google::Auth::Credentials`) A googleauth credentials object + # (see the [googleauth docs](https://rubydoc.info/gems/googleauth/Google/Auth/Credentials)) + # * (`Signet::OAuth2::Client`) A signet oauth2 client object + # (see the [signet docs](https://rubydoc.info/gems/signet/Signet/OAuth2/Client)) + # * (`GRPC::Core::Channel`) a gRPC channel with included credentials + # * (`GRPC::Core::ChannelCredentials`) a gRPC credentails object + # * (`nil`) indicating no credentials + # + # @note Warning: Passing a `String` to a keyfile path or a `Hash` of credentials + # is deprecated. Providing an unvalidated credential configuration to + # Google APIs can compromise the security of your systems and data. + # + # @example + # + # # The recommended way to provide credentials is to use the `make_creds` method + # # on the appropriate credentials class for your environment. + # + # require "googleauth" + # + # credentials = ::Google::Auth::ServiceAccountCredentials.make_creds( + # json_key_io: ::File.open("/path/to/keyfile.json") + # ) + # + # client = ::Google::Cloud::SecurityCenter::V1::SecurityCenter::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 = "securitycenter.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 SecurityCenter 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 `bulk_mute_findings` + # @return [::Gapic::Config::Method] + # + attr_reader :bulk_mute_findings + ## + # RPC-specific configuration for `create_security_health_analytics_custom_module` + # @return [::Gapic::Config::Method] + # + attr_reader :create_security_health_analytics_custom_module + ## + # RPC-specific configuration for `create_source` + # @return [::Gapic::Config::Method] + # + attr_reader :create_source + ## + # RPC-specific configuration for `create_finding` + # @return [::Gapic::Config::Method] + # + attr_reader :create_finding + ## + # RPC-specific configuration for `create_mute_config` + # @return [::Gapic::Config::Method] + # + attr_reader :create_mute_config + ## + # RPC-specific configuration for `create_notification_config` + # @return [::Gapic::Config::Method] + # + attr_reader :create_notification_config + ## + # RPC-specific configuration for `delete_mute_config` + # @return [::Gapic::Config::Method] + # + attr_reader :delete_mute_config + ## + # RPC-specific configuration for `delete_notification_config` + # @return [::Gapic::Config::Method] + # + attr_reader :delete_notification_config + ## + # RPC-specific configuration for `delete_security_health_analytics_custom_module` + # @return [::Gapic::Config::Method] + # + attr_reader :delete_security_health_analytics_custom_module + ## + # RPC-specific configuration for `get_simulation` + # @return [::Gapic::Config::Method] + # + attr_reader :get_simulation + ## + # RPC-specific configuration for `get_valued_resource` + # @return [::Gapic::Config::Method] + # + attr_reader :get_valued_resource + ## + # RPC-specific configuration for `get_big_query_export` + # @return [::Gapic::Config::Method] + # + attr_reader :get_big_query_export + ## + # RPC-specific configuration for `get_iam_policy` + # @return [::Gapic::Config::Method] + # + attr_reader :get_iam_policy + ## + # RPC-specific configuration for `get_mute_config` + # @return [::Gapic::Config::Method] + # + attr_reader :get_mute_config + ## + # RPC-specific configuration for `get_notification_config` + # @return [::Gapic::Config::Method] + # + attr_reader :get_notification_config + ## + # RPC-specific configuration for `get_organization_settings` + # @return [::Gapic::Config::Method] + # + attr_reader :get_organization_settings + ## + # RPC-specific configuration for `get_effective_security_health_analytics_custom_module` + # @return [::Gapic::Config::Method] + # + attr_reader :get_effective_security_health_analytics_custom_module + ## + # RPC-specific configuration for `get_security_health_analytics_custom_module` + # @return [::Gapic::Config::Method] + # + attr_reader :get_security_health_analytics_custom_module + ## + # RPC-specific configuration for `get_source` + # @return [::Gapic::Config::Method] + # + attr_reader :get_source + ## + # RPC-specific configuration for `group_assets` + # @return [::Gapic::Config::Method] + # + attr_reader :group_assets + ## + # RPC-specific configuration for `group_findings` + # @return [::Gapic::Config::Method] + # + attr_reader :group_findings + ## + # RPC-specific configuration for `list_assets` + # @return [::Gapic::Config::Method] + # + attr_reader :list_assets + ## + # RPC-specific configuration for `list_descendant_security_health_analytics_custom_modules` + # @return [::Gapic::Config::Method] + # + attr_reader :list_descendant_security_health_analytics_custom_modules + ## + # RPC-specific configuration for `list_findings` + # @return [::Gapic::Config::Method] + # + attr_reader :list_findings + ## + # RPC-specific configuration for `list_mute_configs` + # @return [::Gapic::Config::Method] + # + attr_reader :list_mute_configs + ## + # RPC-specific configuration for `list_notification_configs` + # @return [::Gapic::Config::Method] + # + attr_reader :list_notification_configs + ## + # RPC-specific configuration for `list_effective_security_health_analytics_custom_modules` + # @return [::Gapic::Config::Method] + # + attr_reader :list_effective_security_health_analytics_custom_modules + ## + # RPC-specific configuration for `list_security_health_analytics_custom_modules` + # @return [::Gapic::Config::Method] + # + attr_reader :list_security_health_analytics_custom_modules + ## + # RPC-specific configuration for `list_sources` + # @return [::Gapic::Config::Method] + # + attr_reader :list_sources + ## + # RPC-specific configuration for `run_asset_discovery` + # @return [::Gapic::Config::Method] + # + attr_reader :run_asset_discovery + ## + # RPC-specific configuration for `set_finding_state` + # @return [::Gapic::Config::Method] + # + attr_reader :set_finding_state + ## + # RPC-specific configuration for `set_mute` + # @return [::Gapic::Config::Method] + # + attr_reader :set_mute + ## + # RPC-specific configuration for `set_iam_policy` + # @return [::Gapic::Config::Method] + # + attr_reader :set_iam_policy + ## + # RPC-specific configuration for `test_iam_permissions` + # @return [::Gapic::Config::Method] + # + attr_reader :test_iam_permissions + ## + # RPC-specific configuration for `simulate_security_health_analytics_custom_module` + # @return [::Gapic::Config::Method] + # + attr_reader :simulate_security_health_analytics_custom_module + ## + # RPC-specific configuration for `update_external_system` + # @return [::Gapic::Config::Method] + # + attr_reader :update_external_system + ## + # RPC-specific configuration for `update_finding` + # @return [::Gapic::Config::Method] + # + attr_reader :update_finding + ## + # RPC-specific configuration for `update_mute_config` + # @return [::Gapic::Config::Method] + # + attr_reader :update_mute_config + ## + # RPC-specific configuration for `update_notification_config` + # @return [::Gapic::Config::Method] + # + attr_reader :update_notification_config + ## + # RPC-specific configuration for `update_organization_settings` + # @return [::Gapic::Config::Method] + # + attr_reader :update_organization_settings + ## + # RPC-specific configuration for `update_security_health_analytics_custom_module` + # @return [::Gapic::Config::Method] + # + attr_reader :update_security_health_analytics_custom_module + ## + # RPC-specific configuration for `update_source` + # @return [::Gapic::Config::Method] + # + attr_reader :update_source + ## + # RPC-specific configuration for `update_security_marks` + # @return [::Gapic::Config::Method] + # + attr_reader :update_security_marks + ## + # RPC-specific configuration for `create_big_query_export` + # @return [::Gapic::Config::Method] + # + attr_reader :create_big_query_export + ## + # RPC-specific configuration for `delete_big_query_export` + # @return [::Gapic::Config::Method] + # + attr_reader :delete_big_query_export + ## + # RPC-specific configuration for `update_big_query_export` + # @return [::Gapic::Config::Method] + # + attr_reader :update_big_query_export + ## + # RPC-specific configuration for `list_big_query_exports` + # @return [::Gapic::Config::Method] + # + attr_reader :list_big_query_exports + ## + # RPC-specific configuration for `create_event_threat_detection_custom_module` + # @return [::Gapic::Config::Method] + # + attr_reader :create_event_threat_detection_custom_module + ## + # RPC-specific configuration for `delete_event_threat_detection_custom_module` + # @return [::Gapic::Config::Method] + # + attr_reader :delete_event_threat_detection_custom_module + ## + # RPC-specific configuration for `get_event_threat_detection_custom_module` + # @return [::Gapic::Config::Method] + # + attr_reader :get_event_threat_detection_custom_module + ## + # RPC-specific configuration for `list_descendant_event_threat_detection_custom_modules` + # @return [::Gapic::Config::Method] + # + attr_reader :list_descendant_event_threat_detection_custom_modules + ## + # RPC-specific configuration for `list_event_threat_detection_custom_modules` + # @return [::Gapic::Config::Method] + # + attr_reader :list_event_threat_detection_custom_modules + ## + # RPC-specific configuration for `update_event_threat_detection_custom_module` + # @return [::Gapic::Config::Method] + # + attr_reader :update_event_threat_detection_custom_module + ## + # RPC-specific configuration for `validate_event_threat_detection_custom_module` + # @return [::Gapic::Config::Method] + # + attr_reader :validate_event_threat_detection_custom_module + ## + # RPC-specific configuration for `get_effective_event_threat_detection_custom_module` + # @return [::Gapic::Config::Method] + # + attr_reader :get_effective_event_threat_detection_custom_module + ## + # RPC-specific configuration for `list_effective_event_threat_detection_custom_modules` + # @return [::Gapic::Config::Method] + # + attr_reader :list_effective_event_threat_detection_custom_modules + ## + # RPC-specific configuration for `batch_create_resource_value_configs` + # @return [::Gapic::Config::Method] + # + attr_reader :batch_create_resource_value_configs + ## + # RPC-specific configuration for `delete_resource_value_config` + # @return [::Gapic::Config::Method] + # + attr_reader :delete_resource_value_config + ## + # RPC-specific configuration for `get_resource_value_config` + # @return [::Gapic::Config::Method] + # + attr_reader :get_resource_value_config + ## + # RPC-specific configuration for `list_resource_value_configs` + # @return [::Gapic::Config::Method] + # + attr_reader :list_resource_value_configs + ## + # RPC-specific configuration for `update_resource_value_config` + # @return [::Gapic::Config::Method] + # + attr_reader :update_resource_value_config + ## + # RPC-specific configuration for `list_valued_resources` + # @return [::Gapic::Config::Method] + # + attr_reader :list_valued_resources + ## + # RPC-specific configuration for `list_attack_paths` + # @return [::Gapic::Config::Method] + # + attr_reader :list_attack_paths + + # @private + def initialize parent_rpcs = nil + bulk_mute_findings_config = parent_rpcs.bulk_mute_findings if parent_rpcs.respond_to? :bulk_mute_findings + @bulk_mute_findings = ::Gapic::Config::Method.new bulk_mute_findings_config + create_security_health_analytics_custom_module_config = parent_rpcs.create_security_health_analytics_custom_module if parent_rpcs.respond_to? :create_security_health_analytics_custom_module + @create_security_health_analytics_custom_module = ::Gapic::Config::Method.new create_security_health_analytics_custom_module_config + create_source_config = parent_rpcs.create_source if parent_rpcs.respond_to? :create_source + @create_source = ::Gapic::Config::Method.new create_source_config + create_finding_config = parent_rpcs.create_finding if parent_rpcs.respond_to? :create_finding + @create_finding = ::Gapic::Config::Method.new create_finding_config + create_mute_config_config = parent_rpcs.create_mute_config if parent_rpcs.respond_to? :create_mute_config + @create_mute_config = ::Gapic::Config::Method.new create_mute_config_config + create_notification_config_config = parent_rpcs.create_notification_config if parent_rpcs.respond_to? :create_notification_config + @create_notification_config = ::Gapic::Config::Method.new create_notification_config_config + delete_mute_config_config = parent_rpcs.delete_mute_config if parent_rpcs.respond_to? :delete_mute_config + @delete_mute_config = ::Gapic::Config::Method.new delete_mute_config_config + delete_notification_config_config = parent_rpcs.delete_notification_config if parent_rpcs.respond_to? :delete_notification_config + @delete_notification_config = ::Gapic::Config::Method.new delete_notification_config_config + delete_security_health_analytics_custom_module_config = parent_rpcs.delete_security_health_analytics_custom_module if parent_rpcs.respond_to? :delete_security_health_analytics_custom_module + @delete_security_health_analytics_custom_module = ::Gapic::Config::Method.new delete_security_health_analytics_custom_module_config + get_simulation_config = parent_rpcs.get_simulation if parent_rpcs.respond_to? :get_simulation + @get_simulation = ::Gapic::Config::Method.new get_simulation_config + get_valued_resource_config = parent_rpcs.get_valued_resource if parent_rpcs.respond_to? :get_valued_resource + @get_valued_resource = ::Gapic::Config::Method.new get_valued_resource_config + get_big_query_export_config = parent_rpcs.get_big_query_export if parent_rpcs.respond_to? :get_big_query_export + @get_big_query_export = ::Gapic::Config::Method.new get_big_query_export_config + get_iam_policy_config = parent_rpcs.get_iam_policy if parent_rpcs.respond_to? :get_iam_policy + @get_iam_policy = ::Gapic::Config::Method.new get_iam_policy_config + get_mute_config_config = parent_rpcs.get_mute_config if parent_rpcs.respond_to? :get_mute_config + @get_mute_config = ::Gapic::Config::Method.new get_mute_config_config + get_notification_config_config = parent_rpcs.get_notification_config if parent_rpcs.respond_to? :get_notification_config + @get_notification_config = ::Gapic::Config::Method.new get_notification_config_config + get_organization_settings_config = parent_rpcs.get_organization_settings if parent_rpcs.respond_to? :get_organization_settings + @get_organization_settings = ::Gapic::Config::Method.new get_organization_settings_config + get_effective_security_health_analytics_custom_module_config = parent_rpcs.get_effective_security_health_analytics_custom_module if parent_rpcs.respond_to? :get_effective_security_health_analytics_custom_module + @get_effective_security_health_analytics_custom_module = ::Gapic::Config::Method.new get_effective_security_health_analytics_custom_module_config + get_security_health_analytics_custom_module_config = parent_rpcs.get_security_health_analytics_custom_module if parent_rpcs.respond_to? :get_security_health_analytics_custom_module + @get_security_health_analytics_custom_module = ::Gapic::Config::Method.new get_security_health_analytics_custom_module_config + get_source_config = parent_rpcs.get_source if parent_rpcs.respond_to? :get_source + @get_source = ::Gapic::Config::Method.new get_source_config + group_assets_config = parent_rpcs.group_assets if parent_rpcs.respond_to? :group_assets + @group_assets = ::Gapic::Config::Method.new group_assets_config + group_findings_config = parent_rpcs.group_findings if parent_rpcs.respond_to? :group_findings + @group_findings = ::Gapic::Config::Method.new group_findings_config + list_assets_config = parent_rpcs.list_assets if parent_rpcs.respond_to? :list_assets + @list_assets = ::Gapic::Config::Method.new list_assets_config + list_descendant_security_health_analytics_custom_modules_config = parent_rpcs.list_descendant_security_health_analytics_custom_modules if parent_rpcs.respond_to? :list_descendant_security_health_analytics_custom_modules + @list_descendant_security_health_analytics_custom_modules = ::Gapic::Config::Method.new list_descendant_security_health_analytics_custom_modules_config + list_findings_config = parent_rpcs.list_findings if parent_rpcs.respond_to? :list_findings + @list_findings = ::Gapic::Config::Method.new list_findings_config + list_mute_configs_config = parent_rpcs.list_mute_configs if parent_rpcs.respond_to? :list_mute_configs + @list_mute_configs = ::Gapic::Config::Method.new list_mute_configs_config + list_notification_configs_config = parent_rpcs.list_notification_configs if parent_rpcs.respond_to? :list_notification_configs + @list_notification_configs = ::Gapic::Config::Method.new list_notification_configs_config + list_effective_security_health_analytics_custom_modules_config = parent_rpcs.list_effective_security_health_analytics_custom_modules if parent_rpcs.respond_to? :list_effective_security_health_analytics_custom_modules + @list_effective_security_health_analytics_custom_modules = ::Gapic::Config::Method.new list_effective_security_health_analytics_custom_modules_config + list_security_health_analytics_custom_modules_config = parent_rpcs.list_security_health_analytics_custom_modules if parent_rpcs.respond_to? :list_security_health_analytics_custom_modules + @list_security_health_analytics_custom_modules = ::Gapic::Config::Method.new list_security_health_analytics_custom_modules_config + list_sources_config = parent_rpcs.list_sources if parent_rpcs.respond_to? :list_sources + @list_sources = ::Gapic::Config::Method.new list_sources_config + run_asset_discovery_config = parent_rpcs.run_asset_discovery if parent_rpcs.respond_to? :run_asset_discovery + @run_asset_discovery = ::Gapic::Config::Method.new run_asset_discovery_config + set_finding_state_config = parent_rpcs.set_finding_state if parent_rpcs.respond_to? :set_finding_state + @set_finding_state = ::Gapic::Config::Method.new set_finding_state_config + set_mute_config = parent_rpcs.set_mute if parent_rpcs.respond_to? :set_mute + @set_mute = ::Gapic::Config::Method.new set_mute_config + set_iam_policy_config = parent_rpcs.set_iam_policy if parent_rpcs.respond_to? :set_iam_policy + @set_iam_policy = ::Gapic::Config::Method.new set_iam_policy_config + test_iam_permissions_config = parent_rpcs.test_iam_permissions if parent_rpcs.respond_to? :test_iam_permissions + @test_iam_permissions = ::Gapic::Config::Method.new test_iam_permissions_config + simulate_security_health_analytics_custom_module_config = parent_rpcs.simulate_security_health_analytics_custom_module if parent_rpcs.respond_to? :simulate_security_health_analytics_custom_module + @simulate_security_health_analytics_custom_module = ::Gapic::Config::Method.new simulate_security_health_analytics_custom_module_config + update_external_system_config = parent_rpcs.update_external_system if parent_rpcs.respond_to? :update_external_system + @update_external_system = ::Gapic::Config::Method.new update_external_system_config + update_finding_config = parent_rpcs.update_finding if parent_rpcs.respond_to? :update_finding + @update_finding = ::Gapic::Config::Method.new update_finding_config + update_mute_config_config = parent_rpcs.update_mute_config if parent_rpcs.respond_to? :update_mute_config + @update_mute_config = ::Gapic::Config::Method.new update_mute_config_config + update_notification_config_config = parent_rpcs.update_notification_config if parent_rpcs.respond_to? :update_notification_config + @update_notification_config = ::Gapic::Config::Method.new update_notification_config_config + update_organization_settings_config = parent_rpcs.update_organization_settings if parent_rpcs.respond_to? :update_organization_settings + @update_organization_settings = ::Gapic::Config::Method.new update_organization_settings_config + update_security_health_analytics_custom_module_config = parent_rpcs.update_security_health_analytics_custom_module if parent_rpcs.respond_to? :update_security_health_analytics_custom_module + @update_security_health_analytics_custom_module = ::Gapic::Config::Method.new update_security_health_analytics_custom_module_config + update_source_config = parent_rpcs.update_source if parent_rpcs.respond_to? :update_source + @update_source = ::Gapic::Config::Method.new update_source_config + update_security_marks_config = parent_rpcs.update_security_marks if parent_rpcs.respond_to? :update_security_marks + @update_security_marks = ::Gapic::Config::Method.new update_security_marks_config + create_big_query_export_config = parent_rpcs.create_big_query_export if parent_rpcs.respond_to? :create_big_query_export + @create_big_query_export = ::Gapic::Config::Method.new create_big_query_export_config + delete_big_query_export_config = parent_rpcs.delete_big_query_export if parent_rpcs.respond_to? :delete_big_query_export + @delete_big_query_export = ::Gapic::Config::Method.new delete_big_query_export_config + update_big_query_export_config = parent_rpcs.update_big_query_export if parent_rpcs.respond_to? :update_big_query_export + @update_big_query_export = ::Gapic::Config::Method.new update_big_query_export_config + list_big_query_exports_config = parent_rpcs.list_big_query_exports if parent_rpcs.respond_to? :list_big_query_exports + @list_big_query_exports = ::Gapic::Config::Method.new list_big_query_exports_config + create_event_threat_detection_custom_module_config = parent_rpcs.create_event_threat_detection_custom_module if parent_rpcs.respond_to? :create_event_threat_detection_custom_module + @create_event_threat_detection_custom_module = ::Gapic::Config::Method.new create_event_threat_detection_custom_module_config + delete_event_threat_detection_custom_module_config = parent_rpcs.delete_event_threat_detection_custom_module if parent_rpcs.respond_to? :delete_event_threat_detection_custom_module + @delete_event_threat_detection_custom_module = ::Gapic::Config::Method.new delete_event_threat_detection_custom_module_config + get_event_threat_detection_custom_module_config = parent_rpcs.get_event_threat_detection_custom_module if parent_rpcs.respond_to? :get_event_threat_detection_custom_module + @get_event_threat_detection_custom_module = ::Gapic::Config::Method.new get_event_threat_detection_custom_module_config + list_descendant_event_threat_detection_custom_modules_config = parent_rpcs.list_descendant_event_threat_detection_custom_modules if parent_rpcs.respond_to? :list_descendant_event_threat_detection_custom_modules + @list_descendant_event_threat_detection_custom_modules = ::Gapic::Config::Method.new list_descendant_event_threat_detection_custom_modules_config + list_event_threat_detection_custom_modules_config = parent_rpcs.list_event_threat_detection_custom_modules if parent_rpcs.respond_to? :list_event_threat_detection_custom_modules + @list_event_threat_detection_custom_modules = ::Gapic::Config::Method.new list_event_threat_detection_custom_modules_config + update_event_threat_detection_custom_module_config = parent_rpcs.update_event_threat_detection_custom_module if parent_rpcs.respond_to? :update_event_threat_detection_custom_module + @update_event_threat_detection_custom_module = ::Gapic::Config::Method.new update_event_threat_detection_custom_module_config + validate_event_threat_detection_custom_module_config = parent_rpcs.validate_event_threat_detection_custom_module if parent_rpcs.respond_to? :validate_event_threat_detection_custom_module + @validate_event_threat_detection_custom_module = ::Gapic::Config::Method.new validate_event_threat_detection_custom_module_config + get_effective_event_threat_detection_custom_module_config = parent_rpcs.get_effective_event_threat_detection_custom_module if parent_rpcs.respond_to? :get_effective_event_threat_detection_custom_module + @get_effective_event_threat_detection_custom_module = ::Gapic::Config::Method.new get_effective_event_threat_detection_custom_module_config + list_effective_event_threat_detection_custom_modules_config = parent_rpcs.list_effective_event_threat_detection_custom_modules if parent_rpcs.respond_to? :list_effective_event_threat_detection_custom_modules + @list_effective_event_threat_detection_custom_modules = ::Gapic::Config::Method.new list_effective_event_threat_detection_custom_modules_config + batch_create_resource_value_configs_config = parent_rpcs.batch_create_resource_value_configs if parent_rpcs.respond_to? :batch_create_resource_value_configs + @batch_create_resource_value_configs = ::Gapic::Config::Method.new batch_create_resource_value_configs_config + delete_resource_value_config_config = parent_rpcs.delete_resource_value_config if parent_rpcs.respond_to? :delete_resource_value_config + @delete_resource_value_config = ::Gapic::Config::Method.new delete_resource_value_config_config + get_resource_value_config_config = parent_rpcs.get_resource_value_config if parent_rpcs.respond_to? :get_resource_value_config + @get_resource_value_config = ::Gapic::Config::Method.new get_resource_value_config_config + list_resource_value_configs_config = parent_rpcs.list_resource_value_configs if parent_rpcs.respond_to? :list_resource_value_configs + @list_resource_value_configs = ::Gapic::Config::Method.new list_resource_value_configs_config + update_resource_value_config_config = parent_rpcs.update_resource_value_config if parent_rpcs.respond_to? :update_resource_value_config + @update_resource_value_config = ::Gapic::Config::Method.new update_resource_value_config_config + list_valued_resources_config = parent_rpcs.list_valued_resources if parent_rpcs.respond_to? :list_valued_resources + @list_valued_resources = ::Gapic::Config::Method.new list_valued_resources_config + list_attack_paths_config = parent_rpcs.list_attack_paths if parent_rpcs.respond_to? :list_attack_paths + @list_attack_paths = ::Gapic::Config::Method.new list_attack_paths_config + + yield self if block_given? + end + end + end + end + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-security_center-v1/lib/google/cloud/security_center/v1/security_center/credentials.rb b/owl-bot-staging/google-cloud-security_center-v1/lib/google/cloud/security_center/v1/security_center/credentials.rb new file mode 100644 index 000000000000..4bb0187caca1 --- /dev/null +++ b/owl-bot-staging/google-cloud-security_center-v1/lib/google/cloud/security_center/v1/security_center/credentials.rb @@ -0,0 +1,51 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +require "googleauth" + +module Google + module Cloud + module SecurityCenter + module V1 + module SecurityCenter + # Credentials for the SecurityCenter API. + class Credentials < ::Google::Auth::Credentials + self.scope = [ + "https://www.googleapis.com/auth/cloud-platform" + ] + self.env_vars = [ + "SECURITY_CENTER_CREDENTIALS", + "SECURITY_CENTER_KEYFILE", + "GOOGLE_CLOUD_CREDENTIALS", + "GOOGLE_CLOUD_KEYFILE", + "GCLOUD_KEYFILE", + "SECURITY_CENTER_CREDENTIALS_JSON", + "SECURITY_CENTER_KEYFILE_JSON", + "GOOGLE_CLOUD_CREDENTIALS_JSON", + "GOOGLE_CLOUD_KEYFILE_JSON", + "GCLOUD_KEYFILE_JSON" + ] + self.paths = [ + "~/.config/google_cloud/application_default_credentials.json" + ] + end + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-security_center-v1/lib/google/cloud/security_center/v1/security_center/operations.rb b/owl-bot-staging/google-cloud-security_center-v1/lib/google/cloud/security_center/v1/security_center/operations.rb new file mode 100644 index 000000000000..c1c3e432c637 --- /dev/null +++ b/owl-bot-staging/google-cloud-security_center-v1/lib/google/cloud/security_center/v1/security_center/operations.rb @@ -0,0 +1,841 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +require "gapic/operation" +require "google/longrunning/operations_pb" + +module Google + module Cloud + module SecurityCenter + module V1 + module SecurityCenter + # Service that implements Longrunning Operations API. + class Operations + # @private + API_VERSION = "" + + # @private + DEFAULT_ENDPOINT_TEMPLATE = "securitycenter.$UNIVERSE_DOMAIN$" + + # @private + attr_reader :operations_stub + + ## + # Configuration for the SecurityCenter 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 SecurityCenter 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::SecurityCenter::V1::VERSION + metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.name + header_params["name"] = request.name + end + + request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") + metadata[:"x-goog-request-params"] ||= request_params_header + + options.apply_defaults timeout: @config.rpcs.list_operations.timeout, + metadata: metadata, + retry_policy: @config.rpcs.list_operations.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @operations_stub.call_rpc :list_operations, request, options: options do |response, operation| + wrap_lro_operation = ->(op_response) { ::Gapic::Operation.new op_response, @operations_client } + response = ::Gapic::PagedEnumerable.new @operations_stub, :list_operations, request, response, operation, options, format_resource: wrap_lro_operation + yield response, operation if block_given? + 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::SecurityCenter::V1::VERSION + metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.name + header_params["name"] = request.name + end + + request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") + metadata[:"x-goog-request-params"] ||= request_params_header + + options.apply_defaults timeout: @config.rpcs.get_operation.timeout, + metadata: metadata, + retry_policy: @config.rpcs.get_operation.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @operations_stub.call_rpc :get_operation, request, options: options do |response, operation| + response = ::Gapic::Operation.new response, @operations_client, options: options + yield response, operation if block_given? + 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::SecurityCenter::V1::VERSION + metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.name + header_params["name"] = request.name + end + + request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") + metadata[:"x-goog-request-params"] ||= request_params_header + + options.apply_defaults timeout: @config.rpcs.delete_operation.timeout, + metadata: metadata, + retry_policy: @config.rpcs.delete_operation.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @operations_stub.call_rpc :delete_operation, request, options: options do |response, operation| + yield response, operation if block_given? + 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::SecurityCenter::V1::VERSION + metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.name + header_params["name"] = request.name + end + + request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") + metadata[:"x-goog-request-params"] ||= request_params_header + + options.apply_defaults timeout: @config.rpcs.cancel_operation.timeout, + metadata: metadata, + retry_policy: @config.rpcs.cancel_operation.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @operations_stub.call_rpc :cancel_operation, request, options: options do |response, operation| + yield response, operation if block_given? + 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::SecurityCenter::V1::VERSION + metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + options.apply_defaults timeout: @config.rpcs.wait_operation.timeout, + metadata: metadata, + retry_policy: @config.rpcs.wait_operation.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @operations_stub.call_rpc :wait_operation, request, options: options do |response, operation| + response = ::Gapic::Operation.new response, @operations_client, options: options + yield response, operation if block_given? + 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 = "securitycenter.googleapis.com" + + config_attr :endpoint, nil, ::String, nil + config_attr :credentials, nil do |value| + allowed = [::String, ::Hash, ::Proc, ::Symbol, ::Google::Auth::Credentials, ::Google::Auth::BaseClient, ::Signet::OAuth2::Client, nil] + allowed += [::GRPC::Core::Channel, ::GRPC::Core::ChannelCredentials] if defined? ::GRPC::Core::Channel + allowed.any? { |klass| klass === value } + end + config_attr :scope, nil, ::String, ::Array, nil + config_attr :lib_name, nil, ::String, nil + config_attr :lib_version, nil, ::String, nil + config_attr(:channel_args, { "grpc.service_config_disable_resolution" => 1 }, ::Hash, nil) + config_attr :interceptors, nil, ::Array, nil + config_attr :timeout, nil, ::Numeric, nil + config_attr :metadata, nil, ::Hash, nil + config_attr :retry_policy, nil, ::Hash, ::Proc, nil + config_attr :quota_project, nil, ::String, nil + config_attr :universe_domain, nil, ::String, nil + config_attr :logger, :default, ::Logger, nil, :default + + # @private + def initialize parent_config = nil + @parent_config = parent_config unless parent_config.nil? + + yield self if block_given? + end + + ## + # Configurations for individual RPCs + # @return [Rpcs] + # + def rpcs + @rpcs ||= begin + parent_rpcs = nil + parent_rpcs = @parent_config.rpcs if defined?(@parent_config) && @parent_config.respond_to?(:rpcs) + Rpcs.new parent_rpcs + end + end + + ## + # Configuration for the channel pool + # @return [::Gapic::ServiceStub::ChannelPool::Configuration] + # + def channel_pool + @channel_pool ||= ::Gapic::ServiceStub::ChannelPool::Configuration.new + end + + ## + # Configuration RPC class for the Operations API. + # + # Includes fields providing the configuration for each RPC in this service. + # Each configuration object is of type `Gapic::Config::Method` and includes + # the following configuration fields: + # + # * `timeout` (*type:* `Numeric`) - The call timeout in seconds + # * `metadata` (*type:* `Hash{Symbol=>String}`) - Additional gRPC headers + # * `retry_policy (*type:* `Hash`) - The retry policy. The policy fields + # include the following keys: + # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds. + # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds. + # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier. + # * `:retry_codes` (*type:* `Array`) - The error codes that should + # trigger a retry. + # + class Rpcs + ## + # RPC-specific configuration for `list_operations` + # @return [::Gapic::Config::Method] + # + attr_reader :list_operations + ## + # RPC-specific configuration for `get_operation` + # @return [::Gapic::Config::Method] + # + attr_reader :get_operation + ## + # RPC-specific configuration for `delete_operation` + # @return [::Gapic::Config::Method] + # + attr_reader :delete_operation + ## + # RPC-specific configuration for `cancel_operation` + # @return [::Gapic::Config::Method] + # + attr_reader :cancel_operation + ## + # RPC-specific configuration for `wait_operation` + # @return [::Gapic::Config::Method] + # + attr_reader :wait_operation + + # @private + def initialize parent_rpcs = nil + list_operations_config = parent_rpcs.list_operations if parent_rpcs.respond_to? :list_operations + @list_operations = ::Gapic::Config::Method.new list_operations_config + get_operation_config = parent_rpcs.get_operation if parent_rpcs.respond_to? :get_operation + @get_operation = ::Gapic::Config::Method.new get_operation_config + delete_operation_config = parent_rpcs.delete_operation if parent_rpcs.respond_to? :delete_operation + @delete_operation = ::Gapic::Config::Method.new delete_operation_config + cancel_operation_config = parent_rpcs.cancel_operation if parent_rpcs.respond_to? :cancel_operation + @cancel_operation = ::Gapic::Config::Method.new cancel_operation_config + wait_operation_config = parent_rpcs.wait_operation if parent_rpcs.respond_to? :wait_operation + @wait_operation = ::Gapic::Config::Method.new wait_operation_config + + yield self if block_given? + end + end + end + end + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-security_center-v1/lib/google/cloud/security_center/v1/security_center/paths.rb b/owl-bot-staging/google-cloud-security_center-v1/lib/google/cloud/security_center/v1/security_center/paths.rb new file mode 100644 index 000000000000..74f6066a7b65 --- /dev/null +++ b/owl-bot-staging/google-cloud-security_center-v1/lib/google/cloud/security_center/v1/security_center/paths.rb @@ -0,0 +1,1127 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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 SecurityCenter + module V1 + module SecurityCenter + # Path helper methods for the SecurityCenter API. + module Paths + ## + # Create a fully-qualified BigQueryExport resource string. + # + # @overload big_query_export_path(organization:, export:) + # The resource will be in the following format: + # + # `organizations/{organization}/bigQueryExports/{export}` + # + # @param organization [String] + # @param export [String] + # + # @overload big_query_export_path(folder:, export:) + # The resource will be in the following format: + # + # `folders/{folder}/bigQueryExports/{export}` + # + # @param folder [String] + # @param export [String] + # + # @overload big_query_export_path(project:, export:) + # The resource will be in the following format: + # + # `projects/{project}/bigQueryExports/{export}` + # + # @param project [String] + # @param export [String] + # + # @return [::String] + def big_query_export_path **args + resources = { + "export:organization" => (proc do |organization:, export:| + raise ::ArgumentError, "organization cannot contain /" if organization.to_s.include? "/" + + "organizations/#{organization}/bigQueryExports/#{export}" + end), + "export:folder" => (proc do |folder:, export:| + raise ::ArgumentError, "folder cannot contain /" if folder.to_s.include? "/" + + "folders/#{folder}/bigQueryExports/#{export}" + end), + "export:project" => (proc do |project:, export:| + raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" + + "projects/#{project}/bigQueryExports/#{export}" + 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 DlpJob resource string. + # + # @overload dlp_job_path(project:, dlp_job:) + # The resource will be in the following format: + # + # `projects/{project}/dlpJobs/{dlp_job}` + # + # @param project [String] + # @param dlp_job [String] + # + # @overload dlp_job_path(project:, location:, dlp_job:) + # The resource will be in the following format: + # + # `projects/{project}/locations/{location}/dlpJobs/{dlp_job}` + # + # @param project [String] + # @param location [String] + # @param dlp_job [String] + # + # @return [::String] + def dlp_job_path **args + resources = { + "dlp_job:project" => (proc do |project:, dlp_job:| + raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" + + "projects/#{project}/dlpJobs/#{dlp_job}" + end), + "dlp_job:location:project" => (proc do |project:, location:, dlp_job:| + raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" + raise ::ArgumentError, "location cannot contain /" if location.to_s.include? "/" + + "projects/#{project}/locations/#{location}/dlpJobs/#{dlp_job}" + 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 EffectiveEventThreatDetectionCustomModule resource string. + # + # @overload effective_event_threat_detection_custom_module_path(organization:, module:) + # The resource will be in the following format: + # + # `organizations/{organization}/eventThreatDetectionSettings/effectiveCustomModules/{module}` + # + # @param organization [String] + # @param module [String] + # + # @overload effective_event_threat_detection_custom_module_path(folder:, module:) + # The resource will be in the following format: + # + # `folders/{folder}/eventThreatDetectionSettings/effectiveCustomModules/{module}` + # + # @param folder [String] + # @param module [String] + # + # @overload effective_event_threat_detection_custom_module_path(project:, module:) + # The resource will be in the following format: + # + # `projects/{project}/eventThreatDetectionSettings/effectiveCustomModules/{module}` + # + # @param project [String] + # @param module [String] + # + # @return [::String] + def effective_event_threat_detection_custom_module_path **args + resources = { + "module:organization" => (proc do |organization:, module:| + raise ::ArgumentError, "organization cannot contain /" if organization.to_s.include? "/" + + "organizations/#{organization}/eventThreatDetectionSettings/effectiveCustomModules/#{binding.local_variable_get :module}" + end), + "folder:module" => (proc do |folder:, module:| + raise ::ArgumentError, "folder cannot contain /" if folder.to_s.include? "/" + + "folders/#{folder}/eventThreatDetectionSettings/effectiveCustomModules/#{binding.local_variable_get :module}" + end), + "module:project" => (proc do |project:, module:| + raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" + + "projects/#{project}/eventThreatDetectionSettings/effectiveCustomModules/#{binding.local_variable_get :module}" + 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 EffectiveSecurityHealthAnalyticsCustomModule resource string. + # + # @overload effective_security_health_analytics_custom_module_path(organization:, effective_custom_module:) + # The resource will be in the following format: + # + # `organizations/{organization}/securityHealthAnalyticsSettings/effectiveCustomModules/{effective_custom_module}` + # + # @param organization [String] + # @param effective_custom_module [String] + # + # @overload effective_security_health_analytics_custom_module_path(folder:, effective_custom_module:) + # The resource will be in the following format: + # + # `folders/{folder}/securityHealthAnalyticsSettings/effectiveCustomModules/{effective_custom_module}` + # + # @param folder [String] + # @param effective_custom_module [String] + # + # @overload effective_security_health_analytics_custom_module_path(project:, effective_custom_module:) + # The resource will be in the following format: + # + # `projects/{project}/securityHealthAnalyticsSettings/effectiveCustomModules/{effective_custom_module}` + # + # @param project [String] + # @param effective_custom_module [String] + # + # @return [::String] + def effective_security_health_analytics_custom_module_path **args + resources = { + "effective_custom_module:organization" => (proc do |organization:, effective_custom_module:| + raise ::ArgumentError, "organization cannot contain /" if organization.to_s.include? "/" + + "organizations/#{organization}/securityHealthAnalyticsSettings/effectiveCustomModules/#{effective_custom_module}" + end), + "effective_custom_module:folder" => (proc do |folder:, effective_custom_module:| + raise ::ArgumentError, "folder cannot contain /" if folder.to_s.include? "/" + + "folders/#{folder}/securityHealthAnalyticsSettings/effectiveCustomModules/#{effective_custom_module}" + end), + "effective_custom_module:project" => (proc do |project:, effective_custom_module:| + raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" + + "projects/#{project}/securityHealthAnalyticsSettings/effectiveCustomModules/#{effective_custom_module}" + 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 EventThreatDetectionCustomModule resource string. + # + # @overload event_threat_detection_custom_module_path(organization:, module:) + # The resource will be in the following format: + # + # `organizations/{organization}/eventThreatDetectionSettings/customModules/{module}` + # + # @param organization [String] + # @param module [String] + # + # @overload event_threat_detection_custom_module_path(folder:, module:) + # The resource will be in the following format: + # + # `folders/{folder}/eventThreatDetectionSettings/customModules/{module}` + # + # @param folder [String] + # @param module [String] + # + # @overload event_threat_detection_custom_module_path(project:, module:) + # The resource will be in the following format: + # + # `projects/{project}/eventThreatDetectionSettings/customModules/{module}` + # + # @param project [String] + # @param module [String] + # + # @return [::String] + def event_threat_detection_custom_module_path **args + resources = { + "module:organization" => (proc do |organization:, module:| + raise ::ArgumentError, "organization cannot contain /" if organization.to_s.include? "/" + + "organizations/#{organization}/eventThreatDetectionSettings/customModules/#{binding.local_variable_get :module}" + end), + "folder:module" => (proc do |folder:, module:| + raise ::ArgumentError, "folder cannot contain /" if folder.to_s.include? "/" + + "folders/#{folder}/eventThreatDetectionSettings/customModules/#{binding.local_variable_get :module}" + end), + "module:project" => (proc do |project:, module:| + raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" + + "projects/#{project}/eventThreatDetectionSettings/customModules/#{binding.local_variable_get :module}" + 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 EventThreatDetectionSettings resource string. + # + # @overload event_threat_detection_settings_path(organization:) + # The resource will be in the following format: + # + # `organizations/{organization}/eventThreatDetectionSettings` + # + # @param organization [String] + # + # @overload event_threat_detection_settings_path(folder:) + # The resource will be in the following format: + # + # `folders/{folder}/eventThreatDetectionSettings` + # + # @param folder [String] + # + # @overload event_threat_detection_settings_path(project:) + # The resource will be in the following format: + # + # `projects/{project}/eventThreatDetectionSettings` + # + # @param project [String] + # + # @return [::String] + def event_threat_detection_settings_path **args + resources = { + "organization" => (proc do |organization:| + "organizations/#{organization}/eventThreatDetectionSettings" + end), + "folder" => (proc do |folder:| + "folders/#{folder}/eventThreatDetectionSettings" + end), + "project" => (proc do |project:| + "projects/#{project}/eventThreatDetectionSettings" + 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 ExternalSystem resource string. + # + # @overload external_system_path(organization:, source:, finding:, externalsystem:) + # The resource will be in the following format: + # + # `organizations/{organization}/sources/{source}/findings/{finding}/externalSystems/{externalsystem}` + # + # @param organization [String] + # @param source [String] + # @param finding [String] + # @param externalsystem [String] + # + # @overload external_system_path(folder:, source:, finding:, externalsystem:) + # The resource will be in the following format: + # + # `folders/{folder}/sources/{source}/findings/{finding}/externalSystems/{externalsystem}` + # + # @param folder [String] + # @param source [String] + # @param finding [String] + # @param externalsystem [String] + # + # @overload external_system_path(project:, source:, finding:, externalsystem:) + # The resource will be in the following format: + # + # `projects/{project}/sources/{source}/findings/{finding}/externalSystems/{externalsystem}` + # + # @param project [String] + # @param source [String] + # @param finding [String] + # @param externalsystem [String] + # + # @return [::String] + def external_system_path **args + resources = { + "externalsystem:finding:organization:source" => (proc do |organization:, source:, finding:, externalsystem:| + raise ::ArgumentError, "organization cannot contain /" if organization.to_s.include? "/" + raise ::ArgumentError, "source cannot contain /" if source.to_s.include? "/" + raise ::ArgumentError, "finding cannot contain /" if finding.to_s.include? "/" + + "organizations/#{organization}/sources/#{source}/findings/#{finding}/externalSystems/#{externalsystem}" + end), + "externalsystem:finding:folder:source" => (proc do |folder:, source:, finding:, externalsystem:| + raise ::ArgumentError, "folder cannot contain /" if folder.to_s.include? "/" + raise ::ArgumentError, "source cannot contain /" if source.to_s.include? "/" + raise ::ArgumentError, "finding cannot contain /" if finding.to_s.include? "/" + + "folders/#{folder}/sources/#{source}/findings/#{finding}/externalSystems/#{externalsystem}" + end), + "externalsystem:finding:project:source" => (proc do |project:, source:, finding:, externalsystem:| + raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" + raise ::ArgumentError, "source cannot contain /" if source.to_s.include? "/" + raise ::ArgumentError, "finding cannot contain /" if finding.to_s.include? "/" + + "projects/#{project}/sources/#{source}/findings/#{finding}/externalSystems/#{externalsystem}" + 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 Finding resource string. + # + # @overload finding_path(organization:, source:, finding:) + # The resource will be in the following format: + # + # `organizations/{organization}/sources/{source}/findings/{finding}` + # + # @param organization [String] + # @param source [String] + # @param finding [String] + # + # @overload finding_path(folder:, source:, finding:) + # The resource will be in the following format: + # + # `folders/{folder}/sources/{source}/findings/{finding}` + # + # @param folder [String] + # @param source [String] + # @param finding [String] + # + # @overload finding_path(project:, source:, finding:) + # The resource will be in the following format: + # + # `projects/{project}/sources/{source}/findings/{finding}` + # + # @param project [String] + # @param source [String] + # @param finding [String] + # + # @return [::String] + def finding_path **args + resources = { + "finding:organization:source" => (proc do |organization:, source:, finding:| + raise ::ArgumentError, "organization cannot contain /" if organization.to_s.include? "/" + raise ::ArgumentError, "source cannot contain /" if source.to_s.include? "/" + + "organizations/#{organization}/sources/#{source}/findings/#{finding}" + end), + "finding:folder:source" => (proc do |folder:, source:, finding:| + raise ::ArgumentError, "folder cannot contain /" if folder.to_s.include? "/" + raise ::ArgumentError, "source cannot contain /" if source.to_s.include? "/" + + "folders/#{folder}/sources/#{source}/findings/#{finding}" + end), + "finding:project:source" => (proc do |project:, source:, finding:| + raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" + raise ::ArgumentError, "source cannot contain /" if source.to_s.include? "/" + + "projects/#{project}/sources/#{source}/findings/#{finding}" + 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 Folder resource string. + # + # The resource will be in the following format: + # + # `folders/{folder}` + # + # @param folder [String] + # + # @return [::String] + def folder_path folder: + "folders/#{folder}" + 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 MuteConfig resource string. + # + # @overload mute_config_path(organization:, mute_config:) + # The resource will be in the following format: + # + # `organizations/{organization}/muteConfigs/{mute_config}` + # + # @param organization [String] + # @param mute_config [String] + # + # @overload mute_config_path(folder:, mute_config:) + # The resource will be in the following format: + # + # `folders/{folder}/muteConfigs/{mute_config}` + # + # @param folder [String] + # @param mute_config [String] + # + # @overload mute_config_path(project:, mute_config:) + # The resource will be in the following format: + # + # `projects/{project}/muteConfigs/{mute_config}` + # + # @param project [String] + # @param mute_config [String] + # + # @overload mute_config_path(organization:, location:, mute_config:) + # The resource will be in the following format: + # + # `organizations/{organization}/locations/{location}/muteConfigs/{mute_config}` + # + # @param organization [String] + # @param location [String] + # @param mute_config [String] + # + # @overload mute_config_path(folder:, location:, mute_config:) + # The resource will be in the following format: + # + # `folders/{folder}/locations/{location}/muteConfigs/{mute_config}` + # + # @param folder [String] + # @param location [String] + # @param mute_config [String] + # + # @overload mute_config_path(project:, location:, mute_config:) + # The resource will be in the following format: + # + # `projects/{project}/locations/{location}/muteConfigs/{mute_config}` + # + # @param project [String] + # @param location [String] + # @param mute_config [String] + # + # @return [::String] + def mute_config_path **args + resources = { + "mute_config:organization" => (proc do |organization:, mute_config:| + raise ::ArgumentError, "organization cannot contain /" if organization.to_s.include? "/" + + "organizations/#{organization}/muteConfigs/#{mute_config}" + end), + "folder:mute_config" => (proc do |folder:, mute_config:| + raise ::ArgumentError, "folder cannot contain /" if folder.to_s.include? "/" + + "folders/#{folder}/muteConfigs/#{mute_config}" + end), + "mute_config:project" => (proc do |project:, mute_config:| + raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" + + "projects/#{project}/muteConfigs/#{mute_config}" + end), + "location:mute_config:organization" => (proc do |organization:, location:, mute_config:| + raise ::ArgumentError, "organization cannot contain /" if organization.to_s.include? "/" + raise ::ArgumentError, "location cannot contain /" if location.to_s.include? "/" + + "organizations/#{organization}/locations/#{location}/muteConfigs/#{mute_config}" + end), + "folder:location:mute_config" => (proc do |folder:, location:, mute_config:| + raise ::ArgumentError, "folder cannot contain /" if folder.to_s.include? "/" + raise ::ArgumentError, "location cannot contain /" if location.to_s.include? "/" + + "folders/#{folder}/locations/#{location}/muteConfigs/#{mute_config}" + end), + "location:mute_config:project" => (proc do |project:, location:, mute_config:| + raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" + raise ::ArgumentError, "location cannot contain /" if location.to_s.include? "/" + + "projects/#{project}/locations/#{location}/muteConfigs/#{mute_config}" + 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 NotificationConfig resource string. + # + # @overload notification_config_path(organization:, notification_config:) + # The resource will be in the following format: + # + # `organizations/{organization}/notificationConfigs/{notification_config}` + # + # @param organization [String] + # @param notification_config [String] + # + # @overload notification_config_path(folder:, notification_config:) + # The resource will be in the following format: + # + # `folders/{folder}/notificationConfigs/{notification_config}` + # + # @param folder [String] + # @param notification_config [String] + # + # @overload notification_config_path(project:, notification_config:) + # The resource will be in the following format: + # + # `projects/{project}/notificationConfigs/{notification_config}` + # + # @param project [String] + # @param notification_config [String] + # + # @return [::String] + def notification_config_path **args + resources = { + "notification_config:organization" => (proc do |organization:, notification_config:| + raise ::ArgumentError, "organization cannot contain /" if organization.to_s.include? "/" + + "organizations/#{organization}/notificationConfigs/#{notification_config}" + end), + "folder:notification_config" => (proc do |folder:, notification_config:| + raise ::ArgumentError, "folder cannot contain /" if folder.to_s.include? "/" + + "folders/#{folder}/notificationConfigs/#{notification_config}" + end), + "notification_config:project" => (proc do |project:, notification_config:| + raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" + + "projects/#{project}/notificationConfigs/#{notification_config}" + 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 Organization resource string. + # + # The resource will be in the following format: + # + # `organizations/{organization}` + # + # @param organization [String] + # + # @return [::String] + def organization_path organization: + "organizations/#{organization}" + 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 OrganizationSettings resource string. + # + # The resource will be in the following format: + # + # `organizations/{organization}/organizationSettings` + # + # @param organization [String] + # + # @return [::String] + def organization_settings_path organization: + "organizations/#{organization}/organizationSettings" + end + + ## + # Create a fully-qualified OrganizationSimulation resource string. + # + # The resource will be in the following format: + # + # `organizations/{organization}/simulations/{simulation}` + # + # @param organization [String] + # @param simulation [String] + # + # @return [::String] + def organization_simulation_path organization:, simulation: + raise ::ArgumentError, "organization cannot contain /" if organization.to_s.include? "/" + + "organizations/#{organization}/simulations/#{simulation}" + end + + ## + # Create a fully-qualified Policy resource string. + # + # @overload policy_path(organization:, constraint_name:) + # The resource will be in the following format: + # + # `organizations/{organization}/policies/{constraint_name}` + # + # @param organization [String] + # @param constraint_name [String] + # + # @overload policy_path(folder:, constraint_name:) + # The resource will be in the following format: + # + # `folders/{folder}/policies/{constraint_name}` + # + # @param folder [String] + # @param constraint_name [String] + # + # @overload policy_path(project:, constraint_name:) + # The resource will be in the following format: + # + # `projects/{project}/policies/{constraint_name}` + # + # @param project [String] + # @param constraint_name [String] + # + # @return [::String] + def policy_path **args + resources = { + "constraint_name:organization" => (proc do |organization:, constraint_name:| + raise ::ArgumentError, "organization cannot contain /" if organization.to_s.include? "/" + + "organizations/#{organization}/policies/#{constraint_name}" + end), + "constraint_name:folder" => (proc do |folder:, constraint_name:| + raise ::ArgumentError, "folder cannot contain /" if folder.to_s.include? "/" + + "folders/#{folder}/policies/#{constraint_name}" + end), + "constraint_name:project" => (proc do |project:, constraint_name:| + raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" + + "projects/#{project}/policies/#{constraint_name}" + 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 Project resource string. + # + # The resource will be in the following format: + # + # `projects/{project}` + # + # @param project [String] + # + # @return [::String] + def project_path project: + "projects/#{project}" + end + + ## + # Create a fully-qualified ResourceValueConfig resource string. + # + # The resource will be in the following format: + # + # `organizations/{organization}/resourceValueConfigs/{resource_value_config}` + # + # @param organization [String] + # @param resource_value_config [String] + # + # @return [::String] + def resource_value_config_path organization:, resource_value_config: + raise ::ArgumentError, "organization cannot contain /" if organization.to_s.include? "/" + + "organizations/#{organization}/resourceValueConfigs/#{resource_value_config}" + end + + ## + # Create a fully-qualified SecurityHealthAnalyticsCustomModule resource string. + # + # @overload security_health_analytics_custom_module_path(organization:, custom_module:) + # The resource will be in the following format: + # + # `organizations/{organization}/securityHealthAnalyticsSettings/customModules/{custom_module}` + # + # @param organization [String] + # @param custom_module [String] + # + # @overload security_health_analytics_custom_module_path(folder:, custom_module:) + # The resource will be in the following format: + # + # `folders/{folder}/securityHealthAnalyticsSettings/customModules/{custom_module}` + # + # @param folder [String] + # @param custom_module [String] + # + # @overload security_health_analytics_custom_module_path(project:, custom_module:) + # The resource will be in the following format: + # + # `projects/{project}/securityHealthAnalyticsSettings/customModules/{custom_module}` + # + # @param project [String] + # @param custom_module [String] + # + # @return [::String] + def security_health_analytics_custom_module_path **args + resources = { + "custom_module:organization" => (proc do |organization:, custom_module:| + raise ::ArgumentError, "organization cannot contain /" if organization.to_s.include? "/" + + "organizations/#{organization}/securityHealthAnalyticsSettings/customModules/#{custom_module}" + end), + "custom_module:folder" => (proc do |folder:, custom_module:| + raise ::ArgumentError, "folder cannot contain /" if folder.to_s.include? "/" + + "folders/#{folder}/securityHealthAnalyticsSettings/customModules/#{custom_module}" + end), + "custom_module:project" => (proc do |project:, custom_module:| + raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" + + "projects/#{project}/securityHealthAnalyticsSettings/customModules/#{custom_module}" + 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 SecurityHealthAnalyticsSettings resource string. + # + # @overload security_health_analytics_settings_path(organization:) + # The resource will be in the following format: + # + # `organizations/{organization}/securityHealthAnalyticsSettings` + # + # @param organization [String] + # + # @overload security_health_analytics_settings_path(folder:) + # The resource will be in the following format: + # + # `folders/{folder}/securityHealthAnalyticsSettings` + # + # @param folder [String] + # + # @overload security_health_analytics_settings_path(project:) + # The resource will be in the following format: + # + # `projects/{project}/securityHealthAnalyticsSettings` + # + # @param project [String] + # + # @return [::String] + def security_health_analytics_settings_path **args + resources = { + "organization" => (proc do |organization:| + "organizations/#{organization}/securityHealthAnalyticsSettings" + end), + "folder" => (proc do |folder:| + "folders/#{folder}/securityHealthAnalyticsSettings" + end), + "project" => (proc do |project:| + "projects/#{project}/securityHealthAnalyticsSettings" + 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 SecurityMarks resource string. + # + # @overload security_marks_path(organization:, asset:) + # The resource will be in the following format: + # + # `organizations/{organization}/assets/{asset}/securityMarks` + # + # @param organization [String] + # @param asset [String] + # + # @overload security_marks_path(organization:, source:, finding:) + # The resource will be in the following format: + # + # `organizations/{organization}/sources/{source}/findings/{finding}/securityMarks` + # + # @param organization [String] + # @param source [String] + # @param finding [String] + # + # @overload security_marks_path(folder:, asset:) + # The resource will be in the following format: + # + # `folders/{folder}/assets/{asset}/securityMarks` + # + # @param folder [String] + # @param asset [String] + # + # @overload security_marks_path(project:, asset:) + # The resource will be in the following format: + # + # `projects/{project}/assets/{asset}/securityMarks` + # + # @param project [String] + # @param asset [String] + # + # @overload security_marks_path(folder:, source:, finding:) + # The resource will be in the following format: + # + # `folders/{folder}/sources/{source}/findings/{finding}/securityMarks` + # + # @param folder [String] + # @param source [String] + # @param finding [String] + # + # @overload security_marks_path(project:, source:, finding:) + # The resource will be in the following format: + # + # `projects/{project}/sources/{source}/findings/{finding}/securityMarks` + # + # @param project [String] + # @param source [String] + # @param finding [String] + # + # @return [::String] + def security_marks_path **args + resources = { + "asset:organization" => (proc do |organization:, asset:| + raise ::ArgumentError, "organization cannot contain /" if organization.to_s.include? "/" + + "organizations/#{organization}/assets/#{asset}/securityMarks" + end), + "finding:organization:source" => (proc do |organization:, source:, finding:| + raise ::ArgumentError, "organization cannot contain /" if organization.to_s.include? "/" + raise ::ArgumentError, "source cannot contain /" if source.to_s.include? "/" + + "organizations/#{organization}/sources/#{source}/findings/#{finding}/securityMarks" + end), + "asset:folder" => (proc do |folder:, asset:| + raise ::ArgumentError, "folder cannot contain /" if folder.to_s.include? "/" + + "folders/#{folder}/assets/#{asset}/securityMarks" + end), + "asset:project" => (proc do |project:, asset:| + raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" + + "projects/#{project}/assets/#{asset}/securityMarks" + end), + "finding:folder:source" => (proc do |folder:, source:, finding:| + raise ::ArgumentError, "folder cannot contain /" if folder.to_s.include? "/" + raise ::ArgumentError, "source cannot contain /" if source.to_s.include? "/" + + "folders/#{folder}/sources/#{source}/findings/#{finding}/securityMarks" + end), + "finding:project:source" => (proc do |project:, source:, finding:| + raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" + raise ::ArgumentError, "source cannot contain /" if source.to_s.include? "/" + + "projects/#{project}/sources/#{source}/findings/#{finding}/securityMarks" + 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 Simulation resource string. + # + # The resource will be in the following format: + # + # `organizations/{organization}/simulations/{simulation}` + # + # @param organization [String] + # @param simulation [String] + # + # @return [::String] + def simulation_path organization:, simulation: + raise ::ArgumentError, "organization cannot contain /" if organization.to_s.include? "/" + + "organizations/#{organization}/simulations/#{simulation}" + end + + ## + # Create a fully-qualified Source resource string. + # + # @overload source_path(organization:, source:) + # The resource will be in the following format: + # + # `organizations/{organization}/sources/{source}` + # + # @param organization [String] + # @param source [String] + # + # @overload source_path(folder:, source:) + # The resource will be in the following format: + # + # `folders/{folder}/sources/{source}` + # + # @param folder [String] + # @param source [String] + # + # @overload source_path(project:, source:) + # The resource will be in the following format: + # + # `projects/{project}/sources/{source}` + # + # @param project [String] + # @param source [String] + # + # @return [::String] + def source_path **args + resources = { + "organization:source" => (proc do |organization:, source:| + raise ::ArgumentError, "organization cannot contain /" if organization.to_s.include? "/" + + "organizations/#{organization}/sources/#{source}" + end), + "folder:source" => (proc do |folder:, source:| + raise ::ArgumentError, "folder cannot contain /" if folder.to_s.include? "/" + + "folders/#{folder}/sources/#{source}" + end), + "project:source" => (proc do |project:, source:| + raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" + + "projects/#{project}/sources/#{source}" + 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 TableDataProfile resource string. + # + # @overload table_data_profile_path(project:, table_profile:) + # The resource will be in the following format: + # + # `projects/{project}/tableProfiles/{table_profile}` + # + # @param project [String] + # @param table_profile [String] + # + # @overload table_data_profile_path(project:, location:, table_profile:) + # The resource will be in the following format: + # + # `projects/{project}/locations/{location}/tableProfiles/{table_profile}` + # + # @param project [String] + # @param location [String] + # @param table_profile [String] + # + # @return [::String] + def table_data_profile_path **args + resources = { + "project:table_profile" => (proc do |project:, table_profile:| + raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" + + "projects/#{project}/tableProfiles/#{table_profile}" + end), + "location:project:table_profile" => (proc do |project:, location:, table_profile:| + raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" + raise ::ArgumentError, "location cannot contain /" if location.to_s.include? "/" + + "projects/#{project}/locations/#{location}/tableProfiles/#{table_profile}" + end) + } + + resource = resources[args.keys.sort.join(":")] + raise ::ArgumentError, "no resource found for values #{args.keys}" if resource.nil? + resource.call(**args) + end + + ## + # Create a fully-qualified Topic resource string. + # + # The resource will be in the following format: + # + # `projects/{project}/topics/{topic}` + # + # @param project [String] + # @param topic [String] + # + # @return [::String] + def topic_path project:, topic: + raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" + + "projects/#{project}/topics/#{topic}" + end + + ## + # Create a fully-qualified ValuedResource resource string. + # + # The resource will be in the following format: + # + # `organizations/{organization}/simulations/{simulation}/valuedResources/{valued_resource}` + # + # @param organization [String] + # @param simulation [String] + # @param valued_resource [String] + # + # @return [::String] + def valued_resource_path organization:, simulation:, valued_resource: + raise ::ArgumentError, "organization cannot contain /" if organization.to_s.include? "/" + raise ::ArgumentError, "simulation cannot contain /" if simulation.to_s.include? "/" + + "organizations/#{organization}/simulations/#{simulation}/valuedResources/#{valued_resource}" + end + + extend self + end + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-security_center-v1/lib/google/cloud/security_center/v1/security_center/rest.rb b/owl-bot-staging/google-cloud-security_center-v1/lib/google/cloud/security_center/v1/security_center/rest.rb new file mode 100644 index 000000000000..9148bffe706d --- /dev/null +++ b/owl-bot-staging/google-cloud-security_center-v1/lib/google/cloud/security_center/v1/security_center/rest.rb @@ -0,0 +1,53 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +require "gapic/rest" +require "gapic/config" +require "gapic/config/method" + +require "google/cloud/security_center/v1/version" + +require "google/cloud/security_center/v1/security_center/credentials" +require "google/cloud/security_center/v1/security_center/paths" +require "google/cloud/security_center/v1/security_center/rest/operations" +require "google/cloud/security_center/v1/security_center/rest/client" + +module Google + module Cloud + module SecurityCenter + module V1 + ## + # V1 APIs for Security Center service. + # + # To load this service and instantiate a REST client: + # + # require "google/cloud/security_center/v1/security_center/rest" + # client = ::Google::Cloud::SecurityCenter::V1::SecurityCenter::Rest::Client.new + # + module SecurityCenter + # Client for the REST transport + module Rest + end + end + end + end + end +end + +helper_path = ::File.join __dir__, "rest", "helpers.rb" +require "google/cloud/security_center/v1/security_center/rest/helpers" if ::File.file? helper_path diff --git a/owl-bot-staging/google-cloud-security_center-v1/lib/google/cloud/security_center/v1/security_center/rest/client.rb b/owl-bot-staging/google-cloud-security_center-v1/lib/google/cloud/security_center/v1/security_center/rest/client.rb new file mode 100644 index 000000000000..f3f3d089b09a --- /dev/null +++ b/owl-bot-staging/google-cloud-security_center-v1/lib/google/cloud/security_center/v1/security_center/rest/client.rb @@ -0,0 +1,6968 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +require "google/cloud/errors" +require "google/cloud/securitycenter/v1/securitycenter_service_pb" +require "google/cloud/security_center/v1/security_center/rest/service_stub" + +module Google + module Cloud + module SecurityCenter + module V1 + module SecurityCenter + module Rest + ## + # REST client for the SecurityCenter service. + # + # V1 APIs for Security Center service. + # + class Client + # @private + API_VERSION = "" + + # @private + DEFAULT_ENDPOINT_TEMPLATE = "securitycenter.$UNIVERSE_DOMAIN$" + + include Paths + + # @private + attr_reader :security_center_stub + + ## + # Configure the SecurityCenter Client class. + # + # See {::Google::Cloud::SecurityCenter::V1::SecurityCenter::Rest::Client::Configuration} + # for a description of the configuration fields. + # + # @example + # + # # Modify the configuration for all SecurityCenter clients + # ::Google::Cloud::SecurityCenter::V1::SecurityCenter::Rest::Client.configure do |config| + # config.timeout = 10.0 + # end + # + # @yield [config] Configure the Client client. + # @yieldparam config [Client::Configuration] + # + # @return [Client::Configuration] + # + def self.configure + @configure ||= begin + namespace = ["Google", "Cloud", "SecurityCenter", "V1"] + parent_config = while namespace.any? + parent_name = namespace.join "::" + parent_const = const_get parent_name + break parent_const.configure if parent_const.respond_to? :configure + namespace.pop + end + default_config = Client::Configuration.new parent_config + + default_config.rpcs.create_security_health_analytics_custom_module.timeout = 60.0 + + default_config.rpcs.create_source.timeout = 60.0 + + default_config.rpcs.create_finding.timeout = 60.0 + + default_config.rpcs.create_notification_config.timeout = 60.0 + + default_config.rpcs.delete_notification_config.timeout = 60.0 + + default_config.rpcs.delete_security_health_analytics_custom_module.timeout = 60.0 + + default_config.rpcs.get_iam_policy.timeout = 60.0 + default_config.rpcs.get_iam_policy.retry_policy = { + initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [4, 14] + } + + default_config.rpcs.get_notification_config.timeout = 60.0 + default_config.rpcs.get_notification_config.retry_policy = { + initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [4, 14] + } + + default_config.rpcs.get_organization_settings.timeout = 60.0 + default_config.rpcs.get_organization_settings.retry_policy = { + initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [4, 14] + } + + default_config.rpcs.get_effective_security_health_analytics_custom_module.timeout = 60.0 + default_config.rpcs.get_effective_security_health_analytics_custom_module.retry_policy = { + initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [4, 14] + } + + default_config.rpcs.get_security_health_analytics_custom_module.timeout = 60.0 + default_config.rpcs.get_security_health_analytics_custom_module.retry_policy = { + initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [4, 14] + } + + default_config.rpcs.get_source.timeout = 60.0 + default_config.rpcs.get_source.retry_policy = { + initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [4, 14] + } + + default_config.rpcs.group_assets.timeout = 480.0 + default_config.rpcs.group_assets.retry_policy = { + initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [4, 14] + } + + default_config.rpcs.group_findings.timeout = 480.0 + default_config.rpcs.group_findings.retry_policy = { + initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [4, 14] + } + + default_config.rpcs.list_assets.timeout = 480.0 + default_config.rpcs.list_assets.retry_policy = { + initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [4, 14] + } + + default_config.rpcs.list_descendant_security_health_analytics_custom_modules.timeout = 60.0 + default_config.rpcs.list_descendant_security_health_analytics_custom_modules.retry_policy = { + initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [4, 14] + } + + default_config.rpcs.list_findings.timeout = 480.0 + default_config.rpcs.list_findings.retry_policy = { + initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [4, 14] + } + + default_config.rpcs.list_notification_configs.timeout = 60.0 + default_config.rpcs.list_notification_configs.retry_policy = { + initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [4, 14] + } + + default_config.rpcs.list_effective_security_health_analytics_custom_modules.timeout = 60.0 + default_config.rpcs.list_effective_security_health_analytics_custom_modules.retry_policy = { + initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [4, 14] + } + + default_config.rpcs.list_security_health_analytics_custom_modules.timeout = 60.0 + default_config.rpcs.list_security_health_analytics_custom_modules.retry_policy = { + initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [4, 14] + } + + default_config.rpcs.list_sources.timeout = 60.0 + default_config.rpcs.list_sources.retry_policy = { + initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [4, 14] + } + + default_config.rpcs.run_asset_discovery.timeout = 60.0 + + default_config.rpcs.set_finding_state.timeout = 60.0 + + default_config.rpcs.set_iam_policy.timeout = 60.0 + + default_config.rpcs.test_iam_permissions.timeout = 60.0 + default_config.rpcs.test_iam_permissions.retry_policy = { + initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [4, 14] + } + + default_config.rpcs.update_finding.timeout = 60.0 + + default_config.rpcs.update_notification_config.timeout = 60.0 + + default_config.rpcs.update_organization_settings.timeout = 60.0 + + default_config.rpcs.update_security_health_analytics_custom_module.timeout = 60.0 + + default_config.rpcs.update_source.timeout = 60.0 + + default_config.rpcs.update_security_marks.timeout = 480.0 + + default_config + end + yield @configure if block_given? + @configure + end + + ## + # Configure the SecurityCenter Client instance. + # + # The configuration is set to the derived mode, meaning that values can be changed, + # but structural changes (adding new fields, etc.) are not allowed. Structural changes + # should be made on {Client.configure}. + # + # See {::Google::Cloud::SecurityCenter::V1::SecurityCenter::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 + @security_center_stub.universe_domain + end + + ## + # Create a new SecurityCenter REST client object. + # + # @example + # + # # Create a client using the default configuration + # client = ::Google::Cloud::SecurityCenter::V1::SecurityCenter::Rest::Client.new + # + # # Create a client using a custom configuration + # client = ::Google::Cloud::SecurityCenter::V1::SecurityCenter::Rest::Client.new do |config| + # config.timeout = 10.0 + # end + # + # @yield [config] Configure the SecurityCenter client. + # @yieldparam config [Client::Configuration] + # + def initialize + # Create the configuration object + @config = Configuration.new Client.configure + + # Yield the configuration if needed + yield @config if block_given? + + # Create credentials + credentials = @config.credentials + # Use self-signed JWT if the endpoint is unchanged from default, + # but only if the default endpoint does not have a region prefix. + enable_self_signed_jwt = @config.endpoint.nil? || + (@config.endpoint == Configuration::DEFAULT_ENDPOINT && + !@config.endpoint.split(".").first.include?("-")) + credentials ||= Credentials.default scope: @config.scope, + enable_self_signed_jwt: enable_self_signed_jwt + if credentials.is_a?(::String) || credentials.is_a?(::Hash) + credentials = Credentials.new credentials, scope: @config.scope + end + + @quota_project_id = @config.quota_project + @quota_project_id ||= credentials.quota_project_id if credentials.respond_to? :quota_project_id + + @operations_client = ::Google::Cloud::SecurityCenter::V1::SecurityCenter::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 + + @security_center_stub = ::Google::Cloud::SecurityCenter::V1::SecurityCenter::Rest::ServiceStub.new( + endpoint: @config.endpoint, + endpoint_template: DEFAULT_ENDPOINT_TEMPLATE, + universe_domain: @config.universe_domain, + credentials: credentials, + logger: @config.logger + ) + + @security_center_stub.logger(stub: true)&.info do |entry| + entry.set_system_name + entry.set_service + entry.message = "Created client for #{entry.service}" + entry.set_credentials_fields credentials + entry.set "customEndpoint", @config.endpoint if @config.endpoint + entry.set "defaultTimeout", @config.timeout if @config.timeout + entry.set "quotaProject", @quota_project_id if @quota_project_id + end + end + + ## + # Get the associated client for long-running operations. + # + # @return [::Google::Cloud::SecurityCenter::V1::SecurityCenter::Rest::Operations] + # + attr_reader :operations_client + + ## + # The logger used for request/response debug logging. + # + # @return [Logger] + # + def logger + @security_center_stub.logger + end + + # Service calls + + ## + # Kicks off an LRO to bulk mute findings for a parent based on a filter. The + # parent can be either an organization, folder or project. The findings + # matched by the filter will be muted after the LRO is done. + # + # @overload bulk_mute_findings(request, options = nil) + # Pass arguments to `bulk_mute_findings` via a request object, either of type + # {::Google::Cloud::SecurityCenter::V1::BulkMuteFindingsRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::SecurityCenter::V1::BulkMuteFindingsRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @overload bulk_mute_findings(parent: nil, filter: nil, mute_annotation: nil, mute_state: nil) + # Pass arguments to `bulk_mute_findings` via keyword arguments. Note that at + # least one keyword argument is 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, at which bulk action needs to be applied. Its format + # is `organizations/[organization_id]`, `folders/[folder_id]`, + # `projects/[project_id]`. + # @param filter [::String] + # Expression that identifies findings that should be updated. + # The expression is a list of zero or more restrictions combined + # via logical operators `AND` and `OR`. Parentheses are supported, and `OR` + # has higher precedence than `AND`. + # + # Restrictions have the form ` ` and may have a + # `-` character in front of them to indicate negation. The fields map to + # those defined in the corresponding resource. + # + # The supported operators are: + # + # * `=` for all value types. + # * `>`, `<`, `>=`, `<=` for integer values. + # * `:`, meaning substring matching, for strings. + # + # The supported value types are: + # + # * string literals in quotes. + # * integer literals without quotes. + # * boolean literals `true` and `false` without quotes. + # @param mute_annotation [::String] + # This can be a mute configuration name or any identifier for mute/unmute + # of findings based on the filter. + # @param mute_state [::Google::Cloud::SecurityCenter::V1::BulkMuteFindingsRequest::MuteState] + # Optional. All findings matching the given filter will have their mute state + # set to this value. The default value is `MUTED`. Setting this to + # `UNDEFINED` will clear the mute state on all matching findings. + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Gapic::Operation] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Gapic::Operation] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/security_center/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::SecurityCenter::V1::SecurityCenter::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::SecurityCenter::V1::BulkMuteFindingsRequest.new + # + # # Call the bulk_mute_findings method. + # result = client.bulk_mute_findings 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 bulk_mute_findings request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::SecurityCenter::V1::BulkMuteFindingsRequest + + # Converts hash 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.bulk_mute_findings.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::SecurityCenter::V1::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + options.apply_defaults timeout: @config.rpcs.bulk_mute_findings.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.bulk_mute_findings.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @security_center_stub.bulk_mute_findings 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 + + ## + # Creates a resident SecurityHealthAnalyticsCustomModule at the scope of the + # given CRM parent, and also creates inherited + # SecurityHealthAnalyticsCustomModules for all CRM descendants of the given + # parent. These modules are enabled by default. + # + # @overload create_security_health_analytics_custom_module(request, options = nil) + # Pass arguments to `create_security_health_analytics_custom_module` via a request object, either of type + # {::Google::Cloud::SecurityCenter::V1::CreateSecurityHealthAnalyticsCustomModuleRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::SecurityCenter::V1::CreateSecurityHealthAnalyticsCustomModuleRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_security_health_analytics_custom_module(parent: nil, security_health_analytics_custom_module: nil) + # Pass arguments to `create_security_health_analytics_custom_module` via keyword arguments. Note that at + # least one keyword argument is 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. Resource name of the new custom module's parent. Its format is + # `organizations/{organization}/securityHealthAnalyticsSettings`, + # `folders/{folder}/securityHealthAnalyticsSettings`, or + # `projects/{project}/securityHealthAnalyticsSettings` + # @param security_health_analytics_custom_module [::Google::Cloud::SecurityCenter::V1::SecurityHealthAnalyticsCustomModule, ::Hash] + # Required. SecurityHealthAnalytics custom module to create. The provided + # name is ignored and reset with provided parent information and + # server-generated ID. + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Cloud::SecurityCenter::V1::SecurityHealthAnalyticsCustomModule] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::SecurityCenter::V1::SecurityHealthAnalyticsCustomModule] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/security_center/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::SecurityCenter::V1::SecurityCenter::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::SecurityCenter::V1::CreateSecurityHealthAnalyticsCustomModuleRequest.new + # + # # Call the create_security_health_analytics_custom_module method. + # result = client.create_security_health_analytics_custom_module request + # + # # The returned object is of type Google::Cloud::SecurityCenter::V1::SecurityHealthAnalyticsCustomModule. + # p result + # + def create_security_health_analytics_custom_module request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::SecurityCenter::V1::CreateSecurityHealthAnalyticsCustomModuleRequest + + # Converts hash 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_security_health_analytics_custom_module.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::SecurityCenter::V1::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + options.apply_defaults timeout: @config.rpcs.create_security_health_analytics_custom_module.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.create_security_health_analytics_custom_module.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @security_center_stub.create_security_health_analytics_custom_module request, options do |result, operation| + yield result, operation if block_given? + end + rescue ::Gapic::Rest::Error => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Creates a source. + # + # @overload create_source(request, options = nil) + # Pass arguments to `create_source` via a request object, either of type + # {::Google::Cloud::SecurityCenter::V1::CreateSourceRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::SecurityCenter::V1::CreateSourceRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_source(parent: nil, source: nil) + # Pass arguments to `create_source` via keyword arguments. Note that at + # least one keyword argument is 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. Resource name of the new source's parent. Its format should be + # `organizations/[organization_id]`. + # @param source [::Google::Cloud::SecurityCenter::V1::Source, ::Hash] + # Required. The Source being created, only the display_name and description + # will be used. All other fields will be ignored. + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Cloud::SecurityCenter::V1::Source] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::SecurityCenter::V1::Source] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/security_center/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::SecurityCenter::V1::SecurityCenter::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::SecurityCenter::V1::CreateSourceRequest.new + # + # # Call the create_source method. + # result = client.create_source request + # + # # The returned object is of type Google::Cloud::SecurityCenter::V1::Source. + # p result + # + def create_source request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::SecurityCenter::V1::CreateSourceRequest + + # Converts hash 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_source.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::SecurityCenter::V1::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + options.apply_defaults timeout: @config.rpcs.create_source.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.create_source.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @security_center_stub.create_source request, options do |result, operation| + yield result, operation if block_given? + end + rescue ::Gapic::Rest::Error => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Creates a finding. The corresponding source must exist for finding creation + # to succeed. + # + # @overload create_finding(request, options = nil) + # Pass arguments to `create_finding` via a request object, either of type + # {::Google::Cloud::SecurityCenter::V1::CreateFindingRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::SecurityCenter::V1::CreateFindingRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_finding(parent: nil, finding_id: nil, finding: nil) + # Pass arguments to `create_finding` via keyword arguments. Note that at + # least one keyword argument is 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. Resource name of the new finding's parent. Its format should be + # `organizations/[organization_id]/sources/[source_id]`. + # @param finding_id [::String] + # Required. Unique identifier provided by the client within the parent scope. + # It must be alphanumeric and less than or equal to 32 characters and + # greater than 0 characters in length. + # @param finding [::Google::Cloud::SecurityCenter::V1::Finding, ::Hash] + # Required. The Finding being created. The name and security_marks will be + # ignored as they are both output only fields on this resource. + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Cloud::SecurityCenter::V1::Finding] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::SecurityCenter::V1::Finding] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/security_center/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::SecurityCenter::V1::SecurityCenter::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::SecurityCenter::V1::CreateFindingRequest.new + # + # # Call the create_finding method. + # result = client.create_finding request + # + # # The returned object is of type Google::Cloud::SecurityCenter::V1::Finding. + # p result + # + def create_finding request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::SecurityCenter::V1::CreateFindingRequest + + # Converts hash 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_finding.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::SecurityCenter::V1::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + options.apply_defaults timeout: @config.rpcs.create_finding.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.create_finding.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @security_center_stub.create_finding request, options do |result, operation| + yield result, operation if block_given? + end + rescue ::Gapic::Rest::Error => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Creates a mute config. + # + # @overload create_mute_config(request, options = nil) + # Pass arguments to `create_mute_config` via a request object, either of type + # {::Google::Cloud::SecurityCenter::V1::CreateMuteConfigRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::SecurityCenter::V1::CreateMuteConfigRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_mute_config(parent: nil, mute_config: nil, mute_config_id: nil) + # Pass arguments to `create_mute_config` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param parent [::String] + # Required. Resource name of the new mute configs's parent. Its format is + # `organizations/[organization_id]`, `folders/[folder_id]`, or + # `projects/[project_id]`. + # @param mute_config [::Google::Cloud::SecurityCenter::V1::MuteConfig, ::Hash] + # Required. The mute config being created. + # @param mute_config_id [::String] + # Required. Unique identifier provided by the client within the parent scope. + # It must consist of only lowercase letters, numbers, and hyphens, must start + # with a letter, must end with either a letter or a number, and must be 63 + # characters or less. + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Cloud::SecurityCenter::V1::MuteConfig] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::SecurityCenter::V1::MuteConfig] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/security_center/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::SecurityCenter::V1::SecurityCenter::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::SecurityCenter::V1::CreateMuteConfigRequest.new + # + # # Call the create_mute_config method. + # result = client.create_mute_config request + # + # # The returned object is of type Google::Cloud::SecurityCenter::V1::MuteConfig. + # p result + # + def create_mute_config request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::SecurityCenter::V1::CreateMuteConfigRequest + + # Converts hash 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_mute_config.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::SecurityCenter::V1::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + options.apply_defaults timeout: @config.rpcs.create_mute_config.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.create_mute_config.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @security_center_stub.create_mute_config request, options do |result, operation| + yield result, operation if block_given? + end + rescue ::Gapic::Rest::Error => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Creates a notification config. + # + # @overload create_notification_config(request, options = nil) + # Pass arguments to `create_notification_config` via a request object, either of type + # {::Google::Cloud::SecurityCenter::V1::CreateNotificationConfigRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::SecurityCenter::V1::CreateNotificationConfigRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_notification_config(parent: nil, config_id: nil, notification_config: nil) + # Pass arguments to `create_notification_config` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param parent [::String] + # Required. Resource name of the new notification config's parent. Its format + # is `organizations/[organization_id]`, `folders/[folder_id]`, or + # `projects/[project_id]`. + # @param config_id [::String] + # Required. + # Unique identifier provided by the client within the parent scope. + # It must be between 1 and 128 characters and contain alphanumeric + # characters, underscores, or hyphens only. + # @param notification_config [::Google::Cloud::SecurityCenter::V1::NotificationConfig, ::Hash] + # Required. The notification config being created. The name and the service + # account will be ignored as they are both output only fields on this + # resource. + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Cloud::SecurityCenter::V1::NotificationConfig] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::SecurityCenter::V1::NotificationConfig] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/security_center/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::SecurityCenter::V1::SecurityCenter::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::SecurityCenter::V1::CreateNotificationConfigRequest.new + # + # # Call the create_notification_config method. + # result = client.create_notification_config request + # + # # The returned object is of type Google::Cloud::SecurityCenter::V1::NotificationConfig. + # p result + # + def create_notification_config request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::SecurityCenter::V1::CreateNotificationConfigRequest + + # Converts hash 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_notification_config.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::SecurityCenter::V1::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + options.apply_defaults timeout: @config.rpcs.create_notification_config.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.create_notification_config.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @security_center_stub.create_notification_config request, options do |result, operation| + yield result, operation if block_given? + end + rescue ::Gapic::Rest::Error => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Deletes an existing mute config. + # + # @overload delete_mute_config(request, options = nil) + # Pass arguments to `delete_mute_config` via a request object, either of type + # {::Google::Cloud::SecurityCenter::V1::DeleteMuteConfigRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::SecurityCenter::V1::DeleteMuteConfigRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_mute_config(name: nil) + # Pass arguments to `delete_mute_config` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param name [::String] + # Required. Name of the mute config to delete. Its format is + # `organizations/{organization}/muteConfigs/{config_id}`, + # `folders/{folder}/muteConfigs/{config_id}`, + # `projects/{project}/muteConfigs/{config_id}`, + # `organizations/{organization}/locations/global/muteConfigs/{config_id}`, + # `folders/{folder}/locations/global/muteConfigs/{config_id}`, or + # `projects/{project}/locations/global/muteConfigs/{config_id}`. + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Protobuf::Empty] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Protobuf::Empty] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/security_center/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::SecurityCenter::V1::SecurityCenter::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::SecurityCenter::V1::DeleteMuteConfigRequest.new + # + # # Call the delete_mute_config method. + # result = client.delete_mute_config request + # + # # The returned object is of type Google::Protobuf::Empty. + # p result + # + def delete_mute_config request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::SecurityCenter::V1::DeleteMuteConfigRequest + + # Converts hash 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_mute_config.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::SecurityCenter::V1::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + options.apply_defaults timeout: @config.rpcs.delete_mute_config.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.delete_mute_config.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @security_center_stub.delete_mute_config request, options do |result, operation| + yield result, operation if block_given? + end + rescue ::Gapic::Rest::Error => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Deletes a notification config. + # + # @overload delete_notification_config(request, options = nil) + # Pass arguments to `delete_notification_config` via a request object, either of type + # {::Google::Cloud::SecurityCenter::V1::DeleteNotificationConfigRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::SecurityCenter::V1::DeleteNotificationConfigRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_notification_config(name: nil) + # Pass arguments to `delete_notification_config` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param name [::String] + # Required. Name of the notification config to delete. Its format is + # `organizations/[organization_id]/notificationConfigs/[config_id]`, + # `folders/[folder_id]/notificationConfigs/[config_id]`, + # or `projects/[project_id]/notificationConfigs/[config_id]`. + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Protobuf::Empty] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Protobuf::Empty] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/security_center/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::SecurityCenter::V1::SecurityCenter::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::SecurityCenter::V1::DeleteNotificationConfigRequest.new + # + # # Call the delete_notification_config method. + # result = client.delete_notification_config request + # + # # The returned object is of type Google::Protobuf::Empty. + # p result + # + def delete_notification_config request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::SecurityCenter::V1::DeleteNotificationConfigRequest + + # Converts hash 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_notification_config.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::SecurityCenter::V1::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + options.apply_defaults timeout: @config.rpcs.delete_notification_config.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.delete_notification_config.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @security_center_stub.delete_notification_config request, options do |result, operation| + yield result, operation if block_given? + end + rescue ::Gapic::Rest::Error => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Deletes the specified SecurityHealthAnalyticsCustomModule and all of its + # descendants in the CRM hierarchy. This method is only supported for + # resident custom modules. + # + # @overload delete_security_health_analytics_custom_module(request, options = nil) + # Pass arguments to `delete_security_health_analytics_custom_module` via a request object, either of type + # {::Google::Cloud::SecurityCenter::V1::DeleteSecurityHealthAnalyticsCustomModuleRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::SecurityCenter::V1::DeleteSecurityHealthAnalyticsCustomModuleRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_security_health_analytics_custom_module(name: nil) + # Pass arguments to `delete_security_health_analytics_custom_module` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param name [::String] + # Required. Name of the custom module to delete. Its format is + # `organizations/{organization}/securityHealthAnalyticsSettings/customModules/{customModule}`, + # `folders/{folder}/securityHealthAnalyticsSettings/customModules/{customModule}`, + # or + # `projects/{project}/securityHealthAnalyticsSettings/customModules/{customModule}` + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Protobuf::Empty] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Protobuf::Empty] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/security_center/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::SecurityCenter::V1::SecurityCenter::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::SecurityCenter::V1::DeleteSecurityHealthAnalyticsCustomModuleRequest.new + # + # # Call the delete_security_health_analytics_custom_module method. + # result = client.delete_security_health_analytics_custom_module request + # + # # The returned object is of type Google::Protobuf::Empty. + # p result + # + def delete_security_health_analytics_custom_module request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::SecurityCenter::V1::DeleteSecurityHealthAnalyticsCustomModuleRequest + + # Converts hash 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_security_health_analytics_custom_module.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::SecurityCenter::V1::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + options.apply_defaults timeout: @config.rpcs.delete_security_health_analytics_custom_module.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.delete_security_health_analytics_custom_module.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @security_center_stub.delete_security_health_analytics_custom_module 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 + + ## + # Get the simulation by name or the latest simulation for the given + # organization. + # + # @overload get_simulation(request, options = nil) + # Pass arguments to `get_simulation` via a request object, either of type + # {::Google::Cloud::SecurityCenter::V1::GetSimulationRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::SecurityCenter::V1::GetSimulationRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_simulation(name: nil) + # Pass arguments to `get_simulation` via keyword arguments. Note that at + # least one keyword argument is 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 organization name or simulation name of this simulation + # + # Valid format: + # `organizations/{organization}/simulations/latest` + # `organizations/{organization}/simulations/{simulation}` + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Cloud::SecurityCenter::V1::Simulation] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::SecurityCenter::V1::Simulation] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/security_center/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::SecurityCenter::V1::SecurityCenter::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::SecurityCenter::V1::GetSimulationRequest.new + # + # # Call the get_simulation method. + # result = client.get_simulation request + # + # # The returned object is of type Google::Cloud::SecurityCenter::V1::Simulation. + # p result + # + def get_simulation request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::SecurityCenter::V1::GetSimulationRequest + + # Converts hash 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_simulation.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::SecurityCenter::V1::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + options.apply_defaults timeout: @config.rpcs.get_simulation.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.get_simulation.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @security_center_stub.get_simulation 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 + + ## + # Get the valued resource by name + # + # @overload get_valued_resource(request, options = nil) + # Pass arguments to `get_valued_resource` via a request object, either of type + # {::Google::Cloud::SecurityCenter::V1::GetValuedResourceRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::SecurityCenter::V1::GetValuedResourceRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_valued_resource(name: nil) + # Pass arguments to `get_valued_resource` via keyword arguments. Note that at + # least one keyword argument is 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 this valued resource + # + # Valid format: + # `organizations/{organization}/simulations/{simulation}/valuedResources/{valued_resource}` + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Cloud::SecurityCenter::V1::ValuedResource] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::SecurityCenter::V1::ValuedResource] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/security_center/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::SecurityCenter::V1::SecurityCenter::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::SecurityCenter::V1::GetValuedResourceRequest.new + # + # # Call the get_valued_resource method. + # result = client.get_valued_resource request + # + # # The returned object is of type Google::Cloud::SecurityCenter::V1::ValuedResource. + # p result + # + def get_valued_resource request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::SecurityCenter::V1::GetValuedResourceRequest + + # Converts hash 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_valued_resource.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::SecurityCenter::V1::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + options.apply_defaults timeout: @config.rpcs.get_valued_resource.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.get_valued_resource.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @security_center_stub.get_valued_resource request, options do |result, operation| + yield result, operation if block_given? + end + rescue ::Gapic::Rest::Error => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Gets a BigQuery export. + # + # @overload get_big_query_export(request, options = nil) + # Pass arguments to `get_big_query_export` via a request object, either of type + # {::Google::Cloud::SecurityCenter::V1::GetBigQueryExportRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::SecurityCenter::V1::GetBigQueryExportRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_big_query_export(name: nil) + # Pass arguments to `get_big_query_export` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param name [::String] + # Required. Name of the BigQuery export to retrieve. Its format is + # `organizations/{organization}/bigQueryExports/{export_id}`, + # `folders/{folder}/bigQueryExports/{export_id}`, or + # `projects/{project}/bigQueryExports/{export_id}` + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Cloud::SecurityCenter::V1::BigQueryExport] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::SecurityCenter::V1::BigQueryExport] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/security_center/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::SecurityCenter::V1::SecurityCenter::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::SecurityCenter::V1::GetBigQueryExportRequest.new + # + # # Call the get_big_query_export method. + # result = client.get_big_query_export request + # + # # The returned object is of type Google::Cloud::SecurityCenter::V1::BigQueryExport. + # p result + # + def get_big_query_export request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::SecurityCenter::V1::GetBigQueryExportRequest + + # Converts hash 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_big_query_export.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::SecurityCenter::V1::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + options.apply_defaults timeout: @config.rpcs.get_big_query_export.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.get_big_query_export.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @security_center_stub.get_big_query_export request, options do |result, operation| + yield result, operation if block_given? + end + rescue ::Gapic::Rest::Error => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Gets the access control policy on the specified Source. + # + # @overload get_iam_policy(request, options = nil) + # Pass arguments to `get_iam_policy` via a request object, either of type + # {::Google::Iam::V1::GetIamPolicyRequest} or an equivalent Hash. + # + # @param request [::Google::Iam::V1::GetIamPolicyRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @overload get_iam_policy(resource: nil, options: nil) + # Pass arguments to `get_iam_policy` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param resource [::String] + # REQUIRED: The resource for which the policy is being requested. + # See the operation documentation for the appropriate value for this field. + # @param options [::Google::Iam::V1::GetPolicyOptions, ::Hash] + # OPTIONAL: A `GetPolicyOptions` object for specifying options to + # `GetIamPolicy`. + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Iam::V1::Policy] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Iam::V1::Policy] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/security_center/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::SecurityCenter::V1::SecurityCenter::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Iam::V1::GetIamPolicyRequest.new + # + # # Call the get_iam_policy method. + # result = client.get_iam_policy request + # + # # The returned object is of type Google::Iam::V1::Policy. + # p result + # + def get_iam_policy request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Iam::V1::GetIamPolicyRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + call_metadata = @config.rpcs.get_iam_policy.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::SecurityCenter::V1::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + options.apply_defaults timeout: @config.rpcs.get_iam_policy.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.get_iam_policy.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @security_center_stub.get_iam_policy request, options do |result, operation| + yield result, operation if block_given? + end + rescue ::Gapic::Rest::Error => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Gets a mute config. + # + # @overload get_mute_config(request, options = nil) + # Pass arguments to `get_mute_config` via a request object, either of type + # {::Google::Cloud::SecurityCenter::V1::GetMuteConfigRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::SecurityCenter::V1::GetMuteConfigRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_mute_config(name: nil) + # Pass arguments to `get_mute_config` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param name [::String] + # Required. Name of the mute config to retrieve. Its format is + # `organizations/{organization}/muteConfigs/{config_id}`, + # `folders/{folder}/muteConfigs/{config_id}`, + # `projects/{project}/muteConfigs/{config_id}`, + # `organizations/{organization}/locations/global/muteConfigs/{config_id}`, + # `folders/{folder}/locations/global/muteConfigs/{config_id}`, or + # `projects/{project}/locations/global/muteConfigs/{config_id}`. + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Cloud::SecurityCenter::V1::MuteConfig] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::SecurityCenter::V1::MuteConfig] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/security_center/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::SecurityCenter::V1::SecurityCenter::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::SecurityCenter::V1::GetMuteConfigRequest.new + # + # # Call the get_mute_config method. + # result = client.get_mute_config request + # + # # The returned object is of type Google::Cloud::SecurityCenter::V1::MuteConfig. + # p result + # + def get_mute_config request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::SecurityCenter::V1::GetMuteConfigRequest + + # Converts hash 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_mute_config.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::SecurityCenter::V1::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + options.apply_defaults timeout: @config.rpcs.get_mute_config.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.get_mute_config.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @security_center_stub.get_mute_config request, options do |result, operation| + yield result, operation if block_given? + end + rescue ::Gapic::Rest::Error => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Gets a notification config. + # + # @overload get_notification_config(request, options = nil) + # Pass arguments to `get_notification_config` via a request object, either of type + # {::Google::Cloud::SecurityCenter::V1::GetNotificationConfigRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::SecurityCenter::V1::GetNotificationConfigRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_notification_config(name: nil) + # Pass arguments to `get_notification_config` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param name [::String] + # Required. Name of the notification config to get. Its format is + # `organizations/[organization_id]/notificationConfigs/[config_id]`, + # `folders/[folder_id]/notificationConfigs/[config_id]`, + # or `projects/[project_id]/notificationConfigs/[config_id]`. + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Cloud::SecurityCenter::V1::NotificationConfig] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::SecurityCenter::V1::NotificationConfig] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/security_center/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::SecurityCenter::V1::SecurityCenter::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::SecurityCenter::V1::GetNotificationConfigRequest.new + # + # # Call the get_notification_config method. + # result = client.get_notification_config request + # + # # The returned object is of type Google::Cloud::SecurityCenter::V1::NotificationConfig. + # p result + # + def get_notification_config request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::SecurityCenter::V1::GetNotificationConfigRequest + + # Converts hash 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_notification_config.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::SecurityCenter::V1::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + options.apply_defaults timeout: @config.rpcs.get_notification_config.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.get_notification_config.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @security_center_stub.get_notification_config request, options do |result, operation| + yield result, operation if block_given? + end + rescue ::Gapic::Rest::Error => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Gets the settings for an organization. + # + # @overload get_organization_settings(request, options = nil) + # Pass arguments to `get_organization_settings` via a request object, either of type + # {::Google::Cloud::SecurityCenter::V1::GetOrganizationSettingsRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::SecurityCenter::V1::GetOrganizationSettingsRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @overload get_organization_settings(name: nil) + # Pass arguments to `get_organization_settings` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param name [::String] + # Required. Name of the organization to get organization settings for. Its + # format is `organizations/[organization_id]/organizationSettings`. + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Cloud::SecurityCenter::V1::OrganizationSettings] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::SecurityCenter::V1::OrganizationSettings] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/security_center/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::SecurityCenter::V1::SecurityCenter::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::SecurityCenter::V1::GetOrganizationSettingsRequest.new + # + # # Call the get_organization_settings method. + # result = client.get_organization_settings request + # + # # The returned object is of type Google::Cloud::SecurityCenter::V1::OrganizationSettings. + # p result + # + def get_organization_settings request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::SecurityCenter::V1::GetOrganizationSettingsRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + call_metadata = @config.rpcs.get_organization_settings.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::SecurityCenter::V1::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + options.apply_defaults timeout: @config.rpcs.get_organization_settings.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.get_organization_settings.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @security_center_stub.get_organization_settings 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 + + ## + # Retrieves an EffectiveSecurityHealthAnalyticsCustomModule. + # + # @overload get_effective_security_health_analytics_custom_module(request, options = nil) + # Pass arguments to `get_effective_security_health_analytics_custom_module` via a request object, either of type + # {::Google::Cloud::SecurityCenter::V1::GetEffectiveSecurityHealthAnalyticsCustomModuleRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::SecurityCenter::V1::GetEffectiveSecurityHealthAnalyticsCustomModuleRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_effective_security_health_analytics_custom_module(name: nil) + # Pass arguments to `get_effective_security_health_analytics_custom_module` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param name [::String] + # Required. Name of the effective custom module to get. Its format is + # `organizations/{organization}/securityHealthAnalyticsSettings/effectiveCustomModules/{customModule}`, + # `folders/{folder}/securityHealthAnalyticsSettings/effectiveCustomModules/{customModule}`, + # or + # `projects/{project}/securityHealthAnalyticsSettings/effectiveCustomModules/{customModule}` + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Cloud::SecurityCenter::V1::EffectiveSecurityHealthAnalyticsCustomModule] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::SecurityCenter::V1::EffectiveSecurityHealthAnalyticsCustomModule] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/security_center/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::SecurityCenter::V1::SecurityCenter::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::SecurityCenter::V1::GetEffectiveSecurityHealthAnalyticsCustomModuleRequest.new + # + # # Call the get_effective_security_health_analytics_custom_module method. + # result = client.get_effective_security_health_analytics_custom_module request + # + # # The returned object is of type Google::Cloud::SecurityCenter::V1::EffectiveSecurityHealthAnalyticsCustomModule. + # p result + # + def get_effective_security_health_analytics_custom_module request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::SecurityCenter::V1::GetEffectiveSecurityHealthAnalyticsCustomModuleRequest + + # Converts hash 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_effective_security_health_analytics_custom_module.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::SecurityCenter::V1::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + options.apply_defaults timeout: @config.rpcs.get_effective_security_health_analytics_custom_module.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.get_effective_security_health_analytics_custom_module.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @security_center_stub.get_effective_security_health_analytics_custom_module 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 + + ## + # Retrieves a SecurityHealthAnalyticsCustomModule. + # + # @overload get_security_health_analytics_custom_module(request, options = nil) + # Pass arguments to `get_security_health_analytics_custom_module` via a request object, either of type + # {::Google::Cloud::SecurityCenter::V1::GetSecurityHealthAnalyticsCustomModuleRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::SecurityCenter::V1::GetSecurityHealthAnalyticsCustomModuleRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_security_health_analytics_custom_module(name: nil) + # Pass arguments to `get_security_health_analytics_custom_module` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param name [::String] + # Required. Name of the custom module to get. Its format is + # `organizations/{organization}/securityHealthAnalyticsSettings/customModules/{customModule}`, + # `folders/{folder}/securityHealthAnalyticsSettings/customModules/{customModule}`, + # or + # `projects/{project}/securityHealthAnalyticsSettings/customModules/{customModule}` + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Cloud::SecurityCenter::V1::SecurityHealthAnalyticsCustomModule] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::SecurityCenter::V1::SecurityHealthAnalyticsCustomModule] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/security_center/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::SecurityCenter::V1::SecurityCenter::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::SecurityCenter::V1::GetSecurityHealthAnalyticsCustomModuleRequest.new + # + # # Call the get_security_health_analytics_custom_module method. + # result = client.get_security_health_analytics_custom_module request + # + # # The returned object is of type Google::Cloud::SecurityCenter::V1::SecurityHealthAnalyticsCustomModule. + # p result + # + def get_security_health_analytics_custom_module request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::SecurityCenter::V1::GetSecurityHealthAnalyticsCustomModuleRequest + + # Converts hash 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_security_health_analytics_custom_module.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::SecurityCenter::V1::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + options.apply_defaults timeout: @config.rpcs.get_security_health_analytics_custom_module.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.get_security_health_analytics_custom_module.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @security_center_stub.get_security_health_analytics_custom_module request, options do |result, operation| + yield result, operation if block_given? + end + rescue ::Gapic::Rest::Error => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Gets a source. + # + # @overload get_source(request, options = nil) + # Pass arguments to `get_source` via a request object, either of type + # {::Google::Cloud::SecurityCenter::V1::GetSourceRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::SecurityCenter::V1::GetSourceRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_source(name: nil) + # Pass arguments to `get_source` via keyword arguments. Note that at + # least one keyword argument is 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. Relative resource name of the source. Its format is + # `organizations/[organization_id]/source/[source_id]`. + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Cloud::SecurityCenter::V1::Source] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::SecurityCenter::V1::Source] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/security_center/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::SecurityCenter::V1::SecurityCenter::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::SecurityCenter::V1::GetSourceRequest.new + # + # # Call the get_source method. + # result = client.get_source request + # + # # The returned object is of type Google::Cloud::SecurityCenter::V1::Source. + # p result + # + def get_source request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::SecurityCenter::V1::GetSourceRequest + + # Converts hash 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_source.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::SecurityCenter::V1::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + options.apply_defaults timeout: @config.rpcs.get_source.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.get_source.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @security_center_stub.get_source 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 + + ## + # Filters an organization's assets and groups them by their specified + # properties. + # + # @overload group_assets(request, options = nil) + # Pass arguments to `group_assets` via a request object, either of type + # {::Google::Cloud::SecurityCenter::V1::GroupAssetsRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::SecurityCenter::V1::GroupAssetsRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @overload group_assets(parent: nil, filter: nil, group_by: nil, compare_duration: nil, read_time: nil, page_token: nil, page_size: nil) + # Pass arguments to `group_assets` via keyword arguments. Note that at + # least one keyword argument is 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 name of the parent to group the assets by. Its format is + # `organizations/[organization_id]`, `folders/[folder_id]`, or + # `projects/[project_id]`. + # @param filter [::String] + # Expression that defines the filter to apply across assets. + # The expression is a list of zero or more restrictions combined via logical + # operators `AND` and `OR`. + # Parentheses are supported, and `OR` has higher precedence than `AND`. + # + # Restrictions have the form ` ` and may have a `-` + # character in front of them to indicate negation. The fields map to those + # defined in the Asset resource. Examples include: + # + # * name + # * security_center_properties.resource_name + # * resource_properties.a_property + # * security_marks.marks.marka + # + # The supported operators are: + # + # * `=` for all value types. + # * `>`, `<`, `>=`, `<=` for integer values. + # * `:`, meaning substring matching, for strings. + # + # The supported value types are: + # + # * string literals in quotes. + # * integer literals without quotes. + # * boolean literals `true` and `false` without quotes. + # + # The following field and operator combinations are supported: + # + # * name: `=` + # * update_time: `=`, `>`, `<`, `>=`, `<=` + # + # Usage: This should be milliseconds since epoch or an RFC3339 string. + # Examples: + # `update_time = "2019-06-10T16:07:18-07:00"` + # `update_time = 1560208038000` + # + # * create_time: `=`, `>`, `<`, `>=`, `<=` + # + # Usage: This should be milliseconds since epoch or an RFC3339 string. + # Examples: + # `create_time = "2019-06-10T16:07:18-07:00"` + # `create_time = 1560208038000` + # + # * iam_policy.policy_blob: `=`, `:` + # * resource_properties: `=`, `:`, `>`, `<`, `>=`, `<=` + # * security_marks.marks: `=`, `:` + # * security_center_properties.resource_name: `=`, `:` + # * security_center_properties.resource_display_name: `=`, `:` + # * security_center_properties.resource_type: `=`, `:` + # * security_center_properties.resource_parent: `=`, `:` + # * security_center_properties.resource_parent_display_name: `=`, `:` + # * security_center_properties.resource_project: `=`, `:` + # * security_center_properties.resource_project_display_name: `=`, `:` + # * security_center_properties.resource_owners: `=`, `:` + # + # For example, `resource_properties.size = 100` is a valid filter string. + # + # Use a partial match on the empty string to filter based on a property + # existing: `resource_properties.my_property : ""` + # + # Use a negated partial match on the empty string to filter based on a + # property not existing: `-resource_properties.my_property : ""` + # @param group_by [::String] + # Required. Expression that defines what assets fields to use for grouping. + # The string value should follow SQL syntax: comma separated list of fields. + # For example: + # "security_center_properties.resource_project,security_center_properties.project". + # + # The following fields are supported when compare_duration is not set: + # + # * security_center_properties.resource_project + # * security_center_properties.resource_project_display_name + # * security_center_properties.resource_type + # * security_center_properties.resource_parent + # * security_center_properties.resource_parent_display_name + # + # The following fields are supported when compare_duration is set: + # + # * security_center_properties.resource_type + # * security_center_properties.resource_project_display_name + # * security_center_properties.resource_parent_display_name + # @param compare_duration [::Google::Protobuf::Duration, ::Hash] + # When compare_duration is set, the GroupResult's "state_change" property is + # updated to indicate whether the asset was added, removed, or remained + # present during the compare_duration period of time that precedes the + # read_time. This is the time between (read_time - compare_duration) and + # read_time. + # + # The state change value is derived based on the presence of the asset at the + # two points in time. Intermediate state changes between the two times don't + # affect the result. For example, the results aren't affected if the asset is + # removed and re-created again. + # + # Possible "state_change" values when compare_duration is specified: + # + # * "ADDED": indicates that the asset was not present at the start of + # compare_duration, but present at reference_time. + # * "REMOVED": indicates that the asset was present at the start of + # compare_duration, but not present at reference_time. + # * "ACTIVE": indicates that the asset was present at both the + # start and the end of the time period defined by + # compare_duration and reference_time. + # + # If compare_duration is not specified, then the only possible state_change + # is "UNUSED", which will be the state_change set for all assets present at + # read_time. + # + # If this field is set then `state_change` must be a specified field in + # `group_by`. + # @param read_time [::Google::Protobuf::Timestamp, ::Hash] + # Time used as a reference point when filtering assets. The filter is limited + # to assets existing at the supplied time and their values are those at that + # specific time. Absence of this field will default to the API's version of + # NOW. + # @param page_token [::String] + # The value returned by the last `GroupAssetsResponse`; indicates + # that this is a continuation of a prior `GroupAssets` call, and that the + # system should return the next page of data. + # @param page_size [::Integer] + # The maximum number of results to return in a single response. Default is + # 10, minimum is 1, maximum is 1000. + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Gapic::Rest::PagedEnumerable<::Google::Cloud::SecurityCenter::V1::GroupResult>] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Gapic::Rest::PagedEnumerable<::Google::Cloud::SecurityCenter::V1::GroupResult>] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/security_center/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::SecurityCenter::V1::SecurityCenter::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::SecurityCenter::V1::GroupAssetsRequest.new + # + # # Call the group_assets method. + # result = client.group_assets request + # + # # The returned object is of type Gapic::PagedEnumerable. You can iterate + # # over elements, and API calls will be issued to fetch pages as needed. + # result.each do |item| + # # Each element is of type ::Google::Cloud::SecurityCenter::V1::GroupResult. + # p item + # end + # + def group_assets request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::SecurityCenter::V1::GroupAssetsRequest + + # Converts hash 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.group_assets.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::SecurityCenter::V1::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + options.apply_defaults timeout: @config.rpcs.group_assets.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.group_assets.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @security_center_stub.group_assets request, options do |result, operation| + result = ::Gapic::Rest::PagedEnumerable.new @security_center_stub, :group_assets, "group_by_results", 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 + + ## + # Filters an organization or source's findings and groups them by their + # specified properties. + # + # To group across all sources provide a `-` as the source id. + # Example: /v1/organizations/\\{organization_id}/sources/-/findings, + # /v1/folders/\\{folder_id}/sources/-/findings, + # /v1/projects/\\{project_id}/sources/-/findings + # + # @overload group_findings(request, options = nil) + # Pass arguments to `group_findings` via a request object, either of type + # {::Google::Cloud::SecurityCenter::V1::GroupFindingsRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::SecurityCenter::V1::GroupFindingsRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @overload group_findings(parent: nil, filter: nil, group_by: nil, read_time: nil, compare_duration: nil, page_token: nil, page_size: nil) + # Pass arguments to `group_findings` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param parent [::String] + # Required. Name of the source to groupBy. Its format is + # `organizations/[organization_id]/sources/[source_id]`, + # `folders/[folder_id]/sources/[source_id]`, or + # `projects/[project_id]/sources/[source_id]`. To groupBy across all sources + # provide a source_id of `-`. For example: + # `organizations/{organization_id}/sources/-, folders/{folder_id}/sources/-`, + # or `projects/{project_id}/sources/-` + # @param filter [::String] + # Expression that defines the filter to apply across findings. + # The expression is a list of one or more restrictions combined via logical + # operators `AND` and `OR`. + # Parentheses are supported, and `OR` has higher precedence than `AND`. + # + # Restrictions have the form ` ` and may have a `-` + # character in front of them to indicate negation. Examples include: + # + # * name + # * source_properties.a_property + # * security_marks.marks.marka + # + # The supported operators are: + # + # * `=` for all value types. + # * `>`, `<`, `>=`, `<=` for integer values. + # * `:`, meaning substring matching, for strings. + # + # The supported value types are: + # + # * string literals in quotes. + # * integer literals without quotes. + # * boolean literals `true` and `false` without quotes. + # + # The following field and operator combinations are supported: + # + # * name: `=` + # * parent: `=`, `:` + # * resource_name: `=`, `:` + # * state: `=`, `:` + # * category: `=`, `:` + # * external_uri: `=`, `:` + # * event_time: `=`, `>`, `<`, `>=`, `<=` + # + # Usage: This should be milliseconds since epoch or an RFC3339 string. + # Examples: + # `event_time = "2019-06-10T16:07:18-07:00"` + # `event_time = 1560208038000` + # + # * severity: `=`, `:` + # * workflow_state: `=`, `:` + # * security_marks.marks: `=`, `:` + # * source_properties: `=`, `:`, `>`, `<`, `>=`, `<=` + # + # For example, `source_properties.size = 100` is a valid filter string. + # + # Use a partial match on the empty string to filter based on a property + # existing: `source_properties.my_property : ""` + # + # Use a negated partial match on the empty string to filter based on a + # property not existing: `-source_properties.my_property : ""` + # + # * resource: + # * resource.name: `=`, `:` + # * resource.parent_name: `=`, `:` + # * resource.parent_display_name: `=`, `:` + # * resource.project_name: `=`, `:` + # * resource.project_display_name: `=`, `:` + # * resource.type: `=`, `:` + # @param group_by [::String] + # Required. Expression that defines what assets fields to use for grouping + # (including `state_change`). The string value should follow SQL syntax: + # comma separated list of fields. For example: "parent,resource_name". + # + # The following fields are supported when compare_duration is set: + # + # * state_change + # @param read_time [::Google::Protobuf::Timestamp, ::Hash] + # Time used as a reference point when filtering findings. The filter is + # limited to findings existing at the supplied time and their values are + # those at that specific time. Absence of this field will default to the + # API's version of NOW. + # @param compare_duration [::Google::Protobuf::Duration, ::Hash] + # When compare_duration is set, the GroupResult's "state_change" attribute is + # updated to indicate whether the finding had its state changed, the + # finding's state remained unchanged, or if the finding was added during the + # compare_duration period of time that precedes the read_time. This is the + # time between (read_time - compare_duration) and read_time. + # + # The state_change value is derived based on the presence and state of the + # finding at the two points in time. Intermediate state changes between the + # two times don't affect the result. For example, the results aren't affected + # if the finding is made inactive and then active again. + # + # Possible "state_change" values when compare_duration is specified: + # + # * "CHANGED": indicates that the finding was present and matched the given + # filter at the start of compare_duration, but changed its + # state at read_time. + # * "UNCHANGED": indicates that the finding was present and matched the given + # filter at the start of compare_duration and did not change + # state at read_time. + # * "ADDED": indicates that the finding did not match the given filter or + # was not present at the start of compare_duration, but was + # present at read_time. + # * "REMOVED": indicates that the finding was present and matched the + # filter at the start of compare_duration, but did not match + # the filter at read_time. + # + # If compare_duration is not specified, then the only possible state_change + # is "UNUSED", which will be the state_change set for all findings present + # at read_time. + # + # If this field is set then `state_change` must be a specified field in + # `group_by`. + # @param page_token [::String] + # The value returned by the last `GroupFindingsResponse`; indicates + # that this is a continuation of a prior `GroupFindings` call, and + # that the system should return the next page of data. + # @param page_size [::Integer] + # The maximum number of results to return in a single response. Default is + # 10, minimum is 1, maximum is 1000. + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Gapic::Rest::PagedEnumerable<::Google::Cloud::SecurityCenter::V1::GroupResult>] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Gapic::Rest::PagedEnumerable<::Google::Cloud::SecurityCenter::V1::GroupResult>] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/security_center/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::SecurityCenter::V1::SecurityCenter::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::SecurityCenter::V1::GroupFindingsRequest.new + # + # # Call the group_findings method. + # result = client.group_findings request + # + # # The returned object is of type Gapic::PagedEnumerable. You can iterate + # # over elements, and API calls will be issued to fetch pages as needed. + # result.each do |item| + # # Each element is of type ::Google::Cloud::SecurityCenter::V1::GroupResult. + # p item + # end + # + def group_findings request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::SecurityCenter::V1::GroupFindingsRequest + + # Converts hash 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.group_findings.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::SecurityCenter::V1::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + options.apply_defaults timeout: @config.rpcs.group_findings.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.group_findings.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @security_center_stub.group_findings request, options do |result, operation| + result = ::Gapic::Rest::PagedEnumerable.new @security_center_stub, :group_findings, "group_by_results", 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 + + ## + # Lists an organization's assets. + # + # @overload list_assets(request, options = nil) + # Pass arguments to `list_assets` via a request object, either of type + # {::Google::Cloud::SecurityCenter::V1::ListAssetsRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::SecurityCenter::V1::ListAssetsRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_assets(parent: nil, filter: nil, order_by: nil, read_time: nil, compare_duration: nil, field_mask: nil, page_token: nil, page_size: nil) + # Pass arguments to `list_assets` via keyword arguments. Note that at + # least one keyword argument is 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 name of the parent resource that contains the assets. The + # value that you can specify on parent depends on the method in which you + # specify parent. You can specify one of the following values: + # `organizations/[organization_id]`, `folders/[folder_id]`, or + # `projects/[project_id]`. + # @param filter [::String] + # Expression that defines the filter to apply across assets. + # The expression is a list of zero or more restrictions combined via logical + # operators `AND` and `OR`. + # Parentheses are supported, and `OR` has higher precedence than `AND`. + # + # Restrictions have the form ` ` and may have a `-` + # character in front of them to indicate negation. The fields map to those + # defined in the Asset resource. Examples include: + # + # * name + # * security_center_properties.resource_name + # * resource_properties.a_property + # * security_marks.marks.marka + # + # The supported operators are: + # + # * `=` for all value types. + # * `>`, `<`, `>=`, `<=` for integer values. + # * `:`, meaning substring matching, for strings. + # + # The supported value types are: + # + # * string literals in quotes. + # * integer literals without quotes. + # * boolean literals `true` and `false` without quotes. + # + # The following are the allowed field and operator combinations: + # + # * name: `=` + # * update_time: `=`, `>`, `<`, `>=`, `<=` + # + # Usage: This should be milliseconds since epoch or an RFC3339 string. + # Examples: + # `update_time = "2019-06-10T16:07:18-07:00"` + # `update_time = 1560208038000` + # + # * create_time: `=`, `>`, `<`, `>=`, `<=` + # + # Usage: This should be milliseconds since epoch or an RFC3339 string. + # Examples: + # `create_time = "2019-06-10T16:07:18-07:00"` + # `create_time = 1560208038000` + # + # * iam_policy.policy_blob: `=`, `:` + # * resource_properties: `=`, `:`, `>`, `<`, `>=`, `<=` + # * security_marks.marks: `=`, `:` + # * security_center_properties.resource_name: `=`, `:` + # * security_center_properties.resource_display_name: `=`, `:` + # * security_center_properties.resource_type: `=`, `:` + # * security_center_properties.resource_parent: `=`, `:` + # * security_center_properties.resource_parent_display_name: `=`, `:` + # * security_center_properties.resource_project: `=`, `:` + # * security_center_properties.resource_project_display_name: `=`, `:` + # * security_center_properties.resource_owners: `=`, `:` + # + # For example, `resource_properties.size = 100` is a valid filter string. + # + # Use a partial match on the empty string to filter based on a property + # existing: `resource_properties.my_property : ""` + # + # Use a negated partial match on the empty string to filter based on a + # property not existing: `-resource_properties.my_property : ""` + # @param order_by [::String] + # Expression that defines what fields and order to use for sorting. The + # string value should follow SQL syntax: comma separated list of fields. For + # example: "name,resource_properties.a_property". The default sorting order + # is ascending. To specify descending order for a field, a suffix " desc" + # should be appended to the field name. For example: "name + # desc,resource_properties.a_property". Redundant space characters in the + # syntax are insignificant. "name desc,resource_properties.a_property" and " + # name desc , resource_properties.a_property " are equivalent. + # + # The following fields are supported: + # name + # update_time + # resource_properties + # security_marks.marks + # security_center_properties.resource_name + # security_center_properties.resource_display_name + # security_center_properties.resource_parent + # security_center_properties.resource_parent_display_name + # security_center_properties.resource_project + # security_center_properties.resource_project_display_name + # security_center_properties.resource_type + # @param read_time [::Google::Protobuf::Timestamp, ::Hash] + # Time used as a reference point when filtering assets. The filter is limited + # to assets existing at the supplied time and their values are those at that + # specific time. Absence of this field will default to the API's version of + # NOW. + # @param compare_duration [::Google::Protobuf::Duration, ::Hash] + # When compare_duration is set, the ListAssetsResult's "state_change" + # attribute is updated to indicate whether the asset was added, removed, or + # remained present during the compare_duration period of time that precedes + # the read_time. This is the time between (read_time - compare_duration) and + # read_time. + # + # The state_change value is derived based on the presence of the asset at the + # two points in time. Intermediate state changes between the two times don't + # affect the result. For example, the results aren't affected if the asset is + # removed and re-created again. + # + # Possible "state_change" values when compare_duration is specified: + # + # * "ADDED": indicates that the asset was not present at the start of + # compare_duration, but present at read_time. + # * "REMOVED": indicates that the asset was present at the start of + # compare_duration, but not present at read_time. + # * "ACTIVE": indicates that the asset was present at both the + # start and the end of the time period defined by + # compare_duration and read_time. + # + # If compare_duration is not specified, then the only possible state_change + # is "UNUSED", which will be the state_change set for all assets present at + # read_time. + # @param field_mask [::Google::Protobuf::FieldMask, ::Hash] + # A field mask to specify the ListAssetsResult fields to be listed in the + # response. + # An empty field mask will list all fields. + # @param page_token [::String] + # The value returned by the last `ListAssetsResponse`; indicates + # that this is a continuation of a prior `ListAssets` call, and + # that the system should return the next page of data. + # @param page_size [::Integer] + # The maximum number of results to return in a single response. Default is + # 10, minimum is 1, maximum is 1000. + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Gapic::Rest::PagedEnumerable<::Google::Cloud::SecurityCenter::V1::ListAssetsResponse::ListAssetsResult>] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Gapic::Rest::PagedEnumerable<::Google::Cloud::SecurityCenter::V1::ListAssetsResponse::ListAssetsResult>] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/security_center/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::SecurityCenter::V1::SecurityCenter::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::SecurityCenter::V1::ListAssetsRequest.new + # + # # Call the list_assets method. + # result = client.list_assets request + # + # # The returned object is of type Gapic::PagedEnumerable. You can iterate + # # over elements, and API calls will be issued to fetch pages as needed. + # result.each do |item| + # # Each element is of type ::Google::Cloud::SecurityCenter::V1::ListAssetsResponse::ListAssetsResult. + # p item + # end + # + def list_assets request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::SecurityCenter::V1::ListAssetsRequest + + # Converts hash 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_assets.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::SecurityCenter::V1::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + options.apply_defaults timeout: @config.rpcs.list_assets.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.list_assets.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @security_center_stub.list_assets request, options do |result, operation| + result = ::Gapic::Rest::PagedEnumerable.new @security_center_stub, :list_assets, "list_assets_results", 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 a list of all resident SecurityHealthAnalyticsCustomModules under + # the given CRM parent and all of the parent’s CRM descendants. + # + # @overload list_descendant_security_health_analytics_custom_modules(request, options = nil) + # Pass arguments to `list_descendant_security_health_analytics_custom_modules` via a request object, either of type + # {::Google::Cloud::SecurityCenter::V1::ListDescendantSecurityHealthAnalyticsCustomModulesRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::SecurityCenter::V1::ListDescendantSecurityHealthAnalyticsCustomModulesRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_descendant_security_health_analytics_custom_modules(parent: nil, page_size: nil, page_token: nil) + # Pass arguments to `list_descendant_security_health_analytics_custom_modules` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param parent [::String] + # Required. Name of parent to list descendant custom modules. Its format is + # `organizations/{organization}/securityHealthAnalyticsSettings`, + # `folders/{folder}/securityHealthAnalyticsSettings`, or + # `projects/{project}/securityHealthAnalyticsSettings` + # @param page_size [::Integer] + # The maximum number of results to return in a single response. Default is + # 10, minimum is 1, maximum is 1000. + # @param page_token [::String] + # The value returned by the last call indicating a continuation + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Gapic::Rest::PagedEnumerable<::Google::Cloud::SecurityCenter::V1::SecurityHealthAnalyticsCustomModule>] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Gapic::Rest::PagedEnumerable<::Google::Cloud::SecurityCenter::V1::SecurityHealthAnalyticsCustomModule>] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/security_center/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::SecurityCenter::V1::SecurityCenter::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::SecurityCenter::V1::ListDescendantSecurityHealthAnalyticsCustomModulesRequest.new + # + # # Call the list_descendant_security_health_analytics_custom_modules method. + # result = client.list_descendant_security_health_analytics_custom_modules request + # + # # The returned object is of type Gapic::PagedEnumerable. You can iterate + # # over elements, and API calls will be issued to fetch pages as needed. + # result.each do |item| + # # Each element is of type ::Google::Cloud::SecurityCenter::V1::SecurityHealthAnalyticsCustomModule. + # p item + # end + # + def list_descendant_security_health_analytics_custom_modules request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::SecurityCenter::V1::ListDescendantSecurityHealthAnalyticsCustomModulesRequest + + # Converts hash 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_descendant_security_health_analytics_custom_modules.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::SecurityCenter::V1::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + options.apply_defaults timeout: @config.rpcs.list_descendant_security_health_analytics_custom_modules.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.list_descendant_security_health_analytics_custom_modules.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @security_center_stub.list_descendant_security_health_analytics_custom_modules request, options do |result, operation| + result = ::Gapic::Rest::PagedEnumerable.new @security_center_stub, :list_descendant_security_health_analytics_custom_modules, "security_health_analytics_custom_modules", 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 + + ## + # Lists an organization or source's findings. + # + # To list across all sources provide a `-` as the source id. + # Example: /v1/organizations/\\{organization_id}/sources/-/findings + # + # @overload list_findings(request, options = nil) + # Pass arguments to `list_findings` via a request object, either of type + # {::Google::Cloud::SecurityCenter::V1::ListFindingsRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::SecurityCenter::V1::ListFindingsRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_findings(parent: nil, filter: nil, order_by: nil, read_time: nil, compare_duration: nil, field_mask: nil, page_token: nil, page_size: nil) + # Pass arguments to `list_findings` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param parent [::String] + # Required. Name of the source the findings belong to. Its format is + # `organizations/[organization_id]/sources/[source_id]`, + # `folders/[folder_id]/sources/[source_id]`, or + # `projects/[project_id]/sources/[source_id]`. To list across all sources + # provide a source_id of `-`. For example: + # `organizations/{organization_id}/sources/-`, + # `folders/{folder_id}/sources/-` or `projects/{projects_id}/sources/-` + # @param filter [::String] + # Expression that defines the filter to apply across findings. + # The expression is a list of one or more restrictions combined via logical + # operators `AND` and `OR`. + # Parentheses are supported, and `OR` has higher precedence than `AND`. + # + # Restrictions have the form ` ` and may have a `-` + # character in front of them to indicate negation. Examples include: + # + # * name + # * source_properties.a_property + # * security_marks.marks.marka + # + # The supported operators are: + # + # * `=` for all value types. + # * `>`, `<`, `>=`, `<=` for integer values. + # * `:`, meaning substring matching, for strings. + # + # The supported value types are: + # + # * string literals in quotes. + # * integer literals without quotes. + # * boolean literals `true` and `false` without quotes. + # + # The following field and operator combinations are supported: + # + # * name: `=` + # * parent: `=`, `:` + # * resource_name: `=`, `:` + # * state: `=`, `:` + # * category: `=`, `:` + # * external_uri: `=`, `:` + # * event_time: `=`, `>`, `<`, `>=`, `<=` + # + # Usage: This should be milliseconds since epoch or an RFC3339 string. + # Examples: + # `event_time = "2019-06-10T16:07:18-07:00"` + # `event_time = 1560208038000` + # + # * severity: `=`, `:` + # * workflow_state: `=`, `:` + # * security_marks.marks: `=`, `:` + # * source_properties: `=`, `:`, `>`, `<`, `>=`, `<=` + # + # For example, `source_properties.size = 100` is a valid filter string. + # + # Use a partial match on the empty string to filter based on a property + # existing: `source_properties.my_property : ""` + # + # Use a negated partial match on the empty string to filter based on a + # property not existing: `-source_properties.my_property : ""` + # + # * resource: + # * resource.name: `=`, `:` + # * resource.parent_name: `=`, `:` + # * resource.parent_display_name: `=`, `:` + # * resource.project_name: `=`, `:` + # * resource.project_display_name: `=`, `:` + # * resource.type: `=`, `:` + # * resource.folders.resource_folder: `=`, `:` + # * resource.display_name: `=`, `:` + # @param order_by [::String] + # Expression that defines what fields and order to use for sorting. The + # string value should follow SQL syntax: comma separated list of fields. For + # example: "name,resource_properties.a_property". The default sorting order + # is ascending. To specify descending order for a field, a suffix " desc" + # should be appended to the field name. For example: "name + # desc,source_properties.a_property". Redundant space characters in the + # syntax are insignificant. "name desc,source_properties.a_property" and " + # name desc , source_properties.a_property " are equivalent. + # + # The following fields are supported: + # name + # parent + # state + # category + # resource_name + # event_time + # source_properties + # security_marks.marks + # @param read_time [::Google::Protobuf::Timestamp, ::Hash] + # Time used as a reference point when filtering findings. The filter is + # limited to findings existing at the supplied time and their values are + # those at that specific time. Absence of this field will default to the + # API's version of NOW. + # @param compare_duration [::Google::Protobuf::Duration, ::Hash] + # When compare_duration is set, the ListFindingsResult's "state_change" + # attribute is updated to indicate whether the finding had its state changed, + # the finding's state remained unchanged, or if the finding was added in any + # state during the compare_duration period of time that precedes the + # read_time. This is the time between (read_time - compare_duration) and + # read_time. + # + # The state_change value is derived based on the presence and state of the + # finding at the two points in time. Intermediate state changes between the + # two times don't affect the result. For example, the results aren't affected + # if the finding is made inactive and then active again. + # + # Possible "state_change" values when compare_duration is specified: + # + # * "CHANGED": indicates that the finding was present and matched the given + # filter at the start of compare_duration, but changed its + # state at read_time. + # * "UNCHANGED": indicates that the finding was present and matched the given + # filter at the start of compare_duration and did not change + # state at read_time. + # * "ADDED": indicates that the finding did not match the given filter or + # was not present at the start of compare_duration, but was + # present at read_time. + # * "REMOVED": indicates that the finding was present and matched the + # filter at the start of compare_duration, but did not match + # the filter at read_time. + # + # If compare_duration is not specified, then the only possible state_change + # is "UNUSED", which will be the state_change set for all findings present at + # read_time. + # @param field_mask [::Google::Protobuf::FieldMask, ::Hash] + # A field mask to specify the Finding fields to be listed in the response. + # An empty field mask will list all fields. + # @param page_token [::String] + # The value returned by the last `ListFindingsResponse`; indicates + # that this is a continuation of a prior `ListFindings` call, and + # that the system should return the next page of data. + # @param page_size [::Integer] + # The maximum number of results to return in a single response. Default is + # 10, minimum is 1, maximum is 1000. + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Gapic::Rest::PagedEnumerable<::Google::Cloud::SecurityCenter::V1::ListFindingsResponse::ListFindingsResult>] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Gapic::Rest::PagedEnumerable<::Google::Cloud::SecurityCenter::V1::ListFindingsResponse::ListFindingsResult>] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/security_center/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::SecurityCenter::V1::SecurityCenter::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::SecurityCenter::V1::ListFindingsRequest.new + # + # # Call the list_findings method. + # result = client.list_findings request + # + # # The returned object is of type Gapic::PagedEnumerable. You can iterate + # # over elements, and API calls will be issued to fetch pages as needed. + # result.each do |item| + # # Each element is of type ::Google::Cloud::SecurityCenter::V1::ListFindingsResponse::ListFindingsResult. + # p item + # end + # + def list_findings request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::SecurityCenter::V1::ListFindingsRequest + + # Converts hash 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_findings.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::SecurityCenter::V1::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + options.apply_defaults timeout: @config.rpcs.list_findings.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.list_findings.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @security_center_stub.list_findings request, options do |result, operation| + result = ::Gapic::Rest::PagedEnumerable.new @security_center_stub, :list_findings, "list_findings_results", 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 + + ## + # Lists mute configs. + # + # @overload list_mute_configs(request, options = nil) + # Pass arguments to `list_mute_configs` via a request object, either of type + # {::Google::Cloud::SecurityCenter::V1::ListMuteConfigsRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::SecurityCenter::V1::ListMuteConfigsRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_mute_configs(parent: nil, page_size: nil, page_token: nil) + # Pass arguments to `list_mute_configs` via keyword arguments. Note that at + # least one keyword argument is 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, which owns the collection of mute configs. Its format + # is `organizations/[organization_id]`, `folders/[folder_id]`, + # `projects/[project_id]`. + # @param page_size [::Integer] + # The maximum number of configs to return. The service may return fewer than + # this value. + # If unspecified, at most 10 configs will be returned. + # The maximum value is 1000; values above 1000 will be coerced to 1000. + # @param page_token [::String] + # A page token, received from a previous `ListMuteConfigs` call. + # Provide this to retrieve the subsequent page. + # + # When paginating, all other parameters provided to `ListMuteConfigs` 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::Cloud::SecurityCenter::V1::MuteConfig>] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Gapic::Rest::PagedEnumerable<::Google::Cloud::SecurityCenter::V1::MuteConfig>] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/security_center/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::SecurityCenter::V1::SecurityCenter::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::SecurityCenter::V1::ListMuteConfigsRequest.new + # + # # Call the list_mute_configs method. + # result = client.list_mute_configs request + # + # # The returned object is of type Gapic::PagedEnumerable. You can iterate + # # over elements, and API calls will be issued to fetch pages as needed. + # result.each do |item| + # # Each element is of type ::Google::Cloud::SecurityCenter::V1::MuteConfig. + # p item + # end + # + def list_mute_configs request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::SecurityCenter::V1::ListMuteConfigsRequest + + # Converts hash 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_mute_configs.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::SecurityCenter::V1::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + options.apply_defaults timeout: @config.rpcs.list_mute_configs.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.list_mute_configs.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @security_center_stub.list_mute_configs request, options do |result, operation| + result = ::Gapic::Rest::PagedEnumerable.new @security_center_stub, :list_mute_configs, "mute_configs", 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 + + ## + # Lists notification configs. + # + # @overload list_notification_configs(request, options = nil) + # Pass arguments to `list_notification_configs` via a request object, either of type + # {::Google::Cloud::SecurityCenter::V1::ListNotificationConfigsRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::SecurityCenter::V1::ListNotificationConfigsRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_notification_configs(parent: nil, page_token: nil, page_size: nil) + # Pass arguments to `list_notification_configs` via keyword arguments. Note that at + # least one keyword argument is 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 name of the parent in which to list the notification + # configurations. Its format is "organizations/[organization_id]", + # "folders/[folder_id]", or "projects/[project_id]". + # @param page_token [::String] + # The value returned by the last `ListNotificationConfigsResponse`; indicates + # that this is a continuation of a prior `ListNotificationConfigs` call, and + # that the system should return the next page of data. + # @param page_size [::Integer] + # The maximum number of results to return in a single response. Default is + # 10, minimum is 1, maximum is 1000. + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Gapic::Rest::PagedEnumerable<::Google::Cloud::SecurityCenter::V1::NotificationConfig>] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Gapic::Rest::PagedEnumerable<::Google::Cloud::SecurityCenter::V1::NotificationConfig>] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/security_center/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::SecurityCenter::V1::SecurityCenter::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::SecurityCenter::V1::ListNotificationConfigsRequest.new + # + # # Call the list_notification_configs method. + # result = client.list_notification_configs request + # + # # The returned object is of type Gapic::PagedEnumerable. You can iterate + # # over elements, and API calls will be issued to fetch pages as needed. + # result.each do |item| + # # Each element is of type ::Google::Cloud::SecurityCenter::V1::NotificationConfig. + # p item + # end + # + def list_notification_configs request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::SecurityCenter::V1::ListNotificationConfigsRequest + + # Converts hash 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_notification_configs.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::SecurityCenter::V1::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + options.apply_defaults timeout: @config.rpcs.list_notification_configs.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.list_notification_configs.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @security_center_stub.list_notification_configs request, options do |result, operation| + result = ::Gapic::Rest::PagedEnumerable.new @security_center_stub, :list_notification_configs, "notification_configs", 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 a list of all EffectiveSecurityHealthAnalyticsCustomModules for the + # given parent. This includes resident modules defined at the scope of the + # parent, and inherited modules, inherited from CRM ancestors. + # + # @overload list_effective_security_health_analytics_custom_modules(request, options = nil) + # Pass arguments to `list_effective_security_health_analytics_custom_modules` via a request object, either of type + # {::Google::Cloud::SecurityCenter::V1::ListEffectiveSecurityHealthAnalyticsCustomModulesRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::SecurityCenter::V1::ListEffectiveSecurityHealthAnalyticsCustomModulesRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_effective_security_health_analytics_custom_modules(parent: nil, page_size: nil, page_token: nil) + # Pass arguments to `list_effective_security_health_analytics_custom_modules` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param parent [::String] + # Required. Name of parent to list effective custom modules. Its format is + # `organizations/{organization}/securityHealthAnalyticsSettings`, + # `folders/{folder}/securityHealthAnalyticsSettings`, or + # `projects/{project}/securityHealthAnalyticsSettings` + # @param page_size [::Integer] + # The maximum number of results to return in a single response. Default is + # 10, minimum is 1, maximum is 1000. + # @param page_token [::String] + # The value returned by the last call indicating a continuation + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Gapic::Rest::PagedEnumerable<::Google::Cloud::SecurityCenter::V1::EffectiveSecurityHealthAnalyticsCustomModule>] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Gapic::Rest::PagedEnumerable<::Google::Cloud::SecurityCenter::V1::EffectiveSecurityHealthAnalyticsCustomModule>] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/security_center/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::SecurityCenter::V1::SecurityCenter::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::SecurityCenter::V1::ListEffectiveSecurityHealthAnalyticsCustomModulesRequest.new + # + # # Call the list_effective_security_health_analytics_custom_modules method. + # result = client.list_effective_security_health_analytics_custom_modules request + # + # # The returned object is of type Gapic::PagedEnumerable. You can iterate + # # over elements, and API calls will be issued to fetch pages as needed. + # result.each do |item| + # # Each element is of type ::Google::Cloud::SecurityCenter::V1::EffectiveSecurityHealthAnalyticsCustomModule. + # p item + # end + # + def list_effective_security_health_analytics_custom_modules request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::SecurityCenter::V1::ListEffectiveSecurityHealthAnalyticsCustomModulesRequest + + # Converts hash 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_effective_security_health_analytics_custom_modules.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::SecurityCenter::V1::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + options.apply_defaults timeout: @config.rpcs.list_effective_security_health_analytics_custom_modules.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.list_effective_security_health_analytics_custom_modules.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @security_center_stub.list_effective_security_health_analytics_custom_modules request, options do |result, operation| + result = ::Gapic::Rest::PagedEnumerable.new @security_center_stub, :list_effective_security_health_analytics_custom_modules, "effective_security_health_analytics_custom_modules", 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 a list of all SecurityHealthAnalyticsCustomModules for the given + # parent. This includes resident modules defined at the scope of the parent, + # and inherited modules, inherited from CRM ancestors. + # + # @overload list_security_health_analytics_custom_modules(request, options = nil) + # Pass arguments to `list_security_health_analytics_custom_modules` via a request object, either of type + # {::Google::Cloud::SecurityCenter::V1::ListSecurityHealthAnalyticsCustomModulesRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::SecurityCenter::V1::ListSecurityHealthAnalyticsCustomModulesRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_security_health_analytics_custom_modules(parent: nil, page_size: nil, page_token: nil) + # Pass arguments to `list_security_health_analytics_custom_modules` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param parent [::String] + # Required. Name of parent to list custom modules. Its format is + # `organizations/{organization}/securityHealthAnalyticsSettings`, + # `folders/{folder}/securityHealthAnalyticsSettings`, or + # `projects/{project}/securityHealthAnalyticsSettings` + # @param page_size [::Integer] + # The maximum number of results to return in a single response. Default is + # 10, minimum is 1, maximum is 1000. + # @param page_token [::String] + # The value returned by the last call indicating a continuation + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Gapic::Rest::PagedEnumerable<::Google::Cloud::SecurityCenter::V1::SecurityHealthAnalyticsCustomModule>] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Gapic::Rest::PagedEnumerable<::Google::Cloud::SecurityCenter::V1::SecurityHealthAnalyticsCustomModule>] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/security_center/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::SecurityCenter::V1::SecurityCenter::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::SecurityCenter::V1::ListSecurityHealthAnalyticsCustomModulesRequest.new + # + # # Call the list_security_health_analytics_custom_modules method. + # result = client.list_security_health_analytics_custom_modules request + # + # # The returned object is of type Gapic::PagedEnumerable. You can iterate + # # over elements, and API calls will be issued to fetch pages as needed. + # result.each do |item| + # # Each element is of type ::Google::Cloud::SecurityCenter::V1::SecurityHealthAnalyticsCustomModule. + # p item + # end + # + def list_security_health_analytics_custom_modules request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::SecurityCenter::V1::ListSecurityHealthAnalyticsCustomModulesRequest + + # Converts hash 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_security_health_analytics_custom_modules.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::SecurityCenter::V1::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + options.apply_defaults timeout: @config.rpcs.list_security_health_analytics_custom_modules.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.list_security_health_analytics_custom_modules.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @security_center_stub.list_security_health_analytics_custom_modules request, options do |result, operation| + result = ::Gapic::Rest::PagedEnumerable.new @security_center_stub, :list_security_health_analytics_custom_modules, "security_health_analytics_custom_modules", 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 + + ## + # Lists all sources belonging to an organization. + # + # @overload list_sources(request, options = nil) + # Pass arguments to `list_sources` via a request object, either of type + # {::Google::Cloud::SecurityCenter::V1::ListSourcesRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::SecurityCenter::V1::ListSourcesRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_sources(parent: nil, page_token: nil, page_size: nil) + # Pass arguments to `list_sources` via keyword arguments. Note that at + # least one keyword argument is 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. Resource name of the parent of sources to list. Its format should + # be `organizations/[organization_id]`, `folders/[folder_id]`, or + # `projects/[project_id]`. + # @param page_token [::String] + # The value returned by the last `ListSourcesResponse`; indicates + # that this is a continuation of a prior `ListSources` call, and + # that the system should return the next page of data. + # @param page_size [::Integer] + # The maximum number of results to return in a single response. Default is + # 10, minimum is 1, maximum is 1000. + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Gapic::Rest::PagedEnumerable<::Google::Cloud::SecurityCenter::V1::Source>] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Gapic::Rest::PagedEnumerable<::Google::Cloud::SecurityCenter::V1::Source>] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/security_center/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::SecurityCenter::V1::SecurityCenter::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::SecurityCenter::V1::ListSourcesRequest.new + # + # # Call the list_sources method. + # result = client.list_sources request + # + # # The returned object is of type Gapic::PagedEnumerable. You can iterate + # # over elements, and API calls will be issued to fetch pages as needed. + # result.each do |item| + # # Each element is of type ::Google::Cloud::SecurityCenter::V1::Source. + # p item + # end + # + def list_sources request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::SecurityCenter::V1::ListSourcesRequest + + # Converts hash 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_sources.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::SecurityCenter::V1::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + options.apply_defaults timeout: @config.rpcs.list_sources.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.list_sources.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @security_center_stub.list_sources request, options do |result, operation| + result = ::Gapic::Rest::PagedEnumerable.new @security_center_stub, :list_sources, "sources", 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 + + ## + # Runs asset discovery. The discovery is tracked with a long-running + # operation. + # + # This API can only be called with limited frequency for an organization. If + # it is called too frequently the caller will receive a TOO_MANY_REQUESTS + # error. + # + # @overload run_asset_discovery(request, options = nil) + # Pass arguments to `run_asset_discovery` via a request object, either of type + # {::Google::Cloud::SecurityCenter::V1::RunAssetDiscoveryRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::SecurityCenter::V1::RunAssetDiscoveryRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @overload run_asset_discovery(parent: nil) + # Pass arguments to `run_asset_discovery` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param parent [::String] + # Required. Name of the organization to run asset discovery for. Its format + # is `organizations/[organization_id]`. + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Gapic::Operation] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Gapic::Operation] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/security_center/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::SecurityCenter::V1::SecurityCenter::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::SecurityCenter::V1::RunAssetDiscoveryRequest.new + # + # # Call the run_asset_discovery method. + # result = client.run_asset_discovery 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 run_asset_discovery request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::SecurityCenter::V1::RunAssetDiscoveryRequest + + # Converts hash 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.run_asset_discovery.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::SecurityCenter::V1::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + options.apply_defaults timeout: @config.rpcs.run_asset_discovery.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.run_asset_discovery.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @security_center_stub.run_asset_discovery 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 + + ## + # Updates the state of a finding. + # + # @overload set_finding_state(request, options = nil) + # Pass arguments to `set_finding_state` via a request object, either of type + # {::Google::Cloud::SecurityCenter::V1::SetFindingStateRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::SecurityCenter::V1::SetFindingStateRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @overload set_finding_state(name: nil, state: nil, start_time: nil) + # Pass arguments to `set_finding_state` via keyword arguments. Note that at + # least one keyword argument is 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 [relative resource + # name](https://cloud.google.com/apis/design/resource_names#relative_resource_name) + # of the finding. Example: + # `organizations/{organization_id}/sources/{source_id}/findings/{finding_id}`, + # `folders/{folder_id}/sources/{source_id}/findings/{finding_id}`, + # `projects/{project_id}/sources/{source_id}/findings/{finding_id}`. + # @param state [::Google::Cloud::SecurityCenter::V1::Finding::State] + # Required. The desired State of the finding. + # @param start_time [::Google::Protobuf::Timestamp, ::Hash] + # Required. The time at which the updated state takes effect. + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Cloud::SecurityCenter::V1::Finding] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::SecurityCenter::V1::Finding] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/security_center/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::SecurityCenter::V1::SecurityCenter::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::SecurityCenter::V1::SetFindingStateRequest.new + # + # # Call the set_finding_state method. + # result = client.set_finding_state request + # + # # The returned object is of type Google::Cloud::SecurityCenter::V1::Finding. + # p result + # + def set_finding_state request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::SecurityCenter::V1::SetFindingStateRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + call_metadata = @config.rpcs.set_finding_state.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::SecurityCenter::V1::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + options.apply_defaults timeout: @config.rpcs.set_finding_state.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.set_finding_state.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @security_center_stub.set_finding_state request, options do |result, operation| + yield result, operation if block_given? + end + rescue ::Gapic::Rest::Error => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Updates the mute state of a finding. + # + # @overload set_mute(request, options = nil) + # Pass arguments to `set_mute` via a request object, either of type + # {::Google::Cloud::SecurityCenter::V1::SetMuteRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::SecurityCenter::V1::SetMuteRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @overload set_mute(name: nil, mute: nil) + # Pass arguments to `set_mute` via keyword arguments. Note that at + # least one keyword argument is 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 [relative resource + # name](https://cloud.google.com/apis/design/resource_names#relative_resource_name) + # of the finding. Example: + # `organizations/{organization_id}/sources/{source_id}/findings/{finding_id}`, + # `folders/{folder_id}/sources/{source_id}/findings/{finding_id}`, + # `projects/{project_id}/sources/{source_id}/findings/{finding_id}`. + # @param mute [::Google::Cloud::SecurityCenter::V1::Finding::Mute] + # Required. The desired state of the Mute. + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Cloud::SecurityCenter::V1::Finding] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::SecurityCenter::V1::Finding] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/security_center/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::SecurityCenter::V1::SecurityCenter::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::SecurityCenter::V1::SetMuteRequest.new + # + # # Call the set_mute method. + # result = client.set_mute request + # + # # The returned object is of type Google::Cloud::SecurityCenter::V1::Finding. + # p result + # + def set_mute request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::SecurityCenter::V1::SetMuteRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + call_metadata = @config.rpcs.set_mute.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::SecurityCenter::V1::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + options.apply_defaults timeout: @config.rpcs.set_mute.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.set_mute.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @security_center_stub.set_mute request, options do |result, operation| + yield result, operation if block_given? + end + rescue ::Gapic::Rest::Error => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Sets the access control policy on the specified Source. + # + # @overload set_iam_policy(request, options = nil) + # Pass arguments to `set_iam_policy` via a request object, either of type + # {::Google::Iam::V1::SetIamPolicyRequest} or an equivalent Hash. + # + # @param request [::Google::Iam::V1::SetIamPolicyRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @overload set_iam_policy(resource: nil, policy: nil, update_mask: nil) + # Pass arguments to `set_iam_policy` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param resource [::String] + # REQUIRED: The resource for which the policy is being specified. + # See the operation documentation for the appropriate value for this field. + # @param policy [::Google::Iam::V1::Policy, ::Hash] + # REQUIRED: The complete policy to be applied to the `resource`. The size of + # the policy is limited to a few 10s of KB. An empty policy is a + # valid policy but certain Cloud Platform services (such as Projects) + # might reject them. + # @param update_mask [::Google::Protobuf::FieldMask, ::Hash] + # OPTIONAL: A FieldMask specifying which fields of the policy to modify. Only + # the fields in the mask will be modified. If no mask is provided, the + # following default mask is used: + # + # `paths: "bindings, etag"` + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Iam::V1::Policy] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Iam::V1::Policy] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/security_center/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::SecurityCenter::V1::SecurityCenter::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Iam::V1::SetIamPolicyRequest.new + # + # # Call the set_iam_policy method. + # result = client.set_iam_policy request + # + # # The returned object is of type Google::Iam::V1::Policy. + # p result + # + def set_iam_policy request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Iam::V1::SetIamPolicyRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + call_metadata = @config.rpcs.set_iam_policy.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::SecurityCenter::V1::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + options.apply_defaults timeout: @config.rpcs.set_iam_policy.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.set_iam_policy.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @security_center_stub.set_iam_policy request, options do |result, operation| + yield result, operation if block_given? + end + rescue ::Gapic::Rest::Error => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Returns the permissions that a caller has on the specified source. + # + # @overload test_iam_permissions(request, options = nil) + # Pass arguments to `test_iam_permissions` via a request object, either of type + # {::Google::Iam::V1::TestIamPermissionsRequest} or an equivalent Hash. + # + # @param request [::Google::Iam::V1::TestIamPermissionsRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @overload test_iam_permissions(resource: nil, permissions: nil) + # Pass arguments to `test_iam_permissions` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param resource [::String] + # REQUIRED: The resource for which the policy detail is being requested. + # See the operation documentation for the appropriate value for this field. + # @param permissions [::Array<::String>] + # The set of permissions to check for the `resource`. Permissions with + # wildcards (such as '*' or 'storage.*') are not allowed. For more + # information see + # [IAM Overview](https://cloud.google.com/iam/docs/overview#permissions). + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Iam::V1::TestIamPermissionsResponse] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Iam::V1::TestIamPermissionsResponse] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/security_center/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::SecurityCenter::V1::SecurityCenter::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Iam::V1::TestIamPermissionsRequest.new + # + # # Call the test_iam_permissions method. + # result = client.test_iam_permissions request + # + # # The returned object is of type Google::Iam::V1::TestIamPermissionsResponse. + # p result + # + def test_iam_permissions request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Iam::V1::TestIamPermissionsRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + call_metadata = @config.rpcs.test_iam_permissions.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::SecurityCenter::V1::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + options.apply_defaults timeout: @config.rpcs.test_iam_permissions.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.test_iam_permissions.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @security_center_stub.test_iam_permissions request, options do |result, operation| + yield result, operation if block_given? + end + rescue ::Gapic::Rest::Error => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Simulates a given SecurityHealthAnalyticsCustomModule and Resource. + # + # @overload simulate_security_health_analytics_custom_module(request, options = nil) + # Pass arguments to `simulate_security_health_analytics_custom_module` via a request object, either of type + # {::Google::Cloud::SecurityCenter::V1::SimulateSecurityHealthAnalyticsCustomModuleRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::SecurityCenter::V1::SimulateSecurityHealthAnalyticsCustomModuleRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @overload simulate_security_health_analytics_custom_module(parent: nil, custom_config: nil, resource: nil) + # Pass arguments to `simulate_security_health_analytics_custom_module` via keyword arguments. Note that at + # least one keyword argument is 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 relative resource name of the organization, project, or + # folder. For more information about relative resource names, see [Relative + # Resource + # Name](https://cloud.google.com/apis/design/resource_names#relative_resource_name) + # Example: `organizations/{organization_id}` + # @param custom_config [::Google::Cloud::SecurityCenter::V1::CustomConfig, ::Hash] + # Required. The custom configuration that you need to test. + # @param resource [::Google::Cloud::SecurityCenter::V1::SimulateSecurityHealthAnalyticsCustomModuleRequest::SimulatedResource, ::Hash] + # Required. Resource data to simulate custom module against. + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Cloud::SecurityCenter::V1::SimulateSecurityHealthAnalyticsCustomModuleResponse] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::SecurityCenter::V1::SimulateSecurityHealthAnalyticsCustomModuleResponse] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/security_center/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::SecurityCenter::V1::SecurityCenter::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::SecurityCenter::V1::SimulateSecurityHealthAnalyticsCustomModuleRequest.new + # + # # Call the simulate_security_health_analytics_custom_module method. + # result = client.simulate_security_health_analytics_custom_module request + # + # # The returned object is of type Google::Cloud::SecurityCenter::V1::SimulateSecurityHealthAnalyticsCustomModuleResponse. + # p result + # + def simulate_security_health_analytics_custom_module request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::SecurityCenter::V1::SimulateSecurityHealthAnalyticsCustomModuleRequest + + # Converts hash 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.simulate_security_health_analytics_custom_module.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::SecurityCenter::V1::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + options.apply_defaults timeout: @config.rpcs.simulate_security_health_analytics_custom_module.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.simulate_security_health_analytics_custom_module.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @security_center_stub.simulate_security_health_analytics_custom_module 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 external system. This is for a given finding. + # + # @overload update_external_system(request, options = nil) + # Pass arguments to `update_external_system` via a request object, either of type + # {::Google::Cloud::SecurityCenter::V1::UpdateExternalSystemRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::SecurityCenter::V1::UpdateExternalSystemRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_external_system(external_system: nil, update_mask: nil) + # Pass arguments to `update_external_system` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param external_system [::Google::Cloud::SecurityCenter::V1::ExternalSystem, ::Hash] + # Required. The external system resource to update. + # @param update_mask [::Google::Protobuf::FieldMask, ::Hash] + # The FieldMask to use when updating the external system resource. + # + # If empty all mutable fields will be updated. + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Cloud::SecurityCenter::V1::ExternalSystem] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::SecurityCenter::V1::ExternalSystem] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/security_center/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::SecurityCenter::V1::SecurityCenter::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::SecurityCenter::V1::UpdateExternalSystemRequest.new + # + # # Call the update_external_system method. + # result = client.update_external_system request + # + # # The returned object is of type Google::Cloud::SecurityCenter::V1::ExternalSystem. + # p result + # + def update_external_system request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::SecurityCenter::V1::UpdateExternalSystemRequest + + # Converts hash 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_external_system.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::SecurityCenter::V1::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + options.apply_defaults timeout: @config.rpcs.update_external_system.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.update_external_system.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @security_center_stub.update_external_system request, options do |result, operation| + yield result, operation if block_given? + end + rescue ::Gapic::Rest::Error => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Creates or updates a finding. The corresponding source must exist for a + # finding creation to succeed. + # + # @overload update_finding(request, options = nil) + # Pass arguments to `update_finding` via a request object, either of type + # {::Google::Cloud::SecurityCenter::V1::UpdateFindingRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::SecurityCenter::V1::UpdateFindingRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_finding(finding: nil, update_mask: nil) + # Pass arguments to `update_finding` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param finding [::Google::Cloud::SecurityCenter::V1::Finding, ::Hash] + # Required. The finding resource to update or create if it does not already + # exist. parent, security_marks, and update_time will be ignored. + # + # In the case of creation, the finding id portion of the name must be + # alphanumeric and less than or equal to 32 characters and greater than 0 + # characters in length. + # @param update_mask [::Google::Protobuf::FieldMask, ::Hash] + # The FieldMask to use when updating the finding resource. This field should + # not be specified when creating a finding. + # + # When updating a finding, an empty mask is treated as updating all mutable + # fields and replacing source_properties. Individual source_properties can + # be added/updated by using "source_properties." in the field + # mask. + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Cloud::SecurityCenter::V1::Finding] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::SecurityCenter::V1::Finding] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/security_center/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::SecurityCenter::V1::SecurityCenter::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::SecurityCenter::V1::UpdateFindingRequest.new + # + # # Call the update_finding method. + # result = client.update_finding request + # + # # The returned object is of type Google::Cloud::SecurityCenter::V1::Finding. + # p result + # + def update_finding request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::SecurityCenter::V1::UpdateFindingRequest + + # Converts hash 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_finding.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::SecurityCenter::V1::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + options.apply_defaults timeout: @config.rpcs.update_finding.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.update_finding.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @security_center_stub.update_finding 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 mute config. + # + # @overload update_mute_config(request, options = nil) + # Pass arguments to `update_mute_config` via a request object, either of type + # {::Google::Cloud::SecurityCenter::V1::UpdateMuteConfigRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::SecurityCenter::V1::UpdateMuteConfigRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_mute_config(mute_config: nil, update_mask: nil) + # Pass arguments to `update_mute_config` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param mute_config [::Google::Cloud::SecurityCenter::V1::MuteConfig, ::Hash] + # Required. The mute config being updated. + # @param update_mask [::Google::Protobuf::FieldMask, ::Hash] + # The list of fields to be updated. + # If empty all mutable fields will be updated. + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Cloud::SecurityCenter::V1::MuteConfig] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::SecurityCenter::V1::MuteConfig] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/security_center/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::SecurityCenter::V1::SecurityCenter::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::SecurityCenter::V1::UpdateMuteConfigRequest.new + # + # # Call the update_mute_config method. + # result = client.update_mute_config request + # + # # The returned object is of type Google::Cloud::SecurityCenter::V1::MuteConfig. + # p result + # + def update_mute_config request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::SecurityCenter::V1::UpdateMuteConfigRequest + + # Converts hash 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_mute_config.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::SecurityCenter::V1::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + options.apply_defaults timeout: @config.rpcs.update_mute_config.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.update_mute_config.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @security_center_stub.update_mute_config request, options do |result, operation| + yield result, operation if block_given? + end + rescue ::Gapic::Rest::Error => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Updates a notification config. The following update + # fields are allowed: description, pubsub_topic, streaming_config.filter + # + # @overload update_notification_config(request, options = nil) + # Pass arguments to `update_notification_config` via a request object, either of type + # {::Google::Cloud::SecurityCenter::V1::UpdateNotificationConfigRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::SecurityCenter::V1::UpdateNotificationConfigRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_notification_config(notification_config: nil, update_mask: nil) + # Pass arguments to `update_notification_config` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param notification_config [::Google::Cloud::SecurityCenter::V1::NotificationConfig, ::Hash] + # Required. The notification config to update. + # @param update_mask [::Google::Protobuf::FieldMask, ::Hash] + # The FieldMask to use when updating the notification config. + # + # If empty all mutable fields will be updated. + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Cloud::SecurityCenter::V1::NotificationConfig] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::SecurityCenter::V1::NotificationConfig] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/security_center/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::SecurityCenter::V1::SecurityCenter::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::SecurityCenter::V1::UpdateNotificationConfigRequest.new + # + # # Call the update_notification_config method. + # result = client.update_notification_config request + # + # # The returned object is of type Google::Cloud::SecurityCenter::V1::NotificationConfig. + # p result + # + def update_notification_config request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::SecurityCenter::V1::UpdateNotificationConfigRequest + + # Converts hash 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_notification_config.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::SecurityCenter::V1::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + options.apply_defaults timeout: @config.rpcs.update_notification_config.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.update_notification_config.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @security_center_stub.update_notification_config request, options do |result, operation| + yield result, operation if block_given? + end + rescue ::Gapic::Rest::Error => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Updates an organization's settings. + # + # @overload update_organization_settings(request, options = nil) + # Pass arguments to `update_organization_settings` via a request object, either of type + # {::Google::Cloud::SecurityCenter::V1::UpdateOrganizationSettingsRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::SecurityCenter::V1::UpdateOrganizationSettingsRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @overload update_organization_settings(organization_settings: nil, update_mask: nil) + # Pass arguments to `update_organization_settings` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param organization_settings [::Google::Cloud::SecurityCenter::V1::OrganizationSettings, ::Hash] + # Required. The organization settings resource to update. + # @param update_mask [::Google::Protobuf::FieldMask, ::Hash] + # The FieldMask to use when updating the settings resource. + # + # If empty all mutable fields will be updated. + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Cloud::SecurityCenter::V1::OrganizationSettings] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::SecurityCenter::V1::OrganizationSettings] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/security_center/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::SecurityCenter::V1::SecurityCenter::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::SecurityCenter::V1::UpdateOrganizationSettingsRequest.new + # + # # Call the update_organization_settings method. + # result = client.update_organization_settings request + # + # # The returned object is of type Google::Cloud::SecurityCenter::V1::OrganizationSettings. + # p result + # + def update_organization_settings request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::SecurityCenter::V1::UpdateOrganizationSettingsRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + call_metadata = @config.rpcs.update_organization_settings.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::SecurityCenter::V1::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + options.apply_defaults timeout: @config.rpcs.update_organization_settings.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.update_organization_settings.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @security_center_stub.update_organization_settings request, options do |result, operation| + yield result, operation if block_given? + end + rescue ::Gapic::Rest::Error => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Updates the SecurityHealthAnalyticsCustomModule under the given name based + # on the given update mask. Updating the enablement state is supported on + # both resident and inherited modules (though resident modules cannot have an + # enablement state of "inherited"). Updating the display name and custom + # config of a module is supported on resident modules only. + # + # @overload update_security_health_analytics_custom_module(request, options = nil) + # Pass arguments to `update_security_health_analytics_custom_module` via a request object, either of type + # {::Google::Cloud::SecurityCenter::V1::UpdateSecurityHealthAnalyticsCustomModuleRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::SecurityCenter::V1::UpdateSecurityHealthAnalyticsCustomModuleRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_security_health_analytics_custom_module(security_health_analytics_custom_module: nil, update_mask: nil) + # Pass arguments to `update_security_health_analytics_custom_module` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param security_health_analytics_custom_module [::Google::Cloud::SecurityCenter::V1::SecurityHealthAnalyticsCustomModule, ::Hash] + # Required. The SecurityHealthAnalytics custom module to update. + # @param update_mask [::Google::Protobuf::FieldMask, ::Hash] + # The list of fields to be updated. The only fields that can be updated are + # `enablement_state` and `custom_config`. If empty or set to the wildcard + # value `*`, both `enablement_state` and `custom_config` are updated. + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Cloud::SecurityCenter::V1::SecurityHealthAnalyticsCustomModule] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::SecurityCenter::V1::SecurityHealthAnalyticsCustomModule] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/security_center/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::SecurityCenter::V1::SecurityCenter::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::SecurityCenter::V1::UpdateSecurityHealthAnalyticsCustomModuleRequest.new + # + # # Call the update_security_health_analytics_custom_module method. + # result = client.update_security_health_analytics_custom_module request + # + # # The returned object is of type Google::Cloud::SecurityCenter::V1::SecurityHealthAnalyticsCustomModule. + # p result + # + def update_security_health_analytics_custom_module request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::SecurityCenter::V1::UpdateSecurityHealthAnalyticsCustomModuleRequest + + # Converts hash 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_security_health_analytics_custom_module.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::SecurityCenter::V1::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + options.apply_defaults timeout: @config.rpcs.update_security_health_analytics_custom_module.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.update_security_health_analytics_custom_module.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @security_center_stub.update_security_health_analytics_custom_module 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 source. + # + # @overload update_source(request, options = nil) + # Pass arguments to `update_source` via a request object, either of type + # {::Google::Cloud::SecurityCenter::V1::UpdateSourceRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::SecurityCenter::V1::UpdateSourceRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_source(source: nil, update_mask: nil) + # Pass arguments to `update_source` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param source [::Google::Cloud::SecurityCenter::V1::Source, ::Hash] + # Required. The source resource to update. + # @param update_mask [::Google::Protobuf::FieldMask, ::Hash] + # The FieldMask to use when updating the source resource. + # + # If empty all mutable fields will be updated. + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Cloud::SecurityCenter::V1::Source] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::SecurityCenter::V1::Source] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/security_center/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::SecurityCenter::V1::SecurityCenter::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::SecurityCenter::V1::UpdateSourceRequest.new + # + # # Call the update_source method. + # result = client.update_source request + # + # # The returned object is of type Google::Cloud::SecurityCenter::V1::Source. + # p result + # + def update_source request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::SecurityCenter::V1::UpdateSourceRequest + + # Converts hash 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_source.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::SecurityCenter::V1::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + options.apply_defaults timeout: @config.rpcs.update_source.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.update_source.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @security_center_stub.update_source 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 security marks. + # + # @overload update_security_marks(request, options = nil) + # Pass arguments to `update_security_marks` via a request object, either of type + # {::Google::Cloud::SecurityCenter::V1::UpdateSecurityMarksRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::SecurityCenter::V1::UpdateSecurityMarksRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_security_marks(security_marks: nil, update_mask: nil, start_time: nil) + # Pass arguments to `update_security_marks` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param security_marks [::Google::Cloud::SecurityCenter::V1::SecurityMarks, ::Hash] + # Required. The security marks resource to update. + # @param update_mask [::Google::Protobuf::FieldMask, ::Hash] + # The FieldMask to use when updating the security marks resource. + # + # The field mask must not contain duplicate fields. + # If empty or set to "marks", all marks will be replaced. Individual + # marks can be updated using "marks.". + # @param start_time [::Google::Protobuf::Timestamp, ::Hash] + # The time at which the updated SecurityMarks take effect. + # If not set uses current server time. Updates will be applied to the + # SecurityMarks that are active immediately preceding this time. Must be + # earlier or equal to the server time. + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Cloud::SecurityCenter::V1::SecurityMarks] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::SecurityCenter::V1::SecurityMarks] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/security_center/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::SecurityCenter::V1::SecurityCenter::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::SecurityCenter::V1::UpdateSecurityMarksRequest.new + # + # # Call the update_security_marks method. + # result = client.update_security_marks request + # + # # The returned object is of type Google::Cloud::SecurityCenter::V1::SecurityMarks. + # p result + # + def update_security_marks request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::SecurityCenter::V1::UpdateSecurityMarksRequest + + # Converts hash 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_security_marks.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::SecurityCenter::V1::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + options.apply_defaults timeout: @config.rpcs.update_security_marks.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.update_security_marks.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @security_center_stub.update_security_marks request, options do |result, operation| + yield result, operation if block_given? + end + rescue ::Gapic::Rest::Error => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Creates a BigQuery export. + # + # @overload create_big_query_export(request, options = nil) + # Pass arguments to `create_big_query_export` via a request object, either of type + # {::Google::Cloud::SecurityCenter::V1::CreateBigQueryExportRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::SecurityCenter::V1::CreateBigQueryExportRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_big_query_export(parent: nil, big_query_export: nil, big_query_export_id: nil) + # Pass arguments to `create_big_query_export` via keyword arguments. Note that at + # least one keyword argument is 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 name of the parent resource of the new BigQuery export. Its + # format is `organizations/[organization_id]`, `folders/[folder_id]`, or + # `projects/[project_id]`. + # @param big_query_export [::Google::Cloud::SecurityCenter::V1::BigQueryExport, ::Hash] + # Required. The BigQuery export being created. + # @param big_query_export_id [::String] + # Required. Unique identifier provided by the client within the parent scope. + # It must consist of only lowercase letters, numbers, and hyphens, must start + # with a letter, must end with either a letter or a number, and must be 63 + # characters or less. + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Cloud::SecurityCenter::V1::BigQueryExport] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::SecurityCenter::V1::BigQueryExport] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/security_center/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::SecurityCenter::V1::SecurityCenter::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::SecurityCenter::V1::CreateBigQueryExportRequest.new + # + # # Call the create_big_query_export method. + # result = client.create_big_query_export request + # + # # The returned object is of type Google::Cloud::SecurityCenter::V1::BigQueryExport. + # p result + # + def create_big_query_export request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::SecurityCenter::V1::CreateBigQueryExportRequest + + # Converts hash 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_big_query_export.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::SecurityCenter::V1::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + options.apply_defaults timeout: @config.rpcs.create_big_query_export.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.create_big_query_export.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @security_center_stub.create_big_query_export request, options do |result, operation| + yield result, operation if block_given? + end + rescue ::Gapic::Rest::Error => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Deletes an existing BigQuery export. + # + # @overload delete_big_query_export(request, options = nil) + # Pass arguments to `delete_big_query_export` via a request object, either of type + # {::Google::Cloud::SecurityCenter::V1::DeleteBigQueryExportRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::SecurityCenter::V1::DeleteBigQueryExportRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_big_query_export(name: nil) + # Pass arguments to `delete_big_query_export` via keyword arguments. Note that at + # least one keyword argument is 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 BigQuery export to delete. Its format is + # `organizations/{organization}/bigQueryExports/{export_id}`, + # `folders/{folder}/bigQueryExports/{export_id}`, or + # `projects/{project}/bigQueryExports/{export_id}` + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Protobuf::Empty] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Protobuf::Empty] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/security_center/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::SecurityCenter::V1::SecurityCenter::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::SecurityCenter::V1::DeleteBigQueryExportRequest.new + # + # # Call the delete_big_query_export method. + # result = client.delete_big_query_export request + # + # # The returned object is of type Google::Protobuf::Empty. + # p result + # + def delete_big_query_export request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::SecurityCenter::V1::DeleteBigQueryExportRequest + + # Converts hash 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_big_query_export.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::SecurityCenter::V1::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + options.apply_defaults timeout: @config.rpcs.delete_big_query_export.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.delete_big_query_export.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @security_center_stub.delete_big_query_export 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 BigQuery export. + # + # @overload update_big_query_export(request, options = nil) + # Pass arguments to `update_big_query_export` via a request object, either of type + # {::Google::Cloud::SecurityCenter::V1::UpdateBigQueryExportRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::SecurityCenter::V1::UpdateBigQueryExportRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_big_query_export(big_query_export: nil, update_mask: nil) + # Pass arguments to `update_big_query_export` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param big_query_export [::Google::Cloud::SecurityCenter::V1::BigQueryExport, ::Hash] + # Required. The BigQuery export being updated. + # @param update_mask [::Google::Protobuf::FieldMask, ::Hash] + # The list of fields to be updated. + # If empty all mutable fields will be updated. + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Cloud::SecurityCenter::V1::BigQueryExport] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::SecurityCenter::V1::BigQueryExport] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/security_center/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::SecurityCenter::V1::SecurityCenter::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::SecurityCenter::V1::UpdateBigQueryExportRequest.new + # + # # Call the update_big_query_export method. + # result = client.update_big_query_export request + # + # # The returned object is of type Google::Cloud::SecurityCenter::V1::BigQueryExport. + # p result + # + def update_big_query_export request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::SecurityCenter::V1::UpdateBigQueryExportRequest + + # Converts hash 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_big_query_export.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::SecurityCenter::V1::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + options.apply_defaults timeout: @config.rpcs.update_big_query_export.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.update_big_query_export.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @security_center_stub.update_big_query_export request, options do |result, operation| + yield result, operation if block_given? + end + rescue ::Gapic::Rest::Error => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Lists BigQuery exports. Note that when requesting BigQuery exports at a + # given level all exports under that level are also returned e.g. if + # requesting BigQuery exports under a folder, then all BigQuery exports + # immediately under the folder plus the ones created under the projects + # within the folder are returned. + # + # @overload list_big_query_exports(request, options = nil) + # Pass arguments to `list_big_query_exports` via a request object, either of type + # {::Google::Cloud::SecurityCenter::V1::ListBigQueryExportsRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::SecurityCenter::V1::ListBigQueryExportsRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_big_query_exports(parent: nil, page_size: nil, page_token: nil) + # Pass arguments to `list_big_query_exports` via keyword arguments. Note that at + # least one keyword argument is 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, which owns the collection of BigQuery exports. Its + # format is `organizations/[organization_id]`, `folders/[folder_id]`, + # `projects/[project_id]`. + # @param page_size [::Integer] + # The maximum number of configs to return. The service may return fewer than + # this value. + # If unspecified, at most 10 configs will be returned. + # The maximum value is 1000; values above 1000 will be coerced to 1000. + # @param page_token [::String] + # A page token, received from a previous `ListBigQueryExports` call. + # Provide this to retrieve the subsequent page. + # When paginating, all other parameters provided to `ListBigQueryExports` + # 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::Cloud::SecurityCenter::V1::BigQueryExport>] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Gapic::Rest::PagedEnumerable<::Google::Cloud::SecurityCenter::V1::BigQueryExport>] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/security_center/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::SecurityCenter::V1::SecurityCenter::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::SecurityCenter::V1::ListBigQueryExportsRequest.new + # + # # Call the list_big_query_exports method. + # result = client.list_big_query_exports request + # + # # The returned object is of type Gapic::PagedEnumerable. You can iterate + # # over elements, and API calls will be issued to fetch pages as needed. + # result.each do |item| + # # Each element is of type ::Google::Cloud::SecurityCenter::V1::BigQueryExport. + # p item + # end + # + def list_big_query_exports request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::SecurityCenter::V1::ListBigQueryExportsRequest + + # Converts hash 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_big_query_exports.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::SecurityCenter::V1::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + options.apply_defaults timeout: @config.rpcs.list_big_query_exports.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.list_big_query_exports.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @security_center_stub.list_big_query_exports request, options do |result, operation| + result = ::Gapic::Rest::PagedEnumerable.new @security_center_stub, :list_big_query_exports, "big_query_exports", request, result, options + yield result, operation if block_given? + throw :response, result + end + rescue ::Gapic::Rest::Error => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Creates a resident Event Threat Detection custom module at the scope of the + # given Resource Manager parent, and also creates inherited custom modules + # for all descendants of the given parent. These modules are enabled by + # default. + # + # @overload create_event_threat_detection_custom_module(request, options = nil) + # Pass arguments to `create_event_threat_detection_custom_module` via a request object, either of type + # {::Google::Cloud::SecurityCenter::V1::CreateEventThreatDetectionCustomModuleRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::SecurityCenter::V1::CreateEventThreatDetectionCustomModuleRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_event_threat_detection_custom_module(parent: nil, event_threat_detection_custom_module: nil) + # Pass arguments to `create_event_threat_detection_custom_module` via keyword arguments. Note that at + # least one keyword argument is 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 new custom module's parent. + # + # Its format is: + # + # * `organizations/{organization}/eventThreatDetectionSettings`. + # * `folders/{folder}/eventThreatDetectionSettings`. + # * `projects/{project}/eventThreatDetectionSettings`. + # @param event_threat_detection_custom_module [::Google::Cloud::SecurityCenter::V1::EventThreatDetectionCustomModule, ::Hash] + # Required. The module to create. The + # event_threat_detection_custom_module.name will be ignored and server + # generated. + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Cloud::SecurityCenter::V1::EventThreatDetectionCustomModule] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::SecurityCenter::V1::EventThreatDetectionCustomModule] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/security_center/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::SecurityCenter::V1::SecurityCenter::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::SecurityCenter::V1::CreateEventThreatDetectionCustomModuleRequest.new + # + # # Call the create_event_threat_detection_custom_module method. + # result = client.create_event_threat_detection_custom_module request + # + # # The returned object is of type Google::Cloud::SecurityCenter::V1::EventThreatDetectionCustomModule. + # p result + # + def create_event_threat_detection_custom_module request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::SecurityCenter::V1::CreateEventThreatDetectionCustomModuleRequest + + # Converts hash 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_event_threat_detection_custom_module.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::SecurityCenter::V1::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + options.apply_defaults timeout: @config.rpcs.create_event_threat_detection_custom_module.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.create_event_threat_detection_custom_module.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @security_center_stub.create_event_threat_detection_custom_module request, options do |result, operation| + yield result, operation if block_given? + end + rescue ::Gapic::Rest::Error => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Deletes the specified Event Threat Detection custom module and all of its + # descendants in the Resource Manager hierarchy. This method is only + # supported for resident custom modules. + # + # @overload delete_event_threat_detection_custom_module(request, options = nil) + # Pass arguments to `delete_event_threat_detection_custom_module` via a request object, either of type + # {::Google::Cloud::SecurityCenter::V1::DeleteEventThreatDetectionCustomModuleRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::SecurityCenter::V1::DeleteEventThreatDetectionCustomModuleRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_event_threat_detection_custom_module(name: nil) + # Pass arguments to `delete_event_threat_detection_custom_module` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param name [::String] + # Required. Name of the custom module to delete. + # + # Its format is: + # + # * `organizations/{organization}/eventThreatDetectionSettings/customModules/{module}`. + # * `folders/{folder}/eventThreatDetectionSettings/customModules/{module}`. + # * `projects/{project}/eventThreatDetectionSettings/customModules/{module}`. + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Protobuf::Empty] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Protobuf::Empty] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/security_center/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::SecurityCenter::V1::SecurityCenter::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::SecurityCenter::V1::DeleteEventThreatDetectionCustomModuleRequest.new + # + # # Call the delete_event_threat_detection_custom_module method. + # result = client.delete_event_threat_detection_custom_module request + # + # # The returned object is of type Google::Protobuf::Empty. + # p result + # + def delete_event_threat_detection_custom_module request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::SecurityCenter::V1::DeleteEventThreatDetectionCustomModuleRequest + + # Converts hash 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_event_threat_detection_custom_module.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::SecurityCenter::V1::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + options.apply_defaults timeout: @config.rpcs.delete_event_threat_detection_custom_module.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.delete_event_threat_detection_custom_module.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @security_center_stub.delete_event_threat_detection_custom_module request, options do |result, operation| + yield result, operation if block_given? + end + rescue ::Gapic::Rest::Error => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Gets an Event Threat Detection custom module. + # + # @overload get_event_threat_detection_custom_module(request, options = nil) + # Pass arguments to `get_event_threat_detection_custom_module` via a request object, either of type + # {::Google::Cloud::SecurityCenter::V1::GetEventThreatDetectionCustomModuleRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::SecurityCenter::V1::GetEventThreatDetectionCustomModuleRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_event_threat_detection_custom_module(name: nil) + # Pass arguments to `get_event_threat_detection_custom_module` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param name [::String] + # Required. Name of the custom module to get. + # + # Its format is: + # + # * `organizations/{organization}/eventThreatDetectionSettings/customModules/{module}`. + # * `folders/{folder}/eventThreatDetectionSettings/customModules/{module}`. + # * `projects/{project}/eventThreatDetectionSettings/customModules/{module}`. + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Cloud::SecurityCenter::V1::EventThreatDetectionCustomModule] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::SecurityCenter::V1::EventThreatDetectionCustomModule] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/security_center/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::SecurityCenter::V1::SecurityCenter::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::SecurityCenter::V1::GetEventThreatDetectionCustomModuleRequest.new + # + # # Call the get_event_threat_detection_custom_module method. + # result = client.get_event_threat_detection_custom_module request + # + # # The returned object is of type Google::Cloud::SecurityCenter::V1::EventThreatDetectionCustomModule. + # p result + # + def get_event_threat_detection_custom_module request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::SecurityCenter::V1::GetEventThreatDetectionCustomModuleRequest + + # Converts hash 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_event_threat_detection_custom_module.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::SecurityCenter::V1::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + options.apply_defaults timeout: @config.rpcs.get_event_threat_detection_custom_module.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.get_event_threat_detection_custom_module.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @security_center_stub.get_event_threat_detection_custom_module request, options do |result, operation| + yield result, operation if block_given? + end + rescue ::Gapic::Rest::Error => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Lists all resident Event Threat Detection custom modules under the + # given Resource Manager parent and its descendants. + # + # @overload list_descendant_event_threat_detection_custom_modules(request, options = nil) + # Pass arguments to `list_descendant_event_threat_detection_custom_modules` via a request object, either of type + # {::Google::Cloud::SecurityCenter::V1::ListDescendantEventThreatDetectionCustomModulesRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::SecurityCenter::V1::ListDescendantEventThreatDetectionCustomModulesRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_descendant_event_threat_detection_custom_modules(parent: nil, page_token: nil, page_size: nil) + # Pass arguments to `list_descendant_event_threat_detection_custom_modules` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param parent [::String] + # Required. Name of the parent to list custom modules under. + # + # Its format is: + # + # * `organizations/{organization}/eventThreatDetectionSettings`. + # * `folders/{folder}/eventThreatDetectionSettings`. + # * `projects/{project}/eventThreatDetectionSettings`. + # @param page_token [::String] + # A page token, received from a previous + # `ListDescendantEventThreatDetectionCustomModules` call. Provide this to + # retrieve the subsequent page. + # + # When paginating, all other parameters provided to + # `ListDescendantEventThreatDetectionCustomModules` must match the call that + # provided the page token. + # @param page_size [::Integer] + # The maximum number of modules to return. The service may return fewer than + # this value. + # If unspecified, at most 10 configs will be returned. + # The maximum value is 1000; values above 1000 will be coerced to 1000. + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Gapic::Rest::PagedEnumerable<::Google::Cloud::SecurityCenter::V1::EventThreatDetectionCustomModule>] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Gapic::Rest::PagedEnumerable<::Google::Cloud::SecurityCenter::V1::EventThreatDetectionCustomModule>] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/security_center/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::SecurityCenter::V1::SecurityCenter::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::SecurityCenter::V1::ListDescendantEventThreatDetectionCustomModulesRequest.new + # + # # Call the list_descendant_event_threat_detection_custom_modules method. + # result = client.list_descendant_event_threat_detection_custom_modules request + # + # # The returned object is of type Gapic::PagedEnumerable. You can iterate + # # over elements, and API calls will be issued to fetch pages as needed. + # result.each do |item| + # # Each element is of type ::Google::Cloud::SecurityCenter::V1::EventThreatDetectionCustomModule. + # p item + # end + # + def list_descendant_event_threat_detection_custom_modules request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::SecurityCenter::V1::ListDescendantEventThreatDetectionCustomModulesRequest + + # Converts hash 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_descendant_event_threat_detection_custom_modules.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::SecurityCenter::V1::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + options.apply_defaults timeout: @config.rpcs.list_descendant_event_threat_detection_custom_modules.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.list_descendant_event_threat_detection_custom_modules.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @security_center_stub.list_descendant_event_threat_detection_custom_modules request, options do |result, operation| + result = ::Gapic::Rest::PagedEnumerable.new @security_center_stub, :list_descendant_event_threat_detection_custom_modules, "event_threat_detection_custom_modules", 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 + + ## + # Lists all Event Threat Detection custom modules for the given + # Resource Manager parent. This includes resident modules defined at the + # scope of the parent along with modules inherited from ancestors. + # + # @overload list_event_threat_detection_custom_modules(request, options = nil) + # Pass arguments to `list_event_threat_detection_custom_modules` via a request object, either of type + # {::Google::Cloud::SecurityCenter::V1::ListEventThreatDetectionCustomModulesRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::SecurityCenter::V1::ListEventThreatDetectionCustomModulesRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_event_threat_detection_custom_modules(parent: nil, page_token: nil, page_size: nil) + # Pass arguments to `list_event_threat_detection_custom_modules` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param parent [::String] + # Required. Name of the parent to list custom modules under. + # + # Its format is: + # + # * `organizations/{organization}/eventThreatDetectionSettings`. + # * `folders/{folder}/eventThreatDetectionSettings`. + # * `projects/{project}/eventThreatDetectionSettings`. + # @param page_token [::String] + # A page token, received from a previous + # `ListEventThreatDetectionCustomModules` call. Provide this to retrieve the + # subsequent page. + # + # When paginating, all other parameters provided to + # `ListEventThreatDetectionCustomModules` must match the call that provided + # the page token. + # @param page_size [::Integer] + # The maximum number of modules to return. The service may return fewer than + # this value. + # If unspecified, at most 10 configs will be returned. + # The maximum value is 1000; values above 1000 will be coerced to 1000. + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Gapic::Rest::PagedEnumerable<::Google::Cloud::SecurityCenter::V1::EventThreatDetectionCustomModule>] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Gapic::Rest::PagedEnumerable<::Google::Cloud::SecurityCenter::V1::EventThreatDetectionCustomModule>] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/security_center/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::SecurityCenter::V1::SecurityCenter::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::SecurityCenter::V1::ListEventThreatDetectionCustomModulesRequest.new + # + # # Call the list_event_threat_detection_custom_modules method. + # result = client.list_event_threat_detection_custom_modules request + # + # # The returned object is of type Gapic::PagedEnumerable. You can iterate + # # over elements, and API calls will be issued to fetch pages as needed. + # result.each do |item| + # # Each element is of type ::Google::Cloud::SecurityCenter::V1::EventThreatDetectionCustomModule. + # p item + # end + # + def list_event_threat_detection_custom_modules request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::SecurityCenter::V1::ListEventThreatDetectionCustomModulesRequest + + # Converts hash 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_event_threat_detection_custom_modules.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::SecurityCenter::V1::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + options.apply_defaults timeout: @config.rpcs.list_event_threat_detection_custom_modules.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.list_event_threat_detection_custom_modules.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @security_center_stub.list_event_threat_detection_custom_modules request, options do |result, operation| + result = ::Gapic::Rest::PagedEnumerable.new @security_center_stub, :list_event_threat_detection_custom_modules, "event_threat_detection_custom_modules", 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 + + ## + # Updates the Event Threat Detection custom module with the given name based + # on the given update mask. Updating the enablement state is supported for + # both resident and inherited modules (though resident modules cannot have an + # enablement state of "inherited"). Updating the display name or + # configuration of a module is supported for resident modules only. The type + # of a module cannot be changed. + # + # @overload update_event_threat_detection_custom_module(request, options = nil) + # Pass arguments to `update_event_threat_detection_custom_module` via a request object, either of type + # {::Google::Cloud::SecurityCenter::V1::UpdateEventThreatDetectionCustomModuleRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::SecurityCenter::V1::UpdateEventThreatDetectionCustomModuleRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_event_threat_detection_custom_module(event_threat_detection_custom_module: nil, update_mask: nil) + # Pass arguments to `update_event_threat_detection_custom_module` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param event_threat_detection_custom_module [::Google::Cloud::SecurityCenter::V1::EventThreatDetectionCustomModule, ::Hash] + # Required. The module being updated. + # @param update_mask [::Google::Protobuf::FieldMask, ::Hash] + # The list of fields to be updated. + # If empty all mutable fields will be updated. + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Cloud::SecurityCenter::V1::EventThreatDetectionCustomModule] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::SecurityCenter::V1::EventThreatDetectionCustomModule] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/security_center/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::SecurityCenter::V1::SecurityCenter::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::SecurityCenter::V1::UpdateEventThreatDetectionCustomModuleRequest.new + # + # # Call the update_event_threat_detection_custom_module method. + # result = client.update_event_threat_detection_custom_module request + # + # # The returned object is of type Google::Cloud::SecurityCenter::V1::EventThreatDetectionCustomModule. + # p result + # + def update_event_threat_detection_custom_module request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::SecurityCenter::V1::UpdateEventThreatDetectionCustomModuleRequest + + # Converts hash 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_event_threat_detection_custom_module.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::SecurityCenter::V1::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + options.apply_defaults timeout: @config.rpcs.update_event_threat_detection_custom_module.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.update_event_threat_detection_custom_module.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @security_center_stub.update_event_threat_detection_custom_module 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 + + ## + # Validates the given Event Threat Detection custom module. + # + # @overload validate_event_threat_detection_custom_module(request, options = nil) + # Pass arguments to `validate_event_threat_detection_custom_module` via a request object, either of type + # {::Google::Cloud::SecurityCenter::V1::ValidateEventThreatDetectionCustomModuleRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::SecurityCenter::V1::ValidateEventThreatDetectionCustomModuleRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @overload validate_event_threat_detection_custom_module(parent: nil, raw_text: nil, type: nil) + # Pass arguments to `validate_event_threat_detection_custom_module` via keyword arguments. Note that at + # least one keyword argument is 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. Resource name of the parent to validate the Custom Module under. + # + # Its format is: + # + # * `organizations/{organization}/eventThreatDetectionSettings`. + # * `folders/{folder}/eventThreatDetectionSettings`. + # * `projects/{project}/eventThreatDetectionSettings`. + # @param raw_text [::String] + # Required. The raw text of the module's contents. Used to generate error + # messages. + # @param type [::String] + # Required. The type of the module (e.g. CONFIGURABLE_BAD_IP). + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Cloud::SecurityCenter::V1::ValidateEventThreatDetectionCustomModuleResponse] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::SecurityCenter::V1::ValidateEventThreatDetectionCustomModuleResponse] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/security_center/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::SecurityCenter::V1::SecurityCenter::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::SecurityCenter::V1::ValidateEventThreatDetectionCustomModuleRequest.new + # + # # Call the validate_event_threat_detection_custom_module method. + # result = client.validate_event_threat_detection_custom_module request + # + # # The returned object is of type Google::Cloud::SecurityCenter::V1::ValidateEventThreatDetectionCustomModuleResponse. + # p result + # + def validate_event_threat_detection_custom_module request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::SecurityCenter::V1::ValidateEventThreatDetectionCustomModuleRequest + + # Converts hash 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.validate_event_threat_detection_custom_module.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::SecurityCenter::V1::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + options.apply_defaults timeout: @config.rpcs.validate_event_threat_detection_custom_module.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.validate_event_threat_detection_custom_module.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @security_center_stub.validate_event_threat_detection_custom_module request, options do |result, operation| + yield result, operation if block_given? + end + rescue ::Gapic::Rest::Error => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Gets an effective Event Threat Detection custom module at the given level. + # + # @overload get_effective_event_threat_detection_custom_module(request, options = nil) + # Pass arguments to `get_effective_event_threat_detection_custom_module` via a request object, either of type + # {::Google::Cloud::SecurityCenter::V1::GetEffectiveEventThreatDetectionCustomModuleRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::SecurityCenter::V1::GetEffectiveEventThreatDetectionCustomModuleRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_effective_event_threat_detection_custom_module(name: nil) + # Pass arguments to `get_effective_event_threat_detection_custom_module` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param name [::String] + # Required. The resource name of the effective Event Threat Detection custom + # module. + # + # Its format is: + # + # * `organizations/{organization}/eventThreatDetectionSettings/effectiveCustomModules/{module}`. + # * `folders/{folder}/eventThreatDetectionSettings/effectiveCustomModules/{module}`. + # * `projects/{project}/eventThreatDetectionSettings/effectiveCustomModules/{module}`. + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Cloud::SecurityCenter::V1::EffectiveEventThreatDetectionCustomModule] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::SecurityCenter::V1::EffectiveEventThreatDetectionCustomModule] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/security_center/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::SecurityCenter::V1::SecurityCenter::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::SecurityCenter::V1::GetEffectiveEventThreatDetectionCustomModuleRequest.new + # + # # Call the get_effective_event_threat_detection_custom_module method. + # result = client.get_effective_event_threat_detection_custom_module request + # + # # The returned object is of type Google::Cloud::SecurityCenter::V1::EffectiveEventThreatDetectionCustomModule. + # p result + # + def get_effective_event_threat_detection_custom_module request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::SecurityCenter::V1::GetEffectiveEventThreatDetectionCustomModuleRequest + + # Converts hash 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_effective_event_threat_detection_custom_module.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::SecurityCenter::V1::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + options.apply_defaults timeout: @config.rpcs.get_effective_event_threat_detection_custom_module.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.get_effective_event_threat_detection_custom_module.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @security_center_stub.get_effective_event_threat_detection_custom_module request, options do |result, operation| + yield result, operation if block_given? + end + rescue ::Gapic::Rest::Error => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Lists all effective Event Threat Detection custom modules for the + # given parent. This includes resident modules defined at the scope of the + # parent along with modules inherited from its ancestors. + # + # @overload list_effective_event_threat_detection_custom_modules(request, options = nil) + # Pass arguments to `list_effective_event_threat_detection_custom_modules` via a request object, either of type + # {::Google::Cloud::SecurityCenter::V1::ListEffectiveEventThreatDetectionCustomModulesRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::SecurityCenter::V1::ListEffectiveEventThreatDetectionCustomModulesRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_effective_event_threat_detection_custom_modules(parent: nil, page_token: nil, page_size: nil) + # Pass arguments to `list_effective_event_threat_detection_custom_modules` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param parent [::String] + # Required. Name of the parent to list custom modules for. + # + # Its format is: + # + # * `organizations/{organization}/eventThreatDetectionSettings`. + # * `folders/{folder}/eventThreatDetectionSettings`. + # * `projects/{project}/eventThreatDetectionSettings`. + # @param page_token [::String] + # A page token, received from a previous + # `ListEffectiveEventThreatDetectionCustomModules` call. Provide this to + # retrieve the subsequent page. + # + # When paginating, all other parameters provided to + # `ListEffectiveEventThreatDetectionCustomModules` must match the call that + # provided the page token. + # @param page_size [::Integer] + # The maximum number of modules to return. The service may return fewer than + # this value. + # If unspecified, at most 10 configs will be returned. + # The maximum value is 1000; values above 1000 will be coerced to 1000. + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Gapic::Rest::PagedEnumerable<::Google::Cloud::SecurityCenter::V1::EffectiveEventThreatDetectionCustomModule>] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Gapic::Rest::PagedEnumerable<::Google::Cloud::SecurityCenter::V1::EffectiveEventThreatDetectionCustomModule>] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/security_center/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::SecurityCenter::V1::SecurityCenter::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::SecurityCenter::V1::ListEffectiveEventThreatDetectionCustomModulesRequest.new + # + # # Call the list_effective_event_threat_detection_custom_modules method. + # result = client.list_effective_event_threat_detection_custom_modules request + # + # # The returned object is of type Gapic::PagedEnumerable. You can iterate + # # over elements, and API calls will be issued to fetch pages as needed. + # result.each do |item| + # # Each element is of type ::Google::Cloud::SecurityCenter::V1::EffectiveEventThreatDetectionCustomModule. + # p item + # end + # + def list_effective_event_threat_detection_custom_modules request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::SecurityCenter::V1::ListEffectiveEventThreatDetectionCustomModulesRequest + + # Converts hash 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_effective_event_threat_detection_custom_modules.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::SecurityCenter::V1::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + options.apply_defaults timeout: @config.rpcs.list_effective_event_threat_detection_custom_modules.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.list_effective_event_threat_detection_custom_modules.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @security_center_stub.list_effective_event_threat_detection_custom_modules request, options do |result, operation| + result = ::Gapic::Rest::PagedEnumerable.new @security_center_stub, :list_effective_event_threat_detection_custom_modules, "effective_event_threat_detection_custom_modules", request, result, options + yield result, operation if block_given? + throw :response, result + end + rescue ::Gapic::Rest::Error => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Creates a ResourceValueConfig for an organization. Maps user's tags to + # difference resource values for use by the attack path simulation. + # + # @overload batch_create_resource_value_configs(request, options = nil) + # Pass arguments to `batch_create_resource_value_configs` via a request object, either of type + # {::Google::Cloud::SecurityCenter::V1::BatchCreateResourceValueConfigsRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::SecurityCenter::V1::BatchCreateResourceValueConfigsRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @overload batch_create_resource_value_configs(parent: nil, requests: nil) + # Pass arguments to `batch_create_resource_value_configs` via keyword arguments. Note that at + # least one keyword argument is 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. Resource name of the new ResourceValueConfig's parent. + # The parent field in the CreateResourceValueConfigRequest + # messages must either be empty or match this field. + # @param requests [::Array<::Google::Cloud::SecurityCenter::V1::CreateResourceValueConfigRequest, ::Hash>] + # Required. The resource value configs to be created. + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Cloud::SecurityCenter::V1::BatchCreateResourceValueConfigsResponse] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::SecurityCenter::V1::BatchCreateResourceValueConfigsResponse] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/security_center/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::SecurityCenter::V1::SecurityCenter::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::SecurityCenter::V1::BatchCreateResourceValueConfigsRequest.new + # + # # Call the batch_create_resource_value_configs method. + # result = client.batch_create_resource_value_configs request + # + # # The returned object is of type Google::Cloud::SecurityCenter::V1::BatchCreateResourceValueConfigsResponse. + # p result + # + def batch_create_resource_value_configs request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::SecurityCenter::V1::BatchCreateResourceValueConfigsRequest + + # Converts hash 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.batch_create_resource_value_configs.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::SecurityCenter::V1::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + options.apply_defaults timeout: @config.rpcs.batch_create_resource_value_configs.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.batch_create_resource_value_configs.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @security_center_stub.batch_create_resource_value_configs request, options do |result, operation| + yield result, operation if block_given? + end + rescue ::Gapic::Rest::Error => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Deletes a ResourceValueConfig. + # + # @overload delete_resource_value_config(request, options = nil) + # Pass arguments to `delete_resource_value_config` via a request object, either of type + # {::Google::Cloud::SecurityCenter::V1::DeleteResourceValueConfigRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::SecurityCenter::V1::DeleteResourceValueConfigRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_resource_value_config(name: nil) + # Pass arguments to `delete_resource_value_config` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param name [::String] + # Required. Name of the ResourceValueConfig to delete + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Protobuf::Empty] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Protobuf::Empty] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/security_center/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::SecurityCenter::V1::SecurityCenter::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::SecurityCenter::V1::DeleteResourceValueConfigRequest.new + # + # # Call the delete_resource_value_config method. + # result = client.delete_resource_value_config request + # + # # The returned object is of type Google::Protobuf::Empty. + # p result + # + def delete_resource_value_config request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::SecurityCenter::V1::DeleteResourceValueConfigRequest + + # Converts hash 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_resource_value_config.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::SecurityCenter::V1::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + options.apply_defaults timeout: @config.rpcs.delete_resource_value_config.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.delete_resource_value_config.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @security_center_stub.delete_resource_value_config request, options do |result, operation| + yield result, operation if block_given? + end + rescue ::Gapic::Rest::Error => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Gets a ResourceValueConfig. + # + # @overload get_resource_value_config(request, options = nil) + # Pass arguments to `get_resource_value_config` via a request object, either of type + # {::Google::Cloud::SecurityCenter::V1::GetResourceValueConfigRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::SecurityCenter::V1::GetResourceValueConfigRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_resource_value_config(name: nil) + # Pass arguments to `get_resource_value_config` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param name [::String] + # Required. Name of the resource value config to retrieve. Its format is + # `organizations/{organization}/resourceValueConfigs/{config_id}`. + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Cloud::SecurityCenter::V1::ResourceValueConfig] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::SecurityCenter::V1::ResourceValueConfig] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/security_center/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::SecurityCenter::V1::SecurityCenter::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::SecurityCenter::V1::GetResourceValueConfigRequest.new + # + # # Call the get_resource_value_config method. + # result = client.get_resource_value_config request + # + # # The returned object is of type Google::Cloud::SecurityCenter::V1::ResourceValueConfig. + # p result + # + def get_resource_value_config request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::SecurityCenter::V1::GetResourceValueConfigRequest + + # Converts hash 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_resource_value_config.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::SecurityCenter::V1::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + options.apply_defaults timeout: @config.rpcs.get_resource_value_config.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.get_resource_value_config.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @security_center_stub.get_resource_value_config request, options do |result, operation| + yield result, operation if block_given? + end + rescue ::Gapic::Rest::Error => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Lists all ResourceValueConfigs. + # + # @overload list_resource_value_configs(request, options = nil) + # Pass arguments to `list_resource_value_configs` via a request object, either of type + # {::Google::Cloud::SecurityCenter::V1::ListResourceValueConfigsRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::SecurityCenter::V1::ListResourceValueConfigsRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_resource_value_configs(parent: nil, page_size: nil, page_token: nil) + # Pass arguments to `list_resource_value_configs` via keyword arguments. Note that at + # least one keyword argument is 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, which owns the collection of resource value configs. + # Its format is + # `organizations/[organization_id]` + # @param page_size [::Integer] + # The number of results to return. The service may return fewer than + # this value. + # If unspecified, at most 10 configs will be returned. + # The maximum value is 1000; values above 1000 will be coerced to 1000. + # @param page_token [::String] + # A page token, received from a previous `ListResourceValueConfigs` call. + # Provide this to retrieve the subsequent page. + # + # When paginating, all other parameters provided to + # `ListResourceValueConfigs` must match the call that provided the + # page token. + # + # page_size can be specified, and the new page_size will be used. + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Gapic::Rest::PagedEnumerable<::Google::Cloud::SecurityCenter::V1::ResourceValueConfig>] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Gapic::Rest::PagedEnumerable<::Google::Cloud::SecurityCenter::V1::ResourceValueConfig>] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/security_center/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::SecurityCenter::V1::SecurityCenter::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::SecurityCenter::V1::ListResourceValueConfigsRequest.new + # + # # Call the list_resource_value_configs method. + # result = client.list_resource_value_configs request + # + # # The returned object is of type Gapic::PagedEnumerable. You can iterate + # # over elements, and API calls will be issued to fetch pages as needed. + # result.each do |item| + # # Each element is of type ::Google::Cloud::SecurityCenter::V1::ResourceValueConfig. + # p item + # end + # + def list_resource_value_configs request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::SecurityCenter::V1::ListResourceValueConfigsRequest + + # Converts hash 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_resource_value_configs.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::SecurityCenter::V1::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + options.apply_defaults timeout: @config.rpcs.list_resource_value_configs.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.list_resource_value_configs.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @security_center_stub.list_resource_value_configs request, options do |result, operation| + result = ::Gapic::Rest::PagedEnumerable.new @security_center_stub, :list_resource_value_configs, "resource_value_configs", 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 + + ## + # Updates an existing ResourceValueConfigs with new rules. + # + # @overload update_resource_value_config(request, options = nil) + # Pass arguments to `update_resource_value_config` via a request object, either of type + # {::Google::Cloud::SecurityCenter::V1::UpdateResourceValueConfigRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::SecurityCenter::V1::UpdateResourceValueConfigRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_resource_value_config(resource_value_config: nil, update_mask: nil) + # Pass arguments to `update_resource_value_config` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param resource_value_config [::Google::Cloud::SecurityCenter::V1::ResourceValueConfig, ::Hash] + # Required. The resource value config being updated. + # @param update_mask [::Google::Protobuf::FieldMask, ::Hash] + # The list of fields to be updated. + # If empty all mutable fields will be updated. + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Cloud::SecurityCenter::V1::ResourceValueConfig] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::SecurityCenter::V1::ResourceValueConfig] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/security_center/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::SecurityCenter::V1::SecurityCenter::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::SecurityCenter::V1::UpdateResourceValueConfigRequest.new + # + # # Call the update_resource_value_config method. + # result = client.update_resource_value_config request + # + # # The returned object is of type Google::Cloud::SecurityCenter::V1::ResourceValueConfig. + # p result + # + def update_resource_value_config request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::SecurityCenter::V1::UpdateResourceValueConfigRequest + + # Converts hash 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_resource_value_config.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::SecurityCenter::V1::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + options.apply_defaults timeout: @config.rpcs.update_resource_value_config.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.update_resource_value_config.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @security_center_stub.update_resource_value_config request, options do |result, operation| + yield result, operation if block_given? + end + rescue ::Gapic::Rest::Error => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Lists the valued resources for a set of simulation results and filter. + # + # @overload list_valued_resources(request, options = nil) + # Pass arguments to `list_valued_resources` via a request object, either of type + # {::Google::Cloud::SecurityCenter::V1::ListValuedResourcesRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::SecurityCenter::V1::ListValuedResourcesRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_valued_resources(parent: nil, filter: nil, page_token: nil, page_size: nil, order_by: nil) + # Pass arguments to `list_valued_resources` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param parent [::String] + # Required. Name of parent to list valued resources. + # + # Valid formats: + # `organizations/{organization}`, + # `organizations/{organization}/simulations/{simulation}` + # `organizations/{organization}/simulations/{simulation}/attackExposureResults/{attack_exposure_result_v2}` + # @param filter [::String] + # The filter expression that filters the valued resources in the response. + # Supported fields: + # + # * `resource_value` supports = + # * `resource_type` supports = + # @param page_token [::String] + # The value returned by the last `ListValuedResourcesResponse`; indicates + # that this is a continuation of a prior `ListValuedResources` call, and + # that the system should return the next page of data. + # @param page_size [::Integer] + # The maximum number of results to return in a single response. Default is + # 10, minimum is 1, maximum is 1000. + # @param order_by [::String] + # Optional. The fields by which to order the valued resources response. + # + # Supported fields: + # + # * `exposed_score` + # + # * `resource_value` + # + # * `resource_type` + # + # * `resource` + # + # * `display_name` + # + # Values should be a comma separated list of fields. For example: + # `exposed_score,resource_value`. + # + # The default sorting order is descending. To specify ascending or descending + # order for a field, append a ` ASC` or a ` DESC` suffix, respectively; for + # example: `exposed_score DESC`. + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Gapic::Rest::PagedEnumerable<::Google::Cloud::SecurityCenter::V1::ValuedResource>] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Gapic::Rest::PagedEnumerable<::Google::Cloud::SecurityCenter::V1::ValuedResource>] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/security_center/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::SecurityCenter::V1::SecurityCenter::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::SecurityCenter::V1::ListValuedResourcesRequest.new + # + # # Call the list_valued_resources method. + # result = client.list_valued_resources request + # + # # The returned object is of type Gapic::PagedEnumerable. You can iterate + # # over elements, and API calls will be issued to fetch pages as needed. + # result.each do |item| + # # Each element is of type ::Google::Cloud::SecurityCenter::V1::ValuedResource. + # p item + # end + # + def list_valued_resources request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::SecurityCenter::V1::ListValuedResourcesRequest + + # Converts hash 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_valued_resources.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::SecurityCenter::V1::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + options.apply_defaults timeout: @config.rpcs.list_valued_resources.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.list_valued_resources.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @security_center_stub.list_valued_resources request, options do |result, operation| + result = ::Gapic::Rest::PagedEnumerable.new @security_center_stub, :list_valued_resources, "valued_resources", 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 + + ## + # Lists the attack paths for a set of simulation results or valued resources + # and filter. + # + # @overload list_attack_paths(request, options = nil) + # Pass arguments to `list_attack_paths` via a request object, either of type + # {::Google::Cloud::SecurityCenter::V1::ListAttackPathsRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::SecurityCenter::V1::ListAttackPathsRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_attack_paths(parent: nil, filter: nil, page_token: nil, page_size: nil) + # Pass arguments to `list_attack_paths` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param parent [::String] + # Required. Name of parent to list attack paths. + # + # Valid formats: + # `organizations/{organization}`, + # `organizations/{organization}/simulations/{simulation}` + # `organizations/{organization}/simulations/{simulation}/attackExposureResults/{attack_exposure_result_v2}` + # `organizations/{organization}/simulations/{simulation}/valuedResources/{valued_resource}` + # @param filter [::String] + # The filter expression that filters the attack path in the response. + # Supported fields: + # + # * `valued_resources` supports = + # @param page_token [::String] + # The value returned by the last `ListAttackPathsResponse`; indicates + # that this is a continuation of a prior `ListAttackPaths` call, and + # that the system should return the next page of data. + # @param page_size [::Integer] + # The maximum number of results to return in a single response. Default is + # 10, minimum is 1, maximum is 1000. + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Gapic::Rest::PagedEnumerable<::Google::Cloud::SecurityCenter::V1::AttackPath>] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Gapic::Rest::PagedEnumerable<::Google::Cloud::SecurityCenter::V1::AttackPath>] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/security_center/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::SecurityCenter::V1::SecurityCenter::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::SecurityCenter::V1::ListAttackPathsRequest.new + # + # # Call the list_attack_paths method. + # result = client.list_attack_paths request + # + # # The returned object is of type Gapic::PagedEnumerable. You can iterate + # # over elements, and API calls will be issued to fetch pages as needed. + # result.each do |item| + # # Each element is of type ::Google::Cloud::SecurityCenter::V1::AttackPath. + # p item + # end + # + def list_attack_paths request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::SecurityCenter::V1::ListAttackPathsRequest + + # Converts hash 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_attack_paths.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::SecurityCenter::V1::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + options.apply_defaults timeout: @config.rpcs.list_attack_paths.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.list_attack_paths.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @security_center_stub.list_attack_paths request, options do |result, operation| + result = ::Gapic::Rest::PagedEnumerable.new @security_center_stub, :list_attack_paths, "attack_paths", 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 SecurityCenter REST API. + # + # This class represents the configuration for SecurityCenter REST, + # providing control over timeouts, retry behavior, logging, transport + # parameters, and other low-level controls. Certain parameters can also be + # applied individually to specific RPCs. See + # {::Google::Cloud::SecurityCenter::V1::SecurityCenter::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 + # # bulk_mute_findings to 20 seconds, + # # and all remaining timeouts to 10 seconds. + # ::Google::Cloud::SecurityCenter::V1::SecurityCenter::Rest::Client.configure do |config| + # config.timeout = 10.0 + # config.rpcs.bulk_mute_findings.timeout = 20.0 + # end + # + # # Apply the above configuration only to a new client. + # client = ::Google::Cloud::SecurityCenter::V1::SecurityCenter::Rest::Client.new do |config| + # config.timeout = 10.0 + # config.rpcs.bulk_mute_findings.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 = "securitycenter.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 SecurityCenter 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 `bulk_mute_findings` + # @return [::Gapic::Config::Method] + # + attr_reader :bulk_mute_findings + ## + # RPC-specific configuration for `create_security_health_analytics_custom_module` + # @return [::Gapic::Config::Method] + # + attr_reader :create_security_health_analytics_custom_module + ## + # RPC-specific configuration for `create_source` + # @return [::Gapic::Config::Method] + # + attr_reader :create_source + ## + # RPC-specific configuration for `create_finding` + # @return [::Gapic::Config::Method] + # + attr_reader :create_finding + ## + # RPC-specific configuration for `create_mute_config` + # @return [::Gapic::Config::Method] + # + attr_reader :create_mute_config + ## + # RPC-specific configuration for `create_notification_config` + # @return [::Gapic::Config::Method] + # + attr_reader :create_notification_config + ## + # RPC-specific configuration for `delete_mute_config` + # @return [::Gapic::Config::Method] + # + attr_reader :delete_mute_config + ## + # RPC-specific configuration for `delete_notification_config` + # @return [::Gapic::Config::Method] + # + attr_reader :delete_notification_config + ## + # RPC-specific configuration for `delete_security_health_analytics_custom_module` + # @return [::Gapic::Config::Method] + # + attr_reader :delete_security_health_analytics_custom_module + ## + # RPC-specific configuration for `get_simulation` + # @return [::Gapic::Config::Method] + # + attr_reader :get_simulation + ## + # RPC-specific configuration for `get_valued_resource` + # @return [::Gapic::Config::Method] + # + attr_reader :get_valued_resource + ## + # RPC-specific configuration for `get_big_query_export` + # @return [::Gapic::Config::Method] + # + attr_reader :get_big_query_export + ## + # RPC-specific configuration for `get_iam_policy` + # @return [::Gapic::Config::Method] + # + attr_reader :get_iam_policy + ## + # RPC-specific configuration for `get_mute_config` + # @return [::Gapic::Config::Method] + # + attr_reader :get_mute_config + ## + # RPC-specific configuration for `get_notification_config` + # @return [::Gapic::Config::Method] + # + attr_reader :get_notification_config + ## + # RPC-specific configuration for `get_organization_settings` + # @return [::Gapic::Config::Method] + # + attr_reader :get_organization_settings + ## + # RPC-specific configuration for `get_effective_security_health_analytics_custom_module` + # @return [::Gapic::Config::Method] + # + attr_reader :get_effective_security_health_analytics_custom_module + ## + # RPC-specific configuration for `get_security_health_analytics_custom_module` + # @return [::Gapic::Config::Method] + # + attr_reader :get_security_health_analytics_custom_module + ## + # RPC-specific configuration for `get_source` + # @return [::Gapic::Config::Method] + # + attr_reader :get_source + ## + # RPC-specific configuration for `group_assets` + # @return [::Gapic::Config::Method] + # + attr_reader :group_assets + ## + # RPC-specific configuration for `group_findings` + # @return [::Gapic::Config::Method] + # + attr_reader :group_findings + ## + # RPC-specific configuration for `list_assets` + # @return [::Gapic::Config::Method] + # + attr_reader :list_assets + ## + # RPC-specific configuration for `list_descendant_security_health_analytics_custom_modules` + # @return [::Gapic::Config::Method] + # + attr_reader :list_descendant_security_health_analytics_custom_modules + ## + # RPC-specific configuration for `list_findings` + # @return [::Gapic::Config::Method] + # + attr_reader :list_findings + ## + # RPC-specific configuration for `list_mute_configs` + # @return [::Gapic::Config::Method] + # + attr_reader :list_mute_configs + ## + # RPC-specific configuration for `list_notification_configs` + # @return [::Gapic::Config::Method] + # + attr_reader :list_notification_configs + ## + # RPC-specific configuration for `list_effective_security_health_analytics_custom_modules` + # @return [::Gapic::Config::Method] + # + attr_reader :list_effective_security_health_analytics_custom_modules + ## + # RPC-specific configuration for `list_security_health_analytics_custom_modules` + # @return [::Gapic::Config::Method] + # + attr_reader :list_security_health_analytics_custom_modules + ## + # RPC-specific configuration for `list_sources` + # @return [::Gapic::Config::Method] + # + attr_reader :list_sources + ## + # RPC-specific configuration for `run_asset_discovery` + # @return [::Gapic::Config::Method] + # + attr_reader :run_asset_discovery + ## + # RPC-specific configuration for `set_finding_state` + # @return [::Gapic::Config::Method] + # + attr_reader :set_finding_state + ## + # RPC-specific configuration for `set_mute` + # @return [::Gapic::Config::Method] + # + attr_reader :set_mute + ## + # RPC-specific configuration for `set_iam_policy` + # @return [::Gapic::Config::Method] + # + attr_reader :set_iam_policy + ## + # RPC-specific configuration for `test_iam_permissions` + # @return [::Gapic::Config::Method] + # + attr_reader :test_iam_permissions + ## + # RPC-specific configuration for `simulate_security_health_analytics_custom_module` + # @return [::Gapic::Config::Method] + # + attr_reader :simulate_security_health_analytics_custom_module + ## + # RPC-specific configuration for `update_external_system` + # @return [::Gapic::Config::Method] + # + attr_reader :update_external_system + ## + # RPC-specific configuration for `update_finding` + # @return [::Gapic::Config::Method] + # + attr_reader :update_finding + ## + # RPC-specific configuration for `update_mute_config` + # @return [::Gapic::Config::Method] + # + attr_reader :update_mute_config + ## + # RPC-specific configuration for `update_notification_config` + # @return [::Gapic::Config::Method] + # + attr_reader :update_notification_config + ## + # RPC-specific configuration for `update_organization_settings` + # @return [::Gapic::Config::Method] + # + attr_reader :update_organization_settings + ## + # RPC-specific configuration for `update_security_health_analytics_custom_module` + # @return [::Gapic::Config::Method] + # + attr_reader :update_security_health_analytics_custom_module + ## + # RPC-specific configuration for `update_source` + # @return [::Gapic::Config::Method] + # + attr_reader :update_source + ## + # RPC-specific configuration for `update_security_marks` + # @return [::Gapic::Config::Method] + # + attr_reader :update_security_marks + ## + # RPC-specific configuration for `create_big_query_export` + # @return [::Gapic::Config::Method] + # + attr_reader :create_big_query_export + ## + # RPC-specific configuration for `delete_big_query_export` + # @return [::Gapic::Config::Method] + # + attr_reader :delete_big_query_export + ## + # RPC-specific configuration for `update_big_query_export` + # @return [::Gapic::Config::Method] + # + attr_reader :update_big_query_export + ## + # RPC-specific configuration for `list_big_query_exports` + # @return [::Gapic::Config::Method] + # + attr_reader :list_big_query_exports + ## + # RPC-specific configuration for `create_event_threat_detection_custom_module` + # @return [::Gapic::Config::Method] + # + attr_reader :create_event_threat_detection_custom_module + ## + # RPC-specific configuration for `delete_event_threat_detection_custom_module` + # @return [::Gapic::Config::Method] + # + attr_reader :delete_event_threat_detection_custom_module + ## + # RPC-specific configuration for `get_event_threat_detection_custom_module` + # @return [::Gapic::Config::Method] + # + attr_reader :get_event_threat_detection_custom_module + ## + # RPC-specific configuration for `list_descendant_event_threat_detection_custom_modules` + # @return [::Gapic::Config::Method] + # + attr_reader :list_descendant_event_threat_detection_custom_modules + ## + # RPC-specific configuration for `list_event_threat_detection_custom_modules` + # @return [::Gapic::Config::Method] + # + attr_reader :list_event_threat_detection_custom_modules + ## + # RPC-specific configuration for `update_event_threat_detection_custom_module` + # @return [::Gapic::Config::Method] + # + attr_reader :update_event_threat_detection_custom_module + ## + # RPC-specific configuration for `validate_event_threat_detection_custom_module` + # @return [::Gapic::Config::Method] + # + attr_reader :validate_event_threat_detection_custom_module + ## + # RPC-specific configuration for `get_effective_event_threat_detection_custom_module` + # @return [::Gapic::Config::Method] + # + attr_reader :get_effective_event_threat_detection_custom_module + ## + # RPC-specific configuration for `list_effective_event_threat_detection_custom_modules` + # @return [::Gapic::Config::Method] + # + attr_reader :list_effective_event_threat_detection_custom_modules + ## + # RPC-specific configuration for `batch_create_resource_value_configs` + # @return [::Gapic::Config::Method] + # + attr_reader :batch_create_resource_value_configs + ## + # RPC-specific configuration for `delete_resource_value_config` + # @return [::Gapic::Config::Method] + # + attr_reader :delete_resource_value_config + ## + # RPC-specific configuration for `get_resource_value_config` + # @return [::Gapic::Config::Method] + # + attr_reader :get_resource_value_config + ## + # RPC-specific configuration for `list_resource_value_configs` + # @return [::Gapic::Config::Method] + # + attr_reader :list_resource_value_configs + ## + # RPC-specific configuration for `update_resource_value_config` + # @return [::Gapic::Config::Method] + # + attr_reader :update_resource_value_config + ## + # RPC-specific configuration for `list_valued_resources` + # @return [::Gapic::Config::Method] + # + attr_reader :list_valued_resources + ## + # RPC-specific configuration for `list_attack_paths` + # @return [::Gapic::Config::Method] + # + attr_reader :list_attack_paths + + # @private + def initialize parent_rpcs = nil + bulk_mute_findings_config = parent_rpcs.bulk_mute_findings if parent_rpcs.respond_to? :bulk_mute_findings + @bulk_mute_findings = ::Gapic::Config::Method.new bulk_mute_findings_config + create_security_health_analytics_custom_module_config = parent_rpcs.create_security_health_analytics_custom_module if parent_rpcs.respond_to? :create_security_health_analytics_custom_module + @create_security_health_analytics_custom_module = ::Gapic::Config::Method.new create_security_health_analytics_custom_module_config + create_source_config = parent_rpcs.create_source if parent_rpcs.respond_to? :create_source + @create_source = ::Gapic::Config::Method.new create_source_config + create_finding_config = parent_rpcs.create_finding if parent_rpcs.respond_to? :create_finding + @create_finding = ::Gapic::Config::Method.new create_finding_config + create_mute_config_config = parent_rpcs.create_mute_config if parent_rpcs.respond_to? :create_mute_config + @create_mute_config = ::Gapic::Config::Method.new create_mute_config_config + create_notification_config_config = parent_rpcs.create_notification_config if parent_rpcs.respond_to? :create_notification_config + @create_notification_config = ::Gapic::Config::Method.new create_notification_config_config + delete_mute_config_config = parent_rpcs.delete_mute_config if parent_rpcs.respond_to? :delete_mute_config + @delete_mute_config = ::Gapic::Config::Method.new delete_mute_config_config + delete_notification_config_config = parent_rpcs.delete_notification_config if parent_rpcs.respond_to? :delete_notification_config + @delete_notification_config = ::Gapic::Config::Method.new delete_notification_config_config + delete_security_health_analytics_custom_module_config = parent_rpcs.delete_security_health_analytics_custom_module if parent_rpcs.respond_to? :delete_security_health_analytics_custom_module + @delete_security_health_analytics_custom_module = ::Gapic::Config::Method.new delete_security_health_analytics_custom_module_config + get_simulation_config = parent_rpcs.get_simulation if parent_rpcs.respond_to? :get_simulation + @get_simulation = ::Gapic::Config::Method.new get_simulation_config + get_valued_resource_config = parent_rpcs.get_valued_resource if parent_rpcs.respond_to? :get_valued_resource + @get_valued_resource = ::Gapic::Config::Method.new get_valued_resource_config + get_big_query_export_config = parent_rpcs.get_big_query_export if parent_rpcs.respond_to? :get_big_query_export + @get_big_query_export = ::Gapic::Config::Method.new get_big_query_export_config + get_iam_policy_config = parent_rpcs.get_iam_policy if parent_rpcs.respond_to? :get_iam_policy + @get_iam_policy = ::Gapic::Config::Method.new get_iam_policy_config + get_mute_config_config = parent_rpcs.get_mute_config if parent_rpcs.respond_to? :get_mute_config + @get_mute_config = ::Gapic::Config::Method.new get_mute_config_config + get_notification_config_config = parent_rpcs.get_notification_config if parent_rpcs.respond_to? :get_notification_config + @get_notification_config = ::Gapic::Config::Method.new get_notification_config_config + get_organization_settings_config = parent_rpcs.get_organization_settings if parent_rpcs.respond_to? :get_organization_settings + @get_organization_settings = ::Gapic::Config::Method.new get_organization_settings_config + get_effective_security_health_analytics_custom_module_config = parent_rpcs.get_effective_security_health_analytics_custom_module if parent_rpcs.respond_to? :get_effective_security_health_analytics_custom_module + @get_effective_security_health_analytics_custom_module = ::Gapic::Config::Method.new get_effective_security_health_analytics_custom_module_config + get_security_health_analytics_custom_module_config = parent_rpcs.get_security_health_analytics_custom_module if parent_rpcs.respond_to? :get_security_health_analytics_custom_module + @get_security_health_analytics_custom_module = ::Gapic::Config::Method.new get_security_health_analytics_custom_module_config + get_source_config = parent_rpcs.get_source if parent_rpcs.respond_to? :get_source + @get_source = ::Gapic::Config::Method.new get_source_config + group_assets_config = parent_rpcs.group_assets if parent_rpcs.respond_to? :group_assets + @group_assets = ::Gapic::Config::Method.new group_assets_config + group_findings_config = parent_rpcs.group_findings if parent_rpcs.respond_to? :group_findings + @group_findings = ::Gapic::Config::Method.new group_findings_config + list_assets_config = parent_rpcs.list_assets if parent_rpcs.respond_to? :list_assets + @list_assets = ::Gapic::Config::Method.new list_assets_config + list_descendant_security_health_analytics_custom_modules_config = parent_rpcs.list_descendant_security_health_analytics_custom_modules if parent_rpcs.respond_to? :list_descendant_security_health_analytics_custom_modules + @list_descendant_security_health_analytics_custom_modules = ::Gapic::Config::Method.new list_descendant_security_health_analytics_custom_modules_config + list_findings_config = parent_rpcs.list_findings if parent_rpcs.respond_to? :list_findings + @list_findings = ::Gapic::Config::Method.new list_findings_config + list_mute_configs_config = parent_rpcs.list_mute_configs if parent_rpcs.respond_to? :list_mute_configs + @list_mute_configs = ::Gapic::Config::Method.new list_mute_configs_config + list_notification_configs_config = parent_rpcs.list_notification_configs if parent_rpcs.respond_to? :list_notification_configs + @list_notification_configs = ::Gapic::Config::Method.new list_notification_configs_config + list_effective_security_health_analytics_custom_modules_config = parent_rpcs.list_effective_security_health_analytics_custom_modules if parent_rpcs.respond_to? :list_effective_security_health_analytics_custom_modules + @list_effective_security_health_analytics_custom_modules = ::Gapic::Config::Method.new list_effective_security_health_analytics_custom_modules_config + list_security_health_analytics_custom_modules_config = parent_rpcs.list_security_health_analytics_custom_modules if parent_rpcs.respond_to? :list_security_health_analytics_custom_modules + @list_security_health_analytics_custom_modules = ::Gapic::Config::Method.new list_security_health_analytics_custom_modules_config + list_sources_config = parent_rpcs.list_sources if parent_rpcs.respond_to? :list_sources + @list_sources = ::Gapic::Config::Method.new list_sources_config + run_asset_discovery_config = parent_rpcs.run_asset_discovery if parent_rpcs.respond_to? :run_asset_discovery + @run_asset_discovery = ::Gapic::Config::Method.new run_asset_discovery_config + set_finding_state_config = parent_rpcs.set_finding_state if parent_rpcs.respond_to? :set_finding_state + @set_finding_state = ::Gapic::Config::Method.new set_finding_state_config + set_mute_config = parent_rpcs.set_mute if parent_rpcs.respond_to? :set_mute + @set_mute = ::Gapic::Config::Method.new set_mute_config + set_iam_policy_config = parent_rpcs.set_iam_policy if parent_rpcs.respond_to? :set_iam_policy + @set_iam_policy = ::Gapic::Config::Method.new set_iam_policy_config + test_iam_permissions_config = parent_rpcs.test_iam_permissions if parent_rpcs.respond_to? :test_iam_permissions + @test_iam_permissions = ::Gapic::Config::Method.new test_iam_permissions_config + simulate_security_health_analytics_custom_module_config = parent_rpcs.simulate_security_health_analytics_custom_module if parent_rpcs.respond_to? :simulate_security_health_analytics_custom_module + @simulate_security_health_analytics_custom_module = ::Gapic::Config::Method.new simulate_security_health_analytics_custom_module_config + update_external_system_config = parent_rpcs.update_external_system if parent_rpcs.respond_to? :update_external_system + @update_external_system = ::Gapic::Config::Method.new update_external_system_config + update_finding_config = parent_rpcs.update_finding if parent_rpcs.respond_to? :update_finding + @update_finding = ::Gapic::Config::Method.new update_finding_config + update_mute_config_config = parent_rpcs.update_mute_config if parent_rpcs.respond_to? :update_mute_config + @update_mute_config = ::Gapic::Config::Method.new update_mute_config_config + update_notification_config_config = parent_rpcs.update_notification_config if parent_rpcs.respond_to? :update_notification_config + @update_notification_config = ::Gapic::Config::Method.new update_notification_config_config + update_organization_settings_config = parent_rpcs.update_organization_settings if parent_rpcs.respond_to? :update_organization_settings + @update_organization_settings = ::Gapic::Config::Method.new update_organization_settings_config + update_security_health_analytics_custom_module_config = parent_rpcs.update_security_health_analytics_custom_module if parent_rpcs.respond_to? :update_security_health_analytics_custom_module + @update_security_health_analytics_custom_module = ::Gapic::Config::Method.new update_security_health_analytics_custom_module_config + update_source_config = parent_rpcs.update_source if parent_rpcs.respond_to? :update_source + @update_source = ::Gapic::Config::Method.new update_source_config + update_security_marks_config = parent_rpcs.update_security_marks if parent_rpcs.respond_to? :update_security_marks + @update_security_marks = ::Gapic::Config::Method.new update_security_marks_config + create_big_query_export_config = parent_rpcs.create_big_query_export if parent_rpcs.respond_to? :create_big_query_export + @create_big_query_export = ::Gapic::Config::Method.new create_big_query_export_config + delete_big_query_export_config = parent_rpcs.delete_big_query_export if parent_rpcs.respond_to? :delete_big_query_export + @delete_big_query_export = ::Gapic::Config::Method.new delete_big_query_export_config + update_big_query_export_config = parent_rpcs.update_big_query_export if parent_rpcs.respond_to? :update_big_query_export + @update_big_query_export = ::Gapic::Config::Method.new update_big_query_export_config + list_big_query_exports_config = parent_rpcs.list_big_query_exports if parent_rpcs.respond_to? :list_big_query_exports + @list_big_query_exports = ::Gapic::Config::Method.new list_big_query_exports_config + create_event_threat_detection_custom_module_config = parent_rpcs.create_event_threat_detection_custom_module if parent_rpcs.respond_to? :create_event_threat_detection_custom_module + @create_event_threat_detection_custom_module = ::Gapic::Config::Method.new create_event_threat_detection_custom_module_config + delete_event_threat_detection_custom_module_config = parent_rpcs.delete_event_threat_detection_custom_module if parent_rpcs.respond_to? :delete_event_threat_detection_custom_module + @delete_event_threat_detection_custom_module = ::Gapic::Config::Method.new delete_event_threat_detection_custom_module_config + get_event_threat_detection_custom_module_config = parent_rpcs.get_event_threat_detection_custom_module if parent_rpcs.respond_to? :get_event_threat_detection_custom_module + @get_event_threat_detection_custom_module = ::Gapic::Config::Method.new get_event_threat_detection_custom_module_config + list_descendant_event_threat_detection_custom_modules_config = parent_rpcs.list_descendant_event_threat_detection_custom_modules if parent_rpcs.respond_to? :list_descendant_event_threat_detection_custom_modules + @list_descendant_event_threat_detection_custom_modules = ::Gapic::Config::Method.new list_descendant_event_threat_detection_custom_modules_config + list_event_threat_detection_custom_modules_config = parent_rpcs.list_event_threat_detection_custom_modules if parent_rpcs.respond_to? :list_event_threat_detection_custom_modules + @list_event_threat_detection_custom_modules = ::Gapic::Config::Method.new list_event_threat_detection_custom_modules_config + update_event_threat_detection_custom_module_config = parent_rpcs.update_event_threat_detection_custom_module if parent_rpcs.respond_to? :update_event_threat_detection_custom_module + @update_event_threat_detection_custom_module = ::Gapic::Config::Method.new update_event_threat_detection_custom_module_config + validate_event_threat_detection_custom_module_config = parent_rpcs.validate_event_threat_detection_custom_module if parent_rpcs.respond_to? :validate_event_threat_detection_custom_module + @validate_event_threat_detection_custom_module = ::Gapic::Config::Method.new validate_event_threat_detection_custom_module_config + get_effective_event_threat_detection_custom_module_config = parent_rpcs.get_effective_event_threat_detection_custom_module if parent_rpcs.respond_to? :get_effective_event_threat_detection_custom_module + @get_effective_event_threat_detection_custom_module = ::Gapic::Config::Method.new get_effective_event_threat_detection_custom_module_config + list_effective_event_threat_detection_custom_modules_config = parent_rpcs.list_effective_event_threat_detection_custom_modules if parent_rpcs.respond_to? :list_effective_event_threat_detection_custom_modules + @list_effective_event_threat_detection_custom_modules = ::Gapic::Config::Method.new list_effective_event_threat_detection_custom_modules_config + batch_create_resource_value_configs_config = parent_rpcs.batch_create_resource_value_configs if parent_rpcs.respond_to? :batch_create_resource_value_configs + @batch_create_resource_value_configs = ::Gapic::Config::Method.new batch_create_resource_value_configs_config + delete_resource_value_config_config = parent_rpcs.delete_resource_value_config if parent_rpcs.respond_to? :delete_resource_value_config + @delete_resource_value_config = ::Gapic::Config::Method.new delete_resource_value_config_config + get_resource_value_config_config = parent_rpcs.get_resource_value_config if parent_rpcs.respond_to? :get_resource_value_config + @get_resource_value_config = ::Gapic::Config::Method.new get_resource_value_config_config + list_resource_value_configs_config = parent_rpcs.list_resource_value_configs if parent_rpcs.respond_to? :list_resource_value_configs + @list_resource_value_configs = ::Gapic::Config::Method.new list_resource_value_configs_config + update_resource_value_config_config = parent_rpcs.update_resource_value_config if parent_rpcs.respond_to? :update_resource_value_config + @update_resource_value_config = ::Gapic::Config::Method.new update_resource_value_config_config + list_valued_resources_config = parent_rpcs.list_valued_resources if parent_rpcs.respond_to? :list_valued_resources + @list_valued_resources = ::Gapic::Config::Method.new list_valued_resources_config + list_attack_paths_config = parent_rpcs.list_attack_paths if parent_rpcs.respond_to? :list_attack_paths + @list_attack_paths = ::Gapic::Config::Method.new list_attack_paths_config + + yield self if block_given? + end + end + end + end + end + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-security_center-v1/lib/google/cloud/security_center/v1/security_center/rest/operations.rb b/owl-bot-staging/google-cloud-security_center-v1/lib/google/cloud/security_center/v1/security_center/rest/operations.rb new file mode 100644 index 000000000000..800790c23351 --- /dev/null +++ b/owl-bot-staging/google-cloud-security_center-v1/lib/google/cloud/security_center/v1/security_center/rest/operations.rb @@ -0,0 +1,924 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +require "gapic/operation" + +module Google + module Cloud + module SecurityCenter + module V1 + module SecurityCenter + module Rest + # Service that implements Longrunning Operations API. + class Operations + # @private + API_VERSION = "" + + # @private + DEFAULT_ENDPOINT_TEMPLATE = "securitycenter.$UNIVERSE_DOMAIN$" + + # @private + attr_reader :operations_stub + + ## + # Configuration for the SecurityCenter 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 SecurityCenter 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::SecurityCenter::V1::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + options.apply_defaults timeout: @config.rpcs.list_operations.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.list_operations.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @operations_stub.list_operations request, options do |result, operation| + result = ::Gapic::Rest::PagedEnumerable.new @operations_stub, :list_operations, "operations", request, result, options + yield result, operation if block_given? + 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::SecurityCenter::V1::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + options.apply_defaults timeout: @config.rpcs.get_operation.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.get_operation.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @operations_stub.get_operation request, options do |result, operation| + result = ::Gapic::Operation.new result, @operations_client, options: options + yield result, operation if block_given? + 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::SecurityCenter::V1::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + options.apply_defaults timeout: @config.rpcs.delete_operation.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.delete_operation.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @operations_stub.delete_operation request, options do |result, operation| + yield result, operation if block_given? + 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::SecurityCenter::V1::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + options.apply_defaults timeout: @config.rpcs.cancel_operation.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.cancel_operation.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @operations_stub.cancel_operation request, options do |result, operation| + yield result, operation if block_given? + 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 = "securitycenter.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{^organizations/[^/]+/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: "/v1/{name}", + matches: [ + ["name", %r{^organizations/[^/]+/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{^organizations/[^/]+/operations/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the cancel_operation REST call + # + # @param request_pb [::Google::Longrunning::CancelOperationRequest] + # A request object representing the call parameters. Required. + # @return [Array(String, [String, nil], Hash{String => String})] + # Uri, Body, Query string parameters + def self.transcode_cancel_operation_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:cancel", + matches: [ + ["name", %r{^organizations/[^/]+/operations/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + end + end + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-security_center-v1/lib/google/cloud/security_center/v1/security_center/rest/service_stub.rb b/owl-bot-staging/google-cloud-security_center-v1/lib/google/cloud/security_center/v1/security_center/rest/service_stub.rb new file mode 100644 index 000000000000..6b84754bb951 --- /dev/null +++ b/owl-bot-staging/google-cloud-security_center-v1/lib/google/cloud/security_center/v1/security_center/rest/service_stub.rb @@ -0,0 +1,4766 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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/securitycenter/v1/securitycenter_service_pb" + +module Google + module Cloud + module SecurityCenter + module V1 + module SecurityCenter + module Rest + ## + # REST service stub for the SecurityCenter 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 bulk_mute_findings REST call + # + # @param request_pb [::Google::Cloud::SecurityCenter::V1::BulkMuteFindingsRequest] + # 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 bulk_mute_findings request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_bulk_mute_findings_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: "bulk_mute_findings", + 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 create_security_health_analytics_custom_module REST call + # + # @param request_pb [::Google::Cloud::SecurityCenter::V1::CreateSecurityHealthAnalyticsCustomModuleRequest] + # A request object representing the call parameters. Required. + # @param options [::Gapic::CallOptions] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Cloud::SecurityCenter::V1::SecurityHealthAnalyticsCustomModule] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::SecurityCenter::V1::SecurityHealthAnalyticsCustomModule] + # A result object deserialized from the server's reply + def create_security_health_analytics_custom_module request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_create_security_health_analytics_custom_module_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_security_health_analytics_custom_module", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Cloud::SecurityCenter::V1::SecurityHealthAnalyticsCustomModule.decode_json response.body, ignore_unknown_fields: true + catch :response do + yield result, operation if block_given? + result + end + end + + ## + # Baseline implementation for the create_source REST call + # + # @param request_pb [::Google::Cloud::SecurityCenter::V1::CreateSourceRequest] + # A request object representing the call parameters. Required. + # @param options [::Gapic::CallOptions] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Cloud::SecurityCenter::V1::Source] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::SecurityCenter::V1::Source] + # A result object deserialized from the server's reply + def create_source request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_create_source_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_source", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Cloud::SecurityCenter::V1::Source.decode_json response.body, ignore_unknown_fields: true + catch :response do + yield result, operation if block_given? + result + end + end + + ## + # Baseline implementation for the create_finding REST call + # + # @param request_pb [::Google::Cloud::SecurityCenter::V1::CreateFindingRequest] + # A request object representing the call parameters. Required. + # @param options [::Gapic::CallOptions] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Cloud::SecurityCenter::V1::Finding] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::SecurityCenter::V1::Finding] + # A result object deserialized from the server's reply + def create_finding request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_create_finding_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_finding", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Cloud::SecurityCenter::V1::Finding.decode_json response.body, ignore_unknown_fields: true + catch :response do + yield result, operation if block_given? + result + end + end + + ## + # Baseline implementation for the create_mute_config REST call + # + # @param request_pb [::Google::Cloud::SecurityCenter::V1::CreateMuteConfigRequest] + # A request object representing the call parameters. Required. + # @param options [::Gapic::CallOptions] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Cloud::SecurityCenter::V1::MuteConfig] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::SecurityCenter::V1::MuteConfig] + # A result object deserialized from the server's reply + def create_mute_config request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_create_mute_config_request request_pb + query_string_params = if query_string_params.any? + query_string_params.to_h { |p| p.split "=", 2 } + else + {} + end + + response = @client_stub.make_http_request( + verb, + uri: uri, + body: body || "", + params: query_string_params, + method_name: "create_mute_config", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Cloud::SecurityCenter::V1::MuteConfig.decode_json response.body, ignore_unknown_fields: true + catch :response do + yield result, operation if block_given? + result + end + end + + ## + # Baseline implementation for the create_notification_config REST call + # + # @param request_pb [::Google::Cloud::SecurityCenter::V1::CreateNotificationConfigRequest] + # A request object representing the call parameters. Required. + # @param options [::Gapic::CallOptions] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Cloud::SecurityCenter::V1::NotificationConfig] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::SecurityCenter::V1::NotificationConfig] + # A result object deserialized from the server's reply + def create_notification_config request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_create_notification_config_request request_pb + query_string_params = if query_string_params.any? + query_string_params.to_h { |p| p.split "=", 2 } + else + {} + end + + response = @client_stub.make_http_request( + verb, + uri: uri, + body: body || "", + params: query_string_params, + method_name: "create_notification_config", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Cloud::SecurityCenter::V1::NotificationConfig.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_mute_config REST call + # + # @param request_pb [::Google::Cloud::SecurityCenter::V1::DeleteMuteConfigRequest] + # 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_mute_config request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_delete_mute_config_request request_pb + query_string_params = if query_string_params.any? + query_string_params.to_h { |p| p.split "=", 2 } + else + {} + end + + response = @client_stub.make_http_request( + verb, + uri: uri, + body: body || "", + params: query_string_params, + method_name: "delete_mute_config", + 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 delete_notification_config REST call + # + # @param request_pb [::Google::Cloud::SecurityCenter::V1::DeleteNotificationConfigRequest] + # 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_notification_config request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_delete_notification_config_request request_pb + query_string_params = if query_string_params.any? + query_string_params.to_h { |p| p.split "=", 2 } + else + {} + end + + response = @client_stub.make_http_request( + verb, + uri: uri, + body: body || "", + params: query_string_params, + method_name: "delete_notification_config", + 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 delete_security_health_analytics_custom_module REST call + # + # @param request_pb [::Google::Cloud::SecurityCenter::V1::DeleteSecurityHealthAnalyticsCustomModuleRequest] + # 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_security_health_analytics_custom_module request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_delete_security_health_analytics_custom_module_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_security_health_analytics_custom_module", + 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 get_simulation REST call + # + # @param request_pb [::Google::Cloud::SecurityCenter::V1::GetSimulationRequest] + # A request object representing the call parameters. Required. + # @param options [::Gapic::CallOptions] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Cloud::SecurityCenter::V1::Simulation] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::SecurityCenter::V1::Simulation] + # A result object deserialized from the server's reply + def get_simulation request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_get_simulation_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_simulation", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Cloud::SecurityCenter::V1::Simulation.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_valued_resource REST call + # + # @param request_pb [::Google::Cloud::SecurityCenter::V1::GetValuedResourceRequest] + # A request object representing the call parameters. Required. + # @param options [::Gapic::CallOptions] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Cloud::SecurityCenter::V1::ValuedResource] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::SecurityCenter::V1::ValuedResource] + # A result object deserialized from the server's reply + def get_valued_resource request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_get_valued_resource_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_valued_resource", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Cloud::SecurityCenter::V1::ValuedResource.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_big_query_export REST call + # + # @param request_pb [::Google::Cloud::SecurityCenter::V1::GetBigQueryExportRequest] + # A request object representing the call parameters. Required. + # @param options [::Gapic::CallOptions] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Cloud::SecurityCenter::V1::BigQueryExport] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::SecurityCenter::V1::BigQueryExport] + # A result object deserialized from the server's reply + def get_big_query_export request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_get_big_query_export_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_big_query_export", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Cloud::SecurityCenter::V1::BigQueryExport.decode_json response.body, ignore_unknown_fields: true + catch :response do + yield result, operation if block_given? + result + end + end + + ## + # Baseline implementation for the get_iam_policy REST call + # + # @param request_pb [::Google::Iam::V1::GetIamPolicyRequest] + # A request object representing the call parameters. Required. + # @param options [::Gapic::CallOptions] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Iam::V1::Policy] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Iam::V1::Policy] + # A result object deserialized from the server's reply + def get_iam_policy request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_get_iam_policy_request request_pb + query_string_params = if query_string_params.any? + query_string_params.to_h { |p| p.split "=", 2 } + else + {} + end + + response = @client_stub.make_http_request( + verb, + uri: uri, + body: body || "", + params: query_string_params, + method_name: "get_iam_policy", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Iam::V1::Policy.decode_json response.body, ignore_unknown_fields: true + catch :response do + yield result, operation if block_given? + result + end + end + + ## + # Baseline implementation for the get_mute_config REST call + # + # @param request_pb [::Google::Cloud::SecurityCenter::V1::GetMuteConfigRequest] + # A request object representing the call parameters. Required. + # @param options [::Gapic::CallOptions] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Cloud::SecurityCenter::V1::MuteConfig] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::SecurityCenter::V1::MuteConfig] + # A result object deserialized from the server's reply + def get_mute_config request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_get_mute_config_request request_pb + query_string_params = if query_string_params.any? + query_string_params.to_h { |p| p.split "=", 2 } + else + {} + end + + response = @client_stub.make_http_request( + verb, + uri: uri, + body: body || "", + params: query_string_params, + method_name: "get_mute_config", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Cloud::SecurityCenter::V1::MuteConfig.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_notification_config REST call + # + # @param request_pb [::Google::Cloud::SecurityCenter::V1::GetNotificationConfigRequest] + # A request object representing the call parameters. Required. + # @param options [::Gapic::CallOptions] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Cloud::SecurityCenter::V1::NotificationConfig] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::SecurityCenter::V1::NotificationConfig] + # A result object deserialized from the server's reply + def get_notification_config request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_get_notification_config_request request_pb + query_string_params = if query_string_params.any? + query_string_params.to_h { |p| p.split "=", 2 } + else + {} + end + + response = @client_stub.make_http_request( + verb, + uri: uri, + body: body || "", + params: query_string_params, + method_name: "get_notification_config", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Cloud::SecurityCenter::V1::NotificationConfig.decode_json response.body, ignore_unknown_fields: true + catch :response do + yield result, operation if block_given? + result + end + end + + ## + # Baseline implementation for the get_organization_settings REST call + # + # @param request_pb [::Google::Cloud::SecurityCenter::V1::GetOrganizationSettingsRequest] + # A request object representing the call parameters. Required. + # @param options [::Gapic::CallOptions] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Cloud::SecurityCenter::V1::OrganizationSettings] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::SecurityCenter::V1::OrganizationSettings] + # A result object deserialized from the server's reply + def get_organization_settings request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_get_organization_settings_request request_pb + query_string_params = if query_string_params.any? + query_string_params.to_h { |p| p.split "=", 2 } + else + {} + end + + response = @client_stub.make_http_request( + verb, + uri: uri, + body: body || "", + params: query_string_params, + method_name: "get_organization_settings", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Cloud::SecurityCenter::V1::OrganizationSettings.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_effective_security_health_analytics_custom_module REST call + # + # @param request_pb [::Google::Cloud::SecurityCenter::V1::GetEffectiveSecurityHealthAnalyticsCustomModuleRequest] + # A request object representing the call parameters. Required. + # @param options [::Gapic::CallOptions] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Cloud::SecurityCenter::V1::EffectiveSecurityHealthAnalyticsCustomModule] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::SecurityCenter::V1::EffectiveSecurityHealthAnalyticsCustomModule] + # A result object deserialized from the server's reply + def get_effective_security_health_analytics_custom_module request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_get_effective_security_health_analytics_custom_module_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_effective_security_health_analytics_custom_module", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Cloud::SecurityCenter::V1::EffectiveSecurityHealthAnalyticsCustomModule.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_security_health_analytics_custom_module REST call + # + # @param request_pb [::Google::Cloud::SecurityCenter::V1::GetSecurityHealthAnalyticsCustomModuleRequest] + # A request object representing the call parameters. Required. + # @param options [::Gapic::CallOptions] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Cloud::SecurityCenter::V1::SecurityHealthAnalyticsCustomModule] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::SecurityCenter::V1::SecurityHealthAnalyticsCustomModule] + # A result object deserialized from the server's reply + def get_security_health_analytics_custom_module request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_get_security_health_analytics_custom_module_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_security_health_analytics_custom_module", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Cloud::SecurityCenter::V1::SecurityHealthAnalyticsCustomModule.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_source REST call + # + # @param request_pb [::Google::Cloud::SecurityCenter::V1::GetSourceRequest] + # A request object representing the call parameters. Required. + # @param options [::Gapic::CallOptions] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Cloud::SecurityCenter::V1::Source] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::SecurityCenter::V1::Source] + # A result object deserialized from the server's reply + def get_source request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_get_source_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_source", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Cloud::SecurityCenter::V1::Source.decode_json response.body, ignore_unknown_fields: true + catch :response do + yield result, operation if block_given? + result + end + end + + ## + # Baseline implementation for the group_assets REST call + # + # @param request_pb [::Google::Cloud::SecurityCenter::V1::GroupAssetsRequest] + # A request object representing the call parameters. Required. + # @param options [::Gapic::CallOptions] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Cloud::SecurityCenter::V1::GroupAssetsResponse] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::SecurityCenter::V1::GroupAssetsResponse] + # A result object deserialized from the server's reply + def group_assets request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_group_assets_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: "group_assets", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Cloud::SecurityCenter::V1::GroupAssetsResponse.decode_json response.body, ignore_unknown_fields: true + catch :response do + yield result, operation if block_given? + result + end + end + + ## + # Baseline implementation for the group_findings REST call + # + # @param request_pb [::Google::Cloud::SecurityCenter::V1::GroupFindingsRequest] + # A request object representing the call parameters. Required. + # @param options [::Gapic::CallOptions] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Cloud::SecurityCenter::V1::GroupFindingsResponse] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::SecurityCenter::V1::GroupFindingsResponse] + # A result object deserialized from the server's reply + def group_findings request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_group_findings_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: "group_findings", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Cloud::SecurityCenter::V1::GroupFindingsResponse.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_assets REST call + # + # @param request_pb [::Google::Cloud::SecurityCenter::V1::ListAssetsRequest] + # A request object representing the call parameters. Required. + # @param options [::Gapic::CallOptions] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Cloud::SecurityCenter::V1::ListAssetsResponse] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::SecurityCenter::V1::ListAssetsResponse] + # A result object deserialized from the server's reply + def list_assets request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_list_assets_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_assets", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Cloud::SecurityCenter::V1::ListAssetsResponse.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_descendant_security_health_analytics_custom_modules REST call + # + # @param request_pb [::Google::Cloud::SecurityCenter::V1::ListDescendantSecurityHealthAnalyticsCustomModulesRequest] + # A request object representing the call parameters. Required. + # @param options [::Gapic::CallOptions] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Cloud::SecurityCenter::V1::ListDescendantSecurityHealthAnalyticsCustomModulesResponse] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::SecurityCenter::V1::ListDescendantSecurityHealthAnalyticsCustomModulesResponse] + # A result object deserialized from the server's reply + def list_descendant_security_health_analytics_custom_modules request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_list_descendant_security_health_analytics_custom_modules_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_descendant_security_health_analytics_custom_modules", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Cloud::SecurityCenter::V1::ListDescendantSecurityHealthAnalyticsCustomModulesResponse.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_findings REST call + # + # @param request_pb [::Google::Cloud::SecurityCenter::V1::ListFindingsRequest] + # A request object representing the call parameters. Required. + # @param options [::Gapic::CallOptions] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Cloud::SecurityCenter::V1::ListFindingsResponse] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::SecurityCenter::V1::ListFindingsResponse] + # A result object deserialized from the server's reply + def list_findings request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_list_findings_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_findings", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Cloud::SecurityCenter::V1::ListFindingsResponse.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_mute_configs REST call + # + # @param request_pb [::Google::Cloud::SecurityCenter::V1::ListMuteConfigsRequest] + # A request object representing the call parameters. Required. + # @param options [::Gapic::CallOptions] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Cloud::SecurityCenter::V1::ListMuteConfigsResponse] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::SecurityCenter::V1::ListMuteConfigsResponse] + # A result object deserialized from the server's reply + def list_mute_configs request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_list_mute_configs_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_mute_configs", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Cloud::SecurityCenter::V1::ListMuteConfigsResponse.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_notification_configs REST call + # + # @param request_pb [::Google::Cloud::SecurityCenter::V1::ListNotificationConfigsRequest] + # A request object representing the call parameters. Required. + # @param options [::Gapic::CallOptions] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Cloud::SecurityCenter::V1::ListNotificationConfigsResponse] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::SecurityCenter::V1::ListNotificationConfigsResponse] + # A result object deserialized from the server's reply + def list_notification_configs request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_list_notification_configs_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_notification_configs", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Cloud::SecurityCenter::V1::ListNotificationConfigsResponse.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_effective_security_health_analytics_custom_modules REST call + # + # @param request_pb [::Google::Cloud::SecurityCenter::V1::ListEffectiveSecurityHealthAnalyticsCustomModulesRequest] + # A request object representing the call parameters. Required. + # @param options [::Gapic::CallOptions] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Cloud::SecurityCenter::V1::ListEffectiveSecurityHealthAnalyticsCustomModulesResponse] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::SecurityCenter::V1::ListEffectiveSecurityHealthAnalyticsCustomModulesResponse] + # A result object deserialized from the server's reply + def list_effective_security_health_analytics_custom_modules request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_list_effective_security_health_analytics_custom_modules_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_effective_security_health_analytics_custom_modules", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Cloud::SecurityCenter::V1::ListEffectiveSecurityHealthAnalyticsCustomModulesResponse.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_security_health_analytics_custom_modules REST call + # + # @param request_pb [::Google::Cloud::SecurityCenter::V1::ListSecurityHealthAnalyticsCustomModulesRequest] + # A request object representing the call parameters. Required. + # @param options [::Gapic::CallOptions] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Cloud::SecurityCenter::V1::ListSecurityHealthAnalyticsCustomModulesResponse] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::SecurityCenter::V1::ListSecurityHealthAnalyticsCustomModulesResponse] + # A result object deserialized from the server's reply + def list_security_health_analytics_custom_modules request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_list_security_health_analytics_custom_modules_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_security_health_analytics_custom_modules", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Cloud::SecurityCenter::V1::ListSecurityHealthAnalyticsCustomModulesResponse.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_sources REST call + # + # @param request_pb [::Google::Cloud::SecurityCenter::V1::ListSourcesRequest] + # A request object representing the call parameters. Required. + # @param options [::Gapic::CallOptions] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Cloud::SecurityCenter::V1::ListSourcesResponse] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::SecurityCenter::V1::ListSourcesResponse] + # A result object deserialized from the server's reply + def list_sources request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_list_sources_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_sources", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Cloud::SecurityCenter::V1::ListSourcesResponse.decode_json response.body, ignore_unknown_fields: true + catch :response do + yield result, operation if block_given? + result + end + end + + ## + # Baseline implementation for the run_asset_discovery REST call + # + # @param request_pb [::Google::Cloud::SecurityCenter::V1::RunAssetDiscoveryRequest] + # 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 run_asset_discovery request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_run_asset_discovery_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: "run_asset_discovery", + 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 set_finding_state REST call + # + # @param request_pb [::Google::Cloud::SecurityCenter::V1::SetFindingStateRequest] + # A request object representing the call parameters. Required. + # @param options [::Gapic::CallOptions] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Cloud::SecurityCenter::V1::Finding] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::SecurityCenter::V1::Finding] + # A result object deserialized from the server's reply + def set_finding_state request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_set_finding_state_request request_pb + query_string_params = if query_string_params.any? + query_string_params.to_h { |p| p.split "=", 2 } + else + {} + end + + response = @client_stub.make_http_request( + verb, + uri: uri, + body: body || "", + params: query_string_params, + method_name: "set_finding_state", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Cloud::SecurityCenter::V1::Finding.decode_json response.body, ignore_unknown_fields: true + catch :response do + yield result, operation if block_given? + result + end + end + + ## + # Baseline implementation for the set_mute REST call + # + # @param request_pb [::Google::Cloud::SecurityCenter::V1::SetMuteRequest] + # A request object representing the call parameters. Required. + # @param options [::Gapic::CallOptions] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Cloud::SecurityCenter::V1::Finding] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::SecurityCenter::V1::Finding] + # A result object deserialized from the server's reply + def set_mute request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_set_mute_request request_pb + query_string_params = if query_string_params.any? + query_string_params.to_h { |p| p.split "=", 2 } + else + {} + end + + response = @client_stub.make_http_request( + verb, + uri: uri, + body: body || "", + params: query_string_params, + method_name: "set_mute", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Cloud::SecurityCenter::V1::Finding.decode_json response.body, ignore_unknown_fields: true + catch :response do + yield result, operation if block_given? + result + end + end + + ## + # Baseline implementation for the set_iam_policy REST call + # + # @param request_pb [::Google::Iam::V1::SetIamPolicyRequest] + # A request object representing the call parameters. Required. + # @param options [::Gapic::CallOptions] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Iam::V1::Policy] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Iam::V1::Policy] + # A result object deserialized from the server's reply + def set_iam_policy request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_set_iam_policy_request request_pb + query_string_params = if query_string_params.any? + query_string_params.to_h { |p| p.split "=", 2 } + else + {} + end + + response = @client_stub.make_http_request( + verb, + uri: uri, + body: body || "", + params: query_string_params, + method_name: "set_iam_policy", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Iam::V1::Policy.decode_json response.body, ignore_unknown_fields: true + catch :response do + yield result, operation if block_given? + result + end + end + + ## + # Baseline implementation for the test_iam_permissions REST call + # + # @param request_pb [::Google::Iam::V1::TestIamPermissionsRequest] + # A request object representing the call parameters. Required. + # @param options [::Gapic::CallOptions] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Iam::V1::TestIamPermissionsResponse] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Iam::V1::TestIamPermissionsResponse] + # A result object deserialized from the server's reply + def test_iam_permissions request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_test_iam_permissions_request request_pb + query_string_params = if query_string_params.any? + query_string_params.to_h { |p| p.split "=", 2 } + else + {} + end + + response = @client_stub.make_http_request( + verb, + uri: uri, + body: body || "", + params: query_string_params, + method_name: "test_iam_permissions", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Iam::V1::TestIamPermissionsResponse.decode_json response.body, ignore_unknown_fields: true + catch :response do + yield result, operation if block_given? + result + end + end + + ## + # Baseline implementation for the simulate_security_health_analytics_custom_module REST call + # + # @param request_pb [::Google::Cloud::SecurityCenter::V1::SimulateSecurityHealthAnalyticsCustomModuleRequest] + # A request object representing the call parameters. Required. + # @param options [::Gapic::CallOptions] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Cloud::SecurityCenter::V1::SimulateSecurityHealthAnalyticsCustomModuleResponse] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::SecurityCenter::V1::SimulateSecurityHealthAnalyticsCustomModuleResponse] + # A result object deserialized from the server's reply + def simulate_security_health_analytics_custom_module request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_simulate_security_health_analytics_custom_module_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: "simulate_security_health_analytics_custom_module", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Cloud::SecurityCenter::V1::SimulateSecurityHealthAnalyticsCustomModuleResponse.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_external_system REST call + # + # @param request_pb [::Google::Cloud::SecurityCenter::V1::UpdateExternalSystemRequest] + # A request object representing the call parameters. Required. + # @param options [::Gapic::CallOptions] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Cloud::SecurityCenter::V1::ExternalSystem] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::SecurityCenter::V1::ExternalSystem] + # A result object deserialized from the server's reply + def update_external_system request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_update_external_system_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_external_system", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Cloud::SecurityCenter::V1::ExternalSystem.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_finding REST call + # + # @param request_pb [::Google::Cloud::SecurityCenter::V1::UpdateFindingRequest] + # A request object representing the call parameters. Required. + # @param options [::Gapic::CallOptions] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Cloud::SecurityCenter::V1::Finding] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::SecurityCenter::V1::Finding] + # A result object deserialized from the server's reply + def update_finding request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_update_finding_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_finding", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Cloud::SecurityCenter::V1::Finding.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_mute_config REST call + # + # @param request_pb [::Google::Cloud::SecurityCenter::V1::UpdateMuteConfigRequest] + # A request object representing the call parameters. Required. + # @param options [::Gapic::CallOptions] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Cloud::SecurityCenter::V1::MuteConfig] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::SecurityCenter::V1::MuteConfig] + # A result object deserialized from the server's reply + def update_mute_config request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_update_mute_config_request request_pb + query_string_params = if query_string_params.any? + query_string_params.to_h { |p| p.split "=", 2 } + else + {} + end + + response = @client_stub.make_http_request( + verb, + uri: uri, + body: body || "", + params: query_string_params, + method_name: "update_mute_config", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Cloud::SecurityCenter::V1::MuteConfig.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_notification_config REST call + # + # @param request_pb [::Google::Cloud::SecurityCenter::V1::UpdateNotificationConfigRequest] + # A request object representing the call parameters. Required. + # @param options [::Gapic::CallOptions] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Cloud::SecurityCenter::V1::NotificationConfig] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::SecurityCenter::V1::NotificationConfig] + # A result object deserialized from the server's reply + def update_notification_config request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_update_notification_config_request request_pb + query_string_params = if query_string_params.any? + query_string_params.to_h { |p| p.split "=", 2 } + else + {} + end + + response = @client_stub.make_http_request( + verb, + uri: uri, + body: body || "", + params: query_string_params, + method_name: "update_notification_config", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Cloud::SecurityCenter::V1::NotificationConfig.decode_json response.body, ignore_unknown_fields: true + catch :response do + yield result, operation if block_given? + result + end + end + + ## + # Baseline implementation for the update_organization_settings REST call + # + # @param request_pb [::Google::Cloud::SecurityCenter::V1::UpdateOrganizationSettingsRequest] + # A request object representing the call parameters. Required. + # @param options [::Gapic::CallOptions] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Cloud::SecurityCenter::V1::OrganizationSettings] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::SecurityCenter::V1::OrganizationSettings] + # A result object deserialized from the server's reply + def update_organization_settings request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_update_organization_settings_request request_pb + query_string_params = if query_string_params.any? + query_string_params.to_h { |p| p.split "=", 2 } + else + {} + end + + response = @client_stub.make_http_request( + verb, + uri: uri, + body: body || "", + params: query_string_params, + method_name: "update_organization_settings", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Cloud::SecurityCenter::V1::OrganizationSettings.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_security_health_analytics_custom_module REST call + # + # @param request_pb [::Google::Cloud::SecurityCenter::V1::UpdateSecurityHealthAnalyticsCustomModuleRequest] + # A request object representing the call parameters. Required. + # @param options [::Gapic::CallOptions] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Cloud::SecurityCenter::V1::SecurityHealthAnalyticsCustomModule] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::SecurityCenter::V1::SecurityHealthAnalyticsCustomModule] + # A result object deserialized from the server's reply + def update_security_health_analytics_custom_module request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_update_security_health_analytics_custom_module_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_security_health_analytics_custom_module", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Cloud::SecurityCenter::V1::SecurityHealthAnalyticsCustomModule.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_source REST call + # + # @param request_pb [::Google::Cloud::SecurityCenter::V1::UpdateSourceRequest] + # A request object representing the call parameters. Required. + # @param options [::Gapic::CallOptions] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Cloud::SecurityCenter::V1::Source] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::SecurityCenter::V1::Source] + # A result object deserialized from the server's reply + def update_source request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_update_source_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_source", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Cloud::SecurityCenter::V1::Source.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_security_marks REST call + # + # @param request_pb [::Google::Cloud::SecurityCenter::V1::UpdateSecurityMarksRequest] + # A request object representing the call parameters. Required. + # @param options [::Gapic::CallOptions] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Cloud::SecurityCenter::V1::SecurityMarks] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::SecurityCenter::V1::SecurityMarks] + # A result object deserialized from the server's reply + def update_security_marks request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_update_security_marks_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_security_marks", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Cloud::SecurityCenter::V1::SecurityMarks.decode_json response.body, ignore_unknown_fields: true + catch :response do + yield result, operation if block_given? + result + end + end + + ## + # Baseline implementation for the create_big_query_export REST call + # + # @param request_pb [::Google::Cloud::SecurityCenter::V1::CreateBigQueryExportRequest] + # A request object representing the call parameters. Required. + # @param options [::Gapic::CallOptions] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Cloud::SecurityCenter::V1::BigQueryExport] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::SecurityCenter::V1::BigQueryExport] + # A result object deserialized from the server's reply + def create_big_query_export request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_create_big_query_export_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_big_query_export", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Cloud::SecurityCenter::V1::BigQueryExport.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_big_query_export REST call + # + # @param request_pb [::Google::Cloud::SecurityCenter::V1::DeleteBigQueryExportRequest] + # 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_big_query_export request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_delete_big_query_export_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_big_query_export", + 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 update_big_query_export REST call + # + # @param request_pb [::Google::Cloud::SecurityCenter::V1::UpdateBigQueryExportRequest] + # A request object representing the call parameters. Required. + # @param options [::Gapic::CallOptions] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Cloud::SecurityCenter::V1::BigQueryExport] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::SecurityCenter::V1::BigQueryExport] + # A result object deserialized from the server's reply + def update_big_query_export request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_update_big_query_export_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_big_query_export", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Cloud::SecurityCenter::V1::BigQueryExport.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_big_query_exports REST call + # + # @param request_pb [::Google::Cloud::SecurityCenter::V1::ListBigQueryExportsRequest] + # A request object representing the call parameters. Required. + # @param options [::Gapic::CallOptions] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Cloud::SecurityCenter::V1::ListBigQueryExportsResponse] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::SecurityCenter::V1::ListBigQueryExportsResponse] + # A result object deserialized from the server's reply + def list_big_query_exports request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_list_big_query_exports_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_big_query_exports", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Cloud::SecurityCenter::V1::ListBigQueryExportsResponse.decode_json response.body, ignore_unknown_fields: true + catch :response do + yield result, operation if block_given? + result + end + end + + ## + # Baseline implementation for the create_event_threat_detection_custom_module REST call + # + # @param request_pb [::Google::Cloud::SecurityCenter::V1::CreateEventThreatDetectionCustomModuleRequest] + # A request object representing the call parameters. Required. + # @param options [::Gapic::CallOptions] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Cloud::SecurityCenter::V1::EventThreatDetectionCustomModule] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::SecurityCenter::V1::EventThreatDetectionCustomModule] + # A result object deserialized from the server's reply + def create_event_threat_detection_custom_module request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_create_event_threat_detection_custom_module_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_event_threat_detection_custom_module", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Cloud::SecurityCenter::V1::EventThreatDetectionCustomModule.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_event_threat_detection_custom_module REST call + # + # @param request_pb [::Google::Cloud::SecurityCenter::V1::DeleteEventThreatDetectionCustomModuleRequest] + # 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_event_threat_detection_custom_module request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_delete_event_threat_detection_custom_module_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_event_threat_detection_custom_module", + 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 get_event_threat_detection_custom_module REST call + # + # @param request_pb [::Google::Cloud::SecurityCenter::V1::GetEventThreatDetectionCustomModuleRequest] + # A request object representing the call parameters. Required. + # @param options [::Gapic::CallOptions] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Cloud::SecurityCenter::V1::EventThreatDetectionCustomModule] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::SecurityCenter::V1::EventThreatDetectionCustomModule] + # A result object deserialized from the server's reply + def get_event_threat_detection_custom_module request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_get_event_threat_detection_custom_module_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_event_threat_detection_custom_module", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Cloud::SecurityCenter::V1::EventThreatDetectionCustomModule.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_descendant_event_threat_detection_custom_modules REST call + # + # @param request_pb [::Google::Cloud::SecurityCenter::V1::ListDescendantEventThreatDetectionCustomModulesRequest] + # A request object representing the call parameters. Required. + # @param options [::Gapic::CallOptions] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Cloud::SecurityCenter::V1::ListDescendantEventThreatDetectionCustomModulesResponse] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::SecurityCenter::V1::ListDescendantEventThreatDetectionCustomModulesResponse] + # A result object deserialized from the server's reply + def list_descendant_event_threat_detection_custom_modules request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_list_descendant_event_threat_detection_custom_modules_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_descendant_event_threat_detection_custom_modules", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Cloud::SecurityCenter::V1::ListDescendantEventThreatDetectionCustomModulesResponse.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_event_threat_detection_custom_modules REST call + # + # @param request_pb [::Google::Cloud::SecurityCenter::V1::ListEventThreatDetectionCustomModulesRequest] + # A request object representing the call parameters. Required. + # @param options [::Gapic::CallOptions] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Cloud::SecurityCenter::V1::ListEventThreatDetectionCustomModulesResponse] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::SecurityCenter::V1::ListEventThreatDetectionCustomModulesResponse] + # A result object deserialized from the server's reply + def list_event_threat_detection_custom_modules request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_list_event_threat_detection_custom_modules_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_event_threat_detection_custom_modules", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Cloud::SecurityCenter::V1::ListEventThreatDetectionCustomModulesResponse.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_event_threat_detection_custom_module REST call + # + # @param request_pb [::Google::Cloud::SecurityCenter::V1::UpdateEventThreatDetectionCustomModuleRequest] + # A request object representing the call parameters. Required. + # @param options [::Gapic::CallOptions] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Cloud::SecurityCenter::V1::EventThreatDetectionCustomModule] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::SecurityCenter::V1::EventThreatDetectionCustomModule] + # A result object deserialized from the server's reply + def update_event_threat_detection_custom_module request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_update_event_threat_detection_custom_module_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_event_threat_detection_custom_module", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Cloud::SecurityCenter::V1::EventThreatDetectionCustomModule.decode_json response.body, ignore_unknown_fields: true + catch :response do + yield result, operation if block_given? + result + end + end + + ## + # Baseline implementation for the validate_event_threat_detection_custom_module REST call + # + # @param request_pb [::Google::Cloud::SecurityCenter::V1::ValidateEventThreatDetectionCustomModuleRequest] + # A request object representing the call parameters. Required. + # @param options [::Gapic::CallOptions] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Cloud::SecurityCenter::V1::ValidateEventThreatDetectionCustomModuleResponse] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::SecurityCenter::V1::ValidateEventThreatDetectionCustomModuleResponse] + # A result object deserialized from the server's reply + def validate_event_threat_detection_custom_module request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_validate_event_threat_detection_custom_module_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: "validate_event_threat_detection_custom_module", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Cloud::SecurityCenter::V1::ValidateEventThreatDetectionCustomModuleResponse.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_effective_event_threat_detection_custom_module REST call + # + # @param request_pb [::Google::Cloud::SecurityCenter::V1::GetEffectiveEventThreatDetectionCustomModuleRequest] + # A request object representing the call parameters. Required. + # @param options [::Gapic::CallOptions] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Cloud::SecurityCenter::V1::EffectiveEventThreatDetectionCustomModule] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::SecurityCenter::V1::EffectiveEventThreatDetectionCustomModule] + # A result object deserialized from the server's reply + def get_effective_event_threat_detection_custom_module request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_get_effective_event_threat_detection_custom_module_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_effective_event_threat_detection_custom_module", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Cloud::SecurityCenter::V1::EffectiveEventThreatDetectionCustomModule.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_effective_event_threat_detection_custom_modules REST call + # + # @param request_pb [::Google::Cloud::SecurityCenter::V1::ListEffectiveEventThreatDetectionCustomModulesRequest] + # A request object representing the call parameters. Required. + # @param options [::Gapic::CallOptions] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Cloud::SecurityCenter::V1::ListEffectiveEventThreatDetectionCustomModulesResponse] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::SecurityCenter::V1::ListEffectiveEventThreatDetectionCustomModulesResponse] + # A result object deserialized from the server's reply + def list_effective_event_threat_detection_custom_modules request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_list_effective_event_threat_detection_custom_modules_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_effective_event_threat_detection_custom_modules", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Cloud::SecurityCenter::V1::ListEffectiveEventThreatDetectionCustomModulesResponse.decode_json response.body, ignore_unknown_fields: true + catch :response do + yield result, operation if block_given? + result + end + end + + ## + # Baseline implementation for the batch_create_resource_value_configs REST call + # + # @param request_pb [::Google::Cloud::SecurityCenter::V1::BatchCreateResourceValueConfigsRequest] + # A request object representing the call parameters. Required. + # @param options [::Gapic::CallOptions] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Cloud::SecurityCenter::V1::BatchCreateResourceValueConfigsResponse] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::SecurityCenter::V1::BatchCreateResourceValueConfigsResponse] + # A result object deserialized from the server's reply + def batch_create_resource_value_configs request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_batch_create_resource_value_configs_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: "batch_create_resource_value_configs", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Cloud::SecurityCenter::V1::BatchCreateResourceValueConfigsResponse.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_resource_value_config REST call + # + # @param request_pb [::Google::Cloud::SecurityCenter::V1::DeleteResourceValueConfigRequest] + # 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_resource_value_config request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_delete_resource_value_config_request request_pb + query_string_params = if query_string_params.any? + query_string_params.to_h { |p| p.split "=", 2 } + else + {} + end + + response = @client_stub.make_http_request( + verb, + uri: uri, + body: body || "", + params: query_string_params, + method_name: "delete_resource_value_config", + 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 get_resource_value_config REST call + # + # @param request_pb [::Google::Cloud::SecurityCenter::V1::GetResourceValueConfigRequest] + # A request object representing the call parameters. Required. + # @param options [::Gapic::CallOptions] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Cloud::SecurityCenter::V1::ResourceValueConfig] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::SecurityCenter::V1::ResourceValueConfig] + # A result object deserialized from the server's reply + def get_resource_value_config request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_get_resource_value_config_request request_pb + query_string_params = if query_string_params.any? + query_string_params.to_h { |p| p.split "=", 2 } + else + {} + end + + response = @client_stub.make_http_request( + verb, + uri: uri, + body: body || "", + params: query_string_params, + method_name: "get_resource_value_config", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Cloud::SecurityCenter::V1::ResourceValueConfig.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_resource_value_configs REST call + # + # @param request_pb [::Google::Cloud::SecurityCenter::V1::ListResourceValueConfigsRequest] + # A request object representing the call parameters. Required. + # @param options [::Gapic::CallOptions] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Cloud::SecurityCenter::V1::ListResourceValueConfigsResponse] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::SecurityCenter::V1::ListResourceValueConfigsResponse] + # A result object deserialized from the server's reply + def list_resource_value_configs request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_list_resource_value_configs_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_resource_value_configs", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Cloud::SecurityCenter::V1::ListResourceValueConfigsResponse.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_resource_value_config REST call + # + # @param request_pb [::Google::Cloud::SecurityCenter::V1::UpdateResourceValueConfigRequest] + # A request object representing the call parameters. Required. + # @param options [::Gapic::CallOptions] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Cloud::SecurityCenter::V1::ResourceValueConfig] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::SecurityCenter::V1::ResourceValueConfig] + # A result object deserialized from the server's reply + def update_resource_value_config request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_update_resource_value_config_request request_pb + query_string_params = if query_string_params.any? + query_string_params.to_h { |p| p.split "=", 2 } + else + {} + end + + response = @client_stub.make_http_request( + verb, + uri: uri, + body: body || "", + params: query_string_params, + method_name: "update_resource_value_config", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Cloud::SecurityCenter::V1::ResourceValueConfig.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_valued_resources REST call + # + # @param request_pb [::Google::Cloud::SecurityCenter::V1::ListValuedResourcesRequest] + # A request object representing the call parameters. Required. + # @param options [::Gapic::CallOptions] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Cloud::SecurityCenter::V1::ListValuedResourcesResponse] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::SecurityCenter::V1::ListValuedResourcesResponse] + # A result object deserialized from the server's reply + def list_valued_resources request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_list_valued_resources_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_valued_resources", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Cloud::SecurityCenter::V1::ListValuedResourcesResponse.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_attack_paths REST call + # + # @param request_pb [::Google::Cloud::SecurityCenter::V1::ListAttackPathsRequest] + # A request object representing the call parameters. Required. + # @param options [::Gapic::CallOptions] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Cloud::SecurityCenter::V1::ListAttackPathsResponse] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::SecurityCenter::V1::ListAttackPathsResponse] + # A result object deserialized from the server's reply + def list_attack_paths request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_list_attack_paths_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_attack_paths", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Cloud::SecurityCenter::V1::ListAttackPathsResponse.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 bulk_mute_findings REST call + # + # @param request_pb [::Google::Cloud::SecurityCenter::V1::BulkMuteFindingsRequest] + # A request object representing the call parameters. Required. + # @return [Array(String, [String, nil], Hash{String => String})] + # Uri, Body, Query string parameters + def self.transcode_bulk_mute_findings_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :post, + uri_template: "/v1/{parent}/findings:bulkMute", + body: "*", + matches: [ + ["parent", %r{^organizations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{parent}/findings:bulkMute", + body: "*", + matches: [ + ["parent", %r{^folders/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{parent}/findings:bulkMute", + body: "*", + matches: [ + ["parent", %r{^projects/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the create_security_health_analytics_custom_module REST call + # + # @param request_pb [::Google::Cloud::SecurityCenter::V1::CreateSecurityHealthAnalyticsCustomModuleRequest] + # 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_security_health_analytics_custom_module_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :post, + uri_template: "/v1/{parent}/customModules", + body: "security_health_analytics_custom_module", + matches: [ + ["parent", %r{^organizations/[^/]+/securityHealthAnalyticsSettings/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{parent}/customModules", + body: "security_health_analytics_custom_module", + matches: [ + ["parent", %r{^folders/[^/]+/securityHealthAnalyticsSettings/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{parent}/customModules", + body: "security_health_analytics_custom_module", + matches: [ + ["parent", %r{^projects/[^/]+/securityHealthAnalyticsSettings/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the create_source REST call + # + # @param request_pb [::Google::Cloud::SecurityCenter::V1::CreateSourceRequest] + # 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_source_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :post, + uri_template: "/v1/{parent}/sources", + body: "source", + matches: [ + ["parent", %r{^organizations/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the create_finding REST call + # + # @param request_pb [::Google::Cloud::SecurityCenter::V1::CreateFindingRequest] + # 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_finding_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :post, + uri_template: "/v1/{parent}/findings", + body: "finding", + matches: [ + ["parent", %r{^organizations/[^/]+/sources/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the create_mute_config REST call + # + # @param request_pb [::Google::Cloud::SecurityCenter::V1::CreateMuteConfigRequest] + # 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_mute_config_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :post, + uri_template: "/v1/{parent}/muteConfigs", + body: "mute_config", + matches: [ + ["parent", %r{^organizations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{parent}/muteConfigs", + body: "mute_config", + matches: [ + ["parent", %r{^organizations/[^/]+/locations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{parent}/muteConfigs", + body: "mute_config", + matches: [ + ["parent", %r{^folders/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{parent}/muteConfigs", + body: "mute_config", + matches: [ + ["parent", %r{^folders/[^/]+/locations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{parent}/muteConfigs", + body: "mute_config", + matches: [ + ["parent", %r{^projects/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{parent}/muteConfigs", + body: "mute_config", + matches: [ + ["parent", %r{^projects/[^/]+/locations/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the create_notification_config REST call + # + # @param request_pb [::Google::Cloud::SecurityCenter::V1::CreateNotificationConfigRequest] + # 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_notification_config_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :post, + uri_template: "/v1/{parent}/notificationConfigs", + body: "notification_config", + matches: [ + ["parent", %r{^organizations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{parent}/notificationConfigs", + body: "notification_config", + matches: [ + ["parent", %r{^folders/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{parent}/notificationConfigs", + body: "notification_config", + matches: [ + ["parent", %r{^projects/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the delete_mute_config REST call + # + # @param request_pb [::Google::Cloud::SecurityCenter::V1::DeleteMuteConfigRequest] + # 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_mute_config_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :delete, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^organizations/[^/]+/muteConfigs/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^folders/[^/]+/muteConfigs/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/muteConfigs/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^organizations/[^/]+/locations/[^/]+/muteConfigs/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^folders/[^/]+/locations/[^/]+/muteConfigs/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/muteConfigs/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the delete_notification_config REST call + # + # @param request_pb [::Google::Cloud::SecurityCenter::V1::DeleteNotificationConfigRequest] + # 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_notification_config_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :delete, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^organizations/[^/]+/notificationConfigs/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^folders/[^/]+/notificationConfigs/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/notificationConfigs/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the delete_security_health_analytics_custom_module REST call + # + # @param request_pb [::Google::Cloud::SecurityCenter::V1::DeleteSecurityHealthAnalyticsCustomModuleRequest] + # 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_security_health_analytics_custom_module_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :delete, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^organizations/[^/]+/securityHealthAnalyticsSettings/customModules/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^folders/[^/]+/securityHealthAnalyticsSettings/customModules/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/securityHealthAnalyticsSettings/customModules/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the get_simulation REST call + # + # @param request_pb [::Google::Cloud::SecurityCenter::V1::GetSimulationRequest] + # 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_simulation_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^organizations/[^/]+/simulations/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the get_valued_resource REST call + # + # @param request_pb [::Google::Cloud::SecurityCenter::V1::GetValuedResourceRequest] + # 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_valued_resource_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^organizations/[^/]+/simulations/[^/]+/valuedResources/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the get_big_query_export REST call + # + # @param request_pb [::Google::Cloud::SecurityCenter::V1::GetBigQueryExportRequest] + # 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_big_query_export_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^organizations/[^/]+/bigQueryExports/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^folders/[^/]+/bigQueryExports/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/bigQueryExports/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the get_iam_policy REST call + # + # @param request_pb [::Google::Iam::V1::GetIamPolicyRequest] + # A request object representing the call parameters. Required. + # @return [Array(String, [String, nil], Hash{String => String})] + # Uri, Body, Query string parameters + def self.transcode_get_iam_policy_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :post, + uri_template: "/v1/{resource}:getIamPolicy", + body: "*", + matches: [ + ["resource", %r{^organizations/[^/]+/sources/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the get_mute_config REST call + # + # @param request_pb [::Google::Cloud::SecurityCenter::V1::GetMuteConfigRequest] + # 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_mute_config_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^organizations/[^/]+/muteConfigs/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^folders/[^/]+/muteConfigs/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/muteConfigs/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^organizations/[^/]+/locations/[^/]+/muteConfigs/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^folders/[^/]+/locations/[^/]+/muteConfigs/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/muteConfigs/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the get_notification_config REST call + # + # @param request_pb [::Google::Cloud::SecurityCenter::V1::GetNotificationConfigRequest] + # 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_notification_config_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^organizations/[^/]+/notificationConfigs/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^folders/[^/]+/notificationConfigs/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/notificationConfigs/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the get_organization_settings REST call + # + # @param request_pb [::Google::Cloud::SecurityCenter::V1::GetOrganizationSettingsRequest] + # A request object representing the call parameters. Required. + # @return [Array(String, [String, nil], Hash{String => String})] + # Uri, Body, Query string parameters + def self.transcode_get_organization_settings_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^organizations/[^/]+/organizationSettings/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the get_effective_security_health_analytics_custom_module REST call + # + # @param request_pb [::Google::Cloud::SecurityCenter::V1::GetEffectiveSecurityHealthAnalyticsCustomModuleRequest] + # 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_effective_security_health_analytics_custom_module_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^organizations/[^/]+/securityHealthAnalyticsSettings/effectiveCustomModules/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^folders/[^/]+/securityHealthAnalyticsSettings/effectiveCustomModules/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/securityHealthAnalyticsSettings/effectiveCustomModules/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the get_security_health_analytics_custom_module REST call + # + # @param request_pb [::Google::Cloud::SecurityCenter::V1::GetSecurityHealthAnalyticsCustomModuleRequest] + # 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_security_health_analytics_custom_module_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^organizations/[^/]+/securityHealthAnalyticsSettings/customModules/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^folders/[^/]+/securityHealthAnalyticsSettings/customModules/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/securityHealthAnalyticsSettings/customModules/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the get_source REST call + # + # @param request_pb [::Google::Cloud::SecurityCenter::V1::GetSourceRequest] + # 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_source_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^organizations/[^/]+/sources/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the group_assets REST call + # + # @param request_pb [::Google::Cloud::SecurityCenter::V1::GroupAssetsRequest] + # A request object representing the call parameters. Required. + # @return [Array(String, [String, nil], Hash{String => String})] + # Uri, Body, Query string parameters + def self.transcode_group_assets_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :post, + uri_template: "/v1/{parent}/assets:group", + body: "*", + matches: [ + ["parent", %r{^organizations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{parent}/assets:group", + body: "*", + matches: [ + ["parent", %r{^folders/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{parent}/assets:group", + body: "*", + matches: [ + ["parent", %r{^projects/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the group_findings REST call + # + # @param request_pb [::Google::Cloud::SecurityCenter::V1::GroupFindingsRequest] + # A request object representing the call parameters. Required. + # @return [Array(String, [String, nil], Hash{String => String})] + # Uri, Body, Query string parameters + def self.transcode_group_findings_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :post, + uri_template: "/v1/{parent}/findings:group", + body: "*", + matches: [ + ["parent", %r{^organizations/[^/]+/sources/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{parent}/findings:group", + body: "*", + matches: [ + ["parent", %r{^folders/[^/]+/sources/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{parent}/findings:group", + body: "*", + matches: [ + ["parent", %r{^projects/[^/]+/sources/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the list_assets REST call + # + # @param request_pb [::Google::Cloud::SecurityCenter::V1::ListAssetsRequest] + # 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_assets_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :get, + uri_template: "/v1/{parent}/assets", + matches: [ + ["parent", %r{^organizations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{parent}/assets", + matches: [ + ["parent", %r{^folders/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{parent}/assets", + matches: [ + ["parent", %r{^projects/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the list_descendant_security_health_analytics_custom_modules REST call + # + # @param request_pb [::Google::Cloud::SecurityCenter::V1::ListDescendantSecurityHealthAnalyticsCustomModulesRequest] + # 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_descendant_security_health_analytics_custom_modules_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :get, + uri_template: "/v1/{parent}/customModules:listDescendant", + matches: [ + ["parent", %r{^organizations/[^/]+/securityHealthAnalyticsSettings/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{parent}/customModules:listDescendant", + matches: [ + ["parent", %r{^folders/[^/]+/securityHealthAnalyticsSettings/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{parent}/customModules:listDescendant", + matches: [ + ["parent", %r{^projects/[^/]+/securityHealthAnalyticsSettings/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the list_findings REST call + # + # @param request_pb [::Google::Cloud::SecurityCenter::V1::ListFindingsRequest] + # 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_findings_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :get, + uri_template: "/v1/{parent}/findings", + matches: [ + ["parent", %r{^organizations/[^/]+/sources/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{parent}/findings", + matches: [ + ["parent", %r{^folders/[^/]+/sources/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{parent}/findings", + matches: [ + ["parent", %r{^projects/[^/]+/sources/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the list_mute_configs REST call + # + # @param request_pb [::Google::Cloud::SecurityCenter::V1::ListMuteConfigsRequest] + # 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_mute_configs_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :get, + uri_template: "/v1/{parent}/muteConfigs", + matches: [ + ["parent", %r{^organizations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{parent}/muteConfigs", + matches: [ + ["parent", %r{^folders/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{parent}/muteConfigs", + matches: [ + ["parent", %r{^projects/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{parent}", + matches: [ + ["parent", %r{^organizations/[^/]+/locations/[^/]+/muteConfigs/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{parent}", + matches: [ + ["parent", %r{^folders/[^/]+/locations/[^/]+/muteConfigs/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{parent}", + matches: [ + ["parent", %r{^projects/[^/]+/locations/[^/]+/muteConfigs/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the list_notification_configs REST call + # + # @param request_pb [::Google::Cloud::SecurityCenter::V1::ListNotificationConfigsRequest] + # 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_notification_configs_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :get, + uri_template: "/v1/{parent}/notificationConfigs", + matches: [ + ["parent", %r{^organizations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{parent}/notificationConfigs", + matches: [ + ["parent", %r{^folders/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{parent}/notificationConfigs", + matches: [ + ["parent", %r{^projects/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the list_effective_security_health_analytics_custom_modules REST call + # + # @param request_pb [::Google::Cloud::SecurityCenter::V1::ListEffectiveSecurityHealthAnalyticsCustomModulesRequest] + # 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_effective_security_health_analytics_custom_modules_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :get, + uri_template: "/v1/{parent}/effectiveCustomModules", + matches: [ + ["parent", %r{^organizations/[^/]+/securityHealthAnalyticsSettings/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{parent}/effectiveCustomModules", + matches: [ + ["parent", %r{^folders/[^/]+/securityHealthAnalyticsSettings/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{parent}/effectiveCustomModules", + matches: [ + ["parent", %r{^projects/[^/]+/securityHealthAnalyticsSettings/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the list_security_health_analytics_custom_modules REST call + # + # @param request_pb [::Google::Cloud::SecurityCenter::V1::ListSecurityHealthAnalyticsCustomModulesRequest] + # 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_security_health_analytics_custom_modules_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :get, + uri_template: "/v1/{parent}/customModules", + matches: [ + ["parent", %r{^organizations/[^/]+/securityHealthAnalyticsSettings/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{parent}/customModules", + matches: [ + ["parent", %r{^folders/[^/]+/securityHealthAnalyticsSettings/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{parent}/customModules", + matches: [ + ["parent", %r{^projects/[^/]+/securityHealthAnalyticsSettings/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the list_sources REST call + # + # @param request_pb [::Google::Cloud::SecurityCenter::V1::ListSourcesRequest] + # 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_sources_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :get, + uri_template: "/v1/{parent}/sources", + matches: [ + ["parent", %r{^organizations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{parent}/sources", + matches: [ + ["parent", %r{^folders/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{parent}/sources", + matches: [ + ["parent", %r{^projects/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the run_asset_discovery REST call + # + # @param request_pb [::Google::Cloud::SecurityCenter::V1::RunAssetDiscoveryRequest] + # A request object representing the call parameters. Required. + # @return [Array(String, [String, nil], Hash{String => String})] + # Uri, Body, Query string parameters + def self.transcode_run_asset_discovery_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :post, + uri_template: "/v1/{parent}/assets:runDiscovery", + body: "*", + matches: [ + ["parent", %r{^organizations/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the set_finding_state REST call + # + # @param request_pb [::Google::Cloud::SecurityCenter::V1::SetFindingStateRequest] + # A request object representing the call parameters. Required. + # @return [Array(String, [String, nil], Hash{String => String})] + # Uri, Body, Query string parameters + def self.transcode_set_finding_state_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:setState", + body: "*", + matches: [ + ["name", %r{^organizations/[^/]+/sources/[^/]+/findings/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:setState", + body: "*", + matches: [ + ["name", %r{^folders/[^/]+/sources/[^/]+/findings/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:setState", + body: "*", + matches: [ + ["name", %r{^projects/[^/]+/sources/[^/]+/findings/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the set_mute REST call + # + # @param request_pb [::Google::Cloud::SecurityCenter::V1::SetMuteRequest] + # A request object representing the call parameters. Required. + # @return [Array(String, [String, nil], Hash{String => String})] + # Uri, Body, Query string parameters + def self.transcode_set_mute_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:setMute", + body: "*", + matches: [ + ["name", %r{^organizations/[^/]+/sources/[^/]+/findings/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:setMute", + body: "*", + matches: [ + ["name", %r{^folders/[^/]+/sources/[^/]+/findings/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:setMute", + body: "*", + matches: [ + ["name", %r{^projects/[^/]+/sources/[^/]+/findings/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the set_iam_policy REST call + # + # @param request_pb [::Google::Iam::V1::SetIamPolicyRequest] + # A request object representing the call parameters. Required. + # @return [Array(String, [String, nil], Hash{String => String})] + # Uri, Body, Query string parameters + def self.transcode_set_iam_policy_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :post, + uri_template: "/v1/{resource}:setIamPolicy", + body: "*", + matches: [ + ["resource", %r{^organizations/[^/]+/sources/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the test_iam_permissions REST call + # + # @param request_pb [::Google::Iam::V1::TestIamPermissionsRequest] + # A request object representing the call parameters. Required. + # @return [Array(String, [String, nil], Hash{String => String})] + # Uri, Body, Query string parameters + def self.transcode_test_iam_permissions_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :post, + uri_template: "/v1/{resource}:testIamPermissions", + body: "*", + matches: [ + ["resource", %r{^organizations/[^/]+/sources/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the simulate_security_health_analytics_custom_module REST call + # + # @param request_pb [::Google::Cloud::SecurityCenter::V1::SimulateSecurityHealthAnalyticsCustomModuleRequest] + # A request object representing the call parameters. Required. + # @return [Array(String, [String, nil], Hash{String => String})] + # Uri, Body, Query string parameters + def self.transcode_simulate_security_health_analytics_custom_module_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :post, + uri_template: "/v1/{parent}/customModules:simulate", + body: "*", + matches: [ + ["parent", %r{^organizations/[^/]+/securityHealthAnalyticsSettings/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{parent}/customModules:simulate", + body: "*", + matches: [ + ["parent", %r{^folders/[^/]+/securityHealthAnalyticsSettings/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{parent}/customModules:simulate", + body: "*", + matches: [ + ["parent", %r{^projects/[^/]+/securityHealthAnalyticsSettings/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the update_external_system REST call + # + # @param request_pb [::Google::Cloud::SecurityCenter::V1::UpdateExternalSystemRequest] + # 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_external_system_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :patch, + uri_template: "/v1/{external_system.name}", + body: "external_system", + matches: [ + ["external_system.name", %r{^organizations/[^/]+/sources/[^/]+/findings/[^/]+/externalSystems/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :patch, + uri_template: "/v1/{external_system.name}", + body: "external_system", + matches: [ + ["external_system.name", %r{^folders/[^/]+/sources/[^/]+/findings/[^/]+/externalSystems/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :patch, + uri_template: "/v1/{external_system.name}", + body: "external_system", + matches: [ + ["external_system.name", %r{^projects/[^/]+/sources/[^/]+/findings/[^/]+/externalSystems/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the update_finding REST call + # + # @param request_pb [::Google::Cloud::SecurityCenter::V1::UpdateFindingRequest] + # 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_finding_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :patch, + uri_template: "/v1/{finding.name}", + body: "finding", + matches: [ + ["finding.name", %r{^organizations/[^/]+/sources/[^/]+/findings/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :patch, + uri_template: "/v1/{finding.name}", + body: "finding", + matches: [ + ["finding.name", %r{^folders/[^/]+/sources/[^/]+/findings/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :patch, + uri_template: "/v1/{finding.name}", + body: "finding", + matches: [ + ["finding.name", %r{^projects/[^/]+/sources/[^/]+/findings/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the update_mute_config REST call + # + # @param request_pb [::Google::Cloud::SecurityCenter::V1::UpdateMuteConfigRequest] + # 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_mute_config_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :patch, + uri_template: "/v1/{mute_config.name}", + body: "mute_config", + matches: [ + ["mute_config.name", %r{^organizations/[^/]+/muteConfigs/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :patch, + uri_template: "/v1/{mute_config.name}", + body: "mute_config", + matches: [ + ["mute_config.name", %r{^folders/[^/]+/muteConfigs/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :patch, + uri_template: "/v1/{mute_config.name}", + body: "mute_config", + matches: [ + ["mute_config.name", %r{^projects/[^/]+/muteConfigs/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :patch, + uri_template: "/v1/{mute_config.name}", + body: "mute_config", + matches: [ + ["mute_config.name", %r{^organizations/[^/]+/locations/[^/]+/muteConfigs/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :patch, + uri_template: "/v1/{mute_config.name}", + body: "mute_config", + matches: [ + ["mute_config.name", %r{^folders/[^/]+/locations/[^/]+/muteConfigs/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :patch, + uri_template: "/v1/{mute_config.name}", + body: "mute_config", + matches: [ + ["mute_config.name", %r{^projects/[^/]+/locations/[^/]+/muteConfigs/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the update_notification_config REST call + # + # @param request_pb [::Google::Cloud::SecurityCenter::V1::UpdateNotificationConfigRequest] + # 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_notification_config_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :patch, + uri_template: "/v1/{notification_config.name}", + body: "notification_config", + matches: [ + ["notification_config.name", %r{^organizations/[^/]+/notificationConfigs/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :patch, + uri_template: "/v1/{notification_config.name}", + body: "notification_config", + matches: [ + ["notification_config.name", %r{^folders/[^/]+/notificationConfigs/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :patch, + uri_template: "/v1/{notification_config.name}", + body: "notification_config", + matches: [ + ["notification_config.name", %r{^projects/[^/]+/notificationConfigs/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the update_organization_settings REST call + # + # @param request_pb [::Google::Cloud::SecurityCenter::V1::UpdateOrganizationSettingsRequest] + # A request object representing the call parameters. Required. + # @return [Array(String, [String, nil], Hash{String => String})] + # Uri, Body, Query string parameters + def self.transcode_update_organization_settings_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :patch, + uri_template: "/v1/{organization_settings.name}", + body: "organization_settings", + matches: [ + ["organization_settings.name", %r{^organizations/[^/]+/organizationSettings/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the update_security_health_analytics_custom_module REST call + # + # @param request_pb [::Google::Cloud::SecurityCenter::V1::UpdateSecurityHealthAnalyticsCustomModuleRequest] + # 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_security_health_analytics_custom_module_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :patch, + uri_template: "/v1/{security_health_analytics_custom_module.name}", + body: "security_health_analytics_custom_module", + matches: [ + ["security_health_analytics_custom_module.name", %r{^organizations/[^/]+/securityHealthAnalyticsSettings/customModules/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :patch, + uri_template: "/v1/{security_health_analytics_custom_module.name}", + body: "security_health_analytics_custom_module", + matches: [ + ["security_health_analytics_custom_module.name", %r{^folders/[^/]+/securityHealthAnalyticsSettings/customModules/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :patch, + uri_template: "/v1/{security_health_analytics_custom_module.name}", + body: "security_health_analytics_custom_module", + matches: [ + ["security_health_analytics_custom_module.name", %r{^projects/[^/]+/securityHealthAnalyticsSettings/customModules/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the update_source REST call + # + # @param request_pb [::Google::Cloud::SecurityCenter::V1::UpdateSourceRequest] + # 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_source_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :patch, + uri_template: "/v1/{source.name}", + body: "source", + matches: [ + ["source.name", %r{^organizations/[^/]+/sources/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the update_security_marks REST call + # + # @param request_pb [::Google::Cloud::SecurityCenter::V1::UpdateSecurityMarksRequest] + # 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_security_marks_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :patch, + uri_template: "/v1/{security_marks.name}", + body: "security_marks", + matches: [ + ["security_marks.name", %r{^organizations/[^/]+/assets/[^/]+/securityMarks/?$}, false] + ] + ) + .with_bindings( + uri_method: :patch, + uri_template: "/v1/{security_marks.name}", + body: "security_marks", + matches: [ + ["security_marks.name", %r{^folders/[^/]+/assets/[^/]+/securityMarks/?$}, false] + ] + ) + .with_bindings( + uri_method: :patch, + uri_template: "/v1/{security_marks.name}", + body: "security_marks", + matches: [ + ["security_marks.name", %r{^projects/[^/]+/assets/[^/]+/securityMarks/?$}, false] + ] + ) + .with_bindings( + uri_method: :patch, + uri_template: "/v1/{security_marks.name}", + body: "security_marks", + matches: [ + ["security_marks.name", %r{^organizations/[^/]+/sources/[^/]+/findings/[^/]+/securityMarks/?$}, false] + ] + ) + .with_bindings( + uri_method: :patch, + uri_template: "/v1/{security_marks.name}", + body: "security_marks", + matches: [ + ["security_marks.name", %r{^folders/[^/]+/sources/[^/]+/findings/[^/]+/securityMarks/?$}, false] + ] + ) + .with_bindings( + uri_method: :patch, + uri_template: "/v1/{security_marks.name}", + body: "security_marks", + matches: [ + ["security_marks.name", %r{^projects/[^/]+/sources/[^/]+/findings/[^/]+/securityMarks/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the create_big_query_export REST call + # + # @param request_pb [::Google::Cloud::SecurityCenter::V1::CreateBigQueryExportRequest] + # 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_big_query_export_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :post, + uri_template: "/v1/{parent}/bigQueryExports", + body: "big_query_export", + matches: [ + ["parent", %r{^organizations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{parent}/bigQueryExports", + body: "big_query_export", + matches: [ + ["parent", %r{^folders/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{parent}/bigQueryExports", + body: "big_query_export", + matches: [ + ["parent", %r{^projects/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the delete_big_query_export REST call + # + # @param request_pb [::Google::Cloud::SecurityCenter::V1::DeleteBigQueryExportRequest] + # 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_big_query_export_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :delete, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^organizations/[^/]+/bigQueryExports/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^folders/[^/]+/bigQueryExports/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/bigQueryExports/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the update_big_query_export REST call + # + # @param request_pb [::Google::Cloud::SecurityCenter::V1::UpdateBigQueryExportRequest] + # 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_big_query_export_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :patch, + uri_template: "/v1/{big_query_export.name}", + body: "big_query_export", + matches: [ + ["big_query_export.name", %r{^organizations/[^/]+/bigQueryExports/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :patch, + uri_template: "/v1/{big_query_export.name}", + body: "big_query_export", + matches: [ + ["big_query_export.name", %r{^folders/[^/]+/bigQueryExports/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :patch, + uri_template: "/v1/{big_query_export.name}", + body: "big_query_export", + matches: [ + ["big_query_export.name", %r{^projects/[^/]+/bigQueryExports/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the list_big_query_exports REST call + # + # @param request_pb [::Google::Cloud::SecurityCenter::V1::ListBigQueryExportsRequest] + # 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_big_query_exports_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :get, + uri_template: "/v1/{parent}/bigQueryExports", + matches: [ + ["parent", %r{^organizations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{parent}/bigQueryExports", + matches: [ + ["parent", %r{^folders/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{parent}/bigQueryExports", + matches: [ + ["parent", %r{^projects/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the create_event_threat_detection_custom_module REST call + # + # @param request_pb [::Google::Cloud::SecurityCenter::V1::CreateEventThreatDetectionCustomModuleRequest] + # 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_event_threat_detection_custom_module_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :post, + uri_template: "/v1/{parent}/customModules", + body: "event_threat_detection_custom_module", + matches: [ + ["parent", %r{^organizations/[^/]+/eventThreatDetectionSettings/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{parent}/customModules", + body: "event_threat_detection_custom_module", + matches: [ + ["parent", %r{^folders/[^/]+/eventThreatDetectionSettings/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{parent}/customModules", + body: "event_threat_detection_custom_module", + matches: [ + ["parent", %r{^projects/[^/]+/eventThreatDetectionSettings/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the delete_event_threat_detection_custom_module REST call + # + # @param request_pb [::Google::Cloud::SecurityCenter::V1::DeleteEventThreatDetectionCustomModuleRequest] + # 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_event_threat_detection_custom_module_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :delete, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^organizations/[^/]+/eventThreatDetectionSettings/customModules/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^folders/[^/]+/eventThreatDetectionSettings/customModules/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/eventThreatDetectionSettings/customModules/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the get_event_threat_detection_custom_module REST call + # + # @param request_pb [::Google::Cloud::SecurityCenter::V1::GetEventThreatDetectionCustomModuleRequest] + # 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_event_threat_detection_custom_module_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^organizations/[^/]+/eventThreatDetectionSettings/customModules/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^folders/[^/]+/eventThreatDetectionSettings/customModules/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/eventThreatDetectionSettings/customModules/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the list_descendant_event_threat_detection_custom_modules REST call + # + # @param request_pb [::Google::Cloud::SecurityCenter::V1::ListDescendantEventThreatDetectionCustomModulesRequest] + # 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_descendant_event_threat_detection_custom_modules_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :get, + uri_template: "/v1/{parent}/customModules:listDescendant", + matches: [ + ["parent", %r{^organizations/[^/]+/eventThreatDetectionSettings/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{parent}/customModules:listDescendant", + matches: [ + ["parent", %r{^folders/[^/]+/eventThreatDetectionSettings/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{parent}/customModules:listDescendant", + matches: [ + ["parent", %r{^projects/[^/]+/eventThreatDetectionSettings/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the list_event_threat_detection_custom_modules REST call + # + # @param request_pb [::Google::Cloud::SecurityCenter::V1::ListEventThreatDetectionCustomModulesRequest] + # 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_event_threat_detection_custom_modules_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :get, + uri_template: "/v1/{parent}/customModules", + matches: [ + ["parent", %r{^organizations/[^/]+/eventThreatDetectionSettings/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{parent}/customModules", + matches: [ + ["parent", %r{^folders/[^/]+/eventThreatDetectionSettings/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{parent}/customModules", + matches: [ + ["parent", %r{^projects/[^/]+/eventThreatDetectionSettings/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the update_event_threat_detection_custom_module REST call + # + # @param request_pb [::Google::Cloud::SecurityCenter::V1::UpdateEventThreatDetectionCustomModuleRequest] + # 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_event_threat_detection_custom_module_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :patch, + uri_template: "/v1/{event_threat_detection_custom_module.name}", + body: "event_threat_detection_custom_module", + matches: [ + ["event_threat_detection_custom_module.name", %r{^organizations/[^/]+/eventThreatDetectionSettings/customModules/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :patch, + uri_template: "/v1/{event_threat_detection_custom_module.name}", + body: "event_threat_detection_custom_module", + matches: [ + ["event_threat_detection_custom_module.name", %r{^folders/[^/]+/eventThreatDetectionSettings/customModules/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :patch, + uri_template: "/v1/{event_threat_detection_custom_module.name}", + body: "event_threat_detection_custom_module", + matches: [ + ["event_threat_detection_custom_module.name", %r{^projects/[^/]+/eventThreatDetectionSettings/customModules/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the validate_event_threat_detection_custom_module REST call + # + # @param request_pb [::Google::Cloud::SecurityCenter::V1::ValidateEventThreatDetectionCustomModuleRequest] + # A request object representing the call parameters. Required. + # @return [Array(String, [String, nil], Hash{String => String})] + # Uri, Body, Query string parameters + def self.transcode_validate_event_threat_detection_custom_module_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :post, + uri_template: "/v1/{parent}:validateCustomModule", + body: "*", + matches: [ + ["parent", %r{^organizations/[^/]+/eventThreatDetectionSettings/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{parent}:validateCustomModule", + body: "*", + matches: [ + ["parent", %r{^folders/[^/]+/eventThreatDetectionSettings/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{parent}:validateCustomModule", + body: "*", + matches: [ + ["parent", %r{^projects/[^/]+/eventThreatDetectionSettings/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the get_effective_event_threat_detection_custom_module REST call + # + # @param request_pb [::Google::Cloud::SecurityCenter::V1::GetEffectiveEventThreatDetectionCustomModuleRequest] + # 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_effective_event_threat_detection_custom_module_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^organizations/[^/]+/eventThreatDetectionSettings/effectiveCustomModules/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^folders/[^/]+/eventThreatDetectionSettings/effectiveCustomModules/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/eventThreatDetectionSettings/effectiveCustomModules/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the list_effective_event_threat_detection_custom_modules REST call + # + # @param request_pb [::Google::Cloud::SecurityCenter::V1::ListEffectiveEventThreatDetectionCustomModulesRequest] + # 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_effective_event_threat_detection_custom_modules_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :get, + uri_template: "/v1/{parent}/effectiveCustomModules", + matches: [ + ["parent", %r{^organizations/[^/]+/eventThreatDetectionSettings/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{parent}/effectiveCustomModules", + matches: [ + ["parent", %r{^folders/[^/]+/eventThreatDetectionSettings/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{parent}/effectiveCustomModules", + matches: [ + ["parent", %r{^projects/[^/]+/eventThreatDetectionSettings/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the batch_create_resource_value_configs REST call + # + # @param request_pb [::Google::Cloud::SecurityCenter::V1::BatchCreateResourceValueConfigsRequest] + # A request object representing the call parameters. Required. + # @return [Array(String, [String, nil], Hash{String => String})] + # Uri, Body, Query string parameters + def self.transcode_batch_create_resource_value_configs_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :post, + uri_template: "/v1/{parent}/resourceValueConfigs:batchCreate", + body: "*", + matches: [ + ["parent", %r{^organizations/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the delete_resource_value_config REST call + # + # @param request_pb [::Google::Cloud::SecurityCenter::V1::DeleteResourceValueConfigRequest] + # 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_resource_value_config_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :delete, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^organizations/[^/]+/resourceValueConfigs/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the get_resource_value_config REST call + # + # @param request_pb [::Google::Cloud::SecurityCenter::V1::GetResourceValueConfigRequest] + # 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_resource_value_config_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^organizations/[^/]+/resourceValueConfigs/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the list_resource_value_configs REST call + # + # @param request_pb [::Google::Cloud::SecurityCenter::V1::ListResourceValueConfigsRequest] + # 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_resource_value_configs_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :get, + uri_template: "/v1/{parent}/resourceValueConfigs", + matches: [ + ["parent", %r{^organizations/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the update_resource_value_config REST call + # + # @param request_pb [::Google::Cloud::SecurityCenter::V1::UpdateResourceValueConfigRequest] + # 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_resource_value_config_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :patch, + uri_template: "/v1/{resource_value_config.name}", + body: "resource_value_config", + matches: [ + ["resource_value_config.name", %r{^organizations/[^/]+/resourceValueConfigs/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the list_valued_resources REST call + # + # @param request_pb [::Google::Cloud::SecurityCenter::V1::ListValuedResourcesRequest] + # 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_valued_resources_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :get, + uri_template: "/v1/{parent}/valuedResources", + matches: [ + ["parent", %r{^organizations/[^/]+/simulations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{parent}/valuedResources", + matches: [ + ["parent", %r{^organizations/[^/]+/simulations/[^/]+/attackExposureResults/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the list_attack_paths REST call + # + # @param request_pb [::Google::Cloud::SecurityCenter::V1::ListAttackPathsRequest] + # 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_attack_paths_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :get, + uri_template: "/v1/{parent}/attackPaths", + matches: [ + ["parent", %r{^organizations/[^/]+/simulations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{parent}/attackPaths", + matches: [ + ["parent", %r{^organizations/[^/]+/simulations/[^/]+/valuedResources/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{parent}/attackPaths", + matches: [ + ["parent", %r{^organizations/[^/]+/simulations/[^/]+/attackExposureResults/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + end + end + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-security_center-v1/lib/google/cloud/security_center/v1/version.rb b/owl-bot-staging/google-cloud-security_center-v1/lib/google/cloud/security_center/v1/version.rb new file mode 100644 index 000000000000..1c19ab7f4c05 --- /dev/null +++ b/owl-bot-staging/google-cloud-security_center-v1/lib/google/cloud/security_center/v1/version.rb @@ -0,0 +1,28 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + + +module Google + module Cloud + module SecurityCenter + module V1 + VERSION = "0.0.1" + end + end + end +end diff --git a/owl-bot-staging/google-cloud-security_center-v1/lib/google/cloud/securitycenter/v1/access_pb.rb b/owl-bot-staging/google-cloud-security_center-v1/lib/google/cloud/securitycenter/v1/access_pb.rb new file mode 100644 index 000000000000..65cfc17f9bbb --- /dev/null +++ b/owl-bot-staging/google-cloud-security_center-v1/lib/google/cloud/securitycenter/v1/access_pb.rb @@ -0,0 +1,23 @@ +# frozen_string_literal: true +# Generated by the protocol buffer compiler. DO NOT EDIT! +# source: google/cloud/securitycenter/v1/access.proto + +require 'google/protobuf' + + +descriptor_data = "\n+google/cloud/securitycenter/v1/access.proto\x12\x1egoogle.cloud.securitycenter.v1\"\x89\x03\n\x06\x41\x63\x63\x65ss\x12\x17\n\x0fprincipal_email\x18\x01 \x01(\t\x12\x11\n\tcaller_ip\x18\x02 \x01(\t\x12\x42\n\rcaller_ip_geo\x18\x03 \x01(\x0b\x32+.google.cloud.securitycenter.v1.Geolocation\x12\x19\n\x11user_agent_family\x18\x04 \x01(\t\x12\x12\n\nuser_agent\x18\x0c \x01(\t\x12\x14\n\x0cservice_name\x18\x05 \x01(\t\x12\x13\n\x0bmethod_name\x18\x06 \x01(\t\x12\x19\n\x11principal_subject\x18\x07 \x01(\t\x12 \n\x18service_account_key_name\x18\x08 \x01(\t\x12\x65\n\x1fservice_account_delegation_info\x18\t \x03(\x0b\x32<.google.cloud.securitycenter.v1.ServiceAccountDelegationInfo\x12\x11\n\tuser_name\x18\x0b \x01(\t\"R\n\x1cServiceAccountDelegationInfo\x12\x17\n\x0fprincipal_email\x18\x01 \x01(\t\x12\x19\n\x11principal_subject\x18\x02 \x01(\t\"\"\n\x0bGeolocation\x12\x13\n\x0bregion_code\x18\x01 \x01(\tB\xe5\x01\n\"com.google.cloud.securitycenter.v1B\x0b\x41\x63\x63\x65ssProtoP\x01ZJcloud.google.com/go/securitycenter/apiv1/securitycenterpb;securitycenterpb\xaa\x02\x1eGoogle.Cloud.SecurityCenter.V1\xca\x02\x1eGoogle\\Cloud\\SecurityCenter\\V1\xea\x02!Google::Cloud::SecurityCenter::V1b\x06proto3" + +pool = ::Google::Protobuf::DescriptorPool.generated_pool +pool.add_serialized_file(descriptor_data) + +module Google + module Cloud + module SecurityCenter + module V1 + Access = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.securitycenter.v1.Access").msgclass + ServiceAccountDelegationInfo = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.securitycenter.v1.ServiceAccountDelegationInfo").msgclass + Geolocation = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.securitycenter.v1.Geolocation").msgclass + end + end + end +end diff --git a/owl-bot-staging/google-cloud-security_center-v1/lib/google/cloud/securitycenter/v1/application_pb.rb b/owl-bot-staging/google-cloud-security_center-v1/lib/google/cloud/securitycenter/v1/application_pb.rb new file mode 100644 index 000000000000..716a87e5400a --- /dev/null +++ b/owl-bot-staging/google-cloud-security_center-v1/lib/google/cloud/securitycenter/v1/application_pb.rb @@ -0,0 +1,21 @@ +# frozen_string_literal: true +# Generated by the protocol buffer compiler. DO NOT EDIT! +# source: google/cloud/securitycenter/v1/application.proto + +require 'google/protobuf' + + +descriptor_data = "\n0google/cloud/securitycenter/v1/application.proto\x12\x1egoogle.cloud.securitycenter.v1\"1\n\x0b\x41pplication\x12\x10\n\x08\x62\x61se_uri\x18\x01 \x01(\t\x12\x10\n\x08\x66ull_uri\x18\x02 \x01(\tB\xea\x01\n\"com.google.cloud.securitycenter.v1B\x10\x41pplicationProtoP\x01ZJcloud.google.com/go/securitycenter/apiv1/securitycenterpb;securitycenterpb\xaa\x02\x1eGoogle.Cloud.SecurityCenter.V1\xca\x02\x1eGoogle\\Cloud\\SecurityCenter\\V1\xea\x02!Google::Cloud::SecurityCenter::V1b\x06proto3" + +pool = ::Google::Protobuf::DescriptorPool.generated_pool +pool.add_serialized_file(descriptor_data) + +module Google + module Cloud + module SecurityCenter + module V1 + Application = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.securitycenter.v1.Application").msgclass + end + end + end +end diff --git a/owl-bot-staging/google-cloud-security_center-v1/lib/google/cloud/securitycenter/v1/asset_pb.rb b/owl-bot-staging/google-cloud-security_center-v1/lib/google/cloud/securitycenter/v1/asset_pb.rb new file mode 100644 index 000000000000..7bbe0a82baf9 --- /dev/null +++ b/owl-bot-staging/google-cloud-security_center-v1/lib/google/cloud/securitycenter/v1/asset_pb.rb @@ -0,0 +1,29 @@ +# frozen_string_literal: true +# Generated by the protocol buffer compiler. DO NOT EDIT! +# source: google/cloud/securitycenter/v1/asset.proto + +require 'google/protobuf' + +require 'google/api/resource_pb' +require 'google/cloud/securitycenter/v1/folder_pb' +require 'google/cloud/securitycenter/v1/security_marks_pb' +require 'google/protobuf/struct_pb' +require 'google/protobuf/timestamp_pb' + + +descriptor_data = "\n*google/cloud/securitycenter/v1/asset.proto\x12\x1egoogle.cloud.securitycenter.v1\x1a\x19google/api/resource.proto\x1a+google/cloud/securitycenter/v1/folder.proto\x1a\x33google/cloud/securitycenter/v1/security_marks.proto\x1a\x1cgoogle/protobuf/struct.proto\x1a\x1fgoogle/protobuf/timestamp.proto\"\xb8\x08\n\x05\x41sset\x12\x0c\n\x04name\x18\x01 \x01(\t\x12\x62\n\x1asecurity_center_properties\x18\x02 \x01(\x0b\x32>.google.cloud.securitycenter.v1.Asset.SecurityCenterProperties\x12Z\n\x13resource_properties\x18\x07 \x03(\x0b\x32=.google.cloud.securitycenter.v1.Asset.ResourcePropertiesEntry\x12\x45\n\x0esecurity_marks\x18\x08 \x01(\x0b\x32-.google.cloud.securitycenter.v1.SecurityMarks\x12/\n\x0b\x63reate_time\x18\t \x01(\x0b\x32\x1a.google.protobuf.Timestamp\x12/\n\x0bupdate_time\x18\n \x01(\x0b\x32\x1a.google.protobuf.Timestamp\x12\x43\n\niam_policy\x18\x0b \x01(\x0b\x32/.google.cloud.securitycenter.v1.Asset.IamPolicy\x12\x16\n\x0e\x63\x61nonical_name\x18\r \x01(\t\x1a\xb9\x02\n\x18SecurityCenterProperties\x12\x15\n\rresource_name\x18\x01 \x01(\t\x12\x15\n\rresource_type\x18\x02 \x01(\t\x12\x17\n\x0fresource_parent\x18\x03 \x01(\t\x12\x18\n\x10resource_project\x18\x04 \x01(\t\x12\x17\n\x0fresource_owners\x18\x05 \x03(\t\x12\x1d\n\x15resource_display_name\x18\x06 \x01(\t\x12$\n\x1cresource_parent_display_name\x18\x07 \x01(\t\x12%\n\x1dresource_project_display_name\x18\x08 \x01(\t\x12\x37\n\x07\x66olders\x18\n \x03(\x0b\x32&.google.cloud.securitycenter.v1.Folder\x1a \n\tIamPolicy\x12\x13\n\x0bpolicy_blob\x18\x01 \x01(\t\x1aQ\n\x17ResourcePropertiesEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12%\n\x05value\x18\x02 \x01(\x0b\x32\x16.google.protobuf.Value:\x02\x38\x01:\xa9\x01\xea\x41\xa5\x01\n#securitycenter.googleapis.com/Asset\x12+organizations/{organization}/assets/{asset}\x12\x1f\x66olders/{folder}/assets/{asset}\x12!projects/{project}/assets/{asset}*\x06\x61ssets2\x05\x61ssetB\xd8\x01\n\"com.google.cloud.securitycenter.v1P\x01ZJcloud.google.com/go/securitycenter/apiv1/securitycenterpb;securitycenterpb\xaa\x02\x1eGoogle.Cloud.SecurityCenter.V1\xca\x02\x1eGoogle\\Cloud\\SecurityCenter\\V1\xea\x02!Google::Cloud::SecurityCenter::V1b\x06proto3" + +pool = ::Google::Protobuf::DescriptorPool.generated_pool +pool.add_serialized_file(descriptor_data) + +module Google + module Cloud + module SecurityCenter + module V1 + Asset = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.securitycenter.v1.Asset").msgclass + Asset::SecurityCenterProperties = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.securitycenter.v1.Asset.SecurityCenterProperties").msgclass + Asset::IamPolicy = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.securitycenter.v1.Asset.IamPolicy").msgclass + end + end + end +end diff --git a/owl-bot-staging/google-cloud-security_center-v1/lib/google/cloud/securitycenter/v1/attack_exposure_pb.rb b/owl-bot-staging/google-cloud-security_center-v1/lib/google/cloud/securitycenter/v1/attack_exposure_pb.rb new file mode 100644 index 000000000000..874c9ce74d43 --- /dev/null +++ b/owl-bot-staging/google-cloud-security_center-v1/lib/google/cloud/securitycenter/v1/attack_exposure_pb.rb @@ -0,0 +1,24 @@ +# frozen_string_literal: true +# Generated by the protocol buffer compiler. DO NOT EDIT! +# source: google/cloud/securitycenter/v1/attack_exposure.proto + +require 'google/protobuf' + +require 'google/protobuf/timestamp_pb' + + +descriptor_data = "\n4google/cloud/securitycenter/v1/attack_exposure.proto\x12\x1egoogle.cloud.securitycenter.v1\x1a\x1fgoogle/protobuf/timestamp.proto\"\x8a\x03\n\x0e\x41ttackExposure\x12\r\n\x05score\x18\x01 \x01(\x01\x12;\n\x17latest_calculation_time\x18\x02 \x01(\x0b\x32\x1a.google.protobuf.Timestamp\x12\x1e\n\x16\x61ttack_exposure_result\x18\x03 \x01(\t\x12\x43\n\x05state\x18\x04 \x01(\x0e\x32\x34.google.cloud.securitycenter.v1.AttackExposure.State\x12*\n\"exposed_high_value_resources_count\x18\x05 \x01(\x05\x12,\n$exposed_medium_value_resources_count\x18\x06 \x01(\x05\x12)\n!exposed_low_value_resources_count\x18\x07 \x01(\x05\"B\n\x05State\x12\x15\n\x11STATE_UNSPECIFIED\x10\x00\x12\x0e\n\nCALCULATED\x10\x01\x12\x12\n\x0eNOT_CALCULATED\x10\x02\x42\xed\x01\n\"com.google.cloud.securitycenter.v1B\x13\x41ttackExposureProtoP\x01ZJcloud.google.com/go/securitycenter/apiv1/securitycenterpb;securitycenterpb\xaa\x02\x1eGoogle.Cloud.SecurityCenter.V1\xca\x02\x1eGoogle\\Cloud\\SecurityCenter\\V1\xea\x02!Google::Cloud::SecurityCenter::V1b\x06proto3" + +pool = ::Google::Protobuf::DescriptorPool.generated_pool +pool.add_serialized_file(descriptor_data) + +module Google + module Cloud + module SecurityCenter + module V1 + AttackExposure = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.securitycenter.v1.AttackExposure").msgclass + AttackExposure::State = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.securitycenter.v1.AttackExposure.State").enummodule + end + end + end +end diff --git a/owl-bot-staging/google-cloud-security_center-v1/lib/google/cloud/securitycenter/v1/attack_path_pb.rb b/owl-bot-staging/google-cloud-security_center-v1/lib/google/cloud/securitycenter/v1/attack_path_pb.rb new file mode 100644 index 000000000000..9a0cc9065451 --- /dev/null +++ b/owl-bot-staging/google-cloud-security_center-v1/lib/google/cloud/securitycenter/v1/attack_path_pb.rb @@ -0,0 +1,28 @@ +# frozen_string_literal: true +# Generated by the protocol buffer compiler. DO NOT EDIT! +# source: google/cloud/securitycenter/v1/attack_path.proto + +require 'google/protobuf' + +require 'google/api/resource_pb' + + +descriptor_data = "\n0google/cloud/securitycenter/v1/attack_path.proto\x12\x1egoogle.cloud.securitycenter.v1\x1a\x19google/api/resource.proto\"\xe7\t\n\nAttackPath\x12\x0c\n\x04name\x18\x01 \x01(\t\x12M\n\npath_nodes\x18\x02 \x03(\x0b\x32\x39.google.cloud.securitycenter.v1.AttackPath.AttackPathNode\x12H\n\x05\x65\x64ges\x18\x03 \x03(\x0b\x32\x39.google.cloud.securitycenter.v1.AttackPath.AttackPathEdge\x1a\xbd\x06\n\x0e\x41ttackPathNode\x12\x10\n\x08resource\x18\x01 \x01(\t\x12\x15\n\rresource_type\x18\x02 \x01(\t\x12\x14\n\x0c\x64isplay_name\x18\x03 \x01(\t\x12p\n\x13\x61ssociated_findings\x18\x04 \x03(\x0b\x32S.google.cloud.securitycenter.v1.AttackPath.AttackPathNode.PathNodeAssociatedFinding\x12\x0c\n\x04uuid\x18\x05 \x01(\t\x12^\n\x0c\x61ttack_steps\x18\x06 \x03(\x0b\x32H.google.cloud.securitycenter.v1.AttackPath.AttackPathNode.AttackStepNode\x1a^\n\x19PathNodeAssociatedFinding\x12\x19\n\x11\x63\x61nonical_finding\x18\x01 \x01(\t\x12\x18\n\x10\x66inding_category\x18\x02 \x01(\t\x12\x0c\n\x04name\x18\x03 \x01(\t\x1a\xb0\x02\n\x0e\x41ttackStepNode\x12\x0c\n\x04uuid\x18\x01 \x01(\t\x12P\n\x04type\x18\x02 \x01(\x0e\x32\x42.google.cloud.securitycenter.v1.AttackPath.AttackPathNode.NodeType\x12\x14\n\x0c\x64isplay_name\x18\x03 \x01(\t\x12\x64\n\x06labels\x18\x04 \x03(\x0b\x32T.google.cloud.securitycenter.v1.AttackPath.AttackPathNode.AttackStepNode.LabelsEntry\x12\x13\n\x0b\x64\x65scription\x18\x05 \x01(\t\x1a-\n\x0bLabelsEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12\r\n\x05value\x18\x02 \x01(\t:\x02\x38\x01\"y\n\x08NodeType\x12\x19\n\x15NODE_TYPE_UNSPECIFIED\x10\x00\x12\x11\n\rNODE_TYPE_AND\x10\x01\x12\x10\n\x0cNODE_TYPE_OR\x10\x02\x12\x15\n\x11NODE_TYPE_DEFENSE\x10\x03\x12\x16\n\x12NODE_TYPE_ATTACKER\x10\x04\x1a\x35\n\x0e\x41ttackPathEdge\x12\x0e\n\x06source\x18\x01 \x01(\t\x12\x13\n\x0b\x64\x65stination\x18\x02 \x01(\t:\xba\x01\xea\x41\xb6\x01\n(securitycenter.googleapis.com/AttackPath\x12qorganizations/{organization}/simulations/{simulation}/valuedResources/{valued_resource}/attackPaths/{attack_path}*\x0b\x61ttackPaths2\nattackPathB\xe9\x01\n\"com.google.cloud.securitycenter.v1B\x0f\x41ttackPathProtoP\x01ZJcloud.google.com/go/securitycenter/apiv1/securitycenterpb;securitycenterpb\xaa\x02\x1eGoogle.Cloud.SecurityCenter.V1\xca\x02\x1eGoogle\\Cloud\\SecurityCenter\\V1\xea\x02!Google::Cloud::SecurityCenter::V1b\x06proto3" + +pool = ::Google::Protobuf::DescriptorPool.generated_pool +pool.add_serialized_file(descriptor_data) + +module Google + module Cloud + module SecurityCenter + module V1 + AttackPath = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.securitycenter.v1.AttackPath").msgclass + AttackPath::AttackPathNode = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.securitycenter.v1.AttackPath.AttackPathNode").msgclass + AttackPath::AttackPathNode::PathNodeAssociatedFinding = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.securitycenter.v1.AttackPath.AttackPathNode.PathNodeAssociatedFinding").msgclass + AttackPath::AttackPathNode::AttackStepNode = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.securitycenter.v1.AttackPath.AttackPathNode.AttackStepNode").msgclass + AttackPath::AttackPathNode::NodeType = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.securitycenter.v1.AttackPath.AttackPathNode.NodeType").enummodule + AttackPath::AttackPathEdge = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.securitycenter.v1.AttackPath.AttackPathEdge").msgclass + end + end + end +end diff --git a/owl-bot-staging/google-cloud-security_center-v1/lib/google/cloud/securitycenter/v1/backup_disaster_recovery_pb.rb b/owl-bot-staging/google-cloud-security_center-v1/lib/google/cloud/securitycenter/v1/backup_disaster_recovery_pb.rb new file mode 100644 index 000000000000..0e004d7fc559 --- /dev/null +++ b/owl-bot-staging/google-cloud-security_center-v1/lib/google/cloud/securitycenter/v1/backup_disaster_recovery_pb.rb @@ -0,0 +1,23 @@ +# frozen_string_literal: true +# Generated by the protocol buffer compiler. DO NOT EDIT! +# source: google/cloud/securitycenter/v1/backup_disaster_recovery.proto + +require 'google/protobuf' + +require 'google/protobuf/timestamp_pb' + + +descriptor_data = "\n=google/cloud/securitycenter/v1/backup_disaster_recovery.proto\x12\x1egoogle.cloud.securitycenter.v1\x1a\x1fgoogle/protobuf/timestamp.proto\"\x86\x02\n\x16\x42\x61\x63kupDisasterRecovery\x12\x17\n\x0f\x62\x61\x63kup_template\x18\x01 \x01(\t\x12\x10\n\x08policies\x18\x02 \x03(\t\x12\x0c\n\x04host\x18\x03 \x01(\t\x12\x14\n\x0c\x61pplications\x18\x04 \x03(\t\x12\x14\n\x0cstorage_pool\x18\x05 \x01(\t\x12\x16\n\x0epolicy_options\x18\x06 \x03(\t\x12\x0f\n\x07profile\x18\x07 \x01(\t\x12\x11\n\tappliance\x18\x08 \x01(\t\x12\x13\n\x0b\x62\x61\x63kup_type\x18\t \x01(\t\x12\x36\n\x12\x62\x61\x63kup_create_time\x18\n \x01(\x0b\x32\x1a.google.protobuf.TimestampB\xf5\x01\n\"com.google.cloud.securitycenter.v1B\x1b\x42\x61\x63kupDisasterRecoveryProtoP\x01ZJcloud.google.com/go/securitycenter/apiv1/securitycenterpb;securitycenterpb\xaa\x02\x1eGoogle.Cloud.SecurityCenter.V1\xca\x02\x1eGoogle\\Cloud\\SecurityCenter\\V1\xea\x02!Google::Cloud::SecurityCenter::V1b\x06proto3" + +pool = ::Google::Protobuf::DescriptorPool.generated_pool +pool.add_serialized_file(descriptor_data) + +module Google + module Cloud + module SecurityCenter + module V1 + BackupDisasterRecovery = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.securitycenter.v1.BackupDisasterRecovery").msgclass + end + end + end +end diff --git a/owl-bot-staging/google-cloud-security_center-v1/lib/google/cloud/securitycenter/v1/bigquery_export_pb.rb b/owl-bot-staging/google-cloud-security_center-v1/lib/google/cloud/securitycenter/v1/bigquery_export_pb.rb new file mode 100644 index 000000000000..dd2586de3962 --- /dev/null +++ b/owl-bot-staging/google-cloud-security_center-v1/lib/google/cloud/securitycenter/v1/bigquery_export_pb.rb @@ -0,0 +1,25 @@ +# frozen_string_literal: true +# Generated by the protocol buffer compiler. DO NOT EDIT! +# source: google/cloud/securitycenter/v1/bigquery_export.proto + +require 'google/protobuf' + +require 'google/api/field_behavior_pb' +require 'google/api/resource_pb' +require 'google/protobuf/timestamp_pb' + + +descriptor_data = "\n4google/cloud/securitycenter/v1/bigquery_export.proto\x12\x1egoogle.cloud.securitycenter.v1\x1a\x1fgoogle/api/field_behavior.proto\x1a\x19google/api/resource.proto\x1a\x1fgoogle/protobuf/timestamp.proto\"\xde\x03\n\x0e\x42igQueryExport\x12\x0c\n\x04name\x18\x01 \x01(\t\x12\x13\n\x0b\x64\x65scription\x18\x02 \x01(\t\x12\x0e\n\x06\x66ilter\x18\x03 \x01(\t\x12\x0f\n\x07\x64\x61taset\x18\x04 \x01(\t\x12\x34\n\x0b\x63reate_time\x18\x05 \x01(\x0b\x32\x1a.google.protobuf.TimestampB\x03\xe0\x41\x03\x12\x34\n\x0bupdate_time\x18\x06 \x01(\x0b\x32\x1a.google.protobuf.TimestampB\x03\xe0\x41\x03\x12\x1f\n\x12most_recent_editor\x18\x07 \x01(\tB\x03\xe0\x41\x03\x12\x16\n\tprincipal\x18\x08 \x01(\tB\x03\xe0\x41\x03:\xe2\x01\xea\x41\xde\x01\n,securitycenter.googleapis.com/BigQueryExport\x12\x35organizations/{organization}/bigQueryExports/{export}\x12)folders/{folder}/bigQueryExports/{export}\x12+projects/{project}/bigQueryExports/{export}*\x0f\x62igQueryExports2\x0e\x62igQueryExportB\xed\x01\n\"com.google.cloud.securitycenter.v1B\x13\x42igQueryExportProtoP\x01ZJcloud.google.com/go/securitycenter/apiv1/securitycenterpb;securitycenterpb\xaa\x02\x1eGoogle.Cloud.SecurityCenter.V1\xca\x02\x1eGoogle\\Cloud\\SecurityCenter\\V1\xea\x02!Google::Cloud::SecurityCenter::V1b\x06proto3" + +pool = ::Google::Protobuf::DescriptorPool.generated_pool +pool.add_serialized_file(descriptor_data) + +module Google + module Cloud + module SecurityCenter + module V1 + BigQueryExport = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.securitycenter.v1.BigQueryExport").msgclass + end + end + end +end diff --git a/owl-bot-staging/google-cloud-security_center-v1/lib/google/cloud/securitycenter/v1/chokepoint_pb.rb b/owl-bot-staging/google-cloud-security_center-v1/lib/google/cloud/securitycenter/v1/chokepoint_pb.rb new file mode 100644 index 000000000000..bcdd9d0754f3 --- /dev/null +++ b/owl-bot-staging/google-cloud-security_center-v1/lib/google/cloud/securitycenter/v1/chokepoint_pb.rb @@ -0,0 +1,21 @@ +# frozen_string_literal: true +# Generated by the protocol buffer compiler. DO NOT EDIT! +# source: google/cloud/securitycenter/v1/chokepoint.proto + +require 'google/protobuf' + + +descriptor_data = "\n/google/cloud/securitycenter/v1/chokepoint.proto\x12\x1egoogle.cloud.securitycenter.v1\"&\n\nChokepoint\x12\x18\n\x10related_findings\x18\x01 \x03(\tB\xe9\x01\n\"com.google.cloud.securitycenter.v1B\x0f\x43hokepointProtoP\x01ZJcloud.google.com/go/securitycenter/apiv1/securitycenterpb;securitycenterpb\xaa\x02\x1eGoogle.Cloud.SecurityCenter.V1\xca\x02\x1eGoogle\\Cloud\\SecurityCenter\\V1\xea\x02!Google::Cloud::SecurityCenter::V1b\x06proto3" + +pool = ::Google::Protobuf::DescriptorPool.generated_pool +pool.add_serialized_file(descriptor_data) + +module Google + module Cloud + module SecurityCenter + module V1 + Chokepoint = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.securitycenter.v1.Chokepoint").msgclass + end + end + end +end diff --git a/owl-bot-staging/google-cloud-security_center-v1/lib/google/cloud/securitycenter/v1/cloud_armor_pb.rb b/owl-bot-staging/google-cloud-security_center-v1/lib/google/cloud/securitycenter/v1/cloud_armor_pb.rb new file mode 100644 index 000000000000..5d2aca35a2a8 --- /dev/null +++ b/owl-bot-staging/google-cloud-security_center-v1/lib/google/cloud/securitycenter/v1/cloud_armor_pb.rb @@ -0,0 +1,27 @@ +# frozen_string_literal: true +# Generated by the protocol buffer compiler. DO NOT EDIT! +# source: google/cloud/securitycenter/v1/cloud_armor.proto + +require 'google/protobuf' + +require 'google/protobuf/duration_pb' + + +descriptor_data = "\n0google/cloud/securitycenter/v1/cloud_armor.proto\x12\x1egoogle.cloud.securitycenter.v1\x1a\x1egoogle/protobuf/duration.proto\"\xde\x02\n\nCloudArmor\x12G\n\x0fsecurity_policy\x18\x01 \x01(\x0b\x32..google.cloud.securitycenter.v1.SecurityPolicy\x12:\n\x08requests\x18\x02 \x01(\x0b\x32(.google.cloud.securitycenter.v1.Requests\x12O\n\x13\x61\x64\x61ptive_protection\x18\x03 \x01(\x0b\x32\x32.google.cloud.securitycenter.v1.AdaptiveProtection\x12\x36\n\x06\x61ttack\x18\x04 \x01(\x0b\x32&.google.cloud.securitycenter.v1.Attack\x12\x15\n\rthreat_vector\x18\x05 \x01(\t\x12+\n\x08\x64uration\x18\x06 \x01(\x0b\x32\x19.google.protobuf.Duration\"=\n\x0eSecurityPolicy\x12\x0c\n\x04name\x18\x01 \x01(\t\x12\x0c\n\x04type\x18\x02 \x01(\t\x12\x0f\n\x07preview\x18\x03 \x01(\x08\"j\n\x08Requests\x12\r\n\x05ratio\x18\x01 \x01(\x01\x12\x1a\n\x12short_term_allowed\x18\x02 \x01(\x05\x12\x19\n\x11long_term_allowed\x18\x03 \x01(\x05\x12\x18\n\x10long_term_denied\x18\x04 \x01(\x05\"(\n\x12\x41\x64\x61ptiveProtection\x12\x12\n\nconfidence\x18\x01 \x01(\x01\"H\n\x06\x41ttack\x12\x12\n\nvolume_pps\x18\x01 \x01(\x05\x12\x12\n\nvolume_bps\x18\x02 \x01(\x05\x12\x16\n\x0e\x63lassification\x18\x03 \x01(\tB\xe9\x01\n\"com.google.cloud.securitycenter.v1B\x0f\x43loudArmorProtoP\x01ZJcloud.google.com/go/securitycenter/apiv1/securitycenterpb;securitycenterpb\xaa\x02\x1eGoogle.Cloud.SecurityCenter.V1\xca\x02\x1eGoogle\\Cloud\\SecurityCenter\\V1\xea\x02!Google::Cloud::SecurityCenter::V1b\x06proto3" + +pool = ::Google::Protobuf::DescriptorPool.generated_pool +pool.add_serialized_file(descriptor_data) + +module Google + module Cloud + module SecurityCenter + module V1 + CloudArmor = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.securitycenter.v1.CloudArmor").msgclass + SecurityPolicy = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.securitycenter.v1.SecurityPolicy").msgclass + Requests = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.securitycenter.v1.Requests").msgclass + AdaptiveProtection = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.securitycenter.v1.AdaptiveProtection").msgclass + Attack = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.securitycenter.v1.Attack").msgclass + end + end + end +end diff --git a/owl-bot-staging/google-cloud-security_center-v1/lib/google/cloud/securitycenter/v1/cloud_dlp_data_profile_pb.rb b/owl-bot-staging/google-cloud-security_center-v1/lib/google/cloud/securitycenter/v1/cloud_dlp_data_profile_pb.rb new file mode 100644 index 000000000000..96dd00769215 --- /dev/null +++ b/owl-bot-staging/google-cloud-security_center-v1/lib/google/cloud/securitycenter/v1/cloud_dlp_data_profile_pb.rb @@ -0,0 +1,27 @@ +# frozen_string_literal: true +# Generated by the protocol buffer compiler. DO NOT EDIT! +# source: google/cloud/securitycenter/v1/cloud_dlp_data_profile.proto + +require 'google/protobuf' + +require 'google/api/resource_pb' + + +descriptor_data = "\n;google/cloud/securitycenter/v1/cloud_dlp_data_profile.proto\x12\x1egoogle.cloud.securitycenter.v1\x1a\x19google/api/resource.proto\"\xb2\x02\n\x13\x43loudDlpDataProfile\x12>\n\x0c\x64\x61ta_profile\x18\x01 \x01(\tB(\xfa\x41%\n#dlp.googleapis.com/TableDataProfile\x12S\n\x0bparent_type\x18\x02 \x01(\x0e\x32>.google.cloud.securitycenter.v1.CloudDlpDataProfile.ParentType\x12<\n\ninfo_types\x18\x03 \x03(\x0b\x32(.google.cloud.securitycenter.v1.InfoType\"H\n\nParentType\x12\x1b\n\x17PARENT_TYPE_UNSPECIFIED\x10\x00\x12\x10\n\x0cORGANIZATION\x10\x01\x12\x0b\n\x07PROJECT\x10\x02\"v\n\x08InfoType\x12\x0c\n\x04name\x18\x01 \x01(\t\x12\x0f\n\x07version\x18\x02 \x01(\t\x12K\n\x11sensitivity_score\x18\x03 \x01(\x0b\x32\x30.google.cloud.securitycenter.v1.SensitivityScore\"\x8a\x02\n\x10SensitivityScore\x12U\n\x05score\x18\x01 \x01(\x0e\x32\x46.google.cloud.securitycenter.v1.SensitivityScore.SensitivityScoreLevel\"\x9e\x01\n\x15SensitivityScoreLevel\x12\'\n#SENSITIVITY_SCORE_LEVEL_UNSPECIFIED\x10\x00\x12\x13\n\x0fSENSITIVITY_LOW\x10\n\x12\x17\n\x13SENSITIVITY_UNKNOWN\x10\x0c\x12\x18\n\x14SENSITIVITY_MODERATE\x10\x14\x12\x14\n\x10SENSITIVITY_HIGH\x10\x1e\x42\x94\x03\n\"com.google.cloud.securitycenter.v1B\x18\x43loudDlpDataProfileProtoP\x01ZJcloud.google.com/go/securitycenter/apiv1/securitycenterpb;securitycenterpb\xaa\x02\x1eGoogle.Cloud.SecurityCenter.V1\xca\x02\x1eGoogle\\Cloud\\SecurityCenter\\V1\xea\x02!Google::Cloud::SecurityCenter::V1\xea\x41\x9e\x01\n#dlp.googleapis.com/TableDataProfile\x12\x30projects/{project}/tableProfiles/{table_profile}\x12\x45projects/{project}/locations/{location}/tableProfiles/{table_profile}b\x06proto3" + +pool = ::Google::Protobuf::DescriptorPool.generated_pool +pool.add_serialized_file(descriptor_data) + +module Google + module Cloud + module SecurityCenter + module V1 + CloudDlpDataProfile = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.securitycenter.v1.CloudDlpDataProfile").msgclass + CloudDlpDataProfile::ParentType = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.securitycenter.v1.CloudDlpDataProfile.ParentType").enummodule + InfoType = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.securitycenter.v1.InfoType").msgclass + SensitivityScore = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.securitycenter.v1.SensitivityScore").msgclass + SensitivityScore::SensitivityScoreLevel = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.securitycenter.v1.SensitivityScore.SensitivityScoreLevel").enummodule + end + end + end +end diff --git a/owl-bot-staging/google-cloud-security_center-v1/lib/google/cloud/securitycenter/v1/cloud_dlp_inspection_pb.rb b/owl-bot-staging/google-cloud-security_center-v1/lib/google/cloud/securitycenter/v1/cloud_dlp_inspection_pb.rb new file mode 100644 index 000000000000..6908abf33a2c --- /dev/null +++ b/owl-bot-staging/google-cloud-security_center-v1/lib/google/cloud/securitycenter/v1/cloud_dlp_inspection_pb.rb @@ -0,0 +1,23 @@ +# frozen_string_literal: true +# Generated by the protocol buffer compiler. DO NOT EDIT! +# source: google/cloud/securitycenter/v1/cloud_dlp_inspection.proto + +require 'google/protobuf' + +require 'google/api/resource_pb' + + +descriptor_data = "\n9google/cloud/securitycenter/v1/cloud_dlp_inspection.proto\x12\x1egoogle.cloud.securitycenter.v1\x1a\x19google/api/resource.proto\"\x88\x01\n\x12\x43loudDlpInspection\x12\x33\n\x0binspect_job\x18\x01 \x01(\tB\x1e\xfa\x41\x1b\n\x19\x64lp.googleapis.com/DlpJob\x12\x11\n\tinfo_type\x18\x02 \x01(\t\x12\x17\n\x0finfo_type_count\x18\x03 \x01(\x03\x12\x11\n\tfull_scan\x18\x04 \x01(\x08\x42\xf0\x02\n\"com.google.cloud.securitycenter.v1B\x17\x43loudDlpInspectionProtoP\x01ZJcloud.google.com/go/securitycenter/apiv1/securitycenterpb;securitycenterpb\xaa\x02\x1eGoogle.Cloud.SecurityCenter.V1\xca\x02\x1eGoogle\\Cloud\\SecurityCenter\\V1\xea\x02!Google::Cloud::SecurityCenter::V1\xea\x41|\n\x19\x64lp.googleapis.com/DlpJob\x12$projects/{project}/dlpJobs/{dlp_job}\x12\x39projects/{project}/locations/{location}/dlpJobs/{dlp_job}b\x06proto3" + +pool = ::Google::Protobuf::DescriptorPool.generated_pool +pool.add_serialized_file(descriptor_data) + +module Google + module Cloud + module SecurityCenter + module V1 + CloudDlpInspection = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.securitycenter.v1.CloudDlpInspection").msgclass + end + end + end +end diff --git a/owl-bot-staging/google-cloud-security_center-v1/lib/google/cloud/securitycenter/v1/compliance_pb.rb b/owl-bot-staging/google-cloud-security_center-v1/lib/google/cloud/securitycenter/v1/compliance_pb.rb new file mode 100644 index 000000000000..db60def7251c --- /dev/null +++ b/owl-bot-staging/google-cloud-security_center-v1/lib/google/cloud/securitycenter/v1/compliance_pb.rb @@ -0,0 +1,21 @@ +# frozen_string_literal: true +# Generated by the protocol buffer compiler. DO NOT EDIT! +# source: google/cloud/securitycenter/v1/compliance.proto + +require 'google/protobuf' + + +descriptor_data = "\n/google/cloud/securitycenter/v1/compliance.proto\x12\x1egoogle.cloud.securitycenter.v1\"<\n\nCompliance\x12\x10\n\x08standard\x18\x01 \x01(\t\x12\x0f\n\x07version\x18\x02 \x01(\t\x12\x0b\n\x03ids\x18\x03 \x03(\tB\xe9\x01\n\"com.google.cloud.securitycenter.v1B\x0f\x43omplianceProtoP\x01ZJcloud.google.com/go/securitycenter/apiv1/securitycenterpb;securitycenterpb\xaa\x02\x1eGoogle.Cloud.SecurityCenter.V1\xca\x02\x1eGoogle\\Cloud\\SecurityCenter\\V1\xea\x02!Google::Cloud::SecurityCenter::V1b\x06proto3" + +pool = ::Google::Protobuf::DescriptorPool.generated_pool +pool.add_serialized_file(descriptor_data) + +module Google + module Cloud + module SecurityCenter + module V1 + Compliance = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.securitycenter.v1.Compliance").msgclass + end + end + end +end diff --git a/owl-bot-staging/google-cloud-security_center-v1/lib/google/cloud/securitycenter/v1/connection_pb.rb b/owl-bot-staging/google-cloud-security_center-v1/lib/google/cloud/securitycenter/v1/connection_pb.rb new file mode 100644 index 000000000000..eb0b9ee52115 --- /dev/null +++ b/owl-bot-staging/google-cloud-security_center-v1/lib/google/cloud/securitycenter/v1/connection_pb.rb @@ -0,0 +1,22 @@ +# frozen_string_literal: true +# Generated by the protocol buffer compiler. DO NOT EDIT! +# source: google/cloud/securitycenter/v1/connection.proto + +require 'google/protobuf' + + +descriptor_data = "\n/google/cloud/securitycenter/v1/connection.proto\x12\x1egoogle.cloud.securitycenter.v1\"\x81\x02\n\nConnection\x12\x16\n\x0e\x64\x65stination_ip\x18\x01 \x01(\t\x12\x18\n\x10\x64\x65stination_port\x18\x02 \x01(\x05\x12\x11\n\tsource_ip\x18\x03 \x01(\t\x12\x13\n\x0bsource_port\x18\x04 \x01(\x05\x12\x45\n\x08protocol\x18\x05 \x01(\x0e\x32\x33.google.cloud.securitycenter.v1.Connection.Protocol\"R\n\x08Protocol\x12\x18\n\x14PROTOCOL_UNSPECIFIED\x10\x00\x12\x08\n\x04ICMP\x10\x01\x12\x07\n\x03TCP\x10\x06\x12\x07\n\x03UDP\x10\x11\x12\x07\n\x03GRE\x10/\x12\x07\n\x03\x45SP\x10\x32\x42\xe9\x01\n\"com.google.cloud.securitycenter.v1B\x0f\x43onnectionProtoP\x01ZJcloud.google.com/go/securitycenter/apiv1/securitycenterpb;securitycenterpb\xaa\x02\x1eGoogle.Cloud.SecurityCenter.V1\xca\x02\x1eGoogle\\Cloud\\SecurityCenter\\V1\xea\x02!Google::Cloud::SecurityCenter::V1b\x06proto3" + +pool = ::Google::Protobuf::DescriptorPool.generated_pool +pool.add_serialized_file(descriptor_data) + +module Google + module Cloud + module SecurityCenter + module V1 + Connection = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.securitycenter.v1.Connection").msgclass + Connection::Protocol = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.securitycenter.v1.Connection.Protocol").enummodule + end + end + end +end diff --git a/owl-bot-staging/google-cloud-security_center-v1/lib/google/cloud/securitycenter/v1/contact_details_pb.rb b/owl-bot-staging/google-cloud-security_center-v1/lib/google/cloud/securitycenter/v1/contact_details_pb.rb new file mode 100644 index 000000000000..82b5fea649e6 --- /dev/null +++ b/owl-bot-staging/google-cloud-security_center-v1/lib/google/cloud/securitycenter/v1/contact_details_pb.rb @@ -0,0 +1,22 @@ +# frozen_string_literal: true +# Generated by the protocol buffer compiler. DO NOT EDIT! +# source: google/cloud/securitycenter/v1/contact_details.proto + +require 'google/protobuf' + + +descriptor_data = "\n4google/cloud/securitycenter/v1/contact_details.proto\x12\x1egoogle.cloud.securitycenter.v1\"K\n\x0e\x43ontactDetails\x12\x39\n\x08\x63ontacts\x18\x01 \x03(\x0b\x32\'.google.cloud.securitycenter.v1.Contact\"\x18\n\x07\x43ontact\x12\r\n\x05\x65mail\x18\x01 \x01(\tB\xed\x01\n\"com.google.cloud.securitycenter.v1B\x13\x43ontactDetailsProtoP\x01ZJcloud.google.com/go/securitycenter/apiv1/securitycenterpb;securitycenterpb\xaa\x02\x1eGoogle.Cloud.SecurityCenter.V1\xca\x02\x1eGoogle\\Cloud\\SecurityCenter\\V1\xea\x02!Google::Cloud::SecurityCenter::V1b\x06proto3" + +pool = ::Google::Protobuf::DescriptorPool.generated_pool +pool.add_serialized_file(descriptor_data) + +module Google + module Cloud + module SecurityCenter + module V1 + ContactDetails = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.securitycenter.v1.ContactDetails").msgclass + Contact = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.securitycenter.v1.Contact").msgclass + end + end + end +end diff --git a/owl-bot-staging/google-cloud-security_center-v1/lib/google/cloud/securitycenter/v1/container_pb.rb b/owl-bot-staging/google-cloud-security_center-v1/lib/google/cloud/securitycenter/v1/container_pb.rb new file mode 100644 index 000000000000..114721a06e25 --- /dev/null +++ b/owl-bot-staging/google-cloud-security_center-v1/lib/google/cloud/securitycenter/v1/container_pb.rb @@ -0,0 +1,24 @@ +# frozen_string_literal: true +# Generated by the protocol buffer compiler. DO NOT EDIT! +# source: google/cloud/securitycenter/v1/container.proto + +require 'google/protobuf' + +require 'google/cloud/securitycenter/v1/label_pb' +require 'google/protobuf/timestamp_pb' + + +descriptor_data = "\n.google/cloud/securitycenter/v1/container.proto\x12\x1egoogle.cloud.securitycenter.v1\x1a*google/cloud/securitycenter/v1/label.proto\x1a\x1fgoogle/protobuf/timestamp.proto\"\xa0\x01\n\tContainer\x12\x0c\n\x04name\x18\x01 \x01(\t\x12\x0b\n\x03uri\x18\x02 \x01(\t\x12\x10\n\x08image_id\x18\x03 \x01(\t\x12\x35\n\x06labels\x18\x04 \x03(\x0b\x32%.google.cloud.securitycenter.v1.Label\x12/\n\x0b\x63reate_time\x18\x05 \x01(\x0b\x32\x1a.google.protobuf.TimestampB\xe8\x01\n\"com.google.cloud.securitycenter.v1B\x0e\x43ontainerProtoP\x01ZJcloud.google.com/go/securitycenter/apiv1/securitycenterpb;securitycenterpb\xaa\x02\x1eGoogle.Cloud.SecurityCenter.V1\xca\x02\x1eGoogle\\Cloud\\SecurityCenter\\V1\xea\x02!Google::Cloud::SecurityCenter::V1b\x06proto3" + +pool = ::Google::Protobuf::DescriptorPool.generated_pool +pool.add_serialized_file(descriptor_data) + +module Google + module Cloud + module SecurityCenter + module V1 + Container = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.securitycenter.v1.Container").msgclass + end + end + end +end diff --git a/owl-bot-staging/google-cloud-security_center-v1/lib/google/cloud/securitycenter/v1/database_pb.rb b/owl-bot-staging/google-cloud-security_center-v1/lib/google/cloud/securitycenter/v1/database_pb.rb new file mode 100644 index 000000000000..14a2d4b30426 --- /dev/null +++ b/owl-bot-staging/google-cloud-security_center-v1/lib/google/cloud/securitycenter/v1/database_pb.rb @@ -0,0 +1,21 @@ +# frozen_string_literal: true +# Generated by the protocol buffer compiler. DO NOT EDIT! +# source: google/cloud/securitycenter/v1/database.proto + +require 'google/protobuf' + + +descriptor_data = "\n-google/cloud/securitycenter/v1/database.proto\x12\x1egoogle.cloud.securitycenter.v1\"s\n\x08\x44\x61tabase\x12\x0c\n\x04name\x18\x01 \x01(\t\x12\x14\n\x0c\x64isplay_name\x18\x02 \x01(\t\x12\x11\n\tuser_name\x18\x03 \x01(\t\x12\r\n\x05query\x18\x04 \x01(\t\x12\x10\n\x08grantees\x18\x05 \x03(\t\x12\x0f\n\x07version\x18\x06 \x01(\tB\xe7\x01\n\"com.google.cloud.securitycenter.v1B\rDatabaseProtoP\x01ZJcloud.google.com/go/securitycenter/apiv1/securitycenterpb;securitycenterpb\xaa\x02\x1eGoogle.Cloud.SecurityCenter.V1\xca\x02\x1eGoogle\\Cloud\\SecurityCenter\\V1\xea\x02!Google::Cloud::SecurityCenter::V1b\x06proto3" + +pool = ::Google::Protobuf::DescriptorPool.generated_pool +pool.add_serialized_file(descriptor_data) + +module Google + module Cloud + module SecurityCenter + module V1 + Database = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.securitycenter.v1.Database").msgclass + end + end + end +end diff --git a/owl-bot-staging/google-cloud-security_center-v1/lib/google/cloud/securitycenter/v1/effective_event_threat_detection_custom_module_pb.rb b/owl-bot-staging/google-cloud-security_center-v1/lib/google/cloud/securitycenter/v1/effective_event_threat_detection_custom_module_pb.rb new file mode 100644 index 000000000000..b7cff88c9276 --- /dev/null +++ b/owl-bot-staging/google-cloud-security_center-v1/lib/google/cloud/securitycenter/v1/effective_event_threat_detection_custom_module_pb.rb @@ -0,0 +1,26 @@ +# frozen_string_literal: true +# Generated by the protocol buffer compiler. DO NOT EDIT! +# source: google/cloud/securitycenter/v1/effective_event_threat_detection_custom_module.proto + +require 'google/protobuf' + +require 'google/api/field_behavior_pb' +require 'google/api/resource_pb' +require 'google/protobuf/struct_pb' + + +descriptor_data = "\nSgoogle/cloud/securitycenter/v1/effective_event_threat_detection_custom_module.proto\x12\x1egoogle.cloud.securitycenter.v1\x1a\x1fgoogle/api/field_behavior.proto\x1a\x19google/api/resource.proto\x1a\x1cgoogle/protobuf/struct.proto\"\xc9\x05\n)EffectiveEventThreatDetectionCustomModule\x12\x11\n\x04name\x18\x01 \x01(\tB\x03\xe0\x41\x03\x12,\n\x06\x63onfig\x18\x02 \x01(\x0b\x32\x17.google.protobuf.StructB\x03\xe0\x41\x03\x12x\n\x10\x65nablement_state\x18\x03 \x01(\x0e\x32Y.google.cloud.securitycenter.v1.EffectiveEventThreatDetectionCustomModule.EnablementStateB\x03\xe0\x41\x03\x12\x11\n\x04type\x18\x04 \x01(\tB\x03\xe0\x41\x03\x12\x19\n\x0c\x64isplay_name\x18\x05 \x01(\tB\x03\xe0\x41\x03\x12\x18\n\x0b\x64\x65scription\x18\x06 \x01(\tB\x03\xe0\x41\x03\"N\n\x0f\x45nablementState\x12 \n\x1c\x45NABLEMENT_STATE_UNSPECIFIED\x10\x00\x12\x0b\n\x07\x45NABLED\x10\x01\x12\x0c\n\x08\x44ISABLED\x10\x02:\xc8\x02\xea\x41\xc4\x02\nGsecuritycenter.googleapis.com/EffectiveEventThreatDetectionCustomModule\x12Yorganizations/{organization}/eventThreatDetectionSettings/effectiveCustomModules/{module}\x12Mfolders/{folder}/eventThreatDetectionSettings/effectiveCustomModules/{module}\x12Oprojects/{project}/eventThreatDetectionSettings/effectiveCustomModules/{module}B\x88\x02\n\"com.google.cloud.securitycenter.v1B.EffectiveEventThreatDetectionCustomModuleProtoP\x01ZJcloud.google.com/go/securitycenter/apiv1/securitycenterpb;securitycenterpb\xaa\x02\x1eGoogle.Cloud.SecurityCenter.V1\xca\x02\x1eGoogle\\Cloud\\SecurityCenter\\V1\xea\x02!Google::Cloud::SecurityCenter::V1b\x06proto3" + +pool = ::Google::Protobuf::DescriptorPool.generated_pool +pool.add_serialized_file(descriptor_data) + +module Google + module Cloud + module SecurityCenter + module V1 + EffectiveEventThreatDetectionCustomModule = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.securitycenter.v1.EffectiveEventThreatDetectionCustomModule").msgclass + EffectiveEventThreatDetectionCustomModule::EnablementState = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.securitycenter.v1.EffectiveEventThreatDetectionCustomModule.EnablementState").enummodule + end + end + end +end diff --git a/owl-bot-staging/google-cloud-security_center-v1/lib/google/cloud/securitycenter/v1/effective_security_health_analytics_custom_module_pb.rb b/owl-bot-staging/google-cloud-security_center-v1/lib/google/cloud/securitycenter/v1/effective_security_health_analytics_custom_module_pb.rb new file mode 100644 index 000000000000..398d13b78b09 --- /dev/null +++ b/owl-bot-staging/google-cloud-security_center-v1/lib/google/cloud/securitycenter/v1/effective_security_health_analytics_custom_module_pb.rb @@ -0,0 +1,26 @@ +# frozen_string_literal: true +# Generated by the protocol buffer compiler. DO NOT EDIT! +# source: google/cloud/securitycenter/v1/effective_security_health_analytics_custom_module.proto + +require 'google/protobuf' + +require 'google/api/field_behavior_pb' +require 'google/api/resource_pb' +require 'google/cloud/securitycenter/v1/security_health_analytics_custom_config_pb' + + +descriptor_data = "\nVgoogle/cloud/securitycenter/v1/effective_security_health_analytics_custom_module.proto\x12\x1egoogle.cloud.securitycenter.v1\x1a\x1fgoogle/api/field_behavior.proto\x1a\x19google/api/resource.proto\x1aLgoogle/cloud/securitycenter/v1/security_health_analytics_custom_config.proto\"\xfd\x05\n,EffectiveSecurityHealthAnalyticsCustomModule\x12\x11\n\x04name\x18\x01 \x01(\tB\x03\xe0\x41\x03\x12H\n\rcustom_config\x18\x02 \x01(\x0b\x32,.google.cloud.securitycenter.v1.CustomConfigB\x03\xe0\x41\x03\x12{\n\x10\x65nablement_state\x18\x03 \x01(\x0e\x32\\.google.cloud.securitycenter.v1.EffectiveSecurityHealthAnalyticsCustomModule.EnablementStateB\x03\xe0\x41\x03\x12\x19\n\x0c\x64isplay_name\x18\x04 \x01(\tB\x03\xe0\x41\x03\"N\n\x0f\x45nablementState\x12 \n\x1c\x45NABLEMENT_STATE_UNSPECIFIED\x10\x00\x12\x0b\n\x07\x45NABLED\x10\x01\x12\x0c\n\x08\x44ISABLED\x10\x02:\x87\x03\xea\x41\x83\x03\nJsecuritycenter.googleapis.com/EffectiveSecurityHealthAnalyticsCustomModule\x12morganizations/{organization}/securityHealthAnalyticsSettings/effectiveCustomModules/{effective_custom_module}\x12\x61\x66olders/{folder}/securityHealthAnalyticsSettings/effectiveCustomModules/{effective_custom_module}\x12\x63projects/{project}/securityHealthAnalyticsSettings/effectiveCustomModules/{effective_custom_module}B\x8b\x02\n\"com.google.cloud.securitycenter.v1B1EffectiveSecurityHealthAnalyticsCustomModuleProtoP\x01ZJcloud.google.com/go/securitycenter/apiv1/securitycenterpb;securitycenterpb\xaa\x02\x1eGoogle.Cloud.SecurityCenter.V1\xca\x02\x1eGoogle\\Cloud\\SecurityCenter\\V1\xea\x02!Google::Cloud::SecurityCenter::V1b\x06proto3" + +pool = ::Google::Protobuf::DescriptorPool.generated_pool +pool.add_serialized_file(descriptor_data) + +module Google + module Cloud + module SecurityCenter + module V1 + EffectiveSecurityHealthAnalyticsCustomModule = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.securitycenter.v1.EffectiveSecurityHealthAnalyticsCustomModule").msgclass + EffectiveSecurityHealthAnalyticsCustomModule::EnablementState = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.securitycenter.v1.EffectiveSecurityHealthAnalyticsCustomModule.EnablementState").enummodule + end + end + end +end diff --git a/owl-bot-staging/google-cloud-security_center-v1/lib/google/cloud/securitycenter/v1/event_threat_detection_custom_module_pb.rb b/owl-bot-staging/google-cloud-security_center-v1/lib/google/cloud/securitycenter/v1/event_threat_detection_custom_module_pb.rb new file mode 100644 index 000000000000..2b24bf1f56c4 --- /dev/null +++ b/owl-bot-staging/google-cloud-security_center-v1/lib/google/cloud/securitycenter/v1/event_threat_detection_custom_module_pb.rb @@ -0,0 +1,27 @@ +# frozen_string_literal: true +# Generated by the protocol buffer compiler. DO NOT EDIT! +# source: google/cloud/securitycenter/v1/event_threat_detection_custom_module.proto + +require 'google/protobuf' + +require 'google/api/field_behavior_pb' +require 'google/api/resource_pb' +require 'google/protobuf/struct_pb' +require 'google/protobuf/timestamp_pb' + + +descriptor_data = "\nIgoogle/cloud/securitycenter/v1/event_threat_detection_custom_module.proto\x12\x1egoogle.cloud.securitycenter.v1\x1a\x1fgoogle/api/field_behavior.proto\x1a\x19google/api/resource.proto\x1a\x1cgoogle/protobuf/struct.proto\x1a\x1fgoogle/protobuf/timestamp.proto\"\xba\x06\n EventThreatDetectionCustomModule\x12\x11\n\x04name\x18\x01 \x01(\tB\x03\xe0\x41\x05\x12\'\n\x06\x63onfig\x18\x02 \x01(\x0b\x32\x17.google.protobuf.Struct\x12_\n\x0f\x61ncestor_module\x18\x03 \x01(\tBF\xe0\x41\x03\xfa\x41@\n>securitycenter.googleapis.com/EventThreatDetectionCustomModule\x12j\n\x10\x65nablement_state\x18\x04 \x01(\x0e\x32P.google.cloud.securitycenter.v1.EventThreatDetectionCustomModule.EnablementState\x12\x0c\n\x04type\x18\x05 \x01(\t\x12\x14\n\x0c\x64isplay_name\x18\x06 \x01(\t\x12\x13\n\x0b\x64\x65scription\x18\x07 \x01(\t\x12\x34\n\x0bupdate_time\x18\x08 \x01(\x0b\x32\x1a.google.protobuf.TimestampB\x03\xe0\x41\x03\x12\x18\n\x0blast_editor\x18\t \x01(\tB\x03\xe0\x41\x03\"]\n\x0f\x45nablementState\x12 \n\x1c\x45NABLEMENT_STATE_UNSPECIFIED\x10\x00\x12\x0b\n\x07\x45NABLED\x10\x01\x12\x0c\n\x08\x44ISABLED\x10\x02\x12\r\n\tINHERITED\x10\x03:\xa4\x02\xea\x41\xa0\x02\n>securitycenter.googleapis.com/EventThreatDetectionCustomModule\x12Porganizations/{organization}/eventThreatDetectionSettings/customModules/{module}\x12\x44\x66olders/{folder}/eventThreatDetectionSettings/customModules/{module}\x12\x46projects/{project}/eventThreatDetectionSettings/customModules/{module}B\xff\x01\n\"com.google.cloud.securitycenter.v1B%EventThreatDetectionCustomModuleProtoP\x01ZJcloud.google.com/go/securitycenter/apiv1/securitycenterpb;securitycenterpb\xaa\x02\x1eGoogle.Cloud.SecurityCenter.V1\xca\x02\x1eGoogle\\Cloud\\SecurityCenter\\V1\xea\x02!Google::Cloud::SecurityCenter::V1b\x06proto3" + +pool = ::Google::Protobuf::DescriptorPool.generated_pool +pool.add_serialized_file(descriptor_data) + +module Google + module Cloud + module SecurityCenter + module V1 + EventThreatDetectionCustomModule = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.securitycenter.v1.EventThreatDetectionCustomModule").msgclass + EventThreatDetectionCustomModule::EnablementState = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.securitycenter.v1.EventThreatDetectionCustomModule.EnablementState").enummodule + end + end + end +end diff --git a/owl-bot-staging/google-cloud-security_center-v1/lib/google/cloud/securitycenter/v1/event_threat_detection_custom_module_validation_errors_pb.rb b/owl-bot-staging/google-cloud-security_center-v1/lib/google/cloud/securitycenter/v1/event_threat_detection_custom_module_validation_errors_pb.rb new file mode 100644 index 000000000000..d900e952525b --- /dev/null +++ b/owl-bot-staging/google-cloud-security_center-v1/lib/google/cloud/securitycenter/v1/event_threat_detection_custom_module_validation_errors_pb.rb @@ -0,0 +1,23 @@ +# frozen_string_literal: true +# Generated by the protocol buffer compiler. DO NOT EDIT! +# source: google/cloud/securitycenter/v1/event_threat_detection_custom_module_validation_errors.proto + +require 'google/protobuf' + + +descriptor_data = "\n[google/cloud/securitycenter/v1/event_threat_detection_custom_module_validation_errors.proto\x12\x1egoogle.cloud.securitycenter.v1\"k\n\x1c\x43ustomModuleValidationErrors\x12K\n\x06\x65rrors\x18\x01 \x03(\x0b\x32;.google.cloud.securitycenter.v1.CustomModuleValidationError\"\xd2\x01\n\x1b\x43ustomModuleValidationError\x12\x13\n\x0b\x64\x65scription\x18\x01 \x01(\t\x12\x12\n\nfield_path\x18\x02 \x01(\t\x12<\n\x05start\x18\x03 \x01(\x0b\x32(.google.cloud.securitycenter.v1.PositionH\x00\x88\x01\x01\x12:\n\x03\x65nd\x18\x04 \x01(\x0b\x32(.google.cloud.securitycenter.v1.PositionH\x01\x88\x01\x01\x42\x08\n\x06_startB\x06\n\x04_end\"6\n\x08Position\x12\x13\n\x0bline_number\x18\x01 \x01(\x05\x12\x15\n\rcolumn_number\x18\x02 \x01(\x05\x42\x8f\x02\n\"com.google.cloud.securitycenter.v1B5EventThreatDetectionCustomModuleValidationErrorsProtoP\x01ZJcloud.google.com/go/securitycenter/apiv1/securitycenterpb;securitycenterpb\xaa\x02\x1eGoogle.Cloud.SecurityCenter.V1\xca\x02\x1eGoogle\\Cloud\\SecurityCenter\\V1\xea\x02!Google::Cloud::SecurityCenter::V1b\x06proto3" + +pool = ::Google::Protobuf::DescriptorPool.generated_pool +pool.add_serialized_file(descriptor_data) + +module Google + module Cloud + module SecurityCenter + module V1 + CustomModuleValidationErrors = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.securitycenter.v1.CustomModuleValidationErrors").msgclass + CustomModuleValidationError = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.securitycenter.v1.CustomModuleValidationError").msgclass + Position = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.securitycenter.v1.Position").msgclass + end + end + end +end diff --git a/owl-bot-staging/google-cloud-security_center-v1/lib/google/cloud/securitycenter/v1/exfiltration_pb.rb b/owl-bot-staging/google-cloud-security_center-v1/lib/google/cloud/securitycenter/v1/exfiltration_pb.rb new file mode 100644 index 000000000000..f444b911b8fd --- /dev/null +++ b/owl-bot-staging/google-cloud-security_center-v1/lib/google/cloud/securitycenter/v1/exfiltration_pb.rb @@ -0,0 +1,22 @@ +# frozen_string_literal: true +# Generated by the protocol buffer compiler. DO NOT EDIT! +# source: google/cloud/securitycenter/v1/exfiltration.proto + +require 'google/protobuf' + + +descriptor_data = "\n1google/cloud/securitycenter/v1/exfiltration.proto\x12\x1egoogle.cloud.securitycenter.v1\"\xaf\x01\n\x0c\x45xfiltration\x12>\n\x07sources\x18\x01 \x03(\x0b\x32-.google.cloud.securitycenter.v1.ExfilResource\x12>\n\x07targets\x18\x02 \x03(\x0b\x32-.google.cloud.securitycenter.v1.ExfilResource\x12\x1f\n\x17total_exfiltrated_bytes\x18\x03 \x01(\x03\"1\n\rExfilResource\x12\x0c\n\x04name\x18\x01 \x01(\t\x12\x12\n\ncomponents\x18\x02 \x03(\tB\xeb\x01\n\"com.google.cloud.securitycenter.v1B\x11\x45xfiltrationProtoP\x01ZJcloud.google.com/go/securitycenter/apiv1/securitycenterpb;securitycenterpb\xaa\x02\x1eGoogle.Cloud.SecurityCenter.V1\xca\x02\x1eGoogle\\Cloud\\SecurityCenter\\V1\xea\x02!Google::Cloud::SecurityCenter::V1b\x06proto3" + +pool = ::Google::Protobuf::DescriptorPool.generated_pool +pool.add_serialized_file(descriptor_data) + +module Google + module Cloud + module SecurityCenter + module V1 + Exfiltration = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.securitycenter.v1.Exfiltration").msgclass + ExfilResource = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.securitycenter.v1.ExfilResource").msgclass + end + end + end +end diff --git a/owl-bot-staging/google-cloud-security_center-v1/lib/google/cloud/securitycenter/v1/external_exposure_pb.rb b/owl-bot-staging/google-cloud-security_center-v1/lib/google/cloud/securitycenter/v1/external_exposure_pb.rb new file mode 100644 index 000000000000..637251a7df01 --- /dev/null +++ b/owl-bot-staging/google-cloud-security_center-v1/lib/google/cloud/securitycenter/v1/external_exposure_pb.rb @@ -0,0 +1,23 @@ +# frozen_string_literal: true +# Generated by the protocol buffer compiler. DO NOT EDIT! +# source: google/cloud/securitycenter/v1/external_exposure.proto + +require 'google/protobuf' + +require 'google/api/field_info_pb' + + +descriptor_data = "\n6google/cloud/securitycenter/v1/external_exposure.proto\x12\x1egoogle.cloud.securitycenter.v1\x1a\x1bgoogle/api/field_info.proto\"\xed\x02\n\x10\x45xternalExposure\x12$\n\x12private_ip_address\x18\x01 \x01(\tB\x08\xe2\x8c\xcf\xd7\x08\x02\x08\x04\x12\x14\n\x0cprivate_port\x18\x02 \x01(\t\x12\x17\n\x0f\x65xposed_service\x18\x03 \x01(\t\x12#\n\x11public_ip_address\x18\x04 \x01(\tB\x08\xe2\x8c\xcf\xd7\x08\x02\x08\x04\x12\x13\n\x0bpublic_port\x18\x05 \x01(\t\x12\x18\n\x10\x65xposed_endpoint\x18\x06 \x01(\t\x12%\n\x1dload_balancer_firewall_policy\x18\x07 \x01(\t\x12\x1f\n\x17service_firewall_policy\x18\x08 \x01(\t\x12\x17\n\x0f\x66orwarding_rule\x18\t \x01(\t\x12\x17\n\x0f\x62\x61\x63kend_service\x18\n \x01(\t\x12\x16\n\x0einstance_group\x18\x0b \x01(\t\x12\x1e\n\x16network_endpoint_group\x18\x0c \x01(\tB\xef\x01\n\"com.google.cloud.securitycenter.v1B\x15\x45xternalExposureProtoP\x01ZJcloud.google.com/go/securitycenter/apiv1/securitycenterpb;securitycenterpb\xaa\x02\x1eGoogle.Cloud.SecurityCenter.V1\xca\x02\x1eGoogle\\Cloud\\SecurityCenter\\V1\xea\x02!Google::Cloud::SecurityCenter::V1b\x06proto3" + +pool = ::Google::Protobuf::DescriptorPool.generated_pool +pool.add_serialized_file(descriptor_data) + +module Google + module Cloud + module SecurityCenter + module V1 + ExternalExposure = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.securitycenter.v1.ExternalExposure").msgclass + end + end + end +end diff --git a/owl-bot-staging/google-cloud-security_center-v1/lib/google/cloud/securitycenter/v1/external_system_pb.rb b/owl-bot-staging/google-cloud-security_center-v1/lib/google/cloud/securitycenter/v1/external_system_pb.rb new file mode 100644 index 000000000000..6b43636594f3 --- /dev/null +++ b/owl-bot-staging/google-cloud-security_center-v1/lib/google/cloud/securitycenter/v1/external_system_pb.rb @@ -0,0 +1,25 @@ +# frozen_string_literal: true +# Generated by the protocol buffer compiler. DO NOT EDIT! +# source: google/cloud/securitycenter/v1/external_system.proto + +require 'google/protobuf' + +require 'google/api/resource_pb' +require 'google/protobuf/timestamp_pb' + + +descriptor_data = "\n4google/cloud/securitycenter/v1/external_system.proto\x12\x1egoogle.cloud.securitycenter.v1\x1a\x19google/api/resource.proto\x1a\x1fgoogle/protobuf/timestamp.proto\"\xa3\x07\n\x0e\x45xternalSystem\x12\x0c\n\x04name\x18\x01 \x01(\t\x12\x11\n\tassignees\x18\x02 \x03(\t\x12\x14\n\x0c\x65xternal_uid\x18\x03 \x01(\t\x12\x0e\n\x06status\x18\x04 \x01(\t\x12?\n\x1b\x65xternal_system_update_time\x18\x05 \x01(\x0b\x32\x1a.google.protobuf.Timestamp\x12\x10\n\x08\x63\x61se_uri\x18\x06 \x01(\t\x12\x15\n\rcase_priority\x18\x07 \x01(\t\x12,\n\x08\x63\x61se_sla\x18\t \x01(\x0b\x32\x1a.google.protobuf.Timestamp\x12\x34\n\x10\x63\x61se_create_time\x18\n \x01(\x0b\x32\x1a.google.protobuf.Timestamp\x12\x33\n\x0f\x63\x61se_close_time\x18\x0b \x01(\x0b\x32\x1a.google.protobuf.Timestamp\x12N\n\x0bticket_info\x18\x08 \x01(\x0b\x32\x39.google.cloud.securitycenter.v1.ExternalSystem.TicketInfo\x1a\x8d\x01\n\nTicketInfo\x12\n\n\x02id\x18\x01 \x01(\t\x12\x10\n\x08\x61ssignee\x18\x02 \x01(\t\x12\x13\n\x0b\x64\x65scription\x18\x03 \x01(\t\x12\x0b\n\x03uri\x18\x04 \x01(\t\x12\x0e\n\x06status\x18\x05 \x01(\t\x12/\n\x0bupdate_time\x18\x06 \x01(\x0b\x32\x1a.google.protobuf.Timestamp:\xe6\x02\xea\x41\xe2\x02\n,securitycenter.googleapis.com/ExternalSystem\x12\x61organizations/{organization}/sources/{source}/findings/{finding}/externalSystems/{externalsystem}\x12Ufolders/{folder}/sources/{source}/findings/{finding}/externalSystems/{externalsystem}\x12Wprojects/{project}/sources/{source}/findings/{finding}/externalSystems/{externalsystem}*\x0f\x65xternalSystems2\x0e\x65xternalSystemB\xed\x01\n\"com.google.cloud.securitycenter.v1B\x13\x45xternalSystemProtoP\x01ZJcloud.google.com/go/securitycenter/apiv1/securitycenterpb;securitycenterpb\xaa\x02\x1eGoogle.Cloud.SecurityCenter.V1\xca\x02\x1eGoogle\\Cloud\\SecurityCenter\\V1\xea\x02!Google::Cloud::SecurityCenter::V1b\x06proto3" + +pool = ::Google::Protobuf::DescriptorPool.generated_pool +pool.add_serialized_file(descriptor_data) + +module Google + module Cloud + module SecurityCenter + module V1 + ExternalSystem = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.securitycenter.v1.ExternalSystem").msgclass + ExternalSystem::TicketInfo = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.securitycenter.v1.ExternalSystem.TicketInfo").msgclass + end + end + end +end diff --git a/owl-bot-staging/google-cloud-security_center-v1/lib/google/cloud/securitycenter/v1/file_pb.rb b/owl-bot-staging/google-cloud-security_center-v1/lib/google/cloud/securitycenter/v1/file_pb.rb new file mode 100644 index 000000000000..1b28cd79a63b --- /dev/null +++ b/owl-bot-staging/google-cloud-security_center-v1/lib/google/cloud/securitycenter/v1/file_pb.rb @@ -0,0 +1,22 @@ +# frozen_string_literal: true +# Generated by the protocol buffer compiler. DO NOT EDIT! +# source: google/cloud/securitycenter/v1/file.proto + +require 'google/protobuf' + + +descriptor_data = "\n)google/cloud/securitycenter/v1/file.proto\x12\x1egoogle.cloud.securitycenter.v1\"\xf0\x01\n\x04\x46ile\x12\x0c\n\x04path\x18\x01 \x01(\t\x12\x0c\n\x04size\x18\x02 \x01(\x03\x12\x0e\n\x06sha256\x18\x03 \x01(\t\x12\x13\n\x0bhashed_size\x18\x04 \x01(\x03\x12\x18\n\x10partially_hashed\x18\x05 \x01(\x08\x12\x10\n\x08\x63ontents\x18\x06 \x01(\t\x12@\n\tdisk_path\x18\x07 \x01(\x0b\x32-.google.cloud.securitycenter.v1.File.DiskPath\x1a\x39\n\x08\x44iskPath\x12\x16\n\x0epartition_uuid\x18\x01 \x01(\t\x12\x15\n\rrelative_path\x18\x02 \x01(\tB\xe3\x01\n\"com.google.cloud.securitycenter.v1B\tFileProtoP\x01ZJcloud.google.com/go/securitycenter/apiv1/securitycenterpb;securitycenterpb\xaa\x02\x1eGoogle.Cloud.SecurityCenter.V1\xca\x02\x1eGoogle\\Cloud\\SecurityCenter\\V1\xea\x02!Google::Cloud::SecurityCenter::V1b\x06proto3" + +pool = ::Google::Protobuf::DescriptorPool.generated_pool +pool.add_serialized_file(descriptor_data) + +module Google + module Cloud + module SecurityCenter + module V1 + File = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.securitycenter.v1.File").msgclass + File::DiskPath = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.securitycenter.v1.File.DiskPath").msgclass + end + end + end +end diff --git a/owl-bot-staging/google-cloud-security_center-v1/lib/google/cloud/securitycenter/v1/finding_pb.rb b/owl-bot-staging/google-cloud-security_center-v1/lib/google/cloud/securitycenter/v1/finding_pb.rb new file mode 100644 index 000000000000..07d8c81a0ec8 --- /dev/null +++ b/owl-bot-staging/google-cloud-security_center-v1/lib/google/cloud/securitycenter/v1/finding_pb.rb @@ -0,0 +1,65 @@ +# frozen_string_literal: true +# Generated by the protocol buffer compiler. DO NOT EDIT! +# source: google/cloud/securitycenter/v1/finding.proto + +require 'google/protobuf' + +require 'google/api/field_behavior_pb' +require 'google/api/resource_pb' +require 'google/cloud/securitycenter/v1/access_pb' +require 'google/cloud/securitycenter/v1/application_pb' +require 'google/cloud/securitycenter/v1/attack_exposure_pb' +require 'google/cloud/securitycenter/v1/backup_disaster_recovery_pb' +require 'google/cloud/securitycenter/v1/chokepoint_pb' +require 'google/cloud/securitycenter/v1/cloud_armor_pb' +require 'google/cloud/securitycenter/v1/cloud_dlp_data_profile_pb' +require 'google/cloud/securitycenter/v1/cloud_dlp_inspection_pb' +require 'google/cloud/securitycenter/v1/compliance_pb' +require 'google/cloud/securitycenter/v1/connection_pb' +require 'google/cloud/securitycenter/v1/contact_details_pb' +require 'google/cloud/securitycenter/v1/container_pb' +require 'google/cloud/securitycenter/v1/database_pb' +require 'google/cloud/securitycenter/v1/exfiltration_pb' +require 'google/cloud/securitycenter/v1/external_exposure_pb' +require 'google/cloud/securitycenter/v1/external_system_pb' +require 'google/cloud/securitycenter/v1/file_pb' +require 'google/cloud/securitycenter/v1/group_membership_pb' +require 'google/cloud/securitycenter/v1/iam_binding_pb' +require 'google/cloud/securitycenter/v1/indicator_pb' +require 'google/cloud/securitycenter/v1/kernel_rootkit_pb' +require 'google/cloud/securitycenter/v1/kubernetes_pb' +require 'google/cloud/securitycenter/v1/load_balancer_pb' +require 'google/cloud/securitycenter/v1/log_entry_pb' +require 'google/cloud/securitycenter/v1/mitre_attack_pb' +require 'google/cloud/securitycenter/v1/notebook_pb' +require 'google/cloud/securitycenter/v1/org_policy_pb' +require 'google/cloud/securitycenter/v1/process_pb' +require 'google/cloud/securitycenter/v1/security_marks_pb' +require 'google/cloud/securitycenter/v1/security_posture_pb' +require 'google/cloud/securitycenter/v1/toxic_combination_pb' +require 'google/cloud/securitycenter/v1/vulnerability_pb' +require 'google/protobuf/struct_pb' +require 'google/protobuf/timestamp_pb' + + +descriptor_data = "\n,google/cloud/securitycenter/v1/finding.proto\x12\x1egoogle.cloud.securitycenter.v1\x1a\x1fgoogle/api/field_behavior.proto\x1a\x19google/api/resource.proto\x1a+google/cloud/securitycenter/v1/access.proto\x1a\x30google/cloud/securitycenter/v1/application.proto\x1a\x34google/cloud/securitycenter/v1/attack_exposure.proto\x1a=google/cloud/securitycenter/v1/backup_disaster_recovery.proto\x1a/google/cloud/securitycenter/v1/chokepoint.proto\x1a\x30google/cloud/securitycenter/v1/cloud_armor.proto\x1a;google/cloud/securitycenter/v1/cloud_dlp_data_profile.proto\x1a\x39google/cloud/securitycenter/v1/cloud_dlp_inspection.proto\x1a/google/cloud/securitycenter/v1/compliance.proto\x1a/google/cloud/securitycenter/v1/connection.proto\x1a\x34google/cloud/securitycenter/v1/contact_details.proto\x1a.google/cloud/securitycenter/v1/container.proto\x1a-google/cloud/securitycenter/v1/database.proto\x1a\x31google/cloud/securitycenter/v1/exfiltration.proto\x1a\x36google/cloud/securitycenter/v1/external_exposure.proto\x1a\x34google/cloud/securitycenter/v1/external_system.proto\x1a)google/cloud/securitycenter/v1/file.proto\x1a\x35google/cloud/securitycenter/v1/group_membership.proto\x1a\x30google/cloud/securitycenter/v1/iam_binding.proto\x1a.google/cloud/securitycenter/v1/indicator.proto\x1a\x33google/cloud/securitycenter/v1/kernel_rootkit.proto\x1a/google/cloud/securitycenter/v1/kubernetes.proto\x1a\x32google/cloud/securitycenter/v1/load_balancer.proto\x1a.google/cloud/securitycenter/v1/log_entry.proto\x1a\x31google/cloud/securitycenter/v1/mitre_attack.proto\x1a-google/cloud/securitycenter/v1/notebook.proto\x1a/google/cloud/securitycenter/v1/org_policy.proto\x1a,google/cloud/securitycenter/v1/process.proto\x1a\x33google/cloud/securitycenter/v1/security_marks.proto\x1a\x35google/cloud/securitycenter/v1/security_posture.proto\x1a\x36google/cloud/securitycenter/v1/toxic_combination.proto\x1a\x32google/cloud/securitycenter/v1/vulnerability.proto\x1a\x1cgoogle/protobuf/struct.proto\x1a\x1fgoogle/protobuf/timestamp.proto\"\xd8\"\n\x07\x46inding\x12\x0c\n\x04name\x18\x01 \x01(\t\x12\x0e\n\x06parent\x18\x02 \x01(\t\x12\x15\n\rresource_name\x18\x03 \x01(\t\x12<\n\x05state\x18\x04 \x01(\x0e\x32-.google.cloud.securitycenter.v1.Finding.State\x12\x10\n\x08\x63\x61tegory\x18\x05 \x01(\t\x12\x14\n\x0c\x65xternal_uri\x18\x06 \x01(\t\x12X\n\x11source_properties\x18\x07 \x03(\x0b\x32=.google.cloud.securitycenter.v1.Finding.SourcePropertiesEntry\x12J\n\x0esecurity_marks\x18\x08 \x01(\x0b\x32-.google.cloud.securitycenter.v1.SecurityMarksB\x03\xe0\x41\x03\x12.\n\nevent_time\x18\t \x01(\x0b\x32\x1a.google.protobuf.Timestamp\x12/\n\x0b\x63reate_time\x18\n \x01(\x0b\x32\x1a.google.protobuf.Timestamp\x12\x42\n\x08severity\x18\x0c \x01(\x0e\x32\x30.google.cloud.securitycenter.v1.Finding.Severity\x12\x16\n\x0e\x63\x61nonical_name\x18\x0e \x01(\t\x12:\n\x04mute\x18\x0f \x01(\x0e\x32,.google.cloud.securitycenter.v1.Finding.Mute\x12K\n\rfinding_class\x18\x11 \x01(\x0e\x32\x34.google.cloud.securitycenter.v1.Finding.FindingClass\x12<\n\tindicator\x18\x12 \x01(\x0b\x32).google.cloud.securitycenter.v1.Indicator\x12\x44\n\rvulnerability\x18\x14 \x01(\x0b\x32-.google.cloud.securitycenter.v1.Vulnerability\x12\x39\n\x10mute_update_time\x18\x15 \x01(\x0b\x32\x1a.google.protobuf.TimestampB\x03\xe0\x41\x03\x12[\n\x10\x65xternal_systems\x18\x16 \x03(\x0b\x32<.google.cloud.securitycenter.v1.Finding.ExternalSystemsEntryB\x03\xe0\x41\x03\x12\x41\n\x0cmitre_attack\x18\x19 \x01(\x0b\x32+.google.cloud.securitycenter.v1.MitreAttack\x12\x36\n\x06\x61\x63\x63\x65ss\x18\x1a \x01(\x0b\x32&.google.cloud.securitycenter.v1.Access\x12?\n\x0b\x63onnections\x18\x1f \x03(\x0b\x32*.google.cloud.securitycenter.v1.Connection\x12\x16\n\x0emute_initiator\x18\x1c \x01(\t\x12H\n\tmute_info\x18= \x01(\x0b\x32\x30.google.cloud.securitycenter.v1.Finding.MuteInfoB\x03\xe0\x41\x03\x12:\n\tprocesses\x18\x1e \x03(\x0b\x32\'.google.cloud.securitycenter.v1.Process\x12L\n\x08\x63ontacts\x18! \x03(\x0b\x32\x35.google.cloud.securitycenter.v1.Finding.ContactsEntryB\x03\xe0\x41\x03\x12?\n\x0b\x63ompliances\x18\" \x03(\x0b\x32*.google.cloud.securitycenter.v1.Compliance\x12 \n\x13parent_display_name\x18$ \x01(\tB\x03\xe0\x41\x03\x12\x13\n\x0b\x64\x65scription\x18% \x01(\t\x12\x42\n\x0c\x65xfiltration\x18& \x01(\x0b\x32,.google.cloud.securitycenter.v1.Exfiltration\x12@\n\x0ciam_bindings\x18\' \x03(\x0b\x32*.google.cloud.securitycenter.v1.IamBinding\x12\x12\n\nnext_steps\x18( \x01(\t\x12\x13\n\x0bmodule_name\x18) \x01(\t\x12=\n\ncontainers\x18* \x03(\x0b\x32).google.cloud.securitycenter.v1.Container\x12>\n\nkubernetes\x18+ \x01(\x0b\x32*.google.cloud.securitycenter.v1.Kubernetes\x12:\n\x08\x64\x61tabase\x18, \x01(\x0b\x32(.google.cloud.securitycenter.v1.Database\x12G\n\x0f\x61ttack_exposure\x18- \x01(\x0b\x32..google.cloud.securitycenter.v1.AttackExposure\x12\x33\n\x05\x66iles\x18. \x03(\x0b\x32$.google.cloud.securitycenter.v1.File\x12P\n\x14\x63loud_dlp_inspection\x18\x30 \x01(\x0b\x32\x32.google.cloud.securitycenter.v1.CloudDlpInspection\x12S\n\x16\x63loud_dlp_data_profile\x18\x31 \x01(\x0b\x32\x33.google.cloud.securitycenter.v1.CloudDlpDataProfile\x12\x45\n\x0ekernel_rootkit\x18\x32 \x01(\x0b\x32-.google.cloud.securitycenter.v1.KernelRootkit\x12?\n\x0corg_policies\x18\x33 \x03(\x0b\x32).google.cloud.securitycenter.v1.OrgPolicy\x12@\n\x0b\x61pplication\x18\x35 \x01(\x0b\x32+.google.cloud.securitycenter.v1.Application\x12X\n\x18\x62\x61\x63kup_disaster_recovery\x18\x37 \x01(\x0b\x32\x36.google.cloud.securitycenter.v1.BackupDisasterRecovery\x12I\n\x10security_posture\x18\x38 \x01(\x0b\x32/.google.cloud.securitycenter.v1.SecurityPosture\x12=\n\x0blog_entries\x18\x39 \x03(\x0b\x32(.google.cloud.securitycenter.v1.LogEntry\x12\x44\n\x0eload_balancers\x18: \x03(\x0b\x32,.google.cloud.securitycenter.v1.LoadBalancer\x12?\n\x0b\x63loud_armor\x18; \x01(\x0b\x32*.google.cloud.securitycenter.v1.CloudArmor\x12:\n\x08notebook\x18? \x01(\x0b\x32(.google.cloud.securitycenter.v1.Notebook\x12K\n\x11toxic_combination\x18@ \x01(\x0b\x32\x30.google.cloud.securitycenter.v1.ToxicCombination\x12J\n\x11group_memberships\x18\x41 \x03(\x0b\x32/.google.cloud.securitycenter.v1.GroupMembership\x12>\n\nchokepoint\x18M \x01(\x0b\x32*.google.cloud.securitycenter.v1.Chokepoint\x12K\n\x11\x65xternal_exposure\x18T \x01(\x0b\x32\x30.google.cloud.securitycenter.v1.ExternalExposure\x1a\x93\x03\n\x08MuteInfo\x12P\n\x0bstatic_mute\x18\x01 \x01(\x0b\x32;.google.cloud.securitycenter.v1.Finding.MuteInfo.StaticMute\x12`\n\x14\x64ynamic_mute_records\x18\x02 \x03(\x0b\x32\x42.google.cloud.securitycenter.v1.Finding.MuteInfo.DynamicMuteRecord\x1ay\n\nStaticMute\x12;\n\x05state\x18\x01 \x01(\x0e\x32,.google.cloud.securitycenter.v1.Finding.Mute\x12.\n\napply_time\x18\x02 \x01(\x0b\x32\x1a.google.protobuf.Timestamp\x1aX\n\x11\x44ynamicMuteRecord\x12\x13\n\x0bmute_config\x18\x01 \x01(\t\x12.\n\nmatch_time\x18\x02 \x01(\x0b\x32\x1a.google.protobuf.Timestamp\x1aO\n\x15SourcePropertiesEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12%\n\x05value\x18\x02 \x01(\x0b\x32\x16.google.protobuf.Value:\x02\x38\x01\x1a\x66\n\x14\x45xternalSystemsEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12=\n\x05value\x18\x02 \x01(\x0b\x32..google.cloud.securitycenter.v1.ExternalSystem:\x02\x38\x01\x1a_\n\rContactsEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12=\n\x05value\x18\x02 \x01(\x0b\x32..google.cloud.securitycenter.v1.ContactDetails:\x02\x38\x01\"8\n\x05State\x12\x15\n\x11STATE_UNSPECIFIED\x10\x00\x12\n\n\x06\x41\x43TIVE\x10\x01\x12\x0c\n\x08INACTIVE\x10\x02\"Q\n\x08Severity\x12\x18\n\x14SEVERITY_UNSPECIFIED\x10\x00\x12\x0c\n\x08\x43RITICAL\x10\x01\x12\x08\n\x04HIGH\x10\x02\x12\n\n\x06MEDIUM\x10\x03\x12\x07\n\x03LOW\x10\x04\"C\n\x04Mute\x12\x14\n\x10MUTE_UNSPECIFIED\x10\x00\x12\t\n\x05MUTED\x10\x01\x12\x0b\n\x07UNMUTED\x10\x02\x12\r\n\tUNDEFINED\x10\x04\"\xf0\x01\n\x0c\x46indingClass\x12\x1d\n\x19\x46INDING_CLASS_UNSPECIFIED\x10\x00\x12\n\n\x06THREAT\x10\x01\x12\x11\n\rVULNERABILITY\x10\x02\x12\x14\n\x10MISCONFIGURATION\x10\x03\x12\x0f\n\x0bOBSERVATION\x10\x04\x12\r\n\tSCC_ERROR\x10\x05\x12\x15\n\x11POSTURE_VIOLATION\x10\x06\x12\x15\n\x11TOXIC_COMBINATION\x10\x07\x12\x17\n\x13SENSITIVE_DATA_RISK\x10\x08\x12\x0e\n\nCHOKEPOINT\x10\t\x12\x15\n\x11\x45XTERNAL_EXPOSURE\x10\n:\xee\x01\xea\x41\xea\x01\n%securitycenter.googleapis.com/Finding\x12@organizations/{organization}/sources/{source}/findings/{finding}\x12\x34\x66olders/{folder}/sources/{source}/findings/{finding}\x12\x36projects/{project}/sources/{source}/findings/{finding}*\x08\x66indings2\x07\x66indingB\xd8\x01\n\"com.google.cloud.securitycenter.v1P\x01ZJcloud.google.com/go/securitycenter/apiv1/securitycenterpb;securitycenterpb\xaa\x02\x1eGoogle.Cloud.SecurityCenter.V1\xca\x02\x1eGoogle\\Cloud\\SecurityCenter\\V1\xea\x02!Google::Cloud::SecurityCenter::V1b\x06proto3" + +pool = ::Google::Protobuf::DescriptorPool.generated_pool +pool.add_serialized_file(descriptor_data) + +module Google + module Cloud + module SecurityCenter + module V1 + Finding = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.securitycenter.v1.Finding").msgclass + Finding::MuteInfo = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.securitycenter.v1.Finding.MuteInfo").msgclass + Finding::MuteInfo::StaticMute = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.securitycenter.v1.Finding.MuteInfo.StaticMute").msgclass + Finding::MuteInfo::DynamicMuteRecord = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.securitycenter.v1.Finding.MuteInfo.DynamicMuteRecord").msgclass + Finding::State = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.securitycenter.v1.Finding.State").enummodule + Finding::Severity = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.securitycenter.v1.Finding.Severity").enummodule + Finding::Mute = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.securitycenter.v1.Finding.Mute").enummodule + Finding::FindingClass = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.securitycenter.v1.Finding.FindingClass").enummodule + end + end + end +end diff --git a/owl-bot-staging/google-cloud-security_center-v1/lib/google/cloud/securitycenter/v1/folder_pb.rb b/owl-bot-staging/google-cloud-security_center-v1/lib/google/cloud/securitycenter/v1/folder_pb.rb new file mode 100644 index 000000000000..e25a1821948f --- /dev/null +++ b/owl-bot-staging/google-cloud-security_center-v1/lib/google/cloud/securitycenter/v1/folder_pb.rb @@ -0,0 +1,21 @@ +# frozen_string_literal: true +# Generated by the protocol buffer compiler. DO NOT EDIT! +# source: google/cloud/securitycenter/v1/folder.proto + +require 'google/protobuf' + + +descriptor_data = "\n+google/cloud/securitycenter/v1/folder.proto\x12\x1egoogle.cloud.securitycenter.v1\"G\n\x06\x46older\x12\x17\n\x0fresource_folder\x18\x01 \x01(\t\x12$\n\x1cresource_folder_display_name\x18\x02 \x01(\tB\xe5\x01\n\"com.google.cloud.securitycenter.v1B\x0b\x46olderProtoP\x01ZJcloud.google.com/go/securitycenter/apiv1/securitycenterpb;securitycenterpb\xaa\x02\x1eGoogle.Cloud.SecurityCenter.V1\xca\x02\x1eGoogle\\Cloud\\SecurityCenter\\V1\xea\x02!Google::Cloud::SecurityCenter::V1b\x06proto3" + +pool = ::Google::Protobuf::DescriptorPool.generated_pool +pool.add_serialized_file(descriptor_data) + +module Google + module Cloud + module SecurityCenter + module V1 + Folder = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.securitycenter.v1.Folder").msgclass + end + end + end +end diff --git a/owl-bot-staging/google-cloud-security_center-v1/lib/google/cloud/securitycenter/v1/group_membership_pb.rb b/owl-bot-staging/google-cloud-security_center-v1/lib/google/cloud/securitycenter/v1/group_membership_pb.rb new file mode 100644 index 000000000000..1f47d17f32d9 --- /dev/null +++ b/owl-bot-staging/google-cloud-security_center-v1/lib/google/cloud/securitycenter/v1/group_membership_pb.rb @@ -0,0 +1,22 @@ +# frozen_string_literal: true +# Generated by the protocol buffer compiler. DO NOT EDIT! +# source: google/cloud/securitycenter/v1/group_membership.proto + +require 'google/protobuf' + + +descriptor_data = "\n5google/cloud/securitycenter/v1/group_membership.proto\x12\x1egoogle.cloud.securitycenter.v1\"\xd8\x01\n\x0fGroupMembership\x12M\n\ngroup_type\x18\x01 \x01(\x0e\x32\x39.google.cloud.securitycenter.v1.GroupMembership.GroupType\x12\x10\n\x08group_id\x18\x02 \x01(\t\"d\n\tGroupType\x12\x1a\n\x16GROUP_TYPE_UNSPECIFIED\x10\x00\x12 \n\x1cGROUP_TYPE_TOXIC_COMBINATION\x10\x01\x12\x19\n\x15GROUP_TYPE_CHOKEPOINT\x10\x03\x42\xee\x01\n\"com.google.cloud.securitycenter.v1B\x14GroupMembershipProtoP\x01ZJcloud.google.com/go/securitycenter/apiv1/securitycenterpb;securitycenterpb\xaa\x02\x1eGoogle.Cloud.SecurityCenter.V1\xca\x02\x1eGoogle\\Cloud\\SecurityCenter\\V1\xea\x02!Google::Cloud::SecurityCenter::V1b\x06proto3" + +pool = ::Google::Protobuf::DescriptorPool.generated_pool +pool.add_serialized_file(descriptor_data) + +module Google + module Cloud + module SecurityCenter + module V1 + GroupMembership = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.securitycenter.v1.GroupMembership").msgclass + GroupMembership::GroupType = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.securitycenter.v1.GroupMembership.GroupType").enummodule + end + end + end +end diff --git a/owl-bot-staging/google-cloud-security_center-v1/lib/google/cloud/securitycenter/v1/iam_binding_pb.rb b/owl-bot-staging/google-cloud-security_center-v1/lib/google/cloud/securitycenter/v1/iam_binding_pb.rb new file mode 100644 index 000000000000..7a11d5d9ab1f --- /dev/null +++ b/owl-bot-staging/google-cloud-security_center-v1/lib/google/cloud/securitycenter/v1/iam_binding_pb.rb @@ -0,0 +1,22 @@ +# frozen_string_literal: true +# Generated by the protocol buffer compiler. DO NOT EDIT! +# source: google/cloud/securitycenter/v1/iam_binding.proto + +require 'google/protobuf' + + +descriptor_data = "\n0google/cloud/securitycenter/v1/iam_binding.proto\x12\x1egoogle.cloud.securitycenter.v1\"\xa4\x01\n\nIamBinding\x12\x41\n\x06\x61\x63tion\x18\x01 \x01(\x0e\x32\x31.google.cloud.securitycenter.v1.IamBinding.Action\x12\x0c\n\x04role\x18\x02 \x01(\t\x12\x0e\n\x06member\x18\x03 \x01(\t\"5\n\x06\x41\x63tion\x12\x16\n\x12\x41\x43TION_UNSPECIFIED\x10\x00\x12\x07\n\x03\x41\x44\x44\x10\x01\x12\n\n\x06REMOVE\x10\x02\x42\xe9\x01\n\"com.google.cloud.securitycenter.v1B\x0fIamBindingProtoP\x01ZJcloud.google.com/go/securitycenter/apiv1/securitycenterpb;securitycenterpb\xaa\x02\x1eGoogle.Cloud.SecurityCenter.V1\xca\x02\x1eGoogle\\Cloud\\SecurityCenter\\V1\xea\x02!Google::Cloud::SecurityCenter::V1b\x06proto3" + +pool = ::Google::Protobuf::DescriptorPool.generated_pool +pool.add_serialized_file(descriptor_data) + +module Google + module Cloud + module SecurityCenter + module V1 + IamBinding = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.securitycenter.v1.IamBinding").msgclass + IamBinding::Action = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.securitycenter.v1.IamBinding.Action").enummodule + end + end + end +end diff --git a/owl-bot-staging/google-cloud-security_center-v1/lib/google/cloud/securitycenter/v1/indicator_pb.rb b/owl-bot-staging/google-cloud-security_center-v1/lib/google/cloud/securitycenter/v1/indicator_pb.rb new file mode 100644 index 000000000000..6fd4289eea6b --- /dev/null +++ b/owl-bot-staging/google-cloud-security_center-v1/lib/google/cloud/securitycenter/v1/indicator_pb.rb @@ -0,0 +1,26 @@ +# frozen_string_literal: true +# Generated by the protocol buffer compiler. DO NOT EDIT! +# source: google/cloud/securitycenter/v1/indicator.proto + +require 'google/protobuf' + + +descriptor_data = "\n.google/cloud/securitycenter/v1/indicator.proto\x12\x1egoogle.cloud.securitycenter.v1\"\xd9\x06\n\tIndicator\x12\x14\n\x0cip_addresses\x18\x01 \x03(\t\x12\x0f\n\x07\x64omains\x18\x02 \x03(\t\x12N\n\nsignatures\x18\x03 \x03(\x0b\x32:.google.cloud.securitycenter.v1.Indicator.ProcessSignature\x12\x0c\n\x04uris\x18\x04 \x03(\t\x1a\xc6\x05\n\x10ProcessSignature\x12o\n\x15memory_hash_signature\x18\x06 \x01(\x0b\x32N.google.cloud.securitycenter.v1.Indicator.ProcessSignature.MemoryHashSignatureH\x00\x12k\n\x13yara_rule_signature\x18\x07 \x01(\x0b\x32L.google.cloud.securitycenter.v1.Indicator.ProcessSignature.YaraRuleSignatureH\x00\x12`\n\x0esignature_type\x18\x08 \x01(\x0e\x32H.google.cloud.securitycenter.v1.Indicator.ProcessSignature.SignatureType\x1a\xd6\x01\n\x13MemoryHashSignature\x12\x15\n\rbinary_family\x18\x01 \x01(\t\x12l\n\ndetections\x18\x04 \x03(\x0b\x32X.google.cloud.securitycenter.v1.Indicator.ProcessSignature.MemoryHashSignature.Detection\x1a:\n\tDetection\x12\x0e\n\x06\x62inary\x18\x02 \x01(\t\x12\x1d\n\x15percent_pages_matched\x18\x03 \x01(\x01\x1a&\n\x11YaraRuleSignature\x12\x11\n\tyara_rule\x18\x05 \x01(\t\"d\n\rSignatureType\x12\x1e\n\x1aSIGNATURE_TYPE_UNSPECIFIED\x10\x00\x12\x1a\n\x16SIGNATURE_TYPE_PROCESS\x10\x01\x12\x17\n\x13SIGNATURE_TYPE_FILE\x10\x02\x42\x0b\n\tsignatureB\xe8\x01\n\"com.google.cloud.securitycenter.v1B\x0eIndicatorProtoP\x01ZJcloud.google.com/go/securitycenter/apiv1/securitycenterpb;securitycenterpb\xaa\x02\x1eGoogle.Cloud.SecurityCenter.V1\xca\x02\x1eGoogle\\Cloud\\SecurityCenter\\V1\xea\x02!Google::Cloud::SecurityCenter::V1b\x06proto3" + +pool = ::Google::Protobuf::DescriptorPool.generated_pool +pool.add_serialized_file(descriptor_data) + +module Google + module Cloud + module SecurityCenter + module V1 + Indicator = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.securitycenter.v1.Indicator").msgclass + Indicator::ProcessSignature = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.securitycenter.v1.Indicator.ProcessSignature").msgclass + Indicator::ProcessSignature::MemoryHashSignature = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.securitycenter.v1.Indicator.ProcessSignature.MemoryHashSignature").msgclass + Indicator::ProcessSignature::MemoryHashSignature::Detection = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.securitycenter.v1.Indicator.ProcessSignature.MemoryHashSignature.Detection").msgclass + Indicator::ProcessSignature::YaraRuleSignature = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.securitycenter.v1.Indicator.ProcessSignature.YaraRuleSignature").msgclass + Indicator::ProcessSignature::SignatureType = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.securitycenter.v1.Indicator.ProcessSignature.SignatureType").enummodule + end + end + end +end diff --git a/owl-bot-staging/google-cloud-security_center-v1/lib/google/cloud/securitycenter/v1/kernel_rootkit_pb.rb b/owl-bot-staging/google-cloud-security_center-v1/lib/google/cloud/securitycenter/v1/kernel_rootkit_pb.rb new file mode 100644 index 000000000000..20e8cb2e66b9 --- /dev/null +++ b/owl-bot-staging/google-cloud-security_center-v1/lib/google/cloud/securitycenter/v1/kernel_rootkit_pb.rb @@ -0,0 +1,21 @@ +# frozen_string_literal: true +# Generated by the protocol buffer compiler. DO NOT EDIT! +# source: google/cloud/securitycenter/v1/kernel_rootkit.proto + +require 'google/protobuf' + + +descriptor_data = "\n3google/cloud/securitycenter/v1/kernel_rootkit.proto\x12\x1egoogle.cloud.securitycenter.v1\"\xd7\x02\n\rKernelRootkit\x12\x0c\n\x04name\x18\x01 \x01(\t\x12$\n\x1cunexpected_code_modification\x18\x02 \x01(\x08\x12.\n&unexpected_read_only_data_modification\x18\x03 \x01(\x08\x12!\n\x19unexpected_ftrace_handler\x18\x04 \x01(\x08\x12!\n\x19unexpected_kprobe_handler\x18\x05 \x01(\x08\x12$\n\x1cunexpected_kernel_code_pages\x18\x06 \x01(\x08\x12&\n\x1eunexpected_system_call_handler\x18\x07 \x01(\x08\x12$\n\x1cunexpected_interrupt_handler\x18\x08 \x01(\x08\x12(\n unexpected_processes_in_runqueue\x18\t \x01(\x08\x42\xec\x01\n\"com.google.cloud.securitycenter.v1B\x12KernelRootkitProtoP\x01ZJcloud.google.com/go/securitycenter/apiv1/securitycenterpb;securitycenterpb\xaa\x02\x1eGoogle.Cloud.SecurityCenter.V1\xca\x02\x1eGoogle\\Cloud\\SecurityCenter\\V1\xea\x02!Google::Cloud::SecurityCenter::V1b\x06proto3" + +pool = ::Google::Protobuf::DescriptorPool.generated_pool +pool.add_serialized_file(descriptor_data) + +module Google + module Cloud + module SecurityCenter + module V1 + KernelRootkit = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.securitycenter.v1.KernelRootkit").msgclass + end + end + end +end diff --git a/owl-bot-staging/google-cloud-security_center-v1/lib/google/cloud/securitycenter/v1/kubernetes_pb.rb b/owl-bot-staging/google-cloud-security_center-v1/lib/google/cloud/securitycenter/v1/kubernetes_pb.rb new file mode 100644 index 000000000000..469575235393 --- /dev/null +++ b/owl-bot-staging/google-cloud-security_center-v1/lib/google/cloud/securitycenter/v1/kubernetes_pb.rb @@ -0,0 +1,34 @@ +# frozen_string_literal: true +# Generated by the protocol buffer compiler. DO NOT EDIT! +# source: google/cloud/securitycenter/v1/kubernetes.proto + +require 'google/protobuf' + +require 'google/cloud/securitycenter/v1/container_pb' +require 'google/cloud/securitycenter/v1/label_pb' + + +descriptor_data = "\n/google/cloud/securitycenter/v1/kubernetes.proto\x12\x1egoogle.cloud.securitycenter.v1\x1a.google/cloud/securitycenter/v1/container.proto\x1a*google/cloud/securitycenter/v1/label.proto\"\x82\x0c\n\nKubernetes\x12<\n\x04pods\x18\x01 \x03(\x0b\x32..google.cloud.securitycenter.v1.Kubernetes.Pod\x12>\n\x05nodes\x18\x02 \x03(\x0b\x32/.google.cloud.securitycenter.v1.Kubernetes.Node\x12G\n\nnode_pools\x18\x03 \x03(\x0b\x32\x33.google.cloud.securitycenter.v1.Kubernetes.NodePool\x12>\n\x05roles\x18\x04 \x03(\x0b\x32/.google.cloud.securitycenter.v1.Kubernetes.Role\x12\x44\n\x08\x62indings\x18\x05 \x03(\x0b\x32\x32.google.cloud.securitycenter.v1.Kubernetes.Binding\x12O\n\x0e\x61\x63\x63\x65ss_reviews\x18\x06 \x03(\x0b\x32\x37.google.cloud.securitycenter.v1.Kubernetes.AccessReview\x12\x42\n\x07objects\x18\x07 \x03(\x0b\x32\x31.google.cloud.securitycenter.v1.Kubernetes.Object\x1a\x95\x01\n\x03Pod\x12\n\n\x02ns\x18\x01 \x01(\t\x12\x0c\n\x04name\x18\x02 \x01(\t\x12\x35\n\x06labels\x18\x03 \x03(\x0b\x32%.google.cloud.securitycenter.v1.Label\x12=\n\ncontainers\x18\x04 \x03(\x0b\x32).google.cloud.securitycenter.v1.Container\x1a\x14\n\x04Node\x12\x0c\n\x04name\x18\x01 \x01(\t\x1aX\n\x08NodePool\x12\x0c\n\x04name\x18\x01 \x01(\t\x12>\n\x05nodes\x18\x02 \x03(\x0b\x32/.google.cloud.securitycenter.v1.Kubernetes.Node\x1a\x9e\x01\n\x04Role\x12\x42\n\x04kind\x18\x01 \x01(\x0e\x32\x34.google.cloud.securitycenter.v1.Kubernetes.Role.Kind\x12\n\n\x02ns\x18\x02 \x01(\t\x12\x0c\n\x04name\x18\x03 \x01(\t\"8\n\x04Kind\x12\x14\n\x10KIND_UNSPECIFIED\x10\x00\x12\x08\n\x04ROLE\x10\x01\x12\x10\n\x0c\x43LUSTER_ROLE\x10\x02\x1a\xa8\x01\n\x07\x42inding\x12\n\n\x02ns\x18\x01 \x01(\t\x12\x0c\n\x04name\x18\x02 \x01(\t\x12=\n\x04role\x18\x03 \x01(\x0b\x32/.google.cloud.securitycenter.v1.Kubernetes.Role\x12\x44\n\x08subjects\x18\x04 \x03(\x0b\x32\x32.google.cloud.securitycenter.v1.Kubernetes.Subject\x1a\xbe\x01\n\x07Subject\x12I\n\x04kind\x18\x01 \x01(\x0e\x32;.google.cloud.securitycenter.v1.Kubernetes.Subject.AuthType\x12\n\n\x02ns\x18\x02 \x01(\t\x12\x0c\n\x04name\x18\x03 \x01(\t\"N\n\x08\x41uthType\x12\x19\n\x15\x41UTH_TYPE_UNSPECIFIED\x10\x00\x12\x08\n\x04USER\x10\x01\x12\x12\n\x0eSERVICEACCOUNT\x10\x02\x12\t\n\x05GROUP\x10\x03\x1a}\n\x0c\x41\x63\x63\x65ssReview\x12\r\n\x05group\x18\x01 \x01(\t\x12\n\n\x02ns\x18\x02 \x01(\t\x12\x0c\n\x04name\x18\x03 \x01(\t\x12\x10\n\x08resource\x18\x04 \x01(\t\x12\x13\n\x0bsubresource\x18\x05 \x01(\t\x12\x0c\n\x04verb\x18\x06 \x01(\t\x12\x0f\n\x07version\x18\x07 \x01(\t\x1a~\n\x06Object\x12\r\n\x05group\x18\x01 \x01(\t\x12\x0c\n\x04kind\x18\x02 \x01(\t\x12\n\n\x02ns\x18\x03 \x01(\t\x12\x0c\n\x04name\x18\x04 \x01(\t\x12=\n\ncontainers\x18\x05 \x03(\x0b\x32).google.cloud.securitycenter.v1.ContainerB\xe9\x01\n\"com.google.cloud.securitycenter.v1B\x0fKubernetesProtoP\x01ZJcloud.google.com/go/securitycenter/apiv1/securitycenterpb;securitycenterpb\xaa\x02\x1eGoogle.Cloud.SecurityCenter.V1\xca\x02\x1eGoogle\\Cloud\\SecurityCenter\\V1\xea\x02!Google::Cloud::SecurityCenter::V1b\x06proto3" + +pool = ::Google::Protobuf::DescriptorPool.generated_pool +pool.add_serialized_file(descriptor_data) + +module Google + module Cloud + module SecurityCenter + module V1 + Kubernetes = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.securitycenter.v1.Kubernetes").msgclass + Kubernetes::Pod = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.securitycenter.v1.Kubernetes.Pod").msgclass + Kubernetes::Node = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.securitycenter.v1.Kubernetes.Node").msgclass + Kubernetes::NodePool = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.securitycenter.v1.Kubernetes.NodePool").msgclass + Kubernetes::Role = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.securitycenter.v1.Kubernetes.Role").msgclass + Kubernetes::Role::Kind = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.securitycenter.v1.Kubernetes.Role.Kind").enummodule + Kubernetes::Binding = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.securitycenter.v1.Kubernetes.Binding").msgclass + Kubernetes::Subject = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.securitycenter.v1.Kubernetes.Subject").msgclass + Kubernetes::Subject::AuthType = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.securitycenter.v1.Kubernetes.Subject.AuthType").enummodule + Kubernetes::AccessReview = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.securitycenter.v1.Kubernetes.AccessReview").msgclass + Kubernetes::Object = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.securitycenter.v1.Kubernetes.Object").msgclass + end + end + end +end diff --git a/owl-bot-staging/google-cloud-security_center-v1/lib/google/cloud/securitycenter/v1/label_pb.rb b/owl-bot-staging/google-cloud-security_center-v1/lib/google/cloud/securitycenter/v1/label_pb.rb new file mode 100644 index 000000000000..814fe4dfd80b --- /dev/null +++ b/owl-bot-staging/google-cloud-security_center-v1/lib/google/cloud/securitycenter/v1/label_pb.rb @@ -0,0 +1,21 @@ +# frozen_string_literal: true +# Generated by the protocol buffer compiler. DO NOT EDIT! +# source: google/cloud/securitycenter/v1/label.proto + +require 'google/protobuf' + + +descriptor_data = "\n*google/cloud/securitycenter/v1/label.proto\x12\x1egoogle.cloud.securitycenter.v1\"$\n\x05Label\x12\x0c\n\x04name\x18\x01 \x01(\t\x12\r\n\x05value\x18\x02 \x01(\tB\xe4\x01\n\"com.google.cloud.securitycenter.v1B\nLabelProtoP\x01ZJcloud.google.com/go/securitycenter/apiv1/securitycenterpb;securitycenterpb\xaa\x02\x1eGoogle.Cloud.SecurityCenter.V1\xca\x02\x1eGoogle\\Cloud\\SecurityCenter\\V1\xea\x02!Google::Cloud::SecurityCenter::V1b\x06proto3" + +pool = ::Google::Protobuf::DescriptorPool.generated_pool +pool.add_serialized_file(descriptor_data) + +module Google + module Cloud + module SecurityCenter + module V1 + Label = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.securitycenter.v1.Label").msgclass + end + end + end +end diff --git a/owl-bot-staging/google-cloud-security_center-v1/lib/google/cloud/securitycenter/v1/load_balancer_pb.rb b/owl-bot-staging/google-cloud-security_center-v1/lib/google/cloud/securitycenter/v1/load_balancer_pb.rb new file mode 100644 index 000000000000..486b320844ef --- /dev/null +++ b/owl-bot-staging/google-cloud-security_center-v1/lib/google/cloud/securitycenter/v1/load_balancer_pb.rb @@ -0,0 +1,21 @@ +# frozen_string_literal: true +# Generated by the protocol buffer compiler. DO NOT EDIT! +# source: google/cloud/securitycenter/v1/load_balancer.proto + +require 'google/protobuf' + + +descriptor_data = "\n2google/cloud/securitycenter/v1/load_balancer.proto\x12\x1egoogle.cloud.securitycenter.v1\"\x1c\n\x0cLoadBalancer\x12\x0c\n\x04name\x18\x01 \x01(\tB\xeb\x01\n\"com.google.cloud.securitycenter.v1B\x11LoadBalancerProtoP\x01ZJcloud.google.com/go/securitycenter/apiv1/securitycenterpb;securitycenterpb\xaa\x02\x1eGoogle.Cloud.SecurityCenter.V1\xca\x02\x1eGoogle\\Cloud\\SecurityCenter\\V1\xea\x02!Google::Cloud::SecurityCenter::V1b\x06proto3" + +pool = ::Google::Protobuf::DescriptorPool.generated_pool +pool.add_serialized_file(descriptor_data) + +module Google + module Cloud + module SecurityCenter + module V1 + LoadBalancer = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.securitycenter.v1.LoadBalancer").msgclass + end + end + end +end diff --git a/owl-bot-staging/google-cloud-security_center-v1/lib/google/cloud/securitycenter/v1/log_entry_pb.rb b/owl-bot-staging/google-cloud-security_center-v1/lib/google/cloud/securitycenter/v1/log_entry_pb.rb new file mode 100644 index 000000000000..edec9da51f37 --- /dev/null +++ b/owl-bot-staging/google-cloud-security_center-v1/lib/google/cloud/securitycenter/v1/log_entry_pb.rb @@ -0,0 +1,24 @@ +# frozen_string_literal: true +# Generated by the protocol buffer compiler. DO NOT EDIT! +# source: google/cloud/securitycenter/v1/log_entry.proto + +require 'google/protobuf' + +require 'google/protobuf/timestamp_pb' + + +descriptor_data = "\n.google/cloud/securitycenter/v1/log_entry.proto\x12\x1egoogle.cloud.securitycenter.v1\x1a\x1fgoogle/protobuf/timestamp.proto\"i\n\x08LogEntry\x12P\n\x13\x63loud_logging_entry\x18\x01 \x01(\x0b\x32\x31.google.cloud.securitycenter.v1.CloudLoggingEntryH\x00\x42\x0b\n\tlog_entry\"\x81\x01\n\x11\x43loudLoggingEntry\x12\x11\n\tinsert_id\x18\x01 \x01(\t\x12\x0e\n\x06log_id\x18\x02 \x01(\t\x12\x1a\n\x12resource_container\x18\x03 \x01(\t\x12-\n\ttimestamp\x18\x04 \x01(\x0b\x32\x1a.google.protobuf.TimestampB\xe7\x01\n\"com.google.cloud.securitycenter.v1B\rLogEntryProtoP\x01ZJcloud.google.com/go/securitycenter/apiv1/securitycenterpb;securitycenterpb\xaa\x02\x1eGoogle.Cloud.SecurityCenter.V1\xca\x02\x1eGoogle\\Cloud\\SecurityCenter\\V1\xea\x02!Google::Cloud::SecurityCenter::V1b\x06proto3" + +pool = ::Google::Protobuf::DescriptorPool.generated_pool +pool.add_serialized_file(descriptor_data) + +module Google + module Cloud + module SecurityCenter + module V1 + LogEntry = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.securitycenter.v1.LogEntry").msgclass + CloudLoggingEntry = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.securitycenter.v1.CloudLoggingEntry").msgclass + end + end + end +end diff --git a/owl-bot-staging/google-cloud-security_center-v1/lib/google/cloud/securitycenter/v1/mitre_attack_pb.rb b/owl-bot-staging/google-cloud-security_center-v1/lib/google/cloud/securitycenter/v1/mitre_attack_pb.rb new file mode 100644 index 000000000000..76a147892b01 --- /dev/null +++ b/owl-bot-staging/google-cloud-security_center-v1/lib/google/cloud/securitycenter/v1/mitre_attack_pb.rb @@ -0,0 +1,23 @@ +# frozen_string_literal: true +# Generated by the protocol buffer compiler. DO NOT EDIT! +# source: google/cloud/securitycenter/v1/mitre_attack.proto + +require 'google/protobuf' + + +descriptor_data = "\n1google/cloud/securitycenter/v1/mitre_attack.proto\x12\x1egoogle.cloud.securitycenter.v1\"\xbc\x13\n\x0bMitreAttack\x12J\n\x0eprimary_tactic\x18\x01 \x01(\x0e\x32\x32.google.cloud.securitycenter.v1.MitreAttack.Tactic\x12Q\n\x12primary_techniques\x18\x02 \x03(\x0e\x32\x35.google.cloud.securitycenter.v1.MitreAttack.Technique\x12N\n\x12\x61\x64\x64itional_tactics\x18\x03 \x03(\x0e\x32\x32.google.cloud.securitycenter.v1.MitreAttack.Tactic\x12T\n\x15\x61\x64\x64itional_techniques\x18\x04 \x03(\x0e\x32\x35.google.cloud.securitycenter.v1.MitreAttack.Technique\x12\x0f\n\x07version\x18\x05 \x01(\t\"\xb4\x02\n\x06Tactic\x12\x16\n\x12TACTIC_UNSPECIFIED\x10\x00\x12\x12\n\x0eRECONNAISSANCE\x10\x01\x12\x18\n\x14RESOURCE_DEVELOPMENT\x10\x02\x12\x12\n\x0eINITIAL_ACCESS\x10\x05\x12\r\n\tEXECUTION\x10\x03\x12\x0f\n\x0bPERSISTENCE\x10\x06\x12\x18\n\x14PRIVILEGE_ESCALATION\x10\x08\x12\x13\n\x0f\x44\x45\x46\x45NSE_EVASION\x10\x07\x12\x15\n\x11\x43REDENTIAL_ACCESS\x10\t\x12\r\n\tDISCOVERY\x10\n\x12\x14\n\x10LATERAL_MOVEMENT\x10\x0b\x12\x0e\n\nCOLLECTION\x10\x0c\x12\x17\n\x13\x43OMMAND_AND_CONTROL\x10\x04\x12\x10\n\x0c\x45XFILTRATION\x10\r\x12\n\n\x06IMPACT\x10\x0e\"\x9f\x0e\n\tTechnique\x12\x19\n\x15TECHNIQUE_UNSPECIFIED\x10\x00\x12\x10\n\x0cMASQUERADING\x10\x31\x12%\n!MATCH_LEGITIMATE_NAME_OR_LOCATION\x10\x32\x12(\n$BOOT_OR_LOGON_INITIALIZATION_SCRIPTS\x10%\x12\x11\n\rSTARTUP_ITEMS\x10&\x12\x1d\n\x19NETWORK_SERVICE_DISCOVERY\x10 \x12\x15\n\x11PROCESS_DISCOVERY\x10\x38\x12%\n!COMMAND_AND_SCRIPTING_INTERPRETER\x10\x06\x12\x0e\n\nUNIX_SHELL\x10\x07\x12\n\n\x06PYTHON\x10;\x12)\n%EXPLOITATION_FOR_PRIVILEGE_ESCALATION\x10?\x12\x1f\n\x1bPERMISSION_GROUPS_DISCOVERY\x10\x12\x12\x10\n\x0c\x43LOUD_GROUPS\x10\x13\x12#\n\x1fINDICATOR_REMOVAL_FILE_DELETION\x10@\x12\x1e\n\x1a\x41PPLICATION_LAYER_PROTOCOL\x10-\x12\x07\n\x03\x44NS\x10.\x12\x1d\n\x19SOFTWARE_DEPLOYMENT_TOOLS\x10/\x12\x12\n\x0eVALID_ACCOUNTS\x10\x0e\x12\x14\n\x10\x44\x45\x46\x41ULT_ACCOUNTS\x10#\x12\x12\n\x0eLOCAL_ACCOUNTS\x10\x0f\x12\x12\n\x0e\x43LOUD_ACCOUNTS\x10\x10\x12\t\n\x05PROXY\x10\t\x12\x12\n\x0e\x45XTERNAL_PROXY\x10\n\x12\x13\n\x0fMULTI_HOP_PROXY\x10\x0b\x12\x18\n\x14\x41\x43\x43OUNT_MANIPULATION\x10\x16\x12 \n\x1c\x41\x44\x44ITIONAL_CLOUD_CREDENTIALS\x10(\x12\x17\n\x13SSH_AUTHORIZED_KEYS\x10\x17\x12&\n\"ADDITIONAL_CONTAINER_CLUSTER_ROLES\x10:\x12\x19\n\x15INGRESS_TOOL_TRANSFER\x10\x03\x12\x0e\n\nNATIVE_API\x10\x04\x12\x0f\n\x0b\x42RUTE_FORCE\x10,\x12\x12\n\x0eSHARED_MODULES\x10\x05\x12\x1d\n\x19\x41\x43\x43\x45SS_TOKEN_MANIPULATION\x10!\x12 \n\x1cTOKEN_IMPERSONATION_OR_THEFT\x10\'\x12%\n!EXPLOIT_PUBLIC_FACING_APPLICATION\x10\x1b\x12\x1e\n\x1a\x44OMAIN_POLICY_MODIFICATION\x10\x1e\x12\x14\n\x10\x44\x41TA_DESTRUCTION\x10\x1d\x12\x10\n\x0cSERVICE_STOP\x10\x34\x12\x1b\n\x17INHIBIT_SYSTEM_RECOVERY\x10$\x12\x16\n\x12RESOURCE_HIJACKING\x10\x08\x12\x1d\n\x19NETWORK_DENIAL_OF_SERVICE\x10\x11\x12\x1b\n\x17\x43LOUD_SERVICE_DISCOVERY\x10\x30\x12\"\n\x1eSTEAL_APPLICATION_ACCESS_TOKEN\x10*\x12\x1a\n\x16\x41\x43\x43OUNT_ACCESS_REMOVAL\x10\x33\x12\x1c\n\x18STEAL_WEB_SESSION_COOKIE\x10\x19\x12#\n\x1f\x43REATE_OR_MODIFY_SYSTEM_PROCESS\x10\x18\x12%\n!ABUSE_ELEVATION_CONTROL_MECHANISM\x10\"\x12\x19\n\x15UNSECURED_CREDENTIALS\x10\r\x12!\n\x1dMODIFY_AUTHENTICATION_PROCESS\x10\x1c\x12\x13\n\x0fIMPAIR_DEFENSES\x10\x1f\x12\x1b\n\x17\x44ISABLE_OR_MODIFY_TOOLS\x10\x37\x12!\n\x1d\x45XFILTRATION_OVER_WEB_SERVICE\x10\x14\x12!\n\x1d\x45XFILTRATION_TO_CLOUD_STORAGE\x10\x15\x12\x16\n\x12\x44YNAMIC_RESOLUTION\x10\x0c\x12\x19\n\x15LATERAL_TOOL_TRANSFER\x10)\x12\'\n#MODIFY_CLOUD_COMPUTE_INFRASTRUCTURE\x10\x1a\x12\x13\n\x0f\x43REATE_SNAPSHOT\x10\x36\x12\"\n\x1e\x43LOUD_INFRASTRUCTURE_DISCOVERY\x10\x35\x12\x17\n\x13OBTAIN_CAPABILITIES\x10+\x12\x13\n\x0f\x41\x43TIVE_SCANNING\x10\x01\x12\x16\n\x12SCANNING_IP_BLOCKS\x10\x02\x12$\n CONTAINER_ADMINISTRATION_COMMAND\x10<\x12\x12\n\x0e\x45SCAPE_TO_HOST\x10=\x12$\n CONTAINER_AND_RESOURCE_DISCOVERY\x10\x39\x12.\n*STEAL_OR_FORGE_AUTHENTICATION_CERTIFICATES\x10>B\xea\x01\n\"com.google.cloud.securitycenter.v1B\x10MitreAttackProtoP\x01ZJcloud.google.com/go/securitycenter/apiv1/securitycenterpb;securitycenterpb\xaa\x02\x1eGoogle.Cloud.SecurityCenter.V1\xca\x02\x1eGoogle\\Cloud\\SecurityCenter\\V1\xea\x02!Google::Cloud::SecurityCenter::V1b\x06proto3" + +pool = ::Google::Protobuf::DescriptorPool.generated_pool +pool.add_serialized_file(descriptor_data) + +module Google + module Cloud + module SecurityCenter + module V1 + MitreAttack = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.securitycenter.v1.MitreAttack").msgclass + MitreAttack::Tactic = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.securitycenter.v1.MitreAttack.Tactic").enummodule + MitreAttack::Technique = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.securitycenter.v1.MitreAttack.Technique").enummodule + end + end + end +end diff --git a/owl-bot-staging/google-cloud-security_center-v1/lib/google/cloud/securitycenter/v1/mute_config_pb.rb b/owl-bot-staging/google-cloud-security_center-v1/lib/google/cloud/securitycenter/v1/mute_config_pb.rb new file mode 100644 index 000000000000..6f270729b563 --- /dev/null +++ b/owl-bot-staging/google-cloud-security_center-v1/lib/google/cloud/securitycenter/v1/mute_config_pb.rb @@ -0,0 +1,26 @@ +# frozen_string_literal: true +# Generated by the protocol buffer compiler. DO NOT EDIT! +# source: google/cloud/securitycenter/v1/mute_config.proto + +require 'google/protobuf' + +require 'google/api/field_behavior_pb' +require 'google/api/resource_pb' +require 'google/protobuf/timestamp_pb' + + +descriptor_data = "\n0google/cloud/securitycenter/v1/mute_config.proto\x12\x1egoogle.cloud.securitycenter.v1\x1a\x1fgoogle/api/field_behavior.proto\x1a\x19google/api/resource.proto\x1a\x1fgoogle/protobuf/timestamp.proto\"\xe9\x06\n\nMuteConfig\x12\x0c\n\x04name\x18\x01 \x01(\t\x12\x18\n\x0c\x64isplay_name\x18\x02 \x01(\tB\x02\x18\x01\x12\x13\n\x0b\x64\x65scription\x18\x03 \x01(\t\x12\x13\n\x06\x66ilter\x18\x04 \x01(\tB\x03\xe0\x41\x02\x12\x34\n\x0b\x63reate_time\x18\x05 \x01(\x0b\x32\x1a.google.protobuf.TimestampB\x03\xe0\x41\x03\x12\x34\n\x0bupdate_time\x18\x06 \x01(\x0b\x32\x1a.google.protobuf.TimestampB\x03\xe0\x41\x03\x12\x1f\n\x12most_recent_editor\x18\x07 \x01(\tB\x03\xe0\x41\x03\x12L\n\x04type\x18\x08 \x01(\x0e\x32\x39.google.cloud.securitycenter.v1.MuteConfig.MuteConfigTypeB\x03\xe0\x41\x01\x12\x34\n\x0b\x65xpiry_time\x18\t \x01(\x0b\x32\x1a.google.protobuf.TimestampB\x03\xe0\x41\x01\"K\n\x0eMuteConfigType\x12 \n\x1cMUTE_CONFIG_TYPE_UNSPECIFIED\x10\x00\x12\n\n\x06STATIC\x10\x01\x12\x0b\n\x07\x44YNAMIC\x10\x02:\xaa\x03\xea\x41\xa6\x03\n(securitycenter.googleapis.com/MuteConfig\x12\x36organizations/{organization}/muteConfigs/{mute_config}\x12*folders/{folder}/muteConfigs/{mute_config}\x12,projects/{project}/muteConfigs/{mute_config}\x12Korganizations/{organization}/locations/{location}/muteConfigs/{mute_config}\x12?folders/{folder}/locations/{location}/muteConfigs/{mute_config}\x12\x41projects/{project}/locations/{location}/muteConfigs/{mute_config}*\x0bmuteConfigs2\nmuteConfigB\xe9\x01\n\"com.google.cloud.securitycenter.v1B\x0fMuteConfigProtoP\x01ZJcloud.google.com/go/securitycenter/apiv1/securitycenterpb;securitycenterpb\xaa\x02\x1eGoogle.Cloud.SecurityCenter.V1\xca\x02\x1eGoogle\\Cloud\\SecurityCenter\\V1\xea\x02!Google::Cloud::SecurityCenter::V1b\x06proto3" + +pool = ::Google::Protobuf::DescriptorPool.generated_pool +pool.add_serialized_file(descriptor_data) + +module Google + module Cloud + module SecurityCenter + module V1 + MuteConfig = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.securitycenter.v1.MuteConfig").msgclass + MuteConfig::MuteConfigType = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.securitycenter.v1.MuteConfig.MuteConfigType").enummodule + end + end + end +end diff --git a/owl-bot-staging/google-cloud-security_center-v1/lib/google/cloud/securitycenter/v1/notebook_pb.rb b/owl-bot-staging/google-cloud-security_center-v1/lib/google/cloud/securitycenter/v1/notebook_pb.rb new file mode 100644 index 000000000000..f8cc3f85eb77 --- /dev/null +++ b/owl-bot-staging/google-cloud-security_center-v1/lib/google/cloud/securitycenter/v1/notebook_pb.rb @@ -0,0 +1,23 @@ +# frozen_string_literal: true +# Generated by the protocol buffer compiler. DO NOT EDIT! +# source: google/cloud/securitycenter/v1/notebook.proto + +require 'google/protobuf' + +require 'google/protobuf/timestamp_pb' + + +descriptor_data = "\n-google/cloud/securitycenter/v1/notebook.proto\x12\x1egoogle.cloud.securitycenter.v1\x1a\x1fgoogle/protobuf/timestamp.proto\"x\n\x08Notebook\x12\x0c\n\x04name\x18\x01 \x01(\t\x12\x0f\n\x07service\x18\x02 \x01(\t\x12\x13\n\x0blast_author\x18\x03 \x01(\t\x12\x38\n\x14notebook_update_time\x18\x04 \x01(\x0b\x32\x1a.google.protobuf.TimestampB\xe7\x01\n\"com.google.cloud.securitycenter.v1B\rNotebookProtoP\x01ZJcloud.google.com/go/securitycenter/apiv1/securitycenterpb;securitycenterpb\xaa\x02\x1eGoogle.Cloud.SecurityCenter.V1\xca\x02\x1eGoogle\\Cloud\\SecurityCenter\\V1\xea\x02!Google::Cloud::SecurityCenter::V1b\x06proto3" + +pool = ::Google::Protobuf::DescriptorPool.generated_pool +pool.add_serialized_file(descriptor_data) + +module Google + module Cloud + module SecurityCenter + module V1 + Notebook = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.securitycenter.v1.Notebook").msgclass + end + end + end +end diff --git a/owl-bot-staging/google-cloud-security_center-v1/lib/google/cloud/securitycenter/v1/notification_config_pb.rb b/owl-bot-staging/google-cloud-security_center-v1/lib/google/cloud/securitycenter/v1/notification_config_pb.rb new file mode 100644 index 000000000000..df0bb0cecc79 --- /dev/null +++ b/owl-bot-staging/google-cloud-security_center-v1/lib/google/cloud/securitycenter/v1/notification_config_pb.rb @@ -0,0 +1,25 @@ +# frozen_string_literal: true +# Generated by the protocol buffer compiler. DO NOT EDIT! +# source: google/cloud/securitycenter/v1/notification_config.proto + +require 'google/protobuf' + +require 'google/api/field_behavior_pb' +require 'google/api/resource_pb' + + +descriptor_data = "\n8google/cloud/securitycenter/v1/notification_config.proto\x12\x1egoogle.cloud.securitycenter.v1\x1a\x1fgoogle/api/field_behavior.proto\x1a\x19google/api/resource.proto\"\xc5\x04\n\x12NotificationConfig\x12\x0c\n\x04name\x18\x01 \x01(\t\x12\x13\n\x0b\x64\x65scription\x18\x02 \x01(\t\x12\x36\n\x0cpubsub_topic\x18\x03 \x01(\tB \xfa\x41\x1d\n\x1bpubsub.googleapis.com/Topic\x12\x1c\n\x0fservice_account\x18\x04 \x01(\tB\x03\xe0\x41\x03\x12^\n\x10streaming_config\x18\x05 \x01(\x0b\x32\x42.google.cloud.securitycenter.v1.NotificationConfig.StreamingConfigH\x00\x1a!\n\x0fStreamingConfig\x12\x0e\n\x06\x66ilter\x18\x01 \x01(\t:\xa1\x02\xea\x41\x9d\x02\n0securitycenter.googleapis.com/NotificationConfig\x12\x46organizations/{organization}/notificationConfigs/{notification_config}\x12:folders/{folder}/notificationConfigs/{notification_config}\x12\n\x04name\x18\x01 \x01(\tB0\xe0\x41\x02\xfa\x41*\n(securitycenter.googleapis.com/MuteConfig\"i\n\x1f\x44\x65leteNotificationConfigRequest\x12\x46\n\x04name\x18\x01 \x01(\tB8\xe0\x41\x02\xfa\x41\x32\n0securitycenter.googleapis.com/NotificationConfig\"\x8b\x01\n0DeleteSecurityHealthAnalyticsCustomModuleRequest\x12W\n\x04name\x18\x01 \x01(\tBI\xe0\x41\x02\xfa\x41\x43\nAsecuritycenter.googleapis.com/SecurityHealthAnalyticsCustomModule\"^\n\x18GetBigQueryExportRequest\x12\x42\n\x04name\x18\x01 \x01(\tB4\xe0\x41\x02\xfa\x41.\n,securitycenter.googleapis.com/BigQueryExport\"V\n\x14GetMuteConfigRequest\x12>\n\x04name\x18\x01 \x01(\tB0\xe0\x41\x02\xfa\x41*\n(securitycenter.googleapis.com/MuteConfig\"f\n\x1cGetNotificationConfigRequest\x12\x46\n\x04name\x18\x01 \x01(\tB8\xe0\x41\x02\xfa\x41\x32\n0securitycenter.googleapis.com/NotificationConfig\"j\n\x1eGetOrganizationSettingsRequest\x12H\n\x04name\x18\x01 \x01(\tB:\xe0\x41\x02\xfa\x41\x34\n2securitycenter.googleapis.com/OrganizationSettings\"\x9a\x01\n6GetEffectiveSecurityHealthAnalyticsCustomModuleRequest\x12`\n\x04name\x18\x01 \x01(\tBR\xe0\x41\x02\xfa\x41L\nJsecuritycenter.googleapis.com/EffectiveSecurityHealthAnalyticsCustomModule\"\x88\x01\n-GetSecurityHealthAnalyticsCustomModuleRequest\x12W\n\x04name\x18\x01 \x01(\tBI\xe0\x41\x02\xfa\x41\x43\nAsecuritycenter.googleapis.com/SecurityHealthAnalyticsCustomModule\"N\n\x10GetSourceRequest\x12:\n\x04name\x18\x01 \x01(\tB,\xe0\x41\x02\xfa\x41&\n$securitycenter.googleapis.com/Source\"\x83\x02\n\x12GroupAssetsRequest\x12;\n\x06parent\x18\x01 \x01(\tB+\xe0\x41\x02\xfa\x41%\x12#securitycenter.googleapis.com/Asset\x12\x0e\n\x06\x66ilter\x18\x02 \x01(\t\x12\x15\n\x08group_by\x18\x03 \x01(\tB\x03\xe0\x41\x02\x12\x33\n\x10\x63ompare_duration\x18\x04 \x01(\x0b\x32\x19.google.protobuf.Duration\x12-\n\tread_time\x18\x05 \x01(\x0b\x32\x1a.google.protobuf.Timestamp\x12\x12\n\npage_token\x18\x07 \x01(\t\x12\x11\n\tpage_size\x18\x08 \x01(\x05\"\xb8\x01\n\x13GroupAssetsResponse\x12\x45\n\x10group_by_results\x18\x01 \x03(\x0b\x32+.google.cloud.securitycenter.v1.GroupResult\x12-\n\tread_time\x18\x02 \x01(\x0b\x32\x1a.google.protobuf.Timestamp\x12\x17\n\x0fnext_page_token\x18\x03 \x01(\t\x12\x12\n\ntotal_size\x18\x04 \x01(\x05\"\x86\x02\n\x14GroupFindingsRequest\x12<\n\x06parent\x18\x01 \x01(\tB,\xe0\x41\x02\xfa\x41&\n$securitycenter.googleapis.com/Source\x12\x0e\n\x06\x66ilter\x18\x02 \x01(\t\x12\x15\n\x08group_by\x18\x03 \x01(\tB\x03\xe0\x41\x02\x12-\n\tread_time\x18\x04 \x01(\x0b\x32\x1a.google.protobuf.Timestamp\x12\x33\n\x10\x63ompare_duration\x18\x05 \x01(\x0b\x32\x19.google.protobuf.Duration\x12\x12\n\npage_token\x18\x07 \x01(\t\x12\x11\n\tpage_size\x18\x08 \x01(\x05\"\xba\x01\n\x15GroupFindingsResponse\x12\x45\n\x10group_by_results\x18\x01 \x03(\x0b\x32+.google.cloud.securitycenter.v1.GroupResult\x12-\n\tread_time\x18\x02 \x01(\x0b\x32\x1a.google.protobuf.Timestamp\x12\x17\n\x0fnext_page_token\x18\x03 \x01(\t\x12\x12\n\ntotal_size\x18\x04 \x01(\x05\"\xb8\x01\n\x0bGroupResult\x12O\n\nproperties\x18\x01 \x03(\x0b\x32;.google.cloud.securitycenter.v1.GroupResult.PropertiesEntry\x12\r\n\x05\x63ount\x18\x02 \x01(\x03\x1aI\n\x0fPropertiesEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12%\n\x05value\x18\x02 \x01(\x0b\x32\x16.google.protobuf.Value:\x02\x38\x01\"\xbd\x01\n9ListDescendantSecurityHealthAnalyticsCustomModulesRequest\x12Y\n\x06parent\x18\x01 \x01(\tBI\xe0\x41\x02\xfa\x41\x43\x12\x41securitycenter.googleapis.com/SecurityHealthAnalyticsCustomModule\x12\x11\n\tpage_size\x18\x02 \x01(\x05\x12\x12\n\npage_token\x18\x03 \x01(\t\"\xcc\x01\n:ListDescendantSecurityHealthAnalyticsCustomModulesResponse\x12u\n(security_health_analytics_custom_modules\x18\x01 \x03(\x0b\x32\x43.google.cloud.securitycenter.v1.SecurityHealthAnalyticsCustomModule\x12\x17\n\x0fnext_page_token\x18\x02 \x01(\t\"\xb0\x01\n\x1aListValuedResourcesRequest\x12\x44\n\x06parent\x18\x01 \x01(\tB4\xe0\x41\x02\xfa\x41.\x12,securitycenter.googleapis.com/ValuedResource\x12\x0e\n\x06\x66ilter\x18\x02 \x01(\t\x12\x12\n\npage_token\x18\x03 \x01(\t\x12\x11\n\tpage_size\x18\x04 \x01(\x05\x12\x15\n\x08order_by\x18\x05 \x01(\tB\x03\xe0\x41\x01\"\x94\x01\n\x1bListValuedResourcesResponse\x12H\n\x10valued_resources\x18\x01 \x03(\x0b\x32..google.cloud.securitycenter.v1.ValuedResource\x12\x17\n\x0fnext_page_token\x18\x02 \x01(\t\x12\x12\n\ntotal_size\x18\x03 \x01(\x05\"\x91\x01\n\x16ListAttackPathsRequest\x12@\n\x06parent\x18\x01 \x01(\tB0\xe0\x41\x02\xfa\x41*\x12(securitycenter.googleapis.com/AttackPath\x12\x0e\n\x06\x66ilter\x18\x02 \x01(\t\x12\x12\n\npage_token\x18\x03 \x01(\t\x12\x11\n\tpage_size\x18\x04 \x01(\x05\"t\n\x17ListAttackPathsResponse\x12@\n\x0c\x61ttack_paths\x18\x01 \x03(\x0b\x32*.google.cloud.securitycenter.v1.AttackPath\x12\x17\n\x0fnext_page_token\x18\x02 \x01(\t\"V\n\x14GetSimulationRequest\x12>\n\x04name\x18\x01 \x01(\tB0\xe0\x41\x02\xfa\x41*\n(securitycenter.googleapis.com/Simulation\"^\n\x18GetValuedResourceRequest\x12\x42\n\x04name\x18\x01 \x01(\tB4\xe0\x41\x02\xfa\x41.\n,securitycenter.googleapis.com/ValuedResource\"\x81\x01\n\x16ListMuteConfigsRequest\x12@\n\x06parent\x18\x01 \x01(\tB0\xe0\x41\x02\xfa\x41*\x12(securitycenter.googleapis.com/MuteConfig\x12\x11\n\tpage_size\x18\x02 \x01(\x05\x12\x12\n\npage_token\x18\x03 \x01(\t\"t\n\x17ListMuteConfigsResponse\x12@\n\x0cmute_configs\x18\x01 \x03(\x0b\x32*.google.cloud.securitycenter.v1.MuteConfig\x12\x17\n\x0fnext_page_token\x18\x02 \x01(\t\"\x91\x01\n\x1eListNotificationConfigsRequest\x12H\n\x06parent\x18\x01 \x01(\tB8\xe0\x41\x02\xfa\x41\x32\x12\x30securitycenter.googleapis.com/NotificationConfig\x12\x12\n\npage_token\x18\x02 \x01(\t\x12\x11\n\tpage_size\x18\x03 \x01(\x05\"\x8c\x01\n\x1fListNotificationConfigsResponse\x12P\n\x14notification_configs\x18\x01 \x03(\x0b\x32\x32.google.cloud.securitycenter.v1.NotificationConfig\x12\x17\n\x0fnext_page_token\x18\x02 \x01(\t\"\xbc\x01\n8ListEffectiveSecurityHealthAnalyticsCustomModulesRequest\x12Y\n\x06parent\x18\x01 \x01(\tBI\xe0\x41\x02\xfa\x41\x43\x12\x41securitycenter.googleapis.com/SecurityHealthAnalyticsCustomModule\x12\x11\n\tpage_size\x18\x02 \x01(\x05\x12\x12\n\npage_token\x18\x03 \x01(\t\"\xdf\x01\n9ListEffectiveSecurityHealthAnalyticsCustomModulesResponse\x12\x88\x01\n2effective_security_health_analytics_custom_modules\x18\x01 \x03(\x0b\x32L.google.cloud.securitycenter.v1.EffectiveSecurityHealthAnalyticsCustomModule\x12\x17\n\x0fnext_page_token\x18\x02 \x01(\t\"\xb3\x01\n/ListSecurityHealthAnalyticsCustomModulesRequest\x12Y\n\x06parent\x18\x01 \x01(\tBI\xe0\x41\x02\xfa\x41\x43\x12\x41securitycenter.googleapis.com/SecurityHealthAnalyticsCustomModule\x12\x11\n\tpage_size\x18\x02 \x01(\x05\x12\x12\n\npage_token\x18\x03 \x01(\t\"\xc2\x01\n0ListSecurityHealthAnalyticsCustomModulesResponse\x12u\n(security_health_analytics_custom_modules\x18\x01 \x03(\x0b\x32\x43.google.cloud.securitycenter.v1.SecurityHealthAnalyticsCustomModule\x12\x17\n\x0fnext_page_token\x18\x02 \x01(\t\"y\n\x12ListSourcesRequest\x12<\n\x06parent\x18\x01 \x01(\tB,\xe0\x41\x02\xfa\x41&\x12$securitycenter.googleapis.com/Source\x12\x12\n\npage_token\x18\x02 \x01(\t\x12\x11\n\tpage_size\x18\x07 \x01(\x05\"g\n\x13ListSourcesResponse\x12\x37\n\x07sources\x18\x01 \x03(\x0b\x32&.google.cloud.securitycenter.v1.Source\x12\x17\n\x0fnext_page_token\x18\x02 \x01(\t\"\xad\x02\n\x11ListAssetsRequest\x12;\n\x06parent\x18\x01 \x01(\tB+\xe0\x41\x02\xfa\x41%\x12#securitycenter.googleapis.com/Asset\x12\x0e\n\x06\x66ilter\x18\x02 \x01(\t\x12\x10\n\x08order_by\x18\x03 \x01(\t\x12-\n\tread_time\x18\x04 \x01(\x0b\x32\x1a.google.protobuf.Timestamp\x12\x33\n\x10\x63ompare_duration\x18\x05 \x01(\x0b\x32\x19.google.protobuf.Duration\x12.\n\nfield_mask\x18\x07 \x01(\x0b\x32\x1a.google.protobuf.FieldMask\x12\x12\n\npage_token\x18\x08 \x01(\t\x12\x11\n\tpage_size\x18\t \x01(\x05\"\xc3\x03\n\x12ListAssetsResponse\x12`\n\x13list_assets_results\x18\x01 \x03(\x0b\x32\x43.google.cloud.securitycenter.v1.ListAssetsResponse.ListAssetsResult\x12-\n\tread_time\x18\x02 \x01(\x0b\x32\x1a.google.protobuf.Timestamp\x12\x17\n\x0fnext_page_token\x18\x03 \x01(\t\x12\x12\n\ntotal_size\x18\x04 \x01(\x05\x1a\xee\x01\n\x10ListAssetsResult\x12\x34\n\x05\x61sset\x18\x01 \x01(\x0b\x32%.google.cloud.securitycenter.v1.Asset\x12\x65\n\x0cstate_change\x18\x02 \x01(\x0e\x32O.google.cloud.securitycenter.v1.ListAssetsResponse.ListAssetsResult.StateChange\"=\n\x0bStateChange\x12\n\n\x06UNUSED\x10\x00\x12\t\n\x05\x41\x44\x44\x45\x44\x10\x01\x12\x0b\n\x07REMOVED\x10\x02\x12\n\n\x06\x41\x43TIVE\x10\x03\"\xb0\x02\n\x13ListFindingsRequest\x12<\n\x06parent\x18\x01 \x01(\tB,\xe0\x41\x02\xfa\x41&\n$securitycenter.googleapis.com/Source\x12\x0e\n\x06\x66ilter\x18\x02 \x01(\t\x12\x10\n\x08order_by\x18\x03 \x01(\t\x12-\n\tread_time\x18\x04 \x01(\x0b\x32\x1a.google.protobuf.Timestamp\x12\x33\n\x10\x63ompare_duration\x18\x05 \x01(\x0b\x32\x19.google.protobuf.Duration\x12.\n\nfield_mask\x18\x07 \x01(\x0b\x32\x1a.google.protobuf.FieldMask\x12\x12\n\npage_token\x18\x08 \x01(\t\x12\x11\n\tpage_size\x18\t \x01(\x05\"\xb8\t\n\x14ListFindingsResponse\x12\x66\n\x15list_findings_results\x18\x01 \x03(\x0b\x32G.google.cloud.securitycenter.v1.ListFindingsResponse.ListFindingsResult\x12-\n\tread_time\x18\x02 \x01(\x0b\x32\x1a.google.protobuf.Timestamp\x12\x17\n\x0fnext_page_token\x18\x03 \x01(\t\x12\x12\n\ntotal_size\x18\x04 \x01(\x05\x1a\xdb\x07\n\x12ListFindingsResult\x12\x38\n\x07\x66inding\x18\x01 \x01(\x0b\x32\'.google.cloud.securitycenter.v1.Finding\x12i\n\x0cstate_change\x18\x02 \x01(\x0e\x32S.google.cloud.securitycenter.v1.ListFindingsResponse.ListFindingsResult.StateChange\x12g\n\x08resource\x18\x03 \x01(\x0b\x32P.google.cloud.securitycenter.v1.ListFindingsResponse.ListFindingsResult.ResourceB\x03\xe0\x41\x03\x1a\xe7\x04\n\x08Resource\x12\x0c\n\x04name\x18\x01 \x01(\t\x12\x14\n\x0c\x64isplay_name\x18\x08 \x01(\t\x12\x0c\n\x04type\x18\x06 \x01(\t\x12\x14\n\x0cproject_name\x18\x02 \x01(\t\x12\x1c\n\x14project_display_name\x18\x03 \x01(\t\x12\x13\n\x0bparent_name\x18\x04 \x01(\t\x12\x1b\n\x13parent_display_name\x18\x05 \x01(\t\x12\x37\n\x07\x66olders\x18\x07 \x03(\x0b\x32&.google.cloud.securitycenter.v1.Folder\x12\x45\n\x0e\x63loud_provider\x18\t \x01(\x0e\x32-.google.cloud.securitycenter.v1.CloudProvider\x12\x14\n\x0corganization\x18\n \x01(\t\x12\x0f\n\x07service\x18\x0b \x01(\t\x12\x10\n\x08location\x18\x0c \x01(\t\x12\x43\n\x0c\x61ws_metadata\x18\x10 \x01(\x0b\x32+.google.cloud.securitycenter.v1.AwsMetadataH\x00\x12G\n\x0e\x61zure_metadata\x18\x11 \x01(\x0b\x32-.google.cloud.securitycenter.v1.AzureMetadataH\x00\x12\x43\n\rresource_path\x18\x12 \x01(\x0b\x32,.google.cloud.securitycenter.v1.ResourcePath\x12\x1c\n\x14resource_path_string\x18\x13 \x01(\tB\x19\n\x17\x63loud_provider_metadata\"M\n\x0bStateChange\x12\n\n\x06UNUSED\x10\x00\x12\x0b\n\x07\x43HANGED\x10\x01\x12\r\n\tUNCHANGED\x10\x02\x12\t\n\x05\x41\x44\x44\x45\x44\x10\x03\x12\x0b\n\x07REMOVED\x10\x04\"\xcd\x01\n\x16SetFindingStateRequest\x12;\n\x04name\x18\x01 \x01(\tB-\xe0\x41\x02\xfa\x41\'\n%securitycenter.googleapis.com/Finding\x12\x41\n\x05state\x18\x02 \x01(\x0e\x32-.google.cloud.securitycenter.v1.Finding.StateB\x03\xe0\x41\x02\x12\x33\n\nstart_time\x18\x03 \x01(\x0b\x32\x1a.google.protobuf.TimestampB\x03\xe0\x41\x02\"\x8e\x01\n\x0eSetMuteRequest\x12;\n\x04name\x18\x01 \x01(\tB-\xe0\x41\x02\xfa\x41\'\n%securitycenter.googleapis.com/Finding\x12?\n\x04mute\x18\x02 \x01(\x0e\x32,.google.cloud.securitycenter.v1.Finding.MuteB\x03\xe0\x41\x02\"d\n\x18RunAssetDiscoveryRequest\x12H\n\x06parent\x18\x01 \x01(\tB8\xe0\x41\x02\xfa\x41\x32\n0cloudresourcemanager.googleapis.com/Organization\"\xac\x03\n2SimulateSecurityHealthAnalyticsCustomModuleRequest\x12\x13\n\x06parent\x18\x01 \x01(\tB\x03\xe0\x41\x02\x12H\n\rcustom_config\x18\x02 \x01(\x0b\x32,.google.cloud.securitycenter.v1.CustomConfigB\x03\xe0\x41\x02\x12{\n\x08resource\x18\x03 \x01(\x0b\x32\x64.google.cloud.securitycenter.v1.SimulateSecurityHealthAnalyticsCustomModuleRequest.SimulatedResourceB\x03\xe0\x41\x02\x1a\x99\x01\n\x11SimulatedResource\x12\x1a\n\rresource_type\x18\x01 \x01(\tB\x03\xe0\x41\x02\x12\x33\n\rresource_data\x18\x02 \x01(\x0b\x32\x17.google.protobuf.StructB\x03\xe0\x41\x01\x12\x33\n\x0fiam_policy_data\x18\x03 \x01(\x0b\x32\x15.google.iam.v1.PolicyB\x03\xe0\x41\x01\"\xd9\x02\n3SimulateSecurityHealthAnalyticsCustomModuleResponse\x12s\n\x06result\x18\x01 \x01(\x0b\x32\x63.google.cloud.securitycenter.v1.SimulateSecurityHealthAnalyticsCustomModuleResponse.SimulatedResult\x1a\xac\x01\n\x0fSimulatedResult\x12:\n\x07\x66inding\x18\x01 \x01(\x0b\x32\'.google.cloud.securitycenter.v1.FindingH\x00\x12.\n\x0cno_violation\x18\x02 \x01(\x0b\x32\x16.google.protobuf.EmptyH\x00\x12#\n\x05\x65rror\x18\x03 \x01(\x0b\x32\x12.google.rpc.StatusH\x00\x42\x08\n\x06result\"\x9c\x01\n\x1bUpdateExternalSystemRequest\x12L\n\x0f\x65xternal_system\x18\x01 \x01(\x0b\x32..google.cloud.securitycenter.v1.ExternalSystemB\x03\xe0\x41\x02\x12/\n\x0bupdate_mask\x18\x02 \x01(\x0b\x32\x1a.google.protobuf.FieldMask\"\x86\x01\n\x14UpdateFindingRequest\x12=\n\x07\x66inding\x18\x01 \x01(\x0b\x32\'.google.cloud.securitycenter.v1.FindingB\x03\xe0\x41\x02\x12/\n\x0bupdate_mask\x18\x02 \x01(\x0b\x32\x1a.google.protobuf.FieldMask\"\x90\x01\n\x17UpdateMuteConfigRequest\x12\x44\n\x0bmute_config\x18\x01 \x01(\x0b\x32*.google.cloud.securitycenter.v1.MuteConfigB\x03\xe0\x41\x02\x12/\n\x0bupdate_mask\x18\x02 \x01(\x0b\x32\x1a.google.protobuf.FieldMask\"\xa8\x01\n\x1fUpdateNotificationConfigRequest\x12T\n\x13notification_config\x18\x01 \x01(\x0b\x32\x32.google.cloud.securitycenter.v1.NotificationConfigB\x03\xe0\x41\x02\x12/\n\x0bupdate_mask\x18\x02 \x01(\x0b\x32\x1a.google.protobuf.FieldMask\"\xae\x01\n!UpdateOrganizationSettingsRequest\x12X\n\x15organization_settings\x18\x01 \x01(\x0b\x32\x34.google.cloud.securitycenter.v1.OrganizationSettingsB\x03\xe0\x41\x02\x12/\n\x0bupdate_mask\x18\x02 \x01(\x0b\x32\x1a.google.protobuf.FieldMask\"\xde\x01\n0UpdateSecurityHealthAnalyticsCustomModuleRequest\x12y\n\'security_health_analytics_custom_module\x18\x01 \x01(\x0b\x32\x43.google.cloud.securitycenter.v1.SecurityHealthAnalyticsCustomModuleB\x03\xe0\x41\x02\x12/\n\x0bupdate_mask\x18\x02 \x01(\x0b\x32\x1a.google.protobuf.FieldMask\"\x83\x01\n\x13UpdateSourceRequest\x12;\n\x06source\x18\x01 \x01(\x0b\x32&.google.cloud.securitycenter.v1.SourceB\x03\xe0\x41\x02\x12/\n\x0bupdate_mask\x18\x02 \x01(\x0b\x32\x1a.google.protobuf.FieldMask\"\xc9\x01\n\x1aUpdateSecurityMarksRequest\x12J\n\x0esecurity_marks\x18\x01 \x01(\x0b\x32-.google.cloud.securitycenter.v1.SecurityMarksB\x03\xe0\x41\x02\x12/\n\x0bupdate_mask\x18\x02 \x01(\x0b\x32\x1a.google.protobuf.FieldMask\x12.\n\nstart_time\x18\x03 \x01(\x0b\x32\x1a.google.protobuf.Timestamp\"\xd4\x01\n\x1b\x43reateBigQueryExportRequest\x12\x44\n\x06parent\x18\x01 \x01(\tB4\xe0\x41\x02\xfa\x41.\x12,securitycenter.googleapis.com/BigQueryExport\x12M\n\x10\x62ig_query_export\x18\x02 \x01(\x0b\x32..google.cloud.securitycenter.v1.BigQueryExportB\x03\xe0\x41\x02\x12 \n\x13\x62ig_query_export_id\x18\x03 \x01(\tB\x03\xe0\x41\x02\"\x9d\x01\n\x1bUpdateBigQueryExportRequest\x12M\n\x10\x62ig_query_export\x18\x01 \x01(\x0b\x32..google.cloud.securitycenter.v1.BigQueryExportB\x03\xe0\x41\x02\x12/\n\x0bupdate_mask\x18\x02 \x01(\x0b\x32\x1a.google.protobuf.FieldMask\"\x89\x01\n\x1aListBigQueryExportsRequest\x12\x44\n\x06parent\x18\x01 \x01(\tB4\xe0\x41\x02\xfa\x41.\x12,securitycenter.googleapis.com/BigQueryExport\x12\x11\n\tpage_size\x18\x02 \x01(\x05\x12\x12\n\npage_token\x18\x03 \x01(\t\"\x81\x01\n\x1bListBigQueryExportsResponse\x12I\n\x11\x62ig_query_exports\x18\x01 \x03(\x0b\x32..google.cloud.securitycenter.v1.BigQueryExport\x12\x17\n\x0fnext_page_token\x18\x02 \x01(\t\"a\n\x1b\x44\x65leteBigQueryExportRequest\x12\x42\n\x04name\x18\x01 \x01(\tB4\xe0\x41\x02\xfa\x41.\n,securitycenter.googleapis.com/BigQueryExport\"\xfc\x01\n-CreateEventThreatDetectionCustomModuleRequest\x12V\n\x06parent\x18\x01 \x01(\tBF\xe0\x41\x02\xfa\x41@\x12>securitycenter.googleapis.com/EventThreatDetectionCustomModule\x12s\n$event_threat_detection_custom_module\x18\x02 \x01(\x0b\x32@.google.cloud.securitycenter.v1.EventThreatDetectionCustomModuleB\x03\xe0\x41\x02\"\xb3\x01\n/ValidateEventThreatDetectionCustomModuleRequest\x12V\n\x06parent\x18\x01 \x01(\tBF\xe0\x41\x02\xfa\x41@\x12>securitycenter.googleapis.com/EventThreatDetectionCustomModule\x12\x15\n\x08raw_text\x18\x02 \x01(\tB\x03\xe0\x41\x02\x12\x11\n\x04type\x18\x03 \x01(\tB\x03\xe0\x41\x02\"\x80\x01\n0ValidateEventThreatDetectionCustomModuleResponse\x12L\n\x06\x65rrors\x18\x02 \x01(\x0b\x32<.google.cloud.securitycenter.v1.CustomModuleValidationErrors\"\x85\x01\n-DeleteEventThreatDetectionCustomModuleRequest\x12T\n\x04name\x18\x01 \x01(\tBF\xe0\x41\x02\xfa\x41@\n>securitycenter.googleapis.com/EventThreatDetectionCustomModule\"\x82\x01\n*GetEventThreatDetectionCustomModuleRequest\x12T\n\x04name\x18\x01 \x01(\tBF\xe0\x41\x02\xfa\x41@\n>securitycenter.googleapis.com/EventThreatDetectionCustomModule\"\xb7\x01\n6ListDescendantEventThreatDetectionCustomModulesRequest\x12V\n\x06parent\x18\x01 \x01(\tBF\xe0\x41\x02\xfa\x41@\x12>securitycenter.googleapis.com/EventThreatDetectionCustomModule\x12\x12\n\npage_token\x18\x02 \x01(\t\x12\x11\n\tpage_size\x18\x03 \x01(\x05\"\xc3\x01\n7ListDescendantEventThreatDetectionCustomModulesResponse\x12o\n%event_threat_detection_custom_modules\x18\x01 \x03(\x0b\x32@.google.cloud.securitycenter.v1.EventThreatDetectionCustomModule\x12\x17\n\x0fnext_page_token\x18\x02 \x01(\t\"\xad\x01\n,ListEventThreatDetectionCustomModulesRequest\x12V\n\x06parent\x18\x01 \x01(\tBF\xe0\x41\x02\xfa\x41@\x12>securitycenter.googleapis.com/EventThreatDetectionCustomModule\x12\x12\n\npage_token\x18\x02 \x01(\t\x12\x11\n\tpage_size\x18\x03 \x01(\x05\"\xb9\x01\n-ListEventThreatDetectionCustomModulesResponse\x12o\n%event_threat_detection_custom_modules\x18\x01 \x03(\x0b\x32@.google.cloud.securitycenter.v1.EventThreatDetectionCustomModule\x12\x17\n\x0fnext_page_token\x18\x02 \x01(\t\"\xd5\x01\n-UpdateEventThreatDetectionCustomModuleRequest\x12s\n$event_threat_detection_custom_module\x18\x01 \x01(\x0b\x32@.google.cloud.securitycenter.v1.EventThreatDetectionCustomModuleB\x03\xe0\x41\x02\x12/\n\x0bupdate_mask\x18\x02 \x01(\x0b\x32\x1a.google.protobuf.FieldMask\"\x94\x01\n3GetEffectiveEventThreatDetectionCustomModuleRequest\x12]\n\x04name\x18\x01 \x01(\tBO\xe0\x41\x02\xfa\x41I\nGsecuritycenter.googleapis.com/EffectiveEventThreatDetectionCustomModule\"\xbf\x01\n5ListEffectiveEventThreatDetectionCustomModulesRequest\x12_\n\x06parent\x18\x01 \x01(\tBO\xe0\x41\x02\xfa\x41I\x12Gsecuritycenter.googleapis.com/EffectiveEventThreatDetectionCustomModule\x12\x12\n\npage_token\x18\x02 \x01(\t\x12\x11\n\tpage_size\x18\x03 \x01(\x05\"\xd6\x01\n6ListEffectiveEventThreatDetectionCustomModulesResponse\x12\x82\x01\n/effective_event_threat_detection_custom_modules\x18\x01 \x03(\x0b\x32I.google.cloud.securitycenter.v1.EffectiveEventThreatDetectionCustomModule\x12\x17\n\x0fnext_page_token\x18\x02 \x01(\t2\xf7\xb2\x01\n\x0eSecurityCenter\x12\xe2\x02\n\x10\x42ulkMuteFindings\x12\x37.google.cloud.securitycenter.v1.BulkMuteFindingsRequest\x1a\x1d.google.longrunning.Operation\"\xf5\x01\xca\x41P\n7google.cloud.securitycenter.v1.BulkMuteFindingsResponse\x12\x15google.protobuf.Empty\xda\x41\x06parent\x82\xd3\xe4\x93\x02\x92\x01\"./v1/{parent=organizations/*}/findings:bulkMute:\x01*Z-\"(/v1/{parent=folders/*}/findings:bulkMute:\x01*Z.\")/v1/{parent=projects/*}/findings:bulkMute:\x01*\x12\xd5\x04\n)CreateSecurityHealthAnalyticsCustomModule\x12P.google.cloud.securitycenter.v1.CreateSecurityHealthAnalyticsCustomModuleRequest\x1a\x43.google.cloud.securitycenter.v1.SecurityHealthAnalyticsCustomModule\"\x90\x03\xda\x41.parent,security_health_analytics_custom_module\x82\xd3\xe4\x93\x02\xd8\x02\"J/v1/{parent=organizations/*/securityHealthAnalyticsSettings}/customModules:\'security_health_analytics_custom_moduleZo\"D/v1/{parent=folders/*/securityHealthAnalyticsSettings}/customModules:\'security_health_analytics_custom_moduleZp\"E/v1/{parent=projects/*/securityHealthAnalyticsSettings}/customModules:\'security_health_analytics_custom_module\x12\xb1\x01\n\x0c\x43reateSource\x12\x33.google.cloud.securitycenter.v1.CreateSourceRequest\x1a&.google.cloud.securitycenter.v1.Source\"D\xda\x41\rparent,source\x82\xd3\xe4\x93\x02.\"$/v1/{parent=organizations/*}/sources:\x06source\x12\xcc\x01\n\rCreateFinding\x12\x34.google.cloud.securitycenter.v1.CreateFindingRequest\x1a\'.google.cloud.securitycenter.v1.Finding\"\\\xda\x41\x19parent,finding_id,finding\x82\xd3\xe4\x93\x02:\"//v1/{parent=organizations/*/sources/*}/findings:\x07\x66inding\x12\x9c\x04\n\x10\x43reateMuteConfig\x12\x37.google.cloud.securitycenter.v1.CreateMuteConfigRequest\x1a*.google.cloud.securitycenter.v1.MuteConfig\"\xa2\x03\xda\x41\x12parent,mute_config\xda\x41!parent,mute_config,mute_config_id\x82\xd3\xe4\x93\x02\xe2\x02\"(/v1/{parent=organizations/*}/muteConfigs:\x0bmute_configZC\"4/v1/{parent=organizations/*/locations/*}/muteConfigs:\x0bmute_configZ1\"\"/v1/{parent=folders/*}/muteConfigs:\x0bmute_configZ=\"./v1/{parent=folders/*/locations/*}/muteConfigs:\x0bmute_configZ2\"#/v1/{parent=projects/*}/muteConfigs:\x0bmute_configZ>\"//v1/{parent=projects/*/locations/*}/muteConfigs:\x0bmute_config\x12\xab\x03\n\x18\x43reateNotificationConfig\x12?.google.cloud.securitycenter.v1.CreateNotificationConfigRequest\x1a\x32.google.cloud.securitycenter.v1.NotificationConfig\"\x99\x02\xda\x41$parent,config_id,notification_config\xda\x41\x1aparent,notification_config\x82\xd3\xe4\x93\x02\xce\x01\"0/v1/{parent=organizations/*}/notificationConfigs:\x13notification_configZA\"*/v1/{parent=folders/*}/notificationConfigs:\x13notification_configZB\"+/v1/{parent=projects/*}/notificationConfigs:\x13notification_config\x12\x88\x03\n\x10\x44\x65leteMuteConfig\x12\x37.google.cloud.securitycenter.v1.DeleteMuteConfigRequest\x1a\x16.google.protobuf.Empty\"\xa2\x02\xda\x41\x04name\x82\xd3\xe4\x93\x02\x94\x02*(/v1/{name=organizations/*/muteConfigs/*}Z$*\"/v1/{name=folders/*/muteConfigs/*}Z%*#/v1/{name=projects/*/muteConfigs/*}Z6*4/v1/{name=organizations/*/locations/*/muteConfigs/*}Z0*./v1/{name=folders/*/locations/*/muteConfigs/*}Z1*//v1/{name=projects/*/locations/*/muteConfigs/*}\x12\x93\x02\n\x18\x44\x65leteNotificationConfig\x12?.google.cloud.securitycenter.v1.DeleteNotificationConfigRequest\x1a\x16.google.protobuf.Empty\"\x9d\x01\xda\x41\x04name\x82\xd3\xe4\x93\x02\x8f\x01*0/v1/{name=organizations/*/notificationConfigs/*}Z,**/v1/{name=folders/*/notificationConfigs/*}Z-*+/v1/{name=projects/*/notificationConfigs/*}\x12\x83\x03\n)DeleteSecurityHealthAnalyticsCustomModule\x12P.google.cloud.securitycenter.v1.DeleteSecurityHealthAnalyticsCustomModuleRequest\x1a\x16.google.protobuf.Empty\"\xeb\x01\xda\x41\x04name\x82\xd3\xe4\x93\x02\xdd\x01*J/v1/{name=organizations/*/securityHealthAnalyticsSettings/customModules/*}ZF*D/v1/{name=folders/*/securityHealthAnalyticsSettings/customModules/*}ZG*E/v1/{name=projects/*/securityHealthAnalyticsSettings/customModules/*}\x12\xaa\x01\n\rGetSimulation\x12\x34.google.cloud.securitycenter.v1.GetSimulationRequest\x1a*.google.cloud.securitycenter.v1.Simulation\"7\xda\x41\x04name\x82\xd3\xe4\x93\x02*\x12(/v1/{name=organizations/*/simulations/*}\x12\xc8\x01\n\x11GetValuedResource\x12\x38.google.cloud.securitycenter.v1.GetValuedResourceRequest\x1a..google.cloud.securitycenter.v1.ValuedResource\"I\xda\x41\x04name\x82\xd3\xe4\x93\x02<\x12:/v1/{name=organizations/*/simulations/*/valuedResources/*}\x12\x91\x02\n\x11GetBigQueryExport\x12\x38.google.cloud.securitycenter.v1.GetBigQueryExportRequest\x1a..google.cloud.securitycenter.v1.BigQueryExport\"\x91\x01\xda\x41\x04name\x82\xd3\xe4\x93\x02\x83\x01\x12,/v1/{name=organizations/*/bigQueryExports/*}Z(\x12&/v1/{name=folders/*/bigQueryExports/*}Z)\x12\'/v1/{name=projects/*/bigQueryExports/*}\x12\x96\x01\n\x0cGetIamPolicy\x12\".google.iam.v1.GetIamPolicyRequest\x1a\x15.google.iam.v1.Policy\"K\xda\x41\x08resource\x82\xd3\xe4\x93\x02:\"5/v1/{resource=organizations/*/sources/*}:getIamPolicy:\x01*\x12\x96\x03\n\rGetMuteConfig\x12\x34.google.cloud.securitycenter.v1.GetMuteConfigRequest\x1a*.google.cloud.securitycenter.v1.MuteConfig\"\xa2\x02\xda\x41\x04name\x82\xd3\xe4\x93\x02\x94\x02\x12(/v1/{name=organizations/*/muteConfigs/*}Z$\x12\"/v1/{name=folders/*/muteConfigs/*}Z%\x12#/v1/{name=projects/*/muteConfigs/*}Z6\x12\x34/v1/{name=organizations/*/locations/*/muteConfigs/*}Z0\x12./v1/{name=folders/*/locations/*/muteConfigs/*}Z1\x12//v1/{name=projects/*/locations/*/muteConfigs/*}\x12\xa9\x02\n\x15GetNotificationConfig\x12<.google.cloud.securitycenter.v1.GetNotificationConfigRequest\x1a\x32.google.cloud.securitycenter.v1.NotificationConfig\"\x9d\x01\xda\x41\x04name\x82\xd3\xe4\x93\x02\x8f\x01\x12\x30/v1/{name=organizations/*/notificationConfigs/*}Z,\x12*/v1/{name=folders/*/notificationConfigs/*}Z-\x12+/v1/{name=projects/*/notificationConfigs/*}\x12\xcf\x01\n\x17GetOrganizationSettings\x12>.google.cloud.securitycenter.v1.GetOrganizationSettingsRequest\x1a\x34.google.cloud.securitycenter.v1.OrganizationSettings\">\xda\x41\x04name\x82\xd3\xe4\x93\x02\x31\x12//v1/{name=organizations/*/organizationSettings}\x12\xe0\x03\n/GetEffectiveSecurityHealthAnalyticsCustomModule\x12V.google.cloud.securitycenter.v1.GetEffectiveSecurityHealthAnalyticsCustomModuleRequest\x1aL.google.cloud.securitycenter.v1.EffectiveSecurityHealthAnalyticsCustomModule\"\x86\x02\xda\x41\x04name\x82\xd3\xe4\x93\x02\xf8\x01\x12S/v1/{name=organizations/*/securityHealthAnalyticsSettings/effectiveCustomModules/*}ZO\x12M/v1/{name=folders/*/securityHealthAnalyticsSettings/effectiveCustomModules/*}ZP\x12N/v1/{name=projects/*/securityHealthAnalyticsSettings/effectiveCustomModules/*}\x12\xaa\x03\n&GetSecurityHealthAnalyticsCustomModule\x12M.google.cloud.securitycenter.v1.GetSecurityHealthAnalyticsCustomModuleRequest\x1a\x43.google.cloud.securitycenter.v1.SecurityHealthAnalyticsCustomModule\"\xeb\x01\xda\x41\x04name\x82\xd3\xe4\x93\x02\xdd\x01\x12J/v1/{name=organizations/*/securityHealthAnalyticsSettings/customModules/*}ZF\x12\x44/v1/{name=folders/*/securityHealthAnalyticsSettings/customModules/*}ZG\x12\x45/v1/{name=projects/*/securityHealthAnalyticsSettings/customModules/*}\x12\x9a\x01\n\tGetSource\x12\x30.google.cloud.securitycenter.v1.GetSourceRequest\x1a&.google.cloud.securitycenter.v1.Source\"3\xda\x41\x04name\x82\xd3\xe4\x93\x02&\x12$/v1/{name=organizations/*/sources/*}\x12\x86\x02\n\x0bGroupAssets\x12\x32.google.cloud.securitycenter.v1.GroupAssetsRequest\x1a\x33.google.cloud.securitycenter.v1.GroupAssetsResponse\"\x8d\x01\x88\x02\x01\x82\xd3\xe4\x93\x02\x83\x01\")/v1/{parent=organizations/*}/assets:group:\x01*Z(\"#/v1/{parent=folders/*}/assets:group:\x01*Z)\"$/v1/{parent=projects/*}/assets:group:\x01*\x12\xbf\x02\n\rGroupFindings\x12\x34.google.cloud.securitycenter.v1.GroupFindingsRequest\x1a\x35.google.cloud.securitycenter.v1.GroupFindingsResponse\"\xc0\x01\xda\x41\x0fparent,group_by\x82\xd3\xe4\x93\x02\xa7\x01\"5/v1/{parent=organizations/*/sources/*}/findings:group:\x01*Z4\"//v1/{parent=folders/*/sources/*}/findings:group:\x01*Z5\"0/v1/{parent=projects/*/sources/*}/findings:group:\x01*\x12\xe6\x01\n\nListAssets\x12\x31.google.cloud.securitycenter.v1.ListAssetsRequest\x1a\x32.google.cloud.securitycenter.v1.ListAssetsResponse\"q\x88\x02\x01\x82\xd3\xe4\x93\x02h\x12#/v1/{parent=organizations/*}/assetsZ\x1f\x12\x1d/v1/{parent=folders/*}/assetsZ \x12\x1e/v1/{parent=projects/*}/assets\x12\x88\x04\n2ListDescendantSecurityHealthAnalyticsCustomModules\x12Y.google.cloud.securitycenter.v1.ListDescendantSecurityHealthAnalyticsCustomModulesRequest\x1aZ.google.cloud.securitycenter.v1.ListDescendantSecurityHealthAnalyticsCustomModulesResponse\"\x9a\x02\xda\x41\x06parent\x82\xd3\xe4\x93\x02\x8a\x02\x12Y/v1/{parent=organizations/*/securityHealthAnalyticsSettings}/customModules:listDescendantZU\x12S/v1/{parent=folders/*/securityHealthAnalyticsSettings}/customModules:listDescendantZV\x12T/v1/{parent=projects/*/securityHealthAnalyticsSettings}/customModules:listDescendant\x12\x8f\x02\n\x0cListFindings\x12\x33.google.cloud.securitycenter.v1.ListFindingsRequest\x1a\x34.google.cloud.securitycenter.v1.ListFindingsResponse\"\x93\x01\x82\xd3\xe4\x93\x02\x8c\x01\x12//v1/{parent=organizations/*/sources/*}/findingsZ+\x12)/v1/{parent=folders/*/sources/*}/findingsZ,\x12*/v1/{parent=projects/*/sources/*}/findings\x12\xa9\x03\n\x0fListMuteConfigs\x12\x36.google.cloud.securitycenter.v1.ListMuteConfigsRequest\x1a\x37.google.cloud.securitycenter.v1.ListMuteConfigsResponse\"\xa4\x02\xda\x41\x06parent\x82\xd3\xe4\x93\x02\x94\x02\x12(/v1/{parent=organizations/*}/muteConfigsZ$\x12\"/v1/{parent=folders/*}/muteConfigsZ%\x12#/v1/{parent=projects/*}/muteConfigsZ6\x12\x34/v1/{parent=organizations/*/locations/*/muteConfigs}Z0\x12./v1/{parent=folders/*/locations/*/muteConfigs}Z1\x12//v1/{parent=projects/*/locations/*/muteConfigs}\x12\xbc\x02\n\x17ListNotificationConfigs\x12>.google.cloud.securitycenter.v1.ListNotificationConfigsRequest\x1a?.google.cloud.securitycenter.v1.ListNotificationConfigsResponse\"\x9f\x01\xda\x41\x06parent\x82\xd3\xe4\x93\x02\x8f\x01\x12\x30/v1/{parent=organizations/*}/notificationConfigsZ,\x12*/v1/{parent=folders/*}/notificationConfigsZ-\x12+/v1/{parent=projects/*}/notificationConfigs\x12\xf3\x03\n1ListEffectiveSecurityHealthAnalyticsCustomModules\x12X.google.cloud.securitycenter.v1.ListEffectiveSecurityHealthAnalyticsCustomModulesRequest\x1aY.google.cloud.securitycenter.v1.ListEffectiveSecurityHealthAnalyticsCustomModulesResponse\"\x88\x02\xda\x41\x06parent\x82\xd3\xe4\x93\x02\xf8\x01\x12S/v1/{parent=organizations/*/securityHealthAnalyticsSettings}/effectiveCustomModulesZO\x12M/v1/{parent=folders/*/securityHealthAnalyticsSettings}/effectiveCustomModulesZP\x12N/v1/{parent=projects/*/securityHealthAnalyticsSettings}/effectiveCustomModules\x12\xbd\x03\n(ListSecurityHealthAnalyticsCustomModules\x12O.google.cloud.securitycenter.v1.ListSecurityHealthAnalyticsCustomModulesRequest\x1aP.google.cloud.securitycenter.v1.ListSecurityHealthAnalyticsCustomModulesResponse\"\xed\x01\xda\x41\x06parent\x82\xd3\xe4\x93\x02\xdd\x01\x12J/v1/{parent=organizations/*/securityHealthAnalyticsSettings}/customModulesZF\x12\x44/v1/{parent=folders/*/securityHealthAnalyticsSettings}/customModulesZG\x12\x45/v1/{parent=projects/*/securityHealthAnalyticsSettings}/customModules\x12\xf2\x01\n\x0bListSources\x12\x32.google.cloud.securitycenter.v1.ListSourcesRequest\x1a\x33.google.cloud.securitycenter.v1.ListSourcesResponse\"z\xda\x41\x06parent\x82\xd3\xe4\x93\x02k\x12$/v1/{parent=organizations/*}/sourcesZ \x12\x1e/v1/{parent=folders/*}/sourcesZ!\x12\x1f/v1/{parent=projects/*}/sources\x12\x8a\x02\n\x11RunAssetDiscovery\x12\x38.google.cloud.securitycenter.v1.RunAssetDiscoveryRequest\x1a\x1d.google.longrunning.Operation\"\x9b\x01\x88\x02\x01\xca\x41Q\n8google.cloud.securitycenter.v1.RunAssetDiscoveryResponse\x12\x15google.protobuf.Empty\xda\x41\x06parent\x82\xd3\xe4\x93\x02\x35\"0/v1/{parent=organizations/*}/assets:runDiscovery:\x01*\x12\xc4\x02\n\x0fSetFindingState\x12\x36.google.cloud.securitycenter.v1.SetFindingStateRequest\x1a\'.google.cloud.securitycenter.v1.Finding\"\xcf\x01\xda\x41\x15name,state,start_time\x82\xd3\xe4\x93\x02\xb0\x01\"8/v1/{name=organizations/*/sources/*/findings/*}:setState:\x01*Z7\"2/v1/{name=folders/*/sources/*/findings/*}:setState:\x01*Z8\"3/v1/{name=projects/*/sources/*/findings/*}:setState:\x01*\x12\xa5\x02\n\x07SetMute\x12..google.cloud.securitycenter.v1.SetMuteRequest\x1a\'.google.cloud.securitycenter.v1.Finding\"\xc0\x01\xda\x41\tname,mute\x82\xd3\xe4\x93\x02\xad\x01\"7/v1/{name=organizations/*/sources/*/findings/*}:setMute:\x01*Z6\"1/v1/{name=folders/*/sources/*/findings/*}:setMute:\x01*Z7\"2/v1/{name=projects/*/sources/*/findings/*}:setMute:\x01*\x12\x9d\x01\n\x0cSetIamPolicy\x12\".google.iam.v1.SetIamPolicyRequest\x1a\x15.google.iam.v1.Policy\"R\xda\x41\x0fresource,policy\x82\xd3\xe4\x93\x02:\"5/v1/{resource=organizations/*/sources/*}:setIamPolicy:\x01*\x12\xc8\x01\n\x12TestIamPermissions\x12(.google.iam.v1.TestIamPermissionsRequest\x1a).google.iam.v1.TestIamPermissionsResponse\"]\xda\x41\x14resource,permissions\x82\xd3\xe4\x93\x02@\";/v1/{resource=organizations/*/sources/*}:testIamPermissions:\x01*\x12\x81\x04\n+SimulateSecurityHealthAnalyticsCustomModule\x12R.google.cloud.securitycenter.v1.SimulateSecurityHealthAnalyticsCustomModuleRequest\x1aS.google.cloud.securitycenter.v1.SimulateSecurityHealthAnalyticsCustomModuleResponse\"\xa8\x02\xda\x41\x1dparent,custom_config,resource\x82\xd3\xe4\x93\x02\x81\x02\"S/v1/{parent=organizations/*/securityHealthAnalyticsSettings}/customModules:simulate:\x01*ZR\"M/v1/{parent=folders/*/securityHealthAnalyticsSettings}/customModules:simulate:\x01*ZS\"N/v1/{parent=projects/*/securityHealthAnalyticsSettings}/customModules:simulate:\x01*\x12\xd0\x03\n\x14UpdateExternalSystem\x12;.google.cloud.securitycenter.v1.UpdateExternalSystemRequest\x1a..google.cloud.securitycenter.v1.ExternalSystem\"\xca\x02\xda\x41\x1b\x65xternal_system,update_mask\x82\xd3\xe4\x93\x02\xa5\x02\x32Q/v1/{external_system.name=organizations/*/sources/*/findings/*/externalSystems/*}:\x0f\x65xternal_systemZ^2K/v1/{external_system.name=folders/*/sources/*/findings/*/externalSystems/*}:\x0f\x65xternal_systemZ_2L/v1/{external_system.name=projects/*/sources/*/findings/*/externalSystems/*}:\x0f\x65xternal_system\x12\xc1\x02\n\rUpdateFinding\x12\x34.google.cloud.securitycenter.v1.UpdateFindingRequest\x1a\'.google.cloud.securitycenter.v1.Finding\"\xd0\x01\xda\x41\x07\x66inding\x82\xd3\xe4\x93\x02\xbf\x01\x32\x37/v1/{finding.name=organizations/*/sources/*/findings/*}:\x07\x66indingZ<21/v1/{finding.name=folders/*/sources/*/findings/*}:\x07\x66indingZ=22/v1/{finding.name=projects/*/sources/*/findings/*}:\x07\x66inding\x12\xc5\x04\n\x10UpdateMuteConfig\x12\x37.google.cloud.securitycenter.v1.UpdateMuteConfigRequest\x1a*.google.cloud.securitycenter.v1.MuteConfig\"\xcb\x03\xda\x41\x17mute_config,update_mask\x82\xd3\xe4\x93\x02\xaa\x03\x32\x34/v1/{mute_config.name=organizations/*/muteConfigs/*}:\x0bmute_configZ=2./v1/{mute_config.name=folders/*/muteConfigs/*}:\x0bmute_configZ>2//v1/{mute_config.name=projects/*/muteConfigs/*}:\x0bmute_configZO2@/v1/{mute_config.name=organizations/*/locations/*/muteConfigs/*}:\x0bmute_configZI2:/v1/{mute_config.name=folders/*/locations/*/muteConfigs/*}:\x0bmute_configZJ2;/v1/{mute_config.name=projects/*/locations/*/muteConfigs/*}:\x0bmute_config\x12\xdb\x03\n\x18UpdateNotificationConfig\x12?.google.cloud.securitycenter.v1.UpdateNotificationConfigRequest\x1a\x32.google.cloud.securitycenter.v1.NotificationConfig\"\xc9\x02\xda\x41\x13notification_config\xda\x41\x1fnotification_config,update_mask\x82\xd3\xe4\x93\x02\x8a\x02\x32\x44/v1/{notification_config.name=organizations/*/notificationConfigs/*}:\x13notification_configZU2>/v1/{notification_config.name=folders/*/notificationConfigs/*}:\x13notification_configZV2?/v1/{notification_config.name=projects/*/notificationConfigs/*}:\x13notification_config\x12\x93\x02\n\x1aUpdateOrganizationSettings\x12\x41.google.cloud.securitycenter.v1.UpdateOrganizationSettingsRequest\x1a\x34.google.cloud.securitycenter.v1.OrganizationSettings\"|\xda\x41\x15organization_settings\x82\xd3\xe4\x93\x02^2E/v1/{organization_settings.name=organizations/*/organizationSettings}:\x15organization_settings\x12\xd4\x05\n)UpdateSecurityHealthAnalyticsCustomModule\x12P.google.cloud.securitycenter.v1.UpdateSecurityHealthAnalyticsCustomModuleRequest\x1a\x43.google.cloud.securitycenter.v1.SecurityHealthAnalyticsCustomModule\"\x8f\x04\xda\x41\x33security_health_analytics_custom_module,update_mask\x82\xd3\xe4\x93\x02\xd2\x03\x32r/v1/{security_health_analytics_custom_module.name=organizations/*/securityHealthAnalyticsSettings/customModules/*}:\'security_health_analytics_custom_moduleZ\x97\x01\x32l/v1/{security_health_analytics_custom_module.name=folders/*/securityHealthAnalyticsSettings/customModules/*}:\'security_health_analytics_custom_moduleZ\x98\x01\x32m/v1/{security_health_analytics_custom_module.name=projects/*/securityHealthAnalyticsSettings/customModules/*}:\'security_health_analytics_custom_module\x12\xb1\x01\n\x0cUpdateSource\x12\x33.google.cloud.securitycenter.v1.UpdateSourceRequest\x1a&.google.cloud.securitycenter.v1.Source\"D\xda\x41\x06source\x82\xd3\xe4\x93\x02\x35\x32+/v1/{source.name=organizations/*/sources/*}:\x06source\x12\x9f\x05\n\x13UpdateSecurityMarks\x12:.google.cloud.securitycenter.v1.UpdateSecurityMarksRequest\x1a-.google.cloud.securitycenter.v1.SecurityMarks\"\x9c\x04\xda\x41\x0esecurity_marks\x82\xd3\xe4\x93\x02\x84\x04\x32@/v1/{security_marks.name=organizations/*/assets/*/securityMarks}:\x0esecurity_marksZL2:/v1/{security_marks.name=folders/*/assets/*/securityMarks}:\x0esecurity_marksZM2;/v1/{security_marks.name=projects/*/assets/*/securityMarks}:\x0esecurity_marksZ^2L/v1/{security_marks.name=organizations/*/sources/*/findings/*/securityMarks}:\x0esecurity_marksZX2F/v1/{security_marks.name=folders/*/sources/*/findings/*/securityMarks}:\x0esecurity_marksZY2G/v1/{security_marks.name=projects/*/sources/*/findings/*/securityMarks}:\x0esecurity_marks\x12\xf4\x02\n\x14\x43reateBigQueryExport\x12;.google.cloud.securitycenter.v1.CreateBigQueryExportRequest\x1a..google.cloud.securitycenter.v1.BigQueryExport\"\xee\x01\xda\x41+parent,big_query_export,big_query_export_id\x82\xd3\xe4\x93\x02\xb9\x01\",/v1/{parent=organizations/*}/bigQueryExports:\x10\x62ig_query_exportZ:\"&/v1/{parent=folders/*}/bigQueryExports:\x10\x62ig_query_exportZ;\"\'/v1/{parent=projects/*}/bigQueryExports:\x10\x62ig_query_export\x12\xff\x01\n\x14\x44\x65leteBigQueryExport\x12;.google.cloud.securitycenter.v1.DeleteBigQueryExportRequest\x1a\x16.google.protobuf.Empty\"\x91\x01\xda\x41\x04name\x82\xd3\xe4\x93\x02\x83\x01*,/v1/{name=organizations/*/bigQueryExports/*}Z(*&/v1/{name=folders/*/bigQueryExports/*}Z)*\'/v1/{name=projects/*/bigQueryExports/*}\x12\x98\x03\n\x14UpdateBigQueryExport\x12;.google.cloud.securitycenter.v1.UpdateBigQueryExportRequest\x1a..google.cloud.securitycenter.v1.BigQueryExport\"\x92\x02\xda\x41\x1c\x62ig_query_export,update_mask\x82\xd3\xe4\x93\x02\xec\x01\x32=/v1/{big_query_export.name=organizations/*/bigQueryExports/*}:\x10\x62ig_query_exportZK27/v1/{big_query_export.name=folders/*/bigQueryExports/*}:\x10\x62ig_query_exportZL28/v1/{big_query_export.name=projects/*/bigQueryExports/*}:\x10\x62ig_query_export\x12\xa4\x02\n\x13ListBigQueryExports\x12:.google.cloud.securitycenter.v1.ListBigQueryExportsRequest\x1a;.google.cloud.securitycenter.v1.ListBigQueryExportsResponse\"\x93\x01\xda\x41\x06parent\x82\xd3\xe4\x93\x02\x83\x01\x12,/v1/{parent=organizations/*}/bigQueryExportsZ(\x12&/v1/{parent=folders/*}/bigQueryExportsZ)\x12\'/v1/{parent=projects/*}/bigQueryExports\x12\xb7\x04\n&CreateEventThreatDetectionCustomModule\x12M.google.cloud.securitycenter.v1.CreateEventThreatDetectionCustomModuleRequest\x1a@.google.cloud.securitycenter.v1.EventThreatDetectionCustomModule\"\xfb\x02\xda\x41+parent,event_threat_detection_custom_module\x82\xd3\xe4\x93\x02\xc6\x02\"G/v1/{parent=organizations/*/eventThreatDetectionSettings}/customModules:$event_threat_detection_custom_moduleZi\"A/v1/{parent=folders/*/eventThreatDetectionSettings}/customModules:$event_threat_detection_custom_moduleZj\"B/v1/{parent=projects/*/eventThreatDetectionSettings}/customModules:$event_threat_detection_custom_module\x12\xf4\x02\n&DeleteEventThreatDetectionCustomModule\x12M.google.cloud.securitycenter.v1.DeleteEventThreatDetectionCustomModuleRequest\x1a\x16.google.protobuf.Empty\"\xe2\x01\xda\x41\x04name\x82\xd3\xe4\x93\x02\xd4\x01*G/v1/{name=organizations/*/eventThreatDetectionSettings/customModules/*}ZC*A/v1/{name=folders/*/eventThreatDetectionSettings/customModules/*}ZD*B/v1/{name=projects/*/eventThreatDetectionSettings/customModules/*}\x12\x98\x03\n#GetEventThreatDetectionCustomModule\x12J.google.cloud.securitycenter.v1.GetEventThreatDetectionCustomModuleRequest\x1a@.google.cloud.securitycenter.v1.EventThreatDetectionCustomModule\"\xe2\x01\xda\x41\x04name\x82\xd3\xe4\x93\x02\xd4\x01\x12G/v1/{name=organizations/*/eventThreatDetectionSettings/customModules/*}ZC\x12\x41/v1/{name=folders/*/eventThreatDetectionSettings/customModules/*}ZD\x12\x42/v1/{name=projects/*/eventThreatDetectionSettings/customModules/*}\x12\xf6\x03\n/ListDescendantEventThreatDetectionCustomModules\x12V.google.cloud.securitycenter.v1.ListDescendantEventThreatDetectionCustomModulesRequest\x1aW.google.cloud.securitycenter.v1.ListDescendantEventThreatDetectionCustomModulesResponse\"\x91\x02\xda\x41\x06parent\x82\xd3\xe4\x93\x02\x81\x02\x12V/v1/{parent=organizations/*/eventThreatDetectionSettings}/customModules:listDescendantZR\x12P/v1/{parent=folders/*/eventThreatDetectionSettings}/customModules:listDescendantZS\x12Q/v1/{parent=projects/*/eventThreatDetectionSettings}/customModules:listDescendant\x12\xab\x03\n%ListEventThreatDetectionCustomModules\x12L.google.cloud.securitycenter.v1.ListEventThreatDetectionCustomModulesRequest\x1aM.google.cloud.securitycenter.v1.ListEventThreatDetectionCustomModulesResponse\"\xe4\x01\xda\x41\x06parent\x82\xd3\xe4\x93\x02\xd4\x01\x12G/v1/{parent=organizations/*/eventThreatDetectionSettings}/customModulesZC\x12\x41/v1/{parent=folders/*/eventThreatDetectionSettings}/customModulesZD\x12\x42/v1/{parent=projects/*/eventThreatDetectionSettings}/customModules\x12\xad\x05\n&UpdateEventThreatDetectionCustomModule\x12M.google.cloud.securitycenter.v1.UpdateEventThreatDetectionCustomModuleRequest\x1a@.google.cloud.securitycenter.v1.EventThreatDetectionCustomModule\"\xf1\x03\xda\x41\x30\x65vent_threat_detection_custom_module,update_mask\x82\xd3\xe4\x93\x02\xb7\x03\x32l/v1/{event_threat_detection_custom_module.name=organizations/*/eventThreatDetectionSettings/customModules/*}:$event_threat_detection_custom_moduleZ\x8e\x01\x32\x66/v1/{event_threat_detection_custom_module.name=folders/*/eventThreatDetectionSettings/customModules/*}:$event_threat_detection_custom_moduleZ\x8f\x01\x32g/v1/{event_threat_detection_custom_module.name=projects/*/eventThreatDetectionSettings/customModules/*}:$event_threat_detection_custom_module\x12\xc9\x03\n(ValidateEventThreatDetectionCustomModule\x12O.google.cloud.securitycenter.v1.ValidateEventThreatDetectionCustomModuleRequest\x1aP.google.cloud.securitycenter.v1.ValidateEventThreatDetectionCustomModuleResponse\"\xf9\x01\x82\xd3\xe4\x93\x02\xf2\x01\"N/v1/{parent=organizations/*/eventThreatDetectionSettings}:validateCustomModule:\x01*ZM\"H/v1/{parent=folders/*/eventThreatDetectionSettings}:validateCustomModule:\x01*ZN\"I/v1/{parent=projects/*/eventThreatDetectionSettings}:validateCustomModule:\x01*\x12\xce\x03\n,GetEffectiveEventThreatDetectionCustomModule\x12S.google.cloud.securitycenter.v1.GetEffectiveEventThreatDetectionCustomModuleRequest\x1aI.google.cloud.securitycenter.v1.EffectiveEventThreatDetectionCustomModule\"\xfd\x01\xda\x41\x04name\x82\xd3\xe4\x93\x02\xef\x01\x12P/v1/{name=organizations/*/eventThreatDetectionSettings/effectiveCustomModules/*}ZL\x12J/v1/{name=folders/*/eventThreatDetectionSettings/effectiveCustomModules/*}ZM\x12K/v1/{name=projects/*/eventThreatDetectionSettings/effectiveCustomModules/*}\x12\xe1\x03\n.ListEffectiveEventThreatDetectionCustomModules\x12U.google.cloud.securitycenter.v1.ListEffectiveEventThreatDetectionCustomModulesRequest\x1aV.google.cloud.securitycenter.v1.ListEffectiveEventThreatDetectionCustomModulesResponse\"\xff\x01\xda\x41\x06parent\x82\xd3\xe4\x93\x02\xef\x01\x12P/v1/{parent=organizations/*/eventThreatDetectionSettings}/effectiveCustomModulesZL\x12J/v1/{parent=folders/*/eventThreatDetectionSettings}/effectiveCustomModulesZM\x12K/v1/{parent=projects/*/eventThreatDetectionSettings}/effectiveCustomModules\x12\x8e\x02\n\x1f\x42\x61tchCreateResourceValueConfigs\x12\x46.google.cloud.securitycenter.v1.BatchCreateResourceValueConfigsRequest\x1aG.google.cloud.securitycenter.v1.BatchCreateResourceValueConfigsResponse\"Z\xda\x41\x0fparent,requests\x82\xd3\xe4\x93\x02\x42\"=/v1/{parent=organizations/*}/resourceValueConfigs:batchCreate:\x01*\x12\xb7\x01\n\x19\x44\x65leteResourceValueConfig\x12@.google.cloud.securitycenter.v1.DeleteResourceValueConfigRequest\x1a\x16.google.protobuf.Empty\"@\xda\x41\x04name\x82\xd3\xe4\x93\x02\x33*1/v1/{name=organizations/*/resourceValueConfigs/*}\x12\xce\x01\n\x16GetResourceValueConfig\x12=.google.cloud.securitycenter.v1.GetResourceValueConfigRequest\x1a\x33.google.cloud.securitycenter.v1.ResourceValueConfig\"@\xda\x41\x04name\x82\xd3\xe4\x93\x02\x33\x12\x31/v1/{name=organizations/*/resourceValueConfigs/*}\x12\xe1\x01\n\x18ListResourceValueConfigs\x12?.google.cloud.securitycenter.v1.ListResourceValueConfigsRequest\x1a@.google.cloud.securitycenter.v1.ListResourceValueConfigsResponse\"B\xda\x41\x06parent\x82\xd3\xe4\x93\x02\x33\x12\x31/v1/{parent=organizations/*}/resourceValueConfigs\x12\x9f\x02\n\x19UpdateResourceValueConfig\x12@.google.cloud.securitycenter.v1.UpdateResourceValueConfigRequest\x1a\x33.google.cloud.securitycenter.v1.ResourceValueConfig\"\x8a\x01\xda\x41!resource_value_config,update_mask\x82\xd3\xe4\x93\x02`2G/v1/{resource_value_config.name=organizations/*/resourceValueConfigs/*}:\x15resource_value_config\x12\xb3\x02\n\x13ListValuedResources\x12:.google.cloud.securitycenter.v1.ListValuedResourcesRequest\x1a;.google.cloud.securitycenter.v1.ListValuedResourcesResponse\"\xa2\x01\xda\x41\x06parent\x82\xd3\xe4\x93\x02\x92\x01\x12:/v1/{parent=organizations/*/simulations/*}/valuedResourcesZT\x12R/v1/{parent=organizations/*/simulations/*/attackExposureResults/*}/valuedResources\x12\xeb\x02\n\x0fListAttackPaths\x12\x36.google.cloud.securitycenter.v1.ListAttackPathsRequest\x1a\x37.google.cloud.securitycenter.v1.ListAttackPathsResponse\"\xe6\x01\xda\x41\x06parent\x82\xd3\xe4\x93\x02\xd6\x01\x12\x36/v1/{parent=organizations/*/simulations/*}/attackPathsZJ\x12H/v1/{parent=organizations/*/simulations/*/valuedResources/*}/attackPathsZP\x12N/v1/{parent=organizations/*/simulations/*/attackExposureResults/*}/attackPaths\x1aQ\xca\x41\x1dsecuritycenter.googleapis.com\xd2\x41.https://www.googleapis.com/auth/cloud-platformB\xe5\x05\n\"com.google.cloud.securitycenter.v1P\x01ZJcloud.google.com/go/securitycenter/apiv1/securitycenterpb;securitycenterpb\xaa\x02\x1eGoogle.Cloud.SecurityCenter.V1\xca\x02\x1eGoogle\\Cloud\\SecurityCenter\\V1\xea\x02!Google::Cloud::SecurityCenter::V1\xea\x41g\n2securitycenter.googleapis.com/OrganizationLocation\x12\x31organizations/{organization}/locations/{location}\xea\x41U\n,securitycenter.googleapis.com/FolderLocation\x12%folders/{folder}/locations/{location}\xea\x41m\n4securitycenter.googleapis.com/OrganizationSimulation\x12\x35organizations/{organization}/simulations/{simulation}\xea\x41\xd7\x01\n:securitycenter.googleapis.com/EventThreatDetectionSettings\x12\x39organizations/{organization}/eventThreatDetectionSettings\x12-folders/{folder}/eventThreatDetectionSettings\x12/projects/{project}/eventThreatDetectionSettingsb\x06proto3" + +pool = ::Google::Protobuf::DescriptorPool.generated_pool +pool.add_serialized_file(descriptor_data) + +module Google + module Cloud + module SecurityCenter + module V1 + BulkMuteFindingsRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.securitycenter.v1.BulkMuteFindingsRequest").msgclass + BulkMuteFindingsRequest::MuteState = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.securitycenter.v1.BulkMuteFindingsRequest.MuteState").enummodule + BulkMuteFindingsResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.securitycenter.v1.BulkMuteFindingsResponse").msgclass + CreateFindingRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.securitycenter.v1.CreateFindingRequest").msgclass + CreateMuteConfigRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.securitycenter.v1.CreateMuteConfigRequest").msgclass + CreateResourceValueConfigRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.securitycenter.v1.CreateResourceValueConfigRequest").msgclass + BatchCreateResourceValueConfigsRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.securitycenter.v1.BatchCreateResourceValueConfigsRequest").msgclass + BatchCreateResourceValueConfigsResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.securitycenter.v1.BatchCreateResourceValueConfigsResponse").msgclass + DeleteResourceValueConfigRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.securitycenter.v1.DeleteResourceValueConfigRequest").msgclass + GetResourceValueConfigRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.securitycenter.v1.GetResourceValueConfigRequest").msgclass + ListResourceValueConfigsRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.securitycenter.v1.ListResourceValueConfigsRequest").msgclass + ListResourceValueConfigsResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.securitycenter.v1.ListResourceValueConfigsResponse").msgclass + UpdateResourceValueConfigRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.securitycenter.v1.UpdateResourceValueConfigRequest").msgclass + CreateNotificationConfigRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.securitycenter.v1.CreateNotificationConfigRequest").msgclass + CreateSecurityHealthAnalyticsCustomModuleRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.securitycenter.v1.CreateSecurityHealthAnalyticsCustomModuleRequest").msgclass + CreateSourceRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.securitycenter.v1.CreateSourceRequest").msgclass + DeleteMuteConfigRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.securitycenter.v1.DeleteMuteConfigRequest").msgclass + DeleteNotificationConfigRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.securitycenter.v1.DeleteNotificationConfigRequest").msgclass + DeleteSecurityHealthAnalyticsCustomModuleRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.securitycenter.v1.DeleteSecurityHealthAnalyticsCustomModuleRequest").msgclass + GetBigQueryExportRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.securitycenter.v1.GetBigQueryExportRequest").msgclass + GetMuteConfigRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.securitycenter.v1.GetMuteConfigRequest").msgclass + GetNotificationConfigRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.securitycenter.v1.GetNotificationConfigRequest").msgclass + GetOrganizationSettingsRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.securitycenter.v1.GetOrganizationSettingsRequest").msgclass + GetEffectiveSecurityHealthAnalyticsCustomModuleRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.securitycenter.v1.GetEffectiveSecurityHealthAnalyticsCustomModuleRequest").msgclass + GetSecurityHealthAnalyticsCustomModuleRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.securitycenter.v1.GetSecurityHealthAnalyticsCustomModuleRequest").msgclass + GetSourceRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.securitycenter.v1.GetSourceRequest").msgclass + GroupAssetsRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.securitycenter.v1.GroupAssetsRequest").msgclass + GroupAssetsResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.securitycenter.v1.GroupAssetsResponse").msgclass + GroupFindingsRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.securitycenter.v1.GroupFindingsRequest").msgclass + GroupFindingsResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.securitycenter.v1.GroupFindingsResponse").msgclass + GroupResult = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.securitycenter.v1.GroupResult").msgclass + ListDescendantSecurityHealthAnalyticsCustomModulesRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.securitycenter.v1.ListDescendantSecurityHealthAnalyticsCustomModulesRequest").msgclass + ListDescendantSecurityHealthAnalyticsCustomModulesResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.securitycenter.v1.ListDescendantSecurityHealthAnalyticsCustomModulesResponse").msgclass + ListValuedResourcesRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.securitycenter.v1.ListValuedResourcesRequest").msgclass + ListValuedResourcesResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.securitycenter.v1.ListValuedResourcesResponse").msgclass + ListAttackPathsRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.securitycenter.v1.ListAttackPathsRequest").msgclass + ListAttackPathsResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.securitycenter.v1.ListAttackPathsResponse").msgclass + GetSimulationRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.securitycenter.v1.GetSimulationRequest").msgclass + GetValuedResourceRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.securitycenter.v1.GetValuedResourceRequest").msgclass + ListMuteConfigsRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.securitycenter.v1.ListMuteConfigsRequest").msgclass + ListMuteConfigsResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.securitycenter.v1.ListMuteConfigsResponse").msgclass + ListNotificationConfigsRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.securitycenter.v1.ListNotificationConfigsRequest").msgclass + ListNotificationConfigsResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.securitycenter.v1.ListNotificationConfigsResponse").msgclass + ListEffectiveSecurityHealthAnalyticsCustomModulesRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.securitycenter.v1.ListEffectiveSecurityHealthAnalyticsCustomModulesRequest").msgclass + ListEffectiveSecurityHealthAnalyticsCustomModulesResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.securitycenter.v1.ListEffectiveSecurityHealthAnalyticsCustomModulesResponse").msgclass + ListSecurityHealthAnalyticsCustomModulesRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.securitycenter.v1.ListSecurityHealthAnalyticsCustomModulesRequest").msgclass + ListSecurityHealthAnalyticsCustomModulesResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.securitycenter.v1.ListSecurityHealthAnalyticsCustomModulesResponse").msgclass + ListSourcesRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.securitycenter.v1.ListSourcesRequest").msgclass + ListSourcesResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.securitycenter.v1.ListSourcesResponse").msgclass + ListAssetsRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.securitycenter.v1.ListAssetsRequest").msgclass + ListAssetsResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.securitycenter.v1.ListAssetsResponse").msgclass + ListAssetsResponse::ListAssetsResult = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.securitycenter.v1.ListAssetsResponse.ListAssetsResult").msgclass + ListAssetsResponse::ListAssetsResult::StateChange = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.securitycenter.v1.ListAssetsResponse.ListAssetsResult.StateChange").enummodule + ListFindingsRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.securitycenter.v1.ListFindingsRequest").msgclass + ListFindingsResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.securitycenter.v1.ListFindingsResponse").msgclass + ListFindingsResponse::ListFindingsResult = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.securitycenter.v1.ListFindingsResponse.ListFindingsResult").msgclass + ListFindingsResponse::ListFindingsResult::Resource = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.securitycenter.v1.ListFindingsResponse.ListFindingsResult.Resource").msgclass + ListFindingsResponse::ListFindingsResult::StateChange = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.securitycenter.v1.ListFindingsResponse.ListFindingsResult.StateChange").enummodule + SetFindingStateRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.securitycenter.v1.SetFindingStateRequest").msgclass + SetMuteRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.securitycenter.v1.SetMuteRequest").msgclass + RunAssetDiscoveryRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.securitycenter.v1.RunAssetDiscoveryRequest").msgclass + SimulateSecurityHealthAnalyticsCustomModuleRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.securitycenter.v1.SimulateSecurityHealthAnalyticsCustomModuleRequest").msgclass + SimulateSecurityHealthAnalyticsCustomModuleRequest::SimulatedResource = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.securitycenter.v1.SimulateSecurityHealthAnalyticsCustomModuleRequest.SimulatedResource").msgclass + SimulateSecurityHealthAnalyticsCustomModuleResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.securitycenter.v1.SimulateSecurityHealthAnalyticsCustomModuleResponse").msgclass + SimulateSecurityHealthAnalyticsCustomModuleResponse::SimulatedResult = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.securitycenter.v1.SimulateSecurityHealthAnalyticsCustomModuleResponse.SimulatedResult").msgclass + UpdateExternalSystemRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.securitycenter.v1.UpdateExternalSystemRequest").msgclass + UpdateFindingRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.securitycenter.v1.UpdateFindingRequest").msgclass + UpdateMuteConfigRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.securitycenter.v1.UpdateMuteConfigRequest").msgclass + UpdateNotificationConfigRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.securitycenter.v1.UpdateNotificationConfigRequest").msgclass + UpdateOrganizationSettingsRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.securitycenter.v1.UpdateOrganizationSettingsRequest").msgclass + UpdateSecurityHealthAnalyticsCustomModuleRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.securitycenter.v1.UpdateSecurityHealthAnalyticsCustomModuleRequest").msgclass + UpdateSourceRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.securitycenter.v1.UpdateSourceRequest").msgclass + UpdateSecurityMarksRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.securitycenter.v1.UpdateSecurityMarksRequest").msgclass + CreateBigQueryExportRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.securitycenter.v1.CreateBigQueryExportRequest").msgclass + UpdateBigQueryExportRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.securitycenter.v1.UpdateBigQueryExportRequest").msgclass + ListBigQueryExportsRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.securitycenter.v1.ListBigQueryExportsRequest").msgclass + ListBigQueryExportsResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.securitycenter.v1.ListBigQueryExportsResponse").msgclass + DeleteBigQueryExportRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.securitycenter.v1.DeleteBigQueryExportRequest").msgclass + CreateEventThreatDetectionCustomModuleRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.securitycenter.v1.CreateEventThreatDetectionCustomModuleRequest").msgclass + ValidateEventThreatDetectionCustomModuleRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.securitycenter.v1.ValidateEventThreatDetectionCustomModuleRequest").msgclass + ValidateEventThreatDetectionCustomModuleResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.securitycenter.v1.ValidateEventThreatDetectionCustomModuleResponse").msgclass + DeleteEventThreatDetectionCustomModuleRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.securitycenter.v1.DeleteEventThreatDetectionCustomModuleRequest").msgclass + GetEventThreatDetectionCustomModuleRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.securitycenter.v1.GetEventThreatDetectionCustomModuleRequest").msgclass + ListDescendantEventThreatDetectionCustomModulesRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.securitycenter.v1.ListDescendantEventThreatDetectionCustomModulesRequest").msgclass + ListDescendantEventThreatDetectionCustomModulesResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.securitycenter.v1.ListDescendantEventThreatDetectionCustomModulesResponse").msgclass + ListEventThreatDetectionCustomModulesRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.securitycenter.v1.ListEventThreatDetectionCustomModulesRequest").msgclass + ListEventThreatDetectionCustomModulesResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.securitycenter.v1.ListEventThreatDetectionCustomModulesResponse").msgclass + UpdateEventThreatDetectionCustomModuleRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.securitycenter.v1.UpdateEventThreatDetectionCustomModuleRequest").msgclass + GetEffectiveEventThreatDetectionCustomModuleRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.securitycenter.v1.GetEffectiveEventThreatDetectionCustomModuleRequest").msgclass + ListEffectiveEventThreatDetectionCustomModulesRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.securitycenter.v1.ListEffectiveEventThreatDetectionCustomModulesRequest").msgclass + ListEffectiveEventThreatDetectionCustomModulesResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.securitycenter.v1.ListEffectiveEventThreatDetectionCustomModulesResponse").msgclass + end + end + end +end diff --git a/owl-bot-staging/google-cloud-security_center-v1/lib/google/cloud/securitycenter/v1/securitycenter_service_services_pb.rb b/owl-bot-staging/google-cloud-security_center-v1/lib/google/cloud/securitycenter/v1/securitycenter_service_services_pb.rb new file mode 100644 index 000000000000..0d62cc122298 --- /dev/null +++ b/owl-bot-staging/google-cloud-security_center-v1/lib/google/cloud/securitycenter/v1/securitycenter_service_services_pb.rb @@ -0,0 +1,226 @@ +# Generated by the protocol buffer compiler. DO NOT EDIT! +# Source: google/cloud/securitycenter/v1/securitycenter_service.proto for package 'Google.Cloud.SecurityCenter.V1' +# Original file comments: +# 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 +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# + +require 'grpc' +require 'google/cloud/securitycenter/v1/securitycenter_service_pb' + +module Google + module Cloud + module SecurityCenter + module V1 + module SecurityCenter + # V1 APIs for Security Center service. + class Service + + include ::GRPC::GenericService + + self.marshal_class_method = :encode + self.unmarshal_class_method = :decode + self.service_name = 'google.cloud.securitycenter.v1.SecurityCenter' + + # Kicks off an LRO to bulk mute findings for a parent based on a filter. The + # parent can be either an organization, folder or project. The findings + # matched by the filter will be muted after the LRO is done. + rpc :BulkMuteFindings, ::Google::Cloud::SecurityCenter::V1::BulkMuteFindingsRequest, ::Google::Longrunning::Operation + # Creates a resident SecurityHealthAnalyticsCustomModule at the scope of the + # given CRM parent, and also creates inherited + # SecurityHealthAnalyticsCustomModules for all CRM descendants of the given + # parent. These modules are enabled by default. + rpc :CreateSecurityHealthAnalyticsCustomModule, ::Google::Cloud::SecurityCenter::V1::CreateSecurityHealthAnalyticsCustomModuleRequest, ::Google::Cloud::SecurityCenter::V1::SecurityHealthAnalyticsCustomModule + # Creates a source. + rpc :CreateSource, ::Google::Cloud::SecurityCenter::V1::CreateSourceRequest, ::Google::Cloud::SecurityCenter::V1::Source + # Creates a finding. The corresponding source must exist for finding creation + # to succeed. + rpc :CreateFinding, ::Google::Cloud::SecurityCenter::V1::CreateFindingRequest, ::Google::Cloud::SecurityCenter::V1::Finding + # Creates a mute config. + rpc :CreateMuteConfig, ::Google::Cloud::SecurityCenter::V1::CreateMuteConfigRequest, ::Google::Cloud::SecurityCenter::V1::MuteConfig + # Creates a notification config. + rpc :CreateNotificationConfig, ::Google::Cloud::SecurityCenter::V1::CreateNotificationConfigRequest, ::Google::Cloud::SecurityCenter::V1::NotificationConfig + # Deletes an existing mute config. + rpc :DeleteMuteConfig, ::Google::Cloud::SecurityCenter::V1::DeleteMuteConfigRequest, ::Google::Protobuf::Empty + # Deletes a notification config. + rpc :DeleteNotificationConfig, ::Google::Cloud::SecurityCenter::V1::DeleteNotificationConfigRequest, ::Google::Protobuf::Empty + # Deletes the specified SecurityHealthAnalyticsCustomModule and all of its + # descendants in the CRM hierarchy. This method is only supported for + # resident custom modules. + rpc :DeleteSecurityHealthAnalyticsCustomModule, ::Google::Cloud::SecurityCenter::V1::DeleteSecurityHealthAnalyticsCustomModuleRequest, ::Google::Protobuf::Empty + # Get the simulation by name or the latest simulation for the given + # organization. + rpc :GetSimulation, ::Google::Cloud::SecurityCenter::V1::GetSimulationRequest, ::Google::Cloud::SecurityCenter::V1::Simulation + # Get the valued resource by name + rpc :GetValuedResource, ::Google::Cloud::SecurityCenter::V1::GetValuedResourceRequest, ::Google::Cloud::SecurityCenter::V1::ValuedResource + # Gets a BigQuery export. + rpc :GetBigQueryExport, ::Google::Cloud::SecurityCenter::V1::GetBigQueryExportRequest, ::Google::Cloud::SecurityCenter::V1::BigQueryExport + # Gets the access control policy on the specified Source. + rpc :GetIamPolicy, ::Google::Iam::V1::GetIamPolicyRequest, ::Google::Iam::V1::Policy + # Gets a mute config. + rpc :GetMuteConfig, ::Google::Cloud::SecurityCenter::V1::GetMuteConfigRequest, ::Google::Cloud::SecurityCenter::V1::MuteConfig + # Gets a notification config. + rpc :GetNotificationConfig, ::Google::Cloud::SecurityCenter::V1::GetNotificationConfigRequest, ::Google::Cloud::SecurityCenter::V1::NotificationConfig + # Gets the settings for an organization. + rpc :GetOrganizationSettings, ::Google::Cloud::SecurityCenter::V1::GetOrganizationSettingsRequest, ::Google::Cloud::SecurityCenter::V1::OrganizationSettings + # Retrieves an EffectiveSecurityHealthAnalyticsCustomModule. + rpc :GetEffectiveSecurityHealthAnalyticsCustomModule, ::Google::Cloud::SecurityCenter::V1::GetEffectiveSecurityHealthAnalyticsCustomModuleRequest, ::Google::Cloud::SecurityCenter::V1::EffectiveSecurityHealthAnalyticsCustomModule + # Retrieves a SecurityHealthAnalyticsCustomModule. + rpc :GetSecurityHealthAnalyticsCustomModule, ::Google::Cloud::SecurityCenter::V1::GetSecurityHealthAnalyticsCustomModuleRequest, ::Google::Cloud::SecurityCenter::V1::SecurityHealthAnalyticsCustomModule + # Gets a source. + rpc :GetSource, ::Google::Cloud::SecurityCenter::V1::GetSourceRequest, ::Google::Cloud::SecurityCenter::V1::Source + # Filters an organization's assets and groups them by their specified + # properties. + rpc :GroupAssets, ::Google::Cloud::SecurityCenter::V1::GroupAssetsRequest, ::Google::Cloud::SecurityCenter::V1::GroupAssetsResponse + # Filters an organization or source's findings and groups them by their + # specified properties. + # + # To group across all sources provide a `-` as the source id. + # Example: /v1/organizations/{organization_id}/sources/-/findings, + # /v1/folders/{folder_id}/sources/-/findings, + # /v1/projects/{project_id}/sources/-/findings + rpc :GroupFindings, ::Google::Cloud::SecurityCenter::V1::GroupFindingsRequest, ::Google::Cloud::SecurityCenter::V1::GroupFindingsResponse + # Lists an organization's assets. + rpc :ListAssets, ::Google::Cloud::SecurityCenter::V1::ListAssetsRequest, ::Google::Cloud::SecurityCenter::V1::ListAssetsResponse + # Returns a list of all resident SecurityHealthAnalyticsCustomModules under + # the given CRM parent and all of the parent’s CRM descendants. + rpc :ListDescendantSecurityHealthAnalyticsCustomModules, ::Google::Cloud::SecurityCenter::V1::ListDescendantSecurityHealthAnalyticsCustomModulesRequest, ::Google::Cloud::SecurityCenter::V1::ListDescendantSecurityHealthAnalyticsCustomModulesResponse + # Lists an organization or source's findings. + # + # To list across all sources provide a `-` as the source id. + # Example: /v1/organizations/{organization_id}/sources/-/findings + rpc :ListFindings, ::Google::Cloud::SecurityCenter::V1::ListFindingsRequest, ::Google::Cloud::SecurityCenter::V1::ListFindingsResponse + # Lists mute configs. + rpc :ListMuteConfigs, ::Google::Cloud::SecurityCenter::V1::ListMuteConfigsRequest, ::Google::Cloud::SecurityCenter::V1::ListMuteConfigsResponse + # Lists notification configs. + rpc :ListNotificationConfigs, ::Google::Cloud::SecurityCenter::V1::ListNotificationConfigsRequest, ::Google::Cloud::SecurityCenter::V1::ListNotificationConfigsResponse + # Returns a list of all EffectiveSecurityHealthAnalyticsCustomModules for the + # given parent. This includes resident modules defined at the scope of the + # parent, and inherited modules, inherited from CRM ancestors. + rpc :ListEffectiveSecurityHealthAnalyticsCustomModules, ::Google::Cloud::SecurityCenter::V1::ListEffectiveSecurityHealthAnalyticsCustomModulesRequest, ::Google::Cloud::SecurityCenter::V1::ListEffectiveSecurityHealthAnalyticsCustomModulesResponse + # Returns a list of all SecurityHealthAnalyticsCustomModules for the given + # parent. This includes resident modules defined at the scope of the parent, + # and inherited modules, inherited from CRM ancestors. + rpc :ListSecurityHealthAnalyticsCustomModules, ::Google::Cloud::SecurityCenter::V1::ListSecurityHealthAnalyticsCustomModulesRequest, ::Google::Cloud::SecurityCenter::V1::ListSecurityHealthAnalyticsCustomModulesResponse + # Lists all sources belonging to an organization. + rpc :ListSources, ::Google::Cloud::SecurityCenter::V1::ListSourcesRequest, ::Google::Cloud::SecurityCenter::V1::ListSourcesResponse + # Runs asset discovery. The discovery is tracked with a long-running + # operation. + # + # This API can only be called with limited frequency for an organization. If + # it is called too frequently the caller will receive a TOO_MANY_REQUESTS + # error. + rpc :RunAssetDiscovery, ::Google::Cloud::SecurityCenter::V1::RunAssetDiscoveryRequest, ::Google::Longrunning::Operation + # Updates the state of a finding. + rpc :SetFindingState, ::Google::Cloud::SecurityCenter::V1::SetFindingStateRequest, ::Google::Cloud::SecurityCenter::V1::Finding + # Updates the mute state of a finding. + rpc :SetMute, ::Google::Cloud::SecurityCenter::V1::SetMuteRequest, ::Google::Cloud::SecurityCenter::V1::Finding + # Sets the access control policy on the specified Source. + rpc :SetIamPolicy, ::Google::Iam::V1::SetIamPolicyRequest, ::Google::Iam::V1::Policy + # Returns the permissions that a caller has on the specified source. + rpc :TestIamPermissions, ::Google::Iam::V1::TestIamPermissionsRequest, ::Google::Iam::V1::TestIamPermissionsResponse + # Simulates a given SecurityHealthAnalyticsCustomModule and Resource. + rpc :SimulateSecurityHealthAnalyticsCustomModule, ::Google::Cloud::SecurityCenter::V1::SimulateSecurityHealthAnalyticsCustomModuleRequest, ::Google::Cloud::SecurityCenter::V1::SimulateSecurityHealthAnalyticsCustomModuleResponse + # Updates external system. This is for a given finding. + rpc :UpdateExternalSystem, ::Google::Cloud::SecurityCenter::V1::UpdateExternalSystemRequest, ::Google::Cloud::SecurityCenter::V1::ExternalSystem + # Creates or updates a finding. The corresponding source must exist for a + # finding creation to succeed. + rpc :UpdateFinding, ::Google::Cloud::SecurityCenter::V1::UpdateFindingRequest, ::Google::Cloud::SecurityCenter::V1::Finding + # Updates a mute config. + rpc :UpdateMuteConfig, ::Google::Cloud::SecurityCenter::V1::UpdateMuteConfigRequest, ::Google::Cloud::SecurityCenter::V1::MuteConfig + # + # Updates a notification config. The following update + # fields are allowed: description, pubsub_topic, streaming_config.filter + rpc :UpdateNotificationConfig, ::Google::Cloud::SecurityCenter::V1::UpdateNotificationConfigRequest, ::Google::Cloud::SecurityCenter::V1::NotificationConfig + # Updates an organization's settings. + rpc :UpdateOrganizationSettings, ::Google::Cloud::SecurityCenter::V1::UpdateOrganizationSettingsRequest, ::Google::Cloud::SecurityCenter::V1::OrganizationSettings + # Updates the SecurityHealthAnalyticsCustomModule under the given name based + # on the given update mask. Updating the enablement state is supported on + # both resident and inherited modules (though resident modules cannot have an + # enablement state of "inherited"). Updating the display name and custom + # config of a module is supported on resident modules only. + rpc :UpdateSecurityHealthAnalyticsCustomModule, ::Google::Cloud::SecurityCenter::V1::UpdateSecurityHealthAnalyticsCustomModuleRequest, ::Google::Cloud::SecurityCenter::V1::SecurityHealthAnalyticsCustomModule + # Updates a source. + rpc :UpdateSource, ::Google::Cloud::SecurityCenter::V1::UpdateSourceRequest, ::Google::Cloud::SecurityCenter::V1::Source + # Updates security marks. + rpc :UpdateSecurityMarks, ::Google::Cloud::SecurityCenter::V1::UpdateSecurityMarksRequest, ::Google::Cloud::SecurityCenter::V1::SecurityMarks + # Creates a BigQuery export. + rpc :CreateBigQueryExport, ::Google::Cloud::SecurityCenter::V1::CreateBigQueryExportRequest, ::Google::Cloud::SecurityCenter::V1::BigQueryExport + # Deletes an existing BigQuery export. + rpc :DeleteBigQueryExport, ::Google::Cloud::SecurityCenter::V1::DeleteBigQueryExportRequest, ::Google::Protobuf::Empty + # Updates a BigQuery export. + rpc :UpdateBigQueryExport, ::Google::Cloud::SecurityCenter::V1::UpdateBigQueryExportRequest, ::Google::Cloud::SecurityCenter::V1::BigQueryExport + # Lists BigQuery exports. Note that when requesting BigQuery exports at a + # given level all exports under that level are also returned e.g. if + # requesting BigQuery exports under a folder, then all BigQuery exports + # immediately under the folder plus the ones created under the projects + # within the folder are returned. + rpc :ListBigQueryExports, ::Google::Cloud::SecurityCenter::V1::ListBigQueryExportsRequest, ::Google::Cloud::SecurityCenter::V1::ListBigQueryExportsResponse + # Creates a resident Event Threat Detection custom module at the scope of the + # given Resource Manager parent, and also creates inherited custom modules + # for all descendants of the given parent. These modules are enabled by + # default. + rpc :CreateEventThreatDetectionCustomModule, ::Google::Cloud::SecurityCenter::V1::CreateEventThreatDetectionCustomModuleRequest, ::Google::Cloud::SecurityCenter::V1::EventThreatDetectionCustomModule + # Deletes the specified Event Threat Detection custom module and all of its + # descendants in the Resource Manager hierarchy. This method is only + # supported for resident custom modules. + rpc :DeleteEventThreatDetectionCustomModule, ::Google::Cloud::SecurityCenter::V1::DeleteEventThreatDetectionCustomModuleRequest, ::Google::Protobuf::Empty + # Gets an Event Threat Detection custom module. + rpc :GetEventThreatDetectionCustomModule, ::Google::Cloud::SecurityCenter::V1::GetEventThreatDetectionCustomModuleRequest, ::Google::Cloud::SecurityCenter::V1::EventThreatDetectionCustomModule + # Lists all resident Event Threat Detection custom modules under the + # given Resource Manager parent and its descendants. + rpc :ListDescendantEventThreatDetectionCustomModules, ::Google::Cloud::SecurityCenter::V1::ListDescendantEventThreatDetectionCustomModulesRequest, ::Google::Cloud::SecurityCenter::V1::ListDescendantEventThreatDetectionCustomModulesResponse + # Lists all Event Threat Detection custom modules for the given + # Resource Manager parent. This includes resident modules defined at the + # scope of the parent along with modules inherited from ancestors. + rpc :ListEventThreatDetectionCustomModules, ::Google::Cloud::SecurityCenter::V1::ListEventThreatDetectionCustomModulesRequest, ::Google::Cloud::SecurityCenter::V1::ListEventThreatDetectionCustomModulesResponse + # Updates the Event Threat Detection custom module with the given name based + # on the given update mask. Updating the enablement state is supported for + # both resident and inherited modules (though resident modules cannot have an + # enablement state of "inherited"). Updating the display name or + # configuration of a module is supported for resident modules only. The type + # of a module cannot be changed. + rpc :UpdateEventThreatDetectionCustomModule, ::Google::Cloud::SecurityCenter::V1::UpdateEventThreatDetectionCustomModuleRequest, ::Google::Cloud::SecurityCenter::V1::EventThreatDetectionCustomModule + # Validates the given Event Threat Detection custom module. + rpc :ValidateEventThreatDetectionCustomModule, ::Google::Cloud::SecurityCenter::V1::ValidateEventThreatDetectionCustomModuleRequest, ::Google::Cloud::SecurityCenter::V1::ValidateEventThreatDetectionCustomModuleResponse + # Gets an effective Event Threat Detection custom module at the given level. + rpc :GetEffectiveEventThreatDetectionCustomModule, ::Google::Cloud::SecurityCenter::V1::GetEffectiveEventThreatDetectionCustomModuleRequest, ::Google::Cloud::SecurityCenter::V1::EffectiveEventThreatDetectionCustomModule + # Lists all effective Event Threat Detection custom modules for the + # given parent. This includes resident modules defined at the scope of the + # parent along with modules inherited from its ancestors. + rpc :ListEffectiveEventThreatDetectionCustomModules, ::Google::Cloud::SecurityCenter::V1::ListEffectiveEventThreatDetectionCustomModulesRequest, ::Google::Cloud::SecurityCenter::V1::ListEffectiveEventThreatDetectionCustomModulesResponse + # Creates a ResourceValueConfig for an organization. Maps user's tags to + # difference resource values for use by the attack path simulation. + rpc :BatchCreateResourceValueConfigs, ::Google::Cloud::SecurityCenter::V1::BatchCreateResourceValueConfigsRequest, ::Google::Cloud::SecurityCenter::V1::BatchCreateResourceValueConfigsResponse + # Deletes a ResourceValueConfig. + rpc :DeleteResourceValueConfig, ::Google::Cloud::SecurityCenter::V1::DeleteResourceValueConfigRequest, ::Google::Protobuf::Empty + # Gets a ResourceValueConfig. + rpc :GetResourceValueConfig, ::Google::Cloud::SecurityCenter::V1::GetResourceValueConfigRequest, ::Google::Cloud::SecurityCenter::V1::ResourceValueConfig + # Lists all ResourceValueConfigs. + rpc :ListResourceValueConfigs, ::Google::Cloud::SecurityCenter::V1::ListResourceValueConfigsRequest, ::Google::Cloud::SecurityCenter::V1::ListResourceValueConfigsResponse + # Updates an existing ResourceValueConfigs with new rules. + rpc :UpdateResourceValueConfig, ::Google::Cloud::SecurityCenter::V1::UpdateResourceValueConfigRequest, ::Google::Cloud::SecurityCenter::V1::ResourceValueConfig + # Lists the valued resources for a set of simulation results and filter. + rpc :ListValuedResources, ::Google::Cloud::SecurityCenter::V1::ListValuedResourcesRequest, ::Google::Cloud::SecurityCenter::V1::ListValuedResourcesResponse + # Lists the attack paths for a set of simulation results or valued resources + # and filter. + rpc :ListAttackPaths, ::Google::Cloud::SecurityCenter::V1::ListAttackPathsRequest, ::Google::Cloud::SecurityCenter::V1::ListAttackPathsResponse + end + + Stub = Service.rpc_stub_class + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-security_center-v1/lib/google/cloud/securitycenter/v1/simulation_pb.rb b/owl-bot-staging/google-cloud-security_center-v1/lib/google/cloud/securitycenter/v1/simulation_pb.rb new file mode 100644 index 000000000000..577a4d977a3a --- /dev/null +++ b/owl-bot-staging/google-cloud-security_center-v1/lib/google/cloud/securitycenter/v1/simulation_pb.rb @@ -0,0 +1,27 @@ +# frozen_string_literal: true +# Generated by the protocol buffer compiler. DO NOT EDIT! +# source: google/cloud/securitycenter/v1/simulation.proto + +require 'google/protobuf' + +require 'google/api/field_behavior_pb' +require 'google/api/resource_pb' +require 'google/cloud/securitycenter/v1/resource_pb' +require 'google/cloud/securitycenter/v1/valued_resource_pb' +require 'google/protobuf/timestamp_pb' + + +descriptor_data = "\n/google/cloud/securitycenter/v1/simulation.proto\x12\x1egoogle.cloud.securitycenter.v1\x1a\x1fgoogle/api/field_behavior.proto\x1a\x19google/api/resource.proto\x1a-google/cloud/securitycenter/v1/resource.proto\x1a\x34google/cloud/securitycenter/v1/valued_resource.proto\x1a\x1fgoogle/protobuf/timestamp.proto\"\xfc\x02\n\nSimulation\x12\x0c\n\x04name\x18\x01 \x01(\t\x12\x34\n\x0b\x63reate_time\x18\x02 \x01(\x0b\x32\x1a.google.protobuf.TimestampB\x03\xe0\x41\x03\x12\x64\n\x1fresource_value_configs_metadata\x18\x03 \x03(\x0b\x32;.google.cloud.securitycenter.v1.ResourceValueConfigMetadata\x12\x45\n\x0e\x63loud_provider\x18\x04 \x01(\x0e\x32-.google.cloud.securitycenter.v1.CloudProvider:}\xea\x41z\n(securitycenter.googleapis.com/Simulation\x12\x35organizations/{organization}/simulations/{simulation}*\x0bsimulations2\nsimulationB\xe9\x01\n\"com.google.cloud.securitycenter.v1B\x0fSimulationProtoP\x01ZJcloud.google.com/go/securitycenter/apiv1/securitycenterpb;securitycenterpb\xaa\x02\x1eGoogle.Cloud.SecurityCenter.V1\xca\x02\x1eGoogle\\Cloud\\SecurityCenter\\V1\xea\x02!Google::Cloud::SecurityCenter::V1b\x06proto3" + +pool = ::Google::Protobuf::DescriptorPool.generated_pool +pool.add_serialized_file(descriptor_data) + +module Google + module Cloud + module SecurityCenter + module V1 + Simulation = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.securitycenter.v1.Simulation").msgclass + end + end + end +end diff --git a/owl-bot-staging/google-cloud-security_center-v1/lib/google/cloud/securitycenter/v1/source_pb.rb b/owl-bot-staging/google-cloud-security_center-v1/lib/google/cloud/securitycenter/v1/source_pb.rb new file mode 100644 index 000000000000..2f7921ed6f0b --- /dev/null +++ b/owl-bot-staging/google-cloud-security_center-v1/lib/google/cloud/securitycenter/v1/source_pb.rb @@ -0,0 +1,23 @@ +# frozen_string_literal: true +# Generated by the protocol buffer compiler. DO NOT EDIT! +# source: google/cloud/securitycenter/v1/source.proto + +require 'google/protobuf' + +require 'google/api/resource_pb' + + +descriptor_data = "\n+google/cloud/securitycenter/v1/source.proto\x12\x1egoogle.cloud.securitycenter.v1\x1a\x19google/api/resource.proto\"\xfd\x01\n\x06Source\x12\x0c\n\x04name\x18\x01 \x01(\t\x12\x14\n\x0c\x64isplay_name\x18\x02 \x01(\t\x12\x13\n\x0b\x64\x65scription\x18\x03 \x01(\t\x12\x16\n\x0e\x63\x61nonical_name\x18\x0e \x01(\t:\xa1\x01\xea\x41\x9d\x01\n$securitycenter.googleapis.com/Source\x12-organizations/{organization}/sources/{source}\x12!folders/{folder}/sources/{source}\x12#projects/{project}/sources/{source}B\xd8\x01\n\"com.google.cloud.securitycenter.v1P\x01ZJcloud.google.com/go/securitycenter/apiv1/securitycenterpb;securitycenterpb\xaa\x02\x1eGoogle.Cloud.SecurityCenter.V1\xca\x02\x1eGoogle\\Cloud\\SecurityCenter\\V1\xea\x02!Google::Cloud::SecurityCenter::V1b\x06proto3" + +pool = ::Google::Protobuf::DescriptorPool.generated_pool +pool.add_serialized_file(descriptor_data) + +module Google + module Cloud + module SecurityCenter + module V1 + Source = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.securitycenter.v1.Source").msgclass + end + end + end +end diff --git a/owl-bot-staging/google-cloud-security_center-v1/lib/google/cloud/securitycenter/v1/toxic_combination_pb.rb b/owl-bot-staging/google-cloud-security_center-v1/lib/google/cloud/securitycenter/v1/toxic_combination_pb.rb new file mode 100644 index 000000000000..78da4c94159e --- /dev/null +++ b/owl-bot-staging/google-cloud-security_center-v1/lib/google/cloud/securitycenter/v1/toxic_combination_pb.rb @@ -0,0 +1,21 @@ +# frozen_string_literal: true +# Generated by the protocol buffer compiler. DO NOT EDIT! +# source: google/cloud/securitycenter/v1/toxic_combination.proto + +require 'google/protobuf' + + +descriptor_data = "\n6google/cloud/securitycenter/v1/toxic_combination.proto\x12\x1egoogle.cloud.securitycenter.v1\"K\n\x10ToxicCombination\x12\x1d\n\x15\x61ttack_exposure_score\x18\x01 \x01(\x01\x12\x18\n\x10related_findings\x18\x02 \x03(\tB\xef\x01\n\"com.google.cloud.securitycenter.v1B\x15ToxicCombinationProtoP\x01ZJcloud.google.com/go/securitycenter/apiv1/securitycenterpb;securitycenterpb\xaa\x02\x1eGoogle.Cloud.SecurityCenter.V1\xca\x02\x1eGoogle\\Cloud\\SecurityCenter\\V1\xea\x02!Google::Cloud::SecurityCenter::V1b\x06proto3" + +pool = ::Google::Protobuf::DescriptorPool.generated_pool +pool.add_serialized_file(descriptor_data) + +module Google + module Cloud + module SecurityCenter + module V1 + ToxicCombination = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.securitycenter.v1.ToxicCombination").msgclass + end + end + end +end diff --git a/owl-bot-staging/google-cloud-security_center-v1/lib/google/cloud/securitycenter/v1/valued_resource_pb.rb b/owl-bot-staging/google-cloud-security_center-v1/lib/google/cloud/securitycenter/v1/valued_resource_pb.rb new file mode 100644 index 000000000000..c0a8708958bb --- /dev/null +++ b/owl-bot-staging/google-cloud-security_center-v1/lib/google/cloud/securitycenter/v1/valued_resource_pb.rb @@ -0,0 +1,25 @@ +# frozen_string_literal: true +# Generated by the protocol buffer compiler. DO NOT EDIT! +# source: google/cloud/securitycenter/v1/valued_resource.proto + +require 'google/protobuf' + +require 'google/api/resource_pb' + + +descriptor_data = "\n4google/cloud/securitycenter/v1/valued_resource.proto\x12\x1egoogle.cloud.securitycenter.v1\x1a\x19google/api/resource.proto\"\xd8\x04\n\x0eValuedResource\x12\x0c\n\x04name\x18\x01 \x01(\t\x12\x10\n\x08resource\x18\x02 \x01(\t\x12\x15\n\rresource_type\x18\x03 \x01(\t\x12\x14\n\x0c\x64isplay_name\x18\x04 \x01(\t\x12T\n\x0eresource_value\x18\x05 \x01(\x0e\x32<.google.cloud.securitycenter.v1.ValuedResource.ResourceValue\x12\x15\n\rexposed_score\x18\x06 \x01(\x01\x12`\n\x1bresource_value_configs_used\x18\x07 \x03(\x0b\x32;.google.cloud.securitycenter.v1.ResourceValueConfigMetadata\"{\n\rResourceValue\x12\x1e\n\x1aRESOURCE_VALUE_UNSPECIFIED\x10\x00\x12\x16\n\x12RESOURCE_VALUE_LOW\x10\x01\x12\x19\n\x15RESOURCE_VALUE_MEDIUM\x10\x02\x12\x17\n\x13RESOURCE_VALUE_HIGH\x10\x03:\xac\x01\xea\x41\xa8\x01\n,securitycenter.googleapis.com/ValuedResource\x12Worganizations/{organization}/simulations/{simulation}/valuedResources/{valued_resource}*\x0fvaluedResources2\x0evaluedResource\"+\n\x1bResourceValueConfigMetadata\x12\x0c\n\x04name\x18\x01 \x01(\tB\xed\x01\n\"com.google.cloud.securitycenter.v1B\x13ValuedResourceProtoP\x01ZJcloud.google.com/go/securitycenter/apiv1/securitycenterpb;securitycenterpb\xaa\x02\x1eGoogle.Cloud.SecurityCenter.V1\xca\x02\x1eGoogle\\Cloud\\SecurityCenter\\V1\xea\x02!Google::Cloud::SecurityCenter::V1b\x06proto3" + +pool = ::Google::Protobuf::DescriptorPool.generated_pool +pool.add_serialized_file(descriptor_data) + +module Google + module Cloud + module SecurityCenter + module V1 + ValuedResource = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.securitycenter.v1.ValuedResource").msgclass + ValuedResource::ResourceValue = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.securitycenter.v1.ValuedResource.ResourceValue").enummodule + ResourceValueConfigMetadata = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.securitycenter.v1.ResourceValueConfigMetadata").msgclass + end + end + end +end diff --git a/owl-bot-staging/google-cloud-security_center-v1/lib/google/cloud/securitycenter/v1/vulnerability_pb.rb b/owl-bot-staging/google-cloud-security_center-v1/lib/google/cloud/securitycenter/v1/vulnerability_pb.rb new file mode 100644 index 000000000000..64dcf8c6b5f7 --- /dev/null +++ b/owl-bot-staging/google-cloud-security_center-v1/lib/google/cloud/securitycenter/v1/vulnerability_pb.rb @@ -0,0 +1,36 @@ +# frozen_string_literal: true +# Generated by the protocol buffer compiler. DO NOT EDIT! +# source: google/cloud/securitycenter/v1/vulnerability.proto + +require 'google/protobuf' + +require 'google/protobuf/timestamp_pb' + + +descriptor_data = "\n2google/cloud/securitycenter/v1/vulnerability.proto\x12\x1egoogle.cloud.securitycenter.v1\x1a\x1fgoogle/protobuf/timestamp.proto\"\x92\x02\n\rVulnerability\x12\x30\n\x03\x63ve\x18\x01 \x01(\x0b\x32#.google.cloud.securitycenter.v1.Cve\x12\x42\n\x11offending_package\x18\x02 \x01(\x0b\x32\'.google.cloud.securitycenter.v1.Package\x12>\n\rfixed_package\x18\x03 \x01(\x0b\x32\'.google.cloud.securitycenter.v1.Package\x12K\n\x11security_bulletin\x18\x04 \x01(\x0b\x32\x30.google.cloud.securitycenter.v1.SecurityBulletin\"\x8a\x05\n\x03\x43ve\x12\n\n\x02id\x18\x01 \x01(\t\x12=\n\nreferences\x18\x02 \x03(\x0b\x32).google.cloud.securitycenter.v1.Reference\x12\x36\n\x06\x63vssv3\x18\x03 \x01(\x0b\x32&.google.cloud.securitycenter.v1.Cvssv3\x12\x1e\n\x16upstream_fix_available\x18\x04 \x01(\x08\x12>\n\x06impact\x18\x05 \x01(\x0e\x32..google.cloud.securitycenter.v1.Cve.RiskRating\x12W\n\x15\x65xploitation_activity\x18\x06 \x01(\x0e\x32\x38.google.cloud.securitycenter.v1.Cve.ExploitationActivity\x12\x1c\n\x14observed_in_the_wild\x18\x07 \x01(\x08\x12\x10\n\x08zero_day\x18\x08 \x01(\x08\x12\x38\n\x14\x65xploit_release_date\x18\t \x01(\x0b\x32\x1a.google.protobuf.Timestamp\"V\n\nRiskRating\x12\x1b\n\x17RISK_RATING_UNSPECIFIED\x10\x00\x12\x07\n\x03LOW\x10\x01\x12\n\n\x06MEDIUM\x10\x02\x12\x08\n\x04HIGH\x10\x03\x12\x0c\n\x08\x43RITICAL\x10\x04\"\x84\x01\n\x14\x45xploitationActivity\x12%\n!EXPLOITATION_ACTIVITY_UNSPECIFIED\x10\x00\x12\x08\n\x04WIDE\x10\x01\x12\r\n\tCONFIRMED\x10\x02\x12\r\n\tAVAILABLE\x10\x03\x12\x0f\n\x0b\x41NTICIPATED\x10\x04\x12\x0c\n\x08NO_KNOWN\x10\x05\"(\n\tReference\x12\x0e\n\x06source\x18\x01 \x01(\t\x12\x0b\n\x03uri\x18\x02 \x01(\t\"\xb1\n\n\x06\x43vssv3\x12\x12\n\nbase_score\x18\x01 \x01(\x01\x12J\n\rattack_vector\x18\x05 \x01(\x0e\x32\x33.google.cloud.securitycenter.v1.Cvssv3.AttackVector\x12R\n\x11\x61ttack_complexity\x18\x06 \x01(\x0e\x32\x37.google.cloud.securitycenter.v1.Cvssv3.AttackComplexity\x12V\n\x13privileges_required\x18\x07 \x01(\x0e\x32\x39.google.cloud.securitycenter.v1.Cvssv3.PrivilegesRequired\x12P\n\x10user_interaction\x18\x08 \x01(\x0e\x32\x36.google.cloud.securitycenter.v1.Cvssv3.UserInteraction\x12;\n\x05scope\x18\t \x01(\x0e\x32,.google.cloud.securitycenter.v1.Cvssv3.Scope\x12M\n\x16\x63onfidentiality_impact\x18\n \x01(\x0e\x32-.google.cloud.securitycenter.v1.Cvssv3.Impact\x12G\n\x10integrity_impact\x18\x0b \x01(\x0e\x32-.google.cloud.securitycenter.v1.Cvssv3.Impact\x12J\n\x13\x61vailability_impact\x18\x0c \x01(\x0e\x32-.google.cloud.securitycenter.v1.Cvssv3.Impact\"\x99\x01\n\x0c\x41ttackVector\x12\x1d\n\x19\x41TTACK_VECTOR_UNSPECIFIED\x10\x00\x12\x19\n\x15\x41TTACK_VECTOR_NETWORK\x10\x01\x12\x1a\n\x16\x41TTACK_VECTOR_ADJACENT\x10\x02\x12\x17\n\x13\x41TTACK_VECTOR_LOCAL\x10\x03\x12\x1a\n\x16\x41TTACK_VECTOR_PHYSICAL\x10\x04\"l\n\x10\x41ttackComplexity\x12!\n\x1d\x41TTACK_COMPLEXITY_UNSPECIFIED\x10\x00\x12\x19\n\x15\x41TTACK_COMPLEXITY_LOW\x10\x01\x12\x1a\n\x16\x41TTACK_COMPLEXITY_HIGH\x10\x02\"\x92\x01\n\x12PrivilegesRequired\x12#\n\x1fPRIVILEGES_REQUIRED_UNSPECIFIED\x10\x00\x12\x1c\n\x18PRIVILEGES_REQUIRED_NONE\x10\x01\x12\x1b\n\x17PRIVILEGES_REQUIRED_LOW\x10\x02\x12\x1c\n\x18PRIVILEGES_REQUIRED_HIGH\x10\x03\"m\n\x0fUserInteraction\x12 \n\x1cUSER_INTERACTION_UNSPECIFIED\x10\x00\x12\x19\n\x15USER_INTERACTION_NONE\x10\x01\x12\x1d\n\x19USER_INTERACTION_REQUIRED\x10\x02\"F\n\x05Scope\x12\x15\n\x11SCOPE_UNSPECIFIED\x10\x00\x12\x13\n\x0fSCOPE_UNCHANGED\x10\x01\x12\x11\n\rSCOPE_CHANGED\x10\x02\"R\n\x06Impact\x12\x16\n\x12IMPACT_UNSPECIFIED\x10\x00\x12\x0f\n\x0bIMPACT_HIGH\x10\x01\x12\x0e\n\nIMPACT_LOW\x10\x02\x12\x0f\n\x0bIMPACT_NONE\x10\x03\"_\n\x07Package\x12\x14\n\x0cpackage_name\x18\x01 \x01(\t\x12\x0f\n\x07\x63pe_uri\x18\x02 \x01(\t\x12\x14\n\x0cpackage_type\x18\x03 \x01(\t\x12\x17\n\x0fpackage_version\x18\x04 \x01(\t\"\x7f\n\x10SecurityBulletin\x12\x13\n\x0b\x62ulletin_id\x18\x01 \x01(\t\x12\x33\n\x0fsubmission_time\x18\x02 \x01(\x0b\x32\x1a.google.protobuf.Timestamp\x12!\n\x19suggested_upgrade_version\x18\x03 \x01(\tB\xec\x01\n\"com.google.cloud.securitycenter.v1B\x12VulnerabilityProtoP\x01ZJcloud.google.com/go/securitycenter/apiv1/securitycenterpb;securitycenterpb\xaa\x02\x1eGoogle.Cloud.SecurityCenter.V1\xca\x02\x1eGoogle\\Cloud\\SecurityCenter\\V1\xea\x02!Google::Cloud::SecurityCenter::V1b\x06proto3" + +pool = ::Google::Protobuf::DescriptorPool.generated_pool +pool.add_serialized_file(descriptor_data) + +module Google + module Cloud + module SecurityCenter + module V1 + Vulnerability = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.securitycenter.v1.Vulnerability").msgclass + Cve = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.securitycenter.v1.Cve").msgclass + Cve::RiskRating = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.securitycenter.v1.Cve.RiskRating").enummodule + Cve::ExploitationActivity = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.securitycenter.v1.Cve.ExploitationActivity").enummodule + Reference = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.securitycenter.v1.Reference").msgclass + Cvssv3 = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.securitycenter.v1.Cvssv3").msgclass + Cvssv3::AttackVector = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.securitycenter.v1.Cvssv3.AttackVector").enummodule + Cvssv3::AttackComplexity = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.securitycenter.v1.Cvssv3.AttackComplexity").enummodule + Cvssv3::PrivilegesRequired = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.securitycenter.v1.Cvssv3.PrivilegesRequired").enummodule + Cvssv3::UserInteraction = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.securitycenter.v1.Cvssv3.UserInteraction").enummodule + Cvssv3::Scope = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.securitycenter.v1.Cvssv3.Scope").enummodule + Cvssv3::Impact = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.securitycenter.v1.Cvssv3.Impact").enummodule + Package = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.securitycenter.v1.Package").msgclass + SecurityBulletin = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.securitycenter.v1.SecurityBulletin").msgclass + end + end + end +end diff --git a/owl-bot-staging/google-cloud-security_center-v1/proto_docs/README.md b/owl-bot-staging/google-cloud-security_center-v1/proto_docs/README.md new file mode 100644 index 000000000000..2477ff9d487e --- /dev/null +++ b/owl-bot-staging/google-cloud-security_center-v1/proto_docs/README.md @@ -0,0 +1,4 @@ +# Cloud Security Command Center V1 Protocol Buffer Documentation + +These files are for the YARD documentation of the generated protobuf files. +They are not intended to be required or loaded at runtime. diff --git a/owl-bot-staging/google-cloud-security_center-v1/proto_docs/google/api/client.rb b/owl-bot-staging/google-cloud-security_center-v1/proto_docs/google/api/client.rb new file mode 100644 index 000000000000..5089551e9ea4 --- /dev/null +++ b/owl-bot-staging/google-cloud-security_center-v1/proto_docs/google/api/client.rb @@ -0,0 +1,589 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + + +module Google + module Api + # Required information for every language. + # @!attribute [rw] reference_docs_uri + # @deprecated This field is deprecated and may be removed in the next major version update. + # @return [::String] + # Link to automatically generated reference documentation. Example: + # https://cloud.google.com/nodejs/docs/reference/asset/latest + # @!attribute [rw] destinations + # @return [::Array<::Google::Api::ClientLibraryDestination>] + # The destination where API teams want this client library to be published. + # @!attribute [rw] selective_gapic_generation + # @return [::Google::Api::SelectiveGapicGeneration] + # Configuration for which RPCs should be generated in the GAPIC client. + class CommonLanguageSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Details about how and where to publish client libraries. + # @!attribute [rw] version + # @return [::String] + # Version of the API to apply these settings to. This is the full protobuf + # package for the API, ending in the version element. + # Examples: "google.cloud.speech.v1" and "google.spanner.admin.database.v1". + # @!attribute [rw] launch_stage + # @return [::Google::Api::LaunchStage] + # Launch stage of this version of the API. + # @!attribute [rw] rest_numeric_enums + # @return [::Boolean] + # When using transport=rest, the client request will encode enums as + # numbers rather than strings. + # @!attribute [rw] java_settings + # @return [::Google::Api::JavaSettings] + # Settings for legacy Java features, supported in the Service YAML. + # @!attribute [rw] cpp_settings + # @return [::Google::Api::CppSettings] + # Settings for C++ client libraries. + # @!attribute [rw] php_settings + # @return [::Google::Api::PhpSettings] + # Settings for PHP client libraries. + # @!attribute [rw] python_settings + # @return [::Google::Api::PythonSettings] + # Settings for Python client libraries. + # @!attribute [rw] node_settings + # @return [::Google::Api::NodeSettings] + # Settings for Node client libraries. + # @!attribute [rw] dotnet_settings + # @return [::Google::Api::DotnetSettings] + # Settings for .NET client libraries. + # @!attribute [rw] ruby_settings + # @return [::Google::Api::RubySettings] + # Settings for Ruby client libraries. + # @!attribute [rw] go_settings + # @return [::Google::Api::GoSettings] + # Settings for Go client libraries. + class ClientLibrarySettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # This message configures the settings for publishing [Google Cloud Client + # libraries](https://cloud.google.com/apis/docs/cloud-client-libraries) + # generated from the service config. + # @!attribute [rw] method_settings + # @return [::Array<::Google::Api::MethodSettings>] + # A list of API method settings, e.g. the behavior for methods that use the + # long-running operation pattern. + # @!attribute [rw] new_issue_uri + # @return [::String] + # Link to a *public* URI where users can report issues. Example: + # https://issuetracker.google.com/issues/new?component=190865&template=1161103 + # @!attribute [rw] documentation_uri + # @return [::String] + # Link to product home page. Example: + # https://cloud.google.com/asset-inventory/docs/overview + # @!attribute [rw] api_short_name + # @return [::String] + # Used as a tracking tag when collecting data about the APIs developer + # relations artifacts like docs, packages delivered to package managers, + # etc. Example: "speech". + # @!attribute [rw] github_label + # @return [::String] + # GitHub label to apply to issues and pull requests opened for this API. + # @!attribute [rw] codeowner_github_teams + # @return [::Array<::String>] + # GitHub teams to be added to CODEOWNERS in the directory in GitHub + # containing source code for the client libraries for this API. + # @!attribute [rw] doc_tag_prefix + # @return [::String] + # A prefix used in sample code when demarking regions to be included in + # documentation. + # @!attribute [rw] organization + # @return [::Google::Api::ClientLibraryOrganization] + # For whom the client library is being published. + # @!attribute [rw] library_settings + # @return [::Array<::Google::Api::ClientLibrarySettings>] + # Client library settings. If the same version string appears multiple + # times in this list, then the last one wins. Settings from earlier + # settings with the same version string are discarded. + # @!attribute [rw] proto_reference_documentation_uri + # @return [::String] + # Optional link to proto reference documentation. Example: + # https://cloud.google.com/pubsub/lite/docs/reference/rpc + # @!attribute [rw] rest_reference_documentation_uri + # @return [::String] + # Optional link to REST reference documentation. Example: + # https://cloud.google.com/pubsub/lite/docs/reference/rest + class Publishing + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Settings for Java client libraries. + # @!attribute [rw] library_package + # @return [::String] + # The package name to use in Java. Clobbers the java_package option + # set in the protobuf. This should be used **only** by APIs + # who have already set the language_settings.java.package_name" field + # in gapic.yaml. API teams should use the protobuf java_package option + # where possible. + # + # Example of a YAML configuration:: + # + # publishing: + # 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. + # @!attribute [rw] methods + # @return [::Array<::String>] + # An allowlist of the fully qualified names of RPCs that should be included + # on public client surfaces. + # @!attribute [rw] generate_omitted_as_internal + # @return [::Boolean] + # Setting this to true indicates to the client generators that methods + # that would be excluded from the generation should instead be generated + # in a way that indicates these methods should not be consumed by + # end users. How this is expressed is up to individual language + # implementations to decide. Some examples may be: added annotations, + # obfuscated identifiers, or other language idiomatic patterns. + class SelectiveGapicGeneration + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # `BatchingConfigProto` defines the batching configuration for an API method. + # @!attribute [rw] thresholds + # @return [::Google::Api::BatchingSettingsProto] + # The thresholds which trigger a batched request to be sent. + # @!attribute [rw] batch_descriptor + # @return [::Google::Api::BatchingDescriptorProto] + # The request and response fields used in batching. + class BatchingConfigProto + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # `BatchingSettingsProto` specifies a set of batching thresholds, each of + # which acts as a trigger to send a batch of messages as a request. At least + # one threshold must be positive nonzero. + # @!attribute [rw] element_count_threshold + # @return [::Integer] + # The number of elements of a field collected into a batch which, if + # exceeded, causes the batch to be sent. + # @!attribute [rw] request_byte_threshold + # @return [::Integer] + # The aggregated size of the batched field which, if exceeded, causes the + # batch to be sent. This size is computed by aggregating the sizes of the + # request field to be batched, not of the entire request message. + # @!attribute [rw] delay_threshold + # @return [::Google::Protobuf::Duration] + # The duration after which a batch should be sent, starting from the addition + # of the first message to that batch. + # @!attribute [rw] element_count_limit + # @return [::Integer] + # The maximum number of elements collected in a batch that could be accepted + # by server. + # @!attribute [rw] request_byte_limit + # @return [::Integer] + # The maximum size of the request that could be accepted by server. + # @!attribute [rw] flow_control_element_limit + # @return [::Integer] + # The maximum number of elements allowed by flow control. + # @!attribute [rw] flow_control_byte_limit + # @return [::Integer] + # The maximum size of data allowed by flow control. + # @!attribute [rw] flow_control_limit_exceeded_behavior + # @return [::Google::Api::FlowControlLimitExceededBehaviorProto] + # The behavior to take when the flow control limit is exceeded. + class BatchingSettingsProto + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # `BatchingDescriptorProto` specifies the fields of the request message to be + # used for batching, and, optionally, the fields of the response message to be + # used for demultiplexing. + # @!attribute [rw] batched_field + # @return [::String] + # The repeated field in the request message to be aggregated by batching. + # @!attribute [rw] discriminator_fields + # @return [::Array<::String>] + # A list of the fields in the request message. Two requests will be batched + # together only if the values of every field specified in + # `request_discriminator_fields` is equal between the two requests. + # @!attribute [rw] subresponse_field + # @return [::String] + # Optional. When present, indicates the field in the response message to be + # used to demultiplex the response into multiple response messages, in + # correspondence with the multiple request messages originally batched + # together. + class BatchingDescriptorProto + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # The organization for which the client libraries are being published. + # Affects the url where generated docs are published, etc. + module ClientLibraryOrganization + # Not useful. + CLIENT_LIBRARY_ORGANIZATION_UNSPECIFIED = 0 + + # Google Cloud Platform Org. + CLOUD = 1 + + # Ads (Advertising) Org. + ADS = 2 + + # Photos Org. + PHOTOS = 3 + + # Street View Org. + STREET_VIEW = 4 + + # Shopping Org. + SHOPPING = 5 + + # Geo Org. + GEO = 6 + + # Generative AI - https://developers.generativeai.google + GENERATIVE_AI = 7 + end + + # To where should client libraries be published? + module ClientLibraryDestination + # Client libraries will neither be generated nor published to package + # managers. + CLIENT_LIBRARY_DESTINATION_UNSPECIFIED = 0 + + # Generate the client library in a repo under github.com/googleapis, + # but don't publish it to package managers. + GITHUB = 10 + + # Publish the library to package managers like nuget.org and npmjs.com. + PACKAGE_MANAGER = 20 + end + + # The behavior to take when the flow control limit is exceeded. + module FlowControlLimitExceededBehaviorProto + # Default behavior, system-defined. + UNSET_BEHAVIOR = 0 + + # Stop operation, raise error. + THROW_EXCEPTION = 1 + + # Pause operation until limit clears. + BLOCK = 2 + + # Continue operation, disregard limit. + IGNORE = 3 + end + end +end diff --git a/owl-bot-staging/google-cloud-security_center-v1/proto_docs/google/api/field_behavior.rb b/owl-bot-staging/google-cloud-security_center-v1/proto_docs/google/api/field_behavior.rb new file mode 100644 index 000000000000..582be187d115 --- /dev/null +++ b/owl-bot-staging/google-cloud-security_center-v1/proto_docs/google/api/field_behavior.rb @@ -0,0 +1,85 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + + +module Google + module Api + # An indicator of the behavior of a given field (for example, that a field + # is required in requests, or given as output but ignored as input). + # This **does not** change the behavior in protocol buffers itself; it only + # denotes the behavior and may affect how API tooling handles the field. + # + # Note: This enum **may** receive new values in the future. + module FieldBehavior + # Conventional default for enums. Do not use this. + FIELD_BEHAVIOR_UNSPECIFIED = 0 + + # Specifically denotes a field as optional. + # While all fields in protocol buffers are optional, this may be specified + # for emphasis if appropriate. + OPTIONAL = 1 + + # Denotes a field as required. + # This indicates that the field **must** be provided as part of the request, + # and failure to do so will cause an error (usually `INVALID_ARGUMENT`). + REQUIRED = 2 + + # Denotes a field as output only. + # This indicates that the field is provided in responses, but including the + # field in a request does nothing (the server *must* ignore it and + # *must not* throw an error as a result of the field's presence). + OUTPUT_ONLY = 3 + + # Denotes a field as input only. + # This indicates that the field is provided in requests, and the + # corresponding field is not included in output. + INPUT_ONLY = 4 + + # Denotes a field as immutable. + # This indicates that the field may be set once in a request to create a + # resource, but may not be changed thereafter. + IMMUTABLE = 5 + + # Denotes that a (repeated) field is an unordered list. + # This indicates that the service may provide the elements of the list + # in any arbitrary order, rather than the order the user originally + # provided. Additionally, the list's order may or may not be stable. + UNORDERED_LIST = 6 + + # Denotes that this field returns a non-empty default value if not set. + # This indicates that if the user provides the empty value in a request, + # a non-empty value will be returned. The user will not be aware of what + # non-empty value to expect. + NON_EMPTY_DEFAULT = 7 + + # Denotes that the field in a resource (a message annotated with + # google.api.resource) is used in the resource name to uniquely identify the + # resource. For AIP-compliant APIs, this should only be applied to the + # `name` field on the resource. + # + # This behavior should not be applied to references to other resources within + # the message. + # + # The identifier field of resources often have different field behavior + # depending on the request it is embedded in (e.g. for Create methods name + # is optional and unused, while for Update methods it is required). Instead + # of method-specific annotations, only `IDENTIFIER` is required. + IDENTIFIER = 8 + end + end +end diff --git a/owl-bot-staging/google-cloud-security_center-v1/proto_docs/google/api/field_info.rb b/owl-bot-staging/google-cloud-security_center-v1/proto_docs/google/api/field_info.rb new file mode 100644 index 000000000000..0f5acf0a5538 --- /dev/null +++ b/owl-bot-staging/google-cloud-security_center-v1/proto_docs/google/api/field_info.rb @@ -0,0 +1,88 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + + +module Google + module Api + # Rich semantic information of an API field beyond basic typing. + # @!attribute [rw] format + # @return [::Google::Api::FieldInfo::Format] + # The standard format of a field value. This does not explicitly configure + # any API consumer, just documents the API's format for the field it is + # applied to. + # @!attribute [rw] referenced_types + # @return [::Array<::Google::Api::TypeReference>] + # The type(s) that the annotated, generic field may represent. + # + # Currently, this must only be used on fields of type `google.protobuf.Any`. + # Supporting other generic types may be considered in the future. + class FieldInfo + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # The standard format of a field value. The supported formats are all backed + # by either an RFC defined by the IETF or a Google-defined AIP. + module Format + # Default, unspecified value. + FORMAT_UNSPECIFIED = 0 + + # Universally Unique Identifier, version 4, value as defined by + # https://datatracker.ietf.org/doc/html/rfc4122. The value may be + # normalized to entirely lowercase letters. For example, the value + # `F47AC10B-58CC-0372-8567-0E02B2C3D479` would be normalized to + # `f47ac10b-58cc-0372-8567-0e02b2c3d479`. + UUID4 = 1 + + # Internet Protocol v4 value as defined by [RFC + # 791](https://datatracker.ietf.org/doc/html/rfc791). The value may be + # condensed, with leading zeros in each octet stripped. For example, + # `001.022.233.040` would be condensed to `1.22.233.40`. + IPV4 = 2 + + # Internet Protocol v6 value as defined by [RFC + # 2460](https://datatracker.ietf.org/doc/html/rfc2460). The value may be + # normalized to entirely lowercase letters with zeros compressed, following + # [RFC 5952](https://datatracker.ietf.org/doc/html/rfc5952). For example, + # the value `2001:0DB8:0::0` would be normalized to `2001:db8::`. + IPV6 = 3 + + # An IP address in either v4 or v6 format as described by the individual + # values defined herein. See the comments on the IPV4 and IPV6 types for + # allowed normalizations of each. + IPV4_OR_IPV6 = 4 + end + end + + # A reference to a message type, for use in {::Google::Api::FieldInfo FieldInfo}. + # @!attribute [rw] type_name + # @return [::String] + # The name of the type that the annotated, generic field may represent. + # If the type is in the same protobuf package, the value can be the simple + # message name e.g., `"MyMessage"`. Otherwise, the value must be the + # fully-qualified message name e.g., `"google.library.v1.Book"`. + # + # If the type(s) are unknown to the service (e.g. the field accepts generic + # user input), use the wildcard `"*"` to denote this behavior. + # + # See [AIP-202](https://google.aip.dev/202#type-references) for more details. + class TypeReference + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end +end diff --git a/owl-bot-staging/google-cloud-security_center-v1/proto_docs/google/api/launch_stage.rb b/owl-bot-staging/google-cloud-security_center-v1/proto_docs/google/api/launch_stage.rb new file mode 100644 index 000000000000..9392a413fb1b --- /dev/null +++ b/owl-bot-staging/google-cloud-security_center-v1/proto_docs/google/api/launch_stage.rb @@ -0,0 +1,71 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + + +module Google + module Api + # The launch stage as defined by [Google Cloud Platform + # Launch Stages](https://cloud.google.com/terms/launch-stages). + module LaunchStage + # Do not use this default value. + LAUNCH_STAGE_UNSPECIFIED = 0 + + # The feature is not yet implemented. Users can not use it. + UNIMPLEMENTED = 6 + + # Prelaunch features are hidden from users and are only visible internally. + PRELAUNCH = 7 + + # Early Access features are limited to a closed group of testers. To use + # these features, you must sign up in advance and sign a Trusted Tester + # agreement (which includes confidentiality provisions). These features may + # be unstable, changed in backward-incompatible ways, and are not + # guaranteed to be released. + EARLY_ACCESS = 1 + + # Alpha is a limited availability test for releases before they are cleared + # for widespread use. By Alpha, all significant design issues are resolved + # and we are in the process of verifying functionality. Alpha customers + # need to apply for access, agree to applicable terms, and have their + # projects allowlisted. Alpha releases don't have to be feature complete, + # no SLAs are provided, and there are no technical support obligations, but + # they will be far enough along that customers can actually use them in + # test environments or for limited-use tests -- just like they would in + # normal production cases. + ALPHA = 2 + + # Beta is the point at which we are ready to open a release for any + # customer to use. There are no SLA or technical support obligations in a + # Beta release. Products will be complete from a feature perspective, but + # may have some open outstanding issues. Beta releases are suitable for + # limited production use cases. + BETA = 3 + + # GA features are open to all developers and are considered stable and + # fully qualified for production use. + GA = 4 + + # Deprecated features are scheduled to be shut down and removed. For more + # information, see the "Deprecation Policy" section of our [Terms of + # Service](https://cloud.google.com/terms/) + # and the [Google Cloud Platform Subject to the Deprecation + # Policy](https://cloud.google.com/terms/deprecation) documentation. + DEPRECATED = 5 + end + end +end diff --git a/owl-bot-staging/google-cloud-security_center-v1/proto_docs/google/api/resource.rb b/owl-bot-staging/google-cloud-security_center-v1/proto_docs/google/api/resource.rb new file mode 100644 index 000000000000..25dec4847ac1 --- /dev/null +++ b/owl-bot-staging/google-cloud-security_center-v1/proto_docs/google/api/resource.rb @@ -0,0 +1,227 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + + +module Google + module Api + # A simple descriptor of a resource type. + # + # ResourceDescriptor annotates a resource message (either by means of a + # protobuf annotation or use in the service config), and associates the + # resource's schema, the resource type, and the pattern of the resource name. + # + # Example: + # + # message Topic { + # // Indicates this message defines a resource schema. + # // Declares the resource type in the format of {service}/{kind}. + # // For Kubernetes resources, the format is {api group}/{kind}. + # option (google.api.resource) = { + # type: "pubsub.googleapis.com/Topic" + # pattern: "projects/{project}/topics/{topic}" + # }; + # } + # + # The ResourceDescriptor Yaml config will look like: + # + # resources: + # - type: "pubsub.googleapis.com/Topic" + # pattern: "projects/{project}/topics/{topic}" + # + # Sometimes, resources have multiple patterns, typically because they can + # live under multiple parents. + # + # Example: + # + # message LogEntry { + # option (google.api.resource) = { + # type: "logging.googleapis.com/LogEntry" + # pattern: "projects/{project}/logs/{log}" + # pattern: "folders/{folder}/logs/{log}" + # pattern: "organizations/{organization}/logs/{log}" + # pattern: "billingAccounts/{billing_account}/logs/{log}" + # }; + # } + # + # The ResourceDescriptor Yaml config will look like: + # + # resources: + # - type: 'logging.googleapis.com/LogEntry' + # pattern: "projects/{project}/logs/{log}" + # pattern: "folders/{folder}/logs/{log}" + # pattern: "organizations/{organization}/logs/{log}" + # pattern: "billingAccounts/{billing_account}/logs/{log}" + # @!attribute [rw] type + # @return [::String] + # The resource type. It must be in the format of + # \\{service_name}/\\{resource_type_kind}. The `resource_type_kind` must be + # singular and must not include version numbers. + # + # Example: `storage.googleapis.com/Bucket` + # + # The value of the resource_type_kind must follow the regular expression + # /[A-Za-z][a-zA-Z0-9]+/. It should start with an upper case character and + # should use PascalCase (UpperCamelCase). The maximum number of + # characters allowed for the `resource_type_kind` is 100. + # @!attribute [rw] pattern + # @return [::Array<::String>] + # Optional. The relative resource name pattern associated with this resource + # type. The DNS prefix of the full resource name shouldn't be specified here. + # + # The path pattern must follow the syntax, which aligns with HTTP binding + # syntax: + # + # Template = Segment { "/" Segment } ; + # Segment = LITERAL | Variable ; + # Variable = "{" LITERAL "}" ; + # + # Examples: + # + # - "projects/\\{project}/topics/\\{topic}" + # - "projects/\\{project}/knowledgeBases/\\{knowledge_base}" + # + # The components in braces correspond to the IDs for each resource in the + # hierarchy. It is expected that, if multiple patterns are provided, + # the same component name (e.g. "project") refers to IDs of the same + # type of resource. + # @!attribute [rw] name_field + # @return [::String] + # Optional. The field on the resource that designates the resource name + # field. If omitted, this is assumed to be "name". + # @!attribute [rw] history + # @return [::Google::Api::ResourceDescriptor::History] + # Optional. The historical or future-looking state of the resource pattern. + # + # Example: + # + # // The InspectTemplate message originally only supported resource + # // names with organization, and project was added later. + # message InspectTemplate { + # option (google.api.resource) = { + # type: "dlp.googleapis.com/InspectTemplate" + # pattern: + # "organizations/{organization}/inspectTemplates/{inspect_template}" + # pattern: "projects/{project}/inspectTemplates/{inspect_template}" + # history: ORIGINALLY_SINGLE_PATTERN + # }; + # } + # @!attribute [rw] plural + # @return [::String] + # The plural name used in the resource name and permission names, such as + # 'projects' for the resource name of 'projects/\\{project}' and the permission + # name of 'cloudresourcemanager.googleapis.com/projects.get'. One exception + # to this is for Nested Collections that have stuttering names, as defined + # in [AIP-122](https://google.aip.dev/122#nested-collections), where the + # collection ID in the resource name pattern does not necessarily directly + # match the `plural` value. + # + # It is the same concept of the `plural` field in k8s CRD spec + # https://kubernetes.io/docs/tasks/access-kubernetes-api/custom-resources/custom-resource-definitions/ + # + # Note: The plural form is required even for singleton resources. See + # https://aip.dev/156 + # @!attribute [rw] singular + # @return [::String] + # The same concept of the `singular` field in k8s CRD spec + # https://kubernetes.io/docs/tasks/access-kubernetes-api/custom-resources/custom-resource-definitions/ + # Such as "project" for the `resourcemanager.googleapis.com/Project` type. + # @!attribute [rw] style + # @return [::Array<::Google::Api::ResourceDescriptor::Style>] + # Style flag(s) for this resource. + # These indicate that a resource is expected to conform to a given + # style. See the specific style flags for additional information. + class ResourceDescriptor + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # A description of the historical or future-looking state of the + # resource pattern. + module History + # The "unset" value. + HISTORY_UNSPECIFIED = 0 + + # The resource originally had one pattern and launched as such, and + # additional patterns were added later. + ORIGINALLY_SINGLE_PATTERN = 1 + + # The resource has one pattern, but the API owner expects to add more + # later. (This is the inverse of ORIGINALLY_SINGLE_PATTERN, and prevents + # that from being necessary once there are multiple patterns.) + FUTURE_MULTI_PATTERN = 2 + end + + # A flag representing a specific style that a resource claims to conform to. + module Style + # The unspecified value. Do not use. + STYLE_UNSPECIFIED = 0 + + # This resource is intended to be "declarative-friendly". + # + # Declarative-friendly resources must be more strictly consistent, and + # setting this to true communicates to tools that this resource should + # adhere to declarative-friendly expectations. + # + # Note: This is used by the API linter (linter.aip.dev) to enable + # additional checks. + DECLARATIVE_FRIENDLY = 1 + end + end + + # Defines a proto annotation that describes a string field that refers to + # an API resource. + # @!attribute [rw] type + # @return [::String] + # The resource type that the annotated field references. + # + # Example: + # + # message Subscription { + # string topic = 2 [(google.api.resource_reference) = { + # type: "pubsub.googleapis.com/Topic" + # }]; + # } + # + # Occasionally, a field may reference an arbitrary resource. In this case, + # APIs use the special value * in their resource reference. + # + # Example: + # + # message GetIamPolicyRequest { + # string resource = 2 [(google.api.resource_reference) = { + # type: "*" + # }]; + # } + # @!attribute [rw] child_type + # @return [::String] + # The resource type of a child collection that the annotated field + # references. This is useful for annotating the `parent` field that + # doesn't have a fixed resource type. + # + # Example: + # + # message ListLogEntriesRequest { + # string parent = 1 [(google.api.resource_reference) = { + # child_type: "logging.googleapis.com/LogEntry" + # }; + # } + class ResourceReference + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end +end diff --git a/owl-bot-staging/google-cloud-security_center-v1/proto_docs/google/cloud/securitycenter/v1/access.rb b/owl-bot-staging/google-cloud-security_center-v1/proto_docs/google/cloud/securitycenter/v1/access.rb new file mode 100644 index 000000000000..31e390d3f8a1 --- /dev/null +++ b/owl-bot-staging/google-cloud-security_center-v1/proto_docs/google/cloud/securitycenter/v1/access.rb @@ -0,0 +1,120 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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 SecurityCenter + module V1 + # Represents an access event. + # @!attribute [rw] principal_email + # @return [::String] + # Associated email, such as "foo@google.com". + # + # The email address of the authenticated user or a service account acting on + # behalf of a third party principal making the request. For third party + # identity callers, the `principal_subject` field is populated instead of + # this field. For privacy reasons, the principal email address is sometimes + # redacted. For more information, see [Caller identities in audit + # logs](https://cloud.google.com/logging/docs/audit#user-id). + # @!attribute [rw] caller_ip + # @return [::String] + # Caller's IP address, such as "1.1.1.1". + # @!attribute [rw] caller_ip_geo + # @return [::Google::Cloud::SecurityCenter::V1::Geolocation] + # The caller IP's geolocation, which identifies where the call came from. + # @!attribute [rw] user_agent_family + # @return [::String] + # Type of user agent associated with the finding. For example, an operating + # system shell or an embedded or standalone application. + # @!attribute [rw] user_agent + # @return [::String] + # The caller's user agent string associated with the finding. + # @!attribute [rw] service_name + # @return [::String] + # This is the API service that the service account made a call to, e.g. + # "iam.googleapis.com" + # @!attribute [rw] method_name + # @return [::String] + # The method that the service account called, e.g. "SetIamPolicy". + # @!attribute [rw] principal_subject + # @return [::String] + # A string that represents the principal_subject that is associated with the + # identity. Unlike `principal_email`, `principal_subject` supports principals + # that aren't associated with email addresses, such as third party + # principals. For most identities, the format is + # `principal://iam.googleapis.com/{identity pool name}/subject/{subject}`. + # Some GKE identities, such as GKE_WORKLOAD, FREEFORM, and GKE_HUB_WORKLOAD, + # still use the legacy format `serviceAccount:{identity pool + # name}[\\{subject}]`. + # @!attribute [rw] service_account_key_name + # @return [::String] + # The name of the service account key that was used to create or exchange + # credentials when authenticating the service account that made the request. + # This is a scheme-less URI full resource name. For example: + # + # "//iam.googleapis.com/projects/\\{PROJECT_ID}/serviceAccounts/\\{ACCOUNT}/keys/\\{key}". + # @!attribute [rw] service_account_delegation_info + # @return [::Array<::Google::Cloud::SecurityCenter::V1::ServiceAccountDelegationInfo>] + # The identity delegation history of an authenticated service account that + # made the request. The `serviceAccountDelegationInfo[]` object contains + # information about the real authorities that try to access Google Cloud + # resources by delegating on a service account. When multiple authorities are + # present, they are guaranteed to be sorted based on the original ordering of + # the identity delegation events. + # @!attribute [rw] user_name + # @return [::String] + # A string that represents a username. The username provided depends on the + # type of the finding and is likely not an IAM principal. For example, this + # can be a system username if the finding is related to a virtual machine, or + # it can be an application login username. + class Access + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Identity delegation history of an authenticated service account. + # @!attribute [rw] principal_email + # @return [::String] + # The email address of a Google account. + # @!attribute [rw] principal_subject + # @return [::String] + # A string representing the principal_subject associated with the identity. + # As compared to `principal_email`, supports principals that aren't + # associated with email addresses, such as third party principals. For most + # identities, the format will be `principal://iam.googleapis.com/{identity + # pool name}/subjects/\\{subject}` except for some GKE identities + # (GKE_WORKLOAD, FREEFORM, GKE_HUB_WORKLOAD) that are still in the legacy + # format `serviceAccount:{identity pool name}[{subject}]` + class ServiceAccountDelegationInfo + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Represents a geographical location for a given access. + # @!attribute [rw] region_code + # @return [::String] + # A CLDR. + class Geolocation + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-security_center-v1/proto_docs/google/cloud/securitycenter/v1/application.rb b/owl-bot-staging/google-cloud-security_center-v1/proto_docs/google/cloud/securitycenter/v1/application.rb new file mode 100644 index 000000000000..219bf34fde42 --- /dev/null +++ b/owl-bot-staging/google-cloud-security_center-v1/proto_docs/google/cloud/securitycenter/v1/application.rb @@ -0,0 +1,40 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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 SecurityCenter + module V1 + # Represents an application associated with a finding. + # @!attribute [rw] base_uri + # @return [::String] + # The base URI that identifies the network location of the application in + # which the vulnerability was detected. For example, `http://example.com`. + # @!attribute [rw] full_uri + # @return [::String] + # The full URI with payload that can be used to reproduce the + # vulnerability. For example, `http://example.com?p=aMmYgI6H`. + class Application + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-security_center-v1/proto_docs/google/cloud/securitycenter/v1/asset.rb b/owl-bot-staging/google-cloud-security_center-v1/proto_docs/google/cloud/securitycenter/v1/asset.rb new file mode 100644 index 000000000000..d04b5a46cc91 --- /dev/null +++ b/owl-bot-staging/google-cloud-security_center-v1/proto_docs/google/cloud/securitycenter/v1/asset.rb @@ -0,0 +1,141 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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 SecurityCenter + module V1 + # Security Command Center representation of a Google Cloud + # resource. + # + # The Asset is a Security Command Center resource that captures information + # about a single Google Cloud resource. All modifications to an Asset are only + # within the context of Security Command Center and don't affect the referenced + # Google Cloud resource. + # @!attribute [rw] name + # @return [::String] + # The relative resource name of this asset. See: + # https://cloud.google.com/apis/design/resource_names#relative_resource_name + # Example: + # "organizations/\\{organization_id}/assets/\\{asset_id}". + # @!attribute [rw] security_center_properties + # @return [::Google::Cloud::SecurityCenter::V1::Asset::SecurityCenterProperties] + # Security Command Center managed properties. These properties are managed by + # Security Command Center and cannot be modified by the user. + # @!attribute [rw] resource_properties + # @return [::Google::Protobuf::Map{::String => ::Google::Protobuf::Value}] + # Resource managed properties. These properties are managed and defined by + # the Google Cloud resource and cannot be modified by the user. + # @!attribute [rw] security_marks + # @return [::Google::Cloud::SecurityCenter::V1::SecurityMarks] + # User specified security marks. These marks are entirely managed by the user + # and come from the SecurityMarks resource that belongs to the asset. + # @!attribute [rw] create_time + # @return [::Google::Protobuf::Timestamp] + # The time at which the asset was created in Security Command Center. + # @!attribute [rw] update_time + # @return [::Google::Protobuf::Timestamp] + # The time at which the asset was last updated or added in Cloud SCC. + # @!attribute [rw] iam_policy + # @return [::Google::Cloud::SecurityCenter::V1::Asset::IamPolicy] + # Cloud IAM Policy information associated with the Google Cloud resource + # described by the Security Command Center asset. This information is managed + # and defined by the Google Cloud resource and cannot be modified by the + # user. + # @!attribute [rw] canonical_name + # @return [::String] + # The canonical name of the resource. It's either + # "organizations/\\{organization_id}/assets/\\{asset_id}", + # "folders/\\{folder_id}/assets/\\{asset_id}" or + # "projects/\\{project_number}/assets/\\{asset_id}", depending on the closest CRM + # ancestor of the resource. + class Asset + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # Security Command Center managed properties. These properties are managed by + # Security Command Center and cannot be modified by the user. + # @!attribute [rw] resource_name + # @return [::String] + # The full resource name of the Google Cloud resource this asset + # represents. This field is immutable after create time. See: + # https://cloud.google.com/apis/design/resource_names#full_resource_name + # @!attribute [rw] resource_type + # @return [::String] + # The type of the Google Cloud resource. Examples include: APPLICATION, + # PROJECT, and ORGANIZATION. This is a case insensitive field defined by + # Security Command Center and/or the producer of the resource and is + # immutable after create time. + # @!attribute [rw] resource_parent + # @return [::String] + # The full resource name of the immediate parent of the resource. See: + # https://cloud.google.com/apis/design/resource_names#full_resource_name + # @!attribute [rw] resource_project + # @return [::String] + # The full resource name of the project the resource belongs to. See: + # https://cloud.google.com/apis/design/resource_names#full_resource_name + # @!attribute [rw] resource_owners + # @return [::Array<::String>] + # Owners of the Google Cloud resource. + # @!attribute [rw] resource_display_name + # @return [::String] + # The user defined display name for this resource. + # @!attribute [rw] resource_parent_display_name + # @return [::String] + # The user defined display name for the parent of this resource. + # @!attribute [rw] resource_project_display_name + # @return [::String] + # The user defined display name for the project of this resource. + # @!attribute [rw] folders + # @return [::Array<::Google::Cloud::SecurityCenter::V1::Folder>] + # Contains a Folder message for each folder in the assets ancestry. + # The first folder is the deepest nested folder, and the last folder is the + # folder directly under the Organization. + class SecurityCenterProperties + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Cloud IAM Policy information associated with the Google Cloud resource + # described by the Security Command Center asset. This information is managed + # and defined by the Google Cloud resource and cannot be modified by the + # user. + # @!attribute [rw] policy_blob + # @return [::String] + # The JSON representation of the Policy associated with the asset. + # See https://cloud.google.com/iam/reference/rest/v1/Policy for format + # details. + class IamPolicy + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # @!attribute [rw] key + # @return [::String] + # @!attribute [rw] value + # @return [::Google::Protobuf::Value] + class ResourcePropertiesEntry + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-security_center-v1/proto_docs/google/cloud/securitycenter/v1/attack_exposure.rb b/owl-bot-staging/google-cloud-security_center-v1/proto_docs/google/cloud/securitycenter/v1/attack_exposure.rb new file mode 100644 index 000000000000..51bd94f1fd18 --- /dev/null +++ b/owl-bot-staging/google-cloud-security_center-v1/proto_docs/google/cloud/securitycenter/v1/attack_exposure.rb @@ -0,0 +1,73 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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 SecurityCenter + module V1 + # An attack exposure contains the results of an attack path simulation run. + # @!attribute [rw] score + # @return [::Float] + # A number between 0 (inclusive) and infinity that represents how important + # this finding is to remediate. The higher the score, the more important it + # is to remediate. + # @!attribute [rw] latest_calculation_time + # @return [::Google::Protobuf::Timestamp] + # The most recent time the attack exposure was updated on this finding. + # @!attribute [rw] attack_exposure_result + # @return [::String] + # The resource name of the attack path simulation result that contains the + # details regarding this attack exposure score. + # Example: `organizations/123/simulations/456/attackExposureResults/789` + # @!attribute [rw] state + # @return [::Google::Cloud::SecurityCenter::V1::AttackExposure::State] + # What state this AttackExposure is in. This captures whether or not an + # attack exposure has been calculated or not. + # @!attribute [rw] exposed_high_value_resources_count + # @return [::Integer] + # The number of high value resources that are exposed as a result of this + # finding. + # @!attribute [rw] exposed_medium_value_resources_count + # @return [::Integer] + # The number of medium value resources that are exposed as a result of this + # finding. + # @!attribute [rw] exposed_low_value_resources_count + # @return [::Integer] + # The number of high value resources that are exposed as a result of this + # finding. + class AttackExposure + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # This enum defines the various states an AttackExposure can be in. + module State + # The state is not specified. + STATE_UNSPECIFIED = 0 + + # The attack exposure has been calculated. + CALCULATED = 1 + + # The attack exposure has not been calculated. + NOT_CALCULATED = 2 + end + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-security_center-v1/proto_docs/google/cloud/securitycenter/v1/attack_path.rb b/owl-bot-staging/google-cloud-security_center-v1/proto_docs/google/cloud/securitycenter/v1/attack_path.rb new file mode 100644 index 000000000000..9a78a90341b5 --- /dev/null +++ b/owl-bot-staging/google-cloud-security_center-v1/proto_docs/google/cloud/securitycenter/v1/attack_path.rb @@ -0,0 +1,147 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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 SecurityCenter + module V1 + # A path that an attacker could take to reach an exposed resource. + # @!attribute [rw] name + # @return [::String] + # The attack path name, for example, + # `organizations/12/simulation/34/valuedResources/56/attackPaths/78` + # @!attribute [rw] path_nodes + # @return [::Array<::Google::Cloud::SecurityCenter::V1::AttackPath::AttackPathNode>] + # A list of nodes that exist in this attack path. + # @!attribute [rw] edges + # @return [::Array<::Google::Cloud::SecurityCenter::V1::AttackPath::AttackPathEdge>] + # A list of the edges between nodes in this attack path. + class AttackPath + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # Represents one point that an attacker passes through in this attack path. + # @!attribute [rw] resource + # @return [::String] + # The name of the resource at this point in the attack path. + # The format of the name follows the Cloud Asset Inventory [resource + # name + # format](https://cloud.google.com/asset-inventory/docs/resource-name-format) + # @!attribute [rw] resource_type + # @return [::String] + # The [supported resource + # type](https://cloud.google.com/asset-inventory/docs/supported-asset-types) + # @!attribute [rw] display_name + # @return [::String] + # Human-readable name of this resource. + # @!attribute [rw] associated_findings + # @return [::Array<::Google::Cloud::SecurityCenter::V1::AttackPath::AttackPathNode::PathNodeAssociatedFinding>] + # The findings associated with this node in the attack path. + # @!attribute [rw] uuid + # @return [::String] + # Unique id of the attack path node. + # @!attribute [rw] attack_steps + # @return [::Array<::Google::Cloud::SecurityCenter::V1::AttackPath::AttackPathNode::AttackStepNode>] + # A list of attack step nodes that exist in this attack path node. + class AttackPathNode + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # A finding that is associated with this node in the attack path. + # @!attribute [rw] canonical_finding + # @return [::String] + # Canonical name of the associated findings. Example: + # `organizations/123/sources/456/findings/789` + # @!attribute [rw] finding_category + # @return [::String] + # The additional taxonomy group within findings from a given source. + # @!attribute [rw] name + # @return [::String] + # Full resource name of the finding. + class PathNodeAssociatedFinding + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Detailed steps the attack can take between path nodes. + # @!attribute [rw] uuid + # @return [::String] + # Unique ID for one Node + # @!attribute [rw] type + # @return [::Google::Cloud::SecurityCenter::V1::AttackPath::AttackPathNode::NodeType] + # Attack step type. Can be either AND, OR or DEFENSE + # @!attribute [rw] display_name + # @return [::String] + # User friendly name of the attack step + # @!attribute [rw] labels + # @return [::Google::Protobuf::Map{::String => ::String}] + # Attack step labels for metadata + # @!attribute [rw] description + # @return [::String] + # Attack step description + class AttackStepNode + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # @!attribute [rw] key + # @return [::String] + # @!attribute [rw] value + # @return [::String] + class LabelsEntry + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end + + # The type of the incoming attack step node. + module NodeType + # Type not specified + NODE_TYPE_UNSPECIFIED = 0 + + # Incoming edge joined with AND + NODE_TYPE_AND = 1 + + # Incoming edge joined with OR + NODE_TYPE_OR = 2 + + # Incoming edge is defense + NODE_TYPE_DEFENSE = 3 + + # Incoming edge is attacker + NODE_TYPE_ATTACKER = 4 + end + end + + # Represents a connection between a source node and a destination node in + # this attack path. + # @!attribute [rw] source + # @return [::String] + # The attack node uuid of the source node. + # @!attribute [rw] destination + # @return [::String] + # The attack node uuid of the destination node. + class AttackPathEdge + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-security_center-v1/proto_docs/google/cloud/securitycenter/v1/backup_disaster_recovery.rb b/owl-bot-staging/google-cloud-security_center-v1/proto_docs/google/cloud/securitycenter/v1/backup_disaster_recovery.rb new file mode 100644 index 000000000000..8f4297aa756e --- /dev/null +++ b/owl-bot-staging/google-cloud-security_center-v1/proto_docs/google/cloud/securitycenter/v1/backup_disaster_recovery.rb @@ -0,0 +1,90 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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 SecurityCenter + module V1 + # Information related to Google Cloud Backup and DR Service findings. + # @!attribute [rw] backup_template + # @return [::String] + # The name of a Backup and DR template which comprises one or more backup + # policies. See the [Backup and DR + # documentation](https://cloud.google.com/backup-disaster-recovery/docs/concepts/backup-plan#temp) + # for more information. For example, `snap-ov`. + # @!attribute [rw] policies + # @return [::Array<::String>] + # The names of Backup and DR policies that are associated with a template + # and that define when to run a backup, how frequently to run a backup, and + # how long to retain the backup image. For example, `onvaults`. + # @!attribute [rw] host + # @return [::String] + # The name of a Backup and DR host, which is managed by the backup and + # recovery appliance and known to the management console. The host can be of + # type Generic (for example, Compute Engine, SQL Server, Oracle DB, SMB file + # system, etc.), vCenter, or an ESX server. See the [Backup and DR + # documentation on + # hosts](https://cloud.google.com/backup-disaster-recovery/docs/configuration/manage-hosts-and-their-applications) + # for more information. For example, `centos7-01`. + # @!attribute [rw] applications + # @return [::Array<::String>] + # The names of Backup and DR applications. An application is a VM, database, + # or file system on a managed host monitored by a backup and recovery + # appliance. For example, `centos7-01-vol00`, `centos7-01-vol01`, + # `centos7-01-vol02`. + # @!attribute [rw] storage_pool + # @return [::String] + # The name of the Backup and DR storage pool that the backup and recovery + # appliance is storing data in. The storage pool could be of type Cloud, + # Primary, Snapshot, or OnVault. See the [Backup and DR documentation on + # storage + # pools](https://cloud.google.com/backup-disaster-recovery/docs/concepts/storage-pools). + # For example, `DiskPoolOne`. + # @!attribute [rw] policy_options + # @return [::Array<::String>] + # The names of Backup and DR advanced policy options of a policy applying to + # an application. See the [Backup and DR documentation on policy + # options](https://cloud.google.com/backup-disaster-recovery/docs/create-plan/policy-settings). + # For example, `skipofflineappsincongrp, nounmap`. + # @!attribute [rw] profile + # @return [::String] + # The name of the Backup and DR resource profile that specifies the storage + # media for backups of application and VM data. See the [Backup and DR + # documentation on + # profiles](https://cloud.google.com/backup-disaster-recovery/docs/concepts/backup-plan#profile). + # For example, `GCP`. + # @!attribute [rw] appliance + # @return [::String] + # The name of the Backup and DR appliance that captures, moves, and manages + # the lifecycle of backup data. For example, `backup-server-57137`. + # @!attribute [rw] backup_type + # @return [::String] + # The backup type of the Backup and DR image. + # For example, `Snapshot`, `Remote Snapshot`, `OnVault`. + # @!attribute [rw] backup_create_time + # @return [::Google::Protobuf::Timestamp] + # The timestamp at which the Backup and DR backup was created. + class BackupDisasterRecovery + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-security_center-v1/proto_docs/google/cloud/securitycenter/v1/bigquery_export.rb b/owl-bot-staging/google-cloud-security_center-v1/proto_docs/google/cloud/securitycenter/v1/bigquery_export.rb new file mode 100644 index 000000000000..f558699d1218 --- /dev/null +++ b/owl-bot-staging/google-cloud-security_center-v1/proto_docs/google/cloud/securitycenter/v1/bigquery_export.rb @@ -0,0 +1,92 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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 SecurityCenter + module V1 + # Configures how to deliver Findings to BigQuery Instance. + # @!attribute [rw] name + # @return [::String] + # The relative resource name of this export. See: + # https://cloud.google.com/apis/design/resource_names#relative_resource_name. + # Example format: + # "organizations/\\{organization_id}/bigQueryExports/\\{export_id}" Example + # format: "folders/\\{folder_id}/bigQueryExports/\\{export_id}" Example format: + # "projects/\\{project_id}/bigQueryExports/\\{export_id}" + # This field is provided in responses, and is ignored when provided in create + # requests. + # @!attribute [rw] description + # @return [::String] + # The description of the export (max of 1024 characters). + # @!attribute [rw] filter + # @return [::String] + # Expression that defines the filter to apply across create/update events + # of findings. The expression is a list of zero or more restrictions combined + # via logical operators `AND` and `OR`. Parentheses are supported, and `OR` + # has higher precedence than `AND`. + # + # Restrictions have the form ` ` and may have a + # `-` character in front of them to indicate negation. The fields map to + # those defined in the corresponding resource. + # + # The supported operators are: + # + # * `=` for all value types. + # * `>`, `<`, `>=`, `<=` for integer values. + # * `:`, meaning substring matching, for strings. + # + # The supported value types are: + # + # * string literals in quotes. + # * integer literals without quotes. + # * boolean literals `true` and `false` without quotes. + # @!attribute [rw] dataset + # @return [::String] + # The dataset to write findings' updates to. Its format is + # "projects/[project_id]/datasets/[bigquery_dataset_id]". + # BigQuery Dataset unique ID must contain only letters (a-z, A-Z), numbers + # (0-9), or underscores (_). + # @!attribute [r] create_time + # @return [::Google::Protobuf::Timestamp] + # Output only. The time at which the BigQuery export was created. + # This field is set by the server and will be ignored if provided on export + # on creation. + # @!attribute [r] update_time + # @return [::Google::Protobuf::Timestamp] + # Output only. The most recent time at which the BigQuery export was updated. + # This field is set by the server and will be ignored if provided on export + # creation or update. + # @!attribute [r] most_recent_editor + # @return [::String] + # Output only. Email address of the user who last edited the BigQuery export. + # This field is set by the server and will be ignored if provided on export + # creation or update. + # @!attribute [r] principal + # @return [::String] + # Output only. The service account that needs permission to create table and + # upload data to the BigQuery dataset. + class BigQueryExport + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-security_center-v1/proto_docs/google/cloud/securitycenter/v1/chokepoint.rb b/owl-bot-staging/google-cloud-security_center-v1/proto_docs/google/cloud/securitycenter/v1/chokepoint.rb new file mode 100644 index 000000000000..d16907c3f4b8 --- /dev/null +++ b/owl-bot-staging/google-cloud-security_center-v1/proto_docs/google/cloud/securitycenter/v1/chokepoint.rb @@ -0,0 +1,39 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + + +module Google + module Cloud + module SecurityCenter + module V1 + # Contains details about a chokepoint, which is a resource or resource group + # where high-risk attack paths converge, based on [attack path simulations] + # (https://cloud.google.com/security-command-center/docs/attack-exposure-learn#attack_path_simulations). + # @!attribute [rw] related_findings + # @return [::Array<::String>] + # List of resource names of findings associated with this chokepoint. + # For example, organizations/123/sources/456/findings/789. + # This list will have at most 100 findings. + class Chokepoint + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-security_center-v1/proto_docs/google/cloud/securitycenter/v1/cloud_armor.rb b/owl-bot-staging/google-cloud-security_center-v1/proto_docs/google/cloud/securitycenter/v1/cloud_armor.rb new file mode 100644 index 000000000000..589ad76bf248 --- /dev/null +++ b/owl-bot-staging/google-cloud-security_center-v1/proto_docs/google/cloud/securitycenter/v1/cloud_armor.rb @@ -0,0 +1,128 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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 SecurityCenter + module V1 + # Fields related to Google Cloud Armor findings. + # @!attribute [rw] security_policy + # @return [::Google::Cloud::SecurityCenter::V1::SecurityPolicy] + # Information about the [Google Cloud Armor security + # policy](https://cloud.google.com/armor/docs/security-policy-overview) + # relevant to the finding. + # @!attribute [rw] requests + # @return [::Google::Cloud::SecurityCenter::V1::Requests] + # Information about incoming requests evaluated by [Google Cloud Armor + # security + # policies](https://cloud.google.com/armor/docs/security-policy-overview). + # @!attribute [rw] adaptive_protection + # @return [::Google::Cloud::SecurityCenter::V1::AdaptiveProtection] + # Information about potential Layer 7 DDoS attacks identified by [Google + # Cloud Armor Adaptive + # Protection](https://cloud.google.com/armor/docs/adaptive-protection-overview). + # @!attribute [rw] attack + # @return [::Google::Cloud::SecurityCenter::V1::Attack] + # Information about DDoS attack volume and classification. + # @!attribute [rw] threat_vector + # @return [::String] + # Distinguish between volumetric & protocol DDoS attack and + # application layer attacks. For example, "L3_4" for Layer 3 and Layer 4 DDoS + # attacks, or "L_7" for Layer 7 DDoS attacks. + # @!attribute [rw] duration + # @return [::Google::Protobuf::Duration] + # Duration of attack from the start until the current moment (updated every 5 + # minutes). + class CloudArmor + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Information about the [Google Cloud Armor security + # policy](https://cloud.google.com/armor/docs/security-policy-overview) + # relevant to the finding. + # @!attribute [rw] name + # @return [::String] + # The name of the Google Cloud Armor security policy, for example, + # "my-security-policy". + # @!attribute [rw] type + # @return [::String] + # The type of Google Cloud Armor security policy for example, 'backend + # security policy', 'edge security policy', 'network edge security policy', + # or 'always-on DDoS protection'. + # @!attribute [rw] preview + # @return [::Boolean] + # Whether or not the associated rule or policy is in preview mode. + class SecurityPolicy + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Information about the requests relevant to the finding. + # @!attribute [rw] ratio + # @return [::Float] + # For 'Increasing deny ratio', the ratio is the denied traffic divided by the + # allowed traffic. For 'Allowed traffic spike', the ratio is the allowed + # traffic in the short term divided by allowed traffic in the long term. + # @!attribute [rw] short_term_allowed + # @return [::Integer] + # Allowed RPS (requests per second) in the short term. + # @!attribute [rw] long_term_allowed + # @return [::Integer] + # Allowed RPS (requests per second) over the long term. + # @!attribute [rw] long_term_denied + # @return [::Integer] + # Denied RPS (requests per second) over the long term. + class Requests + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Information about [Google Cloud Armor Adaptive + # Protection](https://cloud.google.com/armor/docs/cloud-armor-overview#google-cloud-armor-adaptive-protection). + # @!attribute [rw] confidence + # @return [::Float] + # A score of 0 means that there is low confidence that the detected event is + # an actual attack. A score of 1 means that there is high confidence that the + # detected event is an attack. See the [Adaptive Protection + # documentation](https://cloud.google.com/armor/docs/adaptive-protection-overview#configure-alert-tuning) + # for further explanation. + class AdaptiveProtection + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Information about DDoS attack volume and classification. + # @!attribute [rw] volume_pps + # @return [::Integer] + # Total PPS (packets per second) volume of attack. + # @!attribute [rw] volume_bps + # @return [::Integer] + # Total BPS (bytes per second) volume of attack. + # @!attribute [rw] classification + # @return [::String] + # Type of attack, for example, 'SYN-flood', 'NTP-udp', or 'CHARGEN-udp'. + class Attack + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-security_center-v1/proto_docs/google/cloud/securitycenter/v1/cloud_dlp_data_profile.rb b/owl-bot-staging/google-cloud-security_center-v1/proto_docs/google/cloud/securitycenter/v1/cloud_dlp_data_profile.rb new file mode 100644 index 000000000000..83d9ad22a479 --- /dev/null +++ b/owl-bot-staging/google-cloud-security_center-v1/proto_docs/google/cloud/securitycenter/v1/cloud_dlp_data_profile.rb @@ -0,0 +1,114 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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 SecurityCenter + module V1 + # The [data profile](https://cloud.google.com/dlp/docs/data-profiles) + # associated with the finding. + # @!attribute [rw] data_profile + # @return [::String] + # Name of the data profile, for example, + # `projects/123/locations/europe/tableProfiles/8383929`. + # @!attribute [rw] parent_type + # @return [::Google::Cloud::SecurityCenter::V1::CloudDlpDataProfile::ParentType] + # The resource hierarchy level at which the data profile was generated. + # @!attribute [rw] info_types + # @return [::Array<::Google::Cloud::SecurityCenter::V1::InfoType>] + # Type of information detected by SDP. + # Info type includes name, version and sensitivity of the detected + # information type. + class CloudDlpDataProfile + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # Parents for configurations that produce data profile findings. + module ParentType + # Unspecified parent type. + PARENT_TYPE_UNSPECIFIED = 0 + + # Organization-level configurations. + ORGANIZATION = 1 + + # Project-level configurations. + PROJECT = 2 + end + end + + # Type of information detected by the API. + # @!attribute [rw] name + # @return [::String] + # Name of the information type. Either a name of your choosing when + # creating a CustomInfoType, or one of the names listed + # at + # https://cloud.google.com/sensitive-data-protection/docs/infotypes-reference + # when specifying a built-in type. When sending Cloud DLP results to Data + # Catalog, infoType names should conform to the pattern + # `[A-Za-z0-9$_-]{1,64}`. + # @!attribute [rw] version + # @return [::String] + # Optional version name for this InfoType. + # @!attribute [rw] sensitivity_score + # @return [::Google::Cloud::SecurityCenter::V1::SensitivityScore] + # Optional custom sensitivity for this InfoType. + # This only applies to data profiling. + class InfoType + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Score is calculated from of all elements in the data profile. + # A higher level means the data is more sensitive. + # @!attribute [rw] score + # @return [::Google::Cloud::SecurityCenter::V1::SensitivityScore::SensitivityScoreLevel] + # The sensitivity score applied to the resource. + class SensitivityScore + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # Various sensitivity score levels for resources. + module SensitivityScoreLevel + # Unused. + SENSITIVITY_SCORE_LEVEL_UNSPECIFIED = 0 + + # No sensitive information detected. The resource isn't publicly + # accessible. + SENSITIVITY_LOW = 10 + + # Unable to determine sensitivity. + SENSITIVITY_UNKNOWN = 12 + + # Medium risk. Contains personally identifiable information (PII), + # potentially sensitive data, or fields with free-text data that are at a + # higher risk of having intermittent sensitive data. Consider limiting + # access. + SENSITIVITY_MODERATE = 20 + + # High risk. Sensitive personally identifiable information (SPII) can be + # present. Exfiltration of data can lead to user data loss. + # Re-identification of users might be possible. Consider limiting usage and + # or removing SPII. + SENSITIVITY_HIGH = 30 + end + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-security_center-v1/proto_docs/google/cloud/securitycenter/v1/cloud_dlp_inspection.rb b/owl-bot-staging/google-cloud-security_center-v1/proto_docs/google/cloud/securitycenter/v1/cloud_dlp_inspection.rb new file mode 100644 index 000000000000..9faad618c6f4 --- /dev/null +++ b/owl-bot-staging/google-cloud-security_center-v1/proto_docs/google/cloud/securitycenter/v1/cloud_dlp_inspection.rb @@ -0,0 +1,50 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + + +module Google + module Cloud + module SecurityCenter + module V1 + # Details about the Cloud Data Loss Prevention (Cloud DLP) [inspection + # job](https://cloud.google.com/dlp/docs/concepts-job-triggers) that produced + # the finding. + # @!attribute [rw] inspect_job + # @return [::String] + # Name of the inspection job, for example, + # `projects/123/locations/europe/dlpJobs/i-8383929`. + # @!attribute [rw] info_type + # @return [::String] + # The type of information (or + # *[infoType](https://cloud.google.com/dlp/docs/infotypes-reference)*) found, + # for example, `EMAIL_ADDRESS` or `STREET_ADDRESS`. + # @!attribute [rw] info_type_count + # @return [::Integer] + # The number of times Cloud DLP found this infoType within this job + # and resource. + # @!attribute [rw] full_scan + # @return [::Boolean] + # Whether Cloud DLP scanned the complete resource or a sampled subset. + class CloudDlpInspection + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-security_center-v1/proto_docs/google/cloud/securitycenter/v1/compliance.rb b/owl-bot-staging/google-cloud-security_center-v1/proto_docs/google/cloud/securitycenter/v1/compliance.rb new file mode 100644 index 000000000000..158ef2e388fe --- /dev/null +++ b/owl-bot-staging/google-cloud-security_center-v1/proto_docs/google/cloud/securitycenter/v1/compliance.rb @@ -0,0 +1,43 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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 SecurityCenter + module V1 + # Contains compliance information about a security standard indicating unmet + # recommendations. + # @!attribute [rw] standard + # @return [::String] + # Industry-wide compliance standards or benchmarks, such as CIS, PCI, and + # OWASP. + # @!attribute [rw] version + # @return [::String] + # Version of the standard or benchmark, for example, 1.1 + # @!attribute [rw] ids + # @return [::Array<::String>] + # Policies within the standard or benchmark, for example, A.12.4.1 + class Compliance + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-security_center-v1/proto_docs/google/cloud/securitycenter/v1/connection.rb b/owl-bot-staging/google-cloud-security_center-v1/proto_docs/google/cloud/securitycenter/v1/connection.rb new file mode 100644 index 000000000000..b44d3c237ea7 --- /dev/null +++ b/owl-bot-staging/google-cloud-security_center-v1/proto_docs/google/cloud/securitycenter/v1/connection.rb @@ -0,0 +1,70 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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 SecurityCenter + module V1 + # Contains information about the IP connection associated with the finding. + # @!attribute [rw] destination_ip + # @return [::String] + # Destination IP address. Not present for sockets that are listening and not + # connected. + # @!attribute [rw] destination_port + # @return [::Integer] + # Destination port. Not present for sockets that are listening and not + # connected. + # @!attribute [rw] source_ip + # @return [::String] + # Source IP address. + # @!attribute [rw] source_port + # @return [::Integer] + # Source port. + # @!attribute [rw] protocol + # @return [::Google::Cloud::SecurityCenter::V1::Connection::Protocol] + # IANA Internet Protocol Number such as TCP(6) and UDP(17). + class Connection + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # IANA Internet Protocol Number such as TCP(6) and UDP(17). + module Protocol + # Unspecified protocol (not HOPOPT). + PROTOCOL_UNSPECIFIED = 0 + + # Internet Control Message Protocol. + ICMP = 1 + + # Transmission Control Protocol. + TCP = 6 + + # User Datagram Protocol. + UDP = 17 + + # Generic Routing Encapsulation. + GRE = 47 + + # Encap Security Payload. + ESP = 50 + end + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-security_center-v1/proto_docs/google/cloud/securitycenter/v1/contact_details.rb b/owl-bot-staging/google-cloud-security_center-v1/proto_docs/google/cloud/securitycenter/v1/contact_details.rb new file mode 100644 index 000000000000..de91713678d6 --- /dev/null +++ b/owl-bot-staging/google-cloud-security_center-v1/proto_docs/google/cloud/securitycenter/v1/contact_details.rb @@ -0,0 +1,44 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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 SecurityCenter + module V1 + # Details about specific contacts + # @!attribute [rw] contacts + # @return [::Array<::Google::Cloud::SecurityCenter::V1::Contact>] + # A list of contacts + class ContactDetails + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # The email address of a contact. + # @!attribute [rw] email + # @return [::String] + # An email address. For example, "`person123@company.com`". + class Contact + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-security_center-v1/proto_docs/google/cloud/securitycenter/v1/container.rb b/owl-bot-staging/google-cloud-security_center-v1/proto_docs/google/cloud/securitycenter/v1/container.rb new file mode 100644 index 000000000000..acc0a1015fa9 --- /dev/null +++ b/owl-bot-staging/google-cloud-security_center-v1/proto_docs/google/cloud/securitycenter/v1/container.rb @@ -0,0 +1,49 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + + +module Google + module Cloud + module SecurityCenter + module V1 + # Container associated with the finding. + # @!attribute [rw] name + # @return [::String] + # Name of the container. + # @!attribute [rw] uri + # @return [::String] + # Container image URI provided when configuring a pod or container. This + # string can identify a container image version using mutable tags. + # @!attribute [rw] image_id + # @return [::String] + # Optional container image ID, if provided by the container runtime. Uniquely + # identifies the container image launched using a container image digest. + # @!attribute [rw] labels + # @return [::Array<::Google::Cloud::SecurityCenter::V1::Label>] + # Container labels, as provided by the container runtime. + # @!attribute [rw] create_time + # @return [::Google::Protobuf::Timestamp] + # The time that the container was created. + class Container + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-security_center-v1/proto_docs/google/cloud/securitycenter/v1/database.rb b/owl-bot-staging/google-cloud-security_center-v1/proto_docs/google/cloud/securitycenter/v1/database.rb new file mode 100644 index 000000000000..2294178aef6c --- /dev/null +++ b/owl-bot-staging/google-cloud-security_center-v1/proto_docs/google/cloud/securitycenter/v1/database.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 Cloud + module SecurityCenter + module V1 + # Represents database access information, such as queries. A database may be a + # sub-resource of an instance (as in the case of Cloud SQL instances or Cloud + # Spanner instances), or the database instance itself. Some database resources + # might not have the [full resource + # name](https://google.aip.dev/122#full-resource-names) populated because these + # resource types, such as Cloud SQL databases, are not yet supported by Cloud + # Asset Inventory. In these cases only the display name is provided. + # @!attribute [rw] name + # @return [::String] + # Some database resources may not have the [full resource + # name](https://google.aip.dev/122#full-resource-names) populated because + # these resource types are not yet supported by Cloud Asset Inventory (e.g. + # Cloud SQL databases). In these cases only the display name will be + # provided. + # The [full resource name](https://google.aip.dev/122#full-resource-names) of + # the database that the user connected to, if it is supported by Cloud Asset + # Inventory. + # @!attribute [rw] display_name + # @return [::String] + # The human-readable name of the database that the user connected to. + # @!attribute [rw] user_name + # @return [::String] + # The username used to connect to the database. The username might not be an + # IAM principal and does not have a set format. + # @!attribute [rw] query + # @return [::String] + # The SQL statement that is associated with the database access. + # @!attribute [rw] grantees + # @return [::Array<::String>] + # The target usernames, roles, or groups of an SQL privilege grant, which is + # not an IAM policy change. + # @!attribute [rw] version + # @return [::String] + # The version of the database, for example, POSTGRES_14. + # See [the complete + # list](https://cloud.google.com/sql/docs/mysql/admin-api/rest/v1/SqlDatabaseVersion). + class Database + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-security_center-v1/proto_docs/google/cloud/securitycenter/v1/effective_event_threat_detection_custom_module.rb b/owl-bot-staging/google-cloud-security_center-v1/proto_docs/google/cloud/securitycenter/v1/effective_event_threat_detection_custom_module.rb new file mode 100644 index 000000000000..06a03cf035f5 --- /dev/null +++ b/owl-bot-staging/google-cloud-security_center-v1/proto_docs/google/cloud/securitycenter/v1/effective_event_threat_detection_custom_module.rb @@ -0,0 +1,77 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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 SecurityCenter + module V1 + # An EffectiveEventThreatDetectionCustomModule is the representation of + # an Event Threat Detection custom module at a specified level of the + # resource hierarchy: organization, folder, or project. If a custom module is + # inherited from a parent organization or folder, the value of the + # `enablement_state` property in EffectiveEventThreatDetectionCustomModule is + # set to the value that is effective in the parent, instead of `INHERITED`. + # For example, if the module is enabled in a parent organization or folder, the + # effective `enablement_state` for the module in all child folders or projects + # is also `enabled`. EffectiveEventThreatDetectionCustomModule is read-only. + # @!attribute [r] name + # @return [::String] + # Output only. The resource name of the effective ETD custom module. + # + # Its format is: + # + # * `organizations/{organization}/eventThreatDetectionSettings/effectiveCustomModules/{module}`. + # * `folders/{folder}/eventThreatDetectionSettings/effectiveCustomModules/{module}`. + # * `projects/{project}/eventThreatDetectionSettings/effectiveCustomModules/{module}`. + # @!attribute [r] config + # @return [::Google::Protobuf::Struct] + # Output only. Config for the effective module. + # @!attribute [r] enablement_state + # @return [::Google::Cloud::SecurityCenter::V1::EffectiveEventThreatDetectionCustomModule::EnablementState] + # Output only. The effective state of enablement for the module at the given + # level of the hierarchy. + # @!attribute [r] type + # @return [::String] + # Output only. Type for the module. e.g. CONFIGURABLE_BAD_IP. + # @!attribute [r] display_name + # @return [::String] + # Output only. The human readable name to be displayed for the module. + # @!attribute [r] description + # @return [::String] + # Output only. The description for the module. + class EffectiveEventThreatDetectionCustomModule + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # The enablement state of the module. + module EnablementState + # Unspecified enablement state. + ENABLEMENT_STATE_UNSPECIFIED = 0 + + # The module is enabled at the given level. + ENABLED = 1 + + # The module is disabled at the given level. + DISABLED = 2 + end + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-security_center-v1/proto_docs/google/cloud/securitycenter/v1/effective_security_health_analytics_custom_module.rb b/owl-bot-staging/google-cloud-security_center-v1/proto_docs/google/cloud/securitycenter/v1/effective_security_health_analytics_custom_module.rb new file mode 100644 index 000000000000..83aab7af710b --- /dev/null +++ b/owl-bot-staging/google-cloud-security_center-v1/proto_docs/google/cloud/securitycenter/v1/effective_security_health_analytics_custom_module.rb @@ -0,0 +1,73 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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 SecurityCenter + module V1 + # An EffectiveSecurityHealthAnalyticsCustomModule is the representation of + # a Security Health Analytics custom module at a specified level of the + # resource hierarchy: organization, folder, or project. If a custom module is + # inherited from a parent organization or folder, the value of the + # `enablementState` property in EffectiveSecurityHealthAnalyticsCustomModule is + # set to the value that is effective in the parent, instead of `INHERITED`. + # For example, if the module is enabled in a parent organization or folder, the + # effective enablement_state for the module in all child folders or projects is + # also `enabled`. EffectiveSecurityHealthAnalyticsCustomModule is read-only. + # @!attribute [r] name + # @return [::String] + # Output only. The resource name of the custom module. + # Its format is + # "organizations/\\{organization}/securityHealthAnalyticsSettings/effectiveCustomModules/\\{customModule}", + # or + # "folders/\\{folder}/securityHealthAnalyticsSettings/effectiveCustomModules/\\{customModule}", + # or + # "projects/\\{project}/securityHealthAnalyticsSettings/effectiveCustomModules/\\{customModule}" + # @!attribute [r] custom_config + # @return [::Google::Cloud::SecurityCenter::V1::CustomConfig] + # Output only. The user-specified configuration for the module. + # @!attribute [r] enablement_state + # @return [::Google::Cloud::SecurityCenter::V1::EffectiveSecurityHealthAnalyticsCustomModule::EnablementState] + # Output only. The effective state of enablement for the module at the given + # level of the hierarchy. + # @!attribute [r] display_name + # @return [::String] + # Output only. The display name for the custom module. The name must be + # between 1 and 128 characters, start with a lowercase letter, and contain + # alphanumeric characters or underscores only. + class EffectiveSecurityHealthAnalyticsCustomModule + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # The enablement state of the module. + module EnablementState + # Unspecified enablement state. + ENABLEMENT_STATE_UNSPECIFIED = 0 + + # The module is enabled at the given level. + ENABLED = 1 + + # The module is disabled at the given level. + DISABLED = 2 + end + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-security_center-v1/proto_docs/google/cloud/securitycenter/v1/event_threat_detection_custom_module.rb b/owl-bot-staging/google-cloud-security_center-v1/proto_docs/google/cloud/securitycenter/v1/event_threat_detection_custom_module.rb new file mode 100644 index 000000000000..e5b28d560c27 --- /dev/null +++ b/owl-bot-staging/google-cloud-security_center-v1/proto_docs/google/cloud/securitycenter/v1/event_threat_detection_custom_module.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 Cloud + module SecurityCenter + module V1 + # Represents an instance of an Event Threat Detection custom module, + # including its full module name, display name, enablement state, and last + # updated time. You can create a custom module at the organization, folder, or + # project level. Custom modules that you create at the organization or folder + # level are inherited by child folders and projects. + # @!attribute [rw] name + # @return [::String] + # Immutable. The resource name of the Event Threat Detection custom module. + # + # Its format is: + # + # * `organizations/{organization}/eventThreatDetectionSettings/customModules/{module}`. + # * `folders/{folder}/eventThreatDetectionSettings/customModules/{module}`. + # * `projects/{project}/eventThreatDetectionSettings/customModules/{module}`. + # @!attribute [rw] config + # @return [::Google::Protobuf::Struct] + # Config for the module. For the resident module, its config value is defined + # at this level. For the inherited module, its config value is inherited from + # the ancestor module. + # @!attribute [r] ancestor_module + # @return [::String] + # Output only. The closest ancestor module that this module inherits the + # enablement state from. The format is the same as the + # EventThreatDetectionCustomModule resource name. + # @!attribute [rw] enablement_state + # @return [::Google::Cloud::SecurityCenter::V1::EventThreatDetectionCustomModule::EnablementState] + # The state of enablement for the module at the given level of the hierarchy. + # @!attribute [rw] type + # @return [::String] + # Type for the module. e.g. CONFIGURABLE_BAD_IP. + # @!attribute [rw] display_name + # @return [::String] + # The human readable name to be displayed for the module. + # @!attribute [rw] description + # @return [::String] + # The description for the module. + # @!attribute [r] update_time + # @return [::Google::Protobuf::Timestamp] + # Output only. The time the module was last updated. + # @!attribute [r] last_editor + # @return [::String] + # Output only. The editor the module was last updated by. + class EventThreatDetectionCustomModule + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # The enablement state of the module. + module EnablementState + # Unspecified enablement state. + ENABLEMENT_STATE_UNSPECIFIED = 0 + + # The module is enabled at the given level. + ENABLED = 1 + + # The module is disabled at the given level. + DISABLED = 2 + + # When the enablement state is inherited. + INHERITED = 3 + end + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-security_center-v1/proto_docs/google/cloud/securitycenter/v1/event_threat_detection_custom_module_validation_errors.rb b/owl-bot-staging/google-cloud-security_center-v1/proto_docs/google/cloud/securitycenter/v1/event_threat_detection_custom_module_validation_errors.rb new file mode 100644 index 000000000000..0751dbe51e9a --- /dev/null +++ b/owl-bot-staging/google-cloud-security_center-v1/proto_docs/google/cloud/securitycenter/v1/event_threat_detection_custom_module_validation_errors.rb @@ -0,0 +1,69 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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 SecurityCenter + module V1 + # A list of zero or more errors encountered while validating the uploaded + # configuration of an Event Threat Detection Custom Module. + # @!attribute [rw] errors + # @return [::Array<::Google::Cloud::SecurityCenter::V1::CustomModuleValidationError>] + class CustomModuleValidationErrors + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # An error encountered while validating the uploaded configuration of an + # Event Threat Detection Custom Module. + # @!attribute [rw] description + # @return [::String] + # A description of the error, suitable for human consumption. Required. + # @!attribute [rw] field_path + # @return [::String] + # The path, in RFC 8901 JSON Pointer format, to the field that failed + # validation. This may be left empty if no specific field is affected. + # @!attribute [rw] start + # @return [::Google::Cloud::SecurityCenter::V1::Position] + # The initial position of the error in the uploaded text version of the + # module. This field may be omitted if no specific position applies, or if + # one could not be computed. + # @!attribute [rw] end + # @return [::Google::Cloud::SecurityCenter::V1::Position] + # The end position of the error in the uploaded text version of the + # module. This field may be omitted if no specific position applies, or if + # one could not be computed.. + class CustomModuleValidationError + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # A position in the uploaded text version of a module. + # @!attribute [rw] line_number + # @return [::Integer] + # @!attribute [rw] column_number + # @return [::Integer] + class Position + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-security_center-v1/proto_docs/google/cloud/securitycenter/v1/exfiltration.rb b/owl-bot-staging/google-cloud-security_center-v1/proto_docs/google/cloud/securitycenter/v1/exfiltration.rb new file mode 100644 index 000000000000..718388b29179 --- /dev/null +++ b/owl-bot-staging/google-cloud-security_center-v1/proto_docs/google/cloud/securitycenter/v1/exfiltration.rb @@ -0,0 +1,64 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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 SecurityCenter + module V1 + # Exfiltration represents a data exfiltration attempt from one or more sources + # to one or more targets. The `sources` attribute lists the sources of the + # exfiltrated data. The `targets` attribute lists the destinations the data was + # copied to. + # @!attribute [rw] sources + # @return [::Array<::Google::Cloud::SecurityCenter::V1::ExfilResource>] + # If there are multiple sources, then the data is considered "joined" between + # them. For instance, BigQuery can join multiple tables, and each + # table would be considered a source. + # @!attribute [rw] targets + # @return [::Array<::Google::Cloud::SecurityCenter::V1::ExfilResource>] + # If there are multiple targets, each target would get a complete copy of the + # "joined" source data. + # @!attribute [rw] total_exfiltrated_bytes + # @return [::Integer] + # Total exfiltrated bytes processed for the entire job. + class Exfiltration + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Resource where data was exfiltrated from or exfiltrated to. + # @!attribute [rw] name + # @return [::String] + # The resource's [full resource + # name](https://cloud.google.com/apis/design/resource_names#full_resource_name). + # @!attribute [rw] components + # @return [::Array<::String>] + # Subcomponents of the asset that was exfiltrated, like URIs used during + # exfiltration, table names, databases, and filenames. For example, multiple + # tables might have been exfiltrated from the same Cloud SQL instance, or + # multiple files might have been exfiltrated from the same Cloud Storage + # bucket. + class ExfilResource + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-security_center-v1/proto_docs/google/cloud/securitycenter/v1/external_exposure.rb b/owl-bot-staging/google-cloud-security_center-v1/proto_docs/google/cloud/securitycenter/v1/external_exposure.rb new file mode 100644 index 000000000000..8b10d2880776 --- /dev/null +++ b/owl-bot-staging/google-cloud-security_center-v1/proto_docs/google/cloud/securitycenter/v1/external_exposure.rb @@ -0,0 +1,77 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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 SecurityCenter + module V1 + # Details about the externally exposed resource associated with the finding. + # @!attribute [rw] private_ip_address + # @return [::String] + # Private IP address of the exposed endpoint. + # @!attribute [rw] private_port + # @return [::String] + # Port number associated with private IP address. + # @!attribute [rw] exposed_service + # @return [::String] + # The name and version of the service, for example, "Jupyter + # Notebook 6.14.0". + # @!attribute [rw] public_ip_address + # @return [::String] + # Public IP address of the exposed endpoint. + # @!attribute [rw] public_port + # @return [::String] + # Public port number of the exposed endpoint. + # @!attribute [rw] exposed_endpoint + # @return [::String] + # The resource which is running the exposed service, for example, + # "//compute.googleapis.com/projects/\\{project-id}/zones/\\{zone}/instances/\\{instance}.” + # @!attribute [rw] load_balancer_firewall_policy + # @return [::String] + # The full resource name of the load balancer firewall policy, for example, + # "//compute.googleapis.com/projects/\\{project-id}/global/firewallPolicies/\\{policy-name}". + # @!attribute [rw] service_firewall_policy + # @return [::String] + # The full resource name of the firewall policy of the exposed service, for + # example, + # "//compute.googleapis.com/projects/\\{project-id}/global/firewallPolicies/\\{policy-name}". + # @!attribute [rw] forwarding_rule + # @return [::String] + # The full resource name of the forwarding rule, for example, + # "//compute.googleapis.com/projects/\\{project-id}/global/forwardingRules/\\{forwarding-rule-name}". + # @!attribute [rw] backend_service + # @return [::String] + # The full resource name of load balancer backend service, for example, + # "//compute.googleapis.com/projects/\\{project-id}/global/backendServices/\\{name}". + # @!attribute [rw] instance_group + # @return [::String] + # The full resource name of the instance group, for example, + # "//compute.googleapis.com/projects/\\{project-id}/global/instanceGroups/\\{name}". + # @!attribute [rw] network_endpoint_group + # @return [::String] + # The full resource name of the network endpoint group, for example, + # "//compute.googleapis.com/projects/\\{project-id}/global/networkEndpointGroups/\\{name}". + class ExternalExposure + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-security_center-v1/proto_docs/google/cloud/securitycenter/v1/external_system.rb b/owl-bot-staging/google-cloud-security_center-v1/proto_docs/google/cloud/securitycenter/v1/external_system.rb new file mode 100644 index 000000000000..9a0f33c8a79a --- /dev/null +++ b/owl-bot-staging/google-cloud-security_center-v1/proto_docs/google/cloud/securitycenter/v1/external_system.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 Cloud + module SecurityCenter + module V1 + # Representation of third party SIEM/SOAR fields within SCC. + # @!attribute [rw] name + # @return [::String] + # Full resource name of the external system, for example: + # "organizations/1234/sources/5678/findings/123456/externalSystems/jira", + # "folders/1234/sources/5678/findings/123456/externalSystems/jira", + # "projects/1234/sources/5678/findings/123456/externalSystems/jira" + # @!attribute [rw] assignees + # @return [::Array<::String>] + # References primary/secondary etc assignees in the external system. + # @!attribute [rw] external_uid + # @return [::String] + # The identifier that's used to track the finding's corresponding case in the + # external system. + # @!attribute [rw] status + # @return [::String] + # The most recent status of the finding's corresponding case, as reported by + # the external system. + # @!attribute [rw] external_system_update_time + # @return [::Google::Protobuf::Timestamp] + # The time when the case was last updated, as reported by the external + # system. + # @!attribute [rw] case_uri + # @return [::String] + # The link to the finding's corresponding case in the external system. + # @!attribute [rw] case_priority + # @return [::String] + # The priority of the finding's corresponding case in the external system. + # @!attribute [rw] case_sla + # @return [::Google::Protobuf::Timestamp] + # The SLA of the finding's corresponding case in the external system. + # @!attribute [rw] case_create_time + # @return [::Google::Protobuf::Timestamp] + # The time when the case was created, as reported by the external system. + # @!attribute [rw] case_close_time + # @return [::Google::Protobuf::Timestamp] + # The time when the case was closed, as reported by the external system. + # @!attribute [rw] ticket_info + # @return [::Google::Cloud::SecurityCenter::V1::ExternalSystem::TicketInfo] + # Information about the ticket, if any, that is being used to track the + # resolution of the issue that is identified by this finding. + class ExternalSystem + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # Information about the ticket, if any, that is being used to track the + # resolution of the issue that is identified by this finding. + # @!attribute [rw] id + # @return [::String] + # The identifier of the ticket in the ticket system. + # @!attribute [rw] assignee + # @return [::String] + # The assignee of the ticket in the ticket system. + # @!attribute [rw] description + # @return [::String] + # The description of the ticket in the ticket system. + # @!attribute [rw] uri + # @return [::String] + # The link to the ticket in the ticket system. + # @!attribute [rw] status + # @return [::String] + # The latest status of the ticket, as reported by the ticket system. + # @!attribute [rw] update_time + # @return [::Google::Protobuf::Timestamp] + # The time when the ticket was last updated, as reported by the ticket + # system. + class TicketInfo + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-security_center-v1/proto_docs/google/cloud/securitycenter/v1/file.rb b/owl-bot-staging/google-cloud-security_center-v1/proto_docs/google/cloud/securitycenter/v1/file.rb new file mode 100644 index 000000000000..7e7468407e6a --- /dev/null +++ b/owl-bot-staging/google-cloud-security_center-v1/proto_docs/google/cloud/securitycenter/v1/file.rb @@ -0,0 +1,72 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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 SecurityCenter + module V1 + # File information about the related binary/library used by an executable, or + # the script used by a script interpreter + # @!attribute [rw] path + # @return [::String] + # Absolute path of the file as a JSON encoded string. + # @!attribute [rw] size + # @return [::Integer] + # Size of the file in bytes. + # @!attribute [rw] sha256 + # @return [::String] + # SHA256 hash of the first hashed_size bytes of the file encoded as a + # hex string. If hashed_size == size, sha256 represents the SHA256 hash + # of the entire file. + # @!attribute [rw] hashed_size + # @return [::Integer] + # The length in bytes of the file prefix that was hashed. If + # hashed_size == size, any hashes reported represent the entire + # file. + # @!attribute [rw] partially_hashed + # @return [::Boolean] + # True when the hash covers only a prefix of the file. + # @!attribute [rw] contents + # @return [::String] + # Prefix of the file contents as a JSON-encoded string. + # @!attribute [rw] disk_path + # @return [::Google::Cloud::SecurityCenter::V1::File::DiskPath] + # Path of the file in terms of underlying disk/partition identifiers. + class File + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # Path of the file in terms of underlying disk/partition identifiers. + # @!attribute [rw] partition_uuid + # @return [::String] + # UUID of the partition (format + # https://wiki.archlinux.org/title/persistent_block_device_naming#by-uuid) + # @!attribute [rw] relative_path + # @return [::String] + # Relative path of the file in the partition as a JSON encoded string. + # Example: /home/user1/executable_file.sh + class DiskPath + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-security_center-v1/proto_docs/google/cloud/securitycenter/v1/finding.rb b/owl-bot-staging/google-cloud-security_center-v1/proto_docs/google/cloud/securitycenter/v1/finding.rb new file mode 100644 index 000000000000..0ca04a21cd53 --- /dev/null +++ b/owl-bot-staging/google-cloud-security_center-v1/proto_docs/google/cloud/securitycenter/v1/finding.rb @@ -0,0 +1,477 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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 SecurityCenter + module V1 + # Security Command Center finding. + # + # A finding is a record of assessment data like security, risk, health, or + # privacy, that is ingested into Security Command Center for presentation, + # notification, analysis, policy testing, and enforcement. For example, a + # cross-site scripting (XSS) vulnerability in an App Engine application is a + # finding. + # @!attribute [rw] name + # @return [::String] + # The [relative resource + # name](https://cloud.google.com/apis/design/resource_names#relative_resource_name) + # of the finding. Example: + # "organizations/\\{organization_id}/sources/\\{source_id}/findings/\\{finding_id}", + # "folders/\\{folder_id}/sources/\\{source_id}/findings/\\{finding_id}", + # "projects/\\{project_id}/sources/\\{source_id}/findings/\\{finding_id}". + # @!attribute [rw] parent + # @return [::String] + # The relative resource name of the source the finding belongs to. See: + # https://cloud.google.com/apis/design/resource_names#relative_resource_name + # This field is immutable after creation time. + # For example: + # "organizations/\\{organization_id}/sources/\\{source_id}" + # @!attribute [rw] resource_name + # @return [::String] + # For findings on Google Cloud resources, the full resource + # name of the Google Cloud resource this finding is for. See: + # https://cloud.google.com/apis/design/resource_names#full_resource_name + # When the finding is for a non-Google Cloud resource, the resourceName can + # be a customer or partner defined string. This field is immutable after + # creation time. + # @!attribute [rw] state + # @return [::Google::Cloud::SecurityCenter::V1::Finding::State] + # The state of the finding. + # @!attribute [rw] category + # @return [::String] + # The additional taxonomy group within findings from a given source. + # This field is immutable after creation time. + # Example: "XSS_FLASH_INJECTION" + # @!attribute [rw] external_uri + # @return [::String] + # The URI that, if available, points to a web page outside of Security + # Command Center where additional information about the finding can be found. + # This field is guaranteed to be either empty or a well formed URL. + # @!attribute [rw] source_properties + # @return [::Google::Protobuf::Map{::String => ::Google::Protobuf::Value}] + # Source specific properties. These properties are managed by the source + # that writes the finding. The key names in the source_properties map must be + # between 1 and 255 characters, and must start with a letter and contain + # alphanumeric characters or underscores only. + # @!attribute [r] security_marks + # @return [::Google::Cloud::SecurityCenter::V1::SecurityMarks] + # Output only. User specified security marks. These marks are entirely + # managed by the user and come from the SecurityMarks resource that belongs + # to the finding. + # @!attribute [rw] event_time + # @return [::Google::Protobuf::Timestamp] + # The time the finding was first detected. If an existing finding is updated, + # then this is the time the update occurred. + # For example, if the finding represents an open firewall, this property + # captures the time the detector believes the firewall became open. The + # accuracy is determined by the detector. If the finding is later resolved, + # then this time reflects when the finding was resolved. This must not + # be set to a value greater than the current timestamp. + # @!attribute [rw] create_time + # @return [::Google::Protobuf::Timestamp] + # The time at which the finding was created in Security Command Center. + # @!attribute [rw] severity + # @return [::Google::Cloud::SecurityCenter::V1::Finding::Severity] + # The severity of the finding. This field is managed by the source that + # writes the finding. + # @!attribute [rw] canonical_name + # @return [::String] + # The canonical name of the finding. It's either + # "organizations/\\{organization_id}/sources/\\{source_id}/findings/\\{finding_id}", + # "folders/\\{folder_id}/sources/\\{source_id}/findings/\\{finding_id}" or + # "projects/\\{project_number}/sources/\\{source_id}/findings/\\{finding_id}", + # depending on the closest CRM ancestor of the resource associated with the + # finding. + # @!attribute [rw] mute + # @return [::Google::Cloud::SecurityCenter::V1::Finding::Mute] + # Indicates the mute state of a finding (either muted, unmuted + # or undefined). Unlike other attributes of a finding, a finding provider + # shouldn't set the value of mute. + # @!attribute [rw] finding_class + # @return [::Google::Cloud::SecurityCenter::V1::Finding::FindingClass] + # The class of the finding. + # @!attribute [rw] indicator + # @return [::Google::Cloud::SecurityCenter::V1::Indicator] + # Represents what's commonly known as an *indicator of compromise* (IoC) in + # computer forensics. This is an artifact observed on a network or in an + # operating system that, with high confidence, indicates a computer + # intrusion. For more information, see [Indicator of + # compromise](https://en.wikipedia.org/wiki/Indicator_of_compromise). + # @!attribute [rw] vulnerability + # @return [::Google::Cloud::SecurityCenter::V1::Vulnerability] + # Represents vulnerability-specific fields like CVE and CVSS scores. + # CVE stands for Common Vulnerabilities and Exposures + # (https://cve.mitre.org/about/) + # @!attribute [r] mute_update_time + # @return [::Google::Protobuf::Timestamp] + # Output only. The most recent time this finding was muted or unmuted. + # @!attribute [r] external_systems + # @return [::Google::Protobuf::Map{::String => ::Google::Cloud::SecurityCenter::V1::ExternalSystem}] + # Output only. Third party SIEM/SOAR fields within SCC, contains external + # system information and external system finding fields. + # @!attribute [rw] mitre_attack + # @return [::Google::Cloud::SecurityCenter::V1::MitreAttack] + # MITRE ATT&CK tactics and techniques related to this finding. + # See: https://attack.mitre.org + # @!attribute [rw] access + # @return [::Google::Cloud::SecurityCenter::V1::Access] + # Access details associated with the finding, such as more information on the + # caller, which method was accessed, and from where. + # @!attribute [rw] connections + # @return [::Array<::Google::Cloud::SecurityCenter::V1::Connection>] + # Contains information about the IP connection associated with the finding. + # @!attribute [rw] mute_initiator + # @return [::String] + # Records additional information about the mute operation, for example, the + # [mute configuration](/security-command-center/docs/how-to-mute-findings) + # that muted the finding and the user who muted the finding. + # @!attribute [r] mute_info + # @return [::Google::Cloud::SecurityCenter::V1::Finding::MuteInfo] + # Output only. The mute information regarding this finding. + # @!attribute [rw] processes + # @return [::Array<::Google::Cloud::SecurityCenter::V1::Process>] + # Represents operating system processes associated with the Finding. + # @!attribute [r] contacts + # @return [::Google::Protobuf::Map{::String => ::Google::Cloud::SecurityCenter::V1::ContactDetails}] + # Output only. Map containing the points of contact for the given finding. + # The key represents the type of contact, while the value contains a list of + # all the contacts that pertain. Please refer to: + # https://cloud.google.com/resource-manager/docs/managing-notification-contacts#notification-categories + # + # { + # "security": { + # "contacts": [ + # { + # "email": "person1@company.com" + # }, + # { + # "email": "person2@company.com" + # } + # ] + # } + # } + # @!attribute [rw] compliances + # @return [::Array<::Google::Cloud::SecurityCenter::V1::Compliance>] + # Contains compliance information for security standards associated to the + # finding. + # @!attribute [r] parent_display_name + # @return [::String] + # Output only. The human readable display name of the finding source such as + # "Event Threat Detection" or "Security Health Analytics". + # @!attribute [rw] description + # @return [::String] + # Contains more details about the finding. + # @!attribute [rw] exfiltration + # @return [::Google::Cloud::SecurityCenter::V1::Exfiltration] + # Represents exfiltrations associated with the finding. + # @!attribute [rw] iam_bindings + # @return [::Array<::Google::Cloud::SecurityCenter::V1::IamBinding>] + # Represents IAM bindings associated with the finding. + # @!attribute [rw] next_steps + # @return [::String] + # Steps to address the finding. + # @!attribute [rw] module_name + # @return [::String] + # Unique identifier of the module which generated the finding. + # Example: + # folders/598186756061/securityHealthAnalyticsSettings/customModules/56799441161885 + # @!attribute [rw] containers + # @return [::Array<::Google::Cloud::SecurityCenter::V1::Container>] + # Containers associated with the finding. This field provides information for + # both Kubernetes and non-Kubernetes containers. + # @!attribute [rw] kubernetes + # @return [::Google::Cloud::SecurityCenter::V1::Kubernetes] + # Kubernetes resources associated with the finding. + # @!attribute [rw] database + # @return [::Google::Cloud::SecurityCenter::V1::Database] + # Database associated with the finding. + # @!attribute [rw] attack_exposure + # @return [::Google::Cloud::SecurityCenter::V1::AttackExposure] + # The results of an attack path simulation relevant to this finding. + # @!attribute [rw] files + # @return [::Array<::Google::Cloud::SecurityCenter::V1::File>] + # File associated with the finding. + # @!attribute [rw] cloud_dlp_inspection + # @return [::Google::Cloud::SecurityCenter::V1::CloudDlpInspection] + # Cloud Data Loss Prevention (Cloud DLP) inspection results that are + # associated with the finding. + # @!attribute [rw] cloud_dlp_data_profile + # @return [::Google::Cloud::SecurityCenter::V1::CloudDlpDataProfile] + # Cloud DLP data profile that is associated with the finding. + # @!attribute [rw] kernel_rootkit + # @return [::Google::Cloud::SecurityCenter::V1::KernelRootkit] + # Signature of the kernel rootkit. + # @!attribute [rw] org_policies + # @return [::Array<::Google::Cloud::SecurityCenter::V1::OrgPolicy>] + # Contains information about the org policies associated with the finding. + # @!attribute [rw] application + # @return [::Google::Cloud::SecurityCenter::V1::Application] + # Represents an application associated with the finding. + # @!attribute [rw] backup_disaster_recovery + # @return [::Google::Cloud::SecurityCenter::V1::BackupDisasterRecovery] + # Fields related to Backup and DR findings. + # @!attribute [rw] security_posture + # @return [::Google::Cloud::SecurityCenter::V1::SecurityPosture] + # The security posture associated with the finding. + # @!attribute [rw] log_entries + # @return [::Array<::Google::Cloud::SecurityCenter::V1::LogEntry>] + # Log entries that are relevant to the finding. + # @!attribute [rw] load_balancers + # @return [::Array<::Google::Cloud::SecurityCenter::V1::LoadBalancer>] + # The load balancers associated with the finding. + # @!attribute [rw] cloud_armor + # @return [::Google::Cloud::SecurityCenter::V1::CloudArmor] + # Fields related to Cloud Armor findings. + # @!attribute [rw] notebook + # @return [::Google::Cloud::SecurityCenter::V1::Notebook] + # Notebook associated with the finding. + # @!attribute [rw] toxic_combination + # @return [::Google::Cloud::SecurityCenter::V1::ToxicCombination] + # Contains details about a group of security issues that, when the issues + # occur together, represent a greater risk than when the issues occur + # independently. A group of such issues is referred to as a toxic + # combination. + # This field cannot be updated. Its value is ignored in all update requests. + # @!attribute [rw] group_memberships + # @return [::Array<::Google::Cloud::SecurityCenter::V1::GroupMembership>] + # Contains details about groups of which this finding is a member. A group is + # a collection of findings that are related in some way. + # This field cannot be updated. Its value is ignored in all update requests. + # @!attribute [rw] chokepoint + # @return [::Google::Cloud::SecurityCenter::V1::Chokepoint] + # Contains details about a chokepoint, which is a resource or resource group + # where high-risk attack paths converge, based on [attack path simulations] + # (https://cloud.google.com/security-command-center/docs/attack-exposure-learn#attack_path_simulations). + # This field cannot be updated. Its value is ignored in all update requests. + # @!attribute [rw] external_exposure + # @return [::Google::Cloud::SecurityCenter::V1::ExternalExposure] + # External exposure associated with the finding. + class Finding + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # Mute information about the finding, including whether the finding has a + # static mute or any matching dynamic mute rules. + # @!attribute [rw] static_mute + # @return [::Google::Cloud::SecurityCenter::V1::Finding::MuteInfo::StaticMute] + # If set, the static mute applied to this finding. Static mutes override + # dynamic mutes. If unset, there is no static mute. + # @!attribute [rw] dynamic_mute_records + # @return [::Array<::Google::Cloud::SecurityCenter::V1::Finding::MuteInfo::DynamicMuteRecord>] + # The list of dynamic mute rules that currently match the finding. + class MuteInfo + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # Information about the static mute state. A static mute state overrides + # any dynamic mute rules that apply to this finding. The static mute state + # can be set by a static mute rule or by muting the finding directly. + # @!attribute [rw] state + # @return [::Google::Cloud::SecurityCenter::V1::Finding::Mute] + # The static mute state. If the value is `MUTED` or `UNMUTED`, then the + # finding's overall mute state will have the same value. + # @!attribute [rw] apply_time + # @return [::Google::Protobuf::Timestamp] + # When the static mute was applied. + class StaticMute + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # The record of a dynamic mute rule that matches the finding. + # @!attribute [rw] mute_config + # @return [::String] + # The relative resource name of the mute rule, represented by a mute + # config, that created this record, for example + # `organizations/123/muteConfigs/mymuteconfig` or + # `organizations/123/locations/global/muteConfigs/mymuteconfig`. + # @!attribute [rw] match_time + # @return [::Google::Protobuf::Timestamp] + # When the dynamic mute rule first matched the finding. + class DynamicMuteRecord + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end + + # @!attribute [rw] key + # @return [::String] + # @!attribute [rw] value + # @return [::Google::Protobuf::Value] + class SourcePropertiesEntry + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # @!attribute [rw] key + # @return [::String] + # @!attribute [rw] value + # @return [::Google::Cloud::SecurityCenter::V1::ExternalSystem] + class ExternalSystemsEntry + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # @!attribute [rw] key + # @return [::String] + # @!attribute [rw] value + # @return [::Google::Cloud::SecurityCenter::V1::ContactDetails] + class ContactsEntry + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # The state of the finding. + module State + # Unspecified state. + STATE_UNSPECIFIED = 0 + + # The finding requires attention and has not been addressed yet. + ACTIVE = 1 + + # The finding has been fixed, triaged as a non-issue or otherwise addressed + # and is no longer active. + INACTIVE = 2 + end + + # The severity of the finding. + module Severity + # This value is used for findings when a source doesn't write a severity + # value. + SEVERITY_UNSPECIFIED = 0 + + # Vulnerability: + # A critical vulnerability is easily discoverable by an external actor, + # exploitable, and results in the direct ability to execute arbitrary code, + # exfiltrate data, and otherwise gain additional access and privileges to + # cloud resources and workloads. Examples include publicly accessible + # unprotected user data and public SSH access with weak or no + # passwords. + # + # Threat: + # Indicates a threat that is able to access, modify, or delete data or + # execute unauthorized code within existing resources. + CRITICAL = 1 + + # Vulnerability: + # A high risk vulnerability can be easily discovered and exploited in + # combination with other vulnerabilities in order to gain direct access and + # the ability to execute arbitrary code, exfiltrate data, and otherwise + # gain additional access and privileges to cloud resources and workloads. + # An example is a database with weak or no passwords that is only + # accessible internally. This database could easily be compromised by an + # actor that had access to the internal network. + # + # Threat: + # Indicates a threat that is able to create new computational resources in + # an environment but not able to access data or execute code in existing + # resources. + HIGH = 2 + + # Vulnerability: + # A medium risk vulnerability could be used by an actor to gain access to + # resources or privileges that enable them to eventually (through multiple + # steps or a complex exploit) gain access and the ability to execute + # arbitrary code or exfiltrate data. An example is a service account with + # access to more projects than it should have. If an actor gains access to + # the service account, they could potentially use that access to manipulate + # a project the service account was not intended to. + # + # Threat: + # Indicates a threat that is able to cause operational impact but may not + # access data or execute unauthorized code. + MEDIUM = 3 + + # Vulnerability: + # A low risk vulnerability hampers a security organization's ability to + # detect vulnerabilities or active threats in their deployment, or prevents + # the root cause investigation of security issues. An example is monitoring + # and logs being disabled for resource configurations and access. + # + # Threat: + # Indicates a threat that has obtained minimal access to an environment but + # is not able to access data, execute code, or create resources. + LOW = 4 + end + + # Mute state a finding can be in. + module Mute + # Unspecified. + MUTE_UNSPECIFIED = 0 + + # Finding has been muted. + MUTED = 1 + + # Finding has been unmuted. + UNMUTED = 2 + + # Finding has never been muted/unmuted. + UNDEFINED = 4 + end + + # Represents what kind of Finding it is. + module FindingClass + # Unspecified finding class. + FINDING_CLASS_UNSPECIFIED = 0 + + # Describes unwanted or malicious activity. + THREAT = 1 + + # Describes a potential weakness in software that increases risk to + # Confidentiality & Integrity & Availability. + VULNERABILITY = 2 + + # Describes a potential weakness in cloud resource/asset configuration that + # increases risk. + MISCONFIGURATION = 3 + + # Describes a security observation that is for informational purposes. + OBSERVATION = 4 + + # Describes an error that prevents some SCC functionality. + SCC_ERROR = 5 + + # Describes a potential security risk due to a change in the security + # posture. + POSTURE_VIOLATION = 6 + + # Describes a group of security issues that, when the issues + # occur together, represent a greater risk than when the issues occur + # independently. A group of such issues is referred to as a toxic + # combination. + TOXIC_COMBINATION = 7 + + # Describes a potential security risk to data assets that contain sensitive + # data. + SENSITIVE_DATA_RISK = 8 + + # Describes a resource or resource group where high risk attack paths + # converge, based on attack path simulations (APS). + CHOKEPOINT = 9 + + # Describes a potential security risk due to the resource being exposed to + # the internet. + EXTERNAL_EXPOSURE = 10 + end + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-security_center-v1/proto_docs/google/cloud/securitycenter/v1/folder.rb b/owl-bot-staging/google-cloud-security_center-v1/proto_docs/google/cloud/securitycenter/v1/folder.rb new file mode 100644 index 000000000000..18f745ec7791 --- /dev/null +++ b/owl-bot-staging/google-cloud-security_center-v1/proto_docs/google/cloud/securitycenter/v1/folder.rb @@ -0,0 +1,40 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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 SecurityCenter + module V1 + # Message that contains the resource name and display name of a folder + # resource. + # @!attribute [rw] resource_folder + # @return [::String] + # Full resource name of this folder. See: + # https://cloud.google.com/apis/design/resource_names#full_resource_name + # @!attribute [rw] resource_folder_display_name + # @return [::String] + # The user defined display name for this folder. + class Folder + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-security_center-v1/proto_docs/google/cloud/securitycenter/v1/group_membership.rb b/owl-bot-staging/google-cloud-security_center-v1/proto_docs/google/cloud/securitycenter/v1/group_membership.rb new file mode 100644 index 000000000000..78f19b012cf5 --- /dev/null +++ b/owl-bot-staging/google-cloud-security_center-v1/proto_docs/google/cloud/securitycenter/v1/group_membership.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! + + +module Google + module Cloud + module SecurityCenter + module V1 + # Contains details about groups of which this finding is a member. A group is a + # collection of findings that are related in some way. + # @!attribute [rw] group_type + # @return [::Google::Cloud::SecurityCenter::V1::GroupMembership::GroupType] + # Type of group. + # @!attribute [rw] group_id + # @return [::String] + # ID of the group. + class GroupMembership + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # Possible types of groups. + module GroupType + # Default value. + GROUP_TYPE_UNSPECIFIED = 0 + + # Group represents a toxic combination. + GROUP_TYPE_TOXIC_COMBINATION = 1 + + # Group represents a chokepoint. + GROUP_TYPE_CHOKEPOINT = 3 + end + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-security_center-v1/proto_docs/google/cloud/securitycenter/v1/iam_binding.rb b/owl-bot-staging/google-cloud-security_center-v1/proto_docs/google/cloud/securitycenter/v1/iam_binding.rb new file mode 100644 index 000000000000..0444b9de78dc --- /dev/null +++ b/owl-bot-staging/google-cloud-security_center-v1/proto_docs/google/cloud/securitycenter/v1/iam_binding.rb @@ -0,0 +1,56 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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 SecurityCenter + module V1 + # Represents a particular IAM binding, which captures a member's role addition, + # removal, or state. + # @!attribute [rw] action + # @return [::Google::Cloud::SecurityCenter::V1::IamBinding::Action] + # The action that was performed on a Binding. + # @!attribute [rw] role + # @return [::String] + # Role that is assigned to "members". + # For example, "roles/viewer", "roles/editor", or "roles/owner". + # @!attribute [rw] member + # @return [::String] + # A single identity requesting access for a Cloud Platform resource, for + # example, "foo@google.com". + class IamBinding + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # The type of action performed on a Binding in a policy. + module Action + # Unspecified. + ACTION_UNSPECIFIED = 0 + + # Addition of a Binding. + ADD = 1 + + # Removal of a Binding. + REMOVE = 2 + end + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-security_center-v1/proto_docs/google/cloud/securitycenter/v1/indicator.rb b/owl-bot-staging/google-cloud-security_center-v1/proto_docs/google/cloud/securitycenter/v1/indicator.rb new file mode 100644 index 000000000000..518ba2e5451a --- /dev/null +++ b/owl-bot-staging/google-cloud-security_center-v1/proto_docs/google/cloud/securitycenter/v1/indicator.rb @@ -0,0 +1,116 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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 SecurityCenter + module V1 + # Represents what's commonly known as an _indicator of compromise_ (IoC) in + # computer forensics. This is an artifact observed on a network or in an + # operating system that, with high confidence, indicates a computer intrusion. + # For more information, see [Indicator of + # compromise](https://en.wikipedia.org/wiki/Indicator_of_compromise). + # @!attribute [rw] ip_addresses + # @return [::Array<::String>] + # The list of IP addresses that are associated with the finding. + # @!attribute [rw] domains + # @return [::Array<::String>] + # List of domains associated to the Finding. + # @!attribute [rw] signatures + # @return [::Array<::Google::Cloud::SecurityCenter::V1::Indicator::ProcessSignature>] + # The list of matched signatures indicating that the given + # process is present in the environment. + # @!attribute [rw] uris + # @return [::Array<::String>] + # The list of URIs associated to the Findings. + class Indicator + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # Indicates what signature matched this process. + # @!attribute [rw] memory_hash_signature + # @return [::Google::Cloud::SecurityCenter::V1::Indicator::ProcessSignature::MemoryHashSignature] + # Signature indicating that a binary family was matched. + # + # Note: The following fields are mutually exclusive: `memory_hash_signature`, `yara_rule_signature`. If a field in that set is populated, all other fields in the set will automatically be cleared. + # @!attribute [rw] yara_rule_signature + # @return [::Google::Cloud::SecurityCenter::V1::Indicator::ProcessSignature::YaraRuleSignature] + # Signature indicating that a YARA rule was matched. + # + # Note: The following fields are mutually exclusive: `yara_rule_signature`, `memory_hash_signature`. If a field in that set is populated, all other fields in the set will automatically be cleared. + # @!attribute [rw] signature_type + # @return [::Google::Cloud::SecurityCenter::V1::Indicator::ProcessSignature::SignatureType] + # Describes the type of resource associated with the signature. + class ProcessSignature + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # A signature corresponding to memory page hashes. + # @!attribute [rw] binary_family + # @return [::String] + # The binary family. + # @!attribute [rw] detections + # @return [::Array<::Google::Cloud::SecurityCenter::V1::Indicator::ProcessSignature::MemoryHashSignature::Detection>] + # The list of memory hash detections contributing to the binary family + # match. + class MemoryHashSignature + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # Memory hash detection contributing to the binary family match. + # @!attribute [rw] binary + # @return [::String] + # The name of the binary associated with the memory hash + # signature detection. + # @!attribute [rw] percent_pages_matched + # @return [::Float] + # The percentage of memory page hashes in the signature + # that were matched. + class Detection + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end + + # A signature corresponding to a YARA rule. + # @!attribute [rw] yara_rule + # @return [::String] + # The name of the YARA rule. + class YaraRuleSignature + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Possible resource types to be associated with a signature. + module SignatureType + # The default signature type. + SIGNATURE_TYPE_UNSPECIFIED = 0 + + # Used for signatures concerning processes. + SIGNATURE_TYPE_PROCESS = 1 + + # Used for signatures concerning disks. + SIGNATURE_TYPE_FILE = 2 + end + end + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-security_center-v1/proto_docs/google/cloud/securitycenter/v1/kernel_rootkit.rb b/owl-bot-staging/google-cloud-security_center-v1/proto_docs/google/cloud/securitycenter/v1/kernel_rootkit.rb new file mode 100644 index 000000000000..9fc2809838c2 --- /dev/null +++ b/owl-bot-staging/google-cloud-security_center-v1/proto_docs/google/cloud/securitycenter/v1/kernel_rootkit.rb @@ -0,0 +1,66 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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 SecurityCenter + module V1 + # Kernel mode rootkit signatures. + # @!attribute [rw] name + # @return [::String] + # Rootkit name, when available. + # @!attribute [rw] unexpected_code_modification + # @return [::Boolean] + # True if unexpected modifications of kernel code memory are present. + # @!attribute [rw] unexpected_read_only_data_modification + # @return [::Boolean] + # True if unexpected modifications of kernel read-only data memory are + # present. + # @!attribute [rw] unexpected_ftrace_handler + # @return [::Boolean] + # True if `ftrace` points are present with callbacks pointing to regions + # that are not in the expected kernel or module code range. + # @!attribute [rw] unexpected_kprobe_handler + # @return [::Boolean] + # True if `kprobe` points are present with callbacks pointing to regions + # that are not in the expected kernel or module code range. + # @!attribute [rw] unexpected_kernel_code_pages + # @return [::Boolean] + # True if kernel code pages that are not in the expected kernel or module + # code regions are present. + # @!attribute [rw] unexpected_system_call_handler + # @return [::Boolean] + # True if system call handlers that are are not in the expected kernel or + # module code regions are present. + # @!attribute [rw] unexpected_interrupt_handler + # @return [::Boolean] + # True if interrupt handlers that are are not in the expected kernel or + # module code regions are present. + # @!attribute [rw] unexpected_processes_in_runqueue + # @return [::Boolean] + # True if unexpected processes in the scheduler run queue are present. Such + # processes are in the run queue, but not in the process task list. + class KernelRootkit + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-security_center-v1/proto_docs/google/cloud/securitycenter/v1/kubernetes.rb b/owl-bot-staging/google-cloud-security_center-v1/proto_docs/google/cloud/securitycenter/v1/kubernetes.rb new file mode 100644 index 000000000000..6286084901a9 --- /dev/null +++ b/owl-bot-staging/google-cloud-security_center-v1/proto_docs/google/cloud/securitycenter/v1/kubernetes.rb @@ -0,0 +1,241 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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 SecurityCenter + module V1 + # Kubernetes-related attributes. + # @!attribute [rw] pods + # @return [::Array<::Google::Cloud::SecurityCenter::V1::Kubernetes::Pod>] + # Kubernetes + # [Pods](https://cloud.google.com/kubernetes-engine/docs/concepts/pod) + # associated with the finding. This field contains Pod records for each + # container that is owned by a Pod. + # @!attribute [rw] nodes + # @return [::Array<::Google::Cloud::SecurityCenter::V1::Kubernetes::Node>] + # Provides Kubernetes + # [node](https://cloud.google.com/kubernetes-engine/docs/concepts/cluster-architecture#nodes) + # information. + # @!attribute [rw] node_pools + # @return [::Array<::Google::Cloud::SecurityCenter::V1::Kubernetes::NodePool>] + # GKE [node + # pools](https://cloud.google.com/kubernetes-engine/docs/concepts/node-pools) + # associated with the finding. This field contains node pool information for + # each node, when it is available. + # @!attribute [rw] roles + # @return [::Array<::Google::Cloud::SecurityCenter::V1::Kubernetes::Role>] + # Provides Kubernetes role information for findings that involve [Roles or + # ClusterRoles](https://cloud.google.com/kubernetes-engine/docs/how-to/role-based-access-control). + # @!attribute [rw] bindings + # @return [::Array<::Google::Cloud::SecurityCenter::V1::Kubernetes::Binding>] + # Provides Kubernetes role binding information for findings that involve + # [RoleBindings or + # ClusterRoleBindings](https://cloud.google.com/kubernetes-engine/docs/how-to/role-based-access-control). + # @!attribute [rw] access_reviews + # @return [::Array<::Google::Cloud::SecurityCenter::V1::Kubernetes::AccessReview>] + # Provides information on any Kubernetes access reviews (privilege checks) + # relevant to the finding. + # @!attribute [rw] objects + # @return [::Array<::Google::Cloud::SecurityCenter::V1::Kubernetes::Object>] + # Kubernetes objects related to the finding. + class Kubernetes + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # A Kubernetes Pod. + # @!attribute [rw] ns + # @return [::String] + # Kubernetes Pod namespace. + # @!attribute [rw] name + # @return [::String] + # Kubernetes Pod name. + # @!attribute [rw] labels + # @return [::Array<::Google::Cloud::SecurityCenter::V1::Label>] + # Pod labels. For Kubernetes containers, these are applied to the + # container. + # @!attribute [rw] containers + # @return [::Array<::Google::Cloud::SecurityCenter::V1::Container>] + # Pod containers associated with this finding, if any. + class Pod + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Kubernetes nodes associated with the finding. + # @!attribute [rw] name + # @return [::String] + # [Full resource name](https://google.aip.dev/122#full-resource-names) of + # the Compute Engine VM running the cluster node. + class Node + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Provides GKE node pool information. + # @!attribute [rw] name + # @return [::String] + # Kubernetes node pool name. + # @!attribute [rw] nodes + # @return [::Array<::Google::Cloud::SecurityCenter::V1::Kubernetes::Node>] + # Nodes associated with the finding. + class NodePool + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Kubernetes Role or ClusterRole. + # @!attribute [rw] kind + # @return [::Google::Cloud::SecurityCenter::V1::Kubernetes::Role::Kind] + # Role type. + # @!attribute [rw] ns + # @return [::String] + # Role namespace. + # @!attribute [rw] name + # @return [::String] + # Role name. + class Role + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # Types of Kubernetes roles. + module Kind + # Role type is not specified. + KIND_UNSPECIFIED = 0 + + # Kubernetes Role. + ROLE = 1 + + # Kubernetes ClusterRole. + CLUSTER_ROLE = 2 + end + end + + # Represents a Kubernetes RoleBinding or ClusterRoleBinding. + # @!attribute [rw] ns + # @return [::String] + # Namespace for the binding. + # @!attribute [rw] name + # @return [::String] + # Name for the binding. + # @!attribute [rw] role + # @return [::Google::Cloud::SecurityCenter::V1::Kubernetes::Role] + # The Role or ClusterRole referenced by the binding. + # @!attribute [rw] subjects + # @return [::Array<::Google::Cloud::SecurityCenter::V1::Kubernetes::Subject>] + # Represents one or more subjects that are bound to the role. Not always + # available for PATCH requests. + class Binding + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Represents a Kubernetes subject. + # @!attribute [rw] kind + # @return [::Google::Cloud::SecurityCenter::V1::Kubernetes::Subject::AuthType] + # Authentication type for the subject. + # @!attribute [rw] ns + # @return [::String] + # Namespace for the subject. + # @!attribute [rw] name + # @return [::String] + # Name for the subject. + class Subject + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # Auth types that can be used for the subject's kind field. + module AuthType + # Authentication is not specified. + AUTH_TYPE_UNSPECIFIED = 0 + + # User with valid certificate. + USER = 1 + + # Users managed by Kubernetes API with credentials stored as secrets. + SERVICEACCOUNT = 2 + + # Collection of users. + GROUP = 3 + end + end + + # Conveys information about a Kubernetes access review (such as one returned + # by a [`kubectl auth + # can-i`](https://kubernetes.io/docs/reference/access-authn-authz/authorization/#checking-api-access) + # command) that was involved in a finding. + # @!attribute [rw] group + # @return [::String] + # The API group of the resource. "*" means all. + # @!attribute [rw] ns + # @return [::String] + # Namespace of the action being requested. Currently, there is no + # distinction between no namespace and all namespaces. Both + # are represented by "" (empty). + # @!attribute [rw] name + # @return [::String] + # The name of the resource being requested. Empty means all. + # @!attribute [rw] resource + # @return [::String] + # The optional resource type requested. "*" means all. + # @!attribute [rw] subresource + # @return [::String] + # The optional subresource type. + # @!attribute [rw] verb + # @return [::String] + # A Kubernetes resource API verb, like get, list, watch, create, update, + # delete, proxy. "*" means all. + # @!attribute [rw] version + # @return [::String] + # The API version of the resource. "*" means all. + class AccessReview + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Kubernetes object related to the finding, uniquely identified by GKNN. + # Used if the object Kind is not one of Pod, Node, NodePool, Binding, or + # AccessReview. + # @!attribute [rw] group + # @return [::String] + # Kubernetes object group, such as "policy.k8s.io/v1". + # @!attribute [rw] kind + # @return [::String] + # Kubernetes object kind, such as "Namespace". + # @!attribute [rw] ns + # @return [::String] + # Kubernetes object namespace. Must be a valid DNS label. Named + # "ns" to avoid collision with C++ namespace keyword. For details see + # https://kubernetes.io/docs/tasks/administer-cluster/namespaces/. + # @!attribute [rw] name + # @return [::String] + # Kubernetes object name. For details see + # https://kubernetes.io/docs/concepts/overview/working-with-objects/names/. + # @!attribute [rw] containers + # @return [::Array<::Google::Cloud::SecurityCenter::V1::Container>] + # Pod containers associated with this finding, if any. + class Object + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-security_center-v1/proto_docs/google/cloud/securitycenter/v1/label.rb b/owl-bot-staging/google-cloud-security_center-v1/proto_docs/google/cloud/securitycenter/v1/label.rb new file mode 100644 index 000000000000..d3887e4fc185 --- /dev/null +++ b/owl-bot-staging/google-cloud-security_center-v1/proto_docs/google/cloud/securitycenter/v1/label.rb @@ -0,0 +1,41 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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 SecurityCenter + module V1 + # Represents a generic name-value label. A label has separate name and value + # fields to support filtering with the `contains()` function. For more + # information, see [Filtering on array-type + # fields](https://cloud.google.com/security-command-center/docs/how-to-api-list-findings#array-contains-filtering). + # @!attribute [rw] name + # @return [::String] + # Name of the label. + # @!attribute [rw] value + # @return [::String] + # Value that corresponds to the label's name. + class Label + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-security_center-v1/proto_docs/google/cloud/securitycenter/v1/load_balancer.rb b/owl-bot-staging/google-cloud-security_center-v1/proto_docs/google/cloud/securitycenter/v1/load_balancer.rb new file mode 100644 index 000000000000..be5ec1bb5606 --- /dev/null +++ b/owl-bot-staging/google-cloud-security_center-v1/proto_docs/google/cloud/securitycenter/v1/load_balancer.rb @@ -0,0 +1,36 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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 SecurityCenter + module V1 + # Contains information related to the load balancer associated with the + # finding. + # @!attribute [rw] name + # @return [::String] + # The name of the load balancer associated with the finding. + class LoadBalancer + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-security_center-v1/proto_docs/google/cloud/securitycenter/v1/log_entry.rb b/owl-bot-staging/google-cloud-security_center-v1/proto_docs/google/cloud/securitycenter/v1/log_entry.rb new file mode 100644 index 000000000000..6f028cba55b8 --- /dev/null +++ b/owl-bot-staging/google-cloud-security_center-v1/proto_docs/google/cloud/securitycenter/v1/log_entry.rb @@ -0,0 +1,58 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + + +module Google + module Cloud + module SecurityCenter + module V1 + # An individual entry in a log. + # @!attribute [rw] cloud_logging_entry + # @return [::Google::Cloud::SecurityCenter::V1::CloudLoggingEntry] + # An individual entry in a log stored in Cloud Logging. + class LogEntry + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Metadata taken from a [Cloud Logging + # LogEntry](https://cloud.google.com/logging/docs/reference/v2/rest/v2/LogEntry) + # @!attribute [rw] insert_id + # @return [::String] + # A unique identifier for the log entry. + # @!attribute [rw] log_id + # @return [::String] + # The type of the log (part of `log_name`. `log_name` is the resource name of + # the log to which this log entry belongs). For example: + # `cloudresourcemanager.googleapis.com/activity`. Note that this field is not + # URL-encoded, unlike the `LOG_ID` field in `LogEntry`. + # @!attribute [rw] resource_container + # @return [::String] + # The organization, folder, or project of the monitored resource that + # produced this log entry. + # @!attribute [rw] timestamp + # @return [::Google::Protobuf::Timestamp] + # The time the event described by the log entry occurred. + class CloudLoggingEntry + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-security_center-v1/proto_docs/google/cloud/securitycenter/v1/mitre_attack.rb b/owl-bot-staging/google-cloud-security_center-v1/proto_docs/google/cloud/securitycenter/v1/mitre_attack.rb new file mode 100644 index 000000000000..6e17500226e7 --- /dev/null +++ b/owl-bot-staging/google-cloud-security_center-v1/proto_docs/google/cloud/securitycenter/v1/mitre_attack.rb @@ -0,0 +1,303 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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 SecurityCenter + module V1 + # MITRE ATT&CK tactics and techniques related to this finding. + # See: https://attack.mitre.org + # @!attribute [rw] primary_tactic + # @return [::Google::Cloud::SecurityCenter::V1::MitreAttack::Tactic] + # The MITRE ATT&CK tactic most closely represented by this finding, if any. + # @!attribute [rw] primary_techniques + # @return [::Array<::Google::Cloud::SecurityCenter::V1::MitreAttack::Technique>] + # The MITRE ATT&CK technique most closely represented by this finding, if + # any. primary_techniques is a repeated field because there are multiple + # levels of MITRE ATT&CK techniques. If the technique most closely + # represented by this finding is a sub-technique (e.g. `SCANNING_IP_BLOCKS`), + # both the sub-technique and its parent technique(s) will be listed (e.g. + # `SCANNING_IP_BLOCKS`, `ACTIVE_SCANNING`). + # @!attribute [rw] additional_tactics + # @return [::Array<::Google::Cloud::SecurityCenter::V1::MitreAttack::Tactic>] + # Additional MITRE ATT&CK tactics related to this finding, if any. + # @!attribute [rw] additional_techniques + # @return [::Array<::Google::Cloud::SecurityCenter::V1::MitreAttack::Technique>] + # Additional MITRE ATT&CK techniques related to this finding, if any, along + # with any of their respective parent techniques. + # @!attribute [rw] version + # @return [::String] + # The MITRE ATT&CK version referenced by the above fields. E.g. "8". + class MitreAttack + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # MITRE ATT&CK tactics that can be referenced by SCC findings. + # See: https://attack.mitre.org/tactics/enterprise/ + module Tactic + # Unspecified value. + TACTIC_UNSPECIFIED = 0 + + # TA0043 + RECONNAISSANCE = 1 + + # TA0042 + RESOURCE_DEVELOPMENT = 2 + + # TA0001 + INITIAL_ACCESS = 5 + + # TA0002 + EXECUTION = 3 + + # TA0003 + PERSISTENCE = 6 + + # TA0004 + PRIVILEGE_ESCALATION = 8 + + # TA0005 + DEFENSE_EVASION = 7 + + # TA0006 + CREDENTIAL_ACCESS = 9 + + # TA0007 + DISCOVERY = 10 + + # TA0008 + LATERAL_MOVEMENT = 11 + + # TA0009 + COLLECTION = 12 + + # TA0011 + COMMAND_AND_CONTROL = 4 + + # TA0010 + EXFILTRATION = 13 + + # TA0040 + IMPACT = 14 + end + + # MITRE ATT&CK techniques that can be referenced by SCC findings. + # See: https://attack.mitre.org/techniques/enterprise/ + # Next ID: 65 + module Technique + # Unspecified value. + TECHNIQUE_UNSPECIFIED = 0 + + # T1036 + MASQUERADING = 49 + + # T1036.005 + MATCH_LEGITIMATE_NAME_OR_LOCATION = 50 + + # T1037 + BOOT_OR_LOGON_INITIALIZATION_SCRIPTS = 37 + + # T1037.005 + STARTUP_ITEMS = 38 + + # T1046 + NETWORK_SERVICE_DISCOVERY = 32 + + # T1057 + PROCESS_DISCOVERY = 56 + + # T1059 + COMMAND_AND_SCRIPTING_INTERPRETER = 6 + + # T1059.004 + UNIX_SHELL = 7 + + # T1059.006 + PYTHON = 59 + + # T1068 + EXPLOITATION_FOR_PRIVILEGE_ESCALATION = 63 + + # T1069 + PERMISSION_GROUPS_DISCOVERY = 18 + + # T1069.003 + CLOUD_GROUPS = 19 + + # T1070.004 + INDICATOR_REMOVAL_FILE_DELETION = 64 + + # T1071 + APPLICATION_LAYER_PROTOCOL = 45 + + # T1071.004 + DNS = 46 + + # T1072 + SOFTWARE_DEPLOYMENT_TOOLS = 47 + + # T1078 + VALID_ACCOUNTS = 14 + + # T1078.001 + DEFAULT_ACCOUNTS = 35 + + # T1078.003 + LOCAL_ACCOUNTS = 15 + + # T1078.004 + CLOUD_ACCOUNTS = 16 + + # T1090 + PROXY = 9 + + # T1090.002 + EXTERNAL_PROXY = 10 + + # T1090.003 + MULTI_HOP_PROXY = 11 + + # T1098 + ACCOUNT_MANIPULATION = 22 + + # T1098.001 + ADDITIONAL_CLOUD_CREDENTIALS = 40 + + # T1098.004 + SSH_AUTHORIZED_KEYS = 23 + + # T1098.006 + ADDITIONAL_CONTAINER_CLUSTER_ROLES = 58 + + # T1105 + INGRESS_TOOL_TRANSFER = 3 + + # T1106 + NATIVE_API = 4 + + # T1110 + BRUTE_FORCE = 44 + + # T1129 + SHARED_MODULES = 5 + + # T1134 + ACCESS_TOKEN_MANIPULATION = 33 + + # T1134.001 + TOKEN_IMPERSONATION_OR_THEFT = 39 + + # T1190 + EXPLOIT_PUBLIC_FACING_APPLICATION = 27 + + # T1484 + DOMAIN_POLICY_MODIFICATION = 30 + + # T1485 + DATA_DESTRUCTION = 29 + + # T1489 + SERVICE_STOP = 52 + + # T1490 + INHIBIT_SYSTEM_RECOVERY = 36 + + # T1496 + RESOURCE_HIJACKING = 8 + + # T1498 + NETWORK_DENIAL_OF_SERVICE = 17 + + # T1526 + CLOUD_SERVICE_DISCOVERY = 48 + + # T1528 + STEAL_APPLICATION_ACCESS_TOKEN = 42 + + # T1531 + ACCOUNT_ACCESS_REMOVAL = 51 + + # T1539 + STEAL_WEB_SESSION_COOKIE = 25 + + # T1543 + CREATE_OR_MODIFY_SYSTEM_PROCESS = 24 + + # T1548 + ABUSE_ELEVATION_CONTROL_MECHANISM = 34 + + # T1552 + UNSECURED_CREDENTIALS = 13 + + # T1556 + MODIFY_AUTHENTICATION_PROCESS = 28 + + # T1562 + IMPAIR_DEFENSES = 31 + + # T1562.001 + DISABLE_OR_MODIFY_TOOLS = 55 + + # T1567 + EXFILTRATION_OVER_WEB_SERVICE = 20 + + # T1567.002 + EXFILTRATION_TO_CLOUD_STORAGE = 21 + + # T1568 + DYNAMIC_RESOLUTION = 12 + + # T1570 + LATERAL_TOOL_TRANSFER = 41 + + # T1578 + MODIFY_CLOUD_COMPUTE_INFRASTRUCTURE = 26 + + # T1578.001 + CREATE_SNAPSHOT = 54 + + # T1580 + CLOUD_INFRASTRUCTURE_DISCOVERY = 53 + + # T1588 + OBTAIN_CAPABILITIES = 43 + + # T1595 + ACTIVE_SCANNING = 1 + + # T1595.001 + SCANNING_IP_BLOCKS = 2 + + # T1609 + CONTAINER_ADMINISTRATION_COMMAND = 60 + + # T1611 + ESCAPE_TO_HOST = 61 + + # T1613 + CONTAINER_AND_RESOURCE_DISCOVERY = 57 + + # T1649 + STEAL_OR_FORGE_AUTHENTICATION_CERTIFICATES = 62 + end + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-security_center-v1/proto_docs/google/cloud/securitycenter/v1/mute_config.rb b/owl-bot-staging/google-cloud-security_center-v1/proto_docs/google/cloud/securitycenter/v1/mute_config.rb new file mode 100644 index 000000000000..ef639857ed11 --- /dev/null +++ b/owl-bot-staging/google-cloud-security_center-v1/proto_docs/google/cloud/securitycenter/v1/mute_config.rb @@ -0,0 +1,116 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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 SecurityCenter + module V1 + # A mute config is a Cloud SCC resource that contains the configuration + # to mute create/update events of findings. + # @!attribute [rw] name + # @return [::String] + # This field will be ignored if provided on config creation. Format + # `organizations/{organization}/muteConfigs/{mute_config}` + # `folders/{folder}/muteConfigs/{mute_config}` + # `projects/{project}/muteConfigs/{mute_config}` + # `organizations/{organization}/locations/global/muteConfigs/{mute_config}` + # `folders/{folder}/locations/global/muteConfigs/{mute_config}` + # `projects/{project}/locations/global/muteConfigs/{mute_config}` + # @!attribute [rw] display_name + # @deprecated This field is deprecated and may be removed in the next major version update. + # @return [::String] + # The human readable name to be displayed for the mute config. + # @!attribute [rw] description + # @return [::String] + # A description of the mute config. + # @!attribute [rw] filter + # @return [::String] + # Required. An expression that defines the filter to apply across + # create/update events of findings. While creating a filter string, be + # mindful of the scope in which the mute configuration is being created. + # E.g., If a filter contains project = X but is created under the project = Y + # scope, it might not match any findings. + # + # The following field and operator combinations are supported: + # + # * severity: `=`, `:` + # * category: `=`, `:` + # * resource.name: `=`, `:` + # * resource.project_name: `=`, `:` + # * resource.project_display_name: `=`, `:` + # * resource.folders.resource_folder: `=`, `:` + # * resource.parent_name: `=`, `:` + # * resource.parent_display_name: `=`, `:` + # * resource.type: `=`, `:` + # * finding_class: `=`, `:` + # * indicator.ip_addresses: `=`, `:` + # * indicator.domains: `=`, `:` + # @!attribute [r] create_time + # @return [::Google::Protobuf::Timestamp] + # Output only. The time at which the mute config was created. + # This field is set by the server and will be ignored if provided on config + # creation. + # @!attribute [r] update_time + # @return [::Google::Protobuf::Timestamp] + # Output only. The most recent time at which the mute config was updated. + # This field is set by the server and will be ignored if provided on config + # creation or update. + # @!attribute [r] most_recent_editor + # @return [::String] + # Output only. Email address of the user who last edited the mute config. + # This field is set by the server and will be ignored if provided on config + # creation or update. + # @!attribute [rw] type + # @return [::Google::Cloud::SecurityCenter::V1::MuteConfig::MuteConfigType] + # Optional. The type of the mute config, which determines what type of mute + # state the config affects. The static mute state takes precedence over the + # dynamic mute state. Immutable after creation. STATIC by default if not set + # during creation. + # @!attribute [rw] expiry_time + # @return [::Google::Protobuf::Timestamp] + # Optional. The expiry of the mute config. Only applicable for dynamic + # configs. If the expiry is set, when the config expires, it is removed from + # all findings. + class MuteConfig + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # The type of MuteConfig. + module MuteConfigType + # Unused. + MUTE_CONFIG_TYPE_UNSPECIFIED = 0 + + # A static mute config, which sets the static mute state of future matching + # findings to muted. Once the static mute state has been set, finding or + # config modifications will not affect the state. + STATIC = 1 + + # A dynamic mute config, which is applied to existing and future matching + # findings, setting their dynamic mute state to "muted". If the config is + # updated or deleted, or a matching finding is updated, such that the + # finding doesn't match the config, the config will be removed from the + # finding, and the finding's dynamic mute state may become "unmuted" + # (unless other configs still match). + DYNAMIC = 2 + end + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-security_center-v1/proto_docs/google/cloud/securitycenter/v1/notebook.rb b/owl-bot-staging/google-cloud-security_center-v1/proto_docs/google/cloud/securitycenter/v1/notebook.rb new file mode 100644 index 000000000000..c1a520b911b6 --- /dev/null +++ b/owl-bot-staging/google-cloud-security_center-v1/proto_docs/google/cloud/securitycenter/v1/notebook.rb @@ -0,0 +1,46 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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 SecurityCenter + module V1 + # Represents a Jupyter notebook IPYNB file, such as a [Colab Enterprise + # notebook](https://cloud.google.com/colab/docs/introduction) file, that is + # associated with a finding. + # @!attribute [rw] name + # @return [::String] + # The name of the notebook. + # @!attribute [rw] service + # @return [::String] + # The source notebook service, for example, "Colab Enterprise". + # @!attribute [rw] last_author + # @return [::String] + # The user ID of the latest author to modify the notebook. + # @!attribute [rw] notebook_update_time + # @return [::Google::Protobuf::Timestamp] + # The most recent time the notebook was updated. + class Notebook + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-security_center-v1/proto_docs/google/cloud/securitycenter/v1/notification_config.rb b/owl-bot-staging/google-cloud-security_center-v1/proto_docs/google/cloud/securitycenter/v1/notification_config.rb new file mode 100644 index 000000000000..76042f526f38 --- /dev/null +++ b/owl-bot-staging/google-cloud-security_center-v1/proto_docs/google/cloud/securitycenter/v1/notification_config.rb @@ -0,0 +1,87 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + + +module Google + module Cloud + module SecurityCenter + module V1 + # Cloud Security Command Center (Cloud SCC) notification configs. + # + # A notification config is a Cloud SCC resource that contains the configuration + # to send notifications for create/update events of findings, assets and etc. + # @!attribute [rw] name + # @return [::String] + # The relative resource name of this notification config. See: + # https://cloud.google.com/apis/design/resource_names#relative_resource_name + # Example: + # "organizations/\\{organization_id}/notificationConfigs/notify_public_bucket", + # "folders/\\{folder_id}/notificationConfigs/notify_public_bucket", + # or "projects/\\{project_id}/notificationConfigs/notify_public_bucket". + # @!attribute [rw] description + # @return [::String] + # The description of the notification config (max of 1024 characters). + # @!attribute [rw] pubsub_topic + # @return [::String] + # The Pub/Sub topic to send notifications to. Its format is + # "projects/[project_id]/topics/[topic]". + # @!attribute [r] service_account + # @return [::String] + # Output only. The service account that needs "pubsub.topics.publish" + # permission to publish to the Pub/Sub topic. + # @!attribute [rw] streaming_config + # @return [::Google::Cloud::SecurityCenter::V1::NotificationConfig::StreamingConfig] + # The config for triggering streaming-based notifications. + class NotificationConfig + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # The config for streaming-based notifications, which send each event as soon + # as it is detected. + # @!attribute [rw] filter + # @return [::String] + # Expression that defines the filter to apply across create/update events + # of assets or findings as specified by the event type. The expression is a + # list of zero or more restrictions combined via logical operators `AND` + # and `OR`. Parentheses are supported, and `OR` has higher precedence than + # `AND`. + # + # Restrictions have the form ` ` and may have a + # `-` character in front of them to indicate negation. The fields map to + # those defined in the corresponding resource. + # + # The supported operators are: + # + # * `=` for all value types. + # * `>`, `<`, `>=`, `<=` for integer values. + # * `:`, meaning substring matching, for strings. + # + # The supported value types are: + # + # * string literals in quotes. + # * integer literals without quotes. + # * boolean literals `true` and `false` without quotes. + class StreamingConfig + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-security_center-v1/proto_docs/google/cloud/securitycenter/v1/notification_message.rb b/owl-bot-staging/google-cloud-security_center-v1/proto_docs/google/cloud/securitycenter/v1/notification_message.rb new file mode 100644 index 000000000000..117cc8daf4cc --- /dev/null +++ b/owl-bot-staging/google-cloud-security_center-v1/proto_docs/google/cloud/securitycenter/v1/notification_message.rb @@ -0,0 +1,42 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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 SecurityCenter + module V1 + # Cloud SCC's Notification + # @!attribute [rw] notification_config_name + # @return [::String] + # Name of the notification config that generated current notification. + # @!attribute [rw] finding + # @return [::Google::Cloud::SecurityCenter::V1::Finding] + # If it's a Finding based notification config, this field will be + # populated. + # @!attribute [rw] resource + # @return [::Google::Cloud::SecurityCenter::V1::Resource] + # The Cloud resource tied to this notification's Finding. + class NotificationMessage + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-security_center-v1/proto_docs/google/cloud/securitycenter/v1/org_policy.rb b/owl-bot-staging/google-cloud-security_center-v1/proto_docs/google/cloud/securitycenter/v1/org_policy.rb new file mode 100644 index 000000000000..dd2663301322 --- /dev/null +++ b/owl-bot-staging/google-cloud-security_center-v1/proto_docs/google/cloud/securitycenter/v1/org_policy.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! + + +module Google + module Cloud + module SecurityCenter + module V1 + # Contains information about the org policies associated with the finding. + # @!attribute [rw] name + # @return [::String] + # The resource name of the org policy. + # Example: + # "organizations/\\{organization_id}/policies/\\{constraint_name}" + class OrgPolicy + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-security_center-v1/proto_docs/google/cloud/securitycenter/v1/organization_settings.rb b/owl-bot-staging/google-cloud-security_center-v1/proto_docs/google/cloud/securitycenter/v1/organization_settings.rb new file mode 100644 index 000000000000..d75d60b378de --- /dev/null +++ b/owl-bot-staging/google-cloud-security_center-v1/proto_docs/google/cloud/securitycenter/v1/organization_settings.rb @@ -0,0 +1,86 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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 SecurityCenter + module V1 + # User specified settings that are attached to the Security Command + # Center organization. + # @!attribute [rw] name + # @return [::String] + # The relative resource name of the settings. See: + # https://cloud.google.com/apis/design/resource_names#relative_resource_name + # Example: + # "organizations/\\{organization_id}/organizationSettings". + # @!attribute [rw] enable_asset_discovery + # @return [::Boolean] + # A flag that indicates if Asset Discovery should be enabled. If the flag is + # set to `true`, then discovery of assets will occur. If it is set to + # `false`, all historical assets will remain, but discovery of future assets + # will not occur. + # @!attribute [rw] asset_discovery_config + # @return [::Google::Cloud::SecurityCenter::V1::OrganizationSettings::AssetDiscoveryConfig] + # The configuration used for Asset Discovery runs. + class OrganizationSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # The configuration used for Asset Discovery runs. + # @!attribute [rw] project_ids + # @return [::Array<::String>] + # The project ids to use for filtering asset discovery. + # @!attribute [rw] inclusion_mode + # @return [::Google::Cloud::SecurityCenter::V1::OrganizationSettings::AssetDiscoveryConfig::InclusionMode] + # The mode to use for filtering asset discovery. + # @!attribute [rw] folder_ids + # @return [::Array<::String>] + # The folder ids to use for filtering asset discovery. + # It consists of only digits, e.g., 756619654966. + class AssetDiscoveryConfig + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # The mode of inclusion when running Asset Discovery. + # Asset discovery can be limited by explicitly identifying projects to be + # included or excluded. If INCLUDE_ONLY is set, then only those projects + # within the organization and their children are discovered during asset + # discovery. If EXCLUDE is set, then projects that don't match those + # projects are discovered during asset discovery. If neither are set, then + # all projects within the organization are discovered during asset + # discovery. + module InclusionMode + # Unspecified. Setting the mode with this value will disable + # inclusion/exclusion filtering for Asset Discovery. + INCLUSION_MODE_UNSPECIFIED = 0 + + # Asset Discovery will capture only the resources within the projects + # specified. All other resources will be ignored. + INCLUDE_ONLY = 1 + + # Asset Discovery will ignore all resources under the projects specified. + # All other resources will be retrieved. + EXCLUDE = 2 + end + end + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-security_center-v1/proto_docs/google/cloud/securitycenter/v1/process.rb b/owl-bot-staging/google-cloud-security_center-v1/proto_docs/google/cloud/securitycenter/v1/process.rb new file mode 100644 index 000000000000..7c14c9d1baf2 --- /dev/null +++ b/owl-bot-staging/google-cloud-security_center-v1/proto_docs/google/cloud/securitycenter/v1/process.rb @@ -0,0 +1,79 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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 SecurityCenter + module V1 + # Represents an operating system process. + # @!attribute [rw] name + # @return [::String] + # The process name, as displayed in utilities like `top` and `ps`. This name + # can be accessed through `/proc/[pid]/comm` and changed with + # `prctl(PR_SET_NAME)`. + # @!attribute [rw] binary + # @return [::Google::Cloud::SecurityCenter::V1::File] + # File information for the process executable. + # @!attribute [rw] libraries + # @return [::Array<::Google::Cloud::SecurityCenter::V1::File>] + # File information for libraries loaded by the process. + # @!attribute [rw] script + # @return [::Google::Cloud::SecurityCenter::V1::File] + # When the process represents the invocation of a script, `binary` provides + # information about the interpreter, while `script` provides information + # about the script file provided to the interpreter. + # @!attribute [rw] args + # @return [::Array<::String>] + # Process arguments as JSON encoded strings. + # @!attribute [rw] arguments_truncated + # @return [::Boolean] + # True if `args` is incomplete. + # @!attribute [rw] env_variables + # @return [::Array<::Google::Cloud::SecurityCenter::V1::EnvironmentVariable>] + # Process environment variables. + # @!attribute [rw] env_variables_truncated + # @return [::Boolean] + # True if `env_variables` is incomplete. + # @!attribute [rw] pid + # @return [::Integer] + # The process ID. + # @!attribute [rw] parent_pid + # @return [::Integer] + # The parent process ID. + class Process + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # A name-value pair representing an environment variable used in an operating + # system process. + # @!attribute [rw] name + # @return [::String] + # Environment variable name as a JSON encoded string. + # @!attribute [rw] val + # @return [::String] + # Environment variable value as a JSON encoded string. + class EnvironmentVariable + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-security_center-v1/proto_docs/google/cloud/securitycenter/v1/resource.rb b/owl-bot-staging/google-cloud-security_center-v1/proto_docs/google/cloud/securitycenter/v1/resource.rb new file mode 100644 index 000000000000..5783203927c7 --- /dev/null +++ b/owl-bot-staging/google-cloud-security_center-v1/proto_docs/google/cloud/securitycenter/v1/resource.rb @@ -0,0 +1,286 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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 SecurityCenter + module V1 + # Information related to the Google Cloud resource. + # @!attribute [rw] name + # @return [::String] + # The full resource name of the resource. See: + # https://cloud.google.com/apis/design/resource_names#full_resource_name + # @!attribute [rw] display_name + # @return [::String] + # The human readable name of the resource. + # @!attribute [rw] type + # @return [::String] + # The full resource type of the resource. + # @!attribute [rw] project + # @return [::String] + # The full resource name of project that the resource belongs to. + # @!attribute [rw] project_display_name + # @return [::String] + # The project ID that the resource belongs to. + # @!attribute [rw] parent + # @return [::String] + # The full resource name of resource's parent. + # @!attribute [rw] parent_display_name + # @return [::String] + # The human readable name of resource's parent. + # @!attribute [r] folders + # @return [::Array<::Google::Cloud::SecurityCenter::V1::Folder>] + # Output only. Contains a Folder message for each folder in the assets + # ancestry. The first folder is the deepest nested folder, and the last + # folder is the folder directly under the Organization. + # @!attribute [rw] cloud_provider + # @return [::Google::Cloud::SecurityCenter::V1::CloudProvider] + # Indicates which cloud provider the resource resides in. + # @!attribute [rw] organization + # @return [::String] + # Indicates which organization or tenant in the cloud provider the finding + # applies to. + # @!attribute [rw] service + # @return [::String] + # The parent service or product from which the resource is provided, for + # example, GKE or SNS. + # @!attribute [rw] location + # @return [::String] + # The region or location of the service (if applicable). + # @!attribute [rw] aws_metadata + # @return [::Google::Cloud::SecurityCenter::V1::AwsMetadata] + # The AWS metadata associated with the finding. + # + # Note: The following fields are mutually exclusive: `aws_metadata`, `azure_metadata`. If a field in that set is populated, all other fields in the set will automatically be cleared. + # @!attribute [rw] azure_metadata + # @return [::Google::Cloud::SecurityCenter::V1::AzureMetadata] + # The Azure metadata associated with the finding. + # + # Note: The following fields are mutually exclusive: `azure_metadata`, `aws_metadata`. If a field in that set is populated, all other fields in the set will automatically be cleared. + # @!attribute [rw] resource_path + # @return [::Google::Cloud::SecurityCenter::V1::ResourcePath] + # Provides the path to the resource within the resource hierarchy. + # @!attribute [rw] resource_path_string + # @return [::String] + # A string representation of the resource path. + # For Google Cloud, it has the format of + # `organizations/{organization_id}/folders/{folder_id}/folders/{folder_id}/projects/{project_id}` + # where there can be any number of folders. + # For AWS, it has the format of + # `org/{organization_id}/ou/{organizational_unit_id}/ou/{organizational_unit_id}/account/{account_id}` + # where there can be any number of organizational units. + # For Azure, it has the format of + # `mg/{management_group_id}/mg/{management_group_id}/subscription/{subscription_id}/rg/{resource_group_name}` + # where there can be any number of management groups. + class Resource + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # AWS metadata associated with the resource, only applicable if the finding's + # cloud provider is Amazon Web Services. + # @!attribute [rw] organization + # @return [::Google::Cloud::SecurityCenter::V1::AwsMetadata::AwsOrganization] + # The AWS organization associated with the resource. + # @!attribute [rw] organizational_units + # @return [::Array<::Google::Cloud::SecurityCenter::V1::AwsMetadata::AwsOrganizationalUnit>] + # A list of AWS organizational units associated with the resource, ordered + # from lowest level (closest to the account) to highest level. + # @!attribute [rw] account + # @return [::Google::Cloud::SecurityCenter::V1::AwsMetadata::AwsAccount] + # The AWS account associated with the resource. + class AwsMetadata + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # An organization is a collection of accounts that are centrally managed + # together using consolidated billing, organized hierarchically with + # organizational units (OUs), and controlled with policies. + # @!attribute [rw] id + # @return [::String] + # The unique identifier (ID) for the organization. The regex pattern for an + # organization ID string requires "o-" followed by from 10 to 32 lowercase + # letters or digits. + class AwsOrganization + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # An Organizational Unit (OU) is a container of AWS accounts within a root of + # an organization. Policies that are attached to an OU apply to all accounts + # contained in that OU and in any child OUs. + # @!attribute [rw] id + # @return [::String] + # The unique identifier (ID) associated with this OU. The regex pattern for + # an organizational unit ID string requires "ou-" followed by from 4 to 32 + # lowercase letters or digits (the ID of the root that contains the OU). + # This string is followed by a second "-" dash and from 8 to 32 additional + # lowercase letters or digits. For example, "ou-ab12-cd34ef56". + # @!attribute [rw] name + # @return [::String] + # The friendly name of the OU. + class AwsOrganizationalUnit + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # An AWS account that is a member of an organization. + # @!attribute [rw] id + # @return [::String] + # The unique identifier (ID) of the account, containing exactly 12 digits. + # @!attribute [rw] name + # @return [::String] + # The friendly name of this account. + class AwsAccount + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end + + # Azure metadata associated with the resource, only applicable if the finding's + # cloud provider is Microsoft Azure. + # @!attribute [rw] management_groups + # @return [::Array<::Google::Cloud::SecurityCenter::V1::AzureMetadata::AzureManagementGroup>] + # A list of Azure management groups associated with the resource, ordered + # from lowest level (closest to the subscription) to highest level. + # @!attribute [rw] subscription + # @return [::Google::Cloud::SecurityCenter::V1::AzureMetadata::AzureSubscription] + # The Azure subscription associated with the resource. + # @!attribute [rw] resource_group + # @return [::Google::Cloud::SecurityCenter::V1::AzureMetadata::AzureResourceGroup] + # The Azure resource group associated with the resource. + class AzureMetadata + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # Represents an Azure management group. + # @!attribute [rw] id + # @return [::String] + # The UUID of the Azure management group, for example, + # `20000000-0001-0000-0000-000000000000`. + # @!attribute [rw] display_name + # @return [::String] + # The display name of the Azure management group. + class AzureManagementGroup + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Represents an Azure subscription. + # @!attribute [rw] id + # @return [::String] + # The UUID of the Azure subscription, for example, + # `291bba3f-e0a5-47bc-a099-3bdcb2a50a05`. + # @!attribute [rw] display_name + # @return [::String] + # The display name of the Azure subscription. + class AzureSubscription + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Represents an Azure resource group. + # @!attribute [rw] name + # @return [::String] + # The name of the Azure resource group. This is not a UUID. + class AzureResourceGroup + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end + + # Represents the path of resources leading up to the resource this finding is + # about. + # @!attribute [rw] nodes + # @return [::Array<::Google::Cloud::SecurityCenter::V1::ResourcePath::ResourcePathNode>] + # The list of nodes that make the up resource path, ordered from lowest + # level to highest level. + class ResourcePath + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # A node within the resource path. Each node represents a resource within the + # resource hierarchy. + # @!attribute [rw] node_type + # @return [::Google::Cloud::SecurityCenter::V1::ResourcePath::ResourcePathNodeType] + # The type of resource this node represents. + # @!attribute [rw] id + # @return [::String] + # The ID of the resource this node represents. + # @!attribute [rw] display_name + # @return [::String] + # The display name of the resource this node represents. + class ResourcePathNode + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # The type of resource the node represents. + module ResourcePathNodeType + # Node type is unspecified. + RESOURCE_PATH_NODE_TYPE_UNSPECIFIED = 0 + + # The node represents a Google Cloud organization. + GCP_ORGANIZATION = 1 + + # The node represents a Google Cloud folder. + GCP_FOLDER = 2 + + # The node represents a Google Cloud project. + GCP_PROJECT = 3 + + # The node represents an AWS organization. + AWS_ORGANIZATION = 4 + + # The node represents an AWS organizational unit. + AWS_ORGANIZATIONAL_UNIT = 5 + + # The node represents an AWS account. + AWS_ACCOUNT = 6 + + # The node represents an Azure management group. + AZURE_MANAGEMENT_GROUP = 7 + + # The node represents an Azure subscription. + AZURE_SUBSCRIPTION = 8 + + # The node represents an Azure resource group. + AZURE_RESOURCE_GROUP = 9 + end + end + + # Enumeration representing the various cloud providers a finding's resource + # could reside in. + module CloudProvider + # The cloud provider is unspecified. + CLOUD_PROVIDER_UNSPECIFIED = 0 + + # The cloud provider is Google Cloud Platform. + GOOGLE_CLOUD_PLATFORM = 1 + + # The cloud provider is Amazon Web Services. + AMAZON_WEB_SERVICES = 2 + + # The cloud provider is Microsoft Azure. + MICROSOFT_AZURE = 3 + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-security_center-v1/proto_docs/google/cloud/securitycenter/v1/resource_value_config.rb b/owl-bot-staging/google-cloud-security_center-v1/proto_docs/google/cloud/securitycenter/v1/resource_value_config.rb new file mode 100644 index 000000000000..f231fe97ed46 --- /dev/null +++ b/owl-bot-staging/google-cloud-security_center-v1/proto_docs/google/cloud/securitycenter/v1/resource_value_config.rb @@ -0,0 +1,125 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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 SecurityCenter + module V1 + # A resource value configuration (RVC) is a mapping configuration of user's + # resources to resource values. Used in Attack path simulations. + # @!attribute [rw] name + # @return [::String] + # Name for the resource value configuration + # @!attribute [rw] resource_value + # @return [::Google::Cloud::SecurityCenter::V1::ResourceValue] + # Required. Resource value level this expression represents + # @!attribute [rw] tag_values + # @return [::Array<::String>] + # Required. Tag values combined with `AND` to check against. + # Values in the form "tagValues/123" + # Example: `[ "tagValues/123", "tagValues/456", "tagValues/789" ]` + # https://cloud.google.com/resource-manager/docs/tags/tags-creating-and-managing + # @!attribute [rw] resource_type + # @return [::String] + # Apply resource_value only to resources that match resource_type. + # resource_type will be checked with `AND` of other resources. + # For example, "storage.googleapis.com/Bucket" with resource_value "HIGH" + # will apply "HIGH" value only to "storage.googleapis.com/Bucket" resources. + # @!attribute [rw] scope + # @return [::String] + # Project or folder to scope this configuration to. + # For example, "project/456" would apply this configuration only to resources + # in "project/456" scope will be checked with `AND` of other + # resources. + # @!attribute [rw] resource_labels_selector + # @return [::Google::Protobuf::Map{::String => ::String}] + # List of resource labels to search for, evaluated with `AND`. + # For example, `"resource_labels_selector": {"key": "value", "env": "prod"}` + # will match resources with labels "key": "value" `AND` "env": + # "prod" + # https://cloud.google.com/resource-manager/docs/creating-managing-labels + # @!attribute [rw] description + # @return [::String] + # Description of the resource value configuration. + # @!attribute [r] create_time + # @return [::Google::Protobuf::Timestamp] + # Output only. Timestamp this resource value configuration was created. + # @!attribute [r] update_time + # @return [::Google::Protobuf::Timestamp] + # Output only. Timestamp this resource value configuration was last updated. + # @!attribute [rw] cloud_provider + # @return [::Google::Cloud::SecurityCenter::V1::CloudProvider] + # Cloud provider this configuration applies to + # @!attribute [rw] sensitive_data_protection_mapping + # @return [::Google::Cloud::SecurityCenter::V1::ResourceValueConfig::SensitiveDataProtectionMapping] + # A mapping of the sensitivity on Sensitive Data Protection finding to + # resource values. This mapping can only be used in combination with a + # resource_type that is related to BigQuery, e.g. + # "bigquery.googleapis.com/Dataset". + class ResourceValueConfig + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # Resource value mapping for Sensitive Data Protection findings. + # If any of these mappings have a resource value that is not unspecified, + # the resource_value field will be ignored when reading this configuration. + # @!attribute [rw] high_sensitivity_mapping + # @return [::Google::Cloud::SecurityCenter::V1::ResourceValue] + # Resource value mapping for high-sensitivity Sensitive Data Protection + # findings + # @!attribute [rw] medium_sensitivity_mapping + # @return [::Google::Cloud::SecurityCenter::V1::ResourceValue] + # Resource value mapping for medium-sensitivity Sensitive Data Protection + # findings + class SensitiveDataProtectionMapping + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # @!attribute [rw] key + # @return [::String] + # @!attribute [rw] value + # @return [::String] + class ResourceLabelsSelectorEntry + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end + + # Value enum to map to a resource + module ResourceValue + # Unspecific value + RESOURCE_VALUE_UNSPECIFIED = 0 + + # High resource value + HIGH = 1 + + # Medium resource value + MEDIUM = 2 + + # Low resource value + LOW = 3 + + # No resource value, e.g. ignore these resources + NONE = 4 + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-security_center-v1/proto_docs/google/cloud/securitycenter/v1/run_asset_discovery_response.rb b/owl-bot-staging/google-cloud-security_center-v1/proto_docs/google/cloud/securitycenter/v1/run_asset_discovery_response.rb new file mode 100644 index 000000000000..c00c755d2726 --- /dev/null +++ b/owl-bot-staging/google-cloud-security_center-v1/proto_docs/google/cloud/securitycenter/v1/run_asset_discovery_response.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! + + +module Google + module Cloud + module SecurityCenter + module V1 + # Response of asset discovery run + # @!attribute [rw] state + # @return [::Google::Cloud::SecurityCenter::V1::RunAssetDiscoveryResponse::State] + # The state of an asset discovery run. + # @!attribute [rw] duration + # @return [::Google::Protobuf::Duration] + # The duration between asset discovery run start and end + class RunAssetDiscoveryResponse + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # The state of an asset discovery run. + module State + # Asset discovery run state was unspecified. + STATE_UNSPECIFIED = 0 + + # Asset discovery run completed successfully. + COMPLETED = 1 + + # Asset discovery run was cancelled with tasks still pending, as another + # run for the same organization was started with a higher priority. + SUPERSEDED = 2 + + # Asset discovery run was killed and terminated. + TERMINATED = 3 + end + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-security_center-v1/proto_docs/google/cloud/securitycenter/v1/security_health_analytics_custom_config.rb b/owl-bot-staging/google-cloud-security_center-v1/proto_docs/google/cloud/securitycenter/v1/security_health_analytics_custom_config.rb new file mode 100644 index 000000000000..042d8ac3a7b6 --- /dev/null +++ b/owl-bot-staging/google-cloud-security_center-v1/proto_docs/google/cloud/securitycenter/v1/security_health_analytics_custom_config.rb @@ -0,0 +1,112 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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 SecurityCenter + module V1 + # Defines the properties in a custom module configuration for Security + # Health Analytics. Use the custom module configuration to create custom + # detectors that generate custom findings for resources that you specify. + # @!attribute [rw] predicate + # @return [::Google::Type::Expr] + # The CEL expression to evaluate to produce findings. When the expression + # evaluates to true against a resource, a finding is generated. + # @!attribute [rw] custom_output + # @return [::Google::Cloud::SecurityCenter::V1::CustomConfig::CustomOutputSpec] + # Custom output properties. + # @!attribute [rw] resource_selector + # @return [::Google::Cloud::SecurityCenter::V1::CustomConfig::ResourceSelector] + # The resource types that the custom module operates on. Each custom module + # can specify up to 5 resource types. + # @!attribute [rw] severity + # @return [::Google::Cloud::SecurityCenter::V1::CustomConfig::Severity] + # The severity to assign to findings generated by the module. + # @!attribute [rw] description + # @return [::String] + # Text that describes the vulnerability or misconfiguration that the custom + # module detects. This explanation is returned with each finding instance to + # help investigators understand the detected issue. The text must be enclosed + # in quotation marks. + # @!attribute [rw] recommendation + # @return [::String] + # An explanation of the recommended steps that security teams can take to + # resolve the detected issue. This explanation is returned with each finding + # generated by this module in the `nextSteps` property of the finding JSON. + class CustomConfig + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # A set of optional name-value pairs that define custom source properties to + # return with each finding that is generated by the custom module. The custom + # source properties that are defined here are included in the finding JSON + # under `sourceProperties`. + # @!attribute [rw] properties + # @return [::Array<::Google::Cloud::SecurityCenter::V1::CustomConfig::CustomOutputSpec::Property>] + # A list of custom output properties to add to the finding. + class CustomOutputSpec + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # An individual name-value pair that defines a custom source property. + # @!attribute [rw] name + # @return [::String] + # Name of the property for the custom output. + # @!attribute [rw] value_expression + # @return [::Google::Type::Expr] + # The CEL expression for the custom output. A resource property can be + # specified to return the value of the property or a text string enclosed + # in quotation marks. + class Property + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end + + # Resource for selecting resource type. + # @!attribute [rw] resource_types + # @return [::Array<::String>] + # The resource types to run the detector on. + class ResourceSelector + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Defines the valid value options for the severity of a finding. + module Severity + # Unspecified severity. + SEVERITY_UNSPECIFIED = 0 + + # Critical severity. + CRITICAL = 1 + + # High severity. + HIGH = 2 + + # Medium severity. + MEDIUM = 3 + + # Low severity. + LOW = 4 + end + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-security_center-v1/proto_docs/google/cloud/securitycenter/v1/security_health_analytics_custom_module.rb b/owl-bot-staging/google-cloud-security_center-v1/proto_docs/google/cloud/securitycenter/v1/security_health_analytics_custom_module.rb new file mode 100644 index 000000000000..0b327125cfc6 --- /dev/null +++ b/owl-bot-staging/google-cloud-security_center-v1/proto_docs/google/cloud/securitycenter/v1/security_health_analytics_custom_module.rb @@ -0,0 +1,90 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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 SecurityCenter + module V1 + # Represents an instance of a Security Health Analytics custom module, + # including its full module name, display name, enablement state, and last + # updated time. You can create a custom module at the organization, folder, or + # project level. Custom modules that you create at the organization or folder + # level are inherited by the child folders and projects. + # @!attribute [rw] name + # @return [::String] + # Immutable. The resource name of the custom module. + # Its format is + # "organizations/\\{organization}/securityHealthAnalyticsSettings/customModules/\\{customModule}", + # or + # "folders/\\{folder}/securityHealthAnalyticsSettings/customModules/\\{customModule}", + # or + # "projects/\\{project}/securityHealthAnalyticsSettings/customModules/\\{customModule}" + # + # The id \\{customModule} is server-generated and is not user settable. + # It will be a numeric id containing 1-20 digits. + # @!attribute [rw] display_name + # @return [::String] + # The display name of the Security Health Analytics custom module. This + # display name becomes the finding category for all findings that are + # returned by this custom module. The display name must be between 1 and + # 128 characters, start with a lowercase letter, and contain alphanumeric + # characters or underscores only. + # @!attribute [rw] enablement_state + # @return [::Google::Cloud::SecurityCenter::V1::SecurityHealthAnalyticsCustomModule::EnablementState] + # The enablement state of the custom module. + # @!attribute [r] update_time + # @return [::Google::Protobuf::Timestamp] + # Output only. The time at which the custom module was last updated. + # @!attribute [r] last_editor + # @return [::String] + # Output only. The editor that last updated the custom module. + # @!attribute [r] ancestor_module + # @return [::String] + # Output only. If empty, indicates that the custom module was created in the + # organization, folder, or project in which you are viewing the custom + # module. Otherwise, `ancestor_module` specifies the organization or folder + # from which the custom module is inherited. + # @!attribute [rw] custom_config + # @return [::Google::Cloud::SecurityCenter::V1::CustomConfig] + # The user specified custom configuration for the module. + class SecurityHealthAnalyticsCustomModule + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # Possible enablement states of a custom module. + module EnablementState + # Unspecified enablement state. + ENABLEMENT_STATE_UNSPECIFIED = 0 + + # The module is enabled at the given CRM resource. + ENABLED = 1 + + # The module is disabled at the given CRM resource. + DISABLED = 2 + + # State is inherited from an ancestor module. The module will either + # be effectively ENABLED or DISABLED based on its closest non-inherited + # ancestor module in the CRM hierarchy. + INHERITED = 3 + end + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-security_center-v1/proto_docs/google/cloud/securitycenter/v1/security_marks.rb b/owl-bot-staging/google-cloud-security_center-v1/proto_docs/google/cloud/securitycenter/v1/security_marks.rb new file mode 100644 index 000000000000..0fd162583773 --- /dev/null +++ b/owl-bot-staging/google-cloud-security_center-v1/proto_docs/google/cloud/securitycenter/v1/security_marks.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 Cloud + module SecurityCenter + module V1 + # User specified security marks that are attached to the parent Security + # Command Center resource. Security marks are scoped within a Security Command + # Center organization -- they can be modified and viewed by all users who have + # proper permissions on the organization. + # @!attribute [rw] name + # @return [::String] + # The relative resource name of the SecurityMarks. See: + # https://cloud.google.com/apis/design/resource_names#relative_resource_name + # Examples: + # "organizations/\\{organization_id}/assets/\\{asset_id}/securityMarks" + # "organizations/\\{organization_id}/sources/\\{source_id}/findings/\\{finding_id}/securityMarks". + # @!attribute [rw] marks + # @return [::Google::Protobuf::Map{::String => ::String}] + # Mutable user specified security marks belonging to the parent resource. + # Constraints are as follows: + # + # * Keys and values are treated as case insensitive + # * Keys must be between 1 - 256 characters (inclusive) + # * Keys must be letters, numbers, underscores, or dashes + # * Values have leading and trailing whitespace trimmed, remaining + # characters must be between 1 - 4096 characters (inclusive) + # @!attribute [rw] canonical_name + # @return [::String] + # The canonical name of the marks. + # Examples: + # "organizations/\\{organization_id}/assets/\\{asset_id}/securityMarks" + # "folders/\\{folder_id}/assets/\\{asset_id}/securityMarks" + # "projects/\\{project_number}/assets/\\{asset_id}/securityMarks" + # "organizations/\\{organization_id}/sources/\\{source_id}/findings/\\{finding_id}/securityMarks" + # "folders/\\{folder_id}/sources/\\{source_id}/findings/\\{finding_id}/securityMarks" + # "projects/\\{project_number}/sources/\\{source_id}/findings/\\{finding_id}/securityMarks" + class SecurityMarks + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # @!attribute [rw] key + # @return [::String] + # @!attribute [rw] value + # @return [::String] + class MarksEntry + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-security_center-v1/proto_docs/google/cloud/securitycenter/v1/security_posture.rb b/owl-bot-staging/google-cloud-security_center-v1/proto_docs/google/cloud/securitycenter/v1/security_posture.rb new file mode 100644 index 000000000000..fb8f89c609e0 --- /dev/null +++ b/owl-bot-staging/google-cloud-security_center-v1/proto_docs/google/cloud/securitycenter/v1/security_posture.rb @@ -0,0 +1,83 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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 SecurityCenter + module V1 + # Represents a posture that is deployed on Google Cloud by the + # Security Command Center Posture Management service. + # A posture contains one or more policy sets. A policy set is a + # group of policies that enforce a set of security rules on Google + # Cloud. + # @!attribute [rw] name + # @return [::String] + # Name of the posture, for example, `CIS-Posture`. + # @!attribute [rw] revision_id + # @return [::String] + # The version of the posture, for example, `c7cfa2a8`. + # @!attribute [rw] posture_deployment_resource + # @return [::String] + # The project, folder, or organization on which the posture is deployed, + # for example, `projects/{project_number}`. + # @!attribute [rw] posture_deployment + # @return [::String] + # The name of the posture deployment, for example, + # `organizations/{org_id}/posturedeployments/{posture_deployment_id}`. + # @!attribute [rw] changed_policy + # @return [::String] + # The name of the updated policy, for example, + # `projects/{project_id}/policies/{constraint_name}`. + # @!attribute [rw] policy_set + # @return [::String] + # The name of the updated policyset, for example, `cis-policyset`. + # @!attribute [rw] policy + # @return [::String] + # The ID of the updated policy, for example, `compute-policy-1`. + # @!attribute [rw] policy_drift_details + # @return [::Array<::Google::Cloud::SecurityCenter::V1::SecurityPosture::PolicyDriftDetails>] + # The details about a change in an updated policy that violates the deployed + # posture. + class SecurityPosture + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # The policy field that violates the deployed posture and its expected and + # detected values. + # @!attribute [rw] field + # @return [::String] + # The name of the updated field, for example + # constraint.implementation.policy_rules[0].enforce + # @!attribute [rw] expected_value + # @return [::String] + # The value of this field that was configured in a posture, for example, + # `true` or `allowed_values={"projects/29831892"}`. + # @!attribute [rw] detected_value + # @return [::String] + # The detected value that violates the deployed posture, for example, + # `false` or `allowed_values={"projects/22831892"}`. + class PolicyDriftDetails + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-security_center-v1/proto_docs/google/cloud/securitycenter/v1/securitycenter_service.rb b/owl-bot-staging/google-cloud-security_center-v1/proto_docs/google/cloud/securitycenter/v1/securitycenter_service.rb new file mode 100644 index 000000000000..6b9045050b73 --- /dev/null +++ b/owl-bot-staging/google-cloud-security_center-v1/proto_docs/google/cloud/securitycenter/v1/securitycenter_service.rb @@ -0,0 +1,2146 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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 SecurityCenter + module V1 + # Request message for bulk findings update. + # + # Note: + # 1. If multiple bulk update requests match the same resource, the order in + # which they get executed is not defined. + # 2. Once a bulk operation is started, there is no way to stop it. + # @!attribute [rw] parent + # @return [::String] + # Required. The parent, at which bulk action needs to be applied. Its format + # is `organizations/[organization_id]`, `folders/[folder_id]`, + # `projects/[project_id]`. + # @!attribute [rw] filter + # @return [::String] + # Expression that identifies findings that should be updated. + # The expression is a list of zero or more restrictions combined + # via logical operators `AND` and `OR`. Parentheses are supported, and `OR` + # has higher precedence than `AND`. + # + # Restrictions have the form ` ` and may have a + # `-` character in front of them to indicate negation. The fields map to + # those defined in the corresponding resource. + # + # The supported operators are: + # + # * `=` for all value types. + # * `>`, `<`, `>=`, `<=` for integer values. + # * `:`, meaning substring matching, for strings. + # + # The supported value types are: + # + # * string literals in quotes. + # * integer literals without quotes. + # * boolean literals `true` and `false` without quotes. + # @!attribute [rw] mute_annotation + # @deprecated This field is deprecated and may be removed in the next major version update. + # @return [::String] + # This can be a mute configuration name or any identifier for mute/unmute + # of findings based on the filter. + # @!attribute [rw] mute_state + # @return [::Google::Cloud::SecurityCenter::V1::BulkMuteFindingsRequest::MuteState] + # Optional. All findings matching the given filter will have their mute state + # set to this value. The default value is `MUTED`. Setting this to + # `UNDEFINED` will clear the mute state on all matching findings. + class BulkMuteFindingsRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # The mute state. + module MuteState + # Unused. + MUTE_STATE_UNSPECIFIED = 0 + + # Matching findings will be muted (default). + MUTED = 1 + + # Matching findings will have their mute state cleared. + UNDEFINED = 2 + end + end + + # The response to a BulkMute request. Contains the LRO information. + class BulkMuteFindingsResponse + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Request message for creating a finding. + # @!attribute [rw] parent + # @return [::String] + # Required. Resource name of the new finding's parent. Its format should be + # `organizations/[organization_id]/sources/[source_id]`. + # @!attribute [rw] finding_id + # @return [::String] + # Required. Unique identifier provided by the client within the parent scope. + # It must be alphanumeric and less than or equal to 32 characters and + # greater than 0 characters in length. + # @!attribute [rw] finding + # @return [::Google::Cloud::SecurityCenter::V1::Finding] + # Required. The Finding being created. The name and security_marks will be + # ignored as they are both output only fields on this resource. + class CreateFindingRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Request message for creating a mute config. + # @!attribute [rw] parent + # @return [::String] + # Required. Resource name of the new mute configs's parent. Its format is + # `organizations/[organization_id]`, `folders/[folder_id]`, or + # `projects/[project_id]`. + # @!attribute [rw] mute_config + # @return [::Google::Cloud::SecurityCenter::V1::MuteConfig] + # Required. The mute config being created. + # @!attribute [rw] mute_config_id + # @return [::String] + # Required. Unique identifier provided by the client within the parent scope. + # It must consist of only lowercase letters, numbers, and hyphens, must start + # with a letter, must end with either a letter or a number, and must be 63 + # characters or less. + class CreateMuteConfigRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Request message to create single resource value config + # @!attribute [rw] parent + # @return [::String] + # Required. Resource name of the new ResourceValueConfig's parent. + # @!attribute [rw] resource_value_config + # @return [::Google::Cloud::SecurityCenter::V1::ResourceValueConfig] + # Required. The resource value config being created. + class CreateResourceValueConfigRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Request message to create multiple resource value configs + # @!attribute [rw] parent + # @return [::String] + # Required. Resource name of the new ResourceValueConfig's parent. + # The parent field in the CreateResourceValueConfigRequest + # messages must either be empty or match this field. + # @!attribute [rw] requests + # @return [::Array<::Google::Cloud::SecurityCenter::V1::CreateResourceValueConfigRequest>] + # Required. The resource value configs to be created. + class BatchCreateResourceValueConfigsRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Response message for BatchCreateResourceValueConfigs + # @!attribute [rw] resource_value_configs + # @return [::Array<::Google::Cloud::SecurityCenter::V1::ResourceValueConfig>] + # The resource value configs created + class BatchCreateResourceValueConfigsResponse + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Request message to delete resource value config + # @!attribute [rw] name + # @return [::String] + # Required. Name of the ResourceValueConfig to delete + class DeleteResourceValueConfigRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Request message to get resource value config + # @!attribute [rw] name + # @return [::String] + # Required. Name of the resource value config to retrieve. Its format is + # `organizations/{organization}/resourceValueConfigs/{config_id}`. + class GetResourceValueConfigRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Request message to list resource value configs of a parent + # @!attribute [rw] parent + # @return [::String] + # Required. The parent, which owns the collection of resource value configs. + # Its format is + # `organizations/[organization_id]` + # @!attribute [rw] page_size + # @return [::Integer] + # The number of results to return. The service may return fewer than + # this value. + # If unspecified, at most 10 configs will be returned. + # The maximum value is 1000; values above 1000 will be coerced to 1000. + # @!attribute [rw] page_token + # @return [::String] + # A page token, received from a previous `ListResourceValueConfigs` call. + # Provide this to retrieve the subsequent page. + # + # When paginating, all other parameters provided to + # `ListResourceValueConfigs` must match the call that provided the + # page token. + # + # page_size can be specified, and the new page_size will be used. + class ListResourceValueConfigsRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Response message to list resource value configs + # @!attribute [rw] resource_value_configs + # @return [::Array<::Google::Cloud::SecurityCenter::V1::ResourceValueConfig>] + # The resource value configs from the specified parent. + # @!attribute [rw] next_page_token + # @return [::String] + # A token, which can be sent as `page_token` to retrieve the next page. + # If this field is empty, there are no subsequent pages. + class ListResourceValueConfigsResponse + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Request message to update resource value config + # @!attribute [rw] resource_value_config + # @return [::Google::Cloud::SecurityCenter::V1::ResourceValueConfig] + # Required. The resource value config being updated. + # @!attribute [rw] update_mask + # @return [::Google::Protobuf::FieldMask] + # The list of fields to be updated. + # If empty all mutable fields will be updated. + class UpdateResourceValueConfigRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Request message for creating a notification config. + # @!attribute [rw] parent + # @return [::String] + # Required. Resource name of the new notification config's parent. Its format + # is `organizations/[organization_id]`, `folders/[folder_id]`, or + # `projects/[project_id]`. + # @!attribute [rw] config_id + # @return [::String] + # Required. + # Unique identifier provided by the client within the parent scope. + # It must be between 1 and 128 characters and contain alphanumeric + # characters, underscores, or hyphens only. + # @!attribute [rw] notification_config + # @return [::Google::Cloud::SecurityCenter::V1::NotificationConfig] + # Required. The notification config being created. The name and the service + # account will be ignored as they are both output only fields on this + # resource. + class CreateNotificationConfigRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Request message for creating Security Health Analytics custom modules. + # @!attribute [rw] parent + # @return [::String] + # Required. Resource name of the new custom module's parent. Its format is + # `organizations/{organization}/securityHealthAnalyticsSettings`, + # `folders/{folder}/securityHealthAnalyticsSettings`, or + # `projects/{project}/securityHealthAnalyticsSettings` + # @!attribute [rw] security_health_analytics_custom_module + # @return [::Google::Cloud::SecurityCenter::V1::SecurityHealthAnalyticsCustomModule] + # Required. SecurityHealthAnalytics custom module to create. The provided + # name is ignored and reset with provided parent information and + # server-generated ID. + class CreateSecurityHealthAnalyticsCustomModuleRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Request message for creating a source. + # @!attribute [rw] parent + # @return [::String] + # Required. Resource name of the new source's parent. Its format should be + # `organizations/[organization_id]`. + # @!attribute [rw] source + # @return [::Google::Cloud::SecurityCenter::V1::Source] + # Required. The Source being created, only the display_name and description + # will be used. All other fields will be ignored. + class CreateSourceRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Request message for deleting a mute config. + # @!attribute [rw] name + # @return [::String] + # Required. Name of the mute config to delete. Its format is + # `organizations/{organization}/muteConfigs/{config_id}`, + # `folders/{folder}/muteConfigs/{config_id}`, + # `projects/{project}/muteConfigs/{config_id}`, + # `organizations/{organization}/locations/global/muteConfigs/{config_id}`, + # `folders/{folder}/locations/global/muteConfigs/{config_id}`, or + # `projects/{project}/locations/global/muteConfigs/{config_id}`. + class DeleteMuteConfigRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Request message for deleting a notification config. + # @!attribute [rw] name + # @return [::String] + # Required. Name of the notification config to delete. Its format is + # `organizations/[organization_id]/notificationConfigs/[config_id]`, + # `folders/[folder_id]/notificationConfigs/[config_id]`, + # or `projects/[project_id]/notificationConfigs/[config_id]`. + class DeleteNotificationConfigRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Request message for deleting Security Health Analytics custom modules. + # @!attribute [rw] name + # @return [::String] + # Required. Name of the custom module to delete. Its format is + # `organizations/{organization}/securityHealthAnalyticsSettings/customModules/{customModule}`, + # `folders/{folder}/securityHealthAnalyticsSettings/customModules/{customModule}`, + # or + # `projects/{project}/securityHealthAnalyticsSettings/customModules/{customModule}` + class DeleteSecurityHealthAnalyticsCustomModuleRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Request message for retrieving a BigQuery export. + # @!attribute [rw] name + # @return [::String] + # Required. Name of the BigQuery export to retrieve. Its format is + # `organizations/{organization}/bigQueryExports/{export_id}`, + # `folders/{folder}/bigQueryExports/{export_id}`, or + # `projects/{project}/bigQueryExports/{export_id}` + class GetBigQueryExportRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Request message for retrieving a mute config. + # @!attribute [rw] name + # @return [::String] + # Required. Name of the mute config to retrieve. Its format is + # `organizations/{organization}/muteConfigs/{config_id}`, + # `folders/{folder}/muteConfigs/{config_id}`, + # `projects/{project}/muteConfigs/{config_id}`, + # `organizations/{organization}/locations/global/muteConfigs/{config_id}`, + # `folders/{folder}/locations/global/muteConfigs/{config_id}`, or + # `projects/{project}/locations/global/muteConfigs/{config_id}`. + class GetMuteConfigRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Request message for getting a notification config. + # @!attribute [rw] name + # @return [::String] + # Required. Name of the notification config to get. Its format is + # `organizations/[organization_id]/notificationConfigs/[config_id]`, + # `folders/[folder_id]/notificationConfigs/[config_id]`, + # or `projects/[project_id]/notificationConfigs/[config_id]`. + class GetNotificationConfigRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Request message for getting organization settings. + # @!attribute [rw] name + # @return [::String] + # Required. Name of the organization to get organization settings for. Its + # format is `organizations/[organization_id]/organizationSettings`. + class GetOrganizationSettingsRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Request message for getting effective Security Health Analytics custom + # modules. + # @!attribute [rw] name + # @return [::String] + # Required. Name of the effective custom module to get. Its format is + # `organizations/{organization}/securityHealthAnalyticsSettings/effectiveCustomModules/{customModule}`, + # `folders/{folder}/securityHealthAnalyticsSettings/effectiveCustomModules/{customModule}`, + # or + # `projects/{project}/securityHealthAnalyticsSettings/effectiveCustomModules/{customModule}` + class GetEffectiveSecurityHealthAnalyticsCustomModuleRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Request message for getting Security Health Analytics custom modules. + # @!attribute [rw] name + # @return [::String] + # Required. Name of the custom module to get. Its format is + # `organizations/{organization}/securityHealthAnalyticsSettings/customModules/{customModule}`, + # `folders/{folder}/securityHealthAnalyticsSettings/customModules/{customModule}`, + # or + # `projects/{project}/securityHealthAnalyticsSettings/customModules/{customModule}` + class GetSecurityHealthAnalyticsCustomModuleRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Request message for getting a source. + # @!attribute [rw] name + # @return [::String] + # Required. Relative resource name of the source. Its format is + # `organizations/[organization_id]/source/[source_id]`. + class GetSourceRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Request message for grouping by assets. + # @!attribute [rw] parent + # @return [::String] + # Required. The name of the parent to group the assets by. Its format is + # `organizations/[organization_id]`, `folders/[folder_id]`, or + # `projects/[project_id]`. + # @!attribute [rw] filter + # @return [::String] + # Expression that defines the filter to apply across assets. + # The expression is a list of zero or more restrictions combined via logical + # operators `AND` and `OR`. + # Parentheses are supported, and `OR` has higher precedence than `AND`. + # + # Restrictions have the form ` ` and may have a `-` + # character in front of them to indicate negation. The fields map to those + # defined in the Asset resource. Examples include: + # + # * name + # * security_center_properties.resource_name + # * resource_properties.a_property + # * security_marks.marks.marka + # + # The supported operators are: + # + # * `=` for all value types. + # * `>`, `<`, `>=`, `<=` for integer values. + # * `:`, meaning substring matching, for strings. + # + # The supported value types are: + # + # * string literals in quotes. + # * integer literals without quotes. + # * boolean literals `true` and `false` without quotes. + # + # The following field and operator combinations are supported: + # + # * name: `=` + # * update_time: `=`, `>`, `<`, `>=`, `<=` + # + # Usage: This should be milliseconds since epoch or an RFC3339 string. + # Examples: + # `update_time = "2019-06-10T16:07:18-07:00"` + # `update_time = 1560208038000` + # + # * create_time: `=`, `>`, `<`, `>=`, `<=` + # + # Usage: This should be milliseconds since epoch or an RFC3339 string. + # Examples: + # `create_time = "2019-06-10T16:07:18-07:00"` + # `create_time = 1560208038000` + # + # * iam_policy.policy_blob: `=`, `:` + # * resource_properties: `=`, `:`, `>`, `<`, `>=`, `<=` + # * security_marks.marks: `=`, `:` + # * security_center_properties.resource_name: `=`, `:` + # * security_center_properties.resource_display_name: `=`, `:` + # * security_center_properties.resource_type: `=`, `:` + # * security_center_properties.resource_parent: `=`, `:` + # * security_center_properties.resource_parent_display_name: `=`, `:` + # * security_center_properties.resource_project: `=`, `:` + # * security_center_properties.resource_project_display_name: `=`, `:` + # * security_center_properties.resource_owners: `=`, `:` + # + # For example, `resource_properties.size = 100` is a valid filter string. + # + # Use a partial match on the empty string to filter based on a property + # existing: `resource_properties.my_property : ""` + # + # Use a negated partial match on the empty string to filter based on a + # property not existing: `-resource_properties.my_property : ""` + # @!attribute [rw] group_by + # @return [::String] + # Required. Expression that defines what assets fields to use for grouping. + # The string value should follow SQL syntax: comma separated list of fields. + # For example: + # "security_center_properties.resource_project,security_center_properties.project". + # + # The following fields are supported when compare_duration is not set: + # + # * security_center_properties.resource_project + # * security_center_properties.resource_project_display_name + # * security_center_properties.resource_type + # * security_center_properties.resource_parent + # * security_center_properties.resource_parent_display_name + # + # The following fields are supported when compare_duration is set: + # + # * security_center_properties.resource_type + # * security_center_properties.resource_project_display_name + # * security_center_properties.resource_parent_display_name + # @!attribute [rw] compare_duration + # @return [::Google::Protobuf::Duration] + # When compare_duration is set, the GroupResult's "state_change" property is + # updated to indicate whether the asset was added, removed, or remained + # present during the compare_duration period of time that precedes the + # read_time. This is the time between (read_time - compare_duration) and + # read_time. + # + # The state change value is derived based on the presence of the asset at the + # two points in time. Intermediate state changes between the two times don't + # affect the result. For example, the results aren't affected if the asset is + # removed and re-created again. + # + # Possible "state_change" values when compare_duration is specified: + # + # * "ADDED": indicates that the asset was not present at the start of + # compare_duration, but present at reference_time. + # * "REMOVED": indicates that the asset was present at the start of + # compare_duration, but not present at reference_time. + # * "ACTIVE": indicates that the asset was present at both the + # start and the end of the time period defined by + # compare_duration and reference_time. + # + # If compare_duration is not specified, then the only possible state_change + # is "UNUSED", which will be the state_change set for all assets present at + # read_time. + # + # If this field is set then `state_change` must be a specified field in + # `group_by`. + # @!attribute [rw] read_time + # @return [::Google::Protobuf::Timestamp] + # Time used as a reference point when filtering assets. The filter is limited + # to assets existing at the supplied time and their values are those at that + # specific time. Absence of this field will default to the API's version of + # NOW. + # @!attribute [rw] page_token + # @return [::String] + # The value returned by the last `GroupAssetsResponse`; indicates + # that this is a continuation of a prior `GroupAssets` call, and that the + # system should return the next page of data. + # @!attribute [rw] page_size + # @return [::Integer] + # The maximum number of results to return in a single response. Default is + # 10, minimum is 1, maximum is 1000. + class GroupAssetsRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Response message for grouping by assets. + # @!attribute [rw] group_by_results + # @return [::Array<::Google::Cloud::SecurityCenter::V1::GroupResult>] + # Group results. There exists an element for each existing unique + # combination of property/values. The element contains a count for the number + # of times those specific property/values appear. + # @!attribute [rw] read_time + # @return [::Google::Protobuf::Timestamp] + # Time used for executing the groupBy request. + # @!attribute [rw] next_page_token + # @return [::String] + # Token to retrieve the next page of results, or empty if there are no more + # results. + # @!attribute [rw] total_size + # @return [::Integer] + # The total number of results matching the query. + class GroupAssetsResponse + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Request message for grouping by findings. + # @!attribute [rw] parent + # @return [::String] + # Required. Name of the source to groupBy. Its format is + # `organizations/[organization_id]/sources/[source_id]`, + # `folders/[folder_id]/sources/[source_id]`, or + # `projects/[project_id]/sources/[source_id]`. To groupBy across all sources + # provide a source_id of `-`. For example: + # `organizations/{organization_id}/sources/-, folders/{folder_id}/sources/-`, + # or `projects/{project_id}/sources/-` + # @!attribute [rw] filter + # @return [::String] + # Expression that defines the filter to apply across findings. + # The expression is a list of one or more restrictions combined via logical + # operators `AND` and `OR`. + # Parentheses are supported, and `OR` has higher precedence than `AND`. + # + # Restrictions have the form ` ` and may have a `-` + # character in front of them to indicate negation. Examples include: + # + # * name + # * source_properties.a_property + # * security_marks.marks.marka + # + # The supported operators are: + # + # * `=` for all value types. + # * `>`, `<`, `>=`, `<=` for integer values. + # * `:`, meaning substring matching, for strings. + # + # The supported value types are: + # + # * string literals in quotes. + # * integer literals without quotes. + # * boolean literals `true` and `false` without quotes. + # + # The following field and operator combinations are supported: + # + # * name: `=` + # * parent: `=`, `:` + # * resource_name: `=`, `:` + # * state: `=`, `:` + # * category: `=`, `:` + # * external_uri: `=`, `:` + # * event_time: `=`, `>`, `<`, `>=`, `<=` + # + # Usage: This should be milliseconds since epoch or an RFC3339 string. + # Examples: + # `event_time = "2019-06-10T16:07:18-07:00"` + # `event_time = 1560208038000` + # + # * severity: `=`, `:` + # * workflow_state: `=`, `:` + # * security_marks.marks: `=`, `:` + # * source_properties: `=`, `:`, `>`, `<`, `>=`, `<=` + # + # For example, `source_properties.size = 100` is a valid filter string. + # + # Use a partial match on the empty string to filter based on a property + # existing: `source_properties.my_property : ""` + # + # Use a negated partial match on the empty string to filter based on a + # property not existing: `-source_properties.my_property : ""` + # + # * resource: + # * resource.name: `=`, `:` + # * resource.parent_name: `=`, `:` + # * resource.parent_display_name: `=`, `:` + # * resource.project_name: `=`, `:` + # * resource.project_display_name: `=`, `:` + # * resource.type: `=`, `:` + # @!attribute [rw] group_by + # @return [::String] + # Required. Expression that defines what assets fields to use for grouping + # (including `state_change`). The string value should follow SQL syntax: + # comma separated list of fields. For example: "parent,resource_name". + # + # The following fields are supported when compare_duration is set: + # + # * state_change + # @!attribute [rw] read_time + # @return [::Google::Protobuf::Timestamp] + # Time used as a reference point when filtering findings. The filter is + # limited to findings existing at the supplied time and their values are + # those at that specific time. Absence of this field will default to the + # API's version of NOW. + # @!attribute [rw] compare_duration + # @return [::Google::Protobuf::Duration] + # When compare_duration is set, the GroupResult's "state_change" attribute is + # updated to indicate whether the finding had its state changed, the + # finding's state remained unchanged, or if the finding was added during the + # compare_duration period of time that precedes the read_time. This is the + # time between (read_time - compare_duration) and read_time. + # + # The state_change value is derived based on the presence and state of the + # finding at the two points in time. Intermediate state changes between the + # two times don't affect the result. For example, the results aren't affected + # if the finding is made inactive and then active again. + # + # Possible "state_change" values when compare_duration is specified: + # + # * "CHANGED": indicates that the finding was present and matched the given + # filter at the start of compare_duration, but changed its + # state at read_time. + # * "UNCHANGED": indicates that the finding was present and matched the given + # filter at the start of compare_duration and did not change + # state at read_time. + # * "ADDED": indicates that the finding did not match the given filter or + # was not present at the start of compare_duration, but was + # present at read_time. + # * "REMOVED": indicates that the finding was present and matched the + # filter at the start of compare_duration, but did not match + # the filter at read_time. + # + # If compare_duration is not specified, then the only possible state_change + # is "UNUSED", which will be the state_change set for all findings present + # at read_time. + # + # If this field is set then `state_change` must be a specified field in + # `group_by`. + # @!attribute [rw] page_token + # @return [::String] + # The value returned by the last `GroupFindingsResponse`; indicates + # that this is a continuation of a prior `GroupFindings` call, and + # that the system should return the next page of data. + # @!attribute [rw] page_size + # @return [::Integer] + # The maximum number of results to return in a single response. Default is + # 10, minimum is 1, maximum is 1000. + class GroupFindingsRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Response message for group by findings. + # @!attribute [rw] group_by_results + # @return [::Array<::Google::Cloud::SecurityCenter::V1::GroupResult>] + # Group results. There exists an element for each existing unique + # combination of property/values. The element contains a count for the number + # of times those specific property/values appear. + # @!attribute [rw] read_time + # @return [::Google::Protobuf::Timestamp] + # Time used for executing the groupBy request. + # @!attribute [rw] next_page_token + # @return [::String] + # Token to retrieve the next page of results, or empty if there are no more + # results. + # @!attribute [rw] total_size + # @return [::Integer] + # The total number of results matching the query. + class GroupFindingsResponse + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Result containing the properties and count of a groupBy request. + # @!attribute [rw] properties + # @return [::Google::Protobuf::Map{::String => ::Google::Protobuf::Value}] + # Properties matching the groupBy fields in the request. + # @!attribute [rw] count + # @return [::Integer] + # Total count of resources for the given properties. + class GroupResult + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # @!attribute [rw] key + # @return [::String] + # @!attribute [rw] value + # @return [::Google::Protobuf::Value] + class PropertiesEntry + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end + + # Request message for listing descendant Security Health Analytics custom + # modules. + # @!attribute [rw] parent + # @return [::String] + # Required. Name of parent to list descendant custom modules. Its format is + # `organizations/{organization}/securityHealthAnalyticsSettings`, + # `folders/{folder}/securityHealthAnalyticsSettings`, or + # `projects/{project}/securityHealthAnalyticsSettings` + # @!attribute [rw] page_size + # @return [::Integer] + # The maximum number of results to return in a single response. Default is + # 10, minimum is 1, maximum is 1000. + # @!attribute [rw] page_token + # @return [::String] + # The value returned by the last call indicating a continuation + class ListDescendantSecurityHealthAnalyticsCustomModulesRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Response message for listing descendant Security Health Analytics custom + # modules. + # @!attribute [rw] security_health_analytics_custom_modules + # @return [::Array<::Google::Cloud::SecurityCenter::V1::SecurityHealthAnalyticsCustomModule>] + # Custom modules belonging to the requested parent and its descendants. + # @!attribute [rw] next_page_token + # @return [::String] + # If not empty, indicates that there may be more custom modules to be + # returned. + class ListDescendantSecurityHealthAnalyticsCustomModulesResponse + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Request message for listing the valued resources for a given simulation. + # @!attribute [rw] parent + # @return [::String] + # Required. Name of parent to list valued resources. + # + # Valid formats: + # `organizations/{organization}`, + # `organizations/{organization}/simulations/{simulation}` + # `organizations/{organization}/simulations/{simulation}/attackExposureResults/{attack_exposure_result_v2}` + # @!attribute [rw] filter + # @return [::String] + # The filter expression that filters the valued resources in the response. + # Supported fields: + # + # * `resource_value` supports = + # * `resource_type` supports = + # @!attribute [rw] page_token + # @return [::String] + # The value returned by the last `ListValuedResourcesResponse`; indicates + # that this is a continuation of a prior `ListValuedResources` call, and + # that the system should return the next page of data. + # @!attribute [rw] page_size + # @return [::Integer] + # The maximum number of results to return in a single response. Default is + # 10, minimum is 1, maximum is 1000. + # @!attribute [rw] order_by + # @return [::String] + # Optional. The fields by which to order the valued resources response. + # + # Supported fields: + # + # * `exposed_score` + # + # * `resource_value` + # + # * `resource_type` + # + # * `resource` + # + # * `display_name` + # + # Values should be a comma separated list of fields. For example: + # `exposed_score,resource_value`. + # + # The default sorting order is descending. To specify ascending or descending + # order for a field, append a ` ASC` or a ` DESC` suffix, respectively; for + # example: `exposed_score DESC`. + class ListValuedResourcesRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Response message for listing the valued resources for a given simulation. + # @!attribute [rw] valued_resources + # @return [::Array<::Google::Cloud::SecurityCenter::V1::ValuedResource>] + # The valued resources that the attack path simulation identified. + # @!attribute [rw] next_page_token + # @return [::String] + # Token to retrieve the next page of results, or empty if there are no more + # results. + # @!attribute [rw] total_size + # @return [::Integer] + # The estimated total number of results matching the query. + class ListValuedResourcesResponse + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Request message for listing the attack paths for a given simulation or valued + # resource. + # @!attribute [rw] parent + # @return [::String] + # Required. Name of parent to list attack paths. + # + # Valid formats: + # `organizations/{organization}`, + # `organizations/{organization}/simulations/{simulation}` + # `organizations/{organization}/simulations/{simulation}/attackExposureResults/{attack_exposure_result_v2}` + # `organizations/{organization}/simulations/{simulation}/valuedResources/{valued_resource}` + # @!attribute [rw] filter + # @return [::String] + # The filter expression that filters the attack path in the response. + # Supported fields: + # + # * `valued_resources` supports = + # @!attribute [rw] page_token + # @return [::String] + # The value returned by the last `ListAttackPathsResponse`; indicates + # that this is a continuation of a prior `ListAttackPaths` call, and + # that the system should return the next page of data. + # @!attribute [rw] page_size + # @return [::Integer] + # The maximum number of results to return in a single response. Default is + # 10, minimum is 1, maximum is 1000. + class ListAttackPathsRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Response message for listing the attack paths for a given simulation or + # valued resource. + # @!attribute [rw] attack_paths + # @return [::Array<::Google::Cloud::SecurityCenter::V1::AttackPath>] + # The attack paths that the attack path simulation identified. + # @!attribute [rw] next_page_token + # @return [::String] + # Token to retrieve the next page of results, or empty if there are no more + # results. + class ListAttackPathsResponse + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Request message for getting simulation. + # Simulation name can include "latest" to retrieve the latest simulation + # For example, "organizations/123/simulations/latest" + # @!attribute [rw] name + # @return [::String] + # Required. The organization name or simulation name of this simulation + # + # Valid format: + # `organizations/{organization}/simulations/latest` + # `organizations/{organization}/simulations/{simulation}` + class GetSimulationRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Request message for getting a valued resource. + # @!attribute [rw] name + # @return [::String] + # Required. The name of this valued resource + # + # Valid format: + # `organizations/{organization}/simulations/{simulation}/valuedResources/{valued_resource}` + class GetValuedResourceRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Request message for listing mute configs at a given scope e.g. organization, + # folder or project. + # @!attribute [rw] parent + # @return [::String] + # Required. The parent, which owns the collection of mute configs. Its format + # is `organizations/[organization_id]`, `folders/[folder_id]`, + # `projects/[project_id]`. + # @!attribute [rw] page_size + # @return [::Integer] + # The maximum number of configs to return. The service may return fewer than + # this value. + # If unspecified, at most 10 configs will be returned. + # The maximum value is 1000; values above 1000 will be coerced to 1000. + # @!attribute [rw] page_token + # @return [::String] + # A page token, received from a previous `ListMuteConfigs` call. + # Provide this to retrieve the subsequent page. + # + # When paginating, all other parameters provided to `ListMuteConfigs` must + # match the call that provided the page token. + class ListMuteConfigsRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Response message for listing mute configs. + # @!attribute [rw] mute_configs + # @return [::Array<::Google::Cloud::SecurityCenter::V1::MuteConfig>] + # The mute configs from the specified parent. + # @!attribute [rw] next_page_token + # @return [::String] + # A token, which can be sent as `page_token` to retrieve the next page. + # If this field is omitted, there are no subsequent pages. + class ListMuteConfigsResponse + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Request message for listing notification configs. + # @!attribute [rw] parent + # @return [::String] + # Required. The name of the parent in which to list the notification + # configurations. Its format is "organizations/[organization_id]", + # "folders/[folder_id]", or "projects/[project_id]". + # @!attribute [rw] page_token + # @return [::String] + # The value returned by the last `ListNotificationConfigsResponse`; indicates + # that this is a continuation of a prior `ListNotificationConfigs` call, and + # that the system should return the next page of data. + # @!attribute [rw] page_size + # @return [::Integer] + # The maximum number of results to return in a single response. Default is + # 10, minimum is 1, maximum is 1000. + class ListNotificationConfigsRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Response message for listing notification configs. + # @!attribute [rw] notification_configs + # @return [::Array<::Google::Cloud::SecurityCenter::V1::NotificationConfig>] + # Notification configs belonging to the requested parent. + # @!attribute [rw] next_page_token + # @return [::String] + # Token to retrieve the next page of results, or empty if there are no more + # results. + class ListNotificationConfigsResponse + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Request message for listing effective Security Health Analytics custom + # modules. + # @!attribute [rw] parent + # @return [::String] + # Required. Name of parent to list effective custom modules. Its format is + # `organizations/{organization}/securityHealthAnalyticsSettings`, + # `folders/{folder}/securityHealthAnalyticsSettings`, or + # `projects/{project}/securityHealthAnalyticsSettings` + # @!attribute [rw] page_size + # @return [::Integer] + # The maximum number of results to return in a single response. Default is + # 10, minimum is 1, maximum is 1000. + # @!attribute [rw] page_token + # @return [::String] + # The value returned by the last call indicating a continuation + class ListEffectiveSecurityHealthAnalyticsCustomModulesRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Response message for listing effective Security Health Analytics custom + # modules. + # @!attribute [rw] effective_security_health_analytics_custom_modules + # @return [::Array<::Google::Cloud::SecurityCenter::V1::EffectiveSecurityHealthAnalyticsCustomModule>] + # Effective custom modules belonging to the requested parent. + # @!attribute [rw] next_page_token + # @return [::String] + # If not empty, indicates that there may be more effective custom modules to + # be returned. + class ListEffectiveSecurityHealthAnalyticsCustomModulesResponse + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Request message for listing Security Health Analytics custom modules. + # @!attribute [rw] parent + # @return [::String] + # Required. Name of parent to list custom modules. Its format is + # `organizations/{organization}/securityHealthAnalyticsSettings`, + # `folders/{folder}/securityHealthAnalyticsSettings`, or + # `projects/{project}/securityHealthAnalyticsSettings` + # @!attribute [rw] page_size + # @return [::Integer] + # The maximum number of results to return in a single response. Default is + # 10, minimum is 1, maximum is 1000. + # @!attribute [rw] page_token + # @return [::String] + # The value returned by the last call indicating a continuation + class ListSecurityHealthAnalyticsCustomModulesRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Response message for listing Security Health Analytics custom modules. + # @!attribute [rw] security_health_analytics_custom_modules + # @return [::Array<::Google::Cloud::SecurityCenter::V1::SecurityHealthAnalyticsCustomModule>] + # Custom modules belonging to the requested parent. + # @!attribute [rw] next_page_token + # @return [::String] + # If not empty, indicates that there may be more custom modules to be + # returned. + class ListSecurityHealthAnalyticsCustomModulesResponse + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Request message for listing sources. + # @!attribute [rw] parent + # @return [::String] + # Required. Resource name of the parent of sources to list. Its format should + # be `organizations/[organization_id]`, `folders/[folder_id]`, or + # `projects/[project_id]`. + # @!attribute [rw] page_token + # @return [::String] + # The value returned by the last `ListSourcesResponse`; indicates + # that this is a continuation of a prior `ListSources` call, and + # that the system should return the next page of data. + # @!attribute [rw] page_size + # @return [::Integer] + # The maximum number of results to return in a single response. Default is + # 10, minimum is 1, maximum is 1000. + class ListSourcesRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Response message for listing sources. + # @!attribute [rw] sources + # @return [::Array<::Google::Cloud::SecurityCenter::V1::Source>] + # Sources belonging to the requested parent. + # @!attribute [rw] next_page_token + # @return [::String] + # Token to retrieve the next page of results, or empty if there are no more + # results. + class ListSourcesResponse + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Request message for listing assets. + # @!attribute [rw] parent + # @return [::String] + # Required. The name of the parent resource that contains the assets. The + # value that you can specify on parent depends on the method in which you + # specify parent. You can specify one of the following values: + # `organizations/[organization_id]`, `folders/[folder_id]`, or + # `projects/[project_id]`. + # @!attribute [rw] filter + # @return [::String] + # Expression that defines the filter to apply across assets. + # The expression is a list of zero or more restrictions combined via logical + # operators `AND` and `OR`. + # Parentheses are supported, and `OR` has higher precedence than `AND`. + # + # Restrictions have the form ` ` and may have a `-` + # character in front of them to indicate negation. The fields map to those + # defined in the Asset resource. Examples include: + # + # * name + # * security_center_properties.resource_name + # * resource_properties.a_property + # * security_marks.marks.marka + # + # The supported operators are: + # + # * `=` for all value types. + # * `>`, `<`, `>=`, `<=` for integer values. + # * `:`, meaning substring matching, for strings. + # + # The supported value types are: + # + # * string literals in quotes. + # * integer literals without quotes. + # * boolean literals `true` and `false` without quotes. + # + # The following are the allowed field and operator combinations: + # + # * name: `=` + # * update_time: `=`, `>`, `<`, `>=`, `<=` + # + # Usage: This should be milliseconds since epoch or an RFC3339 string. + # Examples: + # `update_time = "2019-06-10T16:07:18-07:00"` + # `update_time = 1560208038000` + # + # * create_time: `=`, `>`, `<`, `>=`, `<=` + # + # Usage: This should be milliseconds since epoch or an RFC3339 string. + # Examples: + # `create_time = "2019-06-10T16:07:18-07:00"` + # `create_time = 1560208038000` + # + # * iam_policy.policy_blob: `=`, `:` + # * resource_properties: `=`, `:`, `>`, `<`, `>=`, `<=` + # * security_marks.marks: `=`, `:` + # * security_center_properties.resource_name: `=`, `:` + # * security_center_properties.resource_display_name: `=`, `:` + # * security_center_properties.resource_type: `=`, `:` + # * security_center_properties.resource_parent: `=`, `:` + # * security_center_properties.resource_parent_display_name: `=`, `:` + # * security_center_properties.resource_project: `=`, `:` + # * security_center_properties.resource_project_display_name: `=`, `:` + # * security_center_properties.resource_owners: `=`, `:` + # + # For example, `resource_properties.size = 100` is a valid filter string. + # + # Use a partial match on the empty string to filter based on a property + # existing: `resource_properties.my_property : ""` + # + # Use a negated partial match on the empty string to filter based on a + # property not existing: `-resource_properties.my_property : ""` + # @!attribute [rw] order_by + # @return [::String] + # Expression that defines what fields and order to use for sorting. The + # string value should follow SQL syntax: comma separated list of fields. For + # example: "name,resource_properties.a_property". The default sorting order + # is ascending. To specify descending order for a field, a suffix " desc" + # should be appended to the field name. For example: "name + # desc,resource_properties.a_property". Redundant space characters in the + # syntax are insignificant. "name desc,resource_properties.a_property" and " + # name desc , resource_properties.a_property " are equivalent. + # + # The following fields are supported: + # name + # update_time + # resource_properties + # security_marks.marks + # security_center_properties.resource_name + # security_center_properties.resource_display_name + # security_center_properties.resource_parent + # security_center_properties.resource_parent_display_name + # security_center_properties.resource_project + # security_center_properties.resource_project_display_name + # security_center_properties.resource_type + # @!attribute [rw] read_time + # @return [::Google::Protobuf::Timestamp] + # Time used as a reference point when filtering assets. The filter is limited + # to assets existing at the supplied time and their values are those at that + # specific time. Absence of this field will default to the API's version of + # NOW. + # @!attribute [rw] compare_duration + # @return [::Google::Protobuf::Duration] + # When compare_duration is set, the ListAssetsResult's "state_change" + # attribute is updated to indicate whether the asset was added, removed, or + # remained present during the compare_duration period of time that precedes + # the read_time. This is the time between (read_time - compare_duration) and + # read_time. + # + # The state_change value is derived based on the presence of the asset at the + # two points in time. Intermediate state changes between the two times don't + # affect the result. For example, the results aren't affected if the asset is + # removed and re-created again. + # + # Possible "state_change" values when compare_duration is specified: + # + # * "ADDED": indicates that the asset was not present at the start of + # compare_duration, but present at read_time. + # * "REMOVED": indicates that the asset was present at the start of + # compare_duration, but not present at read_time. + # * "ACTIVE": indicates that the asset was present at both the + # start and the end of the time period defined by + # compare_duration and read_time. + # + # If compare_duration is not specified, then the only possible state_change + # is "UNUSED", which will be the state_change set for all assets present at + # read_time. + # @!attribute [rw] field_mask + # @return [::Google::Protobuf::FieldMask] + # A field mask to specify the ListAssetsResult fields to be listed in the + # response. + # An empty field mask will list all fields. + # @!attribute [rw] page_token + # @return [::String] + # The value returned by the last `ListAssetsResponse`; indicates + # that this is a continuation of a prior `ListAssets` call, and + # that the system should return the next page of data. + # @!attribute [rw] page_size + # @return [::Integer] + # The maximum number of results to return in a single response. Default is + # 10, minimum is 1, maximum is 1000. + class ListAssetsRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Response message for listing assets. + # @!attribute [rw] list_assets_results + # @return [::Array<::Google::Cloud::SecurityCenter::V1::ListAssetsResponse::ListAssetsResult>] + # Assets matching the list request. + # @!attribute [rw] read_time + # @return [::Google::Protobuf::Timestamp] + # Time used for executing the list request. + # @!attribute [rw] next_page_token + # @return [::String] + # Token to retrieve the next page of results, or empty if there are no more + # results. + # @!attribute [rw] total_size + # @return [::Integer] + # The total number of assets matching the query. + class ListAssetsResponse + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # Result containing the Asset and its State. + # @!attribute [rw] asset + # @return [::Google::Cloud::SecurityCenter::V1::Asset] + # Asset matching the search request. + # @!attribute [rw] state_change + # @return [::Google::Cloud::SecurityCenter::V1::ListAssetsResponse::ListAssetsResult::StateChange] + # State change of the asset between the points in time. + class ListAssetsResult + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # The change in state of the asset. + # + # When querying across two points in time this describes + # the change between the two points: ADDED, REMOVED, or ACTIVE. + # If there was no compare_duration supplied in the request the state change + # will be: UNUSED + module StateChange + # State change is unused, this is the canonical default for this enum. + UNUSED = 0 + + # Asset was added between the points in time. + ADDED = 1 + + # Asset was removed between the points in time. + REMOVED = 2 + + # Asset was present at both point(s) in time. + ACTIVE = 3 + end + end + end + + # Request message for listing findings. + # @!attribute [rw] parent + # @return [::String] + # Required. Name of the source the findings belong to. Its format is + # `organizations/[organization_id]/sources/[source_id]`, + # `folders/[folder_id]/sources/[source_id]`, or + # `projects/[project_id]/sources/[source_id]`. To list across all sources + # provide a source_id of `-`. For example: + # `organizations/{organization_id}/sources/-`, + # `folders/{folder_id}/sources/-` or `projects/{projects_id}/sources/-` + # @!attribute [rw] filter + # @return [::String] + # Expression that defines the filter to apply across findings. + # The expression is a list of one or more restrictions combined via logical + # operators `AND` and `OR`. + # Parentheses are supported, and `OR` has higher precedence than `AND`. + # + # Restrictions have the form ` ` and may have a `-` + # character in front of them to indicate negation. Examples include: + # + # * name + # * source_properties.a_property + # * security_marks.marks.marka + # + # The supported operators are: + # + # * `=` for all value types. + # * `>`, `<`, `>=`, `<=` for integer values. + # * `:`, meaning substring matching, for strings. + # + # The supported value types are: + # + # * string literals in quotes. + # * integer literals without quotes. + # * boolean literals `true` and `false` without quotes. + # + # The following field and operator combinations are supported: + # + # * name: `=` + # * parent: `=`, `:` + # * resource_name: `=`, `:` + # * state: `=`, `:` + # * category: `=`, `:` + # * external_uri: `=`, `:` + # * event_time: `=`, `>`, `<`, `>=`, `<=` + # + # Usage: This should be milliseconds since epoch or an RFC3339 string. + # Examples: + # `event_time = "2019-06-10T16:07:18-07:00"` + # `event_time = 1560208038000` + # + # * severity: `=`, `:` + # * workflow_state: `=`, `:` + # * security_marks.marks: `=`, `:` + # * source_properties: `=`, `:`, `>`, `<`, `>=`, `<=` + # + # For example, `source_properties.size = 100` is a valid filter string. + # + # Use a partial match on the empty string to filter based on a property + # existing: `source_properties.my_property : ""` + # + # Use a negated partial match on the empty string to filter based on a + # property not existing: `-source_properties.my_property : ""` + # + # * resource: + # * resource.name: `=`, `:` + # * resource.parent_name: `=`, `:` + # * resource.parent_display_name: `=`, `:` + # * resource.project_name: `=`, `:` + # * resource.project_display_name: `=`, `:` + # * resource.type: `=`, `:` + # * resource.folders.resource_folder: `=`, `:` + # * resource.display_name: `=`, `:` + # @!attribute [rw] order_by + # @return [::String] + # Expression that defines what fields and order to use for sorting. The + # string value should follow SQL syntax: comma separated list of fields. For + # example: "name,resource_properties.a_property". The default sorting order + # is ascending. To specify descending order for a field, a suffix " desc" + # should be appended to the field name. For example: "name + # desc,source_properties.a_property". Redundant space characters in the + # syntax are insignificant. "name desc,source_properties.a_property" and " + # name desc , source_properties.a_property " are equivalent. + # + # The following fields are supported: + # name + # parent + # state + # category + # resource_name + # event_time + # source_properties + # security_marks.marks + # @!attribute [rw] read_time + # @return [::Google::Protobuf::Timestamp] + # Time used as a reference point when filtering findings. The filter is + # limited to findings existing at the supplied time and their values are + # those at that specific time. Absence of this field will default to the + # API's version of NOW. + # @!attribute [rw] compare_duration + # @return [::Google::Protobuf::Duration] + # When compare_duration is set, the ListFindingsResult's "state_change" + # attribute is updated to indicate whether the finding had its state changed, + # the finding's state remained unchanged, or if the finding was added in any + # state during the compare_duration period of time that precedes the + # read_time. This is the time between (read_time - compare_duration) and + # read_time. + # + # The state_change value is derived based on the presence and state of the + # finding at the two points in time. Intermediate state changes between the + # two times don't affect the result. For example, the results aren't affected + # if the finding is made inactive and then active again. + # + # Possible "state_change" values when compare_duration is specified: + # + # * "CHANGED": indicates that the finding was present and matched the given + # filter at the start of compare_duration, but changed its + # state at read_time. + # * "UNCHANGED": indicates that the finding was present and matched the given + # filter at the start of compare_duration and did not change + # state at read_time. + # * "ADDED": indicates that the finding did not match the given filter or + # was not present at the start of compare_duration, but was + # present at read_time. + # * "REMOVED": indicates that the finding was present and matched the + # filter at the start of compare_duration, but did not match + # the filter at read_time. + # + # If compare_duration is not specified, then the only possible state_change + # is "UNUSED", which will be the state_change set for all findings present at + # read_time. + # @!attribute [rw] field_mask + # @return [::Google::Protobuf::FieldMask] + # A field mask to specify the Finding fields to be listed in the response. + # An empty field mask will list all fields. + # @!attribute [rw] page_token + # @return [::String] + # The value returned by the last `ListFindingsResponse`; indicates + # that this is a continuation of a prior `ListFindings` call, and + # that the system should return the next page of data. + # @!attribute [rw] page_size + # @return [::Integer] + # The maximum number of results to return in a single response. Default is + # 10, minimum is 1, maximum is 1000. + class ListFindingsRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Response message for listing findings. + # @!attribute [rw] list_findings_results + # @return [::Array<::Google::Cloud::SecurityCenter::V1::ListFindingsResponse::ListFindingsResult>] + # Findings matching the list request. + # @!attribute [rw] read_time + # @return [::Google::Protobuf::Timestamp] + # Time used for executing the list request. + # @!attribute [rw] next_page_token + # @return [::String] + # Token to retrieve the next page of results, or empty if there are no more + # results. + # @!attribute [rw] total_size + # @return [::Integer] + # The total number of findings matching the query. + class ListFindingsResponse + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # Result containing the Finding and its StateChange. + # @!attribute [rw] finding + # @return [::Google::Cloud::SecurityCenter::V1::Finding] + # Finding matching the search request. + # @!attribute [rw] state_change + # @return [::Google::Cloud::SecurityCenter::V1::ListFindingsResponse::ListFindingsResult::StateChange] + # State change of the finding between the points in time. + # @!attribute [r] resource + # @return [::Google::Cloud::SecurityCenter::V1::ListFindingsResponse::ListFindingsResult::Resource] + # Output only. Resource that is associated with this finding. + class ListFindingsResult + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # Information related to the Google Cloud resource that is + # associated with this finding. + # @!attribute [rw] name + # @return [::String] + # The full resource name of the resource. See: + # https://cloud.google.com/apis/design/resource_names#full_resource_name + # @!attribute [rw] display_name + # @return [::String] + # The human readable name of the resource. + # @!attribute [rw] type + # @return [::String] + # The full resource type of the resource. + # @!attribute [rw] project_name + # @return [::String] + # The full resource name of project that the resource belongs to. + # @!attribute [rw] project_display_name + # @return [::String] + # The project ID that the resource belongs to. + # @!attribute [rw] parent_name + # @return [::String] + # The full resource name of resource's parent. + # @!attribute [rw] parent_display_name + # @return [::String] + # The human readable name of resource's parent. + # @!attribute [rw] folders + # @return [::Array<::Google::Cloud::SecurityCenter::V1::Folder>] + # Contains a Folder message for each folder in the assets ancestry. + # The first folder is the deepest nested folder, and the last folder is + # the folder directly under the Organization. + # @!attribute [rw] cloud_provider + # @return [::Google::Cloud::SecurityCenter::V1::CloudProvider] + # Indicates which cloud provider the finding is from. + # @!attribute [rw] organization + # @return [::String] + # Indicates which organization / tenant the finding is for. + # @!attribute [rw] service + # @return [::String] + # The service or resource provider associated with the resource. + # @!attribute [rw] location + # @return [::String] + # The region or location of the service (if applicable). + # @!attribute [rw] aws_metadata + # @return [::Google::Cloud::SecurityCenter::V1::AwsMetadata] + # The AWS metadata associated with the finding. + # + # Note: The following fields are mutually exclusive: `aws_metadata`, `azure_metadata`. If a field in that set is populated, all other fields in the set will automatically be cleared. + # @!attribute [rw] azure_metadata + # @return [::Google::Cloud::SecurityCenter::V1::AzureMetadata] + # The Azure metadata associated with the finding. + # + # Note: The following fields are mutually exclusive: `azure_metadata`, `aws_metadata`. If a field in that set is populated, all other fields in the set will automatically be cleared. + # @!attribute [rw] resource_path + # @return [::Google::Cloud::SecurityCenter::V1::ResourcePath] + # Provides the path to the resource within the resource hierarchy. + # @!attribute [rw] resource_path_string + # @return [::String] + # A string representation of the resource path. + # For Google Cloud, it has the format of + # `org/{organization_id}/folder/{folder_id}/folder/{folder_id}/project/{project_id}` + # where there can be any number of folders. + # For AWS, it has the format of + # `org/{organization_id}/ou/{organizational_unit_id}/ou/{organizational_unit_id}/account/{account_id}` + # where there can be any number of organizational units. + # For Azure, it has the format of + # `mg/{management_group_id}/mg/{management_group_id}/subscription/{subscription_id}/rg/{resource_group_name}` + # where there can be any number of management groups. + class Resource + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # The change in state of the finding. + # + # When querying across two points in time this describes + # the change in the finding between the two points: CHANGED, UNCHANGED, + # ADDED, or REMOVED. Findings can not be deleted, so REMOVED implies that + # the finding at timestamp does not match the filter specified, but it did + # at timestamp - compare_duration. If there was no compare_duration + # supplied in the request the state change will be: UNUSED + module StateChange + # State change is unused, this is the canonical default for this enum. + UNUSED = 0 + + # The finding has changed state in some way between the points in time + # and existed at both points. + CHANGED = 1 + + # The finding has not changed state between the points in time and + # existed at both points. + UNCHANGED = 2 + + # The finding was created between the points in time. + ADDED = 3 + + # The finding at timestamp does not match the filter specified, but it + # did at timestamp - compare_duration. + REMOVED = 4 + end + end + end + + # Request message for updating a finding's state. + # @!attribute [rw] name + # @return [::String] + # Required. The [relative resource + # name](https://cloud.google.com/apis/design/resource_names#relative_resource_name) + # of the finding. Example: + # `organizations/{organization_id}/sources/{source_id}/findings/{finding_id}`, + # `folders/{folder_id}/sources/{source_id}/findings/{finding_id}`, + # `projects/{project_id}/sources/{source_id}/findings/{finding_id}`. + # @!attribute [rw] state + # @return [::Google::Cloud::SecurityCenter::V1::Finding::State] + # Required. The desired State of the finding. + # @!attribute [rw] start_time + # @return [::Google::Protobuf::Timestamp] + # Required. The time at which the updated state takes effect. + class SetFindingStateRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Request message for updating a finding's mute status. + # @!attribute [rw] name + # @return [::String] + # Required. The [relative resource + # name](https://cloud.google.com/apis/design/resource_names#relative_resource_name) + # of the finding. Example: + # `organizations/{organization_id}/sources/{source_id}/findings/{finding_id}`, + # `folders/{folder_id}/sources/{source_id}/findings/{finding_id}`, + # `projects/{project_id}/sources/{source_id}/findings/{finding_id}`. + # @!attribute [rw] mute + # @return [::Google::Cloud::SecurityCenter::V1::Finding::Mute] + # Required. The desired state of the Mute. + class SetMuteRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Request message for running asset discovery for an organization. + # @!attribute [rw] parent + # @return [::String] + # Required. Name of the organization to run asset discovery for. Its format + # is `organizations/[organization_id]`. + class RunAssetDiscoveryRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Request message to simulate a CustomConfig against a given test resource. + # Maximum size of the request is 4 MB by default. + # @!attribute [rw] parent + # @return [::String] + # Required. The relative resource name of the organization, project, or + # folder. For more information about relative resource names, see [Relative + # Resource + # Name](https://cloud.google.com/apis/design/resource_names#relative_resource_name) + # Example: `organizations/{organization_id}` + # @!attribute [rw] custom_config + # @return [::Google::Cloud::SecurityCenter::V1::CustomConfig] + # Required. The custom configuration that you need to test. + # @!attribute [rw] resource + # @return [::Google::Cloud::SecurityCenter::V1::SimulateSecurityHealthAnalyticsCustomModuleRequest::SimulatedResource] + # Required. Resource data to simulate custom module against. + class SimulateSecurityHealthAnalyticsCustomModuleRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # Manually constructed resource name. If the custom module evaluates against + # only the resource data, you can omit the `iam_policy_data` field. If it + # evaluates only the `iam_policy_data` field, you can omit the resource data. + # @!attribute [rw] resource_type + # @return [::String] + # Required. The type of the resource, for example, + # `compute.googleapis.com/Disk`. + # @!attribute [rw] resource_data + # @return [::Google::Protobuf::Struct] + # Optional. A representation of the Google Cloud resource. Should match the + # Google Cloud resource JSON format. + # @!attribute [rw] iam_policy_data + # @return [::Google::Iam::V1::Policy] + # Optional. A representation of the IAM policy. + class SimulatedResource + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end + + # Response message for simulating a `SecurityHealthAnalyticsCustomModule` + # against a given resource. + # @!attribute [rw] result + # @return [::Google::Cloud::SecurityCenter::V1::SimulateSecurityHealthAnalyticsCustomModuleResponse::SimulatedResult] + # Result for test case in the corresponding request. + class SimulateSecurityHealthAnalyticsCustomModuleResponse + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # Possible test result. + # @!attribute [rw] finding + # @return [::Google::Cloud::SecurityCenter::V1::Finding] + # Finding that would be published for the test case, + # if a violation is detected. + # + # Note: The following fields are mutually exclusive: `finding`, `no_violation`, `error`. If a field in that set is populated, all other fields in the set will automatically be cleared. + # @!attribute [rw] no_violation + # @return [::Google::Protobuf::Empty] + # Indicates that the test case does not trigger any violation. + # + # Note: The following fields are mutually exclusive: `no_violation`, `finding`, `error`. If a field in that set is populated, all other fields in the set will automatically be cleared. + # @!attribute [rw] error + # @return [::Google::Rpc::Status] + # Error encountered during the test. + # + # Note: The following fields are mutually exclusive: `error`, `finding`, `no_violation`. If a field in that set is populated, all other fields in the set will automatically be cleared. + class SimulatedResult + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end + + # Request message for updating a ExternalSystem resource. + # @!attribute [rw] external_system + # @return [::Google::Cloud::SecurityCenter::V1::ExternalSystem] + # Required. The external system resource to update. + # @!attribute [rw] update_mask + # @return [::Google::Protobuf::FieldMask] + # The FieldMask to use when updating the external system resource. + # + # If empty all mutable fields will be updated. + class UpdateExternalSystemRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Request message for updating or creating a finding. + # @!attribute [rw] finding + # @return [::Google::Cloud::SecurityCenter::V1::Finding] + # Required. The finding resource to update or create if it does not already + # exist. parent, security_marks, and update_time will be ignored. + # + # In the case of creation, the finding id portion of the name must be + # alphanumeric and less than or equal to 32 characters and greater than 0 + # characters in length. + # @!attribute [rw] update_mask + # @return [::Google::Protobuf::FieldMask] + # The FieldMask to use when updating the finding resource. This field should + # not be specified when creating a finding. + # + # When updating a finding, an empty mask is treated as updating all mutable + # fields and replacing source_properties. Individual source_properties can + # be added/updated by using "source_properties." in the field + # mask. + class UpdateFindingRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Request message for updating a mute config. + # @!attribute [rw] mute_config + # @return [::Google::Cloud::SecurityCenter::V1::MuteConfig] + # Required. The mute config being updated. + # @!attribute [rw] update_mask + # @return [::Google::Protobuf::FieldMask] + # The list of fields to be updated. + # If empty all mutable fields will be updated. + class UpdateMuteConfigRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Request message for updating a notification config. + # @!attribute [rw] notification_config + # @return [::Google::Cloud::SecurityCenter::V1::NotificationConfig] + # Required. The notification config to update. + # @!attribute [rw] update_mask + # @return [::Google::Protobuf::FieldMask] + # The FieldMask to use when updating the notification config. + # + # If empty all mutable fields will be updated. + class UpdateNotificationConfigRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Request message for updating an organization's settings. + # @!attribute [rw] organization_settings + # @return [::Google::Cloud::SecurityCenter::V1::OrganizationSettings] + # Required. The organization settings resource to update. + # @!attribute [rw] update_mask + # @return [::Google::Protobuf::FieldMask] + # The FieldMask to use when updating the settings resource. + # + # If empty all mutable fields will be updated. + class UpdateOrganizationSettingsRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Request message for updating Security Health Analytics custom modules. + # @!attribute [rw] security_health_analytics_custom_module + # @return [::Google::Cloud::SecurityCenter::V1::SecurityHealthAnalyticsCustomModule] + # Required. The SecurityHealthAnalytics custom module to update. + # @!attribute [rw] update_mask + # @return [::Google::Protobuf::FieldMask] + # The list of fields to be updated. The only fields that can be updated are + # `enablement_state` and `custom_config`. If empty or set to the wildcard + # value `*`, both `enablement_state` and `custom_config` are updated. + class UpdateSecurityHealthAnalyticsCustomModuleRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Request message for updating a source. + # @!attribute [rw] source + # @return [::Google::Cloud::SecurityCenter::V1::Source] + # Required. The source resource to update. + # @!attribute [rw] update_mask + # @return [::Google::Protobuf::FieldMask] + # The FieldMask to use when updating the source resource. + # + # If empty all mutable fields will be updated. + class UpdateSourceRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Request message for updating a SecurityMarks resource. + # @!attribute [rw] security_marks + # @return [::Google::Cloud::SecurityCenter::V1::SecurityMarks] + # Required. The security marks resource to update. + # @!attribute [rw] update_mask + # @return [::Google::Protobuf::FieldMask] + # The FieldMask to use when updating the security marks resource. + # + # The field mask must not contain duplicate fields. + # If empty or set to "marks", all marks will be replaced. Individual + # marks can be updated using "marks.". + # @!attribute [rw] start_time + # @return [::Google::Protobuf::Timestamp] + # The time at which the updated SecurityMarks take effect. + # If not set uses current server time. Updates will be applied to the + # SecurityMarks that are active immediately preceding this time. Must be + # earlier or equal to the server time. + class UpdateSecurityMarksRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Request message for creating a BigQuery export. + # @!attribute [rw] parent + # @return [::String] + # Required. The name of the parent resource of the new BigQuery export. Its + # format is `organizations/[organization_id]`, `folders/[folder_id]`, or + # `projects/[project_id]`. + # @!attribute [rw] big_query_export + # @return [::Google::Cloud::SecurityCenter::V1::BigQueryExport] + # Required. The BigQuery export being created. + # @!attribute [rw] big_query_export_id + # @return [::String] + # Required. Unique identifier provided by the client within the parent scope. + # It must consist of only lowercase letters, numbers, and hyphens, must start + # with a letter, must end with either a letter or a number, and must be 63 + # characters or less. + class CreateBigQueryExportRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Request message for updating a BigQuery export. + # @!attribute [rw] big_query_export + # @return [::Google::Cloud::SecurityCenter::V1::BigQueryExport] + # Required. The BigQuery export being updated. + # @!attribute [rw] update_mask + # @return [::Google::Protobuf::FieldMask] + # The list of fields to be updated. + # If empty all mutable fields will be updated. + class UpdateBigQueryExportRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Request message for listing BigQuery exports at a given scope e.g. + # organization, folder or project. + # @!attribute [rw] parent + # @return [::String] + # Required. The parent, which owns the collection of BigQuery exports. Its + # format is `organizations/[organization_id]`, `folders/[folder_id]`, + # `projects/[project_id]`. + # @!attribute [rw] page_size + # @return [::Integer] + # The maximum number of configs to return. The service may return fewer than + # this value. + # If unspecified, at most 10 configs will be returned. + # The maximum value is 1000; values above 1000 will be coerced to 1000. + # @!attribute [rw] page_token + # @return [::String] + # A page token, received from a previous `ListBigQueryExports` call. + # Provide this to retrieve the subsequent page. + # When paginating, all other parameters provided to `ListBigQueryExports` + # must match the call that provided the page token. + class ListBigQueryExportsRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Response message for listing BigQuery exports. + # @!attribute [rw] big_query_exports + # @return [::Array<::Google::Cloud::SecurityCenter::V1::BigQueryExport>] + # The BigQuery exports from the specified parent. + # @!attribute [rw] next_page_token + # @return [::String] + # A token, which can be sent as `page_token` to retrieve the next page. + # If this field is omitted, there are no subsequent pages. + class ListBigQueryExportsResponse + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Request message for deleting a BigQuery export. + # @!attribute [rw] name + # @return [::String] + # Required. The name of the BigQuery export to delete. Its format is + # `organizations/{organization}/bigQueryExports/{export_id}`, + # `folders/{folder}/bigQueryExports/{export_id}`, or + # `projects/{project}/bigQueryExports/{export_id}` + class DeleteBigQueryExportRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Request to create an Event Threat Detection custom module. + # @!attribute [rw] parent + # @return [::String] + # Required. The new custom module's parent. + # + # Its format is: + # + # * `organizations/{organization}/eventThreatDetectionSettings`. + # * `folders/{folder}/eventThreatDetectionSettings`. + # * `projects/{project}/eventThreatDetectionSettings`. + # @!attribute [rw] event_threat_detection_custom_module + # @return [::Google::Cloud::SecurityCenter::V1::EventThreatDetectionCustomModule] + # Required. The module to create. The + # event_threat_detection_custom_module.name will be ignored and server + # generated. + class CreateEventThreatDetectionCustomModuleRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Request to validate an Event Threat Detection custom module. + # @!attribute [rw] parent + # @return [::String] + # Required. Resource name of the parent to validate the Custom Module under. + # + # Its format is: + # + # * `organizations/{organization}/eventThreatDetectionSettings`. + # * `folders/{folder}/eventThreatDetectionSettings`. + # * `projects/{project}/eventThreatDetectionSettings`. + # @!attribute [rw] raw_text + # @return [::String] + # Required. The raw text of the module's contents. Used to generate error + # messages. + # @!attribute [rw] type + # @return [::String] + # Required. The type of the module (e.g. CONFIGURABLE_BAD_IP). + class ValidateEventThreatDetectionCustomModuleRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Response to validating an Event Threat Detection custom module. + # @!attribute [rw] errors + # @return [::Google::Cloud::SecurityCenter::V1::CustomModuleValidationErrors] + # A list of errors returned by the validator. If the list is empty, there + # were no errors. + class ValidateEventThreatDetectionCustomModuleResponse + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Request to delete an Event Threat Detection custom module. + # @!attribute [rw] name + # @return [::String] + # Required. Name of the custom module to delete. + # + # Its format is: + # + # * `organizations/{organization}/eventThreatDetectionSettings/customModules/{module}`. + # * `folders/{folder}/eventThreatDetectionSettings/customModules/{module}`. + # * `projects/{project}/eventThreatDetectionSettings/customModules/{module}`. + class DeleteEventThreatDetectionCustomModuleRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Request to get an Event Threat Detection custom module. + # @!attribute [rw] name + # @return [::String] + # Required. Name of the custom module to get. + # + # Its format is: + # + # * `organizations/{organization}/eventThreatDetectionSettings/customModules/{module}`. + # * `folders/{folder}/eventThreatDetectionSettings/customModules/{module}`. + # * `projects/{project}/eventThreatDetectionSettings/customModules/{module}`. + class GetEventThreatDetectionCustomModuleRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Request to list current and descendant resident Event Threat Detection custom + # modules. + # @!attribute [rw] parent + # @return [::String] + # Required. Name of the parent to list custom modules under. + # + # Its format is: + # + # * `organizations/{organization}/eventThreatDetectionSettings`. + # * `folders/{folder}/eventThreatDetectionSettings`. + # * `projects/{project}/eventThreatDetectionSettings`. + # @!attribute [rw] page_token + # @return [::String] + # A page token, received from a previous + # `ListDescendantEventThreatDetectionCustomModules` call. Provide this to + # retrieve the subsequent page. + # + # When paginating, all other parameters provided to + # `ListDescendantEventThreatDetectionCustomModules` must match the call that + # provided the page token. + # @!attribute [rw] page_size + # @return [::Integer] + # The maximum number of modules to return. The service may return fewer than + # this value. + # If unspecified, at most 10 configs will be returned. + # The maximum value is 1000; values above 1000 will be coerced to 1000. + class ListDescendantEventThreatDetectionCustomModulesRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Response for listing current and descendant resident + # Event Threat Detection custom modules. + # @!attribute [rw] event_threat_detection_custom_modules + # @return [::Array<::Google::Cloud::SecurityCenter::V1::EventThreatDetectionCustomModule>] + # Custom modules belonging to the requested parent. + # @!attribute [rw] next_page_token + # @return [::String] + # A token, which can be sent as `page_token` to retrieve the next page. + # If this field is omitted, there are no subsequent pages. + class ListDescendantEventThreatDetectionCustomModulesResponse + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Request to list Event Threat Detection custom modules. + # @!attribute [rw] parent + # @return [::String] + # Required. Name of the parent to list custom modules under. + # + # Its format is: + # + # * `organizations/{organization}/eventThreatDetectionSettings`. + # * `folders/{folder}/eventThreatDetectionSettings`. + # * `projects/{project}/eventThreatDetectionSettings`. + # @!attribute [rw] page_token + # @return [::String] + # A page token, received from a previous + # `ListEventThreatDetectionCustomModules` call. Provide this to retrieve the + # subsequent page. + # + # When paginating, all other parameters provided to + # `ListEventThreatDetectionCustomModules` must match the call that provided + # the page token. + # @!attribute [rw] page_size + # @return [::Integer] + # The maximum number of modules to return. The service may return fewer than + # this value. + # If unspecified, at most 10 configs will be returned. + # The maximum value is 1000; values above 1000 will be coerced to 1000. + class ListEventThreatDetectionCustomModulesRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Response for listing Event Threat Detection custom modules. + # @!attribute [rw] event_threat_detection_custom_modules + # @return [::Array<::Google::Cloud::SecurityCenter::V1::EventThreatDetectionCustomModule>] + # Custom modules belonging to the requested parent. + # @!attribute [rw] next_page_token + # @return [::String] + # A token, which can be sent as `page_token` to retrieve the next page. + # If this field is omitted, there are no subsequent pages. + class ListEventThreatDetectionCustomModulesResponse + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Request to update an Event Threat Detection custom module. + # @!attribute [rw] event_threat_detection_custom_module + # @return [::Google::Cloud::SecurityCenter::V1::EventThreatDetectionCustomModule] + # Required. The module being updated. + # @!attribute [rw] update_mask + # @return [::Google::Protobuf::FieldMask] + # The list of fields to be updated. + # If empty all mutable fields will be updated. + class UpdateEventThreatDetectionCustomModuleRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Request to get an EffectiveEventThreatDetectionCustomModule. + # @!attribute [rw] name + # @return [::String] + # Required. The resource name of the effective Event Threat Detection custom + # module. + # + # Its format is: + # + # * `organizations/{organization}/eventThreatDetectionSettings/effectiveCustomModules/{module}`. + # * `folders/{folder}/eventThreatDetectionSettings/effectiveCustomModules/{module}`. + # * `projects/{project}/eventThreatDetectionSettings/effectiveCustomModules/{module}`. + class GetEffectiveEventThreatDetectionCustomModuleRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Request to list effective Event Threat Detection custom modules. + # @!attribute [rw] parent + # @return [::String] + # Required. Name of the parent to list custom modules for. + # + # Its format is: + # + # * `organizations/{organization}/eventThreatDetectionSettings`. + # * `folders/{folder}/eventThreatDetectionSettings`. + # * `projects/{project}/eventThreatDetectionSettings`. + # @!attribute [rw] page_token + # @return [::String] + # A page token, received from a previous + # `ListEffectiveEventThreatDetectionCustomModules` call. Provide this to + # retrieve the subsequent page. + # + # When paginating, all other parameters provided to + # `ListEffectiveEventThreatDetectionCustomModules` must match the call that + # provided the page token. + # @!attribute [rw] page_size + # @return [::Integer] + # The maximum number of modules to return. The service may return fewer than + # this value. + # If unspecified, at most 10 configs will be returned. + # The maximum value is 1000; values above 1000 will be coerced to 1000. + class ListEffectiveEventThreatDetectionCustomModulesRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Response for listing EffectiveEventThreatDetectionCustomModules. + # @!attribute [rw] effective_event_threat_detection_custom_modules + # @return [::Array<::Google::Cloud::SecurityCenter::V1::EffectiveEventThreatDetectionCustomModule>] + # Effective custom modules belonging to the requested parent. + # @!attribute [rw] next_page_token + # @return [::String] + # A token, which can be sent as `page_token` to retrieve the next page. + # If this field is omitted, there are no subsequent pages. + class ListEffectiveEventThreatDetectionCustomModulesResponse + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-security_center-v1/proto_docs/google/cloud/securitycenter/v1/simulation.rb b/owl-bot-staging/google-cloud-security_center-v1/proto_docs/google/cloud/securitycenter/v1/simulation.rb new file mode 100644 index 000000000000..63924f12b411 --- /dev/null +++ b/owl-bot-staging/google-cloud-security_center-v1/proto_docs/google/cloud/securitycenter/v1/simulation.rb @@ -0,0 +1,46 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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 SecurityCenter + module V1 + # Attack path simulation + # @!attribute [rw] name + # @return [::String] + # Full resource name of the Simulation: + # `organizations/123/simulations/456` + # @!attribute [r] create_time + # @return [::Google::Protobuf::Timestamp] + # Output only. Time simulation was created + # @!attribute [rw] resource_value_configs_metadata + # @return [::Array<::Google::Cloud::SecurityCenter::V1::ResourceValueConfigMetadata>] + # Resource value configurations' metadata used in this simulation. Maximum of + # 100. + # @!attribute [rw] cloud_provider + # @return [::Google::Cloud::SecurityCenter::V1::CloudProvider] + # Indicates which cloud provider was used in this simulation. + class Simulation + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-security_center-v1/proto_docs/google/cloud/securitycenter/v1/source.rb b/owl-bot-staging/google-cloud-security_center-v1/proto_docs/google/cloud/securitycenter/v1/source.rb new file mode 100644 index 000000000000..4ccbdd08fd29 --- /dev/null +++ b/owl-bot-staging/google-cloud-security_center-v1/proto_docs/google/cloud/securitycenter/v1/source.rb @@ -0,0 +1,65 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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 SecurityCenter + module V1 + # Security Command Center finding source. A finding source + # is an entity or a mechanism that can produce a finding. A source is like a + # container of findings that come from the same scanner, logger, monitor, and + # other tools. + # @!attribute [rw] name + # @return [::String] + # The relative resource name of this source. See: + # https://cloud.google.com/apis/design/resource_names#relative_resource_name + # Example: + # "organizations/\\{organization_id}/sources/\\{source_id}" + # @!attribute [rw] display_name + # @return [::String] + # The source's display name. + # A source's display name must be unique amongst its siblings, for example, + # two sources with the same parent can't share the same display name. + # The display name must have a length between 1 and 64 characters + # (inclusive). + # @!attribute [rw] description + # @return [::String] + # The description of the source (max of 1024 characters). + # Example: + # "Web Security Scanner is a web security scanner for common + # vulnerabilities in App Engine applications. It can automatically + # scan and detect four common vulnerabilities, including cross-site-scripting + # (XSS), Flash injection, mixed content (HTTP in HTTPS), and + # outdated or insecure libraries." + # @!attribute [rw] canonical_name + # @return [::String] + # The canonical name of the finding source. It's either + # "organizations/\\{organization_id}/sources/\\{source_id}", + # "folders/\\{folder_id}/sources/\\{source_id}", or + # "projects/\\{project_number}/sources/\\{source_id}", + # depending on the closest CRM ancestor of the resource associated with the + # finding. + class Source + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-security_center-v1/proto_docs/google/cloud/securitycenter/v1/toxic_combination.rb b/owl-bot-staging/google-cloud-security_center-v1/proto_docs/google/cloud/securitycenter/v1/toxic_combination.rb new file mode 100644 index 000000000000..4ad02b3ce5f0 --- /dev/null +++ b/owl-bot-staging/google-cloud-security_center-v1/proto_docs/google/cloud/securitycenter/v1/toxic_combination.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! + + +module Google + module Cloud + module SecurityCenter + module V1 + # Contains details about a group of security issues that, when the issues + # occur together, represent a greater risk than when the issues occur + # independently. A group of such issues is referred to as a toxic combination. + # @!attribute [rw] attack_exposure_score + # @return [::Float] + # The + # [Attack exposure + # score](https://cloud.google.com/security-command-center/docs/attack-exposure-learn#attack_exposure_scores) + # of this toxic combination. The score is a measure of how much this toxic + # combination exposes one or more high-value resources to potential attack. + # @!attribute [rw] related_findings + # @return [::Array<::String>] + # List of resource names of findings associated with this toxic combination. + # For example, `organizations/123/sources/456/findings/789`. + class ToxicCombination + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-security_center-v1/proto_docs/google/cloud/securitycenter/v1/valued_resource.rb b/owl-bot-staging/google-cloud-security_center-v1/proto_docs/google/cloud/securitycenter/v1/valued_resource.rb new file mode 100644 index 000000000000..1cd95d5b43f1 --- /dev/null +++ b/owl-bot-staging/google-cloud-security_center-v1/proto_docs/google/cloud/securitycenter/v1/valued_resource.rb @@ -0,0 +1,86 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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 SecurityCenter + module V1 + # A resource that is determined to have value to a user's system + # @!attribute [rw] name + # @return [::String] + # Valued resource name, for example, + # e.g.: + # `organizations/123/simulations/456/valuedResources/789` + # @!attribute [rw] resource + # @return [::String] + # The + # [full resource + # name](https://cloud.google.com/apis/design/resource_names#full_resource_name) + # of the valued resource. + # @!attribute [rw] resource_type + # @return [::String] + # The [resource + # type](https://cloud.google.com/asset-inventory/docs/supported-asset-types) + # of the valued resource. + # @!attribute [rw] display_name + # @return [::String] + # Human-readable name of the valued resource. + # @!attribute [rw] resource_value + # @return [::Google::Cloud::SecurityCenter::V1::ValuedResource::ResourceValue] + # How valuable this resource is. + # @!attribute [rw] exposed_score + # @return [::Float] + # Exposed score for this valued resource. A value of 0 means no exposure was + # detected exposure. + # @!attribute [rw] resource_value_configs_used + # @return [::Array<::Google::Cloud::SecurityCenter::V1::ResourceValueConfigMetadata>] + # List of resource value configurations' metadata used to determine the value + # of this resource. Maximum of 100. + class ValuedResource + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # How valuable the resource is. + module ResourceValue + # The resource value isn't specified. + RESOURCE_VALUE_UNSPECIFIED = 0 + + # This is a low-value resource. + RESOURCE_VALUE_LOW = 1 + + # This is a medium-value resource. + RESOURCE_VALUE_MEDIUM = 2 + + # This is a high-value resource. + RESOURCE_VALUE_HIGH = 3 + end + end + + # Metadata about a ResourceValueConfig. For example, id and name. + # @!attribute [rw] name + # @return [::String] + # Resource value config name + class ResourceValueConfigMetadata + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-security_center-v1/proto_docs/google/cloud/securitycenter/v1/vulnerability.rb b/owl-bot-staging/google-cloud-security_center-v1/proto_docs/google/cloud/securitycenter/v1/vulnerability.rb new file mode 100644 index 000000000000..aadd507c0a50 --- /dev/null +++ b/owl-bot-staging/google-cloud-security_center-v1/proto_docs/google/cloud/securitycenter/v1/vulnerability.rb @@ -0,0 +1,336 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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 SecurityCenter + module V1 + # Refers to common vulnerability fields e.g. cve, cvss, cwe etc. + # @!attribute [rw] cve + # @return [::Google::Cloud::SecurityCenter::V1::Cve] + # CVE stands for Common Vulnerabilities and Exposures + # (https://cve.mitre.org/about/) + # @!attribute [rw] offending_package + # @return [::Google::Cloud::SecurityCenter::V1::Package] + # The offending package is relevant to the finding. + # @!attribute [rw] fixed_package + # @return [::Google::Cloud::SecurityCenter::V1::Package] + # The fixed package is relevant to the finding. + # @!attribute [rw] security_bulletin + # @return [::Google::Cloud::SecurityCenter::V1::SecurityBulletin] + # The security bulletin is relevant to this finding. + class Vulnerability + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # CVE stands for Common Vulnerabilities and Exposures. + # Information from the [CVE + # record](https://www.cve.org/ResourcesSupport/Glossary) that describes this + # vulnerability. + # @!attribute [rw] id + # @return [::String] + # The unique identifier for the vulnerability. e.g. CVE-2021-34527 + # @!attribute [rw] references + # @return [::Array<::Google::Cloud::SecurityCenter::V1::Reference>] + # Additional information about the CVE. + # e.g. https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2021-34527 + # @!attribute [rw] cvssv3 + # @return [::Google::Cloud::SecurityCenter::V1::Cvssv3] + # Describe Common Vulnerability Scoring System specified at + # https://www.first.org/cvss/v3.1/specification-document + # @!attribute [rw] upstream_fix_available + # @return [::Boolean] + # Whether upstream fix is available for the CVE. + # @!attribute [rw] impact + # @return [::Google::Cloud::SecurityCenter::V1::Cve::RiskRating] + # The potential impact of the vulnerability if it was to be exploited. + # @!attribute [rw] exploitation_activity + # @return [::Google::Cloud::SecurityCenter::V1::Cve::ExploitationActivity] + # The exploitation activity of the vulnerability in the wild. + # @!attribute [rw] observed_in_the_wild + # @return [::Boolean] + # Whether or not the vulnerability has been observed in the wild. + # @!attribute [rw] zero_day + # @return [::Boolean] + # Whether or not the vulnerability was zero day when the finding was + # published. + # @!attribute [rw] exploit_release_date + # @return [::Google::Protobuf::Timestamp] + # Date the first publicly available exploit or PoC was released. + class Cve + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # The possible values of impact of the vulnerability if it was to be + # exploited. + module RiskRating + # Invalid or empty value. + RISK_RATING_UNSPECIFIED = 0 + + # Exploitation would have little to no security impact. + LOW = 1 + + # Exploitation would enable attackers to perform activities, or could allow + # attackers to have a direct impact, but would require additional steps. + MEDIUM = 2 + + # Exploitation would enable attackers to have a notable direct impact + # without needing to overcome any major mitigating factors. + HIGH = 3 + + # Exploitation would fundamentally undermine the security of affected + # systems, enable actors to perform significant attacks with minimal + # effort, with little to no mitigating factors to overcome. + CRITICAL = 4 + end + + # The possible values of exploitation activity of the vulnerability in the + # wild. + module ExploitationActivity + # Invalid or empty value. + EXPLOITATION_ACTIVITY_UNSPECIFIED = 0 + + # Exploitation has been reported or confirmed to widely occur. + WIDE = 1 + + # Limited reported or confirmed exploitation activities. + CONFIRMED = 2 + + # Exploit is publicly available. + AVAILABLE = 3 + + # No known exploitation activity, but has a high potential for + # exploitation. + ANTICIPATED = 4 + + # No known exploitation activity. + NO_KNOWN = 5 + end + end + + # Additional Links + # @!attribute [rw] source + # @return [::String] + # Source of the reference e.g. NVD + # @!attribute [rw] uri + # @return [::String] + # Uri for the mentioned source e.g. + # https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2021-34527. + class Reference + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Common Vulnerability Scoring System version 3. + # @!attribute [rw] base_score + # @return [::Float] + # The base score is a function of the base metric scores. + # @!attribute [rw] attack_vector + # @return [::Google::Cloud::SecurityCenter::V1::Cvssv3::AttackVector] + # Base Metrics + # Represents the intrinsic characteristics of a vulnerability that are + # constant over time and across user environments. + # This metric reflects the context by which vulnerability exploitation is + # possible. + # @!attribute [rw] attack_complexity + # @return [::Google::Cloud::SecurityCenter::V1::Cvssv3::AttackComplexity] + # This metric describes the conditions beyond the attacker's control that + # must exist in order to exploit the vulnerability. + # @!attribute [rw] privileges_required + # @return [::Google::Cloud::SecurityCenter::V1::Cvssv3::PrivilegesRequired] + # This metric describes the level of privileges an attacker must possess + # before successfully exploiting the vulnerability. + # @!attribute [rw] user_interaction + # @return [::Google::Cloud::SecurityCenter::V1::Cvssv3::UserInteraction] + # This metric captures the requirement for a human user, other than the + # attacker, to participate in the successful compromise of the vulnerable + # component. + # @!attribute [rw] scope + # @return [::Google::Cloud::SecurityCenter::V1::Cvssv3::Scope] + # The Scope metric captures whether a vulnerability in one vulnerable + # component impacts resources in components beyond its security scope. + # @!attribute [rw] confidentiality_impact + # @return [::Google::Cloud::SecurityCenter::V1::Cvssv3::Impact] + # This metric measures the impact to the confidentiality of the information + # resources managed by a software component due to a successfully exploited + # vulnerability. + # @!attribute [rw] integrity_impact + # @return [::Google::Cloud::SecurityCenter::V1::Cvssv3::Impact] + # This metric measures the impact to integrity of a successfully exploited + # vulnerability. + # @!attribute [rw] availability_impact + # @return [::Google::Cloud::SecurityCenter::V1::Cvssv3::Impact] + # This metric measures the impact to the availability of the impacted + # component resulting from a successfully exploited vulnerability. + class Cvssv3 + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # This metric reflects the context by which vulnerability exploitation is + # possible. + module AttackVector + # Invalid value. + ATTACK_VECTOR_UNSPECIFIED = 0 + + # The vulnerable component is bound to the network stack and the set of + # possible attackers extends beyond the other options listed below, up to + # and including the entire Internet. + ATTACK_VECTOR_NETWORK = 1 + + # The vulnerable component is bound to the network stack, but the attack is + # limited at the protocol level to a logically adjacent topology. + ATTACK_VECTOR_ADJACENT = 2 + + # The vulnerable component is not bound to the network stack and the + # attacker's path is via read/write/execute capabilities. + ATTACK_VECTOR_LOCAL = 3 + + # The attack requires the attacker to physically touch or manipulate the + # vulnerable component. + ATTACK_VECTOR_PHYSICAL = 4 + end + + # This metric describes the conditions beyond the attacker's control that + # must exist in order to exploit the vulnerability. + module AttackComplexity + # Invalid value. + ATTACK_COMPLEXITY_UNSPECIFIED = 0 + + # Specialized access conditions or extenuating circumstances do not exist. + # An attacker can expect repeatable success when attacking the vulnerable + # component. + ATTACK_COMPLEXITY_LOW = 1 + + # A successful attack depends on conditions beyond the attacker's control. + # That is, a successful attack cannot be accomplished at will, but requires + # the attacker to invest in some measurable amount of effort in preparation + # or execution against the vulnerable component before a successful attack + # can be expected. + ATTACK_COMPLEXITY_HIGH = 2 + end + + # This metric describes the level of privileges an attacker must possess + # before successfully exploiting the vulnerability. + module PrivilegesRequired + # Invalid value. + PRIVILEGES_REQUIRED_UNSPECIFIED = 0 + + # The attacker is unauthorized prior to attack, and therefore does not + # require any access to settings or files of the vulnerable system to + # carry out an attack. + PRIVILEGES_REQUIRED_NONE = 1 + + # The attacker requires privileges that provide basic user capabilities + # that could normally affect only settings and files owned by a user. + # Alternatively, an attacker with Low privileges has the ability to access + # only non-sensitive resources. + PRIVILEGES_REQUIRED_LOW = 2 + + # The attacker requires privileges that provide significant (e.g., + # administrative) control over the vulnerable component allowing access to + # component-wide settings and files. + PRIVILEGES_REQUIRED_HIGH = 3 + end + + # This metric captures the requirement for a human user, other than the + # attacker, to participate in the successful compromise of the vulnerable + # component. + module UserInteraction + # Invalid value. + USER_INTERACTION_UNSPECIFIED = 0 + + # The vulnerable system can be exploited without interaction from any user. + USER_INTERACTION_NONE = 1 + + # Successful exploitation of this vulnerability requires a user to take + # some action before the vulnerability can be exploited. + USER_INTERACTION_REQUIRED = 2 + end + + # The Scope metric captures whether a vulnerability in one vulnerable + # component impacts resources in components beyond its security scope. + module Scope + # Invalid value. + SCOPE_UNSPECIFIED = 0 + + # An exploited vulnerability can only affect resources managed by the same + # security authority. + SCOPE_UNCHANGED = 1 + + # An exploited vulnerability can affect resources beyond the security scope + # managed by the security authority of the vulnerable component. + SCOPE_CHANGED = 2 + end + + # The Impact metrics capture the effects of a successfully exploited + # vulnerability on the component that suffers the worst outcome that is most + # directly and predictably associated with the attack. + module Impact + # Invalid value. + IMPACT_UNSPECIFIED = 0 + + # High impact. + IMPACT_HIGH = 1 + + # Low impact. + IMPACT_LOW = 2 + + # No impact. + IMPACT_NONE = 3 + end + end + + # Package is a generic definition of a package. + # @!attribute [rw] package_name + # @return [::String] + # The name of the package where the vulnerability was detected. + # @!attribute [rw] cpe_uri + # @return [::String] + # The CPE URI where the vulnerability was detected. + # @!attribute [rw] package_type + # @return [::String] + # Type of package, for example, os, maven, or go. + # @!attribute [rw] package_version + # @return [::String] + # The version of the package. + class Package + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # SecurityBulletin are notifications of vulnerabilities of Google products. + # @!attribute [rw] bulletin_id + # @return [::String] + # ID of the bulletin corresponding to the vulnerability. + # @!attribute [rw] submission_time + # @return [::Google::Protobuf::Timestamp] + # Submission time of this Security Bulletin. + # @!attribute [rw] suggested_upgrade_version + # @return [::String] + # This represents a version that the cluster receiving this notification + # should be upgraded to, based on its current version. For example, 1.15.0 + class SecurityBulletin + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-security_center-v1/proto_docs/google/iam/v1/iam_policy.rb b/owl-bot-staging/google-cloud-security_center-v1/proto_docs/google/iam/v1/iam_policy.rb new file mode 100644 index 000000000000..5445c77f8258 --- /dev/null +++ b/owl-bot-staging/google-cloud-security_center-v1/proto_docs/google/iam/v1/iam_policy.rb @@ -0,0 +1,87 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + + +module Google + module Iam + module V1 + # Request message for `SetIamPolicy` method. + # @!attribute [rw] resource + # @return [::String] + # REQUIRED: The resource for which the policy is being specified. + # See the operation documentation for the appropriate value for this field. + # @!attribute [rw] policy + # @return [::Google::Iam::V1::Policy] + # REQUIRED: The complete policy to be applied to the `resource`. The size of + # the policy is limited to a few 10s of KB. An empty policy is a + # valid policy but certain Cloud Platform services (such as Projects) + # might reject them. + # @!attribute [rw] update_mask + # @return [::Google::Protobuf::FieldMask] + # OPTIONAL: A FieldMask specifying which fields of the policy to modify. Only + # the fields in the mask will be modified. If no mask is provided, the + # following default mask is used: + # + # `paths: "bindings, etag"` + class SetIamPolicyRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Request message for `GetIamPolicy` method. + # @!attribute [rw] resource + # @return [::String] + # REQUIRED: The resource for which the policy is being requested. + # See the operation documentation for the appropriate value for this field. + # @!attribute [rw] options + # @return [::Google::Iam::V1::GetPolicyOptions] + # OPTIONAL: A `GetPolicyOptions` object for specifying options to + # `GetIamPolicy`. + class GetIamPolicyRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Request message for `TestIamPermissions` method. + # @!attribute [rw] resource + # @return [::String] + # REQUIRED: The resource for which the policy detail is being requested. + # See the operation documentation for the appropriate value for this field. + # @!attribute [rw] permissions + # @return [::Array<::String>] + # The set of permissions to check for the `resource`. Permissions with + # wildcards (such as '*' or 'storage.*') are not allowed. For more + # information see + # [IAM Overview](https://cloud.google.com/iam/docs/overview#permissions). + class TestIamPermissionsRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Response message for `TestIamPermissions` method. + # @!attribute [rw] permissions + # @return [::Array<::String>] + # A subset of `TestPermissionsRequest.permissions` that the caller is + # allowed. + class TestIamPermissionsResponse + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end + end +end diff --git a/owl-bot-staging/google-cloud-security_center-v1/proto_docs/google/iam/v1/options.rb b/owl-bot-staging/google-cloud-security_center-v1/proto_docs/google/iam/v1/options.rb new file mode 100644 index 000000000000..60713d995b86 --- /dev/null +++ b/owl-bot-staging/google-cloud-security_center-v1/proto_docs/google/iam/v1/options.rb @@ -0,0 +1,50 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + + +module Google + module Iam + module V1 + # Encapsulates settings provided to GetIamPolicy. + # @!attribute [rw] requested_policy_version + # @return [::Integer] + # Optional. The maximum policy version that will be used to format the + # policy. + # + # Valid values are 0, 1, and 3. Requests specifying an invalid value will be + # rejected. + # + # Requests for policies with any conditional role bindings must specify + # version 3. Policies with no conditional role bindings may specify any valid + # value or leave the field unset. + # + # The policy in the response might use the policy version that you specified, + # or it might use a lower policy version. For example, if you specify version + # 3, but the policy has no conditional role bindings, the response uses + # version 1. + # + # To learn which resources support conditions in their IAM policies, see the + # [IAM + # documentation](https://cloud.google.com/iam/help/conditions/resource-policies). + class GetPolicyOptions + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end + end +end diff --git a/owl-bot-staging/google-cloud-security_center-v1/proto_docs/google/iam/v1/policy.rb b/owl-bot-staging/google-cloud-security_center-v1/proto_docs/google/iam/v1/policy.rb new file mode 100644 index 000000000000..999575b797df --- /dev/null +++ b/owl-bot-staging/google-cloud-security_center-v1/proto_docs/google/iam/v1/policy.rb @@ -0,0 +1,426 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + + +module Google + module Iam + module V1 + # An Identity and Access Management (IAM) policy, which specifies access + # controls for Google Cloud resources. + # + # + # A `Policy` is a collection of `bindings`. A `binding` binds one or more + # `members`, or principals, to a single `role`. Principals can be user + # accounts, service accounts, Google groups, and domains (such as G Suite). A + # `role` is a named list of permissions; each `role` can be an IAM predefined + # role or a user-created custom role. + # + # For some types of Google Cloud resources, a `binding` can also specify a + # `condition`, which is a logical expression that allows access to a resource + # only if the expression evaluates to `true`. A condition can add constraints + # based on attributes of the request, the resource, or both. To learn which + # resources support conditions in their IAM policies, see the + # [IAM + # documentation](https://cloud.google.com/iam/help/conditions/resource-policies). + # + # **JSON example:** + # + # ``` + # { + # "bindings": [ + # { + # "role": "roles/resourcemanager.organizationAdmin", + # "members": [ + # "user:mike@example.com", + # "group:admins@example.com", + # "domain:google.com", + # "serviceAccount:my-project-id@appspot.gserviceaccount.com" + # ] + # }, + # { + # "role": "roles/resourcemanager.organizationViewer", + # "members": [ + # "user:eve@example.com" + # ], + # "condition": { + # "title": "expirable access", + # "description": "Does not grant access after Sep 2020", + # "expression": "request.time < + # timestamp('2020-10-01T00:00:00.000Z')", + # } + # } + # ], + # "etag": "BwWWja0YfJA=", + # "version": 3 + # } + # ``` + # + # **YAML example:** + # + # ``` + # bindings: + # - members: + # - user:mike@example.com + # - group:admins@example.com + # - domain:google.com + # - serviceAccount:my-project-id@appspot.gserviceaccount.com + # role: roles/resourcemanager.organizationAdmin + # - members: + # - user:eve@example.com + # role: roles/resourcemanager.organizationViewer + # condition: + # title: expirable access + # description: Does not grant access after Sep 2020 + # expression: request.time < timestamp('2020-10-01T00:00:00.000Z') + # etag: BwWWja0YfJA= + # version: 3 + # ``` + # + # For a description of IAM and its features, see the + # [IAM documentation](https://cloud.google.com/iam/docs/). + # @!attribute [rw] version + # @return [::Integer] + # Specifies the format of the policy. + # + # Valid values are `0`, `1`, and `3`. Requests that specify an invalid value + # are rejected. + # + # Any operation that affects conditional role bindings must specify version + # `3`. This requirement applies to the following operations: + # + # * Getting a policy that includes a conditional role binding + # * Adding a conditional role binding to a policy + # * Changing a conditional role binding in a policy + # * Removing any role binding, with or without a condition, from a policy + # that includes conditions + # + # **Important:** If you use IAM Conditions, you must include the `etag` field + # whenever you call `setIamPolicy`. If you omit this field, then IAM allows + # you to overwrite a version `3` policy with a version `1` policy, and all of + # the conditions in the version `3` policy are lost. + # + # If a policy does not include any conditions, operations on that policy may + # specify any valid version or leave the field unset. + # + # To learn which resources support conditions in their IAM policies, see the + # [IAM + # documentation](https://cloud.google.com/iam/help/conditions/resource-policies). + # @!attribute [rw] bindings + # @return [::Array<::Google::Iam::V1::Binding>] + # Associates a list of `members`, or principals, with a `role`. Optionally, + # may specify a `condition` that determines how and when the `bindings` are + # applied. Each of the `bindings` must contain at least one principal. + # + # The `bindings` in a `Policy` can refer to up to 1,500 principals; up to 250 + # of these principals can be Google groups. Each occurrence of a principal + # counts towards these limits. For example, if the `bindings` grant 50 + # different roles to `user:alice@example.com`, and not to any other + # principal, then you can add another 1,450 principals to the `bindings` in + # the `Policy`. + # @!attribute [rw] audit_configs + # @return [::Array<::Google::Iam::V1::AuditConfig>] + # Specifies cloud audit logging configuration for this policy. + # @!attribute [rw] etag + # @return [::String] + # `etag` is used for optimistic concurrency control as a way to help + # prevent simultaneous updates of a policy from overwriting each other. + # It is strongly suggested that systems make use of the `etag` in the + # read-modify-write cycle to perform policy updates in order to avoid race + # conditions: An `etag` is returned in the response to `getIamPolicy`, and + # systems are expected to put that etag in the request to `setIamPolicy` to + # ensure that their change will be applied to the same version of the policy. + # + # **Important:** If you use IAM Conditions, you must include the `etag` field + # whenever you call `setIamPolicy`. If you omit this field, then IAM allows + # you to overwrite a version `3` policy with a version `1` policy, and all of + # the conditions in the version `3` policy are lost. + class Policy + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Associates `members`, or principals, with a `role`. + # @!attribute [rw] role + # @return [::String] + # Role that is assigned to the list of `members`, or principals. + # For example, `roles/viewer`, `roles/editor`, or `roles/owner`. + # @!attribute [rw] members + # @return [::Array<::String>] + # Specifies the principals requesting access for a Google Cloud resource. + # `members` can have the following values: + # + # * `allUsers`: A special identifier that represents anyone who is + # on the internet; with or without a Google account. + # + # * `allAuthenticatedUsers`: A special identifier that represents anyone + # who is authenticated with a Google account or a service account. + # + # * `user:{emailid}`: An email address that represents a specific Google + # account. For example, `alice@example.com` . + # + # + # * `serviceAccount:{emailid}`: An email address that represents a service + # account. For example, `my-other-app@appspot.gserviceaccount.com`. + # + # * `group:{emailid}`: An email address that represents a Google group. + # For example, `admins@example.com`. + # + # * `deleted:user:{emailid}?uid={uniqueid}`: An email address (plus unique + # identifier) representing a user that has been recently deleted. For + # example, `alice@example.com?uid=123456789012345678901`. If the user is + # recovered, this value reverts to `user:{emailid}` and the recovered user + # retains the role in the binding. + # + # * `deleted:serviceAccount:{emailid}?uid={uniqueid}`: An email address (plus + # unique identifier) representing a service account that has been recently + # deleted. For example, + # `my-other-app@appspot.gserviceaccount.com?uid=123456789012345678901`. + # If the service account is undeleted, this value reverts to + # `serviceAccount:{emailid}` and the undeleted service account retains the + # role in the binding. + # + # * `deleted:group:{emailid}?uid={uniqueid}`: An email address (plus unique + # identifier) representing a Google group that has been recently + # deleted. For example, `admins@example.com?uid=123456789012345678901`. If + # the group is recovered, this value reverts to `group:{emailid}` and the + # recovered group retains the role in the binding. + # + # + # * `domain:{domain}`: The G Suite domain (primary) that represents all the + # users of that domain. For example, `google.com` or `example.com`. + # @!attribute [rw] condition + # @return [::Google::Type::Expr] + # The condition that is associated with this binding. + # + # If the condition evaluates to `true`, then this binding applies to the + # current request. + # + # If the condition evaluates to `false`, then this binding does not apply to + # the current request. However, a different role binding might grant the same + # role to one or more of the principals in this binding. + # + # To learn which resources support conditions in their IAM policies, see the + # [IAM + # documentation](https://cloud.google.com/iam/help/conditions/resource-policies). + class Binding + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Specifies the audit configuration for a service. + # The configuration determines which permission types are logged, and what + # identities, if any, are exempted from logging. + # An AuditConfig must have one or more AuditLogConfigs. + # + # If there are AuditConfigs for both `allServices` and a specific service, + # the union of the two AuditConfigs is used for that service: the log_types + # specified in each AuditConfig are enabled, and the exempted_members in each + # AuditLogConfig are exempted. + # + # Example Policy with multiple AuditConfigs: + # + # { + # "audit_configs": [ + # { + # "service": "allServices", + # "audit_log_configs": [ + # { + # "log_type": "DATA_READ", + # "exempted_members": [ + # "user:jose@example.com" + # ] + # }, + # { + # "log_type": "DATA_WRITE" + # }, + # { + # "log_type": "ADMIN_READ" + # } + # ] + # }, + # { + # "service": "sampleservice.googleapis.com", + # "audit_log_configs": [ + # { + # "log_type": "DATA_READ" + # }, + # { + # "log_type": "DATA_WRITE", + # "exempted_members": [ + # "user:aliya@example.com" + # ] + # } + # ] + # } + # ] + # } + # + # For sampleservice, this policy enables DATA_READ, DATA_WRITE and ADMIN_READ + # logging. It also exempts `jose@example.com` from DATA_READ logging, and + # `aliya@example.com` from DATA_WRITE logging. + # @!attribute [rw] service + # @return [::String] + # Specifies a service that will be enabled for audit logging. + # For example, `storage.googleapis.com`, `cloudsql.googleapis.com`. + # `allServices` is a special value that covers all services. + # @!attribute [rw] audit_log_configs + # @return [::Array<::Google::Iam::V1::AuditLogConfig>] + # The configuration for logging of each type of permission. + class AuditConfig + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Provides the configuration for logging a type of permissions. + # Example: + # + # { + # "audit_log_configs": [ + # { + # "log_type": "DATA_READ", + # "exempted_members": [ + # "user:jose@example.com" + # ] + # }, + # { + # "log_type": "DATA_WRITE" + # } + # ] + # } + # + # This enables 'DATA_READ' and 'DATA_WRITE' logging, while exempting + # jose@example.com from DATA_READ logging. + # @!attribute [rw] log_type + # @return [::Google::Iam::V1::AuditLogConfig::LogType] + # The log type that this config enables. + # @!attribute [rw] exempted_members + # @return [::Array<::String>] + # Specifies the identities that do not cause logging for this type of + # permission. + # Follows the same format of + # [Binding.members][google.iam.v1.Binding.members]. + class AuditLogConfig + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # The list of valid permission types for which logging can be configured. + # Admin writes are always logged, and are not configurable. + module LogType + # Default case. Should never be this. + LOG_TYPE_UNSPECIFIED = 0 + + # Admin reads. Example: CloudIAM getIamPolicy + ADMIN_READ = 1 + + # Data writes. Example: CloudSQL Users create + DATA_WRITE = 2 + + # Data reads. Example: CloudSQL Users list + DATA_READ = 3 + end + end + + # The difference delta between two policies. + # @!attribute [rw] binding_deltas + # @return [::Array<::Google::Iam::V1::BindingDelta>] + # The delta for Bindings between two policies. + # @!attribute [rw] audit_config_deltas + # @return [::Array<::Google::Iam::V1::AuditConfigDelta>] + # The delta for AuditConfigs between two policies. + class PolicyDelta + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # One delta entry for Binding. Each individual change (only one member in each + # entry) to a binding will be a separate entry. + # @!attribute [rw] action + # @return [::Google::Iam::V1::BindingDelta::Action] + # The action that was performed on a Binding. + # Required + # @!attribute [rw] role + # @return [::String] + # Role that is assigned to `members`. + # For example, `roles/viewer`, `roles/editor`, or `roles/owner`. + # Required + # @!attribute [rw] member + # @return [::String] + # A single identity requesting access for a Google Cloud resource. + # Follows the same format of Binding.members. + # Required + # @!attribute [rw] condition + # @return [::Google::Type::Expr] + # The condition that is associated with this binding. + class BindingDelta + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # The type of action performed on a Binding in a policy. + module Action + # Unspecified. + ACTION_UNSPECIFIED = 0 + + # Addition of a Binding. + ADD = 1 + + # Removal of a Binding. + REMOVE = 2 + end + end + + # One delta entry for AuditConfig. Each individual change (only one + # exempted_member in each entry) to a AuditConfig will be a separate entry. + # @!attribute [rw] action + # @return [::Google::Iam::V1::AuditConfigDelta::Action] + # The action that was performed on an audit configuration in a policy. + # Required + # @!attribute [rw] service + # @return [::String] + # Specifies a service that was configured for Cloud Audit Logging. + # For example, `storage.googleapis.com`, `cloudsql.googleapis.com`. + # `allServices` is a special value that covers all services. + # Required + # @!attribute [rw] exempted_member + # @return [::String] + # A single identity that is exempted from "data access" audit + # logging for the `service` specified above. + # Follows the same format of Binding.members. + # @!attribute [rw] log_type + # @return [::String] + # Specifies the log_type that was be enabled. ADMIN_ACTIVITY is always + # enabled, and cannot be configured. + # Required + class AuditConfigDelta + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # The type of action performed on an audit configuration in a policy. + module Action + # Unspecified. + ACTION_UNSPECIFIED = 0 + + # Addition of an audit configuration. + ADD = 1 + + # Removal of an audit configuration. + REMOVE = 2 + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-security_center-v1/proto_docs/google/longrunning/operations.rb b/owl-bot-staging/google-cloud-security_center-v1/proto_docs/google/longrunning/operations.rb new file mode 100644 index 000000000000..7a757f512165 --- /dev/null +++ b/owl-bot-staging/google-cloud-security_center-v1/proto_docs/google/longrunning/operations.rb @@ -0,0 +1,191 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + + +module Google + module Longrunning + # This resource represents a long-running operation that is the result of a + # network API call. + # @!attribute [rw] name + # @return [::String] + # The server-assigned name, which is only unique within the same service that + # originally returns it. If you use the default HTTP mapping, the + # `name` should be a resource name ending with `operations/{unique_id}`. + # @!attribute [rw] metadata + # @return [::Google::Protobuf::Any] + # Service-specific metadata associated with the operation. It typically + # contains progress information and common metadata such as create time. + # Some services might not provide such metadata. Any method that returns a + # long-running operation should document the metadata type, if any. + # @!attribute [rw] done + # @return [::Boolean] + # If the value is `false`, it means the operation is still in progress. + # If `true`, the operation is completed, and either `error` or `response` is + # available. + # @!attribute [rw] error + # @return [::Google::Rpc::Status] + # The error result of the operation in case of failure or cancellation. + # + # Note: The following fields are mutually exclusive: `error`, `response`. If a field in that set is populated, all other fields in the set will automatically be cleared. + # @!attribute [rw] response + # @return [::Google::Protobuf::Any] + # The normal, successful response of the operation. If the original + # method returns no data on success, such as `Delete`, the response is + # `google.protobuf.Empty`. If the original method is standard + # `Get`/`Create`/`Update`, the response should be the resource. For other + # methods, the response should have the type `XxxResponse`, where `Xxx` + # is the original method name. For example, if the original method name + # is `TakeSnapshot()`, the inferred response type is + # `TakeSnapshotResponse`. + # + # Note: The following fields are mutually exclusive: `response`, `error`. If a field in that set is populated, all other fields in the set will automatically be cleared. + class Operation + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # The request message for + # Operations.GetOperation. + # @!attribute [rw] name + # @return [::String] + # The name of the operation resource. + class GetOperationRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # The request message for + # Operations.ListOperations. + # @!attribute [rw] name + # @return [::String] + # The name of the operation's parent resource. + # @!attribute [rw] filter + # @return [::String] + # The standard list filter. + # @!attribute [rw] page_size + # @return [::Integer] + # The standard list page size. + # @!attribute [rw] page_token + # @return [::String] + # The standard list page token. + # @!attribute [rw] return_partial_success + # @return [::Boolean] + # When set to `true`, operations that are reachable are returned as normal, + # and those that are unreachable are returned in the + # [ListOperationsResponse.unreachable] field. + # + # This can only be `true` when reading across collections e.g. when `parent` + # is set to `"projects/example/locations/-"`. + # + # This field is not by default supported and will result in an + # `UNIMPLEMENTED` error if set unless explicitly documented otherwise in + # service or product specific documentation. + class ListOperationsRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # The response message for + # Operations.ListOperations. + # @!attribute [rw] operations + # @return [::Array<::Google::Longrunning::Operation>] + # A list of operations that matches the specified filter in the request. + # @!attribute [rw] next_page_token + # @return [::String] + # The standard List next-page token. + # @!attribute [rw] unreachable + # @return [::Array<::String>] + # Unordered list. Unreachable resources. Populated when the request sets + # `ListOperationsRequest.return_partial_success` and reads across + # collections e.g. when attempting to list all resources across all supported + # locations. + class ListOperationsResponse + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # The request message for + # Operations.CancelOperation. + # @!attribute [rw] name + # @return [::String] + # The name of the operation resource to be cancelled. + class CancelOperationRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # The request message for + # Operations.DeleteOperation. + # @!attribute [rw] name + # @return [::String] + # The name of the operation resource to be deleted. + class DeleteOperationRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # The request message for + # Operations.WaitOperation. + # @!attribute [rw] name + # @return [::String] + # The name of the operation resource to wait on. + # @!attribute [rw] timeout + # @return [::Google::Protobuf::Duration] + # The maximum duration to wait before timing out. If left blank, the wait + # will be at most the time permitted by the underlying HTTP/RPC protocol. + # If RPC context deadline is also specified, the shorter one will be used. + class WaitOperationRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # A message representing the message types used by a long-running operation. + # + # Example: + # + # rpc Export(ExportRequest) returns (google.longrunning.Operation) { + # option (google.longrunning.operation_info) = { + # response_type: "ExportResponse" + # metadata_type: "ExportMetadata" + # }; + # } + # @!attribute [rw] response_type + # @return [::String] + # Required. The message name of the primary return type for this + # long-running operation. + # This type will be used to deserialize the LRO's response. + # + # If the response is in a different package from the rpc, a fully-qualified + # message name must be used (e.g. `google.protobuf.Struct`). + # + # Note: Altering this value constitutes a breaking change. + # @!attribute [rw] metadata_type + # @return [::String] + # Required. The message name of the metadata type for this long-running + # operation. + # + # If the response is in a different package from the rpc, a fully-qualified + # message name must be used (e.g. `google.protobuf.Struct`). + # + # Note: Altering this value constitutes a breaking change. + class OperationInfo + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end +end diff --git a/owl-bot-staging/google-cloud-security_center-v1/proto_docs/google/protobuf/any.rb b/owl-bot-staging/google-cloud-security_center-v1/proto_docs/google/protobuf/any.rb new file mode 100644 index 000000000000..58691995f02e --- /dev/null +++ b/owl-bot-staging/google-cloud-security_center-v1/proto_docs/google/protobuf/any.rb @@ -0,0 +1,145 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + + +module Google + module Protobuf + # `Any` contains an arbitrary serialized protocol buffer message along with a + # URL that describes the type of the serialized message. + # + # Protobuf library provides support to pack/unpack Any values in the form + # of utility functions or additional generated methods of the Any type. + # + # Example 1: Pack and unpack a message in C++. + # + # Foo foo = ...; + # Any any; + # any.PackFrom(foo); + # ... + # if (any.UnpackTo(&foo)) { + # ... + # } + # + # Example 2: Pack and unpack a message in Java. + # + # Foo foo = ...; + # Any any = Any.pack(foo); + # ... + # if (any.is(Foo.class)) { + # foo = any.unpack(Foo.class); + # } + # // or ... + # if (any.isSameTypeAs(Foo.getDefaultInstance())) { + # foo = any.unpack(Foo.getDefaultInstance()); + # } + # + # Example 3: Pack and unpack a message in Python. + # + # foo = Foo(...) + # any = Any() + # any.Pack(foo) + # ... + # if any.Is(Foo.DESCRIPTOR): + # any.Unpack(foo) + # ... + # + # Example 4: Pack and unpack a message in Go + # + # foo := &pb.Foo{...} + # any, err := anypb.New(foo) + # if err != nil { + # ... + # } + # ... + # foo := &pb.Foo{} + # if err := any.UnmarshalTo(foo); err != nil { + # ... + # } + # + # The pack methods provided by protobuf library will by default use + # 'type.googleapis.com/full.type.name' as the type URL and the unpack + # methods only use the fully qualified type name after the last '/' + # in the type URL, for example "foo.bar.com/x/y.z" will yield type + # name "y.z". + # + # JSON + # ==== + # The JSON representation of an `Any` value uses the regular + # representation of the deserialized, embedded message, with an + # additional field `@type` which contains the type URL. Example: + # + # package google.profile; + # message Person { + # string first_name = 1; + # string last_name = 2; + # } + # + # { + # "@type": "type.googleapis.com/google.profile.Person", + # "firstName": , + # "lastName": + # } + # + # If the embedded message type is well-known and has a custom JSON + # representation, that representation will be embedded adding a field + # `value` which holds the custom JSON in addition to the `@type` + # field. Example (for message [google.protobuf.Duration][]): + # + # { + # "@type": "type.googleapis.com/google.protobuf.Duration", + # "value": "1.212s" + # } + # @!attribute [rw] type_url + # @return [::String] + # A URL/resource name that uniquely identifies the type of the serialized + # protocol buffer message. This string must contain at least + # one "/" character. The last segment of the URL's path must represent + # the fully qualified name of the type (as in + # `path/google.protobuf.Duration`). The name should be in a canonical form + # (e.g., leading "." is not accepted). + # + # In practice, teams usually precompile into the binary all types that they + # expect it to use in the context of Any. However, for URLs which use the + # scheme `http`, `https`, or no scheme, one can optionally set up a type + # server that maps type URLs to message definitions as follows: + # + # * If no scheme is provided, `https` is assumed. + # * An HTTP GET on the URL must yield a [google.protobuf.Type][] + # value in binary format, or produce an error. + # * Applications are allowed to cache lookup results based on the + # URL, or have them precompiled into a binary to avoid any + # lookup. Therefore, binary compatibility needs to be preserved + # on changes to types. (Use versioned type names to manage + # breaking changes.) + # + # Note: this functionality is not currently available in the official + # protobuf release, and it is not used for type URLs beginning with + # type.googleapis.com. As of May 2023, there are no widely used type server + # implementations and no plans to implement one. + # + # Schemes other than `http`, `https` (or the empty scheme) might be + # used with implementation specific semantics. + # @!attribute [rw] value + # @return [::String] + # Must be a valid serialized protocol buffer of the above specified type. + class Any + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end +end diff --git a/owl-bot-staging/google-cloud-security_center-v1/proto_docs/google/protobuf/duration.rb b/owl-bot-staging/google-cloud-security_center-v1/proto_docs/google/protobuf/duration.rb new file mode 100644 index 000000000000..ea59f1f91daf --- /dev/null +++ b/owl-bot-staging/google-cloud-security_center-v1/proto_docs/google/protobuf/duration.rb @@ -0,0 +1,98 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + + +module Google + module Protobuf + # A Duration represents a signed, fixed-length span of time represented + # as a count of seconds and fractions of seconds at nanosecond + # resolution. It is independent of any calendar and concepts like "day" + # or "month". It is related to Timestamp in that the difference between + # two Timestamp values is a Duration and it can be added or subtracted + # from a Timestamp. Range is approximately +-10,000 years. + # + # # Examples + # + # Example 1: Compute Duration from two Timestamps in pseudo code. + # + # Timestamp start = ...; + # Timestamp end = ...; + # Duration duration = ...; + # + # duration.seconds = end.seconds - start.seconds; + # duration.nanos = end.nanos - start.nanos; + # + # if (duration.seconds < 0 && duration.nanos > 0) { + # duration.seconds += 1; + # duration.nanos -= 1000000000; + # } else if (duration.seconds > 0 && duration.nanos < 0) { + # duration.seconds -= 1; + # duration.nanos += 1000000000; + # } + # + # Example 2: Compute Timestamp from Timestamp + Duration in pseudo code. + # + # Timestamp start = ...; + # Duration duration = ...; + # Timestamp end = ...; + # + # end.seconds = start.seconds + duration.seconds; + # end.nanos = start.nanos + duration.nanos; + # + # if (end.nanos < 0) { + # end.seconds -= 1; + # end.nanos += 1000000000; + # } else if (end.nanos >= 1000000000) { + # end.seconds += 1; + # end.nanos -= 1000000000; + # } + # + # Example 3: Compute Duration from datetime.timedelta in Python. + # + # td = datetime.timedelta(days=3, minutes=10) + # duration = Duration() + # duration.FromTimedelta(td) + # + # # JSON Mapping + # + # In JSON format, the Duration type is encoded as a string rather than an + # object, where the string ends in the suffix "s" (indicating seconds) and + # is preceded by the number of seconds, with nanoseconds expressed as + # fractional seconds. For example, 3 seconds with 0 nanoseconds should be + # encoded in JSON format as "3s", while 3 seconds and 1 nanosecond should + # be expressed in JSON format as "3.000000001s", and 3 seconds and 1 + # microsecond should be expressed in JSON format as "3.000001s". + # @!attribute [rw] seconds + # @return [::Integer] + # Signed seconds of the span of time. Must be from -315,576,000,000 + # to +315,576,000,000 inclusive. Note: these bounds are computed from: + # 60 sec/min * 60 min/hr * 24 hr/day * 365.25 days/year * 10000 years + # @!attribute [rw] nanos + # @return [::Integer] + # Signed fractions of a second at nanosecond resolution of the span + # of time. Durations less than one second are represented with a 0 + # `seconds` field and a positive or negative `nanos` field. For durations + # of one second or more, a non-zero value for the `nanos` field must be + # of the same sign as the `seconds` field. Must be from -999,999,999 + # to +999,999,999 inclusive. + class Duration + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end +end diff --git a/owl-bot-staging/google-cloud-security_center-v1/proto_docs/google/protobuf/empty.rb b/owl-bot-staging/google-cloud-security_center-v1/proto_docs/google/protobuf/empty.rb new file mode 100644 index 000000000000..83e4481834a6 --- /dev/null +++ b/owl-bot-staging/google-cloud-security_center-v1/proto_docs/google/protobuf/empty.rb @@ -0,0 +1,34 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + + +module Google + module Protobuf + # A generic empty message that you can re-use to avoid defining duplicated + # empty messages in your APIs. A typical example is to use it as the request + # or the response type of an API method. For instance: + # + # service Foo { + # rpc Bar(google.protobuf.Empty) returns (google.protobuf.Empty); + # } + class Empty + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end +end diff --git a/owl-bot-staging/google-cloud-security_center-v1/proto_docs/google/protobuf/field_mask.rb b/owl-bot-staging/google-cloud-security_center-v1/proto_docs/google/protobuf/field_mask.rb new file mode 100644 index 000000000000..7f3ffc78601a --- /dev/null +++ b/owl-bot-staging/google-cloud-security_center-v1/proto_docs/google/protobuf/field_mask.rb @@ -0,0 +1,229 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + + +module Google + module Protobuf + # `FieldMask` represents a set of symbolic field paths, for example: + # + # paths: "f.a" + # paths: "f.b.d" + # + # Here `f` represents a field in some root message, `a` and `b` + # fields in the message found in `f`, and `d` a field found in the + # message in `f.b`. + # + # Field masks are used to specify a subset of fields that should be + # returned by a get operation or modified by an update operation. + # Field masks also have a custom JSON encoding (see below). + # + # # Field Masks in Projections + # + # When used in the context of a projection, a response message or + # sub-message is filtered by the API to only contain those fields as + # specified in the mask. For example, if the mask in the previous + # example is applied to a response message as follows: + # + # f { + # a : 22 + # b { + # d : 1 + # x : 2 + # } + # y : 13 + # } + # z: 8 + # + # The result will not contain specific values for fields x,y and z + # (their value will be set to the default, and omitted in proto text + # output): + # + # + # f { + # a : 22 + # b { + # d : 1 + # } + # } + # + # A repeated field is not allowed except at the last position of a + # paths string. + # + # If a FieldMask object is not present in a get operation, the + # operation applies to all fields (as if a FieldMask of all fields + # had been specified). + # + # Note that a field mask does not necessarily apply to the + # top-level response message. In case of a REST get operation, the + # field mask applies directly to the response, but in case of a REST + # list operation, the mask instead applies to each individual message + # in the returned resource list. In case of a REST custom method, + # other definitions may be used. Where the mask applies will be + # clearly documented together with its declaration in the API. In + # any case, the effect on the returned resource/resources is required + # behavior for APIs. + # + # # Field Masks in Update Operations + # + # A field mask in update operations specifies which fields of the + # targeted resource are going to be updated. The API is required + # to only change the values of the fields as specified in the mask + # and leave the others untouched. If a resource is passed in to + # describe the updated values, the API ignores the values of all + # fields not covered by the mask. + # + # If a repeated field is specified for an update operation, new values will + # be appended to the existing repeated field in the target resource. Note that + # a repeated field is only allowed in the last position of a `paths` string. + # + # If a sub-message is specified in the last position of the field mask for an + # update operation, then new value will be merged into the existing sub-message + # in the target resource. + # + # For example, given the target message: + # + # f { + # b { + # d: 1 + # x: 2 + # } + # c: [1] + # } + # + # And an update message: + # + # f { + # b { + # d: 10 + # } + # c: [2] + # } + # + # then if the field mask is: + # + # paths: ["f.b", "f.c"] + # + # then the result will be: + # + # f { + # b { + # d: 10 + # x: 2 + # } + # c: [1, 2] + # } + # + # An implementation may provide options to override this default behavior for + # repeated and message fields. + # + # In order to reset a field's value to the default, the field must + # be in the mask and set to the default value in the provided resource. + # Hence, in order to reset all fields of a resource, provide a default + # instance of the resource and set all fields in the mask, or do + # not provide a mask as described below. + # + # If a field mask is not present on update, the operation applies to + # all fields (as if a field mask of all fields has been specified). + # Note that in the presence of schema evolution, this may mean that + # fields the client does not know and has therefore not filled into + # the request will be reset to their default. If this is unwanted + # behavior, a specific service may require a client to always specify + # a field mask, producing an error if not. + # + # As with get operations, the location of the resource which + # describes the updated values in the request message depends on the + # operation kind. In any case, the effect of the field mask is + # required to be honored by the API. + # + # ## Considerations for HTTP REST + # + # The HTTP kind of an update operation which uses a field mask must + # be set to PATCH instead of PUT in order to satisfy HTTP semantics + # (PUT must only be used for full updates). + # + # # JSON Encoding of Field Masks + # + # In JSON, a field mask is encoded as a single string where paths are + # separated by a comma. Fields name in each path are converted + # to/from lower-camel naming conventions. + # + # As an example, consider the following message declarations: + # + # message Profile { + # User user = 1; + # Photo photo = 2; + # } + # message User { + # string display_name = 1; + # string address = 2; + # } + # + # In proto a field mask for `Profile` may look as such: + # + # mask { + # paths: "user.display_name" + # paths: "photo" + # } + # + # In JSON, the same mask is represented as below: + # + # { + # mask: "user.displayName,photo" + # } + # + # # Field Masks and Oneof Fields + # + # Field masks treat fields in oneofs just as regular fields. Consider the + # following message: + # + # message SampleMessage { + # oneof test_oneof { + # string name = 4; + # SubMessage sub_message = 9; + # } + # } + # + # The field mask can be: + # + # mask { + # paths: "name" + # } + # + # Or: + # + # mask { + # paths: "sub_message" + # } + # + # Note that oneof type names ("test_oneof" in this case) cannot be used in + # paths. + # + # ## Field Mask Verification + # + # The implementation of any API method which has a FieldMask type field in the + # request should verify the included field paths, and return an + # `INVALID_ARGUMENT` error if any path is unmappable. + # @!attribute [rw] paths + # @return [::Array<::String>] + # The set of field mask paths. + class FieldMask + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end +end diff --git a/owl-bot-staging/google-cloud-security_center-v1/proto_docs/google/protobuf/struct.rb b/owl-bot-staging/google-cloud-security_center-v1/proto_docs/google/protobuf/struct.rb new file mode 100644 index 000000000000..39e1aca868d2 --- /dev/null +++ b/owl-bot-staging/google-cloud-security_center-v1/proto_docs/google/protobuf/struct.rb @@ -0,0 +1,108 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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 + # `Struct` represents a structured data value, consisting of fields + # which map to dynamically typed values. In some languages, `Struct` + # might be supported by a native representation. For example, in + # scripting languages like JS a struct is represented as an + # object. The details of that representation are described together + # with the proto support for the language. + # + # The JSON representation for `Struct` is JSON object. + # @!attribute [rw] fields + # @return [::Google::Protobuf::Map{::String => ::Google::Protobuf::Value}] + # Unordered map of dynamically typed values. + class Struct + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # @!attribute [rw] key + # @return [::String] + # @!attribute [rw] value + # @return [::Google::Protobuf::Value] + class FieldsEntry + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end + + # `Value` represents a dynamically typed value which can be either + # null, a number, a string, a boolean, a recursive struct value, or a + # list of values. A producer of value is expected to set one of these + # variants. Absence of any variant indicates an error. + # + # The JSON representation for `Value` is JSON value. + # @!attribute [rw] null_value + # @return [::Google::Protobuf::NullValue] + # Represents a null value. + # + # Note: The following fields are mutually exclusive: `null_value`, `number_value`, `string_value`, `bool_value`, `struct_value`, `list_value`. If a field in that set is populated, all other fields in the set will automatically be cleared. + # @!attribute [rw] number_value + # @return [::Float] + # Represents a double value. + # + # Note: The following fields are mutually exclusive: `number_value`, `null_value`, `string_value`, `bool_value`, `struct_value`, `list_value`. If a field in that set is populated, all other fields in the set will automatically be cleared. + # @!attribute [rw] string_value + # @return [::String] + # Represents a string value. + # + # Note: The following fields are mutually exclusive: `string_value`, `null_value`, `number_value`, `bool_value`, `struct_value`, `list_value`. If a field in that set is populated, all other fields in the set will automatically be cleared. + # @!attribute [rw] bool_value + # @return [::Boolean] + # Represents a boolean value. + # + # Note: The following fields are mutually exclusive: `bool_value`, `null_value`, `number_value`, `string_value`, `struct_value`, `list_value`. If a field in that set is populated, all other fields in the set will automatically be cleared. + # @!attribute [rw] struct_value + # @return [::Google::Protobuf::Struct] + # Represents a structured value. + # + # Note: The following fields are mutually exclusive: `struct_value`, `null_value`, `number_value`, `string_value`, `bool_value`, `list_value`. If a field in that set is populated, all other fields in the set will automatically be cleared. + # @!attribute [rw] list_value + # @return [::Google::Protobuf::ListValue] + # Represents a repeated `Value`. + # + # Note: The following fields are mutually exclusive: `list_value`, `null_value`, `number_value`, `string_value`, `bool_value`, `struct_value`. If a field in that set is populated, all other fields in the set will automatically be cleared. + class Value + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # `ListValue` is a wrapper around a repeated field of values. + # + # The JSON representation for `ListValue` is JSON array. + # @!attribute [rw] values + # @return [::Array<::Google::Protobuf::Value>] + # Repeated field of dynamically typed values. + class ListValue + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # `NullValue` is a singleton enumeration to represent the null value for the + # `Value` type union. + # + # The JSON representation for `NullValue` is JSON `null`. + module NullValue + # Null value. + NULL_VALUE = 0 + end + end +end diff --git a/owl-bot-staging/google-cloud-security_center-v1/proto_docs/google/protobuf/timestamp.rb b/owl-bot-staging/google-cloud-security_center-v1/proto_docs/google/protobuf/timestamp.rb new file mode 100644 index 000000000000..74352be9c58c --- /dev/null +++ b/owl-bot-staging/google-cloud-security_center-v1/proto_docs/google/protobuf/timestamp.rb @@ -0,0 +1,127 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + + +module Google + module Protobuf + # A Timestamp represents a point in time independent of any time zone or local + # calendar, encoded as a count of seconds and fractions of seconds at + # nanosecond resolution. The count is relative to an epoch at UTC midnight on + # January 1, 1970, in the proleptic Gregorian calendar which extends the + # Gregorian calendar backwards to year one. + # + # All minutes are 60 seconds long. Leap seconds are "smeared" so that no leap + # second table is needed for interpretation, using a [24-hour linear + # smear](https://developers.google.com/time/smear). + # + # The range is from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59.999999999Z. By + # restricting to that range, we ensure that we can convert to and from [RFC + # 3339](https://www.ietf.org/rfc/rfc3339.txt) date strings. + # + # # Examples + # + # Example 1: Compute Timestamp from POSIX `time()`. + # + # Timestamp timestamp; + # timestamp.set_seconds(time(NULL)); + # timestamp.set_nanos(0); + # + # Example 2: Compute Timestamp from POSIX `gettimeofday()`. + # + # struct timeval tv; + # gettimeofday(&tv, NULL); + # + # Timestamp timestamp; + # timestamp.set_seconds(tv.tv_sec); + # timestamp.set_nanos(tv.tv_usec * 1000); + # + # Example 3: Compute Timestamp from Win32 `GetSystemTimeAsFileTime()`. + # + # FILETIME ft; + # GetSystemTimeAsFileTime(&ft); + # UINT64 ticks = (((UINT64)ft.dwHighDateTime) << 32) | ft.dwLowDateTime; + # + # // A Windows tick is 100 nanoseconds. Windows epoch 1601-01-01T00:00:00Z + # // is 11644473600 seconds before Unix epoch 1970-01-01T00:00:00Z. + # Timestamp timestamp; + # timestamp.set_seconds((INT64) ((ticks / 10000000) - 11644473600LL)); + # timestamp.set_nanos((INT32) ((ticks % 10000000) * 100)); + # + # Example 4: Compute Timestamp from Java `System.currentTimeMillis()`. + # + # long millis = System.currentTimeMillis(); + # + # Timestamp timestamp = Timestamp.newBuilder().setSeconds(millis / 1000) + # .setNanos((int) ((millis % 1000) * 1000000)).build(); + # + # Example 5: Compute Timestamp from Java `Instant.now()`. + # + # Instant now = Instant.now(); + # + # Timestamp timestamp = + # Timestamp.newBuilder().setSeconds(now.getEpochSecond()) + # .setNanos(now.getNano()).build(); + # + # Example 6: Compute Timestamp from current time in Python. + # + # timestamp = Timestamp() + # timestamp.GetCurrentTime() + # + # # JSON Mapping + # + # In JSON format, the Timestamp type is encoded as a string in the + # [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format. That is, the + # format is "\\{year}-\\{month}-\\{day}T\\{hour}:\\{min}:\\{sec}[.\\{frac_sec}]Z" + # where \\{year} is always expressed using four digits while \\{month}, \\{day}, + # \\{hour}, \\{min}, and \\{sec} are zero-padded to two digits each. The fractional + # seconds, which can go up to 9 digits (i.e. up to 1 nanosecond resolution), + # are optional. The "Z" suffix indicates the timezone ("UTC"); the timezone + # is required. A proto3 JSON serializer should always use UTC (as indicated by + # "Z") when printing the Timestamp type and a proto3 JSON parser should be + # able to accept both UTC and other timezones (as indicated by an offset). + # + # For example, "2017-01-15T01:30:15.01Z" encodes 15.01 seconds past + # 01:30 UTC on January 15, 2017. + # + # In JavaScript, one can convert a Date object to this format using the + # standard + # [toISOString()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toISOString) + # method. In Python, a standard `datetime.datetime` object can be converted + # to this format using + # [`strftime`](https://docs.python.org/2/library/time.html#time.strftime) with + # the time format spec '%Y-%m-%dT%H:%M:%S.%fZ'. Likewise, in Java, one can use + # the Joda Time's [`ISODateTimeFormat.dateTime()`]( + # http://joda-time.sourceforge.net/apidocs/org/joda/time/format/ISODateTimeFormat.html#dateTime() + # ) to obtain a formatter capable of generating timestamps in this format. + # @!attribute [rw] seconds + # @return [::Integer] + # Represents seconds of UTC time since Unix epoch + # 1970-01-01T00:00:00Z. Must be from 0001-01-01T00:00:00Z to + # 9999-12-31T23:59:59Z inclusive. + # @!attribute [rw] nanos + # @return [::Integer] + # Non-negative fractions of a second at nanosecond resolution. Negative + # second values with fractions must still have non-negative nanos values + # that count forward in time. Must be from 0 to 999,999,999 + # inclusive. + class Timestamp + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end +end diff --git a/owl-bot-staging/google-cloud-security_center-v1/proto_docs/google/rpc/status.rb b/owl-bot-staging/google-cloud-security_center-v1/proto_docs/google/rpc/status.rb new file mode 100644 index 000000000000..c1a1c07eb2db --- /dev/null +++ b/owl-bot-staging/google-cloud-security_center-v1/proto_docs/google/rpc/status.rb @@ -0,0 +1,48 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + + +module Google + module Rpc + # The `Status` type defines a logical error model that is suitable for + # different programming environments, including REST APIs and RPC APIs. It is + # used by [gRPC](https://github.com/grpc). Each `Status` message contains + # three pieces of data: error code, error message, and error details. + # + # You can find out more about this error model and how to work with it in the + # [API Design Guide](https://cloud.google.com/apis/design/errors). + # @!attribute [rw] code + # @return [::Integer] + # The status code, which should be an enum value of + # [google.rpc.Code][google.rpc.Code]. + # @!attribute [rw] message + # @return [::String] + # A developer-facing error message, which should be in English. Any + # user-facing error message should be localized and sent in the + # {::Google::Rpc::Status#details google.rpc.Status.details} field, or localized + # by the client. + # @!attribute [rw] details + # @return [::Array<::Google::Protobuf::Any>] + # A list of messages that carry the error details. There is a common set of + # message types for APIs to use. + class Status + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end +end diff --git a/owl-bot-staging/google-cloud-security_center-v1/proto_docs/google/type/expr.rb b/owl-bot-staging/google-cloud-security_center-v1/proto_docs/google/type/expr.rb new file mode 100644 index 000000000000..53e7733b6592 --- /dev/null +++ b/owl-bot-staging/google-cloud-security_center-v1/proto_docs/google/type/expr.rb @@ -0,0 +1,75 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + + +module Google + module Type + # Represents a textual expression in the Common Expression Language (CEL) + # syntax. CEL is a C-like expression language. The syntax and semantics of CEL + # are documented at https://github.com/google/cel-spec. + # + # Example (Comparison): + # + # title: "Summary size limit" + # description: "Determines if a summary is less than 100 chars" + # expression: "document.summary.size() < 100" + # + # Example (Equality): + # + # title: "Requestor is owner" + # description: "Determines if requestor is the document owner" + # expression: "document.owner == request.auth.claims.email" + # + # Example (Logic): + # + # title: "Public documents" + # description: "Determine whether the document should be publicly visible" + # expression: "document.type != 'private' && document.type != 'internal'" + # + # Example (Data Manipulation): + # + # title: "Notification string" + # description: "Create a notification string with a timestamp." + # expression: "'New message received at ' + string(document.create_time)" + # + # The exact variables and functions that may be referenced within an expression + # are determined by the service that evaluates it. See the service + # documentation for additional information. + # @!attribute [rw] expression + # @return [::String] + # Textual representation of an expression in Common Expression Language + # syntax. + # @!attribute [rw] title + # @return [::String] + # Optional. Title for the expression, i.e. a short string describing + # its purpose. This can be used e.g. in UIs which allow to enter the + # expression. + # @!attribute [rw] description + # @return [::String] + # Optional. Description of the expression. This is a longer text which + # describes the expression, e.g. when hovered over it in a UI. + # @!attribute [rw] location + # @return [::String] + # Optional. String indicating the location of the expression for error + # reporting, e.g. a file name and a position in the file. + class Expr + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end +end diff --git a/owl-bot-staging/google-cloud-security_center-v1/snippets/Gemfile b/owl-bot-staging/google-cloud-security_center-v1/snippets/Gemfile new file mode 100644 index 000000000000..f16288a177ba --- /dev/null +++ b/owl-bot-staging/google-cloud-security_center-v1/snippets/Gemfile @@ -0,0 +1,32 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +source "https://rubygems.org" + +if ENV["GOOGLE_CLOUD_SAMPLES_TEST"] == "master" + gem "google-cloud-security_center-v1", path: "../" +else + gem "google-cloud-security_center-v1" +end + +group :test do + gem "google-style", "~> 1.26.1" + gem "minitest", "~> 5.16" + gem "minitest-focus", "~> 1.1" + gem "minitest-hooks", "~> 1.5" +end diff --git a/owl-bot-staging/google-cloud-security_center-v1/snippets/security_center/batch_create_resource_value_configs.rb b/owl-bot-staging/google-cloud-security_center-v1/snippets/security_center/batch_create_resource_value_configs.rb new file mode 100644 index 000000000000..62423aec31af --- /dev/null +++ b/owl-bot-staging/google-cloud-security_center-v1/snippets/security_center/batch_create_resource_value_configs.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 securitycenter_v1_generated_SecurityCenter_BatchCreateResourceValueConfigs_sync] +require "google/cloud/security_center/v1" + +## +# Snippet for the batch_create_resource_value_configs call in the SecurityCenter service +# +# This snippet has been automatically generated and should be regarded as a code +# template only. It will require modifications to work: +# - It may require correct/in-range values for request initialization. +# - It may require specifying regional endpoints when creating the service +# client as shown in https://cloud.google.com/ruby/docs/reference. +# +# This is an auto-generated example demonstrating basic usage of +# Google::Cloud::SecurityCenter::V1::SecurityCenter::Client#batch_create_resource_value_configs. +# +def batch_create_resource_value_configs + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::SecurityCenter::V1::SecurityCenter::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::SecurityCenter::V1::BatchCreateResourceValueConfigsRequest.new + + # Call the batch_create_resource_value_configs method. + result = client.batch_create_resource_value_configs request + + # The returned object is of type Google::Cloud::SecurityCenter::V1::BatchCreateResourceValueConfigsResponse. + p result +end +# [END securitycenter_v1_generated_SecurityCenter_BatchCreateResourceValueConfigs_sync] diff --git a/owl-bot-staging/google-cloud-security_center-v1/snippets/security_center/bulk_mute_findings.rb b/owl-bot-staging/google-cloud-security_center-v1/snippets/security_center/bulk_mute_findings.rb new file mode 100644 index 000000000000..93db8d1e0876 --- /dev/null +++ b/owl-bot-staging/google-cloud-security_center-v1/snippets/security_center/bulk_mute_findings.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 securitycenter_v1_generated_SecurityCenter_BulkMuteFindings_sync] +require "google/cloud/security_center/v1" + +## +# Snippet for the bulk_mute_findings call in the SecurityCenter service +# +# This snippet has been automatically generated and should be regarded as a code +# template only. It will require modifications to work: +# - It may require correct/in-range values for request initialization. +# - It may require specifying regional endpoints when creating the service +# client as shown in https://cloud.google.com/ruby/docs/reference. +# +# This is an auto-generated example demonstrating basic usage of +# Google::Cloud::SecurityCenter::V1::SecurityCenter::Client#bulk_mute_findings. +# +def bulk_mute_findings + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::SecurityCenter::V1::SecurityCenter::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::SecurityCenter::V1::BulkMuteFindingsRequest.new + + # Call the bulk_mute_findings method. + result = client.bulk_mute_findings 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 securitycenter_v1_generated_SecurityCenter_BulkMuteFindings_sync] diff --git a/owl-bot-staging/google-cloud-security_center-v1/snippets/security_center/create_big_query_export.rb b/owl-bot-staging/google-cloud-security_center-v1/snippets/security_center/create_big_query_export.rb new file mode 100644 index 000000000000..be92178bf7b4 --- /dev/null +++ b/owl-bot-staging/google-cloud-security_center-v1/snippets/security_center/create_big_query_export.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 securitycenter_v1_generated_SecurityCenter_CreateBigQueryExport_sync] +require "google/cloud/security_center/v1" + +## +# Snippet for the create_big_query_export call in the SecurityCenter service +# +# This snippet has been automatically generated and should be regarded as a code +# template only. It will require modifications to work: +# - It may require correct/in-range values for request initialization. +# - It may require specifying regional endpoints when creating the service +# client as shown in https://cloud.google.com/ruby/docs/reference. +# +# This is an auto-generated example demonstrating basic usage of +# Google::Cloud::SecurityCenter::V1::SecurityCenter::Client#create_big_query_export. +# +def create_big_query_export + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::SecurityCenter::V1::SecurityCenter::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::SecurityCenter::V1::CreateBigQueryExportRequest.new + + # Call the create_big_query_export method. + result = client.create_big_query_export request + + # The returned object is of type Google::Cloud::SecurityCenter::V1::BigQueryExport. + p result +end +# [END securitycenter_v1_generated_SecurityCenter_CreateBigQueryExport_sync] diff --git a/owl-bot-staging/google-cloud-security_center-v1/snippets/security_center/create_event_threat_detection_custom_module.rb b/owl-bot-staging/google-cloud-security_center-v1/snippets/security_center/create_event_threat_detection_custom_module.rb new file mode 100644 index 000000000000..08036d256638 --- /dev/null +++ b/owl-bot-staging/google-cloud-security_center-v1/snippets/security_center/create_event_threat_detection_custom_module.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 securitycenter_v1_generated_SecurityCenter_CreateEventThreatDetectionCustomModule_sync] +require "google/cloud/security_center/v1" + +## +# Snippet for the create_event_threat_detection_custom_module call in the SecurityCenter service +# +# This snippet has been automatically generated and should be regarded as a code +# template only. It will require modifications to work: +# - It may require correct/in-range values for request initialization. +# - It may require specifying regional endpoints when creating the service +# client as shown in https://cloud.google.com/ruby/docs/reference. +# +# This is an auto-generated example demonstrating basic usage of +# Google::Cloud::SecurityCenter::V1::SecurityCenter::Client#create_event_threat_detection_custom_module. +# +def create_event_threat_detection_custom_module + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::SecurityCenter::V1::SecurityCenter::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::SecurityCenter::V1::CreateEventThreatDetectionCustomModuleRequest.new + + # Call the create_event_threat_detection_custom_module method. + result = client.create_event_threat_detection_custom_module request + + # The returned object is of type Google::Cloud::SecurityCenter::V1::EventThreatDetectionCustomModule. + p result +end +# [END securitycenter_v1_generated_SecurityCenter_CreateEventThreatDetectionCustomModule_sync] diff --git a/owl-bot-staging/google-cloud-security_center-v1/snippets/security_center/create_finding.rb b/owl-bot-staging/google-cloud-security_center-v1/snippets/security_center/create_finding.rb new file mode 100644 index 000000000000..0b195fb59e80 --- /dev/null +++ b/owl-bot-staging/google-cloud-security_center-v1/snippets/security_center/create_finding.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 securitycenter_v1_generated_SecurityCenter_CreateFinding_sync] +require "google/cloud/security_center/v1" + +## +# Snippet for the create_finding call in the SecurityCenter service +# +# This snippet has been automatically generated and should be regarded as a code +# template only. It will require modifications to work: +# - It may require correct/in-range values for request initialization. +# - It may require specifying regional endpoints when creating the service +# client as shown in https://cloud.google.com/ruby/docs/reference. +# +# This is an auto-generated example demonstrating basic usage of +# Google::Cloud::SecurityCenter::V1::SecurityCenter::Client#create_finding. +# +def create_finding + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::SecurityCenter::V1::SecurityCenter::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::SecurityCenter::V1::CreateFindingRequest.new + + # Call the create_finding method. + result = client.create_finding request + + # The returned object is of type Google::Cloud::SecurityCenter::V1::Finding. + p result +end +# [END securitycenter_v1_generated_SecurityCenter_CreateFinding_sync] diff --git a/owl-bot-staging/google-cloud-security_center-v1/snippets/security_center/create_mute_config.rb b/owl-bot-staging/google-cloud-security_center-v1/snippets/security_center/create_mute_config.rb new file mode 100644 index 000000000000..7c91c84d013c --- /dev/null +++ b/owl-bot-staging/google-cloud-security_center-v1/snippets/security_center/create_mute_config.rb @@ -0,0 +1,47 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +# [START securitycenter_v1_generated_SecurityCenter_CreateMuteConfig_sync] +require "google/cloud/security_center/v1" + +## +# Snippet for the create_mute_config call in the SecurityCenter service +# +# This snippet has been automatically generated and should be regarded as a code +# template only. It will require modifications to work: +# - It may require correct/in-range values for request initialization. +# - It may require specifying regional endpoints when creating the service +# client as shown in https://cloud.google.com/ruby/docs/reference. +# +# This is an auto-generated example demonstrating basic usage of +# Google::Cloud::SecurityCenter::V1::SecurityCenter::Client#create_mute_config. +# +def create_mute_config + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::SecurityCenter::V1::SecurityCenter::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::SecurityCenter::V1::CreateMuteConfigRequest.new + + # Call the create_mute_config method. + result = client.create_mute_config request + + # The returned object is of type Google::Cloud::SecurityCenter::V1::MuteConfig. + p result +end +# [END securitycenter_v1_generated_SecurityCenter_CreateMuteConfig_sync] diff --git a/owl-bot-staging/google-cloud-security_center-v1/snippets/security_center/create_notification_config.rb b/owl-bot-staging/google-cloud-security_center-v1/snippets/security_center/create_notification_config.rb new file mode 100644 index 000000000000..9d25cf280532 --- /dev/null +++ b/owl-bot-staging/google-cloud-security_center-v1/snippets/security_center/create_notification_config.rb @@ -0,0 +1,47 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +# [START securitycenter_v1_generated_SecurityCenter_CreateNotificationConfig_sync] +require "google/cloud/security_center/v1" + +## +# Snippet for the create_notification_config call in the SecurityCenter service +# +# This snippet has been automatically generated and should be regarded as a code +# template only. It will require modifications to work: +# - It may require correct/in-range values for request initialization. +# - It may require specifying regional endpoints when creating the service +# client as shown in https://cloud.google.com/ruby/docs/reference. +# +# This is an auto-generated example demonstrating basic usage of +# Google::Cloud::SecurityCenter::V1::SecurityCenter::Client#create_notification_config. +# +def create_notification_config + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::SecurityCenter::V1::SecurityCenter::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::SecurityCenter::V1::CreateNotificationConfigRequest.new + + # Call the create_notification_config method. + result = client.create_notification_config request + + # The returned object is of type Google::Cloud::SecurityCenter::V1::NotificationConfig. + p result +end +# [END securitycenter_v1_generated_SecurityCenter_CreateNotificationConfig_sync] diff --git a/owl-bot-staging/google-cloud-security_center-v1/snippets/security_center/create_security_health_analytics_custom_module.rb b/owl-bot-staging/google-cloud-security_center-v1/snippets/security_center/create_security_health_analytics_custom_module.rb new file mode 100644 index 000000000000..5de06ad0e47b --- /dev/null +++ b/owl-bot-staging/google-cloud-security_center-v1/snippets/security_center/create_security_health_analytics_custom_module.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 securitycenter_v1_generated_SecurityCenter_CreateSecurityHealthAnalyticsCustomModule_sync] +require "google/cloud/security_center/v1" + +## +# Snippet for the create_security_health_analytics_custom_module call in the SecurityCenter service +# +# This snippet has been automatically generated and should be regarded as a code +# template only. It will require modifications to work: +# - It may require correct/in-range values for request initialization. +# - It may require specifying regional endpoints when creating the service +# client as shown in https://cloud.google.com/ruby/docs/reference. +# +# This is an auto-generated example demonstrating basic usage of +# Google::Cloud::SecurityCenter::V1::SecurityCenter::Client#create_security_health_analytics_custom_module. +# +def create_security_health_analytics_custom_module + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::SecurityCenter::V1::SecurityCenter::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::SecurityCenter::V1::CreateSecurityHealthAnalyticsCustomModuleRequest.new + + # Call the create_security_health_analytics_custom_module method. + result = client.create_security_health_analytics_custom_module request + + # The returned object is of type Google::Cloud::SecurityCenter::V1::SecurityHealthAnalyticsCustomModule. + p result +end +# [END securitycenter_v1_generated_SecurityCenter_CreateSecurityHealthAnalyticsCustomModule_sync] diff --git a/owl-bot-staging/google-cloud-security_center-v1/snippets/security_center/create_source.rb b/owl-bot-staging/google-cloud-security_center-v1/snippets/security_center/create_source.rb new file mode 100644 index 000000000000..426ebeba8ec5 --- /dev/null +++ b/owl-bot-staging/google-cloud-security_center-v1/snippets/security_center/create_source.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 securitycenter_v1_generated_SecurityCenter_CreateSource_sync] +require "google/cloud/security_center/v1" + +## +# Snippet for the create_source call in the SecurityCenter service +# +# This snippet has been automatically generated and should be regarded as a code +# template only. It will require modifications to work: +# - It may require correct/in-range values for request initialization. +# - It may require specifying regional endpoints when creating the service +# client as shown in https://cloud.google.com/ruby/docs/reference. +# +# This is an auto-generated example demonstrating basic usage of +# Google::Cloud::SecurityCenter::V1::SecurityCenter::Client#create_source. +# +def create_source + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::SecurityCenter::V1::SecurityCenter::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::SecurityCenter::V1::CreateSourceRequest.new + + # Call the create_source method. + result = client.create_source request + + # The returned object is of type Google::Cloud::SecurityCenter::V1::Source. + p result +end +# [END securitycenter_v1_generated_SecurityCenter_CreateSource_sync] diff --git a/owl-bot-staging/google-cloud-security_center-v1/snippets/security_center/delete_big_query_export.rb b/owl-bot-staging/google-cloud-security_center-v1/snippets/security_center/delete_big_query_export.rb new file mode 100644 index 000000000000..e549c6d67597 --- /dev/null +++ b/owl-bot-staging/google-cloud-security_center-v1/snippets/security_center/delete_big_query_export.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 securitycenter_v1_generated_SecurityCenter_DeleteBigQueryExport_sync] +require "google/cloud/security_center/v1" + +## +# Snippet for the delete_big_query_export call in the SecurityCenter service +# +# This snippet has been automatically generated and should be regarded as a code +# template only. It will require modifications to work: +# - It may require correct/in-range values for request initialization. +# - It may require specifying regional endpoints when creating the service +# client as shown in https://cloud.google.com/ruby/docs/reference. +# +# This is an auto-generated example demonstrating basic usage of +# Google::Cloud::SecurityCenter::V1::SecurityCenter::Client#delete_big_query_export. +# +def delete_big_query_export + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::SecurityCenter::V1::SecurityCenter::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::SecurityCenter::V1::DeleteBigQueryExportRequest.new + + # Call the delete_big_query_export method. + result = client.delete_big_query_export request + + # The returned object is of type Google::Protobuf::Empty. + p result +end +# [END securitycenter_v1_generated_SecurityCenter_DeleteBigQueryExport_sync] diff --git a/owl-bot-staging/google-cloud-security_center-v1/snippets/security_center/delete_event_threat_detection_custom_module.rb b/owl-bot-staging/google-cloud-security_center-v1/snippets/security_center/delete_event_threat_detection_custom_module.rb new file mode 100644 index 000000000000..9da872ba42f6 --- /dev/null +++ b/owl-bot-staging/google-cloud-security_center-v1/snippets/security_center/delete_event_threat_detection_custom_module.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 securitycenter_v1_generated_SecurityCenter_DeleteEventThreatDetectionCustomModule_sync] +require "google/cloud/security_center/v1" + +## +# Snippet for the delete_event_threat_detection_custom_module call in the SecurityCenter service +# +# This snippet has been automatically generated and should be regarded as a code +# template only. It will require modifications to work: +# - It may require correct/in-range values for request initialization. +# - It may require specifying regional endpoints when creating the service +# client as shown in https://cloud.google.com/ruby/docs/reference. +# +# This is an auto-generated example demonstrating basic usage of +# Google::Cloud::SecurityCenter::V1::SecurityCenter::Client#delete_event_threat_detection_custom_module. +# +def delete_event_threat_detection_custom_module + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::SecurityCenter::V1::SecurityCenter::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::SecurityCenter::V1::DeleteEventThreatDetectionCustomModuleRequest.new + + # Call the delete_event_threat_detection_custom_module method. + result = client.delete_event_threat_detection_custom_module request + + # The returned object is of type Google::Protobuf::Empty. + p result +end +# [END securitycenter_v1_generated_SecurityCenter_DeleteEventThreatDetectionCustomModule_sync] diff --git a/owl-bot-staging/google-cloud-security_center-v1/snippets/security_center/delete_mute_config.rb b/owl-bot-staging/google-cloud-security_center-v1/snippets/security_center/delete_mute_config.rb new file mode 100644 index 000000000000..ea8a60533934 --- /dev/null +++ b/owl-bot-staging/google-cloud-security_center-v1/snippets/security_center/delete_mute_config.rb @@ -0,0 +1,47 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +# [START securitycenter_v1_generated_SecurityCenter_DeleteMuteConfig_sync] +require "google/cloud/security_center/v1" + +## +# Snippet for the delete_mute_config call in the SecurityCenter service +# +# This snippet has been automatically generated and should be regarded as a code +# template only. It will require modifications to work: +# - It may require correct/in-range values for request initialization. +# - It may require specifying regional endpoints when creating the service +# client as shown in https://cloud.google.com/ruby/docs/reference. +# +# This is an auto-generated example demonstrating basic usage of +# Google::Cloud::SecurityCenter::V1::SecurityCenter::Client#delete_mute_config. +# +def delete_mute_config + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::SecurityCenter::V1::SecurityCenter::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::SecurityCenter::V1::DeleteMuteConfigRequest.new + + # Call the delete_mute_config method. + result = client.delete_mute_config request + + # The returned object is of type Google::Protobuf::Empty. + p result +end +# [END securitycenter_v1_generated_SecurityCenter_DeleteMuteConfig_sync] diff --git a/owl-bot-staging/google-cloud-security_center-v1/snippets/security_center/delete_notification_config.rb b/owl-bot-staging/google-cloud-security_center-v1/snippets/security_center/delete_notification_config.rb new file mode 100644 index 000000000000..6bc88e7ff81e --- /dev/null +++ b/owl-bot-staging/google-cloud-security_center-v1/snippets/security_center/delete_notification_config.rb @@ -0,0 +1,47 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +# [START securitycenter_v1_generated_SecurityCenter_DeleteNotificationConfig_sync] +require "google/cloud/security_center/v1" + +## +# Snippet for the delete_notification_config call in the SecurityCenter service +# +# This snippet has been automatically generated and should be regarded as a code +# template only. It will require modifications to work: +# - It may require correct/in-range values for request initialization. +# - It may require specifying regional endpoints when creating the service +# client as shown in https://cloud.google.com/ruby/docs/reference. +# +# This is an auto-generated example demonstrating basic usage of +# Google::Cloud::SecurityCenter::V1::SecurityCenter::Client#delete_notification_config. +# +def delete_notification_config + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::SecurityCenter::V1::SecurityCenter::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::SecurityCenter::V1::DeleteNotificationConfigRequest.new + + # Call the delete_notification_config method. + result = client.delete_notification_config request + + # The returned object is of type Google::Protobuf::Empty. + p result +end +# [END securitycenter_v1_generated_SecurityCenter_DeleteNotificationConfig_sync] diff --git a/owl-bot-staging/google-cloud-security_center-v1/snippets/security_center/delete_resource_value_config.rb b/owl-bot-staging/google-cloud-security_center-v1/snippets/security_center/delete_resource_value_config.rb new file mode 100644 index 000000000000..a39d9a23c8fd --- /dev/null +++ b/owl-bot-staging/google-cloud-security_center-v1/snippets/security_center/delete_resource_value_config.rb @@ -0,0 +1,47 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +# [START securitycenter_v1_generated_SecurityCenter_DeleteResourceValueConfig_sync] +require "google/cloud/security_center/v1" + +## +# Snippet for the delete_resource_value_config call in the SecurityCenter service +# +# This snippet has been automatically generated and should be regarded as a code +# template only. It will require modifications to work: +# - It may require correct/in-range values for request initialization. +# - It may require specifying regional endpoints when creating the service +# client as shown in https://cloud.google.com/ruby/docs/reference. +# +# This is an auto-generated example demonstrating basic usage of +# Google::Cloud::SecurityCenter::V1::SecurityCenter::Client#delete_resource_value_config. +# +def delete_resource_value_config + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::SecurityCenter::V1::SecurityCenter::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::SecurityCenter::V1::DeleteResourceValueConfigRequest.new + + # Call the delete_resource_value_config method. + result = client.delete_resource_value_config request + + # The returned object is of type Google::Protobuf::Empty. + p result +end +# [END securitycenter_v1_generated_SecurityCenter_DeleteResourceValueConfig_sync] diff --git a/owl-bot-staging/google-cloud-security_center-v1/snippets/security_center/delete_security_health_analytics_custom_module.rb b/owl-bot-staging/google-cloud-security_center-v1/snippets/security_center/delete_security_health_analytics_custom_module.rb new file mode 100644 index 000000000000..946a821c16e2 --- /dev/null +++ b/owl-bot-staging/google-cloud-security_center-v1/snippets/security_center/delete_security_health_analytics_custom_module.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 securitycenter_v1_generated_SecurityCenter_DeleteSecurityHealthAnalyticsCustomModule_sync] +require "google/cloud/security_center/v1" + +## +# Snippet for the delete_security_health_analytics_custom_module call in the SecurityCenter service +# +# This snippet has been automatically generated and should be regarded as a code +# template only. It will require modifications to work: +# - It may require correct/in-range values for request initialization. +# - It may require specifying regional endpoints when creating the service +# client as shown in https://cloud.google.com/ruby/docs/reference. +# +# This is an auto-generated example demonstrating basic usage of +# Google::Cloud::SecurityCenter::V1::SecurityCenter::Client#delete_security_health_analytics_custom_module. +# +def delete_security_health_analytics_custom_module + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::SecurityCenter::V1::SecurityCenter::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::SecurityCenter::V1::DeleteSecurityHealthAnalyticsCustomModuleRequest.new + + # Call the delete_security_health_analytics_custom_module method. + result = client.delete_security_health_analytics_custom_module request + + # The returned object is of type Google::Protobuf::Empty. + p result +end +# [END securitycenter_v1_generated_SecurityCenter_DeleteSecurityHealthAnalyticsCustomModule_sync] diff --git a/owl-bot-staging/google-cloud-security_center-v1/snippets/security_center/get_big_query_export.rb b/owl-bot-staging/google-cloud-security_center-v1/snippets/security_center/get_big_query_export.rb new file mode 100644 index 000000000000..1c58bd5b0d78 --- /dev/null +++ b/owl-bot-staging/google-cloud-security_center-v1/snippets/security_center/get_big_query_export.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 securitycenter_v1_generated_SecurityCenter_GetBigQueryExport_sync] +require "google/cloud/security_center/v1" + +## +# Snippet for the get_big_query_export call in the SecurityCenter service +# +# This snippet has been automatically generated and should be regarded as a code +# template only. It will require modifications to work: +# - It may require correct/in-range values for request initialization. +# - It may require specifying regional endpoints when creating the service +# client as shown in https://cloud.google.com/ruby/docs/reference. +# +# This is an auto-generated example demonstrating basic usage of +# Google::Cloud::SecurityCenter::V1::SecurityCenter::Client#get_big_query_export. +# +def get_big_query_export + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::SecurityCenter::V1::SecurityCenter::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::SecurityCenter::V1::GetBigQueryExportRequest.new + + # Call the get_big_query_export method. + result = client.get_big_query_export request + + # The returned object is of type Google::Cloud::SecurityCenter::V1::BigQueryExport. + p result +end +# [END securitycenter_v1_generated_SecurityCenter_GetBigQueryExport_sync] diff --git a/owl-bot-staging/google-cloud-security_center-v1/snippets/security_center/get_effective_event_threat_detection_custom_module.rb b/owl-bot-staging/google-cloud-security_center-v1/snippets/security_center/get_effective_event_threat_detection_custom_module.rb new file mode 100644 index 000000000000..be112113b672 --- /dev/null +++ b/owl-bot-staging/google-cloud-security_center-v1/snippets/security_center/get_effective_event_threat_detection_custom_module.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 securitycenter_v1_generated_SecurityCenter_GetEffectiveEventThreatDetectionCustomModule_sync] +require "google/cloud/security_center/v1" + +## +# Snippet for the get_effective_event_threat_detection_custom_module call in the SecurityCenter service +# +# This snippet has been automatically generated and should be regarded as a code +# template only. It will require modifications to work: +# - It may require correct/in-range values for request initialization. +# - It may require specifying regional endpoints when creating the service +# client as shown in https://cloud.google.com/ruby/docs/reference. +# +# This is an auto-generated example demonstrating basic usage of +# Google::Cloud::SecurityCenter::V1::SecurityCenter::Client#get_effective_event_threat_detection_custom_module. +# +def get_effective_event_threat_detection_custom_module + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::SecurityCenter::V1::SecurityCenter::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::SecurityCenter::V1::GetEffectiveEventThreatDetectionCustomModuleRequest.new + + # Call the get_effective_event_threat_detection_custom_module method. + result = client.get_effective_event_threat_detection_custom_module request + + # The returned object is of type Google::Cloud::SecurityCenter::V1::EffectiveEventThreatDetectionCustomModule. + p result +end +# [END securitycenter_v1_generated_SecurityCenter_GetEffectiveEventThreatDetectionCustomModule_sync] diff --git a/owl-bot-staging/google-cloud-security_center-v1/snippets/security_center/get_effective_security_health_analytics_custom_module.rb b/owl-bot-staging/google-cloud-security_center-v1/snippets/security_center/get_effective_security_health_analytics_custom_module.rb new file mode 100644 index 000000000000..7db2ddb3ecfc --- /dev/null +++ b/owl-bot-staging/google-cloud-security_center-v1/snippets/security_center/get_effective_security_health_analytics_custom_module.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 securitycenter_v1_generated_SecurityCenter_GetEffectiveSecurityHealthAnalyticsCustomModule_sync] +require "google/cloud/security_center/v1" + +## +# Snippet for the get_effective_security_health_analytics_custom_module call in the SecurityCenter service +# +# This snippet has been automatically generated and should be regarded as a code +# template only. It will require modifications to work: +# - It may require correct/in-range values for request initialization. +# - It may require specifying regional endpoints when creating the service +# client as shown in https://cloud.google.com/ruby/docs/reference. +# +# This is an auto-generated example demonstrating basic usage of +# Google::Cloud::SecurityCenter::V1::SecurityCenter::Client#get_effective_security_health_analytics_custom_module. +# +def get_effective_security_health_analytics_custom_module + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::SecurityCenter::V1::SecurityCenter::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::SecurityCenter::V1::GetEffectiveSecurityHealthAnalyticsCustomModuleRequest.new + + # Call the get_effective_security_health_analytics_custom_module method. + result = client.get_effective_security_health_analytics_custom_module request + + # The returned object is of type Google::Cloud::SecurityCenter::V1::EffectiveSecurityHealthAnalyticsCustomModule. + p result +end +# [END securitycenter_v1_generated_SecurityCenter_GetEffectiveSecurityHealthAnalyticsCustomModule_sync] diff --git a/owl-bot-staging/google-cloud-security_center-v1/snippets/security_center/get_event_threat_detection_custom_module.rb b/owl-bot-staging/google-cloud-security_center-v1/snippets/security_center/get_event_threat_detection_custom_module.rb new file mode 100644 index 000000000000..ec5742081391 --- /dev/null +++ b/owl-bot-staging/google-cloud-security_center-v1/snippets/security_center/get_event_threat_detection_custom_module.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 securitycenter_v1_generated_SecurityCenter_GetEventThreatDetectionCustomModule_sync] +require "google/cloud/security_center/v1" + +## +# Snippet for the get_event_threat_detection_custom_module call in the SecurityCenter service +# +# This snippet has been automatically generated and should be regarded as a code +# template only. It will require modifications to work: +# - It may require correct/in-range values for request initialization. +# - It may require specifying regional endpoints when creating the service +# client as shown in https://cloud.google.com/ruby/docs/reference. +# +# This is an auto-generated example demonstrating basic usage of +# Google::Cloud::SecurityCenter::V1::SecurityCenter::Client#get_event_threat_detection_custom_module. +# +def get_event_threat_detection_custom_module + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::SecurityCenter::V1::SecurityCenter::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::SecurityCenter::V1::GetEventThreatDetectionCustomModuleRequest.new + + # Call the get_event_threat_detection_custom_module method. + result = client.get_event_threat_detection_custom_module request + + # The returned object is of type Google::Cloud::SecurityCenter::V1::EventThreatDetectionCustomModule. + p result +end +# [END securitycenter_v1_generated_SecurityCenter_GetEventThreatDetectionCustomModule_sync] diff --git a/owl-bot-staging/google-cloud-security_center-v1/snippets/security_center/get_iam_policy.rb b/owl-bot-staging/google-cloud-security_center-v1/snippets/security_center/get_iam_policy.rb new file mode 100644 index 000000000000..2b9a6db77e1e --- /dev/null +++ b/owl-bot-staging/google-cloud-security_center-v1/snippets/security_center/get_iam_policy.rb @@ -0,0 +1,47 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +# [START securitycenter_v1_generated_SecurityCenter_GetIamPolicy_sync] +require "google/cloud/security_center/v1" + +## +# Snippet for the get_iam_policy call in the SecurityCenter service +# +# This snippet has been automatically generated and should be regarded as a code +# template only. It will require modifications to work: +# - It may require correct/in-range values for request initialization. +# - It may require specifying regional endpoints when creating the service +# client as shown in https://cloud.google.com/ruby/docs/reference. +# +# This is an auto-generated example demonstrating basic usage of +# Google::Cloud::SecurityCenter::V1::SecurityCenter::Client#get_iam_policy. +# +def get_iam_policy + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::SecurityCenter::V1::SecurityCenter::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Iam::V1::GetIamPolicyRequest.new + + # Call the get_iam_policy method. + result = client.get_iam_policy request + + # The returned object is of type Google::Iam::V1::Policy. + p result +end +# [END securitycenter_v1_generated_SecurityCenter_GetIamPolicy_sync] diff --git a/owl-bot-staging/google-cloud-security_center-v1/snippets/security_center/get_mute_config.rb b/owl-bot-staging/google-cloud-security_center-v1/snippets/security_center/get_mute_config.rb new file mode 100644 index 000000000000..48df3fdf3201 --- /dev/null +++ b/owl-bot-staging/google-cloud-security_center-v1/snippets/security_center/get_mute_config.rb @@ -0,0 +1,47 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +# [START securitycenter_v1_generated_SecurityCenter_GetMuteConfig_sync] +require "google/cloud/security_center/v1" + +## +# Snippet for the get_mute_config call in the SecurityCenter service +# +# This snippet has been automatically generated and should be regarded as a code +# template only. It will require modifications to work: +# - It may require correct/in-range values for request initialization. +# - It may require specifying regional endpoints when creating the service +# client as shown in https://cloud.google.com/ruby/docs/reference. +# +# This is an auto-generated example demonstrating basic usage of +# Google::Cloud::SecurityCenter::V1::SecurityCenter::Client#get_mute_config. +# +def get_mute_config + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::SecurityCenter::V1::SecurityCenter::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::SecurityCenter::V1::GetMuteConfigRequest.new + + # Call the get_mute_config method. + result = client.get_mute_config request + + # The returned object is of type Google::Cloud::SecurityCenter::V1::MuteConfig. + p result +end +# [END securitycenter_v1_generated_SecurityCenter_GetMuteConfig_sync] diff --git a/owl-bot-staging/google-cloud-security_center-v1/snippets/security_center/get_notification_config.rb b/owl-bot-staging/google-cloud-security_center-v1/snippets/security_center/get_notification_config.rb new file mode 100644 index 000000000000..6b5a3b4c0d68 --- /dev/null +++ b/owl-bot-staging/google-cloud-security_center-v1/snippets/security_center/get_notification_config.rb @@ -0,0 +1,47 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +# [START securitycenter_v1_generated_SecurityCenter_GetNotificationConfig_sync] +require "google/cloud/security_center/v1" + +## +# Snippet for the get_notification_config call in the SecurityCenter service +# +# This snippet has been automatically generated and should be regarded as a code +# template only. It will require modifications to work: +# - It may require correct/in-range values for request initialization. +# - It may require specifying regional endpoints when creating the service +# client as shown in https://cloud.google.com/ruby/docs/reference. +# +# This is an auto-generated example demonstrating basic usage of +# Google::Cloud::SecurityCenter::V1::SecurityCenter::Client#get_notification_config. +# +def get_notification_config + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::SecurityCenter::V1::SecurityCenter::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::SecurityCenter::V1::GetNotificationConfigRequest.new + + # Call the get_notification_config method. + result = client.get_notification_config request + + # The returned object is of type Google::Cloud::SecurityCenter::V1::NotificationConfig. + p result +end +# [END securitycenter_v1_generated_SecurityCenter_GetNotificationConfig_sync] diff --git a/owl-bot-staging/google-cloud-security_center-v1/snippets/security_center/get_organization_settings.rb b/owl-bot-staging/google-cloud-security_center-v1/snippets/security_center/get_organization_settings.rb new file mode 100644 index 000000000000..b4b9f24ba65c --- /dev/null +++ b/owl-bot-staging/google-cloud-security_center-v1/snippets/security_center/get_organization_settings.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 securitycenter_v1_generated_SecurityCenter_GetOrganizationSettings_sync] +require "google/cloud/security_center/v1" + +## +# Snippet for the get_organization_settings call in the SecurityCenter service +# +# This snippet has been automatically generated and should be regarded as a code +# template only. It will require modifications to work: +# - It may require correct/in-range values for request initialization. +# - It may require specifying regional endpoints when creating the service +# client as shown in https://cloud.google.com/ruby/docs/reference. +# +# This is an auto-generated example demonstrating basic usage of +# Google::Cloud::SecurityCenter::V1::SecurityCenter::Client#get_organization_settings. +# +def get_organization_settings + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::SecurityCenter::V1::SecurityCenter::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::SecurityCenter::V1::GetOrganizationSettingsRequest.new + + # Call the get_organization_settings method. + result = client.get_organization_settings request + + # The returned object is of type Google::Cloud::SecurityCenter::V1::OrganizationSettings. + p result +end +# [END securitycenter_v1_generated_SecurityCenter_GetOrganizationSettings_sync] diff --git a/owl-bot-staging/google-cloud-security_center-v1/snippets/security_center/get_resource_value_config.rb b/owl-bot-staging/google-cloud-security_center-v1/snippets/security_center/get_resource_value_config.rb new file mode 100644 index 000000000000..d40c67a9eba0 --- /dev/null +++ b/owl-bot-staging/google-cloud-security_center-v1/snippets/security_center/get_resource_value_config.rb @@ -0,0 +1,47 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +# [START securitycenter_v1_generated_SecurityCenter_GetResourceValueConfig_sync] +require "google/cloud/security_center/v1" + +## +# Snippet for the get_resource_value_config call in the SecurityCenter service +# +# This snippet has been automatically generated and should be regarded as a code +# template only. It will require modifications to work: +# - It may require correct/in-range values for request initialization. +# - It may require specifying regional endpoints when creating the service +# client as shown in https://cloud.google.com/ruby/docs/reference. +# +# This is an auto-generated example demonstrating basic usage of +# Google::Cloud::SecurityCenter::V1::SecurityCenter::Client#get_resource_value_config. +# +def get_resource_value_config + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::SecurityCenter::V1::SecurityCenter::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::SecurityCenter::V1::GetResourceValueConfigRequest.new + + # Call the get_resource_value_config method. + result = client.get_resource_value_config request + + # The returned object is of type Google::Cloud::SecurityCenter::V1::ResourceValueConfig. + p result +end +# [END securitycenter_v1_generated_SecurityCenter_GetResourceValueConfig_sync] diff --git a/owl-bot-staging/google-cloud-security_center-v1/snippets/security_center/get_security_health_analytics_custom_module.rb b/owl-bot-staging/google-cloud-security_center-v1/snippets/security_center/get_security_health_analytics_custom_module.rb new file mode 100644 index 000000000000..a4f9f8ef3f19 --- /dev/null +++ b/owl-bot-staging/google-cloud-security_center-v1/snippets/security_center/get_security_health_analytics_custom_module.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 securitycenter_v1_generated_SecurityCenter_GetSecurityHealthAnalyticsCustomModule_sync] +require "google/cloud/security_center/v1" + +## +# Snippet for the get_security_health_analytics_custom_module call in the SecurityCenter service +# +# This snippet has been automatically generated and should be regarded as a code +# template only. It will require modifications to work: +# - It may require correct/in-range values for request initialization. +# - It may require specifying regional endpoints when creating the service +# client as shown in https://cloud.google.com/ruby/docs/reference. +# +# This is an auto-generated example demonstrating basic usage of +# Google::Cloud::SecurityCenter::V1::SecurityCenter::Client#get_security_health_analytics_custom_module. +# +def get_security_health_analytics_custom_module + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::SecurityCenter::V1::SecurityCenter::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::SecurityCenter::V1::GetSecurityHealthAnalyticsCustomModuleRequest.new + + # Call the get_security_health_analytics_custom_module method. + result = client.get_security_health_analytics_custom_module request + + # The returned object is of type Google::Cloud::SecurityCenter::V1::SecurityHealthAnalyticsCustomModule. + p result +end +# [END securitycenter_v1_generated_SecurityCenter_GetSecurityHealthAnalyticsCustomModule_sync] diff --git a/owl-bot-staging/google-cloud-security_center-v1/snippets/security_center/get_simulation.rb b/owl-bot-staging/google-cloud-security_center-v1/snippets/security_center/get_simulation.rb new file mode 100644 index 000000000000..c0a1d22fa00d --- /dev/null +++ b/owl-bot-staging/google-cloud-security_center-v1/snippets/security_center/get_simulation.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 securitycenter_v1_generated_SecurityCenter_GetSimulation_sync] +require "google/cloud/security_center/v1" + +## +# Snippet for the get_simulation call in the SecurityCenter service +# +# This snippet has been automatically generated and should be regarded as a code +# template only. It will require modifications to work: +# - It may require correct/in-range values for request initialization. +# - It may require specifying regional endpoints when creating the service +# client as shown in https://cloud.google.com/ruby/docs/reference. +# +# This is an auto-generated example demonstrating basic usage of +# Google::Cloud::SecurityCenter::V1::SecurityCenter::Client#get_simulation. +# +def get_simulation + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::SecurityCenter::V1::SecurityCenter::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::SecurityCenter::V1::GetSimulationRequest.new + + # Call the get_simulation method. + result = client.get_simulation request + + # The returned object is of type Google::Cloud::SecurityCenter::V1::Simulation. + p result +end +# [END securitycenter_v1_generated_SecurityCenter_GetSimulation_sync] diff --git a/owl-bot-staging/google-cloud-security_center-v1/snippets/security_center/get_source.rb b/owl-bot-staging/google-cloud-security_center-v1/snippets/security_center/get_source.rb new file mode 100644 index 000000000000..bd7c16821102 --- /dev/null +++ b/owl-bot-staging/google-cloud-security_center-v1/snippets/security_center/get_source.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 securitycenter_v1_generated_SecurityCenter_GetSource_sync] +require "google/cloud/security_center/v1" + +## +# Snippet for the get_source call in the SecurityCenter service +# +# This snippet has been automatically generated and should be regarded as a code +# template only. It will require modifications to work: +# - It may require correct/in-range values for request initialization. +# - It may require specifying regional endpoints when creating the service +# client as shown in https://cloud.google.com/ruby/docs/reference. +# +# This is an auto-generated example demonstrating basic usage of +# Google::Cloud::SecurityCenter::V1::SecurityCenter::Client#get_source. +# +def get_source + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::SecurityCenter::V1::SecurityCenter::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::SecurityCenter::V1::GetSourceRequest.new + + # Call the get_source method. + result = client.get_source request + + # The returned object is of type Google::Cloud::SecurityCenter::V1::Source. + p result +end +# [END securitycenter_v1_generated_SecurityCenter_GetSource_sync] diff --git a/owl-bot-staging/google-cloud-security_center-v1/snippets/security_center/get_valued_resource.rb b/owl-bot-staging/google-cloud-security_center-v1/snippets/security_center/get_valued_resource.rb new file mode 100644 index 000000000000..8c1d07bdc6de --- /dev/null +++ b/owl-bot-staging/google-cloud-security_center-v1/snippets/security_center/get_valued_resource.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 securitycenter_v1_generated_SecurityCenter_GetValuedResource_sync] +require "google/cloud/security_center/v1" + +## +# Snippet for the get_valued_resource call in the SecurityCenter service +# +# This snippet has been automatically generated and should be regarded as a code +# template only. It will require modifications to work: +# - It may require correct/in-range values for request initialization. +# - It may require specifying regional endpoints when creating the service +# client as shown in https://cloud.google.com/ruby/docs/reference. +# +# This is an auto-generated example demonstrating basic usage of +# Google::Cloud::SecurityCenter::V1::SecurityCenter::Client#get_valued_resource. +# +def get_valued_resource + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::SecurityCenter::V1::SecurityCenter::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::SecurityCenter::V1::GetValuedResourceRequest.new + + # Call the get_valued_resource method. + result = client.get_valued_resource request + + # The returned object is of type Google::Cloud::SecurityCenter::V1::ValuedResource. + p result +end +# [END securitycenter_v1_generated_SecurityCenter_GetValuedResource_sync] diff --git a/owl-bot-staging/google-cloud-security_center-v1/snippets/security_center/group_assets.rb b/owl-bot-staging/google-cloud-security_center-v1/snippets/security_center/group_assets.rb new file mode 100644 index 000000000000..ae956d56813e --- /dev/null +++ b/owl-bot-staging/google-cloud-security_center-v1/snippets/security_center/group_assets.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 securitycenter_v1_generated_SecurityCenter_GroupAssets_sync] +require "google/cloud/security_center/v1" + +## +# Snippet for the group_assets call in the SecurityCenter service +# +# This snippet has been automatically generated and should be regarded as a code +# template only. It will require modifications to work: +# - It may require correct/in-range values for request initialization. +# - It may require specifying regional endpoints when creating the service +# client as shown in https://cloud.google.com/ruby/docs/reference. +# +# This is an auto-generated example demonstrating basic usage of +# Google::Cloud::SecurityCenter::V1::SecurityCenter::Client#group_assets. +# +def group_assets + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::SecurityCenter::V1::SecurityCenter::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::SecurityCenter::V1::GroupAssetsRequest.new + + # Call the group_assets method. + result = client.group_assets request + + # The returned object is of type Gapic::PagedEnumerable. You can iterate + # over elements, and API calls will be issued to fetch pages as needed. + result.each do |item| + # Each element is of type ::Google::Cloud::SecurityCenter::V1::GroupResult. + p item + end +end +# [END securitycenter_v1_generated_SecurityCenter_GroupAssets_sync] diff --git a/owl-bot-staging/google-cloud-security_center-v1/snippets/security_center/group_findings.rb b/owl-bot-staging/google-cloud-security_center-v1/snippets/security_center/group_findings.rb new file mode 100644 index 000000000000..c4786c15f09b --- /dev/null +++ b/owl-bot-staging/google-cloud-security_center-v1/snippets/security_center/group_findings.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 securitycenter_v1_generated_SecurityCenter_GroupFindings_sync] +require "google/cloud/security_center/v1" + +## +# Snippet for the group_findings call in the SecurityCenter service +# +# This snippet has been automatically generated and should be regarded as a code +# template only. It will require modifications to work: +# - It may require correct/in-range values for request initialization. +# - It may require specifying regional endpoints when creating the service +# client as shown in https://cloud.google.com/ruby/docs/reference. +# +# This is an auto-generated example demonstrating basic usage of +# Google::Cloud::SecurityCenter::V1::SecurityCenter::Client#group_findings. +# +def group_findings + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::SecurityCenter::V1::SecurityCenter::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::SecurityCenter::V1::GroupFindingsRequest.new + + # Call the group_findings method. + result = client.group_findings request + + # The returned object is of type Gapic::PagedEnumerable. You can iterate + # over elements, and API calls will be issued to fetch pages as needed. + result.each do |item| + # Each element is of type ::Google::Cloud::SecurityCenter::V1::GroupResult. + p item + end +end +# [END securitycenter_v1_generated_SecurityCenter_GroupFindings_sync] diff --git a/owl-bot-staging/google-cloud-security_center-v1/snippets/security_center/list_assets.rb b/owl-bot-staging/google-cloud-security_center-v1/snippets/security_center/list_assets.rb new file mode 100644 index 000000000000..ceeaebf8d86d --- /dev/null +++ b/owl-bot-staging/google-cloud-security_center-v1/snippets/security_center/list_assets.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 securitycenter_v1_generated_SecurityCenter_ListAssets_sync] +require "google/cloud/security_center/v1" + +## +# Snippet for the list_assets call in the SecurityCenter service +# +# This snippet has been automatically generated and should be regarded as a code +# template only. It will require modifications to work: +# - It may require correct/in-range values for request initialization. +# - It may require specifying regional endpoints when creating the service +# client as shown in https://cloud.google.com/ruby/docs/reference. +# +# This is an auto-generated example demonstrating basic usage of +# Google::Cloud::SecurityCenter::V1::SecurityCenter::Client#list_assets. +# +def list_assets + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::SecurityCenter::V1::SecurityCenter::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::SecurityCenter::V1::ListAssetsRequest.new + + # Call the list_assets method. + result = client.list_assets request + + # The returned object is of type Gapic::PagedEnumerable. You can iterate + # over elements, and API calls will be issued to fetch pages as needed. + result.each do |item| + # Each element is of type ::Google::Cloud::SecurityCenter::V1::ListAssetsResponse::ListAssetsResult. + p item + end +end +# [END securitycenter_v1_generated_SecurityCenter_ListAssets_sync] diff --git a/owl-bot-staging/google-cloud-security_center-v1/snippets/security_center/list_attack_paths.rb b/owl-bot-staging/google-cloud-security_center-v1/snippets/security_center/list_attack_paths.rb new file mode 100644 index 000000000000..5862a15cff4a --- /dev/null +++ b/owl-bot-staging/google-cloud-security_center-v1/snippets/security_center/list_attack_paths.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 securitycenter_v1_generated_SecurityCenter_ListAttackPaths_sync] +require "google/cloud/security_center/v1" + +## +# Snippet for the list_attack_paths call in the SecurityCenter service +# +# This snippet has been automatically generated and should be regarded as a code +# template only. It will require modifications to work: +# - It may require correct/in-range values for request initialization. +# - It may require specifying regional endpoints when creating the service +# client as shown in https://cloud.google.com/ruby/docs/reference. +# +# This is an auto-generated example demonstrating basic usage of +# Google::Cloud::SecurityCenter::V1::SecurityCenter::Client#list_attack_paths. +# +def list_attack_paths + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::SecurityCenter::V1::SecurityCenter::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::SecurityCenter::V1::ListAttackPathsRequest.new + + # Call the list_attack_paths method. + result = client.list_attack_paths request + + # The returned object is of type Gapic::PagedEnumerable. You can iterate + # over elements, and API calls will be issued to fetch pages as needed. + result.each do |item| + # Each element is of type ::Google::Cloud::SecurityCenter::V1::AttackPath. + p item + end +end +# [END securitycenter_v1_generated_SecurityCenter_ListAttackPaths_sync] diff --git a/owl-bot-staging/google-cloud-security_center-v1/snippets/security_center/list_big_query_exports.rb b/owl-bot-staging/google-cloud-security_center-v1/snippets/security_center/list_big_query_exports.rb new file mode 100644 index 000000000000..3746c178ec2f --- /dev/null +++ b/owl-bot-staging/google-cloud-security_center-v1/snippets/security_center/list_big_query_exports.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 securitycenter_v1_generated_SecurityCenter_ListBigQueryExports_sync] +require "google/cloud/security_center/v1" + +## +# Snippet for the list_big_query_exports call in the SecurityCenter service +# +# This snippet has been automatically generated and should be regarded as a code +# template only. It will require modifications to work: +# - It may require correct/in-range values for request initialization. +# - It may require specifying regional endpoints when creating the service +# client as shown in https://cloud.google.com/ruby/docs/reference. +# +# This is an auto-generated example demonstrating basic usage of +# Google::Cloud::SecurityCenter::V1::SecurityCenter::Client#list_big_query_exports. +# +def list_big_query_exports + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::SecurityCenter::V1::SecurityCenter::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::SecurityCenter::V1::ListBigQueryExportsRequest.new + + # Call the list_big_query_exports method. + result = client.list_big_query_exports request + + # The returned object is of type Gapic::PagedEnumerable. You can iterate + # over elements, and API calls will be issued to fetch pages as needed. + result.each do |item| + # Each element is of type ::Google::Cloud::SecurityCenter::V1::BigQueryExport. + p item + end +end +# [END securitycenter_v1_generated_SecurityCenter_ListBigQueryExports_sync] diff --git a/owl-bot-staging/google-cloud-security_center-v1/snippets/security_center/list_descendant_event_threat_detection_custom_modules.rb b/owl-bot-staging/google-cloud-security_center-v1/snippets/security_center/list_descendant_event_threat_detection_custom_modules.rb new file mode 100644 index 000000000000..5dacc91c28be --- /dev/null +++ b/owl-bot-staging/google-cloud-security_center-v1/snippets/security_center/list_descendant_event_threat_detection_custom_modules.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 securitycenter_v1_generated_SecurityCenter_ListDescendantEventThreatDetectionCustomModules_sync] +require "google/cloud/security_center/v1" + +## +# Snippet for the list_descendant_event_threat_detection_custom_modules call in the SecurityCenter service +# +# This snippet has been automatically generated and should be regarded as a code +# template only. It will require modifications to work: +# - It may require correct/in-range values for request initialization. +# - It may require specifying regional endpoints when creating the service +# client as shown in https://cloud.google.com/ruby/docs/reference. +# +# This is an auto-generated example demonstrating basic usage of +# Google::Cloud::SecurityCenter::V1::SecurityCenter::Client#list_descendant_event_threat_detection_custom_modules. +# +def list_descendant_event_threat_detection_custom_modules + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::SecurityCenter::V1::SecurityCenter::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::SecurityCenter::V1::ListDescendantEventThreatDetectionCustomModulesRequest.new + + # Call the list_descendant_event_threat_detection_custom_modules method. + result = client.list_descendant_event_threat_detection_custom_modules request + + # The returned object is of type Gapic::PagedEnumerable. You can iterate + # over elements, and API calls will be issued to fetch pages as needed. + result.each do |item| + # Each element is of type ::Google::Cloud::SecurityCenter::V1::EventThreatDetectionCustomModule. + p item + end +end +# [END securitycenter_v1_generated_SecurityCenter_ListDescendantEventThreatDetectionCustomModules_sync] diff --git a/owl-bot-staging/google-cloud-security_center-v1/snippets/security_center/list_descendant_security_health_analytics_custom_modules.rb b/owl-bot-staging/google-cloud-security_center-v1/snippets/security_center/list_descendant_security_health_analytics_custom_modules.rb new file mode 100644 index 000000000000..5f821c75b303 --- /dev/null +++ b/owl-bot-staging/google-cloud-security_center-v1/snippets/security_center/list_descendant_security_health_analytics_custom_modules.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 securitycenter_v1_generated_SecurityCenter_ListDescendantSecurityHealthAnalyticsCustomModules_sync] +require "google/cloud/security_center/v1" + +## +# Snippet for the list_descendant_security_health_analytics_custom_modules call in the SecurityCenter service +# +# This snippet has been automatically generated and should be regarded as a code +# template only. It will require modifications to work: +# - It may require correct/in-range values for request initialization. +# - It may require specifying regional endpoints when creating the service +# client as shown in https://cloud.google.com/ruby/docs/reference. +# +# This is an auto-generated example demonstrating basic usage of +# Google::Cloud::SecurityCenter::V1::SecurityCenter::Client#list_descendant_security_health_analytics_custom_modules. +# +def list_descendant_security_health_analytics_custom_modules + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::SecurityCenter::V1::SecurityCenter::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::SecurityCenter::V1::ListDescendantSecurityHealthAnalyticsCustomModulesRequest.new + + # Call the list_descendant_security_health_analytics_custom_modules method. + result = client.list_descendant_security_health_analytics_custom_modules request + + # The returned object is of type Gapic::PagedEnumerable. You can iterate + # over elements, and API calls will be issued to fetch pages as needed. + result.each do |item| + # Each element is of type ::Google::Cloud::SecurityCenter::V1::SecurityHealthAnalyticsCustomModule. + p item + end +end +# [END securitycenter_v1_generated_SecurityCenter_ListDescendantSecurityHealthAnalyticsCustomModules_sync] diff --git a/owl-bot-staging/google-cloud-security_center-v1/snippets/security_center/list_effective_event_threat_detection_custom_modules.rb b/owl-bot-staging/google-cloud-security_center-v1/snippets/security_center/list_effective_event_threat_detection_custom_modules.rb new file mode 100644 index 000000000000..39414a8834dd --- /dev/null +++ b/owl-bot-staging/google-cloud-security_center-v1/snippets/security_center/list_effective_event_threat_detection_custom_modules.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 securitycenter_v1_generated_SecurityCenter_ListEffectiveEventThreatDetectionCustomModules_sync] +require "google/cloud/security_center/v1" + +## +# Snippet for the list_effective_event_threat_detection_custom_modules call in the SecurityCenter service +# +# This snippet has been automatically generated and should be regarded as a code +# template only. It will require modifications to work: +# - It may require correct/in-range values for request initialization. +# - It may require specifying regional endpoints when creating the service +# client as shown in https://cloud.google.com/ruby/docs/reference. +# +# This is an auto-generated example demonstrating basic usage of +# Google::Cloud::SecurityCenter::V1::SecurityCenter::Client#list_effective_event_threat_detection_custom_modules. +# +def list_effective_event_threat_detection_custom_modules + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::SecurityCenter::V1::SecurityCenter::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::SecurityCenter::V1::ListEffectiveEventThreatDetectionCustomModulesRequest.new + + # Call the list_effective_event_threat_detection_custom_modules method. + result = client.list_effective_event_threat_detection_custom_modules request + + # The returned object is of type Gapic::PagedEnumerable. You can iterate + # over elements, and API calls will be issued to fetch pages as needed. + result.each do |item| + # Each element is of type ::Google::Cloud::SecurityCenter::V1::EffectiveEventThreatDetectionCustomModule. + p item + end +end +# [END securitycenter_v1_generated_SecurityCenter_ListEffectiveEventThreatDetectionCustomModules_sync] diff --git a/owl-bot-staging/google-cloud-security_center-v1/snippets/security_center/list_effective_security_health_analytics_custom_modules.rb b/owl-bot-staging/google-cloud-security_center-v1/snippets/security_center/list_effective_security_health_analytics_custom_modules.rb new file mode 100644 index 000000000000..964e57448ce6 --- /dev/null +++ b/owl-bot-staging/google-cloud-security_center-v1/snippets/security_center/list_effective_security_health_analytics_custom_modules.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 securitycenter_v1_generated_SecurityCenter_ListEffectiveSecurityHealthAnalyticsCustomModules_sync] +require "google/cloud/security_center/v1" + +## +# Snippet for the list_effective_security_health_analytics_custom_modules call in the SecurityCenter service +# +# This snippet has been automatically generated and should be regarded as a code +# template only. It will require modifications to work: +# - It may require correct/in-range values for request initialization. +# - It may require specifying regional endpoints when creating the service +# client as shown in https://cloud.google.com/ruby/docs/reference. +# +# This is an auto-generated example demonstrating basic usage of +# Google::Cloud::SecurityCenter::V1::SecurityCenter::Client#list_effective_security_health_analytics_custom_modules. +# +def list_effective_security_health_analytics_custom_modules + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::SecurityCenter::V1::SecurityCenter::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::SecurityCenter::V1::ListEffectiveSecurityHealthAnalyticsCustomModulesRequest.new + + # Call the list_effective_security_health_analytics_custom_modules method. + result = client.list_effective_security_health_analytics_custom_modules request + + # The returned object is of type Gapic::PagedEnumerable. You can iterate + # over elements, and API calls will be issued to fetch pages as needed. + result.each do |item| + # Each element is of type ::Google::Cloud::SecurityCenter::V1::EffectiveSecurityHealthAnalyticsCustomModule. + p item + end +end +# [END securitycenter_v1_generated_SecurityCenter_ListEffectiveSecurityHealthAnalyticsCustomModules_sync] diff --git a/owl-bot-staging/google-cloud-security_center-v1/snippets/security_center/list_event_threat_detection_custom_modules.rb b/owl-bot-staging/google-cloud-security_center-v1/snippets/security_center/list_event_threat_detection_custom_modules.rb new file mode 100644 index 000000000000..41b6dd7a76c0 --- /dev/null +++ b/owl-bot-staging/google-cloud-security_center-v1/snippets/security_center/list_event_threat_detection_custom_modules.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 securitycenter_v1_generated_SecurityCenter_ListEventThreatDetectionCustomModules_sync] +require "google/cloud/security_center/v1" + +## +# Snippet for the list_event_threat_detection_custom_modules call in the SecurityCenter service +# +# This snippet has been automatically generated and should be regarded as a code +# template only. It will require modifications to work: +# - It may require correct/in-range values for request initialization. +# - It may require specifying regional endpoints when creating the service +# client as shown in https://cloud.google.com/ruby/docs/reference. +# +# This is an auto-generated example demonstrating basic usage of +# Google::Cloud::SecurityCenter::V1::SecurityCenter::Client#list_event_threat_detection_custom_modules. +# +def list_event_threat_detection_custom_modules + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::SecurityCenter::V1::SecurityCenter::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::SecurityCenter::V1::ListEventThreatDetectionCustomModulesRequest.new + + # Call the list_event_threat_detection_custom_modules method. + result = client.list_event_threat_detection_custom_modules request + + # The returned object is of type Gapic::PagedEnumerable. You can iterate + # over elements, and API calls will be issued to fetch pages as needed. + result.each do |item| + # Each element is of type ::Google::Cloud::SecurityCenter::V1::EventThreatDetectionCustomModule. + p item + end +end +# [END securitycenter_v1_generated_SecurityCenter_ListEventThreatDetectionCustomModules_sync] diff --git a/owl-bot-staging/google-cloud-security_center-v1/snippets/security_center/list_findings.rb b/owl-bot-staging/google-cloud-security_center-v1/snippets/security_center/list_findings.rb new file mode 100644 index 000000000000..57fb4cae4392 --- /dev/null +++ b/owl-bot-staging/google-cloud-security_center-v1/snippets/security_center/list_findings.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 securitycenter_v1_generated_SecurityCenter_ListFindings_sync] +require "google/cloud/security_center/v1" + +## +# Snippet for the list_findings call in the SecurityCenter service +# +# This snippet has been automatically generated and should be regarded as a code +# template only. It will require modifications to work: +# - It may require correct/in-range values for request initialization. +# - It may require specifying regional endpoints when creating the service +# client as shown in https://cloud.google.com/ruby/docs/reference. +# +# This is an auto-generated example demonstrating basic usage of +# Google::Cloud::SecurityCenter::V1::SecurityCenter::Client#list_findings. +# +def list_findings + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::SecurityCenter::V1::SecurityCenter::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::SecurityCenter::V1::ListFindingsRequest.new + + # Call the list_findings method. + result = client.list_findings request + + # The returned object is of type Gapic::PagedEnumerable. You can iterate + # over elements, and API calls will be issued to fetch pages as needed. + result.each do |item| + # Each element is of type ::Google::Cloud::SecurityCenter::V1::ListFindingsResponse::ListFindingsResult. + p item + end +end +# [END securitycenter_v1_generated_SecurityCenter_ListFindings_sync] diff --git a/owl-bot-staging/google-cloud-security_center-v1/snippets/security_center/list_mute_configs.rb b/owl-bot-staging/google-cloud-security_center-v1/snippets/security_center/list_mute_configs.rb new file mode 100644 index 000000000000..eb1fdb03d97d --- /dev/null +++ b/owl-bot-staging/google-cloud-security_center-v1/snippets/security_center/list_mute_configs.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 securitycenter_v1_generated_SecurityCenter_ListMuteConfigs_sync] +require "google/cloud/security_center/v1" + +## +# Snippet for the list_mute_configs call in the SecurityCenter service +# +# This snippet has been automatically generated and should be regarded as a code +# template only. It will require modifications to work: +# - It may require correct/in-range values for request initialization. +# - It may require specifying regional endpoints when creating the service +# client as shown in https://cloud.google.com/ruby/docs/reference. +# +# This is an auto-generated example demonstrating basic usage of +# Google::Cloud::SecurityCenter::V1::SecurityCenter::Client#list_mute_configs. +# +def list_mute_configs + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::SecurityCenter::V1::SecurityCenter::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::SecurityCenter::V1::ListMuteConfigsRequest.new + + # Call the list_mute_configs method. + result = client.list_mute_configs request + + # The returned object is of type Gapic::PagedEnumerable. You can iterate + # over elements, and API calls will be issued to fetch pages as needed. + result.each do |item| + # Each element is of type ::Google::Cloud::SecurityCenter::V1::MuteConfig. + p item + end +end +# [END securitycenter_v1_generated_SecurityCenter_ListMuteConfigs_sync] diff --git a/owl-bot-staging/google-cloud-security_center-v1/snippets/security_center/list_notification_configs.rb b/owl-bot-staging/google-cloud-security_center-v1/snippets/security_center/list_notification_configs.rb new file mode 100644 index 000000000000..b7b5eee3314f --- /dev/null +++ b/owl-bot-staging/google-cloud-security_center-v1/snippets/security_center/list_notification_configs.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 securitycenter_v1_generated_SecurityCenter_ListNotificationConfigs_sync] +require "google/cloud/security_center/v1" + +## +# Snippet for the list_notification_configs call in the SecurityCenter service +# +# This snippet has been automatically generated and should be regarded as a code +# template only. It will require modifications to work: +# - It may require correct/in-range values for request initialization. +# - It may require specifying regional endpoints when creating the service +# client as shown in https://cloud.google.com/ruby/docs/reference. +# +# This is an auto-generated example demonstrating basic usage of +# Google::Cloud::SecurityCenter::V1::SecurityCenter::Client#list_notification_configs. +# +def list_notification_configs + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::SecurityCenter::V1::SecurityCenter::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::SecurityCenter::V1::ListNotificationConfigsRequest.new + + # Call the list_notification_configs method. + result = client.list_notification_configs request + + # The returned object is of type Gapic::PagedEnumerable. You can iterate + # over elements, and API calls will be issued to fetch pages as needed. + result.each do |item| + # Each element is of type ::Google::Cloud::SecurityCenter::V1::NotificationConfig. + p item + end +end +# [END securitycenter_v1_generated_SecurityCenter_ListNotificationConfigs_sync] diff --git a/owl-bot-staging/google-cloud-security_center-v1/snippets/security_center/list_resource_value_configs.rb b/owl-bot-staging/google-cloud-security_center-v1/snippets/security_center/list_resource_value_configs.rb new file mode 100644 index 000000000000..251454a75ea0 --- /dev/null +++ b/owl-bot-staging/google-cloud-security_center-v1/snippets/security_center/list_resource_value_configs.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 securitycenter_v1_generated_SecurityCenter_ListResourceValueConfigs_sync] +require "google/cloud/security_center/v1" + +## +# Snippet for the list_resource_value_configs call in the SecurityCenter service +# +# This snippet has been automatically generated and should be regarded as a code +# template only. It will require modifications to work: +# - It may require correct/in-range values for request initialization. +# - It may require specifying regional endpoints when creating the service +# client as shown in https://cloud.google.com/ruby/docs/reference. +# +# This is an auto-generated example demonstrating basic usage of +# Google::Cloud::SecurityCenter::V1::SecurityCenter::Client#list_resource_value_configs. +# +def list_resource_value_configs + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::SecurityCenter::V1::SecurityCenter::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::SecurityCenter::V1::ListResourceValueConfigsRequest.new + + # Call the list_resource_value_configs method. + result = client.list_resource_value_configs request + + # The returned object is of type Gapic::PagedEnumerable. You can iterate + # over elements, and API calls will be issued to fetch pages as needed. + result.each do |item| + # Each element is of type ::Google::Cloud::SecurityCenter::V1::ResourceValueConfig. + p item + end +end +# [END securitycenter_v1_generated_SecurityCenter_ListResourceValueConfigs_sync] diff --git a/owl-bot-staging/google-cloud-security_center-v1/snippets/security_center/list_security_health_analytics_custom_modules.rb b/owl-bot-staging/google-cloud-security_center-v1/snippets/security_center/list_security_health_analytics_custom_modules.rb new file mode 100644 index 000000000000..1c67c25b10d3 --- /dev/null +++ b/owl-bot-staging/google-cloud-security_center-v1/snippets/security_center/list_security_health_analytics_custom_modules.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 securitycenter_v1_generated_SecurityCenter_ListSecurityHealthAnalyticsCustomModules_sync] +require "google/cloud/security_center/v1" + +## +# Snippet for the list_security_health_analytics_custom_modules call in the SecurityCenter service +# +# This snippet has been automatically generated and should be regarded as a code +# template only. It will require modifications to work: +# - It may require correct/in-range values for request initialization. +# - It may require specifying regional endpoints when creating the service +# client as shown in https://cloud.google.com/ruby/docs/reference. +# +# This is an auto-generated example demonstrating basic usage of +# Google::Cloud::SecurityCenter::V1::SecurityCenter::Client#list_security_health_analytics_custom_modules. +# +def list_security_health_analytics_custom_modules + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::SecurityCenter::V1::SecurityCenter::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::SecurityCenter::V1::ListSecurityHealthAnalyticsCustomModulesRequest.new + + # Call the list_security_health_analytics_custom_modules method. + result = client.list_security_health_analytics_custom_modules request + + # The returned object is of type Gapic::PagedEnumerable. You can iterate + # over elements, and API calls will be issued to fetch pages as needed. + result.each do |item| + # Each element is of type ::Google::Cloud::SecurityCenter::V1::SecurityHealthAnalyticsCustomModule. + p item + end +end +# [END securitycenter_v1_generated_SecurityCenter_ListSecurityHealthAnalyticsCustomModules_sync] diff --git a/owl-bot-staging/google-cloud-security_center-v1/snippets/security_center/list_sources.rb b/owl-bot-staging/google-cloud-security_center-v1/snippets/security_center/list_sources.rb new file mode 100644 index 000000000000..c97a5da2a253 --- /dev/null +++ b/owl-bot-staging/google-cloud-security_center-v1/snippets/security_center/list_sources.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 securitycenter_v1_generated_SecurityCenter_ListSources_sync] +require "google/cloud/security_center/v1" + +## +# Snippet for the list_sources call in the SecurityCenter service +# +# This snippet has been automatically generated and should be regarded as a code +# template only. It will require modifications to work: +# - It may require correct/in-range values for request initialization. +# - It may require specifying regional endpoints when creating the service +# client as shown in https://cloud.google.com/ruby/docs/reference. +# +# This is an auto-generated example demonstrating basic usage of +# Google::Cloud::SecurityCenter::V1::SecurityCenter::Client#list_sources. +# +def list_sources + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::SecurityCenter::V1::SecurityCenter::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::SecurityCenter::V1::ListSourcesRequest.new + + # Call the list_sources method. + result = client.list_sources request + + # The returned object is of type Gapic::PagedEnumerable. You can iterate + # over elements, and API calls will be issued to fetch pages as needed. + result.each do |item| + # Each element is of type ::Google::Cloud::SecurityCenter::V1::Source. + p item + end +end +# [END securitycenter_v1_generated_SecurityCenter_ListSources_sync] diff --git a/owl-bot-staging/google-cloud-security_center-v1/snippets/security_center/list_valued_resources.rb b/owl-bot-staging/google-cloud-security_center-v1/snippets/security_center/list_valued_resources.rb new file mode 100644 index 000000000000..2dfc8bf0281c --- /dev/null +++ b/owl-bot-staging/google-cloud-security_center-v1/snippets/security_center/list_valued_resources.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 securitycenter_v1_generated_SecurityCenter_ListValuedResources_sync] +require "google/cloud/security_center/v1" + +## +# Snippet for the list_valued_resources call in the SecurityCenter service +# +# This snippet has been automatically generated and should be regarded as a code +# template only. It will require modifications to work: +# - It may require correct/in-range values for request initialization. +# - It may require specifying regional endpoints when creating the service +# client as shown in https://cloud.google.com/ruby/docs/reference. +# +# This is an auto-generated example demonstrating basic usage of +# Google::Cloud::SecurityCenter::V1::SecurityCenter::Client#list_valued_resources. +# +def list_valued_resources + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::SecurityCenter::V1::SecurityCenter::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::SecurityCenter::V1::ListValuedResourcesRequest.new + + # Call the list_valued_resources method. + result = client.list_valued_resources request + + # The returned object is of type Gapic::PagedEnumerable. You can iterate + # over elements, and API calls will be issued to fetch pages as needed. + result.each do |item| + # Each element is of type ::Google::Cloud::SecurityCenter::V1::ValuedResource. + p item + end +end +# [END securitycenter_v1_generated_SecurityCenter_ListValuedResources_sync] diff --git a/owl-bot-staging/google-cloud-security_center-v1/snippets/security_center/run_asset_discovery.rb b/owl-bot-staging/google-cloud-security_center-v1/snippets/security_center/run_asset_discovery.rb new file mode 100644 index 000000000000..b4992daa0dfc --- /dev/null +++ b/owl-bot-staging/google-cloud-security_center-v1/snippets/security_center/run_asset_discovery.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 securitycenter_v1_generated_SecurityCenter_RunAssetDiscovery_sync] +require "google/cloud/security_center/v1" + +## +# Snippet for the run_asset_discovery call in the SecurityCenter service +# +# This snippet has been automatically generated and should be regarded as a code +# template only. It will require modifications to work: +# - It may require correct/in-range values for request initialization. +# - It may require specifying regional endpoints when creating the service +# client as shown in https://cloud.google.com/ruby/docs/reference. +# +# This is an auto-generated example demonstrating basic usage of +# Google::Cloud::SecurityCenter::V1::SecurityCenter::Client#run_asset_discovery. +# +def run_asset_discovery + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::SecurityCenter::V1::SecurityCenter::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::SecurityCenter::V1::RunAssetDiscoveryRequest.new + + # Call the run_asset_discovery method. + result = client.run_asset_discovery 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 securitycenter_v1_generated_SecurityCenter_RunAssetDiscovery_sync] diff --git a/owl-bot-staging/google-cloud-security_center-v1/snippets/security_center/set_finding_state.rb b/owl-bot-staging/google-cloud-security_center-v1/snippets/security_center/set_finding_state.rb new file mode 100644 index 000000000000..46ec0d32e12b --- /dev/null +++ b/owl-bot-staging/google-cloud-security_center-v1/snippets/security_center/set_finding_state.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 securitycenter_v1_generated_SecurityCenter_SetFindingState_sync] +require "google/cloud/security_center/v1" + +## +# Snippet for the set_finding_state call in the SecurityCenter service +# +# This snippet has been automatically generated and should be regarded as a code +# template only. It will require modifications to work: +# - It may require correct/in-range values for request initialization. +# - It may require specifying regional endpoints when creating the service +# client as shown in https://cloud.google.com/ruby/docs/reference. +# +# This is an auto-generated example demonstrating basic usage of +# Google::Cloud::SecurityCenter::V1::SecurityCenter::Client#set_finding_state. +# +def set_finding_state + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::SecurityCenter::V1::SecurityCenter::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::SecurityCenter::V1::SetFindingStateRequest.new + + # Call the set_finding_state method. + result = client.set_finding_state request + + # The returned object is of type Google::Cloud::SecurityCenter::V1::Finding. + p result +end +# [END securitycenter_v1_generated_SecurityCenter_SetFindingState_sync] diff --git a/owl-bot-staging/google-cloud-security_center-v1/snippets/security_center/set_iam_policy.rb b/owl-bot-staging/google-cloud-security_center-v1/snippets/security_center/set_iam_policy.rb new file mode 100644 index 000000000000..61c6f0c2658c --- /dev/null +++ b/owl-bot-staging/google-cloud-security_center-v1/snippets/security_center/set_iam_policy.rb @@ -0,0 +1,47 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +# [START securitycenter_v1_generated_SecurityCenter_SetIamPolicy_sync] +require "google/cloud/security_center/v1" + +## +# Snippet for the set_iam_policy call in the SecurityCenter service +# +# This snippet has been automatically generated and should be regarded as a code +# template only. It will require modifications to work: +# - It may require correct/in-range values for request initialization. +# - It may require specifying regional endpoints when creating the service +# client as shown in https://cloud.google.com/ruby/docs/reference. +# +# This is an auto-generated example demonstrating basic usage of +# Google::Cloud::SecurityCenter::V1::SecurityCenter::Client#set_iam_policy. +# +def set_iam_policy + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::SecurityCenter::V1::SecurityCenter::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Iam::V1::SetIamPolicyRequest.new + + # Call the set_iam_policy method. + result = client.set_iam_policy request + + # The returned object is of type Google::Iam::V1::Policy. + p result +end +# [END securitycenter_v1_generated_SecurityCenter_SetIamPolicy_sync] diff --git a/owl-bot-staging/google-cloud-security_center-v1/snippets/security_center/set_mute.rb b/owl-bot-staging/google-cloud-security_center-v1/snippets/security_center/set_mute.rb new file mode 100644 index 000000000000..0d8d48794099 --- /dev/null +++ b/owl-bot-staging/google-cloud-security_center-v1/snippets/security_center/set_mute.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 securitycenter_v1_generated_SecurityCenter_SetMute_sync] +require "google/cloud/security_center/v1" + +## +# Snippet for the set_mute call in the SecurityCenter service +# +# This snippet has been automatically generated and should be regarded as a code +# template only. It will require modifications to work: +# - It may require correct/in-range values for request initialization. +# - It may require specifying regional endpoints when creating the service +# client as shown in https://cloud.google.com/ruby/docs/reference. +# +# This is an auto-generated example demonstrating basic usage of +# Google::Cloud::SecurityCenter::V1::SecurityCenter::Client#set_mute. +# +def set_mute + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::SecurityCenter::V1::SecurityCenter::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::SecurityCenter::V1::SetMuteRequest.new + + # Call the set_mute method. + result = client.set_mute request + + # The returned object is of type Google::Cloud::SecurityCenter::V1::Finding. + p result +end +# [END securitycenter_v1_generated_SecurityCenter_SetMute_sync] diff --git a/owl-bot-staging/google-cloud-security_center-v1/snippets/security_center/simulate_security_health_analytics_custom_module.rb b/owl-bot-staging/google-cloud-security_center-v1/snippets/security_center/simulate_security_health_analytics_custom_module.rb new file mode 100644 index 000000000000..6573cca21b08 --- /dev/null +++ b/owl-bot-staging/google-cloud-security_center-v1/snippets/security_center/simulate_security_health_analytics_custom_module.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 securitycenter_v1_generated_SecurityCenter_SimulateSecurityHealthAnalyticsCustomModule_sync] +require "google/cloud/security_center/v1" + +## +# Snippet for the simulate_security_health_analytics_custom_module call in the SecurityCenter service +# +# This snippet has been automatically generated and should be regarded as a code +# template only. It will require modifications to work: +# - It may require correct/in-range values for request initialization. +# - It may require specifying regional endpoints when creating the service +# client as shown in https://cloud.google.com/ruby/docs/reference. +# +# This is an auto-generated example demonstrating basic usage of +# Google::Cloud::SecurityCenter::V1::SecurityCenter::Client#simulate_security_health_analytics_custom_module. +# +def simulate_security_health_analytics_custom_module + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::SecurityCenter::V1::SecurityCenter::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::SecurityCenter::V1::SimulateSecurityHealthAnalyticsCustomModuleRequest.new + + # Call the simulate_security_health_analytics_custom_module method. + result = client.simulate_security_health_analytics_custom_module request + + # The returned object is of type Google::Cloud::SecurityCenter::V1::SimulateSecurityHealthAnalyticsCustomModuleResponse. + p result +end +# [END securitycenter_v1_generated_SecurityCenter_SimulateSecurityHealthAnalyticsCustomModule_sync] diff --git a/owl-bot-staging/google-cloud-security_center-v1/snippets/security_center/test_iam_permissions.rb b/owl-bot-staging/google-cloud-security_center-v1/snippets/security_center/test_iam_permissions.rb new file mode 100644 index 000000000000..2beb6f525829 --- /dev/null +++ b/owl-bot-staging/google-cloud-security_center-v1/snippets/security_center/test_iam_permissions.rb @@ -0,0 +1,47 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +# [START securitycenter_v1_generated_SecurityCenter_TestIamPermissions_sync] +require "google/cloud/security_center/v1" + +## +# Snippet for the test_iam_permissions call in the SecurityCenter service +# +# This snippet has been automatically generated and should be regarded as a code +# template only. It will require modifications to work: +# - It may require correct/in-range values for request initialization. +# - It may require specifying regional endpoints when creating the service +# client as shown in https://cloud.google.com/ruby/docs/reference. +# +# This is an auto-generated example demonstrating basic usage of +# Google::Cloud::SecurityCenter::V1::SecurityCenter::Client#test_iam_permissions. +# +def test_iam_permissions + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::SecurityCenter::V1::SecurityCenter::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Iam::V1::TestIamPermissionsRequest.new + + # Call the test_iam_permissions method. + result = client.test_iam_permissions request + + # The returned object is of type Google::Iam::V1::TestIamPermissionsResponse. + p result +end +# [END securitycenter_v1_generated_SecurityCenter_TestIamPermissions_sync] diff --git a/owl-bot-staging/google-cloud-security_center-v1/snippets/security_center/update_big_query_export.rb b/owl-bot-staging/google-cloud-security_center-v1/snippets/security_center/update_big_query_export.rb new file mode 100644 index 000000000000..64a07908fd64 --- /dev/null +++ b/owl-bot-staging/google-cloud-security_center-v1/snippets/security_center/update_big_query_export.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 securitycenter_v1_generated_SecurityCenter_UpdateBigQueryExport_sync] +require "google/cloud/security_center/v1" + +## +# Snippet for the update_big_query_export call in the SecurityCenter service +# +# This snippet has been automatically generated and should be regarded as a code +# template only. It will require modifications to work: +# - It may require correct/in-range values for request initialization. +# - It may require specifying regional endpoints when creating the service +# client as shown in https://cloud.google.com/ruby/docs/reference. +# +# This is an auto-generated example demonstrating basic usage of +# Google::Cloud::SecurityCenter::V1::SecurityCenter::Client#update_big_query_export. +# +def update_big_query_export + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::SecurityCenter::V1::SecurityCenter::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::SecurityCenter::V1::UpdateBigQueryExportRequest.new + + # Call the update_big_query_export method. + result = client.update_big_query_export request + + # The returned object is of type Google::Cloud::SecurityCenter::V1::BigQueryExport. + p result +end +# [END securitycenter_v1_generated_SecurityCenter_UpdateBigQueryExport_sync] diff --git a/owl-bot-staging/google-cloud-security_center-v1/snippets/security_center/update_event_threat_detection_custom_module.rb b/owl-bot-staging/google-cloud-security_center-v1/snippets/security_center/update_event_threat_detection_custom_module.rb new file mode 100644 index 000000000000..20ba7f0b690c --- /dev/null +++ b/owl-bot-staging/google-cloud-security_center-v1/snippets/security_center/update_event_threat_detection_custom_module.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 securitycenter_v1_generated_SecurityCenter_UpdateEventThreatDetectionCustomModule_sync] +require "google/cloud/security_center/v1" + +## +# Snippet for the update_event_threat_detection_custom_module call in the SecurityCenter service +# +# This snippet has been automatically generated and should be regarded as a code +# template only. It will require modifications to work: +# - It may require correct/in-range values for request initialization. +# - It may require specifying regional endpoints when creating the service +# client as shown in https://cloud.google.com/ruby/docs/reference. +# +# This is an auto-generated example demonstrating basic usage of +# Google::Cloud::SecurityCenter::V1::SecurityCenter::Client#update_event_threat_detection_custom_module. +# +def update_event_threat_detection_custom_module + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::SecurityCenter::V1::SecurityCenter::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::SecurityCenter::V1::UpdateEventThreatDetectionCustomModuleRequest.new + + # Call the update_event_threat_detection_custom_module method. + result = client.update_event_threat_detection_custom_module request + + # The returned object is of type Google::Cloud::SecurityCenter::V1::EventThreatDetectionCustomModule. + p result +end +# [END securitycenter_v1_generated_SecurityCenter_UpdateEventThreatDetectionCustomModule_sync] diff --git a/owl-bot-staging/google-cloud-security_center-v1/snippets/security_center/update_external_system.rb b/owl-bot-staging/google-cloud-security_center-v1/snippets/security_center/update_external_system.rb new file mode 100644 index 000000000000..4ec047a6fb39 --- /dev/null +++ b/owl-bot-staging/google-cloud-security_center-v1/snippets/security_center/update_external_system.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 securitycenter_v1_generated_SecurityCenter_UpdateExternalSystem_sync] +require "google/cloud/security_center/v1" + +## +# Snippet for the update_external_system call in the SecurityCenter service +# +# This snippet has been automatically generated and should be regarded as a code +# template only. It will require modifications to work: +# - It may require correct/in-range values for request initialization. +# - It may require specifying regional endpoints when creating the service +# client as shown in https://cloud.google.com/ruby/docs/reference. +# +# This is an auto-generated example demonstrating basic usage of +# Google::Cloud::SecurityCenter::V1::SecurityCenter::Client#update_external_system. +# +def update_external_system + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::SecurityCenter::V1::SecurityCenter::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::SecurityCenter::V1::UpdateExternalSystemRequest.new + + # Call the update_external_system method. + result = client.update_external_system request + + # The returned object is of type Google::Cloud::SecurityCenter::V1::ExternalSystem. + p result +end +# [END securitycenter_v1_generated_SecurityCenter_UpdateExternalSystem_sync] diff --git a/owl-bot-staging/google-cloud-security_center-v1/snippets/security_center/update_finding.rb b/owl-bot-staging/google-cloud-security_center-v1/snippets/security_center/update_finding.rb new file mode 100644 index 000000000000..39355b256e0d --- /dev/null +++ b/owl-bot-staging/google-cloud-security_center-v1/snippets/security_center/update_finding.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 securitycenter_v1_generated_SecurityCenter_UpdateFinding_sync] +require "google/cloud/security_center/v1" + +## +# Snippet for the update_finding call in the SecurityCenter service +# +# This snippet has been automatically generated and should be regarded as a code +# template only. It will require modifications to work: +# - It may require correct/in-range values for request initialization. +# - It may require specifying regional endpoints when creating the service +# client as shown in https://cloud.google.com/ruby/docs/reference. +# +# This is an auto-generated example demonstrating basic usage of +# Google::Cloud::SecurityCenter::V1::SecurityCenter::Client#update_finding. +# +def update_finding + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::SecurityCenter::V1::SecurityCenter::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::SecurityCenter::V1::UpdateFindingRequest.new + + # Call the update_finding method. + result = client.update_finding request + + # The returned object is of type Google::Cloud::SecurityCenter::V1::Finding. + p result +end +# [END securitycenter_v1_generated_SecurityCenter_UpdateFinding_sync] diff --git a/owl-bot-staging/google-cloud-security_center-v1/snippets/security_center/update_mute_config.rb b/owl-bot-staging/google-cloud-security_center-v1/snippets/security_center/update_mute_config.rb new file mode 100644 index 000000000000..aa233b884d74 --- /dev/null +++ b/owl-bot-staging/google-cloud-security_center-v1/snippets/security_center/update_mute_config.rb @@ -0,0 +1,47 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +# [START securitycenter_v1_generated_SecurityCenter_UpdateMuteConfig_sync] +require "google/cloud/security_center/v1" + +## +# Snippet for the update_mute_config call in the SecurityCenter service +# +# This snippet has been automatically generated and should be regarded as a code +# template only. It will require modifications to work: +# - It may require correct/in-range values for request initialization. +# - It may require specifying regional endpoints when creating the service +# client as shown in https://cloud.google.com/ruby/docs/reference. +# +# This is an auto-generated example demonstrating basic usage of +# Google::Cloud::SecurityCenter::V1::SecurityCenter::Client#update_mute_config. +# +def update_mute_config + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::SecurityCenter::V1::SecurityCenter::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::SecurityCenter::V1::UpdateMuteConfigRequest.new + + # Call the update_mute_config method. + result = client.update_mute_config request + + # The returned object is of type Google::Cloud::SecurityCenter::V1::MuteConfig. + p result +end +# [END securitycenter_v1_generated_SecurityCenter_UpdateMuteConfig_sync] diff --git a/owl-bot-staging/google-cloud-security_center-v1/snippets/security_center/update_notification_config.rb b/owl-bot-staging/google-cloud-security_center-v1/snippets/security_center/update_notification_config.rb new file mode 100644 index 000000000000..f976002b3515 --- /dev/null +++ b/owl-bot-staging/google-cloud-security_center-v1/snippets/security_center/update_notification_config.rb @@ -0,0 +1,47 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +# [START securitycenter_v1_generated_SecurityCenter_UpdateNotificationConfig_sync] +require "google/cloud/security_center/v1" + +## +# Snippet for the update_notification_config call in the SecurityCenter service +# +# This snippet has been automatically generated and should be regarded as a code +# template only. It will require modifications to work: +# - It may require correct/in-range values for request initialization. +# - It may require specifying regional endpoints when creating the service +# client as shown in https://cloud.google.com/ruby/docs/reference. +# +# This is an auto-generated example demonstrating basic usage of +# Google::Cloud::SecurityCenter::V1::SecurityCenter::Client#update_notification_config. +# +def update_notification_config + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::SecurityCenter::V1::SecurityCenter::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::SecurityCenter::V1::UpdateNotificationConfigRequest.new + + # Call the update_notification_config method. + result = client.update_notification_config request + + # The returned object is of type Google::Cloud::SecurityCenter::V1::NotificationConfig. + p result +end +# [END securitycenter_v1_generated_SecurityCenter_UpdateNotificationConfig_sync] diff --git a/owl-bot-staging/google-cloud-security_center-v1/snippets/security_center/update_organization_settings.rb b/owl-bot-staging/google-cloud-security_center-v1/snippets/security_center/update_organization_settings.rb new file mode 100644 index 000000000000..a4f402013e90 --- /dev/null +++ b/owl-bot-staging/google-cloud-security_center-v1/snippets/security_center/update_organization_settings.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 securitycenter_v1_generated_SecurityCenter_UpdateOrganizationSettings_sync] +require "google/cloud/security_center/v1" + +## +# Snippet for the update_organization_settings call in the SecurityCenter service +# +# This snippet has been automatically generated and should be regarded as a code +# template only. It will require modifications to work: +# - It may require correct/in-range values for request initialization. +# - It may require specifying regional endpoints when creating the service +# client as shown in https://cloud.google.com/ruby/docs/reference. +# +# This is an auto-generated example demonstrating basic usage of +# Google::Cloud::SecurityCenter::V1::SecurityCenter::Client#update_organization_settings. +# +def update_organization_settings + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::SecurityCenter::V1::SecurityCenter::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::SecurityCenter::V1::UpdateOrganizationSettingsRequest.new + + # Call the update_organization_settings method. + result = client.update_organization_settings request + + # The returned object is of type Google::Cloud::SecurityCenter::V1::OrganizationSettings. + p result +end +# [END securitycenter_v1_generated_SecurityCenter_UpdateOrganizationSettings_sync] diff --git a/owl-bot-staging/google-cloud-security_center-v1/snippets/security_center/update_resource_value_config.rb b/owl-bot-staging/google-cloud-security_center-v1/snippets/security_center/update_resource_value_config.rb new file mode 100644 index 000000000000..40a21d5efc16 --- /dev/null +++ b/owl-bot-staging/google-cloud-security_center-v1/snippets/security_center/update_resource_value_config.rb @@ -0,0 +1,47 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +# [START securitycenter_v1_generated_SecurityCenter_UpdateResourceValueConfig_sync] +require "google/cloud/security_center/v1" + +## +# Snippet for the update_resource_value_config call in the SecurityCenter service +# +# This snippet has been automatically generated and should be regarded as a code +# template only. It will require modifications to work: +# - It may require correct/in-range values for request initialization. +# - It may require specifying regional endpoints when creating the service +# client as shown in https://cloud.google.com/ruby/docs/reference. +# +# This is an auto-generated example demonstrating basic usage of +# Google::Cloud::SecurityCenter::V1::SecurityCenter::Client#update_resource_value_config. +# +def update_resource_value_config + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::SecurityCenter::V1::SecurityCenter::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::SecurityCenter::V1::UpdateResourceValueConfigRequest.new + + # Call the update_resource_value_config method. + result = client.update_resource_value_config request + + # The returned object is of type Google::Cloud::SecurityCenter::V1::ResourceValueConfig. + p result +end +# [END securitycenter_v1_generated_SecurityCenter_UpdateResourceValueConfig_sync] diff --git a/owl-bot-staging/google-cloud-security_center-v1/snippets/security_center/update_security_health_analytics_custom_module.rb b/owl-bot-staging/google-cloud-security_center-v1/snippets/security_center/update_security_health_analytics_custom_module.rb new file mode 100644 index 000000000000..8e83edf227ea --- /dev/null +++ b/owl-bot-staging/google-cloud-security_center-v1/snippets/security_center/update_security_health_analytics_custom_module.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 securitycenter_v1_generated_SecurityCenter_UpdateSecurityHealthAnalyticsCustomModule_sync] +require "google/cloud/security_center/v1" + +## +# Snippet for the update_security_health_analytics_custom_module call in the SecurityCenter service +# +# This snippet has been automatically generated and should be regarded as a code +# template only. It will require modifications to work: +# - It may require correct/in-range values for request initialization. +# - It may require specifying regional endpoints when creating the service +# client as shown in https://cloud.google.com/ruby/docs/reference. +# +# This is an auto-generated example demonstrating basic usage of +# Google::Cloud::SecurityCenter::V1::SecurityCenter::Client#update_security_health_analytics_custom_module. +# +def update_security_health_analytics_custom_module + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::SecurityCenter::V1::SecurityCenter::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::SecurityCenter::V1::UpdateSecurityHealthAnalyticsCustomModuleRequest.new + + # Call the update_security_health_analytics_custom_module method. + result = client.update_security_health_analytics_custom_module request + + # The returned object is of type Google::Cloud::SecurityCenter::V1::SecurityHealthAnalyticsCustomModule. + p result +end +# [END securitycenter_v1_generated_SecurityCenter_UpdateSecurityHealthAnalyticsCustomModule_sync] diff --git a/owl-bot-staging/google-cloud-security_center-v1/snippets/security_center/update_security_marks.rb b/owl-bot-staging/google-cloud-security_center-v1/snippets/security_center/update_security_marks.rb new file mode 100644 index 000000000000..04da82c1a94b --- /dev/null +++ b/owl-bot-staging/google-cloud-security_center-v1/snippets/security_center/update_security_marks.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 securitycenter_v1_generated_SecurityCenter_UpdateSecurityMarks_sync] +require "google/cloud/security_center/v1" + +## +# Snippet for the update_security_marks call in the SecurityCenter service +# +# This snippet has been automatically generated and should be regarded as a code +# template only. It will require modifications to work: +# - It may require correct/in-range values for request initialization. +# - It may require specifying regional endpoints when creating the service +# client as shown in https://cloud.google.com/ruby/docs/reference. +# +# This is an auto-generated example demonstrating basic usage of +# Google::Cloud::SecurityCenter::V1::SecurityCenter::Client#update_security_marks. +# +def update_security_marks + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::SecurityCenter::V1::SecurityCenter::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::SecurityCenter::V1::UpdateSecurityMarksRequest.new + + # Call the update_security_marks method. + result = client.update_security_marks request + + # The returned object is of type Google::Cloud::SecurityCenter::V1::SecurityMarks. + p result +end +# [END securitycenter_v1_generated_SecurityCenter_UpdateSecurityMarks_sync] diff --git a/owl-bot-staging/google-cloud-security_center-v1/snippets/security_center/update_source.rb b/owl-bot-staging/google-cloud-security_center-v1/snippets/security_center/update_source.rb new file mode 100644 index 000000000000..6f0ba52cd6f1 --- /dev/null +++ b/owl-bot-staging/google-cloud-security_center-v1/snippets/security_center/update_source.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 securitycenter_v1_generated_SecurityCenter_UpdateSource_sync] +require "google/cloud/security_center/v1" + +## +# Snippet for the update_source call in the SecurityCenter service +# +# This snippet has been automatically generated and should be regarded as a code +# template only. It will require modifications to work: +# - It may require correct/in-range values for request initialization. +# - It may require specifying regional endpoints when creating the service +# client as shown in https://cloud.google.com/ruby/docs/reference. +# +# This is an auto-generated example demonstrating basic usage of +# Google::Cloud::SecurityCenter::V1::SecurityCenter::Client#update_source. +# +def update_source + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::SecurityCenter::V1::SecurityCenter::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::SecurityCenter::V1::UpdateSourceRequest.new + + # Call the update_source method. + result = client.update_source request + + # The returned object is of type Google::Cloud::SecurityCenter::V1::Source. + p result +end +# [END securitycenter_v1_generated_SecurityCenter_UpdateSource_sync] diff --git a/owl-bot-staging/google-cloud-security_center-v1/snippets/security_center/validate_event_threat_detection_custom_module.rb b/owl-bot-staging/google-cloud-security_center-v1/snippets/security_center/validate_event_threat_detection_custom_module.rb new file mode 100644 index 000000000000..31919bb29465 --- /dev/null +++ b/owl-bot-staging/google-cloud-security_center-v1/snippets/security_center/validate_event_threat_detection_custom_module.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 securitycenter_v1_generated_SecurityCenter_ValidateEventThreatDetectionCustomModule_sync] +require "google/cloud/security_center/v1" + +## +# Snippet for the validate_event_threat_detection_custom_module call in the SecurityCenter service +# +# This snippet has been automatically generated and should be regarded as a code +# template only. It will require modifications to work: +# - It may require correct/in-range values for request initialization. +# - It may require specifying regional endpoints when creating the service +# client as shown in https://cloud.google.com/ruby/docs/reference. +# +# This is an auto-generated example demonstrating basic usage of +# Google::Cloud::SecurityCenter::V1::SecurityCenter::Client#validate_event_threat_detection_custom_module. +# +def validate_event_threat_detection_custom_module + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::SecurityCenter::V1::SecurityCenter::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::SecurityCenter::V1::ValidateEventThreatDetectionCustomModuleRequest.new + + # Call the validate_event_threat_detection_custom_module method. + result = client.validate_event_threat_detection_custom_module request + + # The returned object is of type Google::Cloud::SecurityCenter::V1::ValidateEventThreatDetectionCustomModuleResponse. + p result +end +# [END securitycenter_v1_generated_SecurityCenter_ValidateEventThreatDetectionCustomModule_sync] diff --git a/owl-bot-staging/google-cloud-security_center-v1/snippets/snippet_metadata_google.cloud.securitycenter.v1.json b/owl-bot-staging/google-cloud-security_center-v1/snippets/snippet_metadata_google.cloud.securitycenter.v1.json new file mode 100644 index 000000000000..97ec18a5449f --- /dev/null +++ b/owl-bot-staging/google-cloud-security_center-v1/snippets/snippet_metadata_google.cloud.securitycenter.v1.json @@ -0,0 +1,2535 @@ +{ + "client_library": { + "name": "google-cloud-security_center-v1", + "version": "", + "language": "RUBY", + "apis": [ + { + "id": "google.cloud.securitycenter.v1", + "version": "v1" + } + ] + }, + "snippets": [ + { + "region_tag": "securitycenter_v1_generated_SecurityCenter_BulkMuteFindings_sync", + "title": "Snippet for the bulk_mute_findings call in the SecurityCenter service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::SecurityCenter::V1::SecurityCenter::Client#bulk_mute_findings.", + "file": "security_center/bulk_mute_findings.rb", + "language": "RUBY", + "client_method": { + "short_name": "bulk_mute_findings", + "full_name": "::Google::Cloud::SecurityCenter::V1::SecurityCenter::Client#bulk_mute_findings", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::SecurityCenter::V1::BulkMuteFindingsRequest", + "name": "request" + } + ], + "result_type": "::Google::Longrunning::Operation", + "client": { + "short_name": "SecurityCenter::Client", + "full_name": "::Google::Cloud::SecurityCenter::V1::SecurityCenter::Client" + }, + "method": { + "short_name": "BulkMuteFindings", + "full_name": "google.cloud.securitycenter.v1.SecurityCenter.BulkMuteFindings", + "service": { + "short_name": "SecurityCenter", + "full_name": "google.cloud.securitycenter.v1.SecurityCenter" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 53, + "type": "FULL" + } + ] + }, + { + "region_tag": "securitycenter_v1_generated_SecurityCenter_CreateSecurityHealthAnalyticsCustomModule_sync", + "title": "Snippet for the create_security_health_analytics_custom_module call in the SecurityCenter service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::SecurityCenter::V1::SecurityCenter::Client#create_security_health_analytics_custom_module.", + "file": "security_center/create_security_health_analytics_custom_module.rb", + "language": "RUBY", + "client_method": { + "short_name": "create_security_health_analytics_custom_module", + "full_name": "::Google::Cloud::SecurityCenter::V1::SecurityCenter::Client#create_security_health_analytics_custom_module", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::SecurityCenter::V1::CreateSecurityHealthAnalyticsCustomModuleRequest", + "name": "request" + } + ], + "result_type": "::Google::Cloud::SecurityCenter::V1::SecurityHealthAnalyticsCustomModule", + "client": { + "short_name": "SecurityCenter::Client", + "full_name": "::Google::Cloud::SecurityCenter::V1::SecurityCenter::Client" + }, + "method": { + "short_name": "CreateSecurityHealthAnalyticsCustomModule", + "full_name": "google.cloud.securitycenter.v1.SecurityCenter.CreateSecurityHealthAnalyticsCustomModule", + "service": { + "short_name": "SecurityCenter", + "full_name": "google.cloud.securitycenter.v1.SecurityCenter" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 46, + "type": "FULL" + } + ] + }, + { + "region_tag": "securitycenter_v1_generated_SecurityCenter_CreateSource_sync", + "title": "Snippet for the create_source call in the SecurityCenter service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::SecurityCenter::V1::SecurityCenter::Client#create_source.", + "file": "security_center/create_source.rb", + "language": "RUBY", + "client_method": { + "short_name": "create_source", + "full_name": "::Google::Cloud::SecurityCenter::V1::SecurityCenter::Client#create_source", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::SecurityCenter::V1::CreateSourceRequest", + "name": "request" + } + ], + "result_type": "::Google::Cloud::SecurityCenter::V1::Source", + "client": { + "short_name": "SecurityCenter::Client", + "full_name": "::Google::Cloud::SecurityCenter::V1::SecurityCenter::Client" + }, + "method": { + "short_name": "CreateSource", + "full_name": "google.cloud.securitycenter.v1.SecurityCenter.CreateSource", + "service": { + "short_name": "SecurityCenter", + "full_name": "google.cloud.securitycenter.v1.SecurityCenter" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 46, + "type": "FULL" + } + ] + }, + { + "region_tag": "securitycenter_v1_generated_SecurityCenter_CreateFinding_sync", + "title": "Snippet for the create_finding call in the SecurityCenter service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::SecurityCenter::V1::SecurityCenter::Client#create_finding.", + "file": "security_center/create_finding.rb", + "language": "RUBY", + "client_method": { + "short_name": "create_finding", + "full_name": "::Google::Cloud::SecurityCenter::V1::SecurityCenter::Client#create_finding", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::SecurityCenter::V1::CreateFindingRequest", + "name": "request" + } + ], + "result_type": "::Google::Cloud::SecurityCenter::V1::Finding", + "client": { + "short_name": "SecurityCenter::Client", + "full_name": "::Google::Cloud::SecurityCenter::V1::SecurityCenter::Client" + }, + "method": { + "short_name": "CreateFinding", + "full_name": "google.cloud.securitycenter.v1.SecurityCenter.CreateFinding", + "service": { + "short_name": "SecurityCenter", + "full_name": "google.cloud.securitycenter.v1.SecurityCenter" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 46, + "type": "FULL" + } + ] + }, + { + "region_tag": "securitycenter_v1_generated_SecurityCenter_CreateMuteConfig_sync", + "title": "Snippet for the create_mute_config call in the SecurityCenter service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::SecurityCenter::V1::SecurityCenter::Client#create_mute_config.", + "file": "security_center/create_mute_config.rb", + "language": "RUBY", + "client_method": { + "short_name": "create_mute_config", + "full_name": "::Google::Cloud::SecurityCenter::V1::SecurityCenter::Client#create_mute_config", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::SecurityCenter::V1::CreateMuteConfigRequest", + "name": "request" + } + ], + "result_type": "::Google::Cloud::SecurityCenter::V1::MuteConfig", + "client": { + "short_name": "SecurityCenter::Client", + "full_name": "::Google::Cloud::SecurityCenter::V1::SecurityCenter::Client" + }, + "method": { + "short_name": "CreateMuteConfig", + "full_name": "google.cloud.securitycenter.v1.SecurityCenter.CreateMuteConfig", + "service": { + "short_name": "SecurityCenter", + "full_name": "google.cloud.securitycenter.v1.SecurityCenter" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 46, + "type": "FULL" + } + ] + }, + { + "region_tag": "securitycenter_v1_generated_SecurityCenter_CreateNotificationConfig_sync", + "title": "Snippet for the create_notification_config call in the SecurityCenter service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::SecurityCenter::V1::SecurityCenter::Client#create_notification_config.", + "file": "security_center/create_notification_config.rb", + "language": "RUBY", + "client_method": { + "short_name": "create_notification_config", + "full_name": "::Google::Cloud::SecurityCenter::V1::SecurityCenter::Client#create_notification_config", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::SecurityCenter::V1::CreateNotificationConfigRequest", + "name": "request" + } + ], + "result_type": "::Google::Cloud::SecurityCenter::V1::NotificationConfig", + "client": { + "short_name": "SecurityCenter::Client", + "full_name": "::Google::Cloud::SecurityCenter::V1::SecurityCenter::Client" + }, + "method": { + "short_name": "CreateNotificationConfig", + "full_name": "google.cloud.securitycenter.v1.SecurityCenter.CreateNotificationConfig", + "service": { + "short_name": "SecurityCenter", + "full_name": "google.cloud.securitycenter.v1.SecurityCenter" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 46, + "type": "FULL" + } + ] + }, + { + "region_tag": "securitycenter_v1_generated_SecurityCenter_DeleteMuteConfig_sync", + "title": "Snippet for the delete_mute_config call in the SecurityCenter service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::SecurityCenter::V1::SecurityCenter::Client#delete_mute_config.", + "file": "security_center/delete_mute_config.rb", + "language": "RUBY", + "client_method": { + "short_name": "delete_mute_config", + "full_name": "::Google::Cloud::SecurityCenter::V1::SecurityCenter::Client#delete_mute_config", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::SecurityCenter::V1::DeleteMuteConfigRequest", + "name": "request" + } + ], + "result_type": "::Google::Protobuf::Empty", + "client": { + "short_name": "SecurityCenter::Client", + "full_name": "::Google::Cloud::SecurityCenter::V1::SecurityCenter::Client" + }, + "method": { + "short_name": "DeleteMuteConfig", + "full_name": "google.cloud.securitycenter.v1.SecurityCenter.DeleteMuteConfig", + "service": { + "short_name": "SecurityCenter", + "full_name": "google.cloud.securitycenter.v1.SecurityCenter" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 46, + "type": "FULL" + } + ] + }, + { + "region_tag": "securitycenter_v1_generated_SecurityCenter_DeleteNotificationConfig_sync", + "title": "Snippet for the delete_notification_config call in the SecurityCenter service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::SecurityCenter::V1::SecurityCenter::Client#delete_notification_config.", + "file": "security_center/delete_notification_config.rb", + "language": "RUBY", + "client_method": { + "short_name": "delete_notification_config", + "full_name": "::Google::Cloud::SecurityCenter::V1::SecurityCenter::Client#delete_notification_config", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::SecurityCenter::V1::DeleteNotificationConfigRequest", + "name": "request" + } + ], + "result_type": "::Google::Protobuf::Empty", + "client": { + "short_name": "SecurityCenter::Client", + "full_name": "::Google::Cloud::SecurityCenter::V1::SecurityCenter::Client" + }, + "method": { + "short_name": "DeleteNotificationConfig", + "full_name": "google.cloud.securitycenter.v1.SecurityCenter.DeleteNotificationConfig", + "service": { + "short_name": "SecurityCenter", + "full_name": "google.cloud.securitycenter.v1.SecurityCenter" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 46, + "type": "FULL" + } + ] + }, + { + "region_tag": "securitycenter_v1_generated_SecurityCenter_DeleteSecurityHealthAnalyticsCustomModule_sync", + "title": "Snippet for the delete_security_health_analytics_custom_module call in the SecurityCenter service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::SecurityCenter::V1::SecurityCenter::Client#delete_security_health_analytics_custom_module.", + "file": "security_center/delete_security_health_analytics_custom_module.rb", + "language": "RUBY", + "client_method": { + "short_name": "delete_security_health_analytics_custom_module", + "full_name": "::Google::Cloud::SecurityCenter::V1::SecurityCenter::Client#delete_security_health_analytics_custom_module", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::SecurityCenter::V1::DeleteSecurityHealthAnalyticsCustomModuleRequest", + "name": "request" + } + ], + "result_type": "::Google::Protobuf::Empty", + "client": { + "short_name": "SecurityCenter::Client", + "full_name": "::Google::Cloud::SecurityCenter::V1::SecurityCenter::Client" + }, + "method": { + "short_name": "DeleteSecurityHealthAnalyticsCustomModule", + "full_name": "google.cloud.securitycenter.v1.SecurityCenter.DeleteSecurityHealthAnalyticsCustomModule", + "service": { + "short_name": "SecurityCenter", + "full_name": "google.cloud.securitycenter.v1.SecurityCenter" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 46, + "type": "FULL" + } + ] + }, + { + "region_tag": "securitycenter_v1_generated_SecurityCenter_GetSimulation_sync", + "title": "Snippet for the get_simulation call in the SecurityCenter service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::SecurityCenter::V1::SecurityCenter::Client#get_simulation.", + "file": "security_center/get_simulation.rb", + "language": "RUBY", + "client_method": { + "short_name": "get_simulation", + "full_name": "::Google::Cloud::SecurityCenter::V1::SecurityCenter::Client#get_simulation", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::SecurityCenter::V1::GetSimulationRequest", + "name": "request" + } + ], + "result_type": "::Google::Cloud::SecurityCenter::V1::Simulation", + "client": { + "short_name": "SecurityCenter::Client", + "full_name": "::Google::Cloud::SecurityCenter::V1::SecurityCenter::Client" + }, + "method": { + "short_name": "GetSimulation", + "full_name": "google.cloud.securitycenter.v1.SecurityCenter.GetSimulation", + "service": { + "short_name": "SecurityCenter", + "full_name": "google.cloud.securitycenter.v1.SecurityCenter" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 46, + "type": "FULL" + } + ] + }, + { + "region_tag": "securitycenter_v1_generated_SecurityCenter_GetValuedResource_sync", + "title": "Snippet for the get_valued_resource call in the SecurityCenter service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::SecurityCenter::V1::SecurityCenter::Client#get_valued_resource.", + "file": "security_center/get_valued_resource.rb", + "language": "RUBY", + "client_method": { + "short_name": "get_valued_resource", + "full_name": "::Google::Cloud::SecurityCenter::V1::SecurityCenter::Client#get_valued_resource", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::SecurityCenter::V1::GetValuedResourceRequest", + "name": "request" + } + ], + "result_type": "::Google::Cloud::SecurityCenter::V1::ValuedResource", + "client": { + "short_name": "SecurityCenter::Client", + "full_name": "::Google::Cloud::SecurityCenter::V1::SecurityCenter::Client" + }, + "method": { + "short_name": "GetValuedResource", + "full_name": "google.cloud.securitycenter.v1.SecurityCenter.GetValuedResource", + "service": { + "short_name": "SecurityCenter", + "full_name": "google.cloud.securitycenter.v1.SecurityCenter" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 46, + "type": "FULL" + } + ] + }, + { + "region_tag": "securitycenter_v1_generated_SecurityCenter_GetBigQueryExport_sync", + "title": "Snippet for the get_big_query_export call in the SecurityCenter service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::SecurityCenter::V1::SecurityCenter::Client#get_big_query_export.", + "file": "security_center/get_big_query_export.rb", + "language": "RUBY", + "client_method": { + "short_name": "get_big_query_export", + "full_name": "::Google::Cloud::SecurityCenter::V1::SecurityCenter::Client#get_big_query_export", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::SecurityCenter::V1::GetBigQueryExportRequest", + "name": "request" + } + ], + "result_type": "::Google::Cloud::SecurityCenter::V1::BigQueryExport", + "client": { + "short_name": "SecurityCenter::Client", + "full_name": "::Google::Cloud::SecurityCenter::V1::SecurityCenter::Client" + }, + "method": { + "short_name": "GetBigQueryExport", + "full_name": "google.cloud.securitycenter.v1.SecurityCenter.GetBigQueryExport", + "service": { + "short_name": "SecurityCenter", + "full_name": "google.cloud.securitycenter.v1.SecurityCenter" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 46, + "type": "FULL" + } + ] + }, + { + "region_tag": "securitycenter_v1_generated_SecurityCenter_GetIamPolicy_sync", + "title": "Snippet for the get_iam_policy call in the SecurityCenter service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::SecurityCenter::V1::SecurityCenter::Client#get_iam_policy.", + "file": "security_center/get_iam_policy.rb", + "language": "RUBY", + "client_method": { + "short_name": "get_iam_policy", + "full_name": "::Google::Cloud::SecurityCenter::V1::SecurityCenter::Client#get_iam_policy", + "async": false, + "parameters": [ + { + "type": "::Google::Iam::V1::GetIamPolicyRequest", + "name": "request" + } + ], + "result_type": "::Google::Iam::V1::Policy", + "client": { + "short_name": "SecurityCenter::Client", + "full_name": "::Google::Cloud::SecurityCenter::V1::SecurityCenter::Client" + }, + "method": { + "short_name": "GetIamPolicy", + "full_name": "google.cloud.securitycenter.v1.SecurityCenter.GetIamPolicy", + "service": { + "short_name": "SecurityCenter", + "full_name": "google.cloud.securitycenter.v1.SecurityCenter" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 46, + "type": "FULL" + } + ] + }, + { + "region_tag": "securitycenter_v1_generated_SecurityCenter_GetMuteConfig_sync", + "title": "Snippet for the get_mute_config call in the SecurityCenter service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::SecurityCenter::V1::SecurityCenter::Client#get_mute_config.", + "file": "security_center/get_mute_config.rb", + "language": "RUBY", + "client_method": { + "short_name": "get_mute_config", + "full_name": "::Google::Cloud::SecurityCenter::V1::SecurityCenter::Client#get_mute_config", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::SecurityCenter::V1::GetMuteConfigRequest", + "name": "request" + } + ], + "result_type": "::Google::Cloud::SecurityCenter::V1::MuteConfig", + "client": { + "short_name": "SecurityCenter::Client", + "full_name": "::Google::Cloud::SecurityCenter::V1::SecurityCenter::Client" + }, + "method": { + "short_name": "GetMuteConfig", + "full_name": "google.cloud.securitycenter.v1.SecurityCenter.GetMuteConfig", + "service": { + "short_name": "SecurityCenter", + "full_name": "google.cloud.securitycenter.v1.SecurityCenter" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 46, + "type": "FULL" + } + ] + }, + { + "region_tag": "securitycenter_v1_generated_SecurityCenter_GetNotificationConfig_sync", + "title": "Snippet for the get_notification_config call in the SecurityCenter service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::SecurityCenter::V1::SecurityCenter::Client#get_notification_config.", + "file": "security_center/get_notification_config.rb", + "language": "RUBY", + "client_method": { + "short_name": "get_notification_config", + "full_name": "::Google::Cloud::SecurityCenter::V1::SecurityCenter::Client#get_notification_config", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::SecurityCenter::V1::GetNotificationConfigRequest", + "name": "request" + } + ], + "result_type": "::Google::Cloud::SecurityCenter::V1::NotificationConfig", + "client": { + "short_name": "SecurityCenter::Client", + "full_name": "::Google::Cloud::SecurityCenter::V1::SecurityCenter::Client" + }, + "method": { + "short_name": "GetNotificationConfig", + "full_name": "google.cloud.securitycenter.v1.SecurityCenter.GetNotificationConfig", + "service": { + "short_name": "SecurityCenter", + "full_name": "google.cloud.securitycenter.v1.SecurityCenter" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 46, + "type": "FULL" + } + ] + }, + { + "region_tag": "securitycenter_v1_generated_SecurityCenter_GetOrganizationSettings_sync", + "title": "Snippet for the get_organization_settings call in the SecurityCenter service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::SecurityCenter::V1::SecurityCenter::Client#get_organization_settings.", + "file": "security_center/get_organization_settings.rb", + "language": "RUBY", + "client_method": { + "short_name": "get_organization_settings", + "full_name": "::Google::Cloud::SecurityCenter::V1::SecurityCenter::Client#get_organization_settings", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::SecurityCenter::V1::GetOrganizationSettingsRequest", + "name": "request" + } + ], + "result_type": "::Google::Cloud::SecurityCenter::V1::OrganizationSettings", + "client": { + "short_name": "SecurityCenter::Client", + "full_name": "::Google::Cloud::SecurityCenter::V1::SecurityCenter::Client" + }, + "method": { + "short_name": "GetOrganizationSettings", + "full_name": "google.cloud.securitycenter.v1.SecurityCenter.GetOrganizationSettings", + "service": { + "short_name": "SecurityCenter", + "full_name": "google.cloud.securitycenter.v1.SecurityCenter" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 46, + "type": "FULL" + } + ] + }, + { + "region_tag": "securitycenter_v1_generated_SecurityCenter_GetEffectiveSecurityHealthAnalyticsCustomModule_sync", + "title": "Snippet for the get_effective_security_health_analytics_custom_module call in the SecurityCenter service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::SecurityCenter::V1::SecurityCenter::Client#get_effective_security_health_analytics_custom_module.", + "file": "security_center/get_effective_security_health_analytics_custom_module.rb", + "language": "RUBY", + "client_method": { + "short_name": "get_effective_security_health_analytics_custom_module", + "full_name": "::Google::Cloud::SecurityCenter::V1::SecurityCenter::Client#get_effective_security_health_analytics_custom_module", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::SecurityCenter::V1::GetEffectiveSecurityHealthAnalyticsCustomModuleRequest", + "name": "request" + } + ], + "result_type": "::Google::Cloud::SecurityCenter::V1::EffectiveSecurityHealthAnalyticsCustomModule", + "client": { + "short_name": "SecurityCenter::Client", + "full_name": "::Google::Cloud::SecurityCenter::V1::SecurityCenter::Client" + }, + "method": { + "short_name": "GetEffectiveSecurityHealthAnalyticsCustomModule", + "full_name": "google.cloud.securitycenter.v1.SecurityCenter.GetEffectiveSecurityHealthAnalyticsCustomModule", + "service": { + "short_name": "SecurityCenter", + "full_name": "google.cloud.securitycenter.v1.SecurityCenter" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 46, + "type": "FULL" + } + ] + }, + { + "region_tag": "securitycenter_v1_generated_SecurityCenter_GetSecurityHealthAnalyticsCustomModule_sync", + "title": "Snippet for the get_security_health_analytics_custom_module call in the SecurityCenter service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::SecurityCenter::V1::SecurityCenter::Client#get_security_health_analytics_custom_module.", + "file": "security_center/get_security_health_analytics_custom_module.rb", + "language": "RUBY", + "client_method": { + "short_name": "get_security_health_analytics_custom_module", + "full_name": "::Google::Cloud::SecurityCenter::V1::SecurityCenter::Client#get_security_health_analytics_custom_module", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::SecurityCenter::V1::GetSecurityHealthAnalyticsCustomModuleRequest", + "name": "request" + } + ], + "result_type": "::Google::Cloud::SecurityCenter::V1::SecurityHealthAnalyticsCustomModule", + "client": { + "short_name": "SecurityCenter::Client", + "full_name": "::Google::Cloud::SecurityCenter::V1::SecurityCenter::Client" + }, + "method": { + "short_name": "GetSecurityHealthAnalyticsCustomModule", + "full_name": "google.cloud.securitycenter.v1.SecurityCenter.GetSecurityHealthAnalyticsCustomModule", + "service": { + "short_name": "SecurityCenter", + "full_name": "google.cloud.securitycenter.v1.SecurityCenter" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 46, + "type": "FULL" + } + ] + }, + { + "region_tag": "securitycenter_v1_generated_SecurityCenter_GetSource_sync", + "title": "Snippet for the get_source call in the SecurityCenter service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::SecurityCenter::V1::SecurityCenter::Client#get_source.", + "file": "security_center/get_source.rb", + "language": "RUBY", + "client_method": { + "short_name": "get_source", + "full_name": "::Google::Cloud::SecurityCenter::V1::SecurityCenter::Client#get_source", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::SecurityCenter::V1::GetSourceRequest", + "name": "request" + } + ], + "result_type": "::Google::Cloud::SecurityCenter::V1::Source", + "client": { + "short_name": "SecurityCenter::Client", + "full_name": "::Google::Cloud::SecurityCenter::V1::SecurityCenter::Client" + }, + "method": { + "short_name": "GetSource", + "full_name": "google.cloud.securitycenter.v1.SecurityCenter.GetSource", + "service": { + "short_name": "SecurityCenter", + "full_name": "google.cloud.securitycenter.v1.SecurityCenter" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 46, + "type": "FULL" + } + ] + }, + { + "region_tag": "securitycenter_v1_generated_SecurityCenter_GroupAssets_sync", + "title": "Snippet for the group_assets call in the SecurityCenter service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::SecurityCenter::V1::SecurityCenter::Client#group_assets.", + "file": "security_center/group_assets.rb", + "language": "RUBY", + "client_method": { + "short_name": "group_assets", + "full_name": "::Google::Cloud::SecurityCenter::V1::SecurityCenter::Client#group_assets", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::SecurityCenter::V1::GroupAssetsRequest", + "name": "request" + } + ], + "result_type": "::Google::Cloud::SecurityCenter::V1::GroupAssetsResponse", + "client": { + "short_name": "SecurityCenter::Client", + "full_name": "::Google::Cloud::SecurityCenter::V1::SecurityCenter::Client" + }, + "method": { + "short_name": "GroupAssets", + "full_name": "google.cloud.securitycenter.v1.SecurityCenter.GroupAssets", + "service": { + "short_name": "SecurityCenter", + "full_name": "google.cloud.securitycenter.v1.SecurityCenter" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 50, + "type": "FULL" + } + ] + }, + { + "region_tag": "securitycenter_v1_generated_SecurityCenter_GroupFindings_sync", + "title": "Snippet for the group_findings call in the SecurityCenter service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::SecurityCenter::V1::SecurityCenter::Client#group_findings.", + "file": "security_center/group_findings.rb", + "language": "RUBY", + "client_method": { + "short_name": "group_findings", + "full_name": "::Google::Cloud::SecurityCenter::V1::SecurityCenter::Client#group_findings", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::SecurityCenter::V1::GroupFindingsRequest", + "name": "request" + } + ], + "result_type": "::Google::Cloud::SecurityCenter::V1::GroupFindingsResponse", + "client": { + "short_name": "SecurityCenter::Client", + "full_name": "::Google::Cloud::SecurityCenter::V1::SecurityCenter::Client" + }, + "method": { + "short_name": "GroupFindings", + "full_name": "google.cloud.securitycenter.v1.SecurityCenter.GroupFindings", + "service": { + "short_name": "SecurityCenter", + "full_name": "google.cloud.securitycenter.v1.SecurityCenter" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 50, + "type": "FULL" + } + ] + }, + { + "region_tag": "securitycenter_v1_generated_SecurityCenter_ListAssets_sync", + "title": "Snippet for the list_assets call in the SecurityCenter service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::SecurityCenter::V1::SecurityCenter::Client#list_assets.", + "file": "security_center/list_assets.rb", + "language": "RUBY", + "client_method": { + "short_name": "list_assets", + "full_name": "::Google::Cloud::SecurityCenter::V1::SecurityCenter::Client#list_assets", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::SecurityCenter::V1::ListAssetsRequest", + "name": "request" + } + ], + "result_type": "::Google::Cloud::SecurityCenter::V1::ListAssetsResponse", + "client": { + "short_name": "SecurityCenter::Client", + "full_name": "::Google::Cloud::SecurityCenter::V1::SecurityCenter::Client" + }, + "method": { + "short_name": "ListAssets", + "full_name": "google.cloud.securitycenter.v1.SecurityCenter.ListAssets", + "service": { + "short_name": "SecurityCenter", + "full_name": "google.cloud.securitycenter.v1.SecurityCenter" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 50, + "type": "FULL" + } + ] + }, + { + "region_tag": "securitycenter_v1_generated_SecurityCenter_ListDescendantSecurityHealthAnalyticsCustomModules_sync", + "title": "Snippet for the list_descendant_security_health_analytics_custom_modules call in the SecurityCenter service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::SecurityCenter::V1::SecurityCenter::Client#list_descendant_security_health_analytics_custom_modules.", + "file": "security_center/list_descendant_security_health_analytics_custom_modules.rb", + "language": "RUBY", + "client_method": { + "short_name": "list_descendant_security_health_analytics_custom_modules", + "full_name": "::Google::Cloud::SecurityCenter::V1::SecurityCenter::Client#list_descendant_security_health_analytics_custom_modules", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::SecurityCenter::V1::ListDescendantSecurityHealthAnalyticsCustomModulesRequest", + "name": "request" + } + ], + "result_type": "::Google::Cloud::SecurityCenter::V1::ListDescendantSecurityHealthAnalyticsCustomModulesResponse", + "client": { + "short_name": "SecurityCenter::Client", + "full_name": "::Google::Cloud::SecurityCenter::V1::SecurityCenter::Client" + }, + "method": { + "short_name": "ListDescendantSecurityHealthAnalyticsCustomModules", + "full_name": "google.cloud.securitycenter.v1.SecurityCenter.ListDescendantSecurityHealthAnalyticsCustomModules", + "service": { + "short_name": "SecurityCenter", + "full_name": "google.cloud.securitycenter.v1.SecurityCenter" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 50, + "type": "FULL" + } + ] + }, + { + "region_tag": "securitycenter_v1_generated_SecurityCenter_ListFindings_sync", + "title": "Snippet for the list_findings call in the SecurityCenter service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::SecurityCenter::V1::SecurityCenter::Client#list_findings.", + "file": "security_center/list_findings.rb", + "language": "RUBY", + "client_method": { + "short_name": "list_findings", + "full_name": "::Google::Cloud::SecurityCenter::V1::SecurityCenter::Client#list_findings", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::SecurityCenter::V1::ListFindingsRequest", + "name": "request" + } + ], + "result_type": "::Google::Cloud::SecurityCenter::V1::ListFindingsResponse", + "client": { + "short_name": "SecurityCenter::Client", + "full_name": "::Google::Cloud::SecurityCenter::V1::SecurityCenter::Client" + }, + "method": { + "short_name": "ListFindings", + "full_name": "google.cloud.securitycenter.v1.SecurityCenter.ListFindings", + "service": { + "short_name": "SecurityCenter", + "full_name": "google.cloud.securitycenter.v1.SecurityCenter" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 50, + "type": "FULL" + } + ] + }, + { + "region_tag": "securitycenter_v1_generated_SecurityCenter_ListMuteConfigs_sync", + "title": "Snippet for the list_mute_configs call in the SecurityCenter service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::SecurityCenter::V1::SecurityCenter::Client#list_mute_configs.", + "file": "security_center/list_mute_configs.rb", + "language": "RUBY", + "client_method": { + "short_name": "list_mute_configs", + "full_name": "::Google::Cloud::SecurityCenter::V1::SecurityCenter::Client#list_mute_configs", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::SecurityCenter::V1::ListMuteConfigsRequest", + "name": "request" + } + ], + "result_type": "::Google::Cloud::SecurityCenter::V1::ListMuteConfigsResponse", + "client": { + "short_name": "SecurityCenter::Client", + "full_name": "::Google::Cloud::SecurityCenter::V1::SecurityCenter::Client" + }, + "method": { + "short_name": "ListMuteConfigs", + "full_name": "google.cloud.securitycenter.v1.SecurityCenter.ListMuteConfigs", + "service": { + "short_name": "SecurityCenter", + "full_name": "google.cloud.securitycenter.v1.SecurityCenter" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 50, + "type": "FULL" + } + ] + }, + { + "region_tag": "securitycenter_v1_generated_SecurityCenter_ListNotificationConfigs_sync", + "title": "Snippet for the list_notification_configs call in the SecurityCenter service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::SecurityCenter::V1::SecurityCenter::Client#list_notification_configs.", + "file": "security_center/list_notification_configs.rb", + "language": "RUBY", + "client_method": { + "short_name": "list_notification_configs", + "full_name": "::Google::Cloud::SecurityCenter::V1::SecurityCenter::Client#list_notification_configs", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::SecurityCenter::V1::ListNotificationConfigsRequest", + "name": "request" + } + ], + "result_type": "::Google::Cloud::SecurityCenter::V1::ListNotificationConfigsResponse", + "client": { + "short_name": "SecurityCenter::Client", + "full_name": "::Google::Cloud::SecurityCenter::V1::SecurityCenter::Client" + }, + "method": { + "short_name": "ListNotificationConfigs", + "full_name": "google.cloud.securitycenter.v1.SecurityCenter.ListNotificationConfigs", + "service": { + "short_name": "SecurityCenter", + "full_name": "google.cloud.securitycenter.v1.SecurityCenter" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 50, + "type": "FULL" + } + ] + }, + { + "region_tag": "securitycenter_v1_generated_SecurityCenter_ListEffectiveSecurityHealthAnalyticsCustomModules_sync", + "title": "Snippet for the list_effective_security_health_analytics_custom_modules call in the SecurityCenter service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::SecurityCenter::V1::SecurityCenter::Client#list_effective_security_health_analytics_custom_modules.", + "file": "security_center/list_effective_security_health_analytics_custom_modules.rb", + "language": "RUBY", + "client_method": { + "short_name": "list_effective_security_health_analytics_custom_modules", + "full_name": "::Google::Cloud::SecurityCenter::V1::SecurityCenter::Client#list_effective_security_health_analytics_custom_modules", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::SecurityCenter::V1::ListEffectiveSecurityHealthAnalyticsCustomModulesRequest", + "name": "request" + } + ], + "result_type": "::Google::Cloud::SecurityCenter::V1::ListEffectiveSecurityHealthAnalyticsCustomModulesResponse", + "client": { + "short_name": "SecurityCenter::Client", + "full_name": "::Google::Cloud::SecurityCenter::V1::SecurityCenter::Client" + }, + "method": { + "short_name": "ListEffectiveSecurityHealthAnalyticsCustomModules", + "full_name": "google.cloud.securitycenter.v1.SecurityCenter.ListEffectiveSecurityHealthAnalyticsCustomModules", + "service": { + "short_name": "SecurityCenter", + "full_name": "google.cloud.securitycenter.v1.SecurityCenter" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 50, + "type": "FULL" + } + ] + }, + { + "region_tag": "securitycenter_v1_generated_SecurityCenter_ListSecurityHealthAnalyticsCustomModules_sync", + "title": "Snippet for the list_security_health_analytics_custom_modules call in the SecurityCenter service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::SecurityCenter::V1::SecurityCenter::Client#list_security_health_analytics_custom_modules.", + "file": "security_center/list_security_health_analytics_custom_modules.rb", + "language": "RUBY", + "client_method": { + "short_name": "list_security_health_analytics_custom_modules", + "full_name": "::Google::Cloud::SecurityCenter::V1::SecurityCenter::Client#list_security_health_analytics_custom_modules", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::SecurityCenter::V1::ListSecurityHealthAnalyticsCustomModulesRequest", + "name": "request" + } + ], + "result_type": "::Google::Cloud::SecurityCenter::V1::ListSecurityHealthAnalyticsCustomModulesResponse", + "client": { + "short_name": "SecurityCenter::Client", + "full_name": "::Google::Cloud::SecurityCenter::V1::SecurityCenter::Client" + }, + "method": { + "short_name": "ListSecurityHealthAnalyticsCustomModules", + "full_name": "google.cloud.securitycenter.v1.SecurityCenter.ListSecurityHealthAnalyticsCustomModules", + "service": { + "short_name": "SecurityCenter", + "full_name": "google.cloud.securitycenter.v1.SecurityCenter" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 50, + "type": "FULL" + } + ] + }, + { + "region_tag": "securitycenter_v1_generated_SecurityCenter_ListSources_sync", + "title": "Snippet for the list_sources call in the SecurityCenter service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::SecurityCenter::V1::SecurityCenter::Client#list_sources.", + "file": "security_center/list_sources.rb", + "language": "RUBY", + "client_method": { + "short_name": "list_sources", + "full_name": "::Google::Cloud::SecurityCenter::V1::SecurityCenter::Client#list_sources", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::SecurityCenter::V1::ListSourcesRequest", + "name": "request" + } + ], + "result_type": "::Google::Cloud::SecurityCenter::V1::ListSourcesResponse", + "client": { + "short_name": "SecurityCenter::Client", + "full_name": "::Google::Cloud::SecurityCenter::V1::SecurityCenter::Client" + }, + "method": { + "short_name": "ListSources", + "full_name": "google.cloud.securitycenter.v1.SecurityCenter.ListSources", + "service": { + "short_name": "SecurityCenter", + "full_name": "google.cloud.securitycenter.v1.SecurityCenter" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 50, + "type": "FULL" + } + ] + }, + { + "region_tag": "securitycenter_v1_generated_SecurityCenter_RunAssetDiscovery_sync", + "title": "Snippet for the run_asset_discovery call in the SecurityCenter service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::SecurityCenter::V1::SecurityCenter::Client#run_asset_discovery.", + "file": "security_center/run_asset_discovery.rb", + "language": "RUBY", + "client_method": { + "short_name": "run_asset_discovery", + "full_name": "::Google::Cloud::SecurityCenter::V1::SecurityCenter::Client#run_asset_discovery", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::SecurityCenter::V1::RunAssetDiscoveryRequest", + "name": "request" + } + ], + "result_type": "::Google::Longrunning::Operation", + "client": { + "short_name": "SecurityCenter::Client", + "full_name": "::Google::Cloud::SecurityCenter::V1::SecurityCenter::Client" + }, + "method": { + "short_name": "RunAssetDiscovery", + "full_name": "google.cloud.securitycenter.v1.SecurityCenter.RunAssetDiscovery", + "service": { + "short_name": "SecurityCenter", + "full_name": "google.cloud.securitycenter.v1.SecurityCenter" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 53, + "type": "FULL" + } + ] + }, + { + "region_tag": "securitycenter_v1_generated_SecurityCenter_SetFindingState_sync", + "title": "Snippet for the set_finding_state call in the SecurityCenter service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::SecurityCenter::V1::SecurityCenter::Client#set_finding_state.", + "file": "security_center/set_finding_state.rb", + "language": "RUBY", + "client_method": { + "short_name": "set_finding_state", + "full_name": "::Google::Cloud::SecurityCenter::V1::SecurityCenter::Client#set_finding_state", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::SecurityCenter::V1::SetFindingStateRequest", + "name": "request" + } + ], + "result_type": "::Google::Cloud::SecurityCenter::V1::Finding", + "client": { + "short_name": "SecurityCenter::Client", + "full_name": "::Google::Cloud::SecurityCenter::V1::SecurityCenter::Client" + }, + "method": { + "short_name": "SetFindingState", + "full_name": "google.cloud.securitycenter.v1.SecurityCenter.SetFindingState", + "service": { + "short_name": "SecurityCenter", + "full_name": "google.cloud.securitycenter.v1.SecurityCenter" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 46, + "type": "FULL" + } + ] + }, + { + "region_tag": "securitycenter_v1_generated_SecurityCenter_SetMute_sync", + "title": "Snippet for the set_mute call in the SecurityCenter service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::SecurityCenter::V1::SecurityCenter::Client#set_mute.", + "file": "security_center/set_mute.rb", + "language": "RUBY", + "client_method": { + "short_name": "set_mute", + "full_name": "::Google::Cloud::SecurityCenter::V1::SecurityCenter::Client#set_mute", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::SecurityCenter::V1::SetMuteRequest", + "name": "request" + } + ], + "result_type": "::Google::Cloud::SecurityCenter::V1::Finding", + "client": { + "short_name": "SecurityCenter::Client", + "full_name": "::Google::Cloud::SecurityCenter::V1::SecurityCenter::Client" + }, + "method": { + "short_name": "SetMute", + "full_name": "google.cloud.securitycenter.v1.SecurityCenter.SetMute", + "service": { + "short_name": "SecurityCenter", + "full_name": "google.cloud.securitycenter.v1.SecurityCenter" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 46, + "type": "FULL" + } + ] + }, + { + "region_tag": "securitycenter_v1_generated_SecurityCenter_SetIamPolicy_sync", + "title": "Snippet for the set_iam_policy call in the SecurityCenter service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::SecurityCenter::V1::SecurityCenter::Client#set_iam_policy.", + "file": "security_center/set_iam_policy.rb", + "language": "RUBY", + "client_method": { + "short_name": "set_iam_policy", + "full_name": "::Google::Cloud::SecurityCenter::V1::SecurityCenter::Client#set_iam_policy", + "async": false, + "parameters": [ + { + "type": "::Google::Iam::V1::SetIamPolicyRequest", + "name": "request" + } + ], + "result_type": "::Google::Iam::V1::Policy", + "client": { + "short_name": "SecurityCenter::Client", + "full_name": "::Google::Cloud::SecurityCenter::V1::SecurityCenter::Client" + }, + "method": { + "short_name": "SetIamPolicy", + "full_name": "google.cloud.securitycenter.v1.SecurityCenter.SetIamPolicy", + "service": { + "short_name": "SecurityCenter", + "full_name": "google.cloud.securitycenter.v1.SecurityCenter" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 46, + "type": "FULL" + } + ] + }, + { + "region_tag": "securitycenter_v1_generated_SecurityCenter_TestIamPermissions_sync", + "title": "Snippet for the test_iam_permissions call in the SecurityCenter service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::SecurityCenter::V1::SecurityCenter::Client#test_iam_permissions.", + "file": "security_center/test_iam_permissions.rb", + "language": "RUBY", + "client_method": { + "short_name": "test_iam_permissions", + "full_name": "::Google::Cloud::SecurityCenter::V1::SecurityCenter::Client#test_iam_permissions", + "async": false, + "parameters": [ + { + "type": "::Google::Iam::V1::TestIamPermissionsRequest", + "name": "request" + } + ], + "result_type": "::Google::Iam::V1::TestIamPermissionsResponse", + "client": { + "short_name": "SecurityCenter::Client", + "full_name": "::Google::Cloud::SecurityCenter::V1::SecurityCenter::Client" + }, + "method": { + "short_name": "TestIamPermissions", + "full_name": "google.cloud.securitycenter.v1.SecurityCenter.TestIamPermissions", + "service": { + "short_name": "SecurityCenter", + "full_name": "google.cloud.securitycenter.v1.SecurityCenter" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 46, + "type": "FULL" + } + ] + }, + { + "region_tag": "securitycenter_v1_generated_SecurityCenter_SimulateSecurityHealthAnalyticsCustomModule_sync", + "title": "Snippet for the simulate_security_health_analytics_custom_module call in the SecurityCenter service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::SecurityCenter::V1::SecurityCenter::Client#simulate_security_health_analytics_custom_module.", + "file": "security_center/simulate_security_health_analytics_custom_module.rb", + "language": "RUBY", + "client_method": { + "short_name": "simulate_security_health_analytics_custom_module", + "full_name": "::Google::Cloud::SecurityCenter::V1::SecurityCenter::Client#simulate_security_health_analytics_custom_module", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::SecurityCenter::V1::SimulateSecurityHealthAnalyticsCustomModuleRequest", + "name": "request" + } + ], + "result_type": "::Google::Cloud::SecurityCenter::V1::SimulateSecurityHealthAnalyticsCustomModuleResponse", + "client": { + "short_name": "SecurityCenter::Client", + "full_name": "::Google::Cloud::SecurityCenter::V1::SecurityCenter::Client" + }, + "method": { + "short_name": "SimulateSecurityHealthAnalyticsCustomModule", + "full_name": "google.cloud.securitycenter.v1.SecurityCenter.SimulateSecurityHealthAnalyticsCustomModule", + "service": { + "short_name": "SecurityCenter", + "full_name": "google.cloud.securitycenter.v1.SecurityCenter" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 46, + "type": "FULL" + } + ] + }, + { + "region_tag": "securitycenter_v1_generated_SecurityCenter_UpdateExternalSystem_sync", + "title": "Snippet for the update_external_system call in the SecurityCenter service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::SecurityCenter::V1::SecurityCenter::Client#update_external_system.", + "file": "security_center/update_external_system.rb", + "language": "RUBY", + "client_method": { + "short_name": "update_external_system", + "full_name": "::Google::Cloud::SecurityCenter::V1::SecurityCenter::Client#update_external_system", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::SecurityCenter::V1::UpdateExternalSystemRequest", + "name": "request" + } + ], + "result_type": "::Google::Cloud::SecurityCenter::V1::ExternalSystem", + "client": { + "short_name": "SecurityCenter::Client", + "full_name": "::Google::Cloud::SecurityCenter::V1::SecurityCenter::Client" + }, + "method": { + "short_name": "UpdateExternalSystem", + "full_name": "google.cloud.securitycenter.v1.SecurityCenter.UpdateExternalSystem", + "service": { + "short_name": "SecurityCenter", + "full_name": "google.cloud.securitycenter.v1.SecurityCenter" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 46, + "type": "FULL" + } + ] + }, + { + "region_tag": "securitycenter_v1_generated_SecurityCenter_UpdateFinding_sync", + "title": "Snippet for the update_finding call in the SecurityCenter service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::SecurityCenter::V1::SecurityCenter::Client#update_finding.", + "file": "security_center/update_finding.rb", + "language": "RUBY", + "client_method": { + "short_name": "update_finding", + "full_name": "::Google::Cloud::SecurityCenter::V1::SecurityCenter::Client#update_finding", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::SecurityCenter::V1::UpdateFindingRequest", + "name": "request" + } + ], + "result_type": "::Google::Cloud::SecurityCenter::V1::Finding", + "client": { + "short_name": "SecurityCenter::Client", + "full_name": "::Google::Cloud::SecurityCenter::V1::SecurityCenter::Client" + }, + "method": { + "short_name": "UpdateFinding", + "full_name": "google.cloud.securitycenter.v1.SecurityCenter.UpdateFinding", + "service": { + "short_name": "SecurityCenter", + "full_name": "google.cloud.securitycenter.v1.SecurityCenter" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 46, + "type": "FULL" + } + ] + }, + { + "region_tag": "securitycenter_v1_generated_SecurityCenter_UpdateMuteConfig_sync", + "title": "Snippet for the update_mute_config call in the SecurityCenter service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::SecurityCenter::V1::SecurityCenter::Client#update_mute_config.", + "file": "security_center/update_mute_config.rb", + "language": "RUBY", + "client_method": { + "short_name": "update_mute_config", + "full_name": "::Google::Cloud::SecurityCenter::V1::SecurityCenter::Client#update_mute_config", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::SecurityCenter::V1::UpdateMuteConfigRequest", + "name": "request" + } + ], + "result_type": "::Google::Cloud::SecurityCenter::V1::MuteConfig", + "client": { + "short_name": "SecurityCenter::Client", + "full_name": "::Google::Cloud::SecurityCenter::V1::SecurityCenter::Client" + }, + "method": { + "short_name": "UpdateMuteConfig", + "full_name": "google.cloud.securitycenter.v1.SecurityCenter.UpdateMuteConfig", + "service": { + "short_name": "SecurityCenter", + "full_name": "google.cloud.securitycenter.v1.SecurityCenter" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 46, + "type": "FULL" + } + ] + }, + { + "region_tag": "securitycenter_v1_generated_SecurityCenter_UpdateNotificationConfig_sync", + "title": "Snippet for the update_notification_config call in the SecurityCenter service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::SecurityCenter::V1::SecurityCenter::Client#update_notification_config.", + "file": "security_center/update_notification_config.rb", + "language": "RUBY", + "client_method": { + "short_name": "update_notification_config", + "full_name": "::Google::Cloud::SecurityCenter::V1::SecurityCenter::Client#update_notification_config", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::SecurityCenter::V1::UpdateNotificationConfigRequest", + "name": "request" + } + ], + "result_type": "::Google::Cloud::SecurityCenter::V1::NotificationConfig", + "client": { + "short_name": "SecurityCenter::Client", + "full_name": "::Google::Cloud::SecurityCenter::V1::SecurityCenter::Client" + }, + "method": { + "short_name": "UpdateNotificationConfig", + "full_name": "google.cloud.securitycenter.v1.SecurityCenter.UpdateNotificationConfig", + "service": { + "short_name": "SecurityCenter", + "full_name": "google.cloud.securitycenter.v1.SecurityCenter" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 46, + "type": "FULL" + } + ] + }, + { + "region_tag": "securitycenter_v1_generated_SecurityCenter_UpdateOrganizationSettings_sync", + "title": "Snippet for the update_organization_settings call in the SecurityCenter service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::SecurityCenter::V1::SecurityCenter::Client#update_organization_settings.", + "file": "security_center/update_organization_settings.rb", + "language": "RUBY", + "client_method": { + "short_name": "update_organization_settings", + "full_name": "::Google::Cloud::SecurityCenter::V1::SecurityCenter::Client#update_organization_settings", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::SecurityCenter::V1::UpdateOrganizationSettingsRequest", + "name": "request" + } + ], + "result_type": "::Google::Cloud::SecurityCenter::V1::OrganizationSettings", + "client": { + "short_name": "SecurityCenter::Client", + "full_name": "::Google::Cloud::SecurityCenter::V1::SecurityCenter::Client" + }, + "method": { + "short_name": "UpdateOrganizationSettings", + "full_name": "google.cloud.securitycenter.v1.SecurityCenter.UpdateOrganizationSettings", + "service": { + "short_name": "SecurityCenter", + "full_name": "google.cloud.securitycenter.v1.SecurityCenter" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 46, + "type": "FULL" + } + ] + }, + { + "region_tag": "securitycenter_v1_generated_SecurityCenter_UpdateSecurityHealthAnalyticsCustomModule_sync", + "title": "Snippet for the update_security_health_analytics_custom_module call in the SecurityCenter service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::SecurityCenter::V1::SecurityCenter::Client#update_security_health_analytics_custom_module.", + "file": "security_center/update_security_health_analytics_custom_module.rb", + "language": "RUBY", + "client_method": { + "short_name": "update_security_health_analytics_custom_module", + "full_name": "::Google::Cloud::SecurityCenter::V1::SecurityCenter::Client#update_security_health_analytics_custom_module", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::SecurityCenter::V1::UpdateSecurityHealthAnalyticsCustomModuleRequest", + "name": "request" + } + ], + "result_type": "::Google::Cloud::SecurityCenter::V1::SecurityHealthAnalyticsCustomModule", + "client": { + "short_name": "SecurityCenter::Client", + "full_name": "::Google::Cloud::SecurityCenter::V1::SecurityCenter::Client" + }, + "method": { + "short_name": "UpdateSecurityHealthAnalyticsCustomModule", + "full_name": "google.cloud.securitycenter.v1.SecurityCenter.UpdateSecurityHealthAnalyticsCustomModule", + "service": { + "short_name": "SecurityCenter", + "full_name": "google.cloud.securitycenter.v1.SecurityCenter" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 46, + "type": "FULL" + } + ] + }, + { + "region_tag": "securitycenter_v1_generated_SecurityCenter_UpdateSource_sync", + "title": "Snippet for the update_source call in the SecurityCenter service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::SecurityCenter::V1::SecurityCenter::Client#update_source.", + "file": "security_center/update_source.rb", + "language": "RUBY", + "client_method": { + "short_name": "update_source", + "full_name": "::Google::Cloud::SecurityCenter::V1::SecurityCenter::Client#update_source", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::SecurityCenter::V1::UpdateSourceRequest", + "name": "request" + } + ], + "result_type": "::Google::Cloud::SecurityCenter::V1::Source", + "client": { + "short_name": "SecurityCenter::Client", + "full_name": "::Google::Cloud::SecurityCenter::V1::SecurityCenter::Client" + }, + "method": { + "short_name": "UpdateSource", + "full_name": "google.cloud.securitycenter.v1.SecurityCenter.UpdateSource", + "service": { + "short_name": "SecurityCenter", + "full_name": "google.cloud.securitycenter.v1.SecurityCenter" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 46, + "type": "FULL" + } + ] + }, + { + "region_tag": "securitycenter_v1_generated_SecurityCenter_UpdateSecurityMarks_sync", + "title": "Snippet for the update_security_marks call in the SecurityCenter service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::SecurityCenter::V1::SecurityCenter::Client#update_security_marks.", + "file": "security_center/update_security_marks.rb", + "language": "RUBY", + "client_method": { + "short_name": "update_security_marks", + "full_name": "::Google::Cloud::SecurityCenter::V1::SecurityCenter::Client#update_security_marks", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::SecurityCenter::V1::UpdateSecurityMarksRequest", + "name": "request" + } + ], + "result_type": "::Google::Cloud::SecurityCenter::V1::SecurityMarks", + "client": { + "short_name": "SecurityCenter::Client", + "full_name": "::Google::Cloud::SecurityCenter::V1::SecurityCenter::Client" + }, + "method": { + "short_name": "UpdateSecurityMarks", + "full_name": "google.cloud.securitycenter.v1.SecurityCenter.UpdateSecurityMarks", + "service": { + "short_name": "SecurityCenter", + "full_name": "google.cloud.securitycenter.v1.SecurityCenter" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 46, + "type": "FULL" + } + ] + }, + { + "region_tag": "securitycenter_v1_generated_SecurityCenter_CreateBigQueryExport_sync", + "title": "Snippet for the create_big_query_export call in the SecurityCenter service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::SecurityCenter::V1::SecurityCenter::Client#create_big_query_export.", + "file": "security_center/create_big_query_export.rb", + "language": "RUBY", + "client_method": { + "short_name": "create_big_query_export", + "full_name": "::Google::Cloud::SecurityCenter::V1::SecurityCenter::Client#create_big_query_export", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::SecurityCenter::V1::CreateBigQueryExportRequest", + "name": "request" + } + ], + "result_type": "::Google::Cloud::SecurityCenter::V1::BigQueryExport", + "client": { + "short_name": "SecurityCenter::Client", + "full_name": "::Google::Cloud::SecurityCenter::V1::SecurityCenter::Client" + }, + "method": { + "short_name": "CreateBigQueryExport", + "full_name": "google.cloud.securitycenter.v1.SecurityCenter.CreateBigQueryExport", + "service": { + "short_name": "SecurityCenter", + "full_name": "google.cloud.securitycenter.v1.SecurityCenter" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 46, + "type": "FULL" + } + ] + }, + { + "region_tag": "securitycenter_v1_generated_SecurityCenter_DeleteBigQueryExport_sync", + "title": "Snippet for the delete_big_query_export call in the SecurityCenter service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::SecurityCenter::V1::SecurityCenter::Client#delete_big_query_export.", + "file": "security_center/delete_big_query_export.rb", + "language": "RUBY", + "client_method": { + "short_name": "delete_big_query_export", + "full_name": "::Google::Cloud::SecurityCenter::V1::SecurityCenter::Client#delete_big_query_export", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::SecurityCenter::V1::DeleteBigQueryExportRequest", + "name": "request" + } + ], + "result_type": "::Google::Protobuf::Empty", + "client": { + "short_name": "SecurityCenter::Client", + "full_name": "::Google::Cloud::SecurityCenter::V1::SecurityCenter::Client" + }, + "method": { + "short_name": "DeleteBigQueryExport", + "full_name": "google.cloud.securitycenter.v1.SecurityCenter.DeleteBigQueryExport", + "service": { + "short_name": "SecurityCenter", + "full_name": "google.cloud.securitycenter.v1.SecurityCenter" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 46, + "type": "FULL" + } + ] + }, + { + "region_tag": "securitycenter_v1_generated_SecurityCenter_UpdateBigQueryExport_sync", + "title": "Snippet for the update_big_query_export call in the SecurityCenter service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::SecurityCenter::V1::SecurityCenter::Client#update_big_query_export.", + "file": "security_center/update_big_query_export.rb", + "language": "RUBY", + "client_method": { + "short_name": "update_big_query_export", + "full_name": "::Google::Cloud::SecurityCenter::V1::SecurityCenter::Client#update_big_query_export", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::SecurityCenter::V1::UpdateBigQueryExportRequest", + "name": "request" + } + ], + "result_type": "::Google::Cloud::SecurityCenter::V1::BigQueryExport", + "client": { + "short_name": "SecurityCenter::Client", + "full_name": "::Google::Cloud::SecurityCenter::V1::SecurityCenter::Client" + }, + "method": { + "short_name": "UpdateBigQueryExport", + "full_name": "google.cloud.securitycenter.v1.SecurityCenter.UpdateBigQueryExport", + "service": { + "short_name": "SecurityCenter", + "full_name": "google.cloud.securitycenter.v1.SecurityCenter" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 46, + "type": "FULL" + } + ] + }, + { + "region_tag": "securitycenter_v1_generated_SecurityCenter_ListBigQueryExports_sync", + "title": "Snippet for the list_big_query_exports call in the SecurityCenter service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::SecurityCenter::V1::SecurityCenter::Client#list_big_query_exports.", + "file": "security_center/list_big_query_exports.rb", + "language": "RUBY", + "client_method": { + "short_name": "list_big_query_exports", + "full_name": "::Google::Cloud::SecurityCenter::V1::SecurityCenter::Client#list_big_query_exports", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::SecurityCenter::V1::ListBigQueryExportsRequest", + "name": "request" + } + ], + "result_type": "::Google::Cloud::SecurityCenter::V1::ListBigQueryExportsResponse", + "client": { + "short_name": "SecurityCenter::Client", + "full_name": "::Google::Cloud::SecurityCenter::V1::SecurityCenter::Client" + }, + "method": { + "short_name": "ListBigQueryExports", + "full_name": "google.cloud.securitycenter.v1.SecurityCenter.ListBigQueryExports", + "service": { + "short_name": "SecurityCenter", + "full_name": "google.cloud.securitycenter.v1.SecurityCenter" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 50, + "type": "FULL" + } + ] + }, + { + "region_tag": "securitycenter_v1_generated_SecurityCenter_CreateEventThreatDetectionCustomModule_sync", + "title": "Snippet for the create_event_threat_detection_custom_module call in the SecurityCenter service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::SecurityCenter::V1::SecurityCenter::Client#create_event_threat_detection_custom_module.", + "file": "security_center/create_event_threat_detection_custom_module.rb", + "language": "RUBY", + "client_method": { + "short_name": "create_event_threat_detection_custom_module", + "full_name": "::Google::Cloud::SecurityCenter::V1::SecurityCenter::Client#create_event_threat_detection_custom_module", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::SecurityCenter::V1::CreateEventThreatDetectionCustomModuleRequest", + "name": "request" + } + ], + "result_type": "::Google::Cloud::SecurityCenter::V1::EventThreatDetectionCustomModule", + "client": { + "short_name": "SecurityCenter::Client", + "full_name": "::Google::Cloud::SecurityCenter::V1::SecurityCenter::Client" + }, + "method": { + "short_name": "CreateEventThreatDetectionCustomModule", + "full_name": "google.cloud.securitycenter.v1.SecurityCenter.CreateEventThreatDetectionCustomModule", + "service": { + "short_name": "SecurityCenter", + "full_name": "google.cloud.securitycenter.v1.SecurityCenter" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 46, + "type": "FULL" + } + ] + }, + { + "region_tag": "securitycenter_v1_generated_SecurityCenter_DeleteEventThreatDetectionCustomModule_sync", + "title": "Snippet for the delete_event_threat_detection_custom_module call in the SecurityCenter service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::SecurityCenter::V1::SecurityCenter::Client#delete_event_threat_detection_custom_module.", + "file": "security_center/delete_event_threat_detection_custom_module.rb", + "language": "RUBY", + "client_method": { + "short_name": "delete_event_threat_detection_custom_module", + "full_name": "::Google::Cloud::SecurityCenter::V1::SecurityCenter::Client#delete_event_threat_detection_custom_module", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::SecurityCenter::V1::DeleteEventThreatDetectionCustomModuleRequest", + "name": "request" + } + ], + "result_type": "::Google::Protobuf::Empty", + "client": { + "short_name": "SecurityCenter::Client", + "full_name": "::Google::Cloud::SecurityCenter::V1::SecurityCenter::Client" + }, + "method": { + "short_name": "DeleteEventThreatDetectionCustomModule", + "full_name": "google.cloud.securitycenter.v1.SecurityCenter.DeleteEventThreatDetectionCustomModule", + "service": { + "short_name": "SecurityCenter", + "full_name": "google.cloud.securitycenter.v1.SecurityCenter" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 46, + "type": "FULL" + } + ] + }, + { + "region_tag": "securitycenter_v1_generated_SecurityCenter_GetEventThreatDetectionCustomModule_sync", + "title": "Snippet for the get_event_threat_detection_custom_module call in the SecurityCenter service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::SecurityCenter::V1::SecurityCenter::Client#get_event_threat_detection_custom_module.", + "file": "security_center/get_event_threat_detection_custom_module.rb", + "language": "RUBY", + "client_method": { + "short_name": "get_event_threat_detection_custom_module", + "full_name": "::Google::Cloud::SecurityCenter::V1::SecurityCenter::Client#get_event_threat_detection_custom_module", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::SecurityCenter::V1::GetEventThreatDetectionCustomModuleRequest", + "name": "request" + } + ], + "result_type": "::Google::Cloud::SecurityCenter::V1::EventThreatDetectionCustomModule", + "client": { + "short_name": "SecurityCenter::Client", + "full_name": "::Google::Cloud::SecurityCenter::V1::SecurityCenter::Client" + }, + "method": { + "short_name": "GetEventThreatDetectionCustomModule", + "full_name": "google.cloud.securitycenter.v1.SecurityCenter.GetEventThreatDetectionCustomModule", + "service": { + "short_name": "SecurityCenter", + "full_name": "google.cloud.securitycenter.v1.SecurityCenter" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 46, + "type": "FULL" + } + ] + }, + { + "region_tag": "securitycenter_v1_generated_SecurityCenter_ListDescendantEventThreatDetectionCustomModules_sync", + "title": "Snippet for the list_descendant_event_threat_detection_custom_modules call in the SecurityCenter service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::SecurityCenter::V1::SecurityCenter::Client#list_descendant_event_threat_detection_custom_modules.", + "file": "security_center/list_descendant_event_threat_detection_custom_modules.rb", + "language": "RUBY", + "client_method": { + "short_name": "list_descendant_event_threat_detection_custom_modules", + "full_name": "::Google::Cloud::SecurityCenter::V1::SecurityCenter::Client#list_descendant_event_threat_detection_custom_modules", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::SecurityCenter::V1::ListDescendantEventThreatDetectionCustomModulesRequest", + "name": "request" + } + ], + "result_type": "::Google::Cloud::SecurityCenter::V1::ListDescendantEventThreatDetectionCustomModulesResponse", + "client": { + "short_name": "SecurityCenter::Client", + "full_name": "::Google::Cloud::SecurityCenter::V1::SecurityCenter::Client" + }, + "method": { + "short_name": "ListDescendantEventThreatDetectionCustomModules", + "full_name": "google.cloud.securitycenter.v1.SecurityCenter.ListDescendantEventThreatDetectionCustomModules", + "service": { + "short_name": "SecurityCenter", + "full_name": "google.cloud.securitycenter.v1.SecurityCenter" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 50, + "type": "FULL" + } + ] + }, + { + "region_tag": "securitycenter_v1_generated_SecurityCenter_ListEventThreatDetectionCustomModules_sync", + "title": "Snippet for the list_event_threat_detection_custom_modules call in the SecurityCenter service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::SecurityCenter::V1::SecurityCenter::Client#list_event_threat_detection_custom_modules.", + "file": "security_center/list_event_threat_detection_custom_modules.rb", + "language": "RUBY", + "client_method": { + "short_name": "list_event_threat_detection_custom_modules", + "full_name": "::Google::Cloud::SecurityCenter::V1::SecurityCenter::Client#list_event_threat_detection_custom_modules", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::SecurityCenter::V1::ListEventThreatDetectionCustomModulesRequest", + "name": "request" + } + ], + "result_type": "::Google::Cloud::SecurityCenter::V1::ListEventThreatDetectionCustomModulesResponse", + "client": { + "short_name": "SecurityCenter::Client", + "full_name": "::Google::Cloud::SecurityCenter::V1::SecurityCenter::Client" + }, + "method": { + "short_name": "ListEventThreatDetectionCustomModules", + "full_name": "google.cloud.securitycenter.v1.SecurityCenter.ListEventThreatDetectionCustomModules", + "service": { + "short_name": "SecurityCenter", + "full_name": "google.cloud.securitycenter.v1.SecurityCenter" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 50, + "type": "FULL" + } + ] + }, + { + "region_tag": "securitycenter_v1_generated_SecurityCenter_UpdateEventThreatDetectionCustomModule_sync", + "title": "Snippet for the update_event_threat_detection_custom_module call in the SecurityCenter service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::SecurityCenter::V1::SecurityCenter::Client#update_event_threat_detection_custom_module.", + "file": "security_center/update_event_threat_detection_custom_module.rb", + "language": "RUBY", + "client_method": { + "short_name": "update_event_threat_detection_custom_module", + "full_name": "::Google::Cloud::SecurityCenter::V1::SecurityCenter::Client#update_event_threat_detection_custom_module", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::SecurityCenter::V1::UpdateEventThreatDetectionCustomModuleRequest", + "name": "request" + } + ], + "result_type": "::Google::Cloud::SecurityCenter::V1::EventThreatDetectionCustomModule", + "client": { + "short_name": "SecurityCenter::Client", + "full_name": "::Google::Cloud::SecurityCenter::V1::SecurityCenter::Client" + }, + "method": { + "short_name": "UpdateEventThreatDetectionCustomModule", + "full_name": "google.cloud.securitycenter.v1.SecurityCenter.UpdateEventThreatDetectionCustomModule", + "service": { + "short_name": "SecurityCenter", + "full_name": "google.cloud.securitycenter.v1.SecurityCenter" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 46, + "type": "FULL" + } + ] + }, + { + "region_tag": "securitycenter_v1_generated_SecurityCenter_ValidateEventThreatDetectionCustomModule_sync", + "title": "Snippet for the validate_event_threat_detection_custom_module call in the SecurityCenter service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::SecurityCenter::V1::SecurityCenter::Client#validate_event_threat_detection_custom_module.", + "file": "security_center/validate_event_threat_detection_custom_module.rb", + "language": "RUBY", + "client_method": { + "short_name": "validate_event_threat_detection_custom_module", + "full_name": "::Google::Cloud::SecurityCenter::V1::SecurityCenter::Client#validate_event_threat_detection_custom_module", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::SecurityCenter::V1::ValidateEventThreatDetectionCustomModuleRequest", + "name": "request" + } + ], + "result_type": "::Google::Cloud::SecurityCenter::V1::ValidateEventThreatDetectionCustomModuleResponse", + "client": { + "short_name": "SecurityCenter::Client", + "full_name": "::Google::Cloud::SecurityCenter::V1::SecurityCenter::Client" + }, + "method": { + "short_name": "ValidateEventThreatDetectionCustomModule", + "full_name": "google.cloud.securitycenter.v1.SecurityCenter.ValidateEventThreatDetectionCustomModule", + "service": { + "short_name": "SecurityCenter", + "full_name": "google.cloud.securitycenter.v1.SecurityCenter" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 46, + "type": "FULL" + } + ] + }, + { + "region_tag": "securitycenter_v1_generated_SecurityCenter_GetEffectiveEventThreatDetectionCustomModule_sync", + "title": "Snippet for the get_effective_event_threat_detection_custom_module call in the SecurityCenter service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::SecurityCenter::V1::SecurityCenter::Client#get_effective_event_threat_detection_custom_module.", + "file": "security_center/get_effective_event_threat_detection_custom_module.rb", + "language": "RUBY", + "client_method": { + "short_name": "get_effective_event_threat_detection_custom_module", + "full_name": "::Google::Cloud::SecurityCenter::V1::SecurityCenter::Client#get_effective_event_threat_detection_custom_module", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::SecurityCenter::V1::GetEffectiveEventThreatDetectionCustomModuleRequest", + "name": "request" + } + ], + "result_type": "::Google::Cloud::SecurityCenter::V1::EffectiveEventThreatDetectionCustomModule", + "client": { + "short_name": "SecurityCenter::Client", + "full_name": "::Google::Cloud::SecurityCenter::V1::SecurityCenter::Client" + }, + "method": { + "short_name": "GetEffectiveEventThreatDetectionCustomModule", + "full_name": "google.cloud.securitycenter.v1.SecurityCenter.GetEffectiveEventThreatDetectionCustomModule", + "service": { + "short_name": "SecurityCenter", + "full_name": "google.cloud.securitycenter.v1.SecurityCenter" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 46, + "type": "FULL" + } + ] + }, + { + "region_tag": "securitycenter_v1_generated_SecurityCenter_ListEffectiveEventThreatDetectionCustomModules_sync", + "title": "Snippet for the list_effective_event_threat_detection_custom_modules call in the SecurityCenter service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::SecurityCenter::V1::SecurityCenter::Client#list_effective_event_threat_detection_custom_modules.", + "file": "security_center/list_effective_event_threat_detection_custom_modules.rb", + "language": "RUBY", + "client_method": { + "short_name": "list_effective_event_threat_detection_custom_modules", + "full_name": "::Google::Cloud::SecurityCenter::V1::SecurityCenter::Client#list_effective_event_threat_detection_custom_modules", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::SecurityCenter::V1::ListEffectiveEventThreatDetectionCustomModulesRequest", + "name": "request" + } + ], + "result_type": "::Google::Cloud::SecurityCenter::V1::ListEffectiveEventThreatDetectionCustomModulesResponse", + "client": { + "short_name": "SecurityCenter::Client", + "full_name": "::Google::Cloud::SecurityCenter::V1::SecurityCenter::Client" + }, + "method": { + "short_name": "ListEffectiveEventThreatDetectionCustomModules", + "full_name": "google.cloud.securitycenter.v1.SecurityCenter.ListEffectiveEventThreatDetectionCustomModules", + "service": { + "short_name": "SecurityCenter", + "full_name": "google.cloud.securitycenter.v1.SecurityCenter" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 50, + "type": "FULL" + } + ] + }, + { + "region_tag": "securitycenter_v1_generated_SecurityCenter_BatchCreateResourceValueConfigs_sync", + "title": "Snippet for the batch_create_resource_value_configs call in the SecurityCenter service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::SecurityCenter::V1::SecurityCenter::Client#batch_create_resource_value_configs.", + "file": "security_center/batch_create_resource_value_configs.rb", + "language": "RUBY", + "client_method": { + "short_name": "batch_create_resource_value_configs", + "full_name": "::Google::Cloud::SecurityCenter::V1::SecurityCenter::Client#batch_create_resource_value_configs", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::SecurityCenter::V1::BatchCreateResourceValueConfigsRequest", + "name": "request" + } + ], + "result_type": "::Google::Cloud::SecurityCenter::V1::BatchCreateResourceValueConfigsResponse", + "client": { + "short_name": "SecurityCenter::Client", + "full_name": "::Google::Cloud::SecurityCenter::V1::SecurityCenter::Client" + }, + "method": { + "short_name": "BatchCreateResourceValueConfigs", + "full_name": "google.cloud.securitycenter.v1.SecurityCenter.BatchCreateResourceValueConfigs", + "service": { + "short_name": "SecurityCenter", + "full_name": "google.cloud.securitycenter.v1.SecurityCenter" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 46, + "type": "FULL" + } + ] + }, + { + "region_tag": "securitycenter_v1_generated_SecurityCenter_DeleteResourceValueConfig_sync", + "title": "Snippet for the delete_resource_value_config call in the SecurityCenter service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::SecurityCenter::V1::SecurityCenter::Client#delete_resource_value_config.", + "file": "security_center/delete_resource_value_config.rb", + "language": "RUBY", + "client_method": { + "short_name": "delete_resource_value_config", + "full_name": "::Google::Cloud::SecurityCenter::V1::SecurityCenter::Client#delete_resource_value_config", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::SecurityCenter::V1::DeleteResourceValueConfigRequest", + "name": "request" + } + ], + "result_type": "::Google::Protobuf::Empty", + "client": { + "short_name": "SecurityCenter::Client", + "full_name": "::Google::Cloud::SecurityCenter::V1::SecurityCenter::Client" + }, + "method": { + "short_name": "DeleteResourceValueConfig", + "full_name": "google.cloud.securitycenter.v1.SecurityCenter.DeleteResourceValueConfig", + "service": { + "short_name": "SecurityCenter", + "full_name": "google.cloud.securitycenter.v1.SecurityCenter" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 46, + "type": "FULL" + } + ] + }, + { + "region_tag": "securitycenter_v1_generated_SecurityCenter_GetResourceValueConfig_sync", + "title": "Snippet for the get_resource_value_config call in the SecurityCenter service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::SecurityCenter::V1::SecurityCenter::Client#get_resource_value_config.", + "file": "security_center/get_resource_value_config.rb", + "language": "RUBY", + "client_method": { + "short_name": "get_resource_value_config", + "full_name": "::Google::Cloud::SecurityCenter::V1::SecurityCenter::Client#get_resource_value_config", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::SecurityCenter::V1::GetResourceValueConfigRequest", + "name": "request" + } + ], + "result_type": "::Google::Cloud::SecurityCenter::V1::ResourceValueConfig", + "client": { + "short_name": "SecurityCenter::Client", + "full_name": "::Google::Cloud::SecurityCenter::V1::SecurityCenter::Client" + }, + "method": { + "short_name": "GetResourceValueConfig", + "full_name": "google.cloud.securitycenter.v1.SecurityCenter.GetResourceValueConfig", + "service": { + "short_name": "SecurityCenter", + "full_name": "google.cloud.securitycenter.v1.SecurityCenter" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 46, + "type": "FULL" + } + ] + }, + { + "region_tag": "securitycenter_v1_generated_SecurityCenter_ListResourceValueConfigs_sync", + "title": "Snippet for the list_resource_value_configs call in the SecurityCenter service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::SecurityCenter::V1::SecurityCenter::Client#list_resource_value_configs.", + "file": "security_center/list_resource_value_configs.rb", + "language": "RUBY", + "client_method": { + "short_name": "list_resource_value_configs", + "full_name": "::Google::Cloud::SecurityCenter::V1::SecurityCenter::Client#list_resource_value_configs", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::SecurityCenter::V1::ListResourceValueConfigsRequest", + "name": "request" + } + ], + "result_type": "::Google::Cloud::SecurityCenter::V1::ListResourceValueConfigsResponse", + "client": { + "short_name": "SecurityCenter::Client", + "full_name": "::Google::Cloud::SecurityCenter::V1::SecurityCenter::Client" + }, + "method": { + "short_name": "ListResourceValueConfigs", + "full_name": "google.cloud.securitycenter.v1.SecurityCenter.ListResourceValueConfigs", + "service": { + "short_name": "SecurityCenter", + "full_name": "google.cloud.securitycenter.v1.SecurityCenter" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 50, + "type": "FULL" + } + ] + }, + { + "region_tag": "securitycenter_v1_generated_SecurityCenter_UpdateResourceValueConfig_sync", + "title": "Snippet for the update_resource_value_config call in the SecurityCenter service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::SecurityCenter::V1::SecurityCenter::Client#update_resource_value_config.", + "file": "security_center/update_resource_value_config.rb", + "language": "RUBY", + "client_method": { + "short_name": "update_resource_value_config", + "full_name": "::Google::Cloud::SecurityCenter::V1::SecurityCenter::Client#update_resource_value_config", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::SecurityCenter::V1::UpdateResourceValueConfigRequest", + "name": "request" + } + ], + "result_type": "::Google::Cloud::SecurityCenter::V1::ResourceValueConfig", + "client": { + "short_name": "SecurityCenter::Client", + "full_name": "::Google::Cloud::SecurityCenter::V1::SecurityCenter::Client" + }, + "method": { + "short_name": "UpdateResourceValueConfig", + "full_name": "google.cloud.securitycenter.v1.SecurityCenter.UpdateResourceValueConfig", + "service": { + "short_name": "SecurityCenter", + "full_name": "google.cloud.securitycenter.v1.SecurityCenter" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 46, + "type": "FULL" + } + ] + }, + { + "region_tag": "securitycenter_v1_generated_SecurityCenter_ListValuedResources_sync", + "title": "Snippet for the list_valued_resources call in the SecurityCenter service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::SecurityCenter::V1::SecurityCenter::Client#list_valued_resources.", + "file": "security_center/list_valued_resources.rb", + "language": "RUBY", + "client_method": { + "short_name": "list_valued_resources", + "full_name": "::Google::Cloud::SecurityCenter::V1::SecurityCenter::Client#list_valued_resources", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::SecurityCenter::V1::ListValuedResourcesRequest", + "name": "request" + } + ], + "result_type": "::Google::Cloud::SecurityCenter::V1::ListValuedResourcesResponse", + "client": { + "short_name": "SecurityCenter::Client", + "full_name": "::Google::Cloud::SecurityCenter::V1::SecurityCenter::Client" + }, + "method": { + "short_name": "ListValuedResources", + "full_name": "google.cloud.securitycenter.v1.SecurityCenter.ListValuedResources", + "service": { + "short_name": "SecurityCenter", + "full_name": "google.cloud.securitycenter.v1.SecurityCenter" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 50, + "type": "FULL" + } + ] + }, + { + "region_tag": "securitycenter_v1_generated_SecurityCenter_ListAttackPaths_sync", + "title": "Snippet for the list_attack_paths call in the SecurityCenter service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::SecurityCenter::V1::SecurityCenter::Client#list_attack_paths.", + "file": "security_center/list_attack_paths.rb", + "language": "RUBY", + "client_method": { + "short_name": "list_attack_paths", + "full_name": "::Google::Cloud::SecurityCenter::V1::SecurityCenter::Client#list_attack_paths", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::SecurityCenter::V1::ListAttackPathsRequest", + "name": "request" + } + ], + "result_type": "::Google::Cloud::SecurityCenter::V1::ListAttackPathsResponse", + "client": { + "short_name": "SecurityCenter::Client", + "full_name": "::Google::Cloud::SecurityCenter::V1::SecurityCenter::Client" + }, + "method": { + "short_name": "ListAttackPaths", + "full_name": "google.cloud.securitycenter.v1.SecurityCenter.ListAttackPaths", + "service": { + "short_name": "SecurityCenter", + "full_name": "google.cloud.securitycenter.v1.SecurityCenter" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 50, + "type": "FULL" + } + ] + } + ] +} \ No newline at end of file diff --git a/owl-bot-staging/google-cloud-security_center-v1/test/google/cloud/security_center/v1/security_center_operations_test.rb b/owl-bot-staging/google-cloud-security_center-v1/test/google/cloud/security_center/v1/security_center_operations_test.rb new file mode 100644 index 000000000000..c3c87a7a15cc --- /dev/null +++ b/owl-bot-staging/google-cloud-security_center-v1/test/google/cloud/security_center/v1/security_center_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/cloud/securitycenter/v1/securitycenter_service_pb" +require "google/cloud/securitycenter/v1/securitycenter_service_services_pb" +require "google/cloud/security_center/v1/security_center" + +class ::Google::Cloud::SecurityCenter::V1::SecurityCenter::OperationsTest < Minitest::Test + class ClientStub + attr_accessor :call_rpc_count, :requests + + def initialize response, operation, &block + @response = response + @operation = operation + @block = block + @call_rpc_count = 0 + @requests = [] + end + + def call_rpc *args, **kwargs + @call_rpc_count += 1 + + @requests << @block&.call(*args, **kwargs) + + catch :response do + yield @response, @operation if block_given? + @response + end + end + + def endpoint + "endpoint.example.com" + end + + def universe_domain + "example.com" + end + + def stub_logger + nil + end + + def logger + nil + end + end + + def test_list_operations + # Create GRPC objects. + grpc_response = ::Google::Longrunning::ListOperationsResponse.new + grpc_operation = GRPC::ActiveCall::Operation.new nil + grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + grpc_options = {} + + # Create request parameters for a unary method. + name = "hello world" + filter = "hello world" + page_size = 42 + page_token = "hello world" + return_partial_success = true + + list_operations_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :list_operations, name + assert_kind_of ::Google::Longrunning::ListOperationsRequest, request + assert_equal "hello world", request["name"] + assert_equal "hello world", request["filter"] + assert_equal 42, request["page_size"] + assert_equal "hello world", request["page_token"] + assert_equal true, request["return_partial_success"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, list_operations_client_stub do + # Create client + client = ::Google::Cloud::SecurityCenter::V1::SecurityCenter::Operations.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.list_operations({ name: name, filter: filter, page_size: page_size, page_token: page_token, return_partial_success: return_partial_success }) do |response, operation| + assert_kind_of Gapic::PagedEnumerable, response + assert_equal grpc_response, response.response + assert_equal grpc_operation, operation + end + + # Use named arguments + client.list_operations name: name, filter: filter, page_size: page_size, page_token: page_token, return_partial_success: return_partial_success do |response, operation| + assert_kind_of Gapic::PagedEnumerable, response + assert_equal grpc_response, response.response + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.list_operations ::Google::Longrunning::ListOperationsRequest.new(name: name, filter: filter, page_size: page_size, page_token: page_token, return_partial_success: return_partial_success) do |response, operation| + assert_kind_of Gapic::PagedEnumerable, response + assert_equal grpc_response, response.response + assert_equal grpc_operation, operation + end + + # Use hash object with options + client.list_operations({ name: name, filter: filter, page_size: page_size, page_token: page_token, return_partial_success: return_partial_success }, grpc_options) do |response, operation| + assert_kind_of Gapic::PagedEnumerable, response + assert_equal grpc_response, response.response + assert_equal grpc_operation, operation + end + + # Use protobuf object with options + client.list_operations(::Google::Longrunning::ListOperationsRequest.new(name: name, filter: filter, page_size: page_size, page_token: page_token, return_partial_success: return_partial_success), grpc_options) do |response, operation| + assert_kind_of Gapic::PagedEnumerable, response + assert_equal grpc_response, response.response + assert_equal grpc_operation, operation + end + + # Verify method calls + assert_equal 5, list_operations_client_stub.call_rpc_count + end + end + + def test_get_operation + # Create GRPC objects. + grpc_response = ::Google::Longrunning::Operation.new + grpc_operation = GRPC::ActiveCall::Operation.new nil + grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + grpc_options = {} + + # Create request parameters for a unary method. + name = "hello world" + + get_operation_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :get_operation, name + assert_kind_of ::Google::Longrunning::GetOperationRequest, request + assert_equal "hello world", request["name"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, get_operation_client_stub do + # Create client + client = ::Google::Cloud::SecurityCenter::V1::SecurityCenter::Operations.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.get_operation({ name: name }) do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Use named arguments + client.get_operation name: name do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.get_operation ::Google::Longrunning::GetOperationRequest.new(name: name) do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Use hash object with options + client.get_operation({ name: name }, grpc_options) do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Use protobuf object with options + client.get_operation(::Google::Longrunning::GetOperationRequest.new(name: name), grpc_options) do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Verify method calls + assert_equal 5, get_operation_client_stub.call_rpc_count + end + end + + def test_delete_operation + # Create GRPC objects. + grpc_response = ::Google::Protobuf::Empty.new + grpc_operation = GRPC::ActiveCall::Operation.new nil + grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + grpc_options = {} + + # Create request parameters for a unary method. + name = "hello world" + + delete_operation_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :delete_operation, name + assert_kind_of ::Google::Longrunning::DeleteOperationRequest, request + assert_equal "hello world", request["name"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, delete_operation_client_stub do + # Create client + client = ::Google::Cloud::SecurityCenter::V1::SecurityCenter::Operations.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.delete_operation({ name: name }) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use named arguments + client.delete_operation name: name do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.delete_operation ::Google::Longrunning::DeleteOperationRequest.new(name: name) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use hash object with options + client.delete_operation({ name: name }, grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object with options + client.delete_operation(::Google::Longrunning::DeleteOperationRequest.new(name: name), grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Verify method calls + assert_equal 5, delete_operation_client_stub.call_rpc_count + end + end + + def test_cancel_operation + # Create GRPC objects. + grpc_response = ::Google::Protobuf::Empty.new + grpc_operation = GRPC::ActiveCall::Operation.new nil + grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + grpc_options = {} + + # Create request parameters for a unary method. + name = "hello world" + + cancel_operation_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :cancel_operation, name + assert_kind_of ::Google::Longrunning::CancelOperationRequest, request + assert_equal "hello world", request["name"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, cancel_operation_client_stub do + # Create client + client = ::Google::Cloud::SecurityCenter::V1::SecurityCenter::Operations.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.cancel_operation({ name: name }) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use named arguments + client.cancel_operation name: name do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.cancel_operation ::Google::Longrunning::CancelOperationRequest.new(name: name) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use hash object with options + client.cancel_operation({ name: name }, grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object with options + client.cancel_operation(::Google::Longrunning::CancelOperationRequest.new(name: name), grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Verify method calls + assert_equal 5, cancel_operation_client_stub.call_rpc_count + end + end + + def test_wait_operation + # Create GRPC objects. + grpc_response = ::Google::Longrunning::Operation.new + grpc_operation = GRPC::ActiveCall::Operation.new nil + grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + grpc_options = {} + + # Create request parameters for a unary method. + name = "hello world" + timeout = {} + + wait_operation_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :wait_operation, name + assert_kind_of ::Google::Longrunning::WaitOperationRequest, request + assert_equal "hello world", request["name"] + assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Protobuf::Duration), request["timeout"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, wait_operation_client_stub do + # Create client + client = ::Google::Cloud::SecurityCenter::V1::SecurityCenter::Operations.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.wait_operation({ name: name, timeout: timeout }) do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Use named arguments + client.wait_operation name: name, timeout: timeout do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.wait_operation ::Google::Longrunning::WaitOperationRequest.new(name: name, timeout: timeout) do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Use hash object with options + client.wait_operation({ name: name, timeout: timeout }, grpc_options) do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Use protobuf object with options + client.wait_operation(::Google::Longrunning::WaitOperationRequest.new(name: name, timeout: timeout), grpc_options) do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Verify method calls + assert_equal 5, wait_operation_client_stub.call_rpc_count + end + end + + def test_configure + grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + + client = block_config = config = nil + dummy_stub = ClientStub.new nil, nil + Gapic::ServiceStub.stub :new, dummy_stub do + client = ::Google::Cloud::SecurityCenter::V1::SecurityCenter::Operations.new do |config| + config.credentials = grpc_channel + end + end + + config = client.configure do |c| + block_config = c + end + + assert_same block_config, config + assert_kind_of ::Google::Cloud::SecurityCenter::V1::SecurityCenter::Operations::Configuration, config + end +end diff --git a/owl-bot-staging/google-cloud-security_center-v1/test/google/cloud/security_center/v1/security_center_paths_test.rb b/owl-bot-staging/google-cloud-security_center-v1/test/google/cloud/security_center/v1/security_center_paths_test.rb new file mode 100644 index 000000000000..25ac2a34d4cc --- /dev/null +++ b/owl-bot-staging/google-cloud-security_center-v1/test/google/cloud/security_center/v1/security_center_paths_test.rb @@ -0,0 +1,487 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +require "helper" + +require "gapic/grpc/service_stub" + +require "google/cloud/security_center/v1/security_center" + +class ::Google::Cloud::SecurityCenter::V1::SecurityCenter::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_big_query_export_path + grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + ::Gapic::ServiceStub.stub :new, DummyStub.new do + client = ::Google::Cloud::SecurityCenter::V1::SecurityCenter::Client.new do |config| + config.credentials = grpc_channel + end + + path = client.big_query_export_path organization: "value0", export: "value1" + assert_equal "organizations/value0/bigQueryExports/value1", path + + path = client.big_query_export_path folder: "value0", export: "value1" + assert_equal "folders/value0/bigQueryExports/value1", path + + path = client.big_query_export_path project: "value0", export: "value1" + assert_equal "projects/value0/bigQueryExports/value1", path + end + end + + def test_dlp_job_path + grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + ::Gapic::ServiceStub.stub :new, DummyStub.new do + client = ::Google::Cloud::SecurityCenter::V1::SecurityCenter::Client.new do |config| + config.credentials = grpc_channel + end + + path = client.dlp_job_path project: "value0", dlp_job: "value1" + assert_equal "projects/value0/dlpJobs/value1", path + + path = client.dlp_job_path project: "value0", location: "value1", dlp_job: "value2" + assert_equal "projects/value0/locations/value1/dlpJobs/value2", path + end + end + + def test_effective_event_threat_detection_custom_module_path + grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + ::Gapic::ServiceStub.stub :new, DummyStub.new do + client = ::Google::Cloud::SecurityCenter::V1::SecurityCenter::Client.new do |config| + config.credentials = grpc_channel + end + + path = client.effective_event_threat_detection_custom_module_path organization: "value0", module: "value1" + assert_equal "organizations/value0/eventThreatDetectionSettings/effectiveCustomModules/value1", path + + path = client.effective_event_threat_detection_custom_module_path folder: "value0", module: "value1" + assert_equal "folders/value0/eventThreatDetectionSettings/effectiveCustomModules/value1", path + + path = client.effective_event_threat_detection_custom_module_path project: "value0", module: "value1" + assert_equal "projects/value0/eventThreatDetectionSettings/effectiveCustomModules/value1", path + end + end + + def test_effective_security_health_analytics_custom_module_path + grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + ::Gapic::ServiceStub.stub :new, DummyStub.new do + client = ::Google::Cloud::SecurityCenter::V1::SecurityCenter::Client.new do |config| + config.credentials = grpc_channel + end + + path = client.effective_security_health_analytics_custom_module_path organization: "value0", effective_custom_module: "value1" + assert_equal "organizations/value0/securityHealthAnalyticsSettings/effectiveCustomModules/value1", path + + path = client.effective_security_health_analytics_custom_module_path folder: "value0", effective_custom_module: "value1" + assert_equal "folders/value0/securityHealthAnalyticsSettings/effectiveCustomModules/value1", path + + path = client.effective_security_health_analytics_custom_module_path project: "value0", effective_custom_module: "value1" + assert_equal "projects/value0/securityHealthAnalyticsSettings/effectiveCustomModules/value1", path + end + end + + def test_event_threat_detection_custom_module_path + grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + ::Gapic::ServiceStub.stub :new, DummyStub.new do + client = ::Google::Cloud::SecurityCenter::V1::SecurityCenter::Client.new do |config| + config.credentials = grpc_channel + end + + path = client.event_threat_detection_custom_module_path organization: "value0", module: "value1" + assert_equal "organizations/value0/eventThreatDetectionSettings/customModules/value1", path + + path = client.event_threat_detection_custom_module_path folder: "value0", module: "value1" + assert_equal "folders/value0/eventThreatDetectionSettings/customModules/value1", path + + path = client.event_threat_detection_custom_module_path project: "value0", module: "value1" + assert_equal "projects/value0/eventThreatDetectionSettings/customModules/value1", path + end + end + + def test_event_threat_detection_settings_path + grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + ::Gapic::ServiceStub.stub :new, DummyStub.new do + client = ::Google::Cloud::SecurityCenter::V1::SecurityCenter::Client.new do |config| + config.credentials = grpc_channel + end + + path = client.event_threat_detection_settings_path organization: "value0" + assert_equal "organizations/value0/eventThreatDetectionSettings", path + + path = client.event_threat_detection_settings_path folder: "value0" + assert_equal "folders/value0/eventThreatDetectionSettings", path + + path = client.event_threat_detection_settings_path project: "value0" + assert_equal "projects/value0/eventThreatDetectionSettings", path + end + end + + def test_external_system_path + grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + ::Gapic::ServiceStub.stub :new, DummyStub.new do + client = ::Google::Cloud::SecurityCenter::V1::SecurityCenter::Client.new do |config| + config.credentials = grpc_channel + end + + path = client.external_system_path organization: "value0", source: "value1", finding: "value2", externalsystem: "value3" + assert_equal "organizations/value0/sources/value1/findings/value2/externalSystems/value3", path + + path = client.external_system_path folder: "value0", source: "value1", finding: "value2", externalsystem: "value3" + assert_equal "folders/value0/sources/value1/findings/value2/externalSystems/value3", path + + path = client.external_system_path project: "value0", source: "value1", finding: "value2", externalsystem: "value3" + assert_equal "projects/value0/sources/value1/findings/value2/externalSystems/value3", path + end + end + + def test_finding_path + grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + ::Gapic::ServiceStub.stub :new, DummyStub.new do + client = ::Google::Cloud::SecurityCenter::V1::SecurityCenter::Client.new do |config| + config.credentials = grpc_channel + end + + path = client.finding_path organization: "value0", source: "value1", finding: "value2" + assert_equal "organizations/value0/sources/value1/findings/value2", path + + path = client.finding_path folder: "value0", source: "value1", finding: "value2" + assert_equal "folders/value0/sources/value1/findings/value2", path + + path = client.finding_path project: "value0", source: "value1", finding: "value2" + assert_equal "projects/value0/sources/value1/findings/value2", path + end + end + + def test_folder_path + grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + ::Gapic::ServiceStub.stub :new, DummyStub.new do + client = ::Google::Cloud::SecurityCenter::V1::SecurityCenter::Client.new do |config| + config.credentials = grpc_channel + end + + path = client.folder_path folder: "value0" + assert_equal "folders/value0", 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::Cloud::SecurityCenter::V1::SecurityCenter::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::Cloud::SecurityCenter::V1::SecurityCenter::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_mute_config_path + grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + ::Gapic::ServiceStub.stub :new, DummyStub.new do + client = ::Google::Cloud::SecurityCenter::V1::SecurityCenter::Client.new do |config| + config.credentials = grpc_channel + end + + path = client.mute_config_path organization: "value0", mute_config: "value1" + assert_equal "organizations/value0/muteConfigs/value1", path + + path = client.mute_config_path folder: "value0", mute_config: "value1" + assert_equal "folders/value0/muteConfigs/value1", path + + path = client.mute_config_path project: "value0", mute_config: "value1" + assert_equal "projects/value0/muteConfigs/value1", path + + path = client.mute_config_path organization: "value0", location: "value1", mute_config: "value2" + assert_equal "organizations/value0/locations/value1/muteConfigs/value2", path + + path = client.mute_config_path folder: "value0", location: "value1", mute_config: "value2" + assert_equal "folders/value0/locations/value1/muteConfigs/value2", path + + path = client.mute_config_path project: "value0", location: "value1", mute_config: "value2" + assert_equal "projects/value0/locations/value1/muteConfigs/value2", path + end + end + + def test_notification_config_path + grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + ::Gapic::ServiceStub.stub :new, DummyStub.new do + client = ::Google::Cloud::SecurityCenter::V1::SecurityCenter::Client.new do |config| + config.credentials = grpc_channel + end + + path = client.notification_config_path organization: "value0", notification_config: "value1" + assert_equal "organizations/value0/notificationConfigs/value1", path + + path = client.notification_config_path folder: "value0", notification_config: "value1" + assert_equal "folders/value0/notificationConfigs/value1", path + + path = client.notification_config_path project: "value0", notification_config: "value1" + assert_equal "projects/value0/notificationConfigs/value1", path + end + end + + def test_organization_path + grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + ::Gapic::ServiceStub.stub :new, DummyStub.new do + client = ::Google::Cloud::SecurityCenter::V1::SecurityCenter::Client.new do |config| + config.credentials = grpc_channel + end + + path = client.organization_path organization: "value0" + assert_equal "organizations/value0", 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::Cloud::SecurityCenter::V1::SecurityCenter::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_organization_settings_path + grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + ::Gapic::ServiceStub.stub :new, DummyStub.new do + client = ::Google::Cloud::SecurityCenter::V1::SecurityCenter::Client.new do |config| + config.credentials = grpc_channel + end + + path = client.organization_settings_path organization: "value0" + assert_equal "organizations/value0/organizationSettings", path + end + end + + def test_organization_simulation_path + grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + ::Gapic::ServiceStub.stub :new, DummyStub.new do + client = ::Google::Cloud::SecurityCenter::V1::SecurityCenter::Client.new do |config| + config.credentials = grpc_channel + end + + path = client.organization_simulation_path organization: "value0", simulation: "value1" + assert_equal "organizations/value0/simulations/value1", path + end + end + + def test_policy_path + grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + ::Gapic::ServiceStub.stub :new, DummyStub.new do + client = ::Google::Cloud::SecurityCenter::V1::SecurityCenter::Client.new do |config| + config.credentials = grpc_channel + end + + path = client.policy_path organization: "value0", constraint_name: "value1" + assert_equal "organizations/value0/policies/value1", path + + path = client.policy_path folder: "value0", constraint_name: "value1" + assert_equal "folders/value0/policies/value1", path + + path = client.policy_path project: "value0", constraint_name: "value1" + assert_equal "projects/value0/policies/value1", path + end + end + + def test_project_path + grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + ::Gapic::ServiceStub.stub :new, DummyStub.new do + client = ::Google::Cloud::SecurityCenter::V1::SecurityCenter::Client.new do |config| + config.credentials = grpc_channel + end + + path = client.project_path project: "value0" + assert_equal "projects/value0", path + end + end + + def test_resource_value_config_path + grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + ::Gapic::ServiceStub.stub :new, DummyStub.new do + client = ::Google::Cloud::SecurityCenter::V1::SecurityCenter::Client.new do |config| + config.credentials = grpc_channel + end + + path = client.resource_value_config_path organization: "value0", resource_value_config: "value1" + assert_equal "organizations/value0/resourceValueConfigs/value1", path + end + end + + def test_security_health_analytics_custom_module_path + grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + ::Gapic::ServiceStub.stub :new, DummyStub.new do + client = ::Google::Cloud::SecurityCenter::V1::SecurityCenter::Client.new do |config| + config.credentials = grpc_channel + end + + path = client.security_health_analytics_custom_module_path organization: "value0", custom_module: "value1" + assert_equal "organizations/value0/securityHealthAnalyticsSettings/customModules/value1", path + + path = client.security_health_analytics_custom_module_path folder: "value0", custom_module: "value1" + assert_equal "folders/value0/securityHealthAnalyticsSettings/customModules/value1", path + + path = client.security_health_analytics_custom_module_path project: "value0", custom_module: "value1" + assert_equal "projects/value0/securityHealthAnalyticsSettings/customModules/value1", path + end + end + + def test_security_health_analytics_settings_path + grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + ::Gapic::ServiceStub.stub :new, DummyStub.new do + client = ::Google::Cloud::SecurityCenter::V1::SecurityCenter::Client.new do |config| + config.credentials = grpc_channel + end + + path = client.security_health_analytics_settings_path organization: "value0" + assert_equal "organizations/value0/securityHealthAnalyticsSettings", path + + path = client.security_health_analytics_settings_path folder: "value0" + assert_equal "folders/value0/securityHealthAnalyticsSettings", path + + path = client.security_health_analytics_settings_path project: "value0" + assert_equal "projects/value0/securityHealthAnalyticsSettings", path + end + end + + def test_security_marks_path + grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + ::Gapic::ServiceStub.stub :new, DummyStub.new do + client = ::Google::Cloud::SecurityCenter::V1::SecurityCenter::Client.new do |config| + config.credentials = grpc_channel + end + + path = client.security_marks_path organization: "value0", asset: "value1" + assert_equal "organizations/value0/assets/value1/securityMarks", path + + path = client.security_marks_path organization: "value0", source: "value1", finding: "value2" + assert_equal "organizations/value0/sources/value1/findings/value2/securityMarks", path + + path = client.security_marks_path folder: "value0", asset: "value1" + assert_equal "folders/value0/assets/value1/securityMarks", path + + path = client.security_marks_path project: "value0", asset: "value1" + assert_equal "projects/value0/assets/value1/securityMarks", path + + path = client.security_marks_path folder: "value0", source: "value1", finding: "value2" + assert_equal "folders/value0/sources/value1/findings/value2/securityMarks", path + + path = client.security_marks_path project: "value0", source: "value1", finding: "value2" + assert_equal "projects/value0/sources/value1/findings/value2/securityMarks", path + end + end + + def test_simulation_path + grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + ::Gapic::ServiceStub.stub :new, DummyStub.new do + client = ::Google::Cloud::SecurityCenter::V1::SecurityCenter::Client.new do |config| + config.credentials = grpc_channel + end + + path = client.simulation_path organization: "value0", simulation: "value1" + assert_equal "organizations/value0/simulations/value1", path + end + end + + def test_source_path + grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + ::Gapic::ServiceStub.stub :new, DummyStub.new do + client = ::Google::Cloud::SecurityCenter::V1::SecurityCenter::Client.new do |config| + config.credentials = grpc_channel + end + + path = client.source_path organization: "value0", source: "value1" + assert_equal "organizations/value0/sources/value1", path + + path = client.source_path folder: "value0", source: "value1" + assert_equal "folders/value0/sources/value1", path + + path = client.source_path project: "value0", source: "value1" + assert_equal "projects/value0/sources/value1", path + end + end + + def test_table_data_profile_path + grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + ::Gapic::ServiceStub.stub :new, DummyStub.new do + client = ::Google::Cloud::SecurityCenter::V1::SecurityCenter::Client.new do |config| + config.credentials = grpc_channel + end + + path = client.table_data_profile_path project: "value0", table_profile: "value1" + assert_equal "projects/value0/tableProfiles/value1", path + + path = client.table_data_profile_path project: "value0", location: "value1", table_profile: "value2" + assert_equal "projects/value0/locations/value1/tableProfiles/value2", path + end + end + + def test_topic_path + grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + ::Gapic::ServiceStub.stub :new, DummyStub.new do + client = ::Google::Cloud::SecurityCenter::V1::SecurityCenter::Client.new do |config| + config.credentials = grpc_channel + end + + path = client.topic_path project: "value0", topic: "value1" + assert_equal "projects/value0/topics/value1", path + end + end + + def test_valued_resource_path + grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + ::Gapic::ServiceStub.stub :new, DummyStub.new do + client = ::Google::Cloud::SecurityCenter::V1::SecurityCenter::Client.new do |config| + config.credentials = grpc_channel + end + + path = client.valued_resource_path organization: "value0", simulation: "value1", valued_resource: "value2" + assert_equal "organizations/value0/simulations/value1/valuedResources/value2", path + end + end +end diff --git a/owl-bot-staging/google-cloud-security_center-v1/test/google/cloud/security_center/v1/security_center_rest_test.rb b/owl-bot-staging/google-cloud-security_center-v1/test/google/cloud/security_center/v1/security_center_rest_test.rb new file mode 100644 index 000000000000..4a2418bd9a8f --- /dev/null +++ b/owl-bot-staging/google-cloud-security_center-v1/test/google/cloud/security_center/v1/security_center_rest_test.rb @@ -0,0 +1,3594 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +require "helper" +require "gapic/rest" +require "google/cloud/securitycenter/v1/securitycenter_service_pb" +require "google/cloud/security_center/v1/security_center/rest" + + +class ::Google::Cloud::SecurityCenter::V1::SecurityCenter::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_bulk_mute_findings + # 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" + filter = "hello world" + mute_annotation = "hello world" + mute_state = :MUTE_STATE_UNSPECIFIED + + bulk_mute_findings_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| + assert options.metadata.key? :"x-goog-api-client" + assert options.metadata[:"x-goog-api-client"].include? "rest" + refute options.metadata[:"x-goog-api-client"].include? "grpc" + end + + ::Google::Cloud::SecurityCenter::V1::SecurityCenter::Rest::ServiceStub.stub :transcode_bulk_mute_findings_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, bulk_mute_findings_client_stub do + # Create client + client = ::Google::Cloud::SecurityCenter::V1::SecurityCenter::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.bulk_mute_findings({ parent: parent, filter: filter, mute_annotation: mute_annotation, mute_state: mute_state }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.bulk_mute_findings parent: parent, filter: filter, mute_annotation: mute_annotation, mute_state: mute_state do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.bulk_mute_findings ::Google::Cloud::SecurityCenter::V1::BulkMuteFindingsRequest.new(parent: parent, filter: filter, mute_annotation: mute_annotation, mute_state: mute_state) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + client.bulk_mute_findings({ parent: parent, filter: filter, mute_annotation: mute_annotation, mute_state: mute_state }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + client.bulk_mute_findings(::Google::Cloud::SecurityCenter::V1::BulkMuteFindingsRequest.new(parent: parent, filter: filter, mute_annotation: mute_annotation, mute_state: mute_state), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, bulk_mute_findings_client_stub.call_count + end + end + end + + def test_create_security_health_analytics_custom_module + # Create test objects. + client_result = ::Google::Cloud::SecurityCenter::V1::SecurityHealthAnalyticsCustomModule.new + http_response = OpenStruct.new body: client_result.to_json + + call_options = {} + + # Create request parameters for a unary method. + parent = "hello world" + security_health_analytics_custom_module = {} + + create_security_health_analytics_custom_module_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| + assert options.metadata.key? :"x-goog-api-client" + assert options.metadata[:"x-goog-api-client"].include? "rest" + refute options.metadata[:"x-goog-api-client"].include? "grpc" + end + + ::Google::Cloud::SecurityCenter::V1::SecurityCenter::Rest::ServiceStub.stub :transcode_create_security_health_analytics_custom_module_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, create_security_health_analytics_custom_module_client_stub do + # Create client + client = ::Google::Cloud::SecurityCenter::V1::SecurityCenter::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.create_security_health_analytics_custom_module({ parent: parent, security_health_analytics_custom_module: security_health_analytics_custom_module }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.create_security_health_analytics_custom_module parent: parent, security_health_analytics_custom_module: security_health_analytics_custom_module do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.create_security_health_analytics_custom_module ::Google::Cloud::SecurityCenter::V1::CreateSecurityHealthAnalyticsCustomModuleRequest.new(parent: parent, security_health_analytics_custom_module: security_health_analytics_custom_module) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + client.create_security_health_analytics_custom_module({ parent: parent, security_health_analytics_custom_module: security_health_analytics_custom_module }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + client.create_security_health_analytics_custom_module(::Google::Cloud::SecurityCenter::V1::CreateSecurityHealthAnalyticsCustomModuleRequest.new(parent: parent, security_health_analytics_custom_module: security_health_analytics_custom_module), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, create_security_health_analytics_custom_module_client_stub.call_count + end + end + end + + def test_create_source + # Create test objects. + client_result = ::Google::Cloud::SecurityCenter::V1::Source.new + http_response = OpenStruct.new body: client_result.to_json + + call_options = {} + + # Create request parameters for a unary method. + parent = "hello world" + source = {} + + create_source_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| + assert options.metadata.key? :"x-goog-api-client" + assert options.metadata[:"x-goog-api-client"].include? "rest" + refute options.metadata[:"x-goog-api-client"].include? "grpc" + end + + ::Google::Cloud::SecurityCenter::V1::SecurityCenter::Rest::ServiceStub.stub :transcode_create_source_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, create_source_client_stub do + # Create client + client = ::Google::Cloud::SecurityCenter::V1::SecurityCenter::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.create_source({ parent: parent, source: source }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.create_source parent: parent, source: source do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.create_source ::Google::Cloud::SecurityCenter::V1::CreateSourceRequest.new(parent: parent, source: source) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + client.create_source({ parent: parent, source: source }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + client.create_source(::Google::Cloud::SecurityCenter::V1::CreateSourceRequest.new(parent: parent, source: source), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, create_source_client_stub.call_count + end + end + end + + def test_create_finding + # Create test objects. + client_result = ::Google::Cloud::SecurityCenter::V1::Finding.new + http_response = OpenStruct.new body: client_result.to_json + + call_options = {} + + # Create request parameters for a unary method. + parent = "hello world" + finding_id = "hello world" + finding = {} + + create_finding_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| + assert options.metadata.key? :"x-goog-api-client" + assert options.metadata[:"x-goog-api-client"].include? "rest" + refute options.metadata[:"x-goog-api-client"].include? "grpc" + end + + ::Google::Cloud::SecurityCenter::V1::SecurityCenter::Rest::ServiceStub.stub :transcode_create_finding_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, create_finding_client_stub do + # Create client + client = ::Google::Cloud::SecurityCenter::V1::SecurityCenter::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.create_finding({ parent: parent, finding_id: finding_id, finding: finding }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.create_finding parent: parent, finding_id: finding_id, finding: finding do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.create_finding ::Google::Cloud::SecurityCenter::V1::CreateFindingRequest.new(parent: parent, finding_id: finding_id, finding: finding) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + client.create_finding({ parent: parent, finding_id: finding_id, finding: finding }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + client.create_finding(::Google::Cloud::SecurityCenter::V1::CreateFindingRequest.new(parent: parent, finding_id: finding_id, finding: finding), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, create_finding_client_stub.call_count + end + end + end + + def test_create_mute_config + # Create test objects. + client_result = ::Google::Cloud::SecurityCenter::V1::MuteConfig.new + http_response = OpenStruct.new body: client_result.to_json + + call_options = {} + + # Create request parameters for a unary method. + parent = "hello world" + mute_config = {} + mute_config_id = "hello world" + + create_mute_config_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| + assert options.metadata.key? :"x-goog-api-client" + assert options.metadata[:"x-goog-api-client"].include? "rest" + refute options.metadata[:"x-goog-api-client"].include? "grpc" + end + + ::Google::Cloud::SecurityCenter::V1::SecurityCenter::Rest::ServiceStub.stub :transcode_create_mute_config_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, create_mute_config_client_stub do + # Create client + client = ::Google::Cloud::SecurityCenter::V1::SecurityCenter::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.create_mute_config({ parent: parent, mute_config: mute_config, mute_config_id: mute_config_id }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.create_mute_config parent: parent, mute_config: mute_config, mute_config_id: mute_config_id do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.create_mute_config ::Google::Cloud::SecurityCenter::V1::CreateMuteConfigRequest.new(parent: parent, mute_config: mute_config, mute_config_id: mute_config_id) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + client.create_mute_config({ parent: parent, mute_config: mute_config, mute_config_id: mute_config_id }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + client.create_mute_config(::Google::Cloud::SecurityCenter::V1::CreateMuteConfigRequest.new(parent: parent, mute_config: mute_config, mute_config_id: mute_config_id), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, create_mute_config_client_stub.call_count + end + end + end + + def test_create_notification_config + # Create test objects. + client_result = ::Google::Cloud::SecurityCenter::V1::NotificationConfig.new + http_response = OpenStruct.new body: client_result.to_json + + call_options = {} + + # Create request parameters for a unary method. + parent = "hello world" + config_id = "hello world" + notification_config = {} + + create_notification_config_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| + assert options.metadata.key? :"x-goog-api-client" + assert options.metadata[:"x-goog-api-client"].include? "rest" + refute options.metadata[:"x-goog-api-client"].include? "grpc" + end + + ::Google::Cloud::SecurityCenter::V1::SecurityCenter::Rest::ServiceStub.stub :transcode_create_notification_config_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, create_notification_config_client_stub do + # Create client + client = ::Google::Cloud::SecurityCenter::V1::SecurityCenter::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.create_notification_config({ parent: parent, config_id: config_id, notification_config: notification_config }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.create_notification_config parent: parent, config_id: config_id, notification_config: notification_config do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.create_notification_config ::Google::Cloud::SecurityCenter::V1::CreateNotificationConfigRequest.new(parent: parent, config_id: config_id, notification_config: notification_config) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + client.create_notification_config({ parent: parent, config_id: config_id, notification_config: notification_config }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + client.create_notification_config(::Google::Cloud::SecurityCenter::V1::CreateNotificationConfigRequest.new(parent: parent, config_id: config_id, notification_config: notification_config), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, create_notification_config_client_stub.call_count + end + end + end + + def test_delete_mute_config + # Create test objects. + client_result = ::Google::Protobuf::Empty.new + http_response = OpenStruct.new body: client_result.to_json + + call_options = {} + + # Create request parameters for a unary method. + name = "hello world" + + delete_mute_config_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| + assert options.metadata.key? :"x-goog-api-client" + assert options.metadata[:"x-goog-api-client"].include? "rest" + refute options.metadata[:"x-goog-api-client"].include? "grpc" + end + + ::Google::Cloud::SecurityCenter::V1::SecurityCenter::Rest::ServiceStub.stub :transcode_delete_mute_config_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, delete_mute_config_client_stub do + # Create client + client = ::Google::Cloud::SecurityCenter::V1::SecurityCenter::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.delete_mute_config({ name: name }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.delete_mute_config name: name do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.delete_mute_config ::Google::Cloud::SecurityCenter::V1::DeleteMuteConfigRequest.new(name: name) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + client.delete_mute_config({ name: name }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + client.delete_mute_config(::Google::Cloud::SecurityCenter::V1::DeleteMuteConfigRequest.new(name: name), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, delete_mute_config_client_stub.call_count + end + end + end + + def test_delete_notification_config + # Create test objects. + client_result = ::Google::Protobuf::Empty.new + http_response = OpenStruct.new body: client_result.to_json + + call_options = {} + + # Create request parameters for a unary method. + name = "hello world" + + delete_notification_config_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| + assert options.metadata.key? :"x-goog-api-client" + assert options.metadata[:"x-goog-api-client"].include? "rest" + refute options.metadata[:"x-goog-api-client"].include? "grpc" + end + + ::Google::Cloud::SecurityCenter::V1::SecurityCenter::Rest::ServiceStub.stub :transcode_delete_notification_config_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, delete_notification_config_client_stub do + # Create client + client = ::Google::Cloud::SecurityCenter::V1::SecurityCenter::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.delete_notification_config({ name: name }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.delete_notification_config name: name do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.delete_notification_config ::Google::Cloud::SecurityCenter::V1::DeleteNotificationConfigRequest.new(name: name) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + client.delete_notification_config({ name: name }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + client.delete_notification_config(::Google::Cloud::SecurityCenter::V1::DeleteNotificationConfigRequest.new(name: name), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, delete_notification_config_client_stub.call_count + end + end + end + + def test_delete_security_health_analytics_custom_module + # Create test objects. + client_result = ::Google::Protobuf::Empty.new + http_response = OpenStruct.new body: client_result.to_json + + call_options = {} + + # Create request parameters for a unary method. + name = "hello world" + + delete_security_health_analytics_custom_module_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| + assert options.metadata.key? :"x-goog-api-client" + assert options.metadata[:"x-goog-api-client"].include? "rest" + refute options.metadata[:"x-goog-api-client"].include? "grpc" + end + + ::Google::Cloud::SecurityCenter::V1::SecurityCenter::Rest::ServiceStub.stub :transcode_delete_security_health_analytics_custom_module_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, delete_security_health_analytics_custom_module_client_stub do + # Create client + client = ::Google::Cloud::SecurityCenter::V1::SecurityCenter::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.delete_security_health_analytics_custom_module({ name: name }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.delete_security_health_analytics_custom_module name: name do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.delete_security_health_analytics_custom_module ::Google::Cloud::SecurityCenter::V1::DeleteSecurityHealthAnalyticsCustomModuleRequest.new(name: name) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + client.delete_security_health_analytics_custom_module({ name: name }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + client.delete_security_health_analytics_custom_module(::Google::Cloud::SecurityCenter::V1::DeleteSecurityHealthAnalyticsCustomModuleRequest.new(name: name), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, delete_security_health_analytics_custom_module_client_stub.call_count + end + end + end + + def test_get_simulation + # Create test objects. + client_result = ::Google::Cloud::SecurityCenter::V1::Simulation.new + http_response = OpenStruct.new body: client_result.to_json + + call_options = {} + + # Create request parameters for a unary method. + name = "hello world" + + get_simulation_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| + assert options.metadata.key? :"x-goog-api-client" + assert options.metadata[:"x-goog-api-client"].include? "rest" + refute options.metadata[:"x-goog-api-client"].include? "grpc" + end + + ::Google::Cloud::SecurityCenter::V1::SecurityCenter::Rest::ServiceStub.stub :transcode_get_simulation_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, get_simulation_client_stub do + # Create client + client = ::Google::Cloud::SecurityCenter::V1::SecurityCenter::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.get_simulation({ name: name }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.get_simulation name: name do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.get_simulation ::Google::Cloud::SecurityCenter::V1::GetSimulationRequest.new(name: name) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + client.get_simulation({ name: name }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + client.get_simulation(::Google::Cloud::SecurityCenter::V1::GetSimulationRequest.new(name: name), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, get_simulation_client_stub.call_count + end + end + end + + def test_get_valued_resource + # Create test objects. + client_result = ::Google::Cloud::SecurityCenter::V1::ValuedResource.new + http_response = OpenStruct.new body: client_result.to_json + + call_options = {} + + # Create request parameters for a unary method. + name = "hello world" + + get_valued_resource_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| + assert options.metadata.key? :"x-goog-api-client" + assert options.metadata[:"x-goog-api-client"].include? "rest" + refute options.metadata[:"x-goog-api-client"].include? "grpc" + end + + ::Google::Cloud::SecurityCenter::V1::SecurityCenter::Rest::ServiceStub.stub :transcode_get_valued_resource_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, get_valued_resource_client_stub do + # Create client + client = ::Google::Cloud::SecurityCenter::V1::SecurityCenter::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.get_valued_resource({ name: name }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.get_valued_resource name: name do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.get_valued_resource ::Google::Cloud::SecurityCenter::V1::GetValuedResourceRequest.new(name: name) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + client.get_valued_resource({ name: name }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + client.get_valued_resource(::Google::Cloud::SecurityCenter::V1::GetValuedResourceRequest.new(name: name), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, get_valued_resource_client_stub.call_count + end + end + end + + def test_get_big_query_export + # Create test objects. + client_result = ::Google::Cloud::SecurityCenter::V1::BigQueryExport.new + http_response = OpenStruct.new body: client_result.to_json + + call_options = {} + + # Create request parameters for a unary method. + name = "hello world" + + get_big_query_export_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| + assert options.metadata.key? :"x-goog-api-client" + assert options.metadata[:"x-goog-api-client"].include? "rest" + refute options.metadata[:"x-goog-api-client"].include? "grpc" + end + + ::Google::Cloud::SecurityCenter::V1::SecurityCenter::Rest::ServiceStub.stub :transcode_get_big_query_export_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, get_big_query_export_client_stub do + # Create client + client = ::Google::Cloud::SecurityCenter::V1::SecurityCenter::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.get_big_query_export({ name: name }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.get_big_query_export name: name do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.get_big_query_export ::Google::Cloud::SecurityCenter::V1::GetBigQueryExportRequest.new(name: name) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + client.get_big_query_export({ name: name }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + client.get_big_query_export(::Google::Cloud::SecurityCenter::V1::GetBigQueryExportRequest.new(name: name), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, get_big_query_export_client_stub.call_count + end + end + end + + def test_get_iam_policy + # Create test objects. + client_result = ::Google::Iam::V1::Policy.new + http_response = OpenStruct.new body: client_result.to_json + + call_options = {} + + # Create request parameters for a unary method. + resource = "hello world" + options = {} + + get_iam_policy_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| + assert options.metadata.key? :"x-goog-api-client" + assert options.metadata[:"x-goog-api-client"].include? "rest" + refute options.metadata[:"x-goog-api-client"].include? "grpc" + end + + ::Google::Cloud::SecurityCenter::V1::SecurityCenter::Rest::ServiceStub.stub :transcode_get_iam_policy_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, get_iam_policy_client_stub do + # Create client + client = ::Google::Cloud::SecurityCenter::V1::SecurityCenter::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.get_iam_policy({ resource: resource, options: options }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.get_iam_policy resource: resource, options: options do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.get_iam_policy ::Google::Iam::V1::GetIamPolicyRequest.new(resource: resource, options: options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + client.get_iam_policy({ resource: resource, options: options }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + client.get_iam_policy(::Google::Iam::V1::GetIamPolicyRequest.new(resource: resource, options: options), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, get_iam_policy_client_stub.call_count + end + end + end + + def test_get_mute_config + # Create test objects. + client_result = ::Google::Cloud::SecurityCenter::V1::MuteConfig.new + http_response = OpenStruct.new body: client_result.to_json + + call_options = {} + + # Create request parameters for a unary method. + name = "hello world" + + get_mute_config_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| + assert options.metadata.key? :"x-goog-api-client" + assert options.metadata[:"x-goog-api-client"].include? "rest" + refute options.metadata[:"x-goog-api-client"].include? "grpc" + end + + ::Google::Cloud::SecurityCenter::V1::SecurityCenter::Rest::ServiceStub.stub :transcode_get_mute_config_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, get_mute_config_client_stub do + # Create client + client = ::Google::Cloud::SecurityCenter::V1::SecurityCenter::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.get_mute_config({ name: name }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.get_mute_config name: name do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.get_mute_config ::Google::Cloud::SecurityCenter::V1::GetMuteConfigRequest.new(name: name) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + client.get_mute_config({ name: name }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + client.get_mute_config(::Google::Cloud::SecurityCenter::V1::GetMuteConfigRequest.new(name: name), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, get_mute_config_client_stub.call_count + end + end + end + + def test_get_notification_config + # Create test objects. + client_result = ::Google::Cloud::SecurityCenter::V1::NotificationConfig.new + http_response = OpenStruct.new body: client_result.to_json + + call_options = {} + + # Create request parameters for a unary method. + name = "hello world" + + get_notification_config_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| + assert options.metadata.key? :"x-goog-api-client" + assert options.metadata[:"x-goog-api-client"].include? "rest" + refute options.metadata[:"x-goog-api-client"].include? "grpc" + end + + ::Google::Cloud::SecurityCenter::V1::SecurityCenter::Rest::ServiceStub.stub :transcode_get_notification_config_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, get_notification_config_client_stub do + # Create client + client = ::Google::Cloud::SecurityCenter::V1::SecurityCenter::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.get_notification_config({ name: name }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.get_notification_config name: name do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.get_notification_config ::Google::Cloud::SecurityCenter::V1::GetNotificationConfigRequest.new(name: name) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + client.get_notification_config({ name: name }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + client.get_notification_config(::Google::Cloud::SecurityCenter::V1::GetNotificationConfigRequest.new(name: name), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, get_notification_config_client_stub.call_count + end + end + end + + def test_get_organization_settings + # Create test objects. + client_result = ::Google::Cloud::SecurityCenter::V1::OrganizationSettings.new + http_response = OpenStruct.new body: client_result.to_json + + call_options = {} + + # Create request parameters for a unary method. + name = "hello world" + + get_organization_settings_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| + assert options.metadata.key? :"x-goog-api-client" + assert options.metadata[:"x-goog-api-client"].include? "rest" + refute options.metadata[:"x-goog-api-client"].include? "grpc" + end + + ::Google::Cloud::SecurityCenter::V1::SecurityCenter::Rest::ServiceStub.stub :transcode_get_organization_settings_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, get_organization_settings_client_stub do + # Create client + client = ::Google::Cloud::SecurityCenter::V1::SecurityCenter::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.get_organization_settings({ name: name }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.get_organization_settings name: name do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.get_organization_settings ::Google::Cloud::SecurityCenter::V1::GetOrganizationSettingsRequest.new(name: name) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + client.get_organization_settings({ name: name }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + client.get_organization_settings(::Google::Cloud::SecurityCenter::V1::GetOrganizationSettingsRequest.new(name: name), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, get_organization_settings_client_stub.call_count + end + end + end + + def test_get_effective_security_health_analytics_custom_module + # Create test objects. + client_result = ::Google::Cloud::SecurityCenter::V1::EffectiveSecurityHealthAnalyticsCustomModule.new + http_response = OpenStruct.new body: client_result.to_json + + call_options = {} + + # Create request parameters for a unary method. + name = "hello world" + + get_effective_security_health_analytics_custom_module_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| + assert options.metadata.key? :"x-goog-api-client" + assert options.metadata[:"x-goog-api-client"].include? "rest" + refute options.metadata[:"x-goog-api-client"].include? "grpc" + end + + ::Google::Cloud::SecurityCenter::V1::SecurityCenter::Rest::ServiceStub.stub :transcode_get_effective_security_health_analytics_custom_module_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, get_effective_security_health_analytics_custom_module_client_stub do + # Create client + client = ::Google::Cloud::SecurityCenter::V1::SecurityCenter::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.get_effective_security_health_analytics_custom_module({ name: name }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.get_effective_security_health_analytics_custom_module name: name do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.get_effective_security_health_analytics_custom_module ::Google::Cloud::SecurityCenter::V1::GetEffectiveSecurityHealthAnalyticsCustomModuleRequest.new(name: name) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + client.get_effective_security_health_analytics_custom_module({ name: name }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + client.get_effective_security_health_analytics_custom_module(::Google::Cloud::SecurityCenter::V1::GetEffectiveSecurityHealthAnalyticsCustomModuleRequest.new(name: name), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, get_effective_security_health_analytics_custom_module_client_stub.call_count + end + end + end + + def test_get_security_health_analytics_custom_module + # Create test objects. + client_result = ::Google::Cloud::SecurityCenter::V1::SecurityHealthAnalyticsCustomModule.new + http_response = OpenStruct.new body: client_result.to_json + + call_options = {} + + # Create request parameters for a unary method. + name = "hello world" + + get_security_health_analytics_custom_module_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| + assert options.metadata.key? :"x-goog-api-client" + assert options.metadata[:"x-goog-api-client"].include? "rest" + refute options.metadata[:"x-goog-api-client"].include? "grpc" + end + + ::Google::Cloud::SecurityCenter::V1::SecurityCenter::Rest::ServiceStub.stub :transcode_get_security_health_analytics_custom_module_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, get_security_health_analytics_custom_module_client_stub do + # Create client + client = ::Google::Cloud::SecurityCenter::V1::SecurityCenter::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.get_security_health_analytics_custom_module({ name: name }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.get_security_health_analytics_custom_module name: name do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.get_security_health_analytics_custom_module ::Google::Cloud::SecurityCenter::V1::GetSecurityHealthAnalyticsCustomModuleRequest.new(name: name) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + client.get_security_health_analytics_custom_module({ name: name }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + client.get_security_health_analytics_custom_module(::Google::Cloud::SecurityCenter::V1::GetSecurityHealthAnalyticsCustomModuleRequest.new(name: name), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, get_security_health_analytics_custom_module_client_stub.call_count + end + end + end + + def test_get_source + # Create test objects. + client_result = ::Google::Cloud::SecurityCenter::V1::Source.new + http_response = OpenStruct.new body: client_result.to_json + + call_options = {} + + # Create request parameters for a unary method. + name = "hello world" + + get_source_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| + assert options.metadata.key? :"x-goog-api-client" + assert options.metadata[:"x-goog-api-client"].include? "rest" + refute options.metadata[:"x-goog-api-client"].include? "grpc" + end + + ::Google::Cloud::SecurityCenter::V1::SecurityCenter::Rest::ServiceStub.stub :transcode_get_source_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, get_source_client_stub do + # Create client + client = ::Google::Cloud::SecurityCenter::V1::SecurityCenter::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.get_source({ name: name }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.get_source name: name do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.get_source ::Google::Cloud::SecurityCenter::V1::GetSourceRequest.new(name: name) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + client.get_source({ name: name }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + client.get_source(::Google::Cloud::SecurityCenter::V1::GetSourceRequest.new(name: name), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, get_source_client_stub.call_count + end + end + end + + def test_group_assets + # Create test objects. + client_result = ::Google::Cloud::SecurityCenter::V1::GroupAssetsResponse.new + http_response = OpenStruct.new body: client_result.to_json + + call_options = {} + + # Create request parameters for a unary method. + parent = "hello world" + filter = "hello world" + group_by = "hello world" + compare_duration = {} + read_time = {} + page_token = "hello world" + page_size = 42 + + group_assets_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| + assert options.metadata.key? :"x-goog-api-client" + assert options.metadata[:"x-goog-api-client"].include? "rest" + refute options.metadata[:"x-goog-api-client"].include? "grpc" + end + + ::Google::Cloud::SecurityCenter::V1::SecurityCenter::Rest::ServiceStub.stub :transcode_group_assets_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, group_assets_client_stub do + # Create client + client = ::Google::Cloud::SecurityCenter::V1::SecurityCenter::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.group_assets({ parent: parent, filter: filter, group_by: group_by, compare_duration: compare_duration, read_time: read_time, page_token: page_token, page_size: page_size }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.group_assets parent: parent, filter: filter, group_by: group_by, compare_duration: compare_duration, read_time: read_time, page_token: page_token, page_size: page_size do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.group_assets ::Google::Cloud::SecurityCenter::V1::GroupAssetsRequest.new(parent: parent, filter: filter, group_by: group_by, compare_duration: compare_duration, read_time: read_time, page_token: page_token, page_size: page_size) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + client.group_assets({ parent: parent, filter: filter, group_by: group_by, compare_duration: compare_duration, read_time: read_time, page_token: page_token, page_size: page_size }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + client.group_assets(::Google::Cloud::SecurityCenter::V1::GroupAssetsRequest.new(parent: parent, filter: filter, group_by: group_by, compare_duration: compare_duration, read_time: read_time, page_token: page_token, page_size: page_size), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, group_assets_client_stub.call_count + end + end + end + + def test_group_findings + # Create test objects. + client_result = ::Google::Cloud::SecurityCenter::V1::GroupFindingsResponse.new + http_response = OpenStruct.new body: client_result.to_json + + call_options = {} + + # Create request parameters for a unary method. + parent = "hello world" + filter = "hello world" + group_by = "hello world" + read_time = {} + compare_duration = {} + page_token = "hello world" + page_size = 42 + + group_findings_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| + assert options.metadata.key? :"x-goog-api-client" + assert options.metadata[:"x-goog-api-client"].include? "rest" + refute options.metadata[:"x-goog-api-client"].include? "grpc" + end + + ::Google::Cloud::SecurityCenter::V1::SecurityCenter::Rest::ServiceStub.stub :transcode_group_findings_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, group_findings_client_stub do + # Create client + client = ::Google::Cloud::SecurityCenter::V1::SecurityCenter::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.group_findings({ parent: parent, filter: filter, group_by: group_by, read_time: read_time, compare_duration: compare_duration, page_token: page_token, page_size: page_size }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.group_findings parent: parent, filter: filter, group_by: group_by, read_time: read_time, compare_duration: compare_duration, page_token: page_token, page_size: page_size do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.group_findings ::Google::Cloud::SecurityCenter::V1::GroupFindingsRequest.new(parent: parent, filter: filter, group_by: group_by, read_time: read_time, compare_duration: compare_duration, page_token: page_token, page_size: page_size) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + client.group_findings({ parent: parent, filter: filter, group_by: group_by, read_time: read_time, compare_duration: compare_duration, page_token: page_token, page_size: page_size }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + client.group_findings(::Google::Cloud::SecurityCenter::V1::GroupFindingsRequest.new(parent: parent, filter: filter, group_by: group_by, read_time: read_time, compare_duration: compare_duration, page_token: page_token, page_size: page_size), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, group_findings_client_stub.call_count + end + end + end + + def test_list_assets + # Create test objects. + client_result = ::Google::Cloud::SecurityCenter::V1::ListAssetsResponse.new + http_response = OpenStruct.new body: client_result.to_json + + call_options = {} + + # Create request parameters for a unary method. + parent = "hello world" + filter = "hello world" + order_by = "hello world" + read_time = {} + compare_duration = {} + field_mask = {} + page_token = "hello world" + page_size = 42 + + list_assets_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| + assert options.metadata.key? :"x-goog-api-client" + assert options.metadata[:"x-goog-api-client"].include? "rest" + refute options.metadata[:"x-goog-api-client"].include? "grpc" + end + + ::Google::Cloud::SecurityCenter::V1::SecurityCenter::Rest::ServiceStub.stub :transcode_list_assets_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, list_assets_client_stub do + # Create client + client = ::Google::Cloud::SecurityCenter::V1::SecurityCenter::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.list_assets({ parent: parent, filter: filter, order_by: order_by, read_time: read_time, compare_duration: compare_duration, field_mask: field_mask, page_token: page_token, page_size: page_size }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.list_assets parent: parent, filter: filter, order_by: order_by, read_time: read_time, compare_duration: compare_duration, field_mask: field_mask, page_token: page_token, page_size: page_size do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.list_assets ::Google::Cloud::SecurityCenter::V1::ListAssetsRequest.new(parent: parent, filter: filter, order_by: order_by, read_time: read_time, compare_duration: compare_duration, field_mask: field_mask, page_token: page_token, page_size: page_size) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + client.list_assets({ parent: parent, filter: filter, order_by: order_by, read_time: read_time, compare_duration: compare_duration, field_mask: field_mask, page_token: page_token, page_size: page_size }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + client.list_assets(::Google::Cloud::SecurityCenter::V1::ListAssetsRequest.new(parent: parent, filter: filter, order_by: order_by, read_time: read_time, compare_duration: compare_duration, field_mask: field_mask, page_token: page_token, page_size: page_size), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, list_assets_client_stub.call_count + end + end + end + + def test_list_descendant_security_health_analytics_custom_modules + # Create test objects. + client_result = ::Google::Cloud::SecurityCenter::V1::ListDescendantSecurityHealthAnalyticsCustomModulesResponse.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_descendant_security_health_analytics_custom_modules_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| + assert options.metadata.key? :"x-goog-api-client" + assert options.metadata[:"x-goog-api-client"].include? "rest" + refute options.metadata[:"x-goog-api-client"].include? "grpc" + end + + ::Google::Cloud::SecurityCenter::V1::SecurityCenter::Rest::ServiceStub.stub :transcode_list_descendant_security_health_analytics_custom_modules_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, list_descendant_security_health_analytics_custom_modules_client_stub do + # Create client + client = ::Google::Cloud::SecurityCenter::V1::SecurityCenter::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.list_descendant_security_health_analytics_custom_modules({ 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_descendant_security_health_analytics_custom_modules 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_descendant_security_health_analytics_custom_modules ::Google::Cloud::SecurityCenter::V1::ListDescendantSecurityHealthAnalyticsCustomModulesRequest.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_descendant_security_health_analytics_custom_modules({ 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_descendant_security_health_analytics_custom_modules(::Google::Cloud::SecurityCenter::V1::ListDescendantSecurityHealthAnalyticsCustomModulesRequest.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_descendant_security_health_analytics_custom_modules_client_stub.call_count + end + end + end + + def test_list_findings + # Create test objects. + client_result = ::Google::Cloud::SecurityCenter::V1::ListFindingsResponse.new + http_response = OpenStruct.new body: client_result.to_json + + call_options = {} + + # Create request parameters for a unary method. + parent = "hello world" + filter = "hello world" + order_by = "hello world" + read_time = {} + compare_duration = {} + field_mask = {} + page_token = "hello world" + page_size = 42 + + list_findings_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| + assert options.metadata.key? :"x-goog-api-client" + assert options.metadata[:"x-goog-api-client"].include? "rest" + refute options.metadata[:"x-goog-api-client"].include? "grpc" + end + + ::Google::Cloud::SecurityCenter::V1::SecurityCenter::Rest::ServiceStub.stub :transcode_list_findings_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, list_findings_client_stub do + # Create client + client = ::Google::Cloud::SecurityCenter::V1::SecurityCenter::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.list_findings({ parent: parent, filter: filter, order_by: order_by, read_time: read_time, compare_duration: compare_duration, field_mask: field_mask, page_token: page_token, page_size: page_size }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.list_findings parent: parent, filter: filter, order_by: order_by, read_time: read_time, compare_duration: compare_duration, field_mask: field_mask, page_token: page_token, page_size: page_size do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.list_findings ::Google::Cloud::SecurityCenter::V1::ListFindingsRequest.new(parent: parent, filter: filter, order_by: order_by, read_time: read_time, compare_duration: compare_duration, field_mask: field_mask, page_token: page_token, page_size: page_size) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + client.list_findings({ parent: parent, filter: filter, order_by: order_by, read_time: read_time, compare_duration: compare_duration, field_mask: field_mask, page_token: page_token, page_size: page_size }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + client.list_findings(::Google::Cloud::SecurityCenter::V1::ListFindingsRequest.new(parent: parent, filter: filter, order_by: order_by, read_time: read_time, compare_duration: compare_duration, field_mask: field_mask, page_token: page_token, page_size: page_size), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, list_findings_client_stub.call_count + end + end + end + + def test_list_mute_configs + # Create test objects. + client_result = ::Google::Cloud::SecurityCenter::V1::ListMuteConfigsResponse.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_mute_configs_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| + assert options.metadata.key? :"x-goog-api-client" + assert options.metadata[:"x-goog-api-client"].include? "rest" + refute options.metadata[:"x-goog-api-client"].include? "grpc" + end + + ::Google::Cloud::SecurityCenter::V1::SecurityCenter::Rest::ServiceStub.stub :transcode_list_mute_configs_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, list_mute_configs_client_stub do + # Create client + client = ::Google::Cloud::SecurityCenter::V1::SecurityCenter::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.list_mute_configs({ 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_mute_configs 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_mute_configs ::Google::Cloud::SecurityCenter::V1::ListMuteConfigsRequest.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_mute_configs({ 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_mute_configs(::Google::Cloud::SecurityCenter::V1::ListMuteConfigsRequest.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_mute_configs_client_stub.call_count + end + end + end + + def test_list_notification_configs + # Create test objects. + client_result = ::Google::Cloud::SecurityCenter::V1::ListNotificationConfigsResponse.new + http_response = OpenStruct.new body: client_result.to_json + + call_options = {} + + # Create request parameters for a unary method. + parent = "hello world" + page_token = "hello world" + page_size = 42 + + list_notification_configs_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| + assert options.metadata.key? :"x-goog-api-client" + assert options.metadata[:"x-goog-api-client"].include? "rest" + refute options.metadata[:"x-goog-api-client"].include? "grpc" + end + + ::Google::Cloud::SecurityCenter::V1::SecurityCenter::Rest::ServiceStub.stub :transcode_list_notification_configs_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, list_notification_configs_client_stub do + # Create client + client = ::Google::Cloud::SecurityCenter::V1::SecurityCenter::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.list_notification_configs({ parent: parent, page_token: page_token, page_size: page_size }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.list_notification_configs parent: parent, page_token: page_token, page_size: page_size do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.list_notification_configs ::Google::Cloud::SecurityCenter::V1::ListNotificationConfigsRequest.new(parent: parent, page_token: page_token, page_size: page_size) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + client.list_notification_configs({ parent: parent, page_token: page_token, page_size: page_size }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + client.list_notification_configs(::Google::Cloud::SecurityCenter::V1::ListNotificationConfigsRequest.new(parent: parent, page_token: page_token, page_size: page_size), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, list_notification_configs_client_stub.call_count + end + end + end + + def test_list_effective_security_health_analytics_custom_modules + # Create test objects. + client_result = ::Google::Cloud::SecurityCenter::V1::ListEffectiveSecurityHealthAnalyticsCustomModulesResponse.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_effective_security_health_analytics_custom_modules_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| + assert options.metadata.key? :"x-goog-api-client" + assert options.metadata[:"x-goog-api-client"].include? "rest" + refute options.metadata[:"x-goog-api-client"].include? "grpc" + end + + ::Google::Cloud::SecurityCenter::V1::SecurityCenter::Rest::ServiceStub.stub :transcode_list_effective_security_health_analytics_custom_modules_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, list_effective_security_health_analytics_custom_modules_client_stub do + # Create client + client = ::Google::Cloud::SecurityCenter::V1::SecurityCenter::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.list_effective_security_health_analytics_custom_modules({ 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_effective_security_health_analytics_custom_modules 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_effective_security_health_analytics_custom_modules ::Google::Cloud::SecurityCenter::V1::ListEffectiveSecurityHealthAnalyticsCustomModulesRequest.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_effective_security_health_analytics_custom_modules({ 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_effective_security_health_analytics_custom_modules(::Google::Cloud::SecurityCenter::V1::ListEffectiveSecurityHealthAnalyticsCustomModulesRequest.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_effective_security_health_analytics_custom_modules_client_stub.call_count + end + end + end + + def test_list_security_health_analytics_custom_modules + # Create test objects. + client_result = ::Google::Cloud::SecurityCenter::V1::ListSecurityHealthAnalyticsCustomModulesResponse.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_security_health_analytics_custom_modules_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| + assert options.metadata.key? :"x-goog-api-client" + assert options.metadata[:"x-goog-api-client"].include? "rest" + refute options.metadata[:"x-goog-api-client"].include? "grpc" + end + + ::Google::Cloud::SecurityCenter::V1::SecurityCenter::Rest::ServiceStub.stub :transcode_list_security_health_analytics_custom_modules_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, list_security_health_analytics_custom_modules_client_stub do + # Create client + client = ::Google::Cloud::SecurityCenter::V1::SecurityCenter::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.list_security_health_analytics_custom_modules({ 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_security_health_analytics_custom_modules 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_security_health_analytics_custom_modules ::Google::Cloud::SecurityCenter::V1::ListSecurityHealthAnalyticsCustomModulesRequest.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_security_health_analytics_custom_modules({ 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_security_health_analytics_custom_modules(::Google::Cloud::SecurityCenter::V1::ListSecurityHealthAnalyticsCustomModulesRequest.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_security_health_analytics_custom_modules_client_stub.call_count + end + end + end + + def test_list_sources + # Create test objects. + client_result = ::Google::Cloud::SecurityCenter::V1::ListSourcesResponse.new + http_response = OpenStruct.new body: client_result.to_json + + call_options = {} + + # Create request parameters for a unary method. + parent = "hello world" + page_token = "hello world" + page_size = 42 + + list_sources_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| + assert options.metadata.key? :"x-goog-api-client" + assert options.metadata[:"x-goog-api-client"].include? "rest" + refute options.metadata[:"x-goog-api-client"].include? "grpc" + end + + ::Google::Cloud::SecurityCenter::V1::SecurityCenter::Rest::ServiceStub.stub :transcode_list_sources_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, list_sources_client_stub do + # Create client + client = ::Google::Cloud::SecurityCenter::V1::SecurityCenter::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.list_sources({ parent: parent, page_token: page_token, page_size: page_size }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.list_sources parent: parent, page_token: page_token, page_size: page_size do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.list_sources ::Google::Cloud::SecurityCenter::V1::ListSourcesRequest.new(parent: parent, page_token: page_token, page_size: page_size) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + client.list_sources({ parent: parent, page_token: page_token, page_size: page_size }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + client.list_sources(::Google::Cloud::SecurityCenter::V1::ListSourcesRequest.new(parent: parent, page_token: page_token, page_size: page_size), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, list_sources_client_stub.call_count + end + end + end + + def test_run_asset_discovery + # 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" + + run_asset_discovery_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| + assert options.metadata.key? :"x-goog-api-client" + assert options.metadata[:"x-goog-api-client"].include? "rest" + refute options.metadata[:"x-goog-api-client"].include? "grpc" + end + + ::Google::Cloud::SecurityCenter::V1::SecurityCenter::Rest::ServiceStub.stub :transcode_run_asset_discovery_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, run_asset_discovery_client_stub do + # Create client + client = ::Google::Cloud::SecurityCenter::V1::SecurityCenter::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.run_asset_discovery({ parent: parent }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.run_asset_discovery parent: parent do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.run_asset_discovery ::Google::Cloud::SecurityCenter::V1::RunAssetDiscoveryRequest.new(parent: parent) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + client.run_asset_discovery({ parent: parent }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + client.run_asset_discovery(::Google::Cloud::SecurityCenter::V1::RunAssetDiscoveryRequest.new(parent: parent), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, run_asset_discovery_client_stub.call_count + end + end + end + + def test_set_finding_state + # Create test objects. + client_result = ::Google::Cloud::SecurityCenter::V1::Finding.new + http_response = OpenStruct.new body: client_result.to_json + + call_options = {} + + # Create request parameters for a unary method. + name = "hello world" + state = :STATE_UNSPECIFIED + start_time = {} + + set_finding_state_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| + assert options.metadata.key? :"x-goog-api-client" + assert options.metadata[:"x-goog-api-client"].include? "rest" + refute options.metadata[:"x-goog-api-client"].include? "grpc" + end + + ::Google::Cloud::SecurityCenter::V1::SecurityCenter::Rest::ServiceStub.stub :transcode_set_finding_state_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, set_finding_state_client_stub do + # Create client + client = ::Google::Cloud::SecurityCenter::V1::SecurityCenter::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.set_finding_state({ name: name, state: state, start_time: start_time }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.set_finding_state name: name, state: state, start_time: start_time do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.set_finding_state ::Google::Cloud::SecurityCenter::V1::SetFindingStateRequest.new(name: name, state: state, start_time: start_time) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + client.set_finding_state({ name: name, state: state, start_time: start_time }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + client.set_finding_state(::Google::Cloud::SecurityCenter::V1::SetFindingStateRequest.new(name: name, state: state, start_time: start_time), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, set_finding_state_client_stub.call_count + end + end + end + + def test_set_mute + # Create test objects. + client_result = ::Google::Cloud::SecurityCenter::V1::Finding.new + http_response = OpenStruct.new body: client_result.to_json + + call_options = {} + + # Create request parameters for a unary method. + name = "hello world" + mute = :MUTE_UNSPECIFIED + + set_mute_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| + assert options.metadata.key? :"x-goog-api-client" + assert options.metadata[:"x-goog-api-client"].include? "rest" + refute options.metadata[:"x-goog-api-client"].include? "grpc" + end + + ::Google::Cloud::SecurityCenter::V1::SecurityCenter::Rest::ServiceStub.stub :transcode_set_mute_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, set_mute_client_stub do + # Create client + client = ::Google::Cloud::SecurityCenter::V1::SecurityCenter::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.set_mute({ name: name, mute: mute }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.set_mute name: name, mute: mute do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.set_mute ::Google::Cloud::SecurityCenter::V1::SetMuteRequest.new(name: name, mute: mute) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + client.set_mute({ name: name, mute: mute }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + client.set_mute(::Google::Cloud::SecurityCenter::V1::SetMuteRequest.new(name: name, mute: mute), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, set_mute_client_stub.call_count + end + end + end + + def test_set_iam_policy + # Create test objects. + client_result = ::Google::Iam::V1::Policy.new + http_response = OpenStruct.new body: client_result.to_json + + call_options = {} + + # Create request parameters for a unary method. + resource = "hello world" + policy = {} + update_mask = {} + + set_iam_policy_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| + assert options.metadata.key? :"x-goog-api-client" + assert options.metadata[:"x-goog-api-client"].include? "rest" + refute options.metadata[:"x-goog-api-client"].include? "grpc" + end + + ::Google::Cloud::SecurityCenter::V1::SecurityCenter::Rest::ServiceStub.stub :transcode_set_iam_policy_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, set_iam_policy_client_stub do + # Create client + client = ::Google::Cloud::SecurityCenter::V1::SecurityCenter::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.set_iam_policy({ resource: resource, policy: policy, update_mask: update_mask }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.set_iam_policy resource: resource, policy: policy, update_mask: update_mask do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.set_iam_policy ::Google::Iam::V1::SetIamPolicyRequest.new(resource: resource, policy: policy, update_mask: update_mask) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + client.set_iam_policy({ resource: resource, policy: policy, update_mask: update_mask }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + client.set_iam_policy(::Google::Iam::V1::SetIamPolicyRequest.new(resource: resource, policy: policy, update_mask: update_mask), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, set_iam_policy_client_stub.call_count + end + end + end + + def test_test_iam_permissions + # Create test objects. + client_result = ::Google::Iam::V1::TestIamPermissionsResponse.new + http_response = OpenStruct.new body: client_result.to_json + + call_options = {} + + # Create request parameters for a unary method. + resource = "hello world" + permissions = ["hello world"] + + test_iam_permissions_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| + assert options.metadata.key? :"x-goog-api-client" + assert options.metadata[:"x-goog-api-client"].include? "rest" + refute options.metadata[:"x-goog-api-client"].include? "grpc" + end + + ::Google::Cloud::SecurityCenter::V1::SecurityCenter::Rest::ServiceStub.stub :transcode_test_iam_permissions_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, test_iam_permissions_client_stub do + # Create client + client = ::Google::Cloud::SecurityCenter::V1::SecurityCenter::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.test_iam_permissions({ resource: resource, permissions: permissions }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.test_iam_permissions resource: resource, permissions: permissions do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.test_iam_permissions ::Google::Iam::V1::TestIamPermissionsRequest.new(resource: resource, permissions: permissions) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + client.test_iam_permissions({ resource: resource, permissions: permissions }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + client.test_iam_permissions(::Google::Iam::V1::TestIamPermissionsRequest.new(resource: resource, permissions: permissions), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, test_iam_permissions_client_stub.call_count + end + end + end + + def test_simulate_security_health_analytics_custom_module + # Create test objects. + client_result = ::Google::Cloud::SecurityCenter::V1::SimulateSecurityHealthAnalyticsCustomModuleResponse.new + http_response = OpenStruct.new body: client_result.to_json + + call_options = {} + + # Create request parameters for a unary method. + parent = "hello world" + custom_config = {} + resource = {} + + simulate_security_health_analytics_custom_module_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| + assert options.metadata.key? :"x-goog-api-client" + assert options.metadata[:"x-goog-api-client"].include? "rest" + refute options.metadata[:"x-goog-api-client"].include? "grpc" + end + + ::Google::Cloud::SecurityCenter::V1::SecurityCenter::Rest::ServiceStub.stub :transcode_simulate_security_health_analytics_custom_module_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, simulate_security_health_analytics_custom_module_client_stub do + # Create client + client = ::Google::Cloud::SecurityCenter::V1::SecurityCenter::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.simulate_security_health_analytics_custom_module({ parent: parent, custom_config: custom_config, resource: resource }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.simulate_security_health_analytics_custom_module parent: parent, custom_config: custom_config, resource: resource do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.simulate_security_health_analytics_custom_module ::Google::Cloud::SecurityCenter::V1::SimulateSecurityHealthAnalyticsCustomModuleRequest.new(parent: parent, custom_config: custom_config, resource: resource) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + client.simulate_security_health_analytics_custom_module({ parent: parent, custom_config: custom_config, resource: resource }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + client.simulate_security_health_analytics_custom_module(::Google::Cloud::SecurityCenter::V1::SimulateSecurityHealthAnalyticsCustomModuleRequest.new(parent: parent, custom_config: custom_config, resource: resource), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, simulate_security_health_analytics_custom_module_client_stub.call_count + end + end + end + + def test_update_external_system + # Create test objects. + client_result = ::Google::Cloud::SecurityCenter::V1::ExternalSystem.new + http_response = OpenStruct.new body: client_result.to_json + + call_options = {} + + # Create request parameters for a unary method. + external_system = {} + update_mask = {} + + update_external_system_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| + assert options.metadata.key? :"x-goog-api-client" + assert options.metadata[:"x-goog-api-client"].include? "rest" + refute options.metadata[:"x-goog-api-client"].include? "grpc" + end + + ::Google::Cloud::SecurityCenter::V1::SecurityCenter::Rest::ServiceStub.stub :transcode_update_external_system_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, update_external_system_client_stub do + # Create client + client = ::Google::Cloud::SecurityCenter::V1::SecurityCenter::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.update_external_system({ external_system: external_system, update_mask: update_mask }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.update_external_system external_system: external_system, update_mask: update_mask do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.update_external_system ::Google::Cloud::SecurityCenter::V1::UpdateExternalSystemRequest.new(external_system: external_system, update_mask: update_mask) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + client.update_external_system({ external_system: external_system, update_mask: update_mask }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + client.update_external_system(::Google::Cloud::SecurityCenter::V1::UpdateExternalSystemRequest.new(external_system: external_system, update_mask: update_mask), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, update_external_system_client_stub.call_count + end + end + end + + def test_update_finding + # Create test objects. + client_result = ::Google::Cloud::SecurityCenter::V1::Finding.new + http_response = OpenStruct.new body: client_result.to_json + + call_options = {} + + # Create request parameters for a unary method. + finding = {} + update_mask = {} + + update_finding_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| + assert options.metadata.key? :"x-goog-api-client" + assert options.metadata[:"x-goog-api-client"].include? "rest" + refute options.metadata[:"x-goog-api-client"].include? "grpc" + end + + ::Google::Cloud::SecurityCenter::V1::SecurityCenter::Rest::ServiceStub.stub :transcode_update_finding_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, update_finding_client_stub do + # Create client + client = ::Google::Cloud::SecurityCenter::V1::SecurityCenter::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.update_finding({ finding: finding, update_mask: update_mask }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.update_finding finding: finding, update_mask: update_mask do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.update_finding ::Google::Cloud::SecurityCenter::V1::UpdateFindingRequest.new(finding: finding, update_mask: update_mask) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + client.update_finding({ finding: finding, update_mask: update_mask }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + client.update_finding(::Google::Cloud::SecurityCenter::V1::UpdateFindingRequest.new(finding: finding, update_mask: update_mask), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, update_finding_client_stub.call_count + end + end + end + + def test_update_mute_config + # Create test objects. + client_result = ::Google::Cloud::SecurityCenter::V1::MuteConfig.new + http_response = OpenStruct.new body: client_result.to_json + + call_options = {} + + # Create request parameters for a unary method. + mute_config = {} + update_mask = {} + + update_mute_config_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| + assert options.metadata.key? :"x-goog-api-client" + assert options.metadata[:"x-goog-api-client"].include? "rest" + refute options.metadata[:"x-goog-api-client"].include? "grpc" + end + + ::Google::Cloud::SecurityCenter::V1::SecurityCenter::Rest::ServiceStub.stub :transcode_update_mute_config_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, update_mute_config_client_stub do + # Create client + client = ::Google::Cloud::SecurityCenter::V1::SecurityCenter::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.update_mute_config({ mute_config: mute_config, update_mask: update_mask }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.update_mute_config mute_config: mute_config, update_mask: update_mask do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.update_mute_config ::Google::Cloud::SecurityCenter::V1::UpdateMuteConfigRequest.new(mute_config: mute_config, update_mask: update_mask) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + client.update_mute_config({ mute_config: mute_config, update_mask: update_mask }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + client.update_mute_config(::Google::Cloud::SecurityCenter::V1::UpdateMuteConfigRequest.new(mute_config: mute_config, update_mask: update_mask), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, update_mute_config_client_stub.call_count + end + end + end + + def test_update_notification_config + # Create test objects. + client_result = ::Google::Cloud::SecurityCenter::V1::NotificationConfig.new + http_response = OpenStruct.new body: client_result.to_json + + call_options = {} + + # Create request parameters for a unary method. + notification_config = {} + update_mask = {} + + update_notification_config_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| + assert options.metadata.key? :"x-goog-api-client" + assert options.metadata[:"x-goog-api-client"].include? "rest" + refute options.metadata[:"x-goog-api-client"].include? "grpc" + end + + ::Google::Cloud::SecurityCenter::V1::SecurityCenter::Rest::ServiceStub.stub :transcode_update_notification_config_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, update_notification_config_client_stub do + # Create client + client = ::Google::Cloud::SecurityCenter::V1::SecurityCenter::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.update_notification_config({ notification_config: notification_config, update_mask: update_mask }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.update_notification_config notification_config: notification_config, update_mask: update_mask do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.update_notification_config ::Google::Cloud::SecurityCenter::V1::UpdateNotificationConfigRequest.new(notification_config: notification_config, update_mask: update_mask) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + client.update_notification_config({ notification_config: notification_config, update_mask: update_mask }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + client.update_notification_config(::Google::Cloud::SecurityCenter::V1::UpdateNotificationConfigRequest.new(notification_config: notification_config, update_mask: update_mask), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, update_notification_config_client_stub.call_count + end + end + end + + def test_update_organization_settings + # Create test objects. + client_result = ::Google::Cloud::SecurityCenter::V1::OrganizationSettings.new + http_response = OpenStruct.new body: client_result.to_json + + call_options = {} + + # Create request parameters for a unary method. + organization_settings = {} + update_mask = {} + + update_organization_settings_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| + assert options.metadata.key? :"x-goog-api-client" + assert options.metadata[:"x-goog-api-client"].include? "rest" + refute options.metadata[:"x-goog-api-client"].include? "grpc" + end + + ::Google::Cloud::SecurityCenter::V1::SecurityCenter::Rest::ServiceStub.stub :transcode_update_organization_settings_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, update_organization_settings_client_stub do + # Create client + client = ::Google::Cloud::SecurityCenter::V1::SecurityCenter::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.update_organization_settings({ organization_settings: organization_settings, update_mask: update_mask }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.update_organization_settings organization_settings: organization_settings, update_mask: update_mask do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.update_organization_settings ::Google::Cloud::SecurityCenter::V1::UpdateOrganizationSettingsRequest.new(organization_settings: organization_settings, update_mask: update_mask) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + client.update_organization_settings({ organization_settings: organization_settings, update_mask: update_mask }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + client.update_organization_settings(::Google::Cloud::SecurityCenter::V1::UpdateOrganizationSettingsRequest.new(organization_settings: organization_settings, update_mask: update_mask), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, update_organization_settings_client_stub.call_count + end + end + end + + def test_update_security_health_analytics_custom_module + # Create test objects. + client_result = ::Google::Cloud::SecurityCenter::V1::SecurityHealthAnalyticsCustomModule.new + http_response = OpenStruct.new body: client_result.to_json + + call_options = {} + + # Create request parameters for a unary method. + security_health_analytics_custom_module = {} + update_mask = {} + + update_security_health_analytics_custom_module_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| + assert options.metadata.key? :"x-goog-api-client" + assert options.metadata[:"x-goog-api-client"].include? "rest" + refute options.metadata[:"x-goog-api-client"].include? "grpc" + end + + ::Google::Cloud::SecurityCenter::V1::SecurityCenter::Rest::ServiceStub.stub :transcode_update_security_health_analytics_custom_module_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, update_security_health_analytics_custom_module_client_stub do + # Create client + client = ::Google::Cloud::SecurityCenter::V1::SecurityCenter::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.update_security_health_analytics_custom_module({ security_health_analytics_custom_module: security_health_analytics_custom_module, update_mask: update_mask }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.update_security_health_analytics_custom_module security_health_analytics_custom_module: security_health_analytics_custom_module, update_mask: update_mask do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.update_security_health_analytics_custom_module ::Google::Cloud::SecurityCenter::V1::UpdateSecurityHealthAnalyticsCustomModuleRequest.new(security_health_analytics_custom_module: security_health_analytics_custom_module, update_mask: update_mask) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + client.update_security_health_analytics_custom_module({ security_health_analytics_custom_module: security_health_analytics_custom_module, update_mask: update_mask }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + client.update_security_health_analytics_custom_module(::Google::Cloud::SecurityCenter::V1::UpdateSecurityHealthAnalyticsCustomModuleRequest.new(security_health_analytics_custom_module: security_health_analytics_custom_module, update_mask: update_mask), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, update_security_health_analytics_custom_module_client_stub.call_count + end + end + end + + def test_update_source + # Create test objects. + client_result = ::Google::Cloud::SecurityCenter::V1::Source.new + http_response = OpenStruct.new body: client_result.to_json + + call_options = {} + + # Create request parameters for a unary method. + source = {} + update_mask = {} + + update_source_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| + assert options.metadata.key? :"x-goog-api-client" + assert options.metadata[:"x-goog-api-client"].include? "rest" + refute options.metadata[:"x-goog-api-client"].include? "grpc" + end + + ::Google::Cloud::SecurityCenter::V1::SecurityCenter::Rest::ServiceStub.stub :transcode_update_source_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, update_source_client_stub do + # Create client + client = ::Google::Cloud::SecurityCenter::V1::SecurityCenter::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.update_source({ source: source, update_mask: update_mask }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.update_source source: source, update_mask: update_mask do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.update_source ::Google::Cloud::SecurityCenter::V1::UpdateSourceRequest.new(source: source, update_mask: update_mask) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + client.update_source({ source: source, update_mask: update_mask }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + client.update_source(::Google::Cloud::SecurityCenter::V1::UpdateSourceRequest.new(source: source, update_mask: update_mask), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, update_source_client_stub.call_count + end + end + end + + def test_update_security_marks + # Create test objects. + client_result = ::Google::Cloud::SecurityCenter::V1::SecurityMarks.new + http_response = OpenStruct.new body: client_result.to_json + + call_options = {} + + # Create request parameters for a unary method. + security_marks = {} + update_mask = {} + start_time = {} + + update_security_marks_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| + assert options.metadata.key? :"x-goog-api-client" + assert options.metadata[:"x-goog-api-client"].include? "rest" + refute options.metadata[:"x-goog-api-client"].include? "grpc" + end + + ::Google::Cloud::SecurityCenter::V1::SecurityCenter::Rest::ServiceStub.stub :transcode_update_security_marks_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, update_security_marks_client_stub do + # Create client + client = ::Google::Cloud::SecurityCenter::V1::SecurityCenter::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.update_security_marks({ security_marks: security_marks, update_mask: update_mask, start_time: start_time }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.update_security_marks security_marks: security_marks, update_mask: update_mask, start_time: start_time do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.update_security_marks ::Google::Cloud::SecurityCenter::V1::UpdateSecurityMarksRequest.new(security_marks: security_marks, update_mask: update_mask, start_time: start_time) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + client.update_security_marks({ security_marks: security_marks, update_mask: update_mask, start_time: start_time }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + client.update_security_marks(::Google::Cloud::SecurityCenter::V1::UpdateSecurityMarksRequest.new(security_marks: security_marks, update_mask: update_mask, start_time: start_time), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, update_security_marks_client_stub.call_count + end + end + end + + def test_create_big_query_export + # Create test objects. + client_result = ::Google::Cloud::SecurityCenter::V1::BigQueryExport.new + http_response = OpenStruct.new body: client_result.to_json + + call_options = {} + + # Create request parameters for a unary method. + parent = "hello world" + big_query_export = {} + big_query_export_id = "hello world" + + create_big_query_export_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| + assert options.metadata.key? :"x-goog-api-client" + assert options.metadata[:"x-goog-api-client"].include? "rest" + refute options.metadata[:"x-goog-api-client"].include? "grpc" + end + + ::Google::Cloud::SecurityCenter::V1::SecurityCenter::Rest::ServiceStub.stub :transcode_create_big_query_export_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, create_big_query_export_client_stub do + # Create client + client = ::Google::Cloud::SecurityCenter::V1::SecurityCenter::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.create_big_query_export({ parent: parent, big_query_export: big_query_export, big_query_export_id: big_query_export_id }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.create_big_query_export parent: parent, big_query_export: big_query_export, big_query_export_id: big_query_export_id do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.create_big_query_export ::Google::Cloud::SecurityCenter::V1::CreateBigQueryExportRequest.new(parent: parent, big_query_export: big_query_export, big_query_export_id: big_query_export_id) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + client.create_big_query_export({ parent: parent, big_query_export: big_query_export, big_query_export_id: big_query_export_id }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + client.create_big_query_export(::Google::Cloud::SecurityCenter::V1::CreateBigQueryExportRequest.new(parent: parent, big_query_export: big_query_export, big_query_export_id: big_query_export_id), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, create_big_query_export_client_stub.call_count + end + end + end + + def test_delete_big_query_export + # Create test objects. + client_result = ::Google::Protobuf::Empty.new + http_response = OpenStruct.new body: client_result.to_json + + call_options = {} + + # Create request parameters for a unary method. + name = "hello world" + + delete_big_query_export_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| + assert options.metadata.key? :"x-goog-api-client" + assert options.metadata[:"x-goog-api-client"].include? "rest" + refute options.metadata[:"x-goog-api-client"].include? "grpc" + end + + ::Google::Cloud::SecurityCenter::V1::SecurityCenter::Rest::ServiceStub.stub :transcode_delete_big_query_export_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, delete_big_query_export_client_stub do + # Create client + client = ::Google::Cloud::SecurityCenter::V1::SecurityCenter::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.delete_big_query_export({ name: name }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.delete_big_query_export name: name do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.delete_big_query_export ::Google::Cloud::SecurityCenter::V1::DeleteBigQueryExportRequest.new(name: name) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + client.delete_big_query_export({ name: name }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + client.delete_big_query_export(::Google::Cloud::SecurityCenter::V1::DeleteBigQueryExportRequest.new(name: name), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, delete_big_query_export_client_stub.call_count + end + end + end + + def test_update_big_query_export + # Create test objects. + client_result = ::Google::Cloud::SecurityCenter::V1::BigQueryExport.new + http_response = OpenStruct.new body: client_result.to_json + + call_options = {} + + # Create request parameters for a unary method. + big_query_export = {} + update_mask = {} + + update_big_query_export_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| + assert options.metadata.key? :"x-goog-api-client" + assert options.metadata[:"x-goog-api-client"].include? "rest" + refute options.metadata[:"x-goog-api-client"].include? "grpc" + end + + ::Google::Cloud::SecurityCenter::V1::SecurityCenter::Rest::ServiceStub.stub :transcode_update_big_query_export_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, update_big_query_export_client_stub do + # Create client + client = ::Google::Cloud::SecurityCenter::V1::SecurityCenter::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.update_big_query_export({ big_query_export: big_query_export, update_mask: update_mask }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.update_big_query_export big_query_export: big_query_export, update_mask: update_mask do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.update_big_query_export ::Google::Cloud::SecurityCenter::V1::UpdateBigQueryExportRequest.new(big_query_export: big_query_export, update_mask: update_mask) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + client.update_big_query_export({ big_query_export: big_query_export, update_mask: update_mask }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + client.update_big_query_export(::Google::Cloud::SecurityCenter::V1::UpdateBigQueryExportRequest.new(big_query_export: big_query_export, update_mask: update_mask), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, update_big_query_export_client_stub.call_count + end + end + end + + def test_list_big_query_exports + # Create test objects. + client_result = ::Google::Cloud::SecurityCenter::V1::ListBigQueryExportsResponse.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_big_query_exports_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| + assert options.metadata.key? :"x-goog-api-client" + assert options.metadata[:"x-goog-api-client"].include? "rest" + refute options.metadata[:"x-goog-api-client"].include? "grpc" + end + + ::Google::Cloud::SecurityCenter::V1::SecurityCenter::Rest::ServiceStub.stub :transcode_list_big_query_exports_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, list_big_query_exports_client_stub do + # Create client + client = ::Google::Cloud::SecurityCenter::V1::SecurityCenter::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.list_big_query_exports({ 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_big_query_exports 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_big_query_exports ::Google::Cloud::SecurityCenter::V1::ListBigQueryExportsRequest.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_big_query_exports({ 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_big_query_exports(::Google::Cloud::SecurityCenter::V1::ListBigQueryExportsRequest.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_big_query_exports_client_stub.call_count + end + end + end + + def test_create_event_threat_detection_custom_module + # Create test objects. + client_result = ::Google::Cloud::SecurityCenter::V1::EventThreatDetectionCustomModule.new + http_response = OpenStruct.new body: client_result.to_json + + call_options = {} + + # Create request parameters for a unary method. + parent = "hello world" + event_threat_detection_custom_module = {} + + create_event_threat_detection_custom_module_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| + assert options.metadata.key? :"x-goog-api-client" + assert options.metadata[:"x-goog-api-client"].include? "rest" + refute options.metadata[:"x-goog-api-client"].include? "grpc" + end + + ::Google::Cloud::SecurityCenter::V1::SecurityCenter::Rest::ServiceStub.stub :transcode_create_event_threat_detection_custom_module_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, create_event_threat_detection_custom_module_client_stub do + # Create client + client = ::Google::Cloud::SecurityCenter::V1::SecurityCenter::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.create_event_threat_detection_custom_module({ parent: parent, event_threat_detection_custom_module: event_threat_detection_custom_module }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.create_event_threat_detection_custom_module parent: parent, event_threat_detection_custom_module: event_threat_detection_custom_module do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.create_event_threat_detection_custom_module ::Google::Cloud::SecurityCenter::V1::CreateEventThreatDetectionCustomModuleRequest.new(parent: parent, event_threat_detection_custom_module: event_threat_detection_custom_module) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + client.create_event_threat_detection_custom_module({ parent: parent, event_threat_detection_custom_module: event_threat_detection_custom_module }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + client.create_event_threat_detection_custom_module(::Google::Cloud::SecurityCenter::V1::CreateEventThreatDetectionCustomModuleRequest.new(parent: parent, event_threat_detection_custom_module: event_threat_detection_custom_module), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, create_event_threat_detection_custom_module_client_stub.call_count + end + end + end + + def test_delete_event_threat_detection_custom_module + # Create test objects. + client_result = ::Google::Protobuf::Empty.new + http_response = OpenStruct.new body: client_result.to_json + + call_options = {} + + # Create request parameters for a unary method. + name = "hello world" + + delete_event_threat_detection_custom_module_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| + assert options.metadata.key? :"x-goog-api-client" + assert options.metadata[:"x-goog-api-client"].include? "rest" + refute options.metadata[:"x-goog-api-client"].include? "grpc" + end + + ::Google::Cloud::SecurityCenter::V1::SecurityCenter::Rest::ServiceStub.stub :transcode_delete_event_threat_detection_custom_module_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, delete_event_threat_detection_custom_module_client_stub do + # Create client + client = ::Google::Cloud::SecurityCenter::V1::SecurityCenter::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.delete_event_threat_detection_custom_module({ name: name }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.delete_event_threat_detection_custom_module name: name do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.delete_event_threat_detection_custom_module ::Google::Cloud::SecurityCenter::V1::DeleteEventThreatDetectionCustomModuleRequest.new(name: name) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + client.delete_event_threat_detection_custom_module({ name: name }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + client.delete_event_threat_detection_custom_module(::Google::Cloud::SecurityCenter::V1::DeleteEventThreatDetectionCustomModuleRequest.new(name: name), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, delete_event_threat_detection_custom_module_client_stub.call_count + end + end + end + + def test_get_event_threat_detection_custom_module + # Create test objects. + client_result = ::Google::Cloud::SecurityCenter::V1::EventThreatDetectionCustomModule.new + http_response = OpenStruct.new body: client_result.to_json + + call_options = {} + + # Create request parameters for a unary method. + name = "hello world" + + get_event_threat_detection_custom_module_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| + assert options.metadata.key? :"x-goog-api-client" + assert options.metadata[:"x-goog-api-client"].include? "rest" + refute options.metadata[:"x-goog-api-client"].include? "grpc" + end + + ::Google::Cloud::SecurityCenter::V1::SecurityCenter::Rest::ServiceStub.stub :transcode_get_event_threat_detection_custom_module_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, get_event_threat_detection_custom_module_client_stub do + # Create client + client = ::Google::Cloud::SecurityCenter::V1::SecurityCenter::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.get_event_threat_detection_custom_module({ name: name }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.get_event_threat_detection_custom_module name: name do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.get_event_threat_detection_custom_module ::Google::Cloud::SecurityCenter::V1::GetEventThreatDetectionCustomModuleRequest.new(name: name) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + client.get_event_threat_detection_custom_module({ name: name }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + client.get_event_threat_detection_custom_module(::Google::Cloud::SecurityCenter::V1::GetEventThreatDetectionCustomModuleRequest.new(name: name), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, get_event_threat_detection_custom_module_client_stub.call_count + end + end + end + + def test_list_descendant_event_threat_detection_custom_modules + # Create test objects. + client_result = ::Google::Cloud::SecurityCenter::V1::ListDescendantEventThreatDetectionCustomModulesResponse.new + http_response = OpenStruct.new body: client_result.to_json + + call_options = {} + + # Create request parameters for a unary method. + parent = "hello world" + page_token = "hello world" + page_size = 42 + + list_descendant_event_threat_detection_custom_modules_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| + assert options.metadata.key? :"x-goog-api-client" + assert options.metadata[:"x-goog-api-client"].include? "rest" + refute options.metadata[:"x-goog-api-client"].include? "grpc" + end + + ::Google::Cloud::SecurityCenter::V1::SecurityCenter::Rest::ServiceStub.stub :transcode_list_descendant_event_threat_detection_custom_modules_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, list_descendant_event_threat_detection_custom_modules_client_stub do + # Create client + client = ::Google::Cloud::SecurityCenter::V1::SecurityCenter::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.list_descendant_event_threat_detection_custom_modules({ parent: parent, page_token: page_token, page_size: page_size }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.list_descendant_event_threat_detection_custom_modules parent: parent, page_token: page_token, page_size: page_size do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.list_descendant_event_threat_detection_custom_modules ::Google::Cloud::SecurityCenter::V1::ListDescendantEventThreatDetectionCustomModulesRequest.new(parent: parent, page_token: page_token, page_size: page_size) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + client.list_descendant_event_threat_detection_custom_modules({ parent: parent, page_token: page_token, page_size: page_size }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + client.list_descendant_event_threat_detection_custom_modules(::Google::Cloud::SecurityCenter::V1::ListDescendantEventThreatDetectionCustomModulesRequest.new(parent: parent, page_token: page_token, page_size: page_size), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, list_descendant_event_threat_detection_custom_modules_client_stub.call_count + end + end + end + + def test_list_event_threat_detection_custom_modules + # Create test objects. + client_result = ::Google::Cloud::SecurityCenter::V1::ListEventThreatDetectionCustomModulesResponse.new + http_response = OpenStruct.new body: client_result.to_json + + call_options = {} + + # Create request parameters for a unary method. + parent = "hello world" + page_token = "hello world" + page_size = 42 + + list_event_threat_detection_custom_modules_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| + assert options.metadata.key? :"x-goog-api-client" + assert options.metadata[:"x-goog-api-client"].include? "rest" + refute options.metadata[:"x-goog-api-client"].include? "grpc" + end + + ::Google::Cloud::SecurityCenter::V1::SecurityCenter::Rest::ServiceStub.stub :transcode_list_event_threat_detection_custom_modules_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, list_event_threat_detection_custom_modules_client_stub do + # Create client + client = ::Google::Cloud::SecurityCenter::V1::SecurityCenter::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.list_event_threat_detection_custom_modules({ parent: parent, page_token: page_token, page_size: page_size }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.list_event_threat_detection_custom_modules parent: parent, page_token: page_token, page_size: page_size do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.list_event_threat_detection_custom_modules ::Google::Cloud::SecurityCenter::V1::ListEventThreatDetectionCustomModulesRequest.new(parent: parent, page_token: page_token, page_size: page_size) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + client.list_event_threat_detection_custom_modules({ parent: parent, page_token: page_token, page_size: page_size }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + client.list_event_threat_detection_custom_modules(::Google::Cloud::SecurityCenter::V1::ListEventThreatDetectionCustomModulesRequest.new(parent: parent, page_token: page_token, page_size: page_size), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, list_event_threat_detection_custom_modules_client_stub.call_count + end + end + end + + def test_update_event_threat_detection_custom_module + # Create test objects. + client_result = ::Google::Cloud::SecurityCenter::V1::EventThreatDetectionCustomModule.new + http_response = OpenStruct.new body: client_result.to_json + + call_options = {} + + # Create request parameters for a unary method. + event_threat_detection_custom_module = {} + update_mask = {} + + update_event_threat_detection_custom_module_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| + assert options.metadata.key? :"x-goog-api-client" + assert options.metadata[:"x-goog-api-client"].include? "rest" + refute options.metadata[:"x-goog-api-client"].include? "grpc" + end + + ::Google::Cloud::SecurityCenter::V1::SecurityCenter::Rest::ServiceStub.stub :transcode_update_event_threat_detection_custom_module_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, update_event_threat_detection_custom_module_client_stub do + # Create client + client = ::Google::Cloud::SecurityCenter::V1::SecurityCenter::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.update_event_threat_detection_custom_module({ event_threat_detection_custom_module: event_threat_detection_custom_module, update_mask: update_mask }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.update_event_threat_detection_custom_module event_threat_detection_custom_module: event_threat_detection_custom_module, update_mask: update_mask do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.update_event_threat_detection_custom_module ::Google::Cloud::SecurityCenter::V1::UpdateEventThreatDetectionCustomModuleRequest.new(event_threat_detection_custom_module: event_threat_detection_custom_module, update_mask: update_mask) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + client.update_event_threat_detection_custom_module({ event_threat_detection_custom_module: event_threat_detection_custom_module, update_mask: update_mask }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + client.update_event_threat_detection_custom_module(::Google::Cloud::SecurityCenter::V1::UpdateEventThreatDetectionCustomModuleRequest.new(event_threat_detection_custom_module: event_threat_detection_custom_module, update_mask: update_mask), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, update_event_threat_detection_custom_module_client_stub.call_count + end + end + end + + def test_validate_event_threat_detection_custom_module + # Create test objects. + client_result = ::Google::Cloud::SecurityCenter::V1::ValidateEventThreatDetectionCustomModuleResponse.new + http_response = OpenStruct.new body: client_result.to_json + + call_options = {} + + # Create request parameters for a unary method. + parent = "hello world" + raw_text = "hello world" + type = "hello world" + + validate_event_threat_detection_custom_module_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| + assert options.metadata.key? :"x-goog-api-client" + assert options.metadata[:"x-goog-api-client"].include? "rest" + refute options.metadata[:"x-goog-api-client"].include? "grpc" + end + + ::Google::Cloud::SecurityCenter::V1::SecurityCenter::Rest::ServiceStub.stub :transcode_validate_event_threat_detection_custom_module_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, validate_event_threat_detection_custom_module_client_stub do + # Create client + client = ::Google::Cloud::SecurityCenter::V1::SecurityCenter::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.validate_event_threat_detection_custom_module({ parent: parent, raw_text: raw_text, type: type }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.validate_event_threat_detection_custom_module parent: parent, raw_text: raw_text, type: type do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.validate_event_threat_detection_custom_module ::Google::Cloud::SecurityCenter::V1::ValidateEventThreatDetectionCustomModuleRequest.new(parent: parent, raw_text: raw_text, type: type) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + client.validate_event_threat_detection_custom_module({ parent: parent, raw_text: raw_text, type: type }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + client.validate_event_threat_detection_custom_module(::Google::Cloud::SecurityCenter::V1::ValidateEventThreatDetectionCustomModuleRequest.new(parent: parent, raw_text: raw_text, type: type), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, validate_event_threat_detection_custom_module_client_stub.call_count + end + end + end + + def test_get_effective_event_threat_detection_custom_module + # Create test objects. + client_result = ::Google::Cloud::SecurityCenter::V1::EffectiveEventThreatDetectionCustomModule.new + http_response = OpenStruct.new body: client_result.to_json + + call_options = {} + + # Create request parameters for a unary method. + name = "hello world" + + get_effective_event_threat_detection_custom_module_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| + assert options.metadata.key? :"x-goog-api-client" + assert options.metadata[:"x-goog-api-client"].include? "rest" + refute options.metadata[:"x-goog-api-client"].include? "grpc" + end + + ::Google::Cloud::SecurityCenter::V1::SecurityCenter::Rest::ServiceStub.stub :transcode_get_effective_event_threat_detection_custom_module_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, get_effective_event_threat_detection_custom_module_client_stub do + # Create client + client = ::Google::Cloud::SecurityCenter::V1::SecurityCenter::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.get_effective_event_threat_detection_custom_module({ name: name }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.get_effective_event_threat_detection_custom_module name: name do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.get_effective_event_threat_detection_custom_module ::Google::Cloud::SecurityCenter::V1::GetEffectiveEventThreatDetectionCustomModuleRequest.new(name: name) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + client.get_effective_event_threat_detection_custom_module({ name: name }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + client.get_effective_event_threat_detection_custom_module(::Google::Cloud::SecurityCenter::V1::GetEffectiveEventThreatDetectionCustomModuleRequest.new(name: name), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, get_effective_event_threat_detection_custom_module_client_stub.call_count + end + end + end + + def test_list_effective_event_threat_detection_custom_modules + # Create test objects. + client_result = ::Google::Cloud::SecurityCenter::V1::ListEffectiveEventThreatDetectionCustomModulesResponse.new + http_response = OpenStruct.new body: client_result.to_json + + call_options = {} + + # Create request parameters for a unary method. + parent = "hello world" + page_token = "hello world" + page_size = 42 + + list_effective_event_threat_detection_custom_modules_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| + assert options.metadata.key? :"x-goog-api-client" + assert options.metadata[:"x-goog-api-client"].include? "rest" + refute options.metadata[:"x-goog-api-client"].include? "grpc" + end + + ::Google::Cloud::SecurityCenter::V1::SecurityCenter::Rest::ServiceStub.stub :transcode_list_effective_event_threat_detection_custom_modules_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, list_effective_event_threat_detection_custom_modules_client_stub do + # Create client + client = ::Google::Cloud::SecurityCenter::V1::SecurityCenter::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.list_effective_event_threat_detection_custom_modules({ parent: parent, page_token: page_token, page_size: page_size }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.list_effective_event_threat_detection_custom_modules parent: parent, page_token: page_token, page_size: page_size do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.list_effective_event_threat_detection_custom_modules ::Google::Cloud::SecurityCenter::V1::ListEffectiveEventThreatDetectionCustomModulesRequest.new(parent: parent, page_token: page_token, page_size: page_size) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + client.list_effective_event_threat_detection_custom_modules({ parent: parent, page_token: page_token, page_size: page_size }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + client.list_effective_event_threat_detection_custom_modules(::Google::Cloud::SecurityCenter::V1::ListEffectiveEventThreatDetectionCustomModulesRequest.new(parent: parent, page_token: page_token, page_size: page_size), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, list_effective_event_threat_detection_custom_modules_client_stub.call_count + end + end + end + + def test_batch_create_resource_value_configs + # Create test objects. + client_result = ::Google::Cloud::SecurityCenter::V1::BatchCreateResourceValueConfigsResponse.new + http_response = OpenStruct.new body: client_result.to_json + + call_options = {} + + # Create request parameters for a unary method. + parent = "hello world" + requests = [{}] + + batch_create_resource_value_configs_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| + assert options.metadata.key? :"x-goog-api-client" + assert options.metadata[:"x-goog-api-client"].include? "rest" + refute options.metadata[:"x-goog-api-client"].include? "grpc" + end + + ::Google::Cloud::SecurityCenter::V1::SecurityCenter::Rest::ServiceStub.stub :transcode_batch_create_resource_value_configs_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, batch_create_resource_value_configs_client_stub do + # Create client + client = ::Google::Cloud::SecurityCenter::V1::SecurityCenter::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.batch_create_resource_value_configs({ parent: parent, requests: requests }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.batch_create_resource_value_configs parent: parent, requests: requests do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.batch_create_resource_value_configs ::Google::Cloud::SecurityCenter::V1::BatchCreateResourceValueConfigsRequest.new(parent: parent, requests: requests) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + client.batch_create_resource_value_configs({ parent: parent, requests: requests }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + client.batch_create_resource_value_configs(::Google::Cloud::SecurityCenter::V1::BatchCreateResourceValueConfigsRequest.new(parent: parent, requests: requests), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, batch_create_resource_value_configs_client_stub.call_count + end + end + end + + def test_delete_resource_value_config + # Create test objects. + client_result = ::Google::Protobuf::Empty.new + http_response = OpenStruct.new body: client_result.to_json + + call_options = {} + + # Create request parameters for a unary method. + name = "hello world" + + delete_resource_value_config_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| + assert options.metadata.key? :"x-goog-api-client" + assert options.metadata[:"x-goog-api-client"].include? "rest" + refute options.metadata[:"x-goog-api-client"].include? "grpc" + end + + ::Google::Cloud::SecurityCenter::V1::SecurityCenter::Rest::ServiceStub.stub :transcode_delete_resource_value_config_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, delete_resource_value_config_client_stub do + # Create client + client = ::Google::Cloud::SecurityCenter::V1::SecurityCenter::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.delete_resource_value_config({ name: name }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.delete_resource_value_config name: name do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.delete_resource_value_config ::Google::Cloud::SecurityCenter::V1::DeleteResourceValueConfigRequest.new(name: name) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + client.delete_resource_value_config({ name: name }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + client.delete_resource_value_config(::Google::Cloud::SecurityCenter::V1::DeleteResourceValueConfigRequest.new(name: name), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, delete_resource_value_config_client_stub.call_count + end + end + end + + def test_get_resource_value_config + # Create test objects. + client_result = ::Google::Cloud::SecurityCenter::V1::ResourceValueConfig.new + http_response = OpenStruct.new body: client_result.to_json + + call_options = {} + + # Create request parameters for a unary method. + name = "hello world" + + get_resource_value_config_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| + assert options.metadata.key? :"x-goog-api-client" + assert options.metadata[:"x-goog-api-client"].include? "rest" + refute options.metadata[:"x-goog-api-client"].include? "grpc" + end + + ::Google::Cloud::SecurityCenter::V1::SecurityCenter::Rest::ServiceStub.stub :transcode_get_resource_value_config_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, get_resource_value_config_client_stub do + # Create client + client = ::Google::Cloud::SecurityCenter::V1::SecurityCenter::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.get_resource_value_config({ name: name }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.get_resource_value_config name: name do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.get_resource_value_config ::Google::Cloud::SecurityCenter::V1::GetResourceValueConfigRequest.new(name: name) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + client.get_resource_value_config({ name: name }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + client.get_resource_value_config(::Google::Cloud::SecurityCenter::V1::GetResourceValueConfigRequest.new(name: name), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, get_resource_value_config_client_stub.call_count + end + end + end + + def test_list_resource_value_configs + # Create test objects. + client_result = ::Google::Cloud::SecurityCenter::V1::ListResourceValueConfigsResponse.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_resource_value_configs_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| + assert options.metadata.key? :"x-goog-api-client" + assert options.metadata[:"x-goog-api-client"].include? "rest" + refute options.metadata[:"x-goog-api-client"].include? "grpc" + end + + ::Google::Cloud::SecurityCenter::V1::SecurityCenter::Rest::ServiceStub.stub :transcode_list_resource_value_configs_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, list_resource_value_configs_client_stub do + # Create client + client = ::Google::Cloud::SecurityCenter::V1::SecurityCenter::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.list_resource_value_configs({ 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_resource_value_configs 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_resource_value_configs ::Google::Cloud::SecurityCenter::V1::ListResourceValueConfigsRequest.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_resource_value_configs({ 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_resource_value_configs(::Google::Cloud::SecurityCenter::V1::ListResourceValueConfigsRequest.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_resource_value_configs_client_stub.call_count + end + end + end + + def test_update_resource_value_config + # Create test objects. + client_result = ::Google::Cloud::SecurityCenter::V1::ResourceValueConfig.new + http_response = OpenStruct.new body: client_result.to_json + + call_options = {} + + # Create request parameters for a unary method. + resource_value_config = {} + update_mask = {} + + update_resource_value_config_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| + assert options.metadata.key? :"x-goog-api-client" + assert options.metadata[:"x-goog-api-client"].include? "rest" + refute options.metadata[:"x-goog-api-client"].include? "grpc" + end + + ::Google::Cloud::SecurityCenter::V1::SecurityCenter::Rest::ServiceStub.stub :transcode_update_resource_value_config_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, update_resource_value_config_client_stub do + # Create client + client = ::Google::Cloud::SecurityCenter::V1::SecurityCenter::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.update_resource_value_config({ resource_value_config: resource_value_config, update_mask: update_mask }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.update_resource_value_config resource_value_config: resource_value_config, update_mask: update_mask do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.update_resource_value_config ::Google::Cloud::SecurityCenter::V1::UpdateResourceValueConfigRequest.new(resource_value_config: resource_value_config, update_mask: update_mask) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + client.update_resource_value_config({ resource_value_config: resource_value_config, update_mask: update_mask }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + client.update_resource_value_config(::Google::Cloud::SecurityCenter::V1::UpdateResourceValueConfigRequest.new(resource_value_config: resource_value_config, update_mask: update_mask), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, update_resource_value_config_client_stub.call_count + end + end + end + + def test_list_valued_resources + # Create test objects. + client_result = ::Google::Cloud::SecurityCenter::V1::ListValuedResourcesResponse.new + http_response = OpenStruct.new body: client_result.to_json + + call_options = {} + + # Create request parameters for a unary method. + parent = "hello world" + filter = "hello world" + page_token = "hello world" + page_size = 42 + order_by = "hello world" + + list_valued_resources_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| + assert options.metadata.key? :"x-goog-api-client" + assert options.metadata[:"x-goog-api-client"].include? "rest" + refute options.metadata[:"x-goog-api-client"].include? "grpc" + end + + ::Google::Cloud::SecurityCenter::V1::SecurityCenter::Rest::ServiceStub.stub :transcode_list_valued_resources_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, list_valued_resources_client_stub do + # Create client + client = ::Google::Cloud::SecurityCenter::V1::SecurityCenter::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.list_valued_resources({ parent: parent, filter: filter, page_token: page_token, page_size: page_size, order_by: order_by }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.list_valued_resources parent: parent, filter: filter, page_token: page_token, page_size: page_size, order_by: order_by do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.list_valued_resources ::Google::Cloud::SecurityCenter::V1::ListValuedResourcesRequest.new(parent: parent, filter: filter, page_token: page_token, page_size: page_size, order_by: order_by) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + client.list_valued_resources({ parent: parent, filter: filter, page_token: page_token, page_size: page_size, order_by: order_by }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + client.list_valued_resources(::Google::Cloud::SecurityCenter::V1::ListValuedResourcesRequest.new(parent: parent, filter: filter, page_token: page_token, page_size: page_size, order_by: order_by), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, list_valued_resources_client_stub.call_count + end + end + end + + def test_list_attack_paths + # Create test objects. + client_result = ::Google::Cloud::SecurityCenter::V1::ListAttackPathsResponse.new + http_response = OpenStruct.new body: client_result.to_json + + call_options = {} + + # Create request parameters for a unary method. + parent = "hello world" + filter = "hello world" + page_token = "hello world" + page_size = 42 + + list_attack_paths_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| + assert options.metadata.key? :"x-goog-api-client" + assert options.metadata[:"x-goog-api-client"].include? "rest" + refute options.metadata[:"x-goog-api-client"].include? "grpc" + end + + ::Google::Cloud::SecurityCenter::V1::SecurityCenter::Rest::ServiceStub.stub :transcode_list_attack_paths_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, list_attack_paths_client_stub do + # Create client + client = ::Google::Cloud::SecurityCenter::V1::SecurityCenter::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.list_attack_paths({ parent: parent, filter: filter, page_token: page_token, page_size: page_size }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.list_attack_paths parent: parent, filter: filter, page_token: page_token, page_size: page_size do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.list_attack_paths ::Google::Cloud::SecurityCenter::V1::ListAttackPathsRequest.new(parent: parent, filter: filter, page_token: page_token, page_size: page_size) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + client.list_attack_paths({ parent: parent, filter: filter, page_token: page_token, page_size: page_size }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + client.list_attack_paths(::Google::Cloud::SecurityCenter::V1::ListAttackPathsRequest.new(parent: parent, filter: filter, page_token: page_token, page_size: page_size), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, list_attack_paths_client_stub.call_count + end + end + end + + def test_configure + credentials_token = :dummy_value + + client = block_config = config = nil + dummy_stub = ClientStub.new nil + Gapic::Rest::ClientStub.stub :new, dummy_stub do + client = ::Google::Cloud::SecurityCenter::V1::SecurityCenter::Rest::Client.new do |config| + config.credentials = credentials_token + end + end + + config = client.configure do |c| + block_config = c + end + + assert_same block_config, config + assert_kind_of ::Google::Cloud::SecurityCenter::V1::SecurityCenter::Rest::Client::Configuration, config + end +end diff --git a/owl-bot-staging/google-cloud-security_center-v1/test/google/cloud/security_center/v1/security_center_test.rb b/owl-bot-staging/google-cloud-security_center-v1/test/google/cloud/security_center/v1/security_center_test.rb new file mode 100644 index 000000000000..d1e2bbb1443a --- /dev/null +++ b/owl-bot-staging/google-cloud-security_center-v1/test/google/cloud/security_center/v1/security_center_test.rb @@ -0,0 +1,4053 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +require "helper" + +require "gapic/grpc/service_stub" + +require "google/cloud/securitycenter/v1/securitycenter_service_pb" +require "google/cloud/security_center/v1/security_center" + +class ::Google::Cloud::SecurityCenter::V1::SecurityCenter::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_bulk_mute_findings + # 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" + filter = "hello world" + mute_annotation = "hello world" + mute_state = :MUTE_STATE_UNSPECIFIED + + bulk_mute_findings_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :bulk_mute_findings, name + assert_kind_of ::Google::Cloud::SecurityCenter::V1::BulkMuteFindingsRequest, request + assert_equal "hello world", request["parent"] + assert_equal "hello world", request["filter"] + assert_equal "hello world", request["mute_annotation"] + assert_equal :MUTE_STATE_UNSPECIFIED, request["mute_state"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, bulk_mute_findings_client_stub do + # Create client + client = ::Google::Cloud::SecurityCenter::V1::SecurityCenter::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.bulk_mute_findings({ parent: parent, filter: filter, mute_annotation: mute_annotation, mute_state: mute_state }) 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.bulk_mute_findings parent: parent, filter: filter, mute_annotation: mute_annotation, mute_state: mute_state 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.bulk_mute_findings ::Google::Cloud::SecurityCenter::V1::BulkMuteFindingsRequest.new(parent: parent, filter: filter, mute_annotation: mute_annotation, mute_state: mute_state) 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.bulk_mute_findings({ parent: parent, filter: filter, mute_annotation: mute_annotation, mute_state: mute_state }, 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.bulk_mute_findings(::Google::Cloud::SecurityCenter::V1::BulkMuteFindingsRequest.new(parent: parent, filter: filter, mute_annotation: mute_annotation, mute_state: mute_state), 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, bulk_mute_findings_client_stub.call_rpc_count + end + end + + def test_create_security_health_analytics_custom_module + # Create GRPC objects. + grpc_response = ::Google::Cloud::SecurityCenter::V1::SecurityHealthAnalyticsCustomModule.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" + security_health_analytics_custom_module = {} + + create_security_health_analytics_custom_module_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :create_security_health_analytics_custom_module, name + assert_kind_of ::Google::Cloud::SecurityCenter::V1::CreateSecurityHealthAnalyticsCustomModuleRequest, request + assert_equal "hello world", request["parent"] + assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::SecurityCenter::V1::SecurityHealthAnalyticsCustomModule), request["security_health_analytics_custom_module"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, create_security_health_analytics_custom_module_client_stub do + # Create client + client = ::Google::Cloud::SecurityCenter::V1::SecurityCenter::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.create_security_health_analytics_custom_module({ parent: parent, security_health_analytics_custom_module: security_health_analytics_custom_module }) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use named arguments + client.create_security_health_analytics_custom_module parent: parent, security_health_analytics_custom_module: security_health_analytics_custom_module do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.create_security_health_analytics_custom_module ::Google::Cloud::SecurityCenter::V1::CreateSecurityHealthAnalyticsCustomModuleRequest.new(parent: parent, security_health_analytics_custom_module: security_health_analytics_custom_module) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use hash object with options + client.create_security_health_analytics_custom_module({ parent: parent, security_health_analytics_custom_module: security_health_analytics_custom_module }, grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object with options + client.create_security_health_analytics_custom_module(::Google::Cloud::SecurityCenter::V1::CreateSecurityHealthAnalyticsCustomModuleRequest.new(parent: parent, security_health_analytics_custom_module: security_health_analytics_custom_module), grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Verify method calls + assert_equal 5, create_security_health_analytics_custom_module_client_stub.call_rpc_count + end + end + + def test_create_source + # Create GRPC objects. + grpc_response = ::Google::Cloud::SecurityCenter::V1::Source.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" + source = {} + + create_source_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :create_source, name + assert_kind_of ::Google::Cloud::SecurityCenter::V1::CreateSourceRequest, request + assert_equal "hello world", request["parent"] + assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::SecurityCenter::V1::Source), request["source"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, create_source_client_stub do + # Create client + client = ::Google::Cloud::SecurityCenter::V1::SecurityCenter::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.create_source({ parent: parent, source: source }) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use named arguments + client.create_source parent: parent, source: source do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.create_source ::Google::Cloud::SecurityCenter::V1::CreateSourceRequest.new(parent: parent, source: source) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use hash object with options + client.create_source({ parent: parent, source: source }, grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object with options + client.create_source(::Google::Cloud::SecurityCenter::V1::CreateSourceRequest.new(parent: parent, source: source), grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Verify method calls + assert_equal 5, create_source_client_stub.call_rpc_count + end + end + + def test_create_finding + # Create GRPC objects. + grpc_response = ::Google::Cloud::SecurityCenter::V1::Finding.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" + finding_id = "hello world" + finding = {} + + create_finding_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :create_finding, name + assert_kind_of ::Google::Cloud::SecurityCenter::V1::CreateFindingRequest, request + assert_equal "hello world", request["parent"] + assert_equal "hello world", request["finding_id"] + assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::SecurityCenter::V1::Finding), request["finding"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, create_finding_client_stub do + # Create client + client = ::Google::Cloud::SecurityCenter::V1::SecurityCenter::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.create_finding({ parent: parent, finding_id: finding_id, finding: finding }) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use named arguments + client.create_finding parent: parent, finding_id: finding_id, finding: finding do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.create_finding ::Google::Cloud::SecurityCenter::V1::CreateFindingRequest.new(parent: parent, finding_id: finding_id, finding: finding) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use hash object with options + client.create_finding({ parent: parent, finding_id: finding_id, finding: finding }, grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object with options + client.create_finding(::Google::Cloud::SecurityCenter::V1::CreateFindingRequest.new(parent: parent, finding_id: finding_id, finding: finding), grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Verify method calls + assert_equal 5, create_finding_client_stub.call_rpc_count + end + end + + def test_create_mute_config + # Create GRPC objects. + grpc_response = ::Google::Cloud::SecurityCenter::V1::MuteConfig.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" + mute_config = {} + mute_config_id = "hello world" + + create_mute_config_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :create_mute_config, name + assert_kind_of ::Google::Cloud::SecurityCenter::V1::CreateMuteConfigRequest, request + assert_equal "hello world", request["parent"] + assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::SecurityCenter::V1::MuteConfig), request["mute_config"] + assert_equal "hello world", request["mute_config_id"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, create_mute_config_client_stub do + # Create client + client = ::Google::Cloud::SecurityCenter::V1::SecurityCenter::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.create_mute_config({ parent: parent, mute_config: mute_config, mute_config_id: mute_config_id }) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use named arguments + client.create_mute_config parent: parent, mute_config: mute_config, mute_config_id: mute_config_id do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.create_mute_config ::Google::Cloud::SecurityCenter::V1::CreateMuteConfigRequest.new(parent: parent, mute_config: mute_config, mute_config_id: mute_config_id) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use hash object with options + client.create_mute_config({ parent: parent, mute_config: mute_config, mute_config_id: mute_config_id }, grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object with options + client.create_mute_config(::Google::Cloud::SecurityCenter::V1::CreateMuteConfigRequest.new(parent: parent, mute_config: mute_config, mute_config_id: mute_config_id), grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Verify method calls + assert_equal 5, create_mute_config_client_stub.call_rpc_count + end + end + + def test_create_notification_config + # Create GRPC objects. + grpc_response = ::Google::Cloud::SecurityCenter::V1::NotificationConfig.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" + config_id = "hello world" + notification_config = {} + + create_notification_config_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :create_notification_config, name + assert_kind_of ::Google::Cloud::SecurityCenter::V1::CreateNotificationConfigRequest, request + assert_equal "hello world", request["parent"] + assert_equal "hello world", request["config_id"] + assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::SecurityCenter::V1::NotificationConfig), request["notification_config"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, create_notification_config_client_stub do + # Create client + client = ::Google::Cloud::SecurityCenter::V1::SecurityCenter::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.create_notification_config({ parent: parent, config_id: config_id, notification_config: notification_config }) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use named arguments + client.create_notification_config parent: parent, config_id: config_id, notification_config: notification_config do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.create_notification_config ::Google::Cloud::SecurityCenter::V1::CreateNotificationConfigRequest.new(parent: parent, config_id: config_id, notification_config: notification_config) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use hash object with options + client.create_notification_config({ parent: parent, config_id: config_id, notification_config: notification_config }, grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object with options + client.create_notification_config(::Google::Cloud::SecurityCenter::V1::CreateNotificationConfigRequest.new(parent: parent, config_id: config_id, notification_config: notification_config), grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Verify method calls + assert_equal 5, create_notification_config_client_stub.call_rpc_count + end + end + + def test_delete_mute_config + # 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_mute_config_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :delete_mute_config, name + assert_kind_of ::Google::Cloud::SecurityCenter::V1::DeleteMuteConfigRequest, request + assert_equal "hello world", request["name"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, delete_mute_config_client_stub do + # Create client + client = ::Google::Cloud::SecurityCenter::V1::SecurityCenter::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.delete_mute_config({ name: name }) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use named arguments + client.delete_mute_config name: name do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.delete_mute_config ::Google::Cloud::SecurityCenter::V1::DeleteMuteConfigRequest.new(name: name) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use hash object with options + client.delete_mute_config({ name: name }, grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object with options + client.delete_mute_config(::Google::Cloud::SecurityCenter::V1::DeleteMuteConfigRequest.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_mute_config_client_stub.call_rpc_count + end + end + + def test_delete_notification_config + # 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_notification_config_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :delete_notification_config, name + assert_kind_of ::Google::Cloud::SecurityCenter::V1::DeleteNotificationConfigRequest, request + assert_equal "hello world", request["name"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, delete_notification_config_client_stub do + # Create client + client = ::Google::Cloud::SecurityCenter::V1::SecurityCenter::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.delete_notification_config({ name: name }) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use named arguments + client.delete_notification_config name: name do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.delete_notification_config ::Google::Cloud::SecurityCenter::V1::DeleteNotificationConfigRequest.new(name: name) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use hash object with options + client.delete_notification_config({ name: name }, grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object with options + client.delete_notification_config(::Google::Cloud::SecurityCenter::V1::DeleteNotificationConfigRequest.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_notification_config_client_stub.call_rpc_count + end + end + + def test_delete_security_health_analytics_custom_module + # 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_security_health_analytics_custom_module_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :delete_security_health_analytics_custom_module, name + assert_kind_of ::Google::Cloud::SecurityCenter::V1::DeleteSecurityHealthAnalyticsCustomModuleRequest, request + assert_equal "hello world", request["name"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, delete_security_health_analytics_custom_module_client_stub do + # Create client + client = ::Google::Cloud::SecurityCenter::V1::SecurityCenter::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.delete_security_health_analytics_custom_module({ name: name }) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use named arguments + client.delete_security_health_analytics_custom_module name: name do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.delete_security_health_analytics_custom_module ::Google::Cloud::SecurityCenter::V1::DeleteSecurityHealthAnalyticsCustomModuleRequest.new(name: name) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use hash object with options + client.delete_security_health_analytics_custom_module({ 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_security_health_analytics_custom_module(::Google::Cloud::SecurityCenter::V1::DeleteSecurityHealthAnalyticsCustomModuleRequest.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_security_health_analytics_custom_module_client_stub.call_rpc_count + end + end + + def test_get_simulation + # Create GRPC objects. + grpc_response = ::Google::Cloud::SecurityCenter::V1::Simulation.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_simulation_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :get_simulation, name + assert_kind_of ::Google::Cloud::SecurityCenter::V1::GetSimulationRequest, request + assert_equal "hello world", request["name"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, get_simulation_client_stub do + # Create client + client = ::Google::Cloud::SecurityCenter::V1::SecurityCenter::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.get_simulation({ name: name }) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use named arguments + client.get_simulation name: name do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.get_simulation ::Google::Cloud::SecurityCenter::V1::GetSimulationRequest.new(name: name) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use hash object with options + client.get_simulation({ 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_simulation(::Google::Cloud::SecurityCenter::V1::GetSimulationRequest.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_simulation_client_stub.call_rpc_count + end + end + + def test_get_valued_resource + # Create GRPC objects. + grpc_response = ::Google::Cloud::SecurityCenter::V1::ValuedResource.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_valued_resource_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :get_valued_resource, name + assert_kind_of ::Google::Cloud::SecurityCenter::V1::GetValuedResourceRequest, request + assert_equal "hello world", request["name"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, get_valued_resource_client_stub do + # Create client + client = ::Google::Cloud::SecurityCenter::V1::SecurityCenter::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.get_valued_resource({ name: name }) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use named arguments + client.get_valued_resource name: name do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.get_valued_resource ::Google::Cloud::SecurityCenter::V1::GetValuedResourceRequest.new(name: name) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use hash object with options + client.get_valued_resource({ 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_valued_resource(::Google::Cloud::SecurityCenter::V1::GetValuedResourceRequest.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_valued_resource_client_stub.call_rpc_count + end + end + + def test_get_big_query_export + # Create GRPC objects. + grpc_response = ::Google::Cloud::SecurityCenter::V1::BigQueryExport.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_big_query_export_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :get_big_query_export, name + assert_kind_of ::Google::Cloud::SecurityCenter::V1::GetBigQueryExportRequest, request + assert_equal "hello world", request["name"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, get_big_query_export_client_stub do + # Create client + client = ::Google::Cloud::SecurityCenter::V1::SecurityCenter::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.get_big_query_export({ name: name }) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use named arguments + client.get_big_query_export name: name do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.get_big_query_export ::Google::Cloud::SecurityCenter::V1::GetBigQueryExportRequest.new(name: name) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use hash object with options + client.get_big_query_export({ 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_big_query_export(::Google::Cloud::SecurityCenter::V1::GetBigQueryExportRequest.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_big_query_export_client_stub.call_rpc_count + end + end + + def test_get_iam_policy + # Create GRPC objects. + grpc_response = ::Google::Iam::V1::Policy.new + grpc_operation = GRPC::ActiveCall::Operation.new nil + grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + grpc_options = {} + + # Create request parameters for a unary method. + resource = "hello world" + options = {} + + get_iam_policy_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :get_iam_policy, name + assert_kind_of ::Google::Iam::V1::GetIamPolicyRequest, request + assert_equal "hello world", request["resource"] + assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Iam::V1::GetPolicyOptions), request["options"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, get_iam_policy_client_stub do + # Create client + client = ::Google::Cloud::SecurityCenter::V1::SecurityCenter::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.get_iam_policy({ resource: resource, options: options }) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use named arguments + client.get_iam_policy resource: resource, options: options do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.get_iam_policy ::Google::Iam::V1::GetIamPolicyRequest.new(resource: resource, options: options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use hash object with options + client.get_iam_policy({ resource: resource, options: options }, grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object with options + client.get_iam_policy(::Google::Iam::V1::GetIamPolicyRequest.new(resource: resource, options: options), grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Verify method calls + assert_equal 5, get_iam_policy_client_stub.call_rpc_count + end + end + + def test_get_mute_config + # Create GRPC objects. + grpc_response = ::Google::Cloud::SecurityCenter::V1::MuteConfig.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_mute_config_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :get_mute_config, name + assert_kind_of ::Google::Cloud::SecurityCenter::V1::GetMuteConfigRequest, request + assert_equal "hello world", request["name"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, get_mute_config_client_stub do + # Create client + client = ::Google::Cloud::SecurityCenter::V1::SecurityCenter::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.get_mute_config({ name: name }) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use named arguments + client.get_mute_config name: name do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.get_mute_config ::Google::Cloud::SecurityCenter::V1::GetMuteConfigRequest.new(name: name) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use hash object with options + client.get_mute_config({ name: name }, grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object with options + client.get_mute_config(::Google::Cloud::SecurityCenter::V1::GetMuteConfigRequest.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_mute_config_client_stub.call_rpc_count + end + end + + def test_get_notification_config + # Create GRPC objects. + grpc_response = ::Google::Cloud::SecurityCenter::V1::NotificationConfig.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_notification_config_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :get_notification_config, name + assert_kind_of ::Google::Cloud::SecurityCenter::V1::GetNotificationConfigRequest, request + assert_equal "hello world", request["name"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, get_notification_config_client_stub do + # Create client + client = ::Google::Cloud::SecurityCenter::V1::SecurityCenter::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.get_notification_config({ name: name }) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use named arguments + client.get_notification_config name: name do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.get_notification_config ::Google::Cloud::SecurityCenter::V1::GetNotificationConfigRequest.new(name: name) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use hash object with options + client.get_notification_config({ name: name }, grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object with options + client.get_notification_config(::Google::Cloud::SecurityCenter::V1::GetNotificationConfigRequest.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_notification_config_client_stub.call_rpc_count + end + end + + def test_get_organization_settings + # Create GRPC objects. + grpc_response = ::Google::Cloud::SecurityCenter::V1::OrganizationSettings.new + grpc_operation = GRPC::ActiveCall::Operation.new nil + grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + grpc_options = {} + + # Create request parameters for a unary method. + name = "hello world" + + get_organization_settings_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :get_organization_settings, name + assert_kind_of ::Google::Cloud::SecurityCenter::V1::GetOrganizationSettingsRequest, request + assert_equal "hello world", request["name"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, get_organization_settings_client_stub do + # Create client + client = ::Google::Cloud::SecurityCenter::V1::SecurityCenter::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.get_organization_settings({ name: name }) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use named arguments + client.get_organization_settings name: name do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.get_organization_settings ::Google::Cloud::SecurityCenter::V1::GetOrganizationSettingsRequest.new(name: name) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use hash object with options + client.get_organization_settings({ name: name }, grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object with options + client.get_organization_settings(::Google::Cloud::SecurityCenter::V1::GetOrganizationSettingsRequest.new(name: name), grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Verify method calls + assert_equal 5, get_organization_settings_client_stub.call_rpc_count + end + end + + def test_get_effective_security_health_analytics_custom_module + # Create GRPC objects. + grpc_response = ::Google::Cloud::SecurityCenter::V1::EffectiveSecurityHealthAnalyticsCustomModule.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_effective_security_health_analytics_custom_module_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :get_effective_security_health_analytics_custom_module, name + assert_kind_of ::Google::Cloud::SecurityCenter::V1::GetEffectiveSecurityHealthAnalyticsCustomModuleRequest, request + assert_equal "hello world", request["name"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, get_effective_security_health_analytics_custom_module_client_stub do + # Create client + client = ::Google::Cloud::SecurityCenter::V1::SecurityCenter::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.get_effective_security_health_analytics_custom_module({ name: name }) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use named arguments + client.get_effective_security_health_analytics_custom_module name: name do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.get_effective_security_health_analytics_custom_module ::Google::Cloud::SecurityCenter::V1::GetEffectiveSecurityHealthAnalyticsCustomModuleRequest.new(name: name) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use hash object with options + client.get_effective_security_health_analytics_custom_module({ 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_effective_security_health_analytics_custom_module(::Google::Cloud::SecurityCenter::V1::GetEffectiveSecurityHealthAnalyticsCustomModuleRequest.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_effective_security_health_analytics_custom_module_client_stub.call_rpc_count + end + end + + def test_get_security_health_analytics_custom_module + # Create GRPC objects. + grpc_response = ::Google::Cloud::SecurityCenter::V1::SecurityHealthAnalyticsCustomModule.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_security_health_analytics_custom_module_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :get_security_health_analytics_custom_module, name + assert_kind_of ::Google::Cloud::SecurityCenter::V1::GetSecurityHealthAnalyticsCustomModuleRequest, request + assert_equal "hello world", request["name"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, get_security_health_analytics_custom_module_client_stub do + # Create client + client = ::Google::Cloud::SecurityCenter::V1::SecurityCenter::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.get_security_health_analytics_custom_module({ name: name }) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use named arguments + client.get_security_health_analytics_custom_module name: name do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.get_security_health_analytics_custom_module ::Google::Cloud::SecurityCenter::V1::GetSecurityHealthAnalyticsCustomModuleRequest.new(name: name) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use hash object with options + client.get_security_health_analytics_custom_module({ 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_security_health_analytics_custom_module(::Google::Cloud::SecurityCenter::V1::GetSecurityHealthAnalyticsCustomModuleRequest.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_security_health_analytics_custom_module_client_stub.call_rpc_count + end + end + + def test_get_source + # Create GRPC objects. + grpc_response = ::Google::Cloud::SecurityCenter::V1::Source.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_source_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :get_source, name + assert_kind_of ::Google::Cloud::SecurityCenter::V1::GetSourceRequest, request + assert_equal "hello world", request["name"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, get_source_client_stub do + # Create client + client = ::Google::Cloud::SecurityCenter::V1::SecurityCenter::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.get_source({ name: name }) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use named arguments + client.get_source name: name do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.get_source ::Google::Cloud::SecurityCenter::V1::GetSourceRequest.new(name: name) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use hash object with options + client.get_source({ 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_source(::Google::Cloud::SecurityCenter::V1::GetSourceRequest.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_source_client_stub.call_rpc_count + end + end + + def test_group_assets + # Create GRPC objects. + grpc_response = ::Google::Cloud::SecurityCenter::V1::GroupAssetsResponse.new + grpc_operation = GRPC::ActiveCall::Operation.new nil + grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + grpc_options = {} + + # Create request parameters for a unary method. + parent = "hello world" + filter = "hello world" + group_by = "hello world" + compare_duration = {} + read_time = {} + page_token = "hello world" + page_size = 42 + + group_assets_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :group_assets, name + assert_kind_of ::Google::Cloud::SecurityCenter::V1::GroupAssetsRequest, request + assert_equal "hello world", request["parent"] + assert_equal "hello world", request["filter"] + assert_equal "hello world", request["group_by"] + assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Protobuf::Duration), request["compare_duration"] + assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Protobuf::Timestamp), request["read_time"] + assert_equal "hello world", request["page_token"] + assert_equal 42, request["page_size"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, group_assets_client_stub do + # Create client + client = ::Google::Cloud::SecurityCenter::V1::SecurityCenter::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.group_assets({ parent: parent, filter: filter, group_by: group_by, compare_duration: compare_duration, read_time: read_time, page_token: page_token, page_size: page_size }) 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.group_assets parent: parent, filter: filter, group_by: group_by, compare_duration: compare_duration, read_time: read_time, page_token: page_token, page_size: page_size 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.group_assets ::Google::Cloud::SecurityCenter::V1::GroupAssetsRequest.new(parent: parent, filter: filter, group_by: group_by, compare_duration: compare_duration, read_time: read_time, page_token: page_token, page_size: page_size) 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.group_assets({ parent: parent, filter: filter, group_by: group_by, compare_duration: compare_duration, read_time: read_time, page_token: page_token, page_size: page_size }, 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.group_assets(::Google::Cloud::SecurityCenter::V1::GroupAssetsRequest.new(parent: parent, filter: filter, group_by: group_by, compare_duration: compare_duration, read_time: read_time, page_token: page_token, page_size: page_size), 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, group_assets_client_stub.call_rpc_count + end + end + + def test_group_findings + # Create GRPC objects. + grpc_response = ::Google::Cloud::SecurityCenter::V1::GroupFindingsResponse.new + grpc_operation = GRPC::ActiveCall::Operation.new nil + grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + grpc_options = {} + + # Create request parameters for a unary method. + parent = "hello world" + filter = "hello world" + group_by = "hello world" + read_time = {} + compare_duration = {} + page_token = "hello world" + page_size = 42 + + group_findings_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :group_findings, name + assert_kind_of ::Google::Cloud::SecurityCenter::V1::GroupFindingsRequest, request + assert_equal "hello world", request["parent"] + assert_equal "hello world", request["filter"] + assert_equal "hello world", request["group_by"] + assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Protobuf::Timestamp), request["read_time"] + assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Protobuf::Duration), request["compare_duration"] + assert_equal "hello world", request["page_token"] + assert_equal 42, request["page_size"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, group_findings_client_stub do + # Create client + client = ::Google::Cloud::SecurityCenter::V1::SecurityCenter::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.group_findings({ parent: parent, filter: filter, group_by: group_by, read_time: read_time, compare_duration: compare_duration, page_token: page_token, page_size: page_size }) 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.group_findings parent: parent, filter: filter, group_by: group_by, read_time: read_time, compare_duration: compare_duration, page_token: page_token, page_size: page_size 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.group_findings ::Google::Cloud::SecurityCenter::V1::GroupFindingsRequest.new(parent: parent, filter: filter, group_by: group_by, read_time: read_time, compare_duration: compare_duration, page_token: page_token, page_size: page_size) 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.group_findings({ parent: parent, filter: filter, group_by: group_by, read_time: read_time, compare_duration: compare_duration, page_token: page_token, page_size: page_size }, 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.group_findings(::Google::Cloud::SecurityCenter::V1::GroupFindingsRequest.new(parent: parent, filter: filter, group_by: group_by, read_time: read_time, compare_duration: compare_duration, page_token: page_token, page_size: page_size), 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, group_findings_client_stub.call_rpc_count + end + end + + def test_list_assets + # Create GRPC objects. + grpc_response = ::Google::Cloud::SecurityCenter::V1::ListAssetsResponse.new + grpc_operation = GRPC::ActiveCall::Operation.new nil + grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + grpc_options = {} + + # Create request parameters for a unary method. + parent = "hello world" + filter = "hello world" + order_by = "hello world" + read_time = {} + compare_duration = {} + field_mask = {} + page_token = "hello world" + page_size = 42 + + list_assets_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :list_assets, name + assert_kind_of ::Google::Cloud::SecurityCenter::V1::ListAssetsRequest, request + assert_equal "hello world", request["parent"] + assert_equal "hello world", request["filter"] + assert_equal "hello world", request["order_by"] + assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Protobuf::Timestamp), request["read_time"] + assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Protobuf::Duration), request["compare_duration"] + assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Protobuf::FieldMask), request["field_mask"] + assert_equal "hello world", request["page_token"] + assert_equal 42, request["page_size"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, list_assets_client_stub do + # Create client + client = ::Google::Cloud::SecurityCenter::V1::SecurityCenter::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.list_assets({ parent: parent, filter: filter, order_by: order_by, read_time: read_time, compare_duration: compare_duration, field_mask: field_mask, page_token: page_token, page_size: page_size }) 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_assets parent: parent, filter: filter, order_by: order_by, read_time: read_time, compare_duration: compare_duration, field_mask: field_mask, page_token: page_token, page_size: page_size 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_assets ::Google::Cloud::SecurityCenter::V1::ListAssetsRequest.new(parent: parent, filter: filter, order_by: order_by, read_time: read_time, compare_duration: compare_duration, field_mask: field_mask, page_token: page_token, page_size: page_size) 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_assets({ parent: parent, filter: filter, order_by: order_by, read_time: read_time, compare_duration: compare_duration, field_mask: field_mask, page_token: page_token, page_size: page_size }, 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_assets(::Google::Cloud::SecurityCenter::V1::ListAssetsRequest.new(parent: parent, filter: filter, order_by: order_by, read_time: read_time, compare_duration: compare_duration, field_mask: field_mask, page_token: page_token, page_size: page_size), 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_assets_client_stub.call_rpc_count + end + end + + def test_list_descendant_security_health_analytics_custom_modules + # Create GRPC objects. + grpc_response = ::Google::Cloud::SecurityCenter::V1::ListDescendantSecurityHealthAnalyticsCustomModulesResponse.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_descendant_security_health_analytics_custom_modules_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :list_descendant_security_health_analytics_custom_modules, name + assert_kind_of ::Google::Cloud::SecurityCenter::V1::ListDescendantSecurityHealthAnalyticsCustomModulesRequest, 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_descendant_security_health_analytics_custom_modules_client_stub do + # Create client + client = ::Google::Cloud::SecurityCenter::V1::SecurityCenter::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.list_descendant_security_health_analytics_custom_modules({ 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_descendant_security_health_analytics_custom_modules 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_descendant_security_health_analytics_custom_modules ::Google::Cloud::SecurityCenter::V1::ListDescendantSecurityHealthAnalyticsCustomModulesRequest.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_descendant_security_health_analytics_custom_modules({ 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_descendant_security_health_analytics_custom_modules(::Google::Cloud::SecurityCenter::V1::ListDescendantSecurityHealthAnalyticsCustomModulesRequest.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_descendant_security_health_analytics_custom_modules_client_stub.call_rpc_count + end + end + + def test_list_findings + # Create GRPC objects. + grpc_response = ::Google::Cloud::SecurityCenter::V1::ListFindingsResponse.new + grpc_operation = GRPC::ActiveCall::Operation.new nil + grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + grpc_options = {} + + # Create request parameters for a unary method. + parent = "hello world" + filter = "hello world" + order_by = "hello world" + read_time = {} + compare_duration = {} + field_mask = {} + page_token = "hello world" + page_size = 42 + + list_findings_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :list_findings, name + assert_kind_of ::Google::Cloud::SecurityCenter::V1::ListFindingsRequest, request + assert_equal "hello world", request["parent"] + assert_equal "hello world", request["filter"] + assert_equal "hello world", request["order_by"] + assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Protobuf::Timestamp), request["read_time"] + assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Protobuf::Duration), request["compare_duration"] + assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Protobuf::FieldMask), request["field_mask"] + assert_equal "hello world", request["page_token"] + assert_equal 42, request["page_size"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, list_findings_client_stub do + # Create client + client = ::Google::Cloud::SecurityCenter::V1::SecurityCenter::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.list_findings({ parent: parent, filter: filter, order_by: order_by, read_time: read_time, compare_duration: compare_duration, field_mask: field_mask, page_token: page_token, page_size: page_size }) 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_findings parent: parent, filter: filter, order_by: order_by, read_time: read_time, compare_duration: compare_duration, field_mask: field_mask, page_token: page_token, page_size: page_size 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_findings ::Google::Cloud::SecurityCenter::V1::ListFindingsRequest.new(parent: parent, filter: filter, order_by: order_by, read_time: read_time, compare_duration: compare_duration, field_mask: field_mask, page_token: page_token, page_size: page_size) 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_findings({ parent: parent, filter: filter, order_by: order_by, read_time: read_time, compare_duration: compare_duration, field_mask: field_mask, page_token: page_token, page_size: page_size }, 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_findings(::Google::Cloud::SecurityCenter::V1::ListFindingsRequest.new(parent: parent, filter: filter, order_by: order_by, read_time: read_time, compare_duration: compare_duration, field_mask: field_mask, page_token: page_token, page_size: page_size), 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_findings_client_stub.call_rpc_count + end + end + + def test_list_mute_configs + # Create GRPC objects. + grpc_response = ::Google::Cloud::SecurityCenter::V1::ListMuteConfigsResponse.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_mute_configs_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :list_mute_configs, name + assert_kind_of ::Google::Cloud::SecurityCenter::V1::ListMuteConfigsRequest, 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_mute_configs_client_stub do + # Create client + client = ::Google::Cloud::SecurityCenter::V1::SecurityCenter::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.list_mute_configs({ 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_mute_configs 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_mute_configs ::Google::Cloud::SecurityCenter::V1::ListMuteConfigsRequest.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_mute_configs({ 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_mute_configs(::Google::Cloud::SecurityCenter::V1::ListMuteConfigsRequest.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_mute_configs_client_stub.call_rpc_count + end + end + + def test_list_notification_configs + # Create GRPC objects. + grpc_response = ::Google::Cloud::SecurityCenter::V1::ListNotificationConfigsResponse.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_token = "hello world" + page_size = 42 + + list_notification_configs_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :list_notification_configs, name + assert_kind_of ::Google::Cloud::SecurityCenter::V1::ListNotificationConfigsRequest, request + assert_equal "hello world", request["parent"] + assert_equal "hello world", request["page_token"] + assert_equal 42, request["page_size"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, list_notification_configs_client_stub do + # Create client + client = ::Google::Cloud::SecurityCenter::V1::SecurityCenter::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.list_notification_configs({ parent: parent, page_token: page_token, page_size: page_size }) 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_notification_configs parent: parent, page_token: page_token, page_size: page_size 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_notification_configs ::Google::Cloud::SecurityCenter::V1::ListNotificationConfigsRequest.new(parent: parent, page_token: page_token, page_size: page_size) 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_notification_configs({ parent: parent, page_token: page_token, page_size: page_size }, 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_notification_configs(::Google::Cloud::SecurityCenter::V1::ListNotificationConfigsRequest.new(parent: parent, page_token: page_token, page_size: page_size), 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_notification_configs_client_stub.call_rpc_count + end + end + + def test_list_effective_security_health_analytics_custom_modules + # Create GRPC objects. + grpc_response = ::Google::Cloud::SecurityCenter::V1::ListEffectiveSecurityHealthAnalyticsCustomModulesResponse.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_effective_security_health_analytics_custom_modules_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :list_effective_security_health_analytics_custom_modules, name + assert_kind_of ::Google::Cloud::SecurityCenter::V1::ListEffectiveSecurityHealthAnalyticsCustomModulesRequest, 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_effective_security_health_analytics_custom_modules_client_stub do + # Create client + client = ::Google::Cloud::SecurityCenter::V1::SecurityCenter::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.list_effective_security_health_analytics_custom_modules({ 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_effective_security_health_analytics_custom_modules 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_effective_security_health_analytics_custom_modules ::Google::Cloud::SecurityCenter::V1::ListEffectiveSecurityHealthAnalyticsCustomModulesRequest.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_effective_security_health_analytics_custom_modules({ 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_effective_security_health_analytics_custom_modules(::Google::Cloud::SecurityCenter::V1::ListEffectiveSecurityHealthAnalyticsCustomModulesRequest.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_effective_security_health_analytics_custom_modules_client_stub.call_rpc_count + end + end + + def test_list_security_health_analytics_custom_modules + # Create GRPC objects. + grpc_response = ::Google::Cloud::SecurityCenter::V1::ListSecurityHealthAnalyticsCustomModulesResponse.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_security_health_analytics_custom_modules_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :list_security_health_analytics_custom_modules, name + assert_kind_of ::Google::Cloud::SecurityCenter::V1::ListSecurityHealthAnalyticsCustomModulesRequest, 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_security_health_analytics_custom_modules_client_stub do + # Create client + client = ::Google::Cloud::SecurityCenter::V1::SecurityCenter::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.list_security_health_analytics_custom_modules({ 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_security_health_analytics_custom_modules 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_security_health_analytics_custom_modules ::Google::Cloud::SecurityCenter::V1::ListSecurityHealthAnalyticsCustomModulesRequest.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_security_health_analytics_custom_modules({ 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_security_health_analytics_custom_modules(::Google::Cloud::SecurityCenter::V1::ListSecurityHealthAnalyticsCustomModulesRequest.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_security_health_analytics_custom_modules_client_stub.call_rpc_count + end + end + + def test_list_sources + # Create GRPC objects. + grpc_response = ::Google::Cloud::SecurityCenter::V1::ListSourcesResponse.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_token = "hello world" + page_size = 42 + + list_sources_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :list_sources, name + assert_kind_of ::Google::Cloud::SecurityCenter::V1::ListSourcesRequest, request + assert_equal "hello world", request["parent"] + assert_equal "hello world", request["page_token"] + assert_equal 42, request["page_size"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, list_sources_client_stub do + # Create client + client = ::Google::Cloud::SecurityCenter::V1::SecurityCenter::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.list_sources({ parent: parent, page_token: page_token, page_size: page_size }) 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_sources parent: parent, page_token: page_token, page_size: page_size 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_sources ::Google::Cloud::SecurityCenter::V1::ListSourcesRequest.new(parent: parent, page_token: page_token, page_size: page_size) 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_sources({ parent: parent, page_token: page_token, page_size: page_size }, 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_sources(::Google::Cloud::SecurityCenter::V1::ListSourcesRequest.new(parent: parent, page_token: page_token, page_size: page_size), 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_sources_client_stub.call_rpc_count + end + end + + def test_run_asset_discovery + # 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" + + run_asset_discovery_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :run_asset_discovery, name + assert_kind_of ::Google::Cloud::SecurityCenter::V1::RunAssetDiscoveryRequest, request + assert_equal "hello world", request["parent"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, run_asset_discovery_client_stub do + # Create client + client = ::Google::Cloud::SecurityCenter::V1::SecurityCenter::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.run_asset_discovery({ parent: parent }) 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.run_asset_discovery parent: parent 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.run_asset_discovery ::Google::Cloud::SecurityCenter::V1::RunAssetDiscoveryRequest.new(parent: parent) 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.run_asset_discovery({ parent: parent }, 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.run_asset_discovery(::Google::Cloud::SecurityCenter::V1::RunAssetDiscoveryRequest.new(parent: parent), 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, run_asset_discovery_client_stub.call_rpc_count + end + end + + def test_set_finding_state + # Create GRPC objects. + grpc_response = ::Google::Cloud::SecurityCenter::V1::Finding.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" + state = :STATE_UNSPECIFIED + start_time = {} + + set_finding_state_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :set_finding_state, name + assert_kind_of ::Google::Cloud::SecurityCenter::V1::SetFindingStateRequest, request + assert_equal "hello world", request["name"] + assert_equal :STATE_UNSPECIFIED, request["state"] + assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Protobuf::Timestamp), request["start_time"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, set_finding_state_client_stub do + # Create client + client = ::Google::Cloud::SecurityCenter::V1::SecurityCenter::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.set_finding_state({ name: name, state: state, start_time: start_time }) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use named arguments + client.set_finding_state name: name, state: state, start_time: start_time do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.set_finding_state ::Google::Cloud::SecurityCenter::V1::SetFindingStateRequest.new(name: name, state: state, start_time: start_time) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use hash object with options + client.set_finding_state({ name: name, state: state, start_time: start_time }, grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object with options + client.set_finding_state(::Google::Cloud::SecurityCenter::V1::SetFindingStateRequest.new(name: name, state: state, start_time: start_time), grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Verify method calls + assert_equal 5, set_finding_state_client_stub.call_rpc_count + end + end + + def test_set_mute + # Create GRPC objects. + grpc_response = ::Google::Cloud::SecurityCenter::V1::Finding.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" + mute = :MUTE_UNSPECIFIED + + set_mute_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :set_mute, name + assert_kind_of ::Google::Cloud::SecurityCenter::V1::SetMuteRequest, request + assert_equal "hello world", request["name"] + assert_equal :MUTE_UNSPECIFIED, request["mute"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, set_mute_client_stub do + # Create client + client = ::Google::Cloud::SecurityCenter::V1::SecurityCenter::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.set_mute({ name: name, mute: mute }) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use named arguments + client.set_mute name: name, mute: mute do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.set_mute ::Google::Cloud::SecurityCenter::V1::SetMuteRequest.new(name: name, mute: mute) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use hash object with options + client.set_mute({ name: name, mute: mute }, grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object with options + client.set_mute(::Google::Cloud::SecurityCenter::V1::SetMuteRequest.new(name: name, mute: mute), grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Verify method calls + assert_equal 5, set_mute_client_stub.call_rpc_count + end + end + + def test_set_iam_policy + # Create GRPC objects. + grpc_response = ::Google::Iam::V1::Policy.new + grpc_operation = GRPC::ActiveCall::Operation.new nil + grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + grpc_options = {} + + # Create request parameters for a unary method. + resource = "hello world" + policy = {} + update_mask = {} + + set_iam_policy_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :set_iam_policy, name + assert_kind_of ::Google::Iam::V1::SetIamPolicyRequest, request + assert_equal "hello world", request["resource"] + assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Iam::V1::Policy), request["policy"] + assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Protobuf::FieldMask), request["update_mask"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, set_iam_policy_client_stub do + # Create client + client = ::Google::Cloud::SecurityCenter::V1::SecurityCenter::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.set_iam_policy({ resource: resource, policy: policy, update_mask: update_mask }) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use named arguments + client.set_iam_policy resource: resource, policy: policy, update_mask: update_mask do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.set_iam_policy ::Google::Iam::V1::SetIamPolicyRequest.new(resource: resource, policy: policy, update_mask: update_mask) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use hash object with options + client.set_iam_policy({ resource: resource, policy: policy, update_mask: update_mask }, grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object with options + client.set_iam_policy(::Google::Iam::V1::SetIamPolicyRequest.new(resource: resource, policy: policy, update_mask: update_mask), grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Verify method calls + assert_equal 5, set_iam_policy_client_stub.call_rpc_count + end + end + + def test_test_iam_permissions + # Create GRPC objects. + grpc_response = ::Google::Iam::V1::TestIamPermissionsResponse.new + grpc_operation = GRPC::ActiveCall::Operation.new nil + grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + grpc_options = {} + + # Create request parameters for a unary method. + resource = "hello world" + permissions = ["hello world"] + + test_iam_permissions_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :test_iam_permissions, name + assert_kind_of ::Google::Iam::V1::TestIamPermissionsRequest, request + assert_equal "hello world", request["resource"] + assert_equal ["hello world"], request["permissions"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, test_iam_permissions_client_stub do + # Create client + client = ::Google::Cloud::SecurityCenter::V1::SecurityCenter::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.test_iam_permissions({ resource: resource, permissions: permissions }) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use named arguments + client.test_iam_permissions resource: resource, permissions: permissions do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.test_iam_permissions ::Google::Iam::V1::TestIamPermissionsRequest.new(resource: resource, permissions: permissions) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use hash object with options + client.test_iam_permissions({ resource: resource, permissions: permissions }, grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object with options + client.test_iam_permissions(::Google::Iam::V1::TestIamPermissionsRequest.new(resource: resource, permissions: permissions), grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Verify method calls + assert_equal 5, test_iam_permissions_client_stub.call_rpc_count + end + end + + def test_simulate_security_health_analytics_custom_module + # Create GRPC objects. + grpc_response = ::Google::Cloud::SecurityCenter::V1::SimulateSecurityHealthAnalyticsCustomModuleResponse.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" + custom_config = {} + resource = {} + + simulate_security_health_analytics_custom_module_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :simulate_security_health_analytics_custom_module, name + assert_kind_of ::Google::Cloud::SecurityCenter::V1::SimulateSecurityHealthAnalyticsCustomModuleRequest, request + assert_equal "hello world", request["parent"] + assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::SecurityCenter::V1::CustomConfig), request["custom_config"] + assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::SecurityCenter::V1::SimulateSecurityHealthAnalyticsCustomModuleRequest::SimulatedResource), request["resource"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, simulate_security_health_analytics_custom_module_client_stub do + # Create client + client = ::Google::Cloud::SecurityCenter::V1::SecurityCenter::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.simulate_security_health_analytics_custom_module({ parent: parent, custom_config: custom_config, resource: resource }) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use named arguments + client.simulate_security_health_analytics_custom_module parent: parent, custom_config: custom_config, resource: resource do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.simulate_security_health_analytics_custom_module ::Google::Cloud::SecurityCenter::V1::SimulateSecurityHealthAnalyticsCustomModuleRequest.new(parent: parent, custom_config: custom_config, resource: resource) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use hash object with options + client.simulate_security_health_analytics_custom_module({ parent: parent, custom_config: custom_config, resource: resource }, grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object with options + client.simulate_security_health_analytics_custom_module(::Google::Cloud::SecurityCenter::V1::SimulateSecurityHealthAnalyticsCustomModuleRequest.new(parent: parent, custom_config: custom_config, resource: resource), grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Verify method calls + assert_equal 5, simulate_security_health_analytics_custom_module_client_stub.call_rpc_count + end + end + + def test_update_external_system + # Create GRPC objects. + grpc_response = ::Google::Cloud::SecurityCenter::V1::ExternalSystem.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. + external_system = {} + update_mask = {} + + update_external_system_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :update_external_system, name + assert_kind_of ::Google::Cloud::SecurityCenter::V1::UpdateExternalSystemRequest, request + assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::SecurityCenter::V1::ExternalSystem), request["external_system"] + assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Protobuf::FieldMask), request["update_mask"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, update_external_system_client_stub do + # Create client + client = ::Google::Cloud::SecurityCenter::V1::SecurityCenter::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.update_external_system({ external_system: external_system, update_mask: update_mask }) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use named arguments + client.update_external_system external_system: external_system, update_mask: update_mask do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.update_external_system ::Google::Cloud::SecurityCenter::V1::UpdateExternalSystemRequest.new(external_system: external_system, update_mask: update_mask) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use hash object with options + client.update_external_system({ external_system: external_system, update_mask: update_mask }, grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object with options + client.update_external_system(::Google::Cloud::SecurityCenter::V1::UpdateExternalSystemRequest.new(external_system: external_system, update_mask: update_mask), grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Verify method calls + assert_equal 5, update_external_system_client_stub.call_rpc_count + end + end + + def test_update_finding + # Create GRPC objects. + grpc_response = ::Google::Cloud::SecurityCenter::V1::Finding.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. + finding = {} + update_mask = {} + + update_finding_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :update_finding, name + assert_kind_of ::Google::Cloud::SecurityCenter::V1::UpdateFindingRequest, request + assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::SecurityCenter::V1::Finding), request["finding"] + assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Protobuf::FieldMask), request["update_mask"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, update_finding_client_stub do + # Create client + client = ::Google::Cloud::SecurityCenter::V1::SecurityCenter::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.update_finding({ finding: finding, update_mask: update_mask }) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use named arguments + client.update_finding finding: finding, update_mask: update_mask do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.update_finding ::Google::Cloud::SecurityCenter::V1::UpdateFindingRequest.new(finding: finding, update_mask: update_mask) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use hash object with options + client.update_finding({ finding: finding, update_mask: update_mask }, grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object with options + client.update_finding(::Google::Cloud::SecurityCenter::V1::UpdateFindingRequest.new(finding: finding, update_mask: update_mask), grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Verify method calls + assert_equal 5, update_finding_client_stub.call_rpc_count + end + end + + def test_update_mute_config + # Create GRPC objects. + grpc_response = ::Google::Cloud::SecurityCenter::V1::MuteConfig.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. + mute_config = {} + update_mask = {} + + update_mute_config_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :update_mute_config, name + assert_kind_of ::Google::Cloud::SecurityCenter::V1::UpdateMuteConfigRequest, request + assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::SecurityCenter::V1::MuteConfig), request["mute_config"] + assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Protobuf::FieldMask), request["update_mask"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, update_mute_config_client_stub do + # Create client + client = ::Google::Cloud::SecurityCenter::V1::SecurityCenter::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.update_mute_config({ mute_config: mute_config, update_mask: update_mask }) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use named arguments + client.update_mute_config mute_config: mute_config, update_mask: update_mask do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.update_mute_config ::Google::Cloud::SecurityCenter::V1::UpdateMuteConfigRequest.new(mute_config: mute_config, update_mask: update_mask) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use hash object with options + client.update_mute_config({ mute_config: mute_config, update_mask: update_mask }, grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object with options + client.update_mute_config(::Google::Cloud::SecurityCenter::V1::UpdateMuteConfigRequest.new(mute_config: mute_config, update_mask: update_mask), grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Verify method calls + assert_equal 5, update_mute_config_client_stub.call_rpc_count + end + end + + def test_update_notification_config + # Create GRPC objects. + grpc_response = ::Google::Cloud::SecurityCenter::V1::NotificationConfig.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. + notification_config = {} + update_mask = {} + + update_notification_config_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :update_notification_config, name + assert_kind_of ::Google::Cloud::SecurityCenter::V1::UpdateNotificationConfigRequest, request + assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::SecurityCenter::V1::NotificationConfig), request["notification_config"] + assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Protobuf::FieldMask), request["update_mask"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, update_notification_config_client_stub do + # Create client + client = ::Google::Cloud::SecurityCenter::V1::SecurityCenter::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.update_notification_config({ notification_config: notification_config, update_mask: update_mask }) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use named arguments + client.update_notification_config notification_config: notification_config, update_mask: update_mask do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.update_notification_config ::Google::Cloud::SecurityCenter::V1::UpdateNotificationConfigRequest.new(notification_config: notification_config, update_mask: update_mask) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use hash object with options + client.update_notification_config({ notification_config: notification_config, update_mask: update_mask }, grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object with options + client.update_notification_config(::Google::Cloud::SecurityCenter::V1::UpdateNotificationConfigRequest.new(notification_config: notification_config, update_mask: update_mask), grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Verify method calls + assert_equal 5, update_notification_config_client_stub.call_rpc_count + end + end + + def test_update_organization_settings + # Create GRPC objects. + grpc_response = ::Google::Cloud::SecurityCenter::V1::OrganizationSettings.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. + organization_settings = {} + update_mask = {} + + update_organization_settings_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :update_organization_settings, name + assert_kind_of ::Google::Cloud::SecurityCenter::V1::UpdateOrganizationSettingsRequest, request + assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::SecurityCenter::V1::OrganizationSettings), request["organization_settings"] + assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Protobuf::FieldMask), request["update_mask"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, update_organization_settings_client_stub do + # Create client + client = ::Google::Cloud::SecurityCenter::V1::SecurityCenter::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.update_organization_settings({ organization_settings: organization_settings, update_mask: update_mask }) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use named arguments + client.update_organization_settings organization_settings: organization_settings, update_mask: update_mask do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.update_organization_settings ::Google::Cloud::SecurityCenter::V1::UpdateOrganizationSettingsRequest.new(organization_settings: organization_settings, update_mask: update_mask) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use hash object with options + client.update_organization_settings({ organization_settings: organization_settings, update_mask: update_mask }, grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object with options + client.update_organization_settings(::Google::Cloud::SecurityCenter::V1::UpdateOrganizationSettingsRequest.new(organization_settings: organization_settings, update_mask: update_mask), grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Verify method calls + assert_equal 5, update_organization_settings_client_stub.call_rpc_count + end + end + + def test_update_security_health_analytics_custom_module + # Create GRPC objects. + grpc_response = ::Google::Cloud::SecurityCenter::V1::SecurityHealthAnalyticsCustomModule.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. + security_health_analytics_custom_module = {} + update_mask = {} + + update_security_health_analytics_custom_module_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :update_security_health_analytics_custom_module, name + assert_kind_of ::Google::Cloud::SecurityCenter::V1::UpdateSecurityHealthAnalyticsCustomModuleRequest, request + assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::SecurityCenter::V1::SecurityHealthAnalyticsCustomModule), request["security_health_analytics_custom_module"] + assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Protobuf::FieldMask), request["update_mask"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, update_security_health_analytics_custom_module_client_stub do + # Create client + client = ::Google::Cloud::SecurityCenter::V1::SecurityCenter::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.update_security_health_analytics_custom_module({ security_health_analytics_custom_module: security_health_analytics_custom_module, update_mask: update_mask }) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use named arguments + client.update_security_health_analytics_custom_module security_health_analytics_custom_module: security_health_analytics_custom_module, update_mask: update_mask do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.update_security_health_analytics_custom_module ::Google::Cloud::SecurityCenter::V1::UpdateSecurityHealthAnalyticsCustomModuleRequest.new(security_health_analytics_custom_module: security_health_analytics_custom_module, update_mask: update_mask) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use hash object with options + client.update_security_health_analytics_custom_module({ security_health_analytics_custom_module: security_health_analytics_custom_module, update_mask: update_mask }, grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object with options + client.update_security_health_analytics_custom_module(::Google::Cloud::SecurityCenter::V1::UpdateSecurityHealthAnalyticsCustomModuleRequest.new(security_health_analytics_custom_module: security_health_analytics_custom_module, update_mask: update_mask), grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Verify method calls + assert_equal 5, update_security_health_analytics_custom_module_client_stub.call_rpc_count + end + end + + def test_update_source + # Create GRPC objects. + grpc_response = ::Google::Cloud::SecurityCenter::V1::Source.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. + source = {} + update_mask = {} + + update_source_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :update_source, name + assert_kind_of ::Google::Cloud::SecurityCenter::V1::UpdateSourceRequest, request + assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::SecurityCenter::V1::Source), request["source"] + assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Protobuf::FieldMask), request["update_mask"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, update_source_client_stub do + # Create client + client = ::Google::Cloud::SecurityCenter::V1::SecurityCenter::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.update_source({ source: source, update_mask: update_mask }) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use named arguments + client.update_source source: source, update_mask: update_mask do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.update_source ::Google::Cloud::SecurityCenter::V1::UpdateSourceRequest.new(source: source, update_mask: update_mask) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use hash object with options + client.update_source({ source: source, update_mask: update_mask }, grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object with options + client.update_source(::Google::Cloud::SecurityCenter::V1::UpdateSourceRequest.new(source: source, update_mask: update_mask), grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Verify method calls + assert_equal 5, update_source_client_stub.call_rpc_count + end + end + + def test_update_security_marks + # Create GRPC objects. + grpc_response = ::Google::Cloud::SecurityCenter::V1::SecurityMarks.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. + security_marks = {} + update_mask = {} + start_time = {} + + update_security_marks_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :update_security_marks, name + assert_kind_of ::Google::Cloud::SecurityCenter::V1::UpdateSecurityMarksRequest, request + assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::SecurityCenter::V1::SecurityMarks), request["security_marks"] + assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Protobuf::FieldMask), request["update_mask"] + assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Protobuf::Timestamp), request["start_time"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, update_security_marks_client_stub do + # Create client + client = ::Google::Cloud::SecurityCenter::V1::SecurityCenter::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.update_security_marks({ security_marks: security_marks, update_mask: update_mask, start_time: start_time }) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use named arguments + client.update_security_marks security_marks: security_marks, update_mask: update_mask, start_time: start_time do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.update_security_marks ::Google::Cloud::SecurityCenter::V1::UpdateSecurityMarksRequest.new(security_marks: security_marks, update_mask: update_mask, start_time: start_time) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use hash object with options + client.update_security_marks({ security_marks: security_marks, update_mask: update_mask, start_time: start_time }, grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object with options + client.update_security_marks(::Google::Cloud::SecurityCenter::V1::UpdateSecurityMarksRequest.new(security_marks: security_marks, update_mask: update_mask, start_time: start_time), grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Verify method calls + assert_equal 5, update_security_marks_client_stub.call_rpc_count + end + end + + def test_create_big_query_export + # Create GRPC objects. + grpc_response = ::Google::Cloud::SecurityCenter::V1::BigQueryExport.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" + big_query_export = {} + big_query_export_id = "hello world" + + create_big_query_export_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :create_big_query_export, name + assert_kind_of ::Google::Cloud::SecurityCenter::V1::CreateBigQueryExportRequest, request + assert_equal "hello world", request["parent"] + assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::SecurityCenter::V1::BigQueryExport), request["big_query_export"] + assert_equal "hello world", request["big_query_export_id"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, create_big_query_export_client_stub do + # Create client + client = ::Google::Cloud::SecurityCenter::V1::SecurityCenter::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.create_big_query_export({ parent: parent, big_query_export: big_query_export, big_query_export_id: big_query_export_id }) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use named arguments + client.create_big_query_export parent: parent, big_query_export: big_query_export, big_query_export_id: big_query_export_id do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.create_big_query_export ::Google::Cloud::SecurityCenter::V1::CreateBigQueryExportRequest.new(parent: parent, big_query_export: big_query_export, big_query_export_id: big_query_export_id) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use hash object with options + client.create_big_query_export({ parent: parent, big_query_export: big_query_export, big_query_export_id: big_query_export_id }, grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object with options + client.create_big_query_export(::Google::Cloud::SecurityCenter::V1::CreateBigQueryExportRequest.new(parent: parent, big_query_export: big_query_export, big_query_export_id: big_query_export_id), grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Verify method calls + assert_equal 5, create_big_query_export_client_stub.call_rpc_count + end + end + + def test_delete_big_query_export + # 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_big_query_export_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :delete_big_query_export, name + assert_kind_of ::Google::Cloud::SecurityCenter::V1::DeleteBigQueryExportRequest, request + assert_equal "hello world", request["name"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, delete_big_query_export_client_stub do + # Create client + client = ::Google::Cloud::SecurityCenter::V1::SecurityCenter::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.delete_big_query_export({ name: name }) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use named arguments + client.delete_big_query_export name: name do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.delete_big_query_export ::Google::Cloud::SecurityCenter::V1::DeleteBigQueryExportRequest.new(name: name) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use hash object with options + client.delete_big_query_export({ 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_big_query_export(::Google::Cloud::SecurityCenter::V1::DeleteBigQueryExportRequest.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_big_query_export_client_stub.call_rpc_count + end + end + + def test_update_big_query_export + # Create GRPC objects. + grpc_response = ::Google::Cloud::SecurityCenter::V1::BigQueryExport.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. + big_query_export = {} + update_mask = {} + + update_big_query_export_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :update_big_query_export, name + assert_kind_of ::Google::Cloud::SecurityCenter::V1::UpdateBigQueryExportRequest, request + assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::SecurityCenter::V1::BigQueryExport), request["big_query_export"] + assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Protobuf::FieldMask), request["update_mask"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, update_big_query_export_client_stub do + # Create client + client = ::Google::Cloud::SecurityCenter::V1::SecurityCenter::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.update_big_query_export({ big_query_export: big_query_export, update_mask: update_mask }) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use named arguments + client.update_big_query_export big_query_export: big_query_export, update_mask: update_mask do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.update_big_query_export ::Google::Cloud::SecurityCenter::V1::UpdateBigQueryExportRequest.new(big_query_export: big_query_export, update_mask: update_mask) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use hash object with options + client.update_big_query_export({ big_query_export: big_query_export, update_mask: update_mask }, grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object with options + client.update_big_query_export(::Google::Cloud::SecurityCenter::V1::UpdateBigQueryExportRequest.new(big_query_export: big_query_export, update_mask: update_mask), grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Verify method calls + assert_equal 5, update_big_query_export_client_stub.call_rpc_count + end + end + + def test_list_big_query_exports + # Create GRPC objects. + grpc_response = ::Google::Cloud::SecurityCenter::V1::ListBigQueryExportsResponse.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_big_query_exports_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :list_big_query_exports, name + assert_kind_of ::Google::Cloud::SecurityCenter::V1::ListBigQueryExportsRequest, 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_big_query_exports_client_stub do + # Create client + client = ::Google::Cloud::SecurityCenter::V1::SecurityCenter::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.list_big_query_exports({ 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_big_query_exports 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_big_query_exports ::Google::Cloud::SecurityCenter::V1::ListBigQueryExportsRequest.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_big_query_exports({ 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_big_query_exports(::Google::Cloud::SecurityCenter::V1::ListBigQueryExportsRequest.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_big_query_exports_client_stub.call_rpc_count + end + end + + def test_create_event_threat_detection_custom_module + # Create GRPC objects. + grpc_response = ::Google::Cloud::SecurityCenter::V1::EventThreatDetectionCustomModule.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" + event_threat_detection_custom_module = {} + + create_event_threat_detection_custom_module_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :create_event_threat_detection_custom_module, name + assert_kind_of ::Google::Cloud::SecurityCenter::V1::CreateEventThreatDetectionCustomModuleRequest, request + assert_equal "hello world", request["parent"] + assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::SecurityCenter::V1::EventThreatDetectionCustomModule), request["event_threat_detection_custom_module"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, create_event_threat_detection_custom_module_client_stub do + # Create client + client = ::Google::Cloud::SecurityCenter::V1::SecurityCenter::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.create_event_threat_detection_custom_module({ parent: parent, event_threat_detection_custom_module: event_threat_detection_custom_module }) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use named arguments + client.create_event_threat_detection_custom_module parent: parent, event_threat_detection_custom_module: event_threat_detection_custom_module do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.create_event_threat_detection_custom_module ::Google::Cloud::SecurityCenter::V1::CreateEventThreatDetectionCustomModuleRequest.new(parent: parent, event_threat_detection_custom_module: event_threat_detection_custom_module) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use hash object with options + client.create_event_threat_detection_custom_module({ parent: parent, event_threat_detection_custom_module: event_threat_detection_custom_module }, grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object with options + client.create_event_threat_detection_custom_module(::Google::Cloud::SecurityCenter::V1::CreateEventThreatDetectionCustomModuleRequest.new(parent: parent, event_threat_detection_custom_module: event_threat_detection_custom_module), grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Verify method calls + assert_equal 5, create_event_threat_detection_custom_module_client_stub.call_rpc_count + end + end + + def test_delete_event_threat_detection_custom_module + # 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_event_threat_detection_custom_module_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :delete_event_threat_detection_custom_module, name + assert_kind_of ::Google::Cloud::SecurityCenter::V1::DeleteEventThreatDetectionCustomModuleRequest, request + assert_equal "hello world", request["name"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, delete_event_threat_detection_custom_module_client_stub do + # Create client + client = ::Google::Cloud::SecurityCenter::V1::SecurityCenter::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.delete_event_threat_detection_custom_module({ name: name }) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use named arguments + client.delete_event_threat_detection_custom_module name: name do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.delete_event_threat_detection_custom_module ::Google::Cloud::SecurityCenter::V1::DeleteEventThreatDetectionCustomModuleRequest.new(name: name) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use hash object with options + client.delete_event_threat_detection_custom_module({ 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_event_threat_detection_custom_module(::Google::Cloud::SecurityCenter::V1::DeleteEventThreatDetectionCustomModuleRequest.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_event_threat_detection_custom_module_client_stub.call_rpc_count + end + end + + def test_get_event_threat_detection_custom_module + # Create GRPC objects. + grpc_response = ::Google::Cloud::SecurityCenter::V1::EventThreatDetectionCustomModule.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_event_threat_detection_custom_module_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :get_event_threat_detection_custom_module, name + assert_kind_of ::Google::Cloud::SecurityCenter::V1::GetEventThreatDetectionCustomModuleRequest, request + assert_equal "hello world", request["name"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, get_event_threat_detection_custom_module_client_stub do + # Create client + client = ::Google::Cloud::SecurityCenter::V1::SecurityCenter::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.get_event_threat_detection_custom_module({ name: name }) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use named arguments + client.get_event_threat_detection_custom_module name: name do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.get_event_threat_detection_custom_module ::Google::Cloud::SecurityCenter::V1::GetEventThreatDetectionCustomModuleRequest.new(name: name) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use hash object with options + client.get_event_threat_detection_custom_module({ 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_event_threat_detection_custom_module(::Google::Cloud::SecurityCenter::V1::GetEventThreatDetectionCustomModuleRequest.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_event_threat_detection_custom_module_client_stub.call_rpc_count + end + end + + def test_list_descendant_event_threat_detection_custom_modules + # Create GRPC objects. + grpc_response = ::Google::Cloud::SecurityCenter::V1::ListDescendantEventThreatDetectionCustomModulesResponse.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_token = "hello world" + page_size = 42 + + list_descendant_event_threat_detection_custom_modules_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :list_descendant_event_threat_detection_custom_modules, name + assert_kind_of ::Google::Cloud::SecurityCenter::V1::ListDescendantEventThreatDetectionCustomModulesRequest, request + assert_equal "hello world", request["parent"] + assert_equal "hello world", request["page_token"] + assert_equal 42, request["page_size"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, list_descendant_event_threat_detection_custom_modules_client_stub do + # Create client + client = ::Google::Cloud::SecurityCenter::V1::SecurityCenter::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.list_descendant_event_threat_detection_custom_modules({ parent: parent, page_token: page_token, page_size: page_size }) 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_descendant_event_threat_detection_custom_modules parent: parent, page_token: page_token, page_size: page_size 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_descendant_event_threat_detection_custom_modules ::Google::Cloud::SecurityCenter::V1::ListDescendantEventThreatDetectionCustomModulesRequest.new(parent: parent, page_token: page_token, page_size: page_size) 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_descendant_event_threat_detection_custom_modules({ parent: parent, page_token: page_token, page_size: page_size }, 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_descendant_event_threat_detection_custom_modules(::Google::Cloud::SecurityCenter::V1::ListDescendantEventThreatDetectionCustomModulesRequest.new(parent: parent, page_token: page_token, page_size: page_size), 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_descendant_event_threat_detection_custom_modules_client_stub.call_rpc_count + end + end + + def test_list_event_threat_detection_custom_modules + # Create GRPC objects. + grpc_response = ::Google::Cloud::SecurityCenter::V1::ListEventThreatDetectionCustomModulesResponse.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_token = "hello world" + page_size = 42 + + list_event_threat_detection_custom_modules_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :list_event_threat_detection_custom_modules, name + assert_kind_of ::Google::Cloud::SecurityCenter::V1::ListEventThreatDetectionCustomModulesRequest, request + assert_equal "hello world", request["parent"] + assert_equal "hello world", request["page_token"] + assert_equal 42, request["page_size"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, list_event_threat_detection_custom_modules_client_stub do + # Create client + client = ::Google::Cloud::SecurityCenter::V1::SecurityCenter::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.list_event_threat_detection_custom_modules({ parent: parent, page_token: page_token, page_size: page_size }) 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_event_threat_detection_custom_modules parent: parent, page_token: page_token, page_size: page_size 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_event_threat_detection_custom_modules ::Google::Cloud::SecurityCenter::V1::ListEventThreatDetectionCustomModulesRequest.new(parent: parent, page_token: page_token, page_size: page_size) 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_event_threat_detection_custom_modules({ parent: parent, page_token: page_token, page_size: page_size }, 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_event_threat_detection_custom_modules(::Google::Cloud::SecurityCenter::V1::ListEventThreatDetectionCustomModulesRequest.new(parent: parent, page_token: page_token, page_size: page_size), 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_event_threat_detection_custom_modules_client_stub.call_rpc_count + end + end + + def test_update_event_threat_detection_custom_module + # Create GRPC objects. + grpc_response = ::Google::Cloud::SecurityCenter::V1::EventThreatDetectionCustomModule.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. + event_threat_detection_custom_module = {} + update_mask = {} + + update_event_threat_detection_custom_module_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :update_event_threat_detection_custom_module, name + assert_kind_of ::Google::Cloud::SecurityCenter::V1::UpdateEventThreatDetectionCustomModuleRequest, request + assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::SecurityCenter::V1::EventThreatDetectionCustomModule), request["event_threat_detection_custom_module"] + assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Protobuf::FieldMask), request["update_mask"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, update_event_threat_detection_custom_module_client_stub do + # Create client + client = ::Google::Cloud::SecurityCenter::V1::SecurityCenter::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.update_event_threat_detection_custom_module({ event_threat_detection_custom_module: event_threat_detection_custom_module, update_mask: update_mask }) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use named arguments + client.update_event_threat_detection_custom_module event_threat_detection_custom_module: event_threat_detection_custom_module, update_mask: update_mask do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.update_event_threat_detection_custom_module ::Google::Cloud::SecurityCenter::V1::UpdateEventThreatDetectionCustomModuleRequest.new(event_threat_detection_custom_module: event_threat_detection_custom_module, update_mask: update_mask) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use hash object with options + client.update_event_threat_detection_custom_module({ event_threat_detection_custom_module: event_threat_detection_custom_module, update_mask: update_mask }, grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object with options + client.update_event_threat_detection_custom_module(::Google::Cloud::SecurityCenter::V1::UpdateEventThreatDetectionCustomModuleRequest.new(event_threat_detection_custom_module: event_threat_detection_custom_module, update_mask: update_mask), grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Verify method calls + assert_equal 5, update_event_threat_detection_custom_module_client_stub.call_rpc_count + end + end + + def test_validate_event_threat_detection_custom_module + # Create GRPC objects. + grpc_response = ::Google::Cloud::SecurityCenter::V1::ValidateEventThreatDetectionCustomModuleResponse.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" + raw_text = "hello world" + type = "hello world" + + validate_event_threat_detection_custom_module_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :validate_event_threat_detection_custom_module, name + assert_kind_of ::Google::Cloud::SecurityCenter::V1::ValidateEventThreatDetectionCustomModuleRequest, request + assert_equal "hello world", request["parent"] + assert_equal "hello world", request["raw_text"] + assert_equal "hello world", request["type"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, validate_event_threat_detection_custom_module_client_stub do + # Create client + client = ::Google::Cloud::SecurityCenter::V1::SecurityCenter::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.validate_event_threat_detection_custom_module({ parent: parent, raw_text: raw_text, type: type }) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use named arguments + client.validate_event_threat_detection_custom_module parent: parent, raw_text: raw_text, type: type do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.validate_event_threat_detection_custom_module ::Google::Cloud::SecurityCenter::V1::ValidateEventThreatDetectionCustomModuleRequest.new(parent: parent, raw_text: raw_text, type: type) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use hash object with options + client.validate_event_threat_detection_custom_module({ parent: parent, raw_text: raw_text, type: type }, grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object with options + client.validate_event_threat_detection_custom_module(::Google::Cloud::SecurityCenter::V1::ValidateEventThreatDetectionCustomModuleRequest.new(parent: parent, raw_text: raw_text, type: type), grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Verify method calls + assert_equal 5, validate_event_threat_detection_custom_module_client_stub.call_rpc_count + end + end + + def test_get_effective_event_threat_detection_custom_module + # Create GRPC objects. + grpc_response = ::Google::Cloud::SecurityCenter::V1::EffectiveEventThreatDetectionCustomModule.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_effective_event_threat_detection_custom_module_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :get_effective_event_threat_detection_custom_module, name + assert_kind_of ::Google::Cloud::SecurityCenter::V1::GetEffectiveEventThreatDetectionCustomModuleRequest, request + assert_equal "hello world", request["name"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, get_effective_event_threat_detection_custom_module_client_stub do + # Create client + client = ::Google::Cloud::SecurityCenter::V1::SecurityCenter::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.get_effective_event_threat_detection_custom_module({ name: name }) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use named arguments + client.get_effective_event_threat_detection_custom_module name: name do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.get_effective_event_threat_detection_custom_module ::Google::Cloud::SecurityCenter::V1::GetEffectiveEventThreatDetectionCustomModuleRequest.new(name: name) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use hash object with options + client.get_effective_event_threat_detection_custom_module({ 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_effective_event_threat_detection_custom_module(::Google::Cloud::SecurityCenter::V1::GetEffectiveEventThreatDetectionCustomModuleRequest.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_effective_event_threat_detection_custom_module_client_stub.call_rpc_count + end + end + + def test_list_effective_event_threat_detection_custom_modules + # Create GRPC objects. + grpc_response = ::Google::Cloud::SecurityCenter::V1::ListEffectiveEventThreatDetectionCustomModulesResponse.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_token = "hello world" + page_size = 42 + + list_effective_event_threat_detection_custom_modules_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :list_effective_event_threat_detection_custom_modules, name + assert_kind_of ::Google::Cloud::SecurityCenter::V1::ListEffectiveEventThreatDetectionCustomModulesRequest, request + assert_equal "hello world", request["parent"] + assert_equal "hello world", request["page_token"] + assert_equal 42, request["page_size"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, list_effective_event_threat_detection_custom_modules_client_stub do + # Create client + client = ::Google::Cloud::SecurityCenter::V1::SecurityCenter::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.list_effective_event_threat_detection_custom_modules({ parent: parent, page_token: page_token, page_size: page_size }) 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_effective_event_threat_detection_custom_modules parent: parent, page_token: page_token, page_size: page_size 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_effective_event_threat_detection_custom_modules ::Google::Cloud::SecurityCenter::V1::ListEffectiveEventThreatDetectionCustomModulesRequest.new(parent: parent, page_token: page_token, page_size: page_size) 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_effective_event_threat_detection_custom_modules({ parent: parent, page_token: page_token, page_size: page_size }, 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_effective_event_threat_detection_custom_modules(::Google::Cloud::SecurityCenter::V1::ListEffectiveEventThreatDetectionCustomModulesRequest.new(parent: parent, page_token: page_token, page_size: page_size), 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_effective_event_threat_detection_custom_modules_client_stub.call_rpc_count + end + end + + def test_batch_create_resource_value_configs + # Create GRPC objects. + grpc_response = ::Google::Cloud::SecurityCenter::V1::BatchCreateResourceValueConfigsResponse.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" + requests = [{}] + + batch_create_resource_value_configs_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :batch_create_resource_value_configs, name + assert_kind_of ::Google::Cloud::SecurityCenter::V1::BatchCreateResourceValueConfigsRequest, request + assert_equal "hello world", request["parent"] + assert_kind_of ::Google::Cloud::SecurityCenter::V1::CreateResourceValueConfigRequest, request["requests"].first + refute_nil options + end + + Gapic::ServiceStub.stub :new, batch_create_resource_value_configs_client_stub do + # Create client + client = ::Google::Cloud::SecurityCenter::V1::SecurityCenter::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.batch_create_resource_value_configs({ parent: parent, requests: requests }) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use named arguments + client.batch_create_resource_value_configs parent: parent, requests: requests do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.batch_create_resource_value_configs ::Google::Cloud::SecurityCenter::V1::BatchCreateResourceValueConfigsRequest.new(parent: parent, requests: requests) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use hash object with options + client.batch_create_resource_value_configs({ parent: parent, requests: requests }, grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object with options + client.batch_create_resource_value_configs(::Google::Cloud::SecurityCenter::V1::BatchCreateResourceValueConfigsRequest.new(parent: parent, requests: requests), grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Verify method calls + assert_equal 5, batch_create_resource_value_configs_client_stub.call_rpc_count + end + end + + def test_delete_resource_value_config + # 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_resource_value_config_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :delete_resource_value_config, name + assert_kind_of ::Google::Cloud::SecurityCenter::V1::DeleteResourceValueConfigRequest, request + assert_equal "hello world", request["name"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, delete_resource_value_config_client_stub do + # Create client + client = ::Google::Cloud::SecurityCenter::V1::SecurityCenter::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.delete_resource_value_config({ name: name }) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use named arguments + client.delete_resource_value_config name: name do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.delete_resource_value_config ::Google::Cloud::SecurityCenter::V1::DeleteResourceValueConfigRequest.new(name: name) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use hash object with options + client.delete_resource_value_config({ name: name }, grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object with options + client.delete_resource_value_config(::Google::Cloud::SecurityCenter::V1::DeleteResourceValueConfigRequest.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_resource_value_config_client_stub.call_rpc_count + end + end + + def test_get_resource_value_config + # Create GRPC objects. + grpc_response = ::Google::Cloud::SecurityCenter::V1::ResourceValueConfig.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_resource_value_config_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :get_resource_value_config, name + assert_kind_of ::Google::Cloud::SecurityCenter::V1::GetResourceValueConfigRequest, request + assert_equal "hello world", request["name"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, get_resource_value_config_client_stub do + # Create client + client = ::Google::Cloud::SecurityCenter::V1::SecurityCenter::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.get_resource_value_config({ name: name }) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use named arguments + client.get_resource_value_config name: name do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.get_resource_value_config ::Google::Cloud::SecurityCenter::V1::GetResourceValueConfigRequest.new(name: name) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use hash object with options + client.get_resource_value_config({ name: name }, grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object with options + client.get_resource_value_config(::Google::Cloud::SecurityCenter::V1::GetResourceValueConfigRequest.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_resource_value_config_client_stub.call_rpc_count + end + end + + def test_list_resource_value_configs + # Create GRPC objects. + grpc_response = ::Google::Cloud::SecurityCenter::V1::ListResourceValueConfigsResponse.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_resource_value_configs_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :list_resource_value_configs, name + assert_kind_of ::Google::Cloud::SecurityCenter::V1::ListResourceValueConfigsRequest, 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_resource_value_configs_client_stub do + # Create client + client = ::Google::Cloud::SecurityCenter::V1::SecurityCenter::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.list_resource_value_configs({ 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_resource_value_configs 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_resource_value_configs ::Google::Cloud::SecurityCenter::V1::ListResourceValueConfigsRequest.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_resource_value_configs({ 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_resource_value_configs(::Google::Cloud::SecurityCenter::V1::ListResourceValueConfigsRequest.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_resource_value_configs_client_stub.call_rpc_count + end + end + + def test_update_resource_value_config + # Create GRPC objects. + grpc_response = ::Google::Cloud::SecurityCenter::V1::ResourceValueConfig.new + grpc_operation = GRPC::ActiveCall::Operation.new nil + grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + grpc_options = {} + + # Create request parameters for a unary method. + resource_value_config = {} + update_mask = {} + + update_resource_value_config_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :update_resource_value_config, name + assert_kind_of ::Google::Cloud::SecurityCenter::V1::UpdateResourceValueConfigRequest, request + assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::SecurityCenter::V1::ResourceValueConfig), request["resource_value_config"] + assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Protobuf::FieldMask), request["update_mask"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, update_resource_value_config_client_stub do + # Create client + client = ::Google::Cloud::SecurityCenter::V1::SecurityCenter::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.update_resource_value_config({ resource_value_config: resource_value_config, update_mask: update_mask }) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use named arguments + client.update_resource_value_config resource_value_config: resource_value_config, update_mask: update_mask do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.update_resource_value_config ::Google::Cloud::SecurityCenter::V1::UpdateResourceValueConfigRequest.new(resource_value_config: resource_value_config, update_mask: update_mask) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use hash object with options + client.update_resource_value_config({ resource_value_config: resource_value_config, update_mask: update_mask }, grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object with options + client.update_resource_value_config(::Google::Cloud::SecurityCenter::V1::UpdateResourceValueConfigRequest.new(resource_value_config: resource_value_config, update_mask: update_mask), grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Verify method calls + assert_equal 5, update_resource_value_config_client_stub.call_rpc_count + end + end + + def test_list_valued_resources + # Create GRPC objects. + grpc_response = ::Google::Cloud::SecurityCenter::V1::ListValuedResourcesResponse.new + grpc_operation = GRPC::ActiveCall::Operation.new nil + grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + grpc_options = {} + + # Create request parameters for a unary method. + parent = "hello world" + filter = "hello world" + page_token = "hello world" + page_size = 42 + order_by = "hello world" + + list_valued_resources_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :list_valued_resources, name + assert_kind_of ::Google::Cloud::SecurityCenter::V1::ListValuedResourcesRequest, request + assert_equal "hello world", request["parent"] + assert_equal "hello world", request["filter"] + assert_equal "hello world", request["page_token"] + assert_equal 42, request["page_size"] + assert_equal "hello world", request["order_by"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, list_valued_resources_client_stub do + # Create client + client = ::Google::Cloud::SecurityCenter::V1::SecurityCenter::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.list_valued_resources({ parent: parent, filter: filter, page_token: page_token, page_size: page_size, order_by: order_by }) 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_valued_resources parent: parent, filter: filter, page_token: page_token, page_size: page_size, order_by: order_by 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_valued_resources ::Google::Cloud::SecurityCenter::V1::ListValuedResourcesRequest.new(parent: parent, filter: filter, page_token: page_token, page_size: page_size, order_by: order_by) 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_valued_resources({ parent: parent, filter: filter, page_token: page_token, page_size: page_size, order_by: order_by }, 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_valued_resources(::Google::Cloud::SecurityCenter::V1::ListValuedResourcesRequest.new(parent: parent, filter: filter, page_token: page_token, page_size: page_size, order_by: order_by), 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_valued_resources_client_stub.call_rpc_count + end + end + + def test_list_attack_paths + # Create GRPC objects. + grpc_response = ::Google::Cloud::SecurityCenter::V1::ListAttackPathsResponse.new + grpc_operation = GRPC::ActiveCall::Operation.new nil + grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + grpc_options = {} + + # Create request parameters for a unary method. + parent = "hello world" + filter = "hello world" + page_token = "hello world" + page_size = 42 + + list_attack_paths_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :list_attack_paths, name + assert_kind_of ::Google::Cloud::SecurityCenter::V1::ListAttackPathsRequest, request + assert_equal "hello world", request["parent"] + assert_equal "hello world", request["filter"] + assert_equal "hello world", request["page_token"] + assert_equal 42, request["page_size"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, list_attack_paths_client_stub do + # Create client + client = ::Google::Cloud::SecurityCenter::V1::SecurityCenter::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.list_attack_paths({ parent: parent, filter: filter, page_token: page_token, page_size: page_size }) 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_attack_paths parent: parent, filter: filter, page_token: page_token, page_size: page_size 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_attack_paths ::Google::Cloud::SecurityCenter::V1::ListAttackPathsRequest.new(parent: parent, filter: filter, page_token: page_token, page_size: page_size) 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_attack_paths({ parent: parent, filter: filter, page_token: page_token, page_size: page_size }, 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_attack_paths(::Google::Cloud::SecurityCenter::V1::ListAttackPathsRequest.new(parent: parent, filter: filter, page_token: page_token, page_size: page_size), 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_attack_paths_client_stub.call_rpc_count + end + end + + def test_configure + grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + + client = block_config = config = nil + dummy_stub = ClientStub.new nil, nil + Gapic::ServiceStub.stub :new, dummy_stub do + client = ::Google::Cloud::SecurityCenter::V1::SecurityCenter::Client.new do |config| + config.credentials = grpc_channel + end + end + + config = client.configure do |c| + block_config = c + end + + assert_same block_config, config + assert_kind_of ::Google::Cloud::SecurityCenter::V1::SecurityCenter::Client::Configuration, config + end + + def test_credentials + key = OpenSSL::PKey::RSA.new 2048 + cred_json = { + "private_key" => key.to_pem, + "client_email" => "app@developer.gserviceaccount.com", + "type" => "service_account" + } + key_file = StringIO.new cred_json.to_json + creds = Google::Auth::ServiceAccountCredentials.make_creds({ json_key_io: key_file }) + + dummy_stub = ClientStub.new nil, nil + Gapic::ServiceStub.stub :new, dummy_stub do + client = ::Google::Cloud::SecurityCenter::V1::SecurityCenter::Client.new do |config| + config.credentials = creds + end + assert_kind_of ::Google::Cloud::SecurityCenter::V1::SecurityCenter::Client, client + assert_equal creds, client.configure.credentials + end + end + + def test_operations_client + grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + + client = nil + dummy_stub = ClientStub.new nil, nil + Gapic::ServiceStub.stub :new, dummy_stub do + client = ::Google::Cloud::SecurityCenter::V1::SecurityCenter::Client.new do |config| + config.credentials = grpc_channel + end + end + + assert_kind_of ::Google::Cloud::SecurityCenter::V1::SecurityCenter::Operations, client.operations_client + end +end diff --git a/owl-bot-staging/google-cloud-security_center-v1/test/helper.rb b/owl-bot-staging/google-cloud-security_center-v1/test/helper.rb new file mode 100644 index 000000000000..672b337030e7 --- /dev/null +++ b/owl-bot-staging/google-cloud-security_center-v1/test/helper.rb @@ -0,0 +1,26 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +require "minitest/autorun" +require "minitest/focus" +require "minitest/mock" +require "minitest/rg" + +require "grpc" + +require "ostruct" diff --git a/owl-bot-staging/google-cloud-security_center-v1p1beta1/.gitignore b/owl-bot-staging/google-cloud-security_center-v1p1beta1/.gitignore new file mode 100644 index 000000000000..0135b6bc6cfc --- /dev/null +++ b/owl-bot-staging/google-cloud-security_center-v1p1beta1/.gitignore @@ -0,0 +1,22 @@ +# Ignore bundler lockfiles +Gemfile.lock +gems.locked + +# Ignore documentation output +doc/* +.yardoc/* + +# Ignore test output +coverage/* + +# Ignore build artifacts +pkg/* + +# Ignore files commonly present in certain dev environments +.vagrant +.DS_STORE +.idea +*.iml + +# Ignore synth output +__pycache__ diff --git a/owl-bot-staging/google-cloud-security_center-v1p1beta1/.repo-metadata.json b/owl-bot-staging/google-cloud-security_center-v1p1beta1/.repo-metadata.json new file mode 100644 index 000000000000..a20578f7275e --- /dev/null +++ b/owl-bot-staging/google-cloud-security_center-v1p1beta1/.repo-metadata.json @@ -0,0 +1,18 @@ +{ + "api_id": "securitycenter.googleapis.com", + "api_shortname": "securitycenter", + "client_documentation": "https://cloud.google.com/ruby/docs/reference/google-cloud-security_center-v1p1beta1/latest", + "distribution_name": "google-cloud-security_center-v1p1beta1", + "is_cloud": true, + "language": "ruby", + "name": "securitycenter", + "name_pretty": "Cloud Security Command Center V1p1beta1 API", + "product_documentation": "https://cloud.google.com/security-command-center", + "release_level": "unreleased", + "repo": "googleapis/google-cloud-ruby", + "requires_billing": true, + "ruby-cloud-description": "Security Command Center API provides access to temporal views of assets and findings within an organization. Note that google-cloud-security_center-v1p1beta1 is a version-specific client library. For most uses, we recommend installing the main client library google-cloud-security_center instead. See the readme for more details.", + "ruby-cloud-env-prefix": "SECURITY_CENTER", + "ruby-cloud-product-url": "https://cloud.google.com/security-command-center", + "library_type": "GAPIC_AUTO" +} diff --git a/owl-bot-staging/google-cloud-security_center-v1p1beta1/.rubocop.yml b/owl-bot-staging/google-cloud-security_center-v1p1beta1/.rubocop.yml new file mode 100644 index 000000000000..83496958be62 --- /dev/null +++ b/owl-bot-staging/google-cloud-security_center-v1p1beta1/.rubocop.yml @@ -0,0 +1,33 @@ +inherit_gem: + google-style: google-style.yml + +AllCops: + Exclude: + - "google-cloud-security_center-v1p1beta1.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-security_center-v1p1beta1.rb" diff --git a/owl-bot-staging/google-cloud-security_center-v1p1beta1/.toys.rb b/owl-bot-staging/google-cloud-security_center-v1p1beta1/.toys.rb new file mode 100644 index 000000000000..177e22456e8a --- /dev/null +++ b/owl-bot-staging/google-cloud-security_center-v1p1beta1/.toys.rb @@ -0,0 +1,28 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +toys_version! ">= 0.15.3" + +if ENV["RUBY_COMMON_TOOLS"] + common_tools_dir = File.expand_path ENV["RUBY_COMMON_TOOLS"] + load File.join(common_tools_dir, "toys", "gapic") +else + load_git remote: "https://github.com/googleapis/ruby-common-tools.git", + path: "toys/gapic", + update: true +end diff --git a/owl-bot-staging/google-cloud-security_center-v1p1beta1/.yardopts b/owl-bot-staging/google-cloud-security_center-v1p1beta1/.yardopts new file mode 100644 index 000000000000..ebd7730f355a --- /dev/null +++ b/owl-bot-staging/google-cloud-security_center-v1p1beta1/.yardopts @@ -0,0 +1,12 @@ +--no-private +--title="Cloud Security Command Center V1p1beta1 API" +--exclude _pb\.rb$ +--markup markdown +--markup-provider redcarpet + +./lib/**/*.rb +./proto_docs/**/*.rb +- +README.md +LICENSE.md +AUTHENTICATION.md diff --git a/owl-bot-staging/google-cloud-security_center-v1p1beta1/AUTHENTICATION.md b/owl-bot-staging/google-cloud-security_center-v1p1beta1/AUTHENTICATION.md new file mode 100644 index 000000000000..3e145a9570e2 --- /dev/null +++ b/owl-bot-staging/google-cloud-security_center-v1p1beta1/AUTHENTICATION.md @@ -0,0 +1,122 @@ +# Authentication + +The recommended way to authenticate to the google-cloud-security_center-v1p1beta1 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-security_center-v1p1beta1 library provides several mechanisms to configure your system. +Generally, using Application Default Credentials to facilitate automatic +credentials discovery is the easist method. But if you need to explicitly specify +credentials, there are several methods available to you. + +Credentials are accepted in the following ways, in the following order or precedence: + +1. Credentials specified in method arguments +2. Credentials specified in configuration +3. Credentials pointed to or included in environment variables +4. Credentials found in local ADC file +5. Credentials returned by the metadata server for the attached service account (GCP) + +### Configuration + +You can configure a path to a JSON credentials file, either for an individual client object or +globally, for all client objects. The JSON file can contain credentials created for +[workload identity federation](https://cloud.google.com/iam/docs/workload-identity-federation), +[workforce identity federation](https://cloud.google.com/iam/docs/workforce-identity-federation), or a +[service account key](https://cloud.google.com/docs/authentication/provide-credentials-adc#local-key). + +Note: Service account keys are a security risk if not managed correctly. You should +[choose a more secure alternative to service account keys](https://cloud.google.com/docs/authentication#auth-decision-tree) +whenever possible. + +To configure a credentials file for an individual client initialization: + +```ruby +require "google/cloud/security_center/v1p1beta1" + +client = ::Google::Cloud::SecurityCenter::V1p1beta1::SecurityCenter::Client.new do |config| + config.credentials = "path/to/credentialfile.json" +end +``` + +To configure a credentials file globally for all clients: + +```ruby +require "google/cloud/security_center/v1p1beta1" + +::Google::Cloud::SecurityCenter::V1p1beta1::SecurityCenter::Client.configure do |config| + config.credentials = "path/to/credentialfile.json" +end + +client = ::Google::Cloud::SecurityCenter::V1p1beta1::SecurityCenter::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-security_center-v1p1beta1 +checks for credentials are: + +* `GOOGLE_CLOUD_CREDENTIALS` - Path to JSON file, or JSON contents +* `GOOGLE_APPLICATION_CREDENTIALS` - Path to JSON file + +```ruby +require "google/cloud/security_center/v1p1beta1" + +ENV["GOOGLE_APPLICATION_CREDENTIALS"] = "path/to/credentialfile.json" + +client = ::Google::Cloud::SecurityCenter::V1p1beta1::SecurityCenter::Client.new +``` + +### Local ADC file + +You can set up a local ADC file with your user credentials for authentication during +development. If credentials are not provided in code or in environment variables, +then the local ADC credentials are discovered. + +Follow the steps in [Quickstart](#quickstart) to set up a local ADC file. + +### Google Cloud Platform environments + +When running on Google Cloud Platform (GCP), including Google Compute Engine +(GCE), Google Kubernetes Engine (GKE), Google App Engine (GAE), Google Cloud +Functions (GCF) and Cloud Run, credentials are retrieved from the attached +service account automatically. Code should be written as if already authenticated. + +For more information, see +[Set up ADC for Google Cloud services](https://cloud.google.com/docs/authentication/provide-credentials-adc#attached-sa). diff --git a/owl-bot-staging/google-cloud-security_center-v1p1beta1/CHANGELOG.md b/owl-bot-staging/google-cloud-security_center-v1p1beta1/CHANGELOG.md new file mode 100644 index 000000000000..f88957a62ba2 --- /dev/null +++ b/owl-bot-staging/google-cloud-security_center-v1p1beta1/CHANGELOG.md @@ -0,0 +1,2 @@ +# Release History + diff --git a/owl-bot-staging/google-cloud-security_center-v1p1beta1/Gemfile b/owl-bot-staging/google-cloud-security_center-v1p1beta1/Gemfile new file mode 100644 index 000000000000..1d08558908d8 --- /dev/null +++ b/owl-bot-staging/google-cloud-security_center-v1p1beta1/Gemfile @@ -0,0 +1,14 @@ +source "https://rubygems.org" + +gemspec + +gem "google-style", "~> 1.32.0" +gem "irb", "~> 1.17" +gem "minitest", "~> 6.0.2" +gem "minitest-focus", "~> 1.4" +gem "minitest-mock", "~> 5.27" +gem "minitest-rg", "~> 5.3" +gem "ostruct", "~> 0.5.5" +gem "rake", ">= 13.0" +gem "redcarpet", "~> 3.6" +gem "yard", "~> 0.9" diff --git a/owl-bot-staging/google-cloud-security_center-v1p1beta1/LICENSE.md b/owl-bot-staging/google-cloud-security_center-v1p1beta1/LICENSE.md new file mode 100644 index 000000000000..c261857ba6ad --- /dev/null +++ b/owl-bot-staging/google-cloud-security_center-v1p1beta1/LICENSE.md @@ -0,0 +1,201 @@ + Apache License + Version 2.0, January 2004 + http://www.apache.org/licenses/ + + TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION + + 1. Definitions. + + "License" shall mean the terms and conditions for use, reproduction, + and distribution as defined by Sections 1 through 9 of this document. + + "Licensor" shall mean the copyright owner or entity authorized by + the copyright owner that is granting the License. + + "Legal Entity" shall mean the union of the acting entity and all + other entities that control, are controlled by, or are under common + control with that entity. For the purposes of this definition, + "control" means (i) the power, direct or indirect, to cause the + direction or management of such entity, whether by contract or + otherwise, or (ii) ownership of fifty percent (50%) or more of the + outstanding shares, or (iii) beneficial ownership of such entity. + + "You" (or "Your") shall mean an individual or Legal Entity + exercising permissions granted by this License. + + "Source" form shall mean the preferred form for making modifications, + including but not limited to software source code, documentation + source, and configuration files. + + "Object" form shall mean any form resulting from mechanical + transformation or translation of a Source form, including but + not limited to compiled object code, generated documentation, + and conversions to other media types. + + "Work" shall mean the work of authorship, whether in Source or + Object form, made available under the License, as indicated by a + copyright notice that is included in or attached to the work + (an example is provided in the Appendix below). + + "Derivative Works" shall mean any work, whether in Source or Object + form, that is based on (or derived from) the Work and for which the + editorial revisions, annotations, elaborations, or other modifications + represent, as a whole, an original work of authorship. For the purposes + of this License, Derivative Works shall not include works that remain + separable from, or merely link (or bind by name) to the interfaces of, + the Work and Derivative Works thereof. + + "Contribution" shall mean any work of authorship, including + the original version of the Work and any modifications or additions + to that Work or Derivative Works thereof, that is intentionally + submitted to Licensor for inclusion in the Work by the copyright owner + or by an individual or Legal Entity authorized to submit on behalf of + the copyright owner. For the purposes of this definition, "submitted" + means any form of electronic, verbal, or written communication sent + to the Licensor or its representatives, including but not limited to + communication on electronic mailing lists, source code control systems, + and issue tracking systems that are managed by, or on behalf of, the + Licensor for the purpose of discussing and improving the Work, but + excluding communication that is conspicuously marked or otherwise + designated in writing by the copyright owner as "Not a Contribution." + + "Contributor" shall mean Licensor and any individual or Legal Entity + on behalf of whom a Contribution has been received by Licensor and + subsequently incorporated within the Work. + + 2. Grant of Copyright License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + copyright license to reproduce, prepare Derivative Works of, + publicly display, publicly perform, sublicense, and distribute the + Work and such Derivative Works in Source or Object form. + + 3. Grant of Patent License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + (except as stated in this section) patent license to make, have made, + use, offer to sell, sell, import, and otherwise transfer the Work, + where such license applies only to those patent claims licensable + by such Contributor that are necessarily infringed by their + Contribution(s) alone or by combination of their Contribution(s) + with the Work to which such Contribution(s) was submitted. If You + institute patent litigation against any entity (including a + cross-claim or counterclaim in a lawsuit) alleging that the Work + or a Contribution incorporated within the Work constitutes direct + or contributory patent infringement, then any patent licenses + granted to You under this License for that Work shall terminate + as of the date such litigation is filed. + + 4. Redistribution. You may reproduce and distribute copies of the + Work or Derivative Works thereof in any medium, with or without + modifications, and in Source or Object form, provided that You + meet the following conditions: + + (a) You must give any other recipients of the Work or + Derivative Works a copy of this License; and + + (b) You must cause any modified files to carry prominent notices + stating that You changed the files; and + + (c) You must retain, in the Source form of any Derivative Works + that You distribute, all copyright, patent, trademark, and + attribution notices from the Source form of the Work, + excluding those notices that do not pertain to any part of + the Derivative Works; and + + (d) If the Work includes a "NOTICE" text file as part of its + distribution, then any Derivative Works that You distribute must + include a readable copy of the attribution notices contained + within such NOTICE file, excluding those notices that do not + pertain to any part of the Derivative Works, in at least one + of the following places: within a NOTICE text file distributed + as part of the Derivative Works; within the Source form or + documentation, if provided along with the Derivative Works; or, + within a display generated by the Derivative Works, if and + wherever such third-party notices normally appear. The contents + of the NOTICE file are for informational purposes only and + do not modify the License. You may add Your own attribution + notices within Derivative Works that You distribute, alongside + or as an addendum to the NOTICE text from the Work, provided + that such additional attribution notices cannot be construed + as modifying the License. + + You may add Your own copyright statement to Your modifications and + may provide additional or different license terms and conditions + for use, reproduction, or distribution of Your modifications, or + for any such Derivative Works as a whole, provided Your use, + reproduction, and distribution of the Work otherwise complies with + the conditions stated in this License. + + 5. Submission of Contributions. Unless You explicitly state otherwise, + any Contribution intentionally submitted for inclusion in the Work + by You to the Licensor shall be under the terms and conditions of + this License, without any additional terms or conditions. + Notwithstanding the above, nothing herein shall supersede or modify + the terms of any separate license agreement you may have executed + with Licensor regarding such Contributions. + + 6. Trademarks. This License does not grant permission to use the trade + names, trademarks, service marks, or product names of the Licensor, + except as required for reasonable and customary use in describing the + origin of the Work and reproducing the content of the NOTICE file. + + 7. Disclaimer of Warranty. Unless required by applicable law or + agreed to in writing, Licensor provides the Work (and each + Contributor provides its Contributions) on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or + implied, including, without limitation, any warranties or conditions + of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A + PARTICULAR PURPOSE. You are solely responsible for determining the + appropriateness of using or redistributing the Work and assume any + risks associated with Your exercise of permissions under this License. + + 8. Limitation of Liability. In no event and under no legal theory, + whether in tort (including negligence), contract, or otherwise, + unless required by applicable law (such as deliberate and grossly + negligent acts) or agreed to in writing, shall any Contributor be + liable to You for damages, including any direct, indirect, special, + incidental, or consequential damages of any character arising as a + result of this License or out of the use or inability to use the + Work (including but not limited to damages for loss of goodwill, + work stoppage, computer failure or malfunction, or any and all + other commercial damages or losses), even if such Contributor + has been advised of the possibility of such damages. + + 9. Accepting Warranty or Additional Liability. While redistributing + the Work or Derivative Works thereof, You may choose to offer, + and charge a fee for, acceptance of support, warranty, indemnity, + or other liability obligations and/or rights consistent with this + License. However, in accepting such obligations, You may act only + on Your own behalf and on Your sole responsibility, not on behalf + of any other Contributor, and only if You agree to indemnify, + defend, and hold each Contributor harmless for any liability + incurred by, or claims asserted against, such Contributor by reason + of your accepting any such warranty or additional liability. + + END OF TERMS AND CONDITIONS + + APPENDIX: How to apply the Apache License to your work. + + To apply the Apache License to your work, attach the following + boilerplate notice, with the fields enclosed by brackets "[]" + replaced with your own identifying information. (Don't include + the brackets!) The text should be enclosed in the appropriate + comment syntax for the file format. We also recommend that a + file or class name and description of purpose be included on the + same "printed page" as the copyright notice for easier + identification within third-party archives. + + Copyright [yyyy] [name of copyright owner] + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. diff --git a/owl-bot-staging/google-cloud-security_center-v1p1beta1/README.md b/owl-bot-staging/google-cloud-security_center-v1p1beta1/README.md new file mode 100644 index 000000000000..dd4f6ca89772 --- /dev/null +++ b/owl-bot-staging/google-cloud-security_center-v1p1beta1/README.md @@ -0,0 +1,153 @@ +# Ruby Client for the Cloud Security Command Center V1p1beta1 API + +Security Command Center API provides access to temporal views of assets and findings within an organization. + + +https://github.com/googleapis/google-cloud-ruby + +This gem is a _versioned_ client. It provides basic client classes for a +specific version of the Cloud Security Command Center V1p1beta1 API. Most users should consider using +the main client gem, +[google-cloud-security_center](https://rubygems.org/gems/google-cloud-security_center). +See the section below titled *Which client should I use?* for more information. + +## Installation + +``` +$ gem install google-cloud-security_center-v1p1beta1 +``` + +## 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/securitycenter.googleapis.com) +1. [Set up authentication.](AUTHENTICATION.md) + +## Quick Start + +```ruby +require "google/cloud/security_center/v1p1beta1" + +client = ::Google::Cloud::SecurityCenter::V1p1beta1::SecurityCenter::Client.new +request = ::Google::Cloud::SecurityCenter::V1p1beta1::CreateSourceRequest.new # (request fields as keyword arguments...) +response = client.create_source request +``` + +View the [Client Library Documentation](https://cloud.google.com/ruby/docs/reference/google-cloud-security_center-v1p1beta1/latest) +for class and method documentation. + +See also the [Product Documentation](https://cloud.google.com/security-command-center) +for general usage information. + +## Debug Logging + +This library comes with opt-in Debug Logging that can help you troubleshoot +your application's integration with the API. When logging is activated, key +events such as requests and responses, along with data payloads and metadata +such as headers and client configuration, are logged to the standard error +stream. + +**WARNING:** Client Library Debug Logging includes your data payloads in +plaintext, which could include sensitive data such as PII for yourself or your +customers, private keys, or other security data that could be compromising if +leaked. Always practice good data hygiene with your application logs, and follow +the principle of least access. Google also recommends that Client Library Debug +Logging be enabled only temporarily during active debugging, and not used +permanently in production. + +To enable logging, set the environment variable `GOOGLE_SDK_RUBY_LOGGING_GEMS` +to the value `all`. Alternatively, you can set the value to a comma-delimited +list of client library gem names. This will select the default logging behavior, +which writes logs to the standard error stream. On a local workstation, this may +result in logs appearing on the console. When running on a Google Cloud hosting +service such as [Google Cloud Run](https://cloud.google.com/run), this generally +results in logs appearing alongside your application logs in the +[Google Cloud Logging](https://cloud.google.com/logging/) service. + +You can customize logging by modifying the `logger` configuration when +constructing a client object. For example: + +```ruby +require "google/cloud/security_center/v1p1beta1" +require "logger" + +client = ::Google::Cloud::SecurityCenter::V1p1beta1::SecurityCenter::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-security_center`, +and lower-level _versioned_ client libraries with names such as +`google-cloud-security_center-v1p1beta1`. +_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-security_center`. +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-security_center-v1p1beta1`. + +### What about the google-apis- clients? + +Client library gems with names that begin with `google-apis-` are based on an +older code generation technology. They talk to a REST/JSON backend (whereas +most modern clients talk to a [gRPC](https://grpc.io/) backend) and they may +not offer the same performance, features, and ease of use provided by more +modern clients. + +The `google-apis-` clients have wide coverage across Google services, so you +might need to use one if there is no modern client available for the service. +However, if a modern client is available, we generally recommend it over the +older `google-apis-` clients. diff --git a/owl-bot-staging/google-cloud-security_center-v1p1beta1/Rakefile b/owl-bot-staging/google-cloud-security_center-v1p1beta1/Rakefile new file mode 100644 index 000000000000..4edac3b83170 --- /dev/null +++ b/owl-bot-staging/google-cloud-security_center-v1p1beta1/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-security_center-v1p1beta1 acceptance tests." +task :acceptance, :project, :keyfile do |t, args| + project = args[:project] + project ||= + ENV["SECURITY_CENTER_TEST_PROJECT"] || + ENV["GCLOUD_TEST_PROJECT"] + keyfile = args[:keyfile] + keyfile ||= + ENV["SECURITY_CENTER_TEST_KEYFILE"] || + ENV["GCLOUD_TEST_KEYFILE"] + if keyfile + keyfile = File.read keyfile + else + keyfile ||= + ENV["SECURITY_CENTER_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 SECURITY_CENTER_TEST_PROJECT=test123 SECURITY_CENTER_TEST_KEYFILE=/path/to/keyfile.json rake acceptance" + end + require "google/cloud/security_center/v1p1beta1/security_center/credentials" + ::Google::Cloud::SecurityCenter::V1p1beta1::SecurityCenter::Credentials.env_vars.each do |path| + ENV[path] = nil + end + ENV["SECURITY_CENTER_PROJECT"] = project + ENV["SECURITY_CENTER_TEST_PROJECT"] = project + ENV["SECURITY_CENTER_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-security_center-v1p1beta1 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-security_center-v1p1beta1 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-security_center-v1p1beta1 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-security_center-v1p1beta1 gem does not have doctest tests." +end + +desc "Run the CI build" +task :ci do + header "BUILDING google-cloud-security_center-v1p1beta1" + header "google-cloud-security_center-v1p1beta1 rubocop", "*" + Rake::Task[:rubocop].invoke + header "google-cloud-security_center-v1p1beta1 yard", "*" + Rake::Task[:yard].invoke + header "google-cloud-security_center-v1p1beta1 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-security_center-v1p1beta1 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-security_center-v1p1beta1 acceptance", "*" + Rake::Task[:acceptance].invoke + end + task :a do + # This is a handy shortcut to save typing + Rake::Task["ci:acceptance"].invoke + end +end + +task default: :test + +def header str, token = "#" + line_length = str.length + 8 + puts "" + puts token * line_length + puts "#{token * 3} #{str} #{token * 3}" + puts token * line_length + puts "" +end diff --git a/owl-bot-staging/google-cloud-security_center-v1p1beta1/gapic_metadata.json b/owl-bot-staging/google-cloud-security_center-v1p1beta1/gapic_metadata.json new file mode 100644 index 000000000000..429bc0c97eac --- /dev/null +++ b/owl-bot-staging/google-cloud-security_center-v1p1beta1/gapic_metadata.json @@ -0,0 +1,133 @@ +{ + "schema": "1.0", + "comment": "This file maps proto services/RPCs to the corresponding library clients/methods", + "language": "ruby", + "protoPackage": "google.cloud.securitycenter.v1p1beta1", + "libraryPackage": "::Google::Cloud::SecurityCenter::V1p1beta1", + "services": { + "SecurityCenter": { + "clients": { + "grpc": { + "libraryClient": "::Google::Cloud::SecurityCenter::V1p1beta1::SecurityCenter::Client", + "rpcs": { + "CreateSource": { + "methods": [ + "create_source" + ] + }, + "CreateFinding": { + "methods": [ + "create_finding" + ] + }, + "CreateNotificationConfig": { + "methods": [ + "create_notification_config" + ] + }, + "DeleteNotificationConfig": { + "methods": [ + "delete_notification_config" + ] + }, + "GetIamPolicy": { + "methods": [ + "get_iam_policy" + ] + }, + "GetNotificationConfig": { + "methods": [ + "get_notification_config" + ] + }, + "GetOrganizationSettings": { + "methods": [ + "get_organization_settings" + ] + }, + "GetSource": { + "methods": [ + "get_source" + ] + }, + "GroupAssets": { + "methods": [ + "group_assets" + ] + }, + "GroupFindings": { + "methods": [ + "group_findings" + ] + }, + "ListAssets": { + "methods": [ + "list_assets" + ] + }, + "ListFindings": { + "methods": [ + "list_findings" + ] + }, + "ListNotificationConfigs": { + "methods": [ + "list_notification_configs" + ] + }, + "ListSources": { + "methods": [ + "list_sources" + ] + }, + "RunAssetDiscovery": { + "methods": [ + "run_asset_discovery" + ] + }, + "SetFindingState": { + "methods": [ + "set_finding_state" + ] + }, + "SetIamPolicy": { + "methods": [ + "set_iam_policy" + ] + }, + "TestIamPermissions": { + "methods": [ + "test_iam_permissions" + ] + }, + "UpdateFinding": { + "methods": [ + "update_finding" + ] + }, + "UpdateNotificationConfig": { + "methods": [ + "update_notification_config" + ] + }, + "UpdateOrganizationSettings": { + "methods": [ + "update_organization_settings" + ] + }, + "UpdateSource": { + "methods": [ + "update_source" + ] + }, + "UpdateSecurityMarks": { + "methods": [ + "update_security_marks" + ] + } + } + } + } + } + } +} diff --git a/owl-bot-staging/google-cloud-security_center-v1p1beta1/google-cloud-security_center-v1p1beta1.gemspec b/owl-bot-staging/google-cloud-security_center-v1p1beta1/google-cloud-security_center-v1p1beta1.gemspec new file mode 100644 index 000000000000..25ea2ffaec07 --- /dev/null +++ b/owl-bot-staging/google-cloud-security_center-v1p1beta1/google-cloud-security_center-v1p1beta1.gemspec @@ -0,0 +1,29 @@ +# -*- ruby -*- +# encoding: utf-8 + +require File.expand_path("lib/google/cloud/security_center/v1p1beta1/version", __dir__) + +Gem::Specification.new do |gem| + gem.name = "google-cloud-security_center-v1p1beta1" + gem.version = Google::Cloud::SecurityCenter::V1p1beta1::VERSION + + gem.authors = ["Google LLC"] + gem.email = "googleapis-packages@google.com" + gem.description = "Security Command Center API provides access to temporal views of assets and findings within an organization. Note that google-cloud-security_center-v1p1beta1 is a version-specific client library. For most uses, we recommend installing the main client library google-cloud-security_center instead. See the readme for more details." + gem.summary = "Security Command Center API provides access to temporal views of assets and findings within an organization." + 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 "grpc-google-iam-v1", "~> 1.11" +end diff --git a/owl-bot-staging/google-cloud-security_center-v1p1beta1/lib/google-cloud-security_center-v1p1beta1.rb b/owl-bot-staging/google-cloud-security_center-v1p1beta1/lib/google-cloud-security_center-v1p1beta1.rb new file mode 100644 index 000000000000..1e7ec4c542f6 --- /dev/null +++ b/owl-bot-staging/google-cloud-security_center-v1p1beta1/lib/google-cloud-security_center-v1p1beta1.rb @@ -0,0 +1,21 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +# This gem does not autoload during Bundler.require. To load this gem, +# issue explicit require statements for the packages desired, e.g.: +# require "google/cloud/security_center/v1p1beta1" diff --git a/owl-bot-staging/google-cloud-security_center-v1p1beta1/lib/google/cloud/security_center/v1p1beta1.rb b/owl-bot-staging/google-cloud-security_center-v1p1beta1/lib/google/cloud/security_center/v1p1beta1.rb new file mode 100644 index 000000000000..60f6b23b8bbb --- /dev/null +++ b/owl-bot-staging/google-cloud-security_center-v1p1beta1/lib/google/cloud/security_center/v1p1beta1.rb @@ -0,0 +1,45 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +require "google/cloud/security_center/v1p1beta1/security_center" +require "google/cloud/security_center/v1p1beta1/version" + +module Google + module Cloud + module SecurityCenter + ## + # API client module. + # + # @example Load this package, including all its services, and instantiate a gRPC client + # + # require "google/cloud/security_center/v1p1beta1" + # client = ::Google::Cloud::SecurityCenter::V1p1beta1::SecurityCenter::Client.new + # + # @example Load this package, including all its services, and instantiate a REST client + # + # require "google/cloud/security_center/v1p1beta1" + # client = ::Google::Cloud::SecurityCenter::V1p1beta1::SecurityCenter::Rest::Client.new + # + module V1p1beta1 + end + end + end +end + +helper_path = ::File.join __dir__, "v1p1beta1", "_helpers.rb" +require "google/cloud/security_center/v1p1beta1/_helpers" if ::File.file? helper_path diff --git a/owl-bot-staging/google-cloud-security_center-v1p1beta1/lib/google/cloud/security_center/v1p1beta1/rest.rb b/owl-bot-staging/google-cloud-security_center-v1p1beta1/lib/google/cloud/security_center/v1p1beta1/rest.rb new file mode 100644 index 000000000000..33c18366ecf2 --- /dev/null +++ b/owl-bot-staging/google-cloud-security_center-v1p1beta1/lib/google/cloud/security_center/v1p1beta1/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/cloud/security_center/v1p1beta1/security_center/rest" +require "google/cloud/security_center/v1p1beta1/version" + +module Google + module Cloud + module SecurityCenter + ## + # To load just the REST part of this package, including all its services, and instantiate a REST client: + # + # @example + # + # require "google/cloud/security_center/v1p1beta1/rest" + # client = ::Google::Cloud::SecurityCenter::V1p1beta1::SecurityCenter::Rest::Client.new + # + module V1p1beta1 + end + end + end +end diff --git a/owl-bot-staging/google-cloud-security_center-v1p1beta1/lib/google/cloud/security_center/v1p1beta1/security_center.rb b/owl-bot-staging/google-cloud-security_center-v1p1beta1/lib/google/cloud/security_center/v1p1beta1/security_center.rb new file mode 100644 index 000000000000..77d09feb2118 --- /dev/null +++ b/owl-bot-staging/google-cloud-security_center-v1p1beta1/lib/google/cloud/security_center/v1p1beta1/security_center.rb @@ -0,0 +1,56 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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/security_center/v1p1beta1/version" + +require "google/cloud/security_center/v1p1beta1/security_center/credentials" +require "google/cloud/security_center/v1p1beta1/security_center/paths" +require "google/cloud/security_center/v1p1beta1/security_center/operations" +require "google/cloud/security_center/v1p1beta1/security_center/client" +require "google/cloud/security_center/v1p1beta1/security_center/rest" + +module Google + module Cloud + module SecurityCenter + module V1p1beta1 + ## + # V1p1Beta1 APIs for Security Center service. + # + # @example Load this service and instantiate a gRPC client + # + # require "google/cloud/security_center/v1p1beta1/security_center" + # client = ::Google::Cloud::SecurityCenter::V1p1beta1::SecurityCenter::Client.new + # + # @example Load this service and instantiate a REST client + # + # require "google/cloud/security_center/v1p1beta1/security_center/rest" + # client = ::Google::Cloud::SecurityCenter::V1p1beta1::SecurityCenter::Rest::Client.new + # + module SecurityCenter + end + end + end + end +end + +helper_path = ::File.join __dir__, "security_center", "helpers.rb" +require "google/cloud/security_center/v1p1beta1/security_center/helpers" if ::File.file? helper_path diff --git a/owl-bot-staging/google-cloud-security_center-v1p1beta1/lib/google/cloud/security_center/v1p1beta1/security_center/client.rb b/owl-bot-staging/google-cloud-security_center-v1p1beta1/lib/google/cloud/security_center/v1p1beta1/security_center/client.rb new file mode 100644 index 000000000000..7cda5890ec7b --- /dev/null +++ b/owl-bot-staging/google-cloud-security_center-v1p1beta1/lib/google/cloud/security_center/v1p1beta1/security_center/client.rb @@ -0,0 +1,3250 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +require "google/cloud/errors" +require "google/cloud/securitycenter/v1p1beta1/securitycenter_service_pb" + +module Google + module Cloud + module SecurityCenter + module V1p1beta1 + module SecurityCenter + ## + # Client for the SecurityCenter service. + # + # V1p1Beta1 APIs for Security Center service. + # + class Client + # @private + API_VERSION = "" + + # @private + DEFAULT_ENDPOINT_TEMPLATE = "securitycenter.$UNIVERSE_DOMAIN$" + + include Paths + + # @private + attr_reader :security_center_stub + + ## + # Configure the SecurityCenter Client class. + # + # See {::Google::Cloud::SecurityCenter::V1p1beta1::SecurityCenter::Client::Configuration} + # for a description of the configuration fields. + # + # @example + # + # # Modify the configuration for all SecurityCenter clients + # ::Google::Cloud::SecurityCenter::V1p1beta1::SecurityCenter::Client.configure do |config| + # config.timeout = 10.0 + # end + # + # @yield [config] Configure the Client client. + # @yieldparam config [Client::Configuration] + # + # @return [Client::Configuration] + # + def self.configure + @configure ||= begin + namespace = ["Google", "Cloud", "SecurityCenter", "V1p1beta1"] + 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_source.timeout = 60.0 + + default_config.rpcs.create_finding.timeout = 60.0 + + default_config.rpcs.create_notification_config.timeout = 60.0 + + default_config.rpcs.delete_notification_config.timeout = 60.0 + + default_config.rpcs.get_iam_policy.timeout = 60.0 + default_config.rpcs.get_iam_policy.retry_policy = { + initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [4, 14] + } + + default_config.rpcs.get_notification_config.timeout = 60.0 + default_config.rpcs.get_notification_config.retry_policy = { + initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [4, 14] + } + + default_config.rpcs.get_organization_settings.timeout = 60.0 + default_config.rpcs.get_organization_settings.retry_policy = { + initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [4, 14] + } + + default_config.rpcs.get_source.timeout = 60.0 + default_config.rpcs.get_source.retry_policy = { + initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [4, 14] + } + + default_config.rpcs.group_assets.timeout = 480.0 + default_config.rpcs.group_assets.retry_policy = { + initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [4, 14] + } + + default_config.rpcs.group_findings.timeout = 480.0 + default_config.rpcs.group_findings.retry_policy = { + initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [4, 14] + } + + default_config.rpcs.list_assets.timeout = 480.0 + default_config.rpcs.list_assets.retry_policy = { + initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [4, 14] + } + + default_config.rpcs.list_findings.timeout = 480.0 + default_config.rpcs.list_findings.retry_policy = { + initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [4, 14] + } + + default_config.rpcs.list_notification_configs.timeout = 60.0 + default_config.rpcs.list_notification_configs.retry_policy = { + initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [4, 14] + } + + default_config.rpcs.list_sources.timeout = 60.0 + default_config.rpcs.list_sources.retry_policy = { + initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [4, 14] + } + + default_config.rpcs.run_asset_discovery.timeout = 60.0 + + default_config.rpcs.set_finding_state.timeout = 60.0 + + default_config.rpcs.set_iam_policy.timeout = 60.0 + + default_config.rpcs.test_iam_permissions.timeout = 60.0 + default_config.rpcs.test_iam_permissions.retry_policy = { + initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [4, 14] + } + + default_config.rpcs.update_finding.timeout = 60.0 + + default_config.rpcs.update_notification_config.timeout = 60.0 + + default_config.rpcs.update_organization_settings.timeout = 60.0 + + default_config.rpcs.update_source.timeout = 60.0 + + default_config.rpcs.update_security_marks.timeout = 480.0 + + default_config + end + yield @configure if block_given? + @configure + end + + ## + # Configure the SecurityCenter Client instance. + # + # The configuration is set to the derived mode, meaning that values can be changed, + # but structural changes (adding new fields, etc.) are not allowed. Structural changes + # should be made on {Client.configure}. + # + # See {::Google::Cloud::SecurityCenter::V1p1beta1::SecurityCenter::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 + @security_center_stub.universe_domain + end + + ## + # Create a new SecurityCenter client object. + # + # @example + # + # # Create a client using the default configuration + # client = ::Google::Cloud::SecurityCenter::V1p1beta1::SecurityCenter::Client.new + # + # # Create a client using a custom configuration + # client = ::Google::Cloud::SecurityCenter::V1p1beta1::SecurityCenter::Client.new do |config| + # config.timeout = 10.0 + # end + # + # @yield [config] Configure the SecurityCenter client. + # @yieldparam config [Client::Configuration] + # + def initialize + # These require statements are intentionally placed here to initialize + # the gRPC module only when it's required. + # See https://github.com/googleapis/toolkit/issues/446 + require "gapic/grpc" + require "google/cloud/securitycenter/v1p1beta1/securitycenter_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 + + @security_center_stub = ::Gapic::ServiceStub.new( + ::Google::Cloud::SecurityCenter::V1p1beta1::SecurityCenter::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 + ) + + @security_center_stub.stub_logger&.info do |entry| + entry.set_system_name + entry.set_service + entry.message = "Created client for #{entry.service}" + entry.set_credentials_fields credentials + entry.set "customEndpoint", @config.endpoint if @config.endpoint + entry.set "defaultTimeout", @config.timeout if @config.timeout + entry.set "quotaProject", @quota_project_id if @quota_project_id + end + end + + ## + # Get the associated client for long-running operations. + # + # @return [::Google::Cloud::SecurityCenter::V1p1beta1::SecurityCenter::Operations] + # + attr_reader :operations_client + + ## + # The logger used for request/response debug logging. + # + # @return [Logger] + # + def logger + @security_center_stub.logger + end + + # Service calls + + ## + # Creates a source. + # + # @overload create_source(request, options = nil) + # Pass arguments to `create_source` via a request object, either of type + # {::Google::Cloud::SecurityCenter::V1p1beta1::CreateSourceRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::SecurityCenter::V1p1beta1::CreateSourceRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_source(parent: nil, source: nil) + # Pass arguments to `create_source` via keyword arguments. Note that at + # least one keyword argument is 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. Resource name of the new source's parent. Its format should be + # "organizations/[organization_id]". + # @param source [::Google::Cloud::SecurityCenter::V1p1beta1::Source, ::Hash] + # Required. The Source being created, only the display_name and description will be + # used. All other fields will be ignored. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Google::Cloud::SecurityCenter::V1p1beta1::Source] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Google::Cloud::SecurityCenter::V1p1beta1::Source] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/security_center/v1p1beta1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::SecurityCenter::V1p1beta1::SecurityCenter::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::SecurityCenter::V1p1beta1::CreateSourceRequest.new + # + # # Call the create_source method. + # result = client.create_source request + # + # # The returned object is of type Google::Cloud::SecurityCenter::V1p1beta1::Source. + # p result + # + def create_source request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::SecurityCenter::V1p1beta1::CreateSourceRequest + + # Converts hash 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_source.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::SecurityCenter::V1p1beta1::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_source.timeout, + metadata: metadata, + retry_policy: @config.rpcs.create_source.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @security_center_stub.call_rpc :create_source, request, options: options do |response, operation| + yield response, operation if block_given? + end + rescue ::GRPC::BadStatus => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Creates a finding. The corresponding source must exist for finding + # creation to succeed. + # + # @overload create_finding(request, options = nil) + # Pass arguments to `create_finding` via a request object, either of type + # {::Google::Cloud::SecurityCenter::V1p1beta1::CreateFindingRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::SecurityCenter::V1p1beta1::CreateFindingRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_finding(parent: nil, finding_id: nil, finding: nil) + # Pass arguments to `create_finding` via keyword arguments. Note that at + # least one keyword argument is 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. Resource name of the new finding's parent. Its format should be + # "organizations/[organization_id]/sources/[source_id]". + # @param finding_id [::String] + # Required. Unique identifier provided by the client within the parent scope. + # @param finding [::Google::Cloud::SecurityCenter::V1p1beta1::Finding, ::Hash] + # Required. The Finding being created. The name and security_marks will be ignored as + # they are both output only fields on this resource. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Google::Cloud::SecurityCenter::V1p1beta1::Finding] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Google::Cloud::SecurityCenter::V1p1beta1::Finding] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/security_center/v1p1beta1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::SecurityCenter::V1p1beta1::SecurityCenter::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::SecurityCenter::V1p1beta1::CreateFindingRequest.new + # + # # Call the create_finding method. + # result = client.create_finding request + # + # # The returned object is of type Google::Cloud::SecurityCenter::V1p1beta1::Finding. + # p result + # + def create_finding request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::SecurityCenter::V1p1beta1::CreateFindingRequest + + # Converts hash 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_finding.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::SecurityCenter::V1p1beta1::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_finding.timeout, + metadata: metadata, + retry_policy: @config.rpcs.create_finding.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @security_center_stub.call_rpc :create_finding, request, options: options do |response, operation| + yield response, operation if block_given? + end + rescue ::GRPC::BadStatus => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Creates a notification config. + # + # @overload create_notification_config(request, options = nil) + # Pass arguments to `create_notification_config` via a request object, either of type + # {::Google::Cloud::SecurityCenter::V1p1beta1::CreateNotificationConfigRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::SecurityCenter::V1p1beta1::CreateNotificationConfigRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_notification_config(parent: nil, config_id: nil, notification_config: nil) + # Pass arguments to `create_notification_config` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param parent [::String] + # Required. Resource name of the new notification config's parent. Its format is + # "organizations/[organization_id]". + # @param config_id [::String] + # Required. Unique identifier provided by the client within the parent scope. + # It must be between 1 and 128 characters, and contains alphanumeric + # characters, underscores or hyphens only. + # @param notification_config [::Google::Cloud::SecurityCenter::V1p1beta1::NotificationConfig, ::Hash] + # Required. The notification config being created. The name and the service account + # will be ignored as they are both output only fields on this resource. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Google::Cloud::SecurityCenter::V1p1beta1::NotificationConfig] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Google::Cloud::SecurityCenter::V1p1beta1::NotificationConfig] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/security_center/v1p1beta1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::SecurityCenter::V1p1beta1::SecurityCenter::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::SecurityCenter::V1p1beta1::CreateNotificationConfigRequest.new + # + # # Call the create_notification_config method. + # result = client.create_notification_config request + # + # # The returned object is of type Google::Cloud::SecurityCenter::V1p1beta1::NotificationConfig. + # p result + # + def create_notification_config request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::SecurityCenter::V1p1beta1::CreateNotificationConfigRequest + + # Converts hash 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_notification_config.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::SecurityCenter::V1p1beta1::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_notification_config.timeout, + metadata: metadata, + retry_policy: @config.rpcs.create_notification_config.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @security_center_stub.call_rpc :create_notification_config, request, options: options do |response, operation| + yield response, operation if block_given? + end + rescue ::GRPC::BadStatus => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Deletes a notification config. + # + # @overload delete_notification_config(request, options = nil) + # Pass arguments to `delete_notification_config` via a request object, either of type + # {::Google::Cloud::SecurityCenter::V1p1beta1::DeleteNotificationConfigRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::SecurityCenter::V1p1beta1::DeleteNotificationConfigRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_notification_config(name: nil) + # Pass arguments to `delete_notification_config` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param name [::String] + # Required. Name of the notification config to delete. Its format is + # "organizations/[organization_id]/notificationConfigs/[config_id]". + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Google::Protobuf::Empty] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Google::Protobuf::Empty] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/security_center/v1p1beta1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::SecurityCenter::V1p1beta1::SecurityCenter::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::SecurityCenter::V1p1beta1::DeleteNotificationConfigRequest.new + # + # # Call the delete_notification_config method. + # result = client.delete_notification_config request + # + # # The returned object is of type Google::Protobuf::Empty. + # p result + # + def delete_notification_config request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::SecurityCenter::V1p1beta1::DeleteNotificationConfigRequest + + # Converts hash 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_notification_config.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::SecurityCenter::V1p1beta1::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_notification_config.timeout, + metadata: metadata, + retry_policy: @config.rpcs.delete_notification_config.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @security_center_stub.call_rpc :delete_notification_config, request, options: options do |response, operation| + yield response, operation if block_given? + end + rescue ::GRPC::BadStatus => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Gets the access control policy on the specified Source. + # + # @overload get_iam_policy(request, options = nil) + # Pass arguments to `get_iam_policy` via a request object, either of type + # {::Google::Iam::V1::GetIamPolicyRequest} or an equivalent Hash. + # + # @param request [::Google::Iam::V1::GetIamPolicyRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. + # + # @overload get_iam_policy(resource: nil, options: nil) + # Pass arguments to `get_iam_policy` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param resource [::String] + # REQUIRED: The resource for which the policy is being requested. + # See the operation documentation for the appropriate value for this field. + # @param options [::Google::Iam::V1::GetPolicyOptions, ::Hash] + # OPTIONAL: A `GetPolicyOptions` object for specifying options to + # `GetIamPolicy`. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Google::Iam::V1::Policy] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Google::Iam::V1::Policy] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/security_center/v1p1beta1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::SecurityCenter::V1p1beta1::SecurityCenter::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Iam::V1::GetIamPolicyRequest.new + # + # # Call the get_iam_policy method. + # result = client.get_iam_policy request + # + # # The returned object is of type Google::Iam::V1::Policy. + # p result + # + def get_iam_policy request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Iam::V1::GetIamPolicyRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + metadata = @config.rpcs.get_iam_policy.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::SecurityCenter::V1p1beta1::VERSION + metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.resource + header_params["resource"] = request.resource + end + + request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") + metadata[:"x-goog-request-params"] ||= request_params_header + + options.apply_defaults timeout: @config.rpcs.get_iam_policy.timeout, + metadata: metadata, + retry_policy: @config.rpcs.get_iam_policy.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @security_center_stub.call_rpc :get_iam_policy, request, options: options do |response, operation| + yield response, operation if block_given? + end + rescue ::GRPC::BadStatus => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Gets a notification config. + # + # @overload get_notification_config(request, options = nil) + # Pass arguments to `get_notification_config` via a request object, either of type + # {::Google::Cloud::SecurityCenter::V1p1beta1::GetNotificationConfigRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::SecurityCenter::V1p1beta1::GetNotificationConfigRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_notification_config(name: nil) + # Pass arguments to `get_notification_config` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param name [::String] + # Required. Name of the notification config to get. Its format is + # "organizations/[organization_id]/notificationConfigs/[config_id]". + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Google::Cloud::SecurityCenter::V1p1beta1::NotificationConfig] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Google::Cloud::SecurityCenter::V1p1beta1::NotificationConfig] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/security_center/v1p1beta1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::SecurityCenter::V1p1beta1::SecurityCenter::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::SecurityCenter::V1p1beta1::GetNotificationConfigRequest.new + # + # # Call the get_notification_config method. + # result = client.get_notification_config request + # + # # The returned object is of type Google::Cloud::SecurityCenter::V1p1beta1::NotificationConfig. + # p result + # + def get_notification_config request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::SecurityCenter::V1p1beta1::GetNotificationConfigRequest + + # Converts hash 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_notification_config.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::SecurityCenter::V1p1beta1::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_notification_config.timeout, + metadata: metadata, + retry_policy: @config.rpcs.get_notification_config.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @security_center_stub.call_rpc :get_notification_config, request, options: options do |response, operation| + yield response, operation if block_given? + end + rescue ::GRPC::BadStatus => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Gets the settings for an organization. + # + # @overload get_organization_settings(request, options = nil) + # Pass arguments to `get_organization_settings` via a request object, either of type + # {::Google::Cloud::SecurityCenter::V1p1beta1::GetOrganizationSettingsRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::SecurityCenter::V1p1beta1::GetOrganizationSettingsRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. + # + # @overload get_organization_settings(name: nil) + # Pass arguments to `get_organization_settings` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param name [::String] + # Required. Name of the organization to get organization settings for. Its format is + # "organizations/[organization_id]/organizationSettings". + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Google::Cloud::SecurityCenter::V1p1beta1::OrganizationSettings] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Google::Cloud::SecurityCenter::V1p1beta1::OrganizationSettings] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/security_center/v1p1beta1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::SecurityCenter::V1p1beta1::SecurityCenter::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::SecurityCenter::V1p1beta1::GetOrganizationSettingsRequest.new + # + # # Call the get_organization_settings method. + # result = client.get_organization_settings request + # + # # The returned object is of type Google::Cloud::SecurityCenter::V1p1beta1::OrganizationSettings. + # p result + # + def get_organization_settings request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::SecurityCenter::V1p1beta1::GetOrganizationSettingsRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + metadata = @config.rpcs.get_organization_settings.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::SecurityCenter::V1p1beta1::VERSION + metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.name + header_params["name"] = request.name + end + + request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") + metadata[:"x-goog-request-params"] ||= request_params_header + + options.apply_defaults timeout: @config.rpcs.get_organization_settings.timeout, + metadata: metadata, + retry_policy: @config.rpcs.get_organization_settings.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @security_center_stub.call_rpc :get_organization_settings, request, options: options do |response, operation| + yield response, operation if block_given? + end + rescue ::GRPC::BadStatus => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Gets a source. + # + # @overload get_source(request, options = nil) + # Pass arguments to `get_source` via a request object, either of type + # {::Google::Cloud::SecurityCenter::V1p1beta1::GetSourceRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::SecurityCenter::V1p1beta1::GetSourceRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_source(name: nil) + # Pass arguments to `get_source` via keyword arguments. Note that at + # least one keyword argument is 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. Relative resource name of the source. Its format is + # "organizations/[organization_id]/source/[source_id]". + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Google::Cloud::SecurityCenter::V1p1beta1::Source] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Google::Cloud::SecurityCenter::V1p1beta1::Source] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/security_center/v1p1beta1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::SecurityCenter::V1p1beta1::SecurityCenter::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::SecurityCenter::V1p1beta1::GetSourceRequest.new + # + # # Call the get_source method. + # result = client.get_source request + # + # # The returned object is of type Google::Cloud::SecurityCenter::V1p1beta1::Source. + # p result + # + def get_source request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::SecurityCenter::V1p1beta1::GetSourceRequest + + # Converts hash 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_source.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::SecurityCenter::V1p1beta1::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_source.timeout, + metadata: metadata, + retry_policy: @config.rpcs.get_source.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @security_center_stub.call_rpc :get_source, 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 + + ## + # Filters an organization's assets and groups them by their specified + # properties. + # + # @overload group_assets(request, options = nil) + # Pass arguments to `group_assets` via a request object, either of type + # {::Google::Cloud::SecurityCenter::V1p1beta1::GroupAssetsRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::SecurityCenter::V1p1beta1::GroupAssetsRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. + # + # @overload group_assets(parent: nil, filter: nil, group_by: nil, compare_duration: nil, read_time: nil, page_token: nil, page_size: nil) + # Pass arguments to `group_assets` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param parent [::String] + # Required. Name of the organization to groupBy. Its format is + # "organizations/[organization_id], folders/[folder_id], or + # projects/[project_id]". + # @param filter [::String] + # Expression that defines the filter to apply across assets. + # The expression is a list of zero or more restrictions combined via logical + # operators `AND` and `OR`. + # Parentheses are supported, and `OR` has higher precedence than `AND`. + # + # Restrictions have the form ` ` and may have a `-` + # character in front of them to indicate negation. The fields map to those + # defined in the Asset resource. Examples include: + # + # * name + # * security_center_properties.resource_name + # * resource_properties.a_property + # * security_marks.marks.marka + # + # The supported operators are: + # + # * `=` for all value types. + # * `>`, `<`, `>=`, `<=` for integer values. + # * `:`, meaning substring matching, for strings. + # + # The supported value types are: + # + # * string literals in quotes. + # * integer literals without quotes. + # * boolean literals `true` and `false` without quotes. + # + # The following field and operator combinations are supported: + # + # * name: `=` + # * update_time: `=`, `>`, `<`, `>=`, `<=` + # + # Usage: This should be milliseconds since epoch or an RFC3339 string. + # Examples: + # `update_time = "2019-06-10T16:07:18-07:00"` + # `update_time = 1560208038000` + # + # * create_time: `=`, `>`, `<`, `>=`, `<=` + # + # Usage: This should be milliseconds since epoch or an RFC3339 string. + # Examples: + # `create_time = "2019-06-10T16:07:18-07:00"` + # `create_time = 1560208038000` + # + # * iam_policy.policy_blob: `=`, `:` + # * resource_properties: `=`, `:`, `>`, `<`, `>=`, `<=` + # * security_marks.marks: `=`, `:` + # * security_center_properties.resource_name: `=`, `:` + # * security_center_properties.resource_name_display_name: `=`, `:` + # * security_center_properties.resource_type: `=`, `:` + # * security_center_properties.resource_parent: `=`, `:` + # * security_center_properties.resource_parent_display_name: `=`, `:` + # * security_center_properties.resource_project: `=`, `:` + # * security_center_properties.resource_project_display_name: `=`, `:` + # * security_center_properties.resource_owners: `=`, `:` + # + # For example, `resource_properties.size = 100` is a valid filter string. + # + # Use a partial match on the empty string to filter based on a property + # existing: `resource_properties.my_property : ""` + # + # Use a negated partial match on the empty string to filter based on a + # property not existing: `-resource_properties.my_property : ""` + # @param group_by [::String] + # Required. Expression that defines what assets fields to use for grouping. The string + # value should follow SQL syntax: comma separated list of fields. For + # example: + # "security_center_properties.resource_project,security_center_properties.project". + # + # The following fields are supported when compare_duration is not set: + # + # * security_center_properties.resource_project + # * security_center_properties.resource_project_display_name + # * security_center_properties.resource_type + # * security_center_properties.resource_parent + # * security_center_properties.resource_parent_display_name + # + # The following fields are supported when compare_duration is set: + # + # * security_center_properties.resource_type + # * security_center_properties.resource_project_display_name + # * security_center_properties.resource_parent_display_name + # @param compare_duration [::Google::Protobuf::Duration, ::Hash] + # When compare_duration is set, the GroupResult's "state_change" property is + # updated to indicate whether the asset was added, removed, or remained + # present during the compare_duration period of time that precedes the + # read_time. This is the time between (read_time - compare_duration) and + # read_time. + # + # The state change value is derived based on the presence of the asset at the + # two points in time. Intermediate state changes between the two times don't + # affect the result. For example, the results aren't affected if the asset is + # removed and re-created again. + # + # Possible "state_change" values when compare_duration is specified: + # + # * "ADDED": indicates that the asset was not present at the start of + # compare_duration, but present at reference_time. + # * "REMOVED": indicates that the asset was present at the start of + # compare_duration, but not present at reference_time. + # * "ACTIVE": indicates that the asset was present at both the + # start and the end of the time period defined by + # compare_duration and reference_time. + # + # If compare_duration is not specified, then the only possible state_change + # is "UNUSED", which will be the state_change set for all assets present at + # read_time. + # + # If this field is set then `state_change` must be a specified field in + # `group_by`. + # @param read_time [::Google::Protobuf::Timestamp, ::Hash] + # Time used as a reference point when filtering assets. The filter is limited + # to assets existing at the supplied time and their values are those at that + # specific time. Absence of this field will default to the API's version of + # NOW. + # @param page_token [::String] + # The value returned by the last `GroupAssetsResponse`; indicates + # that this is a continuation of a prior `GroupAssets` call, and that the + # system should return the next page of data. + # @param page_size [::Integer] + # The maximum number of results to return in a single response. Default is + # 10, minimum is 1, maximum is 1000. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Gapic::PagedEnumerable<::Google::Cloud::SecurityCenter::V1p1beta1::GroupResult>] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Gapic::PagedEnumerable<::Google::Cloud::SecurityCenter::V1p1beta1::GroupResult>] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/security_center/v1p1beta1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::SecurityCenter::V1p1beta1::SecurityCenter::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::SecurityCenter::V1p1beta1::GroupAssetsRequest.new + # + # # Call the group_assets method. + # result = client.group_assets request + # + # # The returned object is of type Gapic::PagedEnumerable. You can iterate + # # over elements, and API calls will be issued to fetch pages as needed. + # result.each do |item| + # # Each element is of type ::Google::Cloud::SecurityCenter::V1p1beta1::GroupResult. + # p item + # end + # + def group_assets request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::SecurityCenter::V1p1beta1::GroupAssetsRequest + + # Converts hash 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.group_assets.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::SecurityCenter::V1p1beta1::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.group_assets.timeout, + metadata: metadata, + retry_policy: @config.rpcs.group_assets.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @security_center_stub.call_rpc :group_assets, request, options: options do |response, operation| + response = ::Gapic::PagedEnumerable.new @security_center_stub, :group_assets, 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 + + ## + # Filters an organization or source's findings and groups them by their + # specified properties. + # + # To group across all sources provide a `-` as the source id. + # Example: /v1/organizations/\\{organization_id}/sources/-/findings, + # /v1/folders/\\{folder_id}/sources/-/findings, + # /v1/projects/\\{project_id}/sources/-/findings + # + # @overload group_findings(request, options = nil) + # Pass arguments to `group_findings` via a request object, either of type + # {::Google::Cloud::SecurityCenter::V1p1beta1::GroupFindingsRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::SecurityCenter::V1p1beta1::GroupFindingsRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. + # + # @overload group_findings(parent: nil, filter: nil, group_by: nil, read_time: nil, compare_duration: nil, page_token: nil, page_size: nil) + # Pass arguments to `group_findings` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param parent [::String] + # Required. Name of the source to groupBy. Its format is + # "organizations/[organization_id]/sources/[source_id]", + # folders/[folder_id]/sources/[source_id], or + # projects/[project_id]/sources/[source_id]. To groupBy across all sources + # provide a source_id of `-`. For example: + # organizations/\\{organization_id}/sources/-, folders/\\{folder_id}/sources/-, + # or projects/\\{project_id}/sources/- + # @param filter [::String] + # Expression that defines the filter to apply across findings. + # The expression is a list of one or more restrictions combined via logical + # operators `AND` and `OR`. + # Parentheses are supported, and `OR` has higher precedence than `AND`. + # + # Restrictions have the form ` ` and may have a `-` + # character in front of them to indicate negation. Examples include: + # + # * name + # * source_properties.a_property + # * security_marks.marks.marka + # + # The supported operators are: + # + # * `=` for all value types. + # * `>`, `<`, `>=`, `<=` for integer values. + # * `:`, meaning substring matching, for strings. + # + # The supported value types are: + # + # * string literals in quotes. + # * integer literals without quotes. + # * boolean literals `true` and `false` without quotes. + # + # The following field and operator combinations are supported: + # + # * name: `=` + # * parent: `=`, `:` + # * resource_name: `=`, `:` + # * state: `=`, `:` + # * category: `=`, `:` + # * external_uri: `=`, `:` + # * event_time: `=`, `>`, `<`, `>=`, `<=` + # * severity: `=`, `:` + # + # Usage: This should be milliseconds since epoch or an RFC3339 string. + # Examples: + # `event_time = "2019-06-10T16:07:18-07:00"` + # `event_time = 1560208038000` + # + # * security_marks.marks: `=`, `:` + # * source_properties: `=`, `:`, `>`, `<`, `>=`, `<=` + # + # For example, `source_properties.size = 100` is a valid filter string. + # + # Use a partial match on the empty string to filter based on a property + # existing: `source_properties.my_property : ""` + # + # Use a negated partial match on the empty string to filter based on a + # property not existing: `-source_properties.my_property : ""` + # @param group_by [::String] + # Required. Expression that defines what assets fields to use for grouping (including + # `state_change`). The string value should follow SQL syntax: comma separated + # list of fields. For example: "parent,resource_name". + # + # The following fields are supported: + # + # * resource_name + # * category + # * state + # * parent + # * severity + # + # The following fields are supported when compare_duration is set: + # + # * state_change + # @param read_time [::Google::Protobuf::Timestamp, ::Hash] + # Time used as a reference point when filtering findings. The filter is + # limited to findings existing at the supplied time and their values are + # those at that specific time. Absence of this field will default to the + # API's version of NOW. + # @param compare_duration [::Google::Protobuf::Duration, ::Hash] + # When compare_duration is set, the GroupResult's "state_change" attribute is + # updated to indicate whether the finding had its state changed, the + # finding's state remained unchanged, or if the finding was added during the + # compare_duration period of time that precedes the read_time. This is the + # time between (read_time - compare_duration) and read_time. + # + # The state_change value is derived based on the presence and state of the + # finding at the two points in time. Intermediate state changes between the + # two times don't affect the result. For example, the results aren't affected + # if the finding is made inactive and then active again. + # + # Possible "state_change" values when compare_duration is specified: + # + # * "CHANGED": indicates that the finding was present and matched the given + # filter at the start of compare_duration, but changed its + # state at read_time. + # * "UNCHANGED": indicates that the finding was present and matched the given + # filter at the start of compare_duration and did not change + # state at read_time. + # * "ADDED": indicates that the finding did not match the given filter or + # was not present at the start of compare_duration, but was + # present at read_time. + # * "REMOVED": indicates that the finding was present and matched the + # filter at the start of compare_duration, but did not match + # the filter at read_time. + # + # If compare_duration is not specified, then the only possible state_change + # is "UNUSED", which will be the state_change set for all findings present + # at read_time. + # + # If this field is set then `state_change` must be a specified field in + # `group_by`. + # @param page_token [::String] + # The value returned by the last `GroupFindingsResponse`; indicates + # that this is a continuation of a prior `GroupFindings` call, and + # that the system should return the next page of data. + # @param page_size [::Integer] + # The maximum number of results to return in a single response. Default is + # 10, minimum is 1, maximum is 1000. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Gapic::PagedEnumerable<::Google::Cloud::SecurityCenter::V1p1beta1::GroupResult>] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Gapic::PagedEnumerable<::Google::Cloud::SecurityCenter::V1p1beta1::GroupResult>] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/security_center/v1p1beta1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::SecurityCenter::V1p1beta1::SecurityCenter::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::SecurityCenter::V1p1beta1::GroupFindingsRequest.new + # + # # Call the group_findings method. + # result = client.group_findings request + # + # # The returned object is of type Gapic::PagedEnumerable. You can iterate + # # over elements, and API calls will be issued to fetch pages as needed. + # result.each do |item| + # # Each element is of type ::Google::Cloud::SecurityCenter::V1p1beta1::GroupResult. + # p item + # end + # + def group_findings request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::SecurityCenter::V1p1beta1::GroupFindingsRequest + + # Converts hash 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.group_findings.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::SecurityCenter::V1p1beta1::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.group_findings.timeout, + metadata: metadata, + retry_policy: @config.rpcs.group_findings.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @security_center_stub.call_rpc :group_findings, request, options: options do |response, operation| + response = ::Gapic::PagedEnumerable.new @security_center_stub, :group_findings, 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 + + ## + # Lists an organization's assets. + # + # @overload list_assets(request, options = nil) + # Pass arguments to `list_assets` via a request object, either of type + # {::Google::Cloud::SecurityCenter::V1p1beta1::ListAssetsRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::SecurityCenter::V1p1beta1::ListAssetsRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_assets(parent: nil, filter: nil, order_by: nil, read_time: nil, compare_duration: nil, field_mask: nil, page_token: nil, page_size: nil) + # Pass arguments to `list_assets` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param parent [::String] + # Required. Name of the organization assets should belong to. Its format is + # "organizations/[organization_id], folders/[folder_id], or + # projects/[project_id]". + # @param filter [::String] + # Expression that defines the filter to apply across assets. + # The expression is a list of zero or more restrictions combined via logical + # operators `AND` and `OR`. + # Parentheses are supported, and `OR` has higher precedence than `AND`. + # + # Restrictions have the form ` ` and may have a `-` + # character in front of them to indicate negation. The fields map to those + # defined in the Asset resource. Examples include: + # + # * name + # * security_center_properties.resource_name + # * resource_properties.a_property + # * security_marks.marks.marka + # + # The supported operators are: + # + # * `=` for all value types. + # * `>`, `<`, `>=`, `<=` for integer values. + # * `:`, meaning substring matching, for strings. + # + # The supported value types are: + # + # * string literals in quotes. + # * integer literals without quotes. + # * boolean literals `true` and `false` without quotes. + # + # The following are the allowed field and operator combinations: + # + # * name: `=` + # * update_time: `=`, `>`, `<`, `>=`, `<=` + # + # Usage: This should be milliseconds since epoch or an RFC3339 string. + # Examples: + # `update_time = "2019-06-10T16:07:18-07:00"` + # `update_time = 1560208038000` + # + # * create_time: `=`, `>`, `<`, `>=`, `<=` + # + # Usage: This should be milliseconds since epoch or an RFC3339 string. + # Examples: + # `create_time = "2019-06-10T16:07:18-07:00"` + # `create_time = 1560208038000` + # + # * iam_policy.policy_blob: `=`, `:` + # * resource_properties: `=`, `:`, `>`, `<`, `>=`, `<=` + # * security_marks.marks: `=`, `:` + # * security_center_properties.resource_name: `=`, `:` + # * security_center_properties.resource_display_name: `=`, `:` + # * security_center_properties.resource_type: `=`, `:` + # * security_center_properties.resource_parent: `=`, `:` + # * security_center_properties.resource_parent_display_name: `=`, `:` + # * security_center_properties.resource_project: `=`, `:` + # * security_center_properties.resource_project_display_name: `=`, `:` + # * security_center_properties.resource_owners: `=`, `:` + # + # For example, `resource_properties.size = 100` is a valid filter string. + # + # Use a partial match on the empty string to filter based on a property + # existing: `resource_properties.my_property : ""` + # + # Use a negated partial match on the empty string to filter based on a + # property not existing: `-resource_properties.my_property : ""` + # @param order_by [::String] + # Expression that defines what fields and order to use for sorting. The + # string value should follow SQL syntax: comma separated list of fields. For + # example: "name,resource_properties.a_property". The default sorting order + # is ascending. To specify descending order for a field, a suffix " desc" + # should be appended to the field name. For example: "name + # desc,resource_properties.a_property". Redundant space characters in the + # syntax are insignificant. "name desc,resource_properties.a_property" and " + # name desc , resource_properties.a_property " are equivalent. + # + # The following fields are supported: + # name + # update_time + # resource_properties + # security_marks.marks + # security_center_properties.resource_name + # security_center_properties.resource_display_name + # security_center_properties.resource_parent + # security_center_properties.resource_parent_display_name + # security_center_properties.resource_project + # security_center_properties.resource_project_display_name + # security_center_properties.resource_type + # @param read_time [::Google::Protobuf::Timestamp, ::Hash] + # Time used as a reference point when filtering assets. The filter is limited + # to assets existing at the supplied time and their values are those at that + # specific time. Absence of this field will default to the API's version of + # NOW. + # @param compare_duration [::Google::Protobuf::Duration, ::Hash] + # When compare_duration is set, the ListAssetsResult's "state_change" + # attribute is updated to indicate whether the asset was added, removed, or + # remained present during the compare_duration period of time that precedes + # the read_time. This is the time between (read_time - compare_duration) and + # read_time. + # + # The state_change value is derived based on the presence of the asset at the + # two points in time. Intermediate state changes between the two times don't + # affect the result. For example, the results aren't affected if the asset is + # removed and re-created again. + # + # Possible "state_change" values when compare_duration is specified: + # + # * "ADDED": indicates that the asset was not present at the start of + # compare_duration, but present at read_time. + # * "REMOVED": indicates that the asset was present at the start of + # compare_duration, but not present at read_time. + # * "ACTIVE": indicates that the asset was present at both the + # start and the end of the time period defined by + # compare_duration and read_time. + # + # If compare_duration is not specified, then the only possible state_change + # is "UNUSED", which will be the state_change set for all assets present at + # read_time. + # @param field_mask [::Google::Protobuf::FieldMask, ::Hash] + # A field mask to specify the ListAssetsResult fields to be listed in the + # response. + # An empty field mask will list all fields. + # @param page_token [::String] + # The value returned by the last `ListAssetsResponse`; indicates + # that this is a continuation of a prior `ListAssets` call, and + # that the system should return the next page of data. + # @param page_size [::Integer] + # The maximum number of results to return in a single response. Default is + # 10, minimum is 1, maximum is 1000. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Gapic::PagedEnumerable<::Google::Cloud::SecurityCenter::V1p1beta1::ListAssetsResponse::ListAssetsResult>] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Gapic::PagedEnumerable<::Google::Cloud::SecurityCenter::V1p1beta1::ListAssetsResponse::ListAssetsResult>] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/security_center/v1p1beta1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::SecurityCenter::V1p1beta1::SecurityCenter::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::SecurityCenter::V1p1beta1::ListAssetsRequest.new + # + # # Call the list_assets method. + # result = client.list_assets request + # + # # The returned object is of type Gapic::PagedEnumerable. You can iterate + # # over elements, and API calls will be issued to fetch pages as needed. + # result.each do |item| + # # Each element is of type ::Google::Cloud::SecurityCenter::V1p1beta1::ListAssetsResponse::ListAssetsResult. + # p item + # end + # + def list_assets request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::SecurityCenter::V1p1beta1::ListAssetsRequest + + # Converts hash 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_assets.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::SecurityCenter::V1p1beta1::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_assets.timeout, + metadata: metadata, + retry_policy: @config.rpcs.list_assets.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @security_center_stub.call_rpc :list_assets, request, options: options do |response, operation| + response = ::Gapic::PagedEnumerable.new @security_center_stub, :list_assets, 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 + + ## + # Lists an organization or source's findings. + # + # To list across all sources provide a `-` as the source id. + # Example: /v1p1beta1/organizations/\\{organization_id}/sources/-/findings + # + # @overload list_findings(request, options = nil) + # Pass arguments to `list_findings` via a request object, either of type + # {::Google::Cloud::SecurityCenter::V1p1beta1::ListFindingsRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::SecurityCenter::V1p1beta1::ListFindingsRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_findings(parent: nil, filter: nil, order_by: nil, read_time: nil, compare_duration: nil, field_mask: nil, page_token: nil, page_size: nil) + # Pass arguments to `list_findings` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param parent [::String] + # Required. Name of the source the findings belong to. Its format is + # "organizations/[organization_id]/sources/[source_id], + # folders/[folder_id]/sources/[source_id], or + # projects/[project_id]/sources/[source_id]". To list across all sources + # provide a source_id of `-`. For example: + # organizations/\\{organization_id}/sources/-, folders/\\{folder_id}/sources/- or + # projects/\\{projects_id}/sources/- + # @param filter [::String] + # Expression that defines the filter to apply across findings. + # The expression is a list of one or more restrictions combined via logical + # operators `AND` and `OR`. + # Parentheses are supported, and `OR` has higher precedence than `AND`. + # + # Restrictions have the form ` ` and may have a `-` + # character in front of them to indicate negation. Examples include: + # + # * name + # * source_properties.a_property + # * security_marks.marks.marka + # + # The supported operators are: + # + # * `=` for all value types. + # * `>`, `<`, `>=`, `<=` for integer values. + # * `:`, meaning substring matching, for strings. + # + # The supported value types are: + # + # * string literals in quotes. + # * integer literals without quotes. + # * boolean literals `true` and `false` without quotes. + # + # The following field and operator combinations are supported: + # + # * name: `=` + # * parent: `=`, `:` + # * resource_name: `=`, `:` + # * state: `=`, `:` + # * category: `=`, `:` + # * external_uri: `=`, `:` + # * event_time: `=`, `>`, `<`, `>=`, `<=` + # * severity: `=`, `:` + # + # Usage: This should be milliseconds since epoch or an RFC3339 string. + # Examples: + # `event_time = "2019-06-10T16:07:18-07:00"` + # `event_time = 1560208038000` + # + # security_marks.marks: `=`, `:` + # source_properties: `=`, `:`, `>`, `<`, `>=`, `<=` + # + # For example, `source_properties.size = 100` is a valid filter string. + # + # Use a partial match on the empty string to filter based on a property + # existing: `source_properties.my_property : ""` + # + # Use a negated partial match on the empty string to filter based on a + # property not existing: `-source_properties.my_property : ""` + # @param order_by [::String] + # Expression that defines what fields and order to use for sorting. The + # string value should follow SQL syntax: comma separated list of fields. For + # example: "name,resource_properties.a_property". The default sorting order + # is ascending. To specify descending order for a field, a suffix " desc" + # should be appended to the field name. For example: "name + # desc,source_properties.a_property". Redundant space characters in the + # syntax are insignificant. "name desc,source_properties.a_property" and " + # name desc , source_properties.a_property " are equivalent. + # + # The following fields are supported: + # name + # parent + # state + # category + # resource_name + # event_time + # source_properties + # security_marks.marks + # @param read_time [::Google::Protobuf::Timestamp, ::Hash] + # Time used as a reference point when filtering findings. The filter is + # limited to findings existing at the supplied time and their values are + # those at that specific time. Absence of this field will default to the + # API's version of NOW. + # @param compare_duration [::Google::Protobuf::Duration, ::Hash] + # When compare_duration is set, the ListFindingsResult's "state_change" + # attribute is updated to indicate whether the finding had its state changed, + # the finding's state remained unchanged, or if the finding was added in any + # state during the compare_duration period of time that precedes the + # read_time. This is the time between (read_time - compare_duration) and + # read_time. + # + # The state_change value is derived based on the presence and state of the + # finding at the two points in time. Intermediate state changes between the + # two times don't affect the result. For example, the results aren't affected + # if the finding is made inactive and then active again. + # + # Possible "state_change" values when compare_duration is specified: + # + # * "CHANGED": indicates that the finding was present and matched the given + # filter at the start of compare_duration, but changed its + # state at read_time. + # * "UNCHANGED": indicates that the finding was present and matched the given + # filter at the start of compare_duration and did not change + # state at read_time. + # * "ADDED": indicates that the finding did not match the given filter or + # was not present at the start of compare_duration, but was + # present at read_time. + # * "REMOVED": indicates that the finding was present and matched the + # filter at the start of compare_duration, but did not match + # the filter at read_time. + # + # If compare_duration is not specified, then the only possible state_change + # is "UNUSED", which will be the state_change set for all findings present at + # read_time. + # @param field_mask [::Google::Protobuf::FieldMask, ::Hash] + # A field mask to specify the Finding fields to be listed in the response. + # An empty field mask will list all fields. + # @param page_token [::String] + # The value returned by the last `ListFindingsResponse`; indicates + # that this is a continuation of a prior `ListFindings` call, and + # that the system should return the next page of data. + # @param page_size [::Integer] + # The maximum number of results to return in a single response. Default is + # 10, minimum is 1, maximum is 1000. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Gapic::PagedEnumerable<::Google::Cloud::SecurityCenter::V1p1beta1::ListFindingsResponse::ListFindingsResult>] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Gapic::PagedEnumerable<::Google::Cloud::SecurityCenter::V1p1beta1::ListFindingsResponse::ListFindingsResult>] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/security_center/v1p1beta1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::SecurityCenter::V1p1beta1::SecurityCenter::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::SecurityCenter::V1p1beta1::ListFindingsRequest.new + # + # # Call the list_findings method. + # result = client.list_findings request + # + # # The returned object is of type Gapic::PagedEnumerable. You can iterate + # # over elements, and API calls will be issued to fetch pages as needed. + # result.each do |item| + # # Each element is of type ::Google::Cloud::SecurityCenter::V1p1beta1::ListFindingsResponse::ListFindingsResult. + # p item + # end + # + def list_findings request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::SecurityCenter::V1p1beta1::ListFindingsRequest + + # Converts hash 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_findings.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::SecurityCenter::V1p1beta1::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_findings.timeout, + metadata: metadata, + retry_policy: @config.rpcs.list_findings.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @security_center_stub.call_rpc :list_findings, request, options: options do |response, operation| + response = ::Gapic::PagedEnumerable.new @security_center_stub, :list_findings, 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 + + ## + # Lists notification configs. + # + # @overload list_notification_configs(request, options = nil) + # Pass arguments to `list_notification_configs` via a request object, either of type + # {::Google::Cloud::SecurityCenter::V1p1beta1::ListNotificationConfigsRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::SecurityCenter::V1p1beta1::ListNotificationConfigsRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_notification_configs(parent: nil, page_token: nil, page_size: nil) + # Pass arguments to `list_notification_configs` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param parent [::String] + # Required. Name of the organization to list notification configs. + # Its format is "organizations/[organization_id]". + # @param page_token [::String] + # The value returned by the last `ListNotificationConfigsResponse`; indicates + # that this is a continuation of a prior `ListNotificationConfigs` call, and + # that the system should return the next page of data. + # @param page_size [::Integer] + # The maximum number of results to return in a single response. Default is + # 10, minimum is 1, maximum is 1000. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Gapic::PagedEnumerable<::Google::Cloud::SecurityCenter::V1p1beta1::NotificationConfig>] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Gapic::PagedEnumerable<::Google::Cloud::SecurityCenter::V1p1beta1::NotificationConfig>] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/security_center/v1p1beta1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::SecurityCenter::V1p1beta1::SecurityCenter::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::SecurityCenter::V1p1beta1::ListNotificationConfigsRequest.new + # + # # Call the list_notification_configs method. + # result = client.list_notification_configs request + # + # # The returned object is of type Gapic::PagedEnumerable. You can iterate + # # over elements, and API calls will be issued to fetch pages as needed. + # result.each do |item| + # # Each element is of type ::Google::Cloud::SecurityCenter::V1p1beta1::NotificationConfig. + # p item + # end + # + def list_notification_configs request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::SecurityCenter::V1p1beta1::ListNotificationConfigsRequest + + # Converts hash 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_notification_configs.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::SecurityCenter::V1p1beta1::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_notification_configs.timeout, + metadata: metadata, + retry_policy: @config.rpcs.list_notification_configs.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @security_center_stub.call_rpc :list_notification_configs, request, options: options do |response, operation| + response = ::Gapic::PagedEnumerable.new @security_center_stub, :list_notification_configs, 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 + + ## + # Lists all sources belonging to an organization. + # + # @overload list_sources(request, options = nil) + # Pass arguments to `list_sources` via a request object, either of type + # {::Google::Cloud::SecurityCenter::V1p1beta1::ListSourcesRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::SecurityCenter::V1p1beta1::ListSourcesRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_sources(parent: nil, page_token: nil, page_size: nil) + # Pass arguments to `list_sources` via keyword arguments. Note that at + # least one keyword argument is 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. Resource name of the parent of sources to list. Its format should be + # "organizations/[organization_id], folders/[folder_id], or + # projects/[project_id]". + # @param page_token [::String] + # The value returned by the last `ListSourcesResponse`; indicates + # that this is a continuation of a prior `ListSources` call, and + # that the system should return the next page of data. + # @param page_size [::Integer] + # The maximum number of results to return in a single response. Default is + # 10, minimum is 1, maximum is 1000. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Gapic::PagedEnumerable<::Google::Cloud::SecurityCenter::V1p1beta1::Source>] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Gapic::PagedEnumerable<::Google::Cloud::SecurityCenter::V1p1beta1::Source>] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/security_center/v1p1beta1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::SecurityCenter::V1p1beta1::SecurityCenter::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::SecurityCenter::V1p1beta1::ListSourcesRequest.new + # + # # Call the list_sources method. + # result = client.list_sources request + # + # # The returned object is of type Gapic::PagedEnumerable. You can iterate + # # over elements, and API calls will be issued to fetch pages as needed. + # result.each do |item| + # # Each element is of type ::Google::Cloud::SecurityCenter::V1p1beta1::Source. + # p item + # end + # + def list_sources request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::SecurityCenter::V1p1beta1::ListSourcesRequest + + # Converts hash 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_sources.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::SecurityCenter::V1p1beta1::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_sources.timeout, + metadata: metadata, + retry_policy: @config.rpcs.list_sources.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @security_center_stub.call_rpc :list_sources, request, options: options do |response, operation| + response = ::Gapic::PagedEnumerable.new @security_center_stub, :list_sources, 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 + + ## + # Runs asset discovery. The discovery is tracked with a long-running + # operation. + # + # This API can only be called with limited frequency for an organization. If + # it is called too frequently the caller will receive a TOO_MANY_REQUESTS + # error. + # + # @overload run_asset_discovery(request, options = nil) + # Pass arguments to `run_asset_discovery` via a request object, either of type + # {::Google::Cloud::SecurityCenter::V1p1beta1::RunAssetDiscoveryRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::SecurityCenter::V1p1beta1::RunAssetDiscoveryRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. + # + # @overload run_asset_discovery(parent: nil) + # Pass arguments to `run_asset_discovery` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param parent [::String] + # Required. Name of the organization to run asset discovery for. Its format is + # "organizations/[organization_id]". + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Gapic::Operation] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Gapic::Operation] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/security_center/v1p1beta1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::SecurityCenter::V1p1beta1::SecurityCenter::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::SecurityCenter::V1p1beta1::RunAssetDiscoveryRequest.new + # + # # Call the run_asset_discovery method. + # result = client.run_asset_discovery 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 run_asset_discovery request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::SecurityCenter::V1p1beta1::RunAssetDiscoveryRequest + + # Converts hash 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.run_asset_discovery.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::SecurityCenter::V1p1beta1::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.run_asset_discovery.timeout, + metadata: metadata, + retry_policy: @config.rpcs.run_asset_discovery.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @security_center_stub.call_rpc :run_asset_discovery, request, options: options do |response, operation| + response = ::Gapic::Operation.new response, @operations_client, options: options + yield response, operation if block_given? + throw :response, response + end + rescue ::GRPC::BadStatus => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Updates the state of a finding. + # + # @overload set_finding_state(request, options = nil) + # Pass arguments to `set_finding_state` via a request object, either of type + # {::Google::Cloud::SecurityCenter::V1p1beta1::SetFindingStateRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::SecurityCenter::V1p1beta1::SetFindingStateRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. + # + # @overload set_finding_state(name: nil, state: nil, start_time: nil) + # Pass arguments to `set_finding_state` via keyword arguments. Note that at + # least one keyword argument is 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 relative resource name of the finding. See: + # https://cloud.google.com/apis/design/resource_names#relative_resource_name + # Example: + # "organizations/\\{organization_id}/sources/\\{source_id}/finding/\\{finding_id}". + # @param state [::Google::Cloud::SecurityCenter::V1p1beta1::Finding::State] + # Required. The desired State of the finding. + # @param start_time [::Google::Protobuf::Timestamp, ::Hash] + # Required. The time at which the updated state takes effect. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Google::Cloud::SecurityCenter::V1p1beta1::Finding] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Google::Cloud::SecurityCenter::V1p1beta1::Finding] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/security_center/v1p1beta1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::SecurityCenter::V1p1beta1::SecurityCenter::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::SecurityCenter::V1p1beta1::SetFindingStateRequest.new + # + # # Call the set_finding_state method. + # result = client.set_finding_state request + # + # # The returned object is of type Google::Cloud::SecurityCenter::V1p1beta1::Finding. + # p result + # + def set_finding_state request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::SecurityCenter::V1p1beta1::SetFindingStateRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + metadata = @config.rpcs.set_finding_state.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::SecurityCenter::V1p1beta1::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.set_finding_state.timeout, + metadata: metadata, + retry_policy: @config.rpcs.set_finding_state.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @security_center_stub.call_rpc :set_finding_state, request, options: options do |response, operation| + yield response, operation if block_given? + end + rescue ::GRPC::BadStatus => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Sets the access control policy on the specified Source. + # + # @overload set_iam_policy(request, options = nil) + # Pass arguments to `set_iam_policy` via a request object, either of type + # {::Google::Iam::V1::SetIamPolicyRequest} or an equivalent Hash. + # + # @param request [::Google::Iam::V1::SetIamPolicyRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. + # + # @overload set_iam_policy(resource: nil, policy: nil, update_mask: nil) + # Pass arguments to `set_iam_policy` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param resource [::String] + # REQUIRED: The resource for which the policy is being specified. + # See the operation documentation for the appropriate value for this field. + # @param policy [::Google::Iam::V1::Policy, ::Hash] + # REQUIRED: The complete policy to be applied to the `resource`. The size of + # the policy is limited to a few 10s of KB. An empty policy is a + # valid policy but certain Cloud Platform services (such as Projects) + # might reject them. + # @param update_mask [::Google::Protobuf::FieldMask, ::Hash] + # OPTIONAL: A FieldMask specifying which fields of the policy to modify. Only + # the fields in the mask will be modified. If no mask is provided, the + # following default mask is used: + # + # `paths: "bindings, etag"` + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Google::Iam::V1::Policy] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Google::Iam::V1::Policy] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/security_center/v1p1beta1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::SecurityCenter::V1p1beta1::SecurityCenter::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Iam::V1::SetIamPolicyRequest.new + # + # # Call the set_iam_policy method. + # result = client.set_iam_policy request + # + # # The returned object is of type Google::Iam::V1::Policy. + # p result + # + def set_iam_policy request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Iam::V1::SetIamPolicyRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + metadata = @config.rpcs.set_iam_policy.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::SecurityCenter::V1p1beta1::VERSION + metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.resource + header_params["resource"] = request.resource + end + + request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") + metadata[:"x-goog-request-params"] ||= request_params_header + + options.apply_defaults timeout: @config.rpcs.set_iam_policy.timeout, + metadata: metadata, + retry_policy: @config.rpcs.set_iam_policy.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @security_center_stub.call_rpc :set_iam_policy, request, options: options do |response, operation| + yield response, operation if block_given? + end + rescue ::GRPC::BadStatus => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Returns the permissions that a caller has on the specified source. + # + # @overload test_iam_permissions(request, options = nil) + # Pass arguments to `test_iam_permissions` via a request object, either of type + # {::Google::Iam::V1::TestIamPermissionsRequest} or an equivalent Hash. + # + # @param request [::Google::Iam::V1::TestIamPermissionsRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. + # + # @overload test_iam_permissions(resource: nil, permissions: nil) + # Pass arguments to `test_iam_permissions` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param resource [::String] + # REQUIRED: The resource for which the policy detail is being requested. + # See the operation documentation for the appropriate value for this field. + # @param permissions [::Array<::String>] + # The set of permissions to check for the `resource`. Permissions with + # wildcards (such as '*' or 'storage.*') are not allowed. For more + # information see + # [IAM Overview](https://cloud.google.com/iam/docs/overview#permissions). + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Google::Iam::V1::TestIamPermissionsResponse] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Google::Iam::V1::TestIamPermissionsResponse] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/security_center/v1p1beta1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::SecurityCenter::V1p1beta1::SecurityCenter::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Iam::V1::TestIamPermissionsRequest.new + # + # # Call the test_iam_permissions method. + # result = client.test_iam_permissions request + # + # # The returned object is of type Google::Iam::V1::TestIamPermissionsResponse. + # p result + # + def test_iam_permissions request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Iam::V1::TestIamPermissionsRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + metadata = @config.rpcs.test_iam_permissions.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::SecurityCenter::V1p1beta1::VERSION + metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.resource + header_params["resource"] = request.resource + end + + request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") + metadata[:"x-goog-request-params"] ||= request_params_header + + options.apply_defaults timeout: @config.rpcs.test_iam_permissions.timeout, + metadata: metadata, + retry_policy: @config.rpcs.test_iam_permissions.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @security_center_stub.call_rpc :test_iam_permissions, request, options: options do |response, operation| + yield response, operation if block_given? + end + rescue ::GRPC::BadStatus => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Creates or updates a finding. The corresponding source must exist for a + # finding creation to succeed. + # + # @overload update_finding(request, options = nil) + # Pass arguments to `update_finding` via a request object, either of type + # {::Google::Cloud::SecurityCenter::V1p1beta1::UpdateFindingRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::SecurityCenter::V1p1beta1::UpdateFindingRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_finding(finding: nil, update_mask: nil) + # Pass arguments to `update_finding` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param finding [::Google::Cloud::SecurityCenter::V1p1beta1::Finding, ::Hash] + # Required. The finding resource to update or create if it does not already exist. + # parent, security_marks, and update_time will be ignored. + # + # In the case of creation, the finding id portion of the name must be + # alphanumeric and less than or equal to 32 characters and greater than 0 + # characters in length. + # @param update_mask [::Google::Protobuf::FieldMask, ::Hash] + # The FieldMask to use when updating the finding resource. This field should + # not be specified when creating a finding. + # + # When updating a finding, an empty mask is treated as updating all mutable + # fields and replacing source_properties. Individual source_properties can + # be added/updated by using "source_properties." in the field + # mask. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Google::Cloud::SecurityCenter::V1p1beta1::Finding] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Google::Cloud::SecurityCenter::V1p1beta1::Finding] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/security_center/v1p1beta1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::SecurityCenter::V1p1beta1::SecurityCenter::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::SecurityCenter::V1p1beta1::UpdateFindingRequest.new + # + # # Call the update_finding method. + # result = client.update_finding request + # + # # The returned object is of type Google::Cloud::SecurityCenter::V1p1beta1::Finding. + # p result + # + def update_finding request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::SecurityCenter::V1p1beta1::UpdateFindingRequest + + # Converts hash 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_finding.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::SecurityCenter::V1p1beta1::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.finding&.name + header_params["finding.name"] = request.finding.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_finding.timeout, + metadata: metadata, + retry_policy: @config.rpcs.update_finding.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @security_center_stub.call_rpc :update_finding, 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 notification config. The following update + # fields are allowed: description, pubsub_topic, streaming_config.filter + # + # @overload update_notification_config(request, options = nil) + # Pass arguments to `update_notification_config` via a request object, either of type + # {::Google::Cloud::SecurityCenter::V1p1beta1::UpdateNotificationConfigRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::SecurityCenter::V1p1beta1::UpdateNotificationConfigRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_notification_config(notification_config: nil, update_mask: nil) + # Pass arguments to `update_notification_config` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param notification_config [::Google::Cloud::SecurityCenter::V1p1beta1::NotificationConfig, ::Hash] + # Required. The notification config to update. + # @param update_mask [::Google::Protobuf::FieldMask, ::Hash] + # The FieldMask to use when updating the notification config. + # + # If empty all mutable fields will be updated. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Google::Cloud::SecurityCenter::V1p1beta1::NotificationConfig] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Google::Cloud::SecurityCenter::V1p1beta1::NotificationConfig] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/security_center/v1p1beta1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::SecurityCenter::V1p1beta1::SecurityCenter::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::SecurityCenter::V1p1beta1::UpdateNotificationConfigRequest.new + # + # # Call the update_notification_config method. + # result = client.update_notification_config request + # + # # The returned object is of type Google::Cloud::SecurityCenter::V1p1beta1::NotificationConfig. + # p result + # + def update_notification_config request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::SecurityCenter::V1p1beta1::UpdateNotificationConfigRequest + + # Converts hash 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_notification_config.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::SecurityCenter::V1p1beta1::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.notification_config&.name + header_params["notification_config.name"] = request.notification_config.name + end + + request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") + metadata[:"x-goog-request-params"] ||= request_params_header + + options.apply_defaults timeout: @config.rpcs.update_notification_config.timeout, + metadata: metadata, + retry_policy: @config.rpcs.update_notification_config.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @security_center_stub.call_rpc :update_notification_config, request, options: options do |response, operation| + yield response, operation if block_given? + end + rescue ::GRPC::BadStatus => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Updates an organization's settings. + # + # @overload update_organization_settings(request, options = nil) + # Pass arguments to `update_organization_settings` via a request object, either of type + # {::Google::Cloud::SecurityCenter::V1p1beta1::UpdateOrganizationSettingsRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::SecurityCenter::V1p1beta1::UpdateOrganizationSettingsRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. + # + # @overload update_organization_settings(organization_settings: nil, update_mask: nil) + # Pass arguments to `update_organization_settings` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param organization_settings [::Google::Cloud::SecurityCenter::V1p1beta1::OrganizationSettings, ::Hash] + # Required. The organization settings resource to update. + # @param update_mask [::Google::Protobuf::FieldMask, ::Hash] + # The FieldMask to use when updating the settings resource. + # + # If empty all mutable fields will be updated. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Google::Cloud::SecurityCenter::V1p1beta1::OrganizationSettings] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Google::Cloud::SecurityCenter::V1p1beta1::OrganizationSettings] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/security_center/v1p1beta1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::SecurityCenter::V1p1beta1::SecurityCenter::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::SecurityCenter::V1p1beta1::UpdateOrganizationSettingsRequest.new + # + # # Call the update_organization_settings method. + # result = client.update_organization_settings request + # + # # The returned object is of type Google::Cloud::SecurityCenter::V1p1beta1::OrganizationSettings. + # p result + # + def update_organization_settings request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::SecurityCenter::V1p1beta1::UpdateOrganizationSettingsRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + metadata = @config.rpcs.update_organization_settings.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::SecurityCenter::V1p1beta1::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.organization_settings&.name + header_params["organization_settings.name"] = request.organization_settings.name + end + + request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") + metadata[:"x-goog-request-params"] ||= request_params_header + + options.apply_defaults timeout: @config.rpcs.update_organization_settings.timeout, + metadata: metadata, + retry_policy: @config.rpcs.update_organization_settings.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @security_center_stub.call_rpc :update_organization_settings, 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 source. + # + # @overload update_source(request, options = nil) + # Pass arguments to `update_source` via a request object, either of type + # {::Google::Cloud::SecurityCenter::V1p1beta1::UpdateSourceRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::SecurityCenter::V1p1beta1::UpdateSourceRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_source(source: nil, update_mask: nil) + # Pass arguments to `update_source` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param source [::Google::Cloud::SecurityCenter::V1p1beta1::Source, ::Hash] + # Required. The source resource to update. + # @param update_mask [::Google::Protobuf::FieldMask, ::Hash] + # The FieldMask to use when updating the source resource. + # + # If empty all mutable fields will be updated. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Google::Cloud::SecurityCenter::V1p1beta1::Source] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Google::Cloud::SecurityCenter::V1p1beta1::Source] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/security_center/v1p1beta1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::SecurityCenter::V1p1beta1::SecurityCenter::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::SecurityCenter::V1p1beta1::UpdateSourceRequest.new + # + # # Call the update_source method. + # result = client.update_source request + # + # # The returned object is of type Google::Cloud::SecurityCenter::V1p1beta1::Source. + # p result + # + def update_source request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::SecurityCenter::V1p1beta1::UpdateSourceRequest + + # Converts hash 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_source.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::SecurityCenter::V1p1beta1::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.source&.name + header_params["source.name"] = request.source.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_source.timeout, + metadata: metadata, + retry_policy: @config.rpcs.update_source.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @security_center_stub.call_rpc :update_source, 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 security marks. + # + # @overload update_security_marks(request, options = nil) + # Pass arguments to `update_security_marks` via a request object, either of type + # {::Google::Cloud::SecurityCenter::V1p1beta1::UpdateSecurityMarksRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::SecurityCenter::V1p1beta1::UpdateSecurityMarksRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_security_marks(security_marks: nil, update_mask: nil, start_time: nil) + # Pass arguments to `update_security_marks` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param security_marks [::Google::Cloud::SecurityCenter::V1p1beta1::SecurityMarks, ::Hash] + # Required. The security marks resource to update. + # @param update_mask [::Google::Protobuf::FieldMask, ::Hash] + # The FieldMask to use when updating the security marks resource. + # + # The field mask must not contain duplicate fields. + # If empty or set to "marks", all marks will be replaced. Individual + # marks can be updated using "marks.". + # @param start_time [::Google::Protobuf::Timestamp, ::Hash] + # The time at which the updated SecurityMarks take effect. + # If not set uses current server time. Updates will be applied to the + # SecurityMarks that are active immediately preceding this time. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Google::Cloud::SecurityCenter::V1p1beta1::SecurityMarks] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Google::Cloud::SecurityCenter::V1p1beta1::SecurityMarks] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/security_center/v1p1beta1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::SecurityCenter::V1p1beta1::SecurityCenter::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::SecurityCenter::V1p1beta1::UpdateSecurityMarksRequest.new + # + # # Call the update_security_marks method. + # result = client.update_security_marks request + # + # # The returned object is of type Google::Cloud::SecurityCenter::V1p1beta1::SecurityMarks. + # p result + # + def update_security_marks request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::SecurityCenter::V1p1beta1::UpdateSecurityMarksRequest + + # Converts hash 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_security_marks.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::SecurityCenter::V1p1beta1::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.security_marks&.name + header_params["security_marks.name"] = request.security_marks.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_security_marks.timeout, + metadata: metadata, + retry_policy: @config.rpcs.update_security_marks.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @security_center_stub.call_rpc :update_security_marks, request, options: options do |response, operation| + yield response, operation if block_given? + end + rescue ::GRPC::BadStatus => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Configuration class for the SecurityCenter API. + # + # This class represents the configuration for SecurityCenter, + # providing control over timeouts, retry behavior, logging, transport + # parameters, and other low-level controls. Certain parameters can also be + # applied individually to specific RPCs. See + # {::Google::Cloud::SecurityCenter::V1p1beta1::SecurityCenter::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_source to 20 seconds, + # # and all remaining timeouts to 10 seconds. + # ::Google::Cloud::SecurityCenter::V1p1beta1::SecurityCenter::Client.configure do |config| + # config.timeout = 10.0 + # config.rpcs.create_source.timeout = 20.0 + # end + # + # # Apply the above configuration only to a new client. + # client = ::Google::Cloud::SecurityCenter::V1p1beta1::SecurityCenter::Client.new do |config| + # config.timeout = 10.0 + # config.rpcs.create_source.timeout = 20.0 + # end + # + # @!attribute [rw] endpoint + # A custom service endpoint, as a hostname or hostname:port. The default is + # nil, indicating to use the default endpoint in the current universe domain. + # @return [::String,nil] + # @!attribute [rw] credentials + # Credentials to send with calls. You may provide any of the following types: + # * (`Google::Auth::Credentials`) A googleauth credentials object + # (see the [googleauth docs](https://rubydoc.info/gems/googleauth/Google/Auth/Credentials)) + # * (`Signet::OAuth2::Client`) A signet oauth2 client object + # (see the [signet docs](https://rubydoc.info/gems/signet/Signet/OAuth2/Client)) + # * (`GRPC::Core::Channel`) a gRPC channel with included credentials + # * (`GRPC::Core::ChannelCredentials`) a gRPC credentails object + # * (`nil`) indicating no credentials + # + # @note Warning: Passing a `String` to a keyfile path or a `Hash` of credentials + # is deprecated. Providing an unvalidated credential configuration to + # Google APIs can compromise the security of your systems and data. + # + # @example + # + # # The recommended way to provide credentials is to use the `make_creds` method + # # on the appropriate credentials class for your environment. + # + # require "googleauth" + # + # credentials = ::Google::Auth::ServiceAccountCredentials.make_creds( + # json_key_io: ::File.open("/path/to/keyfile.json") + # ) + # + # client = ::Google::Cloud::SecurityCenter::V1p1beta1::SecurityCenter::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 = "securitycenter.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 SecurityCenter 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_source` + # @return [::Gapic::Config::Method] + # + attr_reader :create_source + ## + # RPC-specific configuration for `create_finding` + # @return [::Gapic::Config::Method] + # + attr_reader :create_finding + ## + # RPC-specific configuration for `create_notification_config` + # @return [::Gapic::Config::Method] + # + attr_reader :create_notification_config + ## + # RPC-specific configuration for `delete_notification_config` + # @return [::Gapic::Config::Method] + # + attr_reader :delete_notification_config + ## + # RPC-specific configuration for `get_iam_policy` + # @return [::Gapic::Config::Method] + # + attr_reader :get_iam_policy + ## + # RPC-specific configuration for `get_notification_config` + # @return [::Gapic::Config::Method] + # + attr_reader :get_notification_config + ## + # RPC-specific configuration for `get_organization_settings` + # @return [::Gapic::Config::Method] + # + attr_reader :get_organization_settings + ## + # RPC-specific configuration for `get_source` + # @return [::Gapic::Config::Method] + # + attr_reader :get_source + ## + # RPC-specific configuration for `group_assets` + # @return [::Gapic::Config::Method] + # + attr_reader :group_assets + ## + # RPC-specific configuration for `group_findings` + # @return [::Gapic::Config::Method] + # + attr_reader :group_findings + ## + # RPC-specific configuration for `list_assets` + # @return [::Gapic::Config::Method] + # + attr_reader :list_assets + ## + # RPC-specific configuration for `list_findings` + # @return [::Gapic::Config::Method] + # + attr_reader :list_findings + ## + # RPC-specific configuration for `list_notification_configs` + # @return [::Gapic::Config::Method] + # + attr_reader :list_notification_configs + ## + # RPC-specific configuration for `list_sources` + # @return [::Gapic::Config::Method] + # + attr_reader :list_sources + ## + # RPC-specific configuration for `run_asset_discovery` + # @return [::Gapic::Config::Method] + # + attr_reader :run_asset_discovery + ## + # RPC-specific configuration for `set_finding_state` + # @return [::Gapic::Config::Method] + # + attr_reader :set_finding_state + ## + # RPC-specific configuration for `set_iam_policy` + # @return [::Gapic::Config::Method] + # + attr_reader :set_iam_policy + ## + # RPC-specific configuration for `test_iam_permissions` + # @return [::Gapic::Config::Method] + # + attr_reader :test_iam_permissions + ## + # RPC-specific configuration for `update_finding` + # @return [::Gapic::Config::Method] + # + attr_reader :update_finding + ## + # RPC-specific configuration for `update_notification_config` + # @return [::Gapic::Config::Method] + # + attr_reader :update_notification_config + ## + # RPC-specific configuration for `update_organization_settings` + # @return [::Gapic::Config::Method] + # + attr_reader :update_organization_settings + ## + # RPC-specific configuration for `update_source` + # @return [::Gapic::Config::Method] + # + attr_reader :update_source + ## + # RPC-specific configuration for `update_security_marks` + # @return [::Gapic::Config::Method] + # + attr_reader :update_security_marks + + # @private + def initialize parent_rpcs = nil + create_source_config = parent_rpcs.create_source if parent_rpcs.respond_to? :create_source + @create_source = ::Gapic::Config::Method.new create_source_config + create_finding_config = parent_rpcs.create_finding if parent_rpcs.respond_to? :create_finding + @create_finding = ::Gapic::Config::Method.new create_finding_config + create_notification_config_config = parent_rpcs.create_notification_config if parent_rpcs.respond_to? :create_notification_config + @create_notification_config = ::Gapic::Config::Method.new create_notification_config_config + delete_notification_config_config = parent_rpcs.delete_notification_config if parent_rpcs.respond_to? :delete_notification_config + @delete_notification_config = ::Gapic::Config::Method.new delete_notification_config_config + get_iam_policy_config = parent_rpcs.get_iam_policy if parent_rpcs.respond_to? :get_iam_policy + @get_iam_policy = ::Gapic::Config::Method.new get_iam_policy_config + get_notification_config_config = parent_rpcs.get_notification_config if parent_rpcs.respond_to? :get_notification_config + @get_notification_config = ::Gapic::Config::Method.new get_notification_config_config + get_organization_settings_config = parent_rpcs.get_organization_settings if parent_rpcs.respond_to? :get_organization_settings + @get_organization_settings = ::Gapic::Config::Method.new get_organization_settings_config + get_source_config = parent_rpcs.get_source if parent_rpcs.respond_to? :get_source + @get_source = ::Gapic::Config::Method.new get_source_config + group_assets_config = parent_rpcs.group_assets if parent_rpcs.respond_to? :group_assets + @group_assets = ::Gapic::Config::Method.new group_assets_config + group_findings_config = parent_rpcs.group_findings if parent_rpcs.respond_to? :group_findings + @group_findings = ::Gapic::Config::Method.new group_findings_config + list_assets_config = parent_rpcs.list_assets if parent_rpcs.respond_to? :list_assets + @list_assets = ::Gapic::Config::Method.new list_assets_config + list_findings_config = parent_rpcs.list_findings if parent_rpcs.respond_to? :list_findings + @list_findings = ::Gapic::Config::Method.new list_findings_config + list_notification_configs_config = parent_rpcs.list_notification_configs if parent_rpcs.respond_to? :list_notification_configs + @list_notification_configs = ::Gapic::Config::Method.new list_notification_configs_config + list_sources_config = parent_rpcs.list_sources if parent_rpcs.respond_to? :list_sources + @list_sources = ::Gapic::Config::Method.new list_sources_config + run_asset_discovery_config = parent_rpcs.run_asset_discovery if parent_rpcs.respond_to? :run_asset_discovery + @run_asset_discovery = ::Gapic::Config::Method.new run_asset_discovery_config + set_finding_state_config = parent_rpcs.set_finding_state if parent_rpcs.respond_to? :set_finding_state + @set_finding_state = ::Gapic::Config::Method.new set_finding_state_config + set_iam_policy_config = parent_rpcs.set_iam_policy if parent_rpcs.respond_to? :set_iam_policy + @set_iam_policy = ::Gapic::Config::Method.new set_iam_policy_config + test_iam_permissions_config = parent_rpcs.test_iam_permissions if parent_rpcs.respond_to? :test_iam_permissions + @test_iam_permissions = ::Gapic::Config::Method.new test_iam_permissions_config + update_finding_config = parent_rpcs.update_finding if parent_rpcs.respond_to? :update_finding + @update_finding = ::Gapic::Config::Method.new update_finding_config + update_notification_config_config = parent_rpcs.update_notification_config if parent_rpcs.respond_to? :update_notification_config + @update_notification_config = ::Gapic::Config::Method.new update_notification_config_config + update_organization_settings_config = parent_rpcs.update_organization_settings if parent_rpcs.respond_to? :update_organization_settings + @update_organization_settings = ::Gapic::Config::Method.new update_organization_settings_config + update_source_config = parent_rpcs.update_source if parent_rpcs.respond_to? :update_source + @update_source = ::Gapic::Config::Method.new update_source_config + update_security_marks_config = parent_rpcs.update_security_marks if parent_rpcs.respond_to? :update_security_marks + @update_security_marks = ::Gapic::Config::Method.new update_security_marks_config + + yield self if block_given? + end + end + end + end + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-security_center-v1p1beta1/lib/google/cloud/security_center/v1p1beta1/security_center/credentials.rb b/owl-bot-staging/google-cloud-security_center-v1p1beta1/lib/google/cloud/security_center/v1p1beta1/security_center/credentials.rb new file mode 100644 index 000000000000..cff88a0ffb4f --- /dev/null +++ b/owl-bot-staging/google-cloud-security_center-v1p1beta1/lib/google/cloud/security_center/v1p1beta1/security_center/credentials.rb @@ -0,0 +1,51 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +require "googleauth" + +module Google + module Cloud + module SecurityCenter + module V1p1beta1 + module SecurityCenter + # Credentials for the SecurityCenter API. + class Credentials < ::Google::Auth::Credentials + self.scope = [ + "https://www.googleapis.com/auth/cloud-platform" + ] + self.env_vars = [ + "SECURITY_CENTER_CREDENTIALS", + "SECURITY_CENTER_KEYFILE", + "GOOGLE_CLOUD_CREDENTIALS", + "GOOGLE_CLOUD_KEYFILE", + "GCLOUD_KEYFILE", + "SECURITY_CENTER_CREDENTIALS_JSON", + "SECURITY_CENTER_KEYFILE_JSON", + "GOOGLE_CLOUD_CREDENTIALS_JSON", + "GOOGLE_CLOUD_KEYFILE_JSON", + "GCLOUD_KEYFILE_JSON" + ] + self.paths = [ + "~/.config/google_cloud/application_default_credentials.json" + ] + end + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-security_center-v1p1beta1/lib/google/cloud/security_center/v1p1beta1/security_center/operations.rb b/owl-bot-staging/google-cloud-security_center-v1p1beta1/lib/google/cloud/security_center/v1p1beta1/security_center/operations.rb new file mode 100644 index 000000000000..1feff06a9839 --- /dev/null +++ b/owl-bot-staging/google-cloud-security_center-v1p1beta1/lib/google/cloud/security_center/v1p1beta1/security_center/operations.rb @@ -0,0 +1,841 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +require "gapic/operation" +require "google/longrunning/operations_pb" + +module Google + module Cloud + module SecurityCenter + module V1p1beta1 + module SecurityCenter + # Service that implements Longrunning Operations API. + class Operations + # @private + API_VERSION = "" + + # @private + DEFAULT_ENDPOINT_TEMPLATE = "securitycenter.$UNIVERSE_DOMAIN$" + + # @private + attr_reader :operations_stub + + ## + # Configuration for the SecurityCenter 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 SecurityCenter 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::SecurityCenter::V1p1beta1::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::SecurityCenter::V1p1beta1::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::SecurityCenter::V1p1beta1::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::SecurityCenter::V1p1beta1::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::SecurityCenter::V1p1beta1::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 = "securitycenter.googleapis.com" + + config_attr :endpoint, nil, ::String, nil + config_attr :credentials, nil do |value| + allowed = [::String, ::Hash, ::Proc, ::Symbol, ::Google::Auth::Credentials, ::Google::Auth::BaseClient, ::Signet::OAuth2::Client, nil] + allowed += [::GRPC::Core::Channel, ::GRPC::Core::ChannelCredentials] if defined? ::GRPC::Core::Channel + allowed.any? { |klass| klass === value } + end + config_attr :scope, nil, ::String, ::Array, nil + config_attr :lib_name, nil, ::String, nil + config_attr :lib_version, nil, ::String, nil + config_attr(:channel_args, { "grpc.service_config_disable_resolution" => 1 }, ::Hash, nil) + config_attr :interceptors, nil, ::Array, nil + config_attr :timeout, nil, ::Numeric, nil + config_attr :metadata, nil, ::Hash, nil + config_attr :retry_policy, nil, ::Hash, ::Proc, nil + config_attr :quota_project, nil, ::String, nil + config_attr :universe_domain, nil, ::String, nil + config_attr :logger, :default, ::Logger, nil, :default + + # @private + def initialize parent_config = nil + @parent_config = parent_config unless parent_config.nil? + + yield self if block_given? + end + + ## + # Configurations for individual RPCs + # @return [Rpcs] + # + def rpcs + @rpcs ||= begin + parent_rpcs = nil + parent_rpcs = @parent_config.rpcs if defined?(@parent_config) && @parent_config.respond_to?(:rpcs) + Rpcs.new parent_rpcs + end + end + + ## + # Configuration for the channel pool + # @return [::Gapic::ServiceStub::ChannelPool::Configuration] + # + def channel_pool + @channel_pool ||= ::Gapic::ServiceStub::ChannelPool::Configuration.new + end + + ## + # Configuration RPC class for the Operations API. + # + # Includes fields providing the configuration for each RPC in this service. + # Each configuration object is of type `Gapic::Config::Method` and includes + # the following configuration fields: + # + # * `timeout` (*type:* `Numeric`) - The call timeout in seconds + # * `metadata` (*type:* `Hash{Symbol=>String}`) - Additional gRPC headers + # * `retry_policy (*type:* `Hash`) - The retry policy. The policy fields + # include the following keys: + # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds. + # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds. + # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier. + # * `:retry_codes` (*type:* `Array`) - The error codes that should + # trigger a retry. + # + class Rpcs + ## + # RPC-specific configuration for `list_operations` + # @return [::Gapic::Config::Method] + # + attr_reader :list_operations + ## + # RPC-specific configuration for `get_operation` + # @return [::Gapic::Config::Method] + # + attr_reader :get_operation + ## + # RPC-specific configuration for `delete_operation` + # @return [::Gapic::Config::Method] + # + attr_reader :delete_operation + ## + # RPC-specific configuration for `cancel_operation` + # @return [::Gapic::Config::Method] + # + attr_reader :cancel_operation + ## + # RPC-specific configuration for `wait_operation` + # @return [::Gapic::Config::Method] + # + attr_reader :wait_operation + + # @private + def initialize parent_rpcs = nil + list_operations_config = parent_rpcs.list_operations if parent_rpcs.respond_to? :list_operations + @list_operations = ::Gapic::Config::Method.new list_operations_config + get_operation_config = parent_rpcs.get_operation if parent_rpcs.respond_to? :get_operation + @get_operation = ::Gapic::Config::Method.new get_operation_config + delete_operation_config = parent_rpcs.delete_operation if parent_rpcs.respond_to? :delete_operation + @delete_operation = ::Gapic::Config::Method.new delete_operation_config + cancel_operation_config = parent_rpcs.cancel_operation if parent_rpcs.respond_to? :cancel_operation + @cancel_operation = ::Gapic::Config::Method.new cancel_operation_config + wait_operation_config = parent_rpcs.wait_operation if parent_rpcs.respond_to? :wait_operation + @wait_operation = ::Gapic::Config::Method.new wait_operation_config + + yield self if block_given? + end + end + end + end + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-security_center-v1p1beta1/lib/google/cloud/security_center/v1p1beta1/security_center/paths.rb b/owl-bot-staging/google-cloud-security_center-v1p1beta1/lib/google/cloud/security_center/v1p1beta1/security_center/paths.rb new file mode 100644 index 000000000000..7551d4c8776c --- /dev/null +++ b/owl-bot-staging/google-cloud-security_center-v1p1beta1/lib/google/cloud/security_center/v1p1beta1/security_center/paths.rb @@ -0,0 +1,330 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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 SecurityCenter + module V1p1beta1 + module SecurityCenter + # Path helper methods for the SecurityCenter API. + module Paths + ## + # Create a fully-qualified Finding resource string. + # + # @overload finding_path(organization:, source:, finding:) + # The resource will be in the following format: + # + # `organizations/{organization}/sources/{source}/findings/{finding}` + # + # @param organization [String] + # @param source [String] + # @param finding [String] + # + # @overload finding_path(folder:, source:, finding:) + # The resource will be in the following format: + # + # `folders/{folder}/sources/{source}/findings/{finding}` + # + # @param folder [String] + # @param source [String] + # @param finding [String] + # + # @overload finding_path(project:, source:, finding:) + # The resource will be in the following format: + # + # `projects/{project}/sources/{source}/findings/{finding}` + # + # @param project [String] + # @param source [String] + # @param finding [String] + # + # @return [::String] + def finding_path **args + resources = { + "finding:organization:source" => (proc do |organization:, source:, finding:| + raise ::ArgumentError, "organization cannot contain /" if organization.to_s.include? "/" + raise ::ArgumentError, "source cannot contain /" if source.to_s.include? "/" + + "organizations/#{organization}/sources/#{source}/findings/#{finding}" + end), + "finding:folder:source" => (proc do |folder:, source:, finding:| + raise ::ArgumentError, "folder cannot contain /" if folder.to_s.include? "/" + raise ::ArgumentError, "source cannot contain /" if source.to_s.include? "/" + + "folders/#{folder}/sources/#{source}/findings/#{finding}" + end), + "finding:project:source" => (proc do |project:, source:, finding:| + raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" + raise ::ArgumentError, "source cannot contain /" if source.to_s.include? "/" + + "projects/#{project}/sources/#{source}/findings/#{finding}" + 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 Folder resource string. + # + # The resource will be in the following format: + # + # `folders/{folder}` + # + # @param folder [String] + # + # @return [::String] + def folder_path folder: + "folders/#{folder}" + end + + ## + # Create a fully-qualified NotificationConfig resource string. + # + # The resource will be in the following format: + # + # `organizations/{organization}/notificationConfigs/{notification_config}` + # + # @param organization [String] + # @param notification_config [String] + # + # @return [::String] + def notification_config_path organization:, notification_config: + raise ::ArgumentError, "organization cannot contain /" if organization.to_s.include? "/" + + "organizations/#{organization}/notificationConfigs/#{notification_config}" + end + + ## + # Create a fully-qualified Organization resource string. + # + # The resource will be in the following format: + # + # `organizations/{organization}` + # + # @param organization [String] + # + # @return [::String] + def organization_path organization: + "organizations/#{organization}" + end + + ## + # Create a fully-qualified OrganizationSettings resource string. + # + # The resource will be in the following format: + # + # `organizations/{organization}/organizationSettings` + # + # @param organization [String] + # + # @return [::String] + def organization_settings_path organization: + "organizations/#{organization}/organizationSettings" + end + + ## + # Create a fully-qualified Project resource string. + # + # The resource will be in the following format: + # + # `projects/{project}` + # + # @param project [String] + # + # @return [::String] + def project_path project: + "projects/#{project}" + end + + ## + # Create a fully-qualified SecurityMarks resource string. + # + # @overload security_marks_path(organization:, asset:) + # The resource will be in the following format: + # + # `organizations/{organization}/assets/{asset}/securityMarks` + # + # @param organization [String] + # @param asset [String] + # + # @overload security_marks_path(organization:, source:, finding:) + # The resource will be in the following format: + # + # `organizations/{organization}/sources/{source}/findings/{finding}/securityMarks` + # + # @param organization [String] + # @param source [String] + # @param finding [String] + # + # @overload security_marks_path(folder:, asset:) + # The resource will be in the following format: + # + # `folders/{folder}/assets/{asset}/securityMarks` + # + # @param folder [String] + # @param asset [String] + # + # @overload security_marks_path(project:, asset:) + # The resource will be in the following format: + # + # `projects/{project}/assets/{asset}/securityMarks` + # + # @param project [String] + # @param asset [String] + # + # @overload security_marks_path(folder:, source:, finding:) + # The resource will be in the following format: + # + # `folders/{folder}/sources/{source}/findings/{finding}/securityMarks` + # + # @param folder [String] + # @param source [String] + # @param finding [String] + # + # @overload security_marks_path(project:, source:, finding:) + # The resource will be in the following format: + # + # `projects/{project}/sources/{source}/findings/{finding}/securityMarks` + # + # @param project [String] + # @param source [String] + # @param finding [String] + # + # @return [::String] + def security_marks_path **args + resources = { + "asset:organization" => (proc do |organization:, asset:| + raise ::ArgumentError, "organization cannot contain /" if organization.to_s.include? "/" + + "organizations/#{organization}/assets/#{asset}/securityMarks" + end), + "finding:organization:source" => (proc do |organization:, source:, finding:| + raise ::ArgumentError, "organization cannot contain /" if organization.to_s.include? "/" + raise ::ArgumentError, "source cannot contain /" if source.to_s.include? "/" + + "organizations/#{organization}/sources/#{source}/findings/#{finding}/securityMarks" + end), + "asset:folder" => (proc do |folder:, asset:| + raise ::ArgumentError, "folder cannot contain /" if folder.to_s.include? "/" + + "folders/#{folder}/assets/#{asset}/securityMarks" + end), + "asset:project" => (proc do |project:, asset:| + raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" + + "projects/#{project}/assets/#{asset}/securityMarks" + end), + "finding:folder:source" => (proc do |folder:, source:, finding:| + raise ::ArgumentError, "folder cannot contain /" if folder.to_s.include? "/" + raise ::ArgumentError, "source cannot contain /" if source.to_s.include? "/" + + "folders/#{folder}/sources/#{source}/findings/#{finding}/securityMarks" + end), + "finding:project:source" => (proc do |project:, source:, finding:| + raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" + raise ::ArgumentError, "source cannot contain /" if source.to_s.include? "/" + + "projects/#{project}/sources/#{source}/findings/#{finding}/securityMarks" + 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 Source resource string. + # + # @overload source_path(organization:, source:) + # The resource will be in the following format: + # + # `organizations/{organization}/sources/{source}` + # + # @param organization [String] + # @param source [String] + # + # @overload source_path(folder:, source:) + # The resource will be in the following format: + # + # `folders/{folder}/sources/{source}` + # + # @param folder [String] + # @param source [String] + # + # @overload source_path(project:, source:) + # The resource will be in the following format: + # + # `projects/{project}/sources/{source}` + # + # @param project [String] + # @param source [String] + # + # @return [::String] + def source_path **args + resources = { + "organization:source" => (proc do |organization:, source:| + raise ::ArgumentError, "organization cannot contain /" if organization.to_s.include? "/" + + "organizations/#{organization}/sources/#{source}" + end), + "folder:source" => (proc do |folder:, source:| + raise ::ArgumentError, "folder cannot contain /" if folder.to_s.include? "/" + + "folders/#{folder}/sources/#{source}" + end), + "project:source" => (proc do |project:, source:| + raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" + + "projects/#{project}/sources/#{source}" + end) + } + + resource = resources[args.keys.sort.join(":")] + raise ::ArgumentError, "no resource found for values #{args.keys}" if resource.nil? + resource.call(**args) + end + + ## + # Create a fully-qualified Topic resource string. + # + # The resource will be in the following format: + # + # `projects/{project}/topics/{topic}` + # + # @param project [String] + # @param topic [String] + # + # @return [::String] + def topic_path project:, topic: + raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" + + "projects/#{project}/topics/#{topic}" + end + + extend self + end + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-security_center-v1p1beta1/lib/google/cloud/security_center/v1p1beta1/security_center/rest.rb b/owl-bot-staging/google-cloud-security_center-v1p1beta1/lib/google/cloud/security_center/v1p1beta1/security_center/rest.rb new file mode 100644 index 000000000000..942518e93e2c --- /dev/null +++ b/owl-bot-staging/google-cloud-security_center-v1p1beta1/lib/google/cloud/security_center/v1p1beta1/security_center/rest.rb @@ -0,0 +1,53 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +require "gapic/rest" +require "gapic/config" +require "gapic/config/method" + +require "google/cloud/security_center/v1p1beta1/version" + +require "google/cloud/security_center/v1p1beta1/security_center/credentials" +require "google/cloud/security_center/v1p1beta1/security_center/paths" +require "google/cloud/security_center/v1p1beta1/security_center/rest/operations" +require "google/cloud/security_center/v1p1beta1/security_center/rest/client" + +module Google + module Cloud + module SecurityCenter + module V1p1beta1 + ## + # V1p1Beta1 APIs for Security Center service. + # + # To load this service and instantiate a REST client: + # + # require "google/cloud/security_center/v1p1beta1/security_center/rest" + # client = ::Google::Cloud::SecurityCenter::V1p1beta1::SecurityCenter::Rest::Client.new + # + module SecurityCenter + # Client for the REST transport + module Rest + end + end + end + end + end +end + +helper_path = ::File.join __dir__, "rest", "helpers.rb" +require "google/cloud/security_center/v1p1beta1/security_center/rest/helpers" if ::File.file? helper_path diff --git a/owl-bot-staging/google-cloud-security_center-v1p1beta1/lib/google/cloud/security_center/v1p1beta1/security_center/rest/client.rb b/owl-bot-staging/google-cloud-security_center-v1p1beta1/lib/google/cloud/security_center/v1p1beta1/security_center/rest/client.rb new file mode 100644 index 000000000000..3a2c7c82df87 --- /dev/null +++ b/owl-bot-staging/google-cloud-security_center-v1p1beta1/lib/google/cloud/security_center/v1p1beta1/security_center/rest/client.rb @@ -0,0 +1,3046 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +require "google/cloud/errors" +require "google/cloud/securitycenter/v1p1beta1/securitycenter_service_pb" +require "google/cloud/security_center/v1p1beta1/security_center/rest/service_stub" + +module Google + module Cloud + module SecurityCenter + module V1p1beta1 + module SecurityCenter + module Rest + ## + # REST client for the SecurityCenter service. + # + # V1p1Beta1 APIs for Security Center service. + # + class Client + # @private + API_VERSION = "" + + # @private + DEFAULT_ENDPOINT_TEMPLATE = "securitycenter.$UNIVERSE_DOMAIN$" + + include Paths + + # @private + attr_reader :security_center_stub + + ## + # Configure the SecurityCenter Client class. + # + # See {::Google::Cloud::SecurityCenter::V1p1beta1::SecurityCenter::Rest::Client::Configuration} + # for a description of the configuration fields. + # + # @example + # + # # Modify the configuration for all SecurityCenter clients + # ::Google::Cloud::SecurityCenter::V1p1beta1::SecurityCenter::Rest::Client.configure do |config| + # config.timeout = 10.0 + # end + # + # @yield [config] Configure the Client client. + # @yieldparam config [Client::Configuration] + # + # @return [Client::Configuration] + # + def self.configure + @configure ||= begin + namespace = ["Google", "Cloud", "SecurityCenter", "V1p1beta1"] + 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_source.timeout = 60.0 + + default_config.rpcs.create_finding.timeout = 60.0 + + default_config.rpcs.create_notification_config.timeout = 60.0 + + default_config.rpcs.delete_notification_config.timeout = 60.0 + + default_config.rpcs.get_iam_policy.timeout = 60.0 + default_config.rpcs.get_iam_policy.retry_policy = { + initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [4, 14] + } + + default_config.rpcs.get_notification_config.timeout = 60.0 + default_config.rpcs.get_notification_config.retry_policy = { + initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [4, 14] + } + + default_config.rpcs.get_organization_settings.timeout = 60.0 + default_config.rpcs.get_organization_settings.retry_policy = { + initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [4, 14] + } + + default_config.rpcs.get_source.timeout = 60.0 + default_config.rpcs.get_source.retry_policy = { + initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [4, 14] + } + + default_config.rpcs.group_assets.timeout = 480.0 + default_config.rpcs.group_assets.retry_policy = { + initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [4, 14] + } + + default_config.rpcs.group_findings.timeout = 480.0 + default_config.rpcs.group_findings.retry_policy = { + initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [4, 14] + } + + default_config.rpcs.list_assets.timeout = 480.0 + default_config.rpcs.list_assets.retry_policy = { + initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [4, 14] + } + + default_config.rpcs.list_findings.timeout = 480.0 + default_config.rpcs.list_findings.retry_policy = { + initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [4, 14] + } + + default_config.rpcs.list_notification_configs.timeout = 60.0 + default_config.rpcs.list_notification_configs.retry_policy = { + initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [4, 14] + } + + default_config.rpcs.list_sources.timeout = 60.0 + default_config.rpcs.list_sources.retry_policy = { + initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [4, 14] + } + + default_config.rpcs.run_asset_discovery.timeout = 60.0 + + default_config.rpcs.set_finding_state.timeout = 60.0 + + default_config.rpcs.set_iam_policy.timeout = 60.0 + + default_config.rpcs.test_iam_permissions.timeout = 60.0 + default_config.rpcs.test_iam_permissions.retry_policy = { + initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [4, 14] + } + + default_config.rpcs.update_finding.timeout = 60.0 + + default_config.rpcs.update_notification_config.timeout = 60.0 + + default_config.rpcs.update_organization_settings.timeout = 60.0 + + default_config.rpcs.update_source.timeout = 60.0 + + default_config.rpcs.update_security_marks.timeout = 480.0 + + default_config + end + yield @configure if block_given? + @configure + end + + ## + # Configure the SecurityCenter Client instance. + # + # The configuration is set to the derived mode, meaning that values can be changed, + # but structural changes (adding new fields, etc.) are not allowed. Structural changes + # should be made on {Client.configure}. + # + # See {::Google::Cloud::SecurityCenter::V1p1beta1::SecurityCenter::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 + @security_center_stub.universe_domain + end + + ## + # Create a new SecurityCenter REST client object. + # + # @example + # + # # Create a client using the default configuration + # client = ::Google::Cloud::SecurityCenter::V1p1beta1::SecurityCenter::Rest::Client.new + # + # # Create a client using a custom configuration + # client = ::Google::Cloud::SecurityCenter::V1p1beta1::SecurityCenter::Rest::Client.new do |config| + # config.timeout = 10.0 + # end + # + # @yield [config] Configure the SecurityCenter client. + # @yieldparam config [Client::Configuration] + # + def initialize + # Create the configuration object + @config = Configuration.new Client.configure + + # Yield the configuration if needed + yield @config if block_given? + + # Create credentials + credentials = @config.credentials + # Use self-signed JWT if the endpoint is unchanged from default, + # but only if the default endpoint does not have a region prefix. + enable_self_signed_jwt = @config.endpoint.nil? || + (@config.endpoint == Configuration::DEFAULT_ENDPOINT && + !@config.endpoint.split(".").first.include?("-")) + credentials ||= Credentials.default scope: @config.scope, + enable_self_signed_jwt: enable_self_signed_jwt + if credentials.is_a?(::String) || credentials.is_a?(::Hash) + credentials = Credentials.new credentials, scope: @config.scope + end + + @quota_project_id = @config.quota_project + @quota_project_id ||= credentials.quota_project_id if credentials.respond_to? :quota_project_id + + @operations_client = ::Google::Cloud::SecurityCenter::V1p1beta1::SecurityCenter::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 + + @security_center_stub = ::Google::Cloud::SecurityCenter::V1p1beta1::SecurityCenter::Rest::ServiceStub.new( + endpoint: @config.endpoint, + endpoint_template: DEFAULT_ENDPOINT_TEMPLATE, + universe_domain: @config.universe_domain, + credentials: credentials, + logger: @config.logger + ) + + @security_center_stub.logger(stub: true)&.info do |entry| + entry.set_system_name + entry.set_service + entry.message = "Created client for #{entry.service}" + entry.set_credentials_fields credentials + entry.set "customEndpoint", @config.endpoint if @config.endpoint + entry.set "defaultTimeout", @config.timeout if @config.timeout + entry.set "quotaProject", @quota_project_id if @quota_project_id + end + end + + ## + # Get the associated client for long-running operations. + # + # @return [::Google::Cloud::SecurityCenter::V1p1beta1::SecurityCenter::Rest::Operations] + # + attr_reader :operations_client + + ## + # The logger used for request/response debug logging. + # + # @return [Logger] + # + def logger + @security_center_stub.logger + end + + # Service calls + + ## + # Creates a source. + # + # @overload create_source(request, options = nil) + # Pass arguments to `create_source` via a request object, either of type + # {::Google::Cloud::SecurityCenter::V1p1beta1::CreateSourceRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::SecurityCenter::V1p1beta1::CreateSourceRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_source(parent: nil, source: nil) + # Pass arguments to `create_source` via keyword arguments. Note that at + # least one keyword argument is 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. Resource name of the new source's parent. Its format should be + # "organizations/[organization_id]". + # @param source [::Google::Cloud::SecurityCenter::V1p1beta1::Source, ::Hash] + # Required. The Source being created, only the display_name and description will be + # used. All other fields will be ignored. + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Cloud::SecurityCenter::V1p1beta1::Source] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::SecurityCenter::V1p1beta1::Source] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/security_center/v1p1beta1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::SecurityCenter::V1p1beta1::SecurityCenter::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::SecurityCenter::V1p1beta1::CreateSourceRequest.new + # + # # Call the create_source method. + # result = client.create_source request + # + # # The returned object is of type Google::Cloud::SecurityCenter::V1p1beta1::Source. + # p result + # + def create_source request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::SecurityCenter::V1p1beta1::CreateSourceRequest + + # Converts hash 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_source.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::SecurityCenter::V1p1beta1::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_source.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.create_source.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @security_center_stub.create_source request, options do |result, operation| + yield result, operation if block_given? + end + rescue ::Gapic::Rest::Error => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Creates a finding. The corresponding source must exist for finding + # creation to succeed. + # + # @overload create_finding(request, options = nil) + # Pass arguments to `create_finding` via a request object, either of type + # {::Google::Cloud::SecurityCenter::V1p1beta1::CreateFindingRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::SecurityCenter::V1p1beta1::CreateFindingRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_finding(parent: nil, finding_id: nil, finding: nil) + # Pass arguments to `create_finding` via keyword arguments. Note that at + # least one keyword argument is 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. Resource name of the new finding's parent. Its format should be + # "organizations/[organization_id]/sources/[source_id]". + # @param finding_id [::String] + # Required. Unique identifier provided by the client within the parent scope. + # @param finding [::Google::Cloud::SecurityCenter::V1p1beta1::Finding, ::Hash] + # Required. The Finding being created. The name and security_marks will be ignored as + # they are both output only fields on this resource. + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Cloud::SecurityCenter::V1p1beta1::Finding] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::SecurityCenter::V1p1beta1::Finding] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/security_center/v1p1beta1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::SecurityCenter::V1p1beta1::SecurityCenter::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::SecurityCenter::V1p1beta1::CreateFindingRequest.new + # + # # Call the create_finding method. + # result = client.create_finding request + # + # # The returned object is of type Google::Cloud::SecurityCenter::V1p1beta1::Finding. + # p result + # + def create_finding request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::SecurityCenter::V1p1beta1::CreateFindingRequest + + # Converts hash 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_finding.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::SecurityCenter::V1p1beta1::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_finding.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.create_finding.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @security_center_stub.create_finding request, options do |result, operation| + yield result, operation if block_given? + end + rescue ::Gapic::Rest::Error => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Creates a notification config. + # + # @overload create_notification_config(request, options = nil) + # Pass arguments to `create_notification_config` via a request object, either of type + # {::Google::Cloud::SecurityCenter::V1p1beta1::CreateNotificationConfigRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::SecurityCenter::V1p1beta1::CreateNotificationConfigRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_notification_config(parent: nil, config_id: nil, notification_config: nil) + # Pass arguments to `create_notification_config` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param parent [::String] + # Required. Resource name of the new notification config's parent. Its format is + # "organizations/[organization_id]". + # @param config_id [::String] + # Required. Unique identifier provided by the client within the parent scope. + # It must be between 1 and 128 characters, and contains alphanumeric + # characters, underscores or hyphens only. + # @param notification_config [::Google::Cloud::SecurityCenter::V1p1beta1::NotificationConfig, ::Hash] + # Required. The notification config being created. The name and the service account + # will be ignored as they are both output only fields on this resource. + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Cloud::SecurityCenter::V1p1beta1::NotificationConfig] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::SecurityCenter::V1p1beta1::NotificationConfig] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/security_center/v1p1beta1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::SecurityCenter::V1p1beta1::SecurityCenter::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::SecurityCenter::V1p1beta1::CreateNotificationConfigRequest.new + # + # # Call the create_notification_config method. + # result = client.create_notification_config request + # + # # The returned object is of type Google::Cloud::SecurityCenter::V1p1beta1::NotificationConfig. + # p result + # + def create_notification_config request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::SecurityCenter::V1p1beta1::CreateNotificationConfigRequest + + # Converts hash 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_notification_config.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::SecurityCenter::V1p1beta1::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_notification_config.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.create_notification_config.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @security_center_stub.create_notification_config request, options do |result, operation| + yield result, operation if block_given? + end + rescue ::Gapic::Rest::Error => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Deletes a notification config. + # + # @overload delete_notification_config(request, options = nil) + # Pass arguments to `delete_notification_config` via a request object, either of type + # {::Google::Cloud::SecurityCenter::V1p1beta1::DeleteNotificationConfigRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::SecurityCenter::V1p1beta1::DeleteNotificationConfigRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_notification_config(name: nil) + # Pass arguments to `delete_notification_config` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param name [::String] + # Required. Name of the notification config to delete. Its format is + # "organizations/[organization_id]/notificationConfigs/[config_id]". + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Protobuf::Empty] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Protobuf::Empty] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/security_center/v1p1beta1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::SecurityCenter::V1p1beta1::SecurityCenter::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::SecurityCenter::V1p1beta1::DeleteNotificationConfigRequest.new + # + # # Call the delete_notification_config method. + # result = client.delete_notification_config request + # + # # The returned object is of type Google::Protobuf::Empty. + # p result + # + def delete_notification_config request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::SecurityCenter::V1p1beta1::DeleteNotificationConfigRequest + + # Converts hash 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_notification_config.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::SecurityCenter::V1p1beta1::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_notification_config.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.delete_notification_config.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @security_center_stub.delete_notification_config request, options do |result, operation| + yield result, operation if block_given? + end + rescue ::Gapic::Rest::Error => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Gets the access control policy on the specified Source. + # + # @overload get_iam_policy(request, options = nil) + # Pass arguments to `get_iam_policy` via a request object, either of type + # {::Google::Iam::V1::GetIamPolicyRequest} or an equivalent Hash. + # + # @param request [::Google::Iam::V1::GetIamPolicyRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @overload get_iam_policy(resource: nil, options: nil) + # Pass arguments to `get_iam_policy` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param resource [::String] + # REQUIRED: The resource for which the policy is being requested. + # See the operation documentation for the appropriate value for this field. + # @param options [::Google::Iam::V1::GetPolicyOptions, ::Hash] + # OPTIONAL: A `GetPolicyOptions` object for specifying options to + # `GetIamPolicy`. + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Iam::V1::Policy] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Iam::V1::Policy] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/security_center/v1p1beta1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::SecurityCenter::V1p1beta1::SecurityCenter::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Iam::V1::GetIamPolicyRequest.new + # + # # Call the get_iam_policy method. + # result = client.get_iam_policy request + # + # # The returned object is of type Google::Iam::V1::Policy. + # p result + # + def get_iam_policy request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Iam::V1::GetIamPolicyRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + call_metadata = @config.rpcs.get_iam_policy.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::SecurityCenter::V1p1beta1::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + options.apply_defaults timeout: @config.rpcs.get_iam_policy.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.get_iam_policy.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @security_center_stub.get_iam_policy request, options do |result, operation| + yield result, operation if block_given? + end + rescue ::Gapic::Rest::Error => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Gets a notification config. + # + # @overload get_notification_config(request, options = nil) + # Pass arguments to `get_notification_config` via a request object, either of type + # {::Google::Cloud::SecurityCenter::V1p1beta1::GetNotificationConfigRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::SecurityCenter::V1p1beta1::GetNotificationConfigRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_notification_config(name: nil) + # Pass arguments to `get_notification_config` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param name [::String] + # Required. Name of the notification config to get. Its format is + # "organizations/[organization_id]/notificationConfigs/[config_id]". + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Cloud::SecurityCenter::V1p1beta1::NotificationConfig] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::SecurityCenter::V1p1beta1::NotificationConfig] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/security_center/v1p1beta1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::SecurityCenter::V1p1beta1::SecurityCenter::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::SecurityCenter::V1p1beta1::GetNotificationConfigRequest.new + # + # # Call the get_notification_config method. + # result = client.get_notification_config request + # + # # The returned object is of type Google::Cloud::SecurityCenter::V1p1beta1::NotificationConfig. + # p result + # + def get_notification_config request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::SecurityCenter::V1p1beta1::GetNotificationConfigRequest + + # Converts hash 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_notification_config.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::SecurityCenter::V1p1beta1::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_notification_config.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.get_notification_config.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @security_center_stub.get_notification_config request, options do |result, operation| + yield result, operation if block_given? + end + rescue ::Gapic::Rest::Error => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Gets the settings for an organization. + # + # @overload get_organization_settings(request, options = nil) + # Pass arguments to `get_organization_settings` via a request object, either of type + # {::Google::Cloud::SecurityCenter::V1p1beta1::GetOrganizationSettingsRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::SecurityCenter::V1p1beta1::GetOrganizationSettingsRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @overload get_organization_settings(name: nil) + # Pass arguments to `get_organization_settings` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param name [::String] + # Required. Name of the organization to get organization settings for. Its format is + # "organizations/[organization_id]/organizationSettings". + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Cloud::SecurityCenter::V1p1beta1::OrganizationSettings] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::SecurityCenter::V1p1beta1::OrganizationSettings] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/security_center/v1p1beta1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::SecurityCenter::V1p1beta1::SecurityCenter::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::SecurityCenter::V1p1beta1::GetOrganizationSettingsRequest.new + # + # # Call the get_organization_settings method. + # result = client.get_organization_settings request + # + # # The returned object is of type Google::Cloud::SecurityCenter::V1p1beta1::OrganizationSettings. + # p result + # + def get_organization_settings request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::SecurityCenter::V1p1beta1::GetOrganizationSettingsRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + call_metadata = @config.rpcs.get_organization_settings.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::SecurityCenter::V1p1beta1::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + options.apply_defaults timeout: @config.rpcs.get_organization_settings.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.get_organization_settings.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @security_center_stub.get_organization_settings request, options do |result, operation| + yield result, operation if block_given? + end + rescue ::Gapic::Rest::Error => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Gets a source. + # + # @overload get_source(request, options = nil) + # Pass arguments to `get_source` via a request object, either of type + # {::Google::Cloud::SecurityCenter::V1p1beta1::GetSourceRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::SecurityCenter::V1p1beta1::GetSourceRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_source(name: nil) + # Pass arguments to `get_source` via keyword arguments. Note that at + # least one keyword argument is 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. Relative resource name of the source. Its format is + # "organizations/[organization_id]/source/[source_id]". + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Cloud::SecurityCenter::V1p1beta1::Source] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::SecurityCenter::V1p1beta1::Source] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/security_center/v1p1beta1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::SecurityCenter::V1p1beta1::SecurityCenter::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::SecurityCenter::V1p1beta1::GetSourceRequest.new + # + # # Call the get_source method. + # result = client.get_source request + # + # # The returned object is of type Google::Cloud::SecurityCenter::V1p1beta1::Source. + # p result + # + def get_source request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::SecurityCenter::V1p1beta1::GetSourceRequest + + # Converts hash 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_source.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::SecurityCenter::V1p1beta1::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_source.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.get_source.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @security_center_stub.get_source 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 + + ## + # Filters an organization's assets and groups them by their specified + # properties. + # + # @overload group_assets(request, options = nil) + # Pass arguments to `group_assets` via a request object, either of type + # {::Google::Cloud::SecurityCenter::V1p1beta1::GroupAssetsRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::SecurityCenter::V1p1beta1::GroupAssetsRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @overload group_assets(parent: nil, filter: nil, group_by: nil, compare_duration: nil, read_time: nil, page_token: nil, page_size: nil) + # Pass arguments to `group_assets` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param parent [::String] + # Required. Name of the organization to groupBy. Its format is + # "organizations/[organization_id], folders/[folder_id], or + # projects/[project_id]". + # @param filter [::String] + # Expression that defines the filter to apply across assets. + # The expression is a list of zero or more restrictions combined via logical + # operators `AND` and `OR`. + # Parentheses are supported, and `OR` has higher precedence than `AND`. + # + # Restrictions have the form ` ` and may have a `-` + # character in front of them to indicate negation. The fields map to those + # defined in the Asset resource. Examples include: + # + # * name + # * security_center_properties.resource_name + # * resource_properties.a_property + # * security_marks.marks.marka + # + # The supported operators are: + # + # * `=` for all value types. + # * `>`, `<`, `>=`, `<=` for integer values. + # * `:`, meaning substring matching, for strings. + # + # The supported value types are: + # + # * string literals in quotes. + # * integer literals without quotes. + # * boolean literals `true` and `false` without quotes. + # + # The following field and operator combinations are supported: + # + # * name: `=` + # * update_time: `=`, `>`, `<`, `>=`, `<=` + # + # Usage: This should be milliseconds since epoch or an RFC3339 string. + # Examples: + # `update_time = "2019-06-10T16:07:18-07:00"` + # `update_time = 1560208038000` + # + # * create_time: `=`, `>`, `<`, `>=`, `<=` + # + # Usage: This should be milliseconds since epoch or an RFC3339 string. + # Examples: + # `create_time = "2019-06-10T16:07:18-07:00"` + # `create_time = 1560208038000` + # + # * iam_policy.policy_blob: `=`, `:` + # * resource_properties: `=`, `:`, `>`, `<`, `>=`, `<=` + # * security_marks.marks: `=`, `:` + # * security_center_properties.resource_name: `=`, `:` + # * security_center_properties.resource_name_display_name: `=`, `:` + # * security_center_properties.resource_type: `=`, `:` + # * security_center_properties.resource_parent: `=`, `:` + # * security_center_properties.resource_parent_display_name: `=`, `:` + # * security_center_properties.resource_project: `=`, `:` + # * security_center_properties.resource_project_display_name: `=`, `:` + # * security_center_properties.resource_owners: `=`, `:` + # + # For example, `resource_properties.size = 100` is a valid filter string. + # + # Use a partial match on the empty string to filter based on a property + # existing: `resource_properties.my_property : ""` + # + # Use a negated partial match on the empty string to filter based on a + # property not existing: `-resource_properties.my_property : ""` + # @param group_by [::String] + # Required. Expression that defines what assets fields to use for grouping. The string + # value should follow SQL syntax: comma separated list of fields. For + # example: + # "security_center_properties.resource_project,security_center_properties.project". + # + # The following fields are supported when compare_duration is not set: + # + # * security_center_properties.resource_project + # * security_center_properties.resource_project_display_name + # * security_center_properties.resource_type + # * security_center_properties.resource_parent + # * security_center_properties.resource_parent_display_name + # + # The following fields are supported when compare_duration is set: + # + # * security_center_properties.resource_type + # * security_center_properties.resource_project_display_name + # * security_center_properties.resource_parent_display_name + # @param compare_duration [::Google::Protobuf::Duration, ::Hash] + # When compare_duration is set, the GroupResult's "state_change" property is + # updated to indicate whether the asset was added, removed, or remained + # present during the compare_duration period of time that precedes the + # read_time. This is the time between (read_time - compare_duration) and + # read_time. + # + # The state change value is derived based on the presence of the asset at the + # two points in time. Intermediate state changes between the two times don't + # affect the result. For example, the results aren't affected if the asset is + # removed and re-created again. + # + # Possible "state_change" values when compare_duration is specified: + # + # * "ADDED": indicates that the asset was not present at the start of + # compare_duration, but present at reference_time. + # * "REMOVED": indicates that the asset was present at the start of + # compare_duration, but not present at reference_time. + # * "ACTIVE": indicates that the asset was present at both the + # start and the end of the time period defined by + # compare_duration and reference_time. + # + # If compare_duration is not specified, then the only possible state_change + # is "UNUSED", which will be the state_change set for all assets present at + # read_time. + # + # If this field is set then `state_change` must be a specified field in + # `group_by`. + # @param read_time [::Google::Protobuf::Timestamp, ::Hash] + # Time used as a reference point when filtering assets. The filter is limited + # to assets existing at the supplied time and their values are those at that + # specific time. Absence of this field will default to the API's version of + # NOW. + # @param page_token [::String] + # The value returned by the last `GroupAssetsResponse`; indicates + # that this is a continuation of a prior `GroupAssets` call, and that the + # system should return the next page of data. + # @param page_size [::Integer] + # The maximum number of results to return in a single response. Default is + # 10, minimum is 1, maximum is 1000. + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Gapic::Rest::PagedEnumerable<::Google::Cloud::SecurityCenter::V1p1beta1::GroupResult>] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Gapic::Rest::PagedEnumerable<::Google::Cloud::SecurityCenter::V1p1beta1::GroupResult>] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/security_center/v1p1beta1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::SecurityCenter::V1p1beta1::SecurityCenter::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::SecurityCenter::V1p1beta1::GroupAssetsRequest.new + # + # # Call the group_assets method. + # result = client.group_assets request + # + # # The returned object is of type Gapic::PagedEnumerable. You can iterate + # # over elements, and API calls will be issued to fetch pages as needed. + # result.each do |item| + # # Each element is of type ::Google::Cloud::SecurityCenter::V1p1beta1::GroupResult. + # p item + # end + # + def group_assets request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::SecurityCenter::V1p1beta1::GroupAssetsRequest + + # Converts hash 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.group_assets.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::SecurityCenter::V1p1beta1::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.group_assets.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.group_assets.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @security_center_stub.group_assets request, options do |result, operation| + result = ::Gapic::Rest::PagedEnumerable.new @security_center_stub, :group_assets, "group_by_results", 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 + + ## + # Filters an organization or source's findings and groups them by their + # specified properties. + # + # To group across all sources provide a `-` as the source id. + # Example: /v1/organizations/\\{organization_id}/sources/-/findings, + # /v1/folders/\\{folder_id}/sources/-/findings, + # /v1/projects/\\{project_id}/sources/-/findings + # + # @overload group_findings(request, options = nil) + # Pass arguments to `group_findings` via a request object, either of type + # {::Google::Cloud::SecurityCenter::V1p1beta1::GroupFindingsRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::SecurityCenter::V1p1beta1::GroupFindingsRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @overload group_findings(parent: nil, filter: nil, group_by: nil, read_time: nil, compare_duration: nil, page_token: nil, page_size: nil) + # Pass arguments to `group_findings` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param parent [::String] + # Required. Name of the source to groupBy. Its format is + # "organizations/[organization_id]/sources/[source_id]", + # folders/[folder_id]/sources/[source_id], or + # projects/[project_id]/sources/[source_id]. To groupBy across all sources + # provide a source_id of `-`. For example: + # organizations/\\{organization_id}/sources/-, folders/\\{folder_id}/sources/-, + # or projects/\\{project_id}/sources/- + # @param filter [::String] + # Expression that defines the filter to apply across findings. + # The expression is a list of one or more restrictions combined via logical + # operators `AND` and `OR`. + # Parentheses are supported, and `OR` has higher precedence than `AND`. + # + # Restrictions have the form ` ` and may have a `-` + # character in front of them to indicate negation. Examples include: + # + # * name + # * source_properties.a_property + # * security_marks.marks.marka + # + # The supported operators are: + # + # * `=` for all value types. + # * `>`, `<`, `>=`, `<=` for integer values. + # * `:`, meaning substring matching, for strings. + # + # The supported value types are: + # + # * string literals in quotes. + # * integer literals without quotes. + # * boolean literals `true` and `false` without quotes. + # + # The following field and operator combinations are supported: + # + # * name: `=` + # * parent: `=`, `:` + # * resource_name: `=`, `:` + # * state: `=`, `:` + # * category: `=`, `:` + # * external_uri: `=`, `:` + # * event_time: `=`, `>`, `<`, `>=`, `<=` + # * severity: `=`, `:` + # + # Usage: This should be milliseconds since epoch or an RFC3339 string. + # Examples: + # `event_time = "2019-06-10T16:07:18-07:00"` + # `event_time = 1560208038000` + # + # * security_marks.marks: `=`, `:` + # * source_properties: `=`, `:`, `>`, `<`, `>=`, `<=` + # + # For example, `source_properties.size = 100` is a valid filter string. + # + # Use a partial match on the empty string to filter based on a property + # existing: `source_properties.my_property : ""` + # + # Use a negated partial match on the empty string to filter based on a + # property not existing: `-source_properties.my_property : ""` + # @param group_by [::String] + # Required. Expression that defines what assets fields to use for grouping (including + # `state_change`). The string value should follow SQL syntax: comma separated + # list of fields. For example: "parent,resource_name". + # + # The following fields are supported: + # + # * resource_name + # * category + # * state + # * parent + # * severity + # + # The following fields are supported when compare_duration is set: + # + # * state_change + # @param read_time [::Google::Protobuf::Timestamp, ::Hash] + # Time used as a reference point when filtering findings. The filter is + # limited to findings existing at the supplied time and their values are + # those at that specific time. Absence of this field will default to the + # API's version of NOW. + # @param compare_duration [::Google::Protobuf::Duration, ::Hash] + # When compare_duration is set, the GroupResult's "state_change" attribute is + # updated to indicate whether the finding had its state changed, the + # finding's state remained unchanged, or if the finding was added during the + # compare_duration period of time that precedes the read_time. This is the + # time between (read_time - compare_duration) and read_time. + # + # The state_change value is derived based on the presence and state of the + # finding at the two points in time. Intermediate state changes between the + # two times don't affect the result. For example, the results aren't affected + # if the finding is made inactive and then active again. + # + # Possible "state_change" values when compare_duration is specified: + # + # * "CHANGED": indicates that the finding was present and matched the given + # filter at the start of compare_duration, but changed its + # state at read_time. + # * "UNCHANGED": indicates that the finding was present and matched the given + # filter at the start of compare_duration and did not change + # state at read_time. + # * "ADDED": indicates that the finding did not match the given filter or + # was not present at the start of compare_duration, but was + # present at read_time. + # * "REMOVED": indicates that the finding was present and matched the + # filter at the start of compare_duration, but did not match + # the filter at read_time. + # + # If compare_duration is not specified, then the only possible state_change + # is "UNUSED", which will be the state_change set for all findings present + # at read_time. + # + # If this field is set then `state_change` must be a specified field in + # `group_by`. + # @param page_token [::String] + # The value returned by the last `GroupFindingsResponse`; indicates + # that this is a continuation of a prior `GroupFindings` call, and + # that the system should return the next page of data. + # @param page_size [::Integer] + # The maximum number of results to return in a single response. Default is + # 10, minimum is 1, maximum is 1000. + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Gapic::Rest::PagedEnumerable<::Google::Cloud::SecurityCenter::V1p1beta1::GroupResult>] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Gapic::Rest::PagedEnumerable<::Google::Cloud::SecurityCenter::V1p1beta1::GroupResult>] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/security_center/v1p1beta1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::SecurityCenter::V1p1beta1::SecurityCenter::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::SecurityCenter::V1p1beta1::GroupFindingsRequest.new + # + # # Call the group_findings method. + # result = client.group_findings request + # + # # The returned object is of type Gapic::PagedEnumerable. You can iterate + # # over elements, and API calls will be issued to fetch pages as needed. + # result.each do |item| + # # Each element is of type ::Google::Cloud::SecurityCenter::V1p1beta1::GroupResult. + # p item + # end + # + def group_findings request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::SecurityCenter::V1p1beta1::GroupFindingsRequest + + # Converts hash 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.group_findings.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::SecurityCenter::V1p1beta1::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.group_findings.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.group_findings.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @security_center_stub.group_findings request, options do |result, operation| + result = ::Gapic::Rest::PagedEnumerable.new @security_center_stub, :group_findings, "group_by_results", 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 + + ## + # Lists an organization's assets. + # + # @overload list_assets(request, options = nil) + # Pass arguments to `list_assets` via a request object, either of type + # {::Google::Cloud::SecurityCenter::V1p1beta1::ListAssetsRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::SecurityCenter::V1p1beta1::ListAssetsRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_assets(parent: nil, filter: nil, order_by: nil, read_time: nil, compare_duration: nil, field_mask: nil, page_token: nil, page_size: nil) + # Pass arguments to `list_assets` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param parent [::String] + # Required. Name of the organization assets should belong to. Its format is + # "organizations/[organization_id], folders/[folder_id], or + # projects/[project_id]". + # @param filter [::String] + # Expression that defines the filter to apply across assets. + # The expression is a list of zero or more restrictions combined via logical + # operators `AND` and `OR`. + # Parentheses are supported, and `OR` has higher precedence than `AND`. + # + # Restrictions have the form ` ` and may have a `-` + # character in front of them to indicate negation. The fields map to those + # defined in the Asset resource. Examples include: + # + # * name + # * security_center_properties.resource_name + # * resource_properties.a_property + # * security_marks.marks.marka + # + # The supported operators are: + # + # * `=` for all value types. + # * `>`, `<`, `>=`, `<=` for integer values. + # * `:`, meaning substring matching, for strings. + # + # The supported value types are: + # + # * string literals in quotes. + # * integer literals without quotes. + # * boolean literals `true` and `false` without quotes. + # + # The following are the allowed field and operator combinations: + # + # * name: `=` + # * update_time: `=`, `>`, `<`, `>=`, `<=` + # + # Usage: This should be milliseconds since epoch or an RFC3339 string. + # Examples: + # `update_time = "2019-06-10T16:07:18-07:00"` + # `update_time = 1560208038000` + # + # * create_time: `=`, `>`, `<`, `>=`, `<=` + # + # Usage: This should be milliseconds since epoch or an RFC3339 string. + # Examples: + # `create_time = "2019-06-10T16:07:18-07:00"` + # `create_time = 1560208038000` + # + # * iam_policy.policy_blob: `=`, `:` + # * resource_properties: `=`, `:`, `>`, `<`, `>=`, `<=` + # * security_marks.marks: `=`, `:` + # * security_center_properties.resource_name: `=`, `:` + # * security_center_properties.resource_display_name: `=`, `:` + # * security_center_properties.resource_type: `=`, `:` + # * security_center_properties.resource_parent: `=`, `:` + # * security_center_properties.resource_parent_display_name: `=`, `:` + # * security_center_properties.resource_project: `=`, `:` + # * security_center_properties.resource_project_display_name: `=`, `:` + # * security_center_properties.resource_owners: `=`, `:` + # + # For example, `resource_properties.size = 100` is a valid filter string. + # + # Use a partial match on the empty string to filter based on a property + # existing: `resource_properties.my_property : ""` + # + # Use a negated partial match on the empty string to filter based on a + # property not existing: `-resource_properties.my_property : ""` + # @param order_by [::String] + # Expression that defines what fields and order to use for sorting. The + # string value should follow SQL syntax: comma separated list of fields. For + # example: "name,resource_properties.a_property". The default sorting order + # is ascending. To specify descending order for a field, a suffix " desc" + # should be appended to the field name. For example: "name + # desc,resource_properties.a_property". Redundant space characters in the + # syntax are insignificant. "name desc,resource_properties.a_property" and " + # name desc , resource_properties.a_property " are equivalent. + # + # The following fields are supported: + # name + # update_time + # resource_properties + # security_marks.marks + # security_center_properties.resource_name + # security_center_properties.resource_display_name + # security_center_properties.resource_parent + # security_center_properties.resource_parent_display_name + # security_center_properties.resource_project + # security_center_properties.resource_project_display_name + # security_center_properties.resource_type + # @param read_time [::Google::Protobuf::Timestamp, ::Hash] + # Time used as a reference point when filtering assets. The filter is limited + # to assets existing at the supplied time and their values are those at that + # specific time. Absence of this field will default to the API's version of + # NOW. + # @param compare_duration [::Google::Protobuf::Duration, ::Hash] + # When compare_duration is set, the ListAssetsResult's "state_change" + # attribute is updated to indicate whether the asset was added, removed, or + # remained present during the compare_duration period of time that precedes + # the read_time. This is the time between (read_time - compare_duration) and + # read_time. + # + # The state_change value is derived based on the presence of the asset at the + # two points in time. Intermediate state changes between the two times don't + # affect the result. For example, the results aren't affected if the asset is + # removed and re-created again. + # + # Possible "state_change" values when compare_duration is specified: + # + # * "ADDED": indicates that the asset was not present at the start of + # compare_duration, but present at read_time. + # * "REMOVED": indicates that the asset was present at the start of + # compare_duration, but not present at read_time. + # * "ACTIVE": indicates that the asset was present at both the + # start and the end of the time period defined by + # compare_duration and read_time. + # + # If compare_duration is not specified, then the only possible state_change + # is "UNUSED", which will be the state_change set for all assets present at + # read_time. + # @param field_mask [::Google::Protobuf::FieldMask, ::Hash] + # A field mask to specify the ListAssetsResult fields to be listed in the + # response. + # An empty field mask will list all fields. + # @param page_token [::String] + # The value returned by the last `ListAssetsResponse`; indicates + # that this is a continuation of a prior `ListAssets` call, and + # that the system should return the next page of data. + # @param page_size [::Integer] + # The maximum number of results to return in a single response. Default is + # 10, minimum is 1, maximum is 1000. + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Gapic::Rest::PagedEnumerable<::Google::Cloud::SecurityCenter::V1p1beta1::ListAssetsResponse::ListAssetsResult>] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Gapic::Rest::PagedEnumerable<::Google::Cloud::SecurityCenter::V1p1beta1::ListAssetsResponse::ListAssetsResult>] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/security_center/v1p1beta1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::SecurityCenter::V1p1beta1::SecurityCenter::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::SecurityCenter::V1p1beta1::ListAssetsRequest.new + # + # # Call the list_assets method. + # result = client.list_assets request + # + # # The returned object is of type Gapic::PagedEnumerable. You can iterate + # # over elements, and API calls will be issued to fetch pages as needed. + # result.each do |item| + # # Each element is of type ::Google::Cloud::SecurityCenter::V1p1beta1::ListAssetsResponse::ListAssetsResult. + # p item + # end + # + def list_assets request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::SecurityCenter::V1p1beta1::ListAssetsRequest + + # Converts hash 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_assets.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::SecurityCenter::V1p1beta1::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_assets.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.list_assets.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @security_center_stub.list_assets request, options do |result, operation| + result = ::Gapic::Rest::PagedEnumerable.new @security_center_stub, :list_assets, "list_assets_results", 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 + + ## + # Lists an organization or source's findings. + # + # To list across all sources provide a `-` as the source id. + # Example: /v1p1beta1/organizations/\\{organization_id}/sources/-/findings + # + # @overload list_findings(request, options = nil) + # Pass arguments to `list_findings` via a request object, either of type + # {::Google::Cloud::SecurityCenter::V1p1beta1::ListFindingsRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::SecurityCenter::V1p1beta1::ListFindingsRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_findings(parent: nil, filter: nil, order_by: nil, read_time: nil, compare_duration: nil, field_mask: nil, page_token: nil, page_size: nil) + # Pass arguments to `list_findings` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param parent [::String] + # Required. Name of the source the findings belong to. Its format is + # "organizations/[organization_id]/sources/[source_id], + # folders/[folder_id]/sources/[source_id], or + # projects/[project_id]/sources/[source_id]". To list across all sources + # provide a source_id of `-`. For example: + # organizations/\\{organization_id}/sources/-, folders/\\{folder_id}/sources/- or + # projects/\\{projects_id}/sources/- + # @param filter [::String] + # Expression that defines the filter to apply across findings. + # The expression is a list of one or more restrictions combined via logical + # operators `AND` and `OR`. + # Parentheses are supported, and `OR` has higher precedence than `AND`. + # + # Restrictions have the form ` ` and may have a `-` + # character in front of them to indicate negation. Examples include: + # + # * name + # * source_properties.a_property + # * security_marks.marks.marka + # + # The supported operators are: + # + # * `=` for all value types. + # * `>`, `<`, `>=`, `<=` for integer values. + # * `:`, meaning substring matching, for strings. + # + # The supported value types are: + # + # * string literals in quotes. + # * integer literals without quotes. + # * boolean literals `true` and `false` without quotes. + # + # The following field and operator combinations are supported: + # + # * name: `=` + # * parent: `=`, `:` + # * resource_name: `=`, `:` + # * state: `=`, `:` + # * category: `=`, `:` + # * external_uri: `=`, `:` + # * event_time: `=`, `>`, `<`, `>=`, `<=` + # * severity: `=`, `:` + # + # Usage: This should be milliseconds since epoch or an RFC3339 string. + # Examples: + # `event_time = "2019-06-10T16:07:18-07:00"` + # `event_time = 1560208038000` + # + # security_marks.marks: `=`, `:` + # source_properties: `=`, `:`, `>`, `<`, `>=`, `<=` + # + # For example, `source_properties.size = 100` is a valid filter string. + # + # Use a partial match on the empty string to filter based on a property + # existing: `source_properties.my_property : ""` + # + # Use a negated partial match on the empty string to filter based on a + # property not existing: `-source_properties.my_property : ""` + # @param order_by [::String] + # Expression that defines what fields and order to use for sorting. The + # string value should follow SQL syntax: comma separated list of fields. For + # example: "name,resource_properties.a_property". The default sorting order + # is ascending. To specify descending order for a field, a suffix " desc" + # should be appended to the field name. For example: "name + # desc,source_properties.a_property". Redundant space characters in the + # syntax are insignificant. "name desc,source_properties.a_property" and " + # name desc , source_properties.a_property " are equivalent. + # + # The following fields are supported: + # name + # parent + # state + # category + # resource_name + # event_time + # source_properties + # security_marks.marks + # @param read_time [::Google::Protobuf::Timestamp, ::Hash] + # Time used as a reference point when filtering findings. The filter is + # limited to findings existing at the supplied time and their values are + # those at that specific time. Absence of this field will default to the + # API's version of NOW. + # @param compare_duration [::Google::Protobuf::Duration, ::Hash] + # When compare_duration is set, the ListFindingsResult's "state_change" + # attribute is updated to indicate whether the finding had its state changed, + # the finding's state remained unchanged, or if the finding was added in any + # state during the compare_duration period of time that precedes the + # read_time. This is the time between (read_time - compare_duration) and + # read_time. + # + # The state_change value is derived based on the presence and state of the + # finding at the two points in time. Intermediate state changes between the + # two times don't affect the result. For example, the results aren't affected + # if the finding is made inactive and then active again. + # + # Possible "state_change" values when compare_duration is specified: + # + # * "CHANGED": indicates that the finding was present and matched the given + # filter at the start of compare_duration, but changed its + # state at read_time. + # * "UNCHANGED": indicates that the finding was present and matched the given + # filter at the start of compare_duration and did not change + # state at read_time. + # * "ADDED": indicates that the finding did not match the given filter or + # was not present at the start of compare_duration, but was + # present at read_time. + # * "REMOVED": indicates that the finding was present and matched the + # filter at the start of compare_duration, but did not match + # the filter at read_time. + # + # If compare_duration is not specified, then the only possible state_change + # is "UNUSED", which will be the state_change set for all findings present at + # read_time. + # @param field_mask [::Google::Protobuf::FieldMask, ::Hash] + # A field mask to specify the Finding fields to be listed in the response. + # An empty field mask will list all fields. + # @param page_token [::String] + # The value returned by the last `ListFindingsResponse`; indicates + # that this is a continuation of a prior `ListFindings` call, and + # that the system should return the next page of data. + # @param page_size [::Integer] + # The maximum number of results to return in a single response. Default is + # 10, minimum is 1, maximum is 1000. + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Gapic::Rest::PagedEnumerable<::Google::Cloud::SecurityCenter::V1p1beta1::ListFindingsResponse::ListFindingsResult>] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Gapic::Rest::PagedEnumerable<::Google::Cloud::SecurityCenter::V1p1beta1::ListFindingsResponse::ListFindingsResult>] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/security_center/v1p1beta1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::SecurityCenter::V1p1beta1::SecurityCenter::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::SecurityCenter::V1p1beta1::ListFindingsRequest.new + # + # # Call the list_findings method. + # result = client.list_findings request + # + # # The returned object is of type Gapic::PagedEnumerable. You can iterate + # # over elements, and API calls will be issued to fetch pages as needed. + # result.each do |item| + # # Each element is of type ::Google::Cloud::SecurityCenter::V1p1beta1::ListFindingsResponse::ListFindingsResult. + # p item + # end + # + def list_findings request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::SecurityCenter::V1p1beta1::ListFindingsRequest + + # Converts hash 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_findings.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::SecurityCenter::V1p1beta1::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_findings.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.list_findings.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @security_center_stub.list_findings request, options do |result, operation| + result = ::Gapic::Rest::PagedEnumerable.new @security_center_stub, :list_findings, "list_findings_results", 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 + + ## + # Lists notification configs. + # + # @overload list_notification_configs(request, options = nil) + # Pass arguments to `list_notification_configs` via a request object, either of type + # {::Google::Cloud::SecurityCenter::V1p1beta1::ListNotificationConfigsRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::SecurityCenter::V1p1beta1::ListNotificationConfigsRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_notification_configs(parent: nil, page_token: nil, page_size: nil) + # Pass arguments to `list_notification_configs` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param parent [::String] + # Required. Name of the organization to list notification configs. + # Its format is "organizations/[organization_id]". + # @param page_token [::String] + # The value returned by the last `ListNotificationConfigsResponse`; indicates + # that this is a continuation of a prior `ListNotificationConfigs` call, and + # that the system should return the next page of data. + # @param page_size [::Integer] + # The maximum number of results to return in a single response. Default is + # 10, minimum is 1, maximum is 1000. + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Gapic::Rest::PagedEnumerable<::Google::Cloud::SecurityCenter::V1p1beta1::NotificationConfig>] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Gapic::Rest::PagedEnumerable<::Google::Cloud::SecurityCenter::V1p1beta1::NotificationConfig>] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/security_center/v1p1beta1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::SecurityCenter::V1p1beta1::SecurityCenter::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::SecurityCenter::V1p1beta1::ListNotificationConfigsRequest.new + # + # # Call the list_notification_configs method. + # result = client.list_notification_configs request + # + # # The returned object is of type Gapic::PagedEnumerable. You can iterate + # # over elements, and API calls will be issued to fetch pages as needed. + # result.each do |item| + # # Each element is of type ::Google::Cloud::SecurityCenter::V1p1beta1::NotificationConfig. + # p item + # end + # + def list_notification_configs request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::SecurityCenter::V1p1beta1::ListNotificationConfigsRequest + + # Converts hash 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_notification_configs.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::SecurityCenter::V1p1beta1::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_notification_configs.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.list_notification_configs.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @security_center_stub.list_notification_configs request, options do |result, operation| + result = ::Gapic::Rest::PagedEnumerable.new @security_center_stub, :list_notification_configs, "notification_configs", 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 + + ## + # Lists all sources belonging to an organization. + # + # @overload list_sources(request, options = nil) + # Pass arguments to `list_sources` via a request object, either of type + # {::Google::Cloud::SecurityCenter::V1p1beta1::ListSourcesRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::SecurityCenter::V1p1beta1::ListSourcesRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_sources(parent: nil, page_token: nil, page_size: nil) + # Pass arguments to `list_sources` via keyword arguments. Note that at + # least one keyword argument is 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. Resource name of the parent of sources to list. Its format should be + # "organizations/[organization_id], folders/[folder_id], or + # projects/[project_id]". + # @param page_token [::String] + # The value returned by the last `ListSourcesResponse`; indicates + # that this is a continuation of a prior `ListSources` call, and + # that the system should return the next page of data. + # @param page_size [::Integer] + # The maximum number of results to return in a single response. Default is + # 10, minimum is 1, maximum is 1000. + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Gapic::Rest::PagedEnumerable<::Google::Cloud::SecurityCenter::V1p1beta1::Source>] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Gapic::Rest::PagedEnumerable<::Google::Cloud::SecurityCenter::V1p1beta1::Source>] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/security_center/v1p1beta1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::SecurityCenter::V1p1beta1::SecurityCenter::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::SecurityCenter::V1p1beta1::ListSourcesRequest.new + # + # # Call the list_sources method. + # result = client.list_sources request + # + # # The returned object is of type Gapic::PagedEnumerable. You can iterate + # # over elements, and API calls will be issued to fetch pages as needed. + # result.each do |item| + # # Each element is of type ::Google::Cloud::SecurityCenter::V1p1beta1::Source. + # p item + # end + # + def list_sources request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::SecurityCenter::V1p1beta1::ListSourcesRequest + + # Converts hash 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_sources.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::SecurityCenter::V1p1beta1::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_sources.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.list_sources.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @security_center_stub.list_sources request, options do |result, operation| + result = ::Gapic::Rest::PagedEnumerable.new @security_center_stub, :list_sources, "sources", 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 + + ## + # Runs asset discovery. The discovery is tracked with a long-running + # operation. + # + # This API can only be called with limited frequency for an organization. If + # it is called too frequently the caller will receive a TOO_MANY_REQUESTS + # error. + # + # @overload run_asset_discovery(request, options = nil) + # Pass arguments to `run_asset_discovery` via a request object, either of type + # {::Google::Cloud::SecurityCenter::V1p1beta1::RunAssetDiscoveryRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::SecurityCenter::V1p1beta1::RunAssetDiscoveryRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @overload run_asset_discovery(parent: nil) + # Pass arguments to `run_asset_discovery` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param parent [::String] + # Required. Name of the organization to run asset discovery for. Its format is + # "organizations/[organization_id]". + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Gapic::Operation] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Gapic::Operation] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/security_center/v1p1beta1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::SecurityCenter::V1p1beta1::SecurityCenter::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::SecurityCenter::V1p1beta1::RunAssetDiscoveryRequest.new + # + # # Call the run_asset_discovery method. + # result = client.run_asset_discovery 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 run_asset_discovery request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::SecurityCenter::V1p1beta1::RunAssetDiscoveryRequest + + # Converts hash 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.run_asset_discovery.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::SecurityCenter::V1p1beta1::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.run_asset_discovery.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.run_asset_discovery.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @security_center_stub.run_asset_discovery 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 + + ## + # Updates the state of a finding. + # + # @overload set_finding_state(request, options = nil) + # Pass arguments to `set_finding_state` via a request object, either of type + # {::Google::Cloud::SecurityCenter::V1p1beta1::SetFindingStateRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::SecurityCenter::V1p1beta1::SetFindingStateRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @overload set_finding_state(name: nil, state: nil, start_time: nil) + # Pass arguments to `set_finding_state` via keyword arguments. Note that at + # least one keyword argument is 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 relative resource name of the finding. See: + # https://cloud.google.com/apis/design/resource_names#relative_resource_name + # Example: + # "organizations/\\{organization_id}/sources/\\{source_id}/finding/\\{finding_id}". + # @param state [::Google::Cloud::SecurityCenter::V1p1beta1::Finding::State] + # Required. The desired State of the finding. + # @param start_time [::Google::Protobuf::Timestamp, ::Hash] + # Required. The time at which the updated state takes effect. + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Cloud::SecurityCenter::V1p1beta1::Finding] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::SecurityCenter::V1p1beta1::Finding] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/security_center/v1p1beta1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::SecurityCenter::V1p1beta1::SecurityCenter::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::SecurityCenter::V1p1beta1::SetFindingStateRequest.new + # + # # Call the set_finding_state method. + # result = client.set_finding_state request + # + # # The returned object is of type Google::Cloud::SecurityCenter::V1p1beta1::Finding. + # p result + # + def set_finding_state request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::SecurityCenter::V1p1beta1::SetFindingStateRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + call_metadata = @config.rpcs.set_finding_state.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::SecurityCenter::V1p1beta1::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + options.apply_defaults timeout: @config.rpcs.set_finding_state.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.set_finding_state.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @security_center_stub.set_finding_state request, options do |result, operation| + yield result, operation if block_given? + end + rescue ::Gapic::Rest::Error => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Sets the access control policy on the specified Source. + # + # @overload set_iam_policy(request, options = nil) + # Pass arguments to `set_iam_policy` via a request object, either of type + # {::Google::Iam::V1::SetIamPolicyRequest} or an equivalent Hash. + # + # @param request [::Google::Iam::V1::SetIamPolicyRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @overload set_iam_policy(resource: nil, policy: nil, update_mask: nil) + # Pass arguments to `set_iam_policy` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param resource [::String] + # REQUIRED: The resource for which the policy is being specified. + # See the operation documentation for the appropriate value for this field. + # @param policy [::Google::Iam::V1::Policy, ::Hash] + # REQUIRED: The complete policy to be applied to the `resource`. The size of + # the policy is limited to a few 10s of KB. An empty policy is a + # valid policy but certain Cloud Platform services (such as Projects) + # might reject them. + # @param update_mask [::Google::Protobuf::FieldMask, ::Hash] + # OPTIONAL: A FieldMask specifying which fields of the policy to modify. Only + # the fields in the mask will be modified. If no mask is provided, the + # following default mask is used: + # + # `paths: "bindings, etag"` + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Iam::V1::Policy] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Iam::V1::Policy] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/security_center/v1p1beta1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::SecurityCenter::V1p1beta1::SecurityCenter::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Iam::V1::SetIamPolicyRequest.new + # + # # Call the set_iam_policy method. + # result = client.set_iam_policy request + # + # # The returned object is of type Google::Iam::V1::Policy. + # p result + # + def set_iam_policy request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Iam::V1::SetIamPolicyRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + call_metadata = @config.rpcs.set_iam_policy.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::SecurityCenter::V1p1beta1::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + options.apply_defaults timeout: @config.rpcs.set_iam_policy.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.set_iam_policy.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @security_center_stub.set_iam_policy request, options do |result, operation| + yield result, operation if block_given? + end + rescue ::Gapic::Rest::Error => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Returns the permissions that a caller has on the specified source. + # + # @overload test_iam_permissions(request, options = nil) + # Pass arguments to `test_iam_permissions` via a request object, either of type + # {::Google::Iam::V1::TestIamPermissionsRequest} or an equivalent Hash. + # + # @param request [::Google::Iam::V1::TestIamPermissionsRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @overload test_iam_permissions(resource: nil, permissions: nil) + # Pass arguments to `test_iam_permissions` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param resource [::String] + # REQUIRED: The resource for which the policy detail is being requested. + # See the operation documentation for the appropriate value for this field. + # @param permissions [::Array<::String>] + # The set of permissions to check for the `resource`. Permissions with + # wildcards (such as '*' or 'storage.*') are not allowed. For more + # information see + # [IAM Overview](https://cloud.google.com/iam/docs/overview#permissions). + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Iam::V1::TestIamPermissionsResponse] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Iam::V1::TestIamPermissionsResponse] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/security_center/v1p1beta1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::SecurityCenter::V1p1beta1::SecurityCenter::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Iam::V1::TestIamPermissionsRequest.new + # + # # Call the test_iam_permissions method. + # result = client.test_iam_permissions request + # + # # The returned object is of type Google::Iam::V1::TestIamPermissionsResponse. + # p result + # + def test_iam_permissions request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Iam::V1::TestIamPermissionsRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + call_metadata = @config.rpcs.test_iam_permissions.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::SecurityCenter::V1p1beta1::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + options.apply_defaults timeout: @config.rpcs.test_iam_permissions.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.test_iam_permissions.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @security_center_stub.test_iam_permissions request, options do |result, operation| + yield result, operation if block_given? + end + rescue ::Gapic::Rest::Error => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Creates or updates a finding. The corresponding source must exist for a + # finding creation to succeed. + # + # @overload update_finding(request, options = nil) + # Pass arguments to `update_finding` via a request object, either of type + # {::Google::Cloud::SecurityCenter::V1p1beta1::UpdateFindingRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::SecurityCenter::V1p1beta1::UpdateFindingRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_finding(finding: nil, update_mask: nil) + # Pass arguments to `update_finding` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param finding [::Google::Cloud::SecurityCenter::V1p1beta1::Finding, ::Hash] + # Required. The finding resource to update or create if it does not already exist. + # parent, security_marks, and update_time will be ignored. + # + # In the case of creation, the finding id portion of the name must be + # alphanumeric and less than or equal to 32 characters and greater than 0 + # characters in length. + # @param update_mask [::Google::Protobuf::FieldMask, ::Hash] + # The FieldMask to use when updating the finding resource. This field should + # not be specified when creating a finding. + # + # When updating a finding, an empty mask is treated as updating all mutable + # fields and replacing source_properties. Individual source_properties can + # be added/updated by using "source_properties." in the field + # mask. + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Cloud::SecurityCenter::V1p1beta1::Finding] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::SecurityCenter::V1p1beta1::Finding] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/security_center/v1p1beta1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::SecurityCenter::V1p1beta1::SecurityCenter::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::SecurityCenter::V1p1beta1::UpdateFindingRequest.new + # + # # Call the update_finding method. + # result = client.update_finding request + # + # # The returned object is of type Google::Cloud::SecurityCenter::V1p1beta1::Finding. + # p result + # + def update_finding request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::SecurityCenter::V1p1beta1::UpdateFindingRequest + + # Converts hash 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_finding.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::SecurityCenter::V1p1beta1::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_finding.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.update_finding.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @security_center_stub.update_finding 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 notification config. The following update + # fields are allowed: description, pubsub_topic, streaming_config.filter + # + # @overload update_notification_config(request, options = nil) + # Pass arguments to `update_notification_config` via a request object, either of type + # {::Google::Cloud::SecurityCenter::V1p1beta1::UpdateNotificationConfigRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::SecurityCenter::V1p1beta1::UpdateNotificationConfigRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_notification_config(notification_config: nil, update_mask: nil) + # Pass arguments to `update_notification_config` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param notification_config [::Google::Cloud::SecurityCenter::V1p1beta1::NotificationConfig, ::Hash] + # Required. The notification config to update. + # @param update_mask [::Google::Protobuf::FieldMask, ::Hash] + # The FieldMask to use when updating the notification config. + # + # If empty all mutable fields will be updated. + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Cloud::SecurityCenter::V1p1beta1::NotificationConfig] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::SecurityCenter::V1p1beta1::NotificationConfig] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/security_center/v1p1beta1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::SecurityCenter::V1p1beta1::SecurityCenter::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::SecurityCenter::V1p1beta1::UpdateNotificationConfigRequest.new + # + # # Call the update_notification_config method. + # result = client.update_notification_config request + # + # # The returned object is of type Google::Cloud::SecurityCenter::V1p1beta1::NotificationConfig. + # p result + # + def update_notification_config request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::SecurityCenter::V1p1beta1::UpdateNotificationConfigRequest + + # Converts hash 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_notification_config.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::SecurityCenter::V1p1beta1::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_notification_config.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.update_notification_config.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @security_center_stub.update_notification_config request, options do |result, operation| + yield result, operation if block_given? + end + rescue ::Gapic::Rest::Error => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Updates an organization's settings. + # + # @overload update_organization_settings(request, options = nil) + # Pass arguments to `update_organization_settings` via a request object, either of type + # {::Google::Cloud::SecurityCenter::V1p1beta1::UpdateOrganizationSettingsRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::SecurityCenter::V1p1beta1::UpdateOrganizationSettingsRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @overload update_organization_settings(organization_settings: nil, update_mask: nil) + # Pass arguments to `update_organization_settings` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param organization_settings [::Google::Cloud::SecurityCenter::V1p1beta1::OrganizationSettings, ::Hash] + # Required. The organization settings resource to update. + # @param update_mask [::Google::Protobuf::FieldMask, ::Hash] + # The FieldMask to use when updating the settings resource. + # + # If empty all mutable fields will be updated. + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Cloud::SecurityCenter::V1p1beta1::OrganizationSettings] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::SecurityCenter::V1p1beta1::OrganizationSettings] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/security_center/v1p1beta1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::SecurityCenter::V1p1beta1::SecurityCenter::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::SecurityCenter::V1p1beta1::UpdateOrganizationSettingsRequest.new + # + # # Call the update_organization_settings method. + # result = client.update_organization_settings request + # + # # The returned object is of type Google::Cloud::SecurityCenter::V1p1beta1::OrganizationSettings. + # p result + # + def update_organization_settings request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::SecurityCenter::V1p1beta1::UpdateOrganizationSettingsRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + call_metadata = @config.rpcs.update_organization_settings.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::SecurityCenter::V1p1beta1::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + options.apply_defaults timeout: @config.rpcs.update_organization_settings.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.update_organization_settings.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @security_center_stub.update_organization_settings 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 source. + # + # @overload update_source(request, options = nil) + # Pass arguments to `update_source` via a request object, either of type + # {::Google::Cloud::SecurityCenter::V1p1beta1::UpdateSourceRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::SecurityCenter::V1p1beta1::UpdateSourceRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_source(source: nil, update_mask: nil) + # Pass arguments to `update_source` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param source [::Google::Cloud::SecurityCenter::V1p1beta1::Source, ::Hash] + # Required. The source resource to update. + # @param update_mask [::Google::Protobuf::FieldMask, ::Hash] + # The FieldMask to use when updating the source resource. + # + # If empty all mutable fields will be updated. + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Cloud::SecurityCenter::V1p1beta1::Source] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::SecurityCenter::V1p1beta1::Source] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/security_center/v1p1beta1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::SecurityCenter::V1p1beta1::SecurityCenter::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::SecurityCenter::V1p1beta1::UpdateSourceRequest.new + # + # # Call the update_source method. + # result = client.update_source request + # + # # The returned object is of type Google::Cloud::SecurityCenter::V1p1beta1::Source. + # p result + # + def update_source request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::SecurityCenter::V1p1beta1::UpdateSourceRequest + + # Converts hash 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_source.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::SecurityCenter::V1p1beta1::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_source.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.update_source.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @security_center_stub.update_source 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 security marks. + # + # @overload update_security_marks(request, options = nil) + # Pass arguments to `update_security_marks` via a request object, either of type + # {::Google::Cloud::SecurityCenter::V1p1beta1::UpdateSecurityMarksRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::SecurityCenter::V1p1beta1::UpdateSecurityMarksRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_security_marks(security_marks: nil, update_mask: nil, start_time: nil) + # Pass arguments to `update_security_marks` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param security_marks [::Google::Cloud::SecurityCenter::V1p1beta1::SecurityMarks, ::Hash] + # Required. The security marks resource to update. + # @param update_mask [::Google::Protobuf::FieldMask, ::Hash] + # The FieldMask to use when updating the security marks resource. + # + # The field mask must not contain duplicate fields. + # If empty or set to "marks", all marks will be replaced. Individual + # marks can be updated using "marks.". + # @param start_time [::Google::Protobuf::Timestamp, ::Hash] + # The time at which the updated SecurityMarks take effect. + # If not set uses current server time. Updates will be applied to the + # SecurityMarks that are active immediately preceding this time. + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Cloud::SecurityCenter::V1p1beta1::SecurityMarks] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::SecurityCenter::V1p1beta1::SecurityMarks] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/security_center/v1p1beta1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::SecurityCenter::V1p1beta1::SecurityCenter::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::SecurityCenter::V1p1beta1::UpdateSecurityMarksRequest.new + # + # # Call the update_security_marks method. + # result = client.update_security_marks request + # + # # The returned object is of type Google::Cloud::SecurityCenter::V1p1beta1::SecurityMarks. + # p result + # + def update_security_marks request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::SecurityCenter::V1p1beta1::UpdateSecurityMarksRequest + + # Converts hash 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_security_marks.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::SecurityCenter::V1p1beta1::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_security_marks.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.update_security_marks.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @security_center_stub.update_security_marks 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 SecurityCenter REST API. + # + # This class represents the configuration for SecurityCenter REST, + # providing control over timeouts, retry behavior, logging, transport + # parameters, and other low-level controls. Certain parameters can also be + # applied individually to specific RPCs. See + # {::Google::Cloud::SecurityCenter::V1p1beta1::SecurityCenter::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_source to 20 seconds, + # # and all remaining timeouts to 10 seconds. + # ::Google::Cloud::SecurityCenter::V1p1beta1::SecurityCenter::Rest::Client.configure do |config| + # config.timeout = 10.0 + # config.rpcs.create_source.timeout = 20.0 + # end + # + # # Apply the above configuration only to a new client. + # client = ::Google::Cloud::SecurityCenter::V1p1beta1::SecurityCenter::Rest::Client.new do |config| + # config.timeout = 10.0 + # config.rpcs.create_source.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 = "securitycenter.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 SecurityCenter 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_source` + # @return [::Gapic::Config::Method] + # + attr_reader :create_source + ## + # RPC-specific configuration for `create_finding` + # @return [::Gapic::Config::Method] + # + attr_reader :create_finding + ## + # RPC-specific configuration for `create_notification_config` + # @return [::Gapic::Config::Method] + # + attr_reader :create_notification_config + ## + # RPC-specific configuration for `delete_notification_config` + # @return [::Gapic::Config::Method] + # + attr_reader :delete_notification_config + ## + # RPC-specific configuration for `get_iam_policy` + # @return [::Gapic::Config::Method] + # + attr_reader :get_iam_policy + ## + # RPC-specific configuration for `get_notification_config` + # @return [::Gapic::Config::Method] + # + attr_reader :get_notification_config + ## + # RPC-specific configuration for `get_organization_settings` + # @return [::Gapic::Config::Method] + # + attr_reader :get_organization_settings + ## + # RPC-specific configuration for `get_source` + # @return [::Gapic::Config::Method] + # + attr_reader :get_source + ## + # RPC-specific configuration for `group_assets` + # @return [::Gapic::Config::Method] + # + attr_reader :group_assets + ## + # RPC-specific configuration for `group_findings` + # @return [::Gapic::Config::Method] + # + attr_reader :group_findings + ## + # RPC-specific configuration for `list_assets` + # @return [::Gapic::Config::Method] + # + attr_reader :list_assets + ## + # RPC-specific configuration for `list_findings` + # @return [::Gapic::Config::Method] + # + attr_reader :list_findings + ## + # RPC-specific configuration for `list_notification_configs` + # @return [::Gapic::Config::Method] + # + attr_reader :list_notification_configs + ## + # RPC-specific configuration for `list_sources` + # @return [::Gapic::Config::Method] + # + attr_reader :list_sources + ## + # RPC-specific configuration for `run_asset_discovery` + # @return [::Gapic::Config::Method] + # + attr_reader :run_asset_discovery + ## + # RPC-specific configuration for `set_finding_state` + # @return [::Gapic::Config::Method] + # + attr_reader :set_finding_state + ## + # RPC-specific configuration for `set_iam_policy` + # @return [::Gapic::Config::Method] + # + attr_reader :set_iam_policy + ## + # RPC-specific configuration for `test_iam_permissions` + # @return [::Gapic::Config::Method] + # + attr_reader :test_iam_permissions + ## + # RPC-specific configuration for `update_finding` + # @return [::Gapic::Config::Method] + # + attr_reader :update_finding + ## + # RPC-specific configuration for `update_notification_config` + # @return [::Gapic::Config::Method] + # + attr_reader :update_notification_config + ## + # RPC-specific configuration for `update_organization_settings` + # @return [::Gapic::Config::Method] + # + attr_reader :update_organization_settings + ## + # RPC-specific configuration for `update_source` + # @return [::Gapic::Config::Method] + # + attr_reader :update_source + ## + # RPC-specific configuration for `update_security_marks` + # @return [::Gapic::Config::Method] + # + attr_reader :update_security_marks + + # @private + def initialize parent_rpcs = nil + create_source_config = parent_rpcs.create_source if parent_rpcs.respond_to? :create_source + @create_source = ::Gapic::Config::Method.new create_source_config + create_finding_config = parent_rpcs.create_finding if parent_rpcs.respond_to? :create_finding + @create_finding = ::Gapic::Config::Method.new create_finding_config + create_notification_config_config = parent_rpcs.create_notification_config if parent_rpcs.respond_to? :create_notification_config + @create_notification_config = ::Gapic::Config::Method.new create_notification_config_config + delete_notification_config_config = parent_rpcs.delete_notification_config if parent_rpcs.respond_to? :delete_notification_config + @delete_notification_config = ::Gapic::Config::Method.new delete_notification_config_config + get_iam_policy_config = parent_rpcs.get_iam_policy if parent_rpcs.respond_to? :get_iam_policy + @get_iam_policy = ::Gapic::Config::Method.new get_iam_policy_config + get_notification_config_config = parent_rpcs.get_notification_config if parent_rpcs.respond_to? :get_notification_config + @get_notification_config = ::Gapic::Config::Method.new get_notification_config_config + get_organization_settings_config = parent_rpcs.get_organization_settings if parent_rpcs.respond_to? :get_organization_settings + @get_organization_settings = ::Gapic::Config::Method.new get_organization_settings_config + get_source_config = parent_rpcs.get_source if parent_rpcs.respond_to? :get_source + @get_source = ::Gapic::Config::Method.new get_source_config + group_assets_config = parent_rpcs.group_assets if parent_rpcs.respond_to? :group_assets + @group_assets = ::Gapic::Config::Method.new group_assets_config + group_findings_config = parent_rpcs.group_findings if parent_rpcs.respond_to? :group_findings + @group_findings = ::Gapic::Config::Method.new group_findings_config + list_assets_config = parent_rpcs.list_assets if parent_rpcs.respond_to? :list_assets + @list_assets = ::Gapic::Config::Method.new list_assets_config + list_findings_config = parent_rpcs.list_findings if parent_rpcs.respond_to? :list_findings + @list_findings = ::Gapic::Config::Method.new list_findings_config + list_notification_configs_config = parent_rpcs.list_notification_configs if parent_rpcs.respond_to? :list_notification_configs + @list_notification_configs = ::Gapic::Config::Method.new list_notification_configs_config + list_sources_config = parent_rpcs.list_sources if parent_rpcs.respond_to? :list_sources + @list_sources = ::Gapic::Config::Method.new list_sources_config + run_asset_discovery_config = parent_rpcs.run_asset_discovery if parent_rpcs.respond_to? :run_asset_discovery + @run_asset_discovery = ::Gapic::Config::Method.new run_asset_discovery_config + set_finding_state_config = parent_rpcs.set_finding_state if parent_rpcs.respond_to? :set_finding_state + @set_finding_state = ::Gapic::Config::Method.new set_finding_state_config + set_iam_policy_config = parent_rpcs.set_iam_policy if parent_rpcs.respond_to? :set_iam_policy + @set_iam_policy = ::Gapic::Config::Method.new set_iam_policy_config + test_iam_permissions_config = parent_rpcs.test_iam_permissions if parent_rpcs.respond_to? :test_iam_permissions + @test_iam_permissions = ::Gapic::Config::Method.new test_iam_permissions_config + update_finding_config = parent_rpcs.update_finding if parent_rpcs.respond_to? :update_finding + @update_finding = ::Gapic::Config::Method.new update_finding_config + update_notification_config_config = parent_rpcs.update_notification_config if parent_rpcs.respond_to? :update_notification_config + @update_notification_config = ::Gapic::Config::Method.new update_notification_config_config + update_organization_settings_config = parent_rpcs.update_organization_settings if parent_rpcs.respond_to? :update_organization_settings + @update_organization_settings = ::Gapic::Config::Method.new update_organization_settings_config + update_source_config = parent_rpcs.update_source if parent_rpcs.respond_to? :update_source + @update_source = ::Gapic::Config::Method.new update_source_config + update_security_marks_config = parent_rpcs.update_security_marks if parent_rpcs.respond_to? :update_security_marks + @update_security_marks = ::Gapic::Config::Method.new update_security_marks_config + + yield self if block_given? + end + end + end + end + end + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-security_center-v1p1beta1/lib/google/cloud/security_center/v1p1beta1/security_center/rest/operations.rb b/owl-bot-staging/google-cloud-security_center-v1p1beta1/lib/google/cloud/security_center/v1p1beta1/security_center/rest/operations.rb new file mode 100644 index 000000000000..6f15a750401a --- /dev/null +++ b/owl-bot-staging/google-cloud-security_center-v1p1beta1/lib/google/cloud/security_center/v1p1beta1/security_center/rest/operations.rb @@ -0,0 +1,925 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +require "gapic/operation" + +module Google + module Cloud + module SecurityCenter + module V1p1beta1 + module SecurityCenter + module Rest + # Service that implements Longrunning Operations API. + class Operations + # @private + API_VERSION = "" + + # @private + DEFAULT_ENDPOINT_TEMPLATE = "securitycenter.$UNIVERSE_DOMAIN$" + + # @private + attr_reader :operations_stub + + ## + # Configuration for the SecurityCenter 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 SecurityCenter 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::SecurityCenter::V1p1beta1::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::SecurityCenter::V1p1beta1::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::SecurityCenter::V1p1beta1::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::SecurityCenter::V1p1beta1::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 = "securitycenter.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: "/v1p1beta1/{name}", + matches: [ + ["name", %r{^organizations/[^/]+/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: "/v1p1beta1/{name}", + matches: [ + ["name", %r{^organizations/[^/]+/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: "/v1p1beta1/{name}", + matches: [ + ["name", %r{^organizations/[^/]+/operations/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the cancel_operation REST call + # + # @param request_pb [::Google::Longrunning::CancelOperationRequest] + # A request object representing the call parameters. Required. + # @return [Array(String, [String, nil], Hash{String => String})] + # Uri, Body, Query string parameters + def self.transcode_cancel_operation_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :post, + uri_template: "/v1p1beta1/{name}:cancel", + body: "*", + matches: [ + ["name", %r{^organizations/[^/]+/operations/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + end + end + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-security_center-v1p1beta1/lib/google/cloud/security_center/v1p1beta1/security_center/rest/service_stub.rb b/owl-bot-staging/google-cloud-security_center-v1p1beta1/lib/google/cloud/security_center/v1p1beta1/security_center/rest/service_stub.rb new file mode 100644 index 000000000000..8b4fcab1731e --- /dev/null +++ b/owl-bot-staging/google-cloud-security_center-v1p1beta1/lib/google/cloud/security_center/v1p1beta1/security_center/rest/service_stub.rb @@ -0,0 +1,1645 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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/securitycenter/v1p1beta1/securitycenter_service_pb" + +module Google + module Cloud + module SecurityCenter + module V1p1beta1 + module SecurityCenter + module Rest + ## + # REST service stub for the SecurityCenter 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_source REST call + # + # @param request_pb [::Google::Cloud::SecurityCenter::V1p1beta1::CreateSourceRequest] + # A request object representing the call parameters. Required. + # @param options [::Gapic::CallOptions] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Cloud::SecurityCenter::V1p1beta1::Source] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::SecurityCenter::V1p1beta1::Source] + # A result object deserialized from the server's reply + def create_source request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_create_source_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_source", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Cloud::SecurityCenter::V1p1beta1::Source.decode_json response.body, ignore_unknown_fields: true + catch :response do + yield result, operation if block_given? + result + end + end + + ## + # Baseline implementation for the create_finding REST call + # + # @param request_pb [::Google::Cloud::SecurityCenter::V1p1beta1::CreateFindingRequest] + # A request object representing the call parameters. Required. + # @param options [::Gapic::CallOptions] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Cloud::SecurityCenter::V1p1beta1::Finding] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::SecurityCenter::V1p1beta1::Finding] + # A result object deserialized from the server's reply + def create_finding request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_create_finding_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_finding", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Cloud::SecurityCenter::V1p1beta1::Finding.decode_json response.body, ignore_unknown_fields: true + catch :response do + yield result, operation if block_given? + result + end + end + + ## + # Baseline implementation for the create_notification_config REST call + # + # @param request_pb [::Google::Cloud::SecurityCenter::V1p1beta1::CreateNotificationConfigRequest] + # A request object representing the call parameters. Required. + # @param options [::Gapic::CallOptions] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Cloud::SecurityCenter::V1p1beta1::NotificationConfig] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::SecurityCenter::V1p1beta1::NotificationConfig] + # A result object deserialized from the server's reply + def create_notification_config request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_create_notification_config_request request_pb + query_string_params = if query_string_params.any? + query_string_params.to_h { |p| p.split "=", 2 } + else + {} + end + + response = @client_stub.make_http_request( + verb, + uri: uri, + body: body || "", + params: query_string_params, + method_name: "create_notification_config", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Cloud::SecurityCenter::V1p1beta1::NotificationConfig.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_notification_config REST call + # + # @param request_pb [::Google::Cloud::SecurityCenter::V1p1beta1::DeleteNotificationConfigRequest] + # 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_notification_config request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_delete_notification_config_request request_pb + query_string_params = if query_string_params.any? + query_string_params.to_h { |p| p.split "=", 2 } + else + {} + end + + response = @client_stub.make_http_request( + verb, + uri: uri, + body: body || "", + params: query_string_params, + method_name: "delete_notification_config", + 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 get_iam_policy REST call + # + # @param request_pb [::Google::Iam::V1::GetIamPolicyRequest] + # A request object representing the call parameters. Required. + # @param options [::Gapic::CallOptions] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Iam::V1::Policy] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Iam::V1::Policy] + # A result object deserialized from the server's reply + def get_iam_policy request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_get_iam_policy_request request_pb + query_string_params = if query_string_params.any? + query_string_params.to_h { |p| p.split "=", 2 } + else + {} + end + + response = @client_stub.make_http_request( + verb, + uri: uri, + body: body || "", + params: query_string_params, + method_name: "get_iam_policy", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Iam::V1::Policy.decode_json response.body, ignore_unknown_fields: true + catch :response do + yield result, operation if block_given? + result + end + end + + ## + # Baseline implementation for the get_notification_config REST call + # + # @param request_pb [::Google::Cloud::SecurityCenter::V1p1beta1::GetNotificationConfigRequest] + # A request object representing the call parameters. Required. + # @param options [::Gapic::CallOptions] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Cloud::SecurityCenter::V1p1beta1::NotificationConfig] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::SecurityCenter::V1p1beta1::NotificationConfig] + # A result object deserialized from the server's reply + def get_notification_config request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_get_notification_config_request request_pb + query_string_params = if query_string_params.any? + query_string_params.to_h { |p| p.split "=", 2 } + else + {} + end + + response = @client_stub.make_http_request( + verb, + uri: uri, + body: body || "", + params: query_string_params, + method_name: "get_notification_config", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Cloud::SecurityCenter::V1p1beta1::NotificationConfig.decode_json response.body, ignore_unknown_fields: true + catch :response do + yield result, operation if block_given? + result + end + end + + ## + # Baseline implementation for the get_organization_settings REST call + # + # @param request_pb [::Google::Cloud::SecurityCenter::V1p1beta1::GetOrganizationSettingsRequest] + # A request object representing the call parameters. Required. + # @param options [::Gapic::CallOptions] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Cloud::SecurityCenter::V1p1beta1::OrganizationSettings] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::SecurityCenter::V1p1beta1::OrganizationSettings] + # A result object deserialized from the server's reply + def get_organization_settings request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_get_organization_settings_request request_pb + query_string_params = if query_string_params.any? + query_string_params.to_h { |p| p.split "=", 2 } + else + {} + end + + response = @client_stub.make_http_request( + verb, + uri: uri, + body: body || "", + params: query_string_params, + method_name: "get_organization_settings", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Cloud::SecurityCenter::V1p1beta1::OrganizationSettings.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_source REST call + # + # @param request_pb [::Google::Cloud::SecurityCenter::V1p1beta1::GetSourceRequest] + # A request object representing the call parameters. Required. + # @param options [::Gapic::CallOptions] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Cloud::SecurityCenter::V1p1beta1::Source] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::SecurityCenter::V1p1beta1::Source] + # A result object deserialized from the server's reply + def get_source request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_get_source_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_source", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Cloud::SecurityCenter::V1p1beta1::Source.decode_json response.body, ignore_unknown_fields: true + catch :response do + yield result, operation if block_given? + result + end + end + + ## + # Baseline implementation for the group_assets REST call + # + # @param request_pb [::Google::Cloud::SecurityCenter::V1p1beta1::GroupAssetsRequest] + # A request object representing the call parameters. Required. + # @param options [::Gapic::CallOptions] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Cloud::SecurityCenter::V1p1beta1::GroupAssetsResponse] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::SecurityCenter::V1p1beta1::GroupAssetsResponse] + # A result object deserialized from the server's reply + def group_assets request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_group_assets_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: "group_assets", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Cloud::SecurityCenter::V1p1beta1::GroupAssetsResponse.decode_json response.body, ignore_unknown_fields: true + catch :response do + yield result, operation if block_given? + result + end + end + + ## + # Baseline implementation for the group_findings REST call + # + # @param request_pb [::Google::Cloud::SecurityCenter::V1p1beta1::GroupFindingsRequest] + # A request object representing the call parameters. Required. + # @param options [::Gapic::CallOptions] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Cloud::SecurityCenter::V1p1beta1::GroupFindingsResponse] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::SecurityCenter::V1p1beta1::GroupFindingsResponse] + # A result object deserialized from the server's reply + def group_findings request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_group_findings_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: "group_findings", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Cloud::SecurityCenter::V1p1beta1::GroupFindingsResponse.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_assets REST call + # + # @param request_pb [::Google::Cloud::SecurityCenter::V1p1beta1::ListAssetsRequest] + # A request object representing the call parameters. Required. + # @param options [::Gapic::CallOptions] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Cloud::SecurityCenter::V1p1beta1::ListAssetsResponse] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::SecurityCenter::V1p1beta1::ListAssetsResponse] + # A result object deserialized from the server's reply + def list_assets request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_list_assets_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_assets", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Cloud::SecurityCenter::V1p1beta1::ListAssetsResponse.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_findings REST call + # + # @param request_pb [::Google::Cloud::SecurityCenter::V1p1beta1::ListFindingsRequest] + # A request object representing the call parameters. Required. + # @param options [::Gapic::CallOptions] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Cloud::SecurityCenter::V1p1beta1::ListFindingsResponse] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::SecurityCenter::V1p1beta1::ListFindingsResponse] + # A result object deserialized from the server's reply + def list_findings request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_list_findings_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_findings", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Cloud::SecurityCenter::V1p1beta1::ListFindingsResponse.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_notification_configs REST call + # + # @param request_pb [::Google::Cloud::SecurityCenter::V1p1beta1::ListNotificationConfigsRequest] + # A request object representing the call parameters. Required. + # @param options [::Gapic::CallOptions] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Cloud::SecurityCenter::V1p1beta1::ListNotificationConfigsResponse] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::SecurityCenter::V1p1beta1::ListNotificationConfigsResponse] + # A result object deserialized from the server's reply + def list_notification_configs request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_list_notification_configs_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_notification_configs", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Cloud::SecurityCenter::V1p1beta1::ListNotificationConfigsResponse.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_sources REST call + # + # @param request_pb [::Google::Cloud::SecurityCenter::V1p1beta1::ListSourcesRequest] + # A request object representing the call parameters. Required. + # @param options [::Gapic::CallOptions] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Cloud::SecurityCenter::V1p1beta1::ListSourcesResponse] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::SecurityCenter::V1p1beta1::ListSourcesResponse] + # A result object deserialized from the server's reply + def list_sources request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_list_sources_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_sources", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Cloud::SecurityCenter::V1p1beta1::ListSourcesResponse.decode_json response.body, ignore_unknown_fields: true + catch :response do + yield result, operation if block_given? + result + end + end + + ## + # Baseline implementation for the run_asset_discovery REST call + # + # @param request_pb [::Google::Cloud::SecurityCenter::V1p1beta1::RunAssetDiscoveryRequest] + # 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 run_asset_discovery request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_run_asset_discovery_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: "run_asset_discovery", + 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 set_finding_state REST call + # + # @param request_pb [::Google::Cloud::SecurityCenter::V1p1beta1::SetFindingStateRequest] + # A request object representing the call parameters. Required. + # @param options [::Gapic::CallOptions] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Cloud::SecurityCenter::V1p1beta1::Finding] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::SecurityCenter::V1p1beta1::Finding] + # A result object deserialized from the server's reply + def set_finding_state request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_set_finding_state_request request_pb + query_string_params = if query_string_params.any? + query_string_params.to_h { |p| p.split "=", 2 } + else + {} + end + + response = @client_stub.make_http_request( + verb, + uri: uri, + body: body || "", + params: query_string_params, + method_name: "set_finding_state", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Cloud::SecurityCenter::V1p1beta1::Finding.decode_json response.body, ignore_unknown_fields: true + catch :response do + yield result, operation if block_given? + result + end + end + + ## + # Baseline implementation for the set_iam_policy REST call + # + # @param request_pb [::Google::Iam::V1::SetIamPolicyRequest] + # A request object representing the call parameters. Required. + # @param options [::Gapic::CallOptions] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Iam::V1::Policy] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Iam::V1::Policy] + # A result object deserialized from the server's reply + def set_iam_policy request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_set_iam_policy_request request_pb + query_string_params = if query_string_params.any? + query_string_params.to_h { |p| p.split "=", 2 } + else + {} + end + + response = @client_stub.make_http_request( + verb, + uri: uri, + body: body || "", + params: query_string_params, + method_name: "set_iam_policy", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Iam::V1::Policy.decode_json response.body, ignore_unknown_fields: true + catch :response do + yield result, operation if block_given? + result + end + end + + ## + # Baseline implementation for the test_iam_permissions REST call + # + # @param request_pb [::Google::Iam::V1::TestIamPermissionsRequest] + # A request object representing the call parameters. Required. + # @param options [::Gapic::CallOptions] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Iam::V1::TestIamPermissionsResponse] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Iam::V1::TestIamPermissionsResponse] + # A result object deserialized from the server's reply + def test_iam_permissions request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_test_iam_permissions_request request_pb + query_string_params = if query_string_params.any? + query_string_params.to_h { |p| p.split "=", 2 } + else + {} + end + + response = @client_stub.make_http_request( + verb, + uri: uri, + body: body || "", + params: query_string_params, + method_name: "test_iam_permissions", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Iam::V1::TestIamPermissionsResponse.decode_json response.body, ignore_unknown_fields: true + catch :response do + yield result, operation if block_given? + result + end + end + + ## + # Baseline implementation for the update_finding REST call + # + # @param request_pb [::Google::Cloud::SecurityCenter::V1p1beta1::UpdateFindingRequest] + # A request object representing the call parameters. Required. + # @param options [::Gapic::CallOptions] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Cloud::SecurityCenter::V1p1beta1::Finding] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::SecurityCenter::V1p1beta1::Finding] + # A result object deserialized from the server's reply + def update_finding request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_update_finding_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_finding", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Cloud::SecurityCenter::V1p1beta1::Finding.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_notification_config REST call + # + # @param request_pb [::Google::Cloud::SecurityCenter::V1p1beta1::UpdateNotificationConfigRequest] + # A request object representing the call parameters. Required. + # @param options [::Gapic::CallOptions] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Cloud::SecurityCenter::V1p1beta1::NotificationConfig] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::SecurityCenter::V1p1beta1::NotificationConfig] + # A result object deserialized from the server's reply + def update_notification_config request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_update_notification_config_request request_pb + query_string_params = if query_string_params.any? + query_string_params.to_h { |p| p.split "=", 2 } + else + {} + end + + response = @client_stub.make_http_request( + verb, + uri: uri, + body: body || "", + params: query_string_params, + method_name: "update_notification_config", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Cloud::SecurityCenter::V1p1beta1::NotificationConfig.decode_json response.body, ignore_unknown_fields: true + catch :response do + yield result, operation if block_given? + result + end + end + + ## + # Baseline implementation for the update_organization_settings REST call + # + # @param request_pb [::Google::Cloud::SecurityCenter::V1p1beta1::UpdateOrganizationSettingsRequest] + # A request object representing the call parameters. Required. + # @param options [::Gapic::CallOptions] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Cloud::SecurityCenter::V1p1beta1::OrganizationSettings] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::SecurityCenter::V1p1beta1::OrganizationSettings] + # A result object deserialized from the server's reply + def update_organization_settings request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_update_organization_settings_request request_pb + query_string_params = if query_string_params.any? + query_string_params.to_h { |p| p.split "=", 2 } + else + {} + end + + response = @client_stub.make_http_request( + verb, + uri: uri, + body: body || "", + params: query_string_params, + method_name: "update_organization_settings", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Cloud::SecurityCenter::V1p1beta1::OrganizationSettings.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_source REST call + # + # @param request_pb [::Google::Cloud::SecurityCenter::V1p1beta1::UpdateSourceRequest] + # A request object representing the call parameters. Required. + # @param options [::Gapic::CallOptions] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Cloud::SecurityCenter::V1p1beta1::Source] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::SecurityCenter::V1p1beta1::Source] + # A result object deserialized from the server's reply + def update_source request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_update_source_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_source", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Cloud::SecurityCenter::V1p1beta1::Source.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_security_marks REST call + # + # @param request_pb [::Google::Cloud::SecurityCenter::V1p1beta1::UpdateSecurityMarksRequest] + # A request object representing the call parameters. Required. + # @param options [::Gapic::CallOptions] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Cloud::SecurityCenter::V1p1beta1::SecurityMarks] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::SecurityCenter::V1p1beta1::SecurityMarks] + # A result object deserialized from the server's reply + def update_security_marks request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_update_security_marks_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_security_marks", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Cloud::SecurityCenter::V1p1beta1::SecurityMarks.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_source REST call + # + # @param request_pb [::Google::Cloud::SecurityCenter::V1p1beta1::CreateSourceRequest] + # 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_source_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :post, + uri_template: "/v1p1beta1/{parent}/sources", + body: "source", + matches: [ + ["parent", %r{^organizations/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the create_finding REST call + # + # @param request_pb [::Google::Cloud::SecurityCenter::V1p1beta1::CreateFindingRequest] + # 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_finding_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :post, + uri_template: "/v1p1beta1/{parent}/findings", + body: "finding", + matches: [ + ["parent", %r{^organizations/[^/]+/sources/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the create_notification_config REST call + # + # @param request_pb [::Google::Cloud::SecurityCenter::V1p1beta1::CreateNotificationConfigRequest] + # 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_notification_config_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :post, + uri_template: "/v1p1beta1/{parent}/notificationConfigs", + body: "notification_config", + matches: [ + ["parent", %r{^organizations/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the delete_notification_config REST call + # + # @param request_pb [::Google::Cloud::SecurityCenter::V1p1beta1::DeleteNotificationConfigRequest] + # 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_notification_config_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :delete, + uri_template: "/v1p1beta1/{name}", + matches: [ + ["name", %r{^organizations/[^/]+/notificationConfigs/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the get_iam_policy REST call + # + # @param request_pb [::Google::Iam::V1::GetIamPolicyRequest] + # A request object representing the call parameters. Required. + # @return [Array(String, [String, nil], Hash{String => String})] + # Uri, Body, Query string parameters + def self.transcode_get_iam_policy_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :post, + uri_template: "/v1p1beta1/{resource}:getIamPolicy", + body: "*", + matches: [ + ["resource", %r{^organizations/[^/]+/sources/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the get_notification_config REST call + # + # @param request_pb [::Google::Cloud::SecurityCenter::V1p1beta1::GetNotificationConfigRequest] + # 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_notification_config_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :get, + uri_template: "/v1p1beta1/{name}", + matches: [ + ["name", %r{^organizations/[^/]+/notificationConfigs/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the get_organization_settings REST call + # + # @param request_pb [::Google::Cloud::SecurityCenter::V1p1beta1::GetOrganizationSettingsRequest] + # A request object representing the call parameters. Required. + # @return [Array(String, [String, nil], Hash{String => String})] + # Uri, Body, Query string parameters + def self.transcode_get_organization_settings_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :get, + uri_template: "/v1p1beta1/{name}", + matches: [ + ["name", %r{^organizations/[^/]+/organizationSettings/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the get_source REST call + # + # @param request_pb [::Google::Cloud::SecurityCenter::V1p1beta1::GetSourceRequest] + # 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_source_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :get, + uri_template: "/v1p1beta1/{name}", + matches: [ + ["name", %r{^organizations/[^/]+/sources/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the group_assets REST call + # + # @param request_pb [::Google::Cloud::SecurityCenter::V1p1beta1::GroupAssetsRequest] + # A request object representing the call parameters. Required. + # @return [Array(String, [String, nil], Hash{String => String})] + # Uri, Body, Query string parameters + def self.transcode_group_assets_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :post, + uri_template: "/v1p1beta1/{parent}/assets:group", + body: "*", + matches: [ + ["parent", %r{^organizations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1p1beta1/{parent}/assets:group", + body: "*", + matches: [ + ["parent", %r{^folders/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1p1beta1/{parent}/assets:group", + body: "*", + matches: [ + ["parent", %r{^projects/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the group_findings REST call + # + # @param request_pb [::Google::Cloud::SecurityCenter::V1p1beta1::GroupFindingsRequest] + # A request object representing the call parameters. Required. + # @return [Array(String, [String, nil], Hash{String => String})] + # Uri, Body, Query string parameters + def self.transcode_group_findings_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :post, + uri_template: "/v1p1beta1/{parent}/findings:group", + body: "*", + matches: [ + ["parent", %r{^organizations/[^/]+/sources/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1p1beta1/{parent}/findings:group", + body: "*", + matches: [ + ["parent", %r{^folders/[^/]+/sources/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1p1beta1/{parent}/findings:group", + body: "*", + matches: [ + ["parent", %r{^projects/[^/]+/sources/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the list_assets REST call + # + # @param request_pb [::Google::Cloud::SecurityCenter::V1p1beta1::ListAssetsRequest] + # 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_assets_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :get, + uri_template: "/v1p1beta1/{parent}/assets", + matches: [ + ["parent", %r{^organizations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1p1beta1/{parent}/assets", + matches: [ + ["parent", %r{^folders/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1p1beta1/{parent}/assets", + matches: [ + ["parent", %r{^projects/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the list_findings REST call + # + # @param request_pb [::Google::Cloud::SecurityCenter::V1p1beta1::ListFindingsRequest] + # 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_findings_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :get, + uri_template: "/v1p1beta1/{parent}/findings", + matches: [ + ["parent", %r{^organizations/[^/]+/sources/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1p1beta1/{parent}/findings", + matches: [ + ["parent", %r{^folders/[^/]+/sources/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1p1beta1/{parent}/findings", + matches: [ + ["parent", %r{^projects/[^/]+/sources/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the list_notification_configs REST call + # + # @param request_pb [::Google::Cloud::SecurityCenter::V1p1beta1::ListNotificationConfigsRequest] + # 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_notification_configs_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :get, + uri_template: "/v1p1beta1/{parent}/notificationConfigs", + matches: [ + ["parent", %r{^organizations/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the list_sources REST call + # + # @param request_pb [::Google::Cloud::SecurityCenter::V1p1beta1::ListSourcesRequest] + # 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_sources_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :get, + uri_template: "/v1p1beta1/{parent}/sources", + matches: [ + ["parent", %r{^organizations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1p1beta1/{parent}/sources", + matches: [ + ["parent", %r{^folders/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1p1beta1/{parent}/sources", + matches: [ + ["parent", %r{^projects/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the run_asset_discovery REST call + # + # @param request_pb [::Google::Cloud::SecurityCenter::V1p1beta1::RunAssetDiscoveryRequest] + # A request object representing the call parameters. Required. + # @return [Array(String, [String, nil], Hash{String => String})] + # Uri, Body, Query string parameters + def self.transcode_run_asset_discovery_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :post, + uri_template: "/v1p1beta1/{parent}/assets:runDiscovery", + body: "*", + matches: [ + ["parent", %r{^organizations/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the set_finding_state REST call + # + # @param request_pb [::Google::Cloud::SecurityCenter::V1p1beta1::SetFindingStateRequest] + # A request object representing the call parameters. Required. + # @return [Array(String, [String, nil], Hash{String => String})] + # Uri, Body, Query string parameters + def self.transcode_set_finding_state_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :post, + uri_template: "/v1p1beta1/{name}:setState", + body: "*", + matches: [ + ["name", %r{^organizations/[^/]+/sources/[^/]+/findings/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1p1beta1/{name}:setState", + body: "*", + matches: [ + ["name", %r{^folders/[^/]+/sources/[^/]+/findings/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1p1beta1/{name}:setState", + body: "*", + matches: [ + ["name", %r{^projects/[^/]+/sources/[^/]+/findings/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the set_iam_policy REST call + # + # @param request_pb [::Google::Iam::V1::SetIamPolicyRequest] + # A request object representing the call parameters. Required. + # @return [Array(String, [String, nil], Hash{String => String})] + # Uri, Body, Query string parameters + def self.transcode_set_iam_policy_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :post, + uri_template: "/v1p1beta1/{resource}:setIamPolicy", + body: "*", + matches: [ + ["resource", %r{^organizations/[^/]+/sources/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the test_iam_permissions REST call + # + # @param request_pb [::Google::Iam::V1::TestIamPermissionsRequest] + # A request object representing the call parameters. Required. + # @return [Array(String, [String, nil], Hash{String => String})] + # Uri, Body, Query string parameters + def self.transcode_test_iam_permissions_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :post, + uri_template: "/v1p1beta1/{resource}:testIamPermissions", + body: "*", + matches: [ + ["resource", %r{^organizations/[^/]+/sources/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the update_finding REST call + # + # @param request_pb [::Google::Cloud::SecurityCenter::V1p1beta1::UpdateFindingRequest] + # 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_finding_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :patch, + uri_template: "/v1p1beta1/{finding.name}", + body: "finding", + matches: [ + ["finding.name", %r{^organizations/[^/]+/sources/[^/]+/findings/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :patch, + uri_template: "/v1p1beta1/{finding.name}", + body: "finding", + matches: [ + ["finding.name", %r{^folders/[^/]+/sources/[^/]+/findings/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :patch, + uri_template: "/v1p1beta1/{finding.name}", + body: "finding", + matches: [ + ["finding.name", %r{^projects/[^/]+/sources/[^/]+/findings/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the update_notification_config REST call + # + # @param request_pb [::Google::Cloud::SecurityCenter::V1p1beta1::UpdateNotificationConfigRequest] + # 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_notification_config_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :patch, + uri_template: "/v1p1beta1/{notification_config.name}", + body: "notification_config", + matches: [ + ["notification_config.name", %r{^organizations/[^/]+/notificationConfigs/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the update_organization_settings REST call + # + # @param request_pb [::Google::Cloud::SecurityCenter::V1p1beta1::UpdateOrganizationSettingsRequest] + # A request object representing the call parameters. Required. + # @return [Array(String, [String, nil], Hash{String => String})] + # Uri, Body, Query string parameters + def self.transcode_update_organization_settings_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :patch, + uri_template: "/v1p1beta1/{organization_settings.name}", + body: "organization_settings", + matches: [ + ["organization_settings.name", %r{^organizations/[^/]+/organizationSettings/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the update_source REST call + # + # @param request_pb [::Google::Cloud::SecurityCenter::V1p1beta1::UpdateSourceRequest] + # 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_source_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :patch, + uri_template: "/v1p1beta1/{source.name}", + body: "source", + matches: [ + ["source.name", %r{^organizations/[^/]+/sources/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the update_security_marks REST call + # + # @param request_pb [::Google::Cloud::SecurityCenter::V1p1beta1::UpdateSecurityMarksRequest] + # 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_security_marks_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :patch, + uri_template: "/v1p1beta1/{security_marks.name}", + body: "security_marks", + matches: [ + ["security_marks.name", %r{^organizations/[^/]+/assets/[^/]+/securityMarks/?$}, false] + ] + ) + .with_bindings( + uri_method: :patch, + uri_template: "/v1p1beta1/{security_marks.name}", + body: "security_marks", + matches: [ + ["security_marks.name", %r{^folders/[^/]+/assets/[^/]+/securityMarks/?$}, false] + ] + ) + .with_bindings( + uri_method: :patch, + uri_template: "/v1p1beta1/{security_marks.name}", + body: "security_marks", + matches: [ + ["security_marks.name", %r{^projects/[^/]+/assets/[^/]+/securityMarks/?$}, false] + ] + ) + .with_bindings( + uri_method: :patch, + uri_template: "/v1p1beta1/{security_marks.name}", + body: "security_marks", + matches: [ + ["security_marks.name", %r{^organizations/[^/]+/sources/[^/]+/findings/[^/]+/securityMarks/?$}, false] + ] + ) + .with_bindings( + uri_method: :patch, + uri_template: "/v1p1beta1/{security_marks.name}", + body: "security_marks", + matches: [ + ["security_marks.name", %r{^folders/[^/]+/sources/[^/]+/findings/[^/]+/securityMarks/?$}, false] + ] + ) + .with_bindings( + uri_method: :patch, + uri_template: "/v1p1beta1/{security_marks.name}", + body: "security_marks", + matches: [ + ["security_marks.name", %r{^projects/[^/]+/sources/[^/]+/findings/[^/]+/securityMarks/?$}, false] + ] + ) + transcoder.transcode request_pb + end + end + end + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-security_center-v1p1beta1/lib/google/cloud/security_center/v1p1beta1/version.rb b/owl-bot-staging/google-cloud-security_center-v1p1beta1/lib/google/cloud/security_center/v1p1beta1/version.rb new file mode 100644 index 000000000000..55106c9006d5 --- /dev/null +++ b/owl-bot-staging/google-cloud-security_center-v1p1beta1/lib/google/cloud/security_center/v1p1beta1/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 SecurityCenter + module V1p1beta1 + VERSION = "0.0.1" + end + end + end +end diff --git a/owl-bot-staging/google-cloud-security_center-v1p1beta1/lib/google/cloud/securitycenter/v1p1beta1/asset_pb.rb b/owl-bot-staging/google-cloud-security_center-v1p1beta1/lib/google/cloud/securitycenter/v1p1beta1/asset_pb.rb new file mode 100644 index 000000000000..9a12931a6f98 --- /dev/null +++ b/owl-bot-staging/google-cloud-security_center-v1p1beta1/lib/google/cloud/securitycenter/v1p1beta1/asset_pb.rb @@ -0,0 +1,29 @@ +# frozen_string_literal: true +# Generated by the protocol buffer compiler. DO NOT EDIT! +# source: google/cloud/securitycenter/v1p1beta1/asset.proto + +require 'google/protobuf' + +require 'google/api/resource_pb' +require 'google/cloud/securitycenter/v1p1beta1/folder_pb' +require 'google/cloud/securitycenter/v1p1beta1/security_marks_pb' +require 'google/protobuf/struct_pb' +require 'google/protobuf/timestamp_pb' + + +descriptor_data = "\n1google/cloud/securitycenter/v1p1beta1/asset.proto\x12%google.cloud.securitycenter.v1p1beta1\x1a\x19google/api/resource.proto\x1a\x32google/cloud/securitycenter/v1p1beta1/folder.proto\x1a:google/cloud/securitycenter/v1p1beta1/security_marks.proto\x1a\x1cgoogle/protobuf/struct.proto\x1a\x1fgoogle/protobuf/timestamp.proto\"\xcc\x08\n\x05\x41sset\x12\x0c\n\x04name\x18\x01 \x01(\t\x12i\n\x1asecurity_center_properties\x18\x02 \x01(\x0b\x32\x45.google.cloud.securitycenter.v1p1beta1.Asset.SecurityCenterProperties\x12\x61\n\x13resource_properties\x18\x07 \x03(\x0b\x32\x44.google.cloud.securitycenter.v1p1beta1.Asset.ResourcePropertiesEntry\x12L\n\x0esecurity_marks\x18\x08 \x01(\x0b\x32\x34.google.cloud.securitycenter.v1p1beta1.SecurityMarks\x12/\n\x0b\x63reate_time\x18\t \x01(\x0b\x32\x1a.google.protobuf.Timestamp\x12/\n\x0bupdate_time\x18\n \x01(\x0b\x32\x1a.google.protobuf.Timestamp\x12J\n\niam_policy\x18\x0b \x01(\x0b\x32\x36.google.cloud.securitycenter.v1p1beta1.Asset.IamPolicy\x12\x16\n\x0e\x63\x61nonical_name\x18\r \x01(\t\x1a\xc0\x02\n\x18SecurityCenterProperties\x12\x15\n\rresource_name\x18\x01 \x01(\t\x12\x15\n\rresource_type\x18\x02 \x01(\t\x12\x17\n\x0fresource_parent\x18\x03 \x01(\t\x12\x18\n\x10resource_project\x18\x04 \x01(\t\x12\x17\n\x0fresource_owners\x18\x05 \x03(\t\x12\x1d\n\x15resource_display_name\x18\x06 \x01(\t\x12$\n\x1cresource_parent_display_name\x18\x07 \x01(\t\x12%\n\x1dresource_project_display_name\x18\x08 \x01(\t\x12>\n\x07\x66olders\x18\n \x03(\x0b\x32-.google.cloud.securitycenter.v1p1beta1.Folder\x1a \n\tIamPolicy\x12\x13\n\x0bpolicy_blob\x18\x01 \x01(\t\x1aQ\n\x17ResourcePropertiesEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12%\n\x05value\x18\x02 \x01(\x0b\x32\x16.google.protobuf.Value:\x02\x38\x01:\x9a\x01\xea\x41\x96\x01\n#securitycenter.googleapis.com/Asset\x12+organizations/{organization}/assets/{asset}\x12\x1f\x66olders/{folder}/assets/{asset}\x12!projects/{project}/assets/{asset}B\xfb\x01\n)com.google.cloud.securitycenter.v1p1beta1P\x01ZQcloud.google.com/go/securitycenter/apiv1p1beta1/securitycenterpb;securitycenterpb\xaa\x02%Google.Cloud.SecurityCenter.V1P1Beta1\xca\x02%Google\\Cloud\\SecurityCenter\\V1p1beta1\xea\x02(Google::Cloud::SecurityCenter::V1p1beta1b\x06proto3" + +pool = ::Google::Protobuf::DescriptorPool.generated_pool +pool.add_serialized_file(descriptor_data) + +module Google + module Cloud + module SecurityCenter + module V1p1beta1 + Asset = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.securitycenter.v1p1beta1.Asset").msgclass + Asset::SecurityCenterProperties = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.securitycenter.v1p1beta1.Asset.SecurityCenterProperties").msgclass + Asset::IamPolicy = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.securitycenter.v1p1beta1.Asset.IamPolicy").msgclass + end + end + end +end diff --git a/owl-bot-staging/google-cloud-security_center-v1p1beta1/lib/google/cloud/securitycenter/v1p1beta1/finding_pb.rb b/owl-bot-staging/google-cloud-security_center-v1p1beta1/lib/google/cloud/securitycenter/v1p1beta1/finding_pb.rb new file mode 100644 index 000000000000..050e7b68bfff --- /dev/null +++ b/owl-bot-staging/google-cloud-security_center-v1p1beta1/lib/google/cloud/securitycenter/v1p1beta1/finding_pb.rb @@ -0,0 +1,29 @@ +# frozen_string_literal: true +# Generated by the protocol buffer compiler. DO NOT EDIT! +# source: google/cloud/securitycenter/v1p1beta1/finding.proto + +require 'google/protobuf' + +require 'google/api/field_behavior_pb' +require 'google/api/resource_pb' +require 'google/cloud/securitycenter/v1p1beta1/security_marks_pb' +require 'google/protobuf/struct_pb' +require 'google/protobuf/timestamp_pb' + + +descriptor_data = "\n3google/cloud/securitycenter/v1p1beta1/finding.proto\x12%google.cloud.securitycenter.v1p1beta1\x1a\x1fgoogle/api/field_behavior.proto\x1a\x19google/api/resource.proto\x1a:google/cloud/securitycenter/v1p1beta1/security_marks.proto\x1a\x1cgoogle/protobuf/struct.proto\x1a\x1fgoogle/protobuf/timestamp.proto\"\xdf\x07\n\x07\x46inding\x12\x0c\n\x04name\x18\x01 \x01(\t\x12\x0e\n\x06parent\x18\x02 \x01(\t\x12\x15\n\rresource_name\x18\x03 \x01(\t\x12\x43\n\x05state\x18\x04 \x01(\x0e\x32\x34.google.cloud.securitycenter.v1p1beta1.Finding.State\x12\x10\n\x08\x63\x61tegory\x18\x05 \x01(\t\x12\x14\n\x0c\x65xternal_uri\x18\x06 \x01(\t\x12_\n\x11source_properties\x18\x07 \x03(\x0b\x32\x44.google.cloud.securitycenter.v1p1beta1.Finding.SourcePropertiesEntry\x12Q\n\x0esecurity_marks\x18\x08 \x01(\x0b\x32\x34.google.cloud.securitycenter.v1p1beta1.SecurityMarksB\x03\xe0\x41\x03\x12.\n\nevent_time\x18\t \x01(\x0b\x32\x1a.google.protobuf.Timestamp\x12/\n\x0b\x63reate_time\x18\n \x01(\x0b\x32\x1a.google.protobuf.Timestamp\x12I\n\x08severity\x18\r \x01(\x0e\x32\x37.google.cloud.securitycenter.v1p1beta1.Finding.Severity\x12\x16\n\x0e\x63\x61nonical_name\x18\x0e \x01(\t\x1aO\n\x15SourcePropertiesEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12%\n\x05value\x18\x02 \x01(\x0b\x32\x16.google.protobuf.Value:\x02\x38\x01\"8\n\x05State\x12\x15\n\x11STATE_UNSPECIFIED\x10\x00\x12\n\n\x06\x41\x43TIVE\x10\x01\x12\x0c\n\x08INACTIVE\x10\x02\"Q\n\x08Severity\x12\x18\n\x14SEVERITY_UNSPECIFIED\x10\x00\x12\x0c\n\x08\x43RITICAL\x10\x01\x12\x08\n\x04HIGH\x10\x02\x12\n\n\x06MEDIUM\x10\x03\x12\x07\n\x03LOW\x10\x04:\xdb\x01\xea\x41\xd7\x01\n%securitycenter.googleapis.com/Finding\x12@organizations/{organization}/sources/{source}/findings/{finding}\x12\x34\x66olders/{folder}/sources/{source}/findings/{finding}\x12\x36projects/{project}/sources/{source}/findings/{finding}B\xfb\x01\n)com.google.cloud.securitycenter.v1p1beta1P\x01ZQcloud.google.com/go/securitycenter/apiv1p1beta1/securitycenterpb;securitycenterpb\xaa\x02%Google.Cloud.SecurityCenter.V1P1Beta1\xca\x02%Google\\Cloud\\SecurityCenter\\V1p1beta1\xea\x02(Google::Cloud::SecurityCenter::V1p1beta1b\x06proto3" + +pool = ::Google::Protobuf::DescriptorPool.generated_pool +pool.add_serialized_file(descriptor_data) + +module Google + module Cloud + module SecurityCenter + module V1p1beta1 + Finding = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.securitycenter.v1p1beta1.Finding").msgclass + Finding::State = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.securitycenter.v1p1beta1.Finding.State").enummodule + Finding::Severity = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.securitycenter.v1p1beta1.Finding.Severity").enummodule + end + end + end +end diff --git a/owl-bot-staging/google-cloud-security_center-v1p1beta1/lib/google/cloud/securitycenter/v1p1beta1/folder_pb.rb b/owl-bot-staging/google-cloud-security_center-v1p1beta1/lib/google/cloud/securitycenter/v1p1beta1/folder_pb.rb new file mode 100644 index 000000000000..2a78935f850c --- /dev/null +++ b/owl-bot-staging/google-cloud-security_center-v1p1beta1/lib/google/cloud/securitycenter/v1p1beta1/folder_pb.rb @@ -0,0 +1,21 @@ +# frozen_string_literal: true +# Generated by the protocol buffer compiler. DO NOT EDIT! +# source: google/cloud/securitycenter/v1p1beta1/folder.proto + +require 'google/protobuf' + + +descriptor_data = "\n2google/cloud/securitycenter/v1p1beta1/folder.proto\x12%google.cloud.securitycenter.v1p1beta1\"G\n\x06\x46older\x12\x17\n\x0fresource_folder\x18\x01 \x01(\t\x12$\n\x1cresource_folder_display_name\x18\x02 \x01(\tB\x88\x02\n)com.google.cloud.securitycenter.v1p1beta1B\x0b\x46olderProtoP\x01ZQcloud.google.com/go/securitycenter/apiv1p1beta1/securitycenterpb;securitycenterpb\xaa\x02%Google.Cloud.SecurityCenter.V1P1Beta1\xca\x02%Google\\Cloud\\SecurityCenter\\V1p1beta1\xea\x02(Google::Cloud::SecurityCenter::V1p1Beta1b\x06proto3" + +pool = ::Google::Protobuf::DescriptorPool.generated_pool +pool.add_serialized_file(descriptor_data) + +module Google + module Cloud + module SecurityCenter + module V1p1Beta1 + Folder = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.securitycenter.v1p1beta1.Folder").msgclass + end + end + end +end diff --git a/owl-bot-staging/google-cloud-security_center-v1p1beta1/lib/google/cloud/securitycenter/v1p1beta1/notification_config_pb.rb b/owl-bot-staging/google-cloud-security_center-v1p1beta1/lib/google/cloud/securitycenter/v1p1beta1/notification_config_pb.rb new file mode 100644 index 000000000000..f08fde86beee --- /dev/null +++ b/owl-bot-staging/google-cloud-security_center-v1p1beta1/lib/google/cloud/securitycenter/v1p1beta1/notification_config_pb.rb @@ -0,0 +1,26 @@ +# frozen_string_literal: true +# Generated by the protocol buffer compiler. DO NOT EDIT! +# source: google/cloud/securitycenter/v1p1beta1/notification_config.proto + +require 'google/protobuf' + +require 'google/api/field_behavior_pb' +require 'google/api/resource_pb' + + +descriptor_data = "\n?google/cloud/securitycenter/v1p1beta1/notification_config.proto\x12%google.cloud.securitycenter.v1p1beta1\x1a\x1fgoogle/api/field_behavior.proto\x1a\x19google/api/resource.proto\"\xb6\x04\n\x12NotificationConfig\x12\x0c\n\x04name\x18\x01 \x01(\t\x12\x13\n\x0b\x64\x65scription\x18\x02 \x01(\t\x12W\n\nevent_type\x18\x03 \x01(\x0e\x32\x43.google.cloud.securitycenter.v1p1beta1.NotificationConfig.EventType\x12\x36\n\x0cpubsub_topic\x18\x04 \x01(\tB \xfa\x41\x1d\n\x1bpubsub.googleapis.com/Topic\x12\x1c\n\x0fservice_account\x18\x05 \x01(\tB\x03\xe0\x41\x03\x12\x65\n\x10streaming_config\x18\x06 \x01(\x0b\x32I.google.cloud.securitycenter.v1p1beta1.NotificationConfig.StreamingConfigH\x00\x1a!\n\x0fStreamingConfig\x12\x0e\n\x06\x66ilter\x18\x01 \x01(\t\"4\n\tEventType\x12\x1a\n\x16\x45VENT_TYPE_UNSPECIFIED\x10\x00\x12\x0b\n\x07\x46INDING\x10\x01:}\xea\x41z\n0securitycenter.googleapis.com/NotificationConfig\x12\x46organizations/{organization}/notificationConfigs/{notification_config}B\x0f\n\rnotify_configB\xbe\x02\n)com.google.cloud.securitycenter.v1p1beta1P\x01ZQcloud.google.com/go/securitycenter/apiv1p1beta1/securitycenterpb;securitycenterpb\xaa\x02%Google.Cloud.SecurityCenter.V1P1Beta1\xca\x02%Google\\Cloud\\SecurityCenter\\V1p1beta1\xea\x02(Google::Cloud::SecurityCenter::V1p1beta1\xea\x41@\n\x1bpubsub.googleapis.com/Topic\x12!projects/{project}/topics/{topic}b\x06proto3" + +pool = ::Google::Protobuf::DescriptorPool.generated_pool +pool.add_serialized_file(descriptor_data) + +module Google + module Cloud + module SecurityCenter + module V1p1beta1 + NotificationConfig = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.securitycenter.v1p1beta1.NotificationConfig").msgclass + NotificationConfig::StreamingConfig = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.securitycenter.v1p1beta1.NotificationConfig.StreamingConfig").msgclass + NotificationConfig::EventType = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.securitycenter.v1p1beta1.NotificationConfig.EventType").enummodule + end + end + end +end diff --git a/owl-bot-staging/google-cloud-security_center-v1p1beta1/lib/google/cloud/securitycenter/v1p1beta1/notification_message_pb.rb b/owl-bot-staging/google-cloud-security_center-v1p1beta1/lib/google/cloud/securitycenter/v1p1beta1/notification_message_pb.rb new file mode 100644 index 000000000000..c696cbc0af35 --- /dev/null +++ b/owl-bot-staging/google-cloud-security_center-v1p1beta1/lib/google/cloud/securitycenter/v1p1beta1/notification_message_pb.rb @@ -0,0 +1,24 @@ +# frozen_string_literal: true +# Generated by the protocol buffer compiler. DO NOT EDIT! +# source: google/cloud/securitycenter/v1p1beta1/notification_message.proto + +require 'google/protobuf' + +require 'google/cloud/securitycenter/v1p1beta1/finding_pb' +require 'google/cloud/securitycenter/v1p1beta1/resource_pb' + + +descriptor_data = "\n@google/cloud/securitycenter/v1p1beta1/notification_message.proto\x12%google.cloud.securitycenter.v1p1beta1\x1a\x33google/cloud/securitycenter/v1p1beta1/finding.proto\x1a\x34google/cloud/securitycenter/v1p1beta1/resource.proto\"\xc6\x01\n\x13NotificationMessage\x12 \n\x18notification_config_name\x18\x01 \x01(\t\x12\x41\n\x07\x66inding\x18\x02 \x01(\x0b\x32..google.cloud.securitycenter.v1p1beta1.FindingH\x00\x12\x41\n\x08resource\x18\x03 \x01(\x0b\x32/.google.cloud.securitycenter.v1p1beta1.ResourceB\x07\n\x05\x65ventB\xfb\x01\n)com.google.cloud.securitycenter.v1p1beta1P\x01ZQcloud.google.com/go/securitycenter/apiv1p1beta1/securitycenterpb;securitycenterpb\xaa\x02%Google.Cloud.SecurityCenter.V1P1Beta1\xca\x02%Google\\Cloud\\SecurityCenter\\V1p1beta1\xea\x02(Google::Cloud::SecurityCenter::V1p1beta1b\x06proto3" + +pool = ::Google::Protobuf::DescriptorPool.generated_pool +pool.add_serialized_file(descriptor_data) + +module Google + module Cloud + module SecurityCenter + module V1p1beta1 + NotificationMessage = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.securitycenter.v1p1beta1.NotificationMessage").msgclass + end + end + end +end diff --git a/owl-bot-staging/google-cloud-security_center-v1p1beta1/lib/google/cloud/securitycenter/v1p1beta1/organization_settings_pb.rb b/owl-bot-staging/google-cloud-security_center-v1p1beta1/lib/google/cloud/securitycenter/v1p1beta1/organization_settings_pb.rb new file mode 100644 index 000000000000..d97b8888bc15 --- /dev/null +++ b/owl-bot-staging/google-cloud-security_center-v1p1beta1/lib/google/cloud/securitycenter/v1p1beta1/organization_settings_pb.rb @@ -0,0 +1,25 @@ +# frozen_string_literal: true +# Generated by the protocol buffer compiler. DO NOT EDIT! +# source: google/cloud/securitycenter/v1p1beta1/organization_settings.proto + +require 'google/protobuf' + +require 'google/api/resource_pb' + + +descriptor_data = "\nAgoogle/cloud/securitycenter/v1p1beta1/organization_settings.proto\x12%google.cloud.securitycenter.v1p1beta1\x1a\x19google/api/resource.proto\"\xac\x04\n\x14OrganizationSettings\x12\x0c\n\x04name\x18\x01 \x01(\t\x12\x1e\n\x16\x65nable_asset_discovery\x18\x02 \x01(\x08\x12p\n\x16\x61sset_discovery_config\x18\x03 \x01(\x0b\x32P.google.cloud.securitycenter.v1p1beta1.OrganizationSettings.AssetDiscoveryConfig\x1a\x87\x02\n\x14\x41ssetDiscoveryConfig\x12\x13\n\x0bproject_ids\x18\x01 \x03(\t\x12v\n\x0einclusion_mode\x18\x02 \x01(\x0e\x32^.google.cloud.securitycenter.v1p1beta1.OrganizationSettings.AssetDiscoveryConfig.InclusionMode\x12\x12\n\nfolder_ids\x18\x03 \x03(\t\"N\n\rInclusionMode\x12\x1e\n\x1aINCLUSION_MODE_UNSPECIFIED\x10\x00\x12\x10\n\x0cINCLUDE_ONLY\x10\x01\x12\x0b\n\x07\x45XCLUDE\x10\x02:j\xea\x41g\n2securitycenter.googleapis.com/OrganizationSettings\x12\x31organizations/{organization}/organizationSettingsB\xfb\x01\n)com.google.cloud.securitycenter.v1p1beta1P\x01ZQcloud.google.com/go/securitycenter/apiv1p1beta1/securitycenterpb;securitycenterpb\xaa\x02%Google.Cloud.SecurityCenter.V1P1Beta1\xca\x02%Google\\Cloud\\SecurityCenter\\V1p1beta1\xea\x02(Google::Cloud::SecurityCenter::V1p1beta1b\x06proto3" + +pool = ::Google::Protobuf::DescriptorPool.generated_pool +pool.add_serialized_file(descriptor_data) + +module Google + module Cloud + module SecurityCenter + module V1p1beta1 + OrganizationSettings = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.securitycenter.v1p1beta1.OrganizationSettings").msgclass + OrganizationSettings::AssetDiscoveryConfig = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.securitycenter.v1p1beta1.OrganizationSettings.AssetDiscoveryConfig").msgclass + OrganizationSettings::AssetDiscoveryConfig::InclusionMode = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.securitycenter.v1p1beta1.OrganizationSettings.AssetDiscoveryConfig.InclusionMode").enummodule + end + end + end +end diff --git a/owl-bot-staging/google-cloud-security_center-v1p1beta1/lib/google/cloud/securitycenter/v1p1beta1/resource_pb.rb b/owl-bot-staging/google-cloud-security_center-v1p1beta1/lib/google/cloud/securitycenter/v1p1beta1/resource_pb.rb new file mode 100644 index 000000000000..74eac8cc1a2c --- /dev/null +++ b/owl-bot-staging/google-cloud-security_center-v1p1beta1/lib/google/cloud/securitycenter/v1p1beta1/resource_pb.rb @@ -0,0 +1,24 @@ +# frozen_string_literal: true +# Generated by the protocol buffer compiler. DO NOT EDIT! +# source: google/cloud/securitycenter/v1p1beta1/resource.proto + +require 'google/protobuf' + +require 'google/api/field_behavior_pb' +require 'google/cloud/securitycenter/v1p1beta1/folder_pb' + + +descriptor_data = "\n4google/cloud/securitycenter/v1p1beta1/resource.proto\x12%google.cloud.securitycenter.v1p1beta1\x1a\x1fgoogle/api/field_behavior.proto\x1a\x32google/cloud/securitycenter/v1p1beta1/folder.proto\"\xb9\x01\n\x08Resource\x12\x0c\n\x04name\x18\x01 \x01(\t\x12\x0f\n\x07project\x18\x02 \x01(\t\x12\x1c\n\x14project_display_name\x18\x03 \x01(\t\x12\x0e\n\x06parent\x18\x04 \x01(\t\x12\x1b\n\x13parent_display_name\x18\x05 \x01(\t\x12\x43\n\x07\x66olders\x18\x07 \x03(\x0b\x32-.google.cloud.securitycenter.v1p1beta1.FolderB\x03\xe0\x41\x03\x42\x8a\x02\n)com.google.cloud.securitycenter.v1p1beta1B\rResourceProtoP\x01ZQcloud.google.com/go/securitycenter/apiv1p1beta1/securitycenterpb;securitycenterpb\xaa\x02%Google.Cloud.SecurityCenter.V1P1Beta1\xca\x02%Google\\Cloud\\SecurityCenter\\V1p1beta1\xea\x02(Google::Cloud::SecurityCenter::V1p1beta1b\x06proto3" + +pool = ::Google::Protobuf::DescriptorPool.generated_pool +pool.add_serialized_file(descriptor_data) + +module Google + module Cloud + module SecurityCenter + module V1p1beta1 + Resource = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.securitycenter.v1p1beta1.Resource").msgclass + end + end + end +end diff --git a/owl-bot-staging/google-cloud-security_center-v1p1beta1/lib/google/cloud/securitycenter/v1p1beta1/run_asset_discovery_response_pb.rb b/owl-bot-staging/google-cloud-security_center-v1p1beta1/lib/google/cloud/securitycenter/v1p1beta1/run_asset_discovery_response_pb.rb new file mode 100644 index 000000000000..b8264e7a8867 --- /dev/null +++ b/owl-bot-staging/google-cloud-security_center-v1p1beta1/lib/google/cloud/securitycenter/v1p1beta1/run_asset_discovery_response_pb.rb @@ -0,0 +1,24 @@ +# frozen_string_literal: true +# Generated by the protocol buffer compiler. DO NOT EDIT! +# source: google/cloud/securitycenter/v1p1beta1/run_asset_discovery_response.proto + +require 'google/protobuf' + +require 'google/protobuf/duration_pb' + + +descriptor_data = "\nHgoogle/cloud/securitycenter/v1p1beta1/run_asset_discovery_response.proto\x12%google.cloud.securitycenter.v1p1beta1\x1a\x1egoogle/protobuf/duration.proto\"\xee\x01\n\x19RunAssetDiscoveryResponse\x12U\n\x05state\x18\x01 \x01(\x0e\x32\x46.google.cloud.securitycenter.v1p1beta1.RunAssetDiscoveryResponse.State\x12+\n\x08\x64uration\x18\x02 \x01(\x0b\x32\x19.google.protobuf.Duration\"M\n\x05State\x12\x15\n\x11STATE_UNSPECIFIED\x10\x00\x12\r\n\tCOMPLETED\x10\x01\x12\x0e\n\nSUPERSEDED\x10\x02\x12\x0e\n\nTERMINATED\x10\x03\x42\xfb\x01\n)com.google.cloud.securitycenter.v1p1beta1P\x01ZQcloud.google.com/go/securitycenter/apiv1p1beta1/securitycenterpb;securitycenterpb\xaa\x02%Google.Cloud.SecurityCenter.V1P1Beta1\xca\x02%Google\\Cloud\\SecurityCenter\\V1p1beta1\xea\x02(Google::Cloud::SecurityCenter::V1p1beta1b\x06proto3" + +pool = ::Google::Protobuf::DescriptorPool.generated_pool +pool.add_serialized_file(descriptor_data) + +module Google + module Cloud + module SecurityCenter + module V1p1beta1 + RunAssetDiscoveryResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.securitycenter.v1p1beta1.RunAssetDiscoveryResponse").msgclass + RunAssetDiscoveryResponse::State = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.securitycenter.v1p1beta1.RunAssetDiscoveryResponse.State").enummodule + end + end + end +end diff --git a/owl-bot-staging/google-cloud-security_center-v1p1beta1/lib/google/cloud/securitycenter/v1p1beta1/security_marks_pb.rb b/owl-bot-staging/google-cloud-security_center-v1p1beta1/lib/google/cloud/securitycenter/v1p1beta1/security_marks_pb.rb new file mode 100644 index 000000000000..e31759178cca --- /dev/null +++ b/owl-bot-staging/google-cloud-security_center-v1p1beta1/lib/google/cloud/securitycenter/v1p1beta1/security_marks_pb.rb @@ -0,0 +1,23 @@ +# frozen_string_literal: true +# Generated by the protocol buffer compiler. DO NOT EDIT! +# source: google/cloud/securitycenter/v1p1beta1/security_marks.proto + +require 'google/protobuf' + +require 'google/api/resource_pb' + + +descriptor_data = "\n:google/cloud/securitycenter/v1p1beta1/security_marks.proto\x12%google.cloud.securitycenter.v1p1beta1\x1a\x19google/api/resource.proto\"\xdc\x04\n\rSecurityMarks\x12\x0c\n\x04name\x18\x01 \x01(\t\x12N\n\x05marks\x18\x02 \x03(\x0b\x32?.google.cloud.securitycenter.v1p1beta1.SecurityMarks.MarksEntry\x12\x16\n\x0e\x63\x61nonical_name\x18\x03 \x01(\t\x1a,\n\nMarksEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12\r\n\x05value\x18\x02 \x01(\t:\x02\x38\x01:\xa6\x03\xea\x41\xa2\x03\n+securitycenter.googleapis.com/SecurityMarks\x12\x39organizations/{organization}/assets/{asset}/securityMarks\x12Norganizations/{organization}/sources/{source}/findings/{finding}/securityMarks\x12-folders/{folder}/assets/{asset}/securityMarks\x12/projects/{project}/assets/{asset}/securityMarks\x12\x42\x66olders/{folder}/sources/{source}/findings/{finding}/securityMarks\x12\x44projects/{project}/sources/{source}/findings/{finding}/securityMarksB\xfb\x01\n)com.google.cloud.securitycenter.v1p1beta1P\x01ZQcloud.google.com/go/securitycenter/apiv1p1beta1/securitycenterpb;securitycenterpb\xaa\x02%Google.Cloud.SecurityCenter.V1P1Beta1\xca\x02%Google\\Cloud\\SecurityCenter\\V1p1beta1\xea\x02(Google::Cloud::SecurityCenter::V1p1beta1b\x06proto3" + +pool = ::Google::Protobuf::DescriptorPool.generated_pool +pool.add_serialized_file(descriptor_data) + +module Google + module Cloud + module SecurityCenter + module V1p1beta1 + SecurityMarks = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.securitycenter.v1p1beta1.SecurityMarks").msgclass + end + end + end +end diff --git a/owl-bot-staging/google-cloud-security_center-v1p1beta1/lib/google/cloud/securitycenter/v1p1beta1/securitycenter_service_pb.rb b/owl-bot-staging/google-cloud-security_center-v1p1beta1/lib/google/cloud/securitycenter/v1p1beta1/securitycenter_service_pb.rb new file mode 100644 index 000000000000..fb06f85622aa --- /dev/null +++ b/owl-bot-staging/google-cloud-security_center-v1p1beta1/lib/google/cloud/securitycenter/v1p1beta1/securitycenter_service_pb.rb @@ -0,0 +1,74 @@ +# frozen_string_literal: true +# Generated by the protocol buffer compiler. DO NOT EDIT! +# source: google/cloud/securitycenter/v1p1beta1/securitycenter_service.proto + +require 'google/protobuf' + +require 'google/cloud/securitycenter/v1p1beta1/notification_message_pb' +require 'google/cloud/securitycenter/v1p1beta1/run_asset_discovery_response_pb' +require 'google/api/annotations_pb' +require 'google/api/client_pb' +require 'google/api/field_behavior_pb' +require 'google/api/resource_pb' +require 'google/cloud/securitycenter/v1p1beta1/asset_pb' +require 'google/cloud/securitycenter/v1p1beta1/finding_pb' +require 'google/cloud/securitycenter/v1p1beta1/folder_pb' +require 'google/cloud/securitycenter/v1p1beta1/notification_config_pb' +require 'google/cloud/securitycenter/v1p1beta1/organization_settings_pb' +require 'google/cloud/securitycenter/v1p1beta1/security_marks_pb' +require 'google/cloud/securitycenter/v1p1beta1/source_pb' +require 'google/iam/v1/iam_policy_pb' +require 'google/iam/v1/policy_pb' +require 'google/longrunning/operations_pb' +require 'google/protobuf/duration_pb' +require 'google/protobuf/empty_pb' +require 'google/protobuf/field_mask_pb' +require 'google/protobuf/struct_pb' +require 'google/protobuf/timestamp_pb' + + +descriptor_data = "\nBgoogle/cloud/securitycenter/v1p1beta1/securitycenter_service.proto\x12%google.cloud.securitycenter.v1p1beta1\x1a@google/cloud/securitycenter/v1p1beta1/notification_message.proto\x1aHgoogle/cloud/securitycenter/v1p1beta1/run_asset_discovery_response.proto\x1a\x1cgoogle/api/annotations.proto\x1a\x17google/api/client.proto\x1a\x1fgoogle/api/field_behavior.proto\x1a\x19google/api/resource.proto\x1a\x31google/cloud/securitycenter/v1p1beta1/asset.proto\x1a\x33google/cloud/securitycenter/v1p1beta1/finding.proto\x1a\x32google/cloud/securitycenter/v1p1beta1/folder.proto\x1a?google/cloud/securitycenter/v1p1beta1/notification_config.proto\x1a\x41google/cloud/securitycenter/v1p1beta1/organization_settings.proto\x1a:google/cloud/securitycenter/v1p1beta1/security_marks.proto\x1a\x32google/cloud/securitycenter/v1p1beta1/source.proto\x1a\x1egoogle/iam/v1/iam_policy.proto\x1a\x1agoogle/iam/v1/policy.proto\x1a#google/longrunning/operations.proto\x1a\x1egoogle/protobuf/duration.proto\x1a\x1bgoogle/protobuf/empty.proto\x1a google/protobuf/field_mask.proto\x1a\x1cgoogle/protobuf/struct.proto\x1a\x1fgoogle/protobuf/timestamp.proto\"\xb3\x01\n\x14\x43reateFindingRequest\x12<\n\x06parent\x18\x01 \x01(\tB,\xe0\x41\x02\xfa\x41&\n$securitycenter.googleapis.com/Source\x12\x17\n\nfinding_id\x18\x02 \x01(\tB\x03\xe0\x41\x02\x12\x44\n\x07\x66inding\x18\x03 \x01(\x0b\x32..google.cloud.securitycenter.v1p1beta1.FindingB\x03\xe0\x41\x02\"\xe0\x01\n\x1f\x43reateNotificationConfigRequest\x12H\n\x06parent\x18\x01 \x01(\tB8\xe0\x41\x02\xfa\x41\x32\n0cloudresourcemanager.googleapis.com/Organization\x12\x16\n\tconfig_id\x18\x02 \x01(\tB\x03\xe0\x41\x02\x12[\n\x13notification_config\x18\x03 \x01(\x0b\x32\x39.google.cloud.securitycenter.v1p1beta1.NotificationConfigB\x03\xe0\x41\x02\"\xa3\x01\n\x13\x43reateSourceRequest\x12H\n\x06parent\x18\x01 \x01(\tB8\xe0\x41\x02\xfa\x41\x32\n0cloudresourcemanager.googleapis.com/Organization\x12\x42\n\x06source\x18\x02 \x01(\x0b\x32-.google.cloud.securitycenter.v1p1beta1.SourceB\x03\xe0\x41\x02\"i\n\x1f\x44\x65leteNotificationConfigRequest\x12\x46\n\x04name\x18\x01 \x01(\tB8\xe0\x41\x02\xfa\x41\x32\n0securitycenter.googleapis.com/NotificationConfig\"f\n\x1cGetNotificationConfigRequest\x12\x46\n\x04name\x18\x01 \x01(\tB8\xe0\x41\x02\xfa\x41\x32\n0securitycenter.googleapis.com/NotificationConfig\"j\n\x1eGetOrganizationSettingsRequest\x12H\n\x04name\x18\x01 \x01(\tB:\xe0\x41\x02\xfa\x41\x34\n2securitycenter.googleapis.com/OrganizationSettings\"N\n\x10GetSourceRequest\x12:\n\x04name\x18\x01 \x01(\tB,\xe0\x41\x02\xfa\x41&\n$securitycenter.googleapis.com/Source\"\x83\x02\n\x12GroupAssetsRequest\x12;\n\x06parent\x18\x01 \x01(\tB+\xe0\x41\x02\xfa\x41%\x12#securitycenter.googleapis.com/Asset\x12\x0e\n\x06\x66ilter\x18\x02 \x01(\t\x12\x15\n\x08group_by\x18\x03 \x01(\tB\x03\xe0\x41\x02\x12\x33\n\x10\x63ompare_duration\x18\x04 \x01(\x0b\x32\x19.google.protobuf.Duration\x12-\n\tread_time\x18\x05 \x01(\x0b\x32\x1a.google.protobuf.Timestamp\x12\x12\n\npage_token\x18\x07 \x01(\t\x12\x11\n\tpage_size\x18\x08 \x01(\x05\"\xbf\x01\n\x13GroupAssetsResponse\x12L\n\x10group_by_results\x18\x01 \x03(\x0b\x32\x32.google.cloud.securitycenter.v1p1beta1.GroupResult\x12-\n\tread_time\x18\x02 \x01(\x0b\x32\x1a.google.protobuf.Timestamp\x12\x17\n\x0fnext_page_token\x18\x03 \x01(\t\x12\x12\n\ntotal_size\x18\x04 \x01(\x05\"\x86\x02\n\x14GroupFindingsRequest\x12<\n\x06parent\x18\x01 \x01(\tB,\xe0\x41\x02\xfa\x41&\n$securitycenter.googleapis.com/Source\x12\x0e\n\x06\x66ilter\x18\x02 \x01(\t\x12\x15\n\x08group_by\x18\x03 \x01(\tB\x03\xe0\x41\x02\x12-\n\tread_time\x18\x04 \x01(\x0b\x32\x1a.google.protobuf.Timestamp\x12\x33\n\x10\x63ompare_duration\x18\x05 \x01(\x0b\x32\x19.google.protobuf.Duration\x12\x12\n\npage_token\x18\x07 \x01(\t\x12\x11\n\tpage_size\x18\x08 \x01(\x05\"\xc1\x01\n\x15GroupFindingsResponse\x12L\n\x10group_by_results\x18\x01 \x03(\x0b\x32\x32.google.cloud.securitycenter.v1p1beta1.GroupResult\x12-\n\tread_time\x18\x02 \x01(\x0b\x32\x1a.google.protobuf.Timestamp\x12\x17\n\x0fnext_page_token\x18\x03 \x01(\t\x12\x12\n\ntotal_size\x18\x04 \x01(\x05\"\xbf\x01\n\x0bGroupResult\x12V\n\nproperties\x18\x01 \x03(\x0b\x32\x42.google.cloud.securitycenter.v1p1beta1.GroupResult.PropertiesEntry\x12\r\n\x05\x63ount\x18\x02 \x01(\x03\x1aI\n\x0fPropertiesEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12%\n\x05value\x18\x02 \x01(\x0b\x32\x16.google.protobuf.Value:\x02\x38\x01\"\x91\x01\n\x1eListNotificationConfigsRequest\x12H\n\x06parent\x18\x01 \x01(\tB8\xe0\x41\x02\xfa\x41\x32\n0cloudresourcemanager.googleapis.com/Organization\x12\x12\n\npage_token\x18\x02 \x01(\t\x12\x11\n\tpage_size\x18\x03 \x01(\x05\"\x93\x01\n\x1fListNotificationConfigsResponse\x12W\n\x14notification_configs\x18\x01 \x03(\x0b\x32\x39.google.cloud.securitycenter.v1p1beta1.NotificationConfig\x12\x17\n\x0fnext_page_token\x18\x02 \x01(\t\"y\n\x12ListSourcesRequest\x12<\n\x06parent\x18\x01 \x01(\tB,\xe0\x41\x02\xfa\x41&\x12$securitycenter.googleapis.com/Source\x12\x12\n\npage_token\x18\x02 \x01(\t\x12\x11\n\tpage_size\x18\x07 \x01(\x05\"n\n\x13ListSourcesResponse\x12>\n\x07sources\x18\x01 \x03(\x0b\x32-.google.cloud.securitycenter.v1p1beta1.Source\x12\x17\n\x0fnext_page_token\x18\x02 \x01(\t\"\xad\x02\n\x11ListAssetsRequest\x12;\n\x06parent\x18\x01 \x01(\tB+\xe0\x41\x02\xfa\x41%\x12#securitycenter.googleapis.com/Asset\x12\x0e\n\x06\x66ilter\x18\x02 \x01(\t\x12\x10\n\x08order_by\x18\x03 \x01(\t\x12-\n\tread_time\x18\x04 \x01(\x0b\x32\x1a.google.protobuf.Timestamp\x12\x33\n\x10\x63ompare_duration\x18\x05 \x01(\x0b\x32\x19.google.protobuf.Duration\x12.\n\nfield_mask\x18\x07 \x01(\x0b\x32\x1a.google.protobuf.FieldMask\x12\x12\n\npage_token\x18\x08 \x01(\t\x12\x11\n\tpage_size\x18\t \x01(\x05\"\xd8\x03\n\x12ListAssetsResponse\x12g\n\x13list_assets_results\x18\x01 \x03(\x0b\x32J.google.cloud.securitycenter.v1p1beta1.ListAssetsResponse.ListAssetsResult\x12-\n\tread_time\x18\x02 \x01(\x0b\x32\x1a.google.protobuf.Timestamp\x12\x17\n\x0fnext_page_token\x18\x03 \x01(\t\x12\x12\n\ntotal_size\x18\x04 \x01(\x05\x1a\xfc\x01\n\x10ListAssetsResult\x12;\n\x05\x61sset\x18\x01 \x01(\x0b\x32,.google.cloud.securitycenter.v1p1beta1.Asset\x12l\n\x0cstate_change\x18\x02 \x01(\x0e\x32V.google.cloud.securitycenter.v1p1beta1.ListAssetsResponse.ListAssetsResult.StateChange\"=\n\x0bStateChange\x12\n\n\x06UNUSED\x10\x00\x12\t\n\x05\x41\x44\x44\x45\x44\x10\x01\x12\x0b\n\x07REMOVED\x10\x02\x12\n\n\x06\x41\x43TIVE\x10\x03\"\xb0\x02\n\x13ListFindingsRequest\x12<\n\x06parent\x18\x01 \x01(\tB,\xe0\x41\x02\xfa\x41&\n$securitycenter.googleapis.com/Source\x12\x0e\n\x06\x66ilter\x18\x02 \x01(\t\x12\x10\n\x08order_by\x18\x03 \x01(\t\x12-\n\tread_time\x18\x04 \x01(\x0b\x32\x1a.google.protobuf.Timestamp\x12\x33\n\x10\x63ompare_duration\x18\x05 \x01(\x0b\x32\x19.google.protobuf.Duration\x12.\n\nfield_mask\x18\x07 \x01(\x0b\x32\x1a.google.protobuf.FieldMask\x12\x12\n\npage_token\x18\x08 \x01(\t\x12\x11\n\tpage_size\x18\t \x01(\x05\"\xab\x06\n\x14ListFindingsResponse\x12m\n\x15list_findings_results\x18\x01 \x03(\x0b\x32N.google.cloud.securitycenter.v1p1beta1.ListFindingsResponse.ListFindingsResult\x12-\n\tread_time\x18\x02 \x01(\x0b\x32\x1a.google.protobuf.Timestamp\x12\x17\n\x0fnext_page_token\x18\x03 \x01(\t\x12\x12\n\ntotal_size\x18\x04 \x01(\x05\x1a\xc7\x04\n\x12ListFindingsResult\x12?\n\x07\x66inding\x18\x01 \x01(\x0b\x32..google.cloud.securitycenter.v1p1beta1.Finding\x12p\n\x0cstate_change\x18\x02 \x01(\x0e\x32Z.google.cloud.securitycenter.v1p1beta1.ListFindingsResponse.ListFindingsResult.StateChange\x12n\n\x08resource\x18\x03 \x01(\x0b\x32W.google.cloud.securitycenter.v1p1beta1.ListFindingsResponse.ListFindingsResult.ResourceB\x03\xe0\x41\x03\x1a\xbe\x01\n\x08Resource\x12\x0c\n\x04name\x18\x01 \x01(\t\x12\x14\n\x0cproject_name\x18\x02 \x01(\t\x12\x1c\n\x14project_display_name\x18\x03 \x01(\t\x12\x13\n\x0bparent_name\x18\x04 \x01(\t\x12\x1b\n\x13parent_display_name\x18\x05 \x01(\t\x12>\n\x07\x66olders\x18\n \x03(\x0b\x32-.google.cloud.securitycenter.v1p1beta1.Folder\"M\n\x0bStateChange\x12\n\n\x06UNUSED\x10\x00\x12\x0b\n\x07\x43HANGED\x10\x01\x12\r\n\tUNCHANGED\x10\x02\x12\t\n\x05\x41\x44\x44\x45\x44\x10\x03\x12\x0b\n\x07REMOVED\x10\x04\"\xd4\x01\n\x16SetFindingStateRequest\x12;\n\x04name\x18\x01 \x01(\tB-\xe0\x41\x02\xfa\x41\'\n%securitycenter.googleapis.com/Finding\x12H\n\x05state\x18\x02 \x01(\x0e\x32\x34.google.cloud.securitycenter.v1p1beta1.Finding.StateB\x03\xe0\x41\x02\x12\x33\n\nstart_time\x18\x03 \x01(\x0b\x32\x1a.google.protobuf.TimestampB\x03\xe0\x41\x02\"d\n\x18RunAssetDiscoveryRequest\x12H\n\x06parent\x18\x01 \x01(\tB8\xe0\x41\x02\xfa\x41\x32\n0cloudresourcemanager.googleapis.com/Organization\"\x8d\x01\n\x14UpdateFindingRequest\x12\x44\n\x07\x66inding\x18\x01 \x01(\x0b\x32..google.cloud.securitycenter.v1p1beta1.FindingB\x03\xe0\x41\x02\x12/\n\x0bupdate_mask\x18\x02 \x01(\x0b\x32\x1a.google.protobuf.FieldMask\"\xaf\x01\n\x1fUpdateNotificationConfigRequest\x12[\n\x13notification_config\x18\x01 \x01(\x0b\x32\x39.google.cloud.securitycenter.v1p1beta1.NotificationConfigB\x03\xe0\x41\x02\x12/\n\x0bupdate_mask\x18\x02 \x01(\x0b\x32\x1a.google.protobuf.FieldMask\"\xb5\x01\n!UpdateOrganizationSettingsRequest\x12_\n\x15organization_settings\x18\x01 \x01(\x0b\x32;.google.cloud.securitycenter.v1p1beta1.OrganizationSettingsB\x03\xe0\x41\x02\x12/\n\x0bupdate_mask\x18\x02 \x01(\x0b\x32\x1a.google.protobuf.FieldMask\"\x8a\x01\n\x13UpdateSourceRequest\x12\x42\n\x06source\x18\x01 \x01(\x0b\x32-.google.cloud.securitycenter.v1p1beta1.SourceB\x03\xe0\x41\x02\x12/\n\x0bupdate_mask\x18\x02 \x01(\x0b\x32\x1a.google.protobuf.FieldMask\"\xd0\x01\n\x1aUpdateSecurityMarksRequest\x12Q\n\x0esecurity_marks\x18\x01 \x01(\x0b\x32\x34.google.cloud.securitycenter.v1p1beta1.SecurityMarksB\x03\xe0\x41\x02\x12/\n\x0bupdate_mask\x18\x02 \x01(\x0b\x32\x1a.google.protobuf.FieldMask\x12.\n\nstart_time\x18\x03 \x01(\x0b\x32\x1a.google.protobuf.Timestamp2\xf8\x33\n\x0eSecurityCenter\x12\xc6\x01\n\x0c\x43reateSource\x12:.google.cloud.securitycenter.v1p1beta1.CreateSourceRequest\x1a-.google.cloud.securitycenter.v1p1beta1.Source\"K\xda\x41\rparent,source\x82\xd3\xe4\x93\x02\x35\"+/v1p1beta1/{parent=organizations/*}/sources:\x06source\x12\xfd\x01\n\rCreateFinding\x12;.google.cloud.securitycenter.v1p1beta1.CreateFindingRequest\x1a..google.cloud.securitycenter.v1p1beta1.Finding\"\x7f\xda\x41\x19parent,finding_id,finding\xda\x41\x19parent,finding,finding_id\x82\xd3\xe4\x93\x02\x41\"6/v1p1beta1/{parent=organizations/*/sources/*}/findings:\x07\x66inding\x12\xb8\x02\n\x18\x43reateNotificationConfig\x12\x46.google.cloud.securitycenter.v1p1beta1.CreateNotificationConfigRequest\x1a\x39.google.cloud.securitycenter.v1p1beta1.NotificationConfig\"\x98\x01\xda\x41$parent,config_id,notification_config\xda\x41\x1aparent,notification_config\x82\xd3\xe4\x93\x02N\"7/v1p1beta1/{parent=organizations/*}/notificationConfigs:\x13notification_config\x12\xc2\x01\n\x18\x44\x65leteNotificationConfig\x12\x46.google.cloud.securitycenter.v1p1beta1.DeleteNotificationConfigRequest\x1a\x16.google.protobuf.Empty\"F\xda\x41\x04name\x82\xd3\xe4\x93\x02\x39*7/v1p1beta1/{name=organizations/*/notificationConfigs/*}\x12\x9d\x01\n\x0cGetIamPolicy\x12\".google.iam.v1.GetIamPolicyRequest\x1a\x15.google.iam.v1.Policy\"R\xda\x41\x08resource\x82\xd3\xe4\x93\x02\x41\"\"9/v1p1beta1/{name=folders/*/sources/*/findings/*}:setState:\x01*Z?\":/v1p1beta1/{name=projects/*/sources/*/findings/*}:setState:\x01*\x12\xa4\x01\n\x0cSetIamPolicy\x12\".google.iam.v1.SetIamPolicyRequest\x1a\x15.google.iam.v1.Policy\"Y\xda\x41\x0fresource,policy\x82\xd3\xe4\x93\x02\x41\"/v1p1beta1/{finding.name=organizations/*/sources/*/findings/*}:\x07\x66indingZC28/v1p1beta1/{finding.name=folders/*/sources/*/findings/*}:\x07\x66indingZD29/v1p1beta1/{finding.name=projects/*/sources/*/findings/*}:\x07\x66inding\x12\xc0\x02\n\x18UpdateNotificationConfig\x12\x46.google.cloud.securitycenter.v1p1beta1.UpdateNotificationConfigRequest\x1a\x39.google.cloud.securitycenter.v1p1beta1.NotificationConfig\"\xa0\x01\xda\x41\x13notification_config\xda\x41\x1fnotification_config,update_mask\x82\xd3\xe4\x93\x02\x62\x32K/v1p1beta1/{notification_config.name=organizations/*/notificationConfigs/*}:\x13notification_config\x12\xa9\x02\n\x1aUpdateOrganizationSettings\x12H.google.cloud.securitycenter.v1p1beta1.UpdateOrganizationSettingsRequest\x1a;.google.cloud.securitycenter.v1p1beta1.OrganizationSettings\"\x83\x01\xda\x41\x15organization_settings\x82\xd3\xe4\x93\x02\x65\x32L/v1p1beta1/{organization_settings.name=organizations/*/organizationSettings}:\x15organization_settings\x12\xdb\x01\n\x0cUpdateSource\x12:.google.cloud.securitycenter.v1p1beta1.UpdateSourceRequest\x1a-.google.cloud.securitycenter.v1p1beta1.Source\"`\xda\x41\x06source\xda\x41\x12source,update_mask\x82\xd3\xe4\x93\x02<22/v1p1beta1/{source.name=organizations/*/sources/*}:\x06source\x12\xf4\x05\n\x13UpdateSecurityMarks\x12\x41.google.cloud.securitycenter.v1p1beta1.UpdateSecurityMarksRequest\x1a\x34.google.cloud.securitycenter.v1p1beta1.SecurityMarks\"\xe3\x04\xda\x41\x0esecurity_marks\xda\x41\x1asecurity_marks,update_mask\x82\xd3\xe4\x93\x02\xae\x04\x32G/v1p1beta1/{security_marks.name=organizations/*/assets/*/securityMarks}:\x0esecurity_marksZS2A/v1p1beta1/{security_marks.name=folders/*/assets/*/securityMarks}:\x0esecurity_marksZT2B/v1p1beta1/{security_marks.name=projects/*/assets/*/securityMarks}:\x0esecurity_marksZe2S/v1p1beta1/{security_marks.name=organizations/*/sources/*/findings/*/securityMarks}:\x0esecurity_marksZ_2M/v1p1beta1/{security_marks.name=folders/*/sources/*/findings/*/securityMarks}:\x0esecurity_marksZ`2N/v1p1beta1/{security_marks.name=projects/*/sources/*/findings/*/securityMarks}:\x0esecurity_marks\x1aQ\xca\x41\x1dsecuritycenter.googleapis.com\xd2\x41.https://www.googleapis.com/auth/cloud-platformB\xfb\x01\n)com.google.cloud.securitycenter.v1p1beta1P\x01ZQcloud.google.com/go/securitycenter/apiv1p1beta1/securitycenterpb;securitycenterpb\xaa\x02%Google.Cloud.SecurityCenter.V1P1Beta1\xca\x02%Google\\Cloud\\SecurityCenter\\V1p1beta1\xea\x02(Google::Cloud::SecurityCenter::V1p1beta1P\x00P\x01\x62\x06proto3" + +pool = ::Google::Protobuf::DescriptorPool.generated_pool +pool.add_serialized_file(descriptor_data) + +module Google + module Cloud + module SecurityCenter + module V1p1beta1 + CreateFindingRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.securitycenter.v1p1beta1.CreateFindingRequest").msgclass + CreateNotificationConfigRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.securitycenter.v1p1beta1.CreateNotificationConfigRequest").msgclass + CreateSourceRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.securitycenter.v1p1beta1.CreateSourceRequest").msgclass + DeleteNotificationConfigRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.securitycenter.v1p1beta1.DeleteNotificationConfigRequest").msgclass + GetNotificationConfigRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.securitycenter.v1p1beta1.GetNotificationConfigRequest").msgclass + GetOrganizationSettingsRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.securitycenter.v1p1beta1.GetOrganizationSettingsRequest").msgclass + GetSourceRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.securitycenter.v1p1beta1.GetSourceRequest").msgclass + GroupAssetsRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.securitycenter.v1p1beta1.GroupAssetsRequest").msgclass + GroupAssetsResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.securitycenter.v1p1beta1.GroupAssetsResponse").msgclass + GroupFindingsRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.securitycenter.v1p1beta1.GroupFindingsRequest").msgclass + GroupFindingsResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.securitycenter.v1p1beta1.GroupFindingsResponse").msgclass + GroupResult = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.securitycenter.v1p1beta1.GroupResult").msgclass + ListNotificationConfigsRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.securitycenter.v1p1beta1.ListNotificationConfigsRequest").msgclass + ListNotificationConfigsResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.securitycenter.v1p1beta1.ListNotificationConfigsResponse").msgclass + ListSourcesRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.securitycenter.v1p1beta1.ListSourcesRequest").msgclass + ListSourcesResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.securitycenter.v1p1beta1.ListSourcesResponse").msgclass + ListAssetsRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.securitycenter.v1p1beta1.ListAssetsRequest").msgclass + ListAssetsResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.securitycenter.v1p1beta1.ListAssetsResponse").msgclass + ListAssetsResponse::ListAssetsResult = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.securitycenter.v1p1beta1.ListAssetsResponse.ListAssetsResult").msgclass + ListAssetsResponse::ListAssetsResult::StateChange = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.securitycenter.v1p1beta1.ListAssetsResponse.ListAssetsResult.StateChange").enummodule + ListFindingsRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.securitycenter.v1p1beta1.ListFindingsRequest").msgclass + ListFindingsResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.securitycenter.v1p1beta1.ListFindingsResponse").msgclass + ListFindingsResponse::ListFindingsResult = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.securitycenter.v1p1beta1.ListFindingsResponse.ListFindingsResult").msgclass + ListFindingsResponse::ListFindingsResult::Resource = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.securitycenter.v1p1beta1.ListFindingsResponse.ListFindingsResult.Resource").msgclass + ListFindingsResponse::ListFindingsResult::StateChange = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.securitycenter.v1p1beta1.ListFindingsResponse.ListFindingsResult.StateChange").enummodule + SetFindingStateRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.securitycenter.v1p1beta1.SetFindingStateRequest").msgclass + RunAssetDiscoveryRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.securitycenter.v1p1beta1.RunAssetDiscoveryRequest").msgclass + UpdateFindingRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.securitycenter.v1p1beta1.UpdateFindingRequest").msgclass + UpdateNotificationConfigRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.securitycenter.v1p1beta1.UpdateNotificationConfigRequest").msgclass + UpdateOrganizationSettingsRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.securitycenter.v1p1beta1.UpdateOrganizationSettingsRequest").msgclass + UpdateSourceRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.securitycenter.v1p1beta1.UpdateSourceRequest").msgclass + UpdateSecurityMarksRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.securitycenter.v1p1beta1.UpdateSecurityMarksRequest").msgclass + end + end + end +end diff --git a/owl-bot-staging/google-cloud-security_center-v1p1beta1/lib/google/cloud/securitycenter/v1p1beta1/securitycenter_service_services_pb.rb b/owl-bot-staging/google-cloud-security_center-v1p1beta1/lib/google/cloud/securitycenter/v1p1beta1/securitycenter_service_services_pb.rb new file mode 100644 index 000000000000..76c57914966b --- /dev/null +++ b/owl-bot-staging/google-cloud-security_center-v1p1beta1/lib/google/cloud/securitycenter/v1p1beta1/securitycenter_service_services_pb.rb @@ -0,0 +1,107 @@ +# Generated by the protocol buffer compiler. DO NOT EDIT! +# Source: google/cloud/securitycenter/v1p1beta1/securitycenter_service.proto for package 'Google.Cloud.SecurityCenter.V1p1beta1' +# Original file comments: +# 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 +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# + +require 'grpc' +require 'google/cloud/securitycenter/v1p1beta1/securitycenter_service_pb' + +module Google + module Cloud + module SecurityCenter + module V1p1beta1 + module SecurityCenter + # V1p1Beta1 APIs for Security Center service. + class Service + + include ::GRPC::GenericService + + self.marshal_class_method = :encode + self.unmarshal_class_method = :decode + self.service_name = 'google.cloud.securitycenter.v1p1beta1.SecurityCenter' + + # Creates a source. + rpc :CreateSource, ::Google::Cloud::SecurityCenter::V1p1beta1::CreateSourceRequest, ::Google::Cloud::SecurityCenter::V1p1beta1::Source + # Creates a finding. The corresponding source must exist for finding + # creation to succeed. + rpc :CreateFinding, ::Google::Cloud::SecurityCenter::V1p1beta1::CreateFindingRequest, ::Google::Cloud::SecurityCenter::V1p1beta1::Finding + # Creates a notification config. + rpc :CreateNotificationConfig, ::Google::Cloud::SecurityCenter::V1p1beta1::CreateNotificationConfigRequest, ::Google::Cloud::SecurityCenter::V1p1beta1::NotificationConfig + # Deletes a notification config. + rpc :DeleteNotificationConfig, ::Google::Cloud::SecurityCenter::V1p1beta1::DeleteNotificationConfigRequest, ::Google::Protobuf::Empty + # Gets the access control policy on the specified Source. + rpc :GetIamPolicy, ::Google::Iam::V1::GetIamPolicyRequest, ::Google::Iam::V1::Policy + # Gets a notification config. + rpc :GetNotificationConfig, ::Google::Cloud::SecurityCenter::V1p1beta1::GetNotificationConfigRequest, ::Google::Cloud::SecurityCenter::V1p1beta1::NotificationConfig + # Gets the settings for an organization. + rpc :GetOrganizationSettings, ::Google::Cloud::SecurityCenter::V1p1beta1::GetOrganizationSettingsRequest, ::Google::Cloud::SecurityCenter::V1p1beta1::OrganizationSettings + # Gets a source. + rpc :GetSource, ::Google::Cloud::SecurityCenter::V1p1beta1::GetSourceRequest, ::Google::Cloud::SecurityCenter::V1p1beta1::Source + # Filters an organization's assets and groups them by their specified + # properties. + rpc :GroupAssets, ::Google::Cloud::SecurityCenter::V1p1beta1::GroupAssetsRequest, ::Google::Cloud::SecurityCenter::V1p1beta1::GroupAssetsResponse + # Filters an organization or source's findings and groups them by their + # specified properties. + # + # To group across all sources provide a `-` as the source id. + # Example: /v1/organizations/{organization_id}/sources/-/findings, + # /v1/folders/{folder_id}/sources/-/findings, + # /v1/projects/{project_id}/sources/-/findings + rpc :GroupFindings, ::Google::Cloud::SecurityCenter::V1p1beta1::GroupFindingsRequest, ::Google::Cloud::SecurityCenter::V1p1beta1::GroupFindingsResponse + # Lists an organization's assets. + rpc :ListAssets, ::Google::Cloud::SecurityCenter::V1p1beta1::ListAssetsRequest, ::Google::Cloud::SecurityCenter::V1p1beta1::ListAssetsResponse + # Lists an organization or source's findings. + # + # To list across all sources provide a `-` as the source id. + # Example: /v1p1beta1/organizations/{organization_id}/sources/-/findings + rpc :ListFindings, ::Google::Cloud::SecurityCenter::V1p1beta1::ListFindingsRequest, ::Google::Cloud::SecurityCenter::V1p1beta1::ListFindingsResponse + # Lists notification configs. + rpc :ListNotificationConfigs, ::Google::Cloud::SecurityCenter::V1p1beta1::ListNotificationConfigsRequest, ::Google::Cloud::SecurityCenter::V1p1beta1::ListNotificationConfigsResponse + # Lists all sources belonging to an organization. + rpc :ListSources, ::Google::Cloud::SecurityCenter::V1p1beta1::ListSourcesRequest, ::Google::Cloud::SecurityCenter::V1p1beta1::ListSourcesResponse + # Runs asset discovery. The discovery is tracked with a long-running + # operation. + # + # This API can only be called with limited frequency for an organization. If + # it is called too frequently the caller will receive a TOO_MANY_REQUESTS + # error. + rpc :RunAssetDiscovery, ::Google::Cloud::SecurityCenter::V1p1beta1::RunAssetDiscoveryRequest, ::Google::Longrunning::Operation + # Updates the state of a finding. + rpc :SetFindingState, ::Google::Cloud::SecurityCenter::V1p1beta1::SetFindingStateRequest, ::Google::Cloud::SecurityCenter::V1p1beta1::Finding + # Sets the access control policy on the specified Source. + rpc :SetIamPolicy, ::Google::Iam::V1::SetIamPolicyRequest, ::Google::Iam::V1::Policy + # Returns the permissions that a caller has on the specified source. + rpc :TestIamPermissions, ::Google::Iam::V1::TestIamPermissionsRequest, ::Google::Iam::V1::TestIamPermissionsResponse + # Creates or updates a finding. The corresponding source must exist for a + # finding creation to succeed. + rpc :UpdateFinding, ::Google::Cloud::SecurityCenter::V1p1beta1::UpdateFindingRequest, ::Google::Cloud::SecurityCenter::V1p1beta1::Finding + # Updates a notification config. The following update + # fields are allowed: description, pubsub_topic, streaming_config.filter + rpc :UpdateNotificationConfig, ::Google::Cloud::SecurityCenter::V1p1beta1::UpdateNotificationConfigRequest, ::Google::Cloud::SecurityCenter::V1p1beta1::NotificationConfig + # Updates an organization's settings. + rpc :UpdateOrganizationSettings, ::Google::Cloud::SecurityCenter::V1p1beta1::UpdateOrganizationSettingsRequest, ::Google::Cloud::SecurityCenter::V1p1beta1::OrganizationSettings + # Updates a source. + rpc :UpdateSource, ::Google::Cloud::SecurityCenter::V1p1beta1::UpdateSourceRequest, ::Google::Cloud::SecurityCenter::V1p1beta1::Source + # Updates security marks. + rpc :UpdateSecurityMarks, ::Google::Cloud::SecurityCenter::V1p1beta1::UpdateSecurityMarksRequest, ::Google::Cloud::SecurityCenter::V1p1beta1::SecurityMarks + end + + Stub = Service.rpc_stub_class + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-security_center-v1p1beta1/lib/google/cloud/securitycenter/v1p1beta1/source_pb.rb b/owl-bot-staging/google-cloud-security_center-v1p1beta1/lib/google/cloud/securitycenter/v1p1beta1/source_pb.rb new file mode 100644 index 000000000000..4315dc444ba5 --- /dev/null +++ b/owl-bot-staging/google-cloud-security_center-v1p1beta1/lib/google/cloud/securitycenter/v1p1beta1/source_pb.rb @@ -0,0 +1,23 @@ +# frozen_string_literal: true +# Generated by the protocol buffer compiler. DO NOT EDIT! +# source: google/cloud/securitycenter/v1p1beta1/source.proto + +require 'google/protobuf' + +require 'google/api/resource_pb' + + +descriptor_data = "\n2google/cloud/securitycenter/v1p1beta1/source.proto\x12%google.cloud.securitycenter.v1p1beta1\x1a\x19google/api/resource.proto\"\xfd\x01\n\x06Source\x12\x0c\n\x04name\x18\x01 \x01(\t\x12\x14\n\x0c\x64isplay_name\x18\x02 \x01(\t\x12\x13\n\x0b\x64\x65scription\x18\x03 \x01(\t\x12\x16\n\x0e\x63\x61nonical_name\x18\x0e \x01(\t:\xa1\x01\xea\x41\x9d\x01\n$securitycenter.googleapis.com/Source\x12-organizations/{organization}/sources/{source}\x12!folders/{folder}/sources/{source}\x12#projects/{project}/sources/{source}B\xfb\x01\n)com.google.cloud.securitycenter.v1p1beta1P\x01ZQcloud.google.com/go/securitycenter/apiv1p1beta1/securitycenterpb;securitycenterpb\xaa\x02%Google.Cloud.SecurityCenter.V1P1Beta1\xca\x02%Google\\Cloud\\SecurityCenter\\V1p1beta1\xea\x02(Google::Cloud::SecurityCenter::V1p1beta1b\x06proto3" + +pool = ::Google::Protobuf::DescriptorPool.generated_pool +pool.add_serialized_file(descriptor_data) + +module Google + module Cloud + module SecurityCenter + module V1p1beta1 + Source = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.securitycenter.v1p1beta1.Source").msgclass + end + end + end +end diff --git a/owl-bot-staging/google-cloud-security_center-v1p1beta1/proto_docs/README.md b/owl-bot-staging/google-cloud-security_center-v1p1beta1/proto_docs/README.md new file mode 100644 index 000000000000..a4968e1aaa4d --- /dev/null +++ b/owl-bot-staging/google-cloud-security_center-v1p1beta1/proto_docs/README.md @@ -0,0 +1,4 @@ +# Cloud Security Command Center V1p1beta1 Protocol Buffer Documentation + +These files are for the YARD documentation of the generated protobuf files. +They are not intended to be required or loaded at runtime. diff --git a/owl-bot-staging/google-cloud-security_center-v1p1beta1/proto_docs/google/api/client.rb b/owl-bot-staging/google-cloud-security_center-v1p1beta1/proto_docs/google/api/client.rb new file mode 100644 index 000000000000..5089551e9ea4 --- /dev/null +++ b/owl-bot-staging/google-cloud-security_center-v1p1beta1/proto_docs/google/api/client.rb @@ -0,0 +1,589 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + + +module Google + module Api + # Required information for every language. + # @!attribute [rw] reference_docs_uri + # @deprecated This field is deprecated and may be removed in the next major version update. + # @return [::String] + # Link to automatically generated reference documentation. Example: + # https://cloud.google.com/nodejs/docs/reference/asset/latest + # @!attribute [rw] destinations + # @return [::Array<::Google::Api::ClientLibraryDestination>] + # The destination where API teams want this client library to be published. + # @!attribute [rw] selective_gapic_generation + # @return [::Google::Api::SelectiveGapicGeneration] + # Configuration for which RPCs should be generated in the GAPIC client. + class CommonLanguageSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Details about how and where to publish client libraries. + # @!attribute [rw] version + # @return [::String] + # Version of the API to apply these settings to. This is the full protobuf + # package for the API, ending in the version element. + # Examples: "google.cloud.speech.v1" and "google.spanner.admin.database.v1". + # @!attribute [rw] launch_stage + # @return [::Google::Api::LaunchStage] + # Launch stage of this version of the API. + # @!attribute [rw] rest_numeric_enums + # @return [::Boolean] + # When using transport=rest, the client request will encode enums as + # numbers rather than strings. + # @!attribute [rw] java_settings + # @return [::Google::Api::JavaSettings] + # Settings for legacy Java features, supported in the Service YAML. + # @!attribute [rw] cpp_settings + # @return [::Google::Api::CppSettings] + # Settings for C++ client libraries. + # @!attribute [rw] php_settings + # @return [::Google::Api::PhpSettings] + # Settings for PHP client libraries. + # @!attribute [rw] python_settings + # @return [::Google::Api::PythonSettings] + # Settings for Python client libraries. + # @!attribute [rw] node_settings + # @return [::Google::Api::NodeSettings] + # Settings for Node client libraries. + # @!attribute [rw] dotnet_settings + # @return [::Google::Api::DotnetSettings] + # Settings for .NET client libraries. + # @!attribute [rw] ruby_settings + # @return [::Google::Api::RubySettings] + # Settings for Ruby client libraries. + # @!attribute [rw] go_settings + # @return [::Google::Api::GoSettings] + # Settings for Go client libraries. + class ClientLibrarySettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # This message configures the settings for publishing [Google Cloud Client + # libraries](https://cloud.google.com/apis/docs/cloud-client-libraries) + # generated from the service config. + # @!attribute [rw] method_settings + # @return [::Array<::Google::Api::MethodSettings>] + # A list of API method settings, e.g. the behavior for methods that use the + # long-running operation pattern. + # @!attribute [rw] new_issue_uri + # @return [::String] + # Link to a *public* URI where users can report issues. Example: + # https://issuetracker.google.com/issues/new?component=190865&template=1161103 + # @!attribute [rw] documentation_uri + # @return [::String] + # Link to product home page. Example: + # https://cloud.google.com/asset-inventory/docs/overview + # @!attribute [rw] api_short_name + # @return [::String] + # Used as a tracking tag when collecting data about the APIs developer + # relations artifacts like docs, packages delivered to package managers, + # etc. Example: "speech". + # @!attribute [rw] github_label + # @return [::String] + # GitHub label to apply to issues and pull requests opened for this API. + # @!attribute [rw] codeowner_github_teams + # @return [::Array<::String>] + # GitHub teams to be added to CODEOWNERS in the directory in GitHub + # containing source code for the client libraries for this API. + # @!attribute [rw] doc_tag_prefix + # @return [::String] + # A prefix used in sample code when demarking regions to be included in + # documentation. + # @!attribute [rw] organization + # @return [::Google::Api::ClientLibraryOrganization] + # For whom the client library is being published. + # @!attribute [rw] library_settings + # @return [::Array<::Google::Api::ClientLibrarySettings>] + # Client library settings. If the same version string appears multiple + # times in this list, then the last one wins. Settings from earlier + # settings with the same version string are discarded. + # @!attribute [rw] proto_reference_documentation_uri + # @return [::String] + # Optional link to proto reference documentation. Example: + # https://cloud.google.com/pubsub/lite/docs/reference/rpc + # @!attribute [rw] rest_reference_documentation_uri + # @return [::String] + # Optional link to REST reference documentation. Example: + # https://cloud.google.com/pubsub/lite/docs/reference/rest + class Publishing + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Settings for Java client libraries. + # @!attribute [rw] library_package + # @return [::String] + # The package name to use in Java. Clobbers the java_package option + # set in the protobuf. This should be used **only** by APIs + # who have already set the language_settings.java.package_name" field + # in gapic.yaml. API teams should use the protobuf java_package option + # where possible. + # + # Example of a YAML configuration:: + # + # publishing: + # 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. + # @!attribute [rw] methods + # @return [::Array<::String>] + # An allowlist of the fully qualified names of RPCs that should be included + # on public client surfaces. + # @!attribute [rw] generate_omitted_as_internal + # @return [::Boolean] + # Setting this to true indicates to the client generators that methods + # that would be excluded from the generation should instead be generated + # in a way that indicates these methods should not be consumed by + # end users. How this is expressed is up to individual language + # implementations to decide. Some examples may be: added annotations, + # obfuscated identifiers, or other language idiomatic patterns. + class SelectiveGapicGeneration + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # `BatchingConfigProto` defines the batching configuration for an API method. + # @!attribute [rw] thresholds + # @return [::Google::Api::BatchingSettingsProto] + # The thresholds which trigger a batched request to be sent. + # @!attribute [rw] batch_descriptor + # @return [::Google::Api::BatchingDescriptorProto] + # The request and response fields used in batching. + class BatchingConfigProto + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # `BatchingSettingsProto` specifies a set of batching thresholds, each of + # which acts as a trigger to send a batch of messages as a request. At least + # one threshold must be positive nonzero. + # @!attribute [rw] element_count_threshold + # @return [::Integer] + # The number of elements of a field collected into a batch which, if + # exceeded, causes the batch to be sent. + # @!attribute [rw] request_byte_threshold + # @return [::Integer] + # The aggregated size of the batched field which, if exceeded, causes the + # batch to be sent. This size is computed by aggregating the sizes of the + # request field to be batched, not of the entire request message. + # @!attribute [rw] delay_threshold + # @return [::Google::Protobuf::Duration] + # The duration after which a batch should be sent, starting from the addition + # of the first message to that batch. + # @!attribute [rw] element_count_limit + # @return [::Integer] + # The maximum number of elements collected in a batch that could be accepted + # by server. + # @!attribute [rw] request_byte_limit + # @return [::Integer] + # The maximum size of the request that could be accepted by server. + # @!attribute [rw] flow_control_element_limit + # @return [::Integer] + # The maximum number of elements allowed by flow control. + # @!attribute [rw] flow_control_byte_limit + # @return [::Integer] + # The maximum size of data allowed by flow control. + # @!attribute [rw] flow_control_limit_exceeded_behavior + # @return [::Google::Api::FlowControlLimitExceededBehaviorProto] + # The behavior to take when the flow control limit is exceeded. + class BatchingSettingsProto + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # `BatchingDescriptorProto` specifies the fields of the request message to be + # used for batching, and, optionally, the fields of the response message to be + # used for demultiplexing. + # @!attribute [rw] batched_field + # @return [::String] + # The repeated field in the request message to be aggregated by batching. + # @!attribute [rw] discriminator_fields + # @return [::Array<::String>] + # A list of the fields in the request message. Two requests will be batched + # together only if the values of every field specified in + # `request_discriminator_fields` is equal between the two requests. + # @!attribute [rw] subresponse_field + # @return [::String] + # Optional. When present, indicates the field in the response message to be + # used to demultiplex the response into multiple response messages, in + # correspondence with the multiple request messages originally batched + # together. + class BatchingDescriptorProto + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # The organization for which the client libraries are being published. + # Affects the url where generated docs are published, etc. + module ClientLibraryOrganization + # Not useful. + CLIENT_LIBRARY_ORGANIZATION_UNSPECIFIED = 0 + + # Google Cloud Platform Org. + CLOUD = 1 + + # Ads (Advertising) Org. + ADS = 2 + + # Photos Org. + PHOTOS = 3 + + # Street View Org. + STREET_VIEW = 4 + + # Shopping Org. + SHOPPING = 5 + + # Geo Org. + GEO = 6 + + # Generative AI - https://developers.generativeai.google + GENERATIVE_AI = 7 + end + + # To where should client libraries be published? + module ClientLibraryDestination + # Client libraries will neither be generated nor published to package + # managers. + CLIENT_LIBRARY_DESTINATION_UNSPECIFIED = 0 + + # Generate the client library in a repo under github.com/googleapis, + # but don't publish it to package managers. + GITHUB = 10 + + # Publish the library to package managers like nuget.org and npmjs.com. + PACKAGE_MANAGER = 20 + end + + # The behavior to take when the flow control limit is exceeded. + module FlowControlLimitExceededBehaviorProto + # Default behavior, system-defined. + UNSET_BEHAVIOR = 0 + + # Stop operation, raise error. + THROW_EXCEPTION = 1 + + # Pause operation until limit clears. + BLOCK = 2 + + # Continue operation, disregard limit. + IGNORE = 3 + end + end +end diff --git a/owl-bot-staging/google-cloud-security_center-v1p1beta1/proto_docs/google/api/field_behavior.rb b/owl-bot-staging/google-cloud-security_center-v1p1beta1/proto_docs/google/api/field_behavior.rb new file mode 100644 index 000000000000..582be187d115 --- /dev/null +++ b/owl-bot-staging/google-cloud-security_center-v1p1beta1/proto_docs/google/api/field_behavior.rb @@ -0,0 +1,85 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + + +module Google + module Api + # An indicator of the behavior of a given field (for example, that a field + # is required in requests, or given as output but ignored as input). + # This **does not** change the behavior in protocol buffers itself; it only + # denotes the behavior and may affect how API tooling handles the field. + # + # Note: This enum **may** receive new values in the future. + module FieldBehavior + # Conventional default for enums. Do not use this. + FIELD_BEHAVIOR_UNSPECIFIED = 0 + + # Specifically denotes a field as optional. + # While all fields in protocol buffers are optional, this may be specified + # for emphasis if appropriate. + OPTIONAL = 1 + + # Denotes a field as required. + # This indicates that the field **must** be provided as part of the request, + # and failure to do so will cause an error (usually `INVALID_ARGUMENT`). + REQUIRED = 2 + + # Denotes a field as output only. + # This indicates that the field is provided in responses, but including the + # field in a request does nothing (the server *must* ignore it and + # *must not* throw an error as a result of the field's presence). + OUTPUT_ONLY = 3 + + # Denotes a field as input only. + # This indicates that the field is provided in requests, and the + # corresponding field is not included in output. + INPUT_ONLY = 4 + + # Denotes a field as immutable. + # This indicates that the field may be set once in a request to create a + # resource, but may not be changed thereafter. + IMMUTABLE = 5 + + # Denotes that a (repeated) field is an unordered list. + # This indicates that the service may provide the elements of the list + # in any arbitrary order, rather than the order the user originally + # provided. Additionally, the list's order may or may not be stable. + UNORDERED_LIST = 6 + + # Denotes that this field returns a non-empty default value if not set. + # This indicates that if the user provides the empty value in a request, + # a non-empty value will be returned. The user will not be aware of what + # non-empty value to expect. + NON_EMPTY_DEFAULT = 7 + + # Denotes that the field in a resource (a message annotated with + # google.api.resource) is used in the resource name to uniquely identify the + # resource. For AIP-compliant APIs, this should only be applied to the + # `name` field on the resource. + # + # This behavior should not be applied to references to other resources within + # the message. + # + # The identifier field of resources often have different field behavior + # depending on the request it is embedded in (e.g. for Create methods name + # is optional and unused, while for Update methods it is required). Instead + # of method-specific annotations, only `IDENTIFIER` is required. + IDENTIFIER = 8 + end + end +end diff --git a/owl-bot-staging/google-cloud-security_center-v1p1beta1/proto_docs/google/api/launch_stage.rb b/owl-bot-staging/google-cloud-security_center-v1p1beta1/proto_docs/google/api/launch_stage.rb new file mode 100644 index 000000000000..9392a413fb1b --- /dev/null +++ b/owl-bot-staging/google-cloud-security_center-v1p1beta1/proto_docs/google/api/launch_stage.rb @@ -0,0 +1,71 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + + +module Google + module Api + # The launch stage as defined by [Google Cloud Platform + # Launch Stages](https://cloud.google.com/terms/launch-stages). + module LaunchStage + # Do not use this default value. + LAUNCH_STAGE_UNSPECIFIED = 0 + + # The feature is not yet implemented. Users can not use it. + UNIMPLEMENTED = 6 + + # Prelaunch features are hidden from users and are only visible internally. + PRELAUNCH = 7 + + # Early Access features are limited to a closed group of testers. To use + # these features, you must sign up in advance and sign a Trusted Tester + # agreement (which includes confidentiality provisions). These features may + # be unstable, changed in backward-incompatible ways, and are not + # guaranteed to be released. + EARLY_ACCESS = 1 + + # Alpha is a limited availability test for releases before they are cleared + # for widespread use. By Alpha, all significant design issues are resolved + # and we are in the process of verifying functionality. Alpha customers + # need to apply for access, agree to applicable terms, and have their + # projects allowlisted. Alpha releases don't have to be feature complete, + # no SLAs are provided, and there are no technical support obligations, but + # they will be far enough along that customers can actually use them in + # test environments or for limited-use tests -- just like they would in + # normal production cases. + ALPHA = 2 + + # Beta is the point at which we are ready to open a release for any + # customer to use. There are no SLA or technical support obligations in a + # Beta release. Products will be complete from a feature perspective, but + # may have some open outstanding issues. Beta releases are suitable for + # limited production use cases. + BETA = 3 + + # GA features are open to all developers and are considered stable and + # fully qualified for production use. + GA = 4 + + # Deprecated features are scheduled to be shut down and removed. For more + # information, see the "Deprecation Policy" section of our [Terms of + # Service](https://cloud.google.com/terms/) + # and the [Google Cloud Platform Subject to the Deprecation + # Policy](https://cloud.google.com/terms/deprecation) documentation. + DEPRECATED = 5 + end + end +end diff --git a/owl-bot-staging/google-cloud-security_center-v1p1beta1/proto_docs/google/api/resource.rb b/owl-bot-staging/google-cloud-security_center-v1p1beta1/proto_docs/google/api/resource.rb new file mode 100644 index 000000000000..25dec4847ac1 --- /dev/null +++ b/owl-bot-staging/google-cloud-security_center-v1p1beta1/proto_docs/google/api/resource.rb @@ -0,0 +1,227 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + + +module Google + module Api + # A simple descriptor of a resource type. + # + # ResourceDescriptor annotates a resource message (either by means of a + # protobuf annotation or use in the service config), and associates the + # resource's schema, the resource type, and the pattern of the resource name. + # + # Example: + # + # message Topic { + # // Indicates this message defines a resource schema. + # // Declares the resource type in the format of {service}/{kind}. + # // For Kubernetes resources, the format is {api group}/{kind}. + # option (google.api.resource) = { + # type: "pubsub.googleapis.com/Topic" + # pattern: "projects/{project}/topics/{topic}" + # }; + # } + # + # The ResourceDescriptor Yaml config will look like: + # + # resources: + # - type: "pubsub.googleapis.com/Topic" + # pattern: "projects/{project}/topics/{topic}" + # + # Sometimes, resources have multiple patterns, typically because they can + # live under multiple parents. + # + # Example: + # + # message LogEntry { + # option (google.api.resource) = { + # type: "logging.googleapis.com/LogEntry" + # pattern: "projects/{project}/logs/{log}" + # pattern: "folders/{folder}/logs/{log}" + # pattern: "organizations/{organization}/logs/{log}" + # pattern: "billingAccounts/{billing_account}/logs/{log}" + # }; + # } + # + # The ResourceDescriptor Yaml config will look like: + # + # resources: + # - type: 'logging.googleapis.com/LogEntry' + # pattern: "projects/{project}/logs/{log}" + # pattern: "folders/{folder}/logs/{log}" + # pattern: "organizations/{organization}/logs/{log}" + # pattern: "billingAccounts/{billing_account}/logs/{log}" + # @!attribute [rw] type + # @return [::String] + # The resource type. It must be in the format of + # \\{service_name}/\\{resource_type_kind}. The `resource_type_kind` must be + # singular and must not include version numbers. + # + # Example: `storage.googleapis.com/Bucket` + # + # The value of the resource_type_kind must follow the regular expression + # /[A-Za-z][a-zA-Z0-9]+/. It should start with an upper case character and + # should use PascalCase (UpperCamelCase). The maximum number of + # characters allowed for the `resource_type_kind` is 100. + # @!attribute [rw] pattern + # @return [::Array<::String>] + # Optional. The relative resource name pattern associated with this resource + # type. The DNS prefix of the full resource name shouldn't be specified here. + # + # The path pattern must follow the syntax, which aligns with HTTP binding + # syntax: + # + # Template = Segment { "/" Segment } ; + # Segment = LITERAL | Variable ; + # Variable = "{" LITERAL "}" ; + # + # Examples: + # + # - "projects/\\{project}/topics/\\{topic}" + # - "projects/\\{project}/knowledgeBases/\\{knowledge_base}" + # + # The components in braces correspond to the IDs for each resource in the + # hierarchy. It is expected that, if multiple patterns are provided, + # the same component name (e.g. "project") refers to IDs of the same + # type of resource. + # @!attribute [rw] name_field + # @return [::String] + # Optional. The field on the resource that designates the resource name + # field. If omitted, this is assumed to be "name". + # @!attribute [rw] history + # @return [::Google::Api::ResourceDescriptor::History] + # Optional. The historical or future-looking state of the resource pattern. + # + # Example: + # + # // The InspectTemplate message originally only supported resource + # // names with organization, and project was added later. + # message InspectTemplate { + # option (google.api.resource) = { + # type: "dlp.googleapis.com/InspectTemplate" + # pattern: + # "organizations/{organization}/inspectTemplates/{inspect_template}" + # pattern: "projects/{project}/inspectTemplates/{inspect_template}" + # history: ORIGINALLY_SINGLE_PATTERN + # }; + # } + # @!attribute [rw] plural + # @return [::String] + # The plural name used in the resource name and permission names, such as + # 'projects' for the resource name of 'projects/\\{project}' and the permission + # name of 'cloudresourcemanager.googleapis.com/projects.get'. One exception + # to this is for Nested Collections that have stuttering names, as defined + # in [AIP-122](https://google.aip.dev/122#nested-collections), where the + # collection ID in the resource name pattern does not necessarily directly + # match the `plural` value. + # + # It is the same concept of the `plural` field in k8s CRD spec + # https://kubernetes.io/docs/tasks/access-kubernetes-api/custom-resources/custom-resource-definitions/ + # + # Note: The plural form is required even for singleton resources. See + # https://aip.dev/156 + # @!attribute [rw] singular + # @return [::String] + # The same concept of the `singular` field in k8s CRD spec + # https://kubernetes.io/docs/tasks/access-kubernetes-api/custom-resources/custom-resource-definitions/ + # Such as "project" for the `resourcemanager.googleapis.com/Project` type. + # @!attribute [rw] style + # @return [::Array<::Google::Api::ResourceDescriptor::Style>] + # Style flag(s) for this resource. + # These indicate that a resource is expected to conform to a given + # style. See the specific style flags for additional information. + class ResourceDescriptor + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # A description of the historical or future-looking state of the + # resource pattern. + module History + # The "unset" value. + HISTORY_UNSPECIFIED = 0 + + # The resource originally had one pattern and launched as such, and + # additional patterns were added later. + ORIGINALLY_SINGLE_PATTERN = 1 + + # The resource has one pattern, but the API owner expects to add more + # later. (This is the inverse of ORIGINALLY_SINGLE_PATTERN, and prevents + # that from being necessary once there are multiple patterns.) + FUTURE_MULTI_PATTERN = 2 + end + + # A flag representing a specific style that a resource claims to conform to. + module Style + # The unspecified value. Do not use. + STYLE_UNSPECIFIED = 0 + + # This resource is intended to be "declarative-friendly". + # + # Declarative-friendly resources must be more strictly consistent, and + # setting this to true communicates to tools that this resource should + # adhere to declarative-friendly expectations. + # + # Note: This is used by the API linter (linter.aip.dev) to enable + # additional checks. + DECLARATIVE_FRIENDLY = 1 + end + end + + # Defines a proto annotation that describes a string field that refers to + # an API resource. + # @!attribute [rw] type + # @return [::String] + # The resource type that the annotated field references. + # + # Example: + # + # message Subscription { + # string topic = 2 [(google.api.resource_reference) = { + # type: "pubsub.googleapis.com/Topic" + # }]; + # } + # + # Occasionally, a field may reference an arbitrary resource. In this case, + # APIs use the special value * in their resource reference. + # + # Example: + # + # message GetIamPolicyRequest { + # string resource = 2 [(google.api.resource_reference) = { + # type: "*" + # }]; + # } + # @!attribute [rw] child_type + # @return [::String] + # The resource type of a child collection that the annotated field + # references. This is useful for annotating the `parent` field that + # doesn't have a fixed resource type. + # + # Example: + # + # message ListLogEntriesRequest { + # string parent = 1 [(google.api.resource_reference) = { + # child_type: "logging.googleapis.com/LogEntry" + # }; + # } + class ResourceReference + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end +end diff --git a/owl-bot-staging/google-cloud-security_center-v1p1beta1/proto_docs/google/cloud/securitycenter/v1p1beta1/asset.rb b/owl-bot-staging/google-cloud-security_center-v1p1beta1/proto_docs/google/cloud/securitycenter/v1p1beta1/asset.rb new file mode 100644 index 000000000000..84c95aa10132 --- /dev/null +++ b/owl-bot-staging/google-cloud-security_center-v1p1beta1/proto_docs/google/cloud/securitycenter/v1p1beta1/asset.rb @@ -0,0 +1,141 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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 SecurityCenter + module V1p1beta1 + # Security Command Center representation of a Google Cloud + # resource. + # + # The Asset is a Security Command Center resource that captures information + # about a single Google Cloud resource. All modifications to an Asset are only + # within the context of Security Command Center and don't affect the referenced + # Google Cloud resource. + # @!attribute [rw] name + # @return [::String] + # The relative resource name of this asset. See: + # https://cloud.google.com/apis/design/resource_names#relative_resource_name + # Example: + # "organizations/\\{organization_id}/assets/\\{asset_id}". + # @!attribute [rw] security_center_properties + # @return [::Google::Cloud::SecurityCenter::V1p1beta1::Asset::SecurityCenterProperties] + # Security Command Center managed properties. These properties are managed by + # Security Command Center and cannot be modified by the user. + # @!attribute [rw] resource_properties + # @return [::Google::Protobuf::Map{::String => ::Google::Protobuf::Value}] + # Resource managed properties. These properties are managed and defined by + # the Google Cloud resource and cannot be modified by the user. + # @!attribute [rw] security_marks + # @return [::Google::Cloud::SecurityCenter::V1p1beta1::SecurityMarks] + # User specified security marks. These marks are entirely managed by the user + # and come from the SecurityMarks resource that belongs to the asset. + # @!attribute [rw] create_time + # @return [::Google::Protobuf::Timestamp] + # The time at which the asset was created in Security Command Center. + # @!attribute [rw] update_time + # @return [::Google::Protobuf::Timestamp] + # The time at which the asset was last updated or added in Cloud SCC. + # @!attribute [rw] iam_policy + # @return [::Google::Cloud::SecurityCenter::V1p1beta1::Asset::IamPolicy] + # Cloud IAM Policy information associated with the Google Cloud resource + # described by the Security Command Center asset. This information is managed + # and defined by the Google Cloud resource and cannot be modified by the + # user. + # @!attribute [rw] canonical_name + # @return [::String] + # The canonical name of the resource. It's either + # "organizations/\\{organization_id}/assets/\\{asset_id}", + # "folders/\\{folder_id}/assets/\\{asset_id}" or + # "projects/\\{project_number}/assets/\\{asset_id}", depending on the closest CRM + # ancestor of the resource. + class Asset + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # Security Command Center managed properties. These properties are managed by + # Security Command Center and cannot be modified by the user. + # @!attribute [rw] resource_name + # @return [::String] + # The full resource name of the Google Cloud resource this asset + # represents. This field is immutable after create time. See: + # https://cloud.google.com/apis/design/resource_names#full_resource_name + # @!attribute [rw] resource_type + # @return [::String] + # The type of the Google Cloud resource. Examples include: APPLICATION, + # PROJECT, and ORGANIZATION. This is a case insensitive field defined by + # Security Command Center and/or the producer of the resource and is + # immutable after create time. + # @!attribute [rw] resource_parent + # @return [::String] + # The full resource name of the immediate parent of the resource. See: + # https://cloud.google.com/apis/design/resource_names#full_resource_name + # @!attribute [rw] resource_project + # @return [::String] + # The full resource name of the project the resource belongs to. See: + # https://cloud.google.com/apis/design/resource_names#full_resource_name + # @!attribute [rw] resource_owners + # @return [::Array<::String>] + # Owners of the Google Cloud resource. + # @!attribute [rw] resource_display_name + # @return [::String] + # The user defined display name for this resource. + # @!attribute [rw] resource_parent_display_name + # @return [::String] + # The user defined display name for the parent of this resource. + # @!attribute [rw] resource_project_display_name + # @return [::String] + # The user defined display name for the project of this resource. + # @!attribute [rw] folders + # @return [::Array<::Google::Cloud::SecurityCenter::V1p1Beta1::Folder>] + # Contains a Folder message for each folder in the assets ancestry. + # The first folder is the deepest nested folder, and the last folder is the + # folder directly under the Organization. + class SecurityCenterProperties + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Cloud IAM Policy information associated with the Google Cloud resource + # described by the Security Command Center asset. This information is managed + # and defined by the Google Cloud resource and cannot be modified by the + # user. + # @!attribute [rw] policy_blob + # @return [::String] + # The JSON representation of the Policy associated with the asset. + # See https://cloud.google.com/iam/docs/reference/rest/v1/Policy for + # format details. + class IamPolicy + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # @!attribute [rw] key + # @return [::String] + # @!attribute [rw] value + # @return [::Google::Protobuf::Value] + class ResourcePropertiesEntry + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-security_center-v1p1beta1/proto_docs/google/cloud/securitycenter/v1p1beta1/finding.rb b/owl-bot-staging/google-cloud-security_center-v1p1beta1/proto_docs/google/cloud/securitycenter/v1p1beta1/finding.rb new file mode 100644 index 000000000000..9308757027de --- /dev/null +++ b/owl-bot-staging/google-cloud-security_center-v1p1beta1/proto_docs/google/cloud/securitycenter/v1p1beta1/finding.rb @@ -0,0 +1,146 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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 SecurityCenter + module V1p1beta1 + # Security Command Center finding. + # + # A finding is a record of assessment data (security, risk, health or privacy) + # ingested into Security Command Center for presentation, notification, + # analysis, policy testing, and enforcement. For example, an XSS vulnerability + # in an App Engine application is a finding. + # @!attribute [rw] name + # @return [::String] + # The relative resource name of this finding. See: + # https://cloud.google.com/apis/design/resource_names#relative_resource_name + # Example: + # "organizations/\\{organization_id}/sources/\\{source_id}/findings/\\{finding_id}" + # @!attribute [rw] parent + # @return [::String] + # The relative resource name of the source the finding belongs to. See: + # https://cloud.google.com/apis/design/resource_names#relative_resource_name + # This field is immutable after creation time. + # For example: + # "organizations/\\{organization_id}/sources/\\{source_id}" + # @!attribute [rw] resource_name + # @return [::String] + # For findings on Google Cloud resources, the full resource + # name of the Google Cloud resource this finding is for. See: + # https://cloud.google.com/apis/design/resource_names#full_resource_name + # When the finding is for a non-Google Cloud resource, the resourceName can + # be a customer or partner defined string. This field is immutable after + # creation time. + # @!attribute [rw] state + # @return [::Google::Cloud::SecurityCenter::V1p1beta1::Finding::State] + # The state of the finding. + # @!attribute [rw] category + # @return [::String] + # The additional taxonomy group within findings from a given source. + # This field is immutable after creation time. + # Example: "XSS_FLASH_INJECTION" + # @!attribute [rw] external_uri + # @return [::String] + # The URI that, if available, points to a web page outside of Security + # Command Center where additional information about the finding can be found. + # This field is guaranteed to be either empty or a well formed URL. + # @!attribute [rw] source_properties + # @return [::Google::Protobuf::Map{::String => ::Google::Protobuf::Value}] + # Source specific properties. These properties are managed by the source + # that writes the finding. The key names in the source_properties map must be + # between 1 and 255 characters, and must start with a letter and contain + # alphanumeric characters or underscores only. + # @!attribute [r] security_marks + # @return [::Google::Cloud::SecurityCenter::V1p1beta1::SecurityMarks] + # Output only. User specified security marks. These marks are entirely + # managed by the user and come from the SecurityMarks resource that belongs + # to the finding. + # @!attribute [rw] event_time + # @return [::Google::Protobuf::Timestamp] + # The time at which the event took place, or when an update to the finding + # occurred. For example, if the finding represents an open firewall it would + # capture the time the detector believes the firewall became open. The + # accuracy is determined by the detector. If the finding were to be resolved + # afterward, this time would reflect when the finding was resolved. Must not + # be set to a value greater than the current timestamp. + # @!attribute [rw] create_time + # @return [::Google::Protobuf::Timestamp] + # The time at which the finding was created in Security Command Center. + # @!attribute [rw] severity + # @return [::Google::Cloud::SecurityCenter::V1p1beta1::Finding::Severity] + # The severity of the finding. This field is managed by the source that + # writes the finding. + # @!attribute [rw] canonical_name + # @return [::String] + # The canonical name of the finding. It's either + # "organizations/\\{organization_id}/sources/\\{source_id}/findings/\\{finding_id}", + # "folders/\\{folder_id}/sources/\\{source_id}/findings/\\{finding_id}" or + # "projects/\\{project_number}/sources/\\{source_id}/findings/\\{finding_id}", + # depending on the closest CRM ancestor of the resource associated with the + # finding. + class Finding + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # @!attribute [rw] key + # @return [::String] + # @!attribute [rw] value + # @return [::Google::Protobuf::Value] + class SourcePropertiesEntry + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # The state of the finding. + module State + # Unspecified state. + STATE_UNSPECIFIED = 0 + + # The finding requires attention and has not been addressed yet. + ACTIVE = 1 + + # The finding has been fixed, triaged as a non-issue or otherwise addressed + # and is no longer active. + INACTIVE = 2 + end + + # The severity of the finding. This field is managed by the source that + # writes the finding. + module Severity + # No severity specified. The default value. + SEVERITY_UNSPECIFIED = 0 + + # Critical severity. + CRITICAL = 1 + + # High severity. + HIGH = 2 + + # Medium severity. + MEDIUM = 3 + + # Low severity. + LOW = 4 + end + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-security_center-v1p1beta1/proto_docs/google/cloud/securitycenter/v1p1beta1/folder.rb b/owl-bot-staging/google-cloud-security_center-v1p1beta1/proto_docs/google/cloud/securitycenter/v1p1beta1/folder.rb new file mode 100644 index 000000000000..f816affff89c --- /dev/null +++ b/owl-bot-staging/google-cloud-security_center-v1p1beta1/proto_docs/google/cloud/securitycenter/v1p1beta1/folder.rb @@ -0,0 +1,40 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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 SecurityCenter + module V1p1Beta1 + # Message that contains the resource name and display name of a folder + # resource. + # @!attribute [rw] resource_folder + # @return [::String] + # Full resource name of this folder. See: + # https://cloud.google.com/apis/design/resource_names#full_resource_name + # @!attribute [rw] resource_folder_display_name + # @return [::String] + # The user defined display name for this folder. + class Folder + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-security_center-v1p1beta1/proto_docs/google/cloud/securitycenter/v1p1beta1/notification_config.rb b/owl-bot-staging/google-cloud-security_center-v1p1beta1/proto_docs/google/cloud/securitycenter/v1p1beta1/notification_config.rb new file mode 100644 index 000000000000..5062c0b8e520 --- /dev/null +++ b/owl-bot-staging/google-cloud-security_center-v1p1beta1/proto_docs/google/cloud/securitycenter/v1p1beta1/notification_config.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 Cloud + module SecurityCenter + module V1p1beta1 + # Security Command Center notification configs. + # + # A notification config is a Security Command Center resource that contains the + # configuration to send notifications for create/update events of findings, + # assets and etc. + # @!attribute [rw] name + # @return [::String] + # The relative resource name of this notification config. See: + # https://cloud.google.com/apis/design/resource_names#relative_resource_name + # Example: + # "organizations/\\{organization_id}/notificationConfigs/notify_public_bucket". + # @!attribute [rw] description + # @return [::String] + # The description of the notification config (max of 1024 characters). + # @!attribute [rw] event_type + # @return [::Google::Cloud::SecurityCenter::V1p1beta1::NotificationConfig::EventType] + # The type of events the config is for, e.g. FINDING. + # @!attribute [rw] pubsub_topic + # @return [::String] + # The Pub/Sub topic to send notifications to. Its format is + # "projects/[project_id]/topics/[topic]". + # @!attribute [r] service_account + # @return [::String] + # Output only. The service account that needs "pubsub.topics.publish" + # permission to publish to the Pub/Sub topic. + # @!attribute [rw] streaming_config + # @return [::Google::Cloud::SecurityCenter::V1p1beta1::NotificationConfig::StreamingConfig] + # The config for triggering streaming-based notifications. + class NotificationConfig + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # The config for streaming-based notifications, which send each event as soon + # as it is detected. + # @!attribute [rw] filter + # @return [::String] + # Expression that defines the filter to apply across create/update events + # of assets or findings as specified by the event type. The expression is a + # list of zero or more restrictions combined via logical operators `AND` + # and `OR`. Parentheses are supported, and `OR` has higher precedence than + # `AND`. + # + # Restrictions have the form ` ` and may have a + # `-` character in front of them to indicate negation. The fields map to + # those defined in the corresponding resource. + # + # The supported operators are: + # + # * `=` for all value types. + # * `>`, `<`, `>=`, `<=` for integer values. + # * `:`, meaning substring matching, for strings. + # + # The supported value types are: + # + # * string literals in quotes. + # * integer literals without quotes. + # * boolean literals `true` and `false` without quotes. + class StreamingConfig + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # The type of events. + module EventType + # Unspecified event type. + EVENT_TYPE_UNSPECIFIED = 0 + + # Events for findings. + FINDING = 1 + end + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-security_center-v1p1beta1/proto_docs/google/cloud/securitycenter/v1p1beta1/notification_message.rb b/owl-bot-staging/google-cloud-security_center-v1p1beta1/proto_docs/google/cloud/securitycenter/v1p1beta1/notification_message.rb new file mode 100644 index 000000000000..6948b659b221 --- /dev/null +++ b/owl-bot-staging/google-cloud-security_center-v1p1beta1/proto_docs/google/cloud/securitycenter/v1p1beta1/notification_message.rb @@ -0,0 +1,42 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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 SecurityCenter + module V1p1beta1 + # Security Command Center's Notification + # @!attribute [rw] notification_config_name + # @return [::String] + # Name of the notification config that generated current notification. + # @!attribute [rw] finding + # @return [::Google::Cloud::SecurityCenter::V1p1beta1::Finding] + # If it's a Finding based notification config, this field will be + # populated. + # @!attribute [rw] resource + # @return [::Google::Cloud::SecurityCenter::V1p1beta1::Resource] + # The Cloud resource tied to the notification. + class NotificationMessage + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-security_center-v1p1beta1/proto_docs/google/cloud/securitycenter/v1p1beta1/organization_settings.rb b/owl-bot-staging/google-cloud-security_center-v1p1beta1/proto_docs/google/cloud/securitycenter/v1p1beta1/organization_settings.rb new file mode 100644 index 000000000000..c69cb73d05e1 --- /dev/null +++ b/owl-bot-staging/google-cloud-security_center-v1p1beta1/proto_docs/google/cloud/securitycenter/v1p1beta1/organization_settings.rb @@ -0,0 +1,86 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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 SecurityCenter + module V1p1beta1 + # User specified settings that are attached to the Security Command + # Center organization. + # @!attribute [rw] name + # @return [::String] + # The relative resource name of the settings. See: + # https://cloud.google.com/apis/design/resource_names#relative_resource_name + # Example: + # "organizations/\\{organization_id}/organizationSettings". + # @!attribute [rw] enable_asset_discovery + # @return [::Boolean] + # A flag that indicates if Asset Discovery should be enabled. If the flag is + # set to `true`, then discovery of assets will occur. If it is set to `false, + # all historical assets will remain, but discovery of future assets will not + # occur. + # @!attribute [rw] asset_discovery_config + # @return [::Google::Cloud::SecurityCenter::V1p1beta1::OrganizationSettings::AssetDiscoveryConfig] + # The configuration used for Asset Discovery runs. + class OrganizationSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # The configuration used for Asset Discovery runs. + # @!attribute [rw] project_ids + # @return [::Array<::String>] + # The project ids to use for filtering asset discovery. + # @!attribute [rw] inclusion_mode + # @return [::Google::Cloud::SecurityCenter::V1p1beta1::OrganizationSettings::AssetDiscoveryConfig::InclusionMode] + # The mode to use for filtering asset discovery. + # @!attribute [rw] folder_ids + # @return [::Array<::String>] + # The folder ids to use for filtering asset discovery. + # It consists of only digits, e.g., 756619654966. + class AssetDiscoveryConfig + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # The mode of inclusion when running Asset Discovery. + # Asset discovery can be limited by explicitly identifying projects to be + # included or excluded. If INCLUDE_ONLY is set, then only those projects + # within the organization and their children are discovered during asset + # discovery. If EXCLUDE is set, then projects that don't match those + # projects are discovered during asset discovery. If neither are set, then + # all projects within the organization are discovered during asset + # discovery. + module InclusionMode + # Unspecified. Setting the mode with this value will disable + # inclusion/exclusion filtering for Asset Discovery. + INCLUSION_MODE_UNSPECIFIED = 0 + + # Asset Discovery will capture only the resources within the projects + # specified. All other resources will be ignored. + INCLUDE_ONLY = 1 + + # Asset Discovery will ignore all resources under the projects specified. + # All other resources will be retrieved. + EXCLUDE = 2 + end + end + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-security_center-v1p1beta1/proto_docs/google/cloud/securitycenter/v1p1beta1/resource.rb b/owl-bot-staging/google-cloud-security_center-v1p1beta1/proto_docs/google/cloud/securitycenter/v1p1beta1/resource.rb new file mode 100644 index 000000000000..0fe81011a51b --- /dev/null +++ b/owl-bot-staging/google-cloud-security_center-v1p1beta1/proto_docs/google/cloud/securitycenter/v1p1beta1/resource.rb @@ -0,0 +1,53 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + + +module Google + module Cloud + module SecurityCenter + module V1p1beta1 + # Information related to the Google Cloud resource. + # @!attribute [rw] name + # @return [::String] + # The full resource name of the resource. See: + # https://cloud.google.com/apis/design/resource_names#full_resource_name + # @!attribute [rw] project + # @return [::String] + # The full resource name of project that the resource belongs to. + # @!attribute [rw] project_display_name + # @return [::String] + # The human readable name of project that the resource belongs to. + # @!attribute [rw] parent + # @return [::String] + # The full resource name of resource's parent. + # @!attribute [rw] parent_display_name + # @return [::String] + # The human readable name of resource's parent. + # @!attribute [r] folders + # @return [::Array<::Google::Cloud::SecurityCenter::V1p1Beta1::Folder>] + # Output only. Contains a Folder message for each folder in the assets ancestry. + # The first folder is the deepest nested folder, and the last folder is the + # folder directly under the Organization. + class Resource + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-security_center-v1p1beta1/proto_docs/google/cloud/securitycenter/v1p1beta1/run_asset_discovery_response.rb b/owl-bot-staging/google-cloud-security_center-v1p1beta1/proto_docs/google/cloud/securitycenter/v1p1beta1/run_asset_discovery_response.rb new file mode 100644 index 000000000000..ed38b84c1d65 --- /dev/null +++ b/owl-bot-staging/google-cloud-security_center-v1p1beta1/proto_docs/google/cloud/securitycenter/v1p1beta1/run_asset_discovery_response.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! + + +module Google + module Cloud + module SecurityCenter + module V1p1beta1 + # Response of asset discovery run + # @!attribute [rw] state + # @return [::Google::Cloud::SecurityCenter::V1p1beta1::RunAssetDiscoveryResponse::State] + # The state of an asset discovery run. + # @!attribute [rw] duration + # @return [::Google::Protobuf::Duration] + # The duration between asset discovery run start and end + class RunAssetDiscoveryResponse + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # The state of an asset discovery run. + module State + # Asset discovery run state was unspecified. + STATE_UNSPECIFIED = 0 + + # Asset discovery run completed successfully. + COMPLETED = 1 + + # Asset discovery run was cancelled with tasks still pending, as another + # run for the same organization was started with a higher priority. + SUPERSEDED = 2 + + # Asset discovery run was killed and terminated. + TERMINATED = 3 + end + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-security_center-v1p1beta1/proto_docs/google/cloud/securitycenter/v1p1beta1/security_marks.rb b/owl-bot-staging/google-cloud-security_center-v1p1beta1/proto_docs/google/cloud/securitycenter/v1p1beta1/security_marks.rb new file mode 100644 index 000000000000..db78ba561912 --- /dev/null +++ b/owl-bot-staging/google-cloud-security_center-v1p1beta1/proto_docs/google/cloud/securitycenter/v1p1beta1/security_marks.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 Cloud + module SecurityCenter + module V1p1beta1 + # User specified security marks that are attached to the parent Security + # Command Center resource. Security marks are scoped within a Security Command + # Center organization -- they can be modified and viewed by all users who have + # proper permissions on the organization. + # @!attribute [rw] name + # @return [::String] + # The relative resource name of the SecurityMarks. See: + # https://cloud.google.com/apis/design/resource_names#relative_resource_name + # Examples: + # "organizations/\\{organization_id}/assets/\\{asset_id}/securityMarks" + # "organizations/\\{organization_id}/sources/\\{source_id}/findings/\\{finding_id}/securityMarks". + # @!attribute [rw] marks + # @return [::Google::Protobuf::Map{::String => ::String}] + # Mutable user specified security marks belonging to the parent resource. + # Constraints are as follows: + # + # * Keys and values are treated as case insensitive + # * Keys must be between 1 - 256 characters (inclusive) + # * Keys must be letters, numbers, underscores, or dashes + # * Values have leading and trailing whitespace trimmed, remaining + # characters must be between 1 - 4096 characters (inclusive) + # @!attribute [rw] canonical_name + # @return [::String] + # The canonical name of the marks. + # Examples: + # "organizations/\\{organization_id}/assets/\\{asset_id}/securityMarks" + # "folders/\\{folder_id}/assets/\\{asset_id}/securityMarks" + # "projects/\\{project_number}/assets/\\{asset_id}/securityMarks" + # "organizations/\\{organization_id}/sources/\\{source_id}/findings/\\{finding_id}/securityMarks" + # "folders/\\{folder_id}/sources/\\{source_id}/findings/\\{finding_id}/securityMarks" + # "projects/\\{project_number}/sources/\\{source_id}/findings/\\{finding_id}/securityMarks" + class SecurityMarks + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # @!attribute [rw] key + # @return [::String] + # @!attribute [rw] value + # @return [::String] + class MarksEntry + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-security_center-v1p1beta1/proto_docs/google/cloud/securitycenter/v1p1beta1/securitycenter_service.rb b/owl-bot-staging/google-cloud-security_center-v1p1beta1/proto_docs/google/cloud/securitycenter/v1p1beta1/securitycenter_service.rb new file mode 100644 index 000000000000..a2252480add8 --- /dev/null +++ b/owl-bot-staging/google-cloud-security_center-v1p1beta1/proto_docs/google/cloud/securitycenter/v1p1beta1/securitycenter_service.rb @@ -0,0 +1,1053 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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 SecurityCenter + module V1p1beta1 + # Request message for creating a finding. + # @!attribute [rw] parent + # @return [::String] + # Required. Resource name of the new finding's parent. Its format should be + # "organizations/[organization_id]/sources/[source_id]". + # @!attribute [rw] finding_id + # @return [::String] + # Required. Unique identifier provided by the client within the parent scope. + # @!attribute [rw] finding + # @return [::Google::Cloud::SecurityCenter::V1p1beta1::Finding] + # Required. The Finding being created. The name and security_marks will be ignored as + # they are both output only fields on this resource. + class CreateFindingRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Request message for creating a notification config. + # @!attribute [rw] parent + # @return [::String] + # Required. Resource name of the new notification config's parent. Its format is + # "organizations/[organization_id]". + # @!attribute [rw] config_id + # @return [::String] + # Required. Unique identifier provided by the client within the parent scope. + # It must be between 1 and 128 characters, and contains alphanumeric + # characters, underscores or hyphens only. + # @!attribute [rw] notification_config + # @return [::Google::Cloud::SecurityCenter::V1p1beta1::NotificationConfig] + # Required. The notification config being created. The name and the service account + # will be ignored as they are both output only fields on this resource. + class CreateNotificationConfigRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Request message for creating a source. + # @!attribute [rw] parent + # @return [::String] + # Required. Resource name of the new source's parent. Its format should be + # "organizations/[organization_id]". + # @!attribute [rw] source + # @return [::Google::Cloud::SecurityCenter::V1p1beta1::Source] + # Required. The Source being created, only the display_name and description will be + # used. All other fields will be ignored. + class CreateSourceRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Request message for deleting a notification config. + # @!attribute [rw] name + # @return [::String] + # Required. Name of the notification config to delete. Its format is + # "organizations/[organization_id]/notificationConfigs/[config_id]". + class DeleteNotificationConfigRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Request message for getting a notification config. + # @!attribute [rw] name + # @return [::String] + # Required. Name of the notification config to get. Its format is + # "organizations/[organization_id]/notificationConfigs/[config_id]". + class GetNotificationConfigRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Request message for getting organization settings. + # @!attribute [rw] name + # @return [::String] + # Required. Name of the organization to get organization settings for. Its format is + # "organizations/[organization_id]/organizationSettings". + class GetOrganizationSettingsRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Request message for getting a source. + # @!attribute [rw] name + # @return [::String] + # Required. Relative resource name of the source. Its format is + # "organizations/[organization_id]/source/[source_id]". + class GetSourceRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Request message for grouping by assets. + # @!attribute [rw] parent + # @return [::String] + # Required. Name of the organization to groupBy. Its format is + # "organizations/[organization_id], folders/[folder_id], or + # projects/[project_id]". + # @!attribute [rw] filter + # @return [::String] + # Expression that defines the filter to apply across assets. + # The expression is a list of zero or more restrictions combined via logical + # operators `AND` and `OR`. + # Parentheses are supported, and `OR` has higher precedence than `AND`. + # + # Restrictions have the form ` ` and may have a `-` + # character in front of them to indicate negation. The fields map to those + # defined in the Asset resource. Examples include: + # + # * name + # * security_center_properties.resource_name + # * resource_properties.a_property + # * security_marks.marks.marka + # + # The supported operators are: + # + # * `=` for all value types. + # * `>`, `<`, `>=`, `<=` for integer values. + # * `:`, meaning substring matching, for strings. + # + # The supported value types are: + # + # * string literals in quotes. + # * integer literals without quotes. + # * boolean literals `true` and `false` without quotes. + # + # The following field and operator combinations are supported: + # + # * name: `=` + # * update_time: `=`, `>`, `<`, `>=`, `<=` + # + # Usage: This should be milliseconds since epoch or an RFC3339 string. + # Examples: + # `update_time = "2019-06-10T16:07:18-07:00"` + # `update_time = 1560208038000` + # + # * create_time: `=`, `>`, `<`, `>=`, `<=` + # + # Usage: This should be milliseconds since epoch or an RFC3339 string. + # Examples: + # `create_time = "2019-06-10T16:07:18-07:00"` + # `create_time = 1560208038000` + # + # * iam_policy.policy_blob: `=`, `:` + # * resource_properties: `=`, `:`, `>`, `<`, `>=`, `<=` + # * security_marks.marks: `=`, `:` + # * security_center_properties.resource_name: `=`, `:` + # * security_center_properties.resource_name_display_name: `=`, `:` + # * security_center_properties.resource_type: `=`, `:` + # * security_center_properties.resource_parent: `=`, `:` + # * security_center_properties.resource_parent_display_name: `=`, `:` + # * security_center_properties.resource_project: `=`, `:` + # * security_center_properties.resource_project_display_name: `=`, `:` + # * security_center_properties.resource_owners: `=`, `:` + # + # For example, `resource_properties.size = 100` is a valid filter string. + # + # Use a partial match on the empty string to filter based on a property + # existing: `resource_properties.my_property : ""` + # + # Use a negated partial match on the empty string to filter based on a + # property not existing: `-resource_properties.my_property : ""` + # @!attribute [rw] group_by + # @return [::String] + # Required. Expression that defines what assets fields to use for grouping. The string + # value should follow SQL syntax: comma separated list of fields. For + # example: + # "security_center_properties.resource_project,security_center_properties.project". + # + # The following fields are supported when compare_duration is not set: + # + # * security_center_properties.resource_project + # * security_center_properties.resource_project_display_name + # * security_center_properties.resource_type + # * security_center_properties.resource_parent + # * security_center_properties.resource_parent_display_name + # + # The following fields are supported when compare_duration is set: + # + # * security_center_properties.resource_type + # * security_center_properties.resource_project_display_name + # * security_center_properties.resource_parent_display_name + # @!attribute [rw] compare_duration + # @return [::Google::Protobuf::Duration] + # When compare_duration is set, the GroupResult's "state_change" property is + # updated to indicate whether the asset was added, removed, or remained + # present during the compare_duration period of time that precedes the + # read_time. This is the time between (read_time - compare_duration) and + # read_time. + # + # The state change value is derived based on the presence of the asset at the + # two points in time. Intermediate state changes between the two times don't + # affect the result. For example, the results aren't affected if the asset is + # removed and re-created again. + # + # Possible "state_change" values when compare_duration is specified: + # + # * "ADDED": indicates that the asset was not present at the start of + # compare_duration, but present at reference_time. + # * "REMOVED": indicates that the asset was present at the start of + # compare_duration, but not present at reference_time. + # * "ACTIVE": indicates that the asset was present at both the + # start and the end of the time period defined by + # compare_duration and reference_time. + # + # If compare_duration is not specified, then the only possible state_change + # is "UNUSED", which will be the state_change set for all assets present at + # read_time. + # + # If this field is set then `state_change` must be a specified field in + # `group_by`. + # @!attribute [rw] read_time + # @return [::Google::Protobuf::Timestamp] + # Time used as a reference point when filtering assets. The filter is limited + # to assets existing at the supplied time and their values are those at that + # specific time. Absence of this field will default to the API's version of + # NOW. + # @!attribute [rw] page_token + # @return [::String] + # The value returned by the last `GroupAssetsResponse`; indicates + # that this is a continuation of a prior `GroupAssets` call, and that the + # system should return the next page of data. + # @!attribute [rw] page_size + # @return [::Integer] + # The maximum number of results to return in a single response. Default is + # 10, minimum is 1, maximum is 1000. + class GroupAssetsRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Response message for grouping by assets. + # @!attribute [rw] group_by_results + # @return [::Array<::Google::Cloud::SecurityCenter::V1p1beta1::GroupResult>] + # Group results. There exists an element for each existing unique + # combination of property/values. The element contains a count for the number + # of times those specific property/values appear. + # @!attribute [rw] read_time + # @return [::Google::Protobuf::Timestamp] + # Time used for executing the groupBy request. + # @!attribute [rw] next_page_token + # @return [::String] + # Token to retrieve the next page of results, or empty if there are no more + # results. + # @!attribute [rw] total_size + # @return [::Integer] + # The total number of results matching the query. + class GroupAssetsResponse + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Request message for grouping by findings. + # @!attribute [rw] parent + # @return [::String] + # Required. Name of the source to groupBy. Its format is + # "organizations/[organization_id]/sources/[source_id]", + # folders/[folder_id]/sources/[source_id], or + # projects/[project_id]/sources/[source_id]. To groupBy across all sources + # provide a source_id of `-`. For example: + # organizations/\\{organization_id}/sources/-, folders/\\{folder_id}/sources/-, + # or projects/\\{project_id}/sources/- + # @!attribute [rw] filter + # @return [::String] + # Expression that defines the filter to apply across findings. + # The expression is a list of one or more restrictions combined via logical + # operators `AND` and `OR`. + # Parentheses are supported, and `OR` has higher precedence than `AND`. + # + # Restrictions have the form ` ` and may have a `-` + # character in front of them to indicate negation. Examples include: + # + # * name + # * source_properties.a_property + # * security_marks.marks.marka + # + # The supported operators are: + # + # * `=` for all value types. + # * `>`, `<`, `>=`, `<=` for integer values. + # * `:`, meaning substring matching, for strings. + # + # The supported value types are: + # + # * string literals in quotes. + # * integer literals without quotes. + # * boolean literals `true` and `false` without quotes. + # + # The following field and operator combinations are supported: + # + # * name: `=` + # * parent: `=`, `:` + # * resource_name: `=`, `:` + # * state: `=`, `:` + # * category: `=`, `:` + # * external_uri: `=`, `:` + # * event_time: `=`, `>`, `<`, `>=`, `<=` + # * severity: `=`, `:` + # + # Usage: This should be milliseconds since epoch or an RFC3339 string. + # Examples: + # `event_time = "2019-06-10T16:07:18-07:00"` + # `event_time = 1560208038000` + # + # * security_marks.marks: `=`, `:` + # * source_properties: `=`, `:`, `>`, `<`, `>=`, `<=` + # + # For example, `source_properties.size = 100` is a valid filter string. + # + # Use a partial match on the empty string to filter based on a property + # existing: `source_properties.my_property : ""` + # + # Use a negated partial match on the empty string to filter based on a + # property not existing: `-source_properties.my_property : ""` + # @!attribute [rw] group_by + # @return [::String] + # Required. Expression that defines what assets fields to use for grouping (including + # `state_change`). The string value should follow SQL syntax: comma separated + # list of fields. For example: "parent,resource_name". + # + # The following fields are supported: + # + # * resource_name + # * category + # * state + # * parent + # * severity + # + # The following fields are supported when compare_duration is set: + # + # * state_change + # @!attribute [rw] read_time + # @return [::Google::Protobuf::Timestamp] + # Time used as a reference point when filtering findings. The filter is + # limited to findings existing at the supplied time and their values are + # those at that specific time. Absence of this field will default to the + # API's version of NOW. + # @!attribute [rw] compare_duration + # @return [::Google::Protobuf::Duration] + # When compare_duration is set, the GroupResult's "state_change" attribute is + # updated to indicate whether the finding had its state changed, the + # finding's state remained unchanged, or if the finding was added during the + # compare_duration period of time that precedes the read_time. This is the + # time between (read_time - compare_duration) and read_time. + # + # The state_change value is derived based on the presence and state of the + # finding at the two points in time. Intermediate state changes between the + # two times don't affect the result. For example, the results aren't affected + # if the finding is made inactive and then active again. + # + # Possible "state_change" values when compare_duration is specified: + # + # * "CHANGED": indicates that the finding was present and matched the given + # filter at the start of compare_duration, but changed its + # state at read_time. + # * "UNCHANGED": indicates that the finding was present and matched the given + # filter at the start of compare_duration and did not change + # state at read_time. + # * "ADDED": indicates that the finding did not match the given filter or + # was not present at the start of compare_duration, but was + # present at read_time. + # * "REMOVED": indicates that the finding was present and matched the + # filter at the start of compare_duration, but did not match + # the filter at read_time. + # + # If compare_duration is not specified, then the only possible state_change + # is "UNUSED", which will be the state_change set for all findings present + # at read_time. + # + # If this field is set then `state_change` must be a specified field in + # `group_by`. + # @!attribute [rw] page_token + # @return [::String] + # The value returned by the last `GroupFindingsResponse`; indicates + # that this is a continuation of a prior `GroupFindings` call, and + # that the system should return the next page of data. + # @!attribute [rw] page_size + # @return [::Integer] + # The maximum number of results to return in a single response. Default is + # 10, minimum is 1, maximum is 1000. + class GroupFindingsRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Response message for group by findings. + # @!attribute [rw] group_by_results + # @return [::Array<::Google::Cloud::SecurityCenter::V1p1beta1::GroupResult>] + # Group results. There exists an element for each existing unique + # combination of property/values. The element contains a count for the number + # of times those specific property/values appear. + # @!attribute [rw] read_time + # @return [::Google::Protobuf::Timestamp] + # Time used for executing the groupBy request. + # @!attribute [rw] next_page_token + # @return [::String] + # Token to retrieve the next page of results, or empty if there are no more + # results. + # @!attribute [rw] total_size + # @return [::Integer] + # The total number of results matching the query. + class GroupFindingsResponse + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Result containing the properties and count of a groupBy request. + # @!attribute [rw] properties + # @return [::Google::Protobuf::Map{::String => ::Google::Protobuf::Value}] + # Properties matching the groupBy fields in the request. + # @!attribute [rw] count + # @return [::Integer] + # Total count of resources for the given properties. + class GroupResult + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # @!attribute [rw] key + # @return [::String] + # @!attribute [rw] value + # @return [::Google::Protobuf::Value] + class PropertiesEntry + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end + + # Request message for listing notification configs. + # @!attribute [rw] parent + # @return [::String] + # Required. Name of the organization to list notification configs. + # Its format is "organizations/[organization_id]". + # @!attribute [rw] page_token + # @return [::String] + # The value returned by the last `ListNotificationConfigsResponse`; indicates + # that this is a continuation of a prior `ListNotificationConfigs` call, and + # that the system should return the next page of data. + # @!attribute [rw] page_size + # @return [::Integer] + # The maximum number of results to return in a single response. Default is + # 10, minimum is 1, maximum is 1000. + class ListNotificationConfigsRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Response message for listing notification configs. + # @!attribute [rw] notification_configs + # @return [::Array<::Google::Cloud::SecurityCenter::V1p1beta1::NotificationConfig>] + # Notification configs belonging to the requested parent. + # @!attribute [rw] next_page_token + # @return [::String] + # Token to retrieve the next page of results, or empty if there are no more + # results. + class ListNotificationConfigsResponse + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Request message for listing sources. + # @!attribute [rw] parent + # @return [::String] + # Required. Resource name of the parent of sources to list. Its format should be + # "organizations/[organization_id], folders/[folder_id], or + # projects/[project_id]". + # @!attribute [rw] page_token + # @return [::String] + # The value returned by the last `ListSourcesResponse`; indicates + # that this is a continuation of a prior `ListSources` call, and + # that the system should return the next page of data. + # @!attribute [rw] page_size + # @return [::Integer] + # The maximum number of results to return in a single response. Default is + # 10, minimum is 1, maximum is 1000. + class ListSourcesRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Response message for listing sources. + # @!attribute [rw] sources + # @return [::Array<::Google::Cloud::SecurityCenter::V1p1beta1::Source>] + # Sources belonging to the requested parent. + # @!attribute [rw] next_page_token + # @return [::String] + # Token to retrieve the next page of results, or empty if there are no more + # results. + class ListSourcesResponse + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Request message for listing assets. + # @!attribute [rw] parent + # @return [::String] + # Required. Name of the organization assets should belong to. Its format is + # "organizations/[organization_id], folders/[folder_id], or + # projects/[project_id]". + # @!attribute [rw] filter + # @return [::String] + # Expression that defines the filter to apply across assets. + # The expression is a list of zero or more restrictions combined via logical + # operators `AND` and `OR`. + # Parentheses are supported, and `OR` has higher precedence than `AND`. + # + # Restrictions have the form ` ` and may have a `-` + # character in front of them to indicate negation. The fields map to those + # defined in the Asset resource. Examples include: + # + # * name + # * security_center_properties.resource_name + # * resource_properties.a_property + # * security_marks.marks.marka + # + # The supported operators are: + # + # * `=` for all value types. + # * `>`, `<`, `>=`, `<=` for integer values. + # * `:`, meaning substring matching, for strings. + # + # The supported value types are: + # + # * string literals in quotes. + # * integer literals without quotes. + # * boolean literals `true` and `false` without quotes. + # + # The following are the allowed field and operator combinations: + # + # * name: `=` + # * update_time: `=`, `>`, `<`, `>=`, `<=` + # + # Usage: This should be milliseconds since epoch or an RFC3339 string. + # Examples: + # `update_time = "2019-06-10T16:07:18-07:00"` + # `update_time = 1560208038000` + # + # * create_time: `=`, `>`, `<`, `>=`, `<=` + # + # Usage: This should be milliseconds since epoch or an RFC3339 string. + # Examples: + # `create_time = "2019-06-10T16:07:18-07:00"` + # `create_time = 1560208038000` + # + # * iam_policy.policy_blob: `=`, `:` + # * resource_properties: `=`, `:`, `>`, `<`, `>=`, `<=` + # * security_marks.marks: `=`, `:` + # * security_center_properties.resource_name: `=`, `:` + # * security_center_properties.resource_display_name: `=`, `:` + # * security_center_properties.resource_type: `=`, `:` + # * security_center_properties.resource_parent: `=`, `:` + # * security_center_properties.resource_parent_display_name: `=`, `:` + # * security_center_properties.resource_project: `=`, `:` + # * security_center_properties.resource_project_display_name: `=`, `:` + # * security_center_properties.resource_owners: `=`, `:` + # + # For example, `resource_properties.size = 100` is a valid filter string. + # + # Use a partial match on the empty string to filter based on a property + # existing: `resource_properties.my_property : ""` + # + # Use a negated partial match on the empty string to filter based on a + # property not existing: `-resource_properties.my_property : ""` + # @!attribute [rw] order_by + # @return [::String] + # Expression that defines what fields and order to use for sorting. The + # string value should follow SQL syntax: comma separated list of fields. For + # example: "name,resource_properties.a_property". The default sorting order + # is ascending. To specify descending order for a field, a suffix " desc" + # should be appended to the field name. For example: "name + # desc,resource_properties.a_property". Redundant space characters in the + # syntax are insignificant. "name desc,resource_properties.a_property" and " + # name desc , resource_properties.a_property " are equivalent. + # + # The following fields are supported: + # name + # update_time + # resource_properties + # security_marks.marks + # security_center_properties.resource_name + # security_center_properties.resource_display_name + # security_center_properties.resource_parent + # security_center_properties.resource_parent_display_name + # security_center_properties.resource_project + # security_center_properties.resource_project_display_name + # security_center_properties.resource_type + # @!attribute [rw] read_time + # @return [::Google::Protobuf::Timestamp] + # Time used as a reference point when filtering assets. The filter is limited + # to assets existing at the supplied time and their values are those at that + # specific time. Absence of this field will default to the API's version of + # NOW. + # @!attribute [rw] compare_duration + # @return [::Google::Protobuf::Duration] + # When compare_duration is set, the ListAssetsResult's "state_change" + # attribute is updated to indicate whether the asset was added, removed, or + # remained present during the compare_duration period of time that precedes + # the read_time. This is the time between (read_time - compare_duration) and + # read_time. + # + # The state_change value is derived based on the presence of the asset at the + # two points in time. Intermediate state changes between the two times don't + # affect the result. For example, the results aren't affected if the asset is + # removed and re-created again. + # + # Possible "state_change" values when compare_duration is specified: + # + # * "ADDED": indicates that the asset was not present at the start of + # compare_duration, but present at read_time. + # * "REMOVED": indicates that the asset was present at the start of + # compare_duration, but not present at read_time. + # * "ACTIVE": indicates that the asset was present at both the + # start and the end of the time period defined by + # compare_duration and read_time. + # + # If compare_duration is not specified, then the only possible state_change + # is "UNUSED", which will be the state_change set for all assets present at + # read_time. + # @!attribute [rw] field_mask + # @return [::Google::Protobuf::FieldMask] + # A field mask to specify the ListAssetsResult fields to be listed in the + # response. + # An empty field mask will list all fields. + # @!attribute [rw] page_token + # @return [::String] + # The value returned by the last `ListAssetsResponse`; indicates + # that this is a continuation of a prior `ListAssets` call, and + # that the system should return the next page of data. + # @!attribute [rw] page_size + # @return [::Integer] + # The maximum number of results to return in a single response. Default is + # 10, minimum is 1, maximum is 1000. + class ListAssetsRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Response message for listing assets. + # @!attribute [rw] list_assets_results + # @return [::Array<::Google::Cloud::SecurityCenter::V1p1beta1::ListAssetsResponse::ListAssetsResult>] + # Assets matching the list request. + # @!attribute [rw] read_time + # @return [::Google::Protobuf::Timestamp] + # Time used for executing the list request. + # @!attribute [rw] next_page_token + # @return [::String] + # Token to retrieve the next page of results, or empty if there are no more + # results. + # @!attribute [rw] total_size + # @return [::Integer] + # The total number of assets matching the query. + class ListAssetsResponse + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # Result containing the Asset and its State. + # @!attribute [rw] asset + # @return [::Google::Cloud::SecurityCenter::V1p1beta1::Asset] + # Asset matching the search request. + # @!attribute [rw] state_change + # @return [::Google::Cloud::SecurityCenter::V1p1beta1::ListAssetsResponse::ListAssetsResult::StateChange] + # State change of the asset between the points in time. + class ListAssetsResult + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # The change in state of the asset. + # + # When querying across two points in time this describes + # the change between the two points: ADDED, REMOVED, or ACTIVE. + # If there was no compare_duration supplied in the request the state change + # will be: UNUSED + module StateChange + # State change is unused, this is the canonical default for this enum. + UNUSED = 0 + + # Asset was added between the points in time. + ADDED = 1 + + # Asset was removed between the points in time. + REMOVED = 2 + + # Asset was present at both point(s) in time. + ACTIVE = 3 + end + end + end + + # Request message for listing findings. + # @!attribute [rw] parent + # @return [::String] + # Required. Name of the source the findings belong to. Its format is + # "organizations/[organization_id]/sources/[source_id], + # folders/[folder_id]/sources/[source_id], or + # projects/[project_id]/sources/[source_id]". To list across all sources + # provide a source_id of `-`. For example: + # organizations/\\{organization_id}/sources/-, folders/\\{folder_id}/sources/- or + # projects/\\{projects_id}/sources/- + # @!attribute [rw] filter + # @return [::String] + # Expression that defines the filter to apply across findings. + # The expression is a list of one or more restrictions combined via logical + # operators `AND` and `OR`. + # Parentheses are supported, and `OR` has higher precedence than `AND`. + # + # Restrictions have the form ` ` and may have a `-` + # character in front of them to indicate negation. Examples include: + # + # * name + # * source_properties.a_property + # * security_marks.marks.marka + # + # The supported operators are: + # + # * `=` for all value types. + # * `>`, `<`, `>=`, `<=` for integer values. + # * `:`, meaning substring matching, for strings. + # + # The supported value types are: + # + # * string literals in quotes. + # * integer literals without quotes. + # * boolean literals `true` and `false` without quotes. + # + # The following field and operator combinations are supported: + # + # * name: `=` + # * parent: `=`, `:` + # * resource_name: `=`, `:` + # * state: `=`, `:` + # * category: `=`, `:` + # * external_uri: `=`, `:` + # * event_time: `=`, `>`, `<`, `>=`, `<=` + # * severity: `=`, `:` + # + # Usage: This should be milliseconds since epoch or an RFC3339 string. + # Examples: + # `event_time = "2019-06-10T16:07:18-07:00"` + # `event_time = 1560208038000` + # + # security_marks.marks: `=`, `:` + # source_properties: `=`, `:`, `>`, `<`, `>=`, `<=` + # + # For example, `source_properties.size = 100` is a valid filter string. + # + # Use a partial match on the empty string to filter based on a property + # existing: `source_properties.my_property : ""` + # + # Use a negated partial match on the empty string to filter based on a + # property not existing: `-source_properties.my_property : ""` + # @!attribute [rw] order_by + # @return [::String] + # Expression that defines what fields and order to use for sorting. The + # string value should follow SQL syntax: comma separated list of fields. For + # example: "name,resource_properties.a_property". The default sorting order + # is ascending. To specify descending order for a field, a suffix " desc" + # should be appended to the field name. For example: "name + # desc,source_properties.a_property". Redundant space characters in the + # syntax are insignificant. "name desc,source_properties.a_property" and " + # name desc , source_properties.a_property " are equivalent. + # + # The following fields are supported: + # name + # parent + # state + # category + # resource_name + # event_time + # source_properties + # security_marks.marks + # @!attribute [rw] read_time + # @return [::Google::Protobuf::Timestamp] + # Time used as a reference point when filtering findings. The filter is + # limited to findings existing at the supplied time and their values are + # those at that specific time. Absence of this field will default to the + # API's version of NOW. + # @!attribute [rw] compare_duration + # @return [::Google::Protobuf::Duration] + # When compare_duration is set, the ListFindingsResult's "state_change" + # attribute is updated to indicate whether the finding had its state changed, + # the finding's state remained unchanged, or if the finding was added in any + # state during the compare_duration period of time that precedes the + # read_time. This is the time between (read_time - compare_duration) and + # read_time. + # + # The state_change value is derived based on the presence and state of the + # finding at the two points in time. Intermediate state changes between the + # two times don't affect the result. For example, the results aren't affected + # if the finding is made inactive and then active again. + # + # Possible "state_change" values when compare_duration is specified: + # + # * "CHANGED": indicates that the finding was present and matched the given + # filter at the start of compare_duration, but changed its + # state at read_time. + # * "UNCHANGED": indicates that the finding was present and matched the given + # filter at the start of compare_duration and did not change + # state at read_time. + # * "ADDED": indicates that the finding did not match the given filter or + # was not present at the start of compare_duration, but was + # present at read_time. + # * "REMOVED": indicates that the finding was present and matched the + # filter at the start of compare_duration, but did not match + # the filter at read_time. + # + # If compare_duration is not specified, then the only possible state_change + # is "UNUSED", which will be the state_change set for all findings present at + # read_time. + # @!attribute [rw] field_mask + # @return [::Google::Protobuf::FieldMask] + # A field mask to specify the Finding fields to be listed in the response. + # An empty field mask will list all fields. + # @!attribute [rw] page_token + # @return [::String] + # The value returned by the last `ListFindingsResponse`; indicates + # that this is a continuation of a prior `ListFindings` call, and + # that the system should return the next page of data. + # @!attribute [rw] page_size + # @return [::Integer] + # The maximum number of results to return in a single response. Default is + # 10, minimum is 1, maximum is 1000. + class ListFindingsRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Response message for listing findings. + # @!attribute [rw] list_findings_results + # @return [::Array<::Google::Cloud::SecurityCenter::V1p1beta1::ListFindingsResponse::ListFindingsResult>] + # Findings matching the list request. + # @!attribute [rw] read_time + # @return [::Google::Protobuf::Timestamp] + # Time used for executing the list request. + # @!attribute [rw] next_page_token + # @return [::String] + # Token to retrieve the next page of results, or empty if there are no more + # results. + # @!attribute [rw] total_size + # @return [::Integer] + # The total number of findings matching the query. + class ListFindingsResponse + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # Result containing the Finding and its StateChange. + # @!attribute [rw] finding + # @return [::Google::Cloud::SecurityCenter::V1p1beta1::Finding] + # Finding matching the search request. + # @!attribute [rw] state_change + # @return [::Google::Cloud::SecurityCenter::V1p1beta1::ListFindingsResponse::ListFindingsResult::StateChange] + # State change of the finding between the points in time. + # @!attribute [r] resource + # @return [::Google::Cloud::SecurityCenter::V1p1beta1::ListFindingsResponse::ListFindingsResult::Resource] + # Output only. Resource that is associated with this finding. + class ListFindingsResult + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # Information related to the Google Cloud resource that is + # associated with this finding. + # @!attribute [rw] name + # @return [::String] + # The full resource name of the resource. See: + # https://cloud.google.com/apis/design/resource_names#full_resource_name + # @!attribute [rw] project_name + # @return [::String] + # The full resource name of project that the resource belongs to. + # @!attribute [rw] project_display_name + # @return [::String] + # The human readable name of project that the resource belongs to. + # @!attribute [rw] parent_name + # @return [::String] + # The full resource name of resource's parent. + # @!attribute [rw] parent_display_name + # @return [::String] + # The human readable name of resource's parent. + # @!attribute [rw] folders + # @return [::Array<::Google::Cloud::SecurityCenter::V1p1Beta1::Folder>] + # Contains a Folder message for each folder in the assets ancestry. + # The first folder is the deepest nested folder, and the last folder is + # the folder directly under the Organization. + class Resource + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # The change in state of the finding. + # + # When querying across two points in time this describes + # the change in the finding between the two points: CHANGED, UNCHANGED, + # ADDED, or REMOVED. Findings can not be deleted, so REMOVED implies that + # the finding at timestamp does not match the filter specified, but it did + # at timestamp - compare_duration. If there was no compare_duration + # supplied in the request the state change will be: UNUSED + module StateChange + # State change is unused, this is the canonical default for this enum. + UNUSED = 0 + + # The finding has changed state in some way between the points in time + # and existed at both points. + CHANGED = 1 + + # The finding has not changed state between the points in time and + # existed at both points. + UNCHANGED = 2 + + # The finding was created between the points in time. + ADDED = 3 + + # The finding at timestamp does not match the filter specified, but it + # did at timestamp - compare_duration. + REMOVED = 4 + end + end + end + + # Request message for updating a finding's state. + # @!attribute [rw] name + # @return [::String] + # Required. The relative resource name of the finding. See: + # https://cloud.google.com/apis/design/resource_names#relative_resource_name + # Example: + # "organizations/\\{organization_id}/sources/\\{source_id}/finding/\\{finding_id}". + # @!attribute [rw] state + # @return [::Google::Cloud::SecurityCenter::V1p1beta1::Finding::State] + # Required. The desired State of the finding. + # @!attribute [rw] start_time + # @return [::Google::Protobuf::Timestamp] + # Required. The time at which the updated state takes effect. + class SetFindingStateRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Request message for running asset discovery for an organization. + # @!attribute [rw] parent + # @return [::String] + # Required. Name of the organization to run asset discovery for. Its format is + # "organizations/[organization_id]". + class RunAssetDiscoveryRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Request message for updating or creating a finding. + # @!attribute [rw] finding + # @return [::Google::Cloud::SecurityCenter::V1p1beta1::Finding] + # Required. The finding resource to update or create if it does not already exist. + # parent, security_marks, and update_time will be ignored. + # + # In the case of creation, the finding id portion of the name must be + # alphanumeric and less than or equal to 32 characters and greater than 0 + # characters in length. + # @!attribute [rw] update_mask + # @return [::Google::Protobuf::FieldMask] + # The FieldMask to use when updating the finding resource. This field should + # not be specified when creating a finding. + # + # When updating a finding, an empty mask is treated as updating all mutable + # fields and replacing source_properties. Individual source_properties can + # be added/updated by using "source_properties." in the field + # mask. + class UpdateFindingRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Request message for updating a notification config. + # @!attribute [rw] notification_config + # @return [::Google::Cloud::SecurityCenter::V1p1beta1::NotificationConfig] + # Required. The notification config to update. + # @!attribute [rw] update_mask + # @return [::Google::Protobuf::FieldMask] + # The FieldMask to use when updating the notification config. + # + # If empty all mutable fields will be updated. + class UpdateNotificationConfigRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Request message for updating an organization's settings. + # @!attribute [rw] organization_settings + # @return [::Google::Cloud::SecurityCenter::V1p1beta1::OrganizationSettings] + # Required. The organization settings resource to update. + # @!attribute [rw] update_mask + # @return [::Google::Protobuf::FieldMask] + # The FieldMask to use when updating the settings resource. + # + # If empty all mutable fields will be updated. + class UpdateOrganizationSettingsRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Request message for updating a source. + # @!attribute [rw] source + # @return [::Google::Cloud::SecurityCenter::V1p1beta1::Source] + # Required. The source resource to update. + # @!attribute [rw] update_mask + # @return [::Google::Protobuf::FieldMask] + # The FieldMask to use when updating the source resource. + # + # If empty all mutable fields will be updated. + class UpdateSourceRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Request message for updating a SecurityMarks resource. + # @!attribute [rw] security_marks + # @return [::Google::Cloud::SecurityCenter::V1p1beta1::SecurityMarks] + # Required. The security marks resource to update. + # @!attribute [rw] update_mask + # @return [::Google::Protobuf::FieldMask] + # The FieldMask to use when updating the security marks resource. + # + # The field mask must not contain duplicate fields. + # If empty or set to "marks", all marks will be replaced. Individual + # marks can be updated using "marks.". + # @!attribute [rw] start_time + # @return [::Google::Protobuf::Timestamp] + # The time at which the updated SecurityMarks take effect. + # If not set uses current server time. Updates will be applied to the + # SecurityMarks that are active immediately preceding this time. + class UpdateSecurityMarksRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-security_center-v1p1beta1/proto_docs/google/cloud/securitycenter/v1p1beta1/source.rb b/owl-bot-staging/google-cloud-security_center-v1p1beta1/proto_docs/google/cloud/securitycenter/v1p1beta1/source.rb new file mode 100644 index 000000000000..72b49b0fe90a --- /dev/null +++ b/owl-bot-staging/google-cloud-security_center-v1p1beta1/proto_docs/google/cloud/securitycenter/v1p1beta1/source.rb @@ -0,0 +1,64 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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 SecurityCenter + module V1p1beta1 + # Security Command Center finding source. A finding source + # is an entity or a mechanism that can produce a finding. A source is like a + # container of findings that come from the same scanner, logger, monitor, etc. + # @!attribute [rw] name + # @return [::String] + # The relative resource name of this source. See: + # https://cloud.google.com/apis/design/resource_names#relative_resource_name + # Example: + # "organizations/\\{organization_id}/sources/\\{source_id}" + # @!attribute [rw] display_name + # @return [::String] + # The source's display name. + # A source's display name must be unique amongst its siblings, for example, + # two sources with the same parent can't share the same display name. + # The display name must have a length between 1 and 64 characters + # (inclusive). + # @!attribute [rw] description + # @return [::String] + # The description of the source (max of 1024 characters). + # Example: + # "Web Security Scanner is a web security scanner for common + # vulnerabilities in App Engine applications. It can automatically + # scan and detect four common vulnerabilities, including cross-site-scripting + # (XSS), Flash injection, mixed content (HTTP in HTTPS), and + # outdated/insecure libraries." + # @!attribute [rw] canonical_name + # @return [::String] + # The canonical name of the finding. It's either + # "organizations/\\{organization_id}/sources/\\{source_id}", + # "folders/\\{folder_id}/sources/\\{source_id}" or + # "projects/\\{project_number}/sources/\\{source_id}", + # depending on the closest CRM ancestor of the resource associated with the + # finding. + class Source + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-security_center-v1p1beta1/proto_docs/google/iam/v1/iam_policy.rb b/owl-bot-staging/google-cloud-security_center-v1p1beta1/proto_docs/google/iam/v1/iam_policy.rb new file mode 100644 index 000000000000..5445c77f8258 --- /dev/null +++ b/owl-bot-staging/google-cloud-security_center-v1p1beta1/proto_docs/google/iam/v1/iam_policy.rb @@ -0,0 +1,87 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + + +module Google + module Iam + module V1 + # Request message for `SetIamPolicy` method. + # @!attribute [rw] resource + # @return [::String] + # REQUIRED: The resource for which the policy is being specified. + # See the operation documentation for the appropriate value for this field. + # @!attribute [rw] policy + # @return [::Google::Iam::V1::Policy] + # REQUIRED: The complete policy to be applied to the `resource`. The size of + # the policy is limited to a few 10s of KB. An empty policy is a + # valid policy but certain Cloud Platform services (such as Projects) + # might reject them. + # @!attribute [rw] update_mask + # @return [::Google::Protobuf::FieldMask] + # OPTIONAL: A FieldMask specifying which fields of the policy to modify. Only + # the fields in the mask will be modified. If no mask is provided, the + # following default mask is used: + # + # `paths: "bindings, etag"` + class SetIamPolicyRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Request message for `GetIamPolicy` method. + # @!attribute [rw] resource + # @return [::String] + # REQUIRED: The resource for which the policy is being requested. + # See the operation documentation for the appropriate value for this field. + # @!attribute [rw] options + # @return [::Google::Iam::V1::GetPolicyOptions] + # OPTIONAL: A `GetPolicyOptions` object for specifying options to + # `GetIamPolicy`. + class GetIamPolicyRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Request message for `TestIamPermissions` method. + # @!attribute [rw] resource + # @return [::String] + # REQUIRED: The resource for which the policy detail is being requested. + # See the operation documentation for the appropriate value for this field. + # @!attribute [rw] permissions + # @return [::Array<::String>] + # The set of permissions to check for the `resource`. Permissions with + # wildcards (such as '*' or 'storage.*') are not allowed. For more + # information see + # [IAM Overview](https://cloud.google.com/iam/docs/overview#permissions). + class TestIamPermissionsRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Response message for `TestIamPermissions` method. + # @!attribute [rw] permissions + # @return [::Array<::String>] + # A subset of `TestPermissionsRequest.permissions` that the caller is + # allowed. + class TestIamPermissionsResponse + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end + end +end diff --git a/owl-bot-staging/google-cloud-security_center-v1p1beta1/proto_docs/google/iam/v1/options.rb b/owl-bot-staging/google-cloud-security_center-v1p1beta1/proto_docs/google/iam/v1/options.rb new file mode 100644 index 000000000000..60713d995b86 --- /dev/null +++ b/owl-bot-staging/google-cloud-security_center-v1p1beta1/proto_docs/google/iam/v1/options.rb @@ -0,0 +1,50 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + + +module Google + module Iam + module V1 + # Encapsulates settings provided to GetIamPolicy. + # @!attribute [rw] requested_policy_version + # @return [::Integer] + # Optional. The maximum policy version that will be used to format the + # policy. + # + # Valid values are 0, 1, and 3. Requests specifying an invalid value will be + # rejected. + # + # Requests for policies with any conditional role bindings must specify + # version 3. Policies with no conditional role bindings may specify any valid + # value or leave the field unset. + # + # The policy in the response might use the policy version that you specified, + # or it might use a lower policy version. For example, if you specify version + # 3, but the policy has no conditional role bindings, the response uses + # version 1. + # + # To learn which resources support conditions in their IAM policies, see the + # [IAM + # documentation](https://cloud.google.com/iam/help/conditions/resource-policies). + class GetPolicyOptions + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end + end +end diff --git a/owl-bot-staging/google-cloud-security_center-v1p1beta1/proto_docs/google/iam/v1/policy.rb b/owl-bot-staging/google-cloud-security_center-v1p1beta1/proto_docs/google/iam/v1/policy.rb new file mode 100644 index 000000000000..999575b797df --- /dev/null +++ b/owl-bot-staging/google-cloud-security_center-v1p1beta1/proto_docs/google/iam/v1/policy.rb @@ -0,0 +1,426 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + + +module Google + module Iam + module V1 + # An Identity and Access Management (IAM) policy, which specifies access + # controls for Google Cloud resources. + # + # + # A `Policy` is a collection of `bindings`. A `binding` binds one or more + # `members`, or principals, to a single `role`. Principals can be user + # accounts, service accounts, Google groups, and domains (such as G Suite). A + # `role` is a named list of permissions; each `role` can be an IAM predefined + # role or a user-created custom role. + # + # For some types of Google Cloud resources, a `binding` can also specify a + # `condition`, which is a logical expression that allows access to a resource + # only if the expression evaluates to `true`. A condition can add constraints + # based on attributes of the request, the resource, or both. To learn which + # resources support conditions in their IAM policies, see the + # [IAM + # documentation](https://cloud.google.com/iam/help/conditions/resource-policies). + # + # **JSON example:** + # + # ``` + # { + # "bindings": [ + # { + # "role": "roles/resourcemanager.organizationAdmin", + # "members": [ + # "user:mike@example.com", + # "group:admins@example.com", + # "domain:google.com", + # "serviceAccount:my-project-id@appspot.gserviceaccount.com" + # ] + # }, + # { + # "role": "roles/resourcemanager.organizationViewer", + # "members": [ + # "user:eve@example.com" + # ], + # "condition": { + # "title": "expirable access", + # "description": "Does not grant access after Sep 2020", + # "expression": "request.time < + # timestamp('2020-10-01T00:00:00.000Z')", + # } + # } + # ], + # "etag": "BwWWja0YfJA=", + # "version": 3 + # } + # ``` + # + # **YAML example:** + # + # ``` + # bindings: + # - members: + # - user:mike@example.com + # - group:admins@example.com + # - domain:google.com + # - serviceAccount:my-project-id@appspot.gserviceaccount.com + # role: roles/resourcemanager.organizationAdmin + # - members: + # - user:eve@example.com + # role: roles/resourcemanager.organizationViewer + # condition: + # title: expirable access + # description: Does not grant access after Sep 2020 + # expression: request.time < timestamp('2020-10-01T00:00:00.000Z') + # etag: BwWWja0YfJA= + # version: 3 + # ``` + # + # For a description of IAM and its features, see the + # [IAM documentation](https://cloud.google.com/iam/docs/). + # @!attribute [rw] version + # @return [::Integer] + # Specifies the format of the policy. + # + # Valid values are `0`, `1`, and `3`. Requests that specify an invalid value + # are rejected. + # + # Any operation that affects conditional role bindings must specify version + # `3`. This requirement applies to the following operations: + # + # * Getting a policy that includes a conditional role binding + # * Adding a conditional role binding to a policy + # * Changing a conditional role binding in a policy + # * Removing any role binding, with or without a condition, from a policy + # that includes conditions + # + # **Important:** If you use IAM Conditions, you must include the `etag` field + # whenever you call `setIamPolicy`. If you omit this field, then IAM allows + # you to overwrite a version `3` policy with a version `1` policy, and all of + # the conditions in the version `3` policy are lost. + # + # If a policy does not include any conditions, operations on that policy may + # specify any valid version or leave the field unset. + # + # To learn which resources support conditions in their IAM policies, see the + # [IAM + # documentation](https://cloud.google.com/iam/help/conditions/resource-policies). + # @!attribute [rw] bindings + # @return [::Array<::Google::Iam::V1::Binding>] + # Associates a list of `members`, or principals, with a `role`. Optionally, + # may specify a `condition` that determines how and when the `bindings` are + # applied. Each of the `bindings` must contain at least one principal. + # + # The `bindings` in a `Policy` can refer to up to 1,500 principals; up to 250 + # of these principals can be Google groups. Each occurrence of a principal + # counts towards these limits. For example, if the `bindings` grant 50 + # different roles to `user:alice@example.com`, and not to any other + # principal, then you can add another 1,450 principals to the `bindings` in + # the `Policy`. + # @!attribute [rw] audit_configs + # @return [::Array<::Google::Iam::V1::AuditConfig>] + # Specifies cloud audit logging configuration for this policy. + # @!attribute [rw] etag + # @return [::String] + # `etag` is used for optimistic concurrency control as a way to help + # prevent simultaneous updates of a policy from overwriting each other. + # It is strongly suggested that systems make use of the `etag` in the + # read-modify-write cycle to perform policy updates in order to avoid race + # conditions: An `etag` is returned in the response to `getIamPolicy`, and + # systems are expected to put that etag in the request to `setIamPolicy` to + # ensure that their change will be applied to the same version of the policy. + # + # **Important:** If you use IAM Conditions, you must include the `etag` field + # whenever you call `setIamPolicy`. If you omit this field, then IAM allows + # you to overwrite a version `3` policy with a version `1` policy, and all of + # the conditions in the version `3` policy are lost. + class Policy + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Associates `members`, or principals, with a `role`. + # @!attribute [rw] role + # @return [::String] + # Role that is assigned to the list of `members`, or principals. + # For example, `roles/viewer`, `roles/editor`, or `roles/owner`. + # @!attribute [rw] members + # @return [::Array<::String>] + # Specifies the principals requesting access for a Google Cloud resource. + # `members` can have the following values: + # + # * `allUsers`: A special identifier that represents anyone who is + # on the internet; with or without a Google account. + # + # * `allAuthenticatedUsers`: A special identifier that represents anyone + # who is authenticated with a Google account or a service account. + # + # * `user:{emailid}`: An email address that represents a specific Google + # account. For example, `alice@example.com` . + # + # + # * `serviceAccount:{emailid}`: An email address that represents a service + # account. For example, `my-other-app@appspot.gserviceaccount.com`. + # + # * `group:{emailid}`: An email address that represents a Google group. + # For example, `admins@example.com`. + # + # * `deleted:user:{emailid}?uid={uniqueid}`: An email address (plus unique + # identifier) representing a user that has been recently deleted. For + # example, `alice@example.com?uid=123456789012345678901`. If the user is + # recovered, this value reverts to `user:{emailid}` and the recovered user + # retains the role in the binding. + # + # * `deleted:serviceAccount:{emailid}?uid={uniqueid}`: An email address (plus + # unique identifier) representing a service account that has been recently + # deleted. For example, + # `my-other-app@appspot.gserviceaccount.com?uid=123456789012345678901`. + # If the service account is undeleted, this value reverts to + # `serviceAccount:{emailid}` and the undeleted service account retains the + # role in the binding. + # + # * `deleted:group:{emailid}?uid={uniqueid}`: An email address (plus unique + # identifier) representing a Google group that has been recently + # deleted. For example, `admins@example.com?uid=123456789012345678901`. If + # the group is recovered, this value reverts to `group:{emailid}` and the + # recovered group retains the role in the binding. + # + # + # * `domain:{domain}`: The G Suite domain (primary) that represents all the + # users of that domain. For example, `google.com` or `example.com`. + # @!attribute [rw] condition + # @return [::Google::Type::Expr] + # The condition that is associated with this binding. + # + # If the condition evaluates to `true`, then this binding applies to the + # current request. + # + # If the condition evaluates to `false`, then this binding does not apply to + # the current request. However, a different role binding might grant the same + # role to one or more of the principals in this binding. + # + # To learn which resources support conditions in their IAM policies, see the + # [IAM + # documentation](https://cloud.google.com/iam/help/conditions/resource-policies). + class Binding + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Specifies the audit configuration for a service. + # The configuration determines which permission types are logged, and what + # identities, if any, are exempted from logging. + # An AuditConfig must have one or more AuditLogConfigs. + # + # If there are AuditConfigs for both `allServices` and a specific service, + # the union of the two AuditConfigs is used for that service: the log_types + # specified in each AuditConfig are enabled, and the exempted_members in each + # AuditLogConfig are exempted. + # + # Example Policy with multiple AuditConfigs: + # + # { + # "audit_configs": [ + # { + # "service": "allServices", + # "audit_log_configs": [ + # { + # "log_type": "DATA_READ", + # "exempted_members": [ + # "user:jose@example.com" + # ] + # }, + # { + # "log_type": "DATA_WRITE" + # }, + # { + # "log_type": "ADMIN_READ" + # } + # ] + # }, + # { + # "service": "sampleservice.googleapis.com", + # "audit_log_configs": [ + # { + # "log_type": "DATA_READ" + # }, + # { + # "log_type": "DATA_WRITE", + # "exempted_members": [ + # "user:aliya@example.com" + # ] + # } + # ] + # } + # ] + # } + # + # For sampleservice, this policy enables DATA_READ, DATA_WRITE and ADMIN_READ + # logging. It also exempts `jose@example.com` from DATA_READ logging, and + # `aliya@example.com` from DATA_WRITE logging. + # @!attribute [rw] service + # @return [::String] + # Specifies a service that will be enabled for audit logging. + # For example, `storage.googleapis.com`, `cloudsql.googleapis.com`. + # `allServices` is a special value that covers all services. + # @!attribute [rw] audit_log_configs + # @return [::Array<::Google::Iam::V1::AuditLogConfig>] + # The configuration for logging of each type of permission. + class AuditConfig + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Provides the configuration for logging a type of permissions. + # Example: + # + # { + # "audit_log_configs": [ + # { + # "log_type": "DATA_READ", + # "exempted_members": [ + # "user:jose@example.com" + # ] + # }, + # { + # "log_type": "DATA_WRITE" + # } + # ] + # } + # + # This enables 'DATA_READ' and 'DATA_WRITE' logging, while exempting + # jose@example.com from DATA_READ logging. + # @!attribute [rw] log_type + # @return [::Google::Iam::V1::AuditLogConfig::LogType] + # The log type that this config enables. + # @!attribute [rw] exempted_members + # @return [::Array<::String>] + # Specifies the identities that do not cause logging for this type of + # permission. + # Follows the same format of + # [Binding.members][google.iam.v1.Binding.members]. + class AuditLogConfig + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # The list of valid permission types for which logging can be configured. + # Admin writes are always logged, and are not configurable. + module LogType + # Default case. Should never be this. + LOG_TYPE_UNSPECIFIED = 0 + + # Admin reads. Example: CloudIAM getIamPolicy + ADMIN_READ = 1 + + # Data writes. Example: CloudSQL Users create + DATA_WRITE = 2 + + # Data reads. Example: CloudSQL Users list + DATA_READ = 3 + end + end + + # The difference delta between two policies. + # @!attribute [rw] binding_deltas + # @return [::Array<::Google::Iam::V1::BindingDelta>] + # The delta for Bindings between two policies. + # @!attribute [rw] audit_config_deltas + # @return [::Array<::Google::Iam::V1::AuditConfigDelta>] + # The delta for AuditConfigs between two policies. + class PolicyDelta + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # One delta entry for Binding. Each individual change (only one member in each + # entry) to a binding will be a separate entry. + # @!attribute [rw] action + # @return [::Google::Iam::V1::BindingDelta::Action] + # The action that was performed on a Binding. + # Required + # @!attribute [rw] role + # @return [::String] + # Role that is assigned to `members`. + # For example, `roles/viewer`, `roles/editor`, or `roles/owner`. + # Required + # @!attribute [rw] member + # @return [::String] + # A single identity requesting access for a Google Cloud resource. + # Follows the same format of Binding.members. + # Required + # @!attribute [rw] condition + # @return [::Google::Type::Expr] + # The condition that is associated with this binding. + class BindingDelta + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # The type of action performed on a Binding in a policy. + module Action + # Unspecified. + ACTION_UNSPECIFIED = 0 + + # Addition of a Binding. + ADD = 1 + + # Removal of a Binding. + REMOVE = 2 + end + end + + # One delta entry for AuditConfig. Each individual change (only one + # exempted_member in each entry) to a AuditConfig will be a separate entry. + # @!attribute [rw] action + # @return [::Google::Iam::V1::AuditConfigDelta::Action] + # The action that was performed on an audit configuration in a policy. + # Required + # @!attribute [rw] service + # @return [::String] + # Specifies a service that was configured for Cloud Audit Logging. + # For example, `storage.googleapis.com`, `cloudsql.googleapis.com`. + # `allServices` is a special value that covers all services. + # Required + # @!attribute [rw] exempted_member + # @return [::String] + # A single identity that is exempted from "data access" audit + # logging for the `service` specified above. + # Follows the same format of Binding.members. + # @!attribute [rw] log_type + # @return [::String] + # Specifies the log_type that was be enabled. ADMIN_ACTIVITY is always + # enabled, and cannot be configured. + # Required + class AuditConfigDelta + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # The type of action performed on an audit configuration in a policy. + module Action + # Unspecified. + ACTION_UNSPECIFIED = 0 + + # Addition of an audit configuration. + ADD = 1 + + # Removal of an audit configuration. + REMOVE = 2 + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-security_center-v1p1beta1/proto_docs/google/longrunning/operations.rb b/owl-bot-staging/google-cloud-security_center-v1p1beta1/proto_docs/google/longrunning/operations.rb new file mode 100644 index 000000000000..7a757f512165 --- /dev/null +++ b/owl-bot-staging/google-cloud-security_center-v1p1beta1/proto_docs/google/longrunning/operations.rb @@ -0,0 +1,191 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + + +module Google + module Longrunning + # This resource represents a long-running operation that is the result of a + # network API call. + # @!attribute [rw] name + # @return [::String] + # The server-assigned name, which is only unique within the same service that + # originally returns it. If you use the default HTTP mapping, the + # `name` should be a resource name ending with `operations/{unique_id}`. + # @!attribute [rw] metadata + # @return [::Google::Protobuf::Any] + # Service-specific metadata associated with the operation. It typically + # contains progress information and common metadata such as create time. + # Some services might not provide such metadata. Any method that returns a + # long-running operation should document the metadata type, if any. + # @!attribute [rw] done + # @return [::Boolean] + # If the value is `false`, it means the operation is still in progress. + # If `true`, the operation is completed, and either `error` or `response` is + # available. + # @!attribute [rw] error + # @return [::Google::Rpc::Status] + # The error result of the operation in case of failure or cancellation. + # + # Note: The following fields are mutually exclusive: `error`, `response`. If a field in that set is populated, all other fields in the set will automatically be cleared. + # @!attribute [rw] response + # @return [::Google::Protobuf::Any] + # The normal, successful response of the operation. If the original + # method returns no data on success, such as `Delete`, the response is + # `google.protobuf.Empty`. If the original method is standard + # `Get`/`Create`/`Update`, the response should be the resource. For other + # methods, the response should have the type `XxxResponse`, where `Xxx` + # is the original method name. For example, if the original method name + # is `TakeSnapshot()`, the inferred response type is + # `TakeSnapshotResponse`. + # + # Note: The following fields are mutually exclusive: `response`, `error`. If a field in that set is populated, all other fields in the set will automatically be cleared. + class Operation + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # The request message for + # Operations.GetOperation. + # @!attribute [rw] name + # @return [::String] + # The name of the operation resource. + class GetOperationRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # The request message for + # Operations.ListOperations. + # @!attribute [rw] name + # @return [::String] + # The name of the operation's parent resource. + # @!attribute [rw] filter + # @return [::String] + # The standard list filter. + # @!attribute [rw] page_size + # @return [::Integer] + # The standard list page size. + # @!attribute [rw] page_token + # @return [::String] + # The standard list page token. + # @!attribute [rw] return_partial_success + # @return [::Boolean] + # When set to `true`, operations that are reachable are returned as normal, + # and those that are unreachable are returned in the + # [ListOperationsResponse.unreachable] field. + # + # This can only be `true` when reading across collections e.g. when `parent` + # is set to `"projects/example/locations/-"`. + # + # This field is not by default supported and will result in an + # `UNIMPLEMENTED` error if set unless explicitly documented otherwise in + # service or product specific documentation. + class ListOperationsRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # The response message for + # Operations.ListOperations. + # @!attribute [rw] operations + # @return [::Array<::Google::Longrunning::Operation>] + # A list of operations that matches the specified filter in the request. + # @!attribute [rw] next_page_token + # @return [::String] + # The standard List next-page token. + # @!attribute [rw] unreachable + # @return [::Array<::String>] + # Unordered list. Unreachable resources. Populated when the request sets + # `ListOperationsRequest.return_partial_success` and reads across + # collections e.g. when attempting to list all resources across all supported + # locations. + class ListOperationsResponse + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # The request message for + # Operations.CancelOperation. + # @!attribute [rw] name + # @return [::String] + # The name of the operation resource to be cancelled. + class CancelOperationRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # The request message for + # Operations.DeleteOperation. + # @!attribute [rw] name + # @return [::String] + # The name of the operation resource to be deleted. + class DeleteOperationRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # The request message for + # Operations.WaitOperation. + # @!attribute [rw] name + # @return [::String] + # The name of the operation resource to wait on. + # @!attribute [rw] timeout + # @return [::Google::Protobuf::Duration] + # The maximum duration to wait before timing out. If left blank, the wait + # will be at most the time permitted by the underlying HTTP/RPC protocol. + # If RPC context deadline is also specified, the shorter one will be used. + class WaitOperationRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # A message representing the message types used by a long-running operation. + # + # Example: + # + # rpc Export(ExportRequest) returns (google.longrunning.Operation) { + # option (google.longrunning.operation_info) = { + # response_type: "ExportResponse" + # metadata_type: "ExportMetadata" + # }; + # } + # @!attribute [rw] response_type + # @return [::String] + # Required. The message name of the primary return type for this + # long-running operation. + # This type will be used to deserialize the LRO's response. + # + # If the response is in a different package from the rpc, a fully-qualified + # message name must be used (e.g. `google.protobuf.Struct`). + # + # Note: Altering this value constitutes a breaking change. + # @!attribute [rw] metadata_type + # @return [::String] + # Required. The message name of the metadata type for this long-running + # operation. + # + # If the response is in a different package from the rpc, a fully-qualified + # message name must be used (e.g. `google.protobuf.Struct`). + # + # Note: Altering this value constitutes a breaking change. + class OperationInfo + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end +end diff --git a/owl-bot-staging/google-cloud-security_center-v1p1beta1/proto_docs/google/protobuf/any.rb b/owl-bot-staging/google-cloud-security_center-v1p1beta1/proto_docs/google/protobuf/any.rb new file mode 100644 index 000000000000..58691995f02e --- /dev/null +++ b/owl-bot-staging/google-cloud-security_center-v1p1beta1/proto_docs/google/protobuf/any.rb @@ -0,0 +1,145 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + + +module Google + module Protobuf + # `Any` contains an arbitrary serialized protocol buffer message along with a + # URL that describes the type of the serialized message. + # + # Protobuf library provides support to pack/unpack Any values in the form + # of utility functions or additional generated methods of the Any type. + # + # Example 1: Pack and unpack a message in C++. + # + # Foo foo = ...; + # Any any; + # any.PackFrom(foo); + # ... + # if (any.UnpackTo(&foo)) { + # ... + # } + # + # Example 2: Pack and unpack a message in Java. + # + # Foo foo = ...; + # Any any = Any.pack(foo); + # ... + # if (any.is(Foo.class)) { + # foo = any.unpack(Foo.class); + # } + # // or ... + # if (any.isSameTypeAs(Foo.getDefaultInstance())) { + # foo = any.unpack(Foo.getDefaultInstance()); + # } + # + # Example 3: Pack and unpack a message in Python. + # + # foo = Foo(...) + # any = Any() + # any.Pack(foo) + # ... + # if any.Is(Foo.DESCRIPTOR): + # any.Unpack(foo) + # ... + # + # Example 4: Pack and unpack a message in Go + # + # foo := &pb.Foo{...} + # any, err := anypb.New(foo) + # if err != nil { + # ... + # } + # ... + # foo := &pb.Foo{} + # if err := any.UnmarshalTo(foo); err != nil { + # ... + # } + # + # The pack methods provided by protobuf library will by default use + # 'type.googleapis.com/full.type.name' as the type URL and the unpack + # methods only use the fully qualified type name after the last '/' + # in the type URL, for example "foo.bar.com/x/y.z" will yield type + # name "y.z". + # + # JSON + # ==== + # The JSON representation of an `Any` value uses the regular + # representation of the deserialized, embedded message, with an + # additional field `@type` which contains the type URL. Example: + # + # package google.profile; + # message Person { + # string first_name = 1; + # string last_name = 2; + # } + # + # { + # "@type": "type.googleapis.com/google.profile.Person", + # "firstName": , + # "lastName": + # } + # + # If the embedded message type is well-known and has a custom JSON + # representation, that representation will be embedded adding a field + # `value` which holds the custom JSON in addition to the `@type` + # field. Example (for message [google.protobuf.Duration][]): + # + # { + # "@type": "type.googleapis.com/google.protobuf.Duration", + # "value": "1.212s" + # } + # @!attribute [rw] type_url + # @return [::String] + # A URL/resource name that uniquely identifies the type of the serialized + # protocol buffer message. This string must contain at least + # one "/" character. The last segment of the URL's path must represent + # the fully qualified name of the type (as in + # `path/google.protobuf.Duration`). The name should be in a canonical form + # (e.g., leading "." is not accepted). + # + # In practice, teams usually precompile into the binary all types that they + # expect it to use in the context of Any. However, for URLs which use the + # scheme `http`, `https`, or no scheme, one can optionally set up a type + # server that maps type URLs to message definitions as follows: + # + # * If no scheme is provided, `https` is assumed. + # * An HTTP GET on the URL must yield a [google.protobuf.Type][] + # value in binary format, or produce an error. + # * Applications are allowed to cache lookup results based on the + # URL, or have them precompiled into a binary to avoid any + # lookup. Therefore, binary compatibility needs to be preserved + # on changes to types. (Use versioned type names to manage + # breaking changes.) + # + # Note: this functionality is not currently available in the official + # protobuf release, and it is not used for type URLs beginning with + # type.googleapis.com. As of May 2023, there are no widely used type server + # implementations and no plans to implement one. + # + # Schemes other than `http`, `https` (or the empty scheme) might be + # used with implementation specific semantics. + # @!attribute [rw] value + # @return [::String] + # Must be a valid serialized protocol buffer of the above specified type. + class Any + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end +end diff --git a/owl-bot-staging/google-cloud-security_center-v1p1beta1/proto_docs/google/protobuf/duration.rb b/owl-bot-staging/google-cloud-security_center-v1p1beta1/proto_docs/google/protobuf/duration.rb new file mode 100644 index 000000000000..ea59f1f91daf --- /dev/null +++ b/owl-bot-staging/google-cloud-security_center-v1p1beta1/proto_docs/google/protobuf/duration.rb @@ -0,0 +1,98 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + + +module Google + module Protobuf + # A Duration represents a signed, fixed-length span of time represented + # as a count of seconds and fractions of seconds at nanosecond + # resolution. It is independent of any calendar and concepts like "day" + # or "month". It is related to Timestamp in that the difference between + # two Timestamp values is a Duration and it can be added or subtracted + # from a Timestamp. Range is approximately +-10,000 years. + # + # # Examples + # + # Example 1: Compute Duration from two Timestamps in pseudo code. + # + # Timestamp start = ...; + # Timestamp end = ...; + # Duration duration = ...; + # + # duration.seconds = end.seconds - start.seconds; + # duration.nanos = end.nanos - start.nanos; + # + # if (duration.seconds < 0 && duration.nanos > 0) { + # duration.seconds += 1; + # duration.nanos -= 1000000000; + # } else if (duration.seconds > 0 && duration.nanos < 0) { + # duration.seconds -= 1; + # duration.nanos += 1000000000; + # } + # + # Example 2: Compute Timestamp from Timestamp + Duration in pseudo code. + # + # Timestamp start = ...; + # Duration duration = ...; + # Timestamp end = ...; + # + # end.seconds = start.seconds + duration.seconds; + # end.nanos = start.nanos + duration.nanos; + # + # if (end.nanos < 0) { + # end.seconds -= 1; + # end.nanos += 1000000000; + # } else if (end.nanos >= 1000000000) { + # end.seconds += 1; + # end.nanos -= 1000000000; + # } + # + # Example 3: Compute Duration from datetime.timedelta in Python. + # + # td = datetime.timedelta(days=3, minutes=10) + # duration = Duration() + # duration.FromTimedelta(td) + # + # # JSON Mapping + # + # In JSON format, the Duration type is encoded as a string rather than an + # object, where the string ends in the suffix "s" (indicating seconds) and + # is preceded by the number of seconds, with nanoseconds expressed as + # fractional seconds. For example, 3 seconds with 0 nanoseconds should be + # encoded in JSON format as "3s", while 3 seconds and 1 nanosecond should + # be expressed in JSON format as "3.000000001s", and 3 seconds and 1 + # microsecond should be expressed in JSON format as "3.000001s". + # @!attribute [rw] seconds + # @return [::Integer] + # Signed seconds of the span of time. Must be from -315,576,000,000 + # to +315,576,000,000 inclusive. Note: these bounds are computed from: + # 60 sec/min * 60 min/hr * 24 hr/day * 365.25 days/year * 10000 years + # @!attribute [rw] nanos + # @return [::Integer] + # Signed fractions of a second at nanosecond resolution of the span + # of time. Durations less than one second are represented with a 0 + # `seconds` field and a positive or negative `nanos` field. For durations + # of one second or more, a non-zero value for the `nanos` field must be + # of the same sign as the `seconds` field. Must be from -999,999,999 + # to +999,999,999 inclusive. + class Duration + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end +end diff --git a/owl-bot-staging/google-cloud-security_center-v1p1beta1/proto_docs/google/protobuf/empty.rb b/owl-bot-staging/google-cloud-security_center-v1p1beta1/proto_docs/google/protobuf/empty.rb new file mode 100644 index 000000000000..83e4481834a6 --- /dev/null +++ b/owl-bot-staging/google-cloud-security_center-v1p1beta1/proto_docs/google/protobuf/empty.rb @@ -0,0 +1,34 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + + +module Google + module Protobuf + # A generic empty message that you can re-use to avoid defining duplicated + # empty messages in your APIs. A typical example is to use it as the request + # or the response type of an API method. For instance: + # + # service Foo { + # rpc Bar(google.protobuf.Empty) returns (google.protobuf.Empty); + # } + class Empty + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end +end diff --git a/owl-bot-staging/google-cloud-security_center-v1p1beta1/proto_docs/google/protobuf/field_mask.rb b/owl-bot-staging/google-cloud-security_center-v1p1beta1/proto_docs/google/protobuf/field_mask.rb new file mode 100644 index 000000000000..7f3ffc78601a --- /dev/null +++ b/owl-bot-staging/google-cloud-security_center-v1p1beta1/proto_docs/google/protobuf/field_mask.rb @@ -0,0 +1,229 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + + +module Google + module Protobuf + # `FieldMask` represents a set of symbolic field paths, for example: + # + # paths: "f.a" + # paths: "f.b.d" + # + # Here `f` represents a field in some root message, `a` and `b` + # fields in the message found in `f`, and `d` a field found in the + # message in `f.b`. + # + # Field masks are used to specify a subset of fields that should be + # returned by a get operation or modified by an update operation. + # Field masks also have a custom JSON encoding (see below). + # + # # Field Masks in Projections + # + # When used in the context of a projection, a response message or + # sub-message is filtered by the API to only contain those fields as + # specified in the mask. For example, if the mask in the previous + # example is applied to a response message as follows: + # + # f { + # a : 22 + # b { + # d : 1 + # x : 2 + # } + # y : 13 + # } + # z: 8 + # + # The result will not contain specific values for fields x,y and z + # (their value will be set to the default, and omitted in proto text + # output): + # + # + # f { + # a : 22 + # b { + # d : 1 + # } + # } + # + # A repeated field is not allowed except at the last position of a + # paths string. + # + # If a FieldMask object is not present in a get operation, the + # operation applies to all fields (as if a FieldMask of all fields + # had been specified). + # + # Note that a field mask does not necessarily apply to the + # top-level response message. In case of a REST get operation, the + # field mask applies directly to the response, but in case of a REST + # list operation, the mask instead applies to each individual message + # in the returned resource list. In case of a REST custom method, + # other definitions may be used. Where the mask applies will be + # clearly documented together with its declaration in the API. In + # any case, the effect on the returned resource/resources is required + # behavior for APIs. + # + # # Field Masks in Update Operations + # + # A field mask in update operations specifies which fields of the + # targeted resource are going to be updated. The API is required + # to only change the values of the fields as specified in the mask + # and leave the others untouched. If a resource is passed in to + # describe the updated values, the API ignores the values of all + # fields not covered by the mask. + # + # If a repeated field is specified for an update operation, new values will + # be appended to the existing repeated field in the target resource. Note that + # a repeated field is only allowed in the last position of a `paths` string. + # + # If a sub-message is specified in the last position of the field mask for an + # update operation, then new value will be merged into the existing sub-message + # in the target resource. + # + # For example, given the target message: + # + # f { + # b { + # d: 1 + # x: 2 + # } + # c: [1] + # } + # + # And an update message: + # + # f { + # b { + # d: 10 + # } + # c: [2] + # } + # + # then if the field mask is: + # + # paths: ["f.b", "f.c"] + # + # then the result will be: + # + # f { + # b { + # d: 10 + # x: 2 + # } + # c: [1, 2] + # } + # + # An implementation may provide options to override this default behavior for + # repeated and message fields. + # + # In order to reset a field's value to the default, the field must + # be in the mask and set to the default value in the provided resource. + # Hence, in order to reset all fields of a resource, provide a default + # instance of the resource and set all fields in the mask, or do + # not provide a mask as described below. + # + # If a field mask is not present on update, the operation applies to + # all fields (as if a field mask of all fields has been specified). + # Note that in the presence of schema evolution, this may mean that + # fields the client does not know and has therefore not filled into + # the request will be reset to their default. If this is unwanted + # behavior, a specific service may require a client to always specify + # a field mask, producing an error if not. + # + # As with get operations, the location of the resource which + # describes the updated values in the request message depends on the + # operation kind. In any case, the effect of the field mask is + # required to be honored by the API. + # + # ## Considerations for HTTP REST + # + # The HTTP kind of an update operation which uses a field mask must + # be set to PATCH instead of PUT in order to satisfy HTTP semantics + # (PUT must only be used for full updates). + # + # # JSON Encoding of Field Masks + # + # In JSON, a field mask is encoded as a single string where paths are + # separated by a comma. Fields name in each path are converted + # to/from lower-camel naming conventions. + # + # As an example, consider the following message declarations: + # + # message Profile { + # User user = 1; + # Photo photo = 2; + # } + # message User { + # string display_name = 1; + # string address = 2; + # } + # + # In proto a field mask for `Profile` may look as such: + # + # mask { + # paths: "user.display_name" + # paths: "photo" + # } + # + # In JSON, the same mask is represented as below: + # + # { + # mask: "user.displayName,photo" + # } + # + # # Field Masks and Oneof Fields + # + # Field masks treat fields in oneofs just as regular fields. Consider the + # following message: + # + # message SampleMessage { + # oneof test_oneof { + # string name = 4; + # SubMessage sub_message = 9; + # } + # } + # + # The field mask can be: + # + # mask { + # paths: "name" + # } + # + # Or: + # + # mask { + # paths: "sub_message" + # } + # + # Note that oneof type names ("test_oneof" in this case) cannot be used in + # paths. + # + # ## Field Mask Verification + # + # The implementation of any API method which has a FieldMask type field in the + # request should verify the included field paths, and return an + # `INVALID_ARGUMENT` error if any path is unmappable. + # @!attribute [rw] paths + # @return [::Array<::String>] + # The set of field mask paths. + class FieldMask + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end +end diff --git a/owl-bot-staging/google-cloud-security_center-v1p1beta1/proto_docs/google/protobuf/struct.rb b/owl-bot-staging/google-cloud-security_center-v1p1beta1/proto_docs/google/protobuf/struct.rb new file mode 100644 index 000000000000..39e1aca868d2 --- /dev/null +++ b/owl-bot-staging/google-cloud-security_center-v1p1beta1/proto_docs/google/protobuf/struct.rb @@ -0,0 +1,108 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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 + # `Struct` represents a structured data value, consisting of fields + # which map to dynamically typed values. In some languages, `Struct` + # might be supported by a native representation. For example, in + # scripting languages like JS a struct is represented as an + # object. The details of that representation are described together + # with the proto support for the language. + # + # The JSON representation for `Struct` is JSON object. + # @!attribute [rw] fields + # @return [::Google::Protobuf::Map{::String => ::Google::Protobuf::Value}] + # Unordered map of dynamically typed values. + class Struct + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # @!attribute [rw] key + # @return [::String] + # @!attribute [rw] value + # @return [::Google::Protobuf::Value] + class FieldsEntry + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end + + # `Value` represents a dynamically typed value which can be either + # null, a number, a string, a boolean, a recursive struct value, or a + # list of values. A producer of value is expected to set one of these + # variants. Absence of any variant indicates an error. + # + # The JSON representation for `Value` is JSON value. + # @!attribute [rw] null_value + # @return [::Google::Protobuf::NullValue] + # Represents a null value. + # + # Note: The following fields are mutually exclusive: `null_value`, `number_value`, `string_value`, `bool_value`, `struct_value`, `list_value`. If a field in that set is populated, all other fields in the set will automatically be cleared. + # @!attribute [rw] number_value + # @return [::Float] + # Represents a double value. + # + # Note: The following fields are mutually exclusive: `number_value`, `null_value`, `string_value`, `bool_value`, `struct_value`, `list_value`. If a field in that set is populated, all other fields in the set will automatically be cleared. + # @!attribute [rw] string_value + # @return [::String] + # Represents a string value. + # + # Note: The following fields are mutually exclusive: `string_value`, `null_value`, `number_value`, `bool_value`, `struct_value`, `list_value`. If a field in that set is populated, all other fields in the set will automatically be cleared. + # @!attribute [rw] bool_value + # @return [::Boolean] + # Represents a boolean value. + # + # Note: The following fields are mutually exclusive: `bool_value`, `null_value`, `number_value`, `string_value`, `struct_value`, `list_value`. If a field in that set is populated, all other fields in the set will automatically be cleared. + # @!attribute [rw] struct_value + # @return [::Google::Protobuf::Struct] + # Represents a structured value. + # + # Note: The following fields are mutually exclusive: `struct_value`, `null_value`, `number_value`, `string_value`, `bool_value`, `list_value`. If a field in that set is populated, all other fields in the set will automatically be cleared. + # @!attribute [rw] list_value + # @return [::Google::Protobuf::ListValue] + # Represents a repeated `Value`. + # + # Note: The following fields are mutually exclusive: `list_value`, `null_value`, `number_value`, `string_value`, `bool_value`, `struct_value`. If a field in that set is populated, all other fields in the set will automatically be cleared. + class Value + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # `ListValue` is a wrapper around a repeated field of values. + # + # The JSON representation for `ListValue` is JSON array. + # @!attribute [rw] values + # @return [::Array<::Google::Protobuf::Value>] + # Repeated field of dynamically typed values. + class ListValue + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # `NullValue` is a singleton enumeration to represent the null value for the + # `Value` type union. + # + # The JSON representation for `NullValue` is JSON `null`. + module NullValue + # Null value. + NULL_VALUE = 0 + end + end +end diff --git a/owl-bot-staging/google-cloud-security_center-v1p1beta1/proto_docs/google/protobuf/timestamp.rb b/owl-bot-staging/google-cloud-security_center-v1p1beta1/proto_docs/google/protobuf/timestamp.rb new file mode 100644 index 000000000000..74352be9c58c --- /dev/null +++ b/owl-bot-staging/google-cloud-security_center-v1p1beta1/proto_docs/google/protobuf/timestamp.rb @@ -0,0 +1,127 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + + +module Google + module Protobuf + # A Timestamp represents a point in time independent of any time zone or local + # calendar, encoded as a count of seconds and fractions of seconds at + # nanosecond resolution. The count is relative to an epoch at UTC midnight on + # January 1, 1970, in the proleptic Gregorian calendar which extends the + # Gregorian calendar backwards to year one. + # + # All minutes are 60 seconds long. Leap seconds are "smeared" so that no leap + # second table is needed for interpretation, using a [24-hour linear + # smear](https://developers.google.com/time/smear). + # + # The range is from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59.999999999Z. By + # restricting to that range, we ensure that we can convert to and from [RFC + # 3339](https://www.ietf.org/rfc/rfc3339.txt) date strings. + # + # # Examples + # + # Example 1: Compute Timestamp from POSIX `time()`. + # + # Timestamp timestamp; + # timestamp.set_seconds(time(NULL)); + # timestamp.set_nanos(0); + # + # Example 2: Compute Timestamp from POSIX `gettimeofday()`. + # + # struct timeval tv; + # gettimeofday(&tv, NULL); + # + # Timestamp timestamp; + # timestamp.set_seconds(tv.tv_sec); + # timestamp.set_nanos(tv.tv_usec * 1000); + # + # Example 3: Compute Timestamp from Win32 `GetSystemTimeAsFileTime()`. + # + # FILETIME ft; + # GetSystemTimeAsFileTime(&ft); + # UINT64 ticks = (((UINT64)ft.dwHighDateTime) << 32) | ft.dwLowDateTime; + # + # // A Windows tick is 100 nanoseconds. Windows epoch 1601-01-01T00:00:00Z + # // is 11644473600 seconds before Unix epoch 1970-01-01T00:00:00Z. + # Timestamp timestamp; + # timestamp.set_seconds((INT64) ((ticks / 10000000) - 11644473600LL)); + # timestamp.set_nanos((INT32) ((ticks % 10000000) * 100)); + # + # Example 4: Compute Timestamp from Java `System.currentTimeMillis()`. + # + # long millis = System.currentTimeMillis(); + # + # Timestamp timestamp = Timestamp.newBuilder().setSeconds(millis / 1000) + # .setNanos((int) ((millis % 1000) * 1000000)).build(); + # + # Example 5: Compute Timestamp from Java `Instant.now()`. + # + # Instant now = Instant.now(); + # + # Timestamp timestamp = + # Timestamp.newBuilder().setSeconds(now.getEpochSecond()) + # .setNanos(now.getNano()).build(); + # + # Example 6: Compute Timestamp from current time in Python. + # + # timestamp = Timestamp() + # timestamp.GetCurrentTime() + # + # # JSON Mapping + # + # In JSON format, the Timestamp type is encoded as a string in the + # [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format. That is, the + # format is "\\{year}-\\{month}-\\{day}T\\{hour}:\\{min}:\\{sec}[.\\{frac_sec}]Z" + # where \\{year} is always expressed using four digits while \\{month}, \\{day}, + # \\{hour}, \\{min}, and \\{sec} are zero-padded to two digits each. The fractional + # seconds, which can go up to 9 digits (i.e. up to 1 nanosecond resolution), + # are optional. The "Z" suffix indicates the timezone ("UTC"); the timezone + # is required. A proto3 JSON serializer should always use UTC (as indicated by + # "Z") when printing the Timestamp type and a proto3 JSON parser should be + # able to accept both UTC and other timezones (as indicated by an offset). + # + # For example, "2017-01-15T01:30:15.01Z" encodes 15.01 seconds past + # 01:30 UTC on January 15, 2017. + # + # In JavaScript, one can convert a Date object to this format using the + # standard + # [toISOString()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toISOString) + # method. In Python, a standard `datetime.datetime` object can be converted + # to this format using + # [`strftime`](https://docs.python.org/2/library/time.html#time.strftime) with + # the time format spec '%Y-%m-%dT%H:%M:%S.%fZ'. Likewise, in Java, one can use + # the Joda Time's [`ISODateTimeFormat.dateTime()`]( + # http://joda-time.sourceforge.net/apidocs/org/joda/time/format/ISODateTimeFormat.html#dateTime() + # ) to obtain a formatter capable of generating timestamps in this format. + # @!attribute [rw] seconds + # @return [::Integer] + # Represents seconds of UTC time since Unix epoch + # 1970-01-01T00:00:00Z. Must be from 0001-01-01T00:00:00Z to + # 9999-12-31T23:59:59Z inclusive. + # @!attribute [rw] nanos + # @return [::Integer] + # Non-negative fractions of a second at nanosecond resolution. Negative + # second values with fractions must still have non-negative nanos values + # that count forward in time. Must be from 0 to 999,999,999 + # inclusive. + class Timestamp + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end +end diff --git a/owl-bot-staging/google-cloud-security_center-v1p1beta1/proto_docs/google/rpc/status.rb b/owl-bot-staging/google-cloud-security_center-v1p1beta1/proto_docs/google/rpc/status.rb new file mode 100644 index 000000000000..c1a1c07eb2db --- /dev/null +++ b/owl-bot-staging/google-cloud-security_center-v1p1beta1/proto_docs/google/rpc/status.rb @@ -0,0 +1,48 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + + +module Google + module Rpc + # The `Status` type defines a logical error model that is suitable for + # different programming environments, including REST APIs and RPC APIs. It is + # used by [gRPC](https://github.com/grpc). Each `Status` message contains + # three pieces of data: error code, error message, and error details. + # + # You can find out more about this error model and how to work with it in the + # [API Design Guide](https://cloud.google.com/apis/design/errors). + # @!attribute [rw] code + # @return [::Integer] + # The status code, which should be an enum value of + # [google.rpc.Code][google.rpc.Code]. + # @!attribute [rw] message + # @return [::String] + # A developer-facing error message, which should be in English. Any + # user-facing error message should be localized and sent in the + # {::Google::Rpc::Status#details google.rpc.Status.details} field, or localized + # by the client. + # @!attribute [rw] details + # @return [::Array<::Google::Protobuf::Any>] + # A list of messages that carry the error details. There is a common set of + # message types for APIs to use. + class Status + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end +end diff --git a/owl-bot-staging/google-cloud-security_center-v1p1beta1/proto_docs/google/type/expr.rb b/owl-bot-staging/google-cloud-security_center-v1p1beta1/proto_docs/google/type/expr.rb new file mode 100644 index 000000000000..53e7733b6592 --- /dev/null +++ b/owl-bot-staging/google-cloud-security_center-v1p1beta1/proto_docs/google/type/expr.rb @@ -0,0 +1,75 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + + +module Google + module Type + # Represents a textual expression in the Common Expression Language (CEL) + # syntax. CEL is a C-like expression language. The syntax and semantics of CEL + # are documented at https://github.com/google/cel-spec. + # + # Example (Comparison): + # + # title: "Summary size limit" + # description: "Determines if a summary is less than 100 chars" + # expression: "document.summary.size() < 100" + # + # Example (Equality): + # + # title: "Requestor is owner" + # description: "Determines if requestor is the document owner" + # expression: "document.owner == request.auth.claims.email" + # + # Example (Logic): + # + # title: "Public documents" + # description: "Determine whether the document should be publicly visible" + # expression: "document.type != 'private' && document.type != 'internal'" + # + # Example (Data Manipulation): + # + # title: "Notification string" + # description: "Create a notification string with a timestamp." + # expression: "'New message received at ' + string(document.create_time)" + # + # The exact variables and functions that may be referenced within an expression + # are determined by the service that evaluates it. See the service + # documentation for additional information. + # @!attribute [rw] expression + # @return [::String] + # Textual representation of an expression in Common Expression Language + # syntax. + # @!attribute [rw] title + # @return [::String] + # Optional. Title for the expression, i.e. a short string describing + # its purpose. This can be used e.g. in UIs which allow to enter the + # expression. + # @!attribute [rw] description + # @return [::String] + # Optional. Description of the expression. This is a longer text which + # describes the expression, e.g. when hovered over it in a UI. + # @!attribute [rw] location + # @return [::String] + # Optional. String indicating the location of the expression for error + # reporting, e.g. a file name and a position in the file. + class Expr + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end +end diff --git a/owl-bot-staging/google-cloud-security_center-v1p1beta1/snippets/Gemfile b/owl-bot-staging/google-cloud-security_center-v1p1beta1/snippets/Gemfile new file mode 100644 index 000000000000..a24351ce9260 --- /dev/null +++ b/owl-bot-staging/google-cloud-security_center-v1p1beta1/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-security_center-v1p1beta1", path: "../" +else + gem "google-cloud-security_center-v1p1beta1" +end + +group :test do + gem "google-style", "~> 1.26.1" + gem "minitest", "~> 5.16" + gem "minitest-focus", "~> 1.1" + gem "minitest-hooks", "~> 1.5" +end diff --git a/owl-bot-staging/google-cloud-security_center-v1p1beta1/snippets/security_center/create_finding.rb b/owl-bot-staging/google-cloud-security_center-v1p1beta1/snippets/security_center/create_finding.rb new file mode 100644 index 000000000000..c000d93ed341 --- /dev/null +++ b/owl-bot-staging/google-cloud-security_center-v1p1beta1/snippets/security_center/create_finding.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 securitycenter_v1p1beta1_generated_SecurityCenter_CreateFinding_sync] +require "google/cloud/security_center/v1p1beta1" + +## +# Snippet for the create_finding call in the SecurityCenter service +# +# This snippet has been automatically generated and should be regarded as a code +# template only. It will require modifications to work: +# - It may require correct/in-range values for request initialization. +# - It may require specifying regional endpoints when creating the service +# client as shown in https://cloud.google.com/ruby/docs/reference. +# +# This is an auto-generated example demonstrating basic usage of +# Google::Cloud::SecurityCenter::V1p1beta1::SecurityCenter::Client#create_finding. +# +def create_finding + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::SecurityCenter::V1p1beta1::SecurityCenter::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::SecurityCenter::V1p1beta1::CreateFindingRequest.new + + # Call the create_finding method. + result = client.create_finding request + + # The returned object is of type Google::Cloud::SecurityCenter::V1p1beta1::Finding. + p result +end +# [END securitycenter_v1p1beta1_generated_SecurityCenter_CreateFinding_sync] diff --git a/owl-bot-staging/google-cloud-security_center-v1p1beta1/snippets/security_center/create_notification_config.rb b/owl-bot-staging/google-cloud-security_center-v1p1beta1/snippets/security_center/create_notification_config.rb new file mode 100644 index 000000000000..acdc0989906e --- /dev/null +++ b/owl-bot-staging/google-cloud-security_center-v1p1beta1/snippets/security_center/create_notification_config.rb @@ -0,0 +1,47 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +# [START securitycenter_v1p1beta1_generated_SecurityCenter_CreateNotificationConfig_sync] +require "google/cloud/security_center/v1p1beta1" + +## +# Snippet for the create_notification_config call in the SecurityCenter service +# +# This snippet has been automatically generated and should be regarded as a code +# template only. It will require modifications to work: +# - It may require correct/in-range values for request initialization. +# - It may require specifying regional endpoints when creating the service +# client as shown in https://cloud.google.com/ruby/docs/reference. +# +# This is an auto-generated example demonstrating basic usage of +# Google::Cloud::SecurityCenter::V1p1beta1::SecurityCenter::Client#create_notification_config. +# +def create_notification_config + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::SecurityCenter::V1p1beta1::SecurityCenter::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::SecurityCenter::V1p1beta1::CreateNotificationConfigRequest.new + + # Call the create_notification_config method. + result = client.create_notification_config request + + # The returned object is of type Google::Cloud::SecurityCenter::V1p1beta1::NotificationConfig. + p result +end +# [END securitycenter_v1p1beta1_generated_SecurityCenter_CreateNotificationConfig_sync] diff --git a/owl-bot-staging/google-cloud-security_center-v1p1beta1/snippets/security_center/create_source.rb b/owl-bot-staging/google-cloud-security_center-v1p1beta1/snippets/security_center/create_source.rb new file mode 100644 index 000000000000..9bcf68679623 --- /dev/null +++ b/owl-bot-staging/google-cloud-security_center-v1p1beta1/snippets/security_center/create_source.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 securitycenter_v1p1beta1_generated_SecurityCenter_CreateSource_sync] +require "google/cloud/security_center/v1p1beta1" + +## +# Snippet for the create_source call in the SecurityCenter service +# +# This snippet has been automatically generated and should be regarded as a code +# template only. It will require modifications to work: +# - It may require correct/in-range values for request initialization. +# - It may require specifying regional endpoints when creating the service +# client as shown in https://cloud.google.com/ruby/docs/reference. +# +# This is an auto-generated example demonstrating basic usage of +# Google::Cloud::SecurityCenter::V1p1beta1::SecurityCenter::Client#create_source. +# +def create_source + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::SecurityCenter::V1p1beta1::SecurityCenter::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::SecurityCenter::V1p1beta1::CreateSourceRequest.new + + # Call the create_source method. + result = client.create_source request + + # The returned object is of type Google::Cloud::SecurityCenter::V1p1beta1::Source. + p result +end +# [END securitycenter_v1p1beta1_generated_SecurityCenter_CreateSource_sync] diff --git a/owl-bot-staging/google-cloud-security_center-v1p1beta1/snippets/security_center/delete_notification_config.rb b/owl-bot-staging/google-cloud-security_center-v1p1beta1/snippets/security_center/delete_notification_config.rb new file mode 100644 index 000000000000..442fcdf71d1b --- /dev/null +++ b/owl-bot-staging/google-cloud-security_center-v1p1beta1/snippets/security_center/delete_notification_config.rb @@ -0,0 +1,47 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +# [START securitycenter_v1p1beta1_generated_SecurityCenter_DeleteNotificationConfig_sync] +require "google/cloud/security_center/v1p1beta1" + +## +# Snippet for the delete_notification_config call in the SecurityCenter service +# +# This snippet has been automatically generated and should be regarded as a code +# template only. It will require modifications to work: +# - It may require correct/in-range values for request initialization. +# - It may require specifying regional endpoints when creating the service +# client as shown in https://cloud.google.com/ruby/docs/reference. +# +# This is an auto-generated example demonstrating basic usage of +# Google::Cloud::SecurityCenter::V1p1beta1::SecurityCenter::Client#delete_notification_config. +# +def delete_notification_config + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::SecurityCenter::V1p1beta1::SecurityCenter::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::SecurityCenter::V1p1beta1::DeleteNotificationConfigRequest.new + + # Call the delete_notification_config method. + result = client.delete_notification_config request + + # The returned object is of type Google::Protobuf::Empty. + p result +end +# [END securitycenter_v1p1beta1_generated_SecurityCenter_DeleteNotificationConfig_sync] diff --git a/owl-bot-staging/google-cloud-security_center-v1p1beta1/snippets/security_center/get_iam_policy.rb b/owl-bot-staging/google-cloud-security_center-v1p1beta1/snippets/security_center/get_iam_policy.rb new file mode 100644 index 000000000000..88f1888b1521 --- /dev/null +++ b/owl-bot-staging/google-cloud-security_center-v1p1beta1/snippets/security_center/get_iam_policy.rb @@ -0,0 +1,47 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +# [START securitycenter_v1p1beta1_generated_SecurityCenter_GetIamPolicy_sync] +require "google/cloud/security_center/v1p1beta1" + +## +# Snippet for the get_iam_policy call in the SecurityCenter service +# +# This snippet has been automatically generated and should be regarded as a code +# template only. It will require modifications to work: +# - It may require correct/in-range values for request initialization. +# - It may require specifying regional endpoints when creating the service +# client as shown in https://cloud.google.com/ruby/docs/reference. +# +# This is an auto-generated example demonstrating basic usage of +# Google::Cloud::SecurityCenter::V1p1beta1::SecurityCenter::Client#get_iam_policy. +# +def get_iam_policy + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::SecurityCenter::V1p1beta1::SecurityCenter::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Iam::V1::GetIamPolicyRequest.new + + # Call the get_iam_policy method. + result = client.get_iam_policy request + + # The returned object is of type Google::Iam::V1::Policy. + p result +end +# [END securitycenter_v1p1beta1_generated_SecurityCenter_GetIamPolicy_sync] diff --git a/owl-bot-staging/google-cloud-security_center-v1p1beta1/snippets/security_center/get_notification_config.rb b/owl-bot-staging/google-cloud-security_center-v1p1beta1/snippets/security_center/get_notification_config.rb new file mode 100644 index 000000000000..feaf9ce7665a --- /dev/null +++ b/owl-bot-staging/google-cloud-security_center-v1p1beta1/snippets/security_center/get_notification_config.rb @@ -0,0 +1,47 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +# [START securitycenter_v1p1beta1_generated_SecurityCenter_GetNotificationConfig_sync] +require "google/cloud/security_center/v1p1beta1" + +## +# Snippet for the get_notification_config call in the SecurityCenter service +# +# This snippet has been automatically generated and should be regarded as a code +# template only. It will require modifications to work: +# - It may require correct/in-range values for request initialization. +# - It may require specifying regional endpoints when creating the service +# client as shown in https://cloud.google.com/ruby/docs/reference. +# +# This is an auto-generated example demonstrating basic usage of +# Google::Cloud::SecurityCenter::V1p1beta1::SecurityCenter::Client#get_notification_config. +# +def get_notification_config + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::SecurityCenter::V1p1beta1::SecurityCenter::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::SecurityCenter::V1p1beta1::GetNotificationConfigRequest.new + + # Call the get_notification_config method. + result = client.get_notification_config request + + # The returned object is of type Google::Cloud::SecurityCenter::V1p1beta1::NotificationConfig. + p result +end +# [END securitycenter_v1p1beta1_generated_SecurityCenter_GetNotificationConfig_sync] diff --git a/owl-bot-staging/google-cloud-security_center-v1p1beta1/snippets/security_center/get_organization_settings.rb b/owl-bot-staging/google-cloud-security_center-v1p1beta1/snippets/security_center/get_organization_settings.rb new file mode 100644 index 000000000000..7bed3a6a574a --- /dev/null +++ b/owl-bot-staging/google-cloud-security_center-v1p1beta1/snippets/security_center/get_organization_settings.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 securitycenter_v1p1beta1_generated_SecurityCenter_GetOrganizationSettings_sync] +require "google/cloud/security_center/v1p1beta1" + +## +# Snippet for the get_organization_settings call in the SecurityCenter service +# +# This snippet has been automatically generated and should be regarded as a code +# template only. It will require modifications to work: +# - It may require correct/in-range values for request initialization. +# - It may require specifying regional endpoints when creating the service +# client as shown in https://cloud.google.com/ruby/docs/reference. +# +# This is an auto-generated example demonstrating basic usage of +# Google::Cloud::SecurityCenter::V1p1beta1::SecurityCenter::Client#get_organization_settings. +# +def get_organization_settings + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::SecurityCenter::V1p1beta1::SecurityCenter::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::SecurityCenter::V1p1beta1::GetOrganizationSettingsRequest.new + + # Call the get_organization_settings method. + result = client.get_organization_settings request + + # The returned object is of type Google::Cloud::SecurityCenter::V1p1beta1::OrganizationSettings. + p result +end +# [END securitycenter_v1p1beta1_generated_SecurityCenter_GetOrganizationSettings_sync] diff --git a/owl-bot-staging/google-cloud-security_center-v1p1beta1/snippets/security_center/get_source.rb b/owl-bot-staging/google-cloud-security_center-v1p1beta1/snippets/security_center/get_source.rb new file mode 100644 index 000000000000..9616dc30e5e4 --- /dev/null +++ b/owl-bot-staging/google-cloud-security_center-v1p1beta1/snippets/security_center/get_source.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 securitycenter_v1p1beta1_generated_SecurityCenter_GetSource_sync] +require "google/cloud/security_center/v1p1beta1" + +## +# Snippet for the get_source call in the SecurityCenter service +# +# This snippet has been automatically generated and should be regarded as a code +# template only. It will require modifications to work: +# - It may require correct/in-range values for request initialization. +# - It may require specifying regional endpoints when creating the service +# client as shown in https://cloud.google.com/ruby/docs/reference. +# +# This is an auto-generated example demonstrating basic usage of +# Google::Cloud::SecurityCenter::V1p1beta1::SecurityCenter::Client#get_source. +# +def get_source + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::SecurityCenter::V1p1beta1::SecurityCenter::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::SecurityCenter::V1p1beta1::GetSourceRequest.new + + # Call the get_source method. + result = client.get_source request + + # The returned object is of type Google::Cloud::SecurityCenter::V1p1beta1::Source. + p result +end +# [END securitycenter_v1p1beta1_generated_SecurityCenter_GetSource_sync] diff --git a/owl-bot-staging/google-cloud-security_center-v1p1beta1/snippets/security_center/group_assets.rb b/owl-bot-staging/google-cloud-security_center-v1p1beta1/snippets/security_center/group_assets.rb new file mode 100644 index 000000000000..fba016390793 --- /dev/null +++ b/owl-bot-staging/google-cloud-security_center-v1p1beta1/snippets/security_center/group_assets.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 securitycenter_v1p1beta1_generated_SecurityCenter_GroupAssets_sync] +require "google/cloud/security_center/v1p1beta1" + +## +# Snippet for the group_assets call in the SecurityCenter service +# +# This snippet has been automatically generated and should be regarded as a code +# template only. It will require modifications to work: +# - It may require correct/in-range values for request initialization. +# - It may require specifying regional endpoints when creating the service +# client as shown in https://cloud.google.com/ruby/docs/reference. +# +# This is an auto-generated example demonstrating basic usage of +# Google::Cloud::SecurityCenter::V1p1beta1::SecurityCenter::Client#group_assets. +# +def group_assets + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::SecurityCenter::V1p1beta1::SecurityCenter::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::SecurityCenter::V1p1beta1::GroupAssetsRequest.new + + # Call the group_assets method. + result = client.group_assets request + + # The returned object is of type Gapic::PagedEnumerable. You can iterate + # over elements, and API calls will be issued to fetch pages as needed. + result.each do |item| + # Each element is of type ::Google::Cloud::SecurityCenter::V1p1beta1::GroupResult. + p item + end +end +# [END securitycenter_v1p1beta1_generated_SecurityCenter_GroupAssets_sync] diff --git a/owl-bot-staging/google-cloud-security_center-v1p1beta1/snippets/security_center/group_findings.rb b/owl-bot-staging/google-cloud-security_center-v1p1beta1/snippets/security_center/group_findings.rb new file mode 100644 index 000000000000..6357692d3a5b --- /dev/null +++ b/owl-bot-staging/google-cloud-security_center-v1p1beta1/snippets/security_center/group_findings.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 securitycenter_v1p1beta1_generated_SecurityCenter_GroupFindings_sync] +require "google/cloud/security_center/v1p1beta1" + +## +# Snippet for the group_findings call in the SecurityCenter service +# +# This snippet has been automatically generated and should be regarded as a code +# template only. It will require modifications to work: +# - It may require correct/in-range values for request initialization. +# - It may require specifying regional endpoints when creating the service +# client as shown in https://cloud.google.com/ruby/docs/reference. +# +# This is an auto-generated example demonstrating basic usage of +# Google::Cloud::SecurityCenter::V1p1beta1::SecurityCenter::Client#group_findings. +# +def group_findings + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::SecurityCenter::V1p1beta1::SecurityCenter::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::SecurityCenter::V1p1beta1::GroupFindingsRequest.new + + # Call the group_findings method. + result = client.group_findings request + + # The returned object is of type Gapic::PagedEnumerable. You can iterate + # over elements, and API calls will be issued to fetch pages as needed. + result.each do |item| + # Each element is of type ::Google::Cloud::SecurityCenter::V1p1beta1::GroupResult. + p item + end +end +# [END securitycenter_v1p1beta1_generated_SecurityCenter_GroupFindings_sync] diff --git a/owl-bot-staging/google-cloud-security_center-v1p1beta1/snippets/security_center/list_assets.rb b/owl-bot-staging/google-cloud-security_center-v1p1beta1/snippets/security_center/list_assets.rb new file mode 100644 index 000000000000..9b4cfc34f62b --- /dev/null +++ b/owl-bot-staging/google-cloud-security_center-v1p1beta1/snippets/security_center/list_assets.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 securitycenter_v1p1beta1_generated_SecurityCenter_ListAssets_sync] +require "google/cloud/security_center/v1p1beta1" + +## +# Snippet for the list_assets call in the SecurityCenter service +# +# This snippet has been automatically generated and should be regarded as a code +# template only. It will require modifications to work: +# - It may require correct/in-range values for request initialization. +# - It may require specifying regional endpoints when creating the service +# client as shown in https://cloud.google.com/ruby/docs/reference. +# +# This is an auto-generated example demonstrating basic usage of +# Google::Cloud::SecurityCenter::V1p1beta1::SecurityCenter::Client#list_assets. +# +def list_assets + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::SecurityCenter::V1p1beta1::SecurityCenter::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::SecurityCenter::V1p1beta1::ListAssetsRequest.new + + # Call the list_assets method. + result = client.list_assets request + + # The returned object is of type Gapic::PagedEnumerable. You can iterate + # over elements, and API calls will be issued to fetch pages as needed. + result.each do |item| + # Each element is of type ::Google::Cloud::SecurityCenter::V1p1beta1::ListAssetsResponse::ListAssetsResult. + p item + end +end +# [END securitycenter_v1p1beta1_generated_SecurityCenter_ListAssets_sync] diff --git a/owl-bot-staging/google-cloud-security_center-v1p1beta1/snippets/security_center/list_findings.rb b/owl-bot-staging/google-cloud-security_center-v1p1beta1/snippets/security_center/list_findings.rb new file mode 100644 index 000000000000..9c8bc97942e4 --- /dev/null +++ b/owl-bot-staging/google-cloud-security_center-v1p1beta1/snippets/security_center/list_findings.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 securitycenter_v1p1beta1_generated_SecurityCenter_ListFindings_sync] +require "google/cloud/security_center/v1p1beta1" + +## +# Snippet for the list_findings call in the SecurityCenter service +# +# This snippet has been automatically generated and should be regarded as a code +# template only. It will require modifications to work: +# - It may require correct/in-range values for request initialization. +# - It may require specifying regional endpoints when creating the service +# client as shown in https://cloud.google.com/ruby/docs/reference. +# +# This is an auto-generated example demonstrating basic usage of +# Google::Cloud::SecurityCenter::V1p1beta1::SecurityCenter::Client#list_findings. +# +def list_findings + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::SecurityCenter::V1p1beta1::SecurityCenter::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::SecurityCenter::V1p1beta1::ListFindingsRequest.new + + # Call the list_findings method. + result = client.list_findings request + + # The returned object is of type Gapic::PagedEnumerable. You can iterate + # over elements, and API calls will be issued to fetch pages as needed. + result.each do |item| + # Each element is of type ::Google::Cloud::SecurityCenter::V1p1beta1::ListFindingsResponse::ListFindingsResult. + p item + end +end +# [END securitycenter_v1p1beta1_generated_SecurityCenter_ListFindings_sync] diff --git a/owl-bot-staging/google-cloud-security_center-v1p1beta1/snippets/security_center/list_notification_configs.rb b/owl-bot-staging/google-cloud-security_center-v1p1beta1/snippets/security_center/list_notification_configs.rb new file mode 100644 index 000000000000..ea961a24d957 --- /dev/null +++ b/owl-bot-staging/google-cloud-security_center-v1p1beta1/snippets/security_center/list_notification_configs.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 securitycenter_v1p1beta1_generated_SecurityCenter_ListNotificationConfigs_sync] +require "google/cloud/security_center/v1p1beta1" + +## +# Snippet for the list_notification_configs call in the SecurityCenter service +# +# This snippet has been automatically generated and should be regarded as a code +# template only. It will require modifications to work: +# - It may require correct/in-range values for request initialization. +# - It may require specifying regional endpoints when creating the service +# client as shown in https://cloud.google.com/ruby/docs/reference. +# +# This is an auto-generated example demonstrating basic usage of +# Google::Cloud::SecurityCenter::V1p1beta1::SecurityCenter::Client#list_notification_configs. +# +def list_notification_configs + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::SecurityCenter::V1p1beta1::SecurityCenter::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::SecurityCenter::V1p1beta1::ListNotificationConfigsRequest.new + + # Call the list_notification_configs method. + result = client.list_notification_configs request + + # The returned object is of type Gapic::PagedEnumerable. You can iterate + # over elements, and API calls will be issued to fetch pages as needed. + result.each do |item| + # Each element is of type ::Google::Cloud::SecurityCenter::V1p1beta1::NotificationConfig. + p item + end +end +# [END securitycenter_v1p1beta1_generated_SecurityCenter_ListNotificationConfigs_sync] diff --git a/owl-bot-staging/google-cloud-security_center-v1p1beta1/snippets/security_center/list_sources.rb b/owl-bot-staging/google-cloud-security_center-v1p1beta1/snippets/security_center/list_sources.rb new file mode 100644 index 000000000000..d87dee47b0ed --- /dev/null +++ b/owl-bot-staging/google-cloud-security_center-v1p1beta1/snippets/security_center/list_sources.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 securitycenter_v1p1beta1_generated_SecurityCenter_ListSources_sync] +require "google/cloud/security_center/v1p1beta1" + +## +# Snippet for the list_sources call in the SecurityCenter service +# +# This snippet has been automatically generated and should be regarded as a code +# template only. It will require modifications to work: +# - It may require correct/in-range values for request initialization. +# - It may require specifying regional endpoints when creating the service +# client as shown in https://cloud.google.com/ruby/docs/reference. +# +# This is an auto-generated example demonstrating basic usage of +# Google::Cloud::SecurityCenter::V1p1beta1::SecurityCenter::Client#list_sources. +# +def list_sources + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::SecurityCenter::V1p1beta1::SecurityCenter::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::SecurityCenter::V1p1beta1::ListSourcesRequest.new + + # Call the list_sources method. + result = client.list_sources request + + # The returned object is of type Gapic::PagedEnumerable. You can iterate + # over elements, and API calls will be issued to fetch pages as needed. + result.each do |item| + # Each element is of type ::Google::Cloud::SecurityCenter::V1p1beta1::Source. + p item + end +end +# [END securitycenter_v1p1beta1_generated_SecurityCenter_ListSources_sync] diff --git a/owl-bot-staging/google-cloud-security_center-v1p1beta1/snippets/security_center/run_asset_discovery.rb b/owl-bot-staging/google-cloud-security_center-v1p1beta1/snippets/security_center/run_asset_discovery.rb new file mode 100644 index 000000000000..2065af062b64 --- /dev/null +++ b/owl-bot-staging/google-cloud-security_center-v1p1beta1/snippets/security_center/run_asset_discovery.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 securitycenter_v1p1beta1_generated_SecurityCenter_RunAssetDiscovery_sync] +require "google/cloud/security_center/v1p1beta1" + +## +# Snippet for the run_asset_discovery call in the SecurityCenter service +# +# This snippet has been automatically generated and should be regarded as a code +# template only. It will require modifications to work: +# - It may require correct/in-range values for request initialization. +# - It may require specifying regional endpoints when creating the service +# client as shown in https://cloud.google.com/ruby/docs/reference. +# +# This is an auto-generated example demonstrating basic usage of +# Google::Cloud::SecurityCenter::V1p1beta1::SecurityCenter::Client#run_asset_discovery. +# +def run_asset_discovery + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::SecurityCenter::V1p1beta1::SecurityCenter::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::SecurityCenter::V1p1beta1::RunAssetDiscoveryRequest.new + + # Call the run_asset_discovery method. + result = client.run_asset_discovery 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 securitycenter_v1p1beta1_generated_SecurityCenter_RunAssetDiscovery_sync] diff --git a/owl-bot-staging/google-cloud-security_center-v1p1beta1/snippets/security_center/set_finding_state.rb b/owl-bot-staging/google-cloud-security_center-v1p1beta1/snippets/security_center/set_finding_state.rb new file mode 100644 index 000000000000..915284737f2e --- /dev/null +++ b/owl-bot-staging/google-cloud-security_center-v1p1beta1/snippets/security_center/set_finding_state.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 securitycenter_v1p1beta1_generated_SecurityCenter_SetFindingState_sync] +require "google/cloud/security_center/v1p1beta1" + +## +# Snippet for the set_finding_state call in the SecurityCenter service +# +# This snippet has been automatically generated and should be regarded as a code +# template only. It will require modifications to work: +# - It may require correct/in-range values for request initialization. +# - It may require specifying regional endpoints when creating the service +# client as shown in https://cloud.google.com/ruby/docs/reference. +# +# This is an auto-generated example demonstrating basic usage of +# Google::Cloud::SecurityCenter::V1p1beta1::SecurityCenter::Client#set_finding_state. +# +def set_finding_state + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::SecurityCenter::V1p1beta1::SecurityCenter::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::SecurityCenter::V1p1beta1::SetFindingStateRequest.new + + # Call the set_finding_state method. + result = client.set_finding_state request + + # The returned object is of type Google::Cloud::SecurityCenter::V1p1beta1::Finding. + p result +end +# [END securitycenter_v1p1beta1_generated_SecurityCenter_SetFindingState_sync] diff --git a/owl-bot-staging/google-cloud-security_center-v1p1beta1/snippets/security_center/set_iam_policy.rb b/owl-bot-staging/google-cloud-security_center-v1p1beta1/snippets/security_center/set_iam_policy.rb new file mode 100644 index 000000000000..984368e397b1 --- /dev/null +++ b/owl-bot-staging/google-cloud-security_center-v1p1beta1/snippets/security_center/set_iam_policy.rb @@ -0,0 +1,47 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +# [START securitycenter_v1p1beta1_generated_SecurityCenter_SetIamPolicy_sync] +require "google/cloud/security_center/v1p1beta1" + +## +# Snippet for the set_iam_policy call in the SecurityCenter service +# +# This snippet has been automatically generated and should be regarded as a code +# template only. It will require modifications to work: +# - It may require correct/in-range values for request initialization. +# - It may require specifying regional endpoints when creating the service +# client as shown in https://cloud.google.com/ruby/docs/reference. +# +# This is an auto-generated example demonstrating basic usage of +# Google::Cloud::SecurityCenter::V1p1beta1::SecurityCenter::Client#set_iam_policy. +# +def set_iam_policy + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::SecurityCenter::V1p1beta1::SecurityCenter::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Iam::V1::SetIamPolicyRequest.new + + # Call the set_iam_policy method. + result = client.set_iam_policy request + + # The returned object is of type Google::Iam::V1::Policy. + p result +end +# [END securitycenter_v1p1beta1_generated_SecurityCenter_SetIamPolicy_sync] diff --git a/owl-bot-staging/google-cloud-security_center-v1p1beta1/snippets/security_center/test_iam_permissions.rb b/owl-bot-staging/google-cloud-security_center-v1p1beta1/snippets/security_center/test_iam_permissions.rb new file mode 100644 index 000000000000..279ca1f58995 --- /dev/null +++ b/owl-bot-staging/google-cloud-security_center-v1p1beta1/snippets/security_center/test_iam_permissions.rb @@ -0,0 +1,47 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +# [START securitycenter_v1p1beta1_generated_SecurityCenter_TestIamPermissions_sync] +require "google/cloud/security_center/v1p1beta1" + +## +# Snippet for the test_iam_permissions call in the SecurityCenter service +# +# This snippet has been automatically generated and should be regarded as a code +# template only. It will require modifications to work: +# - It may require correct/in-range values for request initialization. +# - It may require specifying regional endpoints when creating the service +# client as shown in https://cloud.google.com/ruby/docs/reference. +# +# This is an auto-generated example demonstrating basic usage of +# Google::Cloud::SecurityCenter::V1p1beta1::SecurityCenter::Client#test_iam_permissions. +# +def test_iam_permissions + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::SecurityCenter::V1p1beta1::SecurityCenter::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Iam::V1::TestIamPermissionsRequest.new + + # Call the test_iam_permissions method. + result = client.test_iam_permissions request + + # The returned object is of type Google::Iam::V1::TestIamPermissionsResponse. + p result +end +# [END securitycenter_v1p1beta1_generated_SecurityCenter_TestIamPermissions_sync] diff --git a/owl-bot-staging/google-cloud-security_center-v1p1beta1/snippets/security_center/update_finding.rb b/owl-bot-staging/google-cloud-security_center-v1p1beta1/snippets/security_center/update_finding.rb new file mode 100644 index 000000000000..7a803d222ecc --- /dev/null +++ b/owl-bot-staging/google-cloud-security_center-v1p1beta1/snippets/security_center/update_finding.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 securitycenter_v1p1beta1_generated_SecurityCenter_UpdateFinding_sync] +require "google/cloud/security_center/v1p1beta1" + +## +# Snippet for the update_finding call in the SecurityCenter service +# +# This snippet has been automatically generated and should be regarded as a code +# template only. It will require modifications to work: +# - It may require correct/in-range values for request initialization. +# - It may require specifying regional endpoints when creating the service +# client as shown in https://cloud.google.com/ruby/docs/reference. +# +# This is an auto-generated example demonstrating basic usage of +# Google::Cloud::SecurityCenter::V1p1beta1::SecurityCenter::Client#update_finding. +# +def update_finding + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::SecurityCenter::V1p1beta1::SecurityCenter::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::SecurityCenter::V1p1beta1::UpdateFindingRequest.new + + # Call the update_finding method. + result = client.update_finding request + + # The returned object is of type Google::Cloud::SecurityCenter::V1p1beta1::Finding. + p result +end +# [END securitycenter_v1p1beta1_generated_SecurityCenter_UpdateFinding_sync] diff --git a/owl-bot-staging/google-cloud-security_center-v1p1beta1/snippets/security_center/update_notification_config.rb b/owl-bot-staging/google-cloud-security_center-v1p1beta1/snippets/security_center/update_notification_config.rb new file mode 100644 index 000000000000..6b814475d958 --- /dev/null +++ b/owl-bot-staging/google-cloud-security_center-v1p1beta1/snippets/security_center/update_notification_config.rb @@ -0,0 +1,47 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +# [START securitycenter_v1p1beta1_generated_SecurityCenter_UpdateNotificationConfig_sync] +require "google/cloud/security_center/v1p1beta1" + +## +# Snippet for the update_notification_config call in the SecurityCenter service +# +# This snippet has been automatically generated and should be regarded as a code +# template only. It will require modifications to work: +# - It may require correct/in-range values for request initialization. +# - It may require specifying regional endpoints when creating the service +# client as shown in https://cloud.google.com/ruby/docs/reference. +# +# This is an auto-generated example demonstrating basic usage of +# Google::Cloud::SecurityCenter::V1p1beta1::SecurityCenter::Client#update_notification_config. +# +def update_notification_config + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::SecurityCenter::V1p1beta1::SecurityCenter::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::SecurityCenter::V1p1beta1::UpdateNotificationConfigRequest.new + + # Call the update_notification_config method. + result = client.update_notification_config request + + # The returned object is of type Google::Cloud::SecurityCenter::V1p1beta1::NotificationConfig. + p result +end +# [END securitycenter_v1p1beta1_generated_SecurityCenter_UpdateNotificationConfig_sync] diff --git a/owl-bot-staging/google-cloud-security_center-v1p1beta1/snippets/security_center/update_organization_settings.rb b/owl-bot-staging/google-cloud-security_center-v1p1beta1/snippets/security_center/update_organization_settings.rb new file mode 100644 index 000000000000..e16bd81a9532 --- /dev/null +++ b/owl-bot-staging/google-cloud-security_center-v1p1beta1/snippets/security_center/update_organization_settings.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 securitycenter_v1p1beta1_generated_SecurityCenter_UpdateOrganizationSettings_sync] +require "google/cloud/security_center/v1p1beta1" + +## +# Snippet for the update_organization_settings call in the SecurityCenter service +# +# This snippet has been automatically generated and should be regarded as a code +# template only. It will require modifications to work: +# - It may require correct/in-range values for request initialization. +# - It may require specifying regional endpoints when creating the service +# client as shown in https://cloud.google.com/ruby/docs/reference. +# +# This is an auto-generated example demonstrating basic usage of +# Google::Cloud::SecurityCenter::V1p1beta1::SecurityCenter::Client#update_organization_settings. +# +def update_organization_settings + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::SecurityCenter::V1p1beta1::SecurityCenter::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::SecurityCenter::V1p1beta1::UpdateOrganizationSettingsRequest.new + + # Call the update_organization_settings method. + result = client.update_organization_settings request + + # The returned object is of type Google::Cloud::SecurityCenter::V1p1beta1::OrganizationSettings. + p result +end +# [END securitycenter_v1p1beta1_generated_SecurityCenter_UpdateOrganizationSettings_sync] diff --git a/owl-bot-staging/google-cloud-security_center-v1p1beta1/snippets/security_center/update_security_marks.rb b/owl-bot-staging/google-cloud-security_center-v1p1beta1/snippets/security_center/update_security_marks.rb new file mode 100644 index 000000000000..1eb75d7733ee --- /dev/null +++ b/owl-bot-staging/google-cloud-security_center-v1p1beta1/snippets/security_center/update_security_marks.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 securitycenter_v1p1beta1_generated_SecurityCenter_UpdateSecurityMarks_sync] +require "google/cloud/security_center/v1p1beta1" + +## +# Snippet for the update_security_marks call in the SecurityCenter service +# +# This snippet has been automatically generated and should be regarded as a code +# template only. It will require modifications to work: +# - It may require correct/in-range values for request initialization. +# - It may require specifying regional endpoints when creating the service +# client as shown in https://cloud.google.com/ruby/docs/reference. +# +# This is an auto-generated example demonstrating basic usage of +# Google::Cloud::SecurityCenter::V1p1beta1::SecurityCenter::Client#update_security_marks. +# +def update_security_marks + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::SecurityCenter::V1p1beta1::SecurityCenter::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::SecurityCenter::V1p1beta1::UpdateSecurityMarksRequest.new + + # Call the update_security_marks method. + result = client.update_security_marks request + + # The returned object is of type Google::Cloud::SecurityCenter::V1p1beta1::SecurityMarks. + p result +end +# [END securitycenter_v1p1beta1_generated_SecurityCenter_UpdateSecurityMarks_sync] diff --git a/owl-bot-staging/google-cloud-security_center-v1p1beta1/snippets/security_center/update_source.rb b/owl-bot-staging/google-cloud-security_center-v1p1beta1/snippets/security_center/update_source.rb new file mode 100644 index 000000000000..7bc0b249e94c --- /dev/null +++ b/owl-bot-staging/google-cloud-security_center-v1p1beta1/snippets/security_center/update_source.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 securitycenter_v1p1beta1_generated_SecurityCenter_UpdateSource_sync] +require "google/cloud/security_center/v1p1beta1" + +## +# Snippet for the update_source call in the SecurityCenter service +# +# This snippet has been automatically generated and should be regarded as a code +# template only. It will require modifications to work: +# - It may require correct/in-range values for request initialization. +# - It may require specifying regional endpoints when creating the service +# client as shown in https://cloud.google.com/ruby/docs/reference. +# +# This is an auto-generated example demonstrating basic usage of +# Google::Cloud::SecurityCenter::V1p1beta1::SecurityCenter::Client#update_source. +# +def update_source + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::SecurityCenter::V1p1beta1::SecurityCenter::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::SecurityCenter::V1p1beta1::UpdateSourceRequest.new + + # Call the update_source method. + result = client.update_source request + + # The returned object is of type Google::Cloud::SecurityCenter::V1p1beta1::Source. + p result +end +# [END securitycenter_v1p1beta1_generated_SecurityCenter_UpdateSource_sync] diff --git a/owl-bot-staging/google-cloud-security_center-v1p1beta1/snippets/snippet_metadata_google.cloud.securitycenter.v1p1beta1.json b/owl-bot-staging/google-cloud-security_center-v1p1beta1/snippets/snippet_metadata_google.cloud.securitycenter.v1p1beta1.json new file mode 100644 index 000000000000..ea07c1b867ac --- /dev/null +++ b/owl-bot-staging/google-cloud-security_center-v1p1beta1/snippets/snippet_metadata_google.cloud.securitycenter.v1p1beta1.json @@ -0,0 +1,935 @@ +{ + "client_library": { + "name": "google-cloud-security_center-v1p1beta1", + "version": "", + "language": "RUBY", + "apis": [ + { + "id": "google.cloud.securitycenter.v1p1beta1", + "version": "v1p1beta1" + } + ] + }, + "snippets": [ + { + "region_tag": "securitycenter_v1p1beta1_generated_SecurityCenter_CreateSource_sync", + "title": "Snippet for the create_source call in the SecurityCenter service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::SecurityCenter::V1p1beta1::SecurityCenter::Client#create_source.", + "file": "security_center/create_source.rb", + "language": "RUBY", + "client_method": { + "short_name": "create_source", + "full_name": "::Google::Cloud::SecurityCenter::V1p1beta1::SecurityCenter::Client#create_source", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::SecurityCenter::V1p1beta1::CreateSourceRequest", + "name": "request" + } + ], + "result_type": "::Google::Cloud::SecurityCenter::V1p1beta1::Source", + "client": { + "short_name": "SecurityCenter::Client", + "full_name": "::Google::Cloud::SecurityCenter::V1p1beta1::SecurityCenter::Client" + }, + "method": { + "short_name": "CreateSource", + "full_name": "google.cloud.securitycenter.v1p1beta1.SecurityCenter.CreateSource", + "service": { + "short_name": "SecurityCenter", + "full_name": "google.cloud.securitycenter.v1p1beta1.SecurityCenter" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 46, + "type": "FULL" + } + ] + }, + { + "region_tag": "securitycenter_v1p1beta1_generated_SecurityCenter_CreateFinding_sync", + "title": "Snippet for the create_finding call in the SecurityCenter service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::SecurityCenter::V1p1beta1::SecurityCenter::Client#create_finding.", + "file": "security_center/create_finding.rb", + "language": "RUBY", + "client_method": { + "short_name": "create_finding", + "full_name": "::Google::Cloud::SecurityCenter::V1p1beta1::SecurityCenter::Client#create_finding", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::SecurityCenter::V1p1beta1::CreateFindingRequest", + "name": "request" + } + ], + "result_type": "::Google::Cloud::SecurityCenter::V1p1beta1::Finding", + "client": { + "short_name": "SecurityCenter::Client", + "full_name": "::Google::Cloud::SecurityCenter::V1p1beta1::SecurityCenter::Client" + }, + "method": { + "short_name": "CreateFinding", + "full_name": "google.cloud.securitycenter.v1p1beta1.SecurityCenter.CreateFinding", + "service": { + "short_name": "SecurityCenter", + "full_name": "google.cloud.securitycenter.v1p1beta1.SecurityCenter" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 46, + "type": "FULL" + } + ] + }, + { + "region_tag": "securitycenter_v1p1beta1_generated_SecurityCenter_CreateNotificationConfig_sync", + "title": "Snippet for the create_notification_config call in the SecurityCenter service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::SecurityCenter::V1p1beta1::SecurityCenter::Client#create_notification_config.", + "file": "security_center/create_notification_config.rb", + "language": "RUBY", + "client_method": { + "short_name": "create_notification_config", + "full_name": "::Google::Cloud::SecurityCenter::V1p1beta1::SecurityCenter::Client#create_notification_config", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::SecurityCenter::V1p1beta1::CreateNotificationConfigRequest", + "name": "request" + } + ], + "result_type": "::Google::Cloud::SecurityCenter::V1p1beta1::NotificationConfig", + "client": { + "short_name": "SecurityCenter::Client", + "full_name": "::Google::Cloud::SecurityCenter::V1p1beta1::SecurityCenter::Client" + }, + "method": { + "short_name": "CreateNotificationConfig", + "full_name": "google.cloud.securitycenter.v1p1beta1.SecurityCenter.CreateNotificationConfig", + "service": { + "short_name": "SecurityCenter", + "full_name": "google.cloud.securitycenter.v1p1beta1.SecurityCenter" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 46, + "type": "FULL" + } + ] + }, + { + "region_tag": "securitycenter_v1p1beta1_generated_SecurityCenter_DeleteNotificationConfig_sync", + "title": "Snippet for the delete_notification_config call in the SecurityCenter service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::SecurityCenter::V1p1beta1::SecurityCenter::Client#delete_notification_config.", + "file": "security_center/delete_notification_config.rb", + "language": "RUBY", + "client_method": { + "short_name": "delete_notification_config", + "full_name": "::Google::Cloud::SecurityCenter::V1p1beta1::SecurityCenter::Client#delete_notification_config", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::SecurityCenter::V1p1beta1::DeleteNotificationConfigRequest", + "name": "request" + } + ], + "result_type": "::Google::Protobuf::Empty", + "client": { + "short_name": "SecurityCenter::Client", + "full_name": "::Google::Cloud::SecurityCenter::V1p1beta1::SecurityCenter::Client" + }, + "method": { + "short_name": "DeleteNotificationConfig", + "full_name": "google.cloud.securitycenter.v1p1beta1.SecurityCenter.DeleteNotificationConfig", + "service": { + "short_name": "SecurityCenter", + "full_name": "google.cloud.securitycenter.v1p1beta1.SecurityCenter" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 46, + "type": "FULL" + } + ] + }, + { + "region_tag": "securitycenter_v1p1beta1_generated_SecurityCenter_GetIamPolicy_sync", + "title": "Snippet for the get_iam_policy call in the SecurityCenter service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::SecurityCenter::V1p1beta1::SecurityCenter::Client#get_iam_policy.", + "file": "security_center/get_iam_policy.rb", + "language": "RUBY", + "client_method": { + "short_name": "get_iam_policy", + "full_name": "::Google::Cloud::SecurityCenter::V1p1beta1::SecurityCenter::Client#get_iam_policy", + "async": false, + "parameters": [ + { + "type": "::Google::Iam::V1::GetIamPolicyRequest", + "name": "request" + } + ], + "result_type": "::Google::Iam::V1::Policy", + "client": { + "short_name": "SecurityCenter::Client", + "full_name": "::Google::Cloud::SecurityCenter::V1p1beta1::SecurityCenter::Client" + }, + "method": { + "short_name": "GetIamPolicy", + "full_name": "google.cloud.securitycenter.v1p1beta1.SecurityCenter.GetIamPolicy", + "service": { + "short_name": "SecurityCenter", + "full_name": "google.cloud.securitycenter.v1p1beta1.SecurityCenter" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 46, + "type": "FULL" + } + ] + }, + { + "region_tag": "securitycenter_v1p1beta1_generated_SecurityCenter_GetNotificationConfig_sync", + "title": "Snippet for the get_notification_config call in the SecurityCenter service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::SecurityCenter::V1p1beta1::SecurityCenter::Client#get_notification_config.", + "file": "security_center/get_notification_config.rb", + "language": "RUBY", + "client_method": { + "short_name": "get_notification_config", + "full_name": "::Google::Cloud::SecurityCenter::V1p1beta1::SecurityCenter::Client#get_notification_config", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::SecurityCenter::V1p1beta1::GetNotificationConfigRequest", + "name": "request" + } + ], + "result_type": "::Google::Cloud::SecurityCenter::V1p1beta1::NotificationConfig", + "client": { + "short_name": "SecurityCenter::Client", + "full_name": "::Google::Cloud::SecurityCenter::V1p1beta1::SecurityCenter::Client" + }, + "method": { + "short_name": "GetNotificationConfig", + "full_name": "google.cloud.securitycenter.v1p1beta1.SecurityCenter.GetNotificationConfig", + "service": { + "short_name": "SecurityCenter", + "full_name": "google.cloud.securitycenter.v1p1beta1.SecurityCenter" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 46, + "type": "FULL" + } + ] + }, + { + "region_tag": "securitycenter_v1p1beta1_generated_SecurityCenter_GetOrganizationSettings_sync", + "title": "Snippet for the get_organization_settings call in the SecurityCenter service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::SecurityCenter::V1p1beta1::SecurityCenter::Client#get_organization_settings.", + "file": "security_center/get_organization_settings.rb", + "language": "RUBY", + "client_method": { + "short_name": "get_organization_settings", + "full_name": "::Google::Cloud::SecurityCenter::V1p1beta1::SecurityCenter::Client#get_organization_settings", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::SecurityCenter::V1p1beta1::GetOrganizationSettingsRequest", + "name": "request" + } + ], + "result_type": "::Google::Cloud::SecurityCenter::V1p1beta1::OrganizationSettings", + "client": { + "short_name": "SecurityCenter::Client", + "full_name": "::Google::Cloud::SecurityCenter::V1p1beta1::SecurityCenter::Client" + }, + "method": { + "short_name": "GetOrganizationSettings", + "full_name": "google.cloud.securitycenter.v1p1beta1.SecurityCenter.GetOrganizationSettings", + "service": { + "short_name": "SecurityCenter", + "full_name": "google.cloud.securitycenter.v1p1beta1.SecurityCenter" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 46, + "type": "FULL" + } + ] + }, + { + "region_tag": "securitycenter_v1p1beta1_generated_SecurityCenter_GetSource_sync", + "title": "Snippet for the get_source call in the SecurityCenter service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::SecurityCenter::V1p1beta1::SecurityCenter::Client#get_source.", + "file": "security_center/get_source.rb", + "language": "RUBY", + "client_method": { + "short_name": "get_source", + "full_name": "::Google::Cloud::SecurityCenter::V1p1beta1::SecurityCenter::Client#get_source", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::SecurityCenter::V1p1beta1::GetSourceRequest", + "name": "request" + } + ], + "result_type": "::Google::Cloud::SecurityCenter::V1p1beta1::Source", + "client": { + "short_name": "SecurityCenter::Client", + "full_name": "::Google::Cloud::SecurityCenter::V1p1beta1::SecurityCenter::Client" + }, + "method": { + "short_name": "GetSource", + "full_name": "google.cloud.securitycenter.v1p1beta1.SecurityCenter.GetSource", + "service": { + "short_name": "SecurityCenter", + "full_name": "google.cloud.securitycenter.v1p1beta1.SecurityCenter" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 46, + "type": "FULL" + } + ] + }, + { + "region_tag": "securitycenter_v1p1beta1_generated_SecurityCenter_GroupAssets_sync", + "title": "Snippet for the group_assets call in the SecurityCenter service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::SecurityCenter::V1p1beta1::SecurityCenter::Client#group_assets.", + "file": "security_center/group_assets.rb", + "language": "RUBY", + "client_method": { + "short_name": "group_assets", + "full_name": "::Google::Cloud::SecurityCenter::V1p1beta1::SecurityCenter::Client#group_assets", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::SecurityCenter::V1p1beta1::GroupAssetsRequest", + "name": "request" + } + ], + "result_type": "::Google::Cloud::SecurityCenter::V1p1beta1::GroupAssetsResponse", + "client": { + "short_name": "SecurityCenter::Client", + "full_name": "::Google::Cloud::SecurityCenter::V1p1beta1::SecurityCenter::Client" + }, + "method": { + "short_name": "GroupAssets", + "full_name": "google.cloud.securitycenter.v1p1beta1.SecurityCenter.GroupAssets", + "service": { + "short_name": "SecurityCenter", + "full_name": "google.cloud.securitycenter.v1p1beta1.SecurityCenter" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 50, + "type": "FULL" + } + ] + }, + { + "region_tag": "securitycenter_v1p1beta1_generated_SecurityCenter_GroupFindings_sync", + "title": "Snippet for the group_findings call in the SecurityCenter service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::SecurityCenter::V1p1beta1::SecurityCenter::Client#group_findings.", + "file": "security_center/group_findings.rb", + "language": "RUBY", + "client_method": { + "short_name": "group_findings", + "full_name": "::Google::Cloud::SecurityCenter::V1p1beta1::SecurityCenter::Client#group_findings", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::SecurityCenter::V1p1beta1::GroupFindingsRequest", + "name": "request" + } + ], + "result_type": "::Google::Cloud::SecurityCenter::V1p1beta1::GroupFindingsResponse", + "client": { + "short_name": "SecurityCenter::Client", + "full_name": "::Google::Cloud::SecurityCenter::V1p1beta1::SecurityCenter::Client" + }, + "method": { + "short_name": "GroupFindings", + "full_name": "google.cloud.securitycenter.v1p1beta1.SecurityCenter.GroupFindings", + "service": { + "short_name": "SecurityCenter", + "full_name": "google.cloud.securitycenter.v1p1beta1.SecurityCenter" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 50, + "type": "FULL" + } + ] + }, + { + "region_tag": "securitycenter_v1p1beta1_generated_SecurityCenter_ListAssets_sync", + "title": "Snippet for the list_assets call in the SecurityCenter service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::SecurityCenter::V1p1beta1::SecurityCenter::Client#list_assets.", + "file": "security_center/list_assets.rb", + "language": "RUBY", + "client_method": { + "short_name": "list_assets", + "full_name": "::Google::Cloud::SecurityCenter::V1p1beta1::SecurityCenter::Client#list_assets", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::SecurityCenter::V1p1beta1::ListAssetsRequest", + "name": "request" + } + ], + "result_type": "::Google::Cloud::SecurityCenter::V1p1beta1::ListAssetsResponse", + "client": { + "short_name": "SecurityCenter::Client", + "full_name": "::Google::Cloud::SecurityCenter::V1p1beta1::SecurityCenter::Client" + }, + "method": { + "short_name": "ListAssets", + "full_name": "google.cloud.securitycenter.v1p1beta1.SecurityCenter.ListAssets", + "service": { + "short_name": "SecurityCenter", + "full_name": "google.cloud.securitycenter.v1p1beta1.SecurityCenter" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 50, + "type": "FULL" + } + ] + }, + { + "region_tag": "securitycenter_v1p1beta1_generated_SecurityCenter_ListFindings_sync", + "title": "Snippet for the list_findings call in the SecurityCenter service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::SecurityCenter::V1p1beta1::SecurityCenter::Client#list_findings.", + "file": "security_center/list_findings.rb", + "language": "RUBY", + "client_method": { + "short_name": "list_findings", + "full_name": "::Google::Cloud::SecurityCenter::V1p1beta1::SecurityCenter::Client#list_findings", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::SecurityCenter::V1p1beta1::ListFindingsRequest", + "name": "request" + } + ], + "result_type": "::Google::Cloud::SecurityCenter::V1p1beta1::ListFindingsResponse", + "client": { + "short_name": "SecurityCenter::Client", + "full_name": "::Google::Cloud::SecurityCenter::V1p1beta1::SecurityCenter::Client" + }, + "method": { + "short_name": "ListFindings", + "full_name": "google.cloud.securitycenter.v1p1beta1.SecurityCenter.ListFindings", + "service": { + "short_name": "SecurityCenter", + "full_name": "google.cloud.securitycenter.v1p1beta1.SecurityCenter" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 50, + "type": "FULL" + } + ] + }, + { + "region_tag": "securitycenter_v1p1beta1_generated_SecurityCenter_ListNotificationConfigs_sync", + "title": "Snippet for the list_notification_configs call in the SecurityCenter service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::SecurityCenter::V1p1beta1::SecurityCenter::Client#list_notification_configs.", + "file": "security_center/list_notification_configs.rb", + "language": "RUBY", + "client_method": { + "short_name": "list_notification_configs", + "full_name": "::Google::Cloud::SecurityCenter::V1p1beta1::SecurityCenter::Client#list_notification_configs", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::SecurityCenter::V1p1beta1::ListNotificationConfigsRequest", + "name": "request" + } + ], + "result_type": "::Google::Cloud::SecurityCenter::V1p1beta1::ListNotificationConfigsResponse", + "client": { + "short_name": "SecurityCenter::Client", + "full_name": "::Google::Cloud::SecurityCenter::V1p1beta1::SecurityCenter::Client" + }, + "method": { + "short_name": "ListNotificationConfigs", + "full_name": "google.cloud.securitycenter.v1p1beta1.SecurityCenter.ListNotificationConfigs", + "service": { + "short_name": "SecurityCenter", + "full_name": "google.cloud.securitycenter.v1p1beta1.SecurityCenter" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 50, + "type": "FULL" + } + ] + }, + { + "region_tag": "securitycenter_v1p1beta1_generated_SecurityCenter_ListSources_sync", + "title": "Snippet for the list_sources call in the SecurityCenter service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::SecurityCenter::V1p1beta1::SecurityCenter::Client#list_sources.", + "file": "security_center/list_sources.rb", + "language": "RUBY", + "client_method": { + "short_name": "list_sources", + "full_name": "::Google::Cloud::SecurityCenter::V1p1beta1::SecurityCenter::Client#list_sources", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::SecurityCenter::V1p1beta1::ListSourcesRequest", + "name": "request" + } + ], + "result_type": "::Google::Cloud::SecurityCenter::V1p1beta1::ListSourcesResponse", + "client": { + "short_name": "SecurityCenter::Client", + "full_name": "::Google::Cloud::SecurityCenter::V1p1beta1::SecurityCenter::Client" + }, + "method": { + "short_name": "ListSources", + "full_name": "google.cloud.securitycenter.v1p1beta1.SecurityCenter.ListSources", + "service": { + "short_name": "SecurityCenter", + "full_name": "google.cloud.securitycenter.v1p1beta1.SecurityCenter" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 50, + "type": "FULL" + } + ] + }, + { + "region_tag": "securitycenter_v1p1beta1_generated_SecurityCenter_RunAssetDiscovery_sync", + "title": "Snippet for the run_asset_discovery call in the SecurityCenter service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::SecurityCenter::V1p1beta1::SecurityCenter::Client#run_asset_discovery.", + "file": "security_center/run_asset_discovery.rb", + "language": "RUBY", + "client_method": { + "short_name": "run_asset_discovery", + "full_name": "::Google::Cloud::SecurityCenter::V1p1beta1::SecurityCenter::Client#run_asset_discovery", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::SecurityCenter::V1p1beta1::RunAssetDiscoveryRequest", + "name": "request" + } + ], + "result_type": "::Google::Longrunning::Operation", + "client": { + "short_name": "SecurityCenter::Client", + "full_name": "::Google::Cloud::SecurityCenter::V1p1beta1::SecurityCenter::Client" + }, + "method": { + "short_name": "RunAssetDiscovery", + "full_name": "google.cloud.securitycenter.v1p1beta1.SecurityCenter.RunAssetDiscovery", + "service": { + "short_name": "SecurityCenter", + "full_name": "google.cloud.securitycenter.v1p1beta1.SecurityCenter" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 53, + "type": "FULL" + } + ] + }, + { + "region_tag": "securitycenter_v1p1beta1_generated_SecurityCenter_SetFindingState_sync", + "title": "Snippet for the set_finding_state call in the SecurityCenter service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::SecurityCenter::V1p1beta1::SecurityCenter::Client#set_finding_state.", + "file": "security_center/set_finding_state.rb", + "language": "RUBY", + "client_method": { + "short_name": "set_finding_state", + "full_name": "::Google::Cloud::SecurityCenter::V1p1beta1::SecurityCenter::Client#set_finding_state", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::SecurityCenter::V1p1beta1::SetFindingStateRequest", + "name": "request" + } + ], + "result_type": "::Google::Cloud::SecurityCenter::V1p1beta1::Finding", + "client": { + "short_name": "SecurityCenter::Client", + "full_name": "::Google::Cloud::SecurityCenter::V1p1beta1::SecurityCenter::Client" + }, + "method": { + "short_name": "SetFindingState", + "full_name": "google.cloud.securitycenter.v1p1beta1.SecurityCenter.SetFindingState", + "service": { + "short_name": "SecurityCenter", + "full_name": "google.cloud.securitycenter.v1p1beta1.SecurityCenter" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 46, + "type": "FULL" + } + ] + }, + { + "region_tag": "securitycenter_v1p1beta1_generated_SecurityCenter_SetIamPolicy_sync", + "title": "Snippet for the set_iam_policy call in the SecurityCenter service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::SecurityCenter::V1p1beta1::SecurityCenter::Client#set_iam_policy.", + "file": "security_center/set_iam_policy.rb", + "language": "RUBY", + "client_method": { + "short_name": "set_iam_policy", + "full_name": "::Google::Cloud::SecurityCenter::V1p1beta1::SecurityCenter::Client#set_iam_policy", + "async": false, + "parameters": [ + { + "type": "::Google::Iam::V1::SetIamPolicyRequest", + "name": "request" + } + ], + "result_type": "::Google::Iam::V1::Policy", + "client": { + "short_name": "SecurityCenter::Client", + "full_name": "::Google::Cloud::SecurityCenter::V1p1beta1::SecurityCenter::Client" + }, + "method": { + "short_name": "SetIamPolicy", + "full_name": "google.cloud.securitycenter.v1p1beta1.SecurityCenter.SetIamPolicy", + "service": { + "short_name": "SecurityCenter", + "full_name": "google.cloud.securitycenter.v1p1beta1.SecurityCenter" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 46, + "type": "FULL" + } + ] + }, + { + "region_tag": "securitycenter_v1p1beta1_generated_SecurityCenter_TestIamPermissions_sync", + "title": "Snippet for the test_iam_permissions call in the SecurityCenter service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::SecurityCenter::V1p1beta1::SecurityCenter::Client#test_iam_permissions.", + "file": "security_center/test_iam_permissions.rb", + "language": "RUBY", + "client_method": { + "short_name": "test_iam_permissions", + "full_name": "::Google::Cloud::SecurityCenter::V1p1beta1::SecurityCenter::Client#test_iam_permissions", + "async": false, + "parameters": [ + { + "type": "::Google::Iam::V1::TestIamPermissionsRequest", + "name": "request" + } + ], + "result_type": "::Google::Iam::V1::TestIamPermissionsResponse", + "client": { + "short_name": "SecurityCenter::Client", + "full_name": "::Google::Cloud::SecurityCenter::V1p1beta1::SecurityCenter::Client" + }, + "method": { + "short_name": "TestIamPermissions", + "full_name": "google.cloud.securitycenter.v1p1beta1.SecurityCenter.TestIamPermissions", + "service": { + "short_name": "SecurityCenter", + "full_name": "google.cloud.securitycenter.v1p1beta1.SecurityCenter" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 46, + "type": "FULL" + } + ] + }, + { + "region_tag": "securitycenter_v1p1beta1_generated_SecurityCenter_UpdateFinding_sync", + "title": "Snippet for the update_finding call in the SecurityCenter service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::SecurityCenter::V1p1beta1::SecurityCenter::Client#update_finding.", + "file": "security_center/update_finding.rb", + "language": "RUBY", + "client_method": { + "short_name": "update_finding", + "full_name": "::Google::Cloud::SecurityCenter::V1p1beta1::SecurityCenter::Client#update_finding", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::SecurityCenter::V1p1beta1::UpdateFindingRequest", + "name": "request" + } + ], + "result_type": "::Google::Cloud::SecurityCenter::V1p1beta1::Finding", + "client": { + "short_name": "SecurityCenter::Client", + "full_name": "::Google::Cloud::SecurityCenter::V1p1beta1::SecurityCenter::Client" + }, + "method": { + "short_name": "UpdateFinding", + "full_name": "google.cloud.securitycenter.v1p1beta1.SecurityCenter.UpdateFinding", + "service": { + "short_name": "SecurityCenter", + "full_name": "google.cloud.securitycenter.v1p1beta1.SecurityCenter" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 46, + "type": "FULL" + } + ] + }, + { + "region_tag": "securitycenter_v1p1beta1_generated_SecurityCenter_UpdateNotificationConfig_sync", + "title": "Snippet for the update_notification_config call in the SecurityCenter service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::SecurityCenter::V1p1beta1::SecurityCenter::Client#update_notification_config.", + "file": "security_center/update_notification_config.rb", + "language": "RUBY", + "client_method": { + "short_name": "update_notification_config", + "full_name": "::Google::Cloud::SecurityCenter::V1p1beta1::SecurityCenter::Client#update_notification_config", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::SecurityCenter::V1p1beta1::UpdateNotificationConfigRequest", + "name": "request" + } + ], + "result_type": "::Google::Cloud::SecurityCenter::V1p1beta1::NotificationConfig", + "client": { + "short_name": "SecurityCenter::Client", + "full_name": "::Google::Cloud::SecurityCenter::V1p1beta1::SecurityCenter::Client" + }, + "method": { + "short_name": "UpdateNotificationConfig", + "full_name": "google.cloud.securitycenter.v1p1beta1.SecurityCenter.UpdateNotificationConfig", + "service": { + "short_name": "SecurityCenter", + "full_name": "google.cloud.securitycenter.v1p1beta1.SecurityCenter" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 46, + "type": "FULL" + } + ] + }, + { + "region_tag": "securitycenter_v1p1beta1_generated_SecurityCenter_UpdateOrganizationSettings_sync", + "title": "Snippet for the update_organization_settings call in the SecurityCenter service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::SecurityCenter::V1p1beta1::SecurityCenter::Client#update_organization_settings.", + "file": "security_center/update_organization_settings.rb", + "language": "RUBY", + "client_method": { + "short_name": "update_organization_settings", + "full_name": "::Google::Cloud::SecurityCenter::V1p1beta1::SecurityCenter::Client#update_organization_settings", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::SecurityCenter::V1p1beta1::UpdateOrganizationSettingsRequest", + "name": "request" + } + ], + "result_type": "::Google::Cloud::SecurityCenter::V1p1beta1::OrganizationSettings", + "client": { + "short_name": "SecurityCenter::Client", + "full_name": "::Google::Cloud::SecurityCenter::V1p1beta1::SecurityCenter::Client" + }, + "method": { + "short_name": "UpdateOrganizationSettings", + "full_name": "google.cloud.securitycenter.v1p1beta1.SecurityCenter.UpdateOrganizationSettings", + "service": { + "short_name": "SecurityCenter", + "full_name": "google.cloud.securitycenter.v1p1beta1.SecurityCenter" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 46, + "type": "FULL" + } + ] + }, + { + "region_tag": "securitycenter_v1p1beta1_generated_SecurityCenter_UpdateSource_sync", + "title": "Snippet for the update_source call in the SecurityCenter service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::SecurityCenter::V1p1beta1::SecurityCenter::Client#update_source.", + "file": "security_center/update_source.rb", + "language": "RUBY", + "client_method": { + "short_name": "update_source", + "full_name": "::Google::Cloud::SecurityCenter::V1p1beta1::SecurityCenter::Client#update_source", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::SecurityCenter::V1p1beta1::UpdateSourceRequest", + "name": "request" + } + ], + "result_type": "::Google::Cloud::SecurityCenter::V1p1beta1::Source", + "client": { + "short_name": "SecurityCenter::Client", + "full_name": "::Google::Cloud::SecurityCenter::V1p1beta1::SecurityCenter::Client" + }, + "method": { + "short_name": "UpdateSource", + "full_name": "google.cloud.securitycenter.v1p1beta1.SecurityCenter.UpdateSource", + "service": { + "short_name": "SecurityCenter", + "full_name": "google.cloud.securitycenter.v1p1beta1.SecurityCenter" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 46, + "type": "FULL" + } + ] + }, + { + "region_tag": "securitycenter_v1p1beta1_generated_SecurityCenter_UpdateSecurityMarks_sync", + "title": "Snippet for the update_security_marks call in the SecurityCenter service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::SecurityCenter::V1p1beta1::SecurityCenter::Client#update_security_marks.", + "file": "security_center/update_security_marks.rb", + "language": "RUBY", + "client_method": { + "short_name": "update_security_marks", + "full_name": "::Google::Cloud::SecurityCenter::V1p1beta1::SecurityCenter::Client#update_security_marks", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::SecurityCenter::V1p1beta1::UpdateSecurityMarksRequest", + "name": "request" + } + ], + "result_type": "::Google::Cloud::SecurityCenter::V1p1beta1::SecurityMarks", + "client": { + "short_name": "SecurityCenter::Client", + "full_name": "::Google::Cloud::SecurityCenter::V1p1beta1::SecurityCenter::Client" + }, + "method": { + "short_name": "UpdateSecurityMarks", + "full_name": "google.cloud.securitycenter.v1p1beta1.SecurityCenter.UpdateSecurityMarks", + "service": { + "short_name": "SecurityCenter", + "full_name": "google.cloud.securitycenter.v1p1beta1.SecurityCenter" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 46, + "type": "FULL" + } + ] + } + ] +} \ No newline at end of file diff --git a/owl-bot-staging/google-cloud-security_center-v1p1beta1/test/google/cloud/security_center/v1p1beta1/security_center_operations_test.rb b/owl-bot-staging/google-cloud-security_center-v1p1beta1/test/google/cloud/security_center/v1p1beta1/security_center_operations_test.rb new file mode 100644 index 000000000000..610375d6c599 --- /dev/null +++ b/owl-bot-staging/google-cloud-security_center-v1p1beta1/test/google/cloud/security_center/v1p1beta1/security_center_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/cloud/securitycenter/v1p1beta1/securitycenter_service_pb" +require "google/cloud/securitycenter/v1p1beta1/securitycenter_service_services_pb" +require "google/cloud/security_center/v1p1beta1/security_center" + +class ::Google::Cloud::SecurityCenter::V1p1beta1::SecurityCenter::OperationsTest < Minitest::Test + class ClientStub + attr_accessor :call_rpc_count, :requests + + def initialize response, operation, &block + @response = response + @operation = operation + @block = block + @call_rpc_count = 0 + @requests = [] + end + + def call_rpc *args, **kwargs + @call_rpc_count += 1 + + @requests << @block&.call(*args, **kwargs) + + catch :response do + yield @response, @operation if block_given? + @response + end + end + + def endpoint + "endpoint.example.com" + end + + def universe_domain + "example.com" + end + + def stub_logger + nil + end + + def logger + nil + end + end + + def test_list_operations + # Create GRPC objects. + grpc_response = ::Google::Longrunning::ListOperationsResponse.new + grpc_operation = GRPC::ActiveCall::Operation.new nil + grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + grpc_options = {} + + # Create request parameters for a unary method. + name = "hello world" + filter = "hello world" + page_size = 42 + page_token = "hello world" + return_partial_success = true + + list_operations_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :list_operations, name + assert_kind_of ::Google::Longrunning::ListOperationsRequest, request + assert_equal "hello world", request["name"] + assert_equal "hello world", request["filter"] + assert_equal 42, request["page_size"] + assert_equal "hello world", request["page_token"] + assert_equal true, request["return_partial_success"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, list_operations_client_stub do + # Create client + client = ::Google::Cloud::SecurityCenter::V1p1beta1::SecurityCenter::Operations.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.list_operations({ name: name, filter: filter, page_size: page_size, page_token: page_token, return_partial_success: return_partial_success }) do |response, operation| + assert_kind_of Gapic::PagedEnumerable, response + assert_equal grpc_response, response.response + assert_equal grpc_operation, operation + end + + # Use named arguments + client.list_operations name: name, filter: filter, page_size: page_size, page_token: page_token, return_partial_success: return_partial_success do |response, operation| + assert_kind_of Gapic::PagedEnumerable, response + assert_equal grpc_response, response.response + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.list_operations ::Google::Longrunning::ListOperationsRequest.new(name: name, filter: filter, page_size: page_size, page_token: page_token, return_partial_success: return_partial_success) do |response, operation| + assert_kind_of Gapic::PagedEnumerable, response + assert_equal grpc_response, response.response + assert_equal grpc_operation, operation + end + + # Use hash object with options + client.list_operations({ name: name, filter: filter, page_size: page_size, page_token: page_token, return_partial_success: return_partial_success }, grpc_options) do |response, operation| + assert_kind_of Gapic::PagedEnumerable, response + assert_equal grpc_response, response.response + assert_equal grpc_operation, operation + end + + # Use protobuf object with options + client.list_operations(::Google::Longrunning::ListOperationsRequest.new(name: name, filter: filter, page_size: page_size, page_token: page_token, return_partial_success: return_partial_success), grpc_options) do |response, operation| + assert_kind_of Gapic::PagedEnumerable, response + assert_equal grpc_response, response.response + assert_equal grpc_operation, operation + end + + # Verify method calls + assert_equal 5, list_operations_client_stub.call_rpc_count + end + end + + def test_get_operation + # Create GRPC objects. + grpc_response = ::Google::Longrunning::Operation.new + grpc_operation = GRPC::ActiveCall::Operation.new nil + grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + grpc_options = {} + + # Create request parameters for a unary method. + name = "hello world" + + get_operation_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :get_operation, name + assert_kind_of ::Google::Longrunning::GetOperationRequest, request + assert_equal "hello world", request["name"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, get_operation_client_stub do + # Create client + client = ::Google::Cloud::SecurityCenter::V1p1beta1::SecurityCenter::Operations.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.get_operation({ name: name }) do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Use named arguments + client.get_operation name: name do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.get_operation ::Google::Longrunning::GetOperationRequest.new(name: name) do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Use hash object with options + client.get_operation({ name: name }, grpc_options) do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Use protobuf object with options + client.get_operation(::Google::Longrunning::GetOperationRequest.new(name: name), grpc_options) do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Verify method calls + assert_equal 5, get_operation_client_stub.call_rpc_count + end + end + + def test_delete_operation + # Create GRPC objects. + grpc_response = ::Google::Protobuf::Empty.new + grpc_operation = GRPC::ActiveCall::Operation.new nil + grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + grpc_options = {} + + # Create request parameters for a unary method. + name = "hello world" + + delete_operation_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :delete_operation, name + assert_kind_of ::Google::Longrunning::DeleteOperationRequest, request + assert_equal "hello world", request["name"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, delete_operation_client_stub do + # Create client + client = ::Google::Cloud::SecurityCenter::V1p1beta1::SecurityCenter::Operations.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.delete_operation({ name: name }) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use named arguments + client.delete_operation name: name do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.delete_operation ::Google::Longrunning::DeleteOperationRequest.new(name: name) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use hash object with options + client.delete_operation({ name: name }, grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object with options + client.delete_operation(::Google::Longrunning::DeleteOperationRequest.new(name: name), grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Verify method calls + assert_equal 5, delete_operation_client_stub.call_rpc_count + end + end + + def test_cancel_operation + # Create GRPC objects. + grpc_response = ::Google::Protobuf::Empty.new + grpc_operation = GRPC::ActiveCall::Operation.new nil + grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + grpc_options = {} + + # Create request parameters for a unary method. + name = "hello world" + + cancel_operation_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :cancel_operation, name + assert_kind_of ::Google::Longrunning::CancelOperationRequest, request + assert_equal "hello world", request["name"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, cancel_operation_client_stub do + # Create client + client = ::Google::Cloud::SecurityCenter::V1p1beta1::SecurityCenter::Operations.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.cancel_operation({ name: name }) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use named arguments + client.cancel_operation name: name do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.cancel_operation ::Google::Longrunning::CancelOperationRequest.new(name: name) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use hash object with options + client.cancel_operation({ name: name }, grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object with options + client.cancel_operation(::Google::Longrunning::CancelOperationRequest.new(name: name), grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Verify method calls + assert_equal 5, cancel_operation_client_stub.call_rpc_count + end + end + + def test_wait_operation + # Create GRPC objects. + grpc_response = ::Google::Longrunning::Operation.new + grpc_operation = GRPC::ActiveCall::Operation.new nil + grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + grpc_options = {} + + # Create request parameters for a unary method. + name = "hello world" + timeout = {} + + wait_operation_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :wait_operation, name + assert_kind_of ::Google::Longrunning::WaitOperationRequest, request + assert_equal "hello world", request["name"] + assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Protobuf::Duration), request["timeout"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, wait_operation_client_stub do + # Create client + client = ::Google::Cloud::SecurityCenter::V1p1beta1::SecurityCenter::Operations.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.wait_operation({ name: name, timeout: timeout }) do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Use named arguments + client.wait_operation name: name, timeout: timeout do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.wait_operation ::Google::Longrunning::WaitOperationRequest.new(name: name, timeout: timeout) do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Use hash object with options + client.wait_operation({ name: name, timeout: timeout }, grpc_options) do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Use protobuf object with options + client.wait_operation(::Google::Longrunning::WaitOperationRequest.new(name: name, timeout: timeout), grpc_options) do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Verify method calls + assert_equal 5, wait_operation_client_stub.call_rpc_count + end + end + + def test_configure + grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + + client = block_config = config = nil + dummy_stub = ClientStub.new nil, nil + Gapic::ServiceStub.stub :new, dummy_stub do + client = ::Google::Cloud::SecurityCenter::V1p1beta1::SecurityCenter::Operations.new do |config| + config.credentials = grpc_channel + end + end + + config = client.configure do |c| + block_config = c + end + + assert_same block_config, config + assert_kind_of ::Google::Cloud::SecurityCenter::V1p1beta1::SecurityCenter::Operations::Configuration, config + end +end diff --git a/owl-bot-staging/google-cloud-security_center-v1p1beta1/test/google/cloud/security_center/v1p1beta1/security_center_paths_test.rb b/owl-bot-staging/google-cloud-security_center-v1p1beta1/test/google/cloud/security_center/v1p1beta1/security_center_paths_test.rb new file mode 100644 index 000000000000..346d4e4ee6d3 --- /dev/null +++ b/owl-bot-staging/google-cloud-security_center-v1p1beta1/test/google/cloud/security_center/v1p1beta1/security_center_paths_test.rb @@ -0,0 +1,178 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +require "helper" + +require "gapic/grpc/service_stub" + +require "google/cloud/security_center/v1p1beta1/security_center" + +class ::Google::Cloud::SecurityCenter::V1p1beta1::SecurityCenter::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_finding_path + grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + ::Gapic::ServiceStub.stub :new, DummyStub.new do + client = ::Google::Cloud::SecurityCenter::V1p1beta1::SecurityCenter::Client.new do |config| + config.credentials = grpc_channel + end + + path = client.finding_path organization: "value0", source: "value1", finding: "value2" + assert_equal "organizations/value0/sources/value1/findings/value2", path + + path = client.finding_path folder: "value0", source: "value1", finding: "value2" + assert_equal "folders/value0/sources/value1/findings/value2", path + + path = client.finding_path project: "value0", source: "value1", finding: "value2" + assert_equal "projects/value0/sources/value1/findings/value2", path + end + end + + def test_folder_path + grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + ::Gapic::ServiceStub.stub :new, DummyStub.new do + client = ::Google::Cloud::SecurityCenter::V1p1beta1::SecurityCenter::Client.new do |config| + config.credentials = grpc_channel + end + + path = client.folder_path folder: "value0" + assert_equal "folders/value0", path + end + end + + def test_notification_config_path + grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + ::Gapic::ServiceStub.stub :new, DummyStub.new do + client = ::Google::Cloud::SecurityCenter::V1p1beta1::SecurityCenter::Client.new do |config| + config.credentials = grpc_channel + end + + path = client.notification_config_path organization: "value0", notification_config: "value1" + assert_equal "organizations/value0/notificationConfigs/value1", path + end + end + + def test_organization_path + grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + ::Gapic::ServiceStub.stub :new, DummyStub.new do + client = ::Google::Cloud::SecurityCenter::V1p1beta1::SecurityCenter::Client.new do |config| + config.credentials = grpc_channel + end + + path = client.organization_path organization: "value0" + assert_equal "organizations/value0", path + end + end + + def test_organization_settings_path + grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + ::Gapic::ServiceStub.stub :new, DummyStub.new do + client = ::Google::Cloud::SecurityCenter::V1p1beta1::SecurityCenter::Client.new do |config| + config.credentials = grpc_channel + end + + path = client.organization_settings_path organization: "value0" + assert_equal "organizations/value0/organizationSettings", path + end + end + + def test_project_path + grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + ::Gapic::ServiceStub.stub :new, DummyStub.new do + client = ::Google::Cloud::SecurityCenter::V1p1beta1::SecurityCenter::Client.new do |config| + config.credentials = grpc_channel + end + + path = client.project_path project: "value0" + assert_equal "projects/value0", path + end + end + + def test_security_marks_path + grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + ::Gapic::ServiceStub.stub :new, DummyStub.new do + client = ::Google::Cloud::SecurityCenter::V1p1beta1::SecurityCenter::Client.new do |config| + config.credentials = grpc_channel + end + + path = client.security_marks_path organization: "value0", asset: "value1" + assert_equal "organizations/value0/assets/value1/securityMarks", path + + path = client.security_marks_path organization: "value0", source: "value1", finding: "value2" + assert_equal "organizations/value0/sources/value1/findings/value2/securityMarks", path + + path = client.security_marks_path folder: "value0", asset: "value1" + assert_equal "folders/value0/assets/value1/securityMarks", path + + path = client.security_marks_path project: "value0", asset: "value1" + assert_equal "projects/value0/assets/value1/securityMarks", path + + path = client.security_marks_path folder: "value0", source: "value1", finding: "value2" + assert_equal "folders/value0/sources/value1/findings/value2/securityMarks", path + + path = client.security_marks_path project: "value0", source: "value1", finding: "value2" + assert_equal "projects/value0/sources/value1/findings/value2/securityMarks", path + end + end + + def test_source_path + grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + ::Gapic::ServiceStub.stub :new, DummyStub.new do + client = ::Google::Cloud::SecurityCenter::V1p1beta1::SecurityCenter::Client.new do |config| + config.credentials = grpc_channel + end + + path = client.source_path organization: "value0", source: "value1" + assert_equal "organizations/value0/sources/value1", path + + path = client.source_path folder: "value0", source: "value1" + assert_equal "folders/value0/sources/value1", path + + path = client.source_path project: "value0", source: "value1" + assert_equal "projects/value0/sources/value1", path + end + end + + def test_topic_path + grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + ::Gapic::ServiceStub.stub :new, DummyStub.new do + client = ::Google::Cloud::SecurityCenter::V1p1beta1::SecurityCenter::Client.new do |config| + config.credentials = grpc_channel + end + + path = client.topic_path project: "value0", topic: "value1" + assert_equal "projects/value0/topics/value1", path + end + end +end diff --git a/owl-bot-staging/google-cloud-security_center-v1p1beta1/test/google/cloud/security_center/v1p1beta1/security_center_rest_test.rb b/owl-bot-staging/google-cloud-security_center-v1p1beta1/test/google/cloud/security_center/v1p1beta1/security_center_rest_test.rb new file mode 100644 index 000000000000..31510db961ae --- /dev/null +++ b/owl-bot-staging/google-cloud-security_center-v1p1beta1/test/google/cloud/security_center/v1p1beta1/security_center_rest_test.rb @@ -0,0 +1,1388 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +require "helper" +require "gapic/rest" +require "google/cloud/securitycenter/v1p1beta1/securitycenter_service_pb" +require "google/cloud/security_center/v1p1beta1/security_center/rest" + + +class ::Google::Cloud::SecurityCenter::V1p1beta1::SecurityCenter::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_source + # Create test objects. + client_result = ::Google::Cloud::SecurityCenter::V1p1beta1::Source.new + http_response = OpenStruct.new body: client_result.to_json + + call_options = {} + + # Create request parameters for a unary method. + parent = "hello world" + source = {} + + create_source_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| + assert options.metadata.key? :"x-goog-api-client" + assert options.metadata[:"x-goog-api-client"].include? "rest" + refute options.metadata[:"x-goog-api-client"].include? "grpc" + end + + ::Google::Cloud::SecurityCenter::V1p1beta1::SecurityCenter::Rest::ServiceStub.stub :transcode_create_source_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, create_source_client_stub do + # Create client + client = ::Google::Cloud::SecurityCenter::V1p1beta1::SecurityCenter::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.create_source({ parent: parent, source: source }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.create_source parent: parent, source: source do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.create_source ::Google::Cloud::SecurityCenter::V1p1beta1::CreateSourceRequest.new(parent: parent, source: source) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + client.create_source({ parent: parent, source: source }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + client.create_source(::Google::Cloud::SecurityCenter::V1p1beta1::CreateSourceRequest.new(parent: parent, source: source), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, create_source_client_stub.call_count + end + end + end + + def test_create_finding + # Create test objects. + client_result = ::Google::Cloud::SecurityCenter::V1p1beta1::Finding.new + http_response = OpenStruct.new body: client_result.to_json + + call_options = {} + + # Create request parameters for a unary method. + parent = "hello world" + finding_id = "hello world" + finding = {} + + create_finding_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| + assert options.metadata.key? :"x-goog-api-client" + assert options.metadata[:"x-goog-api-client"].include? "rest" + refute options.metadata[:"x-goog-api-client"].include? "grpc" + end + + ::Google::Cloud::SecurityCenter::V1p1beta1::SecurityCenter::Rest::ServiceStub.stub :transcode_create_finding_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, create_finding_client_stub do + # Create client + client = ::Google::Cloud::SecurityCenter::V1p1beta1::SecurityCenter::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.create_finding({ parent: parent, finding_id: finding_id, finding: finding }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.create_finding parent: parent, finding_id: finding_id, finding: finding do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.create_finding ::Google::Cloud::SecurityCenter::V1p1beta1::CreateFindingRequest.new(parent: parent, finding_id: finding_id, finding: finding) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + client.create_finding({ parent: parent, finding_id: finding_id, finding: finding }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + client.create_finding(::Google::Cloud::SecurityCenter::V1p1beta1::CreateFindingRequest.new(parent: parent, finding_id: finding_id, finding: finding), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, create_finding_client_stub.call_count + end + end + end + + def test_create_notification_config + # Create test objects. + client_result = ::Google::Cloud::SecurityCenter::V1p1beta1::NotificationConfig.new + http_response = OpenStruct.new body: client_result.to_json + + call_options = {} + + # Create request parameters for a unary method. + parent = "hello world" + config_id = "hello world" + notification_config = {} + + create_notification_config_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| + assert options.metadata.key? :"x-goog-api-client" + assert options.metadata[:"x-goog-api-client"].include? "rest" + refute options.metadata[:"x-goog-api-client"].include? "grpc" + end + + ::Google::Cloud::SecurityCenter::V1p1beta1::SecurityCenter::Rest::ServiceStub.stub :transcode_create_notification_config_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, create_notification_config_client_stub do + # Create client + client = ::Google::Cloud::SecurityCenter::V1p1beta1::SecurityCenter::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.create_notification_config({ parent: parent, config_id: config_id, notification_config: notification_config }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.create_notification_config parent: parent, config_id: config_id, notification_config: notification_config do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.create_notification_config ::Google::Cloud::SecurityCenter::V1p1beta1::CreateNotificationConfigRequest.new(parent: parent, config_id: config_id, notification_config: notification_config) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + client.create_notification_config({ parent: parent, config_id: config_id, notification_config: notification_config }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + client.create_notification_config(::Google::Cloud::SecurityCenter::V1p1beta1::CreateNotificationConfigRequest.new(parent: parent, config_id: config_id, notification_config: notification_config), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, create_notification_config_client_stub.call_count + end + end + end + + def test_delete_notification_config + # Create test objects. + client_result = ::Google::Protobuf::Empty.new + http_response = OpenStruct.new body: client_result.to_json + + call_options = {} + + # Create request parameters for a unary method. + name = "hello world" + + delete_notification_config_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| + assert options.metadata.key? :"x-goog-api-client" + assert options.metadata[:"x-goog-api-client"].include? "rest" + refute options.metadata[:"x-goog-api-client"].include? "grpc" + end + + ::Google::Cloud::SecurityCenter::V1p1beta1::SecurityCenter::Rest::ServiceStub.stub :transcode_delete_notification_config_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, delete_notification_config_client_stub do + # Create client + client = ::Google::Cloud::SecurityCenter::V1p1beta1::SecurityCenter::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.delete_notification_config({ name: name }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.delete_notification_config name: name do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.delete_notification_config ::Google::Cloud::SecurityCenter::V1p1beta1::DeleteNotificationConfigRequest.new(name: name) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + client.delete_notification_config({ name: name }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + client.delete_notification_config(::Google::Cloud::SecurityCenter::V1p1beta1::DeleteNotificationConfigRequest.new(name: name), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, delete_notification_config_client_stub.call_count + end + end + end + + def test_get_iam_policy + # Create test objects. + client_result = ::Google::Iam::V1::Policy.new + http_response = OpenStruct.new body: client_result.to_json + + call_options = {} + + # Create request parameters for a unary method. + resource = "hello world" + options = {} + + get_iam_policy_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| + assert options.metadata.key? :"x-goog-api-client" + assert options.metadata[:"x-goog-api-client"].include? "rest" + refute options.metadata[:"x-goog-api-client"].include? "grpc" + end + + ::Google::Cloud::SecurityCenter::V1p1beta1::SecurityCenter::Rest::ServiceStub.stub :transcode_get_iam_policy_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, get_iam_policy_client_stub do + # Create client + client = ::Google::Cloud::SecurityCenter::V1p1beta1::SecurityCenter::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.get_iam_policy({ resource: resource, options: options }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.get_iam_policy resource: resource, options: options do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.get_iam_policy ::Google::Iam::V1::GetIamPolicyRequest.new(resource: resource, options: options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + client.get_iam_policy({ resource: resource, options: options }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + client.get_iam_policy(::Google::Iam::V1::GetIamPolicyRequest.new(resource: resource, options: options), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, get_iam_policy_client_stub.call_count + end + end + end + + def test_get_notification_config + # Create test objects. + client_result = ::Google::Cloud::SecurityCenter::V1p1beta1::NotificationConfig.new + http_response = OpenStruct.new body: client_result.to_json + + call_options = {} + + # Create request parameters for a unary method. + name = "hello world" + + get_notification_config_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| + assert options.metadata.key? :"x-goog-api-client" + assert options.metadata[:"x-goog-api-client"].include? "rest" + refute options.metadata[:"x-goog-api-client"].include? "grpc" + end + + ::Google::Cloud::SecurityCenter::V1p1beta1::SecurityCenter::Rest::ServiceStub.stub :transcode_get_notification_config_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, get_notification_config_client_stub do + # Create client + client = ::Google::Cloud::SecurityCenter::V1p1beta1::SecurityCenter::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.get_notification_config({ name: name }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.get_notification_config name: name do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.get_notification_config ::Google::Cloud::SecurityCenter::V1p1beta1::GetNotificationConfigRequest.new(name: name) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + client.get_notification_config({ name: name }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + client.get_notification_config(::Google::Cloud::SecurityCenter::V1p1beta1::GetNotificationConfigRequest.new(name: name), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, get_notification_config_client_stub.call_count + end + end + end + + def test_get_organization_settings + # Create test objects. + client_result = ::Google::Cloud::SecurityCenter::V1p1beta1::OrganizationSettings.new + http_response = OpenStruct.new body: client_result.to_json + + call_options = {} + + # Create request parameters for a unary method. + name = "hello world" + + get_organization_settings_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| + assert options.metadata.key? :"x-goog-api-client" + assert options.metadata[:"x-goog-api-client"].include? "rest" + refute options.metadata[:"x-goog-api-client"].include? "grpc" + end + + ::Google::Cloud::SecurityCenter::V1p1beta1::SecurityCenter::Rest::ServiceStub.stub :transcode_get_organization_settings_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, get_organization_settings_client_stub do + # Create client + client = ::Google::Cloud::SecurityCenter::V1p1beta1::SecurityCenter::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.get_organization_settings({ name: name }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.get_organization_settings name: name do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.get_organization_settings ::Google::Cloud::SecurityCenter::V1p1beta1::GetOrganizationSettingsRequest.new(name: name) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + client.get_organization_settings({ name: name }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + client.get_organization_settings(::Google::Cloud::SecurityCenter::V1p1beta1::GetOrganizationSettingsRequest.new(name: name), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, get_organization_settings_client_stub.call_count + end + end + end + + def test_get_source + # Create test objects. + client_result = ::Google::Cloud::SecurityCenter::V1p1beta1::Source.new + http_response = OpenStruct.new body: client_result.to_json + + call_options = {} + + # Create request parameters for a unary method. + name = "hello world" + + get_source_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| + assert options.metadata.key? :"x-goog-api-client" + assert options.metadata[:"x-goog-api-client"].include? "rest" + refute options.metadata[:"x-goog-api-client"].include? "grpc" + end + + ::Google::Cloud::SecurityCenter::V1p1beta1::SecurityCenter::Rest::ServiceStub.stub :transcode_get_source_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, get_source_client_stub do + # Create client + client = ::Google::Cloud::SecurityCenter::V1p1beta1::SecurityCenter::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.get_source({ name: name }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.get_source name: name do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.get_source ::Google::Cloud::SecurityCenter::V1p1beta1::GetSourceRequest.new(name: name) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + client.get_source({ name: name }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + client.get_source(::Google::Cloud::SecurityCenter::V1p1beta1::GetSourceRequest.new(name: name), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, get_source_client_stub.call_count + end + end + end + + def test_group_assets + # Create test objects. + client_result = ::Google::Cloud::SecurityCenter::V1p1beta1::GroupAssetsResponse.new + http_response = OpenStruct.new body: client_result.to_json + + call_options = {} + + # Create request parameters for a unary method. + parent = "hello world" + filter = "hello world" + group_by = "hello world" + compare_duration = {} + read_time = {} + page_token = "hello world" + page_size = 42 + + group_assets_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| + assert options.metadata.key? :"x-goog-api-client" + assert options.metadata[:"x-goog-api-client"].include? "rest" + refute options.metadata[:"x-goog-api-client"].include? "grpc" + end + + ::Google::Cloud::SecurityCenter::V1p1beta1::SecurityCenter::Rest::ServiceStub.stub :transcode_group_assets_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, group_assets_client_stub do + # Create client + client = ::Google::Cloud::SecurityCenter::V1p1beta1::SecurityCenter::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.group_assets({ parent: parent, filter: filter, group_by: group_by, compare_duration: compare_duration, read_time: read_time, page_token: page_token, page_size: page_size }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.group_assets parent: parent, filter: filter, group_by: group_by, compare_duration: compare_duration, read_time: read_time, page_token: page_token, page_size: page_size do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.group_assets ::Google::Cloud::SecurityCenter::V1p1beta1::GroupAssetsRequest.new(parent: parent, filter: filter, group_by: group_by, compare_duration: compare_duration, read_time: read_time, page_token: page_token, page_size: page_size) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + client.group_assets({ parent: parent, filter: filter, group_by: group_by, compare_duration: compare_duration, read_time: read_time, page_token: page_token, page_size: page_size }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + client.group_assets(::Google::Cloud::SecurityCenter::V1p1beta1::GroupAssetsRequest.new(parent: parent, filter: filter, group_by: group_by, compare_duration: compare_duration, read_time: read_time, page_token: page_token, page_size: page_size), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, group_assets_client_stub.call_count + end + end + end + + def test_group_findings + # Create test objects. + client_result = ::Google::Cloud::SecurityCenter::V1p1beta1::GroupFindingsResponse.new + http_response = OpenStruct.new body: client_result.to_json + + call_options = {} + + # Create request parameters for a unary method. + parent = "hello world" + filter = "hello world" + group_by = "hello world" + read_time = {} + compare_duration = {} + page_token = "hello world" + page_size = 42 + + group_findings_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| + assert options.metadata.key? :"x-goog-api-client" + assert options.metadata[:"x-goog-api-client"].include? "rest" + refute options.metadata[:"x-goog-api-client"].include? "grpc" + end + + ::Google::Cloud::SecurityCenter::V1p1beta1::SecurityCenter::Rest::ServiceStub.stub :transcode_group_findings_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, group_findings_client_stub do + # Create client + client = ::Google::Cloud::SecurityCenter::V1p1beta1::SecurityCenter::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.group_findings({ parent: parent, filter: filter, group_by: group_by, read_time: read_time, compare_duration: compare_duration, page_token: page_token, page_size: page_size }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.group_findings parent: parent, filter: filter, group_by: group_by, read_time: read_time, compare_duration: compare_duration, page_token: page_token, page_size: page_size do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.group_findings ::Google::Cloud::SecurityCenter::V1p1beta1::GroupFindingsRequest.new(parent: parent, filter: filter, group_by: group_by, read_time: read_time, compare_duration: compare_duration, page_token: page_token, page_size: page_size) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + client.group_findings({ parent: parent, filter: filter, group_by: group_by, read_time: read_time, compare_duration: compare_duration, page_token: page_token, page_size: page_size }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + client.group_findings(::Google::Cloud::SecurityCenter::V1p1beta1::GroupFindingsRequest.new(parent: parent, filter: filter, group_by: group_by, read_time: read_time, compare_duration: compare_duration, page_token: page_token, page_size: page_size), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, group_findings_client_stub.call_count + end + end + end + + def test_list_assets + # Create test objects. + client_result = ::Google::Cloud::SecurityCenter::V1p1beta1::ListAssetsResponse.new + http_response = OpenStruct.new body: client_result.to_json + + call_options = {} + + # Create request parameters for a unary method. + parent = "hello world" + filter = "hello world" + order_by = "hello world" + read_time = {} + compare_duration = {} + field_mask = {} + page_token = "hello world" + page_size = 42 + + list_assets_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| + assert options.metadata.key? :"x-goog-api-client" + assert options.metadata[:"x-goog-api-client"].include? "rest" + refute options.metadata[:"x-goog-api-client"].include? "grpc" + end + + ::Google::Cloud::SecurityCenter::V1p1beta1::SecurityCenter::Rest::ServiceStub.stub :transcode_list_assets_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, list_assets_client_stub do + # Create client + client = ::Google::Cloud::SecurityCenter::V1p1beta1::SecurityCenter::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.list_assets({ parent: parent, filter: filter, order_by: order_by, read_time: read_time, compare_duration: compare_duration, field_mask: field_mask, page_token: page_token, page_size: page_size }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.list_assets parent: parent, filter: filter, order_by: order_by, read_time: read_time, compare_duration: compare_duration, field_mask: field_mask, page_token: page_token, page_size: page_size do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.list_assets ::Google::Cloud::SecurityCenter::V1p1beta1::ListAssetsRequest.new(parent: parent, filter: filter, order_by: order_by, read_time: read_time, compare_duration: compare_duration, field_mask: field_mask, page_token: page_token, page_size: page_size) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + client.list_assets({ parent: parent, filter: filter, order_by: order_by, read_time: read_time, compare_duration: compare_duration, field_mask: field_mask, page_token: page_token, page_size: page_size }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + client.list_assets(::Google::Cloud::SecurityCenter::V1p1beta1::ListAssetsRequest.new(parent: parent, filter: filter, order_by: order_by, read_time: read_time, compare_duration: compare_duration, field_mask: field_mask, page_token: page_token, page_size: page_size), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, list_assets_client_stub.call_count + end + end + end + + def test_list_findings + # Create test objects. + client_result = ::Google::Cloud::SecurityCenter::V1p1beta1::ListFindingsResponse.new + http_response = OpenStruct.new body: client_result.to_json + + call_options = {} + + # Create request parameters for a unary method. + parent = "hello world" + filter = "hello world" + order_by = "hello world" + read_time = {} + compare_duration = {} + field_mask = {} + page_token = "hello world" + page_size = 42 + + list_findings_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| + assert options.metadata.key? :"x-goog-api-client" + assert options.metadata[:"x-goog-api-client"].include? "rest" + refute options.metadata[:"x-goog-api-client"].include? "grpc" + end + + ::Google::Cloud::SecurityCenter::V1p1beta1::SecurityCenter::Rest::ServiceStub.stub :transcode_list_findings_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, list_findings_client_stub do + # Create client + client = ::Google::Cloud::SecurityCenter::V1p1beta1::SecurityCenter::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.list_findings({ parent: parent, filter: filter, order_by: order_by, read_time: read_time, compare_duration: compare_duration, field_mask: field_mask, page_token: page_token, page_size: page_size }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.list_findings parent: parent, filter: filter, order_by: order_by, read_time: read_time, compare_duration: compare_duration, field_mask: field_mask, page_token: page_token, page_size: page_size do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.list_findings ::Google::Cloud::SecurityCenter::V1p1beta1::ListFindingsRequest.new(parent: parent, filter: filter, order_by: order_by, read_time: read_time, compare_duration: compare_duration, field_mask: field_mask, page_token: page_token, page_size: page_size) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + client.list_findings({ parent: parent, filter: filter, order_by: order_by, read_time: read_time, compare_duration: compare_duration, field_mask: field_mask, page_token: page_token, page_size: page_size }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + client.list_findings(::Google::Cloud::SecurityCenter::V1p1beta1::ListFindingsRequest.new(parent: parent, filter: filter, order_by: order_by, read_time: read_time, compare_duration: compare_duration, field_mask: field_mask, page_token: page_token, page_size: page_size), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, list_findings_client_stub.call_count + end + end + end + + def test_list_notification_configs + # Create test objects. + client_result = ::Google::Cloud::SecurityCenter::V1p1beta1::ListNotificationConfigsResponse.new + http_response = OpenStruct.new body: client_result.to_json + + call_options = {} + + # Create request parameters for a unary method. + parent = "hello world" + page_token = "hello world" + page_size = 42 + + list_notification_configs_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| + assert options.metadata.key? :"x-goog-api-client" + assert options.metadata[:"x-goog-api-client"].include? "rest" + refute options.metadata[:"x-goog-api-client"].include? "grpc" + end + + ::Google::Cloud::SecurityCenter::V1p1beta1::SecurityCenter::Rest::ServiceStub.stub :transcode_list_notification_configs_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, list_notification_configs_client_stub do + # Create client + client = ::Google::Cloud::SecurityCenter::V1p1beta1::SecurityCenter::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.list_notification_configs({ parent: parent, page_token: page_token, page_size: page_size }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.list_notification_configs parent: parent, page_token: page_token, page_size: page_size do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.list_notification_configs ::Google::Cloud::SecurityCenter::V1p1beta1::ListNotificationConfigsRequest.new(parent: parent, page_token: page_token, page_size: page_size) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + client.list_notification_configs({ parent: parent, page_token: page_token, page_size: page_size }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + client.list_notification_configs(::Google::Cloud::SecurityCenter::V1p1beta1::ListNotificationConfigsRequest.new(parent: parent, page_token: page_token, page_size: page_size), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, list_notification_configs_client_stub.call_count + end + end + end + + def test_list_sources + # Create test objects. + client_result = ::Google::Cloud::SecurityCenter::V1p1beta1::ListSourcesResponse.new + http_response = OpenStruct.new body: client_result.to_json + + call_options = {} + + # Create request parameters for a unary method. + parent = "hello world" + page_token = "hello world" + page_size = 42 + + list_sources_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| + assert options.metadata.key? :"x-goog-api-client" + assert options.metadata[:"x-goog-api-client"].include? "rest" + refute options.metadata[:"x-goog-api-client"].include? "grpc" + end + + ::Google::Cloud::SecurityCenter::V1p1beta1::SecurityCenter::Rest::ServiceStub.stub :transcode_list_sources_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, list_sources_client_stub do + # Create client + client = ::Google::Cloud::SecurityCenter::V1p1beta1::SecurityCenter::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.list_sources({ parent: parent, page_token: page_token, page_size: page_size }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.list_sources parent: parent, page_token: page_token, page_size: page_size do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.list_sources ::Google::Cloud::SecurityCenter::V1p1beta1::ListSourcesRequest.new(parent: parent, page_token: page_token, page_size: page_size) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + client.list_sources({ parent: parent, page_token: page_token, page_size: page_size }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + client.list_sources(::Google::Cloud::SecurityCenter::V1p1beta1::ListSourcesRequest.new(parent: parent, page_token: page_token, page_size: page_size), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, list_sources_client_stub.call_count + end + end + end + + def test_run_asset_discovery + # 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" + + run_asset_discovery_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| + assert options.metadata.key? :"x-goog-api-client" + assert options.metadata[:"x-goog-api-client"].include? "rest" + refute options.metadata[:"x-goog-api-client"].include? "grpc" + end + + ::Google::Cloud::SecurityCenter::V1p1beta1::SecurityCenter::Rest::ServiceStub.stub :transcode_run_asset_discovery_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, run_asset_discovery_client_stub do + # Create client + client = ::Google::Cloud::SecurityCenter::V1p1beta1::SecurityCenter::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.run_asset_discovery({ parent: parent }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.run_asset_discovery parent: parent do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.run_asset_discovery ::Google::Cloud::SecurityCenter::V1p1beta1::RunAssetDiscoveryRequest.new(parent: parent) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + client.run_asset_discovery({ parent: parent }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + client.run_asset_discovery(::Google::Cloud::SecurityCenter::V1p1beta1::RunAssetDiscoveryRequest.new(parent: parent), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, run_asset_discovery_client_stub.call_count + end + end + end + + def test_set_finding_state + # Create test objects. + client_result = ::Google::Cloud::SecurityCenter::V1p1beta1::Finding.new + http_response = OpenStruct.new body: client_result.to_json + + call_options = {} + + # Create request parameters for a unary method. + name = "hello world" + state = :STATE_UNSPECIFIED + start_time = {} + + set_finding_state_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| + assert options.metadata.key? :"x-goog-api-client" + assert options.metadata[:"x-goog-api-client"].include? "rest" + refute options.metadata[:"x-goog-api-client"].include? "grpc" + end + + ::Google::Cloud::SecurityCenter::V1p1beta1::SecurityCenter::Rest::ServiceStub.stub :transcode_set_finding_state_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, set_finding_state_client_stub do + # Create client + client = ::Google::Cloud::SecurityCenter::V1p1beta1::SecurityCenter::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.set_finding_state({ name: name, state: state, start_time: start_time }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.set_finding_state name: name, state: state, start_time: start_time do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.set_finding_state ::Google::Cloud::SecurityCenter::V1p1beta1::SetFindingStateRequest.new(name: name, state: state, start_time: start_time) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + client.set_finding_state({ name: name, state: state, start_time: start_time }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + client.set_finding_state(::Google::Cloud::SecurityCenter::V1p1beta1::SetFindingStateRequest.new(name: name, state: state, start_time: start_time), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, set_finding_state_client_stub.call_count + end + end + end + + def test_set_iam_policy + # Create test objects. + client_result = ::Google::Iam::V1::Policy.new + http_response = OpenStruct.new body: client_result.to_json + + call_options = {} + + # Create request parameters for a unary method. + resource = "hello world" + policy = {} + update_mask = {} + + set_iam_policy_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| + assert options.metadata.key? :"x-goog-api-client" + assert options.metadata[:"x-goog-api-client"].include? "rest" + refute options.metadata[:"x-goog-api-client"].include? "grpc" + end + + ::Google::Cloud::SecurityCenter::V1p1beta1::SecurityCenter::Rest::ServiceStub.stub :transcode_set_iam_policy_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, set_iam_policy_client_stub do + # Create client + client = ::Google::Cloud::SecurityCenter::V1p1beta1::SecurityCenter::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.set_iam_policy({ resource: resource, policy: policy, update_mask: update_mask }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.set_iam_policy resource: resource, policy: policy, update_mask: update_mask do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.set_iam_policy ::Google::Iam::V1::SetIamPolicyRequest.new(resource: resource, policy: policy, update_mask: update_mask) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + client.set_iam_policy({ resource: resource, policy: policy, update_mask: update_mask }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + client.set_iam_policy(::Google::Iam::V1::SetIamPolicyRequest.new(resource: resource, policy: policy, update_mask: update_mask), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, set_iam_policy_client_stub.call_count + end + end + end + + def test_test_iam_permissions + # Create test objects. + client_result = ::Google::Iam::V1::TestIamPermissionsResponse.new + http_response = OpenStruct.new body: client_result.to_json + + call_options = {} + + # Create request parameters for a unary method. + resource = "hello world" + permissions = ["hello world"] + + test_iam_permissions_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| + assert options.metadata.key? :"x-goog-api-client" + assert options.metadata[:"x-goog-api-client"].include? "rest" + refute options.metadata[:"x-goog-api-client"].include? "grpc" + end + + ::Google::Cloud::SecurityCenter::V1p1beta1::SecurityCenter::Rest::ServiceStub.stub :transcode_test_iam_permissions_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, test_iam_permissions_client_stub do + # Create client + client = ::Google::Cloud::SecurityCenter::V1p1beta1::SecurityCenter::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.test_iam_permissions({ resource: resource, permissions: permissions }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.test_iam_permissions resource: resource, permissions: permissions do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.test_iam_permissions ::Google::Iam::V1::TestIamPermissionsRequest.new(resource: resource, permissions: permissions) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + client.test_iam_permissions({ resource: resource, permissions: permissions }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + client.test_iam_permissions(::Google::Iam::V1::TestIamPermissionsRequest.new(resource: resource, permissions: permissions), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, test_iam_permissions_client_stub.call_count + end + end + end + + def test_update_finding + # Create test objects. + client_result = ::Google::Cloud::SecurityCenter::V1p1beta1::Finding.new + http_response = OpenStruct.new body: client_result.to_json + + call_options = {} + + # Create request parameters for a unary method. + finding = {} + update_mask = {} + + update_finding_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| + assert options.metadata.key? :"x-goog-api-client" + assert options.metadata[:"x-goog-api-client"].include? "rest" + refute options.metadata[:"x-goog-api-client"].include? "grpc" + end + + ::Google::Cloud::SecurityCenter::V1p1beta1::SecurityCenter::Rest::ServiceStub.stub :transcode_update_finding_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, update_finding_client_stub do + # Create client + client = ::Google::Cloud::SecurityCenter::V1p1beta1::SecurityCenter::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.update_finding({ finding: finding, update_mask: update_mask }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.update_finding finding: finding, update_mask: update_mask do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.update_finding ::Google::Cloud::SecurityCenter::V1p1beta1::UpdateFindingRequest.new(finding: finding, update_mask: update_mask) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + client.update_finding({ finding: finding, update_mask: update_mask }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + client.update_finding(::Google::Cloud::SecurityCenter::V1p1beta1::UpdateFindingRequest.new(finding: finding, update_mask: update_mask), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, update_finding_client_stub.call_count + end + end + end + + def test_update_notification_config + # Create test objects. + client_result = ::Google::Cloud::SecurityCenter::V1p1beta1::NotificationConfig.new + http_response = OpenStruct.new body: client_result.to_json + + call_options = {} + + # Create request parameters for a unary method. + notification_config = {} + update_mask = {} + + update_notification_config_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| + assert options.metadata.key? :"x-goog-api-client" + assert options.metadata[:"x-goog-api-client"].include? "rest" + refute options.metadata[:"x-goog-api-client"].include? "grpc" + end + + ::Google::Cloud::SecurityCenter::V1p1beta1::SecurityCenter::Rest::ServiceStub.stub :transcode_update_notification_config_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, update_notification_config_client_stub do + # Create client + client = ::Google::Cloud::SecurityCenter::V1p1beta1::SecurityCenter::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.update_notification_config({ notification_config: notification_config, update_mask: update_mask }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.update_notification_config notification_config: notification_config, update_mask: update_mask do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.update_notification_config ::Google::Cloud::SecurityCenter::V1p1beta1::UpdateNotificationConfigRequest.new(notification_config: notification_config, update_mask: update_mask) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + client.update_notification_config({ notification_config: notification_config, update_mask: update_mask }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + client.update_notification_config(::Google::Cloud::SecurityCenter::V1p1beta1::UpdateNotificationConfigRequest.new(notification_config: notification_config, update_mask: update_mask), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, update_notification_config_client_stub.call_count + end + end + end + + def test_update_organization_settings + # Create test objects. + client_result = ::Google::Cloud::SecurityCenter::V1p1beta1::OrganizationSettings.new + http_response = OpenStruct.new body: client_result.to_json + + call_options = {} + + # Create request parameters for a unary method. + organization_settings = {} + update_mask = {} + + update_organization_settings_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| + assert options.metadata.key? :"x-goog-api-client" + assert options.metadata[:"x-goog-api-client"].include? "rest" + refute options.metadata[:"x-goog-api-client"].include? "grpc" + end + + ::Google::Cloud::SecurityCenter::V1p1beta1::SecurityCenter::Rest::ServiceStub.stub :transcode_update_organization_settings_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, update_organization_settings_client_stub do + # Create client + client = ::Google::Cloud::SecurityCenter::V1p1beta1::SecurityCenter::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.update_organization_settings({ organization_settings: organization_settings, update_mask: update_mask }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.update_organization_settings organization_settings: organization_settings, update_mask: update_mask do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.update_organization_settings ::Google::Cloud::SecurityCenter::V1p1beta1::UpdateOrganizationSettingsRequest.new(organization_settings: organization_settings, update_mask: update_mask) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + client.update_organization_settings({ organization_settings: organization_settings, update_mask: update_mask }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + client.update_organization_settings(::Google::Cloud::SecurityCenter::V1p1beta1::UpdateOrganizationSettingsRequest.new(organization_settings: organization_settings, update_mask: update_mask), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, update_organization_settings_client_stub.call_count + end + end + end + + def test_update_source + # Create test objects. + client_result = ::Google::Cloud::SecurityCenter::V1p1beta1::Source.new + http_response = OpenStruct.new body: client_result.to_json + + call_options = {} + + # Create request parameters for a unary method. + source = {} + update_mask = {} + + update_source_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| + assert options.metadata.key? :"x-goog-api-client" + assert options.metadata[:"x-goog-api-client"].include? "rest" + refute options.metadata[:"x-goog-api-client"].include? "grpc" + end + + ::Google::Cloud::SecurityCenter::V1p1beta1::SecurityCenter::Rest::ServiceStub.stub :transcode_update_source_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, update_source_client_stub do + # Create client + client = ::Google::Cloud::SecurityCenter::V1p1beta1::SecurityCenter::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.update_source({ source: source, update_mask: update_mask }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.update_source source: source, update_mask: update_mask do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.update_source ::Google::Cloud::SecurityCenter::V1p1beta1::UpdateSourceRequest.new(source: source, update_mask: update_mask) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + client.update_source({ source: source, update_mask: update_mask }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + client.update_source(::Google::Cloud::SecurityCenter::V1p1beta1::UpdateSourceRequest.new(source: source, update_mask: update_mask), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, update_source_client_stub.call_count + end + end + end + + def test_update_security_marks + # Create test objects. + client_result = ::Google::Cloud::SecurityCenter::V1p1beta1::SecurityMarks.new + http_response = OpenStruct.new body: client_result.to_json + + call_options = {} + + # Create request parameters for a unary method. + security_marks = {} + update_mask = {} + start_time = {} + + update_security_marks_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| + assert options.metadata.key? :"x-goog-api-client" + assert options.metadata[:"x-goog-api-client"].include? "rest" + refute options.metadata[:"x-goog-api-client"].include? "grpc" + end + + ::Google::Cloud::SecurityCenter::V1p1beta1::SecurityCenter::Rest::ServiceStub.stub :transcode_update_security_marks_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, update_security_marks_client_stub do + # Create client + client = ::Google::Cloud::SecurityCenter::V1p1beta1::SecurityCenter::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.update_security_marks({ security_marks: security_marks, update_mask: update_mask, start_time: start_time }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.update_security_marks security_marks: security_marks, update_mask: update_mask, start_time: start_time do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.update_security_marks ::Google::Cloud::SecurityCenter::V1p1beta1::UpdateSecurityMarksRequest.new(security_marks: security_marks, update_mask: update_mask, start_time: start_time) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + client.update_security_marks({ security_marks: security_marks, update_mask: update_mask, start_time: start_time }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + client.update_security_marks(::Google::Cloud::SecurityCenter::V1p1beta1::UpdateSecurityMarksRequest.new(security_marks: security_marks, update_mask: update_mask, start_time: start_time), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, update_security_marks_client_stub.call_count + end + end + end + + def test_configure + credentials_token = :dummy_value + + client = block_config = config = nil + dummy_stub = ClientStub.new nil + Gapic::Rest::ClientStub.stub :new, dummy_stub do + client = ::Google::Cloud::SecurityCenter::V1p1beta1::SecurityCenter::Rest::Client.new do |config| + config.credentials = credentials_token + end + end + + config = client.configure do |c| + block_config = c + end + + assert_same block_config, config + assert_kind_of ::Google::Cloud::SecurityCenter::V1p1beta1::SecurityCenter::Rest::Client::Configuration, config + end +end diff --git a/owl-bot-staging/google-cloud-security_center-v1p1beta1/test/google/cloud/security_center/v1p1beta1/security_center_test.rb b/owl-bot-staging/google-cloud-security_center-v1p1beta1/test/google/cloud/security_center/v1p1beta1/security_center_test.rb new file mode 100644 index 000000000000..3de0ff05e98b --- /dev/null +++ b/owl-bot-staging/google-cloud-security_center-v1p1beta1/test/google/cloud/security_center/v1p1beta1/security_center_test.rb @@ -0,0 +1,1581 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +require "helper" + +require "gapic/grpc/service_stub" + +require "google/cloud/securitycenter/v1p1beta1/securitycenter_service_pb" +require "google/cloud/security_center/v1p1beta1/security_center" + +class ::Google::Cloud::SecurityCenter::V1p1beta1::SecurityCenter::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_source + # Create GRPC objects. + grpc_response = ::Google::Cloud::SecurityCenter::V1p1beta1::Source.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" + source = {} + + create_source_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :create_source, name + assert_kind_of ::Google::Cloud::SecurityCenter::V1p1beta1::CreateSourceRequest, request + assert_equal "hello world", request["parent"] + assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::SecurityCenter::V1p1beta1::Source), request["source"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, create_source_client_stub do + # Create client + client = ::Google::Cloud::SecurityCenter::V1p1beta1::SecurityCenter::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.create_source({ parent: parent, source: source }) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use named arguments + client.create_source parent: parent, source: source do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.create_source ::Google::Cloud::SecurityCenter::V1p1beta1::CreateSourceRequest.new(parent: parent, source: source) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use hash object with options + client.create_source({ parent: parent, source: source }, grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object with options + client.create_source(::Google::Cloud::SecurityCenter::V1p1beta1::CreateSourceRequest.new(parent: parent, source: source), grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Verify method calls + assert_equal 5, create_source_client_stub.call_rpc_count + end + end + + def test_create_finding + # Create GRPC objects. + grpc_response = ::Google::Cloud::SecurityCenter::V1p1beta1::Finding.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" + finding_id = "hello world" + finding = {} + + create_finding_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :create_finding, name + assert_kind_of ::Google::Cloud::SecurityCenter::V1p1beta1::CreateFindingRequest, request + assert_equal "hello world", request["parent"] + assert_equal "hello world", request["finding_id"] + assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::SecurityCenter::V1p1beta1::Finding), request["finding"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, create_finding_client_stub do + # Create client + client = ::Google::Cloud::SecurityCenter::V1p1beta1::SecurityCenter::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.create_finding({ parent: parent, finding_id: finding_id, finding: finding }) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use named arguments + client.create_finding parent: parent, finding_id: finding_id, finding: finding do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.create_finding ::Google::Cloud::SecurityCenter::V1p1beta1::CreateFindingRequest.new(parent: parent, finding_id: finding_id, finding: finding) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use hash object with options + client.create_finding({ parent: parent, finding_id: finding_id, finding: finding }, grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object with options + client.create_finding(::Google::Cloud::SecurityCenter::V1p1beta1::CreateFindingRequest.new(parent: parent, finding_id: finding_id, finding: finding), grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Verify method calls + assert_equal 5, create_finding_client_stub.call_rpc_count + end + end + + def test_create_notification_config + # Create GRPC objects. + grpc_response = ::Google::Cloud::SecurityCenter::V1p1beta1::NotificationConfig.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" + config_id = "hello world" + notification_config = {} + + create_notification_config_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :create_notification_config, name + assert_kind_of ::Google::Cloud::SecurityCenter::V1p1beta1::CreateNotificationConfigRequest, request + assert_equal "hello world", request["parent"] + assert_equal "hello world", request["config_id"] + assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::SecurityCenter::V1p1beta1::NotificationConfig), request["notification_config"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, create_notification_config_client_stub do + # Create client + client = ::Google::Cloud::SecurityCenter::V1p1beta1::SecurityCenter::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.create_notification_config({ parent: parent, config_id: config_id, notification_config: notification_config }) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use named arguments + client.create_notification_config parent: parent, config_id: config_id, notification_config: notification_config do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.create_notification_config ::Google::Cloud::SecurityCenter::V1p1beta1::CreateNotificationConfigRequest.new(parent: parent, config_id: config_id, notification_config: notification_config) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use hash object with options + client.create_notification_config({ parent: parent, config_id: config_id, notification_config: notification_config }, grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object with options + client.create_notification_config(::Google::Cloud::SecurityCenter::V1p1beta1::CreateNotificationConfigRequest.new(parent: parent, config_id: config_id, notification_config: notification_config), grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Verify method calls + assert_equal 5, create_notification_config_client_stub.call_rpc_count + end + end + + def test_delete_notification_config + # 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_notification_config_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :delete_notification_config, name + assert_kind_of ::Google::Cloud::SecurityCenter::V1p1beta1::DeleteNotificationConfigRequest, request + assert_equal "hello world", request["name"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, delete_notification_config_client_stub do + # Create client + client = ::Google::Cloud::SecurityCenter::V1p1beta1::SecurityCenter::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.delete_notification_config({ name: name }) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use named arguments + client.delete_notification_config name: name do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.delete_notification_config ::Google::Cloud::SecurityCenter::V1p1beta1::DeleteNotificationConfigRequest.new(name: name) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use hash object with options + client.delete_notification_config({ name: name }, grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object with options + client.delete_notification_config(::Google::Cloud::SecurityCenter::V1p1beta1::DeleteNotificationConfigRequest.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_notification_config_client_stub.call_rpc_count + end + end + + def test_get_iam_policy + # Create GRPC objects. + grpc_response = ::Google::Iam::V1::Policy.new + grpc_operation = GRPC::ActiveCall::Operation.new nil + grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + grpc_options = {} + + # Create request parameters for a unary method. + resource = "hello world" + options = {} + + get_iam_policy_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :get_iam_policy, name + assert_kind_of ::Google::Iam::V1::GetIamPolicyRequest, request + assert_equal "hello world", request["resource"] + assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Iam::V1::GetPolicyOptions), request["options"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, get_iam_policy_client_stub do + # Create client + client = ::Google::Cloud::SecurityCenter::V1p1beta1::SecurityCenter::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.get_iam_policy({ resource: resource, options: options }) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use named arguments + client.get_iam_policy resource: resource, options: options do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.get_iam_policy ::Google::Iam::V1::GetIamPolicyRequest.new(resource: resource, options: options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use hash object with options + client.get_iam_policy({ resource: resource, options: options }, grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object with options + client.get_iam_policy(::Google::Iam::V1::GetIamPolicyRequest.new(resource: resource, options: options), grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Verify method calls + assert_equal 5, get_iam_policy_client_stub.call_rpc_count + end + end + + def test_get_notification_config + # Create GRPC objects. + grpc_response = ::Google::Cloud::SecurityCenter::V1p1beta1::NotificationConfig.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_notification_config_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :get_notification_config, name + assert_kind_of ::Google::Cloud::SecurityCenter::V1p1beta1::GetNotificationConfigRequest, request + assert_equal "hello world", request["name"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, get_notification_config_client_stub do + # Create client + client = ::Google::Cloud::SecurityCenter::V1p1beta1::SecurityCenter::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.get_notification_config({ name: name }) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use named arguments + client.get_notification_config name: name do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.get_notification_config ::Google::Cloud::SecurityCenter::V1p1beta1::GetNotificationConfigRequest.new(name: name) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use hash object with options + client.get_notification_config({ name: name }, grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object with options + client.get_notification_config(::Google::Cloud::SecurityCenter::V1p1beta1::GetNotificationConfigRequest.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_notification_config_client_stub.call_rpc_count + end + end + + def test_get_organization_settings + # Create GRPC objects. + grpc_response = ::Google::Cloud::SecurityCenter::V1p1beta1::OrganizationSettings.new + grpc_operation = GRPC::ActiveCall::Operation.new nil + grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + grpc_options = {} + + # Create request parameters for a unary method. + name = "hello world" + + get_organization_settings_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :get_organization_settings, name + assert_kind_of ::Google::Cloud::SecurityCenter::V1p1beta1::GetOrganizationSettingsRequest, request + assert_equal "hello world", request["name"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, get_organization_settings_client_stub do + # Create client + client = ::Google::Cloud::SecurityCenter::V1p1beta1::SecurityCenter::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.get_organization_settings({ name: name }) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use named arguments + client.get_organization_settings name: name do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.get_organization_settings ::Google::Cloud::SecurityCenter::V1p1beta1::GetOrganizationSettingsRequest.new(name: name) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use hash object with options + client.get_organization_settings({ name: name }, grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object with options + client.get_organization_settings(::Google::Cloud::SecurityCenter::V1p1beta1::GetOrganizationSettingsRequest.new(name: name), grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Verify method calls + assert_equal 5, get_organization_settings_client_stub.call_rpc_count + end + end + + def test_get_source + # Create GRPC objects. + grpc_response = ::Google::Cloud::SecurityCenter::V1p1beta1::Source.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_source_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :get_source, name + assert_kind_of ::Google::Cloud::SecurityCenter::V1p1beta1::GetSourceRequest, request + assert_equal "hello world", request["name"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, get_source_client_stub do + # Create client + client = ::Google::Cloud::SecurityCenter::V1p1beta1::SecurityCenter::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.get_source({ name: name }) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use named arguments + client.get_source name: name do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.get_source ::Google::Cloud::SecurityCenter::V1p1beta1::GetSourceRequest.new(name: name) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use hash object with options + client.get_source({ 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_source(::Google::Cloud::SecurityCenter::V1p1beta1::GetSourceRequest.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_source_client_stub.call_rpc_count + end + end + + def test_group_assets + # Create GRPC objects. + grpc_response = ::Google::Cloud::SecurityCenter::V1p1beta1::GroupAssetsResponse.new + grpc_operation = GRPC::ActiveCall::Operation.new nil + grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + grpc_options = {} + + # Create request parameters for a unary method. + parent = "hello world" + filter = "hello world" + group_by = "hello world" + compare_duration = {} + read_time = {} + page_token = "hello world" + page_size = 42 + + group_assets_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :group_assets, name + assert_kind_of ::Google::Cloud::SecurityCenter::V1p1beta1::GroupAssetsRequest, request + assert_equal "hello world", request["parent"] + assert_equal "hello world", request["filter"] + assert_equal "hello world", request["group_by"] + assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Protobuf::Duration), request["compare_duration"] + assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Protobuf::Timestamp), request["read_time"] + assert_equal "hello world", request["page_token"] + assert_equal 42, request["page_size"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, group_assets_client_stub do + # Create client + client = ::Google::Cloud::SecurityCenter::V1p1beta1::SecurityCenter::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.group_assets({ parent: parent, filter: filter, group_by: group_by, compare_duration: compare_duration, read_time: read_time, page_token: page_token, page_size: page_size }) 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.group_assets parent: parent, filter: filter, group_by: group_by, compare_duration: compare_duration, read_time: read_time, page_token: page_token, page_size: page_size 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.group_assets ::Google::Cloud::SecurityCenter::V1p1beta1::GroupAssetsRequest.new(parent: parent, filter: filter, group_by: group_by, compare_duration: compare_duration, read_time: read_time, page_token: page_token, page_size: page_size) 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.group_assets({ parent: parent, filter: filter, group_by: group_by, compare_duration: compare_duration, read_time: read_time, page_token: page_token, page_size: page_size }, 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.group_assets(::Google::Cloud::SecurityCenter::V1p1beta1::GroupAssetsRequest.new(parent: parent, filter: filter, group_by: group_by, compare_duration: compare_duration, read_time: read_time, page_token: page_token, page_size: page_size), 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, group_assets_client_stub.call_rpc_count + end + end + + def test_group_findings + # Create GRPC objects. + grpc_response = ::Google::Cloud::SecurityCenter::V1p1beta1::GroupFindingsResponse.new + grpc_operation = GRPC::ActiveCall::Operation.new nil + grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + grpc_options = {} + + # Create request parameters for a unary method. + parent = "hello world" + filter = "hello world" + group_by = "hello world" + read_time = {} + compare_duration = {} + page_token = "hello world" + page_size = 42 + + group_findings_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :group_findings, name + assert_kind_of ::Google::Cloud::SecurityCenter::V1p1beta1::GroupFindingsRequest, request + assert_equal "hello world", request["parent"] + assert_equal "hello world", request["filter"] + assert_equal "hello world", request["group_by"] + assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Protobuf::Timestamp), request["read_time"] + assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Protobuf::Duration), request["compare_duration"] + assert_equal "hello world", request["page_token"] + assert_equal 42, request["page_size"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, group_findings_client_stub do + # Create client + client = ::Google::Cloud::SecurityCenter::V1p1beta1::SecurityCenter::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.group_findings({ parent: parent, filter: filter, group_by: group_by, read_time: read_time, compare_duration: compare_duration, page_token: page_token, page_size: page_size }) 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.group_findings parent: parent, filter: filter, group_by: group_by, read_time: read_time, compare_duration: compare_duration, page_token: page_token, page_size: page_size 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.group_findings ::Google::Cloud::SecurityCenter::V1p1beta1::GroupFindingsRequest.new(parent: parent, filter: filter, group_by: group_by, read_time: read_time, compare_duration: compare_duration, page_token: page_token, page_size: page_size) 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.group_findings({ parent: parent, filter: filter, group_by: group_by, read_time: read_time, compare_duration: compare_duration, page_token: page_token, page_size: page_size }, 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.group_findings(::Google::Cloud::SecurityCenter::V1p1beta1::GroupFindingsRequest.new(parent: parent, filter: filter, group_by: group_by, read_time: read_time, compare_duration: compare_duration, page_token: page_token, page_size: page_size), 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, group_findings_client_stub.call_rpc_count + end + end + + def test_list_assets + # Create GRPC objects. + grpc_response = ::Google::Cloud::SecurityCenter::V1p1beta1::ListAssetsResponse.new + grpc_operation = GRPC::ActiveCall::Operation.new nil + grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + grpc_options = {} + + # Create request parameters for a unary method. + parent = "hello world" + filter = "hello world" + order_by = "hello world" + read_time = {} + compare_duration = {} + field_mask = {} + page_token = "hello world" + page_size = 42 + + list_assets_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :list_assets, name + assert_kind_of ::Google::Cloud::SecurityCenter::V1p1beta1::ListAssetsRequest, request + assert_equal "hello world", request["parent"] + assert_equal "hello world", request["filter"] + assert_equal "hello world", request["order_by"] + assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Protobuf::Timestamp), request["read_time"] + assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Protobuf::Duration), request["compare_duration"] + assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Protobuf::FieldMask), request["field_mask"] + assert_equal "hello world", request["page_token"] + assert_equal 42, request["page_size"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, list_assets_client_stub do + # Create client + client = ::Google::Cloud::SecurityCenter::V1p1beta1::SecurityCenter::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.list_assets({ parent: parent, filter: filter, order_by: order_by, read_time: read_time, compare_duration: compare_duration, field_mask: field_mask, page_token: page_token, page_size: page_size }) 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_assets parent: parent, filter: filter, order_by: order_by, read_time: read_time, compare_duration: compare_duration, field_mask: field_mask, page_token: page_token, page_size: page_size 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_assets ::Google::Cloud::SecurityCenter::V1p1beta1::ListAssetsRequest.new(parent: parent, filter: filter, order_by: order_by, read_time: read_time, compare_duration: compare_duration, field_mask: field_mask, page_token: page_token, page_size: page_size) 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_assets({ parent: parent, filter: filter, order_by: order_by, read_time: read_time, compare_duration: compare_duration, field_mask: field_mask, page_token: page_token, page_size: page_size }, 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_assets(::Google::Cloud::SecurityCenter::V1p1beta1::ListAssetsRequest.new(parent: parent, filter: filter, order_by: order_by, read_time: read_time, compare_duration: compare_duration, field_mask: field_mask, page_token: page_token, page_size: page_size), 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_assets_client_stub.call_rpc_count + end + end + + def test_list_findings + # Create GRPC objects. + grpc_response = ::Google::Cloud::SecurityCenter::V1p1beta1::ListFindingsResponse.new + grpc_operation = GRPC::ActiveCall::Operation.new nil + grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + grpc_options = {} + + # Create request parameters for a unary method. + parent = "hello world" + filter = "hello world" + order_by = "hello world" + read_time = {} + compare_duration = {} + field_mask = {} + page_token = "hello world" + page_size = 42 + + list_findings_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :list_findings, name + assert_kind_of ::Google::Cloud::SecurityCenter::V1p1beta1::ListFindingsRequest, request + assert_equal "hello world", request["parent"] + assert_equal "hello world", request["filter"] + assert_equal "hello world", request["order_by"] + assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Protobuf::Timestamp), request["read_time"] + assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Protobuf::Duration), request["compare_duration"] + assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Protobuf::FieldMask), request["field_mask"] + assert_equal "hello world", request["page_token"] + assert_equal 42, request["page_size"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, list_findings_client_stub do + # Create client + client = ::Google::Cloud::SecurityCenter::V1p1beta1::SecurityCenter::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.list_findings({ parent: parent, filter: filter, order_by: order_by, read_time: read_time, compare_duration: compare_duration, field_mask: field_mask, page_token: page_token, page_size: page_size }) 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_findings parent: parent, filter: filter, order_by: order_by, read_time: read_time, compare_duration: compare_duration, field_mask: field_mask, page_token: page_token, page_size: page_size 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_findings ::Google::Cloud::SecurityCenter::V1p1beta1::ListFindingsRequest.new(parent: parent, filter: filter, order_by: order_by, read_time: read_time, compare_duration: compare_duration, field_mask: field_mask, page_token: page_token, page_size: page_size) 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_findings({ parent: parent, filter: filter, order_by: order_by, read_time: read_time, compare_duration: compare_duration, field_mask: field_mask, page_token: page_token, page_size: page_size }, 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_findings(::Google::Cloud::SecurityCenter::V1p1beta1::ListFindingsRequest.new(parent: parent, filter: filter, order_by: order_by, read_time: read_time, compare_duration: compare_duration, field_mask: field_mask, page_token: page_token, page_size: page_size), 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_findings_client_stub.call_rpc_count + end + end + + def test_list_notification_configs + # Create GRPC objects. + grpc_response = ::Google::Cloud::SecurityCenter::V1p1beta1::ListNotificationConfigsResponse.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_token = "hello world" + page_size = 42 + + list_notification_configs_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :list_notification_configs, name + assert_kind_of ::Google::Cloud::SecurityCenter::V1p1beta1::ListNotificationConfigsRequest, request + assert_equal "hello world", request["parent"] + assert_equal "hello world", request["page_token"] + assert_equal 42, request["page_size"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, list_notification_configs_client_stub do + # Create client + client = ::Google::Cloud::SecurityCenter::V1p1beta1::SecurityCenter::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.list_notification_configs({ parent: parent, page_token: page_token, page_size: page_size }) 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_notification_configs parent: parent, page_token: page_token, page_size: page_size 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_notification_configs ::Google::Cloud::SecurityCenter::V1p1beta1::ListNotificationConfigsRequest.new(parent: parent, page_token: page_token, page_size: page_size) 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_notification_configs({ parent: parent, page_token: page_token, page_size: page_size }, 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_notification_configs(::Google::Cloud::SecurityCenter::V1p1beta1::ListNotificationConfigsRequest.new(parent: parent, page_token: page_token, page_size: page_size), 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_notification_configs_client_stub.call_rpc_count + end + end + + def test_list_sources + # Create GRPC objects. + grpc_response = ::Google::Cloud::SecurityCenter::V1p1beta1::ListSourcesResponse.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_token = "hello world" + page_size = 42 + + list_sources_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :list_sources, name + assert_kind_of ::Google::Cloud::SecurityCenter::V1p1beta1::ListSourcesRequest, request + assert_equal "hello world", request["parent"] + assert_equal "hello world", request["page_token"] + assert_equal 42, request["page_size"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, list_sources_client_stub do + # Create client + client = ::Google::Cloud::SecurityCenter::V1p1beta1::SecurityCenter::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.list_sources({ parent: parent, page_token: page_token, page_size: page_size }) 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_sources parent: parent, page_token: page_token, page_size: page_size 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_sources ::Google::Cloud::SecurityCenter::V1p1beta1::ListSourcesRequest.new(parent: parent, page_token: page_token, page_size: page_size) 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_sources({ parent: parent, page_token: page_token, page_size: page_size }, 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_sources(::Google::Cloud::SecurityCenter::V1p1beta1::ListSourcesRequest.new(parent: parent, page_token: page_token, page_size: page_size), 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_sources_client_stub.call_rpc_count + end + end + + def test_run_asset_discovery + # 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" + + run_asset_discovery_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :run_asset_discovery, name + assert_kind_of ::Google::Cloud::SecurityCenter::V1p1beta1::RunAssetDiscoveryRequest, request + assert_equal "hello world", request["parent"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, run_asset_discovery_client_stub do + # Create client + client = ::Google::Cloud::SecurityCenter::V1p1beta1::SecurityCenter::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.run_asset_discovery({ parent: parent }) 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.run_asset_discovery parent: parent 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.run_asset_discovery ::Google::Cloud::SecurityCenter::V1p1beta1::RunAssetDiscoveryRequest.new(parent: parent) 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.run_asset_discovery({ parent: parent }, 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.run_asset_discovery(::Google::Cloud::SecurityCenter::V1p1beta1::RunAssetDiscoveryRequest.new(parent: parent), 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, run_asset_discovery_client_stub.call_rpc_count + end + end + + def test_set_finding_state + # Create GRPC objects. + grpc_response = ::Google::Cloud::SecurityCenter::V1p1beta1::Finding.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" + state = :STATE_UNSPECIFIED + start_time = {} + + set_finding_state_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :set_finding_state, name + assert_kind_of ::Google::Cloud::SecurityCenter::V1p1beta1::SetFindingStateRequest, request + assert_equal "hello world", request["name"] + assert_equal :STATE_UNSPECIFIED, request["state"] + assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Protobuf::Timestamp), request["start_time"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, set_finding_state_client_stub do + # Create client + client = ::Google::Cloud::SecurityCenter::V1p1beta1::SecurityCenter::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.set_finding_state({ name: name, state: state, start_time: start_time }) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use named arguments + client.set_finding_state name: name, state: state, start_time: start_time do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.set_finding_state ::Google::Cloud::SecurityCenter::V1p1beta1::SetFindingStateRequest.new(name: name, state: state, start_time: start_time) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use hash object with options + client.set_finding_state({ name: name, state: state, start_time: start_time }, grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object with options + client.set_finding_state(::Google::Cloud::SecurityCenter::V1p1beta1::SetFindingStateRequest.new(name: name, state: state, start_time: start_time), grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Verify method calls + assert_equal 5, set_finding_state_client_stub.call_rpc_count + end + end + + def test_set_iam_policy + # Create GRPC objects. + grpc_response = ::Google::Iam::V1::Policy.new + grpc_operation = GRPC::ActiveCall::Operation.new nil + grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + grpc_options = {} + + # Create request parameters for a unary method. + resource = "hello world" + policy = {} + update_mask = {} + + set_iam_policy_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :set_iam_policy, name + assert_kind_of ::Google::Iam::V1::SetIamPolicyRequest, request + assert_equal "hello world", request["resource"] + assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Iam::V1::Policy), request["policy"] + assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Protobuf::FieldMask), request["update_mask"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, set_iam_policy_client_stub do + # Create client + client = ::Google::Cloud::SecurityCenter::V1p1beta1::SecurityCenter::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.set_iam_policy({ resource: resource, policy: policy, update_mask: update_mask }) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use named arguments + client.set_iam_policy resource: resource, policy: policy, update_mask: update_mask do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.set_iam_policy ::Google::Iam::V1::SetIamPolicyRequest.new(resource: resource, policy: policy, update_mask: update_mask) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use hash object with options + client.set_iam_policy({ resource: resource, policy: policy, update_mask: update_mask }, grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object with options + client.set_iam_policy(::Google::Iam::V1::SetIamPolicyRequest.new(resource: resource, policy: policy, update_mask: update_mask), grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Verify method calls + assert_equal 5, set_iam_policy_client_stub.call_rpc_count + end + end + + def test_test_iam_permissions + # Create GRPC objects. + grpc_response = ::Google::Iam::V1::TestIamPermissionsResponse.new + grpc_operation = GRPC::ActiveCall::Operation.new nil + grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + grpc_options = {} + + # Create request parameters for a unary method. + resource = "hello world" + permissions = ["hello world"] + + test_iam_permissions_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :test_iam_permissions, name + assert_kind_of ::Google::Iam::V1::TestIamPermissionsRequest, request + assert_equal "hello world", request["resource"] + assert_equal ["hello world"], request["permissions"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, test_iam_permissions_client_stub do + # Create client + client = ::Google::Cloud::SecurityCenter::V1p1beta1::SecurityCenter::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.test_iam_permissions({ resource: resource, permissions: permissions }) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use named arguments + client.test_iam_permissions resource: resource, permissions: permissions do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.test_iam_permissions ::Google::Iam::V1::TestIamPermissionsRequest.new(resource: resource, permissions: permissions) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use hash object with options + client.test_iam_permissions({ resource: resource, permissions: permissions }, grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object with options + client.test_iam_permissions(::Google::Iam::V1::TestIamPermissionsRequest.new(resource: resource, permissions: permissions), grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Verify method calls + assert_equal 5, test_iam_permissions_client_stub.call_rpc_count + end + end + + def test_update_finding + # Create GRPC objects. + grpc_response = ::Google::Cloud::SecurityCenter::V1p1beta1::Finding.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. + finding = {} + update_mask = {} + + update_finding_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :update_finding, name + assert_kind_of ::Google::Cloud::SecurityCenter::V1p1beta1::UpdateFindingRequest, request + assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::SecurityCenter::V1p1beta1::Finding), request["finding"] + assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Protobuf::FieldMask), request["update_mask"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, update_finding_client_stub do + # Create client + client = ::Google::Cloud::SecurityCenter::V1p1beta1::SecurityCenter::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.update_finding({ finding: finding, update_mask: update_mask }) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use named arguments + client.update_finding finding: finding, update_mask: update_mask do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.update_finding ::Google::Cloud::SecurityCenter::V1p1beta1::UpdateFindingRequest.new(finding: finding, update_mask: update_mask) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use hash object with options + client.update_finding({ finding: finding, update_mask: update_mask }, grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object with options + client.update_finding(::Google::Cloud::SecurityCenter::V1p1beta1::UpdateFindingRequest.new(finding: finding, update_mask: update_mask), grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Verify method calls + assert_equal 5, update_finding_client_stub.call_rpc_count + end + end + + def test_update_notification_config + # Create GRPC objects. + grpc_response = ::Google::Cloud::SecurityCenter::V1p1beta1::NotificationConfig.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. + notification_config = {} + update_mask = {} + + update_notification_config_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :update_notification_config, name + assert_kind_of ::Google::Cloud::SecurityCenter::V1p1beta1::UpdateNotificationConfigRequest, request + assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::SecurityCenter::V1p1beta1::NotificationConfig), request["notification_config"] + assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Protobuf::FieldMask), request["update_mask"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, update_notification_config_client_stub do + # Create client + client = ::Google::Cloud::SecurityCenter::V1p1beta1::SecurityCenter::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.update_notification_config({ notification_config: notification_config, update_mask: update_mask }) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use named arguments + client.update_notification_config notification_config: notification_config, update_mask: update_mask do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.update_notification_config ::Google::Cloud::SecurityCenter::V1p1beta1::UpdateNotificationConfigRequest.new(notification_config: notification_config, update_mask: update_mask) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use hash object with options + client.update_notification_config({ notification_config: notification_config, update_mask: update_mask }, grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object with options + client.update_notification_config(::Google::Cloud::SecurityCenter::V1p1beta1::UpdateNotificationConfigRequest.new(notification_config: notification_config, update_mask: update_mask), grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Verify method calls + assert_equal 5, update_notification_config_client_stub.call_rpc_count + end + end + + def test_update_organization_settings + # Create GRPC objects. + grpc_response = ::Google::Cloud::SecurityCenter::V1p1beta1::OrganizationSettings.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. + organization_settings = {} + update_mask = {} + + update_organization_settings_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :update_organization_settings, name + assert_kind_of ::Google::Cloud::SecurityCenter::V1p1beta1::UpdateOrganizationSettingsRequest, request + assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::SecurityCenter::V1p1beta1::OrganizationSettings), request["organization_settings"] + assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Protobuf::FieldMask), request["update_mask"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, update_organization_settings_client_stub do + # Create client + client = ::Google::Cloud::SecurityCenter::V1p1beta1::SecurityCenter::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.update_organization_settings({ organization_settings: organization_settings, update_mask: update_mask }) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use named arguments + client.update_organization_settings organization_settings: organization_settings, update_mask: update_mask do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.update_organization_settings ::Google::Cloud::SecurityCenter::V1p1beta1::UpdateOrganizationSettingsRequest.new(organization_settings: organization_settings, update_mask: update_mask) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use hash object with options + client.update_organization_settings({ organization_settings: organization_settings, update_mask: update_mask }, grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object with options + client.update_organization_settings(::Google::Cloud::SecurityCenter::V1p1beta1::UpdateOrganizationSettingsRequest.new(organization_settings: organization_settings, update_mask: update_mask), grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Verify method calls + assert_equal 5, update_organization_settings_client_stub.call_rpc_count + end + end + + def test_update_source + # Create GRPC objects. + grpc_response = ::Google::Cloud::SecurityCenter::V1p1beta1::Source.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. + source = {} + update_mask = {} + + update_source_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :update_source, name + assert_kind_of ::Google::Cloud::SecurityCenter::V1p1beta1::UpdateSourceRequest, request + assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::SecurityCenter::V1p1beta1::Source), request["source"] + assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Protobuf::FieldMask), request["update_mask"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, update_source_client_stub do + # Create client + client = ::Google::Cloud::SecurityCenter::V1p1beta1::SecurityCenter::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.update_source({ source: source, update_mask: update_mask }) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use named arguments + client.update_source source: source, update_mask: update_mask do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.update_source ::Google::Cloud::SecurityCenter::V1p1beta1::UpdateSourceRequest.new(source: source, update_mask: update_mask) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use hash object with options + client.update_source({ source: source, update_mask: update_mask }, grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object with options + client.update_source(::Google::Cloud::SecurityCenter::V1p1beta1::UpdateSourceRequest.new(source: source, update_mask: update_mask), grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Verify method calls + assert_equal 5, update_source_client_stub.call_rpc_count + end + end + + def test_update_security_marks + # Create GRPC objects. + grpc_response = ::Google::Cloud::SecurityCenter::V1p1beta1::SecurityMarks.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. + security_marks = {} + update_mask = {} + start_time = {} + + update_security_marks_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :update_security_marks, name + assert_kind_of ::Google::Cloud::SecurityCenter::V1p1beta1::UpdateSecurityMarksRequest, request + assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::SecurityCenter::V1p1beta1::SecurityMarks), request["security_marks"] + assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Protobuf::FieldMask), request["update_mask"] + assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Protobuf::Timestamp), request["start_time"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, update_security_marks_client_stub do + # Create client + client = ::Google::Cloud::SecurityCenter::V1p1beta1::SecurityCenter::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.update_security_marks({ security_marks: security_marks, update_mask: update_mask, start_time: start_time }) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use named arguments + client.update_security_marks security_marks: security_marks, update_mask: update_mask, start_time: start_time do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.update_security_marks ::Google::Cloud::SecurityCenter::V1p1beta1::UpdateSecurityMarksRequest.new(security_marks: security_marks, update_mask: update_mask, start_time: start_time) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use hash object with options + client.update_security_marks({ security_marks: security_marks, update_mask: update_mask, start_time: start_time }, grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object with options + client.update_security_marks(::Google::Cloud::SecurityCenter::V1p1beta1::UpdateSecurityMarksRequest.new(security_marks: security_marks, update_mask: update_mask, start_time: start_time), grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Verify method calls + assert_equal 5, update_security_marks_client_stub.call_rpc_count + end + end + + def test_configure + grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + + client = block_config = config = nil + dummy_stub = ClientStub.new nil, nil + Gapic::ServiceStub.stub :new, dummy_stub do + client = ::Google::Cloud::SecurityCenter::V1p1beta1::SecurityCenter::Client.new do |config| + config.credentials = grpc_channel + end + end + + config = client.configure do |c| + block_config = c + end + + assert_same block_config, config + assert_kind_of ::Google::Cloud::SecurityCenter::V1p1beta1::SecurityCenter::Client::Configuration, config + end + + def test_credentials + key = OpenSSL::PKey::RSA.new 2048 + cred_json = { + "private_key" => key.to_pem, + "client_email" => "app@developer.gserviceaccount.com", + "type" => "service_account" + } + key_file = StringIO.new cred_json.to_json + creds = Google::Auth::ServiceAccountCredentials.make_creds({ json_key_io: key_file }) + + dummy_stub = ClientStub.new nil, nil + Gapic::ServiceStub.stub :new, dummy_stub do + client = ::Google::Cloud::SecurityCenter::V1p1beta1::SecurityCenter::Client.new do |config| + config.credentials = creds + end + assert_kind_of ::Google::Cloud::SecurityCenter::V1p1beta1::SecurityCenter::Client, client + assert_equal creds, client.configure.credentials + end + end + + def test_operations_client + grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + + client = nil + dummy_stub = ClientStub.new nil, nil + Gapic::ServiceStub.stub :new, dummy_stub do + client = ::Google::Cloud::SecurityCenter::V1p1beta1::SecurityCenter::Client.new do |config| + config.credentials = grpc_channel + end + end + + assert_kind_of ::Google::Cloud::SecurityCenter::V1p1beta1::SecurityCenter::Operations, client.operations_client + end +end diff --git a/owl-bot-staging/google-cloud-security_center-v1p1beta1/test/helper.rb b/owl-bot-staging/google-cloud-security_center-v1p1beta1/test/helper.rb new file mode 100644 index 000000000000..672b337030e7 --- /dev/null +++ b/owl-bot-staging/google-cloud-security_center-v1p1beta1/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" diff --git a/owl-bot-staging/google-cloud-security_center-v2/.gitignore b/owl-bot-staging/google-cloud-security_center-v2/.gitignore new file mode 100644 index 000000000000..0135b6bc6cfc --- /dev/null +++ b/owl-bot-staging/google-cloud-security_center-v2/.gitignore @@ -0,0 +1,22 @@ +# Ignore bundler lockfiles +Gemfile.lock +gems.locked + +# Ignore documentation output +doc/* +.yardoc/* + +# Ignore test output +coverage/* + +# Ignore build artifacts +pkg/* + +# Ignore files commonly present in certain dev environments +.vagrant +.DS_STORE +.idea +*.iml + +# Ignore synth output +__pycache__ diff --git a/owl-bot-staging/google-cloud-security_center-v2/.repo-metadata.json b/owl-bot-staging/google-cloud-security_center-v2/.repo-metadata.json new file mode 100644 index 000000000000..0473cc4ee50a --- /dev/null +++ b/owl-bot-staging/google-cloud-security_center-v2/.repo-metadata.json @@ -0,0 +1,18 @@ +{ + "api_id": "securitycenter.googleapis.com", + "api_shortname": "securitycenter", + "client_documentation": "https://cloud.google.com/ruby/docs/reference/google-cloud-security_center-v2/latest", + "distribution_name": "google-cloud-security_center-v2", + "is_cloud": true, + "language": "ruby", + "name": "securitycenter", + "name_pretty": "Security Command Center V2 API", + "product_documentation": "https://cloud.google.com/security-command-center", + "release_level": "unreleased", + "repo": "googleapis/google-cloud-ruby", + "requires_billing": true, + "ruby-cloud-description": "Security Command Center API provides access to temporal views of assets and findings within an organization. Note that google-cloud-security_center-v2 is a version-specific client library. For most uses, we recommend installing the main client library google-cloud-security_center instead. See the readme for more details.", + "ruby-cloud-env-prefix": "SECURITY_CENTER", + "ruby-cloud-product-url": "https://cloud.google.com/security-command-center", + "library_type": "GAPIC_AUTO" +} diff --git a/owl-bot-staging/google-cloud-security_center-v2/.rubocop.yml b/owl-bot-staging/google-cloud-security_center-v2/.rubocop.yml new file mode 100644 index 000000000000..ca95d31c752a --- /dev/null +++ b/owl-bot-staging/google-cloud-security_center-v2/.rubocop.yml @@ -0,0 +1,33 @@ +inherit_gem: + google-style: google-style.yml + +AllCops: + Exclude: + - "google-cloud-security_center-v2.gemspec" + - "lib/**/*_pb.rb" + - "proto_docs/**/*" + - "test/**/*" + - "acceptance/**/*" + - "samples/acceptance/**/*" + - "Rakefile" + +Layout/LineLength: + Enabled: false +Metrics/AbcSize: + Enabled: false +Metrics/ClassLength: + Enabled: false +Metrics/CyclomaticComplexity: + Enabled: false +Metrics/MethodLength: + Enabled: false +Metrics/ModuleLength: + Enabled: false +Metrics/PerceivedComplexity: + Enabled: false +Naming/AccessorMethodName: + Exclude: + - "snippets/**/*.rb" +Naming/FileName: + Exclude: + - "lib/google-cloud-security_center-v2.rb" diff --git a/owl-bot-staging/google-cloud-security_center-v2/.toys.rb b/owl-bot-staging/google-cloud-security_center-v2/.toys.rb new file mode 100644 index 000000000000..177e22456e8a --- /dev/null +++ b/owl-bot-staging/google-cloud-security_center-v2/.toys.rb @@ -0,0 +1,28 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +toys_version! ">= 0.15.3" + +if ENV["RUBY_COMMON_TOOLS"] + common_tools_dir = File.expand_path ENV["RUBY_COMMON_TOOLS"] + load File.join(common_tools_dir, "toys", "gapic") +else + load_git remote: "https://github.com/googleapis/ruby-common-tools.git", + path: "toys/gapic", + update: true +end diff --git a/owl-bot-staging/google-cloud-security_center-v2/.yardopts b/owl-bot-staging/google-cloud-security_center-v2/.yardopts new file mode 100644 index 000000000000..ce63c0dd16df --- /dev/null +++ b/owl-bot-staging/google-cloud-security_center-v2/.yardopts @@ -0,0 +1,12 @@ +--no-private +--title="Security Command Center V2 API" +--exclude _pb\.rb$ +--markup markdown +--markup-provider redcarpet + +./lib/**/*.rb +./proto_docs/**/*.rb +- +README.md +LICENSE.md +AUTHENTICATION.md diff --git a/owl-bot-staging/google-cloud-security_center-v2/AUTHENTICATION.md b/owl-bot-staging/google-cloud-security_center-v2/AUTHENTICATION.md new file mode 100644 index 000000000000..f1313afe9378 --- /dev/null +++ b/owl-bot-staging/google-cloud-security_center-v2/AUTHENTICATION.md @@ -0,0 +1,122 @@ +# Authentication + +The recommended way to authenticate to the google-cloud-security_center-v2 library is to use +[Application Default Credentials (ADC)](https://cloud.google.com/docs/authentication/application-default-credentials). +To review all of your authentication options, see [Credentials lookup](#credential-lookup). + +## Quickstart + +The following example shows how to set up authentication for a local development +environment with your user credentials. + +**NOTE:** This method is _not_ recommended for running in production. User credentials +should be used only during development. + +1. [Download and install the Google Cloud CLI](https://cloud.google.com/sdk). +2. Set up a local ADC file with your user credentials: + +```sh +gcloud auth application-default login +``` + +3. Write code as if already authenticated. + +For more information about setting up authentication for a local development environment, see +[Set up Application Default Credentials](https://cloud.google.com/docs/authentication/provide-credentials-adc#local-dev). + +## Credential Lookup + +The google-cloud-security_center-v2 library provides several mechanisms to configure your system. +Generally, using Application Default Credentials to facilitate automatic +credentials discovery is the easist method. But if you need to explicitly specify +credentials, there are several methods available to you. + +Credentials are accepted in the following ways, in the following order or precedence: + +1. Credentials specified in method arguments +2. Credentials specified in configuration +3. Credentials pointed to or included in environment variables +4. Credentials found in local ADC file +5. Credentials returned by the metadata server for the attached service account (GCP) + +### Configuration + +You can configure a path to a JSON credentials file, either for an individual client object or +globally, for all client objects. The JSON file can contain credentials created for +[workload identity federation](https://cloud.google.com/iam/docs/workload-identity-federation), +[workforce identity federation](https://cloud.google.com/iam/docs/workforce-identity-federation), or a +[service account key](https://cloud.google.com/docs/authentication/provide-credentials-adc#local-key). + +Note: Service account keys are a security risk if not managed correctly. You should +[choose a more secure alternative to service account keys](https://cloud.google.com/docs/authentication#auth-decision-tree) +whenever possible. + +To configure a credentials file for an individual client initialization: + +```ruby +require "google/cloud/security_center/v2" + +client = ::Google::Cloud::SecurityCenter::V2::SecurityCenter::Client.new do |config| + config.credentials = "path/to/credentialfile.json" +end +``` + +To configure a credentials file globally for all clients: + +```ruby +require "google/cloud/security_center/v2" + +::Google::Cloud::SecurityCenter::V2::SecurityCenter::Client.configure do |config| + config.credentials = "path/to/credentialfile.json" +end + +client = ::Google::Cloud::SecurityCenter::V2::SecurityCenter::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-security_center-v2 +checks for credentials are: + +* `GOOGLE_CLOUD_CREDENTIALS` - Path to JSON file, or JSON contents +* `GOOGLE_APPLICATION_CREDENTIALS` - Path to JSON file + +```ruby +require "google/cloud/security_center/v2" + +ENV["GOOGLE_APPLICATION_CREDENTIALS"] = "path/to/credentialfile.json" + +client = ::Google::Cloud::SecurityCenter::V2::SecurityCenter::Client.new +``` + +### Local ADC file + +You can set up a local ADC file with your user credentials for authentication during +development. If credentials are not provided in code or in environment variables, +then the local ADC credentials are discovered. + +Follow the steps in [Quickstart](#quickstart) to set up a local ADC file. + +### Google Cloud Platform environments + +When running on Google Cloud Platform (GCP), including Google Compute Engine +(GCE), Google Kubernetes Engine (GKE), Google App Engine (GAE), Google Cloud +Functions (GCF) and Cloud Run, credentials are retrieved from the attached +service account automatically. Code should be written as if already authenticated. + +For more information, see +[Set up ADC for Google Cloud services](https://cloud.google.com/docs/authentication/provide-credentials-adc#attached-sa). diff --git a/owl-bot-staging/google-cloud-security_center-v2/CHANGELOG.md b/owl-bot-staging/google-cloud-security_center-v2/CHANGELOG.md new file mode 100644 index 000000000000..f88957a62ba2 --- /dev/null +++ b/owl-bot-staging/google-cloud-security_center-v2/CHANGELOG.md @@ -0,0 +1,2 @@ +# Release History + diff --git a/owl-bot-staging/google-cloud-security_center-v2/Gemfile b/owl-bot-staging/google-cloud-security_center-v2/Gemfile new file mode 100644 index 000000000000..1d08558908d8 --- /dev/null +++ b/owl-bot-staging/google-cloud-security_center-v2/Gemfile @@ -0,0 +1,14 @@ +source "https://rubygems.org" + +gemspec + +gem "google-style", "~> 1.32.0" +gem "irb", "~> 1.17" +gem "minitest", "~> 6.0.2" +gem "minitest-focus", "~> 1.4" +gem "minitest-mock", "~> 5.27" +gem "minitest-rg", "~> 5.3" +gem "ostruct", "~> 0.5.5" +gem "rake", ">= 13.0" +gem "redcarpet", "~> 3.6" +gem "yard", "~> 0.9" diff --git a/owl-bot-staging/google-cloud-security_center-v2/LICENSE.md b/owl-bot-staging/google-cloud-security_center-v2/LICENSE.md new file mode 100644 index 000000000000..c261857ba6ad --- /dev/null +++ b/owl-bot-staging/google-cloud-security_center-v2/LICENSE.md @@ -0,0 +1,201 @@ + Apache License + Version 2.0, January 2004 + http://www.apache.org/licenses/ + + TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION + + 1. Definitions. + + "License" shall mean the terms and conditions for use, reproduction, + and distribution as defined by Sections 1 through 9 of this document. + + "Licensor" shall mean the copyright owner or entity authorized by + the copyright owner that is granting the License. + + "Legal Entity" shall mean the union of the acting entity and all + other entities that control, are controlled by, or are under common + control with that entity. For the purposes of this definition, + "control" means (i) the power, direct or indirect, to cause the + direction or management of such entity, whether by contract or + otherwise, or (ii) ownership of fifty percent (50%) or more of the + outstanding shares, or (iii) beneficial ownership of such entity. + + "You" (or "Your") shall mean an individual or Legal Entity + exercising permissions granted by this License. + + "Source" form shall mean the preferred form for making modifications, + including but not limited to software source code, documentation + source, and configuration files. + + "Object" form shall mean any form resulting from mechanical + transformation or translation of a Source form, including but + not limited to compiled object code, generated documentation, + and conversions to other media types. + + "Work" shall mean the work of authorship, whether in Source or + Object form, made available under the License, as indicated by a + copyright notice that is included in or attached to the work + (an example is provided in the Appendix below). + + "Derivative Works" shall mean any work, whether in Source or Object + form, that is based on (or derived from) the Work and for which the + editorial revisions, annotations, elaborations, or other modifications + represent, as a whole, an original work of authorship. For the purposes + of this License, Derivative Works shall not include works that remain + separable from, or merely link (or bind by name) to the interfaces of, + the Work and Derivative Works thereof. + + "Contribution" shall mean any work of authorship, including + the original version of the Work and any modifications or additions + to that Work or Derivative Works thereof, that is intentionally + submitted to Licensor for inclusion in the Work by the copyright owner + or by an individual or Legal Entity authorized to submit on behalf of + the copyright owner. For the purposes of this definition, "submitted" + means any form of electronic, verbal, or written communication sent + to the Licensor or its representatives, including but not limited to + communication on electronic mailing lists, source code control systems, + and issue tracking systems that are managed by, or on behalf of, the + Licensor for the purpose of discussing and improving the Work, but + excluding communication that is conspicuously marked or otherwise + designated in writing by the copyright owner as "Not a Contribution." + + "Contributor" shall mean Licensor and any individual or Legal Entity + on behalf of whom a Contribution has been received by Licensor and + subsequently incorporated within the Work. + + 2. Grant of Copyright License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + copyright license to reproduce, prepare Derivative Works of, + publicly display, publicly perform, sublicense, and distribute the + Work and such Derivative Works in Source or Object form. + + 3. Grant of Patent License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + (except as stated in this section) patent license to make, have made, + use, offer to sell, sell, import, and otherwise transfer the Work, + where such license applies only to those patent claims licensable + by such Contributor that are necessarily infringed by their + Contribution(s) alone or by combination of their Contribution(s) + with the Work to which such Contribution(s) was submitted. If You + institute patent litigation against any entity (including a + cross-claim or counterclaim in a lawsuit) alleging that the Work + or a Contribution incorporated within the Work constitutes direct + or contributory patent infringement, then any patent licenses + granted to You under this License for that Work shall terminate + as of the date such litigation is filed. + + 4. Redistribution. You may reproduce and distribute copies of the + Work or Derivative Works thereof in any medium, with or without + modifications, and in Source or Object form, provided that You + meet the following conditions: + + (a) You must give any other recipients of the Work or + Derivative Works a copy of this License; and + + (b) You must cause any modified files to carry prominent notices + stating that You changed the files; and + + (c) You must retain, in the Source form of any Derivative Works + that You distribute, all copyright, patent, trademark, and + attribution notices from the Source form of the Work, + excluding those notices that do not pertain to any part of + the Derivative Works; and + + (d) If the Work includes a "NOTICE" text file as part of its + distribution, then any Derivative Works that You distribute must + include a readable copy of the attribution notices contained + within such NOTICE file, excluding those notices that do not + pertain to any part of the Derivative Works, in at least one + of the following places: within a NOTICE text file distributed + as part of the Derivative Works; within the Source form or + documentation, if provided along with the Derivative Works; or, + within a display generated by the Derivative Works, if and + wherever such third-party notices normally appear. The contents + of the NOTICE file are for informational purposes only and + do not modify the License. You may add Your own attribution + notices within Derivative Works that You distribute, alongside + or as an addendum to the NOTICE text from the Work, provided + that such additional attribution notices cannot be construed + as modifying the License. + + You may add Your own copyright statement to Your modifications and + may provide additional or different license terms and conditions + for use, reproduction, or distribution of Your modifications, or + for any such Derivative Works as a whole, provided Your use, + reproduction, and distribution of the Work otherwise complies with + the conditions stated in this License. + + 5. Submission of Contributions. Unless You explicitly state otherwise, + any Contribution intentionally submitted for inclusion in the Work + by You to the Licensor shall be under the terms and conditions of + this License, without any additional terms or conditions. + Notwithstanding the above, nothing herein shall supersede or modify + the terms of any separate license agreement you may have executed + with Licensor regarding such Contributions. + + 6. Trademarks. This License does not grant permission to use the trade + names, trademarks, service marks, or product names of the Licensor, + except as required for reasonable and customary use in describing the + origin of the Work and reproducing the content of the NOTICE file. + + 7. Disclaimer of Warranty. Unless required by applicable law or + agreed to in writing, Licensor provides the Work (and each + Contributor provides its Contributions) on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or + implied, including, without limitation, any warranties or conditions + of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A + PARTICULAR PURPOSE. You are solely responsible for determining the + appropriateness of using or redistributing the Work and assume any + risks associated with Your exercise of permissions under this License. + + 8. Limitation of Liability. In no event and under no legal theory, + whether in tort (including negligence), contract, or otherwise, + unless required by applicable law (such as deliberate and grossly + negligent acts) or agreed to in writing, shall any Contributor be + liable to You for damages, including any direct, indirect, special, + incidental, or consequential damages of any character arising as a + result of this License or out of the use or inability to use the + Work (including but not limited to damages for loss of goodwill, + work stoppage, computer failure or malfunction, or any and all + other commercial damages or losses), even if such Contributor + has been advised of the possibility of such damages. + + 9. Accepting Warranty or Additional Liability. While redistributing + the Work or Derivative Works thereof, You may choose to offer, + and charge a fee for, acceptance of support, warranty, indemnity, + or other liability obligations and/or rights consistent with this + License. However, in accepting such obligations, You may act only + on Your own behalf and on Your sole responsibility, not on behalf + of any other Contributor, and only if You agree to indemnify, + defend, and hold each Contributor harmless for any liability + incurred by, or claims asserted against, such Contributor by reason + of your accepting any such warranty or additional liability. + + END OF TERMS AND CONDITIONS + + APPENDIX: How to apply the Apache License to your work. + + To apply the Apache License to your work, attach the following + boilerplate notice, with the fields enclosed by brackets "[]" + replaced with your own identifying information. (Don't include + the brackets!) The text should be enclosed in the appropriate + comment syntax for the file format. We also recommend that a + file or class name and description of purpose be included on the + same "printed page" as the copyright notice for easier + identification within third-party archives. + + Copyright [yyyy] [name of copyright owner] + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. diff --git a/owl-bot-staging/google-cloud-security_center-v2/README.md b/owl-bot-staging/google-cloud-security_center-v2/README.md new file mode 100644 index 000000000000..b1b40a5b2f90 --- /dev/null +++ b/owl-bot-staging/google-cloud-security_center-v2/README.md @@ -0,0 +1,154 @@ +# Ruby Client for the Security Command Center V2 API + +Security Command Center API provides access to temporal views of assets and findings within an organization. + +Security Command Center API provides access to temporal views of assets and findings within an organization. + +https://github.com/googleapis/google-cloud-ruby + +This gem is a _versioned_ client. It provides basic client classes for a +specific version of the Security Command Center V2 API. Most users should consider using +the main client gem, +[google-cloud-security_center](https://rubygems.org/gems/google-cloud-security_center). +See the section below titled *Which client should I use?* for more information. + +## Installation + +``` +$ gem install google-cloud-security_center-v2 +``` + +## Before You Begin + +In order to use this library, you first need to go through the following steps: + +1. [Select or create a Cloud Platform project.](https://console.cloud.google.com/project) +1. [Enable billing for your project.](https://cloud.google.com/billing/docs/how-to/modify-project#enable_billing_for_a_project) +1. [Enable the API.](https://console.cloud.google.com/apis/library/securitycenter.googleapis.com) +1. [Set up authentication.](AUTHENTICATION.md) + +## Quick Start + +```ruby +require "google/cloud/security_center/v2" + +client = ::Google::Cloud::SecurityCenter::V2::SecurityCenter::Client.new +request = ::Google::Cloud::SecurityCenter::V2::BatchCreateResourceValueConfigsRequest.new # (request fields as keyword arguments...) +response = client.batch_create_resource_value_configs request +``` + +View the [Client Library Documentation](https://cloud.google.com/ruby/docs/reference/google-cloud-security_center-v2/latest) +for class and method documentation. + +See also the [Product Documentation](https://cloud.google.com/security-command-center) +for general usage information. + +## Debug Logging + +This library comes with opt-in Debug Logging that can help you troubleshoot +your application's integration with the API. When logging is activated, key +events such as requests and responses, along with data payloads and metadata +such as headers and client configuration, are logged to the standard error +stream. + +**WARNING:** Client Library Debug Logging includes your data payloads in +plaintext, which could include sensitive data such as PII for yourself or your +customers, private keys, or other security data that could be compromising if +leaked. Always practice good data hygiene with your application logs, and follow +the principle of least access. Google also recommends that Client Library Debug +Logging be enabled only temporarily during active debugging, and not used +permanently in production. + +To enable logging, set the environment variable `GOOGLE_SDK_RUBY_LOGGING_GEMS` +to the value `all`. Alternatively, you can set the value to a comma-delimited +list of client library gem names. This will select the default logging behavior, +which writes logs to the standard error stream. On a local workstation, this may +result in logs appearing on the console. When running on a Google Cloud hosting +service such as [Google Cloud Run](https://cloud.google.com/run), this generally +results in logs appearing alongside your application logs in the +[Google Cloud Logging](https://cloud.google.com/logging/) service. + +You can customize logging by modifying the `logger` configuration when +constructing a client object. For example: + +```ruby +require "google/cloud/security_center/v2" +require "logger" + +client = ::Google::Cloud::SecurityCenter::V2::SecurityCenter::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-security_center`, +and lower-level _versioned_ client libraries with names such as +`google-cloud-security_center-v2`. +_In most cases, you should install the main client._ + +### What's the difference between the main client and a versioned client? + +A _versioned client_ provides a basic set of data types and client classes for +a _single version_ of a specific service. (That is, for a service with multiple +versions, there might be a separate versioned client for each service version.) +Most versioned clients are written and maintained by a code generator. + +The _main client_ is designed to provide you with the _recommended_ client +interfaces for the service. There will be only one main client for any given +service, even a service with multiple versions. The main client includes +factory methods for constructing the client objects we recommend for most +users. In some cases, those will be classes provided by an underlying versioned +client; in other cases, they will be handwritten higher-level client objects +with additional capabilities, convenience methods, or best practices built in. +Generally, the main client will default to a recommended service version, +although in some cases you can override this if you need to talk to a specific +service version. + +### Why would I want to use the main client? + +We recommend that most users install the main client gem for a service. You can +identify this gem as the one _without_ a version in its name, e.g. +`google-cloud-security_center`. +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-security_center-v2`. + +### What about the google-apis- clients? + +Client library gems with names that begin with `google-apis-` are based on an +older code generation technology. They talk to a REST/JSON backend (whereas +most modern clients talk to a [gRPC](https://grpc.io/) backend) and they may +not offer the same performance, features, and ease of use provided by more +modern clients. + +The `google-apis-` clients have wide coverage across Google services, so you +might need to use one if there is no modern client available for the service. +However, if a modern client is available, we generally recommend it over the +older `google-apis-` clients. diff --git a/owl-bot-staging/google-cloud-security_center-v2/Rakefile b/owl-bot-staging/google-cloud-security_center-v2/Rakefile new file mode 100644 index 000000000000..3f3dda612226 --- /dev/null +++ b/owl-bot-staging/google-cloud-security_center-v2/Rakefile @@ -0,0 +1,169 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +require "bundler/setup" +require "bundler/gem_tasks" + +require "rubocop/rake_task" +RuboCop::RakeTask.new + +require "rake/testtask" +desc "Run tests." +Rake::TestTask.new do |t| + t.libs << "test" + t.test_files = FileList["test/**/*_test.rb"] + t.warning = false +end + +desc "Runs the smoke tests." +Rake::TestTask.new :smoke_test do |t| + t.test_files = FileList["acceptance/**/*smoke_test.rb"] + t.warning = false +end + +# Acceptance tests +desc "Run the google-cloud-security_center-v2 acceptance tests." +task :acceptance, :project, :keyfile do |t, args| + project = args[:project] + project ||= + ENV["SECURITY_CENTER_TEST_PROJECT"] || + ENV["GCLOUD_TEST_PROJECT"] + keyfile = args[:keyfile] + keyfile ||= + ENV["SECURITY_CENTER_TEST_KEYFILE"] || + ENV["GCLOUD_TEST_KEYFILE"] + if keyfile + keyfile = File.read keyfile + else + keyfile ||= + ENV["SECURITY_CENTER_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 SECURITY_CENTER_TEST_PROJECT=test123 SECURITY_CENTER_TEST_KEYFILE=/path/to/keyfile.json rake acceptance" + end + require "google/cloud/security_center/v2/security_center/credentials" + ::Google::Cloud::SecurityCenter::V2::SecurityCenter::Credentials.env_vars.each do |path| + ENV[path] = nil + end + ENV["SECURITY_CENTER_PROJECT"] = project + ENV["SECURITY_CENTER_TEST_PROJECT"] = project + ENV["SECURITY_CENTER_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-security_center-v2 gem has no acceptance tests." + end + end + + desc "Run acceptance cleanup." + task :cleanup do + end +end + +task :samples do + Rake::Task["samples:latest"].invoke +end + +namespace :samples do + task :latest do + if File.directory? "samples" + Dir.chdir "samples" do + Bundler.with_clean_env do + ENV["GOOGLE_CLOUD_SAMPLES_TEST"] = "not_master" + sh "bundle update" + sh "bundle exec rake test" + end + end + else + puts "The google-cloud-security_center-v2 gem has no samples to test." + end + end + + task :master do + if File.directory? "samples" + Dir.chdir "samples" do + Bundler.with_clean_env do + ENV["GOOGLE_CLOUD_SAMPLES_TEST"] = "master" + sh "bundle update" + sh "bundle exec rake test" + end + end + else + puts "The google-cloud-security_center-v2 gem has no samples to test." + end + end +end + +require "yard" +require "yard/rake/yardoc_task" +YARD::Rake::YardocTask.new do |y| + y.options << "--fail-on-warning" +end + +desc "Run yard-doctest example tests." +task :doctest do + puts "The google-cloud-security_center-v2 gem does not have doctest tests." +end + +desc "Run the CI build" +task :ci do + header "BUILDING google-cloud-security_center-v2" + header "google-cloud-security_center-v2 rubocop", "*" + Rake::Task[:rubocop].invoke + header "google-cloud-security_center-v2 yard", "*" + Rake::Task[:yard].invoke + header "google-cloud-security_center-v2 test", "*" + Rake::Task[:test].invoke +end + +namespace :ci do + desc "Run the CI build, with smoke tests." + task :smoke_test do + Rake::Task[:ci].invoke + header "google-cloud-security_center-v2 smoke_test", "*" + Rake::Task[:smoke_test].invoke + end + desc "Run the CI build, with acceptance tests." + task :acceptance do + Rake::Task[:ci].invoke + header "google-cloud-security_center-v2 acceptance", "*" + Rake::Task[:acceptance].invoke + end + task :a do + # This is a handy shortcut to save typing + Rake::Task["ci:acceptance"].invoke + end +end + +task default: :test + +def header str, token = "#" + line_length = str.length + 8 + puts "" + puts token * line_length + puts "#{token * 3} #{str} #{token * 3}" + puts token * line_length + puts "" +end diff --git a/owl-bot-staging/google-cloud-security_center-v2/gapic_metadata.json b/owl-bot-staging/google-cloud-security_center-v2/gapic_metadata.json new file mode 100644 index 000000000000..8859452b344a --- /dev/null +++ b/owl-bot-staging/google-cloud-security_center-v2/gapic_metadata.json @@ -0,0 +1,218 @@ +{ + "schema": "1.0", + "comment": "This file maps proto services/RPCs to the corresponding library clients/methods", + "language": "ruby", + "protoPackage": "google.cloud.securitycenter.v2", + "libraryPackage": "::Google::Cloud::SecurityCenter::V2", + "services": { + "SecurityCenter": { + "clients": { + "grpc": { + "libraryClient": "::Google::Cloud::SecurityCenter::V2::SecurityCenter::Client", + "rpcs": { + "BatchCreateResourceValueConfigs": { + "methods": [ + "batch_create_resource_value_configs" + ] + }, + "BulkMuteFindings": { + "methods": [ + "bulk_mute_findings" + ] + }, + "CreateBigQueryExport": { + "methods": [ + "create_big_query_export" + ] + }, + "CreateFinding": { + "methods": [ + "create_finding" + ] + }, + "CreateMuteConfig": { + "methods": [ + "create_mute_config" + ] + }, + "CreateNotificationConfig": { + "methods": [ + "create_notification_config" + ] + }, + "CreateSource": { + "methods": [ + "create_source" + ] + }, + "DeleteBigQueryExport": { + "methods": [ + "delete_big_query_export" + ] + }, + "DeleteMuteConfig": { + "methods": [ + "delete_mute_config" + ] + }, + "DeleteNotificationConfig": { + "methods": [ + "delete_notification_config" + ] + }, + "DeleteResourceValueConfig": { + "methods": [ + "delete_resource_value_config" + ] + }, + "GetBigQueryExport": { + "methods": [ + "get_big_query_export" + ] + }, + "GetSimulation": { + "methods": [ + "get_simulation" + ] + }, + "GetValuedResource": { + "methods": [ + "get_valued_resource" + ] + }, + "GetIamPolicy": { + "methods": [ + "get_iam_policy" + ] + }, + "GetMuteConfig": { + "methods": [ + "get_mute_config" + ] + }, + "GetNotificationConfig": { + "methods": [ + "get_notification_config" + ] + }, + "GetResourceValueConfig": { + "methods": [ + "get_resource_value_config" + ] + }, + "GetSource": { + "methods": [ + "get_source" + ] + }, + "GroupFindings": { + "methods": [ + "group_findings" + ] + }, + "ListAttackPaths": { + "methods": [ + "list_attack_paths" + ] + }, + "ListBigQueryExports": { + "methods": [ + "list_big_query_exports" + ] + }, + "ListFindings": { + "methods": [ + "list_findings" + ] + }, + "ListMuteConfigs": { + "methods": [ + "list_mute_configs" + ] + }, + "ListNotificationConfigs": { + "methods": [ + "list_notification_configs" + ] + }, + "ListResourceValueConfigs": { + "methods": [ + "list_resource_value_configs" + ] + }, + "ListSources": { + "methods": [ + "list_sources" + ] + }, + "ListValuedResources": { + "methods": [ + "list_valued_resources" + ] + }, + "SetFindingState": { + "methods": [ + "set_finding_state" + ] + }, + "SetIamPolicy": { + "methods": [ + "set_iam_policy" + ] + }, + "SetMute": { + "methods": [ + "set_mute" + ] + }, + "TestIamPermissions": { + "methods": [ + "test_iam_permissions" + ] + }, + "UpdateBigQueryExport": { + "methods": [ + "update_big_query_export" + ] + }, + "UpdateExternalSystem": { + "methods": [ + "update_external_system" + ] + }, + "UpdateFinding": { + "methods": [ + "update_finding" + ] + }, + "UpdateMuteConfig": { + "methods": [ + "update_mute_config" + ] + }, + "UpdateNotificationConfig": { + "methods": [ + "update_notification_config" + ] + }, + "UpdateResourceValueConfig": { + "methods": [ + "update_resource_value_config" + ] + }, + "UpdateSecurityMarks": { + "methods": [ + "update_security_marks" + ] + }, + "UpdateSource": { + "methods": [ + "update_source" + ] + } + } + } + } + } + } +} diff --git a/owl-bot-staging/google-cloud-security_center-v2/google-cloud-security_center-v2.gemspec b/owl-bot-staging/google-cloud-security_center-v2/google-cloud-security_center-v2.gemspec new file mode 100644 index 000000000000..cd37d72545a4 --- /dev/null +++ b/owl-bot-staging/google-cloud-security_center-v2/google-cloud-security_center-v2.gemspec @@ -0,0 +1,29 @@ +# -*- ruby -*- +# encoding: utf-8 + +require File.expand_path("lib/google/cloud/security_center/v2/version", __dir__) + +Gem::Specification.new do |gem| + gem.name = "google-cloud-security_center-v2" + gem.version = Google::Cloud::SecurityCenter::V2::VERSION + + gem.authors = ["Google LLC"] + gem.email = "googleapis-packages@google.com" + gem.description = "Security Command Center API provides access to temporal views of assets and findings within an organization. Note that google-cloud-security_center-v2 is a version-specific client library. For most uses, we recommend installing the main client library google-cloud-security_center instead. See the readme for more details." + gem.summary = "Security Command Center API provides access to temporal views of assets and findings within an organization." + 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 "grpc-google-iam-v1", "~> 1.11" +end diff --git a/owl-bot-staging/google-cloud-security_center-v2/lib/google-cloud-security_center-v2.rb b/owl-bot-staging/google-cloud-security_center-v2/lib/google-cloud-security_center-v2.rb new file mode 100644 index 000000000000..fbfebf50a08d --- /dev/null +++ b/owl-bot-staging/google-cloud-security_center-v2/lib/google-cloud-security_center-v2.rb @@ -0,0 +1,21 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +# This gem does not autoload during Bundler.require. To load this gem, +# issue explicit require statements for the packages desired, e.g.: +# require "google/cloud/security_center/v2" diff --git a/owl-bot-staging/google-cloud-security_center-v2/lib/google/cloud/security_center/v2.rb b/owl-bot-staging/google-cloud-security_center-v2/lib/google/cloud/security_center/v2.rb new file mode 100644 index 000000000000..cb448baa8c34 --- /dev/null +++ b/owl-bot-staging/google-cloud-security_center-v2/lib/google/cloud/security_center/v2.rb @@ -0,0 +1,45 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +require "google/cloud/security_center/v2/security_center" +require "google/cloud/security_center/v2/version" + +module Google + module Cloud + module SecurityCenter + ## + # API client module. + # + # @example Load this package, including all its services, and instantiate a gRPC client + # + # require "google/cloud/security_center/v2" + # client = ::Google::Cloud::SecurityCenter::V2::SecurityCenter::Client.new + # + # @example Load this package, including all its services, and instantiate a REST client + # + # require "google/cloud/security_center/v2" + # client = ::Google::Cloud::SecurityCenter::V2::SecurityCenter::Rest::Client.new + # + module V2 + end + end + end +end + +helper_path = ::File.join __dir__, "v2", "_helpers.rb" +require "google/cloud/security_center/v2/_helpers" if ::File.file? helper_path diff --git a/owl-bot-staging/google-cloud-security_center-v2/lib/google/cloud/security_center/v2/rest.rb b/owl-bot-staging/google-cloud-security_center-v2/lib/google/cloud/security_center/v2/rest.rb new file mode 100644 index 000000000000..25ca637b14ef --- /dev/null +++ b/owl-bot-staging/google-cloud-security_center-v2/lib/google/cloud/security_center/v2/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/cloud/security_center/v2/security_center/rest" +require "google/cloud/security_center/v2/version" + +module Google + module Cloud + module SecurityCenter + ## + # To load just the REST part of this package, including all its services, and instantiate a REST client: + # + # @example + # + # require "google/cloud/security_center/v2/rest" + # client = ::Google::Cloud::SecurityCenter::V2::SecurityCenter::Rest::Client.new + # + module V2 + end + end + end +end diff --git a/owl-bot-staging/google-cloud-security_center-v2/lib/google/cloud/security_center/v2/security_center.rb b/owl-bot-staging/google-cloud-security_center-v2/lib/google/cloud/security_center/v2/security_center.rb new file mode 100644 index 000000000000..b2e61e4933b2 --- /dev/null +++ b/owl-bot-staging/google-cloud-security_center-v2/lib/google/cloud/security_center/v2/security_center.rb @@ -0,0 +1,56 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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/security_center/v2/version" + +require "google/cloud/security_center/v2/security_center/credentials" +require "google/cloud/security_center/v2/security_center/paths" +require "google/cloud/security_center/v2/security_center/operations" +require "google/cloud/security_center/v2/security_center/client" +require "google/cloud/security_center/v2/security_center/rest" + +module Google + module Cloud + module SecurityCenter + module V2 + ## + # V2 APIs for Security Center service. + # + # @example Load this service and instantiate a gRPC client + # + # require "google/cloud/security_center/v2/security_center" + # client = ::Google::Cloud::SecurityCenter::V2::SecurityCenter::Client.new + # + # @example Load this service and instantiate a REST client + # + # require "google/cloud/security_center/v2/security_center/rest" + # client = ::Google::Cloud::SecurityCenter::V2::SecurityCenter::Rest::Client.new + # + module SecurityCenter + end + end + end + end +end + +helper_path = ::File.join __dir__, "security_center", "helpers.rb" +require "google/cloud/security_center/v2/security_center/helpers" if ::File.file? helper_path diff --git a/owl-bot-staging/google-cloud-security_center-v2/lib/google/cloud/security_center/v2/security_center/client.rb b/owl-bot-staging/google-cloud-security_center-v2/lib/google/cloud/security_center/v2/security_center/client.rb new file mode 100644 index 000000000000..7c8e3827a971 --- /dev/null +++ b/owl-bot-staging/google-cloud-security_center-v2/lib/google/cloud/security_center/v2/security_center/client.rb @@ -0,0 +1,4791 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +require "google/cloud/errors" +require "google/cloud/securitycenter/v2/securitycenter_service_pb" + +module Google + module Cloud + module SecurityCenter + module V2 + module SecurityCenter + ## + # Client for the SecurityCenter service. + # + # V2 APIs for Security Center service. + # + class Client + # @private + API_VERSION = "" + + # @private + DEFAULT_ENDPOINT_TEMPLATE = "securitycenter.$UNIVERSE_DOMAIN$" + + include Paths + + # @private + attr_reader :security_center_stub + + ## + # Configure the SecurityCenter Client class. + # + # See {::Google::Cloud::SecurityCenter::V2::SecurityCenter::Client::Configuration} + # for a description of the configuration fields. + # + # @example + # + # # Modify the configuration for all SecurityCenter clients + # ::Google::Cloud::SecurityCenter::V2::SecurityCenter::Client.configure do |config| + # config.timeout = 10.0 + # end + # + # @yield [config] Configure the Client client. + # @yieldparam config [Client::Configuration] + # + # @return [Client::Configuration] + # + def self.configure + @configure ||= begin + namespace = ["Google", "Cloud", "SecurityCenter", "V2"] + parent_config = while namespace.any? + parent_name = namespace.join "::" + parent_const = const_get parent_name + break parent_const.configure if parent_const.respond_to? :configure + namespace.pop + end + default_config = Client::Configuration.new parent_config + + default_config + end + yield @configure if block_given? + @configure + end + + ## + # Configure the SecurityCenter Client instance. + # + # The configuration is set to the derived mode, meaning that values can be changed, + # but structural changes (adding new fields, etc.) are not allowed. Structural changes + # should be made on {Client.configure}. + # + # See {::Google::Cloud::SecurityCenter::V2::SecurityCenter::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 + @security_center_stub.universe_domain + end + + ## + # Create a new SecurityCenter client object. + # + # @example + # + # # Create a client using the default configuration + # client = ::Google::Cloud::SecurityCenter::V2::SecurityCenter::Client.new + # + # # Create a client using a custom configuration + # client = ::Google::Cloud::SecurityCenter::V2::SecurityCenter::Client.new do |config| + # config.timeout = 10.0 + # end + # + # @yield [config] Configure the SecurityCenter client. + # @yieldparam config [Client::Configuration] + # + def initialize + # These require statements are intentionally placed here to initialize + # the gRPC module only when it's required. + # See https://github.com/googleapis/toolkit/issues/446 + require "gapic/grpc" + require "google/cloud/securitycenter/v2/securitycenter_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 + + @security_center_stub = ::Gapic::ServiceStub.new( + ::Google::Cloud::SecurityCenter::V2::SecurityCenter::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 + ) + + @security_center_stub.stub_logger&.info do |entry| + entry.set_system_name + entry.set_service + entry.message = "Created client for #{entry.service}" + entry.set_credentials_fields credentials + entry.set "customEndpoint", @config.endpoint if @config.endpoint + entry.set "defaultTimeout", @config.timeout if @config.timeout + entry.set "quotaProject", @quota_project_id if @quota_project_id + end + end + + ## + # Get the associated client for long-running operations. + # + # @return [::Google::Cloud::SecurityCenter::V2::SecurityCenter::Operations] + # + attr_reader :operations_client + + ## + # The logger used for request/response debug logging. + # + # @return [Logger] + # + def logger + @security_center_stub.logger + end + + # Service calls + + ## + # Creates a ResourceValueConfig for an organization. Maps user's tags to + # difference resource values for use by the attack path simulation. + # + # @overload batch_create_resource_value_configs(request, options = nil) + # Pass arguments to `batch_create_resource_value_configs` via a request object, either of type + # {::Google::Cloud::SecurityCenter::V2::BatchCreateResourceValueConfigsRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::SecurityCenter::V2::BatchCreateResourceValueConfigsRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. + # + # @overload batch_create_resource_value_configs(parent: nil, requests: nil) + # Pass arguments to `batch_create_resource_value_configs` via keyword arguments. Note that at + # least one keyword argument is 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. Resource name of the new ResourceValueConfig's parent. + # The parent field in the CreateResourceValueConfigRequest + # messages must either be empty or match this field. + # @param requests [::Array<::Google::Cloud::SecurityCenter::V2::CreateResourceValueConfigRequest, ::Hash>] + # Required. The resource value configs to be created. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Google::Cloud::SecurityCenter::V2::BatchCreateResourceValueConfigsResponse] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Google::Cloud::SecurityCenter::V2::BatchCreateResourceValueConfigsResponse] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/security_center/v2" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::SecurityCenter::V2::SecurityCenter::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::SecurityCenter::V2::BatchCreateResourceValueConfigsRequest.new + # + # # Call the batch_create_resource_value_configs method. + # result = client.batch_create_resource_value_configs request + # + # # The returned object is of type Google::Cloud::SecurityCenter::V2::BatchCreateResourceValueConfigsResponse. + # p result + # + def batch_create_resource_value_configs request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::SecurityCenter::V2::BatchCreateResourceValueConfigsRequest + + # Converts hash 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.batch_create_resource_value_configs.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::SecurityCenter::V2::VERSION + metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.parent + 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.batch_create_resource_value_configs.timeout, + metadata: metadata, + retry_policy: @config.rpcs.batch_create_resource_value_configs.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @security_center_stub.call_rpc :batch_create_resource_value_configs, 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 + + ## + # Kicks off an LRO to bulk mute findings for a parent based on a filter. If + # no location is specified, findings are muted in global. The parent + # can be either an organization, folder, or project. The findings matched by + # the filter will be muted after the LRO is done. + # + # @overload bulk_mute_findings(request, options = nil) + # Pass arguments to `bulk_mute_findings` via a request object, either of type + # {::Google::Cloud::SecurityCenter::V2::BulkMuteFindingsRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::SecurityCenter::V2::BulkMuteFindingsRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. + # + # @overload bulk_mute_findings(parent: nil, filter: nil, mute_state: nil) + # Pass arguments to `bulk_mute_findings` via keyword arguments. Note that at + # least one keyword argument is 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, at which bulk action needs to be applied. If no + # location is specified, findings are updated in global. The following list + # shows some examples: + # + # + `organizations/[organization_id]` + # + `organizations/[organization_id]/locations/[location_id]` + # + `folders/[folder_id]` + # + `folders/[folder_id]/locations/[location_id]` + # + `projects/[project_id]` + # + `projects/[project_id]/locations/[location_id]` + # @param filter [::String] + # Expression that identifies findings that should be updated. + # The expression is a list of zero or more restrictions combined + # via logical operators `AND` and `OR`. Parentheses are supported, and `OR` + # has higher precedence than `AND`. + # + # Restrictions have the form ` ` and may have a + # `-` character in front of them to indicate negation. The fields map to + # those defined in the corresponding resource. + # + # The supported operators are: + # + # * `=` for all value types. + # * `>`, `<`, `>=`, `<=` for integer values. + # * `:`, meaning substring matching, for strings. + # + # The supported value types are: + # + # * string literals in quotes. + # * integer literals without quotes. + # * boolean literals `true` and `false` without quotes. + # @param mute_state [::Google::Cloud::SecurityCenter::V2::BulkMuteFindingsRequest::MuteState] + # Optional. All findings matching the given filter will have their mute state + # set to this value. The default value is `MUTED`. Setting this to + # `UNDEFINED` will clear the mute state on all matching findings. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Gapic::Operation] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Gapic::Operation] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/security_center/v2" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::SecurityCenter::V2::SecurityCenter::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::SecurityCenter::V2::BulkMuteFindingsRequest.new + # + # # Call the bulk_mute_findings method. + # result = client.bulk_mute_findings 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 bulk_mute_findings request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::SecurityCenter::V2::BulkMuteFindingsRequest + + # Converts hash 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.bulk_mute_findings.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::SecurityCenter::V2::VERSION + metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.parent + 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.bulk_mute_findings.timeout, + metadata: metadata, + retry_policy: @config.rpcs.bulk_mute_findings.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @security_center_stub.call_rpc :bulk_mute_findings, 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 + + ## + # Creates a BigQuery export. + # + # @overload create_big_query_export(request, options = nil) + # Pass arguments to `create_big_query_export` via a request object, either of type + # {::Google::Cloud::SecurityCenter::V2::CreateBigQueryExportRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::SecurityCenter::V2::CreateBigQueryExportRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_big_query_export(parent: nil, big_query_export: nil, big_query_export_id: nil) + # Pass arguments to `create_big_query_export` via keyword arguments. Note that at + # least one keyword argument is 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 name of the parent resource of the new BigQuery export. Its + # format is `organizations/[organization_id]/locations/[location_id]`, + # `folders/[folder_id]/locations/[location_id]`, or + # `projects/[project_id]/locations/[location_id]`. + # @param big_query_export [::Google::Cloud::SecurityCenter::V2::BigQueryExport, ::Hash] + # Required. The BigQuery export being created. + # @param big_query_export_id [::String] + # Required. Unique identifier provided by the client within the parent scope. + # It must consist of only lowercase letters, numbers, and hyphens, must start + # with a letter, must end with either a letter or a number, and must be 63 + # characters or less. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Google::Cloud::SecurityCenter::V2::BigQueryExport] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Google::Cloud::SecurityCenter::V2::BigQueryExport] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/security_center/v2" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::SecurityCenter::V2::SecurityCenter::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::SecurityCenter::V2::CreateBigQueryExportRequest.new + # + # # Call the create_big_query_export method. + # result = client.create_big_query_export request + # + # # The returned object is of type Google::Cloud::SecurityCenter::V2::BigQueryExport. + # p result + # + def create_big_query_export request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::SecurityCenter::V2::CreateBigQueryExportRequest + + # Converts hash 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_big_query_export.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::SecurityCenter::V2::VERSION + metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.parent + 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_big_query_export.timeout, + metadata: metadata, + retry_policy: @config.rpcs.create_big_query_export.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @security_center_stub.call_rpc :create_big_query_export, request, options: options do |response, operation| + yield response, operation if block_given? + end + rescue ::GRPC::BadStatus => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Creates a finding in a location. The corresponding source must exist for + # finding creation to succeed. + # + # @overload create_finding(request, options = nil) + # Pass arguments to `create_finding` via a request object, either of type + # {::Google::Cloud::SecurityCenter::V2::CreateFindingRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::SecurityCenter::V2::CreateFindingRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_finding(parent: nil, finding_id: nil, finding: nil) + # Pass arguments to `create_finding` via keyword arguments. Note that at + # least one keyword argument is 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. Resource name of the new finding's parent. The following list + # shows some examples of the format: + # + + # `organizations/[organization_id]/sources/[source_id]` + # + + # `organizations/[organization_id]/sources/[source_id]/locations/[location_id]` + # @param finding_id [::String] + # Required. Unique identifier provided by the client within the parent scope. + # It must be alphanumeric and less than or equal to 32 characters and + # greater than 0 characters in length. + # @param finding [::Google::Cloud::SecurityCenter::V2::Finding, ::Hash] + # Required. The Finding being created. The name and security_marks will be + # ignored as they are both output only fields on this resource. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Google::Cloud::SecurityCenter::V2::Finding] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Google::Cloud::SecurityCenter::V2::Finding] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/security_center/v2" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::SecurityCenter::V2::SecurityCenter::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::SecurityCenter::V2::CreateFindingRequest.new + # + # # Call the create_finding method. + # result = client.create_finding request + # + # # The returned object is of type Google::Cloud::SecurityCenter::V2::Finding. + # p result + # + def create_finding request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::SecurityCenter::V2::CreateFindingRequest + + # Converts hash 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_finding.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::SecurityCenter::V2::VERSION + metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.parent + 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_finding.timeout, + metadata: metadata, + retry_policy: @config.rpcs.create_finding.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @security_center_stub.call_rpc :create_finding, request, options: options do |response, operation| + yield response, operation if block_given? + end + rescue ::GRPC::BadStatus => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Creates a mute config. + # + # @overload create_mute_config(request, options = nil) + # Pass arguments to `create_mute_config` via a request object, either of type + # {::Google::Cloud::SecurityCenter::V2::CreateMuteConfigRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::SecurityCenter::V2::CreateMuteConfigRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_mute_config(parent: nil, mute_config: nil, mute_config_id: nil) + # Pass arguments to `create_mute_config` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param parent [::String] + # Required. Resource name of the new mute configs's parent. Its format is + # `organizations/[organization_id]/locations/[location_id]`, + # `folders/[folder_id]/locations/[location_id]`, or + # `projects/[project_id]/locations/[location_id]`. + # @param mute_config [::Google::Cloud::SecurityCenter::V2::MuteConfig, ::Hash] + # Required. The mute config being created. + # @param mute_config_id [::String] + # Required. Unique identifier provided by the client within the parent scope. + # It must consist of only lowercase letters, numbers, and hyphens, must start + # with a letter, must end with either a letter or a number, and must be 63 + # characters or less. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Google::Cloud::SecurityCenter::V2::MuteConfig] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Google::Cloud::SecurityCenter::V2::MuteConfig] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/security_center/v2" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::SecurityCenter::V2::SecurityCenter::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::SecurityCenter::V2::CreateMuteConfigRequest.new + # + # # Call the create_mute_config method. + # result = client.create_mute_config request + # + # # The returned object is of type Google::Cloud::SecurityCenter::V2::MuteConfig. + # p result + # + def create_mute_config request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::SecurityCenter::V2::CreateMuteConfigRequest + + # Converts hash 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_mute_config.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::SecurityCenter::V2::VERSION + metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.parent + regex_match = %r{^projects/[^/]+/locations/(?[^/]+)/?$}.match request.parent + if regex_match + header_params["location"] = regex_match["location".to_s] + end + end + if request.parent + regex_match = %r{^organizations/[^/]+/locations/(?[^/]+)/?$}.match request.parent + if regex_match + header_params["location"] = regex_match["location".to_s] + end + end + if request.parent + regex_match = %r{^folders/[^/]+/locations/(?[^/]+)/?$}.match request.parent + if regex_match + header_params["location"] = regex_match["location".to_s] + end + end + + request_params_header = URI.encode_www_form header_params + metadata[:"x-goog-request-params"] ||= request_params_header + + options.apply_defaults timeout: @config.rpcs.create_mute_config.timeout, + metadata: metadata, + retry_policy: @config.rpcs.create_mute_config.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @security_center_stub.call_rpc :create_mute_config, request, options: options do |response, operation| + yield response, operation if block_given? + end + rescue ::GRPC::BadStatus => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Creates a notification config. + # + # @overload create_notification_config(request, options = nil) + # Pass arguments to `create_notification_config` via a request object, either of type + # {::Google::Cloud::SecurityCenter::V2::CreateNotificationConfigRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::SecurityCenter::V2::CreateNotificationConfigRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_notification_config(parent: nil, config_id: nil, notification_config: nil) + # Pass arguments to `create_notification_config` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param parent [::String] + # Required. Resource name of the new notification config's parent. Its format + # is `organizations/[organization_id]/locations/[location_id]`, + # `folders/[folder_id]/locations/[location_id]`, or + # `projects/[project_id]/locations/[location_id]`. + # @param config_id [::String] + # Required. + # Unique identifier provided by the client within the parent scope. + # It must be between 1 and 128 characters and contain alphanumeric + # characters, underscores, or hyphens only. + # @param notification_config [::Google::Cloud::SecurityCenter::V2::NotificationConfig, ::Hash] + # Required. The notification config being created. The name and the service + # account will be ignored as they are both output only fields on this + # resource. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Google::Cloud::SecurityCenter::V2::NotificationConfig] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Google::Cloud::SecurityCenter::V2::NotificationConfig] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/security_center/v2" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::SecurityCenter::V2::SecurityCenter::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::SecurityCenter::V2::CreateNotificationConfigRequest.new + # + # # Call the create_notification_config method. + # result = client.create_notification_config request + # + # # The returned object is of type Google::Cloud::SecurityCenter::V2::NotificationConfig. + # p result + # + def create_notification_config request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::SecurityCenter::V2::CreateNotificationConfigRequest + + # Converts hash 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_notification_config.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::SecurityCenter::V2::VERSION + metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.parent + 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_notification_config.timeout, + metadata: metadata, + retry_policy: @config.rpcs.create_notification_config.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @security_center_stub.call_rpc :create_notification_config, request, options: options do |response, operation| + yield response, operation if block_given? + end + rescue ::GRPC::BadStatus => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Creates a source. + # + # @overload create_source(request, options = nil) + # Pass arguments to `create_source` via a request object, either of type + # {::Google::Cloud::SecurityCenter::V2::CreateSourceRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::SecurityCenter::V2::CreateSourceRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_source(parent: nil, source: nil) + # Pass arguments to `create_source` via keyword arguments. Note that at + # least one keyword argument is 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. Resource name of the new source's parent. Its format should be + # `organizations/[organization_id]`. + # @param source [::Google::Cloud::SecurityCenter::V2::Source, ::Hash] + # Required. The Source being created, only the display_name and description + # will be used. All other fields will be ignored. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Google::Cloud::SecurityCenter::V2::Source] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Google::Cloud::SecurityCenter::V2::Source] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/security_center/v2" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::SecurityCenter::V2::SecurityCenter::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::SecurityCenter::V2::CreateSourceRequest.new + # + # # Call the create_source method. + # result = client.create_source request + # + # # The returned object is of type Google::Cloud::SecurityCenter::V2::Source. + # p result + # + def create_source request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::SecurityCenter::V2::CreateSourceRequest + + # Converts hash 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_source.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::SecurityCenter::V2::VERSION + metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.parent + 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_source.timeout, + metadata: metadata, + retry_policy: @config.rpcs.create_source.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @security_center_stub.call_rpc :create_source, request, options: options do |response, operation| + yield response, operation if block_given? + end + rescue ::GRPC::BadStatus => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Deletes an existing BigQuery export. + # + # @overload delete_big_query_export(request, options = nil) + # Pass arguments to `delete_big_query_export` via a request object, either of type + # {::Google::Cloud::SecurityCenter::V2::DeleteBigQueryExportRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::SecurityCenter::V2::DeleteBigQueryExportRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_big_query_export(name: nil) + # Pass arguments to `delete_big_query_export` via keyword arguments. Note that at + # least one keyword argument is 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 BigQuery export to delete. The following list + # shows some examples of the format: + # + # + + # `organizations/{organization}/locations/{location}/bigQueryExports/{export_id}` + # + `folders/{folder}/locations/{location}/bigQueryExports/{export_id}` + # + `projects/{project}/locations/{location}/bigQueryExports/{export_id}` + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Google::Protobuf::Empty] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Google::Protobuf::Empty] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/security_center/v2" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::SecurityCenter::V2::SecurityCenter::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::SecurityCenter::V2::DeleteBigQueryExportRequest.new + # + # # Call the delete_big_query_export method. + # result = client.delete_big_query_export request + # + # # The returned object is of type Google::Protobuf::Empty. + # p result + # + def delete_big_query_export request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::SecurityCenter::V2::DeleteBigQueryExportRequest + + # Converts hash 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_big_query_export.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::SecurityCenter::V2::VERSION + metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.name + header_params["name"] = request.name + end + + request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") + metadata[:"x-goog-request-params"] ||= request_params_header + + options.apply_defaults timeout: @config.rpcs.delete_big_query_export.timeout, + metadata: metadata, + retry_policy: @config.rpcs.delete_big_query_export.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @security_center_stub.call_rpc :delete_big_query_export, request, options: options do |response, operation| + yield response, operation if block_given? + end + rescue ::GRPC::BadStatus => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Deletes an existing mute config. If no location is specified, default is + # global. + # + # @overload delete_mute_config(request, options = nil) + # Pass arguments to `delete_mute_config` via a request object, either of type + # {::Google::Cloud::SecurityCenter::V2::DeleteMuteConfigRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::SecurityCenter::V2::DeleteMuteConfigRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_mute_config(name: nil) + # Pass arguments to `delete_mute_config` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param name [::String] + # Required. Name of the mute config to delete. The following list shows some + # examples of the format: + # + # + `organizations/{organization}/muteConfigs/{config_id}` + # + + # `organizations/{organization}/locations/{location}/muteConfigs/{config_id}` + # + `folders/{folder}/muteConfigs/{config_id}` + # + `folders/{folder}/locations/{location}/muteConfigs/{config_id}` + # + `projects/{project}/muteConfigs/{config_id}` + # + `projects/{project}/locations/{location}/muteConfigs/{config_id}` + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Google::Protobuf::Empty] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Google::Protobuf::Empty] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/security_center/v2" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::SecurityCenter::V2::SecurityCenter::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::SecurityCenter::V2::DeleteMuteConfigRequest.new + # + # # Call the delete_mute_config method. + # result = client.delete_mute_config request + # + # # The returned object is of type Google::Protobuf::Empty. + # p result + # + def delete_mute_config request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::SecurityCenter::V2::DeleteMuteConfigRequest + + # Converts hash 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_mute_config.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::SecurityCenter::V2::VERSION + metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.name + regex_match = %r{^projects/[^/]+/locations/(?[^/]+)/muteConfigs/[^/]+/?$}.match request.name + if regex_match + header_params["location"] = regex_match["location".to_s] + end + end + if request.name + regex_match = %r{^organizations/[^/]+/locations/(?[^/]+)/muteConfigs/[^/]+/?$}.match request.name + if regex_match + header_params["location"] = regex_match["location".to_s] + end + end + if request.name + regex_match = %r{^folders/[^/]+/locations/(?[^/]+)/muteConfigs/[^/]+/?$}.match request.name + if regex_match + header_params["location"] = regex_match["location".to_s] + end + end + + request_params_header = URI.encode_www_form header_params + metadata[:"x-goog-request-params"] ||= request_params_header + + options.apply_defaults timeout: @config.rpcs.delete_mute_config.timeout, + metadata: metadata, + retry_policy: @config.rpcs.delete_mute_config.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @security_center_stub.call_rpc :delete_mute_config, request, options: options do |response, operation| + yield response, operation if block_given? + end + rescue ::GRPC::BadStatus => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Deletes a notification config. + # + # @overload delete_notification_config(request, options = nil) + # Pass arguments to `delete_notification_config` via a request object, either of type + # {::Google::Cloud::SecurityCenter::V2::DeleteNotificationConfigRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::SecurityCenter::V2::DeleteNotificationConfigRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_notification_config(name: nil) + # Pass arguments to `delete_notification_config` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param name [::String] + # Required. Name of the notification config to delete. The following list + # shows some examples of the format: + # + # + + # `organizations/[organization_id]/locations/[location_id]/notificationConfigs/[config_id]` + # + + # `folders/[folder_id]/locations/[location_id]notificationConfigs/[config_id]` + # + + # `projects/[project_id]/locations/[location_id]notificationConfigs/[config_id]` + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Google::Protobuf::Empty] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Google::Protobuf::Empty] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/security_center/v2" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::SecurityCenter::V2::SecurityCenter::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::SecurityCenter::V2::DeleteNotificationConfigRequest.new + # + # # Call the delete_notification_config method. + # result = client.delete_notification_config request + # + # # The returned object is of type Google::Protobuf::Empty. + # p result + # + def delete_notification_config request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::SecurityCenter::V2::DeleteNotificationConfigRequest + + # Converts hash 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_notification_config.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::SecurityCenter::V2::VERSION + metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.name + header_params["name"] = request.name + end + + request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") + metadata[:"x-goog-request-params"] ||= request_params_header + + options.apply_defaults timeout: @config.rpcs.delete_notification_config.timeout, + metadata: metadata, + retry_policy: @config.rpcs.delete_notification_config.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @security_center_stub.call_rpc :delete_notification_config, request, options: options do |response, operation| + yield response, operation if block_given? + end + rescue ::GRPC::BadStatus => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Deletes a ResourceValueConfig. + # + # @overload delete_resource_value_config(request, options = nil) + # Pass arguments to `delete_resource_value_config` via a request object, either of type + # {::Google::Cloud::SecurityCenter::V2::DeleteResourceValueConfigRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::SecurityCenter::V2::DeleteResourceValueConfigRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_resource_value_config(name: nil) + # Pass arguments to `delete_resource_value_config` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param name [::String] + # Required. Name of the ResourceValueConfig to delete + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Google::Protobuf::Empty] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Google::Protobuf::Empty] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/security_center/v2" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::SecurityCenter::V2::SecurityCenter::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::SecurityCenter::V2::DeleteResourceValueConfigRequest.new + # + # # Call the delete_resource_value_config method. + # result = client.delete_resource_value_config request + # + # # The returned object is of type Google::Protobuf::Empty. + # p result + # + def delete_resource_value_config request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::SecurityCenter::V2::DeleteResourceValueConfigRequest + + # Converts hash 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_resource_value_config.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::SecurityCenter::V2::VERSION + metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.name + header_params["name"] = request.name + end + + request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") + metadata[:"x-goog-request-params"] ||= request_params_header + + options.apply_defaults timeout: @config.rpcs.delete_resource_value_config.timeout, + metadata: metadata, + retry_policy: @config.rpcs.delete_resource_value_config.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @security_center_stub.call_rpc :delete_resource_value_config, request, options: options do |response, operation| + yield response, operation if block_given? + end + rescue ::GRPC::BadStatus => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Gets a BigQuery export. + # + # @overload get_big_query_export(request, options = nil) + # Pass arguments to `get_big_query_export` via a request object, either of type + # {::Google::Cloud::SecurityCenter::V2::GetBigQueryExportRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::SecurityCenter::V2::GetBigQueryExportRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_big_query_export(name: nil) + # Pass arguments to `get_big_query_export` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param name [::String] + # Required. Name of the BigQuery export to retrieve. The following list shows + # some examples of the format: + # + # + + # `organizations/{organization}/locations/{location}/bigQueryExports/{export_id}` + # + `folders/{folder}/locations/{location}/bigQueryExports/{export_id}` + # + `projects/{project}locations/{location}//bigQueryExports/{export_id}` + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Google::Cloud::SecurityCenter::V2::BigQueryExport] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Google::Cloud::SecurityCenter::V2::BigQueryExport] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/security_center/v2" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::SecurityCenter::V2::SecurityCenter::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::SecurityCenter::V2::GetBigQueryExportRequest.new + # + # # Call the get_big_query_export method. + # result = client.get_big_query_export request + # + # # The returned object is of type Google::Cloud::SecurityCenter::V2::BigQueryExport. + # p result + # + def get_big_query_export request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::SecurityCenter::V2::GetBigQueryExportRequest + + # Converts hash 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_big_query_export.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::SecurityCenter::V2::VERSION + metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.name + header_params["name"] = request.name + end + + request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") + metadata[:"x-goog-request-params"] ||= request_params_header + + options.apply_defaults timeout: @config.rpcs.get_big_query_export.timeout, + metadata: metadata, + retry_policy: @config.rpcs.get_big_query_export.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @security_center_stub.call_rpc :get_big_query_export, 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 + + ## + # Get the simulation by name or the latest simulation for the given + # organization. + # + # @overload get_simulation(request, options = nil) + # Pass arguments to `get_simulation` via a request object, either of type + # {::Google::Cloud::SecurityCenter::V2::GetSimulationRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::SecurityCenter::V2::GetSimulationRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_simulation(name: nil) + # Pass arguments to `get_simulation` via keyword arguments. Note that at + # least one keyword argument is 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 organization name or simulation name of this simulation + # + # Valid format: + # `organizations/{organization}/simulations/latest` + # `organizations/{organization}/simulations/{simulation}` + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Google::Cloud::SecurityCenter::V2::Simulation] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Google::Cloud::SecurityCenter::V2::Simulation] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/security_center/v2" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::SecurityCenter::V2::SecurityCenter::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::SecurityCenter::V2::GetSimulationRequest.new + # + # # Call the get_simulation method. + # result = client.get_simulation request + # + # # The returned object is of type Google::Cloud::SecurityCenter::V2::Simulation. + # p result + # + def get_simulation request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::SecurityCenter::V2::GetSimulationRequest + + # Converts hash 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_simulation.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::SecurityCenter::V2::VERSION + metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.name + header_params["name"] = request.name + end + + request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") + metadata[:"x-goog-request-params"] ||= request_params_header + + options.apply_defaults timeout: @config.rpcs.get_simulation.timeout, + metadata: metadata, + retry_policy: @config.rpcs.get_simulation.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @security_center_stub.call_rpc :get_simulation, 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 + + ## + # Get the valued resource by name + # + # @overload get_valued_resource(request, options = nil) + # Pass arguments to `get_valued_resource` via a request object, either of type + # {::Google::Cloud::SecurityCenter::V2::GetValuedResourceRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::SecurityCenter::V2::GetValuedResourceRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_valued_resource(name: nil) + # Pass arguments to `get_valued_resource` via keyword arguments. Note that at + # least one keyword argument is 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 this valued resource + # + # Valid format: + # `organizations/{organization}/simulations/{simulation}/valuedResources/{valued_resource}` + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Google::Cloud::SecurityCenter::V2::ValuedResource] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Google::Cloud::SecurityCenter::V2::ValuedResource] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/security_center/v2" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::SecurityCenter::V2::SecurityCenter::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::SecurityCenter::V2::GetValuedResourceRequest.new + # + # # Call the get_valued_resource method. + # result = client.get_valued_resource request + # + # # The returned object is of type Google::Cloud::SecurityCenter::V2::ValuedResource. + # p result + # + def get_valued_resource request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::SecurityCenter::V2::GetValuedResourceRequest + + # Converts hash 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_valued_resource.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::SecurityCenter::V2::VERSION + metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.name + header_params["name"] = request.name + end + + request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") + metadata[:"x-goog-request-params"] ||= request_params_header + + options.apply_defaults timeout: @config.rpcs.get_valued_resource.timeout, + metadata: metadata, + retry_policy: @config.rpcs.get_valued_resource.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @security_center_stub.call_rpc :get_valued_resource, request, options: options do |response, operation| + yield response, operation if block_given? + end + rescue ::GRPC::BadStatus => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Gets the access control policy on the specified Source. + # + # @overload get_iam_policy(request, options = nil) + # Pass arguments to `get_iam_policy` via a request object, either of type + # {::Google::Iam::V1::GetIamPolicyRequest} or an equivalent Hash. + # + # @param request [::Google::Iam::V1::GetIamPolicyRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. + # + # @overload get_iam_policy(resource: nil, options: nil) + # Pass arguments to `get_iam_policy` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param resource [::String] + # REQUIRED: The resource for which the policy is being requested. + # See the operation documentation for the appropriate value for this field. + # @param options [::Google::Iam::V1::GetPolicyOptions, ::Hash] + # OPTIONAL: A `GetPolicyOptions` object for specifying options to + # `GetIamPolicy`. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Google::Iam::V1::Policy] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Google::Iam::V1::Policy] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/security_center/v2" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::SecurityCenter::V2::SecurityCenter::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Iam::V1::GetIamPolicyRequest.new + # + # # Call the get_iam_policy method. + # result = client.get_iam_policy request + # + # # The returned object is of type Google::Iam::V1::Policy. + # p result + # + def get_iam_policy request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Iam::V1::GetIamPolicyRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + metadata = @config.rpcs.get_iam_policy.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::SecurityCenter::V2::VERSION + metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.resource + header_params["resource"] = request.resource + end + + request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") + metadata[:"x-goog-request-params"] ||= request_params_header + + options.apply_defaults timeout: @config.rpcs.get_iam_policy.timeout, + metadata: metadata, + retry_policy: @config.rpcs.get_iam_policy.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @security_center_stub.call_rpc :get_iam_policy, request, options: options do |response, operation| + yield response, operation if block_given? + end + rescue ::GRPC::BadStatus => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Gets a mute config. If no location is specified, default is + # global. + # + # @overload get_mute_config(request, options = nil) + # Pass arguments to `get_mute_config` via a request object, either of type + # {::Google::Cloud::SecurityCenter::V2::GetMuteConfigRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::SecurityCenter::V2::GetMuteConfigRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_mute_config(name: nil) + # Pass arguments to `get_mute_config` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param name [::String] + # Required. Name of the mute config to retrieve. The following list shows + # some examples of the format: + # + # + `organizations/{organization}/muteConfigs/{config_id}` + # + + # `organizations/{organization}/locations/{location}/muteConfigs/{config_id}` + # + `folders/{folder}/muteConfigs/{config_id}` + # + `folders/{folder}/locations/{location}/muteConfigs/{config_id}` + # + `projects/{project}/muteConfigs/{config_id}` + # + `projects/{project}/locations/{location}/muteConfigs/{config_id}` + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Google::Cloud::SecurityCenter::V2::MuteConfig] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Google::Cloud::SecurityCenter::V2::MuteConfig] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/security_center/v2" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::SecurityCenter::V2::SecurityCenter::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::SecurityCenter::V2::GetMuteConfigRequest.new + # + # # Call the get_mute_config method. + # result = client.get_mute_config request + # + # # The returned object is of type Google::Cloud::SecurityCenter::V2::MuteConfig. + # p result + # + def get_mute_config request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::SecurityCenter::V2::GetMuteConfigRequest + + # Converts hash 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_mute_config.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::SecurityCenter::V2::VERSION + metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.name + regex_match = %r{^projects/[^/]+/locations/(?[^/]+)/muteConfigs/[^/]+/?$}.match request.name + if regex_match + header_params["location"] = regex_match["location".to_s] + end + end + if request.name + regex_match = %r{^organizations/[^/]+/locations/(?[^/]+)/muteConfigs/[^/]+/?$}.match request.name + if regex_match + header_params["location"] = regex_match["location".to_s] + end + end + if request.name + regex_match = %r{^folders/[^/]+/locations/(?[^/]+)/muteConfigs/[^/]+/?$}.match request.name + if regex_match + header_params["location"] = regex_match["location".to_s] + end + end + + request_params_header = URI.encode_www_form header_params + metadata[:"x-goog-request-params"] ||= request_params_header + + options.apply_defaults timeout: @config.rpcs.get_mute_config.timeout, + metadata: metadata, + retry_policy: @config.rpcs.get_mute_config.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @security_center_stub.call_rpc :get_mute_config, request, options: options do |response, operation| + yield response, operation if block_given? + end + rescue ::GRPC::BadStatus => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Gets a notification config. + # + # @overload get_notification_config(request, options = nil) + # Pass arguments to `get_notification_config` via a request object, either of type + # {::Google::Cloud::SecurityCenter::V2::GetNotificationConfigRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::SecurityCenter::V2::GetNotificationConfigRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_notification_config(name: nil) + # Pass arguments to `get_notification_config` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param name [::String] + # Required. Name of the notification config to get. The following list shows + # some examples of the format: + # + # + + # `organizations/[organization_id]/locations/[location_id]/notificationConfigs/[config_id]` + # + + # `folders/[folder_id]/locations/[location_id]/notificationConfigs/[config_id]` + # + + # `projects/[project_id]/locations/[location_id]/notificationConfigs/[config_id]` + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Google::Cloud::SecurityCenter::V2::NotificationConfig] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Google::Cloud::SecurityCenter::V2::NotificationConfig] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/security_center/v2" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::SecurityCenter::V2::SecurityCenter::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::SecurityCenter::V2::GetNotificationConfigRequest.new + # + # # Call the get_notification_config method. + # result = client.get_notification_config request + # + # # The returned object is of type Google::Cloud::SecurityCenter::V2::NotificationConfig. + # p result + # + def get_notification_config request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::SecurityCenter::V2::GetNotificationConfigRequest + + # Converts hash 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_notification_config.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::SecurityCenter::V2::VERSION + metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.name + header_params["name"] = request.name + end + + request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") + metadata[:"x-goog-request-params"] ||= request_params_header + + options.apply_defaults timeout: @config.rpcs.get_notification_config.timeout, + metadata: metadata, + retry_policy: @config.rpcs.get_notification_config.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @security_center_stub.call_rpc :get_notification_config, request, options: options do |response, operation| + yield response, operation if block_given? + end + rescue ::GRPC::BadStatus => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Gets a ResourceValueConfig. + # + # @overload get_resource_value_config(request, options = nil) + # Pass arguments to `get_resource_value_config` via a request object, either of type + # {::Google::Cloud::SecurityCenter::V2::GetResourceValueConfigRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::SecurityCenter::V2::GetResourceValueConfigRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_resource_value_config(name: nil) + # Pass arguments to `get_resource_value_config` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param name [::String] + # Required. Name of the resource value config to retrieve. Its format is + # organizations/\\{organization}/resourceValueConfigs/\\{config_id}. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Google::Cloud::SecurityCenter::V2::ResourceValueConfig] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Google::Cloud::SecurityCenter::V2::ResourceValueConfig] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/security_center/v2" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::SecurityCenter::V2::SecurityCenter::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::SecurityCenter::V2::GetResourceValueConfigRequest.new + # + # # Call the get_resource_value_config method. + # result = client.get_resource_value_config request + # + # # The returned object is of type Google::Cloud::SecurityCenter::V2::ResourceValueConfig. + # p result + # + def get_resource_value_config request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::SecurityCenter::V2::GetResourceValueConfigRequest + + # Converts hash 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_resource_value_config.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::SecurityCenter::V2::VERSION + metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.name + header_params["name"] = request.name + end + + request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") + metadata[:"x-goog-request-params"] ||= request_params_header + + options.apply_defaults timeout: @config.rpcs.get_resource_value_config.timeout, + metadata: metadata, + retry_policy: @config.rpcs.get_resource_value_config.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @security_center_stub.call_rpc :get_resource_value_config, request, options: options do |response, operation| + yield response, operation if block_given? + end + rescue ::GRPC::BadStatus => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Gets a source. + # + # @overload get_source(request, options = nil) + # Pass arguments to `get_source` via a request object, either of type + # {::Google::Cloud::SecurityCenter::V2::GetSourceRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::SecurityCenter::V2::GetSourceRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_source(name: nil) + # Pass arguments to `get_source` via keyword arguments. Note that at + # least one keyword argument is 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. Relative resource name of the source. Its format is + # `organizations/[organization_id]/source/[source_id]`. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Google::Cloud::SecurityCenter::V2::Source] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Google::Cloud::SecurityCenter::V2::Source] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/security_center/v2" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::SecurityCenter::V2::SecurityCenter::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::SecurityCenter::V2::GetSourceRequest.new + # + # # Call the get_source method. + # result = client.get_source request + # + # # The returned object is of type Google::Cloud::SecurityCenter::V2::Source. + # p result + # + def get_source request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::SecurityCenter::V2::GetSourceRequest + + # Converts hash 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_source.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::SecurityCenter::V2::VERSION + metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.name + header_params["name"] = request.name + end + + request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") + metadata[:"x-goog-request-params"] ||= request_params_header + + options.apply_defaults timeout: @config.rpcs.get_source.timeout, + metadata: metadata, + retry_policy: @config.rpcs.get_source.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @security_center_stub.call_rpc :get_source, 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 + + ## + # Filters an organization or source's findings and groups them by their + # specified properties in a location. If no location is specified, findings + # are assumed to be in global + # + # To group across all sources provide a `-` as the source id. + # The following list shows some examples: + # + # + `/v2/organizations/{organization_id}/sources/-/findings` + # + + # `/v2/organizations/{organization_id}/sources/-/locations/{location_id}/findings` + # + `/v2/folders/{folder_id}/sources/-/findings` + # + `/v2/folders/{folder_id}/sources/-/locations/{location_id}/findings` + # + `/v2/projects/{project_id}/sources/-/findings` + # + `/v2/projects/{project_id}/sources/-/locations/{location_id}/findings` + # + # @overload group_findings(request, options = nil) + # Pass arguments to `group_findings` via a request object, either of type + # {::Google::Cloud::SecurityCenter::V2::GroupFindingsRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::SecurityCenter::V2::GroupFindingsRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. + # + # @overload group_findings(parent: nil, filter: nil, group_by: nil, page_token: nil, page_size: nil) + # Pass arguments to `group_findings` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param parent [::String] + # Required. Name of the source to groupBy. If no location is specified, + # finding is assumed to be in global. + # The following list shows some examples: + # + # + `organizations/[organization_id]/sources/[source_id]` + # + + # `organizations/[organization_id]/sources/[source_id]/locations/[location_id]` + # + `folders/[folder_id]/sources/[source_id]` + # + `folders/[folder_id]/sources/[source_id]/locations/[location_id]` + # + `projects/[project_id]/sources/[source_id]` + # + `projects/[project_id]/sources/[source_id]/locations/[location_id]` + # + # To groupBy across all sources provide a source_id of `-`. The following + # list shows some examples: + # + # + `organizations/{organization_id}/sources/-` + # + `organizations/{organization_id}/sources/-/locations/[location_id]` + # + `folders/{folder_id}/sources/-` + # + `folders/{folder_id}/sources/-/locations/[location_id]` + # + `projects/{project_id}/sources/-` + # + `projects/{project_id}/sources/-/locations/[location_id]` + # @param filter [::String] + # Expression that defines the filter to apply across findings. + # The expression is a list of one or more restrictions combined via logical + # operators `AND` and `OR`. + # Parentheses are supported, and `OR` has higher precedence than `AND`. + # + # Restrictions have the form ` ` and may have a `-` + # character in front of them to indicate negation. Examples include: + # + # * name + # * security_marks.marks.marka + # + # The supported operators are: + # + # * `=` for all value types. + # * `>`, `<`, `>=`, `<=` for integer values. + # * `:`, meaning substring matching, for strings. + # + # The supported value types are: + # + # * string literals in quotes. + # * integer literals without quotes. + # * boolean literals `true` and `false` without quotes. + # + # The following field and operator combinations are supported: + # + # * name: `=` + # * parent: `=`, `:` + # * resource_name: `=`, `:` + # * state: `=`, `:` + # * category: `=`, `:` + # * external_uri: `=`, `:` + # * event_time: `=`, `>`, `<`, `>=`, `<=` + # + # Usage: This should be milliseconds since epoch or an RFC3339 string. + # Examples: + # `event_time = "2019-06-10T16:07:18-07:00"` + # `event_time = 1560208038000` + # + # * severity: `=`, `:` + # * security_marks.marks: `=`, `:` + # * resource: + # * resource.name: `=`, `:` + # * resource.parent_name: `=`, `:` + # * resource.parent_display_name: `=`, `:` + # * resource.project_name: `=`, `:` + # * resource.project_display_name: `=`, `:` + # * resource.type: `=`, `:` + # @param group_by [::String] + # Required. Expression that defines what assets fields to use for grouping. + # The string value should follow SQL syntax: comma separated list of fields. + # For example: "parent,resource_name". + # @param page_token [::String] + # The value returned by the last `GroupFindingsResponse`; indicates + # that this is a continuation of a prior `GroupFindings` call, and + # that the system should return the next page of data. + # @param page_size [::Integer] + # The maximum number of results to return in a single response. Default is + # 10, minimum is 1, maximum is 1000. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Gapic::PagedEnumerable<::Google::Cloud::SecurityCenter::V2::GroupResult>] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Gapic::PagedEnumerable<::Google::Cloud::SecurityCenter::V2::GroupResult>] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/security_center/v2" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::SecurityCenter::V2::SecurityCenter::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::SecurityCenter::V2::GroupFindingsRequest.new + # + # # Call the group_findings method. + # result = client.group_findings request + # + # # The returned object is of type Gapic::PagedEnumerable. You can iterate + # # over elements, and API calls will be issued to fetch pages as needed. + # result.each do |item| + # # Each element is of type ::Google::Cloud::SecurityCenter::V2::GroupResult. + # p item + # end + # + def group_findings request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::SecurityCenter::V2::GroupFindingsRequest + + # Converts hash 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.group_findings.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::SecurityCenter::V2::VERSION + metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.parent + 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.group_findings.timeout, + metadata: metadata, + retry_policy: @config.rpcs.group_findings.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @security_center_stub.call_rpc :group_findings, request, options: options do |response, operation| + response = ::Gapic::PagedEnumerable.new @security_center_stub, :group_findings, 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 + + ## + # Lists the attack paths for a set of simulation results or valued resources + # and filter. + # + # @overload list_attack_paths(request, options = nil) + # Pass arguments to `list_attack_paths` via a request object, either of type + # {::Google::Cloud::SecurityCenter::V2::ListAttackPathsRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::SecurityCenter::V2::ListAttackPathsRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_attack_paths(parent: nil, filter: nil, page_token: nil, page_size: nil) + # Pass arguments to `list_attack_paths` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param parent [::String] + # Required. Name of parent to list attack paths. + # + # Valid formats: + # `organizations/{organization}`, + # `organizations/{organization}/simulations/{simulation}` + # `organizations/{organization}/simulations/{simulation}/attackExposureResults/{attack_exposure_result_v2}` + # `organizations/{organization}/simulations/{simulation}/valuedResources/{valued_resource}` + # @param filter [::String] + # The filter expression that filters the attack path in the response. + # Supported fields: + # + # * `valued_resources` supports = + # @param page_token [::String] + # The value returned by the last `ListAttackPathsResponse`; indicates + # that this is a continuation of a prior `ListAttackPaths` call, and + # that the system should return the next page of data. + # @param page_size [::Integer] + # The maximum number of results to return in a single response. Default is + # 10, minimum is 1, maximum is 1000. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Gapic::PagedEnumerable<::Google::Cloud::SecurityCenter::V2::AttackPath>] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Gapic::PagedEnumerable<::Google::Cloud::SecurityCenter::V2::AttackPath>] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/security_center/v2" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::SecurityCenter::V2::SecurityCenter::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::SecurityCenter::V2::ListAttackPathsRequest.new + # + # # Call the list_attack_paths method. + # result = client.list_attack_paths request + # + # # The returned object is of type Gapic::PagedEnumerable. You can iterate + # # over elements, and API calls will be issued to fetch pages as needed. + # result.each do |item| + # # Each element is of type ::Google::Cloud::SecurityCenter::V2::AttackPath. + # p item + # end + # + def list_attack_paths request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::SecurityCenter::V2::ListAttackPathsRequest + + # Converts hash 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_attack_paths.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::SecurityCenter::V2::VERSION + metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.parent + 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_attack_paths.timeout, + metadata: metadata, + retry_policy: @config.rpcs.list_attack_paths.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @security_center_stub.call_rpc :list_attack_paths, request, options: options do |response, operation| + response = ::Gapic::PagedEnumerable.new @security_center_stub, :list_attack_paths, 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 + + ## + # Lists BigQuery exports. Note that when requesting BigQuery exports at a + # given level all exports under that level are also returned e.g. if + # requesting BigQuery exports under a folder, then all BigQuery exports + # immediately under the folder plus the ones created under the projects + # within the folder are returned. + # + # @overload list_big_query_exports(request, options = nil) + # Pass arguments to `list_big_query_exports` via a request object, either of type + # {::Google::Cloud::SecurityCenter::V2::ListBigQueryExportsRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::SecurityCenter::V2::ListBigQueryExportsRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_big_query_exports(parent: nil, page_size: nil, page_token: nil) + # Pass arguments to `list_big_query_exports` via keyword arguments. Note that at + # least one keyword argument is 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, which owns the collection of BigQuery exports. Its + # format is `organizations/[organization_id]/locations/[location_id]`, + # `folders/[folder_id]/locations/[location_id]`, or + # `projects/[project_id]/locations/[location_id]`. + # @param page_size [::Integer] + # The maximum number of configs to return. The service may return fewer than + # this value. + # If unspecified, at most 10 configs will be returned. + # The maximum value is 1000; values above 1000 will be coerced to 1000. + # @param page_token [::String] + # A page token, received from a previous `ListBigQueryExports` call. + # Provide this to retrieve the subsequent page. + # When paginating, all other parameters provided to `ListBigQueryExports` + # 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::Cloud::SecurityCenter::V2::BigQueryExport>] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Gapic::PagedEnumerable<::Google::Cloud::SecurityCenter::V2::BigQueryExport>] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/security_center/v2" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::SecurityCenter::V2::SecurityCenter::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::SecurityCenter::V2::ListBigQueryExportsRequest.new + # + # # Call the list_big_query_exports method. + # result = client.list_big_query_exports request + # + # # The returned object is of type Gapic::PagedEnumerable. You can iterate + # # over elements, and API calls will be issued to fetch pages as needed. + # result.each do |item| + # # Each element is of type ::Google::Cloud::SecurityCenter::V2::BigQueryExport. + # p item + # end + # + def list_big_query_exports request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::SecurityCenter::V2::ListBigQueryExportsRequest + + # Converts hash 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_big_query_exports.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::SecurityCenter::V2::VERSION + metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.parent + 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_big_query_exports.timeout, + metadata: metadata, + retry_policy: @config.rpcs.list_big_query_exports.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @security_center_stub.call_rpc :list_big_query_exports, request, options: options do |response, operation| + response = ::Gapic::PagedEnumerable.new @security_center_stub, :list_big_query_exports, 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 + + ## + # Lists an organization or source's findings. + # + # To list across all sources for a given location provide a `-` as the source + # id. If no location is specified, finding are assumed to be in global. + # The following list shows some examples: + # + # + `/v2/organizations/{organization_id}/sources/-/findings` + # + + # `/v2/organizations/{organization_id}/sources/-/locations/{location_id}/findings` + # + # @overload list_findings(request, options = nil) + # Pass arguments to `list_findings` via a request object, either of type + # {::Google::Cloud::SecurityCenter::V2::ListFindingsRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::SecurityCenter::V2::ListFindingsRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_findings(parent: nil, filter: nil, order_by: nil, field_mask: nil, page_token: nil, page_size: nil) + # Pass arguments to `list_findings` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param parent [::String] + # Required. Name of the source the findings belong to. If no location is + # specified, the default is global. The following list shows some examples: + # + # + `organizations/[organization_id]/sources/[source_id]` + # + + # `organizations/[organization_id]/sources/[source_id]/locations/[location_id]` + # + `folders/[folder_id]/sources/[source_id]` + # + `folders/[folder_id]/sources/[source_id]/locations/[location_id]` + # + `projects/[project_id]/sources/[source_id]` + # + `projects/[project_id]/sources/[source_id]/locations/[location_id]` + # + # To list across all sources provide a source_id of `-`. The following + # list shows some examples: + # + # + `organizations/{organization_id}/sources/-` + # + `organizations/{organization_id}/sources/-/locations/{location_id}` + # + `folders/{folder_id}/sources/-` + # + `folders/{folder_id}/sources/-locations/{location_id}` + # + `projects/{projects_id}/sources/-` + # + `projects/{projects_id}/sources/-/locations/{location_id}` + # @param filter [::String] + # Expression that defines the filter to apply across findings. + # The expression is a list of one or more restrictions combined via logical + # operators `AND` and `OR`. + # Parentheses are supported, and `OR` has higher precedence than `AND`. + # + # Restrictions have the form ` ` and may have a `-` + # character in front of them to indicate negation. Examples include: + # + # * name + # * security_marks.marks.marka + # + # The supported operators are: + # + # * `=` for all value types. + # * `>`, `<`, `>=`, `<=` for integer values. + # * `:`, meaning substring matching, for strings. + # + # The supported value types are: + # + # * string literals in quotes. + # * integer literals without quotes. + # * boolean literals `true` and `false` without quotes. + # + # The following field and operator combinations are supported: + # + # * name: `=` + # * parent: `=`, `:` + # * resource_name: `=`, `:` + # * state: `=`, `:` + # * category: `=`, `:` + # * external_uri: `=`, `:` + # * event_time: `=`, `>`, `<`, `>=`, `<=` + # + # Usage: This should be milliseconds since epoch or an RFC3339 string. + # Examples: + # `event_time = "2019-06-10T16:07:18-07:00"` + # `event_time = 1560208038000` + # + # * severity: `=`, `:` + # * security_marks.marks: `=`, `:` + # * resource: + # * resource.name: `=`, `:` + # * resource.parent_name: `=`, `:` + # * resource.parent_display_name: `=`, `:` + # * resource.project_name: `=`, `:` + # * resource.project_display_name: `=`, `:` + # * resource.type: `=`, `:` + # * resource.folders.resource_folder: `=`, `:` + # * resource.display_name: `=`, `:` + # @param order_by [::String] + # Expression that defines what fields and order to use for sorting. The + # string value should follow SQL syntax: comma separated list of fields. For + # example: "name,parent". The default sorting order + # is ascending. To specify descending order for a field, a suffix " desc" + # should be appended to the field name. For example: "name + # desc,parent". Redundant space characters in the + # syntax are insignificant. "name desc,parent" and " + # name desc , parent " are equivalent. + # + # The following fields are supported: + # name + # parent + # state + # category + # resource_name + # event_time + # security_marks.marks + # @param field_mask [::Google::Protobuf::FieldMask, ::Hash] + # A field mask to specify the Finding fields to be listed in the response. + # An empty field mask will list all fields. + # @param page_token [::String] + # The value returned by the last `ListFindingsResponse`; indicates + # that this is a continuation of a prior `ListFindings` call, and + # that the system should return the next page of data. + # @param page_size [::Integer] + # The maximum number of results to return in a single response. Default is + # 10, minimum is 1, maximum is 1000. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Gapic::PagedEnumerable<::Google::Cloud::SecurityCenter::V2::ListFindingsResponse::ListFindingsResult>] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Gapic::PagedEnumerable<::Google::Cloud::SecurityCenter::V2::ListFindingsResponse::ListFindingsResult>] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/security_center/v2" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::SecurityCenter::V2::SecurityCenter::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::SecurityCenter::V2::ListFindingsRequest.new + # + # # Call the list_findings method. + # result = client.list_findings request + # + # # The returned object is of type Gapic::PagedEnumerable. You can iterate + # # over elements, and API calls will be issued to fetch pages as needed. + # result.each do |item| + # # Each element is of type ::Google::Cloud::SecurityCenter::V2::ListFindingsResponse::ListFindingsResult. + # p item + # end + # + def list_findings request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::SecurityCenter::V2::ListFindingsRequest + + # Converts hash 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_findings.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::SecurityCenter::V2::VERSION + metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.parent + 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_findings.timeout, + metadata: metadata, + retry_policy: @config.rpcs.list_findings.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @security_center_stub.call_rpc :list_findings, request, options: options do |response, operation| + response = ::Gapic::PagedEnumerable.new @security_center_stub, :list_findings, 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 + + ## + # Lists mute configs. If no location is specified, default is + # global. + # + # @overload list_mute_configs(request, options = nil) + # Pass arguments to `list_mute_configs` via a request object, either of type + # {::Google::Cloud::SecurityCenter::V2::ListMuteConfigsRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::SecurityCenter::V2::ListMuteConfigsRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_mute_configs(parent: nil, page_size: nil, page_token: nil) + # Pass arguments to `list_mute_configs` via keyword arguments. Note that at + # least one keyword argument is 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, which owns the collection of mute configs. Its format + # is `organizations/[organization_id]", "folders/[folder_id]`, + # `projects/[project_id]`, + # `organizations/[organization_id]/locations/[location_id]`, + # `folders/[folder_id]/locations/[location_id]`, + # `projects/[project_id]/locations/[location_id]`. + # @param page_size [::Integer] + # The maximum number of configs to return. The service may return fewer than + # this value. + # If unspecified, at most 10 configs will be returned. + # The maximum value is 1000; values above 1000 will be coerced to 1000. + # @param page_token [::String] + # A page token, received from a previous `ListMuteConfigs` call. + # Provide this to retrieve the subsequent page. + # + # When paginating, all other parameters provided to `ListMuteConfigs` 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::Cloud::SecurityCenter::V2::MuteConfig>] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Gapic::PagedEnumerable<::Google::Cloud::SecurityCenter::V2::MuteConfig>] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/security_center/v2" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::SecurityCenter::V2::SecurityCenter::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::SecurityCenter::V2::ListMuteConfigsRequest.new + # + # # Call the list_mute_configs method. + # result = client.list_mute_configs request + # + # # The returned object is of type Gapic::PagedEnumerable. You can iterate + # # over elements, and API calls will be issued to fetch pages as needed. + # result.each do |item| + # # Each element is of type ::Google::Cloud::SecurityCenter::V2::MuteConfig. + # p item + # end + # + def list_mute_configs request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::SecurityCenter::V2::ListMuteConfigsRequest + + # Converts hash 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_mute_configs.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::SecurityCenter::V2::VERSION + metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.parent + regex_match = %r{^projects/[^/]+/locations/(?[^/]+)/muteConfigs/?$}.match request.parent + if regex_match + header_params["location"] = regex_match["location".to_s] + end + end + if request.parent + regex_match = %r{^organizations/[^/]+/locations/(?[^/]+)/muteConfigs/?$}.match request.parent + if regex_match + header_params["location"] = regex_match["location".to_s] + end + end + if request.parent + regex_match = %r{^folders/[^/]+/locations/(?[^/]+)/muteConfigs/?$}.match request.parent + if regex_match + header_params["location"] = regex_match["location".to_s] + end + end + + request_params_header = URI.encode_www_form header_params + metadata[:"x-goog-request-params"] ||= request_params_header + + options.apply_defaults timeout: @config.rpcs.list_mute_configs.timeout, + metadata: metadata, + retry_policy: @config.rpcs.list_mute_configs.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @security_center_stub.call_rpc :list_mute_configs, request, options: options do |response, operation| + response = ::Gapic::PagedEnumerable.new @security_center_stub, :list_mute_configs, 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 + + ## + # Lists notification configs. + # + # @overload list_notification_configs(request, options = nil) + # Pass arguments to `list_notification_configs` via a request object, either of type + # {::Google::Cloud::SecurityCenter::V2::ListNotificationConfigsRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::SecurityCenter::V2::ListNotificationConfigsRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_notification_configs(parent: nil, page_token: nil, page_size: nil) + # Pass arguments to `list_notification_configs` via keyword arguments. Note that at + # least one keyword argument is 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 name of the parent in which to list the notification + # configurations. Its format is + # "organizations/[organization_id]/locations/[location_id]", + # "folders/[folder_id]/locations/[location_id]", or + # "projects/[project_id]/locations/[location_id]". + # @param page_token [::String] + # The value returned by the last `ListNotificationConfigsResponse`; indicates + # that this is a continuation of a prior `ListNotificationConfigs` call, and + # that the system should return the next page of data. + # @param page_size [::Integer] + # The maximum number of results to return in a single response. Default is + # 10, minimum is 1, maximum is 1000. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Gapic::PagedEnumerable<::Google::Cloud::SecurityCenter::V2::NotificationConfig>] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Gapic::PagedEnumerable<::Google::Cloud::SecurityCenter::V2::NotificationConfig>] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/security_center/v2" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::SecurityCenter::V2::SecurityCenter::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::SecurityCenter::V2::ListNotificationConfigsRequest.new + # + # # Call the list_notification_configs method. + # result = client.list_notification_configs request + # + # # The returned object is of type Gapic::PagedEnumerable. You can iterate + # # over elements, and API calls will be issued to fetch pages as needed. + # result.each do |item| + # # Each element is of type ::Google::Cloud::SecurityCenter::V2::NotificationConfig. + # p item + # end + # + def list_notification_configs request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::SecurityCenter::V2::ListNotificationConfigsRequest + + # Converts hash 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_notification_configs.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::SecurityCenter::V2::VERSION + metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.parent + 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_notification_configs.timeout, + metadata: metadata, + retry_policy: @config.rpcs.list_notification_configs.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @security_center_stub.call_rpc :list_notification_configs, request, options: options do |response, operation| + response = ::Gapic::PagedEnumerable.new @security_center_stub, :list_notification_configs, 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 + + ## + # Lists all ResourceValueConfigs. + # + # @overload list_resource_value_configs(request, options = nil) + # Pass arguments to `list_resource_value_configs` via a request object, either of type + # {::Google::Cloud::SecurityCenter::V2::ListResourceValueConfigsRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::SecurityCenter::V2::ListResourceValueConfigsRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_resource_value_configs(parent: nil, page_size: nil, page_token: nil) + # Pass arguments to `list_resource_value_configs` via keyword arguments. Note that at + # least one keyword argument is 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, which owns the collection of resource value configs. + # Its format is + # `organizations/[organization_id]` + # @param page_size [::Integer] + # The maximum number of configs to return. The service may return fewer than + # this value. + # If unspecified, at most 10 configs will be returned. + # The maximum value is 1000; values above 1000 will be coerced to 1000. + # @param page_token [::String] + # A page token, received from a previous `ListResourceValueConfigs` call. + # Provide this to retrieve the subsequent page. + # + # When paginating, all other parameters provided to + # `ListResourceValueConfigs` must match the call that provided the + # page token. + # + # page_size can be specified, and the new page_size will be used. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Gapic::PagedEnumerable<::Google::Cloud::SecurityCenter::V2::ResourceValueConfig>] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Gapic::PagedEnumerable<::Google::Cloud::SecurityCenter::V2::ResourceValueConfig>] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/security_center/v2" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::SecurityCenter::V2::SecurityCenter::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::SecurityCenter::V2::ListResourceValueConfigsRequest.new + # + # # Call the list_resource_value_configs method. + # result = client.list_resource_value_configs request + # + # # The returned object is of type Gapic::PagedEnumerable. You can iterate + # # over elements, and API calls will be issued to fetch pages as needed. + # result.each do |item| + # # Each element is of type ::Google::Cloud::SecurityCenter::V2::ResourceValueConfig. + # p item + # end + # + def list_resource_value_configs request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::SecurityCenter::V2::ListResourceValueConfigsRequest + + # Converts hash 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_resource_value_configs.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::SecurityCenter::V2::VERSION + metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.parent + 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_resource_value_configs.timeout, + metadata: metadata, + retry_policy: @config.rpcs.list_resource_value_configs.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @security_center_stub.call_rpc :list_resource_value_configs, request, options: options do |response, operation| + response = ::Gapic::PagedEnumerable.new @security_center_stub, :list_resource_value_configs, 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 + + ## + # Lists all sources belonging to an organization. + # + # @overload list_sources(request, options = nil) + # Pass arguments to `list_sources` via a request object, either of type + # {::Google::Cloud::SecurityCenter::V2::ListSourcesRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::SecurityCenter::V2::ListSourcesRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_sources(parent: nil, page_token: nil, page_size: nil) + # Pass arguments to `list_sources` via keyword arguments. Note that at + # least one keyword argument is 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. Resource name of the parent of sources to list. Its format should + # be `organizations/[organization_id]`, `folders/[folder_id]`, or + # `projects/[project_id]`. + # @param page_token [::String] + # The value returned by the last `ListSourcesResponse`; indicates + # that this is a continuation of a prior `ListSources` call, and + # that the system should return the next page of data. + # @param page_size [::Integer] + # The maximum number of results to return in a single response. Default is + # 10, minimum is 1, maximum is 1000. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Gapic::PagedEnumerable<::Google::Cloud::SecurityCenter::V2::Source>] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Gapic::PagedEnumerable<::Google::Cloud::SecurityCenter::V2::Source>] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/security_center/v2" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::SecurityCenter::V2::SecurityCenter::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::SecurityCenter::V2::ListSourcesRequest.new + # + # # Call the list_sources method. + # result = client.list_sources request + # + # # The returned object is of type Gapic::PagedEnumerable. You can iterate + # # over elements, and API calls will be issued to fetch pages as needed. + # result.each do |item| + # # Each element is of type ::Google::Cloud::SecurityCenter::V2::Source. + # p item + # end + # + def list_sources request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::SecurityCenter::V2::ListSourcesRequest + + # Converts hash 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_sources.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::SecurityCenter::V2::VERSION + metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.parent + 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_sources.timeout, + metadata: metadata, + retry_policy: @config.rpcs.list_sources.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @security_center_stub.call_rpc :list_sources, request, options: options do |response, operation| + response = ::Gapic::PagedEnumerable.new @security_center_stub, :list_sources, 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 + + ## + # Lists the valued resources for a set of simulation results and filter. + # + # @overload list_valued_resources(request, options = nil) + # Pass arguments to `list_valued_resources` via a request object, either of type + # {::Google::Cloud::SecurityCenter::V2::ListValuedResourcesRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::SecurityCenter::V2::ListValuedResourcesRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_valued_resources(parent: nil, filter: nil, page_token: nil, page_size: nil, order_by: nil) + # Pass arguments to `list_valued_resources` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param parent [::String] + # Required. Name of parent to list exposed resources. + # + # Valid formats: + # `organizations/{organization}`, + # `organizations/{organization}/simulations/{simulation}` + # `organizations/{organization}/simulations/{simulation}/attackExposureResults/{attack_exposure_result_v2}` + # @param filter [::String] + # The filter expression that filters the valued resources in the response. + # Supported fields: + # + # * `resource_value` supports = + # * `resource_type` supports = + # @param page_token [::String] + # The value returned by the last `ListValuedResourcesResponse`; indicates + # that this is a continuation of a prior `ListValuedResources` call, and + # that the system should return the next page of data. + # @param page_size [::Integer] + # The maximum number of results to return in a single response. Default is + # 10, minimum is 1, maximum is 1000. + # @param order_by [::String] + # Optional. The fields by which to order the valued resources response. + # + # Supported fields: + # + # * `exposed_score` + # + # * `resource_value` + # + # * `resource_type` + # + # Values should be a comma separated list of fields. For example: + # `exposed_score,resource_value`. + # + # The default sorting order is descending. To specify ascending or descending + # order for a field, append a " ASC" or a " DESC" suffix, respectively; for + # example: `exposed_score DESC`. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Gapic::PagedEnumerable<::Google::Cloud::SecurityCenter::V2::ValuedResource>] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Gapic::PagedEnumerable<::Google::Cloud::SecurityCenter::V2::ValuedResource>] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/security_center/v2" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::SecurityCenter::V2::SecurityCenter::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::SecurityCenter::V2::ListValuedResourcesRequest.new + # + # # Call the list_valued_resources method. + # result = client.list_valued_resources request + # + # # The returned object is of type Gapic::PagedEnumerable. You can iterate + # # over elements, and API calls will be issued to fetch pages as needed. + # result.each do |item| + # # Each element is of type ::Google::Cloud::SecurityCenter::V2::ValuedResource. + # p item + # end + # + def list_valued_resources request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::SecurityCenter::V2::ListValuedResourcesRequest + + # Converts hash 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_valued_resources.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::SecurityCenter::V2::VERSION + metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.parent + 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_valued_resources.timeout, + metadata: metadata, + retry_policy: @config.rpcs.list_valued_resources.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @security_center_stub.call_rpc :list_valued_resources, request, options: options do |response, operation| + response = ::Gapic::PagedEnumerable.new @security_center_stub, :list_valued_resources, 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 + + ## + # Updates the state of a finding. If no location is specified, finding is + # assumed to be in global + # + # @overload set_finding_state(request, options = nil) + # Pass arguments to `set_finding_state` via a request object, either of type + # {::Google::Cloud::SecurityCenter::V2::SetFindingStateRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::SecurityCenter::V2::SetFindingStateRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. + # + # @overload set_finding_state(name: nil, state: nil) + # Pass arguments to `set_finding_state` via keyword arguments. Note that at + # least one keyword argument is 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 [relative resource + # name](https://cloud.google.com/apis/design/resource_names#relative_resource_name) + # of the finding. If no location is specified, finding is assumed to be in + # global. The following list shows some examples: + # + # + + # `organizations/{organization_id}/sources/{source_id}/findings/{finding_id}` + # + + # `organizations/{organization_id}/sources/{source_id}/locations/{location_id}/findings/{finding_id}` + # + `folders/{folder_id}/sources/{source_id}/findings/{finding_id}` + # + + # `folders/{folder_id}/sources/{source_id}/locations/{location_id}/findings/{finding_id}` + # + `projects/{project_id}/sources/{source_id}/findings/{finding_id}` + # + + # `projects/{project_id}/sources/{source_id}/locations/{location_id}/findings/{finding_id}` + # @param state [::Google::Cloud::SecurityCenter::V2::Finding::State] + # Required. The desired State of the finding. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Google::Cloud::SecurityCenter::V2::Finding] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Google::Cloud::SecurityCenter::V2::Finding] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/security_center/v2" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::SecurityCenter::V2::SecurityCenter::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::SecurityCenter::V2::SetFindingStateRequest.new + # + # # Call the set_finding_state method. + # result = client.set_finding_state request + # + # # The returned object is of type Google::Cloud::SecurityCenter::V2::Finding. + # p result + # + def set_finding_state request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::SecurityCenter::V2::SetFindingStateRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + metadata = @config.rpcs.set_finding_state.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::SecurityCenter::V2::VERSION + metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.name + header_params["name"] = request.name + end + + request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") + metadata[:"x-goog-request-params"] ||= request_params_header + + options.apply_defaults timeout: @config.rpcs.set_finding_state.timeout, + metadata: metadata, + retry_policy: @config.rpcs.set_finding_state.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @security_center_stub.call_rpc :set_finding_state, request, options: options do |response, operation| + yield response, operation if block_given? + end + rescue ::GRPC::BadStatus => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Sets the access control policy on the specified Source. + # + # @overload set_iam_policy(request, options = nil) + # Pass arguments to `set_iam_policy` via a request object, either of type + # {::Google::Iam::V1::SetIamPolicyRequest} or an equivalent Hash. + # + # @param request [::Google::Iam::V1::SetIamPolicyRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. + # + # @overload set_iam_policy(resource: nil, policy: nil, update_mask: nil) + # Pass arguments to `set_iam_policy` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param resource [::String] + # REQUIRED: The resource for which the policy is being specified. + # See the operation documentation for the appropriate value for this field. + # @param policy [::Google::Iam::V1::Policy, ::Hash] + # REQUIRED: The complete policy to be applied to the `resource`. The size of + # the policy is limited to a few 10s of KB. An empty policy is a + # valid policy but certain Cloud Platform services (such as Projects) + # might reject them. + # @param update_mask [::Google::Protobuf::FieldMask, ::Hash] + # OPTIONAL: A FieldMask specifying which fields of the policy to modify. Only + # the fields in the mask will be modified. If no mask is provided, the + # following default mask is used: + # + # `paths: "bindings, etag"` + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Google::Iam::V1::Policy] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Google::Iam::V1::Policy] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/security_center/v2" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::SecurityCenter::V2::SecurityCenter::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Iam::V1::SetIamPolicyRequest.new + # + # # Call the set_iam_policy method. + # result = client.set_iam_policy request + # + # # The returned object is of type Google::Iam::V1::Policy. + # p result + # + def set_iam_policy request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Iam::V1::SetIamPolicyRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + metadata = @config.rpcs.set_iam_policy.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::SecurityCenter::V2::VERSION + metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.resource + header_params["resource"] = request.resource + end + + request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") + metadata[:"x-goog-request-params"] ||= request_params_header + + options.apply_defaults timeout: @config.rpcs.set_iam_policy.timeout, + metadata: metadata, + retry_policy: @config.rpcs.set_iam_policy.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @security_center_stub.call_rpc :set_iam_policy, request, options: options do |response, operation| + yield response, operation if block_given? + end + rescue ::GRPC::BadStatus => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Updates the mute state of a finding. If no location is specified, finding + # is assumed to be in global + # + # @overload set_mute(request, options = nil) + # Pass arguments to `set_mute` via a request object, either of type + # {::Google::Cloud::SecurityCenter::V2::SetMuteRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::SecurityCenter::V2::SetMuteRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. + # + # @overload set_mute(name: nil, mute: nil) + # Pass arguments to `set_mute` via keyword arguments. Note that at + # least one keyword argument is 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 [relative resource + # name](https://cloud.google.com/apis/design/resource_names#relative_resource_name) + # of the finding. If no location is specified, finding is assumed to be in + # global. The following list shows some examples: + # + # + + # `organizations/{organization_id}/sources/{source_id}/findings/{finding_id}` + # + + # `organizations/{organization_id}/sources/{source_id}/locations/{location_id}/findings/{finding_id}` + # + `folders/{folder_id}/sources/{source_id}/findings/{finding_id}` + # + + # `folders/{folder_id}/sources/{source_id}/locations/{location_id}/findings/{finding_id}` + # + `projects/{project_id}/sources/{source_id}/findings/{finding_id}` + # + + # `projects/{project_id}/sources/{source_id}/locations/{location_id}/findings/{finding_id}` + # @param mute [::Google::Cloud::SecurityCenter::V2::Finding::Mute] + # Required. The desired state of the Mute. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Google::Cloud::SecurityCenter::V2::Finding] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Google::Cloud::SecurityCenter::V2::Finding] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/security_center/v2" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::SecurityCenter::V2::SecurityCenter::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::SecurityCenter::V2::SetMuteRequest.new + # + # # Call the set_mute method. + # result = client.set_mute request + # + # # The returned object is of type Google::Cloud::SecurityCenter::V2::Finding. + # p result + # + def set_mute request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::SecurityCenter::V2::SetMuteRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + metadata = @config.rpcs.set_mute.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::SecurityCenter::V2::VERSION + metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.name + header_params["name"] = request.name + end + + request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") + metadata[:"x-goog-request-params"] ||= request_params_header + + options.apply_defaults timeout: @config.rpcs.set_mute.timeout, + metadata: metadata, + retry_policy: @config.rpcs.set_mute.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @security_center_stub.call_rpc :set_mute, request, options: options do |response, operation| + yield response, operation if block_given? + end + rescue ::GRPC::BadStatus => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Returns the permissions that a caller has on the specified source. + # + # @overload test_iam_permissions(request, options = nil) + # Pass arguments to `test_iam_permissions` via a request object, either of type + # {::Google::Iam::V1::TestIamPermissionsRequest} or an equivalent Hash. + # + # @param request [::Google::Iam::V1::TestIamPermissionsRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. + # + # @overload test_iam_permissions(resource: nil, permissions: nil) + # Pass arguments to `test_iam_permissions` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param resource [::String] + # REQUIRED: The resource for which the policy detail is being requested. + # See the operation documentation for the appropriate value for this field. + # @param permissions [::Array<::String>] + # The set of permissions to check for the `resource`. Permissions with + # wildcards (such as '*' or 'storage.*') are not allowed. For more + # information see + # [IAM Overview](https://cloud.google.com/iam/docs/overview#permissions). + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Google::Iam::V1::TestIamPermissionsResponse] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Google::Iam::V1::TestIamPermissionsResponse] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/security_center/v2" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::SecurityCenter::V2::SecurityCenter::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Iam::V1::TestIamPermissionsRequest.new + # + # # Call the test_iam_permissions method. + # result = client.test_iam_permissions request + # + # # The returned object is of type Google::Iam::V1::TestIamPermissionsResponse. + # p result + # + def test_iam_permissions request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Iam::V1::TestIamPermissionsRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + metadata = @config.rpcs.test_iam_permissions.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::SecurityCenter::V2::VERSION + metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.resource + header_params["resource"] = request.resource + end + + request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") + metadata[:"x-goog-request-params"] ||= request_params_header + + options.apply_defaults timeout: @config.rpcs.test_iam_permissions.timeout, + metadata: metadata, + retry_policy: @config.rpcs.test_iam_permissions.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @security_center_stub.call_rpc :test_iam_permissions, request, options: options do |response, operation| + yield response, operation if block_given? + end + rescue ::GRPC::BadStatus => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Updates a BigQuery export. + # + # @overload update_big_query_export(request, options = nil) + # Pass arguments to `update_big_query_export` via a request object, either of type + # {::Google::Cloud::SecurityCenter::V2::UpdateBigQueryExportRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::SecurityCenter::V2::UpdateBigQueryExportRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_big_query_export(big_query_export: nil, update_mask: nil) + # Pass arguments to `update_big_query_export` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param big_query_export [::Google::Cloud::SecurityCenter::V2::BigQueryExport, ::Hash] + # Required. The BigQuery export being updated. + # @param update_mask [::Google::Protobuf::FieldMask, ::Hash] + # The list of fields to be updated. + # If empty all mutable fields will be updated. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Google::Cloud::SecurityCenter::V2::BigQueryExport] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Google::Cloud::SecurityCenter::V2::BigQueryExport] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/security_center/v2" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::SecurityCenter::V2::SecurityCenter::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::SecurityCenter::V2::UpdateBigQueryExportRequest.new + # + # # Call the update_big_query_export method. + # result = client.update_big_query_export request + # + # # The returned object is of type Google::Cloud::SecurityCenter::V2::BigQueryExport. + # p result + # + def update_big_query_export request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::SecurityCenter::V2::UpdateBigQueryExportRequest + + # Converts hash 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_big_query_export.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::SecurityCenter::V2::VERSION + metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.big_query_export&.name + header_params["big_query_export.name"] = request.big_query_export.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_big_query_export.timeout, + metadata: metadata, + retry_policy: @config.rpcs.update_big_query_export.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @security_center_stub.call_rpc :update_big_query_export, 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 external system. This is for a given finding. If no location is + # specified, finding is assumed to be in global + # + # @overload update_external_system(request, options = nil) + # Pass arguments to `update_external_system` via a request object, either of type + # {::Google::Cloud::SecurityCenter::V2::UpdateExternalSystemRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::SecurityCenter::V2::UpdateExternalSystemRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_external_system(external_system: nil, update_mask: nil) + # Pass arguments to `update_external_system` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param external_system [::Google::Cloud::SecurityCenter::V2::ExternalSystem, ::Hash] + # Required. The external system resource to update. + # @param update_mask [::Google::Protobuf::FieldMask, ::Hash] + # The FieldMask to use when updating the external system resource. + # + # If empty all mutable fields will be updated. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Google::Cloud::SecurityCenter::V2::ExternalSystem] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Google::Cloud::SecurityCenter::V2::ExternalSystem] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/security_center/v2" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::SecurityCenter::V2::SecurityCenter::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::SecurityCenter::V2::UpdateExternalSystemRequest.new + # + # # Call the update_external_system method. + # result = client.update_external_system request + # + # # The returned object is of type Google::Cloud::SecurityCenter::V2::ExternalSystem. + # p result + # + def update_external_system request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::SecurityCenter::V2::UpdateExternalSystemRequest + + # Converts hash 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_external_system.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::SecurityCenter::V2::VERSION + metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.external_system&.name + header_params["external_system.name"] = request.external_system.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_external_system.timeout, + metadata: metadata, + retry_policy: @config.rpcs.update_external_system.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @security_center_stub.call_rpc :update_external_system, request, options: options do |response, operation| + yield response, operation if block_given? + end + rescue ::GRPC::BadStatus => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Creates or updates a finding. If no location is specified, finding is + # assumed to be in global. The corresponding source must exist for a finding + # creation to succeed. + # + # @overload update_finding(request, options = nil) + # Pass arguments to `update_finding` via a request object, either of type + # {::Google::Cloud::SecurityCenter::V2::UpdateFindingRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::SecurityCenter::V2::UpdateFindingRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_finding(finding: nil, update_mask: nil) + # Pass arguments to `update_finding` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param finding [::Google::Cloud::SecurityCenter::V2::Finding, ::Hash] + # Required. The finding resource to update or create if it does not already + # exist. parent, security_marks, and update_time will be ignored. + # + # In the case of creation, the finding id portion of the name must be + # alphanumeric and less than or equal to 32 characters and greater than 0 + # characters in length. + # @param update_mask [::Google::Protobuf::FieldMask, ::Hash] + # The FieldMask to use when updating the finding resource. This field should + # not be specified when creating a finding. + # + # When updating a finding, an empty mask is treated as updating all mutable + # fields and replacing source_properties. Individual source_properties can + # be added/updated by using "source_properties." in the field + # mask. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Google::Cloud::SecurityCenter::V2::Finding] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Google::Cloud::SecurityCenter::V2::Finding] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/security_center/v2" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::SecurityCenter::V2::SecurityCenter::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::SecurityCenter::V2::UpdateFindingRequest.new + # + # # Call the update_finding method. + # result = client.update_finding request + # + # # The returned object is of type Google::Cloud::SecurityCenter::V2::Finding. + # p result + # + def update_finding request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::SecurityCenter::V2::UpdateFindingRequest + + # Converts hash 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_finding.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::SecurityCenter::V2::VERSION + metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.finding&.name + header_params["finding.name"] = request.finding.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_finding.timeout, + metadata: metadata, + retry_policy: @config.rpcs.update_finding.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @security_center_stub.call_rpc :update_finding, 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 mute config. If no location is specified, default is + # global. + # + # @overload update_mute_config(request, options = nil) + # Pass arguments to `update_mute_config` via a request object, either of type + # {::Google::Cloud::SecurityCenter::V2::UpdateMuteConfigRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::SecurityCenter::V2::UpdateMuteConfigRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_mute_config(mute_config: nil, update_mask: nil) + # Pass arguments to `update_mute_config` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param mute_config [::Google::Cloud::SecurityCenter::V2::MuteConfig, ::Hash] + # Required. The mute config being updated. + # @param update_mask [::Google::Protobuf::FieldMask, ::Hash] + # The list of fields to be updated. + # If empty all mutable fields will be updated. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Google::Cloud::SecurityCenter::V2::MuteConfig] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Google::Cloud::SecurityCenter::V2::MuteConfig] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/security_center/v2" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::SecurityCenter::V2::SecurityCenter::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::SecurityCenter::V2::UpdateMuteConfigRequest.new + # + # # Call the update_mute_config method. + # result = client.update_mute_config request + # + # # The returned object is of type Google::Cloud::SecurityCenter::V2::MuteConfig. + # p result + # + def update_mute_config request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::SecurityCenter::V2::UpdateMuteConfigRequest + + # Converts hash 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_mute_config.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::SecurityCenter::V2::VERSION + metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.mute_config&.name + regex_match = %r{^projects/[^/]+/locations/(?[^/]+)/muteConfigs/[^/]+/?$}.match request.mute_config.name + if regex_match + header_params["location"] = regex_match["location".to_s] + end + end + if request.mute_config&.name + regex_match = %r{^organizations/[^/]+/locations/(?[^/]+)/muteConfigs/[^/]+/?$}.match request.mute_config.name + if regex_match + header_params["location"] = regex_match["location".to_s] + end + end + if request.mute_config&.name + regex_match = %r{^folders/[^/]+/locations/(?[^/]+)/muteConfigs/[^/]+/?$}.match request.mute_config.name + if regex_match + header_params["location"] = regex_match["location".to_s] + end + end + + request_params_header = URI.encode_www_form header_params + metadata[:"x-goog-request-params"] ||= request_params_header + + options.apply_defaults timeout: @config.rpcs.update_mute_config.timeout, + metadata: metadata, + retry_policy: @config.rpcs.update_mute_config.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @security_center_stub.call_rpc :update_mute_config, request, options: options do |response, operation| + yield response, operation if block_given? + end + rescue ::GRPC::BadStatus => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Updates a notification config. The following update + # fields are allowed: description, pubsub_topic, streaming_config.filter + # + # @overload update_notification_config(request, options = nil) + # Pass arguments to `update_notification_config` via a request object, either of type + # {::Google::Cloud::SecurityCenter::V2::UpdateNotificationConfigRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::SecurityCenter::V2::UpdateNotificationConfigRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_notification_config(notification_config: nil, update_mask: nil) + # Pass arguments to `update_notification_config` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param notification_config [::Google::Cloud::SecurityCenter::V2::NotificationConfig, ::Hash] + # Required. The notification config to update. + # @param update_mask [::Google::Protobuf::FieldMask, ::Hash] + # The FieldMask to use when updating the notification config. + # + # If empty all mutable fields will be updated. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Google::Cloud::SecurityCenter::V2::NotificationConfig] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Google::Cloud::SecurityCenter::V2::NotificationConfig] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/security_center/v2" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::SecurityCenter::V2::SecurityCenter::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::SecurityCenter::V2::UpdateNotificationConfigRequest.new + # + # # Call the update_notification_config method. + # result = client.update_notification_config request + # + # # The returned object is of type Google::Cloud::SecurityCenter::V2::NotificationConfig. + # p result + # + def update_notification_config request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::SecurityCenter::V2::UpdateNotificationConfigRequest + + # Converts hash 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_notification_config.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::SecurityCenter::V2::VERSION + metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.notification_config&.name + header_params["notification_config.name"] = request.notification_config.name + end + + request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") + metadata[:"x-goog-request-params"] ||= request_params_header + + options.apply_defaults timeout: @config.rpcs.update_notification_config.timeout, + metadata: metadata, + retry_policy: @config.rpcs.update_notification_config.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @security_center_stub.call_rpc :update_notification_config, request, options: options do |response, operation| + yield response, operation if block_given? + end + rescue ::GRPC::BadStatus => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Updates an existing ResourceValueConfigs with new rules. + # + # @overload update_resource_value_config(request, options = nil) + # Pass arguments to `update_resource_value_config` via a request object, either of type + # {::Google::Cloud::SecurityCenter::V2::UpdateResourceValueConfigRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::SecurityCenter::V2::UpdateResourceValueConfigRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_resource_value_config(resource_value_config: nil, update_mask: nil) + # Pass arguments to `update_resource_value_config` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param resource_value_config [::Google::Cloud::SecurityCenter::V2::ResourceValueConfig, ::Hash] + # Required. The resource value config being updated. + # @param update_mask [::Google::Protobuf::FieldMask, ::Hash] + # The list of fields to be updated. + # If empty all mutable fields will be updated. + # + # To update nested fields, include the top level field in the mask + # For example, to update gcp_metadata.resource_type, include the + # "gcp_metadata" field mask + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Google::Cloud::SecurityCenter::V2::ResourceValueConfig] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Google::Cloud::SecurityCenter::V2::ResourceValueConfig] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/security_center/v2" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::SecurityCenter::V2::SecurityCenter::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::SecurityCenter::V2::UpdateResourceValueConfigRequest.new + # + # # Call the update_resource_value_config method. + # result = client.update_resource_value_config request + # + # # The returned object is of type Google::Cloud::SecurityCenter::V2::ResourceValueConfig. + # p result + # + def update_resource_value_config request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::SecurityCenter::V2::UpdateResourceValueConfigRequest + + # Converts hash 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_resource_value_config.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::SecurityCenter::V2::VERSION + metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.resource_value_config&.name + header_params["resource_value_config.name"] = request.resource_value_config.name + end + + request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") + metadata[:"x-goog-request-params"] ||= request_params_header + + options.apply_defaults timeout: @config.rpcs.update_resource_value_config.timeout, + metadata: metadata, + retry_policy: @config.rpcs.update_resource_value_config.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @security_center_stub.call_rpc :update_resource_value_config, request, options: options do |response, operation| + yield response, operation if block_given? + end + rescue ::GRPC::BadStatus => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Updates security marks. For Finding Security marks, if no location is + # specified, finding is assumed to be in global. Assets Security Marks can + # only be accessed through global endpoint. + # + # @overload update_security_marks(request, options = nil) + # Pass arguments to `update_security_marks` via a request object, either of type + # {::Google::Cloud::SecurityCenter::V2::UpdateSecurityMarksRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::SecurityCenter::V2::UpdateSecurityMarksRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_security_marks(security_marks: nil, update_mask: nil) + # Pass arguments to `update_security_marks` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param security_marks [::Google::Cloud::SecurityCenter::V2::SecurityMarks, ::Hash] + # Required. The security marks resource to update. + # @param update_mask [::Google::Protobuf::FieldMask, ::Hash] + # The FieldMask to use when updating the security marks resource. + # + # The field mask must not contain duplicate fields. + # If empty or set to "marks", all marks will be replaced. Individual + # marks can be updated using "marks.". + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Google::Cloud::SecurityCenter::V2::SecurityMarks] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Google::Cloud::SecurityCenter::V2::SecurityMarks] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/security_center/v2" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::SecurityCenter::V2::SecurityCenter::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::SecurityCenter::V2::UpdateSecurityMarksRequest.new + # + # # Call the update_security_marks method. + # result = client.update_security_marks request + # + # # The returned object is of type Google::Cloud::SecurityCenter::V2::SecurityMarks. + # p result + # + def update_security_marks request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::SecurityCenter::V2::UpdateSecurityMarksRequest + + # Converts hash 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_security_marks.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::SecurityCenter::V2::VERSION + metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.security_marks&.name + header_params["security_marks.name"] = request.security_marks.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_security_marks.timeout, + metadata: metadata, + retry_policy: @config.rpcs.update_security_marks.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @security_center_stub.call_rpc :update_security_marks, 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 source. + # + # @overload update_source(request, options = nil) + # Pass arguments to `update_source` via a request object, either of type + # {::Google::Cloud::SecurityCenter::V2::UpdateSourceRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::SecurityCenter::V2::UpdateSourceRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_source(source: nil, update_mask: nil) + # Pass arguments to `update_source` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param source [::Google::Cloud::SecurityCenter::V2::Source, ::Hash] + # Required. The source resource to update. + # @param update_mask [::Google::Protobuf::FieldMask, ::Hash] + # The FieldMask to use when updating the source resource. + # + # If empty all mutable fields will be updated. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Google::Cloud::SecurityCenter::V2::Source] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Google::Cloud::SecurityCenter::V2::Source] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/security_center/v2" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::SecurityCenter::V2::SecurityCenter::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::SecurityCenter::V2::UpdateSourceRequest.new + # + # # Call the update_source method. + # result = client.update_source request + # + # # The returned object is of type Google::Cloud::SecurityCenter::V2::Source. + # p result + # + def update_source request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::SecurityCenter::V2::UpdateSourceRequest + + # Converts hash 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_source.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::SecurityCenter::V2::VERSION + metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.source&.name + header_params["source.name"] = request.source.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_source.timeout, + metadata: metadata, + retry_policy: @config.rpcs.update_source.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @security_center_stub.call_rpc :update_source, request, options: options do |response, operation| + yield response, operation if block_given? + end + rescue ::GRPC::BadStatus => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Configuration class for the SecurityCenter API. + # + # This class represents the configuration for SecurityCenter, + # providing control over timeouts, retry behavior, logging, transport + # parameters, and other low-level controls. Certain parameters can also be + # applied individually to specific RPCs. See + # {::Google::Cloud::SecurityCenter::V2::SecurityCenter::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 + # # batch_create_resource_value_configs to 20 seconds, + # # and all remaining timeouts to 10 seconds. + # ::Google::Cloud::SecurityCenter::V2::SecurityCenter::Client.configure do |config| + # config.timeout = 10.0 + # config.rpcs.batch_create_resource_value_configs.timeout = 20.0 + # end + # + # # Apply the above configuration only to a new client. + # client = ::Google::Cloud::SecurityCenter::V2::SecurityCenter::Client.new do |config| + # config.timeout = 10.0 + # config.rpcs.batch_create_resource_value_configs.timeout = 20.0 + # end + # + # @!attribute [rw] endpoint + # A custom service endpoint, as a hostname or hostname:port. The default is + # nil, indicating to use the default endpoint in the current universe domain. + # @return [::String,nil] + # @!attribute [rw] credentials + # Credentials to send with calls. You may provide any of the following types: + # * (`Google::Auth::Credentials`) A googleauth credentials object + # (see the [googleauth docs](https://rubydoc.info/gems/googleauth/Google/Auth/Credentials)) + # * (`Signet::OAuth2::Client`) A signet oauth2 client object + # (see the [signet docs](https://rubydoc.info/gems/signet/Signet/OAuth2/Client)) + # * (`GRPC::Core::Channel`) a gRPC channel with included credentials + # * (`GRPC::Core::ChannelCredentials`) a gRPC credentails object + # * (`nil`) indicating no credentials + # + # @note Warning: Passing a `String` to a keyfile path or a `Hash` of credentials + # is deprecated. Providing an unvalidated credential configuration to + # Google APIs can compromise the security of your systems and data. + # + # @example + # + # # The recommended way to provide credentials is to use the `make_creds` method + # # on the appropriate credentials class for your environment. + # + # require "googleauth" + # + # credentials = ::Google::Auth::ServiceAccountCredentials.make_creds( + # json_key_io: ::File.open("/path/to/keyfile.json") + # ) + # + # client = ::Google::Cloud::SecurityCenter::V2::SecurityCenter::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 = "securitycenter.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 SecurityCenter 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 `batch_create_resource_value_configs` + # @return [::Gapic::Config::Method] + # + attr_reader :batch_create_resource_value_configs + ## + # RPC-specific configuration for `bulk_mute_findings` + # @return [::Gapic::Config::Method] + # + attr_reader :bulk_mute_findings + ## + # RPC-specific configuration for `create_big_query_export` + # @return [::Gapic::Config::Method] + # + attr_reader :create_big_query_export + ## + # RPC-specific configuration for `create_finding` + # @return [::Gapic::Config::Method] + # + attr_reader :create_finding + ## + # RPC-specific configuration for `create_mute_config` + # @return [::Gapic::Config::Method] + # + attr_reader :create_mute_config + ## + # RPC-specific configuration for `create_notification_config` + # @return [::Gapic::Config::Method] + # + attr_reader :create_notification_config + ## + # RPC-specific configuration for `create_source` + # @return [::Gapic::Config::Method] + # + attr_reader :create_source + ## + # RPC-specific configuration for `delete_big_query_export` + # @return [::Gapic::Config::Method] + # + attr_reader :delete_big_query_export + ## + # RPC-specific configuration for `delete_mute_config` + # @return [::Gapic::Config::Method] + # + attr_reader :delete_mute_config + ## + # RPC-specific configuration for `delete_notification_config` + # @return [::Gapic::Config::Method] + # + attr_reader :delete_notification_config + ## + # RPC-specific configuration for `delete_resource_value_config` + # @return [::Gapic::Config::Method] + # + attr_reader :delete_resource_value_config + ## + # RPC-specific configuration for `get_big_query_export` + # @return [::Gapic::Config::Method] + # + attr_reader :get_big_query_export + ## + # RPC-specific configuration for `get_simulation` + # @return [::Gapic::Config::Method] + # + attr_reader :get_simulation + ## + # RPC-specific configuration for `get_valued_resource` + # @return [::Gapic::Config::Method] + # + attr_reader :get_valued_resource + ## + # RPC-specific configuration for `get_iam_policy` + # @return [::Gapic::Config::Method] + # + attr_reader :get_iam_policy + ## + # RPC-specific configuration for `get_mute_config` + # @return [::Gapic::Config::Method] + # + attr_reader :get_mute_config + ## + # RPC-specific configuration for `get_notification_config` + # @return [::Gapic::Config::Method] + # + attr_reader :get_notification_config + ## + # RPC-specific configuration for `get_resource_value_config` + # @return [::Gapic::Config::Method] + # + attr_reader :get_resource_value_config + ## + # RPC-specific configuration for `get_source` + # @return [::Gapic::Config::Method] + # + attr_reader :get_source + ## + # RPC-specific configuration for `group_findings` + # @return [::Gapic::Config::Method] + # + attr_reader :group_findings + ## + # RPC-specific configuration for `list_attack_paths` + # @return [::Gapic::Config::Method] + # + attr_reader :list_attack_paths + ## + # RPC-specific configuration for `list_big_query_exports` + # @return [::Gapic::Config::Method] + # + attr_reader :list_big_query_exports + ## + # RPC-specific configuration for `list_findings` + # @return [::Gapic::Config::Method] + # + attr_reader :list_findings + ## + # RPC-specific configuration for `list_mute_configs` + # @return [::Gapic::Config::Method] + # + attr_reader :list_mute_configs + ## + # RPC-specific configuration for `list_notification_configs` + # @return [::Gapic::Config::Method] + # + attr_reader :list_notification_configs + ## + # RPC-specific configuration for `list_resource_value_configs` + # @return [::Gapic::Config::Method] + # + attr_reader :list_resource_value_configs + ## + # RPC-specific configuration for `list_sources` + # @return [::Gapic::Config::Method] + # + attr_reader :list_sources + ## + # RPC-specific configuration for `list_valued_resources` + # @return [::Gapic::Config::Method] + # + attr_reader :list_valued_resources + ## + # RPC-specific configuration for `set_finding_state` + # @return [::Gapic::Config::Method] + # + attr_reader :set_finding_state + ## + # RPC-specific configuration for `set_iam_policy` + # @return [::Gapic::Config::Method] + # + attr_reader :set_iam_policy + ## + # RPC-specific configuration for `set_mute` + # @return [::Gapic::Config::Method] + # + attr_reader :set_mute + ## + # RPC-specific configuration for `test_iam_permissions` + # @return [::Gapic::Config::Method] + # + attr_reader :test_iam_permissions + ## + # RPC-specific configuration for `update_big_query_export` + # @return [::Gapic::Config::Method] + # + attr_reader :update_big_query_export + ## + # RPC-specific configuration for `update_external_system` + # @return [::Gapic::Config::Method] + # + attr_reader :update_external_system + ## + # RPC-specific configuration for `update_finding` + # @return [::Gapic::Config::Method] + # + attr_reader :update_finding + ## + # RPC-specific configuration for `update_mute_config` + # @return [::Gapic::Config::Method] + # + attr_reader :update_mute_config + ## + # RPC-specific configuration for `update_notification_config` + # @return [::Gapic::Config::Method] + # + attr_reader :update_notification_config + ## + # RPC-specific configuration for `update_resource_value_config` + # @return [::Gapic::Config::Method] + # + attr_reader :update_resource_value_config + ## + # RPC-specific configuration for `update_security_marks` + # @return [::Gapic::Config::Method] + # + attr_reader :update_security_marks + ## + # RPC-specific configuration for `update_source` + # @return [::Gapic::Config::Method] + # + attr_reader :update_source + + # @private + def initialize parent_rpcs = nil + batch_create_resource_value_configs_config = parent_rpcs.batch_create_resource_value_configs if parent_rpcs.respond_to? :batch_create_resource_value_configs + @batch_create_resource_value_configs = ::Gapic::Config::Method.new batch_create_resource_value_configs_config + bulk_mute_findings_config = parent_rpcs.bulk_mute_findings if parent_rpcs.respond_to? :bulk_mute_findings + @bulk_mute_findings = ::Gapic::Config::Method.new bulk_mute_findings_config + create_big_query_export_config = parent_rpcs.create_big_query_export if parent_rpcs.respond_to? :create_big_query_export + @create_big_query_export = ::Gapic::Config::Method.new create_big_query_export_config + create_finding_config = parent_rpcs.create_finding if parent_rpcs.respond_to? :create_finding + @create_finding = ::Gapic::Config::Method.new create_finding_config + create_mute_config_config = parent_rpcs.create_mute_config if parent_rpcs.respond_to? :create_mute_config + @create_mute_config = ::Gapic::Config::Method.new create_mute_config_config + create_notification_config_config = parent_rpcs.create_notification_config if parent_rpcs.respond_to? :create_notification_config + @create_notification_config = ::Gapic::Config::Method.new create_notification_config_config + create_source_config = parent_rpcs.create_source if parent_rpcs.respond_to? :create_source + @create_source = ::Gapic::Config::Method.new create_source_config + delete_big_query_export_config = parent_rpcs.delete_big_query_export if parent_rpcs.respond_to? :delete_big_query_export + @delete_big_query_export = ::Gapic::Config::Method.new delete_big_query_export_config + delete_mute_config_config = parent_rpcs.delete_mute_config if parent_rpcs.respond_to? :delete_mute_config + @delete_mute_config = ::Gapic::Config::Method.new delete_mute_config_config + delete_notification_config_config = parent_rpcs.delete_notification_config if parent_rpcs.respond_to? :delete_notification_config + @delete_notification_config = ::Gapic::Config::Method.new delete_notification_config_config + delete_resource_value_config_config = parent_rpcs.delete_resource_value_config if parent_rpcs.respond_to? :delete_resource_value_config + @delete_resource_value_config = ::Gapic::Config::Method.new delete_resource_value_config_config + get_big_query_export_config = parent_rpcs.get_big_query_export if parent_rpcs.respond_to? :get_big_query_export + @get_big_query_export = ::Gapic::Config::Method.new get_big_query_export_config + get_simulation_config = parent_rpcs.get_simulation if parent_rpcs.respond_to? :get_simulation + @get_simulation = ::Gapic::Config::Method.new get_simulation_config + get_valued_resource_config = parent_rpcs.get_valued_resource if parent_rpcs.respond_to? :get_valued_resource + @get_valued_resource = ::Gapic::Config::Method.new get_valued_resource_config + get_iam_policy_config = parent_rpcs.get_iam_policy if parent_rpcs.respond_to? :get_iam_policy + @get_iam_policy = ::Gapic::Config::Method.new get_iam_policy_config + get_mute_config_config = parent_rpcs.get_mute_config if parent_rpcs.respond_to? :get_mute_config + @get_mute_config = ::Gapic::Config::Method.new get_mute_config_config + get_notification_config_config = parent_rpcs.get_notification_config if parent_rpcs.respond_to? :get_notification_config + @get_notification_config = ::Gapic::Config::Method.new get_notification_config_config + get_resource_value_config_config = parent_rpcs.get_resource_value_config if parent_rpcs.respond_to? :get_resource_value_config + @get_resource_value_config = ::Gapic::Config::Method.new get_resource_value_config_config + get_source_config = parent_rpcs.get_source if parent_rpcs.respond_to? :get_source + @get_source = ::Gapic::Config::Method.new get_source_config + group_findings_config = parent_rpcs.group_findings if parent_rpcs.respond_to? :group_findings + @group_findings = ::Gapic::Config::Method.new group_findings_config + list_attack_paths_config = parent_rpcs.list_attack_paths if parent_rpcs.respond_to? :list_attack_paths + @list_attack_paths = ::Gapic::Config::Method.new list_attack_paths_config + list_big_query_exports_config = parent_rpcs.list_big_query_exports if parent_rpcs.respond_to? :list_big_query_exports + @list_big_query_exports = ::Gapic::Config::Method.new list_big_query_exports_config + list_findings_config = parent_rpcs.list_findings if parent_rpcs.respond_to? :list_findings + @list_findings = ::Gapic::Config::Method.new list_findings_config + list_mute_configs_config = parent_rpcs.list_mute_configs if parent_rpcs.respond_to? :list_mute_configs + @list_mute_configs = ::Gapic::Config::Method.new list_mute_configs_config + list_notification_configs_config = parent_rpcs.list_notification_configs if parent_rpcs.respond_to? :list_notification_configs + @list_notification_configs = ::Gapic::Config::Method.new list_notification_configs_config + list_resource_value_configs_config = parent_rpcs.list_resource_value_configs if parent_rpcs.respond_to? :list_resource_value_configs + @list_resource_value_configs = ::Gapic::Config::Method.new list_resource_value_configs_config + list_sources_config = parent_rpcs.list_sources if parent_rpcs.respond_to? :list_sources + @list_sources = ::Gapic::Config::Method.new list_sources_config + list_valued_resources_config = parent_rpcs.list_valued_resources if parent_rpcs.respond_to? :list_valued_resources + @list_valued_resources = ::Gapic::Config::Method.new list_valued_resources_config + set_finding_state_config = parent_rpcs.set_finding_state if parent_rpcs.respond_to? :set_finding_state + @set_finding_state = ::Gapic::Config::Method.new set_finding_state_config + set_iam_policy_config = parent_rpcs.set_iam_policy if parent_rpcs.respond_to? :set_iam_policy + @set_iam_policy = ::Gapic::Config::Method.new set_iam_policy_config + set_mute_config = parent_rpcs.set_mute if parent_rpcs.respond_to? :set_mute + @set_mute = ::Gapic::Config::Method.new set_mute_config + test_iam_permissions_config = parent_rpcs.test_iam_permissions if parent_rpcs.respond_to? :test_iam_permissions + @test_iam_permissions = ::Gapic::Config::Method.new test_iam_permissions_config + update_big_query_export_config = parent_rpcs.update_big_query_export if parent_rpcs.respond_to? :update_big_query_export + @update_big_query_export = ::Gapic::Config::Method.new update_big_query_export_config + update_external_system_config = parent_rpcs.update_external_system if parent_rpcs.respond_to? :update_external_system + @update_external_system = ::Gapic::Config::Method.new update_external_system_config + update_finding_config = parent_rpcs.update_finding if parent_rpcs.respond_to? :update_finding + @update_finding = ::Gapic::Config::Method.new update_finding_config + update_mute_config_config = parent_rpcs.update_mute_config if parent_rpcs.respond_to? :update_mute_config + @update_mute_config = ::Gapic::Config::Method.new update_mute_config_config + update_notification_config_config = parent_rpcs.update_notification_config if parent_rpcs.respond_to? :update_notification_config + @update_notification_config = ::Gapic::Config::Method.new update_notification_config_config + update_resource_value_config_config = parent_rpcs.update_resource_value_config if parent_rpcs.respond_to? :update_resource_value_config + @update_resource_value_config = ::Gapic::Config::Method.new update_resource_value_config_config + update_security_marks_config = parent_rpcs.update_security_marks if parent_rpcs.respond_to? :update_security_marks + @update_security_marks = ::Gapic::Config::Method.new update_security_marks_config + update_source_config = parent_rpcs.update_source if parent_rpcs.respond_to? :update_source + @update_source = ::Gapic::Config::Method.new update_source_config + + yield self if block_given? + end + end + end + end + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-security_center-v2/lib/google/cloud/security_center/v2/security_center/credentials.rb b/owl-bot-staging/google-cloud-security_center-v2/lib/google/cloud/security_center/v2/security_center/credentials.rb new file mode 100644 index 000000000000..a53a263683eb --- /dev/null +++ b/owl-bot-staging/google-cloud-security_center-v2/lib/google/cloud/security_center/v2/security_center/credentials.rb @@ -0,0 +1,51 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +require "googleauth" + +module Google + module Cloud + module SecurityCenter + module V2 + module SecurityCenter + # Credentials for the SecurityCenter API. + class Credentials < ::Google::Auth::Credentials + self.scope = [ + "https://www.googleapis.com/auth/cloud-platform" + ] + self.env_vars = [ + "SECURITY_CENTER_CREDENTIALS", + "SECURITY_CENTER_KEYFILE", + "GOOGLE_CLOUD_CREDENTIALS", + "GOOGLE_CLOUD_KEYFILE", + "GCLOUD_KEYFILE", + "SECURITY_CENTER_CREDENTIALS_JSON", + "SECURITY_CENTER_KEYFILE_JSON", + "GOOGLE_CLOUD_CREDENTIALS_JSON", + "GOOGLE_CLOUD_KEYFILE_JSON", + "GCLOUD_KEYFILE_JSON" + ] + self.paths = [ + "~/.config/google_cloud/application_default_credentials.json" + ] + end + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-security_center-v2/lib/google/cloud/security_center/v2/security_center/operations.rb b/owl-bot-staging/google-cloud-security_center-v2/lib/google/cloud/security_center/v2/security_center/operations.rb new file mode 100644 index 000000000000..1e56a46d3e81 --- /dev/null +++ b/owl-bot-staging/google-cloud-security_center-v2/lib/google/cloud/security_center/v2/security_center/operations.rb @@ -0,0 +1,841 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +require "gapic/operation" +require "google/longrunning/operations_pb" + +module Google + module Cloud + module SecurityCenter + module V2 + module SecurityCenter + # Service that implements Longrunning Operations API. + class Operations + # @private + API_VERSION = "" + + # @private + DEFAULT_ENDPOINT_TEMPLATE = "securitycenter.$UNIVERSE_DOMAIN$" + + # @private + attr_reader :operations_stub + + ## + # Configuration for the SecurityCenter 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 SecurityCenter 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::SecurityCenter::V2::VERSION + metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.name + header_params["name"] = request.name + end + + request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") + metadata[:"x-goog-request-params"] ||= request_params_header + + options.apply_defaults timeout: @config.rpcs.list_operations.timeout, + metadata: metadata, + retry_policy: @config.rpcs.list_operations.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @operations_stub.call_rpc :list_operations, request, options: options do |response, operation| + wrap_lro_operation = ->(op_response) { ::Gapic::Operation.new op_response, @operations_client } + response = ::Gapic::PagedEnumerable.new @operations_stub, :list_operations, request, response, operation, options, format_resource: wrap_lro_operation + yield response, operation if block_given? + throw :response, response + end + rescue ::GRPC::BadStatus => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Gets the latest state of a long-running operation. Clients can use this + # method to poll the operation result at intervals as recommended by the API + # service. + # + # @overload get_operation(request, options = nil) + # Pass arguments to `get_operation` via a request object, either of type + # {::Google::Longrunning::GetOperationRequest} or an equivalent Hash. + # + # @param request [::Google::Longrunning::GetOperationRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. + # + # @overload get_operation(name: nil) + # Pass arguments to `get_operation` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param name [::String] + # The name of the operation resource. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Gapic::Operation] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Gapic::Operation] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/longrunning" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Longrunning::Operations::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Longrunning::GetOperationRequest.new + # + # # Call the get_operation method. + # result = client.get_operation request + # + # # The returned object is of type Gapic::Operation. You can use it to + # # check the status of an operation, cancel it, or wait for results. + # # Here is how to wait for a response. + # result.wait_until_done! timeout: 60 + # if result.response? + # p result.response + # else + # puts "No response received." + # end + # + def get_operation request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Longrunning::GetOperationRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + metadata = @config.rpcs.get_operation.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::SecurityCenter::V2::VERSION + metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.name + header_params["name"] = request.name + end + + request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") + metadata[:"x-goog-request-params"] ||= request_params_header + + options.apply_defaults timeout: @config.rpcs.get_operation.timeout, + metadata: metadata, + retry_policy: @config.rpcs.get_operation.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @operations_stub.call_rpc :get_operation, request, options: options do |response, operation| + response = ::Gapic::Operation.new response, @operations_client, options: options + yield response, operation if block_given? + throw :response, response + end + rescue ::GRPC::BadStatus => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Deletes a long-running operation. This method indicates that the client is + # no longer interested in the operation result. It does not cancel the + # operation. If the server doesn't support this method, it returns + # `google.rpc.Code.UNIMPLEMENTED`. + # + # @overload delete_operation(request, options = nil) + # Pass arguments to `delete_operation` via a request object, either of type + # {::Google::Longrunning::DeleteOperationRequest} or an equivalent Hash. + # + # @param request [::Google::Longrunning::DeleteOperationRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. + # + # @overload delete_operation(name: nil) + # Pass arguments to `delete_operation` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param name [::String] + # The name of the operation resource to be deleted. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Google::Protobuf::Empty] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Google::Protobuf::Empty] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/longrunning" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Longrunning::Operations::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Longrunning::DeleteOperationRequest.new + # + # # Call the delete_operation method. + # result = client.delete_operation request + # + # # The returned object is of type Google::Protobuf::Empty. + # p result + # + def delete_operation request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Longrunning::DeleteOperationRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + metadata = @config.rpcs.delete_operation.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::SecurityCenter::V2::VERSION + metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.name + header_params["name"] = request.name + end + + request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") + metadata[:"x-goog-request-params"] ||= request_params_header + + options.apply_defaults timeout: @config.rpcs.delete_operation.timeout, + metadata: metadata, + retry_policy: @config.rpcs.delete_operation.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @operations_stub.call_rpc :delete_operation, request, options: options do |response, operation| + yield response, operation if block_given? + end + rescue ::GRPC::BadStatus => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Starts asynchronous cancellation on a long-running operation. The server + # makes a best effort to cancel the operation, but success is not + # guaranteed. If the server doesn't support this method, it returns + # `google.rpc.Code.UNIMPLEMENTED`. Clients can use + # Operations.GetOperation or + # other methods to check whether the cancellation succeeded or whether the + # operation completed despite cancellation. On successful cancellation, + # the operation is not deleted; instead, it becomes an operation with + # an {::Google::Longrunning::Operation#error Operation.error} value with a + # {::Google::Rpc::Status#code google.rpc.Status.code} of `1`, corresponding to + # `Code.CANCELLED`. + # + # @overload cancel_operation(request, options = nil) + # Pass arguments to `cancel_operation` via a request object, either of type + # {::Google::Longrunning::CancelOperationRequest} or an equivalent Hash. + # + # @param request [::Google::Longrunning::CancelOperationRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. + # + # @overload cancel_operation(name: nil) + # Pass arguments to `cancel_operation` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param name [::String] + # The name of the operation resource to be cancelled. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Google::Protobuf::Empty] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Google::Protobuf::Empty] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/longrunning" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Longrunning::Operations::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Longrunning::CancelOperationRequest.new + # + # # Call the cancel_operation method. + # result = client.cancel_operation request + # + # # The returned object is of type Google::Protobuf::Empty. + # p result + # + def cancel_operation request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Longrunning::CancelOperationRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + metadata = @config.rpcs.cancel_operation.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::SecurityCenter::V2::VERSION + metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.name + header_params["name"] = request.name + end + + request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") + metadata[:"x-goog-request-params"] ||= request_params_header + + options.apply_defaults timeout: @config.rpcs.cancel_operation.timeout, + metadata: metadata, + retry_policy: @config.rpcs.cancel_operation.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @operations_stub.call_rpc :cancel_operation, request, options: options do |response, operation| + yield response, operation if block_given? + end + rescue ::GRPC::BadStatus => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Waits until the specified long-running operation is done or reaches at most + # a specified timeout, returning the latest state. If the operation is + # already done, the latest state is immediately returned. If the timeout + # specified is greater than the default HTTP/RPC timeout, the HTTP/RPC + # timeout is used. If the server does not support this method, it returns + # `google.rpc.Code.UNIMPLEMENTED`. + # Note that this method is on a best-effort basis. It may return the latest + # state before the specified timeout (including immediately), meaning even an + # immediate response is no guarantee that the operation is done. + # + # @overload wait_operation(request, options = nil) + # Pass arguments to `wait_operation` via a request object, either of type + # {::Google::Longrunning::WaitOperationRequest} or an equivalent Hash. + # + # @param request [::Google::Longrunning::WaitOperationRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. + # + # @overload wait_operation(name: nil, timeout: nil) + # Pass arguments to `wait_operation` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param name [::String] + # The name of the operation resource to wait on. + # @param timeout [::Google::Protobuf::Duration, ::Hash] + # The maximum duration to wait before timing out. If left blank, the wait + # will be at most the time permitted by the underlying HTTP/RPC protocol. + # If RPC context deadline is also specified, the shorter one will be used. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Gapic::Operation] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Gapic::Operation] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/longrunning" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Longrunning::Operations::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Longrunning::WaitOperationRequest.new + # + # # Call the wait_operation method. + # result = client.wait_operation request + # + # # The returned object is of type Gapic::Operation. You can use it to + # # check the status of an operation, cancel it, or wait for results. + # # Here is how to wait for a response. + # result.wait_until_done! timeout: 60 + # if result.response? + # p result.response + # else + # puts "No response received." + # end + # + def wait_operation request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Longrunning::WaitOperationRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + metadata = @config.rpcs.wait_operation.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::SecurityCenter::V2::VERSION + metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + options.apply_defaults timeout: @config.rpcs.wait_operation.timeout, + metadata: metadata, + retry_policy: @config.rpcs.wait_operation.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @operations_stub.call_rpc :wait_operation, request, options: options do |response, operation| + response = ::Gapic::Operation.new response, @operations_client, options: options + yield response, operation if block_given? + throw :response, response + end + rescue ::GRPC::BadStatus => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Configuration class for the Operations API. + # + # This class represents the configuration for Operations, + # providing control over timeouts, retry behavior, logging, transport + # parameters, and other low-level controls. Certain parameters can also be + # applied individually to specific RPCs. See + # {::Google::Longrunning::Operations::Client::Configuration::Rpcs} + # for a list of RPCs that can be configured independently. + # + # Configuration can be applied globally to all clients, or to a single client + # on construction. + # + # @example + # + # # Modify the global config, setting the timeout for + # # list_operations to 20 seconds, + # # and all remaining timeouts to 10 seconds. + # ::Google::Longrunning::Operations::Client.configure do |config| + # config.timeout = 10.0 + # config.rpcs.list_operations.timeout = 20.0 + # end + # + # # Apply the above configuration only to a new client. + # client = ::Google::Longrunning::Operations::Client.new do |config| + # config.timeout = 10.0 + # config.rpcs.list_operations.timeout = 20.0 + # end + # + # @!attribute [rw] endpoint + # A custom service endpoint, as a hostname or hostname:port. The default is + # nil, indicating to use the default endpoint in the current universe domain. + # @return [::String,nil] + # @!attribute [rw] credentials + # Credentials to send with calls. You may provide any of the following types: + # * (`Google::Auth::Credentials`) A googleauth credentials object + # (see the [googleauth docs](https://rubydoc.info/gems/googleauth/Google/Auth/Credentials)) + # * (`Signet::OAuth2::Client`) A signet oauth2 client object + # (see the [signet docs](https://rubydoc.info/gems/signet/Signet/OAuth2/Client)) + # * (`GRPC::Core::Channel`) a gRPC channel with included credentials + # * (`GRPC::Core::ChannelCredentials`) a gRPC credentails object + # * (`nil`) indicating no credentials + # + # @note Warning: Passing a `String` to a keyfile path or a `Hash` of credentials + # is deprecated. Providing an unvalidated credential configuration to + # Google APIs can compromise the security of your systems and data. + # + # @example + # + # # The recommended way to provide credentials is to use the `make_creds` method + # # on the appropriate credentials class for your environment. + # + # require "googleauth" + # + # credentials = ::Google::Auth::ServiceAccountCredentials.make_creds( + # json_key_io: ::File.open("/path/to/keyfile.json") + # ) + # + # client = ::Google::Longrunning::Operations::Client.new do |config| + # config.credentials = credentials + # end + # + # @note Warning: If you accept a credential configuration (JSON file or Hash) from an + # external source for authentication to Google Cloud, you must validate it before + # providing it to a Google API client library. Providing an unvalidated credential + # configuration to Google APIs can compromise the security of your systems and data. + # For more information, refer to [Validate credential configurations from external + # sources](https://cloud.google.com/docs/authentication/external/externally-sourced-credentials). + # @return [::Object] + # @!attribute [rw] scope + # The OAuth scopes + # @return [::Array<::String>] + # @!attribute [rw] lib_name + # The library name as recorded in instrumentation and logging + # @return [::String] + # @!attribute [rw] lib_version + # The library version as recorded in instrumentation and logging + # @return [::String] + # @!attribute [rw] channel_args + # Extra parameters passed to the gRPC channel. Note: this is ignored if a + # `GRPC::Core::Channel` object is provided as the credential. + # @return [::Hash] + # @!attribute [rw] interceptors + # An array of interceptors that are run before calls are executed. + # @return [::Array<::GRPC::ClientInterceptor>] + # @!attribute [rw] timeout + # The call timeout in seconds. + # @return [::Numeric] + # @!attribute [rw] metadata + # Additional gRPC headers to be sent with the call. + # @return [::Hash{::Symbol=>::String}] + # @!attribute [rw] retry_policy + # The retry policy. The value is a hash with the following keys: + # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds. + # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds. + # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier. + # * `:retry_codes` (*type:* `Array`) - The error codes that should + # trigger a retry. + # @return [::Hash] + # @!attribute [rw] quota_project + # A separate project against which to charge quota. + # @return [::String] + # @!attribute [rw] universe_domain + # The universe domain within which to make requests. This determines the + # default endpoint URL. The default value of nil uses the environment + # universe (usually the default "googleapis.com" universe). + # @return [::String,nil] + # @!attribute [rw] logger + # A custom logger to use for request/response debug logging, or the value + # `:default` (the default) to construct a default logger, or `nil` to + # explicitly disable logging. + # @return [::Logger,:default,nil] + # + class Configuration + extend ::Gapic::Config + + # @private + # The endpoint specific to the default "googleapis.com" universe. Deprecated. + DEFAULT_ENDPOINT = "securitycenter.googleapis.com" + + config_attr :endpoint, nil, ::String, nil + config_attr :credentials, nil do |value| + allowed = [::String, ::Hash, ::Proc, ::Symbol, ::Google::Auth::Credentials, ::Google::Auth::BaseClient, ::Signet::OAuth2::Client, nil] + allowed += [::GRPC::Core::Channel, ::GRPC::Core::ChannelCredentials] if defined? ::GRPC::Core::Channel + allowed.any? { |klass| klass === value } + end + config_attr :scope, nil, ::String, ::Array, nil + config_attr :lib_name, nil, ::String, nil + config_attr :lib_version, nil, ::String, nil + config_attr(:channel_args, { "grpc.service_config_disable_resolution" => 1 }, ::Hash, nil) + config_attr :interceptors, nil, ::Array, nil + config_attr :timeout, nil, ::Numeric, nil + config_attr :metadata, nil, ::Hash, nil + config_attr :retry_policy, nil, ::Hash, ::Proc, nil + config_attr :quota_project, nil, ::String, nil + config_attr :universe_domain, nil, ::String, nil + config_attr :logger, :default, ::Logger, nil, :default + + # @private + def initialize parent_config = nil + @parent_config = parent_config unless parent_config.nil? + + yield self if block_given? + end + + ## + # Configurations for individual RPCs + # @return [Rpcs] + # + def rpcs + @rpcs ||= begin + parent_rpcs = nil + parent_rpcs = @parent_config.rpcs if defined?(@parent_config) && @parent_config.respond_to?(:rpcs) + Rpcs.new parent_rpcs + end + end + + ## + # Configuration for the channel pool + # @return [::Gapic::ServiceStub::ChannelPool::Configuration] + # + def channel_pool + @channel_pool ||= ::Gapic::ServiceStub::ChannelPool::Configuration.new + end + + ## + # Configuration RPC class for the Operations API. + # + # Includes fields providing the configuration for each RPC in this service. + # Each configuration object is of type `Gapic::Config::Method` and includes + # the following configuration fields: + # + # * `timeout` (*type:* `Numeric`) - The call timeout in seconds + # * `metadata` (*type:* `Hash{Symbol=>String}`) - Additional gRPC headers + # * `retry_policy (*type:* `Hash`) - The retry policy. The policy fields + # include the following keys: + # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds. + # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds. + # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier. + # * `:retry_codes` (*type:* `Array`) - The error codes that should + # trigger a retry. + # + class Rpcs + ## + # RPC-specific configuration for `list_operations` + # @return [::Gapic::Config::Method] + # + attr_reader :list_operations + ## + # RPC-specific configuration for `get_operation` + # @return [::Gapic::Config::Method] + # + attr_reader :get_operation + ## + # RPC-specific configuration for `delete_operation` + # @return [::Gapic::Config::Method] + # + attr_reader :delete_operation + ## + # RPC-specific configuration for `cancel_operation` + # @return [::Gapic::Config::Method] + # + attr_reader :cancel_operation + ## + # RPC-specific configuration for `wait_operation` + # @return [::Gapic::Config::Method] + # + attr_reader :wait_operation + + # @private + def initialize parent_rpcs = nil + list_operations_config = parent_rpcs.list_operations if parent_rpcs.respond_to? :list_operations + @list_operations = ::Gapic::Config::Method.new list_operations_config + get_operation_config = parent_rpcs.get_operation if parent_rpcs.respond_to? :get_operation + @get_operation = ::Gapic::Config::Method.new get_operation_config + delete_operation_config = parent_rpcs.delete_operation if parent_rpcs.respond_to? :delete_operation + @delete_operation = ::Gapic::Config::Method.new delete_operation_config + cancel_operation_config = parent_rpcs.cancel_operation if parent_rpcs.respond_to? :cancel_operation + @cancel_operation = ::Gapic::Config::Method.new cancel_operation_config + wait_operation_config = parent_rpcs.wait_operation if parent_rpcs.respond_to? :wait_operation + @wait_operation = ::Gapic::Config::Method.new wait_operation_config + + yield self if block_given? + end + end + end + end + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-security_center-v2/lib/google/cloud/security_center/v2/security_center/paths.rb b/owl-bot-staging/google-cloud-security_center-v2/lib/google/cloud/security_center/v2/security_center/paths.rb new file mode 100644 index 000000000000..680b1675791d --- /dev/null +++ b/owl-bot-staging/google-cloud-security_center-v2/lib/google/cloud/security_center/v2/security_center/paths.rb @@ -0,0 +1,1068 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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 SecurityCenter + module V2 + module SecurityCenter + # Path helper methods for the SecurityCenter API. + module Paths + ## + # Create a fully-qualified BigQueryExport resource string. + # + # @overload big_query_export_path(organization:, location:, export:) + # The resource will be in the following format: + # + # `organizations/{organization}/locations/{location}/bigQueryExports/{export}` + # + # @param organization [String] + # @param location [String] + # @param export [String] + # + # @overload big_query_export_path(folder:, location:, export:) + # The resource will be in the following format: + # + # `folders/{folder}/locations/{location}/bigQueryExports/{export}` + # + # @param folder [String] + # @param location [String] + # @param export [String] + # + # @overload big_query_export_path(project:, location:, export:) + # The resource will be in the following format: + # + # `projects/{project}/locations/{location}/bigQueryExports/{export}` + # + # @param project [String] + # @param location [String] + # @param export [String] + # + # @return [::String] + def big_query_export_path **args + resources = { + "export:location:organization" => (proc do |organization:, location:, export:| + raise ::ArgumentError, "organization cannot contain /" if organization.to_s.include? "/" + raise ::ArgumentError, "location cannot contain /" if location.to_s.include? "/" + + "organizations/#{organization}/locations/#{location}/bigQueryExports/#{export}" + end), + "export:folder:location" => (proc do |folder:, location:, export:| + raise ::ArgumentError, "folder cannot contain /" if folder.to_s.include? "/" + raise ::ArgumentError, "location cannot contain /" if location.to_s.include? "/" + + "folders/#{folder}/locations/#{location}/bigQueryExports/#{export}" + end), + "export:location:project" => (proc do |project:, location:, export:| + raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" + raise ::ArgumentError, "location cannot contain /" if location.to_s.include? "/" + + "projects/#{project}/locations/#{location}/bigQueryExports/#{export}" + 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 DlpJob resource string. + # + # @overload dlp_job_path(project:, dlp_job:) + # The resource will be in the following format: + # + # `projects/{project}/dlpJobs/{dlp_job}` + # + # @param project [String] + # @param dlp_job [String] + # + # @overload dlp_job_path(project:, location:, dlp_job:) + # The resource will be in the following format: + # + # `projects/{project}/locations/{location}/dlpJobs/{dlp_job}` + # + # @param project [String] + # @param location [String] + # @param dlp_job [String] + # + # @return [::String] + def dlp_job_path **args + resources = { + "dlp_job:project" => (proc do |project:, dlp_job:| + raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" + + "projects/#{project}/dlpJobs/#{dlp_job}" + end), + "dlp_job:location:project" => (proc do |project:, location:, dlp_job:| + raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" + raise ::ArgumentError, "location cannot contain /" if location.to_s.include? "/" + + "projects/#{project}/locations/#{location}/dlpJobs/#{dlp_job}" + 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 ExternalSystem resource string. + # + # @overload external_system_path(organization:, source:, finding:, externalsystem:) + # The resource will be in the following format: + # + # `organizations/{organization}/sources/{source}/findings/{finding}/externalSystems/{externalsystem}` + # + # @param organization [String] + # @param source [String] + # @param finding [String] + # @param externalsystem [String] + # + # @overload external_system_path(organization:, source:, location:, finding:, externalsystem:) + # The resource will be in the following format: + # + # `organizations/{organization}/sources/{source}/locations/{location}/findings/{finding}/externalSystems/{externalsystem}` + # + # @param organization [String] + # @param source [String] + # @param location [String] + # @param finding [String] + # @param externalsystem [String] + # + # @overload external_system_path(folder:, source:, finding:, externalsystem:) + # The resource will be in the following format: + # + # `folders/{folder}/sources/{source}/findings/{finding}/externalSystems/{externalsystem}` + # + # @param folder [String] + # @param source [String] + # @param finding [String] + # @param externalsystem [String] + # + # @overload external_system_path(folder:, source:, location:, finding:, externalsystem:) + # The resource will be in the following format: + # + # `folders/{folder}/sources/{source}/locations/{location}/findings/{finding}/externalSystems/{externalsystem}` + # + # @param folder [String] + # @param source [String] + # @param location [String] + # @param finding [String] + # @param externalsystem [String] + # + # @overload external_system_path(project:, source:, finding:, externalsystem:) + # The resource will be in the following format: + # + # `projects/{project}/sources/{source}/findings/{finding}/externalSystems/{externalsystem}` + # + # @param project [String] + # @param source [String] + # @param finding [String] + # @param externalsystem [String] + # + # @overload external_system_path(project:, source:, location:, finding:, externalsystem:) + # The resource will be in the following format: + # + # `projects/{project}/sources/{source}/locations/{location}/findings/{finding}/externalSystems/{externalsystem}` + # + # @param project [String] + # @param source [String] + # @param location [String] + # @param finding [String] + # @param externalsystem [String] + # + # @return [::String] + def external_system_path **args + resources = { + "externalsystem:finding:organization:source" => (proc do |organization:, source:, finding:, externalsystem:| + raise ::ArgumentError, "organization cannot contain /" if organization.to_s.include? "/" + raise ::ArgumentError, "source cannot contain /" if source.to_s.include? "/" + raise ::ArgumentError, "finding cannot contain /" if finding.to_s.include? "/" + + "organizations/#{organization}/sources/#{source}/findings/#{finding}/externalSystems/#{externalsystem}" + end), + "externalsystem:finding:location:organization:source" => (proc do |organization:, source:, location:, finding:, externalsystem:| + raise ::ArgumentError, "organization cannot contain /" if organization.to_s.include? "/" + raise ::ArgumentError, "source cannot contain /" if source.to_s.include? "/" + raise ::ArgumentError, "location cannot contain /" if location.to_s.include? "/" + raise ::ArgumentError, "finding cannot contain /" if finding.to_s.include? "/" + + "organizations/#{organization}/sources/#{source}/locations/#{location}/findings/#{finding}/externalSystems/#{externalsystem}" + end), + "externalsystem:finding:folder:source" => (proc do |folder:, source:, finding:, externalsystem:| + raise ::ArgumentError, "folder cannot contain /" if folder.to_s.include? "/" + raise ::ArgumentError, "source cannot contain /" if source.to_s.include? "/" + raise ::ArgumentError, "finding cannot contain /" if finding.to_s.include? "/" + + "folders/#{folder}/sources/#{source}/findings/#{finding}/externalSystems/#{externalsystem}" + end), + "externalsystem:finding:folder:location:source" => (proc do |folder:, source:, location:, finding:, externalsystem:| + raise ::ArgumentError, "folder cannot contain /" if folder.to_s.include? "/" + raise ::ArgumentError, "source cannot contain /" if source.to_s.include? "/" + raise ::ArgumentError, "location cannot contain /" if location.to_s.include? "/" + raise ::ArgumentError, "finding cannot contain /" if finding.to_s.include? "/" + + "folders/#{folder}/sources/#{source}/locations/#{location}/findings/#{finding}/externalSystems/#{externalsystem}" + end), + "externalsystem:finding:project:source" => (proc do |project:, source:, finding:, externalsystem:| + raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" + raise ::ArgumentError, "source cannot contain /" if source.to_s.include? "/" + raise ::ArgumentError, "finding cannot contain /" if finding.to_s.include? "/" + + "projects/#{project}/sources/#{source}/findings/#{finding}/externalSystems/#{externalsystem}" + end), + "externalsystem:finding:location:project:source" => (proc do |project:, source:, location:, finding:, externalsystem:| + raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" + raise ::ArgumentError, "source cannot contain /" if source.to_s.include? "/" + raise ::ArgumentError, "location cannot contain /" if location.to_s.include? "/" + raise ::ArgumentError, "finding cannot contain /" if finding.to_s.include? "/" + + "projects/#{project}/sources/#{source}/locations/#{location}/findings/#{finding}/externalSystems/#{externalsystem}" + 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 Finding resource string. + # + # @overload finding_path(organization:, source:, finding:) + # The resource will be in the following format: + # + # `organizations/{organization}/sources/{source}/findings/{finding}` + # + # @param organization [String] + # @param source [String] + # @param finding [String] + # + # @overload finding_path(organization:, source:, location:, finding:) + # The resource will be in the following format: + # + # `organizations/{organization}/sources/{source}/locations/{location}/findings/{finding}` + # + # @param organization [String] + # @param source [String] + # @param location [String] + # @param finding [String] + # + # @overload finding_path(folder:, source:, finding:) + # The resource will be in the following format: + # + # `folders/{folder}/sources/{source}/findings/{finding}` + # + # @param folder [String] + # @param source [String] + # @param finding [String] + # + # @overload finding_path(folder:, source:, location:, finding:) + # The resource will be in the following format: + # + # `folders/{folder}/sources/{source}/locations/{location}/findings/{finding}` + # + # @param folder [String] + # @param source [String] + # @param location [String] + # @param finding [String] + # + # @overload finding_path(project:, source:, finding:) + # The resource will be in the following format: + # + # `projects/{project}/sources/{source}/findings/{finding}` + # + # @param project [String] + # @param source [String] + # @param finding [String] + # + # @overload finding_path(project:, source:, location:, finding:) + # The resource will be in the following format: + # + # `projects/{project}/sources/{source}/locations/{location}/findings/{finding}` + # + # @param project [String] + # @param source [String] + # @param location [String] + # @param finding [String] + # + # @return [::String] + def finding_path **args + resources = { + "finding:organization:source" => (proc do |organization:, source:, finding:| + raise ::ArgumentError, "organization cannot contain /" if organization.to_s.include? "/" + raise ::ArgumentError, "source cannot contain /" if source.to_s.include? "/" + + "organizations/#{organization}/sources/#{source}/findings/#{finding}" + end), + "finding:location:organization:source" => (proc do |organization:, source:, location:, finding:| + raise ::ArgumentError, "organization cannot contain /" if organization.to_s.include? "/" + raise ::ArgumentError, "source cannot contain /" if source.to_s.include? "/" + raise ::ArgumentError, "location cannot contain /" if location.to_s.include? "/" + + "organizations/#{organization}/sources/#{source}/locations/#{location}/findings/#{finding}" + end), + "finding:folder:source" => (proc do |folder:, source:, finding:| + raise ::ArgumentError, "folder cannot contain /" if folder.to_s.include? "/" + raise ::ArgumentError, "source cannot contain /" if source.to_s.include? "/" + + "folders/#{folder}/sources/#{source}/findings/#{finding}" + end), + "finding:folder:location:source" => (proc do |folder:, source:, location:, finding:| + raise ::ArgumentError, "folder cannot contain /" if folder.to_s.include? "/" + raise ::ArgumentError, "source cannot contain /" if source.to_s.include? "/" + raise ::ArgumentError, "location cannot contain /" if location.to_s.include? "/" + + "folders/#{folder}/sources/#{source}/locations/#{location}/findings/#{finding}" + end), + "finding:project:source" => (proc do |project:, source:, finding:| + raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" + raise ::ArgumentError, "source cannot contain /" if source.to_s.include? "/" + + "projects/#{project}/sources/#{source}/findings/#{finding}" + end), + "finding:location:project:source" => (proc do |project:, source:, location:, finding:| + raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" + raise ::ArgumentError, "source cannot contain /" if source.to_s.include? "/" + raise ::ArgumentError, "location cannot contain /" if location.to_s.include? "/" + + "projects/#{project}/sources/#{source}/locations/#{location}/findings/#{finding}" + 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 Folder resource string. + # + # The resource will be in the following format: + # + # `folders/{folder}` + # + # @param folder [String] + # + # @return [::String] + def folder_path folder: + "folders/#{folder}" + 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 MuteConfig resource string. + # + # @overload mute_config_path(organization:, mute_config:) + # The resource will be in the following format: + # + # `organizations/{organization}/muteConfigs/{mute_config}` + # + # @param organization [String] + # @param mute_config [String] + # + # @overload mute_config_path(organization:, location:, mute_config:) + # The resource will be in the following format: + # + # `organizations/{organization}/locations/{location}/muteConfigs/{mute_config}` + # + # @param organization [String] + # @param location [String] + # @param mute_config [String] + # + # @overload mute_config_path(folder:, mute_config:) + # The resource will be in the following format: + # + # `folders/{folder}/muteConfigs/{mute_config}` + # + # @param folder [String] + # @param mute_config [String] + # + # @overload mute_config_path(folder:, location:, mute_config:) + # The resource will be in the following format: + # + # `folders/{folder}/locations/{location}/muteConfigs/{mute_config}` + # + # @param folder [String] + # @param location [String] + # @param mute_config [String] + # + # @overload mute_config_path(project:, mute_config:) + # The resource will be in the following format: + # + # `projects/{project}/muteConfigs/{mute_config}` + # + # @param project [String] + # @param mute_config [String] + # + # @overload mute_config_path(project:, location:, mute_config:) + # The resource will be in the following format: + # + # `projects/{project}/locations/{location}/muteConfigs/{mute_config}` + # + # @param project [String] + # @param location [String] + # @param mute_config [String] + # + # @return [::String] + def mute_config_path **args + resources = { + "mute_config:organization" => (proc do |organization:, mute_config:| + raise ::ArgumentError, "organization cannot contain /" if organization.to_s.include? "/" + + "organizations/#{organization}/muteConfigs/#{mute_config}" + end), + "location:mute_config:organization" => (proc do |organization:, location:, mute_config:| + raise ::ArgumentError, "organization cannot contain /" if organization.to_s.include? "/" + raise ::ArgumentError, "location cannot contain /" if location.to_s.include? "/" + + "organizations/#{organization}/locations/#{location}/muteConfigs/#{mute_config}" + end), + "folder:mute_config" => (proc do |folder:, mute_config:| + raise ::ArgumentError, "folder cannot contain /" if folder.to_s.include? "/" + + "folders/#{folder}/muteConfigs/#{mute_config}" + end), + "folder:location:mute_config" => (proc do |folder:, location:, mute_config:| + raise ::ArgumentError, "folder cannot contain /" if folder.to_s.include? "/" + raise ::ArgumentError, "location cannot contain /" if location.to_s.include? "/" + + "folders/#{folder}/locations/#{location}/muteConfigs/#{mute_config}" + end), + "mute_config:project" => (proc do |project:, mute_config:| + raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" + + "projects/#{project}/muteConfigs/#{mute_config}" + end), + "location:mute_config:project" => (proc do |project:, location:, mute_config:| + raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" + raise ::ArgumentError, "location cannot contain /" if location.to_s.include? "/" + + "projects/#{project}/locations/#{location}/muteConfigs/#{mute_config}" + 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 NotificationConfig resource string. + # + # @overload notification_config_path(organization:, location:, notification_config:) + # The resource will be in the following format: + # + # `organizations/{organization}/locations/{location}/notificationConfigs/{notification_config}` + # + # @param organization [String] + # @param location [String] + # @param notification_config [String] + # + # @overload notification_config_path(folder:, location:, notification_config:) + # The resource will be in the following format: + # + # `folders/{folder}/locations/{location}/notificationConfigs/{notification_config}` + # + # @param folder [String] + # @param location [String] + # @param notification_config [String] + # + # @overload notification_config_path(project:, location:, notification_config:) + # The resource will be in the following format: + # + # `projects/{project}/locations/{location}/notificationConfigs/{notification_config}` + # + # @param project [String] + # @param location [String] + # @param notification_config [String] + # + # @return [::String] + def notification_config_path **args + resources = { + "location:notification_config:organization" => (proc do |organization:, location:, notification_config:| + raise ::ArgumentError, "organization cannot contain /" if organization.to_s.include? "/" + raise ::ArgumentError, "location cannot contain /" if location.to_s.include? "/" + + "organizations/#{organization}/locations/#{location}/notificationConfigs/#{notification_config}" + end), + "folder:location:notification_config" => (proc do |folder:, location:, notification_config:| + raise ::ArgumentError, "folder cannot contain /" if folder.to_s.include? "/" + raise ::ArgumentError, "location cannot contain /" if location.to_s.include? "/" + + "folders/#{folder}/locations/#{location}/notificationConfigs/#{notification_config}" + end), + "location:notification_config:project" => (proc do |project:, location:, notification_config:| + raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" + raise ::ArgumentError, "location cannot contain /" if location.to_s.include? "/" + + "projects/#{project}/locations/#{location}/notificationConfigs/#{notification_config}" + 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 Organization resource string. + # + # The resource will be in the following format: + # + # `organizations/{organization}` + # + # @param organization [String] + # + # @return [::String] + def organization_path organization: + "organizations/#{organization}" + 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 OrganizationValuedResource resource string. + # + # The resource will be in the following format: + # + # `organizations/{organization}/locations/{location}/simulations/{simulation}/valuedResources/{valued_resource}` + # + # @param organization [String] + # @param location [String] + # @param simulation [String] + # @param valued_resource [String] + # + # @return [::String] + def organization_valued_resource_path organization:, location:, simulation:, valued_resource: + raise ::ArgumentError, "organization cannot contain /" if organization.to_s.include? "/" + raise ::ArgumentError, "location cannot contain /" if location.to_s.include? "/" + raise ::ArgumentError, "simulation cannot contain /" if simulation.to_s.include? "/" + + "organizations/#{organization}/locations/#{location}/simulations/#{simulation}/valuedResources/#{valued_resource}" + end + + ## + # Create a fully-qualified Policy resource string. + # + # @overload policy_path(organization:, constraint_name:) + # The resource will be in the following format: + # + # `organizations/{organization}/policies/{constraint_name}` + # + # @param organization [String] + # @param constraint_name [String] + # + # @overload policy_path(folder:, constraint_name:) + # The resource will be in the following format: + # + # `folders/{folder}/policies/{constraint_name}` + # + # @param folder [String] + # @param constraint_name [String] + # + # @overload policy_path(project:, constraint_name:) + # The resource will be in the following format: + # + # `projects/{project}/policies/{constraint_name}` + # + # @param project [String] + # @param constraint_name [String] + # + # @return [::String] + def policy_path **args + resources = { + "constraint_name:organization" => (proc do |organization:, constraint_name:| + raise ::ArgumentError, "organization cannot contain /" if organization.to_s.include? "/" + + "organizations/#{organization}/policies/#{constraint_name}" + end), + "constraint_name:folder" => (proc do |folder:, constraint_name:| + raise ::ArgumentError, "folder cannot contain /" if folder.to_s.include? "/" + + "folders/#{folder}/policies/#{constraint_name}" + end), + "constraint_name:project" => (proc do |project:, constraint_name:| + raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" + + "projects/#{project}/policies/#{constraint_name}" + 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 Project resource string. + # + # The resource will be in the following format: + # + # `projects/{project}` + # + # @param project [String] + # + # @return [::String] + def project_path project: + "projects/#{project}" + end + + ## + # Create a fully-qualified ResourceValueConfig resource string. + # + # @overload resource_value_config_path(organization:, resource_value_config:) + # The resource will be in the following format: + # + # `organizations/{organization}/resourceValueConfigs/{resource_value_config}` + # + # @param organization [String] + # @param resource_value_config [String] + # + # @overload resource_value_config_path(organization:, location:, resource_value_config:) + # The resource will be in the following format: + # + # `organizations/{organization}/locations/{location}/resourceValueConfigs/{resource_value_config}` + # + # @param organization [String] + # @param location [String] + # @param resource_value_config [String] + # + # @return [::String] + def resource_value_config_path **args + resources = { + "organization:resource_value_config" => (proc do |organization:, resource_value_config:| + raise ::ArgumentError, "organization cannot contain /" if organization.to_s.include? "/" + + "organizations/#{organization}/resourceValueConfigs/#{resource_value_config}" + end), + "location:organization:resource_value_config" => (proc do |organization:, location:, resource_value_config:| + raise ::ArgumentError, "organization cannot contain /" if organization.to_s.include? "/" + raise ::ArgumentError, "location cannot contain /" if location.to_s.include? "/" + + "organizations/#{organization}/locations/#{location}/resourceValueConfigs/#{resource_value_config}" + 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 SecurityMarks resource string. + # + # @overload security_marks_path(organization:, asset:) + # The resource will be in the following format: + # + # `organizations/{organization}/assets/{asset}/securityMarks` + # + # @param organization [String] + # @param asset [String] + # + # @overload security_marks_path(organization:, source:, finding:) + # The resource will be in the following format: + # + # `organizations/{organization}/sources/{source}/findings/{finding}/securityMarks` + # + # @param organization [String] + # @param source [String] + # @param finding [String] + # + # @overload security_marks_path(organization:, source:, location:, finding:) + # The resource will be in the following format: + # + # `organizations/{organization}/sources/{source}/locations/{location}/findings/{finding}/securityMarks` + # + # @param organization [String] + # @param source [String] + # @param location [String] + # @param finding [String] + # + # @overload security_marks_path(folder:, asset:) + # The resource will be in the following format: + # + # `folders/{folder}/assets/{asset}/securityMarks` + # + # @param folder [String] + # @param asset [String] + # + # @overload security_marks_path(folder:, source:, finding:) + # The resource will be in the following format: + # + # `folders/{folder}/sources/{source}/findings/{finding}/securityMarks` + # + # @param folder [String] + # @param source [String] + # @param finding [String] + # + # @overload security_marks_path(folder:, source:, location:, finding:) + # The resource will be in the following format: + # + # `folders/{folder}/sources/{source}/locations/{location}/findings/{finding}/securityMarks` + # + # @param folder [String] + # @param source [String] + # @param location [String] + # @param finding [String] + # + # @overload security_marks_path(project:, asset:) + # The resource will be in the following format: + # + # `projects/{project}/assets/{asset}/securityMarks` + # + # @param project [String] + # @param asset [String] + # + # @overload security_marks_path(project:, source:, finding:) + # The resource will be in the following format: + # + # `projects/{project}/sources/{source}/findings/{finding}/securityMarks` + # + # @param project [String] + # @param source [String] + # @param finding [String] + # + # @overload security_marks_path(project:, source:, location:, finding:) + # The resource will be in the following format: + # + # `projects/{project}/sources/{source}/locations/{location}/findings/{finding}/securityMarks` + # + # @param project [String] + # @param source [String] + # @param location [String] + # @param finding [String] + # + # @return [::String] + def security_marks_path **args + resources = { + "asset:organization" => (proc do |organization:, asset:| + raise ::ArgumentError, "organization cannot contain /" if organization.to_s.include? "/" + + "organizations/#{organization}/assets/#{asset}/securityMarks" + end), + "finding:organization:source" => (proc do |organization:, source:, finding:| + raise ::ArgumentError, "organization cannot contain /" if organization.to_s.include? "/" + raise ::ArgumentError, "source cannot contain /" if source.to_s.include? "/" + + "organizations/#{organization}/sources/#{source}/findings/#{finding}/securityMarks" + end), + "finding:location:organization:source" => (proc do |organization:, source:, location:, finding:| + raise ::ArgumentError, "organization cannot contain /" if organization.to_s.include? "/" + raise ::ArgumentError, "source cannot contain /" if source.to_s.include? "/" + raise ::ArgumentError, "location cannot contain /" if location.to_s.include? "/" + + "organizations/#{organization}/sources/#{source}/locations/#{location}/findings/#{finding}/securityMarks" + end), + "asset:folder" => (proc do |folder:, asset:| + raise ::ArgumentError, "folder cannot contain /" if folder.to_s.include? "/" + + "folders/#{folder}/assets/#{asset}/securityMarks" + end), + "finding:folder:source" => (proc do |folder:, source:, finding:| + raise ::ArgumentError, "folder cannot contain /" if folder.to_s.include? "/" + raise ::ArgumentError, "source cannot contain /" if source.to_s.include? "/" + + "folders/#{folder}/sources/#{source}/findings/#{finding}/securityMarks" + end), + "finding:folder:location:source" => (proc do |folder:, source:, location:, finding:| + raise ::ArgumentError, "folder cannot contain /" if folder.to_s.include? "/" + raise ::ArgumentError, "source cannot contain /" if source.to_s.include? "/" + raise ::ArgumentError, "location cannot contain /" if location.to_s.include? "/" + + "folders/#{folder}/sources/#{source}/locations/#{location}/findings/#{finding}/securityMarks" + end), + "asset:project" => (proc do |project:, asset:| + raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" + + "projects/#{project}/assets/#{asset}/securityMarks" + end), + "finding:project:source" => (proc do |project:, source:, finding:| + raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" + raise ::ArgumentError, "source cannot contain /" if source.to_s.include? "/" + + "projects/#{project}/sources/#{source}/findings/#{finding}/securityMarks" + end), + "finding:location:project:source" => (proc do |project:, source:, location:, finding:| + raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" + raise ::ArgumentError, "source cannot contain /" if source.to_s.include? "/" + raise ::ArgumentError, "location cannot contain /" if location.to_s.include? "/" + + "projects/#{project}/sources/#{source}/locations/#{location}/findings/#{finding}/securityMarks" + 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 Simulation resource string. + # + # @overload simulation_path(organization:, simulation:) + # The resource will be in the following format: + # + # `organizations/{organization}/simulations/{simulation}` + # + # @param organization [String] + # @param simulation [String] + # + # @overload simulation_path(organization:, location:, simluation:) + # The resource will be in the following format: + # + # `organizations/{organization}/locations/{location}/simulations/{simluation}` + # + # @param organization [String] + # @param location [String] + # @param simluation [String] + # + # @return [::String] + def simulation_path **args + resources = { + "organization:simulation" => (proc do |organization:, simulation:| + raise ::ArgumentError, "organization cannot contain /" if organization.to_s.include? "/" + + "organizations/#{organization}/simulations/#{simulation}" + end), + "location:organization:simluation" => (proc do |organization:, location:, simluation:| + raise ::ArgumentError, "organization cannot contain /" if organization.to_s.include? "/" + raise ::ArgumentError, "location cannot contain /" if location.to_s.include? "/" + + "organizations/#{organization}/locations/#{location}/simulations/#{simluation}" + 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 Source resource string. + # + # @overload source_path(organization:, source:) + # The resource will be in the following format: + # + # `organizations/{organization}/sources/{source}` + # + # @param organization [String] + # @param source [String] + # + # @overload source_path(folder:, source:) + # The resource will be in the following format: + # + # `folders/{folder}/sources/{source}` + # + # @param folder [String] + # @param source [String] + # + # @overload source_path(project:, source:) + # The resource will be in the following format: + # + # `projects/{project}/sources/{source}` + # + # @param project [String] + # @param source [String] + # + # @return [::String] + def source_path **args + resources = { + "organization:source" => (proc do |organization:, source:| + raise ::ArgumentError, "organization cannot contain /" if organization.to_s.include? "/" + + "organizations/#{organization}/sources/#{source}" + end), + "folder:source" => (proc do |folder:, source:| + raise ::ArgumentError, "folder cannot contain /" if folder.to_s.include? "/" + + "folders/#{folder}/sources/#{source}" + end), + "project:source" => (proc do |project:, source:| + raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" + + "projects/#{project}/sources/#{source}" + 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 TableDataProfile resource string. + # + # @overload table_data_profile_path(project:, table_profile:) + # The resource will be in the following format: + # + # `projects/{project}/tableProfiles/{table_profile}` + # + # @param project [String] + # @param table_profile [String] + # + # @overload table_data_profile_path(project:, location:, table_profile:) + # The resource will be in the following format: + # + # `projects/{project}/locations/{location}/tableProfiles/{table_profile}` + # + # @param project [String] + # @param location [String] + # @param table_profile [String] + # + # @return [::String] + def table_data_profile_path **args + resources = { + "project:table_profile" => (proc do |project:, table_profile:| + raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" + + "projects/#{project}/tableProfiles/#{table_profile}" + end), + "location:project:table_profile" => (proc do |project:, location:, table_profile:| + raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" + raise ::ArgumentError, "location cannot contain /" if location.to_s.include? "/" + + "projects/#{project}/locations/#{location}/tableProfiles/#{table_profile}" + end) + } + + resource = resources[args.keys.sort.join(":")] + raise ::ArgumentError, "no resource found for values #{args.keys}" if resource.nil? + resource.call(**args) + end + + ## + # Create a fully-qualified Topic resource string. + # + # The resource will be in the following format: + # + # `projects/{project}/topics/{topic}` + # + # @param project [String] + # @param topic [String] + # + # @return [::String] + def topic_path project:, topic: + raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" + + "projects/#{project}/topics/#{topic}" + end + + ## + # Create a fully-qualified ValuedResource resource string. + # + # @overload valued_resource_path(organization:, simulation:, valued_resource:) + # The resource will be in the following format: + # + # `organizations/{organization}/simulations/{simulation}/valuedResources/{valued_resource}` + # + # @param organization [String] + # @param simulation [String] + # @param valued_resource [String] + # + # @overload valued_resource_path(organization:, location:, simluation:, valued_resource:) + # The resource will be in the following format: + # + # `organizations/{organization}/locations/{location}/simulations/{simluation}/valuedResources/{valued_resource}` + # + # @param organization [String] + # @param location [String] + # @param simluation [String] + # @param valued_resource [String] + # + # @return [::String] + def valued_resource_path **args + resources = { + "organization:simulation:valued_resource" => (proc do |organization:, simulation:, valued_resource:| + raise ::ArgumentError, "organization cannot contain /" if organization.to_s.include? "/" + raise ::ArgumentError, "simulation cannot contain /" if simulation.to_s.include? "/" + + "organizations/#{organization}/simulations/#{simulation}/valuedResources/#{valued_resource}" + end), + "location:organization:simluation:valued_resource" => (proc do |organization:, location:, simluation:, valued_resource:| + raise ::ArgumentError, "organization cannot contain /" if organization.to_s.include? "/" + raise ::ArgumentError, "location cannot contain /" if location.to_s.include? "/" + raise ::ArgumentError, "simluation cannot contain /" if simluation.to_s.include? "/" + + "organizations/#{organization}/locations/#{location}/simulations/#{simluation}/valuedResources/#{valued_resource}" + 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 +end diff --git a/owl-bot-staging/google-cloud-security_center-v2/lib/google/cloud/security_center/v2/security_center/rest.rb b/owl-bot-staging/google-cloud-security_center-v2/lib/google/cloud/security_center/v2/security_center/rest.rb new file mode 100644 index 000000000000..f11c34c53b84 --- /dev/null +++ b/owl-bot-staging/google-cloud-security_center-v2/lib/google/cloud/security_center/v2/security_center/rest.rb @@ -0,0 +1,53 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +require "gapic/rest" +require "gapic/config" +require "gapic/config/method" + +require "google/cloud/security_center/v2/version" + +require "google/cloud/security_center/v2/security_center/credentials" +require "google/cloud/security_center/v2/security_center/paths" +require "google/cloud/security_center/v2/security_center/rest/operations" +require "google/cloud/security_center/v2/security_center/rest/client" + +module Google + module Cloud + module SecurityCenter + module V2 + ## + # V2 APIs for Security Center service. + # + # To load this service and instantiate a REST client: + # + # require "google/cloud/security_center/v2/security_center/rest" + # client = ::Google::Cloud::SecurityCenter::V2::SecurityCenter::Rest::Client.new + # + module SecurityCenter + # Client for the REST transport + module Rest + end + end + end + end + end +end + +helper_path = ::File.join __dir__, "rest", "helpers.rb" +require "google/cloud/security_center/v2/security_center/rest/helpers" if ::File.file? helper_path diff --git a/owl-bot-staging/google-cloud-security_center-v2/lib/google/cloud/security_center/v2/security_center/rest/client.rb b/owl-bot-staging/google-cloud-security_center-v2/lib/google/cloud/security_center/v2/security_center/rest/client.rb new file mode 100644 index 000000000000..061e60497651 --- /dev/null +++ b/owl-bot-staging/google-cloud-security_center-v2/lib/google/cloud/security_center/v2/security_center/rest/client.rb @@ -0,0 +1,4393 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +require "google/cloud/errors" +require "google/cloud/securitycenter/v2/securitycenter_service_pb" +require "google/cloud/security_center/v2/security_center/rest/service_stub" + +module Google + module Cloud + module SecurityCenter + module V2 + module SecurityCenter + module Rest + ## + # REST client for the SecurityCenter service. + # + # V2 APIs for Security Center service. + # + class Client + # @private + API_VERSION = "" + + # @private + DEFAULT_ENDPOINT_TEMPLATE = "securitycenter.$UNIVERSE_DOMAIN$" + + include Paths + + # @private + attr_reader :security_center_stub + + ## + # Configure the SecurityCenter Client class. + # + # See {::Google::Cloud::SecurityCenter::V2::SecurityCenter::Rest::Client::Configuration} + # for a description of the configuration fields. + # + # @example + # + # # Modify the configuration for all SecurityCenter clients + # ::Google::Cloud::SecurityCenter::V2::SecurityCenter::Rest::Client.configure do |config| + # config.timeout = 10.0 + # end + # + # @yield [config] Configure the Client client. + # @yieldparam config [Client::Configuration] + # + # @return [Client::Configuration] + # + def self.configure + @configure ||= begin + namespace = ["Google", "Cloud", "SecurityCenter", "V2"] + parent_config = while namespace.any? + parent_name = namespace.join "::" + parent_const = const_get parent_name + break parent_const.configure if parent_const.respond_to? :configure + namespace.pop + end + default_config = Client::Configuration.new parent_config + + default_config + end + yield @configure if block_given? + @configure + end + + ## + # Configure the SecurityCenter Client instance. + # + # The configuration is set to the derived mode, meaning that values can be changed, + # but structural changes (adding new fields, etc.) are not allowed. Structural changes + # should be made on {Client.configure}. + # + # See {::Google::Cloud::SecurityCenter::V2::SecurityCenter::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 + @security_center_stub.universe_domain + end + + ## + # Create a new SecurityCenter REST client object. + # + # @example + # + # # Create a client using the default configuration + # client = ::Google::Cloud::SecurityCenter::V2::SecurityCenter::Rest::Client.new + # + # # Create a client using a custom configuration + # client = ::Google::Cloud::SecurityCenter::V2::SecurityCenter::Rest::Client.new do |config| + # config.timeout = 10.0 + # end + # + # @yield [config] Configure the SecurityCenter client. + # @yieldparam config [Client::Configuration] + # + def initialize + # Create the configuration object + @config = Configuration.new Client.configure + + # Yield the configuration if needed + yield @config if block_given? + + # Create credentials + credentials = @config.credentials + # Use self-signed JWT if the endpoint is unchanged from default, + # but only if the default endpoint does not have a region prefix. + enable_self_signed_jwt = @config.endpoint.nil? || + (@config.endpoint == Configuration::DEFAULT_ENDPOINT && + !@config.endpoint.split(".").first.include?("-")) + credentials ||= Credentials.default scope: @config.scope, + enable_self_signed_jwt: enable_self_signed_jwt + if credentials.is_a?(::String) || credentials.is_a?(::Hash) + credentials = Credentials.new credentials, scope: @config.scope + end + + @quota_project_id = @config.quota_project + @quota_project_id ||= credentials.quota_project_id if credentials.respond_to? :quota_project_id + + @operations_client = ::Google::Cloud::SecurityCenter::V2::SecurityCenter::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 + + @security_center_stub = ::Google::Cloud::SecurityCenter::V2::SecurityCenter::Rest::ServiceStub.new( + endpoint: @config.endpoint, + endpoint_template: DEFAULT_ENDPOINT_TEMPLATE, + universe_domain: @config.universe_domain, + credentials: credentials, + logger: @config.logger + ) + + @security_center_stub.logger(stub: true)&.info do |entry| + entry.set_system_name + entry.set_service + entry.message = "Created client for #{entry.service}" + entry.set_credentials_fields credentials + entry.set "customEndpoint", @config.endpoint if @config.endpoint + entry.set "defaultTimeout", @config.timeout if @config.timeout + entry.set "quotaProject", @quota_project_id if @quota_project_id + end + end + + ## + # Get the associated client for long-running operations. + # + # @return [::Google::Cloud::SecurityCenter::V2::SecurityCenter::Rest::Operations] + # + attr_reader :operations_client + + ## + # The logger used for request/response debug logging. + # + # @return [Logger] + # + def logger + @security_center_stub.logger + end + + # Service calls + + ## + # Creates a ResourceValueConfig for an organization. Maps user's tags to + # difference resource values for use by the attack path simulation. + # + # @overload batch_create_resource_value_configs(request, options = nil) + # Pass arguments to `batch_create_resource_value_configs` via a request object, either of type + # {::Google::Cloud::SecurityCenter::V2::BatchCreateResourceValueConfigsRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::SecurityCenter::V2::BatchCreateResourceValueConfigsRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @overload batch_create_resource_value_configs(parent: nil, requests: nil) + # Pass arguments to `batch_create_resource_value_configs` via keyword arguments. Note that at + # least one keyword argument is 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. Resource name of the new ResourceValueConfig's parent. + # The parent field in the CreateResourceValueConfigRequest + # messages must either be empty or match this field. + # @param requests [::Array<::Google::Cloud::SecurityCenter::V2::CreateResourceValueConfigRequest, ::Hash>] + # Required. The resource value configs to be created. + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Cloud::SecurityCenter::V2::BatchCreateResourceValueConfigsResponse] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::SecurityCenter::V2::BatchCreateResourceValueConfigsResponse] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/security_center/v2" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::SecurityCenter::V2::SecurityCenter::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::SecurityCenter::V2::BatchCreateResourceValueConfigsRequest.new + # + # # Call the batch_create_resource_value_configs method. + # result = client.batch_create_resource_value_configs request + # + # # The returned object is of type Google::Cloud::SecurityCenter::V2::BatchCreateResourceValueConfigsResponse. + # p result + # + def batch_create_resource_value_configs request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::SecurityCenter::V2::BatchCreateResourceValueConfigsRequest + + # Converts hash 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.batch_create_resource_value_configs.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::SecurityCenter::V2::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + options.apply_defaults timeout: @config.rpcs.batch_create_resource_value_configs.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.batch_create_resource_value_configs.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @security_center_stub.batch_create_resource_value_configs 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 + + ## + # Kicks off an LRO to bulk mute findings for a parent based on a filter. If + # no location is specified, findings are muted in global. The parent + # can be either an organization, folder, or project. The findings matched by + # the filter will be muted after the LRO is done. + # + # @overload bulk_mute_findings(request, options = nil) + # Pass arguments to `bulk_mute_findings` via a request object, either of type + # {::Google::Cloud::SecurityCenter::V2::BulkMuteFindingsRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::SecurityCenter::V2::BulkMuteFindingsRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @overload bulk_mute_findings(parent: nil, filter: nil, mute_state: nil) + # Pass arguments to `bulk_mute_findings` via keyword arguments. Note that at + # least one keyword argument is 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, at which bulk action needs to be applied. If no + # location is specified, findings are updated in global. The following list + # shows some examples: + # + # + `organizations/[organization_id]` + # + `organizations/[organization_id]/locations/[location_id]` + # + `folders/[folder_id]` + # + `folders/[folder_id]/locations/[location_id]` + # + `projects/[project_id]` + # + `projects/[project_id]/locations/[location_id]` + # @param filter [::String] + # Expression that identifies findings that should be updated. + # The expression is a list of zero or more restrictions combined + # via logical operators `AND` and `OR`. Parentheses are supported, and `OR` + # has higher precedence than `AND`. + # + # Restrictions have the form ` ` and may have a + # `-` character in front of them to indicate negation. The fields map to + # those defined in the corresponding resource. + # + # The supported operators are: + # + # * `=` for all value types. + # * `>`, `<`, `>=`, `<=` for integer values. + # * `:`, meaning substring matching, for strings. + # + # The supported value types are: + # + # * string literals in quotes. + # * integer literals without quotes. + # * boolean literals `true` and `false` without quotes. + # @param mute_state [::Google::Cloud::SecurityCenter::V2::BulkMuteFindingsRequest::MuteState] + # Optional. All findings matching the given filter will have their mute state + # set to this value. The default value is `MUTED`. Setting this to + # `UNDEFINED` will clear the mute state on all matching findings. + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Gapic::Operation] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Gapic::Operation] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/security_center/v2" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::SecurityCenter::V2::SecurityCenter::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::SecurityCenter::V2::BulkMuteFindingsRequest.new + # + # # Call the bulk_mute_findings method. + # result = client.bulk_mute_findings 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 bulk_mute_findings request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::SecurityCenter::V2::BulkMuteFindingsRequest + + # Converts hash 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.bulk_mute_findings.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::SecurityCenter::V2::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + options.apply_defaults timeout: @config.rpcs.bulk_mute_findings.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.bulk_mute_findings.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @security_center_stub.bulk_mute_findings 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 + + ## + # Creates a BigQuery export. + # + # @overload create_big_query_export(request, options = nil) + # Pass arguments to `create_big_query_export` via a request object, either of type + # {::Google::Cloud::SecurityCenter::V2::CreateBigQueryExportRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::SecurityCenter::V2::CreateBigQueryExportRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_big_query_export(parent: nil, big_query_export: nil, big_query_export_id: nil) + # Pass arguments to `create_big_query_export` via keyword arguments. Note that at + # least one keyword argument is 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 name of the parent resource of the new BigQuery export. Its + # format is `organizations/[organization_id]/locations/[location_id]`, + # `folders/[folder_id]/locations/[location_id]`, or + # `projects/[project_id]/locations/[location_id]`. + # @param big_query_export [::Google::Cloud::SecurityCenter::V2::BigQueryExport, ::Hash] + # Required. The BigQuery export being created. + # @param big_query_export_id [::String] + # Required. Unique identifier provided by the client within the parent scope. + # It must consist of only lowercase letters, numbers, and hyphens, must start + # with a letter, must end with either a letter or a number, and must be 63 + # characters or less. + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Cloud::SecurityCenter::V2::BigQueryExport] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::SecurityCenter::V2::BigQueryExport] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/security_center/v2" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::SecurityCenter::V2::SecurityCenter::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::SecurityCenter::V2::CreateBigQueryExportRequest.new + # + # # Call the create_big_query_export method. + # result = client.create_big_query_export request + # + # # The returned object is of type Google::Cloud::SecurityCenter::V2::BigQueryExport. + # p result + # + def create_big_query_export request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::SecurityCenter::V2::CreateBigQueryExportRequest + + # Converts hash 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_big_query_export.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::SecurityCenter::V2::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + options.apply_defaults timeout: @config.rpcs.create_big_query_export.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.create_big_query_export.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @security_center_stub.create_big_query_export request, options do |result, operation| + yield result, operation if block_given? + end + rescue ::Gapic::Rest::Error => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Creates a finding in a location. The corresponding source must exist for + # finding creation to succeed. + # + # @overload create_finding(request, options = nil) + # Pass arguments to `create_finding` via a request object, either of type + # {::Google::Cloud::SecurityCenter::V2::CreateFindingRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::SecurityCenter::V2::CreateFindingRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_finding(parent: nil, finding_id: nil, finding: nil) + # Pass arguments to `create_finding` via keyword arguments. Note that at + # least one keyword argument is 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. Resource name of the new finding's parent. The following list + # shows some examples of the format: + # + + # `organizations/[organization_id]/sources/[source_id]` + # + + # `organizations/[organization_id]/sources/[source_id]/locations/[location_id]` + # @param finding_id [::String] + # Required. Unique identifier provided by the client within the parent scope. + # It must be alphanumeric and less than or equal to 32 characters and + # greater than 0 characters in length. + # @param finding [::Google::Cloud::SecurityCenter::V2::Finding, ::Hash] + # Required. The Finding being created. The name and security_marks will be + # ignored as they are both output only fields on this resource. + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Cloud::SecurityCenter::V2::Finding] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::SecurityCenter::V2::Finding] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/security_center/v2" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::SecurityCenter::V2::SecurityCenter::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::SecurityCenter::V2::CreateFindingRequest.new + # + # # Call the create_finding method. + # result = client.create_finding request + # + # # The returned object is of type Google::Cloud::SecurityCenter::V2::Finding. + # p result + # + def create_finding request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::SecurityCenter::V2::CreateFindingRequest + + # Converts hash 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_finding.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::SecurityCenter::V2::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + options.apply_defaults timeout: @config.rpcs.create_finding.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.create_finding.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @security_center_stub.create_finding request, options do |result, operation| + yield result, operation if block_given? + end + rescue ::Gapic::Rest::Error => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Creates a mute config. + # + # @overload create_mute_config(request, options = nil) + # Pass arguments to `create_mute_config` via a request object, either of type + # {::Google::Cloud::SecurityCenter::V2::CreateMuteConfigRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::SecurityCenter::V2::CreateMuteConfigRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_mute_config(parent: nil, mute_config: nil, mute_config_id: nil) + # Pass arguments to `create_mute_config` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param parent [::String] + # Required. Resource name of the new mute configs's parent. Its format is + # `organizations/[organization_id]/locations/[location_id]`, + # `folders/[folder_id]/locations/[location_id]`, or + # `projects/[project_id]/locations/[location_id]`. + # @param mute_config [::Google::Cloud::SecurityCenter::V2::MuteConfig, ::Hash] + # Required. The mute config being created. + # @param mute_config_id [::String] + # Required. Unique identifier provided by the client within the parent scope. + # It must consist of only lowercase letters, numbers, and hyphens, must start + # with a letter, must end with either a letter or a number, and must be 63 + # characters or less. + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Cloud::SecurityCenter::V2::MuteConfig] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::SecurityCenter::V2::MuteConfig] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/security_center/v2" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::SecurityCenter::V2::SecurityCenter::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::SecurityCenter::V2::CreateMuteConfigRequest.new + # + # # Call the create_mute_config method. + # result = client.create_mute_config request + # + # # The returned object is of type Google::Cloud::SecurityCenter::V2::MuteConfig. + # p result + # + def create_mute_config request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::SecurityCenter::V2::CreateMuteConfigRequest + + # Converts hash 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_mute_config.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::SecurityCenter::V2::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + options.apply_defaults timeout: @config.rpcs.create_mute_config.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.create_mute_config.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @security_center_stub.create_mute_config request, options do |result, operation| + yield result, operation if block_given? + end + rescue ::Gapic::Rest::Error => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Creates a notification config. + # + # @overload create_notification_config(request, options = nil) + # Pass arguments to `create_notification_config` via a request object, either of type + # {::Google::Cloud::SecurityCenter::V2::CreateNotificationConfigRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::SecurityCenter::V2::CreateNotificationConfigRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_notification_config(parent: nil, config_id: nil, notification_config: nil) + # Pass arguments to `create_notification_config` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param parent [::String] + # Required. Resource name of the new notification config's parent. Its format + # is `organizations/[organization_id]/locations/[location_id]`, + # `folders/[folder_id]/locations/[location_id]`, or + # `projects/[project_id]/locations/[location_id]`. + # @param config_id [::String] + # Required. + # Unique identifier provided by the client within the parent scope. + # It must be between 1 and 128 characters and contain alphanumeric + # characters, underscores, or hyphens only. + # @param notification_config [::Google::Cloud::SecurityCenter::V2::NotificationConfig, ::Hash] + # Required. The notification config being created. The name and the service + # account will be ignored as they are both output only fields on this + # resource. + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Cloud::SecurityCenter::V2::NotificationConfig] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::SecurityCenter::V2::NotificationConfig] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/security_center/v2" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::SecurityCenter::V2::SecurityCenter::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::SecurityCenter::V2::CreateNotificationConfigRequest.new + # + # # Call the create_notification_config method. + # result = client.create_notification_config request + # + # # The returned object is of type Google::Cloud::SecurityCenter::V2::NotificationConfig. + # p result + # + def create_notification_config request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::SecurityCenter::V2::CreateNotificationConfigRequest + + # Converts hash 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_notification_config.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::SecurityCenter::V2::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + options.apply_defaults timeout: @config.rpcs.create_notification_config.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.create_notification_config.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @security_center_stub.create_notification_config request, options do |result, operation| + yield result, operation if block_given? + end + rescue ::Gapic::Rest::Error => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Creates a source. + # + # @overload create_source(request, options = nil) + # Pass arguments to `create_source` via a request object, either of type + # {::Google::Cloud::SecurityCenter::V2::CreateSourceRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::SecurityCenter::V2::CreateSourceRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_source(parent: nil, source: nil) + # Pass arguments to `create_source` via keyword arguments. Note that at + # least one keyword argument is 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. Resource name of the new source's parent. Its format should be + # `organizations/[organization_id]`. + # @param source [::Google::Cloud::SecurityCenter::V2::Source, ::Hash] + # Required. The Source being created, only the display_name and description + # will be used. All other fields will be ignored. + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Cloud::SecurityCenter::V2::Source] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::SecurityCenter::V2::Source] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/security_center/v2" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::SecurityCenter::V2::SecurityCenter::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::SecurityCenter::V2::CreateSourceRequest.new + # + # # Call the create_source method. + # result = client.create_source request + # + # # The returned object is of type Google::Cloud::SecurityCenter::V2::Source. + # p result + # + def create_source request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::SecurityCenter::V2::CreateSourceRequest + + # Converts hash 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_source.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::SecurityCenter::V2::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + options.apply_defaults timeout: @config.rpcs.create_source.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.create_source.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @security_center_stub.create_source request, options do |result, operation| + yield result, operation if block_given? + end + rescue ::Gapic::Rest::Error => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Deletes an existing BigQuery export. + # + # @overload delete_big_query_export(request, options = nil) + # Pass arguments to `delete_big_query_export` via a request object, either of type + # {::Google::Cloud::SecurityCenter::V2::DeleteBigQueryExportRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::SecurityCenter::V2::DeleteBigQueryExportRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_big_query_export(name: nil) + # Pass arguments to `delete_big_query_export` via keyword arguments. Note that at + # least one keyword argument is 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 BigQuery export to delete. The following list + # shows some examples of the format: + # + # + + # `organizations/{organization}/locations/{location}/bigQueryExports/{export_id}` + # + `folders/{folder}/locations/{location}/bigQueryExports/{export_id}` + # + `projects/{project}/locations/{location}/bigQueryExports/{export_id}` + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Protobuf::Empty] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Protobuf::Empty] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/security_center/v2" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::SecurityCenter::V2::SecurityCenter::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::SecurityCenter::V2::DeleteBigQueryExportRequest.new + # + # # Call the delete_big_query_export method. + # result = client.delete_big_query_export request + # + # # The returned object is of type Google::Protobuf::Empty. + # p result + # + def delete_big_query_export request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::SecurityCenter::V2::DeleteBigQueryExportRequest + + # Converts hash 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_big_query_export.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::SecurityCenter::V2::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + options.apply_defaults timeout: @config.rpcs.delete_big_query_export.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.delete_big_query_export.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @security_center_stub.delete_big_query_export request, options do |result, operation| + yield result, operation if block_given? + end + rescue ::Gapic::Rest::Error => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Deletes an existing mute config. If no location is specified, default is + # global. + # + # @overload delete_mute_config(request, options = nil) + # Pass arguments to `delete_mute_config` via a request object, either of type + # {::Google::Cloud::SecurityCenter::V2::DeleteMuteConfigRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::SecurityCenter::V2::DeleteMuteConfigRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_mute_config(name: nil) + # Pass arguments to `delete_mute_config` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param name [::String] + # Required. Name of the mute config to delete. The following list shows some + # examples of the format: + # + # + `organizations/{organization}/muteConfigs/{config_id}` + # + + # `organizations/{organization}/locations/{location}/muteConfigs/{config_id}` + # + `folders/{folder}/muteConfigs/{config_id}` + # + `folders/{folder}/locations/{location}/muteConfigs/{config_id}` + # + `projects/{project}/muteConfigs/{config_id}` + # + `projects/{project}/locations/{location}/muteConfigs/{config_id}` + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Protobuf::Empty] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Protobuf::Empty] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/security_center/v2" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::SecurityCenter::V2::SecurityCenter::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::SecurityCenter::V2::DeleteMuteConfigRequest.new + # + # # Call the delete_mute_config method. + # result = client.delete_mute_config request + # + # # The returned object is of type Google::Protobuf::Empty. + # p result + # + def delete_mute_config request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::SecurityCenter::V2::DeleteMuteConfigRequest + + # Converts hash 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_mute_config.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::SecurityCenter::V2::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + options.apply_defaults timeout: @config.rpcs.delete_mute_config.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.delete_mute_config.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @security_center_stub.delete_mute_config request, options do |result, operation| + yield result, operation if block_given? + end + rescue ::Gapic::Rest::Error => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Deletes a notification config. + # + # @overload delete_notification_config(request, options = nil) + # Pass arguments to `delete_notification_config` via a request object, either of type + # {::Google::Cloud::SecurityCenter::V2::DeleteNotificationConfigRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::SecurityCenter::V2::DeleteNotificationConfigRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_notification_config(name: nil) + # Pass arguments to `delete_notification_config` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param name [::String] + # Required. Name of the notification config to delete. The following list + # shows some examples of the format: + # + # + + # `organizations/[organization_id]/locations/[location_id]/notificationConfigs/[config_id]` + # + + # `folders/[folder_id]/locations/[location_id]notificationConfigs/[config_id]` + # + + # `projects/[project_id]/locations/[location_id]notificationConfigs/[config_id]` + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Protobuf::Empty] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Protobuf::Empty] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/security_center/v2" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::SecurityCenter::V2::SecurityCenter::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::SecurityCenter::V2::DeleteNotificationConfigRequest.new + # + # # Call the delete_notification_config method. + # result = client.delete_notification_config request + # + # # The returned object is of type Google::Protobuf::Empty. + # p result + # + def delete_notification_config request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::SecurityCenter::V2::DeleteNotificationConfigRequest + + # Converts hash 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_notification_config.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::SecurityCenter::V2::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + options.apply_defaults timeout: @config.rpcs.delete_notification_config.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.delete_notification_config.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @security_center_stub.delete_notification_config request, options do |result, operation| + yield result, operation if block_given? + end + rescue ::Gapic::Rest::Error => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Deletes a ResourceValueConfig. + # + # @overload delete_resource_value_config(request, options = nil) + # Pass arguments to `delete_resource_value_config` via a request object, either of type + # {::Google::Cloud::SecurityCenter::V2::DeleteResourceValueConfigRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::SecurityCenter::V2::DeleteResourceValueConfigRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_resource_value_config(name: nil) + # Pass arguments to `delete_resource_value_config` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param name [::String] + # Required. Name of the ResourceValueConfig to delete + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Protobuf::Empty] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Protobuf::Empty] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/security_center/v2" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::SecurityCenter::V2::SecurityCenter::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::SecurityCenter::V2::DeleteResourceValueConfigRequest.new + # + # # Call the delete_resource_value_config method. + # result = client.delete_resource_value_config request + # + # # The returned object is of type Google::Protobuf::Empty. + # p result + # + def delete_resource_value_config request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::SecurityCenter::V2::DeleteResourceValueConfigRequest + + # Converts hash 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_resource_value_config.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::SecurityCenter::V2::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + options.apply_defaults timeout: @config.rpcs.delete_resource_value_config.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.delete_resource_value_config.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @security_center_stub.delete_resource_value_config request, options do |result, operation| + yield result, operation if block_given? + end + rescue ::Gapic::Rest::Error => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Gets a BigQuery export. + # + # @overload get_big_query_export(request, options = nil) + # Pass arguments to `get_big_query_export` via a request object, either of type + # {::Google::Cloud::SecurityCenter::V2::GetBigQueryExportRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::SecurityCenter::V2::GetBigQueryExportRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_big_query_export(name: nil) + # Pass arguments to `get_big_query_export` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param name [::String] + # Required. Name of the BigQuery export to retrieve. The following list shows + # some examples of the format: + # + # + + # `organizations/{organization}/locations/{location}/bigQueryExports/{export_id}` + # + `folders/{folder}/locations/{location}/bigQueryExports/{export_id}` + # + `projects/{project}locations/{location}//bigQueryExports/{export_id}` + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Cloud::SecurityCenter::V2::BigQueryExport] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::SecurityCenter::V2::BigQueryExport] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/security_center/v2" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::SecurityCenter::V2::SecurityCenter::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::SecurityCenter::V2::GetBigQueryExportRequest.new + # + # # Call the get_big_query_export method. + # result = client.get_big_query_export request + # + # # The returned object is of type Google::Cloud::SecurityCenter::V2::BigQueryExport. + # p result + # + def get_big_query_export request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::SecurityCenter::V2::GetBigQueryExportRequest + + # Converts hash 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_big_query_export.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::SecurityCenter::V2::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + options.apply_defaults timeout: @config.rpcs.get_big_query_export.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.get_big_query_export.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @security_center_stub.get_big_query_export 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 + + ## + # Get the simulation by name or the latest simulation for the given + # organization. + # + # @overload get_simulation(request, options = nil) + # Pass arguments to `get_simulation` via a request object, either of type + # {::Google::Cloud::SecurityCenter::V2::GetSimulationRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::SecurityCenter::V2::GetSimulationRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_simulation(name: nil) + # Pass arguments to `get_simulation` via keyword arguments. Note that at + # least one keyword argument is 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 organization name or simulation name of this simulation + # + # Valid format: + # `organizations/{organization}/simulations/latest` + # `organizations/{organization}/simulations/{simulation}` + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Cloud::SecurityCenter::V2::Simulation] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::SecurityCenter::V2::Simulation] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/security_center/v2" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::SecurityCenter::V2::SecurityCenter::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::SecurityCenter::V2::GetSimulationRequest.new + # + # # Call the get_simulation method. + # result = client.get_simulation request + # + # # The returned object is of type Google::Cloud::SecurityCenter::V2::Simulation. + # p result + # + def get_simulation request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::SecurityCenter::V2::GetSimulationRequest + + # Converts hash 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_simulation.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::SecurityCenter::V2::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + options.apply_defaults timeout: @config.rpcs.get_simulation.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.get_simulation.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @security_center_stub.get_simulation 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 + + ## + # Get the valued resource by name + # + # @overload get_valued_resource(request, options = nil) + # Pass arguments to `get_valued_resource` via a request object, either of type + # {::Google::Cloud::SecurityCenter::V2::GetValuedResourceRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::SecurityCenter::V2::GetValuedResourceRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_valued_resource(name: nil) + # Pass arguments to `get_valued_resource` via keyword arguments. Note that at + # least one keyword argument is 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 this valued resource + # + # Valid format: + # `organizations/{organization}/simulations/{simulation}/valuedResources/{valued_resource}` + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Cloud::SecurityCenter::V2::ValuedResource] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::SecurityCenter::V2::ValuedResource] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/security_center/v2" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::SecurityCenter::V2::SecurityCenter::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::SecurityCenter::V2::GetValuedResourceRequest.new + # + # # Call the get_valued_resource method. + # result = client.get_valued_resource request + # + # # The returned object is of type Google::Cloud::SecurityCenter::V2::ValuedResource. + # p result + # + def get_valued_resource request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::SecurityCenter::V2::GetValuedResourceRequest + + # Converts hash 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_valued_resource.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::SecurityCenter::V2::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + options.apply_defaults timeout: @config.rpcs.get_valued_resource.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.get_valued_resource.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @security_center_stub.get_valued_resource request, options do |result, operation| + yield result, operation if block_given? + end + rescue ::Gapic::Rest::Error => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Gets the access control policy on the specified Source. + # + # @overload get_iam_policy(request, options = nil) + # Pass arguments to `get_iam_policy` via a request object, either of type + # {::Google::Iam::V1::GetIamPolicyRequest} or an equivalent Hash. + # + # @param request [::Google::Iam::V1::GetIamPolicyRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @overload get_iam_policy(resource: nil, options: nil) + # Pass arguments to `get_iam_policy` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param resource [::String] + # REQUIRED: The resource for which the policy is being requested. + # See the operation documentation for the appropriate value for this field. + # @param options [::Google::Iam::V1::GetPolicyOptions, ::Hash] + # OPTIONAL: A `GetPolicyOptions` object for specifying options to + # `GetIamPolicy`. + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Iam::V1::Policy] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Iam::V1::Policy] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/security_center/v2" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::SecurityCenter::V2::SecurityCenter::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Iam::V1::GetIamPolicyRequest.new + # + # # Call the get_iam_policy method. + # result = client.get_iam_policy request + # + # # The returned object is of type Google::Iam::V1::Policy. + # p result + # + def get_iam_policy request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Iam::V1::GetIamPolicyRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + call_metadata = @config.rpcs.get_iam_policy.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::SecurityCenter::V2::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + options.apply_defaults timeout: @config.rpcs.get_iam_policy.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.get_iam_policy.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @security_center_stub.get_iam_policy request, options do |result, operation| + yield result, operation if block_given? + end + rescue ::Gapic::Rest::Error => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Gets a mute config. If no location is specified, default is + # global. + # + # @overload get_mute_config(request, options = nil) + # Pass arguments to `get_mute_config` via a request object, either of type + # {::Google::Cloud::SecurityCenter::V2::GetMuteConfigRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::SecurityCenter::V2::GetMuteConfigRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_mute_config(name: nil) + # Pass arguments to `get_mute_config` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param name [::String] + # Required. Name of the mute config to retrieve. The following list shows + # some examples of the format: + # + # + `organizations/{organization}/muteConfigs/{config_id}` + # + + # `organizations/{organization}/locations/{location}/muteConfigs/{config_id}` + # + `folders/{folder}/muteConfigs/{config_id}` + # + `folders/{folder}/locations/{location}/muteConfigs/{config_id}` + # + `projects/{project}/muteConfigs/{config_id}` + # + `projects/{project}/locations/{location}/muteConfigs/{config_id}` + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Cloud::SecurityCenter::V2::MuteConfig] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::SecurityCenter::V2::MuteConfig] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/security_center/v2" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::SecurityCenter::V2::SecurityCenter::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::SecurityCenter::V2::GetMuteConfigRequest.new + # + # # Call the get_mute_config method. + # result = client.get_mute_config request + # + # # The returned object is of type Google::Cloud::SecurityCenter::V2::MuteConfig. + # p result + # + def get_mute_config request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::SecurityCenter::V2::GetMuteConfigRequest + + # Converts hash 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_mute_config.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::SecurityCenter::V2::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + options.apply_defaults timeout: @config.rpcs.get_mute_config.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.get_mute_config.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @security_center_stub.get_mute_config request, options do |result, operation| + yield result, operation if block_given? + end + rescue ::Gapic::Rest::Error => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Gets a notification config. + # + # @overload get_notification_config(request, options = nil) + # Pass arguments to `get_notification_config` via a request object, either of type + # {::Google::Cloud::SecurityCenter::V2::GetNotificationConfigRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::SecurityCenter::V2::GetNotificationConfigRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_notification_config(name: nil) + # Pass arguments to `get_notification_config` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param name [::String] + # Required. Name of the notification config to get. The following list shows + # some examples of the format: + # + # + + # `organizations/[organization_id]/locations/[location_id]/notificationConfigs/[config_id]` + # + + # `folders/[folder_id]/locations/[location_id]/notificationConfigs/[config_id]` + # + + # `projects/[project_id]/locations/[location_id]/notificationConfigs/[config_id]` + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Cloud::SecurityCenter::V2::NotificationConfig] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::SecurityCenter::V2::NotificationConfig] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/security_center/v2" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::SecurityCenter::V2::SecurityCenter::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::SecurityCenter::V2::GetNotificationConfigRequest.new + # + # # Call the get_notification_config method. + # result = client.get_notification_config request + # + # # The returned object is of type Google::Cloud::SecurityCenter::V2::NotificationConfig. + # p result + # + def get_notification_config request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::SecurityCenter::V2::GetNotificationConfigRequest + + # Converts hash 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_notification_config.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::SecurityCenter::V2::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + options.apply_defaults timeout: @config.rpcs.get_notification_config.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.get_notification_config.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @security_center_stub.get_notification_config request, options do |result, operation| + yield result, operation if block_given? + end + rescue ::Gapic::Rest::Error => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Gets a ResourceValueConfig. + # + # @overload get_resource_value_config(request, options = nil) + # Pass arguments to `get_resource_value_config` via a request object, either of type + # {::Google::Cloud::SecurityCenter::V2::GetResourceValueConfigRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::SecurityCenter::V2::GetResourceValueConfigRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_resource_value_config(name: nil) + # Pass arguments to `get_resource_value_config` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param name [::String] + # Required. Name of the resource value config to retrieve. Its format is + # organizations/\\{organization}/resourceValueConfigs/\\{config_id}. + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Cloud::SecurityCenter::V2::ResourceValueConfig] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::SecurityCenter::V2::ResourceValueConfig] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/security_center/v2" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::SecurityCenter::V2::SecurityCenter::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::SecurityCenter::V2::GetResourceValueConfigRequest.new + # + # # Call the get_resource_value_config method. + # result = client.get_resource_value_config request + # + # # The returned object is of type Google::Cloud::SecurityCenter::V2::ResourceValueConfig. + # p result + # + def get_resource_value_config request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::SecurityCenter::V2::GetResourceValueConfigRequest + + # Converts hash 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_resource_value_config.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::SecurityCenter::V2::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + options.apply_defaults timeout: @config.rpcs.get_resource_value_config.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.get_resource_value_config.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @security_center_stub.get_resource_value_config request, options do |result, operation| + yield result, operation if block_given? + end + rescue ::Gapic::Rest::Error => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Gets a source. + # + # @overload get_source(request, options = nil) + # Pass arguments to `get_source` via a request object, either of type + # {::Google::Cloud::SecurityCenter::V2::GetSourceRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::SecurityCenter::V2::GetSourceRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_source(name: nil) + # Pass arguments to `get_source` via keyword arguments. Note that at + # least one keyword argument is 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. Relative resource name of the source. Its format is + # `organizations/[organization_id]/source/[source_id]`. + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Cloud::SecurityCenter::V2::Source] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::SecurityCenter::V2::Source] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/security_center/v2" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::SecurityCenter::V2::SecurityCenter::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::SecurityCenter::V2::GetSourceRequest.new + # + # # Call the get_source method. + # result = client.get_source request + # + # # The returned object is of type Google::Cloud::SecurityCenter::V2::Source. + # p result + # + def get_source request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::SecurityCenter::V2::GetSourceRequest + + # Converts hash 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_source.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::SecurityCenter::V2::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + options.apply_defaults timeout: @config.rpcs.get_source.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.get_source.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @security_center_stub.get_source 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 + + ## + # Filters an organization or source's findings and groups them by their + # specified properties in a location. If no location is specified, findings + # are assumed to be in global + # + # To group across all sources provide a `-` as the source id. + # The following list shows some examples: + # + # + `/v2/organizations/{organization_id}/sources/-/findings` + # + + # `/v2/organizations/{organization_id}/sources/-/locations/{location_id}/findings` + # + `/v2/folders/{folder_id}/sources/-/findings` + # + `/v2/folders/{folder_id}/sources/-/locations/{location_id}/findings` + # + `/v2/projects/{project_id}/sources/-/findings` + # + `/v2/projects/{project_id}/sources/-/locations/{location_id}/findings` + # + # @overload group_findings(request, options = nil) + # Pass arguments to `group_findings` via a request object, either of type + # {::Google::Cloud::SecurityCenter::V2::GroupFindingsRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::SecurityCenter::V2::GroupFindingsRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @overload group_findings(parent: nil, filter: nil, group_by: nil, page_token: nil, page_size: nil) + # Pass arguments to `group_findings` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param parent [::String] + # Required. Name of the source to groupBy. If no location is specified, + # finding is assumed to be in global. + # The following list shows some examples: + # + # + `organizations/[organization_id]/sources/[source_id]` + # + + # `organizations/[organization_id]/sources/[source_id]/locations/[location_id]` + # + `folders/[folder_id]/sources/[source_id]` + # + `folders/[folder_id]/sources/[source_id]/locations/[location_id]` + # + `projects/[project_id]/sources/[source_id]` + # + `projects/[project_id]/sources/[source_id]/locations/[location_id]` + # + # To groupBy across all sources provide a source_id of `-`. The following + # list shows some examples: + # + # + `organizations/{organization_id}/sources/-` + # + `organizations/{organization_id}/sources/-/locations/[location_id]` + # + `folders/{folder_id}/sources/-` + # + `folders/{folder_id}/sources/-/locations/[location_id]` + # + `projects/{project_id}/sources/-` + # + `projects/{project_id}/sources/-/locations/[location_id]` + # @param filter [::String] + # Expression that defines the filter to apply across findings. + # The expression is a list of one or more restrictions combined via logical + # operators `AND` and `OR`. + # Parentheses are supported, and `OR` has higher precedence than `AND`. + # + # Restrictions have the form ` ` and may have a `-` + # character in front of them to indicate negation. Examples include: + # + # * name + # * security_marks.marks.marka + # + # The supported operators are: + # + # * `=` for all value types. + # * `>`, `<`, `>=`, `<=` for integer values. + # * `:`, meaning substring matching, for strings. + # + # The supported value types are: + # + # * string literals in quotes. + # * integer literals without quotes. + # * boolean literals `true` and `false` without quotes. + # + # The following field and operator combinations are supported: + # + # * name: `=` + # * parent: `=`, `:` + # * resource_name: `=`, `:` + # * state: `=`, `:` + # * category: `=`, `:` + # * external_uri: `=`, `:` + # * event_time: `=`, `>`, `<`, `>=`, `<=` + # + # Usage: This should be milliseconds since epoch or an RFC3339 string. + # Examples: + # `event_time = "2019-06-10T16:07:18-07:00"` + # `event_time = 1560208038000` + # + # * severity: `=`, `:` + # * security_marks.marks: `=`, `:` + # * resource: + # * resource.name: `=`, `:` + # * resource.parent_name: `=`, `:` + # * resource.parent_display_name: `=`, `:` + # * resource.project_name: `=`, `:` + # * resource.project_display_name: `=`, `:` + # * resource.type: `=`, `:` + # @param group_by [::String] + # Required. Expression that defines what assets fields to use for grouping. + # The string value should follow SQL syntax: comma separated list of fields. + # For example: "parent,resource_name". + # @param page_token [::String] + # The value returned by the last `GroupFindingsResponse`; indicates + # that this is a continuation of a prior `GroupFindings` call, and + # that the system should return the next page of data. + # @param page_size [::Integer] + # The maximum number of results to return in a single response. Default is + # 10, minimum is 1, maximum is 1000. + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Gapic::Rest::PagedEnumerable<::Google::Cloud::SecurityCenter::V2::GroupResult>] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Gapic::Rest::PagedEnumerable<::Google::Cloud::SecurityCenter::V2::GroupResult>] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/security_center/v2" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::SecurityCenter::V2::SecurityCenter::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::SecurityCenter::V2::GroupFindingsRequest.new + # + # # Call the group_findings method. + # result = client.group_findings request + # + # # The returned object is of type Gapic::PagedEnumerable. You can iterate + # # over elements, and API calls will be issued to fetch pages as needed. + # result.each do |item| + # # Each element is of type ::Google::Cloud::SecurityCenter::V2::GroupResult. + # p item + # end + # + def group_findings request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::SecurityCenter::V2::GroupFindingsRequest + + # Converts hash 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.group_findings.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::SecurityCenter::V2::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + options.apply_defaults timeout: @config.rpcs.group_findings.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.group_findings.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @security_center_stub.group_findings request, options do |result, operation| + result = ::Gapic::Rest::PagedEnumerable.new @security_center_stub, :group_findings, "group_by_results", 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 + + ## + # Lists the attack paths for a set of simulation results or valued resources + # and filter. + # + # @overload list_attack_paths(request, options = nil) + # Pass arguments to `list_attack_paths` via a request object, either of type + # {::Google::Cloud::SecurityCenter::V2::ListAttackPathsRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::SecurityCenter::V2::ListAttackPathsRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_attack_paths(parent: nil, filter: nil, page_token: nil, page_size: nil) + # Pass arguments to `list_attack_paths` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param parent [::String] + # Required. Name of parent to list attack paths. + # + # Valid formats: + # `organizations/{organization}`, + # `organizations/{organization}/simulations/{simulation}` + # `organizations/{organization}/simulations/{simulation}/attackExposureResults/{attack_exposure_result_v2}` + # `organizations/{organization}/simulations/{simulation}/valuedResources/{valued_resource}` + # @param filter [::String] + # The filter expression that filters the attack path in the response. + # Supported fields: + # + # * `valued_resources` supports = + # @param page_token [::String] + # The value returned by the last `ListAttackPathsResponse`; indicates + # that this is a continuation of a prior `ListAttackPaths` call, and + # that the system should return the next page of data. + # @param page_size [::Integer] + # The maximum number of results to return in a single response. Default is + # 10, minimum is 1, maximum is 1000. + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Gapic::Rest::PagedEnumerable<::Google::Cloud::SecurityCenter::V2::AttackPath>] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Gapic::Rest::PagedEnumerable<::Google::Cloud::SecurityCenter::V2::AttackPath>] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/security_center/v2" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::SecurityCenter::V2::SecurityCenter::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::SecurityCenter::V2::ListAttackPathsRequest.new + # + # # Call the list_attack_paths method. + # result = client.list_attack_paths request + # + # # The returned object is of type Gapic::PagedEnumerable. You can iterate + # # over elements, and API calls will be issued to fetch pages as needed. + # result.each do |item| + # # Each element is of type ::Google::Cloud::SecurityCenter::V2::AttackPath. + # p item + # end + # + def list_attack_paths request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::SecurityCenter::V2::ListAttackPathsRequest + + # Converts hash 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_attack_paths.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::SecurityCenter::V2::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + options.apply_defaults timeout: @config.rpcs.list_attack_paths.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.list_attack_paths.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @security_center_stub.list_attack_paths request, options do |result, operation| + result = ::Gapic::Rest::PagedEnumerable.new @security_center_stub, :list_attack_paths, "attack_paths", 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 + + ## + # Lists BigQuery exports. Note that when requesting BigQuery exports at a + # given level all exports under that level are also returned e.g. if + # requesting BigQuery exports under a folder, then all BigQuery exports + # immediately under the folder plus the ones created under the projects + # within the folder are returned. + # + # @overload list_big_query_exports(request, options = nil) + # Pass arguments to `list_big_query_exports` via a request object, either of type + # {::Google::Cloud::SecurityCenter::V2::ListBigQueryExportsRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::SecurityCenter::V2::ListBigQueryExportsRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_big_query_exports(parent: nil, page_size: nil, page_token: nil) + # Pass arguments to `list_big_query_exports` via keyword arguments. Note that at + # least one keyword argument is 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, which owns the collection of BigQuery exports. Its + # format is `organizations/[organization_id]/locations/[location_id]`, + # `folders/[folder_id]/locations/[location_id]`, or + # `projects/[project_id]/locations/[location_id]`. + # @param page_size [::Integer] + # The maximum number of configs to return. The service may return fewer than + # this value. + # If unspecified, at most 10 configs will be returned. + # The maximum value is 1000; values above 1000 will be coerced to 1000. + # @param page_token [::String] + # A page token, received from a previous `ListBigQueryExports` call. + # Provide this to retrieve the subsequent page. + # When paginating, all other parameters provided to `ListBigQueryExports` + # 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::Cloud::SecurityCenter::V2::BigQueryExport>] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Gapic::Rest::PagedEnumerable<::Google::Cloud::SecurityCenter::V2::BigQueryExport>] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/security_center/v2" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::SecurityCenter::V2::SecurityCenter::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::SecurityCenter::V2::ListBigQueryExportsRequest.new + # + # # Call the list_big_query_exports method. + # result = client.list_big_query_exports request + # + # # The returned object is of type Gapic::PagedEnumerable. You can iterate + # # over elements, and API calls will be issued to fetch pages as needed. + # result.each do |item| + # # Each element is of type ::Google::Cloud::SecurityCenter::V2::BigQueryExport. + # p item + # end + # + def list_big_query_exports request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::SecurityCenter::V2::ListBigQueryExportsRequest + + # Converts hash 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_big_query_exports.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::SecurityCenter::V2::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + options.apply_defaults timeout: @config.rpcs.list_big_query_exports.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.list_big_query_exports.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @security_center_stub.list_big_query_exports request, options do |result, operation| + result = ::Gapic::Rest::PagedEnumerable.new @security_center_stub, :list_big_query_exports, "big_query_exports", 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 + + ## + # Lists an organization or source's findings. + # + # To list across all sources for a given location provide a `-` as the source + # id. If no location is specified, finding are assumed to be in global. + # The following list shows some examples: + # + # + `/v2/organizations/{organization_id}/sources/-/findings` + # + + # `/v2/organizations/{organization_id}/sources/-/locations/{location_id}/findings` + # + # @overload list_findings(request, options = nil) + # Pass arguments to `list_findings` via a request object, either of type + # {::Google::Cloud::SecurityCenter::V2::ListFindingsRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::SecurityCenter::V2::ListFindingsRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_findings(parent: nil, filter: nil, order_by: nil, field_mask: nil, page_token: nil, page_size: nil) + # Pass arguments to `list_findings` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param parent [::String] + # Required. Name of the source the findings belong to. If no location is + # specified, the default is global. The following list shows some examples: + # + # + `organizations/[organization_id]/sources/[source_id]` + # + + # `organizations/[organization_id]/sources/[source_id]/locations/[location_id]` + # + `folders/[folder_id]/sources/[source_id]` + # + `folders/[folder_id]/sources/[source_id]/locations/[location_id]` + # + `projects/[project_id]/sources/[source_id]` + # + `projects/[project_id]/sources/[source_id]/locations/[location_id]` + # + # To list across all sources provide a source_id of `-`. The following + # list shows some examples: + # + # + `organizations/{organization_id}/sources/-` + # + `organizations/{organization_id}/sources/-/locations/{location_id}` + # + `folders/{folder_id}/sources/-` + # + `folders/{folder_id}/sources/-locations/{location_id}` + # + `projects/{projects_id}/sources/-` + # + `projects/{projects_id}/sources/-/locations/{location_id}` + # @param filter [::String] + # Expression that defines the filter to apply across findings. + # The expression is a list of one or more restrictions combined via logical + # operators `AND` and `OR`. + # Parentheses are supported, and `OR` has higher precedence than `AND`. + # + # Restrictions have the form ` ` and may have a `-` + # character in front of them to indicate negation. Examples include: + # + # * name + # * security_marks.marks.marka + # + # The supported operators are: + # + # * `=` for all value types. + # * `>`, `<`, `>=`, `<=` for integer values. + # * `:`, meaning substring matching, for strings. + # + # The supported value types are: + # + # * string literals in quotes. + # * integer literals without quotes. + # * boolean literals `true` and `false` without quotes. + # + # The following field and operator combinations are supported: + # + # * name: `=` + # * parent: `=`, `:` + # * resource_name: `=`, `:` + # * state: `=`, `:` + # * category: `=`, `:` + # * external_uri: `=`, `:` + # * event_time: `=`, `>`, `<`, `>=`, `<=` + # + # Usage: This should be milliseconds since epoch or an RFC3339 string. + # Examples: + # `event_time = "2019-06-10T16:07:18-07:00"` + # `event_time = 1560208038000` + # + # * severity: `=`, `:` + # * security_marks.marks: `=`, `:` + # * resource: + # * resource.name: `=`, `:` + # * resource.parent_name: `=`, `:` + # * resource.parent_display_name: `=`, `:` + # * resource.project_name: `=`, `:` + # * resource.project_display_name: `=`, `:` + # * resource.type: `=`, `:` + # * resource.folders.resource_folder: `=`, `:` + # * resource.display_name: `=`, `:` + # @param order_by [::String] + # Expression that defines what fields and order to use for sorting. The + # string value should follow SQL syntax: comma separated list of fields. For + # example: "name,parent". The default sorting order + # is ascending. To specify descending order for a field, a suffix " desc" + # should be appended to the field name. For example: "name + # desc,parent". Redundant space characters in the + # syntax are insignificant. "name desc,parent" and " + # name desc , parent " are equivalent. + # + # The following fields are supported: + # name + # parent + # state + # category + # resource_name + # event_time + # security_marks.marks + # @param field_mask [::Google::Protobuf::FieldMask, ::Hash] + # A field mask to specify the Finding fields to be listed in the response. + # An empty field mask will list all fields. + # @param page_token [::String] + # The value returned by the last `ListFindingsResponse`; indicates + # that this is a continuation of a prior `ListFindings` call, and + # that the system should return the next page of data. + # @param page_size [::Integer] + # The maximum number of results to return in a single response. Default is + # 10, minimum is 1, maximum is 1000. + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Gapic::Rest::PagedEnumerable<::Google::Cloud::SecurityCenter::V2::ListFindingsResponse::ListFindingsResult>] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Gapic::Rest::PagedEnumerable<::Google::Cloud::SecurityCenter::V2::ListFindingsResponse::ListFindingsResult>] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/security_center/v2" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::SecurityCenter::V2::SecurityCenter::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::SecurityCenter::V2::ListFindingsRequest.new + # + # # Call the list_findings method. + # result = client.list_findings request + # + # # The returned object is of type Gapic::PagedEnumerable. You can iterate + # # over elements, and API calls will be issued to fetch pages as needed. + # result.each do |item| + # # Each element is of type ::Google::Cloud::SecurityCenter::V2::ListFindingsResponse::ListFindingsResult. + # p item + # end + # + def list_findings request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::SecurityCenter::V2::ListFindingsRequest + + # Converts hash 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_findings.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::SecurityCenter::V2::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + options.apply_defaults timeout: @config.rpcs.list_findings.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.list_findings.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @security_center_stub.list_findings request, options do |result, operation| + result = ::Gapic::Rest::PagedEnumerable.new @security_center_stub, :list_findings, "list_findings_results", 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 + + ## + # Lists mute configs. If no location is specified, default is + # global. + # + # @overload list_mute_configs(request, options = nil) + # Pass arguments to `list_mute_configs` via a request object, either of type + # {::Google::Cloud::SecurityCenter::V2::ListMuteConfigsRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::SecurityCenter::V2::ListMuteConfigsRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_mute_configs(parent: nil, page_size: nil, page_token: nil) + # Pass arguments to `list_mute_configs` via keyword arguments. Note that at + # least one keyword argument is 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, which owns the collection of mute configs. Its format + # is `organizations/[organization_id]", "folders/[folder_id]`, + # `projects/[project_id]`, + # `organizations/[organization_id]/locations/[location_id]`, + # `folders/[folder_id]/locations/[location_id]`, + # `projects/[project_id]/locations/[location_id]`. + # @param page_size [::Integer] + # The maximum number of configs to return. The service may return fewer than + # this value. + # If unspecified, at most 10 configs will be returned. + # The maximum value is 1000; values above 1000 will be coerced to 1000. + # @param page_token [::String] + # A page token, received from a previous `ListMuteConfigs` call. + # Provide this to retrieve the subsequent page. + # + # When paginating, all other parameters provided to `ListMuteConfigs` 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::Cloud::SecurityCenter::V2::MuteConfig>] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Gapic::Rest::PagedEnumerable<::Google::Cloud::SecurityCenter::V2::MuteConfig>] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/security_center/v2" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::SecurityCenter::V2::SecurityCenter::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::SecurityCenter::V2::ListMuteConfigsRequest.new + # + # # Call the list_mute_configs method. + # result = client.list_mute_configs request + # + # # The returned object is of type Gapic::PagedEnumerable. You can iterate + # # over elements, and API calls will be issued to fetch pages as needed. + # result.each do |item| + # # Each element is of type ::Google::Cloud::SecurityCenter::V2::MuteConfig. + # p item + # end + # + def list_mute_configs request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::SecurityCenter::V2::ListMuteConfigsRequest + + # Converts hash 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_mute_configs.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::SecurityCenter::V2::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + options.apply_defaults timeout: @config.rpcs.list_mute_configs.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.list_mute_configs.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @security_center_stub.list_mute_configs request, options do |result, operation| + result = ::Gapic::Rest::PagedEnumerable.new @security_center_stub, :list_mute_configs, "mute_configs", 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 + + ## + # Lists notification configs. + # + # @overload list_notification_configs(request, options = nil) + # Pass arguments to `list_notification_configs` via a request object, either of type + # {::Google::Cloud::SecurityCenter::V2::ListNotificationConfigsRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::SecurityCenter::V2::ListNotificationConfigsRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_notification_configs(parent: nil, page_token: nil, page_size: nil) + # Pass arguments to `list_notification_configs` via keyword arguments. Note that at + # least one keyword argument is 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 name of the parent in which to list the notification + # configurations. Its format is + # "organizations/[organization_id]/locations/[location_id]", + # "folders/[folder_id]/locations/[location_id]", or + # "projects/[project_id]/locations/[location_id]". + # @param page_token [::String] + # The value returned by the last `ListNotificationConfigsResponse`; indicates + # that this is a continuation of a prior `ListNotificationConfigs` call, and + # that the system should return the next page of data. + # @param page_size [::Integer] + # The maximum number of results to return in a single response. Default is + # 10, minimum is 1, maximum is 1000. + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Gapic::Rest::PagedEnumerable<::Google::Cloud::SecurityCenter::V2::NotificationConfig>] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Gapic::Rest::PagedEnumerable<::Google::Cloud::SecurityCenter::V2::NotificationConfig>] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/security_center/v2" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::SecurityCenter::V2::SecurityCenter::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::SecurityCenter::V2::ListNotificationConfigsRequest.new + # + # # Call the list_notification_configs method. + # result = client.list_notification_configs request + # + # # The returned object is of type Gapic::PagedEnumerable. You can iterate + # # over elements, and API calls will be issued to fetch pages as needed. + # result.each do |item| + # # Each element is of type ::Google::Cloud::SecurityCenter::V2::NotificationConfig. + # p item + # end + # + def list_notification_configs request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::SecurityCenter::V2::ListNotificationConfigsRequest + + # Converts hash 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_notification_configs.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::SecurityCenter::V2::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + options.apply_defaults timeout: @config.rpcs.list_notification_configs.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.list_notification_configs.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @security_center_stub.list_notification_configs request, options do |result, operation| + result = ::Gapic::Rest::PagedEnumerable.new @security_center_stub, :list_notification_configs, "notification_configs", 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 + + ## + # Lists all ResourceValueConfigs. + # + # @overload list_resource_value_configs(request, options = nil) + # Pass arguments to `list_resource_value_configs` via a request object, either of type + # {::Google::Cloud::SecurityCenter::V2::ListResourceValueConfigsRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::SecurityCenter::V2::ListResourceValueConfigsRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_resource_value_configs(parent: nil, page_size: nil, page_token: nil) + # Pass arguments to `list_resource_value_configs` via keyword arguments. Note that at + # least one keyword argument is 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, which owns the collection of resource value configs. + # Its format is + # `organizations/[organization_id]` + # @param page_size [::Integer] + # The maximum number of configs to return. The service may return fewer than + # this value. + # If unspecified, at most 10 configs will be returned. + # The maximum value is 1000; values above 1000 will be coerced to 1000. + # @param page_token [::String] + # A page token, received from a previous `ListResourceValueConfigs` call. + # Provide this to retrieve the subsequent page. + # + # When paginating, all other parameters provided to + # `ListResourceValueConfigs` must match the call that provided the + # page token. + # + # page_size can be specified, and the new page_size will be used. + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Gapic::Rest::PagedEnumerable<::Google::Cloud::SecurityCenter::V2::ResourceValueConfig>] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Gapic::Rest::PagedEnumerable<::Google::Cloud::SecurityCenter::V2::ResourceValueConfig>] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/security_center/v2" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::SecurityCenter::V2::SecurityCenter::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::SecurityCenter::V2::ListResourceValueConfigsRequest.new + # + # # Call the list_resource_value_configs method. + # result = client.list_resource_value_configs request + # + # # The returned object is of type Gapic::PagedEnumerable. You can iterate + # # over elements, and API calls will be issued to fetch pages as needed. + # result.each do |item| + # # Each element is of type ::Google::Cloud::SecurityCenter::V2::ResourceValueConfig. + # p item + # end + # + def list_resource_value_configs request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::SecurityCenter::V2::ListResourceValueConfigsRequest + + # Converts hash 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_resource_value_configs.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::SecurityCenter::V2::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + options.apply_defaults timeout: @config.rpcs.list_resource_value_configs.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.list_resource_value_configs.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @security_center_stub.list_resource_value_configs request, options do |result, operation| + result = ::Gapic::Rest::PagedEnumerable.new @security_center_stub, :list_resource_value_configs, "resource_value_configs", 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 + + ## + # Lists all sources belonging to an organization. + # + # @overload list_sources(request, options = nil) + # Pass arguments to `list_sources` via a request object, either of type + # {::Google::Cloud::SecurityCenter::V2::ListSourcesRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::SecurityCenter::V2::ListSourcesRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_sources(parent: nil, page_token: nil, page_size: nil) + # Pass arguments to `list_sources` via keyword arguments. Note that at + # least one keyword argument is 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. Resource name of the parent of sources to list. Its format should + # be `organizations/[organization_id]`, `folders/[folder_id]`, or + # `projects/[project_id]`. + # @param page_token [::String] + # The value returned by the last `ListSourcesResponse`; indicates + # that this is a continuation of a prior `ListSources` call, and + # that the system should return the next page of data. + # @param page_size [::Integer] + # The maximum number of results to return in a single response. Default is + # 10, minimum is 1, maximum is 1000. + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Gapic::Rest::PagedEnumerable<::Google::Cloud::SecurityCenter::V2::Source>] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Gapic::Rest::PagedEnumerable<::Google::Cloud::SecurityCenter::V2::Source>] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/security_center/v2" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::SecurityCenter::V2::SecurityCenter::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::SecurityCenter::V2::ListSourcesRequest.new + # + # # Call the list_sources method. + # result = client.list_sources request + # + # # The returned object is of type Gapic::PagedEnumerable. You can iterate + # # over elements, and API calls will be issued to fetch pages as needed. + # result.each do |item| + # # Each element is of type ::Google::Cloud::SecurityCenter::V2::Source. + # p item + # end + # + def list_sources request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::SecurityCenter::V2::ListSourcesRequest + + # Converts hash 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_sources.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::SecurityCenter::V2::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + options.apply_defaults timeout: @config.rpcs.list_sources.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.list_sources.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @security_center_stub.list_sources request, options do |result, operation| + result = ::Gapic::Rest::PagedEnumerable.new @security_center_stub, :list_sources, "sources", 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 + + ## + # Lists the valued resources for a set of simulation results and filter. + # + # @overload list_valued_resources(request, options = nil) + # Pass arguments to `list_valued_resources` via a request object, either of type + # {::Google::Cloud::SecurityCenter::V2::ListValuedResourcesRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::SecurityCenter::V2::ListValuedResourcesRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_valued_resources(parent: nil, filter: nil, page_token: nil, page_size: nil, order_by: nil) + # Pass arguments to `list_valued_resources` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param parent [::String] + # Required. Name of parent to list exposed resources. + # + # Valid formats: + # `organizations/{organization}`, + # `organizations/{organization}/simulations/{simulation}` + # `organizations/{organization}/simulations/{simulation}/attackExposureResults/{attack_exposure_result_v2}` + # @param filter [::String] + # The filter expression that filters the valued resources in the response. + # Supported fields: + # + # * `resource_value` supports = + # * `resource_type` supports = + # @param page_token [::String] + # The value returned by the last `ListValuedResourcesResponse`; indicates + # that this is a continuation of a prior `ListValuedResources` call, and + # that the system should return the next page of data. + # @param page_size [::Integer] + # The maximum number of results to return in a single response. Default is + # 10, minimum is 1, maximum is 1000. + # @param order_by [::String] + # Optional. The fields by which to order the valued resources response. + # + # Supported fields: + # + # * `exposed_score` + # + # * `resource_value` + # + # * `resource_type` + # + # Values should be a comma separated list of fields. For example: + # `exposed_score,resource_value`. + # + # The default sorting order is descending. To specify ascending or descending + # order for a field, append a " ASC" or a " DESC" suffix, respectively; for + # example: `exposed_score DESC`. + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Gapic::Rest::PagedEnumerable<::Google::Cloud::SecurityCenter::V2::ValuedResource>] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Gapic::Rest::PagedEnumerable<::Google::Cloud::SecurityCenter::V2::ValuedResource>] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/security_center/v2" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::SecurityCenter::V2::SecurityCenter::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::SecurityCenter::V2::ListValuedResourcesRequest.new + # + # # Call the list_valued_resources method. + # result = client.list_valued_resources request + # + # # The returned object is of type Gapic::PagedEnumerable. You can iterate + # # over elements, and API calls will be issued to fetch pages as needed. + # result.each do |item| + # # Each element is of type ::Google::Cloud::SecurityCenter::V2::ValuedResource. + # p item + # end + # + def list_valued_resources request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::SecurityCenter::V2::ListValuedResourcesRequest + + # Converts hash 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_valued_resources.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::SecurityCenter::V2::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + options.apply_defaults timeout: @config.rpcs.list_valued_resources.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.list_valued_resources.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @security_center_stub.list_valued_resources request, options do |result, operation| + result = ::Gapic::Rest::PagedEnumerable.new @security_center_stub, :list_valued_resources, "valued_resources", 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 + + ## + # Updates the state of a finding. If no location is specified, finding is + # assumed to be in global + # + # @overload set_finding_state(request, options = nil) + # Pass arguments to `set_finding_state` via a request object, either of type + # {::Google::Cloud::SecurityCenter::V2::SetFindingStateRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::SecurityCenter::V2::SetFindingStateRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @overload set_finding_state(name: nil, state: nil) + # Pass arguments to `set_finding_state` via keyword arguments. Note that at + # least one keyword argument is 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 [relative resource + # name](https://cloud.google.com/apis/design/resource_names#relative_resource_name) + # of the finding. If no location is specified, finding is assumed to be in + # global. The following list shows some examples: + # + # + + # `organizations/{organization_id}/sources/{source_id}/findings/{finding_id}` + # + + # `organizations/{organization_id}/sources/{source_id}/locations/{location_id}/findings/{finding_id}` + # + `folders/{folder_id}/sources/{source_id}/findings/{finding_id}` + # + + # `folders/{folder_id}/sources/{source_id}/locations/{location_id}/findings/{finding_id}` + # + `projects/{project_id}/sources/{source_id}/findings/{finding_id}` + # + + # `projects/{project_id}/sources/{source_id}/locations/{location_id}/findings/{finding_id}` + # @param state [::Google::Cloud::SecurityCenter::V2::Finding::State] + # Required. The desired State of the finding. + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Cloud::SecurityCenter::V2::Finding] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::SecurityCenter::V2::Finding] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/security_center/v2" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::SecurityCenter::V2::SecurityCenter::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::SecurityCenter::V2::SetFindingStateRequest.new + # + # # Call the set_finding_state method. + # result = client.set_finding_state request + # + # # The returned object is of type Google::Cloud::SecurityCenter::V2::Finding. + # p result + # + def set_finding_state request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::SecurityCenter::V2::SetFindingStateRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + call_metadata = @config.rpcs.set_finding_state.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::SecurityCenter::V2::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + options.apply_defaults timeout: @config.rpcs.set_finding_state.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.set_finding_state.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @security_center_stub.set_finding_state request, options do |result, operation| + yield result, operation if block_given? + end + rescue ::Gapic::Rest::Error => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Sets the access control policy on the specified Source. + # + # @overload set_iam_policy(request, options = nil) + # Pass arguments to `set_iam_policy` via a request object, either of type + # {::Google::Iam::V1::SetIamPolicyRequest} or an equivalent Hash. + # + # @param request [::Google::Iam::V1::SetIamPolicyRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @overload set_iam_policy(resource: nil, policy: nil, update_mask: nil) + # Pass arguments to `set_iam_policy` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param resource [::String] + # REQUIRED: The resource for which the policy is being specified. + # See the operation documentation for the appropriate value for this field. + # @param policy [::Google::Iam::V1::Policy, ::Hash] + # REQUIRED: The complete policy to be applied to the `resource`. The size of + # the policy is limited to a few 10s of KB. An empty policy is a + # valid policy but certain Cloud Platform services (such as Projects) + # might reject them. + # @param update_mask [::Google::Protobuf::FieldMask, ::Hash] + # OPTIONAL: A FieldMask specifying which fields of the policy to modify. Only + # the fields in the mask will be modified. If no mask is provided, the + # following default mask is used: + # + # `paths: "bindings, etag"` + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Iam::V1::Policy] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Iam::V1::Policy] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/security_center/v2" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::SecurityCenter::V2::SecurityCenter::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Iam::V1::SetIamPolicyRequest.new + # + # # Call the set_iam_policy method. + # result = client.set_iam_policy request + # + # # The returned object is of type Google::Iam::V1::Policy. + # p result + # + def set_iam_policy request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Iam::V1::SetIamPolicyRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + call_metadata = @config.rpcs.set_iam_policy.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::SecurityCenter::V2::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + options.apply_defaults timeout: @config.rpcs.set_iam_policy.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.set_iam_policy.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @security_center_stub.set_iam_policy request, options do |result, operation| + yield result, operation if block_given? + end + rescue ::Gapic::Rest::Error => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Updates the mute state of a finding. If no location is specified, finding + # is assumed to be in global + # + # @overload set_mute(request, options = nil) + # Pass arguments to `set_mute` via a request object, either of type + # {::Google::Cloud::SecurityCenter::V2::SetMuteRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::SecurityCenter::V2::SetMuteRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @overload set_mute(name: nil, mute: nil) + # Pass arguments to `set_mute` via keyword arguments. Note that at + # least one keyword argument is 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 [relative resource + # name](https://cloud.google.com/apis/design/resource_names#relative_resource_name) + # of the finding. If no location is specified, finding is assumed to be in + # global. The following list shows some examples: + # + # + + # `organizations/{organization_id}/sources/{source_id}/findings/{finding_id}` + # + + # `organizations/{organization_id}/sources/{source_id}/locations/{location_id}/findings/{finding_id}` + # + `folders/{folder_id}/sources/{source_id}/findings/{finding_id}` + # + + # `folders/{folder_id}/sources/{source_id}/locations/{location_id}/findings/{finding_id}` + # + `projects/{project_id}/sources/{source_id}/findings/{finding_id}` + # + + # `projects/{project_id}/sources/{source_id}/locations/{location_id}/findings/{finding_id}` + # @param mute [::Google::Cloud::SecurityCenter::V2::Finding::Mute] + # Required. The desired state of the Mute. + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Cloud::SecurityCenter::V2::Finding] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::SecurityCenter::V2::Finding] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/security_center/v2" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::SecurityCenter::V2::SecurityCenter::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::SecurityCenter::V2::SetMuteRequest.new + # + # # Call the set_mute method. + # result = client.set_mute request + # + # # The returned object is of type Google::Cloud::SecurityCenter::V2::Finding. + # p result + # + def set_mute request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::SecurityCenter::V2::SetMuteRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + call_metadata = @config.rpcs.set_mute.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::SecurityCenter::V2::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + options.apply_defaults timeout: @config.rpcs.set_mute.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.set_mute.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @security_center_stub.set_mute request, options do |result, operation| + yield result, operation if block_given? + end + rescue ::Gapic::Rest::Error => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Returns the permissions that a caller has on the specified source. + # + # @overload test_iam_permissions(request, options = nil) + # Pass arguments to `test_iam_permissions` via a request object, either of type + # {::Google::Iam::V1::TestIamPermissionsRequest} or an equivalent Hash. + # + # @param request [::Google::Iam::V1::TestIamPermissionsRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @overload test_iam_permissions(resource: nil, permissions: nil) + # Pass arguments to `test_iam_permissions` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param resource [::String] + # REQUIRED: The resource for which the policy detail is being requested. + # See the operation documentation for the appropriate value for this field. + # @param permissions [::Array<::String>] + # The set of permissions to check for the `resource`. Permissions with + # wildcards (such as '*' or 'storage.*') are not allowed. For more + # information see + # [IAM Overview](https://cloud.google.com/iam/docs/overview#permissions). + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Iam::V1::TestIamPermissionsResponse] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Iam::V1::TestIamPermissionsResponse] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/security_center/v2" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::SecurityCenter::V2::SecurityCenter::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Iam::V1::TestIamPermissionsRequest.new + # + # # Call the test_iam_permissions method. + # result = client.test_iam_permissions request + # + # # The returned object is of type Google::Iam::V1::TestIamPermissionsResponse. + # p result + # + def test_iam_permissions request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Iam::V1::TestIamPermissionsRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + call_metadata = @config.rpcs.test_iam_permissions.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::SecurityCenter::V2::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + options.apply_defaults timeout: @config.rpcs.test_iam_permissions.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.test_iam_permissions.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @security_center_stub.test_iam_permissions request, options do |result, operation| + yield result, operation if block_given? + end + rescue ::Gapic::Rest::Error => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Updates a BigQuery export. + # + # @overload update_big_query_export(request, options = nil) + # Pass arguments to `update_big_query_export` via a request object, either of type + # {::Google::Cloud::SecurityCenter::V2::UpdateBigQueryExportRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::SecurityCenter::V2::UpdateBigQueryExportRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_big_query_export(big_query_export: nil, update_mask: nil) + # Pass arguments to `update_big_query_export` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param big_query_export [::Google::Cloud::SecurityCenter::V2::BigQueryExport, ::Hash] + # Required. The BigQuery export being updated. + # @param update_mask [::Google::Protobuf::FieldMask, ::Hash] + # The list of fields to be updated. + # If empty all mutable fields will be updated. + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Cloud::SecurityCenter::V2::BigQueryExport] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::SecurityCenter::V2::BigQueryExport] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/security_center/v2" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::SecurityCenter::V2::SecurityCenter::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::SecurityCenter::V2::UpdateBigQueryExportRequest.new + # + # # Call the update_big_query_export method. + # result = client.update_big_query_export request + # + # # The returned object is of type Google::Cloud::SecurityCenter::V2::BigQueryExport. + # p result + # + def update_big_query_export request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::SecurityCenter::V2::UpdateBigQueryExportRequest + + # Converts hash 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_big_query_export.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::SecurityCenter::V2::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + options.apply_defaults timeout: @config.rpcs.update_big_query_export.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.update_big_query_export.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @security_center_stub.update_big_query_export 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 external system. This is for a given finding. If no location is + # specified, finding is assumed to be in global + # + # @overload update_external_system(request, options = nil) + # Pass arguments to `update_external_system` via a request object, either of type + # {::Google::Cloud::SecurityCenter::V2::UpdateExternalSystemRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::SecurityCenter::V2::UpdateExternalSystemRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_external_system(external_system: nil, update_mask: nil) + # Pass arguments to `update_external_system` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param external_system [::Google::Cloud::SecurityCenter::V2::ExternalSystem, ::Hash] + # Required. The external system resource to update. + # @param update_mask [::Google::Protobuf::FieldMask, ::Hash] + # The FieldMask to use when updating the external system resource. + # + # If empty all mutable fields will be updated. + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Cloud::SecurityCenter::V2::ExternalSystem] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::SecurityCenter::V2::ExternalSystem] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/security_center/v2" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::SecurityCenter::V2::SecurityCenter::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::SecurityCenter::V2::UpdateExternalSystemRequest.new + # + # # Call the update_external_system method. + # result = client.update_external_system request + # + # # The returned object is of type Google::Cloud::SecurityCenter::V2::ExternalSystem. + # p result + # + def update_external_system request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::SecurityCenter::V2::UpdateExternalSystemRequest + + # Converts hash 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_external_system.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::SecurityCenter::V2::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + options.apply_defaults timeout: @config.rpcs.update_external_system.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.update_external_system.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @security_center_stub.update_external_system request, options do |result, operation| + yield result, operation if block_given? + end + rescue ::Gapic::Rest::Error => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Creates or updates a finding. If no location is specified, finding is + # assumed to be in global. The corresponding source must exist for a finding + # creation to succeed. + # + # @overload update_finding(request, options = nil) + # Pass arguments to `update_finding` via a request object, either of type + # {::Google::Cloud::SecurityCenter::V2::UpdateFindingRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::SecurityCenter::V2::UpdateFindingRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_finding(finding: nil, update_mask: nil) + # Pass arguments to `update_finding` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param finding [::Google::Cloud::SecurityCenter::V2::Finding, ::Hash] + # Required. The finding resource to update or create if it does not already + # exist. parent, security_marks, and update_time will be ignored. + # + # In the case of creation, the finding id portion of the name must be + # alphanumeric and less than or equal to 32 characters and greater than 0 + # characters in length. + # @param update_mask [::Google::Protobuf::FieldMask, ::Hash] + # The FieldMask to use when updating the finding resource. This field should + # not be specified when creating a finding. + # + # When updating a finding, an empty mask is treated as updating all mutable + # fields and replacing source_properties. Individual source_properties can + # be added/updated by using "source_properties." in the field + # mask. + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Cloud::SecurityCenter::V2::Finding] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::SecurityCenter::V2::Finding] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/security_center/v2" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::SecurityCenter::V2::SecurityCenter::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::SecurityCenter::V2::UpdateFindingRequest.new + # + # # Call the update_finding method. + # result = client.update_finding request + # + # # The returned object is of type Google::Cloud::SecurityCenter::V2::Finding. + # p result + # + def update_finding request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::SecurityCenter::V2::UpdateFindingRequest + + # Converts hash 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_finding.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::SecurityCenter::V2::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + options.apply_defaults timeout: @config.rpcs.update_finding.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.update_finding.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @security_center_stub.update_finding 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 mute config. If no location is specified, default is + # global. + # + # @overload update_mute_config(request, options = nil) + # Pass arguments to `update_mute_config` via a request object, either of type + # {::Google::Cloud::SecurityCenter::V2::UpdateMuteConfigRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::SecurityCenter::V2::UpdateMuteConfigRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_mute_config(mute_config: nil, update_mask: nil) + # Pass arguments to `update_mute_config` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param mute_config [::Google::Cloud::SecurityCenter::V2::MuteConfig, ::Hash] + # Required. The mute config being updated. + # @param update_mask [::Google::Protobuf::FieldMask, ::Hash] + # The list of fields to be updated. + # If empty all mutable fields will be updated. + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Cloud::SecurityCenter::V2::MuteConfig] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::SecurityCenter::V2::MuteConfig] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/security_center/v2" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::SecurityCenter::V2::SecurityCenter::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::SecurityCenter::V2::UpdateMuteConfigRequest.new + # + # # Call the update_mute_config method. + # result = client.update_mute_config request + # + # # The returned object is of type Google::Cloud::SecurityCenter::V2::MuteConfig. + # p result + # + def update_mute_config request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::SecurityCenter::V2::UpdateMuteConfigRequest + + # Converts hash 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_mute_config.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::SecurityCenter::V2::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + options.apply_defaults timeout: @config.rpcs.update_mute_config.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.update_mute_config.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @security_center_stub.update_mute_config request, options do |result, operation| + yield result, operation if block_given? + end + rescue ::Gapic::Rest::Error => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Updates a notification config. The following update + # fields are allowed: description, pubsub_topic, streaming_config.filter + # + # @overload update_notification_config(request, options = nil) + # Pass arguments to `update_notification_config` via a request object, either of type + # {::Google::Cloud::SecurityCenter::V2::UpdateNotificationConfigRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::SecurityCenter::V2::UpdateNotificationConfigRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_notification_config(notification_config: nil, update_mask: nil) + # Pass arguments to `update_notification_config` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param notification_config [::Google::Cloud::SecurityCenter::V2::NotificationConfig, ::Hash] + # Required. The notification config to update. + # @param update_mask [::Google::Protobuf::FieldMask, ::Hash] + # The FieldMask to use when updating the notification config. + # + # If empty all mutable fields will be updated. + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Cloud::SecurityCenter::V2::NotificationConfig] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::SecurityCenter::V2::NotificationConfig] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/security_center/v2" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::SecurityCenter::V2::SecurityCenter::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::SecurityCenter::V2::UpdateNotificationConfigRequest.new + # + # # Call the update_notification_config method. + # result = client.update_notification_config request + # + # # The returned object is of type Google::Cloud::SecurityCenter::V2::NotificationConfig. + # p result + # + def update_notification_config request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::SecurityCenter::V2::UpdateNotificationConfigRequest + + # Converts hash 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_notification_config.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::SecurityCenter::V2::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + options.apply_defaults timeout: @config.rpcs.update_notification_config.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.update_notification_config.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @security_center_stub.update_notification_config request, options do |result, operation| + yield result, operation if block_given? + end + rescue ::Gapic::Rest::Error => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Updates an existing ResourceValueConfigs with new rules. + # + # @overload update_resource_value_config(request, options = nil) + # Pass arguments to `update_resource_value_config` via a request object, either of type + # {::Google::Cloud::SecurityCenter::V2::UpdateResourceValueConfigRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::SecurityCenter::V2::UpdateResourceValueConfigRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_resource_value_config(resource_value_config: nil, update_mask: nil) + # Pass arguments to `update_resource_value_config` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param resource_value_config [::Google::Cloud::SecurityCenter::V2::ResourceValueConfig, ::Hash] + # Required. The resource value config being updated. + # @param update_mask [::Google::Protobuf::FieldMask, ::Hash] + # The list of fields to be updated. + # If empty all mutable fields will be updated. + # + # To update nested fields, include the top level field in the mask + # For example, to update gcp_metadata.resource_type, include the + # "gcp_metadata" field mask + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Cloud::SecurityCenter::V2::ResourceValueConfig] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::SecurityCenter::V2::ResourceValueConfig] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/security_center/v2" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::SecurityCenter::V2::SecurityCenter::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::SecurityCenter::V2::UpdateResourceValueConfigRequest.new + # + # # Call the update_resource_value_config method. + # result = client.update_resource_value_config request + # + # # The returned object is of type Google::Cloud::SecurityCenter::V2::ResourceValueConfig. + # p result + # + def update_resource_value_config request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::SecurityCenter::V2::UpdateResourceValueConfigRequest + + # Converts hash 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_resource_value_config.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::SecurityCenter::V2::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + options.apply_defaults timeout: @config.rpcs.update_resource_value_config.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.update_resource_value_config.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @security_center_stub.update_resource_value_config request, options do |result, operation| + yield result, operation if block_given? + end + rescue ::Gapic::Rest::Error => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Updates security marks. For Finding Security marks, if no location is + # specified, finding is assumed to be in global. Assets Security Marks can + # only be accessed through global endpoint. + # + # @overload update_security_marks(request, options = nil) + # Pass arguments to `update_security_marks` via a request object, either of type + # {::Google::Cloud::SecurityCenter::V2::UpdateSecurityMarksRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::SecurityCenter::V2::UpdateSecurityMarksRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_security_marks(security_marks: nil, update_mask: nil) + # Pass arguments to `update_security_marks` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param security_marks [::Google::Cloud::SecurityCenter::V2::SecurityMarks, ::Hash] + # Required. The security marks resource to update. + # @param update_mask [::Google::Protobuf::FieldMask, ::Hash] + # The FieldMask to use when updating the security marks resource. + # + # The field mask must not contain duplicate fields. + # If empty or set to "marks", all marks will be replaced. Individual + # marks can be updated using "marks.". + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Cloud::SecurityCenter::V2::SecurityMarks] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::SecurityCenter::V2::SecurityMarks] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/security_center/v2" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::SecurityCenter::V2::SecurityCenter::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::SecurityCenter::V2::UpdateSecurityMarksRequest.new + # + # # Call the update_security_marks method. + # result = client.update_security_marks request + # + # # The returned object is of type Google::Cloud::SecurityCenter::V2::SecurityMarks. + # p result + # + def update_security_marks request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::SecurityCenter::V2::UpdateSecurityMarksRequest + + # Converts hash 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_security_marks.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::SecurityCenter::V2::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + options.apply_defaults timeout: @config.rpcs.update_security_marks.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.update_security_marks.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @security_center_stub.update_security_marks 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 source. + # + # @overload update_source(request, options = nil) + # Pass arguments to `update_source` via a request object, either of type + # {::Google::Cloud::SecurityCenter::V2::UpdateSourceRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::SecurityCenter::V2::UpdateSourceRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_source(source: nil, update_mask: nil) + # Pass arguments to `update_source` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param source [::Google::Cloud::SecurityCenter::V2::Source, ::Hash] + # Required. The source resource to update. + # @param update_mask [::Google::Protobuf::FieldMask, ::Hash] + # The FieldMask to use when updating the source resource. + # + # If empty all mutable fields will be updated. + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Cloud::SecurityCenter::V2::Source] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::SecurityCenter::V2::Source] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/security_center/v2" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::SecurityCenter::V2::SecurityCenter::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::SecurityCenter::V2::UpdateSourceRequest.new + # + # # Call the update_source method. + # result = client.update_source request + # + # # The returned object is of type Google::Cloud::SecurityCenter::V2::Source. + # p result + # + def update_source request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::SecurityCenter::V2::UpdateSourceRequest + + # Converts hash 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_source.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::SecurityCenter::V2::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + options.apply_defaults timeout: @config.rpcs.update_source.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.update_source.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @security_center_stub.update_source 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 SecurityCenter REST API. + # + # This class represents the configuration for SecurityCenter REST, + # providing control over timeouts, retry behavior, logging, transport + # parameters, and other low-level controls. Certain parameters can also be + # applied individually to specific RPCs. See + # {::Google::Cloud::SecurityCenter::V2::SecurityCenter::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 + # # batch_create_resource_value_configs to 20 seconds, + # # and all remaining timeouts to 10 seconds. + # ::Google::Cloud::SecurityCenter::V2::SecurityCenter::Rest::Client.configure do |config| + # config.timeout = 10.0 + # config.rpcs.batch_create_resource_value_configs.timeout = 20.0 + # end + # + # # Apply the above configuration only to a new client. + # client = ::Google::Cloud::SecurityCenter::V2::SecurityCenter::Rest::Client.new do |config| + # config.timeout = 10.0 + # config.rpcs.batch_create_resource_value_configs.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 = "securitycenter.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 SecurityCenter 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 `batch_create_resource_value_configs` + # @return [::Gapic::Config::Method] + # + attr_reader :batch_create_resource_value_configs + ## + # RPC-specific configuration for `bulk_mute_findings` + # @return [::Gapic::Config::Method] + # + attr_reader :bulk_mute_findings + ## + # RPC-specific configuration for `create_big_query_export` + # @return [::Gapic::Config::Method] + # + attr_reader :create_big_query_export + ## + # RPC-specific configuration for `create_finding` + # @return [::Gapic::Config::Method] + # + attr_reader :create_finding + ## + # RPC-specific configuration for `create_mute_config` + # @return [::Gapic::Config::Method] + # + attr_reader :create_mute_config + ## + # RPC-specific configuration for `create_notification_config` + # @return [::Gapic::Config::Method] + # + attr_reader :create_notification_config + ## + # RPC-specific configuration for `create_source` + # @return [::Gapic::Config::Method] + # + attr_reader :create_source + ## + # RPC-specific configuration for `delete_big_query_export` + # @return [::Gapic::Config::Method] + # + attr_reader :delete_big_query_export + ## + # RPC-specific configuration for `delete_mute_config` + # @return [::Gapic::Config::Method] + # + attr_reader :delete_mute_config + ## + # RPC-specific configuration for `delete_notification_config` + # @return [::Gapic::Config::Method] + # + attr_reader :delete_notification_config + ## + # RPC-specific configuration for `delete_resource_value_config` + # @return [::Gapic::Config::Method] + # + attr_reader :delete_resource_value_config + ## + # RPC-specific configuration for `get_big_query_export` + # @return [::Gapic::Config::Method] + # + attr_reader :get_big_query_export + ## + # RPC-specific configuration for `get_simulation` + # @return [::Gapic::Config::Method] + # + attr_reader :get_simulation + ## + # RPC-specific configuration for `get_valued_resource` + # @return [::Gapic::Config::Method] + # + attr_reader :get_valued_resource + ## + # RPC-specific configuration for `get_iam_policy` + # @return [::Gapic::Config::Method] + # + attr_reader :get_iam_policy + ## + # RPC-specific configuration for `get_mute_config` + # @return [::Gapic::Config::Method] + # + attr_reader :get_mute_config + ## + # RPC-specific configuration for `get_notification_config` + # @return [::Gapic::Config::Method] + # + attr_reader :get_notification_config + ## + # RPC-specific configuration for `get_resource_value_config` + # @return [::Gapic::Config::Method] + # + attr_reader :get_resource_value_config + ## + # RPC-specific configuration for `get_source` + # @return [::Gapic::Config::Method] + # + attr_reader :get_source + ## + # RPC-specific configuration for `group_findings` + # @return [::Gapic::Config::Method] + # + attr_reader :group_findings + ## + # RPC-specific configuration for `list_attack_paths` + # @return [::Gapic::Config::Method] + # + attr_reader :list_attack_paths + ## + # RPC-specific configuration for `list_big_query_exports` + # @return [::Gapic::Config::Method] + # + attr_reader :list_big_query_exports + ## + # RPC-specific configuration for `list_findings` + # @return [::Gapic::Config::Method] + # + attr_reader :list_findings + ## + # RPC-specific configuration for `list_mute_configs` + # @return [::Gapic::Config::Method] + # + attr_reader :list_mute_configs + ## + # RPC-specific configuration for `list_notification_configs` + # @return [::Gapic::Config::Method] + # + attr_reader :list_notification_configs + ## + # RPC-specific configuration for `list_resource_value_configs` + # @return [::Gapic::Config::Method] + # + attr_reader :list_resource_value_configs + ## + # RPC-specific configuration for `list_sources` + # @return [::Gapic::Config::Method] + # + attr_reader :list_sources + ## + # RPC-specific configuration for `list_valued_resources` + # @return [::Gapic::Config::Method] + # + attr_reader :list_valued_resources + ## + # RPC-specific configuration for `set_finding_state` + # @return [::Gapic::Config::Method] + # + attr_reader :set_finding_state + ## + # RPC-specific configuration for `set_iam_policy` + # @return [::Gapic::Config::Method] + # + attr_reader :set_iam_policy + ## + # RPC-specific configuration for `set_mute` + # @return [::Gapic::Config::Method] + # + attr_reader :set_mute + ## + # RPC-specific configuration for `test_iam_permissions` + # @return [::Gapic::Config::Method] + # + attr_reader :test_iam_permissions + ## + # RPC-specific configuration for `update_big_query_export` + # @return [::Gapic::Config::Method] + # + attr_reader :update_big_query_export + ## + # RPC-specific configuration for `update_external_system` + # @return [::Gapic::Config::Method] + # + attr_reader :update_external_system + ## + # RPC-specific configuration for `update_finding` + # @return [::Gapic::Config::Method] + # + attr_reader :update_finding + ## + # RPC-specific configuration for `update_mute_config` + # @return [::Gapic::Config::Method] + # + attr_reader :update_mute_config + ## + # RPC-specific configuration for `update_notification_config` + # @return [::Gapic::Config::Method] + # + attr_reader :update_notification_config + ## + # RPC-specific configuration for `update_resource_value_config` + # @return [::Gapic::Config::Method] + # + attr_reader :update_resource_value_config + ## + # RPC-specific configuration for `update_security_marks` + # @return [::Gapic::Config::Method] + # + attr_reader :update_security_marks + ## + # RPC-specific configuration for `update_source` + # @return [::Gapic::Config::Method] + # + attr_reader :update_source + + # @private + def initialize parent_rpcs = nil + batch_create_resource_value_configs_config = parent_rpcs.batch_create_resource_value_configs if parent_rpcs.respond_to? :batch_create_resource_value_configs + @batch_create_resource_value_configs = ::Gapic::Config::Method.new batch_create_resource_value_configs_config + bulk_mute_findings_config = parent_rpcs.bulk_mute_findings if parent_rpcs.respond_to? :bulk_mute_findings + @bulk_mute_findings = ::Gapic::Config::Method.new bulk_mute_findings_config + create_big_query_export_config = parent_rpcs.create_big_query_export if parent_rpcs.respond_to? :create_big_query_export + @create_big_query_export = ::Gapic::Config::Method.new create_big_query_export_config + create_finding_config = parent_rpcs.create_finding if parent_rpcs.respond_to? :create_finding + @create_finding = ::Gapic::Config::Method.new create_finding_config + create_mute_config_config = parent_rpcs.create_mute_config if parent_rpcs.respond_to? :create_mute_config + @create_mute_config = ::Gapic::Config::Method.new create_mute_config_config + create_notification_config_config = parent_rpcs.create_notification_config if parent_rpcs.respond_to? :create_notification_config + @create_notification_config = ::Gapic::Config::Method.new create_notification_config_config + create_source_config = parent_rpcs.create_source if parent_rpcs.respond_to? :create_source + @create_source = ::Gapic::Config::Method.new create_source_config + delete_big_query_export_config = parent_rpcs.delete_big_query_export if parent_rpcs.respond_to? :delete_big_query_export + @delete_big_query_export = ::Gapic::Config::Method.new delete_big_query_export_config + delete_mute_config_config = parent_rpcs.delete_mute_config if parent_rpcs.respond_to? :delete_mute_config + @delete_mute_config = ::Gapic::Config::Method.new delete_mute_config_config + delete_notification_config_config = parent_rpcs.delete_notification_config if parent_rpcs.respond_to? :delete_notification_config + @delete_notification_config = ::Gapic::Config::Method.new delete_notification_config_config + delete_resource_value_config_config = parent_rpcs.delete_resource_value_config if parent_rpcs.respond_to? :delete_resource_value_config + @delete_resource_value_config = ::Gapic::Config::Method.new delete_resource_value_config_config + get_big_query_export_config = parent_rpcs.get_big_query_export if parent_rpcs.respond_to? :get_big_query_export + @get_big_query_export = ::Gapic::Config::Method.new get_big_query_export_config + get_simulation_config = parent_rpcs.get_simulation if parent_rpcs.respond_to? :get_simulation + @get_simulation = ::Gapic::Config::Method.new get_simulation_config + get_valued_resource_config = parent_rpcs.get_valued_resource if parent_rpcs.respond_to? :get_valued_resource + @get_valued_resource = ::Gapic::Config::Method.new get_valued_resource_config + get_iam_policy_config = parent_rpcs.get_iam_policy if parent_rpcs.respond_to? :get_iam_policy + @get_iam_policy = ::Gapic::Config::Method.new get_iam_policy_config + get_mute_config_config = parent_rpcs.get_mute_config if parent_rpcs.respond_to? :get_mute_config + @get_mute_config = ::Gapic::Config::Method.new get_mute_config_config + get_notification_config_config = parent_rpcs.get_notification_config if parent_rpcs.respond_to? :get_notification_config + @get_notification_config = ::Gapic::Config::Method.new get_notification_config_config + get_resource_value_config_config = parent_rpcs.get_resource_value_config if parent_rpcs.respond_to? :get_resource_value_config + @get_resource_value_config = ::Gapic::Config::Method.new get_resource_value_config_config + get_source_config = parent_rpcs.get_source if parent_rpcs.respond_to? :get_source + @get_source = ::Gapic::Config::Method.new get_source_config + group_findings_config = parent_rpcs.group_findings if parent_rpcs.respond_to? :group_findings + @group_findings = ::Gapic::Config::Method.new group_findings_config + list_attack_paths_config = parent_rpcs.list_attack_paths if parent_rpcs.respond_to? :list_attack_paths + @list_attack_paths = ::Gapic::Config::Method.new list_attack_paths_config + list_big_query_exports_config = parent_rpcs.list_big_query_exports if parent_rpcs.respond_to? :list_big_query_exports + @list_big_query_exports = ::Gapic::Config::Method.new list_big_query_exports_config + list_findings_config = parent_rpcs.list_findings if parent_rpcs.respond_to? :list_findings + @list_findings = ::Gapic::Config::Method.new list_findings_config + list_mute_configs_config = parent_rpcs.list_mute_configs if parent_rpcs.respond_to? :list_mute_configs + @list_mute_configs = ::Gapic::Config::Method.new list_mute_configs_config + list_notification_configs_config = parent_rpcs.list_notification_configs if parent_rpcs.respond_to? :list_notification_configs + @list_notification_configs = ::Gapic::Config::Method.new list_notification_configs_config + list_resource_value_configs_config = parent_rpcs.list_resource_value_configs if parent_rpcs.respond_to? :list_resource_value_configs + @list_resource_value_configs = ::Gapic::Config::Method.new list_resource_value_configs_config + list_sources_config = parent_rpcs.list_sources if parent_rpcs.respond_to? :list_sources + @list_sources = ::Gapic::Config::Method.new list_sources_config + list_valued_resources_config = parent_rpcs.list_valued_resources if parent_rpcs.respond_to? :list_valued_resources + @list_valued_resources = ::Gapic::Config::Method.new list_valued_resources_config + set_finding_state_config = parent_rpcs.set_finding_state if parent_rpcs.respond_to? :set_finding_state + @set_finding_state = ::Gapic::Config::Method.new set_finding_state_config + set_iam_policy_config = parent_rpcs.set_iam_policy if parent_rpcs.respond_to? :set_iam_policy + @set_iam_policy = ::Gapic::Config::Method.new set_iam_policy_config + set_mute_config = parent_rpcs.set_mute if parent_rpcs.respond_to? :set_mute + @set_mute = ::Gapic::Config::Method.new set_mute_config + test_iam_permissions_config = parent_rpcs.test_iam_permissions if parent_rpcs.respond_to? :test_iam_permissions + @test_iam_permissions = ::Gapic::Config::Method.new test_iam_permissions_config + update_big_query_export_config = parent_rpcs.update_big_query_export if parent_rpcs.respond_to? :update_big_query_export + @update_big_query_export = ::Gapic::Config::Method.new update_big_query_export_config + update_external_system_config = parent_rpcs.update_external_system if parent_rpcs.respond_to? :update_external_system + @update_external_system = ::Gapic::Config::Method.new update_external_system_config + update_finding_config = parent_rpcs.update_finding if parent_rpcs.respond_to? :update_finding + @update_finding = ::Gapic::Config::Method.new update_finding_config + update_mute_config_config = parent_rpcs.update_mute_config if parent_rpcs.respond_to? :update_mute_config + @update_mute_config = ::Gapic::Config::Method.new update_mute_config_config + update_notification_config_config = parent_rpcs.update_notification_config if parent_rpcs.respond_to? :update_notification_config + @update_notification_config = ::Gapic::Config::Method.new update_notification_config_config + update_resource_value_config_config = parent_rpcs.update_resource_value_config if parent_rpcs.respond_to? :update_resource_value_config + @update_resource_value_config = ::Gapic::Config::Method.new update_resource_value_config_config + update_security_marks_config = parent_rpcs.update_security_marks if parent_rpcs.respond_to? :update_security_marks + @update_security_marks = ::Gapic::Config::Method.new update_security_marks_config + update_source_config = parent_rpcs.update_source if parent_rpcs.respond_to? :update_source + @update_source = ::Gapic::Config::Method.new update_source_config + + yield self if block_given? + end + end + end + end + end + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-security_center-v2/lib/google/cloud/security_center/v2/security_center/rest/operations.rb b/owl-bot-staging/google-cloud-security_center-v2/lib/google/cloud/security_center/v2/security_center/rest/operations.rb new file mode 100644 index 000000000000..e2f7bdbbfacc --- /dev/null +++ b/owl-bot-staging/google-cloud-security_center-v2/lib/google/cloud/security_center/v2/security_center/rest/operations.rb @@ -0,0 +1,924 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +require "gapic/operation" + +module Google + module Cloud + module SecurityCenter + module V2 + module SecurityCenter + module Rest + # Service that implements Longrunning Operations API. + class Operations + # @private + API_VERSION = "" + + # @private + DEFAULT_ENDPOINT_TEMPLATE = "securitycenter.$UNIVERSE_DOMAIN$" + + # @private + attr_reader :operations_stub + + ## + # Configuration for the SecurityCenter 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 SecurityCenter 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::SecurityCenter::V2::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + options.apply_defaults timeout: @config.rpcs.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::SecurityCenter::V2::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + options.apply_defaults timeout: @config.rpcs.get_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::SecurityCenter::V2::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + options.apply_defaults timeout: @config.rpcs.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::SecurityCenter::V2::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + options.apply_defaults timeout: @config.rpcs.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 = "securitycenter.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: "/v2/{name}", + matches: [ + ["name", %r{^organizations/[^/]+/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: "/v2/{name}", + matches: [ + ["name", %r{^organizations/[^/]+/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: "/v2/{name}", + matches: [ + ["name", %r{^organizations/[^/]+/operations/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the cancel_operation REST call + # + # @param request_pb [::Google::Longrunning::CancelOperationRequest] + # A request object representing the call parameters. Required. + # @return [Array(String, [String, nil], Hash{String => String})] + # Uri, Body, Query string parameters + def self.transcode_cancel_operation_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :post, + uri_template: "/v2/{name}:cancel", + matches: [ + ["name", %r{^organizations/[^/]+/operations/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + end + end + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-security_center-v2/lib/google/cloud/security_center/v2/security_center/rest/service_stub.rb b/owl-bot-staging/google-cloud-security_center-v2/lib/google/cloud/security_center/v2/security_center/rest/service_stub.rb new file mode 100644 index 000000000000..49be184914d1 --- /dev/null +++ b/owl-bot-staging/google-cloud-security_center-v2/lib/google/cloud/security_center/v2/security_center/rest/service_stub.rb @@ -0,0 +1,3336 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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/securitycenter/v2/securitycenter_service_pb" + +module Google + module Cloud + module SecurityCenter + module V2 + module SecurityCenter + module Rest + ## + # REST service stub for the SecurityCenter 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 batch_create_resource_value_configs REST call + # + # @param request_pb [::Google::Cloud::SecurityCenter::V2::BatchCreateResourceValueConfigsRequest] + # A request object representing the call parameters. Required. + # @param options [::Gapic::CallOptions] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Cloud::SecurityCenter::V2::BatchCreateResourceValueConfigsResponse] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::SecurityCenter::V2::BatchCreateResourceValueConfigsResponse] + # A result object deserialized from the server's reply + def batch_create_resource_value_configs request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_batch_create_resource_value_configs_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: "batch_create_resource_value_configs", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Cloud::SecurityCenter::V2::BatchCreateResourceValueConfigsResponse.decode_json response.body, ignore_unknown_fields: true + catch :response do + yield result, operation if block_given? + result + end + end + + ## + # Baseline implementation for the bulk_mute_findings REST call + # + # @param request_pb [::Google::Cloud::SecurityCenter::V2::BulkMuteFindingsRequest] + # 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 bulk_mute_findings request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_bulk_mute_findings_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: "bulk_mute_findings", + 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 create_big_query_export REST call + # + # @param request_pb [::Google::Cloud::SecurityCenter::V2::CreateBigQueryExportRequest] + # A request object representing the call parameters. Required. + # @param options [::Gapic::CallOptions] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Cloud::SecurityCenter::V2::BigQueryExport] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::SecurityCenter::V2::BigQueryExport] + # A result object deserialized from the server's reply + def create_big_query_export request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_create_big_query_export_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_big_query_export", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Cloud::SecurityCenter::V2::BigQueryExport.decode_json response.body, ignore_unknown_fields: true + catch :response do + yield result, operation if block_given? + result + end + end + + ## + # Baseline implementation for the create_finding REST call + # + # @param request_pb [::Google::Cloud::SecurityCenter::V2::CreateFindingRequest] + # A request object representing the call parameters. Required. + # @param options [::Gapic::CallOptions] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Cloud::SecurityCenter::V2::Finding] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::SecurityCenter::V2::Finding] + # A result object deserialized from the server's reply + def create_finding request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_create_finding_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_finding", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Cloud::SecurityCenter::V2::Finding.decode_json response.body, ignore_unknown_fields: true + catch :response do + yield result, operation if block_given? + result + end + end + + ## + # Baseline implementation for the create_mute_config REST call + # + # @param request_pb [::Google::Cloud::SecurityCenter::V2::CreateMuteConfigRequest] + # A request object representing the call parameters. Required. + # @param options [::Gapic::CallOptions] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Cloud::SecurityCenter::V2::MuteConfig] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::SecurityCenter::V2::MuteConfig] + # A result object deserialized from the server's reply + def create_mute_config request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_create_mute_config_request request_pb + query_string_params = if query_string_params.any? + query_string_params.to_h { |p| p.split "=", 2 } + else + {} + end + + response = @client_stub.make_http_request( + verb, + uri: uri, + body: body || "", + params: query_string_params, + method_name: "create_mute_config", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Cloud::SecurityCenter::V2::MuteConfig.decode_json response.body, ignore_unknown_fields: true + catch :response do + yield result, operation if block_given? + result + end + end + + ## + # Baseline implementation for the create_notification_config REST call + # + # @param request_pb [::Google::Cloud::SecurityCenter::V2::CreateNotificationConfigRequest] + # A request object representing the call parameters. Required. + # @param options [::Gapic::CallOptions] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Cloud::SecurityCenter::V2::NotificationConfig] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::SecurityCenter::V2::NotificationConfig] + # A result object deserialized from the server's reply + def create_notification_config request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_create_notification_config_request request_pb + query_string_params = if query_string_params.any? + query_string_params.to_h { |p| p.split "=", 2 } + else + {} + end + + response = @client_stub.make_http_request( + verb, + uri: uri, + body: body || "", + params: query_string_params, + method_name: "create_notification_config", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Cloud::SecurityCenter::V2::NotificationConfig.decode_json response.body, ignore_unknown_fields: true + catch :response do + yield result, operation if block_given? + result + end + end + + ## + # Baseline implementation for the create_source REST call + # + # @param request_pb [::Google::Cloud::SecurityCenter::V2::CreateSourceRequest] + # A request object representing the call parameters. Required. + # @param options [::Gapic::CallOptions] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Cloud::SecurityCenter::V2::Source] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::SecurityCenter::V2::Source] + # A result object deserialized from the server's reply + def create_source request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_create_source_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_source", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Cloud::SecurityCenter::V2::Source.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_big_query_export REST call + # + # @param request_pb [::Google::Cloud::SecurityCenter::V2::DeleteBigQueryExportRequest] + # 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_big_query_export request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_delete_big_query_export_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_big_query_export", + 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 delete_mute_config REST call + # + # @param request_pb [::Google::Cloud::SecurityCenter::V2::DeleteMuteConfigRequest] + # 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_mute_config request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_delete_mute_config_request request_pb + query_string_params = if query_string_params.any? + query_string_params.to_h { |p| p.split "=", 2 } + else + {} + end + + response = @client_stub.make_http_request( + verb, + uri: uri, + body: body || "", + params: query_string_params, + method_name: "delete_mute_config", + 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 delete_notification_config REST call + # + # @param request_pb [::Google::Cloud::SecurityCenter::V2::DeleteNotificationConfigRequest] + # 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_notification_config request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_delete_notification_config_request request_pb + query_string_params = if query_string_params.any? + query_string_params.to_h { |p| p.split "=", 2 } + else + {} + end + + response = @client_stub.make_http_request( + verb, + uri: uri, + body: body || "", + params: query_string_params, + method_name: "delete_notification_config", + 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 delete_resource_value_config REST call + # + # @param request_pb [::Google::Cloud::SecurityCenter::V2::DeleteResourceValueConfigRequest] + # 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_resource_value_config request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_delete_resource_value_config_request request_pb + query_string_params = if query_string_params.any? + query_string_params.to_h { |p| p.split "=", 2 } + else + {} + end + + response = @client_stub.make_http_request( + verb, + uri: uri, + body: body || "", + params: query_string_params, + method_name: "delete_resource_value_config", + 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 get_big_query_export REST call + # + # @param request_pb [::Google::Cloud::SecurityCenter::V2::GetBigQueryExportRequest] + # A request object representing the call parameters. Required. + # @param options [::Gapic::CallOptions] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Cloud::SecurityCenter::V2::BigQueryExport] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::SecurityCenter::V2::BigQueryExport] + # A result object deserialized from the server's reply + def get_big_query_export request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_get_big_query_export_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_big_query_export", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Cloud::SecurityCenter::V2::BigQueryExport.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_simulation REST call + # + # @param request_pb [::Google::Cloud::SecurityCenter::V2::GetSimulationRequest] + # A request object representing the call parameters. Required. + # @param options [::Gapic::CallOptions] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Cloud::SecurityCenter::V2::Simulation] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::SecurityCenter::V2::Simulation] + # A result object deserialized from the server's reply + def get_simulation request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_get_simulation_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_simulation", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Cloud::SecurityCenter::V2::Simulation.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_valued_resource REST call + # + # @param request_pb [::Google::Cloud::SecurityCenter::V2::GetValuedResourceRequest] + # A request object representing the call parameters. Required. + # @param options [::Gapic::CallOptions] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Cloud::SecurityCenter::V2::ValuedResource] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::SecurityCenter::V2::ValuedResource] + # A result object deserialized from the server's reply + def get_valued_resource request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_get_valued_resource_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_valued_resource", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Cloud::SecurityCenter::V2::ValuedResource.decode_json response.body, ignore_unknown_fields: true + catch :response do + yield result, operation if block_given? + result + end + end + + ## + # Baseline implementation for the get_iam_policy REST call + # + # @param request_pb [::Google::Iam::V1::GetIamPolicyRequest] + # A request object representing the call parameters. Required. + # @param options [::Gapic::CallOptions] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Iam::V1::Policy] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Iam::V1::Policy] + # A result object deserialized from the server's reply + def get_iam_policy request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_get_iam_policy_request request_pb + query_string_params = if query_string_params.any? + query_string_params.to_h { |p| p.split "=", 2 } + else + {} + end + + response = @client_stub.make_http_request( + verb, + uri: uri, + body: body || "", + params: query_string_params, + method_name: "get_iam_policy", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Iam::V1::Policy.decode_json response.body, ignore_unknown_fields: true + catch :response do + yield result, operation if block_given? + result + end + end + + ## + # Baseline implementation for the get_mute_config REST call + # + # @param request_pb [::Google::Cloud::SecurityCenter::V2::GetMuteConfigRequest] + # A request object representing the call parameters. Required. + # @param options [::Gapic::CallOptions] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Cloud::SecurityCenter::V2::MuteConfig] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::SecurityCenter::V2::MuteConfig] + # A result object deserialized from the server's reply + def get_mute_config request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_get_mute_config_request request_pb + query_string_params = if query_string_params.any? + query_string_params.to_h { |p| p.split "=", 2 } + else + {} + end + + response = @client_stub.make_http_request( + verb, + uri: uri, + body: body || "", + params: query_string_params, + method_name: "get_mute_config", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Cloud::SecurityCenter::V2::MuteConfig.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_notification_config REST call + # + # @param request_pb [::Google::Cloud::SecurityCenter::V2::GetNotificationConfigRequest] + # A request object representing the call parameters. Required. + # @param options [::Gapic::CallOptions] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Cloud::SecurityCenter::V2::NotificationConfig] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::SecurityCenter::V2::NotificationConfig] + # A result object deserialized from the server's reply + def get_notification_config request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_get_notification_config_request request_pb + query_string_params = if query_string_params.any? + query_string_params.to_h { |p| p.split "=", 2 } + else + {} + end + + response = @client_stub.make_http_request( + verb, + uri: uri, + body: body || "", + params: query_string_params, + method_name: "get_notification_config", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Cloud::SecurityCenter::V2::NotificationConfig.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_resource_value_config REST call + # + # @param request_pb [::Google::Cloud::SecurityCenter::V2::GetResourceValueConfigRequest] + # A request object representing the call parameters. Required. + # @param options [::Gapic::CallOptions] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Cloud::SecurityCenter::V2::ResourceValueConfig] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::SecurityCenter::V2::ResourceValueConfig] + # A result object deserialized from the server's reply + def get_resource_value_config request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_get_resource_value_config_request request_pb + query_string_params = if query_string_params.any? + query_string_params.to_h { |p| p.split "=", 2 } + else + {} + end + + response = @client_stub.make_http_request( + verb, + uri: uri, + body: body || "", + params: query_string_params, + method_name: "get_resource_value_config", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Cloud::SecurityCenter::V2::ResourceValueConfig.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_source REST call + # + # @param request_pb [::Google::Cloud::SecurityCenter::V2::GetSourceRequest] + # A request object representing the call parameters. Required. + # @param options [::Gapic::CallOptions] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Cloud::SecurityCenter::V2::Source] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::SecurityCenter::V2::Source] + # A result object deserialized from the server's reply + def get_source request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_get_source_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_source", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Cloud::SecurityCenter::V2::Source.decode_json response.body, ignore_unknown_fields: true + catch :response do + yield result, operation if block_given? + result + end + end + + ## + # Baseline implementation for the group_findings REST call + # + # @param request_pb [::Google::Cloud::SecurityCenter::V2::GroupFindingsRequest] + # A request object representing the call parameters. Required. + # @param options [::Gapic::CallOptions] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Cloud::SecurityCenter::V2::GroupFindingsResponse] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::SecurityCenter::V2::GroupFindingsResponse] + # A result object deserialized from the server's reply + def group_findings request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_group_findings_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: "group_findings", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Cloud::SecurityCenter::V2::GroupFindingsResponse.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_attack_paths REST call + # + # @param request_pb [::Google::Cloud::SecurityCenter::V2::ListAttackPathsRequest] + # A request object representing the call parameters. Required. + # @param options [::Gapic::CallOptions] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Cloud::SecurityCenter::V2::ListAttackPathsResponse] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::SecurityCenter::V2::ListAttackPathsResponse] + # A result object deserialized from the server's reply + def list_attack_paths request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_list_attack_paths_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_attack_paths", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Cloud::SecurityCenter::V2::ListAttackPathsResponse.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_big_query_exports REST call + # + # @param request_pb [::Google::Cloud::SecurityCenter::V2::ListBigQueryExportsRequest] + # A request object representing the call parameters. Required. + # @param options [::Gapic::CallOptions] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Cloud::SecurityCenter::V2::ListBigQueryExportsResponse] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::SecurityCenter::V2::ListBigQueryExportsResponse] + # A result object deserialized from the server's reply + def list_big_query_exports request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_list_big_query_exports_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_big_query_exports", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Cloud::SecurityCenter::V2::ListBigQueryExportsResponse.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_findings REST call + # + # @param request_pb [::Google::Cloud::SecurityCenter::V2::ListFindingsRequest] + # A request object representing the call parameters. Required. + # @param options [::Gapic::CallOptions] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Cloud::SecurityCenter::V2::ListFindingsResponse] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::SecurityCenter::V2::ListFindingsResponse] + # A result object deserialized from the server's reply + def list_findings request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_list_findings_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_findings", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Cloud::SecurityCenter::V2::ListFindingsResponse.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_mute_configs REST call + # + # @param request_pb [::Google::Cloud::SecurityCenter::V2::ListMuteConfigsRequest] + # A request object representing the call parameters. Required. + # @param options [::Gapic::CallOptions] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Cloud::SecurityCenter::V2::ListMuteConfigsResponse] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::SecurityCenter::V2::ListMuteConfigsResponse] + # A result object deserialized from the server's reply + def list_mute_configs request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_list_mute_configs_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_mute_configs", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Cloud::SecurityCenter::V2::ListMuteConfigsResponse.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_notification_configs REST call + # + # @param request_pb [::Google::Cloud::SecurityCenter::V2::ListNotificationConfigsRequest] + # A request object representing the call parameters. Required. + # @param options [::Gapic::CallOptions] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Cloud::SecurityCenter::V2::ListNotificationConfigsResponse] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::SecurityCenter::V2::ListNotificationConfigsResponse] + # A result object deserialized from the server's reply + def list_notification_configs request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_list_notification_configs_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_notification_configs", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Cloud::SecurityCenter::V2::ListNotificationConfigsResponse.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_resource_value_configs REST call + # + # @param request_pb [::Google::Cloud::SecurityCenter::V2::ListResourceValueConfigsRequest] + # A request object representing the call parameters. Required. + # @param options [::Gapic::CallOptions] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Cloud::SecurityCenter::V2::ListResourceValueConfigsResponse] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::SecurityCenter::V2::ListResourceValueConfigsResponse] + # A result object deserialized from the server's reply + def list_resource_value_configs request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_list_resource_value_configs_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_resource_value_configs", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Cloud::SecurityCenter::V2::ListResourceValueConfigsResponse.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_sources REST call + # + # @param request_pb [::Google::Cloud::SecurityCenter::V2::ListSourcesRequest] + # A request object representing the call parameters. Required. + # @param options [::Gapic::CallOptions] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Cloud::SecurityCenter::V2::ListSourcesResponse] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::SecurityCenter::V2::ListSourcesResponse] + # A result object deserialized from the server's reply + def list_sources request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_list_sources_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_sources", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Cloud::SecurityCenter::V2::ListSourcesResponse.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_valued_resources REST call + # + # @param request_pb [::Google::Cloud::SecurityCenter::V2::ListValuedResourcesRequest] + # A request object representing the call parameters. Required. + # @param options [::Gapic::CallOptions] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Cloud::SecurityCenter::V2::ListValuedResourcesResponse] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::SecurityCenter::V2::ListValuedResourcesResponse] + # A result object deserialized from the server's reply + def list_valued_resources request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_list_valued_resources_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_valued_resources", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Cloud::SecurityCenter::V2::ListValuedResourcesResponse.decode_json response.body, ignore_unknown_fields: true + catch :response do + yield result, operation if block_given? + result + end + end + + ## + # Baseline implementation for the set_finding_state REST call + # + # @param request_pb [::Google::Cloud::SecurityCenter::V2::SetFindingStateRequest] + # A request object representing the call parameters. Required. + # @param options [::Gapic::CallOptions] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Cloud::SecurityCenter::V2::Finding] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::SecurityCenter::V2::Finding] + # A result object deserialized from the server's reply + def set_finding_state request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_set_finding_state_request request_pb + query_string_params = if query_string_params.any? + query_string_params.to_h { |p| p.split "=", 2 } + else + {} + end + + response = @client_stub.make_http_request( + verb, + uri: uri, + body: body || "", + params: query_string_params, + method_name: "set_finding_state", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Cloud::SecurityCenter::V2::Finding.decode_json response.body, ignore_unknown_fields: true + catch :response do + yield result, operation if block_given? + result + end + end + + ## + # Baseline implementation for the set_iam_policy REST call + # + # @param request_pb [::Google::Iam::V1::SetIamPolicyRequest] + # A request object representing the call parameters. Required. + # @param options [::Gapic::CallOptions] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Iam::V1::Policy] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Iam::V1::Policy] + # A result object deserialized from the server's reply + def set_iam_policy request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_set_iam_policy_request request_pb + query_string_params = if query_string_params.any? + query_string_params.to_h { |p| p.split "=", 2 } + else + {} + end + + response = @client_stub.make_http_request( + verb, + uri: uri, + body: body || "", + params: query_string_params, + method_name: "set_iam_policy", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Iam::V1::Policy.decode_json response.body, ignore_unknown_fields: true + catch :response do + yield result, operation if block_given? + result + end + end + + ## + # Baseline implementation for the set_mute REST call + # + # @param request_pb [::Google::Cloud::SecurityCenter::V2::SetMuteRequest] + # A request object representing the call parameters. Required. + # @param options [::Gapic::CallOptions] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Cloud::SecurityCenter::V2::Finding] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::SecurityCenter::V2::Finding] + # A result object deserialized from the server's reply + def set_mute request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_set_mute_request request_pb + query_string_params = if query_string_params.any? + query_string_params.to_h { |p| p.split "=", 2 } + else + {} + end + + response = @client_stub.make_http_request( + verb, + uri: uri, + body: body || "", + params: query_string_params, + method_name: "set_mute", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Cloud::SecurityCenter::V2::Finding.decode_json response.body, ignore_unknown_fields: true + catch :response do + yield result, operation if block_given? + result + end + end + + ## + # Baseline implementation for the test_iam_permissions REST call + # + # @param request_pb [::Google::Iam::V1::TestIamPermissionsRequest] + # A request object representing the call parameters. Required. + # @param options [::Gapic::CallOptions] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Iam::V1::TestIamPermissionsResponse] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Iam::V1::TestIamPermissionsResponse] + # A result object deserialized from the server's reply + def test_iam_permissions request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_test_iam_permissions_request request_pb + query_string_params = if query_string_params.any? + query_string_params.to_h { |p| p.split "=", 2 } + else + {} + end + + response = @client_stub.make_http_request( + verb, + uri: uri, + body: body || "", + params: query_string_params, + method_name: "test_iam_permissions", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Iam::V1::TestIamPermissionsResponse.decode_json response.body, ignore_unknown_fields: true + catch :response do + yield result, operation if block_given? + result + end + end + + ## + # Baseline implementation for the update_big_query_export REST call + # + # @param request_pb [::Google::Cloud::SecurityCenter::V2::UpdateBigQueryExportRequest] + # A request object representing the call parameters. Required. + # @param options [::Gapic::CallOptions] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Cloud::SecurityCenter::V2::BigQueryExport] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::SecurityCenter::V2::BigQueryExport] + # A result object deserialized from the server's reply + def update_big_query_export request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_update_big_query_export_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_big_query_export", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Cloud::SecurityCenter::V2::BigQueryExport.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_external_system REST call + # + # @param request_pb [::Google::Cloud::SecurityCenter::V2::UpdateExternalSystemRequest] + # A request object representing the call parameters. Required. + # @param options [::Gapic::CallOptions] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Cloud::SecurityCenter::V2::ExternalSystem] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::SecurityCenter::V2::ExternalSystem] + # A result object deserialized from the server's reply + def update_external_system request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_update_external_system_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_external_system", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Cloud::SecurityCenter::V2::ExternalSystem.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_finding REST call + # + # @param request_pb [::Google::Cloud::SecurityCenter::V2::UpdateFindingRequest] + # A request object representing the call parameters. Required. + # @param options [::Gapic::CallOptions] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Cloud::SecurityCenter::V2::Finding] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::SecurityCenter::V2::Finding] + # A result object deserialized from the server's reply + def update_finding request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_update_finding_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_finding", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Cloud::SecurityCenter::V2::Finding.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_mute_config REST call + # + # @param request_pb [::Google::Cloud::SecurityCenter::V2::UpdateMuteConfigRequest] + # A request object representing the call parameters. Required. + # @param options [::Gapic::CallOptions] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Cloud::SecurityCenter::V2::MuteConfig] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::SecurityCenter::V2::MuteConfig] + # A result object deserialized from the server's reply + def update_mute_config request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_update_mute_config_request request_pb + query_string_params = if query_string_params.any? + query_string_params.to_h { |p| p.split "=", 2 } + else + {} + end + + response = @client_stub.make_http_request( + verb, + uri: uri, + body: body || "", + params: query_string_params, + method_name: "update_mute_config", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Cloud::SecurityCenter::V2::MuteConfig.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_notification_config REST call + # + # @param request_pb [::Google::Cloud::SecurityCenter::V2::UpdateNotificationConfigRequest] + # A request object representing the call parameters. Required. + # @param options [::Gapic::CallOptions] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Cloud::SecurityCenter::V2::NotificationConfig] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::SecurityCenter::V2::NotificationConfig] + # A result object deserialized from the server's reply + def update_notification_config request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_update_notification_config_request request_pb + query_string_params = if query_string_params.any? + query_string_params.to_h { |p| p.split "=", 2 } + else + {} + end + + response = @client_stub.make_http_request( + verb, + uri: uri, + body: body || "", + params: query_string_params, + method_name: "update_notification_config", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Cloud::SecurityCenter::V2::NotificationConfig.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_resource_value_config REST call + # + # @param request_pb [::Google::Cloud::SecurityCenter::V2::UpdateResourceValueConfigRequest] + # A request object representing the call parameters. Required. + # @param options [::Gapic::CallOptions] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Cloud::SecurityCenter::V2::ResourceValueConfig] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::SecurityCenter::V2::ResourceValueConfig] + # A result object deserialized from the server's reply + def update_resource_value_config request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_update_resource_value_config_request request_pb + query_string_params = if query_string_params.any? + query_string_params.to_h { |p| p.split "=", 2 } + else + {} + end + + response = @client_stub.make_http_request( + verb, + uri: uri, + body: body || "", + params: query_string_params, + method_name: "update_resource_value_config", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Cloud::SecurityCenter::V2::ResourceValueConfig.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_security_marks REST call + # + # @param request_pb [::Google::Cloud::SecurityCenter::V2::UpdateSecurityMarksRequest] + # A request object representing the call parameters. Required. + # @param options [::Gapic::CallOptions] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Cloud::SecurityCenter::V2::SecurityMarks] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::SecurityCenter::V2::SecurityMarks] + # A result object deserialized from the server's reply + def update_security_marks request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_update_security_marks_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_security_marks", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Cloud::SecurityCenter::V2::SecurityMarks.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_source REST call + # + # @param request_pb [::Google::Cloud::SecurityCenter::V2::UpdateSourceRequest] + # A request object representing the call parameters. Required. + # @param options [::Gapic::CallOptions] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Cloud::SecurityCenter::V2::Source] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::SecurityCenter::V2::Source] + # A result object deserialized from the server's reply + def update_source request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_update_source_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_source", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Cloud::SecurityCenter::V2::Source.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 batch_create_resource_value_configs REST call + # + # @param request_pb [::Google::Cloud::SecurityCenter::V2::BatchCreateResourceValueConfigsRequest] + # A request object representing the call parameters. Required. + # @return [Array(String, [String, nil], Hash{String => String})] + # Uri, Body, Query string parameters + def self.transcode_batch_create_resource_value_configs_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :post, + uri_template: "/v2/{parent}/resourceValueConfigs:batchCreate", + body: "*", + matches: [ + ["parent", %r{^organizations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v2/{parent}/resourceValueConfigs:batchCreate", + body: "*", + matches: [ + ["parent", %r{^organizations/[^/]+/locations/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the bulk_mute_findings REST call + # + # @param request_pb [::Google::Cloud::SecurityCenter::V2::BulkMuteFindingsRequest] + # A request object representing the call parameters. Required. + # @return [Array(String, [String, nil], Hash{String => String})] + # Uri, Body, Query string parameters + def self.transcode_bulk_mute_findings_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :post, + uri_template: "/v2/{parent}/findings:bulkMute", + body: "*", + matches: [ + ["parent", %r{^organizations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v2/{parent}/findings:bulkMute", + body: "*", + matches: [ + ["parent", %r{^organizations/[^/]+/locations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v2/{parent}/findings:bulkMute", + body: "*", + matches: [ + ["parent", %r{^folders/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v2/{parent}/findings:bulkMute", + body: "*", + matches: [ + ["parent", %r{^folders/[^/]+/locations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v2/{parent}/findings:bulkMute", + body: "*", + matches: [ + ["parent", %r{^projects/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v2/{parent}/findings:bulkMute", + body: "*", + matches: [ + ["parent", %r{^projects/[^/]+/locations/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the create_big_query_export REST call + # + # @param request_pb [::Google::Cloud::SecurityCenter::V2::CreateBigQueryExportRequest] + # 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_big_query_export_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :post, + uri_template: "/v2/{parent}/bigQueryExports", + body: "big_query_export", + matches: [ + ["parent", %r{^organizations/[^/]+/locations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v2/{parent}/bigQueryExports", + body: "big_query_export", + matches: [ + ["parent", %r{^folders/[^/]+/locations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v2/{parent}/bigQueryExports", + body: "big_query_export", + matches: [ + ["parent", %r{^projects/[^/]+/locations/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the create_finding REST call + # + # @param request_pb [::Google::Cloud::SecurityCenter::V2::CreateFindingRequest] + # 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_finding_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :post, + uri_template: "/v2/{parent}/findings", + body: "finding", + matches: [ + ["parent", %r{^organizations/[^/]+/sources/[^/]+/locations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v2/{parent}/findings", + body: "finding", + matches: [ + ["parent", %r{^organizations/[^/]+/sources/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the create_mute_config REST call + # + # @param request_pb [::Google::Cloud::SecurityCenter::V2::CreateMuteConfigRequest] + # 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_mute_config_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :post, + uri_template: "/v2/{parent}/muteConfigs", + body: "mute_config", + matches: [ + ["parent", %r{^organizations/[^/]+/locations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v2/{parent}/muteConfigs", + body: "mute_config", + matches: [ + ["parent", %r{^folders/[^/]+/locations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v2/{parent}/muteConfigs", + body: "mute_config", + matches: [ + ["parent", %r{^projects/[^/]+/locations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v2/{parent}/muteConfigs", + body: "mute_config", + matches: [ + ["parent", %r{^organizations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v2/{parent}/muteConfigs", + body: "mute_config", + matches: [ + ["parent", %r{^folders/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v2/{parent}/muteConfigs", + body: "mute_config", + matches: [ + ["parent", %r{^projects/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the create_notification_config REST call + # + # @param request_pb [::Google::Cloud::SecurityCenter::V2::CreateNotificationConfigRequest] + # 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_notification_config_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :post, + uri_template: "/v2/{parent}/notificationConfigs", + body: "notification_config", + matches: [ + ["parent", %r{^organizations/[^/]+/locations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v2/{parent}/notificationConfigs", + body: "notification_config", + matches: [ + ["parent", %r{^folders/[^/]+/locations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v2/{parent}/notificationConfigs", + body: "notification_config", + matches: [ + ["parent", %r{^projects/[^/]+/locations/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the create_source REST call + # + # @param request_pb [::Google::Cloud::SecurityCenter::V2::CreateSourceRequest] + # 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_source_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :post, + uri_template: "/v2/{parent}/sources", + body: "source", + matches: [ + ["parent", %r{^organizations/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the delete_big_query_export REST call + # + # @param request_pb [::Google::Cloud::SecurityCenter::V2::DeleteBigQueryExportRequest] + # 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_big_query_export_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :delete, + uri_template: "/v2/{name}", + matches: [ + ["name", %r{^organizations/[^/]+/locations/[^/]+/bigQueryExports/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/v2/{name}", + matches: [ + ["name", %r{^folders/[^/]+/locations/[^/]+/bigQueryExports/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/v2/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/bigQueryExports/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the delete_mute_config REST call + # + # @param request_pb [::Google::Cloud::SecurityCenter::V2::DeleteMuteConfigRequest] + # 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_mute_config_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :delete, + uri_template: "/v2/{name}", + matches: [ + ["name", %r{^organizations/[^/]+/muteConfigs/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/v2/{name}", + matches: [ + ["name", %r{^organizations/[^/]+/locations/[^/]+/muteConfigs/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/v2/{name}", + matches: [ + ["name", %r{^folders/[^/]+/muteConfigs/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/v2/{name}", + matches: [ + ["name", %r{^folders/[^/]+/locations/[^/]+/muteConfigs/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/v2/{name}", + matches: [ + ["name", %r{^projects/[^/]+/muteConfigs/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/v2/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/muteConfigs/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the delete_notification_config REST call + # + # @param request_pb [::Google::Cloud::SecurityCenter::V2::DeleteNotificationConfigRequest] + # 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_notification_config_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :delete, + uri_template: "/v2/{name}", + matches: [ + ["name", %r{^organizations/[^/]+/locations/[^/]+/notificationConfigs/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/v2/{name}", + matches: [ + ["name", %r{^folders/[^/]+/locations/[^/]+/notificationConfigs/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/v2/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/notificationConfigs/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the delete_resource_value_config REST call + # + # @param request_pb [::Google::Cloud::SecurityCenter::V2::DeleteResourceValueConfigRequest] + # 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_resource_value_config_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :delete, + uri_template: "/v2/{name}", + matches: [ + ["name", %r{^organizations/[^/]+/resourceValueConfigs/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/v2/{name}", + matches: [ + ["name", %r{^organizations/[^/]+/locations/[^/]+/resourceValueConfigs/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the get_big_query_export REST call + # + # @param request_pb [::Google::Cloud::SecurityCenter::V2::GetBigQueryExportRequest] + # 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_big_query_export_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :get, + uri_template: "/v2/{name}", + matches: [ + ["name", %r{^organizations/[^/]+/locations/[^/]+/bigQueryExports/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v2/{name}", + matches: [ + ["name", %r{^folders/[^/]+/locations/[^/]+/bigQueryExports/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v2/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/bigQueryExports/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the get_simulation REST call + # + # @param request_pb [::Google::Cloud::SecurityCenter::V2::GetSimulationRequest] + # 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_simulation_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :get, + uri_template: "/v2/{name}", + matches: [ + ["name", %r{^organizations/[^/]+/simulations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v2/{name}", + matches: [ + ["name", %r{^organizations/[^/]+/locations/[^/]+/simulations/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the get_valued_resource REST call + # + # @param request_pb [::Google::Cloud::SecurityCenter::V2::GetValuedResourceRequest] + # 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_valued_resource_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :get, + uri_template: "/v2/{name}", + matches: [ + ["name", %r{^organizations/[^/]+/simulations/[^/]+/valuedResources/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v2/{name}", + matches: [ + ["name", %r{^organizations/[^/]+/locations/[^/]+/simulations/[^/]+/valuedResources/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the get_iam_policy REST call + # + # @param request_pb [::Google::Iam::V1::GetIamPolicyRequest] + # A request object representing the call parameters. Required. + # @return [Array(String, [String, nil], Hash{String => String})] + # Uri, Body, Query string parameters + def self.transcode_get_iam_policy_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :post, + uri_template: "/v2/{resource}:getIamPolicy", + body: "*", + matches: [ + ["resource", %r{^organizations/[^/]+/sources/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the get_mute_config REST call + # + # @param request_pb [::Google::Cloud::SecurityCenter::V2::GetMuteConfigRequest] + # 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_mute_config_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :get, + uri_template: "/v2/{name}", + matches: [ + ["name", %r{^organizations/[^/]+/muteConfigs/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v2/{name}", + matches: [ + ["name", %r{^organizations/[^/]+/locations/[^/]+/muteConfigs/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v2/{name}", + matches: [ + ["name", %r{^folders/[^/]+/muteConfigs/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v2/{name}", + matches: [ + ["name", %r{^folders/[^/]+/locations/[^/]+/muteConfigs/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v2/{name}", + matches: [ + ["name", %r{^projects/[^/]+/muteConfigs/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v2/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/muteConfigs/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the get_notification_config REST call + # + # @param request_pb [::Google::Cloud::SecurityCenter::V2::GetNotificationConfigRequest] + # 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_notification_config_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :get, + uri_template: "/v2/{name}", + matches: [ + ["name", %r{^organizations/[^/]+/locations/[^/]+/notificationConfigs/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v2/{name}", + matches: [ + ["name", %r{^folders/[^/]+/locations/[^/]+/notificationConfigs/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v2/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/notificationConfigs/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the get_resource_value_config REST call + # + # @param request_pb [::Google::Cloud::SecurityCenter::V2::GetResourceValueConfigRequest] + # 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_resource_value_config_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :get, + uri_template: "/v2/{name}", + matches: [ + ["name", %r{^organizations/[^/]+/resourceValueConfigs/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v2/{name}", + matches: [ + ["name", %r{^organizations/[^/]+/locations/[^/]+/resourceValueConfigs/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the get_source REST call + # + # @param request_pb [::Google::Cloud::SecurityCenter::V2::GetSourceRequest] + # 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_source_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :get, + uri_template: "/v2/{name}", + matches: [ + ["name", %r{^organizations/[^/]+/sources/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the group_findings REST call + # + # @param request_pb [::Google::Cloud::SecurityCenter::V2::GroupFindingsRequest] + # A request object representing the call parameters. Required. + # @return [Array(String, [String, nil], Hash{String => String})] + # Uri, Body, Query string parameters + def self.transcode_group_findings_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :post, + uri_template: "/v2/{parent}/findings:group", + body: "*", + matches: [ + ["parent", %r{^organizations/[^/]+/sources/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v2/{parent}/findings:group", + body: "*", + matches: [ + ["parent", %r{^organizations/[^/]+/sources/[^/]+/locations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v2/{parent}/findings:group", + body: "*", + matches: [ + ["parent", %r{^folders/[^/]+/sources/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v2/{parent}/findings:group", + body: "*", + matches: [ + ["parent", %r{^folders/[^/]+/sources/[^/]+/locations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v2/{parent}/findings:group", + body: "*", + matches: [ + ["parent", %r{^projects/[^/]+/sources/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v2/{parent}/findings:group", + body: "*", + matches: [ + ["parent", %r{^projects/[^/]+/sources/[^/]+/locations/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the list_attack_paths REST call + # + # @param request_pb [::Google::Cloud::SecurityCenter::V2::ListAttackPathsRequest] + # 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_attack_paths_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :get, + uri_template: "/v2/{parent}/attackPaths", + matches: [ + ["parent", %r{^organizations/[^/]+/simulations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v2/{parent}/attackPaths", + matches: [ + ["parent", %r{^organizations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v2/{parent}/attackPaths", + matches: [ + ["parent", %r{^organizations/[^/]+/simulations/[^/]+/valuedResources/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v2/{parent}/attackPaths", + matches: [ + ["parent", %r{^organizations/[^/]+/locations/[^/]+/simulations/[^/]+/valuedResources/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v2/{parent}/attackPaths", + matches: [ + ["parent", %r{^organizations/[^/]+/simulations/[^/]+/attackExposureResults/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v2/{parent}/attackPaths", + matches: [ + ["parent", %r{^organizations/[^/]+/locations/[^/]+/simulations/[^/]+/attackExposureResults/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the list_big_query_exports REST call + # + # @param request_pb [::Google::Cloud::SecurityCenter::V2::ListBigQueryExportsRequest] + # 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_big_query_exports_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :get, + uri_template: "/v2/{parent}/bigQueryExports", + matches: [ + ["parent", %r{^organizations/[^/]+/locations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v2/{parent}/bigQueryExports", + matches: [ + ["parent", %r{^folders/[^/]+/locations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v2/{parent}/bigQueryExports", + matches: [ + ["parent", %r{^projects/[^/]+/locations/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the list_findings REST call + # + # @param request_pb [::Google::Cloud::SecurityCenter::V2::ListFindingsRequest] + # 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_findings_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :get, + uri_template: "/v2/{parent}/findings", + matches: [ + ["parent", %r{^organizations/[^/]+/sources/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v2/{parent}/findings", + matches: [ + ["parent", %r{^organizations/[^/]+/sources/[^/]+/locations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v2/{parent}/findings", + matches: [ + ["parent", %r{^folders/[^/]+/sources/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v2/{parent}/findings", + matches: [ + ["parent", %r{^folders/[^/]+/sources/[^/]+/locations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v2/{parent}/findings", + matches: [ + ["parent", %r{^projects/[^/]+/sources/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v2/{parent}/findings", + matches: [ + ["parent", %r{^projects/[^/]+/sources/[^/]+/locations/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the list_mute_configs REST call + # + # @param request_pb [::Google::Cloud::SecurityCenter::V2::ListMuteConfigsRequest] + # 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_mute_configs_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :get, + uri_template: "/v2/{parent}/muteConfigs", + matches: [ + ["parent", %r{^organizations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v2/{parent}/muteConfigs", + matches: [ + ["parent", %r{^organizations/[^/]+/locations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v2/{parent}/muteConfigs", + matches: [ + ["parent", %r{^folders/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v2/{parent}/muteConfigs", + matches: [ + ["parent", %r{^folders/[^/]+/locations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v2/{parent}/muteConfigs", + matches: [ + ["parent", %r{^projects/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v2/{parent}/muteConfigs", + matches: [ + ["parent", %r{^projects/[^/]+/locations/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the list_notification_configs REST call + # + # @param request_pb [::Google::Cloud::SecurityCenter::V2::ListNotificationConfigsRequest] + # 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_notification_configs_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :get, + uri_template: "/v2/{parent}/notificationConfigs", + matches: [ + ["parent", %r{^organizations/[^/]+/locations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v2/{parent}/notificationConfigs", + matches: [ + ["parent", %r{^folders/[^/]+/locations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v2/{parent}/notificationConfigs", + matches: [ + ["parent", %r{^projects/[^/]+/locations/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the list_resource_value_configs REST call + # + # @param request_pb [::Google::Cloud::SecurityCenter::V2::ListResourceValueConfigsRequest] + # 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_resource_value_configs_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :get, + uri_template: "/v2/{parent}/resourceValueConfigs", + matches: [ + ["parent", %r{^organizations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v2/{parent}/resourceValueConfigs", + matches: [ + ["parent", %r{^organizations/[^/]+/locations/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the list_sources REST call + # + # @param request_pb [::Google::Cloud::SecurityCenter::V2::ListSourcesRequest] + # 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_sources_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :get, + uri_template: "/v2/{parent}/sources", + matches: [ + ["parent", %r{^organizations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v2/{parent}/sources", + matches: [ + ["parent", %r{^folders/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v2/{parent}/sources", + matches: [ + ["parent", %r{^projects/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the list_valued_resources REST call + # + # @param request_pb [::Google::Cloud::SecurityCenter::V2::ListValuedResourcesRequest] + # 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_valued_resources_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :get, + uri_template: "/v2/{parent}/valuedResources", + matches: [ + ["parent", %r{^organizations/[^/]+/simulations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v2/{parent}/valuedResources", + matches: [ + ["parent", %r{^organizations/[^/]+/simulations/[^/]+/attackExposureResults/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v2/{parent}/valuedResources", + matches: [ + ["parent", %r{^organizations/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the set_finding_state REST call + # + # @param request_pb [::Google::Cloud::SecurityCenter::V2::SetFindingStateRequest] + # A request object representing the call parameters. Required. + # @return [Array(String, [String, nil], Hash{String => String})] + # Uri, Body, Query string parameters + def self.transcode_set_finding_state_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :post, + uri_template: "/v2/{name}:setState", + body: "*", + matches: [ + ["name", %r{^organizations/[^/]+/sources/[^/]+/findings/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v2/{name}:setState", + body: "*", + matches: [ + ["name", %r{^organizations/[^/]+/sources/[^/]+/locations/[^/]+/findings/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v2/{name}:setState", + body: "*", + matches: [ + ["name", %r{^folders/[^/]+/sources/[^/]+/findings/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v2/{name}:setState", + body: "*", + matches: [ + ["name", %r{^folders/[^/]+/sources/[^/]+/locations/[^/]+/findings/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v2/{name}:setState", + body: "*", + matches: [ + ["name", %r{^projects/[^/]+/sources/[^/]+/findings/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v2/{name}:setState", + body: "*", + matches: [ + ["name", %r{^projects/[^/]+/sources/[^/]+/locations/[^/]+/findings/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the set_iam_policy REST call + # + # @param request_pb [::Google::Iam::V1::SetIamPolicyRequest] + # A request object representing the call parameters. Required. + # @return [Array(String, [String, nil], Hash{String => String})] + # Uri, Body, Query string parameters + def self.transcode_set_iam_policy_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :post, + uri_template: "/v2/{resource}:setIamPolicy", + body: "*", + matches: [ + ["resource", %r{^organizations/[^/]+/sources/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the set_mute REST call + # + # @param request_pb [::Google::Cloud::SecurityCenter::V2::SetMuteRequest] + # A request object representing the call parameters. Required. + # @return [Array(String, [String, nil], Hash{String => String})] + # Uri, Body, Query string parameters + def self.transcode_set_mute_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :post, + uri_template: "/v2/{name}:setMute", + body: "*", + matches: [ + ["name", %r{^organizations/[^/]+/sources/[^/]+/findings/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v2/{name}:setMute", + body: "*", + matches: [ + ["name", %r{^organizations/[^/]+/sources/[^/]+/locations/[^/]+/findings/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v2/{name}:setMute", + body: "*", + matches: [ + ["name", %r{^folders/[^/]+/sources/[^/]+/findings/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v2/{name}:setMute", + body: "*", + matches: [ + ["name", %r{^folders/[^/]+/sources/[^/]+/locations/[^/]+/findings/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v2/{name}:setMute", + body: "*", + matches: [ + ["name", %r{^projects/[^/]+/sources/[^/]+/findings/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v2/{name}:setMute", + body: "*", + matches: [ + ["name", %r{^projects/[^/]+/sources/[^/]+/locations/[^/]+/findings/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the test_iam_permissions REST call + # + # @param request_pb [::Google::Iam::V1::TestIamPermissionsRequest] + # A request object representing the call parameters. Required. + # @return [Array(String, [String, nil], Hash{String => String})] + # Uri, Body, Query string parameters + def self.transcode_test_iam_permissions_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :post, + uri_template: "/v2/{resource}:testIamPermissions", + body: "*", + matches: [ + ["resource", %r{^organizations/[^/]+/sources/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the update_big_query_export REST call + # + # @param request_pb [::Google::Cloud::SecurityCenter::V2::UpdateBigQueryExportRequest] + # 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_big_query_export_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :patch, + uri_template: "/v2/{big_query_export.name}", + body: "big_query_export", + matches: [ + ["big_query_export.name", %r{^organizations/[^/]+/locations/[^/]+/bigQueryExports/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :patch, + uri_template: "/v2/{big_query_export.name}", + body: "big_query_export", + matches: [ + ["big_query_export.name", %r{^folders/[^/]+/locations/[^/]+/bigQueryExports/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :patch, + uri_template: "/v2/{big_query_export.name}", + body: "big_query_export", + matches: [ + ["big_query_export.name", %r{^projects/[^/]+/locations/[^/]+/bigQueryExports/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the update_external_system REST call + # + # @param request_pb [::Google::Cloud::SecurityCenter::V2::UpdateExternalSystemRequest] + # 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_external_system_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :patch, + uri_template: "/v2/{external_system.name}", + body: "external_system", + matches: [ + ["external_system.name", %r{^organizations/[^/]+/sources/[^/]+/findings/[^/]+/externalSystems/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :patch, + uri_template: "/v2/{external_system.name}", + body: "external_system", + matches: [ + ["external_system.name", %r{^organizations/[^/]+/sources/[^/]+/locations/[^/]+/findings/[^/]+/externalSystems/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :patch, + uri_template: "/v2/{external_system.name}", + body: "external_system", + matches: [ + ["external_system.name", %r{^folders/[^/]+/sources/[^/]+/findings/[^/]+/externalSystems/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :patch, + uri_template: "/v2/{external_system.name}", + body: "external_system", + matches: [ + ["external_system.name", %r{^folders/[^/]+/sources/[^/]+/locations/[^/]+/findings/[^/]+/externalSystems/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :patch, + uri_template: "/v2/{external_system.name}", + body: "external_system", + matches: [ + ["external_system.name", %r{^projects/[^/]+/sources/[^/]+/findings/[^/]+/externalSystems/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :patch, + uri_template: "/v2/{external_system.name}", + body: "external_system", + matches: [ + ["external_system.name", %r{^projects/[^/]+/sources/[^/]+/locations/[^/]+/findings/[^/]+/externalSystems/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the update_finding REST call + # + # @param request_pb [::Google::Cloud::SecurityCenter::V2::UpdateFindingRequest] + # 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_finding_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :patch, + uri_template: "/v2/{finding.name}", + body: "finding", + matches: [ + ["finding.name", %r{^organizations/[^/]+/sources/[^/]+/findings/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :patch, + uri_template: "/v2/{finding.name}", + body: "finding", + matches: [ + ["finding.name", %r{^organizations/[^/]+/sources/[^/]+/locations/[^/]+/findings/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :patch, + uri_template: "/v2/{finding.name}", + body: "finding", + matches: [ + ["finding.name", %r{^folders/[^/]+/sources/[^/]+/findings/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :patch, + uri_template: "/v2/{finding.name}", + body: "finding", + matches: [ + ["finding.name", %r{^folders/[^/]+/sources/[^/]+/locations/[^/]+/findings/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :patch, + uri_template: "/v2/{finding.name}", + body: "finding", + matches: [ + ["finding.name", %r{^projects/[^/]+/sources/[^/]+/findings/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :patch, + uri_template: "/v2/{finding.name}", + body: "finding", + matches: [ + ["finding.name", %r{^projects/[^/]+/sources/[^/]+/locations/[^/]+/findings/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the update_mute_config REST call + # + # @param request_pb [::Google::Cloud::SecurityCenter::V2::UpdateMuteConfigRequest] + # 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_mute_config_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :patch, + uri_template: "/v2/{mute_config.name}", + body: "mute_config", + matches: [ + ["mute_config.name", %r{^organizations/[^/]+/muteConfigs/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :patch, + uri_template: "/v2/{mute_config.name}", + body: "mute_config", + matches: [ + ["mute_config.name", %r{^organizations/[^/]+/locations/[^/]+/muteConfigs/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :patch, + uri_template: "/v2/{mute_config.name}", + body: "mute_config", + matches: [ + ["mute_config.name", %r{^folders/[^/]+/muteConfigs/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :patch, + uri_template: "/v2/{mute_config.name}", + body: "mute_config", + matches: [ + ["mute_config.name", %r{^folders/[^/]+/locations/[^/]+/muteConfigs/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :patch, + uri_template: "/v2/{mute_config.name}", + body: "mute_config", + matches: [ + ["mute_config.name", %r{^projects/[^/]+/muteConfigs/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :patch, + uri_template: "/v2/{mute_config.name}", + body: "mute_config", + matches: [ + ["mute_config.name", %r{^projects/[^/]+/locations/[^/]+/muteConfigs/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the update_notification_config REST call + # + # @param request_pb [::Google::Cloud::SecurityCenter::V2::UpdateNotificationConfigRequest] + # 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_notification_config_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :patch, + uri_template: "/v2/{notification_config.name}", + body: "notification_config", + matches: [ + ["notification_config.name", %r{^organizations/[^/]+/locations/[^/]+/notificationConfigs/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :patch, + uri_template: "/v2/{notification_config.name}", + body: "notification_config", + matches: [ + ["notification_config.name", %r{^folders/[^/]+/locations/[^/]+/notificationConfigs/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :patch, + uri_template: "/v2/{notification_config.name}", + body: "notification_config", + matches: [ + ["notification_config.name", %r{^projects/[^/]+/locations/[^/]+/notificationConfigs/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the update_resource_value_config REST call + # + # @param request_pb [::Google::Cloud::SecurityCenter::V2::UpdateResourceValueConfigRequest] + # 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_resource_value_config_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :patch, + uri_template: "/v2/{resource_value_config.name}", + body: "resource_value_config", + matches: [ + ["resource_value_config.name", %r{^organizations/[^/]+/resourceValueConfigs/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :patch, + uri_template: "/v2/{resource_value_config.name}", + body: "resource_value_config", + matches: [ + ["resource_value_config.name", %r{^organizations/[^/]+/locations/[^/]+/resourceValueConfigs/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the update_security_marks REST call + # + # @param request_pb [::Google::Cloud::SecurityCenter::V2::UpdateSecurityMarksRequest] + # 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_security_marks_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :patch, + uri_template: "/v2/{security_marks.name}", + body: "security_marks", + matches: [ + ["security_marks.name", %r{^organizations/[^/]+/sources/[^/]+/findings/[^/]+/securityMarks/?$}, false] + ] + ) + .with_bindings( + uri_method: :patch, + uri_template: "/v2/{security_marks.name}", + body: "security_marks", + matches: [ + ["security_marks.name", %r{^organizations/[^/]+/assets/[^/]+/securityMarks/?$}, false] + ] + ) + .with_bindings( + uri_method: :patch, + uri_template: "/v2/{security_marks.name}", + body: "security_marks", + matches: [ + ["security_marks.name", %r{^organizations/[^/]+/sources/[^/]+/locations/[^/]+/findings/[^/]+/securityMarks/?$}, false] + ] + ) + .with_bindings( + uri_method: :patch, + uri_template: "/v2/{security_marks.name}", + body: "security_marks", + matches: [ + ["security_marks.name", %r{^folders/[^/]+/sources/[^/]+/findings/[^/]+/securityMarks/?$}, false] + ] + ) + .with_bindings( + uri_method: :patch, + uri_template: "/v2/{security_marks.name}", + body: "security_marks", + matches: [ + ["security_marks.name", %r{^folders/[^/]+/assets/[^/]+/securityMarks/?$}, false] + ] + ) + .with_bindings( + uri_method: :patch, + uri_template: "/v2/{security_marks.name}", + body: "security_marks", + matches: [ + ["security_marks.name", %r{^folders/[^/]+/sources/[^/]+/locations/[^/]+/findings/[^/]+/securityMarks/?$}, false] + ] + ) + .with_bindings( + uri_method: :patch, + uri_template: "/v2/{security_marks.name}", + body: "security_marks", + matches: [ + ["security_marks.name", %r{^projects/[^/]+/sources/[^/]+/findings/[^/]+/securityMarks/?$}, false] + ] + ) + .with_bindings( + uri_method: :patch, + uri_template: "/v2/{security_marks.name}", + body: "security_marks", + matches: [ + ["security_marks.name", %r{^projects/[^/]+/assets/[^/]+/securityMarks/?$}, false] + ] + ) + .with_bindings( + uri_method: :patch, + uri_template: "/v2/{security_marks.name}", + body: "security_marks", + matches: [ + ["security_marks.name", %r{^projects/[^/]+/sources/[^/]+/locations/[^/]+/findings/[^/]+/securityMarks/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the update_source REST call + # + # @param request_pb [::Google::Cloud::SecurityCenter::V2::UpdateSourceRequest] + # 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_source_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :patch, + uri_template: "/v2/{source.name}", + body: "source", + matches: [ + ["source.name", %r{^organizations/[^/]+/sources/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + end + end + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-security_center-v2/lib/google/cloud/security_center/v2/version.rb b/owl-bot-staging/google-cloud-security_center-v2/lib/google/cloud/security_center/v2/version.rb new file mode 100644 index 000000000000..543e0946f0de --- /dev/null +++ b/owl-bot-staging/google-cloud-security_center-v2/lib/google/cloud/security_center/v2/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 SecurityCenter + module V2 + VERSION = "0.0.1" + end + end + end +end diff --git a/owl-bot-staging/google-cloud-security_center-v2/lib/google/cloud/securitycenter/v2/access_pb.rb b/owl-bot-staging/google-cloud-security_center-v2/lib/google/cloud/securitycenter/v2/access_pb.rb new file mode 100644 index 000000000000..626f8a57d25d --- /dev/null +++ b/owl-bot-staging/google-cloud-security_center-v2/lib/google/cloud/securitycenter/v2/access_pb.rb @@ -0,0 +1,23 @@ +# frozen_string_literal: true +# Generated by the protocol buffer compiler. DO NOT EDIT! +# source: google/cloud/securitycenter/v2/access.proto + +require 'google/protobuf' + + +descriptor_data = "\n+google/cloud/securitycenter/v2/access.proto\x12\x1egoogle.cloud.securitycenter.v2\"\x89\x03\n\x06\x41\x63\x63\x65ss\x12\x17\n\x0fprincipal_email\x18\x01 \x01(\t\x12\x11\n\tcaller_ip\x18\x02 \x01(\t\x12\x42\n\rcaller_ip_geo\x18\x03 \x01(\x0b\x32+.google.cloud.securitycenter.v2.Geolocation\x12\x19\n\x11user_agent_family\x18\x04 \x01(\t\x12\x12\n\nuser_agent\x18\x05 \x01(\t\x12\x14\n\x0cservice_name\x18\x06 \x01(\t\x12\x13\n\x0bmethod_name\x18\x07 \x01(\t\x12\x19\n\x11principal_subject\x18\x08 \x01(\t\x12 \n\x18service_account_key_name\x18\t \x01(\t\x12\x65\n\x1fservice_account_delegation_info\x18\n \x03(\x0b\x32<.google.cloud.securitycenter.v2.ServiceAccountDelegationInfo\x12\x11\n\tuser_name\x18\x0b \x01(\t\"R\n\x1cServiceAccountDelegationInfo\x12\x17\n\x0fprincipal_email\x18\x01 \x01(\t\x12\x19\n\x11principal_subject\x18\x02 \x01(\t\"\"\n\x0bGeolocation\x12\x13\n\x0bregion_code\x18\x01 \x01(\tB\xe5\x01\n\"com.google.cloud.securitycenter.v2B\x0b\x41\x63\x63\x65ssProtoP\x01ZJcloud.google.com/go/securitycenter/apiv2/securitycenterpb;securitycenterpb\xaa\x02\x1eGoogle.Cloud.SecurityCenter.V2\xca\x02\x1eGoogle\\Cloud\\SecurityCenter\\V2\xea\x02!Google::Cloud::SecurityCenter::V2b\x06proto3" + +pool = ::Google::Protobuf::DescriptorPool.generated_pool +pool.add_serialized_file(descriptor_data) + +module Google + module Cloud + module SecurityCenter + module V2 + Access = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.securitycenter.v2.Access").msgclass + ServiceAccountDelegationInfo = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.securitycenter.v2.ServiceAccountDelegationInfo").msgclass + Geolocation = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.securitycenter.v2.Geolocation").msgclass + end + end + end +end diff --git a/owl-bot-staging/google-cloud-security_center-v2/lib/google/cloud/securitycenter/v2/affected_resources_pb.rb b/owl-bot-staging/google-cloud-security_center-v2/lib/google/cloud/securitycenter/v2/affected_resources_pb.rb new file mode 100644 index 000000000000..b2ded5cca4eb --- /dev/null +++ b/owl-bot-staging/google-cloud-security_center-v2/lib/google/cloud/securitycenter/v2/affected_resources_pb.rb @@ -0,0 +1,21 @@ +# frozen_string_literal: true +# Generated by the protocol buffer compiler. DO NOT EDIT! +# source: google/cloud/securitycenter/v2/affected_resources.proto + +require 'google/protobuf' + + +descriptor_data = "\n7google/cloud/securitycenter/v2/affected_resources.proto\x12\x1egoogle.cloud.securitycenter.v2\"\"\n\x11\x41\x66\x66\x65\x63tedResources\x12\r\n\x05\x63ount\x18\x01 \x01(\x03\x42\xf0\x01\n\"com.google.cloud.securitycenter.v2B\x16\x41\x66\x66\x65\x63tedResourcesProtoP\x01ZJcloud.google.com/go/securitycenter/apiv2/securitycenterpb;securitycenterpb\xaa\x02\x1eGoogle.Cloud.SecurityCenter.V2\xca\x02\x1eGoogle\\Cloud\\SecurityCenter\\V2\xea\x02!Google::Cloud::SecurityCenter::V2b\x06proto3" + +pool = ::Google::Protobuf::DescriptorPool.generated_pool +pool.add_serialized_file(descriptor_data) + +module Google + module Cloud + module SecurityCenter + module V2 + AffectedResources = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.securitycenter.v2.AffectedResources").msgclass + end + end + end +end diff --git a/owl-bot-staging/google-cloud-security_center-v2/lib/google/cloud/securitycenter/v2/ai_model_pb.rb b/owl-bot-staging/google-cloud-security_center-v2/lib/google/cloud/securitycenter/v2/ai_model_pb.rb new file mode 100644 index 000000000000..e0d357ddd795 --- /dev/null +++ b/owl-bot-staging/google-cloud-security_center-v2/lib/google/cloud/securitycenter/v2/ai_model_pb.rb @@ -0,0 +1,22 @@ +# frozen_string_literal: true +# Generated by the protocol buffer compiler. DO NOT EDIT! +# source: google/cloud/securitycenter/v2/ai_model.proto + +require 'google/protobuf' + + +descriptor_data = "\n-google/cloud/securitycenter/v2/ai_model.proto\x12\x1egoogle.cloud.securitycenter.v2\"\xbe\x02\n\x07\x41iModel\x12\x0c\n\x04name\x18\x01 \x01(\t\x12\x0e\n\x06\x64omain\x18\x02 \x01(\t\x12\x0f\n\x07library\x18\x03 \x01(\t\x12\x10\n\x08location\x18\x04 \x01(\t\x12\x11\n\tpublisher\x18\x05 \x01(\t\x12W\n\x13\x64\x65ployment_platform\x18\x06 \x01(\x0e\x32:.google.cloud.securitycenter.v2.AiModel.DeploymentPlatform\x12\x14\n\x0c\x64isplay_name\x18\x07 \x01(\t\"p\n\x12\x44\x65ploymentPlatform\x12#\n\x1f\x44\x45PLOYMENT_PLATFORM_UNSPECIFIED\x10\x00\x12\r\n\tVERTEX_AI\x10\x01\x12\x07\n\x03GKE\x10\x02\x12\x07\n\x03GCE\x10\x03\x12\x14\n\x10\x46INE_TUNED_MODEL\x10\x04\x42\xe6\x01\n\"com.google.cloud.securitycenter.v2B\x0c\x41iModelProtoP\x01ZJcloud.google.com/go/securitycenter/apiv2/securitycenterpb;securitycenterpb\xaa\x02\x1eGoogle.Cloud.SecurityCenter.V2\xca\x02\x1eGoogle\\Cloud\\SecurityCenter\\V2\xea\x02!Google::Cloud::SecurityCenter::V2b\x06proto3" + +pool = ::Google::Protobuf::DescriptorPool.generated_pool +pool.add_serialized_file(descriptor_data) + +module Google + module Cloud + module SecurityCenter + module V2 + AiModel = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.securitycenter.v2.AiModel").msgclass + AiModel::DeploymentPlatform = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.securitycenter.v2.AiModel.DeploymentPlatform").enummodule + end + end + end +end diff --git a/owl-bot-staging/google-cloud-security_center-v2/lib/google/cloud/securitycenter/v2/application_pb.rb b/owl-bot-staging/google-cloud-security_center-v2/lib/google/cloud/securitycenter/v2/application_pb.rb new file mode 100644 index 000000000000..3adcac6a59b9 --- /dev/null +++ b/owl-bot-staging/google-cloud-security_center-v2/lib/google/cloud/securitycenter/v2/application_pb.rb @@ -0,0 +1,21 @@ +# frozen_string_literal: true +# Generated by the protocol buffer compiler. DO NOT EDIT! +# source: google/cloud/securitycenter/v2/application.proto + +require 'google/protobuf' + + +descriptor_data = "\n0google/cloud/securitycenter/v2/application.proto\x12\x1egoogle.cloud.securitycenter.v2\"1\n\x0b\x41pplication\x12\x10\n\x08\x62\x61se_uri\x18\x01 \x01(\t\x12\x10\n\x08\x66ull_uri\x18\x02 \x01(\tB\xea\x01\n\"com.google.cloud.securitycenter.v2B\x10\x41pplicationProtoP\x01ZJcloud.google.com/go/securitycenter/apiv2/securitycenterpb;securitycenterpb\xaa\x02\x1eGoogle.Cloud.SecurityCenter.V2\xca\x02\x1eGoogle\\Cloud\\SecurityCenter\\V2\xea\x02!Google::Cloud::SecurityCenter::V2b\x06proto3" + +pool = ::Google::Protobuf::DescriptorPool.generated_pool +pool.add_serialized_file(descriptor_data) + +module Google + module Cloud + module SecurityCenter + module V2 + Application = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.securitycenter.v2.Application").msgclass + end + end + end +end diff --git a/owl-bot-staging/google-cloud-security_center-v2/lib/google/cloud/securitycenter/v2/attack_exposure_pb.rb b/owl-bot-staging/google-cloud-security_center-v2/lib/google/cloud/securitycenter/v2/attack_exposure_pb.rb new file mode 100644 index 000000000000..2455e60ba1f7 --- /dev/null +++ b/owl-bot-staging/google-cloud-security_center-v2/lib/google/cloud/securitycenter/v2/attack_exposure_pb.rb @@ -0,0 +1,25 @@ +# frozen_string_literal: true +# Generated by the protocol buffer compiler. DO NOT EDIT! +# source: google/cloud/securitycenter/v2/attack_exposure.proto + +require 'google/protobuf' + +require 'google/api/field_behavior_pb' +require 'google/protobuf/timestamp_pb' + + +descriptor_data = "\n4google/cloud/securitycenter/v2/attack_exposure.proto\x12\x1egoogle.cloud.securitycenter.v2\x1a\x1fgoogle/api/field_behavior.proto\x1a\x1fgoogle/protobuf/timestamp.proto\"\x8f\x03\n\x0e\x41ttackExposure\x12\r\n\x05score\x18\x01 \x01(\x01\x12;\n\x17latest_calculation_time\x18\x02 \x01(\x0b\x32\x1a.google.protobuf.Timestamp\x12\x1e\n\x16\x61ttack_exposure_result\x18\x03 \x01(\t\x12H\n\x05state\x18\x04 \x01(\x0e\x32\x34.google.cloud.securitycenter.v2.AttackExposure.StateB\x03\xe0\x41\x03\x12*\n\"exposed_high_value_resources_count\x18\x05 \x01(\x05\x12,\n$exposed_medium_value_resources_count\x18\x06 \x01(\x05\x12)\n!exposed_low_value_resources_count\x18\x07 \x01(\x05\"B\n\x05State\x12\x15\n\x11STATE_UNSPECIFIED\x10\x00\x12\x0e\n\nCALCULATED\x10\x01\x12\x12\n\x0eNOT_CALCULATED\x10\x02\x42\xed\x01\n\"com.google.cloud.securitycenter.v2B\x13\x41ttackExposureProtoP\x01ZJcloud.google.com/go/securitycenter/apiv2/securitycenterpb;securitycenterpb\xaa\x02\x1eGoogle.Cloud.SecurityCenter.V2\xca\x02\x1eGoogle\\Cloud\\SecurityCenter\\V2\xea\x02!Google::Cloud::SecurityCenter::V2b\x06proto3" + +pool = ::Google::Protobuf::DescriptorPool.generated_pool +pool.add_serialized_file(descriptor_data) + +module Google + module Cloud + module SecurityCenter + module V2 + AttackExposure = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.securitycenter.v2.AttackExposure").msgclass + AttackExposure::State = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.securitycenter.v2.AttackExposure.State").enummodule + end + end + end +end diff --git a/owl-bot-staging/google-cloud-security_center-v2/lib/google/cloud/securitycenter/v2/attack_path_pb.rb b/owl-bot-staging/google-cloud-security_center-v2/lib/google/cloud/securitycenter/v2/attack_path_pb.rb new file mode 100644 index 000000000000..29d28dc5bf3c --- /dev/null +++ b/owl-bot-staging/google-cloud-security_center-v2/lib/google/cloud/securitycenter/v2/attack_path_pb.rb @@ -0,0 +1,28 @@ +# frozen_string_literal: true +# Generated by the protocol buffer compiler. DO NOT EDIT! +# source: google/cloud/securitycenter/v2/attack_path.proto + +require 'google/protobuf' + +require 'google/api/resource_pb' + + +descriptor_data = "\n0google/cloud/securitycenter/v2/attack_path.proto\x12\x1egoogle.cloud.securitycenter.v2\x1a\x19google/api/resource.proto\"\xf0\n\n\nAttackPath\x12\x0c\n\x04name\x18\x01 \x01(\t\x12M\n\npath_nodes\x18\x02 \x03(\x0b\x32\x39.google.cloud.securitycenter.v2.AttackPath.AttackPathNode\x12H\n\x05\x65\x64ges\x18\x03 \x03(\x0b\x32\x39.google.cloud.securitycenter.v2.AttackPath.AttackPathEdge\x1a\xbd\x06\n\x0e\x41ttackPathNode\x12\x10\n\x08resource\x18\x01 \x01(\t\x12\x15\n\rresource_type\x18\x02 \x01(\t\x12\x14\n\x0c\x64isplay_name\x18\x03 \x01(\t\x12p\n\x13\x61ssociated_findings\x18\x04 \x03(\x0b\x32S.google.cloud.securitycenter.v2.AttackPath.AttackPathNode.PathNodeAssociatedFinding\x12\x0c\n\x04uuid\x18\x05 \x01(\t\x12^\n\x0c\x61ttack_steps\x18\x06 \x03(\x0b\x32H.google.cloud.securitycenter.v2.AttackPath.AttackPathNode.AttackStepNode\x1a^\n\x19PathNodeAssociatedFinding\x12\x19\n\x11\x63\x61nonical_finding\x18\x01 \x01(\t\x12\x18\n\x10\x66inding_category\x18\x02 \x01(\t\x12\x0c\n\x04name\x18\x03 \x01(\t\x1a\xb0\x02\n\x0e\x41ttackStepNode\x12\x0c\n\x04uuid\x18\x01 \x01(\t\x12P\n\x04type\x18\x02 \x01(\x0e\x32\x42.google.cloud.securitycenter.v2.AttackPath.AttackPathNode.NodeType\x12\x14\n\x0c\x64isplay_name\x18\x03 \x01(\t\x12\x64\n\x06labels\x18\x04 \x03(\x0b\x32T.google.cloud.securitycenter.v2.AttackPath.AttackPathNode.AttackStepNode.LabelsEntry\x12\x13\n\x0b\x64\x65scription\x18\x05 \x01(\t\x1a-\n\x0bLabelsEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12\r\n\x05value\x18\x02 \x01(\t:\x02\x38\x01\"y\n\x08NodeType\x12\x19\n\x15NODE_TYPE_UNSPECIFIED\x10\x00\x12\x11\n\rNODE_TYPE_AND\x10\x01\x12\x10\n\x0cNODE_TYPE_OR\x10\x02\x12\x15\n\x11NODE_TYPE_DEFENSE\x10\x03\x12\x16\n\x12NODE_TYPE_ATTACKER\x10\x04\x1a\x35\n\x0e\x41ttackPathEdge\x12\x0e\n\x06source\x18\x01 \x01(\t\x12\x13\n\x0b\x64\x65stination\x18\x02 \x01(\t:\xc3\x02\xea\x41\xbf\x02\n(securitycenter.googleapis.com/AttackPath\x12qorganizations/{organization}/simulations/{simulation}/valuedResources/{valued_resource}/attackPaths/{attack_path}\x12\x86\x01organizations/{organization}/locations/{location}/simulations/{simulation}/valuedResources/{valued_resource}/attackPaths/{attack_path}*\x0b\x61ttackPaths2\nattackPathB\xe9\x01\n\"com.google.cloud.securitycenter.v2B\x0f\x41ttackPathProtoP\x01ZJcloud.google.com/go/securitycenter/apiv2/securitycenterpb;securitycenterpb\xaa\x02\x1eGoogle.Cloud.SecurityCenter.V2\xca\x02\x1eGoogle\\Cloud\\SecurityCenter\\V2\xea\x02!Google::Cloud::SecurityCenter::V2b\x06proto3" + +pool = ::Google::Protobuf::DescriptorPool.generated_pool +pool.add_serialized_file(descriptor_data) + +module Google + module Cloud + module SecurityCenter + module V2 + AttackPath = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.securitycenter.v2.AttackPath").msgclass + AttackPath::AttackPathNode = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.securitycenter.v2.AttackPath.AttackPathNode").msgclass + AttackPath::AttackPathNode::PathNodeAssociatedFinding = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.securitycenter.v2.AttackPath.AttackPathNode.PathNodeAssociatedFinding").msgclass + AttackPath::AttackPathNode::AttackStepNode = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.securitycenter.v2.AttackPath.AttackPathNode.AttackStepNode").msgclass + AttackPath::AttackPathNode::NodeType = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.securitycenter.v2.AttackPath.AttackPathNode.NodeType").enummodule + AttackPath::AttackPathEdge = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.securitycenter.v2.AttackPath.AttackPathEdge").msgclass + end + end + end +end diff --git a/owl-bot-staging/google-cloud-security_center-v2/lib/google/cloud/securitycenter/v2/backup_disaster_recovery_pb.rb b/owl-bot-staging/google-cloud-security_center-v2/lib/google/cloud/securitycenter/v2/backup_disaster_recovery_pb.rb new file mode 100644 index 000000000000..1d0185074970 --- /dev/null +++ b/owl-bot-staging/google-cloud-security_center-v2/lib/google/cloud/securitycenter/v2/backup_disaster_recovery_pb.rb @@ -0,0 +1,23 @@ +# frozen_string_literal: true +# Generated by the protocol buffer compiler. DO NOT EDIT! +# source: google/cloud/securitycenter/v2/backup_disaster_recovery.proto + +require 'google/protobuf' + +require 'google/protobuf/timestamp_pb' + + +descriptor_data = "\n=google/cloud/securitycenter/v2/backup_disaster_recovery.proto\x12\x1egoogle.cloud.securitycenter.v2\x1a\x1fgoogle/protobuf/timestamp.proto\"\x86\x02\n\x16\x42\x61\x63kupDisasterRecovery\x12\x17\n\x0f\x62\x61\x63kup_template\x18\x01 \x01(\t\x12\x10\n\x08policies\x18\x02 \x03(\t\x12\x0c\n\x04host\x18\x03 \x01(\t\x12\x14\n\x0c\x61pplications\x18\x04 \x03(\t\x12\x14\n\x0cstorage_pool\x18\x05 \x01(\t\x12\x16\n\x0epolicy_options\x18\x06 \x03(\t\x12\x0f\n\x07profile\x18\x07 \x01(\t\x12\x11\n\tappliance\x18\x08 \x01(\t\x12\x13\n\x0b\x62\x61\x63kup_type\x18\t \x01(\t\x12\x36\n\x12\x62\x61\x63kup_create_time\x18\n \x01(\x0b\x32\x1a.google.protobuf.TimestampB\xf5\x01\n\"com.google.cloud.securitycenter.v2B\x1b\x42\x61\x63kupDisasterRecoveryProtoP\x01ZJcloud.google.com/go/securitycenter/apiv2/securitycenterpb;securitycenterpb\xaa\x02\x1eGoogle.Cloud.SecurityCenter.V2\xca\x02\x1eGoogle\\Cloud\\SecurityCenter\\V2\xea\x02!Google::Cloud::SecurityCenter::V2b\x06proto3" + +pool = ::Google::Protobuf::DescriptorPool.generated_pool +pool.add_serialized_file(descriptor_data) + +module Google + module Cloud + module SecurityCenter + module V2 + BackupDisasterRecovery = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.securitycenter.v2.BackupDisasterRecovery").msgclass + end + end + end +end diff --git a/owl-bot-staging/google-cloud-security_center-v2/lib/google/cloud/securitycenter/v2/bigquery_export_pb.rb b/owl-bot-staging/google-cloud-security_center-v2/lib/google/cloud/securitycenter/v2/bigquery_export_pb.rb new file mode 100644 index 000000000000..c0ea27ff0b00 --- /dev/null +++ b/owl-bot-staging/google-cloud-security_center-v2/lib/google/cloud/securitycenter/v2/bigquery_export_pb.rb @@ -0,0 +1,25 @@ +# frozen_string_literal: true +# Generated by the protocol buffer compiler. DO NOT EDIT! +# source: google/cloud/securitycenter/v2/bigquery_export.proto + +require 'google/protobuf' + +require 'google/api/field_behavior_pb' +require 'google/api/resource_pb' +require 'google/protobuf/timestamp_pb' + + +descriptor_data = "\n4google/cloud/securitycenter/v2/bigquery_export.proto\x12\x1egoogle.cloud.securitycenter.v2\x1a\x1fgoogle/api/field_behavior.proto\x1a\x19google/api/resource.proto\x1a\x1fgoogle/protobuf/timestamp.proto\"\xa2\x04\n\x0e\x42igQueryExport\x12\x11\n\x04name\x18\x01 \x01(\tB\x03\xe0\x41\x08\x12\x13\n\x0b\x64\x65scription\x18\x02 \x01(\t\x12\x0e\n\x06\x66ilter\x18\x03 \x01(\t\x12\x0f\n\x07\x64\x61taset\x18\x04 \x01(\t\x12\x34\n\x0b\x63reate_time\x18\x05 \x01(\x0b\x32\x1a.google.protobuf.TimestampB\x03\xe0\x41\x03\x12\x34\n\x0bupdate_time\x18\x06 \x01(\x0b\x32\x1a.google.protobuf.TimestampB\x03\xe0\x41\x03\x12\x1f\n\x12most_recent_editor\x18\x07 \x01(\tB\x03\xe0\x41\x03\x12\x16\n\tprincipal\x18\x08 \x01(\tB\x03\xe0\x41\x03:\xa1\x02\xea\x41\x9d\x02\n,securitycenter.googleapis.com/BigQueryExport\x12Jorganizations/{organization}/locations/{location}/bigQueryExports/{export}\x12>folders/{folder}/locations/{location}/bigQueryExports/{export}\x12@projects/{project}/locations/{location}/bigQueryExports/{export}*\x0f\x62igQueryExports2\x0e\x62igQueryExportB\xed\x01\n\"com.google.cloud.securitycenter.v2B\x13\x42igQueryExportProtoP\x01ZJcloud.google.com/go/securitycenter/apiv2/securitycenterpb;securitycenterpb\xaa\x02\x1eGoogle.Cloud.SecurityCenter.V2\xca\x02\x1eGoogle\\Cloud\\SecurityCenter\\V2\xea\x02!Google::Cloud::SecurityCenter::V2b\x06proto3" + +pool = ::Google::Protobuf::DescriptorPool.generated_pool +pool.add_serialized_file(descriptor_data) + +module Google + module Cloud + module SecurityCenter + module V2 + BigQueryExport = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.securitycenter.v2.BigQueryExport").msgclass + end + end + end +end diff --git a/owl-bot-staging/google-cloud-security_center-v2/lib/google/cloud/securitycenter/v2/chokepoint_pb.rb b/owl-bot-staging/google-cloud-security_center-v2/lib/google/cloud/securitycenter/v2/chokepoint_pb.rb new file mode 100644 index 000000000000..077e14997c90 --- /dev/null +++ b/owl-bot-staging/google-cloud-security_center-v2/lib/google/cloud/securitycenter/v2/chokepoint_pb.rb @@ -0,0 +1,21 @@ +# frozen_string_literal: true +# Generated by the protocol buffer compiler. DO NOT EDIT! +# source: google/cloud/securitycenter/v2/chokepoint.proto + +require 'google/protobuf' + + +descriptor_data = "\n/google/cloud/securitycenter/v2/chokepoint.proto\x12\x1egoogle.cloud.securitycenter.v2\"&\n\nChokepoint\x12\x18\n\x10related_findings\x18\x01 \x03(\tB\xe9\x01\n\"com.google.cloud.securitycenter.v2B\x0f\x43hokepointProtoP\x01ZJcloud.google.com/go/securitycenter/apiv2/securitycenterpb;securitycenterpb\xaa\x02\x1eGoogle.Cloud.SecurityCenter.V2\xca\x02\x1eGoogle\\Cloud\\SecurityCenter\\V2\xea\x02!Google::Cloud::SecurityCenter::V2b\x06proto3" + +pool = ::Google::Protobuf::DescriptorPool.generated_pool +pool.add_serialized_file(descriptor_data) + +module Google + module Cloud + module SecurityCenter + module V2 + Chokepoint = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.securitycenter.v2.Chokepoint").msgclass + end + end + end +end diff --git a/owl-bot-staging/google-cloud-security_center-v2/lib/google/cloud/securitycenter/v2/cloud_armor_pb.rb b/owl-bot-staging/google-cloud-security_center-v2/lib/google/cloud/securitycenter/v2/cloud_armor_pb.rb new file mode 100644 index 000000000000..6cd7e16d09a3 --- /dev/null +++ b/owl-bot-staging/google-cloud-security_center-v2/lib/google/cloud/securitycenter/v2/cloud_armor_pb.rb @@ -0,0 +1,27 @@ +# frozen_string_literal: true +# Generated by the protocol buffer compiler. DO NOT EDIT! +# source: google/cloud/securitycenter/v2/cloud_armor.proto + +require 'google/protobuf' + +require 'google/protobuf/duration_pb' + + +descriptor_data = "\n0google/cloud/securitycenter/v2/cloud_armor.proto\x12\x1egoogle.cloud.securitycenter.v2\x1a\x1egoogle/protobuf/duration.proto\"\xde\x02\n\nCloudArmor\x12G\n\x0fsecurity_policy\x18\x01 \x01(\x0b\x32..google.cloud.securitycenter.v2.SecurityPolicy\x12:\n\x08requests\x18\x02 \x01(\x0b\x32(.google.cloud.securitycenter.v2.Requests\x12O\n\x13\x61\x64\x61ptive_protection\x18\x03 \x01(\x0b\x32\x32.google.cloud.securitycenter.v2.AdaptiveProtection\x12\x36\n\x06\x61ttack\x18\x04 \x01(\x0b\x32&.google.cloud.securitycenter.v2.Attack\x12\x15\n\rthreat_vector\x18\x05 \x01(\t\x12+\n\x08\x64uration\x18\x06 \x01(\x0b\x32\x19.google.protobuf.Duration\"=\n\x0eSecurityPolicy\x12\x0c\n\x04name\x18\x01 \x01(\t\x12\x0c\n\x04type\x18\x02 \x01(\t\x12\x0f\n\x07preview\x18\x03 \x01(\x08\"j\n\x08Requests\x12\r\n\x05ratio\x18\x01 \x01(\x01\x12\x1a\n\x12short_term_allowed\x18\x02 \x01(\x05\x12\x19\n\x11long_term_allowed\x18\x03 \x01(\x05\x12\x18\n\x10long_term_denied\x18\x04 \x01(\x05\"(\n\x12\x41\x64\x61ptiveProtection\x12\x12\n\nconfidence\x18\x01 \x01(\x01\"\x82\x01\n\x06\x41ttack\x12\x17\n\x0fvolume_pps_long\x18\x04 \x01(\x03\x12\x17\n\x0fvolume_bps_long\x18\x05 \x01(\x03\x12\x16\n\x0e\x63lassification\x18\x03 \x01(\t\x12\x16\n\nvolume_pps\x18\x01 \x01(\x05\x42\x02\x18\x01\x12\x16\n\nvolume_bps\x18\x02 \x01(\x05\x42\x02\x18\x01\x42\xe9\x01\n\"com.google.cloud.securitycenter.v2B\x0f\x43loudArmorProtoP\x01ZJcloud.google.com/go/securitycenter/apiv2/securitycenterpb;securitycenterpb\xaa\x02\x1eGoogle.Cloud.SecurityCenter.V2\xca\x02\x1eGoogle\\Cloud\\SecurityCenter\\V2\xea\x02!Google::Cloud::SecurityCenter::V2b\x06proto3" + +pool = ::Google::Protobuf::DescriptorPool.generated_pool +pool.add_serialized_file(descriptor_data) + +module Google + module Cloud + module SecurityCenter + module V2 + CloudArmor = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.securitycenter.v2.CloudArmor").msgclass + SecurityPolicy = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.securitycenter.v2.SecurityPolicy").msgclass + Requests = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.securitycenter.v2.Requests").msgclass + AdaptiveProtection = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.securitycenter.v2.AdaptiveProtection").msgclass + Attack = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.securitycenter.v2.Attack").msgclass + end + end + end +end diff --git a/owl-bot-staging/google-cloud-security_center-v2/lib/google/cloud/securitycenter/v2/cloud_dlp_data_profile_pb.rb b/owl-bot-staging/google-cloud-security_center-v2/lib/google/cloud/securitycenter/v2/cloud_dlp_data_profile_pb.rb new file mode 100644 index 000000000000..388023feb3f9 --- /dev/null +++ b/owl-bot-staging/google-cloud-security_center-v2/lib/google/cloud/securitycenter/v2/cloud_dlp_data_profile_pb.rb @@ -0,0 +1,24 @@ +# frozen_string_literal: true +# Generated by the protocol buffer compiler. DO NOT EDIT! +# source: google/cloud/securitycenter/v2/cloud_dlp_data_profile.proto + +require 'google/protobuf' + +require 'google/api/resource_pb' + + +descriptor_data = "\n;google/cloud/securitycenter/v2/cloud_dlp_data_profile.proto\x12\x1egoogle.cloud.securitycenter.v2\x1a\x19google/api/resource.proto\"\xf4\x01\n\x13\x43loudDlpDataProfile\x12>\n\x0c\x64\x61ta_profile\x18\x01 \x01(\tB(\xfa\x41%\n#dlp.googleapis.com/TableDataProfile\x12S\n\x0bparent_type\x18\x02 \x01(\x0e\x32>.google.cloud.securitycenter.v2.CloudDlpDataProfile.ParentType\"H\n\nParentType\x12\x1b\n\x17PARENT_TYPE_UNSPECIFIED\x10\x00\x12\x10\n\x0cORGANIZATION\x10\x01\x12\x0b\n\x07PROJECT\x10\x02\x42\x94\x03\n\"com.google.cloud.securitycenter.v2B\x18\x43loudDlpDataProfileProtoP\x01ZJcloud.google.com/go/securitycenter/apiv2/securitycenterpb;securitycenterpb\xaa\x02\x1eGoogle.Cloud.SecurityCenter.V2\xca\x02\x1eGoogle\\Cloud\\SecurityCenter\\V2\xea\x02!Google::Cloud::SecurityCenter::V2\xea\x41\x9e\x01\n#dlp.googleapis.com/TableDataProfile\x12\x30projects/{project}/tableProfiles/{table_profile}\x12\x45projects/{project}/locations/{location}/tableProfiles/{table_profile}b\x06proto3" + +pool = ::Google::Protobuf::DescriptorPool.generated_pool +pool.add_serialized_file(descriptor_data) + +module Google + module Cloud + module SecurityCenter + module V2 + CloudDlpDataProfile = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.securitycenter.v2.CloudDlpDataProfile").msgclass + CloudDlpDataProfile::ParentType = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.securitycenter.v2.CloudDlpDataProfile.ParentType").enummodule + end + end + end +end diff --git a/owl-bot-staging/google-cloud-security_center-v2/lib/google/cloud/securitycenter/v2/cloud_dlp_inspection_pb.rb b/owl-bot-staging/google-cloud-security_center-v2/lib/google/cloud/securitycenter/v2/cloud_dlp_inspection_pb.rb new file mode 100644 index 000000000000..98b7cb9b4a86 --- /dev/null +++ b/owl-bot-staging/google-cloud-security_center-v2/lib/google/cloud/securitycenter/v2/cloud_dlp_inspection_pb.rb @@ -0,0 +1,23 @@ +# frozen_string_literal: true +# Generated by the protocol buffer compiler. DO NOT EDIT! +# source: google/cloud/securitycenter/v2/cloud_dlp_inspection.proto + +require 'google/protobuf' + +require 'google/api/resource_pb' + + +descriptor_data = "\n9google/cloud/securitycenter/v2/cloud_dlp_inspection.proto\x12\x1egoogle.cloud.securitycenter.v2\x1a\x19google/api/resource.proto\"\x88\x01\n\x12\x43loudDlpInspection\x12\x33\n\x0binspect_job\x18\x01 \x01(\tB\x1e\xfa\x41\x1b\n\x19\x64lp.googleapis.com/DlpJob\x12\x11\n\tinfo_type\x18\x02 \x01(\t\x12\x17\n\x0finfo_type_count\x18\x03 \x01(\x03\x12\x11\n\tfull_scan\x18\x04 \x01(\x08\x42\xf0\x02\n\"com.google.cloud.securitycenter.v2B\x17\x43loudDlpInspectionProtoP\x01ZJcloud.google.com/go/securitycenter/apiv2/securitycenterpb;securitycenterpb\xaa\x02\x1eGoogle.Cloud.SecurityCenter.V2\xca\x02\x1eGoogle\\Cloud\\SecurityCenter\\V2\xea\x02!Google::Cloud::SecurityCenter::V2\xea\x41|\n\x19\x64lp.googleapis.com/DlpJob\x12$projects/{project}/dlpJobs/{dlp_job}\x12\x39projects/{project}/locations/{location}/dlpJobs/{dlp_job}b\x06proto3" + +pool = ::Google::Protobuf::DescriptorPool.generated_pool +pool.add_serialized_file(descriptor_data) + +module Google + module Cloud + module SecurityCenter + module V2 + CloudDlpInspection = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.securitycenter.v2.CloudDlpInspection").msgclass + end + end + end +end diff --git a/owl-bot-staging/google-cloud-security_center-v2/lib/google/cloud/securitycenter/v2/compliance_pb.rb b/owl-bot-staging/google-cloud-security_center-v2/lib/google/cloud/securitycenter/v2/compliance_pb.rb new file mode 100644 index 000000000000..547a8fe23d36 --- /dev/null +++ b/owl-bot-staging/google-cloud-security_center-v2/lib/google/cloud/securitycenter/v2/compliance_pb.rb @@ -0,0 +1,21 @@ +# frozen_string_literal: true +# Generated by the protocol buffer compiler. DO NOT EDIT! +# source: google/cloud/securitycenter/v2/compliance.proto + +require 'google/protobuf' + + +descriptor_data = "\n/google/cloud/securitycenter/v2/compliance.proto\x12\x1egoogle.cloud.securitycenter.v2\"<\n\nCompliance\x12\x10\n\x08standard\x18\x01 \x01(\t\x12\x0f\n\x07version\x18\x02 \x01(\t\x12\x0b\n\x03ids\x18\x03 \x03(\tB\xe9\x01\n\"com.google.cloud.securitycenter.v2B\x0f\x43omplianceProtoP\x01ZJcloud.google.com/go/securitycenter/apiv2/securitycenterpb;securitycenterpb\xaa\x02\x1eGoogle.Cloud.SecurityCenter.V2\xca\x02\x1eGoogle\\Cloud\\SecurityCenter\\V2\xea\x02!Google::Cloud::SecurityCenter::V2b\x06proto3" + +pool = ::Google::Protobuf::DescriptorPool.generated_pool +pool.add_serialized_file(descriptor_data) + +module Google + module Cloud + module SecurityCenter + module V2 + Compliance = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.securitycenter.v2.Compliance").msgclass + end + end + end +end diff --git a/owl-bot-staging/google-cloud-security_center-v2/lib/google/cloud/securitycenter/v2/connection_pb.rb b/owl-bot-staging/google-cloud-security_center-v2/lib/google/cloud/securitycenter/v2/connection_pb.rb new file mode 100644 index 000000000000..b0144d4d939a --- /dev/null +++ b/owl-bot-staging/google-cloud-security_center-v2/lib/google/cloud/securitycenter/v2/connection_pb.rb @@ -0,0 +1,22 @@ +# frozen_string_literal: true +# Generated by the protocol buffer compiler. DO NOT EDIT! +# source: google/cloud/securitycenter/v2/connection.proto + +require 'google/protobuf' + + +descriptor_data = "\n/google/cloud/securitycenter/v2/connection.proto\x12\x1egoogle.cloud.securitycenter.v2\"\x81\x02\n\nConnection\x12\x16\n\x0e\x64\x65stination_ip\x18\x01 \x01(\t\x12\x18\n\x10\x64\x65stination_port\x18\x02 \x01(\x05\x12\x11\n\tsource_ip\x18\x03 \x01(\t\x12\x13\n\x0bsource_port\x18\x04 \x01(\x05\x12\x45\n\x08protocol\x18\x05 \x01(\x0e\x32\x33.google.cloud.securitycenter.v2.Connection.Protocol\"R\n\x08Protocol\x12\x18\n\x14PROTOCOL_UNSPECIFIED\x10\x00\x12\x08\n\x04ICMP\x10\x01\x12\x07\n\x03TCP\x10\x06\x12\x07\n\x03UDP\x10\x11\x12\x07\n\x03GRE\x10/\x12\x07\n\x03\x45SP\x10\x32\x42\xe9\x01\n\"com.google.cloud.securitycenter.v2B\x0f\x43onnectionProtoP\x01ZJcloud.google.com/go/securitycenter/apiv2/securitycenterpb;securitycenterpb\xaa\x02\x1eGoogle.Cloud.SecurityCenter.V2\xca\x02\x1eGoogle\\Cloud\\SecurityCenter\\V2\xea\x02!Google::Cloud::SecurityCenter::V2b\x06proto3" + +pool = ::Google::Protobuf::DescriptorPool.generated_pool +pool.add_serialized_file(descriptor_data) + +module Google + module Cloud + module SecurityCenter + module V2 + Connection = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.securitycenter.v2.Connection").msgclass + Connection::Protocol = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.securitycenter.v2.Connection.Protocol").enummodule + end + end + end +end diff --git a/owl-bot-staging/google-cloud-security_center-v2/lib/google/cloud/securitycenter/v2/contact_details_pb.rb b/owl-bot-staging/google-cloud-security_center-v2/lib/google/cloud/securitycenter/v2/contact_details_pb.rb new file mode 100644 index 000000000000..06a5286cc3de --- /dev/null +++ b/owl-bot-staging/google-cloud-security_center-v2/lib/google/cloud/securitycenter/v2/contact_details_pb.rb @@ -0,0 +1,22 @@ +# frozen_string_literal: true +# Generated by the protocol buffer compiler. DO NOT EDIT! +# source: google/cloud/securitycenter/v2/contact_details.proto + +require 'google/protobuf' + + +descriptor_data = "\n4google/cloud/securitycenter/v2/contact_details.proto\x12\x1egoogle.cloud.securitycenter.v2\"K\n\x0e\x43ontactDetails\x12\x39\n\x08\x63ontacts\x18\x01 \x03(\x0b\x32\'.google.cloud.securitycenter.v2.Contact\"\x18\n\x07\x43ontact\x12\r\n\x05\x65mail\x18\x01 \x01(\tB\xed\x01\n\"com.google.cloud.securitycenter.v2B\x13\x43ontactDetailsProtoP\x01ZJcloud.google.com/go/securitycenter/apiv2/securitycenterpb;securitycenterpb\xaa\x02\x1eGoogle.Cloud.SecurityCenter.V2\xca\x02\x1eGoogle\\Cloud\\SecurityCenter\\V2\xea\x02!Google::Cloud::SecurityCenter::V2b\x06proto3" + +pool = ::Google::Protobuf::DescriptorPool.generated_pool +pool.add_serialized_file(descriptor_data) + +module Google + module Cloud + module SecurityCenter + module V2 + ContactDetails = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.securitycenter.v2.ContactDetails").msgclass + Contact = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.securitycenter.v2.Contact").msgclass + end + end + end +end diff --git a/owl-bot-staging/google-cloud-security_center-v2/lib/google/cloud/securitycenter/v2/container_pb.rb b/owl-bot-staging/google-cloud-security_center-v2/lib/google/cloud/securitycenter/v2/container_pb.rb new file mode 100644 index 000000000000..14bc2a2bab9f --- /dev/null +++ b/owl-bot-staging/google-cloud-security_center-v2/lib/google/cloud/securitycenter/v2/container_pb.rb @@ -0,0 +1,24 @@ +# frozen_string_literal: true +# Generated by the protocol buffer compiler. DO NOT EDIT! +# source: google/cloud/securitycenter/v2/container.proto + +require 'google/protobuf' + +require 'google/cloud/securitycenter/v2/label_pb' +require 'google/protobuf/timestamp_pb' + + +descriptor_data = "\n.google/cloud/securitycenter/v2/container.proto\x12\x1egoogle.cloud.securitycenter.v2\x1a*google/cloud/securitycenter/v2/label.proto\x1a\x1fgoogle/protobuf/timestamp.proto\"\xa0\x01\n\tContainer\x12\x0c\n\x04name\x18\x01 \x01(\t\x12\x0b\n\x03uri\x18\x02 \x01(\t\x12\x10\n\x08image_id\x18\x03 \x01(\t\x12\x35\n\x06labels\x18\x04 \x03(\x0b\x32%.google.cloud.securitycenter.v2.Label\x12/\n\x0b\x63reate_time\x18\x05 \x01(\x0b\x32\x1a.google.protobuf.TimestampB\xe8\x01\n\"com.google.cloud.securitycenter.v2B\x0e\x43ontainerProtoP\x01ZJcloud.google.com/go/securitycenter/apiv2/securitycenterpb;securitycenterpb\xaa\x02\x1eGoogle.Cloud.SecurityCenter.V2\xca\x02\x1eGoogle\\Cloud\\SecurityCenter\\V2\xea\x02!Google::Cloud::SecurityCenter::V2b\x06proto3" + +pool = ::Google::Protobuf::DescriptorPool.generated_pool +pool.add_serialized_file(descriptor_data) + +module Google + module Cloud + module SecurityCenter + module V2 + Container = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.securitycenter.v2.Container").msgclass + end + end + end +end diff --git a/owl-bot-staging/google-cloud-security_center-v2/lib/google/cloud/securitycenter/v2/data_access_event_pb.rb b/owl-bot-staging/google-cloud-security_center-v2/lib/google/cloud/securitycenter/v2/data_access_event_pb.rb new file mode 100644 index 000000000000..77d3859aa987 --- /dev/null +++ b/owl-bot-staging/google-cloud-security_center-v2/lib/google/cloud/securitycenter/v2/data_access_event_pb.rb @@ -0,0 +1,24 @@ +# frozen_string_literal: true +# Generated by the protocol buffer compiler. DO NOT EDIT! +# source: google/cloud/securitycenter/v2/data_access_event.proto + +require 'google/protobuf' + +require 'google/protobuf/timestamp_pb' + + +descriptor_data = "\n6google/cloud/securitycenter/v2/data_access_event.proto\x12\x1egoogle.cloud.securitycenter.v2\x1a\x1fgoogle/protobuf/timestamp.proto\"\x80\x02\n\x0f\x44\x61taAccessEvent\x12\x10\n\x08\x65vent_id\x18\x01 \x01(\t\x12\x17\n\x0fprincipal_email\x18\x02 \x01(\t\x12L\n\toperation\x18\x03 \x01(\x0e\x32\x39.google.cloud.securitycenter.v2.DataAccessEvent.Operation\x12.\n\nevent_time\x18\x04 \x01(\x0b\x32\x1a.google.protobuf.Timestamp\"D\n\tOperation\x12\x19\n\x15OPERATION_UNSPECIFIED\x10\x00\x12\x08\n\x04READ\x10\x01\x12\x08\n\x04MOVE\x10\x02\x12\x08\n\x04\x43OPY\x10\x03\x42\xee\x01\n\"com.google.cloud.securitycenter.v2B\x14\x44\x61taAccessEventProtoP\x01ZJcloud.google.com/go/securitycenter/apiv2/securitycenterpb;securitycenterpb\xaa\x02\x1eGoogle.Cloud.SecurityCenter.V2\xca\x02\x1eGoogle\\Cloud\\SecurityCenter\\V2\xea\x02!Google::Cloud::SecurityCenter::V2b\x06proto3" + +pool = ::Google::Protobuf::DescriptorPool.generated_pool +pool.add_serialized_file(descriptor_data) + +module Google + module Cloud + module SecurityCenter + module V2 + DataAccessEvent = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.securitycenter.v2.DataAccessEvent").msgclass + DataAccessEvent::Operation = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.securitycenter.v2.DataAccessEvent.Operation").enummodule + end + end + end +end diff --git a/owl-bot-staging/google-cloud-security_center-v2/lib/google/cloud/securitycenter/v2/data_flow_event_pb.rb b/owl-bot-staging/google-cloud-security_center-v2/lib/google/cloud/securitycenter/v2/data_flow_event_pb.rb new file mode 100644 index 000000000000..418d09d93c4a --- /dev/null +++ b/owl-bot-staging/google-cloud-security_center-v2/lib/google/cloud/securitycenter/v2/data_flow_event_pb.rb @@ -0,0 +1,24 @@ +# frozen_string_literal: true +# Generated by the protocol buffer compiler. DO NOT EDIT! +# source: google/cloud/securitycenter/v2/data_flow_event.proto + +require 'google/protobuf' + +require 'google/protobuf/timestamp_pb' + + +descriptor_data = "\n4google/cloud/securitycenter/v2/data_flow_event.proto\x12\x1egoogle.cloud.securitycenter.v2\x1a\x1fgoogle/protobuf/timestamp.proto\"\x97\x02\n\rDataFlowEvent\x12\x10\n\x08\x65vent_id\x18\x01 \x01(\t\x12\x17\n\x0fprincipal_email\x18\x02 \x01(\t\x12J\n\toperation\x18\x03 \x01(\x0e\x32\x37.google.cloud.securitycenter.v2.DataFlowEvent.Operation\x12\x19\n\x11violated_location\x18\x04 \x01(\t\x12.\n\nevent_time\x18\x05 \x01(\x0b\x32\x1a.google.protobuf.Timestamp\"D\n\tOperation\x12\x19\n\x15OPERATION_UNSPECIFIED\x10\x00\x12\x08\n\x04READ\x10\x01\x12\x08\n\x04MOVE\x10\x02\x12\x08\n\x04\x43OPY\x10\x03\x42\xec\x01\n\"com.google.cloud.securitycenter.v2B\x12\x44\x61taFlowEventProtoP\x01ZJcloud.google.com/go/securitycenter/apiv2/securitycenterpb;securitycenterpb\xaa\x02\x1eGoogle.Cloud.SecurityCenter.V2\xca\x02\x1eGoogle\\Cloud\\SecurityCenter\\V2\xea\x02!Google::Cloud::SecurityCenter::V2b\x06proto3" + +pool = ::Google::Protobuf::DescriptorPool.generated_pool +pool.add_serialized_file(descriptor_data) + +module Google + module Cloud + module SecurityCenter + module V2 + DataFlowEvent = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.securitycenter.v2.DataFlowEvent").msgclass + DataFlowEvent::Operation = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.securitycenter.v2.DataFlowEvent.Operation").enummodule + end + end + end +end diff --git a/owl-bot-staging/google-cloud-security_center-v2/lib/google/cloud/securitycenter/v2/data_retention_deletion_event_pb.rb b/owl-bot-staging/google-cloud-security_center-v2/lib/google/cloud/securitycenter/v2/data_retention_deletion_event_pb.rb new file mode 100644 index 000000000000..17693433fba7 --- /dev/null +++ b/owl-bot-staging/google-cloud-security_center-v2/lib/google/cloud/securitycenter/v2/data_retention_deletion_event_pb.rb @@ -0,0 +1,25 @@ +# frozen_string_literal: true +# Generated by the protocol buffer compiler. DO NOT EDIT! +# source: google/cloud/securitycenter/v2/data_retention_deletion_event.proto + +require 'google/protobuf' + +require 'google/protobuf/duration_pb' +require 'google/protobuf/timestamp_pb' + + +descriptor_data = "\nBgoogle/cloud/securitycenter/v2/data_retention_deletion_event.proto\x12\x1egoogle.cloud.securitycenter.v2\x1a\x1egoogle/protobuf/duration.proto\x1a\x1fgoogle/protobuf/timestamp.proto\"\xcf\x02\n\x1a\x44\x61taRetentionDeletionEvent\x12\x38\n\x14\x65vent_detection_time\x18\x02 \x01(\x0b\x32\x1a.google.protobuf.Timestamp\x12\x19\n\x11\x64\x61ta_object_count\x18\x03 \x01(\x03\x12\x38\n\x15max_retention_allowed\x18\x04 \x01(\x0b\x32\x19.google.protobuf.Duration\x12X\n\nevent_type\x18\x05 \x01(\x0e\x32\x44.google.cloud.securitycenter.v2.DataRetentionDeletionEvent.EventType\"H\n\tEventType\x12\x1a\n\x16\x45VENT_TYPE_UNSPECIFIED\x10\x00\x12\x1f\n\x1b\x45VENT_TYPE_MAX_TTL_EXCEEDED\x10\x01\x42\xf9\x01\n\"com.google.cloud.securitycenter.v2B\x1f\x44\x61taRetentionDeletionEventProtoP\x01ZJcloud.google.com/go/securitycenter/apiv2/securitycenterpb;securitycenterpb\xaa\x02\x1eGoogle.Cloud.SecurityCenter.V2\xca\x02\x1eGoogle\\Cloud\\SecurityCenter\\V2\xea\x02!Google::Cloud::SecurityCenter::V2b\x06proto3" + +pool = ::Google::Protobuf::DescriptorPool.generated_pool +pool.add_serialized_file(descriptor_data) + +module Google + module Cloud + module SecurityCenter + module V2 + DataRetentionDeletionEvent = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.securitycenter.v2.DataRetentionDeletionEvent").msgclass + DataRetentionDeletionEvent::EventType = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.securitycenter.v2.DataRetentionDeletionEvent.EventType").enummodule + end + end + end +end diff --git a/owl-bot-staging/google-cloud-security_center-v2/lib/google/cloud/securitycenter/v2/database_pb.rb b/owl-bot-staging/google-cloud-security_center-v2/lib/google/cloud/securitycenter/v2/database_pb.rb new file mode 100644 index 000000000000..32310070d4bc --- /dev/null +++ b/owl-bot-staging/google-cloud-security_center-v2/lib/google/cloud/securitycenter/v2/database_pb.rb @@ -0,0 +1,21 @@ +# frozen_string_literal: true +# Generated by the protocol buffer compiler. DO NOT EDIT! +# source: google/cloud/securitycenter/v2/database.proto + +require 'google/protobuf' + + +descriptor_data = "\n-google/cloud/securitycenter/v2/database.proto\x12\x1egoogle.cloud.securitycenter.v2\"s\n\x08\x44\x61tabase\x12\x0c\n\x04name\x18\x01 \x01(\t\x12\x14\n\x0c\x64isplay_name\x18\x02 \x01(\t\x12\x11\n\tuser_name\x18\x03 \x01(\t\x12\r\n\x05query\x18\x04 \x01(\t\x12\x10\n\x08grantees\x18\x05 \x03(\t\x12\x0f\n\x07version\x18\x06 \x01(\tB\xe7\x01\n\"com.google.cloud.securitycenter.v2B\rDatabaseProtoP\x01ZJcloud.google.com/go/securitycenter/apiv2/securitycenterpb;securitycenterpb\xaa\x02\x1eGoogle.Cloud.SecurityCenter.V2\xca\x02\x1eGoogle\\Cloud\\SecurityCenter\\V2\xea\x02!Google::Cloud::SecurityCenter::V2b\x06proto3" + +pool = ::Google::Protobuf::DescriptorPool.generated_pool +pool.add_serialized_file(descriptor_data) + +module Google + module Cloud + module SecurityCenter + module V2 + Database = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.securitycenter.v2.Database").msgclass + end + end + end +end diff --git a/owl-bot-staging/google-cloud-security_center-v2/lib/google/cloud/securitycenter/v2/disk_pb.rb b/owl-bot-staging/google-cloud-security_center-v2/lib/google/cloud/securitycenter/v2/disk_pb.rb new file mode 100644 index 000000000000..a62acf2da0c4 --- /dev/null +++ b/owl-bot-staging/google-cloud-security_center-v2/lib/google/cloud/securitycenter/v2/disk_pb.rb @@ -0,0 +1,21 @@ +# frozen_string_literal: true +# Generated by the protocol buffer compiler. DO NOT EDIT! +# source: google/cloud/securitycenter/v2/disk.proto + +require 'google/protobuf' + + +descriptor_data = "\n)google/cloud/securitycenter/v2/disk.proto\x12\x1egoogle.cloud.securitycenter.v2\"\x14\n\x04\x44isk\x12\x0c\n\x04name\x18\x01 \x01(\tB\xe3\x01\n\"com.google.cloud.securitycenter.v2B\tDiskProtoP\x01ZJcloud.google.com/go/securitycenter/apiv2/securitycenterpb;securitycenterpb\xaa\x02\x1eGoogle.Cloud.SecurityCenter.V2\xca\x02\x1eGoogle\\Cloud\\SecurityCenter\\V2\xea\x02!Google::Cloud::SecurityCenter::V2b\x06proto3" + +pool = ::Google::Protobuf::DescriptorPool.generated_pool +pool.add_serialized_file(descriptor_data) + +module Google + module Cloud + module SecurityCenter + module V2 + Disk = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.securitycenter.v2.Disk").msgclass + end + end + end +end diff --git a/owl-bot-staging/google-cloud-security_center-v2/lib/google/cloud/securitycenter/v2/exfiltration_pb.rb b/owl-bot-staging/google-cloud-security_center-v2/lib/google/cloud/securitycenter/v2/exfiltration_pb.rb new file mode 100644 index 000000000000..4e217d9041f6 --- /dev/null +++ b/owl-bot-staging/google-cloud-security_center-v2/lib/google/cloud/securitycenter/v2/exfiltration_pb.rb @@ -0,0 +1,22 @@ +# frozen_string_literal: true +# Generated by the protocol buffer compiler. DO NOT EDIT! +# source: google/cloud/securitycenter/v2/exfiltration.proto + +require 'google/protobuf' + + +descriptor_data = "\n1google/cloud/securitycenter/v2/exfiltration.proto\x12\x1egoogle.cloud.securitycenter.v2\"\xaf\x01\n\x0c\x45xfiltration\x12>\n\x07sources\x18\x01 \x03(\x0b\x32-.google.cloud.securitycenter.v2.ExfilResource\x12>\n\x07targets\x18\x02 \x03(\x0b\x32-.google.cloud.securitycenter.v2.ExfilResource\x12\x1f\n\x17total_exfiltrated_bytes\x18\x03 \x01(\x03\"1\n\rExfilResource\x12\x0c\n\x04name\x18\x01 \x01(\t\x12\x12\n\ncomponents\x18\x02 \x03(\tB\xeb\x01\n\"com.google.cloud.securitycenter.v2B\x11\x45xfiltrationProtoP\x01ZJcloud.google.com/go/securitycenter/apiv2/securitycenterpb;securitycenterpb\xaa\x02\x1eGoogle.Cloud.SecurityCenter.V2\xca\x02\x1eGoogle\\Cloud\\SecurityCenter\\V2\xea\x02!Google::Cloud::SecurityCenter::V2b\x06proto3" + +pool = ::Google::Protobuf::DescriptorPool.generated_pool +pool.add_serialized_file(descriptor_data) + +module Google + module Cloud + module SecurityCenter + module V2 + Exfiltration = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.securitycenter.v2.Exfiltration").msgclass + ExfilResource = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.securitycenter.v2.ExfilResource").msgclass + end + end + end +end diff --git a/owl-bot-staging/google-cloud-security_center-v2/lib/google/cloud/securitycenter/v2/external_system_pb.rb b/owl-bot-staging/google-cloud-security_center-v2/lib/google/cloud/securitycenter/v2/external_system_pb.rb new file mode 100644 index 000000000000..684f53455eeb --- /dev/null +++ b/owl-bot-staging/google-cloud-security_center-v2/lib/google/cloud/securitycenter/v2/external_system_pb.rb @@ -0,0 +1,25 @@ +# frozen_string_literal: true +# Generated by the protocol buffer compiler. DO NOT EDIT! +# source: google/cloud/securitycenter/v2/external_system.proto + +require 'google/protobuf' + +require 'google/api/resource_pb' +require 'google/protobuf/timestamp_pb' + + +descriptor_data = "\n4google/cloud/securitycenter/v2/external_system.proto\x12\x1egoogle.cloud.securitycenter.v2\x1a\x19google/api/resource.proto\x1a\x1fgoogle/protobuf/timestamp.proto\"\xd4\t\n\x0e\x45xternalSystem\x12\x0c\n\x04name\x18\x01 \x01(\t\x12\x11\n\tassignees\x18\x02 \x03(\t\x12\x14\n\x0c\x65xternal_uid\x18\x03 \x01(\t\x12\x0e\n\x06status\x18\x04 \x01(\t\x12?\n\x1b\x65xternal_system_update_time\x18\x05 \x01(\x0b\x32\x1a.google.protobuf.Timestamp\x12\x10\n\x08\x63\x61se_uri\x18\x06 \x01(\t\x12\x15\n\rcase_priority\x18\x07 \x01(\t\x12,\n\x08\x63\x61se_sla\x18\t \x01(\x0b\x32\x1a.google.protobuf.Timestamp\x12\x34\n\x10\x63\x61se_create_time\x18\n \x01(\x0b\x32\x1a.google.protobuf.Timestamp\x12\x33\n\x0f\x63\x61se_close_time\x18\x0b \x01(\x0b\x32\x1a.google.protobuf.Timestamp\x12N\n\x0bticket_info\x18\x08 \x01(\x0b\x32\x39.google.cloud.securitycenter.v2.ExternalSystem.TicketInfo\x1a\x8d\x01\n\nTicketInfo\x12\n\n\x02id\x18\x01 \x01(\t\x12\x10\n\x08\x61ssignee\x18\x02 \x01(\t\x12\x13\n\x0b\x64\x65scription\x18\x03 \x01(\t\x12\x0b\n\x03uri\x18\x04 \x01(\t\x12\x0e\n\x06status\x18\x05 \x01(\t\x12/\n\x0bupdate_time\x18\x06 \x01(\x0b\x32\x1a.google.protobuf.Timestamp:\x97\x05\xea\x41\x93\x05\n,securitycenter.googleapis.com/ExternalSystem\x12\x61organizations/{organization}/sources/{source}/findings/{finding}/externalSystems/{externalsystem}\x12vorganizations/{organization}/sources/{source}/locations/{location}/findings/{finding}/externalSystems/{externalsystem}\x12Ufolders/{folder}/sources/{source}/findings/{finding}/externalSystems/{externalsystem}\x12jfolders/{folder}/sources/{source}/locations/{location}/findings/{finding}/externalSystems/{externalsystem}\x12Wprojects/{project}/sources/{source}/findings/{finding}/externalSystems/{externalsystem}\x12lprojects/{project}/sources/{source}/locations/{location}/findings/{finding}/externalSystems/{externalsystem}B\xed\x01\n\"com.google.cloud.securitycenter.v2B\x13\x45xternalSystemProtoP\x01ZJcloud.google.com/go/securitycenter/apiv2/securitycenterpb;securitycenterpb\xaa\x02\x1eGoogle.Cloud.SecurityCenter.V2\xca\x02\x1eGoogle\\Cloud\\SecurityCenter\\V2\xea\x02!Google::Cloud::SecurityCenter::V2b\x06proto3" + +pool = ::Google::Protobuf::DescriptorPool.generated_pool +pool.add_serialized_file(descriptor_data) + +module Google + module Cloud + module SecurityCenter + module V2 + ExternalSystem = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.securitycenter.v2.ExternalSystem").msgclass + ExternalSystem::TicketInfo = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.securitycenter.v2.ExternalSystem.TicketInfo").msgclass + end + end + end +end diff --git a/owl-bot-staging/google-cloud-security_center-v2/lib/google/cloud/securitycenter/v2/file_pb.rb b/owl-bot-staging/google-cloud-security_center-v2/lib/google/cloud/securitycenter/v2/file_pb.rb new file mode 100644 index 000000000000..3004389fa02c --- /dev/null +++ b/owl-bot-staging/google-cloud-security_center-v2/lib/google/cloud/securitycenter/v2/file_pb.rb @@ -0,0 +1,24 @@ +# frozen_string_literal: true +# Generated by the protocol buffer compiler. DO NOT EDIT! +# source: google/cloud/securitycenter/v2/file.proto + +require 'google/protobuf' + + +descriptor_data = "\n)google/cloud/securitycenter/v2/file.proto\x12\x1egoogle.cloud.securitycenter.v2\"\x83\x04\n\x04\x46ile\x12\x0c\n\x04path\x18\x01 \x01(\t\x12\x0c\n\x04size\x18\x02 \x01(\x03\x12\x0e\n\x06sha256\x18\x03 \x01(\t\x12\x13\n\x0bhashed_size\x18\x04 \x01(\x03\x12\x18\n\x10partially_hashed\x18\x05 \x01(\x08\x12\x10\n\x08\x63ontents\x18\x06 \x01(\t\x12@\n\tdisk_path\x18\x07 \x01(\x0b\x32-.google.cloud.securitycenter.v2.File.DiskPath\x12\x46\n\noperations\x18\x08 \x03(\x0b\x32\x32.google.cloud.securitycenter.v2.File.FileOperation\x1a\x39\n\x08\x44iskPath\x12\x16\n\x0epartition_uuid\x18\x01 \x01(\t\x12\x15\n\rrelative_path\x18\x02 \x01(\t\x1a\xc8\x01\n\rFileOperation\x12N\n\x04type\x18\x01 \x01(\x0e\x32@.google.cloud.securitycenter.v2.File.FileOperation.OperationType\"g\n\rOperationType\x12\x1e\n\x1aOPERATION_TYPE_UNSPECIFIED\x10\x00\x12\x08\n\x04OPEN\x10\x01\x12\x08\n\x04READ\x10\x02\x12\n\n\x06RENAME\x10\x03\x12\t\n\x05WRITE\x10\x04\x12\x0b\n\x07\x45XECUTE\x10\x05\x42\xe3\x01\n\"com.google.cloud.securitycenter.v2B\tFileProtoP\x01ZJcloud.google.com/go/securitycenter/apiv2/securitycenterpb;securitycenterpb\xaa\x02\x1eGoogle.Cloud.SecurityCenter.V2\xca\x02\x1eGoogle\\Cloud\\SecurityCenter\\V2\xea\x02!Google::Cloud::SecurityCenter::V2b\x06proto3" + +pool = ::Google::Protobuf::DescriptorPool.generated_pool +pool.add_serialized_file(descriptor_data) + +module Google + module Cloud + module SecurityCenter + module V2 + File = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.securitycenter.v2.File").msgclass + File::DiskPath = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.securitycenter.v2.File.DiskPath").msgclass + File::FileOperation = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.securitycenter.v2.File.FileOperation").msgclass + File::FileOperation::OperationType = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.securitycenter.v2.File.FileOperation.OperationType").enummodule + end + end + end +end diff --git a/owl-bot-staging/google-cloud-security_center-v2/lib/google/cloud/securitycenter/v2/finding_pb.rb b/owl-bot-staging/google-cloud-security_center-v2/lib/google/cloud/securitycenter/v2/finding_pb.rb new file mode 100644 index 000000000000..5f7b5a2bbdb2 --- /dev/null +++ b/owl-bot-staging/google-cloud-security_center-v2/lib/google/cloud/securitycenter/v2/finding_pb.rb @@ -0,0 +1,74 @@ +# frozen_string_literal: true +# Generated by the protocol buffer compiler. DO NOT EDIT! +# source: google/cloud/securitycenter/v2/finding.proto + +require 'google/protobuf' + +require 'google/api/field_behavior_pb' +require 'google/api/resource_pb' +require 'google/cloud/securitycenter/v2/access_pb' +require 'google/cloud/securitycenter/v2/affected_resources_pb' +require 'google/cloud/securitycenter/v2/ai_model_pb' +require 'google/cloud/securitycenter/v2/application_pb' +require 'google/cloud/securitycenter/v2/attack_exposure_pb' +require 'google/cloud/securitycenter/v2/backup_disaster_recovery_pb' +require 'google/cloud/securitycenter/v2/chokepoint_pb' +require 'google/cloud/securitycenter/v2/cloud_armor_pb' +require 'google/cloud/securitycenter/v2/cloud_dlp_data_profile_pb' +require 'google/cloud/securitycenter/v2/cloud_dlp_inspection_pb' +require 'google/cloud/securitycenter/v2/compliance_pb' +require 'google/cloud/securitycenter/v2/connection_pb' +require 'google/cloud/securitycenter/v2/contact_details_pb' +require 'google/cloud/securitycenter/v2/container_pb' +require 'google/cloud/securitycenter/v2/data_access_event_pb' +require 'google/cloud/securitycenter/v2/data_flow_event_pb' +require 'google/cloud/securitycenter/v2/data_retention_deletion_event_pb' +require 'google/cloud/securitycenter/v2/database_pb' +require 'google/cloud/securitycenter/v2/disk_pb' +require 'google/cloud/securitycenter/v2/exfiltration_pb' +require 'google/cloud/securitycenter/v2/external_system_pb' +require 'google/cloud/securitycenter/v2/file_pb' +require 'google/cloud/securitycenter/v2/group_membership_pb' +require 'google/cloud/securitycenter/v2/iam_binding_pb' +require 'google/cloud/securitycenter/v2/indicator_pb' +require 'google/cloud/securitycenter/v2/ip_rules_pb' +require 'google/cloud/securitycenter/v2/job_pb' +require 'google/cloud/securitycenter/v2/kernel_rootkit_pb' +require 'google/cloud/securitycenter/v2/kubernetes_pb' +require 'google/cloud/securitycenter/v2/load_balancer_pb' +require 'google/cloud/securitycenter/v2/log_entry_pb' +require 'google/cloud/securitycenter/v2/mitre_attack_pb' +require 'google/cloud/securitycenter/v2/network_pb' +require 'google/cloud/securitycenter/v2/notebook_pb' +require 'google/cloud/securitycenter/v2/org_policy_pb' +require 'google/cloud/securitycenter/v2/process_pb' +require 'google/cloud/securitycenter/v2/security_marks_pb' +require 'google/cloud/securitycenter/v2/security_posture_pb' +require 'google/cloud/securitycenter/v2/toxic_combination_pb' +require 'google/cloud/securitycenter/v2/vertex_ai_pb' +require 'google/cloud/securitycenter/v2/vulnerability_pb' +require 'google/protobuf/struct_pb' +require 'google/protobuf/timestamp_pb' + + +descriptor_data = "\n,google/cloud/securitycenter/v2/finding.proto\x12\x1egoogle.cloud.securitycenter.v2\x1a\x1fgoogle/api/field_behavior.proto\x1a\x19google/api/resource.proto\x1a+google/cloud/securitycenter/v2/access.proto\x1a\x37google/cloud/securitycenter/v2/affected_resources.proto\x1a-google/cloud/securitycenter/v2/ai_model.proto\x1a\x30google/cloud/securitycenter/v2/application.proto\x1a\x34google/cloud/securitycenter/v2/attack_exposure.proto\x1a=google/cloud/securitycenter/v2/backup_disaster_recovery.proto\x1a/google/cloud/securitycenter/v2/chokepoint.proto\x1a\x30google/cloud/securitycenter/v2/cloud_armor.proto\x1a;google/cloud/securitycenter/v2/cloud_dlp_data_profile.proto\x1a\x39google/cloud/securitycenter/v2/cloud_dlp_inspection.proto\x1a/google/cloud/securitycenter/v2/compliance.proto\x1a/google/cloud/securitycenter/v2/connection.proto\x1a\x34google/cloud/securitycenter/v2/contact_details.proto\x1a.google/cloud/securitycenter/v2/container.proto\x1a\x36google/cloud/securitycenter/v2/data_access_event.proto\x1a\x34google/cloud/securitycenter/v2/data_flow_event.proto\x1a\x42google/cloud/securitycenter/v2/data_retention_deletion_event.proto\x1a-google/cloud/securitycenter/v2/database.proto\x1a)google/cloud/securitycenter/v2/disk.proto\x1a\x31google/cloud/securitycenter/v2/exfiltration.proto\x1a\x34google/cloud/securitycenter/v2/external_system.proto\x1a)google/cloud/securitycenter/v2/file.proto\x1a\x35google/cloud/securitycenter/v2/group_membership.proto\x1a\x30google/cloud/securitycenter/v2/iam_binding.proto\x1a.google/cloud/securitycenter/v2/indicator.proto\x1a-google/cloud/securitycenter/v2/ip_rules.proto\x1a(google/cloud/securitycenter/v2/job.proto\x1a\x33google/cloud/securitycenter/v2/kernel_rootkit.proto\x1a/google/cloud/securitycenter/v2/kubernetes.proto\x1a\x32google/cloud/securitycenter/v2/load_balancer.proto\x1a.google/cloud/securitycenter/v2/log_entry.proto\x1a\x31google/cloud/securitycenter/v2/mitre_attack.proto\x1a,google/cloud/securitycenter/v2/network.proto\x1a-google/cloud/securitycenter/v2/notebook.proto\x1a/google/cloud/securitycenter/v2/org_policy.proto\x1a,google/cloud/securitycenter/v2/process.proto\x1a\x33google/cloud/securitycenter/v2/security_marks.proto\x1a\x35google/cloud/securitycenter/v2/security_posture.proto\x1a\x36google/cloud/securitycenter/v2/toxic_combination.proto\x1a.google/cloud/securitycenter/v2/vertex_ai.proto\x1a\x32google/cloud/securitycenter/v2/vulnerability.proto\x1a\x1cgoogle/protobuf/struct.proto\x1a\x1fgoogle/protobuf/timestamp.proto\"\x9e)\n\x07\x46inding\x12\x11\n\x04name\x18\x01 \x01(\tB\x03\xe0\x41\x08\x12\x1b\n\x0e\x63\x61nonical_name\x18\x02 \x01(\tB\x03\xe0\x41\x03\x12\x0e\n\x06parent\x18\x03 \x01(\t\x12\x1a\n\rresource_name\x18\x04 \x01(\tB\x03\xe0\x41\x05\x12\x41\n\x05state\x18\x06 \x01(\x0e\x32-.google.cloud.securitycenter.v2.Finding.StateB\x03\xe0\x41\x03\x12\x15\n\x08\x63\x61tegory\x18\x07 \x01(\tB\x03\xe0\x41\x05\x12\x14\n\x0c\x65xternal_uri\x18\x08 \x01(\t\x12X\n\x11source_properties\x18\t \x03(\x0b\x32=.google.cloud.securitycenter.v2.Finding.SourcePropertiesEntry\x12J\n\x0esecurity_marks\x18\n \x01(\x0b\x32-.google.cloud.securitycenter.v2.SecurityMarksB\x03\xe0\x41\x03\x12.\n\nevent_time\x18\x0b \x01(\x0b\x32\x1a.google.protobuf.Timestamp\x12\x34\n\x0b\x63reate_time\x18\x0c \x01(\x0b\x32\x1a.google.protobuf.TimestampB\x03\xe0\x41\x03\x12\x42\n\x08severity\x18\x0e \x01(\x0e\x32\x30.google.cloud.securitycenter.v2.Finding.Severity\x12:\n\x04mute\x18\x0f \x01(\x0e\x32,.google.cloud.securitycenter.v2.Finding.Mute\x12H\n\tmute_info\x18\x35 \x01(\x0b\x32\x30.google.cloud.securitycenter.v2.Finding.MuteInfoB\x03\xe0\x41\x03\x12K\n\rfinding_class\x18\x10 \x01(\x0e\x32\x34.google.cloud.securitycenter.v2.Finding.FindingClass\x12<\n\tindicator\x18\x11 \x01(\x0b\x32).google.cloud.securitycenter.v2.Indicator\x12\x44\n\rvulnerability\x18\x12 \x01(\x0b\x32-.google.cloud.securitycenter.v2.Vulnerability\x12\x39\n\x10mute_update_time\x18\x13 \x01(\x0b\x32\x1a.google.protobuf.TimestampB\x03\xe0\x41\x03\x12[\n\x10\x65xternal_systems\x18\x14 \x03(\x0b\x32<.google.cloud.securitycenter.v2.Finding.ExternalSystemsEntryB\x03\xe0\x41\x03\x12\x41\n\x0cmitre_attack\x18\x15 \x01(\x0b\x32+.google.cloud.securitycenter.v2.MitreAttack\x12\x36\n\x06\x61\x63\x63\x65ss\x18\x16 \x01(\x0b\x32&.google.cloud.securitycenter.v2.Access\x12?\n\x0b\x63onnections\x18\x17 \x03(\x0b\x32*.google.cloud.securitycenter.v2.Connection\x12\x16\n\x0emute_initiator\x18\x18 \x01(\t\x12:\n\tprocesses\x18\x19 \x03(\x0b\x32\'.google.cloud.securitycenter.v2.Process\x12L\n\x08\x63ontacts\x18\x1a \x03(\x0b\x32\x35.google.cloud.securitycenter.v2.Finding.ContactsEntryB\x03\xe0\x41\x03\x12?\n\x0b\x63ompliances\x18\x1b \x03(\x0b\x32*.google.cloud.securitycenter.v2.Compliance\x12 \n\x13parent_display_name\x18\x1d \x01(\tB\x03\xe0\x41\x03\x12\x13\n\x0b\x64\x65scription\x18\x1e \x01(\t\x12\x42\n\x0c\x65xfiltration\x18\x1f \x01(\x0b\x32,.google.cloud.securitycenter.v2.Exfiltration\x12@\n\x0ciam_bindings\x18 \x03(\x0b\x32*.google.cloud.securitycenter.v2.IamBinding\x12\x12\n\nnext_steps\x18! \x01(\t\x12\x13\n\x0bmodule_name\x18\" \x01(\t\x12=\n\ncontainers\x18# \x03(\x0b\x32).google.cloud.securitycenter.v2.Container\x12>\n\nkubernetes\x18$ \x01(\x0b\x32*.google.cloud.securitycenter.v2.Kubernetes\x12:\n\x08\x64\x61tabase\x18% \x01(\x0b\x32(.google.cloud.securitycenter.v2.Database\x12G\n\x0f\x61ttack_exposure\x18& \x01(\x0b\x32..google.cloud.securitycenter.v2.AttackExposure\x12\x33\n\x05\x66iles\x18\' \x03(\x0b\x32$.google.cloud.securitycenter.v2.File\x12P\n\x14\x63loud_dlp_inspection\x18( \x01(\x0b\x32\x32.google.cloud.securitycenter.v2.CloudDlpInspection\x12S\n\x16\x63loud_dlp_data_profile\x18) \x01(\x0b\x32\x33.google.cloud.securitycenter.v2.CloudDlpDataProfile\x12\x45\n\x0ekernel_rootkit\x18* \x01(\x0b\x32-.google.cloud.securitycenter.v2.KernelRootkit\x12?\n\x0corg_policies\x18+ \x03(\x0b\x32).google.cloud.securitycenter.v2.OrgPolicy\x12\x30\n\x03job\x18, \x01(\x0b\x32#.google.cloud.securitycenter.v2.Job\x12@\n\x0b\x61pplication\x18- \x01(\x0b\x32+.google.cloud.securitycenter.v2.Application\x12\x39\n\x08ip_rules\x18. \x01(\x0b\x32\'.google.cloud.securitycenter.v2.IpRules\x12X\n\x18\x62\x61\x63kup_disaster_recovery\x18/ \x01(\x0b\x32\x36.google.cloud.securitycenter.v2.BackupDisasterRecovery\x12I\n\x10security_posture\x18\x30 \x01(\x0b\x32/.google.cloud.securitycenter.v2.SecurityPosture\x12=\n\x0blog_entries\x18\x31 \x03(\x0b\x32(.google.cloud.securitycenter.v2.LogEntry\x12\x44\n\x0eload_balancers\x18\x32 \x03(\x0b\x32,.google.cloud.securitycenter.v2.LoadBalancer\x12?\n\x0b\x63loud_armor\x18\x33 \x01(\x0b\x32*.google.cloud.securitycenter.v2.CloudArmor\x12:\n\x08notebook\x18\x37 \x01(\x0b\x32(.google.cloud.securitycenter.v2.Notebook\x12K\n\x11toxic_combination\x18\x38 \x01(\x0b\x32\x30.google.cloud.securitycenter.v2.ToxicCombination\x12J\n\x11group_memberships\x18\x39 \x03(\x0b\x32/.google.cloud.securitycenter.v2.GroupMembership\x12\x32\n\x04\x64isk\x18: \x01(\x0b\x32$.google.cloud.securitycenter.v2.Disk\x12K\n\x12\x64\x61ta_access_events\x18= \x03(\x0b\x32/.google.cloud.securitycenter.v2.DataAccessEvent\x12G\n\x10\x64\x61ta_flow_events\x18> \x03(\x0b\x32-.google.cloud.securitycenter.v2.DataFlowEvent\x12\x39\n\x08networks\x18? \x03(\x0b\x32\'.google.cloud.securitycenter.v2.Network\x12\x62\n\x1e\x64\x61ta_retention_deletion_events\x18@ \x03(\x0b\x32:.google.cloud.securitycenter.v2.DataRetentionDeletionEvent\x12M\n\x12\x61\x66\x66\x65\x63ted_resources\x18\x41 \x01(\x0b\x32\x31.google.cloud.securitycenter.v2.AffectedResources\x12\x39\n\x08\x61i_model\x18\x42 \x01(\x0b\x32\'.google.cloud.securitycenter.v2.AiModel\x12>\n\nchokepoint\x18\x45 \x01(\x0b\x32*.google.cloud.securitycenter.v2.Chokepoint\x12;\n\tvertex_ai\x18H \x01(\x0b\x32(.google.cloud.securitycenter.v2.VertexAi\x1a\x93\x03\n\x08MuteInfo\x12P\n\x0bstatic_mute\x18\x01 \x01(\x0b\x32;.google.cloud.securitycenter.v2.Finding.MuteInfo.StaticMute\x12`\n\x14\x64ynamic_mute_records\x18\x02 \x03(\x0b\x32\x42.google.cloud.securitycenter.v2.Finding.MuteInfo.DynamicMuteRecord\x1ay\n\nStaticMute\x12;\n\x05state\x18\x01 \x01(\x0e\x32,.google.cloud.securitycenter.v2.Finding.Mute\x12.\n\napply_time\x18\x02 \x01(\x0b\x32\x1a.google.protobuf.Timestamp\x1aX\n\x11\x44ynamicMuteRecord\x12\x13\n\x0bmute_config\x18\x01 \x01(\t\x12.\n\nmatch_time\x18\x02 \x01(\x0b\x32\x1a.google.protobuf.Timestamp\x1aO\n\x15SourcePropertiesEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12%\n\x05value\x18\x02 \x01(\x0b\x32\x16.google.protobuf.Value:\x02\x38\x01\x1a\x66\n\x14\x45xternalSystemsEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12=\n\x05value\x18\x02 \x01(\x0b\x32..google.cloud.securitycenter.v2.ExternalSystem:\x02\x38\x01\x1a_\n\rContactsEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12=\n\x05value\x18\x02 \x01(\x0b\x32..google.cloud.securitycenter.v2.ContactDetails:\x02\x38\x01\"8\n\x05State\x12\x15\n\x11STATE_UNSPECIFIED\x10\x00\x12\n\n\x06\x41\x43TIVE\x10\x01\x12\x0c\n\x08INACTIVE\x10\x02\"Q\n\x08Severity\x12\x18\n\x14SEVERITY_UNSPECIFIED\x10\x00\x12\x0c\n\x08\x43RITICAL\x10\x01\x12\x08\n\x04HIGH\x10\x02\x12\n\n\x06MEDIUM\x10\x03\x12\x07\n\x03LOW\x10\x04\"C\n\x04Mute\x12\x14\n\x10MUTE_UNSPECIFIED\x10\x00\x12\t\n\x05MUTED\x10\x01\x12\x0b\n\x07UNMUTED\x10\x02\x12\r\n\tUNDEFINED\x10\x03\"\xd9\x01\n\x0c\x46indingClass\x12\x1d\n\x19\x46INDING_CLASS_UNSPECIFIED\x10\x00\x12\n\n\x06THREAT\x10\x01\x12\x11\n\rVULNERABILITY\x10\x02\x12\x14\n\x10MISCONFIGURATION\x10\x03\x12\x0f\n\x0bOBSERVATION\x10\x04\x12\r\n\tSCC_ERROR\x10\x05\x12\x15\n\x11POSTURE_VIOLATION\x10\x06\x12\x15\n\x11TOXIC_COMBINATION\x10\x07\x12\x17\n\x13SENSITIVE_DATA_RISK\x10\x08\x12\x0e\n\nCHOKEPOINT\x10\t:\xdd\x03\xea\x41\xd9\x03\n%securitycenter.googleapis.com/Finding\x12@organizations/{organization}/sources/{source}/findings/{finding}\x12Uorganizations/{organization}/sources/{source}/locations/{location}/findings/{finding}\x12\x34\x66olders/{folder}/sources/{source}/findings/{finding}\x12Ifolders/{folder}/sources/{source}/locations/{location}/findings/{finding}\x12\x36projects/{project}/sources/{source}/findings/{finding}\x12Kprojects/{project}/sources/{source}/locations/{location}/findings/{finding}*\x08\x66indings2\x07\x66indingB\xe6\x01\n\"com.google.cloud.securitycenter.v2B\x0c\x46indingProtoP\x01ZJcloud.google.com/go/securitycenter/apiv2/securitycenterpb;securitycenterpb\xaa\x02\x1eGoogle.Cloud.SecurityCenter.V2\xca\x02\x1eGoogle\\Cloud\\SecurityCenter\\V2\xea\x02!Google::Cloud::SecurityCenter::V2b\x06proto3" + +pool = ::Google::Protobuf::DescriptorPool.generated_pool +pool.add_serialized_file(descriptor_data) + +module Google + module Cloud + module SecurityCenter + module V2 + Finding = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.securitycenter.v2.Finding").msgclass + Finding::MuteInfo = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.securitycenter.v2.Finding.MuteInfo").msgclass + Finding::MuteInfo::StaticMute = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.securitycenter.v2.Finding.MuteInfo.StaticMute").msgclass + Finding::MuteInfo::DynamicMuteRecord = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.securitycenter.v2.Finding.MuteInfo.DynamicMuteRecord").msgclass + Finding::State = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.securitycenter.v2.Finding.State").enummodule + Finding::Severity = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.securitycenter.v2.Finding.Severity").enummodule + Finding::Mute = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.securitycenter.v2.Finding.Mute").enummodule + Finding::FindingClass = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.securitycenter.v2.Finding.FindingClass").enummodule + end + end + end +end diff --git a/owl-bot-staging/google-cloud-security_center-v2/lib/google/cloud/securitycenter/v2/folder_pb.rb b/owl-bot-staging/google-cloud-security_center-v2/lib/google/cloud/securitycenter/v2/folder_pb.rb new file mode 100644 index 000000000000..fe84677148ee --- /dev/null +++ b/owl-bot-staging/google-cloud-security_center-v2/lib/google/cloud/securitycenter/v2/folder_pb.rb @@ -0,0 +1,21 @@ +# frozen_string_literal: true +# Generated by the protocol buffer compiler. DO NOT EDIT! +# source: google/cloud/securitycenter/v2/folder.proto + +require 'google/protobuf' + + +descriptor_data = "\n+google/cloud/securitycenter/v2/folder.proto\x12\x1egoogle.cloud.securitycenter.v2\"G\n\x06\x46older\x12\x17\n\x0fresource_folder\x18\x01 \x01(\t\x12$\n\x1cresource_folder_display_name\x18\x02 \x01(\tB\xe5\x01\n\"com.google.cloud.securitycenter.v2B\x0b\x46olderProtoP\x01ZJcloud.google.com/go/securitycenter/apiv2/securitycenterpb;securitycenterpb\xaa\x02\x1eGoogle.Cloud.SecurityCenter.V2\xca\x02\x1eGoogle\\Cloud\\SecurityCenter\\V2\xea\x02!Google::Cloud::SecurityCenter::V2b\x06proto3" + +pool = ::Google::Protobuf::DescriptorPool.generated_pool +pool.add_serialized_file(descriptor_data) + +module Google + module Cloud + module SecurityCenter + module V2 + Folder = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.securitycenter.v2.Folder").msgclass + end + end + end +end diff --git a/owl-bot-staging/google-cloud-security_center-v2/lib/google/cloud/securitycenter/v2/group_membership_pb.rb b/owl-bot-staging/google-cloud-security_center-v2/lib/google/cloud/securitycenter/v2/group_membership_pb.rb new file mode 100644 index 000000000000..9f419b9c2065 --- /dev/null +++ b/owl-bot-staging/google-cloud-security_center-v2/lib/google/cloud/securitycenter/v2/group_membership_pb.rb @@ -0,0 +1,22 @@ +# frozen_string_literal: true +# Generated by the protocol buffer compiler. DO NOT EDIT! +# source: google/cloud/securitycenter/v2/group_membership.proto + +require 'google/protobuf' + + +descriptor_data = "\n5google/cloud/securitycenter/v2/group_membership.proto\x12\x1egoogle.cloud.securitycenter.v2\"\xd8\x01\n\x0fGroupMembership\x12M\n\ngroup_type\x18\x01 \x01(\x0e\x32\x39.google.cloud.securitycenter.v2.GroupMembership.GroupType\x12\x10\n\x08group_id\x18\x02 \x01(\t\"d\n\tGroupType\x12\x1a\n\x16GROUP_TYPE_UNSPECIFIED\x10\x00\x12 \n\x1cGROUP_TYPE_TOXIC_COMBINATION\x10\x01\x12\x19\n\x15GROUP_TYPE_CHOKEPOINT\x10\x03\x42\xee\x01\n\"com.google.cloud.securitycenter.v2B\x14GroupMembershipProtoP\x01ZJcloud.google.com/go/securitycenter/apiv2/securitycenterpb;securitycenterpb\xaa\x02\x1eGoogle.Cloud.SecurityCenter.V2\xca\x02\x1eGoogle\\Cloud\\SecurityCenter\\V2\xea\x02!Google::Cloud::SecurityCenter::V2b\x06proto3" + +pool = ::Google::Protobuf::DescriptorPool.generated_pool +pool.add_serialized_file(descriptor_data) + +module Google + module Cloud + module SecurityCenter + module V2 + GroupMembership = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.securitycenter.v2.GroupMembership").msgclass + GroupMembership::GroupType = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.securitycenter.v2.GroupMembership.GroupType").enummodule + end + end + end +end diff --git a/owl-bot-staging/google-cloud-security_center-v2/lib/google/cloud/securitycenter/v2/iam_binding_pb.rb b/owl-bot-staging/google-cloud-security_center-v2/lib/google/cloud/securitycenter/v2/iam_binding_pb.rb new file mode 100644 index 000000000000..16a3bb17f83a --- /dev/null +++ b/owl-bot-staging/google-cloud-security_center-v2/lib/google/cloud/securitycenter/v2/iam_binding_pb.rb @@ -0,0 +1,22 @@ +# frozen_string_literal: true +# Generated by the protocol buffer compiler. DO NOT EDIT! +# source: google/cloud/securitycenter/v2/iam_binding.proto + +require 'google/protobuf' + + +descriptor_data = "\n0google/cloud/securitycenter/v2/iam_binding.proto\x12\x1egoogle.cloud.securitycenter.v2\"\xa4\x01\n\nIamBinding\x12\x41\n\x06\x61\x63tion\x18\x01 \x01(\x0e\x32\x31.google.cloud.securitycenter.v2.IamBinding.Action\x12\x0c\n\x04role\x18\x02 \x01(\t\x12\x0e\n\x06member\x18\x03 \x01(\t\"5\n\x06\x41\x63tion\x12\x16\n\x12\x41\x43TION_UNSPECIFIED\x10\x00\x12\x07\n\x03\x41\x44\x44\x10\x01\x12\n\n\x06REMOVE\x10\x02\x42\xe9\x01\n\"com.google.cloud.securitycenter.v2B\x0fIamBindingProtoP\x01ZJcloud.google.com/go/securitycenter/apiv2/securitycenterpb;securitycenterpb\xaa\x02\x1eGoogle.Cloud.SecurityCenter.V2\xca\x02\x1eGoogle\\Cloud\\SecurityCenter\\V2\xea\x02!Google::Cloud::SecurityCenter::V2b\x06proto3" + +pool = ::Google::Protobuf::DescriptorPool.generated_pool +pool.add_serialized_file(descriptor_data) + +module Google + module Cloud + module SecurityCenter + module V2 + IamBinding = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.securitycenter.v2.IamBinding").msgclass + IamBinding::Action = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.securitycenter.v2.IamBinding.Action").enummodule + end + end + end +end diff --git a/owl-bot-staging/google-cloud-security_center-v2/lib/google/cloud/securitycenter/v2/indicator_pb.rb b/owl-bot-staging/google-cloud-security_center-v2/lib/google/cloud/securitycenter/v2/indicator_pb.rb new file mode 100644 index 000000000000..ed506ac1a11d --- /dev/null +++ b/owl-bot-staging/google-cloud-security_center-v2/lib/google/cloud/securitycenter/v2/indicator_pb.rb @@ -0,0 +1,26 @@ +# frozen_string_literal: true +# Generated by the protocol buffer compiler. DO NOT EDIT! +# source: google/cloud/securitycenter/v2/indicator.proto + +require 'google/protobuf' + + +descriptor_data = "\n.google/cloud/securitycenter/v2/indicator.proto\x12\x1egoogle.cloud.securitycenter.v2\"\xd9\x06\n\tIndicator\x12\x14\n\x0cip_addresses\x18\x01 \x03(\t\x12\x0f\n\x07\x64omains\x18\x02 \x03(\t\x12N\n\nsignatures\x18\x03 \x03(\x0b\x32:.google.cloud.securitycenter.v2.Indicator.ProcessSignature\x12\x0c\n\x04uris\x18\x04 \x03(\t\x1a\xc6\x05\n\x10ProcessSignature\x12o\n\x15memory_hash_signature\x18\x06 \x01(\x0b\x32N.google.cloud.securitycenter.v2.Indicator.ProcessSignature.MemoryHashSignatureH\x00\x12k\n\x13yara_rule_signature\x18\x07 \x01(\x0b\x32L.google.cloud.securitycenter.v2.Indicator.ProcessSignature.YaraRuleSignatureH\x00\x12`\n\x0esignature_type\x18\x08 \x01(\x0e\x32H.google.cloud.securitycenter.v2.Indicator.ProcessSignature.SignatureType\x1a\xd6\x01\n\x13MemoryHashSignature\x12\x15\n\rbinary_family\x18\x01 \x01(\t\x12l\n\ndetections\x18\x04 \x03(\x0b\x32X.google.cloud.securitycenter.v2.Indicator.ProcessSignature.MemoryHashSignature.Detection\x1a:\n\tDetection\x12\x0e\n\x06\x62inary\x18\x02 \x01(\t\x12\x1d\n\x15percent_pages_matched\x18\x03 \x01(\x01\x1a&\n\x11YaraRuleSignature\x12\x11\n\tyara_rule\x18\x05 \x01(\t\"d\n\rSignatureType\x12\x1e\n\x1aSIGNATURE_TYPE_UNSPECIFIED\x10\x00\x12\x1a\n\x16SIGNATURE_TYPE_PROCESS\x10\x01\x12\x17\n\x13SIGNATURE_TYPE_FILE\x10\x02\x42\x0b\n\tsignatureB\xe8\x01\n\"com.google.cloud.securitycenter.v2B\x0eIndicatorProtoP\x01ZJcloud.google.com/go/securitycenter/apiv2/securitycenterpb;securitycenterpb\xaa\x02\x1eGoogle.Cloud.SecurityCenter.V2\xca\x02\x1eGoogle\\Cloud\\SecurityCenter\\V2\xea\x02!Google::Cloud::SecurityCenter::V2b\x06proto3" + +pool = ::Google::Protobuf::DescriptorPool.generated_pool +pool.add_serialized_file(descriptor_data) + +module Google + module Cloud + module SecurityCenter + module V2 + Indicator = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.securitycenter.v2.Indicator").msgclass + Indicator::ProcessSignature = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.securitycenter.v2.Indicator.ProcessSignature").msgclass + Indicator::ProcessSignature::MemoryHashSignature = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.securitycenter.v2.Indicator.ProcessSignature.MemoryHashSignature").msgclass + Indicator::ProcessSignature::MemoryHashSignature::Detection = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.securitycenter.v2.Indicator.ProcessSignature.MemoryHashSignature.Detection").msgclass + Indicator::ProcessSignature::YaraRuleSignature = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.securitycenter.v2.Indicator.ProcessSignature.YaraRuleSignature").msgclass + Indicator::ProcessSignature::SignatureType = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.securitycenter.v2.Indicator.ProcessSignature.SignatureType").enummodule + end + end + end +end diff --git a/owl-bot-staging/google-cloud-security_center-v2/lib/google/cloud/securitycenter/v2/ip_rules_pb.rb b/owl-bot-staging/google-cloud-security_center-v2/lib/google/cloud/securitycenter/v2/ip_rules_pb.rb new file mode 100644 index 000000000000..b6597fce0c8c --- /dev/null +++ b/owl-bot-staging/google-cloud-security_center-v2/lib/google/cloud/securitycenter/v2/ip_rules_pb.rb @@ -0,0 +1,28 @@ +# frozen_string_literal: true +# Generated by the protocol buffer compiler. DO NOT EDIT! +# source: google/cloud/securitycenter/v2/ip_rules.proto + +require 'google/protobuf' + +require 'google/api/field_behavior_pb' + + +descriptor_data = "\n-google/cloud/securitycenter/v2/ip_rules.proto\x12\x1egoogle.cloud.securitycenter.v2\x1a\x1fgoogle/api/field_behavior.proto\"\xe2\x02\n\x07IpRules\x12\x44\n\tdirection\x18\x01 \x01(\x0e\x32\x31.google.cloud.securitycenter.v2.IpRules.Direction\x12:\n\x07\x61llowed\x18\x02 \x01(\x0b\x32\'.google.cloud.securitycenter.v2.AllowedH\x00\x12\x38\n\x06\x64\x65nied\x18\x03 \x01(\x0b\x32&.google.cloud.securitycenter.v2.DeniedH\x00\x12\x18\n\x10source_ip_ranges\x18\x04 \x03(\t\x12\x1d\n\x15\x64\x65stination_ip_ranges\x18\x05 \x03(\t\x12\x18\n\x10\x65xposed_services\x18\x06 \x03(\t\"?\n\tDirection\x12\x19\n\x15\x44IRECTION_UNSPECIFIED\x10\x00\x12\x0b\n\x07INGRESS\x10\x01\x12\n\n\x06\x45GRESS\x10\x02\x42\x07\n\x05rules\"\x8d\x01\n\x06IpRule\x12\x10\n\x08protocol\x18\x01 \x01(\t\x12J\n\x0bport_ranges\x18\x02 \x03(\x0b\x32\x30.google.cloud.securitycenter.v2.IpRule.PortRangeB\x03\xe0\x41\x01\x1a%\n\tPortRange\x12\x0b\n\x03min\x18\x01 \x01(\x03\x12\x0b\n\x03max\x18\x02 \x01(\x03\"H\n\x07\x41llowed\x12=\n\x08ip_rules\x18\x01 \x03(\x0b\x32&.google.cloud.securitycenter.v2.IpRuleB\x03\xe0\x41\x01\"G\n\x06\x44\x65nied\x12=\n\x08ip_rules\x18\x01 \x03(\x0b\x32&.google.cloud.securitycenter.v2.IpRuleB\x03\xe0\x41\x01\x42\xe6\x01\n\"com.google.cloud.securitycenter.v2B\x0cIpRulesProtoP\x01ZJcloud.google.com/go/securitycenter/apiv2/securitycenterpb;securitycenterpb\xaa\x02\x1eGoogle.Cloud.SecurityCenter.V2\xca\x02\x1eGoogle\\Cloud\\SecurityCenter\\V2\xea\x02!Google::Cloud::SecurityCenter::V2b\x06proto3" + +pool = ::Google::Protobuf::DescriptorPool.generated_pool +pool.add_serialized_file(descriptor_data) + +module Google + module Cloud + module SecurityCenter + module V2 + IpRules = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.securitycenter.v2.IpRules").msgclass + IpRules::Direction = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.securitycenter.v2.IpRules.Direction").enummodule + IpRule = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.securitycenter.v2.IpRule").msgclass + IpRule::PortRange = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.securitycenter.v2.IpRule.PortRange").msgclass + Allowed = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.securitycenter.v2.Allowed").msgclass + Denied = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.securitycenter.v2.Denied").msgclass + end + end + end +end diff --git a/owl-bot-staging/google-cloud-security_center-v2/lib/google/cloud/securitycenter/v2/job_pb.rb b/owl-bot-staging/google-cloud-security_center-v2/lib/google/cloud/securitycenter/v2/job_pb.rb new file mode 100644 index 000000000000..c079059f9826 --- /dev/null +++ b/owl-bot-staging/google-cloud-security_center-v2/lib/google/cloud/securitycenter/v2/job_pb.rb @@ -0,0 +1,24 @@ +# frozen_string_literal: true +# Generated by the protocol buffer compiler. DO NOT EDIT! +# source: google/cloud/securitycenter/v2/job.proto + +require 'google/protobuf' + +require 'google/api/field_behavior_pb' + + +descriptor_data = "\n(google/cloud/securitycenter/v2/job.proto\x12\x1egoogle.cloud.securitycenter.v2\x1a\x1fgoogle/api/field_behavior.proto\"w\n\x03Job\x12\x0c\n\x04name\x18\x01 \x01(\t\x12<\n\x05state\x18\x02 \x01(\x0e\x32(.google.cloud.securitycenter.v2.JobStateB\x03\xe0\x41\x03\x12\x12\n\nerror_code\x18\x03 \x01(\x05\x12\x10\n\x08location\x18\x04 \x01(\t*Z\n\x08JobState\x12\x19\n\x15JOB_STATE_UNSPECIFIED\x10\x00\x12\x0b\n\x07PENDING\x10\x01\x12\x0b\n\x07RUNNING\x10\x02\x12\r\n\tSUCCEEDED\x10\x03\x12\n\n\x06\x46\x41ILED\x10\x04\x42\xe2\x01\n\"com.google.cloud.securitycenter.v2B\x08JobProtoP\x01ZJcloud.google.com/go/securitycenter/apiv2/securitycenterpb;securitycenterpb\xaa\x02\x1eGoogle.Cloud.SecurityCenter.V2\xca\x02\x1eGoogle\\Cloud\\SecurityCenter\\V2\xea\x02!Google::Cloud::SecurityCenter::V2b\x06proto3" + +pool = ::Google::Protobuf::DescriptorPool.generated_pool +pool.add_serialized_file(descriptor_data) + +module Google + module Cloud + module SecurityCenter + module V2 + Job = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.securitycenter.v2.Job").msgclass + JobState = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.securitycenter.v2.JobState").enummodule + end + end + end +end diff --git a/owl-bot-staging/google-cloud-security_center-v2/lib/google/cloud/securitycenter/v2/kernel_rootkit_pb.rb b/owl-bot-staging/google-cloud-security_center-v2/lib/google/cloud/securitycenter/v2/kernel_rootkit_pb.rb new file mode 100644 index 000000000000..eba594bf469d --- /dev/null +++ b/owl-bot-staging/google-cloud-security_center-v2/lib/google/cloud/securitycenter/v2/kernel_rootkit_pb.rb @@ -0,0 +1,21 @@ +# frozen_string_literal: true +# Generated by the protocol buffer compiler. DO NOT EDIT! +# source: google/cloud/securitycenter/v2/kernel_rootkit.proto + +require 'google/protobuf' + + +descriptor_data = "\n3google/cloud/securitycenter/v2/kernel_rootkit.proto\x12\x1egoogle.cloud.securitycenter.v2\"\xd7\x02\n\rKernelRootkit\x12\x0c\n\x04name\x18\x01 \x01(\t\x12$\n\x1cunexpected_code_modification\x18\x02 \x01(\x08\x12.\n&unexpected_read_only_data_modification\x18\x03 \x01(\x08\x12!\n\x19unexpected_ftrace_handler\x18\x04 \x01(\x08\x12!\n\x19unexpected_kprobe_handler\x18\x05 \x01(\x08\x12$\n\x1cunexpected_kernel_code_pages\x18\x06 \x01(\x08\x12&\n\x1eunexpected_system_call_handler\x18\x07 \x01(\x08\x12$\n\x1cunexpected_interrupt_handler\x18\x08 \x01(\x08\x12(\n unexpected_processes_in_runqueue\x18\t \x01(\x08\x42\xec\x01\n\"com.google.cloud.securitycenter.v2B\x12KernelRootkitProtoP\x01ZJcloud.google.com/go/securitycenter/apiv2/securitycenterpb;securitycenterpb\xaa\x02\x1eGoogle.Cloud.SecurityCenter.V2\xca\x02\x1eGoogle\\Cloud\\SecurityCenter\\V2\xea\x02!Google::Cloud::SecurityCenter::V2b\x06proto3" + +pool = ::Google::Protobuf::DescriptorPool.generated_pool +pool.add_serialized_file(descriptor_data) + +module Google + module Cloud + module SecurityCenter + module V2 + KernelRootkit = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.securitycenter.v2.KernelRootkit").msgclass + end + end + end +end diff --git a/owl-bot-staging/google-cloud-security_center-v2/lib/google/cloud/securitycenter/v2/kubernetes_pb.rb b/owl-bot-staging/google-cloud-security_center-v2/lib/google/cloud/securitycenter/v2/kubernetes_pb.rb new file mode 100644 index 000000000000..2f1bf77bd0f6 --- /dev/null +++ b/owl-bot-staging/google-cloud-security_center-v2/lib/google/cloud/securitycenter/v2/kubernetes_pb.rb @@ -0,0 +1,34 @@ +# frozen_string_literal: true +# Generated by the protocol buffer compiler. DO NOT EDIT! +# source: google/cloud/securitycenter/v2/kubernetes.proto + +require 'google/protobuf' + +require 'google/cloud/securitycenter/v2/container_pb' +require 'google/cloud/securitycenter/v2/label_pb' + + +descriptor_data = "\n/google/cloud/securitycenter/v2/kubernetes.proto\x12\x1egoogle.cloud.securitycenter.v2\x1a.google/cloud/securitycenter/v2/container.proto\x1a*google/cloud/securitycenter/v2/label.proto\"\x82\x0c\n\nKubernetes\x12<\n\x04pods\x18\x01 \x03(\x0b\x32..google.cloud.securitycenter.v2.Kubernetes.Pod\x12>\n\x05nodes\x18\x02 \x03(\x0b\x32/.google.cloud.securitycenter.v2.Kubernetes.Node\x12G\n\nnode_pools\x18\x03 \x03(\x0b\x32\x33.google.cloud.securitycenter.v2.Kubernetes.NodePool\x12>\n\x05roles\x18\x04 \x03(\x0b\x32/.google.cloud.securitycenter.v2.Kubernetes.Role\x12\x44\n\x08\x62indings\x18\x05 \x03(\x0b\x32\x32.google.cloud.securitycenter.v2.Kubernetes.Binding\x12O\n\x0e\x61\x63\x63\x65ss_reviews\x18\x06 \x03(\x0b\x32\x37.google.cloud.securitycenter.v2.Kubernetes.AccessReview\x12\x42\n\x07objects\x18\x07 \x03(\x0b\x32\x31.google.cloud.securitycenter.v2.Kubernetes.Object\x1a\x95\x01\n\x03Pod\x12\n\n\x02ns\x18\x01 \x01(\t\x12\x0c\n\x04name\x18\x02 \x01(\t\x12\x35\n\x06labels\x18\x03 \x03(\x0b\x32%.google.cloud.securitycenter.v2.Label\x12=\n\ncontainers\x18\x04 \x03(\x0b\x32).google.cloud.securitycenter.v2.Container\x1a\x14\n\x04Node\x12\x0c\n\x04name\x18\x01 \x01(\t\x1aX\n\x08NodePool\x12\x0c\n\x04name\x18\x01 \x01(\t\x12>\n\x05nodes\x18\x02 \x03(\x0b\x32/.google.cloud.securitycenter.v2.Kubernetes.Node\x1a\x9e\x01\n\x04Role\x12\x42\n\x04kind\x18\x01 \x01(\x0e\x32\x34.google.cloud.securitycenter.v2.Kubernetes.Role.Kind\x12\n\n\x02ns\x18\x02 \x01(\t\x12\x0c\n\x04name\x18\x03 \x01(\t\"8\n\x04Kind\x12\x14\n\x10KIND_UNSPECIFIED\x10\x00\x12\x08\n\x04ROLE\x10\x01\x12\x10\n\x0c\x43LUSTER_ROLE\x10\x02\x1a\xa8\x01\n\x07\x42inding\x12\n\n\x02ns\x18\x01 \x01(\t\x12\x0c\n\x04name\x18\x02 \x01(\t\x12=\n\x04role\x18\x03 \x01(\x0b\x32/.google.cloud.securitycenter.v2.Kubernetes.Role\x12\x44\n\x08subjects\x18\x04 \x03(\x0b\x32\x32.google.cloud.securitycenter.v2.Kubernetes.Subject\x1a\xbe\x01\n\x07Subject\x12I\n\x04kind\x18\x01 \x01(\x0e\x32;.google.cloud.securitycenter.v2.Kubernetes.Subject.AuthType\x12\n\n\x02ns\x18\x02 \x01(\t\x12\x0c\n\x04name\x18\x03 \x01(\t\"N\n\x08\x41uthType\x12\x19\n\x15\x41UTH_TYPE_UNSPECIFIED\x10\x00\x12\x08\n\x04USER\x10\x01\x12\x12\n\x0eSERVICEACCOUNT\x10\x02\x12\t\n\x05GROUP\x10\x03\x1a}\n\x0c\x41\x63\x63\x65ssReview\x12\r\n\x05group\x18\x01 \x01(\t\x12\n\n\x02ns\x18\x02 \x01(\t\x12\x0c\n\x04name\x18\x03 \x01(\t\x12\x10\n\x08resource\x18\x04 \x01(\t\x12\x13\n\x0bsubresource\x18\x05 \x01(\t\x12\x0c\n\x04verb\x18\x06 \x01(\t\x12\x0f\n\x07version\x18\x07 \x01(\t\x1a~\n\x06Object\x12\r\n\x05group\x18\x01 \x01(\t\x12\x0c\n\x04kind\x18\x02 \x01(\t\x12\n\n\x02ns\x18\x03 \x01(\t\x12\x0c\n\x04name\x18\x04 \x01(\t\x12=\n\ncontainers\x18\x05 \x03(\x0b\x32).google.cloud.securitycenter.v2.ContainerB\xe9\x01\n\"com.google.cloud.securitycenter.v2B\x0fKubernetesProtoP\x01ZJcloud.google.com/go/securitycenter/apiv2/securitycenterpb;securitycenterpb\xaa\x02\x1eGoogle.Cloud.SecurityCenter.V2\xca\x02\x1eGoogle\\Cloud\\SecurityCenter\\V2\xea\x02!Google::Cloud::SecurityCenter::V2b\x06proto3" + +pool = ::Google::Protobuf::DescriptorPool.generated_pool +pool.add_serialized_file(descriptor_data) + +module Google + module Cloud + module SecurityCenter + module V2 + Kubernetes = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.securitycenter.v2.Kubernetes").msgclass + Kubernetes::Pod = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.securitycenter.v2.Kubernetes.Pod").msgclass + Kubernetes::Node = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.securitycenter.v2.Kubernetes.Node").msgclass + Kubernetes::NodePool = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.securitycenter.v2.Kubernetes.NodePool").msgclass + Kubernetes::Role = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.securitycenter.v2.Kubernetes.Role").msgclass + Kubernetes::Role::Kind = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.securitycenter.v2.Kubernetes.Role.Kind").enummodule + Kubernetes::Binding = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.securitycenter.v2.Kubernetes.Binding").msgclass + Kubernetes::Subject = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.securitycenter.v2.Kubernetes.Subject").msgclass + Kubernetes::Subject::AuthType = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.securitycenter.v2.Kubernetes.Subject.AuthType").enummodule + Kubernetes::AccessReview = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.securitycenter.v2.Kubernetes.AccessReview").msgclass + Kubernetes::Object = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.securitycenter.v2.Kubernetes.Object").msgclass + end + end + end +end diff --git a/owl-bot-staging/google-cloud-security_center-v2/lib/google/cloud/securitycenter/v2/label_pb.rb b/owl-bot-staging/google-cloud-security_center-v2/lib/google/cloud/securitycenter/v2/label_pb.rb new file mode 100644 index 000000000000..3cdb278899ec --- /dev/null +++ b/owl-bot-staging/google-cloud-security_center-v2/lib/google/cloud/securitycenter/v2/label_pb.rb @@ -0,0 +1,21 @@ +# frozen_string_literal: true +# Generated by the protocol buffer compiler. DO NOT EDIT! +# source: google/cloud/securitycenter/v2/label.proto + +require 'google/protobuf' + + +descriptor_data = "\n*google/cloud/securitycenter/v2/label.proto\x12\x1egoogle.cloud.securitycenter.v2\"$\n\x05Label\x12\x0c\n\x04name\x18\x01 \x01(\t\x12\r\n\x05value\x18\x02 \x01(\tB\xe4\x01\n\"com.google.cloud.securitycenter.v2B\nLabelProtoP\x01ZJcloud.google.com/go/securitycenter/apiv2/securitycenterpb;securitycenterpb\xaa\x02\x1eGoogle.Cloud.SecurityCenter.V2\xca\x02\x1eGoogle\\Cloud\\SecurityCenter\\V2\xea\x02!Google::Cloud::SecurityCenter::V2b\x06proto3" + +pool = ::Google::Protobuf::DescriptorPool.generated_pool +pool.add_serialized_file(descriptor_data) + +module Google + module Cloud + module SecurityCenter + module V2 + Label = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.securitycenter.v2.Label").msgclass + end + end + end +end diff --git a/owl-bot-staging/google-cloud-security_center-v2/lib/google/cloud/securitycenter/v2/load_balancer_pb.rb b/owl-bot-staging/google-cloud-security_center-v2/lib/google/cloud/securitycenter/v2/load_balancer_pb.rb new file mode 100644 index 000000000000..b23d3a4cfd9f --- /dev/null +++ b/owl-bot-staging/google-cloud-security_center-v2/lib/google/cloud/securitycenter/v2/load_balancer_pb.rb @@ -0,0 +1,21 @@ +# frozen_string_literal: true +# Generated by the protocol buffer compiler. DO NOT EDIT! +# source: google/cloud/securitycenter/v2/load_balancer.proto + +require 'google/protobuf' + + +descriptor_data = "\n2google/cloud/securitycenter/v2/load_balancer.proto\x12\x1egoogle.cloud.securitycenter.v2\"\x1c\n\x0cLoadBalancer\x12\x0c\n\x04name\x18\x01 \x01(\tB\xeb\x01\n\"com.google.cloud.securitycenter.v2B\x11LoadBalancerProtoP\x01ZJcloud.google.com/go/securitycenter/apiv2/securitycenterpb;securitycenterpb\xaa\x02\x1eGoogle.Cloud.SecurityCenter.V2\xca\x02\x1eGoogle\\Cloud\\SecurityCenter\\V2\xea\x02!Google::Cloud::SecurityCenter::V2b\x06proto3" + +pool = ::Google::Protobuf::DescriptorPool.generated_pool +pool.add_serialized_file(descriptor_data) + +module Google + module Cloud + module SecurityCenter + module V2 + LoadBalancer = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.securitycenter.v2.LoadBalancer").msgclass + end + end + end +end diff --git a/owl-bot-staging/google-cloud-security_center-v2/lib/google/cloud/securitycenter/v2/log_entry_pb.rb b/owl-bot-staging/google-cloud-security_center-v2/lib/google/cloud/securitycenter/v2/log_entry_pb.rb new file mode 100644 index 000000000000..b3704ddc1826 --- /dev/null +++ b/owl-bot-staging/google-cloud-security_center-v2/lib/google/cloud/securitycenter/v2/log_entry_pb.rb @@ -0,0 +1,24 @@ +# frozen_string_literal: true +# Generated by the protocol buffer compiler. DO NOT EDIT! +# source: google/cloud/securitycenter/v2/log_entry.proto + +require 'google/protobuf' + +require 'google/protobuf/timestamp_pb' + + +descriptor_data = "\n.google/cloud/securitycenter/v2/log_entry.proto\x12\x1egoogle.cloud.securitycenter.v2\x1a\x1fgoogle/protobuf/timestamp.proto\"i\n\x08LogEntry\x12P\n\x13\x63loud_logging_entry\x18\x01 \x01(\x0b\x32\x31.google.cloud.securitycenter.v2.CloudLoggingEntryH\x00\x42\x0b\n\tlog_entry\"\x81\x01\n\x11\x43loudLoggingEntry\x12\x11\n\tinsert_id\x18\x01 \x01(\t\x12\x0e\n\x06log_id\x18\x02 \x01(\t\x12\x1a\n\x12resource_container\x18\x03 \x01(\t\x12-\n\ttimestamp\x18\x04 \x01(\x0b\x32\x1a.google.protobuf.TimestampB\xe7\x01\n\"com.google.cloud.securitycenter.v2B\rLogEntryProtoP\x01ZJcloud.google.com/go/securitycenter/apiv2/securitycenterpb;securitycenterpb\xaa\x02\x1eGoogle.Cloud.SecurityCenter.V2\xca\x02\x1eGoogle\\Cloud\\SecurityCenter\\V2\xea\x02!Google::Cloud::SecurityCenter::V2b\x06proto3" + +pool = ::Google::Protobuf::DescriptorPool.generated_pool +pool.add_serialized_file(descriptor_data) + +module Google + module Cloud + module SecurityCenter + module V2 + LogEntry = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.securitycenter.v2.LogEntry").msgclass + CloudLoggingEntry = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.securitycenter.v2.CloudLoggingEntry").msgclass + end + end + end +end diff --git a/owl-bot-staging/google-cloud-security_center-v2/lib/google/cloud/securitycenter/v2/mitre_attack_pb.rb b/owl-bot-staging/google-cloud-security_center-v2/lib/google/cloud/securitycenter/v2/mitre_attack_pb.rb new file mode 100644 index 000000000000..08d45bd18d1a --- /dev/null +++ b/owl-bot-staging/google-cloud-security_center-v2/lib/google/cloud/securitycenter/v2/mitre_attack_pb.rb @@ -0,0 +1,23 @@ +# frozen_string_literal: true +# Generated by the protocol buffer compiler. DO NOT EDIT! +# source: google/cloud/securitycenter/v2/mitre_attack.proto + +require 'google/protobuf' + + +descriptor_data = "\n1google/cloud/securitycenter/v2/mitre_attack.proto\x12\x1egoogle.cloud.securitycenter.v2\"\xca%\n\x0bMitreAttack\x12J\n\x0eprimary_tactic\x18\x01 \x01(\x0e\x32\x32.google.cloud.securitycenter.v2.MitreAttack.Tactic\x12Q\n\x12primary_techniques\x18\x02 \x03(\x0e\x32\x35.google.cloud.securitycenter.v2.MitreAttack.Technique\x12N\n\x12\x61\x64\x64itional_tactics\x18\x03 \x03(\x0e\x32\x32.google.cloud.securitycenter.v2.MitreAttack.Tactic\x12T\n\x15\x61\x64\x64itional_techniques\x18\x04 \x03(\x0e\x32\x35.google.cloud.securitycenter.v2.MitreAttack.Technique\x12\x0f\n\x07version\x18\x05 \x01(\t\"\xb4\x02\n\x06Tactic\x12\x16\n\x12TACTIC_UNSPECIFIED\x10\x00\x12\x12\n\x0eRECONNAISSANCE\x10\x01\x12\x18\n\x14RESOURCE_DEVELOPMENT\x10\x02\x12\x12\n\x0eINITIAL_ACCESS\x10\x05\x12\r\n\tEXECUTION\x10\x03\x12\x0f\n\x0bPERSISTENCE\x10\x06\x12\x18\n\x14PRIVILEGE_ESCALATION\x10\x08\x12\x13\n\x0f\x44\x45\x46\x45NSE_EVASION\x10\x07\x12\x15\n\x11\x43REDENTIAL_ACCESS\x10\t\x12\r\n\tDISCOVERY\x10\n\x12\x14\n\x10LATERAL_MOVEMENT\x10\x0b\x12\x0e\n\nCOLLECTION\x10\x0c\x12\x17\n\x13\x43OMMAND_AND_CONTROL\x10\x04\x12\x10\n\x0c\x45XFILTRATION\x10\r\x12\n\n\x06IMPACT\x10\x0e\"\xad \n\tTechnique\x12\x19\n\x15TECHNIQUE_UNSPECIFIED\x10\x00\x12\x14\n\x10\x44\x41TA_OBFUSCATION\x10\x46\x12\"\n\x1e\x44\x41TA_OBFUSCATION_STEGANOGRAPHY\x10G\x12\x19\n\x15OS_CREDENTIAL_DUMPING\x10r\x12)\n%OS_CREDENTIAL_DUMPING_PROC_FILESYSTEM\x10s\x12\x35\n1OS_CREDENTIAL_DUMPING_ETC_PASSWORD_AND_ETC_SHADOW\x10z\x12\x1a\n\x16\x44\x41TA_FROM_LOCAL_SYSTEM\x10u\x12\x1a\n\x16\x41UTOMATED_EXFILTRATION\x10\x44\x12\x1c\n\x18OBFUSCATED_FILES_OR_INFO\x10H\x12\x11\n\rSTEGANOGRAPHY\x10I\x12\x1a\n\x16\x43OMPILE_AFTER_DELIVERY\x10J\x12\x17\n\x13\x43OMMAND_OBFUSCATION\x10K\x12\x16\n\x12SCHEDULED_TRANSFER\x10x\x12\x1f\n\x1bSYSTEM_OWNER_USER_DISCOVERY\x10v\x12\x10\n\x0cMASQUERADING\x10\x31\x12%\n!MATCH_LEGITIMATE_NAME_OR_LOCATION\x10\x32\x12(\n$BOOT_OR_LOGON_INITIALIZATION_SCRIPTS\x10%\x12\x11\n\rSTARTUP_ITEMS\x10&\x12\x1d\n\x19NETWORK_SERVICE_DISCOVERY\x10 \x12\x16\n\x12SCHEDULED_TASK_JOB\x10Y\x12\x1b\n\x17SCHEDULED_TASK_JOB_CRON\x10w\x12\x1f\n\x1b\x43ONTAINER_ORCHESTRATION_JOB\x10Z\x12\x15\n\x11PROCESS_INJECTION\x10]\x12\x11\n\rINPUT_CAPTURE\x10g\x12\x1c\n\x18INPUT_CAPTURE_KEYLOGGING\x10h\x12\x15\n\x11PROCESS_DISCOVERY\x10\x38\x12%\n!COMMAND_AND_SCRIPTING_INTERPRETER\x10\x06\x12\x0e\n\nUNIX_SHELL\x10\x07\x12\n\n\x06PYTHON\x10;\x12)\n%EXPLOITATION_FOR_PRIVILEGE_ESCALATION\x10?\x12\x1f\n\x1bPERMISSION_GROUPS_DISCOVERY\x10\x12\x12\x10\n\x0c\x43LOUD_GROUPS\x10\x13\x12\x15\n\x11INDICATOR_REMOVAL\x10{\x12\x34\n0INDICATOR_REMOVAL_CLEAR_LINUX_OR_MAC_SYSTEM_LOGS\x10|\x12+\n\'INDICATOR_REMOVAL_CLEAR_COMMAND_HISTORY\x10}\x12#\n\x1fINDICATOR_REMOVAL_FILE_DELETION\x10@\x12 \n\x1bINDICATOR_REMOVAL_TIMESTOMP\x10\x80\x01\x12(\n$INDICATOR_REMOVAL_CLEAR_MAILBOX_DATA\x10~\x12\x1e\n\x1a\x41PPLICATION_LAYER_PROTOCOL\x10-\x12\x07\n\x03\x44NS\x10.\x12\x1d\n\x19SOFTWARE_DEPLOYMENT_TOOLS\x10/\x12\x12\n\x0eVALID_ACCOUNTS\x10\x0e\x12\x14\n\x10\x44\x45\x46\x41ULT_ACCOUNTS\x10#\x12\x12\n\x0eLOCAL_ACCOUNTS\x10\x0f\x12\x12\n\x0e\x43LOUD_ACCOUNTS\x10\x10\x12 \n\x1c\x46ILE_AND_DIRECTORY_DISCOVERY\x10y\x12#\n\x1f\x41\x43\x43OUNT_DISCOVERY_LOCAL_ACCOUNT\x10t\x12\t\n\x05PROXY\x10\t\x12\x12\n\x0e\x45XTERNAL_PROXY\x10\n\x12\x13\n\x0fMULTI_HOP_PROXY\x10\x0b\x12\x18\n\x14\x41\x43\x43OUNT_MANIPULATION\x10\x16\x12 \n\x1c\x41\x44\x44ITIONAL_CLOUD_CREDENTIALS\x10(\x12\x1a\n\x16\x41\x44\x44ITIONAL_CLOUD_ROLES\x10\x43\x12\x17\n\x13SSH_AUTHORIZED_KEYS\x10\x17\x12&\n\"ADDITIONAL_CONTAINER_CLUSTER_ROLES\x10:\x12\x18\n\x14MULTI_STAGE_CHANNELS\x10L\x12\x19\n\x15INGRESS_TOOL_TRANSFER\x10\x03\x12\x0e\n\nNATIVE_API\x10\x04\x12\x0f\n\x0b\x42RUTE_FORCE\x10,\x12\x18\n\x14\x41UTOMATED_COLLECTION\x10^\x12\x12\n\x0eSHARED_MODULES\x10\x05\x12\x11\n\rDATA_ENCODING\x10M\x12\x15\n\x11STANDARD_ENCODING\x10N\x12\x1d\n\x19\x41\x43\x43\x45SS_TOKEN_MANIPULATION\x10!\x12 \n\x1cTOKEN_IMPERSONATION_OR_THEFT\x10\'\x12\x12\n\x0e\x43REATE_ACCOUNT\x10O\x12\x11\n\rLOCAL_ACCOUNT\x10P\x12$\n DEOBFUSCATE_DECODE_FILES_OR_INFO\x10_\x12%\n!EXPLOIT_PUBLIC_FACING_APPLICATION\x10\x1b\x12\x1c\n\x17SUPPLY_CHAIN_COMPROMISE\x10\x81\x01\x12;\n6COMPROMISE_SOFTWARE_DEPENDENCIES_AND_DEVELOPMENT_TOOLS\x10\x82\x01\x12&\n!EXPLOITATION_FOR_CLIENT_EXECUTION\x10\x86\x01\x12\x12\n\x0eUSER_EXECUTION\x10\x45\x12>\n9LINUX_AND_MAC_FILE_AND_DIRECTORY_PERMISSIONS_MODIFICATION\x10\x87\x01\x12\x1e\n\x1a\x44OMAIN_POLICY_MODIFICATION\x10\x1e\x12\x14\n\x10\x44\x41TA_DESTRUCTION\x10\x1d\x12\x1e\n\x19\x44\x41TA_ENCRYPTED_FOR_IMPACT\x10\x84\x01\x12\x10\n\x0cSERVICE_STOP\x10\x34\x12\x1b\n\x17INHIBIT_SYSTEM_RECOVERY\x10$\x12\x17\n\x13\x46IRMWARE_CORRUPTION\x10Q\x12\x16\n\x12RESOURCE_HIJACKING\x10\x08\x12\x1d\n\x19NETWORK_DENIAL_OF_SERVICE\x10\x11\x12\x1b\n\x17\x43LOUD_SERVICE_DISCOVERY\x10\x30\x12\"\n\x1eSTEAL_APPLICATION_ACCESS_TOKEN\x10*\x12\x1a\n\x16\x41\x43\x43OUNT_ACCESS_REMOVAL\x10\x33\x12\"\n\x1eTRANSFER_DATA_TO_CLOUD_ACCOUNT\x10[\x12\x1c\n\x18STEAL_WEB_SESSION_COOKIE\x10\x19\x12#\n\x1f\x43REATE_OR_MODIFY_SYSTEM_PROCESS\x10\x18\x12\x1d\n\x19\x45VENT_TRIGGERED_EXECUTION\x10\x41\x12%\n!BOOT_OR_LOGON_AUTOSTART_EXECUTION\x10R\x12!\n\x1dKERNEL_MODULES_AND_EXTENSIONS\x10S\x12\x19\n\x15SHORTCUT_MODIFICATION\x10\x7f\x12%\n!ABUSE_ELEVATION_CONTROL_MECHANISM\x10\"\x12\x38\n3ABUSE_ELEVATION_CONTROL_MECHANISM_SETUID_AND_SETGID\x10\x88\x01\x12;\n7ABUSE_ELEVATION_CONTROL_MECHANISM_SUDO_AND_SUDO_CACHING\x10m\x12\x19\n\x15UNSECURED_CREDENTIALS\x10\r\x12\x18\n\x14\x43REDENTIALS_IN_FILES\x10i\x12\x10\n\x0c\x42\x41SH_HISTORY\x10`\x12\x10\n\x0cPRIVATE_KEYS\x10\x61\x12\x19\n\x15SUBVERT_TRUST_CONTROL\x10j\x12\x1c\n\x18INSTALL_ROOT_CERTIFICATE\x10k\x12#\n\x1f\x43OMPROMISE_HOST_SOFTWARE_BINARY\x10T\x12$\n CREDENTIALS_FROM_PASSWORD_STORES\x10\x62\x12!\n\x1dMODIFY_AUTHENTICATION_PROCESS\x10\x1c\x12$\n PLUGGABLE_AUTHENTICATION_MODULES\x10l\x12 \n\x1bMULTI_FACTOR_AUTHENTICATION\x10\x89\x01\x12\x13\n\x0fIMPAIR_DEFENSES\x10\x1f\x12\x1b\n\x17\x44ISABLE_OR_MODIFY_TOOLS\x10\x37\x12\x16\n\x12INDICATOR_BLOCKING\x10n\x12(\n$DISABLE_OR_MODIFY_LINUX_AUDIT_SYSTEM\x10o\x12\x12\n\x0eHIDE_ARTIFACTS\x10U\x12 \n\x1cHIDDEN_FILES_AND_DIRECTORIES\x10V\x12\x10\n\x0cHIDDEN_USERS\x10W\x12!\n\x1d\x45XFILTRATION_OVER_WEB_SERVICE\x10\x14\x12!\n\x1d\x45XFILTRATION_TO_CLOUD_STORAGE\x10\x15\x12\x16\n\x12\x44YNAMIC_RESOLUTION\x10\x0c\x12\x19\n\x15LATERAL_TOOL_TRANSFER\x10)\x12\x19\n\x15HIJACK_EXECUTION_FLOW\x10p\x12\x32\n.HIJACK_EXECUTION_FLOW_DYNAMIC_LINKER_HIJACKING\x10q\x12\'\n#MODIFY_CLOUD_COMPUTE_INFRASTRUCTURE\x10\x1a\x12\x13\n\x0f\x43REATE_SNAPSHOT\x10\x36\x12\"\n\x1e\x43LOUD_INFRASTRUCTURE_DISCOVERY\x10\x35\x12\x18\n\x14\x44\x45VELOP_CAPABILITIES\x10\x63\x12 \n\x1c\x44\x45VELOP_CAPABILITIES_MALWARE\x10\x64\x12\x17\n\x13OBTAIN_CAPABILITIES\x10+\x12\x1f\n\x1bOBTAIN_CAPABILITIES_MALWARE\x10\x65\x12(\n#OBTAIN_CAPABILITIES_VULNERABILITIES\x10\x85\x01\x12\x13\n\x0f\x41\x43TIVE_SCANNING\x10\x01\x12\x16\n\x12SCANNING_IP_BLOCKS\x10\x02\x12\x16\n\x12STAGE_CAPABILITIES\x10X\x12\x12\n\x0eUPLOAD_MALWARE\x10\x66\x12$\n CONTAINER_ADMINISTRATION_COMMAND\x10<\x12\x14\n\x10\x44\x45PLOY_CONTAINER\x10\x42\x12\x12\n\x0e\x45SCAPE_TO_HOST\x10=\x12$\n CONTAINER_AND_RESOURCE_DISCOVERY\x10\x39\x12\x1b\n\x17REFLECTIVE_CODE_LOADING\x10\\\x12.\n*STEAL_OR_FORGE_AUTHENTICATION_CERTIFICATES\x10>\x12\x14\n\x0f\x46INANCIAL_THEFT\x10\x83\x01\x42\xea\x01\n\"com.google.cloud.securitycenter.v2B\x10MitreAttackProtoP\x01ZJcloud.google.com/go/securitycenter/apiv2/securitycenterpb;securitycenterpb\xaa\x02\x1eGoogle.Cloud.SecurityCenter.V2\xca\x02\x1eGoogle\\Cloud\\SecurityCenter\\V2\xea\x02!Google::Cloud::SecurityCenter::V2b\x06proto3" + +pool = ::Google::Protobuf::DescriptorPool.generated_pool +pool.add_serialized_file(descriptor_data) + +module Google + module Cloud + module SecurityCenter + module V2 + MitreAttack = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.securitycenter.v2.MitreAttack").msgclass + MitreAttack::Tactic = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.securitycenter.v2.MitreAttack.Tactic").enummodule + MitreAttack::Technique = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.securitycenter.v2.MitreAttack.Technique").enummodule + end + end + end +end diff --git a/owl-bot-staging/google-cloud-security_center-v2/lib/google/cloud/securitycenter/v2/mute_config_pb.rb b/owl-bot-staging/google-cloud-security_center-v2/lib/google/cloud/securitycenter/v2/mute_config_pb.rb new file mode 100644 index 000000000000..1fa427767438 --- /dev/null +++ b/owl-bot-staging/google-cloud-security_center-v2/lib/google/cloud/securitycenter/v2/mute_config_pb.rb @@ -0,0 +1,26 @@ +# frozen_string_literal: true +# Generated by the protocol buffer compiler. DO NOT EDIT! +# source: google/cloud/securitycenter/v2/mute_config.proto + +require 'google/protobuf' + +require 'google/api/field_behavior_pb' +require 'google/api/resource_pb' +require 'google/protobuf/timestamp_pb' + + +descriptor_data = "\n0google/cloud/securitycenter/v2/mute_config.proto\x12\x1egoogle.cloud.securitycenter.v2\x1a\x1fgoogle/api/field_behavior.proto\x1a\x19google/api/resource.proto\x1a\x1fgoogle/protobuf/timestamp.proto\"\xd4\x06\n\nMuteConfig\x12\x11\n\x04name\x18\x01 \x01(\tB\x03\xe0\x41\x08\x12\x13\n\x0b\x64\x65scription\x18\x02 \x01(\t\x12\x13\n\x06\x66ilter\x18\x03 \x01(\tB\x03\xe0\x41\x02\x12\x34\n\x0b\x63reate_time\x18\x04 \x01(\x0b\x32\x1a.google.protobuf.TimestampB\x03\xe0\x41\x03\x12\x34\n\x0bupdate_time\x18\x05 \x01(\x0b\x32\x1a.google.protobuf.TimestampB\x03\xe0\x41\x03\x12\x1f\n\x12most_recent_editor\x18\x06 \x01(\tB\x03\xe0\x41\x03\x12L\n\x04type\x18\x08 \x01(\x0e\x32\x39.google.cloud.securitycenter.v2.MuteConfig.MuteConfigTypeB\x03\xe0\x41\x02\x12\x34\n\x0b\x65xpiry_time\x18\t \x01(\x0b\x32\x1a.google.protobuf.TimestampB\x03\xe0\x41\x01\"K\n\x0eMuteConfigType\x12 \n\x1cMUTE_CONFIG_TYPE_UNSPECIFIED\x10\x00\x12\n\n\x06STATIC\x10\x01\x12\x0b\n\x07\x44YNAMIC\x10\x02:\xaa\x03\xea\x41\xa6\x03\n(securitycenter.googleapis.com/MuteConfig\x12\x36organizations/{organization}/muteConfigs/{mute_config}\x12Korganizations/{organization}/locations/{location}/muteConfigs/{mute_config}\x12*folders/{folder}/muteConfigs/{mute_config}\x12?folders/{folder}/locations/{location}/muteConfigs/{mute_config}\x12,projects/{project}/muteConfigs/{mute_config}\x12\x41projects/{project}/locations/{location}/muteConfigs/{mute_config}*\x0bmuteConfigs2\nmuteConfigB\xe9\x01\n\"com.google.cloud.securitycenter.v2B\x0fMuteConfigProtoP\x01ZJcloud.google.com/go/securitycenter/apiv2/securitycenterpb;securitycenterpb\xaa\x02\x1eGoogle.Cloud.SecurityCenter.V2\xca\x02\x1eGoogle\\Cloud\\SecurityCenter\\V2\xea\x02!Google::Cloud::SecurityCenter::V2b\x06proto3" + +pool = ::Google::Protobuf::DescriptorPool.generated_pool +pool.add_serialized_file(descriptor_data) + +module Google + module Cloud + module SecurityCenter + module V2 + MuteConfig = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.securitycenter.v2.MuteConfig").msgclass + MuteConfig::MuteConfigType = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.securitycenter.v2.MuteConfig.MuteConfigType").enummodule + end + end + end +end diff --git a/owl-bot-staging/google-cloud-security_center-v2/lib/google/cloud/securitycenter/v2/network_pb.rb b/owl-bot-staging/google-cloud-security_center-v2/lib/google/cloud/securitycenter/v2/network_pb.rb new file mode 100644 index 000000000000..b3adfa3e0d12 --- /dev/null +++ b/owl-bot-staging/google-cloud-security_center-v2/lib/google/cloud/securitycenter/v2/network_pb.rb @@ -0,0 +1,21 @@ +# frozen_string_literal: true +# Generated by the protocol buffer compiler. DO NOT EDIT! +# source: google/cloud/securitycenter/v2/network.proto + +require 'google/protobuf' + + +descriptor_data = "\n,google/cloud/securitycenter/v2/network.proto\x12\x1egoogle.cloud.securitycenter.v2\"\x17\n\x07Network\x12\x0c\n\x04name\x18\x01 \x01(\tB\xe6\x01\n\"com.google.cloud.securitycenter.v2B\x0cNetworkProtoP\x01ZJcloud.google.com/go/securitycenter/apiv2/securitycenterpb;securitycenterpb\xaa\x02\x1eGoogle.Cloud.SecurityCenter.V2\xca\x02\x1eGoogle\\Cloud\\SecurityCenter\\V2\xea\x02!Google::Cloud::SecurityCenter::V2b\x06proto3" + +pool = ::Google::Protobuf::DescriptorPool.generated_pool +pool.add_serialized_file(descriptor_data) + +module Google + module Cloud + module SecurityCenter + module V2 + Network = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.securitycenter.v2.Network").msgclass + end + end + end +end diff --git a/owl-bot-staging/google-cloud-security_center-v2/lib/google/cloud/securitycenter/v2/notebook_pb.rb b/owl-bot-staging/google-cloud-security_center-v2/lib/google/cloud/securitycenter/v2/notebook_pb.rb new file mode 100644 index 000000000000..648e79e5aff6 --- /dev/null +++ b/owl-bot-staging/google-cloud-security_center-v2/lib/google/cloud/securitycenter/v2/notebook_pb.rb @@ -0,0 +1,23 @@ +# frozen_string_literal: true +# Generated by the protocol buffer compiler. DO NOT EDIT! +# source: google/cloud/securitycenter/v2/notebook.proto + +require 'google/protobuf' + +require 'google/protobuf/timestamp_pb' + + +descriptor_data = "\n-google/cloud/securitycenter/v2/notebook.proto\x12\x1egoogle.cloud.securitycenter.v2\x1a\x1fgoogle/protobuf/timestamp.proto\"x\n\x08Notebook\x12\x0c\n\x04name\x18\x01 \x01(\t\x12\x0f\n\x07service\x18\x02 \x01(\t\x12\x13\n\x0blast_author\x18\x03 \x01(\t\x12\x38\n\x14notebook_update_time\x18\x04 \x01(\x0b\x32\x1a.google.protobuf.TimestampB\xe7\x01\n\"com.google.cloud.securitycenter.v2B\rNotebookProtoP\x01ZJcloud.google.com/go/securitycenter/apiv2/securitycenterpb;securitycenterpb\xaa\x02\x1eGoogle.Cloud.SecurityCenter.V2\xca\x02\x1eGoogle\\Cloud\\SecurityCenter\\V2\xea\x02!Google::Cloud::SecurityCenter::V2b\x06proto3" + +pool = ::Google::Protobuf::DescriptorPool.generated_pool +pool.add_serialized_file(descriptor_data) + +module Google + module Cloud + module SecurityCenter + module V2 + Notebook = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.securitycenter.v2.Notebook").msgclass + end + end + end +end diff --git a/owl-bot-staging/google-cloud-security_center-v2/lib/google/cloud/securitycenter/v2/notification_config_pb.rb b/owl-bot-staging/google-cloud-security_center-v2/lib/google/cloud/securitycenter/v2/notification_config_pb.rb new file mode 100644 index 000000000000..36db41862bbd --- /dev/null +++ b/owl-bot-staging/google-cloud-security_center-v2/lib/google/cloud/securitycenter/v2/notification_config_pb.rb @@ -0,0 +1,26 @@ +# frozen_string_literal: true +# Generated by the protocol buffer compiler. DO NOT EDIT! +# source: google/cloud/securitycenter/v2/notification_config.proto + +require 'google/protobuf' + +require 'google/api/field_behavior_pb' +require 'google/api/resource_pb' +require 'google/protobuf/timestamp_pb' + + +descriptor_data = "\n8google/cloud/securitycenter/v2/notification_config.proto\x12\x1egoogle.cloud.securitycenter.v2\x1a\x1fgoogle/api/field_behavior.proto\x1a\x19google/api/resource.proto\x1a\x1fgoogle/protobuf/timestamp.proto\"\xbf\x05\n\x12NotificationConfig\x12\x11\n\x04name\x18\x01 \x01(\tB\x03\xe0\x41\x08\x12\x13\n\x0b\x64\x65scription\x18\x02 \x01(\t\x12\x36\n\x0cpubsub_topic\x18\x03 \x01(\tB \xfa\x41\x1d\n\x1bpubsub.googleapis.com/Topic\x12\x1c\n\x0fservice_account\x18\x04 \x01(\tB\x03\xe0\x41\x03\x12^\n\x10streaming_config\x18\x05 \x01(\x0b\x32\x42.google.cloud.securitycenter.v2.NotificationConfig.StreamingConfigH\x00\x12\x34\n\x0bupdate_time\x18\x07 \x01(\x0b\x32\x1a.google.protobuf.TimestampB\x03\xe0\x41\x03\x1a!\n\x0fStreamingConfig\x12\x0e\n\x06\x66ilter\x18\x01 \x01(\t:\xe0\x02\xea\x41\xdc\x02\n0securitycenter.googleapis.com/NotificationConfig\x12[organizations/{organization}/locations/{location}/notificationConfigs/{notification_config}\x12Ofolders/{folder}/locations/{location}/notificationConfigs/{notification_config}\x12Qprojects/{project}/locations/{location}/notificationConfigs/{notification_config}*\x13notificationConfigs2\x12notificationConfigB\x0f\n\rnotify_configB\xb4\x02\n\"com.google.cloud.securitycenter.v2B\x17NotificationConfigProtoP\x01ZJcloud.google.com/go/securitycenter/apiv2/securitycenterpb;securitycenterpb\xaa\x02\x1eGoogle.Cloud.SecurityCenter.V2\xca\x02\x1eGoogle\\Cloud\\SecurityCenter\\V2\xea\x02!Google::Cloud::SecurityCenter::V2\xea\x41@\n\x1bpubsub.googleapis.com/Topic\x12!projects/{project}/topics/{topic}b\x06proto3" + +pool = ::Google::Protobuf::DescriptorPool.generated_pool +pool.add_serialized_file(descriptor_data) + +module Google + module Cloud + module SecurityCenter + module V2 + NotificationConfig = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.securitycenter.v2.NotificationConfig").msgclass + NotificationConfig::StreamingConfig = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.securitycenter.v2.NotificationConfig.StreamingConfig").msgclass + end + end + end +end diff --git a/owl-bot-staging/google-cloud-security_center-v2/lib/google/cloud/securitycenter/v2/notification_message_pb.rb b/owl-bot-staging/google-cloud-security_center-v2/lib/google/cloud/securitycenter/v2/notification_message_pb.rb new file mode 100644 index 000000000000..77017de51eeb --- /dev/null +++ b/owl-bot-staging/google-cloud-security_center-v2/lib/google/cloud/securitycenter/v2/notification_message_pb.rb @@ -0,0 +1,24 @@ +# frozen_string_literal: true +# Generated by the protocol buffer compiler. DO NOT EDIT! +# source: google/cloud/securitycenter/v2/notification_message.proto + +require 'google/protobuf' + +require 'google/cloud/securitycenter/v2/finding_pb' +require 'google/cloud/securitycenter/v2/resource_pb' + + +descriptor_data = "\n9google/cloud/securitycenter/v2/notification_message.proto\x12\x1egoogle.cloud.securitycenter.v2\x1a,google/cloud/securitycenter/v2/finding.proto\x1a-google/cloud/securitycenter/v2/resource.proto\"\xb8\x01\n\x13NotificationMessage\x12 \n\x18notification_config_name\x18\x01 \x01(\t\x12:\n\x07\x66inding\x18\x02 \x01(\x0b\x32\'.google.cloud.securitycenter.v2.FindingH\x00\x12:\n\x08resource\x18\x03 \x01(\x0b\x32(.google.cloud.securitycenter.v2.ResourceB\x07\n\x05\x65ventB\xf2\x01\n\"com.google.cloud.securitycenter.v2B\x18NotificationMessageProtoP\x01ZJcloud.google.com/go/securitycenter/apiv2/securitycenterpb;securitycenterpb\xaa\x02\x1eGoogle.Cloud.SecurityCenter.V2\xca\x02\x1eGoogle\\Cloud\\SecurityCenter\\V2\xea\x02!Google::Cloud::SecurityCenter::V2b\x06proto3" + +pool = ::Google::Protobuf::DescriptorPool.generated_pool +pool.add_serialized_file(descriptor_data) + +module Google + module Cloud + module SecurityCenter + module V2 + NotificationMessage = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.securitycenter.v2.NotificationMessage").msgclass + end + end + end +end diff --git a/owl-bot-staging/google-cloud-security_center-v2/lib/google/cloud/securitycenter/v2/org_policy_pb.rb b/owl-bot-staging/google-cloud-security_center-v2/lib/google/cloud/securitycenter/v2/org_policy_pb.rb new file mode 100644 index 000000000000..9668bef4e937 --- /dev/null +++ b/owl-bot-staging/google-cloud-security_center-v2/lib/google/cloud/securitycenter/v2/org_policy_pb.rb @@ -0,0 +1,24 @@ +# frozen_string_literal: true +# Generated by the protocol buffer compiler. DO NOT EDIT! +# source: google/cloud/securitycenter/v2/org_policy.proto + +require 'google/protobuf' + +require 'google/api/field_behavior_pb' +require 'google/api/resource_pb' + + +descriptor_data = "\n/google/cloud/securitycenter/v2/org_policy.proto\x12\x1egoogle.cloud.securitycenter.v2\x1a\x1fgoogle/api/field_behavior.proto\x1a\x19google/api/resource.proto\"\xdb\x01\n\tOrgPolicy\x12\x11\n\x04name\x18\x01 \x01(\tB\x03\xe0\x41\x08:\xba\x01\xea\x41\xb6\x01\n\x1forgpolicy.googleapis.com/Policy\x12\x37organizations/{organization}/policies/{constraint_name}\x12+folders/{folder}/policies/{constraint_name}\x12-projects/{project}/policies/{constraint_name}B\xe8\x01\n\"com.google.cloud.securitycenter.v2B\x0eOrgPolicyProtoP\x01ZJcloud.google.com/go/securitycenter/apiv2/securitycenterpb;securitycenterpb\xaa\x02\x1eGoogle.Cloud.SecurityCenter.V2\xca\x02\x1eGoogle\\Cloud\\SecurityCenter\\V2\xea\x02!Google::Cloud::SecurityCenter::V2b\x06proto3" + +pool = ::Google::Protobuf::DescriptorPool.generated_pool +pool.add_serialized_file(descriptor_data) + +module Google + module Cloud + module SecurityCenter + module V2 + OrgPolicy = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.securitycenter.v2.OrgPolicy").msgclass + end + end + end +end diff --git a/owl-bot-staging/google-cloud-security_center-v2/lib/google/cloud/securitycenter/v2/process_pb.rb b/owl-bot-staging/google-cloud-security_center-v2/lib/google/cloud/securitycenter/v2/process_pb.rb new file mode 100644 index 000000000000..d7368f3889e2 --- /dev/null +++ b/owl-bot-staging/google-cloud-security_center-v2/lib/google/cloud/securitycenter/v2/process_pb.rb @@ -0,0 +1,24 @@ +# frozen_string_literal: true +# Generated by the protocol buffer compiler. DO NOT EDIT! +# source: google/cloud/securitycenter/v2/process.proto + +require 'google/protobuf' + +require 'google/cloud/securitycenter/v2/file_pb' + + +descriptor_data = "\n,google/cloud/securitycenter/v2/process.proto\x12\x1egoogle.cloud.securitycenter.v2\x1a)google/cloud/securitycenter/v2/file.proto\"\x86\x03\n\x07Process\x12\x0c\n\x04name\x18\x01 \x01(\t\x12\x34\n\x06\x62inary\x18\x02 \x01(\x0b\x32$.google.cloud.securitycenter.v2.File\x12\x37\n\tlibraries\x18\x03 \x03(\x0b\x32$.google.cloud.securitycenter.v2.File\x12\x34\n\x06script\x18\x04 \x01(\x0b\x32$.google.cloud.securitycenter.v2.File\x12\x0c\n\x04\x61rgs\x18\x05 \x03(\t\x12\x1b\n\x13\x61rguments_truncated\x18\x06 \x01(\x08\x12J\n\renv_variables\x18\x07 \x03(\x0b\x32\x33.google.cloud.securitycenter.v2.EnvironmentVariable\x12\x1f\n\x17\x65nv_variables_truncated\x18\x08 \x01(\x08\x12\x0b\n\x03pid\x18\t \x01(\x03\x12\x12\n\nparent_pid\x18\n \x01(\x03\x12\x0f\n\x07user_id\x18\x0b \x01(\x03\"0\n\x13\x45nvironmentVariable\x12\x0c\n\x04name\x18\x01 \x01(\t\x12\x0b\n\x03val\x18\x02 \x01(\tB\xe6\x01\n\"com.google.cloud.securitycenter.v2B\x0cProcessProtoP\x01ZJcloud.google.com/go/securitycenter/apiv2/securitycenterpb;securitycenterpb\xaa\x02\x1eGoogle.Cloud.SecurityCenter.V2\xca\x02\x1eGoogle\\Cloud\\SecurityCenter\\V2\xea\x02!Google::Cloud::SecurityCenter::V2b\x06proto3" + +pool = ::Google::Protobuf::DescriptorPool.generated_pool +pool.add_serialized_file(descriptor_data) + +module Google + module Cloud + module SecurityCenter + module V2 + Process = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.securitycenter.v2.Process").msgclass + EnvironmentVariable = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.securitycenter.v2.EnvironmentVariable").msgclass + end + end + end +end diff --git a/owl-bot-staging/google-cloud-security_center-v2/lib/google/cloud/securitycenter/v2/resource_pb.rb b/owl-bot-staging/google-cloud-security_center-v2/lib/google/cloud/securitycenter/v2/resource_pb.rb new file mode 100644 index 000000000000..2537d399e0df --- /dev/null +++ b/owl-bot-staging/google-cloud-security_center-v2/lib/google/cloud/securitycenter/v2/resource_pb.rb @@ -0,0 +1,39 @@ +# frozen_string_literal: true +# Generated by the protocol buffer compiler. DO NOT EDIT! +# source: google/cloud/securitycenter/v2/resource.proto + +require 'google/protobuf' + +require 'google/api/field_behavior_pb' +require 'google/api/resource_pb' +require 'google/cloud/securitycenter/v2/folder_pb' + + +descriptor_data = "\n-google/cloud/securitycenter/v2/resource.proto\x12\x1egoogle.cloud.securitycenter.v2\x1a\x1fgoogle/api/field_behavior.proto\x1a\x19google/api/resource.proto\x1a+google/cloud/securitycenter/v2/folder.proto\"\xf7\x03\n\x08Resource\x12\x0c\n\x04name\x18\x01 \x01(\t\x12\x14\n\x0c\x64isplay_name\x18\x02 \x01(\t\x12\x0c\n\x04type\x18\x03 \x01(\t\x12\x45\n\x0e\x63loud_provider\x18\x04 \x01(\x0e\x32-.google.cloud.securitycenter.v2.CloudProvider\x12\x0f\n\x07service\x18\x05 \x01(\t\x12\x10\n\x08location\x18\x06 \x01(\t\x12\x43\n\x0cgcp_metadata\x18\x07 \x01(\x0b\x32+.google.cloud.securitycenter.v2.GcpMetadataH\x00\x12\x43\n\x0c\x61ws_metadata\x18\x08 \x01(\x0b\x32+.google.cloud.securitycenter.v2.AwsMetadataH\x00\x12G\n\x0e\x61zure_metadata\x18\t \x01(\x0b\x32-.google.cloud.securitycenter.v2.AzureMetadataH\x00\x12\x43\n\rresource_path\x18\n \x01(\x0b\x32,.google.cloud.securitycenter.v2.ResourcePath\x12\x1c\n\x14resource_path_string\x18\x0b \x01(\tB\x19\n\x17\x63loud_provider_metadata\"\xbd\x01\n\x0bGcpMetadata\x12\x0f\n\x07project\x18\x01 \x01(\t\x12\x1c\n\x14project_display_name\x18\x02 \x01(\t\x12\x0e\n\x06parent\x18\x03 \x01(\t\x12\x1b\n\x13parent_display_name\x18\x04 \x01(\t\x12<\n\x07\x66olders\x18\x05 \x03(\x0b\x32&.google.cloud.securitycenter.v2.FolderB\x03\xe0\x41\x03\x12\x14\n\x0corganization\x18\x06 \x01(\t\"\x84\x03\n\x0b\x41wsMetadata\x12Q\n\x0corganization\x18\x01 \x01(\x0b\x32;.google.cloud.securitycenter.v2.AwsMetadata.AwsOrganization\x12_\n\x14organizational_units\x18\x02 \x03(\x0b\x32\x41.google.cloud.securitycenter.v2.AwsMetadata.AwsOrganizationalUnit\x12G\n\x07\x61\x63\x63ount\x18\x03 \x01(\x0b\x32\x36.google.cloud.securitycenter.v2.AwsMetadata.AwsAccount\x1a\x1d\n\x0f\x41wsOrganization\x12\n\n\x02id\x18\x01 \x01(\t\x1a\x31\n\x15\x41wsOrganizationalUnit\x12\n\n\x02id\x18\x01 \x01(\t\x12\x0c\n\x04name\x18\x02 \x01(\t\x1a&\n\nAwsAccount\x12\n\n\x02id\x18\x01 \x01(\t\x12\x0c\n\x04name\x18\x02 \x01(\t\"\xbc\x04\n\rAzureMetadata\x12]\n\x11management_groups\x18\x01 \x03(\x0b\x32\x42.google.cloud.securitycenter.v2.AzureMetadata.AzureManagementGroup\x12U\n\x0csubscription\x18\x02 \x01(\x0b\x32?.google.cloud.securitycenter.v2.AzureMetadata.AzureSubscription\x12X\n\x0eresource_group\x18\x03 \x01(\x0b\x32@.google.cloud.securitycenter.v2.AzureMetadata.AzureResourceGroup\x12I\n\x06tenant\x18\x07 \x01(\x0b\x32\x39.google.cloud.securitycenter.v2.AzureMetadata.AzureTenant\x1a\x38\n\x14\x41zureManagementGroup\x12\n\n\x02id\x18\x01 \x01(\t\x12\x14\n\x0c\x64isplay_name\x18\x02 \x01(\t\x1a\x35\n\x11\x41zureSubscription\x12\n\n\x02id\x18\x01 \x01(\t\x12\x14\n\x0c\x64isplay_name\x18\x02 \x01(\t\x1a.\n\x12\x41zureResourceGroup\x12\n\n\x02id\x18\x02 \x01(\t\x12\x0c\n\x04name\x18\x01 \x01(\t\x1a/\n\x0b\x41zureTenant\x12\n\n\x02id\x18\x01 \x01(\t\x12\x14\n\x0c\x64isplay_name\x18\x02 \x01(\t\"\xf4\x03\n\x0cResourcePath\x12L\n\x05nodes\x18\x01 \x03(\x0b\x32=.google.cloud.securitycenter.v2.ResourcePath.ResourcePathNode\x1a\x8a\x01\n\x10ResourcePathNode\x12T\n\tnode_type\x18\x01 \x01(\x0e\x32\x41.google.cloud.securitycenter.v2.ResourcePath.ResourcePathNodeType\x12\n\n\x02id\x18\x02 \x01(\t\x12\x14\n\x0c\x64isplay_name\x18\x03 \x01(\t\"\x88\x02\n\x14ResourcePathNodeType\x12\'\n#RESOURCE_PATH_NODE_TYPE_UNSPECIFIED\x10\x00\x12\x14\n\x10GCP_ORGANIZATION\x10\x01\x12\x0e\n\nGCP_FOLDER\x10\x02\x12\x0f\n\x0bGCP_PROJECT\x10\x03\x12\x14\n\x10\x41WS_ORGANIZATION\x10\x04\x12\x1b\n\x17\x41WS_ORGANIZATIONAL_UNIT\x10\x05\x12\x0f\n\x0b\x41WS_ACCOUNT\x10\x06\x12\x1a\n\x16\x41ZURE_MANAGEMENT_GROUP\x10\x07\x12\x16\n\x12\x41ZURE_SUBSCRIPTION\x10\x08\x12\x18\n\x14\x41ZURE_RESOURCE_GROUP\x10\t*x\n\rCloudProvider\x12\x1e\n\x1a\x43LOUD_PROVIDER_UNSPECIFIED\x10\x00\x12\x19\n\x15GOOGLE_CLOUD_PLATFORM\x10\x01\x12\x17\n\x13\x41MAZON_WEB_SERVICES\x10\x02\x12\x13\n\x0fMICROSOFT_AZURE\x10\x03\x42\xe7\x01\n\"com.google.cloud.securitycenter.v2B\rResourceProtoP\x01ZJcloud.google.com/go/securitycenter/apiv2/securitycenterpb;securitycenterpb\xaa\x02\x1eGoogle.Cloud.SecurityCenter.V2\xca\x02\x1eGoogle\\Cloud\\SecurityCenter\\V2\xea\x02!Google::Cloud::SecurityCenter::V2b\x06proto3" + +pool = ::Google::Protobuf::DescriptorPool.generated_pool +pool.add_serialized_file(descriptor_data) + +module Google + module Cloud + module SecurityCenter + module V2 + Resource = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.securitycenter.v2.Resource").msgclass + GcpMetadata = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.securitycenter.v2.GcpMetadata").msgclass + AwsMetadata = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.securitycenter.v2.AwsMetadata").msgclass + AwsMetadata::AwsOrganization = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.securitycenter.v2.AwsMetadata.AwsOrganization").msgclass + AwsMetadata::AwsOrganizationalUnit = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.securitycenter.v2.AwsMetadata.AwsOrganizationalUnit").msgclass + AwsMetadata::AwsAccount = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.securitycenter.v2.AwsMetadata.AwsAccount").msgclass + AzureMetadata = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.securitycenter.v2.AzureMetadata").msgclass + AzureMetadata::AzureManagementGroup = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.securitycenter.v2.AzureMetadata.AzureManagementGroup").msgclass + AzureMetadata::AzureSubscription = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.securitycenter.v2.AzureMetadata.AzureSubscription").msgclass + AzureMetadata::AzureResourceGroup = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.securitycenter.v2.AzureMetadata.AzureResourceGroup").msgclass + AzureMetadata::AzureTenant = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.securitycenter.v2.AzureMetadata.AzureTenant").msgclass + ResourcePath = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.securitycenter.v2.ResourcePath").msgclass + ResourcePath::ResourcePathNode = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.securitycenter.v2.ResourcePath.ResourcePathNode").msgclass + ResourcePath::ResourcePathNodeType = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.securitycenter.v2.ResourcePath.ResourcePathNodeType").enummodule + CloudProvider = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.securitycenter.v2.CloudProvider").enummodule + end + end + end +end diff --git a/owl-bot-staging/google-cloud-security_center-v2/lib/google/cloud/securitycenter/v2/resource_value_config_pb.rb b/owl-bot-staging/google-cloud-security_center-v2/lib/google/cloud/securitycenter/v2/resource_value_config_pb.rb new file mode 100644 index 000000000000..a620481d431c --- /dev/null +++ b/owl-bot-staging/google-cloud-security_center-v2/lib/google/cloud/securitycenter/v2/resource_value_config_pb.rb @@ -0,0 +1,28 @@ +# frozen_string_literal: true +# Generated by the protocol buffer compiler. DO NOT EDIT! +# source: google/cloud/securitycenter/v2/resource_value_config.proto + +require 'google/protobuf' + +require 'google/api/field_behavior_pb' +require 'google/api/resource_pb' +require 'google/cloud/securitycenter/v2/resource_pb' +require 'google/protobuf/timestamp_pb' + + +descriptor_data = "\n:google/cloud/securitycenter/v2/resource_value_config.proto\x12\x1egoogle.cloud.securitycenter.v2\x1a\x1fgoogle/api/field_behavior.proto\x1a\x19google/api/resource.proto\x1a-google/cloud/securitycenter/v2/resource.proto\x1a\x1fgoogle/protobuf/timestamp.proto\"\xf9\x08\n\x13ResourceValueConfig\x12\x11\n\x04name\x18\x01 \x01(\tB\x03\xe0\x41\x08\x12\x45\n\x0eresource_value\x18\x02 \x01(\x0e\x32-.google.cloud.securitycenter.v2.ResourceValue\x12\x12\n\ntag_values\x18\x03 \x03(\t\x12\x15\n\rresource_type\x18\x04 \x01(\t\x12\r\n\x05scope\x18\x05 \x01(\t\x12q\n\x18resource_labels_selector\x18\x06 \x03(\x0b\x32O.google.cloud.securitycenter.v2.ResourceValueConfig.ResourceLabelsSelectorEntry\x12\x13\n\x0b\x64\x65scription\x18\x07 \x01(\t\x12\x34\n\x0b\x63reate_time\x18\x08 \x01(\x0b\x32\x1a.google.protobuf.TimestampB\x03\xe0\x41\x03\x12\x34\n\x0bupdate_time\x18\t \x01(\x0b\x32\x1a.google.protobuf.TimestampB\x03\xe0\x41\x03\x12\x45\n\x0e\x63loud_provider\x18\n \x01(\x0e\x32-.google.cloud.securitycenter.v2.CloudProvider\x12}\n!sensitive_data_protection_mapping\x18\x0b \x01(\x0b\x32R.google.cloud.securitycenter.v2.ResourceValueConfig.SensitiveDataProtectionMapping\x1a\xc4\x01\n\x1eSensitiveDataProtectionMapping\x12O\n\x18high_sensitivity_mapping\x18\x01 \x01(\x0e\x32-.google.cloud.securitycenter.v2.ResourceValue\x12Q\n\x1amedium_sensitivity_mapping\x18\x02 \x01(\x0e\x32-.google.cloud.securitycenter.v2.ResourceValue\x1a=\n\x1bResourceLabelsSelectorEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12\r\n\x05value\x18\x02 \x01(\t:\x02\x38\x01:\x8d\x02\xea\x41\x89\x02\n1securitycenter.googleapis.com/ResourceValueConfig\x12Iorganizations/{organization}/resourceValueConfigs/{resource_value_config}\x12^organizations/{organization}/locations/{location}/resourceValueConfigs/{resource_value_config}*\x14resourceValueConfigs2\x13resourceValueConfig*X\n\rResourceValue\x12\x1e\n\x1aRESOURCE_VALUE_UNSPECIFIED\x10\x00\x12\x08\n\x04HIGH\x10\x01\x12\n\n\x06MEDIUM\x10\x02\x12\x07\n\x03LOW\x10\x03\x12\x08\n\x04NONE\x10\x04\x42\xf2\x01\n\"com.google.cloud.securitycenter.v2B\x18ResourceValueConfigProtoP\x01ZJcloud.google.com/go/securitycenter/apiv2/securitycenterpb;securitycenterpb\xaa\x02\x1eGoogle.Cloud.SecurityCenter.V2\xca\x02\x1eGoogle\\Cloud\\SecurityCenter\\V2\xea\x02!Google::Cloud::SecurityCenter::V2b\x06proto3" + +pool = ::Google::Protobuf::DescriptorPool.generated_pool +pool.add_serialized_file(descriptor_data) + +module Google + module Cloud + module SecurityCenter + module V2 + ResourceValueConfig = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.securitycenter.v2.ResourceValueConfig").msgclass + ResourceValueConfig::SensitiveDataProtectionMapping = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.securitycenter.v2.ResourceValueConfig.SensitiveDataProtectionMapping").msgclass + ResourceValue = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.securitycenter.v2.ResourceValue").enummodule + end + end + end +end diff --git a/owl-bot-staging/google-cloud-security_center-v2/lib/google/cloud/securitycenter/v2/security_marks_pb.rb b/owl-bot-staging/google-cloud-security_center-v2/lib/google/cloud/securitycenter/v2/security_marks_pb.rb new file mode 100644 index 000000000000..8f9fb7fdc255 --- /dev/null +++ b/owl-bot-staging/google-cloud-security_center-v2/lib/google/cloud/securitycenter/v2/security_marks_pb.rb @@ -0,0 +1,23 @@ +# frozen_string_literal: true +# Generated by the protocol buffer compiler. DO NOT EDIT! +# source: google/cloud/securitycenter/v2/security_marks.proto + +require 'google/protobuf' + +require 'google/api/resource_pb' + + +descriptor_data = "\n3google/cloud/securitycenter/v2/security_marks.proto\x12\x1egoogle.cloud.securitycenter.v2\x1a\x19google/api/resource.proto\"\xee\x06\n\rSecurityMarks\x12\x0c\n\x04name\x18\x01 \x01(\t\x12G\n\x05marks\x18\x02 \x03(\x0b\x32\x38.google.cloud.securitycenter.v2.SecurityMarks.MarksEntry\x12\x16\n\x0e\x63\x61nonical_name\x18\x03 \x01(\t\x1a,\n\nMarksEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12\r\n\x05value\x18\x02 \x01(\t:\x02\x38\x01:\xbf\x05\xea\x41\xbb\x05\n+securitycenter.googleapis.com/SecurityMarks\x12\x39organizations/{organization}/assets/{asset}/securityMarks\x12Norganizations/{organization}/sources/{source}/findings/{finding}/securityMarks\x12\x63organizations/{organization}/sources/{source}/locations/{location}/findings/{finding}/securityMarks\x12-folders/{folder}/assets/{asset}/securityMarks\x12\x42\x66olders/{folder}/sources/{source}/findings/{finding}/securityMarks\x12Wfolders/{folder}/sources/{source}/locations/{location}/findings/{finding}/securityMarks\x12/projects/{project}/assets/{asset}/securityMarks\x12\x44projects/{project}/sources/{source}/findings/{finding}/securityMarks\x12Yprojects/{project}/sources/{source}/locations/{location}/findings/{finding}/securityMarksB\xec\x01\n\"com.google.cloud.securitycenter.v2B\x12SecurityMarksProtoP\x01ZJcloud.google.com/go/securitycenter/apiv2/securitycenterpb;securitycenterpb\xaa\x02\x1eGoogle.Cloud.SecurityCenter.V2\xca\x02\x1eGoogle\\Cloud\\SecurityCenter\\V2\xea\x02!Google::Cloud::SecurityCenter::V2b\x06proto3" + +pool = ::Google::Protobuf::DescriptorPool.generated_pool +pool.add_serialized_file(descriptor_data) + +module Google + module Cloud + module SecurityCenter + module V2 + SecurityMarks = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.securitycenter.v2.SecurityMarks").msgclass + end + end + end +end diff --git a/owl-bot-staging/google-cloud-security_center-v2/lib/google/cloud/securitycenter/v2/security_posture_pb.rb b/owl-bot-staging/google-cloud-security_center-v2/lib/google/cloud/securitycenter/v2/security_posture_pb.rb new file mode 100644 index 000000000000..0f13af8fe998 --- /dev/null +++ b/owl-bot-staging/google-cloud-security_center-v2/lib/google/cloud/securitycenter/v2/security_posture_pb.rb @@ -0,0 +1,22 @@ +# frozen_string_literal: true +# Generated by the protocol buffer compiler. DO NOT EDIT! +# source: google/cloud/securitycenter/v2/security_posture.proto + +require 'google/protobuf' + + +descriptor_data = "\n5google/cloud/securitycenter/v2/security_posture.proto\x12\x1egoogle.cloud.securitycenter.v2\"\xe8\x02\n\x0fSecurityPosture\x12\x0c\n\x04name\x18\x01 \x01(\t\x12\x13\n\x0brevision_id\x18\x02 \x01(\t\x12#\n\x1bposture_deployment_resource\x18\x03 \x01(\t\x12\x1a\n\x12posture_deployment\x18\x04 \x01(\t\x12\x16\n\x0e\x63hanged_policy\x18\x05 \x01(\t\x12\x12\n\npolicy_set\x18\x06 \x01(\t\x12\x0e\n\x06policy\x18\x07 \x01(\t\x12`\n\x14policy_drift_details\x18\x08 \x03(\x0b\x32\x42.google.cloud.securitycenter.v2.SecurityPosture.PolicyDriftDetails\x1aS\n\x12PolicyDriftDetails\x12\r\n\x05\x66ield\x18\x01 \x01(\t\x12\x16\n\x0e\x65xpected_value\x18\x02 \x01(\t\x12\x16\n\x0e\x64\x65tected_value\x18\x03 \x01(\tB\xee\x01\n\"com.google.cloud.securitycenter.v2B\x14SecurityPostureProtoP\x01ZJcloud.google.com/go/securitycenter/apiv2/securitycenterpb;securitycenterpb\xaa\x02\x1eGoogle.Cloud.SecurityCenter.V2\xca\x02\x1eGoogle\\Cloud\\SecurityCenter\\V2\xea\x02!Google::Cloud::SecurityCenter::V2b\x06proto3" + +pool = ::Google::Protobuf::DescriptorPool.generated_pool +pool.add_serialized_file(descriptor_data) + +module Google + module Cloud + module SecurityCenter + module V2 + SecurityPosture = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.securitycenter.v2.SecurityPosture").msgclass + SecurityPosture::PolicyDriftDetails = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.securitycenter.v2.SecurityPosture.PolicyDriftDetails").msgclass + end + end + end +end diff --git a/owl-bot-staging/google-cloud-security_center-v2/lib/google/cloud/securitycenter/v2/securitycenter_service_pb.rb b/owl-bot-staging/google-cloud-security_center-v2/lib/google/cloud/securitycenter/v2/securitycenter_service_pb.rb new file mode 100644 index 000000000000..438d7aa19da5 --- /dev/null +++ b/owl-bot-staging/google-cloud-security_center-v2/lib/google/cloud/securitycenter/v2/securitycenter_service_pb.rb @@ -0,0 +1,101 @@ +# frozen_string_literal: true +# Generated by the protocol buffer compiler. DO NOT EDIT! +# source: google/cloud/securitycenter/v2/securitycenter_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/api/routing_pb' +require 'google/cloud/securitycenter/v2/attack_path_pb' +require 'google/cloud/securitycenter/v2/bigquery_export_pb' +require 'google/cloud/securitycenter/v2/external_system_pb' +require 'google/cloud/securitycenter/v2/finding_pb' +require 'google/cloud/securitycenter/v2/mute_config_pb' +require 'google/cloud/securitycenter/v2/notification_config_pb' +require 'google/cloud/securitycenter/v2/resource_pb' +require 'google/cloud/securitycenter/v2/resource_value_config_pb' +require 'google/cloud/securitycenter/v2/security_marks_pb' +require 'google/cloud/securitycenter/v2/simulation_pb' +require 'google/cloud/securitycenter/v2/source_pb' +require 'google/cloud/securitycenter/v2/valued_resource_pb' +require 'google/iam/v1/iam_policy_pb' +require 'google/iam/v1/policy_pb' +require 'google/longrunning/operations_pb' +require 'google/protobuf/empty_pb' +require 'google/protobuf/field_mask_pb' +require 'google/protobuf/struct_pb' +require 'google/protobuf/timestamp_pb' + + +descriptor_data = "\n;google/cloud/securitycenter/v2/securitycenter_service.proto\x12\x1egoogle.cloud.securitycenter.v2\x1a\x1cgoogle/api/annotations.proto\x1a\x17google/api/client.proto\x1a\x1fgoogle/api/field_behavior.proto\x1a\x19google/api/resource.proto\x1a\x18google/api/routing.proto\x1a\x30google/cloud/securitycenter/v2/attack_path.proto\x1a\x34google/cloud/securitycenter/v2/bigquery_export.proto\x1a\x34google/cloud/securitycenter/v2/external_system.proto\x1a,google/cloud/securitycenter/v2/finding.proto\x1a\x30google/cloud/securitycenter/v2/mute_config.proto\x1a\x38google/cloud/securitycenter/v2/notification_config.proto\x1a-google/cloud/securitycenter/v2/resource.proto\x1a:google/cloud/securitycenter/v2/resource_value_config.proto\x1a\x33google/cloud/securitycenter/v2/security_marks.proto\x1a/google/cloud/securitycenter/v2/simulation.proto\x1a+google/cloud/securitycenter/v2/source.proto\x1a\x34google/cloud/securitycenter/v2/valued_resource.proto\x1a\x1egoogle/iam/v1/iam_policy.proto\x1a\x1agoogle/iam/v1/policy.proto\x1a#google/longrunning/operations.proto\x1a\x1bgoogle/protobuf/empty.proto\x1a google/protobuf/field_mask.proto\x1a\x1cgoogle/protobuf/struct.proto\x1a\x1fgoogle/protobuf/timestamp.proto\"\xcc\x01\n&BatchCreateResourceValueConfigsRequest\x12I\n\x06parent\x18\x01 \x01(\tB9\xe0\x41\x02\xfa\x41\x33\x12\x31securitycenter.googleapis.com/ResourceValueConfig\x12W\n\x08requests\x18\x02 \x03(\x0b\x32@.google.cloud.securitycenter.v2.CreateResourceValueConfigRequestB\x03\xe0\x41\x02\"~\n\'BatchCreateResourceValueConfigsResponse\x12S\n\x16resource_value_configs\x18\x01 \x03(\x0b\x32\x33.google.cloud.securitycenter.v2.ResourceValueConfig\"\xe3\x01\n\x17\x42ulkMuteFindingsRequest\x12\x19\n\x06parent\x18\x01 \x01(\tB\t\xe0\x41\x02\xfa\x41\x03\n\x01*\x12\x0e\n\x06\x66ilter\x18\x02 \x01(\t\x12Z\n\nmute_state\x18\x03 \x01(\x0e\x32\x41.google.cloud.securitycenter.v2.BulkMuteFindingsRequest.MuteStateB\x03\xe0\x41\x01\"A\n\tMuteState\x12\x1a\n\x16MUTE_STATE_UNSPECIFIED\x10\x00\x12\t\n\x05MUTED\x10\x01\x12\r\n\tUNDEFINED\x10\x02\"\x1a\n\x18\x42ulkMuteFindingsResponse\"\xd4\x01\n\x1b\x43reateBigQueryExportRequest\x12\x44\n\x06parent\x18\x01 \x01(\tB4\xe0\x41\x02\xfa\x41.\x12,securitycenter.googleapis.com/BigQueryExport\x12M\n\x10\x62ig_query_export\x18\x02 \x01(\x0b\x32..google.cloud.securitycenter.v2.BigQueryExportB\x03\xe0\x41\x02\x12 \n\x13\x62ig_query_export_id\x18\x03 \x01(\tB\x03\xe0\x41\x02\"\xac\x01\n\x14\x43reateFindingRequest\x12<\n\x06parent\x18\x01 \x01(\tB,\xe0\x41\x02\xfa\x41&\n$securitycenter.googleapis.com/Source\x12\x17\n\nfinding_id\x18\x02 \x01(\tB\x03\xe0\x41\x02\x12=\n\x07\x66inding\x18\x03 \x01(\x0b\x32\'.google.cloud.securitycenter.v2.FindingB\x03\xe0\x41\x02\"\xbe\x01\n\x17\x43reateMuteConfigRequest\x12@\n\x06parent\x18\x01 \x01(\tB0\xe0\x41\x02\xfa\x41*\x12(securitycenter.googleapis.com/MuteConfig\x12\x44\n\x0bmute_config\x18\x02 \x01(\x0b\x32*.google.cloud.securitycenter.v2.MuteConfigB\x03\xe0\x41\x02\x12\x1b\n\x0emute_config_id\x18\x03 \x01(\tB\x03\xe0\x41\x02\"\xd9\x01\n\x1f\x43reateNotificationConfigRequest\x12H\n\x06parent\x18\x01 \x01(\tB8\xe0\x41\x02\xfa\x41\x32\x12\x30securitycenter.googleapis.com/NotificationConfig\x12\x16\n\tconfig_id\x18\x02 \x01(\tB\x03\xe0\x41\x02\x12T\n\x13notification_config\x18\x03 \x01(\x0b\x32\x32.google.cloud.securitycenter.v2.NotificationConfigB\x03\xe0\x41\x02\"\xc6\x01\n CreateResourceValueConfigRequest\x12I\n\x06parent\x18\x01 \x01(\tB9\xe0\x41\x02\xfa\x41\x33\x12\x31securitycenter.googleapis.com/ResourceValueConfig\x12W\n\x15resource_value_config\x18\x02 \x01(\x0b\x32\x33.google.cloud.securitycenter.v2.ResourceValueConfigB\x03\xe0\x41\x02\"\x9c\x01\n\x13\x43reateSourceRequest\x12H\n\x06parent\x18\x01 \x01(\tB8\xe0\x41\x02\xfa\x41\x32\n0cloudresourcemanager.googleapis.com/Organization\x12;\n\x06source\x18\x02 \x01(\x0b\x32&.google.cloud.securitycenter.v2.SourceB\x03\xe0\x41\x02\"a\n\x1b\x44\x65leteBigQueryExportRequest\x12\x42\n\x04name\x18\x01 \x01(\tB4\xe0\x41\x02\xfa\x41.\n,securitycenter.googleapis.com/BigQueryExport\"Y\n\x17\x44\x65leteMuteConfigRequest\x12>\n\x04name\x18\x01 \x01(\tB0\xe0\x41\x02\xfa\x41*\n(securitycenter.googleapis.com/MuteConfig\"i\n\x1f\x44\x65leteNotificationConfigRequest\x12\x46\n\x04name\x18\x01 \x01(\tB8\xe0\x41\x02\xfa\x41\x32\n0securitycenter.googleapis.com/NotificationConfig\"k\n DeleteResourceValueConfigRequest\x12G\n\x04name\x18\x01 \x01(\tB9\xe0\x41\x02\xfa\x41\x33\n1securitycenter.googleapis.com/ResourceValueConfig\"+\n\x13\x42igQueryDestination\x12\x14\n\x07\x64\x61taset\x18\x01 \x01(\tB\x03\xe0\x41\x02\"\xbe\x01\n\x16\x45xportFindingsMetadata\x12:\n\x11\x65xport_start_time\x18\x01 \x01(\x0b\x32\x1a.google.protobuf.TimestampB\x03\xe0\x41\x01\x12Y\n\x15\x62ig_query_destination\x18\x02 \x01(\x0b\x32\x33.google.cloud.securitycenter.v2.BigQueryDestinationB\x03\xe0\x41\x02H\x00\x42\r\n\x0b\x64\x65stination\"\x18\n\x16\x45xportFindingsResponse\"^\n\x18GetBigQueryExportRequest\x12\x42\n\x04name\x18\x01 \x01(\tB4\xe0\x41\x02\xfa\x41.\n,securitycenter.googleapis.com/BigQueryExport\"V\n\x14GetMuteConfigRequest\x12>\n\x04name\x18\x01 \x01(\tB0\xe0\x41\x02\xfa\x41*\n(securitycenter.googleapis.com/MuteConfig\"f\n\x1cGetNotificationConfigRequest\x12\x46\n\x04name\x18\x01 \x01(\tB8\xe0\x41\x02\xfa\x41\x32\n0securitycenter.googleapis.com/NotificationConfig\"h\n\x1dGetResourceValueConfigRequest\x12G\n\x04name\x18\x01 \x01(\tB9\xe0\x41\x02\xfa\x41\x33\n1securitycenter.googleapis.com/ResourceValueConfig\"N\n\x10GetSourceRequest\x12:\n\x04name\x18\x01 \x01(\tB,\xe0\x41\x02\xfa\x41&\n$securitycenter.googleapis.com/Source\"\xa2\x01\n\x14GroupFindingsRequest\x12<\n\x06parent\x18\x01 \x01(\tB,\xe0\x41\x02\xfa\x41&\n$securitycenter.googleapis.com/Source\x12\x0e\n\x06\x66ilter\x18\x02 \x01(\t\x12\x15\n\x08group_by\x18\x03 \x01(\tB\x03\xe0\x41\x02\x12\x12\n\npage_token\x18\x07 \x01(\t\x12\x11\n\tpage_size\x18\x08 \x01(\x05\"\x8b\x01\n\x15GroupFindingsResponse\x12\x45\n\x10group_by_results\x18\x01 \x03(\x0b\x32+.google.cloud.securitycenter.v2.GroupResult\x12\x17\n\x0fnext_page_token\x18\x03 \x01(\t\x12\x12\n\ntotal_size\x18\x04 \x01(\x05\"\xb8\x01\n\x0bGroupResult\x12O\n\nproperties\x18\x01 \x03(\x0b\x32;.google.cloud.securitycenter.v2.GroupResult.PropertiesEntry\x12\r\n\x05\x63ount\x18\x02 \x01(\x03\x1aI\n\x0fPropertiesEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12%\n\x05value\x18\x02 \x01(\x0b\x32\x16.google.protobuf.Value:\x02\x38\x01\"\x91\x01\n\x16ListAttackPathsRequest\x12@\n\x06parent\x18\x01 \x01(\tB0\xe0\x41\x02\xfa\x41*\x12(securitycenter.googleapis.com/AttackPath\x12\x0e\n\x06\x66ilter\x18\x02 \x01(\t\x12\x12\n\npage_token\x18\x03 \x01(\t\x12\x11\n\tpage_size\x18\x04 \x01(\x05\"t\n\x17ListAttackPathsResponse\x12@\n\x0c\x61ttack_paths\x18\x01 \x03(\x0b\x32*.google.cloud.securitycenter.v2.AttackPath\x12\x17\n\x0fnext_page_token\x18\x02 \x01(\t\"V\n\x14GetSimulationRequest\x12>\n\x04name\x18\x01 \x01(\tB0\xe0\x41\x02\xfa\x41*\n(securitycenter.googleapis.com/Simulation\"^\n\x18GetValuedResourceRequest\x12\x42\n\x04name\x18\x01 \x01(\tB4\xe0\x41\x02\xfa\x41.\n,securitycenter.googleapis.com/ValuedResource\"\x89\x01\n\x1aListBigQueryExportsRequest\x12\x44\n\x06parent\x18\x01 \x01(\tB4\xe0\x41\x02\xfa\x41.\x12,securitycenter.googleapis.com/BigQueryExport\x12\x11\n\tpage_size\x18\x02 \x01(\x05\x12\x12\n\npage_token\x18\x03 \x01(\t\"\x81\x01\n\x1bListBigQueryExportsResponse\x12I\n\x11\x62ig_query_exports\x18\x01 \x03(\x0b\x32..google.cloud.securitycenter.v2.BigQueryExport\x12\x17\n\x0fnext_page_token\x18\x02 \x01(\t\"\xcc\x01\n\x13ListFindingsRequest\x12<\n\x06parent\x18\x01 \x01(\tB,\xe0\x41\x02\xfa\x41&\n$securitycenter.googleapis.com/Source\x12\x0e\n\x06\x66ilter\x18\x02 \x01(\t\x12\x10\n\x08order_by\x18\x03 \x01(\t\x12.\n\nfield_mask\x18\x07 \x01(\x0b\x32\x1a.google.protobuf.FieldMask\x12\x12\n\npage_token\x18\x08 \x01(\t\x12\x11\n\tpage_size\x18\t \x01(\x05\"\xdf\x06\n\x14ListFindingsResponse\x12\x66\n\x15list_findings_results\x18\x01 \x03(\x0b\x32G.google.cloud.securitycenter.v2.ListFindingsResponse.ListFindingsResult\x12\x17\n\x0fnext_page_token\x18\x03 \x01(\t\x12\x12\n\ntotal_size\x18\x04 \x01(\x05\x1a\xb1\x05\n\x12ListFindingsResult\x12\x38\n\x07\x66inding\x18\x01 \x01(\x0b\x32\'.google.cloud.securitycenter.v2.Finding\x12g\n\x08resource\x18\x03 \x01(\x0b\x32P.google.cloud.securitycenter.v2.ListFindingsResponse.ListFindingsResult.ResourceB\x03\xe0\x41\x03\x1a\xf7\x03\n\x08Resource\x12\x0c\n\x04name\x18\x01 \x01(\t\x12\x14\n\x0c\x64isplay_name\x18\x02 \x01(\t\x12\x0c\n\x04type\x18\x03 \x01(\t\x12\x45\n\x0e\x63loud_provider\x18\x04 \x01(\x0e\x32-.google.cloud.securitycenter.v2.CloudProvider\x12\x0f\n\x07service\x18\x05 \x01(\t\x12\x10\n\x08location\x18\x06 \x01(\t\x12\x43\n\x0cgcp_metadata\x18\x07 \x01(\x0b\x32+.google.cloud.securitycenter.v2.GcpMetadataH\x00\x12\x43\n\x0c\x61ws_metadata\x18\x08 \x01(\x0b\x32+.google.cloud.securitycenter.v2.AwsMetadataH\x00\x12G\n\x0e\x61zure_metadata\x18\t \x01(\x0b\x32-.google.cloud.securitycenter.v2.AzureMetadataH\x00\x12\x43\n\rresource_path\x18\n \x01(\x0b\x32,.google.cloud.securitycenter.v2.ResourcePath\x12\x1c\n\x14resource_path_string\x18\x0b \x01(\tB\x19\n\x17\x63loud_provider_metadata\"\x81\x01\n\x16ListMuteConfigsRequest\x12@\n\x06parent\x18\x01 \x01(\tB0\xe0\x41\x02\xfa\x41*\x12(securitycenter.googleapis.com/MuteConfig\x12\x11\n\tpage_size\x18\x02 \x01(\x05\x12\x12\n\npage_token\x18\x03 \x01(\t\"t\n\x17ListMuteConfigsResponse\x12@\n\x0cmute_configs\x18\x01 \x03(\x0b\x32*.google.cloud.securitycenter.v2.MuteConfig\x12\x17\n\x0fnext_page_token\x18\x02 \x01(\t\"\x91\x01\n\x1eListNotificationConfigsRequest\x12H\n\x06parent\x18\x01 \x01(\tB8\xe0\x41\x02\xfa\x41\x32\x12\x30securitycenter.googleapis.com/NotificationConfig\x12\x12\n\npage_token\x18\x02 \x01(\t\x12\x11\n\tpage_size\x18\x03 \x01(\x05\"\x8c\x01\n\x1fListNotificationConfigsResponse\x12P\n\x14notification_configs\x18\x01 \x03(\x0b\x32\x32.google.cloud.securitycenter.v2.NotificationConfig\x12\x17\n\x0fnext_page_token\x18\x02 \x01(\t\"\x93\x01\n\x1fListResourceValueConfigsRequest\x12I\n\x06parent\x18\x01 \x01(\tB9\xe0\x41\x02\xfa\x41\x33\x12\x31securitycenter.googleapis.com/ResourceValueConfig\x12\x11\n\tpage_size\x18\x02 \x01(\x05\x12\x12\n\npage_token\x18\x03 \x01(\t\"\x90\x01\n ListResourceValueConfigsResponse\x12S\n\x16resource_value_configs\x18\x01 \x03(\x0b\x32\x33.google.cloud.securitycenter.v2.ResourceValueConfig\x12\x17\n\x0fnext_page_token\x18\x02 \x01(\t\"y\n\x12ListSourcesRequest\x12<\n\x06parent\x18\x01 \x01(\tB,\xe0\x41\x02\xfa\x41&\x12$securitycenter.googleapis.com/Source\x12\x12\n\npage_token\x18\x02 \x01(\t\x12\x11\n\tpage_size\x18\x07 \x01(\x05\"g\n\x13ListSourcesResponse\x12\x37\n\x07sources\x18\x01 \x03(\x0b\x32&.google.cloud.securitycenter.v2.Source\x12\x17\n\x0fnext_page_token\x18\x02 \x01(\t\"\xb0\x01\n\x1aListValuedResourcesRequest\x12\x44\n\x06parent\x18\x01 \x01(\tB4\xe0\x41\x02\xfa\x41.\x12,securitycenter.googleapis.com/ValuedResource\x12\x0e\n\x06\x66ilter\x18\x02 \x01(\t\x12\x12\n\npage_token\x18\x03 \x01(\t\x12\x11\n\tpage_size\x18\x04 \x01(\x05\x12\x15\n\x08order_by\x18\x05 \x01(\tB\x03\xe0\x41\x01\"\x94\x01\n\x1bListValuedResourcesResponse\x12H\n\x10valued_resources\x18\x01 \x03(\x0b\x32..google.cloud.securitycenter.v2.ValuedResource\x12\x17\n\x0fnext_page_token\x18\x02 \x01(\t\x12\x12\n\ntotal_size\x18\x03 \x01(\x05\"\x98\x01\n\x16SetFindingStateRequest\x12;\n\x04name\x18\x01 \x01(\tB-\xe0\x41\x02\xfa\x41\'\n%securitycenter.googleapis.com/Finding\x12\x41\n\x05state\x18\x02 \x01(\x0e\x32-.google.cloud.securitycenter.v2.Finding.StateB\x03\xe0\x41\x02\"\x8e\x01\n\x0eSetMuteRequest\x12;\n\x04name\x18\x01 \x01(\tB-\xe0\x41\x02\xfa\x41\'\n%securitycenter.googleapis.com/Finding\x12?\n\x04mute\x18\x02 \x01(\x0e\x32,.google.cloud.securitycenter.v2.Finding.MuteB\x03\xe0\x41\x02\"\x9d\x01\n\x1bUpdateBigQueryExportRequest\x12M\n\x10\x62ig_query_export\x18\x01 \x01(\x0b\x32..google.cloud.securitycenter.v2.BigQueryExportB\x03\xe0\x41\x02\x12/\n\x0bupdate_mask\x18\x02 \x01(\x0b\x32\x1a.google.protobuf.FieldMask\"\x9c\x01\n\x1bUpdateExternalSystemRequest\x12L\n\x0f\x65xternal_system\x18\x01 \x01(\x0b\x32..google.cloud.securitycenter.v2.ExternalSystemB\x03\xe0\x41\x02\x12/\n\x0bupdate_mask\x18\x02 \x01(\x0b\x32\x1a.google.protobuf.FieldMask\"\x86\x01\n\x14UpdateFindingRequest\x12=\n\x07\x66inding\x18\x01 \x01(\x0b\x32\'.google.cloud.securitycenter.v2.FindingB\x03\xe0\x41\x02\x12/\n\x0bupdate_mask\x18\x02 \x01(\x0b\x32\x1a.google.protobuf.FieldMask\"\x90\x01\n\x17UpdateMuteConfigRequest\x12\x44\n\x0bmute_config\x18\x01 \x01(\x0b\x32*.google.cloud.securitycenter.v2.MuteConfigB\x03\xe0\x41\x02\x12/\n\x0bupdate_mask\x18\x02 \x01(\x0b\x32\x1a.google.protobuf.FieldMask\"\xa8\x01\n\x1fUpdateNotificationConfigRequest\x12T\n\x13notification_config\x18\x01 \x01(\x0b\x32\x32.google.cloud.securitycenter.v2.NotificationConfigB\x03\xe0\x41\x02\x12/\n\x0bupdate_mask\x18\x02 \x01(\x0b\x32\x1a.google.protobuf.FieldMask\"\xac\x01\n UpdateResourceValueConfigRequest\x12W\n\x15resource_value_config\x18\x01 \x01(\x0b\x32\x33.google.cloud.securitycenter.v2.ResourceValueConfigB\x03\xe0\x41\x02\x12/\n\x0bupdate_mask\x18\x02 \x01(\x0b\x32\x1a.google.protobuf.FieldMask\"\x99\x01\n\x1aUpdateSecurityMarksRequest\x12J\n\x0esecurity_marks\x18\x01 \x01(\x0b\x32-.google.cloud.securitycenter.v2.SecurityMarksB\x03\xe0\x41\x02\x12/\n\x0bupdate_mask\x18\x02 \x01(\x0b\x32\x1a.google.protobuf.FieldMask\"\x83\x01\n\x13UpdateSourceRequest\x12;\n\x06source\x18\x01 \x01(\x0b\x32&.google.cloud.securitycenter.v2.SourceB\x03\xe0\x41\x02\x12/\n\x0bupdate_mask\x18\x02 \x01(\x0b\x32\x1a.google.protobuf.FieldMask2\xe2\x81\x01\n\x0eSecurityCenter\x12\xe0\x02\n\x1f\x42\x61tchCreateResourceValueConfigs\x12\x46.google.cloud.securitycenter.v2.BatchCreateResourceValueConfigsRequest\x1aG.google.cloud.securitycenter.v2.BatchCreateResourceValueConfigsResponse\"\xab\x01\xda\x41\x0fparent,requests\x82\xd3\xe4\x93\x02\x92\x01\"=/v2/{parent=organizations/*}/resourceValueConfigs:batchCreate:\x01*ZN\"I/v2/{parent=organizations/*/locations/*}/resourceValueConfigs:batchCreate:\x01*\x12\x9a\x04\n\x10\x42ulkMuteFindings\x12\x37.google.cloud.securitycenter.v2.BulkMuteFindingsRequest\x1a\x1d.google.longrunning.Operation\"\xad\x03\xca\x41P\n7google.cloud.securitycenter.v2.BulkMuteFindingsResponse\x12\x15google.protobuf.Empty\xda\x41\x06parent\x82\xd3\xe4\x93\x02\xca\x02\"./v2/{parent=organizations/*}/findings:bulkMute:\x01*Z?\":/v2/{parent=organizations/*/locations/*}/findings:bulkMute:\x01*Z-\"(/v2/{parent=folders/*}/findings:bulkMute:\x01*Z9\"4/v2/{parent=folders/*/locations/*}/findings:bulkMute:\x01*Z.\")/v2/{parent=projects/*}/findings:bulkMute:\x01*Z:\"5/v2/{parent=projects/*/locations/*}/findings:bulkMute:\x01*\x12\x98\x03\n\x14\x43reateBigQueryExport\x12;.google.cloud.securitycenter.v2.CreateBigQueryExportRequest\x1a..google.cloud.securitycenter.v2.BigQueryExport\"\x92\x02\xda\x41+parent,big_query_export,big_query_export_id\x82\xd3\xe4\x93\x02\xdd\x01\"8/v2/{parent=organizations/*/locations/*}/bigQueryExports:\x10\x62ig_query_exportZF\"2/v2/{parent=folders/*/locations/*}/bigQueryExports:\x10\x62ig_query_exportZG\"3/v2/{parent=projects/*/locations/*}/bigQueryExports:\x10\x62ig_query_export\x12\x96\x02\n\rCreateFinding\x12\x34.google.cloud.securitycenter.v2.CreateFindingRequest\x1a\'.google.cloud.securitycenter.v2.Finding\"\xa5\x01\xda\x41\x19parent,finding,finding_id\x82\xd3\xe4\x93\x02\x82\x01\";/v2/{parent=organizations/*/sources/*/locations/*}/findings:\x07\x66indingZ:\"//v2/{parent=organizations/*/sources/*}/findings:\x07\x66inding\x12\x99\x05\n\x10\x43reateMuteConfig\x12\x37.google.cloud.securitycenter.v2.CreateMuteConfigRequest\x1a*.google.cloud.securitycenter.v2.MuteConfig\"\x9f\x04\xda\x41!parent,mute_config,mute_config_id\x82\xd3\xe4\x93\x02\xe2\x02\"4/v2/{parent=organizations/*/locations/*}/muteConfigs:\x0bmute_configZ=\"./v2/{parent=folders/*/locations/*}/muteConfigs:\x0bmute_configZ>\"//v2/{parent=projects/*/locations/*}/muteConfigs:\x0bmute_configZ7\"(/v2/{parent=organizations/*}/muteConfigs:\x0bmute_configZ1\"\"/v2/{parent=folders/*}/muteConfigs:\x0bmute_configZ2\"#/v2/{parent=projects/*}/muteConfigs:\x0bmute_config\x8a\xd3\xe4\x93\x02\x8b\x01\x12+\n\x06parent\x12!projects/*/locations/{location=*}\x12\x30\n\x06parent\x12&organizations/*/locations/{location=*}\x12*\n\x06parent\x12 folders/*/locations/{location=*}\x12\xb2\x03\n\x18\x43reateNotificationConfig\x12?.google.cloud.securitycenter.v2.CreateNotificationConfigRequest\x1a\x32.google.cloud.securitycenter.v2.NotificationConfig\"\xa0\x02\xda\x41$parent,notification_config,config_id\x82\xd3\xe4\x93\x02\xf2\x01\".google.cloud.securitycenter.v2.ListNotificationConfigsRequest\x1a?.google.cloud.securitycenter.v2.ListNotificationConfigsResponse\"\xc3\x01\xda\x41\x06parent\x82\xd3\xe4\x93\x02\xb3\x01\x12/v2/{name=folders/*/sources/*/locations/*/findings/*}:setState:\x01*Z8\"3/v2/{name=projects/*/sources/*/findings/*}:setState:\x01*ZD\"?/v2/{name=projects/*/sources/*/locations/*/findings/*}:setState:\x01*\x12\x9d\x01\n\x0cSetIamPolicy\x12\".google.iam.v1.SetIamPolicyRequest\x1a\x15.google.iam.v1.Policy\"R\xda\x41\x0fresource,policy\x82\xd3\xe4\x93\x02:\"5/v2/{resource=organizations/*/sources/*}:setIamPolicy:\x01*\x12\xf8\x03\n\x07SetMute\x12..google.cloud.securitycenter.v2.SetMuteRequest\x1a\'.google.cloud.securitycenter.v2.Finding\"\x93\x03\xda\x41\tname,mute\x82\xd3\xe4\x93\x02\x80\x03\"7/v2/{name=organizations/*/sources/*/findings/*}:setMute:\x01*ZH\"C/v2/{name=organizations/*/sources/*/locations/*/findings/*}:setMute:\x01*Z6\"1/v2/{name=folders/*/sources/*/findings/*}:setMute:\x01*ZB\"=/v2/{name=folders/*/sources/*/locations/*/findings/*}:setMute:\x01*Z7\"2/v2/{name=projects/*/sources/*/findings/*}:setMute:\x01*ZC\">/v2/{name=projects/*/sources/*/locations/*/findings/*}:setMute:\x01*\x12\xc8\x01\n\x12TestIamPermissions\x12(.google.iam.v1.TestIamPermissionsRequest\x1a).google.iam.v1.TestIamPermissionsResponse\"]\xda\x41\x14resource,permissions\x82\xd3\xe4\x93\x02@\";/v2/{resource=organizations/*/sources/*}:testIamPermissions:\x01*\x12\xbc\x03\n\x14UpdateBigQueryExport\x12;.google.cloud.securitycenter.v2.UpdateBigQueryExportRequest\x1a..google.cloud.securitycenter.v2.BigQueryExport\"\xb6\x02\xda\x41\x1c\x62ig_query_export,update_mask\x82\xd3\xe4\x93\x02\x90\x02\x32I/v2/{big_query_export.name=organizations/*/locations/*/bigQueryExports/*}:\x10\x62ig_query_exportZW2C/v2/{big_query_export.name=folders/*/locations/*/bigQueryExports/*}:\x10\x62ig_query_exportZX2D/v2/{big_query_export.name=projects/*/locations/*/bigQueryExports/*}:\x10\x62ig_query_export\x12\x9b\x06\n\x14UpdateExternalSystem\x12;.google.cloud.securitycenter.v2.UpdateExternalSystemRequest\x1a..google.cloud.securitycenter.v2.ExternalSystem\"\x95\x05\xda\x41\x1b\x65xternal_system,update_mask\x82\xd3\xe4\x93\x02\xf0\x04\x32Q/v2/{external_system.name=organizations/*/sources/*/findings/*/externalSystems/*}:\x0f\x65xternal_systemZp2]/v2/{external_system.name=organizations/*/sources/*/locations/*/findings/*/externalSystems/*}:\x0f\x65xternal_systemZ^2K/v2/{external_system.name=folders/*/sources/*/findings/*/externalSystems/*}:\x0f\x65xternal_systemZj2W/v2/{external_system.name=folders/*/sources/*/locations/*/findings/*/externalSystems/*}:\x0f\x65xternal_systemZ_2L/v2/{external_system.name=projects/*/sources/*/findings/*/externalSystems/*}:\x0f\x65xternal_systemZk2X/v2/{external_system.name=projects/*/sources/*/locations/*/findings/*/externalSystems/*}:\x0f\x65xternal_system\x12\xb2\x04\n\rUpdateFinding\x12\x34.google.cloud.securitycenter.v2.UpdateFindingRequest\x1a\'.google.cloud.securitycenter.v2.Finding\"\xc1\x03\xda\x41\x13\x66inding,update_mask\x82\xd3\xe4\x93\x02\xa4\x03\x32\x37/v2/{finding.name=organizations/*/sources/*/findings/*}:\x07\x66indingZN2C/v2/{finding.name=organizations/*/sources/*/locations/*/findings/*}:\x07\x66indingZ<21/v2/{finding.name=folders/*/sources/*/findings/*}:\x07\x66indingZH2=/v2/{finding.name=folders/*/sources/*/locations/*/findings/*}:\x07\x66indingZ=22/v2/{finding.name=projects/*/sources/*/findings/*}:\x07\x66indingZI2>/v2/{finding.name=projects/*/sources/*/locations/*/findings/*}:\x07\x66inding\x12\x9f\x06\n\x10UpdateMuteConfig\x12\x37.google.cloud.securitycenter.v2.UpdateMuteConfigRequest\x1a*.google.cloud.securitycenter.v2.MuteConfig\"\xa5\x05\xda\x41\x17mute_config,update_mask\x82\xd3\xe4\x93\x02\xaa\x03\x32\x34/v2/{mute_config.name=organizations/*/muteConfigs/*}:\x0bmute_configZO2@/v2/{mute_config.name=organizations/*/locations/*/muteConfigs/*}:\x0bmute_configZ=2./v2/{mute_config.name=folders/*/muteConfigs/*}:\x0bmute_configZI2:/v2/{mute_config.name=folders/*/locations/*/muteConfigs/*}:\x0bmute_configZ>2//v2/{mute_config.name=projects/*/muteConfigs/*}:\x0bmute_configZJ2;/v2/{mute_config.name=projects/*/locations/*/muteConfigs/*}:\x0bmute_config\x8a\xd3\xe4\x93\x02\xd3\x01\x12\x43\n\x10mute_config.name\x12/projects/*/locations/{location=*}/muteConfigs/*\x12H\n\x10mute_config.name\x12\x34organizations/*/locations/{location=*}/muteConfigs/*\x12\x42\n\x10mute_config.name\x12.folders/*/locations/{location=*}/muteConfigs/*\x12\xe9\x03\n\x18UpdateNotificationConfig\x12?.google.cloud.securitycenter.v2.UpdateNotificationConfigRequest\x1a\x32.google.cloud.securitycenter.v2.NotificationConfig\"\xd7\x02\xda\x41\x1fnotification_config,update_mask\x82\xd3\xe4\x93\x02\xae\x02\x32P/v2/{notification_config.name=organizations/*/locations/*/notificationConfigs/*}:\x13notification_configZa2J/v2/{notification_config.name=folders/*/locations/*/notificationConfigs/*}:\x13notification_configZb2K/v2/{notification_config.name=projects/*/locations/*/notificationConfigs/*}:\x13notification_config\x12\x8e\x03\n\x19UpdateResourceValueConfig\x12@.google.cloud.securitycenter.v2.UpdateResourceValueConfigRequest\x1a\x33.google.cloud.securitycenter.v2.ResourceValueConfig\"\xf9\x01\xda\x41!resource_value_config,update_mask\x82\xd3\xe4\x93\x02\xce\x01\x32G/v2/{resource_value_config.name=organizations/*/resourceValueConfigs/*}:\x15resource_value_configZl2S/v2/{resource_value_config.name=organizations/*/locations/*/resourceValueConfigs/*}:\x15resource_value_config\x12\xe4\x07\n\x13UpdateSecurityMarks\x12:.google.cloud.securitycenter.v2.UpdateSecurityMarksRequest\x1a-.google.cloud.securitycenter.v2.SecurityMarks\"\xe1\x06\xda\x41\x1asecurity_marks,update_mask\x82\xd3\xe4\x93\x02\xbd\x06\x32L/v2/{security_marks.name=organizations/*/sources/*/findings/*/securityMarks}:\x0esecurity_marksZR2@/v2/{security_marks.name=organizations/*/assets/*/securityMarks}:\x0esecurity_marksZj2X/v2/{security_marks.name=organizations/*/sources/*/locations/*/findings/*/securityMarks}:\x0esecurity_marksZX2F/v2/{security_marks.name=folders/*/sources/*/findings/*/securityMarks}:\x0esecurity_marksZL2:/v2/{security_marks.name=folders/*/assets/*/securityMarks}:\x0esecurity_marksZd2R/v2/{security_marks.name=folders/*/sources/*/locations/*/findings/*/securityMarks}:\x0esecurity_marksZY2G/v2/{security_marks.name=projects/*/sources/*/findings/*/securityMarks}:\x0esecurity_marksZM2;/v2/{security_marks.name=projects/*/assets/*/securityMarks}:\x0esecurity_marksZe2S/v2/{security_marks.name=projects/*/sources/*/locations/*/findings/*/securityMarks}:\x0esecurity_marks\x12\xbd\x01\n\x0cUpdateSource\x12\x33.google.cloud.securitycenter.v2.UpdateSourceRequest\x1a&.google.cloud.securitycenter.v2.Source\"P\xda\x41\x12source,update_mask\x82\xd3\xe4\x93\x02\x35\x32+/v2/{source.name=organizations/*/sources/*}:\x06source\x1aQ\xca\x41\x1dsecuritycenter.googleapis.com\xd2\x41.https://www.googleapis.com/auth/cloud-platformB\xe2\x04\n\"com.google.cloud.securitycenter.v2B\x1aSecuritycenterServiceProtoP\x01ZJcloud.google.com/go/securitycenter/apiv2/securitycenterpb;securitycenterpb\xaa\x02\x1eGoogle.Cloud.SecurityCenter.V2\xca\x02\x1eGoogle\\Cloud\\SecurityCenter\\V2\xea\x02!Google::Cloud::SecurityCenter::V2\xea\x41g\n2securitycenter.googleapis.com/OrganizationLocation\x12\x31organizations/{organization}/locations/{location}\xea\x41U\n,securitycenter.googleapis.com/FolderLocation\x12%folders/{folder}/locations/{location}\xea\x41\xa8\x01\n8securitycenter.googleapis.com/OrganizationValuedResource\x12lorganizations/{organization}/locations/{location}/simulations/{simulation}/valuedResources/{valued_resource}b\x06proto3" + +pool = ::Google::Protobuf::DescriptorPool.generated_pool +pool.add_serialized_file(descriptor_data) + +module Google + module Cloud + module SecurityCenter + module V2 + BatchCreateResourceValueConfigsRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.securitycenter.v2.BatchCreateResourceValueConfigsRequest").msgclass + BatchCreateResourceValueConfigsResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.securitycenter.v2.BatchCreateResourceValueConfigsResponse").msgclass + BulkMuteFindingsRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.securitycenter.v2.BulkMuteFindingsRequest").msgclass + BulkMuteFindingsRequest::MuteState = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.securitycenter.v2.BulkMuteFindingsRequest.MuteState").enummodule + BulkMuteFindingsResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.securitycenter.v2.BulkMuteFindingsResponse").msgclass + CreateBigQueryExportRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.securitycenter.v2.CreateBigQueryExportRequest").msgclass + CreateFindingRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.securitycenter.v2.CreateFindingRequest").msgclass + CreateMuteConfigRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.securitycenter.v2.CreateMuteConfigRequest").msgclass + CreateNotificationConfigRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.securitycenter.v2.CreateNotificationConfigRequest").msgclass + CreateResourceValueConfigRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.securitycenter.v2.CreateResourceValueConfigRequest").msgclass + CreateSourceRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.securitycenter.v2.CreateSourceRequest").msgclass + DeleteBigQueryExportRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.securitycenter.v2.DeleteBigQueryExportRequest").msgclass + DeleteMuteConfigRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.securitycenter.v2.DeleteMuteConfigRequest").msgclass + DeleteNotificationConfigRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.securitycenter.v2.DeleteNotificationConfigRequest").msgclass + DeleteResourceValueConfigRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.securitycenter.v2.DeleteResourceValueConfigRequest").msgclass + BigQueryDestination = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.securitycenter.v2.BigQueryDestination").msgclass + ExportFindingsMetadata = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.securitycenter.v2.ExportFindingsMetadata").msgclass + ExportFindingsResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.securitycenter.v2.ExportFindingsResponse").msgclass + GetBigQueryExportRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.securitycenter.v2.GetBigQueryExportRequest").msgclass + GetMuteConfigRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.securitycenter.v2.GetMuteConfigRequest").msgclass + GetNotificationConfigRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.securitycenter.v2.GetNotificationConfigRequest").msgclass + GetResourceValueConfigRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.securitycenter.v2.GetResourceValueConfigRequest").msgclass + GetSourceRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.securitycenter.v2.GetSourceRequest").msgclass + GroupFindingsRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.securitycenter.v2.GroupFindingsRequest").msgclass + GroupFindingsResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.securitycenter.v2.GroupFindingsResponse").msgclass + GroupResult = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.securitycenter.v2.GroupResult").msgclass + ListAttackPathsRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.securitycenter.v2.ListAttackPathsRequest").msgclass + ListAttackPathsResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.securitycenter.v2.ListAttackPathsResponse").msgclass + GetSimulationRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.securitycenter.v2.GetSimulationRequest").msgclass + GetValuedResourceRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.securitycenter.v2.GetValuedResourceRequest").msgclass + ListBigQueryExportsRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.securitycenter.v2.ListBigQueryExportsRequest").msgclass + ListBigQueryExportsResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.securitycenter.v2.ListBigQueryExportsResponse").msgclass + ListFindingsRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.securitycenter.v2.ListFindingsRequest").msgclass + ListFindingsResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.securitycenter.v2.ListFindingsResponse").msgclass + ListFindingsResponse::ListFindingsResult = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.securitycenter.v2.ListFindingsResponse.ListFindingsResult").msgclass + ListFindingsResponse::ListFindingsResult::Resource = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.securitycenter.v2.ListFindingsResponse.ListFindingsResult.Resource").msgclass + ListMuteConfigsRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.securitycenter.v2.ListMuteConfigsRequest").msgclass + ListMuteConfigsResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.securitycenter.v2.ListMuteConfigsResponse").msgclass + ListNotificationConfigsRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.securitycenter.v2.ListNotificationConfigsRequest").msgclass + ListNotificationConfigsResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.securitycenter.v2.ListNotificationConfigsResponse").msgclass + ListResourceValueConfigsRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.securitycenter.v2.ListResourceValueConfigsRequest").msgclass + ListResourceValueConfigsResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.securitycenter.v2.ListResourceValueConfigsResponse").msgclass + ListSourcesRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.securitycenter.v2.ListSourcesRequest").msgclass + ListSourcesResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.securitycenter.v2.ListSourcesResponse").msgclass + ListValuedResourcesRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.securitycenter.v2.ListValuedResourcesRequest").msgclass + ListValuedResourcesResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.securitycenter.v2.ListValuedResourcesResponse").msgclass + SetFindingStateRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.securitycenter.v2.SetFindingStateRequest").msgclass + SetMuteRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.securitycenter.v2.SetMuteRequest").msgclass + UpdateBigQueryExportRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.securitycenter.v2.UpdateBigQueryExportRequest").msgclass + UpdateExternalSystemRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.securitycenter.v2.UpdateExternalSystemRequest").msgclass + UpdateFindingRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.securitycenter.v2.UpdateFindingRequest").msgclass + UpdateMuteConfigRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.securitycenter.v2.UpdateMuteConfigRequest").msgclass + UpdateNotificationConfigRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.securitycenter.v2.UpdateNotificationConfigRequest").msgclass + UpdateResourceValueConfigRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.securitycenter.v2.UpdateResourceValueConfigRequest").msgclass + UpdateSecurityMarksRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.securitycenter.v2.UpdateSecurityMarksRequest").msgclass + UpdateSourceRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.securitycenter.v2.UpdateSourceRequest").msgclass + end + end + end +end diff --git a/owl-bot-staging/google-cloud-security_center-v2/lib/google/cloud/securitycenter/v2/securitycenter_service_services_pb.rb b/owl-bot-staging/google-cloud-security_center-v2/lib/google/cloud/securitycenter/v2/securitycenter_service_services_pb.rb new file mode 100644 index 000000000000..36c3f5bae249 --- /dev/null +++ b/owl-bot-staging/google-cloud-security_center-v2/lib/google/cloud/securitycenter/v2/securitycenter_service_services_pb.rb @@ -0,0 +1,167 @@ +# Generated by the protocol buffer compiler. DO NOT EDIT! +# Source: google/cloud/securitycenter/v2/securitycenter_service.proto for package 'Google.Cloud.SecurityCenter.V2' +# Original file comments: +# 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 +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# + +require 'grpc' +require 'google/cloud/securitycenter/v2/securitycenter_service_pb' + +module Google + module Cloud + module SecurityCenter + module V2 + module SecurityCenter + # V2 APIs for Security Center service. + class Service + + include ::GRPC::GenericService + + self.marshal_class_method = :encode + self.unmarshal_class_method = :decode + self.service_name = 'google.cloud.securitycenter.v2.SecurityCenter' + + # Creates a ResourceValueConfig for an organization. Maps user's tags to + # difference resource values for use by the attack path simulation. + rpc :BatchCreateResourceValueConfigs, ::Google::Cloud::SecurityCenter::V2::BatchCreateResourceValueConfigsRequest, ::Google::Cloud::SecurityCenter::V2::BatchCreateResourceValueConfigsResponse + # Kicks off an LRO to bulk mute findings for a parent based on a filter. If + # no location is specified, findings are muted in global. The parent + # can be either an organization, folder, or project. The findings matched by + # the filter will be muted after the LRO is done. + rpc :BulkMuteFindings, ::Google::Cloud::SecurityCenter::V2::BulkMuteFindingsRequest, ::Google::Longrunning::Operation + # Creates a BigQuery export. + rpc :CreateBigQueryExport, ::Google::Cloud::SecurityCenter::V2::CreateBigQueryExportRequest, ::Google::Cloud::SecurityCenter::V2::BigQueryExport + # Creates a finding in a location. The corresponding source must exist for + # finding creation to succeed. + rpc :CreateFinding, ::Google::Cloud::SecurityCenter::V2::CreateFindingRequest, ::Google::Cloud::SecurityCenter::V2::Finding + # Creates a mute config. + rpc :CreateMuteConfig, ::Google::Cloud::SecurityCenter::V2::CreateMuteConfigRequest, ::Google::Cloud::SecurityCenter::V2::MuteConfig + # Creates a notification config. + rpc :CreateNotificationConfig, ::Google::Cloud::SecurityCenter::V2::CreateNotificationConfigRequest, ::Google::Cloud::SecurityCenter::V2::NotificationConfig + # Creates a source. + rpc :CreateSource, ::Google::Cloud::SecurityCenter::V2::CreateSourceRequest, ::Google::Cloud::SecurityCenter::V2::Source + # Deletes an existing BigQuery export. + rpc :DeleteBigQueryExport, ::Google::Cloud::SecurityCenter::V2::DeleteBigQueryExportRequest, ::Google::Protobuf::Empty + # Deletes an existing mute config. If no location is specified, default is + # global. + rpc :DeleteMuteConfig, ::Google::Cloud::SecurityCenter::V2::DeleteMuteConfigRequest, ::Google::Protobuf::Empty + # Deletes a notification config. + rpc :DeleteNotificationConfig, ::Google::Cloud::SecurityCenter::V2::DeleteNotificationConfigRequest, ::Google::Protobuf::Empty + # Deletes a ResourceValueConfig. + rpc :DeleteResourceValueConfig, ::Google::Cloud::SecurityCenter::V2::DeleteResourceValueConfigRequest, ::Google::Protobuf::Empty + # Gets a BigQuery export. + rpc :GetBigQueryExport, ::Google::Cloud::SecurityCenter::V2::GetBigQueryExportRequest, ::Google::Cloud::SecurityCenter::V2::BigQueryExport + # Get the simulation by name or the latest simulation for the given + # organization. + rpc :GetSimulation, ::Google::Cloud::SecurityCenter::V2::GetSimulationRequest, ::Google::Cloud::SecurityCenter::V2::Simulation + # Get the valued resource by name + rpc :GetValuedResource, ::Google::Cloud::SecurityCenter::V2::GetValuedResourceRequest, ::Google::Cloud::SecurityCenter::V2::ValuedResource + # Gets the access control policy on the specified Source. + rpc :GetIamPolicy, ::Google::Iam::V1::GetIamPolicyRequest, ::Google::Iam::V1::Policy + # Gets a mute config. If no location is specified, default is + # global. + rpc :GetMuteConfig, ::Google::Cloud::SecurityCenter::V2::GetMuteConfigRequest, ::Google::Cloud::SecurityCenter::V2::MuteConfig + # Gets a notification config. + rpc :GetNotificationConfig, ::Google::Cloud::SecurityCenter::V2::GetNotificationConfigRequest, ::Google::Cloud::SecurityCenter::V2::NotificationConfig + # Gets a ResourceValueConfig. + rpc :GetResourceValueConfig, ::Google::Cloud::SecurityCenter::V2::GetResourceValueConfigRequest, ::Google::Cloud::SecurityCenter::V2::ResourceValueConfig + # Gets a source. + rpc :GetSource, ::Google::Cloud::SecurityCenter::V2::GetSourceRequest, ::Google::Cloud::SecurityCenter::V2::Source + # Filters an organization or source's findings and groups them by their + # specified properties in a location. If no location is specified, findings + # are assumed to be in global + # + # To group across all sources provide a `-` as the source id. + # The following list shows some examples: + # + # + `/v2/organizations/{organization_id}/sources/-/findings` + # + + # `/v2/organizations/{organization_id}/sources/-/locations/{location_id}/findings` + # + `/v2/folders/{folder_id}/sources/-/findings` + # + `/v2/folders/{folder_id}/sources/-/locations/{location_id}/findings` + # + `/v2/projects/{project_id}/sources/-/findings` + # + `/v2/projects/{project_id}/sources/-/locations/{location_id}/findings` + rpc :GroupFindings, ::Google::Cloud::SecurityCenter::V2::GroupFindingsRequest, ::Google::Cloud::SecurityCenter::V2::GroupFindingsResponse + # Lists the attack paths for a set of simulation results or valued resources + # and filter. + rpc :ListAttackPaths, ::Google::Cloud::SecurityCenter::V2::ListAttackPathsRequest, ::Google::Cloud::SecurityCenter::V2::ListAttackPathsResponse + # Lists BigQuery exports. Note that when requesting BigQuery exports at a + # given level all exports under that level are also returned e.g. if + # requesting BigQuery exports under a folder, then all BigQuery exports + # immediately under the folder plus the ones created under the projects + # within the folder are returned. + rpc :ListBigQueryExports, ::Google::Cloud::SecurityCenter::V2::ListBigQueryExportsRequest, ::Google::Cloud::SecurityCenter::V2::ListBigQueryExportsResponse + # Lists an organization or source's findings. + # + # To list across all sources for a given location provide a `-` as the source + # id. If no location is specified, finding are assumed to be in global. + # The following list shows some examples: + # + # + `/v2/organizations/{organization_id}/sources/-/findings` + # + + # `/v2/organizations/{organization_id}/sources/-/locations/{location_id}/findings` + rpc :ListFindings, ::Google::Cloud::SecurityCenter::V2::ListFindingsRequest, ::Google::Cloud::SecurityCenter::V2::ListFindingsResponse + # Lists mute configs. If no location is specified, default is + # global. + rpc :ListMuteConfigs, ::Google::Cloud::SecurityCenter::V2::ListMuteConfigsRequest, ::Google::Cloud::SecurityCenter::V2::ListMuteConfigsResponse + # Lists notification configs. + rpc :ListNotificationConfigs, ::Google::Cloud::SecurityCenter::V2::ListNotificationConfigsRequest, ::Google::Cloud::SecurityCenter::V2::ListNotificationConfigsResponse + # Lists all ResourceValueConfigs. + rpc :ListResourceValueConfigs, ::Google::Cloud::SecurityCenter::V2::ListResourceValueConfigsRequest, ::Google::Cloud::SecurityCenter::V2::ListResourceValueConfigsResponse + # Lists all sources belonging to an organization. + rpc :ListSources, ::Google::Cloud::SecurityCenter::V2::ListSourcesRequest, ::Google::Cloud::SecurityCenter::V2::ListSourcesResponse + # Lists the valued resources for a set of simulation results and filter. + rpc :ListValuedResources, ::Google::Cloud::SecurityCenter::V2::ListValuedResourcesRequest, ::Google::Cloud::SecurityCenter::V2::ListValuedResourcesResponse + # Updates the state of a finding. If no location is specified, finding is + # assumed to be in global + rpc :SetFindingState, ::Google::Cloud::SecurityCenter::V2::SetFindingStateRequest, ::Google::Cloud::SecurityCenter::V2::Finding + # Sets the access control policy on the specified Source. + rpc :SetIamPolicy, ::Google::Iam::V1::SetIamPolicyRequest, ::Google::Iam::V1::Policy + # Updates the mute state of a finding. If no location is specified, finding + # is assumed to be in global + rpc :SetMute, ::Google::Cloud::SecurityCenter::V2::SetMuteRequest, ::Google::Cloud::SecurityCenter::V2::Finding + # Returns the permissions that a caller has on the specified source. + rpc :TestIamPermissions, ::Google::Iam::V1::TestIamPermissionsRequest, ::Google::Iam::V1::TestIamPermissionsResponse + # Updates a BigQuery export. + rpc :UpdateBigQueryExport, ::Google::Cloud::SecurityCenter::V2::UpdateBigQueryExportRequest, ::Google::Cloud::SecurityCenter::V2::BigQueryExport + # Updates external system. This is for a given finding. If no location is + # specified, finding is assumed to be in global + rpc :UpdateExternalSystem, ::Google::Cloud::SecurityCenter::V2::UpdateExternalSystemRequest, ::Google::Cloud::SecurityCenter::V2::ExternalSystem + # Creates or updates a finding. If no location is specified, finding is + # assumed to be in global. The corresponding source must exist for a finding + # creation to succeed. + rpc :UpdateFinding, ::Google::Cloud::SecurityCenter::V2::UpdateFindingRequest, ::Google::Cloud::SecurityCenter::V2::Finding + # Updates a mute config. If no location is specified, default is + # global. + rpc :UpdateMuteConfig, ::Google::Cloud::SecurityCenter::V2::UpdateMuteConfigRequest, ::Google::Cloud::SecurityCenter::V2::MuteConfig + # Updates a notification config. The following update + # fields are allowed: description, pubsub_topic, streaming_config.filter + rpc :UpdateNotificationConfig, ::Google::Cloud::SecurityCenter::V2::UpdateNotificationConfigRequest, ::Google::Cloud::SecurityCenter::V2::NotificationConfig + # Updates an existing ResourceValueConfigs with new rules. + rpc :UpdateResourceValueConfig, ::Google::Cloud::SecurityCenter::V2::UpdateResourceValueConfigRequest, ::Google::Cloud::SecurityCenter::V2::ResourceValueConfig + # Updates security marks. For Finding Security marks, if no location is + # specified, finding is assumed to be in global. Assets Security Marks can + # only be accessed through global endpoint. + rpc :UpdateSecurityMarks, ::Google::Cloud::SecurityCenter::V2::UpdateSecurityMarksRequest, ::Google::Cloud::SecurityCenter::V2::SecurityMarks + # Updates a source. + rpc :UpdateSource, ::Google::Cloud::SecurityCenter::V2::UpdateSourceRequest, ::Google::Cloud::SecurityCenter::V2::Source + end + + Stub = Service.rpc_stub_class + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-security_center-v2/lib/google/cloud/securitycenter/v2/simulation_pb.rb b/owl-bot-staging/google-cloud-security_center-v2/lib/google/cloud/securitycenter/v2/simulation_pb.rb new file mode 100644 index 000000000000..7ffa40f95f0a --- /dev/null +++ b/owl-bot-staging/google-cloud-security_center-v2/lib/google/cloud/securitycenter/v2/simulation_pb.rb @@ -0,0 +1,27 @@ +# frozen_string_literal: true +# Generated by the protocol buffer compiler. DO NOT EDIT! +# source: google/cloud/securitycenter/v2/simulation.proto + +require 'google/protobuf' + +require 'google/api/field_behavior_pb' +require 'google/api/resource_pb' +require 'google/cloud/securitycenter/v2/resource_pb' +require 'google/cloud/securitycenter/v2/valued_resource_pb' +require 'google/protobuf/timestamp_pb' + + +descriptor_data = "\n/google/cloud/securitycenter/v2/simulation.proto\x12\x1egoogle.cloud.securitycenter.v2\x1a\x1fgoogle/api/field_behavior.proto\x1a\x19google/api/resource.proto\x1a-google/cloud/securitycenter/v2/resource.proto\x1a\x34google/cloud/securitycenter/v2/valued_resource.proto\x1a\x1fgoogle/protobuf/timestamp.proto\"\xca\x03\n\nSimulation\x12\x0c\n\x04name\x18\x01 \x01(\t\x12\x34\n\x0b\x63reate_time\x18\x02 \x01(\x0b\x32\x1a.google.protobuf.TimestampB\x03\xe0\x41\x03\x12\x64\n\x1fresource_value_configs_metadata\x18\x03 \x03(\x0b\x32;.google.cloud.securitycenter.v2.ResourceValueConfigMetadata\x12\x45\n\x0e\x63loud_provider\x18\x04 \x01(\x0e\x32-.google.cloud.securitycenter.v2.CloudProvider:\xca\x01\xea\x41\xc6\x01\n(securitycenter.googleapis.com/Simulation\x12\x35organizations/{organization}/simulations/{simulation}\x12Jorganizations/{organization}/locations/{location}/simulations/{simluation}*\x0bsimulations2\nsimulationB\xe9\x01\n\"com.google.cloud.securitycenter.v2B\x0fSimulationProtoP\x01ZJcloud.google.com/go/securitycenter/apiv2/securitycenterpb;securitycenterpb\xaa\x02\x1eGoogle.Cloud.SecurityCenter.V2\xca\x02\x1eGoogle\\Cloud\\SecurityCenter\\V2\xea\x02!Google::Cloud::SecurityCenter::V2b\x06proto3" + +pool = ::Google::Protobuf::DescriptorPool.generated_pool +pool.add_serialized_file(descriptor_data) + +module Google + module Cloud + module SecurityCenter + module V2 + Simulation = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.securitycenter.v2.Simulation").msgclass + end + end + end +end diff --git a/owl-bot-staging/google-cloud-security_center-v2/lib/google/cloud/securitycenter/v2/source_pb.rb b/owl-bot-staging/google-cloud-security_center-v2/lib/google/cloud/securitycenter/v2/source_pb.rb new file mode 100644 index 000000000000..073204318455 --- /dev/null +++ b/owl-bot-staging/google-cloud-security_center-v2/lib/google/cloud/securitycenter/v2/source_pb.rb @@ -0,0 +1,23 @@ +# frozen_string_literal: true +# Generated by the protocol buffer compiler. DO NOT EDIT! +# source: google/cloud/securitycenter/v2/source.proto + +require 'google/protobuf' + +require 'google/api/resource_pb' + + +descriptor_data = "\n+google/cloud/securitycenter/v2/source.proto\x12\x1egoogle.cloud.securitycenter.v2\x1a\x19google/api/resource.proto\"\xfd\x01\n\x06Source\x12\x0c\n\x04name\x18\x01 \x01(\t\x12\x14\n\x0c\x64isplay_name\x18\x02 \x01(\t\x12\x13\n\x0b\x64\x65scription\x18\x03 \x01(\t\x12\x16\n\x0e\x63\x61nonical_name\x18\x04 \x01(\t:\xa1\x01\xea\x41\x9d\x01\n$securitycenter.googleapis.com/Source\x12-organizations/{organization}/sources/{source}\x12!folders/{folder}/sources/{source}\x12#projects/{project}/sources/{source}B\xe5\x01\n\"com.google.cloud.securitycenter.v2B\x0bSourceProtoP\x01ZJcloud.google.com/go/securitycenter/apiv2/securitycenterpb;securitycenterpb\xaa\x02\x1eGoogle.Cloud.SecurityCenter.V2\xca\x02\x1eGoogle\\Cloud\\SecurityCenter\\V2\xea\x02!Google::Cloud::SecurityCenter::V2b\x06proto3" + +pool = ::Google::Protobuf::DescriptorPool.generated_pool +pool.add_serialized_file(descriptor_data) + +module Google + module Cloud + module SecurityCenter + module V2 + Source = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.securitycenter.v2.Source").msgclass + end + end + end +end diff --git a/owl-bot-staging/google-cloud-security_center-v2/lib/google/cloud/securitycenter/v2/toxic_combination_pb.rb b/owl-bot-staging/google-cloud-security_center-v2/lib/google/cloud/securitycenter/v2/toxic_combination_pb.rb new file mode 100644 index 000000000000..7096e7b98ac2 --- /dev/null +++ b/owl-bot-staging/google-cloud-security_center-v2/lib/google/cloud/securitycenter/v2/toxic_combination_pb.rb @@ -0,0 +1,21 @@ +# frozen_string_literal: true +# Generated by the protocol buffer compiler. DO NOT EDIT! +# source: google/cloud/securitycenter/v2/toxic_combination.proto + +require 'google/protobuf' + + +descriptor_data = "\n6google/cloud/securitycenter/v2/toxic_combination.proto\x12\x1egoogle.cloud.securitycenter.v2\"K\n\x10ToxicCombination\x12\x1d\n\x15\x61ttack_exposure_score\x18\x01 \x01(\x01\x12\x18\n\x10related_findings\x18\x02 \x03(\tB\xef\x01\n\"com.google.cloud.securitycenter.v2B\x15ToxicCombinationProtoP\x01ZJcloud.google.com/go/securitycenter/apiv2/securitycenterpb;securitycenterpb\xaa\x02\x1eGoogle.Cloud.SecurityCenter.V2\xca\x02\x1eGoogle\\Cloud\\SecurityCenter\\V2\xea\x02!Google::Cloud::SecurityCenter::V2b\x06proto3" + +pool = ::Google::Protobuf::DescriptorPool.generated_pool +pool.add_serialized_file(descriptor_data) + +module Google + module Cloud + module SecurityCenter + module V2 + ToxicCombination = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.securitycenter.v2.ToxicCombination").msgclass + end + end + end +end diff --git a/owl-bot-staging/google-cloud-security_center-v2/lib/google/cloud/securitycenter/v2/valued_resource_pb.rb b/owl-bot-staging/google-cloud-security_center-v2/lib/google/cloud/securitycenter/v2/valued_resource_pb.rb new file mode 100644 index 000000000000..b7df23211efc --- /dev/null +++ b/owl-bot-staging/google-cloud-security_center-v2/lib/google/cloud/securitycenter/v2/valued_resource_pb.rb @@ -0,0 +1,25 @@ +# frozen_string_literal: true +# Generated by the protocol buffer compiler. DO NOT EDIT! +# source: google/cloud/securitycenter/v2/valued_resource.proto + +require 'google/protobuf' + +require 'google/api/resource_pb' + + +descriptor_data = "\n4google/cloud/securitycenter/v2/valued_resource.proto\x12\x1egoogle.cloud.securitycenter.v2\x1a\x19google/api/resource.proto\"\xc6\x05\n\x0eValuedResource\x12\x0c\n\x04name\x18\x01 \x01(\t\x12\x10\n\x08resource\x18\x02 \x01(\t\x12\x15\n\rresource_type\x18\x03 \x01(\t\x12\x14\n\x0c\x64isplay_name\x18\x04 \x01(\t\x12T\n\x0eresource_value\x18\x05 \x01(\x0e\x32<.google.cloud.securitycenter.v2.ValuedResource.ResourceValue\x12\x15\n\rexposed_score\x18\x06 \x01(\x01\x12`\n\x1bresource_value_configs_used\x18\x07 \x03(\x0b\x32;.google.cloud.securitycenter.v2.ResourceValueConfigMetadata\"{\n\rResourceValue\x12\x1e\n\x1aRESOURCE_VALUE_UNSPECIFIED\x10\x00\x12\x16\n\x12RESOURCE_VALUE_LOW\x10\x01\x12\x19\n\x15RESOURCE_VALUE_MEDIUM\x10\x02\x12\x17\n\x13RESOURCE_VALUE_HIGH\x10\x03:\x9a\x02\xea\x41\x96\x02\n,securitycenter.googleapis.com/ValuedResource\x12Worganizations/{organization}/simulations/{simulation}/valuedResources/{valued_resource}\x12lorganizations/{organization}/locations/{location}/simulations/{simluation}/valuedResources/{valued_resource}*\x0fvaluedResources2\x0evaluedResource\"+\n\x1bResourceValueConfigMetadata\x12\x0c\n\x04name\x18\x01 \x01(\tB\xed\x01\n\"com.google.cloud.securitycenter.v2B\x13ValuedResourceProtoP\x01ZJcloud.google.com/go/securitycenter/apiv2/securitycenterpb;securitycenterpb\xaa\x02\x1eGoogle.Cloud.SecurityCenter.V2\xca\x02\x1eGoogle\\Cloud\\SecurityCenter\\V2\xea\x02!Google::Cloud::SecurityCenter::V2b\x06proto3" + +pool = ::Google::Protobuf::DescriptorPool.generated_pool +pool.add_serialized_file(descriptor_data) + +module Google + module Cloud + module SecurityCenter + module V2 + ValuedResource = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.securitycenter.v2.ValuedResource").msgclass + ValuedResource::ResourceValue = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.securitycenter.v2.ValuedResource.ResourceValue").enummodule + ResourceValueConfigMetadata = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.securitycenter.v2.ResourceValueConfigMetadata").msgclass + end + end + end +end diff --git a/owl-bot-staging/google-cloud-security_center-v2/lib/google/cloud/securitycenter/v2/vertex_ai_pb.rb b/owl-bot-staging/google-cloud-security_center-v2/lib/google/cloud/securitycenter/v2/vertex_ai_pb.rb new file mode 100644 index 000000000000..00ccbb3b5a21 --- /dev/null +++ b/owl-bot-staging/google-cloud-security_center-v2/lib/google/cloud/securitycenter/v2/vertex_ai_pb.rb @@ -0,0 +1,23 @@ +# frozen_string_literal: true +# Generated by the protocol buffer compiler. DO NOT EDIT! +# source: google/cloud/securitycenter/v2/vertex_ai.proto + +require 'google/protobuf' + + +descriptor_data = "\n.google/cloud/securitycenter/v2/vertex_ai.proto\x12\x1egoogle.cloud.securitycenter.v2\"\x83\x02\n\x08VertexAi\x12\x42\n\x08\x64\x61tasets\x18\x01 \x03(\x0b\x32\x30.google.cloud.securitycenter.v2.VertexAi.Dataset\x12\x44\n\tpipelines\x18\x02 \x03(\x0b\x32\x31.google.cloud.securitycenter.v2.VertexAi.Pipeline\x1a=\n\x07\x44\x61taset\x12\x0c\n\x04name\x18\x01 \x01(\t\x12\x14\n\x0c\x64isplay_name\x18\x02 \x01(\t\x12\x0e\n\x06source\x18\x03 \x01(\t\x1a.\n\x08Pipeline\x12\x0c\n\x04name\x18\x01 \x01(\t\x12\x14\n\x0c\x64isplay_name\x18\x02 \x01(\tB\xe7\x01\n\"com.google.cloud.securitycenter.v2B\rVertexAiProtoP\x01ZJcloud.google.com/go/securitycenter/apiv2/securitycenterpb;securitycenterpb\xaa\x02\x1eGoogle.Cloud.SecurityCenter.V2\xca\x02\x1eGoogle\\Cloud\\SecurityCenter\\V2\xea\x02!Google::Cloud::SecurityCenter::V2b\x06proto3" + +pool = ::Google::Protobuf::DescriptorPool.generated_pool +pool.add_serialized_file(descriptor_data) + +module Google + module Cloud + module SecurityCenter + module V2 + VertexAi = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.securitycenter.v2.VertexAi").msgclass + VertexAi::Dataset = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.securitycenter.v2.VertexAi.Dataset").msgclass + VertexAi::Pipeline = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.securitycenter.v2.VertexAi.Pipeline").msgclass + end + end + end +end diff --git a/owl-bot-staging/google-cloud-security_center-v2/lib/google/cloud/securitycenter/v2/vulnerability_pb.rb b/owl-bot-staging/google-cloud-security_center-v2/lib/google/cloud/securitycenter/v2/vulnerability_pb.rb new file mode 100644 index 000000000000..deb4b635f6df --- /dev/null +++ b/owl-bot-staging/google-cloud-security_center-v2/lib/google/cloud/securitycenter/v2/vulnerability_pb.rb @@ -0,0 +1,37 @@ +# frozen_string_literal: true +# Generated by the protocol buffer compiler. DO NOT EDIT! +# source: google/cloud/securitycenter/v2/vulnerability.proto + +require 'google/protobuf' + +require 'google/protobuf/timestamp_pb' + + +descriptor_data = "\n2google/cloud/securitycenter/v2/vulnerability.proto\x12\x1egoogle.cloud.securitycenter.v2\x1a\x1fgoogle/protobuf/timestamp.proto\"\xf5\x02\n\rVulnerability\x12\x30\n\x03\x63ve\x18\x01 \x01(\x0b\x32#.google.cloud.securitycenter.v2.Cve\x12\x42\n\x11offending_package\x18\x02 \x01(\x0b\x32\'.google.cloud.securitycenter.v2.Package\x12>\n\rfixed_package\x18\x03 \x01(\x0b\x32\'.google.cloud.securitycenter.v2.Package\x12K\n\x11security_bulletin\x18\x04 \x01(\x0b\x32\x30.google.cloud.securitycenter.v2.SecurityBulletin\x12\x1b\n\x13provider_risk_score\x18\x05 \x01(\x03\x12\x11\n\treachable\x18\x06 \x01(\x08\x12\x31\n\x04\x63wes\x18\x07 \x03(\x0b\x32#.google.cloud.securitycenter.v2.Cwe\"\xc7\x05\n\x03\x43ve\x12\n\n\x02id\x18\x01 \x01(\t\x12=\n\nreferences\x18\x02 \x03(\x0b\x32).google.cloud.securitycenter.v2.Reference\x12\x36\n\x06\x63vssv3\x18\x03 \x01(\x0b\x32&.google.cloud.securitycenter.v2.Cvssv3\x12\x1e\n\x16upstream_fix_available\x18\x04 \x01(\x08\x12>\n\x06impact\x18\x05 \x01(\x0e\x32..google.cloud.securitycenter.v2.Cve.RiskRating\x12W\n\x15\x65xploitation_activity\x18\x06 \x01(\x0e\x32\x38.google.cloud.securitycenter.v2.Cve.ExploitationActivity\x12\x1c\n\x14observed_in_the_wild\x18\x07 \x01(\x08\x12\x10\n\x08zero_day\x18\x08 \x01(\x08\x12\x38\n\x14\x65xploit_release_date\x18\t \x01(\x0b\x32\x1a.google.protobuf.Timestamp\x12;\n\x17\x66irst_exploitation_date\x18\n \x01(\x0b\x32\x1a.google.protobuf.Timestamp\"V\n\nRiskRating\x12\x1b\n\x17RISK_RATING_UNSPECIFIED\x10\x00\x12\x07\n\x03LOW\x10\x01\x12\n\n\x06MEDIUM\x10\x02\x12\x08\n\x04HIGH\x10\x03\x12\x0c\n\x08\x43RITICAL\x10\x04\"\x84\x01\n\x14\x45xploitationActivity\x12%\n!EXPLOITATION_ACTIVITY_UNSPECIFIED\x10\x00\x12\x08\n\x04WIDE\x10\x01\x12\r\n\tCONFIRMED\x10\x02\x12\r\n\tAVAILABLE\x10\x03\x12\x0f\n\x0b\x41NTICIPATED\x10\x04\x12\x0c\n\x08NO_KNOWN\x10\x05\"(\n\tReference\x12\x0e\n\x06source\x18\x01 \x01(\t\x12\x0b\n\x03uri\x18\x02 \x01(\t\"\xb1\n\n\x06\x43vssv3\x12\x12\n\nbase_score\x18\x01 \x01(\x01\x12J\n\rattack_vector\x18\x02 \x01(\x0e\x32\x33.google.cloud.securitycenter.v2.Cvssv3.AttackVector\x12R\n\x11\x61ttack_complexity\x18\x03 \x01(\x0e\x32\x37.google.cloud.securitycenter.v2.Cvssv3.AttackComplexity\x12V\n\x13privileges_required\x18\x04 \x01(\x0e\x32\x39.google.cloud.securitycenter.v2.Cvssv3.PrivilegesRequired\x12P\n\x10user_interaction\x18\x05 \x01(\x0e\x32\x36.google.cloud.securitycenter.v2.Cvssv3.UserInteraction\x12;\n\x05scope\x18\x06 \x01(\x0e\x32,.google.cloud.securitycenter.v2.Cvssv3.Scope\x12M\n\x16\x63onfidentiality_impact\x18\x07 \x01(\x0e\x32-.google.cloud.securitycenter.v2.Cvssv3.Impact\x12G\n\x10integrity_impact\x18\x08 \x01(\x0e\x32-.google.cloud.securitycenter.v2.Cvssv3.Impact\x12J\n\x13\x61vailability_impact\x18\t \x01(\x0e\x32-.google.cloud.securitycenter.v2.Cvssv3.Impact\"\x99\x01\n\x0c\x41ttackVector\x12\x1d\n\x19\x41TTACK_VECTOR_UNSPECIFIED\x10\x00\x12\x19\n\x15\x41TTACK_VECTOR_NETWORK\x10\x01\x12\x1a\n\x16\x41TTACK_VECTOR_ADJACENT\x10\x02\x12\x17\n\x13\x41TTACK_VECTOR_LOCAL\x10\x03\x12\x1a\n\x16\x41TTACK_VECTOR_PHYSICAL\x10\x04\"l\n\x10\x41ttackComplexity\x12!\n\x1d\x41TTACK_COMPLEXITY_UNSPECIFIED\x10\x00\x12\x19\n\x15\x41TTACK_COMPLEXITY_LOW\x10\x01\x12\x1a\n\x16\x41TTACK_COMPLEXITY_HIGH\x10\x02\"\x92\x01\n\x12PrivilegesRequired\x12#\n\x1fPRIVILEGES_REQUIRED_UNSPECIFIED\x10\x00\x12\x1c\n\x18PRIVILEGES_REQUIRED_NONE\x10\x01\x12\x1b\n\x17PRIVILEGES_REQUIRED_LOW\x10\x02\x12\x1c\n\x18PRIVILEGES_REQUIRED_HIGH\x10\x03\"m\n\x0fUserInteraction\x12 \n\x1cUSER_INTERACTION_UNSPECIFIED\x10\x00\x12\x19\n\x15USER_INTERACTION_NONE\x10\x01\x12\x1d\n\x19USER_INTERACTION_REQUIRED\x10\x02\"F\n\x05Scope\x12\x15\n\x11SCOPE_UNSPECIFIED\x10\x00\x12\x13\n\x0fSCOPE_UNCHANGED\x10\x01\x12\x11\n\rSCOPE_CHANGED\x10\x02\"R\n\x06Impact\x12\x16\n\x12IMPACT_UNSPECIFIED\x10\x00\x12\x0f\n\x0bIMPACT_HIGH\x10\x01\x12\x0e\n\nIMPACT_LOW\x10\x02\x12\x0f\n\x0bIMPACT_NONE\x10\x03\"_\n\x07Package\x12\x14\n\x0cpackage_name\x18\x01 \x01(\t\x12\x0f\n\x07\x63pe_uri\x18\x02 \x01(\t\x12\x14\n\x0cpackage_type\x18\x03 \x01(\t\x12\x17\n\x0fpackage_version\x18\x04 \x01(\t\"\x7f\n\x10SecurityBulletin\x12\x13\n\x0b\x62ulletin_id\x18\x01 \x01(\t\x12\x33\n\x0fsubmission_time\x18\x02 \x01(\x0b\x32\x1a.google.protobuf.Timestamp\x12!\n\x19suggested_upgrade_version\x18\x03 \x01(\t\"P\n\x03\x43we\x12\n\n\x02id\x18\x01 \x01(\t\x12=\n\nreferences\x18\x02 \x03(\x0b\x32).google.cloud.securitycenter.v2.ReferenceB\xec\x01\n\"com.google.cloud.securitycenter.v2B\x12VulnerabilityProtoP\x01ZJcloud.google.com/go/securitycenter/apiv2/securitycenterpb;securitycenterpb\xaa\x02\x1eGoogle.Cloud.SecurityCenter.V2\xca\x02\x1eGoogle\\Cloud\\SecurityCenter\\V2\xea\x02!Google::Cloud::SecurityCenter::V2b\x06proto3" + +pool = ::Google::Protobuf::DescriptorPool.generated_pool +pool.add_serialized_file(descriptor_data) + +module Google + module Cloud + module SecurityCenter + module V2 + Vulnerability = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.securitycenter.v2.Vulnerability").msgclass + Cve = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.securitycenter.v2.Cve").msgclass + Cve::RiskRating = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.securitycenter.v2.Cve.RiskRating").enummodule + Cve::ExploitationActivity = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.securitycenter.v2.Cve.ExploitationActivity").enummodule + Reference = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.securitycenter.v2.Reference").msgclass + Cvssv3 = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.securitycenter.v2.Cvssv3").msgclass + Cvssv3::AttackVector = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.securitycenter.v2.Cvssv3.AttackVector").enummodule + Cvssv3::AttackComplexity = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.securitycenter.v2.Cvssv3.AttackComplexity").enummodule + Cvssv3::PrivilegesRequired = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.securitycenter.v2.Cvssv3.PrivilegesRequired").enummodule + Cvssv3::UserInteraction = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.securitycenter.v2.Cvssv3.UserInteraction").enummodule + Cvssv3::Scope = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.securitycenter.v2.Cvssv3.Scope").enummodule + Cvssv3::Impact = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.securitycenter.v2.Cvssv3.Impact").enummodule + Package = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.securitycenter.v2.Package").msgclass + SecurityBulletin = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.securitycenter.v2.SecurityBulletin").msgclass + Cwe = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.securitycenter.v2.Cwe").msgclass + end + end + end +end diff --git a/owl-bot-staging/google-cloud-security_center-v2/proto_docs/README.md b/owl-bot-staging/google-cloud-security_center-v2/proto_docs/README.md new file mode 100644 index 000000000000..c8ec50fdacaa --- /dev/null +++ b/owl-bot-staging/google-cloud-security_center-v2/proto_docs/README.md @@ -0,0 +1,4 @@ +# Security Command Center V2 Protocol Buffer Documentation + +These files are for the YARD documentation of the generated protobuf files. +They are not intended to be required or loaded at runtime. diff --git a/owl-bot-staging/google-cloud-security_center-v2/proto_docs/google/api/client.rb b/owl-bot-staging/google-cloud-security_center-v2/proto_docs/google/api/client.rb new file mode 100644 index 000000000000..5089551e9ea4 --- /dev/null +++ b/owl-bot-staging/google-cloud-security_center-v2/proto_docs/google/api/client.rb @@ -0,0 +1,589 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + + +module Google + module Api + # Required information for every language. + # @!attribute [rw] reference_docs_uri + # @deprecated This field is deprecated and may be removed in the next major version update. + # @return [::String] + # Link to automatically generated reference documentation. Example: + # https://cloud.google.com/nodejs/docs/reference/asset/latest + # @!attribute [rw] destinations + # @return [::Array<::Google::Api::ClientLibraryDestination>] + # The destination where API teams want this client library to be published. + # @!attribute [rw] selective_gapic_generation + # @return [::Google::Api::SelectiveGapicGeneration] + # Configuration for which RPCs should be generated in the GAPIC client. + class CommonLanguageSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Details about how and where to publish client libraries. + # @!attribute [rw] version + # @return [::String] + # Version of the API to apply these settings to. This is the full protobuf + # package for the API, ending in the version element. + # Examples: "google.cloud.speech.v1" and "google.spanner.admin.database.v1". + # @!attribute [rw] launch_stage + # @return [::Google::Api::LaunchStage] + # Launch stage of this version of the API. + # @!attribute [rw] rest_numeric_enums + # @return [::Boolean] + # When using transport=rest, the client request will encode enums as + # numbers rather than strings. + # @!attribute [rw] java_settings + # @return [::Google::Api::JavaSettings] + # Settings for legacy Java features, supported in the Service YAML. + # @!attribute [rw] cpp_settings + # @return [::Google::Api::CppSettings] + # Settings for C++ client libraries. + # @!attribute [rw] php_settings + # @return [::Google::Api::PhpSettings] + # Settings for PHP client libraries. + # @!attribute [rw] python_settings + # @return [::Google::Api::PythonSettings] + # Settings for Python client libraries. + # @!attribute [rw] node_settings + # @return [::Google::Api::NodeSettings] + # Settings for Node client libraries. + # @!attribute [rw] dotnet_settings + # @return [::Google::Api::DotnetSettings] + # Settings for .NET client libraries. + # @!attribute [rw] ruby_settings + # @return [::Google::Api::RubySettings] + # Settings for Ruby client libraries. + # @!attribute [rw] go_settings + # @return [::Google::Api::GoSettings] + # Settings for Go client libraries. + class ClientLibrarySettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # This message configures the settings for publishing [Google Cloud Client + # libraries](https://cloud.google.com/apis/docs/cloud-client-libraries) + # generated from the service config. + # @!attribute [rw] method_settings + # @return [::Array<::Google::Api::MethodSettings>] + # A list of API method settings, e.g. the behavior for methods that use the + # long-running operation pattern. + # @!attribute [rw] new_issue_uri + # @return [::String] + # Link to a *public* URI where users can report issues. Example: + # https://issuetracker.google.com/issues/new?component=190865&template=1161103 + # @!attribute [rw] documentation_uri + # @return [::String] + # Link to product home page. Example: + # https://cloud.google.com/asset-inventory/docs/overview + # @!attribute [rw] api_short_name + # @return [::String] + # Used as a tracking tag when collecting data about the APIs developer + # relations artifacts like docs, packages delivered to package managers, + # etc. Example: "speech". + # @!attribute [rw] github_label + # @return [::String] + # GitHub label to apply to issues and pull requests opened for this API. + # @!attribute [rw] codeowner_github_teams + # @return [::Array<::String>] + # GitHub teams to be added to CODEOWNERS in the directory in GitHub + # containing source code for the client libraries for this API. + # @!attribute [rw] doc_tag_prefix + # @return [::String] + # A prefix used in sample code when demarking regions to be included in + # documentation. + # @!attribute [rw] organization + # @return [::Google::Api::ClientLibraryOrganization] + # For whom the client library is being published. + # @!attribute [rw] library_settings + # @return [::Array<::Google::Api::ClientLibrarySettings>] + # Client library settings. If the same version string appears multiple + # times in this list, then the last one wins. Settings from earlier + # settings with the same version string are discarded. + # @!attribute [rw] proto_reference_documentation_uri + # @return [::String] + # Optional link to proto reference documentation. Example: + # https://cloud.google.com/pubsub/lite/docs/reference/rpc + # @!attribute [rw] rest_reference_documentation_uri + # @return [::String] + # Optional link to REST reference documentation. Example: + # https://cloud.google.com/pubsub/lite/docs/reference/rest + class Publishing + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Settings for Java client libraries. + # @!attribute [rw] library_package + # @return [::String] + # The package name to use in Java. Clobbers the java_package option + # set in the protobuf. This should be used **only** by APIs + # who have already set the language_settings.java.package_name" field + # in gapic.yaml. API teams should use the protobuf java_package option + # where possible. + # + # Example of a YAML configuration:: + # + # publishing: + # 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. + # @!attribute [rw] methods + # @return [::Array<::String>] + # An allowlist of the fully qualified names of RPCs that should be included + # on public client surfaces. + # @!attribute [rw] generate_omitted_as_internal + # @return [::Boolean] + # Setting this to true indicates to the client generators that methods + # that would be excluded from the generation should instead be generated + # in a way that indicates these methods should not be consumed by + # end users. How this is expressed is up to individual language + # implementations to decide. Some examples may be: added annotations, + # obfuscated identifiers, or other language idiomatic patterns. + class SelectiveGapicGeneration + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # `BatchingConfigProto` defines the batching configuration for an API method. + # @!attribute [rw] thresholds + # @return [::Google::Api::BatchingSettingsProto] + # The thresholds which trigger a batched request to be sent. + # @!attribute [rw] batch_descriptor + # @return [::Google::Api::BatchingDescriptorProto] + # The request and response fields used in batching. + class BatchingConfigProto + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # `BatchingSettingsProto` specifies a set of batching thresholds, each of + # which acts as a trigger to send a batch of messages as a request. At least + # one threshold must be positive nonzero. + # @!attribute [rw] element_count_threshold + # @return [::Integer] + # The number of elements of a field collected into a batch which, if + # exceeded, causes the batch to be sent. + # @!attribute [rw] request_byte_threshold + # @return [::Integer] + # The aggregated size of the batched field which, if exceeded, causes the + # batch to be sent. This size is computed by aggregating the sizes of the + # request field to be batched, not of the entire request message. + # @!attribute [rw] delay_threshold + # @return [::Google::Protobuf::Duration] + # The duration after which a batch should be sent, starting from the addition + # of the first message to that batch. + # @!attribute [rw] element_count_limit + # @return [::Integer] + # The maximum number of elements collected in a batch that could be accepted + # by server. + # @!attribute [rw] request_byte_limit + # @return [::Integer] + # The maximum size of the request that could be accepted by server. + # @!attribute [rw] flow_control_element_limit + # @return [::Integer] + # The maximum number of elements allowed by flow control. + # @!attribute [rw] flow_control_byte_limit + # @return [::Integer] + # The maximum size of data allowed by flow control. + # @!attribute [rw] flow_control_limit_exceeded_behavior + # @return [::Google::Api::FlowControlLimitExceededBehaviorProto] + # The behavior to take when the flow control limit is exceeded. + class BatchingSettingsProto + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # `BatchingDescriptorProto` specifies the fields of the request message to be + # used for batching, and, optionally, the fields of the response message to be + # used for demultiplexing. + # @!attribute [rw] batched_field + # @return [::String] + # The repeated field in the request message to be aggregated by batching. + # @!attribute [rw] discriminator_fields + # @return [::Array<::String>] + # A list of the fields in the request message. Two requests will be batched + # together only if the values of every field specified in + # `request_discriminator_fields` is equal between the two requests. + # @!attribute [rw] subresponse_field + # @return [::String] + # Optional. When present, indicates the field in the response message to be + # used to demultiplex the response into multiple response messages, in + # correspondence with the multiple request messages originally batched + # together. + class BatchingDescriptorProto + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # The organization for which the client libraries are being published. + # Affects the url where generated docs are published, etc. + module ClientLibraryOrganization + # Not useful. + CLIENT_LIBRARY_ORGANIZATION_UNSPECIFIED = 0 + + # Google Cloud Platform Org. + CLOUD = 1 + + # Ads (Advertising) Org. + ADS = 2 + + # Photos Org. + PHOTOS = 3 + + # Street View Org. + STREET_VIEW = 4 + + # Shopping Org. + SHOPPING = 5 + + # Geo Org. + GEO = 6 + + # Generative AI - https://developers.generativeai.google + GENERATIVE_AI = 7 + end + + # To where should client libraries be published? + module ClientLibraryDestination + # Client libraries will neither be generated nor published to package + # managers. + CLIENT_LIBRARY_DESTINATION_UNSPECIFIED = 0 + + # Generate the client library in a repo under github.com/googleapis, + # but don't publish it to package managers. + GITHUB = 10 + + # Publish the library to package managers like nuget.org and npmjs.com. + PACKAGE_MANAGER = 20 + end + + # The behavior to take when the flow control limit is exceeded. + module FlowControlLimitExceededBehaviorProto + # Default behavior, system-defined. + UNSET_BEHAVIOR = 0 + + # Stop operation, raise error. + THROW_EXCEPTION = 1 + + # Pause operation until limit clears. + BLOCK = 2 + + # Continue operation, disregard limit. + IGNORE = 3 + end + end +end diff --git a/owl-bot-staging/google-cloud-security_center-v2/proto_docs/google/api/field_behavior.rb b/owl-bot-staging/google-cloud-security_center-v2/proto_docs/google/api/field_behavior.rb new file mode 100644 index 000000000000..582be187d115 --- /dev/null +++ b/owl-bot-staging/google-cloud-security_center-v2/proto_docs/google/api/field_behavior.rb @@ -0,0 +1,85 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + + +module Google + module Api + # An indicator of the behavior of a given field (for example, that a field + # is required in requests, or given as output but ignored as input). + # This **does not** change the behavior in protocol buffers itself; it only + # denotes the behavior and may affect how API tooling handles the field. + # + # Note: This enum **may** receive new values in the future. + module FieldBehavior + # Conventional default for enums. Do not use this. + FIELD_BEHAVIOR_UNSPECIFIED = 0 + + # Specifically denotes a field as optional. + # While all fields in protocol buffers are optional, this may be specified + # for emphasis if appropriate. + OPTIONAL = 1 + + # Denotes a field as required. + # This indicates that the field **must** be provided as part of the request, + # and failure to do so will cause an error (usually `INVALID_ARGUMENT`). + REQUIRED = 2 + + # Denotes a field as output only. + # This indicates that the field is provided in responses, but including the + # field in a request does nothing (the server *must* ignore it and + # *must not* throw an error as a result of the field's presence). + OUTPUT_ONLY = 3 + + # Denotes a field as input only. + # This indicates that the field is provided in requests, and the + # corresponding field is not included in output. + INPUT_ONLY = 4 + + # Denotes a field as immutable. + # This indicates that the field may be set once in a request to create a + # resource, but may not be changed thereafter. + IMMUTABLE = 5 + + # Denotes that a (repeated) field is an unordered list. + # This indicates that the service may provide the elements of the list + # in any arbitrary order, rather than the order the user originally + # provided. Additionally, the list's order may or may not be stable. + UNORDERED_LIST = 6 + + # Denotes that this field returns a non-empty default value if not set. + # This indicates that if the user provides the empty value in a request, + # a non-empty value will be returned. The user will not be aware of what + # non-empty value to expect. + NON_EMPTY_DEFAULT = 7 + + # Denotes that the field in a resource (a message annotated with + # google.api.resource) is used in the resource name to uniquely identify the + # resource. For AIP-compliant APIs, this should only be applied to the + # `name` field on the resource. + # + # This behavior should not be applied to references to other resources within + # the message. + # + # The identifier field of resources often have different field behavior + # depending on the request it is embedded in (e.g. for Create methods name + # is optional and unused, while for Update methods it is required). Instead + # of method-specific annotations, only `IDENTIFIER` is required. + IDENTIFIER = 8 + end + end +end diff --git a/owl-bot-staging/google-cloud-security_center-v2/proto_docs/google/api/launch_stage.rb b/owl-bot-staging/google-cloud-security_center-v2/proto_docs/google/api/launch_stage.rb new file mode 100644 index 000000000000..9392a413fb1b --- /dev/null +++ b/owl-bot-staging/google-cloud-security_center-v2/proto_docs/google/api/launch_stage.rb @@ -0,0 +1,71 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + + +module Google + module Api + # The launch stage as defined by [Google Cloud Platform + # Launch Stages](https://cloud.google.com/terms/launch-stages). + module LaunchStage + # Do not use this default value. + LAUNCH_STAGE_UNSPECIFIED = 0 + + # The feature is not yet implemented. Users can not use it. + UNIMPLEMENTED = 6 + + # Prelaunch features are hidden from users and are only visible internally. + PRELAUNCH = 7 + + # Early Access features are limited to a closed group of testers. To use + # these features, you must sign up in advance and sign a Trusted Tester + # agreement (which includes confidentiality provisions). These features may + # be unstable, changed in backward-incompatible ways, and are not + # guaranteed to be released. + EARLY_ACCESS = 1 + + # Alpha is a limited availability test for releases before they are cleared + # for widespread use. By Alpha, all significant design issues are resolved + # and we are in the process of verifying functionality. Alpha customers + # need to apply for access, agree to applicable terms, and have their + # projects allowlisted. Alpha releases don't have to be feature complete, + # no SLAs are provided, and there are no technical support obligations, but + # they will be far enough along that customers can actually use them in + # test environments or for limited-use tests -- just like they would in + # normal production cases. + ALPHA = 2 + + # Beta is the point at which we are ready to open a release for any + # customer to use. There are no SLA or technical support obligations in a + # Beta release. Products will be complete from a feature perspective, but + # may have some open outstanding issues. Beta releases are suitable for + # limited production use cases. + BETA = 3 + + # GA features are open to all developers and are considered stable and + # fully qualified for production use. + GA = 4 + + # Deprecated features are scheduled to be shut down and removed. For more + # information, see the "Deprecation Policy" section of our [Terms of + # Service](https://cloud.google.com/terms/) + # and the [Google Cloud Platform Subject to the Deprecation + # Policy](https://cloud.google.com/terms/deprecation) documentation. + DEPRECATED = 5 + end + end +end diff --git a/owl-bot-staging/google-cloud-security_center-v2/proto_docs/google/api/resource.rb b/owl-bot-staging/google-cloud-security_center-v2/proto_docs/google/api/resource.rb new file mode 100644 index 000000000000..25dec4847ac1 --- /dev/null +++ b/owl-bot-staging/google-cloud-security_center-v2/proto_docs/google/api/resource.rb @@ -0,0 +1,227 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + + +module Google + module Api + # A simple descriptor of a resource type. + # + # ResourceDescriptor annotates a resource message (either by means of a + # protobuf annotation or use in the service config), and associates the + # resource's schema, the resource type, and the pattern of the resource name. + # + # Example: + # + # message Topic { + # // Indicates this message defines a resource schema. + # // Declares the resource type in the format of {service}/{kind}. + # // For Kubernetes resources, the format is {api group}/{kind}. + # option (google.api.resource) = { + # type: "pubsub.googleapis.com/Topic" + # pattern: "projects/{project}/topics/{topic}" + # }; + # } + # + # The ResourceDescriptor Yaml config will look like: + # + # resources: + # - type: "pubsub.googleapis.com/Topic" + # pattern: "projects/{project}/topics/{topic}" + # + # Sometimes, resources have multiple patterns, typically because they can + # live under multiple parents. + # + # Example: + # + # message LogEntry { + # option (google.api.resource) = { + # type: "logging.googleapis.com/LogEntry" + # pattern: "projects/{project}/logs/{log}" + # pattern: "folders/{folder}/logs/{log}" + # pattern: "organizations/{organization}/logs/{log}" + # pattern: "billingAccounts/{billing_account}/logs/{log}" + # }; + # } + # + # The ResourceDescriptor Yaml config will look like: + # + # resources: + # - type: 'logging.googleapis.com/LogEntry' + # pattern: "projects/{project}/logs/{log}" + # pattern: "folders/{folder}/logs/{log}" + # pattern: "organizations/{organization}/logs/{log}" + # pattern: "billingAccounts/{billing_account}/logs/{log}" + # @!attribute [rw] type + # @return [::String] + # The resource type. It must be in the format of + # \\{service_name}/\\{resource_type_kind}. The `resource_type_kind` must be + # singular and must not include version numbers. + # + # Example: `storage.googleapis.com/Bucket` + # + # The value of the resource_type_kind must follow the regular expression + # /[A-Za-z][a-zA-Z0-9]+/. It should start with an upper case character and + # should use PascalCase (UpperCamelCase). The maximum number of + # characters allowed for the `resource_type_kind` is 100. + # @!attribute [rw] pattern + # @return [::Array<::String>] + # Optional. The relative resource name pattern associated with this resource + # type. The DNS prefix of the full resource name shouldn't be specified here. + # + # The path pattern must follow the syntax, which aligns with HTTP binding + # syntax: + # + # Template = Segment { "/" Segment } ; + # Segment = LITERAL | Variable ; + # Variable = "{" LITERAL "}" ; + # + # Examples: + # + # - "projects/\\{project}/topics/\\{topic}" + # - "projects/\\{project}/knowledgeBases/\\{knowledge_base}" + # + # The components in braces correspond to the IDs for each resource in the + # hierarchy. It is expected that, if multiple patterns are provided, + # the same component name (e.g. "project") refers to IDs of the same + # type of resource. + # @!attribute [rw] name_field + # @return [::String] + # Optional. The field on the resource that designates the resource name + # field. If omitted, this is assumed to be "name". + # @!attribute [rw] history + # @return [::Google::Api::ResourceDescriptor::History] + # Optional. The historical or future-looking state of the resource pattern. + # + # Example: + # + # // The InspectTemplate message originally only supported resource + # // names with organization, and project was added later. + # message InspectTemplate { + # option (google.api.resource) = { + # type: "dlp.googleapis.com/InspectTemplate" + # pattern: + # "organizations/{organization}/inspectTemplates/{inspect_template}" + # pattern: "projects/{project}/inspectTemplates/{inspect_template}" + # history: ORIGINALLY_SINGLE_PATTERN + # }; + # } + # @!attribute [rw] plural + # @return [::String] + # The plural name used in the resource name and permission names, such as + # 'projects' for the resource name of 'projects/\\{project}' and the permission + # name of 'cloudresourcemanager.googleapis.com/projects.get'. One exception + # to this is for Nested Collections that have stuttering names, as defined + # in [AIP-122](https://google.aip.dev/122#nested-collections), where the + # collection ID in the resource name pattern does not necessarily directly + # match the `plural` value. + # + # It is the same concept of the `plural` field in k8s CRD spec + # https://kubernetes.io/docs/tasks/access-kubernetes-api/custom-resources/custom-resource-definitions/ + # + # Note: The plural form is required even for singleton resources. See + # https://aip.dev/156 + # @!attribute [rw] singular + # @return [::String] + # The same concept of the `singular` field in k8s CRD spec + # https://kubernetes.io/docs/tasks/access-kubernetes-api/custom-resources/custom-resource-definitions/ + # Such as "project" for the `resourcemanager.googleapis.com/Project` type. + # @!attribute [rw] style + # @return [::Array<::Google::Api::ResourceDescriptor::Style>] + # Style flag(s) for this resource. + # These indicate that a resource is expected to conform to a given + # style. See the specific style flags for additional information. + class ResourceDescriptor + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # A description of the historical or future-looking state of the + # resource pattern. + module History + # The "unset" value. + HISTORY_UNSPECIFIED = 0 + + # The resource originally had one pattern and launched as such, and + # additional patterns were added later. + ORIGINALLY_SINGLE_PATTERN = 1 + + # The resource has one pattern, but the API owner expects to add more + # later. (This is the inverse of ORIGINALLY_SINGLE_PATTERN, and prevents + # that from being necessary once there are multiple patterns.) + FUTURE_MULTI_PATTERN = 2 + end + + # A flag representing a specific style that a resource claims to conform to. + module Style + # The unspecified value. Do not use. + STYLE_UNSPECIFIED = 0 + + # This resource is intended to be "declarative-friendly". + # + # Declarative-friendly resources must be more strictly consistent, and + # setting this to true communicates to tools that this resource should + # adhere to declarative-friendly expectations. + # + # Note: This is used by the API linter (linter.aip.dev) to enable + # additional checks. + DECLARATIVE_FRIENDLY = 1 + end + end + + # Defines a proto annotation that describes a string field that refers to + # an API resource. + # @!attribute [rw] type + # @return [::String] + # The resource type that the annotated field references. + # + # Example: + # + # message Subscription { + # string topic = 2 [(google.api.resource_reference) = { + # type: "pubsub.googleapis.com/Topic" + # }]; + # } + # + # Occasionally, a field may reference an arbitrary resource. In this case, + # APIs use the special value * in their resource reference. + # + # Example: + # + # message GetIamPolicyRequest { + # string resource = 2 [(google.api.resource_reference) = { + # type: "*" + # }]; + # } + # @!attribute [rw] child_type + # @return [::String] + # The resource type of a child collection that the annotated field + # references. This is useful for annotating the `parent` field that + # doesn't have a fixed resource type. + # + # Example: + # + # message ListLogEntriesRequest { + # string parent = 1 [(google.api.resource_reference) = { + # child_type: "logging.googleapis.com/LogEntry" + # }; + # } + class ResourceReference + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end +end diff --git a/owl-bot-staging/google-cloud-security_center-v2/proto_docs/google/api/routing.rb b/owl-bot-staging/google-cloud-security_center-v2/proto_docs/google/api/routing.rb new file mode 100644 index 000000000000..6d71a9430253 --- /dev/null +++ b/owl-bot-staging/google-cloud-security_center-v2/proto_docs/google/api/routing.rb @@ -0,0 +1,463 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + + +module Google + module Api + # Specifies the routing information that should be sent along with the request + # in the form of routing header. + # **NOTE:** All service configuration rules follow the "last one wins" order. + # + # The examples below will apply to an RPC which has the following request type: + # + # Message Definition: + # + # message Request { + # // The name of the Table + # // Values can be of the following formats: + # // - `projects//tables/` + # // - `projects//instances//tables/
` + # // - `region//zones//tables/
` + # string table_name = 1; + # + # // This value specifies routing for replication. + # // It can be in the following formats: + # // - `profiles/` + # // - a legacy `profile_id` that can be any string + # string app_profile_id = 2; + # } + # + # Example message: + # + # { + # table_name: projects/proj_foo/instances/instance_bar/table/table_baz, + # app_profile_id: profiles/prof_qux + # } + # + # The routing header consists of one or multiple key-value pairs. The order of + # the key-value pairs is undefined, the order of the `routing_parameters` in + # the `RoutingRule` only matters for the evaluation order of the path + # templates when `field` is the same. See the examples below for more details. + # + # Every key and value in the routing header must be percent-encoded, + # and joined together in the following format: `key1=value1&key2=value2`. + # The examples below skip the percent-encoding for readability. + # + # Example 1 + # + # Extracting a field from the request to put into the routing header + # unchanged, with the key equal to the field name. + # + # annotation: + # + # option (google.api.routing) = { + # // Take the `app_profile_id`. + # routing_parameters { + # field: "app_profile_id" + # } + # }; + # + # result: + # + # x-goog-request-params: app_profile_id=profiles/prof_qux + # + # Example 2 + # + # Extracting a field from the request to put into the routing header + # unchanged, with the key different from the field name. + # + # annotation: + # + # option (google.api.routing) = { + # // Take the `app_profile_id`, but name it `routing_id` in the header. + # routing_parameters { + # field: "app_profile_id" + # path_template: "{routing_id=**}" + # } + # }; + # + # result: + # + # x-goog-request-params: routing_id=profiles/prof_qux + # + # Example 3 + # + # Extracting a field from the request to put into the routing + # header, while matching a path template syntax on the field's value. + # + # NB: it is more useful to send nothing than to send garbage for the purpose + # of dynamic routing, since garbage pollutes cache. Thus the matching. + # + # Sub-example 3a + # + # The field matches the template. + # + # annotation: + # + # option (google.api.routing) = { + # // Take the `table_name`, if it's well-formed (with project-based + # // syntax). + # routing_parameters { + # field: "table_name" + # path_template: "{table_name=projects/*/instances/*/**}" + # } + # }; + # + # result: + # + # x-goog-request-params: + # table_name=projects/proj_foo/instances/instance_bar/table/table_baz + # + # Sub-example 3b + # + # The field does not match the template. + # + # annotation: + # + # option (google.api.routing) = { + # // Take the `table_name`, if it's well-formed (with region-based + # // syntax). + # routing_parameters { + # field: "table_name" + # path_template: "{table_name=regions/*/zones/*/**}" + # } + # }; + # + # result: + # + # + # + # Sub-example 3c + # + # Multiple alternative conflictingly named path templates are + # specified. The one that matches is used to construct the header. + # + # annotation: + # + # option (google.api.routing) = { + # // Take the `table_name`, if it's well-formed, whether + # // using the region- or projects-based syntax. + # + # routing_parameters { + # field: "table_name" + # path_template: "{table_name=regions/*/zones/*/**}" + # } + # routing_parameters { + # field: "table_name" + # path_template: "{table_name=projects/*/instances/*/**}" + # } + # }; + # + # result: + # + # x-goog-request-params: + # table_name=projects/proj_foo/instances/instance_bar/table/table_baz + # + # Example 4 + # + # Extracting a single routing header key-value pair by matching a + # template syntax on (a part of) a single request field. + # + # annotation: + # + # option (google.api.routing) = { + # // Take just the project id from the `table_name` field. + # routing_parameters { + # field: "table_name" + # path_template: "{routing_id=projects/*}/**" + # } + # }; + # + # result: + # + # x-goog-request-params: routing_id=projects/proj_foo + # + # Example 5 + # + # Extracting a single routing header key-value pair by matching + # several conflictingly named path templates on (parts of) a single request + # field. The last template to match "wins" the conflict. + # + # annotation: + # + # option (google.api.routing) = { + # // If the `table_name` does not have instances information, + # // take just the project id for routing. + # // Otherwise take project + instance. + # + # routing_parameters { + # field: "table_name" + # path_template: "{routing_id=projects/*}/**" + # } + # routing_parameters { + # field: "table_name" + # path_template: "{routing_id=projects/*/instances/*}/**" + # } + # }; + # + # result: + # + # x-goog-request-params: + # routing_id=projects/proj_foo/instances/instance_bar + # + # Example 6 + # + # Extracting multiple routing header key-value pairs by matching + # several non-conflicting path templates on (parts of) a single request field. + # + # Sub-example 6a + # + # Make the templates strict, so that if the `table_name` does not + # have an instance information, nothing is sent. + # + # annotation: + # + # option (google.api.routing) = { + # // The routing code needs two keys instead of one composite + # // but works only for the tables with the "project-instance" name + # // syntax. + # + # routing_parameters { + # field: "table_name" + # path_template: "{project_id=projects/*}/instances/*/**" + # } + # routing_parameters { + # field: "table_name" + # path_template: "projects/*/{instance_id=instances/*}/**" + # } + # }; + # + # result: + # + # x-goog-request-params: + # project_id=projects/proj_foo&instance_id=instances/instance_bar + # + # Sub-example 6b + # + # Make the templates loose, so that if the `table_name` does not + # have an instance information, just the project id part is sent. + # + # annotation: + # + # option (google.api.routing) = { + # // The routing code wants two keys instead of one composite + # // but will work with just the `project_id` for tables without + # // an instance in the `table_name`. + # + # routing_parameters { + # field: "table_name" + # path_template: "{project_id=projects/*}/**" + # } + # routing_parameters { + # field: "table_name" + # path_template: "projects/*/{instance_id=instances/*}/**" + # } + # }; + # + # result (is the same as 6a for our example message because it has the instance + # information): + # + # x-goog-request-params: + # project_id=projects/proj_foo&instance_id=instances/instance_bar + # + # Example 7 + # + # Extracting multiple routing header key-value pairs by matching + # several path templates on multiple request fields. + # + # NB: note that here there is no way to specify sending nothing if one of the + # fields does not match its template. E.g. if the `table_name` is in the wrong + # format, the `project_id` will not be sent, but the `routing_id` will be. + # The backend routing code has to be aware of that and be prepared to not + # receive a full complement of keys if it expects multiple. + # + # annotation: + # + # option (google.api.routing) = { + # // The routing needs both `project_id` and `routing_id` + # // (from the `app_profile_id` field) for routing. + # + # routing_parameters { + # field: "table_name" + # path_template: "{project_id=projects/*}/**" + # } + # routing_parameters { + # field: "app_profile_id" + # path_template: "{routing_id=**}" + # } + # }; + # + # result: + # + # x-goog-request-params: + # project_id=projects/proj_foo&routing_id=profiles/prof_qux + # + # Example 8 + # + # Extracting a single routing header key-value pair by matching + # several conflictingly named path templates on several request fields. The + # last template to match "wins" the conflict. + # + # annotation: + # + # option (google.api.routing) = { + # // The `routing_id` can be a project id or a region id depending on + # // the table name format, but only if the `app_profile_id` is not set. + # // If `app_profile_id` is set it should be used instead. + # + # routing_parameters { + # field: "table_name" + # path_template: "{routing_id=projects/*}/**" + # } + # routing_parameters { + # field: "table_name" + # path_template: "{routing_id=regions/*}/**" + # } + # routing_parameters { + # field: "app_profile_id" + # path_template: "{routing_id=**}" + # } + # }; + # + # result: + # + # x-goog-request-params: routing_id=profiles/prof_qux + # + # Example 9 + # + # Bringing it all together. + # + # annotation: + # + # option (google.api.routing) = { + # // For routing both `table_location` and a `routing_id` are needed. + # // + # // table_location can be either an instance id or a region+zone id. + # // + # // For `routing_id`, take the value of `app_profile_id` + # // - If it's in the format `profiles/`, send + # // just the `` part. + # // - If it's any other literal, send it as is. + # // If the `app_profile_id` is empty, and the `table_name` starts with + # // the project_id, send that instead. + # + # routing_parameters { + # field: "table_name" + # path_template: "projects/*/{table_location=instances/*}/tables/*" + # } + # routing_parameters { + # field: "table_name" + # path_template: "{table_location=regions/*/zones/*}/tables/*" + # } + # routing_parameters { + # field: "table_name" + # path_template: "{routing_id=projects/*}/**" + # } + # routing_parameters { + # field: "app_profile_id" + # path_template: "{routing_id=**}" + # } + # routing_parameters { + # field: "app_profile_id" + # path_template: "profiles/{routing_id=*}" + # } + # }; + # + # result: + # + # x-goog-request-params: + # table_location=instances/instance_bar&routing_id=prof_qux + # @!attribute [rw] routing_parameters + # @return [::Array<::Google::Api::RoutingParameter>] + # A collection of Routing Parameter specifications. + # **NOTE:** If multiple Routing Parameters describe the same key + # (via the `path_template` field or via the `field` field when + # `path_template` is not provided), "last one wins" rule + # determines which Parameter gets used. + # See the examples for more details. + class RoutingRule + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # A projection from an input message to the GRPC or REST header. + # @!attribute [rw] field + # @return [::String] + # A request field to extract the header key-value pair from. + # @!attribute [rw] path_template + # @return [::String] + # A pattern matching the key-value field. Optional. + # If not specified, the whole field specified in the `field` field will be + # taken as value, and its name used as key. If specified, it MUST contain + # exactly one named segment (along with any number of unnamed segments) The + # pattern will be matched over the field specified in the `field` field, then + # if the match is successful: + # - the name of the single named segment will be used as a header name, + # - the match value of the segment will be used as a header value; + # if the match is NOT successful, nothing will be sent. + # + # Example: + # + # -- This is a field in the request message + # | that the header value will be extracted from. + # | + # | -- This is the key name in the + # | | routing header. + # V | + # field: "table_name" v + # path_template: "projects/*/{table_location=instances/*}/tables/*" + # ^ ^ + # | | + # In the {} brackets is the pattern that -- | + # specifies what to extract from the | + # field as a value to be sent. | + # | + # The string in the field must match the whole pattern -- + # before brackets, inside brackets, after brackets. + # + # When looking at this specific example, we can see that: + # - A key-value pair with the key `table_location` + # and the value matching `instances/*` should be added + # to the x-goog-request-params routing header. + # - The value is extracted from the request message's `table_name` field + # if it matches the full pattern specified: + # `projects/*/instances/*/tables/*`. + # + # **NB:** If the `path_template` field is not provided, the key name is + # equal to the field name, and the whole field should be sent as a value. + # This makes the pattern for the field and the value functionally equivalent + # to `**`, and the configuration + # + # { + # field: "table_name" + # } + # + # is a functionally equivalent shorthand to: + # + # { + # field: "table_name" + # path_template: "{table_name=**}" + # } + # + # See Example 1 for more details. + class RoutingParameter + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end +end diff --git a/owl-bot-staging/google-cloud-security_center-v2/proto_docs/google/cloud/securitycenter/v2/access.rb b/owl-bot-staging/google-cloud-security_center-v2/proto_docs/google/cloud/securitycenter/v2/access.rb new file mode 100644 index 000000000000..4b452fd07cb2 --- /dev/null +++ b/owl-bot-staging/google-cloud-security_center-v2/proto_docs/google/cloud/securitycenter/v2/access.rb @@ -0,0 +1,120 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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 SecurityCenter + module V2 + # Represents an access event. + # @!attribute [rw] principal_email + # @return [::String] + # Associated email, such as "foo@google.com". + # + # The email address of the authenticated user or a service account acting on + # behalf of a third party principal making the request. For third party + # identity callers, the `principal_subject` field is populated instead of + # this field. For privacy reasons, the principal email address is sometimes + # redacted. For more information, see [Caller identities in audit + # logs](https://cloud.google.com/logging/docs/audit#user-id). + # @!attribute [rw] caller_ip + # @return [::String] + # Caller's IP address, such as "1.1.1.1". + # @!attribute [rw] caller_ip_geo + # @return [::Google::Cloud::SecurityCenter::V2::Geolocation] + # The caller IP's geolocation, which identifies where the call came from. + # @!attribute [rw] user_agent_family + # @return [::String] + # Type of user agent associated with the finding. For example, an operating + # system shell or an embedded or standalone application. + # @!attribute [rw] user_agent + # @return [::String] + # The caller's user agent string associated with the finding. + # @!attribute [rw] service_name + # @return [::String] + # This is the API service that the service account made a call to, e.g. + # "iam.googleapis.com" + # @!attribute [rw] method_name + # @return [::String] + # The method that the service account called, e.g. "SetIamPolicy". + # @!attribute [rw] principal_subject + # @return [::String] + # A string that represents the principal_subject that is associated with the + # identity. Unlike `principal_email`, `principal_subject` supports principals + # that aren't associated with email addresses, such as third party + # principals. For most identities, the format is + # `principal://iam.googleapis.com/{identity pool name}/subject/{subject}`. + # Some GKE identities, such as GKE_WORKLOAD, FREEFORM, and GKE_HUB_WORKLOAD, + # still use the legacy format `serviceAccount:{identity pool + # name}[\\{subject}]`. + # @!attribute [rw] service_account_key_name + # @return [::String] + # The name of the service account key that was used to create or exchange + # credentials when authenticating the service account that made the request. + # This is a scheme-less URI full resource name. For example: + # + # "//iam.googleapis.com/projects/\\{PROJECT_ID}/serviceAccounts/\\{ACCOUNT}/keys/\\{key}". + # @!attribute [rw] service_account_delegation_info + # @return [::Array<::Google::Cloud::SecurityCenter::V2::ServiceAccountDelegationInfo>] + # The identity delegation history of an authenticated service account that + # made the request. The `serviceAccountDelegationInfo[]` object contains + # information about the real authorities that try to access Google Cloud + # resources by delegating on a service account. When multiple authorities are + # present, they are guaranteed to be sorted based on the original ordering of + # the identity delegation events. + # @!attribute [rw] user_name + # @return [::String] + # A string that represents a username. The username provided depends on the + # type of the finding and is likely not an IAM principal. For example, this + # can be a system username if the finding is related to a virtual machine, or + # it can be an application login username. + class Access + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Identity delegation history of an authenticated service account. + # @!attribute [rw] principal_email + # @return [::String] + # The email address of a Google account. + # @!attribute [rw] principal_subject + # @return [::String] + # A string representing the principal_subject associated with the identity. + # As compared to `principal_email`, supports principals that aren't + # associated with email addresses, such as third party principals. For most + # identities, the format will be `principal://iam.googleapis.com/{identity + # pool name}/subjects/\\{subject}` except for some GKE identities + # (GKE_WORKLOAD, FREEFORM, GKE_HUB_WORKLOAD) that are still in the legacy + # format `serviceAccount:{identity pool name}[{subject}]` + class ServiceAccountDelegationInfo + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Represents a geographical location for a given access. + # @!attribute [rw] region_code + # @return [::String] + # A CLDR. + class Geolocation + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-security_center-v2/proto_docs/google/cloud/securitycenter/v2/affected_resources.rb b/owl-bot-staging/google-cloud-security_center-v2/proto_docs/google/cloud/securitycenter/v2/affected_resources.rb new file mode 100644 index 000000000000..22a4e9fe9934 --- /dev/null +++ b/owl-bot-staging/google-cloud-security_center-v2/proto_docs/google/cloud/securitycenter/v2/affected_resources.rb @@ -0,0 +1,35 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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 SecurityCenter + module V2 + # Details about resources affected by this finding. + # @!attribute [rw] count + # @return [::Integer] + # The count of resources affected by the finding. + class AffectedResources + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-security_center-v2/proto_docs/google/cloud/securitycenter/v2/ai_model.rb b/owl-bot-staging/google-cloud-security_center-v2/proto_docs/google/cloud/securitycenter/v2/ai_model.rb new file mode 100644 index 000000000000..fe0106b68b6d --- /dev/null +++ b/owl-bot-staging/google-cloud-security_center-v2/proto_docs/google/cloud/securitycenter/v2/ai_model.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 Cloud + module SecurityCenter + module V2 + # Contains information about the AI model associated with the finding. + # @!attribute [rw] name + # @return [::String] + # The name of the AI model, for example, "gemini:1.0.0". + # @!attribute [rw] domain + # @return [::String] + # The domain of the model, for example, “image-classification”. + # @!attribute [rw] library + # @return [::String] + # The name of the model library, for example, “transformers”. + # @!attribute [rw] location + # @return [::String] + # The region in which the model is used, for example, “us-central1”. + # @!attribute [rw] publisher + # @return [::String] + # The publisher of the model, for example, “google” or “nvidia”. + # @!attribute [rw] deployment_platform + # @return [::Google::Cloud::SecurityCenter::V2::AiModel::DeploymentPlatform] + # The platform on which the model is deployed. + # @!attribute [rw] display_name + # @return [::String] + # The user defined display name of model. Ex. baseline-classification-model + class AiModel + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # The platform on which the model is deployed. + module DeploymentPlatform + # Unspecified deployment platform. + DEPLOYMENT_PLATFORM_UNSPECIFIED = 0 + + # Vertex AI. + VERTEX_AI = 1 + + # Google Kubernetes Engine. + GKE = 2 + + # Google Compute Engine. + GCE = 3 + + # Fine tuned model. + FINE_TUNED_MODEL = 4 + end + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-security_center-v2/proto_docs/google/cloud/securitycenter/v2/application.rb b/owl-bot-staging/google-cloud-security_center-v2/proto_docs/google/cloud/securitycenter/v2/application.rb new file mode 100644 index 000000000000..4c1fa3fef09b --- /dev/null +++ b/owl-bot-staging/google-cloud-security_center-v2/proto_docs/google/cloud/securitycenter/v2/application.rb @@ -0,0 +1,40 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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 SecurityCenter + module V2 + # Represents an application associated with a finding. + # @!attribute [rw] base_uri + # @return [::String] + # The base URI that identifies the network location of the application in + # which the vulnerability was detected. For example, `http://example.com`. + # @!attribute [rw] full_uri + # @return [::String] + # The full URI with payload that could be used to reproduce the + # vulnerability. For example, `http://example.com?p=aMmYgI6H`. + class Application + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-security_center-v2/proto_docs/google/cloud/securitycenter/v2/attack_exposure.rb b/owl-bot-staging/google-cloud-security_center-v2/proto_docs/google/cloud/securitycenter/v2/attack_exposure.rb new file mode 100644 index 000000000000..d3543aea2fa0 --- /dev/null +++ b/owl-bot-staging/google-cloud-security_center-v2/proto_docs/google/cloud/securitycenter/v2/attack_exposure.rb @@ -0,0 +1,73 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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 SecurityCenter + module V2 + # An attack exposure contains the results of an attack path simulation run. + # @!attribute [rw] score + # @return [::Float] + # A number between 0 (inclusive) and infinity that represents how important + # this finding is to remediate. The higher the score, the more important it + # is to remediate. + # @!attribute [rw] latest_calculation_time + # @return [::Google::Protobuf::Timestamp] + # The most recent time the attack exposure was updated on this finding. + # @!attribute [rw] attack_exposure_result + # @return [::String] + # The resource name of the attack path simulation result that contains the + # details regarding this attack exposure score. + # Example: `organizations/123/simulations/456/attackExposureResults/789` + # @!attribute [r] state + # @return [::Google::Cloud::SecurityCenter::V2::AttackExposure::State] + # Output only. What state this AttackExposure is in. This captures whether or + # not an attack exposure has been calculated or not. + # @!attribute [rw] exposed_high_value_resources_count + # @return [::Integer] + # The number of high value resources that are exposed as a result of this + # finding. + # @!attribute [rw] exposed_medium_value_resources_count + # @return [::Integer] + # The number of medium value resources that are exposed as a result of this + # finding. + # @!attribute [rw] exposed_low_value_resources_count + # @return [::Integer] + # The number of high value resources that are exposed as a result of this + # finding. + class AttackExposure + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # This enum defines the various states an AttackExposure can be in. + module State + # The state is not specified. + STATE_UNSPECIFIED = 0 + + # The attack exposure has been calculated. + CALCULATED = 1 + + # The attack exposure has not been calculated. + NOT_CALCULATED = 2 + end + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-security_center-v2/proto_docs/google/cloud/securitycenter/v2/attack_path.rb b/owl-bot-staging/google-cloud-security_center-v2/proto_docs/google/cloud/securitycenter/v2/attack_path.rb new file mode 100644 index 000000000000..395034b6cbf5 --- /dev/null +++ b/owl-bot-staging/google-cloud-security_center-v2/proto_docs/google/cloud/securitycenter/v2/attack_path.rb @@ -0,0 +1,147 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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 SecurityCenter + module V2 + # A path that an attacker could take to reach an exposed resource. + # @!attribute [rw] name + # @return [::String] + # The attack path name, for example, + # `organizations/12/simulations/34/valuedResources/56/attackPaths/78` + # @!attribute [rw] path_nodes + # @return [::Array<::Google::Cloud::SecurityCenter::V2::AttackPath::AttackPathNode>] + # A list of nodes that exist in this attack path. + # @!attribute [rw] edges + # @return [::Array<::Google::Cloud::SecurityCenter::V2::AttackPath::AttackPathEdge>] + # A list of the edges between nodes in this attack path. + class AttackPath + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # Represents one point that an attacker passes through in this attack path. + # @!attribute [rw] resource + # @return [::String] + # The name of the resource at this point in the attack path. + # The format of the name follows the Cloud Asset Inventory [resource + # name + # format](https://cloud.google.com/asset-inventory/docs/resource-name-format) + # @!attribute [rw] resource_type + # @return [::String] + # The [supported resource + # type](https://cloud.google.com/asset-inventory/docs/supported-asset-types) + # @!attribute [rw] display_name + # @return [::String] + # Human-readable name of this resource. + # @!attribute [rw] associated_findings + # @return [::Array<::Google::Cloud::SecurityCenter::V2::AttackPath::AttackPathNode::PathNodeAssociatedFinding>] + # The findings associated with this node in the attack path. + # @!attribute [rw] uuid + # @return [::String] + # Unique id of the attack path node. + # @!attribute [rw] attack_steps + # @return [::Array<::Google::Cloud::SecurityCenter::V2::AttackPath::AttackPathNode::AttackStepNode>] + # A list of attack step nodes that exist in this attack path node. + class AttackPathNode + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # A finding that is associated with this node in the attack path. + # @!attribute [rw] canonical_finding + # @return [::String] + # Canonical name of the associated findings. Example: + # `organizations/123/sources/456/findings/789` + # @!attribute [rw] finding_category + # @return [::String] + # The additional taxonomy group within findings from a given source. + # @!attribute [rw] name + # @return [::String] + # Full resource name of the finding. + class PathNodeAssociatedFinding + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Detailed steps the attack can take between path nodes. + # @!attribute [rw] uuid + # @return [::String] + # Unique ID for one Node + # @!attribute [rw] type + # @return [::Google::Cloud::SecurityCenter::V2::AttackPath::AttackPathNode::NodeType] + # Attack step type. Can be either AND, OR or DEFENSE + # @!attribute [rw] display_name + # @return [::String] + # User friendly name of the attack step + # @!attribute [rw] labels + # @return [::Google::Protobuf::Map{::String => ::String}] + # Attack step labels for metadata + # @!attribute [rw] description + # @return [::String] + # Attack step description + class AttackStepNode + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # @!attribute [rw] key + # @return [::String] + # @!attribute [rw] value + # @return [::String] + class LabelsEntry + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end + + # The type of the incoming attack step node. + module NodeType + # Type not specified + NODE_TYPE_UNSPECIFIED = 0 + + # Incoming edge joined with AND + NODE_TYPE_AND = 1 + + # Incoming edge joined with OR + NODE_TYPE_OR = 2 + + # Incoming edge is defense + NODE_TYPE_DEFENSE = 3 + + # Incoming edge is attacker + NODE_TYPE_ATTACKER = 4 + end + end + + # Represents a connection between a source node and a destination node in + # this attack path. + # @!attribute [rw] source + # @return [::String] + # The attack node uuid of the source node. + # @!attribute [rw] destination + # @return [::String] + # The attack node uuid of the destination node. + class AttackPathEdge + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-security_center-v2/proto_docs/google/cloud/securitycenter/v2/backup_disaster_recovery.rb b/owl-bot-staging/google-cloud-security_center-v2/proto_docs/google/cloud/securitycenter/v2/backup_disaster_recovery.rb new file mode 100644 index 000000000000..b49d6ad06453 --- /dev/null +++ b/owl-bot-staging/google-cloud-security_center-v2/proto_docs/google/cloud/securitycenter/v2/backup_disaster_recovery.rb @@ -0,0 +1,90 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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 SecurityCenter + module V2 + # Information related to Google Cloud Backup and DR Service findings. + # @!attribute [rw] backup_template + # @return [::String] + # The name of a Backup and DR template which comprises one or more backup + # policies. See the [Backup and DR + # documentation](https://cloud.google.com/backup-disaster-recovery/docs/concepts/backup-plan#temp) + # for more information. For example, `snap-ov`. + # @!attribute [rw] policies + # @return [::Array<::String>] + # The names of Backup and DR policies that are associated with a template + # and that define when to run a backup, how frequently to run a backup, and + # how long to retain the backup image. For example, `onvaults`. + # @!attribute [rw] host + # @return [::String] + # The name of a Backup and DR host, which is managed by the backup and + # recovery appliance and known to the management console. The host can be of + # type Generic (for example, Compute Engine, SQL Server, Oracle DB, SMB file + # system, etc.), vCenter, or an ESX server. See the [Backup and DR + # documentation on + # hosts](https://cloud.google.com/backup-disaster-recovery/docs/configuration/manage-hosts-and-their-applications) + # for more information. For example, `centos7-01`. + # @!attribute [rw] applications + # @return [::Array<::String>] + # The names of Backup and DR applications. An application is a VM, database, + # or file system on a managed host monitored by a backup and recovery + # appliance. For example, `centos7-01-vol00`, `centos7-01-vol01`, + # `centos7-01-vol02`. + # @!attribute [rw] storage_pool + # @return [::String] + # The name of the Backup and DR storage pool that the backup and recovery + # appliance is storing data in. The storage pool could be of type Cloud, + # Primary, Snapshot, or OnVault. See the [Backup and DR documentation on + # storage + # pools](https://cloud.google.com/backup-disaster-recovery/docs/concepts/storage-pools). + # For example, `DiskPoolOne`. + # @!attribute [rw] policy_options + # @return [::Array<::String>] + # The names of Backup and DR advanced policy options of a policy applying to + # an application. See the [Backup and DR documentation on policy + # options](https://cloud.google.com/backup-disaster-recovery/docs/create-plan/policy-settings). + # For example, `skipofflineappsincongrp, nounmap`. + # @!attribute [rw] profile + # @return [::String] + # The name of the Backup and DR resource profile that specifies the storage + # media for backups of application and VM data. See the [Backup and DR + # documentation on + # profiles](https://cloud.google.com/backup-disaster-recovery/docs/concepts/backup-plan#profile). + # For example, `GCP`. + # @!attribute [rw] appliance + # @return [::String] + # The name of the Backup and DR appliance that captures, moves, and manages + # the lifecycle of backup data. For example, `backup-server-57137`. + # @!attribute [rw] backup_type + # @return [::String] + # The backup type of the Backup and DR image. + # For example, `Snapshot`, `Remote Snapshot`, `OnVault`. + # @!attribute [rw] backup_create_time + # @return [::Google::Protobuf::Timestamp] + # The timestamp at which the Backup and DR backup was created. + class BackupDisasterRecovery + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-security_center-v2/proto_docs/google/cloud/securitycenter/v2/bigquery_export.rb b/owl-bot-staging/google-cloud-security_center-v2/proto_docs/google/cloud/securitycenter/v2/bigquery_export.rb new file mode 100644 index 000000000000..09155c2a96e1 --- /dev/null +++ b/owl-bot-staging/google-cloud-security_center-v2/proto_docs/google/cloud/securitycenter/v2/bigquery_export.rb @@ -0,0 +1,96 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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 SecurityCenter + module V2 + # Configures how to deliver Findings to BigQuery Instance. + # @!attribute [rw] name + # @return [::String] + # Identifier. The relative resource name of this export. See: + # https://cloud.google.com/apis/design/resource_names#relative_resource_name. + # The following list shows some examples: + # + # + + # `organizations/{organization_id}/locations/{location_id}/bigQueryExports/{export_id}` + # + `folders/{folder_id}/locations/{location_id}/bigQueryExports/{export_id}` + # + + # `projects/{project_id}/locations/{location_id}/bigQueryExports/{export_id}` + # + # This field is provided in responses, and is ignored when provided in create + # requests. + # @!attribute [rw] description + # @return [::String] + # The description of the export (max of 1024 characters). + # @!attribute [rw] filter + # @return [::String] + # Expression that defines the filter to apply across create/update events + # of findings. The expression is a list of zero or more restrictions combined + # via logical operators `AND` and `OR`. Parentheses are supported, and `OR` + # has higher precedence than `AND`. + # + # Restrictions have the form ` ` and may have a + # `-` character in front of them to indicate negation. The fields map to + # those defined in the corresponding resource. + # + # The supported operators are: + # + # * `=` for all value types. + # * `>`, `<`, `>=`, `<=` for integer values. + # * `:`, meaning substring matching, for strings. + # + # The supported value types are: + # + # * string literals in quotes. + # * integer literals without quotes. + # * boolean literals `true` and `false` without quotes. + # @!attribute [rw] dataset + # @return [::String] + # The dataset to write findings' updates to. Its format is + # "projects/[project_id]/datasets/[bigquery_dataset_id]". + # BigQuery dataset unique ID must contain only letters (a-z, A-Z), numbers + # (0-9), or underscores (_). + # @!attribute [r] create_time + # @return [::Google::Protobuf::Timestamp] + # Output only. The time at which the BigQuery export was created. + # This field is set by the server and will be ignored if provided on export + # on creation. + # @!attribute [r] update_time + # @return [::Google::Protobuf::Timestamp] + # Output only. The most recent time at which the BigQuery export was updated. + # This field is set by the server and will be ignored if provided on export + # creation or update. + # @!attribute [r] most_recent_editor + # @return [::String] + # Output only. Email address of the user who last edited the BigQuery export. + # This field is set by the server and will be ignored if provided on export + # creation or update. + # @!attribute [r] principal + # @return [::String] + # Output only. The service account that needs permission to create table and + # upload data to the BigQuery dataset. + class BigQueryExport + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-security_center-v2/proto_docs/google/cloud/securitycenter/v2/chokepoint.rb b/owl-bot-staging/google-cloud-security_center-v2/proto_docs/google/cloud/securitycenter/v2/chokepoint.rb new file mode 100644 index 000000000000..4ac87a98cfbd --- /dev/null +++ b/owl-bot-staging/google-cloud-security_center-v2/proto_docs/google/cloud/securitycenter/v2/chokepoint.rb @@ -0,0 +1,39 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + + +module Google + module Cloud + module SecurityCenter + module V2 + # Contains details about a chokepoint, which is a resource or resource group + # where high-risk attack paths converge, based on [attack path simulations] + # (https://cloud.google.com/security-command-center/docs/attack-exposure-learn#attack_path_simulations). + # @!attribute [rw] related_findings + # @return [::Array<::String>] + # List of resource names of findings associated with this chokepoint. + # For example, organizations/123/sources/456/findings/789. + # This list will have at most 100 findings. + class Chokepoint + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-security_center-v2/proto_docs/google/cloud/securitycenter/v2/cloud_armor.rb b/owl-bot-staging/google-cloud-security_center-v2/proto_docs/google/cloud/securitycenter/v2/cloud_armor.rb new file mode 100644 index 000000000000..de5568f900ac --- /dev/null +++ b/owl-bot-staging/google-cloud-security_center-v2/proto_docs/google/cloud/securitycenter/v2/cloud_armor.rb @@ -0,0 +1,138 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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 SecurityCenter + module V2 + # Fields related to Google Cloud Armor findings. + # @!attribute [rw] security_policy + # @return [::Google::Cloud::SecurityCenter::V2::SecurityPolicy] + # Information about the [Google Cloud Armor security + # policy](https://cloud.google.com/armor/docs/security-policy-overview) + # relevant to the finding. + # @!attribute [rw] requests + # @return [::Google::Cloud::SecurityCenter::V2::Requests] + # Information about incoming requests evaluated by [Google Cloud Armor + # security + # policies](https://cloud.google.com/armor/docs/security-policy-overview). + # @!attribute [rw] adaptive_protection + # @return [::Google::Cloud::SecurityCenter::V2::AdaptiveProtection] + # Information about potential Layer 7 DDoS attacks identified by [Google + # Cloud Armor Adaptive + # Protection](https://cloud.google.com/armor/docs/adaptive-protection-overview). + # @!attribute [rw] attack + # @return [::Google::Cloud::SecurityCenter::V2::Attack] + # Information about DDoS attack volume and classification. + # @!attribute [rw] threat_vector + # @return [::String] + # Distinguish between volumetric & protocol DDoS attack and + # application layer attacks. For example, "L3_4" for Layer 3 and Layer 4 DDoS + # attacks, or "L_7" for Layer 7 DDoS attacks. + # @!attribute [rw] duration + # @return [::Google::Protobuf::Duration] + # Duration of attack from the start until the current moment (updated every 5 + # minutes). + class CloudArmor + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Information about the [Google Cloud Armor security + # policy](https://cloud.google.com/armor/docs/security-policy-overview) + # relevant to the finding. + # @!attribute [rw] name + # @return [::String] + # The name of the Google Cloud Armor security policy, for example, + # "my-security-policy". + # @!attribute [rw] type + # @return [::String] + # The type of Google Cloud Armor security policy for example, 'backend + # security policy', 'edge security policy', 'network edge security policy', + # or 'always-on DDoS protection'. + # @!attribute [rw] preview + # @return [::Boolean] + # Whether or not the associated rule or policy is in preview mode. + class SecurityPolicy + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Information about the requests relevant to the finding. + # @!attribute [rw] ratio + # @return [::Float] + # For 'Increasing deny ratio', the ratio is the denied traffic divided by the + # allowed traffic. For 'Allowed traffic spike', the ratio is the allowed + # traffic in the short term divided by allowed traffic in the long term. + # @!attribute [rw] short_term_allowed + # @return [::Integer] + # Allowed RPS (requests per second) in the short term. + # @!attribute [rw] long_term_allowed + # @return [::Integer] + # Allowed RPS (requests per second) over the long term. + # @!attribute [rw] long_term_denied + # @return [::Integer] + # Denied RPS (requests per second) over the long term. + class Requests + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Information about [Google Cloud Armor Adaptive + # Protection](https://cloud.google.com/armor/docs/cloud-armor-overview#google-cloud-armor-adaptive-protection). + # @!attribute [rw] confidence + # @return [::Float] + # A score of 0 means that there is low confidence that the detected event is + # an actual attack. A score of 1 means that there is high confidence that the + # detected event is an attack. See the [Adaptive Protection + # documentation](https://cloud.google.com/armor/docs/adaptive-protection-overview#configure-alert-tuning) + # for further explanation. + class AdaptiveProtection + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Information about DDoS attack volume and classification. + # @!attribute [rw] volume_pps_long + # @return [::Integer] + # Total PPS (packets per second) volume of attack. + # @!attribute [rw] volume_bps_long + # @return [::Integer] + # Total BPS (bytes per second) volume of attack. + # @!attribute [rw] classification + # @return [::String] + # Type of attack, for example, 'SYN-flood', 'NTP-udp', or 'CHARGEN-udp'. + # @!attribute [rw] volume_pps + # @deprecated This field is deprecated and may be removed in the next major version update. + # @return [::Integer] + # Total PPS (packets per second) volume of attack. Deprecated - refer to + # volume_pps_long instead. + # @!attribute [rw] volume_bps + # @deprecated This field is deprecated and may be removed in the next major version update. + # @return [::Integer] + # Total BPS (bytes per second) volume of attack. Deprecated - refer to + # volume_bps_long instead. + class Attack + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-security_center-v2/proto_docs/google/cloud/securitycenter/v2/cloud_dlp_data_profile.rb b/owl-bot-staging/google-cloud-security_center-v2/proto_docs/google/cloud/securitycenter/v2/cloud_dlp_data_profile.rb new file mode 100644 index 000000000000..346e66b5e35d --- /dev/null +++ b/owl-bot-staging/google-cloud-security_center-v2/proto_docs/google/cloud/securitycenter/v2/cloud_dlp_data_profile.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! + + +module Google + module Cloud + module SecurityCenter + module V2 + # The [data profile](https://cloud.google.com/dlp/docs/data-profiles) + # associated with the finding. + # @!attribute [rw] data_profile + # @return [::String] + # Name of the data profile, for example, + # `projects/123/locations/europe/tableProfiles/8383929`. + # @!attribute [rw] parent_type + # @return [::Google::Cloud::SecurityCenter::V2::CloudDlpDataProfile::ParentType] + # The resource hierarchy level at which the data profile was generated. + class CloudDlpDataProfile + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # Parents for configurations that produce data profile findings. + module ParentType + # Unspecified parent type. + PARENT_TYPE_UNSPECIFIED = 0 + + # Organization-level configurations. + ORGANIZATION = 1 + + # Project-level configurations. + PROJECT = 2 + end + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-security_center-v2/proto_docs/google/cloud/securitycenter/v2/cloud_dlp_inspection.rb b/owl-bot-staging/google-cloud-security_center-v2/proto_docs/google/cloud/securitycenter/v2/cloud_dlp_inspection.rb new file mode 100644 index 000000000000..123bea548585 --- /dev/null +++ b/owl-bot-staging/google-cloud-security_center-v2/proto_docs/google/cloud/securitycenter/v2/cloud_dlp_inspection.rb @@ -0,0 +1,50 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + + +module Google + module Cloud + module SecurityCenter + module V2 + # Details about the Cloud Data Loss Prevention (Cloud DLP) [inspection + # job](https://cloud.google.com/dlp/docs/concepts-job-triggers) that produced + # the finding. + # @!attribute [rw] inspect_job + # @return [::String] + # Name of the inspection job, for example, + # `projects/123/locations/europe/dlpJobs/i-8383929`. + # @!attribute [rw] info_type + # @return [::String] + # The type of information (or + # *[infoType](https://cloud.google.com/dlp/docs/infotypes-reference)*) found, + # for example, `EMAIL_ADDRESS` or `STREET_ADDRESS`. + # @!attribute [rw] info_type_count + # @return [::Integer] + # The number of times Cloud DLP found this infoType within this job + # and resource. + # @!attribute [rw] full_scan + # @return [::Boolean] + # Whether Cloud DLP scanned the complete resource or a sampled subset. + class CloudDlpInspection + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-security_center-v2/proto_docs/google/cloud/securitycenter/v2/compliance.rb b/owl-bot-staging/google-cloud-security_center-v2/proto_docs/google/cloud/securitycenter/v2/compliance.rb new file mode 100644 index 000000000000..01a4fe458c2d --- /dev/null +++ b/owl-bot-staging/google-cloud-security_center-v2/proto_docs/google/cloud/securitycenter/v2/compliance.rb @@ -0,0 +1,43 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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 SecurityCenter + module V2 + # Contains compliance information about a security standard indicating unmet + # recommendations. + # @!attribute [rw] standard + # @return [::String] + # Industry-wide compliance standards or benchmarks, such as CIS, PCI, and + # OWASP. + # @!attribute [rw] version + # @return [::String] + # Version of the standard or benchmark, for example, 1.1 + # @!attribute [rw] ids + # @return [::Array<::String>] + # Policies within the standard or benchmark, for example, A.12.4.1 + class Compliance + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-security_center-v2/proto_docs/google/cloud/securitycenter/v2/connection.rb b/owl-bot-staging/google-cloud-security_center-v2/proto_docs/google/cloud/securitycenter/v2/connection.rb new file mode 100644 index 000000000000..6e6ae87bd5c1 --- /dev/null +++ b/owl-bot-staging/google-cloud-security_center-v2/proto_docs/google/cloud/securitycenter/v2/connection.rb @@ -0,0 +1,70 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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 SecurityCenter + module V2 + # Contains information about the IP connection associated with the finding. + # @!attribute [rw] destination_ip + # @return [::String] + # Destination IP address. Not present for sockets that are listening and not + # connected. + # @!attribute [rw] destination_port + # @return [::Integer] + # Destination port. Not present for sockets that are listening and not + # connected. + # @!attribute [rw] source_ip + # @return [::String] + # Source IP address. + # @!attribute [rw] source_port + # @return [::Integer] + # Source port. + # @!attribute [rw] protocol + # @return [::Google::Cloud::SecurityCenter::V2::Connection::Protocol] + # IANA Internet Protocol Number such as TCP(6) and UDP(17). + class Connection + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # IANA Internet Protocol Number such as TCP(6) and UDP(17). + module Protocol + # Unspecified protocol (not HOPOPT). + PROTOCOL_UNSPECIFIED = 0 + + # Internet Control Message Protocol. + ICMP = 1 + + # Transmission Control Protocol. + TCP = 6 + + # User Datagram Protocol. + UDP = 17 + + # Generic Routing Encapsulation. + GRE = 47 + + # Encap Security Payload. + ESP = 50 + end + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-security_center-v2/proto_docs/google/cloud/securitycenter/v2/contact_details.rb b/owl-bot-staging/google-cloud-security_center-v2/proto_docs/google/cloud/securitycenter/v2/contact_details.rb new file mode 100644 index 000000000000..70a23d045d97 --- /dev/null +++ b/owl-bot-staging/google-cloud-security_center-v2/proto_docs/google/cloud/securitycenter/v2/contact_details.rb @@ -0,0 +1,44 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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 SecurityCenter + module V2 + # Details about specific contacts + # @!attribute [rw] contacts + # @return [::Array<::Google::Cloud::SecurityCenter::V2::Contact>] + # A list of contacts + class ContactDetails + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # The email address of a contact. + # @!attribute [rw] email + # @return [::String] + # An email address. For example, "`person123@company.com`". + class Contact + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-security_center-v2/proto_docs/google/cloud/securitycenter/v2/container.rb b/owl-bot-staging/google-cloud-security_center-v2/proto_docs/google/cloud/securitycenter/v2/container.rb new file mode 100644 index 000000000000..5fd4972d8657 --- /dev/null +++ b/owl-bot-staging/google-cloud-security_center-v2/proto_docs/google/cloud/securitycenter/v2/container.rb @@ -0,0 +1,49 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + + +module Google + module Cloud + module SecurityCenter + module V2 + # Container associated with the finding. + # @!attribute [rw] name + # @return [::String] + # Name of the container. + # @!attribute [rw] uri + # @return [::String] + # Container image URI provided when configuring a pod or container. This + # string can identify a container image version using mutable tags. + # @!attribute [rw] image_id + # @return [::String] + # Optional container image ID, if provided by the container runtime. Uniquely + # identifies the container image launched using a container image digest. + # @!attribute [rw] labels + # @return [::Array<::Google::Cloud::SecurityCenter::V2::Label>] + # Container labels, as provided by the container runtime. + # @!attribute [rw] create_time + # @return [::Google::Protobuf::Timestamp] + # The time that the container was created. + class Container + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-security_center-v2/proto_docs/google/cloud/securitycenter/v2/data_access_event.rb b/owl-bot-staging/google-cloud-security_center-v2/proto_docs/google/cloud/securitycenter/v2/data_access_event.rb new file mode 100644 index 000000000000..35c543064430 --- /dev/null +++ b/owl-bot-staging/google-cloud-security_center-v2/proto_docs/google/cloud/securitycenter/v2/data_access_event.rb @@ -0,0 +1,61 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + + +module Google + module Cloud + module SecurityCenter + module V2 + # Details about a data access attempt made by a principal not authorized under + # applicable data security policy. + # @!attribute [rw] event_id + # @return [::String] + # Unique identifier for data access event. + # @!attribute [rw] principal_email + # @return [::String] + # The email address of the principal that accessed the data. The principal + # could be a user account, service account, Google group, or other. + # @!attribute [rw] operation + # @return [::Google::Cloud::SecurityCenter::V2::DataAccessEvent::Operation] + # The operation performed by the principal to access the data. + # @!attribute [rw] event_time + # @return [::Google::Protobuf::Timestamp] + # Timestamp of data access event. + class DataAccessEvent + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # The operation of a data access event. + module Operation + # The operation is unspecified. + OPERATION_UNSPECIFIED = 0 + + # Represents a read operation. + READ = 1 + + # Represents a move operation. + MOVE = 2 + + # Represents a copy operation. + COPY = 3 + end + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-security_center-v2/proto_docs/google/cloud/securitycenter/v2/data_flow_event.rb b/owl-bot-staging/google-cloud-security_center-v2/proto_docs/google/cloud/securitycenter/v2/data_flow_event.rb new file mode 100644 index 000000000000..ae25f8a2cff3 --- /dev/null +++ b/owl-bot-staging/google-cloud-security_center-v2/proto_docs/google/cloud/securitycenter/v2/data_flow_event.rb @@ -0,0 +1,65 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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 SecurityCenter + module V2 + # Details about a data flow event, in which either the data is moved to or is + # accessed from a non-compliant geo-location, as defined in the applicable data + # security policy. + # @!attribute [rw] event_id + # @return [::String] + # Unique identifier for data flow event. + # @!attribute [rw] principal_email + # @return [::String] + # The email address of the principal that initiated the data flow event. The + # principal could be a user account, service account, Google group, or other. + # @!attribute [rw] operation + # @return [::Google::Cloud::SecurityCenter::V2::DataFlowEvent::Operation] + # The operation performed by the principal for the data flow event. + # @!attribute [rw] violated_location + # @return [::String] + # Non-compliant location of the principal or the data destination. + # @!attribute [rw] event_time + # @return [::Google::Protobuf::Timestamp] + # Timestamp of data flow event. + class DataFlowEvent + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # The operation of a data flow event. + module Operation + # The operation is unspecified. + OPERATION_UNSPECIFIED = 0 + + # Represents a read operation. + READ = 1 + + # Represents a move operation. + MOVE = 2 + + # Represents a copy operation. + COPY = 3 + end + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-security_center-v2/proto_docs/google/cloud/securitycenter/v2/data_retention_deletion_event.rb b/owl-bot-staging/google-cloud-security_center-v2/proto_docs/google/cloud/securitycenter/v2/data_retention_deletion_event.rb new file mode 100644 index 000000000000..978743068cc9 --- /dev/null +++ b/owl-bot-staging/google-cloud-security_center-v2/proto_docs/google/cloud/securitycenter/v2/data_retention_deletion_event.rb @@ -0,0 +1,69 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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 SecurityCenter + module V2 + # Details about data retention deletion violations, in which the data is + # non-compliant based on their retention or deletion time, as defined in the + # applicable data security policy. The Data Retention Deletion (DRD) control is + # a control of the DSPM (Data Security Posture Management) suite that enables + # organizations to manage data retention and deletion policies in compliance + # with regulations, such as GDPR and CRPA. DRD supports two primary policy + # types: maximum storage length (max TTL) and minimum storage length (min TTL). + # Both are aimed at helping organizations meet regulatory and data management + # commitments. + # @!attribute [rw] event_detection_time + # @return [::Google::Protobuf::Timestamp] + # Timestamp indicating when the event was detected. + # @!attribute [rw] data_object_count + # @return [::Integer] + # Number of objects that violated the policy for this resource. If the number + # is less than 1,000, then the value of this field is the exact number. If + # the number of objects that violated the policy is greater than or equal to + # 1,000, then the value of this field is 1000. + # @!attribute [rw] max_retention_allowed + # @return [::Google::Protobuf::Duration] + # Maximum duration of retention allowed from the DRD control. This comes + # from the DRD control where users set a max TTL for their data. For example, + # suppose that a user sets the max TTL for a Cloud Storage bucket to 90 days. + # However, an object in that bucket is 100 days old. In this case, a + # DataRetentionDeletionEvent will be generated for that Cloud Storage bucket, + # and the max_retention_allowed is 90 days. + # @!attribute [rw] event_type + # @return [::Google::Cloud::SecurityCenter::V2::DataRetentionDeletionEvent::EventType] + # Type of the DRD event. + class DataRetentionDeletionEvent + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # Type of the DRD event. + module EventType + # Unspecified event type. + EVENT_TYPE_UNSPECIFIED = 0 + + # The maximum retention time has been exceeded. + EVENT_TYPE_MAX_TTL_EXCEEDED = 1 + end + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-security_center-v2/proto_docs/google/cloud/securitycenter/v2/database.rb b/owl-bot-staging/google-cloud-security_center-v2/proto_docs/google/cloud/securitycenter/v2/database.rb new file mode 100644 index 000000000000..39782b12e5ae --- /dev/null +++ b/owl-bot-staging/google-cloud-security_center-v2/proto_docs/google/cloud/securitycenter/v2/database.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 Cloud + module SecurityCenter + module V2 + # Represents database access information, such as queries. A database may be a + # sub-resource of an instance (as in the case of Cloud SQL instances or Cloud + # Spanner instances), or the database instance itself. Some database resources + # might not have the [full resource + # name](https://google.aip.dev/122#full-resource-names) populated because these + # resource types, such as Cloud SQL databases, are not yet supported by Cloud + # Asset Inventory. In these cases only the display name is provided. + # @!attribute [rw] name + # @return [::String] + # Some database resources may not have the [full resource + # name](https://google.aip.dev/122#full-resource-names) populated because + # these resource types are not yet supported by Cloud Asset Inventory (e.g. + # Cloud SQL databases). In these cases only the display name will be + # provided. + # The [full resource name](https://google.aip.dev/122#full-resource-names) of + # the database that the user connected to, if it is supported by Cloud Asset + # Inventory. + # @!attribute [rw] display_name + # @return [::String] + # The human-readable name of the database that the user connected to. + # @!attribute [rw] user_name + # @return [::String] + # The username used to connect to the database. The username might not be an + # IAM principal and does not have a set format. + # @!attribute [rw] query + # @return [::String] + # The SQL statement that is associated with the database access. + # @!attribute [rw] grantees + # @return [::Array<::String>] + # The target usernames, roles, or groups of an SQL privilege grant, which is + # not an IAM policy change. + # @!attribute [rw] version + # @return [::String] + # The version of the database, for example, POSTGRES_14. + # See [the complete + # list](https://cloud.google.com/sql/docs/mysql/admin-api/rest/v1/SqlDatabaseVersion). + class Database + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-security_center-v2/proto_docs/google/cloud/securitycenter/v2/disk.rb b/owl-bot-staging/google-cloud-security_center-v2/proto_docs/google/cloud/securitycenter/v2/disk.rb new file mode 100644 index 000000000000..0f63d09304ea --- /dev/null +++ b/owl-bot-staging/google-cloud-security_center-v2/proto_docs/google/cloud/securitycenter/v2/disk.rb @@ -0,0 +1,36 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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 SecurityCenter + module V2 + # Contains information about the disk associated with the finding. + # @!attribute [rw] name + # @return [::String] + # The name of the disk, for example, + # "https://www.googleapis.com/compute/v1/projects/\\{project-id}/zones/\\{zone-id}/disks/\\{disk-id}". + class Disk + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-security_center-v2/proto_docs/google/cloud/securitycenter/v2/exfiltration.rb b/owl-bot-staging/google-cloud-security_center-v2/proto_docs/google/cloud/securitycenter/v2/exfiltration.rb new file mode 100644 index 000000000000..e982b02dfc10 --- /dev/null +++ b/owl-bot-staging/google-cloud-security_center-v2/proto_docs/google/cloud/securitycenter/v2/exfiltration.rb @@ -0,0 +1,64 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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 SecurityCenter + module V2 + # Exfiltration represents a data exfiltration attempt from one or more sources + # to one or more targets. The `sources` attribute lists the sources of the + # exfiltrated data. The `targets` attribute lists the destinations the data was + # copied to. + # @!attribute [rw] sources + # @return [::Array<::Google::Cloud::SecurityCenter::V2::ExfilResource>] + # If there are multiple sources, then the data is considered "joined" between + # them. For instance, BigQuery can join multiple tables, and each + # table would be considered a source. + # @!attribute [rw] targets + # @return [::Array<::Google::Cloud::SecurityCenter::V2::ExfilResource>] + # If there are multiple targets, each target would get a complete copy of the + # "joined" source data. + # @!attribute [rw] total_exfiltrated_bytes + # @return [::Integer] + # Total exfiltrated bytes processed for the entire job. + class Exfiltration + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Resource where data was exfiltrated from or exfiltrated to. + # @!attribute [rw] name + # @return [::String] + # The resource's [full resource + # name](https://cloud.google.com/apis/design/resource_names#full_resource_name). + # @!attribute [rw] components + # @return [::Array<::String>] + # Subcomponents of the asset that was exfiltrated, like URIs used during + # exfiltration, table names, databases, and filenames. For example, multiple + # tables might have been exfiltrated from the same Cloud SQL instance, or + # multiple files might have been exfiltrated from the same Cloud Storage + # bucket. + class ExfilResource + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-security_center-v2/proto_docs/google/cloud/securitycenter/v2/external_system.rb b/owl-bot-staging/google-cloud-security_center-v2/proto_docs/google/cloud/securitycenter/v2/external_system.rb new file mode 100644 index 000000000000..d13da6e40e27 --- /dev/null +++ b/owl-bot-staging/google-cloud-security_center-v2/proto_docs/google/cloud/securitycenter/v2/external_system.rb @@ -0,0 +1,106 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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 SecurityCenter + module V2 + # Representation of third party SIEM/SOAR fields within SCC. + # @!attribute [rw] name + # @return [::String] + # Full resource name of the external system. The following list + # shows some examples: + # + # + `organizations/1234/sources/5678/findings/123456/externalSystems/jira` + # + + # `organizations/1234/sources/5678/locations/us/findings/123456/externalSystems/jira` + # + `folders/1234/sources/5678/findings/123456/externalSystems/jira` + # + + # `folders/1234/sources/5678/locations/us/findings/123456/externalSystems/jira` + # + `projects/1234/sources/5678/findings/123456/externalSystems/jira` + # + + # `projects/1234/sources/5678/locations/us/findings/123456/externalSystems/jira` + # @!attribute [rw] assignees + # @return [::Array<::String>] + # References primary/secondary etc assignees in the external system. + # @!attribute [rw] external_uid + # @return [::String] + # The identifier that's used to track the finding's corresponding case in the + # external system. + # @!attribute [rw] status + # @return [::String] + # The most recent status of the finding's corresponding case, as reported by + # the external system. + # @!attribute [rw] external_system_update_time + # @return [::Google::Protobuf::Timestamp] + # The time when the case was last updated, as reported by the external + # system. + # @!attribute [rw] case_uri + # @return [::String] + # The link to the finding's corresponding case in the external system. + # @!attribute [rw] case_priority + # @return [::String] + # The priority of the finding's corresponding case in the external system. + # @!attribute [rw] case_sla + # @return [::Google::Protobuf::Timestamp] + # The SLA of the finding's corresponding case in the external system. + # @!attribute [rw] case_create_time + # @return [::Google::Protobuf::Timestamp] + # The time when the case was created, as reported by the external system. + # @!attribute [rw] case_close_time + # @return [::Google::Protobuf::Timestamp] + # The time when the case was closed, as reported by the external system. + # @!attribute [rw] ticket_info + # @return [::Google::Cloud::SecurityCenter::V2::ExternalSystem::TicketInfo] + # Information about the ticket, if any, that is being used to track the + # resolution of the issue that is identified by this finding. + class ExternalSystem + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # Information about the ticket, if any, that is being used to track the + # resolution of the issue that is identified by this finding. + # @!attribute [rw] id + # @return [::String] + # The identifier of the ticket in the ticket system. + # @!attribute [rw] assignee + # @return [::String] + # The assignee of the ticket in the ticket system. + # @!attribute [rw] description + # @return [::String] + # The description of the ticket in the ticket system. + # @!attribute [rw] uri + # @return [::String] + # The link to the ticket in the ticket system. + # @!attribute [rw] status + # @return [::String] + # The latest status of the ticket, as reported by the ticket system. + # @!attribute [rw] update_time + # @return [::Google::Protobuf::Timestamp] + # The time when the ticket was last updated, as reported by the ticket + # system. + class TicketInfo + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-security_center-v2/proto_docs/google/cloud/securitycenter/v2/file.rb b/owl-bot-staging/google-cloud-security_center-v2/proto_docs/google/cloud/securitycenter/v2/file.rb new file mode 100644 index 000000000000..fcea377226df --- /dev/null +++ b/owl-bot-staging/google-cloud-security_center-v2/proto_docs/google/cloud/securitycenter/v2/file.rb @@ -0,0 +1,105 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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 SecurityCenter + module V2 + # File information about the related binary/library used by an executable, or + # the script used by a script interpreter + # @!attribute [rw] path + # @return [::String] + # Absolute path of the file as a JSON encoded string. + # @!attribute [rw] size + # @return [::Integer] + # Size of the file in bytes. + # @!attribute [rw] sha256 + # @return [::String] + # SHA256 hash of the first hashed_size bytes of the file encoded as a + # hex string. If hashed_size == size, sha256 represents the SHA256 hash + # of the entire file. + # @!attribute [rw] hashed_size + # @return [::Integer] + # The length in bytes of the file prefix that was hashed. If + # hashed_size == size, any hashes reported represent the entire + # file. + # @!attribute [rw] partially_hashed + # @return [::Boolean] + # True when the hash covers only a prefix of the file. + # @!attribute [rw] contents + # @return [::String] + # Prefix of the file contents as a JSON-encoded string. + # @!attribute [rw] disk_path + # @return [::Google::Cloud::SecurityCenter::V2::File::DiskPath] + # Path of the file in terms of underlying disk/partition identifiers. + # @!attribute [rw] operations + # @return [::Array<::Google::Cloud::SecurityCenter::V2::File::FileOperation>] + # Operation(s) performed on a file. + class File + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # Path of the file in terms of underlying disk/partition identifiers. + # @!attribute [rw] partition_uuid + # @return [::String] + # UUID of the partition (format + # https://wiki.archlinux.org/title/persistent_block_device_naming#by-uuid) + # @!attribute [rw] relative_path + # @return [::String] + # Relative path of the file in the partition as a JSON encoded string. + # Example: /home/user1/executable_file.sh + class DiskPath + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Operation(s) performed on a file. + # @!attribute [rw] type + # @return [::Google::Cloud::SecurityCenter::V2::File::FileOperation::OperationType] + # The type of the operation + class FileOperation + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # The type of the operation + module OperationType + # The operation is unspecified. + OPERATION_TYPE_UNSPECIFIED = 0 + + # Represents an open operation. + OPEN = 1 + + # Represents a read operation. + READ = 2 + + # Represents a rename operation. + RENAME = 3 + + # Represents a write operation. + WRITE = 4 + + # Represents an execute operation. + EXECUTE = 5 + end + end + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-security_center-v2/proto_docs/google/cloud/securitycenter/v2/finding.rb b/owl-bot-staging/google-cloud-security_center-v2/proto_docs/google/cloud/securitycenter/v2/finding.rb new file mode 100644 index 000000000000..b9a79e5e7650 --- /dev/null +++ b/owl-bot-staging/google-cloud-security_center-v2/proto_docs/google/cloud/securitycenter/v2/finding.rb @@ -0,0 +1,524 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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 SecurityCenter + module V2 + # Security Command Center finding. + # + # A finding is a record of assessment data like security, risk, health, or + # privacy, that is ingested into Security Command Center for presentation, + # notification, analysis, policy testing, and enforcement. For example, a + # cross-site scripting (XSS) vulnerability in an App Engine application is a + # finding. + # @!attribute [rw] name + # @return [::String] + # Identifier. The [relative resource + # name](https://cloud.google.com/apis/design/resource_names#relative_resource_name) + # of the finding. The following list shows some examples: + # + # + + # `organizations/{organization_id}/sources/{source_id}/findings/{finding_id}` + # + + # `organizations/{organization_id}/sources/{source_id}/locations/{location_id}/findings/{finding_id}` + # + `folders/{folder_id}/sources/{source_id}/findings/{finding_id}` + # + + # `folders/{folder_id}/sources/{source_id}/locations/{location_id}/findings/{finding_id}` + # + `projects/{project_id}/sources/{source_id}/findings/{finding_id}` + # + + # `projects/{project_id}/sources/{source_id}/locations/{location_id}/findings/{finding_id}` + # @!attribute [r] canonical_name + # @return [::String] + # Output only. The canonical name of the finding. The following list shows + # some examples: + # + # + + # `organizations/{organization_id}/sources/{source_id}/findings/{finding_id}` + # + + # `organizations/{organization_id}/sources/{source_id}/locations/{location_id}/findings/{finding_id}` + # + `folders/{folder_id}/sources/{source_id}/findings/{finding_id}` + # + + # `folders/{folder_id}/sources/{source_id}/locations/{location_id}/findings/{finding_id}` + # + `projects/{project_id}/sources/{source_id}/findings/{finding_id}` + # + + # `projects/{project_id}/sources/{source_id}/locations/{location_id}/findings/{finding_id}` + # + # The prefix is the closest CRM ancestor of the resource associated with the + # finding. + # @!attribute [rw] parent + # @return [::String] + # The relative resource name of the source and location the finding belongs + # to. See: + # https://cloud.google.com/apis/design/resource_names#relative_resource_name + # This field is immutable after creation time. The following list shows some + # examples: + # + # + `organizations/{organization_id}/sources/{source_id}` + # + `folders/{folders_id}/sources/{source_id}` + # + `projects/{projects_id}/sources/{source_id}` + # + + # `organizations/{organization_id}/sources/{source_id}/locations/{location_id}` + # + `folders/{folders_id}/sources/{source_id}/locations/{location_id}` + # + `projects/{projects_id}/sources/{source_id}/locations/{location_id}` + # @!attribute [rw] resource_name + # @return [::String] + # Immutable. For findings on Google Cloud resources, the full resource + # name of the Google Cloud resource this finding is for. See: + # https://cloud.google.com/apis/design/resource_names#full_resource_name + # When the finding is for a non-Google Cloud resource, the resourceName can + # be a customer or partner defined string. + # @!attribute [r] state + # @return [::Google::Cloud::SecurityCenter::V2::Finding::State] + # Output only. The state of the finding. + # @!attribute [rw] category + # @return [::String] + # Immutable. The additional taxonomy group within findings from a given + # source. Example: "XSS_FLASH_INJECTION" + # @!attribute [rw] external_uri + # @return [::String] + # The URI that, if available, points to a web page outside of Security + # Command Center where additional information about the finding can be found. + # This field is guaranteed to be either empty or a well formed URL. + # @!attribute [rw] source_properties + # @return [::Google::Protobuf::Map{::String => ::Google::Protobuf::Value}] + # Source specific properties. These properties are managed by the source + # that writes the finding. The key names in the source_properties map must be + # between 1 and 255 characters, and must start with a letter and contain + # alphanumeric characters or underscores only. + # @!attribute [r] security_marks + # @return [::Google::Cloud::SecurityCenter::V2::SecurityMarks] + # Output only. User specified security marks. These marks are entirely + # managed by the user and come from the SecurityMarks resource that belongs + # to the finding. + # @!attribute [rw] event_time + # @return [::Google::Protobuf::Timestamp] + # The time the finding was first detected. If an existing finding is updated, + # then this is the time the update occurred. + # For example, if the finding represents an open firewall, this property + # captures the time the detector believes the firewall became open. The + # accuracy is determined by the detector. If the finding is later resolved, + # then this time reflects when the finding was resolved. This must not + # be set to a value greater than the current timestamp. + # @!attribute [r] create_time + # @return [::Google::Protobuf::Timestamp] + # Output only. The time at which the finding was created in Security Command + # Center. + # @!attribute [rw] severity + # @return [::Google::Cloud::SecurityCenter::V2::Finding::Severity] + # The severity of the finding. This field is managed by the source that + # writes the finding. + # @!attribute [rw] mute + # @return [::Google::Cloud::SecurityCenter::V2::Finding::Mute] + # Indicates the mute state of a finding (either muted, unmuted + # or undefined). Unlike other attributes of a finding, a finding provider + # shouldn't set the value of mute. + # @!attribute [r] mute_info + # @return [::Google::Cloud::SecurityCenter::V2::Finding::MuteInfo] + # Output only. The mute information regarding this finding. + # @!attribute [rw] finding_class + # @return [::Google::Cloud::SecurityCenter::V2::Finding::FindingClass] + # The class of the finding. + # @!attribute [rw] indicator + # @return [::Google::Cloud::SecurityCenter::V2::Indicator] + # Represents what's commonly known as an *indicator of compromise* (IoC) in + # computer forensics. This is an artifact observed on a network or in an + # operating system that, with high confidence, indicates a computer + # intrusion. For more information, see [Indicator of + # compromise](https://en.wikipedia.org/wiki/Indicator_of_compromise). + # @!attribute [rw] vulnerability + # @return [::Google::Cloud::SecurityCenter::V2::Vulnerability] + # Represents vulnerability-specific fields like CVE and CVSS scores. + # CVE stands for Common Vulnerabilities and Exposures + # (https://cve.mitre.org/about/) + # @!attribute [r] mute_update_time + # @return [::Google::Protobuf::Timestamp] + # Output only. The most recent time this finding was muted or unmuted. + # @!attribute [r] external_systems + # @return [::Google::Protobuf::Map{::String => ::Google::Cloud::SecurityCenter::V2::ExternalSystem}] + # Output only. Third party SIEM/SOAR fields within SCC, contains external + # system information and external system finding fields. + # @!attribute [rw] mitre_attack + # @return [::Google::Cloud::SecurityCenter::V2::MitreAttack] + # MITRE ATT&CK tactics and techniques related to this finding. + # See: https://attack.mitre.org + # @!attribute [rw] access + # @return [::Google::Cloud::SecurityCenter::V2::Access] + # Access details associated with the finding, such as more information on the + # caller, which method was accessed, and from where. + # @!attribute [rw] connections + # @return [::Array<::Google::Cloud::SecurityCenter::V2::Connection>] + # Contains information about the IP connection associated with the finding. + # @!attribute [rw] mute_initiator + # @return [::String] + # Records additional information about the mute operation, for example, the + # [mute + # configuration](https://cloud.google.com/security-command-center/docs/how-to-mute-findings) + # that muted the finding and the user who muted the finding. + # @!attribute [rw] processes + # @return [::Array<::Google::Cloud::SecurityCenter::V2::Process>] + # Represents operating system processes associated with the Finding. + # @!attribute [r] contacts + # @return [::Google::Protobuf::Map{::String => ::Google::Cloud::SecurityCenter::V2::ContactDetails}] + # Output only. Map containing the points of contact for the given finding. + # The key represents the type of contact, while the value contains a list of + # all the contacts that pertain. Please refer to: + # https://cloud.google.com/resource-manager/docs/managing-notification-contacts#notification-categories + # + # { + # "security": { + # "contacts": [ + # { + # "email": "person1@company.com" + # }, + # { + # "email": "person2@company.com" + # } + # ] + # } + # } + # @!attribute [rw] compliances + # @return [::Array<::Google::Cloud::SecurityCenter::V2::Compliance>] + # Contains compliance information for security standards associated to the + # finding. + # @!attribute [r] parent_display_name + # @return [::String] + # Output only. The human readable display name of the finding source such as + # "Event Threat Detection" or "Security Health Analytics". + # @!attribute [rw] description + # @return [::String] + # Contains more details about the finding. + # @!attribute [rw] exfiltration + # @return [::Google::Cloud::SecurityCenter::V2::Exfiltration] + # Represents exfiltrations associated with the finding. + # @!attribute [rw] iam_bindings + # @return [::Array<::Google::Cloud::SecurityCenter::V2::IamBinding>] + # Represents IAM bindings associated with the finding. + # @!attribute [rw] next_steps + # @return [::String] + # Steps to address the finding. + # @!attribute [rw] module_name + # @return [::String] + # Unique identifier of the module which generated the finding. + # Example: + # folders/598186756061/securityHealthAnalyticsSettings/customModules/56799441161885 + # @!attribute [rw] containers + # @return [::Array<::Google::Cloud::SecurityCenter::V2::Container>] + # Containers associated with the finding. This field provides information for + # both Kubernetes and non-Kubernetes containers. + # @!attribute [rw] kubernetes + # @return [::Google::Cloud::SecurityCenter::V2::Kubernetes] + # Kubernetes resources associated with the finding. + # @!attribute [rw] database + # @return [::Google::Cloud::SecurityCenter::V2::Database] + # Database associated with the finding. + # @!attribute [rw] attack_exposure + # @return [::Google::Cloud::SecurityCenter::V2::AttackExposure] + # The results of an attack path simulation relevant to this finding. + # @!attribute [rw] files + # @return [::Array<::Google::Cloud::SecurityCenter::V2::File>] + # File associated with the finding. + # @!attribute [rw] cloud_dlp_inspection + # @return [::Google::Cloud::SecurityCenter::V2::CloudDlpInspection] + # Cloud Data Loss Prevention (Cloud DLP) inspection results that are + # associated with the finding. + # @!attribute [rw] cloud_dlp_data_profile + # @return [::Google::Cloud::SecurityCenter::V2::CloudDlpDataProfile] + # Cloud DLP data profile that is associated with the finding. + # @!attribute [rw] kernel_rootkit + # @return [::Google::Cloud::SecurityCenter::V2::KernelRootkit] + # Signature of the kernel rootkit. + # @!attribute [rw] org_policies + # @return [::Array<::Google::Cloud::SecurityCenter::V2::OrgPolicy>] + # Contains information about the org policies associated with the finding. + # @!attribute [rw] job + # @return [::Google::Cloud::SecurityCenter::V2::Job] + # Job associated with the finding. + # @!attribute [rw] application + # @return [::Google::Cloud::SecurityCenter::V2::Application] + # Represents an application associated with the finding. + # @!attribute [rw] ip_rules + # @return [::Google::Cloud::SecurityCenter::V2::IpRules] + # IP rules associated with the finding. + # @!attribute [rw] backup_disaster_recovery + # @return [::Google::Cloud::SecurityCenter::V2::BackupDisasterRecovery] + # Fields related to Backup and DR findings. + # @!attribute [rw] security_posture + # @return [::Google::Cloud::SecurityCenter::V2::SecurityPosture] + # The security posture associated with the finding. + # @!attribute [rw] log_entries + # @return [::Array<::Google::Cloud::SecurityCenter::V2::LogEntry>] + # Log entries that are relevant to the finding. + # @!attribute [rw] load_balancers + # @return [::Array<::Google::Cloud::SecurityCenter::V2::LoadBalancer>] + # The load balancers associated with the finding. + # @!attribute [rw] cloud_armor + # @return [::Google::Cloud::SecurityCenter::V2::CloudArmor] + # Fields related to Cloud Armor findings. + # @!attribute [rw] notebook + # @return [::Google::Cloud::SecurityCenter::V2::Notebook] + # Notebook associated with the finding. + # @!attribute [rw] toxic_combination + # @return [::Google::Cloud::SecurityCenter::V2::ToxicCombination] + # Contains details about a group of security issues that, when the issues + # occur together, represent a greater risk than when the issues occur + # independently. A group of such issues is referred to as a toxic + # combination. + # This field cannot be updated. Its value is ignored in all update requests. + # @!attribute [rw] group_memberships + # @return [::Array<::Google::Cloud::SecurityCenter::V2::GroupMembership>] + # Contains details about groups of which this finding is a member. A group is + # a collection of findings that are related in some way. + # This field cannot be updated. Its value is ignored in all update requests. + # @!attribute [rw] disk + # @return [::Google::Cloud::SecurityCenter::V2::Disk] + # Disk associated with the finding. + # @!attribute [rw] data_access_events + # @return [::Array<::Google::Cloud::SecurityCenter::V2::DataAccessEvent>] + # Data access events associated with the finding. + # @!attribute [rw] data_flow_events + # @return [::Array<::Google::Cloud::SecurityCenter::V2::DataFlowEvent>] + # Data flow events associated with the finding. + # @!attribute [rw] networks + # @return [::Array<::Google::Cloud::SecurityCenter::V2::Network>] + # Represents the VPC networks that the resource is attached to. + # @!attribute [rw] data_retention_deletion_events + # @return [::Array<::Google::Cloud::SecurityCenter::V2::DataRetentionDeletionEvent>] + # Data retention deletion events associated with the finding. + # @!attribute [rw] affected_resources + # @return [::Google::Cloud::SecurityCenter::V2::AffectedResources] + # AffectedResources associated with the finding. + # @!attribute [rw] ai_model + # @return [::Google::Cloud::SecurityCenter::V2::AiModel] + # The AI model associated with the finding. + # @!attribute [rw] chokepoint + # @return [::Google::Cloud::SecurityCenter::V2::Chokepoint] + # Contains details about a chokepoint, which is a resource or resource group + # where high-risk attack paths converge, based on [attack path simulations] + # (https://cloud.google.com/security-command-center/docs/attack-exposure-learn#attack_path_simulations). + # This field cannot be updated. Its value is ignored in all update requests. + # @!attribute [rw] vertex_ai + # @return [::Google::Cloud::SecurityCenter::V2::VertexAi] + # VertexAi associated with the finding. + class Finding + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # Mute information about the finding, including whether the finding has a + # static mute or any matching dynamic mute rules. + # @!attribute [rw] static_mute + # @return [::Google::Cloud::SecurityCenter::V2::Finding::MuteInfo::StaticMute] + # If set, the static mute applied to this finding. Static mutes override + # dynamic mutes. If unset, there is no static mute. + # @!attribute [rw] dynamic_mute_records + # @return [::Array<::Google::Cloud::SecurityCenter::V2::Finding::MuteInfo::DynamicMuteRecord>] + # The list of dynamic mute rules that currently match the finding. + class MuteInfo + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # Information about the static mute state. A static mute state overrides + # any dynamic mute rules that apply to this finding. The static mute state + # can be set by a static mute rule or by muting the finding directly. + # @!attribute [rw] state + # @return [::Google::Cloud::SecurityCenter::V2::Finding::Mute] + # The static mute state. If the value is `MUTED` or `UNMUTED`, then the + # finding's overall mute state will have the same value. + # @!attribute [rw] apply_time + # @return [::Google::Protobuf::Timestamp] + # When the static mute was applied. + class StaticMute + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # The record of a dynamic mute rule that matches the finding. + # @!attribute [rw] mute_config + # @return [::String] + # The relative resource name of the mute rule, represented by a mute + # config, that created this record, for example + # `organizations/123/muteConfigs/mymuteconfig` or + # `organizations/123/locations/global/muteConfigs/mymuteconfig`. + # @!attribute [rw] match_time + # @return [::Google::Protobuf::Timestamp] + # When the dynamic mute rule first matched the finding. + class DynamicMuteRecord + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end + + # @!attribute [rw] key + # @return [::String] + # @!attribute [rw] value + # @return [::Google::Protobuf::Value] + class SourcePropertiesEntry + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # @!attribute [rw] key + # @return [::String] + # @!attribute [rw] value + # @return [::Google::Cloud::SecurityCenter::V2::ExternalSystem] + class ExternalSystemsEntry + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # @!attribute [rw] key + # @return [::String] + # @!attribute [rw] value + # @return [::Google::Cloud::SecurityCenter::V2::ContactDetails] + class ContactsEntry + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # The state of the finding. + module State + # Unspecified state. + STATE_UNSPECIFIED = 0 + + # The finding requires attention and has not been addressed yet. + ACTIVE = 1 + + # The finding has been fixed, triaged as a non-issue or otherwise addressed + # and is no longer active. + INACTIVE = 2 + end + + # The severity of the finding. + module Severity + # This value is used for findings when a source doesn't write a severity + # value. + SEVERITY_UNSPECIFIED = 0 + + # Vulnerability: + # A critical vulnerability is easily discoverable by an external actor, + # exploitable, and results in the direct ability to execute arbitrary code, + # exfiltrate data, and otherwise gain additional access and privileges to + # cloud resources and workloads. Examples include publicly accessible + # unprotected user data and public SSH access with weak or no + # passwords. + # + # Threat: + # Indicates a threat that is able to access, modify, or delete data or + # execute unauthorized code within existing resources. + CRITICAL = 1 + + # Vulnerability: + # A high risk vulnerability can be easily discovered and exploited in + # combination with other vulnerabilities in order to gain direct access and + # the ability to execute arbitrary code, exfiltrate data, and otherwise + # gain additional access and privileges to cloud resources and workloads. + # An example is a database with weak or no passwords that is only + # accessible internally. This database could easily be compromised by an + # actor that had access to the internal network. + # + # Threat: + # Indicates a threat that is able to create new computational resources in + # an environment but not able to access data or execute code in existing + # resources. + HIGH = 2 + + # Vulnerability: + # A medium risk vulnerability could be used by an actor to gain access to + # resources or privileges that enable them to eventually (through multiple + # steps or a complex exploit) gain access and the ability to execute + # arbitrary code or exfiltrate data. An example is a service account with + # access to more projects than it should have. If an actor gains access to + # the service account, they could potentially use that access to manipulate + # a project the service account was not intended to. + # + # Threat: + # Indicates a threat that is able to cause operational impact but may not + # access data or execute unauthorized code. + MEDIUM = 3 + + # Vulnerability: + # A low risk vulnerability hampers a security organization's ability to + # detect vulnerabilities or active threats in their deployment, or prevents + # the root cause investigation of security issues. An example is monitoring + # and logs being disabled for resource configurations and access. + # + # Threat: + # Indicates a threat that has obtained minimal access to an environment but + # is not able to access data, execute code, or create resources. + LOW = 4 + end + + # Mute state a finding can be in. + module Mute + # Unspecified. + MUTE_UNSPECIFIED = 0 + + # Finding has been muted. + MUTED = 1 + + # Finding has been unmuted. + UNMUTED = 2 + + # Finding has never been muted/unmuted. + UNDEFINED = 3 + end + + # Represents what kind of Finding it is. + module FindingClass + # Unspecified finding class. + FINDING_CLASS_UNSPECIFIED = 0 + + # Describes unwanted or malicious activity. + THREAT = 1 + + # Describes a potential weakness in software that increases risk to + # Confidentiality & Integrity & Availability. + VULNERABILITY = 2 + + # Describes a potential weakness in cloud resource/asset configuration that + # increases risk. + MISCONFIGURATION = 3 + + # Describes a security observation that is for informational purposes. + OBSERVATION = 4 + + # Describes an error that prevents some SCC functionality. + SCC_ERROR = 5 + + # Describes a potential security risk due to a change in the security + # posture. + POSTURE_VIOLATION = 6 + + # Describes a combination of security issues that represent a more severe + # security problem when taken together. + TOXIC_COMBINATION = 7 + + # Describes a potential security risk to data assets that contain sensitive + # data. + SENSITIVE_DATA_RISK = 8 + + # Describes a resource or resource group where high risk attack paths + # converge, based on attack path simulations (APS). + CHOKEPOINT = 9 + end + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-security_center-v2/proto_docs/google/cloud/securitycenter/v2/folder.rb b/owl-bot-staging/google-cloud-security_center-v2/proto_docs/google/cloud/securitycenter/v2/folder.rb new file mode 100644 index 000000000000..a56cbebc0318 --- /dev/null +++ b/owl-bot-staging/google-cloud-security_center-v2/proto_docs/google/cloud/securitycenter/v2/folder.rb @@ -0,0 +1,40 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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 SecurityCenter + module V2 + # Message that contains the resource name and display name of a folder + # resource. + # @!attribute [rw] resource_folder + # @return [::String] + # Full resource name of this folder. See: + # https://cloud.google.com/apis/design/resource_names#full_resource_name + # @!attribute [rw] resource_folder_display_name + # @return [::String] + # The user defined display name for this folder. + class Folder + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-security_center-v2/proto_docs/google/cloud/securitycenter/v2/group_membership.rb b/owl-bot-staging/google-cloud-security_center-v2/proto_docs/google/cloud/securitycenter/v2/group_membership.rb new file mode 100644 index 000000000000..4b2f90a8e17c --- /dev/null +++ b/owl-bot-staging/google-cloud-security_center-v2/proto_docs/google/cloud/securitycenter/v2/group_membership.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! + + +module Google + module Cloud + module SecurityCenter + module V2 + # Contains details about groups of which this finding is a member. A group is a + # collection of findings that are related in some way. + # @!attribute [rw] group_type + # @return [::Google::Cloud::SecurityCenter::V2::GroupMembership::GroupType] + # Type of group. + # @!attribute [rw] group_id + # @return [::String] + # ID of the group. + class GroupMembership + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # Possible types of groups. + module GroupType + # Default value. + GROUP_TYPE_UNSPECIFIED = 0 + + # Group represents a toxic combination. + GROUP_TYPE_TOXIC_COMBINATION = 1 + + # Group represents a chokepoint. + GROUP_TYPE_CHOKEPOINT = 3 + end + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-security_center-v2/proto_docs/google/cloud/securitycenter/v2/iam_binding.rb b/owl-bot-staging/google-cloud-security_center-v2/proto_docs/google/cloud/securitycenter/v2/iam_binding.rb new file mode 100644 index 000000000000..879809624b27 --- /dev/null +++ b/owl-bot-staging/google-cloud-security_center-v2/proto_docs/google/cloud/securitycenter/v2/iam_binding.rb @@ -0,0 +1,56 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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 SecurityCenter + module V2 + # Represents a particular IAM binding, which captures a member's role addition, + # removal, or state. + # @!attribute [rw] action + # @return [::Google::Cloud::SecurityCenter::V2::IamBinding::Action] + # The action that was performed on a Binding. + # @!attribute [rw] role + # @return [::String] + # Role that is assigned to "members". + # For example, "roles/viewer", "roles/editor", or "roles/owner". + # @!attribute [rw] member + # @return [::String] + # A single identity requesting access for a Cloud Platform resource, for + # example, "foo@google.com". + class IamBinding + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # The type of action performed on a Binding in a policy. + module Action + # Unspecified. + ACTION_UNSPECIFIED = 0 + + # Addition of a Binding. + ADD = 1 + + # Removal of a Binding. + REMOVE = 2 + end + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-security_center-v2/proto_docs/google/cloud/securitycenter/v2/indicator.rb b/owl-bot-staging/google-cloud-security_center-v2/proto_docs/google/cloud/securitycenter/v2/indicator.rb new file mode 100644 index 000000000000..85acfa00a4c5 --- /dev/null +++ b/owl-bot-staging/google-cloud-security_center-v2/proto_docs/google/cloud/securitycenter/v2/indicator.rb @@ -0,0 +1,116 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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 SecurityCenter + module V2 + # Represents what's commonly known as an _indicator of compromise_ (IoC) in + # computer forensics. This is an artifact observed on a network or in an + # operating system that, with high confidence, indicates a computer intrusion. + # For more information, see [Indicator of + # compromise](https://en.wikipedia.org/wiki/Indicator_of_compromise). + # @!attribute [rw] ip_addresses + # @return [::Array<::String>] + # The list of IP addresses that are associated with the finding. + # @!attribute [rw] domains + # @return [::Array<::String>] + # List of domains associated to the Finding. + # @!attribute [rw] signatures + # @return [::Array<::Google::Cloud::SecurityCenter::V2::Indicator::ProcessSignature>] + # The list of matched signatures indicating that the given + # process is present in the environment. + # @!attribute [rw] uris + # @return [::Array<::String>] + # The list of URIs associated to the Findings. + class Indicator + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # Indicates what signature matched this process. + # @!attribute [rw] memory_hash_signature + # @return [::Google::Cloud::SecurityCenter::V2::Indicator::ProcessSignature::MemoryHashSignature] + # Signature indicating that a binary family was matched. + # + # Note: The following fields are mutually exclusive: `memory_hash_signature`, `yara_rule_signature`. If a field in that set is populated, all other fields in the set will automatically be cleared. + # @!attribute [rw] yara_rule_signature + # @return [::Google::Cloud::SecurityCenter::V2::Indicator::ProcessSignature::YaraRuleSignature] + # Signature indicating that a YARA rule was matched. + # + # Note: The following fields are mutually exclusive: `yara_rule_signature`, `memory_hash_signature`. If a field in that set is populated, all other fields in the set will automatically be cleared. + # @!attribute [rw] signature_type + # @return [::Google::Cloud::SecurityCenter::V2::Indicator::ProcessSignature::SignatureType] + # Describes the type of resource associated with the signature. + class ProcessSignature + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # A signature corresponding to memory page hashes. + # @!attribute [rw] binary_family + # @return [::String] + # The binary family. + # @!attribute [rw] detections + # @return [::Array<::Google::Cloud::SecurityCenter::V2::Indicator::ProcessSignature::MemoryHashSignature::Detection>] + # The list of memory hash detections contributing to the binary family + # match. + class MemoryHashSignature + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # Memory hash detection contributing to the binary family match. + # @!attribute [rw] binary + # @return [::String] + # The name of the binary associated with the memory hash + # signature detection. + # @!attribute [rw] percent_pages_matched + # @return [::Float] + # The percentage of memory page hashes in the signature + # that were matched. + class Detection + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end + + # A signature corresponding to a YARA rule. + # @!attribute [rw] yara_rule + # @return [::String] + # The name of the YARA rule. + class YaraRuleSignature + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Possible resource types to be associated with a signature. + module SignatureType + # The default signature type. + SIGNATURE_TYPE_UNSPECIFIED = 0 + + # Used for signatures concerning processes. + SIGNATURE_TYPE_PROCESS = 1 + + # Used for signatures concerning disks. + SIGNATURE_TYPE_FILE = 2 + end + end + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-security_center-v2/proto_docs/google/cloud/securitycenter/v2/ip_rules.rb b/owl-bot-staging/google-cloud-security_center-v2/proto_docs/google/cloud/securitycenter/v2/ip_rules.rb new file mode 100644 index 000000000000..ce71b3883188 --- /dev/null +++ b/owl-bot-staging/google-cloud-security_center-v2/proto_docs/google/cloud/securitycenter/v2/ip_rules.rb @@ -0,0 +1,122 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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 SecurityCenter + module V2 + # IP rules associated with the finding. + # @!attribute [rw] direction + # @return [::Google::Cloud::SecurityCenter::V2::IpRules::Direction] + # The direction that the rule is applicable to, one of ingress or egress. + # @!attribute [rw] allowed + # @return [::Google::Cloud::SecurityCenter::V2::Allowed] + # Tuple with allowed rules. + # + # Note: The following fields are mutually exclusive: `allowed`, `denied`. If a field in that set is populated, all other fields in the set will automatically be cleared. + # @!attribute [rw] denied + # @return [::Google::Cloud::SecurityCenter::V2::Denied] + # Tuple with denied rules. + # + # Note: The following fields are mutually exclusive: `denied`, `allowed`. If a field in that set is populated, all other fields in the set will automatically be cleared. + # @!attribute [rw] source_ip_ranges + # @return [::Array<::String>] + # If source IP ranges are specified, the firewall rule applies only to + # traffic that has a source IP address in these ranges. These ranges must be + # expressed in CIDR format. Only supports IPv4. + # @!attribute [rw] destination_ip_ranges + # @return [::Array<::String>] + # If destination IP ranges are specified, the firewall rule applies only to + # traffic that has a destination IP address in these ranges. These ranges + # must be expressed in CIDR format. Only supports IPv4. + # @!attribute [rw] exposed_services + # @return [::Array<::String>] + # Name of the network protocol service, such as FTP, that is exposed by the + # open port. Follows the naming convention available at: + # https://www.iana.org/assignments/service-names-port-numbers/service-names-port-numbers.xhtml. + class IpRules + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # The type of direction that the rule is applicable to, one of ingress or + # egress. Not applicable to OPEN_X_PORT findings. + module Direction + # Unspecified direction value. + DIRECTION_UNSPECIFIED = 0 + + # Ingress direction value. + INGRESS = 1 + + # Egress direction value. + EGRESS = 2 + end + end + + # IP rule information. + # @!attribute [rw] protocol + # @return [::String] + # The IP protocol this rule applies to. This value can either be one of the + # following well known protocol strings (TCP, UDP, ICMP, ESP, AH, IPIP, + # SCTP) or a string representation of the integer value. + # @!attribute [rw] port_ranges + # @return [::Array<::Google::Cloud::SecurityCenter::V2::IpRule::PortRange>] + # Optional. An optional list of ports to which this rule applies. This field + # is only applicable for the UDP or (S)TCP protocols. Each entry must be + # either an integer or a range including a min and max port number. + class IpRule + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # A port range which is inclusive of the min and max values. + # Values are between 0 and 2^16-1. The max can be equal / must be not smaller + # than the min value. If min and max are equal this indicates that it is a + # single port. + # @!attribute [rw] min + # @return [::Integer] + # Minimum port value. + # @!attribute [rw] max + # @return [::Integer] + # Maximum port value. + class PortRange + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end + + # Allowed IP rule. + # @!attribute [rw] ip_rules + # @return [::Array<::Google::Cloud::SecurityCenter::V2::IpRule>] + # Optional. Optional list of allowed IP rules. + class Allowed + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Denied IP rule. + # @!attribute [rw] ip_rules + # @return [::Array<::Google::Cloud::SecurityCenter::V2::IpRule>] + # Optional. Optional list of denied IP rules. + class Denied + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-security_center-v2/proto_docs/google/cloud/securitycenter/v2/job.rb b/owl-bot-staging/google-cloud-security_center-v2/proto_docs/google/cloud/securitycenter/v2/job.rb new file mode 100644 index 000000000000..e8f38e48dc1b --- /dev/null +++ b/owl-bot-staging/google-cloud-security_center-v2/proto_docs/google/cloud/securitycenter/v2/job.rb @@ -0,0 +1,65 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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 SecurityCenter + module V2 + # Describes a job + # @!attribute [rw] name + # @return [::String] + # The fully-qualified name for a job. + # e.g. `projects//jobs/` + # @!attribute [r] state + # @return [::Google::Cloud::SecurityCenter::V2::JobState] + # Output only. State of the job, such as `RUNNING` or `PENDING`. + # @!attribute [rw] error_code + # @return [::Integer] + # Optional. If the job did not complete successfully, this field describes + # why. + # @!attribute [rw] location + # @return [::String] + # Optional. Gives the location where the job ran, such as `US` or + # `europe-west1` + class Job + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # JobState represents the state of the job. + module JobState + # Unspecified represents an unknown state and should not be used. + JOB_STATE_UNSPECIFIED = 0 + + # Job is scheduled and pending for run + PENDING = 1 + + # Job in progress + RUNNING = 2 + + # Job has completed with success + SUCCEEDED = 3 + + # Job has completed but with failure + FAILED = 4 + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-security_center-v2/proto_docs/google/cloud/securitycenter/v2/kernel_rootkit.rb b/owl-bot-staging/google-cloud-security_center-v2/proto_docs/google/cloud/securitycenter/v2/kernel_rootkit.rb new file mode 100644 index 000000000000..0e324f832355 --- /dev/null +++ b/owl-bot-staging/google-cloud-security_center-v2/proto_docs/google/cloud/securitycenter/v2/kernel_rootkit.rb @@ -0,0 +1,66 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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 SecurityCenter + module V2 + # Kernel mode rootkit signatures. + # @!attribute [rw] name + # @return [::String] + # Rootkit name, when available. + # @!attribute [rw] unexpected_code_modification + # @return [::Boolean] + # True if unexpected modifications of kernel code memory are present. + # @!attribute [rw] unexpected_read_only_data_modification + # @return [::Boolean] + # True if unexpected modifications of kernel read-only data memory are + # present. + # @!attribute [rw] unexpected_ftrace_handler + # @return [::Boolean] + # True if `ftrace` points are present with callbacks pointing to regions + # that are not in the expected kernel or module code range. + # @!attribute [rw] unexpected_kprobe_handler + # @return [::Boolean] + # True if `kprobe` points are present with callbacks pointing to regions + # that are not in the expected kernel or module code range. + # @!attribute [rw] unexpected_kernel_code_pages + # @return [::Boolean] + # True if kernel code pages that are not in the expected kernel or module + # code regions are present. + # @!attribute [rw] unexpected_system_call_handler + # @return [::Boolean] + # True if system call handlers that are are not in the expected kernel or + # module code regions are present. + # @!attribute [rw] unexpected_interrupt_handler + # @return [::Boolean] + # True if interrupt handlers that are are not in the expected kernel or + # module code regions are present. + # @!attribute [rw] unexpected_processes_in_runqueue + # @return [::Boolean] + # True if unexpected processes in the scheduler run queue are present. Such + # processes are in the run queue, but not in the process task list. + class KernelRootkit + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-security_center-v2/proto_docs/google/cloud/securitycenter/v2/kubernetes.rb b/owl-bot-staging/google-cloud-security_center-v2/proto_docs/google/cloud/securitycenter/v2/kubernetes.rb new file mode 100644 index 000000000000..444ecd5eec70 --- /dev/null +++ b/owl-bot-staging/google-cloud-security_center-v2/proto_docs/google/cloud/securitycenter/v2/kubernetes.rb @@ -0,0 +1,241 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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 SecurityCenter + module V2 + # Kubernetes-related attributes. + # @!attribute [rw] pods + # @return [::Array<::Google::Cloud::SecurityCenter::V2::Kubernetes::Pod>] + # Kubernetes + # [Pods](https://cloud.google.com/kubernetes-engine/docs/concepts/pod) + # associated with the finding. This field contains Pod records for each + # container that is owned by a Pod. + # @!attribute [rw] nodes + # @return [::Array<::Google::Cloud::SecurityCenter::V2::Kubernetes::Node>] + # Provides Kubernetes + # [node](https://cloud.google.com/kubernetes-engine/docs/concepts/cluster-architecture#nodes) + # information. + # @!attribute [rw] node_pools + # @return [::Array<::Google::Cloud::SecurityCenter::V2::Kubernetes::NodePool>] + # GKE [node + # pools](https://cloud.google.com/kubernetes-engine/docs/concepts/node-pools) + # associated with the finding. This field contains node pool information for + # each node, when it is available. + # @!attribute [rw] roles + # @return [::Array<::Google::Cloud::SecurityCenter::V2::Kubernetes::Role>] + # Provides Kubernetes role information for findings that involve [Roles or + # ClusterRoles](https://cloud.google.com/kubernetes-engine/docs/how-to/role-based-access-control). + # @!attribute [rw] bindings + # @return [::Array<::Google::Cloud::SecurityCenter::V2::Kubernetes::Binding>] + # Provides Kubernetes role binding information for findings that involve + # [RoleBindings or + # ClusterRoleBindings](https://cloud.google.com/kubernetes-engine/docs/how-to/role-based-access-control). + # @!attribute [rw] access_reviews + # @return [::Array<::Google::Cloud::SecurityCenter::V2::Kubernetes::AccessReview>] + # Provides information on any Kubernetes access reviews (privilege checks) + # relevant to the finding. + # @!attribute [rw] objects + # @return [::Array<::Google::Cloud::SecurityCenter::V2::Kubernetes::Object>] + # Kubernetes objects related to the finding. + class Kubernetes + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # A Kubernetes Pod. + # @!attribute [rw] ns + # @return [::String] + # Kubernetes Pod namespace. + # @!attribute [rw] name + # @return [::String] + # Kubernetes Pod name. + # @!attribute [rw] labels + # @return [::Array<::Google::Cloud::SecurityCenter::V2::Label>] + # Pod labels. For Kubernetes containers, these are applied to the + # container. + # @!attribute [rw] containers + # @return [::Array<::Google::Cloud::SecurityCenter::V2::Container>] + # Pod containers associated with this finding, if any. + class Pod + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Kubernetes nodes associated with the finding. + # @!attribute [rw] name + # @return [::String] + # [Full resource name](https://google.aip.dev/122#full-resource-names) of + # the Compute Engine VM running the cluster node. + class Node + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Provides GKE node pool information. + # @!attribute [rw] name + # @return [::String] + # Kubernetes node pool name. + # @!attribute [rw] nodes + # @return [::Array<::Google::Cloud::SecurityCenter::V2::Kubernetes::Node>] + # Nodes associated with the finding. + class NodePool + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Kubernetes Role or ClusterRole. + # @!attribute [rw] kind + # @return [::Google::Cloud::SecurityCenter::V2::Kubernetes::Role::Kind] + # Role type. + # @!attribute [rw] ns + # @return [::String] + # Role namespace. + # @!attribute [rw] name + # @return [::String] + # Role name. + class Role + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # Types of Kubernetes roles. + module Kind + # Role type is not specified. + KIND_UNSPECIFIED = 0 + + # Kubernetes Role. + ROLE = 1 + + # Kubernetes ClusterRole. + CLUSTER_ROLE = 2 + end + end + + # Represents a Kubernetes RoleBinding or ClusterRoleBinding. + # @!attribute [rw] ns + # @return [::String] + # Namespace for the binding. + # @!attribute [rw] name + # @return [::String] + # Name for the binding. + # @!attribute [rw] role + # @return [::Google::Cloud::SecurityCenter::V2::Kubernetes::Role] + # The Role or ClusterRole referenced by the binding. + # @!attribute [rw] subjects + # @return [::Array<::Google::Cloud::SecurityCenter::V2::Kubernetes::Subject>] + # Represents one or more subjects that are bound to the role. Not always + # available for PATCH requests. + class Binding + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Represents a Kubernetes subject. + # @!attribute [rw] kind + # @return [::Google::Cloud::SecurityCenter::V2::Kubernetes::Subject::AuthType] + # Authentication type for the subject. + # @!attribute [rw] ns + # @return [::String] + # Namespace for the subject. + # @!attribute [rw] name + # @return [::String] + # Name for the subject. + class Subject + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # Auth types that can be used for the subject's kind field. + module AuthType + # Authentication is not specified. + AUTH_TYPE_UNSPECIFIED = 0 + + # User with valid certificate. + USER = 1 + + # Users managed by Kubernetes API with credentials stored as secrets. + SERVICEACCOUNT = 2 + + # Collection of users. + GROUP = 3 + end + end + + # Conveys information about a Kubernetes access review (such as one returned + # by a [`kubectl auth + # can-i`](https://kubernetes.io/docs/reference/access-authn-authz/authorization/#checking-api-access) + # command) that was involved in a finding. + # @!attribute [rw] group + # @return [::String] + # The API group of the resource. "*" means all. + # @!attribute [rw] ns + # @return [::String] + # Namespace of the action being requested. Currently, there is no + # distinction between no namespace and all namespaces. Both + # are represented by "" (empty). + # @!attribute [rw] name + # @return [::String] + # The name of the resource being requested. Empty means all. + # @!attribute [rw] resource + # @return [::String] + # The optional resource type requested. "*" means all. + # @!attribute [rw] subresource + # @return [::String] + # The optional subresource type. + # @!attribute [rw] verb + # @return [::String] + # A Kubernetes resource API verb, like get, list, watch, create, update, + # delete, proxy. "*" means all. + # @!attribute [rw] version + # @return [::String] + # The API version of the resource. "*" means all. + class AccessReview + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Kubernetes object related to the finding, uniquely identified by GKNN. + # Used if the object Kind is not one of Pod, Node, NodePool, Binding, or + # AccessReview. + # @!attribute [rw] group + # @return [::String] + # Kubernetes object group, such as "policy.k8s.io/v1". + # @!attribute [rw] kind + # @return [::String] + # Kubernetes object kind, such as "Namespace". + # @!attribute [rw] ns + # @return [::String] + # Kubernetes object namespace. Must be a valid DNS label. Named + # "ns" to avoid collision with C++ namespace keyword. For details see + # https://kubernetes.io/docs/tasks/administer-cluster/namespaces/. + # @!attribute [rw] name + # @return [::String] + # Kubernetes object name. For details see + # https://kubernetes.io/docs/concepts/overview/working-with-objects/names/. + # @!attribute [rw] containers + # @return [::Array<::Google::Cloud::SecurityCenter::V2::Container>] + # Pod containers associated with this finding, if any. + class Object + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-security_center-v2/proto_docs/google/cloud/securitycenter/v2/label.rb b/owl-bot-staging/google-cloud-security_center-v2/proto_docs/google/cloud/securitycenter/v2/label.rb new file mode 100644 index 000000000000..609c1859cbe1 --- /dev/null +++ b/owl-bot-staging/google-cloud-security_center-v2/proto_docs/google/cloud/securitycenter/v2/label.rb @@ -0,0 +1,41 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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 SecurityCenter + module V2 + # Represents a generic name-value label. A label has separate name and value + # fields to support filtering with the `contains()` function. For more + # information, see [Filtering on array-type + # fields](https://cloud.google.com/security-command-center/docs/how-to-api-list-findings#array-contains-filtering). + # @!attribute [rw] name + # @return [::String] + # Name of the label. + # @!attribute [rw] value + # @return [::String] + # Value that corresponds to the label's name. + class Label + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-security_center-v2/proto_docs/google/cloud/securitycenter/v2/load_balancer.rb b/owl-bot-staging/google-cloud-security_center-v2/proto_docs/google/cloud/securitycenter/v2/load_balancer.rb new file mode 100644 index 000000000000..a9d466c92655 --- /dev/null +++ b/owl-bot-staging/google-cloud-security_center-v2/proto_docs/google/cloud/securitycenter/v2/load_balancer.rb @@ -0,0 +1,36 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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 SecurityCenter + module V2 + # Contains information related to the load balancer associated with the + # finding. + # @!attribute [rw] name + # @return [::String] + # The name of the load balancer associated with the finding. + class LoadBalancer + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-security_center-v2/proto_docs/google/cloud/securitycenter/v2/log_entry.rb b/owl-bot-staging/google-cloud-security_center-v2/proto_docs/google/cloud/securitycenter/v2/log_entry.rb new file mode 100644 index 000000000000..f3ea1bf4b29d --- /dev/null +++ b/owl-bot-staging/google-cloud-security_center-v2/proto_docs/google/cloud/securitycenter/v2/log_entry.rb @@ -0,0 +1,58 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + + +module Google + module Cloud + module SecurityCenter + module V2 + # An individual entry in a log. + # @!attribute [rw] cloud_logging_entry + # @return [::Google::Cloud::SecurityCenter::V2::CloudLoggingEntry] + # An individual entry in a log stored in Cloud Logging. + class LogEntry + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Metadata taken from a [Cloud Logging + # LogEntry](https://cloud.google.com/logging/docs/reference/v2/rest/v2/LogEntry) + # @!attribute [rw] insert_id + # @return [::String] + # A unique identifier for the log entry. + # @!attribute [rw] log_id + # @return [::String] + # The type of the log (part of `log_name`. `log_name` is the resource name of + # the log to which this log entry belongs). For example: + # `cloudresourcemanager.googleapis.com/activity` Note that this field is not + # URL-encoded, unlike in `LogEntry`. + # @!attribute [rw] resource_container + # @return [::String] + # The organization, folder, or project of the monitored resource that + # produced this log entry. + # @!attribute [rw] timestamp + # @return [::Google::Protobuf::Timestamp] + # The time the event described by the log entry occurred. + class CloudLoggingEntry + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-security_center-v2/proto_docs/google/cloud/securitycenter/v2/mitre_attack.rb b/owl-bot-staging/google-cloud-security_center-v2/proto_docs/google/cloud/securitycenter/v2/mitre_attack.rb new file mode 100644 index 000000000000..a1f6f5b169c8 --- /dev/null +++ b/owl-bot-staging/google-cloud-security_center-v2/proto_docs/google/cloud/securitycenter/v2/mitre_attack.rb @@ -0,0 +1,521 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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 SecurityCenter + module V2 + # MITRE ATT&CK tactics and techniques related to this finding. + # See: https://attack.mitre.org + # @!attribute [rw] primary_tactic + # @return [::Google::Cloud::SecurityCenter::V2::MitreAttack::Tactic] + # The MITRE ATT&CK tactic most closely represented by this finding, if any. + # @!attribute [rw] primary_techniques + # @return [::Array<::Google::Cloud::SecurityCenter::V2::MitreAttack::Technique>] + # The MITRE ATT&CK technique most closely represented by this finding, if + # any. primary_techniques is a repeated field because there are multiple + # levels of MITRE ATT&CK techniques. If the technique most closely + # represented by this finding is a sub-technique (e.g. `SCANNING_IP_BLOCKS`), + # both the sub-technique and its parent technique(s) will be listed (e.g. + # `SCANNING_IP_BLOCKS`, `ACTIVE_SCANNING`). + # @!attribute [rw] additional_tactics + # @return [::Array<::Google::Cloud::SecurityCenter::V2::MitreAttack::Tactic>] + # Additional MITRE ATT&CK tactics related to this finding, if any. + # @!attribute [rw] additional_techniques + # @return [::Array<::Google::Cloud::SecurityCenter::V2::MitreAttack::Technique>] + # Additional MITRE ATT&CK techniques related to this finding, if any, along + # with any of their respective parent techniques. + # @!attribute [rw] version + # @return [::String] + # The MITRE ATT&CK version referenced by the above fields. E.g. "8". + class MitreAttack + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # MITRE ATT&CK tactics that can be referenced by SCC findings. + # See: https://attack.mitre.org/tactics/enterprise/ + module Tactic + # Unspecified value. + TACTIC_UNSPECIFIED = 0 + + # TA0043 + RECONNAISSANCE = 1 + + # TA0042 + RESOURCE_DEVELOPMENT = 2 + + # TA0001 + INITIAL_ACCESS = 5 + + # TA0002 + EXECUTION = 3 + + # TA0003 + PERSISTENCE = 6 + + # TA0004 + PRIVILEGE_ESCALATION = 8 + + # TA0005 + DEFENSE_EVASION = 7 + + # TA0006 + CREDENTIAL_ACCESS = 9 + + # TA0007 + DISCOVERY = 10 + + # TA0008 + LATERAL_MOVEMENT = 11 + + # TA0009 + COLLECTION = 12 + + # TA0011 + COMMAND_AND_CONTROL = 4 + + # TA0010 + EXFILTRATION = 13 + + # TA0040 + IMPACT = 14 + end + + # MITRE ATT&CK techniques that can be referenced by Security Command Center + # findings. See: https://attack.mitre.org/techniques/enterprise/ + module Technique + # Unspecified value. + TECHNIQUE_UNSPECIFIED = 0 + + # T1001 + DATA_OBFUSCATION = 70 + + # T1001.002 + DATA_OBFUSCATION_STEGANOGRAPHY = 71 + + # T1003 + OS_CREDENTIAL_DUMPING = 114 + + # T1003.007 + OS_CREDENTIAL_DUMPING_PROC_FILESYSTEM = 115 + + # T1003.008 + OS_CREDENTIAL_DUMPING_ETC_PASSWORD_AND_ETC_SHADOW = 122 + + # T1005 + DATA_FROM_LOCAL_SYSTEM = 117 + + # T1020 + AUTOMATED_EXFILTRATION = 68 + + # T1027 + OBFUSCATED_FILES_OR_INFO = 72 + + # T1027.003 + STEGANOGRAPHY = 73 + + # T1027.004 + COMPILE_AFTER_DELIVERY = 74 + + # T1027.010 + COMMAND_OBFUSCATION = 75 + + # T1029 + SCHEDULED_TRANSFER = 120 + + # T1033 + SYSTEM_OWNER_USER_DISCOVERY = 118 + + # T1036 + MASQUERADING = 49 + + # T1036.005 + MATCH_LEGITIMATE_NAME_OR_LOCATION = 50 + + # T1037 + BOOT_OR_LOGON_INITIALIZATION_SCRIPTS = 37 + + # T1037.005 + STARTUP_ITEMS = 38 + + # T1046 + NETWORK_SERVICE_DISCOVERY = 32 + + # T1053 + SCHEDULED_TASK_JOB = 89 + + # T1053.003 + SCHEDULED_TASK_JOB_CRON = 119 + + # T1053.007 + CONTAINER_ORCHESTRATION_JOB = 90 + + # T1055 + PROCESS_INJECTION = 93 + + # T1056 + INPUT_CAPTURE = 103 + + # T1056.001 + INPUT_CAPTURE_KEYLOGGING = 104 + + # T1057 + PROCESS_DISCOVERY = 56 + + # T1059 + COMMAND_AND_SCRIPTING_INTERPRETER = 6 + + # T1059.004 + UNIX_SHELL = 7 + + # T1059.006 + PYTHON = 59 + + # T1068 + EXPLOITATION_FOR_PRIVILEGE_ESCALATION = 63 + + # T1069 + PERMISSION_GROUPS_DISCOVERY = 18 + + # T1069.003 + CLOUD_GROUPS = 19 + + # T1070 + INDICATOR_REMOVAL = 123 + + # T1070.002 + INDICATOR_REMOVAL_CLEAR_LINUX_OR_MAC_SYSTEM_LOGS = 124 + + # T1070.003 + INDICATOR_REMOVAL_CLEAR_COMMAND_HISTORY = 125 + + # T1070.004 + INDICATOR_REMOVAL_FILE_DELETION = 64 + + # T1070.006 + INDICATOR_REMOVAL_TIMESTOMP = 128 + + # T1070.008 + INDICATOR_REMOVAL_CLEAR_MAILBOX_DATA = 126 + + # T1071 + APPLICATION_LAYER_PROTOCOL = 45 + + # T1071.004 + DNS = 46 + + # T1072 + SOFTWARE_DEPLOYMENT_TOOLS = 47 + + # T1078 + VALID_ACCOUNTS = 14 + + # T1078.001 + DEFAULT_ACCOUNTS = 35 + + # T1078.003 + LOCAL_ACCOUNTS = 15 + + # T1078.004 + CLOUD_ACCOUNTS = 16 + + # T1083 + FILE_AND_DIRECTORY_DISCOVERY = 121 + + # T1087.001 + ACCOUNT_DISCOVERY_LOCAL_ACCOUNT = 116 + + # T1090 + PROXY = 9 + + # T1090.002 + EXTERNAL_PROXY = 10 + + # T1090.003 + MULTI_HOP_PROXY = 11 + + # T1098 + ACCOUNT_MANIPULATION = 22 + + # T1098.001 + ADDITIONAL_CLOUD_CREDENTIALS = 40 + + # T1098.003 + ADDITIONAL_CLOUD_ROLES = 67 + + # T1098.004 + SSH_AUTHORIZED_KEYS = 23 + + # T1098.006 + ADDITIONAL_CONTAINER_CLUSTER_ROLES = 58 + + # T1104 + MULTI_STAGE_CHANNELS = 76 + + # T1105 + INGRESS_TOOL_TRANSFER = 3 + + # T1106 + NATIVE_API = 4 + + # T1110 + BRUTE_FORCE = 44 + + # T1119 + AUTOMATED_COLLECTION = 94 + + # T1129 + SHARED_MODULES = 5 + + # T1132 + DATA_ENCODING = 77 + + # T1132.001 + STANDARD_ENCODING = 78 + + # T1134 + ACCESS_TOKEN_MANIPULATION = 33 + + # T1134.001 + TOKEN_IMPERSONATION_OR_THEFT = 39 + + # T1136 + CREATE_ACCOUNT = 79 + + # T1136.001 + LOCAL_ACCOUNT = 80 + + # T1140 + DEOBFUSCATE_DECODE_FILES_OR_INFO = 95 + + # T1190 + EXPLOIT_PUBLIC_FACING_APPLICATION = 27 + + # T1195 + SUPPLY_CHAIN_COMPROMISE = 129 + + # T1195.001 + COMPROMISE_SOFTWARE_DEPENDENCIES_AND_DEVELOPMENT_TOOLS = 130 + + # T1203 + EXPLOITATION_FOR_CLIENT_EXECUTION = 134 + + # T1204 + USER_EXECUTION = 69 + + # T1222.002 + LINUX_AND_MAC_FILE_AND_DIRECTORY_PERMISSIONS_MODIFICATION = 135 + + # T1484 + DOMAIN_POLICY_MODIFICATION = 30 + + # T1485 + DATA_DESTRUCTION = 29 + + # T1486 + DATA_ENCRYPTED_FOR_IMPACT = 132 + + # T1489 + SERVICE_STOP = 52 + + # T1490 + INHIBIT_SYSTEM_RECOVERY = 36 + + # T1495 + FIRMWARE_CORRUPTION = 81 + + # T1496 + RESOURCE_HIJACKING = 8 + + # T1498 + NETWORK_DENIAL_OF_SERVICE = 17 + + # T1526 + CLOUD_SERVICE_DISCOVERY = 48 + + # T1528 + STEAL_APPLICATION_ACCESS_TOKEN = 42 + + # T1531 + ACCOUNT_ACCESS_REMOVAL = 51 + + # T1537 + TRANSFER_DATA_TO_CLOUD_ACCOUNT = 91 + + # T1539 + STEAL_WEB_SESSION_COOKIE = 25 + + # T1543 + CREATE_OR_MODIFY_SYSTEM_PROCESS = 24 + + # T1546 + EVENT_TRIGGERED_EXECUTION = 65 + + # T1547 + BOOT_OR_LOGON_AUTOSTART_EXECUTION = 82 + + # T1547.006 + KERNEL_MODULES_AND_EXTENSIONS = 83 + + # T1547.009 + SHORTCUT_MODIFICATION = 127 + + # T1548 + ABUSE_ELEVATION_CONTROL_MECHANISM = 34 + + # T1548.001 + ABUSE_ELEVATION_CONTROL_MECHANISM_SETUID_AND_SETGID = 136 + + # T1548.003 + ABUSE_ELEVATION_CONTROL_MECHANISM_SUDO_AND_SUDO_CACHING = 109 + + # T1552 + UNSECURED_CREDENTIALS = 13 + + # T1552.001 + CREDENTIALS_IN_FILES = 105 + + # T1552.003 + BASH_HISTORY = 96 + + # T1552.004 + PRIVATE_KEYS = 97 + + # T1553 + SUBVERT_TRUST_CONTROL = 106 + + # T1553.004 + INSTALL_ROOT_CERTIFICATE = 107 + + # T1554 + COMPROMISE_HOST_SOFTWARE_BINARY = 84 + + # T1555 + CREDENTIALS_FROM_PASSWORD_STORES = 98 + + # T1556 + MODIFY_AUTHENTICATION_PROCESS = 28 + + # T1556.003 + PLUGGABLE_AUTHENTICATION_MODULES = 108 + + # T1556.006 + MULTI_FACTOR_AUTHENTICATION = 137 + + # T1562 + IMPAIR_DEFENSES = 31 + + # T1562.001 + DISABLE_OR_MODIFY_TOOLS = 55 + + # T1562.006 + INDICATOR_BLOCKING = 110 + + # T1562.012 + DISABLE_OR_MODIFY_LINUX_AUDIT_SYSTEM = 111 + + # T1564 + HIDE_ARTIFACTS = 85 + + # T1564.001 + HIDDEN_FILES_AND_DIRECTORIES = 86 + + # T1564.002 + HIDDEN_USERS = 87 + + # T1567 + EXFILTRATION_OVER_WEB_SERVICE = 20 + + # T1567.002 + EXFILTRATION_TO_CLOUD_STORAGE = 21 + + # T1568 + DYNAMIC_RESOLUTION = 12 + + # T1570 + LATERAL_TOOL_TRANSFER = 41 + + # T1574 + HIJACK_EXECUTION_FLOW = 112 + + # T1574.006 + HIJACK_EXECUTION_FLOW_DYNAMIC_LINKER_HIJACKING = 113 + + # T1578 + MODIFY_CLOUD_COMPUTE_INFRASTRUCTURE = 26 + + # T1578.001 + CREATE_SNAPSHOT = 54 + + # T1580 + CLOUD_INFRASTRUCTURE_DISCOVERY = 53 + + # T1587 + DEVELOP_CAPABILITIES = 99 + + # T1587.001 + DEVELOP_CAPABILITIES_MALWARE = 100 + + # T1588 + OBTAIN_CAPABILITIES = 43 + + # T1588.001 + OBTAIN_CAPABILITIES_MALWARE = 101 + + # T1588.006 + OBTAIN_CAPABILITIES_VULNERABILITIES = 133 + + # T1595 + ACTIVE_SCANNING = 1 + + # T1595.001 + SCANNING_IP_BLOCKS = 2 + + # T1608 + STAGE_CAPABILITIES = 88 + + # T1608.001 + UPLOAD_MALWARE = 102 + + # T1609 + CONTAINER_ADMINISTRATION_COMMAND = 60 + + # T1610 + DEPLOY_CONTAINER = 66 + + # T1611 + ESCAPE_TO_HOST = 61 + + # T1613 + CONTAINER_AND_RESOURCE_DISCOVERY = 57 + + # T1620 + REFLECTIVE_CODE_LOADING = 92 + + # T1649 + STEAL_OR_FORGE_AUTHENTICATION_CERTIFICATES = 62 + + # T1657 + FINANCIAL_THEFT = 131 + end + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-security_center-v2/proto_docs/google/cloud/securitycenter/v2/mute_config.rb b/owl-bot-staging/google-cloud-security_center-v2/proto_docs/google/cloud/securitycenter/v2/mute_config.rb new file mode 100644 index 000000000000..db9977d397e7 --- /dev/null +++ b/owl-bot-staging/google-cloud-security_center-v2/proto_docs/google/cloud/securitycenter/v2/mute_config.rb @@ -0,0 +1,113 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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 SecurityCenter + module V2 + # A mute config is a Cloud SCC resource that contains the configuration + # to mute create/update events of findings. + # @!attribute [rw] name + # @return [::String] + # Identifier. This field will be ignored if provided on config creation. The + # following list shows some examples of the format: + # + # + `organizations/{organization}/muteConfigs/{mute_config}` + # + + # `organizations/{organization}locations/{location}//muteConfigs/{mute_config}` + # + `folders/{folder}/muteConfigs/{mute_config}` + # + `folders/{folder}/locations/{location}/muteConfigs/{mute_config}` + # + `projects/{project}/muteConfigs/{mute_config}` + # + `projects/{project}/locations/{location}/muteConfigs/{mute_config}` + # @!attribute [rw] description + # @return [::String] + # A description of the mute config. + # @!attribute [rw] filter + # @return [::String] + # Required. An expression that defines the filter to apply across + # create/update events of findings. While creating a filter string, be + # mindful of the scope in which the mute configuration is being created. + # E.g., If a filter contains project = X but is created under the project = Y + # scope, it might not match any findings. + # + # The following field and operator combinations are supported: + # + # * severity: `=`, `:` + # * category: `=`, `:` + # * resource.name: `=`, `:` + # * resource.project_name: `=`, `:` + # * resource.project_display_name: `=`, `:` + # * resource.folders.resource_folder: `=`, `:` + # * resource.parent_name: `=`, `:` + # * resource.parent_display_name: `=`, `:` + # * resource.type: `=`, `:` + # * finding_class: `=`, `:` + # * indicator.ip_addresses: `=`, `:` + # * indicator.domains: `=`, `:` + # @!attribute [r] create_time + # @return [::Google::Protobuf::Timestamp] + # Output only. The time at which the mute config was created. + # This field is set by the server and will be ignored if provided on config + # creation. + # @!attribute [r] update_time + # @return [::Google::Protobuf::Timestamp] + # Output only. The most recent time at which the mute config was updated. + # This field is set by the server and will be ignored if provided on config + # creation or update. + # @!attribute [r] most_recent_editor + # @return [::String] + # Output only. Email address of the user who last edited the mute config. + # This field is set by the server and will be ignored if provided on config + # creation or update. + # @!attribute [rw] type + # @return [::Google::Cloud::SecurityCenter::V2::MuteConfig::MuteConfigType] + # Required. The type of the mute config, which determines what type of mute + # state the config affects. Immutable after creation. + # @!attribute [rw] expiry_time + # @return [::Google::Protobuf::Timestamp] + # Optional. The expiry of the mute config. Only applicable for dynamic + # configs. If the expiry is set, when the config expires, it is removed from + # all findings. + class MuteConfig + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # The type of MuteConfig. + module MuteConfigType + # Unused. + MUTE_CONFIG_TYPE_UNSPECIFIED = 0 + + # A static mute config, which sets the static mute state of future matching + # findings to muted. Once the static mute state has been set, finding or + # config modifications will not affect the state. + STATIC = 1 + + # A dynamic mute config, which is applied to existing and future matching + # findings, setting their dynamic mute state to "muted". If the config is + # updated or deleted, or a matching finding is updated, such that the + # finding doesn't match the config, the config will be removed from the + # finding, and the finding's dynamic mute state may become "unmuted" + # (unless other configs still match). + DYNAMIC = 2 + end + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-security_center-v2/proto_docs/google/cloud/securitycenter/v2/network.rb b/owl-bot-staging/google-cloud-security_center-v2/proto_docs/google/cloud/securitycenter/v2/network.rb new file mode 100644 index 000000000000..7fb133f55dc2 --- /dev/null +++ b/owl-bot-staging/google-cloud-security_center-v2/proto_docs/google/cloud/securitycenter/v2/network.rb @@ -0,0 +1,36 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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 SecurityCenter + module V2 + # Contains information about a VPC network associated with the finding. + # @!attribute [rw] name + # @return [::String] + # The name of the VPC network resource, for example, + # `//compute.googleapis.com/projects/my-project/global/networks/my-network`. + class Network + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-security_center-v2/proto_docs/google/cloud/securitycenter/v2/notebook.rb b/owl-bot-staging/google-cloud-security_center-v2/proto_docs/google/cloud/securitycenter/v2/notebook.rb new file mode 100644 index 000000000000..0d1e37a099ef --- /dev/null +++ b/owl-bot-staging/google-cloud-security_center-v2/proto_docs/google/cloud/securitycenter/v2/notebook.rb @@ -0,0 +1,46 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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 SecurityCenter + module V2 + # Represents a Jupyter notebook IPYNB file, such as a [Colab Enterprise + # notebook](https://cloud.google.com/colab/docs/introduction) file, that is + # associated with a finding. + # @!attribute [rw] name + # @return [::String] + # The name of the notebook. + # @!attribute [rw] service + # @return [::String] + # The source notebook service, for example, "Colab Enterprise". + # @!attribute [rw] last_author + # @return [::String] + # The user ID of the latest author to modify the notebook. + # @!attribute [rw] notebook_update_time + # @return [::Google::Protobuf::Timestamp] + # The most recent time the notebook was updated. + class Notebook + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-security_center-v2/proto_docs/google/cloud/securitycenter/v2/notification_config.rb b/owl-bot-staging/google-cloud-security_center-v2/proto_docs/google/cloud/securitycenter/v2/notification_config.rb new file mode 100644 index 000000000000..b5de722177ff --- /dev/null +++ b/owl-bot-staging/google-cloud-security_center-v2/proto_docs/google/cloud/securitycenter/v2/notification_config.rb @@ -0,0 +1,94 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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 SecurityCenter + module V2 + # Cloud Security Command Center (Cloud SCC) notification configs. + # + # A notification config is a Cloud SCC resource that contains the configuration + # to send notifications for create/update events of findings, assets and etc. + # @!attribute [rw] name + # @return [::String] + # Identifier. The relative resource name of this notification config. See: + # https://cloud.google.com/apis/design/resource_names#relative_resource_name + # The following list shows some examples: + # + + # `organizations/{organization_id}/locations/{location_id}/notificationConfigs/notify_public_bucket` + # + + # `folders/{folder_id}/locations/{location_id}/notificationConfigs/notify_public_bucket` + # + + # `projects/{project_id}/locations/{location_id}/notificationConfigs/notify_public_bucket` + # @!attribute [rw] description + # @return [::String] + # The description of the notification config (max of 1024 characters). + # @!attribute [rw] pubsub_topic + # @return [::String] + # The Pub/Sub topic to send notifications to. Its format is + # "projects/[project_id]/topics/[topic]". + # @!attribute [r] service_account + # @return [::String] + # Output only. The service account that needs "pubsub.topics.publish" + # permission to publish to the Pub/Sub topic. + # @!attribute [rw] streaming_config + # @return [::Google::Cloud::SecurityCenter::V2::NotificationConfig::StreamingConfig] + # The config for triggering streaming-based notifications. + # @!attribute [r] update_time + # @return [::Google::Protobuf::Timestamp] + # Output only. The timestamp of when the notification config was last + # updated. + class NotificationConfig + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # The config for streaming-based notifications, which send each event as soon + # as it is detected. + # @!attribute [rw] filter + # @return [::String] + # Expression that defines the filter to apply across create/update events + # of assets or findings as specified by the event type. The expression is a + # list of zero or more restrictions combined via logical operators `AND` + # and `OR`. Parentheses are supported, and `OR` has higher precedence than + # `AND`. + # + # Restrictions have the form ` ` and may have a + # `-` character in front of them to indicate negation. The fields map to + # those defined in the corresponding resource. + # + # The supported operators are: + # + # * `=` for all value types. + # * `>`, `<`, `>=`, `<=` for integer values. + # * `:`, meaning substring matching, for strings. + # + # The supported value types are: + # + # * string literals in quotes. + # * integer literals without quotes. + # * boolean literals `true` and `false` without quotes. + class StreamingConfig + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-security_center-v2/proto_docs/google/cloud/securitycenter/v2/notification_message.rb b/owl-bot-staging/google-cloud-security_center-v2/proto_docs/google/cloud/securitycenter/v2/notification_message.rb new file mode 100644 index 000000000000..bd3046afd7de --- /dev/null +++ b/owl-bot-staging/google-cloud-security_center-v2/proto_docs/google/cloud/securitycenter/v2/notification_message.rb @@ -0,0 +1,42 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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 SecurityCenter + module V2 + # Cloud SCC's Notification + # @!attribute [rw] notification_config_name + # @return [::String] + # Name of the notification config that generated current notification. + # @!attribute [rw] finding + # @return [::Google::Cloud::SecurityCenter::V2::Finding] + # If it's a Finding based notification config, this field will be + # populated. + # @!attribute [rw] resource + # @return [::Google::Cloud::SecurityCenter::V2::Resource] + # The Cloud resource tied to this notification's Finding. + class NotificationMessage + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-security_center-v2/proto_docs/google/cloud/securitycenter/v2/org_policy.rb b/owl-bot-staging/google-cloud-security_center-v2/proto_docs/google/cloud/securitycenter/v2/org_policy.rb new file mode 100644 index 000000000000..b90cb7b8d034 --- /dev/null +++ b/owl-bot-staging/google-cloud-security_center-v2/proto_docs/google/cloud/securitycenter/v2/org_policy.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! + + +module Google + module Cloud + module SecurityCenter + module V2 + # Contains information about the org policies associated with the finding. + # @!attribute [rw] name + # @return [::String] + # Identifier. The resource name of the org policy. + # Example: + # "organizations/\\{organization_id}/policies/\\{constraint_name}" + class OrgPolicy + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-security_center-v2/proto_docs/google/cloud/securitycenter/v2/process.rb b/owl-bot-staging/google-cloud-security_center-v2/proto_docs/google/cloud/securitycenter/v2/process.rb new file mode 100644 index 000000000000..e127710a40a5 --- /dev/null +++ b/owl-bot-staging/google-cloud-security_center-v2/proto_docs/google/cloud/securitycenter/v2/process.rb @@ -0,0 +1,83 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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 SecurityCenter + module V2 + # Represents an operating system process. + # @!attribute [rw] name + # @return [::String] + # The process name, as displayed in utilities like `top` and `ps`. This name + # can be accessed through `/proc/[pid]/comm` and changed with + # `prctl(PR_SET_NAME)`. + # @!attribute [rw] binary + # @return [::Google::Cloud::SecurityCenter::V2::File] + # File information for the process executable. + # @!attribute [rw] libraries + # @return [::Array<::Google::Cloud::SecurityCenter::V2::File>] + # File information for libraries loaded by the process. + # @!attribute [rw] script + # @return [::Google::Cloud::SecurityCenter::V2::File] + # When the process represents the invocation of a script, `binary` provides + # information about the interpreter, while `script` provides information + # about the script file provided to the interpreter. + # @!attribute [rw] args + # @return [::Array<::String>] + # Process arguments as JSON encoded strings. + # @!attribute [rw] arguments_truncated + # @return [::Boolean] + # True if `args` is incomplete. + # @!attribute [rw] env_variables + # @return [::Array<::Google::Cloud::SecurityCenter::V2::EnvironmentVariable>] + # Process environment variables. + # @!attribute [rw] env_variables_truncated + # @return [::Boolean] + # True if `env_variables` is incomplete. + # @!attribute [rw] pid + # @return [::Integer] + # The process ID. + # @!attribute [rw] parent_pid + # @return [::Integer] + # The parent process ID. + # @!attribute [rw] user_id + # @return [::Integer] + # The ID of the user that executed the process. E.g. If this is the root user + # this will always be 0. + class Process + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # A name-value pair representing an environment variable used in an operating + # system process. + # @!attribute [rw] name + # @return [::String] + # Environment variable name as a JSON encoded string. + # @!attribute [rw] val + # @return [::String] + # Environment variable value as a JSON encoded string. + class EnvironmentVariable + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-security_center-v2/proto_docs/google/cloud/securitycenter/v2/resource.rb b/owl-bot-staging/google-cloud-security_center-v2/proto_docs/google/cloud/securitycenter/v2/resource.rb new file mode 100644 index 000000000000..aaa75073c739 --- /dev/null +++ b/owl-bot-staging/google-cloud-security_center-v2/proto_docs/google/cloud/securitycenter/v2/resource.rb @@ -0,0 +1,314 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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 SecurityCenter + module V2 + # Information related to the Google Cloud resource. + # @!attribute [rw] name + # @return [::String] + # The full resource name of the resource. See: + # https://cloud.google.com/apis/design/resource_names#full_resource_name + # @!attribute [rw] display_name + # @return [::String] + # The human readable name of the resource. + # @!attribute [rw] type + # @return [::String] + # The full resource type of the resource. + # @!attribute [rw] cloud_provider + # @return [::Google::Cloud::SecurityCenter::V2::CloudProvider] + # Indicates which cloud provider the finding is from. + # @!attribute [rw] service + # @return [::String] + # The service or resource provider associated with the resource. + # @!attribute [rw] location + # @return [::String] + # The region or location of the service (if applicable). + # @!attribute [rw] gcp_metadata + # @return [::Google::Cloud::SecurityCenter::V2::GcpMetadata] + # The GCP metadata associated with the finding. + # + # Note: The following fields are mutually exclusive: `gcp_metadata`, `aws_metadata`, `azure_metadata`. If a field in that set is populated, all other fields in the set will automatically be cleared. + # @!attribute [rw] aws_metadata + # @return [::Google::Cloud::SecurityCenter::V2::AwsMetadata] + # The AWS metadata associated with the finding. + # + # Note: The following fields are mutually exclusive: `aws_metadata`, `gcp_metadata`, `azure_metadata`. If a field in that set is populated, all other fields in the set will automatically be cleared. + # @!attribute [rw] azure_metadata + # @return [::Google::Cloud::SecurityCenter::V2::AzureMetadata] + # The Azure metadata associated with the finding. + # + # Note: The following fields are mutually exclusive: `azure_metadata`, `gcp_metadata`, `aws_metadata`. If a field in that set is populated, all other fields in the set will automatically be cleared. + # @!attribute [rw] resource_path + # @return [::Google::Cloud::SecurityCenter::V2::ResourcePath] + # Provides the path to the resource within the resource hierarchy. + # @!attribute [rw] resource_path_string + # @return [::String] + # A string representation of the resource path. + # For Google Cloud, it has the format of + # `organizations/{organization_id}/folders/{folder_id}/folders/{folder_id}/projects/{project_id}` + # where there can be any number of folders. + # For AWS, it has the format of + # `org/{organization_id}/ou/{organizational_unit_id}/ou/{organizational_unit_id}/account/{account_id}` + # where there can be any number of organizational units. + # For Azure, it has the format of + # `mg/{management_group_id}/mg/{management_group_id}/subscription/{subscription_id}/rg/{resource_group_name}` + # where there can be any number of management groups. + class Resource + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Google Cloud metadata associated with the resource. Only applicable if the + # finding's cloud provider is Google Cloud. + # @!attribute [rw] project + # @return [::String] + # The full resource name of project that the resource belongs to. + # @!attribute [rw] project_display_name + # @return [::String] + # The project ID that the resource belongs to. + # @!attribute [rw] parent + # @return [::String] + # The full resource name of resource's parent. + # @!attribute [rw] parent_display_name + # @return [::String] + # The human readable name of resource's parent. + # @!attribute [r] folders + # @return [::Array<::Google::Cloud::SecurityCenter::V2::Folder>] + # Output only. Contains a Folder message for each folder in the assets + # ancestry. The first folder is the deepest nested folder, and the last + # folder is the folder directly under the Organization. + # @!attribute [rw] organization + # @return [::String] + # The name of the organization that the resource belongs to. + class GcpMetadata + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # AWS metadata associated with the resource, only applicable if the finding's + # cloud provider is Amazon Web Services. + # @!attribute [rw] organization + # @return [::Google::Cloud::SecurityCenter::V2::AwsMetadata::AwsOrganization] + # The AWS organization associated with the resource. + # @!attribute [rw] organizational_units + # @return [::Array<::Google::Cloud::SecurityCenter::V2::AwsMetadata::AwsOrganizationalUnit>] + # A list of AWS organizational units associated with the resource, ordered + # from lowest level (closest to the account) to highest level. + # @!attribute [rw] account + # @return [::Google::Cloud::SecurityCenter::V2::AwsMetadata::AwsAccount] + # The AWS account associated with the resource. + class AwsMetadata + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # An organization is a collection of accounts that are centrally managed + # together using consolidated billing, organized hierarchically with + # organizational units (OUs), and controlled with policies. + # @!attribute [rw] id + # @return [::String] + # The unique identifier (ID) for the organization. The regex pattern for an + # organization ID string requires "o-" followed by from 10 to 32 lowercase + # letters or digits. + class AwsOrganization + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # An Organizational Unit (OU) is a container of AWS accounts within a root of + # an organization. Policies that are attached to an OU apply to all accounts + # contained in that OU and in any child OUs. + # @!attribute [rw] id + # @return [::String] + # The unique identifier (ID) associated with this OU. The regex pattern for + # an organizational unit ID string requires "ou-" followed by from 4 to 32 + # lowercase letters or digits (the ID of the root that contains the OU). + # This string is followed by a second "-" dash and from 8 to 32 additional + # lowercase letters or digits. For example, "ou-ab12-cd34ef56". + # @!attribute [rw] name + # @return [::String] + # The friendly name of the OU. + class AwsOrganizationalUnit + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # An AWS account that is a member of an organization. + # @!attribute [rw] id + # @return [::String] + # The unique identifier (ID) of the account, containing exactly 12 digits. + # @!attribute [rw] name + # @return [::String] + # The friendly name of this account. + class AwsAccount + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end + + # Azure metadata associated with the resource, only applicable if the finding's + # cloud provider is Microsoft Azure. + # @!attribute [rw] management_groups + # @return [::Array<::Google::Cloud::SecurityCenter::V2::AzureMetadata::AzureManagementGroup>] + # A list of Azure management groups associated with the resource, ordered + # from lowest level (closest to the subscription) to highest level. + # @!attribute [rw] subscription + # @return [::Google::Cloud::SecurityCenter::V2::AzureMetadata::AzureSubscription] + # The Azure subscription associated with the resource. + # @!attribute [rw] resource_group + # @return [::Google::Cloud::SecurityCenter::V2::AzureMetadata::AzureResourceGroup] + # The Azure resource group associated with the resource. + # @!attribute [rw] tenant + # @return [::Google::Cloud::SecurityCenter::V2::AzureMetadata::AzureTenant] + # The Azure Entra tenant associated with the resource. + class AzureMetadata + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # Represents an Azure management group. + # @!attribute [rw] id + # @return [::String] + # The UUID of the Azure management group, for example, + # `20000000-0001-0000-0000-000000000000`. + # @!attribute [rw] display_name + # @return [::String] + # The display name of the Azure management group. + class AzureManagementGroup + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Represents an Azure subscription. + # @!attribute [rw] id + # @return [::String] + # The UUID of the Azure subscription, for example, + # `291bba3f-e0a5-47bc-a099-3bdcb2a50a05`. + # @!attribute [rw] display_name + # @return [::String] + # The display name of the Azure subscription. + class AzureSubscription + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Represents an Azure resource group. + # @!attribute [rw] id + # @return [::String] + # The ID of the Azure resource group. + # @!attribute [rw] name + # @return [::String] + # The name of the Azure resource group. This is not a UUID. + class AzureResourceGroup + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Represents a Microsoft Entra tenant. + # @!attribute [rw] id + # @return [::String] + # The ID of the Microsoft Entra tenant, for example, + # "a11aaa11-aa11-1aa1-11aa-1aaa11a". + # @!attribute [rw] display_name + # @return [::String] + # The display name of the Azure tenant. + class AzureTenant + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end + + # Represents the path of resources leading up to the resource this finding is + # about. + # @!attribute [rw] nodes + # @return [::Array<::Google::Cloud::SecurityCenter::V2::ResourcePath::ResourcePathNode>] + # The list of nodes that make the up resource path, ordered from lowest + # level to highest level. + class ResourcePath + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # A node within the resource path. Each node represents a resource within the + # resource hierarchy. + # @!attribute [rw] node_type + # @return [::Google::Cloud::SecurityCenter::V2::ResourcePath::ResourcePathNodeType] + # The type of resource this node represents. + # @!attribute [rw] id + # @return [::String] + # The ID of the resource this node represents. + # @!attribute [rw] display_name + # @return [::String] + # The display name of the resource this node represents. + class ResourcePathNode + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # The type of resource the node represents. + module ResourcePathNodeType + # Node type is unspecified. + RESOURCE_PATH_NODE_TYPE_UNSPECIFIED = 0 + + # The node represents a Google Cloud organization. + GCP_ORGANIZATION = 1 + + # The node represents a Google Cloud folder. + GCP_FOLDER = 2 + + # The node represents a Google Cloud project. + GCP_PROJECT = 3 + + # The node represents an AWS organization. + AWS_ORGANIZATION = 4 + + # The node represents an AWS organizational unit. + AWS_ORGANIZATIONAL_UNIT = 5 + + # The node represents an AWS account. + AWS_ACCOUNT = 6 + + # The node represents an Azure management group. + AZURE_MANAGEMENT_GROUP = 7 + + # The node represents an Azure subscription. + AZURE_SUBSCRIPTION = 8 + + # The node represents an Azure resource group. + AZURE_RESOURCE_GROUP = 9 + end + end + + # The cloud provider the finding pertains to. + module CloudProvider + # The cloud provider is unspecified. + CLOUD_PROVIDER_UNSPECIFIED = 0 + + # The cloud provider is Google Cloud. + GOOGLE_CLOUD_PLATFORM = 1 + + # The cloud provider is Amazon Web Services. + AMAZON_WEB_SERVICES = 2 + + # The cloud provider is Microsoft Azure. + MICROSOFT_AZURE = 3 + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-security_center-v2/proto_docs/google/cloud/securitycenter/v2/resource_value_config.rb b/owl-bot-staging/google-cloud-security_center-v2/proto_docs/google/cloud/securitycenter/v2/resource_value_config.rb new file mode 100644 index 000000000000..450e83f704b5 --- /dev/null +++ b/owl-bot-staging/google-cloud-security_center-v2/proto_docs/google/cloud/securitycenter/v2/resource_value_config.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 Cloud + module SecurityCenter + module V2 + # A resource value configuration (RVC) is a mapping configuration of user's + # resources to resource values. Used in Attack path simulations. + # @!attribute [rw] name + # @return [::String] + # Identifier. Name for the resource value configuration + # @!attribute [rw] resource_value + # @return [::Google::Cloud::SecurityCenter::V2::ResourceValue] + # Resource value level this expression represents + # Only required when there is no Sensitive Data Protection mapping in the + # request + # @!attribute [rw] tag_values + # @return [::Array<::String>] + # Tag values combined with `AND` to check against. + # For Google Cloud resources, they are tag value IDs in the form of + # "tagValues/123". Example: `[ "tagValues/123", "tagValues/456", + # "tagValues/789" ]` + # https://cloud.google.com/resource-manager/docs/tags/tags-creating-and-managing + # @!attribute [rw] resource_type + # @return [::String] + # Apply resource_value only to resources that match resource_type. + # resource_type will be checked with `AND` of other resources. + # For example, "storage.googleapis.com/Bucket" with resource_value "HIGH" + # will apply "HIGH" value only to "storage.googleapis.com/Bucket" resources. + # @!attribute [rw] scope + # @return [::String] + # Project or folder to scope this configuration to. + # For example, "project/456" would apply this configuration only to resources + # in "project/456" scope and will be checked with `AND` of other resources. + # @!attribute [rw] resource_labels_selector + # @return [::Google::Protobuf::Map{::String => ::String}] + # List of resource labels to search for, evaluated with `AND`. + # For example, "resource_labels_selector": \\{"key": "value", "env": "prod"} + # will match resources with labels "key": "value" `AND` "env": + # "prod" + # https://cloud.google.com/resource-manager/docs/creating-managing-labels + # @!attribute [rw] description + # @return [::String] + # Description of the resource value configuration. + # @!attribute [r] create_time + # @return [::Google::Protobuf::Timestamp] + # Output only. Timestamp this resource value configuration was created. + # @!attribute [r] update_time + # @return [::Google::Protobuf::Timestamp] + # Output only. Timestamp this resource value configuration was last updated. + # @!attribute [rw] cloud_provider + # @return [::Google::Cloud::SecurityCenter::V2::CloudProvider] + # Cloud provider this configuration applies to + # @!attribute [rw] sensitive_data_protection_mapping + # @return [::Google::Cloud::SecurityCenter::V2::ResourceValueConfig::SensitiveDataProtectionMapping] + # A mapping of the sensitivity on Sensitive Data Protection finding to + # resource values. This mapping can only be used in combination with a + # resource_type that is related to BigQuery, e.g. + # "bigquery.googleapis.com/Dataset". + class ResourceValueConfig + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # Resource value mapping for Sensitive Data Protection findings + # If any of these mappings have a resource value that is not unspecified, + # the resource_value field will be ignored when reading this configuration. + # @!attribute [rw] high_sensitivity_mapping + # @return [::Google::Cloud::SecurityCenter::V2::ResourceValue] + # Resource value mapping for high-sensitivity Sensitive Data Protection + # findings + # @!attribute [rw] medium_sensitivity_mapping + # @return [::Google::Cloud::SecurityCenter::V2::ResourceValue] + # Resource value mapping for medium-sensitivity Sensitive Data Protection + # findings + class SensitiveDataProtectionMapping + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # @!attribute [rw] key + # @return [::String] + # @!attribute [rw] value + # @return [::String] + class ResourceLabelsSelectorEntry + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end + + # Value enum to map to a resource + module ResourceValue + # Unspecific value + RESOURCE_VALUE_UNSPECIFIED = 0 + + # High resource value + HIGH = 1 + + # Medium resource value + MEDIUM = 2 + + # Low resource value + LOW = 3 + + # No resource value, e.g. ignore these resources + NONE = 4 + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-security_center-v2/proto_docs/google/cloud/securitycenter/v2/security_marks.rb b/owl-bot-staging/google-cloud-security_center-v2/proto_docs/google/cloud/securitycenter/v2/security_marks.rb new file mode 100644 index 000000000000..1e3bcc93a58a --- /dev/null +++ b/owl-bot-staging/google-cloud-security_center-v2/proto_docs/google/cloud/securitycenter/v2/security_marks.rb @@ -0,0 +1,84 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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 SecurityCenter + module V2 + # User specified security marks that are attached to the parent Security + # Command Center resource. Security marks are scoped within a Security Command + # Center organization -- they can be modified and viewed by all users who have + # proper permissions on the organization. + # @!attribute [rw] name + # @return [::String] + # The relative resource name of the SecurityMarks. See: + # https://cloud.google.com/apis/design/resource_names#relative_resource_name + # The following list shows some examples: + # + # + `organizations/{organization_id}/assets/{asset_id}/securityMarks` + # + + # `organizations/{organization_id}/sources/{source_id}/findings/{finding_id}/securityMarks` + # + + # `organizations/{organization_id}/sources/{source_id}/locations/{location}/findings/{finding_id}/securityMarks` + # @!attribute [rw] marks + # @return [::Google::Protobuf::Map{::String => ::String}] + # Mutable user specified security marks belonging to the parent resource. + # Constraints are as follows: + # + # * Keys and values are treated as case insensitive + # * Keys must be between 1 - 256 characters (inclusive) + # * Keys must be letters, numbers, underscores, or dashes + # * Values have leading and trailing whitespace trimmed, remaining + # characters must be between 1 - 4096 characters (inclusive) + # @!attribute [rw] canonical_name + # @return [::String] + # The canonical name of the marks. The following list shows some examples: + # + # + `organizations/{organization_id}/assets/{asset_id}/securityMarks` + # + + # `organizations/{organization_id}/sources/{source_id}/findings/{finding_id}/securityMarks` + # + + # `organizations/{organization_id}/sources/{source_id}/locations/{location}/findings/{finding_id}/securityMarks` + # + `folders/{folder_id}/assets/{asset_id}/securityMarks` + # + + # `folders/{folder_id}/sources/{source_id}/findings/{finding_id}/securityMarks` + # + + # `folders/{folder_id}/sources/{source_id}/locations/{location}/findings/{finding_id}/securityMarks` + # + `projects/{project_number}/assets/{asset_id}/securityMarks` + # + + # `projects/{project_number}/sources/{source_id}/findings/{finding_id}/securityMarks` + # + + # `projects/{project_number}/sources/{source_id}/locations/{location}/findings/{finding_id}/securityMarks` + class SecurityMarks + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # @!attribute [rw] key + # @return [::String] + # @!attribute [rw] value + # @return [::String] + class MarksEntry + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-security_center-v2/proto_docs/google/cloud/securitycenter/v2/security_posture.rb b/owl-bot-staging/google-cloud-security_center-v2/proto_docs/google/cloud/securitycenter/v2/security_posture.rb new file mode 100644 index 000000000000..3c2c9899fac1 --- /dev/null +++ b/owl-bot-staging/google-cloud-security_center-v2/proto_docs/google/cloud/securitycenter/v2/security_posture.rb @@ -0,0 +1,83 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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 SecurityCenter + module V2 + # Represents a posture that is deployed on Google Cloud by the + # Security Command Center Posture Management service. + # A posture contains one or more policy sets. A policy set is a + # group of policies that enforce a set of security rules on Google + # Cloud. + # @!attribute [rw] name + # @return [::String] + # Name of the posture, for example, `CIS-Posture`. + # @!attribute [rw] revision_id + # @return [::String] + # The version of the posture, for example, `c7cfa2a8`. + # @!attribute [rw] posture_deployment_resource + # @return [::String] + # The project, folder, or organization on which the posture is deployed, + # for example, `projects/{project_number}`. + # @!attribute [rw] posture_deployment + # @return [::String] + # The name of the posture deployment, for example, + # `organizations/{org_id}/posturedeployments/{posture_deployment_id}`. + # @!attribute [rw] changed_policy + # @return [::String] + # The name of the updated policy, for example, + # `projects/{project_id}/policies/{constraint_name}`. + # @!attribute [rw] policy_set + # @return [::String] + # The name of the updated policy set, for example, `cis-policyset`. + # @!attribute [rw] policy + # @return [::String] + # The ID of the updated policy, for example, `compute-policy-1`. + # @!attribute [rw] policy_drift_details + # @return [::Array<::Google::Cloud::SecurityCenter::V2::SecurityPosture::PolicyDriftDetails>] + # The details about a change in an updated policy that violates the deployed + # posture. + class SecurityPosture + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # The policy field that violates the deployed posture and its expected and + # detected values. + # @!attribute [rw] field + # @return [::String] + # The name of the updated field, for example + # constraint.implementation.policy_rules[0].enforce + # @!attribute [rw] expected_value + # @return [::String] + # The value of this field that was configured in a posture, for example, + # `true` or `allowed_values={"projects/29831892"}`. + # @!attribute [rw] detected_value + # @return [::String] + # The detected value that violates the deployed posture, for example, + # `false` or `allowed_values={"projects/22831892"}`. + class PolicyDriftDetails + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-security_center-v2/proto_docs/google/cloud/securitycenter/v2/securitycenter_service.rb b/owl-bot-staging/google-cloud-security_center-v2/proto_docs/google/cloud/securitycenter/v2/securitycenter_service.rb new file mode 100644 index 000000000000..5aa1b2607e39 --- /dev/null +++ b/owl-bot-staging/google-cloud-security_center-v2/proto_docs/google/cloud/securitycenter/v2/securitycenter_service.rb @@ -0,0 +1,1216 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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 SecurityCenter + module V2 + # Request message to create multiple resource value configs + # @!attribute [rw] parent + # @return [::String] + # Required. Resource name of the new ResourceValueConfig's parent. + # The parent field in the CreateResourceValueConfigRequest + # messages must either be empty or match this field. + # @!attribute [rw] requests + # @return [::Array<::Google::Cloud::SecurityCenter::V2::CreateResourceValueConfigRequest>] + # Required. The resource value configs to be created. + class BatchCreateResourceValueConfigsRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Response message for BatchCreateResourceValueConfigs + # @!attribute [rw] resource_value_configs + # @return [::Array<::Google::Cloud::SecurityCenter::V2::ResourceValueConfig>] + # The resource value configs created + class BatchCreateResourceValueConfigsResponse + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Request message for bulk findings update. + # + # Note: + # 1. If multiple bulk update requests match the same resource, the order in + # which they get executed is not defined. + # 2. Once a bulk operation is started, there is no way to stop it. + # @!attribute [rw] parent + # @return [::String] + # Required. The parent, at which bulk action needs to be applied. If no + # location is specified, findings are updated in global. The following list + # shows some examples: + # + # + `organizations/[organization_id]` + # + `organizations/[organization_id]/locations/[location_id]` + # + `folders/[folder_id]` + # + `folders/[folder_id]/locations/[location_id]` + # + `projects/[project_id]` + # + `projects/[project_id]/locations/[location_id]` + # @!attribute [rw] filter + # @return [::String] + # Expression that identifies findings that should be updated. + # The expression is a list of zero or more restrictions combined + # via logical operators `AND` and `OR`. Parentheses are supported, and `OR` + # has higher precedence than `AND`. + # + # Restrictions have the form ` ` and may have a + # `-` character in front of them to indicate negation. The fields map to + # those defined in the corresponding resource. + # + # The supported operators are: + # + # * `=` for all value types. + # * `>`, `<`, `>=`, `<=` for integer values. + # * `:`, meaning substring matching, for strings. + # + # The supported value types are: + # + # * string literals in quotes. + # * integer literals without quotes. + # * boolean literals `true` and `false` without quotes. + # @!attribute [rw] mute_state + # @return [::Google::Cloud::SecurityCenter::V2::BulkMuteFindingsRequest::MuteState] + # Optional. All findings matching the given filter will have their mute state + # set to this value. The default value is `MUTED`. Setting this to + # `UNDEFINED` will clear the mute state on all matching findings. + class BulkMuteFindingsRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # The mute state. + module MuteState + # Unused. + MUTE_STATE_UNSPECIFIED = 0 + + # Matching findings will be muted (default). + MUTED = 1 + + # Matching findings will have their mute state cleared. + UNDEFINED = 2 + end + end + + # The response to a BulkMute request. Contains the LRO information. + class BulkMuteFindingsResponse + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Request message for creating a BigQuery export. + # @!attribute [rw] parent + # @return [::String] + # Required. The name of the parent resource of the new BigQuery export. Its + # format is `organizations/[organization_id]/locations/[location_id]`, + # `folders/[folder_id]/locations/[location_id]`, or + # `projects/[project_id]/locations/[location_id]`. + # @!attribute [rw] big_query_export + # @return [::Google::Cloud::SecurityCenter::V2::BigQueryExport] + # Required. The BigQuery export being created. + # @!attribute [rw] big_query_export_id + # @return [::String] + # Required. Unique identifier provided by the client within the parent scope. + # It must consist of only lowercase letters, numbers, and hyphens, must start + # with a letter, must end with either a letter or a number, and must be 63 + # characters or less. + class CreateBigQueryExportRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Request message for creating a finding. + # @!attribute [rw] parent + # @return [::String] + # Required. Resource name of the new finding's parent. The following list + # shows some examples of the format: + # + + # `organizations/[organization_id]/sources/[source_id]` + # + + # `organizations/[organization_id]/sources/[source_id]/locations/[location_id]` + # @!attribute [rw] finding_id + # @return [::String] + # Required. Unique identifier provided by the client within the parent scope. + # It must be alphanumeric and less than or equal to 32 characters and + # greater than 0 characters in length. + # @!attribute [rw] finding + # @return [::Google::Cloud::SecurityCenter::V2::Finding] + # Required. The Finding being created. The name and security_marks will be + # ignored as they are both output only fields on this resource. + class CreateFindingRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Request message for creating a mute config. + # @!attribute [rw] parent + # @return [::String] + # Required. Resource name of the new mute configs's parent. Its format is + # `organizations/[organization_id]/locations/[location_id]`, + # `folders/[folder_id]/locations/[location_id]`, or + # `projects/[project_id]/locations/[location_id]`. + # @!attribute [rw] mute_config + # @return [::Google::Cloud::SecurityCenter::V2::MuteConfig] + # Required. The mute config being created. + # @!attribute [rw] mute_config_id + # @return [::String] + # Required. Unique identifier provided by the client within the parent scope. + # It must consist of only lowercase letters, numbers, and hyphens, must start + # with a letter, must end with either a letter or a number, and must be 63 + # characters or less. + class CreateMuteConfigRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Request message for creating a notification config. + # @!attribute [rw] parent + # @return [::String] + # Required. Resource name of the new notification config's parent. Its format + # is `organizations/[organization_id]/locations/[location_id]`, + # `folders/[folder_id]/locations/[location_id]`, or + # `projects/[project_id]/locations/[location_id]`. + # @!attribute [rw] config_id + # @return [::String] + # Required. + # Unique identifier provided by the client within the parent scope. + # It must be between 1 and 128 characters and contain alphanumeric + # characters, underscores, or hyphens only. + # @!attribute [rw] notification_config + # @return [::Google::Cloud::SecurityCenter::V2::NotificationConfig] + # Required. The notification config being created. The name and the service + # account will be ignored as they are both output only fields on this + # resource. + class CreateNotificationConfigRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Request message to create single resource value config + # @!attribute [rw] parent + # @return [::String] + # Required. Resource name of the new ResourceValueConfig's parent. + # @!attribute [rw] resource_value_config + # @return [::Google::Cloud::SecurityCenter::V2::ResourceValueConfig] + # Required. The resource value config being created. + class CreateResourceValueConfigRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Request message for creating a source. + # @!attribute [rw] parent + # @return [::String] + # Required. Resource name of the new source's parent. Its format should be + # `organizations/[organization_id]`. + # @!attribute [rw] source + # @return [::Google::Cloud::SecurityCenter::V2::Source] + # Required. The Source being created, only the display_name and description + # will be used. All other fields will be ignored. + class CreateSourceRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Request message for deleting a BigQuery export. + # @!attribute [rw] name + # @return [::String] + # Required. The name of the BigQuery export to delete. The following list + # shows some examples of the format: + # + # + + # `organizations/{organization}/locations/{location}/bigQueryExports/{export_id}` + # + `folders/{folder}/locations/{location}/bigQueryExports/{export_id}` + # + `projects/{project}/locations/{location}/bigQueryExports/{export_id}` + class DeleteBigQueryExportRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Request message for deleting a mute config. If no location is specified, + # default is global. + # @!attribute [rw] name + # @return [::String] + # Required. Name of the mute config to delete. The following list shows some + # examples of the format: + # + # + `organizations/{organization}/muteConfigs/{config_id}` + # + + # `organizations/{organization}/locations/{location}/muteConfigs/{config_id}` + # + `folders/{folder}/muteConfigs/{config_id}` + # + `folders/{folder}/locations/{location}/muteConfigs/{config_id}` + # + `projects/{project}/muteConfigs/{config_id}` + # + `projects/{project}/locations/{location}/muteConfigs/{config_id}` + class DeleteMuteConfigRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Request message for deleting a notification config. + # @!attribute [rw] name + # @return [::String] + # Required. Name of the notification config to delete. The following list + # shows some examples of the format: + # + # + + # `organizations/[organization_id]/locations/[location_id]/notificationConfigs/[config_id]` + # + + # `folders/[folder_id]/locations/[location_id]notificationConfigs/[config_id]` + # + + # `projects/[project_id]/locations/[location_id]notificationConfigs/[config_id]` + class DeleteNotificationConfigRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Request message to delete resource value config + # @!attribute [rw] name + # @return [::String] + # Required. Name of the ResourceValueConfig to delete + class DeleteResourceValueConfigRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # The destination big query dataset to export findings to. + # @!attribute [rw] dataset + # @return [::String] + # Required. The relative resource name of the destination dataset, in the + # form projects/\\{projectId}/datasets/\\{datasetId}. + class BigQueryDestination + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # The LRO metadata for a ExportFindings request. + # @!attribute [rw] export_start_time + # @return [::Google::Protobuf::Timestamp] + # Optional. Timestamp at which export was started + # @!attribute [rw] big_query_destination + # @return [::Google::Cloud::SecurityCenter::V2::BigQueryDestination] + # Required. The destination big query dataset to export findings to. + class ExportFindingsMetadata + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # The response to a ExportFindings request. Contains the LRO information. + class ExportFindingsResponse + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Request message for retrieving a BigQuery export. + # @!attribute [rw] name + # @return [::String] + # Required. Name of the BigQuery export to retrieve. The following list shows + # some examples of the format: + # + # + + # `organizations/{organization}/locations/{location}/bigQueryExports/{export_id}` + # + `folders/{folder}/locations/{location}/bigQueryExports/{export_id}` + # + `projects/{project}locations/{location}//bigQueryExports/{export_id}` + class GetBigQueryExportRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Request message for retrieving a mute config. If no location is specified, + # default is global. + # @!attribute [rw] name + # @return [::String] + # Required. Name of the mute config to retrieve. The following list shows + # some examples of the format: + # + # + `organizations/{organization}/muteConfigs/{config_id}` + # + + # `organizations/{organization}/locations/{location}/muteConfigs/{config_id}` + # + `folders/{folder}/muteConfigs/{config_id}` + # + `folders/{folder}/locations/{location}/muteConfigs/{config_id}` + # + `projects/{project}/muteConfigs/{config_id}` + # + `projects/{project}/locations/{location}/muteConfigs/{config_id}` + class GetMuteConfigRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Request message for getting a notification config. + # @!attribute [rw] name + # @return [::String] + # Required. Name of the notification config to get. The following list shows + # some examples of the format: + # + # + + # `organizations/[organization_id]/locations/[location_id]/notificationConfigs/[config_id]` + # + + # `folders/[folder_id]/locations/[location_id]/notificationConfigs/[config_id]` + # + + # `projects/[project_id]/locations/[location_id]/notificationConfigs/[config_id]` + class GetNotificationConfigRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Request message to get resource value config + # @!attribute [rw] name + # @return [::String] + # Required. Name of the resource value config to retrieve. Its format is + # organizations/\\{organization}/resourceValueConfigs/\\{config_id}. + class GetResourceValueConfigRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Request message for getting a source. + # @!attribute [rw] name + # @return [::String] + # Required. Relative resource name of the source. Its format is + # `organizations/[organization_id]/source/[source_id]`. + class GetSourceRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Request message for grouping by findings. + # @!attribute [rw] parent + # @return [::String] + # Required. Name of the source to groupBy. If no location is specified, + # finding is assumed to be in global. + # The following list shows some examples: + # + # + `organizations/[organization_id]/sources/[source_id]` + # + + # `organizations/[organization_id]/sources/[source_id]/locations/[location_id]` + # + `folders/[folder_id]/sources/[source_id]` + # + `folders/[folder_id]/sources/[source_id]/locations/[location_id]` + # + `projects/[project_id]/sources/[source_id]` + # + `projects/[project_id]/sources/[source_id]/locations/[location_id]` + # + # To groupBy across all sources provide a source_id of `-`. The following + # list shows some examples: + # + # + `organizations/{organization_id}/sources/-` + # + `organizations/{organization_id}/sources/-/locations/[location_id]` + # + `folders/{folder_id}/sources/-` + # + `folders/{folder_id}/sources/-/locations/[location_id]` + # + `projects/{project_id}/sources/-` + # + `projects/{project_id}/sources/-/locations/[location_id]` + # @!attribute [rw] filter + # @return [::String] + # Expression that defines the filter to apply across findings. + # The expression is a list of one or more restrictions combined via logical + # operators `AND` and `OR`. + # Parentheses are supported, and `OR` has higher precedence than `AND`. + # + # Restrictions have the form ` ` and may have a `-` + # character in front of them to indicate negation. Examples include: + # + # * name + # * security_marks.marks.marka + # + # The supported operators are: + # + # * `=` for all value types. + # * `>`, `<`, `>=`, `<=` for integer values. + # * `:`, meaning substring matching, for strings. + # + # The supported value types are: + # + # * string literals in quotes. + # * integer literals without quotes. + # * boolean literals `true` and `false` without quotes. + # + # The following field and operator combinations are supported: + # + # * name: `=` + # * parent: `=`, `:` + # * resource_name: `=`, `:` + # * state: `=`, `:` + # * category: `=`, `:` + # * external_uri: `=`, `:` + # * event_time: `=`, `>`, `<`, `>=`, `<=` + # + # Usage: This should be milliseconds since epoch or an RFC3339 string. + # Examples: + # `event_time = "2019-06-10T16:07:18-07:00"` + # `event_time = 1560208038000` + # + # * severity: `=`, `:` + # * security_marks.marks: `=`, `:` + # * resource: + # * resource.name: `=`, `:` + # * resource.parent_name: `=`, `:` + # * resource.parent_display_name: `=`, `:` + # * resource.project_name: `=`, `:` + # * resource.project_display_name: `=`, `:` + # * resource.type: `=`, `:` + # @!attribute [rw] group_by + # @return [::String] + # Required. Expression that defines what assets fields to use for grouping. + # The string value should follow SQL syntax: comma separated list of fields. + # For example: "parent,resource_name". + # @!attribute [rw] page_token + # @return [::String] + # The value returned by the last `GroupFindingsResponse`; indicates + # that this is a continuation of a prior `GroupFindings` call, and + # that the system should return the next page of data. + # @!attribute [rw] page_size + # @return [::Integer] + # The maximum number of results to return in a single response. Default is + # 10, minimum is 1, maximum is 1000. + class GroupFindingsRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Response message for group by findings. + # @!attribute [rw] group_by_results + # @return [::Array<::Google::Cloud::SecurityCenter::V2::GroupResult>] + # Group results. There exists an element for each existing unique + # combination of property/values. The element contains a count for the number + # of times those specific property/values appear. + # @!attribute [rw] next_page_token + # @return [::String] + # Token to retrieve the next page of results, or empty if there are no more + # results. + # @!attribute [rw] total_size + # @return [::Integer] + # The total number of results matching the query. + class GroupFindingsResponse + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Result containing the properties and count of a groupBy request. + # @!attribute [rw] properties + # @return [::Google::Protobuf::Map{::String => ::Google::Protobuf::Value}] + # Properties matching the groupBy fields in the request. + # @!attribute [rw] count + # @return [::Integer] + # Total count of resources for the given properties. + class GroupResult + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # @!attribute [rw] key + # @return [::String] + # @!attribute [rw] value + # @return [::Google::Protobuf::Value] + class PropertiesEntry + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end + + # Request message for listing the attack paths for a given simulation or valued + # resource. + # @!attribute [rw] parent + # @return [::String] + # Required. Name of parent to list attack paths. + # + # Valid formats: + # `organizations/{organization}`, + # `organizations/{organization}/simulations/{simulation}` + # `organizations/{organization}/simulations/{simulation}/attackExposureResults/{attack_exposure_result_v2}` + # `organizations/{organization}/simulations/{simulation}/valuedResources/{valued_resource}` + # @!attribute [rw] filter + # @return [::String] + # The filter expression that filters the attack path in the response. + # Supported fields: + # + # * `valued_resources` supports = + # @!attribute [rw] page_token + # @return [::String] + # The value returned by the last `ListAttackPathsResponse`; indicates + # that this is a continuation of a prior `ListAttackPaths` call, and + # that the system should return the next page of data. + # @!attribute [rw] page_size + # @return [::Integer] + # The maximum number of results to return in a single response. Default is + # 10, minimum is 1, maximum is 1000. + class ListAttackPathsRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Response message for listing the attack paths for a given simulation or + # valued resource. + # @!attribute [rw] attack_paths + # @return [::Array<::Google::Cloud::SecurityCenter::V2::AttackPath>] + # The attack paths that the attack path simulation identified. + # @!attribute [rw] next_page_token + # @return [::String] + # Token to retrieve the next page of results, or empty if there are no more + # results. + class ListAttackPathsResponse + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Request message for getting simulation. + # Simulation name can include "latest" to retrieve the latest simulation + # For example, "organizations/123/simulations/latest" + # @!attribute [rw] name + # @return [::String] + # Required. The organization name or simulation name of this simulation + # + # Valid format: + # `organizations/{organization}/simulations/latest` + # `organizations/{organization}/simulations/{simulation}` + class GetSimulationRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Request message for getting a valued resource. + # @!attribute [rw] name + # @return [::String] + # Required. The name of this valued resource + # + # Valid format: + # `organizations/{organization}/simulations/{simulation}/valuedResources/{valued_resource}` + class GetValuedResourceRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Request message for listing BigQuery exports at a given scope e.g. + # organization, folder or project. + # @!attribute [rw] parent + # @return [::String] + # Required. The parent, which owns the collection of BigQuery exports. Its + # format is `organizations/[organization_id]/locations/[location_id]`, + # `folders/[folder_id]/locations/[location_id]`, or + # `projects/[project_id]/locations/[location_id]`. + # @!attribute [rw] page_size + # @return [::Integer] + # The maximum number of configs to return. The service may return fewer than + # this value. + # If unspecified, at most 10 configs will be returned. + # The maximum value is 1000; values above 1000 will be coerced to 1000. + # @!attribute [rw] page_token + # @return [::String] + # A page token, received from a previous `ListBigQueryExports` call. + # Provide this to retrieve the subsequent page. + # When paginating, all other parameters provided to `ListBigQueryExports` + # must match the call that provided the page token. + class ListBigQueryExportsRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Response message for listing BigQuery exports. + # @!attribute [rw] big_query_exports + # @return [::Array<::Google::Cloud::SecurityCenter::V2::BigQueryExport>] + # The BigQuery exports from the specified parent. + # @!attribute [rw] next_page_token + # @return [::String] + # A token, which can be sent as `page_token` to retrieve the next page. + # If this field is omitted, there are no subsequent pages. + class ListBigQueryExportsResponse + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Request message for listing findings. + # @!attribute [rw] parent + # @return [::String] + # Required. Name of the source the findings belong to. If no location is + # specified, the default is global. The following list shows some examples: + # + # + `organizations/[organization_id]/sources/[source_id]` + # + + # `organizations/[organization_id]/sources/[source_id]/locations/[location_id]` + # + `folders/[folder_id]/sources/[source_id]` + # + `folders/[folder_id]/sources/[source_id]/locations/[location_id]` + # + `projects/[project_id]/sources/[source_id]` + # + `projects/[project_id]/sources/[source_id]/locations/[location_id]` + # + # To list across all sources provide a source_id of `-`. The following + # list shows some examples: + # + # + `organizations/{organization_id}/sources/-` + # + `organizations/{organization_id}/sources/-/locations/{location_id}` + # + `folders/{folder_id}/sources/-` + # + `folders/{folder_id}/sources/-locations/{location_id}` + # + `projects/{projects_id}/sources/-` + # + `projects/{projects_id}/sources/-/locations/{location_id}` + # @!attribute [rw] filter + # @return [::String] + # Expression that defines the filter to apply across findings. + # The expression is a list of one or more restrictions combined via logical + # operators `AND` and `OR`. + # Parentheses are supported, and `OR` has higher precedence than `AND`. + # + # Restrictions have the form ` ` and may have a `-` + # character in front of them to indicate negation. Examples include: + # + # * name + # * security_marks.marks.marka + # + # The supported operators are: + # + # * `=` for all value types. + # * `>`, `<`, `>=`, `<=` for integer values. + # * `:`, meaning substring matching, for strings. + # + # The supported value types are: + # + # * string literals in quotes. + # * integer literals without quotes. + # * boolean literals `true` and `false` without quotes. + # + # The following field and operator combinations are supported: + # + # * name: `=` + # * parent: `=`, `:` + # * resource_name: `=`, `:` + # * state: `=`, `:` + # * category: `=`, `:` + # * external_uri: `=`, `:` + # * event_time: `=`, `>`, `<`, `>=`, `<=` + # + # Usage: This should be milliseconds since epoch or an RFC3339 string. + # Examples: + # `event_time = "2019-06-10T16:07:18-07:00"` + # `event_time = 1560208038000` + # + # * severity: `=`, `:` + # * security_marks.marks: `=`, `:` + # * resource: + # * resource.name: `=`, `:` + # * resource.parent_name: `=`, `:` + # * resource.parent_display_name: `=`, `:` + # * resource.project_name: `=`, `:` + # * resource.project_display_name: `=`, `:` + # * resource.type: `=`, `:` + # * resource.folders.resource_folder: `=`, `:` + # * resource.display_name: `=`, `:` + # @!attribute [rw] order_by + # @return [::String] + # Expression that defines what fields and order to use for sorting. The + # string value should follow SQL syntax: comma separated list of fields. For + # example: "name,parent". The default sorting order + # is ascending. To specify descending order for a field, a suffix " desc" + # should be appended to the field name. For example: "name + # desc,parent". Redundant space characters in the + # syntax are insignificant. "name desc,parent" and " + # name desc , parent " are equivalent. + # + # The following fields are supported: + # name + # parent + # state + # category + # resource_name + # event_time + # security_marks.marks + # @!attribute [rw] field_mask + # @return [::Google::Protobuf::FieldMask] + # A field mask to specify the Finding fields to be listed in the response. + # An empty field mask will list all fields. + # @!attribute [rw] page_token + # @return [::String] + # The value returned by the last `ListFindingsResponse`; indicates + # that this is a continuation of a prior `ListFindings` call, and + # that the system should return the next page of data. + # @!attribute [rw] page_size + # @return [::Integer] + # The maximum number of results to return in a single response. Default is + # 10, minimum is 1, maximum is 1000. + class ListFindingsRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Response message for listing findings. + # @!attribute [rw] list_findings_results + # @return [::Array<::Google::Cloud::SecurityCenter::V2::ListFindingsResponse::ListFindingsResult>] + # Findings matching the list request. + # @!attribute [rw] next_page_token + # @return [::String] + # Token to retrieve the next page of results, or empty if there are no more + # results. + # @!attribute [rw] total_size + # @return [::Integer] + # The total number of findings matching the query. + class ListFindingsResponse + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # Result containing the Finding. + # @!attribute [rw] finding + # @return [::Google::Cloud::SecurityCenter::V2::Finding] + # Finding matching the search request. + # @!attribute [r] resource + # @return [::Google::Cloud::SecurityCenter::V2::ListFindingsResponse::ListFindingsResult::Resource] + # Output only. Resource that is associated with this finding. + class ListFindingsResult + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # Information related to the Google Cloud resource that is + # associated with this finding. + # @!attribute [rw] name + # @return [::String] + # The full resource name of the resource. See: + # https://cloud.google.com/apis/design/resource_names#full_resource_name + # @!attribute [rw] display_name + # @return [::String] + # The human readable name of the resource. + # @!attribute [rw] type + # @return [::String] + # The full resource type of the resource. + # @!attribute [rw] cloud_provider + # @return [::Google::Cloud::SecurityCenter::V2::CloudProvider] + # Indicates which cloud provider the finding is from. + # @!attribute [rw] service + # @return [::String] + # The service or resource provider associated with the resource. + # @!attribute [rw] location + # @return [::String] + # The region or location of the service (if applicable). + # @!attribute [rw] gcp_metadata + # @return [::Google::Cloud::SecurityCenter::V2::GcpMetadata] + # The GCP metadata associated with the finding. + # + # Note: The following fields are mutually exclusive: `gcp_metadata`, `aws_metadata`, `azure_metadata`. If a field in that set is populated, all other fields in the set will automatically be cleared. + # @!attribute [rw] aws_metadata + # @return [::Google::Cloud::SecurityCenter::V2::AwsMetadata] + # The AWS metadata associated with the finding. + # + # Note: The following fields are mutually exclusive: `aws_metadata`, `gcp_metadata`, `azure_metadata`. If a field in that set is populated, all other fields in the set will automatically be cleared. + # @!attribute [rw] azure_metadata + # @return [::Google::Cloud::SecurityCenter::V2::AzureMetadata] + # The Azure metadata associated with the finding. + # + # Note: The following fields are mutually exclusive: `azure_metadata`, `gcp_metadata`, `aws_metadata`. If a field in that set is populated, all other fields in the set will automatically be cleared. + # @!attribute [rw] resource_path + # @return [::Google::Cloud::SecurityCenter::V2::ResourcePath] + # Provides the path to the resource within the resource hierarchy. + # @!attribute [rw] resource_path_string + # @return [::String] + # A string representation of the resource path. + # For Google Cloud, it has the format of + # `organizations/{organization_id}/folders/{folder_id}/folders/{folder_id}/projects/{project_id}` + # where there can be any number of folders. + # For AWS, it has the format of + # `org/{organization_id}/ou/{organizational_unit_id}/ou/{organizational_unit_id}/account/{account_id}` + # where there can be any number of organizational units. + # For Azure, it has the format of + # `mg/{management_group_id}/mg/{management_group_id}/subscription/{subscription_id}/rg/{resource_group_name}` + # where there can be any number of management groups. + class Resource + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end + end + + # Request message for listing mute configs at a given scope e.g. organization, + # folder or project. If no location is specified, default is + # global. + # @!attribute [rw] parent + # @return [::String] + # Required. The parent, which owns the collection of mute configs. Its format + # is `organizations/[organization_id]", "folders/[folder_id]`, + # `projects/[project_id]`, + # `organizations/[organization_id]/locations/[location_id]`, + # `folders/[folder_id]/locations/[location_id]`, + # `projects/[project_id]/locations/[location_id]`. + # @!attribute [rw] page_size + # @return [::Integer] + # The maximum number of configs to return. The service may return fewer than + # this value. + # If unspecified, at most 10 configs will be returned. + # The maximum value is 1000; values above 1000 will be coerced to 1000. + # @!attribute [rw] page_token + # @return [::String] + # A page token, received from a previous `ListMuteConfigs` call. + # Provide this to retrieve the subsequent page. + # + # When paginating, all other parameters provided to `ListMuteConfigs` must + # match the call that provided the page token. + class ListMuteConfigsRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Response message for listing mute configs. + # @!attribute [rw] mute_configs + # @return [::Array<::Google::Cloud::SecurityCenter::V2::MuteConfig>] + # The mute configs from the specified parent. + # @!attribute [rw] next_page_token + # @return [::String] + # A token, which can be sent as `page_token` to retrieve the next page. + # If this field is omitted, there are no subsequent pages. + class ListMuteConfigsResponse + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Request message for listing notification configs. + # @!attribute [rw] parent + # @return [::String] + # Required. The name of the parent in which to list the notification + # configurations. Its format is + # "organizations/[organization_id]/locations/[location_id]", + # "folders/[folder_id]/locations/[location_id]", or + # "projects/[project_id]/locations/[location_id]". + # @!attribute [rw] page_token + # @return [::String] + # The value returned by the last `ListNotificationConfigsResponse`; indicates + # that this is a continuation of a prior `ListNotificationConfigs` call, and + # that the system should return the next page of data. + # @!attribute [rw] page_size + # @return [::Integer] + # The maximum number of results to return in a single response. Default is + # 10, minimum is 1, maximum is 1000. + class ListNotificationConfigsRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Response message for listing notification configs. + # @!attribute [rw] notification_configs + # @return [::Array<::Google::Cloud::SecurityCenter::V2::NotificationConfig>] + # Notification configs belonging to the requested parent. + # @!attribute [rw] next_page_token + # @return [::String] + # Token to retrieve the next page of results, or empty if there are no more + # results. + class ListNotificationConfigsResponse + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Request message to list resource value configs of a parent + # @!attribute [rw] parent + # @return [::String] + # Required. The parent, which owns the collection of resource value configs. + # Its format is + # `organizations/[organization_id]` + # @!attribute [rw] page_size + # @return [::Integer] + # The maximum number of configs to return. The service may return fewer than + # this value. + # If unspecified, at most 10 configs will be returned. + # The maximum value is 1000; values above 1000 will be coerced to 1000. + # @!attribute [rw] page_token + # @return [::String] + # A page token, received from a previous `ListResourceValueConfigs` call. + # Provide this to retrieve the subsequent page. + # + # When paginating, all other parameters provided to + # `ListResourceValueConfigs` must match the call that provided the + # page token. + # + # page_size can be specified, and the new page_size will be used. + class ListResourceValueConfigsRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Response message to list resource value configs + # @!attribute [rw] resource_value_configs + # @return [::Array<::Google::Cloud::SecurityCenter::V2::ResourceValueConfig>] + # The resource value configs from the specified parent. + # @!attribute [rw] next_page_token + # @return [::String] + # A token, which can be sent as `page_token` to retrieve the next page. + # If this field is empty, there are no subsequent pages. + class ListResourceValueConfigsResponse + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Request message for listing sources. + # @!attribute [rw] parent + # @return [::String] + # Required. Resource name of the parent of sources to list. Its format should + # be `organizations/[organization_id]`, `folders/[folder_id]`, or + # `projects/[project_id]`. + # @!attribute [rw] page_token + # @return [::String] + # The value returned by the last `ListSourcesResponse`; indicates + # that this is a continuation of a prior `ListSources` call, and + # that the system should return the next page of data. + # @!attribute [rw] page_size + # @return [::Integer] + # The maximum number of results to return in a single response. Default is + # 10, minimum is 1, maximum is 1000. + class ListSourcesRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Response message for listing sources. + # @!attribute [rw] sources + # @return [::Array<::Google::Cloud::SecurityCenter::V2::Source>] + # Sources belonging to the requested parent. + # @!attribute [rw] next_page_token + # @return [::String] + # Token to retrieve the next page of results, or empty if there are no more + # results. + class ListSourcesResponse + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Request message for listing the valued resources for a given simulation. + # @!attribute [rw] parent + # @return [::String] + # Required. Name of parent to list exposed resources. + # + # Valid formats: + # `organizations/{organization}`, + # `organizations/{organization}/simulations/{simulation}` + # `organizations/{organization}/simulations/{simulation}/attackExposureResults/{attack_exposure_result_v2}` + # @!attribute [rw] filter + # @return [::String] + # The filter expression that filters the valued resources in the response. + # Supported fields: + # + # * `resource_value` supports = + # * `resource_type` supports = + # @!attribute [rw] page_token + # @return [::String] + # The value returned by the last `ListValuedResourcesResponse`; indicates + # that this is a continuation of a prior `ListValuedResources` call, and + # that the system should return the next page of data. + # @!attribute [rw] page_size + # @return [::Integer] + # The maximum number of results to return in a single response. Default is + # 10, minimum is 1, maximum is 1000. + # @!attribute [rw] order_by + # @return [::String] + # Optional. The fields by which to order the valued resources response. + # + # Supported fields: + # + # * `exposed_score` + # + # * `resource_value` + # + # * `resource_type` + # + # Values should be a comma separated list of fields. For example: + # `exposed_score,resource_value`. + # + # The default sorting order is descending. To specify ascending or descending + # order for a field, append a " ASC" or a " DESC" suffix, respectively; for + # example: `exposed_score DESC`. + class ListValuedResourcesRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Response message for listing the valued resources for a given simulation. + # @!attribute [rw] valued_resources + # @return [::Array<::Google::Cloud::SecurityCenter::V2::ValuedResource>] + # The valued resources that the attack path simulation identified. + # @!attribute [rw] next_page_token + # @return [::String] + # Token to retrieve the next page of results, or empty if there are no more + # results. + # @!attribute [rw] total_size + # @return [::Integer] + # The estimated total number of results matching the query. + class ListValuedResourcesResponse + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Request message for updating a finding's state. + # @!attribute [rw] name + # @return [::String] + # Required. The [relative resource + # name](https://cloud.google.com/apis/design/resource_names#relative_resource_name) + # of the finding. If no location is specified, finding is assumed to be in + # global. The following list shows some examples: + # + # + + # `organizations/{organization_id}/sources/{source_id}/findings/{finding_id}` + # + + # `organizations/{organization_id}/sources/{source_id}/locations/{location_id}/findings/{finding_id}` + # + `folders/{folder_id}/sources/{source_id}/findings/{finding_id}` + # + + # `folders/{folder_id}/sources/{source_id}/locations/{location_id}/findings/{finding_id}` + # + `projects/{project_id}/sources/{source_id}/findings/{finding_id}` + # + + # `projects/{project_id}/sources/{source_id}/locations/{location_id}/findings/{finding_id}` + # @!attribute [rw] state + # @return [::Google::Cloud::SecurityCenter::V2::Finding::State] + # Required. The desired State of the finding. + class SetFindingStateRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Request message for updating a finding's mute status. + # @!attribute [rw] name + # @return [::String] + # Required. The [relative resource + # name](https://cloud.google.com/apis/design/resource_names#relative_resource_name) + # of the finding. If no location is specified, finding is assumed to be in + # global. The following list shows some examples: + # + # + + # `organizations/{organization_id}/sources/{source_id}/findings/{finding_id}` + # + + # `organizations/{organization_id}/sources/{source_id}/locations/{location_id}/findings/{finding_id}` + # + `folders/{folder_id}/sources/{source_id}/findings/{finding_id}` + # + + # `folders/{folder_id}/sources/{source_id}/locations/{location_id}/findings/{finding_id}` + # + `projects/{project_id}/sources/{source_id}/findings/{finding_id}` + # + + # `projects/{project_id}/sources/{source_id}/locations/{location_id}/findings/{finding_id}` + # @!attribute [rw] mute + # @return [::Google::Cloud::SecurityCenter::V2::Finding::Mute] + # Required. The desired state of the Mute. + class SetMuteRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Request message for updating a BigQuery export. + # @!attribute [rw] big_query_export + # @return [::Google::Cloud::SecurityCenter::V2::BigQueryExport] + # Required. The BigQuery export being updated. + # @!attribute [rw] update_mask + # @return [::Google::Protobuf::FieldMask] + # The list of fields to be updated. + # If empty all mutable fields will be updated. + class UpdateBigQueryExportRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Request message for updating a ExternalSystem resource. + # @!attribute [rw] external_system + # @return [::Google::Cloud::SecurityCenter::V2::ExternalSystem] + # Required. The external system resource to update. + # @!attribute [rw] update_mask + # @return [::Google::Protobuf::FieldMask] + # The FieldMask to use when updating the external system resource. + # + # If empty all mutable fields will be updated. + class UpdateExternalSystemRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Request message for updating or creating a finding. + # @!attribute [rw] finding + # @return [::Google::Cloud::SecurityCenter::V2::Finding] + # Required. The finding resource to update or create if it does not already + # exist. parent, security_marks, and update_time will be ignored. + # + # In the case of creation, the finding id portion of the name must be + # alphanumeric and less than or equal to 32 characters and greater than 0 + # characters in length. + # @!attribute [rw] update_mask + # @return [::Google::Protobuf::FieldMask] + # The FieldMask to use when updating the finding resource. This field should + # not be specified when creating a finding. + # + # When updating a finding, an empty mask is treated as updating all mutable + # fields and replacing source_properties. Individual source_properties can + # be added/updated by using "source_properties." in the field + # mask. + class UpdateFindingRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Request message for updating a mute config. + # @!attribute [rw] mute_config + # @return [::Google::Cloud::SecurityCenter::V2::MuteConfig] + # Required. The mute config being updated. + # @!attribute [rw] update_mask + # @return [::Google::Protobuf::FieldMask] + # The list of fields to be updated. + # If empty all mutable fields will be updated. + class UpdateMuteConfigRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Request message for updating a notification config. + # @!attribute [rw] notification_config + # @return [::Google::Cloud::SecurityCenter::V2::NotificationConfig] + # Required. The notification config to update. + # @!attribute [rw] update_mask + # @return [::Google::Protobuf::FieldMask] + # The FieldMask to use when updating the notification config. + # + # If empty all mutable fields will be updated. + class UpdateNotificationConfigRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Request message to update resource value config + # @!attribute [rw] resource_value_config + # @return [::Google::Cloud::SecurityCenter::V2::ResourceValueConfig] + # Required. The resource value config being updated. + # @!attribute [rw] update_mask + # @return [::Google::Protobuf::FieldMask] + # The list of fields to be updated. + # If empty all mutable fields will be updated. + # + # To update nested fields, include the top level field in the mask + # For example, to update gcp_metadata.resource_type, include the + # "gcp_metadata" field mask + class UpdateResourceValueConfigRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Request message for updating a SecurityMarks resource. + # @!attribute [rw] security_marks + # @return [::Google::Cloud::SecurityCenter::V2::SecurityMarks] + # Required. The security marks resource to update. + # @!attribute [rw] update_mask + # @return [::Google::Protobuf::FieldMask] + # The FieldMask to use when updating the security marks resource. + # + # The field mask must not contain duplicate fields. + # If empty or set to "marks", all marks will be replaced. Individual + # marks can be updated using "marks.". + class UpdateSecurityMarksRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Request message for updating a source. + # @!attribute [rw] source + # @return [::Google::Cloud::SecurityCenter::V2::Source] + # Required. The source resource to update. + # @!attribute [rw] update_mask + # @return [::Google::Protobuf::FieldMask] + # The FieldMask to use when updating the source resource. + # + # If empty all mutable fields will be updated. + class UpdateSourceRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-security_center-v2/proto_docs/google/cloud/securitycenter/v2/simulation.rb b/owl-bot-staging/google-cloud-security_center-v2/proto_docs/google/cloud/securitycenter/v2/simulation.rb new file mode 100644 index 000000000000..05bb5af8f001 --- /dev/null +++ b/owl-bot-staging/google-cloud-security_center-v2/proto_docs/google/cloud/securitycenter/v2/simulation.rb @@ -0,0 +1,46 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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 SecurityCenter + module V2 + # Attack path simulation + # @!attribute [rw] name + # @return [::String] + # Full resource name of the Simulation: + # `organizations/123/simulations/456` + # @!attribute [r] create_time + # @return [::Google::Protobuf::Timestamp] + # Output only. Time simulation was created + # @!attribute [rw] resource_value_configs_metadata + # @return [::Array<::Google::Cloud::SecurityCenter::V2::ResourceValueConfigMetadata>] + # Resource value configurations' metadata used in this simulation. Maximum of + # 100. + # @!attribute [rw] cloud_provider + # @return [::Google::Cloud::SecurityCenter::V2::CloudProvider] + # Indicates which cloud provider was used in this simulation. + class Simulation + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-security_center-v2/proto_docs/google/cloud/securitycenter/v2/source.rb b/owl-bot-staging/google-cloud-security_center-v2/proto_docs/google/cloud/securitycenter/v2/source.rb new file mode 100644 index 000000000000..27dd5626b0cf --- /dev/null +++ b/owl-bot-staging/google-cloud-security_center-v2/proto_docs/google/cloud/securitycenter/v2/source.rb @@ -0,0 +1,65 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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 SecurityCenter + module V2 + # Security Command Center finding source. A finding source + # is an entity or a mechanism that can produce a finding. A source is like a + # container of findings that come from the same scanner, logger, monitor, and + # other tools. + # @!attribute [rw] name + # @return [::String] + # The relative resource name of this source. See: + # https://cloud.google.com/apis/design/resource_names#relative_resource_name + # Example: + # "organizations/\\{organization_id}/sources/\\{source_id}" + # @!attribute [rw] display_name + # @return [::String] + # The source's display name. + # A source's display name must be unique amongst its siblings, for example, + # two sources with the same parent can't share the same display name. + # The display name must have a length between 1 and 64 characters + # (inclusive). + # @!attribute [rw] description + # @return [::String] + # The description of the source (max of 1024 characters). + # Example: + # "Web Security Scanner is a web security scanner for common + # vulnerabilities in App Engine applications. It can automatically + # scan and detect four common vulnerabilities, including cross-site-scripting + # (XSS), Flash injection, mixed content (HTTP in HTTPS), and + # outdated or insecure libraries." + # @!attribute [rw] canonical_name + # @return [::String] + # The canonical name of the finding source. It's either + # "organizations/\\{organization_id}/sources/\\{source_id}", + # "folders/\\{folder_id}/sources/\\{source_id}", or + # "projects/\\{project_number}/sources/\\{source_id}", + # depending on the closest CRM ancestor of the resource associated with the + # finding. + class Source + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-security_center-v2/proto_docs/google/cloud/securitycenter/v2/toxic_combination.rb b/owl-bot-staging/google-cloud-security_center-v2/proto_docs/google/cloud/securitycenter/v2/toxic_combination.rb new file mode 100644 index 000000000000..dff76d98c704 --- /dev/null +++ b/owl-bot-staging/google-cloud-security_center-v2/proto_docs/google/cloud/securitycenter/v2/toxic_combination.rb @@ -0,0 +1,46 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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 SecurityCenter + module V2 + # Contains details about a group of security issues that, when the issues + # occur together, represent a greater risk than when the issues occur + # independently. A group of such issues is referred to as a toxic + # combination. + # @!attribute [rw] attack_exposure_score + # @return [::Float] + # The + # [Attack exposure + # score](https://cloud.google.com/security-command-center/docs/attack-exposure-learn#attack_exposure_scores) + # of this toxic combination. The score is a measure of how much this toxic + # combination exposes one or more high-value resources to potential attack. + # @!attribute [rw] related_findings + # @return [::Array<::String>] + # List of resource names of findings associated with this toxic combination. + # For example, `organizations/123/sources/456/findings/789`. + class ToxicCombination + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-security_center-v2/proto_docs/google/cloud/securitycenter/v2/valued_resource.rb b/owl-bot-staging/google-cloud-security_center-v2/proto_docs/google/cloud/securitycenter/v2/valued_resource.rb new file mode 100644 index 000000000000..e97a21960308 --- /dev/null +++ b/owl-bot-staging/google-cloud-security_center-v2/proto_docs/google/cloud/securitycenter/v2/valued_resource.rb @@ -0,0 +1,86 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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 SecurityCenter + module V2 + # A resource that is determined to have value to a user's system + # @!attribute [rw] name + # @return [::String] + # Valued resource name, for example, + # e.g.: + # `organizations/123/simulations/456/valuedResources/789` + # @!attribute [rw] resource + # @return [::String] + # The + # [full resource + # name](https://cloud.google.com/apis/design/resource_names#full_resource_name) + # of the valued resource. + # @!attribute [rw] resource_type + # @return [::String] + # The [resource + # type](https://cloud.google.com/asset-inventory/docs/supported-asset-types) + # of the valued resource. + # @!attribute [rw] display_name + # @return [::String] + # Human-readable name of the valued resource. + # @!attribute [rw] resource_value + # @return [::Google::Cloud::SecurityCenter::V2::ValuedResource::ResourceValue] + # How valuable this resource is. + # @!attribute [rw] exposed_score + # @return [::Float] + # Exposed score for this valued resource. A value of 0 means no exposure was + # detected exposure. + # @!attribute [rw] resource_value_configs_used + # @return [::Array<::Google::Cloud::SecurityCenter::V2::ResourceValueConfigMetadata>] + # List of resource value configurations' metadata used to determine the value + # of this resource. Maximum of 100. + class ValuedResource + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # How valuable the resource is. + module ResourceValue + # The resource value isn't specified. + RESOURCE_VALUE_UNSPECIFIED = 0 + + # This is a low-value resource. + RESOURCE_VALUE_LOW = 1 + + # This is a medium-value resource. + RESOURCE_VALUE_MEDIUM = 2 + + # This is a high-value resource. + RESOURCE_VALUE_HIGH = 3 + end + end + + # Metadata about a ResourceValueConfig. For example, id and name. + # @!attribute [rw] name + # @return [::String] + # Resource value config name + class ResourceValueConfigMetadata + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-security_center-v2/proto_docs/google/cloud/securitycenter/v2/vertex_ai.rb b/owl-bot-staging/google-cloud-security_center-v2/proto_docs/google/cloud/securitycenter/v2/vertex_ai.rb new file mode 100644 index 000000000000..f11b0348de0a --- /dev/null +++ b/owl-bot-staging/google-cloud-security_center-v2/proto_docs/google/cloud/securitycenter/v2/vertex_ai.rb @@ -0,0 +1,68 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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 SecurityCenter + module V2 + # Vertex AI-related information associated with the finding. + # @!attribute [rw] datasets + # @return [::Array<::Google::Cloud::SecurityCenter::V2::VertexAi::Dataset>] + # Datasets associated with the finding. + # @!attribute [rw] pipelines + # @return [::Array<::Google::Cloud::SecurityCenter::V2::VertexAi::Pipeline>] + # Pipelines associated with the finding. + class VertexAi + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # Vertex AI dataset associated with the finding. + # @!attribute [rw] name + # @return [::String] + # Resource name of the dataset, e.g. + # projects/\\{project}/locations/\\{location}/datasets/2094040236064505856 + # @!attribute [rw] display_name + # @return [::String] + # The user defined display name of dataset, e.g. plants-dataset + # @!attribute [rw] source + # @return [::String] + # Data source, such as a BigQuery source URI, e.g. + # bq://scc-nexus-test.AIPPtest.gsod + class Dataset + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Vertex AI training pipeline associated with the finding. + # @!attribute [rw] name + # @return [::String] + # Resource name of the pipeline, e.g. + # projects/\\{project}/locations/\\{location}/trainingPipelines/5253428229225578496 + # @!attribute [rw] display_name + # @return [::String] + # The user-defined display name of pipeline, e.g. plants-classification + class Pipeline + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-security_center-v2/proto_docs/google/cloud/securitycenter/v2/vulnerability.rb b/owl-bot-staging/google-cloud-security_center-v2/proto_docs/google/cloud/securitycenter/v2/vulnerability.rb new file mode 100644 index 000000000000..41c3a3589f1d --- /dev/null +++ b/owl-bot-staging/google-cloud-security_center-v2/proto_docs/google/cloud/securitycenter/v2/vulnerability.rb @@ -0,0 +1,365 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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 SecurityCenter + module V2 + # Refers to common vulnerability fields e.g. cve, cvss, cwe etc. + # @!attribute [rw] cve + # @return [::Google::Cloud::SecurityCenter::V2::Cve] + # CVE stands for Common Vulnerabilities and Exposures + # (https://cve.mitre.org/about/) + # @!attribute [rw] offending_package + # @return [::Google::Cloud::SecurityCenter::V2::Package] + # The offending package is relevant to the finding. + # @!attribute [rw] fixed_package + # @return [::Google::Cloud::SecurityCenter::V2::Package] + # The fixed package is relevant to the finding. + # @!attribute [rw] security_bulletin + # @return [::Google::Cloud::SecurityCenter::V2::SecurityBulletin] + # The security bulletin is relevant to this finding. + # @!attribute [rw] provider_risk_score + # @return [::Integer] + # Provider provided risk_score based on multiple factors. The higher the risk + # score, the more risky the vulnerability is. + # @!attribute [rw] reachable + # @return [::Boolean] + # Represents whether the vulnerability is reachable (detected via static + # analysis) + # @!attribute [rw] cwes + # @return [::Array<::Google::Cloud::SecurityCenter::V2::Cwe>] + # Represents one or more Common Weakness Enumeration (CWE) information on + # this vulnerability. + class Vulnerability + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # CVE stands for Common Vulnerabilities and Exposures. + # Information from the [CVE + # record](https://www.cve.org/ResourcesSupport/Glossary) that describes this + # vulnerability. + # @!attribute [rw] id + # @return [::String] + # The unique identifier for the vulnerability. e.g. CVE-2021-34527 + # @!attribute [rw] references + # @return [::Array<::Google::Cloud::SecurityCenter::V2::Reference>] + # Additional information about the CVE. + # e.g. https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2021-34527 + # @!attribute [rw] cvssv3 + # @return [::Google::Cloud::SecurityCenter::V2::Cvssv3] + # Describe Common Vulnerability Scoring System specified at + # https://www.first.org/cvss/v3.1/specification-document + # @!attribute [rw] upstream_fix_available + # @return [::Boolean] + # Whether upstream fix is available for the CVE. + # @!attribute [rw] impact + # @return [::Google::Cloud::SecurityCenter::V2::Cve::RiskRating] + # The potential impact of the vulnerability if it was to be exploited. + # @!attribute [rw] exploitation_activity + # @return [::Google::Cloud::SecurityCenter::V2::Cve::ExploitationActivity] + # The exploitation activity of the vulnerability in the wild. + # @!attribute [rw] observed_in_the_wild + # @return [::Boolean] + # Whether or not the vulnerability has been observed in the wild. + # @!attribute [rw] zero_day + # @return [::Boolean] + # Whether or not the vulnerability was zero day when the finding was + # published. + # @!attribute [rw] exploit_release_date + # @return [::Google::Protobuf::Timestamp] + # Date the first publicly available exploit or PoC was released. + # @!attribute [rw] first_exploitation_date + # @return [::Google::Protobuf::Timestamp] + # Date of the earliest known exploitation. + class Cve + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # The possible values of impact of the vulnerability if it was to be + # exploited. + module RiskRating + # Invalid or empty value. + RISK_RATING_UNSPECIFIED = 0 + + # Exploitation would have little to no security impact. + LOW = 1 + + # Exploitation would enable attackers to perform activities, or could allow + # attackers to have a direct impact, but would require additional steps. + MEDIUM = 2 + + # Exploitation would enable attackers to have a notable direct impact + # without needing to overcome any major mitigating factors. + HIGH = 3 + + # Exploitation would fundamentally undermine the security of affected + # systems, enable actors to perform significant attacks with minimal + # effort, with little to no mitigating factors to overcome. + CRITICAL = 4 + end + + # The possible values of exploitation activity of the vulnerability in the + # wild. + module ExploitationActivity + # Invalid or empty value. + EXPLOITATION_ACTIVITY_UNSPECIFIED = 0 + + # Exploitation has been reported or confirmed to widely occur. + WIDE = 1 + + # Limited reported or confirmed exploitation activities. + CONFIRMED = 2 + + # Exploit is publicly available. + AVAILABLE = 3 + + # No known exploitation activity, but has a high potential for + # exploitation. + ANTICIPATED = 4 + + # No known exploitation activity. + NO_KNOWN = 5 + end + end + + # Additional Links + # @!attribute [rw] source + # @return [::String] + # Source of the reference e.g. NVD + # @!attribute [rw] uri + # @return [::String] + # Uri for the mentioned source e.g. + # https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2021-34527. + class Reference + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Common Vulnerability Scoring System version 3. + # @!attribute [rw] base_score + # @return [::Float] + # The base score is a function of the base metric scores. + # @!attribute [rw] attack_vector + # @return [::Google::Cloud::SecurityCenter::V2::Cvssv3::AttackVector] + # Base Metrics + # Represents the intrinsic characteristics of a vulnerability that are + # constant over time and across user environments. + # This metric reflects the context by which vulnerability exploitation is + # possible. + # @!attribute [rw] attack_complexity + # @return [::Google::Cloud::SecurityCenter::V2::Cvssv3::AttackComplexity] + # This metric describes the conditions beyond the attacker's control that + # must exist in order to exploit the vulnerability. + # @!attribute [rw] privileges_required + # @return [::Google::Cloud::SecurityCenter::V2::Cvssv3::PrivilegesRequired] + # This metric describes the level of privileges an attacker must possess + # before successfully exploiting the vulnerability. + # @!attribute [rw] user_interaction + # @return [::Google::Cloud::SecurityCenter::V2::Cvssv3::UserInteraction] + # This metric captures the requirement for a human user, other than the + # attacker, to participate in the successful compromise of the vulnerable + # component. + # @!attribute [rw] scope + # @return [::Google::Cloud::SecurityCenter::V2::Cvssv3::Scope] + # The Scope metric captures whether a vulnerability in one vulnerable + # component impacts resources in components beyond its security scope. + # @!attribute [rw] confidentiality_impact + # @return [::Google::Cloud::SecurityCenter::V2::Cvssv3::Impact] + # This metric measures the impact to the confidentiality of the information + # resources managed by a software component due to a successfully exploited + # vulnerability. + # @!attribute [rw] integrity_impact + # @return [::Google::Cloud::SecurityCenter::V2::Cvssv3::Impact] + # This metric measures the impact to integrity of a successfully exploited + # vulnerability. + # @!attribute [rw] availability_impact + # @return [::Google::Cloud::SecurityCenter::V2::Cvssv3::Impact] + # This metric measures the impact to the availability of the impacted + # component resulting from a successfully exploited vulnerability. + class Cvssv3 + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # This metric reflects the context by which vulnerability exploitation is + # possible. + module AttackVector + # Invalid value. + ATTACK_VECTOR_UNSPECIFIED = 0 + + # The vulnerable component is bound to the network stack and the set of + # possible attackers extends beyond the other options listed below, up to + # and including the entire Internet. + ATTACK_VECTOR_NETWORK = 1 + + # The vulnerable component is bound to the network stack, but the attack is + # limited at the protocol level to a logically adjacent topology. + ATTACK_VECTOR_ADJACENT = 2 + + # The vulnerable component is not bound to the network stack and the + # attacker's path is via read/write/execute capabilities. + ATTACK_VECTOR_LOCAL = 3 + + # The attack requires the attacker to physically touch or manipulate the + # vulnerable component. + ATTACK_VECTOR_PHYSICAL = 4 + end + + # This metric describes the conditions beyond the attacker's control that + # must exist in order to exploit the vulnerability. + module AttackComplexity + # Invalid value. + ATTACK_COMPLEXITY_UNSPECIFIED = 0 + + # Specialized access conditions or extenuating circumstances do not exist. + # An attacker can expect repeatable success when attacking the vulnerable + # component. + ATTACK_COMPLEXITY_LOW = 1 + + # A successful attack depends on conditions beyond the attacker's control. + # That is, a successful attack cannot be accomplished at will, but requires + # the attacker to invest in some measurable amount of effort in preparation + # or execution against the vulnerable component before a successful attack + # can be expected. + ATTACK_COMPLEXITY_HIGH = 2 + end + + # This metric describes the level of privileges an attacker must possess + # before successfully exploiting the vulnerability. + module PrivilegesRequired + # Invalid value. + PRIVILEGES_REQUIRED_UNSPECIFIED = 0 + + # The attacker is unauthorized prior to attack, and therefore does not + # require any access to settings or files of the vulnerable system to + # carry out an attack. + PRIVILEGES_REQUIRED_NONE = 1 + + # The attacker requires privileges that provide basic user capabilities + # that could normally affect only settings and files owned by a user. + # Alternatively, an attacker with Low privileges has the ability to access + # only non-sensitive resources. + PRIVILEGES_REQUIRED_LOW = 2 + + # The attacker requires privileges that provide significant (e.g., + # administrative) control over the vulnerable component allowing access to + # component-wide settings and files. + PRIVILEGES_REQUIRED_HIGH = 3 + end + + # This metric captures the requirement for a human user, other than the + # attacker, to participate in the successful compromise of the vulnerable + # component. + module UserInteraction + # Invalid value. + USER_INTERACTION_UNSPECIFIED = 0 + + # The vulnerable system can be exploited without interaction from any user. + USER_INTERACTION_NONE = 1 + + # Successful exploitation of this vulnerability requires a user to take + # some action before the vulnerability can be exploited. + USER_INTERACTION_REQUIRED = 2 + end + + # The Scope metric captures whether a vulnerability in one vulnerable + # component impacts resources in components beyond its security scope. + module Scope + # Invalid value. + SCOPE_UNSPECIFIED = 0 + + # An exploited vulnerability can only affect resources managed by the same + # security authority. + SCOPE_UNCHANGED = 1 + + # An exploited vulnerability can affect resources beyond the security scope + # managed by the security authority of the vulnerable component. + SCOPE_CHANGED = 2 + end + + # The Impact metrics capture the effects of a successfully exploited + # vulnerability on the component that suffers the worst outcome that is most + # directly and predictably associated with the attack. + module Impact + # Invalid value. + IMPACT_UNSPECIFIED = 0 + + # High impact. + IMPACT_HIGH = 1 + + # Low impact. + IMPACT_LOW = 2 + + # No impact. + IMPACT_NONE = 3 + end + end + + # Package is a generic definition of a package. + # @!attribute [rw] package_name + # @return [::String] + # The name of the package where the vulnerability was detected. + # @!attribute [rw] cpe_uri + # @return [::String] + # The CPE URI where the vulnerability was detected. + # @!attribute [rw] package_type + # @return [::String] + # Type of package, for example, os, maven, or go. + # @!attribute [rw] package_version + # @return [::String] + # The version of the package. + class Package + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # SecurityBulletin are notifications of vulnerabilities of Google products. + # @!attribute [rw] bulletin_id + # @return [::String] + # ID of the bulletin corresponding to the vulnerability. + # @!attribute [rw] submission_time + # @return [::Google::Protobuf::Timestamp] + # Submission time of this Security Bulletin. + # @!attribute [rw] suggested_upgrade_version + # @return [::String] + # This represents a version that the cluster receiving this notification + # should be upgraded to, based on its current version. For example, 1.15.0 + class SecurityBulletin + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # CWE stands for Common Weakness Enumeration. Information about this weakness, + # as described by [CWE](https://cwe.mitre.org/). + # @!attribute [rw] id + # @return [::String] + # The CWE identifier, e.g. CWE-94 + # @!attribute [rw] references + # @return [::Array<::Google::Cloud::SecurityCenter::V2::Reference>] + # Any reference to the details on the CWE, for example, + # https://cwe.mitre.org/data/definitions/94.html + class Cwe + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-security_center-v2/proto_docs/google/iam/v1/iam_policy.rb b/owl-bot-staging/google-cloud-security_center-v2/proto_docs/google/iam/v1/iam_policy.rb new file mode 100644 index 000000000000..5445c77f8258 --- /dev/null +++ b/owl-bot-staging/google-cloud-security_center-v2/proto_docs/google/iam/v1/iam_policy.rb @@ -0,0 +1,87 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + + +module Google + module Iam + module V1 + # Request message for `SetIamPolicy` method. + # @!attribute [rw] resource + # @return [::String] + # REQUIRED: The resource for which the policy is being specified. + # See the operation documentation for the appropriate value for this field. + # @!attribute [rw] policy + # @return [::Google::Iam::V1::Policy] + # REQUIRED: The complete policy to be applied to the `resource`. The size of + # the policy is limited to a few 10s of KB. An empty policy is a + # valid policy but certain Cloud Platform services (such as Projects) + # might reject them. + # @!attribute [rw] update_mask + # @return [::Google::Protobuf::FieldMask] + # OPTIONAL: A FieldMask specifying which fields of the policy to modify. Only + # the fields in the mask will be modified. If no mask is provided, the + # following default mask is used: + # + # `paths: "bindings, etag"` + class SetIamPolicyRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Request message for `GetIamPolicy` method. + # @!attribute [rw] resource + # @return [::String] + # REQUIRED: The resource for which the policy is being requested. + # See the operation documentation for the appropriate value for this field. + # @!attribute [rw] options + # @return [::Google::Iam::V1::GetPolicyOptions] + # OPTIONAL: A `GetPolicyOptions` object for specifying options to + # `GetIamPolicy`. + class GetIamPolicyRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Request message for `TestIamPermissions` method. + # @!attribute [rw] resource + # @return [::String] + # REQUIRED: The resource for which the policy detail is being requested. + # See the operation documentation for the appropriate value for this field. + # @!attribute [rw] permissions + # @return [::Array<::String>] + # The set of permissions to check for the `resource`. Permissions with + # wildcards (such as '*' or 'storage.*') are not allowed. For more + # information see + # [IAM Overview](https://cloud.google.com/iam/docs/overview#permissions). + class TestIamPermissionsRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Response message for `TestIamPermissions` method. + # @!attribute [rw] permissions + # @return [::Array<::String>] + # A subset of `TestPermissionsRequest.permissions` that the caller is + # allowed. + class TestIamPermissionsResponse + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end + end +end diff --git a/owl-bot-staging/google-cloud-security_center-v2/proto_docs/google/iam/v1/options.rb b/owl-bot-staging/google-cloud-security_center-v2/proto_docs/google/iam/v1/options.rb new file mode 100644 index 000000000000..60713d995b86 --- /dev/null +++ b/owl-bot-staging/google-cloud-security_center-v2/proto_docs/google/iam/v1/options.rb @@ -0,0 +1,50 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + + +module Google + module Iam + module V1 + # Encapsulates settings provided to GetIamPolicy. + # @!attribute [rw] requested_policy_version + # @return [::Integer] + # Optional. The maximum policy version that will be used to format the + # policy. + # + # Valid values are 0, 1, and 3. Requests specifying an invalid value will be + # rejected. + # + # Requests for policies with any conditional role bindings must specify + # version 3. Policies with no conditional role bindings may specify any valid + # value or leave the field unset. + # + # The policy in the response might use the policy version that you specified, + # or it might use a lower policy version. For example, if you specify version + # 3, but the policy has no conditional role bindings, the response uses + # version 1. + # + # To learn which resources support conditions in their IAM policies, see the + # [IAM + # documentation](https://cloud.google.com/iam/help/conditions/resource-policies). + class GetPolicyOptions + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end + end +end diff --git a/owl-bot-staging/google-cloud-security_center-v2/proto_docs/google/iam/v1/policy.rb b/owl-bot-staging/google-cloud-security_center-v2/proto_docs/google/iam/v1/policy.rb new file mode 100644 index 000000000000..999575b797df --- /dev/null +++ b/owl-bot-staging/google-cloud-security_center-v2/proto_docs/google/iam/v1/policy.rb @@ -0,0 +1,426 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + + +module Google + module Iam + module V1 + # An Identity and Access Management (IAM) policy, which specifies access + # controls for Google Cloud resources. + # + # + # A `Policy` is a collection of `bindings`. A `binding` binds one or more + # `members`, or principals, to a single `role`. Principals can be user + # accounts, service accounts, Google groups, and domains (such as G Suite). A + # `role` is a named list of permissions; each `role` can be an IAM predefined + # role or a user-created custom role. + # + # For some types of Google Cloud resources, a `binding` can also specify a + # `condition`, which is a logical expression that allows access to a resource + # only if the expression evaluates to `true`. A condition can add constraints + # based on attributes of the request, the resource, or both. To learn which + # resources support conditions in their IAM policies, see the + # [IAM + # documentation](https://cloud.google.com/iam/help/conditions/resource-policies). + # + # **JSON example:** + # + # ``` + # { + # "bindings": [ + # { + # "role": "roles/resourcemanager.organizationAdmin", + # "members": [ + # "user:mike@example.com", + # "group:admins@example.com", + # "domain:google.com", + # "serviceAccount:my-project-id@appspot.gserviceaccount.com" + # ] + # }, + # { + # "role": "roles/resourcemanager.organizationViewer", + # "members": [ + # "user:eve@example.com" + # ], + # "condition": { + # "title": "expirable access", + # "description": "Does not grant access after Sep 2020", + # "expression": "request.time < + # timestamp('2020-10-01T00:00:00.000Z')", + # } + # } + # ], + # "etag": "BwWWja0YfJA=", + # "version": 3 + # } + # ``` + # + # **YAML example:** + # + # ``` + # bindings: + # - members: + # - user:mike@example.com + # - group:admins@example.com + # - domain:google.com + # - serviceAccount:my-project-id@appspot.gserviceaccount.com + # role: roles/resourcemanager.organizationAdmin + # - members: + # - user:eve@example.com + # role: roles/resourcemanager.organizationViewer + # condition: + # title: expirable access + # description: Does not grant access after Sep 2020 + # expression: request.time < timestamp('2020-10-01T00:00:00.000Z') + # etag: BwWWja0YfJA= + # version: 3 + # ``` + # + # For a description of IAM and its features, see the + # [IAM documentation](https://cloud.google.com/iam/docs/). + # @!attribute [rw] version + # @return [::Integer] + # Specifies the format of the policy. + # + # Valid values are `0`, `1`, and `3`. Requests that specify an invalid value + # are rejected. + # + # Any operation that affects conditional role bindings must specify version + # `3`. This requirement applies to the following operations: + # + # * Getting a policy that includes a conditional role binding + # * Adding a conditional role binding to a policy + # * Changing a conditional role binding in a policy + # * Removing any role binding, with or without a condition, from a policy + # that includes conditions + # + # **Important:** If you use IAM Conditions, you must include the `etag` field + # whenever you call `setIamPolicy`. If you omit this field, then IAM allows + # you to overwrite a version `3` policy with a version `1` policy, and all of + # the conditions in the version `3` policy are lost. + # + # If a policy does not include any conditions, operations on that policy may + # specify any valid version or leave the field unset. + # + # To learn which resources support conditions in their IAM policies, see the + # [IAM + # documentation](https://cloud.google.com/iam/help/conditions/resource-policies). + # @!attribute [rw] bindings + # @return [::Array<::Google::Iam::V1::Binding>] + # Associates a list of `members`, or principals, with a `role`. Optionally, + # may specify a `condition` that determines how and when the `bindings` are + # applied. Each of the `bindings` must contain at least one principal. + # + # The `bindings` in a `Policy` can refer to up to 1,500 principals; up to 250 + # of these principals can be Google groups. Each occurrence of a principal + # counts towards these limits. For example, if the `bindings` grant 50 + # different roles to `user:alice@example.com`, and not to any other + # principal, then you can add another 1,450 principals to the `bindings` in + # the `Policy`. + # @!attribute [rw] audit_configs + # @return [::Array<::Google::Iam::V1::AuditConfig>] + # Specifies cloud audit logging configuration for this policy. + # @!attribute [rw] etag + # @return [::String] + # `etag` is used for optimistic concurrency control as a way to help + # prevent simultaneous updates of a policy from overwriting each other. + # It is strongly suggested that systems make use of the `etag` in the + # read-modify-write cycle to perform policy updates in order to avoid race + # conditions: An `etag` is returned in the response to `getIamPolicy`, and + # systems are expected to put that etag in the request to `setIamPolicy` to + # ensure that their change will be applied to the same version of the policy. + # + # **Important:** If you use IAM Conditions, you must include the `etag` field + # whenever you call `setIamPolicy`. If you omit this field, then IAM allows + # you to overwrite a version `3` policy with a version `1` policy, and all of + # the conditions in the version `3` policy are lost. + class Policy + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Associates `members`, or principals, with a `role`. + # @!attribute [rw] role + # @return [::String] + # Role that is assigned to the list of `members`, or principals. + # For example, `roles/viewer`, `roles/editor`, or `roles/owner`. + # @!attribute [rw] members + # @return [::Array<::String>] + # Specifies the principals requesting access for a Google Cloud resource. + # `members` can have the following values: + # + # * `allUsers`: A special identifier that represents anyone who is + # on the internet; with or without a Google account. + # + # * `allAuthenticatedUsers`: A special identifier that represents anyone + # who is authenticated with a Google account or a service account. + # + # * `user:{emailid}`: An email address that represents a specific Google + # account. For example, `alice@example.com` . + # + # + # * `serviceAccount:{emailid}`: An email address that represents a service + # account. For example, `my-other-app@appspot.gserviceaccount.com`. + # + # * `group:{emailid}`: An email address that represents a Google group. + # For example, `admins@example.com`. + # + # * `deleted:user:{emailid}?uid={uniqueid}`: An email address (plus unique + # identifier) representing a user that has been recently deleted. For + # example, `alice@example.com?uid=123456789012345678901`. If the user is + # recovered, this value reverts to `user:{emailid}` and the recovered user + # retains the role in the binding. + # + # * `deleted:serviceAccount:{emailid}?uid={uniqueid}`: An email address (plus + # unique identifier) representing a service account that has been recently + # deleted. For example, + # `my-other-app@appspot.gserviceaccount.com?uid=123456789012345678901`. + # If the service account is undeleted, this value reverts to + # `serviceAccount:{emailid}` and the undeleted service account retains the + # role in the binding. + # + # * `deleted:group:{emailid}?uid={uniqueid}`: An email address (plus unique + # identifier) representing a Google group that has been recently + # deleted. For example, `admins@example.com?uid=123456789012345678901`. If + # the group is recovered, this value reverts to `group:{emailid}` and the + # recovered group retains the role in the binding. + # + # + # * `domain:{domain}`: The G Suite domain (primary) that represents all the + # users of that domain. For example, `google.com` or `example.com`. + # @!attribute [rw] condition + # @return [::Google::Type::Expr] + # The condition that is associated with this binding. + # + # If the condition evaluates to `true`, then this binding applies to the + # current request. + # + # If the condition evaluates to `false`, then this binding does not apply to + # the current request. However, a different role binding might grant the same + # role to one or more of the principals in this binding. + # + # To learn which resources support conditions in their IAM policies, see the + # [IAM + # documentation](https://cloud.google.com/iam/help/conditions/resource-policies). + class Binding + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Specifies the audit configuration for a service. + # The configuration determines which permission types are logged, and what + # identities, if any, are exempted from logging. + # An AuditConfig must have one or more AuditLogConfigs. + # + # If there are AuditConfigs for both `allServices` and a specific service, + # the union of the two AuditConfigs is used for that service: the log_types + # specified in each AuditConfig are enabled, and the exempted_members in each + # AuditLogConfig are exempted. + # + # Example Policy with multiple AuditConfigs: + # + # { + # "audit_configs": [ + # { + # "service": "allServices", + # "audit_log_configs": [ + # { + # "log_type": "DATA_READ", + # "exempted_members": [ + # "user:jose@example.com" + # ] + # }, + # { + # "log_type": "DATA_WRITE" + # }, + # { + # "log_type": "ADMIN_READ" + # } + # ] + # }, + # { + # "service": "sampleservice.googleapis.com", + # "audit_log_configs": [ + # { + # "log_type": "DATA_READ" + # }, + # { + # "log_type": "DATA_WRITE", + # "exempted_members": [ + # "user:aliya@example.com" + # ] + # } + # ] + # } + # ] + # } + # + # For sampleservice, this policy enables DATA_READ, DATA_WRITE and ADMIN_READ + # logging. It also exempts `jose@example.com` from DATA_READ logging, and + # `aliya@example.com` from DATA_WRITE logging. + # @!attribute [rw] service + # @return [::String] + # Specifies a service that will be enabled for audit logging. + # For example, `storage.googleapis.com`, `cloudsql.googleapis.com`. + # `allServices` is a special value that covers all services. + # @!attribute [rw] audit_log_configs + # @return [::Array<::Google::Iam::V1::AuditLogConfig>] + # The configuration for logging of each type of permission. + class AuditConfig + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Provides the configuration for logging a type of permissions. + # Example: + # + # { + # "audit_log_configs": [ + # { + # "log_type": "DATA_READ", + # "exempted_members": [ + # "user:jose@example.com" + # ] + # }, + # { + # "log_type": "DATA_WRITE" + # } + # ] + # } + # + # This enables 'DATA_READ' and 'DATA_WRITE' logging, while exempting + # jose@example.com from DATA_READ logging. + # @!attribute [rw] log_type + # @return [::Google::Iam::V1::AuditLogConfig::LogType] + # The log type that this config enables. + # @!attribute [rw] exempted_members + # @return [::Array<::String>] + # Specifies the identities that do not cause logging for this type of + # permission. + # Follows the same format of + # [Binding.members][google.iam.v1.Binding.members]. + class AuditLogConfig + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # The list of valid permission types for which logging can be configured. + # Admin writes are always logged, and are not configurable. + module LogType + # Default case. Should never be this. + LOG_TYPE_UNSPECIFIED = 0 + + # Admin reads. Example: CloudIAM getIamPolicy + ADMIN_READ = 1 + + # Data writes. Example: CloudSQL Users create + DATA_WRITE = 2 + + # Data reads. Example: CloudSQL Users list + DATA_READ = 3 + end + end + + # The difference delta between two policies. + # @!attribute [rw] binding_deltas + # @return [::Array<::Google::Iam::V1::BindingDelta>] + # The delta for Bindings between two policies. + # @!attribute [rw] audit_config_deltas + # @return [::Array<::Google::Iam::V1::AuditConfigDelta>] + # The delta for AuditConfigs between two policies. + class PolicyDelta + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # One delta entry for Binding. Each individual change (only one member in each + # entry) to a binding will be a separate entry. + # @!attribute [rw] action + # @return [::Google::Iam::V1::BindingDelta::Action] + # The action that was performed on a Binding. + # Required + # @!attribute [rw] role + # @return [::String] + # Role that is assigned to `members`. + # For example, `roles/viewer`, `roles/editor`, or `roles/owner`. + # Required + # @!attribute [rw] member + # @return [::String] + # A single identity requesting access for a Google Cloud resource. + # Follows the same format of Binding.members. + # Required + # @!attribute [rw] condition + # @return [::Google::Type::Expr] + # The condition that is associated with this binding. + class BindingDelta + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # The type of action performed on a Binding in a policy. + module Action + # Unspecified. + ACTION_UNSPECIFIED = 0 + + # Addition of a Binding. + ADD = 1 + + # Removal of a Binding. + REMOVE = 2 + end + end + + # One delta entry for AuditConfig. Each individual change (only one + # exempted_member in each entry) to a AuditConfig will be a separate entry. + # @!attribute [rw] action + # @return [::Google::Iam::V1::AuditConfigDelta::Action] + # The action that was performed on an audit configuration in a policy. + # Required + # @!attribute [rw] service + # @return [::String] + # Specifies a service that was configured for Cloud Audit Logging. + # For example, `storage.googleapis.com`, `cloudsql.googleapis.com`. + # `allServices` is a special value that covers all services. + # Required + # @!attribute [rw] exempted_member + # @return [::String] + # A single identity that is exempted from "data access" audit + # logging for the `service` specified above. + # Follows the same format of Binding.members. + # @!attribute [rw] log_type + # @return [::String] + # Specifies the log_type that was be enabled. ADMIN_ACTIVITY is always + # enabled, and cannot be configured. + # Required + class AuditConfigDelta + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # The type of action performed on an audit configuration in a policy. + module Action + # Unspecified. + ACTION_UNSPECIFIED = 0 + + # Addition of an audit configuration. + ADD = 1 + + # Removal of an audit configuration. + REMOVE = 2 + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-security_center-v2/proto_docs/google/longrunning/operations.rb b/owl-bot-staging/google-cloud-security_center-v2/proto_docs/google/longrunning/operations.rb new file mode 100644 index 000000000000..7a757f512165 --- /dev/null +++ b/owl-bot-staging/google-cloud-security_center-v2/proto_docs/google/longrunning/operations.rb @@ -0,0 +1,191 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + + +module Google + module Longrunning + # This resource represents a long-running operation that is the result of a + # network API call. + # @!attribute [rw] name + # @return [::String] + # The server-assigned name, which is only unique within the same service that + # originally returns it. If you use the default HTTP mapping, the + # `name` should be a resource name ending with `operations/{unique_id}`. + # @!attribute [rw] metadata + # @return [::Google::Protobuf::Any] + # Service-specific metadata associated with the operation. It typically + # contains progress information and common metadata such as create time. + # Some services might not provide such metadata. Any method that returns a + # long-running operation should document the metadata type, if any. + # @!attribute [rw] done + # @return [::Boolean] + # If the value is `false`, it means the operation is still in progress. + # If `true`, the operation is completed, and either `error` or `response` is + # available. + # @!attribute [rw] error + # @return [::Google::Rpc::Status] + # The error result of the operation in case of failure or cancellation. + # + # Note: The following fields are mutually exclusive: `error`, `response`. If a field in that set is populated, all other fields in the set will automatically be cleared. + # @!attribute [rw] response + # @return [::Google::Protobuf::Any] + # The normal, successful response of the operation. If the original + # method returns no data on success, such as `Delete`, the response is + # `google.protobuf.Empty`. If the original method is standard + # `Get`/`Create`/`Update`, the response should be the resource. For other + # methods, the response should have the type `XxxResponse`, where `Xxx` + # is the original method name. For example, if the original method name + # is `TakeSnapshot()`, the inferred response type is + # `TakeSnapshotResponse`. + # + # Note: The following fields are mutually exclusive: `response`, `error`. If a field in that set is populated, all other fields in the set will automatically be cleared. + class Operation + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # The request message for + # Operations.GetOperation. + # @!attribute [rw] name + # @return [::String] + # The name of the operation resource. + class GetOperationRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # The request message for + # Operations.ListOperations. + # @!attribute [rw] name + # @return [::String] + # The name of the operation's parent resource. + # @!attribute [rw] filter + # @return [::String] + # The standard list filter. + # @!attribute [rw] page_size + # @return [::Integer] + # The standard list page size. + # @!attribute [rw] page_token + # @return [::String] + # The standard list page token. + # @!attribute [rw] return_partial_success + # @return [::Boolean] + # When set to `true`, operations that are reachable are returned as normal, + # and those that are unreachable are returned in the + # [ListOperationsResponse.unreachable] field. + # + # This can only be `true` when reading across collections e.g. when `parent` + # is set to `"projects/example/locations/-"`. + # + # This field is not by default supported and will result in an + # `UNIMPLEMENTED` error if set unless explicitly documented otherwise in + # service or product specific documentation. + class ListOperationsRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # The response message for + # Operations.ListOperations. + # @!attribute [rw] operations + # @return [::Array<::Google::Longrunning::Operation>] + # A list of operations that matches the specified filter in the request. + # @!attribute [rw] next_page_token + # @return [::String] + # The standard List next-page token. + # @!attribute [rw] unreachable + # @return [::Array<::String>] + # Unordered list. Unreachable resources. Populated when the request sets + # `ListOperationsRequest.return_partial_success` and reads across + # collections e.g. when attempting to list all resources across all supported + # locations. + class ListOperationsResponse + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # The request message for + # Operations.CancelOperation. + # @!attribute [rw] name + # @return [::String] + # The name of the operation resource to be cancelled. + class CancelOperationRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # The request message for + # Operations.DeleteOperation. + # @!attribute [rw] name + # @return [::String] + # The name of the operation resource to be deleted. + class DeleteOperationRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # The request message for + # Operations.WaitOperation. + # @!attribute [rw] name + # @return [::String] + # The name of the operation resource to wait on. + # @!attribute [rw] timeout + # @return [::Google::Protobuf::Duration] + # The maximum duration to wait before timing out. If left blank, the wait + # will be at most the time permitted by the underlying HTTP/RPC protocol. + # If RPC context deadline is also specified, the shorter one will be used. + class WaitOperationRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # A message representing the message types used by a long-running operation. + # + # Example: + # + # rpc Export(ExportRequest) returns (google.longrunning.Operation) { + # option (google.longrunning.operation_info) = { + # response_type: "ExportResponse" + # metadata_type: "ExportMetadata" + # }; + # } + # @!attribute [rw] response_type + # @return [::String] + # Required. The message name of the primary return type for this + # long-running operation. + # This type will be used to deserialize the LRO's response. + # + # If the response is in a different package from the rpc, a fully-qualified + # message name must be used (e.g. `google.protobuf.Struct`). + # + # Note: Altering this value constitutes a breaking change. + # @!attribute [rw] metadata_type + # @return [::String] + # Required. The message name of the metadata type for this long-running + # operation. + # + # If the response is in a different package from the rpc, a fully-qualified + # message name must be used (e.g. `google.protobuf.Struct`). + # + # Note: Altering this value constitutes a breaking change. + class OperationInfo + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end +end diff --git a/owl-bot-staging/google-cloud-security_center-v2/proto_docs/google/protobuf/any.rb b/owl-bot-staging/google-cloud-security_center-v2/proto_docs/google/protobuf/any.rb new file mode 100644 index 000000000000..58691995f02e --- /dev/null +++ b/owl-bot-staging/google-cloud-security_center-v2/proto_docs/google/protobuf/any.rb @@ -0,0 +1,145 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + + +module Google + module Protobuf + # `Any` contains an arbitrary serialized protocol buffer message along with a + # URL that describes the type of the serialized message. + # + # Protobuf library provides support to pack/unpack Any values in the form + # of utility functions or additional generated methods of the Any type. + # + # Example 1: Pack and unpack a message in C++. + # + # Foo foo = ...; + # Any any; + # any.PackFrom(foo); + # ... + # if (any.UnpackTo(&foo)) { + # ... + # } + # + # Example 2: Pack and unpack a message in Java. + # + # Foo foo = ...; + # Any any = Any.pack(foo); + # ... + # if (any.is(Foo.class)) { + # foo = any.unpack(Foo.class); + # } + # // or ... + # if (any.isSameTypeAs(Foo.getDefaultInstance())) { + # foo = any.unpack(Foo.getDefaultInstance()); + # } + # + # Example 3: Pack and unpack a message in Python. + # + # foo = Foo(...) + # any = Any() + # any.Pack(foo) + # ... + # if any.Is(Foo.DESCRIPTOR): + # any.Unpack(foo) + # ... + # + # Example 4: Pack and unpack a message in Go + # + # foo := &pb.Foo{...} + # any, err := anypb.New(foo) + # if err != nil { + # ... + # } + # ... + # foo := &pb.Foo{} + # if err := any.UnmarshalTo(foo); err != nil { + # ... + # } + # + # The pack methods provided by protobuf library will by default use + # 'type.googleapis.com/full.type.name' as the type URL and the unpack + # methods only use the fully qualified type name after the last '/' + # in the type URL, for example "foo.bar.com/x/y.z" will yield type + # name "y.z". + # + # JSON + # ==== + # The JSON representation of an `Any` value uses the regular + # representation of the deserialized, embedded message, with an + # additional field `@type` which contains the type URL. Example: + # + # package google.profile; + # message Person { + # string first_name = 1; + # string last_name = 2; + # } + # + # { + # "@type": "type.googleapis.com/google.profile.Person", + # "firstName": , + # "lastName": + # } + # + # If the embedded message type is well-known and has a custom JSON + # representation, that representation will be embedded adding a field + # `value` which holds the custom JSON in addition to the `@type` + # field. Example (for message [google.protobuf.Duration][]): + # + # { + # "@type": "type.googleapis.com/google.protobuf.Duration", + # "value": "1.212s" + # } + # @!attribute [rw] type_url + # @return [::String] + # A URL/resource name that uniquely identifies the type of the serialized + # protocol buffer message. This string must contain at least + # one "/" character. The last segment of the URL's path must represent + # the fully qualified name of the type (as in + # `path/google.protobuf.Duration`). The name should be in a canonical form + # (e.g., leading "." is not accepted). + # + # In practice, teams usually precompile into the binary all types that they + # expect it to use in the context of Any. However, for URLs which use the + # scheme `http`, `https`, or no scheme, one can optionally set up a type + # server that maps type URLs to message definitions as follows: + # + # * If no scheme is provided, `https` is assumed. + # * An HTTP GET on the URL must yield a [google.protobuf.Type][] + # value in binary format, or produce an error. + # * Applications are allowed to cache lookup results based on the + # URL, or have them precompiled into a binary to avoid any + # lookup. Therefore, binary compatibility needs to be preserved + # on changes to types. (Use versioned type names to manage + # breaking changes.) + # + # Note: this functionality is not currently available in the official + # protobuf release, and it is not used for type URLs beginning with + # type.googleapis.com. As of May 2023, there are no widely used type server + # implementations and no plans to implement one. + # + # Schemes other than `http`, `https` (or the empty scheme) might be + # used with implementation specific semantics. + # @!attribute [rw] value + # @return [::String] + # Must be a valid serialized protocol buffer of the above specified type. + class Any + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end +end diff --git a/owl-bot-staging/google-cloud-security_center-v2/proto_docs/google/protobuf/duration.rb b/owl-bot-staging/google-cloud-security_center-v2/proto_docs/google/protobuf/duration.rb new file mode 100644 index 000000000000..ea59f1f91daf --- /dev/null +++ b/owl-bot-staging/google-cloud-security_center-v2/proto_docs/google/protobuf/duration.rb @@ -0,0 +1,98 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + + +module Google + module Protobuf + # A Duration represents a signed, fixed-length span of time represented + # as a count of seconds and fractions of seconds at nanosecond + # resolution. It is independent of any calendar and concepts like "day" + # or "month". It is related to Timestamp in that the difference between + # two Timestamp values is a Duration and it can be added or subtracted + # from a Timestamp. Range is approximately +-10,000 years. + # + # # Examples + # + # Example 1: Compute Duration from two Timestamps in pseudo code. + # + # Timestamp start = ...; + # Timestamp end = ...; + # Duration duration = ...; + # + # duration.seconds = end.seconds - start.seconds; + # duration.nanos = end.nanos - start.nanos; + # + # if (duration.seconds < 0 && duration.nanos > 0) { + # duration.seconds += 1; + # duration.nanos -= 1000000000; + # } else if (duration.seconds > 0 && duration.nanos < 0) { + # duration.seconds -= 1; + # duration.nanos += 1000000000; + # } + # + # Example 2: Compute Timestamp from Timestamp + Duration in pseudo code. + # + # Timestamp start = ...; + # Duration duration = ...; + # Timestamp end = ...; + # + # end.seconds = start.seconds + duration.seconds; + # end.nanos = start.nanos + duration.nanos; + # + # if (end.nanos < 0) { + # end.seconds -= 1; + # end.nanos += 1000000000; + # } else if (end.nanos >= 1000000000) { + # end.seconds += 1; + # end.nanos -= 1000000000; + # } + # + # Example 3: Compute Duration from datetime.timedelta in Python. + # + # td = datetime.timedelta(days=3, minutes=10) + # duration = Duration() + # duration.FromTimedelta(td) + # + # # JSON Mapping + # + # In JSON format, the Duration type is encoded as a string rather than an + # object, where the string ends in the suffix "s" (indicating seconds) and + # is preceded by the number of seconds, with nanoseconds expressed as + # fractional seconds. For example, 3 seconds with 0 nanoseconds should be + # encoded in JSON format as "3s", while 3 seconds and 1 nanosecond should + # be expressed in JSON format as "3.000000001s", and 3 seconds and 1 + # microsecond should be expressed in JSON format as "3.000001s". + # @!attribute [rw] seconds + # @return [::Integer] + # Signed seconds of the span of time. Must be from -315,576,000,000 + # to +315,576,000,000 inclusive. Note: these bounds are computed from: + # 60 sec/min * 60 min/hr * 24 hr/day * 365.25 days/year * 10000 years + # @!attribute [rw] nanos + # @return [::Integer] + # Signed fractions of a second at nanosecond resolution of the span + # of time. Durations less than one second are represented with a 0 + # `seconds` field and a positive or negative `nanos` field. For durations + # of one second or more, a non-zero value for the `nanos` field must be + # of the same sign as the `seconds` field. Must be from -999,999,999 + # to +999,999,999 inclusive. + class Duration + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end +end diff --git a/owl-bot-staging/google-cloud-security_center-v2/proto_docs/google/protobuf/empty.rb b/owl-bot-staging/google-cloud-security_center-v2/proto_docs/google/protobuf/empty.rb new file mode 100644 index 000000000000..83e4481834a6 --- /dev/null +++ b/owl-bot-staging/google-cloud-security_center-v2/proto_docs/google/protobuf/empty.rb @@ -0,0 +1,34 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + + +module Google + module Protobuf + # A generic empty message that you can re-use to avoid defining duplicated + # empty messages in your APIs. A typical example is to use it as the request + # or the response type of an API method. For instance: + # + # service Foo { + # rpc Bar(google.protobuf.Empty) returns (google.protobuf.Empty); + # } + class Empty + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end +end diff --git a/owl-bot-staging/google-cloud-security_center-v2/proto_docs/google/protobuf/field_mask.rb b/owl-bot-staging/google-cloud-security_center-v2/proto_docs/google/protobuf/field_mask.rb new file mode 100644 index 000000000000..7f3ffc78601a --- /dev/null +++ b/owl-bot-staging/google-cloud-security_center-v2/proto_docs/google/protobuf/field_mask.rb @@ -0,0 +1,229 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + + +module Google + module Protobuf + # `FieldMask` represents a set of symbolic field paths, for example: + # + # paths: "f.a" + # paths: "f.b.d" + # + # Here `f` represents a field in some root message, `a` and `b` + # fields in the message found in `f`, and `d` a field found in the + # message in `f.b`. + # + # Field masks are used to specify a subset of fields that should be + # returned by a get operation or modified by an update operation. + # Field masks also have a custom JSON encoding (see below). + # + # # Field Masks in Projections + # + # When used in the context of a projection, a response message or + # sub-message is filtered by the API to only contain those fields as + # specified in the mask. For example, if the mask in the previous + # example is applied to a response message as follows: + # + # f { + # a : 22 + # b { + # d : 1 + # x : 2 + # } + # y : 13 + # } + # z: 8 + # + # The result will not contain specific values for fields x,y and z + # (their value will be set to the default, and omitted in proto text + # output): + # + # + # f { + # a : 22 + # b { + # d : 1 + # } + # } + # + # A repeated field is not allowed except at the last position of a + # paths string. + # + # If a FieldMask object is not present in a get operation, the + # operation applies to all fields (as if a FieldMask of all fields + # had been specified). + # + # Note that a field mask does not necessarily apply to the + # top-level response message. In case of a REST get operation, the + # field mask applies directly to the response, but in case of a REST + # list operation, the mask instead applies to each individual message + # in the returned resource list. In case of a REST custom method, + # other definitions may be used. Where the mask applies will be + # clearly documented together with its declaration in the API. In + # any case, the effect on the returned resource/resources is required + # behavior for APIs. + # + # # Field Masks in Update Operations + # + # A field mask in update operations specifies which fields of the + # targeted resource are going to be updated. The API is required + # to only change the values of the fields as specified in the mask + # and leave the others untouched. If a resource is passed in to + # describe the updated values, the API ignores the values of all + # fields not covered by the mask. + # + # If a repeated field is specified for an update operation, new values will + # be appended to the existing repeated field in the target resource. Note that + # a repeated field is only allowed in the last position of a `paths` string. + # + # If a sub-message is specified in the last position of the field mask for an + # update operation, then new value will be merged into the existing sub-message + # in the target resource. + # + # For example, given the target message: + # + # f { + # b { + # d: 1 + # x: 2 + # } + # c: [1] + # } + # + # And an update message: + # + # f { + # b { + # d: 10 + # } + # c: [2] + # } + # + # then if the field mask is: + # + # paths: ["f.b", "f.c"] + # + # then the result will be: + # + # f { + # b { + # d: 10 + # x: 2 + # } + # c: [1, 2] + # } + # + # An implementation may provide options to override this default behavior for + # repeated and message fields. + # + # In order to reset a field's value to the default, the field must + # be in the mask and set to the default value in the provided resource. + # Hence, in order to reset all fields of a resource, provide a default + # instance of the resource and set all fields in the mask, or do + # not provide a mask as described below. + # + # If a field mask is not present on update, the operation applies to + # all fields (as if a field mask of all fields has been specified). + # Note that in the presence of schema evolution, this may mean that + # fields the client does not know and has therefore not filled into + # the request will be reset to their default. If this is unwanted + # behavior, a specific service may require a client to always specify + # a field mask, producing an error if not. + # + # As with get operations, the location of the resource which + # describes the updated values in the request message depends on the + # operation kind. In any case, the effect of the field mask is + # required to be honored by the API. + # + # ## Considerations for HTTP REST + # + # The HTTP kind of an update operation which uses a field mask must + # be set to PATCH instead of PUT in order to satisfy HTTP semantics + # (PUT must only be used for full updates). + # + # # JSON Encoding of Field Masks + # + # In JSON, a field mask is encoded as a single string where paths are + # separated by a comma. Fields name in each path are converted + # to/from lower-camel naming conventions. + # + # As an example, consider the following message declarations: + # + # message Profile { + # User user = 1; + # Photo photo = 2; + # } + # message User { + # string display_name = 1; + # string address = 2; + # } + # + # In proto a field mask for `Profile` may look as such: + # + # mask { + # paths: "user.display_name" + # paths: "photo" + # } + # + # In JSON, the same mask is represented as below: + # + # { + # mask: "user.displayName,photo" + # } + # + # # Field Masks and Oneof Fields + # + # Field masks treat fields in oneofs just as regular fields. Consider the + # following message: + # + # message SampleMessage { + # oneof test_oneof { + # string name = 4; + # SubMessage sub_message = 9; + # } + # } + # + # The field mask can be: + # + # mask { + # paths: "name" + # } + # + # Or: + # + # mask { + # paths: "sub_message" + # } + # + # Note that oneof type names ("test_oneof" in this case) cannot be used in + # paths. + # + # ## Field Mask Verification + # + # The implementation of any API method which has a FieldMask type field in the + # request should verify the included field paths, and return an + # `INVALID_ARGUMENT` error if any path is unmappable. + # @!attribute [rw] paths + # @return [::Array<::String>] + # The set of field mask paths. + class FieldMask + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end +end diff --git a/owl-bot-staging/google-cloud-security_center-v2/proto_docs/google/protobuf/struct.rb b/owl-bot-staging/google-cloud-security_center-v2/proto_docs/google/protobuf/struct.rb new file mode 100644 index 000000000000..39e1aca868d2 --- /dev/null +++ b/owl-bot-staging/google-cloud-security_center-v2/proto_docs/google/protobuf/struct.rb @@ -0,0 +1,108 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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 + # `Struct` represents a structured data value, consisting of fields + # which map to dynamically typed values. In some languages, `Struct` + # might be supported by a native representation. For example, in + # scripting languages like JS a struct is represented as an + # object. The details of that representation are described together + # with the proto support for the language. + # + # The JSON representation for `Struct` is JSON object. + # @!attribute [rw] fields + # @return [::Google::Protobuf::Map{::String => ::Google::Protobuf::Value}] + # Unordered map of dynamically typed values. + class Struct + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # @!attribute [rw] key + # @return [::String] + # @!attribute [rw] value + # @return [::Google::Protobuf::Value] + class FieldsEntry + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end + + # `Value` represents a dynamically typed value which can be either + # null, a number, a string, a boolean, a recursive struct value, or a + # list of values. A producer of value is expected to set one of these + # variants. Absence of any variant indicates an error. + # + # The JSON representation for `Value` is JSON value. + # @!attribute [rw] null_value + # @return [::Google::Protobuf::NullValue] + # Represents a null value. + # + # Note: The following fields are mutually exclusive: `null_value`, `number_value`, `string_value`, `bool_value`, `struct_value`, `list_value`. If a field in that set is populated, all other fields in the set will automatically be cleared. + # @!attribute [rw] number_value + # @return [::Float] + # Represents a double value. + # + # Note: The following fields are mutually exclusive: `number_value`, `null_value`, `string_value`, `bool_value`, `struct_value`, `list_value`. If a field in that set is populated, all other fields in the set will automatically be cleared. + # @!attribute [rw] string_value + # @return [::String] + # Represents a string value. + # + # Note: The following fields are mutually exclusive: `string_value`, `null_value`, `number_value`, `bool_value`, `struct_value`, `list_value`. If a field in that set is populated, all other fields in the set will automatically be cleared. + # @!attribute [rw] bool_value + # @return [::Boolean] + # Represents a boolean value. + # + # Note: The following fields are mutually exclusive: `bool_value`, `null_value`, `number_value`, `string_value`, `struct_value`, `list_value`. If a field in that set is populated, all other fields in the set will automatically be cleared. + # @!attribute [rw] struct_value + # @return [::Google::Protobuf::Struct] + # Represents a structured value. + # + # Note: The following fields are mutually exclusive: `struct_value`, `null_value`, `number_value`, `string_value`, `bool_value`, `list_value`. If a field in that set is populated, all other fields in the set will automatically be cleared. + # @!attribute [rw] list_value + # @return [::Google::Protobuf::ListValue] + # Represents a repeated `Value`. + # + # Note: The following fields are mutually exclusive: `list_value`, `null_value`, `number_value`, `string_value`, `bool_value`, `struct_value`. If a field in that set is populated, all other fields in the set will automatically be cleared. + class Value + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # `ListValue` is a wrapper around a repeated field of values. + # + # The JSON representation for `ListValue` is JSON array. + # @!attribute [rw] values + # @return [::Array<::Google::Protobuf::Value>] + # Repeated field of dynamically typed values. + class ListValue + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # `NullValue` is a singleton enumeration to represent the null value for the + # `Value` type union. + # + # The JSON representation for `NullValue` is JSON `null`. + module NullValue + # Null value. + NULL_VALUE = 0 + end + end +end diff --git a/owl-bot-staging/google-cloud-security_center-v2/proto_docs/google/protobuf/timestamp.rb b/owl-bot-staging/google-cloud-security_center-v2/proto_docs/google/protobuf/timestamp.rb new file mode 100644 index 000000000000..74352be9c58c --- /dev/null +++ b/owl-bot-staging/google-cloud-security_center-v2/proto_docs/google/protobuf/timestamp.rb @@ -0,0 +1,127 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + + +module Google + module Protobuf + # A Timestamp represents a point in time independent of any time zone or local + # calendar, encoded as a count of seconds and fractions of seconds at + # nanosecond resolution. The count is relative to an epoch at UTC midnight on + # January 1, 1970, in the proleptic Gregorian calendar which extends the + # Gregorian calendar backwards to year one. + # + # All minutes are 60 seconds long. Leap seconds are "smeared" so that no leap + # second table is needed for interpretation, using a [24-hour linear + # smear](https://developers.google.com/time/smear). + # + # The range is from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59.999999999Z. By + # restricting to that range, we ensure that we can convert to and from [RFC + # 3339](https://www.ietf.org/rfc/rfc3339.txt) date strings. + # + # # Examples + # + # Example 1: Compute Timestamp from POSIX `time()`. + # + # Timestamp timestamp; + # timestamp.set_seconds(time(NULL)); + # timestamp.set_nanos(0); + # + # Example 2: Compute Timestamp from POSIX `gettimeofday()`. + # + # struct timeval tv; + # gettimeofday(&tv, NULL); + # + # Timestamp timestamp; + # timestamp.set_seconds(tv.tv_sec); + # timestamp.set_nanos(tv.tv_usec * 1000); + # + # Example 3: Compute Timestamp from Win32 `GetSystemTimeAsFileTime()`. + # + # FILETIME ft; + # GetSystemTimeAsFileTime(&ft); + # UINT64 ticks = (((UINT64)ft.dwHighDateTime) << 32) | ft.dwLowDateTime; + # + # // A Windows tick is 100 nanoseconds. Windows epoch 1601-01-01T00:00:00Z + # // is 11644473600 seconds before Unix epoch 1970-01-01T00:00:00Z. + # Timestamp timestamp; + # timestamp.set_seconds((INT64) ((ticks / 10000000) - 11644473600LL)); + # timestamp.set_nanos((INT32) ((ticks % 10000000) * 100)); + # + # Example 4: Compute Timestamp from Java `System.currentTimeMillis()`. + # + # long millis = System.currentTimeMillis(); + # + # Timestamp timestamp = Timestamp.newBuilder().setSeconds(millis / 1000) + # .setNanos((int) ((millis % 1000) * 1000000)).build(); + # + # Example 5: Compute Timestamp from Java `Instant.now()`. + # + # Instant now = Instant.now(); + # + # Timestamp timestamp = + # Timestamp.newBuilder().setSeconds(now.getEpochSecond()) + # .setNanos(now.getNano()).build(); + # + # Example 6: Compute Timestamp from current time in Python. + # + # timestamp = Timestamp() + # timestamp.GetCurrentTime() + # + # # JSON Mapping + # + # In JSON format, the Timestamp type is encoded as a string in the + # [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format. That is, the + # format is "\\{year}-\\{month}-\\{day}T\\{hour}:\\{min}:\\{sec}[.\\{frac_sec}]Z" + # where \\{year} is always expressed using four digits while \\{month}, \\{day}, + # \\{hour}, \\{min}, and \\{sec} are zero-padded to two digits each. The fractional + # seconds, which can go up to 9 digits (i.e. up to 1 nanosecond resolution), + # are optional. The "Z" suffix indicates the timezone ("UTC"); the timezone + # is required. A proto3 JSON serializer should always use UTC (as indicated by + # "Z") when printing the Timestamp type and a proto3 JSON parser should be + # able to accept both UTC and other timezones (as indicated by an offset). + # + # For example, "2017-01-15T01:30:15.01Z" encodes 15.01 seconds past + # 01:30 UTC on January 15, 2017. + # + # In JavaScript, one can convert a Date object to this format using the + # standard + # [toISOString()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toISOString) + # method. In Python, a standard `datetime.datetime` object can be converted + # to this format using + # [`strftime`](https://docs.python.org/2/library/time.html#time.strftime) with + # the time format spec '%Y-%m-%dT%H:%M:%S.%fZ'. Likewise, in Java, one can use + # the Joda Time's [`ISODateTimeFormat.dateTime()`]( + # http://joda-time.sourceforge.net/apidocs/org/joda/time/format/ISODateTimeFormat.html#dateTime() + # ) to obtain a formatter capable of generating timestamps in this format. + # @!attribute [rw] seconds + # @return [::Integer] + # Represents seconds of UTC time since Unix epoch + # 1970-01-01T00:00:00Z. Must be from 0001-01-01T00:00:00Z to + # 9999-12-31T23:59:59Z inclusive. + # @!attribute [rw] nanos + # @return [::Integer] + # Non-negative fractions of a second at nanosecond resolution. Negative + # second values with fractions must still have non-negative nanos values + # that count forward in time. Must be from 0 to 999,999,999 + # inclusive. + class Timestamp + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end +end diff --git a/owl-bot-staging/google-cloud-security_center-v2/proto_docs/google/rpc/status.rb b/owl-bot-staging/google-cloud-security_center-v2/proto_docs/google/rpc/status.rb new file mode 100644 index 000000000000..c1a1c07eb2db --- /dev/null +++ b/owl-bot-staging/google-cloud-security_center-v2/proto_docs/google/rpc/status.rb @@ -0,0 +1,48 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + + +module Google + module Rpc + # The `Status` type defines a logical error model that is suitable for + # different programming environments, including REST APIs and RPC APIs. It is + # used by [gRPC](https://github.com/grpc). Each `Status` message contains + # three pieces of data: error code, error message, and error details. + # + # You can find out more about this error model and how to work with it in the + # [API Design Guide](https://cloud.google.com/apis/design/errors). + # @!attribute [rw] code + # @return [::Integer] + # The status code, which should be an enum value of + # [google.rpc.Code][google.rpc.Code]. + # @!attribute [rw] message + # @return [::String] + # A developer-facing error message, which should be in English. Any + # user-facing error message should be localized and sent in the + # {::Google::Rpc::Status#details google.rpc.Status.details} field, or localized + # by the client. + # @!attribute [rw] details + # @return [::Array<::Google::Protobuf::Any>] + # A list of messages that carry the error details. There is a common set of + # message types for APIs to use. + class Status + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end +end diff --git a/owl-bot-staging/google-cloud-security_center-v2/proto_docs/google/type/expr.rb b/owl-bot-staging/google-cloud-security_center-v2/proto_docs/google/type/expr.rb new file mode 100644 index 000000000000..53e7733b6592 --- /dev/null +++ b/owl-bot-staging/google-cloud-security_center-v2/proto_docs/google/type/expr.rb @@ -0,0 +1,75 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + + +module Google + module Type + # Represents a textual expression in the Common Expression Language (CEL) + # syntax. CEL is a C-like expression language. The syntax and semantics of CEL + # are documented at https://github.com/google/cel-spec. + # + # Example (Comparison): + # + # title: "Summary size limit" + # description: "Determines if a summary is less than 100 chars" + # expression: "document.summary.size() < 100" + # + # Example (Equality): + # + # title: "Requestor is owner" + # description: "Determines if requestor is the document owner" + # expression: "document.owner == request.auth.claims.email" + # + # Example (Logic): + # + # title: "Public documents" + # description: "Determine whether the document should be publicly visible" + # expression: "document.type != 'private' && document.type != 'internal'" + # + # Example (Data Manipulation): + # + # title: "Notification string" + # description: "Create a notification string with a timestamp." + # expression: "'New message received at ' + string(document.create_time)" + # + # The exact variables and functions that may be referenced within an expression + # are determined by the service that evaluates it. See the service + # documentation for additional information. + # @!attribute [rw] expression + # @return [::String] + # Textual representation of an expression in Common Expression Language + # syntax. + # @!attribute [rw] title + # @return [::String] + # Optional. Title for the expression, i.e. a short string describing + # its purpose. This can be used e.g. in UIs which allow to enter the + # expression. + # @!attribute [rw] description + # @return [::String] + # Optional. Description of the expression. This is a longer text which + # describes the expression, e.g. when hovered over it in a UI. + # @!attribute [rw] location + # @return [::String] + # Optional. String indicating the location of the expression for error + # reporting, e.g. a file name and a position in the file. + class Expr + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end +end diff --git a/owl-bot-staging/google-cloud-security_center-v2/snippets/Gemfile b/owl-bot-staging/google-cloud-security_center-v2/snippets/Gemfile new file mode 100644 index 000000000000..99432c66bb92 --- /dev/null +++ b/owl-bot-staging/google-cloud-security_center-v2/snippets/Gemfile @@ -0,0 +1,32 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +source "https://rubygems.org" + +if ENV["GOOGLE_CLOUD_SAMPLES_TEST"] == "master" + gem "google-cloud-security_center-v2", path: "../" +else + gem "google-cloud-security_center-v2" +end + +group :test do + gem "google-style", "~> 1.26.1" + gem "minitest", "~> 5.16" + gem "minitest-focus", "~> 1.1" + gem "minitest-hooks", "~> 1.5" +end diff --git a/owl-bot-staging/google-cloud-security_center-v2/snippets/security_center/batch_create_resource_value_configs.rb b/owl-bot-staging/google-cloud-security_center-v2/snippets/security_center/batch_create_resource_value_configs.rb new file mode 100644 index 000000000000..35868ebf184f --- /dev/null +++ b/owl-bot-staging/google-cloud-security_center-v2/snippets/security_center/batch_create_resource_value_configs.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 securitycenter_v2_generated_SecurityCenter_BatchCreateResourceValueConfigs_sync] +require "google/cloud/security_center/v2" + +## +# Snippet for the batch_create_resource_value_configs call in the SecurityCenter service +# +# This snippet has been automatically generated and should be regarded as a code +# template only. It will require modifications to work: +# - It may require correct/in-range values for request initialization. +# - It may require specifying regional endpoints when creating the service +# client as shown in https://cloud.google.com/ruby/docs/reference. +# +# This is an auto-generated example demonstrating basic usage of +# Google::Cloud::SecurityCenter::V2::SecurityCenter::Client#batch_create_resource_value_configs. +# +def batch_create_resource_value_configs + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::SecurityCenter::V2::SecurityCenter::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::SecurityCenter::V2::BatchCreateResourceValueConfigsRequest.new + + # Call the batch_create_resource_value_configs method. + result = client.batch_create_resource_value_configs request + + # The returned object is of type Google::Cloud::SecurityCenter::V2::BatchCreateResourceValueConfigsResponse. + p result +end +# [END securitycenter_v2_generated_SecurityCenter_BatchCreateResourceValueConfigs_sync] diff --git a/owl-bot-staging/google-cloud-security_center-v2/snippets/security_center/bulk_mute_findings.rb b/owl-bot-staging/google-cloud-security_center-v2/snippets/security_center/bulk_mute_findings.rb new file mode 100644 index 000000000000..937f173f1687 --- /dev/null +++ b/owl-bot-staging/google-cloud-security_center-v2/snippets/security_center/bulk_mute_findings.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 securitycenter_v2_generated_SecurityCenter_BulkMuteFindings_sync] +require "google/cloud/security_center/v2" + +## +# Snippet for the bulk_mute_findings call in the SecurityCenter service +# +# This snippet has been automatically generated and should be regarded as a code +# template only. It will require modifications to work: +# - It may require correct/in-range values for request initialization. +# - It may require specifying regional endpoints when creating the service +# client as shown in https://cloud.google.com/ruby/docs/reference. +# +# This is an auto-generated example demonstrating basic usage of +# Google::Cloud::SecurityCenter::V2::SecurityCenter::Client#bulk_mute_findings. +# +def bulk_mute_findings + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::SecurityCenter::V2::SecurityCenter::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::SecurityCenter::V2::BulkMuteFindingsRequest.new + + # Call the bulk_mute_findings method. + result = client.bulk_mute_findings 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 securitycenter_v2_generated_SecurityCenter_BulkMuteFindings_sync] diff --git a/owl-bot-staging/google-cloud-security_center-v2/snippets/security_center/create_big_query_export.rb b/owl-bot-staging/google-cloud-security_center-v2/snippets/security_center/create_big_query_export.rb new file mode 100644 index 000000000000..34909f562782 --- /dev/null +++ b/owl-bot-staging/google-cloud-security_center-v2/snippets/security_center/create_big_query_export.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 securitycenter_v2_generated_SecurityCenter_CreateBigQueryExport_sync] +require "google/cloud/security_center/v2" + +## +# Snippet for the create_big_query_export call in the SecurityCenter service +# +# This snippet has been automatically generated and should be regarded as a code +# template only. It will require modifications to work: +# - It may require correct/in-range values for request initialization. +# - It may require specifying regional endpoints when creating the service +# client as shown in https://cloud.google.com/ruby/docs/reference. +# +# This is an auto-generated example demonstrating basic usage of +# Google::Cloud::SecurityCenter::V2::SecurityCenter::Client#create_big_query_export. +# +def create_big_query_export + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::SecurityCenter::V2::SecurityCenter::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::SecurityCenter::V2::CreateBigQueryExportRequest.new + + # Call the create_big_query_export method. + result = client.create_big_query_export request + + # The returned object is of type Google::Cloud::SecurityCenter::V2::BigQueryExport. + p result +end +# [END securitycenter_v2_generated_SecurityCenter_CreateBigQueryExport_sync] diff --git a/owl-bot-staging/google-cloud-security_center-v2/snippets/security_center/create_finding.rb b/owl-bot-staging/google-cloud-security_center-v2/snippets/security_center/create_finding.rb new file mode 100644 index 000000000000..b2dbeb349717 --- /dev/null +++ b/owl-bot-staging/google-cloud-security_center-v2/snippets/security_center/create_finding.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 securitycenter_v2_generated_SecurityCenter_CreateFinding_sync] +require "google/cloud/security_center/v2" + +## +# Snippet for the create_finding call in the SecurityCenter service +# +# This snippet has been automatically generated and should be regarded as a code +# template only. It will require modifications to work: +# - It may require correct/in-range values for request initialization. +# - It may require specifying regional endpoints when creating the service +# client as shown in https://cloud.google.com/ruby/docs/reference. +# +# This is an auto-generated example demonstrating basic usage of +# Google::Cloud::SecurityCenter::V2::SecurityCenter::Client#create_finding. +# +def create_finding + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::SecurityCenter::V2::SecurityCenter::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::SecurityCenter::V2::CreateFindingRequest.new + + # Call the create_finding method. + result = client.create_finding request + + # The returned object is of type Google::Cloud::SecurityCenter::V2::Finding. + p result +end +# [END securitycenter_v2_generated_SecurityCenter_CreateFinding_sync] diff --git a/owl-bot-staging/google-cloud-security_center-v2/snippets/security_center/create_mute_config.rb b/owl-bot-staging/google-cloud-security_center-v2/snippets/security_center/create_mute_config.rb new file mode 100644 index 000000000000..5ac853e23ca6 --- /dev/null +++ b/owl-bot-staging/google-cloud-security_center-v2/snippets/security_center/create_mute_config.rb @@ -0,0 +1,47 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +# [START securitycenter_v2_generated_SecurityCenter_CreateMuteConfig_sync] +require "google/cloud/security_center/v2" + +## +# Snippet for the create_mute_config call in the SecurityCenter service +# +# This snippet has been automatically generated and should be regarded as a code +# template only. It will require modifications to work: +# - It may require correct/in-range values for request initialization. +# - It may require specifying regional endpoints when creating the service +# client as shown in https://cloud.google.com/ruby/docs/reference. +# +# This is an auto-generated example demonstrating basic usage of +# Google::Cloud::SecurityCenter::V2::SecurityCenter::Client#create_mute_config. +# +def create_mute_config + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::SecurityCenter::V2::SecurityCenter::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::SecurityCenter::V2::CreateMuteConfigRequest.new + + # Call the create_mute_config method. + result = client.create_mute_config request + + # The returned object is of type Google::Cloud::SecurityCenter::V2::MuteConfig. + p result +end +# [END securitycenter_v2_generated_SecurityCenter_CreateMuteConfig_sync] diff --git a/owl-bot-staging/google-cloud-security_center-v2/snippets/security_center/create_notification_config.rb b/owl-bot-staging/google-cloud-security_center-v2/snippets/security_center/create_notification_config.rb new file mode 100644 index 000000000000..8d63ccdb2cc6 --- /dev/null +++ b/owl-bot-staging/google-cloud-security_center-v2/snippets/security_center/create_notification_config.rb @@ -0,0 +1,47 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +# [START securitycenter_v2_generated_SecurityCenter_CreateNotificationConfig_sync] +require "google/cloud/security_center/v2" + +## +# Snippet for the create_notification_config call in the SecurityCenter service +# +# This snippet has been automatically generated and should be regarded as a code +# template only. It will require modifications to work: +# - It may require correct/in-range values for request initialization. +# - It may require specifying regional endpoints when creating the service +# client as shown in https://cloud.google.com/ruby/docs/reference. +# +# This is an auto-generated example demonstrating basic usage of +# Google::Cloud::SecurityCenter::V2::SecurityCenter::Client#create_notification_config. +# +def create_notification_config + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::SecurityCenter::V2::SecurityCenter::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::SecurityCenter::V2::CreateNotificationConfigRequest.new + + # Call the create_notification_config method. + result = client.create_notification_config request + + # The returned object is of type Google::Cloud::SecurityCenter::V2::NotificationConfig. + p result +end +# [END securitycenter_v2_generated_SecurityCenter_CreateNotificationConfig_sync] diff --git a/owl-bot-staging/google-cloud-security_center-v2/snippets/security_center/create_source.rb b/owl-bot-staging/google-cloud-security_center-v2/snippets/security_center/create_source.rb new file mode 100644 index 000000000000..042a0de0ff05 --- /dev/null +++ b/owl-bot-staging/google-cloud-security_center-v2/snippets/security_center/create_source.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 securitycenter_v2_generated_SecurityCenter_CreateSource_sync] +require "google/cloud/security_center/v2" + +## +# Snippet for the create_source call in the SecurityCenter service +# +# This snippet has been automatically generated and should be regarded as a code +# template only. It will require modifications to work: +# - It may require correct/in-range values for request initialization. +# - It may require specifying regional endpoints when creating the service +# client as shown in https://cloud.google.com/ruby/docs/reference. +# +# This is an auto-generated example demonstrating basic usage of +# Google::Cloud::SecurityCenter::V2::SecurityCenter::Client#create_source. +# +def create_source + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::SecurityCenter::V2::SecurityCenter::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::SecurityCenter::V2::CreateSourceRequest.new + + # Call the create_source method. + result = client.create_source request + + # The returned object is of type Google::Cloud::SecurityCenter::V2::Source. + p result +end +# [END securitycenter_v2_generated_SecurityCenter_CreateSource_sync] diff --git a/owl-bot-staging/google-cloud-security_center-v2/snippets/security_center/delete_big_query_export.rb b/owl-bot-staging/google-cloud-security_center-v2/snippets/security_center/delete_big_query_export.rb new file mode 100644 index 000000000000..c5b9ec740f3f --- /dev/null +++ b/owl-bot-staging/google-cloud-security_center-v2/snippets/security_center/delete_big_query_export.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 securitycenter_v2_generated_SecurityCenter_DeleteBigQueryExport_sync] +require "google/cloud/security_center/v2" + +## +# Snippet for the delete_big_query_export call in the SecurityCenter service +# +# This snippet has been automatically generated and should be regarded as a code +# template only. It will require modifications to work: +# - It may require correct/in-range values for request initialization. +# - It may require specifying regional endpoints when creating the service +# client as shown in https://cloud.google.com/ruby/docs/reference. +# +# This is an auto-generated example demonstrating basic usage of +# Google::Cloud::SecurityCenter::V2::SecurityCenter::Client#delete_big_query_export. +# +def delete_big_query_export + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::SecurityCenter::V2::SecurityCenter::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::SecurityCenter::V2::DeleteBigQueryExportRequest.new + + # Call the delete_big_query_export method. + result = client.delete_big_query_export request + + # The returned object is of type Google::Protobuf::Empty. + p result +end +# [END securitycenter_v2_generated_SecurityCenter_DeleteBigQueryExport_sync] diff --git a/owl-bot-staging/google-cloud-security_center-v2/snippets/security_center/delete_mute_config.rb b/owl-bot-staging/google-cloud-security_center-v2/snippets/security_center/delete_mute_config.rb new file mode 100644 index 000000000000..f6d9fe6232b5 --- /dev/null +++ b/owl-bot-staging/google-cloud-security_center-v2/snippets/security_center/delete_mute_config.rb @@ -0,0 +1,47 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +# [START securitycenter_v2_generated_SecurityCenter_DeleteMuteConfig_sync] +require "google/cloud/security_center/v2" + +## +# Snippet for the delete_mute_config call in the SecurityCenter service +# +# This snippet has been automatically generated and should be regarded as a code +# template only. It will require modifications to work: +# - It may require correct/in-range values for request initialization. +# - It may require specifying regional endpoints when creating the service +# client as shown in https://cloud.google.com/ruby/docs/reference. +# +# This is an auto-generated example demonstrating basic usage of +# Google::Cloud::SecurityCenter::V2::SecurityCenter::Client#delete_mute_config. +# +def delete_mute_config + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::SecurityCenter::V2::SecurityCenter::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::SecurityCenter::V2::DeleteMuteConfigRequest.new + + # Call the delete_mute_config method. + result = client.delete_mute_config request + + # The returned object is of type Google::Protobuf::Empty. + p result +end +# [END securitycenter_v2_generated_SecurityCenter_DeleteMuteConfig_sync] diff --git a/owl-bot-staging/google-cloud-security_center-v2/snippets/security_center/delete_notification_config.rb b/owl-bot-staging/google-cloud-security_center-v2/snippets/security_center/delete_notification_config.rb new file mode 100644 index 000000000000..e7084636df2d --- /dev/null +++ b/owl-bot-staging/google-cloud-security_center-v2/snippets/security_center/delete_notification_config.rb @@ -0,0 +1,47 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +# [START securitycenter_v2_generated_SecurityCenter_DeleteNotificationConfig_sync] +require "google/cloud/security_center/v2" + +## +# Snippet for the delete_notification_config call in the SecurityCenter service +# +# This snippet has been automatically generated and should be regarded as a code +# template only. It will require modifications to work: +# - It may require correct/in-range values for request initialization. +# - It may require specifying regional endpoints when creating the service +# client as shown in https://cloud.google.com/ruby/docs/reference. +# +# This is an auto-generated example demonstrating basic usage of +# Google::Cloud::SecurityCenter::V2::SecurityCenter::Client#delete_notification_config. +# +def delete_notification_config + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::SecurityCenter::V2::SecurityCenter::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::SecurityCenter::V2::DeleteNotificationConfigRequest.new + + # Call the delete_notification_config method. + result = client.delete_notification_config request + + # The returned object is of type Google::Protobuf::Empty. + p result +end +# [END securitycenter_v2_generated_SecurityCenter_DeleteNotificationConfig_sync] diff --git a/owl-bot-staging/google-cloud-security_center-v2/snippets/security_center/delete_resource_value_config.rb b/owl-bot-staging/google-cloud-security_center-v2/snippets/security_center/delete_resource_value_config.rb new file mode 100644 index 000000000000..f369d1ca9754 --- /dev/null +++ b/owl-bot-staging/google-cloud-security_center-v2/snippets/security_center/delete_resource_value_config.rb @@ -0,0 +1,47 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +# [START securitycenter_v2_generated_SecurityCenter_DeleteResourceValueConfig_sync] +require "google/cloud/security_center/v2" + +## +# Snippet for the delete_resource_value_config call in the SecurityCenter service +# +# This snippet has been automatically generated and should be regarded as a code +# template only. It will require modifications to work: +# - It may require correct/in-range values for request initialization. +# - It may require specifying regional endpoints when creating the service +# client as shown in https://cloud.google.com/ruby/docs/reference. +# +# This is an auto-generated example demonstrating basic usage of +# Google::Cloud::SecurityCenter::V2::SecurityCenter::Client#delete_resource_value_config. +# +def delete_resource_value_config + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::SecurityCenter::V2::SecurityCenter::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::SecurityCenter::V2::DeleteResourceValueConfigRequest.new + + # Call the delete_resource_value_config method. + result = client.delete_resource_value_config request + + # The returned object is of type Google::Protobuf::Empty. + p result +end +# [END securitycenter_v2_generated_SecurityCenter_DeleteResourceValueConfig_sync] diff --git a/owl-bot-staging/google-cloud-security_center-v2/snippets/security_center/get_big_query_export.rb b/owl-bot-staging/google-cloud-security_center-v2/snippets/security_center/get_big_query_export.rb new file mode 100644 index 000000000000..167844fa3f97 --- /dev/null +++ b/owl-bot-staging/google-cloud-security_center-v2/snippets/security_center/get_big_query_export.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 securitycenter_v2_generated_SecurityCenter_GetBigQueryExport_sync] +require "google/cloud/security_center/v2" + +## +# Snippet for the get_big_query_export call in the SecurityCenter service +# +# This snippet has been automatically generated and should be regarded as a code +# template only. It will require modifications to work: +# - It may require correct/in-range values for request initialization. +# - It may require specifying regional endpoints when creating the service +# client as shown in https://cloud.google.com/ruby/docs/reference. +# +# This is an auto-generated example demonstrating basic usage of +# Google::Cloud::SecurityCenter::V2::SecurityCenter::Client#get_big_query_export. +# +def get_big_query_export + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::SecurityCenter::V2::SecurityCenter::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::SecurityCenter::V2::GetBigQueryExportRequest.new + + # Call the get_big_query_export method. + result = client.get_big_query_export request + + # The returned object is of type Google::Cloud::SecurityCenter::V2::BigQueryExport. + p result +end +# [END securitycenter_v2_generated_SecurityCenter_GetBigQueryExport_sync] diff --git a/owl-bot-staging/google-cloud-security_center-v2/snippets/security_center/get_iam_policy.rb b/owl-bot-staging/google-cloud-security_center-v2/snippets/security_center/get_iam_policy.rb new file mode 100644 index 000000000000..e260df274f67 --- /dev/null +++ b/owl-bot-staging/google-cloud-security_center-v2/snippets/security_center/get_iam_policy.rb @@ -0,0 +1,47 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +# [START securitycenter_v2_generated_SecurityCenter_GetIamPolicy_sync] +require "google/cloud/security_center/v2" + +## +# Snippet for the get_iam_policy call in the SecurityCenter service +# +# This snippet has been automatically generated and should be regarded as a code +# template only. It will require modifications to work: +# - It may require correct/in-range values for request initialization. +# - It may require specifying regional endpoints when creating the service +# client as shown in https://cloud.google.com/ruby/docs/reference. +# +# This is an auto-generated example demonstrating basic usage of +# Google::Cloud::SecurityCenter::V2::SecurityCenter::Client#get_iam_policy. +# +def get_iam_policy + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::SecurityCenter::V2::SecurityCenter::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Iam::V1::GetIamPolicyRequest.new + + # Call the get_iam_policy method. + result = client.get_iam_policy request + + # The returned object is of type Google::Iam::V1::Policy. + p result +end +# [END securitycenter_v2_generated_SecurityCenter_GetIamPolicy_sync] diff --git a/owl-bot-staging/google-cloud-security_center-v2/snippets/security_center/get_mute_config.rb b/owl-bot-staging/google-cloud-security_center-v2/snippets/security_center/get_mute_config.rb new file mode 100644 index 000000000000..737f0b9b778a --- /dev/null +++ b/owl-bot-staging/google-cloud-security_center-v2/snippets/security_center/get_mute_config.rb @@ -0,0 +1,47 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +# [START securitycenter_v2_generated_SecurityCenter_GetMuteConfig_sync] +require "google/cloud/security_center/v2" + +## +# Snippet for the get_mute_config call in the SecurityCenter service +# +# This snippet has been automatically generated and should be regarded as a code +# template only. It will require modifications to work: +# - It may require correct/in-range values for request initialization. +# - It may require specifying regional endpoints when creating the service +# client as shown in https://cloud.google.com/ruby/docs/reference. +# +# This is an auto-generated example demonstrating basic usage of +# Google::Cloud::SecurityCenter::V2::SecurityCenter::Client#get_mute_config. +# +def get_mute_config + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::SecurityCenter::V2::SecurityCenter::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::SecurityCenter::V2::GetMuteConfigRequest.new + + # Call the get_mute_config method. + result = client.get_mute_config request + + # The returned object is of type Google::Cloud::SecurityCenter::V2::MuteConfig. + p result +end +# [END securitycenter_v2_generated_SecurityCenter_GetMuteConfig_sync] diff --git a/owl-bot-staging/google-cloud-security_center-v2/snippets/security_center/get_notification_config.rb b/owl-bot-staging/google-cloud-security_center-v2/snippets/security_center/get_notification_config.rb new file mode 100644 index 000000000000..a6e6fe0bf43d --- /dev/null +++ b/owl-bot-staging/google-cloud-security_center-v2/snippets/security_center/get_notification_config.rb @@ -0,0 +1,47 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +# [START securitycenter_v2_generated_SecurityCenter_GetNotificationConfig_sync] +require "google/cloud/security_center/v2" + +## +# Snippet for the get_notification_config call in the SecurityCenter service +# +# This snippet has been automatically generated and should be regarded as a code +# template only. It will require modifications to work: +# - It may require correct/in-range values for request initialization. +# - It may require specifying regional endpoints when creating the service +# client as shown in https://cloud.google.com/ruby/docs/reference. +# +# This is an auto-generated example demonstrating basic usage of +# Google::Cloud::SecurityCenter::V2::SecurityCenter::Client#get_notification_config. +# +def get_notification_config + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::SecurityCenter::V2::SecurityCenter::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::SecurityCenter::V2::GetNotificationConfigRequest.new + + # Call the get_notification_config method. + result = client.get_notification_config request + + # The returned object is of type Google::Cloud::SecurityCenter::V2::NotificationConfig. + p result +end +# [END securitycenter_v2_generated_SecurityCenter_GetNotificationConfig_sync] diff --git a/owl-bot-staging/google-cloud-security_center-v2/snippets/security_center/get_resource_value_config.rb b/owl-bot-staging/google-cloud-security_center-v2/snippets/security_center/get_resource_value_config.rb new file mode 100644 index 000000000000..dca8397631b9 --- /dev/null +++ b/owl-bot-staging/google-cloud-security_center-v2/snippets/security_center/get_resource_value_config.rb @@ -0,0 +1,47 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +# [START securitycenter_v2_generated_SecurityCenter_GetResourceValueConfig_sync] +require "google/cloud/security_center/v2" + +## +# Snippet for the get_resource_value_config call in the SecurityCenter service +# +# This snippet has been automatically generated and should be regarded as a code +# template only. It will require modifications to work: +# - It may require correct/in-range values for request initialization. +# - It may require specifying regional endpoints when creating the service +# client as shown in https://cloud.google.com/ruby/docs/reference. +# +# This is an auto-generated example demonstrating basic usage of +# Google::Cloud::SecurityCenter::V2::SecurityCenter::Client#get_resource_value_config. +# +def get_resource_value_config + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::SecurityCenter::V2::SecurityCenter::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::SecurityCenter::V2::GetResourceValueConfigRequest.new + + # Call the get_resource_value_config method. + result = client.get_resource_value_config request + + # The returned object is of type Google::Cloud::SecurityCenter::V2::ResourceValueConfig. + p result +end +# [END securitycenter_v2_generated_SecurityCenter_GetResourceValueConfig_sync] diff --git a/owl-bot-staging/google-cloud-security_center-v2/snippets/security_center/get_simulation.rb b/owl-bot-staging/google-cloud-security_center-v2/snippets/security_center/get_simulation.rb new file mode 100644 index 000000000000..97887b9c87b5 --- /dev/null +++ b/owl-bot-staging/google-cloud-security_center-v2/snippets/security_center/get_simulation.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 securitycenter_v2_generated_SecurityCenter_GetSimulation_sync] +require "google/cloud/security_center/v2" + +## +# Snippet for the get_simulation call in the SecurityCenter service +# +# This snippet has been automatically generated and should be regarded as a code +# template only. It will require modifications to work: +# - It may require correct/in-range values for request initialization. +# - It may require specifying regional endpoints when creating the service +# client as shown in https://cloud.google.com/ruby/docs/reference. +# +# This is an auto-generated example demonstrating basic usage of +# Google::Cloud::SecurityCenter::V2::SecurityCenter::Client#get_simulation. +# +def get_simulation + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::SecurityCenter::V2::SecurityCenter::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::SecurityCenter::V2::GetSimulationRequest.new + + # Call the get_simulation method. + result = client.get_simulation request + + # The returned object is of type Google::Cloud::SecurityCenter::V2::Simulation. + p result +end +# [END securitycenter_v2_generated_SecurityCenter_GetSimulation_sync] diff --git a/owl-bot-staging/google-cloud-security_center-v2/snippets/security_center/get_source.rb b/owl-bot-staging/google-cloud-security_center-v2/snippets/security_center/get_source.rb new file mode 100644 index 000000000000..9e23b772526e --- /dev/null +++ b/owl-bot-staging/google-cloud-security_center-v2/snippets/security_center/get_source.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 securitycenter_v2_generated_SecurityCenter_GetSource_sync] +require "google/cloud/security_center/v2" + +## +# Snippet for the get_source call in the SecurityCenter service +# +# This snippet has been automatically generated and should be regarded as a code +# template only. It will require modifications to work: +# - It may require correct/in-range values for request initialization. +# - It may require specifying regional endpoints when creating the service +# client as shown in https://cloud.google.com/ruby/docs/reference. +# +# This is an auto-generated example demonstrating basic usage of +# Google::Cloud::SecurityCenter::V2::SecurityCenter::Client#get_source. +# +def get_source + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::SecurityCenter::V2::SecurityCenter::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::SecurityCenter::V2::GetSourceRequest.new + + # Call the get_source method. + result = client.get_source request + + # The returned object is of type Google::Cloud::SecurityCenter::V2::Source. + p result +end +# [END securitycenter_v2_generated_SecurityCenter_GetSource_sync] diff --git a/owl-bot-staging/google-cloud-security_center-v2/snippets/security_center/get_valued_resource.rb b/owl-bot-staging/google-cloud-security_center-v2/snippets/security_center/get_valued_resource.rb new file mode 100644 index 000000000000..1d27e0e2a2bd --- /dev/null +++ b/owl-bot-staging/google-cloud-security_center-v2/snippets/security_center/get_valued_resource.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 securitycenter_v2_generated_SecurityCenter_GetValuedResource_sync] +require "google/cloud/security_center/v2" + +## +# Snippet for the get_valued_resource call in the SecurityCenter service +# +# This snippet has been automatically generated and should be regarded as a code +# template only. It will require modifications to work: +# - It may require correct/in-range values for request initialization. +# - It may require specifying regional endpoints when creating the service +# client as shown in https://cloud.google.com/ruby/docs/reference. +# +# This is an auto-generated example demonstrating basic usage of +# Google::Cloud::SecurityCenter::V2::SecurityCenter::Client#get_valued_resource. +# +def get_valued_resource + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::SecurityCenter::V2::SecurityCenter::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::SecurityCenter::V2::GetValuedResourceRequest.new + + # Call the get_valued_resource method. + result = client.get_valued_resource request + + # The returned object is of type Google::Cloud::SecurityCenter::V2::ValuedResource. + p result +end +# [END securitycenter_v2_generated_SecurityCenter_GetValuedResource_sync] diff --git a/owl-bot-staging/google-cloud-security_center-v2/snippets/security_center/group_findings.rb b/owl-bot-staging/google-cloud-security_center-v2/snippets/security_center/group_findings.rb new file mode 100644 index 000000000000..1c83d2e734fb --- /dev/null +++ b/owl-bot-staging/google-cloud-security_center-v2/snippets/security_center/group_findings.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 securitycenter_v2_generated_SecurityCenter_GroupFindings_sync] +require "google/cloud/security_center/v2" + +## +# Snippet for the group_findings call in the SecurityCenter service +# +# This snippet has been automatically generated and should be regarded as a code +# template only. It will require modifications to work: +# - It may require correct/in-range values for request initialization. +# - It may require specifying regional endpoints when creating the service +# client as shown in https://cloud.google.com/ruby/docs/reference. +# +# This is an auto-generated example demonstrating basic usage of +# Google::Cloud::SecurityCenter::V2::SecurityCenter::Client#group_findings. +# +def group_findings + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::SecurityCenter::V2::SecurityCenter::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::SecurityCenter::V2::GroupFindingsRequest.new + + # Call the group_findings method. + result = client.group_findings request + + # The returned object is of type Gapic::PagedEnumerable. You can iterate + # over elements, and API calls will be issued to fetch pages as needed. + result.each do |item| + # Each element is of type ::Google::Cloud::SecurityCenter::V2::GroupResult. + p item + end +end +# [END securitycenter_v2_generated_SecurityCenter_GroupFindings_sync] diff --git a/owl-bot-staging/google-cloud-security_center-v2/snippets/security_center/list_attack_paths.rb b/owl-bot-staging/google-cloud-security_center-v2/snippets/security_center/list_attack_paths.rb new file mode 100644 index 000000000000..efd9cc9a111e --- /dev/null +++ b/owl-bot-staging/google-cloud-security_center-v2/snippets/security_center/list_attack_paths.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 securitycenter_v2_generated_SecurityCenter_ListAttackPaths_sync] +require "google/cloud/security_center/v2" + +## +# Snippet for the list_attack_paths call in the SecurityCenter service +# +# This snippet has been automatically generated and should be regarded as a code +# template only. It will require modifications to work: +# - It may require correct/in-range values for request initialization. +# - It may require specifying regional endpoints when creating the service +# client as shown in https://cloud.google.com/ruby/docs/reference. +# +# This is an auto-generated example demonstrating basic usage of +# Google::Cloud::SecurityCenter::V2::SecurityCenter::Client#list_attack_paths. +# +def list_attack_paths + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::SecurityCenter::V2::SecurityCenter::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::SecurityCenter::V2::ListAttackPathsRequest.new + + # Call the list_attack_paths method. + result = client.list_attack_paths request + + # The returned object is of type Gapic::PagedEnumerable. You can iterate + # over elements, and API calls will be issued to fetch pages as needed. + result.each do |item| + # Each element is of type ::Google::Cloud::SecurityCenter::V2::AttackPath. + p item + end +end +# [END securitycenter_v2_generated_SecurityCenter_ListAttackPaths_sync] diff --git a/owl-bot-staging/google-cloud-security_center-v2/snippets/security_center/list_big_query_exports.rb b/owl-bot-staging/google-cloud-security_center-v2/snippets/security_center/list_big_query_exports.rb new file mode 100644 index 000000000000..b499ded4d8b6 --- /dev/null +++ b/owl-bot-staging/google-cloud-security_center-v2/snippets/security_center/list_big_query_exports.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 securitycenter_v2_generated_SecurityCenter_ListBigQueryExports_sync] +require "google/cloud/security_center/v2" + +## +# Snippet for the list_big_query_exports call in the SecurityCenter service +# +# This snippet has been automatically generated and should be regarded as a code +# template only. It will require modifications to work: +# - It may require correct/in-range values for request initialization. +# - It may require specifying regional endpoints when creating the service +# client as shown in https://cloud.google.com/ruby/docs/reference. +# +# This is an auto-generated example demonstrating basic usage of +# Google::Cloud::SecurityCenter::V2::SecurityCenter::Client#list_big_query_exports. +# +def list_big_query_exports + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::SecurityCenter::V2::SecurityCenter::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::SecurityCenter::V2::ListBigQueryExportsRequest.new + + # Call the list_big_query_exports method. + result = client.list_big_query_exports request + + # The returned object is of type Gapic::PagedEnumerable. You can iterate + # over elements, and API calls will be issued to fetch pages as needed. + result.each do |item| + # Each element is of type ::Google::Cloud::SecurityCenter::V2::BigQueryExport. + p item + end +end +# [END securitycenter_v2_generated_SecurityCenter_ListBigQueryExports_sync] diff --git a/owl-bot-staging/google-cloud-security_center-v2/snippets/security_center/list_findings.rb b/owl-bot-staging/google-cloud-security_center-v2/snippets/security_center/list_findings.rb new file mode 100644 index 000000000000..f8f726312d73 --- /dev/null +++ b/owl-bot-staging/google-cloud-security_center-v2/snippets/security_center/list_findings.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 securitycenter_v2_generated_SecurityCenter_ListFindings_sync] +require "google/cloud/security_center/v2" + +## +# Snippet for the list_findings call in the SecurityCenter service +# +# This snippet has been automatically generated and should be regarded as a code +# template only. It will require modifications to work: +# - It may require correct/in-range values for request initialization. +# - It may require specifying regional endpoints when creating the service +# client as shown in https://cloud.google.com/ruby/docs/reference. +# +# This is an auto-generated example demonstrating basic usage of +# Google::Cloud::SecurityCenter::V2::SecurityCenter::Client#list_findings. +# +def list_findings + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::SecurityCenter::V2::SecurityCenter::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::SecurityCenter::V2::ListFindingsRequest.new + + # Call the list_findings method. + result = client.list_findings request + + # The returned object is of type Gapic::PagedEnumerable. You can iterate + # over elements, and API calls will be issued to fetch pages as needed. + result.each do |item| + # Each element is of type ::Google::Cloud::SecurityCenter::V2::ListFindingsResponse::ListFindingsResult. + p item + end +end +# [END securitycenter_v2_generated_SecurityCenter_ListFindings_sync] diff --git a/owl-bot-staging/google-cloud-security_center-v2/snippets/security_center/list_mute_configs.rb b/owl-bot-staging/google-cloud-security_center-v2/snippets/security_center/list_mute_configs.rb new file mode 100644 index 000000000000..aa028407968b --- /dev/null +++ b/owl-bot-staging/google-cloud-security_center-v2/snippets/security_center/list_mute_configs.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 securitycenter_v2_generated_SecurityCenter_ListMuteConfigs_sync] +require "google/cloud/security_center/v2" + +## +# Snippet for the list_mute_configs call in the SecurityCenter service +# +# This snippet has been automatically generated and should be regarded as a code +# template only. It will require modifications to work: +# - It may require correct/in-range values for request initialization. +# - It may require specifying regional endpoints when creating the service +# client as shown in https://cloud.google.com/ruby/docs/reference. +# +# This is an auto-generated example demonstrating basic usage of +# Google::Cloud::SecurityCenter::V2::SecurityCenter::Client#list_mute_configs. +# +def list_mute_configs + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::SecurityCenter::V2::SecurityCenter::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::SecurityCenter::V2::ListMuteConfigsRequest.new + + # Call the list_mute_configs method. + result = client.list_mute_configs request + + # The returned object is of type Gapic::PagedEnumerable. You can iterate + # over elements, and API calls will be issued to fetch pages as needed. + result.each do |item| + # Each element is of type ::Google::Cloud::SecurityCenter::V2::MuteConfig. + p item + end +end +# [END securitycenter_v2_generated_SecurityCenter_ListMuteConfigs_sync] diff --git a/owl-bot-staging/google-cloud-security_center-v2/snippets/security_center/list_notification_configs.rb b/owl-bot-staging/google-cloud-security_center-v2/snippets/security_center/list_notification_configs.rb new file mode 100644 index 000000000000..421f44da22ce --- /dev/null +++ b/owl-bot-staging/google-cloud-security_center-v2/snippets/security_center/list_notification_configs.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 securitycenter_v2_generated_SecurityCenter_ListNotificationConfigs_sync] +require "google/cloud/security_center/v2" + +## +# Snippet for the list_notification_configs call in the SecurityCenter service +# +# This snippet has been automatically generated and should be regarded as a code +# template only. It will require modifications to work: +# - It may require correct/in-range values for request initialization. +# - It may require specifying regional endpoints when creating the service +# client as shown in https://cloud.google.com/ruby/docs/reference. +# +# This is an auto-generated example demonstrating basic usage of +# Google::Cloud::SecurityCenter::V2::SecurityCenter::Client#list_notification_configs. +# +def list_notification_configs + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::SecurityCenter::V2::SecurityCenter::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::SecurityCenter::V2::ListNotificationConfigsRequest.new + + # Call the list_notification_configs method. + result = client.list_notification_configs request + + # The returned object is of type Gapic::PagedEnumerable. You can iterate + # over elements, and API calls will be issued to fetch pages as needed. + result.each do |item| + # Each element is of type ::Google::Cloud::SecurityCenter::V2::NotificationConfig. + p item + end +end +# [END securitycenter_v2_generated_SecurityCenter_ListNotificationConfigs_sync] diff --git a/owl-bot-staging/google-cloud-security_center-v2/snippets/security_center/list_resource_value_configs.rb b/owl-bot-staging/google-cloud-security_center-v2/snippets/security_center/list_resource_value_configs.rb new file mode 100644 index 000000000000..ebd23f97037d --- /dev/null +++ b/owl-bot-staging/google-cloud-security_center-v2/snippets/security_center/list_resource_value_configs.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 securitycenter_v2_generated_SecurityCenter_ListResourceValueConfigs_sync] +require "google/cloud/security_center/v2" + +## +# Snippet for the list_resource_value_configs call in the SecurityCenter service +# +# This snippet has been automatically generated and should be regarded as a code +# template only. It will require modifications to work: +# - It may require correct/in-range values for request initialization. +# - It may require specifying regional endpoints when creating the service +# client as shown in https://cloud.google.com/ruby/docs/reference. +# +# This is an auto-generated example demonstrating basic usage of +# Google::Cloud::SecurityCenter::V2::SecurityCenter::Client#list_resource_value_configs. +# +def list_resource_value_configs + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::SecurityCenter::V2::SecurityCenter::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::SecurityCenter::V2::ListResourceValueConfigsRequest.new + + # Call the list_resource_value_configs method. + result = client.list_resource_value_configs request + + # The returned object is of type Gapic::PagedEnumerable. You can iterate + # over elements, and API calls will be issued to fetch pages as needed. + result.each do |item| + # Each element is of type ::Google::Cloud::SecurityCenter::V2::ResourceValueConfig. + p item + end +end +# [END securitycenter_v2_generated_SecurityCenter_ListResourceValueConfigs_sync] diff --git a/owl-bot-staging/google-cloud-security_center-v2/snippets/security_center/list_sources.rb b/owl-bot-staging/google-cloud-security_center-v2/snippets/security_center/list_sources.rb new file mode 100644 index 000000000000..0d014e61ce97 --- /dev/null +++ b/owl-bot-staging/google-cloud-security_center-v2/snippets/security_center/list_sources.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 securitycenter_v2_generated_SecurityCenter_ListSources_sync] +require "google/cloud/security_center/v2" + +## +# Snippet for the list_sources call in the SecurityCenter service +# +# This snippet has been automatically generated and should be regarded as a code +# template only. It will require modifications to work: +# - It may require correct/in-range values for request initialization. +# - It may require specifying regional endpoints when creating the service +# client as shown in https://cloud.google.com/ruby/docs/reference. +# +# This is an auto-generated example demonstrating basic usage of +# Google::Cloud::SecurityCenter::V2::SecurityCenter::Client#list_sources. +# +def list_sources + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::SecurityCenter::V2::SecurityCenter::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::SecurityCenter::V2::ListSourcesRequest.new + + # Call the list_sources method. + result = client.list_sources request + + # The returned object is of type Gapic::PagedEnumerable. You can iterate + # over elements, and API calls will be issued to fetch pages as needed. + result.each do |item| + # Each element is of type ::Google::Cloud::SecurityCenter::V2::Source. + p item + end +end +# [END securitycenter_v2_generated_SecurityCenter_ListSources_sync] diff --git a/owl-bot-staging/google-cloud-security_center-v2/snippets/security_center/list_valued_resources.rb b/owl-bot-staging/google-cloud-security_center-v2/snippets/security_center/list_valued_resources.rb new file mode 100644 index 000000000000..ff34383c5836 --- /dev/null +++ b/owl-bot-staging/google-cloud-security_center-v2/snippets/security_center/list_valued_resources.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 securitycenter_v2_generated_SecurityCenter_ListValuedResources_sync] +require "google/cloud/security_center/v2" + +## +# Snippet for the list_valued_resources call in the SecurityCenter service +# +# This snippet has been automatically generated and should be regarded as a code +# template only. It will require modifications to work: +# - It may require correct/in-range values for request initialization. +# - It may require specifying regional endpoints when creating the service +# client as shown in https://cloud.google.com/ruby/docs/reference. +# +# This is an auto-generated example demonstrating basic usage of +# Google::Cloud::SecurityCenter::V2::SecurityCenter::Client#list_valued_resources. +# +def list_valued_resources + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::SecurityCenter::V2::SecurityCenter::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::SecurityCenter::V2::ListValuedResourcesRequest.new + + # Call the list_valued_resources method. + result = client.list_valued_resources request + + # The returned object is of type Gapic::PagedEnumerable. You can iterate + # over elements, and API calls will be issued to fetch pages as needed. + result.each do |item| + # Each element is of type ::Google::Cloud::SecurityCenter::V2::ValuedResource. + p item + end +end +# [END securitycenter_v2_generated_SecurityCenter_ListValuedResources_sync] diff --git a/owl-bot-staging/google-cloud-security_center-v2/snippets/security_center/set_finding_state.rb b/owl-bot-staging/google-cloud-security_center-v2/snippets/security_center/set_finding_state.rb new file mode 100644 index 000000000000..948f27b578d9 --- /dev/null +++ b/owl-bot-staging/google-cloud-security_center-v2/snippets/security_center/set_finding_state.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 securitycenter_v2_generated_SecurityCenter_SetFindingState_sync] +require "google/cloud/security_center/v2" + +## +# Snippet for the set_finding_state call in the SecurityCenter service +# +# This snippet has been automatically generated and should be regarded as a code +# template only. It will require modifications to work: +# - It may require correct/in-range values for request initialization. +# - It may require specifying regional endpoints when creating the service +# client as shown in https://cloud.google.com/ruby/docs/reference. +# +# This is an auto-generated example demonstrating basic usage of +# Google::Cloud::SecurityCenter::V2::SecurityCenter::Client#set_finding_state. +# +def set_finding_state + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::SecurityCenter::V2::SecurityCenter::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::SecurityCenter::V2::SetFindingStateRequest.new + + # Call the set_finding_state method. + result = client.set_finding_state request + + # The returned object is of type Google::Cloud::SecurityCenter::V2::Finding. + p result +end +# [END securitycenter_v2_generated_SecurityCenter_SetFindingState_sync] diff --git a/owl-bot-staging/google-cloud-security_center-v2/snippets/security_center/set_iam_policy.rb b/owl-bot-staging/google-cloud-security_center-v2/snippets/security_center/set_iam_policy.rb new file mode 100644 index 000000000000..357443d72dfc --- /dev/null +++ b/owl-bot-staging/google-cloud-security_center-v2/snippets/security_center/set_iam_policy.rb @@ -0,0 +1,47 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +# [START securitycenter_v2_generated_SecurityCenter_SetIamPolicy_sync] +require "google/cloud/security_center/v2" + +## +# Snippet for the set_iam_policy call in the SecurityCenter service +# +# This snippet has been automatically generated and should be regarded as a code +# template only. It will require modifications to work: +# - It may require correct/in-range values for request initialization. +# - It may require specifying regional endpoints when creating the service +# client as shown in https://cloud.google.com/ruby/docs/reference. +# +# This is an auto-generated example demonstrating basic usage of +# Google::Cloud::SecurityCenter::V2::SecurityCenter::Client#set_iam_policy. +# +def set_iam_policy + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::SecurityCenter::V2::SecurityCenter::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Iam::V1::SetIamPolicyRequest.new + + # Call the set_iam_policy method. + result = client.set_iam_policy request + + # The returned object is of type Google::Iam::V1::Policy. + p result +end +# [END securitycenter_v2_generated_SecurityCenter_SetIamPolicy_sync] diff --git a/owl-bot-staging/google-cloud-security_center-v2/snippets/security_center/set_mute.rb b/owl-bot-staging/google-cloud-security_center-v2/snippets/security_center/set_mute.rb new file mode 100644 index 000000000000..7928a7e3a85b --- /dev/null +++ b/owl-bot-staging/google-cloud-security_center-v2/snippets/security_center/set_mute.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 securitycenter_v2_generated_SecurityCenter_SetMute_sync] +require "google/cloud/security_center/v2" + +## +# Snippet for the set_mute call in the SecurityCenter service +# +# This snippet has been automatically generated and should be regarded as a code +# template only. It will require modifications to work: +# - It may require correct/in-range values for request initialization. +# - It may require specifying regional endpoints when creating the service +# client as shown in https://cloud.google.com/ruby/docs/reference. +# +# This is an auto-generated example demonstrating basic usage of +# Google::Cloud::SecurityCenter::V2::SecurityCenter::Client#set_mute. +# +def set_mute + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::SecurityCenter::V2::SecurityCenter::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::SecurityCenter::V2::SetMuteRequest.new + + # Call the set_mute method. + result = client.set_mute request + + # The returned object is of type Google::Cloud::SecurityCenter::V2::Finding. + p result +end +# [END securitycenter_v2_generated_SecurityCenter_SetMute_sync] diff --git a/owl-bot-staging/google-cloud-security_center-v2/snippets/security_center/test_iam_permissions.rb b/owl-bot-staging/google-cloud-security_center-v2/snippets/security_center/test_iam_permissions.rb new file mode 100644 index 000000000000..7a22e129a409 --- /dev/null +++ b/owl-bot-staging/google-cloud-security_center-v2/snippets/security_center/test_iam_permissions.rb @@ -0,0 +1,47 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +# [START securitycenter_v2_generated_SecurityCenter_TestIamPermissions_sync] +require "google/cloud/security_center/v2" + +## +# Snippet for the test_iam_permissions call in the SecurityCenter service +# +# This snippet has been automatically generated and should be regarded as a code +# template only. It will require modifications to work: +# - It may require correct/in-range values for request initialization. +# - It may require specifying regional endpoints when creating the service +# client as shown in https://cloud.google.com/ruby/docs/reference. +# +# This is an auto-generated example demonstrating basic usage of +# Google::Cloud::SecurityCenter::V2::SecurityCenter::Client#test_iam_permissions. +# +def test_iam_permissions + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::SecurityCenter::V2::SecurityCenter::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Iam::V1::TestIamPermissionsRequest.new + + # Call the test_iam_permissions method. + result = client.test_iam_permissions request + + # The returned object is of type Google::Iam::V1::TestIamPermissionsResponse. + p result +end +# [END securitycenter_v2_generated_SecurityCenter_TestIamPermissions_sync] diff --git a/owl-bot-staging/google-cloud-security_center-v2/snippets/security_center/update_big_query_export.rb b/owl-bot-staging/google-cloud-security_center-v2/snippets/security_center/update_big_query_export.rb new file mode 100644 index 000000000000..c3357e841268 --- /dev/null +++ b/owl-bot-staging/google-cloud-security_center-v2/snippets/security_center/update_big_query_export.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 securitycenter_v2_generated_SecurityCenter_UpdateBigQueryExport_sync] +require "google/cloud/security_center/v2" + +## +# Snippet for the update_big_query_export call in the SecurityCenter service +# +# This snippet has been automatically generated and should be regarded as a code +# template only. It will require modifications to work: +# - It may require correct/in-range values for request initialization. +# - It may require specifying regional endpoints when creating the service +# client as shown in https://cloud.google.com/ruby/docs/reference. +# +# This is an auto-generated example demonstrating basic usage of +# Google::Cloud::SecurityCenter::V2::SecurityCenter::Client#update_big_query_export. +# +def update_big_query_export + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::SecurityCenter::V2::SecurityCenter::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::SecurityCenter::V2::UpdateBigQueryExportRequest.new + + # Call the update_big_query_export method. + result = client.update_big_query_export request + + # The returned object is of type Google::Cloud::SecurityCenter::V2::BigQueryExport. + p result +end +# [END securitycenter_v2_generated_SecurityCenter_UpdateBigQueryExport_sync] diff --git a/owl-bot-staging/google-cloud-security_center-v2/snippets/security_center/update_external_system.rb b/owl-bot-staging/google-cloud-security_center-v2/snippets/security_center/update_external_system.rb new file mode 100644 index 000000000000..58bb7f1196d7 --- /dev/null +++ b/owl-bot-staging/google-cloud-security_center-v2/snippets/security_center/update_external_system.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 securitycenter_v2_generated_SecurityCenter_UpdateExternalSystem_sync] +require "google/cloud/security_center/v2" + +## +# Snippet for the update_external_system call in the SecurityCenter service +# +# This snippet has been automatically generated and should be regarded as a code +# template only. It will require modifications to work: +# - It may require correct/in-range values for request initialization. +# - It may require specifying regional endpoints when creating the service +# client as shown in https://cloud.google.com/ruby/docs/reference. +# +# This is an auto-generated example demonstrating basic usage of +# Google::Cloud::SecurityCenter::V2::SecurityCenter::Client#update_external_system. +# +def update_external_system + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::SecurityCenter::V2::SecurityCenter::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::SecurityCenter::V2::UpdateExternalSystemRequest.new + + # Call the update_external_system method. + result = client.update_external_system request + + # The returned object is of type Google::Cloud::SecurityCenter::V2::ExternalSystem. + p result +end +# [END securitycenter_v2_generated_SecurityCenter_UpdateExternalSystem_sync] diff --git a/owl-bot-staging/google-cloud-security_center-v2/snippets/security_center/update_finding.rb b/owl-bot-staging/google-cloud-security_center-v2/snippets/security_center/update_finding.rb new file mode 100644 index 000000000000..3d8d7bc0e599 --- /dev/null +++ b/owl-bot-staging/google-cloud-security_center-v2/snippets/security_center/update_finding.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 securitycenter_v2_generated_SecurityCenter_UpdateFinding_sync] +require "google/cloud/security_center/v2" + +## +# Snippet for the update_finding call in the SecurityCenter service +# +# This snippet has been automatically generated and should be regarded as a code +# template only. It will require modifications to work: +# - It may require correct/in-range values for request initialization. +# - It may require specifying regional endpoints when creating the service +# client as shown in https://cloud.google.com/ruby/docs/reference. +# +# This is an auto-generated example demonstrating basic usage of +# Google::Cloud::SecurityCenter::V2::SecurityCenter::Client#update_finding. +# +def update_finding + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::SecurityCenter::V2::SecurityCenter::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::SecurityCenter::V2::UpdateFindingRequest.new + + # Call the update_finding method. + result = client.update_finding request + + # The returned object is of type Google::Cloud::SecurityCenter::V2::Finding. + p result +end +# [END securitycenter_v2_generated_SecurityCenter_UpdateFinding_sync] diff --git a/owl-bot-staging/google-cloud-security_center-v2/snippets/security_center/update_mute_config.rb b/owl-bot-staging/google-cloud-security_center-v2/snippets/security_center/update_mute_config.rb new file mode 100644 index 000000000000..efa2c28e01be --- /dev/null +++ b/owl-bot-staging/google-cloud-security_center-v2/snippets/security_center/update_mute_config.rb @@ -0,0 +1,47 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +# [START securitycenter_v2_generated_SecurityCenter_UpdateMuteConfig_sync] +require "google/cloud/security_center/v2" + +## +# Snippet for the update_mute_config call in the SecurityCenter service +# +# This snippet has been automatically generated and should be regarded as a code +# template only. It will require modifications to work: +# - It may require correct/in-range values for request initialization. +# - It may require specifying regional endpoints when creating the service +# client as shown in https://cloud.google.com/ruby/docs/reference. +# +# This is an auto-generated example demonstrating basic usage of +# Google::Cloud::SecurityCenter::V2::SecurityCenter::Client#update_mute_config. +# +def update_mute_config + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::SecurityCenter::V2::SecurityCenter::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::SecurityCenter::V2::UpdateMuteConfigRequest.new + + # Call the update_mute_config method. + result = client.update_mute_config request + + # The returned object is of type Google::Cloud::SecurityCenter::V2::MuteConfig. + p result +end +# [END securitycenter_v2_generated_SecurityCenter_UpdateMuteConfig_sync] diff --git a/owl-bot-staging/google-cloud-security_center-v2/snippets/security_center/update_notification_config.rb b/owl-bot-staging/google-cloud-security_center-v2/snippets/security_center/update_notification_config.rb new file mode 100644 index 000000000000..50e827404937 --- /dev/null +++ b/owl-bot-staging/google-cloud-security_center-v2/snippets/security_center/update_notification_config.rb @@ -0,0 +1,47 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +# [START securitycenter_v2_generated_SecurityCenter_UpdateNotificationConfig_sync] +require "google/cloud/security_center/v2" + +## +# Snippet for the update_notification_config call in the SecurityCenter service +# +# This snippet has been automatically generated and should be regarded as a code +# template only. It will require modifications to work: +# - It may require correct/in-range values for request initialization. +# - It may require specifying regional endpoints when creating the service +# client as shown in https://cloud.google.com/ruby/docs/reference. +# +# This is an auto-generated example demonstrating basic usage of +# Google::Cloud::SecurityCenter::V2::SecurityCenter::Client#update_notification_config. +# +def update_notification_config + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::SecurityCenter::V2::SecurityCenter::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::SecurityCenter::V2::UpdateNotificationConfigRequest.new + + # Call the update_notification_config method. + result = client.update_notification_config request + + # The returned object is of type Google::Cloud::SecurityCenter::V2::NotificationConfig. + p result +end +# [END securitycenter_v2_generated_SecurityCenter_UpdateNotificationConfig_sync] diff --git a/owl-bot-staging/google-cloud-security_center-v2/snippets/security_center/update_resource_value_config.rb b/owl-bot-staging/google-cloud-security_center-v2/snippets/security_center/update_resource_value_config.rb new file mode 100644 index 000000000000..fb28fc12506d --- /dev/null +++ b/owl-bot-staging/google-cloud-security_center-v2/snippets/security_center/update_resource_value_config.rb @@ -0,0 +1,47 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +# [START securitycenter_v2_generated_SecurityCenter_UpdateResourceValueConfig_sync] +require "google/cloud/security_center/v2" + +## +# Snippet for the update_resource_value_config call in the SecurityCenter service +# +# This snippet has been automatically generated and should be regarded as a code +# template only. It will require modifications to work: +# - It may require correct/in-range values for request initialization. +# - It may require specifying regional endpoints when creating the service +# client as shown in https://cloud.google.com/ruby/docs/reference. +# +# This is an auto-generated example demonstrating basic usage of +# Google::Cloud::SecurityCenter::V2::SecurityCenter::Client#update_resource_value_config. +# +def update_resource_value_config + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::SecurityCenter::V2::SecurityCenter::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::SecurityCenter::V2::UpdateResourceValueConfigRequest.new + + # Call the update_resource_value_config method. + result = client.update_resource_value_config request + + # The returned object is of type Google::Cloud::SecurityCenter::V2::ResourceValueConfig. + p result +end +# [END securitycenter_v2_generated_SecurityCenter_UpdateResourceValueConfig_sync] diff --git a/owl-bot-staging/google-cloud-security_center-v2/snippets/security_center/update_security_marks.rb b/owl-bot-staging/google-cloud-security_center-v2/snippets/security_center/update_security_marks.rb new file mode 100644 index 000000000000..828f608dee92 --- /dev/null +++ b/owl-bot-staging/google-cloud-security_center-v2/snippets/security_center/update_security_marks.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 securitycenter_v2_generated_SecurityCenter_UpdateSecurityMarks_sync] +require "google/cloud/security_center/v2" + +## +# Snippet for the update_security_marks call in the SecurityCenter service +# +# This snippet has been automatically generated and should be regarded as a code +# template only. It will require modifications to work: +# - It may require correct/in-range values for request initialization. +# - It may require specifying regional endpoints when creating the service +# client as shown in https://cloud.google.com/ruby/docs/reference. +# +# This is an auto-generated example demonstrating basic usage of +# Google::Cloud::SecurityCenter::V2::SecurityCenter::Client#update_security_marks. +# +def update_security_marks + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::SecurityCenter::V2::SecurityCenter::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::SecurityCenter::V2::UpdateSecurityMarksRequest.new + + # Call the update_security_marks method. + result = client.update_security_marks request + + # The returned object is of type Google::Cloud::SecurityCenter::V2::SecurityMarks. + p result +end +# [END securitycenter_v2_generated_SecurityCenter_UpdateSecurityMarks_sync] diff --git a/owl-bot-staging/google-cloud-security_center-v2/snippets/security_center/update_source.rb b/owl-bot-staging/google-cloud-security_center-v2/snippets/security_center/update_source.rb new file mode 100644 index 000000000000..7dad0281409d --- /dev/null +++ b/owl-bot-staging/google-cloud-security_center-v2/snippets/security_center/update_source.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 securitycenter_v2_generated_SecurityCenter_UpdateSource_sync] +require "google/cloud/security_center/v2" + +## +# Snippet for the update_source call in the SecurityCenter service +# +# This snippet has been automatically generated and should be regarded as a code +# template only. It will require modifications to work: +# - It may require correct/in-range values for request initialization. +# - It may require specifying regional endpoints when creating the service +# client as shown in https://cloud.google.com/ruby/docs/reference. +# +# This is an auto-generated example demonstrating basic usage of +# Google::Cloud::SecurityCenter::V2::SecurityCenter::Client#update_source. +# +def update_source + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::SecurityCenter::V2::SecurityCenter::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::SecurityCenter::V2::UpdateSourceRequest.new + + # Call the update_source method. + result = client.update_source request + + # The returned object is of type Google::Cloud::SecurityCenter::V2::Source. + p result +end +# [END securitycenter_v2_generated_SecurityCenter_UpdateSource_sync] diff --git a/owl-bot-staging/google-cloud-security_center-v2/snippets/snippet_metadata_google.cloud.securitycenter.v2.json b/owl-bot-staging/google-cloud-security_center-v2/snippets/snippet_metadata_google.cloud.securitycenter.v2.json new file mode 100644 index 000000000000..8b78714ab7d9 --- /dev/null +++ b/owl-bot-staging/google-cloud-security_center-v2/snippets/snippet_metadata_google.cloud.securitycenter.v2.json @@ -0,0 +1,1615 @@ +{ + "client_library": { + "name": "google-cloud-security_center-v2", + "version": "", + "language": "RUBY", + "apis": [ + { + "id": "google.cloud.securitycenter.v2", + "version": "v2" + } + ] + }, + "snippets": [ + { + "region_tag": "securitycenter_v2_generated_SecurityCenter_BatchCreateResourceValueConfigs_sync", + "title": "Snippet for the batch_create_resource_value_configs call in the SecurityCenter service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::SecurityCenter::V2::SecurityCenter::Client#batch_create_resource_value_configs.", + "file": "security_center/batch_create_resource_value_configs.rb", + "language": "RUBY", + "client_method": { + "short_name": "batch_create_resource_value_configs", + "full_name": "::Google::Cloud::SecurityCenter::V2::SecurityCenter::Client#batch_create_resource_value_configs", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::SecurityCenter::V2::BatchCreateResourceValueConfigsRequest", + "name": "request" + } + ], + "result_type": "::Google::Cloud::SecurityCenter::V2::BatchCreateResourceValueConfigsResponse", + "client": { + "short_name": "SecurityCenter::Client", + "full_name": "::Google::Cloud::SecurityCenter::V2::SecurityCenter::Client" + }, + "method": { + "short_name": "BatchCreateResourceValueConfigs", + "full_name": "google.cloud.securitycenter.v2.SecurityCenter.BatchCreateResourceValueConfigs", + "service": { + "short_name": "SecurityCenter", + "full_name": "google.cloud.securitycenter.v2.SecurityCenter" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 46, + "type": "FULL" + } + ] + }, + { + "region_tag": "securitycenter_v2_generated_SecurityCenter_BulkMuteFindings_sync", + "title": "Snippet for the bulk_mute_findings call in the SecurityCenter service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::SecurityCenter::V2::SecurityCenter::Client#bulk_mute_findings.", + "file": "security_center/bulk_mute_findings.rb", + "language": "RUBY", + "client_method": { + "short_name": "bulk_mute_findings", + "full_name": "::Google::Cloud::SecurityCenter::V2::SecurityCenter::Client#bulk_mute_findings", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::SecurityCenter::V2::BulkMuteFindingsRequest", + "name": "request" + } + ], + "result_type": "::Google::Longrunning::Operation", + "client": { + "short_name": "SecurityCenter::Client", + "full_name": "::Google::Cloud::SecurityCenter::V2::SecurityCenter::Client" + }, + "method": { + "short_name": "BulkMuteFindings", + "full_name": "google.cloud.securitycenter.v2.SecurityCenter.BulkMuteFindings", + "service": { + "short_name": "SecurityCenter", + "full_name": "google.cloud.securitycenter.v2.SecurityCenter" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 53, + "type": "FULL" + } + ] + }, + { + "region_tag": "securitycenter_v2_generated_SecurityCenter_CreateBigQueryExport_sync", + "title": "Snippet for the create_big_query_export call in the SecurityCenter service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::SecurityCenter::V2::SecurityCenter::Client#create_big_query_export.", + "file": "security_center/create_big_query_export.rb", + "language": "RUBY", + "client_method": { + "short_name": "create_big_query_export", + "full_name": "::Google::Cloud::SecurityCenter::V2::SecurityCenter::Client#create_big_query_export", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::SecurityCenter::V2::CreateBigQueryExportRequest", + "name": "request" + } + ], + "result_type": "::Google::Cloud::SecurityCenter::V2::BigQueryExport", + "client": { + "short_name": "SecurityCenter::Client", + "full_name": "::Google::Cloud::SecurityCenter::V2::SecurityCenter::Client" + }, + "method": { + "short_name": "CreateBigQueryExport", + "full_name": "google.cloud.securitycenter.v2.SecurityCenter.CreateBigQueryExport", + "service": { + "short_name": "SecurityCenter", + "full_name": "google.cloud.securitycenter.v2.SecurityCenter" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 46, + "type": "FULL" + } + ] + }, + { + "region_tag": "securitycenter_v2_generated_SecurityCenter_CreateFinding_sync", + "title": "Snippet for the create_finding call in the SecurityCenter service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::SecurityCenter::V2::SecurityCenter::Client#create_finding.", + "file": "security_center/create_finding.rb", + "language": "RUBY", + "client_method": { + "short_name": "create_finding", + "full_name": "::Google::Cloud::SecurityCenter::V2::SecurityCenter::Client#create_finding", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::SecurityCenter::V2::CreateFindingRequest", + "name": "request" + } + ], + "result_type": "::Google::Cloud::SecurityCenter::V2::Finding", + "client": { + "short_name": "SecurityCenter::Client", + "full_name": "::Google::Cloud::SecurityCenter::V2::SecurityCenter::Client" + }, + "method": { + "short_name": "CreateFinding", + "full_name": "google.cloud.securitycenter.v2.SecurityCenter.CreateFinding", + "service": { + "short_name": "SecurityCenter", + "full_name": "google.cloud.securitycenter.v2.SecurityCenter" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 46, + "type": "FULL" + } + ] + }, + { + "region_tag": "securitycenter_v2_generated_SecurityCenter_CreateMuteConfig_sync", + "title": "Snippet for the create_mute_config call in the SecurityCenter service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::SecurityCenter::V2::SecurityCenter::Client#create_mute_config.", + "file": "security_center/create_mute_config.rb", + "language": "RUBY", + "client_method": { + "short_name": "create_mute_config", + "full_name": "::Google::Cloud::SecurityCenter::V2::SecurityCenter::Client#create_mute_config", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::SecurityCenter::V2::CreateMuteConfigRequest", + "name": "request" + } + ], + "result_type": "::Google::Cloud::SecurityCenter::V2::MuteConfig", + "client": { + "short_name": "SecurityCenter::Client", + "full_name": "::Google::Cloud::SecurityCenter::V2::SecurityCenter::Client" + }, + "method": { + "short_name": "CreateMuteConfig", + "full_name": "google.cloud.securitycenter.v2.SecurityCenter.CreateMuteConfig", + "service": { + "short_name": "SecurityCenter", + "full_name": "google.cloud.securitycenter.v2.SecurityCenter" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 46, + "type": "FULL" + } + ] + }, + { + "region_tag": "securitycenter_v2_generated_SecurityCenter_CreateNotificationConfig_sync", + "title": "Snippet for the create_notification_config call in the SecurityCenter service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::SecurityCenter::V2::SecurityCenter::Client#create_notification_config.", + "file": "security_center/create_notification_config.rb", + "language": "RUBY", + "client_method": { + "short_name": "create_notification_config", + "full_name": "::Google::Cloud::SecurityCenter::V2::SecurityCenter::Client#create_notification_config", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::SecurityCenter::V2::CreateNotificationConfigRequest", + "name": "request" + } + ], + "result_type": "::Google::Cloud::SecurityCenter::V2::NotificationConfig", + "client": { + "short_name": "SecurityCenter::Client", + "full_name": "::Google::Cloud::SecurityCenter::V2::SecurityCenter::Client" + }, + "method": { + "short_name": "CreateNotificationConfig", + "full_name": "google.cloud.securitycenter.v2.SecurityCenter.CreateNotificationConfig", + "service": { + "short_name": "SecurityCenter", + "full_name": "google.cloud.securitycenter.v2.SecurityCenter" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 46, + "type": "FULL" + } + ] + }, + { + "region_tag": "securitycenter_v2_generated_SecurityCenter_CreateSource_sync", + "title": "Snippet for the create_source call in the SecurityCenter service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::SecurityCenter::V2::SecurityCenter::Client#create_source.", + "file": "security_center/create_source.rb", + "language": "RUBY", + "client_method": { + "short_name": "create_source", + "full_name": "::Google::Cloud::SecurityCenter::V2::SecurityCenter::Client#create_source", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::SecurityCenter::V2::CreateSourceRequest", + "name": "request" + } + ], + "result_type": "::Google::Cloud::SecurityCenter::V2::Source", + "client": { + "short_name": "SecurityCenter::Client", + "full_name": "::Google::Cloud::SecurityCenter::V2::SecurityCenter::Client" + }, + "method": { + "short_name": "CreateSource", + "full_name": "google.cloud.securitycenter.v2.SecurityCenter.CreateSource", + "service": { + "short_name": "SecurityCenter", + "full_name": "google.cloud.securitycenter.v2.SecurityCenter" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 46, + "type": "FULL" + } + ] + }, + { + "region_tag": "securitycenter_v2_generated_SecurityCenter_DeleteBigQueryExport_sync", + "title": "Snippet for the delete_big_query_export call in the SecurityCenter service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::SecurityCenter::V2::SecurityCenter::Client#delete_big_query_export.", + "file": "security_center/delete_big_query_export.rb", + "language": "RUBY", + "client_method": { + "short_name": "delete_big_query_export", + "full_name": "::Google::Cloud::SecurityCenter::V2::SecurityCenter::Client#delete_big_query_export", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::SecurityCenter::V2::DeleteBigQueryExportRequest", + "name": "request" + } + ], + "result_type": "::Google::Protobuf::Empty", + "client": { + "short_name": "SecurityCenter::Client", + "full_name": "::Google::Cloud::SecurityCenter::V2::SecurityCenter::Client" + }, + "method": { + "short_name": "DeleteBigQueryExport", + "full_name": "google.cloud.securitycenter.v2.SecurityCenter.DeleteBigQueryExport", + "service": { + "short_name": "SecurityCenter", + "full_name": "google.cloud.securitycenter.v2.SecurityCenter" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 46, + "type": "FULL" + } + ] + }, + { + "region_tag": "securitycenter_v2_generated_SecurityCenter_DeleteMuteConfig_sync", + "title": "Snippet for the delete_mute_config call in the SecurityCenter service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::SecurityCenter::V2::SecurityCenter::Client#delete_mute_config.", + "file": "security_center/delete_mute_config.rb", + "language": "RUBY", + "client_method": { + "short_name": "delete_mute_config", + "full_name": "::Google::Cloud::SecurityCenter::V2::SecurityCenter::Client#delete_mute_config", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::SecurityCenter::V2::DeleteMuteConfigRequest", + "name": "request" + } + ], + "result_type": "::Google::Protobuf::Empty", + "client": { + "short_name": "SecurityCenter::Client", + "full_name": "::Google::Cloud::SecurityCenter::V2::SecurityCenter::Client" + }, + "method": { + "short_name": "DeleteMuteConfig", + "full_name": "google.cloud.securitycenter.v2.SecurityCenter.DeleteMuteConfig", + "service": { + "short_name": "SecurityCenter", + "full_name": "google.cloud.securitycenter.v2.SecurityCenter" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 46, + "type": "FULL" + } + ] + }, + { + "region_tag": "securitycenter_v2_generated_SecurityCenter_DeleteNotificationConfig_sync", + "title": "Snippet for the delete_notification_config call in the SecurityCenter service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::SecurityCenter::V2::SecurityCenter::Client#delete_notification_config.", + "file": "security_center/delete_notification_config.rb", + "language": "RUBY", + "client_method": { + "short_name": "delete_notification_config", + "full_name": "::Google::Cloud::SecurityCenter::V2::SecurityCenter::Client#delete_notification_config", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::SecurityCenter::V2::DeleteNotificationConfigRequest", + "name": "request" + } + ], + "result_type": "::Google::Protobuf::Empty", + "client": { + "short_name": "SecurityCenter::Client", + "full_name": "::Google::Cloud::SecurityCenter::V2::SecurityCenter::Client" + }, + "method": { + "short_name": "DeleteNotificationConfig", + "full_name": "google.cloud.securitycenter.v2.SecurityCenter.DeleteNotificationConfig", + "service": { + "short_name": "SecurityCenter", + "full_name": "google.cloud.securitycenter.v2.SecurityCenter" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 46, + "type": "FULL" + } + ] + }, + { + "region_tag": "securitycenter_v2_generated_SecurityCenter_DeleteResourceValueConfig_sync", + "title": "Snippet for the delete_resource_value_config call in the SecurityCenter service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::SecurityCenter::V2::SecurityCenter::Client#delete_resource_value_config.", + "file": "security_center/delete_resource_value_config.rb", + "language": "RUBY", + "client_method": { + "short_name": "delete_resource_value_config", + "full_name": "::Google::Cloud::SecurityCenter::V2::SecurityCenter::Client#delete_resource_value_config", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::SecurityCenter::V2::DeleteResourceValueConfigRequest", + "name": "request" + } + ], + "result_type": "::Google::Protobuf::Empty", + "client": { + "short_name": "SecurityCenter::Client", + "full_name": "::Google::Cloud::SecurityCenter::V2::SecurityCenter::Client" + }, + "method": { + "short_name": "DeleteResourceValueConfig", + "full_name": "google.cloud.securitycenter.v2.SecurityCenter.DeleteResourceValueConfig", + "service": { + "short_name": "SecurityCenter", + "full_name": "google.cloud.securitycenter.v2.SecurityCenter" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 46, + "type": "FULL" + } + ] + }, + { + "region_tag": "securitycenter_v2_generated_SecurityCenter_GetBigQueryExport_sync", + "title": "Snippet for the get_big_query_export call in the SecurityCenter service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::SecurityCenter::V2::SecurityCenter::Client#get_big_query_export.", + "file": "security_center/get_big_query_export.rb", + "language": "RUBY", + "client_method": { + "short_name": "get_big_query_export", + "full_name": "::Google::Cloud::SecurityCenter::V2::SecurityCenter::Client#get_big_query_export", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::SecurityCenter::V2::GetBigQueryExportRequest", + "name": "request" + } + ], + "result_type": "::Google::Cloud::SecurityCenter::V2::BigQueryExport", + "client": { + "short_name": "SecurityCenter::Client", + "full_name": "::Google::Cloud::SecurityCenter::V2::SecurityCenter::Client" + }, + "method": { + "short_name": "GetBigQueryExport", + "full_name": "google.cloud.securitycenter.v2.SecurityCenter.GetBigQueryExport", + "service": { + "short_name": "SecurityCenter", + "full_name": "google.cloud.securitycenter.v2.SecurityCenter" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 46, + "type": "FULL" + } + ] + }, + { + "region_tag": "securitycenter_v2_generated_SecurityCenter_GetSimulation_sync", + "title": "Snippet for the get_simulation call in the SecurityCenter service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::SecurityCenter::V2::SecurityCenter::Client#get_simulation.", + "file": "security_center/get_simulation.rb", + "language": "RUBY", + "client_method": { + "short_name": "get_simulation", + "full_name": "::Google::Cloud::SecurityCenter::V2::SecurityCenter::Client#get_simulation", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::SecurityCenter::V2::GetSimulationRequest", + "name": "request" + } + ], + "result_type": "::Google::Cloud::SecurityCenter::V2::Simulation", + "client": { + "short_name": "SecurityCenter::Client", + "full_name": "::Google::Cloud::SecurityCenter::V2::SecurityCenter::Client" + }, + "method": { + "short_name": "GetSimulation", + "full_name": "google.cloud.securitycenter.v2.SecurityCenter.GetSimulation", + "service": { + "short_name": "SecurityCenter", + "full_name": "google.cloud.securitycenter.v2.SecurityCenter" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 46, + "type": "FULL" + } + ] + }, + { + "region_tag": "securitycenter_v2_generated_SecurityCenter_GetValuedResource_sync", + "title": "Snippet for the get_valued_resource call in the SecurityCenter service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::SecurityCenter::V2::SecurityCenter::Client#get_valued_resource.", + "file": "security_center/get_valued_resource.rb", + "language": "RUBY", + "client_method": { + "short_name": "get_valued_resource", + "full_name": "::Google::Cloud::SecurityCenter::V2::SecurityCenter::Client#get_valued_resource", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::SecurityCenter::V2::GetValuedResourceRequest", + "name": "request" + } + ], + "result_type": "::Google::Cloud::SecurityCenter::V2::ValuedResource", + "client": { + "short_name": "SecurityCenter::Client", + "full_name": "::Google::Cloud::SecurityCenter::V2::SecurityCenter::Client" + }, + "method": { + "short_name": "GetValuedResource", + "full_name": "google.cloud.securitycenter.v2.SecurityCenter.GetValuedResource", + "service": { + "short_name": "SecurityCenter", + "full_name": "google.cloud.securitycenter.v2.SecurityCenter" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 46, + "type": "FULL" + } + ] + }, + { + "region_tag": "securitycenter_v2_generated_SecurityCenter_GetIamPolicy_sync", + "title": "Snippet for the get_iam_policy call in the SecurityCenter service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::SecurityCenter::V2::SecurityCenter::Client#get_iam_policy.", + "file": "security_center/get_iam_policy.rb", + "language": "RUBY", + "client_method": { + "short_name": "get_iam_policy", + "full_name": "::Google::Cloud::SecurityCenter::V2::SecurityCenter::Client#get_iam_policy", + "async": false, + "parameters": [ + { + "type": "::Google::Iam::V1::GetIamPolicyRequest", + "name": "request" + } + ], + "result_type": "::Google::Iam::V1::Policy", + "client": { + "short_name": "SecurityCenter::Client", + "full_name": "::Google::Cloud::SecurityCenter::V2::SecurityCenter::Client" + }, + "method": { + "short_name": "GetIamPolicy", + "full_name": "google.cloud.securitycenter.v2.SecurityCenter.GetIamPolicy", + "service": { + "short_name": "SecurityCenter", + "full_name": "google.cloud.securitycenter.v2.SecurityCenter" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 46, + "type": "FULL" + } + ] + }, + { + "region_tag": "securitycenter_v2_generated_SecurityCenter_GetMuteConfig_sync", + "title": "Snippet for the get_mute_config call in the SecurityCenter service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::SecurityCenter::V2::SecurityCenter::Client#get_mute_config.", + "file": "security_center/get_mute_config.rb", + "language": "RUBY", + "client_method": { + "short_name": "get_mute_config", + "full_name": "::Google::Cloud::SecurityCenter::V2::SecurityCenter::Client#get_mute_config", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::SecurityCenter::V2::GetMuteConfigRequest", + "name": "request" + } + ], + "result_type": "::Google::Cloud::SecurityCenter::V2::MuteConfig", + "client": { + "short_name": "SecurityCenter::Client", + "full_name": "::Google::Cloud::SecurityCenter::V2::SecurityCenter::Client" + }, + "method": { + "short_name": "GetMuteConfig", + "full_name": "google.cloud.securitycenter.v2.SecurityCenter.GetMuteConfig", + "service": { + "short_name": "SecurityCenter", + "full_name": "google.cloud.securitycenter.v2.SecurityCenter" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 46, + "type": "FULL" + } + ] + }, + { + "region_tag": "securitycenter_v2_generated_SecurityCenter_GetNotificationConfig_sync", + "title": "Snippet for the get_notification_config call in the SecurityCenter service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::SecurityCenter::V2::SecurityCenter::Client#get_notification_config.", + "file": "security_center/get_notification_config.rb", + "language": "RUBY", + "client_method": { + "short_name": "get_notification_config", + "full_name": "::Google::Cloud::SecurityCenter::V2::SecurityCenter::Client#get_notification_config", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::SecurityCenter::V2::GetNotificationConfigRequest", + "name": "request" + } + ], + "result_type": "::Google::Cloud::SecurityCenter::V2::NotificationConfig", + "client": { + "short_name": "SecurityCenter::Client", + "full_name": "::Google::Cloud::SecurityCenter::V2::SecurityCenter::Client" + }, + "method": { + "short_name": "GetNotificationConfig", + "full_name": "google.cloud.securitycenter.v2.SecurityCenter.GetNotificationConfig", + "service": { + "short_name": "SecurityCenter", + "full_name": "google.cloud.securitycenter.v2.SecurityCenter" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 46, + "type": "FULL" + } + ] + }, + { + "region_tag": "securitycenter_v2_generated_SecurityCenter_GetResourceValueConfig_sync", + "title": "Snippet for the get_resource_value_config call in the SecurityCenter service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::SecurityCenter::V2::SecurityCenter::Client#get_resource_value_config.", + "file": "security_center/get_resource_value_config.rb", + "language": "RUBY", + "client_method": { + "short_name": "get_resource_value_config", + "full_name": "::Google::Cloud::SecurityCenter::V2::SecurityCenter::Client#get_resource_value_config", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::SecurityCenter::V2::GetResourceValueConfigRequest", + "name": "request" + } + ], + "result_type": "::Google::Cloud::SecurityCenter::V2::ResourceValueConfig", + "client": { + "short_name": "SecurityCenter::Client", + "full_name": "::Google::Cloud::SecurityCenter::V2::SecurityCenter::Client" + }, + "method": { + "short_name": "GetResourceValueConfig", + "full_name": "google.cloud.securitycenter.v2.SecurityCenter.GetResourceValueConfig", + "service": { + "short_name": "SecurityCenter", + "full_name": "google.cloud.securitycenter.v2.SecurityCenter" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 46, + "type": "FULL" + } + ] + }, + { + "region_tag": "securitycenter_v2_generated_SecurityCenter_GetSource_sync", + "title": "Snippet for the get_source call in the SecurityCenter service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::SecurityCenter::V2::SecurityCenter::Client#get_source.", + "file": "security_center/get_source.rb", + "language": "RUBY", + "client_method": { + "short_name": "get_source", + "full_name": "::Google::Cloud::SecurityCenter::V2::SecurityCenter::Client#get_source", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::SecurityCenter::V2::GetSourceRequest", + "name": "request" + } + ], + "result_type": "::Google::Cloud::SecurityCenter::V2::Source", + "client": { + "short_name": "SecurityCenter::Client", + "full_name": "::Google::Cloud::SecurityCenter::V2::SecurityCenter::Client" + }, + "method": { + "short_name": "GetSource", + "full_name": "google.cloud.securitycenter.v2.SecurityCenter.GetSource", + "service": { + "short_name": "SecurityCenter", + "full_name": "google.cloud.securitycenter.v2.SecurityCenter" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 46, + "type": "FULL" + } + ] + }, + { + "region_tag": "securitycenter_v2_generated_SecurityCenter_GroupFindings_sync", + "title": "Snippet for the group_findings call in the SecurityCenter service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::SecurityCenter::V2::SecurityCenter::Client#group_findings.", + "file": "security_center/group_findings.rb", + "language": "RUBY", + "client_method": { + "short_name": "group_findings", + "full_name": "::Google::Cloud::SecurityCenter::V2::SecurityCenter::Client#group_findings", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::SecurityCenter::V2::GroupFindingsRequest", + "name": "request" + } + ], + "result_type": "::Google::Cloud::SecurityCenter::V2::GroupFindingsResponse", + "client": { + "short_name": "SecurityCenter::Client", + "full_name": "::Google::Cloud::SecurityCenter::V2::SecurityCenter::Client" + }, + "method": { + "short_name": "GroupFindings", + "full_name": "google.cloud.securitycenter.v2.SecurityCenter.GroupFindings", + "service": { + "short_name": "SecurityCenter", + "full_name": "google.cloud.securitycenter.v2.SecurityCenter" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 50, + "type": "FULL" + } + ] + }, + { + "region_tag": "securitycenter_v2_generated_SecurityCenter_ListAttackPaths_sync", + "title": "Snippet for the list_attack_paths call in the SecurityCenter service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::SecurityCenter::V2::SecurityCenter::Client#list_attack_paths.", + "file": "security_center/list_attack_paths.rb", + "language": "RUBY", + "client_method": { + "short_name": "list_attack_paths", + "full_name": "::Google::Cloud::SecurityCenter::V2::SecurityCenter::Client#list_attack_paths", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::SecurityCenter::V2::ListAttackPathsRequest", + "name": "request" + } + ], + "result_type": "::Google::Cloud::SecurityCenter::V2::ListAttackPathsResponse", + "client": { + "short_name": "SecurityCenter::Client", + "full_name": "::Google::Cloud::SecurityCenter::V2::SecurityCenter::Client" + }, + "method": { + "short_name": "ListAttackPaths", + "full_name": "google.cloud.securitycenter.v2.SecurityCenter.ListAttackPaths", + "service": { + "short_name": "SecurityCenter", + "full_name": "google.cloud.securitycenter.v2.SecurityCenter" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 50, + "type": "FULL" + } + ] + }, + { + "region_tag": "securitycenter_v2_generated_SecurityCenter_ListBigQueryExports_sync", + "title": "Snippet for the list_big_query_exports call in the SecurityCenter service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::SecurityCenter::V2::SecurityCenter::Client#list_big_query_exports.", + "file": "security_center/list_big_query_exports.rb", + "language": "RUBY", + "client_method": { + "short_name": "list_big_query_exports", + "full_name": "::Google::Cloud::SecurityCenter::V2::SecurityCenter::Client#list_big_query_exports", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::SecurityCenter::V2::ListBigQueryExportsRequest", + "name": "request" + } + ], + "result_type": "::Google::Cloud::SecurityCenter::V2::ListBigQueryExportsResponse", + "client": { + "short_name": "SecurityCenter::Client", + "full_name": "::Google::Cloud::SecurityCenter::V2::SecurityCenter::Client" + }, + "method": { + "short_name": "ListBigQueryExports", + "full_name": "google.cloud.securitycenter.v2.SecurityCenter.ListBigQueryExports", + "service": { + "short_name": "SecurityCenter", + "full_name": "google.cloud.securitycenter.v2.SecurityCenter" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 50, + "type": "FULL" + } + ] + }, + { + "region_tag": "securitycenter_v2_generated_SecurityCenter_ListFindings_sync", + "title": "Snippet for the list_findings call in the SecurityCenter service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::SecurityCenter::V2::SecurityCenter::Client#list_findings.", + "file": "security_center/list_findings.rb", + "language": "RUBY", + "client_method": { + "short_name": "list_findings", + "full_name": "::Google::Cloud::SecurityCenter::V2::SecurityCenter::Client#list_findings", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::SecurityCenter::V2::ListFindingsRequest", + "name": "request" + } + ], + "result_type": "::Google::Cloud::SecurityCenter::V2::ListFindingsResponse", + "client": { + "short_name": "SecurityCenter::Client", + "full_name": "::Google::Cloud::SecurityCenter::V2::SecurityCenter::Client" + }, + "method": { + "short_name": "ListFindings", + "full_name": "google.cloud.securitycenter.v2.SecurityCenter.ListFindings", + "service": { + "short_name": "SecurityCenter", + "full_name": "google.cloud.securitycenter.v2.SecurityCenter" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 50, + "type": "FULL" + } + ] + }, + { + "region_tag": "securitycenter_v2_generated_SecurityCenter_ListMuteConfigs_sync", + "title": "Snippet for the list_mute_configs call in the SecurityCenter service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::SecurityCenter::V2::SecurityCenter::Client#list_mute_configs.", + "file": "security_center/list_mute_configs.rb", + "language": "RUBY", + "client_method": { + "short_name": "list_mute_configs", + "full_name": "::Google::Cloud::SecurityCenter::V2::SecurityCenter::Client#list_mute_configs", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::SecurityCenter::V2::ListMuteConfigsRequest", + "name": "request" + } + ], + "result_type": "::Google::Cloud::SecurityCenter::V2::ListMuteConfigsResponse", + "client": { + "short_name": "SecurityCenter::Client", + "full_name": "::Google::Cloud::SecurityCenter::V2::SecurityCenter::Client" + }, + "method": { + "short_name": "ListMuteConfigs", + "full_name": "google.cloud.securitycenter.v2.SecurityCenter.ListMuteConfigs", + "service": { + "short_name": "SecurityCenter", + "full_name": "google.cloud.securitycenter.v2.SecurityCenter" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 50, + "type": "FULL" + } + ] + }, + { + "region_tag": "securitycenter_v2_generated_SecurityCenter_ListNotificationConfigs_sync", + "title": "Snippet for the list_notification_configs call in the SecurityCenter service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::SecurityCenter::V2::SecurityCenter::Client#list_notification_configs.", + "file": "security_center/list_notification_configs.rb", + "language": "RUBY", + "client_method": { + "short_name": "list_notification_configs", + "full_name": "::Google::Cloud::SecurityCenter::V2::SecurityCenter::Client#list_notification_configs", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::SecurityCenter::V2::ListNotificationConfigsRequest", + "name": "request" + } + ], + "result_type": "::Google::Cloud::SecurityCenter::V2::ListNotificationConfigsResponse", + "client": { + "short_name": "SecurityCenter::Client", + "full_name": "::Google::Cloud::SecurityCenter::V2::SecurityCenter::Client" + }, + "method": { + "short_name": "ListNotificationConfigs", + "full_name": "google.cloud.securitycenter.v2.SecurityCenter.ListNotificationConfigs", + "service": { + "short_name": "SecurityCenter", + "full_name": "google.cloud.securitycenter.v2.SecurityCenter" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 50, + "type": "FULL" + } + ] + }, + { + "region_tag": "securitycenter_v2_generated_SecurityCenter_ListResourceValueConfigs_sync", + "title": "Snippet for the list_resource_value_configs call in the SecurityCenter service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::SecurityCenter::V2::SecurityCenter::Client#list_resource_value_configs.", + "file": "security_center/list_resource_value_configs.rb", + "language": "RUBY", + "client_method": { + "short_name": "list_resource_value_configs", + "full_name": "::Google::Cloud::SecurityCenter::V2::SecurityCenter::Client#list_resource_value_configs", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::SecurityCenter::V2::ListResourceValueConfigsRequest", + "name": "request" + } + ], + "result_type": "::Google::Cloud::SecurityCenter::V2::ListResourceValueConfigsResponse", + "client": { + "short_name": "SecurityCenter::Client", + "full_name": "::Google::Cloud::SecurityCenter::V2::SecurityCenter::Client" + }, + "method": { + "short_name": "ListResourceValueConfigs", + "full_name": "google.cloud.securitycenter.v2.SecurityCenter.ListResourceValueConfigs", + "service": { + "short_name": "SecurityCenter", + "full_name": "google.cloud.securitycenter.v2.SecurityCenter" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 50, + "type": "FULL" + } + ] + }, + { + "region_tag": "securitycenter_v2_generated_SecurityCenter_ListSources_sync", + "title": "Snippet for the list_sources call in the SecurityCenter service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::SecurityCenter::V2::SecurityCenter::Client#list_sources.", + "file": "security_center/list_sources.rb", + "language": "RUBY", + "client_method": { + "short_name": "list_sources", + "full_name": "::Google::Cloud::SecurityCenter::V2::SecurityCenter::Client#list_sources", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::SecurityCenter::V2::ListSourcesRequest", + "name": "request" + } + ], + "result_type": "::Google::Cloud::SecurityCenter::V2::ListSourcesResponse", + "client": { + "short_name": "SecurityCenter::Client", + "full_name": "::Google::Cloud::SecurityCenter::V2::SecurityCenter::Client" + }, + "method": { + "short_name": "ListSources", + "full_name": "google.cloud.securitycenter.v2.SecurityCenter.ListSources", + "service": { + "short_name": "SecurityCenter", + "full_name": "google.cloud.securitycenter.v2.SecurityCenter" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 50, + "type": "FULL" + } + ] + }, + { + "region_tag": "securitycenter_v2_generated_SecurityCenter_ListValuedResources_sync", + "title": "Snippet for the list_valued_resources call in the SecurityCenter service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::SecurityCenter::V2::SecurityCenter::Client#list_valued_resources.", + "file": "security_center/list_valued_resources.rb", + "language": "RUBY", + "client_method": { + "short_name": "list_valued_resources", + "full_name": "::Google::Cloud::SecurityCenter::V2::SecurityCenter::Client#list_valued_resources", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::SecurityCenter::V2::ListValuedResourcesRequest", + "name": "request" + } + ], + "result_type": "::Google::Cloud::SecurityCenter::V2::ListValuedResourcesResponse", + "client": { + "short_name": "SecurityCenter::Client", + "full_name": "::Google::Cloud::SecurityCenter::V2::SecurityCenter::Client" + }, + "method": { + "short_name": "ListValuedResources", + "full_name": "google.cloud.securitycenter.v2.SecurityCenter.ListValuedResources", + "service": { + "short_name": "SecurityCenter", + "full_name": "google.cloud.securitycenter.v2.SecurityCenter" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 50, + "type": "FULL" + } + ] + }, + { + "region_tag": "securitycenter_v2_generated_SecurityCenter_SetFindingState_sync", + "title": "Snippet for the set_finding_state call in the SecurityCenter service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::SecurityCenter::V2::SecurityCenter::Client#set_finding_state.", + "file": "security_center/set_finding_state.rb", + "language": "RUBY", + "client_method": { + "short_name": "set_finding_state", + "full_name": "::Google::Cloud::SecurityCenter::V2::SecurityCenter::Client#set_finding_state", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::SecurityCenter::V2::SetFindingStateRequest", + "name": "request" + } + ], + "result_type": "::Google::Cloud::SecurityCenter::V2::Finding", + "client": { + "short_name": "SecurityCenter::Client", + "full_name": "::Google::Cloud::SecurityCenter::V2::SecurityCenter::Client" + }, + "method": { + "short_name": "SetFindingState", + "full_name": "google.cloud.securitycenter.v2.SecurityCenter.SetFindingState", + "service": { + "short_name": "SecurityCenter", + "full_name": "google.cloud.securitycenter.v2.SecurityCenter" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 46, + "type": "FULL" + } + ] + }, + { + "region_tag": "securitycenter_v2_generated_SecurityCenter_SetIamPolicy_sync", + "title": "Snippet for the set_iam_policy call in the SecurityCenter service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::SecurityCenter::V2::SecurityCenter::Client#set_iam_policy.", + "file": "security_center/set_iam_policy.rb", + "language": "RUBY", + "client_method": { + "short_name": "set_iam_policy", + "full_name": "::Google::Cloud::SecurityCenter::V2::SecurityCenter::Client#set_iam_policy", + "async": false, + "parameters": [ + { + "type": "::Google::Iam::V1::SetIamPolicyRequest", + "name": "request" + } + ], + "result_type": "::Google::Iam::V1::Policy", + "client": { + "short_name": "SecurityCenter::Client", + "full_name": "::Google::Cloud::SecurityCenter::V2::SecurityCenter::Client" + }, + "method": { + "short_name": "SetIamPolicy", + "full_name": "google.cloud.securitycenter.v2.SecurityCenter.SetIamPolicy", + "service": { + "short_name": "SecurityCenter", + "full_name": "google.cloud.securitycenter.v2.SecurityCenter" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 46, + "type": "FULL" + } + ] + }, + { + "region_tag": "securitycenter_v2_generated_SecurityCenter_SetMute_sync", + "title": "Snippet for the set_mute call in the SecurityCenter service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::SecurityCenter::V2::SecurityCenter::Client#set_mute.", + "file": "security_center/set_mute.rb", + "language": "RUBY", + "client_method": { + "short_name": "set_mute", + "full_name": "::Google::Cloud::SecurityCenter::V2::SecurityCenter::Client#set_mute", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::SecurityCenter::V2::SetMuteRequest", + "name": "request" + } + ], + "result_type": "::Google::Cloud::SecurityCenter::V2::Finding", + "client": { + "short_name": "SecurityCenter::Client", + "full_name": "::Google::Cloud::SecurityCenter::V2::SecurityCenter::Client" + }, + "method": { + "short_name": "SetMute", + "full_name": "google.cloud.securitycenter.v2.SecurityCenter.SetMute", + "service": { + "short_name": "SecurityCenter", + "full_name": "google.cloud.securitycenter.v2.SecurityCenter" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 46, + "type": "FULL" + } + ] + }, + { + "region_tag": "securitycenter_v2_generated_SecurityCenter_TestIamPermissions_sync", + "title": "Snippet for the test_iam_permissions call in the SecurityCenter service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::SecurityCenter::V2::SecurityCenter::Client#test_iam_permissions.", + "file": "security_center/test_iam_permissions.rb", + "language": "RUBY", + "client_method": { + "short_name": "test_iam_permissions", + "full_name": "::Google::Cloud::SecurityCenter::V2::SecurityCenter::Client#test_iam_permissions", + "async": false, + "parameters": [ + { + "type": "::Google::Iam::V1::TestIamPermissionsRequest", + "name": "request" + } + ], + "result_type": "::Google::Iam::V1::TestIamPermissionsResponse", + "client": { + "short_name": "SecurityCenter::Client", + "full_name": "::Google::Cloud::SecurityCenter::V2::SecurityCenter::Client" + }, + "method": { + "short_name": "TestIamPermissions", + "full_name": "google.cloud.securitycenter.v2.SecurityCenter.TestIamPermissions", + "service": { + "short_name": "SecurityCenter", + "full_name": "google.cloud.securitycenter.v2.SecurityCenter" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 46, + "type": "FULL" + } + ] + }, + { + "region_tag": "securitycenter_v2_generated_SecurityCenter_UpdateBigQueryExport_sync", + "title": "Snippet for the update_big_query_export call in the SecurityCenter service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::SecurityCenter::V2::SecurityCenter::Client#update_big_query_export.", + "file": "security_center/update_big_query_export.rb", + "language": "RUBY", + "client_method": { + "short_name": "update_big_query_export", + "full_name": "::Google::Cloud::SecurityCenter::V2::SecurityCenter::Client#update_big_query_export", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::SecurityCenter::V2::UpdateBigQueryExportRequest", + "name": "request" + } + ], + "result_type": "::Google::Cloud::SecurityCenter::V2::BigQueryExport", + "client": { + "short_name": "SecurityCenter::Client", + "full_name": "::Google::Cloud::SecurityCenter::V2::SecurityCenter::Client" + }, + "method": { + "short_name": "UpdateBigQueryExport", + "full_name": "google.cloud.securitycenter.v2.SecurityCenter.UpdateBigQueryExport", + "service": { + "short_name": "SecurityCenter", + "full_name": "google.cloud.securitycenter.v2.SecurityCenter" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 46, + "type": "FULL" + } + ] + }, + { + "region_tag": "securitycenter_v2_generated_SecurityCenter_UpdateExternalSystem_sync", + "title": "Snippet for the update_external_system call in the SecurityCenter service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::SecurityCenter::V2::SecurityCenter::Client#update_external_system.", + "file": "security_center/update_external_system.rb", + "language": "RUBY", + "client_method": { + "short_name": "update_external_system", + "full_name": "::Google::Cloud::SecurityCenter::V2::SecurityCenter::Client#update_external_system", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::SecurityCenter::V2::UpdateExternalSystemRequest", + "name": "request" + } + ], + "result_type": "::Google::Cloud::SecurityCenter::V2::ExternalSystem", + "client": { + "short_name": "SecurityCenter::Client", + "full_name": "::Google::Cloud::SecurityCenter::V2::SecurityCenter::Client" + }, + "method": { + "short_name": "UpdateExternalSystem", + "full_name": "google.cloud.securitycenter.v2.SecurityCenter.UpdateExternalSystem", + "service": { + "short_name": "SecurityCenter", + "full_name": "google.cloud.securitycenter.v2.SecurityCenter" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 46, + "type": "FULL" + } + ] + }, + { + "region_tag": "securitycenter_v2_generated_SecurityCenter_UpdateFinding_sync", + "title": "Snippet for the update_finding call in the SecurityCenter service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::SecurityCenter::V2::SecurityCenter::Client#update_finding.", + "file": "security_center/update_finding.rb", + "language": "RUBY", + "client_method": { + "short_name": "update_finding", + "full_name": "::Google::Cloud::SecurityCenter::V2::SecurityCenter::Client#update_finding", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::SecurityCenter::V2::UpdateFindingRequest", + "name": "request" + } + ], + "result_type": "::Google::Cloud::SecurityCenter::V2::Finding", + "client": { + "short_name": "SecurityCenter::Client", + "full_name": "::Google::Cloud::SecurityCenter::V2::SecurityCenter::Client" + }, + "method": { + "short_name": "UpdateFinding", + "full_name": "google.cloud.securitycenter.v2.SecurityCenter.UpdateFinding", + "service": { + "short_name": "SecurityCenter", + "full_name": "google.cloud.securitycenter.v2.SecurityCenter" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 46, + "type": "FULL" + } + ] + }, + { + "region_tag": "securitycenter_v2_generated_SecurityCenter_UpdateMuteConfig_sync", + "title": "Snippet for the update_mute_config call in the SecurityCenter service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::SecurityCenter::V2::SecurityCenter::Client#update_mute_config.", + "file": "security_center/update_mute_config.rb", + "language": "RUBY", + "client_method": { + "short_name": "update_mute_config", + "full_name": "::Google::Cloud::SecurityCenter::V2::SecurityCenter::Client#update_mute_config", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::SecurityCenter::V2::UpdateMuteConfigRequest", + "name": "request" + } + ], + "result_type": "::Google::Cloud::SecurityCenter::V2::MuteConfig", + "client": { + "short_name": "SecurityCenter::Client", + "full_name": "::Google::Cloud::SecurityCenter::V2::SecurityCenter::Client" + }, + "method": { + "short_name": "UpdateMuteConfig", + "full_name": "google.cloud.securitycenter.v2.SecurityCenter.UpdateMuteConfig", + "service": { + "short_name": "SecurityCenter", + "full_name": "google.cloud.securitycenter.v2.SecurityCenter" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 46, + "type": "FULL" + } + ] + }, + { + "region_tag": "securitycenter_v2_generated_SecurityCenter_UpdateNotificationConfig_sync", + "title": "Snippet for the update_notification_config call in the SecurityCenter service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::SecurityCenter::V2::SecurityCenter::Client#update_notification_config.", + "file": "security_center/update_notification_config.rb", + "language": "RUBY", + "client_method": { + "short_name": "update_notification_config", + "full_name": "::Google::Cloud::SecurityCenter::V2::SecurityCenter::Client#update_notification_config", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::SecurityCenter::V2::UpdateNotificationConfigRequest", + "name": "request" + } + ], + "result_type": "::Google::Cloud::SecurityCenter::V2::NotificationConfig", + "client": { + "short_name": "SecurityCenter::Client", + "full_name": "::Google::Cloud::SecurityCenter::V2::SecurityCenter::Client" + }, + "method": { + "short_name": "UpdateNotificationConfig", + "full_name": "google.cloud.securitycenter.v2.SecurityCenter.UpdateNotificationConfig", + "service": { + "short_name": "SecurityCenter", + "full_name": "google.cloud.securitycenter.v2.SecurityCenter" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 46, + "type": "FULL" + } + ] + }, + { + "region_tag": "securitycenter_v2_generated_SecurityCenter_UpdateResourceValueConfig_sync", + "title": "Snippet for the update_resource_value_config call in the SecurityCenter service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::SecurityCenter::V2::SecurityCenter::Client#update_resource_value_config.", + "file": "security_center/update_resource_value_config.rb", + "language": "RUBY", + "client_method": { + "short_name": "update_resource_value_config", + "full_name": "::Google::Cloud::SecurityCenter::V2::SecurityCenter::Client#update_resource_value_config", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::SecurityCenter::V2::UpdateResourceValueConfigRequest", + "name": "request" + } + ], + "result_type": "::Google::Cloud::SecurityCenter::V2::ResourceValueConfig", + "client": { + "short_name": "SecurityCenter::Client", + "full_name": "::Google::Cloud::SecurityCenter::V2::SecurityCenter::Client" + }, + "method": { + "short_name": "UpdateResourceValueConfig", + "full_name": "google.cloud.securitycenter.v2.SecurityCenter.UpdateResourceValueConfig", + "service": { + "short_name": "SecurityCenter", + "full_name": "google.cloud.securitycenter.v2.SecurityCenter" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 46, + "type": "FULL" + } + ] + }, + { + "region_tag": "securitycenter_v2_generated_SecurityCenter_UpdateSecurityMarks_sync", + "title": "Snippet for the update_security_marks call in the SecurityCenter service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::SecurityCenter::V2::SecurityCenter::Client#update_security_marks.", + "file": "security_center/update_security_marks.rb", + "language": "RUBY", + "client_method": { + "short_name": "update_security_marks", + "full_name": "::Google::Cloud::SecurityCenter::V2::SecurityCenter::Client#update_security_marks", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::SecurityCenter::V2::UpdateSecurityMarksRequest", + "name": "request" + } + ], + "result_type": "::Google::Cloud::SecurityCenter::V2::SecurityMarks", + "client": { + "short_name": "SecurityCenter::Client", + "full_name": "::Google::Cloud::SecurityCenter::V2::SecurityCenter::Client" + }, + "method": { + "short_name": "UpdateSecurityMarks", + "full_name": "google.cloud.securitycenter.v2.SecurityCenter.UpdateSecurityMarks", + "service": { + "short_name": "SecurityCenter", + "full_name": "google.cloud.securitycenter.v2.SecurityCenter" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 46, + "type": "FULL" + } + ] + }, + { + "region_tag": "securitycenter_v2_generated_SecurityCenter_UpdateSource_sync", + "title": "Snippet for the update_source call in the SecurityCenter service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::SecurityCenter::V2::SecurityCenter::Client#update_source.", + "file": "security_center/update_source.rb", + "language": "RUBY", + "client_method": { + "short_name": "update_source", + "full_name": "::Google::Cloud::SecurityCenter::V2::SecurityCenter::Client#update_source", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::SecurityCenter::V2::UpdateSourceRequest", + "name": "request" + } + ], + "result_type": "::Google::Cloud::SecurityCenter::V2::Source", + "client": { + "short_name": "SecurityCenter::Client", + "full_name": "::Google::Cloud::SecurityCenter::V2::SecurityCenter::Client" + }, + "method": { + "short_name": "UpdateSource", + "full_name": "google.cloud.securitycenter.v2.SecurityCenter.UpdateSource", + "service": { + "short_name": "SecurityCenter", + "full_name": "google.cloud.securitycenter.v2.SecurityCenter" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 46, + "type": "FULL" + } + ] + } + ] +} \ No newline at end of file diff --git a/owl-bot-staging/google-cloud-security_center-v2/test/google/cloud/security_center/v2/security_center_operations_test.rb b/owl-bot-staging/google-cloud-security_center-v2/test/google/cloud/security_center/v2/security_center_operations_test.rb new file mode 100644 index 000000000000..3e695306bd6f --- /dev/null +++ b/owl-bot-staging/google-cloud-security_center-v2/test/google/cloud/security_center/v2/security_center_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/cloud/securitycenter/v2/securitycenter_service_pb" +require "google/cloud/securitycenter/v2/securitycenter_service_services_pb" +require "google/cloud/security_center/v2/security_center" + +class ::Google::Cloud::SecurityCenter::V2::SecurityCenter::OperationsTest < Minitest::Test + class ClientStub + attr_accessor :call_rpc_count, :requests + + def initialize response, operation, &block + @response = response + @operation = operation + @block = block + @call_rpc_count = 0 + @requests = [] + end + + def call_rpc *args, **kwargs + @call_rpc_count += 1 + + @requests << @block&.call(*args, **kwargs) + + catch :response do + yield @response, @operation if block_given? + @response + end + end + + def endpoint + "endpoint.example.com" + end + + def universe_domain + "example.com" + end + + def stub_logger + nil + end + + def logger + nil + end + end + + def test_list_operations + # Create GRPC objects. + grpc_response = ::Google::Longrunning::ListOperationsResponse.new + grpc_operation = GRPC::ActiveCall::Operation.new nil + grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + grpc_options = {} + + # Create request parameters for a unary method. + name = "hello world" + filter = "hello world" + page_size = 42 + page_token = "hello world" + return_partial_success = true + + list_operations_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :list_operations, name + assert_kind_of ::Google::Longrunning::ListOperationsRequest, request + assert_equal "hello world", request["name"] + assert_equal "hello world", request["filter"] + assert_equal 42, request["page_size"] + assert_equal "hello world", request["page_token"] + assert_equal true, request["return_partial_success"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, list_operations_client_stub do + # Create client + client = ::Google::Cloud::SecurityCenter::V2::SecurityCenter::Operations.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.list_operations({ name: name, filter: filter, page_size: page_size, page_token: page_token, return_partial_success: return_partial_success }) do |response, operation| + assert_kind_of Gapic::PagedEnumerable, response + assert_equal grpc_response, response.response + assert_equal grpc_operation, operation + end + + # Use named arguments + client.list_operations name: name, filter: filter, page_size: page_size, page_token: page_token, return_partial_success: return_partial_success do |response, operation| + assert_kind_of Gapic::PagedEnumerable, response + assert_equal grpc_response, response.response + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.list_operations ::Google::Longrunning::ListOperationsRequest.new(name: name, filter: filter, page_size: page_size, page_token: page_token, return_partial_success: return_partial_success) do |response, operation| + assert_kind_of Gapic::PagedEnumerable, response + assert_equal grpc_response, response.response + assert_equal grpc_operation, operation + end + + # Use hash object with options + client.list_operations({ name: name, filter: filter, page_size: page_size, page_token: page_token, return_partial_success: return_partial_success }, grpc_options) do |response, operation| + assert_kind_of Gapic::PagedEnumerable, response + assert_equal grpc_response, response.response + assert_equal grpc_operation, operation + end + + # Use protobuf object with options + client.list_operations(::Google::Longrunning::ListOperationsRequest.new(name: name, filter: filter, page_size: page_size, page_token: page_token, return_partial_success: return_partial_success), grpc_options) do |response, operation| + assert_kind_of Gapic::PagedEnumerable, response + assert_equal grpc_response, response.response + assert_equal grpc_operation, operation + end + + # Verify method calls + assert_equal 5, list_operations_client_stub.call_rpc_count + end + end + + def test_get_operation + # Create GRPC objects. + grpc_response = ::Google::Longrunning::Operation.new + grpc_operation = GRPC::ActiveCall::Operation.new nil + grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + grpc_options = {} + + # Create request parameters for a unary method. + name = "hello world" + + get_operation_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :get_operation, name + assert_kind_of ::Google::Longrunning::GetOperationRequest, request + assert_equal "hello world", request["name"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, get_operation_client_stub do + # Create client + client = ::Google::Cloud::SecurityCenter::V2::SecurityCenter::Operations.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.get_operation({ name: name }) do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Use named arguments + client.get_operation name: name do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.get_operation ::Google::Longrunning::GetOperationRequest.new(name: name) do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Use hash object with options + client.get_operation({ name: name }, grpc_options) do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Use protobuf object with options + client.get_operation(::Google::Longrunning::GetOperationRequest.new(name: name), grpc_options) do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Verify method calls + assert_equal 5, get_operation_client_stub.call_rpc_count + end + end + + def test_delete_operation + # Create GRPC objects. + grpc_response = ::Google::Protobuf::Empty.new + grpc_operation = GRPC::ActiveCall::Operation.new nil + grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + grpc_options = {} + + # Create request parameters for a unary method. + name = "hello world" + + delete_operation_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :delete_operation, name + assert_kind_of ::Google::Longrunning::DeleteOperationRequest, request + assert_equal "hello world", request["name"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, delete_operation_client_stub do + # Create client + client = ::Google::Cloud::SecurityCenter::V2::SecurityCenter::Operations.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.delete_operation({ name: name }) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use named arguments + client.delete_operation name: name do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.delete_operation ::Google::Longrunning::DeleteOperationRequest.new(name: name) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use hash object with options + client.delete_operation({ name: name }, grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object with options + client.delete_operation(::Google::Longrunning::DeleteOperationRequest.new(name: name), grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Verify method calls + assert_equal 5, delete_operation_client_stub.call_rpc_count + end + end + + def test_cancel_operation + # Create GRPC objects. + grpc_response = ::Google::Protobuf::Empty.new + grpc_operation = GRPC::ActiveCall::Operation.new nil + grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + grpc_options = {} + + # Create request parameters for a unary method. + name = "hello world" + + cancel_operation_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :cancel_operation, name + assert_kind_of ::Google::Longrunning::CancelOperationRequest, request + assert_equal "hello world", request["name"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, cancel_operation_client_stub do + # Create client + client = ::Google::Cloud::SecurityCenter::V2::SecurityCenter::Operations.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.cancel_operation({ name: name }) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use named arguments + client.cancel_operation name: name do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.cancel_operation ::Google::Longrunning::CancelOperationRequest.new(name: name) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use hash object with options + client.cancel_operation({ name: name }, grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object with options + client.cancel_operation(::Google::Longrunning::CancelOperationRequest.new(name: name), grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Verify method calls + assert_equal 5, cancel_operation_client_stub.call_rpc_count + end + end + + def test_wait_operation + # Create GRPC objects. + grpc_response = ::Google::Longrunning::Operation.new + grpc_operation = GRPC::ActiveCall::Operation.new nil + grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + grpc_options = {} + + # Create request parameters for a unary method. + name = "hello world" + timeout = {} + + wait_operation_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :wait_operation, name + assert_kind_of ::Google::Longrunning::WaitOperationRequest, request + assert_equal "hello world", request["name"] + assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Protobuf::Duration), request["timeout"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, wait_operation_client_stub do + # Create client + client = ::Google::Cloud::SecurityCenter::V2::SecurityCenter::Operations.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.wait_operation({ name: name, timeout: timeout }) do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Use named arguments + client.wait_operation name: name, timeout: timeout do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.wait_operation ::Google::Longrunning::WaitOperationRequest.new(name: name, timeout: timeout) do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Use hash object with options + client.wait_operation({ name: name, timeout: timeout }, grpc_options) do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Use protobuf object with options + client.wait_operation(::Google::Longrunning::WaitOperationRequest.new(name: name, timeout: timeout), grpc_options) do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Verify method calls + assert_equal 5, wait_operation_client_stub.call_rpc_count + end + end + + def test_configure + grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + + client = block_config = config = nil + dummy_stub = ClientStub.new nil, nil + Gapic::ServiceStub.stub :new, dummy_stub do + client = ::Google::Cloud::SecurityCenter::V2::SecurityCenter::Operations.new do |config| + config.credentials = grpc_channel + end + end + + config = client.configure do |c| + block_config = c + end + + assert_same block_config, config + assert_kind_of ::Google::Cloud::SecurityCenter::V2::SecurityCenter::Operations::Configuration, config + end +end diff --git a/owl-bot-staging/google-cloud-security_center-v2/test/google/cloud/security_center/v2/security_center_paths_test.rb b/owl-bot-staging/google-cloud-security_center-v2/test/google/cloud/security_center/v2/security_center_paths_test.rb new file mode 100644 index 000000000000..88ac82de925a --- /dev/null +++ b/owl-bot-staging/google-cloud-security_center-v2/test/google/cloud/security_center/v2/security_center_paths_test.rb @@ -0,0 +1,403 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +require "helper" + +require "gapic/grpc/service_stub" + +require "google/cloud/security_center/v2/security_center" + +class ::Google::Cloud::SecurityCenter::V2::SecurityCenter::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_big_query_export_path + grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + ::Gapic::ServiceStub.stub :new, DummyStub.new do + client = ::Google::Cloud::SecurityCenter::V2::SecurityCenter::Client.new do |config| + config.credentials = grpc_channel + end + + path = client.big_query_export_path organization: "value0", location: "value1", export: "value2" + assert_equal "organizations/value0/locations/value1/bigQueryExports/value2", path + + path = client.big_query_export_path folder: "value0", location: "value1", export: "value2" + assert_equal "folders/value0/locations/value1/bigQueryExports/value2", path + + path = client.big_query_export_path project: "value0", location: "value1", export: "value2" + assert_equal "projects/value0/locations/value1/bigQueryExports/value2", path + end + end + + def test_dlp_job_path + grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + ::Gapic::ServiceStub.stub :new, DummyStub.new do + client = ::Google::Cloud::SecurityCenter::V2::SecurityCenter::Client.new do |config| + config.credentials = grpc_channel + end + + path = client.dlp_job_path project: "value0", dlp_job: "value1" + assert_equal "projects/value0/dlpJobs/value1", path + + path = client.dlp_job_path project: "value0", location: "value1", dlp_job: "value2" + assert_equal "projects/value0/locations/value1/dlpJobs/value2", path + end + end + + def test_external_system_path + grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + ::Gapic::ServiceStub.stub :new, DummyStub.new do + client = ::Google::Cloud::SecurityCenter::V2::SecurityCenter::Client.new do |config| + config.credentials = grpc_channel + end + + path = client.external_system_path organization: "value0", source: "value1", finding: "value2", externalsystem: "value3" + assert_equal "organizations/value0/sources/value1/findings/value2/externalSystems/value3", path + + path = client.external_system_path organization: "value0", source: "value1", location: "value2", finding: "value3", externalsystem: "value4" + assert_equal "organizations/value0/sources/value1/locations/value2/findings/value3/externalSystems/value4", path + + path = client.external_system_path folder: "value0", source: "value1", finding: "value2", externalsystem: "value3" + assert_equal "folders/value0/sources/value1/findings/value2/externalSystems/value3", path + + path = client.external_system_path folder: "value0", source: "value1", location: "value2", finding: "value3", externalsystem: "value4" + assert_equal "folders/value0/sources/value1/locations/value2/findings/value3/externalSystems/value4", path + + path = client.external_system_path project: "value0", source: "value1", finding: "value2", externalsystem: "value3" + assert_equal "projects/value0/sources/value1/findings/value2/externalSystems/value3", path + + path = client.external_system_path project: "value0", source: "value1", location: "value2", finding: "value3", externalsystem: "value4" + assert_equal "projects/value0/sources/value1/locations/value2/findings/value3/externalSystems/value4", path + end + end + + def test_finding_path + grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + ::Gapic::ServiceStub.stub :new, DummyStub.new do + client = ::Google::Cloud::SecurityCenter::V2::SecurityCenter::Client.new do |config| + config.credentials = grpc_channel + end + + path = client.finding_path organization: "value0", source: "value1", finding: "value2" + assert_equal "organizations/value0/sources/value1/findings/value2", path + + path = client.finding_path organization: "value0", source: "value1", location: "value2", finding: "value3" + assert_equal "organizations/value0/sources/value1/locations/value2/findings/value3", path + + path = client.finding_path folder: "value0", source: "value1", finding: "value2" + assert_equal "folders/value0/sources/value1/findings/value2", path + + path = client.finding_path folder: "value0", source: "value1", location: "value2", finding: "value3" + assert_equal "folders/value0/sources/value1/locations/value2/findings/value3", path + + path = client.finding_path project: "value0", source: "value1", finding: "value2" + assert_equal "projects/value0/sources/value1/findings/value2", path + + path = client.finding_path project: "value0", source: "value1", location: "value2", finding: "value3" + assert_equal "projects/value0/sources/value1/locations/value2/findings/value3", path + end + end + + def test_folder_path + grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + ::Gapic::ServiceStub.stub :new, DummyStub.new do + client = ::Google::Cloud::SecurityCenter::V2::SecurityCenter::Client.new do |config| + config.credentials = grpc_channel + end + + path = client.folder_path folder: "value0" + assert_equal "folders/value0", 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::Cloud::SecurityCenter::V2::SecurityCenter::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::Cloud::SecurityCenter::V2::SecurityCenter::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_mute_config_path + grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + ::Gapic::ServiceStub.stub :new, DummyStub.new do + client = ::Google::Cloud::SecurityCenter::V2::SecurityCenter::Client.new do |config| + config.credentials = grpc_channel + end + + path = client.mute_config_path organization: "value0", mute_config: "value1" + assert_equal "organizations/value0/muteConfigs/value1", path + + path = client.mute_config_path organization: "value0", location: "value1", mute_config: "value2" + assert_equal "organizations/value0/locations/value1/muteConfigs/value2", path + + path = client.mute_config_path folder: "value0", mute_config: "value1" + assert_equal "folders/value0/muteConfigs/value1", path + + path = client.mute_config_path folder: "value0", location: "value1", mute_config: "value2" + assert_equal "folders/value0/locations/value1/muteConfigs/value2", path + + path = client.mute_config_path project: "value0", mute_config: "value1" + assert_equal "projects/value0/muteConfigs/value1", path + + path = client.mute_config_path project: "value0", location: "value1", mute_config: "value2" + assert_equal "projects/value0/locations/value1/muteConfigs/value2", path + end + end + + def test_notification_config_path + grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + ::Gapic::ServiceStub.stub :new, DummyStub.new do + client = ::Google::Cloud::SecurityCenter::V2::SecurityCenter::Client.new do |config| + config.credentials = grpc_channel + end + + path = client.notification_config_path organization: "value0", location: "value1", notification_config: "value2" + assert_equal "organizations/value0/locations/value1/notificationConfigs/value2", path + + path = client.notification_config_path folder: "value0", location: "value1", notification_config: "value2" + assert_equal "folders/value0/locations/value1/notificationConfigs/value2", path + + path = client.notification_config_path project: "value0", location: "value1", notification_config: "value2" + assert_equal "projects/value0/locations/value1/notificationConfigs/value2", path + end + end + + def test_organization_path + grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + ::Gapic::ServiceStub.stub :new, DummyStub.new do + client = ::Google::Cloud::SecurityCenter::V2::SecurityCenter::Client.new do |config| + config.credentials = grpc_channel + end + + path = client.organization_path organization: "value0" + assert_equal "organizations/value0", 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::Cloud::SecurityCenter::V2::SecurityCenter::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_organization_valued_resource_path + grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + ::Gapic::ServiceStub.stub :new, DummyStub.new do + client = ::Google::Cloud::SecurityCenter::V2::SecurityCenter::Client.new do |config| + config.credentials = grpc_channel + end + + path = client.organization_valued_resource_path organization: "value0", location: "value1", simulation: "value2", valued_resource: "value3" + assert_equal "organizations/value0/locations/value1/simulations/value2/valuedResources/value3", path + end + end + + def test_policy_path + grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + ::Gapic::ServiceStub.stub :new, DummyStub.new do + client = ::Google::Cloud::SecurityCenter::V2::SecurityCenter::Client.new do |config| + config.credentials = grpc_channel + end + + path = client.policy_path organization: "value0", constraint_name: "value1" + assert_equal "organizations/value0/policies/value1", path + + path = client.policy_path folder: "value0", constraint_name: "value1" + assert_equal "folders/value0/policies/value1", path + + path = client.policy_path project: "value0", constraint_name: "value1" + assert_equal "projects/value0/policies/value1", path + end + end + + def test_project_path + grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + ::Gapic::ServiceStub.stub :new, DummyStub.new do + client = ::Google::Cloud::SecurityCenter::V2::SecurityCenter::Client.new do |config| + config.credentials = grpc_channel + end + + path = client.project_path project: "value0" + assert_equal "projects/value0", path + end + end + + def test_resource_value_config_path + grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + ::Gapic::ServiceStub.stub :new, DummyStub.new do + client = ::Google::Cloud::SecurityCenter::V2::SecurityCenter::Client.new do |config| + config.credentials = grpc_channel + end + + path = client.resource_value_config_path organization: "value0", resource_value_config: "value1" + assert_equal "organizations/value0/resourceValueConfigs/value1", path + + path = client.resource_value_config_path organization: "value0", location: "value1", resource_value_config: "value2" + assert_equal "organizations/value0/locations/value1/resourceValueConfigs/value2", path + end + end + + def test_security_marks_path + grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + ::Gapic::ServiceStub.stub :new, DummyStub.new do + client = ::Google::Cloud::SecurityCenter::V2::SecurityCenter::Client.new do |config| + config.credentials = grpc_channel + end + + path = client.security_marks_path organization: "value0", asset: "value1" + assert_equal "organizations/value0/assets/value1/securityMarks", path + + path = client.security_marks_path organization: "value0", source: "value1", finding: "value2" + assert_equal "organizations/value0/sources/value1/findings/value2/securityMarks", path + + path = client.security_marks_path organization: "value0", source: "value1", location: "value2", finding: "value3" + assert_equal "organizations/value0/sources/value1/locations/value2/findings/value3/securityMarks", path + + path = client.security_marks_path folder: "value0", asset: "value1" + assert_equal "folders/value0/assets/value1/securityMarks", path + + path = client.security_marks_path folder: "value0", source: "value1", finding: "value2" + assert_equal "folders/value0/sources/value1/findings/value2/securityMarks", path + + path = client.security_marks_path folder: "value0", source: "value1", location: "value2", finding: "value3" + assert_equal "folders/value0/sources/value1/locations/value2/findings/value3/securityMarks", path + + path = client.security_marks_path project: "value0", asset: "value1" + assert_equal "projects/value0/assets/value1/securityMarks", path + + path = client.security_marks_path project: "value0", source: "value1", finding: "value2" + assert_equal "projects/value0/sources/value1/findings/value2/securityMarks", path + + path = client.security_marks_path project: "value0", source: "value1", location: "value2", finding: "value3" + assert_equal "projects/value0/sources/value1/locations/value2/findings/value3/securityMarks", path + end + end + + def test_simulation_path + grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + ::Gapic::ServiceStub.stub :new, DummyStub.new do + client = ::Google::Cloud::SecurityCenter::V2::SecurityCenter::Client.new do |config| + config.credentials = grpc_channel + end + + path = client.simulation_path organization: "value0", simulation: "value1" + assert_equal "organizations/value0/simulations/value1", path + + path = client.simulation_path organization: "value0", location: "value1", simluation: "value2" + assert_equal "organizations/value0/locations/value1/simulations/value2", path + end + end + + def test_source_path + grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + ::Gapic::ServiceStub.stub :new, DummyStub.new do + client = ::Google::Cloud::SecurityCenter::V2::SecurityCenter::Client.new do |config| + config.credentials = grpc_channel + end + + path = client.source_path organization: "value0", source: "value1" + assert_equal "organizations/value0/sources/value1", path + + path = client.source_path folder: "value0", source: "value1" + assert_equal "folders/value0/sources/value1", path + + path = client.source_path project: "value0", source: "value1" + assert_equal "projects/value0/sources/value1", path + end + end + + def test_table_data_profile_path + grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + ::Gapic::ServiceStub.stub :new, DummyStub.new do + client = ::Google::Cloud::SecurityCenter::V2::SecurityCenter::Client.new do |config| + config.credentials = grpc_channel + end + + path = client.table_data_profile_path project: "value0", table_profile: "value1" + assert_equal "projects/value0/tableProfiles/value1", path + + path = client.table_data_profile_path project: "value0", location: "value1", table_profile: "value2" + assert_equal "projects/value0/locations/value1/tableProfiles/value2", path + end + end + + def test_topic_path + grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + ::Gapic::ServiceStub.stub :new, DummyStub.new do + client = ::Google::Cloud::SecurityCenter::V2::SecurityCenter::Client.new do |config| + config.credentials = grpc_channel + end + + path = client.topic_path project: "value0", topic: "value1" + assert_equal "projects/value0/topics/value1", path + end + end + + def test_valued_resource_path + grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + ::Gapic::ServiceStub.stub :new, DummyStub.new do + client = ::Google::Cloud::SecurityCenter::V2::SecurityCenter::Client.new do |config| + config.credentials = grpc_channel + end + + path = client.valued_resource_path organization: "value0", simulation: "value1", valued_resource: "value2" + assert_equal "organizations/value0/simulations/value1/valuedResources/value2", path + + path = client.valued_resource_path organization: "value0", location: "value1", simluation: "value2", valued_resource: "value3" + assert_equal "organizations/value0/locations/value1/simulations/value2/valuedResources/value3", path + end + end +end diff --git a/owl-bot-staging/google-cloud-security_center-v2/test/google/cloud/security_center/v2/security_center_rest_test.rb b/owl-bot-staging/google-cloud-security_center-v2/test/google/cloud/security_center/v2/security_center_rest_test.rb new file mode 100644 index 000000000000..8a9d020645be --- /dev/null +++ b/owl-bot-staging/google-cloud-security_center-v2/test/google/cloud/security_center/v2/security_center_rest_test.rb @@ -0,0 +1,2311 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +require "helper" +require "gapic/rest" +require "google/cloud/securitycenter/v2/securitycenter_service_pb" +require "google/cloud/security_center/v2/security_center/rest" + + +class ::Google::Cloud::SecurityCenter::V2::SecurityCenter::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_batch_create_resource_value_configs + # Create test objects. + client_result = ::Google::Cloud::SecurityCenter::V2::BatchCreateResourceValueConfigsResponse.new + http_response = OpenStruct.new body: client_result.to_json + + call_options = {} + + # Create request parameters for a unary method. + parent = "hello world" + requests = [{}] + + batch_create_resource_value_configs_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| + assert options.metadata.key? :"x-goog-api-client" + assert options.metadata[:"x-goog-api-client"].include? "rest" + refute options.metadata[:"x-goog-api-client"].include? "grpc" + end + + ::Google::Cloud::SecurityCenter::V2::SecurityCenter::Rest::ServiceStub.stub :transcode_batch_create_resource_value_configs_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, batch_create_resource_value_configs_client_stub do + # Create client + client = ::Google::Cloud::SecurityCenter::V2::SecurityCenter::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.batch_create_resource_value_configs({ parent: parent, requests: requests }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.batch_create_resource_value_configs parent: parent, requests: requests do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.batch_create_resource_value_configs ::Google::Cloud::SecurityCenter::V2::BatchCreateResourceValueConfigsRequest.new(parent: parent, requests: requests) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + client.batch_create_resource_value_configs({ parent: parent, requests: requests }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + client.batch_create_resource_value_configs(::Google::Cloud::SecurityCenter::V2::BatchCreateResourceValueConfigsRequest.new(parent: parent, requests: requests), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, batch_create_resource_value_configs_client_stub.call_count + end + end + end + + def test_bulk_mute_findings + # 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" + filter = "hello world" + mute_state = :MUTE_STATE_UNSPECIFIED + + bulk_mute_findings_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| + assert options.metadata.key? :"x-goog-api-client" + assert options.metadata[:"x-goog-api-client"].include? "rest" + refute options.metadata[:"x-goog-api-client"].include? "grpc" + end + + ::Google::Cloud::SecurityCenter::V2::SecurityCenter::Rest::ServiceStub.stub :transcode_bulk_mute_findings_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, bulk_mute_findings_client_stub do + # Create client + client = ::Google::Cloud::SecurityCenter::V2::SecurityCenter::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.bulk_mute_findings({ parent: parent, filter: filter, mute_state: mute_state }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.bulk_mute_findings parent: parent, filter: filter, mute_state: mute_state do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.bulk_mute_findings ::Google::Cloud::SecurityCenter::V2::BulkMuteFindingsRequest.new(parent: parent, filter: filter, mute_state: mute_state) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + client.bulk_mute_findings({ parent: parent, filter: filter, mute_state: mute_state }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + client.bulk_mute_findings(::Google::Cloud::SecurityCenter::V2::BulkMuteFindingsRequest.new(parent: parent, filter: filter, mute_state: mute_state), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, bulk_mute_findings_client_stub.call_count + end + end + end + + def test_create_big_query_export + # Create test objects. + client_result = ::Google::Cloud::SecurityCenter::V2::BigQueryExport.new + http_response = OpenStruct.new body: client_result.to_json + + call_options = {} + + # Create request parameters for a unary method. + parent = "hello world" + big_query_export = {} + big_query_export_id = "hello world" + + create_big_query_export_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| + assert options.metadata.key? :"x-goog-api-client" + assert options.metadata[:"x-goog-api-client"].include? "rest" + refute options.metadata[:"x-goog-api-client"].include? "grpc" + end + + ::Google::Cloud::SecurityCenter::V2::SecurityCenter::Rest::ServiceStub.stub :transcode_create_big_query_export_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, create_big_query_export_client_stub do + # Create client + client = ::Google::Cloud::SecurityCenter::V2::SecurityCenter::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.create_big_query_export({ parent: parent, big_query_export: big_query_export, big_query_export_id: big_query_export_id }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.create_big_query_export parent: parent, big_query_export: big_query_export, big_query_export_id: big_query_export_id do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.create_big_query_export ::Google::Cloud::SecurityCenter::V2::CreateBigQueryExportRequest.new(parent: parent, big_query_export: big_query_export, big_query_export_id: big_query_export_id) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + client.create_big_query_export({ parent: parent, big_query_export: big_query_export, big_query_export_id: big_query_export_id }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + client.create_big_query_export(::Google::Cloud::SecurityCenter::V2::CreateBigQueryExportRequest.new(parent: parent, big_query_export: big_query_export, big_query_export_id: big_query_export_id), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, create_big_query_export_client_stub.call_count + end + end + end + + def test_create_finding + # Create test objects. + client_result = ::Google::Cloud::SecurityCenter::V2::Finding.new + http_response = OpenStruct.new body: client_result.to_json + + call_options = {} + + # Create request parameters for a unary method. + parent = "hello world" + finding_id = "hello world" + finding = {} + + create_finding_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| + assert options.metadata.key? :"x-goog-api-client" + assert options.metadata[:"x-goog-api-client"].include? "rest" + refute options.metadata[:"x-goog-api-client"].include? "grpc" + end + + ::Google::Cloud::SecurityCenter::V2::SecurityCenter::Rest::ServiceStub.stub :transcode_create_finding_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, create_finding_client_stub do + # Create client + client = ::Google::Cloud::SecurityCenter::V2::SecurityCenter::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.create_finding({ parent: parent, finding_id: finding_id, finding: finding }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.create_finding parent: parent, finding_id: finding_id, finding: finding do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.create_finding ::Google::Cloud::SecurityCenter::V2::CreateFindingRequest.new(parent: parent, finding_id: finding_id, finding: finding) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + client.create_finding({ parent: parent, finding_id: finding_id, finding: finding }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + client.create_finding(::Google::Cloud::SecurityCenter::V2::CreateFindingRequest.new(parent: parent, finding_id: finding_id, finding: finding), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, create_finding_client_stub.call_count + end + end + end + + def test_create_mute_config + # Create test objects. + client_result = ::Google::Cloud::SecurityCenter::V2::MuteConfig.new + http_response = OpenStruct.new body: client_result.to_json + + call_options = {} + + # Create request parameters for a unary method. + parent = "hello world" + mute_config = {} + mute_config_id = "hello world" + + create_mute_config_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| + assert options.metadata.key? :"x-goog-api-client" + assert options.metadata[:"x-goog-api-client"].include? "rest" + refute options.metadata[:"x-goog-api-client"].include? "grpc" + end + + ::Google::Cloud::SecurityCenter::V2::SecurityCenter::Rest::ServiceStub.stub :transcode_create_mute_config_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, create_mute_config_client_stub do + # Create client + client = ::Google::Cloud::SecurityCenter::V2::SecurityCenter::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.create_mute_config({ parent: parent, mute_config: mute_config, mute_config_id: mute_config_id }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.create_mute_config parent: parent, mute_config: mute_config, mute_config_id: mute_config_id do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.create_mute_config ::Google::Cloud::SecurityCenter::V2::CreateMuteConfigRequest.new(parent: parent, mute_config: mute_config, mute_config_id: mute_config_id) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + client.create_mute_config({ parent: parent, mute_config: mute_config, mute_config_id: mute_config_id }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + client.create_mute_config(::Google::Cloud::SecurityCenter::V2::CreateMuteConfigRequest.new(parent: parent, mute_config: mute_config, mute_config_id: mute_config_id), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, create_mute_config_client_stub.call_count + end + end + end + + def test_create_notification_config + # Create test objects. + client_result = ::Google::Cloud::SecurityCenter::V2::NotificationConfig.new + http_response = OpenStruct.new body: client_result.to_json + + call_options = {} + + # Create request parameters for a unary method. + parent = "hello world" + config_id = "hello world" + notification_config = {} + + create_notification_config_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| + assert options.metadata.key? :"x-goog-api-client" + assert options.metadata[:"x-goog-api-client"].include? "rest" + refute options.metadata[:"x-goog-api-client"].include? "grpc" + end + + ::Google::Cloud::SecurityCenter::V2::SecurityCenter::Rest::ServiceStub.stub :transcode_create_notification_config_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, create_notification_config_client_stub do + # Create client + client = ::Google::Cloud::SecurityCenter::V2::SecurityCenter::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.create_notification_config({ parent: parent, config_id: config_id, notification_config: notification_config }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.create_notification_config parent: parent, config_id: config_id, notification_config: notification_config do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.create_notification_config ::Google::Cloud::SecurityCenter::V2::CreateNotificationConfigRequest.new(parent: parent, config_id: config_id, notification_config: notification_config) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + client.create_notification_config({ parent: parent, config_id: config_id, notification_config: notification_config }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + client.create_notification_config(::Google::Cloud::SecurityCenter::V2::CreateNotificationConfigRequest.new(parent: parent, config_id: config_id, notification_config: notification_config), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, create_notification_config_client_stub.call_count + end + end + end + + def test_create_source + # Create test objects. + client_result = ::Google::Cloud::SecurityCenter::V2::Source.new + http_response = OpenStruct.new body: client_result.to_json + + call_options = {} + + # Create request parameters for a unary method. + parent = "hello world" + source = {} + + create_source_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| + assert options.metadata.key? :"x-goog-api-client" + assert options.metadata[:"x-goog-api-client"].include? "rest" + refute options.metadata[:"x-goog-api-client"].include? "grpc" + end + + ::Google::Cloud::SecurityCenter::V2::SecurityCenter::Rest::ServiceStub.stub :transcode_create_source_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, create_source_client_stub do + # Create client + client = ::Google::Cloud::SecurityCenter::V2::SecurityCenter::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.create_source({ parent: parent, source: source }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.create_source parent: parent, source: source do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.create_source ::Google::Cloud::SecurityCenter::V2::CreateSourceRequest.new(parent: parent, source: source) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + client.create_source({ parent: parent, source: source }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + client.create_source(::Google::Cloud::SecurityCenter::V2::CreateSourceRequest.new(parent: parent, source: source), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, create_source_client_stub.call_count + end + end + end + + def test_delete_big_query_export + # Create test objects. + client_result = ::Google::Protobuf::Empty.new + http_response = OpenStruct.new body: client_result.to_json + + call_options = {} + + # Create request parameters for a unary method. + name = "hello world" + + delete_big_query_export_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| + assert options.metadata.key? :"x-goog-api-client" + assert options.metadata[:"x-goog-api-client"].include? "rest" + refute options.metadata[:"x-goog-api-client"].include? "grpc" + end + + ::Google::Cloud::SecurityCenter::V2::SecurityCenter::Rest::ServiceStub.stub :transcode_delete_big_query_export_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, delete_big_query_export_client_stub do + # Create client + client = ::Google::Cloud::SecurityCenter::V2::SecurityCenter::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.delete_big_query_export({ name: name }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.delete_big_query_export name: name do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.delete_big_query_export ::Google::Cloud::SecurityCenter::V2::DeleteBigQueryExportRequest.new(name: name) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + client.delete_big_query_export({ name: name }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + client.delete_big_query_export(::Google::Cloud::SecurityCenter::V2::DeleteBigQueryExportRequest.new(name: name), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, delete_big_query_export_client_stub.call_count + end + end + end + + def test_delete_mute_config + # Create test objects. + client_result = ::Google::Protobuf::Empty.new + http_response = OpenStruct.new body: client_result.to_json + + call_options = {} + + # Create request parameters for a unary method. + name = "hello world" + + delete_mute_config_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| + assert options.metadata.key? :"x-goog-api-client" + assert options.metadata[:"x-goog-api-client"].include? "rest" + refute options.metadata[:"x-goog-api-client"].include? "grpc" + end + + ::Google::Cloud::SecurityCenter::V2::SecurityCenter::Rest::ServiceStub.stub :transcode_delete_mute_config_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, delete_mute_config_client_stub do + # Create client + client = ::Google::Cloud::SecurityCenter::V2::SecurityCenter::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.delete_mute_config({ name: name }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.delete_mute_config name: name do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.delete_mute_config ::Google::Cloud::SecurityCenter::V2::DeleteMuteConfigRequest.new(name: name) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + client.delete_mute_config({ name: name }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + client.delete_mute_config(::Google::Cloud::SecurityCenter::V2::DeleteMuteConfigRequest.new(name: name), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, delete_mute_config_client_stub.call_count + end + end + end + + def test_delete_notification_config + # Create test objects. + client_result = ::Google::Protobuf::Empty.new + http_response = OpenStruct.new body: client_result.to_json + + call_options = {} + + # Create request parameters for a unary method. + name = "hello world" + + delete_notification_config_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| + assert options.metadata.key? :"x-goog-api-client" + assert options.metadata[:"x-goog-api-client"].include? "rest" + refute options.metadata[:"x-goog-api-client"].include? "grpc" + end + + ::Google::Cloud::SecurityCenter::V2::SecurityCenter::Rest::ServiceStub.stub :transcode_delete_notification_config_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, delete_notification_config_client_stub do + # Create client + client = ::Google::Cloud::SecurityCenter::V2::SecurityCenter::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.delete_notification_config({ name: name }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.delete_notification_config name: name do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.delete_notification_config ::Google::Cloud::SecurityCenter::V2::DeleteNotificationConfigRequest.new(name: name) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + client.delete_notification_config({ name: name }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + client.delete_notification_config(::Google::Cloud::SecurityCenter::V2::DeleteNotificationConfigRequest.new(name: name), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, delete_notification_config_client_stub.call_count + end + end + end + + def test_delete_resource_value_config + # Create test objects. + client_result = ::Google::Protobuf::Empty.new + http_response = OpenStruct.new body: client_result.to_json + + call_options = {} + + # Create request parameters for a unary method. + name = "hello world" + + delete_resource_value_config_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| + assert options.metadata.key? :"x-goog-api-client" + assert options.metadata[:"x-goog-api-client"].include? "rest" + refute options.metadata[:"x-goog-api-client"].include? "grpc" + end + + ::Google::Cloud::SecurityCenter::V2::SecurityCenter::Rest::ServiceStub.stub :transcode_delete_resource_value_config_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, delete_resource_value_config_client_stub do + # Create client + client = ::Google::Cloud::SecurityCenter::V2::SecurityCenter::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.delete_resource_value_config({ name: name }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.delete_resource_value_config name: name do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.delete_resource_value_config ::Google::Cloud::SecurityCenter::V2::DeleteResourceValueConfigRequest.new(name: name) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + client.delete_resource_value_config({ name: name }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + client.delete_resource_value_config(::Google::Cloud::SecurityCenter::V2::DeleteResourceValueConfigRequest.new(name: name), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, delete_resource_value_config_client_stub.call_count + end + end + end + + def test_get_big_query_export + # Create test objects. + client_result = ::Google::Cloud::SecurityCenter::V2::BigQueryExport.new + http_response = OpenStruct.new body: client_result.to_json + + call_options = {} + + # Create request parameters for a unary method. + name = "hello world" + + get_big_query_export_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| + assert options.metadata.key? :"x-goog-api-client" + assert options.metadata[:"x-goog-api-client"].include? "rest" + refute options.metadata[:"x-goog-api-client"].include? "grpc" + end + + ::Google::Cloud::SecurityCenter::V2::SecurityCenter::Rest::ServiceStub.stub :transcode_get_big_query_export_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, get_big_query_export_client_stub do + # Create client + client = ::Google::Cloud::SecurityCenter::V2::SecurityCenter::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.get_big_query_export({ name: name }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.get_big_query_export name: name do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.get_big_query_export ::Google::Cloud::SecurityCenter::V2::GetBigQueryExportRequest.new(name: name) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + client.get_big_query_export({ name: name }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + client.get_big_query_export(::Google::Cloud::SecurityCenter::V2::GetBigQueryExportRequest.new(name: name), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, get_big_query_export_client_stub.call_count + end + end + end + + def test_get_simulation + # Create test objects. + client_result = ::Google::Cloud::SecurityCenter::V2::Simulation.new + http_response = OpenStruct.new body: client_result.to_json + + call_options = {} + + # Create request parameters for a unary method. + name = "hello world" + + get_simulation_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| + assert options.metadata.key? :"x-goog-api-client" + assert options.metadata[:"x-goog-api-client"].include? "rest" + refute options.metadata[:"x-goog-api-client"].include? "grpc" + end + + ::Google::Cloud::SecurityCenter::V2::SecurityCenter::Rest::ServiceStub.stub :transcode_get_simulation_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, get_simulation_client_stub do + # Create client + client = ::Google::Cloud::SecurityCenter::V2::SecurityCenter::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.get_simulation({ name: name }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.get_simulation name: name do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.get_simulation ::Google::Cloud::SecurityCenter::V2::GetSimulationRequest.new(name: name) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + client.get_simulation({ name: name }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + client.get_simulation(::Google::Cloud::SecurityCenter::V2::GetSimulationRequest.new(name: name), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, get_simulation_client_stub.call_count + end + end + end + + def test_get_valued_resource + # Create test objects. + client_result = ::Google::Cloud::SecurityCenter::V2::ValuedResource.new + http_response = OpenStruct.new body: client_result.to_json + + call_options = {} + + # Create request parameters for a unary method. + name = "hello world" + + get_valued_resource_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| + assert options.metadata.key? :"x-goog-api-client" + assert options.metadata[:"x-goog-api-client"].include? "rest" + refute options.metadata[:"x-goog-api-client"].include? "grpc" + end + + ::Google::Cloud::SecurityCenter::V2::SecurityCenter::Rest::ServiceStub.stub :transcode_get_valued_resource_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, get_valued_resource_client_stub do + # Create client + client = ::Google::Cloud::SecurityCenter::V2::SecurityCenter::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.get_valued_resource({ name: name }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.get_valued_resource name: name do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.get_valued_resource ::Google::Cloud::SecurityCenter::V2::GetValuedResourceRequest.new(name: name) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + client.get_valued_resource({ name: name }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + client.get_valued_resource(::Google::Cloud::SecurityCenter::V2::GetValuedResourceRequest.new(name: name), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, get_valued_resource_client_stub.call_count + end + end + end + + def test_get_iam_policy + # Create test objects. + client_result = ::Google::Iam::V1::Policy.new + http_response = OpenStruct.new body: client_result.to_json + + call_options = {} + + # Create request parameters for a unary method. + resource = "hello world" + options = {} + + get_iam_policy_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| + assert options.metadata.key? :"x-goog-api-client" + assert options.metadata[:"x-goog-api-client"].include? "rest" + refute options.metadata[:"x-goog-api-client"].include? "grpc" + end + + ::Google::Cloud::SecurityCenter::V2::SecurityCenter::Rest::ServiceStub.stub :transcode_get_iam_policy_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, get_iam_policy_client_stub do + # Create client + client = ::Google::Cloud::SecurityCenter::V2::SecurityCenter::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.get_iam_policy({ resource: resource, options: options }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.get_iam_policy resource: resource, options: options do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.get_iam_policy ::Google::Iam::V1::GetIamPolicyRequest.new(resource: resource, options: options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + client.get_iam_policy({ resource: resource, options: options }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + client.get_iam_policy(::Google::Iam::V1::GetIamPolicyRequest.new(resource: resource, options: options), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, get_iam_policy_client_stub.call_count + end + end + end + + def test_get_mute_config + # Create test objects. + client_result = ::Google::Cloud::SecurityCenter::V2::MuteConfig.new + http_response = OpenStruct.new body: client_result.to_json + + call_options = {} + + # Create request parameters for a unary method. + name = "hello world" + + get_mute_config_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| + assert options.metadata.key? :"x-goog-api-client" + assert options.metadata[:"x-goog-api-client"].include? "rest" + refute options.metadata[:"x-goog-api-client"].include? "grpc" + end + + ::Google::Cloud::SecurityCenter::V2::SecurityCenter::Rest::ServiceStub.stub :transcode_get_mute_config_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, get_mute_config_client_stub do + # Create client + client = ::Google::Cloud::SecurityCenter::V2::SecurityCenter::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.get_mute_config({ name: name }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.get_mute_config name: name do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.get_mute_config ::Google::Cloud::SecurityCenter::V2::GetMuteConfigRequest.new(name: name) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + client.get_mute_config({ name: name }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + client.get_mute_config(::Google::Cloud::SecurityCenter::V2::GetMuteConfigRequest.new(name: name), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, get_mute_config_client_stub.call_count + end + end + end + + def test_get_notification_config + # Create test objects. + client_result = ::Google::Cloud::SecurityCenter::V2::NotificationConfig.new + http_response = OpenStruct.new body: client_result.to_json + + call_options = {} + + # Create request parameters for a unary method. + name = "hello world" + + get_notification_config_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| + assert options.metadata.key? :"x-goog-api-client" + assert options.metadata[:"x-goog-api-client"].include? "rest" + refute options.metadata[:"x-goog-api-client"].include? "grpc" + end + + ::Google::Cloud::SecurityCenter::V2::SecurityCenter::Rest::ServiceStub.stub :transcode_get_notification_config_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, get_notification_config_client_stub do + # Create client + client = ::Google::Cloud::SecurityCenter::V2::SecurityCenter::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.get_notification_config({ name: name }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.get_notification_config name: name do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.get_notification_config ::Google::Cloud::SecurityCenter::V2::GetNotificationConfigRequest.new(name: name) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + client.get_notification_config({ name: name }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + client.get_notification_config(::Google::Cloud::SecurityCenter::V2::GetNotificationConfigRequest.new(name: name), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, get_notification_config_client_stub.call_count + end + end + end + + def test_get_resource_value_config + # Create test objects. + client_result = ::Google::Cloud::SecurityCenter::V2::ResourceValueConfig.new + http_response = OpenStruct.new body: client_result.to_json + + call_options = {} + + # Create request parameters for a unary method. + name = "hello world" + + get_resource_value_config_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| + assert options.metadata.key? :"x-goog-api-client" + assert options.metadata[:"x-goog-api-client"].include? "rest" + refute options.metadata[:"x-goog-api-client"].include? "grpc" + end + + ::Google::Cloud::SecurityCenter::V2::SecurityCenter::Rest::ServiceStub.stub :transcode_get_resource_value_config_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, get_resource_value_config_client_stub do + # Create client + client = ::Google::Cloud::SecurityCenter::V2::SecurityCenter::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.get_resource_value_config({ name: name }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.get_resource_value_config name: name do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.get_resource_value_config ::Google::Cloud::SecurityCenter::V2::GetResourceValueConfigRequest.new(name: name) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + client.get_resource_value_config({ name: name }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + client.get_resource_value_config(::Google::Cloud::SecurityCenter::V2::GetResourceValueConfigRequest.new(name: name), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, get_resource_value_config_client_stub.call_count + end + end + end + + def test_get_source + # Create test objects. + client_result = ::Google::Cloud::SecurityCenter::V2::Source.new + http_response = OpenStruct.new body: client_result.to_json + + call_options = {} + + # Create request parameters for a unary method. + name = "hello world" + + get_source_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| + assert options.metadata.key? :"x-goog-api-client" + assert options.metadata[:"x-goog-api-client"].include? "rest" + refute options.metadata[:"x-goog-api-client"].include? "grpc" + end + + ::Google::Cloud::SecurityCenter::V2::SecurityCenter::Rest::ServiceStub.stub :transcode_get_source_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, get_source_client_stub do + # Create client + client = ::Google::Cloud::SecurityCenter::V2::SecurityCenter::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.get_source({ name: name }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.get_source name: name do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.get_source ::Google::Cloud::SecurityCenter::V2::GetSourceRequest.new(name: name) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + client.get_source({ name: name }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + client.get_source(::Google::Cloud::SecurityCenter::V2::GetSourceRequest.new(name: name), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, get_source_client_stub.call_count + end + end + end + + def test_group_findings + # Create test objects. + client_result = ::Google::Cloud::SecurityCenter::V2::GroupFindingsResponse.new + http_response = OpenStruct.new body: client_result.to_json + + call_options = {} + + # Create request parameters for a unary method. + parent = "hello world" + filter = "hello world" + group_by = "hello world" + page_token = "hello world" + page_size = 42 + + group_findings_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| + assert options.metadata.key? :"x-goog-api-client" + assert options.metadata[:"x-goog-api-client"].include? "rest" + refute options.metadata[:"x-goog-api-client"].include? "grpc" + end + + ::Google::Cloud::SecurityCenter::V2::SecurityCenter::Rest::ServiceStub.stub :transcode_group_findings_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, group_findings_client_stub do + # Create client + client = ::Google::Cloud::SecurityCenter::V2::SecurityCenter::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.group_findings({ parent: parent, filter: filter, group_by: group_by, page_token: page_token, page_size: page_size }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.group_findings parent: parent, filter: filter, group_by: group_by, page_token: page_token, page_size: page_size do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.group_findings ::Google::Cloud::SecurityCenter::V2::GroupFindingsRequest.new(parent: parent, filter: filter, group_by: group_by, page_token: page_token, page_size: page_size) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + client.group_findings({ parent: parent, filter: filter, group_by: group_by, page_token: page_token, page_size: page_size }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + client.group_findings(::Google::Cloud::SecurityCenter::V2::GroupFindingsRequest.new(parent: parent, filter: filter, group_by: group_by, page_token: page_token, page_size: page_size), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, group_findings_client_stub.call_count + end + end + end + + def test_list_attack_paths + # Create test objects. + client_result = ::Google::Cloud::SecurityCenter::V2::ListAttackPathsResponse.new + http_response = OpenStruct.new body: client_result.to_json + + call_options = {} + + # Create request parameters for a unary method. + parent = "hello world" + filter = "hello world" + page_token = "hello world" + page_size = 42 + + list_attack_paths_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| + assert options.metadata.key? :"x-goog-api-client" + assert options.metadata[:"x-goog-api-client"].include? "rest" + refute options.metadata[:"x-goog-api-client"].include? "grpc" + end + + ::Google::Cloud::SecurityCenter::V2::SecurityCenter::Rest::ServiceStub.stub :transcode_list_attack_paths_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, list_attack_paths_client_stub do + # Create client + client = ::Google::Cloud::SecurityCenter::V2::SecurityCenter::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.list_attack_paths({ parent: parent, filter: filter, page_token: page_token, page_size: page_size }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.list_attack_paths parent: parent, filter: filter, page_token: page_token, page_size: page_size do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.list_attack_paths ::Google::Cloud::SecurityCenter::V2::ListAttackPathsRequest.new(parent: parent, filter: filter, page_token: page_token, page_size: page_size) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + client.list_attack_paths({ parent: parent, filter: filter, page_token: page_token, page_size: page_size }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + client.list_attack_paths(::Google::Cloud::SecurityCenter::V2::ListAttackPathsRequest.new(parent: parent, filter: filter, page_token: page_token, page_size: page_size), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, list_attack_paths_client_stub.call_count + end + end + end + + def test_list_big_query_exports + # Create test objects. + client_result = ::Google::Cloud::SecurityCenter::V2::ListBigQueryExportsResponse.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_big_query_exports_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| + assert options.metadata.key? :"x-goog-api-client" + assert options.metadata[:"x-goog-api-client"].include? "rest" + refute options.metadata[:"x-goog-api-client"].include? "grpc" + end + + ::Google::Cloud::SecurityCenter::V2::SecurityCenter::Rest::ServiceStub.stub :transcode_list_big_query_exports_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, list_big_query_exports_client_stub do + # Create client + client = ::Google::Cloud::SecurityCenter::V2::SecurityCenter::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.list_big_query_exports({ 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_big_query_exports 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_big_query_exports ::Google::Cloud::SecurityCenter::V2::ListBigQueryExportsRequest.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_big_query_exports({ 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_big_query_exports(::Google::Cloud::SecurityCenter::V2::ListBigQueryExportsRequest.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_big_query_exports_client_stub.call_count + end + end + end + + def test_list_findings + # Create test objects. + client_result = ::Google::Cloud::SecurityCenter::V2::ListFindingsResponse.new + http_response = OpenStruct.new body: client_result.to_json + + call_options = {} + + # Create request parameters for a unary method. + parent = "hello world" + filter = "hello world" + order_by = "hello world" + field_mask = {} + page_token = "hello world" + page_size = 42 + + list_findings_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| + assert options.metadata.key? :"x-goog-api-client" + assert options.metadata[:"x-goog-api-client"].include? "rest" + refute options.metadata[:"x-goog-api-client"].include? "grpc" + end + + ::Google::Cloud::SecurityCenter::V2::SecurityCenter::Rest::ServiceStub.stub :transcode_list_findings_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, list_findings_client_stub do + # Create client + client = ::Google::Cloud::SecurityCenter::V2::SecurityCenter::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.list_findings({ parent: parent, filter: filter, order_by: order_by, field_mask: field_mask, page_token: page_token, page_size: page_size }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.list_findings parent: parent, filter: filter, order_by: order_by, field_mask: field_mask, page_token: page_token, page_size: page_size do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.list_findings ::Google::Cloud::SecurityCenter::V2::ListFindingsRequest.new(parent: parent, filter: filter, order_by: order_by, field_mask: field_mask, page_token: page_token, page_size: page_size) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + client.list_findings({ parent: parent, filter: filter, order_by: order_by, field_mask: field_mask, page_token: page_token, page_size: page_size }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + client.list_findings(::Google::Cloud::SecurityCenter::V2::ListFindingsRequest.new(parent: parent, filter: filter, order_by: order_by, field_mask: field_mask, page_token: page_token, page_size: page_size), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, list_findings_client_stub.call_count + end + end + end + + def test_list_mute_configs + # Create test objects. + client_result = ::Google::Cloud::SecurityCenter::V2::ListMuteConfigsResponse.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_mute_configs_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| + assert options.metadata.key? :"x-goog-api-client" + assert options.metadata[:"x-goog-api-client"].include? "rest" + refute options.metadata[:"x-goog-api-client"].include? "grpc" + end + + ::Google::Cloud::SecurityCenter::V2::SecurityCenter::Rest::ServiceStub.stub :transcode_list_mute_configs_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, list_mute_configs_client_stub do + # Create client + client = ::Google::Cloud::SecurityCenter::V2::SecurityCenter::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.list_mute_configs({ 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_mute_configs 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_mute_configs ::Google::Cloud::SecurityCenter::V2::ListMuteConfigsRequest.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_mute_configs({ 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_mute_configs(::Google::Cloud::SecurityCenter::V2::ListMuteConfigsRequest.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_mute_configs_client_stub.call_count + end + end + end + + def test_list_notification_configs + # Create test objects. + client_result = ::Google::Cloud::SecurityCenter::V2::ListNotificationConfigsResponse.new + http_response = OpenStruct.new body: client_result.to_json + + call_options = {} + + # Create request parameters for a unary method. + parent = "hello world" + page_token = "hello world" + page_size = 42 + + list_notification_configs_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| + assert options.metadata.key? :"x-goog-api-client" + assert options.metadata[:"x-goog-api-client"].include? "rest" + refute options.metadata[:"x-goog-api-client"].include? "grpc" + end + + ::Google::Cloud::SecurityCenter::V2::SecurityCenter::Rest::ServiceStub.stub :transcode_list_notification_configs_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, list_notification_configs_client_stub do + # Create client + client = ::Google::Cloud::SecurityCenter::V2::SecurityCenter::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.list_notification_configs({ parent: parent, page_token: page_token, page_size: page_size }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.list_notification_configs parent: parent, page_token: page_token, page_size: page_size do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.list_notification_configs ::Google::Cloud::SecurityCenter::V2::ListNotificationConfigsRequest.new(parent: parent, page_token: page_token, page_size: page_size) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + client.list_notification_configs({ parent: parent, page_token: page_token, page_size: page_size }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + client.list_notification_configs(::Google::Cloud::SecurityCenter::V2::ListNotificationConfigsRequest.new(parent: parent, page_token: page_token, page_size: page_size), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, list_notification_configs_client_stub.call_count + end + end + end + + def test_list_resource_value_configs + # Create test objects. + client_result = ::Google::Cloud::SecurityCenter::V2::ListResourceValueConfigsResponse.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_resource_value_configs_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| + assert options.metadata.key? :"x-goog-api-client" + assert options.metadata[:"x-goog-api-client"].include? "rest" + refute options.metadata[:"x-goog-api-client"].include? "grpc" + end + + ::Google::Cloud::SecurityCenter::V2::SecurityCenter::Rest::ServiceStub.stub :transcode_list_resource_value_configs_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, list_resource_value_configs_client_stub do + # Create client + client = ::Google::Cloud::SecurityCenter::V2::SecurityCenter::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.list_resource_value_configs({ 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_resource_value_configs 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_resource_value_configs ::Google::Cloud::SecurityCenter::V2::ListResourceValueConfigsRequest.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_resource_value_configs({ 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_resource_value_configs(::Google::Cloud::SecurityCenter::V2::ListResourceValueConfigsRequest.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_resource_value_configs_client_stub.call_count + end + end + end + + def test_list_sources + # Create test objects. + client_result = ::Google::Cloud::SecurityCenter::V2::ListSourcesResponse.new + http_response = OpenStruct.new body: client_result.to_json + + call_options = {} + + # Create request parameters for a unary method. + parent = "hello world" + page_token = "hello world" + page_size = 42 + + list_sources_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| + assert options.metadata.key? :"x-goog-api-client" + assert options.metadata[:"x-goog-api-client"].include? "rest" + refute options.metadata[:"x-goog-api-client"].include? "grpc" + end + + ::Google::Cloud::SecurityCenter::V2::SecurityCenter::Rest::ServiceStub.stub :transcode_list_sources_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, list_sources_client_stub do + # Create client + client = ::Google::Cloud::SecurityCenter::V2::SecurityCenter::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.list_sources({ parent: parent, page_token: page_token, page_size: page_size }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.list_sources parent: parent, page_token: page_token, page_size: page_size do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.list_sources ::Google::Cloud::SecurityCenter::V2::ListSourcesRequest.new(parent: parent, page_token: page_token, page_size: page_size) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + client.list_sources({ parent: parent, page_token: page_token, page_size: page_size }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + client.list_sources(::Google::Cloud::SecurityCenter::V2::ListSourcesRequest.new(parent: parent, page_token: page_token, page_size: page_size), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, list_sources_client_stub.call_count + end + end + end + + def test_list_valued_resources + # Create test objects. + client_result = ::Google::Cloud::SecurityCenter::V2::ListValuedResourcesResponse.new + http_response = OpenStruct.new body: client_result.to_json + + call_options = {} + + # Create request parameters for a unary method. + parent = "hello world" + filter = "hello world" + page_token = "hello world" + page_size = 42 + order_by = "hello world" + + list_valued_resources_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| + assert options.metadata.key? :"x-goog-api-client" + assert options.metadata[:"x-goog-api-client"].include? "rest" + refute options.metadata[:"x-goog-api-client"].include? "grpc" + end + + ::Google::Cloud::SecurityCenter::V2::SecurityCenter::Rest::ServiceStub.stub :transcode_list_valued_resources_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, list_valued_resources_client_stub do + # Create client + client = ::Google::Cloud::SecurityCenter::V2::SecurityCenter::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.list_valued_resources({ parent: parent, filter: filter, page_token: page_token, page_size: page_size, order_by: order_by }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.list_valued_resources parent: parent, filter: filter, page_token: page_token, page_size: page_size, order_by: order_by do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.list_valued_resources ::Google::Cloud::SecurityCenter::V2::ListValuedResourcesRequest.new(parent: parent, filter: filter, page_token: page_token, page_size: page_size, order_by: order_by) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + client.list_valued_resources({ parent: parent, filter: filter, page_token: page_token, page_size: page_size, order_by: order_by }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + client.list_valued_resources(::Google::Cloud::SecurityCenter::V2::ListValuedResourcesRequest.new(parent: parent, filter: filter, page_token: page_token, page_size: page_size, order_by: order_by), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, list_valued_resources_client_stub.call_count + end + end + end + + def test_set_finding_state + # Create test objects. + client_result = ::Google::Cloud::SecurityCenter::V2::Finding.new + http_response = OpenStruct.new body: client_result.to_json + + call_options = {} + + # Create request parameters for a unary method. + name = "hello world" + state = :STATE_UNSPECIFIED + + set_finding_state_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| + assert options.metadata.key? :"x-goog-api-client" + assert options.metadata[:"x-goog-api-client"].include? "rest" + refute options.metadata[:"x-goog-api-client"].include? "grpc" + end + + ::Google::Cloud::SecurityCenter::V2::SecurityCenter::Rest::ServiceStub.stub :transcode_set_finding_state_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, set_finding_state_client_stub do + # Create client + client = ::Google::Cloud::SecurityCenter::V2::SecurityCenter::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.set_finding_state({ name: name, state: state }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.set_finding_state name: name, state: state do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.set_finding_state ::Google::Cloud::SecurityCenter::V2::SetFindingStateRequest.new(name: name, state: state) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + client.set_finding_state({ name: name, state: state }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + client.set_finding_state(::Google::Cloud::SecurityCenter::V2::SetFindingStateRequest.new(name: name, state: state), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, set_finding_state_client_stub.call_count + end + end + end + + def test_set_iam_policy + # Create test objects. + client_result = ::Google::Iam::V1::Policy.new + http_response = OpenStruct.new body: client_result.to_json + + call_options = {} + + # Create request parameters for a unary method. + resource = "hello world" + policy = {} + update_mask = {} + + set_iam_policy_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| + assert options.metadata.key? :"x-goog-api-client" + assert options.metadata[:"x-goog-api-client"].include? "rest" + refute options.metadata[:"x-goog-api-client"].include? "grpc" + end + + ::Google::Cloud::SecurityCenter::V2::SecurityCenter::Rest::ServiceStub.stub :transcode_set_iam_policy_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, set_iam_policy_client_stub do + # Create client + client = ::Google::Cloud::SecurityCenter::V2::SecurityCenter::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.set_iam_policy({ resource: resource, policy: policy, update_mask: update_mask }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.set_iam_policy resource: resource, policy: policy, update_mask: update_mask do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.set_iam_policy ::Google::Iam::V1::SetIamPolicyRequest.new(resource: resource, policy: policy, update_mask: update_mask) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + client.set_iam_policy({ resource: resource, policy: policy, update_mask: update_mask }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + client.set_iam_policy(::Google::Iam::V1::SetIamPolicyRequest.new(resource: resource, policy: policy, update_mask: update_mask), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, set_iam_policy_client_stub.call_count + end + end + end + + def test_set_mute + # Create test objects. + client_result = ::Google::Cloud::SecurityCenter::V2::Finding.new + http_response = OpenStruct.new body: client_result.to_json + + call_options = {} + + # Create request parameters for a unary method. + name = "hello world" + mute = :MUTE_UNSPECIFIED + + set_mute_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| + assert options.metadata.key? :"x-goog-api-client" + assert options.metadata[:"x-goog-api-client"].include? "rest" + refute options.metadata[:"x-goog-api-client"].include? "grpc" + end + + ::Google::Cloud::SecurityCenter::V2::SecurityCenter::Rest::ServiceStub.stub :transcode_set_mute_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, set_mute_client_stub do + # Create client + client = ::Google::Cloud::SecurityCenter::V2::SecurityCenter::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.set_mute({ name: name, mute: mute }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.set_mute name: name, mute: mute do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.set_mute ::Google::Cloud::SecurityCenter::V2::SetMuteRequest.new(name: name, mute: mute) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + client.set_mute({ name: name, mute: mute }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + client.set_mute(::Google::Cloud::SecurityCenter::V2::SetMuteRequest.new(name: name, mute: mute), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, set_mute_client_stub.call_count + end + end + end + + def test_test_iam_permissions + # Create test objects. + client_result = ::Google::Iam::V1::TestIamPermissionsResponse.new + http_response = OpenStruct.new body: client_result.to_json + + call_options = {} + + # Create request parameters for a unary method. + resource = "hello world" + permissions = ["hello world"] + + test_iam_permissions_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| + assert options.metadata.key? :"x-goog-api-client" + assert options.metadata[:"x-goog-api-client"].include? "rest" + refute options.metadata[:"x-goog-api-client"].include? "grpc" + end + + ::Google::Cloud::SecurityCenter::V2::SecurityCenter::Rest::ServiceStub.stub :transcode_test_iam_permissions_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, test_iam_permissions_client_stub do + # Create client + client = ::Google::Cloud::SecurityCenter::V2::SecurityCenter::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.test_iam_permissions({ resource: resource, permissions: permissions }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.test_iam_permissions resource: resource, permissions: permissions do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.test_iam_permissions ::Google::Iam::V1::TestIamPermissionsRequest.new(resource: resource, permissions: permissions) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + client.test_iam_permissions({ resource: resource, permissions: permissions }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + client.test_iam_permissions(::Google::Iam::V1::TestIamPermissionsRequest.new(resource: resource, permissions: permissions), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, test_iam_permissions_client_stub.call_count + end + end + end + + def test_update_big_query_export + # Create test objects. + client_result = ::Google::Cloud::SecurityCenter::V2::BigQueryExport.new + http_response = OpenStruct.new body: client_result.to_json + + call_options = {} + + # Create request parameters for a unary method. + big_query_export = {} + update_mask = {} + + update_big_query_export_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| + assert options.metadata.key? :"x-goog-api-client" + assert options.metadata[:"x-goog-api-client"].include? "rest" + refute options.metadata[:"x-goog-api-client"].include? "grpc" + end + + ::Google::Cloud::SecurityCenter::V2::SecurityCenter::Rest::ServiceStub.stub :transcode_update_big_query_export_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, update_big_query_export_client_stub do + # Create client + client = ::Google::Cloud::SecurityCenter::V2::SecurityCenter::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.update_big_query_export({ big_query_export: big_query_export, update_mask: update_mask }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.update_big_query_export big_query_export: big_query_export, update_mask: update_mask do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.update_big_query_export ::Google::Cloud::SecurityCenter::V2::UpdateBigQueryExportRequest.new(big_query_export: big_query_export, update_mask: update_mask) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + client.update_big_query_export({ big_query_export: big_query_export, update_mask: update_mask }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + client.update_big_query_export(::Google::Cloud::SecurityCenter::V2::UpdateBigQueryExportRequest.new(big_query_export: big_query_export, update_mask: update_mask), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, update_big_query_export_client_stub.call_count + end + end + end + + def test_update_external_system + # Create test objects. + client_result = ::Google::Cloud::SecurityCenter::V2::ExternalSystem.new + http_response = OpenStruct.new body: client_result.to_json + + call_options = {} + + # Create request parameters for a unary method. + external_system = {} + update_mask = {} + + update_external_system_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| + assert options.metadata.key? :"x-goog-api-client" + assert options.metadata[:"x-goog-api-client"].include? "rest" + refute options.metadata[:"x-goog-api-client"].include? "grpc" + end + + ::Google::Cloud::SecurityCenter::V2::SecurityCenter::Rest::ServiceStub.stub :transcode_update_external_system_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, update_external_system_client_stub do + # Create client + client = ::Google::Cloud::SecurityCenter::V2::SecurityCenter::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.update_external_system({ external_system: external_system, update_mask: update_mask }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.update_external_system external_system: external_system, update_mask: update_mask do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.update_external_system ::Google::Cloud::SecurityCenter::V2::UpdateExternalSystemRequest.new(external_system: external_system, update_mask: update_mask) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + client.update_external_system({ external_system: external_system, update_mask: update_mask }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + client.update_external_system(::Google::Cloud::SecurityCenter::V2::UpdateExternalSystemRequest.new(external_system: external_system, update_mask: update_mask), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, update_external_system_client_stub.call_count + end + end + end + + def test_update_finding + # Create test objects. + client_result = ::Google::Cloud::SecurityCenter::V2::Finding.new + http_response = OpenStruct.new body: client_result.to_json + + call_options = {} + + # Create request parameters for a unary method. + finding = {} + update_mask = {} + + update_finding_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| + assert options.metadata.key? :"x-goog-api-client" + assert options.metadata[:"x-goog-api-client"].include? "rest" + refute options.metadata[:"x-goog-api-client"].include? "grpc" + end + + ::Google::Cloud::SecurityCenter::V2::SecurityCenter::Rest::ServiceStub.stub :transcode_update_finding_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, update_finding_client_stub do + # Create client + client = ::Google::Cloud::SecurityCenter::V2::SecurityCenter::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.update_finding({ finding: finding, update_mask: update_mask }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.update_finding finding: finding, update_mask: update_mask do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.update_finding ::Google::Cloud::SecurityCenter::V2::UpdateFindingRequest.new(finding: finding, update_mask: update_mask) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + client.update_finding({ finding: finding, update_mask: update_mask }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + client.update_finding(::Google::Cloud::SecurityCenter::V2::UpdateFindingRequest.new(finding: finding, update_mask: update_mask), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, update_finding_client_stub.call_count + end + end + end + + def test_update_mute_config + # Create test objects. + client_result = ::Google::Cloud::SecurityCenter::V2::MuteConfig.new + http_response = OpenStruct.new body: client_result.to_json + + call_options = {} + + # Create request parameters for a unary method. + mute_config = {} + update_mask = {} + + update_mute_config_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| + assert options.metadata.key? :"x-goog-api-client" + assert options.metadata[:"x-goog-api-client"].include? "rest" + refute options.metadata[:"x-goog-api-client"].include? "grpc" + end + + ::Google::Cloud::SecurityCenter::V2::SecurityCenter::Rest::ServiceStub.stub :transcode_update_mute_config_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, update_mute_config_client_stub do + # Create client + client = ::Google::Cloud::SecurityCenter::V2::SecurityCenter::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.update_mute_config({ mute_config: mute_config, update_mask: update_mask }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.update_mute_config mute_config: mute_config, update_mask: update_mask do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.update_mute_config ::Google::Cloud::SecurityCenter::V2::UpdateMuteConfigRequest.new(mute_config: mute_config, update_mask: update_mask) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + client.update_mute_config({ mute_config: mute_config, update_mask: update_mask }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + client.update_mute_config(::Google::Cloud::SecurityCenter::V2::UpdateMuteConfigRequest.new(mute_config: mute_config, update_mask: update_mask), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, update_mute_config_client_stub.call_count + end + end + end + + def test_update_notification_config + # Create test objects. + client_result = ::Google::Cloud::SecurityCenter::V2::NotificationConfig.new + http_response = OpenStruct.new body: client_result.to_json + + call_options = {} + + # Create request parameters for a unary method. + notification_config = {} + update_mask = {} + + update_notification_config_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| + assert options.metadata.key? :"x-goog-api-client" + assert options.metadata[:"x-goog-api-client"].include? "rest" + refute options.metadata[:"x-goog-api-client"].include? "grpc" + end + + ::Google::Cloud::SecurityCenter::V2::SecurityCenter::Rest::ServiceStub.stub :transcode_update_notification_config_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, update_notification_config_client_stub do + # Create client + client = ::Google::Cloud::SecurityCenter::V2::SecurityCenter::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.update_notification_config({ notification_config: notification_config, update_mask: update_mask }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.update_notification_config notification_config: notification_config, update_mask: update_mask do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.update_notification_config ::Google::Cloud::SecurityCenter::V2::UpdateNotificationConfigRequest.new(notification_config: notification_config, update_mask: update_mask) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + client.update_notification_config({ notification_config: notification_config, update_mask: update_mask }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + client.update_notification_config(::Google::Cloud::SecurityCenter::V2::UpdateNotificationConfigRequest.new(notification_config: notification_config, update_mask: update_mask), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, update_notification_config_client_stub.call_count + end + end + end + + def test_update_resource_value_config + # Create test objects. + client_result = ::Google::Cloud::SecurityCenter::V2::ResourceValueConfig.new + http_response = OpenStruct.new body: client_result.to_json + + call_options = {} + + # Create request parameters for a unary method. + resource_value_config = {} + update_mask = {} + + update_resource_value_config_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| + assert options.metadata.key? :"x-goog-api-client" + assert options.metadata[:"x-goog-api-client"].include? "rest" + refute options.metadata[:"x-goog-api-client"].include? "grpc" + end + + ::Google::Cloud::SecurityCenter::V2::SecurityCenter::Rest::ServiceStub.stub :transcode_update_resource_value_config_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, update_resource_value_config_client_stub do + # Create client + client = ::Google::Cloud::SecurityCenter::V2::SecurityCenter::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.update_resource_value_config({ resource_value_config: resource_value_config, update_mask: update_mask }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.update_resource_value_config resource_value_config: resource_value_config, update_mask: update_mask do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.update_resource_value_config ::Google::Cloud::SecurityCenter::V2::UpdateResourceValueConfigRequest.new(resource_value_config: resource_value_config, update_mask: update_mask) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + client.update_resource_value_config({ resource_value_config: resource_value_config, update_mask: update_mask }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + client.update_resource_value_config(::Google::Cloud::SecurityCenter::V2::UpdateResourceValueConfigRequest.new(resource_value_config: resource_value_config, update_mask: update_mask), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, update_resource_value_config_client_stub.call_count + end + end + end + + def test_update_security_marks + # Create test objects. + client_result = ::Google::Cloud::SecurityCenter::V2::SecurityMarks.new + http_response = OpenStruct.new body: client_result.to_json + + call_options = {} + + # Create request parameters for a unary method. + security_marks = {} + update_mask = {} + + update_security_marks_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| + assert options.metadata.key? :"x-goog-api-client" + assert options.metadata[:"x-goog-api-client"].include? "rest" + refute options.metadata[:"x-goog-api-client"].include? "grpc" + end + + ::Google::Cloud::SecurityCenter::V2::SecurityCenter::Rest::ServiceStub.stub :transcode_update_security_marks_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, update_security_marks_client_stub do + # Create client + client = ::Google::Cloud::SecurityCenter::V2::SecurityCenter::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.update_security_marks({ security_marks: security_marks, update_mask: update_mask }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.update_security_marks security_marks: security_marks, update_mask: update_mask do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.update_security_marks ::Google::Cloud::SecurityCenter::V2::UpdateSecurityMarksRequest.new(security_marks: security_marks, update_mask: update_mask) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + client.update_security_marks({ security_marks: security_marks, update_mask: update_mask }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + client.update_security_marks(::Google::Cloud::SecurityCenter::V2::UpdateSecurityMarksRequest.new(security_marks: security_marks, update_mask: update_mask), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, update_security_marks_client_stub.call_count + end + end + end + + def test_update_source + # Create test objects. + client_result = ::Google::Cloud::SecurityCenter::V2::Source.new + http_response = OpenStruct.new body: client_result.to_json + + call_options = {} + + # Create request parameters for a unary method. + source = {} + update_mask = {} + + update_source_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| + assert options.metadata.key? :"x-goog-api-client" + assert options.metadata[:"x-goog-api-client"].include? "rest" + refute options.metadata[:"x-goog-api-client"].include? "grpc" + end + + ::Google::Cloud::SecurityCenter::V2::SecurityCenter::Rest::ServiceStub.stub :transcode_update_source_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, update_source_client_stub do + # Create client + client = ::Google::Cloud::SecurityCenter::V2::SecurityCenter::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.update_source({ source: source, update_mask: update_mask }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.update_source source: source, update_mask: update_mask do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.update_source ::Google::Cloud::SecurityCenter::V2::UpdateSourceRequest.new(source: source, update_mask: update_mask) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + client.update_source({ source: source, update_mask: update_mask }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + client.update_source(::Google::Cloud::SecurityCenter::V2::UpdateSourceRequest.new(source: source, update_mask: update_mask), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, update_source_client_stub.call_count + end + end + end + + def test_configure + credentials_token = :dummy_value + + client = block_config = config = nil + dummy_stub = ClientStub.new nil + Gapic::Rest::ClientStub.stub :new, dummy_stub do + client = ::Google::Cloud::SecurityCenter::V2::SecurityCenter::Rest::Client.new do |config| + config.credentials = credentials_token + end + end + + config = client.configure do |c| + block_config = c + end + + assert_same block_config, config + assert_kind_of ::Google::Cloud::SecurityCenter::V2::SecurityCenter::Rest::Client::Configuration, config + end +end diff --git a/owl-bot-staging/google-cloud-security_center-v2/test/google/cloud/security_center/v2/security_center_test.rb b/owl-bot-staging/google-cloud-security_center-v2/test/google/cloud/security_center/v2/security_center_test.rb new file mode 100644 index 000000000000..2dcc90bc8f45 --- /dev/null +++ b/owl-bot-staging/google-cloud-security_center-v2/test/google/cloud/security_center/v2/security_center_test.rb @@ -0,0 +1,2592 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +require "helper" + +require "gapic/grpc/service_stub" + +require "google/cloud/securitycenter/v2/securitycenter_service_pb" +require "google/cloud/security_center/v2/security_center" + +class ::Google::Cloud::SecurityCenter::V2::SecurityCenter::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_batch_create_resource_value_configs + # Create GRPC objects. + grpc_response = ::Google::Cloud::SecurityCenter::V2::BatchCreateResourceValueConfigsResponse.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" + requests = [{}] + + batch_create_resource_value_configs_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :batch_create_resource_value_configs, name + assert_kind_of ::Google::Cloud::SecurityCenter::V2::BatchCreateResourceValueConfigsRequest, request + assert_equal "hello world", request["parent"] + assert_kind_of ::Google::Cloud::SecurityCenter::V2::CreateResourceValueConfigRequest, request["requests"].first + refute_nil options + end + + Gapic::ServiceStub.stub :new, batch_create_resource_value_configs_client_stub do + # Create client + client = ::Google::Cloud::SecurityCenter::V2::SecurityCenter::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.batch_create_resource_value_configs({ parent: parent, requests: requests }) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use named arguments + client.batch_create_resource_value_configs parent: parent, requests: requests do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.batch_create_resource_value_configs ::Google::Cloud::SecurityCenter::V2::BatchCreateResourceValueConfigsRequest.new(parent: parent, requests: requests) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use hash object with options + client.batch_create_resource_value_configs({ parent: parent, requests: requests }, grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object with options + client.batch_create_resource_value_configs(::Google::Cloud::SecurityCenter::V2::BatchCreateResourceValueConfigsRequest.new(parent: parent, requests: requests), grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Verify method calls + assert_equal 5, batch_create_resource_value_configs_client_stub.call_rpc_count + end + end + + def test_bulk_mute_findings + # 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" + filter = "hello world" + mute_state = :MUTE_STATE_UNSPECIFIED + + bulk_mute_findings_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :bulk_mute_findings, name + assert_kind_of ::Google::Cloud::SecurityCenter::V2::BulkMuteFindingsRequest, request + assert_equal "hello world", request["parent"] + assert_equal "hello world", request["filter"] + assert_equal :MUTE_STATE_UNSPECIFIED, request["mute_state"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, bulk_mute_findings_client_stub do + # Create client + client = ::Google::Cloud::SecurityCenter::V2::SecurityCenter::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.bulk_mute_findings({ parent: parent, filter: filter, mute_state: mute_state }) 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.bulk_mute_findings parent: parent, filter: filter, mute_state: mute_state 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.bulk_mute_findings ::Google::Cloud::SecurityCenter::V2::BulkMuteFindingsRequest.new(parent: parent, filter: filter, mute_state: mute_state) 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.bulk_mute_findings({ parent: parent, filter: filter, mute_state: mute_state }, 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.bulk_mute_findings(::Google::Cloud::SecurityCenter::V2::BulkMuteFindingsRequest.new(parent: parent, filter: filter, mute_state: mute_state), 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, bulk_mute_findings_client_stub.call_rpc_count + end + end + + def test_create_big_query_export + # Create GRPC objects. + grpc_response = ::Google::Cloud::SecurityCenter::V2::BigQueryExport.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" + big_query_export = {} + big_query_export_id = "hello world" + + create_big_query_export_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :create_big_query_export, name + assert_kind_of ::Google::Cloud::SecurityCenter::V2::CreateBigQueryExportRequest, request + assert_equal "hello world", request["parent"] + assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::SecurityCenter::V2::BigQueryExport), request["big_query_export"] + assert_equal "hello world", request["big_query_export_id"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, create_big_query_export_client_stub do + # Create client + client = ::Google::Cloud::SecurityCenter::V2::SecurityCenter::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.create_big_query_export({ parent: parent, big_query_export: big_query_export, big_query_export_id: big_query_export_id }) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use named arguments + client.create_big_query_export parent: parent, big_query_export: big_query_export, big_query_export_id: big_query_export_id do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.create_big_query_export ::Google::Cloud::SecurityCenter::V2::CreateBigQueryExportRequest.new(parent: parent, big_query_export: big_query_export, big_query_export_id: big_query_export_id) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use hash object with options + client.create_big_query_export({ parent: parent, big_query_export: big_query_export, big_query_export_id: big_query_export_id }, grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object with options + client.create_big_query_export(::Google::Cloud::SecurityCenter::V2::CreateBigQueryExportRequest.new(parent: parent, big_query_export: big_query_export, big_query_export_id: big_query_export_id), grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Verify method calls + assert_equal 5, create_big_query_export_client_stub.call_rpc_count + end + end + + def test_create_finding + # Create GRPC objects. + grpc_response = ::Google::Cloud::SecurityCenter::V2::Finding.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" + finding_id = "hello world" + finding = {} + + create_finding_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :create_finding, name + assert_kind_of ::Google::Cloud::SecurityCenter::V2::CreateFindingRequest, request + assert_equal "hello world", request["parent"] + assert_equal "hello world", request["finding_id"] + assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::SecurityCenter::V2::Finding), request["finding"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, create_finding_client_stub do + # Create client + client = ::Google::Cloud::SecurityCenter::V2::SecurityCenter::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.create_finding({ parent: parent, finding_id: finding_id, finding: finding }) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use named arguments + client.create_finding parent: parent, finding_id: finding_id, finding: finding do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.create_finding ::Google::Cloud::SecurityCenter::V2::CreateFindingRequest.new(parent: parent, finding_id: finding_id, finding: finding) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use hash object with options + client.create_finding({ parent: parent, finding_id: finding_id, finding: finding }, grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object with options + client.create_finding(::Google::Cloud::SecurityCenter::V2::CreateFindingRequest.new(parent: parent, finding_id: finding_id, finding: finding), grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Verify method calls + assert_equal 5, create_finding_client_stub.call_rpc_count + end + end + + def test_create_mute_config + # Create GRPC objects. + grpc_response = ::Google::Cloud::SecurityCenter::V2::MuteConfig.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" + mute_config = {} + mute_config_id = "hello world" + + create_mute_config_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :create_mute_config, name + assert_kind_of ::Google::Cloud::SecurityCenter::V2::CreateMuteConfigRequest, request + assert_equal "hello world", request["parent"] + assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::SecurityCenter::V2::MuteConfig), request["mute_config"] + assert_equal "hello world", request["mute_config_id"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, create_mute_config_client_stub do + # Create client + client = ::Google::Cloud::SecurityCenter::V2::SecurityCenter::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.create_mute_config({ parent: parent, mute_config: mute_config, mute_config_id: mute_config_id }) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use named arguments + client.create_mute_config parent: parent, mute_config: mute_config, mute_config_id: mute_config_id do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.create_mute_config ::Google::Cloud::SecurityCenter::V2::CreateMuteConfigRequest.new(parent: parent, mute_config: mute_config, mute_config_id: mute_config_id) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use hash object with options + client.create_mute_config({ parent: parent, mute_config: mute_config, mute_config_id: mute_config_id }, grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object with options + client.create_mute_config(::Google::Cloud::SecurityCenter::V2::CreateMuteConfigRequest.new(parent: parent, mute_config: mute_config, mute_config_id: mute_config_id), grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Verify method calls + assert_equal 5, create_mute_config_client_stub.call_rpc_count + end + end + + def test_create_notification_config + # Create GRPC objects. + grpc_response = ::Google::Cloud::SecurityCenter::V2::NotificationConfig.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" + config_id = "hello world" + notification_config = {} + + create_notification_config_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :create_notification_config, name + assert_kind_of ::Google::Cloud::SecurityCenter::V2::CreateNotificationConfigRequest, request + assert_equal "hello world", request["parent"] + assert_equal "hello world", request["config_id"] + assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::SecurityCenter::V2::NotificationConfig), request["notification_config"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, create_notification_config_client_stub do + # Create client + client = ::Google::Cloud::SecurityCenter::V2::SecurityCenter::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.create_notification_config({ parent: parent, config_id: config_id, notification_config: notification_config }) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use named arguments + client.create_notification_config parent: parent, config_id: config_id, notification_config: notification_config do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.create_notification_config ::Google::Cloud::SecurityCenter::V2::CreateNotificationConfigRequest.new(parent: parent, config_id: config_id, notification_config: notification_config) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use hash object with options + client.create_notification_config({ parent: parent, config_id: config_id, notification_config: notification_config }, grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object with options + client.create_notification_config(::Google::Cloud::SecurityCenter::V2::CreateNotificationConfigRequest.new(parent: parent, config_id: config_id, notification_config: notification_config), grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Verify method calls + assert_equal 5, create_notification_config_client_stub.call_rpc_count + end + end + + def test_create_source + # Create GRPC objects. + grpc_response = ::Google::Cloud::SecurityCenter::V2::Source.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" + source = {} + + create_source_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :create_source, name + assert_kind_of ::Google::Cloud::SecurityCenter::V2::CreateSourceRequest, request + assert_equal "hello world", request["parent"] + assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::SecurityCenter::V2::Source), request["source"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, create_source_client_stub do + # Create client + client = ::Google::Cloud::SecurityCenter::V2::SecurityCenter::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.create_source({ parent: parent, source: source }) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use named arguments + client.create_source parent: parent, source: source do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.create_source ::Google::Cloud::SecurityCenter::V2::CreateSourceRequest.new(parent: parent, source: source) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use hash object with options + client.create_source({ parent: parent, source: source }, grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object with options + client.create_source(::Google::Cloud::SecurityCenter::V2::CreateSourceRequest.new(parent: parent, source: source), grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Verify method calls + assert_equal 5, create_source_client_stub.call_rpc_count + end + end + + def test_delete_big_query_export + # 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_big_query_export_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :delete_big_query_export, name + assert_kind_of ::Google::Cloud::SecurityCenter::V2::DeleteBigQueryExportRequest, request + assert_equal "hello world", request["name"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, delete_big_query_export_client_stub do + # Create client + client = ::Google::Cloud::SecurityCenter::V2::SecurityCenter::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.delete_big_query_export({ name: name }) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use named arguments + client.delete_big_query_export name: name do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.delete_big_query_export ::Google::Cloud::SecurityCenter::V2::DeleteBigQueryExportRequest.new(name: name) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use hash object with options + client.delete_big_query_export({ 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_big_query_export(::Google::Cloud::SecurityCenter::V2::DeleteBigQueryExportRequest.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_big_query_export_client_stub.call_rpc_count + end + end + + def test_delete_mute_config + # 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_mute_config_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :delete_mute_config, name + assert_kind_of ::Google::Cloud::SecurityCenter::V2::DeleteMuteConfigRequest, request + assert_equal "hello world", request["name"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, delete_mute_config_client_stub do + # Create client + client = ::Google::Cloud::SecurityCenter::V2::SecurityCenter::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.delete_mute_config({ name: name }) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use named arguments + client.delete_mute_config name: name do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.delete_mute_config ::Google::Cloud::SecurityCenter::V2::DeleteMuteConfigRequest.new(name: name) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use hash object with options + client.delete_mute_config({ name: name }, grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object with options + client.delete_mute_config(::Google::Cloud::SecurityCenter::V2::DeleteMuteConfigRequest.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_mute_config_client_stub.call_rpc_count + end + end + + def test_delete_notification_config + # 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_notification_config_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :delete_notification_config, name + assert_kind_of ::Google::Cloud::SecurityCenter::V2::DeleteNotificationConfigRequest, request + assert_equal "hello world", request["name"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, delete_notification_config_client_stub do + # Create client + client = ::Google::Cloud::SecurityCenter::V2::SecurityCenter::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.delete_notification_config({ name: name }) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use named arguments + client.delete_notification_config name: name do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.delete_notification_config ::Google::Cloud::SecurityCenter::V2::DeleteNotificationConfigRequest.new(name: name) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use hash object with options + client.delete_notification_config({ name: name }, grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object with options + client.delete_notification_config(::Google::Cloud::SecurityCenter::V2::DeleteNotificationConfigRequest.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_notification_config_client_stub.call_rpc_count + end + end + + def test_delete_resource_value_config + # 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_resource_value_config_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :delete_resource_value_config, name + assert_kind_of ::Google::Cloud::SecurityCenter::V2::DeleteResourceValueConfigRequest, request + assert_equal "hello world", request["name"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, delete_resource_value_config_client_stub do + # Create client + client = ::Google::Cloud::SecurityCenter::V2::SecurityCenter::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.delete_resource_value_config({ name: name }) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use named arguments + client.delete_resource_value_config name: name do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.delete_resource_value_config ::Google::Cloud::SecurityCenter::V2::DeleteResourceValueConfigRequest.new(name: name) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use hash object with options + client.delete_resource_value_config({ name: name }, grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object with options + client.delete_resource_value_config(::Google::Cloud::SecurityCenter::V2::DeleteResourceValueConfigRequest.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_resource_value_config_client_stub.call_rpc_count + end + end + + def test_get_big_query_export + # Create GRPC objects. + grpc_response = ::Google::Cloud::SecurityCenter::V2::BigQueryExport.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_big_query_export_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :get_big_query_export, name + assert_kind_of ::Google::Cloud::SecurityCenter::V2::GetBigQueryExportRequest, request + assert_equal "hello world", request["name"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, get_big_query_export_client_stub do + # Create client + client = ::Google::Cloud::SecurityCenter::V2::SecurityCenter::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.get_big_query_export({ name: name }) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use named arguments + client.get_big_query_export name: name do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.get_big_query_export ::Google::Cloud::SecurityCenter::V2::GetBigQueryExportRequest.new(name: name) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use hash object with options + client.get_big_query_export({ 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_big_query_export(::Google::Cloud::SecurityCenter::V2::GetBigQueryExportRequest.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_big_query_export_client_stub.call_rpc_count + end + end + + def test_get_simulation + # Create GRPC objects. + grpc_response = ::Google::Cloud::SecurityCenter::V2::Simulation.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_simulation_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :get_simulation, name + assert_kind_of ::Google::Cloud::SecurityCenter::V2::GetSimulationRequest, request + assert_equal "hello world", request["name"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, get_simulation_client_stub do + # Create client + client = ::Google::Cloud::SecurityCenter::V2::SecurityCenter::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.get_simulation({ name: name }) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use named arguments + client.get_simulation name: name do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.get_simulation ::Google::Cloud::SecurityCenter::V2::GetSimulationRequest.new(name: name) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use hash object with options + client.get_simulation({ 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_simulation(::Google::Cloud::SecurityCenter::V2::GetSimulationRequest.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_simulation_client_stub.call_rpc_count + end + end + + def test_get_valued_resource + # Create GRPC objects. + grpc_response = ::Google::Cloud::SecurityCenter::V2::ValuedResource.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_valued_resource_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :get_valued_resource, name + assert_kind_of ::Google::Cloud::SecurityCenter::V2::GetValuedResourceRequest, request + assert_equal "hello world", request["name"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, get_valued_resource_client_stub do + # Create client + client = ::Google::Cloud::SecurityCenter::V2::SecurityCenter::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.get_valued_resource({ name: name }) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use named arguments + client.get_valued_resource name: name do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.get_valued_resource ::Google::Cloud::SecurityCenter::V2::GetValuedResourceRequest.new(name: name) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use hash object with options + client.get_valued_resource({ 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_valued_resource(::Google::Cloud::SecurityCenter::V2::GetValuedResourceRequest.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_valued_resource_client_stub.call_rpc_count + end + end + + def test_get_iam_policy + # Create GRPC objects. + grpc_response = ::Google::Iam::V1::Policy.new + grpc_operation = GRPC::ActiveCall::Operation.new nil + grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + grpc_options = {} + + # Create request parameters for a unary method. + resource = "hello world" + options = {} + + get_iam_policy_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :get_iam_policy, name + assert_kind_of ::Google::Iam::V1::GetIamPolicyRequest, request + assert_equal "hello world", request["resource"] + assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Iam::V1::GetPolicyOptions), request["options"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, get_iam_policy_client_stub do + # Create client + client = ::Google::Cloud::SecurityCenter::V2::SecurityCenter::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.get_iam_policy({ resource: resource, options: options }) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use named arguments + client.get_iam_policy resource: resource, options: options do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.get_iam_policy ::Google::Iam::V1::GetIamPolicyRequest.new(resource: resource, options: options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use hash object with options + client.get_iam_policy({ resource: resource, options: options }, grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object with options + client.get_iam_policy(::Google::Iam::V1::GetIamPolicyRequest.new(resource: resource, options: options), grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Verify method calls + assert_equal 5, get_iam_policy_client_stub.call_rpc_count + end + end + + def test_get_mute_config + # Create GRPC objects. + grpc_response = ::Google::Cloud::SecurityCenter::V2::MuteConfig.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_mute_config_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :get_mute_config, name + assert_kind_of ::Google::Cloud::SecurityCenter::V2::GetMuteConfigRequest, request + assert_equal "hello world", request["name"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, get_mute_config_client_stub do + # Create client + client = ::Google::Cloud::SecurityCenter::V2::SecurityCenter::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.get_mute_config({ name: name }) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use named arguments + client.get_mute_config name: name do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.get_mute_config ::Google::Cloud::SecurityCenter::V2::GetMuteConfigRequest.new(name: name) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use hash object with options + client.get_mute_config({ name: name }, grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object with options + client.get_mute_config(::Google::Cloud::SecurityCenter::V2::GetMuteConfigRequest.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_mute_config_client_stub.call_rpc_count + end + end + + def test_get_notification_config + # Create GRPC objects. + grpc_response = ::Google::Cloud::SecurityCenter::V2::NotificationConfig.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_notification_config_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :get_notification_config, name + assert_kind_of ::Google::Cloud::SecurityCenter::V2::GetNotificationConfigRequest, request + assert_equal "hello world", request["name"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, get_notification_config_client_stub do + # Create client + client = ::Google::Cloud::SecurityCenter::V2::SecurityCenter::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.get_notification_config({ name: name }) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use named arguments + client.get_notification_config name: name do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.get_notification_config ::Google::Cloud::SecurityCenter::V2::GetNotificationConfigRequest.new(name: name) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use hash object with options + client.get_notification_config({ name: name }, grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object with options + client.get_notification_config(::Google::Cloud::SecurityCenter::V2::GetNotificationConfigRequest.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_notification_config_client_stub.call_rpc_count + end + end + + def test_get_resource_value_config + # Create GRPC objects. + grpc_response = ::Google::Cloud::SecurityCenter::V2::ResourceValueConfig.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_resource_value_config_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :get_resource_value_config, name + assert_kind_of ::Google::Cloud::SecurityCenter::V2::GetResourceValueConfigRequest, request + assert_equal "hello world", request["name"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, get_resource_value_config_client_stub do + # Create client + client = ::Google::Cloud::SecurityCenter::V2::SecurityCenter::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.get_resource_value_config({ name: name }) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use named arguments + client.get_resource_value_config name: name do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.get_resource_value_config ::Google::Cloud::SecurityCenter::V2::GetResourceValueConfigRequest.new(name: name) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use hash object with options + client.get_resource_value_config({ name: name }, grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object with options + client.get_resource_value_config(::Google::Cloud::SecurityCenter::V2::GetResourceValueConfigRequest.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_resource_value_config_client_stub.call_rpc_count + end + end + + def test_get_source + # Create GRPC objects. + grpc_response = ::Google::Cloud::SecurityCenter::V2::Source.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_source_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :get_source, name + assert_kind_of ::Google::Cloud::SecurityCenter::V2::GetSourceRequest, request + assert_equal "hello world", request["name"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, get_source_client_stub do + # Create client + client = ::Google::Cloud::SecurityCenter::V2::SecurityCenter::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.get_source({ name: name }) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use named arguments + client.get_source name: name do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.get_source ::Google::Cloud::SecurityCenter::V2::GetSourceRequest.new(name: name) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use hash object with options + client.get_source({ 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_source(::Google::Cloud::SecurityCenter::V2::GetSourceRequest.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_source_client_stub.call_rpc_count + end + end + + def test_group_findings + # Create GRPC objects. + grpc_response = ::Google::Cloud::SecurityCenter::V2::GroupFindingsResponse.new + grpc_operation = GRPC::ActiveCall::Operation.new nil + grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + grpc_options = {} + + # Create request parameters for a unary method. + parent = "hello world" + filter = "hello world" + group_by = "hello world" + page_token = "hello world" + page_size = 42 + + group_findings_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :group_findings, name + assert_kind_of ::Google::Cloud::SecurityCenter::V2::GroupFindingsRequest, request + assert_equal "hello world", request["parent"] + assert_equal "hello world", request["filter"] + assert_equal "hello world", request["group_by"] + assert_equal "hello world", request["page_token"] + assert_equal 42, request["page_size"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, group_findings_client_stub do + # Create client + client = ::Google::Cloud::SecurityCenter::V2::SecurityCenter::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.group_findings({ parent: parent, filter: filter, group_by: group_by, page_token: page_token, page_size: page_size }) 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.group_findings parent: parent, filter: filter, group_by: group_by, page_token: page_token, page_size: page_size 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.group_findings ::Google::Cloud::SecurityCenter::V2::GroupFindingsRequest.new(parent: parent, filter: filter, group_by: group_by, page_token: page_token, page_size: page_size) 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.group_findings({ parent: parent, filter: filter, group_by: group_by, page_token: page_token, page_size: page_size }, 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.group_findings(::Google::Cloud::SecurityCenter::V2::GroupFindingsRequest.new(parent: parent, filter: filter, group_by: group_by, page_token: page_token, page_size: page_size), 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, group_findings_client_stub.call_rpc_count + end + end + + def test_list_attack_paths + # Create GRPC objects. + grpc_response = ::Google::Cloud::SecurityCenter::V2::ListAttackPathsResponse.new + grpc_operation = GRPC::ActiveCall::Operation.new nil + grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + grpc_options = {} + + # Create request parameters for a unary method. + parent = "hello world" + filter = "hello world" + page_token = "hello world" + page_size = 42 + + list_attack_paths_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :list_attack_paths, name + assert_kind_of ::Google::Cloud::SecurityCenter::V2::ListAttackPathsRequest, request + assert_equal "hello world", request["parent"] + assert_equal "hello world", request["filter"] + assert_equal "hello world", request["page_token"] + assert_equal 42, request["page_size"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, list_attack_paths_client_stub do + # Create client + client = ::Google::Cloud::SecurityCenter::V2::SecurityCenter::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.list_attack_paths({ parent: parent, filter: filter, page_token: page_token, page_size: page_size }) 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_attack_paths parent: parent, filter: filter, page_token: page_token, page_size: page_size 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_attack_paths ::Google::Cloud::SecurityCenter::V2::ListAttackPathsRequest.new(parent: parent, filter: filter, page_token: page_token, page_size: page_size) 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_attack_paths({ parent: parent, filter: filter, page_token: page_token, page_size: page_size }, 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_attack_paths(::Google::Cloud::SecurityCenter::V2::ListAttackPathsRequest.new(parent: parent, filter: filter, page_token: page_token, page_size: page_size), 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_attack_paths_client_stub.call_rpc_count + end + end + + def test_list_big_query_exports + # Create GRPC objects. + grpc_response = ::Google::Cloud::SecurityCenter::V2::ListBigQueryExportsResponse.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_big_query_exports_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :list_big_query_exports, name + assert_kind_of ::Google::Cloud::SecurityCenter::V2::ListBigQueryExportsRequest, 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_big_query_exports_client_stub do + # Create client + client = ::Google::Cloud::SecurityCenter::V2::SecurityCenter::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.list_big_query_exports({ 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_big_query_exports 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_big_query_exports ::Google::Cloud::SecurityCenter::V2::ListBigQueryExportsRequest.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_big_query_exports({ 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_big_query_exports(::Google::Cloud::SecurityCenter::V2::ListBigQueryExportsRequest.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_big_query_exports_client_stub.call_rpc_count + end + end + + def test_list_findings + # Create GRPC objects. + grpc_response = ::Google::Cloud::SecurityCenter::V2::ListFindingsResponse.new + grpc_operation = GRPC::ActiveCall::Operation.new nil + grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + grpc_options = {} + + # Create request parameters for a unary method. + parent = "hello world" + filter = "hello world" + order_by = "hello world" + field_mask = {} + page_token = "hello world" + page_size = 42 + + list_findings_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :list_findings, name + assert_kind_of ::Google::Cloud::SecurityCenter::V2::ListFindingsRequest, request + assert_equal "hello world", request["parent"] + assert_equal "hello world", request["filter"] + assert_equal "hello world", request["order_by"] + assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Protobuf::FieldMask), request["field_mask"] + assert_equal "hello world", request["page_token"] + assert_equal 42, request["page_size"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, list_findings_client_stub do + # Create client + client = ::Google::Cloud::SecurityCenter::V2::SecurityCenter::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.list_findings({ parent: parent, filter: filter, order_by: order_by, field_mask: field_mask, page_token: page_token, page_size: page_size }) 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_findings parent: parent, filter: filter, order_by: order_by, field_mask: field_mask, page_token: page_token, page_size: page_size 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_findings ::Google::Cloud::SecurityCenter::V2::ListFindingsRequest.new(parent: parent, filter: filter, order_by: order_by, field_mask: field_mask, page_token: page_token, page_size: page_size) 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_findings({ parent: parent, filter: filter, order_by: order_by, field_mask: field_mask, page_token: page_token, page_size: page_size }, 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_findings(::Google::Cloud::SecurityCenter::V2::ListFindingsRequest.new(parent: parent, filter: filter, order_by: order_by, field_mask: field_mask, page_token: page_token, page_size: page_size), 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_findings_client_stub.call_rpc_count + end + end + + def test_list_mute_configs + # Create GRPC objects. + grpc_response = ::Google::Cloud::SecurityCenter::V2::ListMuteConfigsResponse.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_mute_configs_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :list_mute_configs, name + assert_kind_of ::Google::Cloud::SecurityCenter::V2::ListMuteConfigsRequest, 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_mute_configs_client_stub do + # Create client + client = ::Google::Cloud::SecurityCenter::V2::SecurityCenter::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.list_mute_configs({ 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_mute_configs 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_mute_configs ::Google::Cloud::SecurityCenter::V2::ListMuteConfigsRequest.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_mute_configs({ 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_mute_configs(::Google::Cloud::SecurityCenter::V2::ListMuteConfigsRequest.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_mute_configs_client_stub.call_rpc_count + end + end + + def test_list_notification_configs + # Create GRPC objects. + grpc_response = ::Google::Cloud::SecurityCenter::V2::ListNotificationConfigsResponse.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_token = "hello world" + page_size = 42 + + list_notification_configs_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :list_notification_configs, name + assert_kind_of ::Google::Cloud::SecurityCenter::V2::ListNotificationConfigsRequest, request + assert_equal "hello world", request["parent"] + assert_equal "hello world", request["page_token"] + assert_equal 42, request["page_size"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, list_notification_configs_client_stub do + # Create client + client = ::Google::Cloud::SecurityCenter::V2::SecurityCenter::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.list_notification_configs({ parent: parent, page_token: page_token, page_size: page_size }) 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_notification_configs parent: parent, page_token: page_token, page_size: page_size 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_notification_configs ::Google::Cloud::SecurityCenter::V2::ListNotificationConfigsRequest.new(parent: parent, page_token: page_token, page_size: page_size) 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_notification_configs({ parent: parent, page_token: page_token, page_size: page_size }, 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_notification_configs(::Google::Cloud::SecurityCenter::V2::ListNotificationConfigsRequest.new(parent: parent, page_token: page_token, page_size: page_size), 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_notification_configs_client_stub.call_rpc_count + end + end + + def test_list_resource_value_configs + # Create GRPC objects. + grpc_response = ::Google::Cloud::SecurityCenter::V2::ListResourceValueConfigsResponse.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_resource_value_configs_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :list_resource_value_configs, name + assert_kind_of ::Google::Cloud::SecurityCenter::V2::ListResourceValueConfigsRequest, 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_resource_value_configs_client_stub do + # Create client + client = ::Google::Cloud::SecurityCenter::V2::SecurityCenter::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.list_resource_value_configs({ 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_resource_value_configs 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_resource_value_configs ::Google::Cloud::SecurityCenter::V2::ListResourceValueConfigsRequest.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_resource_value_configs({ 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_resource_value_configs(::Google::Cloud::SecurityCenter::V2::ListResourceValueConfigsRequest.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_resource_value_configs_client_stub.call_rpc_count + end + end + + def test_list_sources + # Create GRPC objects. + grpc_response = ::Google::Cloud::SecurityCenter::V2::ListSourcesResponse.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_token = "hello world" + page_size = 42 + + list_sources_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :list_sources, name + assert_kind_of ::Google::Cloud::SecurityCenter::V2::ListSourcesRequest, request + assert_equal "hello world", request["parent"] + assert_equal "hello world", request["page_token"] + assert_equal 42, request["page_size"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, list_sources_client_stub do + # Create client + client = ::Google::Cloud::SecurityCenter::V2::SecurityCenter::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.list_sources({ parent: parent, page_token: page_token, page_size: page_size }) 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_sources parent: parent, page_token: page_token, page_size: page_size 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_sources ::Google::Cloud::SecurityCenter::V2::ListSourcesRequest.new(parent: parent, page_token: page_token, page_size: page_size) 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_sources({ parent: parent, page_token: page_token, page_size: page_size }, 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_sources(::Google::Cloud::SecurityCenter::V2::ListSourcesRequest.new(parent: parent, page_token: page_token, page_size: page_size), 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_sources_client_stub.call_rpc_count + end + end + + def test_list_valued_resources + # Create GRPC objects. + grpc_response = ::Google::Cloud::SecurityCenter::V2::ListValuedResourcesResponse.new + grpc_operation = GRPC::ActiveCall::Operation.new nil + grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + grpc_options = {} + + # Create request parameters for a unary method. + parent = "hello world" + filter = "hello world" + page_token = "hello world" + page_size = 42 + order_by = "hello world" + + list_valued_resources_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :list_valued_resources, name + assert_kind_of ::Google::Cloud::SecurityCenter::V2::ListValuedResourcesRequest, request + assert_equal "hello world", request["parent"] + assert_equal "hello world", request["filter"] + assert_equal "hello world", request["page_token"] + assert_equal 42, request["page_size"] + assert_equal "hello world", request["order_by"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, list_valued_resources_client_stub do + # Create client + client = ::Google::Cloud::SecurityCenter::V2::SecurityCenter::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.list_valued_resources({ parent: parent, filter: filter, page_token: page_token, page_size: page_size, order_by: order_by }) 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_valued_resources parent: parent, filter: filter, page_token: page_token, page_size: page_size, order_by: order_by 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_valued_resources ::Google::Cloud::SecurityCenter::V2::ListValuedResourcesRequest.new(parent: parent, filter: filter, page_token: page_token, page_size: page_size, order_by: order_by) 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_valued_resources({ parent: parent, filter: filter, page_token: page_token, page_size: page_size, order_by: order_by }, 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_valued_resources(::Google::Cloud::SecurityCenter::V2::ListValuedResourcesRequest.new(parent: parent, filter: filter, page_token: page_token, page_size: page_size, order_by: order_by), 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_valued_resources_client_stub.call_rpc_count + end + end + + def test_set_finding_state + # Create GRPC objects. + grpc_response = ::Google::Cloud::SecurityCenter::V2::Finding.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" + state = :STATE_UNSPECIFIED + + set_finding_state_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :set_finding_state, name + assert_kind_of ::Google::Cloud::SecurityCenter::V2::SetFindingStateRequest, request + assert_equal "hello world", request["name"] + assert_equal :STATE_UNSPECIFIED, request["state"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, set_finding_state_client_stub do + # Create client + client = ::Google::Cloud::SecurityCenter::V2::SecurityCenter::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.set_finding_state({ name: name, state: state }) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use named arguments + client.set_finding_state name: name, state: state do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.set_finding_state ::Google::Cloud::SecurityCenter::V2::SetFindingStateRequest.new(name: name, state: state) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use hash object with options + client.set_finding_state({ name: name, state: state }, grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object with options + client.set_finding_state(::Google::Cloud::SecurityCenter::V2::SetFindingStateRequest.new(name: name, state: state), grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Verify method calls + assert_equal 5, set_finding_state_client_stub.call_rpc_count + end + end + + def test_set_iam_policy + # Create GRPC objects. + grpc_response = ::Google::Iam::V1::Policy.new + grpc_operation = GRPC::ActiveCall::Operation.new nil + grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + grpc_options = {} + + # Create request parameters for a unary method. + resource = "hello world" + policy = {} + update_mask = {} + + set_iam_policy_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :set_iam_policy, name + assert_kind_of ::Google::Iam::V1::SetIamPolicyRequest, request + assert_equal "hello world", request["resource"] + assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Iam::V1::Policy), request["policy"] + assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Protobuf::FieldMask), request["update_mask"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, set_iam_policy_client_stub do + # Create client + client = ::Google::Cloud::SecurityCenter::V2::SecurityCenter::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.set_iam_policy({ resource: resource, policy: policy, update_mask: update_mask }) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use named arguments + client.set_iam_policy resource: resource, policy: policy, update_mask: update_mask do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.set_iam_policy ::Google::Iam::V1::SetIamPolicyRequest.new(resource: resource, policy: policy, update_mask: update_mask) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use hash object with options + client.set_iam_policy({ resource: resource, policy: policy, update_mask: update_mask }, grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object with options + client.set_iam_policy(::Google::Iam::V1::SetIamPolicyRequest.new(resource: resource, policy: policy, update_mask: update_mask), grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Verify method calls + assert_equal 5, set_iam_policy_client_stub.call_rpc_count + end + end + + def test_set_mute + # Create GRPC objects. + grpc_response = ::Google::Cloud::SecurityCenter::V2::Finding.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" + mute = :MUTE_UNSPECIFIED + + set_mute_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :set_mute, name + assert_kind_of ::Google::Cloud::SecurityCenter::V2::SetMuteRequest, request + assert_equal "hello world", request["name"] + assert_equal :MUTE_UNSPECIFIED, request["mute"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, set_mute_client_stub do + # Create client + client = ::Google::Cloud::SecurityCenter::V2::SecurityCenter::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.set_mute({ name: name, mute: mute }) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use named arguments + client.set_mute name: name, mute: mute do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.set_mute ::Google::Cloud::SecurityCenter::V2::SetMuteRequest.new(name: name, mute: mute) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use hash object with options + client.set_mute({ name: name, mute: mute }, grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object with options + client.set_mute(::Google::Cloud::SecurityCenter::V2::SetMuteRequest.new(name: name, mute: mute), grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Verify method calls + assert_equal 5, set_mute_client_stub.call_rpc_count + end + end + + def test_test_iam_permissions + # Create GRPC objects. + grpc_response = ::Google::Iam::V1::TestIamPermissionsResponse.new + grpc_operation = GRPC::ActiveCall::Operation.new nil + grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + grpc_options = {} + + # Create request parameters for a unary method. + resource = "hello world" + permissions = ["hello world"] + + test_iam_permissions_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :test_iam_permissions, name + assert_kind_of ::Google::Iam::V1::TestIamPermissionsRequest, request + assert_equal "hello world", request["resource"] + assert_equal ["hello world"], request["permissions"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, test_iam_permissions_client_stub do + # Create client + client = ::Google::Cloud::SecurityCenter::V2::SecurityCenter::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.test_iam_permissions({ resource: resource, permissions: permissions }) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use named arguments + client.test_iam_permissions resource: resource, permissions: permissions do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.test_iam_permissions ::Google::Iam::V1::TestIamPermissionsRequest.new(resource: resource, permissions: permissions) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use hash object with options + client.test_iam_permissions({ resource: resource, permissions: permissions }, grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object with options + client.test_iam_permissions(::Google::Iam::V1::TestIamPermissionsRequest.new(resource: resource, permissions: permissions), grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Verify method calls + assert_equal 5, test_iam_permissions_client_stub.call_rpc_count + end + end + + def test_update_big_query_export + # Create GRPC objects. + grpc_response = ::Google::Cloud::SecurityCenter::V2::BigQueryExport.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. + big_query_export = {} + update_mask = {} + + update_big_query_export_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :update_big_query_export, name + assert_kind_of ::Google::Cloud::SecurityCenter::V2::UpdateBigQueryExportRequest, request + assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::SecurityCenter::V2::BigQueryExport), request["big_query_export"] + assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Protobuf::FieldMask), request["update_mask"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, update_big_query_export_client_stub do + # Create client + client = ::Google::Cloud::SecurityCenter::V2::SecurityCenter::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.update_big_query_export({ big_query_export: big_query_export, update_mask: update_mask }) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use named arguments + client.update_big_query_export big_query_export: big_query_export, update_mask: update_mask do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.update_big_query_export ::Google::Cloud::SecurityCenter::V2::UpdateBigQueryExportRequest.new(big_query_export: big_query_export, update_mask: update_mask) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use hash object with options + client.update_big_query_export({ big_query_export: big_query_export, update_mask: update_mask }, grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object with options + client.update_big_query_export(::Google::Cloud::SecurityCenter::V2::UpdateBigQueryExportRequest.new(big_query_export: big_query_export, update_mask: update_mask), grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Verify method calls + assert_equal 5, update_big_query_export_client_stub.call_rpc_count + end + end + + def test_update_external_system + # Create GRPC objects. + grpc_response = ::Google::Cloud::SecurityCenter::V2::ExternalSystem.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. + external_system = {} + update_mask = {} + + update_external_system_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :update_external_system, name + assert_kind_of ::Google::Cloud::SecurityCenter::V2::UpdateExternalSystemRequest, request + assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::SecurityCenter::V2::ExternalSystem), request["external_system"] + assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Protobuf::FieldMask), request["update_mask"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, update_external_system_client_stub do + # Create client + client = ::Google::Cloud::SecurityCenter::V2::SecurityCenter::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.update_external_system({ external_system: external_system, update_mask: update_mask }) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use named arguments + client.update_external_system external_system: external_system, update_mask: update_mask do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.update_external_system ::Google::Cloud::SecurityCenter::V2::UpdateExternalSystemRequest.new(external_system: external_system, update_mask: update_mask) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use hash object with options + client.update_external_system({ external_system: external_system, update_mask: update_mask }, grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object with options + client.update_external_system(::Google::Cloud::SecurityCenter::V2::UpdateExternalSystemRequest.new(external_system: external_system, update_mask: update_mask), grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Verify method calls + assert_equal 5, update_external_system_client_stub.call_rpc_count + end + end + + def test_update_finding + # Create GRPC objects. + grpc_response = ::Google::Cloud::SecurityCenter::V2::Finding.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. + finding = {} + update_mask = {} + + update_finding_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :update_finding, name + assert_kind_of ::Google::Cloud::SecurityCenter::V2::UpdateFindingRequest, request + assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::SecurityCenter::V2::Finding), request["finding"] + assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Protobuf::FieldMask), request["update_mask"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, update_finding_client_stub do + # Create client + client = ::Google::Cloud::SecurityCenter::V2::SecurityCenter::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.update_finding({ finding: finding, update_mask: update_mask }) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use named arguments + client.update_finding finding: finding, update_mask: update_mask do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.update_finding ::Google::Cloud::SecurityCenter::V2::UpdateFindingRequest.new(finding: finding, update_mask: update_mask) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use hash object with options + client.update_finding({ finding: finding, update_mask: update_mask }, grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object with options + client.update_finding(::Google::Cloud::SecurityCenter::V2::UpdateFindingRequest.new(finding: finding, update_mask: update_mask), grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Verify method calls + assert_equal 5, update_finding_client_stub.call_rpc_count + end + end + + def test_update_mute_config + # Create GRPC objects. + grpc_response = ::Google::Cloud::SecurityCenter::V2::MuteConfig.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. + mute_config = {} + update_mask = {} + + update_mute_config_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :update_mute_config, name + assert_kind_of ::Google::Cloud::SecurityCenter::V2::UpdateMuteConfigRequest, request + assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::SecurityCenter::V2::MuteConfig), request["mute_config"] + assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Protobuf::FieldMask), request["update_mask"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, update_mute_config_client_stub do + # Create client + client = ::Google::Cloud::SecurityCenter::V2::SecurityCenter::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.update_mute_config({ mute_config: mute_config, update_mask: update_mask }) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use named arguments + client.update_mute_config mute_config: mute_config, update_mask: update_mask do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.update_mute_config ::Google::Cloud::SecurityCenter::V2::UpdateMuteConfigRequest.new(mute_config: mute_config, update_mask: update_mask) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use hash object with options + client.update_mute_config({ mute_config: mute_config, update_mask: update_mask }, grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object with options + client.update_mute_config(::Google::Cloud::SecurityCenter::V2::UpdateMuteConfigRequest.new(mute_config: mute_config, update_mask: update_mask), grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Verify method calls + assert_equal 5, update_mute_config_client_stub.call_rpc_count + end + end + + def test_update_notification_config + # Create GRPC objects. + grpc_response = ::Google::Cloud::SecurityCenter::V2::NotificationConfig.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. + notification_config = {} + update_mask = {} + + update_notification_config_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :update_notification_config, name + assert_kind_of ::Google::Cloud::SecurityCenter::V2::UpdateNotificationConfigRequest, request + assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::SecurityCenter::V2::NotificationConfig), request["notification_config"] + assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Protobuf::FieldMask), request["update_mask"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, update_notification_config_client_stub do + # Create client + client = ::Google::Cloud::SecurityCenter::V2::SecurityCenter::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.update_notification_config({ notification_config: notification_config, update_mask: update_mask }) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use named arguments + client.update_notification_config notification_config: notification_config, update_mask: update_mask do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.update_notification_config ::Google::Cloud::SecurityCenter::V2::UpdateNotificationConfigRequest.new(notification_config: notification_config, update_mask: update_mask) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use hash object with options + client.update_notification_config({ notification_config: notification_config, update_mask: update_mask }, grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object with options + client.update_notification_config(::Google::Cloud::SecurityCenter::V2::UpdateNotificationConfigRequest.new(notification_config: notification_config, update_mask: update_mask), grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Verify method calls + assert_equal 5, update_notification_config_client_stub.call_rpc_count + end + end + + def test_update_resource_value_config + # Create GRPC objects. + grpc_response = ::Google::Cloud::SecurityCenter::V2::ResourceValueConfig.new + grpc_operation = GRPC::ActiveCall::Operation.new nil + grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + grpc_options = {} + + # Create request parameters for a unary method. + resource_value_config = {} + update_mask = {} + + update_resource_value_config_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :update_resource_value_config, name + assert_kind_of ::Google::Cloud::SecurityCenter::V2::UpdateResourceValueConfigRequest, request + assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::SecurityCenter::V2::ResourceValueConfig), request["resource_value_config"] + assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Protobuf::FieldMask), request["update_mask"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, update_resource_value_config_client_stub do + # Create client + client = ::Google::Cloud::SecurityCenter::V2::SecurityCenter::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.update_resource_value_config({ resource_value_config: resource_value_config, update_mask: update_mask }) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use named arguments + client.update_resource_value_config resource_value_config: resource_value_config, update_mask: update_mask do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.update_resource_value_config ::Google::Cloud::SecurityCenter::V2::UpdateResourceValueConfigRequest.new(resource_value_config: resource_value_config, update_mask: update_mask) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use hash object with options + client.update_resource_value_config({ resource_value_config: resource_value_config, update_mask: update_mask }, grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object with options + client.update_resource_value_config(::Google::Cloud::SecurityCenter::V2::UpdateResourceValueConfigRequest.new(resource_value_config: resource_value_config, update_mask: update_mask), grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Verify method calls + assert_equal 5, update_resource_value_config_client_stub.call_rpc_count + end + end + + def test_update_security_marks + # Create GRPC objects. + grpc_response = ::Google::Cloud::SecurityCenter::V2::SecurityMarks.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. + security_marks = {} + update_mask = {} + + update_security_marks_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :update_security_marks, name + assert_kind_of ::Google::Cloud::SecurityCenter::V2::UpdateSecurityMarksRequest, request + assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::SecurityCenter::V2::SecurityMarks), request["security_marks"] + assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Protobuf::FieldMask), request["update_mask"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, update_security_marks_client_stub do + # Create client + client = ::Google::Cloud::SecurityCenter::V2::SecurityCenter::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.update_security_marks({ security_marks: security_marks, update_mask: update_mask }) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use named arguments + client.update_security_marks security_marks: security_marks, update_mask: update_mask do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.update_security_marks ::Google::Cloud::SecurityCenter::V2::UpdateSecurityMarksRequest.new(security_marks: security_marks, update_mask: update_mask) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use hash object with options + client.update_security_marks({ security_marks: security_marks, update_mask: update_mask }, grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object with options + client.update_security_marks(::Google::Cloud::SecurityCenter::V2::UpdateSecurityMarksRequest.new(security_marks: security_marks, update_mask: update_mask), grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Verify method calls + assert_equal 5, update_security_marks_client_stub.call_rpc_count + end + end + + def test_update_source + # Create GRPC objects. + grpc_response = ::Google::Cloud::SecurityCenter::V2::Source.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. + source = {} + update_mask = {} + + update_source_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :update_source, name + assert_kind_of ::Google::Cloud::SecurityCenter::V2::UpdateSourceRequest, request + assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::SecurityCenter::V2::Source), request["source"] + assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Protobuf::FieldMask), request["update_mask"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, update_source_client_stub do + # Create client + client = ::Google::Cloud::SecurityCenter::V2::SecurityCenter::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.update_source({ source: source, update_mask: update_mask }) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use named arguments + client.update_source source: source, update_mask: update_mask do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.update_source ::Google::Cloud::SecurityCenter::V2::UpdateSourceRequest.new(source: source, update_mask: update_mask) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use hash object with options + client.update_source({ source: source, update_mask: update_mask }, grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object with options + client.update_source(::Google::Cloud::SecurityCenter::V2::UpdateSourceRequest.new(source: source, update_mask: update_mask), grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Verify method calls + assert_equal 5, update_source_client_stub.call_rpc_count + end + end + + def test_configure + grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + + client = block_config = config = nil + dummy_stub = ClientStub.new nil, nil + Gapic::ServiceStub.stub :new, dummy_stub do + client = ::Google::Cloud::SecurityCenter::V2::SecurityCenter::Client.new do |config| + config.credentials = grpc_channel + end + end + + config = client.configure do |c| + block_config = c + end + + assert_same block_config, config + assert_kind_of ::Google::Cloud::SecurityCenter::V2::SecurityCenter::Client::Configuration, config + end + + def test_credentials + key = OpenSSL::PKey::RSA.new 2048 + cred_json = { + "private_key" => key.to_pem, + "client_email" => "app@developer.gserviceaccount.com", + "type" => "service_account" + } + key_file = StringIO.new cred_json.to_json + creds = Google::Auth::ServiceAccountCredentials.make_creds({ json_key_io: key_file }) + + dummy_stub = ClientStub.new nil, nil + Gapic::ServiceStub.stub :new, dummy_stub do + client = ::Google::Cloud::SecurityCenter::V2::SecurityCenter::Client.new do |config| + config.credentials = creds + end + assert_kind_of ::Google::Cloud::SecurityCenter::V2::SecurityCenter::Client, client + assert_equal creds, client.configure.credentials + end + end + + def test_operations_client + grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + + client = nil + dummy_stub = ClientStub.new nil, nil + Gapic::ServiceStub.stub :new, dummy_stub do + client = ::Google::Cloud::SecurityCenter::V2::SecurityCenter::Client.new do |config| + config.credentials = grpc_channel + end + end + + assert_kind_of ::Google::Cloud::SecurityCenter::V2::SecurityCenter::Operations, client.operations_client + end +end diff --git a/owl-bot-staging/google-cloud-security_center-v2/test/helper.rb b/owl-bot-staging/google-cloud-security_center-v2/test/helper.rb new file mode 100644 index 000000000000..672b337030e7 --- /dev/null +++ b/owl-bot-staging/google-cloud-security_center-v2/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" diff --git a/owl-bot-staging/google-cloud-security_center_management-v1/.gitignore b/owl-bot-staging/google-cloud-security_center_management-v1/.gitignore new file mode 100644 index 000000000000..0135b6bc6cfc --- /dev/null +++ b/owl-bot-staging/google-cloud-security_center_management-v1/.gitignore @@ -0,0 +1,22 @@ +# Ignore bundler lockfiles +Gemfile.lock +gems.locked + +# Ignore documentation output +doc/* +.yardoc/* + +# Ignore test output +coverage/* + +# Ignore build artifacts +pkg/* + +# Ignore files commonly present in certain dev environments +.vagrant +.DS_STORE +.idea +*.iml + +# Ignore synth output +__pycache__ diff --git a/owl-bot-staging/google-cloud-security_center_management-v1/.repo-metadata.json b/owl-bot-staging/google-cloud-security_center_management-v1/.repo-metadata.json new file mode 100644 index 000000000000..1d992fcf1320 --- /dev/null +++ b/owl-bot-staging/google-cloud-security_center_management-v1/.repo-metadata.json @@ -0,0 +1,17 @@ +{ + "api_id": "securitycentermanagement.googleapis.com", + "api_shortname": "securitycentermanagement", + "client_documentation": "https://cloud.google.com/ruby/docs/reference/google-cloud-security_center_management-v1/latest", + "distribution_name": "google-cloud-security_center_management-v1", + "is_cloud": true, + "language": "ruby", + "name": "securitycentermanagement", + "name_pretty": "Security Command Center Management V1 API", + "product_documentation": "https://cloud.google.com/security-command-center/docs/reference/security-center-management/rest", + "release_level": "unreleased", + "repo": "googleapis/google-cloud-ruby", + "requires_billing": true, + "ruby-cloud-description": "Management API for Security Command Center, a built-in security and risk management solution for Google Cloud. Use this API to programmatically update the settings and configuration of Security Command Center. Note that google-cloud-security_center_management-v1 is a version-specific client library. For most uses, we recommend installing the main client library google-cloud-security_center_management instead. See the readme for more details.", + "ruby-cloud-product-url": "https://cloud.google.com/security-command-center/docs/reference/security-center-management/rest", + "library_type": "GAPIC_AUTO" +} diff --git a/owl-bot-staging/google-cloud-security_center_management-v1/.rubocop.yml b/owl-bot-staging/google-cloud-security_center_management-v1/.rubocop.yml new file mode 100644 index 000000000000..a9f2a1f499a0 --- /dev/null +++ b/owl-bot-staging/google-cloud-security_center_management-v1/.rubocop.yml @@ -0,0 +1,33 @@ +inherit_gem: + google-style: google-style.yml + +AllCops: + Exclude: + - "google-cloud-security_center_management-v1.gemspec" + - "lib/**/*_pb.rb" + - "proto_docs/**/*" + - "test/**/*" + - "acceptance/**/*" + - "samples/acceptance/**/*" + - "Rakefile" + +Layout/LineLength: + Enabled: false +Metrics/AbcSize: + Enabled: false +Metrics/ClassLength: + Enabled: false +Metrics/CyclomaticComplexity: + Enabled: false +Metrics/MethodLength: + Enabled: false +Metrics/ModuleLength: + Enabled: false +Metrics/PerceivedComplexity: + Enabled: false +Naming/AccessorMethodName: + Exclude: + - "snippets/**/*.rb" +Naming/FileName: + Exclude: + - "lib/google-cloud-security_center_management-v1.rb" diff --git a/owl-bot-staging/google-cloud-security_center_management-v1/.toys.rb b/owl-bot-staging/google-cloud-security_center_management-v1/.toys.rb new file mode 100644 index 000000000000..177e22456e8a --- /dev/null +++ b/owl-bot-staging/google-cloud-security_center_management-v1/.toys.rb @@ -0,0 +1,28 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +toys_version! ">= 0.15.3" + +if ENV["RUBY_COMMON_TOOLS"] + common_tools_dir = File.expand_path ENV["RUBY_COMMON_TOOLS"] + load File.join(common_tools_dir, "toys", "gapic") +else + load_git remote: "https://github.com/googleapis/ruby-common-tools.git", + path: "toys/gapic", + update: true +end diff --git a/owl-bot-staging/google-cloud-security_center_management-v1/.yardopts b/owl-bot-staging/google-cloud-security_center_management-v1/.yardopts new file mode 100644 index 000000000000..e42b7f692e9a --- /dev/null +++ b/owl-bot-staging/google-cloud-security_center_management-v1/.yardopts @@ -0,0 +1,12 @@ +--no-private +--title="Security Command Center Management V1 API" +--exclude _pb\.rb$ +--markup markdown +--markup-provider redcarpet + +./lib/**/*.rb +./proto_docs/**/*.rb +- +README.md +LICENSE.md +AUTHENTICATION.md diff --git a/owl-bot-staging/google-cloud-security_center_management-v1/AUTHENTICATION.md b/owl-bot-staging/google-cloud-security_center_management-v1/AUTHENTICATION.md new file mode 100644 index 000000000000..2e810e8e608e --- /dev/null +++ b/owl-bot-staging/google-cloud-security_center_management-v1/AUTHENTICATION.md @@ -0,0 +1,122 @@ +# Authentication + +The recommended way to authenticate to the google-cloud-security_center_management-v1 library is to use +[Application Default Credentials (ADC)](https://cloud.google.com/docs/authentication/application-default-credentials). +To review all of your authentication options, see [Credentials lookup](#credential-lookup). + +## Quickstart + +The following example shows how to set up authentication for a local development +environment with your user credentials. + +**NOTE:** This method is _not_ recommended for running in production. User credentials +should be used only during development. + +1. [Download and install the Google Cloud CLI](https://cloud.google.com/sdk). +2. Set up a local ADC file with your user credentials: + +```sh +gcloud auth application-default login +``` + +3. Write code as if already authenticated. + +For more information about setting up authentication for a local development environment, see +[Set up Application Default Credentials](https://cloud.google.com/docs/authentication/provide-credentials-adc#local-dev). + +## Credential Lookup + +The google-cloud-security_center_management-v1 library provides several mechanisms to configure your system. +Generally, using Application Default Credentials to facilitate automatic +credentials discovery is the easist method. But if you need to explicitly specify +credentials, there are several methods available to you. + +Credentials are accepted in the following ways, in the following order or precedence: + +1. Credentials specified in method arguments +2. Credentials specified in configuration +3. Credentials pointed to or included in environment variables +4. Credentials found in local ADC file +5. Credentials returned by the metadata server for the attached service account (GCP) + +### Configuration + +You can configure a path to a JSON credentials file, either for an individual client object or +globally, for all client objects. The JSON file can contain credentials created for +[workload identity federation](https://cloud.google.com/iam/docs/workload-identity-federation), +[workforce identity federation](https://cloud.google.com/iam/docs/workforce-identity-federation), or a +[service account key](https://cloud.google.com/docs/authentication/provide-credentials-adc#local-key). + +Note: Service account keys are a security risk if not managed correctly. You should +[choose a more secure alternative to service account keys](https://cloud.google.com/docs/authentication#auth-decision-tree) +whenever possible. + +To configure a credentials file for an individual client initialization: + +```ruby +require "google/cloud/security_center_management/v1" + +client = ::Google::Cloud::SecurityCenterManagement::V1::SecurityCenterManagement::Client.new do |config| + config.credentials = "path/to/credentialfile.json" +end +``` + +To configure a credentials file globally for all clients: + +```ruby +require "google/cloud/security_center_management/v1" + +::Google::Cloud::SecurityCenterManagement::V1::SecurityCenterManagement::Client.configure do |config| + config.credentials = "path/to/credentialfile.json" +end + +client = ::Google::Cloud::SecurityCenterManagement::V1::SecurityCenterManagement::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-security_center_management-v1 +checks for credentials are: + +* `GOOGLE_CLOUD_CREDENTIALS` - Path to JSON file, or JSON contents +* `GOOGLE_APPLICATION_CREDENTIALS` - Path to JSON file + +```ruby +require "google/cloud/security_center_management/v1" + +ENV["GOOGLE_APPLICATION_CREDENTIALS"] = "path/to/credentialfile.json" + +client = ::Google::Cloud::SecurityCenterManagement::V1::SecurityCenterManagement::Client.new +``` + +### Local ADC file + +You can set up a local ADC file with your user credentials for authentication during +development. If credentials are not provided in code or in environment variables, +then the local ADC credentials are discovered. + +Follow the steps in [Quickstart](#quickstart) to set up a local ADC file. + +### Google Cloud Platform environments + +When running on Google Cloud Platform (GCP), including Google Compute Engine +(GCE), Google Kubernetes Engine (GKE), Google App Engine (GAE), Google Cloud +Functions (GCF) and Cloud Run, credentials are retrieved from the attached +service account automatically. Code should be written as if already authenticated. + +For more information, see +[Set up ADC for Google Cloud services](https://cloud.google.com/docs/authentication/provide-credentials-adc#attached-sa). diff --git a/owl-bot-staging/google-cloud-security_center_management-v1/CHANGELOG.md b/owl-bot-staging/google-cloud-security_center_management-v1/CHANGELOG.md new file mode 100644 index 000000000000..f88957a62ba2 --- /dev/null +++ b/owl-bot-staging/google-cloud-security_center_management-v1/CHANGELOG.md @@ -0,0 +1,2 @@ +# Release History + diff --git a/owl-bot-staging/google-cloud-security_center_management-v1/Gemfile b/owl-bot-staging/google-cloud-security_center_management-v1/Gemfile new file mode 100644 index 000000000000..1d08558908d8 --- /dev/null +++ b/owl-bot-staging/google-cloud-security_center_management-v1/Gemfile @@ -0,0 +1,14 @@ +source "https://rubygems.org" + +gemspec + +gem "google-style", "~> 1.32.0" +gem "irb", "~> 1.17" +gem "minitest", "~> 6.0.2" +gem "minitest-focus", "~> 1.4" +gem "minitest-mock", "~> 5.27" +gem "minitest-rg", "~> 5.3" +gem "ostruct", "~> 0.5.5" +gem "rake", ">= 13.0" +gem "redcarpet", "~> 3.6" +gem "yard", "~> 0.9" diff --git a/owl-bot-staging/google-cloud-security_center_management-v1/LICENSE.md b/owl-bot-staging/google-cloud-security_center_management-v1/LICENSE.md new file mode 100644 index 000000000000..c261857ba6ad --- /dev/null +++ b/owl-bot-staging/google-cloud-security_center_management-v1/LICENSE.md @@ -0,0 +1,201 @@ + Apache License + Version 2.0, January 2004 + http://www.apache.org/licenses/ + + TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION + + 1. Definitions. + + "License" shall mean the terms and conditions for use, reproduction, + and distribution as defined by Sections 1 through 9 of this document. + + "Licensor" shall mean the copyright owner or entity authorized by + the copyright owner that is granting the License. + + "Legal Entity" shall mean the union of the acting entity and all + other entities that control, are controlled by, or are under common + control with that entity. For the purposes of this definition, + "control" means (i) the power, direct or indirect, to cause the + direction or management of such entity, whether by contract or + otherwise, or (ii) ownership of fifty percent (50%) or more of the + outstanding shares, or (iii) beneficial ownership of such entity. + + "You" (or "Your") shall mean an individual or Legal Entity + exercising permissions granted by this License. + + "Source" form shall mean the preferred form for making modifications, + including but not limited to software source code, documentation + source, and configuration files. + + "Object" form shall mean any form resulting from mechanical + transformation or translation of a Source form, including but + not limited to compiled object code, generated documentation, + and conversions to other media types. + + "Work" shall mean the work of authorship, whether in Source or + Object form, made available under the License, as indicated by a + copyright notice that is included in or attached to the work + (an example is provided in the Appendix below). + + "Derivative Works" shall mean any work, whether in Source or Object + form, that is based on (or derived from) the Work and for which the + editorial revisions, annotations, elaborations, or other modifications + represent, as a whole, an original work of authorship. For the purposes + of this License, Derivative Works shall not include works that remain + separable from, or merely link (or bind by name) to the interfaces of, + the Work and Derivative Works thereof. + + "Contribution" shall mean any work of authorship, including + the original version of the Work and any modifications or additions + to that Work or Derivative Works thereof, that is intentionally + submitted to Licensor for inclusion in the Work by the copyright owner + or by an individual or Legal Entity authorized to submit on behalf of + the copyright owner. For the purposes of this definition, "submitted" + means any form of electronic, verbal, or written communication sent + to the Licensor or its representatives, including but not limited to + communication on electronic mailing lists, source code control systems, + and issue tracking systems that are managed by, or on behalf of, the + Licensor for the purpose of discussing and improving the Work, but + excluding communication that is conspicuously marked or otherwise + designated in writing by the copyright owner as "Not a Contribution." + + "Contributor" shall mean Licensor and any individual or Legal Entity + on behalf of whom a Contribution has been received by Licensor and + subsequently incorporated within the Work. + + 2. Grant of Copyright License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + copyright license to reproduce, prepare Derivative Works of, + publicly display, publicly perform, sublicense, and distribute the + Work and such Derivative Works in Source or Object form. + + 3. Grant of Patent License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + (except as stated in this section) patent license to make, have made, + use, offer to sell, sell, import, and otherwise transfer the Work, + where such license applies only to those patent claims licensable + by such Contributor that are necessarily infringed by their + Contribution(s) alone or by combination of their Contribution(s) + with the Work to which such Contribution(s) was submitted. If You + institute patent litigation against any entity (including a + cross-claim or counterclaim in a lawsuit) alleging that the Work + or a Contribution incorporated within the Work constitutes direct + or contributory patent infringement, then any patent licenses + granted to You under this License for that Work shall terminate + as of the date such litigation is filed. + + 4. Redistribution. You may reproduce and distribute copies of the + Work or Derivative Works thereof in any medium, with or without + modifications, and in Source or Object form, provided that You + meet the following conditions: + + (a) You must give any other recipients of the Work or + Derivative Works a copy of this License; and + + (b) You must cause any modified files to carry prominent notices + stating that You changed the files; and + + (c) You must retain, in the Source form of any Derivative Works + that You distribute, all copyright, patent, trademark, and + attribution notices from the Source form of the Work, + excluding those notices that do not pertain to any part of + the Derivative Works; and + + (d) If the Work includes a "NOTICE" text file as part of its + distribution, then any Derivative Works that You distribute must + include a readable copy of the attribution notices contained + within such NOTICE file, excluding those notices that do not + pertain to any part of the Derivative Works, in at least one + of the following places: within a NOTICE text file distributed + as part of the Derivative Works; within the Source form or + documentation, if provided along with the Derivative Works; or, + within a display generated by the Derivative Works, if and + wherever such third-party notices normally appear. The contents + of the NOTICE file are for informational purposes only and + do not modify the License. You may add Your own attribution + notices within Derivative Works that You distribute, alongside + or as an addendum to the NOTICE text from the Work, provided + that such additional attribution notices cannot be construed + as modifying the License. + + You may add Your own copyright statement to Your modifications and + may provide additional or different license terms and conditions + for use, reproduction, or distribution of Your modifications, or + for any such Derivative Works as a whole, provided Your use, + reproduction, and distribution of the Work otherwise complies with + the conditions stated in this License. + + 5. Submission of Contributions. Unless You explicitly state otherwise, + any Contribution intentionally submitted for inclusion in the Work + by You to the Licensor shall be under the terms and conditions of + this License, without any additional terms or conditions. + Notwithstanding the above, nothing herein shall supersede or modify + the terms of any separate license agreement you may have executed + with Licensor regarding such Contributions. + + 6. Trademarks. This License does not grant permission to use the trade + names, trademarks, service marks, or product names of the Licensor, + except as required for reasonable and customary use in describing the + origin of the Work and reproducing the content of the NOTICE file. + + 7. Disclaimer of Warranty. Unless required by applicable law or + agreed to in writing, Licensor provides the Work (and each + Contributor provides its Contributions) on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or + implied, including, without limitation, any warranties or conditions + of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A + PARTICULAR PURPOSE. You are solely responsible for determining the + appropriateness of using or redistributing the Work and assume any + risks associated with Your exercise of permissions under this License. + + 8. Limitation of Liability. In no event and under no legal theory, + whether in tort (including negligence), contract, or otherwise, + unless required by applicable law (such as deliberate and grossly + negligent acts) or agreed to in writing, shall any Contributor be + liable to You for damages, including any direct, indirect, special, + incidental, or consequential damages of any character arising as a + result of this License or out of the use or inability to use the + Work (including but not limited to damages for loss of goodwill, + work stoppage, computer failure or malfunction, or any and all + other commercial damages or losses), even if such Contributor + has been advised of the possibility of such damages. + + 9. Accepting Warranty or Additional Liability. While redistributing + the Work or Derivative Works thereof, You may choose to offer, + and charge a fee for, acceptance of support, warranty, indemnity, + or other liability obligations and/or rights consistent with this + License. However, in accepting such obligations, You may act only + on Your own behalf and on Your sole responsibility, not on behalf + of any other Contributor, and only if You agree to indemnify, + defend, and hold each Contributor harmless for any liability + incurred by, or claims asserted against, such Contributor by reason + of your accepting any such warranty or additional liability. + + END OF TERMS AND CONDITIONS + + APPENDIX: How to apply the Apache License to your work. + + To apply the Apache License to your work, attach the following + boilerplate notice, with the fields enclosed by brackets "[]" + replaced with your own identifying information. (Don't include + the brackets!) The text should be enclosed in the appropriate + comment syntax for the file format. We also recommend that a + file or class name and description of purpose be included on the + same "printed page" as the copyright notice for easier + identification within third-party archives. + + Copyright [yyyy] [name of copyright owner] + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. diff --git a/owl-bot-staging/google-cloud-security_center_management-v1/README.md b/owl-bot-staging/google-cloud-security_center_management-v1/README.md new file mode 100644 index 000000000000..521869e5f030 --- /dev/null +++ b/owl-bot-staging/google-cloud-security_center_management-v1/README.md @@ -0,0 +1,154 @@ +# Ruby Client for the Security Command Center Management V1 API + +Management API for Security Command Center, a built-in security and risk management solution for Google Cloud. Use this API to programmatically update the settings and configuration of Security Command Center. + +Management API for Security Command Center, a built-in security and risk management solution for Google Cloud. Use this API to programmatically update the settings and configuration of Security Command Center. + +https://github.com/googleapis/google-cloud-ruby + +This gem is a _versioned_ client. It provides basic client classes for a +specific version of the Security Command Center Management V1 API. Most users should consider using +the main client gem, +[google-cloud-security_center_management](https://rubygems.org/gems/google-cloud-security_center_management). +See the section below titled *Which client should I use?* for more information. + +## Installation + +``` +$ gem install google-cloud-security_center_management-v1 +``` + +## Before You Begin + +In order to use this library, you first need to go through the following steps: + +1. [Select or create a Cloud Platform project.](https://console.cloud.google.com/project) +1. [Enable billing for your project.](https://cloud.google.com/billing/docs/how-to/modify-project#enable_billing_for_a_project) +1. [Enable the API.](https://console.cloud.google.com/apis/library/securitycentermanagement.googleapis.com) +1. [Set up authentication.](AUTHENTICATION.md) + +## Quick Start + +```ruby +require "google/cloud/security_center_management/v1" + +client = ::Google::Cloud::SecurityCenterManagement::V1::SecurityCenterManagement::Client.new +request = ::Google::Cloud::SecurityCenterManagement::V1::ListEffectiveSecurityHealthAnalyticsCustomModulesRequest.new # (request fields as keyword arguments...) +response = client.list_effective_security_health_analytics_custom_modules request +``` + +View the [Client Library Documentation](https://cloud.google.com/ruby/docs/reference/google-cloud-security_center_management-v1/latest) +for class and method documentation. + +See also the [Product Documentation](https://cloud.google.com/security-command-center/docs/reference/security-center-management/rest) +for general usage information. + +## Debug Logging + +This library comes with opt-in Debug Logging that can help you troubleshoot +your application's integration with the API. When logging is activated, key +events such as requests and responses, along with data payloads and metadata +such as headers and client configuration, are logged to the standard error +stream. + +**WARNING:** Client Library Debug Logging includes your data payloads in +plaintext, which could include sensitive data such as PII for yourself or your +customers, private keys, or other security data that could be compromising if +leaked. Always practice good data hygiene with your application logs, and follow +the principle of least access. Google also recommends that Client Library Debug +Logging be enabled only temporarily during active debugging, and not used +permanently in production. + +To enable logging, set the environment variable `GOOGLE_SDK_RUBY_LOGGING_GEMS` +to the value `all`. Alternatively, you can set the value to a comma-delimited +list of client library gem names. This will select the default logging behavior, +which writes logs to the standard error stream. On a local workstation, this may +result in logs appearing on the console. When running on a Google Cloud hosting +service such as [Google Cloud Run](https://cloud.google.com/run), this generally +results in logs appearing alongside your application logs in the +[Google Cloud Logging](https://cloud.google.com/logging/) service. + +You can customize logging by modifying the `logger` configuration when +constructing a client object. For example: + +```ruby +require "google/cloud/security_center_management/v1" +require "logger" + +client = ::Google::Cloud::SecurityCenterManagement::V1::SecurityCenterManagement::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-security_center_management`, +and lower-level _versioned_ client libraries with names such as +`google-cloud-security_center_management-v1`. +_In most cases, you should install the main client._ + +### What's the difference between the main client and a versioned client? + +A _versioned client_ provides a basic set of data types and client classes for +a _single version_ of a specific service. (That is, for a service with multiple +versions, there might be a separate versioned client for each service version.) +Most versioned clients are written and maintained by a code generator. + +The _main client_ is designed to provide you with the _recommended_ client +interfaces for the service. There will be only one main client for any given +service, even a service with multiple versions. The main client includes +factory methods for constructing the client objects we recommend for most +users. In some cases, those will be classes provided by an underlying versioned +client; in other cases, they will be handwritten higher-level client objects +with additional capabilities, convenience methods, or best practices built in. +Generally, the main client will default to a recommended service version, +although in some cases you can override this if you need to talk to a specific +service version. + +### Why would I want to use the main client? + +We recommend that most users install the main client gem for a service. You can +identify this gem as the one _without_ a version in its name, e.g. +`google-cloud-security_center_management`. +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-security_center_management-v1`. + +### What about the google-apis- clients? + +Client library gems with names that begin with `google-apis-` are based on an +older code generation technology. They talk to a REST/JSON backend (whereas +most modern clients talk to a [gRPC](https://grpc.io/) backend) and they may +not offer the same performance, features, and ease of use provided by more +modern clients. + +The `google-apis-` clients have wide coverage across Google services, so you +might need to use one if there is no modern client available for the service. +However, if a modern client is available, we generally recommend it over the +older `google-apis-` clients. diff --git a/owl-bot-staging/google-cloud-security_center_management-v1/Rakefile b/owl-bot-staging/google-cloud-security_center_management-v1/Rakefile new file mode 100644 index 000000000000..48a25ec27530 --- /dev/null +++ b/owl-bot-staging/google-cloud-security_center_management-v1/Rakefile @@ -0,0 +1,169 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +require "bundler/setup" +require "bundler/gem_tasks" + +require "rubocop/rake_task" +RuboCop::RakeTask.new + +require "rake/testtask" +desc "Run tests." +Rake::TestTask.new do |t| + t.libs << "test" + t.test_files = FileList["test/**/*_test.rb"] + t.warning = false +end + +desc "Runs the smoke tests." +Rake::TestTask.new :smoke_test do |t| + t.test_files = FileList["acceptance/**/*smoke_test.rb"] + t.warning = false +end + +# Acceptance tests +desc "Run the google-cloud-security_center_management-v1 acceptance tests." +task :acceptance, :project, :keyfile do |t, args| + project = args[:project] + project ||= + ENV["GOOGLE_CLOUD_TEST_PROJECT"] || + ENV["GCLOUD_TEST_PROJECT"] + keyfile = args[:keyfile] + keyfile ||= + ENV["GOOGLE_CLOUD_TEST_KEYFILE"] || + ENV["GCLOUD_TEST_KEYFILE"] + if keyfile + keyfile = File.read keyfile + else + keyfile ||= + ENV["GOOGLE_CLOUD_TEST_KEYFILE_JSON"] || + ENV["GCLOUD_TEST_KEYFILE_JSON"] + end + if project.nil? || keyfile.nil? + fail "You must provide a project and keyfile. e.g. rake acceptance[test123, /path/to/keyfile.json] or GOOGLE_CLOUD_TEST_PROJECT=test123 GOOGLE_CLOUD_TEST_KEYFILE=/path/to/keyfile.json rake acceptance" + end + require "google/cloud/security_center_management/v1/security_center_management/credentials" + ::Google::Cloud::SecurityCenterManagement::V1::SecurityCenterManagement::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-security_center_management-v1 gem has no acceptance tests." + end + end + + desc "Run acceptance cleanup." + task :cleanup do + end +end + +task :samples do + Rake::Task["samples:latest"].invoke +end + +namespace :samples do + task :latest do + if File.directory? "samples" + Dir.chdir "samples" do + Bundler.with_clean_env do + ENV["GOOGLE_CLOUD_SAMPLES_TEST"] = "not_master" + sh "bundle update" + sh "bundle exec rake test" + end + end + else + puts "The google-cloud-security_center_management-v1 gem has no samples to test." + end + end + + task :master do + if File.directory? "samples" + Dir.chdir "samples" do + Bundler.with_clean_env do + ENV["GOOGLE_CLOUD_SAMPLES_TEST"] = "master" + sh "bundle update" + sh "bundle exec rake test" + end + end + else + puts "The google-cloud-security_center_management-v1 gem has no samples to test." + end + end +end + +require "yard" +require "yard/rake/yardoc_task" +YARD::Rake::YardocTask.new do |y| + y.options << "--fail-on-warning" +end + +desc "Run yard-doctest example tests." +task :doctest do + puts "The google-cloud-security_center_management-v1 gem does not have doctest tests." +end + +desc "Run the CI build" +task :ci do + header "BUILDING google-cloud-security_center_management-v1" + header "google-cloud-security_center_management-v1 rubocop", "*" + Rake::Task[:rubocop].invoke + header "google-cloud-security_center_management-v1 yard", "*" + Rake::Task[:yard].invoke + header "google-cloud-security_center_management-v1 test", "*" + Rake::Task[:test].invoke +end + +namespace :ci do + desc "Run the CI build, with smoke tests." + task :smoke_test do + Rake::Task[:ci].invoke + header "google-cloud-security_center_management-v1 smoke_test", "*" + Rake::Task[:smoke_test].invoke + end + desc "Run the CI build, with acceptance tests." + task :acceptance do + Rake::Task[:ci].invoke + header "google-cloud-security_center_management-v1 acceptance", "*" + Rake::Task[:acceptance].invoke + end + task :a do + # This is a handy shortcut to save typing + Rake::Task["ci:acceptance"].invoke + end +end + +task default: :test + +def header str, token = "#" + line_length = str.length + 8 + puts "" + puts token * line_length + puts "#{token * 3} #{str} #{token * 3}" + puts token * line_length + puts "" +end diff --git a/owl-bot-staging/google-cloud-security_center_management-v1/gapic_metadata.json b/owl-bot-staging/google-cloud-security_center_management-v1/gapic_metadata.json new file mode 100644 index 000000000000..a1ebc19f46fd --- /dev/null +++ b/owl-bot-staging/google-cloud-security_center_management-v1/gapic_metadata.json @@ -0,0 +1,123 @@ +{ + "schema": "1.0", + "comment": "This file maps proto services/RPCs to the corresponding library clients/methods", + "language": "ruby", + "protoPackage": "google.cloud.securitycentermanagement.v1", + "libraryPackage": "::Google::Cloud::SecurityCenterManagement::V1", + "services": { + "SecurityCenterManagement": { + "clients": { + "grpc": { + "libraryClient": "::Google::Cloud::SecurityCenterManagement::V1::SecurityCenterManagement::Client", + "rpcs": { + "ListEffectiveSecurityHealthAnalyticsCustomModules": { + "methods": [ + "list_effective_security_health_analytics_custom_modules" + ] + }, + "GetEffectiveSecurityHealthAnalyticsCustomModule": { + "methods": [ + "get_effective_security_health_analytics_custom_module" + ] + }, + "ListSecurityHealthAnalyticsCustomModules": { + "methods": [ + "list_security_health_analytics_custom_modules" + ] + }, + "ListDescendantSecurityHealthAnalyticsCustomModules": { + "methods": [ + "list_descendant_security_health_analytics_custom_modules" + ] + }, + "GetSecurityHealthAnalyticsCustomModule": { + "methods": [ + "get_security_health_analytics_custom_module" + ] + }, + "CreateSecurityHealthAnalyticsCustomModule": { + "methods": [ + "create_security_health_analytics_custom_module" + ] + }, + "UpdateSecurityHealthAnalyticsCustomModule": { + "methods": [ + "update_security_health_analytics_custom_module" + ] + }, + "DeleteSecurityHealthAnalyticsCustomModule": { + "methods": [ + "delete_security_health_analytics_custom_module" + ] + }, + "SimulateSecurityHealthAnalyticsCustomModule": { + "methods": [ + "simulate_security_health_analytics_custom_module" + ] + }, + "ListEffectiveEventThreatDetectionCustomModules": { + "methods": [ + "list_effective_event_threat_detection_custom_modules" + ] + }, + "GetEffectiveEventThreatDetectionCustomModule": { + "methods": [ + "get_effective_event_threat_detection_custom_module" + ] + }, + "ListEventThreatDetectionCustomModules": { + "methods": [ + "list_event_threat_detection_custom_modules" + ] + }, + "ListDescendantEventThreatDetectionCustomModules": { + "methods": [ + "list_descendant_event_threat_detection_custom_modules" + ] + }, + "GetEventThreatDetectionCustomModule": { + "methods": [ + "get_event_threat_detection_custom_module" + ] + }, + "CreateEventThreatDetectionCustomModule": { + "methods": [ + "create_event_threat_detection_custom_module" + ] + }, + "UpdateEventThreatDetectionCustomModule": { + "methods": [ + "update_event_threat_detection_custom_module" + ] + }, + "DeleteEventThreatDetectionCustomModule": { + "methods": [ + "delete_event_threat_detection_custom_module" + ] + }, + "ValidateEventThreatDetectionCustomModule": { + "methods": [ + "validate_event_threat_detection_custom_module" + ] + }, + "GetSecurityCenterService": { + "methods": [ + "get_security_center_service" + ] + }, + "ListSecurityCenterServices": { + "methods": [ + "list_security_center_services" + ] + }, + "UpdateSecurityCenterService": { + "methods": [ + "update_security_center_service" + ] + } + } + } + } + } + } +} diff --git a/owl-bot-staging/google-cloud-security_center_management-v1/google-cloud-security_center_management-v1.gemspec b/owl-bot-staging/google-cloud-security_center_management-v1/google-cloud-security_center_management-v1.gemspec new file mode 100644 index 000000000000..3ce9ab398fcd --- /dev/null +++ b/owl-bot-staging/google-cloud-security_center_management-v1/google-cloud-security_center_management-v1.gemspec @@ -0,0 +1,30 @@ +# -*- ruby -*- +# encoding: utf-8 + +require File.expand_path("lib/google/cloud/security_center_management/v1/version", __dir__) + +Gem::Specification.new do |gem| + gem.name = "google-cloud-security_center_management-v1" + gem.version = Google::Cloud::SecurityCenterManagement::V1::VERSION + + gem.authors = ["Google LLC"] + gem.email = "googleapis-packages@google.com" + gem.description = "Management API for Security Command Center, a built-in security and risk management solution for Google Cloud. Use this API to programmatically update the settings and configuration of Security Command Center. Note that google-cloud-security_center_management-v1 is a version-specific client library. For most uses, we recommend installing the main client library google-cloud-security_center_management instead. See the readme for more details." + gem.summary = "Management API for Security Command Center, a built-in security and risk management solution for Google Cloud. Use this API to programmatically update the settings and configuration of Security Command Center." + 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" + gem.add_dependency "grpc-google-iam-v1", "~> 1.11" +end diff --git a/owl-bot-staging/google-cloud-security_center_management-v1/lib/google-cloud-security_center_management-v1.rb b/owl-bot-staging/google-cloud-security_center_management-v1/lib/google-cloud-security_center_management-v1.rb new file mode 100644 index 000000000000..64c9d0aec5c2 --- /dev/null +++ b/owl-bot-staging/google-cloud-security_center_management-v1/lib/google-cloud-security_center_management-v1.rb @@ -0,0 +1,21 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +# This gem does not autoload during Bundler.require. To load this gem, +# issue explicit require statements for the packages desired, e.g.: +# require "google/cloud/security_center_management/v1" diff --git a/owl-bot-staging/google-cloud-security_center_management-v1/lib/google/cloud/security_center_management/v1.rb b/owl-bot-staging/google-cloud-security_center_management-v1/lib/google/cloud/security_center_management/v1.rb new file mode 100644 index 000000000000..a6774f1f6c46 --- /dev/null +++ b/owl-bot-staging/google-cloud-security_center_management-v1/lib/google/cloud/security_center_management/v1.rb @@ -0,0 +1,45 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +require "google/cloud/security_center_management/v1/security_center_management" +require "google/cloud/security_center_management/v1/version" + +module Google + module Cloud + module SecurityCenterManagement + ## + # API client module. + # + # @example Load this package, including all its services, and instantiate a gRPC client + # + # require "google/cloud/security_center_management/v1" + # client = ::Google::Cloud::SecurityCenterManagement::V1::SecurityCenterManagement::Client.new + # + # @example Load this package, including all its services, and instantiate a REST client + # + # require "google/cloud/security_center_management/v1" + # client = ::Google::Cloud::SecurityCenterManagement::V1::SecurityCenterManagement::Rest::Client.new + # + module V1 + end + end + end +end + +helper_path = ::File.join __dir__, "v1", "_helpers.rb" +require "google/cloud/security_center_management/v1/_helpers" if ::File.file? helper_path diff --git a/owl-bot-staging/google-cloud-security_center_management-v1/lib/google/cloud/security_center_management/v1/bindings_override.rb b/owl-bot-staging/google-cloud-security_center_management-v1/lib/google/cloud/security_center_management/v1/bindings_override.rb new file mode 100644 index 000000000000..a6a097cc314f --- /dev/null +++ b/owl-bot-staging/google-cloud-security_center_management-v1/lib/google/cloud/security_center_management/v1/bindings_override.rb @@ -0,0 +1,75 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +require "gapic/rest" + +module Google + module Cloud + module SecurityCenterManagement + ## + # @example Loading just the REST part of this package, including all its services, and instantiating a REST client + # + # require "google/cloud/security_center_management/v1/rest" + # client = ::Google::Cloud::SecurityCenterManagement::V1::SecurityCenterManagement::Rest::Client.new + # + module V1 + ## + # @private + # Initialize the mixin bindings configuration + # + def self.configure + @configure ||= begin + namespace = ["Google", "Cloud", "SecurityCenterManagement"] + parent_config = while namespace.any? + parent_name = namespace.join "::" + parent_const = const_get parent_name + break parent_const.configure if parent_const.respond_to? :configure + namespace.pop + end + + default_config = ::Gapic::Rest::HttpBindingOverrideConfiguration.new parent_config + default_config.bindings_override["google.cloud.location.Locations.GetLocation"] = [ + Gapic::Rest::GrpcTranscoder::HttpBinding.create_with_validation( + uri_method: :get, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/?$}, false] + ], + body: nil + ) + ] + default_config.bindings_override["google.cloud.location.Locations.ListLocations"] = [ + + Gapic::Rest::GrpcTranscoder::HttpBinding.create_with_validation( + uri_method: :get, + uri_template: "/v1/{name}/locations", + matches: [ + ["name", %r{^projects/[^/]+/?$}, false] + ], + body: nil + ) + ] + default_config + end + yield @configure if block_given? + @configure + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-security_center_management-v1/lib/google/cloud/security_center_management/v1/rest.rb b/owl-bot-staging/google-cloud-security_center_management-v1/lib/google/cloud/security_center_management/v1/rest.rb new file mode 100644 index 000000000000..26d917a7bf92 --- /dev/null +++ b/owl-bot-staging/google-cloud-security_center_management-v1/lib/google/cloud/security_center_management/v1/rest.rb @@ -0,0 +1,38 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +require "google/cloud/security_center_management/v1/security_center_management/rest" +require "google/cloud/security_center_management/v1/bindings_override" +require "google/cloud/security_center_management/v1/version" + +module Google + module Cloud + module SecurityCenterManagement + ## + # To load just the REST part of this package, including all its services, and instantiate a REST client: + # + # @example + # + # require "google/cloud/security_center_management/v1/rest" + # client = ::Google::Cloud::SecurityCenterManagement::V1::SecurityCenterManagement::Rest::Client.new + # + module V1 + end + end + end +end diff --git a/owl-bot-staging/google-cloud-security_center_management-v1/lib/google/cloud/security_center_management/v1/security_center_management.rb b/owl-bot-staging/google-cloud-security_center_management-v1/lib/google/cloud/security_center_management/v1/security_center_management.rb new file mode 100644 index 000000000000..f906e0bc11fd --- /dev/null +++ b/owl-bot-staging/google-cloud-security_center_management-v1/lib/google/cloud/security_center_management/v1/security_center_management.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/security_center_management/v1/version" + +require "google/cloud/security_center_management/v1/security_center_management/credentials" +require "google/cloud/security_center_management/v1/security_center_management/paths" +require "google/cloud/security_center_management/v1/security_center_management/client" +require "google/cloud/security_center_management/v1/security_center_management/rest" + +module Google + module Cloud + module SecurityCenterManagement + module V1 + ## + # Service describing handlers for resources + # + # @example Load this service and instantiate a gRPC client + # + # require "google/cloud/security_center_management/v1/security_center_management" + # client = ::Google::Cloud::SecurityCenterManagement::V1::SecurityCenterManagement::Client.new + # + # @example Load this service and instantiate a REST client + # + # require "google/cloud/security_center_management/v1/security_center_management/rest" + # client = ::Google::Cloud::SecurityCenterManagement::V1::SecurityCenterManagement::Rest::Client.new + # + module SecurityCenterManagement + end + end + end + end +end + +helper_path = ::File.join __dir__, "security_center_management", "helpers.rb" +require "google/cloud/security_center_management/v1/security_center_management/helpers" if ::File.file? helper_path diff --git a/owl-bot-staging/google-cloud-security_center_management-v1/lib/google/cloud/security_center_management/v1/security_center_management/client.rb b/owl-bot-staging/google-cloud-security_center_management-v1/lib/google/cloud/security_center_management/v1/security_center_management/client.rb new file mode 100644 index 000000000000..99a43500f3e0 --- /dev/null +++ b/owl-bot-staging/google-cloud-security_center_management-v1/lib/google/cloud/security_center_management/v1/security_center_management/client.rb @@ -0,0 +1,2790 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +require "google/cloud/errors" +require "google/cloud/securitycentermanagement/v1/security_center_management_pb" +require "google/cloud/location" + +module Google + module Cloud + module SecurityCenterManagement + module V1 + module SecurityCenterManagement + ## + # Client for the SecurityCenterManagement service. + # + # Service describing handlers for resources + # + class Client + # @private + API_VERSION = "" + + # @private + DEFAULT_ENDPOINT_TEMPLATE = "securitycentermanagement.$UNIVERSE_DOMAIN$" + + include Paths + + # @private + attr_reader :security_center_management_stub + + ## + # Configure the SecurityCenterManagement Client class. + # + # See {::Google::Cloud::SecurityCenterManagement::V1::SecurityCenterManagement::Client::Configuration} + # for a description of the configuration fields. + # + # @example + # + # # Modify the configuration for all SecurityCenterManagement clients + # ::Google::Cloud::SecurityCenterManagement::V1::SecurityCenterManagement::Client.configure do |config| + # config.timeout = 10.0 + # end + # + # @yield [config] Configure the Client client. + # @yieldparam config [Client::Configuration] + # + # @return [Client::Configuration] + # + def self.configure + @configure ||= begin + namespace = ["Google", "Cloud", "SecurityCenterManagement", "V1"] + parent_config = while namespace.any? + parent_name = namespace.join "::" + parent_const = const_get parent_name + break parent_const.configure if parent_const.respond_to? :configure + namespace.pop + end + default_config = Client::Configuration.new parent_config + + default_config.rpcs.list_effective_security_health_analytics_custom_modules.timeout = 60.0 + default_config.rpcs.list_effective_security_health_analytics_custom_modules.retry_policy = { + initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [14, 4] + } + + default_config.rpcs.get_effective_security_health_analytics_custom_module.timeout = 60.0 + default_config.rpcs.get_effective_security_health_analytics_custom_module.retry_policy = { + initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [14, 4] + } + + default_config.rpcs.list_security_health_analytics_custom_modules.timeout = 60.0 + default_config.rpcs.list_security_health_analytics_custom_modules.retry_policy = { + initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [14, 4] + } + + default_config.rpcs.list_descendant_security_health_analytics_custom_modules.timeout = 60.0 + default_config.rpcs.list_descendant_security_health_analytics_custom_modules.retry_policy = { + initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [14, 4] + } + + default_config.rpcs.get_security_health_analytics_custom_module.timeout = 60.0 + default_config.rpcs.get_security_health_analytics_custom_module.retry_policy = { + initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [14, 4] + } + + default_config.rpcs.create_security_health_analytics_custom_module.timeout = 60.0 + + default_config.rpcs.update_security_health_analytics_custom_module.timeout = 60.0 + + default_config.rpcs.delete_security_health_analytics_custom_module.timeout = 60.0 + + default_config.rpcs.simulate_security_health_analytics_custom_module.timeout = 60.0 + default_config.rpcs.simulate_security_health_analytics_custom_module.retry_policy = { + initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [14, 4] + } + + default_config.rpcs.list_effective_event_threat_detection_custom_modules.timeout = 60.0 + default_config.rpcs.list_effective_event_threat_detection_custom_modules.retry_policy = { + initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [14, 4] + } + + default_config.rpcs.get_effective_event_threat_detection_custom_module.timeout = 60.0 + default_config.rpcs.get_effective_event_threat_detection_custom_module.retry_policy = { + initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [14, 4] + } + + default_config.rpcs.list_event_threat_detection_custom_modules.timeout = 60.0 + default_config.rpcs.list_event_threat_detection_custom_modules.retry_policy = { + initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [14, 4] + } + + default_config.rpcs.list_descendant_event_threat_detection_custom_modules.timeout = 60.0 + default_config.rpcs.list_descendant_event_threat_detection_custom_modules.retry_policy = { + initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [14, 4] + } + + default_config.rpcs.get_event_threat_detection_custom_module.timeout = 60.0 + default_config.rpcs.get_event_threat_detection_custom_module.retry_policy = { + initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [14, 4] + } + + default_config.rpcs.create_event_threat_detection_custom_module.timeout = 60.0 + + default_config.rpcs.update_event_threat_detection_custom_module.timeout = 60.0 + + default_config.rpcs.delete_event_threat_detection_custom_module.timeout = 60.0 + + default_config.rpcs.validate_event_threat_detection_custom_module.timeout = 60.0 + default_config.rpcs.validate_event_threat_detection_custom_module.retry_policy = { + initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [14, 4] + } + + default_config + end + yield @configure if block_given? + @configure + end + + ## + # Configure the SecurityCenterManagement Client instance. + # + # The configuration is set to the derived mode, meaning that values can be changed, + # but structural changes (adding new fields, etc.) are not allowed. Structural changes + # should be made on {Client.configure}. + # + # See {::Google::Cloud::SecurityCenterManagement::V1::SecurityCenterManagement::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 + @security_center_management_stub.universe_domain + end + + ## + # Create a new SecurityCenterManagement client object. + # + # @example + # + # # Create a client using the default configuration + # client = ::Google::Cloud::SecurityCenterManagement::V1::SecurityCenterManagement::Client.new + # + # # Create a client using a custom configuration + # client = ::Google::Cloud::SecurityCenterManagement::V1::SecurityCenterManagement::Client.new do |config| + # config.timeout = 10.0 + # end + # + # @yield [config] Configure the SecurityCenterManagement client. + # @yieldparam config [Client::Configuration] + # + def initialize + # These require statements are intentionally placed here to initialize + # the gRPC module only when it's required. + # See https://github.com/googleapis/toolkit/issues/446 + require "gapic/grpc" + require "google/cloud/securitycentermanagement/v1/security_center_management_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 + + @security_center_management_stub = ::Gapic::ServiceStub.new( + ::Google::Cloud::SecurityCenterManagement::V1::SecurityCenterManagement::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 + ) + + @security_center_management_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 = @security_center_management_stub.endpoint + config.universe_domain = @security_center_management_stub.universe_domain + config.logger = @security_center_management_stub.logger if config.respond_to? :logger= + end + end + + ## + # Get the associated client for mix-in of the Locations. + # + # @return [Google::Cloud::Location::Locations::Client] + # + attr_reader :location_client + + ## + # The logger used for request/response debug logging. + # + # @return [Logger] + # + def logger + @security_center_management_stub.logger + end + + # Service calls + + ## + # Returns a list of all + # {::Google::Cloud::SecurityCenterManagement::V1::EffectiveSecurityHealthAnalyticsCustomModule EffectiveSecurityHealthAnalyticsCustomModule} + # resources for the given parent. This includes resident modules defined at + # the scope of the parent, and inherited modules, inherited from ancestor + # organizations, folders, and projects (no descendants). + # + # @overload list_effective_security_health_analytics_custom_modules(request, options = nil) + # Pass arguments to `list_effective_security_health_analytics_custom_modules` via a request object, either of type + # {::Google::Cloud::SecurityCenterManagement::V1::ListEffectiveSecurityHealthAnalyticsCustomModulesRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::SecurityCenterManagement::V1::ListEffectiveSecurityHealthAnalyticsCustomModulesRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_effective_security_health_analytics_custom_modules(parent: nil, page_size: nil, page_token: nil) + # Pass arguments to `list_effective_security_health_analytics_custom_modules` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param parent [::String] + # Required. Name of parent to list effective custom modules, in one of the + # following formats: + # + # * `organizations/{organization}/locations/{location}` + # * `folders/{folder}/locations/{location}` + # * `projects/{project}/locations/{location}` + # @param page_size [::Integer] + # Optional. The maximum number of results to return in a single response. + # Default is 10, minimum is 1, maximum is 1000. + # @param page_token [::String] + # Optional. A pagination token returned from a previous request. Provide this + # token to retrieve the next page of results. + # + # When paginating, the rest of the request must match the request that + # generated the page token. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Gapic::PagedEnumerable<::Google::Cloud::SecurityCenterManagement::V1::EffectiveSecurityHealthAnalyticsCustomModule>] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Gapic::PagedEnumerable<::Google::Cloud::SecurityCenterManagement::V1::EffectiveSecurityHealthAnalyticsCustomModule>] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/security_center_management/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::SecurityCenterManagement::V1::SecurityCenterManagement::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::SecurityCenterManagement::V1::ListEffectiveSecurityHealthAnalyticsCustomModulesRequest.new + # + # # Call the list_effective_security_health_analytics_custom_modules method. + # result = client.list_effective_security_health_analytics_custom_modules request + # + # # The returned object is of type Gapic::PagedEnumerable. You can iterate + # # over elements, and API calls will be issued to fetch pages as needed. + # result.each do |item| + # # Each element is of type ::Google::Cloud::SecurityCenterManagement::V1::EffectiveSecurityHealthAnalyticsCustomModule. + # p item + # end + # + def list_effective_security_health_analytics_custom_modules request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::SecurityCenterManagement::V1::ListEffectiveSecurityHealthAnalyticsCustomModulesRequest + + # Converts hash 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_effective_security_health_analytics_custom_modules.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::SecurityCenterManagement::V1::VERSION + metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.parent + header_params["parent"] = request.parent + end + + request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") + metadata[:"x-goog-request-params"] ||= request_params_header + + options.apply_defaults timeout: @config.rpcs.list_effective_security_health_analytics_custom_modules.timeout, + metadata: metadata, + retry_policy: @config.rpcs.list_effective_security_health_analytics_custom_modules.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @security_center_management_stub.call_rpc :list_effective_security_health_analytics_custom_modules, request, options: options do |response, operation| + response = ::Gapic::PagedEnumerable.new @security_center_management_stub, :list_effective_security_health_analytics_custom_modules, request, response, operation, options + yield response, operation if block_given? + throw :response, response + end + rescue ::GRPC::BadStatus => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Gets details of a single + # {::Google::Cloud::SecurityCenterManagement::V1::EffectiveSecurityHealthAnalyticsCustomModule EffectiveSecurityHealthAnalyticsCustomModule}. + # + # @overload get_effective_security_health_analytics_custom_module(request, options = nil) + # Pass arguments to `get_effective_security_health_analytics_custom_module` via a request object, either of type + # {::Google::Cloud::SecurityCenterManagement::V1::GetEffectiveSecurityHealthAnalyticsCustomModuleRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::SecurityCenterManagement::V1::GetEffectiveSecurityHealthAnalyticsCustomModuleRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_effective_security_health_analytics_custom_module(name: nil) + # Pass arguments to `get_effective_security_health_analytics_custom_module` via keyword arguments. Note that at + # least one keyword argument is 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 full resource name of the custom module, specified in one of + # the following formats: + # + # * `organizations/organization/{location}/effectiveSecurityHealthAnalyticsCustomModules/{custom_module}` + # * `folders/folder/{location}/effectiveSecurityHealthAnalyticsCustomModules/{custom_module}` + # * `projects/project/{location}/effectiveSecurityHealthAnalyticsCustomModules/{custom_module}` + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Google::Cloud::SecurityCenterManagement::V1::EffectiveSecurityHealthAnalyticsCustomModule] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Google::Cloud::SecurityCenterManagement::V1::EffectiveSecurityHealthAnalyticsCustomModule] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/security_center_management/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::SecurityCenterManagement::V1::SecurityCenterManagement::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::SecurityCenterManagement::V1::GetEffectiveSecurityHealthAnalyticsCustomModuleRequest.new + # + # # Call the get_effective_security_health_analytics_custom_module method. + # result = client.get_effective_security_health_analytics_custom_module request + # + # # The returned object is of type Google::Cloud::SecurityCenterManagement::V1::EffectiveSecurityHealthAnalyticsCustomModule. + # p result + # + def get_effective_security_health_analytics_custom_module request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::SecurityCenterManagement::V1::GetEffectiveSecurityHealthAnalyticsCustomModuleRequest + + # Converts hash 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_effective_security_health_analytics_custom_module.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::SecurityCenterManagement::V1::VERSION + metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.name + header_params["name"] = request.name + end + + request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") + metadata[:"x-goog-request-params"] ||= request_params_header + + options.apply_defaults timeout: @config.rpcs.get_effective_security_health_analytics_custom_module.timeout, + metadata: metadata, + retry_policy: @config.rpcs.get_effective_security_health_analytics_custom_module.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @security_center_management_stub.call_rpc :get_effective_security_health_analytics_custom_module, request, options: options do |response, operation| + yield response, operation if block_given? + end + rescue ::GRPC::BadStatus => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Returns a list of all + # {::Google::Cloud::SecurityCenterManagement::V1::SecurityHealthAnalyticsCustomModule SecurityHealthAnalyticsCustomModule} + # resources for the given parent. This includes resident modules defined at + # the scope of the parent, and inherited modules, inherited from ancestor + # organizations, folders, and projects (no descendants). + # + # @overload list_security_health_analytics_custom_modules(request, options = nil) + # Pass arguments to `list_security_health_analytics_custom_modules` via a request object, either of type + # {::Google::Cloud::SecurityCenterManagement::V1::ListSecurityHealthAnalyticsCustomModulesRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::SecurityCenterManagement::V1::ListSecurityHealthAnalyticsCustomModulesRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_security_health_analytics_custom_modules(parent: nil, page_size: nil, page_token: nil) + # Pass arguments to `list_security_health_analytics_custom_modules` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param parent [::String] + # Required. Name of the parent organization, folder, or project in which to + # list custom modules, in one of the following formats: + # + # * `organizations/{organization}/locations/{location}` + # * `folders/{folder}/locations/{location}` + # * `projects/{project}/locations/{location}` + # @param page_size [::Integer] + # Optional. The maximum number of results to return in a single response. + # Default is 10, minimum is 1, maximum is 1000. + # @param page_token [::String] + # Optional. A pagination token returned from a previous request. Provide this + # token to retrieve the next page of results. + # + # When paginating, the rest of the request must match the request that + # generated the page token. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Gapic::PagedEnumerable<::Google::Cloud::SecurityCenterManagement::V1::SecurityHealthAnalyticsCustomModule>] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Gapic::PagedEnumerable<::Google::Cloud::SecurityCenterManagement::V1::SecurityHealthAnalyticsCustomModule>] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/security_center_management/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::SecurityCenterManagement::V1::SecurityCenterManagement::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::SecurityCenterManagement::V1::ListSecurityHealthAnalyticsCustomModulesRequest.new + # + # # Call the list_security_health_analytics_custom_modules method. + # result = client.list_security_health_analytics_custom_modules request + # + # # The returned object is of type Gapic::PagedEnumerable. You can iterate + # # over elements, and API calls will be issued to fetch pages as needed. + # result.each do |item| + # # Each element is of type ::Google::Cloud::SecurityCenterManagement::V1::SecurityHealthAnalyticsCustomModule. + # p item + # end + # + def list_security_health_analytics_custom_modules request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::SecurityCenterManagement::V1::ListSecurityHealthAnalyticsCustomModulesRequest + + # Converts hash 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_security_health_analytics_custom_modules.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::SecurityCenterManagement::V1::VERSION + metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.parent + header_params["parent"] = request.parent + end + + request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") + metadata[:"x-goog-request-params"] ||= request_params_header + + options.apply_defaults timeout: @config.rpcs.list_security_health_analytics_custom_modules.timeout, + metadata: metadata, + retry_policy: @config.rpcs.list_security_health_analytics_custom_modules.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @security_center_management_stub.call_rpc :list_security_health_analytics_custom_modules, request, options: options do |response, operation| + response = ::Gapic::PagedEnumerable.new @security_center_management_stub, :list_security_health_analytics_custom_modules, 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 a list of all resident + # {::Google::Cloud::SecurityCenterManagement::V1::SecurityHealthAnalyticsCustomModule SecurityHealthAnalyticsCustomModule} + # resources under the given organization, folder, or project and all of its + # descendants. + # + # @overload list_descendant_security_health_analytics_custom_modules(request, options = nil) + # Pass arguments to `list_descendant_security_health_analytics_custom_modules` via a request object, either of type + # {::Google::Cloud::SecurityCenterManagement::V1::ListDescendantSecurityHealthAnalyticsCustomModulesRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::SecurityCenterManagement::V1::ListDescendantSecurityHealthAnalyticsCustomModulesRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_descendant_security_health_analytics_custom_modules(parent: nil, page_size: nil, page_token: nil) + # Pass arguments to `list_descendant_security_health_analytics_custom_modules` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param parent [::String] + # Required. Name of the parent organization, folder, or project in which to + # list custom modules, in one of the following formats: + # + # * `organizations/{organization}/locations/{location}` + # * `folders/{folder}/locations/{location}` + # * `projects/{project}/locations/{location}` + # @param page_size [::Integer] + # Optional. The maximum number of results to return in a single response. + # Default is 10, minimum is 1, maximum is 1000. + # @param page_token [::String] + # Optional. A pagination token returned from a previous request. Provide this + # token to retrieve the next page of results. + # + # When paginating, the rest of the request must match the request that + # generated the page token. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Gapic::PagedEnumerable<::Google::Cloud::SecurityCenterManagement::V1::SecurityHealthAnalyticsCustomModule>] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Gapic::PagedEnumerable<::Google::Cloud::SecurityCenterManagement::V1::SecurityHealthAnalyticsCustomModule>] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/security_center_management/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::SecurityCenterManagement::V1::SecurityCenterManagement::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::SecurityCenterManagement::V1::ListDescendantSecurityHealthAnalyticsCustomModulesRequest.new + # + # # Call the list_descendant_security_health_analytics_custom_modules method. + # result = client.list_descendant_security_health_analytics_custom_modules request + # + # # The returned object is of type Gapic::PagedEnumerable. You can iterate + # # over elements, and API calls will be issued to fetch pages as needed. + # result.each do |item| + # # Each element is of type ::Google::Cloud::SecurityCenterManagement::V1::SecurityHealthAnalyticsCustomModule. + # p item + # end + # + def list_descendant_security_health_analytics_custom_modules request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::SecurityCenterManagement::V1::ListDescendantSecurityHealthAnalyticsCustomModulesRequest + + # Converts hash 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_descendant_security_health_analytics_custom_modules.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::SecurityCenterManagement::V1::VERSION + metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.parent + header_params["parent"] = request.parent + end + + request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") + metadata[:"x-goog-request-params"] ||= request_params_header + + options.apply_defaults timeout: @config.rpcs.list_descendant_security_health_analytics_custom_modules.timeout, + metadata: metadata, + retry_policy: @config.rpcs.list_descendant_security_health_analytics_custom_modules.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @security_center_management_stub.call_rpc :list_descendant_security_health_analytics_custom_modules, request, options: options do |response, operation| + response = ::Gapic::PagedEnumerable.new @security_center_management_stub, :list_descendant_security_health_analytics_custom_modules, 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 + + ## + # Retrieves a + # {::Google::Cloud::SecurityCenterManagement::V1::SecurityHealthAnalyticsCustomModule SecurityHealthAnalyticsCustomModule}. + # + # @overload get_security_health_analytics_custom_module(request, options = nil) + # Pass arguments to `get_security_health_analytics_custom_module` via a request object, either of type + # {::Google::Cloud::SecurityCenterManagement::V1::GetSecurityHealthAnalyticsCustomModuleRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::SecurityCenterManagement::V1::GetSecurityHealthAnalyticsCustomModuleRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_security_health_analytics_custom_module(name: nil) + # Pass arguments to `get_security_health_analytics_custom_module` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param name [::String] + # Required. Name of the resource, in the format + # `projects/{project}/locations/{location}/securityHealthAnalyticsCustomModules/{custom_module}`. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Google::Cloud::SecurityCenterManagement::V1::SecurityHealthAnalyticsCustomModule] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Google::Cloud::SecurityCenterManagement::V1::SecurityHealthAnalyticsCustomModule] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/security_center_management/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::SecurityCenterManagement::V1::SecurityCenterManagement::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::SecurityCenterManagement::V1::GetSecurityHealthAnalyticsCustomModuleRequest.new + # + # # Call the get_security_health_analytics_custom_module method. + # result = client.get_security_health_analytics_custom_module request + # + # # The returned object is of type Google::Cloud::SecurityCenterManagement::V1::SecurityHealthAnalyticsCustomModule. + # p result + # + def get_security_health_analytics_custom_module request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::SecurityCenterManagement::V1::GetSecurityHealthAnalyticsCustomModuleRequest + + # Converts hash 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_security_health_analytics_custom_module.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::SecurityCenterManagement::V1::VERSION + metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.name + header_params["name"] = request.name + end + + request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") + metadata[:"x-goog-request-params"] ||= request_params_header + + options.apply_defaults timeout: @config.rpcs.get_security_health_analytics_custom_module.timeout, + metadata: metadata, + retry_policy: @config.rpcs.get_security_health_analytics_custom_module.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @security_center_management_stub.call_rpc :get_security_health_analytics_custom_module, request, options: options do |response, operation| + yield response, operation if block_given? + end + rescue ::GRPC::BadStatus => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Creates a resident + # {::Google::Cloud::SecurityCenterManagement::V1::SecurityHealthAnalyticsCustomModule SecurityHealthAnalyticsCustomModule} + # at the scope of the given organization, folder, or project, and also + # creates inherited `SecurityHealthAnalyticsCustomModule` resources for all + # folders and projects that are descendants of the given parent. These + # modules are enabled by default. + # + # @overload create_security_health_analytics_custom_module(request, options = nil) + # Pass arguments to `create_security_health_analytics_custom_module` via a request object, either of type + # {::Google::Cloud::SecurityCenterManagement::V1::CreateSecurityHealthAnalyticsCustomModuleRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::SecurityCenterManagement::V1::CreateSecurityHealthAnalyticsCustomModuleRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_security_health_analytics_custom_module(parent: nil, security_health_analytics_custom_module: nil, validate_only: nil) + # Pass arguments to `create_security_health_analytics_custom_module` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param parent [::String] + # Required. Name of the parent organization, folder, or project of the + # module, in one of the following formats: + # + # * `organizations/{organization}/locations/{location}` + # * `folders/{folder}/locations/{location}` + # * `projects/{project}/locations/{location}` + # @param security_health_analytics_custom_module [::Google::Cloud::SecurityCenterManagement::V1::SecurityHealthAnalyticsCustomModule, ::Hash] + # Required. The resource being created. + # @param validate_only [::Boolean] + # Optional. When set to `true`, the request will be validated (including IAM + # checks), but no module will be created. An `OK` response indicates that the + # request is valid, while an error response indicates that the request is + # invalid. + # + # If the request is valid, a subsequent request to create the module could + # still fail for one of the following reasons: + # + # * The state of your cloud resources changed; for example, you lost a + # required IAM permission + # * An error occurred during creation of the module + # + # Defaults to `false`. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Google::Cloud::SecurityCenterManagement::V1::SecurityHealthAnalyticsCustomModule] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Google::Cloud::SecurityCenterManagement::V1::SecurityHealthAnalyticsCustomModule] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/security_center_management/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::SecurityCenterManagement::V1::SecurityCenterManagement::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::SecurityCenterManagement::V1::CreateSecurityHealthAnalyticsCustomModuleRequest.new + # + # # Call the create_security_health_analytics_custom_module method. + # result = client.create_security_health_analytics_custom_module request + # + # # The returned object is of type Google::Cloud::SecurityCenterManagement::V1::SecurityHealthAnalyticsCustomModule. + # p result + # + def create_security_health_analytics_custom_module request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::SecurityCenterManagement::V1::CreateSecurityHealthAnalyticsCustomModuleRequest + + # Converts hash 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_security_health_analytics_custom_module.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::SecurityCenterManagement::V1::VERSION + metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.parent + header_params["parent"] = request.parent + end + + request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") + metadata[:"x-goog-request-params"] ||= request_params_header + + options.apply_defaults timeout: @config.rpcs.create_security_health_analytics_custom_module.timeout, + metadata: metadata, + retry_policy: @config.rpcs.create_security_health_analytics_custom_module.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @security_center_management_stub.call_rpc :create_security_health_analytics_custom_module, request, options: options do |response, operation| + yield response, operation if block_given? + end + rescue ::GRPC::BadStatus => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Updates the + # {::Google::Cloud::SecurityCenterManagement::V1::SecurityHealthAnalyticsCustomModule SecurityHealthAnalyticsCustomModule} + # under the given name based on the given update mask. Updating the + # enablement state is supported on both resident and inherited modules + # (though resident modules cannot have an enablement state of "inherited"). + # Updating the display name and custom configuration of a module is supported + # on resident modules only. + # + # @overload update_security_health_analytics_custom_module(request, options = nil) + # Pass arguments to `update_security_health_analytics_custom_module` via a request object, either of type + # {::Google::Cloud::SecurityCenterManagement::V1::UpdateSecurityHealthAnalyticsCustomModuleRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::SecurityCenterManagement::V1::UpdateSecurityHealthAnalyticsCustomModuleRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_security_health_analytics_custom_module(update_mask: nil, security_health_analytics_custom_module: nil, validate_only: nil) + # Pass arguments to `update_security_health_analytics_custom_module` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param update_mask [::Google::Protobuf::FieldMask, ::Hash] + # Required. The fields to update. The following values are valid: + # + # * `custom_config` + # * `enablement_state` + # + # If you omit this field or set it to the wildcard value `*`, then all + # eligible fields are updated. + # @param security_health_analytics_custom_module [::Google::Cloud::SecurityCenterManagement::V1::SecurityHealthAnalyticsCustomModule, ::Hash] + # Required. The resource being updated. + # @param validate_only [::Boolean] + # Optional. When set to `true`, the request will be validated (including IAM + # checks), but no module will be updated. An `OK` response indicates that the + # request is valid, while an error response indicates that the request is + # invalid. + # + # If the request is valid, a subsequent request to update the module could + # still fail for one of the following reasons: + # + # * The state of your cloud resources changed; for example, you lost a + # required IAM permission + # * An error occurred during creation of the module + # + # Defaults to `false`. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Google::Cloud::SecurityCenterManagement::V1::SecurityHealthAnalyticsCustomModule] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Google::Cloud::SecurityCenterManagement::V1::SecurityHealthAnalyticsCustomModule] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/security_center_management/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::SecurityCenterManagement::V1::SecurityCenterManagement::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::SecurityCenterManagement::V1::UpdateSecurityHealthAnalyticsCustomModuleRequest.new + # + # # Call the update_security_health_analytics_custom_module method. + # result = client.update_security_health_analytics_custom_module request + # + # # The returned object is of type Google::Cloud::SecurityCenterManagement::V1::SecurityHealthAnalyticsCustomModule. + # p result + # + def update_security_health_analytics_custom_module request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::SecurityCenterManagement::V1::UpdateSecurityHealthAnalyticsCustomModuleRequest + + # Converts hash 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_security_health_analytics_custom_module.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::SecurityCenterManagement::V1::VERSION + metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.security_health_analytics_custom_module&.name + header_params["security_health_analytics_custom_module.name"] = request.security_health_analytics_custom_module.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_security_health_analytics_custom_module.timeout, + metadata: metadata, + retry_policy: @config.rpcs.update_security_health_analytics_custom_module.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @security_center_management_stub.call_rpc :update_security_health_analytics_custom_module, request, options: options do |response, operation| + yield response, operation if block_given? + end + rescue ::GRPC::BadStatus => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Deletes the specified + # {::Google::Cloud::SecurityCenterManagement::V1::SecurityHealthAnalyticsCustomModule SecurityHealthAnalyticsCustomModule} + # and all of its descendants in the resource hierarchy. This method is only + # supported for resident custom modules. + # + # @overload delete_security_health_analytics_custom_module(request, options = nil) + # Pass arguments to `delete_security_health_analytics_custom_module` via a request object, either of type + # {::Google::Cloud::SecurityCenterManagement::V1::DeleteSecurityHealthAnalyticsCustomModuleRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::SecurityCenterManagement::V1::DeleteSecurityHealthAnalyticsCustomModuleRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_security_health_analytics_custom_module(name: nil, validate_only: nil) + # Pass arguments to `delete_security_health_analytics_custom_module` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param name [::String] + # Required. The resource name of the SHA custom module, in one of the + # following formats: + # + # * `organizations/{organization}/locations/{location}/securityHealthAnalyticsCustomModules/{custom_module}` + # * `folders/{folder}/locations/{location}/securityHealthAnalyticsCustomModules/{custom_module}` + # * `projects/{project}/locations/{location}/securityHealthAnalyticsCustomModules/{custom_module}` + # @param validate_only [::Boolean] + # Optional. When set to `true`, the request will be validated (including IAM + # checks), but no module will be deleted. An `OK` response indicates that the + # request is valid, while an error response indicates that the request is + # invalid. + # + # If the request is valid, a subsequent request to delete the module could + # still fail for one of the following reasons: + # + # * The state of your cloud resources changed; for example, you lost a + # required IAM permission + # * An error occurred during deletion of the module + # + # Defaults to `false`. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Google::Protobuf::Empty] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Google::Protobuf::Empty] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/security_center_management/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::SecurityCenterManagement::V1::SecurityCenterManagement::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::SecurityCenterManagement::V1::DeleteSecurityHealthAnalyticsCustomModuleRequest.new + # + # # Call the delete_security_health_analytics_custom_module method. + # result = client.delete_security_health_analytics_custom_module request + # + # # The returned object is of type Google::Protobuf::Empty. + # p result + # + def delete_security_health_analytics_custom_module request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::SecurityCenterManagement::V1::DeleteSecurityHealthAnalyticsCustomModuleRequest + + # Converts hash 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_security_health_analytics_custom_module.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::SecurityCenterManagement::V1::VERSION + metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.name + header_params["name"] = request.name + end + + request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") + metadata[:"x-goog-request-params"] ||= request_params_header + + options.apply_defaults timeout: @config.rpcs.delete_security_health_analytics_custom_module.timeout, + metadata: metadata, + retry_policy: @config.rpcs.delete_security_health_analytics_custom_module.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @security_center_management_stub.call_rpc :delete_security_health_analytics_custom_module, 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 + + ## + # Simulates the result of using a + # {::Google::Cloud::SecurityCenterManagement::V1::SecurityHealthAnalyticsCustomModule SecurityHealthAnalyticsCustomModule} + # to check a resource. + # + # @overload simulate_security_health_analytics_custom_module(request, options = nil) + # Pass arguments to `simulate_security_health_analytics_custom_module` via a request object, either of type + # {::Google::Cloud::SecurityCenterManagement::V1::SimulateSecurityHealthAnalyticsCustomModuleRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::SecurityCenterManagement::V1::SimulateSecurityHealthAnalyticsCustomModuleRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. + # + # @overload simulate_security_health_analytics_custom_module(parent: nil, custom_config: nil, resource: nil) + # Pass arguments to `simulate_security_health_analytics_custom_module` via keyword arguments. Note that at + # least one keyword argument is 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 relative resource name of the organization, project, or + # folder. For more information about relative resource names, see [AIP-122: + # Resource names](https://google.aip.dev/122). Example: + # `organizations/{organization_id}`. + # @param custom_config [::Google::Cloud::SecurityCenterManagement::V1::CustomConfig, ::Hash] + # Required. The custom configuration that you need to test. + # @param resource [::Google::Cloud::SecurityCenterManagement::V1::SimulateSecurityHealthAnalyticsCustomModuleRequest::SimulatedResource, ::Hash] + # Required. Resource data to simulate custom module against. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Google::Cloud::SecurityCenterManagement::V1::SimulateSecurityHealthAnalyticsCustomModuleResponse] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Google::Cloud::SecurityCenterManagement::V1::SimulateSecurityHealthAnalyticsCustomModuleResponse] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/security_center_management/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::SecurityCenterManagement::V1::SecurityCenterManagement::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::SecurityCenterManagement::V1::SimulateSecurityHealthAnalyticsCustomModuleRequest.new + # + # # Call the simulate_security_health_analytics_custom_module method. + # result = client.simulate_security_health_analytics_custom_module request + # + # # The returned object is of type Google::Cloud::SecurityCenterManagement::V1::SimulateSecurityHealthAnalyticsCustomModuleResponse. + # p result + # + def simulate_security_health_analytics_custom_module request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::SecurityCenterManagement::V1::SimulateSecurityHealthAnalyticsCustomModuleRequest + + # Converts hash 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.simulate_security_health_analytics_custom_module.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::SecurityCenterManagement::V1::VERSION + metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.parent + header_params["parent"] = request.parent + end + + request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") + metadata[:"x-goog-request-params"] ||= request_params_header + + options.apply_defaults timeout: @config.rpcs.simulate_security_health_analytics_custom_module.timeout, + metadata: metadata, + retry_policy: @config.rpcs.simulate_security_health_analytics_custom_module.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @security_center_management_stub.call_rpc :simulate_security_health_analytics_custom_module, request, options: options do |response, operation| + yield response, operation if block_given? + end + rescue ::GRPC::BadStatus => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Lists all effective Event Threat Detection custom modules for the + # given parent. This includes resident modules defined at the scope of the + # parent along with modules inherited from its ancestors. + # + # @overload list_effective_event_threat_detection_custom_modules(request, options = nil) + # Pass arguments to `list_effective_event_threat_detection_custom_modules` via a request object, either of type + # {::Google::Cloud::SecurityCenterManagement::V1::ListEffectiveEventThreatDetectionCustomModulesRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::SecurityCenterManagement::V1::ListEffectiveEventThreatDetectionCustomModulesRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_effective_event_threat_detection_custom_modules(parent: nil, page_size: nil, page_token: nil) + # Pass arguments to `list_effective_event_threat_detection_custom_modules` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param parent [::String] + # Required. Name of parent to list effective custom modules, in one of the + # following formats: + # + # * `organizations/{organization}/locations/{location}` + # * `folders/{folder}/locations/{location}` + # * `projects/{project}/locations/{location}` + # @param page_size [::Integer] + # Optional. The maximum number of results to return in a single response. + # Default is 10, minimum is 1, maximum is 1000. + # @param page_token [::String] + # Optional. A pagination token returned from a previous request. Provide this + # token to retrieve the next page of results. + # + # When paginating, the rest of the request must match the request that + # generated the page token. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Gapic::PagedEnumerable<::Google::Cloud::SecurityCenterManagement::V1::EffectiveEventThreatDetectionCustomModule>] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Gapic::PagedEnumerable<::Google::Cloud::SecurityCenterManagement::V1::EffectiveEventThreatDetectionCustomModule>] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/security_center_management/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::SecurityCenterManagement::V1::SecurityCenterManagement::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::SecurityCenterManagement::V1::ListEffectiveEventThreatDetectionCustomModulesRequest.new + # + # # Call the list_effective_event_threat_detection_custom_modules method. + # result = client.list_effective_event_threat_detection_custom_modules request + # + # # The returned object is of type Gapic::PagedEnumerable. You can iterate + # # over elements, and API calls will be issued to fetch pages as needed. + # result.each do |item| + # # Each element is of type ::Google::Cloud::SecurityCenterManagement::V1::EffectiveEventThreatDetectionCustomModule. + # p item + # end + # + def list_effective_event_threat_detection_custom_modules request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::SecurityCenterManagement::V1::ListEffectiveEventThreatDetectionCustomModulesRequest + + # Converts hash 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_effective_event_threat_detection_custom_modules.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::SecurityCenterManagement::V1::VERSION + metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.parent + header_params["parent"] = request.parent + end + + request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") + metadata[:"x-goog-request-params"] ||= request_params_header + + options.apply_defaults timeout: @config.rpcs.list_effective_event_threat_detection_custom_modules.timeout, + metadata: metadata, + retry_policy: @config.rpcs.list_effective_event_threat_detection_custom_modules.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @security_center_management_stub.call_rpc :list_effective_event_threat_detection_custom_modules, request, options: options do |response, operation| + response = ::Gapic::PagedEnumerable.new @security_center_management_stub, :list_effective_event_threat_detection_custom_modules, request, response, operation, options + yield response, operation if block_given? + throw :response, response + end + rescue ::GRPC::BadStatus => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Gets the effective Event Threat Detection custom module at the given level. + # + # The difference between an + # {::Google::Cloud::SecurityCenterManagement::V1::EffectiveEventThreatDetectionCustomModule EffectiveEventThreatDetectionCustomModule} + # and an + # {::Google::Cloud::SecurityCenterManagement::V1::EventThreatDetectionCustomModule EventThreatDetectionCustomModule} + # is that the fields for an `EffectiveEventThreatDetectionCustomModule` are + # computed from ancestors if needed. For example, the enablement state for an + # `EventThreatDetectionCustomModule` can be `ENABLED`, `DISABLED`, or + # `INHERITED`. In contrast, the enablement state for an + # `EffectiveEventThreatDetectionCustomModule` is always computed as `ENABLED` + # or `DISABLED`. + # + # @overload get_effective_event_threat_detection_custom_module(request, options = nil) + # Pass arguments to `get_effective_event_threat_detection_custom_module` via a request object, either of type + # {::Google::Cloud::SecurityCenterManagement::V1::GetEffectiveEventThreatDetectionCustomModuleRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::SecurityCenterManagement::V1::GetEffectiveEventThreatDetectionCustomModuleRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_effective_event_threat_detection_custom_module(name: nil) + # Pass arguments to `get_effective_event_threat_detection_custom_module` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param name [::String] + # Required. The resource name of the Event Threat Detection custom module, in + # one of the following formats: + # + # * `organizations/{organization}/locations/{location}/effectiveEventThreatDetectionCustomModules/{custom_module}` + # * `folders/{folder}/locations/{location}/effectiveEventThreatDetectionCustomModules/{custom_module}` + # * `projects/{project}/locations/{location}/effectiveEventThreatDetectionCustomModules/{custom_module}` + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Google::Cloud::SecurityCenterManagement::V1::EffectiveEventThreatDetectionCustomModule] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Google::Cloud::SecurityCenterManagement::V1::EffectiveEventThreatDetectionCustomModule] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/security_center_management/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::SecurityCenterManagement::V1::SecurityCenterManagement::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::SecurityCenterManagement::V1::GetEffectiveEventThreatDetectionCustomModuleRequest.new + # + # # Call the get_effective_event_threat_detection_custom_module method. + # result = client.get_effective_event_threat_detection_custom_module request + # + # # The returned object is of type Google::Cloud::SecurityCenterManagement::V1::EffectiveEventThreatDetectionCustomModule. + # p result + # + def get_effective_event_threat_detection_custom_module request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::SecurityCenterManagement::V1::GetEffectiveEventThreatDetectionCustomModuleRequest + + # Converts hash 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_effective_event_threat_detection_custom_module.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::SecurityCenterManagement::V1::VERSION + metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.name + header_params["name"] = request.name + end + + request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") + metadata[:"x-goog-request-params"] ||= request_params_header + + options.apply_defaults timeout: @config.rpcs.get_effective_event_threat_detection_custom_module.timeout, + metadata: metadata, + retry_policy: @config.rpcs.get_effective_event_threat_detection_custom_module.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @security_center_management_stub.call_rpc :get_effective_event_threat_detection_custom_module, request, options: options do |response, operation| + yield response, operation if block_given? + end + rescue ::GRPC::BadStatus => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Lists all Event Threat Detection custom modules for the given organization, + # folder, or project. This includes resident modules defined at the scope of + # the parent along with modules inherited from ancestors. + # + # @overload list_event_threat_detection_custom_modules(request, options = nil) + # Pass arguments to `list_event_threat_detection_custom_modules` via a request object, either of type + # {::Google::Cloud::SecurityCenterManagement::V1::ListEventThreatDetectionCustomModulesRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::SecurityCenterManagement::V1::ListEventThreatDetectionCustomModulesRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_event_threat_detection_custom_modules(parent: nil, page_size: nil, page_token: nil) + # Pass arguments to `list_event_threat_detection_custom_modules` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param parent [::String] + # Required. Name of parent to list custom modules, in one of the following + # formats: + # + # * `organizations/{organization}/locations/{location}` + # * `folders/{folder}/locations/{location}` + # * `projects/{project}/locations/{location}` + # @param page_size [::Integer] + # Optional. The maximum number of modules to return. The service may return + # fewer than this value. If unspecified, at most 10 modules will be returned. + # The maximum value is 1000; values above 1000 will be coerced to 1000. + # @param page_token [::String] + # Optional. A pagination token returned from a previous request. Provide this + # token to retrieve the next page of results. + # + # When paginating, the rest of the request must match the request that + # generated the page token. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Gapic::PagedEnumerable<::Google::Cloud::SecurityCenterManagement::V1::EventThreatDetectionCustomModule>] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Gapic::PagedEnumerable<::Google::Cloud::SecurityCenterManagement::V1::EventThreatDetectionCustomModule>] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/security_center_management/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::SecurityCenterManagement::V1::SecurityCenterManagement::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::SecurityCenterManagement::V1::ListEventThreatDetectionCustomModulesRequest.new + # + # # Call the list_event_threat_detection_custom_modules method. + # result = client.list_event_threat_detection_custom_modules request + # + # # The returned object is of type Gapic::PagedEnumerable. You can iterate + # # over elements, and API calls will be issued to fetch pages as needed. + # result.each do |item| + # # Each element is of type ::Google::Cloud::SecurityCenterManagement::V1::EventThreatDetectionCustomModule. + # p item + # end + # + def list_event_threat_detection_custom_modules request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::SecurityCenterManagement::V1::ListEventThreatDetectionCustomModulesRequest + + # Converts hash 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_event_threat_detection_custom_modules.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::SecurityCenterManagement::V1::VERSION + metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.parent + header_params["parent"] = request.parent + end + + request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") + metadata[:"x-goog-request-params"] ||= request_params_header + + options.apply_defaults timeout: @config.rpcs.list_event_threat_detection_custom_modules.timeout, + metadata: metadata, + retry_policy: @config.rpcs.list_event_threat_detection_custom_modules.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @security_center_management_stub.call_rpc :list_event_threat_detection_custom_modules, request, options: options do |response, operation| + response = ::Gapic::PagedEnumerable.new @security_center_management_stub, :list_event_threat_detection_custom_modules, 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 + + ## + # Lists all resident Event Threat Detection custom modules for the given + # organization, folder, or project and its descendants. + # + # @overload list_descendant_event_threat_detection_custom_modules(request, options = nil) + # Pass arguments to `list_descendant_event_threat_detection_custom_modules` via a request object, either of type + # {::Google::Cloud::SecurityCenterManagement::V1::ListDescendantEventThreatDetectionCustomModulesRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::SecurityCenterManagement::V1::ListDescendantEventThreatDetectionCustomModulesRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_descendant_event_threat_detection_custom_modules(parent: nil, page_size: nil, page_token: nil) + # Pass arguments to `list_descendant_event_threat_detection_custom_modules` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param parent [::String] + # Required. Name of parent to list custom modules, in one of the following + # formats: + # + # * `organizations/{organization}/locations/{location}` + # * `folders/{folder}/locations/{location}` + # * `projects/{project}/locations/{location}` + # @param page_size [::Integer] + # Optional. The maximum number of modules to return. The service may return + # fewer than this value. If unspecified, at most 10 configs will be returned. + # The maximum value is 1000; values above 1000 will be coerced to 1000. + # @param page_token [::String] + # Optional. A pagination token returned from a previous request. Provide this + # token to retrieve the next page of results. + # + # When paginating, the rest of the request must match the request that + # generated the page token. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Gapic::PagedEnumerable<::Google::Cloud::SecurityCenterManagement::V1::EventThreatDetectionCustomModule>] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Gapic::PagedEnumerable<::Google::Cloud::SecurityCenterManagement::V1::EventThreatDetectionCustomModule>] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/security_center_management/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::SecurityCenterManagement::V1::SecurityCenterManagement::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::SecurityCenterManagement::V1::ListDescendantEventThreatDetectionCustomModulesRequest.new + # + # # Call the list_descendant_event_threat_detection_custom_modules method. + # result = client.list_descendant_event_threat_detection_custom_modules request + # + # # The returned object is of type Gapic::PagedEnumerable. You can iterate + # # over elements, and API calls will be issued to fetch pages as needed. + # result.each do |item| + # # Each element is of type ::Google::Cloud::SecurityCenterManagement::V1::EventThreatDetectionCustomModule. + # p item + # end + # + def list_descendant_event_threat_detection_custom_modules request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::SecurityCenterManagement::V1::ListDescendantEventThreatDetectionCustomModulesRequest + + # Converts hash 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_descendant_event_threat_detection_custom_modules.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::SecurityCenterManagement::V1::VERSION + metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.parent + header_params["parent"] = request.parent + end + + request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") + metadata[:"x-goog-request-params"] ||= request_params_header + + options.apply_defaults timeout: @config.rpcs.list_descendant_event_threat_detection_custom_modules.timeout, + metadata: metadata, + retry_policy: @config.rpcs.list_descendant_event_threat_detection_custom_modules.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @security_center_management_stub.call_rpc :list_descendant_event_threat_detection_custom_modules, request, options: options do |response, operation| + response = ::Gapic::PagedEnumerable.new @security_center_management_stub, :list_descendant_event_threat_detection_custom_modules, request, response, operation, options + yield response, operation if block_given? + throw :response, response + end + rescue ::GRPC::BadStatus => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Gets an Event Threat Detection custom module. + # + # @overload get_event_threat_detection_custom_module(request, options = nil) + # Pass arguments to `get_event_threat_detection_custom_module` via a request object, either of type + # {::Google::Cloud::SecurityCenterManagement::V1::GetEventThreatDetectionCustomModuleRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::SecurityCenterManagement::V1::GetEventThreatDetectionCustomModuleRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_event_threat_detection_custom_module(name: nil) + # Pass arguments to `get_event_threat_detection_custom_module` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param name [::String] + # Required. The resource name of the Event Threat Detection custom module, in + # one of the following formats: + # + # * `organizations/{organization}/locations/{location}/eventThreatDetectionCustomModules/{custom_module}` + # * `folders/{folder}/locations/{location}/eventThreatDetectionCustomModules/{custom_module}` + # * `projects/{project}/locations/{location}/eventThreatDetectionCustomModules/{custom_module}` + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Google::Cloud::SecurityCenterManagement::V1::EventThreatDetectionCustomModule] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Google::Cloud::SecurityCenterManagement::V1::EventThreatDetectionCustomModule] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/security_center_management/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::SecurityCenterManagement::V1::SecurityCenterManagement::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::SecurityCenterManagement::V1::GetEventThreatDetectionCustomModuleRequest.new + # + # # Call the get_event_threat_detection_custom_module method. + # result = client.get_event_threat_detection_custom_module request + # + # # The returned object is of type Google::Cloud::SecurityCenterManagement::V1::EventThreatDetectionCustomModule. + # p result + # + def get_event_threat_detection_custom_module request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::SecurityCenterManagement::V1::GetEventThreatDetectionCustomModuleRequest + + # Converts hash 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_event_threat_detection_custom_module.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::SecurityCenterManagement::V1::VERSION + metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.name + header_params["name"] = request.name + end + + request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") + metadata[:"x-goog-request-params"] ||= request_params_header + + options.apply_defaults timeout: @config.rpcs.get_event_threat_detection_custom_module.timeout, + metadata: metadata, + retry_policy: @config.rpcs.get_event_threat_detection_custom_module.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @security_center_management_stub.call_rpc :get_event_threat_detection_custom_module, request, options: options do |response, operation| + yield response, operation if block_given? + end + rescue ::GRPC::BadStatus => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Creates a resident Event Threat Detection custom module at the scope of the + # given organization, folder, or project, and creates inherited custom + # modules for all descendants of the given parent. These modules are enabled + # by default. + # + # @overload create_event_threat_detection_custom_module(request, options = nil) + # Pass arguments to `create_event_threat_detection_custom_module` via a request object, either of type + # {::Google::Cloud::SecurityCenterManagement::V1::CreateEventThreatDetectionCustomModuleRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::SecurityCenterManagement::V1::CreateEventThreatDetectionCustomModuleRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_event_threat_detection_custom_module(parent: nil, event_threat_detection_custom_module: nil, validate_only: nil) + # Pass arguments to `create_event_threat_detection_custom_module` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param parent [::String] + # Required. Name of parent for the module, in one of the following formats: + # + # * `organizations/{organization}/locations/{location}` + # * `folders/{folder}/locations/{location}` + # * `projects/{project}/locations/{location}` + # @param event_threat_detection_custom_module [::Google::Cloud::SecurityCenterManagement::V1::EventThreatDetectionCustomModule, ::Hash] + # Required. The module to create. The + # {::Google::Cloud::SecurityCenterManagement::V1::EventThreatDetectionCustomModule#name EventThreatDetectionCustomModule.name} + # field is ignored; Security Command Center generates the name. + # @param validate_only [::Boolean] + # Optional. When set to `true`, the request will be validated (including IAM + # checks), but no module will be created. An `OK` response indicates that the + # request is valid, while an error response indicates that the request is + # invalid. + # + # If the request is valid, a subsequent request to create the module could + # still fail for one of the following reasons: + # + # * The state of your cloud resources changed; for example, you lost a + # required IAM permission + # * An error occurred during creation of the module + # + # Defaults to `false`. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Google::Cloud::SecurityCenterManagement::V1::EventThreatDetectionCustomModule] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Google::Cloud::SecurityCenterManagement::V1::EventThreatDetectionCustomModule] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/security_center_management/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::SecurityCenterManagement::V1::SecurityCenterManagement::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::SecurityCenterManagement::V1::CreateEventThreatDetectionCustomModuleRequest.new + # + # # Call the create_event_threat_detection_custom_module method. + # result = client.create_event_threat_detection_custom_module request + # + # # The returned object is of type Google::Cloud::SecurityCenterManagement::V1::EventThreatDetectionCustomModule. + # p result + # + def create_event_threat_detection_custom_module request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::SecurityCenterManagement::V1::CreateEventThreatDetectionCustomModuleRequest + + # Converts hash 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_event_threat_detection_custom_module.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::SecurityCenterManagement::V1::VERSION + metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.parent + header_params["parent"] = request.parent + end + + request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") + metadata[:"x-goog-request-params"] ||= request_params_header + + options.apply_defaults timeout: @config.rpcs.create_event_threat_detection_custom_module.timeout, + metadata: metadata, + retry_policy: @config.rpcs.create_event_threat_detection_custom_module.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @security_center_management_stub.call_rpc :create_event_threat_detection_custom_module, request, options: options do |response, operation| + yield response, operation if block_given? + end + rescue ::GRPC::BadStatus => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Updates the Event Threat Detection custom module with the given name based + # on the given update mask. Updating the enablement state is supported for + # both resident and inherited modules (though resident modules cannot have an + # enablement state of "inherited"). Updating the display name or + # configuration of a module is supported for resident modules only. The type + # of a module cannot be changed. + # + # @overload update_event_threat_detection_custom_module(request, options = nil) + # Pass arguments to `update_event_threat_detection_custom_module` via a request object, either of type + # {::Google::Cloud::SecurityCenterManagement::V1::UpdateEventThreatDetectionCustomModuleRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::SecurityCenterManagement::V1::UpdateEventThreatDetectionCustomModuleRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_event_threat_detection_custom_module(update_mask: nil, event_threat_detection_custom_module: nil, validate_only: nil) + # Pass arguments to `update_event_threat_detection_custom_module` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param update_mask [::Google::Protobuf::FieldMask, ::Hash] + # Required. The fields to update. If omitted, then all fields are updated. + # @param event_threat_detection_custom_module [::Google::Cloud::SecurityCenterManagement::V1::EventThreatDetectionCustomModule, ::Hash] + # Required. The module being updated. + # @param validate_only [::Boolean] + # Optional. When set to `true`, the request will be validated (including IAM + # checks), but no module will be updated. An `OK` response indicates that the + # request is valid, while an error response indicates that the request is + # invalid. + # + # If the request is valid, a subsequent request to update the module could + # still fail for one of the following reasons: + # + # * The state of your cloud resources changed; for example, you lost a + # required IAM permission + # * An error occurred during creation of the module + # + # Defaults to `false`. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Google::Cloud::SecurityCenterManagement::V1::EventThreatDetectionCustomModule] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Google::Cloud::SecurityCenterManagement::V1::EventThreatDetectionCustomModule] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/security_center_management/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::SecurityCenterManagement::V1::SecurityCenterManagement::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::SecurityCenterManagement::V1::UpdateEventThreatDetectionCustomModuleRequest.new + # + # # Call the update_event_threat_detection_custom_module method. + # result = client.update_event_threat_detection_custom_module request + # + # # The returned object is of type Google::Cloud::SecurityCenterManagement::V1::EventThreatDetectionCustomModule. + # p result + # + def update_event_threat_detection_custom_module request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::SecurityCenterManagement::V1::UpdateEventThreatDetectionCustomModuleRequest + + # Converts hash 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_event_threat_detection_custom_module.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::SecurityCenterManagement::V1::VERSION + metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.event_threat_detection_custom_module&.name + header_params["event_threat_detection_custom_module.name"] = request.event_threat_detection_custom_module.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_event_threat_detection_custom_module.timeout, + metadata: metadata, + retry_policy: @config.rpcs.update_event_threat_detection_custom_module.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @security_center_management_stub.call_rpc :update_event_threat_detection_custom_module, request, options: options do |response, operation| + yield response, operation if block_given? + end + rescue ::GRPC::BadStatus => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Deletes the specified Event Threat Detection custom module and all of its + # descendants in the resource hierarchy. This method is only supported for + # resident custom modules. + # + # @overload delete_event_threat_detection_custom_module(request, options = nil) + # Pass arguments to `delete_event_threat_detection_custom_module` via a request object, either of type + # {::Google::Cloud::SecurityCenterManagement::V1::DeleteEventThreatDetectionCustomModuleRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::SecurityCenterManagement::V1::DeleteEventThreatDetectionCustomModuleRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_event_threat_detection_custom_module(name: nil, validate_only: nil) + # Pass arguments to `delete_event_threat_detection_custom_module` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param name [::String] + # Required. The resource name of the Event Threat Detection custom module, in + # one of the following formats: + # + # * `organizations/{organization}/locations/{location}/eventThreatDetectionCustomModules/{custom_module}` + # * `folders/{folder}/locations/{location}/eventThreatDetectionCustomModules/{custom_module}` + # * `projects/{project}/locations/{location}/eventThreatDetectionCustomModules/{custom_module}` + # @param validate_only [::Boolean] + # Optional. When set to `true`, the request will be validated (including IAM + # checks), but no module will be deleted. An `OK` response indicates that the + # request is valid, while an error response indicates that the request is + # invalid. + # + # If the request is valid, a subsequent request to delete the module could + # still fail for one of the following reasons: + # + # * The state of your cloud resources changed; for example, you lost a + # required IAM permission + # * An error occurred during creation of the module + # + # Defaults to `false`. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Google::Protobuf::Empty] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Google::Protobuf::Empty] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/security_center_management/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::SecurityCenterManagement::V1::SecurityCenterManagement::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::SecurityCenterManagement::V1::DeleteEventThreatDetectionCustomModuleRequest.new + # + # # Call the delete_event_threat_detection_custom_module method. + # result = client.delete_event_threat_detection_custom_module request + # + # # The returned object is of type Google::Protobuf::Empty. + # p result + # + def delete_event_threat_detection_custom_module request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::SecurityCenterManagement::V1::DeleteEventThreatDetectionCustomModuleRequest + + # Converts hash 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_event_threat_detection_custom_module.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::SecurityCenterManagement::V1::VERSION + metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.name + header_params["name"] = request.name + end + + request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") + metadata[:"x-goog-request-params"] ||= request_params_header + + options.apply_defaults timeout: @config.rpcs.delete_event_threat_detection_custom_module.timeout, + metadata: metadata, + retry_policy: @config.rpcs.delete_event_threat_detection_custom_module.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @security_center_management_stub.call_rpc :delete_event_threat_detection_custom_module, 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 + + ## + # Validates the given Event Threat Detection custom module. + # + # @overload validate_event_threat_detection_custom_module(request, options = nil) + # Pass arguments to `validate_event_threat_detection_custom_module` via a request object, either of type + # {::Google::Cloud::SecurityCenterManagement::V1::ValidateEventThreatDetectionCustomModuleRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::SecurityCenterManagement::V1::ValidateEventThreatDetectionCustomModuleRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. + # + # @overload validate_event_threat_detection_custom_module(parent: nil, raw_text: nil, type: nil) + # Pass arguments to `validate_event_threat_detection_custom_module` via keyword arguments. Note that at + # least one keyword argument is 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. Resource name of the parent to validate the custom modules under, + # in one of the following formats: + # + # * `organizations/{organization}/locations/{location}` + # @param raw_text [::String] + # Required. The raw text of the module's contents. Used to generate error + # messages. + # @param type [::String] + # Required. The type of the module. For example, `CONFIGURABLE_BAD_IP`. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Google::Cloud::SecurityCenterManagement::V1::ValidateEventThreatDetectionCustomModuleResponse] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Google::Cloud::SecurityCenterManagement::V1::ValidateEventThreatDetectionCustomModuleResponse] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/security_center_management/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::SecurityCenterManagement::V1::SecurityCenterManagement::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::SecurityCenterManagement::V1::ValidateEventThreatDetectionCustomModuleRequest.new + # + # # Call the validate_event_threat_detection_custom_module method. + # result = client.validate_event_threat_detection_custom_module request + # + # # The returned object is of type Google::Cloud::SecurityCenterManagement::V1::ValidateEventThreatDetectionCustomModuleResponse. + # p result + # + def validate_event_threat_detection_custom_module request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::SecurityCenterManagement::V1::ValidateEventThreatDetectionCustomModuleRequest + + # Converts hash 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.validate_event_threat_detection_custom_module.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::SecurityCenterManagement::V1::VERSION + metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.parent + header_params["parent"] = request.parent + end + + request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") + metadata[:"x-goog-request-params"] ||= request_params_header + + options.apply_defaults timeout: @config.rpcs.validate_event_threat_detection_custom_module.timeout, + metadata: metadata, + retry_policy: @config.rpcs.validate_event_threat_detection_custom_module.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @security_center_management_stub.call_rpc :validate_event_threat_detection_custom_module, request, options: options do |response, operation| + yield response, operation if block_given? + end + rescue ::GRPC::BadStatus => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Gets service settings for the specified Security Command Center service. + # + # @overload get_security_center_service(request, options = nil) + # Pass arguments to `get_security_center_service` via a request object, either of type + # {::Google::Cloud::SecurityCenterManagement::V1::GetSecurityCenterServiceRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::SecurityCenterManagement::V1::GetSecurityCenterServiceRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_security_center_service(name: nil, show_eligible_modules_only: nil) + # Pass arguments to `get_security_center_service` via keyword arguments. Note that at + # least one keyword argument is 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 Security Command Center service to retrieve, in one of the + # following formats: + # + # * organizations/\\{organization}/locations/\\{location}/securityCenterServices/\\{service} + # * folders/\\{folder}/locations/\\{location}/securityCenterServices/\\{service} + # * projects/\\{project}/locations/\\{location}/securityCenterServices/\\{service} + # + # The following values are valid for `{service}`: + # + # * `container-threat-detection` + # * `event-threat-detection` + # * `security-health-analytics` + # * `vm-threat-detection` + # * `web-security-scanner` + # @param show_eligible_modules_only [::Boolean] + # Set to `true` to show only modules that are in scope. By default, all + # modules are shown. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Google::Cloud::SecurityCenterManagement::V1::SecurityCenterService] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Google::Cloud::SecurityCenterManagement::V1::SecurityCenterService] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/security_center_management/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::SecurityCenterManagement::V1::SecurityCenterManagement::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::SecurityCenterManagement::V1::GetSecurityCenterServiceRequest.new + # + # # Call the get_security_center_service method. + # result = client.get_security_center_service request + # + # # The returned object is of type Google::Cloud::SecurityCenterManagement::V1::SecurityCenterService. + # p result + # + def get_security_center_service request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::SecurityCenterManagement::V1::GetSecurityCenterServiceRequest + + # Converts hash 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_security_center_service.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::SecurityCenterManagement::V1::VERSION + metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.name + header_params["name"] = request.name + end + + request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") + metadata[:"x-goog-request-params"] ||= request_params_header + + options.apply_defaults timeout: @config.rpcs.get_security_center_service.timeout, + metadata: metadata, + retry_policy: @config.rpcs.get_security_center_service.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @security_center_management_stub.call_rpc :get_security_center_service, request, options: options do |response, operation| + yield response, operation if block_given? + end + rescue ::GRPC::BadStatus => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Returns a list of all Security Command Center services for the given + # parent. + # + # @overload list_security_center_services(request, options = nil) + # Pass arguments to `list_security_center_services` via a request object, either of type + # {::Google::Cloud::SecurityCenterManagement::V1::ListSecurityCenterServicesRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::SecurityCenterManagement::V1::ListSecurityCenterServicesRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_security_center_services(parent: nil, page_size: nil, page_token: nil, show_eligible_modules_only: nil) + # Pass arguments to `list_security_center_services` via keyword arguments. Note that at + # least one keyword argument is 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 name of the parent to list Security Command Center services, + # in one of the following formats: + # + # * `organizations/{organization}/locations/{location}` + # * `folders/{folder}/locations/{location}` + # * `projects/{project}/locations/{location}` + # @param page_size [::Integer] + # Optional. The maximum number of results to return in a single response. + # Default is 10, minimum is 1, maximum is 1000. + # @param page_token [::String] + # Optional. A pagination token returned from a previous request. Provide this + # token to retrieve the next page of results. + # + # When paginating, the rest of the request must match the request that + # generated the page token. + # @param show_eligible_modules_only [::Boolean] + # Flag that, when set, is used to filter the module settings that are shown. + # The default setting is that all modules are shown. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Gapic::PagedEnumerable<::Google::Cloud::SecurityCenterManagement::V1::SecurityCenterService>] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Gapic::PagedEnumerable<::Google::Cloud::SecurityCenterManagement::V1::SecurityCenterService>] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/security_center_management/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::SecurityCenterManagement::V1::SecurityCenterManagement::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::SecurityCenterManagement::V1::ListSecurityCenterServicesRequest.new + # + # # Call the list_security_center_services method. + # result = client.list_security_center_services request + # + # # The returned object is of type Gapic::PagedEnumerable. You can iterate + # # over elements, and API calls will be issued to fetch pages as needed. + # result.each do |item| + # # Each element is of type ::Google::Cloud::SecurityCenterManagement::V1::SecurityCenterService. + # p item + # end + # + def list_security_center_services request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::SecurityCenterManagement::V1::ListSecurityCenterServicesRequest + + # Converts hash 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_security_center_services.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::SecurityCenterManagement::V1::VERSION + metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.parent + header_params["parent"] = request.parent + end + + request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") + metadata[:"x-goog-request-params"] ||= request_params_header + + options.apply_defaults timeout: @config.rpcs.list_security_center_services.timeout, + metadata: metadata, + retry_policy: @config.rpcs.list_security_center_services.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @security_center_management_stub.call_rpc :list_security_center_services, request, options: options do |response, operation| + response = ::Gapic::PagedEnumerable.new @security_center_management_stub, :list_security_center_services, 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 + + ## + # Updates a Security Command Center service using the given update mask. + # + # @overload update_security_center_service(request, options = nil) + # Pass arguments to `update_security_center_service` via a request object, either of type + # {::Google::Cloud::SecurityCenterManagement::V1::UpdateSecurityCenterServiceRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::SecurityCenterManagement::V1::UpdateSecurityCenterServiceRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_security_center_service(security_center_service: nil, update_mask: nil, validate_only: nil) + # Pass arguments to `update_security_center_service` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param security_center_service [::Google::Cloud::SecurityCenterManagement::V1::SecurityCenterService, ::Hash] + # Required. The updated service. + # @param update_mask [::Google::Protobuf::FieldMask, ::Hash] + # Required. The fields to update. Accepts the following values: + # + # * `intended_enablement_state` + # * `modules` + # + # If omitted, then all eligible fields are updated. + # @param validate_only [::Boolean] + # Optional. When set to `true`, the request will be validated (including IAM + # checks), but no service will be updated. An `OK` response indicates that + # the request is valid, while an error response indicates that the request is + # invalid. + # + # If the request is valid, a subsequent request to update the service could + # still fail for one of the following reasons: + # + # * The state of your cloud resources changed; for example, you lost a + # required IAM permission + # * An error occurred during update of the service + # + # Defaults to `false`. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Google::Cloud::SecurityCenterManagement::V1::SecurityCenterService] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Google::Cloud::SecurityCenterManagement::V1::SecurityCenterService] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/security_center_management/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::SecurityCenterManagement::V1::SecurityCenterManagement::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::SecurityCenterManagement::V1::UpdateSecurityCenterServiceRequest.new + # + # # Call the update_security_center_service method. + # result = client.update_security_center_service request + # + # # The returned object is of type Google::Cloud::SecurityCenterManagement::V1::SecurityCenterService. + # p result + # + def update_security_center_service request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::SecurityCenterManagement::V1::UpdateSecurityCenterServiceRequest + + # Converts hash 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_security_center_service.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::SecurityCenterManagement::V1::VERSION + metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.security_center_service&.name + header_params["security_center_service.name"] = request.security_center_service.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_security_center_service.timeout, + metadata: metadata, + retry_policy: @config.rpcs.update_security_center_service.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @security_center_management_stub.call_rpc :update_security_center_service, request, options: options do |response, operation| + yield response, operation if block_given? + end + rescue ::GRPC::BadStatus => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Configuration class for the SecurityCenterManagement API. + # + # This class represents the configuration for SecurityCenterManagement, + # providing control over timeouts, retry behavior, logging, transport + # parameters, and other low-level controls. Certain parameters can also be + # applied individually to specific RPCs. See + # {::Google::Cloud::SecurityCenterManagement::V1::SecurityCenterManagement::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_effective_security_health_analytics_custom_modules to 20 seconds, + # # and all remaining timeouts to 10 seconds. + # ::Google::Cloud::SecurityCenterManagement::V1::SecurityCenterManagement::Client.configure do |config| + # config.timeout = 10.0 + # config.rpcs.list_effective_security_health_analytics_custom_modules.timeout = 20.0 + # end + # + # # Apply the above configuration only to a new client. + # client = ::Google::Cloud::SecurityCenterManagement::V1::SecurityCenterManagement::Client.new do |config| + # config.timeout = 10.0 + # config.rpcs.list_effective_security_health_analytics_custom_modules.timeout = 20.0 + # end + # + # @!attribute [rw] endpoint + # A custom service endpoint, as a hostname or hostname:port. The default is + # nil, indicating to use the default endpoint in the current universe domain. + # @return [::String,nil] + # @!attribute [rw] credentials + # Credentials to send with calls. You may provide any of the following types: + # * (`Google::Auth::Credentials`) A googleauth credentials object + # (see the [googleauth docs](https://rubydoc.info/gems/googleauth/Google/Auth/Credentials)) + # * (`Signet::OAuth2::Client`) A signet oauth2 client object + # (see the [signet docs](https://rubydoc.info/gems/signet/Signet/OAuth2/Client)) + # * (`GRPC::Core::Channel`) a gRPC channel with included credentials + # * (`GRPC::Core::ChannelCredentials`) a gRPC credentails object + # * (`nil`) indicating no credentials + # + # @note Warning: Passing a `String` to a keyfile path or a `Hash` of credentials + # is deprecated. Providing an unvalidated credential configuration to + # Google APIs can compromise the security of your systems and data. + # + # @example + # + # # The recommended way to provide credentials is to use the `make_creds` method + # # on the appropriate credentials class for your environment. + # + # require "googleauth" + # + # credentials = ::Google::Auth::ServiceAccountCredentials.make_creds( + # json_key_io: ::File.open("/path/to/keyfile.json") + # ) + # + # client = ::Google::Cloud::SecurityCenterManagement::V1::SecurityCenterManagement::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 = "securitycentermanagement.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 SecurityCenterManagement 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_effective_security_health_analytics_custom_modules` + # @return [::Gapic::Config::Method] + # + attr_reader :list_effective_security_health_analytics_custom_modules + ## + # RPC-specific configuration for `get_effective_security_health_analytics_custom_module` + # @return [::Gapic::Config::Method] + # + attr_reader :get_effective_security_health_analytics_custom_module + ## + # RPC-specific configuration for `list_security_health_analytics_custom_modules` + # @return [::Gapic::Config::Method] + # + attr_reader :list_security_health_analytics_custom_modules + ## + # RPC-specific configuration for `list_descendant_security_health_analytics_custom_modules` + # @return [::Gapic::Config::Method] + # + attr_reader :list_descendant_security_health_analytics_custom_modules + ## + # RPC-specific configuration for `get_security_health_analytics_custom_module` + # @return [::Gapic::Config::Method] + # + attr_reader :get_security_health_analytics_custom_module + ## + # RPC-specific configuration for `create_security_health_analytics_custom_module` + # @return [::Gapic::Config::Method] + # + attr_reader :create_security_health_analytics_custom_module + ## + # RPC-specific configuration for `update_security_health_analytics_custom_module` + # @return [::Gapic::Config::Method] + # + attr_reader :update_security_health_analytics_custom_module + ## + # RPC-specific configuration for `delete_security_health_analytics_custom_module` + # @return [::Gapic::Config::Method] + # + attr_reader :delete_security_health_analytics_custom_module + ## + # RPC-specific configuration for `simulate_security_health_analytics_custom_module` + # @return [::Gapic::Config::Method] + # + attr_reader :simulate_security_health_analytics_custom_module + ## + # RPC-specific configuration for `list_effective_event_threat_detection_custom_modules` + # @return [::Gapic::Config::Method] + # + attr_reader :list_effective_event_threat_detection_custom_modules + ## + # RPC-specific configuration for `get_effective_event_threat_detection_custom_module` + # @return [::Gapic::Config::Method] + # + attr_reader :get_effective_event_threat_detection_custom_module + ## + # RPC-specific configuration for `list_event_threat_detection_custom_modules` + # @return [::Gapic::Config::Method] + # + attr_reader :list_event_threat_detection_custom_modules + ## + # RPC-specific configuration for `list_descendant_event_threat_detection_custom_modules` + # @return [::Gapic::Config::Method] + # + attr_reader :list_descendant_event_threat_detection_custom_modules + ## + # RPC-specific configuration for `get_event_threat_detection_custom_module` + # @return [::Gapic::Config::Method] + # + attr_reader :get_event_threat_detection_custom_module + ## + # RPC-specific configuration for `create_event_threat_detection_custom_module` + # @return [::Gapic::Config::Method] + # + attr_reader :create_event_threat_detection_custom_module + ## + # RPC-specific configuration for `update_event_threat_detection_custom_module` + # @return [::Gapic::Config::Method] + # + attr_reader :update_event_threat_detection_custom_module + ## + # RPC-specific configuration for `delete_event_threat_detection_custom_module` + # @return [::Gapic::Config::Method] + # + attr_reader :delete_event_threat_detection_custom_module + ## + # RPC-specific configuration for `validate_event_threat_detection_custom_module` + # @return [::Gapic::Config::Method] + # + attr_reader :validate_event_threat_detection_custom_module + ## + # RPC-specific configuration for `get_security_center_service` + # @return [::Gapic::Config::Method] + # + attr_reader :get_security_center_service + ## + # RPC-specific configuration for `list_security_center_services` + # @return [::Gapic::Config::Method] + # + attr_reader :list_security_center_services + ## + # RPC-specific configuration for `update_security_center_service` + # @return [::Gapic::Config::Method] + # + attr_reader :update_security_center_service + + # @private + def initialize parent_rpcs = nil + list_effective_security_health_analytics_custom_modules_config = parent_rpcs.list_effective_security_health_analytics_custom_modules if parent_rpcs.respond_to? :list_effective_security_health_analytics_custom_modules + @list_effective_security_health_analytics_custom_modules = ::Gapic::Config::Method.new list_effective_security_health_analytics_custom_modules_config + get_effective_security_health_analytics_custom_module_config = parent_rpcs.get_effective_security_health_analytics_custom_module if parent_rpcs.respond_to? :get_effective_security_health_analytics_custom_module + @get_effective_security_health_analytics_custom_module = ::Gapic::Config::Method.new get_effective_security_health_analytics_custom_module_config + list_security_health_analytics_custom_modules_config = parent_rpcs.list_security_health_analytics_custom_modules if parent_rpcs.respond_to? :list_security_health_analytics_custom_modules + @list_security_health_analytics_custom_modules = ::Gapic::Config::Method.new list_security_health_analytics_custom_modules_config + list_descendant_security_health_analytics_custom_modules_config = parent_rpcs.list_descendant_security_health_analytics_custom_modules if parent_rpcs.respond_to? :list_descendant_security_health_analytics_custom_modules + @list_descendant_security_health_analytics_custom_modules = ::Gapic::Config::Method.new list_descendant_security_health_analytics_custom_modules_config + get_security_health_analytics_custom_module_config = parent_rpcs.get_security_health_analytics_custom_module if parent_rpcs.respond_to? :get_security_health_analytics_custom_module + @get_security_health_analytics_custom_module = ::Gapic::Config::Method.new get_security_health_analytics_custom_module_config + create_security_health_analytics_custom_module_config = parent_rpcs.create_security_health_analytics_custom_module if parent_rpcs.respond_to? :create_security_health_analytics_custom_module + @create_security_health_analytics_custom_module = ::Gapic::Config::Method.new create_security_health_analytics_custom_module_config + update_security_health_analytics_custom_module_config = parent_rpcs.update_security_health_analytics_custom_module if parent_rpcs.respond_to? :update_security_health_analytics_custom_module + @update_security_health_analytics_custom_module = ::Gapic::Config::Method.new update_security_health_analytics_custom_module_config + delete_security_health_analytics_custom_module_config = parent_rpcs.delete_security_health_analytics_custom_module if parent_rpcs.respond_to? :delete_security_health_analytics_custom_module + @delete_security_health_analytics_custom_module = ::Gapic::Config::Method.new delete_security_health_analytics_custom_module_config + simulate_security_health_analytics_custom_module_config = parent_rpcs.simulate_security_health_analytics_custom_module if parent_rpcs.respond_to? :simulate_security_health_analytics_custom_module + @simulate_security_health_analytics_custom_module = ::Gapic::Config::Method.new simulate_security_health_analytics_custom_module_config + list_effective_event_threat_detection_custom_modules_config = parent_rpcs.list_effective_event_threat_detection_custom_modules if parent_rpcs.respond_to? :list_effective_event_threat_detection_custom_modules + @list_effective_event_threat_detection_custom_modules = ::Gapic::Config::Method.new list_effective_event_threat_detection_custom_modules_config + get_effective_event_threat_detection_custom_module_config = parent_rpcs.get_effective_event_threat_detection_custom_module if parent_rpcs.respond_to? :get_effective_event_threat_detection_custom_module + @get_effective_event_threat_detection_custom_module = ::Gapic::Config::Method.new get_effective_event_threat_detection_custom_module_config + list_event_threat_detection_custom_modules_config = parent_rpcs.list_event_threat_detection_custom_modules if parent_rpcs.respond_to? :list_event_threat_detection_custom_modules + @list_event_threat_detection_custom_modules = ::Gapic::Config::Method.new list_event_threat_detection_custom_modules_config + list_descendant_event_threat_detection_custom_modules_config = parent_rpcs.list_descendant_event_threat_detection_custom_modules if parent_rpcs.respond_to? :list_descendant_event_threat_detection_custom_modules + @list_descendant_event_threat_detection_custom_modules = ::Gapic::Config::Method.new list_descendant_event_threat_detection_custom_modules_config + get_event_threat_detection_custom_module_config = parent_rpcs.get_event_threat_detection_custom_module if parent_rpcs.respond_to? :get_event_threat_detection_custom_module + @get_event_threat_detection_custom_module = ::Gapic::Config::Method.new get_event_threat_detection_custom_module_config + create_event_threat_detection_custom_module_config = parent_rpcs.create_event_threat_detection_custom_module if parent_rpcs.respond_to? :create_event_threat_detection_custom_module + @create_event_threat_detection_custom_module = ::Gapic::Config::Method.new create_event_threat_detection_custom_module_config + update_event_threat_detection_custom_module_config = parent_rpcs.update_event_threat_detection_custom_module if parent_rpcs.respond_to? :update_event_threat_detection_custom_module + @update_event_threat_detection_custom_module = ::Gapic::Config::Method.new update_event_threat_detection_custom_module_config + delete_event_threat_detection_custom_module_config = parent_rpcs.delete_event_threat_detection_custom_module if parent_rpcs.respond_to? :delete_event_threat_detection_custom_module + @delete_event_threat_detection_custom_module = ::Gapic::Config::Method.new delete_event_threat_detection_custom_module_config + validate_event_threat_detection_custom_module_config = parent_rpcs.validate_event_threat_detection_custom_module if parent_rpcs.respond_to? :validate_event_threat_detection_custom_module + @validate_event_threat_detection_custom_module = ::Gapic::Config::Method.new validate_event_threat_detection_custom_module_config + get_security_center_service_config = parent_rpcs.get_security_center_service if parent_rpcs.respond_to? :get_security_center_service + @get_security_center_service = ::Gapic::Config::Method.new get_security_center_service_config + list_security_center_services_config = parent_rpcs.list_security_center_services if parent_rpcs.respond_to? :list_security_center_services + @list_security_center_services = ::Gapic::Config::Method.new list_security_center_services_config + update_security_center_service_config = parent_rpcs.update_security_center_service if parent_rpcs.respond_to? :update_security_center_service + @update_security_center_service = ::Gapic::Config::Method.new update_security_center_service_config + + yield self if block_given? + end + end + end + end + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-security_center_management-v1/lib/google/cloud/security_center_management/v1/security_center_management/credentials.rb b/owl-bot-staging/google-cloud-security_center_management-v1/lib/google/cloud/security_center_management/v1/security_center_management/credentials.rb new file mode 100644 index 000000000000..d03792871b08 --- /dev/null +++ b/owl-bot-staging/google-cloud-security_center_management-v1/lib/google/cloud/security_center_management/v1/security_center_management/credentials.rb @@ -0,0 +1,47 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +require "googleauth" + +module Google + module Cloud + module SecurityCenterManagement + module V1 + module SecurityCenterManagement + # Credentials for the SecurityCenterManagement API. + class Credentials < ::Google::Auth::Credentials + self.scope = [ + "https://www.googleapis.com/auth/cloud-platform" + ] + self.env_vars = [ + "GOOGLE_CLOUD_CREDENTIALS", + "GOOGLE_CLOUD_KEYFILE", + "GCLOUD_KEYFILE", + "GOOGLE_CLOUD_CREDENTIALS_JSON", + "GOOGLE_CLOUD_KEYFILE_JSON", + "GCLOUD_KEYFILE_JSON" + ] + self.paths = [ + "~/.config/google_cloud/application_default_credentials.json" + ] + end + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-security_center_management-v1/lib/google/cloud/security_center_management/v1/security_center_management/paths.rb b/owl-bot-staging/google-cloud-security_center_management-v1/lib/google/cloud/security_center_management/v1/security_center_management/paths.rb new file mode 100644 index 000000000000..614cfad55b62 --- /dev/null +++ b/owl-bot-staging/google-cloud-security_center_management-v1/lib/google/cloud/security_center_management/v1/security_center_management/paths.rb @@ -0,0 +1,374 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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 SecurityCenterManagement + module V1 + module SecurityCenterManagement + # Path helper methods for the SecurityCenterManagement API. + module Paths + ## + # Create a fully-qualified EffectiveEventThreatDetectionCustomModule resource string. + # + # @overload effective_event_threat_detection_custom_module_path(organization:, location:, effective_event_threat_detection_custom_module:) + # The resource will be in the following format: + # + # `organizations/{organization}/locations/{location}/effectiveEventThreatDetectionCustomModules/{effective_event_threat_detection_custom_module}` + # + # @param organization [String] + # @param location [String] + # @param effective_event_threat_detection_custom_module [String] + # + # @overload effective_event_threat_detection_custom_module_path(project:, location:, effective_event_threat_detection_custom_module:) + # The resource will be in the following format: + # + # `projects/{project}/locations/{location}/effectiveEventThreatDetectionCustomModules/{effective_event_threat_detection_custom_module}` + # + # @param project [String] + # @param location [String] + # @param effective_event_threat_detection_custom_module [String] + # + # @overload effective_event_threat_detection_custom_module_path(folder:, location:, effective_event_threat_detection_custom_module:) + # The resource will be in the following format: + # + # `folders/{folder}/locations/{location}/effectiveEventThreatDetectionCustomModules/{effective_event_threat_detection_custom_module}` + # + # @param folder [String] + # @param location [String] + # @param effective_event_threat_detection_custom_module [String] + # + # @return [::String] + def effective_event_threat_detection_custom_module_path **args + resources = { + "effective_event_threat_detection_custom_module:location:organization" => (proc do |organization:, location:, effective_event_threat_detection_custom_module:| + raise ::ArgumentError, "organization cannot contain /" if organization.to_s.include? "/" + raise ::ArgumentError, "location cannot contain /" if location.to_s.include? "/" + + "organizations/#{organization}/locations/#{location}/effectiveEventThreatDetectionCustomModules/#{effective_event_threat_detection_custom_module}" + end), + "effective_event_threat_detection_custom_module:location:project" => (proc do |project:, location:, effective_event_threat_detection_custom_module:| + raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" + raise ::ArgumentError, "location cannot contain /" if location.to_s.include? "/" + + "projects/#{project}/locations/#{location}/effectiveEventThreatDetectionCustomModules/#{effective_event_threat_detection_custom_module}" + end), + "effective_event_threat_detection_custom_module:folder:location" => (proc do |folder:, location:, effective_event_threat_detection_custom_module:| + raise ::ArgumentError, "folder cannot contain /" if folder.to_s.include? "/" + raise ::ArgumentError, "location cannot contain /" if location.to_s.include? "/" + + "folders/#{folder}/locations/#{location}/effectiveEventThreatDetectionCustomModules/#{effective_event_threat_detection_custom_module}" + 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 EffectiveSecurityHealthAnalyticsCustomModule resource string. + # + # @overload effective_security_health_analytics_custom_module_path(organization:, location:, effective_security_health_analytics_custom_module:) + # The resource will be in the following format: + # + # `organizations/{organization}/locations/{location}/effectiveSecurityHealthAnalyticsCustomModules/{effective_security_health_analytics_custom_module}` + # + # @param organization [String] + # @param location [String] + # @param effective_security_health_analytics_custom_module [String] + # + # @overload effective_security_health_analytics_custom_module_path(project:, location:, effective_security_health_analytics_custom_module:) + # The resource will be in the following format: + # + # `projects/{project}/locations/{location}/effectiveSecurityHealthAnalyticsCustomModules/{effective_security_health_analytics_custom_module}` + # + # @param project [String] + # @param location [String] + # @param effective_security_health_analytics_custom_module [String] + # + # @overload effective_security_health_analytics_custom_module_path(folder:, location:, effective_security_health_analytics_custom_module:) + # The resource will be in the following format: + # + # `folders/{folder}/locations/{location}/effectiveSecurityHealthAnalyticsCustomModules/{effective_security_health_analytics_custom_module}` + # + # @param folder [String] + # @param location [String] + # @param effective_security_health_analytics_custom_module [String] + # + # @return [::String] + def effective_security_health_analytics_custom_module_path **args + resources = { + "effective_security_health_analytics_custom_module:location:organization" => (proc do |organization:, location:, effective_security_health_analytics_custom_module:| + raise ::ArgumentError, "organization cannot contain /" if organization.to_s.include? "/" + raise ::ArgumentError, "location cannot contain /" if location.to_s.include? "/" + + "organizations/#{organization}/locations/#{location}/effectiveSecurityHealthAnalyticsCustomModules/#{effective_security_health_analytics_custom_module}" + end), + "effective_security_health_analytics_custom_module:location:project" => (proc do |project:, location:, effective_security_health_analytics_custom_module:| + raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" + raise ::ArgumentError, "location cannot contain /" if location.to_s.include? "/" + + "projects/#{project}/locations/#{location}/effectiveSecurityHealthAnalyticsCustomModules/#{effective_security_health_analytics_custom_module}" + end), + "effective_security_health_analytics_custom_module:folder:location" => (proc do |folder:, location:, effective_security_health_analytics_custom_module:| + raise ::ArgumentError, "folder cannot contain /" if folder.to_s.include? "/" + raise ::ArgumentError, "location cannot contain /" if location.to_s.include? "/" + + "folders/#{folder}/locations/#{location}/effectiveSecurityHealthAnalyticsCustomModules/#{effective_security_health_analytics_custom_module}" + 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 EventThreatDetectionCustomModule resource string. + # + # @overload event_threat_detection_custom_module_path(organization:, location:, event_threat_detection_custom_module:) + # The resource will be in the following format: + # + # `organizations/{organization}/locations/{location}/eventThreatDetectionCustomModules/{event_threat_detection_custom_module}` + # + # @param organization [String] + # @param location [String] + # @param event_threat_detection_custom_module [String] + # + # @overload event_threat_detection_custom_module_path(project:, location:, event_threat_detection_custom_module:) + # The resource will be in the following format: + # + # `projects/{project}/locations/{location}/eventThreatDetectionCustomModules/{event_threat_detection_custom_module}` + # + # @param project [String] + # @param location [String] + # @param event_threat_detection_custom_module [String] + # + # @overload event_threat_detection_custom_module_path(folder:, location:, event_threat_detection_custom_module:) + # The resource will be in the following format: + # + # `folders/{folder}/locations/{location}/eventThreatDetectionCustomModules/{event_threat_detection_custom_module}` + # + # @param folder [String] + # @param location [String] + # @param event_threat_detection_custom_module [String] + # + # @return [::String] + def event_threat_detection_custom_module_path **args + resources = { + "event_threat_detection_custom_module:location:organization" => (proc do |organization:, location:, event_threat_detection_custom_module:| + raise ::ArgumentError, "organization cannot contain /" if organization.to_s.include? "/" + raise ::ArgumentError, "location cannot contain /" if location.to_s.include? "/" + + "organizations/#{organization}/locations/#{location}/eventThreatDetectionCustomModules/#{event_threat_detection_custom_module}" + end), + "event_threat_detection_custom_module:location:project" => (proc do |project:, location:, event_threat_detection_custom_module:| + raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" + raise ::ArgumentError, "location cannot contain /" if location.to_s.include? "/" + + "projects/#{project}/locations/#{location}/eventThreatDetectionCustomModules/#{event_threat_detection_custom_module}" + end), + "event_threat_detection_custom_module:folder:location" => (proc do |folder:, location:, event_threat_detection_custom_module:| + raise ::ArgumentError, "folder cannot contain /" if folder.to_s.include? "/" + raise ::ArgumentError, "location cannot contain /" if location.to_s.include? "/" + + "folders/#{folder}/locations/#{location}/eventThreatDetectionCustomModules/#{event_threat_detection_custom_module}" + 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 + + ## + # Create a fully-qualified SecurityCenterService resource string. + # + # @overload security_center_service_path(project:, location:, service:) + # The resource will be in the following format: + # + # `projects/{project}/locations/{location}/securityCenterServices/{service}` + # + # @param project [String] + # @param location [String] + # @param service [String] + # + # @overload security_center_service_path(folder:, location:, service:) + # The resource will be in the following format: + # + # `folders/{folder}/locations/{location}/securityCenterServices/{service}` + # + # @param folder [String] + # @param location [String] + # @param service [String] + # + # @overload security_center_service_path(organization:, location:, service:) + # The resource will be in the following format: + # + # `organizations/{organization}/locations/{location}/securityCenterServices/{service}` + # + # @param organization [String] + # @param location [String] + # @param service [String] + # + # @return [::String] + def security_center_service_path **args + resources = { + "location:project:service" => (proc do |project:, location:, service:| + raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" + raise ::ArgumentError, "location cannot contain /" if location.to_s.include? "/" + + "projects/#{project}/locations/#{location}/securityCenterServices/#{service}" + end), + "folder:location:service" => (proc do |folder:, location:, service:| + raise ::ArgumentError, "folder cannot contain /" if folder.to_s.include? "/" + raise ::ArgumentError, "location cannot contain /" if location.to_s.include? "/" + + "folders/#{folder}/locations/#{location}/securityCenterServices/#{service}" + end), + "location:organization:service" => (proc do |organization:, location:, service:| + raise ::ArgumentError, "organization cannot contain /" if organization.to_s.include? "/" + raise ::ArgumentError, "location cannot contain /" if location.to_s.include? "/" + + "organizations/#{organization}/locations/#{location}/securityCenterServices/#{service}" + 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 SecurityHealthAnalyticsCustomModule resource string. + # + # @overload security_health_analytics_custom_module_path(organization:, location:, security_health_analytics_custom_module:) + # The resource will be in the following format: + # + # `organizations/{organization}/locations/{location}/securityHealthAnalyticsCustomModules/{security_health_analytics_custom_module}` + # + # @param organization [String] + # @param location [String] + # @param security_health_analytics_custom_module [String] + # + # @overload security_health_analytics_custom_module_path(project:, location:, security_health_analytics_custom_module:) + # The resource will be in the following format: + # + # `projects/{project}/locations/{location}/securityHealthAnalyticsCustomModules/{security_health_analytics_custom_module}` + # + # @param project [String] + # @param location [String] + # @param security_health_analytics_custom_module [String] + # + # @overload security_health_analytics_custom_module_path(folder:, location:, security_health_analytics_custom_module:) + # The resource will be in the following format: + # + # `folders/{folder}/locations/{location}/securityHealthAnalyticsCustomModules/{security_health_analytics_custom_module}` + # + # @param folder [String] + # @param location [String] + # @param security_health_analytics_custom_module [String] + # + # @return [::String] + def security_health_analytics_custom_module_path **args + resources = { + "location:organization:security_health_analytics_custom_module" => (proc do |organization:, location:, security_health_analytics_custom_module:| + raise ::ArgumentError, "organization cannot contain /" if organization.to_s.include? "/" + raise ::ArgumentError, "location cannot contain /" if location.to_s.include? "/" + + "organizations/#{organization}/locations/#{location}/securityHealthAnalyticsCustomModules/#{security_health_analytics_custom_module}" + end), + "location:project:security_health_analytics_custom_module" => (proc do |project:, location:, security_health_analytics_custom_module:| + raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" + raise ::ArgumentError, "location cannot contain /" if location.to_s.include? "/" + + "projects/#{project}/locations/#{location}/securityHealthAnalyticsCustomModules/#{security_health_analytics_custom_module}" + end), + "folder:location:security_health_analytics_custom_module" => (proc do |folder:, location:, security_health_analytics_custom_module:| + raise ::ArgumentError, "folder cannot contain /" if folder.to_s.include? "/" + raise ::ArgumentError, "location cannot contain /" if location.to_s.include? "/" + + "folders/#{folder}/locations/#{location}/securityHealthAnalyticsCustomModules/#{security_health_analytics_custom_module}" + 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 +end diff --git a/owl-bot-staging/google-cloud-security_center_management-v1/lib/google/cloud/security_center_management/v1/security_center_management/rest.rb b/owl-bot-staging/google-cloud-security_center_management-v1/lib/google/cloud/security_center_management/v1/security_center_management/rest.rb new file mode 100644 index 000000000000..2451529ae88b --- /dev/null +++ b/owl-bot-staging/google-cloud-security_center_management-v1/lib/google/cloud/security_center_management/v1/security_center_management/rest.rb @@ -0,0 +1,53 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +require "gapic/rest" +require "gapic/config" +require "gapic/config/method" + +require "google/cloud/security_center_management/v1/version" +require "google/cloud/security_center_management/v1/bindings_override" + +require "google/cloud/security_center_management/v1/security_center_management/credentials" +require "google/cloud/security_center_management/v1/security_center_management/paths" +require "google/cloud/security_center_management/v1/security_center_management/rest/client" + +module Google + module Cloud + module SecurityCenterManagement + module V1 + ## + # Service describing handlers for resources + # + # To load this service and instantiate a REST client: + # + # require "google/cloud/security_center_management/v1/security_center_management/rest" + # client = ::Google::Cloud::SecurityCenterManagement::V1::SecurityCenterManagement::Rest::Client.new + # + module SecurityCenterManagement + # Client for the REST transport + module Rest + end + end + end + end + end +end + +helper_path = ::File.join __dir__, "rest", "helpers.rb" +require "google/cloud/security_center_management/v1/security_center_management/rest/helpers" if ::File.file? helper_path diff --git a/owl-bot-staging/google-cloud-security_center_management-v1/lib/google/cloud/security_center_management/v1/security_center_management/rest/client.rb b/owl-bot-staging/google-cloud-security_center_management-v1/lib/google/cloud/security_center_management/v1/security_center_management/rest/client.rb new file mode 100644 index 000000000000..6dd8e13223c3 --- /dev/null +++ b/owl-bot-staging/google-cloud-security_center_management-v1/lib/google/cloud/security_center_management/v1/security_center_management/rest/client.rb @@ -0,0 +1,2608 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +require "google/cloud/errors" +require "google/cloud/securitycentermanagement/v1/security_center_management_pb" +require "google/cloud/security_center_management/v1/security_center_management/rest/service_stub" +require "google/cloud/location/rest" + +module Google + module Cloud + module SecurityCenterManagement + module V1 + module SecurityCenterManagement + module Rest + ## + # REST client for the SecurityCenterManagement service. + # + # Service describing handlers for resources + # + class Client + # @private + API_VERSION = "" + + # @private + DEFAULT_ENDPOINT_TEMPLATE = "securitycentermanagement.$UNIVERSE_DOMAIN$" + + include Paths + + # @private + attr_reader :security_center_management_stub + + ## + # Configure the SecurityCenterManagement Client class. + # + # See {::Google::Cloud::SecurityCenterManagement::V1::SecurityCenterManagement::Rest::Client::Configuration} + # for a description of the configuration fields. + # + # @example + # + # # Modify the configuration for all SecurityCenterManagement clients + # ::Google::Cloud::SecurityCenterManagement::V1::SecurityCenterManagement::Rest::Client.configure do |config| + # config.timeout = 10.0 + # end + # + # @yield [config] Configure the Client client. + # @yieldparam config [Client::Configuration] + # + # @return [Client::Configuration] + # + def self.configure + @configure ||= begin + namespace = ["Google", "Cloud", "SecurityCenterManagement", "V1"] + parent_config = while namespace.any? + parent_name = namespace.join "::" + parent_const = const_get parent_name + break parent_const.configure if parent_const.respond_to? :configure + namespace.pop + end + default_config = Client::Configuration.new parent_config + + default_config.rpcs.list_effective_security_health_analytics_custom_modules.timeout = 60.0 + default_config.rpcs.list_effective_security_health_analytics_custom_modules.retry_policy = { + initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [14, 4] + } + + default_config.rpcs.get_effective_security_health_analytics_custom_module.timeout = 60.0 + default_config.rpcs.get_effective_security_health_analytics_custom_module.retry_policy = { + initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [14, 4] + } + + default_config.rpcs.list_security_health_analytics_custom_modules.timeout = 60.0 + default_config.rpcs.list_security_health_analytics_custom_modules.retry_policy = { + initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [14, 4] + } + + default_config.rpcs.list_descendant_security_health_analytics_custom_modules.timeout = 60.0 + default_config.rpcs.list_descendant_security_health_analytics_custom_modules.retry_policy = { + initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [14, 4] + } + + default_config.rpcs.get_security_health_analytics_custom_module.timeout = 60.0 + default_config.rpcs.get_security_health_analytics_custom_module.retry_policy = { + initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [14, 4] + } + + default_config.rpcs.create_security_health_analytics_custom_module.timeout = 60.0 + + default_config.rpcs.update_security_health_analytics_custom_module.timeout = 60.0 + + default_config.rpcs.delete_security_health_analytics_custom_module.timeout = 60.0 + + default_config.rpcs.simulate_security_health_analytics_custom_module.timeout = 60.0 + default_config.rpcs.simulate_security_health_analytics_custom_module.retry_policy = { + initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [14, 4] + } + + default_config.rpcs.list_effective_event_threat_detection_custom_modules.timeout = 60.0 + default_config.rpcs.list_effective_event_threat_detection_custom_modules.retry_policy = { + initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [14, 4] + } + + default_config.rpcs.get_effective_event_threat_detection_custom_module.timeout = 60.0 + default_config.rpcs.get_effective_event_threat_detection_custom_module.retry_policy = { + initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [14, 4] + } + + default_config.rpcs.list_event_threat_detection_custom_modules.timeout = 60.0 + default_config.rpcs.list_event_threat_detection_custom_modules.retry_policy = { + initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [14, 4] + } + + default_config.rpcs.list_descendant_event_threat_detection_custom_modules.timeout = 60.0 + default_config.rpcs.list_descendant_event_threat_detection_custom_modules.retry_policy = { + initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [14, 4] + } + + default_config.rpcs.get_event_threat_detection_custom_module.timeout = 60.0 + default_config.rpcs.get_event_threat_detection_custom_module.retry_policy = { + initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [14, 4] + } + + default_config.rpcs.create_event_threat_detection_custom_module.timeout = 60.0 + + default_config.rpcs.update_event_threat_detection_custom_module.timeout = 60.0 + + default_config.rpcs.delete_event_threat_detection_custom_module.timeout = 60.0 + + default_config.rpcs.validate_event_threat_detection_custom_module.timeout = 60.0 + default_config.rpcs.validate_event_threat_detection_custom_module.retry_policy = { + initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [14, 4] + } + + default_config + end + yield @configure if block_given? + @configure + end + + ## + # Configure the SecurityCenterManagement Client instance. + # + # The configuration is set to the derived mode, meaning that values can be changed, + # but structural changes (adding new fields, etc.) are not allowed. Structural changes + # should be made on {Client.configure}. + # + # See {::Google::Cloud::SecurityCenterManagement::V1::SecurityCenterManagement::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 + @security_center_management_stub.universe_domain + end + + ## + # Create a new SecurityCenterManagement REST client object. + # + # @example + # + # # Create a client using the default configuration + # client = ::Google::Cloud::SecurityCenterManagement::V1::SecurityCenterManagement::Rest::Client.new + # + # # Create a client using a custom configuration + # client = ::Google::Cloud::SecurityCenterManagement::V1::SecurityCenterManagement::Rest::Client.new do |config| + # config.timeout = 10.0 + # end + # + # @yield [config] Configure the SecurityCenterManagement 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 + + @security_center_management_stub = ::Google::Cloud::SecurityCenterManagement::V1::SecurityCenterManagement::Rest::ServiceStub.new( + endpoint: @config.endpoint, + endpoint_template: DEFAULT_ENDPOINT_TEMPLATE, + universe_domain: @config.universe_domain, + credentials: credentials, + logger: @config.logger + ) + + @security_center_management_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 = @security_center_management_stub.endpoint + config.universe_domain = @security_center_management_stub.universe_domain + config.bindings_override = @config.bindings_override + config.logger = @security_center_management_stub.logger if config.respond_to? :logger= + end + end + + ## + # Get the associated client for mix-in of the Locations. + # + # @return [Google::Cloud::Location::Locations::Rest::Client] + # + attr_reader :location_client + + ## + # The logger used for request/response debug logging. + # + # @return [Logger] + # + def logger + @security_center_management_stub.logger + end + + # Service calls + + ## + # Returns a list of all + # {::Google::Cloud::SecurityCenterManagement::V1::EffectiveSecurityHealthAnalyticsCustomModule EffectiveSecurityHealthAnalyticsCustomModule} + # resources for the given parent. This includes resident modules defined at + # the scope of the parent, and inherited modules, inherited from ancestor + # organizations, folders, and projects (no descendants). + # + # @overload list_effective_security_health_analytics_custom_modules(request, options = nil) + # Pass arguments to `list_effective_security_health_analytics_custom_modules` via a request object, either of type + # {::Google::Cloud::SecurityCenterManagement::V1::ListEffectiveSecurityHealthAnalyticsCustomModulesRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::SecurityCenterManagement::V1::ListEffectiveSecurityHealthAnalyticsCustomModulesRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_effective_security_health_analytics_custom_modules(parent: nil, page_size: nil, page_token: nil) + # Pass arguments to `list_effective_security_health_analytics_custom_modules` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param parent [::String] + # Required. Name of parent to list effective custom modules, in one of the + # following formats: + # + # * `organizations/{organization}/locations/{location}` + # * `folders/{folder}/locations/{location}` + # * `projects/{project}/locations/{location}` + # @param page_size [::Integer] + # Optional. The maximum number of results to return in a single response. + # Default is 10, minimum is 1, maximum is 1000. + # @param page_token [::String] + # Optional. A pagination token returned from a previous request. Provide this + # token to retrieve the next page of results. + # + # When paginating, the rest of the request must match the request that + # generated the page token. + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Gapic::Rest::PagedEnumerable<::Google::Cloud::SecurityCenterManagement::V1::EffectiveSecurityHealthAnalyticsCustomModule>] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Gapic::Rest::PagedEnumerable<::Google::Cloud::SecurityCenterManagement::V1::EffectiveSecurityHealthAnalyticsCustomModule>] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/security_center_management/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::SecurityCenterManagement::V1::SecurityCenterManagement::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::SecurityCenterManagement::V1::ListEffectiveSecurityHealthAnalyticsCustomModulesRequest.new + # + # # Call the list_effective_security_health_analytics_custom_modules method. + # result = client.list_effective_security_health_analytics_custom_modules request + # + # # The returned object is of type Gapic::PagedEnumerable. You can iterate + # # over elements, and API calls will be issued to fetch pages as needed. + # result.each do |item| + # # Each element is of type ::Google::Cloud::SecurityCenterManagement::V1::EffectiveSecurityHealthAnalyticsCustomModule. + # p item + # end + # + def list_effective_security_health_analytics_custom_modules request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::SecurityCenterManagement::V1::ListEffectiveSecurityHealthAnalyticsCustomModulesRequest + + # Converts hash 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_effective_security_health_analytics_custom_modules.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::SecurityCenterManagement::V1::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + options.apply_defaults timeout: @config.rpcs.list_effective_security_health_analytics_custom_modules.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.list_effective_security_health_analytics_custom_modules.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @security_center_management_stub.list_effective_security_health_analytics_custom_modules request, options do |result, operation| + result = ::Gapic::Rest::PagedEnumerable.new @security_center_management_stub, :list_effective_security_health_analytics_custom_modules, "effective_security_health_analytics_custom_modules", 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 details of a single + # {::Google::Cloud::SecurityCenterManagement::V1::EffectiveSecurityHealthAnalyticsCustomModule EffectiveSecurityHealthAnalyticsCustomModule}. + # + # @overload get_effective_security_health_analytics_custom_module(request, options = nil) + # Pass arguments to `get_effective_security_health_analytics_custom_module` via a request object, either of type + # {::Google::Cloud::SecurityCenterManagement::V1::GetEffectiveSecurityHealthAnalyticsCustomModuleRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::SecurityCenterManagement::V1::GetEffectiveSecurityHealthAnalyticsCustomModuleRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_effective_security_health_analytics_custom_module(name: nil) + # Pass arguments to `get_effective_security_health_analytics_custom_module` via keyword arguments. Note that at + # least one keyword argument is 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 full resource name of the custom module, specified in one of + # the following formats: + # + # * `organizations/organization/{location}/effectiveSecurityHealthAnalyticsCustomModules/{custom_module}` + # * `folders/folder/{location}/effectiveSecurityHealthAnalyticsCustomModules/{custom_module}` + # * `projects/project/{location}/effectiveSecurityHealthAnalyticsCustomModules/{custom_module}` + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Cloud::SecurityCenterManagement::V1::EffectiveSecurityHealthAnalyticsCustomModule] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::SecurityCenterManagement::V1::EffectiveSecurityHealthAnalyticsCustomModule] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/security_center_management/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::SecurityCenterManagement::V1::SecurityCenterManagement::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::SecurityCenterManagement::V1::GetEffectiveSecurityHealthAnalyticsCustomModuleRequest.new + # + # # Call the get_effective_security_health_analytics_custom_module method. + # result = client.get_effective_security_health_analytics_custom_module request + # + # # The returned object is of type Google::Cloud::SecurityCenterManagement::V1::EffectiveSecurityHealthAnalyticsCustomModule. + # p result + # + def get_effective_security_health_analytics_custom_module request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::SecurityCenterManagement::V1::GetEffectiveSecurityHealthAnalyticsCustomModuleRequest + + # Converts hash 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_effective_security_health_analytics_custom_module.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::SecurityCenterManagement::V1::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + options.apply_defaults timeout: @config.rpcs.get_effective_security_health_analytics_custom_module.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.get_effective_security_health_analytics_custom_module.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @security_center_management_stub.get_effective_security_health_analytics_custom_module request, options do |result, operation| + yield result, operation if block_given? + end + rescue ::Gapic::Rest::Error => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Returns a list of all + # {::Google::Cloud::SecurityCenterManagement::V1::SecurityHealthAnalyticsCustomModule SecurityHealthAnalyticsCustomModule} + # resources for the given parent. This includes resident modules defined at + # the scope of the parent, and inherited modules, inherited from ancestor + # organizations, folders, and projects (no descendants). + # + # @overload list_security_health_analytics_custom_modules(request, options = nil) + # Pass arguments to `list_security_health_analytics_custom_modules` via a request object, either of type + # {::Google::Cloud::SecurityCenterManagement::V1::ListSecurityHealthAnalyticsCustomModulesRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::SecurityCenterManagement::V1::ListSecurityHealthAnalyticsCustomModulesRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_security_health_analytics_custom_modules(parent: nil, page_size: nil, page_token: nil) + # Pass arguments to `list_security_health_analytics_custom_modules` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param parent [::String] + # Required. Name of the parent organization, folder, or project in which to + # list custom modules, in one of the following formats: + # + # * `organizations/{organization}/locations/{location}` + # * `folders/{folder}/locations/{location}` + # * `projects/{project}/locations/{location}` + # @param page_size [::Integer] + # Optional. The maximum number of results to return in a single response. + # Default is 10, minimum is 1, maximum is 1000. + # @param page_token [::String] + # Optional. A pagination token returned from a previous request. Provide this + # token to retrieve the next page of results. + # + # When paginating, the rest of the request must match the request that + # generated the page token. + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Gapic::Rest::PagedEnumerable<::Google::Cloud::SecurityCenterManagement::V1::SecurityHealthAnalyticsCustomModule>] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Gapic::Rest::PagedEnumerable<::Google::Cloud::SecurityCenterManagement::V1::SecurityHealthAnalyticsCustomModule>] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/security_center_management/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::SecurityCenterManagement::V1::SecurityCenterManagement::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::SecurityCenterManagement::V1::ListSecurityHealthAnalyticsCustomModulesRequest.new + # + # # Call the list_security_health_analytics_custom_modules method. + # result = client.list_security_health_analytics_custom_modules request + # + # # The returned object is of type Gapic::PagedEnumerable. You can iterate + # # over elements, and API calls will be issued to fetch pages as needed. + # result.each do |item| + # # Each element is of type ::Google::Cloud::SecurityCenterManagement::V1::SecurityHealthAnalyticsCustomModule. + # p item + # end + # + def list_security_health_analytics_custom_modules request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::SecurityCenterManagement::V1::ListSecurityHealthAnalyticsCustomModulesRequest + + # Converts hash 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_security_health_analytics_custom_modules.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::SecurityCenterManagement::V1::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + options.apply_defaults timeout: @config.rpcs.list_security_health_analytics_custom_modules.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.list_security_health_analytics_custom_modules.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @security_center_management_stub.list_security_health_analytics_custom_modules request, options do |result, operation| + result = ::Gapic::Rest::PagedEnumerable.new @security_center_management_stub, :list_security_health_analytics_custom_modules, "security_health_analytics_custom_modules", 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 a list of all resident + # {::Google::Cloud::SecurityCenterManagement::V1::SecurityHealthAnalyticsCustomModule SecurityHealthAnalyticsCustomModule} + # resources under the given organization, folder, or project and all of its + # descendants. + # + # @overload list_descendant_security_health_analytics_custom_modules(request, options = nil) + # Pass arguments to `list_descendant_security_health_analytics_custom_modules` via a request object, either of type + # {::Google::Cloud::SecurityCenterManagement::V1::ListDescendantSecurityHealthAnalyticsCustomModulesRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::SecurityCenterManagement::V1::ListDescendantSecurityHealthAnalyticsCustomModulesRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_descendant_security_health_analytics_custom_modules(parent: nil, page_size: nil, page_token: nil) + # Pass arguments to `list_descendant_security_health_analytics_custom_modules` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param parent [::String] + # Required. Name of the parent organization, folder, or project in which to + # list custom modules, in one of the following formats: + # + # * `organizations/{organization}/locations/{location}` + # * `folders/{folder}/locations/{location}` + # * `projects/{project}/locations/{location}` + # @param page_size [::Integer] + # Optional. The maximum number of results to return in a single response. + # Default is 10, minimum is 1, maximum is 1000. + # @param page_token [::String] + # Optional. A pagination token returned from a previous request. Provide this + # token to retrieve the next page of results. + # + # When paginating, the rest of the request must match the request that + # generated the page token. + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Gapic::Rest::PagedEnumerable<::Google::Cloud::SecurityCenterManagement::V1::SecurityHealthAnalyticsCustomModule>] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Gapic::Rest::PagedEnumerable<::Google::Cloud::SecurityCenterManagement::V1::SecurityHealthAnalyticsCustomModule>] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/security_center_management/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::SecurityCenterManagement::V1::SecurityCenterManagement::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::SecurityCenterManagement::V1::ListDescendantSecurityHealthAnalyticsCustomModulesRequest.new + # + # # Call the list_descendant_security_health_analytics_custom_modules method. + # result = client.list_descendant_security_health_analytics_custom_modules request + # + # # The returned object is of type Gapic::PagedEnumerable. You can iterate + # # over elements, and API calls will be issued to fetch pages as needed. + # result.each do |item| + # # Each element is of type ::Google::Cloud::SecurityCenterManagement::V1::SecurityHealthAnalyticsCustomModule. + # p item + # end + # + def list_descendant_security_health_analytics_custom_modules request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::SecurityCenterManagement::V1::ListDescendantSecurityHealthAnalyticsCustomModulesRequest + + # Converts hash 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_descendant_security_health_analytics_custom_modules.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::SecurityCenterManagement::V1::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + options.apply_defaults timeout: @config.rpcs.list_descendant_security_health_analytics_custom_modules.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.list_descendant_security_health_analytics_custom_modules.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @security_center_management_stub.list_descendant_security_health_analytics_custom_modules request, options do |result, operation| + result = ::Gapic::Rest::PagedEnumerable.new @security_center_management_stub, :list_descendant_security_health_analytics_custom_modules, "security_health_analytics_custom_modules", 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 + + ## + # Retrieves a + # {::Google::Cloud::SecurityCenterManagement::V1::SecurityHealthAnalyticsCustomModule SecurityHealthAnalyticsCustomModule}. + # + # @overload get_security_health_analytics_custom_module(request, options = nil) + # Pass arguments to `get_security_health_analytics_custom_module` via a request object, either of type + # {::Google::Cloud::SecurityCenterManagement::V1::GetSecurityHealthAnalyticsCustomModuleRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::SecurityCenterManagement::V1::GetSecurityHealthAnalyticsCustomModuleRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_security_health_analytics_custom_module(name: nil) + # Pass arguments to `get_security_health_analytics_custom_module` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param name [::String] + # Required. Name of the resource, in the format + # `projects/{project}/locations/{location}/securityHealthAnalyticsCustomModules/{custom_module}`. + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Cloud::SecurityCenterManagement::V1::SecurityHealthAnalyticsCustomModule] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::SecurityCenterManagement::V1::SecurityHealthAnalyticsCustomModule] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/security_center_management/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::SecurityCenterManagement::V1::SecurityCenterManagement::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::SecurityCenterManagement::V1::GetSecurityHealthAnalyticsCustomModuleRequest.new + # + # # Call the get_security_health_analytics_custom_module method. + # result = client.get_security_health_analytics_custom_module request + # + # # The returned object is of type Google::Cloud::SecurityCenterManagement::V1::SecurityHealthAnalyticsCustomModule. + # p result + # + def get_security_health_analytics_custom_module request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::SecurityCenterManagement::V1::GetSecurityHealthAnalyticsCustomModuleRequest + + # Converts hash 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_security_health_analytics_custom_module.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::SecurityCenterManagement::V1::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + options.apply_defaults timeout: @config.rpcs.get_security_health_analytics_custom_module.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.get_security_health_analytics_custom_module.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @security_center_management_stub.get_security_health_analytics_custom_module request, options do |result, operation| + yield result, operation if block_given? + end + rescue ::Gapic::Rest::Error => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Creates a resident + # {::Google::Cloud::SecurityCenterManagement::V1::SecurityHealthAnalyticsCustomModule SecurityHealthAnalyticsCustomModule} + # at the scope of the given organization, folder, or project, and also + # creates inherited `SecurityHealthAnalyticsCustomModule` resources for all + # folders and projects that are descendants of the given parent. These + # modules are enabled by default. + # + # @overload create_security_health_analytics_custom_module(request, options = nil) + # Pass arguments to `create_security_health_analytics_custom_module` via a request object, either of type + # {::Google::Cloud::SecurityCenterManagement::V1::CreateSecurityHealthAnalyticsCustomModuleRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::SecurityCenterManagement::V1::CreateSecurityHealthAnalyticsCustomModuleRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_security_health_analytics_custom_module(parent: nil, security_health_analytics_custom_module: nil, validate_only: nil) + # Pass arguments to `create_security_health_analytics_custom_module` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param parent [::String] + # Required. Name of the parent organization, folder, or project of the + # module, in one of the following formats: + # + # * `organizations/{organization}/locations/{location}` + # * `folders/{folder}/locations/{location}` + # * `projects/{project}/locations/{location}` + # @param security_health_analytics_custom_module [::Google::Cloud::SecurityCenterManagement::V1::SecurityHealthAnalyticsCustomModule, ::Hash] + # Required. The resource being created. + # @param validate_only [::Boolean] + # Optional. When set to `true`, the request will be validated (including IAM + # checks), but no module will be created. An `OK` response indicates that the + # request is valid, while an error response indicates that the request is + # invalid. + # + # If the request is valid, a subsequent request to create the module could + # still fail for one of the following reasons: + # + # * The state of your cloud resources changed; for example, you lost a + # required IAM permission + # * An error occurred during creation of the module + # + # Defaults to `false`. + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Cloud::SecurityCenterManagement::V1::SecurityHealthAnalyticsCustomModule] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::SecurityCenterManagement::V1::SecurityHealthAnalyticsCustomModule] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/security_center_management/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::SecurityCenterManagement::V1::SecurityCenterManagement::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::SecurityCenterManagement::V1::CreateSecurityHealthAnalyticsCustomModuleRequest.new + # + # # Call the create_security_health_analytics_custom_module method. + # result = client.create_security_health_analytics_custom_module request + # + # # The returned object is of type Google::Cloud::SecurityCenterManagement::V1::SecurityHealthAnalyticsCustomModule. + # p result + # + def create_security_health_analytics_custom_module request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::SecurityCenterManagement::V1::CreateSecurityHealthAnalyticsCustomModuleRequest + + # Converts hash 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_security_health_analytics_custom_module.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::SecurityCenterManagement::V1::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + options.apply_defaults timeout: @config.rpcs.create_security_health_analytics_custom_module.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.create_security_health_analytics_custom_module.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @security_center_management_stub.create_security_health_analytics_custom_module request, options do |result, operation| + yield result, operation if block_given? + end + rescue ::Gapic::Rest::Error => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Updates the + # {::Google::Cloud::SecurityCenterManagement::V1::SecurityHealthAnalyticsCustomModule SecurityHealthAnalyticsCustomModule} + # under the given name based on the given update mask. Updating the + # enablement state is supported on both resident and inherited modules + # (though resident modules cannot have an enablement state of "inherited"). + # Updating the display name and custom configuration of a module is supported + # on resident modules only. + # + # @overload update_security_health_analytics_custom_module(request, options = nil) + # Pass arguments to `update_security_health_analytics_custom_module` via a request object, either of type + # {::Google::Cloud::SecurityCenterManagement::V1::UpdateSecurityHealthAnalyticsCustomModuleRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::SecurityCenterManagement::V1::UpdateSecurityHealthAnalyticsCustomModuleRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_security_health_analytics_custom_module(update_mask: nil, security_health_analytics_custom_module: nil, validate_only: nil) + # Pass arguments to `update_security_health_analytics_custom_module` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param update_mask [::Google::Protobuf::FieldMask, ::Hash] + # Required. The fields to update. The following values are valid: + # + # * `custom_config` + # * `enablement_state` + # + # If you omit this field or set it to the wildcard value `*`, then all + # eligible fields are updated. + # @param security_health_analytics_custom_module [::Google::Cloud::SecurityCenterManagement::V1::SecurityHealthAnalyticsCustomModule, ::Hash] + # Required. The resource being updated. + # @param validate_only [::Boolean] + # Optional. When set to `true`, the request will be validated (including IAM + # checks), but no module will be updated. An `OK` response indicates that the + # request is valid, while an error response indicates that the request is + # invalid. + # + # If the request is valid, a subsequent request to update the module could + # still fail for one of the following reasons: + # + # * The state of your cloud resources changed; for example, you lost a + # required IAM permission + # * An error occurred during creation of the module + # + # Defaults to `false`. + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Cloud::SecurityCenterManagement::V1::SecurityHealthAnalyticsCustomModule] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::SecurityCenterManagement::V1::SecurityHealthAnalyticsCustomModule] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/security_center_management/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::SecurityCenterManagement::V1::SecurityCenterManagement::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::SecurityCenterManagement::V1::UpdateSecurityHealthAnalyticsCustomModuleRequest.new + # + # # Call the update_security_health_analytics_custom_module method. + # result = client.update_security_health_analytics_custom_module request + # + # # The returned object is of type Google::Cloud::SecurityCenterManagement::V1::SecurityHealthAnalyticsCustomModule. + # p result + # + def update_security_health_analytics_custom_module request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::SecurityCenterManagement::V1::UpdateSecurityHealthAnalyticsCustomModuleRequest + + # Converts hash 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_security_health_analytics_custom_module.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::SecurityCenterManagement::V1::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + options.apply_defaults timeout: @config.rpcs.update_security_health_analytics_custom_module.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.update_security_health_analytics_custom_module.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @security_center_management_stub.update_security_health_analytics_custom_module request, options do |result, operation| + yield result, operation if block_given? + end + rescue ::Gapic::Rest::Error => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Deletes the specified + # {::Google::Cloud::SecurityCenterManagement::V1::SecurityHealthAnalyticsCustomModule SecurityHealthAnalyticsCustomModule} + # and all of its descendants in the resource hierarchy. This method is only + # supported for resident custom modules. + # + # @overload delete_security_health_analytics_custom_module(request, options = nil) + # Pass arguments to `delete_security_health_analytics_custom_module` via a request object, either of type + # {::Google::Cloud::SecurityCenterManagement::V1::DeleteSecurityHealthAnalyticsCustomModuleRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::SecurityCenterManagement::V1::DeleteSecurityHealthAnalyticsCustomModuleRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_security_health_analytics_custom_module(name: nil, validate_only: nil) + # Pass arguments to `delete_security_health_analytics_custom_module` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param name [::String] + # Required. The resource name of the SHA custom module, in one of the + # following formats: + # + # * `organizations/{organization}/locations/{location}/securityHealthAnalyticsCustomModules/{custom_module}` + # * `folders/{folder}/locations/{location}/securityHealthAnalyticsCustomModules/{custom_module}` + # * `projects/{project}/locations/{location}/securityHealthAnalyticsCustomModules/{custom_module}` + # @param validate_only [::Boolean] + # Optional. When set to `true`, the request will be validated (including IAM + # checks), but no module will be deleted. An `OK` response indicates that the + # request is valid, while an error response indicates that the request is + # invalid. + # + # If the request is valid, a subsequent request to delete the module could + # still fail for one of the following reasons: + # + # * The state of your cloud resources changed; for example, you lost a + # required IAM permission + # * An error occurred during deletion of the module + # + # Defaults to `false`. + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Protobuf::Empty] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Protobuf::Empty] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/security_center_management/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::SecurityCenterManagement::V1::SecurityCenterManagement::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::SecurityCenterManagement::V1::DeleteSecurityHealthAnalyticsCustomModuleRequest.new + # + # # Call the delete_security_health_analytics_custom_module method. + # result = client.delete_security_health_analytics_custom_module request + # + # # The returned object is of type Google::Protobuf::Empty. + # p result + # + def delete_security_health_analytics_custom_module request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::SecurityCenterManagement::V1::DeleteSecurityHealthAnalyticsCustomModuleRequest + + # Converts hash 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_security_health_analytics_custom_module.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::SecurityCenterManagement::V1::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + options.apply_defaults timeout: @config.rpcs.delete_security_health_analytics_custom_module.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.delete_security_health_analytics_custom_module.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @security_center_management_stub.delete_security_health_analytics_custom_module 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 + + ## + # Simulates the result of using a + # {::Google::Cloud::SecurityCenterManagement::V1::SecurityHealthAnalyticsCustomModule SecurityHealthAnalyticsCustomModule} + # to check a resource. + # + # @overload simulate_security_health_analytics_custom_module(request, options = nil) + # Pass arguments to `simulate_security_health_analytics_custom_module` via a request object, either of type + # {::Google::Cloud::SecurityCenterManagement::V1::SimulateSecurityHealthAnalyticsCustomModuleRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::SecurityCenterManagement::V1::SimulateSecurityHealthAnalyticsCustomModuleRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @overload simulate_security_health_analytics_custom_module(parent: nil, custom_config: nil, resource: nil) + # Pass arguments to `simulate_security_health_analytics_custom_module` via keyword arguments. Note that at + # least one keyword argument is 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 relative resource name of the organization, project, or + # folder. For more information about relative resource names, see [AIP-122: + # Resource names](https://google.aip.dev/122). Example: + # `organizations/{organization_id}`. + # @param custom_config [::Google::Cloud::SecurityCenterManagement::V1::CustomConfig, ::Hash] + # Required. The custom configuration that you need to test. + # @param resource [::Google::Cloud::SecurityCenterManagement::V1::SimulateSecurityHealthAnalyticsCustomModuleRequest::SimulatedResource, ::Hash] + # Required. Resource data to simulate custom module against. + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Cloud::SecurityCenterManagement::V1::SimulateSecurityHealthAnalyticsCustomModuleResponse] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::SecurityCenterManagement::V1::SimulateSecurityHealthAnalyticsCustomModuleResponse] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/security_center_management/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::SecurityCenterManagement::V1::SecurityCenterManagement::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::SecurityCenterManagement::V1::SimulateSecurityHealthAnalyticsCustomModuleRequest.new + # + # # Call the simulate_security_health_analytics_custom_module method. + # result = client.simulate_security_health_analytics_custom_module request + # + # # The returned object is of type Google::Cloud::SecurityCenterManagement::V1::SimulateSecurityHealthAnalyticsCustomModuleResponse. + # p result + # + def simulate_security_health_analytics_custom_module request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::SecurityCenterManagement::V1::SimulateSecurityHealthAnalyticsCustomModuleRequest + + # Converts hash 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.simulate_security_health_analytics_custom_module.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::SecurityCenterManagement::V1::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + options.apply_defaults timeout: @config.rpcs.simulate_security_health_analytics_custom_module.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.simulate_security_health_analytics_custom_module.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @security_center_management_stub.simulate_security_health_analytics_custom_module request, options do |result, operation| + yield result, operation if block_given? + end + rescue ::Gapic::Rest::Error => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Lists all effective Event Threat Detection custom modules for the + # given parent. This includes resident modules defined at the scope of the + # parent along with modules inherited from its ancestors. + # + # @overload list_effective_event_threat_detection_custom_modules(request, options = nil) + # Pass arguments to `list_effective_event_threat_detection_custom_modules` via a request object, either of type + # {::Google::Cloud::SecurityCenterManagement::V1::ListEffectiveEventThreatDetectionCustomModulesRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::SecurityCenterManagement::V1::ListEffectiveEventThreatDetectionCustomModulesRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_effective_event_threat_detection_custom_modules(parent: nil, page_size: nil, page_token: nil) + # Pass arguments to `list_effective_event_threat_detection_custom_modules` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param parent [::String] + # Required. Name of parent to list effective custom modules, in one of the + # following formats: + # + # * `organizations/{organization}/locations/{location}` + # * `folders/{folder}/locations/{location}` + # * `projects/{project}/locations/{location}` + # @param page_size [::Integer] + # Optional. The maximum number of results to return in a single response. + # Default is 10, minimum is 1, maximum is 1000. + # @param page_token [::String] + # Optional. A pagination token returned from a previous request. Provide this + # token to retrieve the next page of results. + # + # When paginating, the rest of the request must match the request that + # generated the page token. + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Gapic::Rest::PagedEnumerable<::Google::Cloud::SecurityCenterManagement::V1::EffectiveEventThreatDetectionCustomModule>] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Gapic::Rest::PagedEnumerable<::Google::Cloud::SecurityCenterManagement::V1::EffectiveEventThreatDetectionCustomModule>] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/security_center_management/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::SecurityCenterManagement::V1::SecurityCenterManagement::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::SecurityCenterManagement::V1::ListEffectiveEventThreatDetectionCustomModulesRequest.new + # + # # Call the list_effective_event_threat_detection_custom_modules method. + # result = client.list_effective_event_threat_detection_custom_modules request + # + # # The returned object is of type Gapic::PagedEnumerable. You can iterate + # # over elements, and API calls will be issued to fetch pages as needed. + # result.each do |item| + # # Each element is of type ::Google::Cloud::SecurityCenterManagement::V1::EffectiveEventThreatDetectionCustomModule. + # p item + # end + # + def list_effective_event_threat_detection_custom_modules request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::SecurityCenterManagement::V1::ListEffectiveEventThreatDetectionCustomModulesRequest + + # Converts hash 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_effective_event_threat_detection_custom_modules.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::SecurityCenterManagement::V1::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + options.apply_defaults timeout: @config.rpcs.list_effective_event_threat_detection_custom_modules.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.list_effective_event_threat_detection_custom_modules.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @security_center_management_stub.list_effective_event_threat_detection_custom_modules request, options do |result, operation| + result = ::Gapic::Rest::PagedEnumerable.new @security_center_management_stub, :list_effective_event_threat_detection_custom_modules, "effective_event_threat_detection_custom_modules", 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 effective Event Threat Detection custom module at the given level. + # + # The difference between an + # {::Google::Cloud::SecurityCenterManagement::V1::EffectiveEventThreatDetectionCustomModule EffectiveEventThreatDetectionCustomModule} + # and an + # {::Google::Cloud::SecurityCenterManagement::V1::EventThreatDetectionCustomModule EventThreatDetectionCustomModule} + # is that the fields for an `EffectiveEventThreatDetectionCustomModule` are + # computed from ancestors if needed. For example, the enablement state for an + # `EventThreatDetectionCustomModule` can be `ENABLED`, `DISABLED`, or + # `INHERITED`. In contrast, the enablement state for an + # `EffectiveEventThreatDetectionCustomModule` is always computed as `ENABLED` + # or `DISABLED`. + # + # @overload get_effective_event_threat_detection_custom_module(request, options = nil) + # Pass arguments to `get_effective_event_threat_detection_custom_module` via a request object, either of type + # {::Google::Cloud::SecurityCenterManagement::V1::GetEffectiveEventThreatDetectionCustomModuleRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::SecurityCenterManagement::V1::GetEffectiveEventThreatDetectionCustomModuleRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_effective_event_threat_detection_custom_module(name: nil) + # Pass arguments to `get_effective_event_threat_detection_custom_module` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param name [::String] + # Required. The resource name of the Event Threat Detection custom module, in + # one of the following formats: + # + # * `organizations/{organization}/locations/{location}/effectiveEventThreatDetectionCustomModules/{custom_module}` + # * `folders/{folder}/locations/{location}/effectiveEventThreatDetectionCustomModules/{custom_module}` + # * `projects/{project}/locations/{location}/effectiveEventThreatDetectionCustomModules/{custom_module}` + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Cloud::SecurityCenterManagement::V1::EffectiveEventThreatDetectionCustomModule] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::SecurityCenterManagement::V1::EffectiveEventThreatDetectionCustomModule] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/security_center_management/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::SecurityCenterManagement::V1::SecurityCenterManagement::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::SecurityCenterManagement::V1::GetEffectiveEventThreatDetectionCustomModuleRequest.new + # + # # Call the get_effective_event_threat_detection_custom_module method. + # result = client.get_effective_event_threat_detection_custom_module request + # + # # The returned object is of type Google::Cloud::SecurityCenterManagement::V1::EffectiveEventThreatDetectionCustomModule. + # p result + # + def get_effective_event_threat_detection_custom_module request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::SecurityCenterManagement::V1::GetEffectiveEventThreatDetectionCustomModuleRequest + + # Converts hash 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_effective_event_threat_detection_custom_module.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::SecurityCenterManagement::V1::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + options.apply_defaults timeout: @config.rpcs.get_effective_event_threat_detection_custom_module.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.get_effective_event_threat_detection_custom_module.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @security_center_management_stub.get_effective_event_threat_detection_custom_module request, options do |result, operation| + yield result, operation if block_given? + end + rescue ::Gapic::Rest::Error => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Lists all Event Threat Detection custom modules for the given organization, + # folder, or project. This includes resident modules defined at the scope of + # the parent along with modules inherited from ancestors. + # + # @overload list_event_threat_detection_custom_modules(request, options = nil) + # Pass arguments to `list_event_threat_detection_custom_modules` via a request object, either of type + # {::Google::Cloud::SecurityCenterManagement::V1::ListEventThreatDetectionCustomModulesRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::SecurityCenterManagement::V1::ListEventThreatDetectionCustomModulesRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_event_threat_detection_custom_modules(parent: nil, page_size: nil, page_token: nil) + # Pass arguments to `list_event_threat_detection_custom_modules` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param parent [::String] + # Required. Name of parent to list custom modules, in one of the following + # formats: + # + # * `organizations/{organization}/locations/{location}` + # * `folders/{folder}/locations/{location}` + # * `projects/{project}/locations/{location}` + # @param page_size [::Integer] + # Optional. The maximum number of modules to return. The service may return + # fewer than this value. If unspecified, at most 10 modules will be returned. + # The maximum value is 1000; values above 1000 will be coerced to 1000. + # @param page_token [::String] + # Optional. A pagination token returned from a previous request. Provide this + # token to retrieve the next page of results. + # + # When paginating, the rest of the request must match the request that + # generated the page token. + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Gapic::Rest::PagedEnumerable<::Google::Cloud::SecurityCenterManagement::V1::EventThreatDetectionCustomModule>] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Gapic::Rest::PagedEnumerable<::Google::Cloud::SecurityCenterManagement::V1::EventThreatDetectionCustomModule>] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/security_center_management/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::SecurityCenterManagement::V1::SecurityCenterManagement::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::SecurityCenterManagement::V1::ListEventThreatDetectionCustomModulesRequest.new + # + # # Call the list_event_threat_detection_custom_modules method. + # result = client.list_event_threat_detection_custom_modules request + # + # # The returned object is of type Gapic::PagedEnumerable. You can iterate + # # over elements, and API calls will be issued to fetch pages as needed. + # result.each do |item| + # # Each element is of type ::Google::Cloud::SecurityCenterManagement::V1::EventThreatDetectionCustomModule. + # p item + # end + # + def list_event_threat_detection_custom_modules request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::SecurityCenterManagement::V1::ListEventThreatDetectionCustomModulesRequest + + # Converts hash 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_event_threat_detection_custom_modules.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::SecurityCenterManagement::V1::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + options.apply_defaults timeout: @config.rpcs.list_event_threat_detection_custom_modules.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.list_event_threat_detection_custom_modules.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @security_center_management_stub.list_event_threat_detection_custom_modules request, options do |result, operation| + result = ::Gapic::Rest::PagedEnumerable.new @security_center_management_stub, :list_event_threat_detection_custom_modules, "event_threat_detection_custom_modules", 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 + + ## + # Lists all resident Event Threat Detection custom modules for the given + # organization, folder, or project and its descendants. + # + # @overload list_descendant_event_threat_detection_custom_modules(request, options = nil) + # Pass arguments to `list_descendant_event_threat_detection_custom_modules` via a request object, either of type + # {::Google::Cloud::SecurityCenterManagement::V1::ListDescendantEventThreatDetectionCustomModulesRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::SecurityCenterManagement::V1::ListDescendantEventThreatDetectionCustomModulesRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_descendant_event_threat_detection_custom_modules(parent: nil, page_size: nil, page_token: nil) + # Pass arguments to `list_descendant_event_threat_detection_custom_modules` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param parent [::String] + # Required. Name of parent to list custom modules, in one of the following + # formats: + # + # * `organizations/{organization}/locations/{location}` + # * `folders/{folder}/locations/{location}` + # * `projects/{project}/locations/{location}` + # @param page_size [::Integer] + # Optional. The maximum number of modules to return. The service may return + # fewer than this value. If unspecified, at most 10 configs will be returned. + # The maximum value is 1000; values above 1000 will be coerced to 1000. + # @param page_token [::String] + # Optional. A pagination token returned from a previous request. Provide this + # token to retrieve the next page of results. + # + # When paginating, the rest of the request must match the request that + # generated the page token. + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Gapic::Rest::PagedEnumerable<::Google::Cloud::SecurityCenterManagement::V1::EventThreatDetectionCustomModule>] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Gapic::Rest::PagedEnumerable<::Google::Cloud::SecurityCenterManagement::V1::EventThreatDetectionCustomModule>] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/security_center_management/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::SecurityCenterManagement::V1::SecurityCenterManagement::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::SecurityCenterManagement::V1::ListDescendantEventThreatDetectionCustomModulesRequest.new + # + # # Call the list_descendant_event_threat_detection_custom_modules method. + # result = client.list_descendant_event_threat_detection_custom_modules request + # + # # The returned object is of type Gapic::PagedEnumerable. You can iterate + # # over elements, and API calls will be issued to fetch pages as needed. + # result.each do |item| + # # Each element is of type ::Google::Cloud::SecurityCenterManagement::V1::EventThreatDetectionCustomModule. + # p item + # end + # + def list_descendant_event_threat_detection_custom_modules request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::SecurityCenterManagement::V1::ListDescendantEventThreatDetectionCustomModulesRequest + + # Converts hash 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_descendant_event_threat_detection_custom_modules.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::SecurityCenterManagement::V1::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + options.apply_defaults timeout: @config.rpcs.list_descendant_event_threat_detection_custom_modules.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.list_descendant_event_threat_detection_custom_modules.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @security_center_management_stub.list_descendant_event_threat_detection_custom_modules request, options do |result, operation| + result = ::Gapic::Rest::PagedEnumerable.new @security_center_management_stub, :list_descendant_event_threat_detection_custom_modules, "event_threat_detection_custom_modules", 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 an Event Threat Detection custom module. + # + # @overload get_event_threat_detection_custom_module(request, options = nil) + # Pass arguments to `get_event_threat_detection_custom_module` via a request object, either of type + # {::Google::Cloud::SecurityCenterManagement::V1::GetEventThreatDetectionCustomModuleRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::SecurityCenterManagement::V1::GetEventThreatDetectionCustomModuleRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_event_threat_detection_custom_module(name: nil) + # Pass arguments to `get_event_threat_detection_custom_module` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param name [::String] + # Required. The resource name of the Event Threat Detection custom module, in + # one of the following formats: + # + # * `organizations/{organization}/locations/{location}/eventThreatDetectionCustomModules/{custom_module}` + # * `folders/{folder}/locations/{location}/eventThreatDetectionCustomModules/{custom_module}` + # * `projects/{project}/locations/{location}/eventThreatDetectionCustomModules/{custom_module}` + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Cloud::SecurityCenterManagement::V1::EventThreatDetectionCustomModule] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::SecurityCenterManagement::V1::EventThreatDetectionCustomModule] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/security_center_management/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::SecurityCenterManagement::V1::SecurityCenterManagement::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::SecurityCenterManagement::V1::GetEventThreatDetectionCustomModuleRequest.new + # + # # Call the get_event_threat_detection_custom_module method. + # result = client.get_event_threat_detection_custom_module request + # + # # The returned object is of type Google::Cloud::SecurityCenterManagement::V1::EventThreatDetectionCustomModule. + # p result + # + def get_event_threat_detection_custom_module request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::SecurityCenterManagement::V1::GetEventThreatDetectionCustomModuleRequest + + # Converts hash 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_event_threat_detection_custom_module.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::SecurityCenterManagement::V1::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + options.apply_defaults timeout: @config.rpcs.get_event_threat_detection_custom_module.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.get_event_threat_detection_custom_module.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @security_center_management_stub.get_event_threat_detection_custom_module request, options do |result, operation| + yield result, operation if block_given? + end + rescue ::Gapic::Rest::Error => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Creates a resident Event Threat Detection custom module at the scope of the + # given organization, folder, or project, and creates inherited custom + # modules for all descendants of the given parent. These modules are enabled + # by default. + # + # @overload create_event_threat_detection_custom_module(request, options = nil) + # Pass arguments to `create_event_threat_detection_custom_module` via a request object, either of type + # {::Google::Cloud::SecurityCenterManagement::V1::CreateEventThreatDetectionCustomModuleRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::SecurityCenterManagement::V1::CreateEventThreatDetectionCustomModuleRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_event_threat_detection_custom_module(parent: nil, event_threat_detection_custom_module: nil, validate_only: nil) + # Pass arguments to `create_event_threat_detection_custom_module` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param parent [::String] + # Required. Name of parent for the module, in one of the following formats: + # + # * `organizations/{organization}/locations/{location}` + # * `folders/{folder}/locations/{location}` + # * `projects/{project}/locations/{location}` + # @param event_threat_detection_custom_module [::Google::Cloud::SecurityCenterManagement::V1::EventThreatDetectionCustomModule, ::Hash] + # Required. The module to create. The + # {::Google::Cloud::SecurityCenterManagement::V1::EventThreatDetectionCustomModule#name EventThreatDetectionCustomModule.name} + # field is ignored; Security Command Center generates the name. + # @param validate_only [::Boolean] + # Optional. When set to `true`, the request will be validated (including IAM + # checks), but no module will be created. An `OK` response indicates that the + # request is valid, while an error response indicates that the request is + # invalid. + # + # If the request is valid, a subsequent request to create the module could + # still fail for one of the following reasons: + # + # * The state of your cloud resources changed; for example, you lost a + # required IAM permission + # * An error occurred during creation of the module + # + # Defaults to `false`. + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Cloud::SecurityCenterManagement::V1::EventThreatDetectionCustomModule] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::SecurityCenterManagement::V1::EventThreatDetectionCustomModule] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/security_center_management/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::SecurityCenterManagement::V1::SecurityCenterManagement::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::SecurityCenterManagement::V1::CreateEventThreatDetectionCustomModuleRequest.new + # + # # Call the create_event_threat_detection_custom_module method. + # result = client.create_event_threat_detection_custom_module request + # + # # The returned object is of type Google::Cloud::SecurityCenterManagement::V1::EventThreatDetectionCustomModule. + # p result + # + def create_event_threat_detection_custom_module request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::SecurityCenterManagement::V1::CreateEventThreatDetectionCustomModuleRequest + + # Converts hash 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_event_threat_detection_custom_module.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::SecurityCenterManagement::V1::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + options.apply_defaults timeout: @config.rpcs.create_event_threat_detection_custom_module.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.create_event_threat_detection_custom_module.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @security_center_management_stub.create_event_threat_detection_custom_module request, options do |result, operation| + yield result, operation if block_given? + end + rescue ::Gapic::Rest::Error => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Updates the Event Threat Detection custom module with the given name based + # on the given update mask. Updating the enablement state is supported for + # both resident and inherited modules (though resident modules cannot have an + # enablement state of "inherited"). Updating the display name or + # configuration of a module is supported for resident modules only. The type + # of a module cannot be changed. + # + # @overload update_event_threat_detection_custom_module(request, options = nil) + # Pass arguments to `update_event_threat_detection_custom_module` via a request object, either of type + # {::Google::Cloud::SecurityCenterManagement::V1::UpdateEventThreatDetectionCustomModuleRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::SecurityCenterManagement::V1::UpdateEventThreatDetectionCustomModuleRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_event_threat_detection_custom_module(update_mask: nil, event_threat_detection_custom_module: nil, validate_only: nil) + # Pass arguments to `update_event_threat_detection_custom_module` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param update_mask [::Google::Protobuf::FieldMask, ::Hash] + # Required. The fields to update. If omitted, then all fields are updated. + # @param event_threat_detection_custom_module [::Google::Cloud::SecurityCenterManagement::V1::EventThreatDetectionCustomModule, ::Hash] + # Required. The module being updated. + # @param validate_only [::Boolean] + # Optional. When set to `true`, the request will be validated (including IAM + # checks), but no module will be updated. An `OK` response indicates that the + # request is valid, while an error response indicates that the request is + # invalid. + # + # If the request is valid, a subsequent request to update the module could + # still fail for one of the following reasons: + # + # * The state of your cloud resources changed; for example, you lost a + # required IAM permission + # * An error occurred during creation of the module + # + # Defaults to `false`. + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Cloud::SecurityCenterManagement::V1::EventThreatDetectionCustomModule] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::SecurityCenterManagement::V1::EventThreatDetectionCustomModule] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/security_center_management/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::SecurityCenterManagement::V1::SecurityCenterManagement::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::SecurityCenterManagement::V1::UpdateEventThreatDetectionCustomModuleRequest.new + # + # # Call the update_event_threat_detection_custom_module method. + # result = client.update_event_threat_detection_custom_module request + # + # # The returned object is of type Google::Cloud::SecurityCenterManagement::V1::EventThreatDetectionCustomModule. + # p result + # + def update_event_threat_detection_custom_module request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::SecurityCenterManagement::V1::UpdateEventThreatDetectionCustomModuleRequest + + # Converts hash 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_event_threat_detection_custom_module.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::SecurityCenterManagement::V1::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + options.apply_defaults timeout: @config.rpcs.update_event_threat_detection_custom_module.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.update_event_threat_detection_custom_module.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @security_center_management_stub.update_event_threat_detection_custom_module request, options do |result, operation| + yield result, operation if block_given? + end + rescue ::Gapic::Rest::Error => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Deletes the specified Event Threat Detection custom module and all of its + # descendants in the resource hierarchy. This method is only supported for + # resident custom modules. + # + # @overload delete_event_threat_detection_custom_module(request, options = nil) + # Pass arguments to `delete_event_threat_detection_custom_module` via a request object, either of type + # {::Google::Cloud::SecurityCenterManagement::V1::DeleteEventThreatDetectionCustomModuleRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::SecurityCenterManagement::V1::DeleteEventThreatDetectionCustomModuleRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_event_threat_detection_custom_module(name: nil, validate_only: nil) + # Pass arguments to `delete_event_threat_detection_custom_module` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param name [::String] + # Required. The resource name of the Event Threat Detection custom module, in + # one of the following formats: + # + # * `organizations/{organization}/locations/{location}/eventThreatDetectionCustomModules/{custom_module}` + # * `folders/{folder}/locations/{location}/eventThreatDetectionCustomModules/{custom_module}` + # * `projects/{project}/locations/{location}/eventThreatDetectionCustomModules/{custom_module}` + # @param validate_only [::Boolean] + # Optional. When set to `true`, the request will be validated (including IAM + # checks), but no module will be deleted. An `OK` response indicates that the + # request is valid, while an error response indicates that the request is + # invalid. + # + # If the request is valid, a subsequent request to delete the module could + # still fail for one of the following reasons: + # + # * The state of your cloud resources changed; for example, you lost a + # required IAM permission + # * An error occurred during creation of the module + # + # Defaults to `false`. + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Protobuf::Empty] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Protobuf::Empty] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/security_center_management/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::SecurityCenterManagement::V1::SecurityCenterManagement::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::SecurityCenterManagement::V1::DeleteEventThreatDetectionCustomModuleRequest.new + # + # # Call the delete_event_threat_detection_custom_module method. + # result = client.delete_event_threat_detection_custom_module request + # + # # The returned object is of type Google::Protobuf::Empty. + # p result + # + def delete_event_threat_detection_custom_module request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::SecurityCenterManagement::V1::DeleteEventThreatDetectionCustomModuleRequest + + # Converts hash 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_event_threat_detection_custom_module.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::SecurityCenterManagement::V1::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + options.apply_defaults timeout: @config.rpcs.delete_event_threat_detection_custom_module.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.delete_event_threat_detection_custom_module.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @security_center_management_stub.delete_event_threat_detection_custom_module 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 + + ## + # Validates the given Event Threat Detection custom module. + # + # @overload validate_event_threat_detection_custom_module(request, options = nil) + # Pass arguments to `validate_event_threat_detection_custom_module` via a request object, either of type + # {::Google::Cloud::SecurityCenterManagement::V1::ValidateEventThreatDetectionCustomModuleRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::SecurityCenterManagement::V1::ValidateEventThreatDetectionCustomModuleRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @overload validate_event_threat_detection_custom_module(parent: nil, raw_text: nil, type: nil) + # Pass arguments to `validate_event_threat_detection_custom_module` via keyword arguments. Note that at + # least one keyword argument is 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. Resource name of the parent to validate the custom modules under, + # in one of the following formats: + # + # * `organizations/{organization}/locations/{location}` + # @param raw_text [::String] + # Required. The raw text of the module's contents. Used to generate error + # messages. + # @param type [::String] + # Required. The type of the module. For example, `CONFIGURABLE_BAD_IP`. + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Cloud::SecurityCenterManagement::V1::ValidateEventThreatDetectionCustomModuleResponse] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::SecurityCenterManagement::V1::ValidateEventThreatDetectionCustomModuleResponse] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/security_center_management/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::SecurityCenterManagement::V1::SecurityCenterManagement::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::SecurityCenterManagement::V1::ValidateEventThreatDetectionCustomModuleRequest.new + # + # # Call the validate_event_threat_detection_custom_module method. + # result = client.validate_event_threat_detection_custom_module request + # + # # The returned object is of type Google::Cloud::SecurityCenterManagement::V1::ValidateEventThreatDetectionCustomModuleResponse. + # p result + # + def validate_event_threat_detection_custom_module request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::SecurityCenterManagement::V1::ValidateEventThreatDetectionCustomModuleRequest + + # Converts hash 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.validate_event_threat_detection_custom_module.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::SecurityCenterManagement::V1::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + options.apply_defaults timeout: @config.rpcs.validate_event_threat_detection_custom_module.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.validate_event_threat_detection_custom_module.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @security_center_management_stub.validate_event_threat_detection_custom_module request, options do |result, operation| + yield result, operation if block_given? + end + rescue ::Gapic::Rest::Error => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Gets service settings for the specified Security Command Center service. + # + # @overload get_security_center_service(request, options = nil) + # Pass arguments to `get_security_center_service` via a request object, either of type + # {::Google::Cloud::SecurityCenterManagement::V1::GetSecurityCenterServiceRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::SecurityCenterManagement::V1::GetSecurityCenterServiceRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_security_center_service(name: nil, show_eligible_modules_only: nil) + # Pass arguments to `get_security_center_service` via keyword arguments. Note that at + # least one keyword argument is 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 Security Command Center service to retrieve, in one of the + # following formats: + # + # * organizations/\\{organization}/locations/\\{location}/securityCenterServices/\\{service} + # * folders/\\{folder}/locations/\\{location}/securityCenterServices/\\{service} + # * projects/\\{project}/locations/\\{location}/securityCenterServices/\\{service} + # + # The following values are valid for `{service}`: + # + # * `container-threat-detection` + # * `event-threat-detection` + # * `security-health-analytics` + # * `vm-threat-detection` + # * `web-security-scanner` + # @param show_eligible_modules_only [::Boolean] + # Set to `true` to show only modules that are in scope. By default, all + # modules are shown. + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Cloud::SecurityCenterManagement::V1::SecurityCenterService] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::SecurityCenterManagement::V1::SecurityCenterService] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/security_center_management/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::SecurityCenterManagement::V1::SecurityCenterManagement::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::SecurityCenterManagement::V1::GetSecurityCenterServiceRequest.new + # + # # Call the get_security_center_service method. + # result = client.get_security_center_service request + # + # # The returned object is of type Google::Cloud::SecurityCenterManagement::V1::SecurityCenterService. + # p result + # + def get_security_center_service request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::SecurityCenterManagement::V1::GetSecurityCenterServiceRequest + + # Converts hash 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_security_center_service.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::SecurityCenterManagement::V1::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + options.apply_defaults timeout: @config.rpcs.get_security_center_service.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.get_security_center_service.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @security_center_management_stub.get_security_center_service request, options do |result, operation| + yield result, operation if block_given? + end + rescue ::Gapic::Rest::Error => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Returns a list of all Security Command Center services for the given + # parent. + # + # @overload list_security_center_services(request, options = nil) + # Pass arguments to `list_security_center_services` via a request object, either of type + # {::Google::Cloud::SecurityCenterManagement::V1::ListSecurityCenterServicesRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::SecurityCenterManagement::V1::ListSecurityCenterServicesRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_security_center_services(parent: nil, page_size: nil, page_token: nil, show_eligible_modules_only: nil) + # Pass arguments to `list_security_center_services` via keyword arguments. Note that at + # least one keyword argument is 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 name of the parent to list Security Command Center services, + # in one of the following formats: + # + # * `organizations/{organization}/locations/{location}` + # * `folders/{folder}/locations/{location}` + # * `projects/{project}/locations/{location}` + # @param page_size [::Integer] + # Optional. The maximum number of results to return in a single response. + # Default is 10, minimum is 1, maximum is 1000. + # @param page_token [::String] + # Optional. A pagination token returned from a previous request. Provide this + # token to retrieve the next page of results. + # + # When paginating, the rest of the request must match the request that + # generated the page token. + # @param show_eligible_modules_only [::Boolean] + # Flag that, when set, is used to filter the module settings that are shown. + # The default setting is that all modules are shown. + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Gapic::Rest::PagedEnumerable<::Google::Cloud::SecurityCenterManagement::V1::SecurityCenterService>] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Gapic::Rest::PagedEnumerable<::Google::Cloud::SecurityCenterManagement::V1::SecurityCenterService>] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/security_center_management/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::SecurityCenterManagement::V1::SecurityCenterManagement::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::SecurityCenterManagement::V1::ListSecurityCenterServicesRequest.new + # + # # Call the list_security_center_services method. + # result = client.list_security_center_services request + # + # # The returned object is of type Gapic::PagedEnumerable. You can iterate + # # over elements, and API calls will be issued to fetch pages as needed. + # result.each do |item| + # # Each element is of type ::Google::Cloud::SecurityCenterManagement::V1::SecurityCenterService. + # p item + # end + # + def list_security_center_services request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::SecurityCenterManagement::V1::ListSecurityCenterServicesRequest + + # Converts hash 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_security_center_services.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::SecurityCenterManagement::V1::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + options.apply_defaults timeout: @config.rpcs.list_security_center_services.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.list_security_center_services.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @security_center_management_stub.list_security_center_services request, options do |result, operation| + result = ::Gapic::Rest::PagedEnumerable.new @security_center_management_stub, :list_security_center_services, "security_center_services", 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 + + ## + # Updates a Security Command Center service using the given update mask. + # + # @overload update_security_center_service(request, options = nil) + # Pass arguments to `update_security_center_service` via a request object, either of type + # {::Google::Cloud::SecurityCenterManagement::V1::UpdateSecurityCenterServiceRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::SecurityCenterManagement::V1::UpdateSecurityCenterServiceRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_security_center_service(security_center_service: nil, update_mask: nil, validate_only: nil) + # Pass arguments to `update_security_center_service` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param security_center_service [::Google::Cloud::SecurityCenterManagement::V1::SecurityCenterService, ::Hash] + # Required. The updated service. + # @param update_mask [::Google::Protobuf::FieldMask, ::Hash] + # Required. The fields to update. Accepts the following values: + # + # * `intended_enablement_state` + # * `modules` + # + # If omitted, then all eligible fields are updated. + # @param validate_only [::Boolean] + # Optional. When set to `true`, the request will be validated (including IAM + # checks), but no service will be updated. An `OK` response indicates that + # the request is valid, while an error response indicates that the request is + # invalid. + # + # If the request is valid, a subsequent request to update the service could + # still fail for one of the following reasons: + # + # * The state of your cloud resources changed; for example, you lost a + # required IAM permission + # * An error occurred during update of the service + # + # Defaults to `false`. + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Cloud::SecurityCenterManagement::V1::SecurityCenterService] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::SecurityCenterManagement::V1::SecurityCenterService] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/security_center_management/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::SecurityCenterManagement::V1::SecurityCenterManagement::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::SecurityCenterManagement::V1::UpdateSecurityCenterServiceRequest.new + # + # # Call the update_security_center_service method. + # result = client.update_security_center_service request + # + # # The returned object is of type Google::Cloud::SecurityCenterManagement::V1::SecurityCenterService. + # p result + # + def update_security_center_service request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::SecurityCenterManagement::V1::UpdateSecurityCenterServiceRequest + + # Converts hash 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_security_center_service.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::SecurityCenterManagement::V1::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + options.apply_defaults timeout: @config.rpcs.update_security_center_service.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.update_security_center_service.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @security_center_management_stub.update_security_center_service 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 SecurityCenterManagement REST API. + # + # This class represents the configuration for SecurityCenterManagement REST, + # providing control over timeouts, retry behavior, logging, transport + # parameters, and other low-level controls. Certain parameters can also be + # applied individually to specific RPCs. See + # {::Google::Cloud::SecurityCenterManagement::V1::SecurityCenterManagement::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_effective_security_health_analytics_custom_modules to 20 seconds, + # # and all remaining timeouts to 10 seconds. + # ::Google::Cloud::SecurityCenterManagement::V1::SecurityCenterManagement::Rest::Client.configure do |config| + # config.timeout = 10.0 + # config.rpcs.list_effective_security_health_analytics_custom_modules.timeout = 20.0 + # end + # + # # Apply the above configuration only to a new client. + # client = ::Google::Cloud::SecurityCenterManagement::V1::SecurityCenterManagement::Rest::Client.new do |config| + # config.timeout = 10.0 + # config.rpcs.list_effective_security_health_analytics_custom_modules.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 = "securitycentermanagement.googleapis.com" + + config_attr :endpoint, nil, ::String, nil + config_attr :credentials, nil do |value| + allowed = [::String, ::Hash, ::Proc, ::Symbol, ::Google::Auth::Credentials, ::Google::Auth::BaseClient, ::Signet::OAuth2::Client, nil] + allowed.any? { |klass| klass === value } + end + config_attr :scope, nil, ::String, ::Array, nil + config_attr :lib_name, nil, ::String, nil + config_attr :lib_version, nil, ::String, nil + config_attr :timeout, nil, ::Numeric, nil + config_attr :metadata, nil, ::Hash, nil + config_attr :retry_policy, nil, ::Hash, ::Proc, nil + config_attr :quota_project, nil, ::String, nil + config_attr :universe_domain, nil, ::String, nil + + # @private + # Overrides for http bindings for the RPCs of this service + # are only used when this service is used as mixin, and only + # by the host service. + # @return [::Hash{::Symbol=>::Array<::Gapic::Rest::GrpcTranscoder::HttpBinding>}] + config_attr :bindings_override, {}, ::Hash, nil + config_attr :logger, :default, ::Logger, nil, :default + + # @private + def initialize parent_config = nil + @parent_config = parent_config unless parent_config.nil? + + yield self if block_given? + end + + ## + # Configurations for individual RPCs + # @return [Rpcs] + # + def rpcs + @rpcs ||= begin + parent_rpcs = nil + parent_rpcs = @parent_config.rpcs if defined?(@parent_config) && @parent_config.respond_to?(:rpcs) + Rpcs.new parent_rpcs + end + end + + ## + # Configuration RPC class for the SecurityCenterManagement 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_effective_security_health_analytics_custom_modules` + # @return [::Gapic::Config::Method] + # + attr_reader :list_effective_security_health_analytics_custom_modules + ## + # RPC-specific configuration for `get_effective_security_health_analytics_custom_module` + # @return [::Gapic::Config::Method] + # + attr_reader :get_effective_security_health_analytics_custom_module + ## + # RPC-specific configuration for `list_security_health_analytics_custom_modules` + # @return [::Gapic::Config::Method] + # + attr_reader :list_security_health_analytics_custom_modules + ## + # RPC-specific configuration for `list_descendant_security_health_analytics_custom_modules` + # @return [::Gapic::Config::Method] + # + attr_reader :list_descendant_security_health_analytics_custom_modules + ## + # RPC-specific configuration for `get_security_health_analytics_custom_module` + # @return [::Gapic::Config::Method] + # + attr_reader :get_security_health_analytics_custom_module + ## + # RPC-specific configuration for `create_security_health_analytics_custom_module` + # @return [::Gapic::Config::Method] + # + attr_reader :create_security_health_analytics_custom_module + ## + # RPC-specific configuration for `update_security_health_analytics_custom_module` + # @return [::Gapic::Config::Method] + # + attr_reader :update_security_health_analytics_custom_module + ## + # RPC-specific configuration for `delete_security_health_analytics_custom_module` + # @return [::Gapic::Config::Method] + # + attr_reader :delete_security_health_analytics_custom_module + ## + # RPC-specific configuration for `simulate_security_health_analytics_custom_module` + # @return [::Gapic::Config::Method] + # + attr_reader :simulate_security_health_analytics_custom_module + ## + # RPC-specific configuration for `list_effective_event_threat_detection_custom_modules` + # @return [::Gapic::Config::Method] + # + attr_reader :list_effective_event_threat_detection_custom_modules + ## + # RPC-specific configuration for `get_effective_event_threat_detection_custom_module` + # @return [::Gapic::Config::Method] + # + attr_reader :get_effective_event_threat_detection_custom_module + ## + # RPC-specific configuration for `list_event_threat_detection_custom_modules` + # @return [::Gapic::Config::Method] + # + attr_reader :list_event_threat_detection_custom_modules + ## + # RPC-specific configuration for `list_descendant_event_threat_detection_custom_modules` + # @return [::Gapic::Config::Method] + # + attr_reader :list_descendant_event_threat_detection_custom_modules + ## + # RPC-specific configuration for `get_event_threat_detection_custom_module` + # @return [::Gapic::Config::Method] + # + attr_reader :get_event_threat_detection_custom_module + ## + # RPC-specific configuration for `create_event_threat_detection_custom_module` + # @return [::Gapic::Config::Method] + # + attr_reader :create_event_threat_detection_custom_module + ## + # RPC-specific configuration for `update_event_threat_detection_custom_module` + # @return [::Gapic::Config::Method] + # + attr_reader :update_event_threat_detection_custom_module + ## + # RPC-specific configuration for `delete_event_threat_detection_custom_module` + # @return [::Gapic::Config::Method] + # + attr_reader :delete_event_threat_detection_custom_module + ## + # RPC-specific configuration for `validate_event_threat_detection_custom_module` + # @return [::Gapic::Config::Method] + # + attr_reader :validate_event_threat_detection_custom_module + ## + # RPC-specific configuration for `get_security_center_service` + # @return [::Gapic::Config::Method] + # + attr_reader :get_security_center_service + ## + # RPC-specific configuration for `list_security_center_services` + # @return [::Gapic::Config::Method] + # + attr_reader :list_security_center_services + ## + # RPC-specific configuration for `update_security_center_service` + # @return [::Gapic::Config::Method] + # + attr_reader :update_security_center_service + + # @private + def initialize parent_rpcs = nil + list_effective_security_health_analytics_custom_modules_config = parent_rpcs.list_effective_security_health_analytics_custom_modules if parent_rpcs.respond_to? :list_effective_security_health_analytics_custom_modules + @list_effective_security_health_analytics_custom_modules = ::Gapic::Config::Method.new list_effective_security_health_analytics_custom_modules_config + get_effective_security_health_analytics_custom_module_config = parent_rpcs.get_effective_security_health_analytics_custom_module if parent_rpcs.respond_to? :get_effective_security_health_analytics_custom_module + @get_effective_security_health_analytics_custom_module = ::Gapic::Config::Method.new get_effective_security_health_analytics_custom_module_config + list_security_health_analytics_custom_modules_config = parent_rpcs.list_security_health_analytics_custom_modules if parent_rpcs.respond_to? :list_security_health_analytics_custom_modules + @list_security_health_analytics_custom_modules = ::Gapic::Config::Method.new list_security_health_analytics_custom_modules_config + list_descendant_security_health_analytics_custom_modules_config = parent_rpcs.list_descendant_security_health_analytics_custom_modules if parent_rpcs.respond_to? :list_descendant_security_health_analytics_custom_modules + @list_descendant_security_health_analytics_custom_modules = ::Gapic::Config::Method.new list_descendant_security_health_analytics_custom_modules_config + get_security_health_analytics_custom_module_config = parent_rpcs.get_security_health_analytics_custom_module if parent_rpcs.respond_to? :get_security_health_analytics_custom_module + @get_security_health_analytics_custom_module = ::Gapic::Config::Method.new get_security_health_analytics_custom_module_config + create_security_health_analytics_custom_module_config = parent_rpcs.create_security_health_analytics_custom_module if parent_rpcs.respond_to? :create_security_health_analytics_custom_module + @create_security_health_analytics_custom_module = ::Gapic::Config::Method.new create_security_health_analytics_custom_module_config + update_security_health_analytics_custom_module_config = parent_rpcs.update_security_health_analytics_custom_module if parent_rpcs.respond_to? :update_security_health_analytics_custom_module + @update_security_health_analytics_custom_module = ::Gapic::Config::Method.new update_security_health_analytics_custom_module_config + delete_security_health_analytics_custom_module_config = parent_rpcs.delete_security_health_analytics_custom_module if parent_rpcs.respond_to? :delete_security_health_analytics_custom_module + @delete_security_health_analytics_custom_module = ::Gapic::Config::Method.new delete_security_health_analytics_custom_module_config + simulate_security_health_analytics_custom_module_config = parent_rpcs.simulate_security_health_analytics_custom_module if parent_rpcs.respond_to? :simulate_security_health_analytics_custom_module + @simulate_security_health_analytics_custom_module = ::Gapic::Config::Method.new simulate_security_health_analytics_custom_module_config + list_effective_event_threat_detection_custom_modules_config = parent_rpcs.list_effective_event_threat_detection_custom_modules if parent_rpcs.respond_to? :list_effective_event_threat_detection_custom_modules + @list_effective_event_threat_detection_custom_modules = ::Gapic::Config::Method.new list_effective_event_threat_detection_custom_modules_config + get_effective_event_threat_detection_custom_module_config = parent_rpcs.get_effective_event_threat_detection_custom_module if parent_rpcs.respond_to? :get_effective_event_threat_detection_custom_module + @get_effective_event_threat_detection_custom_module = ::Gapic::Config::Method.new get_effective_event_threat_detection_custom_module_config + list_event_threat_detection_custom_modules_config = parent_rpcs.list_event_threat_detection_custom_modules if parent_rpcs.respond_to? :list_event_threat_detection_custom_modules + @list_event_threat_detection_custom_modules = ::Gapic::Config::Method.new list_event_threat_detection_custom_modules_config + list_descendant_event_threat_detection_custom_modules_config = parent_rpcs.list_descendant_event_threat_detection_custom_modules if parent_rpcs.respond_to? :list_descendant_event_threat_detection_custom_modules + @list_descendant_event_threat_detection_custom_modules = ::Gapic::Config::Method.new list_descendant_event_threat_detection_custom_modules_config + get_event_threat_detection_custom_module_config = parent_rpcs.get_event_threat_detection_custom_module if parent_rpcs.respond_to? :get_event_threat_detection_custom_module + @get_event_threat_detection_custom_module = ::Gapic::Config::Method.new get_event_threat_detection_custom_module_config + create_event_threat_detection_custom_module_config = parent_rpcs.create_event_threat_detection_custom_module if parent_rpcs.respond_to? :create_event_threat_detection_custom_module + @create_event_threat_detection_custom_module = ::Gapic::Config::Method.new create_event_threat_detection_custom_module_config + update_event_threat_detection_custom_module_config = parent_rpcs.update_event_threat_detection_custom_module if parent_rpcs.respond_to? :update_event_threat_detection_custom_module + @update_event_threat_detection_custom_module = ::Gapic::Config::Method.new update_event_threat_detection_custom_module_config + delete_event_threat_detection_custom_module_config = parent_rpcs.delete_event_threat_detection_custom_module if parent_rpcs.respond_to? :delete_event_threat_detection_custom_module + @delete_event_threat_detection_custom_module = ::Gapic::Config::Method.new delete_event_threat_detection_custom_module_config + validate_event_threat_detection_custom_module_config = parent_rpcs.validate_event_threat_detection_custom_module if parent_rpcs.respond_to? :validate_event_threat_detection_custom_module + @validate_event_threat_detection_custom_module = ::Gapic::Config::Method.new validate_event_threat_detection_custom_module_config + get_security_center_service_config = parent_rpcs.get_security_center_service if parent_rpcs.respond_to? :get_security_center_service + @get_security_center_service = ::Gapic::Config::Method.new get_security_center_service_config + list_security_center_services_config = parent_rpcs.list_security_center_services if parent_rpcs.respond_to? :list_security_center_services + @list_security_center_services = ::Gapic::Config::Method.new list_security_center_services_config + update_security_center_service_config = parent_rpcs.update_security_center_service if parent_rpcs.respond_to? :update_security_center_service + @update_security_center_service = ::Gapic::Config::Method.new update_security_center_service_config + + yield self if block_given? + end + end + end + end + end + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-security_center_management-v1/lib/google/cloud/security_center_management/v1/security_center_management/rest/service_stub.rb b/owl-bot-staging/google-cloud-security_center_management-v1/lib/google/cloud/security_center_management/v1/security_center_management/rest/service_stub.rb new file mode 100644 index 000000000000..4bd0edd3626c --- /dev/null +++ b/owl-bot-staging/google-cloud-security_center_management-v1/lib/google/cloud/security_center_management/v1/security_center_management/rest/service_stub.rb @@ -0,0 +1,1677 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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/securitycentermanagement/v1/security_center_management_pb" + +module Google + module Cloud + module SecurityCenterManagement + module V1 + module SecurityCenterManagement + module Rest + ## + # REST service stub for the SecurityCenterManagement service. + # Service stub contains baseline method implementations + # including transcoding, making the REST call, and deserialing the response. + # + class ServiceStub + # @private + def initialize endpoint:, endpoint_template:, universe_domain:, credentials:, logger: + # These require statements are intentionally placed here to initialize + # the REST modules only when it's required. + require "gapic/rest" + + @client_stub = ::Gapic::Rest::ClientStub.new endpoint: endpoint, + endpoint_template: endpoint_template, + universe_domain: universe_domain, + credentials: credentials, + numeric_enums: true, + service_name: self.class, + raise_faraday_errors: false, + logger: logger + end + + ## + # The effective universe domain + # + # @return [String] + # + def universe_domain + @client_stub.universe_domain + end + + ## + # The effective endpoint + # + # @return [String] + # + def endpoint + @client_stub.endpoint + end + + ## + # The logger used for request/response debug logging. + # + # @return [Logger] + # + def logger stub: false + stub ? @client_stub.stub_logger : @client_stub.logger + end + + ## + # Baseline implementation for the list_effective_security_health_analytics_custom_modules REST call + # + # @param request_pb [::Google::Cloud::SecurityCenterManagement::V1::ListEffectiveSecurityHealthAnalyticsCustomModulesRequest] + # A request object representing the call parameters. Required. + # @param options [::Gapic::CallOptions] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Cloud::SecurityCenterManagement::V1::ListEffectiveSecurityHealthAnalyticsCustomModulesResponse] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::SecurityCenterManagement::V1::ListEffectiveSecurityHealthAnalyticsCustomModulesResponse] + # A result object deserialized from the server's reply + def list_effective_security_health_analytics_custom_modules request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_list_effective_security_health_analytics_custom_modules_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_effective_security_health_analytics_custom_modules", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Cloud::SecurityCenterManagement::V1::ListEffectiveSecurityHealthAnalyticsCustomModulesResponse.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_effective_security_health_analytics_custom_module REST call + # + # @param request_pb [::Google::Cloud::SecurityCenterManagement::V1::GetEffectiveSecurityHealthAnalyticsCustomModuleRequest] + # A request object representing the call parameters. Required. + # @param options [::Gapic::CallOptions] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Cloud::SecurityCenterManagement::V1::EffectiveSecurityHealthAnalyticsCustomModule] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::SecurityCenterManagement::V1::EffectiveSecurityHealthAnalyticsCustomModule] + # A result object deserialized from the server's reply + def get_effective_security_health_analytics_custom_module request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_get_effective_security_health_analytics_custom_module_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_effective_security_health_analytics_custom_module", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Cloud::SecurityCenterManagement::V1::EffectiveSecurityHealthAnalyticsCustomModule.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_security_health_analytics_custom_modules REST call + # + # @param request_pb [::Google::Cloud::SecurityCenterManagement::V1::ListSecurityHealthAnalyticsCustomModulesRequest] + # A request object representing the call parameters. Required. + # @param options [::Gapic::CallOptions] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Cloud::SecurityCenterManagement::V1::ListSecurityHealthAnalyticsCustomModulesResponse] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::SecurityCenterManagement::V1::ListSecurityHealthAnalyticsCustomModulesResponse] + # A result object deserialized from the server's reply + def list_security_health_analytics_custom_modules request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_list_security_health_analytics_custom_modules_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_security_health_analytics_custom_modules", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Cloud::SecurityCenterManagement::V1::ListSecurityHealthAnalyticsCustomModulesResponse.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_descendant_security_health_analytics_custom_modules REST call + # + # @param request_pb [::Google::Cloud::SecurityCenterManagement::V1::ListDescendantSecurityHealthAnalyticsCustomModulesRequest] + # A request object representing the call parameters. Required. + # @param options [::Gapic::CallOptions] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Cloud::SecurityCenterManagement::V1::ListDescendantSecurityHealthAnalyticsCustomModulesResponse] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::SecurityCenterManagement::V1::ListDescendantSecurityHealthAnalyticsCustomModulesResponse] + # A result object deserialized from the server's reply + def list_descendant_security_health_analytics_custom_modules request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_list_descendant_security_health_analytics_custom_modules_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_descendant_security_health_analytics_custom_modules", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Cloud::SecurityCenterManagement::V1::ListDescendantSecurityHealthAnalyticsCustomModulesResponse.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_security_health_analytics_custom_module REST call + # + # @param request_pb [::Google::Cloud::SecurityCenterManagement::V1::GetSecurityHealthAnalyticsCustomModuleRequest] + # A request object representing the call parameters. Required. + # @param options [::Gapic::CallOptions] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Cloud::SecurityCenterManagement::V1::SecurityHealthAnalyticsCustomModule] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::SecurityCenterManagement::V1::SecurityHealthAnalyticsCustomModule] + # A result object deserialized from the server's reply + def get_security_health_analytics_custom_module request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_get_security_health_analytics_custom_module_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_security_health_analytics_custom_module", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Cloud::SecurityCenterManagement::V1::SecurityHealthAnalyticsCustomModule.decode_json response.body, ignore_unknown_fields: true + catch :response do + yield result, operation if block_given? + result + end + end + + ## + # Baseline implementation for the create_security_health_analytics_custom_module REST call + # + # @param request_pb [::Google::Cloud::SecurityCenterManagement::V1::CreateSecurityHealthAnalyticsCustomModuleRequest] + # A request object representing the call parameters. Required. + # @param options [::Gapic::CallOptions] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Cloud::SecurityCenterManagement::V1::SecurityHealthAnalyticsCustomModule] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::SecurityCenterManagement::V1::SecurityHealthAnalyticsCustomModule] + # A result object deserialized from the server's reply + def create_security_health_analytics_custom_module request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_create_security_health_analytics_custom_module_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_security_health_analytics_custom_module", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Cloud::SecurityCenterManagement::V1::SecurityHealthAnalyticsCustomModule.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_security_health_analytics_custom_module REST call + # + # @param request_pb [::Google::Cloud::SecurityCenterManagement::V1::UpdateSecurityHealthAnalyticsCustomModuleRequest] + # A request object representing the call parameters. Required. + # @param options [::Gapic::CallOptions] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Cloud::SecurityCenterManagement::V1::SecurityHealthAnalyticsCustomModule] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::SecurityCenterManagement::V1::SecurityHealthAnalyticsCustomModule] + # A result object deserialized from the server's reply + def update_security_health_analytics_custom_module request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_update_security_health_analytics_custom_module_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_security_health_analytics_custom_module", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Cloud::SecurityCenterManagement::V1::SecurityHealthAnalyticsCustomModule.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_security_health_analytics_custom_module REST call + # + # @param request_pb [::Google::Cloud::SecurityCenterManagement::V1::DeleteSecurityHealthAnalyticsCustomModuleRequest] + # 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_security_health_analytics_custom_module request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_delete_security_health_analytics_custom_module_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_security_health_analytics_custom_module", + 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 simulate_security_health_analytics_custom_module REST call + # + # @param request_pb [::Google::Cloud::SecurityCenterManagement::V1::SimulateSecurityHealthAnalyticsCustomModuleRequest] + # A request object representing the call parameters. Required. + # @param options [::Gapic::CallOptions] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Cloud::SecurityCenterManagement::V1::SimulateSecurityHealthAnalyticsCustomModuleResponse] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::SecurityCenterManagement::V1::SimulateSecurityHealthAnalyticsCustomModuleResponse] + # A result object deserialized from the server's reply + def simulate_security_health_analytics_custom_module request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_simulate_security_health_analytics_custom_module_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: "simulate_security_health_analytics_custom_module", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Cloud::SecurityCenterManagement::V1::SimulateSecurityHealthAnalyticsCustomModuleResponse.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_effective_event_threat_detection_custom_modules REST call + # + # @param request_pb [::Google::Cloud::SecurityCenterManagement::V1::ListEffectiveEventThreatDetectionCustomModulesRequest] + # A request object representing the call parameters. Required. + # @param options [::Gapic::CallOptions] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Cloud::SecurityCenterManagement::V1::ListEffectiveEventThreatDetectionCustomModulesResponse] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::SecurityCenterManagement::V1::ListEffectiveEventThreatDetectionCustomModulesResponse] + # A result object deserialized from the server's reply + def list_effective_event_threat_detection_custom_modules request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_list_effective_event_threat_detection_custom_modules_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_effective_event_threat_detection_custom_modules", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Cloud::SecurityCenterManagement::V1::ListEffectiveEventThreatDetectionCustomModulesResponse.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_effective_event_threat_detection_custom_module REST call + # + # @param request_pb [::Google::Cloud::SecurityCenterManagement::V1::GetEffectiveEventThreatDetectionCustomModuleRequest] + # A request object representing the call parameters. Required. + # @param options [::Gapic::CallOptions] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Cloud::SecurityCenterManagement::V1::EffectiveEventThreatDetectionCustomModule] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::SecurityCenterManagement::V1::EffectiveEventThreatDetectionCustomModule] + # A result object deserialized from the server's reply + def get_effective_event_threat_detection_custom_module request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_get_effective_event_threat_detection_custom_module_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_effective_event_threat_detection_custom_module", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Cloud::SecurityCenterManagement::V1::EffectiveEventThreatDetectionCustomModule.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_event_threat_detection_custom_modules REST call + # + # @param request_pb [::Google::Cloud::SecurityCenterManagement::V1::ListEventThreatDetectionCustomModulesRequest] + # A request object representing the call parameters. Required. + # @param options [::Gapic::CallOptions] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Cloud::SecurityCenterManagement::V1::ListEventThreatDetectionCustomModulesResponse] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::SecurityCenterManagement::V1::ListEventThreatDetectionCustomModulesResponse] + # A result object deserialized from the server's reply + def list_event_threat_detection_custom_modules request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_list_event_threat_detection_custom_modules_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_event_threat_detection_custom_modules", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Cloud::SecurityCenterManagement::V1::ListEventThreatDetectionCustomModulesResponse.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_descendant_event_threat_detection_custom_modules REST call + # + # @param request_pb [::Google::Cloud::SecurityCenterManagement::V1::ListDescendantEventThreatDetectionCustomModulesRequest] + # A request object representing the call parameters. Required. + # @param options [::Gapic::CallOptions] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Cloud::SecurityCenterManagement::V1::ListDescendantEventThreatDetectionCustomModulesResponse] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::SecurityCenterManagement::V1::ListDescendantEventThreatDetectionCustomModulesResponse] + # A result object deserialized from the server's reply + def list_descendant_event_threat_detection_custom_modules request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_list_descendant_event_threat_detection_custom_modules_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_descendant_event_threat_detection_custom_modules", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Cloud::SecurityCenterManagement::V1::ListDescendantEventThreatDetectionCustomModulesResponse.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_event_threat_detection_custom_module REST call + # + # @param request_pb [::Google::Cloud::SecurityCenterManagement::V1::GetEventThreatDetectionCustomModuleRequest] + # A request object representing the call parameters. Required. + # @param options [::Gapic::CallOptions] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Cloud::SecurityCenterManagement::V1::EventThreatDetectionCustomModule] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::SecurityCenterManagement::V1::EventThreatDetectionCustomModule] + # A result object deserialized from the server's reply + def get_event_threat_detection_custom_module request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_get_event_threat_detection_custom_module_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_event_threat_detection_custom_module", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Cloud::SecurityCenterManagement::V1::EventThreatDetectionCustomModule.decode_json response.body, ignore_unknown_fields: true + catch :response do + yield result, operation if block_given? + result + end + end + + ## + # Baseline implementation for the create_event_threat_detection_custom_module REST call + # + # @param request_pb [::Google::Cloud::SecurityCenterManagement::V1::CreateEventThreatDetectionCustomModuleRequest] + # A request object representing the call parameters. Required. + # @param options [::Gapic::CallOptions] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Cloud::SecurityCenterManagement::V1::EventThreatDetectionCustomModule] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::SecurityCenterManagement::V1::EventThreatDetectionCustomModule] + # A result object deserialized from the server's reply + def create_event_threat_detection_custom_module request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_create_event_threat_detection_custom_module_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_event_threat_detection_custom_module", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Cloud::SecurityCenterManagement::V1::EventThreatDetectionCustomModule.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_event_threat_detection_custom_module REST call + # + # @param request_pb [::Google::Cloud::SecurityCenterManagement::V1::UpdateEventThreatDetectionCustomModuleRequest] + # A request object representing the call parameters. Required. + # @param options [::Gapic::CallOptions] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Cloud::SecurityCenterManagement::V1::EventThreatDetectionCustomModule] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::SecurityCenterManagement::V1::EventThreatDetectionCustomModule] + # A result object deserialized from the server's reply + def update_event_threat_detection_custom_module request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_update_event_threat_detection_custom_module_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_event_threat_detection_custom_module", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Cloud::SecurityCenterManagement::V1::EventThreatDetectionCustomModule.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_event_threat_detection_custom_module REST call + # + # @param request_pb [::Google::Cloud::SecurityCenterManagement::V1::DeleteEventThreatDetectionCustomModuleRequest] + # 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_event_threat_detection_custom_module request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_delete_event_threat_detection_custom_module_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_event_threat_detection_custom_module", + 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 validate_event_threat_detection_custom_module REST call + # + # @param request_pb [::Google::Cloud::SecurityCenterManagement::V1::ValidateEventThreatDetectionCustomModuleRequest] + # A request object representing the call parameters. Required. + # @param options [::Gapic::CallOptions] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Cloud::SecurityCenterManagement::V1::ValidateEventThreatDetectionCustomModuleResponse] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::SecurityCenterManagement::V1::ValidateEventThreatDetectionCustomModuleResponse] + # A result object deserialized from the server's reply + def validate_event_threat_detection_custom_module request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_validate_event_threat_detection_custom_module_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: "validate_event_threat_detection_custom_module", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Cloud::SecurityCenterManagement::V1::ValidateEventThreatDetectionCustomModuleResponse.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_security_center_service REST call + # + # @param request_pb [::Google::Cloud::SecurityCenterManagement::V1::GetSecurityCenterServiceRequest] + # A request object representing the call parameters. Required. + # @param options [::Gapic::CallOptions] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Cloud::SecurityCenterManagement::V1::SecurityCenterService] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::SecurityCenterManagement::V1::SecurityCenterService] + # A result object deserialized from the server's reply + def get_security_center_service request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_get_security_center_service_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_security_center_service", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Cloud::SecurityCenterManagement::V1::SecurityCenterService.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_security_center_services REST call + # + # @param request_pb [::Google::Cloud::SecurityCenterManagement::V1::ListSecurityCenterServicesRequest] + # A request object representing the call parameters. Required. + # @param options [::Gapic::CallOptions] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Cloud::SecurityCenterManagement::V1::ListSecurityCenterServicesResponse] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::SecurityCenterManagement::V1::ListSecurityCenterServicesResponse] + # A result object deserialized from the server's reply + def list_security_center_services request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_list_security_center_services_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_security_center_services", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Cloud::SecurityCenterManagement::V1::ListSecurityCenterServicesResponse.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_security_center_service REST call + # + # @param request_pb [::Google::Cloud::SecurityCenterManagement::V1::UpdateSecurityCenterServiceRequest] + # A request object representing the call parameters. Required. + # @param options [::Gapic::CallOptions] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Cloud::SecurityCenterManagement::V1::SecurityCenterService] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::SecurityCenterManagement::V1::SecurityCenterService] + # A result object deserialized from the server's reply + def update_security_center_service request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_update_security_center_service_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_security_center_service", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Cloud::SecurityCenterManagement::V1::SecurityCenterService.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_effective_security_health_analytics_custom_modules REST call + # + # @param request_pb [::Google::Cloud::SecurityCenterManagement::V1::ListEffectiveSecurityHealthAnalyticsCustomModulesRequest] + # 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_effective_security_health_analytics_custom_modules_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :get, + uri_template: "/v1/{parent}/effectiveSecurityHealthAnalyticsCustomModules", + matches: [ + ["parent", %r{^projects/[^/]+/locations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{parent}/effectiveSecurityHealthAnalyticsCustomModules", + matches: [ + ["parent", %r{^folders/[^/]+/locations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{parent}/effectiveSecurityHealthAnalyticsCustomModules", + matches: [ + ["parent", %r{^organizations/[^/]+/locations/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the get_effective_security_health_analytics_custom_module REST call + # + # @param request_pb [::Google::Cloud::SecurityCenterManagement::V1::GetEffectiveSecurityHealthAnalyticsCustomModuleRequest] + # 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_effective_security_health_analytics_custom_module_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/effectiveSecurityHealthAnalyticsCustomModules/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^folders/[^/]+/locations/[^/]+/effectiveSecurityHealthAnalyticsCustomModules/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^organizations/[^/]+/locations/[^/]+/effectiveSecurityHealthAnalyticsCustomModules/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the list_security_health_analytics_custom_modules REST call + # + # @param request_pb [::Google::Cloud::SecurityCenterManagement::V1::ListSecurityHealthAnalyticsCustomModulesRequest] + # 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_security_health_analytics_custom_modules_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :get, + uri_template: "/v1/{parent}/securityHealthAnalyticsCustomModules", + matches: [ + ["parent", %r{^projects/[^/]+/locations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{parent}/securityHealthAnalyticsCustomModules", + matches: [ + ["parent", %r{^folders/[^/]+/locations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{parent}/securityHealthAnalyticsCustomModules", + matches: [ + ["parent", %r{^organizations/[^/]+/locations/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the list_descendant_security_health_analytics_custom_modules REST call + # + # @param request_pb [::Google::Cloud::SecurityCenterManagement::V1::ListDescendantSecurityHealthAnalyticsCustomModulesRequest] + # 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_descendant_security_health_analytics_custom_modules_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :get, + uri_template: "/v1/{parent}/securityHealthAnalyticsCustomModules:listDescendant", + matches: [ + ["parent", %r{^projects/[^/]+/locations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{parent}/securityHealthAnalyticsCustomModules:listDescendant", + matches: [ + ["parent", %r{^folders/[^/]+/locations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{parent}/securityHealthAnalyticsCustomModules:listDescendant", + matches: [ + ["parent", %r{^organizations/[^/]+/locations/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the get_security_health_analytics_custom_module REST call + # + # @param request_pb [::Google::Cloud::SecurityCenterManagement::V1::GetSecurityHealthAnalyticsCustomModuleRequest] + # 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_security_health_analytics_custom_module_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/securityHealthAnalyticsCustomModules/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^folders/[^/]+/locations/[^/]+/securityHealthAnalyticsCustomModules/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^organizations/[^/]+/locations/[^/]+/securityHealthAnalyticsCustomModules/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the create_security_health_analytics_custom_module REST call + # + # @param request_pb [::Google::Cloud::SecurityCenterManagement::V1::CreateSecurityHealthAnalyticsCustomModuleRequest] + # 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_security_health_analytics_custom_module_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :post, + uri_template: "/v1/{parent}/securityHealthAnalyticsCustomModules", + body: "security_health_analytics_custom_module", + matches: [ + ["parent", %r{^projects/[^/]+/locations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{parent}/securityHealthAnalyticsCustomModules", + body: "security_health_analytics_custom_module", + matches: [ + ["parent", %r{^folders/[^/]+/locations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{parent}/securityHealthAnalyticsCustomModules", + body: "security_health_analytics_custom_module", + matches: [ + ["parent", %r{^organizations/[^/]+/locations/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the update_security_health_analytics_custom_module REST call + # + # @param request_pb [::Google::Cloud::SecurityCenterManagement::V1::UpdateSecurityHealthAnalyticsCustomModuleRequest] + # 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_security_health_analytics_custom_module_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :patch, + uri_template: "/v1/{security_health_analytics_custom_module.name}", + body: "security_health_analytics_custom_module", + matches: [ + ["security_health_analytics_custom_module.name", %r{^projects/[^/]+/locations/[^/]+/securityHealthAnalyticsCustomModules/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :patch, + uri_template: "/v1/{security_health_analytics_custom_module.name}", + body: "security_health_analytics_custom_module", + matches: [ + ["security_health_analytics_custom_module.name", %r{^folders/[^/]+/locations/[^/]+/securityHealthAnalyticsCustomModules/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :patch, + uri_template: "/v1/{security_health_analytics_custom_module.name}", + body: "security_health_analytics_custom_module", + matches: [ + ["security_health_analytics_custom_module.name", %r{^organizations/[^/]+/locations/[^/]+/securityHealthAnalyticsCustomModules/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the delete_security_health_analytics_custom_module REST call + # + # @param request_pb [::Google::Cloud::SecurityCenterManagement::V1::DeleteSecurityHealthAnalyticsCustomModuleRequest] + # 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_security_health_analytics_custom_module_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :delete, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/securityHealthAnalyticsCustomModules/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^folders/[^/]+/locations/[^/]+/securityHealthAnalyticsCustomModules/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^organizations/[^/]+/locations/[^/]+/securityHealthAnalyticsCustomModules/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the simulate_security_health_analytics_custom_module REST call + # + # @param request_pb [::Google::Cloud::SecurityCenterManagement::V1::SimulateSecurityHealthAnalyticsCustomModuleRequest] + # A request object representing the call parameters. Required. + # @return [Array(String, [String, nil], Hash{String => String})] + # Uri, Body, Query string parameters + def self.transcode_simulate_security_health_analytics_custom_module_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :post, + uri_template: "/v1/{parent}/securityHealthAnalyticsCustomModules:simulate", + body: "*", + matches: [ + ["parent", %r{^projects/[^/]+/locations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{parent}/securityHealthAnalyticsCustomModules:simulate", + body: "*", + matches: [ + ["parent", %r{^folders/[^/]+/locations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{parent}/securityHealthAnalyticsCustomModules:simulate", + body: "*", + matches: [ + ["parent", %r{^organizations/[^/]+/locations/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the list_effective_event_threat_detection_custom_modules REST call + # + # @param request_pb [::Google::Cloud::SecurityCenterManagement::V1::ListEffectiveEventThreatDetectionCustomModulesRequest] + # 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_effective_event_threat_detection_custom_modules_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :get, + uri_template: "/v1/{parent}/effectiveEventThreatDetectionCustomModules", + matches: [ + ["parent", %r{^projects/[^/]+/locations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{parent}/effectiveEventThreatDetectionCustomModules", + matches: [ + ["parent", %r{^folders/[^/]+/locations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{parent}/effectiveEventThreatDetectionCustomModules", + matches: [ + ["parent", %r{^organizations/[^/]+/locations/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the get_effective_event_threat_detection_custom_module REST call + # + # @param request_pb [::Google::Cloud::SecurityCenterManagement::V1::GetEffectiveEventThreatDetectionCustomModuleRequest] + # 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_effective_event_threat_detection_custom_module_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/effectiveEventThreatDetectionCustomModules/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^folders/[^/]+/locations/[^/]+/effectiveEventThreatDetectionCustomModules/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^organizations/[^/]+/locations/[^/]+/effectiveEventThreatDetectionCustomModules/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the list_event_threat_detection_custom_modules REST call + # + # @param request_pb [::Google::Cloud::SecurityCenterManagement::V1::ListEventThreatDetectionCustomModulesRequest] + # 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_event_threat_detection_custom_modules_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :get, + uri_template: "/v1/{parent}/eventThreatDetectionCustomModules", + matches: [ + ["parent", %r{^projects/[^/]+/locations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{parent}/eventThreatDetectionCustomModules", + matches: [ + ["parent", %r{^folders/[^/]+/locations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{parent}/eventThreatDetectionCustomModules", + matches: [ + ["parent", %r{^organizations/[^/]+/locations/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the list_descendant_event_threat_detection_custom_modules REST call + # + # @param request_pb [::Google::Cloud::SecurityCenterManagement::V1::ListDescendantEventThreatDetectionCustomModulesRequest] + # 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_descendant_event_threat_detection_custom_modules_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :get, + uri_template: "/v1/{parent}/eventThreatDetectionCustomModules:listDescendant", + matches: [ + ["parent", %r{^projects/[^/]+/locations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{parent}/eventThreatDetectionCustomModules:listDescendant", + matches: [ + ["parent", %r{^folders/[^/]+/locations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{parent}/eventThreatDetectionCustomModules:listDescendant", + matches: [ + ["parent", %r{^organizations/[^/]+/locations/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the get_event_threat_detection_custom_module REST call + # + # @param request_pb [::Google::Cloud::SecurityCenterManagement::V1::GetEventThreatDetectionCustomModuleRequest] + # 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_event_threat_detection_custom_module_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/eventThreatDetectionCustomModules/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^folders/[^/]+/locations/[^/]+/eventThreatDetectionCustomModules/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^organizations/[^/]+/locations/[^/]+/eventThreatDetectionCustomModules/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the create_event_threat_detection_custom_module REST call + # + # @param request_pb [::Google::Cloud::SecurityCenterManagement::V1::CreateEventThreatDetectionCustomModuleRequest] + # 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_event_threat_detection_custom_module_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :post, + uri_template: "/v1/{parent}/eventThreatDetectionCustomModules", + body: "event_threat_detection_custom_module", + matches: [ + ["parent", %r{^projects/[^/]+/locations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{parent}/eventThreatDetectionCustomModules", + body: "event_threat_detection_custom_module", + matches: [ + ["parent", %r{^folders/[^/]+/locations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{parent}/eventThreatDetectionCustomModules", + body: "event_threat_detection_custom_module", + matches: [ + ["parent", %r{^organizations/[^/]+/locations/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the update_event_threat_detection_custom_module REST call + # + # @param request_pb [::Google::Cloud::SecurityCenterManagement::V1::UpdateEventThreatDetectionCustomModuleRequest] + # 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_event_threat_detection_custom_module_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :patch, + uri_template: "/v1/{event_threat_detection_custom_module.name}", + body: "event_threat_detection_custom_module", + matches: [ + ["event_threat_detection_custom_module.name", %r{^projects/[^/]+/locations/[^/]+/eventThreatDetectionCustomModules/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :patch, + uri_template: "/v1/{event_threat_detection_custom_module.name}", + body: "event_threat_detection_custom_module", + matches: [ + ["event_threat_detection_custom_module.name", %r{^folders/[^/]+/locations/[^/]+/eventThreatDetectionCustomModules/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :patch, + uri_template: "/v1/{event_threat_detection_custom_module.name}", + body: "event_threat_detection_custom_module", + matches: [ + ["event_threat_detection_custom_module.name", %r{^organizations/[^/]+/locations/[^/]+/eventThreatDetectionCustomModules/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the delete_event_threat_detection_custom_module REST call + # + # @param request_pb [::Google::Cloud::SecurityCenterManagement::V1::DeleteEventThreatDetectionCustomModuleRequest] + # 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_event_threat_detection_custom_module_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :delete, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/eventThreatDetectionCustomModules/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^folders/[^/]+/locations/[^/]+/eventThreatDetectionCustomModules/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^organizations/[^/]+/locations/[^/]+/eventThreatDetectionCustomModules/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the validate_event_threat_detection_custom_module REST call + # + # @param request_pb [::Google::Cloud::SecurityCenterManagement::V1::ValidateEventThreatDetectionCustomModuleRequest] + # A request object representing the call parameters. Required. + # @return [Array(String, [String, nil], Hash{String => String})] + # Uri, Body, Query string parameters + def self.transcode_validate_event_threat_detection_custom_module_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :post, + uri_template: "/v1/{parent}/eventThreatDetectionCustomModules:validate", + body: "*", + matches: [ + ["parent", %r{^projects/[^/]+/locations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{parent}/eventThreatDetectionCustomModules:validate", + body: "*", + matches: [ + ["parent", %r{^folders/[^/]+/locations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{parent}/eventThreatDetectionCustomModules:validate", + body: "*", + matches: [ + ["parent", %r{^organizations/[^/]+/locations/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the get_security_center_service REST call + # + # @param request_pb [::Google::Cloud::SecurityCenterManagement::V1::GetSecurityCenterServiceRequest] + # 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_security_center_service_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/securityCenterServices/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^folders/[^/]+/locations/[^/]+/securityCenterServices/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^organizations/[^/]+/locations/[^/]+/securityCenterServices/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the list_security_center_services REST call + # + # @param request_pb [::Google::Cloud::SecurityCenterManagement::V1::ListSecurityCenterServicesRequest] + # 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_security_center_services_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :get, + uri_template: "/v1/{parent}/securityCenterServices", + matches: [ + ["parent", %r{^projects/[^/]+/locations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{parent}/securityCenterServices", + matches: [ + ["parent", %r{^folders/[^/]+/locations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{parent}/securityCenterServices", + matches: [ + ["parent", %r{^organizations/[^/]+/locations/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the update_security_center_service REST call + # + # @param request_pb [::Google::Cloud::SecurityCenterManagement::V1::UpdateSecurityCenterServiceRequest] + # 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_security_center_service_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :patch, + uri_template: "/v1/{security_center_service.name}", + body: "security_center_service", + matches: [ + ["security_center_service.name", %r{^projects/[^/]+/locations/[^/]+/securityCenterServices/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :patch, + uri_template: "/v1/{security_center_service.name}", + body: "security_center_service", + matches: [ + ["security_center_service.name", %r{^folders/[^/]+/locations/[^/]+/securityCenterServices/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :patch, + uri_template: "/v1/{security_center_service.name}", + body: "security_center_service", + matches: [ + ["security_center_service.name", %r{^organizations/[^/]+/locations/[^/]+/securityCenterServices/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + end + end + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-security_center_management-v1/lib/google/cloud/security_center_management/v1/version.rb b/owl-bot-staging/google-cloud-security_center_management-v1/lib/google/cloud/security_center_management/v1/version.rb new file mode 100644 index 000000000000..5a44413e0a99 --- /dev/null +++ b/owl-bot-staging/google-cloud-security_center_management-v1/lib/google/cloud/security_center_management/v1/version.rb @@ -0,0 +1,28 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + + +module Google + module Cloud + module SecurityCenterManagement + module V1 + VERSION = "0.0.1" + end + end + end +end diff --git a/owl-bot-staging/google-cloud-security_center_management-v1/lib/google/cloud/securitycentermanagement/v1/security_center_management_pb.rb b/owl-bot-staging/google-cloud-security_center_management-v1/lib/google/cloud/securitycentermanagement/v1/security_center_management_pb.rb new file mode 100644 index 000000000000..9dc6c4a10fff --- /dev/null +++ b/owl-bot-staging/google-cloud-security_center_management-v1/lib/google/cloud/securitycentermanagement/v1/security_center_management_pb.rb @@ -0,0 +1,86 @@ +# frozen_string_literal: true +# Generated by the protocol buffer compiler. DO NOT EDIT! +# source: google/cloud/securitycentermanagement/v1/security_center_management.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/v1/policy_pb' +require 'google/protobuf/empty_pb' +require 'google/protobuf/field_mask_pb' +require 'google/protobuf/struct_pb' +require 'google/protobuf/timestamp_pb' +require 'google/rpc/status_pb' +require 'google/type/expr_pb' + + +descriptor_data = "\nIgoogle/cloud/securitycentermanagement/v1/security_center_management.proto\x12(google.cloud.securitycentermanagement.v1\x1a\x1cgoogle/api/annotations.proto\x1a\x17google/api/client.proto\x1a\x1fgoogle/api/field_behavior.proto\x1a\x19google/api/resource.proto\x1a\x1agoogle/iam/v1/policy.proto\x1a\x1bgoogle/protobuf/empty.proto\x1a google/protobuf/field_mask.proto\x1a\x1cgoogle/protobuf/struct.proto\x1a\x1fgoogle/protobuf/timestamp.proto\x1a\x17google/rpc/status.proto\x1a\x16google/type/expr.proto\"\xbe\n\n\x15SecurityCenterService\x12\x11\n\x04name\x18\x01 \x01(\tB\x03\xe0\x41\x08\x12w\n\x19intended_enablement_state\x18\x02 \x01(\x0e\x32O.google.cloud.securitycentermanagement.v1.SecurityCenterService.EnablementStateB\x03\xe0\x41\x01\x12x\n\x1a\x65\x66\x66\x65\x63tive_enablement_state\x18\x03 \x01(\x0e\x32O.google.cloud.securitycentermanagement.v1.SecurityCenterService.EnablementStateB\x03\xe0\x41\x03\x12\x62\n\x07modules\x18\x04 \x03(\x0b\x32L.google.cloud.securitycentermanagement.v1.SecurityCenterService.ModulesEntryB\x03\xe0\x41\x01\x12\x34\n\x0bupdate_time\x18\x05 \x01(\x0b\x32\x1a.google.protobuf.TimestampB\x03\xe0\x41\x03\x12\x34\n\x0eservice_config\x18\x06 \x01(\x0b\x32\x17.google.protobuf.StructB\x03\xe0\x41\x01\x1a\x83\x02\n\x0eModuleSettings\x12w\n\x19intended_enablement_state\x18\x01 \x01(\x0e\x32O.google.cloud.securitycentermanagement.v1.SecurityCenterService.EnablementStateB\x03\xe0\x41\x01\x12x\n\x1a\x65\x66\x66\x65\x63tive_enablement_state\x18\x02 \x01(\x0e\x32O.google.cloud.securitycentermanagement.v1.SecurityCenterService.EnablementStateB\x03\xe0\x41\x03\x1a~\n\x0cModulesEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12]\n\x05value\x18\x02 \x01(\x0b\x32N.google.cloud.securitycentermanagement.v1.SecurityCenterService.ModuleSettings:\x02\x38\x01\"n\n\x0f\x45nablementState\x12 \n\x1c\x45NABLEMENT_STATE_UNSPECIFIED\x10\x00\x12\r\n\tINHERITED\x10\x01\x12\x0b\n\x07\x45NABLED\x10\x02\x12\x0c\n\x08\x44ISABLED\x10\x03\x12\x0f\n\x0bINGEST_ONLY\x10\x04:\xd8\x02\xea\x41\xd4\x02\n=securitycentermanagement.googleapis.com/SecurityCenterService\x12Hprojects/{project}/locations/{location}/securityCenterServices/{service}\x12\x46\x66olders/{folder}/locations/{location}/securityCenterServices/{service}\x12Rorganizations/{organization}/locations/{location}/securityCenterServices/{service}*\x16securityCenterServices2\x15securityCenterService\"\xee\x07\n,EffectiveSecurityHealthAnalyticsCustomModule\x12\x11\n\x04name\x18\x01 \x01(\tB\x03\xe0\x41\x08\x12R\n\rcustom_config\x18\x02 \x01(\x0b\x32\x36.google.cloud.securitycentermanagement.v1.CustomConfigB\x03\xe0\x41\x03\x12\x85\x01\n\x10\x65nablement_state\x18\x03 \x01(\x0e\x32\x66.google.cloud.securitycentermanagement.v1.EffectiveSecurityHealthAnalyticsCustomModule.EnablementStateB\x03\xe0\x41\x03\x12\x19\n\x0c\x64isplay_name\x18\x04 \x01(\tB\x03\xe0\x41\x03\"N\n\x0f\x45nablementState\x12 \n\x1c\x45NABLEMENT_STATE_UNSPECIFIED\x10\x00\x12\x0b\n\x07\x45NABLED\x10\x01\x12\x0c\n\x08\x44ISABLED\x10\x02:\xe3\x04\xea\x41\xdf\x04\nTsecuritycentermanagement.googleapis.com/EffectiveSecurityHealthAnalyticsCustomModule\x12\x93\x01organizations/{organization}/locations/{location}/effectiveSecurityHealthAnalyticsCustomModules/{effective_security_health_analytics_custom_module}\x12\x89\x01projects/{project}/locations/{location}/effectiveSecurityHealthAnalyticsCustomModules/{effective_security_health_analytics_custom_module}\x12\x87\x01\x66olders/{folder}/locations/{location}/effectiveSecurityHealthAnalyticsCustomModules/{effective_security_health_analytics_custom_module}*-effectiveSecurityHealthAnalyticsCustomModules2,effectiveSecurityHealthAnalyticsCustomModule\"\xd9\x01\n8ListEffectiveSecurityHealthAnalyticsCustomModulesRequest\x12l\n\x06parent\x18\x01 \x01(\tB\\\xe0\x41\x02\xfa\x41V\x12Tsecuritycentermanagement.googleapis.com/EffectiveSecurityHealthAnalyticsCustomModule\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\"\xe9\x01\n9ListEffectiveSecurityHealthAnalyticsCustomModulesResponse\x12\x92\x01\n2effective_security_health_analytics_custom_modules\x18\x01 \x03(\x0b\x32V.google.cloud.securitycentermanagement.v1.EffectiveSecurityHealthAnalyticsCustomModule\x12\x17\n\x0fnext_page_token\x18\x02 \x01(\t\"\xa4\x01\n6GetEffectiveSecurityHealthAnalyticsCustomModuleRequest\x12j\n\x04name\x18\x01 \x01(\tB\\\xe0\x41\x02\xfa\x41V\nTsecuritycentermanagement.googleapis.com/EffectiveSecurityHealthAnalyticsCustomModule\"\xd2\x08\n#SecurityHealthAnalyticsCustomModule\x12\x11\n\x04name\x18\x01 \x01(\tB\x03\xe0\x41\x08\x12\x19\n\x0c\x64isplay_name\x18\x02 \x01(\tB\x03\xe0\x41\x01\x12|\n\x10\x65nablement_state\x18\x03 \x01(\x0e\x32].google.cloud.securitycentermanagement.v1.SecurityHealthAnalyticsCustomModule.EnablementStateB\x03\xe0\x41\x01\x12\x34\n\x0bupdate_time\x18\x04 \x01(\x0b\x32\x1a.google.protobuf.TimestampB\x03\xe0\x41\x03\x12\x18\n\x0blast_editor\x18\x05 \x01(\tB\x03\xe0\x41\x03\x12l\n\x0f\x61ncestor_module\x18\x06 \x01(\tBS\xe0\x41\x03\xfa\x41M\nKsecuritycentermanagement.googleapis.com/SecurityHealthAnalyticsCustomModule\x12R\n\rcustom_config\x18\x07 \x01(\x0b\x32\x36.google.cloud.securitycentermanagement.v1.CustomConfigB\x03\xe0\x41\x01\"]\n\x0f\x45nablementState\x12 \n\x1c\x45NABLEMENT_STATE_UNSPECIFIED\x10\x00\x12\x0b\n\x07\x45NABLED\x10\x01\x12\x0c\n\x08\x44ISABLED\x10\x02\x12\r\n\tINHERITED\x10\x03:\x8d\x04\xea\x41\x89\x04\nKsecuritycentermanagement.googleapis.com/SecurityHealthAnalyticsCustomModule\x12\x80\x01organizations/{organization}/locations/{location}/securityHealthAnalyticsCustomModules/{security_health_analytics_custom_module}\x12vprojects/{project}/locations/{location}/securityHealthAnalyticsCustomModules/{security_health_analytics_custom_module}\x12tfolders/{folder}/locations/{location}/securityHealthAnalyticsCustomModules/{security_health_analytics_custom_module}*$securityHealthAnalyticsCustomModules2#securityHealthAnalyticsCustomModule\"\xeb\x05\n\x0c\x43ustomConfig\x12)\n\tpredicate\x18\x01 \x01(\x0b\x32\x11.google.type.ExprB\x03\xe0\x41\x01\x12\x63\n\rcustom_output\x18\x02 \x01(\x0b\x32G.google.cloud.securitycentermanagement.v1.CustomConfig.CustomOutputSpecB\x03\xe0\x41\x01\x12g\n\x11resource_selector\x18\x03 \x01(\x0b\x32G.google.cloud.securitycentermanagement.v1.CustomConfig.ResourceSelectorB\x03\xe0\x41\x01\x12V\n\x08severity\x18\x04 \x01(\x0e\x32?.google.cloud.securitycentermanagement.v1.CustomConfig.SeverityB\x03\xe0\x41\x01\x12\x18\n\x0b\x64\x65scription\x18\x05 \x01(\tB\x03\xe0\x41\x01\x12\x1b\n\x0erecommendation\x18\x06 \x01(\tB\x03\xe0\x41\x01\x1a\xce\x01\n\x10\x43ustomOutputSpec\x12i\n\nproperties\x18\x01 \x03(\x0b\x32P.google.cloud.securitycentermanagement.v1.CustomConfig.CustomOutputSpec.PropertyB\x03\xe0\x41\x01\x1aO\n\x08Property\x12\x11\n\x04name\x18\x01 \x01(\tB\x03\xe0\x41\x01\x12\x30\n\x10value_expression\x18\x02 \x01(\x0b\x32\x11.google.type.ExprB\x03\xe0\x41\x01\x1a/\n\x10ResourceSelector\x12\x1b\n\x0eresource_types\x18\x01 \x03(\tB\x03\xe0\x41\x01\"Q\n\x08Severity\x12\x18\n\x14SEVERITY_UNSPECIFIED\x10\x00\x12\x0c\n\x08\x43RITICAL\x10\x01\x12\x08\n\x04HIGH\x10\x02\x12\n\n\x06MEDIUM\x10\x03\x12\x07\n\x03LOW\x10\x04\"\xc7\x01\n/ListSecurityHealthAnalyticsCustomModulesRequest\x12\x63\n\x06parent\x18\x01 \x01(\tBS\xe0\x41\x02\xfa\x41M\x12Ksecuritycentermanagement.googleapis.com/SecurityHealthAnalyticsCustomModule\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\"\xcc\x01\n0ListSecurityHealthAnalyticsCustomModulesResponse\x12\x7f\n(security_health_analytics_custom_modules\x18\x01 \x03(\x0b\x32M.google.cloud.securitycentermanagement.v1.SecurityHealthAnalyticsCustomModule\x12\x17\n\x0fnext_page_token\x18\x02 \x01(\t\"\xd1\x01\n9ListDescendantSecurityHealthAnalyticsCustomModulesRequest\x12\x63\n\x06parent\x18\x01 \x01(\tBS\xe0\x41\x02\xfa\x41M\x12Ksecuritycentermanagement.googleapis.com/SecurityHealthAnalyticsCustomModule\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\"\xd6\x01\n:ListDescendantSecurityHealthAnalyticsCustomModulesResponse\x12\x7f\n(security_health_analytics_custom_modules\x18\x01 \x03(\x0b\x32M.google.cloud.securitycentermanagement.v1.SecurityHealthAnalyticsCustomModule\x12\x17\n\x0fnext_page_token\x18\x02 \x01(\t\"\x92\x01\n-GetSecurityHealthAnalyticsCustomModuleRequest\x12\x61\n\x04name\x18\x01 \x01(\tBS\xe0\x41\x02\xfa\x41M\nKsecuritycentermanagement.googleapis.com/SecurityHealthAnalyticsCustomModule\"\xb9\x02\n0CreateSecurityHealthAnalyticsCustomModuleRequest\x12\x63\n\x06parent\x18\x01 \x01(\tBS\xe0\x41\x02\xfa\x41M\x12Ksecuritycentermanagement.googleapis.com/SecurityHealthAnalyticsCustomModule\x12\x83\x01\n\'security_health_analytics_custom_module\x18\x02 \x01(\x0b\x32M.google.cloud.securitycentermanagement.v1.SecurityHealthAnalyticsCustomModuleB\x03\xe0\x41\x02\x12\x1a\n\rvalidate_only\x18\x03 \x01(\x08\x42\x03\xe0\x41\x01\"\x8a\x02\n0UpdateSecurityHealthAnalyticsCustomModuleRequest\x12\x34\n\x0bupdate_mask\x18\x01 \x01(\x0b\x32\x1a.google.protobuf.FieldMaskB\x03\xe0\x41\x02\x12\x83\x01\n\'security_health_analytics_custom_module\x18\x02 \x01(\x0b\x32M.google.cloud.securitycentermanagement.v1.SecurityHealthAnalyticsCustomModuleB\x03\xe0\x41\x02\x12\x1a\n\rvalidate_only\x18\x03 \x01(\x08\x42\x03\xe0\x41\x01\"\xb1\x01\n0DeleteSecurityHealthAnalyticsCustomModuleRequest\x12\x61\n\x04name\x18\x01 \x01(\tBS\xe0\x41\x02\xfa\x41M\nKsecuritycentermanagement.googleapis.com/SecurityHealthAnalyticsCustomModule\x12\x1a\n\rvalidate_only\x18\x02 \x01(\x08\x42\x03\xe0\x41\x01\"\xc1\x03\n2SimulateSecurityHealthAnalyticsCustomModuleRequest\x12\x13\n\x06parent\x18\x01 \x01(\tB\x03\xe0\x41\x02\x12R\n\rcustom_config\x18\x02 \x01(\x0b\x32\x36.google.cloud.securitycentermanagement.v1.CustomConfigB\x03\xe0\x41\x02\x12\x85\x01\n\x08resource\x18\x03 \x01(\x0b\x32n.google.cloud.securitycentermanagement.v1.SimulateSecurityHealthAnalyticsCustomModuleRequest.SimulatedResourceB\x03\xe0\x41\x02\x1a\x99\x01\n\x11SimulatedResource\x12\x1a\n\rresource_type\x18\x01 \x01(\tB\x03\xe0\x41\x02\x12\x33\n\rresource_data\x18\x02 \x01(\x0b\x32\x17.google.protobuf.StructB\x03\xe0\x41\x01\x12\x33\n\x0fiam_policy_data\x18\x03 \x01(\x0b\x32\x15.google.iam.v1.PolicyB\x03\xe0\x41\x01\"\x8a\t\n\x10SimulatedFinding\x12\x11\n\x04name\x18\x01 \x01(\tB\x03\xe0\x41\x08\x12\x0e\n\x06parent\x18\x02 \x01(\t\x12\x15\n\rresource_name\x18\x03 \x01(\t\x12\x10\n\x08\x63\x61tegory\x18\x04 \x01(\t\x12T\n\x05state\x18\x05 \x01(\x0e\x32@.google.cloud.securitycentermanagement.v1.SimulatedFinding.StateB\x03\xe0\x41\x03\x12k\n\x11source_properties\x18\x06 \x03(\x0b\x32P.google.cloud.securitycentermanagement.v1.SimulatedFinding.SourcePropertiesEntry\x12.\n\nevent_time\x18\x07 \x01(\x0b\x32\x1a.google.protobuf.Timestamp\x12U\n\x08severity\x18\x08 \x01(\x0e\x32\x43.google.cloud.securitycentermanagement.v1.SimulatedFinding.Severity\x12^\n\rfinding_class\x18\t \x01(\x0e\x32G.google.cloud.securitycentermanagement.v1.SimulatedFinding.FindingClass\x1aO\n\x15SourcePropertiesEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12%\n\x05value\x18\x02 \x01(\x0b\x32\x16.google.protobuf.Value:\x02\x38\x01\"8\n\x05State\x12\x15\n\x11STATE_UNSPECIFIED\x10\x00\x12\n\n\x06\x41\x43TIVE\x10\x01\x12\x0c\n\x08INACTIVE\x10\x02\"Q\n\x08Severity\x12\x18\n\x14SEVERITY_UNSPECIFIED\x10\x00\x12\x0c\n\x08\x43RITICAL\x10\x01\x12\x08\n\x04HIGH\x10\x02\x12\n\n\x06MEDIUM\x10\x03\x12\x07\n\x03LOW\x10\x04\"\xb0\x01\n\x0c\x46indingClass\x12\x1d\n\x19\x46INDING_CLASS_UNSPECIFIED\x10\x00\x12\n\n\x06THREAT\x10\x01\x12\x11\n\rVULNERABILITY\x10\x02\x12\x14\n\x10MISCONFIGURATION\x10\x03\x12\x0f\n\x0bOBSERVATION\x10\x04\x12\r\n\tSCC_ERROR\x10\x05\x12\x15\n\x11POSTURE_VIOLATION\x10\x06\x12\x15\n\x11TOXIC_COMBINATION\x10\x07:\xee\x01\xea\x41\xea\x01\n%securitycenter.googleapis.com/Finding\x12@organizations/{organization}/sources/{source}/findings/{finding}\x12\x34\x66olders/{folder}/sources/{source}/findings/{finding}\x12\x36projects/{project}/sources/{source}/findings/{finding}*\x08\x66indings2\x07\x66inding\"\xf6\x02\n3SimulateSecurityHealthAnalyticsCustomModuleResponse\x12}\n\x06result\x18\x01 \x01(\x0b\x32m.google.cloud.securitycentermanagement.v1.SimulateSecurityHealthAnalyticsCustomModuleResponse.SimulatedResult\x1a\xbf\x01\n\x0fSimulatedResult\x12M\n\x07\x66inding\x18\x01 \x01(\x0b\x32:.google.cloud.securitycentermanagement.v1.SimulatedFindingH\x00\x12.\n\x0cno_violation\x18\x02 \x01(\x0b\x32\x16.google.protobuf.EmptyH\x00\x12#\n\x05\x65rror\x18\x03 \x01(\x0b\x32\x12.google.rpc.StatusH\x00\x42\x08\n\x06result\"\xd4\x07\n)EffectiveEventThreatDetectionCustomModule\x12\x11\n\x04name\x18\x01 \x01(\tB\x03\xe0\x41\x08\x12,\n\x06\x63onfig\x18\x02 \x01(\x0b\x32\x17.google.protobuf.StructB\x03\xe0\x41\x03\x12\x82\x01\n\x10\x65nablement_state\x18\x03 \x01(\x0e\x32\x63.google.cloud.securitycentermanagement.v1.EffectiveEventThreatDetectionCustomModule.EnablementStateB\x03\xe0\x41\x03\x12\x11\n\x04type\x18\x04 \x01(\tB\x03\xe0\x41\x03\x12\x19\n\x0c\x64isplay_name\x18\x05 \x01(\tB\x03\xe0\x41\x03\x12\x18\n\x0b\x64\x65scription\x18\x06 \x01(\tB\x03\xe0\x41\x03\"N\n\x0f\x45nablementState\x12 \n\x1c\x45NABLEMENT_STATE_UNSPECIFIED\x10\x00\x12\x0b\n\x07\x45NABLED\x10\x01\x12\x0c\n\x08\x44ISABLED\x10\x02:\xc8\x04\xea\x41\xc4\x04\nQsecuritycentermanagement.googleapis.com/EffectiveEventThreatDetectionCustomModule\x12\x8d\x01organizations/{organization}/locations/{location}/effectiveEventThreatDetectionCustomModules/{effective_event_threat_detection_custom_module}\x12\x83\x01projects/{project}/locations/{location}/effectiveEventThreatDetectionCustomModules/{effective_event_threat_detection_custom_module}\x12\x81\x01\x66olders/{folder}/locations/{location}/effectiveEventThreatDetectionCustomModules/{effective_event_threat_detection_custom_module}**effectiveEventThreatDetectionCustomModules2)effectiveEventThreatDetectionCustomModule\"\xd3\x01\n5ListEffectiveEventThreatDetectionCustomModulesRequest\x12i\n\x06parent\x18\x01 \x01(\tBY\xe0\x41\x02\xfa\x41S\x12Qsecuritycentermanagement.googleapis.com/EffectiveEventThreatDetectionCustomModule\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\"\xe0\x01\n6ListEffectiveEventThreatDetectionCustomModulesResponse\x12\x8c\x01\n/effective_event_threat_detection_custom_modules\x18\x01 \x03(\x0b\x32S.google.cloud.securitycentermanagement.v1.EffectiveEventThreatDetectionCustomModule\x12\x17\n\x0fnext_page_token\x18\x02 \x01(\t\"\x9e\x01\n3GetEffectiveEventThreatDetectionCustomModuleRequest\x12g\n\x04name\x18\x01 \x01(\tBY\xe0\x41\x02\xfa\x41S\nQsecuritycentermanagement.googleapis.com/EffectiveEventThreatDetectionCustomModule\"\xb4\x08\n EventThreatDetectionCustomModule\x12\x11\n\x04name\x18\x01 \x01(\tB\x03\xe0\x41\x08\x12,\n\x06\x63onfig\x18\x02 \x01(\x0b\x32\x17.google.protobuf.StructB\x03\xe0\x41\x01\x12i\n\x0f\x61ncestor_module\x18\x03 \x01(\tBP\xe0\x41\x03\xfa\x41J\nHsecuritycentermanagement.googleapis.com/EventThreatDetectionCustomModule\x12y\n\x10\x65nablement_state\x18\x04 \x01(\x0e\x32Z.google.cloud.securitycentermanagement.v1.EventThreatDetectionCustomModule.EnablementStateB\x03\xe0\x41\x01\x12\x11\n\x04type\x18\x05 \x01(\tB\x03\xe0\x41\x01\x12\x19\n\x0c\x64isplay_name\x18\x06 \x01(\tB\x03\xe0\x41\x01\x12\x18\n\x0b\x64\x65scription\x18\x07 \x01(\tB\x03\xe0\x41\x01\x12\x34\n\x0bupdate_time\x18\x08 \x01(\x0b\x32\x1a.google.protobuf.TimestampB\x03\xe0\x41\x03\x12\x18\n\x0blast_editor\x18\t \x01(\tB\x03\xe0\x41\x03\"]\n\x0f\x45nablementState\x12 \n\x1c\x45NABLEMENT_STATE_UNSPECIFIED\x10\x00\x12\x0b\n\x07\x45NABLED\x10\x01\x12\x0c\n\x08\x44ISABLED\x10\x02\x12\r\n\tINHERITED\x10\x03:\xf1\x03\xea\x41\xed\x03\nHsecuritycentermanagement.googleapis.com/EventThreatDetectionCustomModule\x12zorganizations/{organization}/locations/{location}/eventThreatDetectionCustomModules/{event_threat_detection_custom_module}\x12pprojects/{project}/locations/{location}/eventThreatDetectionCustomModules/{event_threat_detection_custom_module}\x12nfolders/{folder}/locations/{location}/eventThreatDetectionCustomModules/{event_threat_detection_custom_module}*!eventThreatDetectionCustomModules2 eventThreatDetectionCustomModule\"\xc1\x01\n,ListEventThreatDetectionCustomModulesRequest\x12`\n\x06parent\x18\x01 \x01(\tBP\xe0\x41\x02\xfa\x41J\x12Hsecuritycentermanagement.googleapis.com/EventThreatDetectionCustomModule\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\"\xc3\x01\n-ListEventThreatDetectionCustomModulesResponse\x12y\n%event_threat_detection_custom_modules\x18\x01 \x03(\x0b\x32J.google.cloud.securitycentermanagement.v1.EventThreatDetectionCustomModule\x12\x17\n\x0fnext_page_token\x18\x02 \x01(\t\"\xcb\x01\n6ListDescendantEventThreatDetectionCustomModulesRequest\x12`\n\x06parent\x18\x01 \x01(\tBP\xe0\x41\x02\xfa\x41J\x12Hsecuritycentermanagement.googleapis.com/EventThreatDetectionCustomModule\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\"\xcd\x01\n7ListDescendantEventThreatDetectionCustomModulesResponse\x12y\n%event_threat_detection_custom_modules\x18\x01 \x03(\x0b\x32J.google.cloud.securitycentermanagement.v1.EventThreatDetectionCustomModule\x12\x17\n\x0fnext_page_token\x18\x02 \x01(\t\"\x8c\x01\n*GetEventThreatDetectionCustomModuleRequest\x12^\n\x04name\x18\x01 \x01(\tBP\xe0\x41\x02\xfa\x41J\nHsecuritycentermanagement.googleapis.com/EventThreatDetectionCustomModule\"\xac\x02\n-CreateEventThreatDetectionCustomModuleRequest\x12`\n\x06parent\x18\x01 \x01(\tBP\xe0\x41\x02\xfa\x41J\x12Hsecuritycentermanagement.googleapis.com/EventThreatDetectionCustomModule\x12}\n$event_threat_detection_custom_module\x18\x03 \x01(\x0b\x32J.google.cloud.securitycentermanagement.v1.EventThreatDetectionCustomModuleB\x03\xe0\x41\x02\x12\x1a\n\rvalidate_only\x18\x04 \x01(\x08\x42\x03\xe0\x41\x01\"\x80\x02\n-UpdateEventThreatDetectionCustomModuleRequest\x12\x34\n\x0bupdate_mask\x18\x01 \x01(\x0b\x32\x1a.google.protobuf.FieldMaskB\x03\xe0\x41\x02\x12}\n$event_threat_detection_custom_module\x18\x02 \x01(\x0b\x32J.google.cloud.securitycentermanagement.v1.EventThreatDetectionCustomModuleB\x03\xe0\x41\x02\x12\x1a\n\rvalidate_only\x18\x03 \x01(\x08\x42\x03\xe0\x41\x01\"\xab\x01\n-DeleteEventThreatDetectionCustomModuleRequest\x12^\n\x04name\x18\x01 \x01(\tBP\xe0\x41\x02\xfa\x41J\nHsecuritycentermanagement.googleapis.com/EventThreatDetectionCustomModule\x12\x1a\n\rvalidate_only\x18\x02 \x01(\x08\x42\x03\xe0\x41\x01\"\xbd\x01\n/ValidateEventThreatDetectionCustomModuleRequest\x12`\n\x06parent\x18\x01 \x01(\tBP\xe0\x41\x02\xfa\x41J\x12Hsecuritycentermanagement.googleapis.com/EventThreatDetectionCustomModule\x12\x15\n\x08raw_text\x18\x02 \x01(\tB\x03\xe0\x41\x02\x12\x11\n\x04type\x18\x03 \x01(\tB\x03\xe0\x41\x02\"\xbe\x04\n0ValidateEventThreatDetectionCustomModuleResponse\x12\x86\x01\n\x06\x65rrors\x18\x02 \x03(\x0b\x32v.google.cloud.securitycentermanagement.v1.ValidateEventThreatDetectionCustomModuleResponse.CustomModuleValidationError\x1a\xc8\x02\n\x1b\x43ustomModuleValidationError\x12\x13\n\x0b\x64\x65scription\x18\x01 \x01(\t\x12\x12\n\nfield_path\x18\x02 \x01(\t\x12w\n\x05start\x18\x03 \x01(\x0b\x32\x63.google.cloud.securitycentermanagement.v1.ValidateEventThreatDetectionCustomModuleResponse.PositionH\x00\x88\x01\x01\x12u\n\x03\x65nd\x18\x04 \x01(\x0b\x32\x63.google.cloud.securitycentermanagement.v1.ValidateEventThreatDetectionCustomModuleResponse.PositionH\x01\x88\x01\x01\x42\x08\n\x06_startB\x06\n\x04_end\x1a\x36\n\x08Position\x12\x13\n\x0bline_number\x18\x01 \x01(\x05\x12\x15\n\rcolumn_number\x18\x02 \x01(\x05\"\x9a\x01\n\x1fGetSecurityCenterServiceRequest\x12S\n\x04name\x18\x01 \x01(\tBE\xe0\x41\x02\xfa\x41?\n=securitycentermanagement.googleapis.com/SecurityCenterService\x12\"\n\x1ashow_eligible_modules_only\x18\x02 \x01(\x08\"\xcf\x01\n!ListSecurityCenterServicesRequest\x12U\n\x06parent\x18\x01 \x01(\tBE\xe0\x41\x02\xfa\x41?\x12=securitycentermanagement.googleapis.com/SecurityCenterService\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\"\n\x1ashow_eligible_modules_only\x18\x04 \x01(\x08\"\xa0\x01\n\"ListSecurityCenterServicesResponse\x12\x61\n\x18security_center_services\x18\x01 \x03(\x0b\x32?.google.cloud.securitycentermanagement.v1.SecurityCenterService\x12\x17\n\x0fnext_page_token\x18\x02 \x01(\t\"\xdd\x01\n\"UpdateSecurityCenterServiceRequest\x12\x65\n\x17security_center_service\x18\x01 \x01(\x0b\x32?.google.cloud.securitycentermanagement.v1.SecurityCenterServiceB\x03\xe0\x41\x02\x12\x34\n\x0bupdate_mask\x18\x02 \x01(\x0b\x32\x1a.google.protobuf.FieldMaskB\x03\xe0\x41\x02\x12\x1a\n\rvalidate_only\x18\x03 \x01(\x08\x42\x03\xe0\x41\x01\x32\xceU\n\x18SecurityCenterManagement\x12\x90\x04\n1ListEffectiveSecurityHealthAnalyticsCustomModules\x12\x62.google.cloud.securitycentermanagement.v1.ListEffectiveSecurityHealthAnalyticsCustomModulesRequest\x1a\x63.google.cloud.securitycentermanagement.v1.ListEffectiveSecurityHealthAnalyticsCustomModulesResponse\"\x91\x02\xda\x41\x06parent\x82\xd3\xe4\x93\x02\x81\x02\x12Q/v1/{parent=projects/*/locations/*}/effectiveSecurityHealthAnalyticsCustomModulesZR\x12P/v1/{parent=folders/*/locations/*}/effectiveSecurityHealthAnalyticsCustomModulesZX\x12V/v1/{parent=organizations/*/locations/*}/effectiveSecurityHealthAnalyticsCustomModules\x12\xfd\x03\n/GetEffectiveSecurityHealthAnalyticsCustomModule\x12`.google.cloud.securitycentermanagement.v1.GetEffectiveSecurityHealthAnalyticsCustomModuleRequest\x1aV.google.cloud.securitycentermanagement.v1.EffectiveSecurityHealthAnalyticsCustomModule\"\x8f\x02\xda\x41\x04name\x82\xd3\xe4\x93\x02\x81\x02\x12Q/v1/{name=projects/*/locations/*/effectiveSecurityHealthAnalyticsCustomModules/*}ZR\x12P/v1/{name=folders/*/locations/*/effectiveSecurityHealthAnalyticsCustomModules/*}ZX\x12V/v1/{name=organizations/*/locations/*/effectiveSecurityHealthAnalyticsCustomModules/*}\x12\xda\x03\n(ListSecurityHealthAnalyticsCustomModules\x12Y.google.cloud.securitycentermanagement.v1.ListSecurityHealthAnalyticsCustomModulesRequest\x1aZ.google.cloud.securitycentermanagement.v1.ListSecurityHealthAnalyticsCustomModulesResponse\"\xf6\x01\xda\x41\x06parent\x82\xd3\xe4\x93\x02\xe6\x01\x12H/v1/{parent=projects/*/locations/*}/securityHealthAnalyticsCustomModulesZI\x12G/v1/{parent=folders/*/locations/*}/securityHealthAnalyticsCustomModulesZO\x12M/v1/{parent=organizations/*/locations/*}/securityHealthAnalyticsCustomModules\x12\xa5\x04\n2ListDescendantSecurityHealthAnalyticsCustomModules\x12\x63.google.cloud.securitycentermanagement.v1.ListDescendantSecurityHealthAnalyticsCustomModulesRequest\x1a\x64.google.cloud.securitycentermanagement.v1.ListDescendantSecurityHealthAnalyticsCustomModulesResponse\"\xa3\x02\xda\x41\x06parent\x82\xd3\xe4\x93\x02\x93\x02\x12W/v1/{parent=projects/*/locations/*}/securityHealthAnalyticsCustomModules:listDescendantZX\x12V/v1/{parent=folders/*/locations/*}/securityHealthAnalyticsCustomModules:listDescendantZ^\x12\\/v1/{parent=organizations/*/locations/*}/securityHealthAnalyticsCustomModules:listDescendant\x12\xc7\x03\n&GetSecurityHealthAnalyticsCustomModule\x12W.google.cloud.securitycentermanagement.v1.GetSecurityHealthAnalyticsCustomModuleRequest\x1aM.google.cloud.securitycentermanagement.v1.SecurityHealthAnalyticsCustomModule\"\xf4\x01\xda\x41\x04name\x82\xd3\xe4\x93\x02\xe6\x01\x12H/v1/{name=projects/*/locations/*/securityHealthAnalyticsCustomModules/*}ZI\x12G/v1/{name=folders/*/locations/*/securityHealthAnalyticsCustomModules/*}ZO\x12M/v1/{name=organizations/*/locations/*/securityHealthAnalyticsCustomModules/*}\x12\xf2\x04\n)CreateSecurityHealthAnalyticsCustomModule\x12Z.google.cloud.securitycentermanagement.v1.CreateSecurityHealthAnalyticsCustomModuleRequest\x1aM.google.cloud.securitycentermanagement.v1.SecurityHealthAnalyticsCustomModule\"\x99\x03\xda\x41.parent,security_health_analytics_custom_module\x82\xd3\xe4\x93\x02\xe1\x02\"H/v1/{parent=projects/*/locations/*}/securityHealthAnalyticsCustomModules:\'security_health_analytics_custom_moduleZr\"G/v1/{parent=folders/*/locations/*}/securityHealthAnalyticsCustomModules:\'security_health_analytics_custom_moduleZx\"M/v1/{parent=organizations/*/locations/*}/securityHealthAnalyticsCustomModules:\'security_health_analytics_custom_module\x12\xf1\x05\n)UpdateSecurityHealthAnalyticsCustomModule\x12Z.google.cloud.securitycentermanagement.v1.UpdateSecurityHealthAnalyticsCustomModuleRequest\x1aM.google.cloud.securitycentermanagement.v1.SecurityHealthAnalyticsCustomModule\"\x98\x04\xda\x41\x33security_health_analytics_custom_module,update_mask\x82\xd3\xe4\x93\x02\xdb\x03\x32p/v1/{security_health_analytics_custom_module.name=projects/*/locations/*/securityHealthAnalyticsCustomModules/*}:\'security_health_analytics_custom_moduleZ\x9a\x01\x32o/v1/{security_health_analytics_custom_module.name=folders/*/locations/*/securityHealthAnalyticsCustomModules/*}:\'security_health_analytics_custom_moduleZ\xa0\x01\x32u/v1/{security_health_analytics_custom_module.name=organizations/*/locations/*/securityHealthAnalyticsCustomModules/*}:\'security_health_analytics_custom_module\x12\x96\x03\n)DeleteSecurityHealthAnalyticsCustomModule\x12Z.google.cloud.securitycentermanagement.v1.DeleteSecurityHealthAnalyticsCustomModuleRequest\x1a\x16.google.protobuf.Empty\"\xf4\x01\xda\x41\x04name\x82\xd3\xe4\x93\x02\xe6\x01*H/v1/{name=projects/*/locations/*/securityHealthAnalyticsCustomModules/*}ZI*G/v1/{name=folders/*/locations/*/securityHealthAnalyticsCustomModules/*}ZO*M/v1/{name=organizations/*/locations/*/securityHealthAnalyticsCustomModules/*}\x12\x9e\x04\n+SimulateSecurityHealthAnalyticsCustomModule\x12\\.google.cloud.securitycentermanagement.v1.SimulateSecurityHealthAnalyticsCustomModuleRequest\x1a].google.cloud.securitycentermanagement.v1.SimulateSecurityHealthAnalyticsCustomModuleResponse\"\xb1\x02\xda\x41\x1dparent,custom_config,resource\x82\xd3\xe4\x93\x02\x8a\x02\"Q/v1/{parent=projects/*/locations/*}/securityHealthAnalyticsCustomModules:simulate:\x01*ZU\"P/v1/{parent=folders/*/locations/*}/securityHealthAnalyticsCustomModules:simulate:\x01*Z[\"V/v1/{parent=organizations/*/locations/*}/securityHealthAnalyticsCustomModules:simulate:\x01*\x12\xfe\x03\n.ListEffectiveEventThreatDetectionCustomModules\x12_.google.cloud.securitycentermanagement.v1.ListEffectiveEventThreatDetectionCustomModulesRequest\x1a`.google.cloud.securitycentermanagement.v1.ListEffectiveEventThreatDetectionCustomModulesResponse\"\x88\x02\xda\x41\x06parent\x82\xd3\xe4\x93\x02\xf8\x01\x12N/v1/{parent=projects/*/locations/*}/effectiveEventThreatDetectionCustomModulesZO\x12M/v1/{parent=folders/*/locations/*}/effectiveEventThreatDetectionCustomModulesZU\x12S/v1/{parent=organizations/*/locations/*}/effectiveEventThreatDetectionCustomModules\x12\xeb\x03\n,GetEffectiveEventThreatDetectionCustomModule\x12].google.cloud.securitycentermanagement.v1.GetEffectiveEventThreatDetectionCustomModuleRequest\x1aS.google.cloud.securitycentermanagement.v1.EffectiveEventThreatDetectionCustomModule\"\x86\x02\xda\x41\x04name\x82\xd3\xe4\x93\x02\xf8\x01\x12N/v1/{name=projects/*/locations/*/effectiveEventThreatDetectionCustomModules/*}ZO\x12M/v1/{name=folders/*/locations/*/effectiveEventThreatDetectionCustomModules/*}ZU\x12S/v1/{name=organizations/*/locations/*/effectiveEventThreatDetectionCustomModules/*}\x12\xc8\x03\n%ListEventThreatDetectionCustomModules\x12V.google.cloud.securitycentermanagement.v1.ListEventThreatDetectionCustomModulesRequest\x1aW.google.cloud.securitycentermanagement.v1.ListEventThreatDetectionCustomModulesResponse\"\xed\x01\xda\x41\x06parent\x82\xd3\xe4\x93\x02\xdd\x01\x12\x45/v1/{parent=projects/*/locations/*}/eventThreatDetectionCustomModulesZF\x12\x44/v1/{parent=folders/*/locations/*}/eventThreatDetectionCustomModulesZL\x12J/v1/{parent=organizations/*/locations/*}/eventThreatDetectionCustomModules\x12\x93\x04\n/ListDescendantEventThreatDetectionCustomModules\x12`.google.cloud.securitycentermanagement.v1.ListDescendantEventThreatDetectionCustomModulesRequest\x1a\x61.google.cloud.securitycentermanagement.v1.ListDescendantEventThreatDetectionCustomModulesResponse\"\x9a\x02\xda\x41\x06parent\x82\xd3\xe4\x93\x02\x8a\x02\x12T/v1/{parent=projects/*/locations/*}/eventThreatDetectionCustomModules:listDescendantZU\x12S/v1/{parent=folders/*/locations/*}/eventThreatDetectionCustomModules:listDescendantZ[\x12Y/v1/{parent=organizations/*/locations/*}/eventThreatDetectionCustomModules:listDescendant\x12\xb5\x03\n#GetEventThreatDetectionCustomModule\x12T.google.cloud.securitycentermanagement.v1.GetEventThreatDetectionCustomModuleRequest\x1aJ.google.cloud.securitycentermanagement.v1.EventThreatDetectionCustomModule\"\xeb\x01\xda\x41\x04name\x82\xd3\xe4\x93\x02\xdd\x01\x12\x45/v1/{name=projects/*/locations/*/eventThreatDetectionCustomModules/*}ZF\x12\x44/v1/{name=folders/*/locations/*/eventThreatDetectionCustomModules/*}ZL\x12J/v1/{name=organizations/*/locations/*/eventThreatDetectionCustomModules/*}\x12\xd4\x04\n&CreateEventThreatDetectionCustomModule\x12W.google.cloud.securitycentermanagement.v1.CreateEventThreatDetectionCustomModuleRequest\x1aJ.google.cloud.securitycentermanagement.v1.EventThreatDetectionCustomModule\"\x84\x03\xda\x41+parent,event_threat_detection_custom_module\x82\xd3\xe4\x93\x02\xcf\x02\"E/v1/{parent=projects/*/locations/*}/eventThreatDetectionCustomModules:$event_threat_detection_custom_moduleZl\"D/v1/{parent=folders/*/locations/*}/eventThreatDetectionCustomModules:$event_threat_detection_custom_moduleZr\"J/v1/{parent=organizations/*/locations/*}/eventThreatDetectionCustomModules:$event_threat_detection_custom_module\x12\xca\x05\n&UpdateEventThreatDetectionCustomModule\x12W.google.cloud.securitycentermanagement.v1.UpdateEventThreatDetectionCustomModuleRequest\x1aJ.google.cloud.securitycentermanagement.v1.EventThreatDetectionCustomModule\"\xfa\x03\xda\x41\x30\x65vent_threat_detection_custom_module,update_mask\x82\xd3\xe4\x93\x02\xc0\x03\x32j/v1/{event_threat_detection_custom_module.name=projects/*/locations/*/eventThreatDetectionCustomModules/*}:$event_threat_detection_custom_moduleZ\x91\x01\x32i/v1/{event_threat_detection_custom_module.name=folders/*/locations/*/eventThreatDetectionCustomModules/*}:$event_threat_detection_custom_moduleZ\x97\x01\x32o/v1/{event_threat_detection_custom_module.name=organizations/*/locations/*/eventThreatDetectionCustomModules/*}:$event_threat_detection_custom_module\x12\x87\x03\n&DeleteEventThreatDetectionCustomModule\x12W.google.cloud.securitycentermanagement.v1.DeleteEventThreatDetectionCustomModuleRequest\x1a\x16.google.protobuf.Empty\"\xeb\x01\xda\x41\x04name\x82\xd3\xe4\x93\x02\xdd\x01*E/v1/{name=projects/*/locations/*/eventThreatDetectionCustomModules/*}ZF*D/v1/{name=folders/*/locations/*/eventThreatDetectionCustomModules/*}ZL*J/v1/{name=organizations/*/locations/*/eventThreatDetectionCustomModules/*}\x12\xec\x03\n(ValidateEventThreatDetectionCustomModule\x12Y.google.cloud.securitycentermanagement.v1.ValidateEventThreatDetectionCustomModuleRequest\x1aZ.google.cloud.securitycentermanagement.v1.ValidateEventThreatDetectionCustomModuleResponse\"\x88\x02\x82\xd3\xe4\x93\x02\x81\x02\"N/v1/{parent=projects/*/locations/*}/eventThreatDetectionCustomModules:validate:\x01*ZR\"M/v1/{parent=folders/*/locations/*}/eventThreatDetectionCustomModules:validate:\x01*ZX\"S/v1/{parent=organizations/*/locations/*}/eventThreatDetectionCustomModules:validate:\x01*\x12\xf3\x02\n\x18GetSecurityCenterService\x12I.google.cloud.securitycentermanagement.v1.GetSecurityCenterServiceRequest\x1a?.google.cloud.securitycentermanagement.v1.SecurityCenterService\"\xca\x01\xda\x41\x04name\x82\xd3\xe4\x93\x02\xbc\x01\x12:/v1/{name=projects/*/locations/*/securityCenterServices/*}Z;\x12\x39/v1/{name=folders/*/locations/*/securityCenterServices/*}ZA\x12?/v1/{name=organizations/*/locations/*/securityCenterServices/*}\x12\x86\x03\n\x1aListSecurityCenterServices\x12K.google.cloud.securitycentermanagement.v1.ListSecurityCenterServicesRequest\x1aL.google.cloud.securitycentermanagement.v1.ListSecurityCenterServicesResponse\"\xcc\x01\xda\x41\x06parent\x82\xd3\xe4\x93\x02\xbc\x01\x12:/v1/{parent=projects/*/locations/*}/securityCenterServicesZ;\x12\x39/v1/{parent=folders/*/locations/*}/securityCenterServicesZA\x12?/v1/{parent=organizations/*/locations/*}/securityCenterServices\x12\xab\x04\n\x1bUpdateSecurityCenterService\x12L.google.cloud.securitycentermanagement.v1.UpdateSecurityCenterServiceRequest\x1a?.google.cloud.securitycentermanagement.v1.SecurityCenterService\"\xfc\x02\xda\x41#security_center_service,update_mask\x82\xd3\xe4\x93\x02\xcf\x02\x32R/v1/{security_center_service.name=projects/*/locations/*/securityCenterServices/*}:\x17security_center_serviceZl2Q/v1/{security_center_service.name=folders/*/locations/*/securityCenterServices/*}:\x17security_center_serviceZr2W/v1/{security_center_service.name=organizations/*/locations/*/securityCenterServices/*}:\x17security_center_service\x1a[\xca\x41\'securitycentermanagement.googleapis.com\xd2\x41.https://www.googleapis.com/auth/cloud-platformB\x93\x04\n,com.google.cloud.securitycentermanagement.v1B\x1dSecurityCenterManagementProtoP\x01Zhcloud.google.com/go/securitycentermanagement/apiv1/securitycentermanagementpb;securitycentermanagementpb\xaa\x02(Google.Cloud.SecurityCenterManagement.V1\xca\x02(Google\\Cloud\\SecurityCenterManagement\\V1\xea\x02+Google::Cloud::SecurityCenterManagement::V1\xea\x41q\n] + # The destination where API teams want this client library to be published. + # @!attribute [rw] selective_gapic_generation + # @return [::Google::Api::SelectiveGapicGeneration] + # Configuration for which RPCs should be generated in the GAPIC client. + class CommonLanguageSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Details about how and where to publish client libraries. + # @!attribute [rw] version + # @return [::String] + # Version of the API to apply these settings to. This is the full protobuf + # package for the API, ending in the version element. + # Examples: "google.cloud.speech.v1" and "google.spanner.admin.database.v1". + # @!attribute [rw] launch_stage + # @return [::Google::Api::LaunchStage] + # Launch stage of this version of the API. + # @!attribute [rw] rest_numeric_enums + # @return [::Boolean] + # When using transport=rest, the client request will encode enums as + # numbers rather than strings. + # @!attribute [rw] java_settings + # @return [::Google::Api::JavaSettings] + # Settings for legacy Java features, supported in the Service YAML. + # @!attribute [rw] cpp_settings + # @return [::Google::Api::CppSettings] + # Settings for C++ client libraries. + # @!attribute [rw] php_settings + # @return [::Google::Api::PhpSettings] + # Settings for PHP client libraries. + # @!attribute [rw] python_settings + # @return [::Google::Api::PythonSettings] + # Settings for Python client libraries. + # @!attribute [rw] node_settings + # @return [::Google::Api::NodeSettings] + # Settings for Node client libraries. + # @!attribute [rw] dotnet_settings + # @return [::Google::Api::DotnetSettings] + # Settings for .NET client libraries. + # @!attribute [rw] ruby_settings + # @return [::Google::Api::RubySettings] + # Settings for Ruby client libraries. + # @!attribute [rw] go_settings + # @return [::Google::Api::GoSettings] + # Settings for Go client libraries. + class ClientLibrarySettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # This message configures the settings for publishing [Google Cloud Client + # libraries](https://cloud.google.com/apis/docs/cloud-client-libraries) + # generated from the service config. + # @!attribute [rw] method_settings + # @return [::Array<::Google::Api::MethodSettings>] + # A list of API method settings, e.g. the behavior for methods that use the + # long-running operation pattern. + # @!attribute [rw] new_issue_uri + # @return [::String] + # Link to a *public* URI where users can report issues. Example: + # https://issuetracker.google.com/issues/new?component=190865&template=1161103 + # @!attribute [rw] documentation_uri + # @return [::String] + # Link to product home page. Example: + # https://cloud.google.com/asset-inventory/docs/overview + # @!attribute [rw] api_short_name + # @return [::String] + # Used as a tracking tag when collecting data about the APIs developer + # relations artifacts like docs, packages delivered to package managers, + # etc. Example: "speech". + # @!attribute [rw] github_label + # @return [::String] + # GitHub label to apply to issues and pull requests opened for this API. + # @!attribute [rw] codeowner_github_teams + # @return [::Array<::String>] + # GitHub teams to be added to CODEOWNERS in the directory in GitHub + # containing source code for the client libraries for this API. + # @!attribute [rw] doc_tag_prefix + # @return [::String] + # A prefix used in sample code when demarking regions to be included in + # documentation. + # @!attribute [rw] organization + # @return [::Google::Api::ClientLibraryOrganization] + # For whom the client library is being published. + # @!attribute [rw] library_settings + # @return [::Array<::Google::Api::ClientLibrarySettings>] + # Client library settings. If the same version string appears multiple + # times in this list, then the last one wins. Settings from earlier + # settings with the same version string are discarded. + # @!attribute [rw] proto_reference_documentation_uri + # @return [::String] + # Optional link to proto reference documentation. Example: + # https://cloud.google.com/pubsub/lite/docs/reference/rpc + # @!attribute [rw] rest_reference_documentation_uri + # @return [::String] + # Optional link to REST reference documentation. Example: + # https://cloud.google.com/pubsub/lite/docs/reference/rest + class Publishing + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Settings for Java client libraries. + # @!attribute [rw] library_package + # @return [::String] + # The package name to use in Java. Clobbers the java_package option + # set in the protobuf. This should be used **only** by APIs + # who have already set the language_settings.java.package_name" field + # in gapic.yaml. API teams should use the protobuf java_package option + # where possible. + # + # Example of a YAML configuration:: + # + # publishing: + # 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. + # @!attribute [rw] methods + # @return [::Array<::String>] + # An allowlist of the fully qualified names of RPCs that should be included + # on public client surfaces. + # @!attribute [rw] generate_omitted_as_internal + # @return [::Boolean] + # Setting this to true indicates to the client generators that methods + # that would be excluded from the generation should instead be generated + # in a way that indicates these methods should not be consumed by + # end users. How this is expressed is up to individual language + # implementations to decide. Some examples may be: added annotations, + # obfuscated identifiers, or other language idiomatic patterns. + class SelectiveGapicGeneration + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # `BatchingConfigProto` defines the batching configuration for an API method. + # @!attribute [rw] thresholds + # @return [::Google::Api::BatchingSettingsProto] + # The thresholds which trigger a batched request to be sent. + # @!attribute [rw] batch_descriptor + # @return [::Google::Api::BatchingDescriptorProto] + # The request and response fields used in batching. + class BatchingConfigProto + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # `BatchingSettingsProto` specifies a set of batching thresholds, each of + # which acts as a trigger to send a batch of messages as a request. At least + # one threshold must be positive nonzero. + # @!attribute [rw] element_count_threshold + # @return [::Integer] + # The number of elements of a field collected into a batch which, if + # exceeded, causes the batch to be sent. + # @!attribute [rw] request_byte_threshold + # @return [::Integer] + # The aggregated size of the batched field which, if exceeded, causes the + # batch to be sent. This size is computed by aggregating the sizes of the + # request field to be batched, not of the entire request message. + # @!attribute [rw] delay_threshold + # @return [::Google::Protobuf::Duration] + # The duration after which a batch should be sent, starting from the addition + # of the first message to that batch. + # @!attribute [rw] element_count_limit + # @return [::Integer] + # The maximum number of elements collected in a batch that could be accepted + # by server. + # @!attribute [rw] request_byte_limit + # @return [::Integer] + # The maximum size of the request that could be accepted by server. + # @!attribute [rw] flow_control_element_limit + # @return [::Integer] + # The maximum number of elements allowed by flow control. + # @!attribute [rw] flow_control_byte_limit + # @return [::Integer] + # The maximum size of data allowed by flow control. + # @!attribute [rw] flow_control_limit_exceeded_behavior + # @return [::Google::Api::FlowControlLimitExceededBehaviorProto] + # The behavior to take when the flow control limit is exceeded. + class BatchingSettingsProto + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # `BatchingDescriptorProto` specifies the fields of the request message to be + # used for batching, and, optionally, the fields of the response message to be + # used for demultiplexing. + # @!attribute [rw] batched_field + # @return [::String] + # The repeated field in the request message to be aggregated by batching. + # @!attribute [rw] discriminator_fields + # @return [::Array<::String>] + # A list of the fields in the request message. Two requests will be batched + # together only if the values of every field specified in + # `request_discriminator_fields` is equal between the two requests. + # @!attribute [rw] subresponse_field + # @return [::String] + # Optional. When present, indicates the field in the response message to be + # used to demultiplex the response into multiple response messages, in + # correspondence with the multiple request messages originally batched + # together. + class BatchingDescriptorProto + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # The organization for which the client libraries are being published. + # Affects the url where generated docs are published, etc. + module ClientLibraryOrganization + # Not useful. + CLIENT_LIBRARY_ORGANIZATION_UNSPECIFIED = 0 + + # Google Cloud Platform Org. + CLOUD = 1 + + # Ads (Advertising) Org. + ADS = 2 + + # Photos Org. + PHOTOS = 3 + + # Street View Org. + STREET_VIEW = 4 + + # Shopping Org. + SHOPPING = 5 + + # Geo Org. + GEO = 6 + + # Generative AI - https://developers.generativeai.google + GENERATIVE_AI = 7 + end + + # To where should client libraries be published? + module ClientLibraryDestination + # Client libraries will neither be generated nor published to package + # managers. + CLIENT_LIBRARY_DESTINATION_UNSPECIFIED = 0 + + # Generate the client library in a repo under github.com/googleapis, + # but don't publish it to package managers. + GITHUB = 10 + + # Publish the library to package managers like nuget.org and npmjs.com. + PACKAGE_MANAGER = 20 + end + + # The behavior to take when the flow control limit is exceeded. + module FlowControlLimitExceededBehaviorProto + # Default behavior, system-defined. + UNSET_BEHAVIOR = 0 + + # Stop operation, raise error. + THROW_EXCEPTION = 1 + + # Pause operation until limit clears. + BLOCK = 2 + + # Continue operation, disregard limit. + IGNORE = 3 + end + end +end diff --git a/owl-bot-staging/google-cloud-security_center_management-v1/proto_docs/google/api/field_behavior.rb b/owl-bot-staging/google-cloud-security_center_management-v1/proto_docs/google/api/field_behavior.rb new file mode 100644 index 000000000000..582be187d115 --- /dev/null +++ b/owl-bot-staging/google-cloud-security_center_management-v1/proto_docs/google/api/field_behavior.rb @@ -0,0 +1,85 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + + +module Google + module Api + # An indicator of the behavior of a given field (for example, that a field + # is required in requests, or given as output but ignored as input). + # This **does not** change the behavior in protocol buffers itself; it only + # denotes the behavior and may affect how API tooling handles the field. + # + # Note: This enum **may** receive new values in the future. + module FieldBehavior + # Conventional default for enums. Do not use this. + FIELD_BEHAVIOR_UNSPECIFIED = 0 + + # Specifically denotes a field as optional. + # While all fields in protocol buffers are optional, this may be specified + # for emphasis if appropriate. + OPTIONAL = 1 + + # Denotes a field as required. + # This indicates that the field **must** be provided as part of the request, + # and failure to do so will cause an error (usually `INVALID_ARGUMENT`). + REQUIRED = 2 + + # Denotes a field as output only. + # This indicates that the field is provided in responses, but including the + # field in a request does nothing (the server *must* ignore it and + # *must not* throw an error as a result of the field's presence). + OUTPUT_ONLY = 3 + + # Denotes a field as input only. + # This indicates that the field is provided in requests, and the + # corresponding field is not included in output. + INPUT_ONLY = 4 + + # Denotes a field as immutable. + # This indicates that the field may be set once in a request to create a + # resource, but may not be changed thereafter. + IMMUTABLE = 5 + + # Denotes that a (repeated) field is an unordered list. + # This indicates that the service may provide the elements of the list + # in any arbitrary order, rather than the order the user originally + # provided. Additionally, the list's order may or may not be stable. + UNORDERED_LIST = 6 + + # Denotes that this field returns a non-empty default value if not set. + # This indicates that if the user provides the empty value in a request, + # a non-empty value will be returned. The user will not be aware of what + # non-empty value to expect. + NON_EMPTY_DEFAULT = 7 + + # Denotes that the field in a resource (a message annotated with + # google.api.resource) is used in the resource name to uniquely identify the + # resource. For AIP-compliant APIs, this should only be applied to the + # `name` field on the resource. + # + # This behavior should not be applied to references to other resources within + # the message. + # + # The identifier field of resources often have different field behavior + # depending on the request it is embedded in (e.g. for Create methods name + # is optional and unused, while for Update methods it is required). Instead + # of method-specific annotations, only `IDENTIFIER` is required. + IDENTIFIER = 8 + end + end +end diff --git a/owl-bot-staging/google-cloud-security_center_management-v1/proto_docs/google/api/launch_stage.rb b/owl-bot-staging/google-cloud-security_center_management-v1/proto_docs/google/api/launch_stage.rb new file mode 100644 index 000000000000..9392a413fb1b --- /dev/null +++ b/owl-bot-staging/google-cloud-security_center_management-v1/proto_docs/google/api/launch_stage.rb @@ -0,0 +1,71 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + + +module Google + module Api + # The launch stage as defined by [Google Cloud Platform + # Launch Stages](https://cloud.google.com/terms/launch-stages). + module LaunchStage + # Do not use this default value. + LAUNCH_STAGE_UNSPECIFIED = 0 + + # The feature is not yet implemented. Users can not use it. + UNIMPLEMENTED = 6 + + # Prelaunch features are hidden from users and are only visible internally. + PRELAUNCH = 7 + + # Early Access features are limited to a closed group of testers. To use + # these features, you must sign up in advance and sign a Trusted Tester + # agreement (which includes confidentiality provisions). These features may + # be unstable, changed in backward-incompatible ways, and are not + # guaranteed to be released. + EARLY_ACCESS = 1 + + # Alpha is a limited availability test for releases before they are cleared + # for widespread use. By Alpha, all significant design issues are resolved + # and we are in the process of verifying functionality. Alpha customers + # need to apply for access, agree to applicable terms, and have their + # projects allowlisted. Alpha releases don't have to be feature complete, + # no SLAs are provided, and there are no technical support obligations, but + # they will be far enough along that customers can actually use them in + # test environments or for limited-use tests -- just like they would in + # normal production cases. + ALPHA = 2 + + # Beta is the point at which we are ready to open a release for any + # customer to use. There are no SLA or technical support obligations in a + # Beta release. Products will be complete from a feature perspective, but + # may have some open outstanding issues. Beta releases are suitable for + # limited production use cases. + BETA = 3 + + # GA features are open to all developers and are considered stable and + # fully qualified for production use. + GA = 4 + + # Deprecated features are scheduled to be shut down and removed. For more + # information, see the "Deprecation Policy" section of our [Terms of + # Service](https://cloud.google.com/terms/) + # and the [Google Cloud Platform Subject to the Deprecation + # Policy](https://cloud.google.com/terms/deprecation) documentation. + DEPRECATED = 5 + end + end +end diff --git a/owl-bot-staging/google-cloud-security_center_management-v1/proto_docs/google/api/resource.rb b/owl-bot-staging/google-cloud-security_center_management-v1/proto_docs/google/api/resource.rb new file mode 100644 index 000000000000..25dec4847ac1 --- /dev/null +++ b/owl-bot-staging/google-cloud-security_center_management-v1/proto_docs/google/api/resource.rb @@ -0,0 +1,227 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + + +module Google + module Api + # A simple descriptor of a resource type. + # + # ResourceDescriptor annotates a resource message (either by means of a + # protobuf annotation or use in the service config), and associates the + # resource's schema, the resource type, and the pattern of the resource name. + # + # Example: + # + # message Topic { + # // Indicates this message defines a resource schema. + # // Declares the resource type in the format of {service}/{kind}. + # // For Kubernetes resources, the format is {api group}/{kind}. + # option (google.api.resource) = { + # type: "pubsub.googleapis.com/Topic" + # pattern: "projects/{project}/topics/{topic}" + # }; + # } + # + # The ResourceDescriptor Yaml config will look like: + # + # resources: + # - type: "pubsub.googleapis.com/Topic" + # pattern: "projects/{project}/topics/{topic}" + # + # Sometimes, resources have multiple patterns, typically because they can + # live under multiple parents. + # + # Example: + # + # message LogEntry { + # option (google.api.resource) = { + # type: "logging.googleapis.com/LogEntry" + # pattern: "projects/{project}/logs/{log}" + # pattern: "folders/{folder}/logs/{log}" + # pattern: "organizations/{organization}/logs/{log}" + # pattern: "billingAccounts/{billing_account}/logs/{log}" + # }; + # } + # + # The ResourceDescriptor Yaml config will look like: + # + # resources: + # - type: 'logging.googleapis.com/LogEntry' + # pattern: "projects/{project}/logs/{log}" + # pattern: "folders/{folder}/logs/{log}" + # pattern: "organizations/{organization}/logs/{log}" + # pattern: "billingAccounts/{billing_account}/logs/{log}" + # @!attribute [rw] type + # @return [::String] + # The resource type. It must be in the format of + # \\{service_name}/\\{resource_type_kind}. The `resource_type_kind` must be + # singular and must not include version numbers. + # + # Example: `storage.googleapis.com/Bucket` + # + # The value of the resource_type_kind must follow the regular expression + # /[A-Za-z][a-zA-Z0-9]+/. It should start with an upper case character and + # should use PascalCase (UpperCamelCase). The maximum number of + # characters allowed for the `resource_type_kind` is 100. + # @!attribute [rw] pattern + # @return [::Array<::String>] + # Optional. The relative resource name pattern associated with this resource + # type. The DNS prefix of the full resource name shouldn't be specified here. + # + # The path pattern must follow the syntax, which aligns with HTTP binding + # syntax: + # + # Template = Segment { "/" Segment } ; + # Segment = LITERAL | Variable ; + # Variable = "{" LITERAL "}" ; + # + # Examples: + # + # - "projects/\\{project}/topics/\\{topic}" + # - "projects/\\{project}/knowledgeBases/\\{knowledge_base}" + # + # The components in braces correspond to the IDs for each resource in the + # hierarchy. It is expected that, if multiple patterns are provided, + # the same component name (e.g. "project") refers to IDs of the same + # type of resource. + # @!attribute [rw] name_field + # @return [::String] + # Optional. The field on the resource that designates the resource name + # field. If omitted, this is assumed to be "name". + # @!attribute [rw] history + # @return [::Google::Api::ResourceDescriptor::History] + # Optional. The historical or future-looking state of the resource pattern. + # + # Example: + # + # // The InspectTemplate message originally only supported resource + # // names with organization, and project was added later. + # message InspectTemplate { + # option (google.api.resource) = { + # type: "dlp.googleapis.com/InspectTemplate" + # pattern: + # "organizations/{organization}/inspectTemplates/{inspect_template}" + # pattern: "projects/{project}/inspectTemplates/{inspect_template}" + # history: ORIGINALLY_SINGLE_PATTERN + # }; + # } + # @!attribute [rw] plural + # @return [::String] + # The plural name used in the resource name and permission names, such as + # 'projects' for the resource name of 'projects/\\{project}' and the permission + # name of 'cloudresourcemanager.googleapis.com/projects.get'. One exception + # to this is for Nested Collections that have stuttering names, as defined + # in [AIP-122](https://google.aip.dev/122#nested-collections), where the + # collection ID in the resource name pattern does not necessarily directly + # match the `plural` value. + # + # It is the same concept of the `plural` field in k8s CRD spec + # https://kubernetes.io/docs/tasks/access-kubernetes-api/custom-resources/custom-resource-definitions/ + # + # Note: The plural form is required even for singleton resources. See + # https://aip.dev/156 + # @!attribute [rw] singular + # @return [::String] + # The same concept of the `singular` field in k8s CRD spec + # https://kubernetes.io/docs/tasks/access-kubernetes-api/custom-resources/custom-resource-definitions/ + # Such as "project" for the `resourcemanager.googleapis.com/Project` type. + # @!attribute [rw] style + # @return [::Array<::Google::Api::ResourceDescriptor::Style>] + # Style flag(s) for this resource. + # These indicate that a resource is expected to conform to a given + # style. See the specific style flags for additional information. + class ResourceDescriptor + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # A description of the historical or future-looking state of the + # resource pattern. + module History + # The "unset" value. + HISTORY_UNSPECIFIED = 0 + + # The resource originally had one pattern and launched as such, and + # additional patterns were added later. + ORIGINALLY_SINGLE_PATTERN = 1 + + # The resource has one pattern, but the API owner expects to add more + # later. (This is the inverse of ORIGINALLY_SINGLE_PATTERN, and prevents + # that from being necessary once there are multiple patterns.) + FUTURE_MULTI_PATTERN = 2 + end + + # A flag representing a specific style that a resource claims to conform to. + module Style + # The unspecified value. Do not use. + STYLE_UNSPECIFIED = 0 + + # This resource is intended to be "declarative-friendly". + # + # Declarative-friendly resources must be more strictly consistent, and + # setting this to true communicates to tools that this resource should + # adhere to declarative-friendly expectations. + # + # Note: This is used by the API linter (linter.aip.dev) to enable + # additional checks. + DECLARATIVE_FRIENDLY = 1 + end + end + + # Defines a proto annotation that describes a string field that refers to + # an API resource. + # @!attribute [rw] type + # @return [::String] + # The resource type that the annotated field references. + # + # Example: + # + # message Subscription { + # string topic = 2 [(google.api.resource_reference) = { + # type: "pubsub.googleapis.com/Topic" + # }]; + # } + # + # Occasionally, a field may reference an arbitrary resource. In this case, + # APIs use the special value * in their resource reference. + # + # Example: + # + # message GetIamPolicyRequest { + # string resource = 2 [(google.api.resource_reference) = { + # type: "*" + # }]; + # } + # @!attribute [rw] child_type + # @return [::String] + # The resource type of a child collection that the annotated field + # references. This is useful for annotating the `parent` field that + # doesn't have a fixed resource type. + # + # Example: + # + # message ListLogEntriesRequest { + # string parent = 1 [(google.api.resource_reference) = { + # child_type: "logging.googleapis.com/LogEntry" + # }; + # } + class ResourceReference + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end +end diff --git a/owl-bot-staging/google-cloud-security_center_management-v1/proto_docs/google/cloud/securitycentermanagement/v1/security_center_management.rb b/owl-bot-staging/google-cloud-security_center_management-v1/proto_docs/google/cloud/securitycentermanagement/v1/security_center_management.rb new file mode 100644 index 000000000000..b9f8a419f0dc --- /dev/null +++ b/owl-bot-staging/google-cloud-security_center_management-v1/proto_docs/google/cloud/securitycentermanagement/v1/security_center_management.rb @@ -0,0 +1,1334 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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 SecurityCenterManagement + module V1 + # Represents a particular Security Command Center service. This includes + # settings information such as top-level enablement in addition to individual + # module settings. Service settings can be configured at the organization, + # folder, or project level. Service settings at the organization or folder + # level are inherited by those in descendant folders and projects. + # @!attribute [rw] name + # @return [::String] + # Identifier. The name of the service, in one of the following formats: + # + # * `organizations/{organization}/locations/{location}/securityCenterServices/{service}` + # * `folders/{folder}/locations/{location}/securityCenterServices/{service}` + # * `projects/{project}/locations/{location}/securityCenterServices/{service}` + # + # The following values are valid for `{service}`: + # + # * `container-threat-detection` + # * `event-threat-detection` + # * `security-health-analytics` + # * `vm-threat-detection` + # * `web-security-scanner` + # @!attribute [rw] intended_enablement_state + # @return [::Google::Cloud::SecurityCenterManagement::V1::SecurityCenterService::EnablementState] + # Optional. The intended enablement state for the service at its level of the + # resource hierarchy. A `DISABLED` state will override all module enablement + # states to `DISABLED`. + # @!attribute [r] effective_enablement_state + # @return [::Google::Cloud::SecurityCenterManagement::V1::SecurityCenterService::EnablementState] + # Output only. The effective enablement state for the service at its level of + # the resource hierarchy. If the intended state is set to `INHERITED`, the + # effective state will be inherited from the enablement state of an ancestor. + # This state may differ from the intended enablement state due to billing + # eligibility or onboarding status. + # @!attribute [rw] modules + # @return [::Google::Protobuf::Map{::String => ::Google::Cloud::SecurityCenterManagement::V1::SecurityCenterService::ModuleSettings}] + # Optional. The module configurations, including the enablement state for the + # service's modules. The absence of a module in the map implies that its + # configuration is inherited from its parents. + # @!attribute [r] update_time + # @return [::Google::Protobuf::Timestamp] + # Output only. The time the service was last updated. This could be due to an + # explicit user update or due to a side effect of another system change, such + # as billing subscription expiry. + # @!attribute [rw] service_config + # @return [::Google::Protobuf::Struct] + # Optional. Additional service-specific configuration. Not all services will + # utilize this field. + class SecurityCenterService + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # The settings for individual modules. + # @!attribute [rw] intended_enablement_state + # @return [::Google::Cloud::SecurityCenterManagement::V1::SecurityCenterService::EnablementState] + # Optional. The intended enablement state for the module at its level of + # the resource hierarchy. + # @!attribute [r] effective_enablement_state + # @return [::Google::Cloud::SecurityCenterManagement::V1::SecurityCenterService::EnablementState] + # Output only. The effective enablement state for the module at its level + # of the resource hierarchy. If the intended state is set to `INHERITED`, + # the effective state will be inherited from the enablement state of an + # ancestor. This state may differ from the intended enablement state due to + # billing eligibility or onboarding status. + class ModuleSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # @!attribute [rw] key + # @return [::String] + # @!attribute [rw] value + # @return [::Google::Cloud::SecurityCenterManagement::V1::SecurityCenterService::ModuleSettings] + class ModulesEntry + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Represents the possible enablement states for a service or module. + module EnablementState + # Default value. This value is unused. + ENABLEMENT_STATE_UNSPECIFIED = 0 + + # State is inherited from the parent resource. Valid as an intended + # enablement state, but not as an effective enablement state. + INHERITED = 1 + + # State is enabled. + ENABLED = 2 + + # State is disabled. + DISABLED = 3 + + # Security Command Center is configured to ingest findings from this + # service, but not to enable this service. This state indicates that + # Security Command Center is misconfigured. You can't set this state + # yourself. + INGEST_ONLY = 4 + end + end + + # The representation of a Security Health Analytics custom module at a + # specified level of the resource hierarchy: organization, folder, or project. + # If a custom module is inherited from an ancestor organization or folder, then + # the enablement state is set to the value that is effective in the parent, not + # to `INHERITED`. For example, if the module is enabled in an organization or + # folder, then the effective enablement state for the module is `ENABLED` in + # all descendant folders or projects. + # @!attribute [rw] name + # @return [::String] + # Identifier. The full resource name of the custom module, in one of the + # following formats: + # + # * `organizations/organization/{location}/effectiveSecurityHealthAnalyticsCustomModules/{custom_module}` + # * `folders/folder/{location}/effectiveSecurityHealthAnalyticsCustomModules/{custom_module}` + # * `projects/project/{location}/effectiveSecurityHealthAnalyticsCustomModules/{custom_module}` + # @!attribute [r] custom_config + # @return [::Google::Cloud::SecurityCenterManagement::V1::CustomConfig] + # Output only. The user-specified configuration for the module. + # @!attribute [r] enablement_state + # @return [::Google::Cloud::SecurityCenterManagement::V1::EffectiveSecurityHealthAnalyticsCustomModule::EnablementState] + # Output only. The effective enablement state for the module at the given + # level of the hierarchy. + # @!attribute [r] display_name + # @return [::String] + # Output only. The display name for the custom module. The name must be + # between 1 and 128 characters, start with a lowercase letter, and contain + # alphanumeric characters or underscores only. + class EffectiveSecurityHealthAnalyticsCustomModule + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # The enablement state of the module. + module EnablementState + # Default value. This value is unused. + ENABLEMENT_STATE_UNSPECIFIED = 0 + + # The module is enabled at the given level. + ENABLED = 1 + + # The module is disabled at the given level. + DISABLED = 2 + end + end + + # Request message for + # {::Google::Cloud::SecurityCenterManagement::V1::SecurityCenterManagement::Client#list_effective_security_health_analytics_custom_modules SecurityCenterManagement.ListEffectiveSecurityHealthAnalyticsCustomModules}. + # @!attribute [rw] parent + # @return [::String] + # Required. Name of parent to list effective custom modules, in one of the + # following formats: + # + # * `organizations/{organization}/locations/{location}` + # * `folders/{folder}/locations/{location}` + # * `projects/{project}/locations/{location}` + # @!attribute [rw] page_size + # @return [::Integer] + # Optional. The maximum number of results to return in a single response. + # Default is 10, minimum is 1, maximum is 1000. + # @!attribute [rw] page_token + # @return [::String] + # Optional. A pagination token returned from a previous request. Provide this + # token to retrieve the next page of results. + # + # When paginating, the rest of the request must match the request that + # generated the page token. + class ListEffectiveSecurityHealthAnalyticsCustomModulesRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Response message for + # {::Google::Cloud::SecurityCenterManagement::V1::SecurityCenterManagement::Client#list_effective_security_health_analytics_custom_modules SecurityCenterManagement.ListEffectiveSecurityHealthAnalyticsCustomModules}. + # @!attribute [rw] effective_security_health_analytics_custom_modules + # @return [::Array<::Google::Cloud::SecurityCenterManagement::V1::EffectiveSecurityHealthAnalyticsCustomModule>] + # The list of effective Security Health Analytics custom modules. + # @!attribute [rw] next_page_token + # @return [::String] + # A pagination token. To retrieve the next page of results, call the method + # again with this token. + class ListEffectiveSecurityHealthAnalyticsCustomModulesResponse + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Request message for + # {::Google::Cloud::SecurityCenterManagement::V1::SecurityCenterManagement::Client#get_effective_security_health_analytics_custom_module SecurityCenterManagement.GetEffectiveSecurityHealthAnalyticsCustomModule}. + # @!attribute [rw] name + # @return [::String] + # Required. The full resource name of the custom module, specified in one of + # the following formats: + # + # * `organizations/organization/{location}/effectiveSecurityHealthAnalyticsCustomModules/{custom_module}` + # * `folders/folder/{location}/effectiveSecurityHealthAnalyticsCustomModules/{custom_module}` + # * `projects/project/{location}/effectiveSecurityHealthAnalyticsCustomModules/{custom_module}` + class GetEffectiveSecurityHealthAnalyticsCustomModuleRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Represents an instance of a Security Health Analytics custom module, + # including its full module name, display name, enablement state, and last + # updated time. You can create a custom module at the organization, folder, or + # project level. Custom modules that you create at the organization or folder + # level are inherited by the descendant folders and projects. + # @!attribute [rw] name + # @return [::String] + # Identifier. The full resource name of the custom module, in one of the + # following formats: + # + # * `organizations/{organization}/locations/{location}/securityHealthAnalyticsCustomModules/{custom_module}` + # * `folders/{folder}/locations/{location}/securityHealthAnalyticsCustomModules/{custom_module}` + # * `projects/{project}/locations/{location}/securityHealthAnalyticsCustomModules/{custom_module}` + # @!attribute [rw] display_name + # @return [::String] + # Optional. The display name of the Security Health Analytics custom module. + # This display name becomes the finding category for all findings that are + # returned by this custom module. The display name must be between 1 and 128 + # characters, start with a lowercase letter, and contain alphanumeric + # characters or underscores only. + # @!attribute [rw] enablement_state + # @return [::Google::Cloud::SecurityCenterManagement::V1::SecurityHealthAnalyticsCustomModule::EnablementState] + # Optional. The enablement state of the custom module. + # @!attribute [r] update_time + # @return [::Google::Protobuf::Timestamp] + # Output only. The time at which the custom module was last updated. + # @!attribute [r] last_editor + # @return [::String] + # Output only. The editor that last updated the custom module. + # @!attribute [r] ancestor_module + # @return [::String] + # Output only. Specifies the organization or folder from which the custom + # module is inherited. If empty, indicates that the custom module was created + # in the organization, folder, or project in which you are viewing the custom + # module. + # @!attribute [rw] custom_config + # @return [::Google::Cloud::SecurityCenterManagement::V1::CustomConfig] + # Optional. The user-specified custom configuration for the module. + class SecurityHealthAnalyticsCustomModule + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # Possible enablement states of a custom module. + module EnablementState + # Default value. This value is unused. + ENABLEMENT_STATE_UNSPECIFIED = 0 + + # The module is enabled at the given organization, folder, or project. + ENABLED = 1 + + # The module is disabled at the given organization, folder, or project. + DISABLED = 2 + + # State is inherited from an ancestor module. The module will either + # be effectively `ENABLED` or `DISABLED` based on its closest non-inherited + # ancestor module in the resource hierarchy. If you try to set a top-level + # module (a module with no parent) to the `INHERITED` state, you receive an + # `INVALID_ARGUMENT` error. + INHERITED = 3 + end + end + + # Defines the properties in a custom module configuration for Security + # Health Analytics. Use the custom module configuration to create custom + # detectors that generate custom findings for resources that you specify. + # @!attribute [rw] predicate + # @return [::Google::Type::Expr] + # Optional. The Common Expression Language (CEL) expression to evaluate to + # produce findings. When the expression evaluates to `true` against a + # resource, a finding is generated. + # @!attribute [rw] custom_output + # @return [::Google::Cloud::SecurityCenterManagement::V1::CustomConfig::CustomOutputSpec] + # Optional. Custom output properties. + # @!attribute [rw] resource_selector + # @return [::Google::Cloud::SecurityCenterManagement::V1::CustomConfig::ResourceSelector] + # Optional. The Cloud Asset Inventory resource types that the custom module + # operates on. For information about resource types, see [Supported asset + # types](https://cloud.google.com/asset-inventory/docs/supported-asset-types). + # Each custom module can specify up to 5 resource types. + # @!attribute [rw] severity + # @return [::Google::Cloud::SecurityCenterManagement::V1::CustomConfig::Severity] + # Optional. The severity to assign to findings generated by the module. + # @!attribute [rw] description + # @return [::String] + # Optional. Text that describes the vulnerability or misconfiguration that + # the custom module detects. This explanation is returned with each finding + # instance to help investigators understand the detected issue. The text must + # be enclosed in quotation marks. + # @!attribute [rw] recommendation + # @return [::String] + # Optional. An explanation of the recommended steps that security teams can + # take to resolve the detected issue. This explanation is returned with each + # finding generated by this module. + class CustomConfig + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # A set of optional name-value pairs that define custom source properties to + # return with each finding that is generated by the custom module. The custom + # source properties that are defined here are included in the finding. + # @!attribute [rw] properties + # @return [::Array<::Google::Cloud::SecurityCenterManagement::V1::CustomConfig::CustomOutputSpec::Property>] + # Optional. A list of custom output properties to add to the finding. + class CustomOutputSpec + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # An individual name-value pair that defines a custom source property. + # @!attribute [rw] name + # @return [::String] + # Optional. Name of the property for the custom output. + # @!attribute [rw] value_expression + # @return [::Google::Type::Expr] + # Optional. The CEL expression for the custom output. A resource property + # can be specified to return the value of the property or a text string + # enclosed in quotation marks. + class Property + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end + + # Resource for selecting resource type. + # @!attribute [rw] resource_types + # @return [::Array<::String>] + # Optional. The resource types to run the detector on. + class ResourceSelector + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Defines the valid value options for the severity of a finding. + module Severity + # Default value. This value is unused. + SEVERITY_UNSPECIFIED = 0 + + # Critical severity. + CRITICAL = 1 + + # High severity. + HIGH = 2 + + # Medium severity. + MEDIUM = 3 + + # Low severity. + LOW = 4 + end + end + + # Request message for + # {::Google::Cloud::SecurityCenterManagement::V1::SecurityCenterManagement::Client#list_security_health_analytics_custom_modules SecurityCenterManagement.ListSecurityHealthAnalyticsCustomModules}. + # @!attribute [rw] parent + # @return [::String] + # Required. Name of the parent organization, folder, or project in which to + # list custom modules, in one of the following formats: + # + # * `organizations/{organization}/locations/{location}` + # * `folders/{folder}/locations/{location}` + # * `projects/{project}/locations/{location}` + # @!attribute [rw] page_size + # @return [::Integer] + # Optional. The maximum number of results to return in a single response. + # Default is 10, minimum is 1, maximum is 1000. + # @!attribute [rw] page_token + # @return [::String] + # Optional. A pagination token returned from a previous request. Provide this + # token to retrieve the next page of results. + # + # When paginating, the rest of the request must match the request that + # generated the page token. + class ListSecurityHealthAnalyticsCustomModulesRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Response message for + # {::Google::Cloud::SecurityCenterManagement::V1::SecurityCenterManagement::Client#list_security_health_analytics_custom_modules SecurityCenterManagement.ListSecurityHealthAnalyticsCustomModules}. + # @!attribute [rw] security_health_analytics_custom_modules + # @return [::Array<::Google::Cloud::SecurityCenterManagement::V1::SecurityHealthAnalyticsCustomModule>] + # The list of Security Health Analytics custom modules. + # @!attribute [rw] next_page_token + # @return [::String] + # A pagination token. To retrieve the next page of results, call the method + # again with this token. + class ListSecurityHealthAnalyticsCustomModulesResponse + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Request message for + # {::Google::Cloud::SecurityCenterManagement::V1::SecurityCenterManagement::Client#list_descendant_security_health_analytics_custom_modules SecurityCenterManagement.ListDescendantSecurityHealthAnalyticsCustomModules}. + # @!attribute [rw] parent + # @return [::String] + # Required. Name of the parent organization, folder, or project in which to + # list custom modules, in one of the following formats: + # + # * `organizations/{organization}/locations/{location}` + # * `folders/{folder}/locations/{location}` + # * `projects/{project}/locations/{location}` + # @!attribute [rw] page_size + # @return [::Integer] + # Optional. The maximum number of results to return in a single response. + # Default is 10, minimum is 1, maximum is 1000. + # @!attribute [rw] page_token + # @return [::String] + # Optional. A pagination token returned from a previous request. Provide this + # token to retrieve the next page of results. + # + # When paginating, the rest of the request must match the request that + # generated the page token. + class ListDescendantSecurityHealthAnalyticsCustomModulesRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Response message for + # {::Google::Cloud::SecurityCenterManagement::V1::SecurityCenterManagement::Client#list_descendant_security_health_analytics_custom_modules SecurityCenterManagement.ListDescendantSecurityHealthAnalyticsCustomModules}. + # @!attribute [rw] security_health_analytics_custom_modules + # @return [::Array<::Google::Cloud::SecurityCenterManagement::V1::SecurityHealthAnalyticsCustomModule>] + # The list of SecurityHealthAnalyticsCustomModules + # @!attribute [rw] next_page_token + # @return [::String] + # A pagination token. To retrieve the next page of results, call the method + # again with this token. + class ListDescendantSecurityHealthAnalyticsCustomModulesResponse + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Request message for + # {::Google::Cloud::SecurityCenterManagement::V1::SecurityCenterManagement::Client#get_security_health_analytics_custom_module SecurityCenterManagement.GetSecurityHealthAnalyticsCustomModule}. + # @!attribute [rw] name + # @return [::String] + # Required. Name of the resource, in the format + # `projects/{project}/locations/{location}/securityHealthAnalyticsCustomModules/{custom_module}`. + class GetSecurityHealthAnalyticsCustomModuleRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Request message for + # {::Google::Cloud::SecurityCenterManagement::V1::SecurityCenterManagement::Client#create_security_health_analytics_custom_module SecurityCenterManagement.CreateSecurityHealthAnalyticsCustomModule}. + # @!attribute [rw] parent + # @return [::String] + # Required. Name of the parent organization, folder, or project of the + # module, in one of the following formats: + # + # * `organizations/{organization}/locations/{location}` + # * `folders/{folder}/locations/{location}` + # * `projects/{project}/locations/{location}` + # @!attribute [rw] security_health_analytics_custom_module + # @return [::Google::Cloud::SecurityCenterManagement::V1::SecurityHealthAnalyticsCustomModule] + # Required. The resource being created. + # @!attribute [rw] validate_only + # @return [::Boolean] + # Optional. When set to `true`, the request will be validated (including IAM + # checks), but no module will be created. An `OK` response indicates that the + # request is valid, while an error response indicates that the request is + # invalid. + # + # If the request is valid, a subsequent request to create the module could + # still fail for one of the following reasons: + # + # * The state of your cloud resources changed; for example, you lost a + # required IAM permission + # * An error occurred during creation of the module + # + # Defaults to `false`. + class CreateSecurityHealthAnalyticsCustomModuleRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Request message for + # {::Google::Cloud::SecurityCenterManagement::V1::SecurityCenterManagement::Client#update_security_health_analytics_custom_module SecurityCenterManagement.UpdateSecurityHealthAnalyticsCustomModule}. + # @!attribute [rw] update_mask + # @return [::Google::Protobuf::FieldMask] + # Required. The fields to update. The following values are valid: + # + # * `custom_config` + # * `enablement_state` + # + # If you omit this field or set it to the wildcard value `*`, then all + # eligible fields are updated. + # @!attribute [rw] security_health_analytics_custom_module + # @return [::Google::Cloud::SecurityCenterManagement::V1::SecurityHealthAnalyticsCustomModule] + # Required. The resource being updated. + # @!attribute [rw] validate_only + # @return [::Boolean] + # Optional. When set to `true`, the request will be validated (including IAM + # checks), but no module will be updated. An `OK` response indicates that the + # request is valid, while an error response indicates that the request is + # invalid. + # + # If the request is valid, a subsequent request to update the module could + # still fail for one of the following reasons: + # + # * The state of your cloud resources changed; for example, you lost a + # required IAM permission + # * An error occurred during creation of the module + # + # Defaults to `false`. + class UpdateSecurityHealthAnalyticsCustomModuleRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Request message for + # {::Google::Cloud::SecurityCenterManagement::V1::SecurityCenterManagement::Client#delete_security_health_analytics_custom_module SecurityCenterManagement.DeleteSecurityHealthAnalyticsCustomModule}. + # @!attribute [rw] name + # @return [::String] + # Required. The resource name of the SHA custom module, in one of the + # following formats: + # + # * `organizations/{organization}/locations/{location}/securityHealthAnalyticsCustomModules/{custom_module}` + # * `folders/{folder}/locations/{location}/securityHealthAnalyticsCustomModules/{custom_module}` + # * `projects/{project}/locations/{location}/securityHealthAnalyticsCustomModules/{custom_module}` + # @!attribute [rw] validate_only + # @return [::Boolean] + # Optional. When set to `true`, the request will be validated (including IAM + # checks), but no module will be deleted. An `OK` response indicates that the + # request is valid, while an error response indicates that the request is + # invalid. + # + # If the request is valid, a subsequent request to delete the module could + # still fail for one of the following reasons: + # + # * The state of your cloud resources changed; for example, you lost a + # required IAM permission + # * An error occurred during deletion of the module + # + # Defaults to `false`. + class DeleteSecurityHealthAnalyticsCustomModuleRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Request message for + # {::Google::Cloud::SecurityCenterManagement::V1::SecurityCenterManagement::Client#simulate_security_health_analytics_custom_module SecurityCenterManagement.SimulateSecurityHealthAnalyticsCustomModule}. + # The maximum size of the request is 4 MiB. + # @!attribute [rw] parent + # @return [::String] + # Required. The relative resource name of the organization, project, or + # folder. For more information about relative resource names, see [AIP-122: + # Resource names](https://google.aip.dev/122). Example: + # `organizations/{organization_id}`. + # @!attribute [rw] custom_config + # @return [::Google::Cloud::SecurityCenterManagement::V1::CustomConfig] + # Required. The custom configuration that you need to test. + # @!attribute [rw] resource + # @return [::Google::Cloud::SecurityCenterManagement::V1::SimulateSecurityHealthAnalyticsCustomModuleRequest::SimulatedResource] + # Required. Resource data to simulate custom module against. + class SimulateSecurityHealthAnalyticsCustomModuleRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # Manually constructed information about a resource. + # @!attribute [rw] resource_type + # @return [::String] + # Required. The type of the resource. For example, + # `compute.googleapis.com/Disk`. + # @!attribute [rw] resource_data + # @return [::Google::Protobuf::Struct] + # Optional. A representation of the Google Cloud resource. Should match the + # Google Cloud resource JSON format. + # + # If the custom module evaluates only the IAM allow policy, then you can + # omit this field. + # @!attribute [rw] iam_policy_data + # @return [::Google::Iam::V1::Policy] + # Optional. A representation of the IAM allow policy. + # + # If the custom module evaluates only the resource data, then you can omit + # this field. + class SimulatedResource + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end + + # The minimum set of fields needed to represent a simulated finding from a + # Security Health Analytics custom module. + # @!attribute [rw] name + # @return [::String] + # Identifier. The [relative resource name](https://google.aip.dev/122) of the + # finding, in one of the following formats: + # + # * `organizations/{organization_id}/sources/{source_id}/findings/{finding_id}` + # * `folders/{folder_id}/sources/{source_id}/findings/{finding_id}` + # * `projects/{project_id}/sources/{source_id}/findings/{finding_id}` + # @!attribute [rw] parent + # @return [::String] + # The [relative resource name](https://google.aip.dev/122) of the source the + # finding belongs to. For example, + # `organizations/{organization_id}/sources/{source_id}`. This field is + # immutable after creation time. + # @!attribute [rw] resource_name + # @return [::String] + # For findings on Google Cloud resources, the + # [full resource name](https://google.aip.dev/122#full-resource-names) of the + # Google Cloud resource this finding is for. When the finding is for a + # non-Google Cloud resource, the value can be a customer or partner defined + # string. This field is immutable after creation time. + # @!attribute [rw] category + # @return [::String] + # The additional taxonomy group within findings from a given source. For + # example, `XSS_FLASH_INJECTION`. This field is immutable after creation + # time. + # @!attribute [r] state + # @return [::Google::Cloud::SecurityCenterManagement::V1::SimulatedFinding::State] + # Output only. The state of the finding. + # @!attribute [rw] source_properties + # @return [::Google::Protobuf::Map{::String => ::Google::Protobuf::Value}] + # Source-specific properties. These properties are managed by the source + # that writes the finding. The key names must be between 1 and 255 + # characters; they must start with a letter and contain alphanumeric + # characters or underscores only. + # @!attribute [rw] event_time + # @return [::Google::Protobuf::Timestamp] + # The time the finding was first detected. If an existing finding is updated, + # then this is the time the update occurred. If the finding is later + # resolved, then this time reflects when the finding was resolved. + # + # For example, if the finding represents an open firewall, this property + # captures the time the detector believes the firewall became open. The + # accuracy is determined by the detector. + # + # The event time must not be set to a value greater than the current + # timestamp. + # @!attribute [rw] severity + # @return [::Google::Cloud::SecurityCenterManagement::V1::SimulatedFinding::Severity] + # The severity of the finding. This field is managed by the source that + # writes the finding. + # @!attribute [rw] finding_class + # @return [::Google::Cloud::SecurityCenterManagement::V1::SimulatedFinding::FindingClass] + # The class of the finding. + class SimulatedFinding + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # @!attribute [rw] key + # @return [::String] + # @!attribute [rw] value + # @return [::Google::Protobuf::Value] + class SourcePropertiesEntry + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # The state of the finding. + module State + # Default value. This value is unused. + STATE_UNSPECIFIED = 0 + + # The finding requires attention and has not been addressed yet. + ACTIVE = 1 + + # The finding has been fixed, triaged as a non-issue, or otherwise + # addressed and is no longer active. + INACTIVE = 2 + end + + # The severity of the finding. + module Severity + # Default value. This value is unused. + SEVERITY_UNSPECIFIED = 0 + + # For vulnerabilities: A critical vulnerability is easily discoverable by + # an external actor, exploitable, and results in the direct ability to + # execute arbitrary code, exfiltrate data, and otherwise gain additional + # access and privileges to cloud resources and workloads. Examples include + # publicly accessible unprotected user data and public SSH access with weak + # or no passwords. + # + # For threats: Indicates a threat that is able to access, modify, or delete + # data or execute unauthorized code within existing resources. + CRITICAL = 1 + + # For vulnerabilities: A high-risk vulnerability can be easily discovered + # and exploited in combination with other vulnerabilities in order to gain + # direct access and the ability to execute arbitrary code, exfiltrate data, + # and otherwise gain additional access and privileges to cloud resources + # and workloads. An example is a database with weak or no passwords that is + # only accessible internally. This database could easily be compromised by + # an actor that had access to the internal network. + # + # For threats: Indicates a threat that is able to create new computational + # resources in an environment but not able to access data or execute code + # in existing resources. + HIGH = 2 + + # For vulnerabilities: A medium-risk vulnerability could be used by an + # actor to gain access to resources or privileges that enable them to + # eventually (through multiple steps or a complex exploit) gain access and + # the ability to execute arbitrary code or exfiltrate data. An example is a + # service account with access to more projects than it should have. If an + # actor gains access to the service account, they could potentially use + # that access to manipulate a project the service account was not intended + # to. + # + # For threats: Indicates a threat that is able to cause operational impact + # but may not access data or execute unauthorized code. + MEDIUM = 3 + + # For vulnerabilities: A low-risk vulnerability hampers a security + # organization's ability to detect vulnerabilities or active threats in + # their deployment, or prevents the root cause investigation of security + # issues. An example is monitoring and logs being disabled for resource + # configurations and access. + # + # For threats: Indicates a threat that has obtained minimal access to an + # environment but is not able to access data, execute code, or create + # resources. + LOW = 4 + end + + # Represents what kind of finding it is. + module FindingClass + # Default value. This value is unused. + FINDING_CLASS_UNSPECIFIED = 0 + + # Describes unwanted or malicious activity. + THREAT = 1 + + # Describes a potential weakness in software that increases risk to + # confidentiality, integrity, and availability. + VULNERABILITY = 2 + + # Describes a potential weakness in cloud resource or asset configuration + # that increases risk. + MISCONFIGURATION = 3 + + # Describes a security observation that is for informational purposes. + OBSERVATION = 4 + + # Describes an error that prevents Security Command Center from working + # correctly. + SCC_ERROR = 5 + + # Describes a potential security risk due to a change in the security + # posture. + POSTURE_VIOLATION = 6 + + # Describes a combination of security issues that represent a more severe + # security problem when taken together. + TOXIC_COMBINATION = 7 + end + end + + # Response message for + # {::Google::Cloud::SecurityCenterManagement::V1::SecurityCenterManagement::Client#simulate_security_health_analytics_custom_module SecurityCenterManagement.SimulateSecurityHealthAnalyticsCustomModule}. + # @!attribute [rw] result + # @return [::Google::Cloud::SecurityCenterManagement::V1::SimulateSecurityHealthAnalyticsCustomModuleResponse::SimulatedResult] + # Result for test case in the corresponding request. + class SimulateSecurityHealthAnalyticsCustomModuleResponse + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # Possible test result. + # @!attribute [rw] finding + # @return [::Google::Cloud::SecurityCenterManagement::V1::SimulatedFinding] + # Finding that would be published for the test case if a violation is + # detected. + # + # Note: The following fields are mutually exclusive: `finding`, `no_violation`, `error`. If a field in that set is populated, all other fields in the set will automatically be cleared. + # @!attribute [rw] no_violation + # @return [::Google::Protobuf::Empty] + # Indicates that the test case does not trigger any violation. + # + # Note: The following fields are mutually exclusive: `no_violation`, `finding`, `error`. If a field in that set is populated, all other fields in the set will automatically be cleared. + # @!attribute [rw] error + # @return [::Google::Rpc::Status] + # Error encountered during the test. + # + # Note: The following fields are mutually exclusive: `error`, `finding`, `no_violation`. If a field in that set is populated, all other fields in the set will automatically be cleared. + class SimulatedResult + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end + + # The representation of an + # {::Google::Cloud::SecurityCenterManagement::V1::EventThreatDetectionCustomModule EventThreatDetectionCustomModule} + # at a given level, taking hierarchy into account and resolving various fields + # accordingly. For example, if the module is enabled at the ancestor level, + # then effective modules at all descendant levels will have their enablement + # state set to `ENABLED`. Similarly, if `module.inherited` is set, then the + # effective module's configuration will reflect the ancestor's configuration. + # @!attribute [rw] name + # @return [::String] + # Identifier. The resource name of the Event Threat Detection custom module, + # in one of the following formats: + # + # * `organizations/{organization}/locations/{location}/effectiveEventThreatDetectionCustomModules/{custom_module}` + # * `folders/{folder}/locations/{location}/effectiveEventThreatDetectionCustomModules/{custom_module}` + # * `projects/{project}/locations/{location}/effectiveEventThreatDetectionCustomModules/{custom_module}` + # @!attribute [r] config + # @return [::Google::Protobuf::Struct] + # Output only. Configuration for the effective module. + # @!attribute [r] enablement_state + # @return [::Google::Cloud::SecurityCenterManagement::V1::EffectiveEventThreatDetectionCustomModule::EnablementState] + # Output only. The effective state of enablement for the module at the given + # level of the hierarchy. + # @!attribute [r] type + # @return [::String] + # Output only. Type for the module (for example, `CONFIGURABLE_BAD_IP`). + # @!attribute [r] display_name + # @return [::String] + # Output only. The human-readable name of the module. + # @!attribute [r] description + # @return [::String] + # Output only. A description of the module. + class EffectiveEventThreatDetectionCustomModule + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # The enablement state of the module. + module EnablementState + # Default value. This value is unused. + ENABLEMENT_STATE_UNSPECIFIED = 0 + + # The module is enabled at the given level. + ENABLED = 1 + + # The module is disabled at the given level. + DISABLED = 2 + end + end + + # Request message for + # {::Google::Cloud::SecurityCenterManagement::V1::SecurityCenterManagement::Client#list_effective_event_threat_detection_custom_modules SecurityCenterManagement.ListEffectiveEventThreatDetectionCustomModules}. + # @!attribute [rw] parent + # @return [::String] + # Required. Name of parent to list effective custom modules, in one of the + # following formats: + # + # * `organizations/{organization}/locations/{location}` + # * `folders/{folder}/locations/{location}` + # * `projects/{project}/locations/{location}` + # @!attribute [rw] page_size + # @return [::Integer] + # Optional. The maximum number of results to return in a single response. + # Default is 10, minimum is 1, maximum is 1000. + # @!attribute [rw] page_token + # @return [::String] + # Optional. A pagination token returned from a previous request. Provide this + # token to retrieve the next page of results. + # + # When paginating, the rest of the request must match the request that + # generated the page token. + class ListEffectiveEventThreatDetectionCustomModulesRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Response message for + # {::Google::Cloud::SecurityCenterManagement::V1::SecurityCenterManagement::Client#list_effective_event_threat_detection_custom_modules SecurityCenterManagement.ListEffectiveEventThreatDetectionCustomModules}. + # @!attribute [rw] effective_event_threat_detection_custom_modules + # @return [::Array<::Google::Cloud::SecurityCenterManagement::V1::EffectiveEventThreatDetectionCustomModule>] + # The list of effective Event Threat Detection custom modules. + # @!attribute [rw] next_page_token + # @return [::String] + # A pagination token. To retrieve the next page of results, call the method + # again with this token. + class ListEffectiveEventThreatDetectionCustomModulesResponse + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Request message for + # {::Google::Cloud::SecurityCenterManagement::V1::SecurityCenterManagement::Client#get_effective_event_threat_detection_custom_module SecurityCenterManagement.GetEffectiveEventThreatDetectionCustomModule}. + # @!attribute [rw] name + # @return [::String] + # Required. The resource name of the Event Threat Detection custom module, in + # one of the following formats: + # + # * `organizations/{organization}/locations/{location}/effectiveEventThreatDetectionCustomModules/{custom_module}` + # * `folders/{folder}/locations/{location}/effectiveEventThreatDetectionCustomModules/{custom_module}` + # * `projects/{project}/locations/{location}/effectiveEventThreatDetectionCustomModules/{custom_module}` + class GetEffectiveEventThreatDetectionCustomModuleRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # A Security Command Center resource that contains the configuration and + # enablement state of a custom module, which enables Event Threat Detection to + # write certain findings to Security Command Center. + # @!attribute [rw] name + # @return [::String] + # Identifier. The resource name of the Event Threat Detection custom module, + # in one of the following formats: + # + # * `organizations/{organization}/locations/{location}/eventThreatDetectionCustomModules/{custom_module}` + # * `folders/{folder}/locations/{location}/eventThreatDetectionCustomModules/{custom_module}` + # * `projects/{project}/locations/{location}/eventThreatDetectionCustomModules/{custom_module}` + # @!attribute [rw] config + # @return [::Google::Protobuf::Struct] + # Optional. Configuration for the module. For the resident module, its + # configuration value is defined at this level. For the inherited module, its + # configuration value is inherited from the ancestor module. + # @!attribute [r] ancestor_module + # @return [::String] + # Output only. The closest ancestor module that this module inherits the + # enablement state from. If empty, indicates that the custom module was + # created in the requesting parent organization, folder, or project. The + # format is the same as the custom module's resource name. + # @!attribute [rw] enablement_state + # @return [::Google::Cloud::SecurityCenterManagement::V1::EventThreatDetectionCustomModule::EnablementState] + # Optional. The state of enablement for the module at the given level of the + # hierarchy. + # @!attribute [rw] type + # @return [::String] + # Optional. Type for the module. For example, `CONFIGURABLE_BAD_IP`. + # @!attribute [rw] display_name + # @return [::String] + # Optional. The human-readable name of the module. + # @!attribute [rw] description + # @return [::String] + # Optional. A description of the module. + # @!attribute [r] update_time + # @return [::Google::Protobuf::Timestamp] + # Output only. The time the module was last updated. + # @!attribute [r] last_editor + # @return [::String] + # Output only. The editor the module was last updated by. + class EventThreatDetectionCustomModule + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # The enablement state of the module. + module EnablementState + # Unspecified enablement state. + ENABLEMENT_STATE_UNSPECIFIED = 0 + + # The module is enabled at the given level. + ENABLED = 1 + + # The module is disabled at the given level. + DISABLED = 2 + + # State is inherited from an ancestor module. The module will either be + # effectively `ENABLED` or `DISABLED` based on its closest non-inherited + # ancestor module in the CRM hierarchy. If you try to set a top-level + # module (a module with no parent) to the `INHERITED` state, you receive an + # `INVALID_ARGUMENT` error. + INHERITED = 3 + end + end + + # Request message for + # {::Google::Cloud::SecurityCenterManagement::V1::SecurityCenterManagement::Client#list_event_threat_detection_custom_modules SecurityCenterManagement.ListEventThreatDetectionCustomModules}. + # @!attribute [rw] parent + # @return [::String] + # Required. Name of parent to list custom modules, in one of the following + # formats: + # + # * `organizations/{organization}/locations/{location}` + # * `folders/{folder}/locations/{location}` + # * `projects/{project}/locations/{location}` + # @!attribute [rw] page_size + # @return [::Integer] + # Optional. The maximum number of modules to return. The service may return + # fewer than this value. If unspecified, at most 10 modules will be returned. + # The maximum value is 1000; values above 1000 will be coerced to 1000. + # @!attribute [rw] page_token + # @return [::String] + # Optional. A pagination token returned from a previous request. Provide this + # token to retrieve the next page of results. + # + # When paginating, the rest of the request must match the request that + # generated the page token. + class ListEventThreatDetectionCustomModulesRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Response message for + # {::Google::Cloud::SecurityCenterManagement::V1::SecurityCenterManagement::Client#list_event_threat_detection_custom_modules SecurityCenterManagement.ListEventThreatDetectionCustomModules}. + # @!attribute [rw] event_threat_detection_custom_modules + # @return [::Array<::Google::Cloud::SecurityCenterManagement::V1::EventThreatDetectionCustomModule>] + # The list of custom modules. + # @!attribute [rw] next_page_token + # @return [::String] + # A pagination token. To retrieve the next page of results, call the method + # again with this token. + class ListEventThreatDetectionCustomModulesResponse + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Request message for + # {::Google::Cloud::SecurityCenterManagement::V1::SecurityCenterManagement::Client#list_descendant_event_threat_detection_custom_modules SecurityCenterManagement.ListDescendantEventThreatDetectionCustomModules}. + # @!attribute [rw] parent + # @return [::String] + # Required. Name of parent to list custom modules, in one of the following + # formats: + # + # * `organizations/{organization}/locations/{location}` + # * `folders/{folder}/locations/{location}` + # * `projects/{project}/locations/{location}` + # @!attribute [rw] page_size + # @return [::Integer] + # Optional. The maximum number of modules to return. The service may return + # fewer than this value. If unspecified, at most 10 configs will be returned. + # The maximum value is 1000; values above 1000 will be coerced to 1000. + # @!attribute [rw] page_token + # @return [::String] + # Optional. A pagination token returned from a previous request. Provide this + # token to retrieve the next page of results. + # + # When paginating, the rest of the request must match the request that + # generated the page token. + class ListDescendantEventThreatDetectionCustomModulesRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Response message for + # {::Google::Cloud::SecurityCenterManagement::V1::SecurityCenterManagement::Client#list_descendant_event_threat_detection_custom_modules SecurityCenterManagement.ListDescendantEventThreatDetectionCustomModules}. + # @!attribute [rw] event_threat_detection_custom_modules + # @return [::Array<::Google::Cloud::SecurityCenterManagement::V1::EventThreatDetectionCustomModule>] + # The list of custom modules. + # @!attribute [rw] next_page_token + # @return [::String] + # A pagination token. To retrieve the next page of results, call the method + # again with this token. + class ListDescendantEventThreatDetectionCustomModulesResponse + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Request message for + # {::Google::Cloud::SecurityCenterManagement::V1::SecurityCenterManagement::Client#get_event_threat_detection_custom_module SecurityCenterManagement.GetEventThreatDetectionCustomModule}. + # @!attribute [rw] name + # @return [::String] + # Required. The resource name of the Event Threat Detection custom module, in + # one of the following formats: + # + # * `organizations/{organization}/locations/{location}/eventThreatDetectionCustomModules/{custom_module}` + # * `folders/{folder}/locations/{location}/eventThreatDetectionCustomModules/{custom_module}` + # * `projects/{project}/locations/{location}/eventThreatDetectionCustomModules/{custom_module}` + class GetEventThreatDetectionCustomModuleRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Request message for + # {::Google::Cloud::SecurityCenterManagement::V1::SecurityCenterManagement::Client#create_event_threat_detection_custom_module SecurityCenterManagement.CreateEventThreatDetectionCustomModule}. + # @!attribute [rw] parent + # @return [::String] + # Required. Name of parent for the module, in one of the following formats: + # + # * `organizations/{organization}/locations/{location}` + # * `folders/{folder}/locations/{location}` + # * `projects/{project}/locations/{location}` + # @!attribute [rw] event_threat_detection_custom_module + # @return [::Google::Cloud::SecurityCenterManagement::V1::EventThreatDetectionCustomModule] + # Required. The module to create. The + # {::Google::Cloud::SecurityCenterManagement::V1::EventThreatDetectionCustomModule#name EventThreatDetectionCustomModule.name} + # field is ignored; Security Command Center generates the name. + # @!attribute [rw] validate_only + # @return [::Boolean] + # Optional. When set to `true`, the request will be validated (including IAM + # checks), but no module will be created. An `OK` response indicates that the + # request is valid, while an error response indicates that the request is + # invalid. + # + # If the request is valid, a subsequent request to create the module could + # still fail for one of the following reasons: + # + # * The state of your cloud resources changed; for example, you lost a + # required IAM permission + # * An error occurred during creation of the module + # + # Defaults to `false`. + class CreateEventThreatDetectionCustomModuleRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Message for updating a EventThreatDetectionCustomModule + # @!attribute [rw] update_mask + # @return [::Google::Protobuf::FieldMask] + # Required. The fields to update. If omitted, then all fields are updated. + # @!attribute [rw] event_threat_detection_custom_module + # @return [::Google::Cloud::SecurityCenterManagement::V1::EventThreatDetectionCustomModule] + # Required. The module being updated. + # @!attribute [rw] validate_only + # @return [::Boolean] + # Optional. When set to `true`, the request will be validated (including IAM + # checks), but no module will be updated. An `OK` response indicates that the + # request is valid, while an error response indicates that the request is + # invalid. + # + # If the request is valid, a subsequent request to update the module could + # still fail for one of the following reasons: + # + # * The state of your cloud resources changed; for example, you lost a + # required IAM permission + # * An error occurred during creation of the module + # + # Defaults to `false`. + class UpdateEventThreatDetectionCustomModuleRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Request message for + # {::Google::Cloud::SecurityCenterManagement::V1::SecurityCenterManagement::Client#delete_event_threat_detection_custom_module SecurityCenterManagement.DeleteEventThreatDetectionCustomModule}. + # @!attribute [rw] name + # @return [::String] + # Required. The resource name of the Event Threat Detection custom module, in + # one of the following formats: + # + # * `organizations/{organization}/locations/{location}/eventThreatDetectionCustomModules/{custom_module}` + # * `folders/{folder}/locations/{location}/eventThreatDetectionCustomModules/{custom_module}` + # * `projects/{project}/locations/{location}/eventThreatDetectionCustomModules/{custom_module}` + # @!attribute [rw] validate_only + # @return [::Boolean] + # Optional. When set to `true`, the request will be validated (including IAM + # checks), but no module will be deleted. An `OK` response indicates that the + # request is valid, while an error response indicates that the request is + # invalid. + # + # If the request is valid, a subsequent request to delete the module could + # still fail for one of the following reasons: + # + # * The state of your cloud resources changed; for example, you lost a + # required IAM permission + # * An error occurred during creation of the module + # + # Defaults to `false`. + class DeleteEventThreatDetectionCustomModuleRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Request message for + # {::Google::Cloud::SecurityCenterManagement::V1::SecurityCenterManagement::Client#validate_event_threat_detection_custom_module SecurityCenterManagement.ValidateEventThreatDetectionCustomModule}. + # @!attribute [rw] parent + # @return [::String] + # Required. Resource name of the parent to validate the custom modules under, + # in one of the following formats: + # + # * `organizations/{organization}/locations/{location}` + # @!attribute [rw] raw_text + # @return [::String] + # Required. The raw text of the module's contents. Used to generate error + # messages. + # @!attribute [rw] type + # @return [::String] + # Required. The type of the module. For example, `CONFIGURABLE_BAD_IP`. + class ValidateEventThreatDetectionCustomModuleRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Response message for + # {::Google::Cloud::SecurityCenterManagement::V1::SecurityCenterManagement::Client#validate_event_threat_detection_custom_module SecurityCenterManagement.ValidateEventThreatDetectionCustomModule}. + # @!attribute [rw] errors + # @return [::Array<::Google::Cloud::SecurityCenterManagement::V1::ValidateEventThreatDetectionCustomModuleResponse::CustomModuleValidationError>] + # A list of errors returned by the validator. If the list is empty, there + # were no errors. + class ValidateEventThreatDetectionCustomModuleResponse + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # An error encountered while validating the uploaded configuration of an + # Event Threat Detection custom module. + # @!attribute [rw] description + # @return [::String] + # A human-readable description of the error. + # @!attribute [rw] field_path + # @return [::String] + # The path, in [RFC 6901: JSON + # Pointer](https://datatracker.ietf.org/doc/html/rfc6901) format, to the + # field that failed validation. Omitted if no specific field is affected. + # @!attribute [rw] start + # @return [::Google::Cloud::SecurityCenterManagement::V1::ValidateEventThreatDetectionCustomModuleResponse::Position] + # The initial position of the error in the uploaded text version of the + # module. Omitted if no specific position applies, or if the position could + # not be computed. + # @!attribute [rw] end + # @return [::Google::Cloud::SecurityCenterManagement::V1::ValidateEventThreatDetectionCustomModuleResponse::Position] + # The end position of the error in the uploaded text version of the module. + # Omitted if no specific position applies, or if the position could not be + # computed. + class CustomModuleValidationError + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # A position in the uploaded text version of a module. + # @!attribute [rw] line_number + # @return [::Integer] + # The line position in the text. + # @!attribute [rw] column_number + # @return [::Integer] + # The column position in the line. + class Position + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end + + # Request message for + # {::Google::Cloud::SecurityCenterManagement::V1::SecurityCenterManagement::Client#get_security_center_service SecurityCenterManagement.GetSecurityCenterService}. + # @!attribute [rw] name + # @return [::String] + # Required. The Security Command Center service to retrieve, in one of the + # following formats: + # + # * organizations/\\{organization}/locations/\\{location}/securityCenterServices/\\{service} + # * folders/\\{folder}/locations/\\{location}/securityCenterServices/\\{service} + # * projects/\\{project}/locations/\\{location}/securityCenterServices/\\{service} + # + # The following values are valid for `{service}`: + # + # * `container-threat-detection` + # * `event-threat-detection` + # * `security-health-analytics` + # * `vm-threat-detection` + # * `web-security-scanner` + # @!attribute [rw] show_eligible_modules_only + # @return [::Boolean] + # Set to `true` to show only modules that are in scope. By default, all + # modules are shown. + class GetSecurityCenterServiceRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Request message for + # {::Google::Cloud::SecurityCenterManagement::V1::SecurityCenterManagement::Client#list_security_center_services SecurityCenterManagement.ListSecurityCenterServices}. + # @!attribute [rw] parent + # @return [::String] + # Required. The name of the parent to list Security Command Center services, + # in one of the following formats: + # + # * `organizations/{organization}/locations/{location}` + # * `folders/{folder}/locations/{location}` + # * `projects/{project}/locations/{location}` + # @!attribute [rw] page_size + # @return [::Integer] + # Optional. The maximum number of results to return in a single response. + # Default is 10, minimum is 1, maximum is 1000. + # @!attribute [rw] page_token + # @return [::String] + # Optional. A pagination token returned from a previous request. Provide this + # token to retrieve the next page of results. + # + # When paginating, the rest of the request must match the request that + # generated the page token. + # @!attribute [rw] show_eligible_modules_only + # @return [::Boolean] + # Flag that, when set, is used to filter the module settings that are shown. + # The default setting is that all modules are shown. + class ListSecurityCenterServicesRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Response message for + # {::Google::Cloud::SecurityCenterManagement::V1::SecurityCenterManagement::Client#list_security_center_services SecurityCenterManagement.ListSecurityCenterServices}. + # @!attribute [rw] security_center_services + # @return [::Array<::Google::Cloud::SecurityCenterManagement::V1::SecurityCenterService>] + # The list of services. + # @!attribute [rw] next_page_token + # @return [::String] + # A pagination token. To retrieve the next page of results, call the method + # again with this token. + class ListSecurityCenterServicesResponse + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Request message for + # {::Google::Cloud::SecurityCenterManagement::V1::SecurityCenterManagement::Client#update_security_center_service SecurityCenterManagement.UpdateSecurityCenterService}. + # @!attribute [rw] security_center_service + # @return [::Google::Cloud::SecurityCenterManagement::V1::SecurityCenterService] + # Required. The updated service. + # @!attribute [rw] update_mask + # @return [::Google::Protobuf::FieldMask] + # Required. The fields to update. Accepts the following values: + # + # * `intended_enablement_state` + # * `modules` + # + # If omitted, then all eligible fields are updated. + # @!attribute [rw] validate_only + # @return [::Boolean] + # Optional. When set to `true`, the request will be validated (including IAM + # checks), but no service will be updated. An `OK` response indicates that + # the request is valid, while an error response indicates that the request is + # invalid. + # + # If the request is valid, a subsequent request to update the service could + # still fail for one of the following reasons: + # + # * The state of your cloud resources changed; for example, you lost a + # required IAM permission + # * An error occurred during update of the service + # + # Defaults to `false`. + class UpdateSecurityCenterServiceRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-security_center_management-v1/proto_docs/google/iam/v1/policy.rb b/owl-bot-staging/google-cloud-security_center_management-v1/proto_docs/google/iam/v1/policy.rb new file mode 100644 index 000000000000..999575b797df --- /dev/null +++ b/owl-bot-staging/google-cloud-security_center_management-v1/proto_docs/google/iam/v1/policy.rb @@ -0,0 +1,426 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + + +module Google + module Iam + module V1 + # An Identity and Access Management (IAM) policy, which specifies access + # controls for Google Cloud resources. + # + # + # A `Policy` is a collection of `bindings`. A `binding` binds one or more + # `members`, or principals, to a single `role`. Principals can be user + # accounts, service accounts, Google groups, and domains (such as G Suite). A + # `role` is a named list of permissions; each `role` can be an IAM predefined + # role or a user-created custom role. + # + # For some types of Google Cloud resources, a `binding` can also specify a + # `condition`, which is a logical expression that allows access to a resource + # only if the expression evaluates to `true`. A condition can add constraints + # based on attributes of the request, the resource, or both. To learn which + # resources support conditions in their IAM policies, see the + # [IAM + # documentation](https://cloud.google.com/iam/help/conditions/resource-policies). + # + # **JSON example:** + # + # ``` + # { + # "bindings": [ + # { + # "role": "roles/resourcemanager.organizationAdmin", + # "members": [ + # "user:mike@example.com", + # "group:admins@example.com", + # "domain:google.com", + # "serviceAccount:my-project-id@appspot.gserviceaccount.com" + # ] + # }, + # { + # "role": "roles/resourcemanager.organizationViewer", + # "members": [ + # "user:eve@example.com" + # ], + # "condition": { + # "title": "expirable access", + # "description": "Does not grant access after Sep 2020", + # "expression": "request.time < + # timestamp('2020-10-01T00:00:00.000Z')", + # } + # } + # ], + # "etag": "BwWWja0YfJA=", + # "version": 3 + # } + # ``` + # + # **YAML example:** + # + # ``` + # bindings: + # - members: + # - user:mike@example.com + # - group:admins@example.com + # - domain:google.com + # - serviceAccount:my-project-id@appspot.gserviceaccount.com + # role: roles/resourcemanager.organizationAdmin + # - members: + # - user:eve@example.com + # role: roles/resourcemanager.organizationViewer + # condition: + # title: expirable access + # description: Does not grant access after Sep 2020 + # expression: request.time < timestamp('2020-10-01T00:00:00.000Z') + # etag: BwWWja0YfJA= + # version: 3 + # ``` + # + # For a description of IAM and its features, see the + # [IAM documentation](https://cloud.google.com/iam/docs/). + # @!attribute [rw] version + # @return [::Integer] + # Specifies the format of the policy. + # + # Valid values are `0`, `1`, and `3`. Requests that specify an invalid value + # are rejected. + # + # Any operation that affects conditional role bindings must specify version + # `3`. This requirement applies to the following operations: + # + # * Getting a policy that includes a conditional role binding + # * Adding a conditional role binding to a policy + # * Changing a conditional role binding in a policy + # * Removing any role binding, with or without a condition, from a policy + # that includes conditions + # + # **Important:** If you use IAM Conditions, you must include the `etag` field + # whenever you call `setIamPolicy`. If you omit this field, then IAM allows + # you to overwrite a version `3` policy with a version `1` policy, and all of + # the conditions in the version `3` policy are lost. + # + # If a policy does not include any conditions, operations on that policy may + # specify any valid version or leave the field unset. + # + # To learn which resources support conditions in their IAM policies, see the + # [IAM + # documentation](https://cloud.google.com/iam/help/conditions/resource-policies). + # @!attribute [rw] bindings + # @return [::Array<::Google::Iam::V1::Binding>] + # Associates a list of `members`, or principals, with a `role`. Optionally, + # may specify a `condition` that determines how and when the `bindings` are + # applied. Each of the `bindings` must contain at least one principal. + # + # The `bindings` in a `Policy` can refer to up to 1,500 principals; up to 250 + # of these principals can be Google groups. Each occurrence of a principal + # counts towards these limits. For example, if the `bindings` grant 50 + # different roles to `user:alice@example.com`, and not to any other + # principal, then you can add another 1,450 principals to the `bindings` in + # the `Policy`. + # @!attribute [rw] audit_configs + # @return [::Array<::Google::Iam::V1::AuditConfig>] + # Specifies cloud audit logging configuration for this policy. + # @!attribute [rw] etag + # @return [::String] + # `etag` is used for optimistic concurrency control as a way to help + # prevent simultaneous updates of a policy from overwriting each other. + # It is strongly suggested that systems make use of the `etag` in the + # read-modify-write cycle to perform policy updates in order to avoid race + # conditions: An `etag` is returned in the response to `getIamPolicy`, and + # systems are expected to put that etag in the request to `setIamPolicy` to + # ensure that their change will be applied to the same version of the policy. + # + # **Important:** If you use IAM Conditions, you must include the `etag` field + # whenever you call `setIamPolicy`. If you omit this field, then IAM allows + # you to overwrite a version `3` policy with a version `1` policy, and all of + # the conditions in the version `3` policy are lost. + class Policy + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Associates `members`, or principals, with a `role`. + # @!attribute [rw] role + # @return [::String] + # Role that is assigned to the list of `members`, or principals. + # For example, `roles/viewer`, `roles/editor`, or `roles/owner`. + # @!attribute [rw] members + # @return [::Array<::String>] + # Specifies the principals requesting access for a Google Cloud resource. + # `members` can have the following values: + # + # * `allUsers`: A special identifier that represents anyone who is + # on the internet; with or without a Google account. + # + # * `allAuthenticatedUsers`: A special identifier that represents anyone + # who is authenticated with a Google account or a service account. + # + # * `user:{emailid}`: An email address that represents a specific Google + # account. For example, `alice@example.com` . + # + # + # * `serviceAccount:{emailid}`: An email address that represents a service + # account. For example, `my-other-app@appspot.gserviceaccount.com`. + # + # * `group:{emailid}`: An email address that represents a Google group. + # For example, `admins@example.com`. + # + # * `deleted:user:{emailid}?uid={uniqueid}`: An email address (plus unique + # identifier) representing a user that has been recently deleted. For + # example, `alice@example.com?uid=123456789012345678901`. If the user is + # recovered, this value reverts to `user:{emailid}` and the recovered user + # retains the role in the binding. + # + # * `deleted:serviceAccount:{emailid}?uid={uniqueid}`: An email address (plus + # unique identifier) representing a service account that has been recently + # deleted. For example, + # `my-other-app@appspot.gserviceaccount.com?uid=123456789012345678901`. + # If the service account is undeleted, this value reverts to + # `serviceAccount:{emailid}` and the undeleted service account retains the + # role in the binding. + # + # * `deleted:group:{emailid}?uid={uniqueid}`: An email address (plus unique + # identifier) representing a Google group that has been recently + # deleted. For example, `admins@example.com?uid=123456789012345678901`. If + # the group is recovered, this value reverts to `group:{emailid}` and the + # recovered group retains the role in the binding. + # + # + # * `domain:{domain}`: The G Suite domain (primary) that represents all the + # users of that domain. For example, `google.com` or `example.com`. + # @!attribute [rw] condition + # @return [::Google::Type::Expr] + # The condition that is associated with this binding. + # + # If the condition evaluates to `true`, then this binding applies to the + # current request. + # + # If the condition evaluates to `false`, then this binding does not apply to + # the current request. However, a different role binding might grant the same + # role to one or more of the principals in this binding. + # + # To learn which resources support conditions in their IAM policies, see the + # [IAM + # documentation](https://cloud.google.com/iam/help/conditions/resource-policies). + class Binding + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Specifies the audit configuration for a service. + # The configuration determines which permission types are logged, and what + # identities, if any, are exempted from logging. + # An AuditConfig must have one or more AuditLogConfigs. + # + # If there are AuditConfigs for both `allServices` and a specific service, + # the union of the two AuditConfigs is used for that service: the log_types + # specified in each AuditConfig are enabled, and the exempted_members in each + # AuditLogConfig are exempted. + # + # Example Policy with multiple AuditConfigs: + # + # { + # "audit_configs": [ + # { + # "service": "allServices", + # "audit_log_configs": [ + # { + # "log_type": "DATA_READ", + # "exempted_members": [ + # "user:jose@example.com" + # ] + # }, + # { + # "log_type": "DATA_WRITE" + # }, + # { + # "log_type": "ADMIN_READ" + # } + # ] + # }, + # { + # "service": "sampleservice.googleapis.com", + # "audit_log_configs": [ + # { + # "log_type": "DATA_READ" + # }, + # { + # "log_type": "DATA_WRITE", + # "exempted_members": [ + # "user:aliya@example.com" + # ] + # } + # ] + # } + # ] + # } + # + # For sampleservice, this policy enables DATA_READ, DATA_WRITE and ADMIN_READ + # logging. It also exempts `jose@example.com` from DATA_READ logging, and + # `aliya@example.com` from DATA_WRITE logging. + # @!attribute [rw] service + # @return [::String] + # Specifies a service that will be enabled for audit logging. + # For example, `storage.googleapis.com`, `cloudsql.googleapis.com`. + # `allServices` is a special value that covers all services. + # @!attribute [rw] audit_log_configs + # @return [::Array<::Google::Iam::V1::AuditLogConfig>] + # The configuration for logging of each type of permission. + class AuditConfig + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Provides the configuration for logging a type of permissions. + # Example: + # + # { + # "audit_log_configs": [ + # { + # "log_type": "DATA_READ", + # "exempted_members": [ + # "user:jose@example.com" + # ] + # }, + # { + # "log_type": "DATA_WRITE" + # } + # ] + # } + # + # This enables 'DATA_READ' and 'DATA_WRITE' logging, while exempting + # jose@example.com from DATA_READ logging. + # @!attribute [rw] log_type + # @return [::Google::Iam::V1::AuditLogConfig::LogType] + # The log type that this config enables. + # @!attribute [rw] exempted_members + # @return [::Array<::String>] + # Specifies the identities that do not cause logging for this type of + # permission. + # Follows the same format of + # [Binding.members][google.iam.v1.Binding.members]. + class AuditLogConfig + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # The list of valid permission types for which logging can be configured. + # Admin writes are always logged, and are not configurable. + module LogType + # Default case. Should never be this. + LOG_TYPE_UNSPECIFIED = 0 + + # Admin reads. Example: CloudIAM getIamPolicy + ADMIN_READ = 1 + + # Data writes. Example: CloudSQL Users create + DATA_WRITE = 2 + + # Data reads. Example: CloudSQL Users list + DATA_READ = 3 + end + end + + # The difference delta between two policies. + # @!attribute [rw] binding_deltas + # @return [::Array<::Google::Iam::V1::BindingDelta>] + # The delta for Bindings between two policies. + # @!attribute [rw] audit_config_deltas + # @return [::Array<::Google::Iam::V1::AuditConfigDelta>] + # The delta for AuditConfigs between two policies. + class PolicyDelta + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # One delta entry for Binding. Each individual change (only one member in each + # entry) to a binding will be a separate entry. + # @!attribute [rw] action + # @return [::Google::Iam::V1::BindingDelta::Action] + # The action that was performed on a Binding. + # Required + # @!attribute [rw] role + # @return [::String] + # Role that is assigned to `members`. + # For example, `roles/viewer`, `roles/editor`, or `roles/owner`. + # Required + # @!attribute [rw] member + # @return [::String] + # A single identity requesting access for a Google Cloud resource. + # Follows the same format of Binding.members. + # Required + # @!attribute [rw] condition + # @return [::Google::Type::Expr] + # The condition that is associated with this binding. + class BindingDelta + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # The type of action performed on a Binding in a policy. + module Action + # Unspecified. + ACTION_UNSPECIFIED = 0 + + # Addition of a Binding. + ADD = 1 + + # Removal of a Binding. + REMOVE = 2 + end + end + + # One delta entry for AuditConfig. Each individual change (only one + # exempted_member in each entry) to a AuditConfig will be a separate entry. + # @!attribute [rw] action + # @return [::Google::Iam::V1::AuditConfigDelta::Action] + # The action that was performed on an audit configuration in a policy. + # Required + # @!attribute [rw] service + # @return [::String] + # Specifies a service that was configured for Cloud Audit Logging. + # For example, `storage.googleapis.com`, `cloudsql.googleapis.com`. + # `allServices` is a special value that covers all services. + # Required + # @!attribute [rw] exempted_member + # @return [::String] + # A single identity that is exempted from "data access" audit + # logging for the `service` specified above. + # Follows the same format of Binding.members. + # @!attribute [rw] log_type + # @return [::String] + # Specifies the log_type that was be enabled. ADMIN_ACTIVITY is always + # enabled, and cannot be configured. + # Required + class AuditConfigDelta + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # The type of action performed on an audit configuration in a policy. + module Action + # Unspecified. + ACTION_UNSPECIFIED = 0 + + # Addition of an audit configuration. + ADD = 1 + + # Removal of an audit configuration. + REMOVE = 2 + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-security_center_management-v1/proto_docs/google/protobuf/any.rb b/owl-bot-staging/google-cloud-security_center_management-v1/proto_docs/google/protobuf/any.rb new file mode 100644 index 000000000000..58691995f02e --- /dev/null +++ b/owl-bot-staging/google-cloud-security_center_management-v1/proto_docs/google/protobuf/any.rb @@ -0,0 +1,145 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + + +module Google + module Protobuf + # `Any` contains an arbitrary serialized protocol buffer message along with a + # URL that describes the type of the serialized message. + # + # Protobuf library provides support to pack/unpack Any values in the form + # of utility functions or additional generated methods of the Any type. + # + # Example 1: Pack and unpack a message in C++. + # + # Foo foo = ...; + # Any any; + # any.PackFrom(foo); + # ... + # if (any.UnpackTo(&foo)) { + # ... + # } + # + # Example 2: Pack and unpack a message in Java. + # + # Foo foo = ...; + # Any any = Any.pack(foo); + # ... + # if (any.is(Foo.class)) { + # foo = any.unpack(Foo.class); + # } + # // or ... + # if (any.isSameTypeAs(Foo.getDefaultInstance())) { + # foo = any.unpack(Foo.getDefaultInstance()); + # } + # + # Example 3: Pack and unpack a message in Python. + # + # foo = Foo(...) + # any = Any() + # any.Pack(foo) + # ... + # if any.Is(Foo.DESCRIPTOR): + # any.Unpack(foo) + # ... + # + # Example 4: Pack and unpack a message in Go + # + # foo := &pb.Foo{...} + # any, err := anypb.New(foo) + # if err != nil { + # ... + # } + # ... + # foo := &pb.Foo{} + # if err := any.UnmarshalTo(foo); err != nil { + # ... + # } + # + # The pack methods provided by protobuf library will by default use + # 'type.googleapis.com/full.type.name' as the type URL and the unpack + # methods only use the fully qualified type name after the last '/' + # in the type URL, for example "foo.bar.com/x/y.z" will yield type + # name "y.z". + # + # JSON + # ==== + # The JSON representation of an `Any` value uses the regular + # representation of the deserialized, embedded message, with an + # additional field `@type` which contains the type URL. Example: + # + # package google.profile; + # message Person { + # string first_name = 1; + # string last_name = 2; + # } + # + # { + # "@type": "type.googleapis.com/google.profile.Person", + # "firstName": , + # "lastName": + # } + # + # If the embedded message type is well-known and has a custom JSON + # representation, that representation will be embedded adding a field + # `value` which holds the custom JSON in addition to the `@type` + # field. Example (for message [google.protobuf.Duration][]): + # + # { + # "@type": "type.googleapis.com/google.protobuf.Duration", + # "value": "1.212s" + # } + # @!attribute [rw] type_url + # @return [::String] + # A URL/resource name that uniquely identifies the type of the serialized + # protocol buffer message. This string must contain at least + # one "/" character. The last segment of the URL's path must represent + # the fully qualified name of the type (as in + # `path/google.protobuf.Duration`). The name should be in a canonical form + # (e.g., leading "." is not accepted). + # + # In practice, teams usually precompile into the binary all types that they + # expect it to use in the context of Any. However, for URLs which use the + # scheme `http`, `https`, or no scheme, one can optionally set up a type + # server that maps type URLs to message definitions as follows: + # + # * If no scheme is provided, `https` is assumed. + # * An HTTP GET on the URL must yield a [google.protobuf.Type][] + # value in binary format, or produce an error. + # * Applications are allowed to cache lookup results based on the + # URL, or have them precompiled into a binary to avoid any + # lookup. Therefore, binary compatibility needs to be preserved + # on changes to types. (Use versioned type names to manage + # breaking changes.) + # + # Note: this functionality is not currently available in the official + # protobuf release, and it is not used for type URLs beginning with + # type.googleapis.com. As of May 2023, there are no widely used type server + # implementations and no plans to implement one. + # + # Schemes other than `http`, `https` (or the empty scheme) might be + # used with implementation specific semantics. + # @!attribute [rw] value + # @return [::String] + # Must be a valid serialized protocol buffer of the above specified type. + class Any + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end +end diff --git a/owl-bot-staging/google-cloud-security_center_management-v1/proto_docs/google/protobuf/duration.rb b/owl-bot-staging/google-cloud-security_center_management-v1/proto_docs/google/protobuf/duration.rb new file mode 100644 index 000000000000..ea59f1f91daf --- /dev/null +++ b/owl-bot-staging/google-cloud-security_center_management-v1/proto_docs/google/protobuf/duration.rb @@ -0,0 +1,98 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + + +module Google + module Protobuf + # A Duration represents a signed, fixed-length span of time represented + # as a count of seconds and fractions of seconds at nanosecond + # resolution. It is independent of any calendar and concepts like "day" + # or "month". It is related to Timestamp in that the difference between + # two Timestamp values is a Duration and it can be added or subtracted + # from a Timestamp. Range is approximately +-10,000 years. + # + # # Examples + # + # Example 1: Compute Duration from two Timestamps in pseudo code. + # + # Timestamp start = ...; + # Timestamp end = ...; + # Duration duration = ...; + # + # duration.seconds = end.seconds - start.seconds; + # duration.nanos = end.nanos - start.nanos; + # + # if (duration.seconds < 0 && duration.nanos > 0) { + # duration.seconds += 1; + # duration.nanos -= 1000000000; + # } else if (duration.seconds > 0 && duration.nanos < 0) { + # duration.seconds -= 1; + # duration.nanos += 1000000000; + # } + # + # Example 2: Compute Timestamp from Timestamp + Duration in pseudo code. + # + # Timestamp start = ...; + # Duration duration = ...; + # Timestamp end = ...; + # + # end.seconds = start.seconds + duration.seconds; + # end.nanos = start.nanos + duration.nanos; + # + # if (end.nanos < 0) { + # end.seconds -= 1; + # end.nanos += 1000000000; + # } else if (end.nanos >= 1000000000) { + # end.seconds += 1; + # end.nanos -= 1000000000; + # } + # + # Example 3: Compute Duration from datetime.timedelta in Python. + # + # td = datetime.timedelta(days=3, minutes=10) + # duration = Duration() + # duration.FromTimedelta(td) + # + # # JSON Mapping + # + # In JSON format, the Duration type is encoded as a string rather than an + # object, where the string ends in the suffix "s" (indicating seconds) and + # is preceded by the number of seconds, with nanoseconds expressed as + # fractional seconds. For example, 3 seconds with 0 nanoseconds should be + # encoded in JSON format as "3s", while 3 seconds and 1 nanosecond should + # be expressed in JSON format as "3.000000001s", and 3 seconds and 1 + # microsecond should be expressed in JSON format as "3.000001s". + # @!attribute [rw] seconds + # @return [::Integer] + # Signed seconds of the span of time. Must be from -315,576,000,000 + # to +315,576,000,000 inclusive. Note: these bounds are computed from: + # 60 sec/min * 60 min/hr * 24 hr/day * 365.25 days/year * 10000 years + # @!attribute [rw] nanos + # @return [::Integer] + # Signed fractions of a second at nanosecond resolution of the span + # of time. Durations less than one second are represented with a 0 + # `seconds` field and a positive or negative `nanos` field. For durations + # of one second or more, a non-zero value for the `nanos` field must be + # of the same sign as the `seconds` field. Must be from -999,999,999 + # to +999,999,999 inclusive. + class Duration + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end +end diff --git a/owl-bot-staging/google-cloud-security_center_management-v1/proto_docs/google/protobuf/empty.rb b/owl-bot-staging/google-cloud-security_center_management-v1/proto_docs/google/protobuf/empty.rb new file mode 100644 index 000000000000..83e4481834a6 --- /dev/null +++ b/owl-bot-staging/google-cloud-security_center_management-v1/proto_docs/google/protobuf/empty.rb @@ -0,0 +1,34 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + + +module Google + module Protobuf + # A generic empty message that you can re-use to avoid defining duplicated + # empty messages in your APIs. A typical example is to use it as the request + # or the response type of an API method. For instance: + # + # service Foo { + # rpc Bar(google.protobuf.Empty) returns (google.protobuf.Empty); + # } + class Empty + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end +end diff --git a/owl-bot-staging/google-cloud-security_center_management-v1/proto_docs/google/protobuf/field_mask.rb b/owl-bot-staging/google-cloud-security_center_management-v1/proto_docs/google/protobuf/field_mask.rb new file mode 100644 index 000000000000..7f3ffc78601a --- /dev/null +++ b/owl-bot-staging/google-cloud-security_center_management-v1/proto_docs/google/protobuf/field_mask.rb @@ -0,0 +1,229 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + + +module Google + module Protobuf + # `FieldMask` represents a set of symbolic field paths, for example: + # + # paths: "f.a" + # paths: "f.b.d" + # + # Here `f` represents a field in some root message, `a` and `b` + # fields in the message found in `f`, and `d` a field found in the + # message in `f.b`. + # + # Field masks are used to specify a subset of fields that should be + # returned by a get operation or modified by an update operation. + # Field masks also have a custom JSON encoding (see below). + # + # # Field Masks in Projections + # + # When used in the context of a projection, a response message or + # sub-message is filtered by the API to only contain those fields as + # specified in the mask. For example, if the mask in the previous + # example is applied to a response message as follows: + # + # f { + # a : 22 + # b { + # d : 1 + # x : 2 + # } + # y : 13 + # } + # z: 8 + # + # The result will not contain specific values for fields x,y and z + # (their value will be set to the default, and omitted in proto text + # output): + # + # + # f { + # a : 22 + # b { + # d : 1 + # } + # } + # + # A repeated field is not allowed except at the last position of a + # paths string. + # + # If a FieldMask object is not present in a get operation, the + # operation applies to all fields (as if a FieldMask of all fields + # had been specified). + # + # Note that a field mask does not necessarily apply to the + # top-level response message. In case of a REST get operation, the + # field mask applies directly to the response, but in case of a REST + # list operation, the mask instead applies to each individual message + # in the returned resource list. In case of a REST custom method, + # other definitions may be used. Where the mask applies will be + # clearly documented together with its declaration in the API. In + # any case, the effect on the returned resource/resources is required + # behavior for APIs. + # + # # Field Masks in Update Operations + # + # A field mask in update operations specifies which fields of the + # targeted resource are going to be updated. The API is required + # to only change the values of the fields as specified in the mask + # and leave the others untouched. If a resource is passed in to + # describe the updated values, the API ignores the values of all + # fields not covered by the mask. + # + # If a repeated field is specified for an update operation, new values will + # be appended to the existing repeated field in the target resource. Note that + # a repeated field is only allowed in the last position of a `paths` string. + # + # If a sub-message is specified in the last position of the field mask for an + # update operation, then new value will be merged into the existing sub-message + # in the target resource. + # + # For example, given the target message: + # + # f { + # b { + # d: 1 + # x: 2 + # } + # c: [1] + # } + # + # And an update message: + # + # f { + # b { + # d: 10 + # } + # c: [2] + # } + # + # then if the field mask is: + # + # paths: ["f.b", "f.c"] + # + # then the result will be: + # + # f { + # b { + # d: 10 + # x: 2 + # } + # c: [1, 2] + # } + # + # An implementation may provide options to override this default behavior for + # repeated and message fields. + # + # In order to reset a field's value to the default, the field must + # be in the mask and set to the default value in the provided resource. + # Hence, in order to reset all fields of a resource, provide a default + # instance of the resource and set all fields in the mask, or do + # not provide a mask as described below. + # + # If a field mask is not present on update, the operation applies to + # all fields (as if a field mask of all fields has been specified). + # Note that in the presence of schema evolution, this may mean that + # fields the client does not know and has therefore not filled into + # the request will be reset to their default. If this is unwanted + # behavior, a specific service may require a client to always specify + # a field mask, producing an error if not. + # + # As with get operations, the location of the resource which + # describes the updated values in the request message depends on the + # operation kind. In any case, the effect of the field mask is + # required to be honored by the API. + # + # ## Considerations for HTTP REST + # + # The HTTP kind of an update operation which uses a field mask must + # be set to PATCH instead of PUT in order to satisfy HTTP semantics + # (PUT must only be used for full updates). + # + # # JSON Encoding of Field Masks + # + # In JSON, a field mask is encoded as a single string where paths are + # separated by a comma. Fields name in each path are converted + # to/from lower-camel naming conventions. + # + # As an example, consider the following message declarations: + # + # message Profile { + # User user = 1; + # Photo photo = 2; + # } + # message User { + # string display_name = 1; + # string address = 2; + # } + # + # In proto a field mask for `Profile` may look as such: + # + # mask { + # paths: "user.display_name" + # paths: "photo" + # } + # + # In JSON, the same mask is represented as below: + # + # { + # mask: "user.displayName,photo" + # } + # + # # Field Masks and Oneof Fields + # + # Field masks treat fields in oneofs just as regular fields. Consider the + # following message: + # + # message SampleMessage { + # oneof test_oneof { + # string name = 4; + # SubMessage sub_message = 9; + # } + # } + # + # The field mask can be: + # + # mask { + # paths: "name" + # } + # + # Or: + # + # mask { + # paths: "sub_message" + # } + # + # Note that oneof type names ("test_oneof" in this case) cannot be used in + # paths. + # + # ## Field Mask Verification + # + # The implementation of any API method which has a FieldMask type field in the + # request should verify the included field paths, and return an + # `INVALID_ARGUMENT` error if any path is unmappable. + # @!attribute [rw] paths + # @return [::Array<::String>] + # The set of field mask paths. + class FieldMask + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end +end diff --git a/owl-bot-staging/google-cloud-security_center_management-v1/proto_docs/google/protobuf/struct.rb b/owl-bot-staging/google-cloud-security_center_management-v1/proto_docs/google/protobuf/struct.rb new file mode 100644 index 000000000000..39e1aca868d2 --- /dev/null +++ b/owl-bot-staging/google-cloud-security_center_management-v1/proto_docs/google/protobuf/struct.rb @@ -0,0 +1,108 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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 + # `Struct` represents a structured data value, consisting of fields + # which map to dynamically typed values. In some languages, `Struct` + # might be supported by a native representation. For example, in + # scripting languages like JS a struct is represented as an + # object. The details of that representation are described together + # with the proto support for the language. + # + # The JSON representation for `Struct` is JSON object. + # @!attribute [rw] fields + # @return [::Google::Protobuf::Map{::String => ::Google::Protobuf::Value}] + # Unordered map of dynamically typed values. + class Struct + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # @!attribute [rw] key + # @return [::String] + # @!attribute [rw] value + # @return [::Google::Protobuf::Value] + class FieldsEntry + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end + + # `Value` represents a dynamically typed value which can be either + # null, a number, a string, a boolean, a recursive struct value, or a + # list of values. A producer of value is expected to set one of these + # variants. Absence of any variant indicates an error. + # + # The JSON representation for `Value` is JSON value. + # @!attribute [rw] null_value + # @return [::Google::Protobuf::NullValue] + # Represents a null value. + # + # Note: The following fields are mutually exclusive: `null_value`, `number_value`, `string_value`, `bool_value`, `struct_value`, `list_value`. If a field in that set is populated, all other fields in the set will automatically be cleared. + # @!attribute [rw] number_value + # @return [::Float] + # Represents a double value. + # + # Note: The following fields are mutually exclusive: `number_value`, `null_value`, `string_value`, `bool_value`, `struct_value`, `list_value`. If a field in that set is populated, all other fields in the set will automatically be cleared. + # @!attribute [rw] string_value + # @return [::String] + # Represents a string value. + # + # Note: The following fields are mutually exclusive: `string_value`, `null_value`, `number_value`, `bool_value`, `struct_value`, `list_value`. If a field in that set is populated, all other fields in the set will automatically be cleared. + # @!attribute [rw] bool_value + # @return [::Boolean] + # Represents a boolean value. + # + # Note: The following fields are mutually exclusive: `bool_value`, `null_value`, `number_value`, `string_value`, `struct_value`, `list_value`. If a field in that set is populated, all other fields in the set will automatically be cleared. + # @!attribute [rw] struct_value + # @return [::Google::Protobuf::Struct] + # Represents a structured value. + # + # Note: The following fields are mutually exclusive: `struct_value`, `null_value`, `number_value`, `string_value`, `bool_value`, `list_value`. If a field in that set is populated, all other fields in the set will automatically be cleared. + # @!attribute [rw] list_value + # @return [::Google::Protobuf::ListValue] + # Represents a repeated `Value`. + # + # Note: The following fields are mutually exclusive: `list_value`, `null_value`, `number_value`, `string_value`, `bool_value`, `struct_value`. If a field in that set is populated, all other fields in the set will automatically be cleared. + class Value + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # `ListValue` is a wrapper around a repeated field of values. + # + # The JSON representation for `ListValue` is JSON array. + # @!attribute [rw] values + # @return [::Array<::Google::Protobuf::Value>] + # Repeated field of dynamically typed values. + class ListValue + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # `NullValue` is a singleton enumeration to represent the null value for the + # `Value` type union. + # + # The JSON representation for `NullValue` is JSON `null`. + module NullValue + # Null value. + NULL_VALUE = 0 + end + end +end diff --git a/owl-bot-staging/google-cloud-security_center_management-v1/proto_docs/google/protobuf/timestamp.rb b/owl-bot-staging/google-cloud-security_center_management-v1/proto_docs/google/protobuf/timestamp.rb new file mode 100644 index 000000000000..74352be9c58c --- /dev/null +++ b/owl-bot-staging/google-cloud-security_center_management-v1/proto_docs/google/protobuf/timestamp.rb @@ -0,0 +1,127 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + + +module Google + module Protobuf + # A Timestamp represents a point in time independent of any time zone or local + # calendar, encoded as a count of seconds and fractions of seconds at + # nanosecond resolution. The count is relative to an epoch at UTC midnight on + # January 1, 1970, in the proleptic Gregorian calendar which extends the + # Gregorian calendar backwards to year one. + # + # All minutes are 60 seconds long. Leap seconds are "smeared" so that no leap + # second table is needed for interpretation, using a [24-hour linear + # smear](https://developers.google.com/time/smear). + # + # The range is from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59.999999999Z. By + # restricting to that range, we ensure that we can convert to and from [RFC + # 3339](https://www.ietf.org/rfc/rfc3339.txt) date strings. + # + # # Examples + # + # Example 1: Compute Timestamp from POSIX `time()`. + # + # Timestamp timestamp; + # timestamp.set_seconds(time(NULL)); + # timestamp.set_nanos(0); + # + # Example 2: Compute Timestamp from POSIX `gettimeofday()`. + # + # struct timeval tv; + # gettimeofday(&tv, NULL); + # + # Timestamp timestamp; + # timestamp.set_seconds(tv.tv_sec); + # timestamp.set_nanos(tv.tv_usec * 1000); + # + # Example 3: Compute Timestamp from Win32 `GetSystemTimeAsFileTime()`. + # + # FILETIME ft; + # GetSystemTimeAsFileTime(&ft); + # UINT64 ticks = (((UINT64)ft.dwHighDateTime) << 32) | ft.dwLowDateTime; + # + # // A Windows tick is 100 nanoseconds. Windows epoch 1601-01-01T00:00:00Z + # // is 11644473600 seconds before Unix epoch 1970-01-01T00:00:00Z. + # Timestamp timestamp; + # timestamp.set_seconds((INT64) ((ticks / 10000000) - 11644473600LL)); + # timestamp.set_nanos((INT32) ((ticks % 10000000) * 100)); + # + # Example 4: Compute Timestamp from Java `System.currentTimeMillis()`. + # + # long millis = System.currentTimeMillis(); + # + # Timestamp timestamp = Timestamp.newBuilder().setSeconds(millis / 1000) + # .setNanos((int) ((millis % 1000) * 1000000)).build(); + # + # Example 5: Compute Timestamp from Java `Instant.now()`. + # + # Instant now = Instant.now(); + # + # Timestamp timestamp = + # Timestamp.newBuilder().setSeconds(now.getEpochSecond()) + # .setNanos(now.getNano()).build(); + # + # Example 6: Compute Timestamp from current time in Python. + # + # timestamp = Timestamp() + # timestamp.GetCurrentTime() + # + # # JSON Mapping + # + # In JSON format, the Timestamp type is encoded as a string in the + # [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format. That is, the + # format is "\\{year}-\\{month}-\\{day}T\\{hour}:\\{min}:\\{sec}[.\\{frac_sec}]Z" + # where \\{year} is always expressed using four digits while \\{month}, \\{day}, + # \\{hour}, \\{min}, and \\{sec} are zero-padded to two digits each. The fractional + # seconds, which can go up to 9 digits (i.e. up to 1 nanosecond resolution), + # are optional. The "Z" suffix indicates the timezone ("UTC"); the timezone + # is required. A proto3 JSON serializer should always use UTC (as indicated by + # "Z") when printing the Timestamp type and a proto3 JSON parser should be + # able to accept both UTC and other timezones (as indicated by an offset). + # + # For example, "2017-01-15T01:30:15.01Z" encodes 15.01 seconds past + # 01:30 UTC on January 15, 2017. + # + # In JavaScript, one can convert a Date object to this format using the + # standard + # [toISOString()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toISOString) + # method. In Python, a standard `datetime.datetime` object can be converted + # to this format using + # [`strftime`](https://docs.python.org/2/library/time.html#time.strftime) with + # the time format spec '%Y-%m-%dT%H:%M:%S.%fZ'. Likewise, in Java, one can use + # the Joda Time's [`ISODateTimeFormat.dateTime()`]( + # http://joda-time.sourceforge.net/apidocs/org/joda/time/format/ISODateTimeFormat.html#dateTime() + # ) to obtain a formatter capable of generating timestamps in this format. + # @!attribute [rw] seconds + # @return [::Integer] + # Represents seconds of UTC time since Unix epoch + # 1970-01-01T00:00:00Z. Must be from 0001-01-01T00:00:00Z to + # 9999-12-31T23:59:59Z inclusive. + # @!attribute [rw] nanos + # @return [::Integer] + # Non-negative fractions of a second at nanosecond resolution. Negative + # second values with fractions must still have non-negative nanos values + # that count forward in time. Must be from 0 to 999,999,999 + # inclusive. + class Timestamp + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end +end diff --git a/owl-bot-staging/google-cloud-security_center_management-v1/proto_docs/google/rpc/status.rb b/owl-bot-staging/google-cloud-security_center_management-v1/proto_docs/google/rpc/status.rb new file mode 100644 index 000000000000..c1a1c07eb2db --- /dev/null +++ b/owl-bot-staging/google-cloud-security_center_management-v1/proto_docs/google/rpc/status.rb @@ -0,0 +1,48 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + + +module Google + module Rpc + # The `Status` type defines a logical error model that is suitable for + # different programming environments, including REST APIs and RPC APIs. It is + # used by [gRPC](https://github.com/grpc). Each `Status` message contains + # three pieces of data: error code, error message, and error details. + # + # You can find out more about this error model and how to work with it in the + # [API Design Guide](https://cloud.google.com/apis/design/errors). + # @!attribute [rw] code + # @return [::Integer] + # The status code, which should be an enum value of + # [google.rpc.Code][google.rpc.Code]. + # @!attribute [rw] message + # @return [::String] + # A developer-facing error message, which should be in English. Any + # user-facing error message should be localized and sent in the + # {::Google::Rpc::Status#details google.rpc.Status.details} field, or localized + # by the client. + # @!attribute [rw] details + # @return [::Array<::Google::Protobuf::Any>] + # A list of messages that carry the error details. There is a common set of + # message types for APIs to use. + class Status + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end +end diff --git a/owl-bot-staging/google-cloud-security_center_management-v1/proto_docs/google/type/expr.rb b/owl-bot-staging/google-cloud-security_center_management-v1/proto_docs/google/type/expr.rb new file mode 100644 index 000000000000..53e7733b6592 --- /dev/null +++ b/owl-bot-staging/google-cloud-security_center_management-v1/proto_docs/google/type/expr.rb @@ -0,0 +1,75 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + + +module Google + module Type + # Represents a textual expression in the Common Expression Language (CEL) + # syntax. CEL is a C-like expression language. The syntax and semantics of CEL + # are documented at https://github.com/google/cel-spec. + # + # Example (Comparison): + # + # title: "Summary size limit" + # description: "Determines if a summary is less than 100 chars" + # expression: "document.summary.size() < 100" + # + # Example (Equality): + # + # title: "Requestor is owner" + # description: "Determines if requestor is the document owner" + # expression: "document.owner == request.auth.claims.email" + # + # Example (Logic): + # + # title: "Public documents" + # description: "Determine whether the document should be publicly visible" + # expression: "document.type != 'private' && document.type != 'internal'" + # + # Example (Data Manipulation): + # + # title: "Notification string" + # description: "Create a notification string with a timestamp." + # expression: "'New message received at ' + string(document.create_time)" + # + # The exact variables and functions that may be referenced within an expression + # are determined by the service that evaluates it. See the service + # documentation for additional information. + # @!attribute [rw] expression + # @return [::String] + # Textual representation of an expression in Common Expression Language + # syntax. + # @!attribute [rw] title + # @return [::String] + # Optional. Title for the expression, i.e. a short string describing + # its purpose. This can be used e.g. in UIs which allow to enter the + # expression. + # @!attribute [rw] description + # @return [::String] + # Optional. Description of the expression. This is a longer text which + # describes the expression, e.g. when hovered over it in a UI. + # @!attribute [rw] location + # @return [::String] + # Optional. String indicating the location of the expression for error + # reporting, e.g. a file name and a position in the file. + class Expr + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end +end diff --git a/owl-bot-staging/google-cloud-security_center_management-v1/snippets/Gemfile b/owl-bot-staging/google-cloud-security_center_management-v1/snippets/Gemfile new file mode 100644 index 000000000000..48ea53e31c30 --- /dev/null +++ b/owl-bot-staging/google-cloud-security_center_management-v1/snippets/Gemfile @@ -0,0 +1,32 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +source "https://rubygems.org" + +if ENV["GOOGLE_CLOUD_SAMPLES_TEST"] == "master" + gem "google-cloud-security_center_management-v1", path: "../" +else + gem "google-cloud-security_center_management-v1" +end + +group :test do + gem "google-style", "~> 1.26.1" + gem "minitest", "~> 5.16" + gem "minitest-focus", "~> 1.1" + gem "minitest-hooks", "~> 1.5" +end diff --git a/owl-bot-staging/google-cloud-security_center_management-v1/snippets/security_center_management/create_event_threat_detection_custom_module.rb b/owl-bot-staging/google-cloud-security_center_management-v1/snippets/security_center_management/create_event_threat_detection_custom_module.rb new file mode 100644 index 000000000000..1af62ea87528 --- /dev/null +++ b/owl-bot-staging/google-cloud-security_center_management-v1/snippets/security_center_management/create_event_threat_detection_custom_module.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 securitycentermanagement_v1_generated_SecurityCenterManagement_CreateEventThreatDetectionCustomModule_sync] +require "google/cloud/security_center_management/v1" + +## +# Snippet for the create_event_threat_detection_custom_module call in the SecurityCenterManagement service +# +# This snippet has been automatically generated and should be regarded as a code +# template only. It will require modifications to work: +# - It may require correct/in-range values for request initialization. +# - It may require specifying regional endpoints when creating the service +# client as shown in https://cloud.google.com/ruby/docs/reference. +# +# This is an auto-generated example demonstrating basic usage of +# Google::Cloud::SecurityCenterManagement::V1::SecurityCenterManagement::Client#create_event_threat_detection_custom_module. +# +def create_event_threat_detection_custom_module + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::SecurityCenterManagement::V1::SecurityCenterManagement::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::SecurityCenterManagement::V1::CreateEventThreatDetectionCustomModuleRequest.new + + # Call the create_event_threat_detection_custom_module method. + result = client.create_event_threat_detection_custom_module request + + # The returned object is of type Google::Cloud::SecurityCenterManagement::V1::EventThreatDetectionCustomModule. + p result +end +# [END securitycentermanagement_v1_generated_SecurityCenterManagement_CreateEventThreatDetectionCustomModule_sync] diff --git a/owl-bot-staging/google-cloud-security_center_management-v1/snippets/security_center_management/create_security_health_analytics_custom_module.rb b/owl-bot-staging/google-cloud-security_center_management-v1/snippets/security_center_management/create_security_health_analytics_custom_module.rb new file mode 100644 index 000000000000..345362f5da41 --- /dev/null +++ b/owl-bot-staging/google-cloud-security_center_management-v1/snippets/security_center_management/create_security_health_analytics_custom_module.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 securitycentermanagement_v1_generated_SecurityCenterManagement_CreateSecurityHealthAnalyticsCustomModule_sync] +require "google/cloud/security_center_management/v1" + +## +# Snippet for the create_security_health_analytics_custom_module call in the SecurityCenterManagement service +# +# This snippet has been automatically generated and should be regarded as a code +# template only. It will require modifications to work: +# - It may require correct/in-range values for request initialization. +# - It may require specifying regional endpoints when creating the service +# client as shown in https://cloud.google.com/ruby/docs/reference. +# +# This is an auto-generated example demonstrating basic usage of +# Google::Cloud::SecurityCenterManagement::V1::SecurityCenterManagement::Client#create_security_health_analytics_custom_module. +# +def create_security_health_analytics_custom_module + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::SecurityCenterManagement::V1::SecurityCenterManagement::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::SecurityCenterManagement::V1::CreateSecurityHealthAnalyticsCustomModuleRequest.new + + # Call the create_security_health_analytics_custom_module method. + result = client.create_security_health_analytics_custom_module request + + # The returned object is of type Google::Cloud::SecurityCenterManagement::V1::SecurityHealthAnalyticsCustomModule. + p result +end +# [END securitycentermanagement_v1_generated_SecurityCenterManagement_CreateSecurityHealthAnalyticsCustomModule_sync] diff --git a/owl-bot-staging/google-cloud-security_center_management-v1/snippets/security_center_management/delete_event_threat_detection_custom_module.rb b/owl-bot-staging/google-cloud-security_center_management-v1/snippets/security_center_management/delete_event_threat_detection_custom_module.rb new file mode 100644 index 000000000000..1a1782aec5de --- /dev/null +++ b/owl-bot-staging/google-cloud-security_center_management-v1/snippets/security_center_management/delete_event_threat_detection_custom_module.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 securitycentermanagement_v1_generated_SecurityCenterManagement_DeleteEventThreatDetectionCustomModule_sync] +require "google/cloud/security_center_management/v1" + +## +# Snippet for the delete_event_threat_detection_custom_module call in the SecurityCenterManagement service +# +# This snippet has been automatically generated and should be regarded as a code +# template only. It will require modifications to work: +# - It may require correct/in-range values for request initialization. +# - It may require specifying regional endpoints when creating the service +# client as shown in https://cloud.google.com/ruby/docs/reference. +# +# This is an auto-generated example demonstrating basic usage of +# Google::Cloud::SecurityCenterManagement::V1::SecurityCenterManagement::Client#delete_event_threat_detection_custom_module. +# +def delete_event_threat_detection_custom_module + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::SecurityCenterManagement::V1::SecurityCenterManagement::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::SecurityCenterManagement::V1::DeleteEventThreatDetectionCustomModuleRequest.new + + # Call the delete_event_threat_detection_custom_module method. + result = client.delete_event_threat_detection_custom_module request + + # The returned object is of type Google::Protobuf::Empty. + p result +end +# [END securitycentermanagement_v1_generated_SecurityCenterManagement_DeleteEventThreatDetectionCustomModule_sync] diff --git a/owl-bot-staging/google-cloud-security_center_management-v1/snippets/security_center_management/delete_security_health_analytics_custom_module.rb b/owl-bot-staging/google-cloud-security_center_management-v1/snippets/security_center_management/delete_security_health_analytics_custom_module.rb new file mode 100644 index 000000000000..7c265ee8e5ba --- /dev/null +++ b/owl-bot-staging/google-cloud-security_center_management-v1/snippets/security_center_management/delete_security_health_analytics_custom_module.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 securitycentermanagement_v1_generated_SecurityCenterManagement_DeleteSecurityHealthAnalyticsCustomModule_sync] +require "google/cloud/security_center_management/v1" + +## +# Snippet for the delete_security_health_analytics_custom_module call in the SecurityCenterManagement service +# +# This snippet has been automatically generated and should be regarded as a code +# template only. It will require modifications to work: +# - It may require correct/in-range values for request initialization. +# - It may require specifying regional endpoints when creating the service +# client as shown in https://cloud.google.com/ruby/docs/reference. +# +# This is an auto-generated example demonstrating basic usage of +# Google::Cloud::SecurityCenterManagement::V1::SecurityCenterManagement::Client#delete_security_health_analytics_custom_module. +# +def delete_security_health_analytics_custom_module + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::SecurityCenterManagement::V1::SecurityCenterManagement::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::SecurityCenterManagement::V1::DeleteSecurityHealthAnalyticsCustomModuleRequest.new + + # Call the delete_security_health_analytics_custom_module method. + result = client.delete_security_health_analytics_custom_module request + + # The returned object is of type Google::Protobuf::Empty. + p result +end +# [END securitycentermanagement_v1_generated_SecurityCenterManagement_DeleteSecurityHealthAnalyticsCustomModule_sync] diff --git a/owl-bot-staging/google-cloud-security_center_management-v1/snippets/security_center_management/get_effective_event_threat_detection_custom_module.rb b/owl-bot-staging/google-cloud-security_center_management-v1/snippets/security_center_management/get_effective_event_threat_detection_custom_module.rb new file mode 100644 index 000000000000..9dfd40d071fc --- /dev/null +++ b/owl-bot-staging/google-cloud-security_center_management-v1/snippets/security_center_management/get_effective_event_threat_detection_custom_module.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 securitycentermanagement_v1_generated_SecurityCenterManagement_GetEffectiveEventThreatDetectionCustomModule_sync] +require "google/cloud/security_center_management/v1" + +## +# Snippet for the get_effective_event_threat_detection_custom_module call in the SecurityCenterManagement service +# +# This snippet has been automatically generated and should be regarded as a code +# template only. It will require modifications to work: +# - It may require correct/in-range values for request initialization. +# - It may require specifying regional endpoints when creating the service +# client as shown in https://cloud.google.com/ruby/docs/reference. +# +# This is an auto-generated example demonstrating basic usage of +# Google::Cloud::SecurityCenterManagement::V1::SecurityCenterManagement::Client#get_effective_event_threat_detection_custom_module. +# +def get_effective_event_threat_detection_custom_module + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::SecurityCenterManagement::V1::SecurityCenterManagement::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::SecurityCenterManagement::V1::GetEffectiveEventThreatDetectionCustomModuleRequest.new + + # Call the get_effective_event_threat_detection_custom_module method. + result = client.get_effective_event_threat_detection_custom_module request + + # The returned object is of type Google::Cloud::SecurityCenterManagement::V1::EffectiveEventThreatDetectionCustomModule. + p result +end +# [END securitycentermanagement_v1_generated_SecurityCenterManagement_GetEffectiveEventThreatDetectionCustomModule_sync] diff --git a/owl-bot-staging/google-cloud-security_center_management-v1/snippets/security_center_management/get_effective_security_health_analytics_custom_module.rb b/owl-bot-staging/google-cloud-security_center_management-v1/snippets/security_center_management/get_effective_security_health_analytics_custom_module.rb new file mode 100644 index 000000000000..6fe48aa1f67b --- /dev/null +++ b/owl-bot-staging/google-cloud-security_center_management-v1/snippets/security_center_management/get_effective_security_health_analytics_custom_module.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 securitycentermanagement_v1_generated_SecurityCenterManagement_GetEffectiveSecurityHealthAnalyticsCustomModule_sync] +require "google/cloud/security_center_management/v1" + +## +# Snippet for the get_effective_security_health_analytics_custom_module call in the SecurityCenterManagement service +# +# This snippet has been automatically generated and should be regarded as a code +# template only. It will require modifications to work: +# - It may require correct/in-range values for request initialization. +# - It may require specifying regional endpoints when creating the service +# client as shown in https://cloud.google.com/ruby/docs/reference. +# +# This is an auto-generated example demonstrating basic usage of +# Google::Cloud::SecurityCenterManagement::V1::SecurityCenterManagement::Client#get_effective_security_health_analytics_custom_module. +# +def get_effective_security_health_analytics_custom_module + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::SecurityCenterManagement::V1::SecurityCenterManagement::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::SecurityCenterManagement::V1::GetEffectiveSecurityHealthAnalyticsCustomModuleRequest.new + + # Call the get_effective_security_health_analytics_custom_module method. + result = client.get_effective_security_health_analytics_custom_module request + + # The returned object is of type Google::Cloud::SecurityCenterManagement::V1::EffectiveSecurityHealthAnalyticsCustomModule. + p result +end +# [END securitycentermanagement_v1_generated_SecurityCenterManagement_GetEffectiveSecurityHealthAnalyticsCustomModule_sync] diff --git a/owl-bot-staging/google-cloud-security_center_management-v1/snippets/security_center_management/get_event_threat_detection_custom_module.rb b/owl-bot-staging/google-cloud-security_center_management-v1/snippets/security_center_management/get_event_threat_detection_custom_module.rb new file mode 100644 index 000000000000..e772e63bd4e2 --- /dev/null +++ b/owl-bot-staging/google-cloud-security_center_management-v1/snippets/security_center_management/get_event_threat_detection_custom_module.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 securitycentermanagement_v1_generated_SecurityCenterManagement_GetEventThreatDetectionCustomModule_sync] +require "google/cloud/security_center_management/v1" + +## +# Snippet for the get_event_threat_detection_custom_module call in the SecurityCenterManagement service +# +# This snippet has been automatically generated and should be regarded as a code +# template only. It will require modifications to work: +# - It may require correct/in-range values for request initialization. +# - It may require specifying regional endpoints when creating the service +# client as shown in https://cloud.google.com/ruby/docs/reference. +# +# This is an auto-generated example demonstrating basic usage of +# Google::Cloud::SecurityCenterManagement::V1::SecurityCenterManagement::Client#get_event_threat_detection_custom_module. +# +def get_event_threat_detection_custom_module + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::SecurityCenterManagement::V1::SecurityCenterManagement::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::SecurityCenterManagement::V1::GetEventThreatDetectionCustomModuleRequest.new + + # Call the get_event_threat_detection_custom_module method. + result = client.get_event_threat_detection_custom_module request + + # The returned object is of type Google::Cloud::SecurityCenterManagement::V1::EventThreatDetectionCustomModule. + p result +end +# [END securitycentermanagement_v1_generated_SecurityCenterManagement_GetEventThreatDetectionCustomModule_sync] diff --git a/owl-bot-staging/google-cloud-security_center_management-v1/snippets/security_center_management/get_security_center_service.rb b/owl-bot-staging/google-cloud-security_center_management-v1/snippets/security_center_management/get_security_center_service.rb new file mode 100644 index 000000000000..6034fcfea4db --- /dev/null +++ b/owl-bot-staging/google-cloud-security_center_management-v1/snippets/security_center_management/get_security_center_service.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 securitycentermanagement_v1_generated_SecurityCenterManagement_GetSecurityCenterService_sync] +require "google/cloud/security_center_management/v1" + +## +# Snippet for the get_security_center_service call in the SecurityCenterManagement service +# +# This snippet has been automatically generated and should be regarded as a code +# template only. It will require modifications to work: +# - It may require correct/in-range values for request initialization. +# - It may require specifying regional endpoints when creating the service +# client as shown in https://cloud.google.com/ruby/docs/reference. +# +# This is an auto-generated example demonstrating basic usage of +# Google::Cloud::SecurityCenterManagement::V1::SecurityCenterManagement::Client#get_security_center_service. +# +def get_security_center_service + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::SecurityCenterManagement::V1::SecurityCenterManagement::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::SecurityCenterManagement::V1::GetSecurityCenterServiceRequest.new + + # Call the get_security_center_service method. + result = client.get_security_center_service request + + # The returned object is of type Google::Cloud::SecurityCenterManagement::V1::SecurityCenterService. + p result +end +# [END securitycentermanagement_v1_generated_SecurityCenterManagement_GetSecurityCenterService_sync] diff --git a/owl-bot-staging/google-cloud-security_center_management-v1/snippets/security_center_management/get_security_health_analytics_custom_module.rb b/owl-bot-staging/google-cloud-security_center_management-v1/snippets/security_center_management/get_security_health_analytics_custom_module.rb new file mode 100644 index 000000000000..bb916a20de63 --- /dev/null +++ b/owl-bot-staging/google-cloud-security_center_management-v1/snippets/security_center_management/get_security_health_analytics_custom_module.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 securitycentermanagement_v1_generated_SecurityCenterManagement_GetSecurityHealthAnalyticsCustomModule_sync] +require "google/cloud/security_center_management/v1" + +## +# Snippet for the get_security_health_analytics_custom_module call in the SecurityCenterManagement service +# +# This snippet has been automatically generated and should be regarded as a code +# template only. It will require modifications to work: +# - It may require correct/in-range values for request initialization. +# - It may require specifying regional endpoints when creating the service +# client as shown in https://cloud.google.com/ruby/docs/reference. +# +# This is an auto-generated example demonstrating basic usage of +# Google::Cloud::SecurityCenterManagement::V1::SecurityCenterManagement::Client#get_security_health_analytics_custom_module. +# +def get_security_health_analytics_custom_module + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::SecurityCenterManagement::V1::SecurityCenterManagement::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::SecurityCenterManagement::V1::GetSecurityHealthAnalyticsCustomModuleRequest.new + + # Call the get_security_health_analytics_custom_module method. + result = client.get_security_health_analytics_custom_module request + + # The returned object is of type Google::Cloud::SecurityCenterManagement::V1::SecurityHealthAnalyticsCustomModule. + p result +end +# [END securitycentermanagement_v1_generated_SecurityCenterManagement_GetSecurityHealthAnalyticsCustomModule_sync] diff --git a/owl-bot-staging/google-cloud-security_center_management-v1/snippets/security_center_management/list_descendant_event_threat_detection_custom_modules.rb b/owl-bot-staging/google-cloud-security_center_management-v1/snippets/security_center_management/list_descendant_event_threat_detection_custom_modules.rb new file mode 100644 index 000000000000..f36375df2816 --- /dev/null +++ b/owl-bot-staging/google-cloud-security_center_management-v1/snippets/security_center_management/list_descendant_event_threat_detection_custom_modules.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 securitycentermanagement_v1_generated_SecurityCenterManagement_ListDescendantEventThreatDetectionCustomModules_sync] +require "google/cloud/security_center_management/v1" + +## +# Snippet for the list_descendant_event_threat_detection_custom_modules call in the SecurityCenterManagement service +# +# This snippet has been automatically generated and should be regarded as a code +# template only. It will require modifications to work: +# - It may require correct/in-range values for request initialization. +# - It may require specifying regional endpoints when creating the service +# client as shown in https://cloud.google.com/ruby/docs/reference. +# +# This is an auto-generated example demonstrating basic usage of +# Google::Cloud::SecurityCenterManagement::V1::SecurityCenterManagement::Client#list_descendant_event_threat_detection_custom_modules. +# +def list_descendant_event_threat_detection_custom_modules + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::SecurityCenterManagement::V1::SecurityCenterManagement::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::SecurityCenterManagement::V1::ListDescendantEventThreatDetectionCustomModulesRequest.new + + # Call the list_descendant_event_threat_detection_custom_modules method. + result = client.list_descendant_event_threat_detection_custom_modules request + + # The returned object is of type Gapic::PagedEnumerable. You can iterate + # over elements, and API calls will be issued to fetch pages as needed. + result.each do |item| + # Each element is of type ::Google::Cloud::SecurityCenterManagement::V1::EventThreatDetectionCustomModule. + p item + end +end +# [END securitycentermanagement_v1_generated_SecurityCenterManagement_ListDescendantEventThreatDetectionCustomModules_sync] diff --git a/owl-bot-staging/google-cloud-security_center_management-v1/snippets/security_center_management/list_descendant_security_health_analytics_custom_modules.rb b/owl-bot-staging/google-cloud-security_center_management-v1/snippets/security_center_management/list_descendant_security_health_analytics_custom_modules.rb new file mode 100644 index 000000000000..7cfa0c972603 --- /dev/null +++ b/owl-bot-staging/google-cloud-security_center_management-v1/snippets/security_center_management/list_descendant_security_health_analytics_custom_modules.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 securitycentermanagement_v1_generated_SecurityCenterManagement_ListDescendantSecurityHealthAnalyticsCustomModules_sync] +require "google/cloud/security_center_management/v1" + +## +# Snippet for the list_descendant_security_health_analytics_custom_modules call in the SecurityCenterManagement service +# +# This snippet has been automatically generated and should be regarded as a code +# template only. It will require modifications to work: +# - It may require correct/in-range values for request initialization. +# - It may require specifying regional endpoints when creating the service +# client as shown in https://cloud.google.com/ruby/docs/reference. +# +# This is an auto-generated example demonstrating basic usage of +# Google::Cloud::SecurityCenterManagement::V1::SecurityCenterManagement::Client#list_descendant_security_health_analytics_custom_modules. +# +def list_descendant_security_health_analytics_custom_modules + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::SecurityCenterManagement::V1::SecurityCenterManagement::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::SecurityCenterManagement::V1::ListDescendantSecurityHealthAnalyticsCustomModulesRequest.new + + # Call the list_descendant_security_health_analytics_custom_modules method. + result = client.list_descendant_security_health_analytics_custom_modules request + + # The returned object is of type Gapic::PagedEnumerable. You can iterate + # over elements, and API calls will be issued to fetch pages as needed. + result.each do |item| + # Each element is of type ::Google::Cloud::SecurityCenterManagement::V1::SecurityHealthAnalyticsCustomModule. + p item + end +end +# [END securitycentermanagement_v1_generated_SecurityCenterManagement_ListDescendantSecurityHealthAnalyticsCustomModules_sync] diff --git a/owl-bot-staging/google-cloud-security_center_management-v1/snippets/security_center_management/list_effective_event_threat_detection_custom_modules.rb b/owl-bot-staging/google-cloud-security_center_management-v1/snippets/security_center_management/list_effective_event_threat_detection_custom_modules.rb new file mode 100644 index 000000000000..4c7f69640d8a --- /dev/null +++ b/owl-bot-staging/google-cloud-security_center_management-v1/snippets/security_center_management/list_effective_event_threat_detection_custom_modules.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 securitycentermanagement_v1_generated_SecurityCenterManagement_ListEffectiveEventThreatDetectionCustomModules_sync] +require "google/cloud/security_center_management/v1" + +## +# Snippet for the list_effective_event_threat_detection_custom_modules call in the SecurityCenterManagement service +# +# This snippet has been automatically generated and should be regarded as a code +# template only. It will require modifications to work: +# - It may require correct/in-range values for request initialization. +# - It may require specifying regional endpoints when creating the service +# client as shown in https://cloud.google.com/ruby/docs/reference. +# +# This is an auto-generated example demonstrating basic usage of +# Google::Cloud::SecurityCenterManagement::V1::SecurityCenterManagement::Client#list_effective_event_threat_detection_custom_modules. +# +def list_effective_event_threat_detection_custom_modules + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::SecurityCenterManagement::V1::SecurityCenterManagement::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::SecurityCenterManagement::V1::ListEffectiveEventThreatDetectionCustomModulesRequest.new + + # Call the list_effective_event_threat_detection_custom_modules method. + result = client.list_effective_event_threat_detection_custom_modules request + + # The returned object is of type Gapic::PagedEnumerable. You can iterate + # over elements, and API calls will be issued to fetch pages as needed. + result.each do |item| + # Each element is of type ::Google::Cloud::SecurityCenterManagement::V1::EffectiveEventThreatDetectionCustomModule. + p item + end +end +# [END securitycentermanagement_v1_generated_SecurityCenterManagement_ListEffectiveEventThreatDetectionCustomModules_sync] diff --git a/owl-bot-staging/google-cloud-security_center_management-v1/snippets/security_center_management/list_effective_security_health_analytics_custom_modules.rb b/owl-bot-staging/google-cloud-security_center_management-v1/snippets/security_center_management/list_effective_security_health_analytics_custom_modules.rb new file mode 100644 index 000000000000..28d70b7bc51f --- /dev/null +++ b/owl-bot-staging/google-cloud-security_center_management-v1/snippets/security_center_management/list_effective_security_health_analytics_custom_modules.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 securitycentermanagement_v1_generated_SecurityCenterManagement_ListEffectiveSecurityHealthAnalyticsCustomModules_sync] +require "google/cloud/security_center_management/v1" + +## +# Snippet for the list_effective_security_health_analytics_custom_modules call in the SecurityCenterManagement service +# +# This snippet has been automatically generated and should be regarded as a code +# template only. It will require modifications to work: +# - It may require correct/in-range values for request initialization. +# - It may require specifying regional endpoints when creating the service +# client as shown in https://cloud.google.com/ruby/docs/reference. +# +# This is an auto-generated example demonstrating basic usage of +# Google::Cloud::SecurityCenterManagement::V1::SecurityCenterManagement::Client#list_effective_security_health_analytics_custom_modules. +# +def list_effective_security_health_analytics_custom_modules + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::SecurityCenterManagement::V1::SecurityCenterManagement::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::SecurityCenterManagement::V1::ListEffectiveSecurityHealthAnalyticsCustomModulesRequest.new + + # Call the list_effective_security_health_analytics_custom_modules method. + result = client.list_effective_security_health_analytics_custom_modules request + + # The returned object is of type Gapic::PagedEnumerable. You can iterate + # over elements, and API calls will be issued to fetch pages as needed. + result.each do |item| + # Each element is of type ::Google::Cloud::SecurityCenterManagement::V1::EffectiveSecurityHealthAnalyticsCustomModule. + p item + end +end +# [END securitycentermanagement_v1_generated_SecurityCenterManagement_ListEffectiveSecurityHealthAnalyticsCustomModules_sync] diff --git a/owl-bot-staging/google-cloud-security_center_management-v1/snippets/security_center_management/list_event_threat_detection_custom_modules.rb b/owl-bot-staging/google-cloud-security_center_management-v1/snippets/security_center_management/list_event_threat_detection_custom_modules.rb new file mode 100644 index 000000000000..fc62f7c99e51 --- /dev/null +++ b/owl-bot-staging/google-cloud-security_center_management-v1/snippets/security_center_management/list_event_threat_detection_custom_modules.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 securitycentermanagement_v1_generated_SecurityCenterManagement_ListEventThreatDetectionCustomModules_sync] +require "google/cloud/security_center_management/v1" + +## +# Snippet for the list_event_threat_detection_custom_modules call in the SecurityCenterManagement service +# +# This snippet has been automatically generated and should be regarded as a code +# template only. It will require modifications to work: +# - It may require correct/in-range values for request initialization. +# - It may require specifying regional endpoints when creating the service +# client as shown in https://cloud.google.com/ruby/docs/reference. +# +# This is an auto-generated example demonstrating basic usage of +# Google::Cloud::SecurityCenterManagement::V1::SecurityCenterManagement::Client#list_event_threat_detection_custom_modules. +# +def list_event_threat_detection_custom_modules + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::SecurityCenterManagement::V1::SecurityCenterManagement::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::SecurityCenterManagement::V1::ListEventThreatDetectionCustomModulesRequest.new + + # Call the list_event_threat_detection_custom_modules method. + result = client.list_event_threat_detection_custom_modules request + + # The returned object is of type Gapic::PagedEnumerable. You can iterate + # over elements, and API calls will be issued to fetch pages as needed. + result.each do |item| + # Each element is of type ::Google::Cloud::SecurityCenterManagement::V1::EventThreatDetectionCustomModule. + p item + end +end +# [END securitycentermanagement_v1_generated_SecurityCenterManagement_ListEventThreatDetectionCustomModules_sync] diff --git a/owl-bot-staging/google-cloud-security_center_management-v1/snippets/security_center_management/list_security_center_services.rb b/owl-bot-staging/google-cloud-security_center_management-v1/snippets/security_center_management/list_security_center_services.rb new file mode 100644 index 000000000000..3c2cc1f945c6 --- /dev/null +++ b/owl-bot-staging/google-cloud-security_center_management-v1/snippets/security_center_management/list_security_center_services.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 securitycentermanagement_v1_generated_SecurityCenterManagement_ListSecurityCenterServices_sync] +require "google/cloud/security_center_management/v1" + +## +# Snippet for the list_security_center_services call in the SecurityCenterManagement service +# +# This snippet has been automatically generated and should be regarded as a code +# template only. It will require modifications to work: +# - It may require correct/in-range values for request initialization. +# - It may require specifying regional endpoints when creating the service +# client as shown in https://cloud.google.com/ruby/docs/reference. +# +# This is an auto-generated example demonstrating basic usage of +# Google::Cloud::SecurityCenterManagement::V1::SecurityCenterManagement::Client#list_security_center_services. +# +def list_security_center_services + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::SecurityCenterManagement::V1::SecurityCenterManagement::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::SecurityCenterManagement::V1::ListSecurityCenterServicesRequest.new + + # Call the list_security_center_services method. + result = client.list_security_center_services request + + # The returned object is of type Gapic::PagedEnumerable. You can iterate + # over elements, and API calls will be issued to fetch pages as needed. + result.each do |item| + # Each element is of type ::Google::Cloud::SecurityCenterManagement::V1::SecurityCenterService. + p item + end +end +# [END securitycentermanagement_v1_generated_SecurityCenterManagement_ListSecurityCenterServices_sync] diff --git a/owl-bot-staging/google-cloud-security_center_management-v1/snippets/security_center_management/list_security_health_analytics_custom_modules.rb b/owl-bot-staging/google-cloud-security_center_management-v1/snippets/security_center_management/list_security_health_analytics_custom_modules.rb new file mode 100644 index 000000000000..38701f9cc760 --- /dev/null +++ b/owl-bot-staging/google-cloud-security_center_management-v1/snippets/security_center_management/list_security_health_analytics_custom_modules.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 securitycentermanagement_v1_generated_SecurityCenterManagement_ListSecurityHealthAnalyticsCustomModules_sync] +require "google/cloud/security_center_management/v1" + +## +# Snippet for the list_security_health_analytics_custom_modules call in the SecurityCenterManagement service +# +# This snippet has been automatically generated and should be regarded as a code +# template only. It will require modifications to work: +# - It may require correct/in-range values for request initialization. +# - It may require specifying regional endpoints when creating the service +# client as shown in https://cloud.google.com/ruby/docs/reference. +# +# This is an auto-generated example demonstrating basic usage of +# Google::Cloud::SecurityCenterManagement::V1::SecurityCenterManagement::Client#list_security_health_analytics_custom_modules. +# +def list_security_health_analytics_custom_modules + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::SecurityCenterManagement::V1::SecurityCenterManagement::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::SecurityCenterManagement::V1::ListSecurityHealthAnalyticsCustomModulesRequest.new + + # Call the list_security_health_analytics_custom_modules method. + result = client.list_security_health_analytics_custom_modules request + + # The returned object is of type Gapic::PagedEnumerable. You can iterate + # over elements, and API calls will be issued to fetch pages as needed. + result.each do |item| + # Each element is of type ::Google::Cloud::SecurityCenterManagement::V1::SecurityHealthAnalyticsCustomModule. + p item + end +end +# [END securitycentermanagement_v1_generated_SecurityCenterManagement_ListSecurityHealthAnalyticsCustomModules_sync] diff --git a/owl-bot-staging/google-cloud-security_center_management-v1/snippets/security_center_management/simulate_security_health_analytics_custom_module.rb b/owl-bot-staging/google-cloud-security_center_management-v1/snippets/security_center_management/simulate_security_health_analytics_custom_module.rb new file mode 100644 index 000000000000..a87f00cd27b9 --- /dev/null +++ b/owl-bot-staging/google-cloud-security_center_management-v1/snippets/security_center_management/simulate_security_health_analytics_custom_module.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 securitycentermanagement_v1_generated_SecurityCenterManagement_SimulateSecurityHealthAnalyticsCustomModule_sync] +require "google/cloud/security_center_management/v1" + +## +# Snippet for the simulate_security_health_analytics_custom_module call in the SecurityCenterManagement service +# +# This snippet has been automatically generated and should be regarded as a code +# template only. It will require modifications to work: +# - It may require correct/in-range values for request initialization. +# - It may require specifying regional endpoints when creating the service +# client as shown in https://cloud.google.com/ruby/docs/reference. +# +# This is an auto-generated example demonstrating basic usage of +# Google::Cloud::SecurityCenterManagement::V1::SecurityCenterManagement::Client#simulate_security_health_analytics_custom_module. +# +def simulate_security_health_analytics_custom_module + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::SecurityCenterManagement::V1::SecurityCenterManagement::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::SecurityCenterManagement::V1::SimulateSecurityHealthAnalyticsCustomModuleRequest.new + + # Call the simulate_security_health_analytics_custom_module method. + result = client.simulate_security_health_analytics_custom_module request + + # The returned object is of type Google::Cloud::SecurityCenterManagement::V1::SimulateSecurityHealthAnalyticsCustomModuleResponse. + p result +end +# [END securitycentermanagement_v1_generated_SecurityCenterManagement_SimulateSecurityHealthAnalyticsCustomModule_sync] diff --git a/owl-bot-staging/google-cloud-security_center_management-v1/snippets/security_center_management/update_event_threat_detection_custom_module.rb b/owl-bot-staging/google-cloud-security_center_management-v1/snippets/security_center_management/update_event_threat_detection_custom_module.rb new file mode 100644 index 000000000000..3551bb287965 --- /dev/null +++ b/owl-bot-staging/google-cloud-security_center_management-v1/snippets/security_center_management/update_event_threat_detection_custom_module.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 securitycentermanagement_v1_generated_SecurityCenterManagement_UpdateEventThreatDetectionCustomModule_sync] +require "google/cloud/security_center_management/v1" + +## +# Snippet for the update_event_threat_detection_custom_module call in the SecurityCenterManagement service +# +# This snippet has been automatically generated and should be regarded as a code +# template only. It will require modifications to work: +# - It may require correct/in-range values for request initialization. +# - It may require specifying regional endpoints when creating the service +# client as shown in https://cloud.google.com/ruby/docs/reference. +# +# This is an auto-generated example demonstrating basic usage of +# Google::Cloud::SecurityCenterManagement::V1::SecurityCenterManagement::Client#update_event_threat_detection_custom_module. +# +def update_event_threat_detection_custom_module + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::SecurityCenterManagement::V1::SecurityCenterManagement::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::SecurityCenterManagement::V1::UpdateEventThreatDetectionCustomModuleRequest.new + + # Call the update_event_threat_detection_custom_module method. + result = client.update_event_threat_detection_custom_module request + + # The returned object is of type Google::Cloud::SecurityCenterManagement::V1::EventThreatDetectionCustomModule. + p result +end +# [END securitycentermanagement_v1_generated_SecurityCenterManagement_UpdateEventThreatDetectionCustomModule_sync] diff --git a/owl-bot-staging/google-cloud-security_center_management-v1/snippets/security_center_management/update_security_center_service.rb b/owl-bot-staging/google-cloud-security_center_management-v1/snippets/security_center_management/update_security_center_service.rb new file mode 100644 index 000000000000..4abb4dcae4a3 --- /dev/null +++ b/owl-bot-staging/google-cloud-security_center_management-v1/snippets/security_center_management/update_security_center_service.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 securitycentermanagement_v1_generated_SecurityCenterManagement_UpdateSecurityCenterService_sync] +require "google/cloud/security_center_management/v1" + +## +# Snippet for the update_security_center_service call in the SecurityCenterManagement service +# +# This snippet has been automatically generated and should be regarded as a code +# template only. It will require modifications to work: +# - It may require correct/in-range values for request initialization. +# - It may require specifying regional endpoints when creating the service +# client as shown in https://cloud.google.com/ruby/docs/reference. +# +# This is an auto-generated example demonstrating basic usage of +# Google::Cloud::SecurityCenterManagement::V1::SecurityCenterManagement::Client#update_security_center_service. +# +def update_security_center_service + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::SecurityCenterManagement::V1::SecurityCenterManagement::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::SecurityCenterManagement::V1::UpdateSecurityCenterServiceRequest.new + + # Call the update_security_center_service method. + result = client.update_security_center_service request + + # The returned object is of type Google::Cloud::SecurityCenterManagement::V1::SecurityCenterService. + p result +end +# [END securitycentermanagement_v1_generated_SecurityCenterManagement_UpdateSecurityCenterService_sync] diff --git a/owl-bot-staging/google-cloud-security_center_management-v1/snippets/security_center_management/update_security_health_analytics_custom_module.rb b/owl-bot-staging/google-cloud-security_center_management-v1/snippets/security_center_management/update_security_health_analytics_custom_module.rb new file mode 100644 index 000000000000..7aef0a715144 --- /dev/null +++ b/owl-bot-staging/google-cloud-security_center_management-v1/snippets/security_center_management/update_security_health_analytics_custom_module.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 securitycentermanagement_v1_generated_SecurityCenterManagement_UpdateSecurityHealthAnalyticsCustomModule_sync] +require "google/cloud/security_center_management/v1" + +## +# Snippet for the update_security_health_analytics_custom_module call in the SecurityCenterManagement service +# +# This snippet has been automatically generated and should be regarded as a code +# template only. It will require modifications to work: +# - It may require correct/in-range values for request initialization. +# - It may require specifying regional endpoints when creating the service +# client as shown in https://cloud.google.com/ruby/docs/reference. +# +# This is an auto-generated example demonstrating basic usage of +# Google::Cloud::SecurityCenterManagement::V1::SecurityCenterManagement::Client#update_security_health_analytics_custom_module. +# +def update_security_health_analytics_custom_module + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::SecurityCenterManagement::V1::SecurityCenterManagement::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::SecurityCenterManagement::V1::UpdateSecurityHealthAnalyticsCustomModuleRequest.new + + # Call the update_security_health_analytics_custom_module method. + result = client.update_security_health_analytics_custom_module request + + # The returned object is of type Google::Cloud::SecurityCenterManagement::V1::SecurityHealthAnalyticsCustomModule. + p result +end +# [END securitycentermanagement_v1_generated_SecurityCenterManagement_UpdateSecurityHealthAnalyticsCustomModule_sync] diff --git a/owl-bot-staging/google-cloud-security_center_management-v1/snippets/security_center_management/validate_event_threat_detection_custom_module.rb b/owl-bot-staging/google-cloud-security_center_management-v1/snippets/security_center_management/validate_event_threat_detection_custom_module.rb new file mode 100644 index 000000000000..4fd089b6c7d4 --- /dev/null +++ b/owl-bot-staging/google-cloud-security_center_management-v1/snippets/security_center_management/validate_event_threat_detection_custom_module.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 securitycentermanagement_v1_generated_SecurityCenterManagement_ValidateEventThreatDetectionCustomModule_sync] +require "google/cloud/security_center_management/v1" + +## +# Snippet for the validate_event_threat_detection_custom_module call in the SecurityCenterManagement service +# +# This snippet has been automatically generated and should be regarded as a code +# template only. It will require modifications to work: +# - It may require correct/in-range values for request initialization. +# - It may require specifying regional endpoints when creating the service +# client as shown in https://cloud.google.com/ruby/docs/reference. +# +# This is an auto-generated example demonstrating basic usage of +# Google::Cloud::SecurityCenterManagement::V1::SecurityCenterManagement::Client#validate_event_threat_detection_custom_module. +# +def validate_event_threat_detection_custom_module + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::SecurityCenterManagement::V1::SecurityCenterManagement::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::SecurityCenterManagement::V1::ValidateEventThreatDetectionCustomModuleRequest.new + + # Call the validate_event_threat_detection_custom_module method. + result = client.validate_event_threat_detection_custom_module request + + # The returned object is of type Google::Cloud::SecurityCenterManagement::V1::ValidateEventThreatDetectionCustomModuleResponse. + p result +end +# [END securitycentermanagement_v1_generated_SecurityCenterManagement_ValidateEventThreatDetectionCustomModule_sync] diff --git a/owl-bot-staging/google-cloud-security_center_management-v1/snippets/snippet_metadata_google.cloud.securitycentermanagement.v1.json b/owl-bot-staging/google-cloud-security_center_management-v1/snippets/snippet_metadata_google.cloud.securitycentermanagement.v1.json new file mode 100644 index 000000000000..1f027b6d1787 --- /dev/null +++ b/owl-bot-staging/google-cloud-security_center_management-v1/snippets/snippet_metadata_google.cloud.securitycentermanagement.v1.json @@ -0,0 +1,855 @@ +{ + "client_library": { + "name": "google-cloud-security_center_management-v1", + "version": "", + "language": "RUBY", + "apis": [ + { + "id": "google.cloud.securitycentermanagement.v1", + "version": "v1" + } + ] + }, + "snippets": [ + { + "region_tag": "securitycentermanagement_v1_generated_SecurityCenterManagement_ListEffectiveSecurityHealthAnalyticsCustomModules_sync", + "title": "Snippet for the list_effective_security_health_analytics_custom_modules call in the SecurityCenterManagement service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::SecurityCenterManagement::V1::SecurityCenterManagement::Client#list_effective_security_health_analytics_custom_modules.", + "file": "security_center_management/list_effective_security_health_analytics_custom_modules.rb", + "language": "RUBY", + "client_method": { + "short_name": "list_effective_security_health_analytics_custom_modules", + "full_name": "::Google::Cloud::SecurityCenterManagement::V1::SecurityCenterManagement::Client#list_effective_security_health_analytics_custom_modules", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::SecurityCenterManagement::V1::ListEffectiveSecurityHealthAnalyticsCustomModulesRequest", + "name": "request" + } + ], + "result_type": "::Google::Cloud::SecurityCenterManagement::V1::ListEffectiveSecurityHealthAnalyticsCustomModulesResponse", + "client": { + "short_name": "SecurityCenterManagement::Client", + "full_name": "::Google::Cloud::SecurityCenterManagement::V1::SecurityCenterManagement::Client" + }, + "method": { + "short_name": "ListEffectiveSecurityHealthAnalyticsCustomModules", + "full_name": "google.cloud.securitycentermanagement.v1.SecurityCenterManagement.ListEffectiveSecurityHealthAnalyticsCustomModules", + "service": { + "short_name": "SecurityCenterManagement", + "full_name": "google.cloud.securitycentermanagement.v1.SecurityCenterManagement" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 50, + "type": "FULL" + } + ] + }, + { + "region_tag": "securitycentermanagement_v1_generated_SecurityCenterManagement_GetEffectiveSecurityHealthAnalyticsCustomModule_sync", + "title": "Snippet for the get_effective_security_health_analytics_custom_module call in the SecurityCenterManagement service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::SecurityCenterManagement::V1::SecurityCenterManagement::Client#get_effective_security_health_analytics_custom_module.", + "file": "security_center_management/get_effective_security_health_analytics_custom_module.rb", + "language": "RUBY", + "client_method": { + "short_name": "get_effective_security_health_analytics_custom_module", + "full_name": "::Google::Cloud::SecurityCenterManagement::V1::SecurityCenterManagement::Client#get_effective_security_health_analytics_custom_module", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::SecurityCenterManagement::V1::GetEffectiveSecurityHealthAnalyticsCustomModuleRequest", + "name": "request" + } + ], + "result_type": "::Google::Cloud::SecurityCenterManagement::V1::EffectiveSecurityHealthAnalyticsCustomModule", + "client": { + "short_name": "SecurityCenterManagement::Client", + "full_name": "::Google::Cloud::SecurityCenterManagement::V1::SecurityCenterManagement::Client" + }, + "method": { + "short_name": "GetEffectiveSecurityHealthAnalyticsCustomModule", + "full_name": "google.cloud.securitycentermanagement.v1.SecurityCenterManagement.GetEffectiveSecurityHealthAnalyticsCustomModule", + "service": { + "short_name": "SecurityCenterManagement", + "full_name": "google.cloud.securitycentermanagement.v1.SecurityCenterManagement" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 46, + "type": "FULL" + } + ] + }, + { + "region_tag": "securitycentermanagement_v1_generated_SecurityCenterManagement_ListSecurityHealthAnalyticsCustomModules_sync", + "title": "Snippet for the list_security_health_analytics_custom_modules call in the SecurityCenterManagement service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::SecurityCenterManagement::V1::SecurityCenterManagement::Client#list_security_health_analytics_custom_modules.", + "file": "security_center_management/list_security_health_analytics_custom_modules.rb", + "language": "RUBY", + "client_method": { + "short_name": "list_security_health_analytics_custom_modules", + "full_name": "::Google::Cloud::SecurityCenterManagement::V1::SecurityCenterManagement::Client#list_security_health_analytics_custom_modules", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::SecurityCenterManagement::V1::ListSecurityHealthAnalyticsCustomModulesRequest", + "name": "request" + } + ], + "result_type": "::Google::Cloud::SecurityCenterManagement::V1::ListSecurityHealthAnalyticsCustomModulesResponse", + "client": { + "short_name": "SecurityCenterManagement::Client", + "full_name": "::Google::Cloud::SecurityCenterManagement::V1::SecurityCenterManagement::Client" + }, + "method": { + "short_name": "ListSecurityHealthAnalyticsCustomModules", + "full_name": "google.cloud.securitycentermanagement.v1.SecurityCenterManagement.ListSecurityHealthAnalyticsCustomModules", + "service": { + "short_name": "SecurityCenterManagement", + "full_name": "google.cloud.securitycentermanagement.v1.SecurityCenterManagement" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 50, + "type": "FULL" + } + ] + }, + { + "region_tag": "securitycentermanagement_v1_generated_SecurityCenterManagement_ListDescendantSecurityHealthAnalyticsCustomModules_sync", + "title": "Snippet for the list_descendant_security_health_analytics_custom_modules call in the SecurityCenterManagement service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::SecurityCenterManagement::V1::SecurityCenterManagement::Client#list_descendant_security_health_analytics_custom_modules.", + "file": "security_center_management/list_descendant_security_health_analytics_custom_modules.rb", + "language": "RUBY", + "client_method": { + "short_name": "list_descendant_security_health_analytics_custom_modules", + "full_name": "::Google::Cloud::SecurityCenterManagement::V1::SecurityCenterManagement::Client#list_descendant_security_health_analytics_custom_modules", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::SecurityCenterManagement::V1::ListDescendantSecurityHealthAnalyticsCustomModulesRequest", + "name": "request" + } + ], + "result_type": "::Google::Cloud::SecurityCenterManagement::V1::ListDescendantSecurityHealthAnalyticsCustomModulesResponse", + "client": { + "short_name": "SecurityCenterManagement::Client", + "full_name": "::Google::Cloud::SecurityCenterManagement::V1::SecurityCenterManagement::Client" + }, + "method": { + "short_name": "ListDescendantSecurityHealthAnalyticsCustomModules", + "full_name": "google.cloud.securitycentermanagement.v1.SecurityCenterManagement.ListDescendantSecurityHealthAnalyticsCustomModules", + "service": { + "short_name": "SecurityCenterManagement", + "full_name": "google.cloud.securitycentermanagement.v1.SecurityCenterManagement" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 50, + "type": "FULL" + } + ] + }, + { + "region_tag": "securitycentermanagement_v1_generated_SecurityCenterManagement_GetSecurityHealthAnalyticsCustomModule_sync", + "title": "Snippet for the get_security_health_analytics_custom_module call in the SecurityCenterManagement service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::SecurityCenterManagement::V1::SecurityCenterManagement::Client#get_security_health_analytics_custom_module.", + "file": "security_center_management/get_security_health_analytics_custom_module.rb", + "language": "RUBY", + "client_method": { + "short_name": "get_security_health_analytics_custom_module", + "full_name": "::Google::Cloud::SecurityCenterManagement::V1::SecurityCenterManagement::Client#get_security_health_analytics_custom_module", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::SecurityCenterManagement::V1::GetSecurityHealthAnalyticsCustomModuleRequest", + "name": "request" + } + ], + "result_type": "::Google::Cloud::SecurityCenterManagement::V1::SecurityHealthAnalyticsCustomModule", + "client": { + "short_name": "SecurityCenterManagement::Client", + "full_name": "::Google::Cloud::SecurityCenterManagement::V1::SecurityCenterManagement::Client" + }, + "method": { + "short_name": "GetSecurityHealthAnalyticsCustomModule", + "full_name": "google.cloud.securitycentermanagement.v1.SecurityCenterManagement.GetSecurityHealthAnalyticsCustomModule", + "service": { + "short_name": "SecurityCenterManagement", + "full_name": "google.cloud.securitycentermanagement.v1.SecurityCenterManagement" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 46, + "type": "FULL" + } + ] + }, + { + "region_tag": "securitycentermanagement_v1_generated_SecurityCenterManagement_CreateSecurityHealthAnalyticsCustomModule_sync", + "title": "Snippet for the create_security_health_analytics_custom_module call in the SecurityCenterManagement service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::SecurityCenterManagement::V1::SecurityCenterManagement::Client#create_security_health_analytics_custom_module.", + "file": "security_center_management/create_security_health_analytics_custom_module.rb", + "language": "RUBY", + "client_method": { + "short_name": "create_security_health_analytics_custom_module", + "full_name": "::Google::Cloud::SecurityCenterManagement::V1::SecurityCenterManagement::Client#create_security_health_analytics_custom_module", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::SecurityCenterManagement::V1::CreateSecurityHealthAnalyticsCustomModuleRequest", + "name": "request" + } + ], + "result_type": "::Google::Cloud::SecurityCenterManagement::V1::SecurityHealthAnalyticsCustomModule", + "client": { + "short_name": "SecurityCenterManagement::Client", + "full_name": "::Google::Cloud::SecurityCenterManagement::V1::SecurityCenterManagement::Client" + }, + "method": { + "short_name": "CreateSecurityHealthAnalyticsCustomModule", + "full_name": "google.cloud.securitycentermanagement.v1.SecurityCenterManagement.CreateSecurityHealthAnalyticsCustomModule", + "service": { + "short_name": "SecurityCenterManagement", + "full_name": "google.cloud.securitycentermanagement.v1.SecurityCenterManagement" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 46, + "type": "FULL" + } + ] + }, + { + "region_tag": "securitycentermanagement_v1_generated_SecurityCenterManagement_UpdateSecurityHealthAnalyticsCustomModule_sync", + "title": "Snippet for the update_security_health_analytics_custom_module call in the SecurityCenterManagement service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::SecurityCenterManagement::V1::SecurityCenterManagement::Client#update_security_health_analytics_custom_module.", + "file": "security_center_management/update_security_health_analytics_custom_module.rb", + "language": "RUBY", + "client_method": { + "short_name": "update_security_health_analytics_custom_module", + "full_name": "::Google::Cloud::SecurityCenterManagement::V1::SecurityCenterManagement::Client#update_security_health_analytics_custom_module", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::SecurityCenterManagement::V1::UpdateSecurityHealthAnalyticsCustomModuleRequest", + "name": "request" + } + ], + "result_type": "::Google::Cloud::SecurityCenterManagement::V1::SecurityHealthAnalyticsCustomModule", + "client": { + "short_name": "SecurityCenterManagement::Client", + "full_name": "::Google::Cloud::SecurityCenterManagement::V1::SecurityCenterManagement::Client" + }, + "method": { + "short_name": "UpdateSecurityHealthAnalyticsCustomModule", + "full_name": "google.cloud.securitycentermanagement.v1.SecurityCenterManagement.UpdateSecurityHealthAnalyticsCustomModule", + "service": { + "short_name": "SecurityCenterManagement", + "full_name": "google.cloud.securitycentermanagement.v1.SecurityCenterManagement" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 46, + "type": "FULL" + } + ] + }, + { + "region_tag": "securitycentermanagement_v1_generated_SecurityCenterManagement_DeleteSecurityHealthAnalyticsCustomModule_sync", + "title": "Snippet for the delete_security_health_analytics_custom_module call in the SecurityCenterManagement service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::SecurityCenterManagement::V1::SecurityCenterManagement::Client#delete_security_health_analytics_custom_module.", + "file": "security_center_management/delete_security_health_analytics_custom_module.rb", + "language": "RUBY", + "client_method": { + "short_name": "delete_security_health_analytics_custom_module", + "full_name": "::Google::Cloud::SecurityCenterManagement::V1::SecurityCenterManagement::Client#delete_security_health_analytics_custom_module", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::SecurityCenterManagement::V1::DeleteSecurityHealthAnalyticsCustomModuleRequest", + "name": "request" + } + ], + "result_type": "::Google::Protobuf::Empty", + "client": { + "short_name": "SecurityCenterManagement::Client", + "full_name": "::Google::Cloud::SecurityCenterManagement::V1::SecurityCenterManagement::Client" + }, + "method": { + "short_name": "DeleteSecurityHealthAnalyticsCustomModule", + "full_name": "google.cloud.securitycentermanagement.v1.SecurityCenterManagement.DeleteSecurityHealthAnalyticsCustomModule", + "service": { + "short_name": "SecurityCenterManagement", + "full_name": "google.cloud.securitycentermanagement.v1.SecurityCenterManagement" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 46, + "type": "FULL" + } + ] + }, + { + "region_tag": "securitycentermanagement_v1_generated_SecurityCenterManagement_SimulateSecurityHealthAnalyticsCustomModule_sync", + "title": "Snippet for the simulate_security_health_analytics_custom_module call in the SecurityCenterManagement service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::SecurityCenterManagement::V1::SecurityCenterManagement::Client#simulate_security_health_analytics_custom_module.", + "file": "security_center_management/simulate_security_health_analytics_custom_module.rb", + "language": "RUBY", + "client_method": { + "short_name": "simulate_security_health_analytics_custom_module", + "full_name": "::Google::Cloud::SecurityCenterManagement::V1::SecurityCenterManagement::Client#simulate_security_health_analytics_custom_module", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::SecurityCenterManagement::V1::SimulateSecurityHealthAnalyticsCustomModuleRequest", + "name": "request" + } + ], + "result_type": "::Google::Cloud::SecurityCenterManagement::V1::SimulateSecurityHealthAnalyticsCustomModuleResponse", + "client": { + "short_name": "SecurityCenterManagement::Client", + "full_name": "::Google::Cloud::SecurityCenterManagement::V1::SecurityCenterManagement::Client" + }, + "method": { + "short_name": "SimulateSecurityHealthAnalyticsCustomModule", + "full_name": "google.cloud.securitycentermanagement.v1.SecurityCenterManagement.SimulateSecurityHealthAnalyticsCustomModule", + "service": { + "short_name": "SecurityCenterManagement", + "full_name": "google.cloud.securitycentermanagement.v1.SecurityCenterManagement" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 46, + "type": "FULL" + } + ] + }, + { + "region_tag": "securitycentermanagement_v1_generated_SecurityCenterManagement_ListEffectiveEventThreatDetectionCustomModules_sync", + "title": "Snippet for the list_effective_event_threat_detection_custom_modules call in the SecurityCenterManagement service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::SecurityCenterManagement::V1::SecurityCenterManagement::Client#list_effective_event_threat_detection_custom_modules.", + "file": "security_center_management/list_effective_event_threat_detection_custom_modules.rb", + "language": "RUBY", + "client_method": { + "short_name": "list_effective_event_threat_detection_custom_modules", + "full_name": "::Google::Cloud::SecurityCenterManagement::V1::SecurityCenterManagement::Client#list_effective_event_threat_detection_custom_modules", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::SecurityCenterManagement::V1::ListEffectiveEventThreatDetectionCustomModulesRequest", + "name": "request" + } + ], + "result_type": "::Google::Cloud::SecurityCenterManagement::V1::ListEffectiveEventThreatDetectionCustomModulesResponse", + "client": { + "short_name": "SecurityCenterManagement::Client", + "full_name": "::Google::Cloud::SecurityCenterManagement::V1::SecurityCenterManagement::Client" + }, + "method": { + "short_name": "ListEffectiveEventThreatDetectionCustomModules", + "full_name": "google.cloud.securitycentermanagement.v1.SecurityCenterManagement.ListEffectiveEventThreatDetectionCustomModules", + "service": { + "short_name": "SecurityCenterManagement", + "full_name": "google.cloud.securitycentermanagement.v1.SecurityCenterManagement" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 50, + "type": "FULL" + } + ] + }, + { + "region_tag": "securitycentermanagement_v1_generated_SecurityCenterManagement_GetEffectiveEventThreatDetectionCustomModule_sync", + "title": "Snippet for the get_effective_event_threat_detection_custom_module call in the SecurityCenterManagement service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::SecurityCenterManagement::V1::SecurityCenterManagement::Client#get_effective_event_threat_detection_custom_module.", + "file": "security_center_management/get_effective_event_threat_detection_custom_module.rb", + "language": "RUBY", + "client_method": { + "short_name": "get_effective_event_threat_detection_custom_module", + "full_name": "::Google::Cloud::SecurityCenterManagement::V1::SecurityCenterManagement::Client#get_effective_event_threat_detection_custom_module", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::SecurityCenterManagement::V1::GetEffectiveEventThreatDetectionCustomModuleRequest", + "name": "request" + } + ], + "result_type": "::Google::Cloud::SecurityCenterManagement::V1::EffectiveEventThreatDetectionCustomModule", + "client": { + "short_name": "SecurityCenterManagement::Client", + "full_name": "::Google::Cloud::SecurityCenterManagement::V1::SecurityCenterManagement::Client" + }, + "method": { + "short_name": "GetEffectiveEventThreatDetectionCustomModule", + "full_name": "google.cloud.securitycentermanagement.v1.SecurityCenterManagement.GetEffectiveEventThreatDetectionCustomModule", + "service": { + "short_name": "SecurityCenterManagement", + "full_name": "google.cloud.securitycentermanagement.v1.SecurityCenterManagement" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 46, + "type": "FULL" + } + ] + }, + { + "region_tag": "securitycentermanagement_v1_generated_SecurityCenterManagement_ListEventThreatDetectionCustomModules_sync", + "title": "Snippet for the list_event_threat_detection_custom_modules call in the SecurityCenterManagement service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::SecurityCenterManagement::V1::SecurityCenterManagement::Client#list_event_threat_detection_custom_modules.", + "file": "security_center_management/list_event_threat_detection_custom_modules.rb", + "language": "RUBY", + "client_method": { + "short_name": "list_event_threat_detection_custom_modules", + "full_name": "::Google::Cloud::SecurityCenterManagement::V1::SecurityCenterManagement::Client#list_event_threat_detection_custom_modules", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::SecurityCenterManagement::V1::ListEventThreatDetectionCustomModulesRequest", + "name": "request" + } + ], + "result_type": "::Google::Cloud::SecurityCenterManagement::V1::ListEventThreatDetectionCustomModulesResponse", + "client": { + "short_name": "SecurityCenterManagement::Client", + "full_name": "::Google::Cloud::SecurityCenterManagement::V1::SecurityCenterManagement::Client" + }, + "method": { + "short_name": "ListEventThreatDetectionCustomModules", + "full_name": "google.cloud.securitycentermanagement.v1.SecurityCenterManagement.ListEventThreatDetectionCustomModules", + "service": { + "short_name": "SecurityCenterManagement", + "full_name": "google.cloud.securitycentermanagement.v1.SecurityCenterManagement" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 50, + "type": "FULL" + } + ] + }, + { + "region_tag": "securitycentermanagement_v1_generated_SecurityCenterManagement_ListDescendantEventThreatDetectionCustomModules_sync", + "title": "Snippet for the list_descendant_event_threat_detection_custom_modules call in the SecurityCenterManagement service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::SecurityCenterManagement::V1::SecurityCenterManagement::Client#list_descendant_event_threat_detection_custom_modules.", + "file": "security_center_management/list_descendant_event_threat_detection_custom_modules.rb", + "language": "RUBY", + "client_method": { + "short_name": "list_descendant_event_threat_detection_custom_modules", + "full_name": "::Google::Cloud::SecurityCenterManagement::V1::SecurityCenterManagement::Client#list_descendant_event_threat_detection_custom_modules", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::SecurityCenterManagement::V1::ListDescendantEventThreatDetectionCustomModulesRequest", + "name": "request" + } + ], + "result_type": "::Google::Cloud::SecurityCenterManagement::V1::ListDescendantEventThreatDetectionCustomModulesResponse", + "client": { + "short_name": "SecurityCenterManagement::Client", + "full_name": "::Google::Cloud::SecurityCenterManagement::V1::SecurityCenterManagement::Client" + }, + "method": { + "short_name": "ListDescendantEventThreatDetectionCustomModules", + "full_name": "google.cloud.securitycentermanagement.v1.SecurityCenterManagement.ListDescendantEventThreatDetectionCustomModules", + "service": { + "short_name": "SecurityCenterManagement", + "full_name": "google.cloud.securitycentermanagement.v1.SecurityCenterManagement" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 50, + "type": "FULL" + } + ] + }, + { + "region_tag": "securitycentermanagement_v1_generated_SecurityCenterManagement_GetEventThreatDetectionCustomModule_sync", + "title": "Snippet for the get_event_threat_detection_custom_module call in the SecurityCenterManagement service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::SecurityCenterManagement::V1::SecurityCenterManagement::Client#get_event_threat_detection_custom_module.", + "file": "security_center_management/get_event_threat_detection_custom_module.rb", + "language": "RUBY", + "client_method": { + "short_name": "get_event_threat_detection_custom_module", + "full_name": "::Google::Cloud::SecurityCenterManagement::V1::SecurityCenterManagement::Client#get_event_threat_detection_custom_module", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::SecurityCenterManagement::V1::GetEventThreatDetectionCustomModuleRequest", + "name": "request" + } + ], + "result_type": "::Google::Cloud::SecurityCenterManagement::V1::EventThreatDetectionCustomModule", + "client": { + "short_name": "SecurityCenterManagement::Client", + "full_name": "::Google::Cloud::SecurityCenterManagement::V1::SecurityCenterManagement::Client" + }, + "method": { + "short_name": "GetEventThreatDetectionCustomModule", + "full_name": "google.cloud.securitycentermanagement.v1.SecurityCenterManagement.GetEventThreatDetectionCustomModule", + "service": { + "short_name": "SecurityCenterManagement", + "full_name": "google.cloud.securitycentermanagement.v1.SecurityCenterManagement" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 46, + "type": "FULL" + } + ] + }, + { + "region_tag": "securitycentermanagement_v1_generated_SecurityCenterManagement_CreateEventThreatDetectionCustomModule_sync", + "title": "Snippet for the create_event_threat_detection_custom_module call in the SecurityCenterManagement service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::SecurityCenterManagement::V1::SecurityCenterManagement::Client#create_event_threat_detection_custom_module.", + "file": "security_center_management/create_event_threat_detection_custom_module.rb", + "language": "RUBY", + "client_method": { + "short_name": "create_event_threat_detection_custom_module", + "full_name": "::Google::Cloud::SecurityCenterManagement::V1::SecurityCenterManagement::Client#create_event_threat_detection_custom_module", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::SecurityCenterManagement::V1::CreateEventThreatDetectionCustomModuleRequest", + "name": "request" + } + ], + "result_type": "::Google::Cloud::SecurityCenterManagement::V1::EventThreatDetectionCustomModule", + "client": { + "short_name": "SecurityCenterManagement::Client", + "full_name": "::Google::Cloud::SecurityCenterManagement::V1::SecurityCenterManagement::Client" + }, + "method": { + "short_name": "CreateEventThreatDetectionCustomModule", + "full_name": "google.cloud.securitycentermanagement.v1.SecurityCenterManagement.CreateEventThreatDetectionCustomModule", + "service": { + "short_name": "SecurityCenterManagement", + "full_name": "google.cloud.securitycentermanagement.v1.SecurityCenterManagement" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 46, + "type": "FULL" + } + ] + }, + { + "region_tag": "securitycentermanagement_v1_generated_SecurityCenterManagement_UpdateEventThreatDetectionCustomModule_sync", + "title": "Snippet for the update_event_threat_detection_custom_module call in the SecurityCenterManagement service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::SecurityCenterManagement::V1::SecurityCenterManagement::Client#update_event_threat_detection_custom_module.", + "file": "security_center_management/update_event_threat_detection_custom_module.rb", + "language": "RUBY", + "client_method": { + "short_name": "update_event_threat_detection_custom_module", + "full_name": "::Google::Cloud::SecurityCenterManagement::V1::SecurityCenterManagement::Client#update_event_threat_detection_custom_module", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::SecurityCenterManagement::V1::UpdateEventThreatDetectionCustomModuleRequest", + "name": "request" + } + ], + "result_type": "::Google::Cloud::SecurityCenterManagement::V1::EventThreatDetectionCustomModule", + "client": { + "short_name": "SecurityCenterManagement::Client", + "full_name": "::Google::Cloud::SecurityCenterManagement::V1::SecurityCenterManagement::Client" + }, + "method": { + "short_name": "UpdateEventThreatDetectionCustomModule", + "full_name": "google.cloud.securitycentermanagement.v1.SecurityCenterManagement.UpdateEventThreatDetectionCustomModule", + "service": { + "short_name": "SecurityCenterManagement", + "full_name": "google.cloud.securitycentermanagement.v1.SecurityCenterManagement" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 46, + "type": "FULL" + } + ] + }, + { + "region_tag": "securitycentermanagement_v1_generated_SecurityCenterManagement_DeleteEventThreatDetectionCustomModule_sync", + "title": "Snippet for the delete_event_threat_detection_custom_module call in the SecurityCenterManagement service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::SecurityCenterManagement::V1::SecurityCenterManagement::Client#delete_event_threat_detection_custom_module.", + "file": "security_center_management/delete_event_threat_detection_custom_module.rb", + "language": "RUBY", + "client_method": { + "short_name": "delete_event_threat_detection_custom_module", + "full_name": "::Google::Cloud::SecurityCenterManagement::V1::SecurityCenterManagement::Client#delete_event_threat_detection_custom_module", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::SecurityCenterManagement::V1::DeleteEventThreatDetectionCustomModuleRequest", + "name": "request" + } + ], + "result_type": "::Google::Protobuf::Empty", + "client": { + "short_name": "SecurityCenterManagement::Client", + "full_name": "::Google::Cloud::SecurityCenterManagement::V1::SecurityCenterManagement::Client" + }, + "method": { + "short_name": "DeleteEventThreatDetectionCustomModule", + "full_name": "google.cloud.securitycentermanagement.v1.SecurityCenterManagement.DeleteEventThreatDetectionCustomModule", + "service": { + "short_name": "SecurityCenterManagement", + "full_name": "google.cloud.securitycentermanagement.v1.SecurityCenterManagement" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 46, + "type": "FULL" + } + ] + }, + { + "region_tag": "securitycentermanagement_v1_generated_SecurityCenterManagement_ValidateEventThreatDetectionCustomModule_sync", + "title": "Snippet for the validate_event_threat_detection_custom_module call in the SecurityCenterManagement service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::SecurityCenterManagement::V1::SecurityCenterManagement::Client#validate_event_threat_detection_custom_module.", + "file": "security_center_management/validate_event_threat_detection_custom_module.rb", + "language": "RUBY", + "client_method": { + "short_name": "validate_event_threat_detection_custom_module", + "full_name": "::Google::Cloud::SecurityCenterManagement::V1::SecurityCenterManagement::Client#validate_event_threat_detection_custom_module", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::SecurityCenterManagement::V1::ValidateEventThreatDetectionCustomModuleRequest", + "name": "request" + } + ], + "result_type": "::Google::Cloud::SecurityCenterManagement::V1::ValidateEventThreatDetectionCustomModuleResponse", + "client": { + "short_name": "SecurityCenterManagement::Client", + "full_name": "::Google::Cloud::SecurityCenterManagement::V1::SecurityCenterManagement::Client" + }, + "method": { + "short_name": "ValidateEventThreatDetectionCustomModule", + "full_name": "google.cloud.securitycentermanagement.v1.SecurityCenterManagement.ValidateEventThreatDetectionCustomModule", + "service": { + "short_name": "SecurityCenterManagement", + "full_name": "google.cloud.securitycentermanagement.v1.SecurityCenterManagement" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 46, + "type": "FULL" + } + ] + }, + { + "region_tag": "securitycentermanagement_v1_generated_SecurityCenterManagement_GetSecurityCenterService_sync", + "title": "Snippet for the get_security_center_service call in the SecurityCenterManagement service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::SecurityCenterManagement::V1::SecurityCenterManagement::Client#get_security_center_service.", + "file": "security_center_management/get_security_center_service.rb", + "language": "RUBY", + "client_method": { + "short_name": "get_security_center_service", + "full_name": "::Google::Cloud::SecurityCenterManagement::V1::SecurityCenterManagement::Client#get_security_center_service", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::SecurityCenterManagement::V1::GetSecurityCenterServiceRequest", + "name": "request" + } + ], + "result_type": "::Google::Cloud::SecurityCenterManagement::V1::SecurityCenterService", + "client": { + "short_name": "SecurityCenterManagement::Client", + "full_name": "::Google::Cloud::SecurityCenterManagement::V1::SecurityCenterManagement::Client" + }, + "method": { + "short_name": "GetSecurityCenterService", + "full_name": "google.cloud.securitycentermanagement.v1.SecurityCenterManagement.GetSecurityCenterService", + "service": { + "short_name": "SecurityCenterManagement", + "full_name": "google.cloud.securitycentermanagement.v1.SecurityCenterManagement" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 46, + "type": "FULL" + } + ] + }, + { + "region_tag": "securitycentermanagement_v1_generated_SecurityCenterManagement_ListSecurityCenterServices_sync", + "title": "Snippet for the list_security_center_services call in the SecurityCenterManagement service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::SecurityCenterManagement::V1::SecurityCenterManagement::Client#list_security_center_services.", + "file": "security_center_management/list_security_center_services.rb", + "language": "RUBY", + "client_method": { + "short_name": "list_security_center_services", + "full_name": "::Google::Cloud::SecurityCenterManagement::V1::SecurityCenterManagement::Client#list_security_center_services", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::SecurityCenterManagement::V1::ListSecurityCenterServicesRequest", + "name": "request" + } + ], + "result_type": "::Google::Cloud::SecurityCenterManagement::V1::ListSecurityCenterServicesResponse", + "client": { + "short_name": "SecurityCenterManagement::Client", + "full_name": "::Google::Cloud::SecurityCenterManagement::V1::SecurityCenterManagement::Client" + }, + "method": { + "short_name": "ListSecurityCenterServices", + "full_name": "google.cloud.securitycentermanagement.v1.SecurityCenterManagement.ListSecurityCenterServices", + "service": { + "short_name": "SecurityCenterManagement", + "full_name": "google.cloud.securitycentermanagement.v1.SecurityCenterManagement" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 50, + "type": "FULL" + } + ] + }, + { + "region_tag": "securitycentermanagement_v1_generated_SecurityCenterManagement_UpdateSecurityCenterService_sync", + "title": "Snippet for the update_security_center_service call in the SecurityCenterManagement service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::SecurityCenterManagement::V1::SecurityCenterManagement::Client#update_security_center_service.", + "file": "security_center_management/update_security_center_service.rb", + "language": "RUBY", + "client_method": { + "short_name": "update_security_center_service", + "full_name": "::Google::Cloud::SecurityCenterManagement::V1::SecurityCenterManagement::Client#update_security_center_service", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::SecurityCenterManagement::V1::UpdateSecurityCenterServiceRequest", + "name": "request" + } + ], + "result_type": "::Google::Cloud::SecurityCenterManagement::V1::SecurityCenterService", + "client": { + "short_name": "SecurityCenterManagement::Client", + "full_name": "::Google::Cloud::SecurityCenterManagement::V1::SecurityCenterManagement::Client" + }, + "method": { + "short_name": "UpdateSecurityCenterService", + "full_name": "google.cloud.securitycentermanagement.v1.SecurityCenterManagement.UpdateSecurityCenterService", + "service": { + "short_name": "SecurityCenterManagement", + "full_name": "google.cloud.securitycentermanagement.v1.SecurityCenterManagement" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 46, + "type": "FULL" + } + ] + } + ] +} \ No newline at end of file diff --git a/owl-bot-staging/google-cloud-security_center_management-v1/test/google/cloud/security_center_management/v1/security_center_management_paths_test.rb b/owl-bot-staging/google-cloud-security_center_management-v1/test/google/cloud/security_center_management/v1/security_center_management_paths_test.rb new file mode 100644 index 000000000000..57be2bde861c --- /dev/null +++ b/owl-bot-staging/google-cloud-security_center_management-v1/test/google/cloud/security_center_management/v1/security_center_management_paths_test.rb @@ -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 "helper" + +require "gapic/grpc/service_stub" + +require "google/cloud/security_center_management/v1/security_center_management" + +class ::Google::Cloud::SecurityCenterManagement::V1::SecurityCenterManagement::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_effective_event_threat_detection_custom_module_path + grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + ::Gapic::ServiceStub.stub :new, DummyStub.new do + client = ::Google::Cloud::SecurityCenterManagement::V1::SecurityCenterManagement::Client.new do |config| + config.credentials = grpc_channel + end + + path = client.effective_event_threat_detection_custom_module_path organization: "value0", location: "value1", effective_event_threat_detection_custom_module: "value2" + assert_equal "organizations/value0/locations/value1/effectiveEventThreatDetectionCustomModules/value2", path + + path = client.effective_event_threat_detection_custom_module_path project: "value0", location: "value1", effective_event_threat_detection_custom_module: "value2" + assert_equal "projects/value0/locations/value1/effectiveEventThreatDetectionCustomModules/value2", path + + path = client.effective_event_threat_detection_custom_module_path folder: "value0", location: "value1", effective_event_threat_detection_custom_module: "value2" + assert_equal "folders/value0/locations/value1/effectiveEventThreatDetectionCustomModules/value2", path + end + end + + def test_effective_security_health_analytics_custom_module_path + grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + ::Gapic::ServiceStub.stub :new, DummyStub.new do + client = ::Google::Cloud::SecurityCenterManagement::V1::SecurityCenterManagement::Client.new do |config| + config.credentials = grpc_channel + end + + path = client.effective_security_health_analytics_custom_module_path organization: "value0", location: "value1", effective_security_health_analytics_custom_module: "value2" + assert_equal "organizations/value0/locations/value1/effectiveSecurityHealthAnalyticsCustomModules/value2", path + + path = client.effective_security_health_analytics_custom_module_path project: "value0", location: "value1", effective_security_health_analytics_custom_module: "value2" + assert_equal "projects/value0/locations/value1/effectiveSecurityHealthAnalyticsCustomModules/value2", path + + path = client.effective_security_health_analytics_custom_module_path folder: "value0", location: "value1", effective_security_health_analytics_custom_module: "value2" + assert_equal "folders/value0/locations/value1/effectiveSecurityHealthAnalyticsCustomModules/value2", path + end + end + + def test_event_threat_detection_custom_module_path + grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + ::Gapic::ServiceStub.stub :new, DummyStub.new do + client = ::Google::Cloud::SecurityCenterManagement::V1::SecurityCenterManagement::Client.new do |config| + config.credentials = grpc_channel + end + + path = client.event_threat_detection_custom_module_path organization: "value0", location: "value1", event_threat_detection_custom_module: "value2" + assert_equal "organizations/value0/locations/value1/eventThreatDetectionCustomModules/value2", path + + path = client.event_threat_detection_custom_module_path project: "value0", location: "value1", event_threat_detection_custom_module: "value2" + assert_equal "projects/value0/locations/value1/eventThreatDetectionCustomModules/value2", path + + path = client.event_threat_detection_custom_module_path folder: "value0", location: "value1", event_threat_detection_custom_module: "value2" + assert_equal "folders/value0/locations/value1/eventThreatDetectionCustomModules/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::Cloud::SecurityCenterManagement::V1::SecurityCenterManagement::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::Cloud::SecurityCenterManagement::V1::SecurityCenterManagement::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::Cloud::SecurityCenterManagement::V1::SecurityCenterManagement::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_security_center_service_path + grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + ::Gapic::ServiceStub.stub :new, DummyStub.new do + client = ::Google::Cloud::SecurityCenterManagement::V1::SecurityCenterManagement::Client.new do |config| + config.credentials = grpc_channel + end + + path = client.security_center_service_path project: "value0", location: "value1", service: "value2" + assert_equal "projects/value0/locations/value1/securityCenterServices/value2", path + + path = client.security_center_service_path folder: "value0", location: "value1", service: "value2" + assert_equal "folders/value0/locations/value1/securityCenterServices/value2", path + + path = client.security_center_service_path organization: "value0", location: "value1", service: "value2" + assert_equal "organizations/value0/locations/value1/securityCenterServices/value2", path + end + end + + def test_security_health_analytics_custom_module_path + grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + ::Gapic::ServiceStub.stub :new, DummyStub.new do + client = ::Google::Cloud::SecurityCenterManagement::V1::SecurityCenterManagement::Client.new do |config| + config.credentials = grpc_channel + end + + path = client.security_health_analytics_custom_module_path organization: "value0", location: "value1", security_health_analytics_custom_module: "value2" + assert_equal "organizations/value0/locations/value1/securityHealthAnalyticsCustomModules/value2", path + + path = client.security_health_analytics_custom_module_path project: "value0", location: "value1", security_health_analytics_custom_module: "value2" + assert_equal "projects/value0/locations/value1/securityHealthAnalyticsCustomModules/value2", path + + path = client.security_health_analytics_custom_module_path folder: "value0", location: "value1", security_health_analytics_custom_module: "value2" + assert_equal "folders/value0/locations/value1/securityHealthAnalyticsCustomModules/value2", path + end + end +end diff --git a/owl-bot-staging/google-cloud-security_center_management-v1/test/google/cloud/security_center_management/v1/security_center_management_rest_test.rb b/owl-bot-staging/google-cloud-security_center_management-v1/test/google/cloud/security_center_management/v1/security_center_management_rest_test.rb new file mode 100644 index 000000000000..c5f5a663a657 --- /dev/null +++ b/owl-bot-staging/google-cloud-security_center_management-v1/test/google/cloud/security_center_management/v1/security_center_management_rest_test.rb @@ -0,0 +1,1265 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +require "helper" +require "gapic/rest" +require "google/cloud/securitycentermanagement/v1/security_center_management_pb" +require "google/cloud/security_center_management/v1/security_center_management/rest" + + +class ::Google::Cloud::SecurityCenterManagement::V1::SecurityCenterManagement::Rest::ClientTest < Minitest::Test + class ClientStub + attr_accessor :call_count, :requests + + def initialize response, &block + @response = response + @block = block + @call_count = 0 + @requests = [] + end + + def make_get_request uri:, params: {}, options: {}, method_name: nil + make_http_request :get, uri: uri, body: nil, params: params, options: options, method_name: method_name + end + + def make_delete_request uri:, params: {}, options: {}, method_name: nil + make_http_request :delete, uri: uri, body: nil, params: params, options: options, method_name: method_name + end + + def make_post_request uri:, body: nil, params: {}, options: {}, method_name: nil + make_http_request :post, uri: uri, body: body, params: params, options: options, method_name: method_name + end + + def make_patch_request uri:, body:, params: {}, options: {}, method_name: nil + make_http_request :patch, uri: uri, body: body, params: params, options: options, method_name: method_name + end + + def make_put_request uri:, body:, params: {}, options: {}, method_name: nil + make_http_request :put, uri: uri, body: body, params: params, options: options, method_name: method_name + end + + def make_http_request *args, **kwargs + @call_count += 1 + + @requests << @block&.call(*args, **kwargs) + + @response + end + + def endpoint + "endpoint.example.com" + end + + def universe_domain + "example.com" + end + + def stub_logger + nil + end + + def logger + nil + end + end + + def test_list_effective_security_health_analytics_custom_modules + # Create test objects. + client_result = ::Google::Cloud::SecurityCenterManagement::V1::ListEffectiveSecurityHealthAnalyticsCustomModulesResponse.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_effective_security_health_analytics_custom_modules_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| + assert options.metadata.key? :"x-goog-api-client" + assert options.metadata[:"x-goog-api-client"].include? "rest" + refute options.metadata[:"x-goog-api-client"].include? "grpc" + end + + ::Google::Cloud::SecurityCenterManagement::V1::SecurityCenterManagement::Rest::ServiceStub.stub :transcode_list_effective_security_health_analytics_custom_modules_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, list_effective_security_health_analytics_custom_modules_client_stub do + # Create client + client = ::Google::Cloud::SecurityCenterManagement::V1::SecurityCenterManagement::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.list_effective_security_health_analytics_custom_modules({ 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_effective_security_health_analytics_custom_modules 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_effective_security_health_analytics_custom_modules ::Google::Cloud::SecurityCenterManagement::V1::ListEffectiveSecurityHealthAnalyticsCustomModulesRequest.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_effective_security_health_analytics_custom_modules({ 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_effective_security_health_analytics_custom_modules(::Google::Cloud::SecurityCenterManagement::V1::ListEffectiveSecurityHealthAnalyticsCustomModulesRequest.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_effective_security_health_analytics_custom_modules_client_stub.call_count + end + end + end + + def test_get_effective_security_health_analytics_custom_module + # Create test objects. + client_result = ::Google::Cloud::SecurityCenterManagement::V1::EffectiveSecurityHealthAnalyticsCustomModule.new + http_response = OpenStruct.new body: client_result.to_json + + call_options = {} + + # Create request parameters for a unary method. + name = "hello world" + + get_effective_security_health_analytics_custom_module_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| + assert options.metadata.key? :"x-goog-api-client" + assert options.metadata[:"x-goog-api-client"].include? "rest" + refute options.metadata[:"x-goog-api-client"].include? "grpc" + end + + ::Google::Cloud::SecurityCenterManagement::V1::SecurityCenterManagement::Rest::ServiceStub.stub :transcode_get_effective_security_health_analytics_custom_module_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, get_effective_security_health_analytics_custom_module_client_stub do + # Create client + client = ::Google::Cloud::SecurityCenterManagement::V1::SecurityCenterManagement::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.get_effective_security_health_analytics_custom_module({ name: name }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.get_effective_security_health_analytics_custom_module name: name do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.get_effective_security_health_analytics_custom_module ::Google::Cloud::SecurityCenterManagement::V1::GetEffectiveSecurityHealthAnalyticsCustomModuleRequest.new(name: name) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + client.get_effective_security_health_analytics_custom_module({ name: name }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + client.get_effective_security_health_analytics_custom_module(::Google::Cloud::SecurityCenterManagement::V1::GetEffectiveSecurityHealthAnalyticsCustomModuleRequest.new(name: name), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, get_effective_security_health_analytics_custom_module_client_stub.call_count + end + end + end + + def test_list_security_health_analytics_custom_modules + # Create test objects. + client_result = ::Google::Cloud::SecurityCenterManagement::V1::ListSecurityHealthAnalyticsCustomModulesResponse.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_security_health_analytics_custom_modules_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| + assert options.metadata.key? :"x-goog-api-client" + assert options.metadata[:"x-goog-api-client"].include? "rest" + refute options.metadata[:"x-goog-api-client"].include? "grpc" + end + + ::Google::Cloud::SecurityCenterManagement::V1::SecurityCenterManagement::Rest::ServiceStub.stub :transcode_list_security_health_analytics_custom_modules_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, list_security_health_analytics_custom_modules_client_stub do + # Create client + client = ::Google::Cloud::SecurityCenterManagement::V1::SecurityCenterManagement::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.list_security_health_analytics_custom_modules({ 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_security_health_analytics_custom_modules 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_security_health_analytics_custom_modules ::Google::Cloud::SecurityCenterManagement::V1::ListSecurityHealthAnalyticsCustomModulesRequest.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_security_health_analytics_custom_modules({ 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_security_health_analytics_custom_modules(::Google::Cloud::SecurityCenterManagement::V1::ListSecurityHealthAnalyticsCustomModulesRequest.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_security_health_analytics_custom_modules_client_stub.call_count + end + end + end + + def test_list_descendant_security_health_analytics_custom_modules + # Create test objects. + client_result = ::Google::Cloud::SecurityCenterManagement::V1::ListDescendantSecurityHealthAnalyticsCustomModulesResponse.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_descendant_security_health_analytics_custom_modules_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| + assert options.metadata.key? :"x-goog-api-client" + assert options.metadata[:"x-goog-api-client"].include? "rest" + refute options.metadata[:"x-goog-api-client"].include? "grpc" + end + + ::Google::Cloud::SecurityCenterManagement::V1::SecurityCenterManagement::Rest::ServiceStub.stub :transcode_list_descendant_security_health_analytics_custom_modules_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, list_descendant_security_health_analytics_custom_modules_client_stub do + # Create client + client = ::Google::Cloud::SecurityCenterManagement::V1::SecurityCenterManagement::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.list_descendant_security_health_analytics_custom_modules({ 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_descendant_security_health_analytics_custom_modules 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_descendant_security_health_analytics_custom_modules ::Google::Cloud::SecurityCenterManagement::V1::ListDescendantSecurityHealthAnalyticsCustomModulesRequest.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_descendant_security_health_analytics_custom_modules({ 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_descendant_security_health_analytics_custom_modules(::Google::Cloud::SecurityCenterManagement::V1::ListDescendantSecurityHealthAnalyticsCustomModulesRequest.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_descendant_security_health_analytics_custom_modules_client_stub.call_count + end + end + end + + def test_get_security_health_analytics_custom_module + # Create test objects. + client_result = ::Google::Cloud::SecurityCenterManagement::V1::SecurityHealthAnalyticsCustomModule.new + http_response = OpenStruct.new body: client_result.to_json + + call_options = {} + + # Create request parameters for a unary method. + name = "hello world" + + get_security_health_analytics_custom_module_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| + assert options.metadata.key? :"x-goog-api-client" + assert options.metadata[:"x-goog-api-client"].include? "rest" + refute options.metadata[:"x-goog-api-client"].include? "grpc" + end + + ::Google::Cloud::SecurityCenterManagement::V1::SecurityCenterManagement::Rest::ServiceStub.stub :transcode_get_security_health_analytics_custom_module_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, get_security_health_analytics_custom_module_client_stub do + # Create client + client = ::Google::Cloud::SecurityCenterManagement::V1::SecurityCenterManagement::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.get_security_health_analytics_custom_module({ name: name }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.get_security_health_analytics_custom_module name: name do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.get_security_health_analytics_custom_module ::Google::Cloud::SecurityCenterManagement::V1::GetSecurityHealthAnalyticsCustomModuleRequest.new(name: name) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + client.get_security_health_analytics_custom_module({ name: name }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + client.get_security_health_analytics_custom_module(::Google::Cloud::SecurityCenterManagement::V1::GetSecurityHealthAnalyticsCustomModuleRequest.new(name: name), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, get_security_health_analytics_custom_module_client_stub.call_count + end + end + end + + def test_create_security_health_analytics_custom_module + # Create test objects. + client_result = ::Google::Cloud::SecurityCenterManagement::V1::SecurityHealthAnalyticsCustomModule.new + http_response = OpenStruct.new body: client_result.to_json + + call_options = {} + + # Create request parameters for a unary method. + parent = "hello world" + security_health_analytics_custom_module = {} + validate_only = true + + create_security_health_analytics_custom_module_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| + assert options.metadata.key? :"x-goog-api-client" + assert options.metadata[:"x-goog-api-client"].include? "rest" + refute options.metadata[:"x-goog-api-client"].include? "grpc" + end + + ::Google::Cloud::SecurityCenterManagement::V1::SecurityCenterManagement::Rest::ServiceStub.stub :transcode_create_security_health_analytics_custom_module_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, create_security_health_analytics_custom_module_client_stub do + # Create client + client = ::Google::Cloud::SecurityCenterManagement::V1::SecurityCenterManagement::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.create_security_health_analytics_custom_module({ parent: parent, security_health_analytics_custom_module: security_health_analytics_custom_module, validate_only: validate_only }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.create_security_health_analytics_custom_module parent: parent, security_health_analytics_custom_module: security_health_analytics_custom_module, validate_only: validate_only do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.create_security_health_analytics_custom_module ::Google::Cloud::SecurityCenterManagement::V1::CreateSecurityHealthAnalyticsCustomModuleRequest.new(parent: parent, security_health_analytics_custom_module: security_health_analytics_custom_module, validate_only: validate_only) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + client.create_security_health_analytics_custom_module({ parent: parent, security_health_analytics_custom_module: security_health_analytics_custom_module, validate_only: validate_only }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + client.create_security_health_analytics_custom_module(::Google::Cloud::SecurityCenterManagement::V1::CreateSecurityHealthAnalyticsCustomModuleRequest.new(parent: parent, security_health_analytics_custom_module: security_health_analytics_custom_module, validate_only: validate_only), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, create_security_health_analytics_custom_module_client_stub.call_count + end + end + end + + def test_update_security_health_analytics_custom_module + # Create test objects. + client_result = ::Google::Cloud::SecurityCenterManagement::V1::SecurityHealthAnalyticsCustomModule.new + http_response = OpenStruct.new body: client_result.to_json + + call_options = {} + + # Create request parameters for a unary method. + update_mask = {} + security_health_analytics_custom_module = {} + validate_only = true + + update_security_health_analytics_custom_module_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| + assert options.metadata.key? :"x-goog-api-client" + assert options.metadata[:"x-goog-api-client"].include? "rest" + refute options.metadata[:"x-goog-api-client"].include? "grpc" + end + + ::Google::Cloud::SecurityCenterManagement::V1::SecurityCenterManagement::Rest::ServiceStub.stub :transcode_update_security_health_analytics_custom_module_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, update_security_health_analytics_custom_module_client_stub do + # Create client + client = ::Google::Cloud::SecurityCenterManagement::V1::SecurityCenterManagement::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.update_security_health_analytics_custom_module({ update_mask: update_mask, security_health_analytics_custom_module: security_health_analytics_custom_module, validate_only: validate_only }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.update_security_health_analytics_custom_module update_mask: update_mask, security_health_analytics_custom_module: security_health_analytics_custom_module, validate_only: validate_only do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.update_security_health_analytics_custom_module ::Google::Cloud::SecurityCenterManagement::V1::UpdateSecurityHealthAnalyticsCustomModuleRequest.new(update_mask: update_mask, security_health_analytics_custom_module: security_health_analytics_custom_module, validate_only: validate_only) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + client.update_security_health_analytics_custom_module({ update_mask: update_mask, security_health_analytics_custom_module: security_health_analytics_custom_module, validate_only: validate_only }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + client.update_security_health_analytics_custom_module(::Google::Cloud::SecurityCenterManagement::V1::UpdateSecurityHealthAnalyticsCustomModuleRequest.new(update_mask: update_mask, security_health_analytics_custom_module: security_health_analytics_custom_module, validate_only: validate_only), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, update_security_health_analytics_custom_module_client_stub.call_count + end + end + end + + def test_delete_security_health_analytics_custom_module + # Create test objects. + client_result = ::Google::Protobuf::Empty.new + http_response = OpenStruct.new body: client_result.to_json + + call_options = {} + + # Create request parameters for a unary method. + name = "hello world" + validate_only = true + + delete_security_health_analytics_custom_module_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| + assert options.metadata.key? :"x-goog-api-client" + assert options.metadata[:"x-goog-api-client"].include? "rest" + refute options.metadata[:"x-goog-api-client"].include? "grpc" + end + + ::Google::Cloud::SecurityCenterManagement::V1::SecurityCenterManagement::Rest::ServiceStub.stub :transcode_delete_security_health_analytics_custom_module_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, delete_security_health_analytics_custom_module_client_stub do + # Create client + client = ::Google::Cloud::SecurityCenterManagement::V1::SecurityCenterManagement::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.delete_security_health_analytics_custom_module({ name: name, validate_only: validate_only }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.delete_security_health_analytics_custom_module name: name, validate_only: validate_only do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.delete_security_health_analytics_custom_module ::Google::Cloud::SecurityCenterManagement::V1::DeleteSecurityHealthAnalyticsCustomModuleRequest.new(name: name, validate_only: validate_only) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + client.delete_security_health_analytics_custom_module({ name: name, validate_only: validate_only }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + client.delete_security_health_analytics_custom_module(::Google::Cloud::SecurityCenterManagement::V1::DeleteSecurityHealthAnalyticsCustomModuleRequest.new(name: name, validate_only: validate_only), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, delete_security_health_analytics_custom_module_client_stub.call_count + end + end + end + + def test_simulate_security_health_analytics_custom_module + # Create test objects. + client_result = ::Google::Cloud::SecurityCenterManagement::V1::SimulateSecurityHealthAnalyticsCustomModuleResponse.new + http_response = OpenStruct.new body: client_result.to_json + + call_options = {} + + # Create request parameters for a unary method. + parent = "hello world" + custom_config = {} + resource = {} + + simulate_security_health_analytics_custom_module_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| + assert options.metadata.key? :"x-goog-api-client" + assert options.metadata[:"x-goog-api-client"].include? "rest" + refute options.metadata[:"x-goog-api-client"].include? "grpc" + end + + ::Google::Cloud::SecurityCenterManagement::V1::SecurityCenterManagement::Rest::ServiceStub.stub :transcode_simulate_security_health_analytics_custom_module_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, simulate_security_health_analytics_custom_module_client_stub do + # Create client + client = ::Google::Cloud::SecurityCenterManagement::V1::SecurityCenterManagement::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.simulate_security_health_analytics_custom_module({ parent: parent, custom_config: custom_config, resource: resource }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.simulate_security_health_analytics_custom_module parent: parent, custom_config: custom_config, resource: resource do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.simulate_security_health_analytics_custom_module ::Google::Cloud::SecurityCenterManagement::V1::SimulateSecurityHealthAnalyticsCustomModuleRequest.new(parent: parent, custom_config: custom_config, resource: resource) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + client.simulate_security_health_analytics_custom_module({ parent: parent, custom_config: custom_config, resource: resource }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + client.simulate_security_health_analytics_custom_module(::Google::Cloud::SecurityCenterManagement::V1::SimulateSecurityHealthAnalyticsCustomModuleRequest.new(parent: parent, custom_config: custom_config, resource: resource), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, simulate_security_health_analytics_custom_module_client_stub.call_count + end + end + end + + def test_list_effective_event_threat_detection_custom_modules + # Create test objects. + client_result = ::Google::Cloud::SecurityCenterManagement::V1::ListEffectiveEventThreatDetectionCustomModulesResponse.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_effective_event_threat_detection_custom_modules_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| + assert options.metadata.key? :"x-goog-api-client" + assert options.metadata[:"x-goog-api-client"].include? "rest" + refute options.metadata[:"x-goog-api-client"].include? "grpc" + end + + ::Google::Cloud::SecurityCenterManagement::V1::SecurityCenterManagement::Rest::ServiceStub.stub :transcode_list_effective_event_threat_detection_custom_modules_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, list_effective_event_threat_detection_custom_modules_client_stub do + # Create client + client = ::Google::Cloud::SecurityCenterManagement::V1::SecurityCenterManagement::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.list_effective_event_threat_detection_custom_modules({ 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_effective_event_threat_detection_custom_modules 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_effective_event_threat_detection_custom_modules ::Google::Cloud::SecurityCenterManagement::V1::ListEffectiveEventThreatDetectionCustomModulesRequest.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_effective_event_threat_detection_custom_modules({ 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_effective_event_threat_detection_custom_modules(::Google::Cloud::SecurityCenterManagement::V1::ListEffectiveEventThreatDetectionCustomModulesRequest.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_effective_event_threat_detection_custom_modules_client_stub.call_count + end + end + end + + def test_get_effective_event_threat_detection_custom_module + # Create test objects. + client_result = ::Google::Cloud::SecurityCenterManagement::V1::EffectiveEventThreatDetectionCustomModule.new + http_response = OpenStruct.new body: client_result.to_json + + call_options = {} + + # Create request parameters for a unary method. + name = "hello world" + + get_effective_event_threat_detection_custom_module_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| + assert options.metadata.key? :"x-goog-api-client" + assert options.metadata[:"x-goog-api-client"].include? "rest" + refute options.metadata[:"x-goog-api-client"].include? "grpc" + end + + ::Google::Cloud::SecurityCenterManagement::V1::SecurityCenterManagement::Rest::ServiceStub.stub :transcode_get_effective_event_threat_detection_custom_module_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, get_effective_event_threat_detection_custom_module_client_stub do + # Create client + client = ::Google::Cloud::SecurityCenterManagement::V1::SecurityCenterManagement::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.get_effective_event_threat_detection_custom_module({ name: name }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.get_effective_event_threat_detection_custom_module name: name do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.get_effective_event_threat_detection_custom_module ::Google::Cloud::SecurityCenterManagement::V1::GetEffectiveEventThreatDetectionCustomModuleRequest.new(name: name) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + client.get_effective_event_threat_detection_custom_module({ name: name }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + client.get_effective_event_threat_detection_custom_module(::Google::Cloud::SecurityCenterManagement::V1::GetEffectiveEventThreatDetectionCustomModuleRequest.new(name: name), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, get_effective_event_threat_detection_custom_module_client_stub.call_count + end + end + end + + def test_list_event_threat_detection_custom_modules + # Create test objects. + client_result = ::Google::Cloud::SecurityCenterManagement::V1::ListEventThreatDetectionCustomModulesResponse.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_event_threat_detection_custom_modules_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| + assert options.metadata.key? :"x-goog-api-client" + assert options.metadata[:"x-goog-api-client"].include? "rest" + refute options.metadata[:"x-goog-api-client"].include? "grpc" + end + + ::Google::Cloud::SecurityCenterManagement::V1::SecurityCenterManagement::Rest::ServiceStub.stub :transcode_list_event_threat_detection_custom_modules_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, list_event_threat_detection_custom_modules_client_stub do + # Create client + client = ::Google::Cloud::SecurityCenterManagement::V1::SecurityCenterManagement::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.list_event_threat_detection_custom_modules({ 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_event_threat_detection_custom_modules 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_event_threat_detection_custom_modules ::Google::Cloud::SecurityCenterManagement::V1::ListEventThreatDetectionCustomModulesRequest.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_event_threat_detection_custom_modules({ 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_event_threat_detection_custom_modules(::Google::Cloud::SecurityCenterManagement::V1::ListEventThreatDetectionCustomModulesRequest.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_event_threat_detection_custom_modules_client_stub.call_count + end + end + end + + def test_list_descendant_event_threat_detection_custom_modules + # Create test objects. + client_result = ::Google::Cloud::SecurityCenterManagement::V1::ListDescendantEventThreatDetectionCustomModulesResponse.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_descendant_event_threat_detection_custom_modules_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| + assert options.metadata.key? :"x-goog-api-client" + assert options.metadata[:"x-goog-api-client"].include? "rest" + refute options.metadata[:"x-goog-api-client"].include? "grpc" + end + + ::Google::Cloud::SecurityCenterManagement::V1::SecurityCenterManagement::Rest::ServiceStub.stub :transcode_list_descendant_event_threat_detection_custom_modules_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, list_descendant_event_threat_detection_custom_modules_client_stub do + # Create client + client = ::Google::Cloud::SecurityCenterManagement::V1::SecurityCenterManagement::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.list_descendant_event_threat_detection_custom_modules({ 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_descendant_event_threat_detection_custom_modules 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_descendant_event_threat_detection_custom_modules ::Google::Cloud::SecurityCenterManagement::V1::ListDescendantEventThreatDetectionCustomModulesRequest.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_descendant_event_threat_detection_custom_modules({ 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_descendant_event_threat_detection_custom_modules(::Google::Cloud::SecurityCenterManagement::V1::ListDescendantEventThreatDetectionCustomModulesRequest.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_descendant_event_threat_detection_custom_modules_client_stub.call_count + end + end + end + + def test_get_event_threat_detection_custom_module + # Create test objects. + client_result = ::Google::Cloud::SecurityCenterManagement::V1::EventThreatDetectionCustomModule.new + http_response = OpenStruct.new body: client_result.to_json + + call_options = {} + + # Create request parameters for a unary method. + name = "hello world" + + get_event_threat_detection_custom_module_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| + assert options.metadata.key? :"x-goog-api-client" + assert options.metadata[:"x-goog-api-client"].include? "rest" + refute options.metadata[:"x-goog-api-client"].include? "grpc" + end + + ::Google::Cloud::SecurityCenterManagement::V1::SecurityCenterManagement::Rest::ServiceStub.stub :transcode_get_event_threat_detection_custom_module_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, get_event_threat_detection_custom_module_client_stub do + # Create client + client = ::Google::Cloud::SecurityCenterManagement::V1::SecurityCenterManagement::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.get_event_threat_detection_custom_module({ name: name }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.get_event_threat_detection_custom_module name: name do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.get_event_threat_detection_custom_module ::Google::Cloud::SecurityCenterManagement::V1::GetEventThreatDetectionCustomModuleRequest.new(name: name) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + client.get_event_threat_detection_custom_module({ name: name }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + client.get_event_threat_detection_custom_module(::Google::Cloud::SecurityCenterManagement::V1::GetEventThreatDetectionCustomModuleRequest.new(name: name), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, get_event_threat_detection_custom_module_client_stub.call_count + end + end + end + + def test_create_event_threat_detection_custom_module + # Create test objects. + client_result = ::Google::Cloud::SecurityCenterManagement::V1::EventThreatDetectionCustomModule.new + http_response = OpenStruct.new body: client_result.to_json + + call_options = {} + + # Create request parameters for a unary method. + parent = "hello world" + event_threat_detection_custom_module = {} + validate_only = true + + create_event_threat_detection_custom_module_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| + assert options.metadata.key? :"x-goog-api-client" + assert options.metadata[:"x-goog-api-client"].include? "rest" + refute options.metadata[:"x-goog-api-client"].include? "grpc" + end + + ::Google::Cloud::SecurityCenterManagement::V1::SecurityCenterManagement::Rest::ServiceStub.stub :transcode_create_event_threat_detection_custom_module_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, create_event_threat_detection_custom_module_client_stub do + # Create client + client = ::Google::Cloud::SecurityCenterManagement::V1::SecurityCenterManagement::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.create_event_threat_detection_custom_module({ parent: parent, event_threat_detection_custom_module: event_threat_detection_custom_module, validate_only: validate_only }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.create_event_threat_detection_custom_module parent: parent, event_threat_detection_custom_module: event_threat_detection_custom_module, validate_only: validate_only do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.create_event_threat_detection_custom_module ::Google::Cloud::SecurityCenterManagement::V1::CreateEventThreatDetectionCustomModuleRequest.new(parent: parent, event_threat_detection_custom_module: event_threat_detection_custom_module, validate_only: validate_only) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + client.create_event_threat_detection_custom_module({ parent: parent, event_threat_detection_custom_module: event_threat_detection_custom_module, validate_only: validate_only }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + client.create_event_threat_detection_custom_module(::Google::Cloud::SecurityCenterManagement::V1::CreateEventThreatDetectionCustomModuleRequest.new(parent: parent, event_threat_detection_custom_module: event_threat_detection_custom_module, validate_only: validate_only), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, create_event_threat_detection_custom_module_client_stub.call_count + end + end + end + + def test_update_event_threat_detection_custom_module + # Create test objects. + client_result = ::Google::Cloud::SecurityCenterManagement::V1::EventThreatDetectionCustomModule.new + http_response = OpenStruct.new body: client_result.to_json + + call_options = {} + + # Create request parameters for a unary method. + update_mask = {} + event_threat_detection_custom_module = {} + validate_only = true + + update_event_threat_detection_custom_module_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| + assert options.metadata.key? :"x-goog-api-client" + assert options.metadata[:"x-goog-api-client"].include? "rest" + refute options.metadata[:"x-goog-api-client"].include? "grpc" + end + + ::Google::Cloud::SecurityCenterManagement::V1::SecurityCenterManagement::Rest::ServiceStub.stub :transcode_update_event_threat_detection_custom_module_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, update_event_threat_detection_custom_module_client_stub do + # Create client + client = ::Google::Cloud::SecurityCenterManagement::V1::SecurityCenterManagement::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.update_event_threat_detection_custom_module({ update_mask: update_mask, event_threat_detection_custom_module: event_threat_detection_custom_module, validate_only: validate_only }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.update_event_threat_detection_custom_module update_mask: update_mask, event_threat_detection_custom_module: event_threat_detection_custom_module, validate_only: validate_only do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.update_event_threat_detection_custom_module ::Google::Cloud::SecurityCenterManagement::V1::UpdateEventThreatDetectionCustomModuleRequest.new(update_mask: update_mask, event_threat_detection_custom_module: event_threat_detection_custom_module, validate_only: validate_only) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + client.update_event_threat_detection_custom_module({ update_mask: update_mask, event_threat_detection_custom_module: event_threat_detection_custom_module, validate_only: validate_only }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + client.update_event_threat_detection_custom_module(::Google::Cloud::SecurityCenterManagement::V1::UpdateEventThreatDetectionCustomModuleRequest.new(update_mask: update_mask, event_threat_detection_custom_module: event_threat_detection_custom_module, validate_only: validate_only), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, update_event_threat_detection_custom_module_client_stub.call_count + end + end + end + + def test_delete_event_threat_detection_custom_module + # Create test objects. + client_result = ::Google::Protobuf::Empty.new + http_response = OpenStruct.new body: client_result.to_json + + call_options = {} + + # Create request parameters for a unary method. + name = "hello world" + validate_only = true + + delete_event_threat_detection_custom_module_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| + assert options.metadata.key? :"x-goog-api-client" + assert options.metadata[:"x-goog-api-client"].include? "rest" + refute options.metadata[:"x-goog-api-client"].include? "grpc" + end + + ::Google::Cloud::SecurityCenterManagement::V1::SecurityCenterManagement::Rest::ServiceStub.stub :transcode_delete_event_threat_detection_custom_module_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, delete_event_threat_detection_custom_module_client_stub do + # Create client + client = ::Google::Cloud::SecurityCenterManagement::V1::SecurityCenterManagement::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.delete_event_threat_detection_custom_module({ name: name, validate_only: validate_only }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.delete_event_threat_detection_custom_module name: name, validate_only: validate_only do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.delete_event_threat_detection_custom_module ::Google::Cloud::SecurityCenterManagement::V1::DeleteEventThreatDetectionCustomModuleRequest.new(name: name, validate_only: validate_only) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + client.delete_event_threat_detection_custom_module({ name: name, validate_only: validate_only }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + client.delete_event_threat_detection_custom_module(::Google::Cloud::SecurityCenterManagement::V1::DeleteEventThreatDetectionCustomModuleRequest.new(name: name, validate_only: validate_only), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, delete_event_threat_detection_custom_module_client_stub.call_count + end + end + end + + def test_validate_event_threat_detection_custom_module + # Create test objects. + client_result = ::Google::Cloud::SecurityCenterManagement::V1::ValidateEventThreatDetectionCustomModuleResponse.new + http_response = OpenStruct.new body: client_result.to_json + + call_options = {} + + # Create request parameters for a unary method. + parent = "hello world" + raw_text = "hello world" + type = "hello world" + + validate_event_threat_detection_custom_module_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| + assert options.metadata.key? :"x-goog-api-client" + assert options.metadata[:"x-goog-api-client"].include? "rest" + refute options.metadata[:"x-goog-api-client"].include? "grpc" + end + + ::Google::Cloud::SecurityCenterManagement::V1::SecurityCenterManagement::Rest::ServiceStub.stub :transcode_validate_event_threat_detection_custom_module_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, validate_event_threat_detection_custom_module_client_stub do + # Create client + client = ::Google::Cloud::SecurityCenterManagement::V1::SecurityCenterManagement::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.validate_event_threat_detection_custom_module({ parent: parent, raw_text: raw_text, type: type }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.validate_event_threat_detection_custom_module parent: parent, raw_text: raw_text, type: type do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.validate_event_threat_detection_custom_module ::Google::Cloud::SecurityCenterManagement::V1::ValidateEventThreatDetectionCustomModuleRequest.new(parent: parent, raw_text: raw_text, type: type) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + client.validate_event_threat_detection_custom_module({ parent: parent, raw_text: raw_text, type: type }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + client.validate_event_threat_detection_custom_module(::Google::Cloud::SecurityCenterManagement::V1::ValidateEventThreatDetectionCustomModuleRequest.new(parent: parent, raw_text: raw_text, type: type), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, validate_event_threat_detection_custom_module_client_stub.call_count + end + end + end + + def test_get_security_center_service + # Create test objects. + client_result = ::Google::Cloud::SecurityCenterManagement::V1::SecurityCenterService.new + http_response = OpenStruct.new body: client_result.to_json + + call_options = {} + + # Create request parameters for a unary method. + name = "hello world" + show_eligible_modules_only = true + + get_security_center_service_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| + assert options.metadata.key? :"x-goog-api-client" + assert options.metadata[:"x-goog-api-client"].include? "rest" + refute options.metadata[:"x-goog-api-client"].include? "grpc" + end + + ::Google::Cloud::SecurityCenterManagement::V1::SecurityCenterManagement::Rest::ServiceStub.stub :transcode_get_security_center_service_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, get_security_center_service_client_stub do + # Create client + client = ::Google::Cloud::SecurityCenterManagement::V1::SecurityCenterManagement::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.get_security_center_service({ name: name, show_eligible_modules_only: show_eligible_modules_only }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.get_security_center_service name: name, show_eligible_modules_only: show_eligible_modules_only do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.get_security_center_service ::Google::Cloud::SecurityCenterManagement::V1::GetSecurityCenterServiceRequest.new(name: name, show_eligible_modules_only: show_eligible_modules_only) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + client.get_security_center_service({ name: name, show_eligible_modules_only: show_eligible_modules_only }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + client.get_security_center_service(::Google::Cloud::SecurityCenterManagement::V1::GetSecurityCenterServiceRequest.new(name: name, show_eligible_modules_only: show_eligible_modules_only), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, get_security_center_service_client_stub.call_count + end + end + end + + def test_list_security_center_services + # Create test objects. + client_result = ::Google::Cloud::SecurityCenterManagement::V1::ListSecurityCenterServicesResponse.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" + show_eligible_modules_only = true + + list_security_center_services_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| + assert options.metadata.key? :"x-goog-api-client" + assert options.metadata[:"x-goog-api-client"].include? "rest" + refute options.metadata[:"x-goog-api-client"].include? "grpc" + end + + ::Google::Cloud::SecurityCenterManagement::V1::SecurityCenterManagement::Rest::ServiceStub.stub :transcode_list_security_center_services_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, list_security_center_services_client_stub do + # Create client + client = ::Google::Cloud::SecurityCenterManagement::V1::SecurityCenterManagement::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.list_security_center_services({ parent: parent, page_size: page_size, page_token: page_token, show_eligible_modules_only: show_eligible_modules_only }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.list_security_center_services parent: parent, page_size: page_size, page_token: page_token, show_eligible_modules_only: show_eligible_modules_only do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.list_security_center_services ::Google::Cloud::SecurityCenterManagement::V1::ListSecurityCenterServicesRequest.new(parent: parent, page_size: page_size, page_token: page_token, show_eligible_modules_only: show_eligible_modules_only) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + client.list_security_center_services({ parent: parent, page_size: page_size, page_token: page_token, show_eligible_modules_only: show_eligible_modules_only }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + client.list_security_center_services(::Google::Cloud::SecurityCenterManagement::V1::ListSecurityCenterServicesRequest.new(parent: parent, page_size: page_size, page_token: page_token, show_eligible_modules_only: show_eligible_modules_only), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, list_security_center_services_client_stub.call_count + end + end + end + + def test_update_security_center_service + # Create test objects. + client_result = ::Google::Cloud::SecurityCenterManagement::V1::SecurityCenterService.new + http_response = OpenStruct.new body: client_result.to_json + + call_options = {} + + # Create request parameters for a unary method. + security_center_service = {} + update_mask = {} + validate_only = true + + update_security_center_service_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| + assert options.metadata.key? :"x-goog-api-client" + assert options.metadata[:"x-goog-api-client"].include? "rest" + refute options.metadata[:"x-goog-api-client"].include? "grpc" + end + + ::Google::Cloud::SecurityCenterManagement::V1::SecurityCenterManagement::Rest::ServiceStub.stub :transcode_update_security_center_service_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, update_security_center_service_client_stub do + # Create client + client = ::Google::Cloud::SecurityCenterManagement::V1::SecurityCenterManagement::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.update_security_center_service({ security_center_service: security_center_service, update_mask: update_mask, validate_only: validate_only }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.update_security_center_service security_center_service: security_center_service, update_mask: update_mask, validate_only: validate_only do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.update_security_center_service ::Google::Cloud::SecurityCenterManagement::V1::UpdateSecurityCenterServiceRequest.new(security_center_service: security_center_service, update_mask: update_mask, validate_only: validate_only) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + client.update_security_center_service({ security_center_service: security_center_service, update_mask: update_mask, validate_only: validate_only }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + client.update_security_center_service(::Google::Cloud::SecurityCenterManagement::V1::UpdateSecurityCenterServiceRequest.new(security_center_service: security_center_service, update_mask: update_mask, validate_only: validate_only), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, update_security_center_service_client_stub.call_count + end + end + end + + def test_configure + credentials_token = :dummy_value + + client = block_config = config = nil + dummy_stub = ClientStub.new nil + Gapic::Rest::ClientStub.stub :new, dummy_stub do + client = ::Google::Cloud::SecurityCenterManagement::V1::SecurityCenterManagement::Rest::Client.new do |config| + config.credentials = credentials_token + end + end + + config = client.configure do |c| + block_config = c + end + + assert_same block_config, config + assert_kind_of ::Google::Cloud::SecurityCenterManagement::V1::SecurityCenterManagement::Rest::Client::Configuration, config + end +end diff --git a/owl-bot-staging/google-cloud-security_center_management-v1/test/google/cloud/security_center_management/v1/security_center_management_test.rb b/owl-bot-staging/google-cloud-security_center_management-v1/test/google/cloud/security_center_management/v1/security_center_management_test.rb new file mode 100644 index 000000000000..5e0d83eb3215 --- /dev/null +++ b/owl-bot-staging/google-cloud-security_center_management-v1/test/google/cloud/security_center_management/v1/security_center_management_test.rb @@ -0,0 +1,1421 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +require "helper" + +require "gapic/grpc/service_stub" + +require "google/cloud/securitycentermanagement/v1/security_center_management_pb" +require "google/cloud/security_center_management/v1/security_center_management" + +class ::Google::Cloud::SecurityCenterManagement::V1::SecurityCenterManagement::ClientTest < Minitest::Test + class ClientStub + attr_accessor :call_rpc_count, :requests + + def initialize response, operation, &block + @response = response + @operation = operation + @block = block + @call_rpc_count = 0 + @requests = [] + end + + def call_rpc *args, **kwargs + @call_rpc_count += 1 + + @requests << @block&.call(*args, **kwargs) + + catch :response do + yield @response, @operation if block_given? + @response + end + end + + def endpoint + "endpoint.example.com" + end + + def universe_domain + "example.com" + end + + def stub_logger + nil + end + + def logger + nil + end + end + + def test_list_effective_security_health_analytics_custom_modules + # Create GRPC objects. + grpc_response = ::Google::Cloud::SecurityCenterManagement::V1::ListEffectiveSecurityHealthAnalyticsCustomModulesResponse.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_effective_security_health_analytics_custom_modules_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :list_effective_security_health_analytics_custom_modules, name + assert_kind_of ::Google::Cloud::SecurityCenterManagement::V1::ListEffectiveSecurityHealthAnalyticsCustomModulesRequest, 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_effective_security_health_analytics_custom_modules_client_stub do + # Create client + client = ::Google::Cloud::SecurityCenterManagement::V1::SecurityCenterManagement::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.list_effective_security_health_analytics_custom_modules({ 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_effective_security_health_analytics_custom_modules 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_effective_security_health_analytics_custom_modules ::Google::Cloud::SecurityCenterManagement::V1::ListEffectiveSecurityHealthAnalyticsCustomModulesRequest.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_effective_security_health_analytics_custom_modules({ 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_effective_security_health_analytics_custom_modules(::Google::Cloud::SecurityCenterManagement::V1::ListEffectiveSecurityHealthAnalyticsCustomModulesRequest.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_effective_security_health_analytics_custom_modules_client_stub.call_rpc_count + end + end + + def test_get_effective_security_health_analytics_custom_module + # Create GRPC objects. + grpc_response = ::Google::Cloud::SecurityCenterManagement::V1::EffectiveSecurityHealthAnalyticsCustomModule.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_effective_security_health_analytics_custom_module_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :get_effective_security_health_analytics_custom_module, name + assert_kind_of ::Google::Cloud::SecurityCenterManagement::V1::GetEffectiveSecurityHealthAnalyticsCustomModuleRequest, request + assert_equal "hello world", request["name"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, get_effective_security_health_analytics_custom_module_client_stub do + # Create client + client = ::Google::Cloud::SecurityCenterManagement::V1::SecurityCenterManagement::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.get_effective_security_health_analytics_custom_module({ name: name }) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use named arguments + client.get_effective_security_health_analytics_custom_module name: name do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.get_effective_security_health_analytics_custom_module ::Google::Cloud::SecurityCenterManagement::V1::GetEffectiveSecurityHealthAnalyticsCustomModuleRequest.new(name: name) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use hash object with options + client.get_effective_security_health_analytics_custom_module({ 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_effective_security_health_analytics_custom_module(::Google::Cloud::SecurityCenterManagement::V1::GetEffectiveSecurityHealthAnalyticsCustomModuleRequest.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_effective_security_health_analytics_custom_module_client_stub.call_rpc_count + end + end + + def test_list_security_health_analytics_custom_modules + # Create GRPC objects. + grpc_response = ::Google::Cloud::SecurityCenterManagement::V1::ListSecurityHealthAnalyticsCustomModulesResponse.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_security_health_analytics_custom_modules_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :list_security_health_analytics_custom_modules, name + assert_kind_of ::Google::Cloud::SecurityCenterManagement::V1::ListSecurityHealthAnalyticsCustomModulesRequest, 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_security_health_analytics_custom_modules_client_stub do + # Create client + client = ::Google::Cloud::SecurityCenterManagement::V1::SecurityCenterManagement::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.list_security_health_analytics_custom_modules({ 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_security_health_analytics_custom_modules 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_security_health_analytics_custom_modules ::Google::Cloud::SecurityCenterManagement::V1::ListSecurityHealthAnalyticsCustomModulesRequest.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_security_health_analytics_custom_modules({ 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_security_health_analytics_custom_modules(::Google::Cloud::SecurityCenterManagement::V1::ListSecurityHealthAnalyticsCustomModulesRequest.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_security_health_analytics_custom_modules_client_stub.call_rpc_count + end + end + + def test_list_descendant_security_health_analytics_custom_modules + # Create GRPC objects. + grpc_response = ::Google::Cloud::SecurityCenterManagement::V1::ListDescendantSecurityHealthAnalyticsCustomModulesResponse.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_descendant_security_health_analytics_custom_modules_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :list_descendant_security_health_analytics_custom_modules, name + assert_kind_of ::Google::Cloud::SecurityCenterManagement::V1::ListDescendantSecurityHealthAnalyticsCustomModulesRequest, 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_descendant_security_health_analytics_custom_modules_client_stub do + # Create client + client = ::Google::Cloud::SecurityCenterManagement::V1::SecurityCenterManagement::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.list_descendant_security_health_analytics_custom_modules({ 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_descendant_security_health_analytics_custom_modules 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_descendant_security_health_analytics_custom_modules ::Google::Cloud::SecurityCenterManagement::V1::ListDescendantSecurityHealthAnalyticsCustomModulesRequest.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_descendant_security_health_analytics_custom_modules({ 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_descendant_security_health_analytics_custom_modules(::Google::Cloud::SecurityCenterManagement::V1::ListDescendantSecurityHealthAnalyticsCustomModulesRequest.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_descendant_security_health_analytics_custom_modules_client_stub.call_rpc_count + end + end + + def test_get_security_health_analytics_custom_module + # Create GRPC objects. + grpc_response = ::Google::Cloud::SecurityCenterManagement::V1::SecurityHealthAnalyticsCustomModule.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_security_health_analytics_custom_module_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :get_security_health_analytics_custom_module, name + assert_kind_of ::Google::Cloud::SecurityCenterManagement::V1::GetSecurityHealthAnalyticsCustomModuleRequest, request + assert_equal "hello world", request["name"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, get_security_health_analytics_custom_module_client_stub do + # Create client + client = ::Google::Cloud::SecurityCenterManagement::V1::SecurityCenterManagement::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.get_security_health_analytics_custom_module({ name: name }) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use named arguments + client.get_security_health_analytics_custom_module name: name do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.get_security_health_analytics_custom_module ::Google::Cloud::SecurityCenterManagement::V1::GetSecurityHealthAnalyticsCustomModuleRequest.new(name: name) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use hash object with options + client.get_security_health_analytics_custom_module({ 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_security_health_analytics_custom_module(::Google::Cloud::SecurityCenterManagement::V1::GetSecurityHealthAnalyticsCustomModuleRequest.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_security_health_analytics_custom_module_client_stub.call_rpc_count + end + end + + def test_create_security_health_analytics_custom_module + # Create GRPC objects. + grpc_response = ::Google::Cloud::SecurityCenterManagement::V1::SecurityHealthAnalyticsCustomModule.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" + security_health_analytics_custom_module = {} + validate_only = true + + create_security_health_analytics_custom_module_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :create_security_health_analytics_custom_module, name + assert_kind_of ::Google::Cloud::SecurityCenterManagement::V1::CreateSecurityHealthAnalyticsCustomModuleRequest, request + assert_equal "hello world", request["parent"] + assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::SecurityCenterManagement::V1::SecurityHealthAnalyticsCustomModule), request["security_health_analytics_custom_module"] + assert_equal true, request["validate_only"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, create_security_health_analytics_custom_module_client_stub do + # Create client + client = ::Google::Cloud::SecurityCenterManagement::V1::SecurityCenterManagement::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.create_security_health_analytics_custom_module({ parent: parent, security_health_analytics_custom_module: security_health_analytics_custom_module, validate_only: validate_only }) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use named arguments + client.create_security_health_analytics_custom_module parent: parent, security_health_analytics_custom_module: security_health_analytics_custom_module, validate_only: validate_only do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.create_security_health_analytics_custom_module ::Google::Cloud::SecurityCenterManagement::V1::CreateSecurityHealthAnalyticsCustomModuleRequest.new(parent: parent, security_health_analytics_custom_module: security_health_analytics_custom_module, validate_only: validate_only) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use hash object with options + client.create_security_health_analytics_custom_module({ parent: parent, security_health_analytics_custom_module: security_health_analytics_custom_module, validate_only: validate_only }, grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object with options + client.create_security_health_analytics_custom_module(::Google::Cloud::SecurityCenterManagement::V1::CreateSecurityHealthAnalyticsCustomModuleRequest.new(parent: parent, security_health_analytics_custom_module: security_health_analytics_custom_module, validate_only: validate_only), grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Verify method calls + assert_equal 5, create_security_health_analytics_custom_module_client_stub.call_rpc_count + end + end + + def test_update_security_health_analytics_custom_module + # Create GRPC objects. + grpc_response = ::Google::Cloud::SecurityCenterManagement::V1::SecurityHealthAnalyticsCustomModule.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. + update_mask = {} + security_health_analytics_custom_module = {} + validate_only = true + + update_security_health_analytics_custom_module_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :update_security_health_analytics_custom_module, name + assert_kind_of ::Google::Cloud::SecurityCenterManagement::V1::UpdateSecurityHealthAnalyticsCustomModuleRequest, request + assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Protobuf::FieldMask), request["update_mask"] + assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::SecurityCenterManagement::V1::SecurityHealthAnalyticsCustomModule), request["security_health_analytics_custom_module"] + assert_equal true, request["validate_only"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, update_security_health_analytics_custom_module_client_stub do + # Create client + client = ::Google::Cloud::SecurityCenterManagement::V1::SecurityCenterManagement::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.update_security_health_analytics_custom_module({ update_mask: update_mask, security_health_analytics_custom_module: security_health_analytics_custom_module, validate_only: validate_only }) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use named arguments + client.update_security_health_analytics_custom_module update_mask: update_mask, security_health_analytics_custom_module: security_health_analytics_custom_module, validate_only: validate_only do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.update_security_health_analytics_custom_module ::Google::Cloud::SecurityCenterManagement::V1::UpdateSecurityHealthAnalyticsCustomModuleRequest.new(update_mask: update_mask, security_health_analytics_custom_module: security_health_analytics_custom_module, validate_only: validate_only) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use hash object with options + client.update_security_health_analytics_custom_module({ update_mask: update_mask, security_health_analytics_custom_module: security_health_analytics_custom_module, validate_only: validate_only }, grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object with options + client.update_security_health_analytics_custom_module(::Google::Cloud::SecurityCenterManagement::V1::UpdateSecurityHealthAnalyticsCustomModuleRequest.new(update_mask: update_mask, security_health_analytics_custom_module: security_health_analytics_custom_module, validate_only: validate_only), grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Verify method calls + assert_equal 5, update_security_health_analytics_custom_module_client_stub.call_rpc_count + end + end + + def test_delete_security_health_analytics_custom_module + # 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" + validate_only = true + + delete_security_health_analytics_custom_module_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :delete_security_health_analytics_custom_module, name + assert_kind_of ::Google::Cloud::SecurityCenterManagement::V1::DeleteSecurityHealthAnalyticsCustomModuleRequest, request + assert_equal "hello world", request["name"] + assert_equal true, request["validate_only"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, delete_security_health_analytics_custom_module_client_stub do + # Create client + client = ::Google::Cloud::SecurityCenterManagement::V1::SecurityCenterManagement::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.delete_security_health_analytics_custom_module({ name: name, validate_only: validate_only }) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use named arguments + client.delete_security_health_analytics_custom_module name: name, validate_only: validate_only do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.delete_security_health_analytics_custom_module ::Google::Cloud::SecurityCenterManagement::V1::DeleteSecurityHealthAnalyticsCustomModuleRequest.new(name: name, validate_only: validate_only) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use hash object with options + client.delete_security_health_analytics_custom_module({ name: name, validate_only: validate_only }, grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object with options + client.delete_security_health_analytics_custom_module(::Google::Cloud::SecurityCenterManagement::V1::DeleteSecurityHealthAnalyticsCustomModuleRequest.new(name: name, validate_only: validate_only), grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Verify method calls + assert_equal 5, delete_security_health_analytics_custom_module_client_stub.call_rpc_count + end + end + + def test_simulate_security_health_analytics_custom_module + # Create GRPC objects. + grpc_response = ::Google::Cloud::SecurityCenterManagement::V1::SimulateSecurityHealthAnalyticsCustomModuleResponse.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" + custom_config = {} + resource = {} + + simulate_security_health_analytics_custom_module_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :simulate_security_health_analytics_custom_module, name + assert_kind_of ::Google::Cloud::SecurityCenterManagement::V1::SimulateSecurityHealthAnalyticsCustomModuleRequest, request + assert_equal "hello world", request["parent"] + assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::SecurityCenterManagement::V1::CustomConfig), request["custom_config"] + assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::SecurityCenterManagement::V1::SimulateSecurityHealthAnalyticsCustomModuleRequest::SimulatedResource), request["resource"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, simulate_security_health_analytics_custom_module_client_stub do + # Create client + client = ::Google::Cloud::SecurityCenterManagement::V1::SecurityCenterManagement::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.simulate_security_health_analytics_custom_module({ parent: parent, custom_config: custom_config, resource: resource }) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use named arguments + client.simulate_security_health_analytics_custom_module parent: parent, custom_config: custom_config, resource: resource do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.simulate_security_health_analytics_custom_module ::Google::Cloud::SecurityCenterManagement::V1::SimulateSecurityHealthAnalyticsCustomModuleRequest.new(parent: parent, custom_config: custom_config, resource: resource) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use hash object with options + client.simulate_security_health_analytics_custom_module({ parent: parent, custom_config: custom_config, resource: resource }, grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object with options + client.simulate_security_health_analytics_custom_module(::Google::Cloud::SecurityCenterManagement::V1::SimulateSecurityHealthAnalyticsCustomModuleRequest.new(parent: parent, custom_config: custom_config, resource: resource), grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Verify method calls + assert_equal 5, simulate_security_health_analytics_custom_module_client_stub.call_rpc_count + end + end + + def test_list_effective_event_threat_detection_custom_modules + # Create GRPC objects. + grpc_response = ::Google::Cloud::SecurityCenterManagement::V1::ListEffectiveEventThreatDetectionCustomModulesResponse.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_effective_event_threat_detection_custom_modules_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :list_effective_event_threat_detection_custom_modules, name + assert_kind_of ::Google::Cloud::SecurityCenterManagement::V1::ListEffectiveEventThreatDetectionCustomModulesRequest, 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_effective_event_threat_detection_custom_modules_client_stub do + # Create client + client = ::Google::Cloud::SecurityCenterManagement::V1::SecurityCenterManagement::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.list_effective_event_threat_detection_custom_modules({ 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_effective_event_threat_detection_custom_modules 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_effective_event_threat_detection_custom_modules ::Google::Cloud::SecurityCenterManagement::V1::ListEffectiveEventThreatDetectionCustomModulesRequest.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_effective_event_threat_detection_custom_modules({ 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_effective_event_threat_detection_custom_modules(::Google::Cloud::SecurityCenterManagement::V1::ListEffectiveEventThreatDetectionCustomModulesRequest.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_effective_event_threat_detection_custom_modules_client_stub.call_rpc_count + end + end + + def test_get_effective_event_threat_detection_custom_module + # Create GRPC objects. + grpc_response = ::Google::Cloud::SecurityCenterManagement::V1::EffectiveEventThreatDetectionCustomModule.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_effective_event_threat_detection_custom_module_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :get_effective_event_threat_detection_custom_module, name + assert_kind_of ::Google::Cloud::SecurityCenterManagement::V1::GetEffectiveEventThreatDetectionCustomModuleRequest, request + assert_equal "hello world", request["name"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, get_effective_event_threat_detection_custom_module_client_stub do + # Create client + client = ::Google::Cloud::SecurityCenterManagement::V1::SecurityCenterManagement::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.get_effective_event_threat_detection_custom_module({ name: name }) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use named arguments + client.get_effective_event_threat_detection_custom_module name: name do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.get_effective_event_threat_detection_custom_module ::Google::Cloud::SecurityCenterManagement::V1::GetEffectiveEventThreatDetectionCustomModuleRequest.new(name: name) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use hash object with options + client.get_effective_event_threat_detection_custom_module({ 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_effective_event_threat_detection_custom_module(::Google::Cloud::SecurityCenterManagement::V1::GetEffectiveEventThreatDetectionCustomModuleRequest.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_effective_event_threat_detection_custom_module_client_stub.call_rpc_count + end + end + + def test_list_event_threat_detection_custom_modules + # Create GRPC objects. + grpc_response = ::Google::Cloud::SecurityCenterManagement::V1::ListEventThreatDetectionCustomModulesResponse.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_event_threat_detection_custom_modules_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :list_event_threat_detection_custom_modules, name + assert_kind_of ::Google::Cloud::SecurityCenterManagement::V1::ListEventThreatDetectionCustomModulesRequest, 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_event_threat_detection_custom_modules_client_stub do + # Create client + client = ::Google::Cloud::SecurityCenterManagement::V1::SecurityCenterManagement::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.list_event_threat_detection_custom_modules({ 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_event_threat_detection_custom_modules 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_event_threat_detection_custom_modules ::Google::Cloud::SecurityCenterManagement::V1::ListEventThreatDetectionCustomModulesRequest.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_event_threat_detection_custom_modules({ 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_event_threat_detection_custom_modules(::Google::Cloud::SecurityCenterManagement::V1::ListEventThreatDetectionCustomModulesRequest.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_event_threat_detection_custom_modules_client_stub.call_rpc_count + end + end + + def test_list_descendant_event_threat_detection_custom_modules + # Create GRPC objects. + grpc_response = ::Google::Cloud::SecurityCenterManagement::V1::ListDescendantEventThreatDetectionCustomModulesResponse.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_descendant_event_threat_detection_custom_modules_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :list_descendant_event_threat_detection_custom_modules, name + assert_kind_of ::Google::Cloud::SecurityCenterManagement::V1::ListDescendantEventThreatDetectionCustomModulesRequest, 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_descendant_event_threat_detection_custom_modules_client_stub do + # Create client + client = ::Google::Cloud::SecurityCenterManagement::V1::SecurityCenterManagement::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.list_descendant_event_threat_detection_custom_modules({ 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_descendant_event_threat_detection_custom_modules 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_descendant_event_threat_detection_custom_modules ::Google::Cloud::SecurityCenterManagement::V1::ListDescendantEventThreatDetectionCustomModulesRequest.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_descendant_event_threat_detection_custom_modules({ 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_descendant_event_threat_detection_custom_modules(::Google::Cloud::SecurityCenterManagement::V1::ListDescendantEventThreatDetectionCustomModulesRequest.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_descendant_event_threat_detection_custom_modules_client_stub.call_rpc_count + end + end + + def test_get_event_threat_detection_custom_module + # Create GRPC objects. + grpc_response = ::Google::Cloud::SecurityCenterManagement::V1::EventThreatDetectionCustomModule.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_event_threat_detection_custom_module_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :get_event_threat_detection_custom_module, name + assert_kind_of ::Google::Cloud::SecurityCenterManagement::V1::GetEventThreatDetectionCustomModuleRequest, request + assert_equal "hello world", request["name"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, get_event_threat_detection_custom_module_client_stub do + # Create client + client = ::Google::Cloud::SecurityCenterManagement::V1::SecurityCenterManagement::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.get_event_threat_detection_custom_module({ name: name }) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use named arguments + client.get_event_threat_detection_custom_module name: name do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.get_event_threat_detection_custom_module ::Google::Cloud::SecurityCenterManagement::V1::GetEventThreatDetectionCustomModuleRequest.new(name: name) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use hash object with options + client.get_event_threat_detection_custom_module({ 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_event_threat_detection_custom_module(::Google::Cloud::SecurityCenterManagement::V1::GetEventThreatDetectionCustomModuleRequest.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_event_threat_detection_custom_module_client_stub.call_rpc_count + end + end + + def test_create_event_threat_detection_custom_module + # Create GRPC objects. + grpc_response = ::Google::Cloud::SecurityCenterManagement::V1::EventThreatDetectionCustomModule.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" + event_threat_detection_custom_module = {} + validate_only = true + + create_event_threat_detection_custom_module_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :create_event_threat_detection_custom_module, name + assert_kind_of ::Google::Cloud::SecurityCenterManagement::V1::CreateEventThreatDetectionCustomModuleRequest, request + assert_equal "hello world", request["parent"] + assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::SecurityCenterManagement::V1::EventThreatDetectionCustomModule), request["event_threat_detection_custom_module"] + assert_equal true, request["validate_only"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, create_event_threat_detection_custom_module_client_stub do + # Create client + client = ::Google::Cloud::SecurityCenterManagement::V1::SecurityCenterManagement::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.create_event_threat_detection_custom_module({ parent: parent, event_threat_detection_custom_module: event_threat_detection_custom_module, validate_only: validate_only }) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use named arguments + client.create_event_threat_detection_custom_module parent: parent, event_threat_detection_custom_module: event_threat_detection_custom_module, validate_only: validate_only do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.create_event_threat_detection_custom_module ::Google::Cloud::SecurityCenterManagement::V1::CreateEventThreatDetectionCustomModuleRequest.new(parent: parent, event_threat_detection_custom_module: event_threat_detection_custom_module, validate_only: validate_only) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use hash object with options + client.create_event_threat_detection_custom_module({ parent: parent, event_threat_detection_custom_module: event_threat_detection_custom_module, validate_only: validate_only }, grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object with options + client.create_event_threat_detection_custom_module(::Google::Cloud::SecurityCenterManagement::V1::CreateEventThreatDetectionCustomModuleRequest.new(parent: parent, event_threat_detection_custom_module: event_threat_detection_custom_module, validate_only: validate_only), grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Verify method calls + assert_equal 5, create_event_threat_detection_custom_module_client_stub.call_rpc_count + end + end + + def test_update_event_threat_detection_custom_module + # Create GRPC objects. + grpc_response = ::Google::Cloud::SecurityCenterManagement::V1::EventThreatDetectionCustomModule.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. + update_mask = {} + event_threat_detection_custom_module = {} + validate_only = true + + update_event_threat_detection_custom_module_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :update_event_threat_detection_custom_module, name + assert_kind_of ::Google::Cloud::SecurityCenterManagement::V1::UpdateEventThreatDetectionCustomModuleRequest, request + assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Protobuf::FieldMask), request["update_mask"] + assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::SecurityCenterManagement::V1::EventThreatDetectionCustomModule), request["event_threat_detection_custom_module"] + assert_equal true, request["validate_only"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, update_event_threat_detection_custom_module_client_stub do + # Create client + client = ::Google::Cloud::SecurityCenterManagement::V1::SecurityCenterManagement::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.update_event_threat_detection_custom_module({ update_mask: update_mask, event_threat_detection_custom_module: event_threat_detection_custom_module, validate_only: validate_only }) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use named arguments + client.update_event_threat_detection_custom_module update_mask: update_mask, event_threat_detection_custom_module: event_threat_detection_custom_module, validate_only: validate_only do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.update_event_threat_detection_custom_module ::Google::Cloud::SecurityCenterManagement::V1::UpdateEventThreatDetectionCustomModuleRequest.new(update_mask: update_mask, event_threat_detection_custom_module: event_threat_detection_custom_module, validate_only: validate_only) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use hash object with options + client.update_event_threat_detection_custom_module({ update_mask: update_mask, event_threat_detection_custom_module: event_threat_detection_custom_module, validate_only: validate_only }, grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object with options + client.update_event_threat_detection_custom_module(::Google::Cloud::SecurityCenterManagement::V1::UpdateEventThreatDetectionCustomModuleRequest.new(update_mask: update_mask, event_threat_detection_custom_module: event_threat_detection_custom_module, validate_only: validate_only), grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Verify method calls + assert_equal 5, update_event_threat_detection_custom_module_client_stub.call_rpc_count + end + end + + def test_delete_event_threat_detection_custom_module + # 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" + validate_only = true + + delete_event_threat_detection_custom_module_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :delete_event_threat_detection_custom_module, name + assert_kind_of ::Google::Cloud::SecurityCenterManagement::V1::DeleteEventThreatDetectionCustomModuleRequest, request + assert_equal "hello world", request["name"] + assert_equal true, request["validate_only"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, delete_event_threat_detection_custom_module_client_stub do + # Create client + client = ::Google::Cloud::SecurityCenterManagement::V1::SecurityCenterManagement::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.delete_event_threat_detection_custom_module({ name: name, validate_only: validate_only }) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use named arguments + client.delete_event_threat_detection_custom_module name: name, validate_only: validate_only do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.delete_event_threat_detection_custom_module ::Google::Cloud::SecurityCenterManagement::V1::DeleteEventThreatDetectionCustomModuleRequest.new(name: name, validate_only: validate_only) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use hash object with options + client.delete_event_threat_detection_custom_module({ name: name, validate_only: validate_only }, grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object with options + client.delete_event_threat_detection_custom_module(::Google::Cloud::SecurityCenterManagement::V1::DeleteEventThreatDetectionCustomModuleRequest.new(name: name, validate_only: validate_only), grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Verify method calls + assert_equal 5, delete_event_threat_detection_custom_module_client_stub.call_rpc_count + end + end + + def test_validate_event_threat_detection_custom_module + # Create GRPC objects. + grpc_response = ::Google::Cloud::SecurityCenterManagement::V1::ValidateEventThreatDetectionCustomModuleResponse.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" + raw_text = "hello world" + type = "hello world" + + validate_event_threat_detection_custom_module_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :validate_event_threat_detection_custom_module, name + assert_kind_of ::Google::Cloud::SecurityCenterManagement::V1::ValidateEventThreatDetectionCustomModuleRequest, request + assert_equal "hello world", request["parent"] + assert_equal "hello world", request["raw_text"] + assert_equal "hello world", request["type"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, validate_event_threat_detection_custom_module_client_stub do + # Create client + client = ::Google::Cloud::SecurityCenterManagement::V1::SecurityCenterManagement::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.validate_event_threat_detection_custom_module({ parent: parent, raw_text: raw_text, type: type }) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use named arguments + client.validate_event_threat_detection_custom_module parent: parent, raw_text: raw_text, type: type do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.validate_event_threat_detection_custom_module ::Google::Cloud::SecurityCenterManagement::V1::ValidateEventThreatDetectionCustomModuleRequest.new(parent: parent, raw_text: raw_text, type: type) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use hash object with options + client.validate_event_threat_detection_custom_module({ parent: parent, raw_text: raw_text, type: type }, grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object with options + client.validate_event_threat_detection_custom_module(::Google::Cloud::SecurityCenterManagement::V1::ValidateEventThreatDetectionCustomModuleRequest.new(parent: parent, raw_text: raw_text, type: type), grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Verify method calls + assert_equal 5, validate_event_threat_detection_custom_module_client_stub.call_rpc_count + end + end + + def test_get_security_center_service + # Create GRPC objects. + grpc_response = ::Google::Cloud::SecurityCenterManagement::V1::SecurityCenterService.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" + show_eligible_modules_only = true + + get_security_center_service_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :get_security_center_service, name + assert_kind_of ::Google::Cloud::SecurityCenterManagement::V1::GetSecurityCenterServiceRequest, request + assert_equal "hello world", request["name"] + assert_equal true, request["show_eligible_modules_only"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, get_security_center_service_client_stub do + # Create client + client = ::Google::Cloud::SecurityCenterManagement::V1::SecurityCenterManagement::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.get_security_center_service({ name: name, show_eligible_modules_only: show_eligible_modules_only }) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use named arguments + client.get_security_center_service name: name, show_eligible_modules_only: show_eligible_modules_only do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.get_security_center_service ::Google::Cloud::SecurityCenterManagement::V1::GetSecurityCenterServiceRequest.new(name: name, show_eligible_modules_only: show_eligible_modules_only) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use hash object with options + client.get_security_center_service({ name: name, show_eligible_modules_only: show_eligible_modules_only }, grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object with options + client.get_security_center_service(::Google::Cloud::SecurityCenterManagement::V1::GetSecurityCenterServiceRequest.new(name: name, show_eligible_modules_only: show_eligible_modules_only), grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Verify method calls + assert_equal 5, get_security_center_service_client_stub.call_rpc_count + end + end + + def test_list_security_center_services + # Create GRPC objects. + grpc_response = ::Google::Cloud::SecurityCenterManagement::V1::ListSecurityCenterServicesResponse.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" + show_eligible_modules_only = true + + list_security_center_services_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :list_security_center_services, name + assert_kind_of ::Google::Cloud::SecurityCenterManagement::V1::ListSecurityCenterServicesRequest, request + assert_equal "hello world", request["parent"] + assert_equal 42, request["page_size"] + assert_equal "hello world", request["page_token"] + assert_equal true, request["show_eligible_modules_only"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, list_security_center_services_client_stub do + # Create client + client = ::Google::Cloud::SecurityCenterManagement::V1::SecurityCenterManagement::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.list_security_center_services({ parent: parent, page_size: page_size, page_token: page_token, show_eligible_modules_only: show_eligible_modules_only }) 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_security_center_services parent: parent, page_size: page_size, page_token: page_token, show_eligible_modules_only: show_eligible_modules_only 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_security_center_services ::Google::Cloud::SecurityCenterManagement::V1::ListSecurityCenterServicesRequest.new(parent: parent, page_size: page_size, page_token: page_token, show_eligible_modules_only: show_eligible_modules_only) 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_security_center_services({ parent: parent, page_size: page_size, page_token: page_token, show_eligible_modules_only: show_eligible_modules_only }, 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_security_center_services(::Google::Cloud::SecurityCenterManagement::V1::ListSecurityCenterServicesRequest.new(parent: parent, page_size: page_size, page_token: page_token, show_eligible_modules_only: show_eligible_modules_only), 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_security_center_services_client_stub.call_rpc_count + end + end + + def test_update_security_center_service + # Create GRPC objects. + grpc_response = ::Google::Cloud::SecurityCenterManagement::V1::SecurityCenterService.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. + security_center_service = {} + update_mask = {} + validate_only = true + + update_security_center_service_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :update_security_center_service, name + assert_kind_of ::Google::Cloud::SecurityCenterManagement::V1::UpdateSecurityCenterServiceRequest, request + assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::SecurityCenterManagement::V1::SecurityCenterService), request["security_center_service"] + assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Protobuf::FieldMask), request["update_mask"] + assert_equal true, request["validate_only"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, update_security_center_service_client_stub do + # Create client + client = ::Google::Cloud::SecurityCenterManagement::V1::SecurityCenterManagement::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.update_security_center_service({ security_center_service: security_center_service, update_mask: update_mask, validate_only: validate_only }) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use named arguments + client.update_security_center_service security_center_service: security_center_service, update_mask: update_mask, validate_only: validate_only do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.update_security_center_service ::Google::Cloud::SecurityCenterManagement::V1::UpdateSecurityCenterServiceRequest.new(security_center_service: security_center_service, update_mask: update_mask, validate_only: validate_only) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use hash object with options + client.update_security_center_service({ security_center_service: security_center_service, update_mask: update_mask, validate_only: validate_only }, grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object with options + client.update_security_center_service(::Google::Cloud::SecurityCenterManagement::V1::UpdateSecurityCenterServiceRequest.new(security_center_service: security_center_service, update_mask: update_mask, validate_only: validate_only), grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Verify method calls + assert_equal 5, update_security_center_service_client_stub.call_rpc_count + end + end + + def test_configure + grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + + client = block_config = config = nil + dummy_stub = ClientStub.new nil, nil + Gapic::ServiceStub.stub :new, dummy_stub do + client = ::Google::Cloud::SecurityCenterManagement::V1::SecurityCenterManagement::Client.new do |config| + config.credentials = grpc_channel + end + end + + config = client.configure do |c| + block_config = c + end + + assert_same block_config, config + assert_kind_of ::Google::Cloud::SecurityCenterManagement::V1::SecurityCenterManagement::Client::Configuration, config + end + + def test_credentials + key = OpenSSL::PKey::RSA.new 2048 + cred_json = { + "private_key" => key.to_pem, + "client_email" => "app@developer.gserviceaccount.com", + "type" => "service_account" + } + key_file = StringIO.new cred_json.to_json + creds = Google::Auth::ServiceAccountCredentials.make_creds({ json_key_io: key_file }) + + dummy_stub = ClientStub.new nil, nil + Gapic::ServiceStub.stub :new, dummy_stub do + client = ::Google::Cloud::SecurityCenterManagement::V1::SecurityCenterManagement::Client.new do |config| + config.credentials = creds + end + assert_kind_of ::Google::Cloud::SecurityCenterManagement::V1::SecurityCenterManagement::Client, client + assert_equal creds, client.configure.credentials + end + end +end diff --git a/owl-bot-staging/google-cloud-security_center_management-v1/test/helper.rb b/owl-bot-staging/google-cloud-security_center_management-v1/test/helper.rb new file mode 100644 index 000000000000..672b337030e7 --- /dev/null +++ b/owl-bot-staging/google-cloud-security_center_management-v1/test/helper.rb @@ -0,0 +1,26 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +require "minitest/autorun" +require "minitest/focus" +require "minitest/mock" +require "minitest/rg" + +require "grpc" + +require "ostruct" From bc9df2d12252e6b945e8257e46897f7b9b05b217 Mon Sep 17 00:00:00 2001 From: Owl Bot Date: Wed, 25 Mar 2026 21:23:39 +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 --- .../proto_docs/google/api/client.rb | 174 +- .../proto_docs/google/api/client.rb | 174 +- .../proto_docs/google/api/client.rb | 174 +- .../proto_docs/google/api/client.rb | 174 +- .../proto_docs/google/api/client.rb | 174 +- .../proto_docs/google/api/client.rb | 174 +- .../proto_docs/google/api/client.rb | 174 +- .../proto_docs/google/api/client.rb | 174 +- .../proto_docs/google/api/client.rb | 174 +- .../proto_docs/google/api/client.rb | 174 +- .../proto_docs/google/api/client.rb | 174 +- .../proto_docs/google/api/client.rb | 174 +- .../proto_docs/google/api/client.rb | 174 +- .../proto_docs/google/api/client.rb | 174 +- .../proto_docs/google/api/client.rb | 174 +- .../proto_docs/google/api/client.rb | 174 +- .../proto_docs/google/api/client.rb | 174 +- .../proto_docs/google/api/client.rb | 174 +- .../proto_docs/google/api/client.rb | 174 +- .../proto_docs/google/api/routing.rb | 10 +- .../proto_docs/google/api/client.rb | 174 +- .../.gitignore | 22 - .../.repo-metadata.json | 17 - .../.rubocop.yml | 33 - .../.toys.rb | 28 - .../.yardopts | 12 - .../AUTHENTICATION.md | 122 - .../CHANGELOG.md | 2 - .../Gemfile | 14 - .../LICENSE.md | 201 - .../README.md | 153 - .../Rakefile | 169 - .../gapic_metadata.json | 88 - ...google-cloud-redis-cluster-v1beta1.gemspec | 29 - .../lib/google-cloud-redis-cluster-v1beta1.rb | 21 - .../lib/google/cloud/redis/cluster/v1beta1.rb | 47 - .../cluster/v1beta1/bindings_override.rb | 77 - .../cluster/v1beta1/cloud_redis_cluster.rb | 72 - .../v1beta1/cloud_redis_cluster/client.rb | 1958 ----- .../cloud_redis_cluster/credentials.rb | 49 - .../v1beta1/cloud_redis_cluster/operations.rb | 843 -- .../v1beta1/cloud_redis_cluster/paths.rb | 229 - .../v1beta1/cloud_redis_cluster/rest.rb | 70 - .../cloud_redis_cluster/rest/client.rb | 1825 ---- .../cloud_redis_cluster/rest/operations.rb | 926 -- .../cloud_redis_cluster/rest/service_stub.rb | 942 --- .../cluster/v1beta1/cloud_redis_cluster_pb.rb | 102 - .../cloud_redis_cluster_services_pb.rb | 122 - .../cloud/redis/cluster/v1beta1/rest.rb | 40 - .../cloud/redis/cluster/v1beta1/version.rb | 30 - .../proto_docs/README.md | 4 - .../proto_docs/google/api/client.rb | 589 -- .../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 - .../cluster/v1beta1/cloud_redis_cluster.rb | 1301 --- .../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/dayofweek.rb | 49 - .../proto_docs/google/type/timeofday.rb | 45 - .../snippets/Gemfile | 32 - .../cloud_redis_cluster/backup_cluster.rb | 54 - .../cloud_redis_cluster/create_cluster.rb | 54 - .../cloud_redis_cluster/delete_backup.rb | 54 - .../cloud_redis_cluster/delete_cluster.rb | 54 - .../cloud_redis_cluster/export_backup.rb | 54 - .../cloud_redis_cluster/get_backup.rb | 47 - .../get_backup_collection.rb | 47 - .../cloud_redis_cluster/get_cluster.rb | 47 - .../get_cluster_certificate_authority.rb | 47 - .../list_backup_collections.rb | 51 - .../cloud_redis_cluster/list_backups.rb | 51 - .../cloud_redis_cluster/list_clusters.rb | 51 - .../reschedule_cluster_maintenance.rb | 54 - .../cloud_redis_cluster/update_cluster.rb | 54 - ...ta_google.cloud.redis.cluster.v1beta1.json | 575 -- .../cloud_redis_cluster_operations_test.rb | 400 - .../v1beta1/cloud_redis_cluster_paths_test.rb | 163 - .../v1beta1/cloud_redis_cluster_rest_test.rb | 873 -- .../v1beta1/cloud_redis_cluster_test.rb | 1018 --- .../test/helper.rb | 26 - .../google-cloud-redis-v1/.gitignore | 22 - .../google-cloud-redis-v1/.repo-metadata.json | 18 - .../google-cloud-redis-v1/.rubocop.yml | 33 - .../google-cloud-redis-v1/.toys.rb | 28 - .../google-cloud-redis-v1/.yardopts | 12 - .../google-cloud-redis-v1/AUTHENTICATION.md | 122 - .../google-cloud-redis-v1/CHANGELOG.md | 2 - owl-bot-staging/google-cloud-redis-v1/Gemfile | 14 - .../google-cloud-redis-v1/LICENSE.md | 201 - .../google-cloud-redis-v1/README.md | 153 - .../google-cloud-redis-v1/Rakefile | 169 - .../google-cloud-redis-v1/gapic_metadata.json | 73 - .../google-cloud-redis-v1.gemspec | 29 - .../lib/google-cloud-redis-v1.rb | 21 - .../lib/google/cloud/redis/v1.rb | 45 - .../cloud/redis/v1/bindings_override.rb | 75 - .../lib/google/cloud/redis/v1/cloud_redis.rb | 70 - .../cloud/redis/v1/cloud_redis/client.rb | 1649 ---- .../cloud/redis/v1/cloud_redis/credentials.rb | 51 - .../cloud/redis/v1/cloud_redis/operations.rb | 841 -- .../cloud/redis/v1/cloud_redis/paths.rb | 69 - .../google/cloud/redis/v1/cloud_redis/rest.rb | 68 - .../cloud/redis/v1/cloud_redis/rest/client.rb | 1537 ---- .../redis/v1/cloud_redis/rest/operations.rb | 924 -- .../redis/v1/cloud_redis/rest/service_stub.rb | 759 -- .../google/cloud/redis/v1/cloud_redis_pb.rb | 69 - .../cloud/redis/v1/cloud_redis_services_pb.rb | 120 - .../lib/google/cloud/redis/v1/rest.rb | 38 - .../lib/google/cloud/redis/v1/version.rb | 28 - .../proto_docs/README.md | 4 - .../proto_docs/google/api/client.rb | 589 -- .../proto_docs/google/api/field_behavior.rb | 85 - .../proto_docs/google/api/launch_stage.rb | 71 - .../proto_docs/google/api/resource.rb | 227 - .../google/cloud/redis/v1/cloud_redis.rb | 836 -- .../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/dayofweek.rb | 49 - .../proto_docs/google/type/timeofday.rb | 45 - .../google-cloud-redis-v1/snippets/Gemfile | 32 - .../snippets/cloud_redis/create_instance.rb | 54 - .../snippets/cloud_redis/delete_instance.rb | 54 - .../snippets/cloud_redis/export_instance.rb | 54 - .../snippets/cloud_redis/failover_instance.rb | 54 - .../snippets/cloud_redis/get_instance.rb | 47 - .../cloud_redis/get_instance_auth_string.rb | 47 - .../snippets/cloud_redis/import_instance.rb | 54 - .../snippets/cloud_redis/list_instances.rb | 51 - .../cloud_redis/reschedule_maintenance.rb | 54 - .../snippets/cloud_redis/update_instance.rb | 54 - .../snippets/cloud_redis/upgrade_instance.rb | 54 - ...nippet_metadata_google.cloud.redis.v1.json | 455 - .../redis/v1/cloud_redis_operations_test.rb | 400 - .../cloud/redis/v1/cloud_redis_paths_test.rb | 67 - .../cloud/redis/v1/cloud_redis_rest_test.rb | 704 -- .../google/cloud/redis/v1/cloud_redis_test.rb | 823 -- .../google-cloud-redis-v1/test/helper.rb | 26 - .../google-cloud-redis-v1beta1/.gitignore | 22 - .../.repo-metadata.json | 18 - .../google-cloud-redis-v1beta1/.rubocop.yml | 33 - .../google-cloud-redis-v1beta1/.toys.rb | 28 - .../google-cloud-redis-v1beta1/.yardopts | 12 - .../AUTHENTICATION.md | 122 - .../google-cloud-redis-v1beta1/CHANGELOG.md | 2 - .../google-cloud-redis-v1beta1/Gemfile | 14 - .../google-cloud-redis-v1beta1/LICENSE.md | 201 - .../google-cloud-redis-v1beta1/README.md | 153 - .../google-cloud-redis-v1beta1/Rakefile | 169 - .../gapic_metadata.json | 73 - .../google-cloud-redis-v1beta1.gemspec | 28 - .../lib/google-cloud-redis-v1beta1.rb | 21 - .../lib/google/cloud/redis/v1beta1.rb | 45 - .../google/cloud/redis/v1beta1/cloud_redis.rb | 70 - .../cloud/redis/v1beta1/cloud_redis/client.rb | 1629 ---- .../redis/v1beta1/cloud_redis/credentials.rb | 51 - .../redis/v1beta1/cloud_redis/operations.rb | 841 -- .../cloud/redis/v1beta1/cloud_redis/paths.rb | 69 - .../cloud/redis/v1beta1/cloud_redis/rest.rb | 67 - .../redis/v1beta1/cloud_redis/rest/client.rb | 1509 ---- .../v1beta1/cloud_redis/rest/operations.rb | 924 -- .../v1beta1/cloud_redis/rest/service_stub.rb | 759 -- .../cloud/redis/v1beta1/cloud_redis_pb.rb | 66 - .../redis/v1beta1/cloud_redis_services_pb.rb | 120 - .../lib/google/cloud/redis/v1beta1/rest.rb | 37 - .../lib/google/cloud/redis/v1beta1/version.rb | 28 - .../proto_docs/README.md | 4 - .../proto_docs/google/api/client.rb | 589 -- .../proto_docs/google/api/field_behavior.rb | 85 - .../proto_docs/google/api/launch_stage.rb | 71 - .../proto_docs/google/api/resource.rb | 227 - .../google/cloud/redis/v1beta1/cloud_redis.rb | 771 -- .../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/dayofweek.rb | 49 - .../proto_docs/google/type/timeofday.rb | 45 - .../snippets/Gemfile | 32 - .../snippets/cloud_redis/create_instance.rb | 54 - .../snippets/cloud_redis/delete_instance.rb | 54 - .../snippets/cloud_redis/export_instance.rb | 54 - .../snippets/cloud_redis/failover_instance.rb | 54 - .../snippets/cloud_redis/get_instance.rb | 47 - .../cloud_redis/get_instance_auth_string.rb | 47 - .../snippets/cloud_redis/import_instance.rb | 54 - .../snippets/cloud_redis/list_instances.rb | 51 - .../cloud_redis/reschedule_maintenance.rb | 54 - .../snippets/cloud_redis/update_instance.rb | 54 - .../snippets/cloud_redis/upgrade_instance.rb | 54 - ...t_metadata_google.cloud.redis.v1beta1.json | 455 - .../v1beta1/cloud_redis_operations_test.rb | 400 - .../redis/v1beta1/cloud_redis_paths_test.rb | 67 - .../redis/v1beta1/cloud_redis_rest_test.rb | 704 -- .../cloud/redis/v1beta1/cloud_redis_test.rb | 823 -- .../google-cloud-redis-v1beta1/test/helper.rb | 26 - .../.gitignore | 22 - .../.repo-metadata.json | 18 - .../.rubocop.yml | 33 - .../google-cloud-resource_manager-v3/.toys.rb | 28 - .../.yardopts | 12 - .../AUTHENTICATION.md | 122 - .../CHANGELOG.md | 2 - .../google-cloud-resource_manager-v3/Gemfile | 14 - .../LICENSE.md | 201 - .../README.md | 154 - .../google-cloud-resource_manager-v3/Rakefile | 169 - .../gapic_metadata.json | 332 - .../google-cloud-resource_manager-v3.gemspec | 29 - .../lib/google-cloud-resource_manager-v3.rb | 21 - .../lib/google/cloud/resource_manager/v3.rb | 51 - .../cloud/resource_manager/v3/folders.rb | 58 - .../resource_manager/v3/folders/client.rb | 1668 ---- .../v3/folders/credentials.rb | 52 - .../resource_manager/v3/folders/operations.rb | 841 -- .../resource_manager/v3/folders/paths.rb | 47 - .../cloud/resource_manager/v3/folders/rest.rb | 55 - .../v3/folders/rest/client.rb | 1572 ---- .../v3/folders/rest/operations.rb | 925 -- .../v3/folders/rest/service_stub.rb | 753 -- .../resource_manager/v3/organizations.rb | 55 - .../v3/organizations/client.rb | 923 -- .../v3/organizations/credentials.rb | 52 - .../v3/organizations/paths.rb | 47 - .../resource_manager/v3/organizations/rest.rb | 52 - .../v3/organizations/rest/client.rb | 853 -- .../v3/organizations/rest/service_stub.rb | 387 - .../cloud/resource_manager/v3/projects.rb | 56 - .../resource_manager/v3/projects/client.rb | 1685 ---- .../v3/projects/credentials.rb | 52 - .../v3/projects/operations.rb | 841 -- .../resource_manager/v3/projects/paths.rb | 47 - .../resource_manager/v3/projects/rest.rb | 53 - .../v3/projects/rest/client.rb | 1589 ---- .../v3/projects/rest/operations.rb | 925 -- .../v3/projects/rest/service_stub.rb | 753 -- .../google/cloud/resource_manager/v3/rest.rb | 43 - .../cloud/resource_manager/v3/tag_bindings.rb | 57 - .../v3/tag_bindings/client.rb | 808 -- .../v3/tag_bindings/credentials.rb | 52 - .../v3/tag_bindings/operations.rb | 841 -- .../resource_manager/v3/tag_bindings/paths.rb | 47 - .../resource_manager/v3/tag_bindings/rest.rb | 54 - .../v3/tag_bindings/rest/client.rb | 761 -- .../v3/tag_bindings/rest/operations.rb | 925 -- .../v3/tag_bindings/rest/service_stub.rb | 320 - .../cloud/resource_manager/v3/tag_holds.rb | 60 - .../resource_manager/v3/tag_holds/client.rb | 731 -- .../v3/tag_holds/credentials.rb | 52 - .../v3/tag_holds/operations.rb | 841 -- .../resource_manager/v3/tag_holds/paths.rb | 64 - .../resource_manager/v3/tag_holds/rest.rb | 57 - .../v3/tag_holds/rest/client.rb | 667 -- .../v3/tag_holds/rest/operations.rb | 925 -- .../v3/tag_holds/rest/service_stub.rb | 265 - .../cloud/resource_manager/v3/tag_keys.rb | 56 - .../resource_manager/v3/tag_keys/client.rb | 1333 --- .../v3/tag_keys/credentials.rb | 52 - .../v3/tag_keys/operations.rb | 841 -- .../resource_manager/v3/tag_keys/paths.rb | 47 - .../resource_manager/v3/tag_keys/rest.rb | 53 - .../v3/tag_keys/rest/client.rb | 1251 --- .../v3/tag_keys/rest/operations.rb | 925 -- .../v3/tag_keys/rest/service_stub.rb | 629 -- .../cloud/resource_manager/v3/tag_values.rb | 56 - .../resource_manager/v3/tag_values/client.rb | 1333 --- .../v3/tag_values/credentials.rb | 52 - .../v3/tag_values/operations.rb | 841 -- .../resource_manager/v3/tag_values/paths.rb | 47 - .../resource_manager/v3/tag_values/rest.rb | 53 - .../v3/tag_values/rest/client.rb | 1251 --- .../v3/tag_values/rest/operations.rb | 925 -- .../v3/tag_values/rest/service_stub.rb | 629 -- .../cloud/resource_manager/v3/version.rb | 28 - .../cloud/resourcemanager/v3/folders_pb.rb | 47 - .../resourcemanager/v3/folders_services_pb.rb | 172 - .../resourcemanager/v3/organizations_pb.rb | 35 - .../v3/organizations_services_pb.rb | 73 - .../cloud/resourcemanager/v3/projects_pb.rb | 47 - .../v3/projects_services_pb.rb | 190 - .../resourcemanager/v3/tag_bindings_pb.rb | 37 - .../v3/tag_bindings_services_pb.rb | 57 - .../cloud/resourcemanager/v3/tag_holds_pb.rb | 35 - .../v3/tag_holds_services_pb.rb | 54 - .../cloud/resourcemanager/v3/tag_keys_pb.rb | 42 - .../v3/tag_keys_services_pb.rb | 81 - .../cloud/resourcemanager/v3/tag_values_pb.rb | 41 - .../v3/tag_values_services_pb.rb | 81 - .../proto_docs/README.md | 4 - .../proto_docs/google/api/client.rb | 589 -- .../proto_docs/google/api/field_behavior.rb | 85 - .../proto_docs/google/api/launch_stage.rb | 71 - .../proto_docs/google/api/resource.rb | 227 - .../cloud/resourcemanager/v3/folders.rb | 315 - .../cloud/resourcemanager/v3/organizations.rb | 155 - .../cloud/resourcemanager/v3/projects.rb | 395 - .../cloud/resourcemanager/v3/tag_bindings.rb | 216 - .../cloud/resourcemanager/v3/tag_holds.rb | 161 - .../cloud/resourcemanager/v3/tag_keys.rb | 247 - .../cloud/resourcemanager/v3/tag_values.rb | 202 - .../proto_docs/google/iam/v1/iam_policy.rb | 87 - .../proto_docs/google/iam/v1/options.rb | 50 - .../proto_docs/google/iam/v1/policy.rb | 426 - .../google/longrunning/operations.rb | 191 - .../proto_docs/google/protobuf/any.rb | 145 - .../proto_docs/google/protobuf/duration.rb | 98 - .../proto_docs/google/protobuf/empty.rb | 34 - .../proto_docs/google/protobuf/field_mask.rb | 229 - .../proto_docs/google/protobuf/timestamp.rb | 127 - .../proto_docs/google/rpc/status.rb | 48 - .../proto_docs/google/type/expr.rb | 75 - .../snippets/Gemfile | 32 - .../snippets/folders/create_folder.rb | 54 - .../snippets/folders/delete_folder.rb | 54 - .../snippets/folders/get_folder.rb | 47 - .../snippets/folders/get_iam_policy.rb | 47 - .../snippets/folders/list_folders.rb | 51 - .../snippets/folders/move_folder.rb | 54 - .../snippets/folders/search_folders.rb | 51 - .../snippets/folders/set_iam_policy.rb | 47 - .../snippets/folders/test_iam_permissions.rb | 47 - .../snippets/folders/undelete_folder.rb | 54 - .../snippets/folders/update_folder.rb | 54 - .../snippets/organizations/get_iam_policy.rb | 47 - .../organizations/get_organization.rb | 47 - .../organizations/search_organizations.rb | 51 - .../snippets/organizations/set_iam_policy.rb | 47 - .../organizations/test_iam_permissions.rb | 47 - .../snippets/projects/create_project.rb | 54 - .../snippets/projects/delete_project.rb | 54 - .../snippets/projects/get_iam_policy.rb | 47 - .../snippets/projects/get_project.rb | 47 - .../snippets/projects/list_projects.rb | 51 - .../snippets/projects/move_project.rb | 54 - .../snippets/projects/search_projects.rb | 51 - .../snippets/projects/set_iam_policy.rb | 47 - .../snippets/projects/test_iam_permissions.rb | 47 - .../snippets/projects/undelete_project.rb | 54 - .../snippets/projects/update_project.rb | 54 - ...adata_google.cloud.resourcemanager.v3.json | 2095 ----- .../tag_bindings/create_tag_binding.rb | 54 - .../tag_bindings/delete_tag_binding.rb | 54 - .../tag_bindings/list_effective_tags.rb | 51 - .../tag_bindings/list_tag_bindings.rb | 51 - .../snippets/tag_holds/create_tag_hold.rb | 54 - .../snippets/tag_holds/delete_tag_hold.rb | 54 - .../snippets/tag_holds/list_tag_holds.rb | 51 - .../snippets/tag_keys/create_tag_key.rb | 54 - .../snippets/tag_keys/delete_tag_key.rb | 54 - .../snippets/tag_keys/get_iam_policy.rb | 47 - .../tag_keys/get_namespaced_tag_key.rb | 47 - .../snippets/tag_keys/get_tag_key.rb | 47 - .../snippets/tag_keys/list_tag_keys.rb | 51 - .../snippets/tag_keys/set_iam_policy.rb | 47 - .../snippets/tag_keys/test_iam_permissions.rb | 47 - .../snippets/tag_keys/update_tag_key.rb | 54 - .../snippets/tag_values/create_tag_value.rb | 54 - .../snippets/tag_values/delete_tag_value.rb | 54 - .../snippets/tag_values/get_iam_policy.rb | 47 - .../tag_values/get_namespaced_tag_value.rb | 47 - .../snippets/tag_values/get_tag_value.rb | 47 - .../snippets/tag_values/list_tag_values.rb | 51 - .../snippets/tag_values/set_iam_policy.rb | 47 - .../tag_values/test_iam_permissions.rb | 47 - .../snippets/tag_values/update_tag_value.rb | 54 - .../v3/folders_operations_test.rb | 400 - .../resource_manager/v3/folders_paths_test.rb | 55 - .../resource_manager/v3/folders_rest_test.rb | 704 -- .../cloud/resource_manager/v3/folders_test.rb | 813 -- .../v3/organizations_paths_test.rb | 55 - .../v3/organizations_rest_test.rb | 375 - .../resource_manager/v3/organizations_test.rb | 411 - .../v3/projects_operations_test.rb | 400 - .../v3/projects_paths_test.rb | 55 - .../resource_manager/v3/projects_rest_test.rb | 704 -- .../resource_manager/v3/projects_test.rb | 813 -- .../v3/tag_bindings_operations_test.rb | 400 - .../v3/tag_bindings_paths_test.rb | 55 - .../v3/tag_bindings_rest_test.rb | 320 - .../resource_manager/v3/tag_bindings_test.rb | 380 - .../v3/tag_holds_operations_test.rb | 400 - .../v3/tag_holds_paths_test.rb | 67 - .../v3/tag_holds_rest_test.rb | 267 - .../resource_manager/v3/tag_holds_test.rb | 319 - .../v3/tag_keys_operations_test.rb | 400 - .../v3/tag_keys_paths_test.rb | 55 - .../resource_manager/v3/tag_keys_rest_test.rb | 596 -- .../resource_manager/v3/tag_keys_test.rb | 682 -- .../v3/tag_values_operations_test.rb | 400 - .../v3/tag_values_paths_test.rb | 55 - .../v3/tag_values_rest_test.rb | 596 -- .../resource_manager/v3/tag_values_test.rb | 682 -- .../test/helper.rb | 26 - .../google-cloud-retail-v2/.gitignore | 22 - .../.repo-metadata.json | 18 - .../google-cloud-retail-v2/.rubocop.yml | 33 - .../google-cloud-retail-v2/.toys.rb | 28 - .../google-cloud-retail-v2/.yardopts | 12 - .../google-cloud-retail-v2/AUTHENTICATION.md | 122 - .../google-cloud-retail-v2/CHANGELOG.md | 2 - .../google-cloud-retail-v2/Gemfile | 14 - .../google-cloud-retail-v2/LICENSE.md | 201 - .../google-cloud-retail-v2/README.md | 154 - .../google-cloud-retail-v2/Rakefile | 169 - .../gapic_metadata.json | 412 - .../google-cloud-retail-v2.gemspec | 29 - .../lib/google-cloud-retail-v2.rb | 21 - .../lib/google/cloud/retail/v2.rb | 56 - .../cloud/retail/v2/analytics_service.rb | 56 - .../retail/v2/analytics_service/client.rb | 541 -- .../v2/analytics_service/credentials.rb | 51 - .../retail/v2/analytics_service/operations.rb | 841 -- .../cloud/retail/v2/analytics_service/rest.rb | 53 - .../v2/analytics_service/rest/client.rb | 491 -- .../v2/analytics_service/rest/operations.rb | 960 --- .../v2/analytics_service/rest/service_stub.rb | 143 - .../cloud/retail/v2/analytics_service_pb.rb | 27 - .../v2/analytics_service_services_pb.rb | 49 - .../lib/google/cloud/retail/v2/catalog_pb.rb | 42 - .../google/cloud/retail/v2/catalog_service.rb | 55 - .../cloud/retail/v2/catalog_service/client.rb | 1588 ---- .../retail/v2/catalog_service/credentials.rb | 51 - .../cloud/retail/v2/catalog_service/paths.rb | 128 - .../cloud/retail/v2/catalog_service/rest.rb | 52 - .../retail/v2/catalog_service/rest/client.rb | 1468 ---- .../v2/catalog_service/rest/service_stub.rb | 759 -- .../cloud/retail/v2/catalog_service_pb.rb | 42 - .../retail/v2/catalog_service_services_pb.rb | 125 - .../lib/google/cloud/retail/v2/common_pb.rb | 58 - .../cloud/retail/v2/completion_service.rb | 59 - .../retail/v2/completion_service/client.rb | 714 -- .../v2/completion_service/credentials.rb | 51 - .../v2/completion_service/operations.rb | 841 -- .../retail/v2/completion_service/paths.rb | 52 - .../retail/v2/completion_service/rest.rb | 56 - .../v2/completion_service/rest/client.rb | 657 -- .../v2/completion_service/rest/operations.rb | 960 --- .../completion_service/rest/service_stub.rb | 204 - .../cloud/retail/v2/completion_service_pb.rb | 33 - .../v2/completion_service_services_pb.rb | 61 - .../lib/google/cloud/retail/v2/control_pb.rb | 25 - .../google/cloud/retail/v2/control_service.rb | 55 - .../cloud/retail/v2/control_service/client.rb | 909 -- .../retail/v2/control_service/credentials.rb | 51 - .../cloud/retail/v2/control_service/paths.rb | 73 - .../cloud/retail/v2/control_service/rest.rb | 52 - .../retail/v2/control_service/rest/client.rb | 831 -- .../v2/control_service/rest/service_stub.rb | 388 - .../cloud/retail/v2/control_service_pb.rb | 34 - .../retail/v2/control_service_services_pb.rb | 65 - .../v2/conversational_search_service.rb | 59 - .../conversational_search_service/client.rb | 574 -- .../credentials.rb | 51 - .../v2/conversational_search_service/paths.rb | 54 - .../v2/conversational_search_service/rest.rb | 56 - .../rest/client.rb | 526 -- .../rest/service_stub.rb | 145 - .../v2/conversational_search_service_pb.rb | 41 - ...nversational_search_service_services_pb.rb | 52 - .../cloud/retail/v2/export_config_pb.rb | 35 - .../cloud/retail/v2/generative_question_pb.rb | 24 - .../retail/v2/generative_question_service.rb | 55 - .../v2/generative_question_service/client.rb | 877 -- .../credentials.rb | 51 - .../v2/generative_question_service/paths.rb | 52 - .../v2/generative_question_service/rest.rb | 52 - .../rest/client.rb | 799 -- .../rest/service_stub.rb | 389 - .../v2/generative_question_service_pb.rb | 34 - ...generative_question_service_services_pb.rb | 55 - .../cloud/retail/v2/import_config_pb.rb | 46 - .../lib/google/cloud/retail/v2/model_pb.rb | 34 - .../google/cloud/retail/v2/model_service.rb | 67 - .../cloud/retail/v2/model_service/client.rb | 1219 --- .../retail/v2/model_service/credentials.rb | 51 - .../retail/v2/model_service/operations.rb | 841 -- .../cloud/retail/v2/model_service/paths.rb | 73 - .../cloud/retail/v2/model_service/rest.rb | 64 - .../retail/v2/model_service/rest/client.rb | 1120 --- .../v2/model_service/rest/operations.rb | 960 --- .../v2/model_service/rest/service_stub.rb | 574 -- .../cloud/retail/v2/model_service_pb.rb | 41 - .../retail/v2/model_service_services_pb.rb | 73 - .../cloud/retail/v2/prediction_service.rb | 55 - .../retail/v2/prediction_service/client.rb | 621 -- .../v2/prediction_service/credentials.rb | 51 - .../retail/v2/prediction_service/paths.rb | 56 - .../retail/v2/prediction_service/rest.rb | 52 - .../v2/prediction_service/rest/client.rb | 571 -- .../prediction_service/rest/service_stub.rb | 151 - .../cloud/retail/v2/prediction_service_pb.rb | 30 - .../v2/prediction_service_services_pb.rb | 45 - .../lib/google/cloud/retail/v2/product_pb.rb | 32 - .../google/cloud/retail/v2/product_service.rb | 57 - .../cloud/retail/v2/product_service/client.rb | 2237 ----- .../retail/v2/product_service/credentials.rb | 51 - .../retail/v2/product_service/operations.rb | 841 -- .../cloud/retail/v2/product_service/paths.rb | 77 - .../cloud/retail/v2/product_service/rest.rb | 54 - .../retail/v2/product_service/rest/client.rb | 2110 ----- .../v2/product_service/rest/operations.rb | 960 --- .../v2/product_service/rest/service_stub.rb | 822 -- .../cloud/retail/v2/product_service_pb.rb | 54 - .../retail/v2/product_service_services_pb.rb | 248 - .../google/cloud/retail/v2/promotion_pb.rb | 21 - .../google/cloud/retail/v2/purge_config_pb.rb | 30 - .../lib/google/cloud/retail/v2/rest.rb | 48 - .../lib/google/cloud/retail/v2/safety_pb.rb | 26 - .../google/cloud/retail/v2/search_service.rb | 58 - .../cloud/retail/v2/search_service/client.rb | 787 -- .../retail/v2/search_service/credentials.rb | 51 - .../cloud/retail/v2/search_service/paths.rb | 54 - .../cloud/retail/v2/search_service/rest.rb | 55 - .../retail/v2/search_service/rest/client.rb | 737 -- .../v2/search_service/rest/service_stub.rb | 151 - .../cloud/retail/v2/search_service_pb.rb | 61 - .../retail/v2/search_service_services_pb.rb | 51 - .../cloud/retail/v2/serving_config_pb.rb | 27 - .../cloud/retail/v2/serving_config_service.rb | 55 - .../v2/serving_config_service/client.rb | 1100 --- .../v2/serving_config_service/credentials.rb | 51 - .../retail/v2/serving_config_service/paths.rb | 73 - .../retail/v2/serving_config_service/rest.rb | 52 - .../v2/serving_config_service/rest/client.rb | 1008 --- .../rest/service_stub.rb | 512 -- .../retail/v2/serving_config_service_pb.rb | 36 - .../v2/serving_config_service_services_pb.rb | 74 - .../google/cloud/retail/v2/user_event_pb.rb | 30 - .../cloud/retail/v2/user_event_service.rb | 56 - .../retail/v2/user_event_service/client.rb | 1006 --- .../v2/user_event_service/credentials.rb | 51 - .../v2/user_event_service/operations.rb | 841 -- .../retail/v2/user_event_service/paths.rb | 75 - .../retail/v2/user_event_service/rest.rb | 53 - .../v2/user_event_service/rest/client.rb | 928 -- .../v2/user_event_service/rest/operations.rb | 960 --- .../user_event_service/rest/service_stub.rb | 398 - .../cloud/retail/v2/user_event_service_pb.rb | 36 - .../v2/user_event_service_services_pb.rb | 75 - .../lib/google/cloud/retail/v2/version.rb | 28 - .../proto_docs/README.md | 4 - .../proto_docs/google/api/client.rb | 589 -- .../proto_docs/google/api/field_behavior.rb | 85 - .../proto_docs/google/api/httpbody.rb | 80 - .../proto_docs/google/api/launch_stage.rb | 71 - .../proto_docs/google/api/resource.rb | 227 - .../google/cloud/retail/v2/catalog.rb | 516 -- .../google/cloud/retail/v2/catalog_service.rb | 297 - .../google/cloud/retail/v2/common.rb | 1085 --- .../cloud/retail/v2/completion_service.rb | 230 - .../google/cloud/retail/v2/control.rb | 75 - .../google/cloud/retail/v2/control_service.rb | 122 - .../v2/conversational_search_service.rb | 358 - .../google/cloud/retail/v2/export_config.rb | 184 - .../cloud/retail/v2/generative_question.rb | 75 - .../retail/v2/generative_question_service.rb | 109 - .../google/cloud/retail/v2/import_config.rb | 404 - .../google/cloud/retail/v2/model.rb | 267 - .../google/cloud/retail/v2/model_service.rb | 172 - .../cloud/retail/v2/prediction_service.rb | 237 - .../google/cloud/retail/v2/product.rb | 588 -- .../google/cloud/retail/v2/product_service.rb | 653 -- .../google/cloud/retail/v2/promotion.rb | 43 - .../google/cloud/retail/v2/purge_config.rb | 178 - .../google/cloud/retail/v2/safety.rb | 96 - .../google/cloud/retail/v2/search_service.rb | 1301 --- .../google/cloud/retail/v2/serving_config.rb | 259 - .../cloud/retail/v2/serving_config_service.rb | 143 - .../google/cloud/retail/v2/user_event.rb | 364 - .../cloud/retail/v2/user_event_service.rb | 130 - .../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/struct.rb | 108 - .../proto_docs/google/protobuf/timestamp.rb | 127 - .../proto_docs/google/protobuf/wrappers.rb | 148 - .../proto_docs/google/rpc/status.rb | 48 - .../proto_docs/google/type/date.rb | 53 - .../google-cloud-retail-v2/snippets/Gemfile | 32 - .../export_analytics_metrics.rb | 54 - .../catalog_service/add_catalog_attribute.rb | 47 - .../catalog_service/get_attributes_config.rb | 47 - .../catalog_service/get_completion_config.rb | 47 - .../catalog_service/get_default_branch.rb | 47 - .../snippets/catalog_service/list_catalogs.rb | 51 - .../remove_catalog_attribute.rb | 47 - .../replace_catalog_attribute.rb | 47 - .../catalog_service/set_default_branch.rb | 47 - .../update_attributes_config.rb | 47 - .../catalog_service/update_catalog.rb | 47 - .../update_completion_config.rb | 47 - .../completion_service/complete_query.rb | 47 - .../import_completion_data.rb | 54 - .../control_service/create_control.rb | 47 - .../control_service/delete_control.rb | 47 - .../snippets/control_service/get_control.rb | 47 - .../snippets/control_service/list_controls.rb | 51 - .../control_service/update_control.rb | 47 - .../conversational_search.rb | 50 - ...atch_update_generative_question_configs.rb | 47 - ...get_generative_questions_feature_config.rb | 47 - .../list_generative_question_configs.rb | 47 - .../update_generative_question_config.rb | 47 - ...ate_generative_questions_feature_config.rb | 47 - .../snippets/model_service/create_model.rb | 54 - .../snippets/model_service/delete_model.rb | 47 - .../snippets/model_service/get_model.rb | 47 - .../snippets/model_service/list_models.rb | 51 - .../snippets/model_service/pause_model.rb | 47 - .../snippets/model_service/resume_model.rb | 47 - .../snippets/model_service/tune_model.rb | 54 - .../snippets/model_service/update_model.rb | 47 - .../snippets/prediction_service/predict.rb | 47 - .../product_service/add_fulfillment_places.rb | 54 - .../product_service/add_local_inventories.rb | 54 - .../product_service/create_product.rb | 47 - .../product_service/delete_product.rb | 47 - .../snippets/product_service/get_product.rb | 47 - .../product_service/import_products.rb | 54 - .../snippets/product_service/list_products.rb | 51 - .../product_service/purge_products.rb | 54 - .../remove_fulfillment_places.rb | 54 - .../remove_local_inventories.rb | 54 - .../snippets/product_service/set_inventory.rb | 54 - .../product_service/update_product.rb | 47 - .../snippets/search_service/search.rb | 51 - .../serving_config_service/add_control.rb | 47 - .../create_serving_config.rb | 47 - .../delete_serving_config.rb | 47 - .../get_serving_config.rb | 47 - .../list_serving_configs.rb | 51 - .../serving_config_service/remove_control.rb | 47 - .../update_serving_config.rb | 47 - ...ippet_metadata_google.cloud.retail.v2.json | 2375 ------ .../user_event_service/collect_user_event.rb | 47 - .../user_event_service/import_user_events.rb | 54 - .../user_event_service/purge_user_events.rb | 54 - .../user_event_service/rejoin_user_events.rb | 54 - .../user_event_service/write_user_event.rb | 47 - .../v2/analytics_service_operations_test.rb | 400 - .../retail/v2/analytics_service_rest_test.rb | 155 - .../cloud/retail/v2/analytics_service_test.rb | 185 - .../retail/v2/catalog_service_paths_test.rb | 103 - .../retail/v2/catalog_service_rest_test.rb | 705 -- .../cloud/retail/v2/catalog_service_test.rb | 771 -- .../v2/completion_service_operations_test.rb | 400 - .../v2/completion_service_paths_test.rb | 55 - .../retail/v2/completion_service_rest_test.rb | 217 - .../retail/v2/completion_service_test.rb | 259 - .../retail/v2/control_service_paths_test.rb | 67 - .../retail/v2/control_service_rest_test.rb | 375 - .../cloud/retail/v2/control_service_test.rb | 411 - ...onversational_search_service_paths_test.rb | 55 - ...conversational_search_service_rest_test.rb | 163 - .../v2/conversational_search_service_test.rb | 197 - .../generative_question_service_paths_test.rb | 55 - .../generative_question_service_rest_test.rb | 372 - .../v2/generative_question_service_test.rb | 400 - .../v2/model_service_operations_test.rb | 400 - .../retail/v2/model_service_paths_test.rb | 67 - .../retail/v2/model_service_rest_test.rb | 536 -- .../cloud/retail/v2/model_service_test.rb | 607 -- .../v2/prediction_service_paths_test.rb | 55 - .../retail/v2/prediction_service_rest_test.rb | 160 - .../retail/v2/prediction_service_test.rb | 176 - .../v2/product_service_operations_test.rb | 400 - .../retail/v2/product_service_paths_test.rb | 67 - .../retail/v2/product_service_rest_test.rb | 781 -- .../cloud/retail/v2/product_service_test.rb | 922 -- .../retail/v2/search_service_paths_test.rb | 55 - .../retail/v2/search_service_rest_test.rb | 180 - .../cloud/retail/v2/search_service_test.rb | 222 - .../v2/serving_config_service_paths_test.rb | 67 - .../v2/serving_config_service_rest_test.rb | 484 -- .../retail/v2/serving_config_service_test.rb | 529 -- .../v2/user_event_service_operations_test.rb | 400 - .../v2/user_event_service_paths_test.rb | 67 - .../retail/v2/user_event_service_rest_test.rb | 381 - .../retail/v2/user_event_service_test.rb | 448 - .../google-cloud-retail-v2/test/helper.rb | 26 - .../.gitignore | 22 - .../.repo-metadata.json | 17 - .../.rubocop.yml | 33 - .../.toys.rb | 28 - .../.yardopts | 12 - .../AUTHENTICATION.md | 122 - .../CHANGELOG.md | 2 - .../Gemfile | 14 - .../LICENSE.md | 201 - .../README.md | 154 - .../Rakefile | 169 - .../gapic_metadata.json | 227 - ...platform-saas_service_mgmt-v1beta1.gemspec | 29 - ...saas_platform-saas_service_mgmt-v1beta1.rb | 21 - .../saas_service_mgmt/v1beta1.rb | 48 - .../v1beta1/bindings_override.rb | 77 - .../saas_service_mgmt/v1beta1/rest.rb | 41 - .../v1beta1/saas_deployments.rb | 57 - .../v1beta1/saas_deployments/client.rb | 3802 --------- .../v1beta1/saas_deployments/credentials.rb | 49 - .../v1beta1/saas_deployments/paths.rb | 185 - .../v1beta1/saas_deployments/rest.rb | 55 - .../v1beta1/saas_deployments/rest/client.rb | 3557 -------- .../saas_deployments/rest/service_stub.rb | 1925 ----- .../v1beta1/saas_rollouts.rb | 57 - .../v1beta1/saas_rollouts/client.rb | 1534 ---- .../v1beta1/saas_rollouts/credentials.rb | 49 - .../v1beta1/saas_rollouts/paths.rb | 128 - .../v1beta1/saas_rollouts/rest.rb | 55 - .../v1beta1/saas_rollouts/rest/client.rb | 1429 ---- .../saas_rollouts/rest/service_stub.rb | 697 -- .../saas_service_mgmt/v1beta1/version.rb | 30 - .../saasservicemgmt/v1beta1/common_pb.rb | 36 - .../v1beta1/deployments_resources_pb.rb | 50 - .../v1beta1/deployments_service_pb.rb | 66 - .../deployments_service_services_pb.rb | 105 - .../v1beta1/rollouts_resources_pb.rb | 37 - .../v1beta1/rollouts_service_pb.rb | 42 - .../v1beta1/rollouts_service_services_pb.rb | 65 - .../proto_docs/README.md | 4 - .../proto_docs/google/api/client.rb | 589 -- .../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 - .../saasservicemgmt/v1beta1/common.rb | 237 - .../v1beta1/deployments_resources.rb | 837 -- .../v1beta1/deployments_service.rb | 976 --- .../v1beta1/rollouts_resources.rb | 389 - .../v1beta1/rollouts_service.rb | 344 - .../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 - .../snippets/Gemfile | 32 - .../saas_deployments/create_release.rb | 47 - .../snippets/saas_deployments/create_saas.rb | 47 - .../saas_deployments/create_tenant.rb | 47 - .../snippets/saas_deployments/create_unit.rb | 47 - .../saas_deployments/create_unit_kind.rb | 47 - .../saas_deployments/create_unit_operation.rb | 47 - .../saas_deployments/delete_release.rb | 47 - .../snippets/saas_deployments/delete_saas.rb | 47 - .../saas_deployments/delete_tenant.rb | 47 - .../snippets/saas_deployments/delete_unit.rb | 47 - .../saas_deployments/delete_unit_kind.rb | 47 - .../saas_deployments/delete_unit_operation.rb | 47 - .../snippets/saas_deployments/get_release.rb | 47 - .../snippets/saas_deployments/get_saas.rb | 47 - .../snippets/saas_deployments/get_tenant.rb | 47 - .../snippets/saas_deployments/get_unit.rb | 47 - .../saas_deployments/get_unit_kind.rb | 47 - .../saas_deployments/get_unit_operation.rb | 47 - .../saas_deployments/list_releases.rb | 51 - .../snippets/saas_deployments/list_saas.rb | 51 - .../snippets/saas_deployments/list_tenants.rb | 51 - .../saas_deployments/list_unit_kinds.rb | 51 - .../saas_deployments/list_unit_operations.rb | 51 - .../snippets/saas_deployments/list_units.rb | 51 - .../saas_deployments/update_release.rb | 47 - .../snippets/saas_deployments/update_saas.rb | 47 - .../saas_deployments/update_tenant.rb | 47 - .../snippets/saas_deployments/update_unit.rb | 47 - .../saas_deployments/update_unit_kind.rb | 47 - .../saas_deployments/update_unit_operation.rb | 47 - .../snippets/saas_rollouts/create_rollout.rb | 47 - .../saas_rollouts/create_rollout_kind.rb | 47 - .../snippets/saas_rollouts/delete_rollout.rb | 47 - .../saas_rollouts/delete_rollout_kind.rb | 47 - .../snippets/saas_rollouts/get_rollout.rb | 47 - .../saas_rollouts/get_rollout_kind.rb | 47 - .../saas_rollouts/list_rollout_kinds.rb | 51 - .../snippets/saas_rollouts/list_rollouts.rb | 51 - .../snippets/saas_rollouts/update_rollout.rb | 47 - .../saas_rollouts/update_rollout_kind.rb | 47 - ....saasplatform.saasservicemgmt.v1beta1.json | 1615 ---- .../v1beta1/saas_deployments_paths_test.rb | 139 - .../v1beta1/saas_deployments_rest_test.rb | 1803 ---- .../v1beta1/saas_deployments_test.rb | 2042 ----- .../v1beta1/saas_rollouts_paths_test.rb | 103 - .../v1beta1/saas_rollouts_rest_test.rb | 667 -- .../v1beta1/saas_rollouts_test.rb | 750 -- .../test/helper.rb | 26 - .../google-cloud-scheduler-v1/.gitignore | 22 - .../.repo-metadata.json | 18 - .../google-cloud-scheduler-v1/.rubocop.yml | 33 - .../google-cloud-scheduler-v1/.toys.rb | 28 - .../google-cloud-scheduler-v1/.yardopts | 12 - .../AUTHENTICATION.md | 122 - .../google-cloud-scheduler-v1/CHANGELOG.md | 2 - .../google-cloud-scheduler-v1/Gemfile | 14 - .../google-cloud-scheduler-v1/LICENSE.md | 201 - .../google-cloud-scheduler-v1/README.md | 154 - .../google-cloud-scheduler-v1/Rakefile | 169 - .../gapic_metadata.json | 58 - .../google-cloud-scheduler-v1.gemspec | 29 - .../lib/google-cloud-scheduler-v1.rb | 21 - .../lib/google/cloud/scheduler/v1.rb | 45 - .../cloud/scheduler/v1/bindings_override.rb | 75 - .../cloud/scheduler/v1/cloud_scheduler.rb | 56 - .../scheduler/v1/cloud_scheduler/client.rb | 1229 --- .../v1/cloud_scheduler/credentials.rb | 51 - .../scheduler/v1/cloud_scheduler/paths.rb | 86 - .../scheduler/v1/cloud_scheduler/rest.rb | 54 - .../v1/cloud_scheduler/rest/client.rb | 1138 --- .../v1/cloud_scheduler/rest/service_stub.rb | 574 -- .../cloud/scheduler/v1/cloudscheduler_pb.rb | 37 - .../v1/cloudscheduler_services_pb.rb | 89 - .../lib/google/cloud/scheduler/v1/job_pb.rb | 30 - .../lib/google/cloud/scheduler/v1/rest.rb | 38 - .../google/cloud/scheduler/v1/target_pb.rb | 29 - .../lib/google/cloud/scheduler/v1/version.rb | 28 - .../proto_docs/README.md | 4 - .../proto_docs/google/api/client.rb | 589 -- .../proto_docs/google/api/field_behavior.rb | 85 - .../proto_docs/google/api/launch_stage.rb | 71 - .../proto_docs/google/api/resource.rb | 227 - .../cloud/scheduler/v1/cloudscheduler.rb | 164 - .../google/cloud/scheduler/v1/job.rb | 264 - .../google/cloud/scheduler/v1/target.rb | 420 - .../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 - .../snippets/Gemfile | 32 - .../snippets/cloud_scheduler/create_job.rb | 47 - .../snippets/cloud_scheduler/delete_job.rb | 47 - .../snippets/cloud_scheduler/get_job.rb | 47 - .../snippets/cloud_scheduler/list_jobs.rb | 51 - .../snippets/cloud_scheduler/pause_job.rb | 47 - .../snippets/cloud_scheduler/resume_job.rb | 47 - .../snippets/cloud_scheduler/run_job.rb | 47 - .../snippets/cloud_scheduler/update_job.rb | 47 - ...et_metadata_google.cloud.scheduler.v1.json | 335 - .../v1/cloud_scheduler_paths_test.rb | 79 - .../scheduler/v1/cloud_scheduler_rest_test.rb | 535 -- .../scheduler/v1/cloud_scheduler_test.rb | 581 -- .../google-cloud-scheduler-v1/test/helper.rb | 26 - .../google-cloud-scheduler-v1beta1/.gitignore | 22 - .../.repo-metadata.json | 18 - .../.rubocop.yml | 33 - .../google-cloud-scheduler-v1beta1/.toys.rb | 28 - .../google-cloud-scheduler-v1beta1/.yardopts | 12 - .../AUTHENTICATION.md | 122 - .../CHANGELOG.md | 2 - .../google-cloud-scheduler-v1beta1/Gemfile | 14 - .../google-cloud-scheduler-v1beta1/LICENSE.md | 201 - .../google-cloud-scheduler-v1beta1/README.md | 154 - .../google-cloud-scheduler-v1beta1/Rakefile | 169 - .../gapic_metadata.json | 58 - .../google-cloud-scheduler-v1beta1.gemspec | 29 - .../lib/google-cloud-scheduler-v1beta1.rb | 21 - .../lib/google/cloud/scheduler/v1beta1.rb | 45 - .../scheduler/v1beta1/bindings_override.rb | 75 - .../scheduler/v1beta1/cloud_scheduler.rb | 56 - .../v1beta1/cloud_scheduler/client.rb | 1263 --- .../v1beta1/cloud_scheduler/credentials.rb | 51 - .../v1beta1/cloud_scheduler/paths.rb | 86 - .../scheduler/v1beta1/cloud_scheduler/rest.rb | 54 - .../v1beta1/cloud_scheduler/rest/client.rb | 1172 --- .../cloud_scheduler/rest/service_stub.rb | 574 -- .../scheduler/v1beta1/cloudscheduler_pb.rb | 37 - .../v1beta1/cloudscheduler_services_pb.rb | 92 - .../google/cloud/scheduler/v1beta1/job_pb.rb | 30 - .../google/cloud/scheduler/v1beta1/rest.rb | 38 - .../cloud/scheduler/v1beta1/target_pb.rb | 29 - .../google/cloud/scheduler/v1beta1/version.rb | 28 - .../proto_docs/README.md | 4 - .../proto_docs/google/api/client.rb | 589 -- .../proto_docs/google/api/field_behavior.rb | 85 - .../proto_docs/google/api/launch_stage.rb | 71 - .../proto_docs/google/api/resource.rb | 227 - .../cloud/scheduler/v1beta1/cloudscheduler.rb | 193 - .../google/cloud/scheduler/v1beta1/job.rb | 267 - .../google/cloud/scheduler/v1beta1/target.rb | 409 - .../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 - .../snippets/Gemfile | 32 - .../snippets/cloud_scheduler/create_job.rb | 47 - .../snippets/cloud_scheduler/delete_job.rb | 47 - .../snippets/cloud_scheduler/get_job.rb | 47 - .../snippets/cloud_scheduler/list_jobs.rb | 51 - .../snippets/cloud_scheduler/pause_job.rb | 47 - .../snippets/cloud_scheduler/resume_job.rb | 47 - .../snippets/cloud_scheduler/run_job.rb | 47 - .../snippets/cloud_scheduler/update_job.rb | 47 - ...tadata_google.cloud.scheduler.v1beta1.json | 335 - .../v1beta1/cloud_scheduler_paths_test.rb | 79 - .../v1beta1/cloud_scheduler_rest_test.rb | 539 -- .../scheduler/v1beta1/cloud_scheduler_test.rb | 589 -- .../test/helper.rb | 26 - .../google-cloud-secret_manager-v1/.gitignore | 22 - .../.repo-metadata.json | 18 - .../.rubocop.yml | 33 - .../google-cloud-secret_manager-v1/.toys.rb | 28 - .../google-cloud-secret_manager-v1/.yardopts | 12 - .../AUTHENTICATION.md | 122 - .../CHANGELOG.md | 2 - .../google-cloud-secret_manager-v1/Gemfile | 14 - .../google-cloud-secret_manager-v1/LICENSE.md | 201 - .../google-cloud-secret_manager-v1/README.md | 154 - .../google-cloud-secret_manager-v1/Rakefile | 169 - .../gapic_metadata.json | 93 - .../google-cloud-secret_manager-v1.gemspec | 30 - .../lib/google-cloud-secret_manager-v1.rb | 21 - .../lib/google/cloud/secret_manager/v1.rb | 45 - .../secret_manager/v1/bindings_override.rb | 75 - .../google/cloud/secret_manager/v1/rest.rb | 38 - .../v1/secret_manager_service.rb | 61 - .../v1/secret_manager_service/client.rb | 1989 ----- .../v1/secret_manager_service/credentials.rb | 51 - .../v1/secret_manager_service/paths.rb | 167 - .../v1/secret_manager_service/rest.rb | 59 - .../v1/secret_manager_service/rest/client.rb | 1849 ---- .../rest/service_stub.rb | 1117 --- .../google/cloud/secret_manager/v1/version.rb | 28 - .../cloud/secretmanager/v1/resources_pb.rb | 41 - .../cloud/secretmanager/v1/service_pb.rb | 45 - .../secretmanager/v1/service_services_pb.rb | 118 - .../proto_docs/README.md | 4 - .../proto_docs/google/api/client.rb | 589 -- .../proto_docs/google/api/field_behavior.rb | 85 - .../proto_docs/google/api/launch_stage.rb | 71 - .../proto_docs/google/api/resource.rb | 227 - .../cloud/secretmanager/v1/resources.rb | 526 -- .../google/cloud/secretmanager/v1/service.rb | 320 - .../proto_docs/google/iam/v1/iam_policy.rb | 87 - .../proto_docs/google/iam/v1/options.rb | 50 - .../proto_docs/google/iam/v1/policy.rb | 426 - .../proto_docs/google/protobuf/duration.rb | 98 - .../proto_docs/google/protobuf/empty.rb | 34 - .../proto_docs/google/protobuf/field_mask.rb | 229 - .../proto_docs/google/protobuf/timestamp.rb | 127 - .../proto_docs/google/type/expr.rb | 75 - .../snippets/Gemfile | 32 - .../access_secret_version.rb | 47 - .../add_secret_version.rb | 47 - .../secret_manager_service/create_secret.rb | 47 - .../secret_manager_service/delete_secret.rb | 47 - .../destroy_secret_version.rb | 47 - .../disable_secret_version.rb | 47 - .../enable_secret_version.rb | 47 - .../secret_manager_service/get_iam_policy.rb | 47 - .../secret_manager_service/get_secret.rb | 47 - .../get_secret_version.rb | 47 - .../list_secret_versions.rb | 51 - .../secret_manager_service/list_secrets.rb | 51 - .../secret_manager_service/set_iam_policy.rb | 47 - .../test_iam_permissions.rb | 47 - .../secret_manager_service/update_secret.rb | 47 - ...etadata_google.cloud.secretmanager.v1.json | 615 -- .../v1/secret_manager_service_paths_test.rb | 109 - .../v1/secret_manager_service_rest_test.rb | 927 -- .../v1/secret_manager_service_test.rb | 1020 --- .../test/helper.rb | 26 - .../.gitignore | 22 - .../.repo-metadata.json | 18 - .../.rubocop.yml | 33 - .../.toys.rb | 28 - .../.yardopts | 12 - .../AUTHENTICATION.md | 122 - .../CHANGELOG.md | 2 - .../Gemfile | 14 - .../LICENSE.md | 201 - .../README.md | 154 - .../Rakefile | 169 - .../gapic_metadata.json | 93 - ...oogle-cloud-secret_manager-v1beta1.gemspec | 30 - .../google-cloud-secret_manager-v1beta1.rb | 21 - .../google/cloud/secret_manager/v1beta1.rb | 45 - .../v1beta1/bindings_override.rb | 75 - .../cloud/secret_manager/v1beta1/rest.rb | 38 - .../v1beta1/secret_manager_service.rb | 61 - .../v1beta1/secret_manager_service/client.rb | 1942 ----- .../secret_manager_service/credentials.rb | 51 - .../v1beta1/secret_manager_service/paths.rb | 83 - .../v1beta1/secret_manager_service/rest.rb | 59 - .../secret_manager_service/rest/client.rb | 1802 ---- .../rest/service_stub.rb | 1004 --- .../cloud/secret_manager/v1beta1/version.rb | 28 - .../cloud/secrets/v1beta1/resources_pb.rb | 32 - .../cloud/secrets/v1beta1/service_pb.rb | 45 - .../secrets/v1beta1/service_services_pb.rb | 117 - .../proto_docs/README.md | 4 - .../proto_docs/google/api/client.rb | 589 -- .../proto_docs/google/api/field_behavior.rb | 85 - .../proto_docs/google/api/launch_stage.rb | 71 - .../proto_docs/google/api/resource.rb | 227 - .../google/cloud/secrets/v1beta1/resources.rb | 189 - .../google/cloud/secrets/v1beta1/service.rb | 261 - .../proto_docs/google/iam/v1/iam_policy.rb | 87 - .../proto_docs/google/iam/v1/options.rb | 50 - .../proto_docs/google/iam/v1/policy.rb | 426 - .../proto_docs/google/protobuf/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/type/expr.rb | 75 - .../snippets/Gemfile | 32 - .../access_secret_version.rb | 47 - .../add_secret_version.rb | 47 - .../secret_manager_service/create_secret.rb | 47 - .../secret_manager_service/delete_secret.rb | 47 - .../destroy_secret_version.rb | 47 - .../disable_secret_version.rb | 47 - .../enable_secret_version.rb | 47 - .../secret_manager_service/get_iam_policy.rb | 47 - .../secret_manager_service/get_secret.rb | 47 - .../get_secret_version.rb | 47 - .../list_secret_versions.rb | 51 - .../secret_manager_service/list_secrets.rb | 51 - .../secret_manager_service/set_iam_policy.rb | 47 - .../test_iam_permissions.rb | 47 - .../secret_manager_service/update_secret.rb | 47 - ...metadata_google.cloud.secrets.v1beta1.json | 615 -- .../secret_manager_service_paths_test.rb | 79 - .../secret_manager_service_rest_test.rb | 921 -- .../v1beta1/secret_manager_service_test.rb | 1008 --- .../test/helper.rb | 26 - .../.gitignore | 22 - .../.repo-metadata.json | 18 - .../.rubocop.yml | 33 - .../.toys.rb | 28 - .../.yardopts | 12 - .../AUTHENTICATION.md | 122 - .../CHANGELOG.md | 2 - .../Gemfile | 14 - .../LICENSE.md | 201 - .../README.md | 154 - .../Rakefile | 169 - .../gapic_metadata.json | 93 - ...oogle-cloud-secret_manager-v1beta2.gemspec | 30 - .../google-cloud-secret_manager-v1beta2.rb | 21 - .../google/cloud/secret_manager/v1beta2.rb | 45 - .../v1beta2/bindings_override.rb | 75 - .../cloud/secret_manager/v1beta2/rest.rb | 38 - .../v1beta2/secret_manager_service.rb | 61 - .../v1beta2/secret_manager_service/client.rb | 1996 ----- .../secret_manager_service/credentials.rb | 51 - .../v1beta2/secret_manager_service/paths.rb | 167 - .../v1beta2/secret_manager_service/rest.rb | 59 - .../secret_manager_service/rest/client.rb | 1856 ---- .../rest/service_stub.rb | 1117 --- .../cloud/secret_manager/v1beta2/version.rb | 28 - .../secretmanager/v1beta2/resources_pb.rb | 41 - .../cloud/secretmanager/v1beta2/service_pb.rb | 45 - .../v1beta2/service_services_pb.rb | 125 - .../proto_docs/README.md | 4 - .../proto_docs/google/api/client.rb | 589 -- .../proto_docs/google/api/field_behavior.rb | 85 - .../proto_docs/google/api/launch_stage.rb | 71 - .../proto_docs/google/api/resource.rb | 227 - .../cloud/secretmanager/v1beta2/resources.rb | 512 -- .../cloud/secretmanager/v1beta2/service.rb | 321 - .../proto_docs/google/iam/v1/iam_policy.rb | 87 - .../proto_docs/google/iam/v1/options.rb | 50 - .../proto_docs/google/iam/v1/policy.rb | 426 - .../proto_docs/google/protobuf/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/type/expr.rb | 75 - .../snippets/Gemfile | 32 - .../access_secret_version.rb | 47 - .../add_secret_version.rb | 47 - .../secret_manager_service/create_secret.rb | 47 - .../secret_manager_service/delete_secret.rb | 47 - .../destroy_secret_version.rb | 47 - .../disable_secret_version.rb | 47 - .../enable_secret_version.rb | 47 - .../secret_manager_service/get_iam_policy.rb | 47 - .../secret_manager_service/get_secret.rb | 47 - .../get_secret_version.rb | 47 - .../list_secret_versions.rb | 51 - .../secret_manager_service/list_secrets.rb | 51 - .../secret_manager_service/set_iam_policy.rb | 47 - .../test_iam_permissions.rb | 47 - .../secret_manager_service/update_secret.rb | 47 - ...ta_google.cloud.secretmanager.v1beta2.json | 615 -- .../secret_manager_service_paths_test.rb | 109 - .../secret_manager_service_rest_test.rb | 927 -- .../v1beta2/secret_manager_service_test.rb | 1020 --- .../test/helper.rb | 26 - .../.gitignore | 22 - .../.repo-metadata.json | 17 - .../.rubocop.yml | 33 - .../.toys.rb | 28 - .../.yardopts | 12 - .../AUTHENTICATION.md | 122 - .../CHANGELOG.md | 2 - .../Gemfile | 14 - .../LICENSE.md | 201 - .../README.md | 154 - .../Rakefile | 169 - .../gapic_metadata.json | 278 - ...gle-cloud-secure_source_manager-v1.gemspec | 30 - .../google-cloud-secure_source_manager-v1.rb | 21 - .../google/cloud/secure_source_manager/v1.rb | 45 - .../v1/bindings_override.rb | 108 - .../cloud/secure_source_manager/v1/rest.rb | 38 - .../v1/secure_source_manager.rb | 58 - .../v1/secure_source_manager/client.rb | 5877 ------------- .../v1/secure_source_manager/credentials.rb | 47 - .../v1/secure_source_manager/operations.rb | 841 -- .../v1/secure_source_manager/paths.rb | 277 - .../v1/secure_source_manager/rest.rb | 56 - .../v1/secure_source_manager/rest/client.rb | 5479 ------------ .../secure_source_manager/rest/operations.rb | 925 -- .../rest/service_stub.rb | 3278 -------- .../cloud/secure_source_manager/v1/version.rb | 28 - .../v1/secure_source_manager_pb.rb | 125 - .../v1/secure_source_manager_services_pb.rb | 170 - .../proto_docs/README.md | 4 - .../proto_docs/google/api/client.rb | 589 -- .../proto_docs/google/api/field_behavior.rb | 85 - .../proto_docs/google/api/launch_stage.rb | 71 - .../proto_docs/google/api/resource.rb | 227 - .../v1/secure_source_manager.rb | 1792 ---- .../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 - .../snippets/Gemfile | 32 - .../batch_create_pull_request_comments.rb | 54 - .../secure_source_manager/close_issue.rb | 54 - .../close_pull_request.rb | 54 - .../create_branch_rule.rb | 54 - .../secure_source_manager/create_hook.rb | 54 - .../secure_source_manager/create_instance.rb | 54 - .../secure_source_manager/create_issue.rb | 54 - .../create_issue_comment.rb | 54 - .../create_pull_request.rb | 54 - .../create_pull_request_comment.rb | 54 - .../create_repository.rb | 54 - .../delete_branch_rule.rb | 54 - .../secure_source_manager/delete_hook.rb | 54 - .../secure_source_manager/delete_instance.rb | 54 - .../secure_source_manager/delete_issue.rb | 54 - .../delete_issue_comment.rb | 54 - .../delete_pull_request_comment.rb | 54 - .../delete_repository.rb | 54 - .../secure_source_manager/fetch_blob.rb | 47 - .../secure_source_manager/fetch_tree.rb | 51 - .../secure_source_manager/get_branch_rule.rb | 47 - .../secure_source_manager/get_hook.rb | 47 - .../get_iam_policy_repo.rb | 47 - .../secure_source_manager/get_instance.rb | 47 - .../secure_source_manager/get_issue.rb | 47 - .../get_issue_comment.rb | 47 - .../secure_source_manager/get_pull_request.rb | 47 - .../get_pull_request_comment.rb | 47 - .../secure_source_manager/get_repository.rb | 47 - .../list_branch_rules.rb | 51 - .../secure_source_manager/list_hooks.rb | 51 - .../secure_source_manager/list_instances.rb | 51 - .../list_issue_comments.rb | 51 - .../secure_source_manager/list_issues.rb | 51 - .../list_pull_request_comments.rb | 51 - .../list_pull_request_file_diffs.rb | 51 - .../list_pull_requests.rb | 51 - .../list_repositories.rb | 51 - .../merge_pull_request.rb | 54 - .../secure_source_manager/open_issue.rb | 54 - .../open_pull_request.rb | 54 - .../resolve_pull_request_comments.rb | 54 - .../set_iam_policy_repo.rb | 47 - .../test_iam_permissions_repo.rb | 47 - .../unresolve_pull_request_comments.rb | 54 - .../update_branch_rule.rb | 54 - .../secure_source_manager/update_hook.rb | 54 - .../secure_source_manager/update_issue.rb | 54 - .../update_issue_comment.rb | 54 - .../update_pull_request.rb | 54 - .../update_pull_request_comment.rb | 54 - .../update_repository.rb | 54 - ...a_google.cloud.securesourcemanager.v1.json | 2095 ----- .../secure_source_manager_operations_test.rb | 400 - .../v1/secure_source_manager_paths_test.rb | 187 - .../v1/secure_source_manager_rest_test.rb | 2972 ------- .../v1/secure_source_manager_test.rb | 3464 -------- .../test/helper.rb | 26 - .../.gitignore | 22 - .../.repo-metadata.json | 18 - .../.rubocop.yml | 33 - .../.toys.rb | 28 - .../.yardopts | 12 - .../AUTHENTICATION.md | 122 - .../CHANGELOG.md | 2 - .../Gemfile | 14 - .../LICENSE.md | 201 - .../README.md | 154 - .../Rakefile | 169 - .../gapic_metadata.json | 163 - ...oogle-cloud-security-private_ca-v1.gemspec | 30 - .../google-cloud-security-private_ca-v1.rb | 21 - .../google/cloud/security/private_ca/v1.rb | 47 - .../private_ca/v1/bindings_override.rb | 158 - .../v1/certificate_authority_service.rb | 60 - .../certificate_authority_service/client.rb | 3804 --------- .../credentials.rb | 53 - .../operations.rb | 843 -- .../v1/certificate_authority_service/paths.rb | 155 - .../v1/certificate_authority_service/rest.rb | 58 - .../rest/client.rb | 3567 -------- .../rest/operations.rb | 927 -- .../rest/service_stub.rb | 1867 ----- .../cloud/security/private_ca/v1/rest.rb | 40 - .../cloud/security/private_ca/v1/version.rb | 30 - .../security/privateca/v1/resources_pb.rb | 80 - .../cloud/security/privateca/v1/service_pb.rb | 71 - .../privateca/v1/service_services_pb.rb | 150 - .../proto_docs/README.md | 4 - .../proto_docs/google/api/client.rb | 589 -- .../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 - .../cloud/security/privateca/v1/resources.rb | 1676 ---- .../cloud/security/privateca/v1/service.rb | 1032 --- .../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 - .../snippets/Gemfile | 32 - .../activate_certificate_authority.rb | 54 - .../create_ca_pool.rb | 54 - .../create_certificate.rb | 47 - .../create_certificate_authority.rb | 54 - .../create_certificate_template.rb | 54 - .../delete_ca_pool.rb | 54 - .../delete_certificate_authority.rb | 54 - .../delete_certificate_template.rb | 54 - .../disable_certificate_authority.rb | 54 - .../enable_certificate_authority.rb | 54 - .../fetch_ca_certs.rb | 47 - .../fetch_certificate_authority_csr.rb | 47 - .../get_ca_pool.rb | 47 - .../get_certificate.rb | 47 - .../get_certificate_authority.rb | 47 - .../get_certificate_revocation_list.rb | 47 - .../get_certificate_template.rb | 47 - .../list_ca_pools.rb | 51 - .../list_certificate_authorities.rb | 51 - .../list_certificate_revocation_lists.rb | 51 - .../list_certificate_templates.rb | 51 - .../list_certificates.rb | 51 - .../revoke_certificate.rb | 47 - .../undelete_certificate_authority.rb | 54 - .../update_ca_pool.rb | 54 - .../update_certificate.rb | 47 - .../update_certificate_authority.rb | 54 - .../update_certificate_revocation_list.rb | 54 - .../update_certificate_template.rb | 54 - ...ta_google.cloud.security.privateca.v1.json | 1175 --- ...icate_authority_service_operations_test.rb | 400 - ...ertificate_authority_service_paths_test.rb | 115 - ...certificate_authority_service_rest_test.rb | 1726 ---- .../v1/certificate_authority_service_test.rb | 2017 ----- .../test/helper.rb | 26 - .../.gitignore | 22 - .../.repo-metadata.json | 18 - .../.rubocop.yml | 33 - .../.toys.rb | 28 - .../.yardopts | 12 - .../AUTHENTICATION.md | 122 - .../CHANGELOG.md | 2 - .../Gemfile | 14 - .../LICENSE.md | 201 - .../README.md | 154 - .../Rakefile | 169 - .../gapic_metadata.json | 118 - ...-cloud-security-private_ca-v1beta1.gemspec | 28 - ...oogle-cloud-security-private_ca-v1beta1.rb | 21 - .../cloud/security/private_ca/v1beta1.rb | 47 - .../v1beta1/certificate_authority_service.rb | 59 - .../certificate_authority_service/client.rb | 2614 ------ .../credentials.rb | 53 - .../operations.rb | 843 -- .../certificate_authority_service/paths.rb | 132 - .../certificate_authority_service/rest.rb | 56 - .../rest/client.rb | 2431 ------ .../rest/operations.rb | 927 -- .../rest/service_stub.rb | 1314 --- .../cloud/security/private_ca/v1beta1/rest.rb | 39 - .../security/private_ca/v1beta1/version.rb | 30 - .../privateca/v1beta1/resources_pb.rb | 67 - .../security/privateca/v1beta1/service_pb.rb | 57 - .../privateca/v1beta1/service_services_pb.rb | 99 - .../proto_docs/README.md | 4 - .../proto_docs/google/api/client.rb | 589 -- .../proto_docs/google/api/field_behavior.rb | 85 - .../proto_docs/google/api/launch_stage.rb | 71 - .../proto_docs/google/api/resource.rb | 227 - .../security/privateca/v1beta1/resources.rb | 1001 --- .../security/privateca/v1beta1/service.rb | 633 -- .../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/protobuf/wrappers.rb | 148 - .../proto_docs/google/rpc/status.rb | 48 - .../snippets/Gemfile | 32 - .../activate_certificate_authority.rb | 54 - .../create_certificate.rb | 47 - .../create_certificate_authority.rb | 54 - .../disable_certificate_authority.rb | 54 - .../enable_certificate_authority.rb | 54 - .../fetch_certificate_authority_csr.rb | 47 - .../get_certificate.rb | 47 - .../get_certificate_authority.rb | 47 - .../get_certificate_revocation_list.rb | 47 - .../get_reusable_config.rb | 47 - .../list_certificate_authorities.rb | 51 - .../list_certificate_revocation_lists.rb | 51 - .../list_certificates.rb | 51 - .../list_reusable_configs.rb | 51 - .../restore_certificate_authority.rb | 54 - .../revoke_certificate.rb | 47 - .../schedule_delete_certificate_authority.rb | 54 - .../update_certificate.rb | 47 - .../update_certificate_authority.rb | 54 - .../update_certificate_revocation_list.rb | 54 - ...ogle.cloud.security.privateca.v1beta1.json | 815 -- ...icate_authority_service_operations_test.rb | 400 - ...ertificate_authority_service_paths_test.rb | 103 - ...certificate_authority_service_rest_test.rb | 1216 --- .../certificate_authority_service_test.rb | 1412 ---- .../test/helper.rb | 26 - .../.gitignore | 22 - .../.repo-metadata.json | 17 - .../.rubocop.yml | 33 - .../.toys.rb | 28 - .../.yardopts | 12 - .../AUTHENTICATION.md | 122 - .../CHANGELOG.md | 2 - .../Gemfile | 14 - .../LICENSE.md | 201 - .../README.md | 154 - .../Rakefile | 169 - .../gapic_metadata.json | 23 - ...google-cloud-security-public_ca-v1.gemspec | 28 - .../lib/google-cloud-security-public_ca-v1.rb | 21 - .../lib/google/cloud/security/public_ca/v1.rb | 47 - .../public_certificate_authority_service.rb | 59 - .../client.rb | 492 -- .../credentials.rb | 49 - .../paths.rb | 71 - .../rest.rb | 56 - .../rest/client.rb | 442 - .../rest/service_stub.rb | 145 - .../cloud/security/public_ca/v1/rest.rb | 39 - .../cloud/security/public_ca/v1/version.rb | 30 - .../security/publicca/v1/resources_pb.rb | 26 - .../cloud/security/publicca/v1/service_pb.rb | 29 - .../publicca/v1/service_services_pb.rb | 51 - .../proto_docs/README.md | 4 - .../proto_docs/google/api/client.rb | 589 -- .../proto_docs/google/api/field_behavior.rb | 85 - .../proto_docs/google/api/launch_stage.rb | 71 - .../proto_docs/google/api/resource.rb | 227 - .../cloud/security/publicca/v1/resources.rb | 49 - .../cloud/security/publicca/v1/service.rb | 47 - .../proto_docs/google/protobuf/duration.rb | 98 - .../snippets/Gemfile | 32 - .../create_external_account_key.rb | 47 - ...ata_google.cloud.security.publicca.v1.json | 55 - ...ertificate_authority_service_paths_test.rb | 67 - ...certificate_authority_service_rest_test.rb | 154 - ...blic_certificate_authority_service_test.rb | 164 - .../test/helper.rb | 26 - .../.gitignore | 22 - .../.repo-metadata.json | 17 - .../.rubocop.yml | 33 - .../.toys.rb | 28 - .../.yardopts | 12 - .../AUTHENTICATION.md | 122 - .../CHANGELOG.md | 2 - .../Gemfile | 14 - .../LICENSE.md | 201 - .../README.md | 154 - .../Rakefile | 169 - .../gapic_metadata.json | 23 - ...e-cloud-security-public_ca-v1beta1.gemspec | 28 - ...google-cloud-security-public_ca-v1beta1.rb | 21 - .../cloud/security/public_ca/v1beta1.rb | 47 - .../public_certificate_authority_service.rb | 59 - .../client.rb | 492 -- .../credentials.rb | 49 - .../paths.rb | 71 - .../rest.rb | 56 - .../rest/client.rb | 442 - .../rest/service_stub.rb | 145 - .../cloud/security/public_ca/v1beta1/rest.rb | 39 - .../security/public_ca/v1beta1/version.rb | 30 - .../security/publicca/v1beta1/resources_pb.rb | 26 - .../security/publicca/v1beta1/service_pb.rb | 29 - .../publicca/v1beta1/service_services_pb.rb | 51 - .../proto_docs/README.md | 4 - .../proto_docs/google/api/client.rb | 589 -- .../proto_docs/google/api/field_behavior.rb | 85 - .../proto_docs/google/api/launch_stage.rb | 71 - .../proto_docs/google/api/resource.rb | 227 - .../security/publicca/v1beta1/resources.rb | 49 - .../security/publicca/v1beta1/service.rb | 47 - .../proto_docs/google/protobuf/duration.rb | 98 - .../snippets/Gemfile | 32 - .../create_external_account_key.rb | 47 - ...oogle.cloud.security.publicca.v1beta1.json | 55 - ...ertificate_authority_service_paths_test.rb | 67 - ...certificate_authority_service_rest_test.rb | 154 - ...blic_certificate_authority_service_test.rb | 164 - .../test/helper.rb | 26 - .../.gitignore | 22 - .../.repo-metadata.json | 18 - .../.rubocop.yml | 33 - .../google-cloud-security_center-v1/.toys.rb | 28 - .../google-cloud-security_center-v1/.yardopts | 12 - .../AUTHENTICATION.md | 122 - .../CHANGELOG.md | 2 - .../google-cloud-security_center-v1/Gemfile | 14 - .../LICENSE.md | 201 - .../google-cloud-security_center-v1/README.md | 153 - .../google-cloud-security_center-v1/Rakefile | 169 - .../gapic_metadata.json | 333 - .../google-cloud-security_center-v1.gemspec | 29 - .../lib/google-cloud-security_center-v1.rb | 21 - .../lib/google/cloud/security_center/v1.rb | 45 - .../google/cloud/security_center/v1/rest.rb | 37 - .../security_center/v1/security_center.rb | 56 - .../v1/security_center/client.rb | 7458 ----------------- .../v1/security_center/credentials.rb | 51 - .../v1/security_center/operations.rb | 841 -- .../v1/security_center/paths.rb | 1127 --- .../v1/security_center/rest.rb | 53 - .../v1/security_center/rest/client.rb | 6968 --------------- .../v1/security_center/rest/operations.rb | 924 -- .../v1/security_center/rest/service_stub.rb | 4766 ----------- .../cloud/security_center/v1/version.rb | 28 - .../cloud/securitycenter/v1/access_pb.rb | 23 - .../cloud/securitycenter/v1/application_pb.rb | 21 - .../cloud/securitycenter/v1/asset_pb.rb | 29 - .../securitycenter/v1/attack_exposure_pb.rb | 24 - .../cloud/securitycenter/v1/attack_path_pb.rb | 28 - .../v1/backup_disaster_recovery_pb.rb | 23 - .../securitycenter/v1/bigquery_export_pb.rb | 25 - .../cloud/securitycenter/v1/chokepoint_pb.rb | 21 - .../cloud/securitycenter/v1/cloud_armor_pb.rb | 27 - .../v1/cloud_dlp_data_profile_pb.rb | 27 - .../v1/cloud_dlp_inspection_pb.rb | 23 - .../cloud/securitycenter/v1/compliance_pb.rb | 21 - .../cloud/securitycenter/v1/connection_pb.rb | 22 - .../securitycenter/v1/contact_details_pb.rb | 22 - .../cloud/securitycenter/v1/container_pb.rb | 24 - .../cloud/securitycenter/v1/database_pb.rb | 21 - ...event_threat_detection_custom_module_pb.rb | 26 - ...urity_health_analytics_custom_module_pb.rb | 26 - ...event_threat_detection_custom_module_pb.rb | 27 - ...tion_custom_module_validation_errors_pb.rb | 23 - .../securitycenter/v1/exfiltration_pb.rb | 22 - .../securitycenter/v1/external_exposure_pb.rb | 23 - .../securitycenter/v1/external_system_pb.rb | 25 - .../google/cloud/securitycenter/v1/file_pb.rb | 22 - .../cloud/securitycenter/v1/finding_pb.rb | 65 - .../cloud/securitycenter/v1/folder_pb.rb | 21 - .../securitycenter/v1/group_membership_pb.rb | 22 - .../cloud/securitycenter/v1/iam_binding_pb.rb | 22 - .../cloud/securitycenter/v1/indicator_pb.rb | 26 - .../securitycenter/v1/kernel_rootkit_pb.rb | 21 - .../cloud/securitycenter/v1/kubernetes_pb.rb | 34 - .../cloud/securitycenter/v1/label_pb.rb | 21 - .../securitycenter/v1/load_balancer_pb.rb | 21 - .../cloud/securitycenter/v1/log_entry_pb.rb | 24 - .../securitycenter/v1/mitre_attack_pb.rb | 23 - .../cloud/securitycenter/v1/mute_config_pb.rb | 26 - .../cloud/securitycenter/v1/notebook_pb.rb | 23 - .../v1/notification_config_pb.rb | 25 - .../v1/notification_message_pb.rb | 24 - .../cloud/securitycenter/v1/org_policy_pb.rb | 23 - .../v1/organization_settings_pb.rb | 25 - .../cloud/securitycenter/v1/process_pb.rb | 24 - .../cloud/securitycenter/v1/resource_pb.rb | 36 - .../v1/resource_value_config_pb.rb | 28 - .../v1/run_asset_discovery_response_pb.rb | 24 - ...urity_health_analytics_custom_config_pb.rb | 27 - ...urity_health_analytics_custom_module_pb.rb | 27 - .../securitycenter/v1/security_marks_pb.rb | 23 - .../securitycenter/v1/security_posture_pb.rb | 22 - .../v1/securitycenter_service_pb.rb | 147 - .../v1/securitycenter_service_services_pb.rb | 226 - .../cloud/securitycenter/v1/simulation_pb.rb | 27 - .../cloud/securitycenter/v1/source_pb.rb | 23 - .../securitycenter/v1/toxic_combination_pb.rb | 21 - .../securitycenter/v1/valued_resource_pb.rb | 25 - .../securitycenter/v1/vulnerability_pb.rb | 36 - .../proto_docs/README.md | 4 - .../proto_docs/google/api/client.rb | 589 -- .../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/cloud/securitycenter/v1/access.rb | 120 - .../cloud/securitycenter/v1/application.rb | 40 - .../google/cloud/securitycenter/v1/asset.rb | 141 - .../securitycenter/v1/attack_exposure.rb | 73 - .../cloud/securitycenter/v1/attack_path.rb | 147 - .../v1/backup_disaster_recovery.rb | 90 - .../securitycenter/v1/bigquery_export.rb | 92 - .../cloud/securitycenter/v1/chokepoint.rb | 39 - .../cloud/securitycenter/v1/cloud_armor.rb | 128 - .../v1/cloud_dlp_data_profile.rb | 114 - .../securitycenter/v1/cloud_dlp_inspection.rb | 50 - .../cloud/securitycenter/v1/compliance.rb | 43 - .../cloud/securitycenter/v1/connection.rb | 70 - .../securitycenter/v1/contact_details.rb | 44 - .../cloud/securitycenter/v1/container.rb | 49 - .../cloud/securitycenter/v1/database.rb | 67 - ...ve_event_threat_detection_custom_module.rb | 77 - ...security_health_analytics_custom_module.rb | 73 - .../event_threat_detection_custom_module.rb | 88 - ...tection_custom_module_validation_errors.rb | 69 - .../cloud/securitycenter/v1/exfiltration.rb | 64 - .../securitycenter/v1/external_exposure.rb | 77 - .../securitycenter/v1/external_system.rb | 98 - .../google/cloud/securitycenter/v1/file.rb | 72 - .../google/cloud/securitycenter/v1/finding.rb | 477 -- .../google/cloud/securitycenter/v1/folder.rb | 40 - .../securitycenter/v1/group_membership.rb | 51 - .../cloud/securitycenter/v1/iam_binding.rb | 56 - .../cloud/securitycenter/v1/indicator.rb | 116 - .../cloud/securitycenter/v1/kernel_rootkit.rb | 66 - .../cloud/securitycenter/v1/kubernetes.rb | 241 - .../google/cloud/securitycenter/v1/label.rb | 41 - .../cloud/securitycenter/v1/load_balancer.rb | 36 - .../cloud/securitycenter/v1/log_entry.rb | 58 - .../cloud/securitycenter/v1/mitre_attack.rb | 303 - .../cloud/securitycenter/v1/mute_config.rb | 116 - .../cloud/securitycenter/v1/notebook.rb | 46 - .../securitycenter/v1/notification_config.rb | 87 - .../securitycenter/v1/notification_message.rb | 42 - .../cloud/securitycenter/v1/org_policy.rb | 37 - .../v1/organization_settings.rb | 86 - .../google/cloud/securitycenter/v1/process.rb | 79 - .../cloud/securitycenter/v1/resource.rb | 286 - .../v1/resource_value_config.rb | 125 - .../v1/run_asset_discovery_response.rb | 54 - ...security_health_analytics_custom_config.rb | 112 - ...security_health_analytics_custom_module.rb | 90 - .../cloud/securitycenter/v1/security_marks.rb | 71 - .../securitycenter/v1/security_posture.rb | 83 - .../v1/securitycenter_service.rb | 2146 ----- .../cloud/securitycenter/v1/simulation.rb | 46 - .../google/cloud/securitycenter/v1/source.rb | 65 - .../securitycenter/v1/toxic_combination.rb | 45 - .../securitycenter/v1/valued_resource.rb | 86 - .../cloud/securitycenter/v1/vulnerability.rb | 336 - .../proto_docs/google/iam/v1/iam_policy.rb | 87 - .../proto_docs/google/iam/v1/options.rb | 50 - .../proto_docs/google/iam/v1/policy.rb | 426 - .../google/longrunning/operations.rb | 191 - .../proto_docs/google/protobuf/any.rb | 145 - .../proto_docs/google/protobuf/duration.rb | 98 - .../proto_docs/google/protobuf/empty.rb | 34 - .../proto_docs/google/protobuf/field_mask.rb | 229 - .../proto_docs/google/protobuf/struct.rb | 108 - .../proto_docs/google/protobuf/timestamp.rb | 127 - .../proto_docs/google/rpc/status.rb | 48 - .../proto_docs/google/type/expr.rb | 75 - .../snippets/Gemfile | 32 - .../batch_create_resource_value_configs.rb | 47 - .../security_center/bulk_mute_findings.rb | 54 - .../create_big_query_export.rb | 47 - ...te_event_threat_detection_custom_module.rb | 47 - .../security_center/create_finding.rb | 47 - .../security_center/create_mute_config.rb | 47 - .../create_notification_config.rb | 47 - ...security_health_analytics_custom_module.rb | 47 - .../snippets/security_center/create_source.rb | 47 - .../delete_big_query_export.rb | 47 - ...te_event_threat_detection_custom_module.rb | 47 - .../security_center/delete_mute_config.rb | 47 - .../delete_notification_config.rb | 47 - .../delete_resource_value_config.rb | 47 - ...security_health_analytics_custom_module.rb | 47 - .../security_center/get_big_query_export.rb | 47 - ...ve_event_threat_detection_custom_module.rb | 47 - ...security_health_analytics_custom_module.rb | 47 - ...et_event_threat_detection_custom_module.rb | 47 - .../security_center/get_iam_policy.rb | 47 - .../security_center/get_mute_config.rb | 47 - .../get_notification_config.rb | 47 - .../get_organization_settings.rb | 47 - .../get_resource_value_config.rb | 47 - ...security_health_analytics_custom_module.rb | 47 - .../security_center/get_simulation.rb | 47 - .../snippets/security_center/get_source.rb | 47 - .../security_center/get_valued_resource.rb | 47 - .../snippets/security_center/group_assets.rb | 51 - .../security_center/group_findings.rb | 51 - .../snippets/security_center/list_assets.rb | 51 - .../security_center/list_attack_paths.rb | 51 - .../security_center/list_big_query_exports.rb | 51 - ...t_event_threat_detection_custom_modules.rb | 51 - ...ecurity_health_analytics_custom_modules.rb | 51 - ...e_event_threat_detection_custom_modules.rb | 51 - ...ecurity_health_analytics_custom_modules.rb | 51 - ...t_event_threat_detection_custom_modules.rb | 51 - .../snippets/security_center/list_findings.rb | 51 - .../security_center/list_mute_configs.rb | 51 - .../list_notification_configs.rb | 51 - .../list_resource_value_configs.rb | 51 - ...ecurity_health_analytics_custom_modules.rb | 51 - .../snippets/security_center/list_sources.rb | 51 - .../security_center/list_valued_resources.rb | 51 - .../security_center/run_asset_discovery.rb | 54 - .../security_center/set_finding_state.rb | 47 - .../security_center/set_iam_policy.rb | 47 - .../snippets/security_center/set_mute.rb | 47 - ...security_health_analytics_custom_module.rb | 47 - .../security_center/test_iam_permissions.rb | 47 - .../update_big_query_export.rb | 47 - ...te_event_threat_detection_custom_module.rb | 47 - .../security_center/update_external_system.rb | 47 - .../security_center/update_finding.rb | 47 - .../security_center/update_mute_config.rb | 47 - .../update_notification_config.rb | 47 - .../update_organization_settings.rb | 47 - .../update_resource_value_config.rb | 47 - ...security_health_analytics_custom_module.rb | 47 - .../security_center/update_security_marks.rb | 47 - .../snippets/security_center/update_source.rb | 47 - ...te_event_threat_detection_custom_module.rb | 47 - ...tadata_google.cloud.securitycenter.v1.json | 2535 ------ .../v1/security_center_operations_test.rb | 400 - .../v1/security_center_paths_test.rb | 487 -- .../v1/security_center_rest_test.rb | 3594 -------- .../v1/security_center_test.rb | 4053 --------- .../test/helper.rb | 26 - .../.gitignore | 22 - .../.repo-metadata.json | 18 - .../.rubocop.yml | 33 - .../.toys.rb | 28 - .../.yardopts | 12 - .../AUTHENTICATION.md | 122 - .../CHANGELOG.md | 2 - .../Gemfile | 14 - .../LICENSE.md | 201 - .../README.md | 153 - .../Rakefile | 169 - .../gapic_metadata.json | 133 - ...le-cloud-security_center-v1p1beta1.gemspec | 29 - .../google-cloud-security_center-v1p1beta1.rb | 21 - .../google/cloud/security_center/v1p1beta1.rb | 45 - .../cloud/security_center/v1p1beta1/rest.rb | 37 - .../v1p1beta1/security_center.rb | 56 - .../v1p1beta1/security_center/client.rb | 3250 ------- .../v1p1beta1/security_center/credentials.rb | 51 - .../v1p1beta1/security_center/operations.rb | 841 -- .../v1p1beta1/security_center/paths.rb | 330 - .../v1p1beta1/security_center/rest.rb | 53 - .../v1p1beta1/security_center/rest/client.rb | 3046 ------- .../security_center/rest/operations.rb | 925 -- .../security_center/rest/service_stub.rb | 1645 ---- .../security_center/v1p1beta1/version.rb | 28 - .../securitycenter/v1p1beta1/asset_pb.rb | 29 - .../securitycenter/v1p1beta1/finding_pb.rb | 29 - .../securitycenter/v1p1beta1/folder_pb.rb | 21 - .../v1p1beta1/notification_config_pb.rb | 26 - .../v1p1beta1/notification_message_pb.rb | 24 - .../v1p1beta1/organization_settings_pb.rb | 25 - .../securitycenter/v1p1beta1/resource_pb.rb | 24 - .../run_asset_discovery_response_pb.rb | 24 - .../v1p1beta1/security_marks_pb.rb | 23 - .../v1p1beta1/securitycenter_service_pb.rb | 74 - .../securitycenter_service_services_pb.rb | 107 - .../securitycenter/v1p1beta1/source_pb.rb | 23 - .../proto_docs/README.md | 4 - .../proto_docs/google/api/client.rb | 589 -- .../proto_docs/google/api/field_behavior.rb | 85 - .../proto_docs/google/api/launch_stage.rb | 71 - .../proto_docs/google/api/resource.rb | 227 - .../cloud/securitycenter/v1p1beta1/asset.rb | 141 - .../cloud/securitycenter/v1p1beta1/finding.rb | 146 - .../cloud/securitycenter/v1p1beta1/folder.rb | 40 - .../v1p1beta1/notification_config.rb | 98 - .../v1p1beta1/notification_message.rb | 42 - .../v1p1beta1/organization_settings.rb | 86 - .../securitycenter/v1p1beta1/resource.rb | 53 - .../v1p1beta1/run_asset_discovery_response.rb | 54 - .../v1p1beta1/security_marks.rb | 71 - .../v1p1beta1/securitycenter_service.rb | 1053 --- .../cloud/securitycenter/v1p1beta1/source.rb | 64 - .../proto_docs/google/iam/v1/iam_policy.rb | 87 - .../proto_docs/google/iam/v1/options.rb | 50 - .../proto_docs/google/iam/v1/policy.rb | 426 - .../google/longrunning/operations.rb | 191 - .../proto_docs/google/protobuf/any.rb | 145 - .../proto_docs/google/protobuf/duration.rb | 98 - .../proto_docs/google/protobuf/empty.rb | 34 - .../proto_docs/google/protobuf/field_mask.rb | 229 - .../proto_docs/google/protobuf/struct.rb | 108 - .../proto_docs/google/protobuf/timestamp.rb | 127 - .../proto_docs/google/rpc/status.rb | 48 - .../proto_docs/google/type/expr.rb | 75 - .../snippets/Gemfile | 32 - .../security_center/create_finding.rb | 47 - .../create_notification_config.rb | 47 - .../snippets/security_center/create_source.rb | 47 - .../delete_notification_config.rb | 47 - .../security_center/get_iam_policy.rb | 47 - .../get_notification_config.rb | 47 - .../get_organization_settings.rb | 47 - .../snippets/security_center/get_source.rb | 47 - .../snippets/security_center/group_assets.rb | 51 - .../security_center/group_findings.rb | 51 - .../snippets/security_center/list_assets.rb | 51 - .../snippets/security_center/list_findings.rb | 51 - .../list_notification_configs.rb | 51 - .../snippets/security_center/list_sources.rb | 51 - .../security_center/run_asset_discovery.rb | 54 - .../security_center/set_finding_state.rb | 47 - .../security_center/set_iam_policy.rb | 47 - .../security_center/test_iam_permissions.rb | 47 - .../security_center/update_finding.rb | 47 - .../update_notification_config.rb | 47 - .../update_organization_settings.rb | 47 - .../security_center/update_security_marks.rb | 47 - .../snippets/security_center/update_source.rb | 47 - ...google.cloud.securitycenter.v1p1beta1.json | 935 --- .../security_center_operations_test.rb | 400 - .../v1p1beta1/security_center_paths_test.rb | 178 - .../v1p1beta1/security_center_rest_test.rb | 1388 --- .../v1p1beta1/security_center_test.rb | 1581 ---- .../test/helper.rb | 26 - .../.gitignore | 22 - .../.repo-metadata.json | 18 - .../.rubocop.yml | 33 - .../google-cloud-security_center-v2/.toys.rb | 28 - .../google-cloud-security_center-v2/.yardopts | 12 - .../AUTHENTICATION.md | 122 - .../CHANGELOG.md | 2 - .../google-cloud-security_center-v2/Gemfile | 14 - .../LICENSE.md | 201 - .../google-cloud-security_center-v2/README.md | 154 - .../google-cloud-security_center-v2/Rakefile | 169 - .../gapic_metadata.json | 218 - .../google-cloud-security_center-v2.gemspec | 29 - .../lib/google-cloud-security_center-v2.rb | 21 - .../lib/google/cloud/security_center/v2.rb | 45 - .../google/cloud/security_center/v2/rest.rb | 37 - .../security_center/v2/security_center.rb | 56 - .../v2/security_center/client.rb | 4791 ----------- .../v2/security_center/credentials.rb | 51 - .../v2/security_center/operations.rb | 841 -- .../v2/security_center/paths.rb | 1068 --- .../v2/security_center/rest.rb | 53 - .../v2/security_center/rest/client.rb | 4393 ---------- .../v2/security_center/rest/operations.rb | 924 -- .../v2/security_center/rest/service_stub.rb | 3336 -------- .../cloud/security_center/v2/version.rb | 28 - .../cloud/securitycenter/v2/access_pb.rb | 23 - .../v2/affected_resources_pb.rb | 21 - .../cloud/securitycenter/v2/ai_model_pb.rb | 22 - .../cloud/securitycenter/v2/application_pb.rb | 21 - .../securitycenter/v2/attack_exposure_pb.rb | 25 - .../cloud/securitycenter/v2/attack_path_pb.rb | 28 - .../v2/backup_disaster_recovery_pb.rb | 23 - .../securitycenter/v2/bigquery_export_pb.rb | 25 - .../cloud/securitycenter/v2/chokepoint_pb.rb | 21 - .../cloud/securitycenter/v2/cloud_armor_pb.rb | 27 - .../v2/cloud_dlp_data_profile_pb.rb | 24 - .../v2/cloud_dlp_inspection_pb.rb | 23 - .../cloud/securitycenter/v2/compliance_pb.rb | 21 - .../cloud/securitycenter/v2/connection_pb.rb | 22 - .../securitycenter/v2/contact_details_pb.rb | 22 - .../cloud/securitycenter/v2/container_pb.rb | 24 - .../securitycenter/v2/data_access_event_pb.rb | 24 - .../securitycenter/v2/data_flow_event_pb.rb | 24 - .../v2/data_retention_deletion_event_pb.rb | 25 - .../cloud/securitycenter/v2/database_pb.rb | 21 - .../google/cloud/securitycenter/v2/disk_pb.rb | 21 - .../securitycenter/v2/exfiltration_pb.rb | 22 - .../securitycenter/v2/external_system_pb.rb | 25 - .../google/cloud/securitycenter/v2/file_pb.rb | 24 - .../cloud/securitycenter/v2/finding_pb.rb | 74 - .../cloud/securitycenter/v2/folder_pb.rb | 21 - .../securitycenter/v2/group_membership_pb.rb | 22 - .../cloud/securitycenter/v2/iam_binding_pb.rb | 22 - .../cloud/securitycenter/v2/indicator_pb.rb | 26 - .../cloud/securitycenter/v2/ip_rules_pb.rb | 28 - .../google/cloud/securitycenter/v2/job_pb.rb | 24 - .../securitycenter/v2/kernel_rootkit_pb.rb | 21 - .../cloud/securitycenter/v2/kubernetes_pb.rb | 34 - .../cloud/securitycenter/v2/label_pb.rb | 21 - .../securitycenter/v2/load_balancer_pb.rb | 21 - .../cloud/securitycenter/v2/log_entry_pb.rb | 24 - .../securitycenter/v2/mitre_attack_pb.rb | 23 - .../cloud/securitycenter/v2/mute_config_pb.rb | 26 - .../cloud/securitycenter/v2/network_pb.rb | 21 - .../cloud/securitycenter/v2/notebook_pb.rb | 23 - .../v2/notification_config_pb.rb | 26 - .../v2/notification_message_pb.rb | 24 - .../cloud/securitycenter/v2/org_policy_pb.rb | 24 - .../cloud/securitycenter/v2/process_pb.rb | 24 - .../cloud/securitycenter/v2/resource_pb.rb | 39 - .../v2/resource_value_config_pb.rb | 28 - .../securitycenter/v2/security_marks_pb.rb | 23 - .../securitycenter/v2/security_posture_pb.rb | 22 - .../v2/securitycenter_service_pb.rb | 101 - .../v2/securitycenter_service_services_pb.rb | 167 - .../cloud/securitycenter/v2/simulation_pb.rb | 27 - .../cloud/securitycenter/v2/source_pb.rb | 23 - .../securitycenter/v2/toxic_combination_pb.rb | 21 - .../securitycenter/v2/valued_resource_pb.rb | 25 - .../cloud/securitycenter/v2/vertex_ai_pb.rb | 23 - .../securitycenter/v2/vulnerability_pb.rb | 37 - .../proto_docs/README.md | 4 - .../proto_docs/google/api/client.rb | 589 -- .../proto_docs/google/api/field_behavior.rb | 85 - .../proto_docs/google/api/launch_stage.rb | 71 - .../proto_docs/google/api/resource.rb | 227 - .../proto_docs/google/api/routing.rb | 463 - .../google/cloud/securitycenter/v2/access.rb | 120 - .../securitycenter/v2/affected_resources.rb | 35 - .../cloud/securitycenter/v2/ai_model.rb | 71 - .../cloud/securitycenter/v2/application.rb | 40 - .../securitycenter/v2/attack_exposure.rb | 73 - .../cloud/securitycenter/v2/attack_path.rb | 147 - .../v2/backup_disaster_recovery.rb | 90 - .../securitycenter/v2/bigquery_export.rb | 96 - .../cloud/securitycenter/v2/chokepoint.rb | 39 - .../cloud/securitycenter/v2/cloud_armor.rb | 138 - .../v2/cloud_dlp_data_profile.rb | 52 - .../securitycenter/v2/cloud_dlp_inspection.rb | 50 - .../cloud/securitycenter/v2/compliance.rb | 43 - .../cloud/securitycenter/v2/connection.rb | 70 - .../securitycenter/v2/contact_details.rb | 44 - .../cloud/securitycenter/v2/container.rb | 49 - .../securitycenter/v2/data_access_event.rb | 61 - .../securitycenter/v2/data_flow_event.rb | 65 - .../v2/data_retention_deletion_event.rb | 69 - .../cloud/securitycenter/v2/database.rb | 67 - .../google/cloud/securitycenter/v2/disk.rb | 36 - .../cloud/securitycenter/v2/exfiltration.rb | 64 - .../securitycenter/v2/external_system.rb | 106 - .../google/cloud/securitycenter/v2/file.rb | 105 - .../google/cloud/securitycenter/v2/finding.rb | 524 -- .../google/cloud/securitycenter/v2/folder.rb | 40 - .../securitycenter/v2/group_membership.rb | 51 - .../cloud/securitycenter/v2/iam_binding.rb | 56 - .../cloud/securitycenter/v2/indicator.rb | 116 - .../cloud/securitycenter/v2/ip_rules.rb | 122 - .../google/cloud/securitycenter/v2/job.rb | 65 - .../cloud/securitycenter/v2/kernel_rootkit.rb | 66 - .../cloud/securitycenter/v2/kubernetes.rb | 241 - .../google/cloud/securitycenter/v2/label.rb | 41 - .../cloud/securitycenter/v2/load_balancer.rb | 36 - .../cloud/securitycenter/v2/log_entry.rb | 58 - .../cloud/securitycenter/v2/mitre_attack.rb | 521 -- .../cloud/securitycenter/v2/mute_config.rb | 113 - .../google/cloud/securitycenter/v2/network.rb | 36 - .../cloud/securitycenter/v2/notebook.rb | 46 - .../securitycenter/v2/notification_config.rb | 94 - .../securitycenter/v2/notification_message.rb | 42 - .../cloud/securitycenter/v2/org_policy.rb | 37 - .../google/cloud/securitycenter/v2/process.rb | 83 - .../cloud/securitycenter/v2/resource.rb | 314 - .../v2/resource_value_config.rb | 127 - .../cloud/securitycenter/v2/security_marks.rb | 84 - .../securitycenter/v2/security_posture.rb | 83 - .../v2/securitycenter_service.rb | 1216 --- .../cloud/securitycenter/v2/simulation.rb | 46 - .../google/cloud/securitycenter/v2/source.rb | 65 - .../securitycenter/v2/toxic_combination.rb | 46 - .../securitycenter/v2/valued_resource.rb | 86 - .../cloud/securitycenter/v2/vertex_ai.rb | 68 - .../cloud/securitycenter/v2/vulnerability.rb | 365 - .../proto_docs/google/iam/v1/iam_policy.rb | 87 - .../proto_docs/google/iam/v1/options.rb | 50 - .../proto_docs/google/iam/v1/policy.rb | 426 - .../google/longrunning/operations.rb | 191 - .../proto_docs/google/protobuf/any.rb | 145 - .../proto_docs/google/protobuf/duration.rb | 98 - .../proto_docs/google/protobuf/empty.rb | 34 - .../proto_docs/google/protobuf/field_mask.rb | 229 - .../proto_docs/google/protobuf/struct.rb | 108 - .../proto_docs/google/protobuf/timestamp.rb | 127 - .../proto_docs/google/rpc/status.rb | 48 - .../proto_docs/google/type/expr.rb | 75 - .../snippets/Gemfile | 32 - .../batch_create_resource_value_configs.rb | 47 - .../security_center/bulk_mute_findings.rb | 54 - .../create_big_query_export.rb | 47 - .../security_center/create_finding.rb | 47 - .../security_center/create_mute_config.rb | 47 - .../create_notification_config.rb | 47 - .../snippets/security_center/create_source.rb | 47 - .../delete_big_query_export.rb | 47 - .../security_center/delete_mute_config.rb | 47 - .../delete_notification_config.rb | 47 - .../delete_resource_value_config.rb | 47 - .../security_center/get_big_query_export.rb | 47 - .../security_center/get_iam_policy.rb | 47 - .../security_center/get_mute_config.rb | 47 - .../get_notification_config.rb | 47 - .../get_resource_value_config.rb | 47 - .../security_center/get_simulation.rb | 47 - .../snippets/security_center/get_source.rb | 47 - .../security_center/get_valued_resource.rb | 47 - .../security_center/group_findings.rb | 51 - .../security_center/list_attack_paths.rb | 51 - .../security_center/list_big_query_exports.rb | 51 - .../snippets/security_center/list_findings.rb | 51 - .../security_center/list_mute_configs.rb | 51 - .../list_notification_configs.rb | 51 - .../list_resource_value_configs.rb | 51 - .../snippets/security_center/list_sources.rb | 51 - .../security_center/list_valued_resources.rb | 51 - .../security_center/set_finding_state.rb | 47 - .../security_center/set_iam_policy.rb | 47 - .../snippets/security_center/set_mute.rb | 47 - .../security_center/test_iam_permissions.rb | 47 - .../update_big_query_export.rb | 47 - .../security_center/update_external_system.rb | 47 - .../security_center/update_finding.rb | 47 - .../security_center/update_mute_config.rb | 47 - .../update_notification_config.rb | 47 - .../update_resource_value_config.rb | 47 - .../security_center/update_security_marks.rb | 47 - .../snippets/security_center/update_source.rb | 47 - ...tadata_google.cloud.securitycenter.v2.json | 1615 ---- .../v2/security_center_operations_test.rb | 400 - .../v2/security_center_paths_test.rb | 403 - .../v2/security_center_rest_test.rb | 2311 ----- .../v2/security_center_test.rb | 2592 ------ .../test/helper.rb | 26 - .../.gitignore | 22 - .../.repo-metadata.json | 17 - .../.rubocop.yml | 33 - .../.toys.rb | 28 - .../.yardopts | 12 - .../AUTHENTICATION.md | 122 - .../CHANGELOG.md | 2 - .../Gemfile | 14 - .../LICENSE.md | 201 - .../README.md | 154 - .../Rakefile | 169 - .../gapic_metadata.json | 123 - ...loud-security_center_management-v1.gemspec | 30 - ...gle-cloud-security_center_management-v1.rb | 21 - .../cloud/security_center_management/v1.rb | 45 - .../v1/bindings_override.rb | 75 - .../security_center_management/v1/rest.rb | 38 - .../v1/security_center_management.rb | 55 - .../v1/security_center_management/client.rb | 2790 ------ .../security_center_management/credentials.rb | 47 - .../v1/security_center_management/paths.rb | 374 - .../v1/security_center_management/rest.rb | 53 - .../security_center_management/rest/client.rb | 2608 ------ .../rest/service_stub.rb | 1677 ---- .../security_center_management/v1/version.rb | 28 - .../v1/security_center_management_pb.rb | 86 - .../security_center_management_services_pb.rb | 141 - .../proto_docs/README.md | 4 - .../proto_docs/google/api/client.rb | 589 -- .../proto_docs/google/api/field_behavior.rb | 85 - .../proto_docs/google/api/launch_stage.rb | 71 - .../proto_docs/google/api/resource.rb | 227 - .../v1/security_center_management.rb | 1334 --- .../proto_docs/google/iam/v1/policy.rb | 426 - .../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/struct.rb | 108 - .../proto_docs/google/protobuf/timestamp.rb | 127 - .../proto_docs/google/rpc/status.rb | 48 - .../proto_docs/google/type/expr.rb | 75 - .../snippets/Gemfile | 32 - ...te_event_threat_detection_custom_module.rb | 47 - ...security_health_analytics_custom_module.rb | 47 - ...te_event_threat_detection_custom_module.rb | 47 - ...security_health_analytics_custom_module.rb | 47 - ...ve_event_threat_detection_custom_module.rb | 47 - ...security_health_analytics_custom_module.rb | 47 - ...et_event_threat_detection_custom_module.rb | 47 - .../get_security_center_service.rb | 47 - ...security_health_analytics_custom_module.rb | 47 - ...t_event_threat_detection_custom_modules.rb | 51 - ...ecurity_health_analytics_custom_modules.rb | 51 - ...e_event_threat_detection_custom_modules.rb | 51 - ...ecurity_health_analytics_custom_modules.rb | 51 - ...t_event_threat_detection_custom_modules.rb | 51 - .../list_security_center_services.rb | 51 - ...ecurity_health_analytics_custom_modules.rb | 51 - ...security_health_analytics_custom_module.rb | 47 - ...te_event_threat_detection_custom_module.rb | 47 - .../update_security_center_service.rb | 47 - ...security_health_analytics_custom_module.rb | 47 - ...te_event_threat_detection_custom_module.rb | 47 - ...gle.cloud.securitycentermanagement.v1.json | 855 -- .../security_center_management_paths_test.rb | 169 - .../security_center_management_rest_test.rb | 1265 --- .../v1/security_center_management_test.rb | 1421 ---- .../test/helper.rb | 26 - 2039 files changed, 2907 insertions(+), 463108 deletions(-) delete mode 100644 owl-bot-staging/google-cloud-redis-cluster-v1beta1/.gitignore delete mode 100644 owl-bot-staging/google-cloud-redis-cluster-v1beta1/.repo-metadata.json delete mode 100644 owl-bot-staging/google-cloud-redis-cluster-v1beta1/.rubocop.yml delete mode 100644 owl-bot-staging/google-cloud-redis-cluster-v1beta1/.toys.rb delete mode 100644 owl-bot-staging/google-cloud-redis-cluster-v1beta1/.yardopts delete mode 100644 owl-bot-staging/google-cloud-redis-cluster-v1beta1/AUTHENTICATION.md delete mode 100644 owl-bot-staging/google-cloud-redis-cluster-v1beta1/CHANGELOG.md delete mode 100644 owl-bot-staging/google-cloud-redis-cluster-v1beta1/Gemfile delete mode 100644 owl-bot-staging/google-cloud-redis-cluster-v1beta1/LICENSE.md delete mode 100644 owl-bot-staging/google-cloud-redis-cluster-v1beta1/README.md delete mode 100644 owl-bot-staging/google-cloud-redis-cluster-v1beta1/Rakefile delete mode 100644 owl-bot-staging/google-cloud-redis-cluster-v1beta1/gapic_metadata.json delete mode 100644 owl-bot-staging/google-cloud-redis-cluster-v1beta1/google-cloud-redis-cluster-v1beta1.gemspec delete mode 100644 owl-bot-staging/google-cloud-redis-cluster-v1beta1/lib/google-cloud-redis-cluster-v1beta1.rb delete mode 100644 owl-bot-staging/google-cloud-redis-cluster-v1beta1/lib/google/cloud/redis/cluster/v1beta1.rb delete mode 100644 owl-bot-staging/google-cloud-redis-cluster-v1beta1/lib/google/cloud/redis/cluster/v1beta1/bindings_override.rb delete mode 100644 owl-bot-staging/google-cloud-redis-cluster-v1beta1/lib/google/cloud/redis/cluster/v1beta1/cloud_redis_cluster.rb delete mode 100644 owl-bot-staging/google-cloud-redis-cluster-v1beta1/lib/google/cloud/redis/cluster/v1beta1/cloud_redis_cluster/client.rb delete mode 100644 owl-bot-staging/google-cloud-redis-cluster-v1beta1/lib/google/cloud/redis/cluster/v1beta1/cloud_redis_cluster/credentials.rb delete mode 100644 owl-bot-staging/google-cloud-redis-cluster-v1beta1/lib/google/cloud/redis/cluster/v1beta1/cloud_redis_cluster/operations.rb delete mode 100644 owl-bot-staging/google-cloud-redis-cluster-v1beta1/lib/google/cloud/redis/cluster/v1beta1/cloud_redis_cluster/paths.rb delete mode 100644 owl-bot-staging/google-cloud-redis-cluster-v1beta1/lib/google/cloud/redis/cluster/v1beta1/cloud_redis_cluster/rest.rb delete mode 100644 owl-bot-staging/google-cloud-redis-cluster-v1beta1/lib/google/cloud/redis/cluster/v1beta1/cloud_redis_cluster/rest/client.rb delete mode 100644 owl-bot-staging/google-cloud-redis-cluster-v1beta1/lib/google/cloud/redis/cluster/v1beta1/cloud_redis_cluster/rest/operations.rb delete mode 100644 owl-bot-staging/google-cloud-redis-cluster-v1beta1/lib/google/cloud/redis/cluster/v1beta1/cloud_redis_cluster/rest/service_stub.rb delete mode 100644 owl-bot-staging/google-cloud-redis-cluster-v1beta1/lib/google/cloud/redis/cluster/v1beta1/cloud_redis_cluster_pb.rb delete mode 100644 owl-bot-staging/google-cloud-redis-cluster-v1beta1/lib/google/cloud/redis/cluster/v1beta1/cloud_redis_cluster_services_pb.rb delete mode 100644 owl-bot-staging/google-cloud-redis-cluster-v1beta1/lib/google/cloud/redis/cluster/v1beta1/rest.rb delete mode 100644 owl-bot-staging/google-cloud-redis-cluster-v1beta1/lib/google/cloud/redis/cluster/v1beta1/version.rb delete mode 100644 owl-bot-staging/google-cloud-redis-cluster-v1beta1/proto_docs/README.md delete mode 100644 owl-bot-staging/google-cloud-redis-cluster-v1beta1/proto_docs/google/api/client.rb delete mode 100644 owl-bot-staging/google-cloud-redis-cluster-v1beta1/proto_docs/google/api/field_behavior.rb delete mode 100644 owl-bot-staging/google-cloud-redis-cluster-v1beta1/proto_docs/google/api/field_info.rb delete mode 100644 owl-bot-staging/google-cloud-redis-cluster-v1beta1/proto_docs/google/api/launch_stage.rb delete mode 100644 owl-bot-staging/google-cloud-redis-cluster-v1beta1/proto_docs/google/api/resource.rb delete mode 100644 owl-bot-staging/google-cloud-redis-cluster-v1beta1/proto_docs/google/cloud/redis/cluster/v1beta1/cloud_redis_cluster.rb delete mode 100644 owl-bot-staging/google-cloud-redis-cluster-v1beta1/proto_docs/google/longrunning/operations.rb delete mode 100644 owl-bot-staging/google-cloud-redis-cluster-v1beta1/proto_docs/google/protobuf/any.rb delete mode 100644 owl-bot-staging/google-cloud-redis-cluster-v1beta1/proto_docs/google/protobuf/duration.rb delete mode 100644 owl-bot-staging/google-cloud-redis-cluster-v1beta1/proto_docs/google/protobuf/empty.rb delete mode 100644 owl-bot-staging/google-cloud-redis-cluster-v1beta1/proto_docs/google/protobuf/field_mask.rb delete mode 100644 owl-bot-staging/google-cloud-redis-cluster-v1beta1/proto_docs/google/protobuf/timestamp.rb delete mode 100644 owl-bot-staging/google-cloud-redis-cluster-v1beta1/proto_docs/google/rpc/status.rb delete mode 100644 owl-bot-staging/google-cloud-redis-cluster-v1beta1/proto_docs/google/type/dayofweek.rb delete mode 100644 owl-bot-staging/google-cloud-redis-cluster-v1beta1/proto_docs/google/type/timeofday.rb delete mode 100644 owl-bot-staging/google-cloud-redis-cluster-v1beta1/snippets/Gemfile delete mode 100644 owl-bot-staging/google-cloud-redis-cluster-v1beta1/snippets/cloud_redis_cluster/backup_cluster.rb delete mode 100644 owl-bot-staging/google-cloud-redis-cluster-v1beta1/snippets/cloud_redis_cluster/create_cluster.rb delete mode 100644 owl-bot-staging/google-cloud-redis-cluster-v1beta1/snippets/cloud_redis_cluster/delete_backup.rb delete mode 100644 owl-bot-staging/google-cloud-redis-cluster-v1beta1/snippets/cloud_redis_cluster/delete_cluster.rb delete mode 100644 owl-bot-staging/google-cloud-redis-cluster-v1beta1/snippets/cloud_redis_cluster/export_backup.rb delete mode 100644 owl-bot-staging/google-cloud-redis-cluster-v1beta1/snippets/cloud_redis_cluster/get_backup.rb delete mode 100644 owl-bot-staging/google-cloud-redis-cluster-v1beta1/snippets/cloud_redis_cluster/get_backup_collection.rb delete mode 100644 owl-bot-staging/google-cloud-redis-cluster-v1beta1/snippets/cloud_redis_cluster/get_cluster.rb delete mode 100644 owl-bot-staging/google-cloud-redis-cluster-v1beta1/snippets/cloud_redis_cluster/get_cluster_certificate_authority.rb delete mode 100644 owl-bot-staging/google-cloud-redis-cluster-v1beta1/snippets/cloud_redis_cluster/list_backup_collections.rb delete mode 100644 owl-bot-staging/google-cloud-redis-cluster-v1beta1/snippets/cloud_redis_cluster/list_backups.rb delete mode 100644 owl-bot-staging/google-cloud-redis-cluster-v1beta1/snippets/cloud_redis_cluster/list_clusters.rb delete mode 100644 owl-bot-staging/google-cloud-redis-cluster-v1beta1/snippets/cloud_redis_cluster/reschedule_cluster_maintenance.rb delete mode 100644 owl-bot-staging/google-cloud-redis-cluster-v1beta1/snippets/cloud_redis_cluster/update_cluster.rb delete mode 100644 owl-bot-staging/google-cloud-redis-cluster-v1beta1/snippets/snippet_metadata_google.cloud.redis.cluster.v1beta1.json delete mode 100644 owl-bot-staging/google-cloud-redis-cluster-v1beta1/test/google/cloud/redis/cluster/v1beta1/cloud_redis_cluster_operations_test.rb delete mode 100644 owl-bot-staging/google-cloud-redis-cluster-v1beta1/test/google/cloud/redis/cluster/v1beta1/cloud_redis_cluster_paths_test.rb delete mode 100644 owl-bot-staging/google-cloud-redis-cluster-v1beta1/test/google/cloud/redis/cluster/v1beta1/cloud_redis_cluster_rest_test.rb delete mode 100644 owl-bot-staging/google-cloud-redis-cluster-v1beta1/test/google/cloud/redis/cluster/v1beta1/cloud_redis_cluster_test.rb delete mode 100644 owl-bot-staging/google-cloud-redis-cluster-v1beta1/test/helper.rb delete mode 100644 owl-bot-staging/google-cloud-redis-v1/.gitignore delete mode 100644 owl-bot-staging/google-cloud-redis-v1/.repo-metadata.json delete mode 100644 owl-bot-staging/google-cloud-redis-v1/.rubocop.yml delete mode 100644 owl-bot-staging/google-cloud-redis-v1/.toys.rb delete mode 100644 owl-bot-staging/google-cloud-redis-v1/.yardopts delete mode 100644 owl-bot-staging/google-cloud-redis-v1/AUTHENTICATION.md delete mode 100644 owl-bot-staging/google-cloud-redis-v1/CHANGELOG.md delete mode 100644 owl-bot-staging/google-cloud-redis-v1/Gemfile delete mode 100644 owl-bot-staging/google-cloud-redis-v1/LICENSE.md delete mode 100644 owl-bot-staging/google-cloud-redis-v1/README.md delete mode 100644 owl-bot-staging/google-cloud-redis-v1/Rakefile delete mode 100644 owl-bot-staging/google-cloud-redis-v1/gapic_metadata.json delete mode 100644 owl-bot-staging/google-cloud-redis-v1/google-cloud-redis-v1.gemspec delete mode 100644 owl-bot-staging/google-cloud-redis-v1/lib/google-cloud-redis-v1.rb delete mode 100644 owl-bot-staging/google-cloud-redis-v1/lib/google/cloud/redis/v1.rb delete mode 100644 owl-bot-staging/google-cloud-redis-v1/lib/google/cloud/redis/v1/bindings_override.rb delete mode 100644 owl-bot-staging/google-cloud-redis-v1/lib/google/cloud/redis/v1/cloud_redis.rb delete mode 100644 owl-bot-staging/google-cloud-redis-v1/lib/google/cloud/redis/v1/cloud_redis/client.rb delete mode 100644 owl-bot-staging/google-cloud-redis-v1/lib/google/cloud/redis/v1/cloud_redis/credentials.rb delete mode 100644 owl-bot-staging/google-cloud-redis-v1/lib/google/cloud/redis/v1/cloud_redis/operations.rb delete mode 100644 owl-bot-staging/google-cloud-redis-v1/lib/google/cloud/redis/v1/cloud_redis/paths.rb delete mode 100644 owl-bot-staging/google-cloud-redis-v1/lib/google/cloud/redis/v1/cloud_redis/rest.rb delete mode 100644 owl-bot-staging/google-cloud-redis-v1/lib/google/cloud/redis/v1/cloud_redis/rest/client.rb delete mode 100644 owl-bot-staging/google-cloud-redis-v1/lib/google/cloud/redis/v1/cloud_redis/rest/operations.rb delete mode 100644 owl-bot-staging/google-cloud-redis-v1/lib/google/cloud/redis/v1/cloud_redis/rest/service_stub.rb delete mode 100644 owl-bot-staging/google-cloud-redis-v1/lib/google/cloud/redis/v1/cloud_redis_pb.rb delete mode 100644 owl-bot-staging/google-cloud-redis-v1/lib/google/cloud/redis/v1/cloud_redis_services_pb.rb delete mode 100644 owl-bot-staging/google-cloud-redis-v1/lib/google/cloud/redis/v1/rest.rb delete mode 100644 owl-bot-staging/google-cloud-redis-v1/lib/google/cloud/redis/v1/version.rb delete mode 100644 owl-bot-staging/google-cloud-redis-v1/proto_docs/README.md delete mode 100644 owl-bot-staging/google-cloud-redis-v1/proto_docs/google/api/client.rb delete mode 100644 owl-bot-staging/google-cloud-redis-v1/proto_docs/google/api/field_behavior.rb delete mode 100644 owl-bot-staging/google-cloud-redis-v1/proto_docs/google/api/launch_stage.rb delete mode 100644 owl-bot-staging/google-cloud-redis-v1/proto_docs/google/api/resource.rb delete mode 100644 owl-bot-staging/google-cloud-redis-v1/proto_docs/google/cloud/redis/v1/cloud_redis.rb delete mode 100644 owl-bot-staging/google-cloud-redis-v1/proto_docs/google/longrunning/operations.rb delete mode 100644 owl-bot-staging/google-cloud-redis-v1/proto_docs/google/protobuf/any.rb delete mode 100644 owl-bot-staging/google-cloud-redis-v1/proto_docs/google/protobuf/duration.rb delete mode 100644 owl-bot-staging/google-cloud-redis-v1/proto_docs/google/protobuf/empty.rb delete mode 100644 owl-bot-staging/google-cloud-redis-v1/proto_docs/google/protobuf/field_mask.rb delete mode 100644 owl-bot-staging/google-cloud-redis-v1/proto_docs/google/protobuf/timestamp.rb delete mode 100644 owl-bot-staging/google-cloud-redis-v1/proto_docs/google/rpc/status.rb delete mode 100644 owl-bot-staging/google-cloud-redis-v1/proto_docs/google/type/dayofweek.rb delete mode 100644 owl-bot-staging/google-cloud-redis-v1/proto_docs/google/type/timeofday.rb delete mode 100644 owl-bot-staging/google-cloud-redis-v1/snippets/Gemfile delete mode 100644 owl-bot-staging/google-cloud-redis-v1/snippets/cloud_redis/create_instance.rb delete mode 100644 owl-bot-staging/google-cloud-redis-v1/snippets/cloud_redis/delete_instance.rb delete mode 100644 owl-bot-staging/google-cloud-redis-v1/snippets/cloud_redis/export_instance.rb delete mode 100644 owl-bot-staging/google-cloud-redis-v1/snippets/cloud_redis/failover_instance.rb delete mode 100644 owl-bot-staging/google-cloud-redis-v1/snippets/cloud_redis/get_instance.rb delete mode 100644 owl-bot-staging/google-cloud-redis-v1/snippets/cloud_redis/get_instance_auth_string.rb delete mode 100644 owl-bot-staging/google-cloud-redis-v1/snippets/cloud_redis/import_instance.rb delete mode 100644 owl-bot-staging/google-cloud-redis-v1/snippets/cloud_redis/list_instances.rb delete mode 100644 owl-bot-staging/google-cloud-redis-v1/snippets/cloud_redis/reschedule_maintenance.rb delete mode 100644 owl-bot-staging/google-cloud-redis-v1/snippets/cloud_redis/update_instance.rb delete mode 100644 owl-bot-staging/google-cloud-redis-v1/snippets/cloud_redis/upgrade_instance.rb delete mode 100644 owl-bot-staging/google-cloud-redis-v1/snippets/snippet_metadata_google.cloud.redis.v1.json delete mode 100644 owl-bot-staging/google-cloud-redis-v1/test/google/cloud/redis/v1/cloud_redis_operations_test.rb delete mode 100644 owl-bot-staging/google-cloud-redis-v1/test/google/cloud/redis/v1/cloud_redis_paths_test.rb delete mode 100644 owl-bot-staging/google-cloud-redis-v1/test/google/cloud/redis/v1/cloud_redis_rest_test.rb delete mode 100644 owl-bot-staging/google-cloud-redis-v1/test/google/cloud/redis/v1/cloud_redis_test.rb delete mode 100644 owl-bot-staging/google-cloud-redis-v1/test/helper.rb delete mode 100644 owl-bot-staging/google-cloud-redis-v1beta1/.gitignore delete mode 100644 owl-bot-staging/google-cloud-redis-v1beta1/.repo-metadata.json delete mode 100644 owl-bot-staging/google-cloud-redis-v1beta1/.rubocop.yml delete mode 100644 owl-bot-staging/google-cloud-redis-v1beta1/.toys.rb delete mode 100644 owl-bot-staging/google-cloud-redis-v1beta1/.yardopts delete mode 100644 owl-bot-staging/google-cloud-redis-v1beta1/AUTHENTICATION.md delete mode 100644 owl-bot-staging/google-cloud-redis-v1beta1/CHANGELOG.md delete mode 100644 owl-bot-staging/google-cloud-redis-v1beta1/Gemfile delete mode 100644 owl-bot-staging/google-cloud-redis-v1beta1/LICENSE.md delete mode 100644 owl-bot-staging/google-cloud-redis-v1beta1/README.md delete mode 100644 owl-bot-staging/google-cloud-redis-v1beta1/Rakefile delete mode 100644 owl-bot-staging/google-cloud-redis-v1beta1/gapic_metadata.json delete mode 100644 owl-bot-staging/google-cloud-redis-v1beta1/google-cloud-redis-v1beta1.gemspec delete mode 100644 owl-bot-staging/google-cloud-redis-v1beta1/lib/google-cloud-redis-v1beta1.rb delete mode 100644 owl-bot-staging/google-cloud-redis-v1beta1/lib/google/cloud/redis/v1beta1.rb delete mode 100644 owl-bot-staging/google-cloud-redis-v1beta1/lib/google/cloud/redis/v1beta1/cloud_redis.rb delete mode 100644 owl-bot-staging/google-cloud-redis-v1beta1/lib/google/cloud/redis/v1beta1/cloud_redis/client.rb delete mode 100644 owl-bot-staging/google-cloud-redis-v1beta1/lib/google/cloud/redis/v1beta1/cloud_redis/credentials.rb delete mode 100644 owl-bot-staging/google-cloud-redis-v1beta1/lib/google/cloud/redis/v1beta1/cloud_redis/operations.rb delete mode 100644 owl-bot-staging/google-cloud-redis-v1beta1/lib/google/cloud/redis/v1beta1/cloud_redis/paths.rb delete mode 100644 owl-bot-staging/google-cloud-redis-v1beta1/lib/google/cloud/redis/v1beta1/cloud_redis/rest.rb delete mode 100644 owl-bot-staging/google-cloud-redis-v1beta1/lib/google/cloud/redis/v1beta1/cloud_redis/rest/client.rb delete mode 100644 owl-bot-staging/google-cloud-redis-v1beta1/lib/google/cloud/redis/v1beta1/cloud_redis/rest/operations.rb delete mode 100644 owl-bot-staging/google-cloud-redis-v1beta1/lib/google/cloud/redis/v1beta1/cloud_redis/rest/service_stub.rb delete mode 100644 owl-bot-staging/google-cloud-redis-v1beta1/lib/google/cloud/redis/v1beta1/cloud_redis_pb.rb delete mode 100644 owl-bot-staging/google-cloud-redis-v1beta1/lib/google/cloud/redis/v1beta1/cloud_redis_services_pb.rb delete mode 100644 owl-bot-staging/google-cloud-redis-v1beta1/lib/google/cloud/redis/v1beta1/rest.rb delete mode 100644 owl-bot-staging/google-cloud-redis-v1beta1/lib/google/cloud/redis/v1beta1/version.rb delete mode 100644 owl-bot-staging/google-cloud-redis-v1beta1/proto_docs/README.md delete mode 100644 owl-bot-staging/google-cloud-redis-v1beta1/proto_docs/google/api/client.rb delete mode 100644 owl-bot-staging/google-cloud-redis-v1beta1/proto_docs/google/api/field_behavior.rb delete mode 100644 owl-bot-staging/google-cloud-redis-v1beta1/proto_docs/google/api/launch_stage.rb delete mode 100644 owl-bot-staging/google-cloud-redis-v1beta1/proto_docs/google/api/resource.rb delete mode 100644 owl-bot-staging/google-cloud-redis-v1beta1/proto_docs/google/cloud/redis/v1beta1/cloud_redis.rb delete mode 100644 owl-bot-staging/google-cloud-redis-v1beta1/proto_docs/google/longrunning/operations.rb delete mode 100644 owl-bot-staging/google-cloud-redis-v1beta1/proto_docs/google/protobuf/any.rb delete mode 100644 owl-bot-staging/google-cloud-redis-v1beta1/proto_docs/google/protobuf/duration.rb delete mode 100644 owl-bot-staging/google-cloud-redis-v1beta1/proto_docs/google/protobuf/empty.rb delete mode 100644 owl-bot-staging/google-cloud-redis-v1beta1/proto_docs/google/protobuf/field_mask.rb delete mode 100644 owl-bot-staging/google-cloud-redis-v1beta1/proto_docs/google/protobuf/timestamp.rb delete mode 100644 owl-bot-staging/google-cloud-redis-v1beta1/proto_docs/google/rpc/status.rb delete mode 100644 owl-bot-staging/google-cloud-redis-v1beta1/proto_docs/google/type/dayofweek.rb delete mode 100644 owl-bot-staging/google-cloud-redis-v1beta1/proto_docs/google/type/timeofday.rb delete mode 100644 owl-bot-staging/google-cloud-redis-v1beta1/snippets/Gemfile delete mode 100644 owl-bot-staging/google-cloud-redis-v1beta1/snippets/cloud_redis/create_instance.rb delete mode 100644 owl-bot-staging/google-cloud-redis-v1beta1/snippets/cloud_redis/delete_instance.rb delete mode 100644 owl-bot-staging/google-cloud-redis-v1beta1/snippets/cloud_redis/export_instance.rb delete mode 100644 owl-bot-staging/google-cloud-redis-v1beta1/snippets/cloud_redis/failover_instance.rb delete mode 100644 owl-bot-staging/google-cloud-redis-v1beta1/snippets/cloud_redis/get_instance.rb delete mode 100644 owl-bot-staging/google-cloud-redis-v1beta1/snippets/cloud_redis/get_instance_auth_string.rb delete mode 100644 owl-bot-staging/google-cloud-redis-v1beta1/snippets/cloud_redis/import_instance.rb delete mode 100644 owl-bot-staging/google-cloud-redis-v1beta1/snippets/cloud_redis/list_instances.rb delete mode 100644 owl-bot-staging/google-cloud-redis-v1beta1/snippets/cloud_redis/reschedule_maintenance.rb delete mode 100644 owl-bot-staging/google-cloud-redis-v1beta1/snippets/cloud_redis/update_instance.rb delete mode 100644 owl-bot-staging/google-cloud-redis-v1beta1/snippets/cloud_redis/upgrade_instance.rb delete mode 100644 owl-bot-staging/google-cloud-redis-v1beta1/snippets/snippet_metadata_google.cloud.redis.v1beta1.json delete mode 100644 owl-bot-staging/google-cloud-redis-v1beta1/test/google/cloud/redis/v1beta1/cloud_redis_operations_test.rb delete mode 100644 owl-bot-staging/google-cloud-redis-v1beta1/test/google/cloud/redis/v1beta1/cloud_redis_paths_test.rb delete mode 100644 owl-bot-staging/google-cloud-redis-v1beta1/test/google/cloud/redis/v1beta1/cloud_redis_rest_test.rb delete mode 100644 owl-bot-staging/google-cloud-redis-v1beta1/test/google/cloud/redis/v1beta1/cloud_redis_test.rb delete mode 100644 owl-bot-staging/google-cloud-redis-v1beta1/test/helper.rb delete mode 100644 owl-bot-staging/google-cloud-resource_manager-v3/.gitignore delete mode 100644 owl-bot-staging/google-cloud-resource_manager-v3/.repo-metadata.json delete mode 100644 owl-bot-staging/google-cloud-resource_manager-v3/.rubocop.yml delete mode 100644 owl-bot-staging/google-cloud-resource_manager-v3/.toys.rb delete mode 100644 owl-bot-staging/google-cloud-resource_manager-v3/.yardopts delete mode 100644 owl-bot-staging/google-cloud-resource_manager-v3/AUTHENTICATION.md delete mode 100644 owl-bot-staging/google-cloud-resource_manager-v3/CHANGELOG.md delete mode 100644 owl-bot-staging/google-cloud-resource_manager-v3/Gemfile delete mode 100644 owl-bot-staging/google-cloud-resource_manager-v3/LICENSE.md delete mode 100644 owl-bot-staging/google-cloud-resource_manager-v3/README.md delete mode 100644 owl-bot-staging/google-cloud-resource_manager-v3/Rakefile delete mode 100644 owl-bot-staging/google-cloud-resource_manager-v3/gapic_metadata.json delete mode 100644 owl-bot-staging/google-cloud-resource_manager-v3/google-cloud-resource_manager-v3.gemspec delete mode 100644 owl-bot-staging/google-cloud-resource_manager-v3/lib/google-cloud-resource_manager-v3.rb delete mode 100644 owl-bot-staging/google-cloud-resource_manager-v3/lib/google/cloud/resource_manager/v3.rb delete mode 100644 owl-bot-staging/google-cloud-resource_manager-v3/lib/google/cloud/resource_manager/v3/folders.rb delete mode 100644 owl-bot-staging/google-cloud-resource_manager-v3/lib/google/cloud/resource_manager/v3/folders/client.rb delete mode 100644 owl-bot-staging/google-cloud-resource_manager-v3/lib/google/cloud/resource_manager/v3/folders/credentials.rb delete mode 100644 owl-bot-staging/google-cloud-resource_manager-v3/lib/google/cloud/resource_manager/v3/folders/operations.rb delete mode 100644 owl-bot-staging/google-cloud-resource_manager-v3/lib/google/cloud/resource_manager/v3/folders/paths.rb delete mode 100644 owl-bot-staging/google-cloud-resource_manager-v3/lib/google/cloud/resource_manager/v3/folders/rest.rb delete mode 100644 owl-bot-staging/google-cloud-resource_manager-v3/lib/google/cloud/resource_manager/v3/folders/rest/client.rb delete mode 100644 owl-bot-staging/google-cloud-resource_manager-v3/lib/google/cloud/resource_manager/v3/folders/rest/operations.rb delete mode 100644 owl-bot-staging/google-cloud-resource_manager-v3/lib/google/cloud/resource_manager/v3/folders/rest/service_stub.rb delete mode 100644 owl-bot-staging/google-cloud-resource_manager-v3/lib/google/cloud/resource_manager/v3/organizations.rb delete mode 100644 owl-bot-staging/google-cloud-resource_manager-v3/lib/google/cloud/resource_manager/v3/organizations/client.rb delete mode 100644 owl-bot-staging/google-cloud-resource_manager-v3/lib/google/cloud/resource_manager/v3/organizations/credentials.rb delete mode 100644 owl-bot-staging/google-cloud-resource_manager-v3/lib/google/cloud/resource_manager/v3/organizations/paths.rb delete mode 100644 owl-bot-staging/google-cloud-resource_manager-v3/lib/google/cloud/resource_manager/v3/organizations/rest.rb delete mode 100644 owl-bot-staging/google-cloud-resource_manager-v3/lib/google/cloud/resource_manager/v3/organizations/rest/client.rb delete mode 100644 owl-bot-staging/google-cloud-resource_manager-v3/lib/google/cloud/resource_manager/v3/organizations/rest/service_stub.rb delete mode 100644 owl-bot-staging/google-cloud-resource_manager-v3/lib/google/cloud/resource_manager/v3/projects.rb delete mode 100644 owl-bot-staging/google-cloud-resource_manager-v3/lib/google/cloud/resource_manager/v3/projects/client.rb delete mode 100644 owl-bot-staging/google-cloud-resource_manager-v3/lib/google/cloud/resource_manager/v3/projects/credentials.rb delete mode 100644 owl-bot-staging/google-cloud-resource_manager-v3/lib/google/cloud/resource_manager/v3/projects/operations.rb delete mode 100644 owl-bot-staging/google-cloud-resource_manager-v3/lib/google/cloud/resource_manager/v3/projects/paths.rb delete mode 100644 owl-bot-staging/google-cloud-resource_manager-v3/lib/google/cloud/resource_manager/v3/projects/rest.rb delete mode 100644 owl-bot-staging/google-cloud-resource_manager-v3/lib/google/cloud/resource_manager/v3/projects/rest/client.rb delete mode 100644 owl-bot-staging/google-cloud-resource_manager-v3/lib/google/cloud/resource_manager/v3/projects/rest/operations.rb delete mode 100644 owl-bot-staging/google-cloud-resource_manager-v3/lib/google/cloud/resource_manager/v3/projects/rest/service_stub.rb delete mode 100644 owl-bot-staging/google-cloud-resource_manager-v3/lib/google/cloud/resource_manager/v3/rest.rb delete mode 100644 owl-bot-staging/google-cloud-resource_manager-v3/lib/google/cloud/resource_manager/v3/tag_bindings.rb delete mode 100644 owl-bot-staging/google-cloud-resource_manager-v3/lib/google/cloud/resource_manager/v3/tag_bindings/client.rb delete mode 100644 owl-bot-staging/google-cloud-resource_manager-v3/lib/google/cloud/resource_manager/v3/tag_bindings/credentials.rb delete mode 100644 owl-bot-staging/google-cloud-resource_manager-v3/lib/google/cloud/resource_manager/v3/tag_bindings/operations.rb delete mode 100644 owl-bot-staging/google-cloud-resource_manager-v3/lib/google/cloud/resource_manager/v3/tag_bindings/paths.rb delete mode 100644 owl-bot-staging/google-cloud-resource_manager-v3/lib/google/cloud/resource_manager/v3/tag_bindings/rest.rb delete mode 100644 owl-bot-staging/google-cloud-resource_manager-v3/lib/google/cloud/resource_manager/v3/tag_bindings/rest/client.rb delete mode 100644 owl-bot-staging/google-cloud-resource_manager-v3/lib/google/cloud/resource_manager/v3/tag_bindings/rest/operations.rb delete mode 100644 owl-bot-staging/google-cloud-resource_manager-v3/lib/google/cloud/resource_manager/v3/tag_bindings/rest/service_stub.rb delete mode 100644 owl-bot-staging/google-cloud-resource_manager-v3/lib/google/cloud/resource_manager/v3/tag_holds.rb delete mode 100644 owl-bot-staging/google-cloud-resource_manager-v3/lib/google/cloud/resource_manager/v3/tag_holds/client.rb delete mode 100644 owl-bot-staging/google-cloud-resource_manager-v3/lib/google/cloud/resource_manager/v3/tag_holds/credentials.rb delete mode 100644 owl-bot-staging/google-cloud-resource_manager-v3/lib/google/cloud/resource_manager/v3/tag_holds/operations.rb delete mode 100644 owl-bot-staging/google-cloud-resource_manager-v3/lib/google/cloud/resource_manager/v3/tag_holds/paths.rb delete mode 100644 owl-bot-staging/google-cloud-resource_manager-v3/lib/google/cloud/resource_manager/v3/tag_holds/rest.rb delete mode 100644 owl-bot-staging/google-cloud-resource_manager-v3/lib/google/cloud/resource_manager/v3/tag_holds/rest/client.rb delete mode 100644 owl-bot-staging/google-cloud-resource_manager-v3/lib/google/cloud/resource_manager/v3/tag_holds/rest/operations.rb delete mode 100644 owl-bot-staging/google-cloud-resource_manager-v3/lib/google/cloud/resource_manager/v3/tag_holds/rest/service_stub.rb delete mode 100644 owl-bot-staging/google-cloud-resource_manager-v3/lib/google/cloud/resource_manager/v3/tag_keys.rb delete mode 100644 owl-bot-staging/google-cloud-resource_manager-v3/lib/google/cloud/resource_manager/v3/tag_keys/client.rb delete mode 100644 owl-bot-staging/google-cloud-resource_manager-v3/lib/google/cloud/resource_manager/v3/tag_keys/credentials.rb delete mode 100644 owl-bot-staging/google-cloud-resource_manager-v3/lib/google/cloud/resource_manager/v3/tag_keys/operations.rb delete mode 100644 owl-bot-staging/google-cloud-resource_manager-v3/lib/google/cloud/resource_manager/v3/tag_keys/paths.rb delete mode 100644 owl-bot-staging/google-cloud-resource_manager-v3/lib/google/cloud/resource_manager/v3/tag_keys/rest.rb delete mode 100644 owl-bot-staging/google-cloud-resource_manager-v3/lib/google/cloud/resource_manager/v3/tag_keys/rest/client.rb delete mode 100644 owl-bot-staging/google-cloud-resource_manager-v3/lib/google/cloud/resource_manager/v3/tag_keys/rest/operations.rb delete mode 100644 owl-bot-staging/google-cloud-resource_manager-v3/lib/google/cloud/resource_manager/v3/tag_keys/rest/service_stub.rb delete mode 100644 owl-bot-staging/google-cloud-resource_manager-v3/lib/google/cloud/resource_manager/v3/tag_values.rb delete mode 100644 owl-bot-staging/google-cloud-resource_manager-v3/lib/google/cloud/resource_manager/v3/tag_values/client.rb delete mode 100644 owl-bot-staging/google-cloud-resource_manager-v3/lib/google/cloud/resource_manager/v3/tag_values/credentials.rb delete mode 100644 owl-bot-staging/google-cloud-resource_manager-v3/lib/google/cloud/resource_manager/v3/tag_values/operations.rb delete mode 100644 owl-bot-staging/google-cloud-resource_manager-v3/lib/google/cloud/resource_manager/v3/tag_values/paths.rb delete mode 100644 owl-bot-staging/google-cloud-resource_manager-v3/lib/google/cloud/resource_manager/v3/tag_values/rest.rb delete mode 100644 owl-bot-staging/google-cloud-resource_manager-v3/lib/google/cloud/resource_manager/v3/tag_values/rest/client.rb delete mode 100644 owl-bot-staging/google-cloud-resource_manager-v3/lib/google/cloud/resource_manager/v3/tag_values/rest/operations.rb delete mode 100644 owl-bot-staging/google-cloud-resource_manager-v3/lib/google/cloud/resource_manager/v3/tag_values/rest/service_stub.rb delete mode 100644 owl-bot-staging/google-cloud-resource_manager-v3/lib/google/cloud/resource_manager/v3/version.rb delete mode 100644 owl-bot-staging/google-cloud-resource_manager-v3/lib/google/cloud/resourcemanager/v3/folders_pb.rb delete mode 100644 owl-bot-staging/google-cloud-resource_manager-v3/lib/google/cloud/resourcemanager/v3/folders_services_pb.rb delete mode 100644 owl-bot-staging/google-cloud-resource_manager-v3/lib/google/cloud/resourcemanager/v3/organizations_pb.rb delete mode 100644 owl-bot-staging/google-cloud-resource_manager-v3/lib/google/cloud/resourcemanager/v3/organizations_services_pb.rb delete mode 100644 owl-bot-staging/google-cloud-resource_manager-v3/lib/google/cloud/resourcemanager/v3/projects_pb.rb delete mode 100644 owl-bot-staging/google-cloud-resource_manager-v3/lib/google/cloud/resourcemanager/v3/projects_services_pb.rb delete mode 100644 owl-bot-staging/google-cloud-resource_manager-v3/lib/google/cloud/resourcemanager/v3/tag_bindings_pb.rb delete mode 100644 owl-bot-staging/google-cloud-resource_manager-v3/lib/google/cloud/resourcemanager/v3/tag_bindings_services_pb.rb delete mode 100644 owl-bot-staging/google-cloud-resource_manager-v3/lib/google/cloud/resourcemanager/v3/tag_holds_pb.rb delete mode 100644 owl-bot-staging/google-cloud-resource_manager-v3/lib/google/cloud/resourcemanager/v3/tag_holds_services_pb.rb delete mode 100644 owl-bot-staging/google-cloud-resource_manager-v3/lib/google/cloud/resourcemanager/v3/tag_keys_pb.rb delete mode 100644 owl-bot-staging/google-cloud-resource_manager-v3/lib/google/cloud/resourcemanager/v3/tag_keys_services_pb.rb delete mode 100644 owl-bot-staging/google-cloud-resource_manager-v3/lib/google/cloud/resourcemanager/v3/tag_values_pb.rb delete mode 100644 owl-bot-staging/google-cloud-resource_manager-v3/lib/google/cloud/resourcemanager/v3/tag_values_services_pb.rb delete mode 100644 owl-bot-staging/google-cloud-resource_manager-v3/proto_docs/README.md delete mode 100644 owl-bot-staging/google-cloud-resource_manager-v3/proto_docs/google/api/client.rb delete mode 100644 owl-bot-staging/google-cloud-resource_manager-v3/proto_docs/google/api/field_behavior.rb delete mode 100644 owl-bot-staging/google-cloud-resource_manager-v3/proto_docs/google/api/launch_stage.rb delete mode 100644 owl-bot-staging/google-cloud-resource_manager-v3/proto_docs/google/api/resource.rb delete mode 100644 owl-bot-staging/google-cloud-resource_manager-v3/proto_docs/google/cloud/resourcemanager/v3/folders.rb delete mode 100644 owl-bot-staging/google-cloud-resource_manager-v3/proto_docs/google/cloud/resourcemanager/v3/organizations.rb delete mode 100644 owl-bot-staging/google-cloud-resource_manager-v3/proto_docs/google/cloud/resourcemanager/v3/projects.rb delete mode 100644 owl-bot-staging/google-cloud-resource_manager-v3/proto_docs/google/cloud/resourcemanager/v3/tag_bindings.rb delete mode 100644 owl-bot-staging/google-cloud-resource_manager-v3/proto_docs/google/cloud/resourcemanager/v3/tag_holds.rb delete mode 100644 owl-bot-staging/google-cloud-resource_manager-v3/proto_docs/google/cloud/resourcemanager/v3/tag_keys.rb delete mode 100644 owl-bot-staging/google-cloud-resource_manager-v3/proto_docs/google/cloud/resourcemanager/v3/tag_values.rb delete mode 100644 owl-bot-staging/google-cloud-resource_manager-v3/proto_docs/google/iam/v1/iam_policy.rb delete mode 100644 owl-bot-staging/google-cloud-resource_manager-v3/proto_docs/google/iam/v1/options.rb delete mode 100644 owl-bot-staging/google-cloud-resource_manager-v3/proto_docs/google/iam/v1/policy.rb delete mode 100644 owl-bot-staging/google-cloud-resource_manager-v3/proto_docs/google/longrunning/operations.rb delete mode 100644 owl-bot-staging/google-cloud-resource_manager-v3/proto_docs/google/protobuf/any.rb delete mode 100644 owl-bot-staging/google-cloud-resource_manager-v3/proto_docs/google/protobuf/duration.rb delete mode 100644 owl-bot-staging/google-cloud-resource_manager-v3/proto_docs/google/protobuf/empty.rb delete mode 100644 owl-bot-staging/google-cloud-resource_manager-v3/proto_docs/google/protobuf/field_mask.rb delete mode 100644 owl-bot-staging/google-cloud-resource_manager-v3/proto_docs/google/protobuf/timestamp.rb delete mode 100644 owl-bot-staging/google-cloud-resource_manager-v3/proto_docs/google/rpc/status.rb delete mode 100644 owl-bot-staging/google-cloud-resource_manager-v3/proto_docs/google/type/expr.rb delete mode 100644 owl-bot-staging/google-cloud-resource_manager-v3/snippets/Gemfile delete mode 100644 owl-bot-staging/google-cloud-resource_manager-v3/snippets/folders/create_folder.rb delete mode 100644 owl-bot-staging/google-cloud-resource_manager-v3/snippets/folders/delete_folder.rb delete mode 100644 owl-bot-staging/google-cloud-resource_manager-v3/snippets/folders/get_folder.rb delete mode 100644 owl-bot-staging/google-cloud-resource_manager-v3/snippets/folders/get_iam_policy.rb delete mode 100644 owl-bot-staging/google-cloud-resource_manager-v3/snippets/folders/list_folders.rb delete mode 100644 owl-bot-staging/google-cloud-resource_manager-v3/snippets/folders/move_folder.rb delete mode 100644 owl-bot-staging/google-cloud-resource_manager-v3/snippets/folders/search_folders.rb delete mode 100644 owl-bot-staging/google-cloud-resource_manager-v3/snippets/folders/set_iam_policy.rb delete mode 100644 owl-bot-staging/google-cloud-resource_manager-v3/snippets/folders/test_iam_permissions.rb delete mode 100644 owl-bot-staging/google-cloud-resource_manager-v3/snippets/folders/undelete_folder.rb delete mode 100644 owl-bot-staging/google-cloud-resource_manager-v3/snippets/folders/update_folder.rb delete mode 100644 owl-bot-staging/google-cloud-resource_manager-v3/snippets/organizations/get_iam_policy.rb delete mode 100644 owl-bot-staging/google-cloud-resource_manager-v3/snippets/organizations/get_organization.rb delete mode 100644 owl-bot-staging/google-cloud-resource_manager-v3/snippets/organizations/search_organizations.rb delete mode 100644 owl-bot-staging/google-cloud-resource_manager-v3/snippets/organizations/set_iam_policy.rb delete mode 100644 owl-bot-staging/google-cloud-resource_manager-v3/snippets/organizations/test_iam_permissions.rb delete mode 100644 owl-bot-staging/google-cloud-resource_manager-v3/snippets/projects/create_project.rb delete mode 100644 owl-bot-staging/google-cloud-resource_manager-v3/snippets/projects/delete_project.rb delete mode 100644 owl-bot-staging/google-cloud-resource_manager-v3/snippets/projects/get_iam_policy.rb delete mode 100644 owl-bot-staging/google-cloud-resource_manager-v3/snippets/projects/get_project.rb delete mode 100644 owl-bot-staging/google-cloud-resource_manager-v3/snippets/projects/list_projects.rb delete mode 100644 owl-bot-staging/google-cloud-resource_manager-v3/snippets/projects/move_project.rb delete mode 100644 owl-bot-staging/google-cloud-resource_manager-v3/snippets/projects/search_projects.rb delete mode 100644 owl-bot-staging/google-cloud-resource_manager-v3/snippets/projects/set_iam_policy.rb delete mode 100644 owl-bot-staging/google-cloud-resource_manager-v3/snippets/projects/test_iam_permissions.rb delete mode 100644 owl-bot-staging/google-cloud-resource_manager-v3/snippets/projects/undelete_project.rb delete mode 100644 owl-bot-staging/google-cloud-resource_manager-v3/snippets/projects/update_project.rb delete mode 100644 owl-bot-staging/google-cloud-resource_manager-v3/snippets/snippet_metadata_google.cloud.resourcemanager.v3.json delete mode 100644 owl-bot-staging/google-cloud-resource_manager-v3/snippets/tag_bindings/create_tag_binding.rb delete mode 100644 owl-bot-staging/google-cloud-resource_manager-v3/snippets/tag_bindings/delete_tag_binding.rb delete mode 100644 owl-bot-staging/google-cloud-resource_manager-v3/snippets/tag_bindings/list_effective_tags.rb delete mode 100644 owl-bot-staging/google-cloud-resource_manager-v3/snippets/tag_bindings/list_tag_bindings.rb delete mode 100644 owl-bot-staging/google-cloud-resource_manager-v3/snippets/tag_holds/create_tag_hold.rb delete mode 100644 owl-bot-staging/google-cloud-resource_manager-v3/snippets/tag_holds/delete_tag_hold.rb delete mode 100644 owl-bot-staging/google-cloud-resource_manager-v3/snippets/tag_holds/list_tag_holds.rb delete mode 100644 owl-bot-staging/google-cloud-resource_manager-v3/snippets/tag_keys/create_tag_key.rb delete mode 100644 owl-bot-staging/google-cloud-resource_manager-v3/snippets/tag_keys/delete_tag_key.rb delete mode 100644 owl-bot-staging/google-cloud-resource_manager-v3/snippets/tag_keys/get_iam_policy.rb delete mode 100644 owl-bot-staging/google-cloud-resource_manager-v3/snippets/tag_keys/get_namespaced_tag_key.rb delete mode 100644 owl-bot-staging/google-cloud-resource_manager-v3/snippets/tag_keys/get_tag_key.rb delete mode 100644 owl-bot-staging/google-cloud-resource_manager-v3/snippets/tag_keys/list_tag_keys.rb delete mode 100644 owl-bot-staging/google-cloud-resource_manager-v3/snippets/tag_keys/set_iam_policy.rb delete mode 100644 owl-bot-staging/google-cloud-resource_manager-v3/snippets/tag_keys/test_iam_permissions.rb delete mode 100644 owl-bot-staging/google-cloud-resource_manager-v3/snippets/tag_keys/update_tag_key.rb delete mode 100644 owl-bot-staging/google-cloud-resource_manager-v3/snippets/tag_values/create_tag_value.rb delete mode 100644 owl-bot-staging/google-cloud-resource_manager-v3/snippets/tag_values/delete_tag_value.rb delete mode 100644 owl-bot-staging/google-cloud-resource_manager-v3/snippets/tag_values/get_iam_policy.rb delete mode 100644 owl-bot-staging/google-cloud-resource_manager-v3/snippets/tag_values/get_namespaced_tag_value.rb delete mode 100644 owl-bot-staging/google-cloud-resource_manager-v3/snippets/tag_values/get_tag_value.rb delete mode 100644 owl-bot-staging/google-cloud-resource_manager-v3/snippets/tag_values/list_tag_values.rb delete mode 100644 owl-bot-staging/google-cloud-resource_manager-v3/snippets/tag_values/set_iam_policy.rb delete mode 100644 owl-bot-staging/google-cloud-resource_manager-v3/snippets/tag_values/test_iam_permissions.rb delete mode 100644 owl-bot-staging/google-cloud-resource_manager-v3/snippets/tag_values/update_tag_value.rb delete mode 100644 owl-bot-staging/google-cloud-resource_manager-v3/test/google/cloud/resource_manager/v3/folders_operations_test.rb delete mode 100644 owl-bot-staging/google-cloud-resource_manager-v3/test/google/cloud/resource_manager/v3/folders_paths_test.rb delete mode 100644 owl-bot-staging/google-cloud-resource_manager-v3/test/google/cloud/resource_manager/v3/folders_rest_test.rb delete mode 100644 owl-bot-staging/google-cloud-resource_manager-v3/test/google/cloud/resource_manager/v3/folders_test.rb delete mode 100644 owl-bot-staging/google-cloud-resource_manager-v3/test/google/cloud/resource_manager/v3/organizations_paths_test.rb delete mode 100644 owl-bot-staging/google-cloud-resource_manager-v3/test/google/cloud/resource_manager/v3/organizations_rest_test.rb delete mode 100644 owl-bot-staging/google-cloud-resource_manager-v3/test/google/cloud/resource_manager/v3/organizations_test.rb delete mode 100644 owl-bot-staging/google-cloud-resource_manager-v3/test/google/cloud/resource_manager/v3/projects_operations_test.rb delete mode 100644 owl-bot-staging/google-cloud-resource_manager-v3/test/google/cloud/resource_manager/v3/projects_paths_test.rb delete mode 100644 owl-bot-staging/google-cloud-resource_manager-v3/test/google/cloud/resource_manager/v3/projects_rest_test.rb delete mode 100644 owl-bot-staging/google-cloud-resource_manager-v3/test/google/cloud/resource_manager/v3/projects_test.rb delete mode 100644 owl-bot-staging/google-cloud-resource_manager-v3/test/google/cloud/resource_manager/v3/tag_bindings_operations_test.rb delete mode 100644 owl-bot-staging/google-cloud-resource_manager-v3/test/google/cloud/resource_manager/v3/tag_bindings_paths_test.rb delete mode 100644 owl-bot-staging/google-cloud-resource_manager-v3/test/google/cloud/resource_manager/v3/tag_bindings_rest_test.rb delete mode 100644 owl-bot-staging/google-cloud-resource_manager-v3/test/google/cloud/resource_manager/v3/tag_bindings_test.rb delete mode 100644 owl-bot-staging/google-cloud-resource_manager-v3/test/google/cloud/resource_manager/v3/tag_holds_operations_test.rb delete mode 100644 owl-bot-staging/google-cloud-resource_manager-v3/test/google/cloud/resource_manager/v3/tag_holds_paths_test.rb delete mode 100644 owl-bot-staging/google-cloud-resource_manager-v3/test/google/cloud/resource_manager/v3/tag_holds_rest_test.rb delete mode 100644 owl-bot-staging/google-cloud-resource_manager-v3/test/google/cloud/resource_manager/v3/tag_holds_test.rb delete mode 100644 owl-bot-staging/google-cloud-resource_manager-v3/test/google/cloud/resource_manager/v3/tag_keys_operations_test.rb delete mode 100644 owl-bot-staging/google-cloud-resource_manager-v3/test/google/cloud/resource_manager/v3/tag_keys_paths_test.rb delete mode 100644 owl-bot-staging/google-cloud-resource_manager-v3/test/google/cloud/resource_manager/v3/tag_keys_rest_test.rb delete mode 100644 owl-bot-staging/google-cloud-resource_manager-v3/test/google/cloud/resource_manager/v3/tag_keys_test.rb delete mode 100644 owl-bot-staging/google-cloud-resource_manager-v3/test/google/cloud/resource_manager/v3/tag_values_operations_test.rb delete mode 100644 owl-bot-staging/google-cloud-resource_manager-v3/test/google/cloud/resource_manager/v3/tag_values_paths_test.rb delete mode 100644 owl-bot-staging/google-cloud-resource_manager-v3/test/google/cloud/resource_manager/v3/tag_values_rest_test.rb delete mode 100644 owl-bot-staging/google-cloud-resource_manager-v3/test/google/cloud/resource_manager/v3/tag_values_test.rb delete mode 100644 owl-bot-staging/google-cloud-resource_manager-v3/test/helper.rb delete mode 100644 owl-bot-staging/google-cloud-retail-v2/.gitignore delete mode 100644 owl-bot-staging/google-cloud-retail-v2/.repo-metadata.json delete mode 100644 owl-bot-staging/google-cloud-retail-v2/.rubocop.yml delete mode 100644 owl-bot-staging/google-cloud-retail-v2/.toys.rb delete mode 100644 owl-bot-staging/google-cloud-retail-v2/.yardopts delete mode 100644 owl-bot-staging/google-cloud-retail-v2/AUTHENTICATION.md delete mode 100644 owl-bot-staging/google-cloud-retail-v2/CHANGELOG.md delete mode 100644 owl-bot-staging/google-cloud-retail-v2/Gemfile delete mode 100644 owl-bot-staging/google-cloud-retail-v2/LICENSE.md delete mode 100644 owl-bot-staging/google-cloud-retail-v2/README.md delete mode 100644 owl-bot-staging/google-cloud-retail-v2/Rakefile delete mode 100644 owl-bot-staging/google-cloud-retail-v2/gapic_metadata.json delete mode 100644 owl-bot-staging/google-cloud-retail-v2/google-cloud-retail-v2.gemspec delete mode 100644 owl-bot-staging/google-cloud-retail-v2/lib/google-cloud-retail-v2.rb delete mode 100644 owl-bot-staging/google-cloud-retail-v2/lib/google/cloud/retail/v2.rb delete mode 100644 owl-bot-staging/google-cloud-retail-v2/lib/google/cloud/retail/v2/analytics_service.rb delete mode 100644 owl-bot-staging/google-cloud-retail-v2/lib/google/cloud/retail/v2/analytics_service/client.rb delete mode 100644 owl-bot-staging/google-cloud-retail-v2/lib/google/cloud/retail/v2/analytics_service/credentials.rb delete mode 100644 owl-bot-staging/google-cloud-retail-v2/lib/google/cloud/retail/v2/analytics_service/operations.rb delete mode 100644 owl-bot-staging/google-cloud-retail-v2/lib/google/cloud/retail/v2/analytics_service/rest.rb delete mode 100644 owl-bot-staging/google-cloud-retail-v2/lib/google/cloud/retail/v2/analytics_service/rest/client.rb delete mode 100644 owl-bot-staging/google-cloud-retail-v2/lib/google/cloud/retail/v2/analytics_service/rest/operations.rb delete mode 100644 owl-bot-staging/google-cloud-retail-v2/lib/google/cloud/retail/v2/analytics_service/rest/service_stub.rb delete mode 100644 owl-bot-staging/google-cloud-retail-v2/lib/google/cloud/retail/v2/analytics_service_pb.rb delete mode 100644 owl-bot-staging/google-cloud-retail-v2/lib/google/cloud/retail/v2/analytics_service_services_pb.rb delete mode 100644 owl-bot-staging/google-cloud-retail-v2/lib/google/cloud/retail/v2/catalog_pb.rb delete mode 100644 owl-bot-staging/google-cloud-retail-v2/lib/google/cloud/retail/v2/catalog_service.rb delete mode 100644 owl-bot-staging/google-cloud-retail-v2/lib/google/cloud/retail/v2/catalog_service/client.rb delete mode 100644 owl-bot-staging/google-cloud-retail-v2/lib/google/cloud/retail/v2/catalog_service/credentials.rb delete mode 100644 owl-bot-staging/google-cloud-retail-v2/lib/google/cloud/retail/v2/catalog_service/paths.rb delete mode 100644 owl-bot-staging/google-cloud-retail-v2/lib/google/cloud/retail/v2/catalog_service/rest.rb delete mode 100644 owl-bot-staging/google-cloud-retail-v2/lib/google/cloud/retail/v2/catalog_service/rest/client.rb delete mode 100644 owl-bot-staging/google-cloud-retail-v2/lib/google/cloud/retail/v2/catalog_service/rest/service_stub.rb delete mode 100644 owl-bot-staging/google-cloud-retail-v2/lib/google/cloud/retail/v2/catalog_service_pb.rb delete mode 100644 owl-bot-staging/google-cloud-retail-v2/lib/google/cloud/retail/v2/catalog_service_services_pb.rb delete mode 100644 owl-bot-staging/google-cloud-retail-v2/lib/google/cloud/retail/v2/common_pb.rb delete mode 100644 owl-bot-staging/google-cloud-retail-v2/lib/google/cloud/retail/v2/completion_service.rb delete mode 100644 owl-bot-staging/google-cloud-retail-v2/lib/google/cloud/retail/v2/completion_service/client.rb delete mode 100644 owl-bot-staging/google-cloud-retail-v2/lib/google/cloud/retail/v2/completion_service/credentials.rb delete mode 100644 owl-bot-staging/google-cloud-retail-v2/lib/google/cloud/retail/v2/completion_service/operations.rb delete mode 100644 owl-bot-staging/google-cloud-retail-v2/lib/google/cloud/retail/v2/completion_service/paths.rb delete mode 100644 owl-bot-staging/google-cloud-retail-v2/lib/google/cloud/retail/v2/completion_service/rest.rb delete mode 100644 owl-bot-staging/google-cloud-retail-v2/lib/google/cloud/retail/v2/completion_service/rest/client.rb delete mode 100644 owl-bot-staging/google-cloud-retail-v2/lib/google/cloud/retail/v2/completion_service/rest/operations.rb delete mode 100644 owl-bot-staging/google-cloud-retail-v2/lib/google/cloud/retail/v2/completion_service/rest/service_stub.rb delete mode 100644 owl-bot-staging/google-cloud-retail-v2/lib/google/cloud/retail/v2/completion_service_pb.rb delete mode 100644 owl-bot-staging/google-cloud-retail-v2/lib/google/cloud/retail/v2/completion_service_services_pb.rb delete mode 100644 owl-bot-staging/google-cloud-retail-v2/lib/google/cloud/retail/v2/control_pb.rb delete mode 100644 owl-bot-staging/google-cloud-retail-v2/lib/google/cloud/retail/v2/control_service.rb delete mode 100644 owl-bot-staging/google-cloud-retail-v2/lib/google/cloud/retail/v2/control_service/client.rb delete mode 100644 owl-bot-staging/google-cloud-retail-v2/lib/google/cloud/retail/v2/control_service/credentials.rb delete mode 100644 owl-bot-staging/google-cloud-retail-v2/lib/google/cloud/retail/v2/control_service/paths.rb delete mode 100644 owl-bot-staging/google-cloud-retail-v2/lib/google/cloud/retail/v2/control_service/rest.rb delete mode 100644 owl-bot-staging/google-cloud-retail-v2/lib/google/cloud/retail/v2/control_service/rest/client.rb delete mode 100644 owl-bot-staging/google-cloud-retail-v2/lib/google/cloud/retail/v2/control_service/rest/service_stub.rb delete mode 100644 owl-bot-staging/google-cloud-retail-v2/lib/google/cloud/retail/v2/control_service_pb.rb delete mode 100644 owl-bot-staging/google-cloud-retail-v2/lib/google/cloud/retail/v2/control_service_services_pb.rb delete mode 100644 owl-bot-staging/google-cloud-retail-v2/lib/google/cloud/retail/v2/conversational_search_service.rb delete mode 100644 owl-bot-staging/google-cloud-retail-v2/lib/google/cloud/retail/v2/conversational_search_service/client.rb delete mode 100644 owl-bot-staging/google-cloud-retail-v2/lib/google/cloud/retail/v2/conversational_search_service/credentials.rb delete mode 100644 owl-bot-staging/google-cloud-retail-v2/lib/google/cloud/retail/v2/conversational_search_service/paths.rb delete mode 100644 owl-bot-staging/google-cloud-retail-v2/lib/google/cloud/retail/v2/conversational_search_service/rest.rb delete mode 100644 owl-bot-staging/google-cloud-retail-v2/lib/google/cloud/retail/v2/conversational_search_service/rest/client.rb delete mode 100644 owl-bot-staging/google-cloud-retail-v2/lib/google/cloud/retail/v2/conversational_search_service/rest/service_stub.rb delete mode 100644 owl-bot-staging/google-cloud-retail-v2/lib/google/cloud/retail/v2/conversational_search_service_pb.rb delete mode 100644 owl-bot-staging/google-cloud-retail-v2/lib/google/cloud/retail/v2/conversational_search_service_services_pb.rb delete mode 100644 owl-bot-staging/google-cloud-retail-v2/lib/google/cloud/retail/v2/export_config_pb.rb delete mode 100644 owl-bot-staging/google-cloud-retail-v2/lib/google/cloud/retail/v2/generative_question_pb.rb delete mode 100644 owl-bot-staging/google-cloud-retail-v2/lib/google/cloud/retail/v2/generative_question_service.rb delete mode 100644 owl-bot-staging/google-cloud-retail-v2/lib/google/cloud/retail/v2/generative_question_service/client.rb delete mode 100644 owl-bot-staging/google-cloud-retail-v2/lib/google/cloud/retail/v2/generative_question_service/credentials.rb delete mode 100644 owl-bot-staging/google-cloud-retail-v2/lib/google/cloud/retail/v2/generative_question_service/paths.rb delete mode 100644 owl-bot-staging/google-cloud-retail-v2/lib/google/cloud/retail/v2/generative_question_service/rest.rb delete mode 100644 owl-bot-staging/google-cloud-retail-v2/lib/google/cloud/retail/v2/generative_question_service/rest/client.rb delete mode 100644 owl-bot-staging/google-cloud-retail-v2/lib/google/cloud/retail/v2/generative_question_service/rest/service_stub.rb delete mode 100644 owl-bot-staging/google-cloud-retail-v2/lib/google/cloud/retail/v2/generative_question_service_pb.rb delete mode 100644 owl-bot-staging/google-cloud-retail-v2/lib/google/cloud/retail/v2/generative_question_service_services_pb.rb delete mode 100644 owl-bot-staging/google-cloud-retail-v2/lib/google/cloud/retail/v2/import_config_pb.rb delete mode 100644 owl-bot-staging/google-cloud-retail-v2/lib/google/cloud/retail/v2/model_pb.rb delete mode 100644 owl-bot-staging/google-cloud-retail-v2/lib/google/cloud/retail/v2/model_service.rb delete mode 100644 owl-bot-staging/google-cloud-retail-v2/lib/google/cloud/retail/v2/model_service/client.rb delete mode 100644 owl-bot-staging/google-cloud-retail-v2/lib/google/cloud/retail/v2/model_service/credentials.rb delete mode 100644 owl-bot-staging/google-cloud-retail-v2/lib/google/cloud/retail/v2/model_service/operations.rb delete mode 100644 owl-bot-staging/google-cloud-retail-v2/lib/google/cloud/retail/v2/model_service/paths.rb delete mode 100644 owl-bot-staging/google-cloud-retail-v2/lib/google/cloud/retail/v2/model_service/rest.rb delete mode 100644 owl-bot-staging/google-cloud-retail-v2/lib/google/cloud/retail/v2/model_service/rest/client.rb delete mode 100644 owl-bot-staging/google-cloud-retail-v2/lib/google/cloud/retail/v2/model_service/rest/operations.rb delete mode 100644 owl-bot-staging/google-cloud-retail-v2/lib/google/cloud/retail/v2/model_service/rest/service_stub.rb delete mode 100644 owl-bot-staging/google-cloud-retail-v2/lib/google/cloud/retail/v2/model_service_pb.rb delete mode 100644 owl-bot-staging/google-cloud-retail-v2/lib/google/cloud/retail/v2/model_service_services_pb.rb delete mode 100644 owl-bot-staging/google-cloud-retail-v2/lib/google/cloud/retail/v2/prediction_service.rb delete mode 100644 owl-bot-staging/google-cloud-retail-v2/lib/google/cloud/retail/v2/prediction_service/client.rb delete mode 100644 owl-bot-staging/google-cloud-retail-v2/lib/google/cloud/retail/v2/prediction_service/credentials.rb delete mode 100644 owl-bot-staging/google-cloud-retail-v2/lib/google/cloud/retail/v2/prediction_service/paths.rb delete mode 100644 owl-bot-staging/google-cloud-retail-v2/lib/google/cloud/retail/v2/prediction_service/rest.rb delete mode 100644 owl-bot-staging/google-cloud-retail-v2/lib/google/cloud/retail/v2/prediction_service/rest/client.rb delete mode 100644 owl-bot-staging/google-cloud-retail-v2/lib/google/cloud/retail/v2/prediction_service/rest/service_stub.rb delete mode 100644 owl-bot-staging/google-cloud-retail-v2/lib/google/cloud/retail/v2/prediction_service_pb.rb delete mode 100644 owl-bot-staging/google-cloud-retail-v2/lib/google/cloud/retail/v2/prediction_service_services_pb.rb delete mode 100644 owl-bot-staging/google-cloud-retail-v2/lib/google/cloud/retail/v2/product_pb.rb delete mode 100644 owl-bot-staging/google-cloud-retail-v2/lib/google/cloud/retail/v2/product_service.rb delete mode 100644 owl-bot-staging/google-cloud-retail-v2/lib/google/cloud/retail/v2/product_service/client.rb delete mode 100644 owl-bot-staging/google-cloud-retail-v2/lib/google/cloud/retail/v2/product_service/credentials.rb delete mode 100644 owl-bot-staging/google-cloud-retail-v2/lib/google/cloud/retail/v2/product_service/operations.rb delete mode 100644 owl-bot-staging/google-cloud-retail-v2/lib/google/cloud/retail/v2/product_service/paths.rb delete mode 100644 owl-bot-staging/google-cloud-retail-v2/lib/google/cloud/retail/v2/product_service/rest.rb delete mode 100644 owl-bot-staging/google-cloud-retail-v2/lib/google/cloud/retail/v2/product_service/rest/client.rb delete mode 100644 owl-bot-staging/google-cloud-retail-v2/lib/google/cloud/retail/v2/product_service/rest/operations.rb delete mode 100644 owl-bot-staging/google-cloud-retail-v2/lib/google/cloud/retail/v2/product_service/rest/service_stub.rb delete mode 100644 owl-bot-staging/google-cloud-retail-v2/lib/google/cloud/retail/v2/product_service_pb.rb delete mode 100644 owl-bot-staging/google-cloud-retail-v2/lib/google/cloud/retail/v2/product_service_services_pb.rb delete mode 100644 owl-bot-staging/google-cloud-retail-v2/lib/google/cloud/retail/v2/promotion_pb.rb delete mode 100644 owl-bot-staging/google-cloud-retail-v2/lib/google/cloud/retail/v2/purge_config_pb.rb delete mode 100644 owl-bot-staging/google-cloud-retail-v2/lib/google/cloud/retail/v2/rest.rb delete mode 100644 owl-bot-staging/google-cloud-retail-v2/lib/google/cloud/retail/v2/safety_pb.rb delete mode 100644 owl-bot-staging/google-cloud-retail-v2/lib/google/cloud/retail/v2/search_service.rb delete mode 100644 owl-bot-staging/google-cloud-retail-v2/lib/google/cloud/retail/v2/search_service/client.rb delete mode 100644 owl-bot-staging/google-cloud-retail-v2/lib/google/cloud/retail/v2/search_service/credentials.rb delete mode 100644 owl-bot-staging/google-cloud-retail-v2/lib/google/cloud/retail/v2/search_service/paths.rb delete mode 100644 owl-bot-staging/google-cloud-retail-v2/lib/google/cloud/retail/v2/search_service/rest.rb delete mode 100644 owl-bot-staging/google-cloud-retail-v2/lib/google/cloud/retail/v2/search_service/rest/client.rb delete mode 100644 owl-bot-staging/google-cloud-retail-v2/lib/google/cloud/retail/v2/search_service/rest/service_stub.rb delete mode 100644 owl-bot-staging/google-cloud-retail-v2/lib/google/cloud/retail/v2/search_service_pb.rb delete mode 100644 owl-bot-staging/google-cloud-retail-v2/lib/google/cloud/retail/v2/search_service_services_pb.rb delete mode 100644 owl-bot-staging/google-cloud-retail-v2/lib/google/cloud/retail/v2/serving_config_pb.rb delete mode 100644 owl-bot-staging/google-cloud-retail-v2/lib/google/cloud/retail/v2/serving_config_service.rb delete mode 100644 owl-bot-staging/google-cloud-retail-v2/lib/google/cloud/retail/v2/serving_config_service/client.rb delete mode 100644 owl-bot-staging/google-cloud-retail-v2/lib/google/cloud/retail/v2/serving_config_service/credentials.rb delete mode 100644 owl-bot-staging/google-cloud-retail-v2/lib/google/cloud/retail/v2/serving_config_service/paths.rb delete mode 100644 owl-bot-staging/google-cloud-retail-v2/lib/google/cloud/retail/v2/serving_config_service/rest.rb delete mode 100644 owl-bot-staging/google-cloud-retail-v2/lib/google/cloud/retail/v2/serving_config_service/rest/client.rb delete mode 100644 owl-bot-staging/google-cloud-retail-v2/lib/google/cloud/retail/v2/serving_config_service/rest/service_stub.rb delete mode 100644 owl-bot-staging/google-cloud-retail-v2/lib/google/cloud/retail/v2/serving_config_service_pb.rb delete mode 100644 owl-bot-staging/google-cloud-retail-v2/lib/google/cloud/retail/v2/serving_config_service_services_pb.rb delete mode 100644 owl-bot-staging/google-cloud-retail-v2/lib/google/cloud/retail/v2/user_event_pb.rb delete mode 100644 owl-bot-staging/google-cloud-retail-v2/lib/google/cloud/retail/v2/user_event_service.rb delete mode 100644 owl-bot-staging/google-cloud-retail-v2/lib/google/cloud/retail/v2/user_event_service/client.rb delete mode 100644 owl-bot-staging/google-cloud-retail-v2/lib/google/cloud/retail/v2/user_event_service/credentials.rb delete mode 100644 owl-bot-staging/google-cloud-retail-v2/lib/google/cloud/retail/v2/user_event_service/operations.rb delete mode 100644 owl-bot-staging/google-cloud-retail-v2/lib/google/cloud/retail/v2/user_event_service/paths.rb delete mode 100644 owl-bot-staging/google-cloud-retail-v2/lib/google/cloud/retail/v2/user_event_service/rest.rb delete mode 100644 owl-bot-staging/google-cloud-retail-v2/lib/google/cloud/retail/v2/user_event_service/rest/client.rb delete mode 100644 owl-bot-staging/google-cloud-retail-v2/lib/google/cloud/retail/v2/user_event_service/rest/operations.rb delete mode 100644 owl-bot-staging/google-cloud-retail-v2/lib/google/cloud/retail/v2/user_event_service/rest/service_stub.rb delete mode 100644 owl-bot-staging/google-cloud-retail-v2/lib/google/cloud/retail/v2/user_event_service_pb.rb delete mode 100644 owl-bot-staging/google-cloud-retail-v2/lib/google/cloud/retail/v2/user_event_service_services_pb.rb delete mode 100644 owl-bot-staging/google-cloud-retail-v2/lib/google/cloud/retail/v2/version.rb delete mode 100644 owl-bot-staging/google-cloud-retail-v2/proto_docs/README.md delete mode 100644 owl-bot-staging/google-cloud-retail-v2/proto_docs/google/api/client.rb delete mode 100644 owl-bot-staging/google-cloud-retail-v2/proto_docs/google/api/field_behavior.rb delete mode 100644 owl-bot-staging/google-cloud-retail-v2/proto_docs/google/api/httpbody.rb delete mode 100644 owl-bot-staging/google-cloud-retail-v2/proto_docs/google/api/launch_stage.rb delete mode 100644 owl-bot-staging/google-cloud-retail-v2/proto_docs/google/api/resource.rb delete mode 100644 owl-bot-staging/google-cloud-retail-v2/proto_docs/google/cloud/retail/v2/catalog.rb delete mode 100644 owl-bot-staging/google-cloud-retail-v2/proto_docs/google/cloud/retail/v2/catalog_service.rb delete mode 100644 owl-bot-staging/google-cloud-retail-v2/proto_docs/google/cloud/retail/v2/common.rb delete mode 100644 owl-bot-staging/google-cloud-retail-v2/proto_docs/google/cloud/retail/v2/completion_service.rb delete mode 100644 owl-bot-staging/google-cloud-retail-v2/proto_docs/google/cloud/retail/v2/control.rb delete mode 100644 owl-bot-staging/google-cloud-retail-v2/proto_docs/google/cloud/retail/v2/control_service.rb delete mode 100644 owl-bot-staging/google-cloud-retail-v2/proto_docs/google/cloud/retail/v2/conversational_search_service.rb delete mode 100644 owl-bot-staging/google-cloud-retail-v2/proto_docs/google/cloud/retail/v2/export_config.rb delete mode 100644 owl-bot-staging/google-cloud-retail-v2/proto_docs/google/cloud/retail/v2/generative_question.rb delete mode 100644 owl-bot-staging/google-cloud-retail-v2/proto_docs/google/cloud/retail/v2/generative_question_service.rb delete mode 100644 owl-bot-staging/google-cloud-retail-v2/proto_docs/google/cloud/retail/v2/import_config.rb delete mode 100644 owl-bot-staging/google-cloud-retail-v2/proto_docs/google/cloud/retail/v2/model.rb delete mode 100644 owl-bot-staging/google-cloud-retail-v2/proto_docs/google/cloud/retail/v2/model_service.rb delete mode 100644 owl-bot-staging/google-cloud-retail-v2/proto_docs/google/cloud/retail/v2/prediction_service.rb delete mode 100644 owl-bot-staging/google-cloud-retail-v2/proto_docs/google/cloud/retail/v2/product.rb delete mode 100644 owl-bot-staging/google-cloud-retail-v2/proto_docs/google/cloud/retail/v2/product_service.rb delete mode 100644 owl-bot-staging/google-cloud-retail-v2/proto_docs/google/cloud/retail/v2/promotion.rb delete mode 100644 owl-bot-staging/google-cloud-retail-v2/proto_docs/google/cloud/retail/v2/purge_config.rb delete mode 100644 owl-bot-staging/google-cloud-retail-v2/proto_docs/google/cloud/retail/v2/safety.rb delete mode 100644 owl-bot-staging/google-cloud-retail-v2/proto_docs/google/cloud/retail/v2/search_service.rb delete mode 100644 owl-bot-staging/google-cloud-retail-v2/proto_docs/google/cloud/retail/v2/serving_config.rb delete mode 100644 owl-bot-staging/google-cloud-retail-v2/proto_docs/google/cloud/retail/v2/serving_config_service.rb delete mode 100644 owl-bot-staging/google-cloud-retail-v2/proto_docs/google/cloud/retail/v2/user_event.rb delete mode 100644 owl-bot-staging/google-cloud-retail-v2/proto_docs/google/cloud/retail/v2/user_event_service.rb delete mode 100644 owl-bot-staging/google-cloud-retail-v2/proto_docs/google/longrunning/operations.rb delete mode 100644 owl-bot-staging/google-cloud-retail-v2/proto_docs/google/protobuf/any.rb delete mode 100644 owl-bot-staging/google-cloud-retail-v2/proto_docs/google/protobuf/duration.rb delete mode 100644 owl-bot-staging/google-cloud-retail-v2/proto_docs/google/protobuf/empty.rb delete mode 100644 owl-bot-staging/google-cloud-retail-v2/proto_docs/google/protobuf/field_mask.rb delete mode 100644 owl-bot-staging/google-cloud-retail-v2/proto_docs/google/protobuf/struct.rb delete mode 100644 owl-bot-staging/google-cloud-retail-v2/proto_docs/google/protobuf/timestamp.rb delete mode 100644 owl-bot-staging/google-cloud-retail-v2/proto_docs/google/protobuf/wrappers.rb delete mode 100644 owl-bot-staging/google-cloud-retail-v2/proto_docs/google/rpc/status.rb delete mode 100644 owl-bot-staging/google-cloud-retail-v2/proto_docs/google/type/date.rb delete mode 100644 owl-bot-staging/google-cloud-retail-v2/snippets/Gemfile delete mode 100644 owl-bot-staging/google-cloud-retail-v2/snippets/analytics_service/export_analytics_metrics.rb delete mode 100644 owl-bot-staging/google-cloud-retail-v2/snippets/catalog_service/add_catalog_attribute.rb delete mode 100644 owl-bot-staging/google-cloud-retail-v2/snippets/catalog_service/get_attributes_config.rb delete mode 100644 owl-bot-staging/google-cloud-retail-v2/snippets/catalog_service/get_completion_config.rb delete mode 100644 owl-bot-staging/google-cloud-retail-v2/snippets/catalog_service/get_default_branch.rb delete mode 100644 owl-bot-staging/google-cloud-retail-v2/snippets/catalog_service/list_catalogs.rb delete mode 100644 owl-bot-staging/google-cloud-retail-v2/snippets/catalog_service/remove_catalog_attribute.rb delete mode 100644 owl-bot-staging/google-cloud-retail-v2/snippets/catalog_service/replace_catalog_attribute.rb delete mode 100644 owl-bot-staging/google-cloud-retail-v2/snippets/catalog_service/set_default_branch.rb delete mode 100644 owl-bot-staging/google-cloud-retail-v2/snippets/catalog_service/update_attributes_config.rb delete mode 100644 owl-bot-staging/google-cloud-retail-v2/snippets/catalog_service/update_catalog.rb delete mode 100644 owl-bot-staging/google-cloud-retail-v2/snippets/catalog_service/update_completion_config.rb delete mode 100644 owl-bot-staging/google-cloud-retail-v2/snippets/completion_service/complete_query.rb delete mode 100644 owl-bot-staging/google-cloud-retail-v2/snippets/completion_service/import_completion_data.rb delete mode 100644 owl-bot-staging/google-cloud-retail-v2/snippets/control_service/create_control.rb delete mode 100644 owl-bot-staging/google-cloud-retail-v2/snippets/control_service/delete_control.rb delete mode 100644 owl-bot-staging/google-cloud-retail-v2/snippets/control_service/get_control.rb delete mode 100644 owl-bot-staging/google-cloud-retail-v2/snippets/control_service/list_controls.rb delete mode 100644 owl-bot-staging/google-cloud-retail-v2/snippets/control_service/update_control.rb delete mode 100644 owl-bot-staging/google-cloud-retail-v2/snippets/conversational_search_service/conversational_search.rb delete mode 100644 owl-bot-staging/google-cloud-retail-v2/snippets/generative_question_service/batch_update_generative_question_configs.rb delete mode 100644 owl-bot-staging/google-cloud-retail-v2/snippets/generative_question_service/get_generative_questions_feature_config.rb delete mode 100644 owl-bot-staging/google-cloud-retail-v2/snippets/generative_question_service/list_generative_question_configs.rb delete mode 100644 owl-bot-staging/google-cloud-retail-v2/snippets/generative_question_service/update_generative_question_config.rb delete mode 100644 owl-bot-staging/google-cloud-retail-v2/snippets/generative_question_service/update_generative_questions_feature_config.rb delete mode 100644 owl-bot-staging/google-cloud-retail-v2/snippets/model_service/create_model.rb delete mode 100644 owl-bot-staging/google-cloud-retail-v2/snippets/model_service/delete_model.rb delete mode 100644 owl-bot-staging/google-cloud-retail-v2/snippets/model_service/get_model.rb delete mode 100644 owl-bot-staging/google-cloud-retail-v2/snippets/model_service/list_models.rb delete mode 100644 owl-bot-staging/google-cloud-retail-v2/snippets/model_service/pause_model.rb delete mode 100644 owl-bot-staging/google-cloud-retail-v2/snippets/model_service/resume_model.rb delete mode 100644 owl-bot-staging/google-cloud-retail-v2/snippets/model_service/tune_model.rb delete mode 100644 owl-bot-staging/google-cloud-retail-v2/snippets/model_service/update_model.rb delete mode 100644 owl-bot-staging/google-cloud-retail-v2/snippets/prediction_service/predict.rb delete mode 100644 owl-bot-staging/google-cloud-retail-v2/snippets/product_service/add_fulfillment_places.rb delete mode 100644 owl-bot-staging/google-cloud-retail-v2/snippets/product_service/add_local_inventories.rb delete mode 100644 owl-bot-staging/google-cloud-retail-v2/snippets/product_service/create_product.rb delete mode 100644 owl-bot-staging/google-cloud-retail-v2/snippets/product_service/delete_product.rb delete mode 100644 owl-bot-staging/google-cloud-retail-v2/snippets/product_service/get_product.rb delete mode 100644 owl-bot-staging/google-cloud-retail-v2/snippets/product_service/import_products.rb delete mode 100644 owl-bot-staging/google-cloud-retail-v2/snippets/product_service/list_products.rb delete mode 100644 owl-bot-staging/google-cloud-retail-v2/snippets/product_service/purge_products.rb delete mode 100644 owl-bot-staging/google-cloud-retail-v2/snippets/product_service/remove_fulfillment_places.rb delete mode 100644 owl-bot-staging/google-cloud-retail-v2/snippets/product_service/remove_local_inventories.rb delete mode 100644 owl-bot-staging/google-cloud-retail-v2/snippets/product_service/set_inventory.rb delete mode 100644 owl-bot-staging/google-cloud-retail-v2/snippets/product_service/update_product.rb delete mode 100644 owl-bot-staging/google-cloud-retail-v2/snippets/search_service/search.rb delete mode 100644 owl-bot-staging/google-cloud-retail-v2/snippets/serving_config_service/add_control.rb delete mode 100644 owl-bot-staging/google-cloud-retail-v2/snippets/serving_config_service/create_serving_config.rb delete mode 100644 owl-bot-staging/google-cloud-retail-v2/snippets/serving_config_service/delete_serving_config.rb delete mode 100644 owl-bot-staging/google-cloud-retail-v2/snippets/serving_config_service/get_serving_config.rb delete mode 100644 owl-bot-staging/google-cloud-retail-v2/snippets/serving_config_service/list_serving_configs.rb delete mode 100644 owl-bot-staging/google-cloud-retail-v2/snippets/serving_config_service/remove_control.rb delete mode 100644 owl-bot-staging/google-cloud-retail-v2/snippets/serving_config_service/update_serving_config.rb delete mode 100644 owl-bot-staging/google-cloud-retail-v2/snippets/snippet_metadata_google.cloud.retail.v2.json delete mode 100644 owl-bot-staging/google-cloud-retail-v2/snippets/user_event_service/collect_user_event.rb delete mode 100644 owl-bot-staging/google-cloud-retail-v2/snippets/user_event_service/import_user_events.rb delete mode 100644 owl-bot-staging/google-cloud-retail-v2/snippets/user_event_service/purge_user_events.rb delete mode 100644 owl-bot-staging/google-cloud-retail-v2/snippets/user_event_service/rejoin_user_events.rb delete mode 100644 owl-bot-staging/google-cloud-retail-v2/snippets/user_event_service/write_user_event.rb delete mode 100644 owl-bot-staging/google-cloud-retail-v2/test/google/cloud/retail/v2/analytics_service_operations_test.rb delete mode 100644 owl-bot-staging/google-cloud-retail-v2/test/google/cloud/retail/v2/analytics_service_rest_test.rb delete mode 100644 owl-bot-staging/google-cloud-retail-v2/test/google/cloud/retail/v2/analytics_service_test.rb delete mode 100644 owl-bot-staging/google-cloud-retail-v2/test/google/cloud/retail/v2/catalog_service_paths_test.rb delete mode 100644 owl-bot-staging/google-cloud-retail-v2/test/google/cloud/retail/v2/catalog_service_rest_test.rb delete mode 100644 owl-bot-staging/google-cloud-retail-v2/test/google/cloud/retail/v2/catalog_service_test.rb delete mode 100644 owl-bot-staging/google-cloud-retail-v2/test/google/cloud/retail/v2/completion_service_operations_test.rb delete mode 100644 owl-bot-staging/google-cloud-retail-v2/test/google/cloud/retail/v2/completion_service_paths_test.rb delete mode 100644 owl-bot-staging/google-cloud-retail-v2/test/google/cloud/retail/v2/completion_service_rest_test.rb delete mode 100644 owl-bot-staging/google-cloud-retail-v2/test/google/cloud/retail/v2/completion_service_test.rb delete mode 100644 owl-bot-staging/google-cloud-retail-v2/test/google/cloud/retail/v2/control_service_paths_test.rb delete mode 100644 owl-bot-staging/google-cloud-retail-v2/test/google/cloud/retail/v2/control_service_rest_test.rb delete mode 100644 owl-bot-staging/google-cloud-retail-v2/test/google/cloud/retail/v2/control_service_test.rb delete mode 100644 owl-bot-staging/google-cloud-retail-v2/test/google/cloud/retail/v2/conversational_search_service_paths_test.rb delete mode 100644 owl-bot-staging/google-cloud-retail-v2/test/google/cloud/retail/v2/conversational_search_service_rest_test.rb delete mode 100644 owl-bot-staging/google-cloud-retail-v2/test/google/cloud/retail/v2/conversational_search_service_test.rb delete mode 100644 owl-bot-staging/google-cloud-retail-v2/test/google/cloud/retail/v2/generative_question_service_paths_test.rb delete mode 100644 owl-bot-staging/google-cloud-retail-v2/test/google/cloud/retail/v2/generative_question_service_rest_test.rb delete mode 100644 owl-bot-staging/google-cloud-retail-v2/test/google/cloud/retail/v2/generative_question_service_test.rb delete mode 100644 owl-bot-staging/google-cloud-retail-v2/test/google/cloud/retail/v2/model_service_operations_test.rb delete mode 100644 owl-bot-staging/google-cloud-retail-v2/test/google/cloud/retail/v2/model_service_paths_test.rb delete mode 100644 owl-bot-staging/google-cloud-retail-v2/test/google/cloud/retail/v2/model_service_rest_test.rb delete mode 100644 owl-bot-staging/google-cloud-retail-v2/test/google/cloud/retail/v2/model_service_test.rb delete mode 100644 owl-bot-staging/google-cloud-retail-v2/test/google/cloud/retail/v2/prediction_service_paths_test.rb delete mode 100644 owl-bot-staging/google-cloud-retail-v2/test/google/cloud/retail/v2/prediction_service_rest_test.rb delete mode 100644 owl-bot-staging/google-cloud-retail-v2/test/google/cloud/retail/v2/prediction_service_test.rb delete mode 100644 owl-bot-staging/google-cloud-retail-v2/test/google/cloud/retail/v2/product_service_operations_test.rb delete mode 100644 owl-bot-staging/google-cloud-retail-v2/test/google/cloud/retail/v2/product_service_paths_test.rb delete mode 100644 owl-bot-staging/google-cloud-retail-v2/test/google/cloud/retail/v2/product_service_rest_test.rb delete mode 100644 owl-bot-staging/google-cloud-retail-v2/test/google/cloud/retail/v2/product_service_test.rb delete mode 100644 owl-bot-staging/google-cloud-retail-v2/test/google/cloud/retail/v2/search_service_paths_test.rb delete mode 100644 owl-bot-staging/google-cloud-retail-v2/test/google/cloud/retail/v2/search_service_rest_test.rb delete mode 100644 owl-bot-staging/google-cloud-retail-v2/test/google/cloud/retail/v2/search_service_test.rb delete mode 100644 owl-bot-staging/google-cloud-retail-v2/test/google/cloud/retail/v2/serving_config_service_paths_test.rb delete mode 100644 owl-bot-staging/google-cloud-retail-v2/test/google/cloud/retail/v2/serving_config_service_rest_test.rb delete mode 100644 owl-bot-staging/google-cloud-retail-v2/test/google/cloud/retail/v2/serving_config_service_test.rb delete mode 100644 owl-bot-staging/google-cloud-retail-v2/test/google/cloud/retail/v2/user_event_service_operations_test.rb delete mode 100644 owl-bot-staging/google-cloud-retail-v2/test/google/cloud/retail/v2/user_event_service_paths_test.rb delete mode 100644 owl-bot-staging/google-cloud-retail-v2/test/google/cloud/retail/v2/user_event_service_rest_test.rb delete mode 100644 owl-bot-staging/google-cloud-retail-v2/test/google/cloud/retail/v2/user_event_service_test.rb delete mode 100644 owl-bot-staging/google-cloud-retail-v2/test/helper.rb delete mode 100644 owl-bot-staging/google-cloud-saas_platform-saas_service_mgmt-v1beta1/.gitignore delete mode 100644 owl-bot-staging/google-cloud-saas_platform-saas_service_mgmt-v1beta1/.repo-metadata.json delete mode 100644 owl-bot-staging/google-cloud-saas_platform-saas_service_mgmt-v1beta1/.rubocop.yml delete mode 100644 owl-bot-staging/google-cloud-saas_platform-saas_service_mgmt-v1beta1/.toys.rb delete mode 100644 owl-bot-staging/google-cloud-saas_platform-saas_service_mgmt-v1beta1/.yardopts delete mode 100644 owl-bot-staging/google-cloud-saas_platform-saas_service_mgmt-v1beta1/AUTHENTICATION.md delete mode 100644 owl-bot-staging/google-cloud-saas_platform-saas_service_mgmt-v1beta1/CHANGELOG.md delete mode 100644 owl-bot-staging/google-cloud-saas_platform-saas_service_mgmt-v1beta1/Gemfile delete mode 100644 owl-bot-staging/google-cloud-saas_platform-saas_service_mgmt-v1beta1/LICENSE.md delete mode 100644 owl-bot-staging/google-cloud-saas_platform-saas_service_mgmt-v1beta1/README.md delete mode 100644 owl-bot-staging/google-cloud-saas_platform-saas_service_mgmt-v1beta1/Rakefile delete mode 100644 owl-bot-staging/google-cloud-saas_platform-saas_service_mgmt-v1beta1/gapic_metadata.json delete mode 100644 owl-bot-staging/google-cloud-saas_platform-saas_service_mgmt-v1beta1/google-cloud-saas_platform-saas_service_mgmt-v1beta1.gemspec delete mode 100644 owl-bot-staging/google-cloud-saas_platform-saas_service_mgmt-v1beta1/lib/google-cloud-saas_platform-saas_service_mgmt-v1beta1.rb delete mode 100644 owl-bot-staging/google-cloud-saas_platform-saas_service_mgmt-v1beta1/lib/google/cloud/saas_platform/saas_service_mgmt/v1beta1.rb delete mode 100644 owl-bot-staging/google-cloud-saas_platform-saas_service_mgmt-v1beta1/lib/google/cloud/saas_platform/saas_service_mgmt/v1beta1/bindings_override.rb delete mode 100644 owl-bot-staging/google-cloud-saas_platform-saas_service_mgmt-v1beta1/lib/google/cloud/saas_platform/saas_service_mgmt/v1beta1/rest.rb delete mode 100644 owl-bot-staging/google-cloud-saas_platform-saas_service_mgmt-v1beta1/lib/google/cloud/saas_platform/saas_service_mgmt/v1beta1/saas_deployments.rb delete mode 100644 owl-bot-staging/google-cloud-saas_platform-saas_service_mgmt-v1beta1/lib/google/cloud/saas_platform/saas_service_mgmt/v1beta1/saas_deployments/client.rb delete mode 100644 owl-bot-staging/google-cloud-saas_platform-saas_service_mgmt-v1beta1/lib/google/cloud/saas_platform/saas_service_mgmt/v1beta1/saas_deployments/credentials.rb delete mode 100644 owl-bot-staging/google-cloud-saas_platform-saas_service_mgmt-v1beta1/lib/google/cloud/saas_platform/saas_service_mgmt/v1beta1/saas_deployments/paths.rb delete mode 100644 owl-bot-staging/google-cloud-saas_platform-saas_service_mgmt-v1beta1/lib/google/cloud/saas_platform/saas_service_mgmt/v1beta1/saas_deployments/rest.rb delete mode 100644 owl-bot-staging/google-cloud-saas_platform-saas_service_mgmt-v1beta1/lib/google/cloud/saas_platform/saas_service_mgmt/v1beta1/saas_deployments/rest/client.rb delete mode 100644 owl-bot-staging/google-cloud-saas_platform-saas_service_mgmt-v1beta1/lib/google/cloud/saas_platform/saas_service_mgmt/v1beta1/saas_deployments/rest/service_stub.rb delete mode 100644 owl-bot-staging/google-cloud-saas_platform-saas_service_mgmt-v1beta1/lib/google/cloud/saas_platform/saas_service_mgmt/v1beta1/saas_rollouts.rb delete mode 100644 owl-bot-staging/google-cloud-saas_platform-saas_service_mgmt-v1beta1/lib/google/cloud/saas_platform/saas_service_mgmt/v1beta1/saas_rollouts/client.rb delete mode 100644 owl-bot-staging/google-cloud-saas_platform-saas_service_mgmt-v1beta1/lib/google/cloud/saas_platform/saas_service_mgmt/v1beta1/saas_rollouts/credentials.rb delete mode 100644 owl-bot-staging/google-cloud-saas_platform-saas_service_mgmt-v1beta1/lib/google/cloud/saas_platform/saas_service_mgmt/v1beta1/saas_rollouts/paths.rb delete mode 100644 owl-bot-staging/google-cloud-saas_platform-saas_service_mgmt-v1beta1/lib/google/cloud/saas_platform/saas_service_mgmt/v1beta1/saas_rollouts/rest.rb delete mode 100644 owl-bot-staging/google-cloud-saas_platform-saas_service_mgmt-v1beta1/lib/google/cloud/saas_platform/saas_service_mgmt/v1beta1/saas_rollouts/rest/client.rb delete mode 100644 owl-bot-staging/google-cloud-saas_platform-saas_service_mgmt-v1beta1/lib/google/cloud/saas_platform/saas_service_mgmt/v1beta1/saas_rollouts/rest/service_stub.rb delete mode 100644 owl-bot-staging/google-cloud-saas_platform-saas_service_mgmt-v1beta1/lib/google/cloud/saas_platform/saas_service_mgmt/v1beta1/version.rb delete mode 100644 owl-bot-staging/google-cloud-saas_platform-saas_service_mgmt-v1beta1/lib/google/cloud/saasplatform/saasservicemgmt/v1beta1/common_pb.rb delete mode 100644 owl-bot-staging/google-cloud-saas_platform-saas_service_mgmt-v1beta1/lib/google/cloud/saasplatform/saasservicemgmt/v1beta1/deployments_resources_pb.rb delete mode 100644 owl-bot-staging/google-cloud-saas_platform-saas_service_mgmt-v1beta1/lib/google/cloud/saasplatform/saasservicemgmt/v1beta1/deployments_service_pb.rb delete mode 100644 owl-bot-staging/google-cloud-saas_platform-saas_service_mgmt-v1beta1/lib/google/cloud/saasplatform/saasservicemgmt/v1beta1/deployments_service_services_pb.rb delete mode 100644 owl-bot-staging/google-cloud-saas_platform-saas_service_mgmt-v1beta1/lib/google/cloud/saasplatform/saasservicemgmt/v1beta1/rollouts_resources_pb.rb delete mode 100644 owl-bot-staging/google-cloud-saas_platform-saas_service_mgmt-v1beta1/lib/google/cloud/saasplatform/saasservicemgmt/v1beta1/rollouts_service_pb.rb delete mode 100644 owl-bot-staging/google-cloud-saas_platform-saas_service_mgmt-v1beta1/lib/google/cloud/saasplatform/saasservicemgmt/v1beta1/rollouts_service_services_pb.rb delete mode 100644 owl-bot-staging/google-cloud-saas_platform-saas_service_mgmt-v1beta1/proto_docs/README.md delete mode 100644 owl-bot-staging/google-cloud-saas_platform-saas_service_mgmt-v1beta1/proto_docs/google/api/client.rb delete mode 100644 owl-bot-staging/google-cloud-saas_platform-saas_service_mgmt-v1beta1/proto_docs/google/api/field_behavior.rb delete mode 100644 owl-bot-staging/google-cloud-saas_platform-saas_service_mgmt-v1beta1/proto_docs/google/api/field_info.rb delete mode 100644 owl-bot-staging/google-cloud-saas_platform-saas_service_mgmt-v1beta1/proto_docs/google/api/launch_stage.rb delete mode 100644 owl-bot-staging/google-cloud-saas_platform-saas_service_mgmt-v1beta1/proto_docs/google/api/resource.rb delete mode 100644 owl-bot-staging/google-cloud-saas_platform-saas_service_mgmt-v1beta1/proto_docs/google/cloud/saasplatform/saasservicemgmt/v1beta1/common.rb delete mode 100644 owl-bot-staging/google-cloud-saas_platform-saas_service_mgmt-v1beta1/proto_docs/google/cloud/saasplatform/saasservicemgmt/v1beta1/deployments_resources.rb delete mode 100644 owl-bot-staging/google-cloud-saas_platform-saas_service_mgmt-v1beta1/proto_docs/google/cloud/saasplatform/saasservicemgmt/v1beta1/deployments_service.rb delete mode 100644 owl-bot-staging/google-cloud-saas_platform-saas_service_mgmt-v1beta1/proto_docs/google/cloud/saasplatform/saasservicemgmt/v1beta1/rollouts_resources.rb delete mode 100644 owl-bot-staging/google-cloud-saas_platform-saas_service_mgmt-v1beta1/proto_docs/google/cloud/saasplatform/saasservicemgmt/v1beta1/rollouts_service.rb delete mode 100644 owl-bot-staging/google-cloud-saas_platform-saas_service_mgmt-v1beta1/proto_docs/google/protobuf/any.rb delete mode 100644 owl-bot-staging/google-cloud-saas_platform-saas_service_mgmt-v1beta1/proto_docs/google/protobuf/duration.rb delete mode 100644 owl-bot-staging/google-cloud-saas_platform-saas_service_mgmt-v1beta1/proto_docs/google/protobuf/empty.rb delete mode 100644 owl-bot-staging/google-cloud-saas_platform-saas_service_mgmt-v1beta1/proto_docs/google/protobuf/field_mask.rb delete mode 100644 owl-bot-staging/google-cloud-saas_platform-saas_service_mgmt-v1beta1/proto_docs/google/protobuf/timestamp.rb delete mode 100644 owl-bot-staging/google-cloud-saas_platform-saas_service_mgmt-v1beta1/snippets/Gemfile delete mode 100644 owl-bot-staging/google-cloud-saas_platform-saas_service_mgmt-v1beta1/snippets/saas_deployments/create_release.rb delete mode 100644 owl-bot-staging/google-cloud-saas_platform-saas_service_mgmt-v1beta1/snippets/saas_deployments/create_saas.rb delete mode 100644 owl-bot-staging/google-cloud-saas_platform-saas_service_mgmt-v1beta1/snippets/saas_deployments/create_tenant.rb delete mode 100644 owl-bot-staging/google-cloud-saas_platform-saas_service_mgmt-v1beta1/snippets/saas_deployments/create_unit.rb delete mode 100644 owl-bot-staging/google-cloud-saas_platform-saas_service_mgmt-v1beta1/snippets/saas_deployments/create_unit_kind.rb delete mode 100644 owl-bot-staging/google-cloud-saas_platform-saas_service_mgmt-v1beta1/snippets/saas_deployments/create_unit_operation.rb delete mode 100644 owl-bot-staging/google-cloud-saas_platform-saas_service_mgmt-v1beta1/snippets/saas_deployments/delete_release.rb delete mode 100644 owl-bot-staging/google-cloud-saas_platform-saas_service_mgmt-v1beta1/snippets/saas_deployments/delete_saas.rb delete mode 100644 owl-bot-staging/google-cloud-saas_platform-saas_service_mgmt-v1beta1/snippets/saas_deployments/delete_tenant.rb delete mode 100644 owl-bot-staging/google-cloud-saas_platform-saas_service_mgmt-v1beta1/snippets/saas_deployments/delete_unit.rb delete mode 100644 owl-bot-staging/google-cloud-saas_platform-saas_service_mgmt-v1beta1/snippets/saas_deployments/delete_unit_kind.rb delete mode 100644 owl-bot-staging/google-cloud-saas_platform-saas_service_mgmt-v1beta1/snippets/saas_deployments/delete_unit_operation.rb delete mode 100644 owl-bot-staging/google-cloud-saas_platform-saas_service_mgmt-v1beta1/snippets/saas_deployments/get_release.rb delete mode 100644 owl-bot-staging/google-cloud-saas_platform-saas_service_mgmt-v1beta1/snippets/saas_deployments/get_saas.rb delete mode 100644 owl-bot-staging/google-cloud-saas_platform-saas_service_mgmt-v1beta1/snippets/saas_deployments/get_tenant.rb delete mode 100644 owl-bot-staging/google-cloud-saas_platform-saas_service_mgmt-v1beta1/snippets/saas_deployments/get_unit.rb delete mode 100644 owl-bot-staging/google-cloud-saas_platform-saas_service_mgmt-v1beta1/snippets/saas_deployments/get_unit_kind.rb delete mode 100644 owl-bot-staging/google-cloud-saas_platform-saas_service_mgmt-v1beta1/snippets/saas_deployments/get_unit_operation.rb delete mode 100644 owl-bot-staging/google-cloud-saas_platform-saas_service_mgmt-v1beta1/snippets/saas_deployments/list_releases.rb delete mode 100644 owl-bot-staging/google-cloud-saas_platform-saas_service_mgmt-v1beta1/snippets/saas_deployments/list_saas.rb delete mode 100644 owl-bot-staging/google-cloud-saas_platform-saas_service_mgmt-v1beta1/snippets/saas_deployments/list_tenants.rb delete mode 100644 owl-bot-staging/google-cloud-saas_platform-saas_service_mgmt-v1beta1/snippets/saas_deployments/list_unit_kinds.rb delete mode 100644 owl-bot-staging/google-cloud-saas_platform-saas_service_mgmt-v1beta1/snippets/saas_deployments/list_unit_operations.rb delete mode 100644 owl-bot-staging/google-cloud-saas_platform-saas_service_mgmt-v1beta1/snippets/saas_deployments/list_units.rb delete mode 100644 owl-bot-staging/google-cloud-saas_platform-saas_service_mgmt-v1beta1/snippets/saas_deployments/update_release.rb delete mode 100644 owl-bot-staging/google-cloud-saas_platform-saas_service_mgmt-v1beta1/snippets/saas_deployments/update_saas.rb delete mode 100644 owl-bot-staging/google-cloud-saas_platform-saas_service_mgmt-v1beta1/snippets/saas_deployments/update_tenant.rb delete mode 100644 owl-bot-staging/google-cloud-saas_platform-saas_service_mgmt-v1beta1/snippets/saas_deployments/update_unit.rb delete mode 100644 owl-bot-staging/google-cloud-saas_platform-saas_service_mgmt-v1beta1/snippets/saas_deployments/update_unit_kind.rb delete mode 100644 owl-bot-staging/google-cloud-saas_platform-saas_service_mgmt-v1beta1/snippets/saas_deployments/update_unit_operation.rb delete mode 100644 owl-bot-staging/google-cloud-saas_platform-saas_service_mgmt-v1beta1/snippets/saas_rollouts/create_rollout.rb delete mode 100644 owl-bot-staging/google-cloud-saas_platform-saas_service_mgmt-v1beta1/snippets/saas_rollouts/create_rollout_kind.rb delete mode 100644 owl-bot-staging/google-cloud-saas_platform-saas_service_mgmt-v1beta1/snippets/saas_rollouts/delete_rollout.rb delete mode 100644 owl-bot-staging/google-cloud-saas_platform-saas_service_mgmt-v1beta1/snippets/saas_rollouts/delete_rollout_kind.rb delete mode 100644 owl-bot-staging/google-cloud-saas_platform-saas_service_mgmt-v1beta1/snippets/saas_rollouts/get_rollout.rb delete mode 100644 owl-bot-staging/google-cloud-saas_platform-saas_service_mgmt-v1beta1/snippets/saas_rollouts/get_rollout_kind.rb delete mode 100644 owl-bot-staging/google-cloud-saas_platform-saas_service_mgmt-v1beta1/snippets/saas_rollouts/list_rollout_kinds.rb delete mode 100644 owl-bot-staging/google-cloud-saas_platform-saas_service_mgmt-v1beta1/snippets/saas_rollouts/list_rollouts.rb delete mode 100644 owl-bot-staging/google-cloud-saas_platform-saas_service_mgmt-v1beta1/snippets/saas_rollouts/update_rollout.rb delete mode 100644 owl-bot-staging/google-cloud-saas_platform-saas_service_mgmt-v1beta1/snippets/saas_rollouts/update_rollout_kind.rb delete mode 100644 owl-bot-staging/google-cloud-saas_platform-saas_service_mgmt-v1beta1/snippets/snippet_metadata_google.cloud.saasplatform.saasservicemgmt.v1beta1.json delete mode 100644 owl-bot-staging/google-cloud-saas_platform-saas_service_mgmt-v1beta1/test/google/cloud/saas_platform/saas_service_mgmt/v1beta1/saas_deployments_paths_test.rb delete mode 100644 owl-bot-staging/google-cloud-saas_platform-saas_service_mgmt-v1beta1/test/google/cloud/saas_platform/saas_service_mgmt/v1beta1/saas_deployments_rest_test.rb delete mode 100644 owl-bot-staging/google-cloud-saas_platform-saas_service_mgmt-v1beta1/test/google/cloud/saas_platform/saas_service_mgmt/v1beta1/saas_deployments_test.rb delete mode 100644 owl-bot-staging/google-cloud-saas_platform-saas_service_mgmt-v1beta1/test/google/cloud/saas_platform/saas_service_mgmt/v1beta1/saas_rollouts_paths_test.rb delete mode 100644 owl-bot-staging/google-cloud-saas_platform-saas_service_mgmt-v1beta1/test/google/cloud/saas_platform/saas_service_mgmt/v1beta1/saas_rollouts_rest_test.rb delete mode 100644 owl-bot-staging/google-cloud-saas_platform-saas_service_mgmt-v1beta1/test/google/cloud/saas_platform/saas_service_mgmt/v1beta1/saas_rollouts_test.rb delete mode 100644 owl-bot-staging/google-cloud-saas_platform-saas_service_mgmt-v1beta1/test/helper.rb delete mode 100644 owl-bot-staging/google-cloud-scheduler-v1/.gitignore delete mode 100644 owl-bot-staging/google-cloud-scheduler-v1/.repo-metadata.json delete mode 100644 owl-bot-staging/google-cloud-scheduler-v1/.rubocop.yml delete mode 100644 owl-bot-staging/google-cloud-scheduler-v1/.toys.rb delete mode 100644 owl-bot-staging/google-cloud-scheduler-v1/.yardopts delete mode 100644 owl-bot-staging/google-cloud-scheduler-v1/AUTHENTICATION.md delete mode 100644 owl-bot-staging/google-cloud-scheduler-v1/CHANGELOG.md delete mode 100644 owl-bot-staging/google-cloud-scheduler-v1/Gemfile delete mode 100644 owl-bot-staging/google-cloud-scheduler-v1/LICENSE.md delete mode 100644 owl-bot-staging/google-cloud-scheduler-v1/README.md delete mode 100644 owl-bot-staging/google-cloud-scheduler-v1/Rakefile delete mode 100644 owl-bot-staging/google-cloud-scheduler-v1/gapic_metadata.json delete mode 100644 owl-bot-staging/google-cloud-scheduler-v1/google-cloud-scheduler-v1.gemspec delete mode 100644 owl-bot-staging/google-cloud-scheduler-v1/lib/google-cloud-scheduler-v1.rb delete mode 100644 owl-bot-staging/google-cloud-scheduler-v1/lib/google/cloud/scheduler/v1.rb delete mode 100644 owl-bot-staging/google-cloud-scheduler-v1/lib/google/cloud/scheduler/v1/bindings_override.rb delete mode 100644 owl-bot-staging/google-cloud-scheduler-v1/lib/google/cloud/scheduler/v1/cloud_scheduler.rb delete mode 100644 owl-bot-staging/google-cloud-scheduler-v1/lib/google/cloud/scheduler/v1/cloud_scheduler/client.rb delete mode 100644 owl-bot-staging/google-cloud-scheduler-v1/lib/google/cloud/scheduler/v1/cloud_scheduler/credentials.rb delete mode 100644 owl-bot-staging/google-cloud-scheduler-v1/lib/google/cloud/scheduler/v1/cloud_scheduler/paths.rb delete mode 100644 owl-bot-staging/google-cloud-scheduler-v1/lib/google/cloud/scheduler/v1/cloud_scheduler/rest.rb delete mode 100644 owl-bot-staging/google-cloud-scheduler-v1/lib/google/cloud/scheduler/v1/cloud_scheduler/rest/client.rb delete mode 100644 owl-bot-staging/google-cloud-scheduler-v1/lib/google/cloud/scheduler/v1/cloud_scheduler/rest/service_stub.rb delete mode 100644 owl-bot-staging/google-cloud-scheduler-v1/lib/google/cloud/scheduler/v1/cloudscheduler_pb.rb delete mode 100644 owl-bot-staging/google-cloud-scheduler-v1/lib/google/cloud/scheduler/v1/cloudscheduler_services_pb.rb delete mode 100644 owl-bot-staging/google-cloud-scheduler-v1/lib/google/cloud/scheduler/v1/job_pb.rb delete mode 100644 owl-bot-staging/google-cloud-scheduler-v1/lib/google/cloud/scheduler/v1/rest.rb delete mode 100644 owl-bot-staging/google-cloud-scheduler-v1/lib/google/cloud/scheduler/v1/target_pb.rb delete mode 100644 owl-bot-staging/google-cloud-scheduler-v1/lib/google/cloud/scheduler/v1/version.rb delete mode 100644 owl-bot-staging/google-cloud-scheduler-v1/proto_docs/README.md delete mode 100644 owl-bot-staging/google-cloud-scheduler-v1/proto_docs/google/api/client.rb delete mode 100644 owl-bot-staging/google-cloud-scheduler-v1/proto_docs/google/api/field_behavior.rb delete mode 100644 owl-bot-staging/google-cloud-scheduler-v1/proto_docs/google/api/launch_stage.rb delete mode 100644 owl-bot-staging/google-cloud-scheduler-v1/proto_docs/google/api/resource.rb delete mode 100644 owl-bot-staging/google-cloud-scheduler-v1/proto_docs/google/cloud/scheduler/v1/cloudscheduler.rb delete mode 100644 owl-bot-staging/google-cloud-scheduler-v1/proto_docs/google/cloud/scheduler/v1/job.rb delete mode 100644 owl-bot-staging/google-cloud-scheduler-v1/proto_docs/google/cloud/scheduler/v1/target.rb delete mode 100644 owl-bot-staging/google-cloud-scheduler-v1/proto_docs/google/protobuf/any.rb delete mode 100644 owl-bot-staging/google-cloud-scheduler-v1/proto_docs/google/protobuf/duration.rb delete mode 100644 owl-bot-staging/google-cloud-scheduler-v1/proto_docs/google/protobuf/empty.rb delete mode 100644 owl-bot-staging/google-cloud-scheduler-v1/proto_docs/google/protobuf/field_mask.rb delete mode 100644 owl-bot-staging/google-cloud-scheduler-v1/proto_docs/google/protobuf/timestamp.rb delete mode 100644 owl-bot-staging/google-cloud-scheduler-v1/proto_docs/google/rpc/status.rb delete mode 100644 owl-bot-staging/google-cloud-scheduler-v1/snippets/Gemfile delete mode 100644 owl-bot-staging/google-cloud-scheduler-v1/snippets/cloud_scheduler/create_job.rb delete mode 100644 owl-bot-staging/google-cloud-scheduler-v1/snippets/cloud_scheduler/delete_job.rb delete mode 100644 owl-bot-staging/google-cloud-scheduler-v1/snippets/cloud_scheduler/get_job.rb delete mode 100644 owl-bot-staging/google-cloud-scheduler-v1/snippets/cloud_scheduler/list_jobs.rb delete mode 100644 owl-bot-staging/google-cloud-scheduler-v1/snippets/cloud_scheduler/pause_job.rb delete mode 100644 owl-bot-staging/google-cloud-scheduler-v1/snippets/cloud_scheduler/resume_job.rb delete mode 100644 owl-bot-staging/google-cloud-scheduler-v1/snippets/cloud_scheduler/run_job.rb delete mode 100644 owl-bot-staging/google-cloud-scheduler-v1/snippets/cloud_scheduler/update_job.rb delete mode 100644 owl-bot-staging/google-cloud-scheduler-v1/snippets/snippet_metadata_google.cloud.scheduler.v1.json delete mode 100644 owl-bot-staging/google-cloud-scheduler-v1/test/google/cloud/scheduler/v1/cloud_scheduler_paths_test.rb delete mode 100644 owl-bot-staging/google-cloud-scheduler-v1/test/google/cloud/scheduler/v1/cloud_scheduler_rest_test.rb delete mode 100644 owl-bot-staging/google-cloud-scheduler-v1/test/google/cloud/scheduler/v1/cloud_scheduler_test.rb delete mode 100644 owl-bot-staging/google-cloud-scheduler-v1/test/helper.rb delete mode 100644 owl-bot-staging/google-cloud-scheduler-v1beta1/.gitignore delete mode 100644 owl-bot-staging/google-cloud-scheduler-v1beta1/.repo-metadata.json delete mode 100644 owl-bot-staging/google-cloud-scheduler-v1beta1/.rubocop.yml delete mode 100644 owl-bot-staging/google-cloud-scheduler-v1beta1/.toys.rb delete mode 100644 owl-bot-staging/google-cloud-scheduler-v1beta1/.yardopts delete mode 100644 owl-bot-staging/google-cloud-scheduler-v1beta1/AUTHENTICATION.md delete mode 100644 owl-bot-staging/google-cloud-scheduler-v1beta1/CHANGELOG.md delete mode 100644 owl-bot-staging/google-cloud-scheduler-v1beta1/Gemfile delete mode 100644 owl-bot-staging/google-cloud-scheduler-v1beta1/LICENSE.md delete mode 100644 owl-bot-staging/google-cloud-scheduler-v1beta1/README.md delete mode 100644 owl-bot-staging/google-cloud-scheduler-v1beta1/Rakefile delete mode 100644 owl-bot-staging/google-cloud-scheduler-v1beta1/gapic_metadata.json delete mode 100644 owl-bot-staging/google-cloud-scheduler-v1beta1/google-cloud-scheduler-v1beta1.gemspec delete mode 100644 owl-bot-staging/google-cloud-scheduler-v1beta1/lib/google-cloud-scheduler-v1beta1.rb delete mode 100644 owl-bot-staging/google-cloud-scheduler-v1beta1/lib/google/cloud/scheduler/v1beta1.rb delete mode 100644 owl-bot-staging/google-cloud-scheduler-v1beta1/lib/google/cloud/scheduler/v1beta1/bindings_override.rb delete mode 100644 owl-bot-staging/google-cloud-scheduler-v1beta1/lib/google/cloud/scheduler/v1beta1/cloud_scheduler.rb delete mode 100644 owl-bot-staging/google-cloud-scheduler-v1beta1/lib/google/cloud/scheduler/v1beta1/cloud_scheduler/client.rb delete mode 100644 owl-bot-staging/google-cloud-scheduler-v1beta1/lib/google/cloud/scheduler/v1beta1/cloud_scheduler/credentials.rb delete mode 100644 owl-bot-staging/google-cloud-scheduler-v1beta1/lib/google/cloud/scheduler/v1beta1/cloud_scheduler/paths.rb delete mode 100644 owl-bot-staging/google-cloud-scheduler-v1beta1/lib/google/cloud/scheduler/v1beta1/cloud_scheduler/rest.rb delete mode 100644 owl-bot-staging/google-cloud-scheduler-v1beta1/lib/google/cloud/scheduler/v1beta1/cloud_scheduler/rest/client.rb delete mode 100644 owl-bot-staging/google-cloud-scheduler-v1beta1/lib/google/cloud/scheduler/v1beta1/cloud_scheduler/rest/service_stub.rb delete mode 100644 owl-bot-staging/google-cloud-scheduler-v1beta1/lib/google/cloud/scheduler/v1beta1/cloudscheduler_pb.rb delete mode 100644 owl-bot-staging/google-cloud-scheduler-v1beta1/lib/google/cloud/scheduler/v1beta1/cloudscheduler_services_pb.rb delete mode 100644 owl-bot-staging/google-cloud-scheduler-v1beta1/lib/google/cloud/scheduler/v1beta1/job_pb.rb delete mode 100644 owl-bot-staging/google-cloud-scheduler-v1beta1/lib/google/cloud/scheduler/v1beta1/rest.rb delete mode 100644 owl-bot-staging/google-cloud-scheduler-v1beta1/lib/google/cloud/scheduler/v1beta1/target_pb.rb delete mode 100644 owl-bot-staging/google-cloud-scheduler-v1beta1/lib/google/cloud/scheduler/v1beta1/version.rb delete mode 100644 owl-bot-staging/google-cloud-scheduler-v1beta1/proto_docs/README.md delete mode 100644 owl-bot-staging/google-cloud-scheduler-v1beta1/proto_docs/google/api/client.rb delete mode 100644 owl-bot-staging/google-cloud-scheduler-v1beta1/proto_docs/google/api/field_behavior.rb delete mode 100644 owl-bot-staging/google-cloud-scheduler-v1beta1/proto_docs/google/api/launch_stage.rb delete mode 100644 owl-bot-staging/google-cloud-scheduler-v1beta1/proto_docs/google/api/resource.rb delete mode 100644 owl-bot-staging/google-cloud-scheduler-v1beta1/proto_docs/google/cloud/scheduler/v1beta1/cloudscheduler.rb delete mode 100644 owl-bot-staging/google-cloud-scheduler-v1beta1/proto_docs/google/cloud/scheduler/v1beta1/job.rb delete mode 100644 owl-bot-staging/google-cloud-scheduler-v1beta1/proto_docs/google/cloud/scheduler/v1beta1/target.rb delete mode 100644 owl-bot-staging/google-cloud-scheduler-v1beta1/proto_docs/google/protobuf/any.rb delete mode 100644 owl-bot-staging/google-cloud-scheduler-v1beta1/proto_docs/google/protobuf/duration.rb delete mode 100644 owl-bot-staging/google-cloud-scheduler-v1beta1/proto_docs/google/protobuf/empty.rb delete mode 100644 owl-bot-staging/google-cloud-scheduler-v1beta1/proto_docs/google/protobuf/field_mask.rb delete mode 100644 owl-bot-staging/google-cloud-scheduler-v1beta1/proto_docs/google/protobuf/timestamp.rb delete mode 100644 owl-bot-staging/google-cloud-scheduler-v1beta1/proto_docs/google/rpc/status.rb delete mode 100644 owl-bot-staging/google-cloud-scheduler-v1beta1/snippets/Gemfile delete mode 100644 owl-bot-staging/google-cloud-scheduler-v1beta1/snippets/cloud_scheduler/create_job.rb delete mode 100644 owl-bot-staging/google-cloud-scheduler-v1beta1/snippets/cloud_scheduler/delete_job.rb delete mode 100644 owl-bot-staging/google-cloud-scheduler-v1beta1/snippets/cloud_scheduler/get_job.rb delete mode 100644 owl-bot-staging/google-cloud-scheduler-v1beta1/snippets/cloud_scheduler/list_jobs.rb delete mode 100644 owl-bot-staging/google-cloud-scheduler-v1beta1/snippets/cloud_scheduler/pause_job.rb delete mode 100644 owl-bot-staging/google-cloud-scheduler-v1beta1/snippets/cloud_scheduler/resume_job.rb delete mode 100644 owl-bot-staging/google-cloud-scheduler-v1beta1/snippets/cloud_scheduler/run_job.rb delete mode 100644 owl-bot-staging/google-cloud-scheduler-v1beta1/snippets/cloud_scheduler/update_job.rb delete mode 100644 owl-bot-staging/google-cloud-scheduler-v1beta1/snippets/snippet_metadata_google.cloud.scheduler.v1beta1.json delete mode 100644 owl-bot-staging/google-cloud-scheduler-v1beta1/test/google/cloud/scheduler/v1beta1/cloud_scheduler_paths_test.rb delete mode 100644 owl-bot-staging/google-cloud-scheduler-v1beta1/test/google/cloud/scheduler/v1beta1/cloud_scheduler_rest_test.rb delete mode 100644 owl-bot-staging/google-cloud-scheduler-v1beta1/test/google/cloud/scheduler/v1beta1/cloud_scheduler_test.rb delete mode 100644 owl-bot-staging/google-cloud-scheduler-v1beta1/test/helper.rb delete mode 100644 owl-bot-staging/google-cloud-secret_manager-v1/.gitignore delete mode 100644 owl-bot-staging/google-cloud-secret_manager-v1/.repo-metadata.json delete mode 100644 owl-bot-staging/google-cloud-secret_manager-v1/.rubocop.yml delete mode 100644 owl-bot-staging/google-cloud-secret_manager-v1/.toys.rb delete mode 100644 owl-bot-staging/google-cloud-secret_manager-v1/.yardopts delete mode 100644 owl-bot-staging/google-cloud-secret_manager-v1/AUTHENTICATION.md delete mode 100644 owl-bot-staging/google-cloud-secret_manager-v1/CHANGELOG.md delete mode 100644 owl-bot-staging/google-cloud-secret_manager-v1/Gemfile delete mode 100644 owl-bot-staging/google-cloud-secret_manager-v1/LICENSE.md delete mode 100644 owl-bot-staging/google-cloud-secret_manager-v1/README.md delete mode 100644 owl-bot-staging/google-cloud-secret_manager-v1/Rakefile delete mode 100644 owl-bot-staging/google-cloud-secret_manager-v1/gapic_metadata.json delete mode 100644 owl-bot-staging/google-cloud-secret_manager-v1/google-cloud-secret_manager-v1.gemspec delete mode 100644 owl-bot-staging/google-cloud-secret_manager-v1/lib/google-cloud-secret_manager-v1.rb delete mode 100644 owl-bot-staging/google-cloud-secret_manager-v1/lib/google/cloud/secret_manager/v1.rb delete mode 100644 owl-bot-staging/google-cloud-secret_manager-v1/lib/google/cloud/secret_manager/v1/bindings_override.rb delete mode 100644 owl-bot-staging/google-cloud-secret_manager-v1/lib/google/cloud/secret_manager/v1/rest.rb delete mode 100644 owl-bot-staging/google-cloud-secret_manager-v1/lib/google/cloud/secret_manager/v1/secret_manager_service.rb delete mode 100644 owl-bot-staging/google-cloud-secret_manager-v1/lib/google/cloud/secret_manager/v1/secret_manager_service/client.rb delete mode 100644 owl-bot-staging/google-cloud-secret_manager-v1/lib/google/cloud/secret_manager/v1/secret_manager_service/credentials.rb delete mode 100644 owl-bot-staging/google-cloud-secret_manager-v1/lib/google/cloud/secret_manager/v1/secret_manager_service/paths.rb delete mode 100644 owl-bot-staging/google-cloud-secret_manager-v1/lib/google/cloud/secret_manager/v1/secret_manager_service/rest.rb delete mode 100644 owl-bot-staging/google-cloud-secret_manager-v1/lib/google/cloud/secret_manager/v1/secret_manager_service/rest/client.rb delete mode 100644 owl-bot-staging/google-cloud-secret_manager-v1/lib/google/cloud/secret_manager/v1/secret_manager_service/rest/service_stub.rb delete mode 100644 owl-bot-staging/google-cloud-secret_manager-v1/lib/google/cloud/secret_manager/v1/version.rb delete mode 100644 owl-bot-staging/google-cloud-secret_manager-v1/lib/google/cloud/secretmanager/v1/resources_pb.rb delete mode 100644 owl-bot-staging/google-cloud-secret_manager-v1/lib/google/cloud/secretmanager/v1/service_pb.rb delete mode 100644 owl-bot-staging/google-cloud-secret_manager-v1/lib/google/cloud/secretmanager/v1/service_services_pb.rb delete mode 100644 owl-bot-staging/google-cloud-secret_manager-v1/proto_docs/README.md delete mode 100644 owl-bot-staging/google-cloud-secret_manager-v1/proto_docs/google/api/client.rb delete mode 100644 owl-bot-staging/google-cloud-secret_manager-v1/proto_docs/google/api/field_behavior.rb delete mode 100644 owl-bot-staging/google-cloud-secret_manager-v1/proto_docs/google/api/launch_stage.rb delete mode 100644 owl-bot-staging/google-cloud-secret_manager-v1/proto_docs/google/api/resource.rb delete mode 100644 owl-bot-staging/google-cloud-secret_manager-v1/proto_docs/google/cloud/secretmanager/v1/resources.rb delete mode 100644 owl-bot-staging/google-cloud-secret_manager-v1/proto_docs/google/cloud/secretmanager/v1/service.rb delete mode 100644 owl-bot-staging/google-cloud-secret_manager-v1/proto_docs/google/iam/v1/iam_policy.rb delete mode 100644 owl-bot-staging/google-cloud-secret_manager-v1/proto_docs/google/iam/v1/options.rb delete mode 100644 owl-bot-staging/google-cloud-secret_manager-v1/proto_docs/google/iam/v1/policy.rb delete mode 100644 owl-bot-staging/google-cloud-secret_manager-v1/proto_docs/google/protobuf/duration.rb delete mode 100644 owl-bot-staging/google-cloud-secret_manager-v1/proto_docs/google/protobuf/empty.rb delete mode 100644 owl-bot-staging/google-cloud-secret_manager-v1/proto_docs/google/protobuf/field_mask.rb delete mode 100644 owl-bot-staging/google-cloud-secret_manager-v1/proto_docs/google/protobuf/timestamp.rb delete mode 100644 owl-bot-staging/google-cloud-secret_manager-v1/proto_docs/google/type/expr.rb delete mode 100644 owl-bot-staging/google-cloud-secret_manager-v1/snippets/Gemfile delete mode 100644 owl-bot-staging/google-cloud-secret_manager-v1/snippets/secret_manager_service/access_secret_version.rb delete mode 100644 owl-bot-staging/google-cloud-secret_manager-v1/snippets/secret_manager_service/add_secret_version.rb delete mode 100644 owl-bot-staging/google-cloud-secret_manager-v1/snippets/secret_manager_service/create_secret.rb delete mode 100644 owl-bot-staging/google-cloud-secret_manager-v1/snippets/secret_manager_service/delete_secret.rb delete mode 100644 owl-bot-staging/google-cloud-secret_manager-v1/snippets/secret_manager_service/destroy_secret_version.rb delete mode 100644 owl-bot-staging/google-cloud-secret_manager-v1/snippets/secret_manager_service/disable_secret_version.rb delete mode 100644 owl-bot-staging/google-cloud-secret_manager-v1/snippets/secret_manager_service/enable_secret_version.rb delete mode 100644 owl-bot-staging/google-cloud-secret_manager-v1/snippets/secret_manager_service/get_iam_policy.rb delete mode 100644 owl-bot-staging/google-cloud-secret_manager-v1/snippets/secret_manager_service/get_secret.rb delete mode 100644 owl-bot-staging/google-cloud-secret_manager-v1/snippets/secret_manager_service/get_secret_version.rb delete mode 100644 owl-bot-staging/google-cloud-secret_manager-v1/snippets/secret_manager_service/list_secret_versions.rb delete mode 100644 owl-bot-staging/google-cloud-secret_manager-v1/snippets/secret_manager_service/list_secrets.rb delete mode 100644 owl-bot-staging/google-cloud-secret_manager-v1/snippets/secret_manager_service/set_iam_policy.rb delete mode 100644 owl-bot-staging/google-cloud-secret_manager-v1/snippets/secret_manager_service/test_iam_permissions.rb delete mode 100644 owl-bot-staging/google-cloud-secret_manager-v1/snippets/secret_manager_service/update_secret.rb delete mode 100644 owl-bot-staging/google-cloud-secret_manager-v1/snippets/snippet_metadata_google.cloud.secretmanager.v1.json delete mode 100644 owl-bot-staging/google-cloud-secret_manager-v1/test/google/cloud/secret_manager/v1/secret_manager_service_paths_test.rb delete mode 100644 owl-bot-staging/google-cloud-secret_manager-v1/test/google/cloud/secret_manager/v1/secret_manager_service_rest_test.rb delete mode 100644 owl-bot-staging/google-cloud-secret_manager-v1/test/google/cloud/secret_manager/v1/secret_manager_service_test.rb delete mode 100644 owl-bot-staging/google-cloud-secret_manager-v1/test/helper.rb delete mode 100644 owl-bot-staging/google-cloud-secret_manager-v1beta1/.gitignore delete mode 100644 owl-bot-staging/google-cloud-secret_manager-v1beta1/.repo-metadata.json delete mode 100644 owl-bot-staging/google-cloud-secret_manager-v1beta1/.rubocop.yml delete mode 100644 owl-bot-staging/google-cloud-secret_manager-v1beta1/.toys.rb delete mode 100644 owl-bot-staging/google-cloud-secret_manager-v1beta1/.yardopts delete mode 100644 owl-bot-staging/google-cloud-secret_manager-v1beta1/AUTHENTICATION.md delete mode 100644 owl-bot-staging/google-cloud-secret_manager-v1beta1/CHANGELOG.md delete mode 100644 owl-bot-staging/google-cloud-secret_manager-v1beta1/Gemfile delete mode 100644 owl-bot-staging/google-cloud-secret_manager-v1beta1/LICENSE.md delete mode 100644 owl-bot-staging/google-cloud-secret_manager-v1beta1/README.md delete mode 100644 owl-bot-staging/google-cloud-secret_manager-v1beta1/Rakefile delete mode 100644 owl-bot-staging/google-cloud-secret_manager-v1beta1/gapic_metadata.json delete mode 100644 owl-bot-staging/google-cloud-secret_manager-v1beta1/google-cloud-secret_manager-v1beta1.gemspec delete mode 100644 owl-bot-staging/google-cloud-secret_manager-v1beta1/lib/google-cloud-secret_manager-v1beta1.rb delete mode 100644 owl-bot-staging/google-cloud-secret_manager-v1beta1/lib/google/cloud/secret_manager/v1beta1.rb delete mode 100644 owl-bot-staging/google-cloud-secret_manager-v1beta1/lib/google/cloud/secret_manager/v1beta1/bindings_override.rb delete mode 100644 owl-bot-staging/google-cloud-secret_manager-v1beta1/lib/google/cloud/secret_manager/v1beta1/rest.rb delete mode 100644 owl-bot-staging/google-cloud-secret_manager-v1beta1/lib/google/cloud/secret_manager/v1beta1/secret_manager_service.rb delete mode 100644 owl-bot-staging/google-cloud-secret_manager-v1beta1/lib/google/cloud/secret_manager/v1beta1/secret_manager_service/client.rb delete mode 100644 owl-bot-staging/google-cloud-secret_manager-v1beta1/lib/google/cloud/secret_manager/v1beta1/secret_manager_service/credentials.rb delete mode 100644 owl-bot-staging/google-cloud-secret_manager-v1beta1/lib/google/cloud/secret_manager/v1beta1/secret_manager_service/paths.rb delete mode 100644 owl-bot-staging/google-cloud-secret_manager-v1beta1/lib/google/cloud/secret_manager/v1beta1/secret_manager_service/rest.rb delete mode 100644 owl-bot-staging/google-cloud-secret_manager-v1beta1/lib/google/cloud/secret_manager/v1beta1/secret_manager_service/rest/client.rb delete mode 100644 owl-bot-staging/google-cloud-secret_manager-v1beta1/lib/google/cloud/secret_manager/v1beta1/secret_manager_service/rest/service_stub.rb delete mode 100644 owl-bot-staging/google-cloud-secret_manager-v1beta1/lib/google/cloud/secret_manager/v1beta1/version.rb delete mode 100644 owl-bot-staging/google-cloud-secret_manager-v1beta1/lib/google/cloud/secrets/v1beta1/resources_pb.rb delete mode 100644 owl-bot-staging/google-cloud-secret_manager-v1beta1/lib/google/cloud/secrets/v1beta1/service_pb.rb delete mode 100644 owl-bot-staging/google-cloud-secret_manager-v1beta1/lib/google/cloud/secrets/v1beta1/service_services_pb.rb delete mode 100644 owl-bot-staging/google-cloud-secret_manager-v1beta1/proto_docs/README.md delete mode 100644 owl-bot-staging/google-cloud-secret_manager-v1beta1/proto_docs/google/api/client.rb delete mode 100644 owl-bot-staging/google-cloud-secret_manager-v1beta1/proto_docs/google/api/field_behavior.rb delete mode 100644 owl-bot-staging/google-cloud-secret_manager-v1beta1/proto_docs/google/api/launch_stage.rb delete mode 100644 owl-bot-staging/google-cloud-secret_manager-v1beta1/proto_docs/google/api/resource.rb delete mode 100644 owl-bot-staging/google-cloud-secret_manager-v1beta1/proto_docs/google/cloud/secrets/v1beta1/resources.rb delete mode 100644 owl-bot-staging/google-cloud-secret_manager-v1beta1/proto_docs/google/cloud/secrets/v1beta1/service.rb delete mode 100644 owl-bot-staging/google-cloud-secret_manager-v1beta1/proto_docs/google/iam/v1/iam_policy.rb delete mode 100644 owl-bot-staging/google-cloud-secret_manager-v1beta1/proto_docs/google/iam/v1/options.rb delete mode 100644 owl-bot-staging/google-cloud-secret_manager-v1beta1/proto_docs/google/iam/v1/policy.rb delete mode 100644 owl-bot-staging/google-cloud-secret_manager-v1beta1/proto_docs/google/protobuf/any.rb delete mode 100644 owl-bot-staging/google-cloud-secret_manager-v1beta1/proto_docs/google/protobuf/duration.rb delete mode 100644 owl-bot-staging/google-cloud-secret_manager-v1beta1/proto_docs/google/protobuf/empty.rb delete mode 100644 owl-bot-staging/google-cloud-secret_manager-v1beta1/proto_docs/google/protobuf/field_mask.rb delete mode 100644 owl-bot-staging/google-cloud-secret_manager-v1beta1/proto_docs/google/protobuf/timestamp.rb delete mode 100644 owl-bot-staging/google-cloud-secret_manager-v1beta1/proto_docs/google/type/expr.rb delete mode 100644 owl-bot-staging/google-cloud-secret_manager-v1beta1/snippets/Gemfile delete mode 100644 owl-bot-staging/google-cloud-secret_manager-v1beta1/snippets/secret_manager_service/access_secret_version.rb delete mode 100644 owl-bot-staging/google-cloud-secret_manager-v1beta1/snippets/secret_manager_service/add_secret_version.rb delete mode 100644 owl-bot-staging/google-cloud-secret_manager-v1beta1/snippets/secret_manager_service/create_secret.rb delete mode 100644 owl-bot-staging/google-cloud-secret_manager-v1beta1/snippets/secret_manager_service/delete_secret.rb delete mode 100644 owl-bot-staging/google-cloud-secret_manager-v1beta1/snippets/secret_manager_service/destroy_secret_version.rb delete mode 100644 owl-bot-staging/google-cloud-secret_manager-v1beta1/snippets/secret_manager_service/disable_secret_version.rb delete mode 100644 owl-bot-staging/google-cloud-secret_manager-v1beta1/snippets/secret_manager_service/enable_secret_version.rb delete mode 100644 owl-bot-staging/google-cloud-secret_manager-v1beta1/snippets/secret_manager_service/get_iam_policy.rb delete mode 100644 owl-bot-staging/google-cloud-secret_manager-v1beta1/snippets/secret_manager_service/get_secret.rb delete mode 100644 owl-bot-staging/google-cloud-secret_manager-v1beta1/snippets/secret_manager_service/get_secret_version.rb delete mode 100644 owl-bot-staging/google-cloud-secret_manager-v1beta1/snippets/secret_manager_service/list_secret_versions.rb delete mode 100644 owl-bot-staging/google-cloud-secret_manager-v1beta1/snippets/secret_manager_service/list_secrets.rb delete mode 100644 owl-bot-staging/google-cloud-secret_manager-v1beta1/snippets/secret_manager_service/set_iam_policy.rb delete mode 100644 owl-bot-staging/google-cloud-secret_manager-v1beta1/snippets/secret_manager_service/test_iam_permissions.rb delete mode 100644 owl-bot-staging/google-cloud-secret_manager-v1beta1/snippets/secret_manager_service/update_secret.rb delete mode 100644 owl-bot-staging/google-cloud-secret_manager-v1beta1/snippets/snippet_metadata_google.cloud.secrets.v1beta1.json delete mode 100644 owl-bot-staging/google-cloud-secret_manager-v1beta1/test/google/cloud/secret_manager/v1beta1/secret_manager_service_paths_test.rb delete mode 100644 owl-bot-staging/google-cloud-secret_manager-v1beta1/test/google/cloud/secret_manager/v1beta1/secret_manager_service_rest_test.rb delete mode 100644 owl-bot-staging/google-cloud-secret_manager-v1beta1/test/google/cloud/secret_manager/v1beta1/secret_manager_service_test.rb delete mode 100644 owl-bot-staging/google-cloud-secret_manager-v1beta1/test/helper.rb delete mode 100644 owl-bot-staging/google-cloud-secret_manager-v1beta2/.gitignore delete mode 100644 owl-bot-staging/google-cloud-secret_manager-v1beta2/.repo-metadata.json delete mode 100644 owl-bot-staging/google-cloud-secret_manager-v1beta2/.rubocop.yml delete mode 100644 owl-bot-staging/google-cloud-secret_manager-v1beta2/.toys.rb delete mode 100644 owl-bot-staging/google-cloud-secret_manager-v1beta2/.yardopts delete mode 100644 owl-bot-staging/google-cloud-secret_manager-v1beta2/AUTHENTICATION.md delete mode 100644 owl-bot-staging/google-cloud-secret_manager-v1beta2/CHANGELOG.md delete mode 100644 owl-bot-staging/google-cloud-secret_manager-v1beta2/Gemfile delete mode 100644 owl-bot-staging/google-cloud-secret_manager-v1beta2/LICENSE.md delete mode 100644 owl-bot-staging/google-cloud-secret_manager-v1beta2/README.md delete mode 100644 owl-bot-staging/google-cloud-secret_manager-v1beta2/Rakefile delete mode 100644 owl-bot-staging/google-cloud-secret_manager-v1beta2/gapic_metadata.json delete mode 100644 owl-bot-staging/google-cloud-secret_manager-v1beta2/google-cloud-secret_manager-v1beta2.gemspec delete mode 100644 owl-bot-staging/google-cloud-secret_manager-v1beta2/lib/google-cloud-secret_manager-v1beta2.rb delete mode 100644 owl-bot-staging/google-cloud-secret_manager-v1beta2/lib/google/cloud/secret_manager/v1beta2.rb delete mode 100644 owl-bot-staging/google-cloud-secret_manager-v1beta2/lib/google/cloud/secret_manager/v1beta2/bindings_override.rb delete mode 100644 owl-bot-staging/google-cloud-secret_manager-v1beta2/lib/google/cloud/secret_manager/v1beta2/rest.rb delete mode 100644 owl-bot-staging/google-cloud-secret_manager-v1beta2/lib/google/cloud/secret_manager/v1beta2/secret_manager_service.rb delete mode 100644 owl-bot-staging/google-cloud-secret_manager-v1beta2/lib/google/cloud/secret_manager/v1beta2/secret_manager_service/client.rb delete mode 100644 owl-bot-staging/google-cloud-secret_manager-v1beta2/lib/google/cloud/secret_manager/v1beta2/secret_manager_service/credentials.rb delete mode 100644 owl-bot-staging/google-cloud-secret_manager-v1beta2/lib/google/cloud/secret_manager/v1beta2/secret_manager_service/paths.rb delete mode 100644 owl-bot-staging/google-cloud-secret_manager-v1beta2/lib/google/cloud/secret_manager/v1beta2/secret_manager_service/rest.rb delete mode 100644 owl-bot-staging/google-cloud-secret_manager-v1beta2/lib/google/cloud/secret_manager/v1beta2/secret_manager_service/rest/client.rb delete mode 100644 owl-bot-staging/google-cloud-secret_manager-v1beta2/lib/google/cloud/secret_manager/v1beta2/secret_manager_service/rest/service_stub.rb delete mode 100644 owl-bot-staging/google-cloud-secret_manager-v1beta2/lib/google/cloud/secret_manager/v1beta2/version.rb delete mode 100644 owl-bot-staging/google-cloud-secret_manager-v1beta2/lib/google/cloud/secretmanager/v1beta2/resources_pb.rb delete mode 100644 owl-bot-staging/google-cloud-secret_manager-v1beta2/lib/google/cloud/secretmanager/v1beta2/service_pb.rb delete mode 100644 owl-bot-staging/google-cloud-secret_manager-v1beta2/lib/google/cloud/secretmanager/v1beta2/service_services_pb.rb delete mode 100644 owl-bot-staging/google-cloud-secret_manager-v1beta2/proto_docs/README.md delete mode 100644 owl-bot-staging/google-cloud-secret_manager-v1beta2/proto_docs/google/api/client.rb delete mode 100644 owl-bot-staging/google-cloud-secret_manager-v1beta2/proto_docs/google/api/field_behavior.rb delete mode 100644 owl-bot-staging/google-cloud-secret_manager-v1beta2/proto_docs/google/api/launch_stage.rb delete mode 100644 owl-bot-staging/google-cloud-secret_manager-v1beta2/proto_docs/google/api/resource.rb delete mode 100644 owl-bot-staging/google-cloud-secret_manager-v1beta2/proto_docs/google/cloud/secretmanager/v1beta2/resources.rb delete mode 100644 owl-bot-staging/google-cloud-secret_manager-v1beta2/proto_docs/google/cloud/secretmanager/v1beta2/service.rb delete mode 100644 owl-bot-staging/google-cloud-secret_manager-v1beta2/proto_docs/google/iam/v1/iam_policy.rb delete mode 100644 owl-bot-staging/google-cloud-secret_manager-v1beta2/proto_docs/google/iam/v1/options.rb delete mode 100644 owl-bot-staging/google-cloud-secret_manager-v1beta2/proto_docs/google/iam/v1/policy.rb delete mode 100644 owl-bot-staging/google-cloud-secret_manager-v1beta2/proto_docs/google/protobuf/any.rb delete mode 100644 owl-bot-staging/google-cloud-secret_manager-v1beta2/proto_docs/google/protobuf/duration.rb delete mode 100644 owl-bot-staging/google-cloud-secret_manager-v1beta2/proto_docs/google/protobuf/empty.rb delete mode 100644 owl-bot-staging/google-cloud-secret_manager-v1beta2/proto_docs/google/protobuf/field_mask.rb delete mode 100644 owl-bot-staging/google-cloud-secret_manager-v1beta2/proto_docs/google/protobuf/timestamp.rb delete mode 100644 owl-bot-staging/google-cloud-secret_manager-v1beta2/proto_docs/google/type/expr.rb delete mode 100644 owl-bot-staging/google-cloud-secret_manager-v1beta2/snippets/Gemfile delete mode 100644 owl-bot-staging/google-cloud-secret_manager-v1beta2/snippets/secret_manager_service/access_secret_version.rb delete mode 100644 owl-bot-staging/google-cloud-secret_manager-v1beta2/snippets/secret_manager_service/add_secret_version.rb delete mode 100644 owl-bot-staging/google-cloud-secret_manager-v1beta2/snippets/secret_manager_service/create_secret.rb delete mode 100644 owl-bot-staging/google-cloud-secret_manager-v1beta2/snippets/secret_manager_service/delete_secret.rb delete mode 100644 owl-bot-staging/google-cloud-secret_manager-v1beta2/snippets/secret_manager_service/destroy_secret_version.rb delete mode 100644 owl-bot-staging/google-cloud-secret_manager-v1beta2/snippets/secret_manager_service/disable_secret_version.rb delete mode 100644 owl-bot-staging/google-cloud-secret_manager-v1beta2/snippets/secret_manager_service/enable_secret_version.rb delete mode 100644 owl-bot-staging/google-cloud-secret_manager-v1beta2/snippets/secret_manager_service/get_iam_policy.rb delete mode 100644 owl-bot-staging/google-cloud-secret_manager-v1beta2/snippets/secret_manager_service/get_secret.rb delete mode 100644 owl-bot-staging/google-cloud-secret_manager-v1beta2/snippets/secret_manager_service/get_secret_version.rb delete mode 100644 owl-bot-staging/google-cloud-secret_manager-v1beta2/snippets/secret_manager_service/list_secret_versions.rb delete mode 100644 owl-bot-staging/google-cloud-secret_manager-v1beta2/snippets/secret_manager_service/list_secrets.rb delete mode 100644 owl-bot-staging/google-cloud-secret_manager-v1beta2/snippets/secret_manager_service/set_iam_policy.rb delete mode 100644 owl-bot-staging/google-cloud-secret_manager-v1beta2/snippets/secret_manager_service/test_iam_permissions.rb delete mode 100644 owl-bot-staging/google-cloud-secret_manager-v1beta2/snippets/secret_manager_service/update_secret.rb delete mode 100644 owl-bot-staging/google-cloud-secret_manager-v1beta2/snippets/snippet_metadata_google.cloud.secretmanager.v1beta2.json delete mode 100644 owl-bot-staging/google-cloud-secret_manager-v1beta2/test/google/cloud/secret_manager/v1beta2/secret_manager_service_paths_test.rb delete mode 100644 owl-bot-staging/google-cloud-secret_manager-v1beta2/test/google/cloud/secret_manager/v1beta2/secret_manager_service_rest_test.rb delete mode 100644 owl-bot-staging/google-cloud-secret_manager-v1beta2/test/google/cloud/secret_manager/v1beta2/secret_manager_service_test.rb delete mode 100644 owl-bot-staging/google-cloud-secret_manager-v1beta2/test/helper.rb delete mode 100644 owl-bot-staging/google-cloud-secure_source_manager-v1/.gitignore delete mode 100644 owl-bot-staging/google-cloud-secure_source_manager-v1/.repo-metadata.json delete mode 100644 owl-bot-staging/google-cloud-secure_source_manager-v1/.rubocop.yml delete mode 100644 owl-bot-staging/google-cloud-secure_source_manager-v1/.toys.rb delete mode 100644 owl-bot-staging/google-cloud-secure_source_manager-v1/.yardopts delete mode 100644 owl-bot-staging/google-cloud-secure_source_manager-v1/AUTHENTICATION.md delete mode 100644 owl-bot-staging/google-cloud-secure_source_manager-v1/CHANGELOG.md delete mode 100644 owl-bot-staging/google-cloud-secure_source_manager-v1/Gemfile delete mode 100644 owl-bot-staging/google-cloud-secure_source_manager-v1/LICENSE.md delete mode 100644 owl-bot-staging/google-cloud-secure_source_manager-v1/README.md delete mode 100644 owl-bot-staging/google-cloud-secure_source_manager-v1/Rakefile delete mode 100644 owl-bot-staging/google-cloud-secure_source_manager-v1/gapic_metadata.json delete mode 100644 owl-bot-staging/google-cloud-secure_source_manager-v1/google-cloud-secure_source_manager-v1.gemspec delete mode 100644 owl-bot-staging/google-cloud-secure_source_manager-v1/lib/google-cloud-secure_source_manager-v1.rb delete mode 100644 owl-bot-staging/google-cloud-secure_source_manager-v1/lib/google/cloud/secure_source_manager/v1.rb delete mode 100644 owl-bot-staging/google-cloud-secure_source_manager-v1/lib/google/cloud/secure_source_manager/v1/bindings_override.rb delete mode 100644 owl-bot-staging/google-cloud-secure_source_manager-v1/lib/google/cloud/secure_source_manager/v1/rest.rb delete mode 100644 owl-bot-staging/google-cloud-secure_source_manager-v1/lib/google/cloud/secure_source_manager/v1/secure_source_manager.rb delete mode 100644 owl-bot-staging/google-cloud-secure_source_manager-v1/lib/google/cloud/secure_source_manager/v1/secure_source_manager/client.rb delete mode 100644 owl-bot-staging/google-cloud-secure_source_manager-v1/lib/google/cloud/secure_source_manager/v1/secure_source_manager/credentials.rb delete mode 100644 owl-bot-staging/google-cloud-secure_source_manager-v1/lib/google/cloud/secure_source_manager/v1/secure_source_manager/operations.rb delete mode 100644 owl-bot-staging/google-cloud-secure_source_manager-v1/lib/google/cloud/secure_source_manager/v1/secure_source_manager/paths.rb delete mode 100644 owl-bot-staging/google-cloud-secure_source_manager-v1/lib/google/cloud/secure_source_manager/v1/secure_source_manager/rest.rb delete mode 100644 owl-bot-staging/google-cloud-secure_source_manager-v1/lib/google/cloud/secure_source_manager/v1/secure_source_manager/rest/client.rb delete mode 100644 owl-bot-staging/google-cloud-secure_source_manager-v1/lib/google/cloud/secure_source_manager/v1/secure_source_manager/rest/operations.rb delete mode 100644 owl-bot-staging/google-cloud-secure_source_manager-v1/lib/google/cloud/secure_source_manager/v1/secure_source_manager/rest/service_stub.rb delete mode 100644 owl-bot-staging/google-cloud-secure_source_manager-v1/lib/google/cloud/secure_source_manager/v1/version.rb delete mode 100644 owl-bot-staging/google-cloud-secure_source_manager-v1/lib/google/cloud/securesourcemanager/v1/secure_source_manager_pb.rb delete mode 100644 owl-bot-staging/google-cloud-secure_source_manager-v1/lib/google/cloud/securesourcemanager/v1/secure_source_manager_services_pb.rb delete mode 100644 owl-bot-staging/google-cloud-secure_source_manager-v1/proto_docs/README.md delete mode 100644 owl-bot-staging/google-cloud-secure_source_manager-v1/proto_docs/google/api/client.rb delete mode 100644 owl-bot-staging/google-cloud-secure_source_manager-v1/proto_docs/google/api/field_behavior.rb delete mode 100644 owl-bot-staging/google-cloud-secure_source_manager-v1/proto_docs/google/api/launch_stage.rb delete mode 100644 owl-bot-staging/google-cloud-secure_source_manager-v1/proto_docs/google/api/resource.rb delete mode 100644 owl-bot-staging/google-cloud-secure_source_manager-v1/proto_docs/google/cloud/securesourcemanager/v1/secure_source_manager.rb delete mode 100644 owl-bot-staging/google-cloud-secure_source_manager-v1/proto_docs/google/longrunning/operations.rb delete mode 100644 owl-bot-staging/google-cloud-secure_source_manager-v1/proto_docs/google/protobuf/any.rb delete mode 100644 owl-bot-staging/google-cloud-secure_source_manager-v1/proto_docs/google/protobuf/duration.rb delete mode 100644 owl-bot-staging/google-cloud-secure_source_manager-v1/proto_docs/google/protobuf/empty.rb delete mode 100644 owl-bot-staging/google-cloud-secure_source_manager-v1/proto_docs/google/protobuf/field_mask.rb delete mode 100644 owl-bot-staging/google-cloud-secure_source_manager-v1/proto_docs/google/protobuf/timestamp.rb delete mode 100644 owl-bot-staging/google-cloud-secure_source_manager-v1/proto_docs/google/rpc/status.rb delete mode 100644 owl-bot-staging/google-cloud-secure_source_manager-v1/proto_docs/google/type/expr.rb delete mode 100644 owl-bot-staging/google-cloud-secure_source_manager-v1/snippets/Gemfile delete mode 100644 owl-bot-staging/google-cloud-secure_source_manager-v1/snippets/secure_source_manager/batch_create_pull_request_comments.rb delete mode 100644 owl-bot-staging/google-cloud-secure_source_manager-v1/snippets/secure_source_manager/close_issue.rb delete mode 100644 owl-bot-staging/google-cloud-secure_source_manager-v1/snippets/secure_source_manager/close_pull_request.rb delete mode 100644 owl-bot-staging/google-cloud-secure_source_manager-v1/snippets/secure_source_manager/create_branch_rule.rb delete mode 100644 owl-bot-staging/google-cloud-secure_source_manager-v1/snippets/secure_source_manager/create_hook.rb delete mode 100644 owl-bot-staging/google-cloud-secure_source_manager-v1/snippets/secure_source_manager/create_instance.rb delete mode 100644 owl-bot-staging/google-cloud-secure_source_manager-v1/snippets/secure_source_manager/create_issue.rb delete mode 100644 owl-bot-staging/google-cloud-secure_source_manager-v1/snippets/secure_source_manager/create_issue_comment.rb delete mode 100644 owl-bot-staging/google-cloud-secure_source_manager-v1/snippets/secure_source_manager/create_pull_request.rb delete mode 100644 owl-bot-staging/google-cloud-secure_source_manager-v1/snippets/secure_source_manager/create_pull_request_comment.rb delete mode 100644 owl-bot-staging/google-cloud-secure_source_manager-v1/snippets/secure_source_manager/create_repository.rb delete mode 100644 owl-bot-staging/google-cloud-secure_source_manager-v1/snippets/secure_source_manager/delete_branch_rule.rb delete mode 100644 owl-bot-staging/google-cloud-secure_source_manager-v1/snippets/secure_source_manager/delete_hook.rb delete mode 100644 owl-bot-staging/google-cloud-secure_source_manager-v1/snippets/secure_source_manager/delete_instance.rb delete mode 100644 owl-bot-staging/google-cloud-secure_source_manager-v1/snippets/secure_source_manager/delete_issue.rb delete mode 100644 owl-bot-staging/google-cloud-secure_source_manager-v1/snippets/secure_source_manager/delete_issue_comment.rb delete mode 100644 owl-bot-staging/google-cloud-secure_source_manager-v1/snippets/secure_source_manager/delete_pull_request_comment.rb delete mode 100644 owl-bot-staging/google-cloud-secure_source_manager-v1/snippets/secure_source_manager/delete_repository.rb delete mode 100644 owl-bot-staging/google-cloud-secure_source_manager-v1/snippets/secure_source_manager/fetch_blob.rb delete mode 100644 owl-bot-staging/google-cloud-secure_source_manager-v1/snippets/secure_source_manager/fetch_tree.rb delete mode 100644 owl-bot-staging/google-cloud-secure_source_manager-v1/snippets/secure_source_manager/get_branch_rule.rb delete mode 100644 owl-bot-staging/google-cloud-secure_source_manager-v1/snippets/secure_source_manager/get_hook.rb delete mode 100644 owl-bot-staging/google-cloud-secure_source_manager-v1/snippets/secure_source_manager/get_iam_policy_repo.rb delete mode 100644 owl-bot-staging/google-cloud-secure_source_manager-v1/snippets/secure_source_manager/get_instance.rb delete mode 100644 owl-bot-staging/google-cloud-secure_source_manager-v1/snippets/secure_source_manager/get_issue.rb delete mode 100644 owl-bot-staging/google-cloud-secure_source_manager-v1/snippets/secure_source_manager/get_issue_comment.rb delete mode 100644 owl-bot-staging/google-cloud-secure_source_manager-v1/snippets/secure_source_manager/get_pull_request.rb delete mode 100644 owl-bot-staging/google-cloud-secure_source_manager-v1/snippets/secure_source_manager/get_pull_request_comment.rb delete mode 100644 owl-bot-staging/google-cloud-secure_source_manager-v1/snippets/secure_source_manager/get_repository.rb delete mode 100644 owl-bot-staging/google-cloud-secure_source_manager-v1/snippets/secure_source_manager/list_branch_rules.rb delete mode 100644 owl-bot-staging/google-cloud-secure_source_manager-v1/snippets/secure_source_manager/list_hooks.rb delete mode 100644 owl-bot-staging/google-cloud-secure_source_manager-v1/snippets/secure_source_manager/list_instances.rb delete mode 100644 owl-bot-staging/google-cloud-secure_source_manager-v1/snippets/secure_source_manager/list_issue_comments.rb delete mode 100644 owl-bot-staging/google-cloud-secure_source_manager-v1/snippets/secure_source_manager/list_issues.rb delete mode 100644 owl-bot-staging/google-cloud-secure_source_manager-v1/snippets/secure_source_manager/list_pull_request_comments.rb delete mode 100644 owl-bot-staging/google-cloud-secure_source_manager-v1/snippets/secure_source_manager/list_pull_request_file_diffs.rb delete mode 100644 owl-bot-staging/google-cloud-secure_source_manager-v1/snippets/secure_source_manager/list_pull_requests.rb delete mode 100644 owl-bot-staging/google-cloud-secure_source_manager-v1/snippets/secure_source_manager/list_repositories.rb delete mode 100644 owl-bot-staging/google-cloud-secure_source_manager-v1/snippets/secure_source_manager/merge_pull_request.rb delete mode 100644 owl-bot-staging/google-cloud-secure_source_manager-v1/snippets/secure_source_manager/open_issue.rb delete mode 100644 owl-bot-staging/google-cloud-secure_source_manager-v1/snippets/secure_source_manager/open_pull_request.rb delete mode 100644 owl-bot-staging/google-cloud-secure_source_manager-v1/snippets/secure_source_manager/resolve_pull_request_comments.rb delete mode 100644 owl-bot-staging/google-cloud-secure_source_manager-v1/snippets/secure_source_manager/set_iam_policy_repo.rb delete mode 100644 owl-bot-staging/google-cloud-secure_source_manager-v1/snippets/secure_source_manager/test_iam_permissions_repo.rb delete mode 100644 owl-bot-staging/google-cloud-secure_source_manager-v1/snippets/secure_source_manager/unresolve_pull_request_comments.rb delete mode 100644 owl-bot-staging/google-cloud-secure_source_manager-v1/snippets/secure_source_manager/update_branch_rule.rb delete mode 100644 owl-bot-staging/google-cloud-secure_source_manager-v1/snippets/secure_source_manager/update_hook.rb delete mode 100644 owl-bot-staging/google-cloud-secure_source_manager-v1/snippets/secure_source_manager/update_issue.rb delete mode 100644 owl-bot-staging/google-cloud-secure_source_manager-v1/snippets/secure_source_manager/update_issue_comment.rb delete mode 100644 owl-bot-staging/google-cloud-secure_source_manager-v1/snippets/secure_source_manager/update_pull_request.rb delete mode 100644 owl-bot-staging/google-cloud-secure_source_manager-v1/snippets/secure_source_manager/update_pull_request_comment.rb delete mode 100644 owl-bot-staging/google-cloud-secure_source_manager-v1/snippets/secure_source_manager/update_repository.rb delete mode 100644 owl-bot-staging/google-cloud-secure_source_manager-v1/snippets/snippet_metadata_google.cloud.securesourcemanager.v1.json delete mode 100644 owl-bot-staging/google-cloud-secure_source_manager-v1/test/google/cloud/secure_source_manager/v1/secure_source_manager_operations_test.rb delete mode 100644 owl-bot-staging/google-cloud-secure_source_manager-v1/test/google/cloud/secure_source_manager/v1/secure_source_manager_paths_test.rb delete mode 100644 owl-bot-staging/google-cloud-secure_source_manager-v1/test/google/cloud/secure_source_manager/v1/secure_source_manager_rest_test.rb delete mode 100644 owl-bot-staging/google-cloud-secure_source_manager-v1/test/google/cloud/secure_source_manager/v1/secure_source_manager_test.rb delete mode 100644 owl-bot-staging/google-cloud-secure_source_manager-v1/test/helper.rb delete mode 100644 owl-bot-staging/google-cloud-security-private_ca-v1/.gitignore delete mode 100644 owl-bot-staging/google-cloud-security-private_ca-v1/.repo-metadata.json delete mode 100644 owl-bot-staging/google-cloud-security-private_ca-v1/.rubocop.yml delete mode 100644 owl-bot-staging/google-cloud-security-private_ca-v1/.toys.rb delete mode 100644 owl-bot-staging/google-cloud-security-private_ca-v1/.yardopts delete mode 100644 owl-bot-staging/google-cloud-security-private_ca-v1/AUTHENTICATION.md delete mode 100644 owl-bot-staging/google-cloud-security-private_ca-v1/CHANGELOG.md delete mode 100644 owl-bot-staging/google-cloud-security-private_ca-v1/Gemfile delete mode 100644 owl-bot-staging/google-cloud-security-private_ca-v1/LICENSE.md delete mode 100644 owl-bot-staging/google-cloud-security-private_ca-v1/README.md delete mode 100644 owl-bot-staging/google-cloud-security-private_ca-v1/Rakefile delete mode 100644 owl-bot-staging/google-cloud-security-private_ca-v1/gapic_metadata.json delete mode 100644 owl-bot-staging/google-cloud-security-private_ca-v1/google-cloud-security-private_ca-v1.gemspec delete mode 100644 owl-bot-staging/google-cloud-security-private_ca-v1/lib/google-cloud-security-private_ca-v1.rb delete mode 100644 owl-bot-staging/google-cloud-security-private_ca-v1/lib/google/cloud/security/private_ca/v1.rb delete mode 100644 owl-bot-staging/google-cloud-security-private_ca-v1/lib/google/cloud/security/private_ca/v1/bindings_override.rb delete mode 100644 owl-bot-staging/google-cloud-security-private_ca-v1/lib/google/cloud/security/private_ca/v1/certificate_authority_service.rb delete mode 100644 owl-bot-staging/google-cloud-security-private_ca-v1/lib/google/cloud/security/private_ca/v1/certificate_authority_service/client.rb delete mode 100644 owl-bot-staging/google-cloud-security-private_ca-v1/lib/google/cloud/security/private_ca/v1/certificate_authority_service/credentials.rb delete mode 100644 owl-bot-staging/google-cloud-security-private_ca-v1/lib/google/cloud/security/private_ca/v1/certificate_authority_service/operations.rb delete mode 100644 owl-bot-staging/google-cloud-security-private_ca-v1/lib/google/cloud/security/private_ca/v1/certificate_authority_service/paths.rb delete mode 100644 owl-bot-staging/google-cloud-security-private_ca-v1/lib/google/cloud/security/private_ca/v1/certificate_authority_service/rest.rb delete mode 100644 owl-bot-staging/google-cloud-security-private_ca-v1/lib/google/cloud/security/private_ca/v1/certificate_authority_service/rest/client.rb delete mode 100644 owl-bot-staging/google-cloud-security-private_ca-v1/lib/google/cloud/security/private_ca/v1/certificate_authority_service/rest/operations.rb delete mode 100644 owl-bot-staging/google-cloud-security-private_ca-v1/lib/google/cloud/security/private_ca/v1/certificate_authority_service/rest/service_stub.rb delete mode 100644 owl-bot-staging/google-cloud-security-private_ca-v1/lib/google/cloud/security/private_ca/v1/rest.rb delete mode 100644 owl-bot-staging/google-cloud-security-private_ca-v1/lib/google/cloud/security/private_ca/v1/version.rb delete mode 100644 owl-bot-staging/google-cloud-security-private_ca-v1/lib/google/cloud/security/privateca/v1/resources_pb.rb delete mode 100644 owl-bot-staging/google-cloud-security-private_ca-v1/lib/google/cloud/security/privateca/v1/service_pb.rb delete mode 100644 owl-bot-staging/google-cloud-security-private_ca-v1/lib/google/cloud/security/privateca/v1/service_services_pb.rb delete mode 100644 owl-bot-staging/google-cloud-security-private_ca-v1/proto_docs/README.md delete mode 100644 owl-bot-staging/google-cloud-security-private_ca-v1/proto_docs/google/api/client.rb delete mode 100644 owl-bot-staging/google-cloud-security-private_ca-v1/proto_docs/google/api/field_behavior.rb delete mode 100644 owl-bot-staging/google-cloud-security-private_ca-v1/proto_docs/google/api/field_info.rb delete mode 100644 owl-bot-staging/google-cloud-security-private_ca-v1/proto_docs/google/api/launch_stage.rb delete mode 100644 owl-bot-staging/google-cloud-security-private_ca-v1/proto_docs/google/api/resource.rb delete mode 100644 owl-bot-staging/google-cloud-security-private_ca-v1/proto_docs/google/cloud/security/privateca/v1/resources.rb delete mode 100644 owl-bot-staging/google-cloud-security-private_ca-v1/proto_docs/google/cloud/security/privateca/v1/service.rb delete mode 100644 owl-bot-staging/google-cloud-security-private_ca-v1/proto_docs/google/longrunning/operations.rb delete mode 100644 owl-bot-staging/google-cloud-security-private_ca-v1/proto_docs/google/protobuf/any.rb delete mode 100644 owl-bot-staging/google-cloud-security-private_ca-v1/proto_docs/google/protobuf/duration.rb delete mode 100644 owl-bot-staging/google-cloud-security-private_ca-v1/proto_docs/google/protobuf/empty.rb delete mode 100644 owl-bot-staging/google-cloud-security-private_ca-v1/proto_docs/google/protobuf/field_mask.rb delete mode 100644 owl-bot-staging/google-cloud-security-private_ca-v1/proto_docs/google/protobuf/timestamp.rb delete mode 100644 owl-bot-staging/google-cloud-security-private_ca-v1/proto_docs/google/rpc/status.rb delete mode 100644 owl-bot-staging/google-cloud-security-private_ca-v1/proto_docs/google/type/expr.rb delete mode 100644 owl-bot-staging/google-cloud-security-private_ca-v1/snippets/Gemfile delete mode 100644 owl-bot-staging/google-cloud-security-private_ca-v1/snippets/certificate_authority_service/activate_certificate_authority.rb delete mode 100644 owl-bot-staging/google-cloud-security-private_ca-v1/snippets/certificate_authority_service/create_ca_pool.rb delete mode 100644 owl-bot-staging/google-cloud-security-private_ca-v1/snippets/certificate_authority_service/create_certificate.rb delete mode 100644 owl-bot-staging/google-cloud-security-private_ca-v1/snippets/certificate_authority_service/create_certificate_authority.rb delete mode 100644 owl-bot-staging/google-cloud-security-private_ca-v1/snippets/certificate_authority_service/create_certificate_template.rb delete mode 100644 owl-bot-staging/google-cloud-security-private_ca-v1/snippets/certificate_authority_service/delete_ca_pool.rb delete mode 100644 owl-bot-staging/google-cloud-security-private_ca-v1/snippets/certificate_authority_service/delete_certificate_authority.rb delete mode 100644 owl-bot-staging/google-cloud-security-private_ca-v1/snippets/certificate_authority_service/delete_certificate_template.rb delete mode 100644 owl-bot-staging/google-cloud-security-private_ca-v1/snippets/certificate_authority_service/disable_certificate_authority.rb delete mode 100644 owl-bot-staging/google-cloud-security-private_ca-v1/snippets/certificate_authority_service/enable_certificate_authority.rb delete mode 100644 owl-bot-staging/google-cloud-security-private_ca-v1/snippets/certificate_authority_service/fetch_ca_certs.rb delete mode 100644 owl-bot-staging/google-cloud-security-private_ca-v1/snippets/certificate_authority_service/fetch_certificate_authority_csr.rb delete mode 100644 owl-bot-staging/google-cloud-security-private_ca-v1/snippets/certificate_authority_service/get_ca_pool.rb delete mode 100644 owl-bot-staging/google-cloud-security-private_ca-v1/snippets/certificate_authority_service/get_certificate.rb delete mode 100644 owl-bot-staging/google-cloud-security-private_ca-v1/snippets/certificate_authority_service/get_certificate_authority.rb delete mode 100644 owl-bot-staging/google-cloud-security-private_ca-v1/snippets/certificate_authority_service/get_certificate_revocation_list.rb delete mode 100644 owl-bot-staging/google-cloud-security-private_ca-v1/snippets/certificate_authority_service/get_certificate_template.rb delete mode 100644 owl-bot-staging/google-cloud-security-private_ca-v1/snippets/certificate_authority_service/list_ca_pools.rb delete mode 100644 owl-bot-staging/google-cloud-security-private_ca-v1/snippets/certificate_authority_service/list_certificate_authorities.rb delete mode 100644 owl-bot-staging/google-cloud-security-private_ca-v1/snippets/certificate_authority_service/list_certificate_revocation_lists.rb delete mode 100644 owl-bot-staging/google-cloud-security-private_ca-v1/snippets/certificate_authority_service/list_certificate_templates.rb delete mode 100644 owl-bot-staging/google-cloud-security-private_ca-v1/snippets/certificate_authority_service/list_certificates.rb delete mode 100644 owl-bot-staging/google-cloud-security-private_ca-v1/snippets/certificate_authority_service/revoke_certificate.rb delete mode 100644 owl-bot-staging/google-cloud-security-private_ca-v1/snippets/certificate_authority_service/undelete_certificate_authority.rb delete mode 100644 owl-bot-staging/google-cloud-security-private_ca-v1/snippets/certificate_authority_service/update_ca_pool.rb delete mode 100644 owl-bot-staging/google-cloud-security-private_ca-v1/snippets/certificate_authority_service/update_certificate.rb delete mode 100644 owl-bot-staging/google-cloud-security-private_ca-v1/snippets/certificate_authority_service/update_certificate_authority.rb delete mode 100644 owl-bot-staging/google-cloud-security-private_ca-v1/snippets/certificate_authority_service/update_certificate_revocation_list.rb delete mode 100644 owl-bot-staging/google-cloud-security-private_ca-v1/snippets/certificate_authority_service/update_certificate_template.rb delete mode 100644 owl-bot-staging/google-cloud-security-private_ca-v1/snippets/snippet_metadata_google.cloud.security.privateca.v1.json delete mode 100644 owl-bot-staging/google-cloud-security-private_ca-v1/test/google/cloud/security/private_ca/v1/certificate_authority_service_operations_test.rb delete mode 100644 owl-bot-staging/google-cloud-security-private_ca-v1/test/google/cloud/security/private_ca/v1/certificate_authority_service_paths_test.rb delete mode 100644 owl-bot-staging/google-cloud-security-private_ca-v1/test/google/cloud/security/private_ca/v1/certificate_authority_service_rest_test.rb delete mode 100644 owl-bot-staging/google-cloud-security-private_ca-v1/test/google/cloud/security/private_ca/v1/certificate_authority_service_test.rb delete mode 100644 owl-bot-staging/google-cloud-security-private_ca-v1/test/helper.rb delete mode 100644 owl-bot-staging/google-cloud-security-private_ca-v1beta1/.gitignore delete mode 100644 owl-bot-staging/google-cloud-security-private_ca-v1beta1/.repo-metadata.json delete mode 100644 owl-bot-staging/google-cloud-security-private_ca-v1beta1/.rubocop.yml delete mode 100644 owl-bot-staging/google-cloud-security-private_ca-v1beta1/.toys.rb delete mode 100644 owl-bot-staging/google-cloud-security-private_ca-v1beta1/.yardopts delete mode 100644 owl-bot-staging/google-cloud-security-private_ca-v1beta1/AUTHENTICATION.md delete mode 100644 owl-bot-staging/google-cloud-security-private_ca-v1beta1/CHANGELOG.md delete mode 100644 owl-bot-staging/google-cloud-security-private_ca-v1beta1/Gemfile delete mode 100644 owl-bot-staging/google-cloud-security-private_ca-v1beta1/LICENSE.md delete mode 100644 owl-bot-staging/google-cloud-security-private_ca-v1beta1/README.md delete mode 100644 owl-bot-staging/google-cloud-security-private_ca-v1beta1/Rakefile delete mode 100644 owl-bot-staging/google-cloud-security-private_ca-v1beta1/gapic_metadata.json delete mode 100644 owl-bot-staging/google-cloud-security-private_ca-v1beta1/google-cloud-security-private_ca-v1beta1.gemspec delete mode 100644 owl-bot-staging/google-cloud-security-private_ca-v1beta1/lib/google-cloud-security-private_ca-v1beta1.rb delete mode 100644 owl-bot-staging/google-cloud-security-private_ca-v1beta1/lib/google/cloud/security/private_ca/v1beta1.rb delete mode 100644 owl-bot-staging/google-cloud-security-private_ca-v1beta1/lib/google/cloud/security/private_ca/v1beta1/certificate_authority_service.rb delete mode 100644 owl-bot-staging/google-cloud-security-private_ca-v1beta1/lib/google/cloud/security/private_ca/v1beta1/certificate_authority_service/client.rb delete mode 100644 owl-bot-staging/google-cloud-security-private_ca-v1beta1/lib/google/cloud/security/private_ca/v1beta1/certificate_authority_service/credentials.rb delete mode 100644 owl-bot-staging/google-cloud-security-private_ca-v1beta1/lib/google/cloud/security/private_ca/v1beta1/certificate_authority_service/operations.rb delete mode 100644 owl-bot-staging/google-cloud-security-private_ca-v1beta1/lib/google/cloud/security/private_ca/v1beta1/certificate_authority_service/paths.rb delete mode 100644 owl-bot-staging/google-cloud-security-private_ca-v1beta1/lib/google/cloud/security/private_ca/v1beta1/certificate_authority_service/rest.rb delete mode 100644 owl-bot-staging/google-cloud-security-private_ca-v1beta1/lib/google/cloud/security/private_ca/v1beta1/certificate_authority_service/rest/client.rb delete mode 100644 owl-bot-staging/google-cloud-security-private_ca-v1beta1/lib/google/cloud/security/private_ca/v1beta1/certificate_authority_service/rest/operations.rb delete mode 100644 owl-bot-staging/google-cloud-security-private_ca-v1beta1/lib/google/cloud/security/private_ca/v1beta1/certificate_authority_service/rest/service_stub.rb delete mode 100644 owl-bot-staging/google-cloud-security-private_ca-v1beta1/lib/google/cloud/security/private_ca/v1beta1/rest.rb delete mode 100644 owl-bot-staging/google-cloud-security-private_ca-v1beta1/lib/google/cloud/security/private_ca/v1beta1/version.rb delete mode 100644 owl-bot-staging/google-cloud-security-private_ca-v1beta1/lib/google/cloud/security/privateca/v1beta1/resources_pb.rb delete mode 100644 owl-bot-staging/google-cloud-security-private_ca-v1beta1/lib/google/cloud/security/privateca/v1beta1/service_pb.rb delete mode 100644 owl-bot-staging/google-cloud-security-private_ca-v1beta1/lib/google/cloud/security/privateca/v1beta1/service_services_pb.rb delete mode 100644 owl-bot-staging/google-cloud-security-private_ca-v1beta1/proto_docs/README.md delete mode 100644 owl-bot-staging/google-cloud-security-private_ca-v1beta1/proto_docs/google/api/client.rb delete mode 100644 owl-bot-staging/google-cloud-security-private_ca-v1beta1/proto_docs/google/api/field_behavior.rb delete mode 100644 owl-bot-staging/google-cloud-security-private_ca-v1beta1/proto_docs/google/api/launch_stage.rb delete mode 100644 owl-bot-staging/google-cloud-security-private_ca-v1beta1/proto_docs/google/api/resource.rb delete mode 100644 owl-bot-staging/google-cloud-security-private_ca-v1beta1/proto_docs/google/cloud/security/privateca/v1beta1/resources.rb delete mode 100644 owl-bot-staging/google-cloud-security-private_ca-v1beta1/proto_docs/google/cloud/security/privateca/v1beta1/service.rb delete mode 100644 owl-bot-staging/google-cloud-security-private_ca-v1beta1/proto_docs/google/longrunning/operations.rb delete mode 100644 owl-bot-staging/google-cloud-security-private_ca-v1beta1/proto_docs/google/protobuf/any.rb delete mode 100644 owl-bot-staging/google-cloud-security-private_ca-v1beta1/proto_docs/google/protobuf/duration.rb delete mode 100644 owl-bot-staging/google-cloud-security-private_ca-v1beta1/proto_docs/google/protobuf/empty.rb delete mode 100644 owl-bot-staging/google-cloud-security-private_ca-v1beta1/proto_docs/google/protobuf/field_mask.rb delete mode 100644 owl-bot-staging/google-cloud-security-private_ca-v1beta1/proto_docs/google/protobuf/timestamp.rb delete mode 100644 owl-bot-staging/google-cloud-security-private_ca-v1beta1/proto_docs/google/protobuf/wrappers.rb delete mode 100644 owl-bot-staging/google-cloud-security-private_ca-v1beta1/proto_docs/google/rpc/status.rb delete mode 100644 owl-bot-staging/google-cloud-security-private_ca-v1beta1/snippets/Gemfile delete mode 100644 owl-bot-staging/google-cloud-security-private_ca-v1beta1/snippets/certificate_authority_service/activate_certificate_authority.rb delete mode 100644 owl-bot-staging/google-cloud-security-private_ca-v1beta1/snippets/certificate_authority_service/create_certificate.rb delete mode 100644 owl-bot-staging/google-cloud-security-private_ca-v1beta1/snippets/certificate_authority_service/create_certificate_authority.rb delete mode 100644 owl-bot-staging/google-cloud-security-private_ca-v1beta1/snippets/certificate_authority_service/disable_certificate_authority.rb delete mode 100644 owl-bot-staging/google-cloud-security-private_ca-v1beta1/snippets/certificate_authority_service/enable_certificate_authority.rb delete mode 100644 owl-bot-staging/google-cloud-security-private_ca-v1beta1/snippets/certificate_authority_service/fetch_certificate_authority_csr.rb delete mode 100644 owl-bot-staging/google-cloud-security-private_ca-v1beta1/snippets/certificate_authority_service/get_certificate.rb delete mode 100644 owl-bot-staging/google-cloud-security-private_ca-v1beta1/snippets/certificate_authority_service/get_certificate_authority.rb delete mode 100644 owl-bot-staging/google-cloud-security-private_ca-v1beta1/snippets/certificate_authority_service/get_certificate_revocation_list.rb delete mode 100644 owl-bot-staging/google-cloud-security-private_ca-v1beta1/snippets/certificate_authority_service/get_reusable_config.rb delete mode 100644 owl-bot-staging/google-cloud-security-private_ca-v1beta1/snippets/certificate_authority_service/list_certificate_authorities.rb delete mode 100644 owl-bot-staging/google-cloud-security-private_ca-v1beta1/snippets/certificate_authority_service/list_certificate_revocation_lists.rb delete mode 100644 owl-bot-staging/google-cloud-security-private_ca-v1beta1/snippets/certificate_authority_service/list_certificates.rb delete mode 100644 owl-bot-staging/google-cloud-security-private_ca-v1beta1/snippets/certificate_authority_service/list_reusable_configs.rb delete mode 100644 owl-bot-staging/google-cloud-security-private_ca-v1beta1/snippets/certificate_authority_service/restore_certificate_authority.rb delete mode 100644 owl-bot-staging/google-cloud-security-private_ca-v1beta1/snippets/certificate_authority_service/revoke_certificate.rb delete mode 100644 owl-bot-staging/google-cloud-security-private_ca-v1beta1/snippets/certificate_authority_service/schedule_delete_certificate_authority.rb delete mode 100644 owl-bot-staging/google-cloud-security-private_ca-v1beta1/snippets/certificate_authority_service/update_certificate.rb delete mode 100644 owl-bot-staging/google-cloud-security-private_ca-v1beta1/snippets/certificate_authority_service/update_certificate_authority.rb delete mode 100644 owl-bot-staging/google-cloud-security-private_ca-v1beta1/snippets/certificate_authority_service/update_certificate_revocation_list.rb delete mode 100644 owl-bot-staging/google-cloud-security-private_ca-v1beta1/snippets/snippet_metadata_google.cloud.security.privateca.v1beta1.json delete mode 100644 owl-bot-staging/google-cloud-security-private_ca-v1beta1/test/google/cloud/security/private_ca/v1beta1/certificate_authority_service_operations_test.rb delete mode 100644 owl-bot-staging/google-cloud-security-private_ca-v1beta1/test/google/cloud/security/private_ca/v1beta1/certificate_authority_service_paths_test.rb delete mode 100644 owl-bot-staging/google-cloud-security-private_ca-v1beta1/test/google/cloud/security/private_ca/v1beta1/certificate_authority_service_rest_test.rb delete mode 100644 owl-bot-staging/google-cloud-security-private_ca-v1beta1/test/google/cloud/security/private_ca/v1beta1/certificate_authority_service_test.rb delete mode 100644 owl-bot-staging/google-cloud-security-private_ca-v1beta1/test/helper.rb delete mode 100644 owl-bot-staging/google-cloud-security-public_ca-v1/.gitignore delete mode 100644 owl-bot-staging/google-cloud-security-public_ca-v1/.repo-metadata.json delete mode 100644 owl-bot-staging/google-cloud-security-public_ca-v1/.rubocop.yml delete mode 100644 owl-bot-staging/google-cloud-security-public_ca-v1/.toys.rb delete mode 100644 owl-bot-staging/google-cloud-security-public_ca-v1/.yardopts delete mode 100644 owl-bot-staging/google-cloud-security-public_ca-v1/AUTHENTICATION.md delete mode 100644 owl-bot-staging/google-cloud-security-public_ca-v1/CHANGELOG.md delete mode 100644 owl-bot-staging/google-cloud-security-public_ca-v1/Gemfile delete mode 100644 owl-bot-staging/google-cloud-security-public_ca-v1/LICENSE.md delete mode 100644 owl-bot-staging/google-cloud-security-public_ca-v1/README.md delete mode 100644 owl-bot-staging/google-cloud-security-public_ca-v1/Rakefile delete mode 100644 owl-bot-staging/google-cloud-security-public_ca-v1/gapic_metadata.json delete mode 100644 owl-bot-staging/google-cloud-security-public_ca-v1/google-cloud-security-public_ca-v1.gemspec delete mode 100644 owl-bot-staging/google-cloud-security-public_ca-v1/lib/google-cloud-security-public_ca-v1.rb delete mode 100644 owl-bot-staging/google-cloud-security-public_ca-v1/lib/google/cloud/security/public_ca/v1.rb delete mode 100644 owl-bot-staging/google-cloud-security-public_ca-v1/lib/google/cloud/security/public_ca/v1/public_certificate_authority_service.rb delete mode 100644 owl-bot-staging/google-cloud-security-public_ca-v1/lib/google/cloud/security/public_ca/v1/public_certificate_authority_service/client.rb delete mode 100644 owl-bot-staging/google-cloud-security-public_ca-v1/lib/google/cloud/security/public_ca/v1/public_certificate_authority_service/credentials.rb delete mode 100644 owl-bot-staging/google-cloud-security-public_ca-v1/lib/google/cloud/security/public_ca/v1/public_certificate_authority_service/paths.rb delete mode 100644 owl-bot-staging/google-cloud-security-public_ca-v1/lib/google/cloud/security/public_ca/v1/public_certificate_authority_service/rest.rb delete mode 100644 owl-bot-staging/google-cloud-security-public_ca-v1/lib/google/cloud/security/public_ca/v1/public_certificate_authority_service/rest/client.rb delete mode 100644 owl-bot-staging/google-cloud-security-public_ca-v1/lib/google/cloud/security/public_ca/v1/public_certificate_authority_service/rest/service_stub.rb delete mode 100644 owl-bot-staging/google-cloud-security-public_ca-v1/lib/google/cloud/security/public_ca/v1/rest.rb delete mode 100644 owl-bot-staging/google-cloud-security-public_ca-v1/lib/google/cloud/security/public_ca/v1/version.rb delete mode 100644 owl-bot-staging/google-cloud-security-public_ca-v1/lib/google/cloud/security/publicca/v1/resources_pb.rb delete mode 100644 owl-bot-staging/google-cloud-security-public_ca-v1/lib/google/cloud/security/publicca/v1/service_pb.rb delete mode 100644 owl-bot-staging/google-cloud-security-public_ca-v1/lib/google/cloud/security/publicca/v1/service_services_pb.rb delete mode 100644 owl-bot-staging/google-cloud-security-public_ca-v1/proto_docs/README.md delete mode 100644 owl-bot-staging/google-cloud-security-public_ca-v1/proto_docs/google/api/client.rb delete mode 100644 owl-bot-staging/google-cloud-security-public_ca-v1/proto_docs/google/api/field_behavior.rb delete mode 100644 owl-bot-staging/google-cloud-security-public_ca-v1/proto_docs/google/api/launch_stage.rb delete mode 100644 owl-bot-staging/google-cloud-security-public_ca-v1/proto_docs/google/api/resource.rb delete mode 100644 owl-bot-staging/google-cloud-security-public_ca-v1/proto_docs/google/cloud/security/publicca/v1/resources.rb delete mode 100644 owl-bot-staging/google-cloud-security-public_ca-v1/proto_docs/google/cloud/security/publicca/v1/service.rb delete mode 100644 owl-bot-staging/google-cloud-security-public_ca-v1/proto_docs/google/protobuf/duration.rb delete mode 100644 owl-bot-staging/google-cloud-security-public_ca-v1/snippets/Gemfile delete mode 100644 owl-bot-staging/google-cloud-security-public_ca-v1/snippets/public_certificate_authority_service/create_external_account_key.rb delete mode 100644 owl-bot-staging/google-cloud-security-public_ca-v1/snippets/snippet_metadata_google.cloud.security.publicca.v1.json delete mode 100644 owl-bot-staging/google-cloud-security-public_ca-v1/test/google/cloud/security/public_ca/v1/public_certificate_authority_service_paths_test.rb delete mode 100644 owl-bot-staging/google-cloud-security-public_ca-v1/test/google/cloud/security/public_ca/v1/public_certificate_authority_service_rest_test.rb delete mode 100644 owl-bot-staging/google-cloud-security-public_ca-v1/test/google/cloud/security/public_ca/v1/public_certificate_authority_service_test.rb delete mode 100644 owl-bot-staging/google-cloud-security-public_ca-v1/test/helper.rb delete mode 100644 owl-bot-staging/google-cloud-security-public_ca-v1beta1/.gitignore delete mode 100644 owl-bot-staging/google-cloud-security-public_ca-v1beta1/.repo-metadata.json delete mode 100644 owl-bot-staging/google-cloud-security-public_ca-v1beta1/.rubocop.yml delete mode 100644 owl-bot-staging/google-cloud-security-public_ca-v1beta1/.toys.rb delete mode 100644 owl-bot-staging/google-cloud-security-public_ca-v1beta1/.yardopts delete mode 100644 owl-bot-staging/google-cloud-security-public_ca-v1beta1/AUTHENTICATION.md delete mode 100644 owl-bot-staging/google-cloud-security-public_ca-v1beta1/CHANGELOG.md delete mode 100644 owl-bot-staging/google-cloud-security-public_ca-v1beta1/Gemfile delete mode 100644 owl-bot-staging/google-cloud-security-public_ca-v1beta1/LICENSE.md delete mode 100644 owl-bot-staging/google-cloud-security-public_ca-v1beta1/README.md delete mode 100644 owl-bot-staging/google-cloud-security-public_ca-v1beta1/Rakefile delete mode 100644 owl-bot-staging/google-cloud-security-public_ca-v1beta1/gapic_metadata.json delete mode 100644 owl-bot-staging/google-cloud-security-public_ca-v1beta1/google-cloud-security-public_ca-v1beta1.gemspec delete mode 100644 owl-bot-staging/google-cloud-security-public_ca-v1beta1/lib/google-cloud-security-public_ca-v1beta1.rb delete mode 100644 owl-bot-staging/google-cloud-security-public_ca-v1beta1/lib/google/cloud/security/public_ca/v1beta1.rb delete mode 100644 owl-bot-staging/google-cloud-security-public_ca-v1beta1/lib/google/cloud/security/public_ca/v1beta1/public_certificate_authority_service.rb delete mode 100644 owl-bot-staging/google-cloud-security-public_ca-v1beta1/lib/google/cloud/security/public_ca/v1beta1/public_certificate_authority_service/client.rb delete mode 100644 owl-bot-staging/google-cloud-security-public_ca-v1beta1/lib/google/cloud/security/public_ca/v1beta1/public_certificate_authority_service/credentials.rb delete mode 100644 owl-bot-staging/google-cloud-security-public_ca-v1beta1/lib/google/cloud/security/public_ca/v1beta1/public_certificate_authority_service/paths.rb delete mode 100644 owl-bot-staging/google-cloud-security-public_ca-v1beta1/lib/google/cloud/security/public_ca/v1beta1/public_certificate_authority_service/rest.rb delete mode 100644 owl-bot-staging/google-cloud-security-public_ca-v1beta1/lib/google/cloud/security/public_ca/v1beta1/public_certificate_authority_service/rest/client.rb delete mode 100644 owl-bot-staging/google-cloud-security-public_ca-v1beta1/lib/google/cloud/security/public_ca/v1beta1/public_certificate_authority_service/rest/service_stub.rb delete mode 100644 owl-bot-staging/google-cloud-security-public_ca-v1beta1/lib/google/cloud/security/public_ca/v1beta1/rest.rb delete mode 100644 owl-bot-staging/google-cloud-security-public_ca-v1beta1/lib/google/cloud/security/public_ca/v1beta1/version.rb delete mode 100644 owl-bot-staging/google-cloud-security-public_ca-v1beta1/lib/google/cloud/security/publicca/v1beta1/resources_pb.rb delete mode 100644 owl-bot-staging/google-cloud-security-public_ca-v1beta1/lib/google/cloud/security/publicca/v1beta1/service_pb.rb delete mode 100644 owl-bot-staging/google-cloud-security-public_ca-v1beta1/lib/google/cloud/security/publicca/v1beta1/service_services_pb.rb delete mode 100644 owl-bot-staging/google-cloud-security-public_ca-v1beta1/proto_docs/README.md delete mode 100644 owl-bot-staging/google-cloud-security-public_ca-v1beta1/proto_docs/google/api/client.rb delete mode 100644 owl-bot-staging/google-cloud-security-public_ca-v1beta1/proto_docs/google/api/field_behavior.rb delete mode 100644 owl-bot-staging/google-cloud-security-public_ca-v1beta1/proto_docs/google/api/launch_stage.rb delete mode 100644 owl-bot-staging/google-cloud-security-public_ca-v1beta1/proto_docs/google/api/resource.rb delete mode 100644 owl-bot-staging/google-cloud-security-public_ca-v1beta1/proto_docs/google/cloud/security/publicca/v1beta1/resources.rb delete mode 100644 owl-bot-staging/google-cloud-security-public_ca-v1beta1/proto_docs/google/cloud/security/publicca/v1beta1/service.rb delete mode 100644 owl-bot-staging/google-cloud-security-public_ca-v1beta1/proto_docs/google/protobuf/duration.rb delete mode 100644 owl-bot-staging/google-cloud-security-public_ca-v1beta1/snippets/Gemfile delete mode 100644 owl-bot-staging/google-cloud-security-public_ca-v1beta1/snippets/public_certificate_authority_service/create_external_account_key.rb delete mode 100644 owl-bot-staging/google-cloud-security-public_ca-v1beta1/snippets/snippet_metadata_google.cloud.security.publicca.v1beta1.json delete mode 100644 owl-bot-staging/google-cloud-security-public_ca-v1beta1/test/google/cloud/security/public_ca/v1beta1/public_certificate_authority_service_paths_test.rb delete mode 100644 owl-bot-staging/google-cloud-security-public_ca-v1beta1/test/google/cloud/security/public_ca/v1beta1/public_certificate_authority_service_rest_test.rb delete mode 100644 owl-bot-staging/google-cloud-security-public_ca-v1beta1/test/google/cloud/security/public_ca/v1beta1/public_certificate_authority_service_test.rb delete mode 100644 owl-bot-staging/google-cloud-security-public_ca-v1beta1/test/helper.rb delete mode 100644 owl-bot-staging/google-cloud-security_center-v1/.gitignore delete mode 100644 owl-bot-staging/google-cloud-security_center-v1/.repo-metadata.json delete mode 100644 owl-bot-staging/google-cloud-security_center-v1/.rubocop.yml delete mode 100644 owl-bot-staging/google-cloud-security_center-v1/.toys.rb delete mode 100644 owl-bot-staging/google-cloud-security_center-v1/.yardopts delete mode 100644 owl-bot-staging/google-cloud-security_center-v1/AUTHENTICATION.md delete mode 100644 owl-bot-staging/google-cloud-security_center-v1/CHANGELOG.md delete mode 100644 owl-bot-staging/google-cloud-security_center-v1/Gemfile delete mode 100644 owl-bot-staging/google-cloud-security_center-v1/LICENSE.md delete mode 100644 owl-bot-staging/google-cloud-security_center-v1/README.md delete mode 100644 owl-bot-staging/google-cloud-security_center-v1/Rakefile delete mode 100644 owl-bot-staging/google-cloud-security_center-v1/gapic_metadata.json delete mode 100644 owl-bot-staging/google-cloud-security_center-v1/google-cloud-security_center-v1.gemspec delete mode 100644 owl-bot-staging/google-cloud-security_center-v1/lib/google-cloud-security_center-v1.rb delete mode 100644 owl-bot-staging/google-cloud-security_center-v1/lib/google/cloud/security_center/v1.rb delete mode 100644 owl-bot-staging/google-cloud-security_center-v1/lib/google/cloud/security_center/v1/rest.rb delete mode 100644 owl-bot-staging/google-cloud-security_center-v1/lib/google/cloud/security_center/v1/security_center.rb delete mode 100644 owl-bot-staging/google-cloud-security_center-v1/lib/google/cloud/security_center/v1/security_center/client.rb delete mode 100644 owl-bot-staging/google-cloud-security_center-v1/lib/google/cloud/security_center/v1/security_center/credentials.rb delete mode 100644 owl-bot-staging/google-cloud-security_center-v1/lib/google/cloud/security_center/v1/security_center/operations.rb delete mode 100644 owl-bot-staging/google-cloud-security_center-v1/lib/google/cloud/security_center/v1/security_center/paths.rb delete mode 100644 owl-bot-staging/google-cloud-security_center-v1/lib/google/cloud/security_center/v1/security_center/rest.rb delete mode 100644 owl-bot-staging/google-cloud-security_center-v1/lib/google/cloud/security_center/v1/security_center/rest/client.rb delete mode 100644 owl-bot-staging/google-cloud-security_center-v1/lib/google/cloud/security_center/v1/security_center/rest/operations.rb delete mode 100644 owl-bot-staging/google-cloud-security_center-v1/lib/google/cloud/security_center/v1/security_center/rest/service_stub.rb delete mode 100644 owl-bot-staging/google-cloud-security_center-v1/lib/google/cloud/security_center/v1/version.rb delete mode 100644 owl-bot-staging/google-cloud-security_center-v1/lib/google/cloud/securitycenter/v1/access_pb.rb delete mode 100644 owl-bot-staging/google-cloud-security_center-v1/lib/google/cloud/securitycenter/v1/application_pb.rb delete mode 100644 owl-bot-staging/google-cloud-security_center-v1/lib/google/cloud/securitycenter/v1/asset_pb.rb delete mode 100644 owl-bot-staging/google-cloud-security_center-v1/lib/google/cloud/securitycenter/v1/attack_exposure_pb.rb delete mode 100644 owl-bot-staging/google-cloud-security_center-v1/lib/google/cloud/securitycenter/v1/attack_path_pb.rb delete mode 100644 owl-bot-staging/google-cloud-security_center-v1/lib/google/cloud/securitycenter/v1/backup_disaster_recovery_pb.rb delete mode 100644 owl-bot-staging/google-cloud-security_center-v1/lib/google/cloud/securitycenter/v1/bigquery_export_pb.rb delete mode 100644 owl-bot-staging/google-cloud-security_center-v1/lib/google/cloud/securitycenter/v1/chokepoint_pb.rb delete mode 100644 owl-bot-staging/google-cloud-security_center-v1/lib/google/cloud/securitycenter/v1/cloud_armor_pb.rb delete mode 100644 owl-bot-staging/google-cloud-security_center-v1/lib/google/cloud/securitycenter/v1/cloud_dlp_data_profile_pb.rb delete mode 100644 owl-bot-staging/google-cloud-security_center-v1/lib/google/cloud/securitycenter/v1/cloud_dlp_inspection_pb.rb delete mode 100644 owl-bot-staging/google-cloud-security_center-v1/lib/google/cloud/securitycenter/v1/compliance_pb.rb delete mode 100644 owl-bot-staging/google-cloud-security_center-v1/lib/google/cloud/securitycenter/v1/connection_pb.rb delete mode 100644 owl-bot-staging/google-cloud-security_center-v1/lib/google/cloud/securitycenter/v1/contact_details_pb.rb delete mode 100644 owl-bot-staging/google-cloud-security_center-v1/lib/google/cloud/securitycenter/v1/container_pb.rb delete mode 100644 owl-bot-staging/google-cloud-security_center-v1/lib/google/cloud/securitycenter/v1/database_pb.rb delete mode 100644 owl-bot-staging/google-cloud-security_center-v1/lib/google/cloud/securitycenter/v1/effective_event_threat_detection_custom_module_pb.rb delete mode 100644 owl-bot-staging/google-cloud-security_center-v1/lib/google/cloud/securitycenter/v1/effective_security_health_analytics_custom_module_pb.rb delete mode 100644 owl-bot-staging/google-cloud-security_center-v1/lib/google/cloud/securitycenter/v1/event_threat_detection_custom_module_pb.rb delete mode 100644 owl-bot-staging/google-cloud-security_center-v1/lib/google/cloud/securitycenter/v1/event_threat_detection_custom_module_validation_errors_pb.rb delete mode 100644 owl-bot-staging/google-cloud-security_center-v1/lib/google/cloud/securitycenter/v1/exfiltration_pb.rb delete mode 100644 owl-bot-staging/google-cloud-security_center-v1/lib/google/cloud/securitycenter/v1/external_exposure_pb.rb delete mode 100644 owl-bot-staging/google-cloud-security_center-v1/lib/google/cloud/securitycenter/v1/external_system_pb.rb delete mode 100644 owl-bot-staging/google-cloud-security_center-v1/lib/google/cloud/securitycenter/v1/file_pb.rb delete mode 100644 owl-bot-staging/google-cloud-security_center-v1/lib/google/cloud/securitycenter/v1/finding_pb.rb delete mode 100644 owl-bot-staging/google-cloud-security_center-v1/lib/google/cloud/securitycenter/v1/folder_pb.rb delete mode 100644 owl-bot-staging/google-cloud-security_center-v1/lib/google/cloud/securitycenter/v1/group_membership_pb.rb delete mode 100644 owl-bot-staging/google-cloud-security_center-v1/lib/google/cloud/securitycenter/v1/iam_binding_pb.rb delete mode 100644 owl-bot-staging/google-cloud-security_center-v1/lib/google/cloud/securitycenter/v1/indicator_pb.rb delete mode 100644 owl-bot-staging/google-cloud-security_center-v1/lib/google/cloud/securitycenter/v1/kernel_rootkit_pb.rb delete mode 100644 owl-bot-staging/google-cloud-security_center-v1/lib/google/cloud/securitycenter/v1/kubernetes_pb.rb delete mode 100644 owl-bot-staging/google-cloud-security_center-v1/lib/google/cloud/securitycenter/v1/label_pb.rb delete mode 100644 owl-bot-staging/google-cloud-security_center-v1/lib/google/cloud/securitycenter/v1/load_balancer_pb.rb delete mode 100644 owl-bot-staging/google-cloud-security_center-v1/lib/google/cloud/securitycenter/v1/log_entry_pb.rb delete mode 100644 owl-bot-staging/google-cloud-security_center-v1/lib/google/cloud/securitycenter/v1/mitre_attack_pb.rb delete mode 100644 owl-bot-staging/google-cloud-security_center-v1/lib/google/cloud/securitycenter/v1/mute_config_pb.rb delete mode 100644 owl-bot-staging/google-cloud-security_center-v1/lib/google/cloud/securitycenter/v1/notebook_pb.rb delete mode 100644 owl-bot-staging/google-cloud-security_center-v1/lib/google/cloud/securitycenter/v1/notification_config_pb.rb delete mode 100644 owl-bot-staging/google-cloud-security_center-v1/lib/google/cloud/securitycenter/v1/notification_message_pb.rb delete mode 100644 owl-bot-staging/google-cloud-security_center-v1/lib/google/cloud/securitycenter/v1/org_policy_pb.rb delete mode 100644 owl-bot-staging/google-cloud-security_center-v1/lib/google/cloud/securitycenter/v1/organization_settings_pb.rb delete mode 100644 owl-bot-staging/google-cloud-security_center-v1/lib/google/cloud/securitycenter/v1/process_pb.rb delete mode 100644 owl-bot-staging/google-cloud-security_center-v1/lib/google/cloud/securitycenter/v1/resource_pb.rb delete mode 100644 owl-bot-staging/google-cloud-security_center-v1/lib/google/cloud/securitycenter/v1/resource_value_config_pb.rb delete mode 100644 owl-bot-staging/google-cloud-security_center-v1/lib/google/cloud/securitycenter/v1/run_asset_discovery_response_pb.rb delete mode 100644 owl-bot-staging/google-cloud-security_center-v1/lib/google/cloud/securitycenter/v1/security_health_analytics_custom_config_pb.rb delete mode 100644 owl-bot-staging/google-cloud-security_center-v1/lib/google/cloud/securitycenter/v1/security_health_analytics_custom_module_pb.rb delete mode 100644 owl-bot-staging/google-cloud-security_center-v1/lib/google/cloud/securitycenter/v1/security_marks_pb.rb delete mode 100644 owl-bot-staging/google-cloud-security_center-v1/lib/google/cloud/securitycenter/v1/security_posture_pb.rb delete mode 100644 owl-bot-staging/google-cloud-security_center-v1/lib/google/cloud/securitycenter/v1/securitycenter_service_pb.rb delete mode 100644 owl-bot-staging/google-cloud-security_center-v1/lib/google/cloud/securitycenter/v1/securitycenter_service_services_pb.rb delete mode 100644 owl-bot-staging/google-cloud-security_center-v1/lib/google/cloud/securitycenter/v1/simulation_pb.rb delete mode 100644 owl-bot-staging/google-cloud-security_center-v1/lib/google/cloud/securitycenter/v1/source_pb.rb delete mode 100644 owl-bot-staging/google-cloud-security_center-v1/lib/google/cloud/securitycenter/v1/toxic_combination_pb.rb delete mode 100644 owl-bot-staging/google-cloud-security_center-v1/lib/google/cloud/securitycenter/v1/valued_resource_pb.rb delete mode 100644 owl-bot-staging/google-cloud-security_center-v1/lib/google/cloud/securitycenter/v1/vulnerability_pb.rb delete mode 100644 owl-bot-staging/google-cloud-security_center-v1/proto_docs/README.md delete mode 100644 owl-bot-staging/google-cloud-security_center-v1/proto_docs/google/api/client.rb delete mode 100644 owl-bot-staging/google-cloud-security_center-v1/proto_docs/google/api/field_behavior.rb delete mode 100644 owl-bot-staging/google-cloud-security_center-v1/proto_docs/google/api/field_info.rb delete mode 100644 owl-bot-staging/google-cloud-security_center-v1/proto_docs/google/api/launch_stage.rb delete mode 100644 owl-bot-staging/google-cloud-security_center-v1/proto_docs/google/api/resource.rb delete mode 100644 owl-bot-staging/google-cloud-security_center-v1/proto_docs/google/cloud/securitycenter/v1/access.rb delete mode 100644 owl-bot-staging/google-cloud-security_center-v1/proto_docs/google/cloud/securitycenter/v1/application.rb delete mode 100644 owl-bot-staging/google-cloud-security_center-v1/proto_docs/google/cloud/securitycenter/v1/asset.rb delete mode 100644 owl-bot-staging/google-cloud-security_center-v1/proto_docs/google/cloud/securitycenter/v1/attack_exposure.rb delete mode 100644 owl-bot-staging/google-cloud-security_center-v1/proto_docs/google/cloud/securitycenter/v1/attack_path.rb delete mode 100644 owl-bot-staging/google-cloud-security_center-v1/proto_docs/google/cloud/securitycenter/v1/backup_disaster_recovery.rb delete mode 100644 owl-bot-staging/google-cloud-security_center-v1/proto_docs/google/cloud/securitycenter/v1/bigquery_export.rb delete mode 100644 owl-bot-staging/google-cloud-security_center-v1/proto_docs/google/cloud/securitycenter/v1/chokepoint.rb delete mode 100644 owl-bot-staging/google-cloud-security_center-v1/proto_docs/google/cloud/securitycenter/v1/cloud_armor.rb delete mode 100644 owl-bot-staging/google-cloud-security_center-v1/proto_docs/google/cloud/securitycenter/v1/cloud_dlp_data_profile.rb delete mode 100644 owl-bot-staging/google-cloud-security_center-v1/proto_docs/google/cloud/securitycenter/v1/cloud_dlp_inspection.rb delete mode 100644 owl-bot-staging/google-cloud-security_center-v1/proto_docs/google/cloud/securitycenter/v1/compliance.rb delete mode 100644 owl-bot-staging/google-cloud-security_center-v1/proto_docs/google/cloud/securitycenter/v1/connection.rb delete mode 100644 owl-bot-staging/google-cloud-security_center-v1/proto_docs/google/cloud/securitycenter/v1/contact_details.rb delete mode 100644 owl-bot-staging/google-cloud-security_center-v1/proto_docs/google/cloud/securitycenter/v1/container.rb delete mode 100644 owl-bot-staging/google-cloud-security_center-v1/proto_docs/google/cloud/securitycenter/v1/database.rb delete mode 100644 owl-bot-staging/google-cloud-security_center-v1/proto_docs/google/cloud/securitycenter/v1/effective_event_threat_detection_custom_module.rb delete mode 100644 owl-bot-staging/google-cloud-security_center-v1/proto_docs/google/cloud/securitycenter/v1/effective_security_health_analytics_custom_module.rb delete mode 100644 owl-bot-staging/google-cloud-security_center-v1/proto_docs/google/cloud/securitycenter/v1/event_threat_detection_custom_module.rb delete mode 100644 owl-bot-staging/google-cloud-security_center-v1/proto_docs/google/cloud/securitycenter/v1/event_threat_detection_custom_module_validation_errors.rb delete mode 100644 owl-bot-staging/google-cloud-security_center-v1/proto_docs/google/cloud/securitycenter/v1/exfiltration.rb delete mode 100644 owl-bot-staging/google-cloud-security_center-v1/proto_docs/google/cloud/securitycenter/v1/external_exposure.rb delete mode 100644 owl-bot-staging/google-cloud-security_center-v1/proto_docs/google/cloud/securitycenter/v1/external_system.rb delete mode 100644 owl-bot-staging/google-cloud-security_center-v1/proto_docs/google/cloud/securitycenter/v1/file.rb delete mode 100644 owl-bot-staging/google-cloud-security_center-v1/proto_docs/google/cloud/securitycenter/v1/finding.rb delete mode 100644 owl-bot-staging/google-cloud-security_center-v1/proto_docs/google/cloud/securitycenter/v1/folder.rb delete mode 100644 owl-bot-staging/google-cloud-security_center-v1/proto_docs/google/cloud/securitycenter/v1/group_membership.rb delete mode 100644 owl-bot-staging/google-cloud-security_center-v1/proto_docs/google/cloud/securitycenter/v1/iam_binding.rb delete mode 100644 owl-bot-staging/google-cloud-security_center-v1/proto_docs/google/cloud/securitycenter/v1/indicator.rb delete mode 100644 owl-bot-staging/google-cloud-security_center-v1/proto_docs/google/cloud/securitycenter/v1/kernel_rootkit.rb delete mode 100644 owl-bot-staging/google-cloud-security_center-v1/proto_docs/google/cloud/securitycenter/v1/kubernetes.rb delete mode 100644 owl-bot-staging/google-cloud-security_center-v1/proto_docs/google/cloud/securitycenter/v1/label.rb delete mode 100644 owl-bot-staging/google-cloud-security_center-v1/proto_docs/google/cloud/securitycenter/v1/load_balancer.rb delete mode 100644 owl-bot-staging/google-cloud-security_center-v1/proto_docs/google/cloud/securitycenter/v1/log_entry.rb delete mode 100644 owl-bot-staging/google-cloud-security_center-v1/proto_docs/google/cloud/securitycenter/v1/mitre_attack.rb delete mode 100644 owl-bot-staging/google-cloud-security_center-v1/proto_docs/google/cloud/securitycenter/v1/mute_config.rb delete mode 100644 owl-bot-staging/google-cloud-security_center-v1/proto_docs/google/cloud/securitycenter/v1/notebook.rb delete mode 100644 owl-bot-staging/google-cloud-security_center-v1/proto_docs/google/cloud/securitycenter/v1/notification_config.rb delete mode 100644 owl-bot-staging/google-cloud-security_center-v1/proto_docs/google/cloud/securitycenter/v1/notification_message.rb delete mode 100644 owl-bot-staging/google-cloud-security_center-v1/proto_docs/google/cloud/securitycenter/v1/org_policy.rb delete mode 100644 owl-bot-staging/google-cloud-security_center-v1/proto_docs/google/cloud/securitycenter/v1/organization_settings.rb delete mode 100644 owl-bot-staging/google-cloud-security_center-v1/proto_docs/google/cloud/securitycenter/v1/process.rb delete mode 100644 owl-bot-staging/google-cloud-security_center-v1/proto_docs/google/cloud/securitycenter/v1/resource.rb delete mode 100644 owl-bot-staging/google-cloud-security_center-v1/proto_docs/google/cloud/securitycenter/v1/resource_value_config.rb delete mode 100644 owl-bot-staging/google-cloud-security_center-v1/proto_docs/google/cloud/securitycenter/v1/run_asset_discovery_response.rb delete mode 100644 owl-bot-staging/google-cloud-security_center-v1/proto_docs/google/cloud/securitycenter/v1/security_health_analytics_custom_config.rb delete mode 100644 owl-bot-staging/google-cloud-security_center-v1/proto_docs/google/cloud/securitycenter/v1/security_health_analytics_custom_module.rb delete mode 100644 owl-bot-staging/google-cloud-security_center-v1/proto_docs/google/cloud/securitycenter/v1/security_marks.rb delete mode 100644 owl-bot-staging/google-cloud-security_center-v1/proto_docs/google/cloud/securitycenter/v1/security_posture.rb delete mode 100644 owl-bot-staging/google-cloud-security_center-v1/proto_docs/google/cloud/securitycenter/v1/securitycenter_service.rb delete mode 100644 owl-bot-staging/google-cloud-security_center-v1/proto_docs/google/cloud/securitycenter/v1/simulation.rb delete mode 100644 owl-bot-staging/google-cloud-security_center-v1/proto_docs/google/cloud/securitycenter/v1/source.rb delete mode 100644 owl-bot-staging/google-cloud-security_center-v1/proto_docs/google/cloud/securitycenter/v1/toxic_combination.rb delete mode 100644 owl-bot-staging/google-cloud-security_center-v1/proto_docs/google/cloud/securitycenter/v1/valued_resource.rb delete mode 100644 owl-bot-staging/google-cloud-security_center-v1/proto_docs/google/cloud/securitycenter/v1/vulnerability.rb delete mode 100644 owl-bot-staging/google-cloud-security_center-v1/proto_docs/google/iam/v1/iam_policy.rb delete mode 100644 owl-bot-staging/google-cloud-security_center-v1/proto_docs/google/iam/v1/options.rb delete mode 100644 owl-bot-staging/google-cloud-security_center-v1/proto_docs/google/iam/v1/policy.rb delete mode 100644 owl-bot-staging/google-cloud-security_center-v1/proto_docs/google/longrunning/operations.rb delete mode 100644 owl-bot-staging/google-cloud-security_center-v1/proto_docs/google/protobuf/any.rb delete mode 100644 owl-bot-staging/google-cloud-security_center-v1/proto_docs/google/protobuf/duration.rb delete mode 100644 owl-bot-staging/google-cloud-security_center-v1/proto_docs/google/protobuf/empty.rb delete mode 100644 owl-bot-staging/google-cloud-security_center-v1/proto_docs/google/protobuf/field_mask.rb delete mode 100644 owl-bot-staging/google-cloud-security_center-v1/proto_docs/google/protobuf/struct.rb delete mode 100644 owl-bot-staging/google-cloud-security_center-v1/proto_docs/google/protobuf/timestamp.rb delete mode 100644 owl-bot-staging/google-cloud-security_center-v1/proto_docs/google/rpc/status.rb delete mode 100644 owl-bot-staging/google-cloud-security_center-v1/proto_docs/google/type/expr.rb delete mode 100644 owl-bot-staging/google-cloud-security_center-v1/snippets/Gemfile delete mode 100644 owl-bot-staging/google-cloud-security_center-v1/snippets/security_center/batch_create_resource_value_configs.rb delete mode 100644 owl-bot-staging/google-cloud-security_center-v1/snippets/security_center/bulk_mute_findings.rb delete mode 100644 owl-bot-staging/google-cloud-security_center-v1/snippets/security_center/create_big_query_export.rb delete mode 100644 owl-bot-staging/google-cloud-security_center-v1/snippets/security_center/create_event_threat_detection_custom_module.rb delete mode 100644 owl-bot-staging/google-cloud-security_center-v1/snippets/security_center/create_finding.rb delete mode 100644 owl-bot-staging/google-cloud-security_center-v1/snippets/security_center/create_mute_config.rb delete mode 100644 owl-bot-staging/google-cloud-security_center-v1/snippets/security_center/create_notification_config.rb delete mode 100644 owl-bot-staging/google-cloud-security_center-v1/snippets/security_center/create_security_health_analytics_custom_module.rb delete mode 100644 owl-bot-staging/google-cloud-security_center-v1/snippets/security_center/create_source.rb delete mode 100644 owl-bot-staging/google-cloud-security_center-v1/snippets/security_center/delete_big_query_export.rb delete mode 100644 owl-bot-staging/google-cloud-security_center-v1/snippets/security_center/delete_event_threat_detection_custom_module.rb delete mode 100644 owl-bot-staging/google-cloud-security_center-v1/snippets/security_center/delete_mute_config.rb delete mode 100644 owl-bot-staging/google-cloud-security_center-v1/snippets/security_center/delete_notification_config.rb delete mode 100644 owl-bot-staging/google-cloud-security_center-v1/snippets/security_center/delete_resource_value_config.rb delete mode 100644 owl-bot-staging/google-cloud-security_center-v1/snippets/security_center/delete_security_health_analytics_custom_module.rb delete mode 100644 owl-bot-staging/google-cloud-security_center-v1/snippets/security_center/get_big_query_export.rb delete mode 100644 owl-bot-staging/google-cloud-security_center-v1/snippets/security_center/get_effective_event_threat_detection_custom_module.rb delete mode 100644 owl-bot-staging/google-cloud-security_center-v1/snippets/security_center/get_effective_security_health_analytics_custom_module.rb delete mode 100644 owl-bot-staging/google-cloud-security_center-v1/snippets/security_center/get_event_threat_detection_custom_module.rb delete mode 100644 owl-bot-staging/google-cloud-security_center-v1/snippets/security_center/get_iam_policy.rb delete mode 100644 owl-bot-staging/google-cloud-security_center-v1/snippets/security_center/get_mute_config.rb delete mode 100644 owl-bot-staging/google-cloud-security_center-v1/snippets/security_center/get_notification_config.rb delete mode 100644 owl-bot-staging/google-cloud-security_center-v1/snippets/security_center/get_organization_settings.rb delete mode 100644 owl-bot-staging/google-cloud-security_center-v1/snippets/security_center/get_resource_value_config.rb delete mode 100644 owl-bot-staging/google-cloud-security_center-v1/snippets/security_center/get_security_health_analytics_custom_module.rb delete mode 100644 owl-bot-staging/google-cloud-security_center-v1/snippets/security_center/get_simulation.rb delete mode 100644 owl-bot-staging/google-cloud-security_center-v1/snippets/security_center/get_source.rb delete mode 100644 owl-bot-staging/google-cloud-security_center-v1/snippets/security_center/get_valued_resource.rb delete mode 100644 owl-bot-staging/google-cloud-security_center-v1/snippets/security_center/group_assets.rb delete mode 100644 owl-bot-staging/google-cloud-security_center-v1/snippets/security_center/group_findings.rb delete mode 100644 owl-bot-staging/google-cloud-security_center-v1/snippets/security_center/list_assets.rb delete mode 100644 owl-bot-staging/google-cloud-security_center-v1/snippets/security_center/list_attack_paths.rb delete mode 100644 owl-bot-staging/google-cloud-security_center-v1/snippets/security_center/list_big_query_exports.rb delete mode 100644 owl-bot-staging/google-cloud-security_center-v1/snippets/security_center/list_descendant_event_threat_detection_custom_modules.rb delete mode 100644 owl-bot-staging/google-cloud-security_center-v1/snippets/security_center/list_descendant_security_health_analytics_custom_modules.rb delete mode 100644 owl-bot-staging/google-cloud-security_center-v1/snippets/security_center/list_effective_event_threat_detection_custom_modules.rb delete mode 100644 owl-bot-staging/google-cloud-security_center-v1/snippets/security_center/list_effective_security_health_analytics_custom_modules.rb delete mode 100644 owl-bot-staging/google-cloud-security_center-v1/snippets/security_center/list_event_threat_detection_custom_modules.rb delete mode 100644 owl-bot-staging/google-cloud-security_center-v1/snippets/security_center/list_findings.rb delete mode 100644 owl-bot-staging/google-cloud-security_center-v1/snippets/security_center/list_mute_configs.rb delete mode 100644 owl-bot-staging/google-cloud-security_center-v1/snippets/security_center/list_notification_configs.rb delete mode 100644 owl-bot-staging/google-cloud-security_center-v1/snippets/security_center/list_resource_value_configs.rb delete mode 100644 owl-bot-staging/google-cloud-security_center-v1/snippets/security_center/list_security_health_analytics_custom_modules.rb delete mode 100644 owl-bot-staging/google-cloud-security_center-v1/snippets/security_center/list_sources.rb delete mode 100644 owl-bot-staging/google-cloud-security_center-v1/snippets/security_center/list_valued_resources.rb delete mode 100644 owl-bot-staging/google-cloud-security_center-v1/snippets/security_center/run_asset_discovery.rb delete mode 100644 owl-bot-staging/google-cloud-security_center-v1/snippets/security_center/set_finding_state.rb delete mode 100644 owl-bot-staging/google-cloud-security_center-v1/snippets/security_center/set_iam_policy.rb delete mode 100644 owl-bot-staging/google-cloud-security_center-v1/snippets/security_center/set_mute.rb delete mode 100644 owl-bot-staging/google-cloud-security_center-v1/snippets/security_center/simulate_security_health_analytics_custom_module.rb delete mode 100644 owl-bot-staging/google-cloud-security_center-v1/snippets/security_center/test_iam_permissions.rb delete mode 100644 owl-bot-staging/google-cloud-security_center-v1/snippets/security_center/update_big_query_export.rb delete mode 100644 owl-bot-staging/google-cloud-security_center-v1/snippets/security_center/update_event_threat_detection_custom_module.rb delete mode 100644 owl-bot-staging/google-cloud-security_center-v1/snippets/security_center/update_external_system.rb delete mode 100644 owl-bot-staging/google-cloud-security_center-v1/snippets/security_center/update_finding.rb delete mode 100644 owl-bot-staging/google-cloud-security_center-v1/snippets/security_center/update_mute_config.rb delete mode 100644 owl-bot-staging/google-cloud-security_center-v1/snippets/security_center/update_notification_config.rb delete mode 100644 owl-bot-staging/google-cloud-security_center-v1/snippets/security_center/update_organization_settings.rb delete mode 100644 owl-bot-staging/google-cloud-security_center-v1/snippets/security_center/update_resource_value_config.rb delete mode 100644 owl-bot-staging/google-cloud-security_center-v1/snippets/security_center/update_security_health_analytics_custom_module.rb delete mode 100644 owl-bot-staging/google-cloud-security_center-v1/snippets/security_center/update_security_marks.rb delete mode 100644 owl-bot-staging/google-cloud-security_center-v1/snippets/security_center/update_source.rb delete mode 100644 owl-bot-staging/google-cloud-security_center-v1/snippets/security_center/validate_event_threat_detection_custom_module.rb delete mode 100644 owl-bot-staging/google-cloud-security_center-v1/snippets/snippet_metadata_google.cloud.securitycenter.v1.json delete mode 100644 owl-bot-staging/google-cloud-security_center-v1/test/google/cloud/security_center/v1/security_center_operations_test.rb delete mode 100644 owl-bot-staging/google-cloud-security_center-v1/test/google/cloud/security_center/v1/security_center_paths_test.rb delete mode 100644 owl-bot-staging/google-cloud-security_center-v1/test/google/cloud/security_center/v1/security_center_rest_test.rb delete mode 100644 owl-bot-staging/google-cloud-security_center-v1/test/google/cloud/security_center/v1/security_center_test.rb delete mode 100644 owl-bot-staging/google-cloud-security_center-v1/test/helper.rb delete mode 100644 owl-bot-staging/google-cloud-security_center-v1p1beta1/.gitignore delete mode 100644 owl-bot-staging/google-cloud-security_center-v1p1beta1/.repo-metadata.json delete mode 100644 owl-bot-staging/google-cloud-security_center-v1p1beta1/.rubocop.yml delete mode 100644 owl-bot-staging/google-cloud-security_center-v1p1beta1/.toys.rb delete mode 100644 owl-bot-staging/google-cloud-security_center-v1p1beta1/.yardopts delete mode 100644 owl-bot-staging/google-cloud-security_center-v1p1beta1/AUTHENTICATION.md delete mode 100644 owl-bot-staging/google-cloud-security_center-v1p1beta1/CHANGELOG.md delete mode 100644 owl-bot-staging/google-cloud-security_center-v1p1beta1/Gemfile delete mode 100644 owl-bot-staging/google-cloud-security_center-v1p1beta1/LICENSE.md delete mode 100644 owl-bot-staging/google-cloud-security_center-v1p1beta1/README.md delete mode 100644 owl-bot-staging/google-cloud-security_center-v1p1beta1/Rakefile delete mode 100644 owl-bot-staging/google-cloud-security_center-v1p1beta1/gapic_metadata.json delete mode 100644 owl-bot-staging/google-cloud-security_center-v1p1beta1/google-cloud-security_center-v1p1beta1.gemspec delete mode 100644 owl-bot-staging/google-cloud-security_center-v1p1beta1/lib/google-cloud-security_center-v1p1beta1.rb delete mode 100644 owl-bot-staging/google-cloud-security_center-v1p1beta1/lib/google/cloud/security_center/v1p1beta1.rb delete mode 100644 owl-bot-staging/google-cloud-security_center-v1p1beta1/lib/google/cloud/security_center/v1p1beta1/rest.rb delete mode 100644 owl-bot-staging/google-cloud-security_center-v1p1beta1/lib/google/cloud/security_center/v1p1beta1/security_center.rb delete mode 100644 owl-bot-staging/google-cloud-security_center-v1p1beta1/lib/google/cloud/security_center/v1p1beta1/security_center/client.rb delete mode 100644 owl-bot-staging/google-cloud-security_center-v1p1beta1/lib/google/cloud/security_center/v1p1beta1/security_center/credentials.rb delete mode 100644 owl-bot-staging/google-cloud-security_center-v1p1beta1/lib/google/cloud/security_center/v1p1beta1/security_center/operations.rb delete mode 100644 owl-bot-staging/google-cloud-security_center-v1p1beta1/lib/google/cloud/security_center/v1p1beta1/security_center/paths.rb delete mode 100644 owl-bot-staging/google-cloud-security_center-v1p1beta1/lib/google/cloud/security_center/v1p1beta1/security_center/rest.rb delete mode 100644 owl-bot-staging/google-cloud-security_center-v1p1beta1/lib/google/cloud/security_center/v1p1beta1/security_center/rest/client.rb delete mode 100644 owl-bot-staging/google-cloud-security_center-v1p1beta1/lib/google/cloud/security_center/v1p1beta1/security_center/rest/operations.rb delete mode 100644 owl-bot-staging/google-cloud-security_center-v1p1beta1/lib/google/cloud/security_center/v1p1beta1/security_center/rest/service_stub.rb delete mode 100644 owl-bot-staging/google-cloud-security_center-v1p1beta1/lib/google/cloud/security_center/v1p1beta1/version.rb delete mode 100644 owl-bot-staging/google-cloud-security_center-v1p1beta1/lib/google/cloud/securitycenter/v1p1beta1/asset_pb.rb delete mode 100644 owl-bot-staging/google-cloud-security_center-v1p1beta1/lib/google/cloud/securitycenter/v1p1beta1/finding_pb.rb delete mode 100644 owl-bot-staging/google-cloud-security_center-v1p1beta1/lib/google/cloud/securitycenter/v1p1beta1/folder_pb.rb delete mode 100644 owl-bot-staging/google-cloud-security_center-v1p1beta1/lib/google/cloud/securitycenter/v1p1beta1/notification_config_pb.rb delete mode 100644 owl-bot-staging/google-cloud-security_center-v1p1beta1/lib/google/cloud/securitycenter/v1p1beta1/notification_message_pb.rb delete mode 100644 owl-bot-staging/google-cloud-security_center-v1p1beta1/lib/google/cloud/securitycenter/v1p1beta1/organization_settings_pb.rb delete mode 100644 owl-bot-staging/google-cloud-security_center-v1p1beta1/lib/google/cloud/securitycenter/v1p1beta1/resource_pb.rb delete mode 100644 owl-bot-staging/google-cloud-security_center-v1p1beta1/lib/google/cloud/securitycenter/v1p1beta1/run_asset_discovery_response_pb.rb delete mode 100644 owl-bot-staging/google-cloud-security_center-v1p1beta1/lib/google/cloud/securitycenter/v1p1beta1/security_marks_pb.rb delete mode 100644 owl-bot-staging/google-cloud-security_center-v1p1beta1/lib/google/cloud/securitycenter/v1p1beta1/securitycenter_service_pb.rb delete mode 100644 owl-bot-staging/google-cloud-security_center-v1p1beta1/lib/google/cloud/securitycenter/v1p1beta1/securitycenter_service_services_pb.rb delete mode 100644 owl-bot-staging/google-cloud-security_center-v1p1beta1/lib/google/cloud/securitycenter/v1p1beta1/source_pb.rb delete mode 100644 owl-bot-staging/google-cloud-security_center-v1p1beta1/proto_docs/README.md delete mode 100644 owl-bot-staging/google-cloud-security_center-v1p1beta1/proto_docs/google/api/client.rb delete mode 100644 owl-bot-staging/google-cloud-security_center-v1p1beta1/proto_docs/google/api/field_behavior.rb delete mode 100644 owl-bot-staging/google-cloud-security_center-v1p1beta1/proto_docs/google/api/launch_stage.rb delete mode 100644 owl-bot-staging/google-cloud-security_center-v1p1beta1/proto_docs/google/api/resource.rb delete mode 100644 owl-bot-staging/google-cloud-security_center-v1p1beta1/proto_docs/google/cloud/securitycenter/v1p1beta1/asset.rb delete mode 100644 owl-bot-staging/google-cloud-security_center-v1p1beta1/proto_docs/google/cloud/securitycenter/v1p1beta1/finding.rb delete mode 100644 owl-bot-staging/google-cloud-security_center-v1p1beta1/proto_docs/google/cloud/securitycenter/v1p1beta1/folder.rb delete mode 100644 owl-bot-staging/google-cloud-security_center-v1p1beta1/proto_docs/google/cloud/securitycenter/v1p1beta1/notification_config.rb delete mode 100644 owl-bot-staging/google-cloud-security_center-v1p1beta1/proto_docs/google/cloud/securitycenter/v1p1beta1/notification_message.rb delete mode 100644 owl-bot-staging/google-cloud-security_center-v1p1beta1/proto_docs/google/cloud/securitycenter/v1p1beta1/organization_settings.rb delete mode 100644 owl-bot-staging/google-cloud-security_center-v1p1beta1/proto_docs/google/cloud/securitycenter/v1p1beta1/resource.rb delete mode 100644 owl-bot-staging/google-cloud-security_center-v1p1beta1/proto_docs/google/cloud/securitycenter/v1p1beta1/run_asset_discovery_response.rb delete mode 100644 owl-bot-staging/google-cloud-security_center-v1p1beta1/proto_docs/google/cloud/securitycenter/v1p1beta1/security_marks.rb delete mode 100644 owl-bot-staging/google-cloud-security_center-v1p1beta1/proto_docs/google/cloud/securitycenter/v1p1beta1/securitycenter_service.rb delete mode 100644 owl-bot-staging/google-cloud-security_center-v1p1beta1/proto_docs/google/cloud/securitycenter/v1p1beta1/source.rb delete mode 100644 owl-bot-staging/google-cloud-security_center-v1p1beta1/proto_docs/google/iam/v1/iam_policy.rb delete mode 100644 owl-bot-staging/google-cloud-security_center-v1p1beta1/proto_docs/google/iam/v1/options.rb delete mode 100644 owl-bot-staging/google-cloud-security_center-v1p1beta1/proto_docs/google/iam/v1/policy.rb delete mode 100644 owl-bot-staging/google-cloud-security_center-v1p1beta1/proto_docs/google/longrunning/operations.rb delete mode 100644 owl-bot-staging/google-cloud-security_center-v1p1beta1/proto_docs/google/protobuf/any.rb delete mode 100644 owl-bot-staging/google-cloud-security_center-v1p1beta1/proto_docs/google/protobuf/duration.rb delete mode 100644 owl-bot-staging/google-cloud-security_center-v1p1beta1/proto_docs/google/protobuf/empty.rb delete mode 100644 owl-bot-staging/google-cloud-security_center-v1p1beta1/proto_docs/google/protobuf/field_mask.rb delete mode 100644 owl-bot-staging/google-cloud-security_center-v1p1beta1/proto_docs/google/protobuf/struct.rb delete mode 100644 owl-bot-staging/google-cloud-security_center-v1p1beta1/proto_docs/google/protobuf/timestamp.rb delete mode 100644 owl-bot-staging/google-cloud-security_center-v1p1beta1/proto_docs/google/rpc/status.rb delete mode 100644 owl-bot-staging/google-cloud-security_center-v1p1beta1/proto_docs/google/type/expr.rb delete mode 100644 owl-bot-staging/google-cloud-security_center-v1p1beta1/snippets/Gemfile delete mode 100644 owl-bot-staging/google-cloud-security_center-v1p1beta1/snippets/security_center/create_finding.rb delete mode 100644 owl-bot-staging/google-cloud-security_center-v1p1beta1/snippets/security_center/create_notification_config.rb delete mode 100644 owl-bot-staging/google-cloud-security_center-v1p1beta1/snippets/security_center/create_source.rb delete mode 100644 owl-bot-staging/google-cloud-security_center-v1p1beta1/snippets/security_center/delete_notification_config.rb delete mode 100644 owl-bot-staging/google-cloud-security_center-v1p1beta1/snippets/security_center/get_iam_policy.rb delete mode 100644 owl-bot-staging/google-cloud-security_center-v1p1beta1/snippets/security_center/get_notification_config.rb delete mode 100644 owl-bot-staging/google-cloud-security_center-v1p1beta1/snippets/security_center/get_organization_settings.rb delete mode 100644 owl-bot-staging/google-cloud-security_center-v1p1beta1/snippets/security_center/get_source.rb delete mode 100644 owl-bot-staging/google-cloud-security_center-v1p1beta1/snippets/security_center/group_assets.rb delete mode 100644 owl-bot-staging/google-cloud-security_center-v1p1beta1/snippets/security_center/group_findings.rb delete mode 100644 owl-bot-staging/google-cloud-security_center-v1p1beta1/snippets/security_center/list_assets.rb delete mode 100644 owl-bot-staging/google-cloud-security_center-v1p1beta1/snippets/security_center/list_findings.rb delete mode 100644 owl-bot-staging/google-cloud-security_center-v1p1beta1/snippets/security_center/list_notification_configs.rb delete mode 100644 owl-bot-staging/google-cloud-security_center-v1p1beta1/snippets/security_center/list_sources.rb delete mode 100644 owl-bot-staging/google-cloud-security_center-v1p1beta1/snippets/security_center/run_asset_discovery.rb delete mode 100644 owl-bot-staging/google-cloud-security_center-v1p1beta1/snippets/security_center/set_finding_state.rb delete mode 100644 owl-bot-staging/google-cloud-security_center-v1p1beta1/snippets/security_center/set_iam_policy.rb delete mode 100644 owl-bot-staging/google-cloud-security_center-v1p1beta1/snippets/security_center/test_iam_permissions.rb delete mode 100644 owl-bot-staging/google-cloud-security_center-v1p1beta1/snippets/security_center/update_finding.rb delete mode 100644 owl-bot-staging/google-cloud-security_center-v1p1beta1/snippets/security_center/update_notification_config.rb delete mode 100644 owl-bot-staging/google-cloud-security_center-v1p1beta1/snippets/security_center/update_organization_settings.rb delete mode 100644 owl-bot-staging/google-cloud-security_center-v1p1beta1/snippets/security_center/update_security_marks.rb delete mode 100644 owl-bot-staging/google-cloud-security_center-v1p1beta1/snippets/security_center/update_source.rb delete mode 100644 owl-bot-staging/google-cloud-security_center-v1p1beta1/snippets/snippet_metadata_google.cloud.securitycenter.v1p1beta1.json delete mode 100644 owl-bot-staging/google-cloud-security_center-v1p1beta1/test/google/cloud/security_center/v1p1beta1/security_center_operations_test.rb delete mode 100644 owl-bot-staging/google-cloud-security_center-v1p1beta1/test/google/cloud/security_center/v1p1beta1/security_center_paths_test.rb delete mode 100644 owl-bot-staging/google-cloud-security_center-v1p1beta1/test/google/cloud/security_center/v1p1beta1/security_center_rest_test.rb delete mode 100644 owl-bot-staging/google-cloud-security_center-v1p1beta1/test/google/cloud/security_center/v1p1beta1/security_center_test.rb delete mode 100644 owl-bot-staging/google-cloud-security_center-v1p1beta1/test/helper.rb delete mode 100644 owl-bot-staging/google-cloud-security_center-v2/.gitignore delete mode 100644 owl-bot-staging/google-cloud-security_center-v2/.repo-metadata.json delete mode 100644 owl-bot-staging/google-cloud-security_center-v2/.rubocop.yml delete mode 100644 owl-bot-staging/google-cloud-security_center-v2/.toys.rb delete mode 100644 owl-bot-staging/google-cloud-security_center-v2/.yardopts delete mode 100644 owl-bot-staging/google-cloud-security_center-v2/AUTHENTICATION.md delete mode 100644 owl-bot-staging/google-cloud-security_center-v2/CHANGELOG.md delete mode 100644 owl-bot-staging/google-cloud-security_center-v2/Gemfile delete mode 100644 owl-bot-staging/google-cloud-security_center-v2/LICENSE.md delete mode 100644 owl-bot-staging/google-cloud-security_center-v2/README.md delete mode 100644 owl-bot-staging/google-cloud-security_center-v2/Rakefile delete mode 100644 owl-bot-staging/google-cloud-security_center-v2/gapic_metadata.json delete mode 100644 owl-bot-staging/google-cloud-security_center-v2/google-cloud-security_center-v2.gemspec delete mode 100644 owl-bot-staging/google-cloud-security_center-v2/lib/google-cloud-security_center-v2.rb delete mode 100644 owl-bot-staging/google-cloud-security_center-v2/lib/google/cloud/security_center/v2.rb delete mode 100644 owl-bot-staging/google-cloud-security_center-v2/lib/google/cloud/security_center/v2/rest.rb delete mode 100644 owl-bot-staging/google-cloud-security_center-v2/lib/google/cloud/security_center/v2/security_center.rb delete mode 100644 owl-bot-staging/google-cloud-security_center-v2/lib/google/cloud/security_center/v2/security_center/client.rb delete mode 100644 owl-bot-staging/google-cloud-security_center-v2/lib/google/cloud/security_center/v2/security_center/credentials.rb delete mode 100644 owl-bot-staging/google-cloud-security_center-v2/lib/google/cloud/security_center/v2/security_center/operations.rb delete mode 100644 owl-bot-staging/google-cloud-security_center-v2/lib/google/cloud/security_center/v2/security_center/paths.rb delete mode 100644 owl-bot-staging/google-cloud-security_center-v2/lib/google/cloud/security_center/v2/security_center/rest.rb delete mode 100644 owl-bot-staging/google-cloud-security_center-v2/lib/google/cloud/security_center/v2/security_center/rest/client.rb delete mode 100644 owl-bot-staging/google-cloud-security_center-v2/lib/google/cloud/security_center/v2/security_center/rest/operations.rb delete mode 100644 owl-bot-staging/google-cloud-security_center-v2/lib/google/cloud/security_center/v2/security_center/rest/service_stub.rb delete mode 100644 owl-bot-staging/google-cloud-security_center-v2/lib/google/cloud/security_center/v2/version.rb delete mode 100644 owl-bot-staging/google-cloud-security_center-v2/lib/google/cloud/securitycenter/v2/access_pb.rb delete mode 100644 owl-bot-staging/google-cloud-security_center-v2/lib/google/cloud/securitycenter/v2/affected_resources_pb.rb delete mode 100644 owl-bot-staging/google-cloud-security_center-v2/lib/google/cloud/securitycenter/v2/ai_model_pb.rb delete mode 100644 owl-bot-staging/google-cloud-security_center-v2/lib/google/cloud/securitycenter/v2/application_pb.rb delete mode 100644 owl-bot-staging/google-cloud-security_center-v2/lib/google/cloud/securitycenter/v2/attack_exposure_pb.rb delete mode 100644 owl-bot-staging/google-cloud-security_center-v2/lib/google/cloud/securitycenter/v2/attack_path_pb.rb delete mode 100644 owl-bot-staging/google-cloud-security_center-v2/lib/google/cloud/securitycenter/v2/backup_disaster_recovery_pb.rb delete mode 100644 owl-bot-staging/google-cloud-security_center-v2/lib/google/cloud/securitycenter/v2/bigquery_export_pb.rb delete mode 100644 owl-bot-staging/google-cloud-security_center-v2/lib/google/cloud/securitycenter/v2/chokepoint_pb.rb delete mode 100644 owl-bot-staging/google-cloud-security_center-v2/lib/google/cloud/securitycenter/v2/cloud_armor_pb.rb delete mode 100644 owl-bot-staging/google-cloud-security_center-v2/lib/google/cloud/securitycenter/v2/cloud_dlp_data_profile_pb.rb delete mode 100644 owl-bot-staging/google-cloud-security_center-v2/lib/google/cloud/securitycenter/v2/cloud_dlp_inspection_pb.rb delete mode 100644 owl-bot-staging/google-cloud-security_center-v2/lib/google/cloud/securitycenter/v2/compliance_pb.rb delete mode 100644 owl-bot-staging/google-cloud-security_center-v2/lib/google/cloud/securitycenter/v2/connection_pb.rb delete mode 100644 owl-bot-staging/google-cloud-security_center-v2/lib/google/cloud/securitycenter/v2/contact_details_pb.rb delete mode 100644 owl-bot-staging/google-cloud-security_center-v2/lib/google/cloud/securitycenter/v2/container_pb.rb delete mode 100644 owl-bot-staging/google-cloud-security_center-v2/lib/google/cloud/securitycenter/v2/data_access_event_pb.rb delete mode 100644 owl-bot-staging/google-cloud-security_center-v2/lib/google/cloud/securitycenter/v2/data_flow_event_pb.rb delete mode 100644 owl-bot-staging/google-cloud-security_center-v2/lib/google/cloud/securitycenter/v2/data_retention_deletion_event_pb.rb delete mode 100644 owl-bot-staging/google-cloud-security_center-v2/lib/google/cloud/securitycenter/v2/database_pb.rb delete mode 100644 owl-bot-staging/google-cloud-security_center-v2/lib/google/cloud/securitycenter/v2/disk_pb.rb delete mode 100644 owl-bot-staging/google-cloud-security_center-v2/lib/google/cloud/securitycenter/v2/exfiltration_pb.rb delete mode 100644 owl-bot-staging/google-cloud-security_center-v2/lib/google/cloud/securitycenter/v2/external_system_pb.rb delete mode 100644 owl-bot-staging/google-cloud-security_center-v2/lib/google/cloud/securitycenter/v2/file_pb.rb delete mode 100644 owl-bot-staging/google-cloud-security_center-v2/lib/google/cloud/securitycenter/v2/finding_pb.rb delete mode 100644 owl-bot-staging/google-cloud-security_center-v2/lib/google/cloud/securitycenter/v2/folder_pb.rb delete mode 100644 owl-bot-staging/google-cloud-security_center-v2/lib/google/cloud/securitycenter/v2/group_membership_pb.rb delete mode 100644 owl-bot-staging/google-cloud-security_center-v2/lib/google/cloud/securitycenter/v2/iam_binding_pb.rb delete mode 100644 owl-bot-staging/google-cloud-security_center-v2/lib/google/cloud/securitycenter/v2/indicator_pb.rb delete mode 100644 owl-bot-staging/google-cloud-security_center-v2/lib/google/cloud/securitycenter/v2/ip_rules_pb.rb delete mode 100644 owl-bot-staging/google-cloud-security_center-v2/lib/google/cloud/securitycenter/v2/job_pb.rb delete mode 100644 owl-bot-staging/google-cloud-security_center-v2/lib/google/cloud/securitycenter/v2/kernel_rootkit_pb.rb delete mode 100644 owl-bot-staging/google-cloud-security_center-v2/lib/google/cloud/securitycenter/v2/kubernetes_pb.rb delete mode 100644 owl-bot-staging/google-cloud-security_center-v2/lib/google/cloud/securitycenter/v2/label_pb.rb delete mode 100644 owl-bot-staging/google-cloud-security_center-v2/lib/google/cloud/securitycenter/v2/load_balancer_pb.rb delete mode 100644 owl-bot-staging/google-cloud-security_center-v2/lib/google/cloud/securitycenter/v2/log_entry_pb.rb delete mode 100644 owl-bot-staging/google-cloud-security_center-v2/lib/google/cloud/securitycenter/v2/mitre_attack_pb.rb delete mode 100644 owl-bot-staging/google-cloud-security_center-v2/lib/google/cloud/securitycenter/v2/mute_config_pb.rb delete mode 100644 owl-bot-staging/google-cloud-security_center-v2/lib/google/cloud/securitycenter/v2/network_pb.rb delete mode 100644 owl-bot-staging/google-cloud-security_center-v2/lib/google/cloud/securitycenter/v2/notebook_pb.rb delete mode 100644 owl-bot-staging/google-cloud-security_center-v2/lib/google/cloud/securitycenter/v2/notification_config_pb.rb delete mode 100644 owl-bot-staging/google-cloud-security_center-v2/lib/google/cloud/securitycenter/v2/notification_message_pb.rb delete mode 100644 owl-bot-staging/google-cloud-security_center-v2/lib/google/cloud/securitycenter/v2/org_policy_pb.rb delete mode 100644 owl-bot-staging/google-cloud-security_center-v2/lib/google/cloud/securitycenter/v2/process_pb.rb delete mode 100644 owl-bot-staging/google-cloud-security_center-v2/lib/google/cloud/securitycenter/v2/resource_pb.rb delete mode 100644 owl-bot-staging/google-cloud-security_center-v2/lib/google/cloud/securitycenter/v2/resource_value_config_pb.rb delete mode 100644 owl-bot-staging/google-cloud-security_center-v2/lib/google/cloud/securitycenter/v2/security_marks_pb.rb delete mode 100644 owl-bot-staging/google-cloud-security_center-v2/lib/google/cloud/securitycenter/v2/security_posture_pb.rb delete mode 100644 owl-bot-staging/google-cloud-security_center-v2/lib/google/cloud/securitycenter/v2/securitycenter_service_pb.rb delete mode 100644 owl-bot-staging/google-cloud-security_center-v2/lib/google/cloud/securitycenter/v2/securitycenter_service_services_pb.rb delete mode 100644 owl-bot-staging/google-cloud-security_center-v2/lib/google/cloud/securitycenter/v2/simulation_pb.rb delete mode 100644 owl-bot-staging/google-cloud-security_center-v2/lib/google/cloud/securitycenter/v2/source_pb.rb delete mode 100644 owl-bot-staging/google-cloud-security_center-v2/lib/google/cloud/securitycenter/v2/toxic_combination_pb.rb delete mode 100644 owl-bot-staging/google-cloud-security_center-v2/lib/google/cloud/securitycenter/v2/valued_resource_pb.rb delete mode 100644 owl-bot-staging/google-cloud-security_center-v2/lib/google/cloud/securitycenter/v2/vertex_ai_pb.rb delete mode 100644 owl-bot-staging/google-cloud-security_center-v2/lib/google/cloud/securitycenter/v2/vulnerability_pb.rb delete mode 100644 owl-bot-staging/google-cloud-security_center-v2/proto_docs/README.md delete mode 100644 owl-bot-staging/google-cloud-security_center-v2/proto_docs/google/api/client.rb delete mode 100644 owl-bot-staging/google-cloud-security_center-v2/proto_docs/google/api/field_behavior.rb delete mode 100644 owl-bot-staging/google-cloud-security_center-v2/proto_docs/google/api/launch_stage.rb delete mode 100644 owl-bot-staging/google-cloud-security_center-v2/proto_docs/google/api/resource.rb delete mode 100644 owl-bot-staging/google-cloud-security_center-v2/proto_docs/google/api/routing.rb delete mode 100644 owl-bot-staging/google-cloud-security_center-v2/proto_docs/google/cloud/securitycenter/v2/access.rb delete mode 100644 owl-bot-staging/google-cloud-security_center-v2/proto_docs/google/cloud/securitycenter/v2/affected_resources.rb delete mode 100644 owl-bot-staging/google-cloud-security_center-v2/proto_docs/google/cloud/securitycenter/v2/ai_model.rb delete mode 100644 owl-bot-staging/google-cloud-security_center-v2/proto_docs/google/cloud/securitycenter/v2/application.rb delete mode 100644 owl-bot-staging/google-cloud-security_center-v2/proto_docs/google/cloud/securitycenter/v2/attack_exposure.rb delete mode 100644 owl-bot-staging/google-cloud-security_center-v2/proto_docs/google/cloud/securitycenter/v2/attack_path.rb delete mode 100644 owl-bot-staging/google-cloud-security_center-v2/proto_docs/google/cloud/securitycenter/v2/backup_disaster_recovery.rb delete mode 100644 owl-bot-staging/google-cloud-security_center-v2/proto_docs/google/cloud/securitycenter/v2/bigquery_export.rb delete mode 100644 owl-bot-staging/google-cloud-security_center-v2/proto_docs/google/cloud/securitycenter/v2/chokepoint.rb delete mode 100644 owl-bot-staging/google-cloud-security_center-v2/proto_docs/google/cloud/securitycenter/v2/cloud_armor.rb delete mode 100644 owl-bot-staging/google-cloud-security_center-v2/proto_docs/google/cloud/securitycenter/v2/cloud_dlp_data_profile.rb delete mode 100644 owl-bot-staging/google-cloud-security_center-v2/proto_docs/google/cloud/securitycenter/v2/cloud_dlp_inspection.rb delete mode 100644 owl-bot-staging/google-cloud-security_center-v2/proto_docs/google/cloud/securitycenter/v2/compliance.rb delete mode 100644 owl-bot-staging/google-cloud-security_center-v2/proto_docs/google/cloud/securitycenter/v2/connection.rb delete mode 100644 owl-bot-staging/google-cloud-security_center-v2/proto_docs/google/cloud/securitycenter/v2/contact_details.rb delete mode 100644 owl-bot-staging/google-cloud-security_center-v2/proto_docs/google/cloud/securitycenter/v2/container.rb delete mode 100644 owl-bot-staging/google-cloud-security_center-v2/proto_docs/google/cloud/securitycenter/v2/data_access_event.rb delete mode 100644 owl-bot-staging/google-cloud-security_center-v2/proto_docs/google/cloud/securitycenter/v2/data_flow_event.rb delete mode 100644 owl-bot-staging/google-cloud-security_center-v2/proto_docs/google/cloud/securitycenter/v2/data_retention_deletion_event.rb delete mode 100644 owl-bot-staging/google-cloud-security_center-v2/proto_docs/google/cloud/securitycenter/v2/database.rb delete mode 100644 owl-bot-staging/google-cloud-security_center-v2/proto_docs/google/cloud/securitycenter/v2/disk.rb delete mode 100644 owl-bot-staging/google-cloud-security_center-v2/proto_docs/google/cloud/securitycenter/v2/exfiltration.rb delete mode 100644 owl-bot-staging/google-cloud-security_center-v2/proto_docs/google/cloud/securitycenter/v2/external_system.rb delete mode 100644 owl-bot-staging/google-cloud-security_center-v2/proto_docs/google/cloud/securitycenter/v2/file.rb delete mode 100644 owl-bot-staging/google-cloud-security_center-v2/proto_docs/google/cloud/securitycenter/v2/finding.rb delete mode 100644 owl-bot-staging/google-cloud-security_center-v2/proto_docs/google/cloud/securitycenter/v2/folder.rb delete mode 100644 owl-bot-staging/google-cloud-security_center-v2/proto_docs/google/cloud/securitycenter/v2/group_membership.rb delete mode 100644 owl-bot-staging/google-cloud-security_center-v2/proto_docs/google/cloud/securitycenter/v2/iam_binding.rb delete mode 100644 owl-bot-staging/google-cloud-security_center-v2/proto_docs/google/cloud/securitycenter/v2/indicator.rb delete mode 100644 owl-bot-staging/google-cloud-security_center-v2/proto_docs/google/cloud/securitycenter/v2/ip_rules.rb delete mode 100644 owl-bot-staging/google-cloud-security_center-v2/proto_docs/google/cloud/securitycenter/v2/job.rb delete mode 100644 owl-bot-staging/google-cloud-security_center-v2/proto_docs/google/cloud/securitycenter/v2/kernel_rootkit.rb delete mode 100644 owl-bot-staging/google-cloud-security_center-v2/proto_docs/google/cloud/securitycenter/v2/kubernetes.rb delete mode 100644 owl-bot-staging/google-cloud-security_center-v2/proto_docs/google/cloud/securitycenter/v2/label.rb delete mode 100644 owl-bot-staging/google-cloud-security_center-v2/proto_docs/google/cloud/securitycenter/v2/load_balancer.rb delete mode 100644 owl-bot-staging/google-cloud-security_center-v2/proto_docs/google/cloud/securitycenter/v2/log_entry.rb delete mode 100644 owl-bot-staging/google-cloud-security_center-v2/proto_docs/google/cloud/securitycenter/v2/mitre_attack.rb delete mode 100644 owl-bot-staging/google-cloud-security_center-v2/proto_docs/google/cloud/securitycenter/v2/mute_config.rb delete mode 100644 owl-bot-staging/google-cloud-security_center-v2/proto_docs/google/cloud/securitycenter/v2/network.rb delete mode 100644 owl-bot-staging/google-cloud-security_center-v2/proto_docs/google/cloud/securitycenter/v2/notebook.rb delete mode 100644 owl-bot-staging/google-cloud-security_center-v2/proto_docs/google/cloud/securitycenter/v2/notification_config.rb delete mode 100644 owl-bot-staging/google-cloud-security_center-v2/proto_docs/google/cloud/securitycenter/v2/notification_message.rb delete mode 100644 owl-bot-staging/google-cloud-security_center-v2/proto_docs/google/cloud/securitycenter/v2/org_policy.rb delete mode 100644 owl-bot-staging/google-cloud-security_center-v2/proto_docs/google/cloud/securitycenter/v2/process.rb delete mode 100644 owl-bot-staging/google-cloud-security_center-v2/proto_docs/google/cloud/securitycenter/v2/resource.rb delete mode 100644 owl-bot-staging/google-cloud-security_center-v2/proto_docs/google/cloud/securitycenter/v2/resource_value_config.rb delete mode 100644 owl-bot-staging/google-cloud-security_center-v2/proto_docs/google/cloud/securitycenter/v2/security_marks.rb delete mode 100644 owl-bot-staging/google-cloud-security_center-v2/proto_docs/google/cloud/securitycenter/v2/security_posture.rb delete mode 100644 owl-bot-staging/google-cloud-security_center-v2/proto_docs/google/cloud/securitycenter/v2/securitycenter_service.rb delete mode 100644 owl-bot-staging/google-cloud-security_center-v2/proto_docs/google/cloud/securitycenter/v2/simulation.rb delete mode 100644 owl-bot-staging/google-cloud-security_center-v2/proto_docs/google/cloud/securitycenter/v2/source.rb delete mode 100644 owl-bot-staging/google-cloud-security_center-v2/proto_docs/google/cloud/securitycenter/v2/toxic_combination.rb delete mode 100644 owl-bot-staging/google-cloud-security_center-v2/proto_docs/google/cloud/securitycenter/v2/valued_resource.rb delete mode 100644 owl-bot-staging/google-cloud-security_center-v2/proto_docs/google/cloud/securitycenter/v2/vertex_ai.rb delete mode 100644 owl-bot-staging/google-cloud-security_center-v2/proto_docs/google/cloud/securitycenter/v2/vulnerability.rb delete mode 100644 owl-bot-staging/google-cloud-security_center-v2/proto_docs/google/iam/v1/iam_policy.rb delete mode 100644 owl-bot-staging/google-cloud-security_center-v2/proto_docs/google/iam/v1/options.rb delete mode 100644 owl-bot-staging/google-cloud-security_center-v2/proto_docs/google/iam/v1/policy.rb delete mode 100644 owl-bot-staging/google-cloud-security_center-v2/proto_docs/google/longrunning/operations.rb delete mode 100644 owl-bot-staging/google-cloud-security_center-v2/proto_docs/google/protobuf/any.rb delete mode 100644 owl-bot-staging/google-cloud-security_center-v2/proto_docs/google/protobuf/duration.rb delete mode 100644 owl-bot-staging/google-cloud-security_center-v2/proto_docs/google/protobuf/empty.rb delete mode 100644 owl-bot-staging/google-cloud-security_center-v2/proto_docs/google/protobuf/field_mask.rb delete mode 100644 owl-bot-staging/google-cloud-security_center-v2/proto_docs/google/protobuf/struct.rb delete mode 100644 owl-bot-staging/google-cloud-security_center-v2/proto_docs/google/protobuf/timestamp.rb delete mode 100644 owl-bot-staging/google-cloud-security_center-v2/proto_docs/google/rpc/status.rb delete mode 100644 owl-bot-staging/google-cloud-security_center-v2/proto_docs/google/type/expr.rb delete mode 100644 owl-bot-staging/google-cloud-security_center-v2/snippets/Gemfile delete mode 100644 owl-bot-staging/google-cloud-security_center-v2/snippets/security_center/batch_create_resource_value_configs.rb delete mode 100644 owl-bot-staging/google-cloud-security_center-v2/snippets/security_center/bulk_mute_findings.rb delete mode 100644 owl-bot-staging/google-cloud-security_center-v2/snippets/security_center/create_big_query_export.rb delete mode 100644 owl-bot-staging/google-cloud-security_center-v2/snippets/security_center/create_finding.rb delete mode 100644 owl-bot-staging/google-cloud-security_center-v2/snippets/security_center/create_mute_config.rb delete mode 100644 owl-bot-staging/google-cloud-security_center-v2/snippets/security_center/create_notification_config.rb delete mode 100644 owl-bot-staging/google-cloud-security_center-v2/snippets/security_center/create_source.rb delete mode 100644 owl-bot-staging/google-cloud-security_center-v2/snippets/security_center/delete_big_query_export.rb delete mode 100644 owl-bot-staging/google-cloud-security_center-v2/snippets/security_center/delete_mute_config.rb delete mode 100644 owl-bot-staging/google-cloud-security_center-v2/snippets/security_center/delete_notification_config.rb delete mode 100644 owl-bot-staging/google-cloud-security_center-v2/snippets/security_center/delete_resource_value_config.rb delete mode 100644 owl-bot-staging/google-cloud-security_center-v2/snippets/security_center/get_big_query_export.rb delete mode 100644 owl-bot-staging/google-cloud-security_center-v2/snippets/security_center/get_iam_policy.rb delete mode 100644 owl-bot-staging/google-cloud-security_center-v2/snippets/security_center/get_mute_config.rb delete mode 100644 owl-bot-staging/google-cloud-security_center-v2/snippets/security_center/get_notification_config.rb delete mode 100644 owl-bot-staging/google-cloud-security_center-v2/snippets/security_center/get_resource_value_config.rb delete mode 100644 owl-bot-staging/google-cloud-security_center-v2/snippets/security_center/get_simulation.rb delete mode 100644 owl-bot-staging/google-cloud-security_center-v2/snippets/security_center/get_source.rb delete mode 100644 owl-bot-staging/google-cloud-security_center-v2/snippets/security_center/get_valued_resource.rb delete mode 100644 owl-bot-staging/google-cloud-security_center-v2/snippets/security_center/group_findings.rb delete mode 100644 owl-bot-staging/google-cloud-security_center-v2/snippets/security_center/list_attack_paths.rb delete mode 100644 owl-bot-staging/google-cloud-security_center-v2/snippets/security_center/list_big_query_exports.rb delete mode 100644 owl-bot-staging/google-cloud-security_center-v2/snippets/security_center/list_findings.rb delete mode 100644 owl-bot-staging/google-cloud-security_center-v2/snippets/security_center/list_mute_configs.rb delete mode 100644 owl-bot-staging/google-cloud-security_center-v2/snippets/security_center/list_notification_configs.rb delete mode 100644 owl-bot-staging/google-cloud-security_center-v2/snippets/security_center/list_resource_value_configs.rb delete mode 100644 owl-bot-staging/google-cloud-security_center-v2/snippets/security_center/list_sources.rb delete mode 100644 owl-bot-staging/google-cloud-security_center-v2/snippets/security_center/list_valued_resources.rb delete mode 100644 owl-bot-staging/google-cloud-security_center-v2/snippets/security_center/set_finding_state.rb delete mode 100644 owl-bot-staging/google-cloud-security_center-v2/snippets/security_center/set_iam_policy.rb delete mode 100644 owl-bot-staging/google-cloud-security_center-v2/snippets/security_center/set_mute.rb delete mode 100644 owl-bot-staging/google-cloud-security_center-v2/snippets/security_center/test_iam_permissions.rb delete mode 100644 owl-bot-staging/google-cloud-security_center-v2/snippets/security_center/update_big_query_export.rb delete mode 100644 owl-bot-staging/google-cloud-security_center-v2/snippets/security_center/update_external_system.rb delete mode 100644 owl-bot-staging/google-cloud-security_center-v2/snippets/security_center/update_finding.rb delete mode 100644 owl-bot-staging/google-cloud-security_center-v2/snippets/security_center/update_mute_config.rb delete mode 100644 owl-bot-staging/google-cloud-security_center-v2/snippets/security_center/update_notification_config.rb delete mode 100644 owl-bot-staging/google-cloud-security_center-v2/snippets/security_center/update_resource_value_config.rb delete mode 100644 owl-bot-staging/google-cloud-security_center-v2/snippets/security_center/update_security_marks.rb delete mode 100644 owl-bot-staging/google-cloud-security_center-v2/snippets/security_center/update_source.rb delete mode 100644 owl-bot-staging/google-cloud-security_center-v2/snippets/snippet_metadata_google.cloud.securitycenter.v2.json delete mode 100644 owl-bot-staging/google-cloud-security_center-v2/test/google/cloud/security_center/v2/security_center_operations_test.rb delete mode 100644 owl-bot-staging/google-cloud-security_center-v2/test/google/cloud/security_center/v2/security_center_paths_test.rb delete mode 100644 owl-bot-staging/google-cloud-security_center-v2/test/google/cloud/security_center/v2/security_center_rest_test.rb delete mode 100644 owl-bot-staging/google-cloud-security_center-v2/test/google/cloud/security_center/v2/security_center_test.rb delete mode 100644 owl-bot-staging/google-cloud-security_center-v2/test/helper.rb delete mode 100644 owl-bot-staging/google-cloud-security_center_management-v1/.gitignore delete mode 100644 owl-bot-staging/google-cloud-security_center_management-v1/.repo-metadata.json delete mode 100644 owl-bot-staging/google-cloud-security_center_management-v1/.rubocop.yml delete mode 100644 owl-bot-staging/google-cloud-security_center_management-v1/.toys.rb delete mode 100644 owl-bot-staging/google-cloud-security_center_management-v1/.yardopts delete mode 100644 owl-bot-staging/google-cloud-security_center_management-v1/AUTHENTICATION.md delete mode 100644 owl-bot-staging/google-cloud-security_center_management-v1/CHANGELOG.md delete mode 100644 owl-bot-staging/google-cloud-security_center_management-v1/Gemfile delete mode 100644 owl-bot-staging/google-cloud-security_center_management-v1/LICENSE.md delete mode 100644 owl-bot-staging/google-cloud-security_center_management-v1/README.md delete mode 100644 owl-bot-staging/google-cloud-security_center_management-v1/Rakefile delete mode 100644 owl-bot-staging/google-cloud-security_center_management-v1/gapic_metadata.json delete mode 100644 owl-bot-staging/google-cloud-security_center_management-v1/google-cloud-security_center_management-v1.gemspec delete mode 100644 owl-bot-staging/google-cloud-security_center_management-v1/lib/google-cloud-security_center_management-v1.rb delete mode 100644 owl-bot-staging/google-cloud-security_center_management-v1/lib/google/cloud/security_center_management/v1.rb delete mode 100644 owl-bot-staging/google-cloud-security_center_management-v1/lib/google/cloud/security_center_management/v1/bindings_override.rb delete mode 100644 owl-bot-staging/google-cloud-security_center_management-v1/lib/google/cloud/security_center_management/v1/rest.rb delete mode 100644 owl-bot-staging/google-cloud-security_center_management-v1/lib/google/cloud/security_center_management/v1/security_center_management.rb delete mode 100644 owl-bot-staging/google-cloud-security_center_management-v1/lib/google/cloud/security_center_management/v1/security_center_management/client.rb delete mode 100644 owl-bot-staging/google-cloud-security_center_management-v1/lib/google/cloud/security_center_management/v1/security_center_management/credentials.rb delete mode 100644 owl-bot-staging/google-cloud-security_center_management-v1/lib/google/cloud/security_center_management/v1/security_center_management/paths.rb delete mode 100644 owl-bot-staging/google-cloud-security_center_management-v1/lib/google/cloud/security_center_management/v1/security_center_management/rest.rb delete mode 100644 owl-bot-staging/google-cloud-security_center_management-v1/lib/google/cloud/security_center_management/v1/security_center_management/rest/client.rb delete mode 100644 owl-bot-staging/google-cloud-security_center_management-v1/lib/google/cloud/security_center_management/v1/security_center_management/rest/service_stub.rb delete mode 100644 owl-bot-staging/google-cloud-security_center_management-v1/lib/google/cloud/security_center_management/v1/version.rb delete mode 100644 owl-bot-staging/google-cloud-security_center_management-v1/lib/google/cloud/securitycentermanagement/v1/security_center_management_pb.rb delete mode 100644 owl-bot-staging/google-cloud-security_center_management-v1/lib/google/cloud/securitycentermanagement/v1/security_center_management_services_pb.rb delete mode 100644 owl-bot-staging/google-cloud-security_center_management-v1/proto_docs/README.md delete mode 100644 owl-bot-staging/google-cloud-security_center_management-v1/proto_docs/google/api/client.rb delete mode 100644 owl-bot-staging/google-cloud-security_center_management-v1/proto_docs/google/api/field_behavior.rb delete mode 100644 owl-bot-staging/google-cloud-security_center_management-v1/proto_docs/google/api/launch_stage.rb delete mode 100644 owl-bot-staging/google-cloud-security_center_management-v1/proto_docs/google/api/resource.rb delete mode 100644 owl-bot-staging/google-cloud-security_center_management-v1/proto_docs/google/cloud/securitycentermanagement/v1/security_center_management.rb delete mode 100644 owl-bot-staging/google-cloud-security_center_management-v1/proto_docs/google/iam/v1/policy.rb delete mode 100644 owl-bot-staging/google-cloud-security_center_management-v1/proto_docs/google/protobuf/any.rb delete mode 100644 owl-bot-staging/google-cloud-security_center_management-v1/proto_docs/google/protobuf/duration.rb delete mode 100644 owl-bot-staging/google-cloud-security_center_management-v1/proto_docs/google/protobuf/empty.rb delete mode 100644 owl-bot-staging/google-cloud-security_center_management-v1/proto_docs/google/protobuf/field_mask.rb delete mode 100644 owl-bot-staging/google-cloud-security_center_management-v1/proto_docs/google/protobuf/struct.rb delete mode 100644 owl-bot-staging/google-cloud-security_center_management-v1/proto_docs/google/protobuf/timestamp.rb delete mode 100644 owl-bot-staging/google-cloud-security_center_management-v1/proto_docs/google/rpc/status.rb delete mode 100644 owl-bot-staging/google-cloud-security_center_management-v1/proto_docs/google/type/expr.rb delete mode 100644 owl-bot-staging/google-cloud-security_center_management-v1/snippets/Gemfile delete mode 100644 owl-bot-staging/google-cloud-security_center_management-v1/snippets/security_center_management/create_event_threat_detection_custom_module.rb delete mode 100644 owl-bot-staging/google-cloud-security_center_management-v1/snippets/security_center_management/create_security_health_analytics_custom_module.rb delete mode 100644 owl-bot-staging/google-cloud-security_center_management-v1/snippets/security_center_management/delete_event_threat_detection_custom_module.rb delete mode 100644 owl-bot-staging/google-cloud-security_center_management-v1/snippets/security_center_management/delete_security_health_analytics_custom_module.rb delete mode 100644 owl-bot-staging/google-cloud-security_center_management-v1/snippets/security_center_management/get_effective_event_threat_detection_custom_module.rb delete mode 100644 owl-bot-staging/google-cloud-security_center_management-v1/snippets/security_center_management/get_effective_security_health_analytics_custom_module.rb delete mode 100644 owl-bot-staging/google-cloud-security_center_management-v1/snippets/security_center_management/get_event_threat_detection_custom_module.rb delete mode 100644 owl-bot-staging/google-cloud-security_center_management-v1/snippets/security_center_management/get_security_center_service.rb delete mode 100644 owl-bot-staging/google-cloud-security_center_management-v1/snippets/security_center_management/get_security_health_analytics_custom_module.rb delete mode 100644 owl-bot-staging/google-cloud-security_center_management-v1/snippets/security_center_management/list_descendant_event_threat_detection_custom_modules.rb delete mode 100644 owl-bot-staging/google-cloud-security_center_management-v1/snippets/security_center_management/list_descendant_security_health_analytics_custom_modules.rb delete mode 100644 owl-bot-staging/google-cloud-security_center_management-v1/snippets/security_center_management/list_effective_event_threat_detection_custom_modules.rb delete mode 100644 owl-bot-staging/google-cloud-security_center_management-v1/snippets/security_center_management/list_effective_security_health_analytics_custom_modules.rb delete mode 100644 owl-bot-staging/google-cloud-security_center_management-v1/snippets/security_center_management/list_event_threat_detection_custom_modules.rb delete mode 100644 owl-bot-staging/google-cloud-security_center_management-v1/snippets/security_center_management/list_security_center_services.rb delete mode 100644 owl-bot-staging/google-cloud-security_center_management-v1/snippets/security_center_management/list_security_health_analytics_custom_modules.rb delete mode 100644 owl-bot-staging/google-cloud-security_center_management-v1/snippets/security_center_management/simulate_security_health_analytics_custom_module.rb delete mode 100644 owl-bot-staging/google-cloud-security_center_management-v1/snippets/security_center_management/update_event_threat_detection_custom_module.rb delete mode 100644 owl-bot-staging/google-cloud-security_center_management-v1/snippets/security_center_management/update_security_center_service.rb delete mode 100644 owl-bot-staging/google-cloud-security_center_management-v1/snippets/security_center_management/update_security_health_analytics_custom_module.rb delete mode 100644 owl-bot-staging/google-cloud-security_center_management-v1/snippets/security_center_management/validate_event_threat_detection_custom_module.rb delete mode 100644 owl-bot-staging/google-cloud-security_center_management-v1/snippets/snippet_metadata_google.cloud.securitycentermanagement.v1.json delete mode 100644 owl-bot-staging/google-cloud-security_center_management-v1/test/google/cloud/security_center_management/v1/security_center_management_paths_test.rb delete mode 100644 owl-bot-staging/google-cloud-security_center_management-v1/test/google/cloud/security_center_management/v1/security_center_management_rest_test.rb delete mode 100644 owl-bot-staging/google-cloud-security_center_management-v1/test/google/cloud/security_center_management/v1/security_center_management_test.rb delete mode 100644 owl-bot-staging/google-cloud-security_center_management-v1/test/helper.rb diff --git a/google-cloud-redis-cluster-v1beta1/proto_docs/google/api/client.rb b/google-cloud-redis-cluster-v1beta1/proto_docs/google/api/client.rb index 483a6510978e..a8b1b06d1cad 100644 --- a/google-cloud-redis-cluster-v1beta1/proto_docs/google/api/client.rb +++ b/google-cloud-redis-cluster-v1beta1/proto_docs/google/api/client.rb @@ -141,9 +141,10 @@ class Publishing # # Example of a YAML configuration:: # - # publishing: - # java_settings: - # library_package: com.google.cloud.pubsub.v1 + # 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 @@ -155,11 +156,11 @@ class Publishing # # Example of a YAML configuration:: # - # publishing: - # java_settings: - # service_class_names: - # - google.pubsub.v1.Publisher: TopicAdmin - # - google.pubsub.v1.Subscriber: SubscriptionAdmin + # 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. @@ -190,6 +191,20 @@ class CppSettings # @!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 @@ -318,10 +333,12 @@ class RubySettings # service names and values are the name to be used for the service client # and call options. # - # publishing: - # go_settings: - # renamed_services: - # Publisher: TopicAdmin + # Example: + # + # publishing: + # go_settings: + # renamed_services: + # Publisher: TopicAdmin class GoSettings include ::Google::Protobuf::MessageExts extend ::Google::Protobuf::MessageExts::ClassMethods @@ -344,10 +361,10 @@ class RenamedServicesEntry # # Example: # - # publishing: - # method_settings: - # - selector: google.storage.control.v2.StorageControl.CreateFolder - # # method settings for CreateFolder... + # 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 @@ -356,14 +373,14 @@ class RenamedServicesEntry # # 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 + # 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 @@ -372,11 +389,24 @@ class RenamedServicesEntry # # Example of a YAML configuration: # - # publishing: - # method_settings: - # - selector: google.example.v1.ExampleService.CreateExample - # auto_populated_fields: - # - request_id + # 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 @@ -428,6 +458,77 @@ class SelectiveGapicGeneration 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 @@ -469,5 +570,20 @@ module ClientLibraryDestination # 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/google-cloud-redis-v1/proto_docs/google/api/client.rb b/google-cloud-redis-v1/proto_docs/google/api/client.rb index 8f4ca4b4d6e5..7796382e3a21 100644 --- a/google-cloud-redis-v1/proto_docs/google/api/client.rb +++ b/google-cloud-redis-v1/proto_docs/google/api/client.rb @@ -141,9 +141,10 @@ class Publishing # # Example of a YAML configuration:: # - # publishing: - # java_settings: - # library_package: com.google.cloud.pubsub.v1 + # 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 @@ -155,11 +156,11 @@ class Publishing # # Example of a YAML configuration:: # - # publishing: - # java_settings: - # service_class_names: - # - google.pubsub.v1.Publisher: TopicAdmin - # - google.pubsub.v1.Subscriber: SubscriptionAdmin + # 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. @@ -190,6 +191,20 @@ class CppSettings # @!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 @@ -318,10 +333,12 @@ class RubySettings # service names and values are the name to be used for the service client # and call options. # - # publishing: - # go_settings: - # renamed_services: - # Publisher: TopicAdmin + # Example: + # + # publishing: + # go_settings: + # renamed_services: + # Publisher: TopicAdmin class GoSettings include ::Google::Protobuf::MessageExts extend ::Google::Protobuf::MessageExts::ClassMethods @@ -344,10 +361,10 @@ class RenamedServicesEntry # # Example: # - # publishing: - # method_settings: - # - selector: google.storage.control.v2.StorageControl.CreateFolder - # # method settings for CreateFolder... + # 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 @@ -356,14 +373,14 @@ class RenamedServicesEntry # # 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 + # 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 @@ -372,11 +389,24 @@ class RenamedServicesEntry # # Example of a YAML configuration: # - # publishing: - # method_settings: - # - selector: google.example.v1.ExampleService.CreateExample - # auto_populated_fields: - # - request_id + # 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 @@ -428,6 +458,77 @@ class SelectiveGapicGeneration 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 @@ -469,5 +570,20 @@ module ClientLibraryDestination # 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/google-cloud-redis-v1beta1/proto_docs/google/api/client.rb b/google-cloud-redis-v1beta1/proto_docs/google/api/client.rb index 8f4ca4b4d6e5..7796382e3a21 100644 --- a/google-cloud-redis-v1beta1/proto_docs/google/api/client.rb +++ b/google-cloud-redis-v1beta1/proto_docs/google/api/client.rb @@ -141,9 +141,10 @@ class Publishing # # Example of a YAML configuration:: # - # publishing: - # java_settings: - # library_package: com.google.cloud.pubsub.v1 + # 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 @@ -155,11 +156,11 @@ class Publishing # # Example of a YAML configuration:: # - # publishing: - # java_settings: - # service_class_names: - # - google.pubsub.v1.Publisher: TopicAdmin - # - google.pubsub.v1.Subscriber: SubscriptionAdmin + # 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. @@ -190,6 +191,20 @@ class CppSettings # @!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 @@ -318,10 +333,12 @@ class RubySettings # service names and values are the name to be used for the service client # and call options. # - # publishing: - # go_settings: - # renamed_services: - # Publisher: TopicAdmin + # Example: + # + # publishing: + # go_settings: + # renamed_services: + # Publisher: TopicAdmin class GoSettings include ::Google::Protobuf::MessageExts extend ::Google::Protobuf::MessageExts::ClassMethods @@ -344,10 +361,10 @@ class RenamedServicesEntry # # Example: # - # publishing: - # method_settings: - # - selector: google.storage.control.v2.StorageControl.CreateFolder - # # method settings for CreateFolder... + # 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 @@ -356,14 +373,14 @@ class RenamedServicesEntry # # 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 + # 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 @@ -372,11 +389,24 @@ class RenamedServicesEntry # # Example of a YAML configuration: # - # publishing: - # method_settings: - # - selector: google.example.v1.ExampleService.CreateExample - # auto_populated_fields: - # - request_id + # 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 @@ -428,6 +458,77 @@ class SelectiveGapicGeneration 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 @@ -469,5 +570,20 @@ module ClientLibraryDestination # 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/google-cloud-resource_manager-v3/proto_docs/google/api/client.rb b/google-cloud-resource_manager-v3/proto_docs/google/api/client.rb index 8f4ca4b4d6e5..7796382e3a21 100644 --- a/google-cloud-resource_manager-v3/proto_docs/google/api/client.rb +++ b/google-cloud-resource_manager-v3/proto_docs/google/api/client.rb @@ -141,9 +141,10 @@ class Publishing # # Example of a YAML configuration:: # - # publishing: - # java_settings: - # library_package: com.google.cloud.pubsub.v1 + # 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 @@ -155,11 +156,11 @@ class Publishing # # Example of a YAML configuration:: # - # publishing: - # java_settings: - # service_class_names: - # - google.pubsub.v1.Publisher: TopicAdmin - # - google.pubsub.v1.Subscriber: SubscriptionAdmin + # 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. @@ -190,6 +191,20 @@ class CppSettings # @!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 @@ -318,10 +333,12 @@ class RubySettings # service names and values are the name to be used for the service client # and call options. # - # publishing: - # go_settings: - # renamed_services: - # Publisher: TopicAdmin + # Example: + # + # publishing: + # go_settings: + # renamed_services: + # Publisher: TopicAdmin class GoSettings include ::Google::Protobuf::MessageExts extend ::Google::Protobuf::MessageExts::ClassMethods @@ -344,10 +361,10 @@ class RenamedServicesEntry # # Example: # - # publishing: - # method_settings: - # - selector: google.storage.control.v2.StorageControl.CreateFolder - # # method settings for CreateFolder... + # 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 @@ -356,14 +373,14 @@ class RenamedServicesEntry # # 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 + # 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 @@ -372,11 +389,24 @@ class RenamedServicesEntry # # Example of a YAML configuration: # - # publishing: - # method_settings: - # - selector: google.example.v1.ExampleService.CreateExample - # auto_populated_fields: - # - request_id + # 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 @@ -428,6 +458,77 @@ class SelectiveGapicGeneration 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 @@ -469,5 +570,20 @@ module ClientLibraryDestination # 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/google-cloud-retail-v2/proto_docs/google/api/client.rb b/google-cloud-retail-v2/proto_docs/google/api/client.rb index 8f4ca4b4d6e5..7796382e3a21 100644 --- a/google-cloud-retail-v2/proto_docs/google/api/client.rb +++ b/google-cloud-retail-v2/proto_docs/google/api/client.rb @@ -141,9 +141,10 @@ class Publishing # # Example of a YAML configuration:: # - # publishing: - # java_settings: - # library_package: com.google.cloud.pubsub.v1 + # 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 @@ -155,11 +156,11 @@ class Publishing # # Example of a YAML configuration:: # - # publishing: - # java_settings: - # service_class_names: - # - google.pubsub.v1.Publisher: TopicAdmin - # - google.pubsub.v1.Subscriber: SubscriptionAdmin + # 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. @@ -190,6 +191,20 @@ class CppSettings # @!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 @@ -318,10 +333,12 @@ class RubySettings # service names and values are the name to be used for the service client # and call options. # - # publishing: - # go_settings: - # renamed_services: - # Publisher: TopicAdmin + # Example: + # + # publishing: + # go_settings: + # renamed_services: + # Publisher: TopicAdmin class GoSettings include ::Google::Protobuf::MessageExts extend ::Google::Protobuf::MessageExts::ClassMethods @@ -344,10 +361,10 @@ class RenamedServicesEntry # # Example: # - # publishing: - # method_settings: - # - selector: google.storage.control.v2.StorageControl.CreateFolder - # # method settings for CreateFolder... + # 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 @@ -356,14 +373,14 @@ class RenamedServicesEntry # # 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 + # 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 @@ -372,11 +389,24 @@ class RenamedServicesEntry # # Example of a YAML configuration: # - # publishing: - # method_settings: - # - selector: google.example.v1.ExampleService.CreateExample - # auto_populated_fields: - # - request_id + # 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 @@ -428,6 +458,77 @@ class SelectiveGapicGeneration 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 @@ -469,5 +570,20 @@ module ClientLibraryDestination # 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/google-cloud-saas_platform-saas_service_mgmt-v1beta1/proto_docs/google/api/client.rb b/google-cloud-saas_platform-saas_service_mgmt-v1beta1/proto_docs/google/api/client.rb index c6b6b60729c9..25b227e61cdc 100644 --- a/google-cloud-saas_platform-saas_service_mgmt-v1beta1/proto_docs/google/api/client.rb +++ b/google-cloud-saas_platform-saas_service_mgmt-v1beta1/proto_docs/google/api/client.rb @@ -141,9 +141,10 @@ class Publishing # # Example of a YAML configuration:: # - # publishing: - # java_settings: - # library_package: com.google.cloud.pubsub.v1 + # 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 @@ -155,11 +156,11 @@ class Publishing # # Example of a YAML configuration:: # - # publishing: - # java_settings: - # service_class_names: - # - google.pubsub.v1.Publisher: TopicAdmin - # - google.pubsub.v1.Subscriber: SubscriptionAdmin + # 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. @@ -190,6 +191,20 @@ class CppSettings # @!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 @@ -318,10 +333,12 @@ class RubySettings # service names and values are the name to be used for the service client # and call options. # - # publishing: - # go_settings: - # renamed_services: - # Publisher: TopicAdmin + # Example: + # + # publishing: + # go_settings: + # renamed_services: + # Publisher: TopicAdmin class GoSettings include ::Google::Protobuf::MessageExts extend ::Google::Protobuf::MessageExts::ClassMethods @@ -344,10 +361,10 @@ class RenamedServicesEntry # # Example: # - # publishing: - # method_settings: - # - selector: google.storage.control.v2.StorageControl.CreateFolder - # # method settings for CreateFolder... + # 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 @@ -356,14 +373,14 @@ class RenamedServicesEntry # # 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 + # 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 @@ -372,11 +389,24 @@ class RenamedServicesEntry # # Example of a YAML configuration: # - # publishing: - # method_settings: - # - selector: google.example.v1.ExampleService.CreateExample - # auto_populated_fields: - # - request_id + # 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 @@ -428,6 +458,77 @@ class SelectiveGapicGeneration 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 @@ -469,5 +570,20 @@ module ClientLibraryDestination # 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/google-cloud-scheduler-v1/proto_docs/google/api/client.rb b/google-cloud-scheduler-v1/proto_docs/google/api/client.rb index 8f4ca4b4d6e5..7796382e3a21 100644 --- a/google-cloud-scheduler-v1/proto_docs/google/api/client.rb +++ b/google-cloud-scheduler-v1/proto_docs/google/api/client.rb @@ -141,9 +141,10 @@ class Publishing # # Example of a YAML configuration:: # - # publishing: - # java_settings: - # library_package: com.google.cloud.pubsub.v1 + # 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 @@ -155,11 +156,11 @@ class Publishing # # Example of a YAML configuration:: # - # publishing: - # java_settings: - # service_class_names: - # - google.pubsub.v1.Publisher: TopicAdmin - # - google.pubsub.v1.Subscriber: SubscriptionAdmin + # 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. @@ -190,6 +191,20 @@ class CppSettings # @!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 @@ -318,10 +333,12 @@ class RubySettings # service names and values are the name to be used for the service client # and call options. # - # publishing: - # go_settings: - # renamed_services: - # Publisher: TopicAdmin + # Example: + # + # publishing: + # go_settings: + # renamed_services: + # Publisher: TopicAdmin class GoSettings include ::Google::Protobuf::MessageExts extend ::Google::Protobuf::MessageExts::ClassMethods @@ -344,10 +361,10 @@ class RenamedServicesEntry # # Example: # - # publishing: - # method_settings: - # - selector: google.storage.control.v2.StorageControl.CreateFolder - # # method settings for CreateFolder... + # 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 @@ -356,14 +373,14 @@ class RenamedServicesEntry # # 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 + # 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 @@ -372,11 +389,24 @@ class RenamedServicesEntry # # Example of a YAML configuration: # - # publishing: - # method_settings: - # - selector: google.example.v1.ExampleService.CreateExample - # auto_populated_fields: - # - request_id + # 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 @@ -428,6 +458,77 @@ class SelectiveGapicGeneration 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 @@ -469,5 +570,20 @@ module ClientLibraryDestination # 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/google-cloud-scheduler-v1beta1/proto_docs/google/api/client.rb b/google-cloud-scheduler-v1beta1/proto_docs/google/api/client.rb index 8f4ca4b4d6e5..7796382e3a21 100644 --- a/google-cloud-scheduler-v1beta1/proto_docs/google/api/client.rb +++ b/google-cloud-scheduler-v1beta1/proto_docs/google/api/client.rb @@ -141,9 +141,10 @@ class Publishing # # Example of a YAML configuration:: # - # publishing: - # java_settings: - # library_package: com.google.cloud.pubsub.v1 + # 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 @@ -155,11 +156,11 @@ class Publishing # # Example of a YAML configuration:: # - # publishing: - # java_settings: - # service_class_names: - # - google.pubsub.v1.Publisher: TopicAdmin - # - google.pubsub.v1.Subscriber: SubscriptionAdmin + # 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. @@ -190,6 +191,20 @@ class CppSettings # @!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 @@ -318,10 +333,12 @@ class RubySettings # service names and values are the name to be used for the service client # and call options. # - # publishing: - # go_settings: - # renamed_services: - # Publisher: TopicAdmin + # Example: + # + # publishing: + # go_settings: + # renamed_services: + # Publisher: TopicAdmin class GoSettings include ::Google::Protobuf::MessageExts extend ::Google::Protobuf::MessageExts::ClassMethods @@ -344,10 +361,10 @@ class RenamedServicesEntry # # Example: # - # publishing: - # method_settings: - # - selector: google.storage.control.v2.StorageControl.CreateFolder - # # method settings for CreateFolder... + # 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 @@ -356,14 +373,14 @@ class RenamedServicesEntry # # 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 + # 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 @@ -372,11 +389,24 @@ class RenamedServicesEntry # # Example of a YAML configuration: # - # publishing: - # method_settings: - # - selector: google.example.v1.ExampleService.CreateExample - # auto_populated_fields: - # - request_id + # 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 @@ -428,6 +458,77 @@ class SelectiveGapicGeneration 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 @@ -469,5 +570,20 @@ module ClientLibraryDestination # 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/google-cloud-secret_manager-v1/proto_docs/google/api/client.rb b/google-cloud-secret_manager-v1/proto_docs/google/api/client.rb index 8f4ca4b4d6e5..7796382e3a21 100644 --- a/google-cloud-secret_manager-v1/proto_docs/google/api/client.rb +++ b/google-cloud-secret_manager-v1/proto_docs/google/api/client.rb @@ -141,9 +141,10 @@ class Publishing # # Example of a YAML configuration:: # - # publishing: - # java_settings: - # library_package: com.google.cloud.pubsub.v1 + # 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 @@ -155,11 +156,11 @@ class Publishing # # Example of a YAML configuration:: # - # publishing: - # java_settings: - # service_class_names: - # - google.pubsub.v1.Publisher: TopicAdmin - # - google.pubsub.v1.Subscriber: SubscriptionAdmin + # 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. @@ -190,6 +191,20 @@ class CppSettings # @!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 @@ -318,10 +333,12 @@ class RubySettings # service names and values are the name to be used for the service client # and call options. # - # publishing: - # go_settings: - # renamed_services: - # Publisher: TopicAdmin + # Example: + # + # publishing: + # go_settings: + # renamed_services: + # Publisher: TopicAdmin class GoSettings include ::Google::Protobuf::MessageExts extend ::Google::Protobuf::MessageExts::ClassMethods @@ -344,10 +361,10 @@ class RenamedServicesEntry # # Example: # - # publishing: - # method_settings: - # - selector: google.storage.control.v2.StorageControl.CreateFolder - # # method settings for CreateFolder... + # 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 @@ -356,14 +373,14 @@ class RenamedServicesEntry # # 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 + # 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 @@ -372,11 +389,24 @@ class RenamedServicesEntry # # Example of a YAML configuration: # - # publishing: - # method_settings: - # - selector: google.example.v1.ExampleService.CreateExample - # auto_populated_fields: - # - request_id + # 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 @@ -428,6 +458,77 @@ class SelectiveGapicGeneration 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 @@ -469,5 +570,20 @@ module ClientLibraryDestination # 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/google-cloud-secret_manager-v1beta1/proto_docs/google/api/client.rb b/google-cloud-secret_manager-v1beta1/proto_docs/google/api/client.rb index 8f4ca4b4d6e5..7796382e3a21 100644 --- a/google-cloud-secret_manager-v1beta1/proto_docs/google/api/client.rb +++ b/google-cloud-secret_manager-v1beta1/proto_docs/google/api/client.rb @@ -141,9 +141,10 @@ class Publishing # # Example of a YAML configuration:: # - # publishing: - # java_settings: - # library_package: com.google.cloud.pubsub.v1 + # 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 @@ -155,11 +156,11 @@ class Publishing # # Example of a YAML configuration:: # - # publishing: - # java_settings: - # service_class_names: - # - google.pubsub.v1.Publisher: TopicAdmin - # - google.pubsub.v1.Subscriber: SubscriptionAdmin + # 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. @@ -190,6 +191,20 @@ class CppSettings # @!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 @@ -318,10 +333,12 @@ class RubySettings # service names and values are the name to be used for the service client # and call options. # - # publishing: - # go_settings: - # renamed_services: - # Publisher: TopicAdmin + # Example: + # + # publishing: + # go_settings: + # renamed_services: + # Publisher: TopicAdmin class GoSettings include ::Google::Protobuf::MessageExts extend ::Google::Protobuf::MessageExts::ClassMethods @@ -344,10 +361,10 @@ class RenamedServicesEntry # # Example: # - # publishing: - # method_settings: - # - selector: google.storage.control.v2.StorageControl.CreateFolder - # # method settings for CreateFolder... + # 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 @@ -356,14 +373,14 @@ class RenamedServicesEntry # # 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 + # 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 @@ -372,11 +389,24 @@ class RenamedServicesEntry # # Example of a YAML configuration: # - # publishing: - # method_settings: - # - selector: google.example.v1.ExampleService.CreateExample - # auto_populated_fields: - # - request_id + # 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 @@ -428,6 +458,77 @@ class SelectiveGapicGeneration 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 @@ -469,5 +570,20 @@ module ClientLibraryDestination # 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/google-cloud-secret_manager-v1beta2/proto_docs/google/api/client.rb b/google-cloud-secret_manager-v1beta2/proto_docs/google/api/client.rb index 483a6510978e..a8b1b06d1cad 100644 --- a/google-cloud-secret_manager-v1beta2/proto_docs/google/api/client.rb +++ b/google-cloud-secret_manager-v1beta2/proto_docs/google/api/client.rb @@ -141,9 +141,10 @@ class Publishing # # Example of a YAML configuration:: # - # publishing: - # java_settings: - # library_package: com.google.cloud.pubsub.v1 + # 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 @@ -155,11 +156,11 @@ class Publishing # # Example of a YAML configuration:: # - # publishing: - # java_settings: - # service_class_names: - # - google.pubsub.v1.Publisher: TopicAdmin - # - google.pubsub.v1.Subscriber: SubscriptionAdmin + # 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. @@ -190,6 +191,20 @@ class CppSettings # @!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 @@ -318,10 +333,12 @@ class RubySettings # service names and values are the name to be used for the service client # and call options. # - # publishing: - # go_settings: - # renamed_services: - # Publisher: TopicAdmin + # Example: + # + # publishing: + # go_settings: + # renamed_services: + # Publisher: TopicAdmin class GoSettings include ::Google::Protobuf::MessageExts extend ::Google::Protobuf::MessageExts::ClassMethods @@ -344,10 +361,10 @@ class RenamedServicesEntry # # Example: # - # publishing: - # method_settings: - # - selector: google.storage.control.v2.StorageControl.CreateFolder - # # method settings for CreateFolder... + # 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 @@ -356,14 +373,14 @@ class RenamedServicesEntry # # 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 + # 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 @@ -372,11 +389,24 @@ class RenamedServicesEntry # # Example of a YAML configuration: # - # publishing: - # method_settings: - # - selector: google.example.v1.ExampleService.CreateExample - # auto_populated_fields: - # - request_id + # 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 @@ -428,6 +458,77 @@ class SelectiveGapicGeneration 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 @@ -469,5 +570,20 @@ module ClientLibraryDestination # 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/google-cloud-secure_source_manager-v1/proto_docs/google/api/client.rb b/google-cloud-secure_source_manager-v1/proto_docs/google/api/client.rb index 483a6510978e..a8b1b06d1cad 100644 --- a/google-cloud-secure_source_manager-v1/proto_docs/google/api/client.rb +++ b/google-cloud-secure_source_manager-v1/proto_docs/google/api/client.rb @@ -141,9 +141,10 @@ class Publishing # # Example of a YAML configuration:: # - # publishing: - # java_settings: - # library_package: com.google.cloud.pubsub.v1 + # 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 @@ -155,11 +156,11 @@ class Publishing # # Example of a YAML configuration:: # - # publishing: - # java_settings: - # service_class_names: - # - google.pubsub.v1.Publisher: TopicAdmin - # - google.pubsub.v1.Subscriber: SubscriptionAdmin + # 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. @@ -190,6 +191,20 @@ class CppSettings # @!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 @@ -318,10 +333,12 @@ class RubySettings # service names and values are the name to be used for the service client # and call options. # - # publishing: - # go_settings: - # renamed_services: - # Publisher: TopicAdmin + # Example: + # + # publishing: + # go_settings: + # renamed_services: + # Publisher: TopicAdmin class GoSettings include ::Google::Protobuf::MessageExts extend ::Google::Protobuf::MessageExts::ClassMethods @@ -344,10 +361,10 @@ class RenamedServicesEntry # # Example: # - # publishing: - # method_settings: - # - selector: google.storage.control.v2.StorageControl.CreateFolder - # # method settings for CreateFolder... + # 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 @@ -356,14 +373,14 @@ class RenamedServicesEntry # # 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 + # 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 @@ -372,11 +389,24 @@ class RenamedServicesEntry # # Example of a YAML configuration: # - # publishing: - # method_settings: - # - selector: google.example.v1.ExampleService.CreateExample - # auto_populated_fields: - # - request_id + # 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 @@ -428,6 +458,77 @@ class SelectiveGapicGeneration 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 @@ -469,5 +570,20 @@ module ClientLibraryDestination # 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/google-cloud-security-private_ca-v1/proto_docs/google/api/client.rb b/google-cloud-security-private_ca-v1/proto_docs/google/api/client.rb index 8f4ca4b4d6e5..7796382e3a21 100644 --- a/google-cloud-security-private_ca-v1/proto_docs/google/api/client.rb +++ b/google-cloud-security-private_ca-v1/proto_docs/google/api/client.rb @@ -141,9 +141,10 @@ class Publishing # # Example of a YAML configuration:: # - # publishing: - # java_settings: - # library_package: com.google.cloud.pubsub.v1 + # 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 @@ -155,11 +156,11 @@ class Publishing # # Example of a YAML configuration:: # - # publishing: - # java_settings: - # service_class_names: - # - google.pubsub.v1.Publisher: TopicAdmin - # - google.pubsub.v1.Subscriber: SubscriptionAdmin + # 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. @@ -190,6 +191,20 @@ class CppSettings # @!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 @@ -318,10 +333,12 @@ class RubySettings # service names and values are the name to be used for the service client # and call options. # - # publishing: - # go_settings: - # renamed_services: - # Publisher: TopicAdmin + # Example: + # + # publishing: + # go_settings: + # renamed_services: + # Publisher: TopicAdmin class GoSettings include ::Google::Protobuf::MessageExts extend ::Google::Protobuf::MessageExts::ClassMethods @@ -344,10 +361,10 @@ class RenamedServicesEntry # # Example: # - # publishing: - # method_settings: - # - selector: google.storage.control.v2.StorageControl.CreateFolder - # # method settings for CreateFolder... + # 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 @@ -356,14 +373,14 @@ class RenamedServicesEntry # # 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 + # 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 @@ -372,11 +389,24 @@ class RenamedServicesEntry # # Example of a YAML configuration: # - # publishing: - # method_settings: - # - selector: google.example.v1.ExampleService.CreateExample - # auto_populated_fields: - # - request_id + # 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 @@ -428,6 +458,77 @@ class SelectiveGapicGeneration 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 @@ -469,5 +570,20 @@ module ClientLibraryDestination # 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/google-cloud-security-private_ca-v1beta1/proto_docs/google/api/client.rb b/google-cloud-security-private_ca-v1beta1/proto_docs/google/api/client.rb index 8f4ca4b4d6e5..7796382e3a21 100644 --- a/google-cloud-security-private_ca-v1beta1/proto_docs/google/api/client.rb +++ b/google-cloud-security-private_ca-v1beta1/proto_docs/google/api/client.rb @@ -141,9 +141,10 @@ class Publishing # # Example of a YAML configuration:: # - # publishing: - # java_settings: - # library_package: com.google.cloud.pubsub.v1 + # 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 @@ -155,11 +156,11 @@ class Publishing # # Example of a YAML configuration:: # - # publishing: - # java_settings: - # service_class_names: - # - google.pubsub.v1.Publisher: TopicAdmin - # - google.pubsub.v1.Subscriber: SubscriptionAdmin + # 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. @@ -190,6 +191,20 @@ class CppSettings # @!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 @@ -318,10 +333,12 @@ class RubySettings # service names and values are the name to be used for the service client # and call options. # - # publishing: - # go_settings: - # renamed_services: - # Publisher: TopicAdmin + # Example: + # + # publishing: + # go_settings: + # renamed_services: + # Publisher: TopicAdmin class GoSettings include ::Google::Protobuf::MessageExts extend ::Google::Protobuf::MessageExts::ClassMethods @@ -344,10 +361,10 @@ class RenamedServicesEntry # # Example: # - # publishing: - # method_settings: - # - selector: google.storage.control.v2.StorageControl.CreateFolder - # # method settings for CreateFolder... + # 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 @@ -356,14 +373,14 @@ class RenamedServicesEntry # # 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 + # 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 @@ -372,11 +389,24 @@ class RenamedServicesEntry # # Example of a YAML configuration: # - # publishing: - # method_settings: - # - selector: google.example.v1.ExampleService.CreateExample - # auto_populated_fields: - # - request_id + # 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 @@ -428,6 +458,77 @@ class SelectiveGapicGeneration 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 @@ -469,5 +570,20 @@ module ClientLibraryDestination # 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/google-cloud-security-public_ca-v1/proto_docs/google/api/client.rb b/google-cloud-security-public_ca-v1/proto_docs/google/api/client.rb index 483a6510978e..a8b1b06d1cad 100644 --- a/google-cloud-security-public_ca-v1/proto_docs/google/api/client.rb +++ b/google-cloud-security-public_ca-v1/proto_docs/google/api/client.rb @@ -141,9 +141,10 @@ class Publishing # # Example of a YAML configuration:: # - # publishing: - # java_settings: - # library_package: com.google.cloud.pubsub.v1 + # 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 @@ -155,11 +156,11 @@ class Publishing # # Example of a YAML configuration:: # - # publishing: - # java_settings: - # service_class_names: - # - google.pubsub.v1.Publisher: TopicAdmin - # - google.pubsub.v1.Subscriber: SubscriptionAdmin + # 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. @@ -190,6 +191,20 @@ class CppSettings # @!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 @@ -318,10 +333,12 @@ class RubySettings # service names and values are the name to be used for the service client # and call options. # - # publishing: - # go_settings: - # renamed_services: - # Publisher: TopicAdmin + # Example: + # + # publishing: + # go_settings: + # renamed_services: + # Publisher: TopicAdmin class GoSettings include ::Google::Protobuf::MessageExts extend ::Google::Protobuf::MessageExts::ClassMethods @@ -344,10 +361,10 @@ class RenamedServicesEntry # # Example: # - # publishing: - # method_settings: - # - selector: google.storage.control.v2.StorageControl.CreateFolder - # # method settings for CreateFolder... + # 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 @@ -356,14 +373,14 @@ class RenamedServicesEntry # # 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 + # 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 @@ -372,11 +389,24 @@ class RenamedServicesEntry # # Example of a YAML configuration: # - # publishing: - # method_settings: - # - selector: google.example.v1.ExampleService.CreateExample - # auto_populated_fields: - # - request_id + # 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 @@ -428,6 +458,77 @@ class SelectiveGapicGeneration 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 @@ -469,5 +570,20 @@ module ClientLibraryDestination # 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/google-cloud-security-public_ca-v1beta1/proto_docs/google/api/client.rb b/google-cloud-security-public_ca-v1beta1/proto_docs/google/api/client.rb index 8f4ca4b4d6e5..7796382e3a21 100644 --- a/google-cloud-security-public_ca-v1beta1/proto_docs/google/api/client.rb +++ b/google-cloud-security-public_ca-v1beta1/proto_docs/google/api/client.rb @@ -141,9 +141,10 @@ class Publishing # # Example of a YAML configuration:: # - # publishing: - # java_settings: - # library_package: com.google.cloud.pubsub.v1 + # 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 @@ -155,11 +156,11 @@ class Publishing # # Example of a YAML configuration:: # - # publishing: - # java_settings: - # service_class_names: - # - google.pubsub.v1.Publisher: TopicAdmin - # - google.pubsub.v1.Subscriber: SubscriptionAdmin + # 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. @@ -190,6 +191,20 @@ class CppSettings # @!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 @@ -318,10 +333,12 @@ class RubySettings # service names and values are the name to be used for the service client # and call options. # - # publishing: - # go_settings: - # renamed_services: - # Publisher: TopicAdmin + # Example: + # + # publishing: + # go_settings: + # renamed_services: + # Publisher: TopicAdmin class GoSettings include ::Google::Protobuf::MessageExts extend ::Google::Protobuf::MessageExts::ClassMethods @@ -344,10 +361,10 @@ class RenamedServicesEntry # # Example: # - # publishing: - # method_settings: - # - selector: google.storage.control.v2.StorageControl.CreateFolder - # # method settings for CreateFolder... + # 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 @@ -356,14 +373,14 @@ class RenamedServicesEntry # # 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 + # 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 @@ -372,11 +389,24 @@ class RenamedServicesEntry # # Example of a YAML configuration: # - # publishing: - # method_settings: - # - selector: google.example.v1.ExampleService.CreateExample - # auto_populated_fields: - # - request_id + # 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 @@ -428,6 +458,77 @@ class SelectiveGapicGeneration 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 @@ -469,5 +570,20 @@ module ClientLibraryDestination # 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/google-cloud-security_center-v1/proto_docs/google/api/client.rb b/google-cloud-security_center-v1/proto_docs/google/api/client.rb index 8f4ca4b4d6e5..7796382e3a21 100644 --- a/google-cloud-security_center-v1/proto_docs/google/api/client.rb +++ b/google-cloud-security_center-v1/proto_docs/google/api/client.rb @@ -141,9 +141,10 @@ class Publishing # # Example of a YAML configuration:: # - # publishing: - # java_settings: - # library_package: com.google.cloud.pubsub.v1 + # 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 @@ -155,11 +156,11 @@ class Publishing # # Example of a YAML configuration:: # - # publishing: - # java_settings: - # service_class_names: - # - google.pubsub.v1.Publisher: TopicAdmin - # - google.pubsub.v1.Subscriber: SubscriptionAdmin + # 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. @@ -190,6 +191,20 @@ class CppSettings # @!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 @@ -318,10 +333,12 @@ class RubySettings # service names and values are the name to be used for the service client # and call options. # - # publishing: - # go_settings: - # renamed_services: - # Publisher: TopicAdmin + # Example: + # + # publishing: + # go_settings: + # renamed_services: + # Publisher: TopicAdmin class GoSettings include ::Google::Protobuf::MessageExts extend ::Google::Protobuf::MessageExts::ClassMethods @@ -344,10 +361,10 @@ class RenamedServicesEntry # # Example: # - # publishing: - # method_settings: - # - selector: google.storage.control.v2.StorageControl.CreateFolder - # # method settings for CreateFolder... + # 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 @@ -356,14 +373,14 @@ class RenamedServicesEntry # # 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 + # 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 @@ -372,11 +389,24 @@ class RenamedServicesEntry # # Example of a YAML configuration: # - # publishing: - # method_settings: - # - selector: google.example.v1.ExampleService.CreateExample - # auto_populated_fields: - # - request_id + # 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 @@ -428,6 +458,77 @@ class SelectiveGapicGeneration 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 @@ -469,5 +570,20 @@ module ClientLibraryDestination # 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/google-cloud-security_center-v1p1beta1/proto_docs/google/api/client.rb b/google-cloud-security_center-v1p1beta1/proto_docs/google/api/client.rb index 8f4ca4b4d6e5..7796382e3a21 100644 --- a/google-cloud-security_center-v1p1beta1/proto_docs/google/api/client.rb +++ b/google-cloud-security_center-v1p1beta1/proto_docs/google/api/client.rb @@ -141,9 +141,10 @@ class Publishing # # Example of a YAML configuration:: # - # publishing: - # java_settings: - # library_package: com.google.cloud.pubsub.v1 + # 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 @@ -155,11 +156,11 @@ class Publishing # # Example of a YAML configuration:: # - # publishing: - # java_settings: - # service_class_names: - # - google.pubsub.v1.Publisher: TopicAdmin - # - google.pubsub.v1.Subscriber: SubscriptionAdmin + # 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. @@ -190,6 +191,20 @@ class CppSettings # @!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 @@ -318,10 +333,12 @@ class RubySettings # service names and values are the name to be used for the service client # and call options. # - # publishing: - # go_settings: - # renamed_services: - # Publisher: TopicAdmin + # Example: + # + # publishing: + # go_settings: + # renamed_services: + # Publisher: TopicAdmin class GoSettings include ::Google::Protobuf::MessageExts extend ::Google::Protobuf::MessageExts::ClassMethods @@ -344,10 +361,10 @@ class RenamedServicesEntry # # Example: # - # publishing: - # method_settings: - # - selector: google.storage.control.v2.StorageControl.CreateFolder - # # method settings for CreateFolder... + # 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 @@ -356,14 +373,14 @@ class RenamedServicesEntry # # 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 + # 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 @@ -372,11 +389,24 @@ class RenamedServicesEntry # # Example of a YAML configuration: # - # publishing: - # method_settings: - # - selector: google.example.v1.ExampleService.CreateExample - # auto_populated_fields: - # - request_id + # 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 @@ -428,6 +458,77 @@ class SelectiveGapicGeneration 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 @@ -469,5 +570,20 @@ module ClientLibraryDestination # 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/google-cloud-security_center-v2/proto_docs/google/api/client.rb b/google-cloud-security_center-v2/proto_docs/google/api/client.rb index 483a6510978e..a8b1b06d1cad 100644 --- a/google-cloud-security_center-v2/proto_docs/google/api/client.rb +++ b/google-cloud-security_center-v2/proto_docs/google/api/client.rb @@ -141,9 +141,10 @@ class Publishing # # Example of a YAML configuration:: # - # publishing: - # java_settings: - # library_package: com.google.cloud.pubsub.v1 + # 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 @@ -155,11 +156,11 @@ class Publishing # # Example of a YAML configuration:: # - # publishing: - # java_settings: - # service_class_names: - # - google.pubsub.v1.Publisher: TopicAdmin - # - google.pubsub.v1.Subscriber: SubscriptionAdmin + # 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. @@ -190,6 +191,20 @@ class CppSettings # @!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 @@ -318,10 +333,12 @@ class RubySettings # service names and values are the name to be used for the service client # and call options. # - # publishing: - # go_settings: - # renamed_services: - # Publisher: TopicAdmin + # Example: + # + # publishing: + # go_settings: + # renamed_services: + # Publisher: TopicAdmin class GoSettings include ::Google::Protobuf::MessageExts extend ::Google::Protobuf::MessageExts::ClassMethods @@ -344,10 +361,10 @@ class RenamedServicesEntry # # Example: # - # publishing: - # method_settings: - # - selector: google.storage.control.v2.StorageControl.CreateFolder - # # method settings for CreateFolder... + # 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 @@ -356,14 +373,14 @@ class RenamedServicesEntry # # 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 + # 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 @@ -372,11 +389,24 @@ class RenamedServicesEntry # # Example of a YAML configuration: # - # publishing: - # method_settings: - # - selector: google.example.v1.ExampleService.CreateExample - # auto_populated_fields: - # - request_id + # 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 @@ -428,6 +458,77 @@ class SelectiveGapicGeneration 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 @@ -469,5 +570,20 @@ module ClientLibraryDestination # 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/google-cloud-security_center-v2/proto_docs/google/api/routing.rb b/google-cloud-security_center-v2/proto_docs/google/api/routing.rb index 0a6697baa4a9..497560392276 100644 --- a/google-cloud-security_center-v2/proto_docs/google/api/routing.rb +++ b/google-cloud-security_center-v2/proto_docs/google/api/routing.rb @@ -49,9 +49,13 @@ module Api # app_profile_id: profiles/prof_qux # } # - # The routing header consists of one or multiple key-value pairs. Every key - # and value must be percent-encoded, and joined together in the format of - # `key1=value1&key2=value2`. + # The routing header consists of one or multiple key-value pairs. The order of + # the key-value pairs is undefined, the order of the `routing_parameters` in + # the `RoutingRule` only matters for the evaluation order of the path + # templates when `field` is the same. See the examples below for more details. + # + # Every key and value in the routing header must be percent-encoded, + # and joined together in the following format: `key1=value1&key2=value2`. # The examples below skip the percent-encoding for readability. # # Example 1 diff --git a/google-cloud-security_center_management-v1/proto_docs/google/api/client.rb b/google-cloud-security_center_management-v1/proto_docs/google/api/client.rb index 483a6510978e..a8b1b06d1cad 100644 --- a/google-cloud-security_center_management-v1/proto_docs/google/api/client.rb +++ b/google-cloud-security_center_management-v1/proto_docs/google/api/client.rb @@ -141,9 +141,10 @@ class Publishing # # Example of a YAML configuration:: # - # publishing: - # java_settings: - # library_package: com.google.cloud.pubsub.v1 + # 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 @@ -155,11 +156,11 @@ class Publishing # # Example of a YAML configuration:: # - # publishing: - # java_settings: - # service_class_names: - # - google.pubsub.v1.Publisher: TopicAdmin - # - google.pubsub.v1.Subscriber: SubscriptionAdmin + # 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. @@ -190,6 +191,20 @@ class CppSettings # @!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 @@ -318,10 +333,12 @@ class RubySettings # service names and values are the name to be used for the service client # and call options. # - # publishing: - # go_settings: - # renamed_services: - # Publisher: TopicAdmin + # Example: + # + # publishing: + # go_settings: + # renamed_services: + # Publisher: TopicAdmin class GoSettings include ::Google::Protobuf::MessageExts extend ::Google::Protobuf::MessageExts::ClassMethods @@ -344,10 +361,10 @@ class RenamedServicesEntry # # Example: # - # publishing: - # method_settings: - # - selector: google.storage.control.v2.StorageControl.CreateFolder - # # method settings for CreateFolder... + # 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 @@ -356,14 +373,14 @@ class RenamedServicesEntry # # 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 + # 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 @@ -372,11 +389,24 @@ class RenamedServicesEntry # # Example of a YAML configuration: # - # publishing: - # method_settings: - # - selector: google.example.v1.ExampleService.CreateExample - # auto_populated_fields: - # - request_id + # 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 @@ -428,6 +458,77 @@ class SelectiveGapicGeneration 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 @@ -469,5 +570,20 @@ module ClientLibraryDestination # Publish the library to package managers like nuget.org and npmjs.com. PACKAGE_MANAGER = 20 end + + # The behavior to take when the flow control limit is exceeded. + module FlowControlLimitExceededBehaviorProto + # Default behavior, system-defined. + UNSET_BEHAVIOR = 0 + + # Stop operation, raise error. + THROW_EXCEPTION = 1 + + # Pause operation until limit clears. + BLOCK = 2 + + # Continue operation, disregard limit. + IGNORE = 3 + end end end diff --git a/owl-bot-staging/google-cloud-redis-cluster-v1beta1/.gitignore b/owl-bot-staging/google-cloud-redis-cluster-v1beta1/.gitignore deleted file mode 100644 index 0135b6bc6cfc..000000000000 --- a/owl-bot-staging/google-cloud-redis-cluster-v1beta1/.gitignore +++ /dev/null @@ -1,22 +0,0 @@ -# Ignore bundler lockfiles -Gemfile.lock -gems.locked - -# Ignore documentation output -doc/* -.yardoc/* - -# Ignore test output -coverage/* - -# Ignore build artifacts -pkg/* - -# Ignore files commonly present in certain dev environments -.vagrant -.DS_STORE -.idea -*.iml - -# Ignore synth output -__pycache__ diff --git a/owl-bot-staging/google-cloud-redis-cluster-v1beta1/.repo-metadata.json b/owl-bot-staging/google-cloud-redis-cluster-v1beta1/.repo-metadata.json deleted file mode 100644 index 2ab1d03bbe46..000000000000 --- a/owl-bot-staging/google-cloud-redis-cluster-v1beta1/.repo-metadata.json +++ /dev/null @@ -1,17 +0,0 @@ -{ - "api_id": "redis.googleapis.com", - "api_shortname": "redis", - "client_documentation": "https://cloud.google.com/ruby/docs/reference/google-cloud-redis-cluster-v1beta1/latest", - "distribution_name": "google-cloud-redis-cluster-v1beta1", - "is_cloud": true, - "language": "ruby", - "name": "redis", - "name_pretty": "Google Cloud Memorystore for Redis V1BETA1 API", - "product_documentation": "https://cloud.google.com/memorystore/docs/cluster", - "release_level": "unreleased", - "repo": "googleapis/google-cloud-ruby", - "requires_billing": true, - "ruby-cloud-description": "Creates and manages Redis instances on the Google Cloud Platform. Note that google-cloud-redis-cluster-v1beta1 is a version-specific client library. For most uses, we recommend installing the main client library google-cloud-redis-cluster instead. See the readme for more details.", - "ruby-cloud-product-url": "https://cloud.google.com/memorystore/docs/cluster", - "library_type": "GAPIC_AUTO" -} diff --git a/owl-bot-staging/google-cloud-redis-cluster-v1beta1/.rubocop.yml b/owl-bot-staging/google-cloud-redis-cluster-v1beta1/.rubocop.yml deleted file mode 100644 index fc0606d1c085..000000000000 --- a/owl-bot-staging/google-cloud-redis-cluster-v1beta1/.rubocop.yml +++ /dev/null @@ -1,33 +0,0 @@ -inherit_gem: - google-style: google-style.yml - -AllCops: - Exclude: - - "google-cloud-redis-cluster-v1beta1.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-redis-cluster-v1beta1.rb" diff --git a/owl-bot-staging/google-cloud-redis-cluster-v1beta1/.toys.rb b/owl-bot-staging/google-cloud-redis-cluster-v1beta1/.toys.rb deleted file mode 100644 index 177e22456e8a..000000000000 --- a/owl-bot-staging/google-cloud-redis-cluster-v1beta1/.toys.rb +++ /dev/null @@ -1,28 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -toys_version! ">= 0.15.3" - -if ENV["RUBY_COMMON_TOOLS"] - common_tools_dir = File.expand_path ENV["RUBY_COMMON_TOOLS"] - load File.join(common_tools_dir, "toys", "gapic") -else - load_git remote: "https://github.com/googleapis/ruby-common-tools.git", - path: "toys/gapic", - update: true -end diff --git a/owl-bot-staging/google-cloud-redis-cluster-v1beta1/.yardopts b/owl-bot-staging/google-cloud-redis-cluster-v1beta1/.yardopts deleted file mode 100644 index 599cfbea4d19..000000000000 --- a/owl-bot-staging/google-cloud-redis-cluster-v1beta1/.yardopts +++ /dev/null @@ -1,12 +0,0 @@ ---no-private ---title="Google Cloud Memorystore for Redis V1BETA1 API" ---exclude _pb\.rb$ ---markup markdown ---markup-provider redcarpet - -./lib/**/*.rb -./proto_docs/**/*.rb -- -README.md -LICENSE.md -AUTHENTICATION.md diff --git a/owl-bot-staging/google-cloud-redis-cluster-v1beta1/AUTHENTICATION.md b/owl-bot-staging/google-cloud-redis-cluster-v1beta1/AUTHENTICATION.md deleted file mode 100644 index 9972a8b1c9f5..000000000000 --- a/owl-bot-staging/google-cloud-redis-cluster-v1beta1/AUTHENTICATION.md +++ /dev/null @@ -1,122 +0,0 @@ -# Authentication - -The recommended way to authenticate to the google-cloud-redis-cluster-v1beta1 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-redis-cluster-v1beta1 library provides several mechanisms to configure your system. -Generally, using Application Default Credentials to facilitate automatic -credentials discovery is the easist method. But if you need to explicitly specify -credentials, there are several methods available to you. - -Credentials are accepted in the following ways, in the following order or precedence: - -1. Credentials specified in method arguments -2. Credentials specified in configuration -3. Credentials pointed to or included in environment variables -4. Credentials found in local ADC file -5. Credentials returned by the metadata server for the attached service account (GCP) - -### Configuration - -You can configure a path to a JSON credentials file, either for an individual client object or -globally, for all client objects. The JSON file can contain credentials created for -[workload identity federation](https://cloud.google.com/iam/docs/workload-identity-federation), -[workforce identity federation](https://cloud.google.com/iam/docs/workforce-identity-federation), or a -[service account key](https://cloud.google.com/docs/authentication/provide-credentials-adc#local-key). - -Note: Service account keys are a security risk if not managed correctly. You should -[choose a more secure alternative to service account keys](https://cloud.google.com/docs/authentication#auth-decision-tree) -whenever possible. - -To configure a credentials file for an individual client initialization: - -```ruby -require "google/cloud/redis/cluster/v1beta1" - -client = ::Google::Cloud::Redis::Cluster::V1beta1::CloudRedisCluster::Client.new do |config| - config.credentials = "path/to/credentialfile.json" -end -``` - -To configure a credentials file globally for all clients: - -```ruby -require "google/cloud/redis/cluster/v1beta1" - -::Google::Cloud::Redis::Cluster::V1beta1::CloudRedisCluster::Client.configure do |config| - config.credentials = "path/to/credentialfile.json" -end - -client = ::Google::Cloud::Redis::Cluster::V1beta1::CloudRedisCluster::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-redis-cluster-v1beta1 -checks for credentials are: - -* `GOOGLE_CLOUD_CREDENTIALS` - Path to JSON file, or JSON contents -* `GOOGLE_APPLICATION_CREDENTIALS` - Path to JSON file - -```ruby -require "google/cloud/redis/cluster/v1beta1" - -ENV["GOOGLE_APPLICATION_CREDENTIALS"] = "path/to/credentialfile.json" - -client = ::Google::Cloud::Redis::Cluster::V1beta1::CloudRedisCluster::Client.new -``` - -### Local ADC file - -You can set up a local ADC file with your user credentials for authentication during -development. If credentials are not provided in code or in environment variables, -then the local ADC credentials are discovered. - -Follow the steps in [Quickstart](#quickstart) to set up a local ADC file. - -### Google Cloud Platform environments - -When running on Google Cloud Platform (GCP), including Google Compute Engine -(GCE), Google Kubernetes Engine (GKE), Google App Engine (GAE), Google Cloud -Functions (GCF) and Cloud Run, credentials are retrieved from the attached -service account automatically. Code should be written as if already authenticated. - -For more information, see -[Set up ADC for Google Cloud services](https://cloud.google.com/docs/authentication/provide-credentials-adc#attached-sa). diff --git a/owl-bot-staging/google-cloud-redis-cluster-v1beta1/CHANGELOG.md b/owl-bot-staging/google-cloud-redis-cluster-v1beta1/CHANGELOG.md deleted file mode 100644 index f88957a62ba2..000000000000 --- a/owl-bot-staging/google-cloud-redis-cluster-v1beta1/CHANGELOG.md +++ /dev/null @@ -1,2 +0,0 @@ -# Release History - diff --git a/owl-bot-staging/google-cloud-redis-cluster-v1beta1/Gemfile b/owl-bot-staging/google-cloud-redis-cluster-v1beta1/Gemfile deleted file mode 100644 index 1d08558908d8..000000000000 --- a/owl-bot-staging/google-cloud-redis-cluster-v1beta1/Gemfile +++ /dev/null @@ -1,14 +0,0 @@ -source "https://rubygems.org" - -gemspec - -gem "google-style", "~> 1.32.0" -gem "irb", "~> 1.17" -gem "minitest", "~> 6.0.2" -gem "minitest-focus", "~> 1.4" -gem "minitest-mock", "~> 5.27" -gem "minitest-rg", "~> 5.3" -gem "ostruct", "~> 0.5.5" -gem "rake", ">= 13.0" -gem "redcarpet", "~> 3.6" -gem "yard", "~> 0.9" diff --git a/owl-bot-staging/google-cloud-redis-cluster-v1beta1/LICENSE.md b/owl-bot-staging/google-cloud-redis-cluster-v1beta1/LICENSE.md deleted file mode 100644 index c261857ba6ad..000000000000 --- a/owl-bot-staging/google-cloud-redis-cluster-v1beta1/LICENSE.md +++ /dev/null @@ -1,201 +0,0 @@ - Apache License - Version 2.0, January 2004 - http://www.apache.org/licenses/ - - TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION - - 1. Definitions. - - "License" shall mean the terms and conditions for use, reproduction, - and distribution as defined by Sections 1 through 9 of this document. - - "Licensor" shall mean the copyright owner or entity authorized by - the copyright owner that is granting the License. - - "Legal Entity" shall mean the union of the acting entity and all - other entities that control, are controlled by, or are under common - control with that entity. For the purposes of this definition, - "control" means (i) the power, direct or indirect, to cause the - direction or management of such entity, whether by contract or - otherwise, or (ii) ownership of fifty percent (50%) or more of the - outstanding shares, or (iii) beneficial ownership of such entity. - - "You" (or "Your") shall mean an individual or Legal Entity - exercising permissions granted by this License. - - "Source" form shall mean the preferred form for making modifications, - including but not limited to software source code, documentation - source, and configuration files. - - "Object" form shall mean any form resulting from mechanical - transformation or translation of a Source form, including but - not limited to compiled object code, generated documentation, - and conversions to other media types. - - "Work" shall mean the work of authorship, whether in Source or - Object form, made available under the License, as indicated by a - copyright notice that is included in or attached to the work - (an example is provided in the Appendix below). - - "Derivative Works" shall mean any work, whether in Source or Object - form, that is based on (or derived from) the Work and for which the - editorial revisions, annotations, elaborations, or other modifications - represent, as a whole, an original work of authorship. For the purposes - of this License, Derivative Works shall not include works that remain - separable from, or merely link (or bind by name) to the interfaces of, - the Work and Derivative Works thereof. - - "Contribution" shall mean any work of authorship, including - the original version of the Work and any modifications or additions - to that Work or Derivative Works thereof, that is intentionally - submitted to Licensor for inclusion in the Work by the copyright owner - or by an individual or Legal Entity authorized to submit on behalf of - the copyright owner. For the purposes of this definition, "submitted" - means any form of electronic, verbal, or written communication sent - to the Licensor or its representatives, including but not limited to - communication on electronic mailing lists, source code control systems, - and issue tracking systems that are managed by, or on behalf of, the - Licensor for the purpose of discussing and improving the Work, but - excluding communication that is conspicuously marked or otherwise - designated in writing by the copyright owner as "Not a Contribution." - - "Contributor" shall mean Licensor and any individual or Legal Entity - on behalf of whom a Contribution has been received by Licensor and - subsequently incorporated within the Work. - - 2. Grant of Copyright License. Subject to the terms and conditions of - this License, each Contributor hereby grants to You a perpetual, - worldwide, non-exclusive, no-charge, royalty-free, irrevocable - copyright license to reproduce, prepare Derivative Works of, - publicly display, publicly perform, sublicense, and distribute the - Work and such Derivative Works in Source or Object form. - - 3. Grant of Patent License. Subject to the terms and conditions of - this License, each Contributor hereby grants to You a perpetual, - worldwide, non-exclusive, no-charge, royalty-free, irrevocable - (except as stated in this section) patent license to make, have made, - use, offer to sell, sell, import, and otherwise transfer the Work, - where such license applies only to those patent claims licensable - by such Contributor that are necessarily infringed by their - Contribution(s) alone or by combination of their Contribution(s) - with the Work to which such Contribution(s) was submitted. If You - institute patent litigation against any entity (including a - cross-claim or counterclaim in a lawsuit) alleging that the Work - or a Contribution incorporated within the Work constitutes direct - or contributory patent infringement, then any patent licenses - granted to You under this License for that Work shall terminate - as of the date such litigation is filed. - - 4. Redistribution. You may reproduce and distribute copies of the - Work or Derivative Works thereof in any medium, with or without - modifications, and in Source or Object form, provided that You - meet the following conditions: - - (a) You must give any other recipients of the Work or - Derivative Works a copy of this License; and - - (b) You must cause any modified files to carry prominent notices - stating that You changed the files; and - - (c) You must retain, in the Source form of any Derivative Works - that You distribute, all copyright, patent, trademark, and - attribution notices from the Source form of the Work, - excluding those notices that do not pertain to any part of - the Derivative Works; and - - (d) If the Work includes a "NOTICE" text file as part of its - distribution, then any Derivative Works that You distribute must - include a readable copy of the attribution notices contained - within such NOTICE file, excluding those notices that do not - pertain to any part of the Derivative Works, in at least one - of the following places: within a NOTICE text file distributed - as part of the Derivative Works; within the Source form or - documentation, if provided along with the Derivative Works; or, - within a display generated by the Derivative Works, if and - wherever such third-party notices normally appear. The contents - of the NOTICE file are for informational purposes only and - do not modify the License. You may add Your own attribution - notices within Derivative Works that You distribute, alongside - or as an addendum to the NOTICE text from the Work, provided - that such additional attribution notices cannot be construed - as modifying the License. - - You may add Your own copyright statement to Your modifications and - may provide additional or different license terms and conditions - for use, reproduction, or distribution of Your modifications, or - for any such Derivative Works as a whole, provided Your use, - reproduction, and distribution of the Work otherwise complies with - the conditions stated in this License. - - 5. Submission of Contributions. Unless You explicitly state otherwise, - any Contribution intentionally submitted for inclusion in the Work - by You to the Licensor shall be under the terms and conditions of - this License, without any additional terms or conditions. - Notwithstanding the above, nothing herein shall supersede or modify - the terms of any separate license agreement you may have executed - with Licensor regarding such Contributions. - - 6. Trademarks. This License does not grant permission to use the trade - names, trademarks, service marks, or product names of the Licensor, - except as required for reasonable and customary use in describing the - origin of the Work and reproducing the content of the NOTICE file. - - 7. Disclaimer of Warranty. Unless required by applicable law or - agreed to in writing, Licensor provides the Work (and each - Contributor provides its Contributions) on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or - implied, including, without limitation, any warranties or conditions - of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A - PARTICULAR PURPOSE. You are solely responsible for determining the - appropriateness of using or redistributing the Work and assume any - risks associated with Your exercise of permissions under this License. - - 8. Limitation of Liability. In no event and under no legal theory, - whether in tort (including negligence), contract, or otherwise, - unless required by applicable law (such as deliberate and grossly - negligent acts) or agreed to in writing, shall any Contributor be - liable to You for damages, including any direct, indirect, special, - incidental, or consequential damages of any character arising as a - result of this License or out of the use or inability to use the - Work (including but not limited to damages for loss of goodwill, - work stoppage, computer failure or malfunction, or any and all - other commercial damages or losses), even if such Contributor - has been advised of the possibility of such damages. - - 9. Accepting Warranty or Additional Liability. While redistributing - the Work or Derivative Works thereof, You may choose to offer, - and charge a fee for, acceptance of support, warranty, indemnity, - or other liability obligations and/or rights consistent with this - License. However, in accepting such obligations, You may act only - on Your own behalf and on Your sole responsibility, not on behalf - of any other Contributor, and only if You agree to indemnify, - defend, and hold each Contributor harmless for any liability - incurred by, or claims asserted against, such Contributor by reason - of your accepting any such warranty or additional liability. - - END OF TERMS AND CONDITIONS - - APPENDIX: How to apply the Apache License to your work. - - To apply the Apache License to your work, attach the following - boilerplate notice, with the fields enclosed by brackets "[]" - replaced with your own identifying information. (Don't include - the brackets!) The text should be enclosed in the appropriate - comment syntax for the file format. We also recommend that a - file or class name and description of purpose be included on the - same "printed page" as the copyright notice for easier - identification within third-party archives. - - Copyright [yyyy] [name of copyright owner] - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. diff --git a/owl-bot-staging/google-cloud-redis-cluster-v1beta1/README.md b/owl-bot-staging/google-cloud-redis-cluster-v1beta1/README.md deleted file mode 100644 index 51dd0050463a..000000000000 --- a/owl-bot-staging/google-cloud-redis-cluster-v1beta1/README.md +++ /dev/null @@ -1,153 +0,0 @@ -# Ruby Client for the Google Cloud Memorystore for Redis V1BETA1 API - -Creates and manages Redis instances on the Google Cloud Platform. - - -https://github.com/googleapis/google-cloud-ruby - -This gem is a _versioned_ client. It provides basic client classes for a -specific version of the Google Cloud Memorystore for Redis V1BETA1 API. Most users should consider using -the main client gem, -[google-cloud-redis-cluster](https://rubygems.org/gems/google-cloud-redis-cluster). -See the section below titled *Which client should I use?* for more information. - -## Installation - -``` -$ gem install google-cloud-redis-cluster-v1beta1 -``` - -## 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/redis.googleapis.com) -1. [Set up authentication.](AUTHENTICATION.md) - -## Quick Start - -```ruby -require "google/cloud/redis/cluster/v1beta1" - -client = ::Google::Cloud::Redis::Cluster::V1beta1::CloudRedisCluster::Client.new -request = ::Google::Cloud::Redis::Cluster::V1beta1::ListClustersRequest.new # (request fields as keyword arguments...) -response = client.list_clusters request -``` - -View the [Client Library Documentation](https://cloud.google.com/ruby/docs/reference/google-cloud-redis-cluster-v1beta1/latest) -for class and method documentation. - -See also the [Product Documentation](https://cloud.google.com/memorystore/docs/cluster) -for general usage information. - -## Debug Logging - -This library comes with opt-in Debug Logging that can help you troubleshoot -your application's integration with the API. When logging is activated, key -events such as requests and responses, along with data payloads and metadata -such as headers and client configuration, are logged to the standard error -stream. - -**WARNING:** Client Library Debug Logging includes your data payloads in -plaintext, which could include sensitive data such as PII for yourself or your -customers, private keys, or other security data that could be compromising if -leaked. Always practice good data hygiene with your application logs, and follow -the principle of least access. Google also recommends that Client Library Debug -Logging be enabled only temporarily during active debugging, and not used -permanently in production. - -To enable logging, set the environment variable `GOOGLE_SDK_RUBY_LOGGING_GEMS` -to the value `all`. Alternatively, you can set the value to a comma-delimited -list of client library gem names. This will select the default logging behavior, -which writes logs to the standard error stream. On a local workstation, this may -result in logs appearing on the console. When running on a Google Cloud hosting -service such as [Google Cloud Run](https://cloud.google.com/run), this generally -results in logs appearing alongside your application logs in the -[Google Cloud Logging](https://cloud.google.com/logging/) service. - -You can customize logging by modifying the `logger` configuration when -constructing a client object. For example: - -```ruby -require "google/cloud/redis/cluster/v1beta1" -require "logger" - -client = ::Google::Cloud::Redis::Cluster::V1beta1::CloudRedisCluster::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-redis-cluster`, -and lower-level _versioned_ client libraries with names such as -`google-cloud-redis-cluster-v1beta1`. -_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-redis-cluster`. -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-redis-cluster-v1beta1`. - -### What about the google-apis- clients? - -Client library gems with names that begin with `google-apis-` are based on an -older code generation technology. They talk to a REST/JSON backend (whereas -most modern clients talk to a [gRPC](https://grpc.io/) backend) and they may -not offer the same performance, features, and ease of use provided by more -modern clients. - -The `google-apis-` clients have wide coverage across Google services, so you -might need to use one if there is no modern client available for the service. -However, if a modern client is available, we generally recommend it over the -older `google-apis-` clients. diff --git a/owl-bot-staging/google-cloud-redis-cluster-v1beta1/Rakefile b/owl-bot-staging/google-cloud-redis-cluster-v1beta1/Rakefile deleted file mode 100644 index ad063dcffe89..000000000000 --- a/owl-bot-staging/google-cloud-redis-cluster-v1beta1/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-redis-cluster-v1beta1 acceptance tests." -task :acceptance, :project, :keyfile do |t, args| - project = args[:project] - project ||= - ENV["GOOGLE_CLOUD_TEST_PROJECT"] || - ENV["GCLOUD_TEST_PROJECT"] - keyfile = args[:keyfile] - keyfile ||= - ENV["GOOGLE_CLOUD_TEST_KEYFILE"] || - ENV["GCLOUD_TEST_KEYFILE"] - if keyfile - keyfile = File.read keyfile - else - keyfile ||= - ENV["GOOGLE_CLOUD_TEST_KEYFILE_JSON"] || - ENV["GCLOUD_TEST_KEYFILE_JSON"] - end - if project.nil? || keyfile.nil? - fail "You must provide a project and keyfile. e.g. rake acceptance[test123, /path/to/keyfile.json] or GOOGLE_CLOUD_TEST_PROJECT=test123 GOOGLE_CLOUD_TEST_KEYFILE=/path/to/keyfile.json rake acceptance" - end - require "google/cloud/redis/cluster/v1beta1/cloud_redis_cluster/credentials" - ::Google::Cloud::Redis::Cluster::V1beta1::CloudRedisCluster::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-redis-cluster-v1beta1 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-redis-cluster-v1beta1 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-redis-cluster-v1beta1 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-redis-cluster-v1beta1 gem does not have doctest tests." -end - -desc "Run the CI build" -task :ci do - header "BUILDING google-cloud-redis-cluster-v1beta1" - header "google-cloud-redis-cluster-v1beta1 rubocop", "*" - Rake::Task[:rubocop].invoke - header "google-cloud-redis-cluster-v1beta1 yard", "*" - Rake::Task[:yard].invoke - header "google-cloud-redis-cluster-v1beta1 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-redis-cluster-v1beta1 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-redis-cluster-v1beta1 acceptance", "*" - Rake::Task[:acceptance].invoke - end - task :a do - # This is a handy shortcut to save typing - Rake::Task["ci:acceptance"].invoke - end -end - -task default: :test - -def header str, token = "#" - line_length = str.length + 8 - puts "" - puts token * line_length - puts "#{token * 3} #{str} #{token * 3}" - puts token * line_length - puts "" -end diff --git a/owl-bot-staging/google-cloud-redis-cluster-v1beta1/gapic_metadata.json b/owl-bot-staging/google-cloud-redis-cluster-v1beta1/gapic_metadata.json deleted file mode 100644 index 1ecbc8224ac2..000000000000 --- a/owl-bot-staging/google-cloud-redis-cluster-v1beta1/gapic_metadata.json +++ /dev/null @@ -1,88 +0,0 @@ -{ - "schema": "1.0", - "comment": "This file maps proto services/RPCs to the corresponding library clients/methods", - "language": "ruby", - "protoPackage": "google.cloud.redis.cluster.v1beta1", - "libraryPackage": "::Google::Cloud::Redis::Cluster::V1beta1", - "services": { - "CloudRedisCluster": { - "clients": { - "grpc": { - "libraryClient": "::Google::Cloud::Redis::Cluster::V1beta1::CloudRedisCluster::Client", - "rpcs": { - "ListClusters": { - "methods": [ - "list_clusters" - ] - }, - "GetCluster": { - "methods": [ - "get_cluster" - ] - }, - "UpdateCluster": { - "methods": [ - "update_cluster" - ] - }, - "DeleteCluster": { - "methods": [ - "delete_cluster" - ] - }, - "CreateCluster": { - "methods": [ - "create_cluster" - ] - }, - "GetClusterCertificateAuthority": { - "methods": [ - "get_cluster_certificate_authority" - ] - }, - "RescheduleClusterMaintenance": { - "methods": [ - "reschedule_cluster_maintenance" - ] - }, - "ListBackupCollections": { - "methods": [ - "list_backup_collections" - ] - }, - "GetBackupCollection": { - "methods": [ - "get_backup_collection" - ] - }, - "ListBackups": { - "methods": [ - "list_backups" - ] - }, - "GetBackup": { - "methods": [ - "get_backup" - ] - }, - "DeleteBackup": { - "methods": [ - "delete_backup" - ] - }, - "ExportBackup": { - "methods": [ - "export_backup" - ] - }, - "BackupCluster": { - "methods": [ - "backup_cluster" - ] - } - } - } - } - } - } -} diff --git a/owl-bot-staging/google-cloud-redis-cluster-v1beta1/google-cloud-redis-cluster-v1beta1.gemspec b/owl-bot-staging/google-cloud-redis-cluster-v1beta1/google-cloud-redis-cluster-v1beta1.gemspec deleted file mode 100644 index 65b7fef74d81..000000000000 --- a/owl-bot-staging/google-cloud-redis-cluster-v1beta1/google-cloud-redis-cluster-v1beta1.gemspec +++ /dev/null @@ -1,29 +0,0 @@ -# -*- ruby -*- -# encoding: utf-8 - -require File.expand_path("lib/google/cloud/redis/cluster/v1beta1/version", __dir__) - -Gem::Specification.new do |gem| - gem.name = "google-cloud-redis-cluster-v1beta1" - gem.version = Google::Cloud::Redis::Cluster::V1beta1::VERSION - - gem.authors = ["Google LLC"] - gem.email = "googleapis-packages@google.com" - gem.description = "Creates and manages Redis instances on the Google Cloud Platform. Note that google-cloud-redis-cluster-v1beta1 is a version-specific client library. For most uses, we recommend installing the main client library google-cloud-redis-cluster instead. See the readme for more details." - gem.summary = "Creates and manages Redis instances on the Google Cloud Platform." - gem.homepage = "https://github.com/googleapis/google-cloud-ruby" - gem.license = "Apache-2.0" - - gem.platform = Gem::Platform::RUBY - - gem.files = `git ls-files -- lib/*`.split("\n") + - `git ls-files -- proto_docs/*`.split("\n") + - ["README.md", "LICENSE.md", "AUTHENTICATION.md", ".yardopts"] - gem.require_paths = ["lib"] - - gem.required_ruby_version = ">= 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-cloud-redis-cluster-v1beta1/lib/google-cloud-redis-cluster-v1beta1.rb b/owl-bot-staging/google-cloud-redis-cluster-v1beta1/lib/google-cloud-redis-cluster-v1beta1.rb deleted file mode 100644 index d6ebeaed939f..000000000000 --- a/owl-bot-staging/google-cloud-redis-cluster-v1beta1/lib/google-cloud-redis-cluster-v1beta1.rb +++ /dev/null @@ -1,21 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -# This gem does not autoload during Bundler.require. To load this gem, -# issue explicit require statements for the packages desired, e.g.: -# require "google/cloud/redis/cluster/v1beta1" diff --git a/owl-bot-staging/google-cloud-redis-cluster-v1beta1/lib/google/cloud/redis/cluster/v1beta1.rb b/owl-bot-staging/google-cloud-redis-cluster-v1beta1/lib/google/cloud/redis/cluster/v1beta1.rb deleted file mode 100644 index 9a8dca3ac28b..000000000000 --- a/owl-bot-staging/google-cloud-redis-cluster-v1beta1/lib/google/cloud/redis/cluster/v1beta1.rb +++ /dev/null @@ -1,47 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -require "google/cloud/redis/cluster/v1beta1/cloud_redis_cluster" -require "google/cloud/redis/cluster/v1beta1/version" - -module Google - module Cloud - module Redis - module Cluster - ## - # API client module. - # - # @example Load this package, including all its services, and instantiate a gRPC client - # - # require "google/cloud/redis/cluster/v1beta1" - # client = ::Google::Cloud::Redis::Cluster::V1beta1::CloudRedisCluster::Client.new - # - # @example Load this package, including all its services, and instantiate a REST client - # - # require "google/cloud/redis/cluster/v1beta1" - # client = ::Google::Cloud::Redis::Cluster::V1beta1::CloudRedisCluster::Rest::Client.new - # - module V1beta1 - end - end - end - end -end - -helper_path = ::File.join __dir__, "v1beta1", "_helpers.rb" -require "google/cloud/redis/cluster/v1beta1/_helpers" if ::File.file? helper_path diff --git a/owl-bot-staging/google-cloud-redis-cluster-v1beta1/lib/google/cloud/redis/cluster/v1beta1/bindings_override.rb b/owl-bot-staging/google-cloud-redis-cluster-v1beta1/lib/google/cloud/redis/cluster/v1beta1/bindings_override.rb deleted file mode 100644 index e71d4e449670..000000000000 --- a/owl-bot-staging/google-cloud-redis-cluster-v1beta1/lib/google/cloud/redis/cluster/v1beta1/bindings_override.rb +++ /dev/null @@ -1,77 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -require "gapic/rest" - -module Google - module Cloud - module Redis - module Cluster - ## - # @example Loading just the REST part of this package, including all its services, and instantiating a REST client - # - # require "google/cloud/redis/cluster/v1beta1/rest" - # client = ::Google::Cloud::Redis::Cluster::V1beta1::CloudRedisCluster::Rest::Client.new - # - module V1beta1 - ## - # @private - # Initialize the mixin bindings configuration - # - def self.configure - @configure ||= begin - namespace = ["Google", "Cloud", "Redis", "Cluster"] - parent_config = while namespace.any? - parent_name = namespace.join "::" - parent_const = const_get parent_name - break parent_const.configure if parent_const.respond_to? :configure - namespace.pop - end - - default_config = ::Gapic::Rest::HttpBindingOverrideConfiguration.new parent_config - default_config.bindings_override["google.cloud.location.Locations.GetLocation"] = [ - Gapic::Rest::GrpcTranscoder::HttpBinding.create_with_validation( - uri_method: :get, - uri_template: "/v1beta1/{name}", - matches: [ - ["name", %r{^projects/[^/]+/locations/[^/]+/?$}, false] - ], - body: nil - ) - ] - default_config.bindings_override["google.cloud.location.Locations.ListLocations"] = [ - - Gapic::Rest::GrpcTranscoder::HttpBinding.create_with_validation( - uri_method: :get, - uri_template: "/v1beta1/{name}/locations", - matches: [ - ["name", %r{^projects/[^/]+/?$}, false] - ], - body: nil - ) - ] - default_config - end - yield @configure if block_given? - @configure - end - end - end - end - end -end diff --git a/owl-bot-staging/google-cloud-redis-cluster-v1beta1/lib/google/cloud/redis/cluster/v1beta1/cloud_redis_cluster.rb b/owl-bot-staging/google-cloud-redis-cluster-v1beta1/lib/google/cloud/redis/cluster/v1beta1/cloud_redis_cluster.rb deleted file mode 100644 index 23fc244f3f90..000000000000 --- a/owl-bot-staging/google-cloud-redis-cluster-v1beta1/lib/google/cloud/redis/cluster/v1beta1/cloud_redis_cluster.rb +++ /dev/null @@ -1,72 +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/redis/cluster/v1beta1/version" - -require "google/cloud/redis/cluster/v1beta1/cloud_redis_cluster/credentials" -require "google/cloud/redis/cluster/v1beta1/cloud_redis_cluster/paths" -require "google/cloud/redis/cluster/v1beta1/cloud_redis_cluster/operations" -require "google/cloud/redis/cluster/v1beta1/cloud_redis_cluster/client" -require "google/cloud/redis/cluster/v1beta1/cloud_redis_cluster/rest" - -module Google - module Cloud - module Redis - module Cluster - module V1beta1 - ## - # Configures and manages Cloud Memorystore for Redis clusters - # - # Google Cloud Memorystore for Redis Cluster - # - # The `redis.googleapis.com` service implements the Google Cloud Memorystore - # for Redis API and defines the following resource model for managing Redis - # clusters: - # * The service works with a collection of cloud projects, named: `/projects/*` - # * Each project has a collection of available locations, named: `/locations/*` - # * Each location has a collection of Redis clusters, named: `/clusters/*` - # * As such, Redis clusters are resources of the form: - # `/projects/{project_id}/locations/{location_id}/clusters/{instance_id}` - # - # Note that location_id must be a GCP `region`; for example: - # * `projects/redpepper-1290/locations/us-central1/clusters/my-redis` - # - # @example Load this service and instantiate a gRPC client - # - # require "google/cloud/redis/cluster/v1beta1/cloud_redis_cluster" - # client = ::Google::Cloud::Redis::Cluster::V1beta1::CloudRedisCluster::Client.new - # - # @example Load this service and instantiate a REST client - # - # require "google/cloud/redis/cluster/v1beta1/cloud_redis_cluster/rest" - # client = ::Google::Cloud::Redis::Cluster::V1beta1::CloudRedisCluster::Rest::Client.new - # - module CloudRedisCluster - end - end - end - end - end -end - -helper_path = ::File.join __dir__, "cloud_redis_cluster", "helpers.rb" -require "google/cloud/redis/cluster/v1beta1/cloud_redis_cluster/helpers" if ::File.file? helper_path diff --git a/owl-bot-staging/google-cloud-redis-cluster-v1beta1/lib/google/cloud/redis/cluster/v1beta1/cloud_redis_cluster/client.rb b/owl-bot-staging/google-cloud-redis-cluster-v1beta1/lib/google/cloud/redis/cluster/v1beta1/cloud_redis_cluster/client.rb deleted file mode 100644 index 2c3aeac42e98..000000000000 --- a/owl-bot-staging/google-cloud-redis-cluster-v1beta1/lib/google/cloud/redis/cluster/v1beta1/cloud_redis_cluster/client.rb +++ /dev/null @@ -1,1958 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -require "google/cloud/errors" -require "google/cloud/redis/cluster/v1beta1/cloud_redis_cluster_pb" -require "google/cloud/location" - -module Google - module Cloud - module Redis - module Cluster - module V1beta1 - module CloudRedisCluster - ## - # Client for the CloudRedisCluster service. - # - # Configures and manages Cloud Memorystore for Redis clusters - # - # Google Cloud Memorystore for Redis Cluster - # - # The `redis.googleapis.com` service implements the Google Cloud Memorystore - # for Redis API and defines the following resource model for managing Redis - # clusters: - # * The service works with a collection of cloud projects, named: `/projects/*` - # * Each project has a collection of available locations, named: `/locations/*` - # * Each location has a collection of Redis clusters, named: `/clusters/*` - # * As such, Redis clusters are resources of the form: - # `/projects/{project_id}/locations/{location_id}/clusters/{instance_id}` - # - # Note that location_id must be a GCP `region`; for example: - # * `projects/redpepper-1290/locations/us-central1/clusters/my-redis` - # - class Client - # @private - API_VERSION = "" - - # @private - DEFAULT_ENDPOINT_TEMPLATE = "redis.$UNIVERSE_DOMAIN$" - - include Paths - - # @private - attr_reader :cloud_redis_cluster_stub - - ## - # Configure the CloudRedisCluster Client class. - # - # See {::Google::Cloud::Redis::Cluster::V1beta1::CloudRedisCluster::Client::Configuration} - # for a description of the configuration fields. - # - # @example - # - # # Modify the configuration for all CloudRedisCluster clients - # ::Google::Cloud::Redis::Cluster::V1beta1::CloudRedisCluster::Client.configure do |config| - # config.timeout = 10.0 - # end - # - # @yield [config] Configure the Client client. - # @yieldparam config [Client::Configuration] - # - # @return [Client::Configuration] - # - def self.configure - @configure ||= begin - namespace = ["Google", "Cloud", "Redis", "Cluster", "V1beta1"] - parent_config = while namespace.any? - parent_name = namespace.join "::" - parent_const = const_get parent_name - break parent_const.configure if parent_const.respond_to? :configure - namespace.pop - end - default_config = Client::Configuration.new parent_config - - default_config.rpcs.list_clusters.timeout = 600.0 - - default_config.rpcs.get_cluster.timeout = 600.0 - - default_config.rpcs.update_cluster.timeout = 600.0 - - default_config.rpcs.delete_cluster.timeout = 600.0 - - default_config.rpcs.create_cluster.timeout = 600.0 - - default_config.rpcs.get_cluster_certificate_authority.timeout = 600.0 - - default_config.rpcs.reschedule_cluster_maintenance.timeout = 600.0 - - default_config.rpcs.list_backup_collections.timeout = 600.0 - - default_config.rpcs.get_backup_collection.timeout = 600.0 - - default_config.rpcs.list_backups.timeout = 600.0 - - default_config.rpcs.get_backup.timeout = 600.0 - - default_config.rpcs.delete_backup.timeout = 600.0 - - default_config.rpcs.export_backup.timeout = 600.0 - - default_config.rpcs.backup_cluster.timeout = 600.0 - - default_config - end - yield @configure if block_given? - @configure - end - - ## - # Configure the CloudRedisCluster Client instance. - # - # The configuration is set to the derived mode, meaning that values can be changed, - # but structural changes (adding new fields, etc.) are not allowed. Structural changes - # should be made on {Client.configure}. - # - # See {::Google::Cloud::Redis::Cluster::V1beta1::CloudRedisCluster::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 - @cloud_redis_cluster_stub.universe_domain - end - - ## - # Create a new CloudRedisCluster client object. - # - # @example - # - # # Create a client using the default configuration - # client = ::Google::Cloud::Redis::Cluster::V1beta1::CloudRedisCluster::Client.new - # - # # Create a client using a custom configuration - # client = ::Google::Cloud::Redis::Cluster::V1beta1::CloudRedisCluster::Client.new do |config| - # config.timeout = 10.0 - # end - # - # @yield [config] Configure the CloudRedisCluster client. - # @yieldparam config [Client::Configuration] - # - def initialize - # These require statements are intentionally placed here to initialize - # the gRPC module only when it's required. - # See https://github.com/googleapis/toolkit/issues/446 - require "gapic/grpc" - require "google/cloud/redis/cluster/v1beta1/cloud_redis_cluster_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 - - @cloud_redis_cluster_stub = ::Gapic::ServiceStub.new( - ::Google::Cloud::Redis::Cluster::V1beta1::CloudRedisCluster::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 - ) - - @cloud_redis_cluster_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 = @cloud_redis_cluster_stub.endpoint - config.universe_domain = @cloud_redis_cluster_stub.universe_domain - config.logger = @cloud_redis_cluster_stub.logger if config.respond_to? :logger= - end - end - - ## - # Get the associated client for long-running operations. - # - # @return [::Google::Cloud::Redis::Cluster::V1beta1::CloudRedisCluster::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 - @cloud_redis_cluster_stub.logger - end - - # Service calls - - ## - # Lists all Redis clusters owned by a project in either the specified - # location (region) or all locations. - # - # The location should have the following format: - # - # * `projects/{project_id}/locations/{location_id}` - # - # If `location_id` is specified as `-` (wildcard), then all regions - # available to the project are queried, and the results are aggregated. - # - # @overload list_clusters(request, options = nil) - # Pass arguments to `list_clusters` via a request object, either of type - # {::Google::Cloud::Redis::Cluster::V1beta1::ListClustersRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Redis::Cluster::V1beta1::ListClustersRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_clusters(parent: nil, page_size: nil, page_token: nil) - # Pass arguments to `list_clusters` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param parent [::String] - # Required. The resource name of the cluster location using the form: - # `projects/{project_id}/locations/{location_id}` - # where `location_id` refers to a GCP region. - # @param page_size [::Integer] - # The maximum number of items to return. - # - # If not specified, a default value of 1000 will be used by the service. - # Regardless of the page_size value, the response may include a partial list - # and a caller should only rely on response's - # {::Google::Cloud::Redis::Cluster::V1beta1::ListClustersResponse#next_page_token `next_page_token`} - # to determine if there are more clusters left to be queried. - # @param page_token [::String] - # The `next_page_token` value returned from a previous - # [ListClusters][CloudRedis.ListClusters] request, if any. - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Gapic::PagedEnumerable<::Google::Cloud::Redis::Cluster::V1beta1::Cluster>] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Gapic::PagedEnumerable<::Google::Cloud::Redis::Cluster::V1beta1::Cluster>] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/cloud/redis/cluster/v1beta1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Redis::Cluster::V1beta1::CloudRedisCluster::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Redis::Cluster::V1beta1::ListClustersRequest.new - # - # # Call the list_clusters method. - # result = client.list_clusters request - # - # # The returned object is of type Gapic::PagedEnumerable. You can iterate - # # over elements, and API calls will be issued to fetch pages as needed. - # result.each do |item| - # # Each element is of type ::Google::Cloud::Redis::Cluster::V1beta1::Cluster. - # p item - # end - # - def list_clusters request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Redis::Cluster::V1beta1::ListClustersRequest - - # Converts hash 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_clusters.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::Redis::Cluster::V1beta1::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_clusters.timeout, - metadata: metadata, - retry_policy: @config.rpcs.list_clusters.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @cloud_redis_cluster_stub.call_rpc :list_clusters, request, options: options do |response, operation| - response = ::Gapic::PagedEnumerable.new @cloud_redis_cluster_stub, :list_clusters, request, response, operation, options - yield response, operation if block_given? - throw :response, response - end - rescue ::GRPC::BadStatus => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Gets the details of a specific Redis cluster. - # - # @overload get_cluster(request, options = nil) - # Pass arguments to `get_cluster` via a request object, either of type - # {::Google::Cloud::Redis::Cluster::V1beta1::GetClusterRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Redis::Cluster::V1beta1::GetClusterRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_cluster(name: nil) - # Pass arguments to `get_cluster` via keyword arguments. Note that at - # least one keyword argument is 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. Redis cluster resource name using the form: - # `projects/{project_id}/locations/{location_id}/clusters/{cluster_id}` - # where `location_id` refers to a GCP region. - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Google::Cloud::Redis::Cluster::V1beta1::Cluster] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Google::Cloud::Redis::Cluster::V1beta1::Cluster] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/cloud/redis/cluster/v1beta1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Redis::Cluster::V1beta1::CloudRedisCluster::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Redis::Cluster::V1beta1::GetClusterRequest.new - # - # # Call the get_cluster method. - # result = client.get_cluster request - # - # # The returned object is of type Google::Cloud::Redis::Cluster::V1beta1::Cluster. - # p result - # - def get_cluster request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Redis::Cluster::V1beta1::GetClusterRequest - - # Converts hash 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_cluster.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::Redis::Cluster::V1beta1::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_cluster.timeout, - metadata: metadata, - retry_policy: @config.rpcs.get_cluster.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @cloud_redis_cluster_stub.call_rpc :get_cluster, request, options: options do |response, operation| - yield response, operation if block_given? - end - rescue ::GRPC::BadStatus => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Updates the metadata and configuration of a specific Redis cluster. - # - # Completed longrunning.Operation will contain the new cluster object - # in the response field. The returned operation is automatically deleted - # after a few hours, so there is no need to call DeleteOperation. - # - # @overload update_cluster(request, options = nil) - # Pass arguments to `update_cluster` via a request object, either of type - # {::Google::Cloud::Redis::Cluster::V1beta1::UpdateClusterRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Redis::Cluster::V1beta1::UpdateClusterRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_cluster(update_mask: nil, cluster: nil, request_id: nil) - # Pass arguments to `update_cluster` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param update_mask [::Google::Protobuf::FieldMask, ::Hash] - # Required. Mask of fields to update. At least one path must be supplied in - # this field. The elements of the repeated paths field may only include these - # fields from {::Google::Cloud::Redis::Cluster::V1beta1::Cluster Cluster}: - # - # * `size_gb` - # * `replica_count` - # @param cluster [::Google::Cloud::Redis::Cluster::V1beta1::Cluster, ::Hash] - # Required. Update description. - # Only fields specified in update_mask are updated. - # @param request_id [::String] - # Idempotent request UUID. - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Gapic::Operation] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Gapic::Operation] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/cloud/redis/cluster/v1beta1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Redis::Cluster::V1beta1::CloudRedisCluster::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Redis::Cluster::V1beta1::UpdateClusterRequest.new - # - # # Call the update_cluster method. - # result = client.update_cluster 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_cluster request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Redis::Cluster::V1beta1::UpdateClusterRequest - - # Converts hash 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_cluster.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::Redis::Cluster::V1beta1::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.cluster&.name - header_params["cluster.name"] = request.cluster.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_cluster.timeout, - metadata: metadata, - retry_policy: @config.rpcs.update_cluster.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @cloud_redis_cluster_stub.call_rpc :update_cluster, 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 specific Redis cluster. Cluster stops serving and data is - # deleted. - # - # @overload delete_cluster(request, options = nil) - # Pass arguments to `delete_cluster` via a request object, either of type - # {::Google::Cloud::Redis::Cluster::V1beta1::DeleteClusterRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Redis::Cluster::V1beta1::DeleteClusterRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_cluster(name: nil, request_id: nil) - # Pass arguments to `delete_cluster` via keyword arguments. Note that at - # least one keyword argument is 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. Redis cluster resource name using the form: - # `projects/{project_id}/locations/{location_id}/clusters/{cluster_id}` - # where `location_id` refers to a GCP region. - # @param request_id [::String] - # Idempotent request UUID. - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Gapic::Operation] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Gapic::Operation] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/cloud/redis/cluster/v1beta1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Redis::Cluster::V1beta1::CloudRedisCluster::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Redis::Cluster::V1beta1::DeleteClusterRequest.new - # - # # Call the delete_cluster method. - # result = client.delete_cluster 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_cluster request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Redis::Cluster::V1beta1::DeleteClusterRequest - - # Converts hash 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_cluster.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::Redis::Cluster::V1beta1::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_cluster.timeout, - metadata: metadata, - retry_policy: @config.rpcs.delete_cluster.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @cloud_redis_cluster_stub.call_rpc :delete_cluster, 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 - - ## - # Creates a Redis cluster based on the specified properties. - # The creation is executed asynchronously and callers may check the returned - # operation to track its progress. Once the operation is completed the Redis - # cluster will be fully functional. The completed longrunning.Operation will - # contain the new cluster object in the response field. - # - # The returned operation is automatically deleted after a few hours, so there - # is no need to call DeleteOperation. - # - # @overload create_cluster(request, options = nil) - # Pass arguments to `create_cluster` via a request object, either of type - # {::Google::Cloud::Redis::Cluster::V1beta1::CreateClusterRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Redis::Cluster::V1beta1::CreateClusterRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_cluster(parent: nil, cluster_id: nil, cluster: nil, request_id: nil) - # Pass arguments to `create_cluster` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param parent [::String] - # Required. The resource name of the cluster location using the form: - # `projects/{project_id}/locations/{location_id}` - # where `location_id` refers to a GCP region. - # @param cluster_id [::String] - # Required. The logical name of the Redis cluster in the customer project - # with the following restrictions: - # - # * Must contain only lowercase letters, numbers, and hyphens. - # * Must start with a letter. - # * Must be between 1-63 characters. - # * Must end with a number or a letter. - # * Must be unique within the customer project / location - # @param cluster [::Google::Cloud::Redis::Cluster::V1beta1::Cluster, ::Hash] - # Required. The cluster that is to be created. - # @param request_id [::String] - # Idempotent request UUID. - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Gapic::Operation] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Gapic::Operation] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/cloud/redis/cluster/v1beta1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Redis::Cluster::V1beta1::CloudRedisCluster::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Redis::Cluster::V1beta1::CreateClusterRequest.new - # - # # Call the create_cluster method. - # result = client.create_cluster 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_cluster request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Redis::Cluster::V1beta1::CreateClusterRequest - - # Converts hash 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_cluster.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::Redis::Cluster::V1beta1::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_cluster.timeout, - metadata: metadata, - retry_policy: @config.rpcs.create_cluster.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @cloud_redis_cluster_stub.call_rpc :create_cluster, 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 the details of certificate authority information for Redis cluster. - # - # @overload get_cluster_certificate_authority(request, options = nil) - # Pass arguments to `get_cluster_certificate_authority` via a request object, either of type - # {::Google::Cloud::Redis::Cluster::V1beta1::GetClusterCertificateAuthorityRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Redis::Cluster::V1beta1::GetClusterCertificateAuthorityRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_cluster_certificate_authority(name: nil) - # Pass arguments to `get_cluster_certificate_authority` via keyword arguments. Note that at - # least one keyword argument is 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. Redis cluster certificate authority resource name using the form: - # `projects/{project_id}/locations/{location_id}/clusters/{cluster_id}/certificateAuthority` - # where `location_id` refers to a GCP region. - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Google::Cloud::Redis::Cluster::V1beta1::CertificateAuthority] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Google::Cloud::Redis::Cluster::V1beta1::CertificateAuthority] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/cloud/redis/cluster/v1beta1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Redis::Cluster::V1beta1::CloudRedisCluster::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Redis::Cluster::V1beta1::GetClusterCertificateAuthorityRequest.new - # - # # Call the get_cluster_certificate_authority method. - # result = client.get_cluster_certificate_authority request - # - # # The returned object is of type Google::Cloud::Redis::Cluster::V1beta1::CertificateAuthority. - # p result - # - def get_cluster_certificate_authority request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Redis::Cluster::V1beta1::GetClusterCertificateAuthorityRequest - - # Converts hash 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_cluster_certificate_authority.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::Redis::Cluster::V1beta1::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_cluster_certificate_authority.timeout, - metadata: metadata, - retry_policy: @config.rpcs.get_cluster_certificate_authority.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @cloud_redis_cluster_stub.call_rpc :get_cluster_certificate_authority, 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 - - ## - # Reschedules upcoming maintenance event. - # - # @overload reschedule_cluster_maintenance(request, options = nil) - # Pass arguments to `reschedule_cluster_maintenance` via a request object, either of type - # {::Google::Cloud::Redis::Cluster::V1beta1::RescheduleClusterMaintenanceRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Redis::Cluster::V1beta1::RescheduleClusterMaintenanceRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. - # - # @overload reschedule_cluster_maintenance(name: nil, reschedule_type: nil, schedule_time: nil) - # Pass arguments to `reschedule_cluster_maintenance` via keyword arguments. Note that at - # least one keyword argument is 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. Redis Cluster instance resource name using the form: - # `projects/{project_id}/locations/{location_id}/clusters/{cluster_id}` - # where `location_id` refers to a GCP region. - # @param reschedule_type [::Google::Cloud::Redis::Cluster::V1beta1::RescheduleClusterMaintenanceRequest::RescheduleType] - # Required. If reschedule type is SPECIFIC_TIME, must set up schedule_time as - # well. - # @param schedule_time [::Google::Protobuf::Timestamp, ::Hash] - # Optional. Timestamp when the maintenance shall be rescheduled to if - # reschedule_type=SPECIFIC_TIME, in RFC 3339 format, for - # example `2012-11-15T16:19:00.094Z`. - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Gapic::Operation] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Gapic::Operation] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/cloud/redis/cluster/v1beta1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Redis::Cluster::V1beta1::CloudRedisCluster::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Redis::Cluster::V1beta1::RescheduleClusterMaintenanceRequest.new - # - # # Call the reschedule_cluster_maintenance method. - # result = client.reschedule_cluster_maintenance 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 reschedule_cluster_maintenance request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Redis::Cluster::V1beta1::RescheduleClusterMaintenanceRequest - - # Converts hash 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.reschedule_cluster_maintenance.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::Redis::Cluster::V1beta1::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.reschedule_cluster_maintenance.timeout, - metadata: metadata, - retry_policy: @config.rpcs.reschedule_cluster_maintenance.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @cloud_redis_cluster_stub.call_rpc :reschedule_cluster_maintenance, 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 all backup collections owned by a consumer project in either the - # specified location (region) or all locations. - # - # If `location_id` is specified as `-` (wildcard), then all regions - # available to the project are queried, and the results are aggregated. - # - # @overload list_backup_collections(request, options = nil) - # Pass arguments to `list_backup_collections` via a request object, either of type - # {::Google::Cloud::Redis::Cluster::V1beta1::ListBackupCollectionsRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Redis::Cluster::V1beta1::ListBackupCollectionsRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_backup_collections(parent: nil, page_size: nil, page_token: nil) - # Pass arguments to `list_backup_collections` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param parent [::String] - # Required. The resource name of the backupCollection location using the - # form: - # `projects/{project_id}/locations/{location_id}` - # where `location_id` refers to a GCP region. - # @param page_size [::Integer] - # Optional. The maximum number of items to return. - # - # If not specified, a default value of 1000 will be used by the service. - # Regardless of the page_size value, the response may include a partial list - # and a caller should only rely on response's - # {::Google::Cloud::Redis::Cluster::V1beta1::ListBackupCollectionsResponse#next_page_token `next_page_token`} - # to determine if there are more clusters left to be queried. - # @param page_token [::String] - # Optional. The `next_page_token` value returned from a previous - # [ListBackupCollections] request, if any. - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Gapic::PagedEnumerable<::Google::Cloud::Redis::Cluster::V1beta1::BackupCollection>] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Gapic::PagedEnumerable<::Google::Cloud::Redis::Cluster::V1beta1::BackupCollection>] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/cloud/redis/cluster/v1beta1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Redis::Cluster::V1beta1::CloudRedisCluster::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Redis::Cluster::V1beta1::ListBackupCollectionsRequest.new - # - # # Call the list_backup_collections method. - # result = client.list_backup_collections request - # - # # The returned object is of type Gapic::PagedEnumerable. You can iterate - # # over elements, and API calls will be issued to fetch pages as needed. - # result.each do |item| - # # Each element is of type ::Google::Cloud::Redis::Cluster::V1beta1::BackupCollection. - # p item - # end - # - def list_backup_collections request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Redis::Cluster::V1beta1::ListBackupCollectionsRequest - - # Converts hash 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_backup_collections.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::Redis::Cluster::V1beta1::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_backup_collections.timeout, - metadata: metadata, - retry_policy: @config.rpcs.list_backup_collections.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @cloud_redis_cluster_stub.call_rpc :list_backup_collections, request, options: options do |response, operation| - response = ::Gapic::PagedEnumerable.new @cloud_redis_cluster_stub, :list_backup_collections, 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 - - ## - # Get a backup collection. - # - # @overload get_backup_collection(request, options = nil) - # Pass arguments to `get_backup_collection` via a request object, either of type - # {::Google::Cloud::Redis::Cluster::V1beta1::GetBackupCollectionRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Redis::Cluster::V1beta1::GetBackupCollectionRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_backup_collection(name: nil) - # Pass arguments to `get_backup_collection` via keyword arguments. Note that at - # least one keyword argument is 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. Redis backupCollection resource name using the form: - # `projects/{project_id}/locations/{location_id}/backupCollections/{backup_collection_id}` - # where `location_id` refers to a GCP region. - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Google::Cloud::Redis::Cluster::V1beta1::BackupCollection] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Google::Cloud::Redis::Cluster::V1beta1::BackupCollection] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/cloud/redis/cluster/v1beta1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Redis::Cluster::V1beta1::CloudRedisCluster::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Redis::Cluster::V1beta1::GetBackupCollectionRequest.new - # - # # Call the get_backup_collection method. - # result = client.get_backup_collection request - # - # # The returned object is of type Google::Cloud::Redis::Cluster::V1beta1::BackupCollection. - # p result - # - def get_backup_collection request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Redis::Cluster::V1beta1::GetBackupCollectionRequest - - # Converts hash 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_backup_collection.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::Redis::Cluster::V1beta1::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_backup_collection.timeout, - metadata: metadata, - retry_policy: @config.rpcs.get_backup_collection.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @cloud_redis_cluster_stub.call_rpc :get_backup_collection, request, options: options do |response, operation| - yield response, operation if block_given? - end - rescue ::GRPC::BadStatus => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Lists all backups owned by a backup collection. - # - # @overload list_backups(request, options = nil) - # Pass arguments to `list_backups` via a request object, either of type - # {::Google::Cloud::Redis::Cluster::V1beta1::ListBackupsRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Redis::Cluster::V1beta1::ListBackupsRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_backups(parent: nil, page_size: nil, page_token: nil) - # Pass arguments to `list_backups` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param parent [::String] - # Required. The resource name of the backupCollection using the form: - # `projects/{project_id}/locations/{location_id}/backupCollections/{backup_collection_id}` - # @param page_size [::Integer] - # Optional. The maximum number of items to return. - # - # If not specified, a default value of 1000 will be used by the service. - # Regardless of the page_size value, the response may include a partial list - # and a caller should only rely on response's - # {::Google::Cloud::Redis::Cluster::V1beta1::ListBackupsResponse#next_page_token `next_page_token`} - # to determine if there are more clusters left to be queried. - # @param page_token [::String] - # Optional. The `next_page_token` value returned from a previous - # [ListBackupCollections] request, if any. - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Gapic::PagedEnumerable<::Google::Cloud::Redis::Cluster::V1beta1::Backup>] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Gapic::PagedEnumerable<::Google::Cloud::Redis::Cluster::V1beta1::Backup>] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/cloud/redis/cluster/v1beta1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Redis::Cluster::V1beta1::CloudRedisCluster::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Redis::Cluster::V1beta1::ListBackupsRequest.new - # - # # Call the list_backups method. - # result = client.list_backups request - # - # # The returned object is of type Gapic::PagedEnumerable. You can iterate - # # over elements, and API calls will be issued to fetch pages as needed. - # result.each do |item| - # # Each element is of type ::Google::Cloud::Redis::Cluster::V1beta1::Backup. - # p item - # end - # - def list_backups request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Redis::Cluster::V1beta1::ListBackupsRequest - - # Converts hash 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_backups.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::Redis::Cluster::V1beta1::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_backups.timeout, - metadata: metadata, - retry_policy: @config.rpcs.list_backups.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @cloud_redis_cluster_stub.call_rpc :list_backups, request, options: options do |response, operation| - response = ::Gapic::PagedEnumerable.new @cloud_redis_cluster_stub, :list_backups, request, response, operation, options - yield response, operation if block_given? - throw :response, response - end - rescue ::GRPC::BadStatus => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Gets the details of a specific backup. - # - # @overload get_backup(request, options = nil) - # Pass arguments to `get_backup` via a request object, either of type - # {::Google::Cloud::Redis::Cluster::V1beta1::GetBackupRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Redis::Cluster::V1beta1::GetBackupRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_backup(name: nil) - # Pass arguments to `get_backup` via keyword arguments. Note that at - # least one keyword argument is 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. Redis backup resource name using the form: - # `projects/{project_id}/locations/{location_id}/backupCollections/{backup_collection_id}/backups/{backup_id}` - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Google::Cloud::Redis::Cluster::V1beta1::Backup] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Google::Cloud::Redis::Cluster::V1beta1::Backup] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/cloud/redis/cluster/v1beta1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Redis::Cluster::V1beta1::CloudRedisCluster::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Redis::Cluster::V1beta1::GetBackupRequest.new - # - # # Call the get_backup method. - # result = client.get_backup request - # - # # The returned object is of type Google::Cloud::Redis::Cluster::V1beta1::Backup. - # p result - # - def get_backup request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Redis::Cluster::V1beta1::GetBackupRequest - - # Converts hash 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_backup.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::Redis::Cluster::V1beta1::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_backup.timeout, - metadata: metadata, - retry_policy: @config.rpcs.get_backup.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @cloud_redis_cluster_stub.call_rpc :get_backup, request, options: options do |response, operation| - yield response, operation if block_given? - end - rescue ::GRPC::BadStatus => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Deletes a specific backup. - # - # @overload delete_backup(request, options = nil) - # Pass arguments to `delete_backup` via a request object, either of type - # {::Google::Cloud::Redis::Cluster::V1beta1::DeleteBackupRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Redis::Cluster::V1beta1::DeleteBackupRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_backup(name: nil, request_id: nil) - # Pass arguments to `delete_backup` via keyword arguments. Note that at - # least one keyword argument is 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. Redis backup resource name using the form: - # `projects/{project_id}/locations/{location_id}/backupCollections/{backup_collection_id}/backups/{backup_id}` - # @param request_id [::String] - # Optional. Idempotent request UUID. - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Gapic::Operation] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Gapic::Operation] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/cloud/redis/cluster/v1beta1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Redis::Cluster::V1beta1::CloudRedisCluster::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Redis::Cluster::V1beta1::DeleteBackupRequest.new - # - # # Call the delete_backup method. - # result = client.delete_backup 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_backup request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Redis::Cluster::V1beta1::DeleteBackupRequest - - # Converts hash 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_backup.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::Redis::Cluster::V1beta1::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_backup.timeout, - metadata: metadata, - retry_policy: @config.rpcs.delete_backup.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @cloud_redis_cluster_stub.call_rpc :delete_backup, 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 - - ## - # Exports a specific backup to a customer target Cloud Storage URI. - # - # @overload export_backup(request, options = nil) - # Pass arguments to `export_backup` via a request object, either of type - # {::Google::Cloud::Redis::Cluster::V1beta1::ExportBackupRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Redis::Cluster::V1beta1::ExportBackupRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. - # - # @overload export_backup(gcs_bucket: nil, name: nil) - # Pass arguments to `export_backup` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param gcs_bucket [::String] - # Google Cloud Storage bucket, like "my-bucket". - # @param name [::String] - # Required. Redis backup resource name using the form: - # `projects/{project_id}/locations/{location_id}/backupCollections/{backup_collection_id}/backups/{backup_id}` - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Gapic::Operation] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Gapic::Operation] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/cloud/redis/cluster/v1beta1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Redis::Cluster::V1beta1::CloudRedisCluster::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Redis::Cluster::V1beta1::ExportBackupRequest.new - # - # # Call the export_backup method. - # result = client.export_backup 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 export_backup request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Redis::Cluster::V1beta1::ExportBackupRequest - - # Converts hash 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.export_backup.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::Redis::Cluster::V1beta1::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.export_backup.timeout, - metadata: metadata, - retry_policy: @config.rpcs.export_backup.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @cloud_redis_cluster_stub.call_rpc :export_backup, 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 - - ## - # Backup Redis Cluster. - # If this is the first time a backup is being created, a backup collection - # will be created at the backend, and this backup belongs to this collection. - # Both collection and backup will have a resource name. Backup will be - # executed for each shard. A replica (primary if nonHA) will be selected to - # perform the execution. Backup call will be rejected if there is an ongoing - # backup or update operation. Be aware that during preview, if the cluster's - # internal software version is too old, critical update will be performed - # before actual backup. Once the internal software version is updated to the - # minimum version required by the backup feature, subsequent backups will not - # require critical update. After preview, there will be no critical update - # needed for backup. - # - # @overload backup_cluster(request, options = nil) - # Pass arguments to `backup_cluster` via a request object, either of type - # {::Google::Cloud::Redis::Cluster::V1beta1::BackupClusterRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Redis::Cluster::V1beta1::BackupClusterRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. - # - # @overload backup_cluster(name: nil, ttl: nil, backup_id: nil) - # Pass arguments to `backup_cluster` via keyword arguments. Note that at - # least one keyword argument is 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. Redis cluster resource name using the form: - # `projects/{project_id}/locations/{location_id}/clusters/{cluster_id}` - # where `location_id` refers to a GCP region. - # @param ttl [::Google::Protobuf::Duration, ::Hash] - # Optional. TTL for the backup to expire. Value range is 1 day to 100 years. - # If not specified, the default value is 100 years. - # @param backup_id [::String] - # Optional. The id of the backup to be created. If not specified, the - # default value ([YYYYMMDDHHMMSS]_[Shortened Cluster UID] is 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/cloud/redis/cluster/v1beta1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Redis::Cluster::V1beta1::CloudRedisCluster::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Redis::Cluster::V1beta1::BackupClusterRequest.new - # - # # Call the backup_cluster method. - # result = client.backup_cluster 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 backup_cluster request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Redis::Cluster::V1beta1::BackupClusterRequest - - # Converts hash 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.backup_cluster.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::Redis::Cluster::V1beta1::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.backup_cluster.timeout, - metadata: metadata, - retry_policy: @config.rpcs.backup_cluster.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @cloud_redis_cluster_stub.call_rpc :backup_cluster, 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 CloudRedisCluster API. - # - # This class represents the configuration for CloudRedisCluster, - # providing control over timeouts, retry behavior, logging, transport - # parameters, and other low-level controls. Certain parameters can also be - # applied individually to specific RPCs. See - # {::Google::Cloud::Redis::Cluster::V1beta1::CloudRedisCluster::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_clusters to 20 seconds, - # # and all remaining timeouts to 10 seconds. - # ::Google::Cloud::Redis::Cluster::V1beta1::CloudRedisCluster::Client.configure do |config| - # config.timeout = 10.0 - # config.rpcs.list_clusters.timeout = 20.0 - # end - # - # # Apply the above configuration only to a new client. - # client = ::Google::Cloud::Redis::Cluster::V1beta1::CloudRedisCluster::Client.new do |config| - # config.timeout = 10.0 - # config.rpcs.list_clusters.timeout = 20.0 - # end - # - # @!attribute [rw] endpoint - # A custom service endpoint, as a hostname or hostname:port. The default is - # nil, indicating to use the default endpoint in the current universe domain. - # @return [::String,nil] - # @!attribute [rw] credentials - # Credentials to send with calls. You may provide any of the following types: - # * (`Google::Auth::Credentials`) A googleauth credentials object - # (see the [googleauth docs](https://rubydoc.info/gems/googleauth/Google/Auth/Credentials)) - # * (`Signet::OAuth2::Client`) A signet oauth2 client object - # (see the [signet docs](https://rubydoc.info/gems/signet/Signet/OAuth2/Client)) - # * (`GRPC::Core::Channel`) a gRPC channel with included credentials - # * (`GRPC::Core::ChannelCredentials`) a gRPC credentails object - # * (`nil`) indicating no credentials - # - # @note Warning: Passing a `String` to a keyfile path or a `Hash` of credentials - # is deprecated. Providing an unvalidated credential configuration to - # Google APIs can compromise the security of your systems and data. - # - # @example - # - # # The recommended way to provide credentials is to use the `make_creds` method - # # on the appropriate credentials class for your environment. - # - # require "googleauth" - # - # credentials = ::Google::Auth::ServiceAccountCredentials.make_creds( - # json_key_io: ::File.open("/path/to/keyfile.json") - # ) - # - # client = ::Google::Cloud::Redis::Cluster::V1beta1::CloudRedisCluster::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 = "redis.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 CloudRedisCluster 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_clusters` - # @return [::Gapic::Config::Method] - # - attr_reader :list_clusters - ## - # RPC-specific configuration for `get_cluster` - # @return [::Gapic::Config::Method] - # - attr_reader :get_cluster - ## - # RPC-specific configuration for `update_cluster` - # @return [::Gapic::Config::Method] - # - attr_reader :update_cluster - ## - # RPC-specific configuration for `delete_cluster` - # @return [::Gapic::Config::Method] - # - attr_reader :delete_cluster - ## - # RPC-specific configuration for `create_cluster` - # @return [::Gapic::Config::Method] - # - attr_reader :create_cluster - ## - # RPC-specific configuration for `get_cluster_certificate_authority` - # @return [::Gapic::Config::Method] - # - attr_reader :get_cluster_certificate_authority - ## - # RPC-specific configuration for `reschedule_cluster_maintenance` - # @return [::Gapic::Config::Method] - # - attr_reader :reschedule_cluster_maintenance - ## - # RPC-specific configuration for `list_backup_collections` - # @return [::Gapic::Config::Method] - # - attr_reader :list_backup_collections - ## - # RPC-specific configuration for `get_backup_collection` - # @return [::Gapic::Config::Method] - # - attr_reader :get_backup_collection - ## - # RPC-specific configuration for `list_backups` - # @return [::Gapic::Config::Method] - # - attr_reader :list_backups - ## - # RPC-specific configuration for `get_backup` - # @return [::Gapic::Config::Method] - # - attr_reader :get_backup - ## - # RPC-specific configuration for `delete_backup` - # @return [::Gapic::Config::Method] - # - attr_reader :delete_backup - ## - # RPC-specific configuration for `export_backup` - # @return [::Gapic::Config::Method] - # - attr_reader :export_backup - ## - # RPC-specific configuration for `backup_cluster` - # @return [::Gapic::Config::Method] - # - attr_reader :backup_cluster - - # @private - def initialize parent_rpcs = nil - list_clusters_config = parent_rpcs.list_clusters if parent_rpcs.respond_to? :list_clusters - @list_clusters = ::Gapic::Config::Method.new list_clusters_config - get_cluster_config = parent_rpcs.get_cluster if parent_rpcs.respond_to? :get_cluster - @get_cluster = ::Gapic::Config::Method.new get_cluster_config - update_cluster_config = parent_rpcs.update_cluster if parent_rpcs.respond_to? :update_cluster - @update_cluster = ::Gapic::Config::Method.new update_cluster_config - delete_cluster_config = parent_rpcs.delete_cluster if parent_rpcs.respond_to? :delete_cluster - @delete_cluster = ::Gapic::Config::Method.new delete_cluster_config - create_cluster_config = parent_rpcs.create_cluster if parent_rpcs.respond_to? :create_cluster - @create_cluster = ::Gapic::Config::Method.new create_cluster_config - get_cluster_certificate_authority_config = parent_rpcs.get_cluster_certificate_authority if parent_rpcs.respond_to? :get_cluster_certificate_authority - @get_cluster_certificate_authority = ::Gapic::Config::Method.new get_cluster_certificate_authority_config - reschedule_cluster_maintenance_config = parent_rpcs.reschedule_cluster_maintenance if parent_rpcs.respond_to? :reschedule_cluster_maintenance - @reschedule_cluster_maintenance = ::Gapic::Config::Method.new reschedule_cluster_maintenance_config - list_backup_collections_config = parent_rpcs.list_backup_collections if parent_rpcs.respond_to? :list_backup_collections - @list_backup_collections = ::Gapic::Config::Method.new list_backup_collections_config - get_backup_collection_config = parent_rpcs.get_backup_collection if parent_rpcs.respond_to? :get_backup_collection - @get_backup_collection = ::Gapic::Config::Method.new get_backup_collection_config - list_backups_config = parent_rpcs.list_backups if parent_rpcs.respond_to? :list_backups - @list_backups = ::Gapic::Config::Method.new list_backups_config - get_backup_config = parent_rpcs.get_backup if parent_rpcs.respond_to? :get_backup - @get_backup = ::Gapic::Config::Method.new get_backup_config - delete_backup_config = parent_rpcs.delete_backup if parent_rpcs.respond_to? :delete_backup - @delete_backup = ::Gapic::Config::Method.new delete_backup_config - export_backup_config = parent_rpcs.export_backup if parent_rpcs.respond_to? :export_backup - @export_backup = ::Gapic::Config::Method.new export_backup_config - backup_cluster_config = parent_rpcs.backup_cluster if parent_rpcs.respond_to? :backup_cluster - @backup_cluster = ::Gapic::Config::Method.new backup_cluster_config - - yield self if block_given? - end - end - end - end - end - end - end - end - end -end diff --git a/owl-bot-staging/google-cloud-redis-cluster-v1beta1/lib/google/cloud/redis/cluster/v1beta1/cloud_redis_cluster/credentials.rb b/owl-bot-staging/google-cloud-redis-cluster-v1beta1/lib/google/cloud/redis/cluster/v1beta1/cloud_redis_cluster/credentials.rb deleted file mode 100644 index 95358ab0cf8d..000000000000 --- a/owl-bot-staging/google-cloud-redis-cluster-v1beta1/lib/google/cloud/redis/cluster/v1beta1/cloud_redis_cluster/credentials.rb +++ /dev/null @@ -1,49 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -require "googleauth" - -module Google - module Cloud - module Redis - module Cluster - module V1beta1 - module CloudRedisCluster - # Credentials for the CloudRedisCluster API. - class Credentials < ::Google::Auth::Credentials - self.scope = [ - "https://www.googleapis.com/auth/cloud-platform" - ] - self.env_vars = [ - "GOOGLE_CLOUD_CREDENTIALS", - "GOOGLE_CLOUD_KEYFILE", - "GCLOUD_KEYFILE", - "GOOGLE_CLOUD_CREDENTIALS_JSON", - "GOOGLE_CLOUD_KEYFILE_JSON", - "GCLOUD_KEYFILE_JSON" - ] - self.paths = [ - "~/.config/google_cloud/application_default_credentials.json" - ] - end - end - end - end - end - end -end diff --git a/owl-bot-staging/google-cloud-redis-cluster-v1beta1/lib/google/cloud/redis/cluster/v1beta1/cloud_redis_cluster/operations.rb b/owl-bot-staging/google-cloud-redis-cluster-v1beta1/lib/google/cloud/redis/cluster/v1beta1/cloud_redis_cluster/operations.rb deleted file mode 100644 index cef09e76cbb7..000000000000 --- a/owl-bot-staging/google-cloud-redis-cluster-v1beta1/lib/google/cloud/redis/cluster/v1beta1/cloud_redis_cluster/operations.rb +++ /dev/null @@ -1,843 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -require "gapic/operation" -require "google/longrunning/operations_pb" - -module Google - module Cloud - module Redis - module Cluster - module V1beta1 - module CloudRedisCluster - # Service that implements Longrunning Operations API. - class Operations - # @private - API_VERSION = "" - - # @private - DEFAULT_ENDPOINT_TEMPLATE = "redis.$UNIVERSE_DOMAIN$" - - # @private - attr_reader :operations_stub - - ## - # Configuration for the CloudRedisCluster 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 CloudRedisCluster 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::Redis::Cluster::V1beta1::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::Redis::Cluster::V1beta1::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::Redis::Cluster::V1beta1::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::Redis::Cluster::V1beta1::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::Redis::Cluster::V1beta1::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 = "redis.googleapis.com" - - config_attr :endpoint, nil, ::String, nil - config_attr :credentials, nil do |value| - allowed = [::String, ::Hash, ::Proc, ::Symbol, ::Google::Auth::Credentials, ::Google::Auth::BaseClient, ::Signet::OAuth2::Client, nil] - allowed += [::GRPC::Core::Channel, ::GRPC::Core::ChannelCredentials] if defined? ::GRPC::Core::Channel - allowed.any? { |klass| klass === value } - end - config_attr :scope, nil, ::String, ::Array, nil - config_attr :lib_name, nil, ::String, nil - config_attr :lib_version, nil, ::String, nil - config_attr(:channel_args, { "grpc.service_config_disable_resolution" => 1 }, ::Hash, nil) - config_attr :interceptors, nil, ::Array, nil - config_attr :timeout, nil, ::Numeric, nil - config_attr :metadata, nil, ::Hash, nil - config_attr :retry_policy, nil, ::Hash, ::Proc, nil - config_attr :quota_project, nil, ::String, nil - config_attr :universe_domain, nil, ::String, nil - config_attr :logger, :default, ::Logger, nil, :default - - # @private - def initialize parent_config = nil - @parent_config = parent_config unless parent_config.nil? - - yield self if block_given? - end - - ## - # Configurations for individual RPCs - # @return [Rpcs] - # - def rpcs - @rpcs ||= begin - parent_rpcs = nil - parent_rpcs = @parent_config.rpcs if defined?(@parent_config) && @parent_config.respond_to?(:rpcs) - Rpcs.new parent_rpcs - end - end - - ## - # Configuration for the channel pool - # @return [::Gapic::ServiceStub::ChannelPool::Configuration] - # - def channel_pool - @channel_pool ||= ::Gapic::ServiceStub::ChannelPool::Configuration.new - end - - ## - # Configuration RPC class for the Operations API. - # - # Includes fields providing the configuration for each RPC in this service. - # Each configuration object is of type `Gapic::Config::Method` and includes - # the following configuration fields: - # - # * `timeout` (*type:* `Numeric`) - The call timeout in seconds - # * `metadata` (*type:* `Hash{Symbol=>String}`) - Additional gRPC headers - # * `retry_policy (*type:* `Hash`) - The retry policy. The policy fields - # include the following keys: - # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds. - # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds. - # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier. - # * `:retry_codes` (*type:* `Array`) - The error codes that should - # trigger a retry. - # - class Rpcs - ## - # RPC-specific configuration for `list_operations` - # @return [::Gapic::Config::Method] - # - attr_reader :list_operations - ## - # RPC-specific configuration for `get_operation` - # @return [::Gapic::Config::Method] - # - attr_reader :get_operation - ## - # RPC-specific configuration for `delete_operation` - # @return [::Gapic::Config::Method] - # - attr_reader :delete_operation - ## - # RPC-specific configuration for `cancel_operation` - # @return [::Gapic::Config::Method] - # - attr_reader :cancel_operation - ## - # RPC-specific configuration for `wait_operation` - # @return [::Gapic::Config::Method] - # - attr_reader :wait_operation - - # @private - def initialize parent_rpcs = nil - list_operations_config = parent_rpcs.list_operations if parent_rpcs.respond_to? :list_operations - @list_operations = ::Gapic::Config::Method.new list_operations_config - get_operation_config = parent_rpcs.get_operation if parent_rpcs.respond_to? :get_operation - @get_operation = ::Gapic::Config::Method.new get_operation_config - delete_operation_config = parent_rpcs.delete_operation if parent_rpcs.respond_to? :delete_operation - @delete_operation = ::Gapic::Config::Method.new delete_operation_config - cancel_operation_config = parent_rpcs.cancel_operation if parent_rpcs.respond_to? :cancel_operation - @cancel_operation = ::Gapic::Config::Method.new cancel_operation_config - wait_operation_config = parent_rpcs.wait_operation if parent_rpcs.respond_to? :wait_operation - @wait_operation = ::Gapic::Config::Method.new wait_operation_config - - yield self if block_given? - end - end - end - end - end - end - end - end - end -end diff --git a/owl-bot-staging/google-cloud-redis-cluster-v1beta1/lib/google/cloud/redis/cluster/v1beta1/cloud_redis_cluster/paths.rb b/owl-bot-staging/google-cloud-redis-cluster-v1beta1/lib/google/cloud/redis/cluster/v1beta1/cloud_redis_cluster/paths.rb deleted file mode 100644 index 4e928f81d245..000000000000 --- a/owl-bot-staging/google-cloud-redis-cluster-v1beta1/lib/google/cloud/redis/cluster/v1beta1/cloud_redis_cluster/paths.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 Cloud - module Redis - module Cluster - module V1beta1 - module CloudRedisCluster - # Path helper methods for the CloudRedisCluster API. - module Paths - ## - # Create a fully-qualified Backup resource string. - # - # The resource will be in the following format: - # - # `projects/{project}/locations/{location}/backupCollections/{backup_collection}/backups/{backup}` - # - # @param project [String] - # @param location [String] - # @param backup_collection [String] - # @param backup [String] - # - # @return [::String] - def backup_path project:, location:, backup_collection:, backup: - raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" - raise ::ArgumentError, "location cannot contain /" if location.to_s.include? "/" - raise ::ArgumentError, "backup_collection cannot contain /" if backup_collection.to_s.include? "/" - - "projects/#{project}/locations/#{location}/backupCollections/#{backup_collection}/backups/#{backup}" - end - - ## - # Create a fully-qualified BackupCollection resource string. - # - # The resource will be in the following format: - # - # `projects/{project}/locations/{location}/backupCollections/{backup_collection}` - # - # @param project [String] - # @param location [String] - # @param backup_collection [String] - # - # @return [::String] - def backup_collection_path project:, location:, backup_collection: - raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" - raise ::ArgumentError, "location cannot contain /" if location.to_s.include? "/" - - "projects/#{project}/locations/#{location}/backupCollections/#{backup_collection}" - end - - ## - # Create a fully-qualified CertificateAuthority resource string. - # - # The resource will be in the following format: - # - # `projects/{project}/locations/{location}/clusters/{cluster}/certificateAuthority` - # - # @param project [String] - # @param location [String] - # @param cluster [String] - # - # @return [::String] - def certificate_authority_path project:, location:, cluster: - raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" - raise ::ArgumentError, "location cannot contain /" if location.to_s.include? "/" - - "projects/#{project}/locations/#{location}/clusters/#{cluster}/certificateAuthority" - end - - ## - # Create a fully-qualified Cluster resource string. - # - # The resource will be in the following format: - # - # `projects/{project}/locations/{location}/clusters/{cluster}` - # - # @param project [String] - # @param location [String] - # @param cluster [String] - # - # @return [::String] - def cluster_path project:, location:, cluster: - raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" - raise ::ArgumentError, "location cannot contain /" if location.to_s.include? "/" - - "projects/#{project}/locations/#{location}/clusters/#{cluster}" - end - - ## - # Create a fully-qualified CryptoKey resource string. - # - # The resource will be in the following format: - # - # `projects/{project}/locations/{location}/keyRings/{key_ring}/cryptoKeys/{crypto_key}` - # - # @param project [String] - # @param location [String] - # @param key_ring [String] - # @param crypto_key [String] - # - # @return [::String] - def crypto_key_path project:, location:, key_ring:, crypto_key: - raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" - raise ::ArgumentError, "location cannot contain /" if location.to_s.include? "/" - raise ::ArgumentError, "key_ring cannot contain /" if key_ring.to_s.include? "/" - - "projects/#{project}/locations/#{location}/keyRings/#{key_ring}/cryptoKeys/#{crypto_key}" - end - - ## - # Create a fully-qualified CryptoKeyVersion resource string. - # - # The resource will be in the following format: - # - # `projects/{project}/locations/{location}/keyRings/{key_ring}/cryptoKeys/{crypto_key}/cryptoKeyVersions/{crypto_key_version}` - # - # @param project [String] - # @param location [String] - # @param key_ring [String] - # @param crypto_key [String] - # @param crypto_key_version [String] - # - # @return [::String] - def crypto_key_version_path project:, location:, key_ring:, crypto_key:, crypto_key_version: - raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" - raise ::ArgumentError, "location cannot contain /" if location.to_s.include? "/" - raise ::ArgumentError, "key_ring cannot contain /" if key_ring.to_s.include? "/" - raise ::ArgumentError, "crypto_key cannot contain /" if crypto_key.to_s.include? "/" - - "projects/#{project}/locations/#{location}/keyRings/#{key_ring}/cryptoKeys/#{crypto_key}/cryptoKeyVersions/#{crypto_key_version}" - end - - ## - # Create a fully-qualified ForwardingRule resource string. - # - # The resource will be in the following format: - # - # `projects/{project}/regions/{region}/forwardingRules/{forwarding_rule}` - # - # @param project [String] - # @param region [String] - # @param forwarding_rule [String] - # - # @return [::String] - def forwarding_rule_path project:, region:, forwarding_rule: - raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" - raise ::ArgumentError, "region cannot contain /" if region.to_s.include? "/" - - "projects/#{project}/regions/#{region}/forwardingRules/#{forwarding_rule}" - 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 Network resource string. - # - # The resource will be in the following format: - # - # `projects/{project}/global/networks/{network}` - # - # @param project [String] - # @param network [String] - # - # @return [::String] - def network_path project:, network: - raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" - - "projects/#{project}/global/networks/#{network}" - end - - ## - # Create a fully-qualified ServiceAttachment resource string. - # - # The resource will be in the following format: - # - # `projects/{project}/regions/{region}/serviceAttachments/{service_attachment}` - # - # @param project [String] - # @param region [String] - # @param service_attachment [String] - # - # @return [::String] - def service_attachment_path project:, region:, service_attachment: - raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" - raise ::ArgumentError, "region cannot contain /" if region.to_s.include? "/" - - "projects/#{project}/regions/#{region}/serviceAttachments/#{service_attachment}" - end - - extend self - end - end - end - end - end - end -end diff --git a/owl-bot-staging/google-cloud-redis-cluster-v1beta1/lib/google/cloud/redis/cluster/v1beta1/cloud_redis_cluster/rest.rb b/owl-bot-staging/google-cloud-redis-cluster-v1beta1/lib/google/cloud/redis/cluster/v1beta1/cloud_redis_cluster/rest.rb deleted file mode 100644 index 9dcf91ae8976..000000000000 --- a/owl-bot-staging/google-cloud-redis-cluster-v1beta1/lib/google/cloud/redis/cluster/v1beta1/cloud_redis_cluster/rest.rb +++ /dev/null @@ -1,70 +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/redis/cluster/v1beta1/version" -require "google/cloud/redis/cluster/v1beta1/bindings_override" - -require "google/cloud/redis/cluster/v1beta1/cloud_redis_cluster/credentials" -require "google/cloud/redis/cluster/v1beta1/cloud_redis_cluster/paths" -require "google/cloud/redis/cluster/v1beta1/cloud_redis_cluster/rest/operations" -require "google/cloud/redis/cluster/v1beta1/cloud_redis_cluster/rest/client" - -module Google - module Cloud - module Redis - module Cluster - module V1beta1 - ## - # Configures and manages Cloud Memorystore for Redis clusters - # - # Google Cloud Memorystore for Redis Cluster - # - # The `redis.googleapis.com` service implements the Google Cloud Memorystore - # for Redis API and defines the following resource model for managing Redis - # clusters: - # * The service works with a collection of cloud projects, named: `/projects/*` - # * Each project has a collection of available locations, named: `/locations/*` - # * Each location has a collection of Redis clusters, named: `/clusters/*` - # * As such, Redis clusters are resources of the form: - # `/projects/{project_id}/locations/{location_id}/clusters/{instance_id}` - # - # Note that location_id must be a GCP `region`; for example: - # * `projects/redpepper-1290/locations/us-central1/clusters/my-redis` - # - # To load this service and instantiate a REST client: - # - # require "google/cloud/redis/cluster/v1beta1/cloud_redis_cluster/rest" - # client = ::Google::Cloud::Redis::Cluster::V1beta1::CloudRedisCluster::Rest::Client.new - # - module CloudRedisCluster - # Client for the REST transport - module Rest - end - end - end - end - end - end -end - -helper_path = ::File.join __dir__, "rest", "helpers.rb" -require "google/cloud/redis/cluster/v1beta1/cloud_redis_cluster/rest/helpers" if ::File.file? helper_path diff --git a/owl-bot-staging/google-cloud-redis-cluster-v1beta1/lib/google/cloud/redis/cluster/v1beta1/cloud_redis_cluster/rest/client.rb b/owl-bot-staging/google-cloud-redis-cluster-v1beta1/lib/google/cloud/redis/cluster/v1beta1/cloud_redis_cluster/rest/client.rb deleted file mode 100644 index 7506c3777984..000000000000 --- a/owl-bot-staging/google-cloud-redis-cluster-v1beta1/lib/google/cloud/redis/cluster/v1beta1/cloud_redis_cluster/rest/client.rb +++ /dev/null @@ -1,1825 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -require "google/cloud/errors" -require "google/cloud/redis/cluster/v1beta1/cloud_redis_cluster_pb" -require "google/cloud/redis/cluster/v1beta1/cloud_redis_cluster/rest/service_stub" -require "google/cloud/location/rest" - -module Google - module Cloud - module Redis - module Cluster - module V1beta1 - module CloudRedisCluster - module Rest - ## - # REST client for the CloudRedisCluster service. - # - # Configures and manages Cloud Memorystore for Redis clusters - # - # Google Cloud Memorystore for Redis Cluster - # - # The `redis.googleapis.com` service implements the Google Cloud Memorystore - # for Redis API and defines the following resource model for managing Redis - # clusters: - # * The service works with a collection of cloud projects, named: `/projects/*` - # * Each project has a collection of available locations, named: `/locations/*` - # * Each location has a collection of Redis clusters, named: `/clusters/*` - # * As such, Redis clusters are resources of the form: - # `/projects/{project_id}/locations/{location_id}/clusters/{instance_id}` - # - # Note that location_id must be a GCP `region`; for example: - # * `projects/redpepper-1290/locations/us-central1/clusters/my-redis` - # - class Client - # @private - API_VERSION = "" - - # @private - DEFAULT_ENDPOINT_TEMPLATE = "redis.$UNIVERSE_DOMAIN$" - - include Paths - - # @private - attr_reader :cloud_redis_cluster_stub - - ## - # Configure the CloudRedisCluster Client class. - # - # See {::Google::Cloud::Redis::Cluster::V1beta1::CloudRedisCluster::Rest::Client::Configuration} - # for a description of the configuration fields. - # - # @example - # - # # Modify the configuration for all CloudRedisCluster clients - # ::Google::Cloud::Redis::Cluster::V1beta1::CloudRedisCluster::Rest::Client.configure do |config| - # config.timeout = 10.0 - # end - # - # @yield [config] Configure the Client client. - # @yieldparam config [Client::Configuration] - # - # @return [Client::Configuration] - # - def self.configure - @configure ||= begin - namespace = ["Google", "Cloud", "Redis", "Cluster", "V1beta1"] - parent_config = while namespace.any? - parent_name = namespace.join "::" - parent_const = const_get parent_name - break parent_const.configure if parent_const.respond_to? :configure - namespace.pop - end - default_config = Client::Configuration.new parent_config - - default_config.rpcs.list_clusters.timeout = 600.0 - - default_config.rpcs.get_cluster.timeout = 600.0 - - default_config.rpcs.update_cluster.timeout = 600.0 - - default_config.rpcs.delete_cluster.timeout = 600.0 - - default_config.rpcs.create_cluster.timeout = 600.0 - - default_config.rpcs.get_cluster_certificate_authority.timeout = 600.0 - - default_config.rpcs.reschedule_cluster_maintenance.timeout = 600.0 - - default_config.rpcs.list_backup_collections.timeout = 600.0 - - default_config.rpcs.get_backup_collection.timeout = 600.0 - - default_config.rpcs.list_backups.timeout = 600.0 - - default_config.rpcs.get_backup.timeout = 600.0 - - default_config.rpcs.delete_backup.timeout = 600.0 - - default_config.rpcs.export_backup.timeout = 600.0 - - default_config.rpcs.backup_cluster.timeout = 600.0 - - default_config - end - yield @configure if block_given? - @configure - end - - ## - # Configure the CloudRedisCluster Client instance. - # - # The configuration is set to the derived mode, meaning that values can be changed, - # but structural changes (adding new fields, etc.) are not allowed. Structural changes - # should be made on {Client.configure}. - # - # See {::Google::Cloud::Redis::Cluster::V1beta1::CloudRedisCluster::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 - @cloud_redis_cluster_stub.universe_domain - end - - ## - # Create a new CloudRedisCluster REST client object. - # - # @example - # - # # Create a client using the default configuration - # client = ::Google::Cloud::Redis::Cluster::V1beta1::CloudRedisCluster::Rest::Client.new - # - # # Create a client using a custom configuration - # client = ::Google::Cloud::Redis::Cluster::V1beta1::CloudRedisCluster::Rest::Client.new do |config| - # config.timeout = 10.0 - # end - # - # @yield [config] Configure the CloudRedisCluster client. - # @yieldparam config [Client::Configuration] - # - def initialize - # Create the configuration object - @config = Configuration.new Client.configure - - # Yield the configuration if needed - yield @config if block_given? - - # Create credentials - credentials = @config.credentials - # Use self-signed JWT if the endpoint is unchanged from default, - # but only if the default endpoint does not have a region prefix. - enable_self_signed_jwt = @config.endpoint.nil? || - (@config.endpoint == Configuration::DEFAULT_ENDPOINT && - !@config.endpoint.split(".").first.include?("-")) - credentials ||= Credentials.default scope: @config.scope, - enable_self_signed_jwt: enable_self_signed_jwt - if credentials.is_a?(::String) || credentials.is_a?(::Hash) - credentials = Credentials.new credentials, scope: @config.scope - end - - @quota_project_id = @config.quota_project - @quota_project_id ||= credentials.quota_project_id if credentials.respond_to? :quota_project_id - - @operations_client = ::Google::Cloud::Redis::Cluster::V1beta1::CloudRedisCluster::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 - - @cloud_redis_cluster_stub = ::Google::Cloud::Redis::Cluster::V1beta1::CloudRedisCluster::Rest::ServiceStub.new( - endpoint: @config.endpoint, - endpoint_template: DEFAULT_ENDPOINT_TEMPLATE, - universe_domain: @config.universe_domain, - credentials: credentials, - logger: @config.logger - ) - - @cloud_redis_cluster_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 = @cloud_redis_cluster_stub.endpoint - config.universe_domain = @cloud_redis_cluster_stub.universe_domain - config.bindings_override = @config.bindings_override - config.logger = @cloud_redis_cluster_stub.logger if config.respond_to? :logger= - end - end - - ## - # Get the associated client for long-running operations. - # - # @return [::Google::Cloud::Redis::Cluster::V1beta1::CloudRedisCluster::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 - @cloud_redis_cluster_stub.logger - end - - # Service calls - - ## - # Lists all Redis clusters owned by a project in either the specified - # location (region) or all locations. - # - # The location should have the following format: - # - # * `projects/{project_id}/locations/{location_id}` - # - # If `location_id` is specified as `-` (wildcard), then all regions - # available to the project are queried, and the results are aggregated. - # - # @overload list_clusters(request, options = nil) - # Pass arguments to `list_clusters` via a request object, either of type - # {::Google::Cloud::Redis::Cluster::V1beta1::ListClustersRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Redis::Cluster::V1beta1::ListClustersRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_clusters(parent: nil, page_size: nil, page_token: nil) - # Pass arguments to `list_clusters` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param parent [::String] - # Required. The resource name of the cluster location using the form: - # `projects/{project_id}/locations/{location_id}` - # where `location_id` refers to a GCP region. - # @param page_size [::Integer] - # The maximum number of items to return. - # - # If not specified, a default value of 1000 will be used by the service. - # Regardless of the page_size value, the response may include a partial list - # and a caller should only rely on response's - # {::Google::Cloud::Redis::Cluster::V1beta1::ListClustersResponse#next_page_token `next_page_token`} - # to determine if there are more clusters left to be queried. - # @param page_token [::String] - # The `next_page_token` value returned from a previous - # [ListClusters][CloudRedis.ListClusters] request, if any. - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Gapic::Rest::PagedEnumerable<::Google::Cloud::Redis::Cluster::V1beta1::Cluster>] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Gapic::Rest::PagedEnumerable<::Google::Cloud::Redis::Cluster::V1beta1::Cluster>] - # - # @raise [::Google::Cloud::Error] if the REST call is aborted. - # - # @example Basic example - # require "google/cloud/redis/cluster/v1beta1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Redis::Cluster::V1beta1::CloudRedisCluster::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Redis::Cluster::V1beta1::ListClustersRequest.new - # - # # Call the list_clusters method. - # result = client.list_clusters request - # - # # The returned object is of type Gapic::PagedEnumerable. You can iterate - # # over elements, and API calls will be issued to fetch pages as needed. - # result.each do |item| - # # Each element is of type ::Google::Cloud::Redis::Cluster::V1beta1::Cluster. - # p item - # end - # - def list_clusters request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Redis::Cluster::V1beta1::ListClustersRequest - - # Converts hash 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_clusters.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::Redis::Cluster::V1beta1::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_clusters.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.list_clusters.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @cloud_redis_cluster_stub.list_clusters request, options do |result, operation| - result = ::Gapic::Rest::PagedEnumerable.new @cloud_redis_cluster_stub, :list_clusters, "clusters", 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 details of a specific Redis cluster. - # - # @overload get_cluster(request, options = nil) - # Pass arguments to `get_cluster` via a request object, either of type - # {::Google::Cloud::Redis::Cluster::V1beta1::GetClusterRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Redis::Cluster::V1beta1::GetClusterRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_cluster(name: nil) - # Pass arguments to `get_cluster` via keyword arguments. Note that at - # least one keyword argument is 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. Redis cluster resource name using the form: - # `projects/{project_id}/locations/{location_id}/clusters/{cluster_id}` - # where `location_id` refers to a GCP region. - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Cloud::Redis::Cluster::V1beta1::Cluster] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::Redis::Cluster::V1beta1::Cluster] - # - # @raise [::Google::Cloud::Error] if the REST call is aborted. - # - # @example Basic example - # require "google/cloud/redis/cluster/v1beta1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Redis::Cluster::V1beta1::CloudRedisCluster::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Redis::Cluster::V1beta1::GetClusterRequest.new - # - # # Call the get_cluster method. - # result = client.get_cluster request - # - # # The returned object is of type Google::Cloud::Redis::Cluster::V1beta1::Cluster. - # p result - # - def get_cluster request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Redis::Cluster::V1beta1::GetClusterRequest - - # Converts hash 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_cluster.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::Redis::Cluster::V1beta1::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_cluster.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.get_cluster.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @cloud_redis_cluster_stub.get_cluster request, options do |result, operation| - yield result, operation if block_given? - end - rescue ::Gapic::Rest::Error => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Updates the metadata and configuration of a specific Redis cluster. - # - # Completed longrunning.Operation will contain the new cluster object - # in the response field. The returned operation is automatically deleted - # after a few hours, so there is no need to call DeleteOperation. - # - # @overload update_cluster(request, options = nil) - # Pass arguments to `update_cluster` via a request object, either of type - # {::Google::Cloud::Redis::Cluster::V1beta1::UpdateClusterRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Redis::Cluster::V1beta1::UpdateClusterRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_cluster(update_mask: nil, cluster: nil, request_id: nil) - # Pass arguments to `update_cluster` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param update_mask [::Google::Protobuf::FieldMask, ::Hash] - # Required. Mask of fields to update. At least one path must be supplied in - # this field. The elements of the repeated paths field may only include these - # fields from {::Google::Cloud::Redis::Cluster::V1beta1::Cluster Cluster}: - # - # * `size_gb` - # * `replica_count` - # @param cluster [::Google::Cloud::Redis::Cluster::V1beta1::Cluster, ::Hash] - # Required. Update description. - # Only fields specified in update_mask are updated. - # @param request_id [::String] - # Idempotent request UUID. - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Gapic::Operation] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Gapic::Operation] - # - # @raise [::Google::Cloud::Error] if the REST call is aborted. - # - # @example Basic example - # require "google/cloud/redis/cluster/v1beta1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Redis::Cluster::V1beta1::CloudRedisCluster::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Redis::Cluster::V1beta1::UpdateClusterRequest.new - # - # # Call the update_cluster method. - # result = client.update_cluster 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_cluster request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Redis::Cluster::V1beta1::UpdateClusterRequest - - # Converts hash 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_cluster.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::Redis::Cluster::V1beta1::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_cluster.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.update_cluster.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @cloud_redis_cluster_stub.update_cluster 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 specific Redis cluster. Cluster stops serving and data is - # deleted. - # - # @overload delete_cluster(request, options = nil) - # Pass arguments to `delete_cluster` via a request object, either of type - # {::Google::Cloud::Redis::Cluster::V1beta1::DeleteClusterRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Redis::Cluster::V1beta1::DeleteClusterRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_cluster(name: nil, request_id: nil) - # Pass arguments to `delete_cluster` via keyword arguments. Note that at - # least one keyword argument is 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. Redis cluster resource name using the form: - # `projects/{project_id}/locations/{location_id}/clusters/{cluster_id}` - # where `location_id` refers to a GCP region. - # @param request_id [::String] - # Idempotent request UUID. - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Gapic::Operation] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Gapic::Operation] - # - # @raise [::Google::Cloud::Error] if the REST call is aborted. - # - # @example Basic example - # require "google/cloud/redis/cluster/v1beta1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Redis::Cluster::V1beta1::CloudRedisCluster::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Redis::Cluster::V1beta1::DeleteClusterRequest.new - # - # # Call the delete_cluster method. - # result = client.delete_cluster 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_cluster request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Redis::Cluster::V1beta1::DeleteClusterRequest - - # Converts hash 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_cluster.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::Redis::Cluster::V1beta1::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_cluster.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.delete_cluster.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @cloud_redis_cluster_stub.delete_cluster 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 - - ## - # Creates a Redis cluster based on the specified properties. - # The creation is executed asynchronously and callers may check the returned - # operation to track its progress. Once the operation is completed the Redis - # cluster will be fully functional. The completed longrunning.Operation will - # contain the new cluster object in the response field. - # - # The returned operation is automatically deleted after a few hours, so there - # is no need to call DeleteOperation. - # - # @overload create_cluster(request, options = nil) - # Pass arguments to `create_cluster` via a request object, either of type - # {::Google::Cloud::Redis::Cluster::V1beta1::CreateClusterRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Redis::Cluster::V1beta1::CreateClusterRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_cluster(parent: nil, cluster_id: nil, cluster: nil, request_id: nil) - # Pass arguments to `create_cluster` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param parent [::String] - # Required. The resource name of the cluster location using the form: - # `projects/{project_id}/locations/{location_id}` - # where `location_id` refers to a GCP region. - # @param cluster_id [::String] - # Required. The logical name of the Redis cluster in the customer project - # with the following restrictions: - # - # * Must contain only lowercase letters, numbers, and hyphens. - # * Must start with a letter. - # * Must be between 1-63 characters. - # * Must end with a number or a letter. - # * Must be unique within the customer project / location - # @param cluster [::Google::Cloud::Redis::Cluster::V1beta1::Cluster, ::Hash] - # Required. The cluster that is to be created. - # @param request_id [::String] - # Idempotent request UUID. - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Gapic::Operation] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Gapic::Operation] - # - # @raise [::Google::Cloud::Error] if the REST call is aborted. - # - # @example Basic example - # require "google/cloud/redis/cluster/v1beta1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Redis::Cluster::V1beta1::CloudRedisCluster::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Redis::Cluster::V1beta1::CreateClusterRequest.new - # - # # Call the create_cluster method. - # result = client.create_cluster 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_cluster request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Redis::Cluster::V1beta1::CreateClusterRequest - - # Converts hash 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_cluster.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::Redis::Cluster::V1beta1::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_cluster.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.create_cluster.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @cloud_redis_cluster_stub.create_cluster 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 the details of certificate authority information for Redis cluster. - # - # @overload get_cluster_certificate_authority(request, options = nil) - # Pass arguments to `get_cluster_certificate_authority` via a request object, either of type - # {::Google::Cloud::Redis::Cluster::V1beta1::GetClusterCertificateAuthorityRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Redis::Cluster::V1beta1::GetClusterCertificateAuthorityRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_cluster_certificate_authority(name: nil) - # Pass arguments to `get_cluster_certificate_authority` via keyword arguments. Note that at - # least one keyword argument is 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. Redis cluster certificate authority resource name using the form: - # `projects/{project_id}/locations/{location_id}/clusters/{cluster_id}/certificateAuthority` - # where `location_id` refers to a GCP region. - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Cloud::Redis::Cluster::V1beta1::CertificateAuthority] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::Redis::Cluster::V1beta1::CertificateAuthority] - # - # @raise [::Google::Cloud::Error] if the REST call is aborted. - # - # @example Basic example - # require "google/cloud/redis/cluster/v1beta1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Redis::Cluster::V1beta1::CloudRedisCluster::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Redis::Cluster::V1beta1::GetClusterCertificateAuthorityRequest.new - # - # # Call the get_cluster_certificate_authority method. - # result = client.get_cluster_certificate_authority request - # - # # The returned object is of type Google::Cloud::Redis::Cluster::V1beta1::CertificateAuthority. - # p result - # - def get_cluster_certificate_authority request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Redis::Cluster::V1beta1::GetClusterCertificateAuthorityRequest - - # Converts hash 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_cluster_certificate_authority.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::Redis::Cluster::V1beta1::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_cluster_certificate_authority.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.get_cluster_certificate_authority.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @cloud_redis_cluster_stub.get_cluster_certificate_authority 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 - - ## - # Reschedules upcoming maintenance event. - # - # @overload reschedule_cluster_maintenance(request, options = nil) - # Pass arguments to `reschedule_cluster_maintenance` via a request object, either of type - # {::Google::Cloud::Redis::Cluster::V1beta1::RescheduleClusterMaintenanceRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Redis::Cluster::V1beta1::RescheduleClusterMaintenanceRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @overload reschedule_cluster_maintenance(name: nil, reschedule_type: nil, schedule_time: nil) - # Pass arguments to `reschedule_cluster_maintenance` via keyword arguments. Note that at - # least one keyword argument is 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. Redis Cluster instance resource name using the form: - # `projects/{project_id}/locations/{location_id}/clusters/{cluster_id}` - # where `location_id` refers to a GCP region. - # @param reschedule_type [::Google::Cloud::Redis::Cluster::V1beta1::RescheduleClusterMaintenanceRequest::RescheduleType] - # Required. If reschedule type is SPECIFIC_TIME, must set up schedule_time as - # well. - # @param schedule_time [::Google::Protobuf::Timestamp, ::Hash] - # Optional. Timestamp when the maintenance shall be rescheduled to if - # reschedule_type=SPECIFIC_TIME, in RFC 3339 format, for - # example `2012-11-15T16:19:00.094Z`. - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Gapic::Operation] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Gapic::Operation] - # - # @raise [::Google::Cloud::Error] if the REST call is aborted. - # - # @example Basic example - # require "google/cloud/redis/cluster/v1beta1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Redis::Cluster::V1beta1::CloudRedisCluster::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Redis::Cluster::V1beta1::RescheduleClusterMaintenanceRequest.new - # - # # Call the reschedule_cluster_maintenance method. - # result = client.reschedule_cluster_maintenance 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 reschedule_cluster_maintenance request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Redis::Cluster::V1beta1::RescheduleClusterMaintenanceRequest - - # Converts hash 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.reschedule_cluster_maintenance.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::Redis::Cluster::V1beta1::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.reschedule_cluster_maintenance.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.reschedule_cluster_maintenance.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @cloud_redis_cluster_stub.reschedule_cluster_maintenance 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 all backup collections owned by a consumer project in either the - # specified location (region) or all locations. - # - # If `location_id` is specified as `-` (wildcard), then all regions - # available to the project are queried, and the results are aggregated. - # - # @overload list_backup_collections(request, options = nil) - # Pass arguments to `list_backup_collections` via a request object, either of type - # {::Google::Cloud::Redis::Cluster::V1beta1::ListBackupCollectionsRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Redis::Cluster::V1beta1::ListBackupCollectionsRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_backup_collections(parent: nil, page_size: nil, page_token: nil) - # Pass arguments to `list_backup_collections` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param parent [::String] - # Required. The resource name of the backupCollection location using the - # form: - # `projects/{project_id}/locations/{location_id}` - # where `location_id` refers to a GCP region. - # @param page_size [::Integer] - # Optional. The maximum number of items to return. - # - # If not specified, a default value of 1000 will be used by the service. - # Regardless of the page_size value, the response may include a partial list - # and a caller should only rely on response's - # {::Google::Cloud::Redis::Cluster::V1beta1::ListBackupCollectionsResponse#next_page_token `next_page_token`} - # to determine if there are more clusters left to be queried. - # @param page_token [::String] - # Optional. The `next_page_token` value returned from a previous - # [ListBackupCollections] request, if any. - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Gapic::Rest::PagedEnumerable<::Google::Cloud::Redis::Cluster::V1beta1::BackupCollection>] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Gapic::Rest::PagedEnumerable<::Google::Cloud::Redis::Cluster::V1beta1::BackupCollection>] - # - # @raise [::Google::Cloud::Error] if the REST call is aborted. - # - # @example Basic example - # require "google/cloud/redis/cluster/v1beta1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Redis::Cluster::V1beta1::CloudRedisCluster::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Redis::Cluster::V1beta1::ListBackupCollectionsRequest.new - # - # # Call the list_backup_collections method. - # result = client.list_backup_collections request - # - # # The returned object is of type Gapic::PagedEnumerable. You can iterate - # # over elements, and API calls will be issued to fetch pages as needed. - # result.each do |item| - # # Each element is of type ::Google::Cloud::Redis::Cluster::V1beta1::BackupCollection. - # p item - # end - # - def list_backup_collections request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Redis::Cluster::V1beta1::ListBackupCollectionsRequest - - # Converts hash 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_backup_collections.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::Redis::Cluster::V1beta1::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_backup_collections.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.list_backup_collections.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @cloud_redis_cluster_stub.list_backup_collections request, options do |result, operation| - result = ::Gapic::Rest::PagedEnumerable.new @cloud_redis_cluster_stub, :list_backup_collections, "backup_collections", 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 - - ## - # Get a backup collection. - # - # @overload get_backup_collection(request, options = nil) - # Pass arguments to `get_backup_collection` via a request object, either of type - # {::Google::Cloud::Redis::Cluster::V1beta1::GetBackupCollectionRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Redis::Cluster::V1beta1::GetBackupCollectionRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_backup_collection(name: nil) - # Pass arguments to `get_backup_collection` via keyword arguments. Note that at - # least one keyword argument is 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. Redis backupCollection resource name using the form: - # `projects/{project_id}/locations/{location_id}/backupCollections/{backup_collection_id}` - # where `location_id` refers to a GCP region. - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Cloud::Redis::Cluster::V1beta1::BackupCollection] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::Redis::Cluster::V1beta1::BackupCollection] - # - # @raise [::Google::Cloud::Error] if the REST call is aborted. - # - # @example Basic example - # require "google/cloud/redis/cluster/v1beta1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Redis::Cluster::V1beta1::CloudRedisCluster::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Redis::Cluster::V1beta1::GetBackupCollectionRequest.new - # - # # Call the get_backup_collection method. - # result = client.get_backup_collection request - # - # # The returned object is of type Google::Cloud::Redis::Cluster::V1beta1::BackupCollection. - # p result - # - def get_backup_collection request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Redis::Cluster::V1beta1::GetBackupCollectionRequest - - # Converts hash 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_backup_collection.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::Redis::Cluster::V1beta1::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_backup_collection.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.get_backup_collection.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @cloud_redis_cluster_stub.get_backup_collection request, options do |result, operation| - yield result, operation if block_given? - end - rescue ::Gapic::Rest::Error => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Lists all backups owned by a backup collection. - # - # @overload list_backups(request, options = nil) - # Pass arguments to `list_backups` via a request object, either of type - # {::Google::Cloud::Redis::Cluster::V1beta1::ListBackupsRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Redis::Cluster::V1beta1::ListBackupsRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_backups(parent: nil, page_size: nil, page_token: nil) - # Pass arguments to `list_backups` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param parent [::String] - # Required. The resource name of the backupCollection using the form: - # `projects/{project_id}/locations/{location_id}/backupCollections/{backup_collection_id}` - # @param page_size [::Integer] - # Optional. The maximum number of items to return. - # - # If not specified, a default value of 1000 will be used by the service. - # Regardless of the page_size value, the response may include a partial list - # and a caller should only rely on response's - # {::Google::Cloud::Redis::Cluster::V1beta1::ListBackupsResponse#next_page_token `next_page_token`} - # to determine if there are more clusters left to be queried. - # @param page_token [::String] - # Optional. The `next_page_token` value returned from a previous - # [ListBackupCollections] request, if any. - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Gapic::Rest::PagedEnumerable<::Google::Cloud::Redis::Cluster::V1beta1::Backup>] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Gapic::Rest::PagedEnumerable<::Google::Cloud::Redis::Cluster::V1beta1::Backup>] - # - # @raise [::Google::Cloud::Error] if the REST call is aborted. - # - # @example Basic example - # require "google/cloud/redis/cluster/v1beta1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Redis::Cluster::V1beta1::CloudRedisCluster::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Redis::Cluster::V1beta1::ListBackupsRequest.new - # - # # Call the list_backups method. - # result = client.list_backups request - # - # # The returned object is of type Gapic::PagedEnumerable. You can iterate - # # over elements, and API calls will be issued to fetch pages as needed. - # result.each do |item| - # # Each element is of type ::Google::Cloud::Redis::Cluster::V1beta1::Backup. - # p item - # end - # - def list_backups request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Redis::Cluster::V1beta1::ListBackupsRequest - - # Converts hash 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_backups.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::Redis::Cluster::V1beta1::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_backups.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.list_backups.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @cloud_redis_cluster_stub.list_backups request, options do |result, operation| - result = ::Gapic::Rest::PagedEnumerable.new @cloud_redis_cluster_stub, :list_backups, "backups", 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 details of a specific backup. - # - # @overload get_backup(request, options = nil) - # Pass arguments to `get_backup` via a request object, either of type - # {::Google::Cloud::Redis::Cluster::V1beta1::GetBackupRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Redis::Cluster::V1beta1::GetBackupRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_backup(name: nil) - # Pass arguments to `get_backup` via keyword arguments. Note that at - # least one keyword argument is 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. Redis backup resource name using the form: - # `projects/{project_id}/locations/{location_id}/backupCollections/{backup_collection_id}/backups/{backup_id}` - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Cloud::Redis::Cluster::V1beta1::Backup] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::Redis::Cluster::V1beta1::Backup] - # - # @raise [::Google::Cloud::Error] if the REST call is aborted. - # - # @example Basic example - # require "google/cloud/redis/cluster/v1beta1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Redis::Cluster::V1beta1::CloudRedisCluster::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Redis::Cluster::V1beta1::GetBackupRequest.new - # - # # Call the get_backup method. - # result = client.get_backup request - # - # # The returned object is of type Google::Cloud::Redis::Cluster::V1beta1::Backup. - # p result - # - def get_backup request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Redis::Cluster::V1beta1::GetBackupRequest - - # Converts hash 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_backup.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::Redis::Cluster::V1beta1::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_backup.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.get_backup.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @cloud_redis_cluster_stub.get_backup request, options do |result, operation| - yield result, operation if block_given? - end - rescue ::Gapic::Rest::Error => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Deletes a specific backup. - # - # @overload delete_backup(request, options = nil) - # Pass arguments to `delete_backup` via a request object, either of type - # {::Google::Cloud::Redis::Cluster::V1beta1::DeleteBackupRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Redis::Cluster::V1beta1::DeleteBackupRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_backup(name: nil, request_id: nil) - # Pass arguments to `delete_backup` via keyword arguments. Note that at - # least one keyword argument is 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. Redis backup resource name using the form: - # `projects/{project_id}/locations/{location_id}/backupCollections/{backup_collection_id}/backups/{backup_id}` - # @param request_id [::String] - # Optional. Idempotent request UUID. - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Gapic::Operation] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Gapic::Operation] - # - # @raise [::Google::Cloud::Error] if the REST call is aborted. - # - # @example Basic example - # require "google/cloud/redis/cluster/v1beta1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Redis::Cluster::V1beta1::CloudRedisCluster::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Redis::Cluster::V1beta1::DeleteBackupRequest.new - # - # # Call the delete_backup method. - # result = client.delete_backup 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_backup request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Redis::Cluster::V1beta1::DeleteBackupRequest - - # Converts hash 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_backup.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::Redis::Cluster::V1beta1::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_backup.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.delete_backup.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @cloud_redis_cluster_stub.delete_backup 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 - - ## - # Exports a specific backup to a customer target Cloud Storage URI. - # - # @overload export_backup(request, options = nil) - # Pass arguments to `export_backup` via a request object, either of type - # {::Google::Cloud::Redis::Cluster::V1beta1::ExportBackupRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Redis::Cluster::V1beta1::ExportBackupRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @overload export_backup(gcs_bucket: nil, name: nil) - # Pass arguments to `export_backup` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param gcs_bucket [::String] - # Google Cloud Storage bucket, like "my-bucket". - # @param name [::String] - # Required. Redis backup resource name using the form: - # `projects/{project_id}/locations/{location_id}/backupCollections/{backup_collection_id}/backups/{backup_id}` - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Gapic::Operation] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Gapic::Operation] - # - # @raise [::Google::Cloud::Error] if the REST call is aborted. - # - # @example Basic example - # require "google/cloud/redis/cluster/v1beta1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Redis::Cluster::V1beta1::CloudRedisCluster::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Redis::Cluster::V1beta1::ExportBackupRequest.new - # - # # Call the export_backup method. - # result = client.export_backup 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 export_backup request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Redis::Cluster::V1beta1::ExportBackupRequest - - # Converts hash 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.export_backup.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::Redis::Cluster::V1beta1::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.export_backup.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.export_backup.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @cloud_redis_cluster_stub.export_backup 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 - - ## - # Backup Redis Cluster. - # If this is the first time a backup is being created, a backup collection - # will be created at the backend, and this backup belongs to this collection. - # Both collection and backup will have a resource name. Backup will be - # executed for each shard. A replica (primary if nonHA) will be selected to - # perform the execution. Backup call will be rejected if there is an ongoing - # backup or update operation. Be aware that during preview, if the cluster's - # internal software version is too old, critical update will be performed - # before actual backup. Once the internal software version is updated to the - # minimum version required by the backup feature, subsequent backups will not - # require critical update. After preview, there will be no critical update - # needed for backup. - # - # @overload backup_cluster(request, options = nil) - # Pass arguments to `backup_cluster` via a request object, either of type - # {::Google::Cloud::Redis::Cluster::V1beta1::BackupClusterRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Redis::Cluster::V1beta1::BackupClusterRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @overload backup_cluster(name: nil, ttl: nil, backup_id: nil) - # Pass arguments to `backup_cluster` via keyword arguments. Note that at - # least one keyword argument is 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. Redis cluster resource name using the form: - # `projects/{project_id}/locations/{location_id}/clusters/{cluster_id}` - # where `location_id` refers to a GCP region. - # @param ttl [::Google::Protobuf::Duration, ::Hash] - # Optional. TTL for the backup to expire. Value range is 1 day to 100 years. - # If not specified, the default value is 100 years. - # @param backup_id [::String] - # Optional. The id of the backup to be created. If not specified, the - # default value ([YYYYMMDDHHMMSS]_[Shortened Cluster UID] is used. - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Gapic::Operation] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Gapic::Operation] - # - # @raise [::Google::Cloud::Error] if the REST call is aborted. - # - # @example Basic example - # require "google/cloud/redis/cluster/v1beta1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Redis::Cluster::V1beta1::CloudRedisCluster::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Redis::Cluster::V1beta1::BackupClusterRequest.new - # - # # Call the backup_cluster method. - # result = client.backup_cluster 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 backup_cluster request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Redis::Cluster::V1beta1::BackupClusterRequest - - # Converts hash 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.backup_cluster.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::Redis::Cluster::V1beta1::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.backup_cluster.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.backup_cluster.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @cloud_redis_cluster_stub.backup_cluster 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 - - ## - # Configuration class for the CloudRedisCluster REST API. - # - # This class represents the configuration for CloudRedisCluster REST, - # providing control over timeouts, retry behavior, logging, transport - # parameters, and other low-level controls. Certain parameters can also be - # applied individually to specific RPCs. See - # {::Google::Cloud::Redis::Cluster::V1beta1::CloudRedisCluster::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_clusters to 20 seconds, - # # and all remaining timeouts to 10 seconds. - # ::Google::Cloud::Redis::Cluster::V1beta1::CloudRedisCluster::Rest::Client.configure do |config| - # config.timeout = 10.0 - # config.rpcs.list_clusters.timeout = 20.0 - # end - # - # # Apply the above configuration only to a new client. - # client = ::Google::Cloud::Redis::Cluster::V1beta1::CloudRedisCluster::Rest::Client.new do |config| - # config.timeout = 10.0 - # config.rpcs.list_clusters.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 = "redis.googleapis.com" - - config_attr :endpoint, nil, ::String, nil - config_attr :credentials, nil do |value| - allowed = [::String, ::Hash, ::Proc, ::Symbol, ::Google::Auth::Credentials, ::Google::Auth::BaseClient, ::Signet::OAuth2::Client, nil] - allowed.any? { |klass| klass === value } - end - config_attr :scope, nil, ::String, ::Array, nil - config_attr :lib_name, nil, ::String, nil - config_attr :lib_version, nil, ::String, nil - config_attr :timeout, nil, ::Numeric, nil - config_attr :metadata, nil, ::Hash, nil - config_attr :retry_policy, nil, ::Hash, ::Proc, nil - config_attr :quota_project, nil, ::String, nil - config_attr :universe_domain, nil, ::String, nil - - # @private - # Overrides for http bindings for the RPCs of this service - # are only used when this service is used as mixin, and only - # by the host service. - # @return [::Hash{::Symbol=>::Array<::Gapic::Rest::GrpcTranscoder::HttpBinding>}] - config_attr :bindings_override, {}, ::Hash, nil - config_attr :logger, :default, ::Logger, nil, :default - - # @private - def initialize parent_config = nil - @parent_config = parent_config unless parent_config.nil? - - yield self if block_given? - end - - ## - # Configurations for individual RPCs - # @return [Rpcs] - # - def rpcs - @rpcs ||= begin - parent_rpcs = nil - parent_rpcs = @parent_config.rpcs if defined?(@parent_config) && @parent_config.respond_to?(:rpcs) - Rpcs.new parent_rpcs - end - end - - ## - # Configuration RPC class for the CloudRedisCluster 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_clusters` - # @return [::Gapic::Config::Method] - # - attr_reader :list_clusters - ## - # RPC-specific configuration for `get_cluster` - # @return [::Gapic::Config::Method] - # - attr_reader :get_cluster - ## - # RPC-specific configuration for `update_cluster` - # @return [::Gapic::Config::Method] - # - attr_reader :update_cluster - ## - # RPC-specific configuration for `delete_cluster` - # @return [::Gapic::Config::Method] - # - attr_reader :delete_cluster - ## - # RPC-specific configuration for `create_cluster` - # @return [::Gapic::Config::Method] - # - attr_reader :create_cluster - ## - # RPC-specific configuration for `get_cluster_certificate_authority` - # @return [::Gapic::Config::Method] - # - attr_reader :get_cluster_certificate_authority - ## - # RPC-specific configuration for `reschedule_cluster_maintenance` - # @return [::Gapic::Config::Method] - # - attr_reader :reschedule_cluster_maintenance - ## - # RPC-specific configuration for `list_backup_collections` - # @return [::Gapic::Config::Method] - # - attr_reader :list_backup_collections - ## - # RPC-specific configuration for `get_backup_collection` - # @return [::Gapic::Config::Method] - # - attr_reader :get_backup_collection - ## - # RPC-specific configuration for `list_backups` - # @return [::Gapic::Config::Method] - # - attr_reader :list_backups - ## - # RPC-specific configuration for `get_backup` - # @return [::Gapic::Config::Method] - # - attr_reader :get_backup - ## - # RPC-specific configuration for `delete_backup` - # @return [::Gapic::Config::Method] - # - attr_reader :delete_backup - ## - # RPC-specific configuration for `export_backup` - # @return [::Gapic::Config::Method] - # - attr_reader :export_backup - ## - # RPC-specific configuration for `backup_cluster` - # @return [::Gapic::Config::Method] - # - attr_reader :backup_cluster - - # @private - def initialize parent_rpcs = nil - list_clusters_config = parent_rpcs.list_clusters if parent_rpcs.respond_to? :list_clusters - @list_clusters = ::Gapic::Config::Method.new list_clusters_config - get_cluster_config = parent_rpcs.get_cluster if parent_rpcs.respond_to? :get_cluster - @get_cluster = ::Gapic::Config::Method.new get_cluster_config - update_cluster_config = parent_rpcs.update_cluster if parent_rpcs.respond_to? :update_cluster - @update_cluster = ::Gapic::Config::Method.new update_cluster_config - delete_cluster_config = parent_rpcs.delete_cluster if parent_rpcs.respond_to? :delete_cluster - @delete_cluster = ::Gapic::Config::Method.new delete_cluster_config - create_cluster_config = parent_rpcs.create_cluster if parent_rpcs.respond_to? :create_cluster - @create_cluster = ::Gapic::Config::Method.new create_cluster_config - get_cluster_certificate_authority_config = parent_rpcs.get_cluster_certificate_authority if parent_rpcs.respond_to? :get_cluster_certificate_authority - @get_cluster_certificate_authority = ::Gapic::Config::Method.new get_cluster_certificate_authority_config - reschedule_cluster_maintenance_config = parent_rpcs.reschedule_cluster_maintenance if parent_rpcs.respond_to? :reschedule_cluster_maintenance - @reschedule_cluster_maintenance = ::Gapic::Config::Method.new reschedule_cluster_maintenance_config - list_backup_collections_config = parent_rpcs.list_backup_collections if parent_rpcs.respond_to? :list_backup_collections - @list_backup_collections = ::Gapic::Config::Method.new list_backup_collections_config - get_backup_collection_config = parent_rpcs.get_backup_collection if parent_rpcs.respond_to? :get_backup_collection - @get_backup_collection = ::Gapic::Config::Method.new get_backup_collection_config - list_backups_config = parent_rpcs.list_backups if parent_rpcs.respond_to? :list_backups - @list_backups = ::Gapic::Config::Method.new list_backups_config - get_backup_config = parent_rpcs.get_backup if parent_rpcs.respond_to? :get_backup - @get_backup = ::Gapic::Config::Method.new get_backup_config - delete_backup_config = parent_rpcs.delete_backup if parent_rpcs.respond_to? :delete_backup - @delete_backup = ::Gapic::Config::Method.new delete_backup_config - export_backup_config = parent_rpcs.export_backup if parent_rpcs.respond_to? :export_backup - @export_backup = ::Gapic::Config::Method.new export_backup_config - backup_cluster_config = parent_rpcs.backup_cluster if parent_rpcs.respond_to? :backup_cluster - @backup_cluster = ::Gapic::Config::Method.new backup_cluster_config - - yield self if block_given? - end - end - end - end - end - end - end - end - end - end -end diff --git a/owl-bot-staging/google-cloud-redis-cluster-v1beta1/lib/google/cloud/redis/cluster/v1beta1/cloud_redis_cluster/rest/operations.rb b/owl-bot-staging/google-cloud-redis-cluster-v1beta1/lib/google/cloud/redis/cluster/v1beta1/cloud_redis_cluster/rest/operations.rb deleted file mode 100644 index fb3b4d97dfa2..000000000000 --- a/owl-bot-staging/google-cloud-redis-cluster-v1beta1/lib/google/cloud/redis/cluster/v1beta1/cloud_redis_cluster/rest/operations.rb +++ /dev/null @@ -1,926 +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 Cloud - module Redis - module Cluster - module V1beta1 - module CloudRedisCluster - module Rest - # Service that implements Longrunning Operations API. - class Operations - # @private - API_VERSION = "" - - # @private - DEFAULT_ENDPOINT_TEMPLATE = "redis.$UNIVERSE_DOMAIN$" - - # @private - attr_reader :operations_stub - - ## - # Configuration for the CloudRedisCluster 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 CloudRedisCluster 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::Redis::Cluster::V1beta1::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::Redis::Cluster::V1beta1::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::Redis::Cluster::V1beta1::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::Redis::Cluster::V1beta1::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 = "redis.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: "/v1beta1/{name}/operations", - matches: [ - ["name", %r{^projects/[^/]+/locations/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the get_operation REST call - # - # @param request_pb [::Google::Longrunning::GetOperationRequest] - # A request object representing the call parameters. Required. - # @return [Array(String, [String, nil], Hash{String => String})] - # Uri, Body, Query string parameters - def self.transcode_get_operation_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :get, - uri_template: "/v1beta1/{name}", - matches: [ - ["name", %r{^projects/[^/]+/locations/[^/]+/operations/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the delete_operation REST call - # - # @param request_pb [::Google::Longrunning::DeleteOperationRequest] - # A request object representing the call parameters. Required. - # @return [Array(String, [String, nil], Hash{String => String})] - # Uri, Body, Query string parameters - def self.transcode_delete_operation_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :delete, - uri_template: "/v1beta1/{name}", - matches: [ - ["name", %r{^projects/[^/]+/locations/[^/]+/operations/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the cancel_operation REST call - # - # @param request_pb [::Google::Longrunning::CancelOperationRequest] - # A request object representing the call parameters. Required. - # @return [Array(String, [String, nil], Hash{String => String})] - # Uri, Body, Query string parameters - def self.transcode_cancel_operation_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :post, - uri_template: "/v1beta1/{name}:cancel", - matches: [ - ["name", %r{^projects/[^/]+/locations/[^/]+/operations/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - end - end - end - end - end - end - end -end diff --git a/owl-bot-staging/google-cloud-redis-cluster-v1beta1/lib/google/cloud/redis/cluster/v1beta1/cloud_redis_cluster/rest/service_stub.rb b/owl-bot-staging/google-cloud-redis-cluster-v1beta1/lib/google/cloud/redis/cluster/v1beta1/cloud_redis_cluster/rest/service_stub.rb deleted file mode 100644 index 0b4291c4ede3..000000000000 --- a/owl-bot-staging/google-cloud-redis-cluster-v1beta1/lib/google/cloud/redis/cluster/v1beta1/cloud_redis_cluster/rest/service_stub.rb +++ /dev/null @@ -1,942 +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/redis/cluster/v1beta1/cloud_redis_cluster_pb" - -module Google - module Cloud - module Redis - module Cluster - module V1beta1 - module CloudRedisCluster - module Rest - ## - # REST service stub for the CloudRedisCluster service. - # Service stub contains baseline method implementations - # including transcoding, making the REST call, and deserialing the response. - # - class ServiceStub - # @private - def initialize endpoint:, endpoint_template:, universe_domain:, credentials:, logger: - # These require statements are intentionally placed here to initialize - # the REST modules only when it's required. - require "gapic/rest" - - @client_stub = ::Gapic::Rest::ClientStub.new endpoint: endpoint, - endpoint_template: endpoint_template, - universe_domain: universe_domain, - credentials: credentials, - numeric_enums: true, - service_name: self.class, - raise_faraday_errors: false, - logger: logger - end - - ## - # The effective universe domain - # - # @return [String] - # - def universe_domain - @client_stub.universe_domain - end - - ## - # The effective endpoint - # - # @return [String] - # - def endpoint - @client_stub.endpoint - end - - ## - # The logger used for request/response debug logging. - # - # @return [Logger] - # - def logger stub: false - stub ? @client_stub.stub_logger : @client_stub.logger - end - - ## - # Baseline implementation for the list_clusters REST call - # - # @param request_pb [::Google::Cloud::Redis::Cluster::V1beta1::ListClustersRequest] - # A request object representing the call parameters. Required. - # @param options [::Gapic::CallOptions] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Cloud::Redis::Cluster::V1beta1::ListClustersResponse] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::Redis::Cluster::V1beta1::ListClustersResponse] - # A result object deserialized from the server's reply - def list_clusters request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_list_clusters_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_clusters", - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Cloud::Redis::Cluster::V1beta1::ListClustersResponse.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_cluster REST call - # - # @param request_pb [::Google::Cloud::Redis::Cluster::V1beta1::GetClusterRequest] - # A request object representing the call parameters. Required. - # @param options [::Gapic::CallOptions] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Cloud::Redis::Cluster::V1beta1::Cluster] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::Redis::Cluster::V1beta1::Cluster] - # A result object deserialized from the server's reply - def get_cluster request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_get_cluster_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_cluster", - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Cloud::Redis::Cluster::V1beta1::Cluster.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_cluster REST call - # - # @param request_pb [::Google::Cloud::Redis::Cluster::V1beta1::UpdateClusterRequest] - # 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_cluster request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_update_cluster_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_cluster", - 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_cluster REST call - # - # @param request_pb [::Google::Cloud::Redis::Cluster::V1beta1::DeleteClusterRequest] - # 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_cluster request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_delete_cluster_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_cluster", - 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 create_cluster REST call - # - # @param request_pb [::Google::Cloud::Redis::Cluster::V1beta1::CreateClusterRequest] - # 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_cluster request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_create_cluster_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_cluster", - 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_cluster_certificate_authority REST call - # - # @param request_pb [::Google::Cloud::Redis::Cluster::V1beta1::GetClusterCertificateAuthorityRequest] - # A request object representing the call parameters. Required. - # @param options [::Gapic::CallOptions] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Cloud::Redis::Cluster::V1beta1::CertificateAuthority] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::Redis::Cluster::V1beta1::CertificateAuthority] - # A result object deserialized from the server's reply - def get_cluster_certificate_authority request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_get_cluster_certificate_authority_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_cluster_certificate_authority", - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Cloud::Redis::Cluster::V1beta1::CertificateAuthority.decode_json response.body, ignore_unknown_fields: true - catch :response do - yield result, operation if block_given? - result - end - end - - ## - # Baseline implementation for the reschedule_cluster_maintenance REST call - # - # @param request_pb [::Google::Cloud::Redis::Cluster::V1beta1::RescheduleClusterMaintenanceRequest] - # 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 reschedule_cluster_maintenance request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_reschedule_cluster_maintenance_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: "reschedule_cluster_maintenance", - 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_backup_collections REST call - # - # @param request_pb [::Google::Cloud::Redis::Cluster::V1beta1::ListBackupCollectionsRequest] - # A request object representing the call parameters. Required. - # @param options [::Gapic::CallOptions] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Cloud::Redis::Cluster::V1beta1::ListBackupCollectionsResponse] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::Redis::Cluster::V1beta1::ListBackupCollectionsResponse] - # A result object deserialized from the server's reply - def list_backup_collections request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_list_backup_collections_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_backup_collections", - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Cloud::Redis::Cluster::V1beta1::ListBackupCollectionsResponse.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_backup_collection REST call - # - # @param request_pb [::Google::Cloud::Redis::Cluster::V1beta1::GetBackupCollectionRequest] - # A request object representing the call parameters. Required. - # @param options [::Gapic::CallOptions] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Cloud::Redis::Cluster::V1beta1::BackupCollection] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::Redis::Cluster::V1beta1::BackupCollection] - # A result object deserialized from the server's reply - def get_backup_collection request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_get_backup_collection_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_backup_collection", - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Cloud::Redis::Cluster::V1beta1::BackupCollection.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_backups REST call - # - # @param request_pb [::Google::Cloud::Redis::Cluster::V1beta1::ListBackupsRequest] - # A request object representing the call parameters. Required. - # @param options [::Gapic::CallOptions] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Cloud::Redis::Cluster::V1beta1::ListBackupsResponse] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::Redis::Cluster::V1beta1::ListBackupsResponse] - # A result object deserialized from the server's reply - def list_backups request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_list_backups_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_backups", - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Cloud::Redis::Cluster::V1beta1::ListBackupsResponse.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_backup REST call - # - # @param request_pb [::Google::Cloud::Redis::Cluster::V1beta1::GetBackupRequest] - # A request object representing the call parameters. Required. - # @param options [::Gapic::CallOptions] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Cloud::Redis::Cluster::V1beta1::Backup] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::Redis::Cluster::V1beta1::Backup] - # A result object deserialized from the server's reply - def get_backup request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_get_backup_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_backup", - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Cloud::Redis::Cluster::V1beta1::Backup.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_backup REST call - # - # @param request_pb [::Google::Cloud::Redis::Cluster::V1beta1::DeleteBackupRequest] - # 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_backup request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_delete_backup_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_backup", - 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 export_backup REST call - # - # @param request_pb [::Google::Cloud::Redis::Cluster::V1beta1::ExportBackupRequest] - # 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 export_backup request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_export_backup_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: "export_backup", - 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 backup_cluster REST call - # - # @param request_pb [::Google::Cloud::Redis::Cluster::V1beta1::BackupClusterRequest] - # 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 backup_cluster request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_backup_cluster_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: "backup_cluster", - 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 - - ## - # @private - # - # GRPC transcoding helper method for the list_clusters REST call - # - # @param request_pb [::Google::Cloud::Redis::Cluster::V1beta1::ListClustersRequest] - # 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_clusters_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :get, - uri_template: "/v1beta1/{parent}/clusters", - matches: [ - ["parent", %r{^projects/[^/]+/locations/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the get_cluster REST call - # - # @param request_pb [::Google::Cloud::Redis::Cluster::V1beta1::GetClusterRequest] - # 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_cluster_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :get, - uri_template: "/v1beta1/{name}", - matches: [ - ["name", %r{^projects/[^/]+/locations/[^/]+/clusters/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the update_cluster REST call - # - # @param request_pb [::Google::Cloud::Redis::Cluster::V1beta1::UpdateClusterRequest] - # 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_cluster_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :patch, - uri_template: "/v1beta1/{cluster.name}", - body: "cluster", - matches: [ - ["cluster.name", %r{^projects/[^/]+/locations/[^/]+/clusters/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the delete_cluster REST call - # - # @param request_pb [::Google::Cloud::Redis::Cluster::V1beta1::DeleteClusterRequest] - # 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_cluster_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :delete, - uri_template: "/v1beta1/{name}", - matches: [ - ["name", %r{^projects/[^/]+/locations/[^/]+/clusters/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the create_cluster REST call - # - # @param request_pb [::Google::Cloud::Redis::Cluster::V1beta1::CreateClusterRequest] - # 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_cluster_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :post, - uri_template: "/v1beta1/{parent}/clusters", - body: "cluster", - matches: [ - ["parent", %r{^projects/[^/]+/locations/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the get_cluster_certificate_authority REST call - # - # @param request_pb [::Google::Cloud::Redis::Cluster::V1beta1::GetClusterCertificateAuthorityRequest] - # 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_cluster_certificate_authority_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :get, - uri_template: "/v1beta1/{name}", - matches: [ - ["name", %r{^projects/[^/]+/locations/[^/]+/clusters/[^/]+/certificateAuthority/?$}, false] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the reschedule_cluster_maintenance REST call - # - # @param request_pb [::Google::Cloud::Redis::Cluster::V1beta1::RescheduleClusterMaintenanceRequest] - # A request object representing the call parameters. Required. - # @return [Array(String, [String, nil], Hash{String => String})] - # Uri, Body, Query string parameters - def self.transcode_reschedule_cluster_maintenance_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :post, - uri_template: "/v1beta1/{name}:rescheduleClusterMaintenance", - body: "*", - matches: [ - ["name", %r{^projects/[^/]+/locations/[^/]+/clusters/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the list_backup_collections REST call - # - # @param request_pb [::Google::Cloud::Redis::Cluster::V1beta1::ListBackupCollectionsRequest] - # 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_backup_collections_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :get, - uri_template: "/v1beta1/{parent}/backupCollections", - matches: [ - ["parent", %r{^projects/[^/]+/locations/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the get_backup_collection REST call - # - # @param request_pb [::Google::Cloud::Redis::Cluster::V1beta1::GetBackupCollectionRequest] - # 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_backup_collection_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :get, - uri_template: "/v1beta1/{name}", - matches: [ - ["name", %r{^projects/[^/]+/locations/[^/]+/backupCollections/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the list_backups REST call - # - # @param request_pb [::Google::Cloud::Redis::Cluster::V1beta1::ListBackupsRequest] - # 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_backups_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :get, - uri_template: "/v1beta1/{parent}/backups", - matches: [ - ["parent", %r{^projects/[^/]+/locations/[^/]+/backupCollections/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the get_backup REST call - # - # @param request_pb [::Google::Cloud::Redis::Cluster::V1beta1::GetBackupRequest] - # 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_backup_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :get, - uri_template: "/v1beta1/{name}", - matches: [ - ["name", %r{^projects/[^/]+/locations/[^/]+/backupCollections/[^/]+/backups/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the delete_backup REST call - # - # @param request_pb [::Google::Cloud::Redis::Cluster::V1beta1::DeleteBackupRequest] - # 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_backup_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :delete, - uri_template: "/v1beta1/{name}", - matches: [ - ["name", %r{^projects/[^/]+/locations/[^/]+/backupCollections/[^/]+/backups/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the export_backup REST call - # - # @param request_pb [::Google::Cloud::Redis::Cluster::V1beta1::ExportBackupRequest] - # A request object representing the call parameters. Required. - # @return [Array(String, [String, nil], Hash{String => String})] - # Uri, Body, Query string parameters - def self.transcode_export_backup_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :post, - uri_template: "/v1beta1/{name}:export", - body: "*", - matches: [ - ["name", %r{^projects/[^/]+/locations/[^/]+/backupCollections/[^/]+/backups/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the backup_cluster REST call - # - # @param request_pb [::Google::Cloud::Redis::Cluster::V1beta1::BackupClusterRequest] - # A request object representing the call parameters. Required. - # @return [Array(String, [String, nil], Hash{String => String})] - # Uri, Body, Query string parameters - def self.transcode_backup_cluster_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :post, - uri_template: "/v1beta1/{name}:backup", - body: "*", - matches: [ - ["name", %r{^projects/[^/]+/locations/[^/]+/clusters/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - end - end - end - end - end - end - end -end diff --git a/owl-bot-staging/google-cloud-redis-cluster-v1beta1/lib/google/cloud/redis/cluster/v1beta1/cloud_redis_cluster_pb.rb b/owl-bot-staging/google-cloud-redis-cluster-v1beta1/lib/google/cloud/redis/cluster/v1beta1/cloud_redis_cluster_pb.rb deleted file mode 100644 index 9074ebc40e65..000000000000 --- a/owl-bot-staging/google-cloud-redis-cluster-v1beta1/lib/google/cloud/redis/cluster/v1beta1/cloud_redis_cluster_pb.rb +++ /dev/null @@ -1,102 +0,0 @@ -# frozen_string_literal: true -# Generated by the protocol buffer compiler. DO NOT EDIT! -# source: google/cloud/redis/cluster/v1beta1/cloud_redis_cluster.proto - -require 'google/protobuf' - -require 'google/api/annotations_pb' -require 'google/api/client_pb' -require 'google/api/field_behavior_pb' -require 'google/api/field_info_pb' -require 'google/api/resource_pb' -require 'google/longrunning/operations_pb' -require 'google/protobuf/any_pb' -require 'google/protobuf/duration_pb' -require 'google/protobuf/empty_pb' -require 'google/protobuf/field_mask_pb' -require 'google/protobuf/timestamp_pb' -require 'google/type/dayofweek_pb' -require 'google/type/timeofday_pb' - - -descriptor_data = "\n.google.cloud.redis.cluster.v1beta1.ClusterMaintenanceScheduleB\x03\xe0\x41\x03H\x07\x88\x01\x01\x12^\n\x17psc_service_attachments\x18\x1e \x03(\x0b\x32\x38.google.cloud.redis.cluster.v1beta1.PscServiceAttachmentB\x03\xe0\x41\x03\x12S\n\x11\x63luster_endpoints\x18$ \x03(\x0b\x32\x33.google.cloud.redis.cluster.v1beta1.ClusterEndpointB\x03\xe0\x41\x01\x12P\n\x11\x62\x61\x63kup_collection\x18\' \x01(\tB0\xe0\x41\x01\xe0\x41\x03\xfa\x41\'\n%redis.googleapis.com/BackupCollectionH\x08\x88\x01\x01\x12?\n\x07kms_key\x18( \x01(\tB)\xe0\x41\x01\xfa\x41#\n!cloudkms.googleapis.com/CryptoKeyH\t\x88\x01\x01\x12_\n\x17\x61utomated_backup_config\x18* \x01(\x0b\x32\x39.google.cloud.redis.cluster.v1beta1.AutomatedBackupConfigB\x03\xe0\x41\x01\x12P\n\x0f\x65ncryption_info\x18+ \x01(\x0b\x32\x32.google.cloud.redis.cluster.v1beta1.EncryptionInfoB\x03\xe0\x41\x03\x1a\xef\x01\n\tStateInfo\x12W\n\x0bupdate_info\x18\x01 \x01(\x0b\x32@.google.cloud.redis.cluster.v1beta1.Cluster.StateInfo.UpdateInfoH\x00\x1a\x80\x01\n\nUpdateInfo\x12\x1f\n\x12target_shard_count\x18\x01 \x01(\x05H\x00\x88\x01\x01\x12!\n\x14target_replica_count\x18\x02 \x01(\x05H\x01\x88\x01\x01\x42\x15\n\x13_target_shard_countB\x17\n\x15_target_replica_countB\x06\n\x04info\x1a$\n\x0fGcsBackupSource\x12\x11\n\x04uris\x18\x01 \x03(\tB\x03\xe0\x41\x01\x1a*\n\x13ManagedBackupSource\x12\x13\n\x06\x62\x61\x63kup\x18\x01 \x01(\tB\x03\xe0\x41\x01\x1a\x33\n\x11RedisConfigsEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12\r\n\x05value\x18\x02 \x01(\t:\x02\x38\x01\"T\n\x05State\x12\x15\n\x11STATE_UNSPECIFIED\x10\x00\x12\x0c\n\x08\x43REATING\x10\x01\x12\n\n\x06\x41\x43TIVE\x10\x02\x12\x0c\n\x08UPDATING\x10\x03\x12\x0c\n\x08\x44\x45LETING\x10\x04:p\xea\x41m\n\x1credis.googleapis.com/Cluster\x12:projects/{project}/locations/{location}/clusters/{cluster}*\x08\x63lusters2\x07\x63lusterB\x10\n\x0eimport_sourcesB\x10\n\x0e_replica_countB\n\n\x08_size_gbB\x0e\n\x0c_shard_countB\x12\n\x10_precise_size_gbB\x1e\n\x1c_deletion_protection_enabledB\x15\n\x13_maintenance_policyB\x17\n\x15_maintenance_scheduleB\x14\n\x12_backup_collectionB\n\n\x08_kms_key\"\x8f\x04\n\x15\x41utomatedBackupConfig\x12y\n\x18\x66ixed_frequency_schedule\x18\x02 \x01(\x0b\x32P.google.cloud.redis.cluster.v1beta1.AutomatedBackupConfig.FixedFrequencyScheduleB\x03\xe0\x41\x01H\x00\x12q\n\x15\x61utomated_backup_mode\x18\x01 \x01(\x0e\x32M.google.cloud.redis.cluster.v1beta1.AutomatedBackupConfig.AutomatedBackupModeB\x03\xe0\x41\x01\x12\x36\n\tretention\x18\x03 \x01(\x0b\x32\x19.google.protobuf.DurationB\x03\xe0\x41\x01H\x01\x88\x01\x01\x1a]\n\x16\x46ixedFrequencySchedule\x12\x34\n\nstart_time\x18\x02 \x01(\x0b\x32\x16.google.type.TimeOfDayB\x03\xe0\x41\x02H\x00\x88\x01\x01\x42\r\n\x0b_start_time\"W\n\x13\x41utomatedBackupMode\x12%\n!AUTOMATED_BACKUP_MODE_UNSPECIFIED\x10\x00\x12\x0c\n\x08\x44ISABLED\x10\x01\x12\x0b\n\x07\x45NABLED\x10\x02\x42\n\n\x08scheduleB\x0c\n\n_retention\"\xf6\x02\n\x10\x42\x61\x63kupCollection\x12\x11\n\x04name\x18\x01 \x01(\tB\x03\xe0\x41\x08\x12 \n\x0b\x63luster_uid\x18\x03 \x01(\tB\x0b\xe0\x41\x03\xe2\x8c\xcf\xd7\x08\x02\x08\x01\x12\x35\n\x07\x63luster\x18\x04 \x01(\tB$\xe0\x41\x03\xfa\x41\x1e\n\x1credis.googleapis.com/Cluster\x12:\n\x07kms_key\x18\x05 \x01(\tB)\xe0\x41\x03\xfa\x41#\n!cloudkms.googleapis.com/CryptoKey\x12\x18\n\x03uid\x18\x06 \x01(\tB\x0b\xe0\x41\x03\xe2\x8c\xcf\xd7\x08\x02\x08\x01:\x9f\x01\xea\x41\x9b\x01\n%redis.googleapis.com/BackupCollection\x12Mprojects/{project}/locations/{location}/backupCollections/{backup_collection}*\x11\x62\x61\x63kupCollections2\x10\x62\x61\x63kupCollection\"\x9b\x08\n\x06\x42\x61\x63kup\x12\x11\n\x04name\x18\x01 \x01(\tB\x03\xe0\x41\x08\x12\x34\n\x0b\x63reate_time\x18\x02 \x01(\x0b\x32\x1a.google.protobuf.TimestampB\x03\xe0\x41\x03\x12\x35\n\x07\x63luster\x18\x03 \x01(\tB$\xe0\x41\x03\xfa\x41\x1e\n\x1credis.googleapis.com/Cluster\x12 \n\x0b\x63luster_uid\x18\x04 \x01(\tB\x0b\xe0\x41\x03\xe2\x8c\xcf\xd7\x08\x02\x08\x01\x12\x1d\n\x10total_size_bytes\x18\x05 \x01(\x03\x42\x03\xe0\x41\x03\x12\x34\n\x0b\x65xpire_time\x18\x06 \x01(\x0b\x32\x1a.google.protobuf.TimestampB\x03\xe0\x41\x03\x12\x1b\n\x0e\x65ngine_version\x18\x07 \x01(\tB\x03\xe0\x41\x03\x12I\n\x0c\x62\x61\x63kup_files\x18\x08 \x03(\x0b\x32..google.cloud.redis.cluster.v1beta1.BackupFileB\x03\xe0\x41\x03\x12\x44\n\tnode_type\x18\t \x01(\x0e\x32,.google.cloud.redis.cluster.v1beta1.NodeTypeB\x03\xe0\x41\x03\x12\x1a\n\rreplica_count\x18\n \x01(\x05\x42\x03\xe0\x41\x03\x12\x18\n\x0bshard_count\x18\x0b \x01(\x05\x42\x03\xe0\x41\x03\x12O\n\x0b\x62\x61\x63kup_type\x18\x0c \x01(\x0e\x32\x35.google.cloud.redis.cluster.v1beta1.Backup.BackupTypeB\x03\xe0\x41\x03\x12\x44\n\x05state\x18\r \x01(\x0e\x32\x30.google.cloud.redis.cluster.v1beta1.Backup.StateB\x03\xe0\x41\x03\x12P\n\x0f\x65ncryption_info\x18\x0e \x01(\x0b\x32\x32.google.cloud.redis.cluster.v1beta1.EncryptionInfoB\x03\xe0\x41\x03\x12\x18\n\x03uid\x18\x0f \x01(\tB\x0b\xe0\x41\x03\xe2\x8c\xcf\xd7\x08\x02\x08\x01\"G\n\nBackupType\x12\x1b\n\x17\x42\x41\x43KUP_TYPE_UNSPECIFIED\x10\x00\x12\r\n\tON_DEMAND\x10\x01\x12\r\n\tAUTOMATED\x10\x02\"U\n\x05State\x12\x15\n\x11STATE_UNSPECIFIED\x10\x00\x12\x0c\n\x08\x43REATING\x10\x01\x12\n\n\x06\x41\x43TIVE\x10\x02\x12\x0c\n\x08\x44\x45LETING\x10\x03\x12\r\n\tSUSPENDED\x10\x04:\x92\x01\xea\x41\x8e\x01\n\x1bredis.googleapis.com/Backup\x12^projects/{project}/locations/{location}/backupCollections/{backup_collection}/backups/{backup}*\x07\x62\x61\x63kups2\x06\x62\x61\x63kup\"s\n\nBackupFile\x12\x16\n\tfile_name\x18\x01 \x01(\tB\x03\xe0\x41\x03\x12\x17\n\nsize_bytes\x18\x02 \x01(\x03\x42\x03\xe0\x41\x03\x12\x34\n\x0b\x63reate_time\x18\x03 \x01(\x0b\x32\x1a.google.protobuf.TimestampB\x03\xe0\x41\x03\"\x89\x01\n\x14PscServiceAttachment\x12\x1f\n\x12service_attachment\x18\x01 \x01(\tB\x03\xe0\x41\x03\x12P\n\x0f\x63onnection_type\x18\x03 \x01(\x0e\x32\x32.google.cloud.redis.cluster.v1beta1.ConnectionTypeB\x03\xe0\x41\x03\"\x92\x07\n\x1d\x43rossClusterReplicationConfig\x12\x63\n\x0c\x63luster_role\x18\x01 \x01(\x0e\x32M.google.cloud.redis.cluster.v1beta1.CrossClusterReplicationConfig.ClusterRole\x12h\n\x0fprimary_cluster\x18\x02 \x01(\x0b\x32O.google.cloud.redis.cluster.v1beta1.CrossClusterReplicationConfig.RemoteCluster\x12k\n\x12secondary_clusters\x18\x03 \x03(\x0b\x32O.google.cloud.redis.cluster.v1beta1.CrossClusterReplicationConfig.RemoteCluster\x12\x34\n\x0bupdate_time\x18\x04 \x01(\x0b\x32\x1a.google.protobuf.TimestampB\x03\xe0\x41\x03\x12\x65\n\nmembership\x18\x05 \x01(\x0b\x32L.google.cloud.redis.cluster.v1beta1.CrossClusterReplicationConfig.MembershipB\x03\xe0\x41\x03\x1aU\n\rRemoteCluster\x12\x32\n\x07\x63luster\x18\x01 \x01(\tB!\xfa\x41\x1e\n\x1credis.googleapis.com/Cluster\x12\x10\n\x03uid\x18\x02 \x01(\tB\x03\xe0\x41\x03\x1a\xed\x01\n\nMembership\x12m\n\x0fprimary_cluster\x18\x01 \x01(\x0b\x32O.google.cloud.redis.cluster.v1beta1.CrossClusterReplicationConfig.RemoteClusterB\x03\xe0\x41\x03\x12p\n\x12secondary_clusters\x18\x02 \x03(\x0b\x32O.google.cloud.redis.cluster.v1beta1.CrossClusterReplicationConfig.RemoteClusterB\x03\xe0\x41\x03\"Q\n\x0b\x43lusterRole\x12\x1c\n\x18\x43LUSTER_ROLE_UNSPECIFIED\x10\x00\x12\x08\n\x04NONE\x10\x01\x12\x0b\n\x07PRIMARY\x10\x02\x12\r\n\tSECONDARY\x10\x03\"\xed\x01\n\x18\x43lusterMaintenancePolicy\x12\x34\n\x0b\x63reate_time\x18\x01 \x01(\x0b\x32\x1a.google.protobuf.TimestampB\x03\xe0\x41\x03\x12\x34\n\x0bupdate_time\x18\x02 \x01(\x0b\x32\x1a.google.protobuf.TimestampB\x03\xe0\x41\x03\x12\x65\n\x19weekly_maintenance_window\x18\x03 \x03(\x0b\x32\x42.google.cloud.redis.cluster.v1beta1.ClusterWeeklyMaintenanceWindow\"q\n\x1e\x43lusterWeeklyMaintenanceWindow\x12#\n\x03\x64\x61y\x18\x01 \x01(\x0e\x32\x16.google.type.DayOfWeek\x12*\n\nstart_time\x18\x02 \x01(\x0b\x32\x16.google.type.TimeOfDay\"\x84\x01\n\x1a\x43lusterMaintenanceSchedule\x12\x33\n\nstart_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\"!\n\tPscConfig\x12\x14\n\x07network\x18\x02 \x01(\tB\x03\xe0\x41\x02\"\x84\x01\n\x11\x44iscoveryEndpoint\x12\x14\n\x07\x61\x64\x64ress\x18\x01 \x01(\tB\x03\xe0\x41\x03\x12\x11\n\x04port\x18\x02 \x01(\x05\x42\x03\xe0\x41\x03\x12\x46\n\npsc_config\x18\x03 \x01(\x0b\x32-.google.cloud.redis.cluster.v1beta1.PscConfigB\x03\xe0\x41\x03\"\xe4\x03\n\rPscConnection\x12\x1e\n\x11psc_connection_id\x18\x01 \x01(\tB\x03\xe0\x41\x02\x12\x1c\n\x07\x61\x64\x64ress\x18\x02 \x01(\tB\x0b\xe0\x41\x02\xe2\x8c\xcf\xd7\x08\x02\x08\x02\x12\x46\n\x0f\x66orwarding_rule\x18\x03 \x01(\tB-\xe0\x41\x02\xfa\x41\'\n%compute.googleapis.com/ForwardingRule\x12\x17\n\nproject_id\x18\x04 \x01(\tB\x03\xe0\x41\x01\x12\x37\n\x07network\x18\x05 \x01(\tB&\xe0\x41\x02\xfa\x41 \n\x1e\x63ompute.googleapis.com/Network\x12L\n\x12service_attachment\x18\x06 \x01(\tB0\xe0\x41\x02\xfa\x41*\n(compute.googleapis.com/ServiceAttachment\x12[\n\x15psc_connection_status\x18\x08 \x01(\x0e\x32\x37.google.cloud.redis.cluster.v1beta1.PscConnectionStatusB\x03\xe0\x41\x03\x12P\n\x0f\x63onnection_type\x18\n \x01(\x0e\x32\x32.google.cloud.redis.cluster.v1beta1.ConnectionTypeB\x03\xe0\x41\x03\"\\\n\x0f\x43lusterEndpoint\x12I\n\x0b\x63onnections\x18\x01 \x03(\x0b\x32\x34.google.cloud.redis.cluster.v1beta1.ConnectionDetail\"\xc3\x01\n\x10\x43onnectionDetail\x12T\n\x13psc_auto_connection\x18\x01 \x01(\x0b\x32\x35.google.cloud.redis.cluster.v1beta1.PscAutoConnectionH\x00\x12K\n\x0epsc_connection\x18\x02 \x01(\x0b\x32\x31.google.cloud.redis.cluster.v1beta1.PscConnectionH\x00\x42\x0c\n\nconnection\"\xe8\x03\n\x11PscAutoConnection\x12\x1e\n\x11psc_connection_id\x18\x01 \x01(\tB\x03\xe0\x41\x03\x12\x1c\n\x07\x61\x64\x64ress\x18\x02 \x01(\tB\x0b\xe0\x41\x03\xe2\x8c\xcf\xd7\x08\x02\x08\x02\x12\x46\n\x0f\x66orwarding_rule\x18\x03 \x01(\tB-\xe0\x41\x03\xfa\x41\'\n%compute.googleapis.com/ForwardingRule\x12\x17\n\nproject_id\x18\x04 \x01(\tB\x03\xe0\x41\x02\x12\x37\n\x07network\x18\x05 \x01(\tB&\xe0\x41\x02\xfa\x41 \n\x1e\x63ompute.googleapis.com/Network\x12L\n\x12service_attachment\x18\x06 \x01(\tB0\xe0\x41\x03\xfa\x41*\n(compute.googleapis.com/ServiceAttachment\x12[\n\x15psc_connection_status\x18\x08 \x01(\x0e\x32\x37.google.cloud.redis.cluster.v1beta1.PscConnectionStatusB\x03\xe0\x41\x03\x12P\n\x0f\x63onnection_type\x18\t \x01(\x0e\x32\x32.google.cloud.redis.cluster.v1beta1.ConnectionTypeB\x03\xe0\x41\x03\"\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\"\x8f\x04\n\x14\x43\x65rtificateAuthority\x12q\n\x11managed_server_ca\x18\x01 \x01(\x0b\x32T.google.cloud.redis.cluster.v1beta1.CertificateAuthority.ManagedCertificateAuthorityH\x00\x12\x11\n\x04name\x18\x02 \x01(\tB\x03\xe0\x41\x08\x1a\xb2\x01\n\x1bManagedCertificateAuthority\x12p\n\x08\x63\x61_certs\x18\x01 \x03(\x0b\x32^.google.cloud.redis.cluster.v1beta1.CertificateAuthority.ManagedCertificateAuthority.CertChain\x1a!\n\tCertChain\x12\x14\n\x0c\x63\x65rtificates\x18\x01 \x03(\t:\xae\x01\xea\x41\xaa\x01\n)redis.googleapis.com/CertificateAuthority\x12Oprojects/{project}/locations/{location}/clusters/{cluster}/certificateAuthority*\x16\x63\x65rtificateAuthorities2\x14\x63\x65rtificateAuthorityB\x0b\n\tserver_ca\"\xa0\x07\n\x18\x43lusterPersistenceConfig\x12_\n\x04mode\x18\x01 \x01(\x0e\x32L.google.cloud.redis.cluster.v1beta1.ClusterPersistenceConfig.PersistenceModeB\x03\xe0\x41\x01\x12_\n\nrdb_config\x18\x02 \x01(\x0b\x32\x46.google.cloud.redis.cluster.v1beta1.ClusterPersistenceConfig.RDBConfigB\x03\xe0\x41\x01\x12_\n\naof_config\x18\x03 \x01(\x0b\x32\x46.google.cloud.redis.cluster.v1beta1.ClusterPersistenceConfig.AOFConfigB\x03\xe0\x41\x01\x1a\xbf\x02\n\tRDBConfig\x12w\n\x13rdb_snapshot_period\x18\x01 \x01(\x0e\x32U.google.cloud.redis.cluster.v1beta1.ClusterPersistenceConfig.RDBConfig.SnapshotPeriodB\x03\xe0\x41\x01\x12@\n\x17rdb_snapshot_start_time\x18\x02 \x01(\x0b\x32\x1a.google.protobuf.TimestampB\x03\xe0\x41\x01\"w\n\x0eSnapshotPeriod\x12\x1f\n\x1bSNAPSHOT_PERIOD_UNSPECIFIED\x10\x00\x12\x0c\n\x08ONE_HOUR\x10\x01\x12\r\n\tSIX_HOURS\x10\x02\x12\x10\n\x0cTWELVE_HOURS\x10\x03\x12\x15\n\x11TWENTY_FOUR_HOURS\x10\x04\x1a\xc9\x01\n\tAOFConfig\x12m\n\x0c\x61ppend_fsync\x18\x01 \x01(\x0e\x32R.google.cloud.redis.cluster.v1beta1.ClusterPersistenceConfig.AOFConfig.AppendFsyncB\x03\xe0\x41\x01\"M\n\x0b\x41ppendFsync\x12\x1c\n\x18\x41PPEND_FSYNC_UNSPECIFIED\x10\x00\x12\x06\n\x02NO\x10\x01\x12\x0c\n\x08\x45VERYSEC\x10\x02\x12\n\n\x06\x41LWAYS\x10\x03\"S\n\x0fPersistenceMode\x12 \n\x1cPERSISTENCE_MODE_UNSPECIFIED\x10\x00\x12\x0c\n\x08\x44ISABLED\x10\x01\x12\x07\n\x03RDB\x10\x02\x12\x07\n\x03\x41OF\x10\x03\"\xf0\x01\n\x16ZoneDistributionConfig\x12\x62\n\x04mode\x18\x01 \x01(\x0e\x32O.google.cloud.redis.cluster.v1beta1.ZoneDistributionConfig.ZoneDistributionModeB\x03\xe0\x41\x01\x12\x11\n\x04zone\x18\x02 \x01(\tB\x03\xe0\x41\x01\"_\n\x14ZoneDistributionMode\x12&\n\"ZONE_DISTRIBUTION_MODE_UNSPECIFIED\x10\x00\x12\x0e\n\nMULTI_ZONE\x10\x01\x12\x0f\n\x0bSINGLE_ZONE\x10\x02\"\xdc\x02\n#RescheduleClusterMaintenanceRequest\x12\x32\n\x04name\x18\x01 \x01(\tB$\xe0\x41\x02\xfa\x41\x1e\n\x1credis.googleapis.com/Cluster\x12t\n\x0freschedule_type\x18\x02 \x01(\x0e\x32V.google.cloud.redis.cluster.v1beta1.RescheduleClusterMaintenanceRequest.RescheduleTypeB\x03\xe0\x41\x02\x12\x36\n\rschedule_time\x18\x03 \x01(\x0b\x32\x1a.google.protobuf.TimestampB\x03\xe0\x41\x01\"S\n\x0eRescheduleType\x12\x1f\n\x1bRESCHEDULE_TYPE_UNSPECIFIED\x10\x00\x12\r\n\tIMMEDIATE\x10\x01\x12\x11\n\rSPECIFIC_TIME\x10\x03\"\x84\x05\n\x0e\x45ncryptionInfo\x12U\n\x0f\x65ncryption_type\x18\x01 \x01(\x0e\x32\x37.google.cloud.redis.cluster.v1beta1.EncryptionInfo.TypeB\x03\xe0\x41\x03\x12J\n\x10kms_key_versions\x18\x02 \x03(\tB0\xe0\x41\x03\xfa\x41*\n(cloudkms.googleapis.com/CryptoKeyVersion\x12\x62\n\x15kms_key_primary_state\x18\x03 \x01(\x0e\x32>.google.cloud.redis.cluster.v1beta1.EncryptionInfo.KmsKeyStateB\x03\xe0\x41\x03\x12\x39\n\x10last_update_time\x18\x04 \x01(\x0b\x32\x1a.google.protobuf.TimestampB\x03\xe0\x41\x03\"\\\n\x04Type\x12\x14\n\x10TYPE_UNSPECIFIED\x10\x00\x12\x1d\n\x19GOOGLE_DEFAULT_ENCRYPTION\x10\x01\x12\x1f\n\x1b\x43USTOMER_MANAGED_ENCRYPTION\x10\x02\"\xd1\x01\n\x0bKmsKeyState\x12\x1d\n\x19KMS_KEY_STATE_UNSPECIFIED\x10\x00\x12\x0b\n\x07\x45NABLED\x10\x01\x12\x15\n\x11PERMISSION_DENIED\x10\x02\x12\x0c\n\x08\x44ISABLED\x10\x03\x12\r\n\tDESTROYED\x10\x04\x12\x15\n\x11\x44\x45STROY_SCHEDULED\x10\x05\x12 \n\x1c\x45KM_KEY_UNREACHABLE_DETECTED\x10\x06\x12\x14\n\x10\x42ILLING_DISABLED\x10\x07\x12\x13\n\x0fUNKNOWN_FAILURE\x10\x08*\x83\x01\n\x13PscConnectionStatus\x12%\n!PSC_CONNECTION_STATUS_UNSPECIFIED\x10\x00\x12 \n\x1cPSC_CONNECTION_STATUS_ACTIVE\x10\x01\x12#\n\x1fPSC_CONNECTION_STATUS_NOT_FOUND\x10\x02*^\n\x11\x41uthorizationMode\x12\x19\n\x15\x41UTH_MODE_UNSPECIFIED\x10\x00\x12\x16\n\x12\x41UTH_MODE_IAM_AUTH\x10\x01\x12\x16\n\x12\x41UTH_MODE_DISABLED\x10\x02*\x8f\x01\n\x08NodeType\x12\x19\n\x15NODE_TYPE_UNSPECIFIED\x10\x00\x12\x1a\n\x16REDIS_SHARED_CORE_NANO\x10\x01\x12\x18\n\x14REDIS_HIGHMEM_MEDIUM\x10\x02\x12\x18\n\x14REDIS_HIGHMEM_XLARGE\x10\x03\x12\x18\n\x14REDIS_STANDARD_SMALL\x10\x04*\x99\x01\n\x15TransitEncryptionMode\x12\'\n#TRANSIT_ENCRYPTION_MODE_UNSPECIFIED\x10\x00\x12$\n TRANSIT_ENCRYPTION_MODE_DISABLED\x10\x01\x12\x31\n-TRANSIT_ENCRYPTION_MODE_SERVER_AUTHENTICATION\x10\x02*\x89\x01\n\x0e\x43onnectionType\x12\x1f\n\x1b\x43ONNECTION_TYPE_UNSPECIFIED\x10\x00\x12\x1d\n\x19\x43ONNECTION_TYPE_DISCOVERY\x10\x01\x12\x1b\n\x17\x43ONNECTION_TYPE_PRIMARY\x10\x02\x12\x1a\n\x16\x43ONNECTION_TYPE_READER\x10\x03\x32\xc4\x19\n\x11\x43loudRedisCluster\x12\xc5\x01\n\x0cListClusters\x12\x37.google.cloud.redis.cluster.v1beta1.ListClustersRequest\x1a\x38.google.cloud.redis.cluster.v1beta1.ListClustersResponse\"B\xda\x41\x06parent\x82\xd3\xe4\x93\x02\x33\x12\x31/v1beta1/{parent=projects/*/locations/*}/clusters\x12\xb2\x01\n\nGetCluster\x12\x35.google.cloud.redis.cluster.v1beta1.GetClusterRequest\x1a+.google.cloud.redis.cluster.v1beta1.Cluster\"@\xda\x41\x04name\x82\xd3\xe4\x93\x02\x33\x12\x31/v1beta1/{name=projects/*/locations/*/clusters/*}\x12\xec\x01\n\rUpdateCluster\x12\x38.google.cloud.redis.cluster.v1beta1.UpdateClusterRequest\x1a\x1d.google.longrunning.Operation\"\x81\x01\xca\x41\x1e\n\x07\x43luster\x12\x13google.protobuf.Any\xda\x41\x13\x63luster,update_mask\x82\xd3\xe4\x93\x02\x44\x32\x39/v1beta1/{cluster.name=projects/*/locations/*/clusters/*}:\x07\x63luster\x12\xd9\x01\n\rDeleteCluster\x12\x38.google.cloud.redis.cluster.v1beta1.DeleteClusterRequest\x1a\x1d.google.longrunning.Operation\"o\xca\x41,\n\x15google.protobuf.Empty\x12\x13google.protobuf.Any\xda\x41\x04name\x82\xd3\xe4\x93\x02\x33*1/v1beta1/{name=projects/*/locations/*/clusters/*}\x12\xe9\x01\n\rCreateCluster\x12\x38.google.cloud.redis.cluster.v1beta1.CreateClusterRequest\x1a\x1d.google.longrunning.Operation\"\x7f\xca\x41\x1e\n\x07\x43luster\x12\x13google.protobuf.Any\xda\x41\x19parent,cluster,cluster_id\x82\xd3\xe4\x93\x02<\"1/v1beta1/{parent=projects/*/locations/*}/clusters:\x07\x63luster\x12\xfc\x01\n\x1eGetClusterCertificateAuthority\x12I.google.cloud.redis.cluster.v1beta1.GetClusterCertificateAuthorityRequest\x1a\x38.google.cloud.redis.cluster.v1beta1.CertificateAuthority\"U\xda\x41\x04name\x82\xd3\xe4\x93\x02H\x12\x46/v1beta1/{name=projects/*/locations/*/clusters/*/certificateAuthority}\x12\xa8\x02\n\x1cRescheduleClusterMaintenance\x12G.google.cloud.redis.cluster.v1beta1.RescheduleClusterMaintenanceRequest\x1a\x1d.google.longrunning.Operation\"\x9f\x01\xca\x41\x1e\n\x07\x43luster\x12\x13google.protobuf.Any\xda\x41\"name,reschedule_type,schedule_time\x82\xd3\xe4\x93\x02S\"N/v1beta1/{name=projects/*/locations/*/clusters/*}:rescheduleClusterMaintenance:\x01*\x12\xe9\x01\n\x15ListBackupCollections\x12@.google.cloud.redis.cluster.v1beta1.ListBackupCollectionsRequest\x1a\x41.google.cloud.redis.cluster.v1beta1.ListBackupCollectionsResponse\"K\xda\x41\x06parent\x82\xd3\xe4\x93\x02<\x12:/v1beta1/{parent=projects/*/locations/*}/backupCollections\x12\xd6\x01\n\x13GetBackupCollection\x12>.google.cloud.redis.cluster.v1beta1.GetBackupCollectionRequest\x1a\x34.google.cloud.redis.cluster.v1beta1.BackupCollection\"I\xda\x41\x04name\x82\xd3\xe4\x93\x02<\x12:/v1beta1/{name=projects/*/locations/*/backupCollections/*}\x12\xd5\x01\n\x0bListBackups\x12\x36.google.cloud.redis.cluster.v1beta1.ListBackupsRequest\x1a\x37.google.cloud.redis.cluster.v1beta1.ListBackupsResponse\"U\xda\x41\x06parent\x82\xd3\xe4\x93\x02\x46\x12\x44/v1beta1/{parent=projects/*/locations/*/backupCollections/*}/backups\x12\xc2\x01\n\tGetBackup\x12\x34.google.cloud.redis.cluster.v1beta1.GetBackupRequest\x1a*.google.cloud.redis.cluster.v1beta1.Backup\"S\xda\x41\x04name\x82\xd3\xe4\x93\x02\x46\x12\x44/v1beta1/{name=projects/*/locations/*/backupCollections/*/backups/*}\x12\xeb\x01\n\x0c\x44\x65leteBackup\x12\x37.google.cloud.redis.cluster.v1beta1.DeleteBackupRequest\x1a\x1d.google.longrunning.Operation\"\x82\x01\xca\x41,\n\x15google.protobuf.Empty\x12\x13google.protobuf.Any\xda\x41\x04name\x82\xd3\xe4\x93\x02\x46*D/v1beta1/{name=projects/*/locations/*/backupCollections/*/backups/*}\x12\xde\x01\n\x0c\x45xportBackup\x12\x37.google.cloud.redis.cluster.v1beta1.ExportBackupRequest\x1a\x1d.google.longrunning.Operation\"v\xca\x41\x1d\n\x06\x42\x61\x63kup\x12\x13google.protobuf.Any\x82\xd3\xe4\x93\x02P\"K/v1beta1/{name=projects/*/locations/*/backupCollections/*/backups/*}:export:\x01*\x12\xd5\x01\n\rBackupCluster\x12\x38.google.cloud.redis.cluster.v1beta1.BackupClusterRequest\x1a\x1d.google.longrunning.Operation\"k\xca\x41\x1e\n\x07\x43luster\x12\x13google.protobuf.Any\xda\x41\x04name\x82\xd3\xe4\x93\x02=\"8/v1beta1/{name=projects/*/locations/*/clusters/*}:backup:\x01*\x1aH\xca\x41\x14redis.googleapis.com\xd2\x41.https://www.googleapis.com/auth/cloud-platformB\x8e\x06\n&com.google.cloud.redis.cluster.v1beta1B\x16\x43loudRedisClusterProtoP\x01Z@cloud.google.com/go/redis/cluster/apiv1beta1/clusterpb;clusterpb\xea\x02&Google::Cloud::Redis::Cluster::V1beta1\xea\x41n\n%compute.googleapis.com/ForwardingRule\x12\x45projects/{project}/regions/{region}/forwardingRules/{forwarding_rule}\xea\x41N\n\x1e\x63ompute.googleapis.com/Network\x12,projects/{project}/global/networks/{network}\xea\x41w\n(compute.googleapis.com/ServiceAttachment\x12Kprojects/{project}/regions/{region}/serviceAttachments/{service_attachment}\xea\x41x\n!cloudkms.googleapis.com/CryptoKey\x12Sprojects/{project}/locations/{location}/keyRings/{key_ring}/cryptoKeys/{crypto_key}\xea\x41\xa6\x01\n(cloudkms.googleapis.com/CryptoKeyVersion\x12zprojects/{project}/locations/{location}/keyRings/{key_ring}/cryptoKeys/{crypto_key}/cryptoKeyVersions/{crypto_key_version}b\x06proto3" - -pool = ::Google::Protobuf::DescriptorPool.generated_pool -pool.add_serialized_file(descriptor_data) - -module Google - module Cloud - module Redis - module Cluster - module V1beta1 - CreateClusterRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.redis.cluster.v1beta1.CreateClusterRequest").msgclass - ListClustersRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.redis.cluster.v1beta1.ListClustersRequest").msgclass - ListClustersResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.redis.cluster.v1beta1.ListClustersResponse").msgclass - UpdateClusterRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.redis.cluster.v1beta1.UpdateClusterRequest").msgclass - GetClusterRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.redis.cluster.v1beta1.GetClusterRequest").msgclass - DeleteClusterRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.redis.cluster.v1beta1.DeleteClusterRequest").msgclass - GetClusterCertificateAuthorityRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.redis.cluster.v1beta1.GetClusterCertificateAuthorityRequest").msgclass - ListBackupCollectionsRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.redis.cluster.v1beta1.ListBackupCollectionsRequest").msgclass - ListBackupCollectionsResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.redis.cluster.v1beta1.ListBackupCollectionsResponse").msgclass - GetBackupCollectionRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.redis.cluster.v1beta1.GetBackupCollectionRequest").msgclass - ListBackupsRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.redis.cluster.v1beta1.ListBackupsRequest").msgclass - ListBackupsResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.redis.cluster.v1beta1.ListBackupsResponse").msgclass - GetBackupRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.redis.cluster.v1beta1.GetBackupRequest").msgclass - DeleteBackupRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.redis.cluster.v1beta1.DeleteBackupRequest").msgclass - ExportBackupRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.redis.cluster.v1beta1.ExportBackupRequest").msgclass - BackupClusterRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.redis.cluster.v1beta1.BackupClusterRequest").msgclass - Cluster = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.redis.cluster.v1beta1.Cluster").msgclass - Cluster::StateInfo = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.redis.cluster.v1beta1.Cluster.StateInfo").msgclass - Cluster::StateInfo::UpdateInfo = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.redis.cluster.v1beta1.Cluster.StateInfo.UpdateInfo").msgclass - Cluster::GcsBackupSource = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.redis.cluster.v1beta1.Cluster.GcsBackupSource").msgclass - Cluster::ManagedBackupSource = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.redis.cluster.v1beta1.Cluster.ManagedBackupSource").msgclass - Cluster::State = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.redis.cluster.v1beta1.Cluster.State").enummodule - AutomatedBackupConfig = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.redis.cluster.v1beta1.AutomatedBackupConfig").msgclass - AutomatedBackupConfig::FixedFrequencySchedule = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.redis.cluster.v1beta1.AutomatedBackupConfig.FixedFrequencySchedule").msgclass - AutomatedBackupConfig::AutomatedBackupMode = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.redis.cluster.v1beta1.AutomatedBackupConfig.AutomatedBackupMode").enummodule - BackupCollection = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.redis.cluster.v1beta1.BackupCollection").msgclass - Backup = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.redis.cluster.v1beta1.Backup").msgclass - Backup::BackupType = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.redis.cluster.v1beta1.Backup.BackupType").enummodule - Backup::State = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.redis.cluster.v1beta1.Backup.State").enummodule - BackupFile = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.redis.cluster.v1beta1.BackupFile").msgclass - PscServiceAttachment = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.redis.cluster.v1beta1.PscServiceAttachment").msgclass - CrossClusterReplicationConfig = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.redis.cluster.v1beta1.CrossClusterReplicationConfig").msgclass - CrossClusterReplicationConfig::RemoteCluster = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.redis.cluster.v1beta1.CrossClusterReplicationConfig.RemoteCluster").msgclass - CrossClusterReplicationConfig::Membership = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.redis.cluster.v1beta1.CrossClusterReplicationConfig.Membership").msgclass - CrossClusterReplicationConfig::ClusterRole = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.redis.cluster.v1beta1.CrossClusterReplicationConfig.ClusterRole").enummodule - ClusterMaintenancePolicy = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.redis.cluster.v1beta1.ClusterMaintenancePolicy").msgclass - ClusterWeeklyMaintenanceWindow = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.redis.cluster.v1beta1.ClusterWeeklyMaintenanceWindow").msgclass - ClusterMaintenanceSchedule = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.redis.cluster.v1beta1.ClusterMaintenanceSchedule").msgclass - PscConfig = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.redis.cluster.v1beta1.PscConfig").msgclass - DiscoveryEndpoint = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.redis.cluster.v1beta1.DiscoveryEndpoint").msgclass - PscConnection = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.redis.cluster.v1beta1.PscConnection").msgclass - ClusterEndpoint = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.redis.cluster.v1beta1.ClusterEndpoint").msgclass - ConnectionDetail = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.redis.cluster.v1beta1.ConnectionDetail").msgclass - PscAutoConnection = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.redis.cluster.v1beta1.PscAutoConnection").msgclass - OperationMetadata = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.redis.cluster.v1beta1.OperationMetadata").msgclass - CertificateAuthority = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.redis.cluster.v1beta1.CertificateAuthority").msgclass - CertificateAuthority::ManagedCertificateAuthority = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.redis.cluster.v1beta1.CertificateAuthority.ManagedCertificateAuthority").msgclass - CertificateAuthority::ManagedCertificateAuthority::CertChain = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.redis.cluster.v1beta1.CertificateAuthority.ManagedCertificateAuthority.CertChain").msgclass - ClusterPersistenceConfig = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.redis.cluster.v1beta1.ClusterPersistenceConfig").msgclass - ClusterPersistenceConfig::RDBConfig = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.redis.cluster.v1beta1.ClusterPersistenceConfig.RDBConfig").msgclass - ClusterPersistenceConfig::RDBConfig::SnapshotPeriod = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.redis.cluster.v1beta1.ClusterPersistenceConfig.RDBConfig.SnapshotPeriod").enummodule - ClusterPersistenceConfig::AOFConfig = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.redis.cluster.v1beta1.ClusterPersistenceConfig.AOFConfig").msgclass - ClusterPersistenceConfig::AOFConfig::AppendFsync = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.redis.cluster.v1beta1.ClusterPersistenceConfig.AOFConfig.AppendFsync").enummodule - ClusterPersistenceConfig::PersistenceMode = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.redis.cluster.v1beta1.ClusterPersistenceConfig.PersistenceMode").enummodule - ZoneDistributionConfig = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.redis.cluster.v1beta1.ZoneDistributionConfig").msgclass - ZoneDistributionConfig::ZoneDistributionMode = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.redis.cluster.v1beta1.ZoneDistributionConfig.ZoneDistributionMode").enummodule - RescheduleClusterMaintenanceRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.redis.cluster.v1beta1.RescheduleClusterMaintenanceRequest").msgclass - RescheduleClusterMaintenanceRequest::RescheduleType = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.redis.cluster.v1beta1.RescheduleClusterMaintenanceRequest.RescheduleType").enummodule - EncryptionInfo = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.redis.cluster.v1beta1.EncryptionInfo").msgclass - EncryptionInfo::Type = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.redis.cluster.v1beta1.EncryptionInfo.Type").enummodule - EncryptionInfo::KmsKeyState = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.redis.cluster.v1beta1.EncryptionInfo.KmsKeyState").enummodule - PscConnectionStatus = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.redis.cluster.v1beta1.PscConnectionStatus").enummodule - AuthorizationMode = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.redis.cluster.v1beta1.AuthorizationMode").enummodule - NodeType = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.redis.cluster.v1beta1.NodeType").enummodule - TransitEncryptionMode = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.redis.cluster.v1beta1.TransitEncryptionMode").enummodule - ConnectionType = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.redis.cluster.v1beta1.ConnectionType").enummodule - end - end - end - end -end diff --git a/owl-bot-staging/google-cloud-redis-cluster-v1beta1/lib/google/cloud/redis/cluster/v1beta1/cloud_redis_cluster_services_pb.rb b/owl-bot-staging/google-cloud-redis-cluster-v1beta1/lib/google/cloud/redis/cluster/v1beta1/cloud_redis_cluster_services_pb.rb deleted file mode 100644 index 1c3cba0b9031..000000000000 --- a/owl-bot-staging/google-cloud-redis-cluster-v1beta1/lib/google/cloud/redis/cluster/v1beta1/cloud_redis_cluster_services_pb.rb +++ /dev/null @@ -1,122 +0,0 @@ -# Generated by the protocol buffer compiler. DO NOT EDIT! -# Source: google/cloud/redis/cluster/v1beta1/cloud_redis_cluster.proto for package 'Google.Cloud.Redis.Cluster.V1beta1' -# Original file comments: -# 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 -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. -# - -require 'grpc' -require 'google/cloud/redis/cluster/v1beta1/cloud_redis_cluster_pb' - -module Google - module Cloud - module Redis - module Cluster - module V1beta1 - module CloudRedisCluster - # Configures and manages Cloud Memorystore for Redis clusters - # - # Google Cloud Memorystore for Redis Cluster - # - # The `redis.googleapis.com` service implements the Google Cloud Memorystore - # for Redis API and defines the following resource model for managing Redis - # clusters: - # * The service works with a collection of cloud projects, named: `/projects/*` - # * Each project has a collection of available locations, named: `/locations/*` - # * Each location has a collection of Redis clusters, named: `/clusters/*` - # * As such, Redis clusters are resources of the form: - # `/projects/{project_id}/locations/{location_id}/clusters/{instance_id}` - # - # Note that location_id must be a GCP `region`; for example: - # * `projects/redpepper-1290/locations/us-central1/clusters/my-redis` - class Service - - include ::GRPC::GenericService - - self.marshal_class_method = :encode - self.unmarshal_class_method = :decode - self.service_name = 'google.cloud.redis.cluster.v1beta1.CloudRedisCluster' - - # Lists all Redis clusters owned by a project in either the specified - # location (region) or all locations. - # - # The location should have the following format: - # - # * `projects/{project_id}/locations/{location_id}` - # - # If `location_id` is specified as `-` (wildcard), then all regions - # available to the project are queried, and the results are aggregated. - rpc :ListClusters, ::Google::Cloud::Redis::Cluster::V1beta1::ListClustersRequest, ::Google::Cloud::Redis::Cluster::V1beta1::ListClustersResponse - # Gets the details of a specific Redis cluster. - rpc :GetCluster, ::Google::Cloud::Redis::Cluster::V1beta1::GetClusterRequest, ::Google::Cloud::Redis::Cluster::V1beta1::Cluster - # Updates the metadata and configuration of a specific Redis cluster. - # - # Completed longrunning.Operation will contain the new cluster object - # in the response field. The returned operation is automatically deleted - # after a few hours, so there is no need to call DeleteOperation. - rpc :UpdateCluster, ::Google::Cloud::Redis::Cluster::V1beta1::UpdateClusterRequest, ::Google::Longrunning::Operation - # Deletes a specific Redis cluster. Cluster stops serving and data is - # deleted. - rpc :DeleteCluster, ::Google::Cloud::Redis::Cluster::V1beta1::DeleteClusterRequest, ::Google::Longrunning::Operation - # Creates a Redis cluster based on the specified properties. - # The creation is executed asynchronously and callers may check the returned - # operation to track its progress. Once the operation is completed the Redis - # cluster will be fully functional. The completed longrunning.Operation will - # contain the new cluster object in the response field. - # - # The returned operation is automatically deleted after a few hours, so there - # is no need to call DeleteOperation. - rpc :CreateCluster, ::Google::Cloud::Redis::Cluster::V1beta1::CreateClusterRequest, ::Google::Longrunning::Operation - # Gets the details of certificate authority information for Redis cluster. - rpc :GetClusterCertificateAuthority, ::Google::Cloud::Redis::Cluster::V1beta1::GetClusterCertificateAuthorityRequest, ::Google::Cloud::Redis::Cluster::V1beta1::CertificateAuthority - # Reschedules upcoming maintenance event. - rpc :RescheduleClusterMaintenance, ::Google::Cloud::Redis::Cluster::V1beta1::RescheduleClusterMaintenanceRequest, ::Google::Longrunning::Operation - # Lists all backup collections owned by a consumer project in either the - # specified location (region) or all locations. - # - # If `location_id` is specified as `-` (wildcard), then all regions - # available to the project are queried, and the results are aggregated. - rpc :ListBackupCollections, ::Google::Cloud::Redis::Cluster::V1beta1::ListBackupCollectionsRequest, ::Google::Cloud::Redis::Cluster::V1beta1::ListBackupCollectionsResponse - # Get a backup collection. - rpc :GetBackupCollection, ::Google::Cloud::Redis::Cluster::V1beta1::GetBackupCollectionRequest, ::Google::Cloud::Redis::Cluster::V1beta1::BackupCollection - # Lists all backups owned by a backup collection. - rpc :ListBackups, ::Google::Cloud::Redis::Cluster::V1beta1::ListBackupsRequest, ::Google::Cloud::Redis::Cluster::V1beta1::ListBackupsResponse - # Gets the details of a specific backup. - rpc :GetBackup, ::Google::Cloud::Redis::Cluster::V1beta1::GetBackupRequest, ::Google::Cloud::Redis::Cluster::V1beta1::Backup - # Deletes a specific backup. - rpc :DeleteBackup, ::Google::Cloud::Redis::Cluster::V1beta1::DeleteBackupRequest, ::Google::Longrunning::Operation - # Exports a specific backup to a customer target Cloud Storage URI. - rpc :ExportBackup, ::Google::Cloud::Redis::Cluster::V1beta1::ExportBackupRequest, ::Google::Longrunning::Operation - # Backup Redis Cluster. - # If this is the first time a backup is being created, a backup collection - # will be created at the backend, and this backup belongs to this collection. - # Both collection and backup will have a resource name. Backup will be - # executed for each shard. A replica (primary if nonHA) will be selected to - # perform the execution. Backup call will be rejected if there is an ongoing - # backup or update operation. Be aware that during preview, if the cluster's - # internal software version is too old, critical update will be performed - # before actual backup. Once the internal software version is updated to the - # minimum version required by the backup feature, subsequent backups will not - # require critical update. After preview, there will be no critical update - # needed for backup. - rpc :BackupCluster, ::Google::Cloud::Redis::Cluster::V1beta1::BackupClusterRequest, ::Google::Longrunning::Operation - end - - Stub = Service.rpc_stub_class - end - end - end - end - end -end diff --git a/owl-bot-staging/google-cloud-redis-cluster-v1beta1/lib/google/cloud/redis/cluster/v1beta1/rest.rb b/owl-bot-staging/google-cloud-redis-cluster-v1beta1/lib/google/cloud/redis/cluster/v1beta1/rest.rb deleted file mode 100644 index 8c0c0259da61..000000000000 --- a/owl-bot-staging/google-cloud-redis-cluster-v1beta1/lib/google/cloud/redis/cluster/v1beta1/rest.rb +++ /dev/null @@ -1,40 +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/redis/cluster/v1beta1/cloud_redis_cluster/rest" -require "google/cloud/redis/cluster/v1beta1/bindings_override" -require "google/cloud/redis/cluster/v1beta1/version" - -module Google - module Cloud - module Redis - module Cluster - ## - # To load just the REST part of this package, including all its services, and instantiate a REST client: - # - # @example - # - # require "google/cloud/redis/cluster/v1beta1/rest" - # client = ::Google::Cloud::Redis::Cluster::V1beta1::CloudRedisCluster::Rest::Client.new - # - module V1beta1 - end - end - end - end -end diff --git a/owl-bot-staging/google-cloud-redis-cluster-v1beta1/lib/google/cloud/redis/cluster/v1beta1/version.rb b/owl-bot-staging/google-cloud-redis-cluster-v1beta1/lib/google/cloud/redis/cluster/v1beta1/version.rb deleted file mode 100644 index 5aa210ce32bc..000000000000 --- a/owl-bot-staging/google-cloud-redis-cluster-v1beta1/lib/google/cloud/redis/cluster/v1beta1/version.rb +++ /dev/null @@ -1,30 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - - -module Google - module Cloud - module Redis - module Cluster - module V1beta1 - VERSION = "0.0.1" - end - end - end - end -end diff --git a/owl-bot-staging/google-cloud-redis-cluster-v1beta1/proto_docs/README.md b/owl-bot-staging/google-cloud-redis-cluster-v1beta1/proto_docs/README.md deleted file mode 100644 index fdace2b045a6..000000000000 --- a/owl-bot-staging/google-cloud-redis-cluster-v1beta1/proto_docs/README.md +++ /dev/null @@ -1,4 +0,0 @@ -# Google Cloud Memorystore for Redis V1BETA1 Protocol Buffer Documentation - -These files are for the YARD documentation of the generated protobuf files. -They are not intended to be required or loaded at runtime. diff --git a/owl-bot-staging/google-cloud-redis-cluster-v1beta1/proto_docs/google/api/client.rb b/owl-bot-staging/google-cloud-redis-cluster-v1beta1/proto_docs/google/api/client.rb deleted file mode 100644 index 5089551e9ea4..000000000000 --- a/owl-bot-staging/google-cloud-redis-cluster-v1beta1/proto_docs/google/api/client.rb +++ /dev/null @@ -1,589 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - - -module Google - module Api - # Required information for every language. - # @!attribute [rw] reference_docs_uri - # @deprecated This field is deprecated and may be removed in the next major version update. - # @return [::String] - # Link to automatically generated reference documentation. Example: - # https://cloud.google.com/nodejs/docs/reference/asset/latest - # @!attribute [rw] destinations - # @return [::Array<::Google::Api::ClientLibraryDestination>] - # The destination where API teams want this client library to be published. - # @!attribute [rw] selective_gapic_generation - # @return [::Google::Api::SelectiveGapicGeneration] - # Configuration for which RPCs should be generated in the GAPIC client. - class CommonLanguageSettings - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Details about how and where to publish client libraries. - # @!attribute [rw] version - # @return [::String] - # Version of the API to apply these settings to. This is the full protobuf - # package for the API, ending in the version element. - # Examples: "google.cloud.speech.v1" and "google.spanner.admin.database.v1". - # @!attribute [rw] launch_stage - # @return [::Google::Api::LaunchStage] - # Launch stage of this version of the API. - # @!attribute [rw] rest_numeric_enums - # @return [::Boolean] - # When using transport=rest, the client request will encode enums as - # numbers rather than strings. - # @!attribute [rw] java_settings - # @return [::Google::Api::JavaSettings] - # Settings for legacy Java features, supported in the Service YAML. - # @!attribute [rw] cpp_settings - # @return [::Google::Api::CppSettings] - # Settings for C++ client libraries. - # @!attribute [rw] php_settings - # @return [::Google::Api::PhpSettings] - # Settings for PHP client libraries. - # @!attribute [rw] python_settings - # @return [::Google::Api::PythonSettings] - # Settings for Python client libraries. - # @!attribute [rw] node_settings - # @return [::Google::Api::NodeSettings] - # Settings for Node client libraries. - # @!attribute [rw] dotnet_settings - # @return [::Google::Api::DotnetSettings] - # Settings for .NET client libraries. - # @!attribute [rw] ruby_settings - # @return [::Google::Api::RubySettings] - # Settings for Ruby client libraries. - # @!attribute [rw] go_settings - # @return [::Google::Api::GoSettings] - # Settings for Go client libraries. - class ClientLibrarySettings - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # This message configures the settings for publishing [Google Cloud Client - # libraries](https://cloud.google.com/apis/docs/cloud-client-libraries) - # generated from the service config. - # @!attribute [rw] method_settings - # @return [::Array<::Google::Api::MethodSettings>] - # A list of API method settings, e.g. the behavior for methods that use the - # long-running operation pattern. - # @!attribute [rw] new_issue_uri - # @return [::String] - # Link to a *public* URI where users can report issues. Example: - # https://issuetracker.google.com/issues/new?component=190865&template=1161103 - # @!attribute [rw] documentation_uri - # @return [::String] - # Link to product home page. Example: - # https://cloud.google.com/asset-inventory/docs/overview - # @!attribute [rw] api_short_name - # @return [::String] - # Used as a tracking tag when collecting data about the APIs developer - # relations artifacts like docs, packages delivered to package managers, - # etc. Example: "speech". - # @!attribute [rw] github_label - # @return [::String] - # GitHub label to apply to issues and pull requests opened for this API. - # @!attribute [rw] codeowner_github_teams - # @return [::Array<::String>] - # GitHub teams to be added to CODEOWNERS in the directory in GitHub - # containing source code for the client libraries for this API. - # @!attribute [rw] doc_tag_prefix - # @return [::String] - # A prefix used in sample code when demarking regions to be included in - # documentation. - # @!attribute [rw] organization - # @return [::Google::Api::ClientLibraryOrganization] - # For whom the client library is being published. - # @!attribute [rw] library_settings - # @return [::Array<::Google::Api::ClientLibrarySettings>] - # Client library settings. If the same version string appears multiple - # times in this list, then the last one wins. Settings from earlier - # settings with the same version string are discarded. - # @!attribute [rw] proto_reference_documentation_uri - # @return [::String] - # Optional link to proto reference documentation. Example: - # https://cloud.google.com/pubsub/lite/docs/reference/rpc - # @!attribute [rw] rest_reference_documentation_uri - # @return [::String] - # Optional link to REST reference documentation. Example: - # https://cloud.google.com/pubsub/lite/docs/reference/rest - class Publishing - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Settings for Java client libraries. - # @!attribute [rw] library_package - # @return [::String] - # The package name to use in Java. Clobbers the java_package option - # set in the protobuf. This should be used **only** by APIs - # who have already set the language_settings.java.package_name" field - # in gapic.yaml. API teams should use the protobuf java_package option - # where possible. - # - # Example of a YAML configuration:: - # - # publishing: - # 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. - # @!attribute [rw] methods - # @return [::Array<::String>] - # An allowlist of the fully qualified names of RPCs that should be included - # on public client surfaces. - # @!attribute [rw] generate_omitted_as_internal - # @return [::Boolean] - # Setting this to true indicates to the client generators that methods - # that would be excluded from the generation should instead be generated - # in a way that indicates these methods should not be consumed by - # end users. How this is expressed is up to individual language - # implementations to decide. Some examples may be: added annotations, - # obfuscated identifiers, or other language idiomatic patterns. - class SelectiveGapicGeneration - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # `BatchingConfigProto` defines the batching configuration for an API method. - # @!attribute [rw] thresholds - # @return [::Google::Api::BatchingSettingsProto] - # The thresholds which trigger a batched request to be sent. - # @!attribute [rw] batch_descriptor - # @return [::Google::Api::BatchingDescriptorProto] - # The request and response fields used in batching. - class BatchingConfigProto - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # `BatchingSettingsProto` specifies a set of batching thresholds, each of - # which acts as a trigger to send a batch of messages as a request. At least - # one threshold must be positive nonzero. - # @!attribute [rw] element_count_threshold - # @return [::Integer] - # The number of elements of a field collected into a batch which, if - # exceeded, causes the batch to be sent. - # @!attribute [rw] request_byte_threshold - # @return [::Integer] - # The aggregated size of the batched field which, if exceeded, causes the - # batch to be sent. This size is computed by aggregating the sizes of the - # request field to be batched, not of the entire request message. - # @!attribute [rw] delay_threshold - # @return [::Google::Protobuf::Duration] - # The duration after which a batch should be sent, starting from the addition - # of the first message to that batch. - # @!attribute [rw] element_count_limit - # @return [::Integer] - # The maximum number of elements collected in a batch that could be accepted - # by server. - # @!attribute [rw] request_byte_limit - # @return [::Integer] - # The maximum size of the request that could be accepted by server. - # @!attribute [rw] flow_control_element_limit - # @return [::Integer] - # The maximum number of elements allowed by flow control. - # @!attribute [rw] flow_control_byte_limit - # @return [::Integer] - # The maximum size of data allowed by flow control. - # @!attribute [rw] flow_control_limit_exceeded_behavior - # @return [::Google::Api::FlowControlLimitExceededBehaviorProto] - # The behavior to take when the flow control limit is exceeded. - class BatchingSettingsProto - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # `BatchingDescriptorProto` specifies the fields of the request message to be - # used for batching, and, optionally, the fields of the response message to be - # used for demultiplexing. - # @!attribute [rw] batched_field - # @return [::String] - # The repeated field in the request message to be aggregated by batching. - # @!attribute [rw] discriminator_fields - # @return [::Array<::String>] - # A list of the fields in the request message. Two requests will be batched - # together only if the values of every field specified in - # `request_discriminator_fields` is equal between the two requests. - # @!attribute [rw] subresponse_field - # @return [::String] - # Optional. When present, indicates the field in the response message to be - # used to demultiplex the response into multiple response messages, in - # correspondence with the multiple request messages originally batched - # together. - class BatchingDescriptorProto - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # The organization for which the client libraries are being published. - # Affects the url where generated docs are published, etc. - module ClientLibraryOrganization - # Not useful. - CLIENT_LIBRARY_ORGANIZATION_UNSPECIFIED = 0 - - # Google Cloud Platform Org. - CLOUD = 1 - - # Ads (Advertising) Org. - ADS = 2 - - # Photos Org. - PHOTOS = 3 - - # Street View Org. - STREET_VIEW = 4 - - # Shopping Org. - SHOPPING = 5 - - # Geo Org. - GEO = 6 - - # Generative AI - https://developers.generativeai.google - GENERATIVE_AI = 7 - end - - # To where should client libraries be published? - module ClientLibraryDestination - # Client libraries will neither be generated nor published to package - # managers. - CLIENT_LIBRARY_DESTINATION_UNSPECIFIED = 0 - - # Generate the client library in a repo under github.com/googleapis, - # but don't publish it to package managers. - GITHUB = 10 - - # Publish the library to package managers like nuget.org and npmjs.com. - PACKAGE_MANAGER = 20 - end - - # The behavior to take when the flow control limit is exceeded. - module FlowControlLimitExceededBehaviorProto - # Default behavior, system-defined. - UNSET_BEHAVIOR = 0 - - # Stop operation, raise error. - THROW_EXCEPTION = 1 - - # Pause operation until limit clears. - BLOCK = 2 - - # Continue operation, disregard limit. - IGNORE = 3 - end - end -end diff --git a/owl-bot-staging/google-cloud-redis-cluster-v1beta1/proto_docs/google/api/field_behavior.rb b/owl-bot-staging/google-cloud-redis-cluster-v1beta1/proto_docs/google/api/field_behavior.rb deleted file mode 100644 index 582be187d115..000000000000 --- a/owl-bot-staging/google-cloud-redis-cluster-v1beta1/proto_docs/google/api/field_behavior.rb +++ /dev/null @@ -1,85 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - - -module Google - module Api - # An indicator of the behavior of a given field (for example, that a field - # is required in requests, or given as output but ignored as input). - # This **does not** change the behavior in protocol buffers itself; it only - # denotes the behavior and may affect how API tooling handles the field. - # - # Note: This enum **may** receive new values in the future. - module FieldBehavior - # Conventional default for enums. Do not use this. - FIELD_BEHAVIOR_UNSPECIFIED = 0 - - # Specifically denotes a field as optional. - # While all fields in protocol buffers are optional, this may be specified - # for emphasis if appropriate. - OPTIONAL = 1 - - # Denotes a field as required. - # This indicates that the field **must** be provided as part of the request, - # and failure to do so will cause an error (usually `INVALID_ARGUMENT`). - REQUIRED = 2 - - # Denotes a field as output only. - # This indicates that the field is provided in responses, but including the - # field in a request does nothing (the server *must* ignore it and - # *must not* throw an error as a result of the field's presence). - OUTPUT_ONLY = 3 - - # Denotes a field as input only. - # This indicates that the field is provided in requests, and the - # corresponding field is not included in output. - INPUT_ONLY = 4 - - # Denotes a field as immutable. - # This indicates that the field may be set once in a request to create a - # resource, but may not be changed thereafter. - IMMUTABLE = 5 - - # Denotes that a (repeated) field is an unordered list. - # This indicates that the service may provide the elements of the list - # in any arbitrary order, rather than the order the user originally - # provided. Additionally, the list's order may or may not be stable. - UNORDERED_LIST = 6 - - # Denotes that this field returns a non-empty default value if not set. - # This indicates that if the user provides the empty value in a request, - # a non-empty value will be returned. The user will not be aware of what - # non-empty value to expect. - NON_EMPTY_DEFAULT = 7 - - # Denotes that the field in a resource (a message annotated with - # google.api.resource) is used in the resource name to uniquely identify the - # resource. For AIP-compliant APIs, this should only be applied to the - # `name` field on the resource. - # - # This behavior should not be applied to references to other resources within - # the message. - # - # The identifier field of resources often have different field behavior - # depending on the request it is embedded in (e.g. for Create methods name - # is optional and unused, while for Update methods it is required). Instead - # of method-specific annotations, only `IDENTIFIER` is required. - IDENTIFIER = 8 - end - end -end diff --git a/owl-bot-staging/google-cloud-redis-cluster-v1beta1/proto_docs/google/api/field_info.rb b/owl-bot-staging/google-cloud-redis-cluster-v1beta1/proto_docs/google/api/field_info.rb deleted file mode 100644 index 0f5acf0a5538..000000000000 --- a/owl-bot-staging/google-cloud-redis-cluster-v1beta1/proto_docs/google/api/field_info.rb +++ /dev/null @@ -1,88 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - - -module Google - module Api - # Rich semantic information of an API field beyond basic typing. - # @!attribute [rw] format - # @return [::Google::Api::FieldInfo::Format] - # The standard format of a field value. This does not explicitly configure - # any API consumer, just documents the API's format for the field it is - # applied to. - # @!attribute [rw] referenced_types - # @return [::Array<::Google::Api::TypeReference>] - # The type(s) that the annotated, generic field may represent. - # - # Currently, this must only be used on fields of type `google.protobuf.Any`. - # Supporting other generic types may be considered in the future. - class FieldInfo - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - - # The standard format of a field value. The supported formats are all backed - # by either an RFC defined by the IETF or a Google-defined AIP. - module Format - # Default, unspecified value. - FORMAT_UNSPECIFIED = 0 - - # Universally Unique Identifier, version 4, value as defined by - # https://datatracker.ietf.org/doc/html/rfc4122. The value may be - # normalized to entirely lowercase letters. For example, the value - # `F47AC10B-58CC-0372-8567-0E02B2C3D479` would be normalized to - # `f47ac10b-58cc-0372-8567-0e02b2c3d479`. - UUID4 = 1 - - # Internet Protocol v4 value as defined by [RFC - # 791](https://datatracker.ietf.org/doc/html/rfc791). The value may be - # condensed, with leading zeros in each octet stripped. For example, - # `001.022.233.040` would be condensed to `1.22.233.40`. - IPV4 = 2 - - # Internet Protocol v6 value as defined by [RFC - # 2460](https://datatracker.ietf.org/doc/html/rfc2460). The value may be - # normalized to entirely lowercase letters with zeros compressed, following - # [RFC 5952](https://datatracker.ietf.org/doc/html/rfc5952). For example, - # the value `2001:0DB8:0::0` would be normalized to `2001:db8::`. - IPV6 = 3 - - # An IP address in either v4 or v6 format as described by the individual - # values defined herein. See the comments on the IPV4 and IPV6 types for - # allowed normalizations of each. - IPV4_OR_IPV6 = 4 - end - end - - # A reference to a message type, for use in {::Google::Api::FieldInfo FieldInfo}. - # @!attribute [rw] type_name - # @return [::String] - # The name of the type that the annotated, generic field may represent. - # If the type is in the same protobuf package, the value can be the simple - # message name e.g., `"MyMessage"`. Otherwise, the value must be the - # fully-qualified message name e.g., `"google.library.v1.Book"`. - # - # If the type(s) are unknown to the service (e.g. the field accepts generic - # user input), use the wildcard `"*"` to denote this behavior. - # - # See [AIP-202](https://google.aip.dev/202#type-references) for more details. - class TypeReference - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - end -end diff --git a/owl-bot-staging/google-cloud-redis-cluster-v1beta1/proto_docs/google/api/launch_stage.rb b/owl-bot-staging/google-cloud-redis-cluster-v1beta1/proto_docs/google/api/launch_stage.rb deleted file mode 100644 index 9392a413fb1b..000000000000 --- a/owl-bot-staging/google-cloud-redis-cluster-v1beta1/proto_docs/google/api/launch_stage.rb +++ /dev/null @@ -1,71 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - - -module Google - module Api - # The launch stage as defined by [Google Cloud Platform - # Launch Stages](https://cloud.google.com/terms/launch-stages). - module LaunchStage - # Do not use this default value. - LAUNCH_STAGE_UNSPECIFIED = 0 - - # The feature is not yet implemented. Users can not use it. - UNIMPLEMENTED = 6 - - # Prelaunch features are hidden from users and are only visible internally. - PRELAUNCH = 7 - - # Early Access features are limited to a closed group of testers. To use - # these features, you must sign up in advance and sign a Trusted Tester - # agreement (which includes confidentiality provisions). These features may - # be unstable, changed in backward-incompatible ways, and are not - # guaranteed to be released. - EARLY_ACCESS = 1 - - # Alpha is a limited availability test for releases before they are cleared - # for widespread use. By Alpha, all significant design issues are resolved - # and we are in the process of verifying functionality. Alpha customers - # need to apply for access, agree to applicable terms, and have their - # projects allowlisted. Alpha releases don't have to be feature complete, - # no SLAs are provided, and there are no technical support obligations, but - # they will be far enough along that customers can actually use them in - # test environments or for limited-use tests -- just like they would in - # normal production cases. - ALPHA = 2 - - # Beta is the point at which we are ready to open a release for any - # customer to use. There are no SLA or technical support obligations in a - # Beta release. Products will be complete from a feature perspective, but - # may have some open outstanding issues. Beta releases are suitable for - # limited production use cases. - BETA = 3 - - # GA features are open to all developers and are considered stable and - # fully qualified for production use. - GA = 4 - - # Deprecated features are scheduled to be shut down and removed. For more - # information, see the "Deprecation Policy" section of our [Terms of - # Service](https://cloud.google.com/terms/) - # and the [Google Cloud Platform Subject to the Deprecation - # Policy](https://cloud.google.com/terms/deprecation) documentation. - DEPRECATED = 5 - end - end -end diff --git a/owl-bot-staging/google-cloud-redis-cluster-v1beta1/proto_docs/google/api/resource.rb b/owl-bot-staging/google-cloud-redis-cluster-v1beta1/proto_docs/google/api/resource.rb deleted file mode 100644 index 25dec4847ac1..000000000000 --- a/owl-bot-staging/google-cloud-redis-cluster-v1beta1/proto_docs/google/api/resource.rb +++ /dev/null @@ -1,227 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - - -module Google - module Api - # A simple descriptor of a resource type. - # - # ResourceDescriptor annotates a resource message (either by means of a - # protobuf annotation or use in the service config), and associates the - # resource's schema, the resource type, and the pattern of the resource name. - # - # Example: - # - # message Topic { - # // Indicates this message defines a resource schema. - # // Declares the resource type in the format of {service}/{kind}. - # // For Kubernetes resources, the format is {api group}/{kind}. - # option (google.api.resource) = { - # type: "pubsub.googleapis.com/Topic" - # pattern: "projects/{project}/topics/{topic}" - # }; - # } - # - # The ResourceDescriptor Yaml config will look like: - # - # resources: - # - type: "pubsub.googleapis.com/Topic" - # pattern: "projects/{project}/topics/{topic}" - # - # Sometimes, resources have multiple patterns, typically because they can - # live under multiple parents. - # - # Example: - # - # message LogEntry { - # option (google.api.resource) = { - # type: "logging.googleapis.com/LogEntry" - # pattern: "projects/{project}/logs/{log}" - # pattern: "folders/{folder}/logs/{log}" - # pattern: "organizations/{organization}/logs/{log}" - # pattern: "billingAccounts/{billing_account}/logs/{log}" - # }; - # } - # - # The ResourceDescriptor Yaml config will look like: - # - # resources: - # - type: 'logging.googleapis.com/LogEntry' - # pattern: "projects/{project}/logs/{log}" - # pattern: "folders/{folder}/logs/{log}" - # pattern: "organizations/{organization}/logs/{log}" - # pattern: "billingAccounts/{billing_account}/logs/{log}" - # @!attribute [rw] type - # @return [::String] - # The resource type. It must be in the format of - # \\{service_name}/\\{resource_type_kind}. The `resource_type_kind` must be - # singular and must not include version numbers. - # - # Example: `storage.googleapis.com/Bucket` - # - # The value of the resource_type_kind must follow the regular expression - # /[A-Za-z][a-zA-Z0-9]+/. It should start with an upper case character and - # should use PascalCase (UpperCamelCase). The maximum number of - # characters allowed for the `resource_type_kind` is 100. - # @!attribute [rw] pattern - # @return [::Array<::String>] - # Optional. The relative resource name pattern associated with this resource - # type. The DNS prefix of the full resource name shouldn't be specified here. - # - # The path pattern must follow the syntax, which aligns with HTTP binding - # syntax: - # - # Template = Segment { "/" Segment } ; - # Segment = LITERAL | Variable ; - # Variable = "{" LITERAL "}" ; - # - # Examples: - # - # - "projects/\\{project}/topics/\\{topic}" - # - "projects/\\{project}/knowledgeBases/\\{knowledge_base}" - # - # The components in braces correspond to the IDs for each resource in the - # hierarchy. It is expected that, if multiple patterns are provided, - # the same component name (e.g. "project") refers to IDs of the same - # type of resource. - # @!attribute [rw] name_field - # @return [::String] - # Optional. The field on the resource that designates the resource name - # field. If omitted, this is assumed to be "name". - # @!attribute [rw] history - # @return [::Google::Api::ResourceDescriptor::History] - # Optional. The historical or future-looking state of the resource pattern. - # - # Example: - # - # // The InspectTemplate message originally only supported resource - # // names with organization, and project was added later. - # message InspectTemplate { - # option (google.api.resource) = { - # type: "dlp.googleapis.com/InspectTemplate" - # pattern: - # "organizations/{organization}/inspectTemplates/{inspect_template}" - # pattern: "projects/{project}/inspectTemplates/{inspect_template}" - # history: ORIGINALLY_SINGLE_PATTERN - # }; - # } - # @!attribute [rw] plural - # @return [::String] - # The plural name used in the resource name and permission names, such as - # 'projects' for the resource name of 'projects/\\{project}' and the permission - # name of 'cloudresourcemanager.googleapis.com/projects.get'. One exception - # to this is for Nested Collections that have stuttering names, as defined - # in [AIP-122](https://google.aip.dev/122#nested-collections), where the - # collection ID in the resource name pattern does not necessarily directly - # match the `plural` value. - # - # It is the same concept of the `plural` field in k8s CRD spec - # https://kubernetes.io/docs/tasks/access-kubernetes-api/custom-resources/custom-resource-definitions/ - # - # Note: The plural form is required even for singleton resources. See - # https://aip.dev/156 - # @!attribute [rw] singular - # @return [::String] - # The same concept of the `singular` field in k8s CRD spec - # https://kubernetes.io/docs/tasks/access-kubernetes-api/custom-resources/custom-resource-definitions/ - # Such as "project" for the `resourcemanager.googleapis.com/Project` type. - # @!attribute [rw] style - # @return [::Array<::Google::Api::ResourceDescriptor::Style>] - # Style flag(s) for this resource. - # These indicate that a resource is expected to conform to a given - # style. See the specific style flags for additional information. - class ResourceDescriptor - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - - # A description of the historical or future-looking state of the - # resource pattern. - module History - # The "unset" value. - HISTORY_UNSPECIFIED = 0 - - # The resource originally had one pattern and launched as such, and - # additional patterns were added later. - ORIGINALLY_SINGLE_PATTERN = 1 - - # The resource has one pattern, but the API owner expects to add more - # later. (This is the inverse of ORIGINALLY_SINGLE_PATTERN, and prevents - # that from being necessary once there are multiple patterns.) - FUTURE_MULTI_PATTERN = 2 - end - - # A flag representing a specific style that a resource claims to conform to. - module Style - # The unspecified value. Do not use. - STYLE_UNSPECIFIED = 0 - - # This resource is intended to be "declarative-friendly". - # - # Declarative-friendly resources must be more strictly consistent, and - # setting this to true communicates to tools that this resource should - # adhere to declarative-friendly expectations. - # - # Note: This is used by the API linter (linter.aip.dev) to enable - # additional checks. - DECLARATIVE_FRIENDLY = 1 - end - end - - # Defines a proto annotation that describes a string field that refers to - # an API resource. - # @!attribute [rw] type - # @return [::String] - # The resource type that the annotated field references. - # - # Example: - # - # message Subscription { - # string topic = 2 [(google.api.resource_reference) = { - # type: "pubsub.googleapis.com/Topic" - # }]; - # } - # - # Occasionally, a field may reference an arbitrary resource. In this case, - # APIs use the special value * in their resource reference. - # - # Example: - # - # message GetIamPolicyRequest { - # string resource = 2 [(google.api.resource_reference) = { - # type: "*" - # }]; - # } - # @!attribute [rw] child_type - # @return [::String] - # The resource type of a child collection that the annotated field - # references. This is useful for annotating the `parent` field that - # doesn't have a fixed resource type. - # - # Example: - # - # message ListLogEntriesRequest { - # string parent = 1 [(google.api.resource_reference) = { - # child_type: "logging.googleapis.com/LogEntry" - # }; - # } - class ResourceReference - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - end -end diff --git a/owl-bot-staging/google-cloud-redis-cluster-v1beta1/proto_docs/google/cloud/redis/cluster/v1beta1/cloud_redis_cluster.rb b/owl-bot-staging/google-cloud-redis-cluster-v1beta1/proto_docs/google/cloud/redis/cluster/v1beta1/cloud_redis_cluster.rb deleted file mode 100644 index 1a25774de845..000000000000 --- a/owl-bot-staging/google-cloud-redis-cluster-v1beta1/proto_docs/google/cloud/redis/cluster/v1beta1/cloud_redis_cluster.rb +++ /dev/null @@ -1,1301 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - - -module Google - module Cloud - module Redis - module Cluster - module V1beta1 - # Request for [CreateCluster][CloudRedis.CreateCluster]. - # @!attribute [rw] parent - # @return [::String] - # Required. The resource name of the cluster location using the form: - # `projects/{project_id}/locations/{location_id}` - # where `location_id` refers to a GCP region. - # @!attribute [rw] cluster_id - # @return [::String] - # Required. The logical name of the Redis cluster in the customer project - # with the following restrictions: - # - # * Must contain only lowercase letters, numbers, and hyphens. - # * Must start with a letter. - # * Must be between 1-63 characters. - # * Must end with a number or a letter. - # * Must be unique within the customer project / location - # @!attribute [rw] cluster - # @return [::Google::Cloud::Redis::Cluster::V1beta1::Cluster] - # Required. The cluster that is to be created. - # @!attribute [rw] request_id - # @return [::String] - # Idempotent request UUID. - class CreateClusterRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Request for [ListClusters][CloudRedis.ListClusters]. - # @!attribute [rw] parent - # @return [::String] - # Required. The resource name of the cluster location using the form: - # `projects/{project_id}/locations/{location_id}` - # where `location_id` refers to a GCP region. - # @!attribute [rw] page_size - # @return [::Integer] - # The maximum number of items to return. - # - # If not specified, a default value of 1000 will be used by the service. - # Regardless of the page_size value, the response may include a partial list - # and a caller should only rely on response's - # {::Google::Cloud::Redis::Cluster::V1beta1::ListClustersResponse#next_page_token `next_page_token`} - # to determine if there are more clusters left to be queried. - # @!attribute [rw] page_token - # @return [::String] - # The `next_page_token` value returned from a previous - # [ListClusters][CloudRedis.ListClusters] request, if any. - class ListClustersRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Response for [ListClusters][CloudRedis.ListClusters]. - # @!attribute [rw] clusters - # @return [::Array<::Google::Cloud::Redis::Cluster::V1beta1::Cluster>] - # A list of Redis clusters in the project in the specified location, - # or across all locations. - # - # If the `location_id` in the parent field of the request is "-", all regions - # available to the project are queried, and the results aggregated. - # If in such an aggregated query a location is unavailable, a placeholder - # Redis entry is included in the response with the `name` field set to a - # value of the form - # `projects/{project_id}/locations/{location_id}/clusters/`- and the - # `status` field set to ERROR and `status_message` field set to "location not - # available for ListClusters". - # @!attribute [rw] next_page_token - # @return [::String] - # Token to retrieve the next page of results, or empty if there are no more - # results in the list. - # @!attribute [rw] unreachable - # @return [::Array<::String>] - # Locations that could not be reached. - class ListClustersResponse - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Request for [UpdateCluster][CloudRedis.UpdateCluster]. - # @!attribute [rw] update_mask - # @return [::Google::Protobuf::FieldMask] - # Required. Mask of fields to update. At least one path must be supplied in - # this field. The elements of the repeated paths field may only include these - # fields from {::Google::Cloud::Redis::Cluster::V1beta1::Cluster Cluster}: - # - # * `size_gb` - # * `replica_count` - # @!attribute [rw] cluster - # @return [::Google::Cloud::Redis::Cluster::V1beta1::Cluster] - # Required. Update description. - # Only fields specified in update_mask are updated. - # @!attribute [rw] request_id - # @return [::String] - # Idempotent request UUID. - class UpdateClusterRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Request for [GetCluster][CloudRedis.GetCluster]. - # @!attribute [rw] name - # @return [::String] - # Required. Redis cluster resource name using the form: - # `projects/{project_id}/locations/{location_id}/clusters/{cluster_id}` - # where `location_id` refers to a GCP region. - class GetClusterRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Request for [DeleteCluster][CloudRedis.DeleteCluster]. - # @!attribute [rw] name - # @return [::String] - # Required. Redis cluster resource name using the form: - # `projects/{project_id}/locations/{location_id}/clusters/{cluster_id}` - # where `location_id` refers to a GCP region. - # @!attribute [rw] request_id - # @return [::String] - # Idempotent request UUID. - class DeleteClusterRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Request for - # [GetClusterCertificateAuthorityRequest][CloudRedis.GetClusterCertificateAuthorityRequest]. - # @!attribute [rw] name - # @return [::String] - # Required. Redis cluster certificate authority resource name using the form: - # `projects/{project_id}/locations/{location_id}/clusters/{cluster_id}/certificateAuthority` - # where `location_id` refers to a GCP region. - class GetClusterCertificateAuthorityRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Request for [ListBackupCollections] - # @!attribute [rw] parent - # @return [::String] - # Required. The resource name of the backupCollection location using the - # form: - # `projects/{project_id}/locations/{location_id}` - # where `location_id` refers to a GCP region. - # @!attribute [rw] page_size - # @return [::Integer] - # Optional. The maximum number of items to return. - # - # If not specified, a default value of 1000 will be used by the service. - # Regardless of the page_size value, the response may include a partial list - # and a caller should only rely on response's - # {::Google::Cloud::Redis::Cluster::V1beta1::ListBackupCollectionsResponse#next_page_token `next_page_token`} - # to determine if there are more clusters left to be queried. - # @!attribute [rw] page_token - # @return [::String] - # Optional. The `next_page_token` value returned from a previous - # [ListBackupCollections] request, if any. - class ListBackupCollectionsRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Response for [ListBackupCollections]. - # @!attribute [rw] backup_collections - # @return [::Array<::Google::Cloud::Redis::Cluster::V1beta1::BackupCollection>] - # A list of backupCollections in the project. - # - # If the `location_id` in the parent field of the request is "-", all regions - # available to the project are queried, and the results aggregated. - # If in such an aggregated query a location is unavailable, a placeholder - # backupCollection entry is included in the response with the `name` field - # set to a value of the form - # `projects/{project_id}/locations/{location_id}/backupCollections/`- and the - # `status` field set to ERROR and `status_message` field set to "location not - # available for ListBackupCollections". - # @!attribute [rw] next_page_token - # @return [::String] - # Token to retrieve the next page of results, or empty if there are no more - # results in the list. - # @!attribute [rw] unreachable - # @return [::Array<::String>] - # Locations that could not be reached. - class ListBackupCollectionsResponse - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Request for [GetBackupCollection]. - # @!attribute [rw] name - # @return [::String] - # Required. Redis backupCollection resource name using the form: - # `projects/{project_id}/locations/{location_id}/backupCollections/{backup_collection_id}` - # where `location_id` refers to a GCP region. - class GetBackupCollectionRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Request for [ListBackups]. - # @!attribute [rw] parent - # @return [::String] - # Required. The resource name of the backupCollection using the form: - # `projects/{project_id}/locations/{location_id}/backupCollections/{backup_collection_id}` - # @!attribute [rw] page_size - # @return [::Integer] - # Optional. The maximum number of items to return. - # - # If not specified, a default value of 1000 will be used by the service. - # Regardless of the page_size value, the response may include a partial list - # and a caller should only rely on response's - # {::Google::Cloud::Redis::Cluster::V1beta1::ListBackupsResponse#next_page_token `next_page_token`} - # to determine if there are more clusters left to be queried. - # @!attribute [rw] page_token - # @return [::String] - # Optional. The `next_page_token` value returned from a previous - # [ListBackupCollections] request, if any. - class ListBackupsRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Response for [ListBackups]. - # @!attribute [rw] backups - # @return [::Array<::Google::Cloud::Redis::Cluster::V1beta1::Backup>] - # A list of backups in the project. - # @!attribute [rw] next_page_token - # @return [::String] - # Token to retrieve the next page of results, or empty if there are no more - # results in the list. - # @!attribute [rw] unreachable - # @return [::Array<::String>] - # Backups that could not be reached. - class ListBackupsResponse - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Request for [GetBackup]. - # @!attribute [rw] name - # @return [::String] - # Required. Redis backup resource name using the form: - # `projects/{project_id}/locations/{location_id}/backupCollections/{backup_collection_id}/backups/{backup_id}` - class GetBackupRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Request for [DeleteBackup]. - # @!attribute [rw] name - # @return [::String] - # Required. Redis backup resource name using the form: - # `projects/{project_id}/locations/{location_id}/backupCollections/{backup_collection_id}/backups/{backup_id}` - # @!attribute [rw] request_id - # @return [::String] - # Optional. Idempotent request UUID. - class DeleteBackupRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Request for [ExportBackup]. - # @!attribute [rw] gcs_bucket - # @return [::String] - # Google Cloud Storage bucket, like "my-bucket". - # @!attribute [rw] name - # @return [::String] - # Required. Redis backup resource name using the form: - # `projects/{project_id}/locations/{location_id}/backupCollections/{backup_collection_id}/backups/{backup_id}` - class ExportBackupRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Request for [BackupCluster]. - # @!attribute [rw] name - # @return [::String] - # Required. Redis cluster resource name using the form: - # `projects/{project_id}/locations/{location_id}/clusters/{cluster_id}` - # where `location_id` refers to a GCP region. - # @!attribute [rw] ttl - # @return [::Google::Protobuf::Duration] - # Optional. TTL for the backup to expire. Value range is 1 day to 100 years. - # If not specified, the default value is 100 years. - # @!attribute [rw] backup_id - # @return [::String] - # Optional. The id of the backup to be created. If not specified, the - # default value ([YYYYMMDDHHMMSS]_[Shortened Cluster UID] is used. - class BackupClusterRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # A cluster instance. - # @!attribute [rw] gcs_source - # @return [::Google::Cloud::Redis::Cluster::V1beta1::Cluster::GcsBackupSource] - # Optional. Backups stored in Cloud Storage buckets. - # The Cloud Storage buckets need to be the same region as the clusters. - # Read permission is required to import from the provided Cloud Storage - # objects. - # - # Note: The following fields are mutually exclusive: `gcs_source`, `managed_backup_source`. If a field in that set is populated, all other fields in the set will automatically be cleared. - # @!attribute [rw] managed_backup_source - # @return [::Google::Cloud::Redis::Cluster::V1beta1::Cluster::ManagedBackupSource] - # Optional. Backups generated and managed by memorystore service. - # - # Note: The following fields are mutually exclusive: `managed_backup_source`, `gcs_source`. If a field in that set is populated, all other fields in the set will automatically be cleared. - # @!attribute [rw] name - # @return [::String] - # Required. Identifier. Unique name of the resource in this scope including - # project and location using the form: - # `projects/{project_id}/locations/{location_id}/clusters/{cluster_id}` - # @!attribute [r] create_time - # @return [::Google::Protobuf::Timestamp] - # Output only. The timestamp associated with the cluster creation request. - # @!attribute [r] state - # @return [::Google::Cloud::Redis::Cluster::V1beta1::Cluster::State] - # Output only. The current state of this cluster. - # Can be CREATING, READY, UPDATING, DELETING and SUSPENDED - # @!attribute [r] uid - # @return [::String] - # Output only. System assigned, unique identifier for the cluster. - # @!attribute [rw] replica_count - # @return [::Integer] - # Optional. The number of replica nodes per shard. - # @!attribute [rw] authorization_mode - # @return [::Google::Cloud::Redis::Cluster::V1beta1::AuthorizationMode] - # Optional. The authorization mode of the Redis cluster. - # If not provided, auth feature is disabled for the cluster. - # @!attribute [rw] transit_encryption_mode - # @return [::Google::Cloud::Redis::Cluster::V1beta1::TransitEncryptionMode] - # Optional. The in-transit encryption for the Redis cluster. - # If not provided, encryption is disabled for the cluster. - # @!attribute [r] size_gb - # @return [::Integer] - # Output only. Redis memory size in GB for the entire cluster rounded up to - # the next integer. - # @!attribute [rw] shard_count - # @return [::Integer] - # Optional. Number of shards for the Redis cluster. - # @!attribute [rw] psc_configs - # @return [::Array<::Google::Cloud::Redis::Cluster::V1beta1::PscConfig>] - # Optional. Each PscConfig configures the consumer network where IPs will - # be designated to the cluster for client access through Private Service - # Connect Automation. Currently, only one PscConfig is supported. - # @!attribute [r] discovery_endpoints - # @return [::Array<::Google::Cloud::Redis::Cluster::V1beta1::DiscoveryEndpoint>] - # Output only. Endpoints created on each given network, for Redis clients to - # connect to the cluster. Currently only one discovery endpoint is supported. - # @!attribute [r] psc_connections - # @return [::Array<::Google::Cloud::Redis::Cluster::V1beta1::PscConnection>] - # Output only. The list of PSC connections that are auto-created through - # service connectivity automation. - # @!attribute [r] state_info - # @return [::Google::Cloud::Redis::Cluster::V1beta1::Cluster::StateInfo] - # Output only. Additional information about the current state of the cluster. - # @!attribute [rw] node_type - # @return [::Google::Cloud::Redis::Cluster::V1beta1::NodeType] - # Optional. The type of a redis node in the cluster. NodeType determines the - # underlying machine-type of a redis node. - # @!attribute [rw] persistence_config - # @return [::Google::Cloud::Redis::Cluster::V1beta1::ClusterPersistenceConfig] - # Optional. Persistence config (RDB, AOF) for the cluster. - # @!attribute [rw] redis_configs - # @return [::Google::Protobuf::Map{::String => ::String}] - # Optional. Key/Value pairs of customer overrides for mutable Redis Configs - # @!attribute [r] precise_size_gb - # @return [::Float] - # Output only. Precise value of redis memory size in GB for the entire - # cluster. - # @!attribute [rw] zone_distribution_config - # @return [::Google::Cloud::Redis::Cluster::V1beta1::ZoneDistributionConfig] - # Optional. This config will be used to determine how the customer wants us - # to distribute cluster resources within the region. - # @!attribute [rw] cross_cluster_replication_config - # @return [::Google::Cloud::Redis::Cluster::V1beta1::CrossClusterReplicationConfig] - # Optional. Cross cluster replication config. - # @!attribute [rw] deletion_protection_enabled - # @return [::Boolean] - # Optional. The delete operation will fail when the value is set to true. - # @!attribute [rw] maintenance_policy - # @return [::Google::Cloud::Redis::Cluster::V1beta1::ClusterMaintenancePolicy] - # Optional. ClusterMaintenancePolicy determines when to allow or deny - # updates. - # @!attribute [r] maintenance_schedule - # @return [::Google::Cloud::Redis::Cluster::V1beta1::ClusterMaintenanceSchedule] - # Output only. ClusterMaintenanceSchedule Output only Published maintenance - # schedule. - # @!attribute [r] psc_service_attachments - # @return [::Array<::Google::Cloud::Redis::Cluster::V1beta1::PscServiceAttachment>] - # Output only. Service attachment details to configure Psc connections - # @!attribute [rw] cluster_endpoints - # @return [::Array<::Google::Cloud::Redis::Cluster::V1beta1::ClusterEndpoint>] - # Optional. A list of cluster enpoints. - # @!attribute [r] backup_collection - # @return [::String] - # Optional. Output only. The backup collection full resource name. Example: - # projects/\\{project}/locations/\\{location}/backupCollections/\\{collection} - # @!attribute [rw] kms_key - # @return [::String] - # Optional. The KMS key used to encrypt the at-rest data of the cluster. - # @!attribute [rw] automated_backup_config - # @return [::Google::Cloud::Redis::Cluster::V1beta1::AutomatedBackupConfig] - # Optional. The automated backup config for the cluster. - # @!attribute [r] encryption_info - # @return [::Google::Cloud::Redis::Cluster::V1beta1::EncryptionInfo] - # Output only. Encryption information of the data at rest of the cluster. - class Cluster - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - - # Represents additional information about the state of the cluster. - # @!attribute [rw] update_info - # @return [::Google::Cloud::Redis::Cluster::V1beta1::Cluster::StateInfo::UpdateInfo] - # Describes ongoing update on the cluster when cluster state is UPDATING. - class StateInfo - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - - # Represents information about an updating cluster. - # @!attribute [rw] target_shard_count - # @return [::Integer] - # Target number of shards for redis cluster - # @!attribute [rw] target_replica_count - # @return [::Integer] - # Target number of replica nodes per shard. - class UpdateInfo - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - end - - # Backups stored in Cloud Storage buckets. - # The Cloud Storage buckets need to be the same region as the clusters. - # @!attribute [rw] uris - # @return [::Array<::String>] - # Optional. URIs of the GCS objects to import. - # Example: gs://bucket1/object1, gs://bucket2/folder2/object2 - class GcsBackupSource - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Backups that generated and managed by memorystore. - # @!attribute [rw] backup - # @return [::String] - # Optional. Example: - # //redis.googleapis.com/projects/\\{project}/locations/\\{location}/backupCollections/\\{collection}/backups/\\{backup} - # A shorter version (without the prefix) of the backup name is also - # supported, like - # projects/\\{project}/locations/\\{location}/backupCollections/\\{collection}/backups/\\{backup_id} - # In this case, it assumes the backup is under redis.googleapis.com. - class ManagedBackupSource - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # @!attribute [rw] key - # @return [::String] - # @!attribute [rw] value - # @return [::String] - class RedisConfigsEntry - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Represents the different states of a Redis cluster. - module State - # Not set. - STATE_UNSPECIFIED = 0 - - # Redis cluster is being created. - CREATING = 1 - - # Redis cluster has been created and is fully usable. - ACTIVE = 2 - - # Redis cluster configuration is being updated. - UPDATING = 3 - - # Redis cluster is being deleted. - DELETING = 4 - end - end - - # The automated backup config for a cluster. - # @!attribute [rw] fixed_frequency_schedule - # @return [::Google::Cloud::Redis::Cluster::V1beta1::AutomatedBackupConfig::FixedFrequencySchedule] - # Optional. Trigger automated backups at a fixed frequency. - # @!attribute [rw] automated_backup_mode - # @return [::Google::Cloud::Redis::Cluster::V1beta1::AutomatedBackupConfig::AutomatedBackupMode] - # Optional. The automated backup mode. If the mode is disabled, the other - # fields will be ignored. - # @!attribute [rw] retention - # @return [::Google::Protobuf::Duration] - # Optional. How long to keep automated backups before the backups are - # deleted. The value should be between 1 day and 365 days. If not specified, - # the default value is 35 days. - class AutomatedBackupConfig - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - - # This schedule allows the backup to be triggered at a fixed frequency - # (currently only daily is supported). - # @!attribute [rw] start_time - # @return [::Google::Type::TimeOfDay] - # Required. The start time of every automated backup in UTC. It must be set - # to the start of an hour. This field is required. - class FixedFrequencySchedule - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # The automated backup mode. - module AutomatedBackupMode - # Default value. Automated backup config is not specified. - AUTOMATED_BACKUP_MODE_UNSPECIFIED = 0 - - # Automated backup config disabled. - DISABLED = 1 - - # Automated backup config enabled. - ENABLED = 2 - end - end - - # BackupCollection of a cluster. - # @!attribute [rw] name - # @return [::String] - # Identifier. Full resource path of the backup collection. - # @!attribute [r] cluster_uid - # @return [::String] - # Output only. The cluster uid of the backup collection. - # @!attribute [r] cluster - # @return [::String] - # Output only. The full resource path of the cluster the backup collection - # belongs to. Example: - # projects/\\{project}/locations/\\{location}/clusters/\\{cluster} - # @!attribute [r] kms_key - # @return [::String] - # Output only. The KMS key used to encrypt the backups under this backup - # collection. - # @!attribute [r] uid - # @return [::String] - # Output only. System assigned unique identifier of the backup collection. - class BackupCollection - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Backup of a cluster. - # @!attribute [rw] name - # @return [::String] - # Identifier. Full resource path of the backup. the last part of the name is - # the backup id with the following format: [YYYYMMDDHHMMSS]_[Shorted Cluster - # UID] OR customer specified while backup cluster. Example: - # 20240515123000_1234 - # @!attribute [r] create_time - # @return [::Google::Protobuf::Timestamp] - # Output only. The time when the backup was created. - # @!attribute [r] cluster - # @return [::String] - # Output only. Cluster resource path of this backup. - # @!attribute [r] cluster_uid - # @return [::String] - # Output only. Cluster uid of this backup. - # @!attribute [r] total_size_bytes - # @return [::Integer] - # Output only. Total size of the backup in bytes. - # @!attribute [r] expire_time - # @return [::Google::Protobuf::Timestamp] - # Output only. The time when the backup will expire. - # @!attribute [r] engine_version - # @return [::String] - # Output only. redis-7.2, valkey-7.5 - # @!attribute [r] backup_files - # @return [::Array<::Google::Cloud::Redis::Cluster::V1beta1::BackupFile>] - # Output only. List of backup files of the backup. - # @!attribute [r] node_type - # @return [::Google::Cloud::Redis::Cluster::V1beta1::NodeType] - # Output only. Node type of the cluster. - # @!attribute [r] replica_count - # @return [::Integer] - # Output only. Number of replicas for the cluster. - # @!attribute [r] shard_count - # @return [::Integer] - # Output only. Number of shards for the cluster. - # @!attribute [r] backup_type - # @return [::Google::Cloud::Redis::Cluster::V1beta1::Backup::BackupType] - # Output only. Type of the backup. - # @!attribute [r] state - # @return [::Google::Cloud::Redis::Cluster::V1beta1::Backup::State] - # Output only. State of the backup. - # @!attribute [r] encryption_info - # @return [::Google::Cloud::Redis::Cluster::V1beta1::EncryptionInfo] - # Output only. Encryption information of the backup. - # @!attribute [r] uid - # @return [::String] - # Output only. System assigned unique identifier of the backup. - class Backup - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - - # Type of the backup. - module BackupType - # The default value, not set. - BACKUP_TYPE_UNSPECIFIED = 0 - - # On-demand backup. - ON_DEMAND = 1 - - # Automated backup. - AUTOMATED = 2 - end - - # State of the backup. - module State - # The default value, not set. - STATE_UNSPECIFIED = 0 - - # The backup is being created. - CREATING = 1 - - # The backup is active to be used. - ACTIVE = 2 - - # The backup is being deleted. - DELETING = 3 - - # The backup is currently suspended due to reasons like project deletion, - # billing account closure, etc. - SUSPENDED = 4 - end - end - - # Backup is consisted of multiple backup files. - # @!attribute [r] file_name - # @return [::String] - # Output only. e.g: .rdb - # @!attribute [r] size_bytes - # @return [::Integer] - # Output only. Size of the backup file in bytes. - # @!attribute [r] create_time - # @return [::Google::Protobuf::Timestamp] - # Output only. The time when the backup file was created. - class BackupFile - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Configuration of a service attachment of the cluster, for creating PSC - # connections. - # @!attribute [r] service_attachment - # @return [::String] - # Output only. Service attachment URI which your self-created PscConnection - # should use as target - # @!attribute [r] connection_type - # @return [::Google::Cloud::Redis::Cluster::V1beta1::ConnectionType] - # Output only. Type of a PSC connection targeting this service attachment. - class PscServiceAttachment - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Cross cluster replication config. - # @!attribute [rw] cluster_role - # @return [::Google::Cloud::Redis::Cluster::V1beta1::CrossClusterReplicationConfig::ClusterRole] - # The role of the cluster in cross cluster replication. - # @!attribute [rw] primary_cluster - # @return [::Google::Cloud::Redis::Cluster::V1beta1::CrossClusterReplicationConfig::RemoteCluster] - # Details of the primary cluster that is used as the replication source for - # this secondary cluster. - # - # This field is only set for a secondary cluster. - # @!attribute [rw] secondary_clusters - # @return [::Array<::Google::Cloud::Redis::Cluster::V1beta1::CrossClusterReplicationConfig::RemoteCluster>] - # List of secondary clusters that are replicating from this primary cluster. - # - # This field is only set for a primary cluster. - # @!attribute [r] update_time - # @return [::Google::Protobuf::Timestamp] - # Output only. The last time cross cluster replication config was updated. - # @!attribute [r] membership - # @return [::Google::Cloud::Redis::Cluster::V1beta1::CrossClusterReplicationConfig::Membership] - # Output only. An output only view of all the member clusters participating - # in the cross cluster replication. This view will be provided by every - # member cluster irrespective of its cluster role(primary or secondary). - # - # A primary cluster can provide information about all the secondary clusters - # replicating from it. However, a secondary cluster only knows about the - # primary cluster from which it is replicating. However, for scenarios, where - # the primary cluster is unavailable(e.g. regional outage), a GetCluster - # request can be sent to any other member cluster and this field will list - # all the member clusters participating in cross cluster replication. - class CrossClusterReplicationConfig - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - - # Details of the remote cluster associated with this cluster in a cross - # cluster replication setup. - # @!attribute [rw] cluster - # @return [::String] - # The full resource path of the remote cluster in - # the format: projects//locations//clusters/ - # @!attribute [r] uid - # @return [::String] - # Output only. The unique identifier of the remote cluster. - class RemoteCluster - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # An output only view of all the member clusters participating in the cross - # cluster replication. - # @!attribute [r] primary_cluster - # @return [::Google::Cloud::Redis::Cluster::V1beta1::CrossClusterReplicationConfig::RemoteCluster] - # Output only. The primary cluster that acts as the source of replication - # for the secondary clusters. - # @!attribute [r] secondary_clusters - # @return [::Array<::Google::Cloud::Redis::Cluster::V1beta1::CrossClusterReplicationConfig::RemoteCluster>] - # Output only. The list of secondary clusters replicating from the primary - # cluster. - class Membership - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # The role of the cluster in cross cluster replication. - module ClusterRole - # Cluster role is not set. - # The behavior is equivalent to NONE. - CLUSTER_ROLE_UNSPECIFIED = 0 - - # This cluster does not participate in cross cluster replication. It is an - # independent cluster and does not replicate to or from any other clusters. - NONE = 1 - - # A cluster that allows both reads and writes. Any data written to this - # cluster is also replicated to the attached secondary clusters. - PRIMARY = 2 - - # A cluster that allows only reads and replicates data from a primary - # cluster. - SECONDARY = 3 - end - end - - # Maintenance policy per cluster. - # @!attribute [r] create_time - # @return [::Google::Protobuf::Timestamp] - # Output only. The time when the policy was created i.e. Maintenance Window - # or Deny Period was assigned. - # @!attribute [r] update_time - # @return [::Google::Protobuf::Timestamp] - # Output only. The time when the policy was updated i.e. Maintenance Window - # or Deny Period was updated. - # @!attribute [rw] weekly_maintenance_window - # @return [::Array<::Google::Cloud::Redis::Cluster::V1beta1::ClusterWeeklyMaintenanceWindow>] - # Optional. Maintenance window that is applied to resources covered by this - # policy. Minimum 1. For the current version, the maximum number of - # weekly_maintenance_window is expected to be one. - class ClusterMaintenancePolicy - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Time window specified for weekly operations. - # @!attribute [rw] day - # @return [::Google::Type::DayOfWeek] - # Allows to define schedule that runs specified day of the week. - # @!attribute [rw] start_time - # @return [::Google::Type::TimeOfDay] - # Start time of the window in UTC. - class ClusterWeeklyMaintenanceWindow - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Upcoming maitenance schedule. - # @!attribute [r] start_time - # @return [::Google::Protobuf::Timestamp] - # Output only. The start time of any upcoming scheduled maintenance for this - # instance. - # @!attribute [r] end_time - # @return [::Google::Protobuf::Timestamp] - # Output only. The end time of any upcoming scheduled maintenance for this - # instance. - class ClusterMaintenanceSchedule - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # @!attribute [rw] network - # @return [::String] - # Required. The network where the IP address of the discovery endpoint will - # be reserved, in the form of - # projects/\\{network_project}/global/networks/\\{network_id}. - class PscConfig - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Endpoints on each network, for Redis clients to connect to the cluster. - # @!attribute [r] address - # @return [::String] - # Output only. Address of the exposed Redis endpoint used by clients to - # connect to the service. The address could be either IP or hostname. - # @!attribute [r] port - # @return [::Integer] - # Output only. The port number of the exposed Redis endpoint. - # @!attribute [r] psc_config - # @return [::Google::Cloud::Redis::Cluster::V1beta1::PscConfig] - # Output only. Customer configuration for where the endpoint is created and - # accessed from. - class DiscoveryEndpoint - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Details of consumer resources in a PSC connection. - # @!attribute [rw] psc_connection_id - # @return [::String] - # Required. The PSC connection id of the forwarding rule connected to the - # service attachment. - # @!attribute [rw] address - # @return [::String] - # Required. The IP allocated on the consumer network for the PSC forwarding - # rule. - # @!attribute [rw] forwarding_rule - # @return [::String] - # Required. The URI of the consumer side forwarding rule. - # Example: - # projects/\\{projectNumOrId}/regions/us-east1/forwardingRules/\\{resourceId}. - # @!attribute [rw] project_id - # @return [::String] - # Optional. Project ID of the consumer project where the forwarding rule is - # created in. - # @!attribute [rw] network - # @return [::String] - # Required. The consumer network where the IP address resides, in the form of - # projects/\\{project_id}/global/networks/\\{network_id}. - # @!attribute [rw] service_attachment - # @return [::String] - # Required. The service attachment which is the target of the PSC connection, - # in the form of - # projects/\\{project-id}/regions/\\{region}/serviceAttachments/\\{service-attachment-id}. - # @!attribute [r] psc_connection_status - # @return [::Google::Cloud::Redis::Cluster::V1beta1::PscConnectionStatus] - # Output only. The status of the PSC connection. - # Please note that this value is updated periodically. - # To get the latest status of a PSC connection, follow - # https://cloud.google.com/vpc/docs/configure-private-service-connect-services#endpoint-details. - # @!attribute [r] connection_type - # @return [::Google::Cloud::Redis::Cluster::V1beta1::ConnectionType] - # Output only. Type of the PSC connection. - class PscConnection - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # ClusterEndpoint consists of PSC connections that are created - # as a group in each VPC network for accessing the cluster. In each group, - # there shall be one connection for each service attachment in the cluster. - # @!attribute [rw] connections - # @return [::Array<::Google::Cloud::Redis::Cluster::V1beta1::ConnectionDetail>] - # A group of PSC connections. They are created in the same VPC network, one - # for each service attachment in the cluster. - class ClusterEndpoint - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Detailed information of each PSC connection. - # @!attribute [rw] psc_auto_connection - # @return [::Google::Cloud::Redis::Cluster::V1beta1::PscAutoConnection] - # Detailed information of a PSC connection that is created through - # service connectivity automation. - # - # Note: The following fields are mutually exclusive: `psc_auto_connection`, `psc_connection`. If a field in that set is populated, all other fields in the set will automatically be cleared. - # @!attribute [rw] psc_connection - # @return [::Google::Cloud::Redis::Cluster::V1beta1::PscConnection] - # Detailed information of a PSC connection that is created by the customer - # who owns the cluster. - # - # Note: The following fields are mutually exclusive: `psc_connection`, `psc_auto_connection`. If a field in that set is populated, all other fields in the set will automatically be cleared. - class ConnectionDetail - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Details of consumer resources in a PSC connection that is created through - # Service Connectivity Automation. - # @!attribute [r] psc_connection_id - # @return [::String] - # Output only. The PSC connection id of the forwarding rule connected to the - # service attachment. - # @!attribute [r] address - # @return [::String] - # Output only. The IP allocated on the consumer network for the PSC - # forwarding rule. - # @!attribute [r] forwarding_rule - # @return [::String] - # Output only. The URI of the consumer side forwarding rule. - # Example: - # projects/\\{projectNumOrId}/regions/us-east1/forwardingRules/\\{resourceId}. - # @!attribute [rw] project_id - # @return [::String] - # Required. The consumer project_id where the forwarding rule is created - # from. - # @!attribute [rw] network - # @return [::String] - # Required. The consumer network where the IP address resides, in the form of - # projects/\\{project_id}/global/networks/\\{network_id}. - # @!attribute [r] service_attachment - # @return [::String] - # Output only. The service attachment which is the target of the PSC - # connection, in the form of - # projects/\\{project-id}/regions/\\{region}/serviceAttachments/\\{service-attachment-id}. - # @!attribute [r] psc_connection_status - # @return [::Google::Cloud::Redis::Cluster::V1beta1::PscConnectionStatus] - # Output only. The status of the PSC connection. - # Please note that this value is updated periodically. - # Please use Private Service Connect APIs for the latest status. - # @!attribute [r] connection_type - # @return [::Google::Cloud::Redis::Cluster::V1beta1::ConnectionType] - # Output only. Type of the PSC connection. - class PscAutoConnection - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Pre-defined metadata fields. - # @!attribute [r] create_time - # @return [::Google::Protobuf::Timestamp] - # Output only. The time the operation was created. - # @!attribute [r] end_time - # @return [::Google::Protobuf::Timestamp] - # Output only. The time the operation finished running. - # @!attribute [r] target - # @return [::String] - # Output only. Server-defined resource path for the target of the operation. - # @!attribute [r] verb - # @return [::String] - # Output only. Name of the verb executed by the operation. - # @!attribute [r] status_message - # @return [::String] - # Output only. Human-readable status of the operation, if any. - # @!attribute [r] requested_cancellation - # @return [::Boolean] - # Output only. Identifies whether the user has requested cancellation - # of the operation. Operations that have successfully been cancelled - # have [Operation.error][] value with a - # {::Google::Rpc::Status#code google.rpc.Status.code} of 1, corresponding to - # `Code.CANCELLED`. - # @!attribute [r] api_version - # @return [::String] - # Output only. API version used to start the operation. - class OperationMetadata - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Redis cluster certificate authority - # @!attribute [rw] managed_server_ca - # @return [::Google::Cloud::Redis::Cluster::V1beta1::CertificateAuthority::ManagedCertificateAuthority] - # @!attribute [rw] name - # @return [::String] - # Identifier. Unique name of the resource in this scope including project, - # location and cluster using the form: - # `projects/{project}/locations/{location}/clusters/{cluster}/certificateAuthority` - class CertificateAuthority - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - - # @!attribute [rw] ca_certs - # @return [::Array<::Google::Cloud::Redis::Cluster::V1beta1::CertificateAuthority::ManagedCertificateAuthority::CertChain>] - # The PEM encoded CA certificate chains for redis managed - # server authentication - class ManagedCertificateAuthority - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - - # @!attribute [rw] certificates - # @return [::Array<::String>] - # The certificates that form the CA chain, from leaf to root order. - class CertChain - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - end - end - - # Configuration of the persistence functionality. - # @!attribute [rw] mode - # @return [::Google::Cloud::Redis::Cluster::V1beta1::ClusterPersistenceConfig::PersistenceMode] - # Optional. The mode of persistence. - # @!attribute [rw] rdb_config - # @return [::Google::Cloud::Redis::Cluster::V1beta1::ClusterPersistenceConfig::RDBConfig] - # Optional. RDB configuration. This field will be ignored if mode is not RDB. - # @!attribute [rw] aof_config - # @return [::Google::Cloud::Redis::Cluster::V1beta1::ClusterPersistenceConfig::AOFConfig] - # Optional. AOF configuration. This field will be ignored if mode is not AOF. - class ClusterPersistenceConfig - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - - # Configuration of the RDB based persistence. - # @!attribute [rw] rdb_snapshot_period - # @return [::Google::Cloud::Redis::Cluster::V1beta1::ClusterPersistenceConfig::RDBConfig::SnapshotPeriod] - # Optional. Period between RDB snapshots. - # @!attribute [rw] rdb_snapshot_start_time - # @return [::Google::Protobuf::Timestamp] - # Optional. The time that the first snapshot was/will be attempted, and to - # which future snapshots will be aligned. If not provided, the current time - # will be used. - class RDBConfig - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - - # Available snapshot periods. - module SnapshotPeriod - # Not set. - SNAPSHOT_PERIOD_UNSPECIFIED = 0 - - # One hour. - ONE_HOUR = 1 - - # Six hours. - SIX_HOURS = 2 - - # Twelve hours. - TWELVE_HOURS = 3 - - # Twenty four hours. - TWENTY_FOUR_HOURS = 4 - end - end - - # Configuration of the AOF based persistence. - # @!attribute [rw] append_fsync - # @return [::Google::Cloud::Redis::Cluster::V1beta1::ClusterPersistenceConfig::AOFConfig::AppendFsync] - # Optional. fsync configuration. - class AOFConfig - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - - # Available fsync modes. - module AppendFsync - # Not set. Default: EVERYSEC - APPEND_FSYNC_UNSPECIFIED = 0 - - # Never fsync. Normally Linux will flush data every 30 seconds with this - # configuration, but it's up to the kernel's exact tuning. - NO = 1 - - # fsync every second. Fast enough, and you may lose 1 second of data if - # there is a disaster - EVERYSEC = 2 - - # fsync every time new write commands are appended to the AOF. It has the - # best data loss protection at the cost of performance - ALWAYS = 3 - end - end - - # Available persistence modes. - module PersistenceMode - # Not set. - PERSISTENCE_MODE_UNSPECIFIED = 0 - - # Persistence is disabled, and any snapshot data is deleted. - DISABLED = 1 - - # RDB based persistence is enabled. - RDB = 2 - - # AOF based persistence is enabled. - AOF = 3 - end - end - - # Zone distribution config for allocation of cluster resources. - # @!attribute [rw] mode - # @return [::Google::Cloud::Redis::Cluster::V1beta1::ZoneDistributionConfig::ZoneDistributionMode] - # Optional. The mode of zone distribution. Defaults to MULTI_ZONE, when not - # specified. - # @!attribute [rw] zone - # @return [::String] - # Optional. When SINGLE ZONE distribution is selected, zone field would be - # used to allocate all resources in that zone. This is not applicable to - # MULTI_ZONE, and would be ignored for MULTI_ZONE clusters. - class ZoneDistributionConfig - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - - # Defines various modes of zone distribution. - module ZoneDistributionMode - # Not Set. Default: MULTI_ZONE - ZONE_DISTRIBUTION_MODE_UNSPECIFIED = 0 - - # Distribute all resources across 3 zones picked at random, within the - # region. - MULTI_ZONE = 1 - - # Distribute all resources in a single zone. The zone field must be - # specified, when this mode is selected. - SINGLE_ZONE = 2 - end - end - - # Request for rescheduling a cluster maintenance. - # @!attribute [rw] name - # @return [::String] - # Required. Redis Cluster instance resource name using the form: - # `projects/{project_id}/locations/{location_id}/clusters/{cluster_id}` - # where `location_id` refers to a GCP region. - # @!attribute [rw] reschedule_type - # @return [::Google::Cloud::Redis::Cluster::V1beta1::RescheduleClusterMaintenanceRequest::RescheduleType] - # Required. If reschedule type is SPECIFIC_TIME, must set up schedule_time as - # well. - # @!attribute [rw] schedule_time - # @return [::Google::Protobuf::Timestamp] - # Optional. Timestamp when the maintenance shall be rescheduled to if - # reschedule_type=SPECIFIC_TIME, in RFC 3339 format, for - # example `2012-11-15T16:19:00.094Z`. - class RescheduleClusterMaintenanceRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - - # Reschedule options. - module RescheduleType - # Not set. - RESCHEDULE_TYPE_UNSPECIFIED = 0 - - # If the user wants to schedule the maintenance to happen now. - IMMEDIATE = 1 - - # If the user wants to reschedule the maintenance to a specific time. - SPECIFIC_TIME = 3 - end - end - - # EncryptionInfo describes the encryption information of a cluster or a backup. - # @!attribute [r] encryption_type - # @return [::Google::Cloud::Redis::Cluster::V1beta1::EncryptionInfo::Type] - # Output only. Type of encryption. - # @!attribute [r] kms_key_versions - # @return [::Array<::String>] - # Output only. KMS key versions that are being used to protect the data - # at-rest. - # @!attribute [r] kms_key_primary_state - # @return [::Google::Cloud::Redis::Cluster::V1beta1::EncryptionInfo::KmsKeyState] - # Output only. The state of the primary version of the KMS key perceived by - # the system. This field is not populated in backups. - # @!attribute [r] last_update_time - # @return [::Google::Protobuf::Timestamp] - # Output only. The most recent time when the encryption info was updated. - class EncryptionInfo - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - - # Possible encryption types. - module Type - # Encryption type not specified. Defaults to GOOGLE_DEFAULT_ENCRYPTION. - TYPE_UNSPECIFIED = 0 - - # The data is encrypted at rest with a key that is fully managed by Google. - # No key version will be populated. This is the default state. - GOOGLE_DEFAULT_ENCRYPTION = 1 - - # The data is encrypted at rest with a key that is managed by the customer. - # KMS key versions will be populated. - CUSTOMER_MANAGED_ENCRYPTION = 2 - end - - # The state of the KMS key perceived by the system. Refer to the public - # documentation for the impact of each state. - module KmsKeyState - # The default value. This value is unused. - KMS_KEY_STATE_UNSPECIFIED = 0 - - # The KMS key is enabled and correctly configured. - ENABLED = 1 - - # Permission denied on the KMS key. - PERMISSION_DENIED = 2 - - # The KMS key is disabled. - DISABLED = 3 - - # The KMS key is destroyed. - DESTROYED = 4 - - # The KMS key is scheduled to be destroyed. - DESTROY_SCHEDULED = 5 - - # The EKM key is unreachable. - EKM_KEY_UNREACHABLE_DETECTED = 6 - - # Billing is disabled for the project. - BILLING_DISABLED = 7 - - # All other unknown failures. - UNKNOWN_FAILURE = 8 - end - end - - # Status of the PSC connection. - module PscConnectionStatus - # PSC connection status is not specified. - PSC_CONNECTION_STATUS_UNSPECIFIED = 0 - - # The connection is active - PSC_CONNECTION_STATUS_ACTIVE = 1 - - # Connection not found - PSC_CONNECTION_STATUS_NOT_FOUND = 2 - end - - # Available authorization mode of a Redis cluster. - module AuthorizationMode - # Not set. - AUTH_MODE_UNSPECIFIED = 0 - - # IAM basic authorization mode - AUTH_MODE_IAM_AUTH = 1 - - # Authorization disabled mode - AUTH_MODE_DISABLED = 2 - end - - # NodeType of a redis cluster node, - module NodeType - # Node type unspecified - NODE_TYPE_UNSPECIFIED = 0 - - # Redis shared core nano node_type. - REDIS_SHARED_CORE_NANO = 1 - - # Redis highmem medium node_type. - REDIS_HIGHMEM_MEDIUM = 2 - - # Redis highmem xlarge node_type. - REDIS_HIGHMEM_XLARGE = 3 - - # Redis standard small node_type. - REDIS_STANDARD_SMALL = 4 - end - - # Available mode of in-transit encryption. - module TransitEncryptionMode - # In-transit encryption not set. - TRANSIT_ENCRYPTION_MODE_UNSPECIFIED = 0 - - # In-transit encryption disabled. - TRANSIT_ENCRYPTION_MODE_DISABLED = 1 - - # Use server managed encryption for in-transit encryption. - TRANSIT_ENCRYPTION_MODE_SERVER_AUTHENTICATION = 2 - end - - # Type of a PSC connection, for cluster access purpose. - module ConnectionType - # Cluster endpoint Type is not set - CONNECTION_TYPE_UNSPECIFIED = 0 - - # Cluster endpoint that will be used as for cluster topology discovery. - CONNECTION_TYPE_DISCOVERY = 1 - - # Cluster endpoint that will be used as primary endpoint to access primary. - CONNECTION_TYPE_PRIMARY = 2 - - # Cluster endpoint that will be used as reader endpoint to access replicas. - CONNECTION_TYPE_READER = 3 - end - end - end - end - end -end diff --git a/owl-bot-staging/google-cloud-redis-cluster-v1beta1/proto_docs/google/longrunning/operations.rb b/owl-bot-staging/google-cloud-redis-cluster-v1beta1/proto_docs/google/longrunning/operations.rb deleted file mode 100644 index 7a757f512165..000000000000 --- a/owl-bot-staging/google-cloud-redis-cluster-v1beta1/proto_docs/google/longrunning/operations.rb +++ /dev/null @@ -1,191 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - - -module Google - module Longrunning - # This resource represents a long-running operation that is the result of a - # network API call. - # @!attribute [rw] name - # @return [::String] - # The server-assigned name, which is only unique within the same service that - # originally returns it. If you use the default HTTP mapping, the - # `name` should be a resource name ending with `operations/{unique_id}`. - # @!attribute [rw] metadata - # @return [::Google::Protobuf::Any] - # Service-specific metadata associated with the operation. It typically - # contains progress information and common metadata such as create time. - # Some services might not provide such metadata. Any method that returns a - # long-running operation should document the metadata type, if any. - # @!attribute [rw] done - # @return [::Boolean] - # If the value is `false`, it means the operation is still in progress. - # If `true`, the operation is completed, and either `error` or `response` is - # available. - # @!attribute [rw] error - # @return [::Google::Rpc::Status] - # The error result of the operation in case of failure or cancellation. - # - # Note: The following fields are mutually exclusive: `error`, `response`. If a field in that set is populated, all other fields in the set will automatically be cleared. - # @!attribute [rw] response - # @return [::Google::Protobuf::Any] - # The normal, successful response of the operation. If the original - # method returns no data on success, such as `Delete`, the response is - # `google.protobuf.Empty`. If the original method is standard - # `Get`/`Create`/`Update`, the response should be the resource. For other - # methods, the response should have the type `XxxResponse`, where `Xxx` - # is the original method name. For example, if the original method name - # is `TakeSnapshot()`, the inferred response type is - # `TakeSnapshotResponse`. - # - # Note: The following fields are mutually exclusive: `response`, `error`. If a field in that set is populated, all other fields in the set will automatically be cleared. - class Operation - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # The request message for - # Operations.GetOperation. - # @!attribute [rw] name - # @return [::String] - # The name of the operation resource. - class GetOperationRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # The request message for - # Operations.ListOperations. - # @!attribute [rw] name - # @return [::String] - # The name of the operation's parent resource. - # @!attribute [rw] filter - # @return [::String] - # The standard list filter. - # @!attribute [rw] page_size - # @return [::Integer] - # The standard list page size. - # @!attribute [rw] page_token - # @return [::String] - # The standard list page token. - # @!attribute [rw] return_partial_success - # @return [::Boolean] - # When set to `true`, operations that are reachable are returned as normal, - # and those that are unreachable are returned in the - # [ListOperationsResponse.unreachable] field. - # - # This can only be `true` when reading across collections e.g. when `parent` - # is set to `"projects/example/locations/-"`. - # - # This field is not by default supported and will result in an - # `UNIMPLEMENTED` error if set unless explicitly documented otherwise in - # service or product specific documentation. - class ListOperationsRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # The response message for - # Operations.ListOperations. - # @!attribute [rw] operations - # @return [::Array<::Google::Longrunning::Operation>] - # A list of operations that matches the specified filter in the request. - # @!attribute [rw] next_page_token - # @return [::String] - # The standard List next-page token. - # @!attribute [rw] unreachable - # @return [::Array<::String>] - # Unordered list. Unreachable resources. Populated when the request sets - # `ListOperationsRequest.return_partial_success` and reads across - # collections e.g. when attempting to list all resources across all supported - # locations. - class ListOperationsResponse - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # The request message for - # Operations.CancelOperation. - # @!attribute [rw] name - # @return [::String] - # The name of the operation resource to be cancelled. - class CancelOperationRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # The request message for - # Operations.DeleteOperation. - # @!attribute [rw] name - # @return [::String] - # The name of the operation resource to be deleted. - class DeleteOperationRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # The request message for - # Operations.WaitOperation. - # @!attribute [rw] name - # @return [::String] - # The name of the operation resource to wait on. - # @!attribute [rw] timeout - # @return [::Google::Protobuf::Duration] - # The maximum duration to wait before timing out. If left blank, the wait - # will be at most the time permitted by the underlying HTTP/RPC protocol. - # If RPC context deadline is also specified, the shorter one will be used. - class WaitOperationRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # A message representing the message types used by a long-running operation. - # - # Example: - # - # rpc Export(ExportRequest) returns (google.longrunning.Operation) { - # option (google.longrunning.operation_info) = { - # response_type: "ExportResponse" - # metadata_type: "ExportMetadata" - # }; - # } - # @!attribute [rw] response_type - # @return [::String] - # Required. The message name of the primary return type for this - # long-running operation. - # This type will be used to deserialize the LRO's response. - # - # If the response is in a different package from the rpc, a fully-qualified - # message name must be used (e.g. `google.protobuf.Struct`). - # - # Note: Altering this value constitutes a breaking change. - # @!attribute [rw] metadata_type - # @return [::String] - # Required. The message name of the metadata type for this long-running - # operation. - # - # If the response is in a different package from the rpc, a fully-qualified - # message name must be used (e.g. `google.protobuf.Struct`). - # - # Note: Altering this value constitutes a breaking change. - class OperationInfo - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - end -end diff --git a/owl-bot-staging/google-cloud-redis-cluster-v1beta1/proto_docs/google/protobuf/any.rb b/owl-bot-staging/google-cloud-redis-cluster-v1beta1/proto_docs/google/protobuf/any.rb deleted file mode 100644 index 58691995f02e..000000000000 --- a/owl-bot-staging/google-cloud-redis-cluster-v1beta1/proto_docs/google/protobuf/any.rb +++ /dev/null @@ -1,145 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - - -module Google - module Protobuf - # `Any` contains an arbitrary serialized protocol buffer message along with a - # URL that describes the type of the serialized message. - # - # Protobuf library provides support to pack/unpack Any values in the form - # of utility functions or additional generated methods of the Any type. - # - # Example 1: Pack and unpack a message in C++. - # - # Foo foo = ...; - # Any any; - # any.PackFrom(foo); - # ... - # if (any.UnpackTo(&foo)) { - # ... - # } - # - # Example 2: Pack and unpack a message in Java. - # - # Foo foo = ...; - # Any any = Any.pack(foo); - # ... - # if (any.is(Foo.class)) { - # foo = any.unpack(Foo.class); - # } - # // or ... - # if (any.isSameTypeAs(Foo.getDefaultInstance())) { - # foo = any.unpack(Foo.getDefaultInstance()); - # } - # - # Example 3: Pack and unpack a message in Python. - # - # foo = Foo(...) - # any = Any() - # any.Pack(foo) - # ... - # if any.Is(Foo.DESCRIPTOR): - # any.Unpack(foo) - # ... - # - # Example 4: Pack and unpack a message in Go - # - # foo := &pb.Foo{...} - # any, err := anypb.New(foo) - # if err != nil { - # ... - # } - # ... - # foo := &pb.Foo{} - # if err := any.UnmarshalTo(foo); err != nil { - # ... - # } - # - # The pack methods provided by protobuf library will by default use - # 'type.googleapis.com/full.type.name' as the type URL and the unpack - # methods only use the fully qualified type name after the last '/' - # in the type URL, for example "foo.bar.com/x/y.z" will yield type - # name "y.z". - # - # JSON - # ==== - # The JSON representation of an `Any` value uses the regular - # representation of the deserialized, embedded message, with an - # additional field `@type` which contains the type URL. Example: - # - # package google.profile; - # message Person { - # string first_name = 1; - # string last_name = 2; - # } - # - # { - # "@type": "type.googleapis.com/google.profile.Person", - # "firstName": , - # "lastName": - # } - # - # If the embedded message type is well-known and has a custom JSON - # representation, that representation will be embedded adding a field - # `value` which holds the custom JSON in addition to the `@type` - # field. Example (for message [google.protobuf.Duration][]): - # - # { - # "@type": "type.googleapis.com/google.protobuf.Duration", - # "value": "1.212s" - # } - # @!attribute [rw] type_url - # @return [::String] - # A URL/resource name that uniquely identifies the type of the serialized - # protocol buffer message. This string must contain at least - # one "/" character. The last segment of the URL's path must represent - # the fully qualified name of the type (as in - # `path/google.protobuf.Duration`). The name should be in a canonical form - # (e.g., leading "." is not accepted). - # - # In practice, teams usually precompile into the binary all types that they - # expect it to use in the context of Any. However, for URLs which use the - # scheme `http`, `https`, or no scheme, one can optionally set up a type - # server that maps type URLs to message definitions as follows: - # - # * If no scheme is provided, `https` is assumed. - # * An HTTP GET on the URL must yield a [google.protobuf.Type][] - # value in binary format, or produce an error. - # * Applications are allowed to cache lookup results based on the - # URL, or have them precompiled into a binary to avoid any - # lookup. Therefore, binary compatibility needs to be preserved - # on changes to types. (Use versioned type names to manage - # breaking changes.) - # - # Note: this functionality is not currently available in the official - # protobuf release, and it is not used for type URLs beginning with - # type.googleapis.com. As of May 2023, there are no widely used type server - # implementations and no plans to implement one. - # - # Schemes other than `http`, `https` (or the empty scheme) might be - # used with implementation specific semantics. - # @!attribute [rw] value - # @return [::String] - # Must be a valid serialized protocol buffer of the above specified type. - class Any - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - end -end diff --git a/owl-bot-staging/google-cloud-redis-cluster-v1beta1/proto_docs/google/protobuf/duration.rb b/owl-bot-staging/google-cloud-redis-cluster-v1beta1/proto_docs/google/protobuf/duration.rb deleted file mode 100644 index ea59f1f91daf..000000000000 --- a/owl-bot-staging/google-cloud-redis-cluster-v1beta1/proto_docs/google/protobuf/duration.rb +++ /dev/null @@ -1,98 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - - -module Google - module Protobuf - # A Duration represents a signed, fixed-length span of time represented - # as a count of seconds and fractions of seconds at nanosecond - # resolution. It is independent of any calendar and concepts like "day" - # or "month". It is related to Timestamp in that the difference between - # two Timestamp values is a Duration and it can be added or subtracted - # from a Timestamp. Range is approximately +-10,000 years. - # - # # Examples - # - # Example 1: Compute Duration from two Timestamps in pseudo code. - # - # Timestamp start = ...; - # Timestamp end = ...; - # Duration duration = ...; - # - # duration.seconds = end.seconds - start.seconds; - # duration.nanos = end.nanos - start.nanos; - # - # if (duration.seconds < 0 && duration.nanos > 0) { - # duration.seconds += 1; - # duration.nanos -= 1000000000; - # } else if (duration.seconds > 0 && duration.nanos < 0) { - # duration.seconds -= 1; - # duration.nanos += 1000000000; - # } - # - # Example 2: Compute Timestamp from Timestamp + Duration in pseudo code. - # - # Timestamp start = ...; - # Duration duration = ...; - # Timestamp end = ...; - # - # end.seconds = start.seconds + duration.seconds; - # end.nanos = start.nanos + duration.nanos; - # - # if (end.nanos < 0) { - # end.seconds -= 1; - # end.nanos += 1000000000; - # } else if (end.nanos >= 1000000000) { - # end.seconds += 1; - # end.nanos -= 1000000000; - # } - # - # Example 3: Compute Duration from datetime.timedelta in Python. - # - # td = datetime.timedelta(days=3, minutes=10) - # duration = Duration() - # duration.FromTimedelta(td) - # - # # JSON Mapping - # - # In JSON format, the Duration type is encoded as a string rather than an - # object, where the string ends in the suffix "s" (indicating seconds) and - # is preceded by the number of seconds, with nanoseconds expressed as - # fractional seconds. For example, 3 seconds with 0 nanoseconds should be - # encoded in JSON format as "3s", while 3 seconds and 1 nanosecond should - # be expressed in JSON format as "3.000000001s", and 3 seconds and 1 - # microsecond should be expressed in JSON format as "3.000001s". - # @!attribute [rw] seconds - # @return [::Integer] - # Signed seconds of the span of time. Must be from -315,576,000,000 - # to +315,576,000,000 inclusive. Note: these bounds are computed from: - # 60 sec/min * 60 min/hr * 24 hr/day * 365.25 days/year * 10000 years - # @!attribute [rw] nanos - # @return [::Integer] - # Signed fractions of a second at nanosecond resolution of the span - # of time. Durations less than one second are represented with a 0 - # `seconds` field and a positive or negative `nanos` field. For durations - # of one second or more, a non-zero value for the `nanos` field must be - # of the same sign as the `seconds` field. Must be from -999,999,999 - # to +999,999,999 inclusive. - class Duration - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - end -end diff --git a/owl-bot-staging/google-cloud-redis-cluster-v1beta1/proto_docs/google/protobuf/empty.rb b/owl-bot-staging/google-cloud-redis-cluster-v1beta1/proto_docs/google/protobuf/empty.rb deleted file mode 100644 index 83e4481834a6..000000000000 --- a/owl-bot-staging/google-cloud-redis-cluster-v1beta1/proto_docs/google/protobuf/empty.rb +++ /dev/null @@ -1,34 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - - -module Google - module Protobuf - # A generic empty message that you can re-use to avoid defining duplicated - # empty messages in your APIs. A typical example is to use it as the request - # or the response type of an API method. For instance: - # - # service Foo { - # rpc Bar(google.protobuf.Empty) returns (google.protobuf.Empty); - # } - class Empty - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - end -end diff --git a/owl-bot-staging/google-cloud-redis-cluster-v1beta1/proto_docs/google/protobuf/field_mask.rb b/owl-bot-staging/google-cloud-redis-cluster-v1beta1/proto_docs/google/protobuf/field_mask.rb deleted file mode 100644 index 7f3ffc78601a..000000000000 --- a/owl-bot-staging/google-cloud-redis-cluster-v1beta1/proto_docs/google/protobuf/field_mask.rb +++ /dev/null @@ -1,229 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - - -module Google - module Protobuf - # `FieldMask` represents a set of symbolic field paths, for example: - # - # paths: "f.a" - # paths: "f.b.d" - # - # Here `f` represents a field in some root message, `a` and `b` - # fields in the message found in `f`, and `d` a field found in the - # message in `f.b`. - # - # Field masks are used to specify a subset of fields that should be - # returned by a get operation or modified by an update operation. - # Field masks also have a custom JSON encoding (see below). - # - # # Field Masks in Projections - # - # When used in the context of a projection, a response message or - # sub-message is filtered by the API to only contain those fields as - # specified in the mask. For example, if the mask in the previous - # example is applied to a response message as follows: - # - # f { - # a : 22 - # b { - # d : 1 - # x : 2 - # } - # y : 13 - # } - # z: 8 - # - # The result will not contain specific values for fields x,y and z - # (their value will be set to the default, and omitted in proto text - # output): - # - # - # f { - # a : 22 - # b { - # d : 1 - # } - # } - # - # A repeated field is not allowed except at the last position of a - # paths string. - # - # If a FieldMask object is not present in a get operation, the - # operation applies to all fields (as if a FieldMask of all fields - # had been specified). - # - # Note that a field mask does not necessarily apply to the - # top-level response message. In case of a REST get operation, the - # field mask applies directly to the response, but in case of a REST - # list operation, the mask instead applies to each individual message - # in the returned resource list. In case of a REST custom method, - # other definitions may be used. Where the mask applies will be - # clearly documented together with its declaration in the API. In - # any case, the effect on the returned resource/resources is required - # behavior for APIs. - # - # # Field Masks in Update Operations - # - # A field mask in update operations specifies which fields of the - # targeted resource are going to be updated. The API is required - # to only change the values of the fields as specified in the mask - # and leave the others untouched. If a resource is passed in to - # describe the updated values, the API ignores the values of all - # fields not covered by the mask. - # - # If a repeated field is specified for an update operation, new values will - # be appended to the existing repeated field in the target resource. Note that - # a repeated field is only allowed in the last position of a `paths` string. - # - # If a sub-message is specified in the last position of the field mask for an - # update operation, then new value will be merged into the existing sub-message - # in the target resource. - # - # For example, given the target message: - # - # f { - # b { - # d: 1 - # x: 2 - # } - # c: [1] - # } - # - # And an update message: - # - # f { - # b { - # d: 10 - # } - # c: [2] - # } - # - # then if the field mask is: - # - # paths: ["f.b", "f.c"] - # - # then the result will be: - # - # f { - # b { - # d: 10 - # x: 2 - # } - # c: [1, 2] - # } - # - # An implementation may provide options to override this default behavior for - # repeated and message fields. - # - # In order to reset a field's value to the default, the field must - # be in the mask and set to the default value in the provided resource. - # Hence, in order to reset all fields of a resource, provide a default - # instance of the resource and set all fields in the mask, or do - # not provide a mask as described below. - # - # If a field mask is not present on update, the operation applies to - # all fields (as if a field mask of all fields has been specified). - # Note that in the presence of schema evolution, this may mean that - # fields the client does not know and has therefore not filled into - # the request will be reset to their default. If this is unwanted - # behavior, a specific service may require a client to always specify - # a field mask, producing an error if not. - # - # As with get operations, the location of the resource which - # describes the updated values in the request message depends on the - # operation kind. In any case, the effect of the field mask is - # required to be honored by the API. - # - # ## Considerations for HTTP REST - # - # The HTTP kind of an update operation which uses a field mask must - # be set to PATCH instead of PUT in order to satisfy HTTP semantics - # (PUT must only be used for full updates). - # - # # JSON Encoding of Field Masks - # - # In JSON, a field mask is encoded as a single string where paths are - # separated by a comma. Fields name in each path are converted - # to/from lower-camel naming conventions. - # - # As an example, consider the following message declarations: - # - # message Profile { - # User user = 1; - # Photo photo = 2; - # } - # message User { - # string display_name = 1; - # string address = 2; - # } - # - # In proto a field mask for `Profile` may look as such: - # - # mask { - # paths: "user.display_name" - # paths: "photo" - # } - # - # In JSON, the same mask is represented as below: - # - # { - # mask: "user.displayName,photo" - # } - # - # # Field Masks and Oneof Fields - # - # Field masks treat fields in oneofs just as regular fields. Consider the - # following message: - # - # message SampleMessage { - # oneof test_oneof { - # string name = 4; - # SubMessage sub_message = 9; - # } - # } - # - # The field mask can be: - # - # mask { - # paths: "name" - # } - # - # Or: - # - # mask { - # paths: "sub_message" - # } - # - # Note that oneof type names ("test_oneof" in this case) cannot be used in - # paths. - # - # ## Field Mask Verification - # - # The implementation of any API method which has a FieldMask type field in the - # request should verify the included field paths, and return an - # `INVALID_ARGUMENT` error if any path is unmappable. - # @!attribute [rw] paths - # @return [::Array<::String>] - # The set of field mask paths. - class FieldMask - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - end -end diff --git a/owl-bot-staging/google-cloud-redis-cluster-v1beta1/proto_docs/google/protobuf/timestamp.rb b/owl-bot-staging/google-cloud-redis-cluster-v1beta1/proto_docs/google/protobuf/timestamp.rb deleted file mode 100644 index 74352be9c58c..000000000000 --- a/owl-bot-staging/google-cloud-redis-cluster-v1beta1/proto_docs/google/protobuf/timestamp.rb +++ /dev/null @@ -1,127 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - - -module Google - module Protobuf - # A Timestamp represents a point in time independent of any time zone or local - # calendar, encoded as a count of seconds and fractions of seconds at - # nanosecond resolution. The count is relative to an epoch at UTC midnight on - # January 1, 1970, in the proleptic Gregorian calendar which extends the - # Gregorian calendar backwards to year one. - # - # All minutes are 60 seconds long. Leap seconds are "smeared" so that no leap - # second table is needed for interpretation, using a [24-hour linear - # smear](https://developers.google.com/time/smear). - # - # The range is from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59.999999999Z. By - # restricting to that range, we ensure that we can convert to and from [RFC - # 3339](https://www.ietf.org/rfc/rfc3339.txt) date strings. - # - # # Examples - # - # Example 1: Compute Timestamp from POSIX `time()`. - # - # Timestamp timestamp; - # timestamp.set_seconds(time(NULL)); - # timestamp.set_nanos(0); - # - # Example 2: Compute Timestamp from POSIX `gettimeofday()`. - # - # struct timeval tv; - # gettimeofday(&tv, NULL); - # - # Timestamp timestamp; - # timestamp.set_seconds(tv.tv_sec); - # timestamp.set_nanos(tv.tv_usec * 1000); - # - # Example 3: Compute Timestamp from Win32 `GetSystemTimeAsFileTime()`. - # - # FILETIME ft; - # GetSystemTimeAsFileTime(&ft); - # UINT64 ticks = (((UINT64)ft.dwHighDateTime) << 32) | ft.dwLowDateTime; - # - # // A Windows tick is 100 nanoseconds. Windows epoch 1601-01-01T00:00:00Z - # // is 11644473600 seconds before Unix epoch 1970-01-01T00:00:00Z. - # Timestamp timestamp; - # timestamp.set_seconds((INT64) ((ticks / 10000000) - 11644473600LL)); - # timestamp.set_nanos((INT32) ((ticks % 10000000) * 100)); - # - # Example 4: Compute Timestamp from Java `System.currentTimeMillis()`. - # - # long millis = System.currentTimeMillis(); - # - # Timestamp timestamp = Timestamp.newBuilder().setSeconds(millis / 1000) - # .setNanos((int) ((millis % 1000) * 1000000)).build(); - # - # Example 5: Compute Timestamp from Java `Instant.now()`. - # - # Instant now = Instant.now(); - # - # Timestamp timestamp = - # Timestamp.newBuilder().setSeconds(now.getEpochSecond()) - # .setNanos(now.getNano()).build(); - # - # Example 6: Compute Timestamp from current time in Python. - # - # timestamp = Timestamp() - # timestamp.GetCurrentTime() - # - # # JSON Mapping - # - # In JSON format, the Timestamp type is encoded as a string in the - # [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format. That is, the - # format is "\\{year}-\\{month}-\\{day}T\\{hour}:\\{min}:\\{sec}[.\\{frac_sec}]Z" - # where \\{year} is always expressed using four digits while \\{month}, \\{day}, - # \\{hour}, \\{min}, and \\{sec} are zero-padded to two digits each. The fractional - # seconds, which can go up to 9 digits (i.e. up to 1 nanosecond resolution), - # are optional. The "Z" suffix indicates the timezone ("UTC"); the timezone - # is required. A proto3 JSON serializer should always use UTC (as indicated by - # "Z") when printing the Timestamp type and a proto3 JSON parser should be - # able to accept both UTC and other timezones (as indicated by an offset). - # - # For example, "2017-01-15T01:30:15.01Z" encodes 15.01 seconds past - # 01:30 UTC on January 15, 2017. - # - # In JavaScript, one can convert a Date object to this format using the - # standard - # [toISOString()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toISOString) - # method. In Python, a standard `datetime.datetime` object can be converted - # to this format using - # [`strftime`](https://docs.python.org/2/library/time.html#time.strftime) with - # the time format spec '%Y-%m-%dT%H:%M:%S.%fZ'. Likewise, in Java, one can use - # the Joda Time's [`ISODateTimeFormat.dateTime()`]( - # http://joda-time.sourceforge.net/apidocs/org/joda/time/format/ISODateTimeFormat.html#dateTime() - # ) to obtain a formatter capable of generating timestamps in this format. - # @!attribute [rw] seconds - # @return [::Integer] - # Represents seconds of UTC time since Unix epoch - # 1970-01-01T00:00:00Z. Must be from 0001-01-01T00:00:00Z to - # 9999-12-31T23:59:59Z inclusive. - # @!attribute [rw] nanos - # @return [::Integer] - # Non-negative fractions of a second at nanosecond resolution. Negative - # second values with fractions must still have non-negative nanos values - # that count forward in time. Must be from 0 to 999,999,999 - # inclusive. - class Timestamp - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - end -end diff --git a/owl-bot-staging/google-cloud-redis-cluster-v1beta1/proto_docs/google/rpc/status.rb b/owl-bot-staging/google-cloud-redis-cluster-v1beta1/proto_docs/google/rpc/status.rb deleted file mode 100644 index c1a1c07eb2db..000000000000 --- a/owl-bot-staging/google-cloud-redis-cluster-v1beta1/proto_docs/google/rpc/status.rb +++ /dev/null @@ -1,48 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - - -module Google - module Rpc - # The `Status` type defines a logical error model that is suitable for - # different programming environments, including REST APIs and RPC APIs. It is - # used by [gRPC](https://github.com/grpc). Each `Status` message contains - # three pieces of data: error code, error message, and error details. - # - # You can find out more about this error model and how to work with it in the - # [API Design Guide](https://cloud.google.com/apis/design/errors). - # @!attribute [rw] code - # @return [::Integer] - # The status code, which should be an enum value of - # [google.rpc.Code][google.rpc.Code]. - # @!attribute [rw] message - # @return [::String] - # A developer-facing error message, which should be in English. Any - # user-facing error message should be localized and sent in the - # {::Google::Rpc::Status#details google.rpc.Status.details} field, or localized - # by the client. - # @!attribute [rw] details - # @return [::Array<::Google::Protobuf::Any>] - # A list of messages that carry the error details. There is a common set of - # message types for APIs to use. - class Status - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - end -end diff --git a/owl-bot-staging/google-cloud-redis-cluster-v1beta1/proto_docs/google/type/dayofweek.rb b/owl-bot-staging/google-cloud-redis-cluster-v1beta1/proto_docs/google/type/dayofweek.rb deleted file mode 100644 index 973211b9ffe7..000000000000 --- a/owl-bot-staging/google-cloud-redis-cluster-v1beta1/proto_docs/google/type/dayofweek.rb +++ /dev/null @@ -1,49 +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 day of the week. - module DayOfWeek - # The day of the week is unspecified. - DAY_OF_WEEK_UNSPECIFIED = 0 - - # Monday - MONDAY = 1 - - # Tuesday - TUESDAY = 2 - - # Wednesday - WEDNESDAY = 3 - - # Thursday - THURSDAY = 4 - - # Friday - FRIDAY = 5 - - # Saturday - SATURDAY = 6 - - # Sunday - SUNDAY = 7 - end - end -end diff --git a/owl-bot-staging/google-cloud-redis-cluster-v1beta1/proto_docs/google/type/timeofday.rb b/owl-bot-staging/google-cloud-redis-cluster-v1beta1/proto_docs/google/type/timeofday.rb deleted file mode 100644 index 8372dad8beb8..000000000000 --- a/owl-bot-staging/google-cloud-redis-cluster-v1beta1/proto_docs/google/type/timeofday.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! - - -module Google - module Type - # Represents a time of day. The date and time zone are either not significant - # or are specified elsewhere. An API may choose to allow leap seconds. Related - # types are [google.type.Date][google.type.Date] and - # `google.protobuf.Timestamp`. - # @!attribute [rw] hours - # @return [::Integer] - # Hours of day in 24 hour format. Should be from 0 to 23. An API may choose - # to allow the value "24:00:00" for scenarios like business closing time. - # @!attribute [rw] minutes - # @return [::Integer] - # Minutes of hour of day. Must be from 0 to 59. - # @!attribute [rw] seconds - # @return [::Integer] - # Seconds of minutes of the time. Must normally be from 0 to 59. An API may - # allow the value 60 if it allows leap-seconds. - # @!attribute [rw] nanos - # @return [::Integer] - # Fractions of seconds in nanoseconds. Must be from 0 to 999,999,999. - class TimeOfDay - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - end -end diff --git a/owl-bot-staging/google-cloud-redis-cluster-v1beta1/snippets/Gemfile b/owl-bot-staging/google-cloud-redis-cluster-v1beta1/snippets/Gemfile deleted file mode 100644 index df35534a4e02..000000000000 --- a/owl-bot-staging/google-cloud-redis-cluster-v1beta1/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-redis-cluster-v1beta1", path: "../" -else - gem "google-cloud-redis-cluster-v1beta1" -end - -group :test do - gem "google-style", "~> 1.26.1" - gem "minitest", "~> 5.16" - gem "minitest-focus", "~> 1.1" - gem "minitest-hooks", "~> 1.5" -end diff --git a/owl-bot-staging/google-cloud-redis-cluster-v1beta1/snippets/cloud_redis_cluster/backup_cluster.rb b/owl-bot-staging/google-cloud-redis-cluster-v1beta1/snippets/cloud_redis_cluster/backup_cluster.rb deleted file mode 100644 index bf5ebfcda30d..000000000000 --- a/owl-bot-staging/google-cloud-redis-cluster-v1beta1/snippets/cloud_redis_cluster/backup_cluster.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 redis_v1beta1_generated_CloudRedisCluster_BackupCluster_sync] -require "google/cloud/redis/cluster/v1beta1" - -## -# Snippet for the backup_cluster call in the CloudRedisCluster service -# -# This snippet has been automatically generated and should be regarded as a code -# template only. It will require modifications to work: -# - It may require correct/in-range values for request initialization. -# - It may require specifying regional endpoints when creating the service -# client as shown in https://cloud.google.com/ruby/docs/reference. -# -# This is an auto-generated example demonstrating basic usage of -# Google::Cloud::Redis::Cluster::V1beta1::CloudRedisCluster::Client#backup_cluster. -# -def backup_cluster - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::Redis::Cluster::V1beta1::CloudRedisCluster::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::Redis::Cluster::V1beta1::BackupClusterRequest.new - - # Call the backup_cluster method. - result = client.backup_cluster 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 redis_v1beta1_generated_CloudRedisCluster_BackupCluster_sync] diff --git a/owl-bot-staging/google-cloud-redis-cluster-v1beta1/snippets/cloud_redis_cluster/create_cluster.rb b/owl-bot-staging/google-cloud-redis-cluster-v1beta1/snippets/cloud_redis_cluster/create_cluster.rb deleted file mode 100644 index 7638244dba94..000000000000 --- a/owl-bot-staging/google-cloud-redis-cluster-v1beta1/snippets/cloud_redis_cluster/create_cluster.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 redis_v1beta1_generated_CloudRedisCluster_CreateCluster_sync] -require "google/cloud/redis/cluster/v1beta1" - -## -# Snippet for the create_cluster call in the CloudRedisCluster service -# -# This snippet has been automatically generated and should be regarded as a code -# template only. It will require modifications to work: -# - It may require correct/in-range values for request initialization. -# - It may require specifying regional endpoints when creating the service -# client as shown in https://cloud.google.com/ruby/docs/reference. -# -# This is an auto-generated example demonstrating basic usage of -# Google::Cloud::Redis::Cluster::V1beta1::CloudRedisCluster::Client#create_cluster. -# -def create_cluster - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::Redis::Cluster::V1beta1::CloudRedisCluster::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::Redis::Cluster::V1beta1::CreateClusterRequest.new - - # Call the create_cluster method. - result = client.create_cluster 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 redis_v1beta1_generated_CloudRedisCluster_CreateCluster_sync] diff --git a/owl-bot-staging/google-cloud-redis-cluster-v1beta1/snippets/cloud_redis_cluster/delete_backup.rb b/owl-bot-staging/google-cloud-redis-cluster-v1beta1/snippets/cloud_redis_cluster/delete_backup.rb deleted file mode 100644 index 19917b30490c..000000000000 --- a/owl-bot-staging/google-cloud-redis-cluster-v1beta1/snippets/cloud_redis_cluster/delete_backup.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 redis_v1beta1_generated_CloudRedisCluster_DeleteBackup_sync] -require "google/cloud/redis/cluster/v1beta1" - -## -# Snippet for the delete_backup call in the CloudRedisCluster service -# -# This snippet has been automatically generated and should be regarded as a code -# template only. It will require modifications to work: -# - It may require correct/in-range values for request initialization. -# - It may require specifying regional endpoints when creating the service -# client as shown in https://cloud.google.com/ruby/docs/reference. -# -# This is an auto-generated example demonstrating basic usage of -# Google::Cloud::Redis::Cluster::V1beta1::CloudRedisCluster::Client#delete_backup. -# -def delete_backup - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::Redis::Cluster::V1beta1::CloudRedisCluster::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::Redis::Cluster::V1beta1::DeleteBackupRequest.new - - # Call the delete_backup method. - result = client.delete_backup 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 redis_v1beta1_generated_CloudRedisCluster_DeleteBackup_sync] diff --git a/owl-bot-staging/google-cloud-redis-cluster-v1beta1/snippets/cloud_redis_cluster/delete_cluster.rb b/owl-bot-staging/google-cloud-redis-cluster-v1beta1/snippets/cloud_redis_cluster/delete_cluster.rb deleted file mode 100644 index fbc95553d4b7..000000000000 --- a/owl-bot-staging/google-cloud-redis-cluster-v1beta1/snippets/cloud_redis_cluster/delete_cluster.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 redis_v1beta1_generated_CloudRedisCluster_DeleteCluster_sync] -require "google/cloud/redis/cluster/v1beta1" - -## -# Snippet for the delete_cluster call in the CloudRedisCluster service -# -# This snippet has been automatically generated and should be regarded as a code -# template only. It will require modifications to work: -# - It may require correct/in-range values for request initialization. -# - It may require specifying regional endpoints when creating the service -# client as shown in https://cloud.google.com/ruby/docs/reference. -# -# This is an auto-generated example demonstrating basic usage of -# Google::Cloud::Redis::Cluster::V1beta1::CloudRedisCluster::Client#delete_cluster. -# -def delete_cluster - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::Redis::Cluster::V1beta1::CloudRedisCluster::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::Redis::Cluster::V1beta1::DeleteClusterRequest.new - - # Call the delete_cluster method. - result = client.delete_cluster 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 redis_v1beta1_generated_CloudRedisCluster_DeleteCluster_sync] diff --git a/owl-bot-staging/google-cloud-redis-cluster-v1beta1/snippets/cloud_redis_cluster/export_backup.rb b/owl-bot-staging/google-cloud-redis-cluster-v1beta1/snippets/cloud_redis_cluster/export_backup.rb deleted file mode 100644 index 5ab68f801603..000000000000 --- a/owl-bot-staging/google-cloud-redis-cluster-v1beta1/snippets/cloud_redis_cluster/export_backup.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 redis_v1beta1_generated_CloudRedisCluster_ExportBackup_sync] -require "google/cloud/redis/cluster/v1beta1" - -## -# Snippet for the export_backup call in the CloudRedisCluster service -# -# This snippet has been automatically generated and should be regarded as a code -# template only. It will require modifications to work: -# - It may require correct/in-range values for request initialization. -# - It may require specifying regional endpoints when creating the service -# client as shown in https://cloud.google.com/ruby/docs/reference. -# -# This is an auto-generated example demonstrating basic usage of -# Google::Cloud::Redis::Cluster::V1beta1::CloudRedisCluster::Client#export_backup. -# -def export_backup - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::Redis::Cluster::V1beta1::CloudRedisCluster::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::Redis::Cluster::V1beta1::ExportBackupRequest.new - - # Call the export_backup method. - result = client.export_backup 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 redis_v1beta1_generated_CloudRedisCluster_ExportBackup_sync] diff --git a/owl-bot-staging/google-cloud-redis-cluster-v1beta1/snippets/cloud_redis_cluster/get_backup.rb b/owl-bot-staging/google-cloud-redis-cluster-v1beta1/snippets/cloud_redis_cluster/get_backup.rb deleted file mode 100644 index 7db2d5eecb49..000000000000 --- a/owl-bot-staging/google-cloud-redis-cluster-v1beta1/snippets/cloud_redis_cluster/get_backup.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 redis_v1beta1_generated_CloudRedisCluster_GetBackup_sync] -require "google/cloud/redis/cluster/v1beta1" - -## -# Snippet for the get_backup call in the CloudRedisCluster service -# -# This snippet has been automatically generated and should be regarded as a code -# template only. It will require modifications to work: -# - It may require correct/in-range values for request initialization. -# - It may require specifying regional endpoints when creating the service -# client as shown in https://cloud.google.com/ruby/docs/reference. -# -# This is an auto-generated example demonstrating basic usage of -# Google::Cloud::Redis::Cluster::V1beta1::CloudRedisCluster::Client#get_backup. -# -def get_backup - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::Redis::Cluster::V1beta1::CloudRedisCluster::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::Redis::Cluster::V1beta1::GetBackupRequest.new - - # Call the get_backup method. - result = client.get_backup request - - # The returned object is of type Google::Cloud::Redis::Cluster::V1beta1::Backup. - p result -end -# [END redis_v1beta1_generated_CloudRedisCluster_GetBackup_sync] diff --git a/owl-bot-staging/google-cloud-redis-cluster-v1beta1/snippets/cloud_redis_cluster/get_backup_collection.rb b/owl-bot-staging/google-cloud-redis-cluster-v1beta1/snippets/cloud_redis_cluster/get_backup_collection.rb deleted file mode 100644 index 766299664331..000000000000 --- a/owl-bot-staging/google-cloud-redis-cluster-v1beta1/snippets/cloud_redis_cluster/get_backup_collection.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 redis_v1beta1_generated_CloudRedisCluster_GetBackupCollection_sync] -require "google/cloud/redis/cluster/v1beta1" - -## -# Snippet for the get_backup_collection call in the CloudRedisCluster service -# -# This snippet has been automatically generated and should be regarded as a code -# template only. It will require modifications to work: -# - It may require correct/in-range values for request initialization. -# - It may require specifying regional endpoints when creating the service -# client as shown in https://cloud.google.com/ruby/docs/reference. -# -# This is an auto-generated example demonstrating basic usage of -# Google::Cloud::Redis::Cluster::V1beta1::CloudRedisCluster::Client#get_backup_collection. -# -def get_backup_collection - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::Redis::Cluster::V1beta1::CloudRedisCluster::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::Redis::Cluster::V1beta1::GetBackupCollectionRequest.new - - # Call the get_backup_collection method. - result = client.get_backup_collection request - - # The returned object is of type Google::Cloud::Redis::Cluster::V1beta1::BackupCollection. - p result -end -# [END redis_v1beta1_generated_CloudRedisCluster_GetBackupCollection_sync] diff --git a/owl-bot-staging/google-cloud-redis-cluster-v1beta1/snippets/cloud_redis_cluster/get_cluster.rb b/owl-bot-staging/google-cloud-redis-cluster-v1beta1/snippets/cloud_redis_cluster/get_cluster.rb deleted file mode 100644 index 77e8fff246f1..000000000000 --- a/owl-bot-staging/google-cloud-redis-cluster-v1beta1/snippets/cloud_redis_cluster/get_cluster.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 redis_v1beta1_generated_CloudRedisCluster_GetCluster_sync] -require "google/cloud/redis/cluster/v1beta1" - -## -# Snippet for the get_cluster call in the CloudRedisCluster service -# -# This snippet has been automatically generated and should be regarded as a code -# template only. It will require modifications to work: -# - It may require correct/in-range values for request initialization. -# - It may require specifying regional endpoints when creating the service -# client as shown in https://cloud.google.com/ruby/docs/reference. -# -# This is an auto-generated example demonstrating basic usage of -# Google::Cloud::Redis::Cluster::V1beta1::CloudRedisCluster::Client#get_cluster. -# -def get_cluster - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::Redis::Cluster::V1beta1::CloudRedisCluster::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::Redis::Cluster::V1beta1::GetClusterRequest.new - - # Call the get_cluster method. - result = client.get_cluster request - - # The returned object is of type Google::Cloud::Redis::Cluster::V1beta1::Cluster. - p result -end -# [END redis_v1beta1_generated_CloudRedisCluster_GetCluster_sync] diff --git a/owl-bot-staging/google-cloud-redis-cluster-v1beta1/snippets/cloud_redis_cluster/get_cluster_certificate_authority.rb b/owl-bot-staging/google-cloud-redis-cluster-v1beta1/snippets/cloud_redis_cluster/get_cluster_certificate_authority.rb deleted file mode 100644 index e5b88a2ead35..000000000000 --- a/owl-bot-staging/google-cloud-redis-cluster-v1beta1/snippets/cloud_redis_cluster/get_cluster_certificate_authority.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 redis_v1beta1_generated_CloudRedisCluster_GetClusterCertificateAuthority_sync] -require "google/cloud/redis/cluster/v1beta1" - -## -# Snippet for the get_cluster_certificate_authority call in the CloudRedisCluster service -# -# This snippet has been automatically generated and should be regarded as a code -# template only. It will require modifications to work: -# - It may require correct/in-range values for request initialization. -# - It may require specifying regional endpoints when creating the service -# client as shown in https://cloud.google.com/ruby/docs/reference. -# -# This is an auto-generated example demonstrating basic usage of -# Google::Cloud::Redis::Cluster::V1beta1::CloudRedisCluster::Client#get_cluster_certificate_authority. -# -def get_cluster_certificate_authority - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::Redis::Cluster::V1beta1::CloudRedisCluster::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::Redis::Cluster::V1beta1::GetClusterCertificateAuthorityRequest.new - - # Call the get_cluster_certificate_authority method. - result = client.get_cluster_certificate_authority request - - # The returned object is of type Google::Cloud::Redis::Cluster::V1beta1::CertificateAuthority. - p result -end -# [END redis_v1beta1_generated_CloudRedisCluster_GetClusterCertificateAuthority_sync] diff --git a/owl-bot-staging/google-cloud-redis-cluster-v1beta1/snippets/cloud_redis_cluster/list_backup_collections.rb b/owl-bot-staging/google-cloud-redis-cluster-v1beta1/snippets/cloud_redis_cluster/list_backup_collections.rb deleted file mode 100644 index ad3986e233a3..000000000000 --- a/owl-bot-staging/google-cloud-redis-cluster-v1beta1/snippets/cloud_redis_cluster/list_backup_collections.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 redis_v1beta1_generated_CloudRedisCluster_ListBackupCollections_sync] -require "google/cloud/redis/cluster/v1beta1" - -## -# Snippet for the list_backup_collections call in the CloudRedisCluster service -# -# This snippet has been automatically generated and should be regarded as a code -# template only. It will require modifications to work: -# - It may require correct/in-range values for request initialization. -# - It may require specifying regional endpoints when creating the service -# client as shown in https://cloud.google.com/ruby/docs/reference. -# -# This is an auto-generated example demonstrating basic usage of -# Google::Cloud::Redis::Cluster::V1beta1::CloudRedisCluster::Client#list_backup_collections. -# -def list_backup_collections - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::Redis::Cluster::V1beta1::CloudRedisCluster::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::Redis::Cluster::V1beta1::ListBackupCollectionsRequest.new - - # Call the list_backup_collections method. - result = client.list_backup_collections request - - # The returned object is of type Gapic::PagedEnumerable. You can iterate - # over elements, and API calls will be issued to fetch pages as needed. - result.each do |item| - # Each element is of type ::Google::Cloud::Redis::Cluster::V1beta1::BackupCollection. - p item - end -end -# [END redis_v1beta1_generated_CloudRedisCluster_ListBackupCollections_sync] diff --git a/owl-bot-staging/google-cloud-redis-cluster-v1beta1/snippets/cloud_redis_cluster/list_backups.rb b/owl-bot-staging/google-cloud-redis-cluster-v1beta1/snippets/cloud_redis_cluster/list_backups.rb deleted file mode 100644 index cd01f47c1522..000000000000 --- a/owl-bot-staging/google-cloud-redis-cluster-v1beta1/snippets/cloud_redis_cluster/list_backups.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 redis_v1beta1_generated_CloudRedisCluster_ListBackups_sync] -require "google/cloud/redis/cluster/v1beta1" - -## -# Snippet for the list_backups call in the CloudRedisCluster service -# -# This snippet has been automatically generated and should be regarded as a code -# template only. It will require modifications to work: -# - It may require correct/in-range values for request initialization. -# - It may require specifying regional endpoints when creating the service -# client as shown in https://cloud.google.com/ruby/docs/reference. -# -# This is an auto-generated example demonstrating basic usage of -# Google::Cloud::Redis::Cluster::V1beta1::CloudRedisCluster::Client#list_backups. -# -def list_backups - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::Redis::Cluster::V1beta1::CloudRedisCluster::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::Redis::Cluster::V1beta1::ListBackupsRequest.new - - # Call the list_backups method. - result = client.list_backups request - - # The returned object is of type Gapic::PagedEnumerable. You can iterate - # over elements, and API calls will be issued to fetch pages as needed. - result.each do |item| - # Each element is of type ::Google::Cloud::Redis::Cluster::V1beta1::Backup. - p item - end -end -# [END redis_v1beta1_generated_CloudRedisCluster_ListBackups_sync] diff --git a/owl-bot-staging/google-cloud-redis-cluster-v1beta1/snippets/cloud_redis_cluster/list_clusters.rb b/owl-bot-staging/google-cloud-redis-cluster-v1beta1/snippets/cloud_redis_cluster/list_clusters.rb deleted file mode 100644 index eecf60935fcf..000000000000 --- a/owl-bot-staging/google-cloud-redis-cluster-v1beta1/snippets/cloud_redis_cluster/list_clusters.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 redis_v1beta1_generated_CloudRedisCluster_ListClusters_sync] -require "google/cloud/redis/cluster/v1beta1" - -## -# Snippet for the list_clusters call in the CloudRedisCluster service -# -# This snippet has been automatically generated and should be regarded as a code -# template only. It will require modifications to work: -# - It may require correct/in-range values for request initialization. -# - It may require specifying regional endpoints when creating the service -# client as shown in https://cloud.google.com/ruby/docs/reference. -# -# This is an auto-generated example demonstrating basic usage of -# Google::Cloud::Redis::Cluster::V1beta1::CloudRedisCluster::Client#list_clusters. -# -def list_clusters - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::Redis::Cluster::V1beta1::CloudRedisCluster::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::Redis::Cluster::V1beta1::ListClustersRequest.new - - # Call the list_clusters method. - result = client.list_clusters request - - # The returned object is of type Gapic::PagedEnumerable. You can iterate - # over elements, and API calls will be issued to fetch pages as needed. - result.each do |item| - # Each element is of type ::Google::Cloud::Redis::Cluster::V1beta1::Cluster. - p item - end -end -# [END redis_v1beta1_generated_CloudRedisCluster_ListClusters_sync] diff --git a/owl-bot-staging/google-cloud-redis-cluster-v1beta1/snippets/cloud_redis_cluster/reschedule_cluster_maintenance.rb b/owl-bot-staging/google-cloud-redis-cluster-v1beta1/snippets/cloud_redis_cluster/reschedule_cluster_maintenance.rb deleted file mode 100644 index 0f6991ad3882..000000000000 --- a/owl-bot-staging/google-cloud-redis-cluster-v1beta1/snippets/cloud_redis_cluster/reschedule_cluster_maintenance.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 redis_v1beta1_generated_CloudRedisCluster_RescheduleClusterMaintenance_sync] -require "google/cloud/redis/cluster/v1beta1" - -## -# Snippet for the reschedule_cluster_maintenance call in the CloudRedisCluster service -# -# This snippet has been automatically generated and should be regarded as a code -# template only. It will require modifications to work: -# - It may require correct/in-range values for request initialization. -# - It may require specifying regional endpoints when creating the service -# client as shown in https://cloud.google.com/ruby/docs/reference. -# -# This is an auto-generated example demonstrating basic usage of -# Google::Cloud::Redis::Cluster::V1beta1::CloudRedisCluster::Client#reschedule_cluster_maintenance. -# -def reschedule_cluster_maintenance - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::Redis::Cluster::V1beta1::CloudRedisCluster::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::Redis::Cluster::V1beta1::RescheduleClusterMaintenanceRequest.new - - # Call the reschedule_cluster_maintenance method. - result = client.reschedule_cluster_maintenance 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 redis_v1beta1_generated_CloudRedisCluster_RescheduleClusterMaintenance_sync] diff --git a/owl-bot-staging/google-cloud-redis-cluster-v1beta1/snippets/cloud_redis_cluster/update_cluster.rb b/owl-bot-staging/google-cloud-redis-cluster-v1beta1/snippets/cloud_redis_cluster/update_cluster.rb deleted file mode 100644 index d626b00ee718..000000000000 --- a/owl-bot-staging/google-cloud-redis-cluster-v1beta1/snippets/cloud_redis_cluster/update_cluster.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 redis_v1beta1_generated_CloudRedisCluster_UpdateCluster_sync] -require "google/cloud/redis/cluster/v1beta1" - -## -# Snippet for the update_cluster call in the CloudRedisCluster service -# -# This snippet has been automatically generated and should be regarded as a code -# template only. It will require modifications to work: -# - It may require correct/in-range values for request initialization. -# - It may require specifying regional endpoints when creating the service -# client as shown in https://cloud.google.com/ruby/docs/reference. -# -# This is an auto-generated example demonstrating basic usage of -# Google::Cloud::Redis::Cluster::V1beta1::CloudRedisCluster::Client#update_cluster. -# -def update_cluster - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::Redis::Cluster::V1beta1::CloudRedisCluster::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::Redis::Cluster::V1beta1::UpdateClusterRequest.new - - # Call the update_cluster method. - result = client.update_cluster 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 redis_v1beta1_generated_CloudRedisCluster_UpdateCluster_sync] diff --git a/owl-bot-staging/google-cloud-redis-cluster-v1beta1/snippets/snippet_metadata_google.cloud.redis.cluster.v1beta1.json b/owl-bot-staging/google-cloud-redis-cluster-v1beta1/snippets/snippet_metadata_google.cloud.redis.cluster.v1beta1.json deleted file mode 100644 index 7e3369688058..000000000000 --- a/owl-bot-staging/google-cloud-redis-cluster-v1beta1/snippets/snippet_metadata_google.cloud.redis.cluster.v1beta1.json +++ /dev/null @@ -1,575 +0,0 @@ -{ - "client_library": { - "name": "google-cloud-redis-cluster-v1beta1", - "version": "", - "language": "RUBY", - "apis": [ - { - "id": "google.cloud.redis.cluster.v1beta1", - "version": "v1beta1" - } - ] - }, - "snippets": [ - { - "region_tag": "redis_v1beta1_generated_CloudRedisCluster_ListClusters_sync", - "title": "Snippet for the list_clusters call in the CloudRedisCluster service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Redis::Cluster::V1beta1::CloudRedisCluster::Client#list_clusters.", - "file": "cloud_redis_cluster/list_clusters.rb", - "language": "RUBY", - "client_method": { - "short_name": "list_clusters", - "full_name": "::Google::Cloud::Redis::Cluster::V1beta1::CloudRedisCluster::Client#list_clusters", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::Redis::Cluster::V1beta1::ListClustersRequest", - "name": "request" - } - ], - "result_type": "::Google::Cloud::Redis::Cluster::V1beta1::ListClustersResponse", - "client": { - "short_name": "CloudRedisCluster::Client", - "full_name": "::Google::Cloud::Redis::Cluster::V1beta1::CloudRedisCluster::Client" - }, - "method": { - "short_name": "ListClusters", - "full_name": "google.cloud.redis.cluster.v1beta1.CloudRedisCluster.ListClusters", - "service": { - "short_name": "CloudRedisCluster", - "full_name": "google.cloud.redis.cluster.v1beta1.CloudRedisCluster" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 50, - "type": "FULL" - } - ] - }, - { - "region_tag": "redis_v1beta1_generated_CloudRedisCluster_GetCluster_sync", - "title": "Snippet for the get_cluster call in the CloudRedisCluster service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Redis::Cluster::V1beta1::CloudRedisCluster::Client#get_cluster.", - "file": "cloud_redis_cluster/get_cluster.rb", - "language": "RUBY", - "client_method": { - "short_name": "get_cluster", - "full_name": "::Google::Cloud::Redis::Cluster::V1beta1::CloudRedisCluster::Client#get_cluster", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::Redis::Cluster::V1beta1::GetClusterRequest", - "name": "request" - } - ], - "result_type": "::Google::Cloud::Redis::Cluster::V1beta1::Cluster", - "client": { - "short_name": "CloudRedisCluster::Client", - "full_name": "::Google::Cloud::Redis::Cluster::V1beta1::CloudRedisCluster::Client" - }, - "method": { - "short_name": "GetCluster", - "full_name": "google.cloud.redis.cluster.v1beta1.CloudRedisCluster.GetCluster", - "service": { - "short_name": "CloudRedisCluster", - "full_name": "google.cloud.redis.cluster.v1beta1.CloudRedisCluster" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 46, - "type": "FULL" - } - ] - }, - { - "region_tag": "redis_v1beta1_generated_CloudRedisCluster_UpdateCluster_sync", - "title": "Snippet for the update_cluster call in the CloudRedisCluster service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Redis::Cluster::V1beta1::CloudRedisCluster::Client#update_cluster.", - "file": "cloud_redis_cluster/update_cluster.rb", - "language": "RUBY", - "client_method": { - "short_name": "update_cluster", - "full_name": "::Google::Cloud::Redis::Cluster::V1beta1::CloudRedisCluster::Client#update_cluster", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::Redis::Cluster::V1beta1::UpdateClusterRequest", - "name": "request" - } - ], - "result_type": "::Google::Longrunning::Operation", - "client": { - "short_name": "CloudRedisCluster::Client", - "full_name": "::Google::Cloud::Redis::Cluster::V1beta1::CloudRedisCluster::Client" - }, - "method": { - "short_name": "UpdateCluster", - "full_name": "google.cloud.redis.cluster.v1beta1.CloudRedisCluster.UpdateCluster", - "service": { - "short_name": "CloudRedisCluster", - "full_name": "google.cloud.redis.cluster.v1beta1.CloudRedisCluster" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 53, - "type": "FULL" - } - ] - }, - { - "region_tag": "redis_v1beta1_generated_CloudRedisCluster_DeleteCluster_sync", - "title": "Snippet for the delete_cluster call in the CloudRedisCluster service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Redis::Cluster::V1beta1::CloudRedisCluster::Client#delete_cluster.", - "file": "cloud_redis_cluster/delete_cluster.rb", - "language": "RUBY", - "client_method": { - "short_name": "delete_cluster", - "full_name": "::Google::Cloud::Redis::Cluster::V1beta1::CloudRedisCluster::Client#delete_cluster", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::Redis::Cluster::V1beta1::DeleteClusterRequest", - "name": "request" - } - ], - "result_type": "::Google::Longrunning::Operation", - "client": { - "short_name": "CloudRedisCluster::Client", - "full_name": "::Google::Cloud::Redis::Cluster::V1beta1::CloudRedisCluster::Client" - }, - "method": { - "short_name": "DeleteCluster", - "full_name": "google.cloud.redis.cluster.v1beta1.CloudRedisCluster.DeleteCluster", - "service": { - "short_name": "CloudRedisCluster", - "full_name": "google.cloud.redis.cluster.v1beta1.CloudRedisCluster" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 53, - "type": "FULL" - } - ] - }, - { - "region_tag": "redis_v1beta1_generated_CloudRedisCluster_CreateCluster_sync", - "title": "Snippet for the create_cluster call in the CloudRedisCluster service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Redis::Cluster::V1beta1::CloudRedisCluster::Client#create_cluster.", - "file": "cloud_redis_cluster/create_cluster.rb", - "language": "RUBY", - "client_method": { - "short_name": "create_cluster", - "full_name": "::Google::Cloud::Redis::Cluster::V1beta1::CloudRedisCluster::Client#create_cluster", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::Redis::Cluster::V1beta1::CreateClusterRequest", - "name": "request" - } - ], - "result_type": "::Google::Longrunning::Operation", - "client": { - "short_name": "CloudRedisCluster::Client", - "full_name": "::Google::Cloud::Redis::Cluster::V1beta1::CloudRedisCluster::Client" - }, - "method": { - "short_name": "CreateCluster", - "full_name": "google.cloud.redis.cluster.v1beta1.CloudRedisCluster.CreateCluster", - "service": { - "short_name": "CloudRedisCluster", - "full_name": "google.cloud.redis.cluster.v1beta1.CloudRedisCluster" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 53, - "type": "FULL" - } - ] - }, - { - "region_tag": "redis_v1beta1_generated_CloudRedisCluster_GetClusterCertificateAuthority_sync", - "title": "Snippet for the get_cluster_certificate_authority call in the CloudRedisCluster service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Redis::Cluster::V1beta1::CloudRedisCluster::Client#get_cluster_certificate_authority.", - "file": "cloud_redis_cluster/get_cluster_certificate_authority.rb", - "language": "RUBY", - "client_method": { - "short_name": "get_cluster_certificate_authority", - "full_name": "::Google::Cloud::Redis::Cluster::V1beta1::CloudRedisCluster::Client#get_cluster_certificate_authority", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::Redis::Cluster::V1beta1::GetClusterCertificateAuthorityRequest", - "name": "request" - } - ], - "result_type": "::Google::Cloud::Redis::Cluster::V1beta1::CertificateAuthority", - "client": { - "short_name": "CloudRedisCluster::Client", - "full_name": "::Google::Cloud::Redis::Cluster::V1beta1::CloudRedisCluster::Client" - }, - "method": { - "short_name": "GetClusterCertificateAuthority", - "full_name": "google.cloud.redis.cluster.v1beta1.CloudRedisCluster.GetClusterCertificateAuthority", - "service": { - "short_name": "CloudRedisCluster", - "full_name": "google.cloud.redis.cluster.v1beta1.CloudRedisCluster" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 46, - "type": "FULL" - } - ] - }, - { - "region_tag": "redis_v1beta1_generated_CloudRedisCluster_RescheduleClusterMaintenance_sync", - "title": "Snippet for the reschedule_cluster_maintenance call in the CloudRedisCluster service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Redis::Cluster::V1beta1::CloudRedisCluster::Client#reschedule_cluster_maintenance.", - "file": "cloud_redis_cluster/reschedule_cluster_maintenance.rb", - "language": "RUBY", - "client_method": { - "short_name": "reschedule_cluster_maintenance", - "full_name": "::Google::Cloud::Redis::Cluster::V1beta1::CloudRedisCluster::Client#reschedule_cluster_maintenance", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::Redis::Cluster::V1beta1::RescheduleClusterMaintenanceRequest", - "name": "request" - } - ], - "result_type": "::Google::Longrunning::Operation", - "client": { - "short_name": "CloudRedisCluster::Client", - "full_name": "::Google::Cloud::Redis::Cluster::V1beta1::CloudRedisCluster::Client" - }, - "method": { - "short_name": "RescheduleClusterMaintenance", - "full_name": "google.cloud.redis.cluster.v1beta1.CloudRedisCluster.RescheduleClusterMaintenance", - "service": { - "short_name": "CloudRedisCluster", - "full_name": "google.cloud.redis.cluster.v1beta1.CloudRedisCluster" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 53, - "type": "FULL" - } - ] - }, - { - "region_tag": "redis_v1beta1_generated_CloudRedisCluster_ListBackupCollections_sync", - "title": "Snippet for the list_backup_collections call in the CloudRedisCluster service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Redis::Cluster::V1beta1::CloudRedisCluster::Client#list_backup_collections.", - "file": "cloud_redis_cluster/list_backup_collections.rb", - "language": "RUBY", - "client_method": { - "short_name": "list_backup_collections", - "full_name": "::Google::Cloud::Redis::Cluster::V1beta1::CloudRedisCluster::Client#list_backup_collections", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::Redis::Cluster::V1beta1::ListBackupCollectionsRequest", - "name": "request" - } - ], - "result_type": "::Google::Cloud::Redis::Cluster::V1beta1::ListBackupCollectionsResponse", - "client": { - "short_name": "CloudRedisCluster::Client", - "full_name": "::Google::Cloud::Redis::Cluster::V1beta1::CloudRedisCluster::Client" - }, - "method": { - "short_name": "ListBackupCollections", - "full_name": "google.cloud.redis.cluster.v1beta1.CloudRedisCluster.ListBackupCollections", - "service": { - "short_name": "CloudRedisCluster", - "full_name": "google.cloud.redis.cluster.v1beta1.CloudRedisCluster" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 50, - "type": "FULL" - } - ] - }, - { - "region_tag": "redis_v1beta1_generated_CloudRedisCluster_GetBackupCollection_sync", - "title": "Snippet for the get_backup_collection call in the CloudRedisCluster service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Redis::Cluster::V1beta1::CloudRedisCluster::Client#get_backup_collection.", - "file": "cloud_redis_cluster/get_backup_collection.rb", - "language": "RUBY", - "client_method": { - "short_name": "get_backup_collection", - "full_name": "::Google::Cloud::Redis::Cluster::V1beta1::CloudRedisCluster::Client#get_backup_collection", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::Redis::Cluster::V1beta1::GetBackupCollectionRequest", - "name": "request" - } - ], - "result_type": "::Google::Cloud::Redis::Cluster::V1beta1::BackupCollection", - "client": { - "short_name": "CloudRedisCluster::Client", - "full_name": "::Google::Cloud::Redis::Cluster::V1beta1::CloudRedisCluster::Client" - }, - "method": { - "short_name": "GetBackupCollection", - "full_name": "google.cloud.redis.cluster.v1beta1.CloudRedisCluster.GetBackupCollection", - "service": { - "short_name": "CloudRedisCluster", - "full_name": "google.cloud.redis.cluster.v1beta1.CloudRedisCluster" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 46, - "type": "FULL" - } - ] - }, - { - "region_tag": "redis_v1beta1_generated_CloudRedisCluster_ListBackups_sync", - "title": "Snippet for the list_backups call in the CloudRedisCluster service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Redis::Cluster::V1beta1::CloudRedisCluster::Client#list_backups.", - "file": "cloud_redis_cluster/list_backups.rb", - "language": "RUBY", - "client_method": { - "short_name": "list_backups", - "full_name": "::Google::Cloud::Redis::Cluster::V1beta1::CloudRedisCluster::Client#list_backups", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::Redis::Cluster::V1beta1::ListBackupsRequest", - "name": "request" - } - ], - "result_type": "::Google::Cloud::Redis::Cluster::V1beta1::ListBackupsResponse", - "client": { - "short_name": "CloudRedisCluster::Client", - "full_name": "::Google::Cloud::Redis::Cluster::V1beta1::CloudRedisCluster::Client" - }, - "method": { - "short_name": "ListBackups", - "full_name": "google.cloud.redis.cluster.v1beta1.CloudRedisCluster.ListBackups", - "service": { - "short_name": "CloudRedisCluster", - "full_name": "google.cloud.redis.cluster.v1beta1.CloudRedisCluster" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 50, - "type": "FULL" - } - ] - }, - { - "region_tag": "redis_v1beta1_generated_CloudRedisCluster_GetBackup_sync", - "title": "Snippet for the get_backup call in the CloudRedisCluster service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Redis::Cluster::V1beta1::CloudRedisCluster::Client#get_backup.", - "file": "cloud_redis_cluster/get_backup.rb", - "language": "RUBY", - "client_method": { - "short_name": "get_backup", - "full_name": "::Google::Cloud::Redis::Cluster::V1beta1::CloudRedisCluster::Client#get_backup", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::Redis::Cluster::V1beta1::GetBackupRequest", - "name": "request" - } - ], - "result_type": "::Google::Cloud::Redis::Cluster::V1beta1::Backup", - "client": { - "short_name": "CloudRedisCluster::Client", - "full_name": "::Google::Cloud::Redis::Cluster::V1beta1::CloudRedisCluster::Client" - }, - "method": { - "short_name": "GetBackup", - "full_name": "google.cloud.redis.cluster.v1beta1.CloudRedisCluster.GetBackup", - "service": { - "short_name": "CloudRedisCluster", - "full_name": "google.cloud.redis.cluster.v1beta1.CloudRedisCluster" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 46, - "type": "FULL" - } - ] - }, - { - "region_tag": "redis_v1beta1_generated_CloudRedisCluster_DeleteBackup_sync", - "title": "Snippet for the delete_backup call in the CloudRedisCluster service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Redis::Cluster::V1beta1::CloudRedisCluster::Client#delete_backup.", - "file": "cloud_redis_cluster/delete_backup.rb", - "language": "RUBY", - "client_method": { - "short_name": "delete_backup", - "full_name": "::Google::Cloud::Redis::Cluster::V1beta1::CloudRedisCluster::Client#delete_backup", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::Redis::Cluster::V1beta1::DeleteBackupRequest", - "name": "request" - } - ], - "result_type": "::Google::Longrunning::Operation", - "client": { - "short_name": "CloudRedisCluster::Client", - "full_name": "::Google::Cloud::Redis::Cluster::V1beta1::CloudRedisCluster::Client" - }, - "method": { - "short_name": "DeleteBackup", - "full_name": "google.cloud.redis.cluster.v1beta1.CloudRedisCluster.DeleteBackup", - "service": { - "short_name": "CloudRedisCluster", - "full_name": "google.cloud.redis.cluster.v1beta1.CloudRedisCluster" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 53, - "type": "FULL" - } - ] - }, - { - "region_tag": "redis_v1beta1_generated_CloudRedisCluster_ExportBackup_sync", - "title": "Snippet for the export_backup call in the CloudRedisCluster service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Redis::Cluster::V1beta1::CloudRedisCluster::Client#export_backup.", - "file": "cloud_redis_cluster/export_backup.rb", - "language": "RUBY", - "client_method": { - "short_name": "export_backup", - "full_name": "::Google::Cloud::Redis::Cluster::V1beta1::CloudRedisCluster::Client#export_backup", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::Redis::Cluster::V1beta1::ExportBackupRequest", - "name": "request" - } - ], - "result_type": "::Google::Longrunning::Operation", - "client": { - "short_name": "CloudRedisCluster::Client", - "full_name": "::Google::Cloud::Redis::Cluster::V1beta1::CloudRedisCluster::Client" - }, - "method": { - "short_name": "ExportBackup", - "full_name": "google.cloud.redis.cluster.v1beta1.CloudRedisCluster.ExportBackup", - "service": { - "short_name": "CloudRedisCluster", - "full_name": "google.cloud.redis.cluster.v1beta1.CloudRedisCluster" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 53, - "type": "FULL" - } - ] - }, - { - "region_tag": "redis_v1beta1_generated_CloudRedisCluster_BackupCluster_sync", - "title": "Snippet for the backup_cluster call in the CloudRedisCluster service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Redis::Cluster::V1beta1::CloudRedisCluster::Client#backup_cluster.", - "file": "cloud_redis_cluster/backup_cluster.rb", - "language": "RUBY", - "client_method": { - "short_name": "backup_cluster", - "full_name": "::Google::Cloud::Redis::Cluster::V1beta1::CloudRedisCluster::Client#backup_cluster", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::Redis::Cluster::V1beta1::BackupClusterRequest", - "name": "request" - } - ], - "result_type": "::Google::Longrunning::Operation", - "client": { - "short_name": "CloudRedisCluster::Client", - "full_name": "::Google::Cloud::Redis::Cluster::V1beta1::CloudRedisCluster::Client" - }, - "method": { - "short_name": "BackupCluster", - "full_name": "google.cloud.redis.cluster.v1beta1.CloudRedisCluster.BackupCluster", - "service": { - "short_name": "CloudRedisCluster", - "full_name": "google.cloud.redis.cluster.v1beta1.CloudRedisCluster" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 53, - "type": "FULL" - } - ] - } - ] -} \ No newline at end of file diff --git a/owl-bot-staging/google-cloud-redis-cluster-v1beta1/test/google/cloud/redis/cluster/v1beta1/cloud_redis_cluster_operations_test.rb b/owl-bot-staging/google-cloud-redis-cluster-v1beta1/test/google/cloud/redis/cluster/v1beta1/cloud_redis_cluster_operations_test.rb deleted file mode 100644 index 7d3baf4c1ca7..000000000000 --- a/owl-bot-staging/google-cloud-redis-cluster-v1beta1/test/google/cloud/redis/cluster/v1beta1/cloud_redis_cluster_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/cloud/redis/cluster/v1beta1/cloud_redis_cluster_pb" -require "google/cloud/redis/cluster/v1beta1/cloud_redis_cluster_services_pb" -require "google/cloud/redis/cluster/v1beta1/cloud_redis_cluster" - -class ::Google::Cloud::Redis::Cluster::V1beta1::CloudRedisCluster::OperationsTest < Minitest::Test - class ClientStub - attr_accessor :call_rpc_count, :requests - - def initialize response, operation, &block - @response = response - @operation = operation - @block = block - @call_rpc_count = 0 - @requests = [] - end - - def call_rpc *args, **kwargs - @call_rpc_count += 1 - - @requests << @block&.call(*args, **kwargs) - - catch :response do - yield @response, @operation if block_given? - @response - end - end - - def endpoint - "endpoint.example.com" - end - - def universe_domain - "example.com" - end - - def stub_logger - nil - end - - def logger - nil - end - end - - def test_list_operations - # Create GRPC objects. - grpc_response = ::Google::Longrunning::ListOperationsResponse.new - grpc_operation = GRPC::ActiveCall::Operation.new nil - grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - grpc_options = {} - - # Create request parameters for a unary method. - name = "hello world" - filter = "hello world" - page_size = 42 - page_token = "hello world" - return_partial_success = true - - list_operations_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :list_operations, name - assert_kind_of ::Google::Longrunning::ListOperationsRequest, request - assert_equal "hello world", request["name"] - assert_equal "hello world", request["filter"] - assert_equal 42, request["page_size"] - assert_equal "hello world", request["page_token"] - assert_equal true, request["return_partial_success"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, list_operations_client_stub do - # Create client - client = ::Google::Cloud::Redis::Cluster::V1beta1::CloudRedisCluster::Operations.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.list_operations({ name: name, filter: filter, page_size: page_size, page_token: page_token, return_partial_success: return_partial_success }) do |response, operation| - assert_kind_of Gapic::PagedEnumerable, response - assert_equal grpc_response, response.response - assert_equal grpc_operation, operation - end - - # Use named arguments - client.list_operations name: name, filter: filter, page_size: page_size, page_token: page_token, return_partial_success: return_partial_success do |response, operation| - assert_kind_of Gapic::PagedEnumerable, response - assert_equal grpc_response, response.response - assert_equal grpc_operation, operation - end - - # Use protobuf object - client.list_operations ::Google::Longrunning::ListOperationsRequest.new(name: name, filter: filter, page_size: page_size, page_token: page_token, return_partial_success: return_partial_success) do |response, operation| - assert_kind_of Gapic::PagedEnumerable, response - assert_equal grpc_response, response.response - assert_equal grpc_operation, operation - end - - # Use hash object with options - client.list_operations({ name: name, filter: filter, page_size: page_size, page_token: page_token, return_partial_success: return_partial_success }, grpc_options) do |response, operation| - assert_kind_of Gapic::PagedEnumerable, response - assert_equal grpc_response, response.response - assert_equal grpc_operation, operation - end - - # Use protobuf object with options - client.list_operations(::Google::Longrunning::ListOperationsRequest.new(name: name, filter: filter, page_size: page_size, page_token: page_token, return_partial_success: return_partial_success), grpc_options) do |response, operation| - assert_kind_of Gapic::PagedEnumerable, response - assert_equal grpc_response, response.response - assert_equal grpc_operation, operation - end - - # Verify method calls - assert_equal 5, list_operations_client_stub.call_rpc_count - end - end - - def test_get_operation - # Create GRPC objects. - grpc_response = ::Google::Longrunning::Operation.new - grpc_operation = GRPC::ActiveCall::Operation.new nil - grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - grpc_options = {} - - # Create request parameters for a unary method. - name = "hello world" - - get_operation_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :get_operation, name - assert_kind_of ::Google::Longrunning::GetOperationRequest, request - assert_equal "hello world", request["name"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, get_operation_client_stub do - # Create client - client = ::Google::Cloud::Redis::Cluster::V1beta1::CloudRedisCluster::Operations.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.get_operation({ name: name }) do |response, operation| - assert_kind_of Gapic::Operation, response - assert_equal grpc_response, response.grpc_op - assert_equal grpc_operation, operation - end - - # Use named arguments - client.get_operation name: name do |response, operation| - assert_kind_of Gapic::Operation, response - assert_equal grpc_response, response.grpc_op - assert_equal grpc_operation, operation - end - - # Use protobuf object - client.get_operation ::Google::Longrunning::GetOperationRequest.new(name: name) do |response, operation| - assert_kind_of Gapic::Operation, response - assert_equal grpc_response, response.grpc_op - assert_equal grpc_operation, operation - end - - # Use hash object with options - client.get_operation({ name: name }, grpc_options) do |response, operation| - assert_kind_of Gapic::Operation, response - assert_equal grpc_response, response.grpc_op - assert_equal grpc_operation, operation - end - - # Use protobuf object with options - client.get_operation(::Google::Longrunning::GetOperationRequest.new(name: name), grpc_options) do |response, operation| - assert_kind_of Gapic::Operation, response - assert_equal grpc_response, response.grpc_op - assert_equal grpc_operation, operation - end - - # Verify method calls - assert_equal 5, get_operation_client_stub.call_rpc_count - end - end - - def test_delete_operation - # Create GRPC objects. - grpc_response = ::Google::Protobuf::Empty.new - grpc_operation = GRPC::ActiveCall::Operation.new nil - grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - grpc_options = {} - - # Create request parameters for a unary method. - name = "hello world" - - delete_operation_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :delete_operation, name - assert_kind_of ::Google::Longrunning::DeleteOperationRequest, request - assert_equal "hello world", request["name"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, delete_operation_client_stub do - # Create client - client = ::Google::Cloud::Redis::Cluster::V1beta1::CloudRedisCluster::Operations.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.delete_operation({ name: name }) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use named arguments - client.delete_operation name: name do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object - client.delete_operation ::Google::Longrunning::DeleteOperationRequest.new(name: name) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use hash object with options - client.delete_operation({ name: name }, grpc_options) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object with options - client.delete_operation(::Google::Longrunning::DeleteOperationRequest.new(name: name), grpc_options) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Verify method calls - assert_equal 5, delete_operation_client_stub.call_rpc_count - end - end - - def test_cancel_operation - # Create GRPC objects. - grpc_response = ::Google::Protobuf::Empty.new - grpc_operation = GRPC::ActiveCall::Operation.new nil - grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - grpc_options = {} - - # Create request parameters for a unary method. - name = "hello world" - - cancel_operation_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :cancel_operation, name - assert_kind_of ::Google::Longrunning::CancelOperationRequest, request - assert_equal "hello world", request["name"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, cancel_operation_client_stub do - # Create client - client = ::Google::Cloud::Redis::Cluster::V1beta1::CloudRedisCluster::Operations.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.cancel_operation({ name: name }) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use named arguments - client.cancel_operation name: name do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object - client.cancel_operation ::Google::Longrunning::CancelOperationRequest.new(name: name) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use hash object with options - client.cancel_operation({ name: name }, grpc_options) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object with options - client.cancel_operation(::Google::Longrunning::CancelOperationRequest.new(name: name), grpc_options) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Verify method calls - assert_equal 5, cancel_operation_client_stub.call_rpc_count - end - end - - def test_wait_operation - # Create GRPC objects. - grpc_response = ::Google::Longrunning::Operation.new - grpc_operation = GRPC::ActiveCall::Operation.new nil - grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - grpc_options = {} - - # Create request parameters for a unary method. - name = "hello world" - timeout = {} - - wait_operation_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :wait_operation, name - assert_kind_of ::Google::Longrunning::WaitOperationRequest, request - assert_equal "hello world", request["name"] - assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Protobuf::Duration), request["timeout"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, wait_operation_client_stub do - # Create client - client = ::Google::Cloud::Redis::Cluster::V1beta1::CloudRedisCluster::Operations.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.wait_operation({ name: name, timeout: timeout }) do |response, operation| - assert_kind_of Gapic::Operation, response - assert_equal grpc_response, response.grpc_op - assert_equal grpc_operation, operation - end - - # Use named arguments - client.wait_operation name: name, timeout: timeout do |response, operation| - assert_kind_of Gapic::Operation, response - assert_equal grpc_response, response.grpc_op - assert_equal grpc_operation, operation - end - - # Use protobuf object - client.wait_operation ::Google::Longrunning::WaitOperationRequest.new(name: name, timeout: timeout) do |response, operation| - assert_kind_of Gapic::Operation, response - assert_equal grpc_response, response.grpc_op - assert_equal grpc_operation, operation - end - - # Use hash object with options - client.wait_operation({ name: name, timeout: timeout }, grpc_options) do |response, operation| - assert_kind_of Gapic::Operation, response - assert_equal grpc_response, response.grpc_op - assert_equal grpc_operation, operation - end - - # Use protobuf object with options - client.wait_operation(::Google::Longrunning::WaitOperationRequest.new(name: name, timeout: timeout), grpc_options) do |response, operation| - assert_kind_of Gapic::Operation, response - assert_equal grpc_response, response.grpc_op - assert_equal grpc_operation, operation - end - - # Verify method calls - assert_equal 5, wait_operation_client_stub.call_rpc_count - end - end - - def test_configure - grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - - client = block_config = config = nil - dummy_stub = ClientStub.new nil, nil - Gapic::ServiceStub.stub :new, dummy_stub do - client = ::Google::Cloud::Redis::Cluster::V1beta1::CloudRedisCluster::Operations.new do |config| - config.credentials = grpc_channel - end - end - - config = client.configure do |c| - block_config = c - end - - assert_same block_config, config - assert_kind_of ::Google::Cloud::Redis::Cluster::V1beta1::CloudRedisCluster::Operations::Configuration, config - end -end diff --git a/owl-bot-staging/google-cloud-redis-cluster-v1beta1/test/google/cloud/redis/cluster/v1beta1/cloud_redis_cluster_paths_test.rb b/owl-bot-staging/google-cloud-redis-cluster-v1beta1/test/google/cloud/redis/cluster/v1beta1/cloud_redis_cluster_paths_test.rb deleted file mode 100644 index 26bfd76d5d1c..000000000000 --- a/owl-bot-staging/google-cloud-redis-cluster-v1beta1/test/google/cloud/redis/cluster/v1beta1/cloud_redis_cluster_paths_test.rb +++ /dev/null @@ -1,163 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -require "helper" - -require "gapic/grpc/service_stub" - -require "google/cloud/redis/cluster/v1beta1/cloud_redis_cluster" - -class ::Google::Cloud::Redis::Cluster::V1beta1::CloudRedisCluster::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_backup_path - grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - ::Gapic::ServiceStub.stub :new, DummyStub.new do - client = ::Google::Cloud::Redis::Cluster::V1beta1::CloudRedisCluster::Client.new do |config| - config.credentials = grpc_channel - end - - path = client.backup_path project: "value0", location: "value1", backup_collection: "value2", backup: "value3" - assert_equal "projects/value0/locations/value1/backupCollections/value2/backups/value3", path - end - end - - def test_backup_collection_path - grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - ::Gapic::ServiceStub.stub :new, DummyStub.new do - client = ::Google::Cloud::Redis::Cluster::V1beta1::CloudRedisCluster::Client.new do |config| - config.credentials = grpc_channel - end - - path = client.backup_collection_path project: "value0", location: "value1", backup_collection: "value2" - assert_equal "projects/value0/locations/value1/backupCollections/value2", path - end - end - - def test_certificate_authority_path - grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - ::Gapic::ServiceStub.stub :new, DummyStub.new do - client = ::Google::Cloud::Redis::Cluster::V1beta1::CloudRedisCluster::Client.new do |config| - config.credentials = grpc_channel - end - - path = client.certificate_authority_path project: "value0", location: "value1", cluster: "value2" - assert_equal "projects/value0/locations/value1/clusters/value2/certificateAuthority", path - end - end - - def test_cluster_path - grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - ::Gapic::ServiceStub.stub :new, DummyStub.new do - client = ::Google::Cloud::Redis::Cluster::V1beta1::CloudRedisCluster::Client.new do |config| - config.credentials = grpc_channel - end - - path = client.cluster_path project: "value0", location: "value1", cluster: "value2" - assert_equal "projects/value0/locations/value1/clusters/value2", path - end - end - - def test_crypto_key_path - grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - ::Gapic::ServiceStub.stub :new, DummyStub.new do - client = ::Google::Cloud::Redis::Cluster::V1beta1::CloudRedisCluster::Client.new do |config| - config.credentials = grpc_channel - end - - path = client.crypto_key_path project: "value0", location: "value1", key_ring: "value2", crypto_key: "value3" - assert_equal "projects/value0/locations/value1/keyRings/value2/cryptoKeys/value3", path - end - end - - def test_crypto_key_version_path - grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - ::Gapic::ServiceStub.stub :new, DummyStub.new do - client = ::Google::Cloud::Redis::Cluster::V1beta1::CloudRedisCluster::Client.new do |config| - config.credentials = grpc_channel - end - - path = client.crypto_key_version_path project: "value0", location: "value1", key_ring: "value2", crypto_key: "value3", crypto_key_version: "value4" - assert_equal "projects/value0/locations/value1/keyRings/value2/cryptoKeys/value3/cryptoKeyVersions/value4", path - end - end - - def test_forwarding_rule_path - grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - ::Gapic::ServiceStub.stub :new, DummyStub.new do - client = ::Google::Cloud::Redis::Cluster::V1beta1::CloudRedisCluster::Client.new do |config| - config.credentials = grpc_channel - end - - path = client.forwarding_rule_path project: "value0", region: "value1", forwarding_rule: "value2" - assert_equal "projects/value0/regions/value1/forwardingRules/value2", path - end - end - - def test_location_path - grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - ::Gapic::ServiceStub.stub :new, DummyStub.new do - client = ::Google::Cloud::Redis::Cluster::V1beta1::CloudRedisCluster::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_network_path - grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - ::Gapic::ServiceStub.stub :new, DummyStub.new do - client = ::Google::Cloud::Redis::Cluster::V1beta1::CloudRedisCluster::Client.new do |config| - config.credentials = grpc_channel - end - - path = client.network_path project: "value0", network: "value1" - assert_equal "projects/value0/global/networks/value1", path - end - end - - def test_service_attachment_path - grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - ::Gapic::ServiceStub.stub :new, DummyStub.new do - client = ::Google::Cloud::Redis::Cluster::V1beta1::CloudRedisCluster::Client.new do |config| - config.credentials = grpc_channel - end - - path = client.service_attachment_path project: "value0", region: "value1", service_attachment: "value2" - assert_equal "projects/value0/regions/value1/serviceAttachments/value2", path - end - end -end diff --git a/owl-bot-staging/google-cloud-redis-cluster-v1beta1/test/google/cloud/redis/cluster/v1beta1/cloud_redis_cluster_rest_test.rb b/owl-bot-staging/google-cloud-redis-cluster-v1beta1/test/google/cloud/redis/cluster/v1beta1/cloud_redis_cluster_rest_test.rb deleted file mode 100644 index 906ca29bdc78..000000000000 --- a/owl-bot-staging/google-cloud-redis-cluster-v1beta1/test/google/cloud/redis/cluster/v1beta1/cloud_redis_cluster_rest_test.rb +++ /dev/null @@ -1,873 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -require "helper" -require "gapic/rest" -require "google/cloud/redis/cluster/v1beta1/cloud_redis_cluster_pb" -require "google/cloud/redis/cluster/v1beta1/cloud_redis_cluster/rest" - - -class ::Google::Cloud::Redis::Cluster::V1beta1::CloudRedisCluster::Rest::ClientTest < Minitest::Test - class ClientStub - attr_accessor :call_count, :requests - - def initialize response, &block - @response = response - @block = block - @call_count = 0 - @requests = [] - end - - def make_get_request uri:, params: {}, options: {}, method_name: nil - make_http_request :get, uri: uri, body: nil, params: params, options: options, method_name: method_name - end - - def make_delete_request uri:, params: {}, options: {}, method_name: nil - make_http_request :delete, uri: uri, body: nil, params: params, options: options, method_name: method_name - end - - def make_post_request uri:, body: nil, params: {}, options: {}, method_name: nil - make_http_request :post, uri: uri, body: body, params: params, options: options, method_name: method_name - end - - def make_patch_request uri:, body:, params: {}, options: {}, method_name: nil - make_http_request :patch, uri: uri, body: body, params: params, options: options, method_name: method_name - end - - def make_put_request uri:, body:, params: {}, options: {}, method_name: nil - make_http_request :put, uri: uri, body: body, params: params, options: options, method_name: method_name - end - - def make_http_request *args, **kwargs - @call_count += 1 - - @requests << @block&.call(*args, **kwargs) - - @response - end - - def endpoint - "endpoint.example.com" - end - - def universe_domain - "example.com" - end - - def stub_logger - nil - end - - def logger - nil - end - end - - def test_list_clusters - # Create test objects. - client_result = ::Google::Cloud::Redis::Cluster::V1beta1::ListClustersResponse.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_clusters_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| - assert options.metadata.key? :"x-goog-api-client" - assert options.metadata[:"x-goog-api-client"].include? "rest" - refute options.metadata[:"x-goog-api-client"].include? "grpc" - end - - ::Google::Cloud::Redis::Cluster::V1beta1::CloudRedisCluster::Rest::ServiceStub.stub :transcode_list_clusters_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, list_clusters_client_stub do - # Create client - client = ::Google::Cloud::Redis::Cluster::V1beta1::CloudRedisCluster::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - client.list_clusters({ 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_clusters 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_clusters ::Google::Cloud::Redis::Cluster::V1beta1::ListClustersRequest.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_clusters({ 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_clusters(::Google::Cloud::Redis::Cluster::V1beta1::ListClustersRequest.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_clusters_client_stub.call_count - end - end - end - - def test_get_cluster - # Create test objects. - client_result = ::Google::Cloud::Redis::Cluster::V1beta1::Cluster.new - http_response = OpenStruct.new body: client_result.to_json - - call_options = {} - - # Create request parameters for a unary method. - name = "hello world" - - get_cluster_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| - assert options.metadata.key? :"x-goog-api-client" - assert options.metadata[:"x-goog-api-client"].include? "rest" - refute options.metadata[:"x-goog-api-client"].include? "grpc" - end - - ::Google::Cloud::Redis::Cluster::V1beta1::CloudRedisCluster::Rest::ServiceStub.stub :transcode_get_cluster_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, get_cluster_client_stub do - # Create client - client = ::Google::Cloud::Redis::Cluster::V1beta1::CloudRedisCluster::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - client.get_cluster({ name: name }) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use named arguments - client.get_cluster name: name do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object - client.get_cluster ::Google::Cloud::Redis::Cluster::V1beta1::GetClusterRequest.new(name: name) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use hash object with options - client.get_cluster({ name: name }, call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object with options - client.get_cluster(::Google::Cloud::Redis::Cluster::V1beta1::GetClusterRequest.new(name: name), call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Verify method calls - assert_equal 5, get_cluster_client_stub.call_count - end - end - end - - def test_update_cluster - # 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. - update_mask = {} - cluster = {} - request_id = "hello world" - - update_cluster_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| - assert options.metadata.key? :"x-goog-api-client" - assert options.metadata[:"x-goog-api-client"].include? "rest" - refute options.metadata[:"x-goog-api-client"].include? "grpc" - end - - ::Google::Cloud::Redis::Cluster::V1beta1::CloudRedisCluster::Rest::ServiceStub.stub :transcode_update_cluster_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, update_cluster_client_stub do - # Create client - client = ::Google::Cloud::Redis::Cluster::V1beta1::CloudRedisCluster::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - client.update_cluster({ update_mask: update_mask, cluster: cluster, request_id: request_id }) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use named arguments - client.update_cluster update_mask: update_mask, cluster: cluster, request_id: request_id do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object - client.update_cluster ::Google::Cloud::Redis::Cluster::V1beta1::UpdateClusterRequest.new(update_mask: update_mask, cluster: cluster, request_id: request_id) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use hash object with options - client.update_cluster({ update_mask: update_mask, cluster: cluster, request_id: request_id }, call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object with options - client.update_cluster(::Google::Cloud::Redis::Cluster::V1beta1::UpdateClusterRequest.new(update_mask: update_mask, cluster: cluster, request_id: request_id), call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Verify method calls - assert_equal 5, update_cluster_client_stub.call_count - end - end - end - - def test_delete_cluster - # 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" - request_id = "hello world" - - delete_cluster_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| - assert options.metadata.key? :"x-goog-api-client" - assert options.metadata[:"x-goog-api-client"].include? "rest" - refute options.metadata[:"x-goog-api-client"].include? "grpc" - end - - ::Google::Cloud::Redis::Cluster::V1beta1::CloudRedisCluster::Rest::ServiceStub.stub :transcode_delete_cluster_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, delete_cluster_client_stub do - # Create client - client = ::Google::Cloud::Redis::Cluster::V1beta1::CloudRedisCluster::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - client.delete_cluster({ name: name, request_id: request_id }) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use named arguments - client.delete_cluster name: name, request_id: request_id do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object - client.delete_cluster ::Google::Cloud::Redis::Cluster::V1beta1::DeleteClusterRequest.new(name: name, request_id: request_id) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use hash object with options - client.delete_cluster({ name: name, request_id: request_id }, call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object with options - client.delete_cluster(::Google::Cloud::Redis::Cluster::V1beta1::DeleteClusterRequest.new(name: name, request_id: request_id), call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Verify method calls - assert_equal 5, delete_cluster_client_stub.call_count - end - end - end - - def test_create_cluster - # 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" - cluster_id = "hello world" - cluster = {} - request_id = "hello world" - - create_cluster_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| - assert options.metadata.key? :"x-goog-api-client" - assert options.metadata[:"x-goog-api-client"].include? "rest" - refute options.metadata[:"x-goog-api-client"].include? "grpc" - end - - ::Google::Cloud::Redis::Cluster::V1beta1::CloudRedisCluster::Rest::ServiceStub.stub :transcode_create_cluster_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, create_cluster_client_stub do - # Create client - client = ::Google::Cloud::Redis::Cluster::V1beta1::CloudRedisCluster::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - client.create_cluster({ parent: parent, cluster_id: cluster_id, cluster: cluster, request_id: request_id }) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use named arguments - client.create_cluster parent: parent, cluster_id: cluster_id, cluster: cluster, request_id: request_id do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object - client.create_cluster ::Google::Cloud::Redis::Cluster::V1beta1::CreateClusterRequest.new(parent: parent, cluster_id: cluster_id, cluster: cluster, request_id: request_id) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use hash object with options - client.create_cluster({ parent: parent, cluster_id: cluster_id, cluster: cluster, request_id: request_id }, call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object with options - client.create_cluster(::Google::Cloud::Redis::Cluster::V1beta1::CreateClusterRequest.new(parent: parent, cluster_id: cluster_id, cluster: cluster, request_id: request_id), call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Verify method calls - assert_equal 5, create_cluster_client_stub.call_count - end - end - end - - def test_get_cluster_certificate_authority - # Create test objects. - client_result = ::Google::Cloud::Redis::Cluster::V1beta1::CertificateAuthority.new - http_response = OpenStruct.new body: client_result.to_json - - call_options = {} - - # Create request parameters for a unary method. - name = "hello world" - - get_cluster_certificate_authority_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| - assert options.metadata.key? :"x-goog-api-client" - assert options.metadata[:"x-goog-api-client"].include? "rest" - refute options.metadata[:"x-goog-api-client"].include? "grpc" - end - - ::Google::Cloud::Redis::Cluster::V1beta1::CloudRedisCluster::Rest::ServiceStub.stub :transcode_get_cluster_certificate_authority_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, get_cluster_certificate_authority_client_stub do - # Create client - client = ::Google::Cloud::Redis::Cluster::V1beta1::CloudRedisCluster::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - client.get_cluster_certificate_authority({ name: name }) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use named arguments - client.get_cluster_certificate_authority name: name do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object - client.get_cluster_certificate_authority ::Google::Cloud::Redis::Cluster::V1beta1::GetClusterCertificateAuthorityRequest.new(name: name) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use hash object with options - client.get_cluster_certificate_authority({ name: name }, call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object with options - client.get_cluster_certificate_authority(::Google::Cloud::Redis::Cluster::V1beta1::GetClusterCertificateAuthorityRequest.new(name: name), call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Verify method calls - assert_equal 5, get_cluster_certificate_authority_client_stub.call_count - end - end - end - - def test_reschedule_cluster_maintenance - # 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" - reschedule_type = :RESCHEDULE_TYPE_UNSPECIFIED - schedule_time = {} - - reschedule_cluster_maintenance_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| - assert options.metadata.key? :"x-goog-api-client" - assert options.metadata[:"x-goog-api-client"].include? "rest" - refute options.metadata[:"x-goog-api-client"].include? "grpc" - end - - ::Google::Cloud::Redis::Cluster::V1beta1::CloudRedisCluster::Rest::ServiceStub.stub :transcode_reschedule_cluster_maintenance_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, reschedule_cluster_maintenance_client_stub do - # Create client - client = ::Google::Cloud::Redis::Cluster::V1beta1::CloudRedisCluster::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - client.reschedule_cluster_maintenance({ name: name, reschedule_type: reschedule_type, schedule_time: schedule_time }) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use named arguments - client.reschedule_cluster_maintenance name: name, reschedule_type: reschedule_type, schedule_time: schedule_time do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object - client.reschedule_cluster_maintenance ::Google::Cloud::Redis::Cluster::V1beta1::RescheduleClusterMaintenanceRequest.new(name: name, reschedule_type: reschedule_type, schedule_time: schedule_time) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use hash object with options - client.reschedule_cluster_maintenance({ name: name, reschedule_type: reschedule_type, schedule_time: schedule_time }, call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object with options - client.reschedule_cluster_maintenance(::Google::Cloud::Redis::Cluster::V1beta1::RescheduleClusterMaintenanceRequest.new(name: name, reschedule_type: reschedule_type, schedule_time: schedule_time), call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Verify method calls - assert_equal 5, reschedule_cluster_maintenance_client_stub.call_count - end - end - end - - def test_list_backup_collections - # Create test objects. - client_result = ::Google::Cloud::Redis::Cluster::V1beta1::ListBackupCollectionsResponse.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_backup_collections_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| - assert options.metadata.key? :"x-goog-api-client" - assert options.metadata[:"x-goog-api-client"].include? "rest" - refute options.metadata[:"x-goog-api-client"].include? "grpc" - end - - ::Google::Cloud::Redis::Cluster::V1beta1::CloudRedisCluster::Rest::ServiceStub.stub :transcode_list_backup_collections_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, list_backup_collections_client_stub do - # Create client - client = ::Google::Cloud::Redis::Cluster::V1beta1::CloudRedisCluster::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - client.list_backup_collections({ 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_backup_collections 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_backup_collections ::Google::Cloud::Redis::Cluster::V1beta1::ListBackupCollectionsRequest.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_backup_collections({ 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_backup_collections(::Google::Cloud::Redis::Cluster::V1beta1::ListBackupCollectionsRequest.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_backup_collections_client_stub.call_count - end - end - end - - def test_get_backup_collection - # Create test objects. - client_result = ::Google::Cloud::Redis::Cluster::V1beta1::BackupCollection.new - http_response = OpenStruct.new body: client_result.to_json - - call_options = {} - - # Create request parameters for a unary method. - name = "hello world" - - get_backup_collection_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| - assert options.metadata.key? :"x-goog-api-client" - assert options.metadata[:"x-goog-api-client"].include? "rest" - refute options.metadata[:"x-goog-api-client"].include? "grpc" - end - - ::Google::Cloud::Redis::Cluster::V1beta1::CloudRedisCluster::Rest::ServiceStub.stub :transcode_get_backup_collection_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, get_backup_collection_client_stub do - # Create client - client = ::Google::Cloud::Redis::Cluster::V1beta1::CloudRedisCluster::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - client.get_backup_collection({ name: name }) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use named arguments - client.get_backup_collection name: name do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object - client.get_backup_collection ::Google::Cloud::Redis::Cluster::V1beta1::GetBackupCollectionRequest.new(name: name) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use hash object with options - client.get_backup_collection({ name: name }, call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object with options - client.get_backup_collection(::Google::Cloud::Redis::Cluster::V1beta1::GetBackupCollectionRequest.new(name: name), call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Verify method calls - assert_equal 5, get_backup_collection_client_stub.call_count - end - end - end - - def test_list_backups - # Create test objects. - client_result = ::Google::Cloud::Redis::Cluster::V1beta1::ListBackupsResponse.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_backups_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| - assert options.metadata.key? :"x-goog-api-client" - assert options.metadata[:"x-goog-api-client"].include? "rest" - refute options.metadata[:"x-goog-api-client"].include? "grpc" - end - - ::Google::Cloud::Redis::Cluster::V1beta1::CloudRedisCluster::Rest::ServiceStub.stub :transcode_list_backups_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, list_backups_client_stub do - # Create client - client = ::Google::Cloud::Redis::Cluster::V1beta1::CloudRedisCluster::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - client.list_backups({ 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_backups 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_backups ::Google::Cloud::Redis::Cluster::V1beta1::ListBackupsRequest.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_backups({ 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_backups(::Google::Cloud::Redis::Cluster::V1beta1::ListBackupsRequest.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_backups_client_stub.call_count - end - end - end - - def test_get_backup - # Create test objects. - client_result = ::Google::Cloud::Redis::Cluster::V1beta1::Backup.new - http_response = OpenStruct.new body: client_result.to_json - - call_options = {} - - # Create request parameters for a unary method. - name = "hello world" - - get_backup_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| - assert options.metadata.key? :"x-goog-api-client" - assert options.metadata[:"x-goog-api-client"].include? "rest" - refute options.metadata[:"x-goog-api-client"].include? "grpc" - end - - ::Google::Cloud::Redis::Cluster::V1beta1::CloudRedisCluster::Rest::ServiceStub.stub :transcode_get_backup_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, get_backup_client_stub do - # Create client - client = ::Google::Cloud::Redis::Cluster::V1beta1::CloudRedisCluster::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - client.get_backup({ name: name }) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use named arguments - client.get_backup name: name do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object - client.get_backup ::Google::Cloud::Redis::Cluster::V1beta1::GetBackupRequest.new(name: name) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use hash object with options - client.get_backup({ name: name }, call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object with options - client.get_backup(::Google::Cloud::Redis::Cluster::V1beta1::GetBackupRequest.new(name: name), call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Verify method calls - assert_equal 5, get_backup_client_stub.call_count - end - end - end - - def test_delete_backup - # 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" - request_id = "hello world" - - delete_backup_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| - assert options.metadata.key? :"x-goog-api-client" - assert options.metadata[:"x-goog-api-client"].include? "rest" - refute options.metadata[:"x-goog-api-client"].include? "grpc" - end - - ::Google::Cloud::Redis::Cluster::V1beta1::CloudRedisCluster::Rest::ServiceStub.stub :transcode_delete_backup_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, delete_backup_client_stub do - # Create client - client = ::Google::Cloud::Redis::Cluster::V1beta1::CloudRedisCluster::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - client.delete_backup({ name: name, request_id: request_id }) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use named arguments - client.delete_backup name: name, request_id: request_id do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object - client.delete_backup ::Google::Cloud::Redis::Cluster::V1beta1::DeleteBackupRequest.new(name: name, request_id: request_id) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use hash object with options - client.delete_backup({ name: name, request_id: request_id }, call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object with options - client.delete_backup(::Google::Cloud::Redis::Cluster::V1beta1::DeleteBackupRequest.new(name: name, request_id: request_id), call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Verify method calls - assert_equal 5, delete_backup_client_stub.call_count - end - end - end - - def test_export_backup - # 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. - gcs_bucket = "hello world" - name = "hello world" - - export_backup_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| - assert options.metadata.key? :"x-goog-api-client" - assert options.metadata[:"x-goog-api-client"].include? "rest" - refute options.metadata[:"x-goog-api-client"].include? "grpc" - end - - ::Google::Cloud::Redis::Cluster::V1beta1::CloudRedisCluster::Rest::ServiceStub.stub :transcode_export_backup_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, export_backup_client_stub do - # Create client - client = ::Google::Cloud::Redis::Cluster::V1beta1::CloudRedisCluster::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - client.export_backup({ gcs_bucket: gcs_bucket, name: name }) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use named arguments - client.export_backup gcs_bucket: gcs_bucket, name: name do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object - client.export_backup ::Google::Cloud::Redis::Cluster::V1beta1::ExportBackupRequest.new(gcs_bucket: gcs_bucket, name: name) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use hash object with options - client.export_backup({ gcs_bucket: gcs_bucket, name: name }, call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object with options - client.export_backup(::Google::Cloud::Redis::Cluster::V1beta1::ExportBackupRequest.new(gcs_bucket: gcs_bucket, name: name), call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Verify method calls - assert_equal 5, export_backup_client_stub.call_count - end - end - end - - def test_backup_cluster - # 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" - ttl = {} - backup_id = "hello world" - - backup_cluster_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| - assert options.metadata.key? :"x-goog-api-client" - assert options.metadata[:"x-goog-api-client"].include? "rest" - refute options.metadata[:"x-goog-api-client"].include? "grpc" - end - - ::Google::Cloud::Redis::Cluster::V1beta1::CloudRedisCluster::Rest::ServiceStub.stub :transcode_backup_cluster_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, backup_cluster_client_stub do - # Create client - client = ::Google::Cloud::Redis::Cluster::V1beta1::CloudRedisCluster::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - client.backup_cluster({ name: name, ttl: ttl, backup_id: backup_id }) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use named arguments - client.backup_cluster name: name, ttl: ttl, backup_id: backup_id do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object - client.backup_cluster ::Google::Cloud::Redis::Cluster::V1beta1::BackupClusterRequest.new(name: name, ttl: ttl, backup_id: backup_id) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use hash object with options - client.backup_cluster({ name: name, ttl: ttl, backup_id: backup_id }, call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object with options - client.backup_cluster(::Google::Cloud::Redis::Cluster::V1beta1::BackupClusterRequest.new(name: name, ttl: ttl, backup_id: backup_id), call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Verify method calls - assert_equal 5, backup_cluster_client_stub.call_count - end - end - end - - def test_configure - credentials_token = :dummy_value - - client = block_config = config = nil - dummy_stub = ClientStub.new nil - Gapic::Rest::ClientStub.stub :new, dummy_stub do - client = ::Google::Cloud::Redis::Cluster::V1beta1::CloudRedisCluster::Rest::Client.new do |config| - config.credentials = credentials_token - end - end - - config = client.configure do |c| - block_config = c - end - - assert_same block_config, config - assert_kind_of ::Google::Cloud::Redis::Cluster::V1beta1::CloudRedisCluster::Rest::Client::Configuration, config - end -end diff --git a/owl-bot-staging/google-cloud-redis-cluster-v1beta1/test/google/cloud/redis/cluster/v1beta1/cloud_redis_cluster_test.rb b/owl-bot-staging/google-cloud-redis-cluster-v1beta1/test/google/cloud/redis/cluster/v1beta1/cloud_redis_cluster_test.rb deleted file mode 100644 index 5699b33b9472..000000000000 --- a/owl-bot-staging/google-cloud-redis-cluster-v1beta1/test/google/cloud/redis/cluster/v1beta1/cloud_redis_cluster_test.rb +++ /dev/null @@ -1,1018 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -require "helper" - -require "gapic/grpc/service_stub" - -require "google/cloud/redis/cluster/v1beta1/cloud_redis_cluster_pb" -require "google/cloud/redis/cluster/v1beta1/cloud_redis_cluster" - -class ::Google::Cloud::Redis::Cluster::V1beta1::CloudRedisCluster::ClientTest < Minitest::Test - class ClientStub - attr_accessor :call_rpc_count, :requests - - def initialize response, operation, &block - @response = response - @operation = operation - @block = block - @call_rpc_count = 0 - @requests = [] - end - - def call_rpc *args, **kwargs - @call_rpc_count += 1 - - @requests << @block&.call(*args, **kwargs) - - catch :response do - yield @response, @operation if block_given? - @response - end - end - - def endpoint - "endpoint.example.com" - end - - def universe_domain - "example.com" - end - - def stub_logger - nil - end - - def logger - nil - end - end - - def test_list_clusters - # Create GRPC objects. - grpc_response = ::Google::Cloud::Redis::Cluster::V1beta1::ListClustersResponse.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_clusters_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :list_clusters, name - assert_kind_of ::Google::Cloud::Redis::Cluster::V1beta1::ListClustersRequest, 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_clusters_client_stub do - # Create client - client = ::Google::Cloud::Redis::Cluster::V1beta1::CloudRedisCluster::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.list_clusters({ 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_clusters 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_clusters ::Google::Cloud::Redis::Cluster::V1beta1::ListClustersRequest.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_clusters({ 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_clusters(::Google::Cloud::Redis::Cluster::V1beta1::ListClustersRequest.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_clusters_client_stub.call_rpc_count - end - end - - def test_get_cluster - # Create GRPC objects. - grpc_response = ::Google::Cloud::Redis::Cluster::V1beta1::Cluster.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_cluster_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :get_cluster, name - assert_kind_of ::Google::Cloud::Redis::Cluster::V1beta1::GetClusterRequest, request - assert_equal "hello world", request["name"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, get_cluster_client_stub do - # Create client - client = ::Google::Cloud::Redis::Cluster::V1beta1::CloudRedisCluster::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.get_cluster({ name: name }) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use named arguments - client.get_cluster name: name do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object - client.get_cluster ::Google::Cloud::Redis::Cluster::V1beta1::GetClusterRequest.new(name: name) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use hash object with options - client.get_cluster({ 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_cluster(::Google::Cloud::Redis::Cluster::V1beta1::GetClusterRequest.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_cluster_client_stub.call_rpc_count - end - end - - def test_update_cluster - # 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. - update_mask = {} - cluster = {} - request_id = "hello world" - - update_cluster_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :update_cluster, name - assert_kind_of ::Google::Cloud::Redis::Cluster::V1beta1::UpdateClusterRequest, request - assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Protobuf::FieldMask), request["update_mask"] - assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::Redis::Cluster::V1beta1::Cluster), request["cluster"] - assert_equal "hello world", request["request_id"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, update_cluster_client_stub do - # Create client - client = ::Google::Cloud::Redis::Cluster::V1beta1::CloudRedisCluster::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.update_cluster({ update_mask: update_mask, cluster: cluster, request_id: request_id }) do |response, operation| - assert_kind_of Gapic::Operation, response - assert_equal grpc_response, response.grpc_op - assert_equal grpc_operation, operation - end - - # Use named arguments - client.update_cluster update_mask: update_mask, cluster: cluster, request_id: request_id do |response, operation| - assert_kind_of Gapic::Operation, response - assert_equal grpc_response, response.grpc_op - assert_equal grpc_operation, operation - end - - # Use protobuf object - client.update_cluster ::Google::Cloud::Redis::Cluster::V1beta1::UpdateClusterRequest.new(update_mask: update_mask, cluster: cluster, request_id: request_id) do |response, operation| - assert_kind_of Gapic::Operation, response - assert_equal grpc_response, response.grpc_op - assert_equal grpc_operation, operation - end - - # Use hash object with options - client.update_cluster({ update_mask: update_mask, cluster: cluster, request_id: request_id }, grpc_options) do |response, operation| - assert_kind_of Gapic::Operation, response - assert_equal grpc_response, response.grpc_op - assert_equal grpc_operation, operation - end - - # Use protobuf object with options - client.update_cluster(::Google::Cloud::Redis::Cluster::V1beta1::UpdateClusterRequest.new(update_mask: update_mask, cluster: cluster, request_id: request_id), grpc_options) do |response, operation| - assert_kind_of Gapic::Operation, response - assert_equal grpc_response, response.grpc_op - assert_equal grpc_operation, operation - end - - # Verify method calls - assert_equal 5, update_cluster_client_stub.call_rpc_count - end - end - - def test_delete_cluster - # 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" - request_id = "hello world" - - delete_cluster_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :delete_cluster, name - assert_kind_of ::Google::Cloud::Redis::Cluster::V1beta1::DeleteClusterRequest, request - assert_equal "hello world", request["name"] - assert_equal "hello world", request["request_id"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, delete_cluster_client_stub do - # Create client - client = ::Google::Cloud::Redis::Cluster::V1beta1::CloudRedisCluster::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.delete_cluster({ name: name, request_id: request_id }) do |response, operation| - assert_kind_of Gapic::Operation, response - assert_equal grpc_response, response.grpc_op - assert_equal grpc_operation, operation - end - - # Use named arguments - client.delete_cluster name: name, request_id: request_id do |response, operation| - assert_kind_of Gapic::Operation, response - assert_equal grpc_response, response.grpc_op - assert_equal grpc_operation, operation - end - - # Use protobuf object - client.delete_cluster ::Google::Cloud::Redis::Cluster::V1beta1::DeleteClusterRequest.new(name: name, request_id: request_id) do |response, operation| - assert_kind_of Gapic::Operation, response - assert_equal grpc_response, response.grpc_op - assert_equal grpc_operation, operation - end - - # Use hash object with options - client.delete_cluster({ name: name, request_id: request_id }, grpc_options) do |response, operation| - assert_kind_of Gapic::Operation, response - assert_equal grpc_response, response.grpc_op - assert_equal grpc_operation, operation - end - - # Use protobuf object with options - client.delete_cluster(::Google::Cloud::Redis::Cluster::V1beta1::DeleteClusterRequest.new(name: name, request_id: request_id), grpc_options) do |response, operation| - assert_kind_of Gapic::Operation, response - assert_equal grpc_response, response.grpc_op - assert_equal grpc_operation, operation - end - - # Verify method calls - assert_equal 5, delete_cluster_client_stub.call_rpc_count - end - end - - def test_create_cluster - # 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" - cluster_id = "hello world" - cluster = {} - request_id = "hello world" - - create_cluster_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :create_cluster, name - assert_kind_of ::Google::Cloud::Redis::Cluster::V1beta1::CreateClusterRequest, request - assert_equal "hello world", request["parent"] - assert_equal "hello world", request["cluster_id"] - assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::Redis::Cluster::V1beta1::Cluster), request["cluster"] - assert_equal "hello world", request["request_id"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, create_cluster_client_stub do - # Create client - client = ::Google::Cloud::Redis::Cluster::V1beta1::CloudRedisCluster::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.create_cluster({ parent: parent, cluster_id: cluster_id, cluster: cluster, request_id: request_id }) do |response, operation| - assert_kind_of Gapic::Operation, response - assert_equal grpc_response, response.grpc_op - assert_equal grpc_operation, operation - end - - # Use named arguments - client.create_cluster parent: parent, cluster_id: cluster_id, cluster: cluster, request_id: request_id do |response, operation| - assert_kind_of Gapic::Operation, response - assert_equal grpc_response, response.grpc_op - assert_equal grpc_operation, operation - end - - # Use protobuf object - client.create_cluster ::Google::Cloud::Redis::Cluster::V1beta1::CreateClusterRequest.new(parent: parent, cluster_id: cluster_id, cluster: cluster, request_id: request_id) do |response, operation| - assert_kind_of Gapic::Operation, response - assert_equal grpc_response, response.grpc_op - assert_equal grpc_operation, operation - end - - # Use hash object with options - client.create_cluster({ parent: parent, cluster_id: cluster_id, cluster: cluster, request_id: request_id }, grpc_options) do |response, operation| - assert_kind_of Gapic::Operation, response - assert_equal grpc_response, response.grpc_op - assert_equal grpc_operation, operation - end - - # Use protobuf object with options - client.create_cluster(::Google::Cloud::Redis::Cluster::V1beta1::CreateClusterRequest.new(parent: parent, cluster_id: cluster_id, cluster: cluster, request_id: request_id), grpc_options) do |response, operation| - assert_kind_of Gapic::Operation, response - assert_equal grpc_response, response.grpc_op - assert_equal grpc_operation, operation - end - - # Verify method calls - assert_equal 5, create_cluster_client_stub.call_rpc_count - end - end - - def test_get_cluster_certificate_authority - # Create GRPC objects. - grpc_response = ::Google::Cloud::Redis::Cluster::V1beta1::CertificateAuthority.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_cluster_certificate_authority_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :get_cluster_certificate_authority, name - assert_kind_of ::Google::Cloud::Redis::Cluster::V1beta1::GetClusterCertificateAuthorityRequest, request - assert_equal "hello world", request["name"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, get_cluster_certificate_authority_client_stub do - # Create client - client = ::Google::Cloud::Redis::Cluster::V1beta1::CloudRedisCluster::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.get_cluster_certificate_authority({ name: name }) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use named arguments - client.get_cluster_certificate_authority name: name do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object - client.get_cluster_certificate_authority ::Google::Cloud::Redis::Cluster::V1beta1::GetClusterCertificateAuthorityRequest.new(name: name) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use hash object with options - client.get_cluster_certificate_authority({ 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_cluster_certificate_authority(::Google::Cloud::Redis::Cluster::V1beta1::GetClusterCertificateAuthorityRequest.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_cluster_certificate_authority_client_stub.call_rpc_count - end - end - - def test_reschedule_cluster_maintenance - # 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" - reschedule_type = :RESCHEDULE_TYPE_UNSPECIFIED - schedule_time = {} - - reschedule_cluster_maintenance_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :reschedule_cluster_maintenance, name - assert_kind_of ::Google::Cloud::Redis::Cluster::V1beta1::RescheduleClusterMaintenanceRequest, request - assert_equal "hello world", request["name"] - assert_equal :RESCHEDULE_TYPE_UNSPECIFIED, request["reschedule_type"] - assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Protobuf::Timestamp), request["schedule_time"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, reschedule_cluster_maintenance_client_stub do - # Create client - client = ::Google::Cloud::Redis::Cluster::V1beta1::CloudRedisCluster::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.reschedule_cluster_maintenance({ name: name, reschedule_type: reschedule_type, schedule_time: schedule_time }) 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.reschedule_cluster_maintenance name: name, reschedule_type: reschedule_type, schedule_time: schedule_time 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.reschedule_cluster_maintenance ::Google::Cloud::Redis::Cluster::V1beta1::RescheduleClusterMaintenanceRequest.new(name: name, reschedule_type: reschedule_type, schedule_time: schedule_time) 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.reschedule_cluster_maintenance({ name: name, reschedule_type: reschedule_type, schedule_time: schedule_time }, 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.reschedule_cluster_maintenance(::Google::Cloud::Redis::Cluster::V1beta1::RescheduleClusterMaintenanceRequest.new(name: name, reschedule_type: reschedule_type, schedule_time: schedule_time), 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, reschedule_cluster_maintenance_client_stub.call_rpc_count - end - end - - def test_list_backup_collections - # Create GRPC objects. - grpc_response = ::Google::Cloud::Redis::Cluster::V1beta1::ListBackupCollectionsResponse.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_backup_collections_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :list_backup_collections, name - assert_kind_of ::Google::Cloud::Redis::Cluster::V1beta1::ListBackupCollectionsRequest, 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_backup_collections_client_stub do - # Create client - client = ::Google::Cloud::Redis::Cluster::V1beta1::CloudRedisCluster::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.list_backup_collections({ 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_backup_collections 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_backup_collections ::Google::Cloud::Redis::Cluster::V1beta1::ListBackupCollectionsRequest.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_backup_collections({ 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_backup_collections(::Google::Cloud::Redis::Cluster::V1beta1::ListBackupCollectionsRequest.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_backup_collections_client_stub.call_rpc_count - end - end - - def test_get_backup_collection - # Create GRPC objects. - grpc_response = ::Google::Cloud::Redis::Cluster::V1beta1::BackupCollection.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_backup_collection_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :get_backup_collection, name - assert_kind_of ::Google::Cloud::Redis::Cluster::V1beta1::GetBackupCollectionRequest, request - assert_equal "hello world", request["name"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, get_backup_collection_client_stub do - # Create client - client = ::Google::Cloud::Redis::Cluster::V1beta1::CloudRedisCluster::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.get_backup_collection({ name: name }) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use named arguments - client.get_backup_collection name: name do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object - client.get_backup_collection ::Google::Cloud::Redis::Cluster::V1beta1::GetBackupCollectionRequest.new(name: name) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use hash object with options - client.get_backup_collection({ 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_backup_collection(::Google::Cloud::Redis::Cluster::V1beta1::GetBackupCollectionRequest.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_backup_collection_client_stub.call_rpc_count - end - end - - def test_list_backups - # Create GRPC objects. - grpc_response = ::Google::Cloud::Redis::Cluster::V1beta1::ListBackupsResponse.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_backups_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :list_backups, name - assert_kind_of ::Google::Cloud::Redis::Cluster::V1beta1::ListBackupsRequest, 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_backups_client_stub do - # Create client - client = ::Google::Cloud::Redis::Cluster::V1beta1::CloudRedisCluster::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.list_backups({ 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_backups 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_backups ::Google::Cloud::Redis::Cluster::V1beta1::ListBackupsRequest.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_backups({ 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_backups(::Google::Cloud::Redis::Cluster::V1beta1::ListBackupsRequest.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_backups_client_stub.call_rpc_count - end - end - - def test_get_backup - # Create GRPC objects. - grpc_response = ::Google::Cloud::Redis::Cluster::V1beta1::Backup.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_backup_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :get_backup, name - assert_kind_of ::Google::Cloud::Redis::Cluster::V1beta1::GetBackupRequest, request - assert_equal "hello world", request["name"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, get_backup_client_stub do - # Create client - client = ::Google::Cloud::Redis::Cluster::V1beta1::CloudRedisCluster::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.get_backup({ name: name }) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use named arguments - client.get_backup name: name do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object - client.get_backup ::Google::Cloud::Redis::Cluster::V1beta1::GetBackupRequest.new(name: name) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use hash object with options - client.get_backup({ 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_backup(::Google::Cloud::Redis::Cluster::V1beta1::GetBackupRequest.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_backup_client_stub.call_rpc_count - end - end - - def test_delete_backup - # 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" - request_id = "hello world" - - delete_backup_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :delete_backup, name - assert_kind_of ::Google::Cloud::Redis::Cluster::V1beta1::DeleteBackupRequest, request - assert_equal "hello world", request["name"] - assert_equal "hello world", request["request_id"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, delete_backup_client_stub do - # Create client - client = ::Google::Cloud::Redis::Cluster::V1beta1::CloudRedisCluster::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.delete_backup({ name: name, request_id: request_id }) do |response, operation| - assert_kind_of Gapic::Operation, response - assert_equal grpc_response, response.grpc_op - assert_equal grpc_operation, operation - end - - # Use named arguments - client.delete_backup name: name, request_id: request_id do |response, operation| - assert_kind_of Gapic::Operation, response - assert_equal grpc_response, response.grpc_op - assert_equal grpc_operation, operation - end - - # Use protobuf object - client.delete_backup ::Google::Cloud::Redis::Cluster::V1beta1::DeleteBackupRequest.new(name: name, request_id: request_id) do |response, operation| - assert_kind_of Gapic::Operation, response - assert_equal grpc_response, response.grpc_op - assert_equal grpc_operation, operation - end - - # Use hash object with options - client.delete_backup({ name: name, request_id: request_id }, grpc_options) do |response, operation| - assert_kind_of Gapic::Operation, response - assert_equal grpc_response, response.grpc_op - assert_equal grpc_operation, operation - end - - # Use protobuf object with options - client.delete_backup(::Google::Cloud::Redis::Cluster::V1beta1::DeleteBackupRequest.new(name: name, request_id: request_id), grpc_options) do |response, operation| - assert_kind_of Gapic::Operation, response - assert_equal grpc_response, response.grpc_op - assert_equal grpc_operation, operation - end - - # Verify method calls - assert_equal 5, delete_backup_client_stub.call_rpc_count - end - end - - def test_export_backup - # 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. - gcs_bucket = "hello world" - name = "hello world" - - export_backup_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :export_backup, name - assert_kind_of ::Google::Cloud::Redis::Cluster::V1beta1::ExportBackupRequest, request - assert_equal "hello world", request["gcs_bucket"] - assert_equal :gcs_bucket, request.destination - assert_equal "hello world", request["name"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, export_backup_client_stub do - # Create client - client = ::Google::Cloud::Redis::Cluster::V1beta1::CloudRedisCluster::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.export_backup({ gcs_bucket: gcs_bucket, 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.export_backup gcs_bucket: gcs_bucket, 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.export_backup ::Google::Cloud::Redis::Cluster::V1beta1::ExportBackupRequest.new(gcs_bucket: gcs_bucket, 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.export_backup({ gcs_bucket: gcs_bucket, 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.export_backup(::Google::Cloud::Redis::Cluster::V1beta1::ExportBackupRequest.new(gcs_bucket: gcs_bucket, 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, export_backup_client_stub.call_rpc_count - end - end - - def test_backup_cluster - # 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" - ttl = {} - backup_id = "hello world" - - backup_cluster_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :backup_cluster, name - assert_kind_of ::Google::Cloud::Redis::Cluster::V1beta1::BackupClusterRequest, request - assert_equal "hello world", request["name"] - assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Protobuf::Duration), request["ttl"] - assert_equal "hello world", request["backup_id"] - assert request.has_backup_id? - refute_nil options - end - - Gapic::ServiceStub.stub :new, backup_cluster_client_stub do - # Create client - client = ::Google::Cloud::Redis::Cluster::V1beta1::CloudRedisCluster::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.backup_cluster({ name: name, ttl: ttl, backup_id: backup_id }) do |response, operation| - assert_kind_of Gapic::Operation, response - assert_equal grpc_response, response.grpc_op - assert_equal grpc_operation, operation - end - - # Use named arguments - client.backup_cluster name: name, ttl: ttl, backup_id: backup_id do |response, operation| - assert_kind_of Gapic::Operation, response - assert_equal grpc_response, response.grpc_op - assert_equal grpc_operation, operation - end - - # Use protobuf object - client.backup_cluster ::Google::Cloud::Redis::Cluster::V1beta1::BackupClusterRequest.new(name: name, ttl: ttl, backup_id: backup_id) do |response, operation| - assert_kind_of Gapic::Operation, response - assert_equal grpc_response, response.grpc_op - assert_equal grpc_operation, operation - end - - # Use hash object with options - client.backup_cluster({ name: name, ttl: ttl, backup_id: backup_id }, grpc_options) do |response, operation| - assert_kind_of Gapic::Operation, response - assert_equal grpc_response, response.grpc_op - assert_equal grpc_operation, operation - end - - # Use protobuf object with options - client.backup_cluster(::Google::Cloud::Redis::Cluster::V1beta1::BackupClusterRequest.new(name: name, ttl: ttl, backup_id: backup_id), grpc_options) do |response, operation| - assert_kind_of Gapic::Operation, response - assert_equal grpc_response, response.grpc_op - assert_equal grpc_operation, operation - end - - # Verify method calls - assert_equal 5, backup_cluster_client_stub.call_rpc_count - end - end - - def test_configure - grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - - client = block_config = config = nil - dummy_stub = ClientStub.new nil, nil - Gapic::ServiceStub.stub :new, dummy_stub do - client = ::Google::Cloud::Redis::Cluster::V1beta1::CloudRedisCluster::Client.new do |config| - config.credentials = grpc_channel - end - end - - config = client.configure do |c| - block_config = c - end - - assert_same block_config, config - assert_kind_of ::Google::Cloud::Redis::Cluster::V1beta1::CloudRedisCluster::Client::Configuration, config - end - - def test_credentials - key = OpenSSL::PKey::RSA.new 2048 - cred_json = { - "private_key" => key.to_pem, - "client_email" => "app@developer.gserviceaccount.com", - "type" => "service_account" - } - key_file = StringIO.new cred_json.to_json - creds = Google::Auth::ServiceAccountCredentials.make_creds({ json_key_io: key_file }) - - dummy_stub = ClientStub.new nil, nil - Gapic::ServiceStub.stub :new, dummy_stub do - client = ::Google::Cloud::Redis::Cluster::V1beta1::CloudRedisCluster::Client.new do |config| - config.credentials = creds - end - assert_kind_of ::Google::Cloud::Redis::Cluster::V1beta1::CloudRedisCluster::Client, client - assert_equal creds, client.configure.credentials - end - end - - def test_operations_client - grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - - client = nil - dummy_stub = ClientStub.new nil, nil - Gapic::ServiceStub.stub :new, dummy_stub do - client = ::Google::Cloud::Redis::Cluster::V1beta1::CloudRedisCluster::Client.new do |config| - config.credentials = grpc_channel - end - end - - assert_kind_of ::Google::Cloud::Redis::Cluster::V1beta1::CloudRedisCluster::Operations, client.operations_client - end -end diff --git a/owl-bot-staging/google-cloud-redis-cluster-v1beta1/test/helper.rb b/owl-bot-staging/google-cloud-redis-cluster-v1beta1/test/helper.rb deleted file mode 100644 index 672b337030e7..000000000000 --- a/owl-bot-staging/google-cloud-redis-cluster-v1beta1/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" diff --git a/owl-bot-staging/google-cloud-redis-v1/.gitignore b/owl-bot-staging/google-cloud-redis-v1/.gitignore deleted file mode 100644 index 0135b6bc6cfc..000000000000 --- a/owl-bot-staging/google-cloud-redis-v1/.gitignore +++ /dev/null @@ -1,22 +0,0 @@ -# Ignore bundler lockfiles -Gemfile.lock -gems.locked - -# Ignore documentation output -doc/* -.yardoc/* - -# Ignore test output -coverage/* - -# Ignore build artifacts -pkg/* - -# Ignore files commonly present in certain dev environments -.vagrant -.DS_STORE -.idea -*.iml - -# Ignore synth output -__pycache__ diff --git a/owl-bot-staging/google-cloud-redis-v1/.repo-metadata.json b/owl-bot-staging/google-cloud-redis-v1/.repo-metadata.json deleted file mode 100644 index 2a5bec164822..000000000000 --- a/owl-bot-staging/google-cloud-redis-v1/.repo-metadata.json +++ /dev/null @@ -1,18 +0,0 @@ -{ - "api_id": "redis.googleapis.com", - "api_shortname": "redis", - "client_documentation": "https://cloud.google.com/ruby/docs/reference/google-cloud-redis-v1/latest", - "distribution_name": "google-cloud-redis-v1", - "is_cloud": true, - "language": "ruby", - "name": "redis", - "name_pretty": "Google Cloud Memorystore for Redis V1 API", - "product_documentation": "https://cloud.google.com/memorystore/docs/redis", - "release_level": "unreleased", - "repo": "googleapis/google-cloud-ruby", - "requires_billing": true, - "ruby-cloud-description": "Creates and manages Redis instances on the Google Cloud Platform. Note that google-cloud-redis-v1 is a version-specific client library. For most uses, we recommend installing the main client library google-cloud-redis instead. See the readme for more details.", - "ruby-cloud-env-prefix": "REDIS", - "ruby-cloud-product-url": "https://cloud.google.com/memorystore/docs/redis", - "library_type": "GAPIC_AUTO" -} diff --git a/owl-bot-staging/google-cloud-redis-v1/.rubocop.yml b/owl-bot-staging/google-cloud-redis-v1/.rubocop.yml deleted file mode 100644 index b21553825e68..000000000000 --- a/owl-bot-staging/google-cloud-redis-v1/.rubocop.yml +++ /dev/null @@ -1,33 +0,0 @@ -inherit_gem: - google-style: google-style.yml - -AllCops: - Exclude: - - "google-cloud-redis-v1.gemspec" - - "lib/**/*_pb.rb" - - "proto_docs/**/*" - - "test/**/*" - - "acceptance/**/*" - - "samples/acceptance/**/*" - - "Rakefile" - -Layout/LineLength: - Enabled: false -Metrics/AbcSize: - Enabled: false -Metrics/ClassLength: - Enabled: false -Metrics/CyclomaticComplexity: - Enabled: false -Metrics/MethodLength: - Enabled: false -Metrics/ModuleLength: - Enabled: false -Metrics/PerceivedComplexity: - Enabled: false -Naming/AccessorMethodName: - Exclude: - - "snippets/**/*.rb" -Naming/FileName: - Exclude: - - "lib/google-cloud-redis-v1.rb" diff --git a/owl-bot-staging/google-cloud-redis-v1/.toys.rb b/owl-bot-staging/google-cloud-redis-v1/.toys.rb deleted file mode 100644 index 177e22456e8a..000000000000 --- a/owl-bot-staging/google-cloud-redis-v1/.toys.rb +++ /dev/null @@ -1,28 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -toys_version! ">= 0.15.3" - -if ENV["RUBY_COMMON_TOOLS"] - common_tools_dir = File.expand_path ENV["RUBY_COMMON_TOOLS"] - load File.join(common_tools_dir, "toys", "gapic") -else - load_git remote: "https://github.com/googleapis/ruby-common-tools.git", - path: "toys/gapic", - update: true -end diff --git a/owl-bot-staging/google-cloud-redis-v1/.yardopts b/owl-bot-staging/google-cloud-redis-v1/.yardopts deleted file mode 100644 index 6b73bdb64053..000000000000 --- a/owl-bot-staging/google-cloud-redis-v1/.yardopts +++ /dev/null @@ -1,12 +0,0 @@ ---no-private ---title="Google Cloud Memorystore for Redis V1 API" ---exclude _pb\.rb$ ---markup markdown ---markup-provider redcarpet - -./lib/**/*.rb -./proto_docs/**/*.rb -- -README.md -LICENSE.md -AUTHENTICATION.md diff --git a/owl-bot-staging/google-cloud-redis-v1/AUTHENTICATION.md b/owl-bot-staging/google-cloud-redis-v1/AUTHENTICATION.md deleted file mode 100644 index b7e2faf35a8e..000000000000 --- a/owl-bot-staging/google-cloud-redis-v1/AUTHENTICATION.md +++ /dev/null @@ -1,122 +0,0 @@ -# Authentication - -The recommended way to authenticate to the google-cloud-redis-v1 library is to use -[Application Default Credentials (ADC)](https://cloud.google.com/docs/authentication/application-default-credentials). -To review all of your authentication options, see [Credentials lookup](#credential-lookup). - -## Quickstart - -The following example shows how to set up authentication for a local development -environment with your user credentials. - -**NOTE:** This method is _not_ recommended for running in production. User credentials -should be used only during development. - -1. [Download and install the Google Cloud CLI](https://cloud.google.com/sdk). -2. Set up a local ADC file with your user credentials: - -```sh -gcloud auth application-default login -``` - -3. Write code as if already authenticated. - -For more information about setting up authentication for a local development environment, see -[Set up Application Default Credentials](https://cloud.google.com/docs/authentication/provide-credentials-adc#local-dev). - -## Credential Lookup - -The google-cloud-redis-v1 library provides several mechanisms to configure your system. -Generally, using Application Default Credentials to facilitate automatic -credentials discovery is the easist method. But if you need to explicitly specify -credentials, there are several methods available to you. - -Credentials are accepted in the following ways, in the following order or precedence: - -1. Credentials specified in method arguments -2. Credentials specified in configuration -3. Credentials pointed to or included in environment variables -4. Credentials found in local ADC file -5. Credentials returned by the metadata server for the attached service account (GCP) - -### Configuration - -You can configure a path to a JSON credentials file, either for an individual client object or -globally, for all client objects. The JSON file can contain credentials created for -[workload identity federation](https://cloud.google.com/iam/docs/workload-identity-federation), -[workforce identity federation](https://cloud.google.com/iam/docs/workforce-identity-federation), or a -[service account key](https://cloud.google.com/docs/authentication/provide-credentials-adc#local-key). - -Note: Service account keys are a security risk if not managed correctly. You should -[choose a more secure alternative to service account keys](https://cloud.google.com/docs/authentication#auth-decision-tree) -whenever possible. - -To configure a credentials file for an individual client initialization: - -```ruby -require "google/cloud/redis/v1" - -client = ::Google::Cloud::Redis::V1::CloudRedis::Client.new do |config| - config.credentials = "path/to/credentialfile.json" -end -``` - -To configure a credentials file globally for all clients: - -```ruby -require "google/cloud/redis/v1" - -::Google::Cloud::Redis::V1::CloudRedis::Client.configure do |config| - config.credentials = "path/to/credentialfile.json" -end - -client = ::Google::Cloud::Redis::V1::CloudRedis::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-redis-v1 -checks for credentials are: - -* `GOOGLE_CLOUD_CREDENTIALS` - Path to JSON file, or JSON contents -* `GOOGLE_APPLICATION_CREDENTIALS` - Path to JSON file - -```ruby -require "google/cloud/redis/v1" - -ENV["GOOGLE_APPLICATION_CREDENTIALS"] = "path/to/credentialfile.json" - -client = ::Google::Cloud::Redis::V1::CloudRedis::Client.new -``` - -### Local ADC file - -You can set up a local ADC file with your user credentials for authentication during -development. If credentials are not provided in code or in environment variables, -then the local ADC credentials are discovered. - -Follow the steps in [Quickstart](#quickstart) to set up a local ADC file. - -### Google Cloud Platform environments - -When running on Google Cloud Platform (GCP), including Google Compute Engine -(GCE), Google Kubernetes Engine (GKE), Google App Engine (GAE), Google Cloud -Functions (GCF) and Cloud Run, credentials are retrieved from the attached -service account automatically. Code should be written as if already authenticated. - -For more information, see -[Set up ADC for Google Cloud services](https://cloud.google.com/docs/authentication/provide-credentials-adc#attached-sa). diff --git a/owl-bot-staging/google-cloud-redis-v1/CHANGELOG.md b/owl-bot-staging/google-cloud-redis-v1/CHANGELOG.md deleted file mode 100644 index f88957a62ba2..000000000000 --- a/owl-bot-staging/google-cloud-redis-v1/CHANGELOG.md +++ /dev/null @@ -1,2 +0,0 @@ -# Release History - diff --git a/owl-bot-staging/google-cloud-redis-v1/Gemfile b/owl-bot-staging/google-cloud-redis-v1/Gemfile deleted file mode 100644 index 1d08558908d8..000000000000 --- a/owl-bot-staging/google-cloud-redis-v1/Gemfile +++ /dev/null @@ -1,14 +0,0 @@ -source "https://rubygems.org" - -gemspec - -gem "google-style", "~> 1.32.0" -gem "irb", "~> 1.17" -gem "minitest", "~> 6.0.2" -gem "minitest-focus", "~> 1.4" -gem "minitest-mock", "~> 5.27" -gem "minitest-rg", "~> 5.3" -gem "ostruct", "~> 0.5.5" -gem "rake", ">= 13.0" -gem "redcarpet", "~> 3.6" -gem "yard", "~> 0.9" diff --git a/owl-bot-staging/google-cloud-redis-v1/LICENSE.md b/owl-bot-staging/google-cloud-redis-v1/LICENSE.md deleted file mode 100644 index c261857ba6ad..000000000000 --- a/owl-bot-staging/google-cloud-redis-v1/LICENSE.md +++ /dev/null @@ -1,201 +0,0 @@ - Apache License - Version 2.0, January 2004 - http://www.apache.org/licenses/ - - TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION - - 1. Definitions. - - "License" shall mean the terms and conditions for use, reproduction, - and distribution as defined by Sections 1 through 9 of this document. - - "Licensor" shall mean the copyright owner or entity authorized by - the copyright owner that is granting the License. - - "Legal Entity" shall mean the union of the acting entity and all - other entities that control, are controlled by, or are under common - control with that entity. For the purposes of this definition, - "control" means (i) the power, direct or indirect, to cause the - direction or management of such entity, whether by contract or - otherwise, or (ii) ownership of fifty percent (50%) or more of the - outstanding shares, or (iii) beneficial ownership of such entity. - - "You" (or "Your") shall mean an individual or Legal Entity - exercising permissions granted by this License. - - "Source" form shall mean the preferred form for making modifications, - including but not limited to software source code, documentation - source, and configuration files. - - "Object" form shall mean any form resulting from mechanical - transformation or translation of a Source form, including but - not limited to compiled object code, generated documentation, - and conversions to other media types. - - "Work" shall mean the work of authorship, whether in Source or - Object form, made available under the License, as indicated by a - copyright notice that is included in or attached to the work - (an example is provided in the Appendix below). - - "Derivative Works" shall mean any work, whether in Source or Object - form, that is based on (or derived from) the Work and for which the - editorial revisions, annotations, elaborations, or other modifications - represent, as a whole, an original work of authorship. For the purposes - of this License, Derivative Works shall not include works that remain - separable from, or merely link (or bind by name) to the interfaces of, - the Work and Derivative Works thereof. - - "Contribution" shall mean any work of authorship, including - the original version of the Work and any modifications or additions - to that Work or Derivative Works thereof, that is intentionally - submitted to Licensor for inclusion in the Work by the copyright owner - or by an individual or Legal Entity authorized to submit on behalf of - the copyright owner. For the purposes of this definition, "submitted" - means any form of electronic, verbal, or written communication sent - to the Licensor or its representatives, including but not limited to - communication on electronic mailing lists, source code control systems, - and issue tracking systems that are managed by, or on behalf of, the - Licensor for the purpose of discussing and improving the Work, but - excluding communication that is conspicuously marked or otherwise - designated in writing by the copyright owner as "Not a Contribution." - - "Contributor" shall mean Licensor and any individual or Legal Entity - on behalf of whom a Contribution has been received by Licensor and - subsequently incorporated within the Work. - - 2. Grant of Copyright License. Subject to the terms and conditions of - this License, each Contributor hereby grants to You a perpetual, - worldwide, non-exclusive, no-charge, royalty-free, irrevocable - copyright license to reproduce, prepare Derivative Works of, - publicly display, publicly perform, sublicense, and distribute the - Work and such Derivative Works in Source or Object form. - - 3. Grant of Patent License. Subject to the terms and conditions of - this License, each Contributor hereby grants to You a perpetual, - worldwide, non-exclusive, no-charge, royalty-free, irrevocable - (except as stated in this section) patent license to make, have made, - use, offer to sell, sell, import, and otherwise transfer the Work, - where such license applies only to those patent claims licensable - by such Contributor that are necessarily infringed by their - Contribution(s) alone or by combination of their Contribution(s) - with the Work to which such Contribution(s) was submitted. If You - institute patent litigation against any entity (including a - cross-claim or counterclaim in a lawsuit) alleging that the Work - or a Contribution incorporated within the Work constitutes direct - or contributory patent infringement, then any patent licenses - granted to You under this License for that Work shall terminate - as of the date such litigation is filed. - - 4. Redistribution. You may reproduce and distribute copies of the - Work or Derivative Works thereof in any medium, with or without - modifications, and in Source or Object form, provided that You - meet the following conditions: - - (a) You must give any other recipients of the Work or - Derivative Works a copy of this License; and - - (b) You must cause any modified files to carry prominent notices - stating that You changed the files; and - - (c) You must retain, in the Source form of any Derivative Works - that You distribute, all copyright, patent, trademark, and - attribution notices from the Source form of the Work, - excluding those notices that do not pertain to any part of - the Derivative Works; and - - (d) If the Work includes a "NOTICE" text file as part of its - distribution, then any Derivative Works that You distribute must - include a readable copy of the attribution notices contained - within such NOTICE file, excluding those notices that do not - pertain to any part of the Derivative Works, in at least one - of the following places: within a NOTICE text file distributed - as part of the Derivative Works; within the Source form or - documentation, if provided along with the Derivative Works; or, - within a display generated by the Derivative Works, if and - wherever such third-party notices normally appear. The contents - of the NOTICE file are for informational purposes only and - do not modify the License. You may add Your own attribution - notices within Derivative Works that You distribute, alongside - or as an addendum to the NOTICE text from the Work, provided - that such additional attribution notices cannot be construed - as modifying the License. - - You may add Your own copyright statement to Your modifications and - may provide additional or different license terms and conditions - for use, reproduction, or distribution of Your modifications, or - for any such Derivative Works as a whole, provided Your use, - reproduction, and distribution of the Work otherwise complies with - the conditions stated in this License. - - 5. Submission of Contributions. Unless You explicitly state otherwise, - any Contribution intentionally submitted for inclusion in the Work - by You to the Licensor shall be under the terms and conditions of - this License, without any additional terms or conditions. - Notwithstanding the above, nothing herein shall supersede or modify - the terms of any separate license agreement you may have executed - with Licensor regarding such Contributions. - - 6. Trademarks. This License does not grant permission to use the trade - names, trademarks, service marks, or product names of the Licensor, - except as required for reasonable and customary use in describing the - origin of the Work and reproducing the content of the NOTICE file. - - 7. Disclaimer of Warranty. Unless required by applicable law or - agreed to in writing, Licensor provides the Work (and each - Contributor provides its Contributions) on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or - implied, including, without limitation, any warranties or conditions - of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A - PARTICULAR PURPOSE. You are solely responsible for determining the - appropriateness of using or redistributing the Work and assume any - risks associated with Your exercise of permissions under this License. - - 8. Limitation of Liability. In no event and under no legal theory, - whether in tort (including negligence), contract, or otherwise, - unless required by applicable law (such as deliberate and grossly - negligent acts) or agreed to in writing, shall any Contributor be - liable to You for damages, including any direct, indirect, special, - incidental, or consequential damages of any character arising as a - result of this License or out of the use or inability to use the - Work (including but not limited to damages for loss of goodwill, - work stoppage, computer failure or malfunction, or any and all - other commercial damages or losses), even if such Contributor - has been advised of the possibility of such damages. - - 9. Accepting Warranty or Additional Liability. While redistributing - the Work or Derivative Works thereof, You may choose to offer, - and charge a fee for, acceptance of support, warranty, indemnity, - or other liability obligations and/or rights consistent with this - License. However, in accepting such obligations, You may act only - on Your own behalf and on Your sole responsibility, not on behalf - of any other Contributor, and only if You agree to indemnify, - defend, and hold each Contributor harmless for any liability - incurred by, or claims asserted against, such Contributor by reason - of your accepting any such warranty or additional liability. - - END OF TERMS AND CONDITIONS - - APPENDIX: How to apply the Apache License to your work. - - To apply the Apache License to your work, attach the following - boilerplate notice, with the fields enclosed by brackets "[]" - replaced with your own identifying information. (Don't include - the brackets!) The text should be enclosed in the appropriate - comment syntax for the file format. We also recommend that a - file or class name and description of purpose be included on the - same "printed page" as the copyright notice for easier - identification within third-party archives. - - Copyright [yyyy] [name of copyright owner] - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. diff --git a/owl-bot-staging/google-cloud-redis-v1/README.md b/owl-bot-staging/google-cloud-redis-v1/README.md deleted file mode 100644 index bd08efb1a196..000000000000 --- a/owl-bot-staging/google-cloud-redis-v1/README.md +++ /dev/null @@ -1,153 +0,0 @@ -# Ruby Client for the Google Cloud Memorystore for Redis V1 API - -Creates and manages Redis instances on the Google Cloud Platform. - - -https://github.com/googleapis/google-cloud-ruby - -This gem is a _versioned_ client. It provides basic client classes for a -specific version of the Google Cloud Memorystore for Redis V1 API. Most users should consider using -the main client gem, -[google-cloud-redis](https://rubygems.org/gems/google-cloud-redis). -See the section below titled *Which client should I use?* for more information. - -## Installation - -``` -$ gem install google-cloud-redis-v1 -``` - -## Before You Begin - -In order to use this library, you first need to go through the following steps: - -1. [Select or create a Cloud Platform project.](https://console.cloud.google.com/project) -1. [Enable billing for your project.](https://cloud.google.com/billing/docs/how-to/modify-project#enable_billing_for_a_project) -1. [Enable the API.](https://console.cloud.google.com/apis/library/redis.googleapis.com) -1. [Set up authentication.](AUTHENTICATION.md) - -## Quick Start - -```ruby -require "google/cloud/redis/v1" - -client = ::Google::Cloud::Redis::V1::CloudRedis::Client.new -request = ::Google::Cloud::Redis::V1::ListInstancesRequest.new # (request fields as keyword arguments...) -response = client.list_instances request -``` - -View the [Client Library Documentation](https://cloud.google.com/ruby/docs/reference/google-cloud-redis-v1/latest) -for class and method documentation. - -See also the [Product Documentation](https://cloud.google.com/memorystore/docs/redis) -for general usage information. - -## Debug Logging - -This library comes with opt-in Debug Logging that can help you troubleshoot -your application's integration with the API. When logging is activated, key -events such as requests and responses, along with data payloads and metadata -such as headers and client configuration, are logged to the standard error -stream. - -**WARNING:** Client Library Debug Logging includes your data payloads in -plaintext, which could include sensitive data such as PII for yourself or your -customers, private keys, or other security data that could be compromising if -leaked. Always practice good data hygiene with your application logs, and follow -the principle of least access. Google also recommends that Client Library Debug -Logging be enabled only temporarily during active debugging, and not used -permanently in production. - -To enable logging, set the environment variable `GOOGLE_SDK_RUBY_LOGGING_GEMS` -to the value `all`. Alternatively, you can set the value to a comma-delimited -list of client library gem names. This will select the default logging behavior, -which writes logs to the standard error stream. On a local workstation, this may -result in logs appearing on the console. When running on a Google Cloud hosting -service such as [Google Cloud Run](https://cloud.google.com/run), this generally -results in logs appearing alongside your application logs in the -[Google Cloud Logging](https://cloud.google.com/logging/) service. - -You can customize logging by modifying the `logger` configuration when -constructing a client object. For example: - -```ruby -require "google/cloud/redis/v1" -require "logger" - -client = ::Google::Cloud::Redis::V1::CloudRedis::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-redis`, -and lower-level _versioned_ client libraries with names such as -`google-cloud-redis-v1`. -_In most cases, you should install the main client._ - -### What's the difference between the main client and a versioned client? - -A _versioned client_ provides a basic set of data types and client classes for -a _single version_ of a specific service. (That is, for a service with multiple -versions, there might be a separate versioned client for each service version.) -Most versioned clients are written and maintained by a code generator. - -The _main client_ is designed to provide you with the _recommended_ client -interfaces for the service. There will be only one main client for any given -service, even a service with multiple versions. The main client includes -factory methods for constructing the client objects we recommend for most -users. In some cases, those will be classes provided by an underlying versioned -client; in other cases, they will be handwritten higher-level client objects -with additional capabilities, convenience methods, or best practices built in. -Generally, the main client will default to a recommended service version, -although in some cases you can override this if you need to talk to a specific -service version. - -### Why would I want to use the main client? - -We recommend that most users install the main client gem for a service. You can -identify this gem as the one _without_ a version in its name, e.g. -`google-cloud-redis`. -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-redis-v1`. - -### What about the google-apis- clients? - -Client library gems with names that begin with `google-apis-` are based on an -older code generation technology. They talk to a REST/JSON backend (whereas -most modern clients talk to a [gRPC](https://grpc.io/) backend) and they may -not offer the same performance, features, and ease of use provided by more -modern clients. - -The `google-apis-` clients have wide coverage across Google services, so you -might need to use one if there is no modern client available for the service. -However, if a modern client is available, we generally recommend it over the -older `google-apis-` clients. diff --git a/owl-bot-staging/google-cloud-redis-v1/Rakefile b/owl-bot-staging/google-cloud-redis-v1/Rakefile deleted file mode 100644 index 99b84180ee78..000000000000 --- a/owl-bot-staging/google-cloud-redis-v1/Rakefile +++ /dev/null @@ -1,169 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -require "bundler/setup" -require "bundler/gem_tasks" - -require "rubocop/rake_task" -RuboCop::RakeTask.new - -require "rake/testtask" -desc "Run tests." -Rake::TestTask.new do |t| - t.libs << "test" - t.test_files = FileList["test/**/*_test.rb"] - t.warning = false -end - -desc "Runs the smoke tests." -Rake::TestTask.new :smoke_test do |t| - t.test_files = FileList["acceptance/**/*smoke_test.rb"] - t.warning = false -end - -# Acceptance tests -desc "Run the google-cloud-redis-v1 acceptance tests." -task :acceptance, :project, :keyfile do |t, args| - project = args[:project] - project ||= - ENV["REDIS_TEST_PROJECT"] || - ENV["GCLOUD_TEST_PROJECT"] - keyfile = args[:keyfile] - keyfile ||= - ENV["REDIS_TEST_KEYFILE"] || - ENV["GCLOUD_TEST_KEYFILE"] - if keyfile - keyfile = File.read keyfile - else - keyfile ||= - ENV["REDIS_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 REDIS_TEST_PROJECT=test123 REDIS_TEST_KEYFILE=/path/to/keyfile.json rake acceptance" - end - require "google/cloud/redis/v1/cloud_redis/credentials" - ::Google::Cloud::Redis::V1::CloudRedis::Credentials.env_vars.each do |path| - ENV[path] = nil - end - ENV["REDIS_PROJECT"] = project - ENV["REDIS_TEST_PROJECT"] = project - ENV["REDIS_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-redis-v1 gem has no acceptance tests." - end - end - - desc "Run acceptance cleanup." - task :cleanup do - end -end - -task :samples do - Rake::Task["samples:latest"].invoke -end - -namespace :samples do - task :latest do - if File.directory? "samples" - Dir.chdir "samples" do - Bundler.with_clean_env do - ENV["GOOGLE_CLOUD_SAMPLES_TEST"] = "not_master" - sh "bundle update" - sh "bundle exec rake test" - end - end - else - puts "The google-cloud-redis-v1 gem has no samples to test." - end - end - - task :master do - if File.directory? "samples" - Dir.chdir "samples" do - Bundler.with_clean_env do - ENV["GOOGLE_CLOUD_SAMPLES_TEST"] = "master" - sh "bundle update" - sh "bundle exec rake test" - end - end - else - puts "The google-cloud-redis-v1 gem has no samples to test." - end - end -end - -require "yard" -require "yard/rake/yardoc_task" -YARD::Rake::YardocTask.new do |y| - y.options << "--fail-on-warning" -end - -desc "Run yard-doctest example tests." -task :doctest do - puts "The google-cloud-redis-v1 gem does not have doctest tests." -end - -desc "Run the CI build" -task :ci do - header "BUILDING google-cloud-redis-v1" - header "google-cloud-redis-v1 rubocop", "*" - Rake::Task[:rubocop].invoke - header "google-cloud-redis-v1 yard", "*" - Rake::Task[:yard].invoke - header "google-cloud-redis-v1 test", "*" - Rake::Task[:test].invoke -end - -namespace :ci do - desc "Run the CI build, with smoke tests." - task :smoke_test do - Rake::Task[:ci].invoke - header "google-cloud-redis-v1 smoke_test", "*" - Rake::Task[:smoke_test].invoke - end - desc "Run the CI build, with acceptance tests." - task :acceptance do - Rake::Task[:ci].invoke - header "google-cloud-redis-v1 acceptance", "*" - Rake::Task[:acceptance].invoke - end - task :a do - # This is a handy shortcut to save typing - Rake::Task["ci:acceptance"].invoke - end -end - -task default: :test - -def header str, token = "#" - line_length = str.length + 8 - puts "" - puts token * line_length - puts "#{token * 3} #{str} #{token * 3}" - puts token * line_length - puts "" -end diff --git a/owl-bot-staging/google-cloud-redis-v1/gapic_metadata.json b/owl-bot-staging/google-cloud-redis-v1/gapic_metadata.json deleted file mode 100644 index 8cebdc986221..000000000000 --- a/owl-bot-staging/google-cloud-redis-v1/gapic_metadata.json +++ /dev/null @@ -1,73 +0,0 @@ -{ - "schema": "1.0", - "comment": "This file maps proto services/RPCs to the corresponding library clients/methods", - "language": "ruby", - "protoPackage": "google.cloud.redis.v1", - "libraryPackage": "::Google::Cloud::Redis::V1", - "services": { - "CloudRedis": { - "clients": { - "grpc": { - "libraryClient": "::Google::Cloud::Redis::V1::CloudRedis::Client", - "rpcs": { - "ListInstances": { - "methods": [ - "list_instances" - ] - }, - "GetInstance": { - "methods": [ - "get_instance" - ] - }, - "GetInstanceAuthString": { - "methods": [ - "get_instance_auth_string" - ] - }, - "CreateInstance": { - "methods": [ - "create_instance" - ] - }, - "UpdateInstance": { - "methods": [ - "update_instance" - ] - }, - "UpgradeInstance": { - "methods": [ - "upgrade_instance" - ] - }, - "ImportInstance": { - "methods": [ - "import_instance" - ] - }, - "ExportInstance": { - "methods": [ - "export_instance" - ] - }, - "FailoverInstance": { - "methods": [ - "failover_instance" - ] - }, - "DeleteInstance": { - "methods": [ - "delete_instance" - ] - }, - "RescheduleMaintenance": { - "methods": [ - "reschedule_maintenance" - ] - } - } - } - } - } - } -} diff --git a/owl-bot-staging/google-cloud-redis-v1/google-cloud-redis-v1.gemspec b/owl-bot-staging/google-cloud-redis-v1/google-cloud-redis-v1.gemspec deleted file mode 100644 index ca174a28ce5d..000000000000 --- a/owl-bot-staging/google-cloud-redis-v1/google-cloud-redis-v1.gemspec +++ /dev/null @@ -1,29 +0,0 @@ -# -*- ruby -*- -# encoding: utf-8 - -require File.expand_path("lib/google/cloud/redis/v1/version", __dir__) - -Gem::Specification.new do |gem| - gem.name = "google-cloud-redis-v1" - gem.version = Google::Cloud::Redis::V1::VERSION - - gem.authors = ["Google LLC"] - gem.email = "googleapis-packages@google.com" - gem.description = "Creates and manages Redis instances on the Google Cloud Platform. Note that google-cloud-redis-v1 is a version-specific client library. For most uses, we recommend installing the main client library google-cloud-redis instead. See the readme for more details." - gem.summary = "Creates and manages Redis instances on the Google Cloud Platform." - gem.homepage = "https://github.com/googleapis/google-cloud-ruby" - gem.license = "Apache-2.0" - - gem.platform = Gem::Platform::RUBY - - gem.files = `git ls-files -- lib/*`.split("\n") + - `git ls-files -- proto_docs/*`.split("\n") + - ["README.md", "LICENSE.md", "AUTHENTICATION.md", ".yardopts"] - gem.require_paths = ["lib"] - - gem.required_ruby_version = ">= 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-cloud-redis-v1/lib/google-cloud-redis-v1.rb b/owl-bot-staging/google-cloud-redis-v1/lib/google-cloud-redis-v1.rb deleted file mode 100644 index ba3315e36853..000000000000 --- a/owl-bot-staging/google-cloud-redis-v1/lib/google-cloud-redis-v1.rb +++ /dev/null @@ -1,21 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -# This gem does not autoload during Bundler.require. To load this gem, -# issue explicit require statements for the packages desired, e.g.: -# require "google/cloud/redis/v1" diff --git a/owl-bot-staging/google-cloud-redis-v1/lib/google/cloud/redis/v1.rb b/owl-bot-staging/google-cloud-redis-v1/lib/google/cloud/redis/v1.rb deleted file mode 100644 index 1f021367abe9..000000000000 --- a/owl-bot-staging/google-cloud-redis-v1/lib/google/cloud/redis/v1.rb +++ /dev/null @@ -1,45 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -require "google/cloud/redis/v1/cloud_redis" -require "google/cloud/redis/v1/version" - -module Google - module Cloud - module Redis - ## - # API client module. - # - # @example Load this package, including all its services, and instantiate a gRPC client - # - # require "google/cloud/redis/v1" - # client = ::Google::Cloud::Redis::V1::CloudRedis::Client.new - # - # @example Load this package, including all its services, and instantiate a REST client - # - # require "google/cloud/redis/v1" - # client = ::Google::Cloud::Redis::V1::CloudRedis::Rest::Client.new - # - module V1 - end - end - end -end - -helper_path = ::File.join __dir__, "v1", "_helpers.rb" -require "google/cloud/redis/v1/_helpers" if ::File.file? helper_path diff --git a/owl-bot-staging/google-cloud-redis-v1/lib/google/cloud/redis/v1/bindings_override.rb b/owl-bot-staging/google-cloud-redis-v1/lib/google/cloud/redis/v1/bindings_override.rb deleted file mode 100644 index ed4ac2ac4cb7..000000000000 --- a/owl-bot-staging/google-cloud-redis-v1/lib/google/cloud/redis/v1/bindings_override.rb +++ /dev/null @@ -1,75 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -require "gapic/rest" - -module Google - module Cloud - module Redis - ## - # @example Loading just the REST part of this package, including all its services, and instantiating a REST client - # - # require "google/cloud/redis/v1/rest" - # client = ::Google::Cloud::Redis::V1::CloudRedis::Rest::Client.new - # - module V1 - ## - # @private - # Initialize the mixin bindings configuration - # - def self.configure - @configure ||= begin - namespace = ["Google", "Cloud", "Redis"] - parent_config = while namespace.any? - parent_name = namespace.join "::" - parent_const = const_get parent_name - break parent_const.configure if parent_const.respond_to? :configure - namespace.pop - end - - default_config = ::Gapic::Rest::HttpBindingOverrideConfiguration.new parent_config - default_config.bindings_override["google.cloud.location.Locations.GetLocation"] = [ - Gapic::Rest::GrpcTranscoder::HttpBinding.create_with_validation( - uri_method: :get, - uri_template: "/v1/{name}", - matches: [ - ["name", %r{^projects/[^/]+/locations/[^/]+/?$}, false] - ], - body: nil - ) - ] - default_config.bindings_override["google.cloud.location.Locations.ListLocations"] = [ - - Gapic::Rest::GrpcTranscoder::HttpBinding.create_with_validation( - uri_method: :get, - uri_template: "/v1/{name}/locations", - matches: [ - ["name", %r{^projects/[^/]+/?$}, false] - ], - body: nil - ) - ] - default_config - end - yield @configure if block_given? - @configure - end - end - end - end -end diff --git a/owl-bot-staging/google-cloud-redis-v1/lib/google/cloud/redis/v1/cloud_redis.rb b/owl-bot-staging/google-cloud-redis-v1/lib/google/cloud/redis/v1/cloud_redis.rb deleted file mode 100644 index f1210eb66f2c..000000000000 --- a/owl-bot-staging/google-cloud-redis-v1/lib/google/cloud/redis/v1/cloud_redis.rb +++ /dev/null @@ -1,70 +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/redis/v1/version" - -require "google/cloud/redis/v1/cloud_redis/credentials" -require "google/cloud/redis/v1/cloud_redis/paths" -require "google/cloud/redis/v1/cloud_redis/operations" -require "google/cloud/redis/v1/cloud_redis/client" -require "google/cloud/redis/v1/cloud_redis/rest" - -module Google - module Cloud - module Redis - module V1 - ## - # Configures and manages Cloud Memorystore for Redis instances - # - # Google Cloud Memorystore for Redis v1 - # - # The `redis.googleapis.com` service implements the Google Cloud Memorystore - # for Redis API and defines the following resource model for managing Redis - # instances: - # * The service works with a collection of cloud projects, named: `/projects/*` - # * Each project has a collection of available locations, named: `/locations/*` - # * Each location has a collection of Redis instances, named: `/instances/*` - # * As such, Redis instances are resources of the form: - # `/projects/{project_id}/locations/{location_id}/instances/{instance_id}` - # - # Note that location_id must be referring to a GCP `region`; for example: - # * `projects/redpepper-1290/locations/us-central1/instances/my-redis` - # - # @example Load this service and instantiate a gRPC client - # - # require "google/cloud/redis/v1/cloud_redis" - # client = ::Google::Cloud::Redis::V1::CloudRedis::Client.new - # - # @example Load this service and instantiate a REST client - # - # require "google/cloud/redis/v1/cloud_redis/rest" - # client = ::Google::Cloud::Redis::V1::CloudRedis::Rest::Client.new - # - module CloudRedis - end - end - end - end -end - -helper_path = ::File.join __dir__, "cloud_redis", "helpers.rb" -require "google/cloud/redis/v1/cloud_redis/helpers" if ::File.file? helper_path diff --git a/owl-bot-staging/google-cloud-redis-v1/lib/google/cloud/redis/v1/cloud_redis/client.rb b/owl-bot-staging/google-cloud-redis-v1/lib/google/cloud/redis/v1/cloud_redis/client.rb deleted file mode 100644 index 879d5ccc933f..000000000000 --- a/owl-bot-staging/google-cloud-redis-v1/lib/google/cloud/redis/v1/cloud_redis/client.rb +++ /dev/null @@ -1,1649 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -require "google/cloud/errors" -require "google/cloud/redis/v1/cloud_redis_pb" -require "google/cloud/location" - -module Google - module Cloud - module Redis - module V1 - module CloudRedis - ## - # Client for the CloudRedis service. - # - # Configures and manages Cloud Memorystore for Redis instances - # - # Google Cloud Memorystore for Redis v1 - # - # The `redis.googleapis.com` service implements the Google Cloud Memorystore - # for Redis API and defines the following resource model for managing Redis - # instances: - # * The service works with a collection of cloud projects, named: `/projects/*` - # * Each project has a collection of available locations, named: `/locations/*` - # * Each location has a collection of Redis instances, named: `/instances/*` - # * As such, Redis instances are resources of the form: - # `/projects/{project_id}/locations/{location_id}/instances/{instance_id}` - # - # Note that location_id must be referring to a GCP `region`; for example: - # * `projects/redpepper-1290/locations/us-central1/instances/my-redis` - # - class Client - # @private - API_VERSION = "" - - # @private - DEFAULT_ENDPOINT_TEMPLATE = "redis.$UNIVERSE_DOMAIN$" - - include Paths - - # @private - attr_reader :cloud_redis_stub - - ## - # Configure the CloudRedis Client class. - # - # See {::Google::Cloud::Redis::V1::CloudRedis::Client::Configuration} - # for a description of the configuration fields. - # - # @example - # - # # Modify the configuration for all CloudRedis clients - # ::Google::Cloud::Redis::V1::CloudRedis::Client.configure do |config| - # config.timeout = 10.0 - # end - # - # @yield [config] Configure the Client client. - # @yieldparam config [Client::Configuration] - # - # @return [Client::Configuration] - # - def self.configure - @configure ||= begin - namespace = ["Google", "Cloud", "Redis", "V1"] - parent_config = while namespace.any? - parent_name = namespace.join "::" - parent_const = const_get parent_name - break parent_const.configure if parent_const.respond_to? :configure - namespace.pop - end - default_config = Client::Configuration.new parent_config - - default_config.rpcs.list_instances.timeout = 600.0 - - default_config.rpcs.get_instance.timeout = 600.0 - - default_config.rpcs.get_instance_auth_string.timeout = 600.0 - - default_config.rpcs.create_instance.timeout = 600.0 - - default_config.rpcs.update_instance.timeout = 600.0 - - default_config.rpcs.upgrade_instance.timeout = 600.0 - - default_config.rpcs.import_instance.timeout = 600.0 - - default_config.rpcs.export_instance.timeout = 600.0 - - default_config.rpcs.failover_instance.timeout = 600.0 - - default_config.rpcs.delete_instance.timeout = 600.0 - - default_config.rpcs.reschedule_maintenance.timeout = 600.0 - - default_config - end - yield @configure if block_given? - @configure - end - - ## - # Configure the CloudRedis Client instance. - # - # The configuration is set to the derived mode, meaning that values can be changed, - # but structural changes (adding new fields, etc.) are not allowed. Structural changes - # should be made on {Client.configure}. - # - # See {::Google::Cloud::Redis::V1::CloudRedis::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 - @cloud_redis_stub.universe_domain - end - - ## - # Create a new CloudRedis client object. - # - # @example - # - # # Create a client using the default configuration - # client = ::Google::Cloud::Redis::V1::CloudRedis::Client.new - # - # # Create a client using a custom configuration - # client = ::Google::Cloud::Redis::V1::CloudRedis::Client.new do |config| - # config.timeout = 10.0 - # end - # - # @yield [config] Configure the CloudRedis client. - # @yieldparam config [Client::Configuration] - # - def initialize - # These require statements are intentionally placed here to initialize - # the gRPC module only when it's required. - # See https://github.com/googleapis/toolkit/issues/446 - require "gapic/grpc" - require "google/cloud/redis/v1/cloud_redis_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 - - @cloud_redis_stub = ::Gapic::ServiceStub.new( - ::Google::Cloud::Redis::V1::CloudRedis::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 - ) - - @cloud_redis_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 = @cloud_redis_stub.endpoint - config.universe_domain = @cloud_redis_stub.universe_domain - config.logger = @cloud_redis_stub.logger if config.respond_to? :logger= - end - end - - ## - # Get the associated client for long-running operations. - # - # @return [::Google::Cloud::Redis::V1::CloudRedis::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 - @cloud_redis_stub.logger - end - - # Service calls - - ## - # Lists all Redis instances owned by a project in either the specified - # location (region) or all locations. - # - # The location should have the following format: - # - # * `projects/{project_id}/locations/{location_id}` - # - # If `location_id` is specified as `-` (wildcard), then all regions - # available to the project are queried, and the results are aggregated. - # - # @overload list_instances(request, options = nil) - # Pass arguments to `list_instances` via a request object, either of type - # {::Google::Cloud::Redis::V1::ListInstancesRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Redis::V1::ListInstancesRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_instances(parent: nil, page_size: nil, page_token: nil) - # Pass arguments to `list_instances` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param parent [::String] - # Required. The resource name of the instance location using the form: - # `projects/{project_id}/locations/{location_id}` - # where `location_id` refers to a GCP region. - # @param page_size [::Integer] - # The maximum number of items to return. - # - # If not specified, a default value of 1000 will be used by the service. - # Regardless of the page_size value, the response may include a partial list - # and a caller should only rely on response's - # {::Google::Cloud::Redis::V1::ListInstancesResponse#next_page_token `next_page_token`} - # to determine if there are more instances left to be queried. - # @param page_token [::String] - # The `next_page_token` value returned from a previous - # {::Google::Cloud::Redis::V1::CloudRedis::Client#list_instances ListInstances} request, if - # any. - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Gapic::PagedEnumerable<::Google::Cloud::Redis::V1::Instance>] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Gapic::PagedEnumerable<::Google::Cloud::Redis::V1::Instance>] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/cloud/redis/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Redis::V1::CloudRedis::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Redis::V1::ListInstancesRequest.new - # - # # Call the list_instances method. - # result = client.list_instances request - # - # # The returned object is of type Gapic::PagedEnumerable. You can iterate - # # over elements, and API calls will be issued to fetch pages as needed. - # result.each do |item| - # # Each element is of type ::Google::Cloud::Redis::V1::Instance. - # p item - # end - # - def list_instances request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Redis::V1::ListInstancesRequest - - # Converts hash 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_instances.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::Redis::V1::VERSION - metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - header_params = {} - if request.parent - header_params["parent"] = request.parent - end - - request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") - metadata[:"x-goog-request-params"] ||= request_params_header - - options.apply_defaults timeout: @config.rpcs.list_instances.timeout, - metadata: metadata, - retry_policy: @config.rpcs.list_instances.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @cloud_redis_stub.call_rpc :list_instances, request, options: options do |response, operation| - response = ::Gapic::PagedEnumerable.new @cloud_redis_stub, :list_instances, request, response, operation, options - yield response, operation if block_given? - throw :response, response - end - rescue ::GRPC::BadStatus => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Gets the details of a specific Redis instance. - # - # @overload get_instance(request, options = nil) - # Pass arguments to `get_instance` via a request object, either of type - # {::Google::Cloud::Redis::V1::GetInstanceRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Redis::V1::GetInstanceRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_instance(name: nil) - # Pass arguments to `get_instance` via keyword arguments. Note that at - # least one keyword argument is 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. Redis instance resource name using the form: - # `projects/{project_id}/locations/{location_id}/instances/{instance_id}` - # where `location_id` refers to a GCP region. - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Google::Cloud::Redis::V1::Instance] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Google::Cloud::Redis::V1::Instance] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/cloud/redis/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Redis::V1::CloudRedis::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Redis::V1::GetInstanceRequest.new - # - # # Call the get_instance method. - # result = client.get_instance request - # - # # The returned object is of type Google::Cloud::Redis::V1::Instance. - # p result - # - def get_instance request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Redis::V1::GetInstanceRequest - - # Converts hash 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_instance.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::Redis::V1::VERSION - metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - header_params = {} - if request.name - header_params["name"] = request.name - end - - request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") - metadata[:"x-goog-request-params"] ||= request_params_header - - options.apply_defaults timeout: @config.rpcs.get_instance.timeout, - metadata: metadata, - retry_policy: @config.rpcs.get_instance.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @cloud_redis_stub.call_rpc :get_instance, request, options: options do |response, operation| - yield response, operation if block_given? - end - rescue ::GRPC::BadStatus => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Gets the AUTH string for a Redis instance. If AUTH is not enabled for the - # instance the response will be empty. This information is not included in - # the details returned to GetInstance. - # - # @overload get_instance_auth_string(request, options = nil) - # Pass arguments to `get_instance_auth_string` via a request object, either of type - # {::Google::Cloud::Redis::V1::GetInstanceAuthStringRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Redis::V1::GetInstanceAuthStringRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_instance_auth_string(name: nil) - # Pass arguments to `get_instance_auth_string` via keyword arguments. Note that at - # least one keyword argument is 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. Redis instance resource name using the form: - # `projects/{project_id}/locations/{location_id}/instances/{instance_id}` - # where `location_id` refers to a GCP region. - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Google::Cloud::Redis::V1::InstanceAuthString] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Google::Cloud::Redis::V1::InstanceAuthString] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/cloud/redis/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Redis::V1::CloudRedis::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Redis::V1::GetInstanceAuthStringRequest.new - # - # # Call the get_instance_auth_string method. - # result = client.get_instance_auth_string request - # - # # The returned object is of type Google::Cloud::Redis::V1::InstanceAuthString. - # p result - # - def get_instance_auth_string request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Redis::V1::GetInstanceAuthStringRequest - - # Converts hash 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_instance_auth_string.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::Redis::V1::VERSION - metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - header_params = {} - if request.name - header_params["name"] = request.name - end - - request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") - metadata[:"x-goog-request-params"] ||= request_params_header - - options.apply_defaults timeout: @config.rpcs.get_instance_auth_string.timeout, - metadata: metadata, - retry_policy: @config.rpcs.get_instance_auth_string.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @cloud_redis_stub.call_rpc :get_instance_auth_string, request, options: options do |response, operation| - yield response, operation if block_given? - end - rescue ::GRPC::BadStatus => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Creates a Redis instance based on the specified tier and memory size. - # - # By default, the instance is accessible from the project's - # [default network](https://cloud.google.com/vpc/docs/vpc). - # - # The creation is executed asynchronously and callers may check the returned - # operation to track its progress. Once the operation is completed the Redis - # instance will be fully functional. Completed longrunning.Operation will - # contain the new instance object in the response field. - # - # The returned operation is automatically deleted after a few hours, so there - # is no need to call DeleteOperation. - # - # @overload create_instance(request, options = nil) - # Pass arguments to `create_instance` via a request object, either of type - # {::Google::Cloud::Redis::V1::CreateInstanceRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Redis::V1::CreateInstanceRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_instance(parent: nil, instance_id: nil, instance: nil) - # Pass arguments to `create_instance` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param parent [::String] - # Required. The resource name of the instance location using the form: - # `projects/{project_id}/locations/{location_id}` - # where `location_id` refers to a GCP region. - # @param instance_id [::String] - # Required. The logical name of the Redis instance in the customer project - # with the following restrictions: - # - # * Must contain only lowercase letters, numbers, and hyphens. - # * Must start with a letter. - # * Must be between 1-40 characters. - # * Must end with a number or a letter. - # * Must be unique within the customer project / location - # @param instance [::Google::Cloud::Redis::V1::Instance, ::Hash] - # Required. A Redis [Instance] 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/cloud/redis/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Redis::V1::CloudRedis::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Redis::V1::CreateInstanceRequest.new - # - # # Call the create_instance method. - # result = client.create_instance 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_instance request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Redis::V1::CreateInstanceRequest - - # Converts hash 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_instance.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::Redis::V1::VERSION - metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - header_params = {} - if request.parent - header_params["parent"] = request.parent - end - - request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") - metadata[:"x-goog-request-params"] ||= request_params_header - - options.apply_defaults timeout: @config.rpcs.create_instance.timeout, - metadata: metadata, - retry_policy: @config.rpcs.create_instance.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @cloud_redis_stub.call_rpc :create_instance, request, options: options do |response, operation| - response = ::Gapic::Operation.new response, @operations_client, options: options - yield response, operation if block_given? - throw :response, response - end - rescue ::GRPC::BadStatus => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Updates the metadata and configuration of a specific Redis instance. - # - # Completed longrunning.Operation will contain the new instance object - # in the response field. The returned operation is automatically deleted - # after a few hours, so there is no need to call DeleteOperation. - # - # @overload update_instance(request, options = nil) - # Pass arguments to `update_instance` via a request object, either of type - # {::Google::Cloud::Redis::V1::UpdateInstanceRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Redis::V1::UpdateInstanceRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_instance(update_mask: nil, instance: nil) - # Pass arguments to `update_instance` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param update_mask [::Google::Protobuf::FieldMask, ::Hash] - # Required. Mask of fields to update. At least one path must be supplied in - # this field. The elements of the repeated paths field may only include these - # fields from {::Google::Cloud::Redis::V1::Instance Instance}: - # - # * `displayName` - # * `labels` - # * `memorySizeGb` - # * `redisConfig` - # * `replica_count` - # @param instance [::Google::Cloud::Redis::V1::Instance, ::Hash] - # Required. Update description. - # Only fields specified in update_mask are updated. - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Gapic::Operation] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Gapic::Operation] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/cloud/redis/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Redis::V1::CloudRedis::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Redis::V1::UpdateInstanceRequest.new - # - # # Call the update_instance method. - # result = client.update_instance 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_instance request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Redis::V1::UpdateInstanceRequest - - # Converts hash 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_instance.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::Redis::V1::VERSION - metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - header_params = {} - if request.instance&.name - header_params["instance.name"] = request.instance.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_instance.timeout, - metadata: metadata, - retry_policy: @config.rpcs.update_instance.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @cloud_redis_stub.call_rpc :update_instance, 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 - - ## - # Upgrades Redis instance to the newer Redis version specified in the - # request. - # - # @overload upgrade_instance(request, options = nil) - # Pass arguments to `upgrade_instance` via a request object, either of type - # {::Google::Cloud::Redis::V1::UpgradeInstanceRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Redis::V1::UpgradeInstanceRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. - # - # @overload upgrade_instance(name: nil, redis_version: nil) - # Pass arguments to `upgrade_instance` via keyword arguments. Note that at - # least one keyword argument is 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. Redis instance resource name using the form: - # `projects/{project_id}/locations/{location_id}/instances/{instance_id}` - # where `location_id` refers to a GCP region. - # @param redis_version [::String] - # Required. Specifies the target version of Redis software to upgrade to. - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Gapic::Operation] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Gapic::Operation] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/cloud/redis/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Redis::V1::CloudRedis::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Redis::V1::UpgradeInstanceRequest.new - # - # # Call the upgrade_instance method. - # result = client.upgrade_instance 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 upgrade_instance request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Redis::V1::UpgradeInstanceRequest - - # Converts hash 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.upgrade_instance.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::Redis::V1::VERSION - metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - header_params = {} - if request.name - header_params["name"] = request.name - end - - request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") - metadata[:"x-goog-request-params"] ||= request_params_header - - options.apply_defaults timeout: @config.rpcs.upgrade_instance.timeout, - metadata: metadata, - retry_policy: @config.rpcs.upgrade_instance.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @cloud_redis_stub.call_rpc :upgrade_instance, 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 - - ## - # Import a Redis RDB snapshot file from Cloud Storage into a Redis instance. - # - # Redis may stop serving during this operation. Instance state will be - # IMPORTING for entire operation. When complete, the instance will contain - # only data from the imported file. - # - # The returned operation is automatically deleted after a few hours, so - # there is no need to call DeleteOperation. - # - # @overload import_instance(request, options = nil) - # Pass arguments to `import_instance` via a request object, either of type - # {::Google::Cloud::Redis::V1::ImportInstanceRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Redis::V1::ImportInstanceRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. - # - # @overload import_instance(name: nil, input_config: nil) - # Pass arguments to `import_instance` via keyword arguments. Note that at - # least one keyword argument is 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. Redis instance resource name using the form: - # `projects/{project_id}/locations/{location_id}/instances/{instance_id}` - # where `location_id` refers to a GCP region. - # @param input_config [::Google::Cloud::Redis::V1::InputConfig, ::Hash] - # Required. Specify data to be imported. - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Gapic::Operation] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Gapic::Operation] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/cloud/redis/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Redis::V1::CloudRedis::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Redis::V1::ImportInstanceRequest.new - # - # # Call the import_instance method. - # result = client.import_instance 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 import_instance request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Redis::V1::ImportInstanceRequest - - # Converts hash 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.import_instance.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::Redis::V1::VERSION - metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - header_params = {} - if request.name - header_params["name"] = request.name - end - - request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") - metadata[:"x-goog-request-params"] ||= request_params_header - - options.apply_defaults timeout: @config.rpcs.import_instance.timeout, - metadata: metadata, - retry_policy: @config.rpcs.import_instance.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @cloud_redis_stub.call_rpc :import_instance, 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 - - ## - # Export Redis instance data into a Redis RDB format file in Cloud Storage. - # - # Redis will continue serving during this operation. - # - # The returned operation is automatically deleted after a few hours, so - # there is no need to call DeleteOperation. - # - # @overload export_instance(request, options = nil) - # Pass arguments to `export_instance` via a request object, either of type - # {::Google::Cloud::Redis::V1::ExportInstanceRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Redis::V1::ExportInstanceRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. - # - # @overload export_instance(name: nil, output_config: nil) - # Pass arguments to `export_instance` via keyword arguments. Note that at - # least one keyword argument is 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. Redis instance resource name using the form: - # `projects/{project_id}/locations/{location_id}/instances/{instance_id}` - # where `location_id` refers to a GCP region. - # @param output_config [::Google::Cloud::Redis::V1::OutputConfig, ::Hash] - # Required. Specify data to be exported. - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Gapic::Operation] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Gapic::Operation] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/cloud/redis/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Redis::V1::CloudRedis::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Redis::V1::ExportInstanceRequest.new - # - # # Call the export_instance method. - # result = client.export_instance 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 export_instance request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Redis::V1::ExportInstanceRequest - - # Converts hash 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.export_instance.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::Redis::V1::VERSION - metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - header_params = {} - if request.name - header_params["name"] = request.name - end - - request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") - metadata[:"x-goog-request-params"] ||= request_params_header - - options.apply_defaults timeout: @config.rpcs.export_instance.timeout, - metadata: metadata, - retry_policy: @config.rpcs.export_instance.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @cloud_redis_stub.call_rpc :export_instance, 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 - - ## - # Initiates a failover of the primary node to current replica node for a - # specific STANDARD tier Cloud Memorystore for Redis instance. - # - # @overload failover_instance(request, options = nil) - # Pass arguments to `failover_instance` via a request object, either of type - # {::Google::Cloud::Redis::V1::FailoverInstanceRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Redis::V1::FailoverInstanceRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. - # - # @overload failover_instance(name: nil, data_protection_mode: nil) - # Pass arguments to `failover_instance` via keyword arguments. Note that at - # least one keyword argument is 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. Redis instance resource name using the form: - # `projects/{project_id}/locations/{location_id}/instances/{instance_id}` - # where `location_id` refers to a GCP region. - # @param data_protection_mode [::Google::Cloud::Redis::V1::FailoverInstanceRequest::DataProtectionMode] - # Optional. Available data protection modes that the user can choose. If it's - # unspecified, data protection mode will be LIMITED_DATA_LOSS by default. - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Gapic::Operation] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Gapic::Operation] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/cloud/redis/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Redis::V1::CloudRedis::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Redis::V1::FailoverInstanceRequest.new - # - # # Call the failover_instance method. - # result = client.failover_instance 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 failover_instance request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Redis::V1::FailoverInstanceRequest - - # Converts hash 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.failover_instance.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::Redis::V1::VERSION - metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - header_params = {} - if request.name - header_params["name"] = request.name - end - - request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") - metadata[:"x-goog-request-params"] ||= request_params_header - - options.apply_defaults timeout: @config.rpcs.failover_instance.timeout, - metadata: metadata, - retry_policy: @config.rpcs.failover_instance.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @cloud_redis_stub.call_rpc :failover_instance, 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 specific Redis instance. Instance stops serving and data is - # deleted. - # - # @overload delete_instance(request, options = nil) - # Pass arguments to `delete_instance` via a request object, either of type - # {::Google::Cloud::Redis::V1::DeleteInstanceRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Redis::V1::DeleteInstanceRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_instance(name: nil) - # Pass arguments to `delete_instance` via keyword arguments. Note that at - # least one keyword argument is 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. Redis instance resource name using the form: - # `projects/{project_id}/locations/{location_id}/instances/{instance_id}` - # where `location_id` refers to a GCP region. - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Gapic::Operation] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Gapic::Operation] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/cloud/redis/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Redis::V1::CloudRedis::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Redis::V1::DeleteInstanceRequest.new - # - # # Call the delete_instance method. - # result = client.delete_instance 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_instance request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Redis::V1::DeleteInstanceRequest - - # Converts hash 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_instance.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::Redis::V1::VERSION - metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - header_params = {} - if request.name - header_params["name"] = request.name - end - - request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") - metadata[:"x-goog-request-params"] ||= request_params_header - - options.apply_defaults timeout: @config.rpcs.delete_instance.timeout, - metadata: metadata, - retry_policy: @config.rpcs.delete_instance.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @cloud_redis_stub.call_rpc :delete_instance, 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 - - ## - # Reschedule maintenance for a given instance in a given project and - # location. - # - # @overload reschedule_maintenance(request, options = nil) - # Pass arguments to `reschedule_maintenance` via a request object, either of type - # {::Google::Cloud::Redis::V1::RescheduleMaintenanceRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Redis::V1::RescheduleMaintenanceRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. - # - # @overload reschedule_maintenance(name: nil, reschedule_type: nil, schedule_time: nil) - # Pass arguments to `reschedule_maintenance` via keyword arguments. Note that at - # least one keyword argument is 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. Redis instance resource name using the form: - # `projects/{project_id}/locations/{location_id}/instances/{instance_id}` - # where `location_id` refers to a GCP region. - # @param reschedule_type [::Google::Cloud::Redis::V1::RescheduleMaintenanceRequest::RescheduleType] - # Required. If reschedule type is SPECIFIC_TIME, must set up schedule_time as - # well. - # @param schedule_time [::Google::Protobuf::Timestamp, ::Hash] - # Optional. Timestamp when the maintenance shall be rescheduled to if - # reschedule_type=SPECIFIC_TIME, in RFC 3339 format, for - # example `2012-11-15T16:19:00.094Z`. - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Gapic::Operation] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Gapic::Operation] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/cloud/redis/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Redis::V1::CloudRedis::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Redis::V1::RescheduleMaintenanceRequest.new - # - # # Call the reschedule_maintenance method. - # result = client.reschedule_maintenance 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 reschedule_maintenance request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Redis::V1::RescheduleMaintenanceRequest - - # Converts hash 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.reschedule_maintenance.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::Redis::V1::VERSION - metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - header_params = {} - if request.name - header_params["name"] = request.name - end - - request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") - metadata[:"x-goog-request-params"] ||= request_params_header - - options.apply_defaults timeout: @config.rpcs.reschedule_maintenance.timeout, - metadata: metadata, - retry_policy: @config.rpcs.reschedule_maintenance.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @cloud_redis_stub.call_rpc :reschedule_maintenance, 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 CloudRedis API. - # - # This class represents the configuration for CloudRedis, - # providing control over timeouts, retry behavior, logging, transport - # parameters, and other low-level controls. Certain parameters can also be - # applied individually to specific RPCs. See - # {::Google::Cloud::Redis::V1::CloudRedis::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_instances to 20 seconds, - # # and all remaining timeouts to 10 seconds. - # ::Google::Cloud::Redis::V1::CloudRedis::Client.configure do |config| - # config.timeout = 10.0 - # config.rpcs.list_instances.timeout = 20.0 - # end - # - # # Apply the above configuration only to a new client. - # client = ::Google::Cloud::Redis::V1::CloudRedis::Client.new do |config| - # config.timeout = 10.0 - # config.rpcs.list_instances.timeout = 20.0 - # end - # - # @!attribute [rw] endpoint - # A custom service endpoint, as a hostname or hostname:port. The default is - # nil, indicating to use the default endpoint in the current universe domain. - # @return [::String,nil] - # @!attribute [rw] credentials - # Credentials to send with calls. You may provide any of the following types: - # * (`Google::Auth::Credentials`) A googleauth credentials object - # (see the [googleauth docs](https://rubydoc.info/gems/googleauth/Google/Auth/Credentials)) - # * (`Signet::OAuth2::Client`) A signet oauth2 client object - # (see the [signet docs](https://rubydoc.info/gems/signet/Signet/OAuth2/Client)) - # * (`GRPC::Core::Channel`) a gRPC channel with included credentials - # * (`GRPC::Core::ChannelCredentials`) a gRPC credentails object - # * (`nil`) indicating no credentials - # - # @note Warning: Passing a `String` to a keyfile path or a `Hash` of credentials - # is deprecated. Providing an unvalidated credential configuration to - # Google APIs can compromise the security of your systems and data. - # - # @example - # - # # The recommended way to provide credentials is to use the `make_creds` method - # # on the appropriate credentials class for your environment. - # - # require "googleauth" - # - # credentials = ::Google::Auth::ServiceAccountCredentials.make_creds( - # json_key_io: ::File.open("/path/to/keyfile.json") - # ) - # - # client = ::Google::Cloud::Redis::V1::CloudRedis::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 = "redis.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 CloudRedis 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_instances` - # @return [::Gapic::Config::Method] - # - attr_reader :list_instances - ## - # RPC-specific configuration for `get_instance` - # @return [::Gapic::Config::Method] - # - attr_reader :get_instance - ## - # RPC-specific configuration for `get_instance_auth_string` - # @return [::Gapic::Config::Method] - # - attr_reader :get_instance_auth_string - ## - # RPC-specific configuration for `create_instance` - # @return [::Gapic::Config::Method] - # - attr_reader :create_instance - ## - # RPC-specific configuration for `update_instance` - # @return [::Gapic::Config::Method] - # - attr_reader :update_instance - ## - # RPC-specific configuration for `upgrade_instance` - # @return [::Gapic::Config::Method] - # - attr_reader :upgrade_instance - ## - # RPC-specific configuration for `import_instance` - # @return [::Gapic::Config::Method] - # - attr_reader :import_instance - ## - # RPC-specific configuration for `export_instance` - # @return [::Gapic::Config::Method] - # - attr_reader :export_instance - ## - # RPC-specific configuration for `failover_instance` - # @return [::Gapic::Config::Method] - # - attr_reader :failover_instance - ## - # RPC-specific configuration for `delete_instance` - # @return [::Gapic::Config::Method] - # - attr_reader :delete_instance - ## - # RPC-specific configuration for `reschedule_maintenance` - # @return [::Gapic::Config::Method] - # - attr_reader :reschedule_maintenance - - # @private - def initialize parent_rpcs = nil - list_instances_config = parent_rpcs.list_instances if parent_rpcs.respond_to? :list_instances - @list_instances = ::Gapic::Config::Method.new list_instances_config - get_instance_config = parent_rpcs.get_instance if parent_rpcs.respond_to? :get_instance - @get_instance = ::Gapic::Config::Method.new get_instance_config - get_instance_auth_string_config = parent_rpcs.get_instance_auth_string if parent_rpcs.respond_to? :get_instance_auth_string - @get_instance_auth_string = ::Gapic::Config::Method.new get_instance_auth_string_config - create_instance_config = parent_rpcs.create_instance if parent_rpcs.respond_to? :create_instance - @create_instance = ::Gapic::Config::Method.new create_instance_config - update_instance_config = parent_rpcs.update_instance if parent_rpcs.respond_to? :update_instance - @update_instance = ::Gapic::Config::Method.new update_instance_config - upgrade_instance_config = parent_rpcs.upgrade_instance if parent_rpcs.respond_to? :upgrade_instance - @upgrade_instance = ::Gapic::Config::Method.new upgrade_instance_config - import_instance_config = parent_rpcs.import_instance if parent_rpcs.respond_to? :import_instance - @import_instance = ::Gapic::Config::Method.new import_instance_config - export_instance_config = parent_rpcs.export_instance if parent_rpcs.respond_to? :export_instance - @export_instance = ::Gapic::Config::Method.new export_instance_config - failover_instance_config = parent_rpcs.failover_instance if parent_rpcs.respond_to? :failover_instance - @failover_instance = ::Gapic::Config::Method.new failover_instance_config - delete_instance_config = parent_rpcs.delete_instance if parent_rpcs.respond_to? :delete_instance - @delete_instance = ::Gapic::Config::Method.new delete_instance_config - reschedule_maintenance_config = parent_rpcs.reschedule_maintenance if parent_rpcs.respond_to? :reschedule_maintenance - @reschedule_maintenance = ::Gapic::Config::Method.new reschedule_maintenance_config - - yield self if block_given? - end - end - end - end - end - end - end - end -end diff --git a/owl-bot-staging/google-cloud-redis-v1/lib/google/cloud/redis/v1/cloud_redis/credentials.rb b/owl-bot-staging/google-cloud-redis-v1/lib/google/cloud/redis/v1/cloud_redis/credentials.rb deleted file mode 100644 index 5cbeef4d938c..000000000000 --- a/owl-bot-staging/google-cloud-redis-v1/lib/google/cloud/redis/v1/cloud_redis/credentials.rb +++ /dev/null @@ -1,51 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -require "googleauth" - -module Google - module Cloud - module Redis - module V1 - module CloudRedis - # Credentials for the CloudRedis API. - class Credentials < ::Google::Auth::Credentials - self.scope = [ - "https://www.googleapis.com/auth/cloud-platform" - ] - self.env_vars = [ - "REDIS_CREDENTIALS", - "REDIS_KEYFILE", - "GOOGLE_CLOUD_CREDENTIALS", - "GOOGLE_CLOUD_KEYFILE", - "GCLOUD_KEYFILE", - "REDIS_CREDENTIALS_JSON", - "REDIS_KEYFILE_JSON", - "GOOGLE_CLOUD_CREDENTIALS_JSON", - "GOOGLE_CLOUD_KEYFILE_JSON", - "GCLOUD_KEYFILE_JSON" - ] - self.paths = [ - "~/.config/google_cloud/application_default_credentials.json" - ] - end - end - end - end - end -end diff --git a/owl-bot-staging/google-cloud-redis-v1/lib/google/cloud/redis/v1/cloud_redis/operations.rb b/owl-bot-staging/google-cloud-redis-v1/lib/google/cloud/redis/v1/cloud_redis/operations.rb deleted file mode 100644 index c0b8de973715..000000000000 --- a/owl-bot-staging/google-cloud-redis-v1/lib/google/cloud/redis/v1/cloud_redis/operations.rb +++ /dev/null @@ -1,841 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -require "gapic/operation" -require "google/longrunning/operations_pb" - -module Google - module Cloud - module Redis - module V1 - module CloudRedis - # Service that implements Longrunning Operations API. - class Operations - # @private - API_VERSION = "" - - # @private - DEFAULT_ENDPOINT_TEMPLATE = "redis.$UNIVERSE_DOMAIN$" - - # @private - attr_reader :operations_stub - - ## - # Configuration for the CloudRedis 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 CloudRedis 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::Redis::V1::VERSION - metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - header_params = {} - if request.name - header_params["name"] = request.name - end - - request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") - metadata[:"x-goog-request-params"] ||= request_params_header - - options.apply_defaults timeout: @config.rpcs.list_operations.timeout, - metadata: metadata, - retry_policy: @config.rpcs.list_operations.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @operations_stub.call_rpc :list_operations, request, options: options do |response, operation| - wrap_lro_operation = ->(op_response) { ::Gapic::Operation.new op_response, @operations_client } - response = ::Gapic::PagedEnumerable.new @operations_stub, :list_operations, request, response, operation, options, format_resource: wrap_lro_operation - yield response, operation if block_given? - 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::Redis::V1::VERSION - metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - header_params = {} - if request.name - header_params["name"] = request.name - end - - request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") - metadata[:"x-goog-request-params"] ||= request_params_header - - options.apply_defaults timeout: @config.rpcs.get_operation.timeout, - metadata: metadata, - retry_policy: @config.rpcs.get_operation.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @operations_stub.call_rpc :get_operation, request, options: options do |response, operation| - response = ::Gapic::Operation.new response, @operations_client, options: options - yield response, operation if block_given? - 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::Redis::V1::VERSION - metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - header_params = {} - if request.name - header_params["name"] = request.name - end - - request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") - metadata[:"x-goog-request-params"] ||= request_params_header - - options.apply_defaults timeout: @config.rpcs.delete_operation.timeout, - metadata: metadata, - retry_policy: @config.rpcs.delete_operation.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @operations_stub.call_rpc :delete_operation, request, options: options do |response, operation| - yield response, operation if block_given? - 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::Redis::V1::VERSION - metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - header_params = {} - if request.name - header_params["name"] = request.name - end - - request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") - metadata[:"x-goog-request-params"] ||= request_params_header - - options.apply_defaults timeout: @config.rpcs.cancel_operation.timeout, - metadata: metadata, - retry_policy: @config.rpcs.cancel_operation.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @operations_stub.call_rpc :cancel_operation, request, options: options do |response, operation| - yield response, operation if block_given? - 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::Redis::V1::VERSION - metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - options.apply_defaults timeout: @config.rpcs.wait_operation.timeout, - metadata: metadata, - retry_policy: @config.rpcs.wait_operation.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @operations_stub.call_rpc :wait_operation, request, options: options do |response, operation| - response = ::Gapic::Operation.new response, @operations_client, options: options - yield response, operation if block_given? - 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 = "redis.googleapis.com" - - config_attr :endpoint, nil, ::String, nil - config_attr :credentials, nil do |value| - allowed = [::String, ::Hash, ::Proc, ::Symbol, ::Google::Auth::Credentials, ::Google::Auth::BaseClient, ::Signet::OAuth2::Client, nil] - allowed += [::GRPC::Core::Channel, ::GRPC::Core::ChannelCredentials] if defined? ::GRPC::Core::Channel - allowed.any? { |klass| klass === value } - end - config_attr :scope, nil, ::String, ::Array, nil - config_attr :lib_name, nil, ::String, nil - config_attr :lib_version, nil, ::String, nil - config_attr(:channel_args, { "grpc.service_config_disable_resolution" => 1 }, ::Hash, nil) - config_attr :interceptors, nil, ::Array, nil - config_attr :timeout, nil, ::Numeric, nil - config_attr :metadata, nil, ::Hash, nil - config_attr :retry_policy, nil, ::Hash, ::Proc, nil - config_attr :quota_project, nil, ::String, nil - config_attr :universe_domain, nil, ::String, nil - config_attr :logger, :default, ::Logger, nil, :default - - # @private - def initialize parent_config = nil - @parent_config = parent_config unless parent_config.nil? - - yield self if block_given? - end - - ## - # Configurations for individual RPCs - # @return [Rpcs] - # - def rpcs - @rpcs ||= begin - parent_rpcs = nil - parent_rpcs = @parent_config.rpcs if defined?(@parent_config) && @parent_config.respond_to?(:rpcs) - Rpcs.new parent_rpcs - end - end - - ## - # Configuration for the channel pool - # @return [::Gapic::ServiceStub::ChannelPool::Configuration] - # - def channel_pool - @channel_pool ||= ::Gapic::ServiceStub::ChannelPool::Configuration.new - end - - ## - # Configuration RPC class for the Operations API. - # - # Includes fields providing the configuration for each RPC in this service. - # Each configuration object is of type `Gapic::Config::Method` and includes - # the following configuration fields: - # - # * `timeout` (*type:* `Numeric`) - The call timeout in seconds - # * `metadata` (*type:* `Hash{Symbol=>String}`) - Additional gRPC headers - # * `retry_policy (*type:* `Hash`) - The retry policy. The policy fields - # include the following keys: - # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds. - # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds. - # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier. - # * `:retry_codes` (*type:* `Array`) - The error codes that should - # trigger a retry. - # - class Rpcs - ## - # RPC-specific configuration for `list_operations` - # @return [::Gapic::Config::Method] - # - attr_reader :list_operations - ## - # RPC-specific configuration for `get_operation` - # @return [::Gapic::Config::Method] - # - attr_reader :get_operation - ## - # RPC-specific configuration for `delete_operation` - # @return [::Gapic::Config::Method] - # - attr_reader :delete_operation - ## - # RPC-specific configuration for `cancel_operation` - # @return [::Gapic::Config::Method] - # - attr_reader :cancel_operation - ## - # RPC-specific configuration for `wait_operation` - # @return [::Gapic::Config::Method] - # - attr_reader :wait_operation - - # @private - def initialize parent_rpcs = nil - list_operations_config = parent_rpcs.list_operations if parent_rpcs.respond_to? :list_operations - @list_operations = ::Gapic::Config::Method.new list_operations_config - get_operation_config = parent_rpcs.get_operation if parent_rpcs.respond_to? :get_operation - @get_operation = ::Gapic::Config::Method.new get_operation_config - delete_operation_config = parent_rpcs.delete_operation if parent_rpcs.respond_to? :delete_operation - @delete_operation = ::Gapic::Config::Method.new delete_operation_config - cancel_operation_config = parent_rpcs.cancel_operation if parent_rpcs.respond_to? :cancel_operation - @cancel_operation = ::Gapic::Config::Method.new cancel_operation_config - wait_operation_config = parent_rpcs.wait_operation if parent_rpcs.respond_to? :wait_operation - @wait_operation = ::Gapic::Config::Method.new wait_operation_config - - yield self if block_given? - end - end - end - end - end - end - end - end -end diff --git a/owl-bot-staging/google-cloud-redis-v1/lib/google/cloud/redis/v1/cloud_redis/paths.rb b/owl-bot-staging/google-cloud-redis-v1/lib/google/cloud/redis/v1/cloud_redis/paths.rb deleted file mode 100644 index 1077a0084cf3..000000000000 --- a/owl-bot-staging/google-cloud-redis-v1/lib/google/cloud/redis/v1/cloud_redis/paths.rb +++ /dev/null @@ -1,69 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - - -module Google - module Cloud - module Redis - module V1 - module CloudRedis - # Path helper methods for the CloudRedis API. - module Paths - ## - # Create a fully-qualified Instance resource string. - # - # The resource will be in the following format: - # - # `projects/{project}/locations/{location}/instances/{instance}` - # - # @param project [String] - # @param location [String] - # @param instance [String] - # - # @return [::String] - def instance_path project:, location:, instance: - raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" - raise ::ArgumentError, "location cannot contain /" if location.to_s.include? "/" - - "projects/#{project}/locations/#{location}/instances/#{instance}" - 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 - - extend self - end - end - end - end - end -end diff --git a/owl-bot-staging/google-cloud-redis-v1/lib/google/cloud/redis/v1/cloud_redis/rest.rb b/owl-bot-staging/google-cloud-redis-v1/lib/google/cloud/redis/v1/cloud_redis/rest.rb deleted file mode 100644 index d3cb458ddfd3..000000000000 --- a/owl-bot-staging/google-cloud-redis-v1/lib/google/cloud/redis/v1/cloud_redis/rest.rb +++ /dev/null @@ -1,68 +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/redis/v1/version" -require "google/cloud/redis/v1/bindings_override" - -require "google/cloud/redis/v1/cloud_redis/credentials" -require "google/cloud/redis/v1/cloud_redis/paths" -require "google/cloud/redis/v1/cloud_redis/rest/operations" -require "google/cloud/redis/v1/cloud_redis/rest/client" - -module Google - module Cloud - module Redis - module V1 - ## - # Configures and manages Cloud Memorystore for Redis instances - # - # Google Cloud Memorystore for Redis v1 - # - # The `redis.googleapis.com` service implements the Google Cloud Memorystore - # for Redis API and defines the following resource model for managing Redis - # instances: - # * The service works with a collection of cloud projects, named: `/projects/*` - # * Each project has a collection of available locations, named: `/locations/*` - # * Each location has a collection of Redis instances, named: `/instances/*` - # * As such, Redis instances are resources of the form: - # `/projects/{project_id}/locations/{location_id}/instances/{instance_id}` - # - # Note that location_id must be referring to a GCP `region`; for example: - # * `projects/redpepper-1290/locations/us-central1/instances/my-redis` - # - # To load this service and instantiate a REST client: - # - # require "google/cloud/redis/v1/cloud_redis/rest" - # client = ::Google::Cloud::Redis::V1::CloudRedis::Rest::Client.new - # - module CloudRedis - # Client for the REST transport - module Rest - end - end - end - end - end -end - -helper_path = ::File.join __dir__, "rest", "helpers.rb" -require "google/cloud/redis/v1/cloud_redis/rest/helpers" if ::File.file? helper_path diff --git a/owl-bot-staging/google-cloud-redis-v1/lib/google/cloud/redis/v1/cloud_redis/rest/client.rb b/owl-bot-staging/google-cloud-redis-v1/lib/google/cloud/redis/v1/cloud_redis/rest/client.rb deleted file mode 100644 index 2d6c409f24aa..000000000000 --- a/owl-bot-staging/google-cloud-redis-v1/lib/google/cloud/redis/v1/cloud_redis/rest/client.rb +++ /dev/null @@ -1,1537 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -require "google/cloud/errors" -require "google/cloud/redis/v1/cloud_redis_pb" -require "google/cloud/redis/v1/cloud_redis/rest/service_stub" -require "google/cloud/location/rest" - -module Google - module Cloud - module Redis - module V1 - module CloudRedis - module Rest - ## - # REST client for the CloudRedis service. - # - # Configures and manages Cloud Memorystore for Redis instances - # - # Google Cloud Memorystore for Redis v1 - # - # The `redis.googleapis.com` service implements the Google Cloud Memorystore - # for Redis API and defines the following resource model for managing Redis - # instances: - # * The service works with a collection of cloud projects, named: `/projects/*` - # * Each project has a collection of available locations, named: `/locations/*` - # * Each location has a collection of Redis instances, named: `/instances/*` - # * As such, Redis instances are resources of the form: - # `/projects/{project_id}/locations/{location_id}/instances/{instance_id}` - # - # Note that location_id must be referring to a GCP `region`; for example: - # * `projects/redpepper-1290/locations/us-central1/instances/my-redis` - # - class Client - # @private - API_VERSION = "" - - # @private - DEFAULT_ENDPOINT_TEMPLATE = "redis.$UNIVERSE_DOMAIN$" - - include Paths - - # @private - attr_reader :cloud_redis_stub - - ## - # Configure the CloudRedis Client class. - # - # See {::Google::Cloud::Redis::V1::CloudRedis::Rest::Client::Configuration} - # for a description of the configuration fields. - # - # @example - # - # # Modify the configuration for all CloudRedis clients - # ::Google::Cloud::Redis::V1::CloudRedis::Rest::Client.configure do |config| - # config.timeout = 10.0 - # end - # - # @yield [config] Configure the Client client. - # @yieldparam config [Client::Configuration] - # - # @return [Client::Configuration] - # - def self.configure - @configure ||= begin - namespace = ["Google", "Cloud", "Redis", "V1"] - parent_config = while namespace.any? - parent_name = namespace.join "::" - parent_const = const_get parent_name - break parent_const.configure if parent_const.respond_to? :configure - namespace.pop - end - default_config = Client::Configuration.new parent_config - - default_config.rpcs.list_instances.timeout = 600.0 - - default_config.rpcs.get_instance.timeout = 600.0 - - default_config.rpcs.get_instance_auth_string.timeout = 600.0 - - default_config.rpcs.create_instance.timeout = 600.0 - - default_config.rpcs.update_instance.timeout = 600.0 - - default_config.rpcs.upgrade_instance.timeout = 600.0 - - default_config.rpcs.import_instance.timeout = 600.0 - - default_config.rpcs.export_instance.timeout = 600.0 - - default_config.rpcs.failover_instance.timeout = 600.0 - - default_config.rpcs.delete_instance.timeout = 600.0 - - default_config.rpcs.reschedule_maintenance.timeout = 600.0 - - default_config - end - yield @configure if block_given? - @configure - end - - ## - # Configure the CloudRedis Client instance. - # - # The configuration is set to the derived mode, meaning that values can be changed, - # but structural changes (adding new fields, etc.) are not allowed. Structural changes - # should be made on {Client.configure}. - # - # See {::Google::Cloud::Redis::V1::CloudRedis::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 - @cloud_redis_stub.universe_domain - end - - ## - # Create a new CloudRedis REST client object. - # - # @example - # - # # Create a client using the default configuration - # client = ::Google::Cloud::Redis::V1::CloudRedis::Rest::Client.new - # - # # Create a client using a custom configuration - # client = ::Google::Cloud::Redis::V1::CloudRedis::Rest::Client.new do |config| - # config.timeout = 10.0 - # end - # - # @yield [config] Configure the CloudRedis client. - # @yieldparam config [Client::Configuration] - # - def initialize - # Create the configuration object - @config = Configuration.new Client.configure - - # Yield the configuration if needed - yield @config if block_given? - - # Create credentials - credentials = @config.credentials - # Use self-signed JWT if the endpoint is unchanged from default, - # but only if the default endpoint does not have a region prefix. - enable_self_signed_jwt = @config.endpoint.nil? || - (@config.endpoint == Configuration::DEFAULT_ENDPOINT && - !@config.endpoint.split(".").first.include?("-")) - credentials ||= Credentials.default scope: @config.scope, - enable_self_signed_jwt: enable_self_signed_jwt - if credentials.is_a?(::String) || credentials.is_a?(::Hash) - credentials = Credentials.new credentials, scope: @config.scope - end - - @quota_project_id = @config.quota_project - @quota_project_id ||= credentials.quota_project_id if credentials.respond_to? :quota_project_id - - @operations_client = ::Google::Cloud::Redis::V1::CloudRedis::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 - - @cloud_redis_stub = ::Google::Cloud::Redis::V1::CloudRedis::Rest::ServiceStub.new( - endpoint: @config.endpoint, - endpoint_template: DEFAULT_ENDPOINT_TEMPLATE, - universe_domain: @config.universe_domain, - credentials: credentials, - logger: @config.logger - ) - - @cloud_redis_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 = @cloud_redis_stub.endpoint - config.universe_domain = @cloud_redis_stub.universe_domain - config.bindings_override = @config.bindings_override - config.logger = @cloud_redis_stub.logger if config.respond_to? :logger= - end - end - - ## - # Get the associated client for long-running operations. - # - # @return [::Google::Cloud::Redis::V1::CloudRedis::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 - @cloud_redis_stub.logger - end - - # Service calls - - ## - # Lists all Redis instances owned by a project in either the specified - # location (region) or all locations. - # - # The location should have the following format: - # - # * `projects/{project_id}/locations/{location_id}` - # - # If `location_id` is specified as `-` (wildcard), then all regions - # available to the project are queried, and the results are aggregated. - # - # @overload list_instances(request, options = nil) - # Pass arguments to `list_instances` via a request object, either of type - # {::Google::Cloud::Redis::V1::ListInstancesRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Redis::V1::ListInstancesRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_instances(parent: nil, page_size: nil, page_token: nil) - # Pass arguments to `list_instances` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param parent [::String] - # Required. The resource name of the instance location using the form: - # `projects/{project_id}/locations/{location_id}` - # where `location_id` refers to a GCP region. - # @param page_size [::Integer] - # The maximum number of items to return. - # - # If not specified, a default value of 1000 will be used by the service. - # Regardless of the page_size value, the response may include a partial list - # and a caller should only rely on response's - # {::Google::Cloud::Redis::V1::ListInstancesResponse#next_page_token `next_page_token`} - # to determine if there are more instances left to be queried. - # @param page_token [::String] - # The `next_page_token` value returned from a previous - # {::Google::Cloud::Redis::V1::CloudRedis::Rest::Client#list_instances ListInstances} request, if - # any. - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Gapic::Rest::PagedEnumerable<::Google::Cloud::Redis::V1::Instance>] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Gapic::Rest::PagedEnumerable<::Google::Cloud::Redis::V1::Instance>] - # - # @raise [::Google::Cloud::Error] if the REST call is aborted. - # - # @example Basic example - # require "google/cloud/redis/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Redis::V1::CloudRedis::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Redis::V1::ListInstancesRequest.new - # - # # Call the list_instances method. - # result = client.list_instances request - # - # # The returned object is of type Gapic::PagedEnumerable. You can iterate - # # over elements, and API calls will be issued to fetch pages as needed. - # result.each do |item| - # # Each element is of type ::Google::Cloud::Redis::V1::Instance. - # p item - # end - # - def list_instances request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Redis::V1::ListInstancesRequest - - # Converts hash 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_instances.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::Redis::V1::VERSION, - transports_version_send: [:rest] - - call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - options.apply_defaults timeout: @config.rpcs.list_instances.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.list_instances.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @cloud_redis_stub.list_instances request, options do |result, operation| - result = ::Gapic::Rest::PagedEnumerable.new @cloud_redis_stub, :list_instances, "instances", 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 details of a specific Redis instance. - # - # @overload get_instance(request, options = nil) - # Pass arguments to `get_instance` via a request object, either of type - # {::Google::Cloud::Redis::V1::GetInstanceRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Redis::V1::GetInstanceRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_instance(name: nil) - # Pass arguments to `get_instance` via keyword arguments. Note that at - # least one keyword argument is 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. Redis instance resource name using the form: - # `projects/{project_id}/locations/{location_id}/instances/{instance_id}` - # where `location_id` refers to a GCP region. - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Cloud::Redis::V1::Instance] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::Redis::V1::Instance] - # - # @raise [::Google::Cloud::Error] if the REST call is aborted. - # - # @example Basic example - # require "google/cloud/redis/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Redis::V1::CloudRedis::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Redis::V1::GetInstanceRequest.new - # - # # Call the get_instance method. - # result = client.get_instance request - # - # # The returned object is of type Google::Cloud::Redis::V1::Instance. - # p result - # - def get_instance request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Redis::V1::GetInstanceRequest - - # Converts hash 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_instance.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::Redis::V1::VERSION, - transports_version_send: [:rest] - - call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - options.apply_defaults timeout: @config.rpcs.get_instance.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.get_instance.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @cloud_redis_stub.get_instance request, options do |result, operation| - yield result, operation if block_given? - end - rescue ::Gapic::Rest::Error => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Gets the AUTH string for a Redis instance. If AUTH is not enabled for the - # instance the response will be empty. This information is not included in - # the details returned to GetInstance. - # - # @overload get_instance_auth_string(request, options = nil) - # Pass arguments to `get_instance_auth_string` via a request object, either of type - # {::Google::Cloud::Redis::V1::GetInstanceAuthStringRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Redis::V1::GetInstanceAuthStringRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_instance_auth_string(name: nil) - # Pass arguments to `get_instance_auth_string` via keyword arguments. Note that at - # least one keyword argument is 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. Redis instance resource name using the form: - # `projects/{project_id}/locations/{location_id}/instances/{instance_id}` - # where `location_id` refers to a GCP region. - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Cloud::Redis::V1::InstanceAuthString] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::Redis::V1::InstanceAuthString] - # - # @raise [::Google::Cloud::Error] if the REST call is aborted. - # - # @example Basic example - # require "google/cloud/redis/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Redis::V1::CloudRedis::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Redis::V1::GetInstanceAuthStringRequest.new - # - # # Call the get_instance_auth_string method. - # result = client.get_instance_auth_string request - # - # # The returned object is of type Google::Cloud::Redis::V1::InstanceAuthString. - # p result - # - def get_instance_auth_string request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Redis::V1::GetInstanceAuthStringRequest - - # Converts hash 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_instance_auth_string.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::Redis::V1::VERSION, - transports_version_send: [:rest] - - call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - options.apply_defaults timeout: @config.rpcs.get_instance_auth_string.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.get_instance_auth_string.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @cloud_redis_stub.get_instance_auth_string request, options do |result, operation| - yield result, operation if block_given? - end - rescue ::Gapic::Rest::Error => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Creates a Redis instance based on the specified tier and memory size. - # - # By default, the instance is accessible from the project's - # [default network](https://cloud.google.com/vpc/docs/vpc). - # - # The creation is executed asynchronously and callers may check the returned - # operation to track its progress. Once the operation is completed the Redis - # instance will be fully functional. Completed longrunning.Operation will - # contain the new instance object in the response field. - # - # The returned operation is automatically deleted after a few hours, so there - # is no need to call DeleteOperation. - # - # @overload create_instance(request, options = nil) - # Pass arguments to `create_instance` via a request object, either of type - # {::Google::Cloud::Redis::V1::CreateInstanceRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Redis::V1::CreateInstanceRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_instance(parent: nil, instance_id: nil, instance: nil) - # Pass arguments to `create_instance` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param parent [::String] - # Required. The resource name of the instance location using the form: - # `projects/{project_id}/locations/{location_id}` - # where `location_id` refers to a GCP region. - # @param instance_id [::String] - # Required. The logical name of the Redis instance in the customer project - # with the following restrictions: - # - # * Must contain only lowercase letters, numbers, and hyphens. - # * Must start with a letter. - # * Must be between 1-40 characters. - # * Must end with a number or a letter. - # * Must be unique within the customer project / location - # @param instance [::Google::Cloud::Redis::V1::Instance, ::Hash] - # Required. A Redis [Instance] 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/cloud/redis/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Redis::V1::CloudRedis::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Redis::V1::CreateInstanceRequest.new - # - # # Call the create_instance method. - # result = client.create_instance 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_instance request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Redis::V1::CreateInstanceRequest - - # Converts hash 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_instance.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::Redis::V1::VERSION, - transports_version_send: [:rest] - - call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - options.apply_defaults timeout: @config.rpcs.create_instance.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.create_instance.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @cloud_redis_stub.create_instance 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 - - ## - # Updates the metadata and configuration of a specific Redis instance. - # - # Completed longrunning.Operation will contain the new instance object - # in the response field. The returned operation is automatically deleted - # after a few hours, so there is no need to call DeleteOperation. - # - # @overload update_instance(request, options = nil) - # Pass arguments to `update_instance` via a request object, either of type - # {::Google::Cloud::Redis::V1::UpdateInstanceRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Redis::V1::UpdateInstanceRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_instance(update_mask: nil, instance: nil) - # Pass arguments to `update_instance` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param update_mask [::Google::Protobuf::FieldMask, ::Hash] - # Required. Mask of fields to update. At least one path must be supplied in - # this field. The elements of the repeated paths field may only include these - # fields from {::Google::Cloud::Redis::V1::Instance Instance}: - # - # * `displayName` - # * `labels` - # * `memorySizeGb` - # * `redisConfig` - # * `replica_count` - # @param instance [::Google::Cloud::Redis::V1::Instance, ::Hash] - # Required. Update description. - # Only fields specified in update_mask are updated. - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Gapic::Operation] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Gapic::Operation] - # - # @raise [::Google::Cloud::Error] if the REST call is aborted. - # - # @example Basic example - # require "google/cloud/redis/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Redis::V1::CloudRedis::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Redis::V1::UpdateInstanceRequest.new - # - # # Call the update_instance method. - # result = client.update_instance 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_instance request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Redis::V1::UpdateInstanceRequest - - # Converts hash 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_instance.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::Redis::V1::VERSION, - transports_version_send: [:rest] - - call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - options.apply_defaults timeout: @config.rpcs.update_instance.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.update_instance.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @cloud_redis_stub.update_instance 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 - - ## - # Upgrades Redis instance to the newer Redis version specified in the - # request. - # - # @overload upgrade_instance(request, options = nil) - # Pass arguments to `upgrade_instance` via a request object, either of type - # {::Google::Cloud::Redis::V1::UpgradeInstanceRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Redis::V1::UpgradeInstanceRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @overload upgrade_instance(name: nil, redis_version: nil) - # Pass arguments to `upgrade_instance` via keyword arguments. Note that at - # least one keyword argument is 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. Redis instance resource name using the form: - # `projects/{project_id}/locations/{location_id}/instances/{instance_id}` - # where `location_id` refers to a GCP region. - # @param redis_version [::String] - # Required. Specifies the target version of Redis software to upgrade to. - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Gapic::Operation] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Gapic::Operation] - # - # @raise [::Google::Cloud::Error] if the REST call is aborted. - # - # @example Basic example - # require "google/cloud/redis/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Redis::V1::CloudRedis::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Redis::V1::UpgradeInstanceRequest.new - # - # # Call the upgrade_instance method. - # result = client.upgrade_instance 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 upgrade_instance request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Redis::V1::UpgradeInstanceRequest - - # Converts hash 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.upgrade_instance.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::Redis::V1::VERSION, - transports_version_send: [:rest] - - call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - options.apply_defaults timeout: @config.rpcs.upgrade_instance.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.upgrade_instance.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @cloud_redis_stub.upgrade_instance 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 - - ## - # Import a Redis RDB snapshot file from Cloud Storage into a Redis instance. - # - # Redis may stop serving during this operation. Instance state will be - # IMPORTING for entire operation. When complete, the instance will contain - # only data from the imported file. - # - # The returned operation is automatically deleted after a few hours, so - # there is no need to call DeleteOperation. - # - # @overload import_instance(request, options = nil) - # Pass arguments to `import_instance` via a request object, either of type - # {::Google::Cloud::Redis::V1::ImportInstanceRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Redis::V1::ImportInstanceRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @overload import_instance(name: nil, input_config: nil) - # Pass arguments to `import_instance` via keyword arguments. Note that at - # least one keyword argument is 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. Redis instance resource name using the form: - # `projects/{project_id}/locations/{location_id}/instances/{instance_id}` - # where `location_id` refers to a GCP region. - # @param input_config [::Google::Cloud::Redis::V1::InputConfig, ::Hash] - # Required. Specify data to be imported. - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Gapic::Operation] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Gapic::Operation] - # - # @raise [::Google::Cloud::Error] if the REST call is aborted. - # - # @example Basic example - # require "google/cloud/redis/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Redis::V1::CloudRedis::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Redis::V1::ImportInstanceRequest.new - # - # # Call the import_instance method. - # result = client.import_instance 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 import_instance request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Redis::V1::ImportInstanceRequest - - # Converts hash 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.import_instance.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::Redis::V1::VERSION, - transports_version_send: [:rest] - - call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - options.apply_defaults timeout: @config.rpcs.import_instance.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.import_instance.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @cloud_redis_stub.import_instance 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 - - ## - # Export Redis instance data into a Redis RDB format file in Cloud Storage. - # - # Redis will continue serving during this operation. - # - # The returned operation is automatically deleted after a few hours, so - # there is no need to call DeleteOperation. - # - # @overload export_instance(request, options = nil) - # Pass arguments to `export_instance` via a request object, either of type - # {::Google::Cloud::Redis::V1::ExportInstanceRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Redis::V1::ExportInstanceRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @overload export_instance(name: nil, output_config: nil) - # Pass arguments to `export_instance` via keyword arguments. Note that at - # least one keyword argument is 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. Redis instance resource name using the form: - # `projects/{project_id}/locations/{location_id}/instances/{instance_id}` - # where `location_id` refers to a GCP region. - # @param output_config [::Google::Cloud::Redis::V1::OutputConfig, ::Hash] - # Required. Specify data to be exported. - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Gapic::Operation] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Gapic::Operation] - # - # @raise [::Google::Cloud::Error] if the REST call is aborted. - # - # @example Basic example - # require "google/cloud/redis/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Redis::V1::CloudRedis::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Redis::V1::ExportInstanceRequest.new - # - # # Call the export_instance method. - # result = client.export_instance 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 export_instance request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Redis::V1::ExportInstanceRequest - - # Converts hash 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.export_instance.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::Redis::V1::VERSION, - transports_version_send: [:rest] - - call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - options.apply_defaults timeout: @config.rpcs.export_instance.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.export_instance.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @cloud_redis_stub.export_instance 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 - - ## - # Initiates a failover of the primary node to current replica node for a - # specific STANDARD tier Cloud Memorystore for Redis instance. - # - # @overload failover_instance(request, options = nil) - # Pass arguments to `failover_instance` via a request object, either of type - # {::Google::Cloud::Redis::V1::FailoverInstanceRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Redis::V1::FailoverInstanceRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @overload failover_instance(name: nil, data_protection_mode: nil) - # Pass arguments to `failover_instance` via keyword arguments. Note that at - # least one keyword argument is 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. Redis instance resource name using the form: - # `projects/{project_id}/locations/{location_id}/instances/{instance_id}` - # where `location_id` refers to a GCP region. - # @param data_protection_mode [::Google::Cloud::Redis::V1::FailoverInstanceRequest::DataProtectionMode] - # Optional. Available data protection modes that the user can choose. If it's - # unspecified, data protection mode will be LIMITED_DATA_LOSS by default. - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Gapic::Operation] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Gapic::Operation] - # - # @raise [::Google::Cloud::Error] if the REST call is aborted. - # - # @example Basic example - # require "google/cloud/redis/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Redis::V1::CloudRedis::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Redis::V1::FailoverInstanceRequest.new - # - # # Call the failover_instance method. - # result = client.failover_instance 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 failover_instance request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Redis::V1::FailoverInstanceRequest - - # Converts hash 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.failover_instance.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::Redis::V1::VERSION, - transports_version_send: [:rest] - - call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - options.apply_defaults timeout: @config.rpcs.failover_instance.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.failover_instance.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @cloud_redis_stub.failover_instance 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 specific Redis instance. Instance stops serving and data is - # deleted. - # - # @overload delete_instance(request, options = nil) - # Pass arguments to `delete_instance` via a request object, either of type - # {::Google::Cloud::Redis::V1::DeleteInstanceRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Redis::V1::DeleteInstanceRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_instance(name: nil) - # Pass arguments to `delete_instance` via keyword arguments. Note that at - # least one keyword argument is 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. Redis instance resource name using the form: - # `projects/{project_id}/locations/{location_id}/instances/{instance_id}` - # where `location_id` refers to a GCP region. - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Gapic::Operation] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Gapic::Operation] - # - # @raise [::Google::Cloud::Error] if the REST call is aborted. - # - # @example Basic example - # require "google/cloud/redis/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Redis::V1::CloudRedis::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Redis::V1::DeleteInstanceRequest.new - # - # # Call the delete_instance method. - # result = client.delete_instance 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_instance request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Redis::V1::DeleteInstanceRequest - - # Converts hash 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_instance.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::Redis::V1::VERSION, - transports_version_send: [:rest] - - call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - options.apply_defaults timeout: @config.rpcs.delete_instance.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.delete_instance.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @cloud_redis_stub.delete_instance 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 - - ## - # Reschedule maintenance for a given instance in a given project and - # location. - # - # @overload reschedule_maintenance(request, options = nil) - # Pass arguments to `reschedule_maintenance` via a request object, either of type - # {::Google::Cloud::Redis::V1::RescheduleMaintenanceRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Redis::V1::RescheduleMaintenanceRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @overload reschedule_maintenance(name: nil, reschedule_type: nil, schedule_time: nil) - # Pass arguments to `reschedule_maintenance` via keyword arguments. Note that at - # least one keyword argument is 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. Redis instance resource name using the form: - # `projects/{project_id}/locations/{location_id}/instances/{instance_id}` - # where `location_id` refers to a GCP region. - # @param reschedule_type [::Google::Cloud::Redis::V1::RescheduleMaintenanceRequest::RescheduleType] - # Required. If reschedule type is SPECIFIC_TIME, must set up schedule_time as - # well. - # @param schedule_time [::Google::Protobuf::Timestamp, ::Hash] - # Optional. Timestamp when the maintenance shall be rescheduled to if - # reschedule_type=SPECIFIC_TIME, in RFC 3339 format, for - # example `2012-11-15T16:19:00.094Z`. - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Gapic::Operation] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Gapic::Operation] - # - # @raise [::Google::Cloud::Error] if the REST call is aborted. - # - # @example Basic example - # require "google/cloud/redis/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Redis::V1::CloudRedis::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Redis::V1::RescheduleMaintenanceRequest.new - # - # # Call the reschedule_maintenance method. - # result = client.reschedule_maintenance 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 reschedule_maintenance request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Redis::V1::RescheduleMaintenanceRequest - - # Converts hash 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.reschedule_maintenance.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::Redis::V1::VERSION, - transports_version_send: [:rest] - - call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - options.apply_defaults timeout: @config.rpcs.reschedule_maintenance.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.reschedule_maintenance.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @cloud_redis_stub.reschedule_maintenance 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 - - ## - # Configuration class for the CloudRedis REST API. - # - # This class represents the configuration for CloudRedis REST, - # providing control over timeouts, retry behavior, logging, transport - # parameters, and other low-level controls. Certain parameters can also be - # applied individually to specific RPCs. See - # {::Google::Cloud::Redis::V1::CloudRedis::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_instances to 20 seconds, - # # and all remaining timeouts to 10 seconds. - # ::Google::Cloud::Redis::V1::CloudRedis::Rest::Client.configure do |config| - # config.timeout = 10.0 - # config.rpcs.list_instances.timeout = 20.0 - # end - # - # # Apply the above configuration only to a new client. - # client = ::Google::Cloud::Redis::V1::CloudRedis::Rest::Client.new do |config| - # config.timeout = 10.0 - # config.rpcs.list_instances.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 = "redis.googleapis.com" - - config_attr :endpoint, nil, ::String, nil - config_attr :credentials, nil do |value| - allowed = [::String, ::Hash, ::Proc, ::Symbol, ::Google::Auth::Credentials, ::Google::Auth::BaseClient, ::Signet::OAuth2::Client, nil] - allowed.any? { |klass| klass === value } - end - config_attr :scope, nil, ::String, ::Array, nil - config_attr :lib_name, nil, ::String, nil - config_attr :lib_version, nil, ::String, nil - config_attr :timeout, nil, ::Numeric, nil - config_attr :metadata, nil, ::Hash, nil - config_attr :retry_policy, nil, ::Hash, ::Proc, nil - config_attr :quota_project, nil, ::String, nil - config_attr :universe_domain, nil, ::String, nil - - # @private - # Overrides for http bindings for the RPCs of this service - # are only used when this service is used as mixin, and only - # by the host service. - # @return [::Hash{::Symbol=>::Array<::Gapic::Rest::GrpcTranscoder::HttpBinding>}] - config_attr :bindings_override, {}, ::Hash, nil - config_attr :logger, :default, ::Logger, nil, :default - - # @private - def initialize parent_config = nil - @parent_config = parent_config unless parent_config.nil? - - yield self if block_given? - end - - ## - # Configurations for individual RPCs - # @return [Rpcs] - # - def rpcs - @rpcs ||= begin - parent_rpcs = nil - parent_rpcs = @parent_config.rpcs if defined?(@parent_config) && @parent_config.respond_to?(:rpcs) - Rpcs.new parent_rpcs - end - end - - ## - # Configuration RPC class for the CloudRedis 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_instances` - # @return [::Gapic::Config::Method] - # - attr_reader :list_instances - ## - # RPC-specific configuration for `get_instance` - # @return [::Gapic::Config::Method] - # - attr_reader :get_instance - ## - # RPC-specific configuration for `get_instance_auth_string` - # @return [::Gapic::Config::Method] - # - attr_reader :get_instance_auth_string - ## - # RPC-specific configuration for `create_instance` - # @return [::Gapic::Config::Method] - # - attr_reader :create_instance - ## - # RPC-specific configuration for `update_instance` - # @return [::Gapic::Config::Method] - # - attr_reader :update_instance - ## - # RPC-specific configuration for `upgrade_instance` - # @return [::Gapic::Config::Method] - # - attr_reader :upgrade_instance - ## - # RPC-specific configuration for `import_instance` - # @return [::Gapic::Config::Method] - # - attr_reader :import_instance - ## - # RPC-specific configuration for `export_instance` - # @return [::Gapic::Config::Method] - # - attr_reader :export_instance - ## - # RPC-specific configuration for `failover_instance` - # @return [::Gapic::Config::Method] - # - attr_reader :failover_instance - ## - # RPC-specific configuration for `delete_instance` - # @return [::Gapic::Config::Method] - # - attr_reader :delete_instance - ## - # RPC-specific configuration for `reschedule_maintenance` - # @return [::Gapic::Config::Method] - # - attr_reader :reschedule_maintenance - - # @private - def initialize parent_rpcs = nil - list_instances_config = parent_rpcs.list_instances if parent_rpcs.respond_to? :list_instances - @list_instances = ::Gapic::Config::Method.new list_instances_config - get_instance_config = parent_rpcs.get_instance if parent_rpcs.respond_to? :get_instance - @get_instance = ::Gapic::Config::Method.new get_instance_config - get_instance_auth_string_config = parent_rpcs.get_instance_auth_string if parent_rpcs.respond_to? :get_instance_auth_string - @get_instance_auth_string = ::Gapic::Config::Method.new get_instance_auth_string_config - create_instance_config = parent_rpcs.create_instance if parent_rpcs.respond_to? :create_instance - @create_instance = ::Gapic::Config::Method.new create_instance_config - update_instance_config = parent_rpcs.update_instance if parent_rpcs.respond_to? :update_instance - @update_instance = ::Gapic::Config::Method.new update_instance_config - upgrade_instance_config = parent_rpcs.upgrade_instance if parent_rpcs.respond_to? :upgrade_instance - @upgrade_instance = ::Gapic::Config::Method.new upgrade_instance_config - import_instance_config = parent_rpcs.import_instance if parent_rpcs.respond_to? :import_instance - @import_instance = ::Gapic::Config::Method.new import_instance_config - export_instance_config = parent_rpcs.export_instance if parent_rpcs.respond_to? :export_instance - @export_instance = ::Gapic::Config::Method.new export_instance_config - failover_instance_config = parent_rpcs.failover_instance if parent_rpcs.respond_to? :failover_instance - @failover_instance = ::Gapic::Config::Method.new failover_instance_config - delete_instance_config = parent_rpcs.delete_instance if parent_rpcs.respond_to? :delete_instance - @delete_instance = ::Gapic::Config::Method.new delete_instance_config - reschedule_maintenance_config = parent_rpcs.reschedule_maintenance if parent_rpcs.respond_to? :reschedule_maintenance - @reschedule_maintenance = ::Gapic::Config::Method.new reschedule_maintenance_config - - yield self if block_given? - end - end - end - end - end - end - end - end - end -end diff --git a/owl-bot-staging/google-cloud-redis-v1/lib/google/cloud/redis/v1/cloud_redis/rest/operations.rb b/owl-bot-staging/google-cloud-redis-v1/lib/google/cloud/redis/v1/cloud_redis/rest/operations.rb deleted file mode 100644 index 79e5ab9ba956..000000000000 --- a/owl-bot-staging/google-cloud-redis-v1/lib/google/cloud/redis/v1/cloud_redis/rest/operations.rb +++ /dev/null @@ -1,924 +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 Cloud - module Redis - module V1 - module CloudRedis - module Rest - # Service that implements Longrunning Operations API. - class Operations - # @private - API_VERSION = "" - - # @private - DEFAULT_ENDPOINT_TEMPLATE = "redis.$UNIVERSE_DOMAIN$" - - # @private - attr_reader :operations_stub - - ## - # Configuration for the CloudRedis 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 CloudRedis 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::Redis::V1::VERSION, - transports_version_send: [:rest] - - call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - options.apply_defaults timeout: @config.rpcs.list_operations.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.list_operations.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @operations_stub.list_operations request, options do |result, operation| - result = ::Gapic::Rest::PagedEnumerable.new @operations_stub, :list_operations, "operations", request, result, options - yield result, operation if block_given? - 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::Redis::V1::VERSION, - transports_version_send: [:rest] - - call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - options.apply_defaults timeout: @config.rpcs.get_operation.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.get_operation.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @operations_stub.get_operation request, options do |result, operation| - result = ::Gapic::Operation.new result, @operations_client, options: options - yield result, operation if block_given? - 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::Redis::V1::VERSION, - transports_version_send: [:rest] - - call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - options.apply_defaults timeout: @config.rpcs.delete_operation.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.delete_operation.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @operations_stub.delete_operation request, options do |result, operation| - yield result, operation if block_given? - 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::Redis::V1::VERSION, - transports_version_send: [:rest] - - call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - options.apply_defaults timeout: @config.rpcs.cancel_operation.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.cancel_operation.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @operations_stub.cancel_operation request, options do |result, operation| - yield result, operation if block_given? - 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 = "redis.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}/operations", - matches: [ - ["name", %r{^projects/[^/]+/locations/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the get_operation REST call - # - # @param request_pb [::Google::Longrunning::GetOperationRequest] - # A request object representing the call parameters. Required. - # @return [Array(String, [String, nil], Hash{String => String})] - # Uri, Body, Query string parameters - def self.transcode_get_operation_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :get, - uri_template: "/v1/{name}", - matches: [ - ["name", %r{^projects/[^/]+/locations/[^/]+/operations/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the delete_operation REST call - # - # @param request_pb [::Google::Longrunning::DeleteOperationRequest] - # A request object representing the call parameters. Required. - # @return [Array(String, [String, nil], Hash{String => String})] - # Uri, Body, Query string parameters - def self.transcode_delete_operation_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :delete, - uri_template: "/v1/{name}", - matches: [ - ["name", %r{^projects/[^/]+/locations/[^/]+/operations/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the cancel_operation REST call - # - # @param request_pb [::Google::Longrunning::CancelOperationRequest] - # A request object representing the call parameters. Required. - # @return [Array(String, [String, nil], Hash{String => String})] - # Uri, Body, Query string parameters - def self.transcode_cancel_operation_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :post, - uri_template: "/v1/{name}:cancel", - matches: [ - ["name", %r{^projects/[^/]+/locations/[^/]+/operations/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - end - end - end - end - end - end -end diff --git a/owl-bot-staging/google-cloud-redis-v1/lib/google/cloud/redis/v1/cloud_redis/rest/service_stub.rb b/owl-bot-staging/google-cloud-redis-v1/lib/google/cloud/redis/v1/cloud_redis/rest/service_stub.rb deleted file mode 100644 index c768dbf9d049..000000000000 --- a/owl-bot-staging/google-cloud-redis-v1/lib/google/cloud/redis/v1/cloud_redis/rest/service_stub.rb +++ /dev/null @@ -1,759 +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/redis/v1/cloud_redis_pb" - -module Google - module Cloud - module Redis - module V1 - module CloudRedis - module Rest - ## - # REST service stub for the CloudRedis service. - # Service stub contains baseline method implementations - # including transcoding, making the REST call, and deserialing the response. - # - class ServiceStub - # @private - def initialize endpoint:, endpoint_template:, universe_domain:, credentials:, logger: - # These require statements are intentionally placed here to initialize - # the REST modules only when it's required. - require "gapic/rest" - - @client_stub = ::Gapic::Rest::ClientStub.new endpoint: endpoint, - endpoint_template: endpoint_template, - universe_domain: universe_domain, - credentials: credentials, - numeric_enums: true, - service_name: self.class, - raise_faraday_errors: false, - logger: logger - end - - ## - # The effective universe domain - # - # @return [String] - # - def universe_domain - @client_stub.universe_domain - end - - ## - # The effective endpoint - # - # @return [String] - # - def endpoint - @client_stub.endpoint - end - - ## - # The logger used for request/response debug logging. - # - # @return [Logger] - # - def logger stub: false - stub ? @client_stub.stub_logger : @client_stub.logger - end - - ## - # Baseline implementation for the list_instances REST call - # - # @param request_pb [::Google::Cloud::Redis::V1::ListInstancesRequest] - # A request object representing the call parameters. Required. - # @param options [::Gapic::CallOptions] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Cloud::Redis::V1::ListInstancesResponse] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::Redis::V1::ListInstancesResponse] - # A result object deserialized from the server's reply - def list_instances request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_list_instances_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_instances", - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Cloud::Redis::V1::ListInstancesResponse.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_instance REST call - # - # @param request_pb [::Google::Cloud::Redis::V1::GetInstanceRequest] - # A request object representing the call parameters. Required. - # @param options [::Gapic::CallOptions] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Cloud::Redis::V1::Instance] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::Redis::V1::Instance] - # A result object deserialized from the server's reply - def get_instance request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_get_instance_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_instance", - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Cloud::Redis::V1::Instance.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_instance_auth_string REST call - # - # @param request_pb [::Google::Cloud::Redis::V1::GetInstanceAuthStringRequest] - # A request object representing the call parameters. Required. - # @param options [::Gapic::CallOptions] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Cloud::Redis::V1::InstanceAuthString] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::Redis::V1::InstanceAuthString] - # A result object deserialized from the server's reply - def get_instance_auth_string request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_get_instance_auth_string_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_instance_auth_string", - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Cloud::Redis::V1::InstanceAuthString.decode_json response.body, ignore_unknown_fields: true - catch :response do - yield result, operation if block_given? - result - end - end - - ## - # Baseline implementation for the create_instance REST call - # - # @param request_pb [::Google::Cloud::Redis::V1::CreateInstanceRequest] - # 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_instance request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_create_instance_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_instance", - 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 update_instance REST call - # - # @param request_pb [::Google::Cloud::Redis::V1::UpdateInstanceRequest] - # 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_instance request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_update_instance_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_instance", - 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 upgrade_instance REST call - # - # @param request_pb [::Google::Cloud::Redis::V1::UpgradeInstanceRequest] - # 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 upgrade_instance request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_upgrade_instance_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: "upgrade_instance", - 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 import_instance REST call - # - # @param request_pb [::Google::Cloud::Redis::V1::ImportInstanceRequest] - # 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 import_instance request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_import_instance_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: "import_instance", - 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 export_instance REST call - # - # @param request_pb [::Google::Cloud::Redis::V1::ExportInstanceRequest] - # 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 export_instance request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_export_instance_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: "export_instance", - 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 failover_instance REST call - # - # @param request_pb [::Google::Cloud::Redis::V1::FailoverInstanceRequest] - # 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 failover_instance request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_failover_instance_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: "failover_instance", - 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_instance REST call - # - # @param request_pb [::Google::Cloud::Redis::V1::DeleteInstanceRequest] - # 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_instance request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_delete_instance_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_instance", - 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 reschedule_maintenance REST call - # - # @param request_pb [::Google::Cloud::Redis::V1::RescheduleMaintenanceRequest] - # 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 reschedule_maintenance request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_reschedule_maintenance_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: "reschedule_maintenance", - 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 - - ## - # @private - # - # GRPC transcoding helper method for the list_instances REST call - # - # @param request_pb [::Google::Cloud::Redis::V1::ListInstancesRequest] - # 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_instances_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :get, - uri_template: "/v1/{parent}/instances", - matches: [ - ["parent", %r{^projects/[^/]+/locations/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the get_instance REST call - # - # @param request_pb [::Google::Cloud::Redis::V1::GetInstanceRequest] - # 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_instance_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :get, - uri_template: "/v1/{name}", - matches: [ - ["name", %r{^projects/[^/]+/locations/[^/]+/instances/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the get_instance_auth_string REST call - # - # @param request_pb [::Google::Cloud::Redis::V1::GetInstanceAuthStringRequest] - # 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_instance_auth_string_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :get, - uri_template: "/v1/{name}/authString", - matches: [ - ["name", %r{^projects/[^/]+/locations/[^/]+/instances/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the create_instance REST call - # - # @param request_pb [::Google::Cloud::Redis::V1::CreateInstanceRequest] - # 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_instance_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :post, - uri_template: "/v1/{parent}/instances", - body: "instance", - matches: [ - ["parent", %r{^projects/[^/]+/locations/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the update_instance REST call - # - # @param request_pb [::Google::Cloud::Redis::V1::UpdateInstanceRequest] - # 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_instance_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :patch, - uri_template: "/v1/{instance.name}", - body: "instance", - matches: [ - ["instance.name", %r{^projects/[^/]+/locations/[^/]+/instances/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the upgrade_instance REST call - # - # @param request_pb [::Google::Cloud::Redis::V1::UpgradeInstanceRequest] - # A request object representing the call parameters. Required. - # @return [Array(String, [String, nil], Hash{String => String})] - # Uri, Body, Query string parameters - def self.transcode_upgrade_instance_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :post, - uri_template: "/v1/{name}:upgrade", - body: "*", - matches: [ - ["name", %r{^projects/[^/]+/locations/[^/]+/instances/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the import_instance REST call - # - # @param request_pb [::Google::Cloud::Redis::V1::ImportInstanceRequest] - # A request object representing the call parameters. Required. - # @return [Array(String, [String, nil], Hash{String => String})] - # Uri, Body, Query string parameters - def self.transcode_import_instance_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :post, - uri_template: "/v1/{name}:import", - body: "*", - matches: [ - ["name", %r{^projects/[^/]+/locations/[^/]+/instances/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the export_instance REST call - # - # @param request_pb [::Google::Cloud::Redis::V1::ExportInstanceRequest] - # A request object representing the call parameters. Required. - # @return [Array(String, [String, nil], Hash{String => String})] - # Uri, Body, Query string parameters - def self.transcode_export_instance_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :post, - uri_template: "/v1/{name}:export", - body: "*", - matches: [ - ["name", %r{^projects/[^/]+/locations/[^/]+/instances/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the failover_instance REST call - # - # @param request_pb [::Google::Cloud::Redis::V1::FailoverInstanceRequest] - # A request object representing the call parameters. Required. - # @return [Array(String, [String, nil], Hash{String => String})] - # Uri, Body, Query string parameters - def self.transcode_failover_instance_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :post, - uri_template: "/v1/{name}:failover", - body: "*", - matches: [ - ["name", %r{^projects/[^/]+/locations/[^/]+/instances/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the delete_instance REST call - # - # @param request_pb [::Google::Cloud::Redis::V1::DeleteInstanceRequest] - # 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_instance_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :delete, - uri_template: "/v1/{name}", - matches: [ - ["name", %r{^projects/[^/]+/locations/[^/]+/instances/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the reschedule_maintenance REST call - # - # @param request_pb [::Google::Cloud::Redis::V1::RescheduleMaintenanceRequest] - # A request object representing the call parameters. Required. - # @return [Array(String, [String, nil], Hash{String => String})] - # Uri, Body, Query string parameters - def self.transcode_reschedule_maintenance_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :post, - uri_template: "/v1/{name}:rescheduleMaintenance", - body: "*", - matches: [ - ["name", %r{^projects/[^/]+/locations/[^/]+/instances/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - end - end - end - end - end - end -end diff --git a/owl-bot-staging/google-cloud-redis-v1/lib/google/cloud/redis/v1/cloud_redis_pb.rb b/owl-bot-staging/google-cloud-redis-v1/lib/google/cloud/redis/v1/cloud_redis_pb.rb deleted file mode 100644 index 6df342725ce7..000000000000 --- a/owl-bot-staging/google-cloud-redis-v1/lib/google/cloud/redis/v1/cloud_redis_pb.rb +++ /dev/null @@ -1,69 +0,0 @@ -# frozen_string_literal: true -# Generated by the protocol buffer compiler. DO NOT EDIT! -# source: google/cloud/redis/v1/cloud_redis.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/longrunning/operations_pb' -require 'google/protobuf/duration_pb' -require 'google/protobuf/empty_pb' -require 'google/protobuf/field_mask_pb' -require 'google/protobuf/timestamp_pb' -require 'google/type/dayofweek_pb' -require 'google/type/timeofday_pb' - - -descriptor_data = "\n\'google/cloud/redis/v1/cloud_redis.proto\x12\x15google.cloud.redis.v1\x1a\x1cgoogle/api/annotations.proto\x1a\x17google/api/client.proto\x1a\x1fgoogle/api/field_behavior.proto\x1a\x19google/api/resource.proto\x1a#google/longrunning/operations.proto\x1a\x1egoogle/protobuf/duration.proto\x1a\x1bgoogle/protobuf/empty.proto\x1a google/protobuf/field_mask.proto\x1a\x1fgoogle/protobuf/timestamp.proto\x1a\x1bgoogle/type/dayofweek.proto\x1a\x1bgoogle/type/timeofday.proto\".\n\x08NodeInfo\x12\x0f\n\x02id\x18\x01 \x01(\tB\x03\xe0\x41\x03\x12\x11\n\x04zone\x18\x02 \x01(\tB\x03\xe0\x41\x03\"\x85\x13\n\x08Instance\x12\x11\n\x04name\x18\x01 \x01(\tB\x03\xe0\x41\x02\x12\x14\n\x0c\x64isplay_name\x18\x02 \x01(\t\x12;\n\x06labels\x18\x03 \x03(\x0b\x32+.google.cloud.redis.v1.Instance.LabelsEntry\x12\x18\n\x0blocation_id\x18\x04 \x01(\tB\x03\xe0\x41\x01\x12$\n\x17\x61lternative_location_id\x18\x05 \x01(\tB\x03\xe0\x41\x01\x12\x1a\n\rredis_version\x18\x07 \x01(\tB\x03\xe0\x41\x01\x12\x1e\n\x11reserved_ip_range\x18\t \x01(\tB\x03\xe0\x41\x01\x12\x1f\n\x12secondary_ip_range\x18\x1e \x01(\tB\x03\xe0\x41\x01\x12\x11\n\x04host\x18\n \x01(\tB\x03\xe0\x41\x03\x12\x11\n\x04port\x18\x0b \x01(\x05\x42\x03\xe0\x41\x03\x12 \n\x13\x63urrent_location_id\x18\x0c \x01(\tB\x03\xe0\x41\x03\x12\x34\n\x0b\x63reate_time\x18\r \x01(\x0b\x32\x1a.google.protobuf.TimestampB\x03\xe0\x41\x03\x12\x39\n\x05state\x18\x0e \x01(\x0e\x32%.google.cloud.redis.v1.Instance.StateB\x03\xe0\x41\x03\x12\x1b\n\x0estatus_message\x18\x0f \x01(\tB\x03\xe0\x41\x03\x12M\n\rredis_configs\x18\x10 \x03(\x0b\x32\x31.google.cloud.redis.v1.Instance.RedisConfigsEntryB\x03\xe0\x41\x01\x12\x37\n\x04tier\x18\x11 \x01(\x0e\x32$.google.cloud.redis.v1.Instance.TierB\x03\xe0\x41\x02\x12\x1b\n\x0ememory_size_gb\x18\x12 \x01(\x05\x42\x03\xe0\x41\x02\x12\x1f\n\x12\x61uthorized_network\x18\x14 \x01(\tB\x03\xe0\x41\x01\x12%\n\x18persistence_iam_identity\x18\x15 \x01(\tB\x03\xe0\x41\x03\x12\x46\n\x0c\x63onnect_mode\x18\x16 \x01(\x0e\x32+.google.cloud.redis.v1.Instance.ConnectModeB\x03\xe0\x41\x01\x12\x19\n\x0c\x61uth_enabled\x18\x17 \x01(\x08\x42\x03\xe0\x41\x01\x12\x43\n\x0fserver_ca_certs\x18\x19 \x03(\x0b\x32%.google.cloud.redis.v1.TlsCertificateB\x03\xe0\x41\x03\x12[\n\x17transit_encryption_mode\x18\x1a \x01(\x0e\x32\x35.google.cloud.redis.v1.Instance.TransitEncryptionModeB\x03\xe0\x41\x01\x12I\n\x12maintenance_policy\x18\x1b \x01(\x0b\x32(.google.cloud.redis.v1.MaintenancePolicyB\x03\xe0\x41\x01\x12M\n\x14maintenance_schedule\x18\x1c \x01(\x0b\x32*.google.cloud.redis.v1.MaintenanceScheduleB\x03\xe0\x41\x03\x12\x1a\n\rreplica_count\x18\x1f \x01(\x05\x42\x03\xe0\x41\x01\x12\x33\n\x05nodes\x18 \x03(\x0b\x32\x1f.google.cloud.redis.v1.NodeInfoB\x03\xe0\x41\x03\x12\x1a\n\rread_endpoint\x18! \x01(\tB\x03\xe0\x41\x03\x12\x1f\n\x12read_endpoint_port\x18\" \x01(\x05\x42\x03\xe0\x41\x03\x12Q\n\x12read_replicas_mode\x18# \x01(\x0e\x32\x30.google.cloud.redis.v1.Instance.ReadReplicasModeB\x03\xe0\x41\x01\x12!\n\x14\x63ustomer_managed_key\x18$ \x01(\tB\x03\xe0\x41\x01\x12I\n\x12persistence_config\x18% \x01(\x0b\x32(.google.cloud.redis.v1.PersistenceConfigB\x03\xe0\x41\x01\x12Q\n\x12suspension_reasons\x18& \x03(\x0e\x32\x30.google.cloud.redis.v1.Instance.SuspensionReasonB\x03\xe0\x41\x01\x12 \n\x13maintenance_version\x18\' \x01(\tB\x03\xe0\x41\x01\x12+\n\x1e\x61vailable_maintenance_versions\x18( \x03(\tB\x03\xe0\x41\x01\x1a-\n\x0bLabelsEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12\r\n\x05value\x18\x02 \x01(\t:\x02\x38\x01\x1a\x33\n\x11RedisConfigsEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12\r\n\x05value\x18\x02 \x01(\t:\x02\x38\x01\"\x94\x01\n\x05State\x12\x15\n\x11STATE_UNSPECIFIED\x10\x00\x12\x0c\n\x08\x43REATING\x10\x01\x12\t\n\x05READY\x10\x02\x12\x0c\n\x08UPDATING\x10\x03\x12\x0c\n\x08\x44\x45LETING\x10\x04\x12\r\n\tREPAIRING\x10\x05\x12\x0f\n\x0bMAINTENANCE\x10\x06\x12\r\n\tIMPORTING\x10\x08\x12\x10\n\x0c\x46\x41ILING_OVER\x10\t\"8\n\x04Tier\x12\x14\n\x10TIER_UNSPECIFIED\x10\x00\x12\t\n\x05\x42\x41SIC\x10\x01\x12\x0f\n\x0bSTANDARD_HA\x10\x03\"[\n\x0b\x43onnectMode\x12\x1c\n\x18\x43ONNECT_MODE_UNSPECIFIED\x10\x00\x12\x12\n\x0e\x44IRECT_PEERING\x10\x01\x12\x1a\n\x16PRIVATE_SERVICE_ACCESS\x10\x02\"i\n\x15TransitEncryptionMode\x12\'\n#TRANSIT_ENCRYPTION_MODE_UNSPECIFIED\x10\x00\x12\x19\n\x15SERVER_AUTHENTICATION\x10\x01\x12\x0c\n\x08\x44ISABLED\x10\x02\"m\n\x10ReadReplicasMode\x12\"\n\x1eREAD_REPLICAS_MODE_UNSPECIFIED\x10\x00\x12\x1a\n\x16READ_REPLICAS_DISABLED\x10\x01\x12\x19\n\x15READ_REPLICAS_ENABLED\x10\x02\"U\n\x10SuspensionReason\x12!\n\x1dSUSPENSION_REASON_UNSPECIFIED\x10\x00\x12\x1e\n\x1a\x43USTOMER_MANAGED_KEY_ISSUE\x10\x01:`\xea\x41]\n\x1dredis.googleapis.com/Instance\x12\xda\x41\x06parent\x82\xd3\xe4\x93\x02/\x12-/v1/{parent=projects/*/locations/*}/instances\x12\x97\x01\n\x0bGetInstance\x12).google.cloud.redis.v1.GetInstanceRequest\x1a\x1f.google.cloud.redis.v1.Instance\"<\xda\x41\x04name\x82\xd3\xe4\x93\x02/\x12-/v1/{name=projects/*/locations/*/instances/*}\x12\xc0\x01\n\x15GetInstanceAuthString\x12\x33.google.cloud.redis.v1.GetInstanceAuthStringRequest\x1a).google.cloud.redis.v1.InstanceAuthString\"G\xda\x41\x04name\x82\xd3\xe4\x93\x02:\x12\x38/v1/{name=projects/*/locations/*/instances/*}/authString\x12\x89\x02\n\x0e\x43reateInstance\x12,.google.cloud.redis.v1.CreateInstanceRequest\x1a\x1d.google.longrunning.Operation\"\xa9\x01\xca\x41I\n\x1egoogle.cloud.redis.v1.Instance\x12\'google.cloud.redis.v1.OperationMetadata\xda\x41\x1bparent,instance_id,instance\x82\xd3\xe4\x93\x02\x39\"-/v1/{parent=projects/*/locations/*}/instances:\x08instance\x12\x8b\x02\n\x0eUpdateInstance\x12,.google.cloud.redis.v1.UpdateInstanceRequest\x1a\x1d.google.longrunning.Operation\"\xab\x01\xca\x41I\n\x1egoogle.cloud.redis.v1.Instance\x12\'google.cloud.redis.v1.OperationMetadata\xda\x41\x14update_mask,instance\x82\xd3\xe4\x93\x02\x42\x32\x36/v1/{instance.name=projects/*/locations/*/instances/*}:\x08instance\x12\x83\x02\n\x0fUpgradeInstance\x12-.google.cloud.redis.v1.UpgradeInstanceRequest\x1a\x1d.google.longrunning.Operation\"\xa1\x01\xca\x41I\n\x1egoogle.cloud.redis.v1.Instance\x12\'google.cloud.redis.v1.OperationMetadata\xda\x41\x12name,redis_version\x82\xd3\xe4\x93\x02:\"5/v1/{name=projects/*/locations/*/instances/*}:upgrade:\x01*\x12\xff\x01\n\x0eImportInstance\x12,.google.cloud.redis.v1.ImportInstanceRequest\x1a\x1d.google.longrunning.Operation\"\x9f\x01\xca\x41I\n\x1egoogle.cloud.redis.v1.Instance\x12\'google.cloud.redis.v1.OperationMetadata\xda\x41\x11name,input_config\x82\xd3\xe4\x93\x02\x39\"4/v1/{name=projects/*/locations/*/instances/*}:import:\x01*\x12\x80\x02\n\x0e\x45xportInstance\x12,.google.cloud.redis.v1.ExportInstanceRequest\x1a\x1d.google.longrunning.Operation\"\xa0\x01\xca\x41I\n\x1egoogle.cloud.redis.v1.Instance\x12\'google.cloud.redis.v1.OperationMetadata\xda\x41\x12name,output_config\x82\xd3\xe4\x93\x02\x39\"4/v1/{name=projects/*/locations/*/instances/*}:export:\x01*\x12\x8d\x02\n\x10\x46\x61iloverInstance\x12..google.cloud.redis.v1.FailoverInstanceRequest\x1a\x1d.google.longrunning.Operation\"\xa9\x01\xca\x41I\n\x1egoogle.cloud.redis.v1.Instance\x12\'google.cloud.redis.v1.OperationMetadata\xda\x41\x19name,data_protection_mode\x82\xd3\xe4\x93\x02;\"6/v1/{name=projects/*/locations/*/instances/*}:failover:\x01*\x12\xde\x01\n\x0e\x44\x65leteInstance\x12,.google.cloud.redis.v1.DeleteInstanceRequest\x1a\x1d.google.longrunning.Operation\"\x7f\xca\x41@\n\x15google.protobuf.Empty\x12\'google.cloud.redis.v1.OperationMetadata\xda\x41\x04name\x82\xd3\xe4\x93\x02/*-/v1/{name=projects/*/locations/*/instances/*}\x12\xaf\x02\n\x15RescheduleMaintenance\x12\x33.google.cloud.redis.v1.RescheduleMaintenanceRequest\x1a\x1d.google.longrunning.Operation\"\xc1\x01\xca\x41I\n\x1egoogle.cloud.redis.v1.Instance\x12\'google.cloud.redis.v1.OperationMetadata\xda\x41$name, reschedule_type, schedule_time\x82\xd3\xe4\x93\x02H\"C/v1/{name=projects/*/locations/*/instances/*}:rescheduleMaintenance:\x01*\x1aH\xca\x41\x14redis.googleapis.com\xd2\x41.https://www.googleapis.com/auth/cloud-platformBh\n\x19\x63om.google.cloud.redis.v1B\x18\x43loudRedisServiceV1ProtoP\x01Z/cloud.google.com/go/redis/apiv1/redispb;redispbb\x06proto3" - -pool = ::Google::Protobuf::DescriptorPool.generated_pool -pool.add_serialized_file(descriptor_data) - -module Google - module Cloud - module Redis - module V1 - NodeInfo = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.redis.v1.NodeInfo").msgclass - Instance = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.redis.v1.Instance").msgclass - Instance::State = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.redis.v1.Instance.State").enummodule - Instance::Tier = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.redis.v1.Instance.Tier").enummodule - Instance::ConnectMode = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.redis.v1.Instance.ConnectMode").enummodule - Instance::TransitEncryptionMode = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.redis.v1.Instance.TransitEncryptionMode").enummodule - Instance::ReadReplicasMode = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.redis.v1.Instance.ReadReplicasMode").enummodule - Instance::SuspensionReason = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.redis.v1.Instance.SuspensionReason").enummodule - PersistenceConfig = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.redis.v1.PersistenceConfig").msgclass - PersistenceConfig::PersistenceMode = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.redis.v1.PersistenceConfig.PersistenceMode").enummodule - PersistenceConfig::SnapshotPeriod = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.redis.v1.PersistenceConfig.SnapshotPeriod").enummodule - RescheduleMaintenanceRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.redis.v1.RescheduleMaintenanceRequest").msgclass - RescheduleMaintenanceRequest::RescheduleType = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.redis.v1.RescheduleMaintenanceRequest.RescheduleType").enummodule - MaintenancePolicy = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.redis.v1.MaintenancePolicy").msgclass - WeeklyMaintenanceWindow = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.redis.v1.WeeklyMaintenanceWindow").msgclass - MaintenanceSchedule = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.redis.v1.MaintenanceSchedule").msgclass - ListInstancesRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.redis.v1.ListInstancesRequest").msgclass - ListInstancesResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.redis.v1.ListInstancesResponse").msgclass - GetInstanceRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.redis.v1.GetInstanceRequest").msgclass - GetInstanceAuthStringRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.redis.v1.GetInstanceAuthStringRequest").msgclass - InstanceAuthString = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.redis.v1.InstanceAuthString").msgclass - CreateInstanceRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.redis.v1.CreateInstanceRequest").msgclass - UpdateInstanceRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.redis.v1.UpdateInstanceRequest").msgclass - UpgradeInstanceRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.redis.v1.UpgradeInstanceRequest").msgclass - DeleteInstanceRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.redis.v1.DeleteInstanceRequest").msgclass - GcsSource = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.redis.v1.GcsSource").msgclass - InputConfig = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.redis.v1.InputConfig").msgclass - ImportInstanceRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.redis.v1.ImportInstanceRequest").msgclass - GcsDestination = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.redis.v1.GcsDestination").msgclass - OutputConfig = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.redis.v1.OutputConfig").msgclass - ExportInstanceRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.redis.v1.ExportInstanceRequest").msgclass - FailoverInstanceRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.redis.v1.FailoverInstanceRequest").msgclass - FailoverInstanceRequest::DataProtectionMode = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.redis.v1.FailoverInstanceRequest.DataProtectionMode").enummodule - OperationMetadata = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.redis.v1.OperationMetadata").msgclass - LocationMetadata = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.redis.v1.LocationMetadata").msgclass - ZoneMetadata = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.redis.v1.ZoneMetadata").msgclass - TlsCertificate = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.redis.v1.TlsCertificate").msgclass - end - end - end -end diff --git a/owl-bot-staging/google-cloud-redis-v1/lib/google/cloud/redis/v1/cloud_redis_services_pb.rb b/owl-bot-staging/google-cloud-redis-v1/lib/google/cloud/redis/v1/cloud_redis_services_pb.rb deleted file mode 100644 index 46495700f5c3..000000000000 --- a/owl-bot-staging/google-cloud-redis-v1/lib/google/cloud/redis/v1/cloud_redis_services_pb.rb +++ /dev/null @@ -1,120 +0,0 @@ -# Generated by the protocol buffer compiler. DO NOT EDIT! -# Source: google/cloud/redis/v1/cloud_redis.proto for package 'google.cloud.redis.v1' -# Original file comments: -# 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 -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. -# - -require 'grpc' -require 'google/cloud/redis/v1/cloud_redis_pb' - -module Google - module Cloud - module Redis - module V1 - module CloudRedis - # Configures and manages Cloud Memorystore for Redis instances - # - # Google Cloud Memorystore for Redis v1 - # - # The `redis.googleapis.com` service implements the Google Cloud Memorystore - # for Redis API and defines the following resource model for managing Redis - # instances: - # * The service works with a collection of cloud projects, named: `/projects/*` - # * Each project has a collection of available locations, named: `/locations/*` - # * Each location has a collection of Redis instances, named: `/instances/*` - # * As such, Redis instances are resources of the form: - # `/projects/{project_id}/locations/{location_id}/instances/{instance_id}` - # - # Note that location_id must be referring to a GCP `region`; for example: - # * `projects/redpepper-1290/locations/us-central1/instances/my-redis` - class Service - - include ::GRPC::GenericService - - self.marshal_class_method = :encode - self.unmarshal_class_method = :decode - self.service_name = 'google.cloud.redis.v1.CloudRedis' - - # Lists all Redis instances owned by a project in either the specified - # location (region) or all locations. - # - # The location should have the following format: - # - # * `projects/{project_id}/locations/{location_id}` - # - # If `location_id` is specified as `-` (wildcard), then all regions - # available to the project are queried, and the results are aggregated. - rpc :ListInstances, ::Google::Cloud::Redis::V1::ListInstancesRequest, ::Google::Cloud::Redis::V1::ListInstancesResponse - # Gets the details of a specific Redis instance. - rpc :GetInstance, ::Google::Cloud::Redis::V1::GetInstanceRequest, ::Google::Cloud::Redis::V1::Instance - # Gets the AUTH string for a Redis instance. If AUTH is not enabled for the - # instance the response will be empty. This information is not included in - # the details returned to GetInstance. - rpc :GetInstanceAuthString, ::Google::Cloud::Redis::V1::GetInstanceAuthStringRequest, ::Google::Cloud::Redis::V1::InstanceAuthString - # Creates a Redis instance based on the specified tier and memory size. - # - # By default, the instance is accessible from the project's - # [default network](https://cloud.google.com/vpc/docs/vpc). - # - # The creation is executed asynchronously and callers may check the returned - # operation to track its progress. Once the operation is completed the Redis - # instance will be fully functional. Completed longrunning.Operation will - # contain the new instance object in the response field. - # - # The returned operation is automatically deleted after a few hours, so there - # is no need to call DeleteOperation. - rpc :CreateInstance, ::Google::Cloud::Redis::V1::CreateInstanceRequest, ::Google::Longrunning::Operation - # Updates the metadata and configuration of a specific Redis instance. - # - # Completed longrunning.Operation will contain the new instance object - # in the response field. The returned operation is automatically deleted - # after a few hours, so there is no need to call DeleteOperation. - rpc :UpdateInstance, ::Google::Cloud::Redis::V1::UpdateInstanceRequest, ::Google::Longrunning::Operation - # Upgrades Redis instance to the newer Redis version specified in the - # request. - rpc :UpgradeInstance, ::Google::Cloud::Redis::V1::UpgradeInstanceRequest, ::Google::Longrunning::Operation - # Import a Redis RDB snapshot file from Cloud Storage into a Redis instance. - # - # Redis may stop serving during this operation. Instance state will be - # IMPORTING for entire operation. When complete, the instance will contain - # only data from the imported file. - # - # The returned operation is automatically deleted after a few hours, so - # there is no need to call DeleteOperation. - rpc :ImportInstance, ::Google::Cloud::Redis::V1::ImportInstanceRequest, ::Google::Longrunning::Operation - # Export Redis instance data into a Redis RDB format file in Cloud Storage. - # - # Redis will continue serving during this operation. - # - # The returned operation is automatically deleted after a few hours, so - # there is no need to call DeleteOperation. - rpc :ExportInstance, ::Google::Cloud::Redis::V1::ExportInstanceRequest, ::Google::Longrunning::Operation - # Initiates a failover of the primary node to current replica node for a - # specific STANDARD tier Cloud Memorystore for Redis instance. - rpc :FailoverInstance, ::Google::Cloud::Redis::V1::FailoverInstanceRequest, ::Google::Longrunning::Operation - # Deletes a specific Redis instance. Instance stops serving and data is - # deleted. - rpc :DeleteInstance, ::Google::Cloud::Redis::V1::DeleteInstanceRequest, ::Google::Longrunning::Operation - # Reschedule maintenance for a given instance in a given project and - # location. - rpc :RescheduleMaintenance, ::Google::Cloud::Redis::V1::RescheduleMaintenanceRequest, ::Google::Longrunning::Operation - end - - Stub = Service.rpc_stub_class - end - end - end - end -end diff --git a/owl-bot-staging/google-cloud-redis-v1/lib/google/cloud/redis/v1/rest.rb b/owl-bot-staging/google-cloud-redis-v1/lib/google/cloud/redis/v1/rest.rb deleted file mode 100644 index 08522168e06e..000000000000 --- a/owl-bot-staging/google-cloud-redis-v1/lib/google/cloud/redis/v1/rest.rb +++ /dev/null @@ -1,38 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -require "google/cloud/redis/v1/cloud_redis/rest" -require "google/cloud/redis/v1/bindings_override" -require "google/cloud/redis/v1/version" - -module Google - module Cloud - module Redis - ## - # To load just the REST part of this package, including all its services, and instantiate a REST client: - # - # @example - # - # require "google/cloud/redis/v1/rest" - # client = ::Google::Cloud::Redis::V1::CloudRedis::Rest::Client.new - # - module V1 - end - end - end -end diff --git a/owl-bot-staging/google-cloud-redis-v1/lib/google/cloud/redis/v1/version.rb b/owl-bot-staging/google-cloud-redis-v1/lib/google/cloud/redis/v1/version.rb deleted file mode 100644 index b98699b8e42a..000000000000 --- a/owl-bot-staging/google-cloud-redis-v1/lib/google/cloud/redis/v1/version.rb +++ /dev/null @@ -1,28 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - - -module Google - module Cloud - module Redis - module V1 - VERSION = "0.0.1" - end - end - end -end diff --git a/owl-bot-staging/google-cloud-redis-v1/proto_docs/README.md b/owl-bot-staging/google-cloud-redis-v1/proto_docs/README.md deleted file mode 100644 index 49fbb528a7ef..000000000000 --- a/owl-bot-staging/google-cloud-redis-v1/proto_docs/README.md +++ /dev/null @@ -1,4 +0,0 @@ -# Google Cloud Memorystore for Redis V1 Protocol Buffer Documentation - -These files are for the YARD documentation of the generated protobuf files. -They are not intended to be required or loaded at runtime. diff --git a/owl-bot-staging/google-cloud-redis-v1/proto_docs/google/api/client.rb b/owl-bot-staging/google-cloud-redis-v1/proto_docs/google/api/client.rb deleted file mode 100644 index 5089551e9ea4..000000000000 --- a/owl-bot-staging/google-cloud-redis-v1/proto_docs/google/api/client.rb +++ /dev/null @@ -1,589 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - - -module Google - module Api - # Required information for every language. - # @!attribute [rw] reference_docs_uri - # @deprecated This field is deprecated and may be removed in the next major version update. - # @return [::String] - # Link to automatically generated reference documentation. Example: - # https://cloud.google.com/nodejs/docs/reference/asset/latest - # @!attribute [rw] destinations - # @return [::Array<::Google::Api::ClientLibraryDestination>] - # The destination where API teams want this client library to be published. - # @!attribute [rw] selective_gapic_generation - # @return [::Google::Api::SelectiveGapicGeneration] - # Configuration for which RPCs should be generated in the GAPIC client. - class CommonLanguageSettings - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Details about how and where to publish client libraries. - # @!attribute [rw] version - # @return [::String] - # Version of the API to apply these settings to. This is the full protobuf - # package for the API, ending in the version element. - # Examples: "google.cloud.speech.v1" and "google.spanner.admin.database.v1". - # @!attribute [rw] launch_stage - # @return [::Google::Api::LaunchStage] - # Launch stage of this version of the API. - # @!attribute [rw] rest_numeric_enums - # @return [::Boolean] - # When using transport=rest, the client request will encode enums as - # numbers rather than strings. - # @!attribute [rw] java_settings - # @return [::Google::Api::JavaSettings] - # Settings for legacy Java features, supported in the Service YAML. - # @!attribute [rw] cpp_settings - # @return [::Google::Api::CppSettings] - # Settings for C++ client libraries. - # @!attribute [rw] php_settings - # @return [::Google::Api::PhpSettings] - # Settings for PHP client libraries. - # @!attribute [rw] python_settings - # @return [::Google::Api::PythonSettings] - # Settings for Python client libraries. - # @!attribute [rw] node_settings - # @return [::Google::Api::NodeSettings] - # Settings for Node client libraries. - # @!attribute [rw] dotnet_settings - # @return [::Google::Api::DotnetSettings] - # Settings for .NET client libraries. - # @!attribute [rw] ruby_settings - # @return [::Google::Api::RubySettings] - # Settings for Ruby client libraries. - # @!attribute [rw] go_settings - # @return [::Google::Api::GoSettings] - # Settings for Go client libraries. - class ClientLibrarySettings - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # This message configures the settings for publishing [Google Cloud Client - # libraries](https://cloud.google.com/apis/docs/cloud-client-libraries) - # generated from the service config. - # @!attribute [rw] method_settings - # @return [::Array<::Google::Api::MethodSettings>] - # A list of API method settings, e.g. the behavior for methods that use the - # long-running operation pattern. - # @!attribute [rw] new_issue_uri - # @return [::String] - # Link to a *public* URI where users can report issues. Example: - # https://issuetracker.google.com/issues/new?component=190865&template=1161103 - # @!attribute [rw] documentation_uri - # @return [::String] - # Link to product home page. Example: - # https://cloud.google.com/asset-inventory/docs/overview - # @!attribute [rw] api_short_name - # @return [::String] - # Used as a tracking tag when collecting data about the APIs developer - # relations artifacts like docs, packages delivered to package managers, - # etc. Example: "speech". - # @!attribute [rw] github_label - # @return [::String] - # GitHub label to apply to issues and pull requests opened for this API. - # @!attribute [rw] codeowner_github_teams - # @return [::Array<::String>] - # GitHub teams to be added to CODEOWNERS in the directory in GitHub - # containing source code for the client libraries for this API. - # @!attribute [rw] doc_tag_prefix - # @return [::String] - # A prefix used in sample code when demarking regions to be included in - # documentation. - # @!attribute [rw] organization - # @return [::Google::Api::ClientLibraryOrganization] - # For whom the client library is being published. - # @!attribute [rw] library_settings - # @return [::Array<::Google::Api::ClientLibrarySettings>] - # Client library settings. If the same version string appears multiple - # times in this list, then the last one wins. Settings from earlier - # settings with the same version string are discarded. - # @!attribute [rw] proto_reference_documentation_uri - # @return [::String] - # Optional link to proto reference documentation. Example: - # https://cloud.google.com/pubsub/lite/docs/reference/rpc - # @!attribute [rw] rest_reference_documentation_uri - # @return [::String] - # Optional link to REST reference documentation. Example: - # https://cloud.google.com/pubsub/lite/docs/reference/rest - class Publishing - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Settings for Java client libraries. - # @!attribute [rw] library_package - # @return [::String] - # The package name to use in Java. Clobbers the java_package option - # set in the protobuf. This should be used **only** by APIs - # who have already set the language_settings.java.package_name" field - # in gapic.yaml. API teams should use the protobuf java_package option - # where possible. - # - # Example of a YAML configuration:: - # - # publishing: - # 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. - # @!attribute [rw] methods - # @return [::Array<::String>] - # An allowlist of the fully qualified names of RPCs that should be included - # on public client surfaces. - # @!attribute [rw] generate_omitted_as_internal - # @return [::Boolean] - # Setting this to true indicates to the client generators that methods - # that would be excluded from the generation should instead be generated - # in a way that indicates these methods should not be consumed by - # end users. How this is expressed is up to individual language - # implementations to decide. Some examples may be: added annotations, - # obfuscated identifiers, or other language idiomatic patterns. - class SelectiveGapicGeneration - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # `BatchingConfigProto` defines the batching configuration for an API method. - # @!attribute [rw] thresholds - # @return [::Google::Api::BatchingSettingsProto] - # The thresholds which trigger a batched request to be sent. - # @!attribute [rw] batch_descriptor - # @return [::Google::Api::BatchingDescriptorProto] - # The request and response fields used in batching. - class BatchingConfigProto - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # `BatchingSettingsProto` specifies a set of batching thresholds, each of - # which acts as a trigger to send a batch of messages as a request. At least - # one threshold must be positive nonzero. - # @!attribute [rw] element_count_threshold - # @return [::Integer] - # The number of elements of a field collected into a batch which, if - # exceeded, causes the batch to be sent. - # @!attribute [rw] request_byte_threshold - # @return [::Integer] - # The aggregated size of the batched field which, if exceeded, causes the - # batch to be sent. This size is computed by aggregating the sizes of the - # request field to be batched, not of the entire request message. - # @!attribute [rw] delay_threshold - # @return [::Google::Protobuf::Duration] - # The duration after which a batch should be sent, starting from the addition - # of the first message to that batch. - # @!attribute [rw] element_count_limit - # @return [::Integer] - # The maximum number of elements collected in a batch that could be accepted - # by server. - # @!attribute [rw] request_byte_limit - # @return [::Integer] - # The maximum size of the request that could be accepted by server. - # @!attribute [rw] flow_control_element_limit - # @return [::Integer] - # The maximum number of elements allowed by flow control. - # @!attribute [rw] flow_control_byte_limit - # @return [::Integer] - # The maximum size of data allowed by flow control. - # @!attribute [rw] flow_control_limit_exceeded_behavior - # @return [::Google::Api::FlowControlLimitExceededBehaviorProto] - # The behavior to take when the flow control limit is exceeded. - class BatchingSettingsProto - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # `BatchingDescriptorProto` specifies the fields of the request message to be - # used for batching, and, optionally, the fields of the response message to be - # used for demultiplexing. - # @!attribute [rw] batched_field - # @return [::String] - # The repeated field in the request message to be aggregated by batching. - # @!attribute [rw] discriminator_fields - # @return [::Array<::String>] - # A list of the fields in the request message. Two requests will be batched - # together only if the values of every field specified in - # `request_discriminator_fields` is equal between the two requests. - # @!attribute [rw] subresponse_field - # @return [::String] - # Optional. When present, indicates the field in the response message to be - # used to demultiplex the response into multiple response messages, in - # correspondence with the multiple request messages originally batched - # together. - class BatchingDescriptorProto - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # The organization for which the client libraries are being published. - # Affects the url where generated docs are published, etc. - module ClientLibraryOrganization - # Not useful. - CLIENT_LIBRARY_ORGANIZATION_UNSPECIFIED = 0 - - # Google Cloud Platform Org. - CLOUD = 1 - - # Ads (Advertising) Org. - ADS = 2 - - # Photos Org. - PHOTOS = 3 - - # Street View Org. - STREET_VIEW = 4 - - # Shopping Org. - SHOPPING = 5 - - # Geo Org. - GEO = 6 - - # Generative AI - https://developers.generativeai.google - GENERATIVE_AI = 7 - end - - # To where should client libraries be published? - module ClientLibraryDestination - # Client libraries will neither be generated nor published to package - # managers. - CLIENT_LIBRARY_DESTINATION_UNSPECIFIED = 0 - - # Generate the client library in a repo under github.com/googleapis, - # but don't publish it to package managers. - GITHUB = 10 - - # Publish the library to package managers like nuget.org and npmjs.com. - PACKAGE_MANAGER = 20 - end - - # The behavior to take when the flow control limit is exceeded. - module FlowControlLimitExceededBehaviorProto - # Default behavior, system-defined. - UNSET_BEHAVIOR = 0 - - # Stop operation, raise error. - THROW_EXCEPTION = 1 - - # Pause operation until limit clears. - BLOCK = 2 - - # Continue operation, disregard limit. - IGNORE = 3 - end - end -end diff --git a/owl-bot-staging/google-cloud-redis-v1/proto_docs/google/api/field_behavior.rb b/owl-bot-staging/google-cloud-redis-v1/proto_docs/google/api/field_behavior.rb deleted file mode 100644 index 582be187d115..000000000000 --- a/owl-bot-staging/google-cloud-redis-v1/proto_docs/google/api/field_behavior.rb +++ /dev/null @@ -1,85 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - - -module Google - module Api - # An indicator of the behavior of a given field (for example, that a field - # is required in requests, or given as output but ignored as input). - # This **does not** change the behavior in protocol buffers itself; it only - # denotes the behavior and may affect how API tooling handles the field. - # - # Note: This enum **may** receive new values in the future. - module FieldBehavior - # Conventional default for enums. Do not use this. - FIELD_BEHAVIOR_UNSPECIFIED = 0 - - # Specifically denotes a field as optional. - # While all fields in protocol buffers are optional, this may be specified - # for emphasis if appropriate. - OPTIONAL = 1 - - # Denotes a field as required. - # This indicates that the field **must** be provided as part of the request, - # and failure to do so will cause an error (usually `INVALID_ARGUMENT`). - REQUIRED = 2 - - # Denotes a field as output only. - # This indicates that the field is provided in responses, but including the - # field in a request does nothing (the server *must* ignore it and - # *must not* throw an error as a result of the field's presence). - OUTPUT_ONLY = 3 - - # Denotes a field as input only. - # This indicates that the field is provided in requests, and the - # corresponding field is not included in output. - INPUT_ONLY = 4 - - # Denotes a field as immutable. - # This indicates that the field may be set once in a request to create a - # resource, but may not be changed thereafter. - IMMUTABLE = 5 - - # Denotes that a (repeated) field is an unordered list. - # This indicates that the service may provide the elements of the list - # in any arbitrary order, rather than the order the user originally - # provided. Additionally, the list's order may or may not be stable. - UNORDERED_LIST = 6 - - # Denotes that this field returns a non-empty default value if not set. - # This indicates that if the user provides the empty value in a request, - # a non-empty value will be returned. The user will not be aware of what - # non-empty value to expect. - NON_EMPTY_DEFAULT = 7 - - # Denotes that the field in a resource (a message annotated with - # google.api.resource) is used in the resource name to uniquely identify the - # resource. For AIP-compliant APIs, this should only be applied to the - # `name` field on the resource. - # - # This behavior should not be applied to references to other resources within - # the message. - # - # The identifier field of resources often have different field behavior - # depending on the request it is embedded in (e.g. for Create methods name - # is optional and unused, while for Update methods it is required). Instead - # of method-specific annotations, only `IDENTIFIER` is required. - IDENTIFIER = 8 - end - end -end diff --git a/owl-bot-staging/google-cloud-redis-v1/proto_docs/google/api/launch_stage.rb b/owl-bot-staging/google-cloud-redis-v1/proto_docs/google/api/launch_stage.rb deleted file mode 100644 index 9392a413fb1b..000000000000 --- a/owl-bot-staging/google-cloud-redis-v1/proto_docs/google/api/launch_stage.rb +++ /dev/null @@ -1,71 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - - -module Google - module Api - # The launch stage as defined by [Google Cloud Platform - # Launch Stages](https://cloud.google.com/terms/launch-stages). - module LaunchStage - # Do not use this default value. - LAUNCH_STAGE_UNSPECIFIED = 0 - - # The feature is not yet implemented. Users can not use it. - UNIMPLEMENTED = 6 - - # Prelaunch features are hidden from users and are only visible internally. - PRELAUNCH = 7 - - # Early Access features are limited to a closed group of testers. To use - # these features, you must sign up in advance and sign a Trusted Tester - # agreement (which includes confidentiality provisions). These features may - # be unstable, changed in backward-incompatible ways, and are not - # guaranteed to be released. - EARLY_ACCESS = 1 - - # Alpha is a limited availability test for releases before they are cleared - # for widespread use. By Alpha, all significant design issues are resolved - # and we are in the process of verifying functionality. Alpha customers - # need to apply for access, agree to applicable terms, and have their - # projects allowlisted. Alpha releases don't have to be feature complete, - # no SLAs are provided, and there are no technical support obligations, but - # they will be far enough along that customers can actually use them in - # test environments or for limited-use tests -- just like they would in - # normal production cases. - ALPHA = 2 - - # Beta is the point at which we are ready to open a release for any - # customer to use. There are no SLA or technical support obligations in a - # Beta release. Products will be complete from a feature perspective, but - # may have some open outstanding issues. Beta releases are suitable for - # limited production use cases. - BETA = 3 - - # GA features are open to all developers and are considered stable and - # fully qualified for production use. - GA = 4 - - # Deprecated features are scheduled to be shut down and removed. For more - # information, see the "Deprecation Policy" section of our [Terms of - # Service](https://cloud.google.com/terms/) - # and the [Google Cloud Platform Subject to the Deprecation - # Policy](https://cloud.google.com/terms/deprecation) documentation. - DEPRECATED = 5 - end - end -end diff --git a/owl-bot-staging/google-cloud-redis-v1/proto_docs/google/api/resource.rb b/owl-bot-staging/google-cloud-redis-v1/proto_docs/google/api/resource.rb deleted file mode 100644 index 25dec4847ac1..000000000000 --- a/owl-bot-staging/google-cloud-redis-v1/proto_docs/google/api/resource.rb +++ /dev/null @@ -1,227 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - - -module Google - module Api - # A simple descriptor of a resource type. - # - # ResourceDescriptor annotates a resource message (either by means of a - # protobuf annotation or use in the service config), and associates the - # resource's schema, the resource type, and the pattern of the resource name. - # - # Example: - # - # message Topic { - # // Indicates this message defines a resource schema. - # // Declares the resource type in the format of {service}/{kind}. - # // For Kubernetes resources, the format is {api group}/{kind}. - # option (google.api.resource) = { - # type: "pubsub.googleapis.com/Topic" - # pattern: "projects/{project}/topics/{topic}" - # }; - # } - # - # The ResourceDescriptor Yaml config will look like: - # - # resources: - # - type: "pubsub.googleapis.com/Topic" - # pattern: "projects/{project}/topics/{topic}" - # - # Sometimes, resources have multiple patterns, typically because they can - # live under multiple parents. - # - # Example: - # - # message LogEntry { - # option (google.api.resource) = { - # type: "logging.googleapis.com/LogEntry" - # pattern: "projects/{project}/logs/{log}" - # pattern: "folders/{folder}/logs/{log}" - # pattern: "organizations/{organization}/logs/{log}" - # pattern: "billingAccounts/{billing_account}/logs/{log}" - # }; - # } - # - # The ResourceDescriptor Yaml config will look like: - # - # resources: - # - type: 'logging.googleapis.com/LogEntry' - # pattern: "projects/{project}/logs/{log}" - # pattern: "folders/{folder}/logs/{log}" - # pattern: "organizations/{organization}/logs/{log}" - # pattern: "billingAccounts/{billing_account}/logs/{log}" - # @!attribute [rw] type - # @return [::String] - # The resource type. It must be in the format of - # \\{service_name}/\\{resource_type_kind}. The `resource_type_kind` must be - # singular and must not include version numbers. - # - # Example: `storage.googleapis.com/Bucket` - # - # The value of the resource_type_kind must follow the regular expression - # /[A-Za-z][a-zA-Z0-9]+/. It should start with an upper case character and - # should use PascalCase (UpperCamelCase). The maximum number of - # characters allowed for the `resource_type_kind` is 100. - # @!attribute [rw] pattern - # @return [::Array<::String>] - # Optional. The relative resource name pattern associated with this resource - # type. The DNS prefix of the full resource name shouldn't be specified here. - # - # The path pattern must follow the syntax, which aligns with HTTP binding - # syntax: - # - # Template = Segment { "/" Segment } ; - # Segment = LITERAL | Variable ; - # Variable = "{" LITERAL "}" ; - # - # Examples: - # - # - "projects/\\{project}/topics/\\{topic}" - # - "projects/\\{project}/knowledgeBases/\\{knowledge_base}" - # - # The components in braces correspond to the IDs for each resource in the - # hierarchy. It is expected that, if multiple patterns are provided, - # the same component name (e.g. "project") refers to IDs of the same - # type of resource. - # @!attribute [rw] name_field - # @return [::String] - # Optional. The field on the resource that designates the resource name - # field. If omitted, this is assumed to be "name". - # @!attribute [rw] history - # @return [::Google::Api::ResourceDescriptor::History] - # Optional. The historical or future-looking state of the resource pattern. - # - # Example: - # - # // The InspectTemplate message originally only supported resource - # // names with organization, and project was added later. - # message InspectTemplate { - # option (google.api.resource) = { - # type: "dlp.googleapis.com/InspectTemplate" - # pattern: - # "organizations/{organization}/inspectTemplates/{inspect_template}" - # pattern: "projects/{project}/inspectTemplates/{inspect_template}" - # history: ORIGINALLY_SINGLE_PATTERN - # }; - # } - # @!attribute [rw] plural - # @return [::String] - # The plural name used in the resource name and permission names, such as - # 'projects' for the resource name of 'projects/\\{project}' and the permission - # name of 'cloudresourcemanager.googleapis.com/projects.get'. One exception - # to this is for Nested Collections that have stuttering names, as defined - # in [AIP-122](https://google.aip.dev/122#nested-collections), where the - # collection ID in the resource name pattern does not necessarily directly - # match the `plural` value. - # - # It is the same concept of the `plural` field in k8s CRD spec - # https://kubernetes.io/docs/tasks/access-kubernetes-api/custom-resources/custom-resource-definitions/ - # - # Note: The plural form is required even for singleton resources. See - # https://aip.dev/156 - # @!attribute [rw] singular - # @return [::String] - # The same concept of the `singular` field in k8s CRD spec - # https://kubernetes.io/docs/tasks/access-kubernetes-api/custom-resources/custom-resource-definitions/ - # Such as "project" for the `resourcemanager.googleapis.com/Project` type. - # @!attribute [rw] style - # @return [::Array<::Google::Api::ResourceDescriptor::Style>] - # Style flag(s) for this resource. - # These indicate that a resource is expected to conform to a given - # style. See the specific style flags for additional information. - class ResourceDescriptor - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - - # A description of the historical or future-looking state of the - # resource pattern. - module History - # The "unset" value. - HISTORY_UNSPECIFIED = 0 - - # The resource originally had one pattern and launched as such, and - # additional patterns were added later. - ORIGINALLY_SINGLE_PATTERN = 1 - - # The resource has one pattern, but the API owner expects to add more - # later. (This is the inverse of ORIGINALLY_SINGLE_PATTERN, and prevents - # that from being necessary once there are multiple patterns.) - FUTURE_MULTI_PATTERN = 2 - end - - # A flag representing a specific style that a resource claims to conform to. - module Style - # The unspecified value. Do not use. - STYLE_UNSPECIFIED = 0 - - # This resource is intended to be "declarative-friendly". - # - # Declarative-friendly resources must be more strictly consistent, and - # setting this to true communicates to tools that this resource should - # adhere to declarative-friendly expectations. - # - # Note: This is used by the API linter (linter.aip.dev) to enable - # additional checks. - DECLARATIVE_FRIENDLY = 1 - end - end - - # Defines a proto annotation that describes a string field that refers to - # an API resource. - # @!attribute [rw] type - # @return [::String] - # The resource type that the annotated field references. - # - # Example: - # - # message Subscription { - # string topic = 2 [(google.api.resource_reference) = { - # type: "pubsub.googleapis.com/Topic" - # }]; - # } - # - # Occasionally, a field may reference an arbitrary resource. In this case, - # APIs use the special value * in their resource reference. - # - # Example: - # - # message GetIamPolicyRequest { - # string resource = 2 [(google.api.resource_reference) = { - # type: "*" - # }]; - # } - # @!attribute [rw] child_type - # @return [::String] - # The resource type of a child collection that the annotated field - # references. This is useful for annotating the `parent` field that - # doesn't have a fixed resource type. - # - # Example: - # - # message ListLogEntriesRequest { - # string parent = 1 [(google.api.resource_reference) = { - # child_type: "logging.googleapis.com/LogEntry" - # }; - # } - class ResourceReference - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - end -end diff --git a/owl-bot-staging/google-cloud-redis-v1/proto_docs/google/cloud/redis/v1/cloud_redis.rb b/owl-bot-staging/google-cloud-redis-v1/proto_docs/google/cloud/redis/v1/cloud_redis.rb deleted file mode 100644 index db24af763a85..000000000000 --- a/owl-bot-staging/google-cloud-redis-v1/proto_docs/google/cloud/redis/v1/cloud_redis.rb +++ /dev/null @@ -1,836 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - - -module Google - module Cloud - module Redis - module V1 - # Node specific properties. - # @!attribute [r] id - # @return [::String] - # Output only. Node identifying string. e.g. 'node-0', 'node-1' - # @!attribute [r] zone - # @return [::String] - # Output only. Location of the node. - class NodeInfo - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # A Memorystore for Redis instance. - # @!attribute [rw] name - # @return [::String] - # Required. Unique name of the resource in this scope including project and - # location using the form: - # `projects/{project_id}/locations/{location_id}/instances/{instance_id}` - # - # Note: Redis instances are managed and addressed at regional level so - # location_id here refers to a GCP region; however, users may choose which - # specific zone (or collection of zones for cross-zone instances) an instance - # should be provisioned in. Refer to - # {::Google::Cloud::Redis::V1::Instance#location_id location_id} and - # {::Google::Cloud::Redis::V1::Instance#alternative_location_id alternative_location_id} - # fields for more details. - # @!attribute [rw] display_name - # @return [::String] - # An arbitrary and optional user-provided name for the instance. - # @!attribute [rw] labels - # @return [::Google::Protobuf::Map{::String => ::String}] - # Resource labels to represent user provided metadata - # @!attribute [rw] location_id - # @return [::String] - # Optional. The zone where the instance will be provisioned. If not provided, - # the service will choose a zone from the specified region for the instance. - # For standard tier, additional nodes will be added across multiple zones for - # protection against zonal failures. If specified, at least one node will be - # provisioned in this zone. - # @!attribute [rw] alternative_location_id - # @return [::String] - # Optional. If specified, at least one node will be provisioned in this zone - # in addition to the zone specified in location_id. Only applicable to - # standard tier. If provided, it must be a different zone from the one - # provided in [location_id]. Additional nodes beyond the first 2 will be - # placed in zones selected by the service. - # @!attribute [rw] redis_version - # @return [::String] - # Optional. The version of Redis software. - # If not provided, latest supported version will be used. Currently, the - # supported values are: - # - # * `REDIS_3_2` for Redis 3.2 compatibility - # * `REDIS_4_0` for Redis 4.0 compatibility (default) - # * `REDIS_5_0` for Redis 5.0 compatibility - # * `REDIS_6_X` for Redis 6.x compatibility - # @!attribute [rw] reserved_ip_range - # @return [::String] - # Optional. For DIRECT_PEERING mode, the CIDR range of internal addresses - # that are reserved for this instance. Range must - # be unique and non-overlapping with existing subnets in an authorized - # network. For PRIVATE_SERVICE_ACCESS mode, the name of one allocated IP - # address ranges associated with this private service access connection. - # If not provided, the service will choose an unused /29 block, for - # example, 10.0.0.0/29 or 192.168.0.0/29. For READ_REPLICAS_ENABLED - # the default block size is /28. - # @!attribute [rw] secondary_ip_range - # @return [::String] - # Optional. Additional IP range for node placement. Required when enabling - # read replicas on an existing instance. For DIRECT_PEERING mode value must - # be a CIDR range of size /28, or "auto". For PRIVATE_SERVICE_ACCESS mode - # value must be the name of an allocated address range associated with the - # private service access connection, or "auto". - # @!attribute [r] host - # @return [::String] - # Output only. Hostname or IP address of the exposed Redis endpoint used by - # clients to connect to the service. - # @!attribute [r] port - # @return [::Integer] - # Output only. The port number of the exposed Redis endpoint. - # @!attribute [r] current_location_id - # @return [::String] - # Output only. The current zone where the Redis primary node is located. In - # basic tier, this will always be the same as [location_id]. In - # standard tier, this can be the zone of any node in the instance. - # @!attribute [r] create_time - # @return [::Google::Protobuf::Timestamp] - # Output only. The time the instance was created. - # @!attribute [r] state - # @return [::Google::Cloud::Redis::V1::Instance::State] - # Output only. The current state of this instance. - # @!attribute [r] status_message - # @return [::String] - # Output only. Additional information about the current status of this - # instance, if available. - # @!attribute [rw] redis_configs - # @return [::Google::Protobuf::Map{::String => ::String}] - # Optional. Redis configuration parameters, according to - # http://redis.io/topics/config. Currently, the only supported parameters - # are: - # - # Redis version 3.2 and newer: - # - # * maxmemory-policy - # * notify-keyspace-events - # - # Redis version 4.0 and newer: - # - # * activedefrag - # * lfu-decay-time - # * lfu-log-factor - # * maxmemory-gb - # - # Redis version 5.0 and newer: - # - # * stream-node-max-bytes - # * stream-node-max-entries - # @!attribute [rw] tier - # @return [::Google::Cloud::Redis::V1::Instance::Tier] - # Required. The service tier of the instance. - # @!attribute [rw] memory_size_gb - # @return [::Integer] - # Required. Redis memory size in GiB. - # @!attribute [rw] authorized_network - # @return [::String] - # Optional. The full name of the Google Compute Engine - # [network](https://cloud.google.com/vpc/docs/vpc) to which the - # instance is connected. If left unspecified, the `default` network - # will be used. - # @!attribute [r] persistence_iam_identity - # @return [::String] - # Output only. Cloud IAM identity used by import / export operations to - # transfer data to/from Cloud Storage. Format is - # "serviceAccount:". The value may change over time - # for a given instance so should be checked before each import/export - # operation. - # @!attribute [rw] connect_mode - # @return [::Google::Cloud::Redis::V1::Instance::ConnectMode] - # Optional. The network connect mode of the Redis instance. - # If not provided, the connect mode defaults to DIRECT_PEERING. - # @!attribute [rw] auth_enabled - # @return [::Boolean] - # Optional. Indicates whether OSS Redis AUTH is enabled for the instance. If - # set to "true" AUTH is enabled on the instance. Default value is "false" - # meaning AUTH is disabled. - # @!attribute [r] server_ca_certs - # @return [::Array<::Google::Cloud::Redis::V1::TlsCertificate>] - # Output only. List of server CA certificates for the instance. - # @!attribute [rw] transit_encryption_mode - # @return [::Google::Cloud::Redis::V1::Instance::TransitEncryptionMode] - # Optional. The TLS mode of the Redis instance. - # If not provided, TLS is disabled for the instance. - # @!attribute [rw] maintenance_policy - # @return [::Google::Cloud::Redis::V1::MaintenancePolicy] - # Optional. The maintenance policy for the instance. If not provided, - # maintenance events can be performed at any time. - # @!attribute [r] maintenance_schedule - # @return [::Google::Cloud::Redis::V1::MaintenanceSchedule] - # Output only. Date and time of upcoming maintenance events which have been - # scheduled. - # @!attribute [rw] replica_count - # @return [::Integer] - # Optional. The number of replica nodes. The valid range for the Standard - # Tier with read replicas enabled is [1-5] and defaults to 2. If read - # replicas are not enabled for a Standard Tier instance, the only valid value - # is 1 and the default is 1. The valid value for basic tier is 0 and the - # default is also 0. - # @!attribute [r] nodes - # @return [::Array<::Google::Cloud::Redis::V1::NodeInfo>] - # Output only. Info per node. - # @!attribute [r] read_endpoint - # @return [::String] - # Output only. Hostname or IP address of the exposed readonly Redis - # endpoint. Standard tier only. Targets all healthy replica nodes in - # instance. Replication is asynchronous and replica nodes will exhibit some - # lag behind the primary. Write requests must target 'host'. - # @!attribute [r] read_endpoint_port - # @return [::Integer] - # Output only. The port number of the exposed readonly redis - # endpoint. Standard tier only. Write requests should target 'port'. - # @!attribute [rw] read_replicas_mode - # @return [::Google::Cloud::Redis::V1::Instance::ReadReplicasMode] - # Optional. Read replicas mode for the instance. Defaults to - # READ_REPLICAS_DISABLED. - # @!attribute [rw] customer_managed_key - # @return [::String] - # Optional. The KMS key reference that the customer provides when trying to - # create the instance. - # @!attribute [rw] persistence_config - # @return [::Google::Cloud::Redis::V1::PersistenceConfig] - # Optional. Persistence configuration parameters - # @!attribute [rw] suspension_reasons - # @return [::Array<::Google::Cloud::Redis::V1::Instance::SuspensionReason>] - # Optional. reasons that causes instance in "SUSPENDED" state. - # @!attribute [rw] maintenance_version - # @return [::String] - # Optional. The self service update maintenance version. - # The version is date based such as "20210712_00_00". - # @!attribute [rw] available_maintenance_versions - # @return [::Array<::String>] - # Optional. The available maintenance versions that an instance could update - # to. - class Instance - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - - # @!attribute [rw] key - # @return [::String] - # @!attribute [rw] value - # @return [::String] - class LabelsEntry - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # @!attribute [rw] key - # @return [::String] - # @!attribute [rw] value - # @return [::String] - class RedisConfigsEntry - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Represents the different states of a Redis instance. - module State - # Not set. - STATE_UNSPECIFIED = 0 - - # Redis instance is being created. - CREATING = 1 - - # Redis instance has been created and is fully usable. - READY = 2 - - # Redis instance configuration is being updated. Certain kinds of updates - # may cause the instance to become unusable while the update is in - # progress. - UPDATING = 3 - - # Redis instance is being deleted. - DELETING = 4 - - # Redis instance is being repaired and may be unusable. - REPAIRING = 5 - - # Maintenance is being performed on this Redis instance. - MAINTENANCE = 6 - - # Redis instance is importing data (availability may be affected). - IMPORTING = 8 - - # Redis instance is failing over (availability may be affected). - FAILING_OVER = 9 - end - - # Available service tiers to choose from - module Tier - # Not set. - TIER_UNSPECIFIED = 0 - - # BASIC tier: standalone instance - BASIC = 1 - - # STANDARD_HA tier: highly available primary/replica instances - STANDARD_HA = 3 - end - - # Available connection modes. - module ConnectMode - # Not set. - CONNECT_MODE_UNSPECIFIED = 0 - - # Connect via direct peering to the Memorystore for Redis hosted service. - DIRECT_PEERING = 1 - - # Connect your Memorystore for Redis instance using Private Service - # Access. Private services access provides an IP address range for multiple - # Google Cloud services, including Memorystore. - PRIVATE_SERVICE_ACCESS = 2 - end - - # Available TLS modes. - module TransitEncryptionMode - # Not set. - TRANSIT_ENCRYPTION_MODE_UNSPECIFIED = 0 - - # Client to Server traffic encryption enabled with server authentication. - SERVER_AUTHENTICATION = 1 - - # TLS is disabled for the instance. - DISABLED = 2 - end - - # Read replicas mode. - module ReadReplicasMode - # If not set, Memorystore Redis backend will default to - # READ_REPLICAS_DISABLED. - READ_REPLICAS_MODE_UNSPECIFIED = 0 - - # If disabled, read endpoint will not be provided and the instance cannot - # scale up or down the number of replicas. - READ_REPLICAS_DISABLED = 1 - - # If enabled, read endpoint will be provided and the instance can scale - # up and down the number of replicas. Not valid for basic tier. - READ_REPLICAS_ENABLED = 2 - end - - # Possible reasons for the instance to be in a "SUSPENDED" state. - module SuspensionReason - # Not set. - SUSPENSION_REASON_UNSPECIFIED = 0 - - # Something wrong with the CMEK key provided by customer. - CUSTOMER_MANAGED_KEY_ISSUE = 1 - end - end - - # Configuration of the persistence functionality. - # @!attribute [rw] persistence_mode - # @return [::Google::Cloud::Redis::V1::PersistenceConfig::PersistenceMode] - # Optional. Controls whether Persistence features are enabled. - # If not provided, the existing value will be used. - # @!attribute [rw] rdb_snapshot_period - # @return [::Google::Cloud::Redis::V1::PersistenceConfig::SnapshotPeriod] - # Optional. Period between RDB snapshots. Snapshots will be attempted every - # period starting from the provided snapshot start time. For example, a start - # time of 01/01/2033 06:45 and SIX_HOURS snapshot period will do nothing - # until 01/01/2033, and then trigger snapshots every day at 06:45, 12:45, - # 18:45, and 00:45 the next day, and so on. If not provided, - # TWENTY_FOUR_HOURS will be used as default. - # @!attribute [r] rdb_next_snapshot_time - # @return [::Google::Protobuf::Timestamp] - # Output only. The next time that a snapshot attempt is scheduled to occur. - # @!attribute [rw] rdb_snapshot_start_time - # @return [::Google::Protobuf::Timestamp] - # Optional. Date and time that the first snapshot was/will be attempted, and - # to which future snapshots will be aligned. If not provided, the current - # time will be used. - class PersistenceConfig - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - - # Available Persistence modes. - module PersistenceMode - # Not set. - PERSISTENCE_MODE_UNSPECIFIED = 0 - - # Persistence is disabled for the instance, - # and any existing snapshots are deleted. - DISABLED = 1 - - # RDB based Persistence is enabled. - RDB = 2 - end - - # Available snapshot periods for scheduling. - module SnapshotPeriod - # Not set. - SNAPSHOT_PERIOD_UNSPECIFIED = 0 - - # Snapshot every 1 hour. - ONE_HOUR = 3 - - # Snapshot every 6 hours. - SIX_HOURS = 4 - - # Snapshot every 12 hours. - TWELVE_HOURS = 5 - - # Snapshot every 24 hours. - TWENTY_FOUR_HOURS = 6 - end - end - - # Request for - # {::Google::Cloud::Redis::V1::CloudRedis::Client#reschedule_maintenance RescheduleMaintenance}. - # @!attribute [rw] name - # @return [::String] - # Required. Redis instance resource name using the form: - # `projects/{project_id}/locations/{location_id}/instances/{instance_id}` - # where `location_id` refers to a GCP region. - # @!attribute [rw] reschedule_type - # @return [::Google::Cloud::Redis::V1::RescheduleMaintenanceRequest::RescheduleType] - # Required. If reschedule type is SPECIFIC_TIME, must set up schedule_time as - # well. - # @!attribute [rw] schedule_time - # @return [::Google::Protobuf::Timestamp] - # Optional. Timestamp when the maintenance shall be rescheduled to if - # reschedule_type=SPECIFIC_TIME, in RFC 3339 format, for - # example `2012-11-15T16:19:00.094Z`. - class RescheduleMaintenanceRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - - # Reschedule options. - module RescheduleType - # Not set. - RESCHEDULE_TYPE_UNSPECIFIED = 0 - - # If the user wants to schedule the maintenance to happen now. - IMMEDIATE = 1 - - # If the user wants to use the existing maintenance policy to find the - # next available window. - NEXT_AVAILABLE_WINDOW = 2 - - # If the user wants to reschedule the maintenance to a specific time. - SPECIFIC_TIME = 3 - end - end - - # Maintenance policy for an instance. - # @!attribute [r] create_time - # @return [::Google::Protobuf::Timestamp] - # Output only. The time when the policy was created. - # @!attribute [r] update_time - # @return [::Google::Protobuf::Timestamp] - # Output only. The time when the policy was last updated. - # @!attribute [rw] description - # @return [::String] - # Optional. Description of what this policy is for. Create/Update methods - # return INVALID_ARGUMENT if the length is greater than 512. - # @!attribute [rw] weekly_maintenance_window - # @return [::Array<::Google::Cloud::Redis::V1::WeeklyMaintenanceWindow>] - # Optional. Maintenance window that is applied to resources covered by this - # policy. Minimum 1. For the current version, the maximum number of - # weekly_window is expected to be one. - class MaintenancePolicy - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Time window in which disruptive maintenance updates occur. Non-disruptive - # updates can occur inside or outside this window. - # @!attribute [rw] day - # @return [::Google::Type::DayOfWeek] - # Required. The day of week that maintenance updates occur. - # @!attribute [rw] start_time - # @return [::Google::Type::TimeOfDay] - # Required. Start time of the window in UTC time. - # @!attribute [r] duration - # @return [::Google::Protobuf::Duration] - # Output only. Duration of the maintenance window. The current window is - # fixed at 1 hour. - class WeeklyMaintenanceWindow - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Upcoming maintenance schedule. If no maintenance is scheduled, fields are not - # populated. - # @!attribute [r] start_time - # @return [::Google::Protobuf::Timestamp] - # Output only. The start time of any upcoming scheduled maintenance for this - # instance. - # @!attribute [r] end_time - # @return [::Google::Protobuf::Timestamp] - # Output only. The end time of any upcoming scheduled maintenance for this - # instance. - # @!attribute [rw] can_reschedule - # @deprecated This field is deprecated and may be removed in the next major version update. - # @return [::Boolean] - # If the scheduled maintenance can be rescheduled, default is true. - # @!attribute [r] schedule_deadline_time - # @return [::Google::Protobuf::Timestamp] - # Output only. The deadline that the maintenance schedule start time can not - # go beyond, including reschedule. - class MaintenanceSchedule - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Request for {::Google::Cloud::Redis::V1::CloudRedis::Client#list_instances ListInstances}. - # @!attribute [rw] parent - # @return [::String] - # Required. The resource name of the instance location using the form: - # `projects/{project_id}/locations/{location_id}` - # where `location_id` refers to a GCP region. - # @!attribute [rw] page_size - # @return [::Integer] - # The maximum number of items to return. - # - # If not specified, a default value of 1000 will be used by the service. - # Regardless of the page_size value, the response may include a partial list - # and a caller should only rely on response's - # {::Google::Cloud::Redis::V1::ListInstancesResponse#next_page_token `next_page_token`} - # to determine if there are more instances left to be queried. - # @!attribute [rw] page_token - # @return [::String] - # The `next_page_token` value returned from a previous - # {::Google::Cloud::Redis::V1::CloudRedis::Client#list_instances ListInstances} request, if - # any. - class ListInstancesRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Response for {::Google::Cloud::Redis::V1::CloudRedis::Client#list_instances ListInstances}. - # @!attribute [rw] instances - # @return [::Array<::Google::Cloud::Redis::V1::Instance>] - # A list of Redis instances in the project in the specified location, - # or across all locations. - # - # If the `location_id` in the parent field of the request is "-", all regions - # available to the project are queried, and the results aggregated. - # If in such an aggregated query a location is unavailable, a placeholder - # Redis entry is included in the response with the `name` field set to a - # value of the form - # `projects/{project_id}/locations/{location_id}/instances/`- and the - # `status` field set to ERROR and `status_message` field set to "location not - # available for ListInstances". - # @!attribute [rw] next_page_token - # @return [::String] - # Token to retrieve the next page of results, or empty if there are no more - # results in the list. - # @!attribute [rw] unreachable - # @return [::Array<::String>] - # Locations that could not be reached. - class ListInstancesResponse - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Request for {::Google::Cloud::Redis::V1::CloudRedis::Client#get_instance GetInstance}. - # @!attribute [rw] name - # @return [::String] - # Required. Redis instance resource name using the form: - # `projects/{project_id}/locations/{location_id}/instances/{instance_id}` - # where `location_id` refers to a GCP region. - class GetInstanceRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Request for - # {::Google::Cloud::Redis::V1::CloudRedis::Client#get_instance_auth_string GetInstanceAuthString}. - # @!attribute [rw] name - # @return [::String] - # Required. Redis instance resource name using the form: - # `projects/{project_id}/locations/{location_id}/instances/{instance_id}` - # where `location_id` refers to a GCP region. - class GetInstanceAuthStringRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Instance AUTH string details. - # @!attribute [rw] auth_string - # @return [::String] - # AUTH string set on the instance. - class InstanceAuthString - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Request for - # {::Google::Cloud::Redis::V1::CloudRedis::Client#create_instance CreateInstance}. - # @!attribute [rw] parent - # @return [::String] - # Required. The resource name of the instance location using the form: - # `projects/{project_id}/locations/{location_id}` - # where `location_id` refers to a GCP region. - # @!attribute [rw] instance_id - # @return [::String] - # Required. The logical name of the Redis instance in the customer project - # with the following restrictions: - # - # * Must contain only lowercase letters, numbers, and hyphens. - # * Must start with a letter. - # * Must be between 1-40 characters. - # * Must end with a number or a letter. - # * Must be unique within the customer project / location - # @!attribute [rw] instance - # @return [::Google::Cloud::Redis::V1::Instance] - # Required. A Redis [Instance] resource - class CreateInstanceRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Request for - # {::Google::Cloud::Redis::V1::CloudRedis::Client#update_instance UpdateInstance}. - # @!attribute [rw] update_mask - # @return [::Google::Protobuf::FieldMask] - # Required. Mask of fields to update. At least one path must be supplied in - # this field. The elements of the repeated paths field may only include these - # fields from {::Google::Cloud::Redis::V1::Instance Instance}: - # - # * `displayName` - # * `labels` - # * `memorySizeGb` - # * `redisConfig` - # * `replica_count` - # @!attribute [rw] instance - # @return [::Google::Cloud::Redis::V1::Instance] - # Required. Update description. - # Only fields specified in update_mask are updated. - class UpdateInstanceRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Request for - # {::Google::Cloud::Redis::V1::CloudRedis::Client#upgrade_instance UpgradeInstance}. - # @!attribute [rw] name - # @return [::String] - # Required. Redis instance resource name using the form: - # `projects/{project_id}/locations/{location_id}/instances/{instance_id}` - # where `location_id` refers to a GCP region. - # @!attribute [rw] redis_version - # @return [::String] - # Required. Specifies the target version of Redis software to upgrade to. - class UpgradeInstanceRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Request for - # {::Google::Cloud::Redis::V1::CloudRedis::Client#delete_instance DeleteInstance}. - # @!attribute [rw] name - # @return [::String] - # Required. Redis instance resource name using the form: - # `projects/{project_id}/locations/{location_id}/instances/{instance_id}` - # where `location_id` refers to a GCP region. - class DeleteInstanceRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # The Cloud Storage location for the input content - # @!attribute [rw] uri - # @return [::String] - # Required. Source data URI. (e.g. 'gs://my_bucket/my_object'). - class GcsSource - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # The input content - # @!attribute [rw] gcs_source - # @return [::Google::Cloud::Redis::V1::GcsSource] - # Google Cloud Storage location where input content is located. - class InputConfig - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Request for {::Google::Cloud::Redis::V1::CloudRedis::Client#import_instance Import}. - # @!attribute [rw] name - # @return [::String] - # Required. Redis instance resource name using the form: - # `projects/{project_id}/locations/{location_id}/instances/{instance_id}` - # where `location_id` refers to a GCP region. - # @!attribute [rw] input_config - # @return [::Google::Cloud::Redis::V1::InputConfig] - # Required. Specify data to be imported. - class ImportInstanceRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # The Cloud Storage location for the output content - # @!attribute [rw] uri - # @return [::String] - # Required. Data destination URI (e.g. - # 'gs://my_bucket/my_object'). Existing files will be overwritten. - class GcsDestination - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # The output content - # @!attribute [rw] gcs_destination - # @return [::Google::Cloud::Redis::V1::GcsDestination] - # Google Cloud Storage destination for output content. - class OutputConfig - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Request for {::Google::Cloud::Redis::V1::CloudRedis::Client#export_instance Export}. - # @!attribute [rw] name - # @return [::String] - # Required. Redis instance resource name using the form: - # `projects/{project_id}/locations/{location_id}/instances/{instance_id}` - # where `location_id` refers to a GCP region. - # @!attribute [rw] output_config - # @return [::Google::Cloud::Redis::V1::OutputConfig] - # Required. Specify data to be exported. - class ExportInstanceRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Request for {::Google::Cloud::Redis::V1::CloudRedis::Client#failover_instance Failover}. - # @!attribute [rw] name - # @return [::String] - # Required. Redis instance resource name using the form: - # `projects/{project_id}/locations/{location_id}/instances/{instance_id}` - # where `location_id` refers to a GCP region. - # @!attribute [rw] data_protection_mode - # @return [::Google::Cloud::Redis::V1::FailoverInstanceRequest::DataProtectionMode] - # Optional. Available data protection modes that the user can choose. If it's - # unspecified, data protection mode will be LIMITED_DATA_LOSS by default. - class FailoverInstanceRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - - # Specifies different modes of operation in relation to the data retention. - module DataProtectionMode - # Defaults to LIMITED_DATA_LOSS if a data protection mode is not - # specified. - DATA_PROTECTION_MODE_UNSPECIFIED = 0 - - # Instance failover will be protected with data loss control. More - # specifically, the failover will only be performed if the current - # replication offset diff between primary and replica is under a certain - # threshold. - LIMITED_DATA_LOSS = 1 - - # Instance failover will be performed without data loss control. - FORCE_DATA_LOSS = 2 - end - end - - # Represents the v1 metadata of the long-running operation. - # @!attribute [rw] create_time - # @return [::Google::Protobuf::Timestamp] - # Creation timestamp. - # @!attribute [rw] end_time - # @return [::Google::Protobuf::Timestamp] - # End timestamp. - # @!attribute [rw] target - # @return [::String] - # Operation target. - # @!attribute [rw] verb - # @return [::String] - # Operation verb. - # @!attribute [rw] status_detail - # @return [::String] - # Operation status details. - # @!attribute [rw] cancel_requested - # @return [::Boolean] - # Specifies if cancellation was requested for the operation. - # @!attribute [rw] api_version - # @return [::String] - # API version. - class OperationMetadata - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # This location metadata represents additional configuration options for a - # given location where a Redis instance may be created. All fields are output - # only. It is returned as content of the - # `google.cloud.location.Location.metadata` field. - # @!attribute [r] available_zones - # @return [::Google::Protobuf::Map{::String => ::Google::Cloud::Redis::V1::ZoneMetadata}] - # Output only. The set of available zones in the location. The map is keyed - # by the lowercase ID of each zone, as defined by GCE. These keys can be - # specified in `location_id` or `alternative_location_id` fields when - # creating a Redis instance. - class LocationMetadata - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - - # @!attribute [rw] key - # @return [::String] - # @!attribute [rw] value - # @return [::Google::Cloud::Redis::V1::ZoneMetadata] - class AvailableZonesEntry - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - end - - # Defines specific information for a particular zone. Currently empty and - # reserved for future use only. - class ZoneMetadata - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # TlsCertificate Resource - # @!attribute [rw] serial_number - # @return [::String] - # Serial number, as extracted from the certificate. - # @!attribute [rw] cert - # @return [::String] - # PEM representation. - # @!attribute [r] create_time - # @return [::Google::Protobuf::Timestamp] - # Output only. The time when the certificate was created in [RFC - # 3339](https://tools.ietf.org/html/rfc3339) format, for example - # `2020-05-18T00:00:00.094Z`. - # @!attribute [r] expire_time - # @return [::Google::Protobuf::Timestamp] - # Output only. The time when the certificate expires in [RFC - # 3339](https://tools.ietf.org/html/rfc3339) format, for example - # `2020-05-18T00:00:00.094Z`. - # @!attribute [rw] sha1_fingerprint - # @return [::String] - # Sha1 Fingerprint of the certificate. - class TlsCertificate - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - end - end - end -end diff --git a/owl-bot-staging/google-cloud-redis-v1/proto_docs/google/longrunning/operations.rb b/owl-bot-staging/google-cloud-redis-v1/proto_docs/google/longrunning/operations.rb deleted file mode 100644 index 7a757f512165..000000000000 --- a/owl-bot-staging/google-cloud-redis-v1/proto_docs/google/longrunning/operations.rb +++ /dev/null @@ -1,191 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - - -module Google - module Longrunning - # This resource represents a long-running operation that is the result of a - # network API call. - # @!attribute [rw] name - # @return [::String] - # The server-assigned name, which is only unique within the same service that - # originally returns it. If you use the default HTTP mapping, the - # `name` should be a resource name ending with `operations/{unique_id}`. - # @!attribute [rw] metadata - # @return [::Google::Protobuf::Any] - # Service-specific metadata associated with the operation. It typically - # contains progress information and common metadata such as create time. - # Some services might not provide such metadata. Any method that returns a - # long-running operation should document the metadata type, if any. - # @!attribute [rw] done - # @return [::Boolean] - # If the value is `false`, it means the operation is still in progress. - # If `true`, the operation is completed, and either `error` or `response` is - # available. - # @!attribute [rw] error - # @return [::Google::Rpc::Status] - # The error result of the operation in case of failure or cancellation. - # - # Note: The following fields are mutually exclusive: `error`, `response`. If a field in that set is populated, all other fields in the set will automatically be cleared. - # @!attribute [rw] response - # @return [::Google::Protobuf::Any] - # The normal, successful response of the operation. If the original - # method returns no data on success, such as `Delete`, the response is - # `google.protobuf.Empty`. If the original method is standard - # `Get`/`Create`/`Update`, the response should be the resource. For other - # methods, the response should have the type `XxxResponse`, where `Xxx` - # is the original method name. For example, if the original method name - # is `TakeSnapshot()`, the inferred response type is - # `TakeSnapshotResponse`. - # - # Note: The following fields are mutually exclusive: `response`, `error`. If a field in that set is populated, all other fields in the set will automatically be cleared. - class Operation - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # The request message for - # Operations.GetOperation. - # @!attribute [rw] name - # @return [::String] - # The name of the operation resource. - class GetOperationRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # The request message for - # Operations.ListOperations. - # @!attribute [rw] name - # @return [::String] - # The name of the operation's parent resource. - # @!attribute [rw] filter - # @return [::String] - # The standard list filter. - # @!attribute [rw] page_size - # @return [::Integer] - # The standard list page size. - # @!attribute [rw] page_token - # @return [::String] - # The standard list page token. - # @!attribute [rw] return_partial_success - # @return [::Boolean] - # When set to `true`, operations that are reachable are returned as normal, - # and those that are unreachable are returned in the - # [ListOperationsResponse.unreachable] field. - # - # This can only be `true` when reading across collections e.g. when `parent` - # is set to `"projects/example/locations/-"`. - # - # This field is not by default supported and will result in an - # `UNIMPLEMENTED` error if set unless explicitly documented otherwise in - # service or product specific documentation. - class ListOperationsRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # The response message for - # Operations.ListOperations. - # @!attribute [rw] operations - # @return [::Array<::Google::Longrunning::Operation>] - # A list of operations that matches the specified filter in the request. - # @!attribute [rw] next_page_token - # @return [::String] - # The standard List next-page token. - # @!attribute [rw] unreachable - # @return [::Array<::String>] - # Unordered list. Unreachable resources. Populated when the request sets - # `ListOperationsRequest.return_partial_success` and reads across - # collections e.g. when attempting to list all resources across all supported - # locations. - class ListOperationsResponse - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # The request message for - # Operations.CancelOperation. - # @!attribute [rw] name - # @return [::String] - # The name of the operation resource to be cancelled. - class CancelOperationRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # The request message for - # Operations.DeleteOperation. - # @!attribute [rw] name - # @return [::String] - # The name of the operation resource to be deleted. - class DeleteOperationRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # The request message for - # Operations.WaitOperation. - # @!attribute [rw] name - # @return [::String] - # The name of the operation resource to wait on. - # @!attribute [rw] timeout - # @return [::Google::Protobuf::Duration] - # The maximum duration to wait before timing out. If left blank, the wait - # will be at most the time permitted by the underlying HTTP/RPC protocol. - # If RPC context deadline is also specified, the shorter one will be used. - class WaitOperationRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # A message representing the message types used by a long-running operation. - # - # Example: - # - # rpc Export(ExportRequest) returns (google.longrunning.Operation) { - # option (google.longrunning.operation_info) = { - # response_type: "ExportResponse" - # metadata_type: "ExportMetadata" - # }; - # } - # @!attribute [rw] response_type - # @return [::String] - # Required. The message name of the primary return type for this - # long-running operation. - # This type will be used to deserialize the LRO's response. - # - # If the response is in a different package from the rpc, a fully-qualified - # message name must be used (e.g. `google.protobuf.Struct`). - # - # Note: Altering this value constitutes a breaking change. - # @!attribute [rw] metadata_type - # @return [::String] - # Required. The message name of the metadata type for this long-running - # operation. - # - # If the response is in a different package from the rpc, a fully-qualified - # message name must be used (e.g. `google.protobuf.Struct`). - # - # Note: Altering this value constitutes a breaking change. - class OperationInfo - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - end -end diff --git a/owl-bot-staging/google-cloud-redis-v1/proto_docs/google/protobuf/any.rb b/owl-bot-staging/google-cloud-redis-v1/proto_docs/google/protobuf/any.rb deleted file mode 100644 index 58691995f02e..000000000000 --- a/owl-bot-staging/google-cloud-redis-v1/proto_docs/google/protobuf/any.rb +++ /dev/null @@ -1,145 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - - -module Google - module Protobuf - # `Any` contains an arbitrary serialized protocol buffer message along with a - # URL that describes the type of the serialized message. - # - # Protobuf library provides support to pack/unpack Any values in the form - # of utility functions or additional generated methods of the Any type. - # - # Example 1: Pack and unpack a message in C++. - # - # Foo foo = ...; - # Any any; - # any.PackFrom(foo); - # ... - # if (any.UnpackTo(&foo)) { - # ... - # } - # - # Example 2: Pack and unpack a message in Java. - # - # Foo foo = ...; - # Any any = Any.pack(foo); - # ... - # if (any.is(Foo.class)) { - # foo = any.unpack(Foo.class); - # } - # // or ... - # if (any.isSameTypeAs(Foo.getDefaultInstance())) { - # foo = any.unpack(Foo.getDefaultInstance()); - # } - # - # Example 3: Pack and unpack a message in Python. - # - # foo = Foo(...) - # any = Any() - # any.Pack(foo) - # ... - # if any.Is(Foo.DESCRIPTOR): - # any.Unpack(foo) - # ... - # - # Example 4: Pack and unpack a message in Go - # - # foo := &pb.Foo{...} - # any, err := anypb.New(foo) - # if err != nil { - # ... - # } - # ... - # foo := &pb.Foo{} - # if err := any.UnmarshalTo(foo); err != nil { - # ... - # } - # - # The pack methods provided by protobuf library will by default use - # 'type.googleapis.com/full.type.name' as the type URL and the unpack - # methods only use the fully qualified type name after the last '/' - # in the type URL, for example "foo.bar.com/x/y.z" will yield type - # name "y.z". - # - # JSON - # ==== - # The JSON representation of an `Any` value uses the regular - # representation of the deserialized, embedded message, with an - # additional field `@type` which contains the type URL. Example: - # - # package google.profile; - # message Person { - # string first_name = 1; - # string last_name = 2; - # } - # - # { - # "@type": "type.googleapis.com/google.profile.Person", - # "firstName": , - # "lastName": - # } - # - # If the embedded message type is well-known and has a custom JSON - # representation, that representation will be embedded adding a field - # `value` which holds the custom JSON in addition to the `@type` - # field. Example (for message [google.protobuf.Duration][]): - # - # { - # "@type": "type.googleapis.com/google.protobuf.Duration", - # "value": "1.212s" - # } - # @!attribute [rw] type_url - # @return [::String] - # A URL/resource name that uniquely identifies the type of the serialized - # protocol buffer message. This string must contain at least - # one "/" character. The last segment of the URL's path must represent - # the fully qualified name of the type (as in - # `path/google.protobuf.Duration`). The name should be in a canonical form - # (e.g., leading "." is not accepted). - # - # In practice, teams usually precompile into the binary all types that they - # expect it to use in the context of Any. However, for URLs which use the - # scheme `http`, `https`, or no scheme, one can optionally set up a type - # server that maps type URLs to message definitions as follows: - # - # * If no scheme is provided, `https` is assumed. - # * An HTTP GET on the URL must yield a [google.protobuf.Type][] - # value in binary format, or produce an error. - # * Applications are allowed to cache lookup results based on the - # URL, or have them precompiled into a binary to avoid any - # lookup. Therefore, binary compatibility needs to be preserved - # on changes to types. (Use versioned type names to manage - # breaking changes.) - # - # Note: this functionality is not currently available in the official - # protobuf release, and it is not used for type URLs beginning with - # type.googleapis.com. As of May 2023, there are no widely used type server - # implementations and no plans to implement one. - # - # Schemes other than `http`, `https` (or the empty scheme) might be - # used with implementation specific semantics. - # @!attribute [rw] value - # @return [::String] - # Must be a valid serialized protocol buffer of the above specified type. - class Any - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - end -end diff --git a/owl-bot-staging/google-cloud-redis-v1/proto_docs/google/protobuf/duration.rb b/owl-bot-staging/google-cloud-redis-v1/proto_docs/google/protobuf/duration.rb deleted file mode 100644 index ea59f1f91daf..000000000000 --- a/owl-bot-staging/google-cloud-redis-v1/proto_docs/google/protobuf/duration.rb +++ /dev/null @@ -1,98 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - - -module Google - module Protobuf - # A Duration represents a signed, fixed-length span of time represented - # as a count of seconds and fractions of seconds at nanosecond - # resolution. It is independent of any calendar and concepts like "day" - # or "month". It is related to Timestamp in that the difference between - # two Timestamp values is a Duration and it can be added or subtracted - # from a Timestamp. Range is approximately +-10,000 years. - # - # # Examples - # - # Example 1: Compute Duration from two Timestamps in pseudo code. - # - # Timestamp start = ...; - # Timestamp end = ...; - # Duration duration = ...; - # - # duration.seconds = end.seconds - start.seconds; - # duration.nanos = end.nanos - start.nanos; - # - # if (duration.seconds < 0 && duration.nanos > 0) { - # duration.seconds += 1; - # duration.nanos -= 1000000000; - # } else if (duration.seconds > 0 && duration.nanos < 0) { - # duration.seconds -= 1; - # duration.nanos += 1000000000; - # } - # - # Example 2: Compute Timestamp from Timestamp + Duration in pseudo code. - # - # Timestamp start = ...; - # Duration duration = ...; - # Timestamp end = ...; - # - # end.seconds = start.seconds + duration.seconds; - # end.nanos = start.nanos + duration.nanos; - # - # if (end.nanos < 0) { - # end.seconds -= 1; - # end.nanos += 1000000000; - # } else if (end.nanos >= 1000000000) { - # end.seconds += 1; - # end.nanos -= 1000000000; - # } - # - # Example 3: Compute Duration from datetime.timedelta in Python. - # - # td = datetime.timedelta(days=3, minutes=10) - # duration = Duration() - # duration.FromTimedelta(td) - # - # # JSON Mapping - # - # In JSON format, the Duration type is encoded as a string rather than an - # object, where the string ends in the suffix "s" (indicating seconds) and - # is preceded by the number of seconds, with nanoseconds expressed as - # fractional seconds. For example, 3 seconds with 0 nanoseconds should be - # encoded in JSON format as "3s", while 3 seconds and 1 nanosecond should - # be expressed in JSON format as "3.000000001s", and 3 seconds and 1 - # microsecond should be expressed in JSON format as "3.000001s". - # @!attribute [rw] seconds - # @return [::Integer] - # Signed seconds of the span of time. Must be from -315,576,000,000 - # to +315,576,000,000 inclusive. Note: these bounds are computed from: - # 60 sec/min * 60 min/hr * 24 hr/day * 365.25 days/year * 10000 years - # @!attribute [rw] nanos - # @return [::Integer] - # Signed fractions of a second at nanosecond resolution of the span - # of time. Durations less than one second are represented with a 0 - # `seconds` field and a positive or negative `nanos` field. For durations - # of one second or more, a non-zero value for the `nanos` field must be - # of the same sign as the `seconds` field. Must be from -999,999,999 - # to +999,999,999 inclusive. - class Duration - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - end -end diff --git a/owl-bot-staging/google-cloud-redis-v1/proto_docs/google/protobuf/empty.rb b/owl-bot-staging/google-cloud-redis-v1/proto_docs/google/protobuf/empty.rb deleted file mode 100644 index 83e4481834a6..000000000000 --- a/owl-bot-staging/google-cloud-redis-v1/proto_docs/google/protobuf/empty.rb +++ /dev/null @@ -1,34 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - - -module Google - module Protobuf - # A generic empty message that you can re-use to avoid defining duplicated - # empty messages in your APIs. A typical example is to use it as the request - # or the response type of an API method. For instance: - # - # service Foo { - # rpc Bar(google.protobuf.Empty) returns (google.protobuf.Empty); - # } - class Empty - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - end -end diff --git a/owl-bot-staging/google-cloud-redis-v1/proto_docs/google/protobuf/field_mask.rb b/owl-bot-staging/google-cloud-redis-v1/proto_docs/google/protobuf/field_mask.rb deleted file mode 100644 index 7f3ffc78601a..000000000000 --- a/owl-bot-staging/google-cloud-redis-v1/proto_docs/google/protobuf/field_mask.rb +++ /dev/null @@ -1,229 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - - -module Google - module Protobuf - # `FieldMask` represents a set of symbolic field paths, for example: - # - # paths: "f.a" - # paths: "f.b.d" - # - # Here `f` represents a field in some root message, `a` and `b` - # fields in the message found in `f`, and `d` a field found in the - # message in `f.b`. - # - # Field masks are used to specify a subset of fields that should be - # returned by a get operation or modified by an update operation. - # Field masks also have a custom JSON encoding (see below). - # - # # Field Masks in Projections - # - # When used in the context of a projection, a response message or - # sub-message is filtered by the API to only contain those fields as - # specified in the mask. For example, if the mask in the previous - # example is applied to a response message as follows: - # - # f { - # a : 22 - # b { - # d : 1 - # x : 2 - # } - # y : 13 - # } - # z: 8 - # - # The result will not contain specific values for fields x,y and z - # (their value will be set to the default, and omitted in proto text - # output): - # - # - # f { - # a : 22 - # b { - # d : 1 - # } - # } - # - # A repeated field is not allowed except at the last position of a - # paths string. - # - # If a FieldMask object is not present in a get operation, the - # operation applies to all fields (as if a FieldMask of all fields - # had been specified). - # - # Note that a field mask does not necessarily apply to the - # top-level response message. In case of a REST get operation, the - # field mask applies directly to the response, but in case of a REST - # list operation, the mask instead applies to each individual message - # in the returned resource list. In case of a REST custom method, - # other definitions may be used. Where the mask applies will be - # clearly documented together with its declaration in the API. In - # any case, the effect on the returned resource/resources is required - # behavior for APIs. - # - # # Field Masks in Update Operations - # - # A field mask in update operations specifies which fields of the - # targeted resource are going to be updated. The API is required - # to only change the values of the fields as specified in the mask - # and leave the others untouched. If a resource is passed in to - # describe the updated values, the API ignores the values of all - # fields not covered by the mask. - # - # If a repeated field is specified for an update operation, new values will - # be appended to the existing repeated field in the target resource. Note that - # a repeated field is only allowed in the last position of a `paths` string. - # - # If a sub-message is specified in the last position of the field mask for an - # update operation, then new value will be merged into the existing sub-message - # in the target resource. - # - # For example, given the target message: - # - # f { - # b { - # d: 1 - # x: 2 - # } - # c: [1] - # } - # - # And an update message: - # - # f { - # b { - # d: 10 - # } - # c: [2] - # } - # - # then if the field mask is: - # - # paths: ["f.b", "f.c"] - # - # then the result will be: - # - # f { - # b { - # d: 10 - # x: 2 - # } - # c: [1, 2] - # } - # - # An implementation may provide options to override this default behavior for - # repeated and message fields. - # - # In order to reset a field's value to the default, the field must - # be in the mask and set to the default value in the provided resource. - # Hence, in order to reset all fields of a resource, provide a default - # instance of the resource and set all fields in the mask, or do - # not provide a mask as described below. - # - # If a field mask is not present on update, the operation applies to - # all fields (as if a field mask of all fields has been specified). - # Note that in the presence of schema evolution, this may mean that - # fields the client does not know and has therefore not filled into - # the request will be reset to their default. If this is unwanted - # behavior, a specific service may require a client to always specify - # a field mask, producing an error if not. - # - # As with get operations, the location of the resource which - # describes the updated values in the request message depends on the - # operation kind. In any case, the effect of the field mask is - # required to be honored by the API. - # - # ## Considerations for HTTP REST - # - # The HTTP kind of an update operation which uses a field mask must - # be set to PATCH instead of PUT in order to satisfy HTTP semantics - # (PUT must only be used for full updates). - # - # # JSON Encoding of Field Masks - # - # In JSON, a field mask is encoded as a single string where paths are - # separated by a comma. Fields name in each path are converted - # to/from lower-camel naming conventions. - # - # As an example, consider the following message declarations: - # - # message Profile { - # User user = 1; - # Photo photo = 2; - # } - # message User { - # string display_name = 1; - # string address = 2; - # } - # - # In proto a field mask for `Profile` may look as such: - # - # mask { - # paths: "user.display_name" - # paths: "photo" - # } - # - # In JSON, the same mask is represented as below: - # - # { - # mask: "user.displayName,photo" - # } - # - # # Field Masks and Oneof Fields - # - # Field masks treat fields in oneofs just as regular fields. Consider the - # following message: - # - # message SampleMessage { - # oneof test_oneof { - # string name = 4; - # SubMessage sub_message = 9; - # } - # } - # - # The field mask can be: - # - # mask { - # paths: "name" - # } - # - # Or: - # - # mask { - # paths: "sub_message" - # } - # - # Note that oneof type names ("test_oneof" in this case) cannot be used in - # paths. - # - # ## Field Mask Verification - # - # The implementation of any API method which has a FieldMask type field in the - # request should verify the included field paths, and return an - # `INVALID_ARGUMENT` error if any path is unmappable. - # @!attribute [rw] paths - # @return [::Array<::String>] - # The set of field mask paths. - class FieldMask - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - end -end diff --git a/owl-bot-staging/google-cloud-redis-v1/proto_docs/google/protobuf/timestamp.rb b/owl-bot-staging/google-cloud-redis-v1/proto_docs/google/protobuf/timestamp.rb deleted file mode 100644 index 74352be9c58c..000000000000 --- a/owl-bot-staging/google-cloud-redis-v1/proto_docs/google/protobuf/timestamp.rb +++ /dev/null @@ -1,127 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - - -module Google - module Protobuf - # A Timestamp represents a point in time independent of any time zone or local - # calendar, encoded as a count of seconds and fractions of seconds at - # nanosecond resolution. The count is relative to an epoch at UTC midnight on - # January 1, 1970, in the proleptic Gregorian calendar which extends the - # Gregorian calendar backwards to year one. - # - # All minutes are 60 seconds long. Leap seconds are "smeared" so that no leap - # second table is needed for interpretation, using a [24-hour linear - # smear](https://developers.google.com/time/smear). - # - # The range is from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59.999999999Z. By - # restricting to that range, we ensure that we can convert to and from [RFC - # 3339](https://www.ietf.org/rfc/rfc3339.txt) date strings. - # - # # Examples - # - # Example 1: Compute Timestamp from POSIX `time()`. - # - # Timestamp timestamp; - # timestamp.set_seconds(time(NULL)); - # timestamp.set_nanos(0); - # - # Example 2: Compute Timestamp from POSIX `gettimeofday()`. - # - # struct timeval tv; - # gettimeofday(&tv, NULL); - # - # Timestamp timestamp; - # timestamp.set_seconds(tv.tv_sec); - # timestamp.set_nanos(tv.tv_usec * 1000); - # - # Example 3: Compute Timestamp from Win32 `GetSystemTimeAsFileTime()`. - # - # FILETIME ft; - # GetSystemTimeAsFileTime(&ft); - # UINT64 ticks = (((UINT64)ft.dwHighDateTime) << 32) | ft.dwLowDateTime; - # - # // A Windows tick is 100 nanoseconds. Windows epoch 1601-01-01T00:00:00Z - # // is 11644473600 seconds before Unix epoch 1970-01-01T00:00:00Z. - # Timestamp timestamp; - # timestamp.set_seconds((INT64) ((ticks / 10000000) - 11644473600LL)); - # timestamp.set_nanos((INT32) ((ticks % 10000000) * 100)); - # - # Example 4: Compute Timestamp from Java `System.currentTimeMillis()`. - # - # long millis = System.currentTimeMillis(); - # - # Timestamp timestamp = Timestamp.newBuilder().setSeconds(millis / 1000) - # .setNanos((int) ((millis % 1000) * 1000000)).build(); - # - # Example 5: Compute Timestamp from Java `Instant.now()`. - # - # Instant now = Instant.now(); - # - # Timestamp timestamp = - # Timestamp.newBuilder().setSeconds(now.getEpochSecond()) - # .setNanos(now.getNano()).build(); - # - # Example 6: Compute Timestamp from current time in Python. - # - # timestamp = Timestamp() - # timestamp.GetCurrentTime() - # - # # JSON Mapping - # - # In JSON format, the Timestamp type is encoded as a string in the - # [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format. That is, the - # format is "\\{year}-\\{month}-\\{day}T\\{hour}:\\{min}:\\{sec}[.\\{frac_sec}]Z" - # where \\{year} is always expressed using four digits while \\{month}, \\{day}, - # \\{hour}, \\{min}, and \\{sec} are zero-padded to two digits each. The fractional - # seconds, which can go up to 9 digits (i.e. up to 1 nanosecond resolution), - # are optional. The "Z" suffix indicates the timezone ("UTC"); the timezone - # is required. A proto3 JSON serializer should always use UTC (as indicated by - # "Z") when printing the Timestamp type and a proto3 JSON parser should be - # able to accept both UTC and other timezones (as indicated by an offset). - # - # For example, "2017-01-15T01:30:15.01Z" encodes 15.01 seconds past - # 01:30 UTC on January 15, 2017. - # - # In JavaScript, one can convert a Date object to this format using the - # standard - # [toISOString()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toISOString) - # method. In Python, a standard `datetime.datetime` object can be converted - # to this format using - # [`strftime`](https://docs.python.org/2/library/time.html#time.strftime) with - # the time format spec '%Y-%m-%dT%H:%M:%S.%fZ'. Likewise, in Java, one can use - # the Joda Time's [`ISODateTimeFormat.dateTime()`]( - # http://joda-time.sourceforge.net/apidocs/org/joda/time/format/ISODateTimeFormat.html#dateTime() - # ) to obtain a formatter capable of generating timestamps in this format. - # @!attribute [rw] seconds - # @return [::Integer] - # Represents seconds of UTC time since Unix epoch - # 1970-01-01T00:00:00Z. Must be from 0001-01-01T00:00:00Z to - # 9999-12-31T23:59:59Z inclusive. - # @!attribute [rw] nanos - # @return [::Integer] - # Non-negative fractions of a second at nanosecond resolution. Negative - # second values with fractions must still have non-negative nanos values - # that count forward in time. Must be from 0 to 999,999,999 - # inclusive. - class Timestamp - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - end -end diff --git a/owl-bot-staging/google-cloud-redis-v1/proto_docs/google/rpc/status.rb b/owl-bot-staging/google-cloud-redis-v1/proto_docs/google/rpc/status.rb deleted file mode 100644 index c1a1c07eb2db..000000000000 --- a/owl-bot-staging/google-cloud-redis-v1/proto_docs/google/rpc/status.rb +++ /dev/null @@ -1,48 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - - -module Google - module Rpc - # The `Status` type defines a logical error model that is suitable for - # different programming environments, including REST APIs and RPC APIs. It is - # used by [gRPC](https://github.com/grpc). Each `Status` message contains - # three pieces of data: error code, error message, and error details. - # - # You can find out more about this error model and how to work with it in the - # [API Design Guide](https://cloud.google.com/apis/design/errors). - # @!attribute [rw] code - # @return [::Integer] - # The status code, which should be an enum value of - # [google.rpc.Code][google.rpc.Code]. - # @!attribute [rw] message - # @return [::String] - # A developer-facing error message, which should be in English. Any - # user-facing error message should be localized and sent in the - # {::Google::Rpc::Status#details google.rpc.Status.details} field, or localized - # by the client. - # @!attribute [rw] details - # @return [::Array<::Google::Protobuf::Any>] - # A list of messages that carry the error details. There is a common set of - # message types for APIs to use. - class Status - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - end -end diff --git a/owl-bot-staging/google-cloud-redis-v1/proto_docs/google/type/dayofweek.rb b/owl-bot-staging/google-cloud-redis-v1/proto_docs/google/type/dayofweek.rb deleted file mode 100644 index 973211b9ffe7..000000000000 --- a/owl-bot-staging/google-cloud-redis-v1/proto_docs/google/type/dayofweek.rb +++ /dev/null @@ -1,49 +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 day of the week. - module DayOfWeek - # The day of the week is unspecified. - DAY_OF_WEEK_UNSPECIFIED = 0 - - # Monday - MONDAY = 1 - - # Tuesday - TUESDAY = 2 - - # Wednesday - WEDNESDAY = 3 - - # Thursday - THURSDAY = 4 - - # Friday - FRIDAY = 5 - - # Saturday - SATURDAY = 6 - - # Sunday - SUNDAY = 7 - end - end -end diff --git a/owl-bot-staging/google-cloud-redis-v1/proto_docs/google/type/timeofday.rb b/owl-bot-staging/google-cloud-redis-v1/proto_docs/google/type/timeofday.rb deleted file mode 100644 index 8372dad8beb8..000000000000 --- a/owl-bot-staging/google-cloud-redis-v1/proto_docs/google/type/timeofday.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! - - -module Google - module Type - # Represents a time of day. The date and time zone are either not significant - # or are specified elsewhere. An API may choose to allow leap seconds. Related - # types are [google.type.Date][google.type.Date] and - # `google.protobuf.Timestamp`. - # @!attribute [rw] hours - # @return [::Integer] - # Hours of day in 24 hour format. Should be from 0 to 23. An API may choose - # to allow the value "24:00:00" for scenarios like business closing time. - # @!attribute [rw] minutes - # @return [::Integer] - # Minutes of hour of day. Must be from 0 to 59. - # @!attribute [rw] seconds - # @return [::Integer] - # Seconds of minutes of the time. Must normally be from 0 to 59. An API may - # allow the value 60 if it allows leap-seconds. - # @!attribute [rw] nanos - # @return [::Integer] - # Fractions of seconds in nanoseconds. Must be from 0 to 999,999,999. - class TimeOfDay - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - end -end diff --git a/owl-bot-staging/google-cloud-redis-v1/snippets/Gemfile b/owl-bot-staging/google-cloud-redis-v1/snippets/Gemfile deleted file mode 100644 index 6003ed6bc6f4..000000000000 --- a/owl-bot-staging/google-cloud-redis-v1/snippets/Gemfile +++ /dev/null @@ -1,32 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -source "https://rubygems.org" - -if ENV["GOOGLE_CLOUD_SAMPLES_TEST"] == "master" - gem "google-cloud-redis-v1", path: "../" -else - gem "google-cloud-redis-v1" -end - -group :test do - gem "google-style", "~> 1.26.1" - gem "minitest", "~> 5.16" - gem "minitest-focus", "~> 1.1" - gem "minitest-hooks", "~> 1.5" -end diff --git a/owl-bot-staging/google-cloud-redis-v1/snippets/cloud_redis/create_instance.rb b/owl-bot-staging/google-cloud-redis-v1/snippets/cloud_redis/create_instance.rb deleted file mode 100644 index a85e187c7e83..000000000000 --- a/owl-bot-staging/google-cloud-redis-v1/snippets/cloud_redis/create_instance.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 redis_v1_generated_CloudRedis_CreateInstance_sync] -require "google/cloud/redis/v1" - -## -# Snippet for the create_instance call in the CloudRedis service -# -# This snippet has been automatically generated and should be regarded as a code -# template only. It will require modifications to work: -# - It may require correct/in-range values for request initialization. -# - It may require specifying regional endpoints when creating the service -# client as shown in https://cloud.google.com/ruby/docs/reference. -# -# This is an auto-generated example demonstrating basic usage of -# Google::Cloud::Redis::V1::CloudRedis::Client#create_instance. -# -def create_instance - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::Redis::V1::CloudRedis::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::Redis::V1::CreateInstanceRequest.new - - # Call the create_instance method. - result = client.create_instance 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 redis_v1_generated_CloudRedis_CreateInstance_sync] diff --git a/owl-bot-staging/google-cloud-redis-v1/snippets/cloud_redis/delete_instance.rb b/owl-bot-staging/google-cloud-redis-v1/snippets/cloud_redis/delete_instance.rb deleted file mode 100644 index cbb66f6761f3..000000000000 --- a/owl-bot-staging/google-cloud-redis-v1/snippets/cloud_redis/delete_instance.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 redis_v1_generated_CloudRedis_DeleteInstance_sync] -require "google/cloud/redis/v1" - -## -# Snippet for the delete_instance call in the CloudRedis service -# -# This snippet has been automatically generated and should be regarded as a code -# template only. It will require modifications to work: -# - It may require correct/in-range values for request initialization. -# - It may require specifying regional endpoints when creating the service -# client as shown in https://cloud.google.com/ruby/docs/reference. -# -# This is an auto-generated example demonstrating basic usage of -# Google::Cloud::Redis::V1::CloudRedis::Client#delete_instance. -# -def delete_instance - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::Redis::V1::CloudRedis::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::Redis::V1::DeleteInstanceRequest.new - - # Call the delete_instance method. - result = client.delete_instance 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 redis_v1_generated_CloudRedis_DeleteInstance_sync] diff --git a/owl-bot-staging/google-cloud-redis-v1/snippets/cloud_redis/export_instance.rb b/owl-bot-staging/google-cloud-redis-v1/snippets/cloud_redis/export_instance.rb deleted file mode 100644 index 3cf89998196b..000000000000 --- a/owl-bot-staging/google-cloud-redis-v1/snippets/cloud_redis/export_instance.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 redis_v1_generated_CloudRedis_ExportInstance_sync] -require "google/cloud/redis/v1" - -## -# Snippet for the export_instance call in the CloudRedis service -# -# This snippet has been automatically generated and should be regarded as a code -# template only. It will require modifications to work: -# - It may require correct/in-range values for request initialization. -# - It may require specifying regional endpoints when creating the service -# client as shown in https://cloud.google.com/ruby/docs/reference. -# -# This is an auto-generated example demonstrating basic usage of -# Google::Cloud::Redis::V1::CloudRedis::Client#export_instance. -# -def export_instance - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::Redis::V1::CloudRedis::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::Redis::V1::ExportInstanceRequest.new - - # Call the export_instance method. - result = client.export_instance 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 redis_v1_generated_CloudRedis_ExportInstance_sync] diff --git a/owl-bot-staging/google-cloud-redis-v1/snippets/cloud_redis/failover_instance.rb b/owl-bot-staging/google-cloud-redis-v1/snippets/cloud_redis/failover_instance.rb deleted file mode 100644 index 613c90fa070a..000000000000 --- a/owl-bot-staging/google-cloud-redis-v1/snippets/cloud_redis/failover_instance.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 redis_v1_generated_CloudRedis_FailoverInstance_sync] -require "google/cloud/redis/v1" - -## -# Snippet for the failover_instance call in the CloudRedis service -# -# This snippet has been automatically generated and should be regarded as a code -# template only. It will require modifications to work: -# - It may require correct/in-range values for request initialization. -# - It may require specifying regional endpoints when creating the service -# client as shown in https://cloud.google.com/ruby/docs/reference. -# -# This is an auto-generated example demonstrating basic usage of -# Google::Cloud::Redis::V1::CloudRedis::Client#failover_instance. -# -def failover_instance - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::Redis::V1::CloudRedis::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::Redis::V1::FailoverInstanceRequest.new - - # Call the failover_instance method. - result = client.failover_instance 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 redis_v1_generated_CloudRedis_FailoverInstance_sync] diff --git a/owl-bot-staging/google-cloud-redis-v1/snippets/cloud_redis/get_instance.rb b/owl-bot-staging/google-cloud-redis-v1/snippets/cloud_redis/get_instance.rb deleted file mode 100644 index 522711995113..000000000000 --- a/owl-bot-staging/google-cloud-redis-v1/snippets/cloud_redis/get_instance.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 redis_v1_generated_CloudRedis_GetInstance_sync] -require "google/cloud/redis/v1" - -## -# Snippet for the get_instance call in the CloudRedis service -# -# This snippet has been automatically generated and should be regarded as a code -# template only. It will require modifications to work: -# - It may require correct/in-range values for request initialization. -# - It may require specifying regional endpoints when creating the service -# client as shown in https://cloud.google.com/ruby/docs/reference. -# -# This is an auto-generated example demonstrating basic usage of -# Google::Cloud::Redis::V1::CloudRedis::Client#get_instance. -# -def get_instance - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::Redis::V1::CloudRedis::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::Redis::V1::GetInstanceRequest.new - - # Call the get_instance method. - result = client.get_instance request - - # The returned object is of type Google::Cloud::Redis::V1::Instance. - p result -end -# [END redis_v1_generated_CloudRedis_GetInstance_sync] diff --git a/owl-bot-staging/google-cloud-redis-v1/snippets/cloud_redis/get_instance_auth_string.rb b/owl-bot-staging/google-cloud-redis-v1/snippets/cloud_redis/get_instance_auth_string.rb deleted file mode 100644 index d583817635ac..000000000000 --- a/owl-bot-staging/google-cloud-redis-v1/snippets/cloud_redis/get_instance_auth_string.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 redis_v1_generated_CloudRedis_GetInstanceAuthString_sync] -require "google/cloud/redis/v1" - -## -# Snippet for the get_instance_auth_string call in the CloudRedis service -# -# This snippet has been automatically generated and should be regarded as a code -# template only. It will require modifications to work: -# - It may require correct/in-range values for request initialization. -# - It may require specifying regional endpoints when creating the service -# client as shown in https://cloud.google.com/ruby/docs/reference. -# -# This is an auto-generated example demonstrating basic usage of -# Google::Cloud::Redis::V1::CloudRedis::Client#get_instance_auth_string. -# -def get_instance_auth_string - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::Redis::V1::CloudRedis::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::Redis::V1::GetInstanceAuthStringRequest.new - - # Call the get_instance_auth_string method. - result = client.get_instance_auth_string request - - # The returned object is of type Google::Cloud::Redis::V1::InstanceAuthString. - p result -end -# [END redis_v1_generated_CloudRedis_GetInstanceAuthString_sync] diff --git a/owl-bot-staging/google-cloud-redis-v1/snippets/cloud_redis/import_instance.rb b/owl-bot-staging/google-cloud-redis-v1/snippets/cloud_redis/import_instance.rb deleted file mode 100644 index eb9497653ab5..000000000000 --- a/owl-bot-staging/google-cloud-redis-v1/snippets/cloud_redis/import_instance.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 redis_v1_generated_CloudRedis_ImportInstance_sync] -require "google/cloud/redis/v1" - -## -# Snippet for the import_instance call in the CloudRedis service -# -# This snippet has been automatically generated and should be regarded as a code -# template only. It will require modifications to work: -# - It may require correct/in-range values for request initialization. -# - It may require specifying regional endpoints when creating the service -# client as shown in https://cloud.google.com/ruby/docs/reference. -# -# This is an auto-generated example demonstrating basic usage of -# Google::Cloud::Redis::V1::CloudRedis::Client#import_instance. -# -def import_instance - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::Redis::V1::CloudRedis::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::Redis::V1::ImportInstanceRequest.new - - # Call the import_instance method. - result = client.import_instance 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 redis_v1_generated_CloudRedis_ImportInstance_sync] diff --git a/owl-bot-staging/google-cloud-redis-v1/snippets/cloud_redis/list_instances.rb b/owl-bot-staging/google-cloud-redis-v1/snippets/cloud_redis/list_instances.rb deleted file mode 100644 index ace5184602b9..000000000000 --- a/owl-bot-staging/google-cloud-redis-v1/snippets/cloud_redis/list_instances.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 redis_v1_generated_CloudRedis_ListInstances_sync] -require "google/cloud/redis/v1" - -## -# Snippet for the list_instances call in the CloudRedis service -# -# This snippet has been automatically generated and should be regarded as a code -# template only. It will require modifications to work: -# - It may require correct/in-range values for request initialization. -# - It may require specifying regional endpoints when creating the service -# client as shown in https://cloud.google.com/ruby/docs/reference. -# -# This is an auto-generated example demonstrating basic usage of -# Google::Cloud::Redis::V1::CloudRedis::Client#list_instances. -# -def list_instances - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::Redis::V1::CloudRedis::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::Redis::V1::ListInstancesRequest.new - - # Call the list_instances method. - result = client.list_instances request - - # The returned object is of type Gapic::PagedEnumerable. You can iterate - # over elements, and API calls will be issued to fetch pages as needed. - result.each do |item| - # Each element is of type ::Google::Cloud::Redis::V1::Instance. - p item - end -end -# [END redis_v1_generated_CloudRedis_ListInstances_sync] diff --git a/owl-bot-staging/google-cloud-redis-v1/snippets/cloud_redis/reschedule_maintenance.rb b/owl-bot-staging/google-cloud-redis-v1/snippets/cloud_redis/reschedule_maintenance.rb deleted file mode 100644 index c101bbea499b..000000000000 --- a/owl-bot-staging/google-cloud-redis-v1/snippets/cloud_redis/reschedule_maintenance.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 redis_v1_generated_CloudRedis_RescheduleMaintenance_sync] -require "google/cloud/redis/v1" - -## -# Snippet for the reschedule_maintenance call in the CloudRedis service -# -# This snippet has been automatically generated and should be regarded as a code -# template only. It will require modifications to work: -# - It may require correct/in-range values for request initialization. -# - It may require specifying regional endpoints when creating the service -# client as shown in https://cloud.google.com/ruby/docs/reference. -# -# This is an auto-generated example demonstrating basic usage of -# Google::Cloud::Redis::V1::CloudRedis::Client#reschedule_maintenance. -# -def reschedule_maintenance - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::Redis::V1::CloudRedis::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::Redis::V1::RescheduleMaintenanceRequest.new - - # Call the reschedule_maintenance method. - result = client.reschedule_maintenance 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 redis_v1_generated_CloudRedis_RescheduleMaintenance_sync] diff --git a/owl-bot-staging/google-cloud-redis-v1/snippets/cloud_redis/update_instance.rb b/owl-bot-staging/google-cloud-redis-v1/snippets/cloud_redis/update_instance.rb deleted file mode 100644 index 6021230dbaca..000000000000 --- a/owl-bot-staging/google-cloud-redis-v1/snippets/cloud_redis/update_instance.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 redis_v1_generated_CloudRedis_UpdateInstance_sync] -require "google/cloud/redis/v1" - -## -# Snippet for the update_instance call in the CloudRedis service -# -# This snippet has been automatically generated and should be regarded as a code -# template only. It will require modifications to work: -# - It may require correct/in-range values for request initialization. -# - It may require specifying regional endpoints when creating the service -# client as shown in https://cloud.google.com/ruby/docs/reference. -# -# This is an auto-generated example demonstrating basic usage of -# Google::Cloud::Redis::V1::CloudRedis::Client#update_instance. -# -def update_instance - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::Redis::V1::CloudRedis::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::Redis::V1::UpdateInstanceRequest.new - - # Call the update_instance method. - result = client.update_instance 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 redis_v1_generated_CloudRedis_UpdateInstance_sync] diff --git a/owl-bot-staging/google-cloud-redis-v1/snippets/cloud_redis/upgrade_instance.rb b/owl-bot-staging/google-cloud-redis-v1/snippets/cloud_redis/upgrade_instance.rb deleted file mode 100644 index 5bb70ad81b74..000000000000 --- a/owl-bot-staging/google-cloud-redis-v1/snippets/cloud_redis/upgrade_instance.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 redis_v1_generated_CloudRedis_UpgradeInstance_sync] -require "google/cloud/redis/v1" - -## -# Snippet for the upgrade_instance call in the CloudRedis service -# -# This snippet has been automatically generated and should be regarded as a code -# template only. It will require modifications to work: -# - It may require correct/in-range values for request initialization. -# - It may require specifying regional endpoints when creating the service -# client as shown in https://cloud.google.com/ruby/docs/reference. -# -# This is an auto-generated example demonstrating basic usage of -# Google::Cloud::Redis::V1::CloudRedis::Client#upgrade_instance. -# -def upgrade_instance - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::Redis::V1::CloudRedis::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::Redis::V1::UpgradeInstanceRequest.new - - # Call the upgrade_instance method. - result = client.upgrade_instance 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 redis_v1_generated_CloudRedis_UpgradeInstance_sync] diff --git a/owl-bot-staging/google-cloud-redis-v1/snippets/snippet_metadata_google.cloud.redis.v1.json b/owl-bot-staging/google-cloud-redis-v1/snippets/snippet_metadata_google.cloud.redis.v1.json deleted file mode 100644 index a0fbd771f85f..000000000000 --- a/owl-bot-staging/google-cloud-redis-v1/snippets/snippet_metadata_google.cloud.redis.v1.json +++ /dev/null @@ -1,455 +0,0 @@ -{ - "client_library": { - "name": "google-cloud-redis-v1", - "version": "", - "language": "RUBY", - "apis": [ - { - "id": "google.cloud.redis.v1", - "version": "v1" - } - ] - }, - "snippets": [ - { - "region_tag": "redis_v1_generated_CloudRedis_ListInstances_sync", - "title": "Snippet for the list_instances call in the CloudRedis service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Redis::V1::CloudRedis::Client#list_instances.", - "file": "cloud_redis/list_instances.rb", - "language": "RUBY", - "client_method": { - "short_name": "list_instances", - "full_name": "::Google::Cloud::Redis::V1::CloudRedis::Client#list_instances", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::Redis::V1::ListInstancesRequest", - "name": "request" - } - ], - "result_type": "::Google::Cloud::Redis::V1::ListInstancesResponse", - "client": { - "short_name": "CloudRedis::Client", - "full_name": "::Google::Cloud::Redis::V1::CloudRedis::Client" - }, - "method": { - "short_name": "ListInstances", - "full_name": "google.cloud.redis.v1.CloudRedis.ListInstances", - "service": { - "short_name": "CloudRedis", - "full_name": "google.cloud.redis.v1.CloudRedis" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 50, - "type": "FULL" - } - ] - }, - { - "region_tag": "redis_v1_generated_CloudRedis_GetInstance_sync", - "title": "Snippet for the get_instance call in the CloudRedis service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Redis::V1::CloudRedis::Client#get_instance.", - "file": "cloud_redis/get_instance.rb", - "language": "RUBY", - "client_method": { - "short_name": "get_instance", - "full_name": "::Google::Cloud::Redis::V1::CloudRedis::Client#get_instance", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::Redis::V1::GetInstanceRequest", - "name": "request" - } - ], - "result_type": "::Google::Cloud::Redis::V1::Instance", - "client": { - "short_name": "CloudRedis::Client", - "full_name": "::Google::Cloud::Redis::V1::CloudRedis::Client" - }, - "method": { - "short_name": "GetInstance", - "full_name": "google.cloud.redis.v1.CloudRedis.GetInstance", - "service": { - "short_name": "CloudRedis", - "full_name": "google.cloud.redis.v1.CloudRedis" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 46, - "type": "FULL" - } - ] - }, - { - "region_tag": "redis_v1_generated_CloudRedis_GetInstanceAuthString_sync", - "title": "Snippet for the get_instance_auth_string call in the CloudRedis service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Redis::V1::CloudRedis::Client#get_instance_auth_string.", - "file": "cloud_redis/get_instance_auth_string.rb", - "language": "RUBY", - "client_method": { - "short_name": "get_instance_auth_string", - "full_name": "::Google::Cloud::Redis::V1::CloudRedis::Client#get_instance_auth_string", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::Redis::V1::GetInstanceAuthStringRequest", - "name": "request" - } - ], - "result_type": "::Google::Cloud::Redis::V1::InstanceAuthString", - "client": { - "short_name": "CloudRedis::Client", - "full_name": "::Google::Cloud::Redis::V1::CloudRedis::Client" - }, - "method": { - "short_name": "GetInstanceAuthString", - "full_name": "google.cloud.redis.v1.CloudRedis.GetInstanceAuthString", - "service": { - "short_name": "CloudRedis", - "full_name": "google.cloud.redis.v1.CloudRedis" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 46, - "type": "FULL" - } - ] - }, - { - "region_tag": "redis_v1_generated_CloudRedis_CreateInstance_sync", - "title": "Snippet for the create_instance call in the CloudRedis service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Redis::V1::CloudRedis::Client#create_instance.", - "file": "cloud_redis/create_instance.rb", - "language": "RUBY", - "client_method": { - "short_name": "create_instance", - "full_name": "::Google::Cloud::Redis::V1::CloudRedis::Client#create_instance", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::Redis::V1::CreateInstanceRequest", - "name": "request" - } - ], - "result_type": "::Google::Longrunning::Operation", - "client": { - "short_name": "CloudRedis::Client", - "full_name": "::Google::Cloud::Redis::V1::CloudRedis::Client" - }, - "method": { - "short_name": "CreateInstance", - "full_name": "google.cloud.redis.v1.CloudRedis.CreateInstance", - "service": { - "short_name": "CloudRedis", - "full_name": "google.cloud.redis.v1.CloudRedis" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 53, - "type": "FULL" - } - ] - }, - { - "region_tag": "redis_v1_generated_CloudRedis_UpdateInstance_sync", - "title": "Snippet for the update_instance call in the CloudRedis service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Redis::V1::CloudRedis::Client#update_instance.", - "file": "cloud_redis/update_instance.rb", - "language": "RUBY", - "client_method": { - "short_name": "update_instance", - "full_name": "::Google::Cloud::Redis::V1::CloudRedis::Client#update_instance", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::Redis::V1::UpdateInstanceRequest", - "name": "request" - } - ], - "result_type": "::Google::Longrunning::Operation", - "client": { - "short_name": "CloudRedis::Client", - "full_name": "::Google::Cloud::Redis::V1::CloudRedis::Client" - }, - "method": { - "short_name": "UpdateInstance", - "full_name": "google.cloud.redis.v1.CloudRedis.UpdateInstance", - "service": { - "short_name": "CloudRedis", - "full_name": "google.cloud.redis.v1.CloudRedis" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 53, - "type": "FULL" - } - ] - }, - { - "region_tag": "redis_v1_generated_CloudRedis_UpgradeInstance_sync", - "title": "Snippet for the upgrade_instance call in the CloudRedis service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Redis::V1::CloudRedis::Client#upgrade_instance.", - "file": "cloud_redis/upgrade_instance.rb", - "language": "RUBY", - "client_method": { - "short_name": "upgrade_instance", - "full_name": "::Google::Cloud::Redis::V1::CloudRedis::Client#upgrade_instance", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::Redis::V1::UpgradeInstanceRequest", - "name": "request" - } - ], - "result_type": "::Google::Longrunning::Operation", - "client": { - "short_name": "CloudRedis::Client", - "full_name": "::Google::Cloud::Redis::V1::CloudRedis::Client" - }, - "method": { - "short_name": "UpgradeInstance", - "full_name": "google.cloud.redis.v1.CloudRedis.UpgradeInstance", - "service": { - "short_name": "CloudRedis", - "full_name": "google.cloud.redis.v1.CloudRedis" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 53, - "type": "FULL" - } - ] - }, - { - "region_tag": "redis_v1_generated_CloudRedis_ImportInstance_sync", - "title": "Snippet for the import_instance call in the CloudRedis service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Redis::V1::CloudRedis::Client#import_instance.", - "file": "cloud_redis/import_instance.rb", - "language": "RUBY", - "client_method": { - "short_name": "import_instance", - "full_name": "::Google::Cloud::Redis::V1::CloudRedis::Client#import_instance", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::Redis::V1::ImportInstanceRequest", - "name": "request" - } - ], - "result_type": "::Google::Longrunning::Operation", - "client": { - "short_name": "CloudRedis::Client", - "full_name": "::Google::Cloud::Redis::V1::CloudRedis::Client" - }, - "method": { - "short_name": "ImportInstance", - "full_name": "google.cloud.redis.v1.CloudRedis.ImportInstance", - "service": { - "short_name": "CloudRedis", - "full_name": "google.cloud.redis.v1.CloudRedis" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 53, - "type": "FULL" - } - ] - }, - { - "region_tag": "redis_v1_generated_CloudRedis_ExportInstance_sync", - "title": "Snippet for the export_instance call in the CloudRedis service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Redis::V1::CloudRedis::Client#export_instance.", - "file": "cloud_redis/export_instance.rb", - "language": "RUBY", - "client_method": { - "short_name": "export_instance", - "full_name": "::Google::Cloud::Redis::V1::CloudRedis::Client#export_instance", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::Redis::V1::ExportInstanceRequest", - "name": "request" - } - ], - "result_type": "::Google::Longrunning::Operation", - "client": { - "short_name": "CloudRedis::Client", - "full_name": "::Google::Cloud::Redis::V1::CloudRedis::Client" - }, - "method": { - "short_name": "ExportInstance", - "full_name": "google.cloud.redis.v1.CloudRedis.ExportInstance", - "service": { - "short_name": "CloudRedis", - "full_name": "google.cloud.redis.v1.CloudRedis" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 53, - "type": "FULL" - } - ] - }, - { - "region_tag": "redis_v1_generated_CloudRedis_FailoverInstance_sync", - "title": "Snippet for the failover_instance call in the CloudRedis service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Redis::V1::CloudRedis::Client#failover_instance.", - "file": "cloud_redis/failover_instance.rb", - "language": "RUBY", - "client_method": { - "short_name": "failover_instance", - "full_name": "::Google::Cloud::Redis::V1::CloudRedis::Client#failover_instance", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::Redis::V1::FailoverInstanceRequest", - "name": "request" - } - ], - "result_type": "::Google::Longrunning::Operation", - "client": { - "short_name": "CloudRedis::Client", - "full_name": "::Google::Cloud::Redis::V1::CloudRedis::Client" - }, - "method": { - "short_name": "FailoverInstance", - "full_name": "google.cloud.redis.v1.CloudRedis.FailoverInstance", - "service": { - "short_name": "CloudRedis", - "full_name": "google.cloud.redis.v1.CloudRedis" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 53, - "type": "FULL" - } - ] - }, - { - "region_tag": "redis_v1_generated_CloudRedis_DeleteInstance_sync", - "title": "Snippet for the delete_instance call in the CloudRedis service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Redis::V1::CloudRedis::Client#delete_instance.", - "file": "cloud_redis/delete_instance.rb", - "language": "RUBY", - "client_method": { - "short_name": "delete_instance", - "full_name": "::Google::Cloud::Redis::V1::CloudRedis::Client#delete_instance", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::Redis::V1::DeleteInstanceRequest", - "name": "request" - } - ], - "result_type": "::Google::Longrunning::Operation", - "client": { - "short_name": "CloudRedis::Client", - "full_name": "::Google::Cloud::Redis::V1::CloudRedis::Client" - }, - "method": { - "short_name": "DeleteInstance", - "full_name": "google.cloud.redis.v1.CloudRedis.DeleteInstance", - "service": { - "short_name": "CloudRedis", - "full_name": "google.cloud.redis.v1.CloudRedis" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 53, - "type": "FULL" - } - ] - }, - { - "region_tag": "redis_v1_generated_CloudRedis_RescheduleMaintenance_sync", - "title": "Snippet for the reschedule_maintenance call in the CloudRedis service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Redis::V1::CloudRedis::Client#reschedule_maintenance.", - "file": "cloud_redis/reschedule_maintenance.rb", - "language": "RUBY", - "client_method": { - "short_name": "reschedule_maintenance", - "full_name": "::Google::Cloud::Redis::V1::CloudRedis::Client#reschedule_maintenance", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::Redis::V1::RescheduleMaintenanceRequest", - "name": "request" - } - ], - "result_type": "::Google::Longrunning::Operation", - "client": { - "short_name": "CloudRedis::Client", - "full_name": "::Google::Cloud::Redis::V1::CloudRedis::Client" - }, - "method": { - "short_name": "RescheduleMaintenance", - "full_name": "google.cloud.redis.v1.CloudRedis.RescheduleMaintenance", - "service": { - "short_name": "CloudRedis", - "full_name": "google.cloud.redis.v1.CloudRedis" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 53, - "type": "FULL" - } - ] - } - ] -} \ No newline at end of file diff --git a/owl-bot-staging/google-cloud-redis-v1/test/google/cloud/redis/v1/cloud_redis_operations_test.rb b/owl-bot-staging/google-cloud-redis-v1/test/google/cloud/redis/v1/cloud_redis_operations_test.rb deleted file mode 100644 index e74aacea7a72..000000000000 --- a/owl-bot-staging/google-cloud-redis-v1/test/google/cloud/redis/v1/cloud_redis_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/cloud/redis/v1/cloud_redis_pb" -require "google/cloud/redis/v1/cloud_redis_services_pb" -require "google/cloud/redis/v1/cloud_redis" - -class ::Google::Cloud::Redis::V1::CloudRedis::OperationsTest < Minitest::Test - class ClientStub - attr_accessor :call_rpc_count, :requests - - def initialize response, operation, &block - @response = response - @operation = operation - @block = block - @call_rpc_count = 0 - @requests = [] - end - - def call_rpc *args, **kwargs - @call_rpc_count += 1 - - @requests << @block&.call(*args, **kwargs) - - catch :response do - yield @response, @operation if block_given? - @response - end - end - - def endpoint - "endpoint.example.com" - end - - def universe_domain - "example.com" - end - - def stub_logger - nil - end - - def logger - nil - end - end - - def test_list_operations - # Create GRPC objects. - grpc_response = ::Google::Longrunning::ListOperationsResponse.new - grpc_operation = GRPC::ActiveCall::Operation.new nil - grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - grpc_options = {} - - # Create request parameters for a unary method. - name = "hello world" - filter = "hello world" - page_size = 42 - page_token = "hello world" - return_partial_success = true - - list_operations_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :list_operations, name - assert_kind_of ::Google::Longrunning::ListOperationsRequest, request - assert_equal "hello world", request["name"] - assert_equal "hello world", request["filter"] - assert_equal 42, request["page_size"] - assert_equal "hello world", request["page_token"] - assert_equal true, request["return_partial_success"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, list_operations_client_stub do - # Create client - client = ::Google::Cloud::Redis::V1::CloudRedis::Operations.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.list_operations({ name: name, filter: filter, page_size: page_size, page_token: page_token, return_partial_success: return_partial_success }) do |response, operation| - assert_kind_of Gapic::PagedEnumerable, response - assert_equal grpc_response, response.response - assert_equal grpc_operation, operation - end - - # Use named arguments - client.list_operations name: name, filter: filter, page_size: page_size, page_token: page_token, return_partial_success: return_partial_success do |response, operation| - assert_kind_of Gapic::PagedEnumerable, response - assert_equal grpc_response, response.response - assert_equal grpc_operation, operation - end - - # Use protobuf object - client.list_operations ::Google::Longrunning::ListOperationsRequest.new(name: name, filter: filter, page_size: page_size, page_token: page_token, return_partial_success: return_partial_success) do |response, operation| - assert_kind_of Gapic::PagedEnumerable, response - assert_equal grpc_response, response.response - assert_equal grpc_operation, operation - end - - # Use hash object with options - client.list_operations({ name: name, filter: filter, page_size: page_size, page_token: page_token, return_partial_success: return_partial_success }, grpc_options) do |response, operation| - assert_kind_of Gapic::PagedEnumerable, response - assert_equal grpc_response, response.response - assert_equal grpc_operation, operation - end - - # Use protobuf object with options - client.list_operations(::Google::Longrunning::ListOperationsRequest.new(name: name, filter: filter, page_size: page_size, page_token: page_token, return_partial_success: return_partial_success), grpc_options) do |response, operation| - assert_kind_of Gapic::PagedEnumerable, response - assert_equal grpc_response, response.response - assert_equal grpc_operation, operation - end - - # Verify method calls - assert_equal 5, list_operations_client_stub.call_rpc_count - end - end - - def test_get_operation - # Create GRPC objects. - grpc_response = ::Google::Longrunning::Operation.new - grpc_operation = GRPC::ActiveCall::Operation.new nil - grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - grpc_options = {} - - # Create request parameters for a unary method. - name = "hello world" - - get_operation_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :get_operation, name - assert_kind_of ::Google::Longrunning::GetOperationRequest, request - assert_equal "hello world", request["name"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, get_operation_client_stub do - # Create client - client = ::Google::Cloud::Redis::V1::CloudRedis::Operations.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.get_operation({ name: name }) do |response, operation| - assert_kind_of Gapic::Operation, response - assert_equal grpc_response, response.grpc_op - assert_equal grpc_operation, operation - end - - # Use named arguments - client.get_operation name: name do |response, operation| - assert_kind_of Gapic::Operation, response - assert_equal grpc_response, response.grpc_op - assert_equal grpc_operation, operation - end - - # Use protobuf object - client.get_operation ::Google::Longrunning::GetOperationRequest.new(name: name) do |response, operation| - assert_kind_of Gapic::Operation, response - assert_equal grpc_response, response.grpc_op - assert_equal grpc_operation, operation - end - - # Use hash object with options - client.get_operation({ name: name }, grpc_options) do |response, operation| - assert_kind_of Gapic::Operation, response - assert_equal grpc_response, response.grpc_op - assert_equal grpc_operation, operation - end - - # Use protobuf object with options - client.get_operation(::Google::Longrunning::GetOperationRequest.new(name: name), grpc_options) do |response, operation| - assert_kind_of Gapic::Operation, response - assert_equal grpc_response, response.grpc_op - assert_equal grpc_operation, operation - end - - # Verify method calls - assert_equal 5, get_operation_client_stub.call_rpc_count - end - end - - def test_delete_operation - # Create GRPC objects. - grpc_response = ::Google::Protobuf::Empty.new - grpc_operation = GRPC::ActiveCall::Operation.new nil - grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - grpc_options = {} - - # Create request parameters for a unary method. - name = "hello world" - - delete_operation_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :delete_operation, name - assert_kind_of ::Google::Longrunning::DeleteOperationRequest, request - assert_equal "hello world", request["name"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, delete_operation_client_stub do - # Create client - client = ::Google::Cloud::Redis::V1::CloudRedis::Operations.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.delete_operation({ name: name }) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use named arguments - client.delete_operation name: name do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object - client.delete_operation ::Google::Longrunning::DeleteOperationRequest.new(name: name) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use hash object with options - client.delete_operation({ name: name }, grpc_options) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object with options - client.delete_operation(::Google::Longrunning::DeleteOperationRequest.new(name: name), grpc_options) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Verify method calls - assert_equal 5, delete_operation_client_stub.call_rpc_count - end - end - - def test_cancel_operation - # Create GRPC objects. - grpc_response = ::Google::Protobuf::Empty.new - grpc_operation = GRPC::ActiveCall::Operation.new nil - grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - grpc_options = {} - - # Create request parameters for a unary method. - name = "hello world" - - cancel_operation_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :cancel_operation, name - assert_kind_of ::Google::Longrunning::CancelOperationRequest, request - assert_equal "hello world", request["name"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, cancel_operation_client_stub do - # Create client - client = ::Google::Cloud::Redis::V1::CloudRedis::Operations.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.cancel_operation({ name: name }) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use named arguments - client.cancel_operation name: name do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object - client.cancel_operation ::Google::Longrunning::CancelOperationRequest.new(name: name) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use hash object with options - client.cancel_operation({ name: name }, grpc_options) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object with options - client.cancel_operation(::Google::Longrunning::CancelOperationRequest.new(name: name), grpc_options) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Verify method calls - assert_equal 5, cancel_operation_client_stub.call_rpc_count - end - end - - def test_wait_operation - # Create GRPC objects. - grpc_response = ::Google::Longrunning::Operation.new - grpc_operation = GRPC::ActiveCall::Operation.new nil - grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - grpc_options = {} - - # Create request parameters for a unary method. - name = "hello world" - timeout = {} - - wait_operation_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :wait_operation, name - assert_kind_of ::Google::Longrunning::WaitOperationRequest, request - assert_equal "hello world", request["name"] - assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Protobuf::Duration), request["timeout"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, wait_operation_client_stub do - # Create client - client = ::Google::Cloud::Redis::V1::CloudRedis::Operations.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.wait_operation({ name: name, timeout: timeout }) do |response, operation| - assert_kind_of Gapic::Operation, response - assert_equal grpc_response, response.grpc_op - assert_equal grpc_operation, operation - end - - # Use named arguments - client.wait_operation name: name, timeout: timeout do |response, operation| - assert_kind_of Gapic::Operation, response - assert_equal grpc_response, response.grpc_op - assert_equal grpc_operation, operation - end - - # Use protobuf object - client.wait_operation ::Google::Longrunning::WaitOperationRequest.new(name: name, timeout: timeout) do |response, operation| - assert_kind_of Gapic::Operation, response - assert_equal grpc_response, response.grpc_op - assert_equal grpc_operation, operation - end - - # Use hash object with options - client.wait_operation({ name: name, timeout: timeout }, grpc_options) do |response, operation| - assert_kind_of Gapic::Operation, response - assert_equal grpc_response, response.grpc_op - assert_equal grpc_operation, operation - end - - # Use protobuf object with options - client.wait_operation(::Google::Longrunning::WaitOperationRequest.new(name: name, timeout: timeout), grpc_options) do |response, operation| - assert_kind_of Gapic::Operation, response - assert_equal grpc_response, response.grpc_op - assert_equal grpc_operation, operation - end - - # Verify method calls - assert_equal 5, wait_operation_client_stub.call_rpc_count - end - end - - def test_configure - grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - - client = block_config = config = nil - dummy_stub = ClientStub.new nil, nil - Gapic::ServiceStub.stub :new, dummy_stub do - client = ::Google::Cloud::Redis::V1::CloudRedis::Operations.new do |config| - config.credentials = grpc_channel - end - end - - config = client.configure do |c| - block_config = c - end - - assert_same block_config, config - assert_kind_of ::Google::Cloud::Redis::V1::CloudRedis::Operations::Configuration, config - end -end diff --git a/owl-bot-staging/google-cloud-redis-v1/test/google/cloud/redis/v1/cloud_redis_paths_test.rb b/owl-bot-staging/google-cloud-redis-v1/test/google/cloud/redis/v1/cloud_redis_paths_test.rb deleted file mode 100644 index 51a4663345d8..000000000000 --- a/owl-bot-staging/google-cloud-redis-v1/test/google/cloud/redis/v1/cloud_redis_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/cloud/redis/v1/cloud_redis" - -class ::Google::Cloud::Redis::V1::CloudRedis::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_instance_path - grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - ::Gapic::ServiceStub.stub :new, DummyStub.new do - client = ::Google::Cloud::Redis::V1::CloudRedis::Client.new do |config| - config.credentials = grpc_channel - end - - path = client.instance_path project: "value0", location: "value1", instance: "value2" - assert_equal "projects/value0/locations/value1/instances/value2", path - end - end - - def test_location_path - grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - ::Gapic::ServiceStub.stub :new, DummyStub.new do - client = ::Google::Cloud::Redis::V1::CloudRedis::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 -end diff --git a/owl-bot-staging/google-cloud-redis-v1/test/google/cloud/redis/v1/cloud_redis_rest_test.rb b/owl-bot-staging/google-cloud-redis-v1/test/google/cloud/redis/v1/cloud_redis_rest_test.rb deleted file mode 100644 index 913e969243e5..000000000000 --- a/owl-bot-staging/google-cloud-redis-v1/test/google/cloud/redis/v1/cloud_redis_rest_test.rb +++ /dev/null @@ -1,704 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -require "helper" -require "gapic/rest" -require "google/cloud/redis/v1/cloud_redis_pb" -require "google/cloud/redis/v1/cloud_redis/rest" - - -class ::Google::Cloud::Redis::V1::CloudRedis::Rest::ClientTest < Minitest::Test - class ClientStub - attr_accessor :call_count, :requests - - def initialize response, &block - @response = response - @block = block - @call_count = 0 - @requests = [] - end - - def make_get_request uri:, params: {}, options: {}, method_name: nil - make_http_request :get, uri: uri, body: nil, params: params, options: options, method_name: method_name - end - - def make_delete_request uri:, params: {}, options: {}, method_name: nil - make_http_request :delete, uri: uri, body: nil, params: params, options: options, method_name: method_name - end - - def make_post_request uri:, body: nil, params: {}, options: {}, method_name: nil - make_http_request :post, uri: uri, body: body, params: params, options: options, method_name: method_name - end - - def make_patch_request uri:, body:, params: {}, options: {}, method_name: nil - make_http_request :patch, uri: uri, body: body, params: params, options: options, method_name: method_name - end - - def make_put_request uri:, body:, params: {}, options: {}, method_name: nil - make_http_request :put, uri: uri, body: body, params: params, options: options, method_name: method_name - end - - def make_http_request *args, **kwargs - @call_count += 1 - - @requests << @block&.call(*args, **kwargs) - - @response - end - - def endpoint - "endpoint.example.com" - end - - def universe_domain - "example.com" - end - - def stub_logger - nil - end - - def logger - nil - end - end - - def test_list_instances - # Create test objects. - client_result = ::Google::Cloud::Redis::V1::ListInstancesResponse.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_instances_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| - assert options.metadata.key? :"x-goog-api-client" - assert options.metadata[:"x-goog-api-client"].include? "rest" - refute options.metadata[:"x-goog-api-client"].include? "grpc" - end - - ::Google::Cloud::Redis::V1::CloudRedis::Rest::ServiceStub.stub :transcode_list_instances_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, list_instances_client_stub do - # Create client - client = ::Google::Cloud::Redis::V1::CloudRedis::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - client.list_instances({ 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_instances 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_instances ::Google::Cloud::Redis::V1::ListInstancesRequest.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_instances({ 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_instances(::Google::Cloud::Redis::V1::ListInstancesRequest.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_instances_client_stub.call_count - end - end - end - - def test_get_instance - # Create test objects. - client_result = ::Google::Cloud::Redis::V1::Instance.new - http_response = OpenStruct.new body: client_result.to_json - - call_options = {} - - # Create request parameters for a unary method. - name = "hello world" - - get_instance_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| - assert options.metadata.key? :"x-goog-api-client" - assert options.metadata[:"x-goog-api-client"].include? "rest" - refute options.metadata[:"x-goog-api-client"].include? "grpc" - end - - ::Google::Cloud::Redis::V1::CloudRedis::Rest::ServiceStub.stub :transcode_get_instance_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, get_instance_client_stub do - # Create client - client = ::Google::Cloud::Redis::V1::CloudRedis::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - client.get_instance({ name: name }) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use named arguments - client.get_instance name: name do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object - client.get_instance ::Google::Cloud::Redis::V1::GetInstanceRequest.new(name: name) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use hash object with options - client.get_instance({ name: name }, call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object with options - client.get_instance(::Google::Cloud::Redis::V1::GetInstanceRequest.new(name: name), call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Verify method calls - assert_equal 5, get_instance_client_stub.call_count - end - end - end - - def test_get_instance_auth_string - # Create test objects. - client_result = ::Google::Cloud::Redis::V1::InstanceAuthString.new - http_response = OpenStruct.new body: client_result.to_json - - call_options = {} - - # Create request parameters for a unary method. - name = "hello world" - - get_instance_auth_string_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| - assert options.metadata.key? :"x-goog-api-client" - assert options.metadata[:"x-goog-api-client"].include? "rest" - refute options.metadata[:"x-goog-api-client"].include? "grpc" - end - - ::Google::Cloud::Redis::V1::CloudRedis::Rest::ServiceStub.stub :transcode_get_instance_auth_string_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, get_instance_auth_string_client_stub do - # Create client - client = ::Google::Cloud::Redis::V1::CloudRedis::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - client.get_instance_auth_string({ name: name }) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use named arguments - client.get_instance_auth_string name: name do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object - client.get_instance_auth_string ::Google::Cloud::Redis::V1::GetInstanceAuthStringRequest.new(name: name) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use hash object with options - client.get_instance_auth_string({ name: name }, call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object with options - client.get_instance_auth_string(::Google::Cloud::Redis::V1::GetInstanceAuthStringRequest.new(name: name), call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Verify method calls - assert_equal 5, get_instance_auth_string_client_stub.call_count - end - end - end - - def test_create_instance - # 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" - instance_id = "hello world" - instance = {} - - create_instance_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| - assert options.metadata.key? :"x-goog-api-client" - assert options.metadata[:"x-goog-api-client"].include? "rest" - refute options.metadata[:"x-goog-api-client"].include? "grpc" - end - - ::Google::Cloud::Redis::V1::CloudRedis::Rest::ServiceStub.stub :transcode_create_instance_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, create_instance_client_stub do - # Create client - client = ::Google::Cloud::Redis::V1::CloudRedis::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - client.create_instance({ parent: parent, instance_id: instance_id, instance: instance }) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use named arguments - client.create_instance parent: parent, instance_id: instance_id, instance: instance do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object - client.create_instance ::Google::Cloud::Redis::V1::CreateInstanceRequest.new(parent: parent, instance_id: instance_id, instance: instance) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use hash object with options - client.create_instance({ parent: parent, instance_id: instance_id, instance: instance }, call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object with options - client.create_instance(::Google::Cloud::Redis::V1::CreateInstanceRequest.new(parent: parent, instance_id: instance_id, instance: instance), call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Verify method calls - assert_equal 5, create_instance_client_stub.call_count - end - end - end - - def test_update_instance - # 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. - update_mask = {} - instance = {} - - update_instance_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| - assert options.metadata.key? :"x-goog-api-client" - assert options.metadata[:"x-goog-api-client"].include? "rest" - refute options.metadata[:"x-goog-api-client"].include? "grpc" - end - - ::Google::Cloud::Redis::V1::CloudRedis::Rest::ServiceStub.stub :transcode_update_instance_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, update_instance_client_stub do - # Create client - client = ::Google::Cloud::Redis::V1::CloudRedis::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - client.update_instance({ update_mask: update_mask, instance: instance }) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use named arguments - client.update_instance update_mask: update_mask, instance: instance do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object - client.update_instance ::Google::Cloud::Redis::V1::UpdateInstanceRequest.new(update_mask: update_mask, instance: instance) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use hash object with options - client.update_instance({ update_mask: update_mask, instance: instance }, call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object with options - client.update_instance(::Google::Cloud::Redis::V1::UpdateInstanceRequest.new(update_mask: update_mask, instance: instance), call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Verify method calls - assert_equal 5, update_instance_client_stub.call_count - end - end - end - - def test_upgrade_instance - # 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" - redis_version = "hello world" - - upgrade_instance_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| - assert options.metadata.key? :"x-goog-api-client" - assert options.metadata[:"x-goog-api-client"].include? "rest" - refute options.metadata[:"x-goog-api-client"].include? "grpc" - end - - ::Google::Cloud::Redis::V1::CloudRedis::Rest::ServiceStub.stub :transcode_upgrade_instance_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, upgrade_instance_client_stub do - # Create client - client = ::Google::Cloud::Redis::V1::CloudRedis::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - client.upgrade_instance({ name: name, redis_version: redis_version }) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use named arguments - client.upgrade_instance name: name, redis_version: redis_version do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object - client.upgrade_instance ::Google::Cloud::Redis::V1::UpgradeInstanceRequest.new(name: name, redis_version: redis_version) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use hash object with options - client.upgrade_instance({ name: name, redis_version: redis_version }, call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object with options - client.upgrade_instance(::Google::Cloud::Redis::V1::UpgradeInstanceRequest.new(name: name, redis_version: redis_version), call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Verify method calls - assert_equal 5, upgrade_instance_client_stub.call_count - end - end - end - - def test_import_instance - # 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" - input_config = {} - - import_instance_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| - assert options.metadata.key? :"x-goog-api-client" - assert options.metadata[:"x-goog-api-client"].include? "rest" - refute options.metadata[:"x-goog-api-client"].include? "grpc" - end - - ::Google::Cloud::Redis::V1::CloudRedis::Rest::ServiceStub.stub :transcode_import_instance_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, import_instance_client_stub do - # Create client - client = ::Google::Cloud::Redis::V1::CloudRedis::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - client.import_instance({ name: name, input_config: input_config }) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use named arguments - client.import_instance name: name, input_config: input_config do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object - client.import_instance ::Google::Cloud::Redis::V1::ImportInstanceRequest.new(name: name, input_config: input_config) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use hash object with options - client.import_instance({ name: name, input_config: input_config }, call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object with options - client.import_instance(::Google::Cloud::Redis::V1::ImportInstanceRequest.new(name: name, input_config: input_config), call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Verify method calls - assert_equal 5, import_instance_client_stub.call_count - end - end - end - - def test_export_instance - # 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" - output_config = {} - - export_instance_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| - assert options.metadata.key? :"x-goog-api-client" - assert options.metadata[:"x-goog-api-client"].include? "rest" - refute options.metadata[:"x-goog-api-client"].include? "grpc" - end - - ::Google::Cloud::Redis::V1::CloudRedis::Rest::ServiceStub.stub :transcode_export_instance_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, export_instance_client_stub do - # Create client - client = ::Google::Cloud::Redis::V1::CloudRedis::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - client.export_instance({ name: name, output_config: output_config }) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use named arguments - client.export_instance name: name, output_config: output_config do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object - client.export_instance ::Google::Cloud::Redis::V1::ExportInstanceRequest.new(name: name, output_config: output_config) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use hash object with options - client.export_instance({ name: name, output_config: output_config }, call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object with options - client.export_instance(::Google::Cloud::Redis::V1::ExportInstanceRequest.new(name: name, output_config: output_config), call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Verify method calls - assert_equal 5, export_instance_client_stub.call_count - end - end - end - - def test_failover_instance - # 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" - data_protection_mode = :DATA_PROTECTION_MODE_UNSPECIFIED - - failover_instance_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| - assert options.metadata.key? :"x-goog-api-client" - assert options.metadata[:"x-goog-api-client"].include? "rest" - refute options.metadata[:"x-goog-api-client"].include? "grpc" - end - - ::Google::Cloud::Redis::V1::CloudRedis::Rest::ServiceStub.stub :transcode_failover_instance_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, failover_instance_client_stub do - # Create client - client = ::Google::Cloud::Redis::V1::CloudRedis::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - client.failover_instance({ name: name, data_protection_mode: data_protection_mode }) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use named arguments - client.failover_instance name: name, data_protection_mode: data_protection_mode do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object - client.failover_instance ::Google::Cloud::Redis::V1::FailoverInstanceRequest.new(name: name, data_protection_mode: data_protection_mode) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use hash object with options - client.failover_instance({ name: name, data_protection_mode: data_protection_mode }, call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object with options - client.failover_instance(::Google::Cloud::Redis::V1::FailoverInstanceRequest.new(name: name, data_protection_mode: data_protection_mode), call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Verify method calls - assert_equal 5, failover_instance_client_stub.call_count - end - end - end - - def test_delete_instance - # 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" - - delete_instance_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| - assert options.metadata.key? :"x-goog-api-client" - assert options.metadata[:"x-goog-api-client"].include? "rest" - refute options.metadata[:"x-goog-api-client"].include? "grpc" - end - - ::Google::Cloud::Redis::V1::CloudRedis::Rest::ServiceStub.stub :transcode_delete_instance_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, delete_instance_client_stub do - # Create client - client = ::Google::Cloud::Redis::V1::CloudRedis::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - client.delete_instance({ name: name }) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use named arguments - client.delete_instance name: name do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object - client.delete_instance ::Google::Cloud::Redis::V1::DeleteInstanceRequest.new(name: name) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use hash object with options - client.delete_instance({ name: name }, call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object with options - client.delete_instance(::Google::Cloud::Redis::V1::DeleteInstanceRequest.new(name: name), call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Verify method calls - assert_equal 5, delete_instance_client_stub.call_count - end - end - end - - def test_reschedule_maintenance - # 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" - reschedule_type = :RESCHEDULE_TYPE_UNSPECIFIED - schedule_time = {} - - reschedule_maintenance_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| - assert options.metadata.key? :"x-goog-api-client" - assert options.metadata[:"x-goog-api-client"].include? "rest" - refute options.metadata[:"x-goog-api-client"].include? "grpc" - end - - ::Google::Cloud::Redis::V1::CloudRedis::Rest::ServiceStub.stub :transcode_reschedule_maintenance_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, reschedule_maintenance_client_stub do - # Create client - client = ::Google::Cloud::Redis::V1::CloudRedis::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - client.reschedule_maintenance({ name: name, reschedule_type: reschedule_type, schedule_time: schedule_time }) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use named arguments - client.reschedule_maintenance name: name, reschedule_type: reschedule_type, schedule_time: schedule_time do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object - client.reschedule_maintenance ::Google::Cloud::Redis::V1::RescheduleMaintenanceRequest.new(name: name, reschedule_type: reschedule_type, schedule_time: schedule_time) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use hash object with options - client.reschedule_maintenance({ name: name, reschedule_type: reschedule_type, schedule_time: schedule_time }, call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object with options - client.reschedule_maintenance(::Google::Cloud::Redis::V1::RescheduleMaintenanceRequest.new(name: name, reschedule_type: reschedule_type, schedule_time: schedule_time), call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Verify method calls - assert_equal 5, reschedule_maintenance_client_stub.call_count - end - end - end - - def test_configure - credentials_token = :dummy_value - - client = block_config = config = nil - dummy_stub = ClientStub.new nil - Gapic::Rest::ClientStub.stub :new, dummy_stub do - client = ::Google::Cloud::Redis::V1::CloudRedis::Rest::Client.new do |config| - config.credentials = credentials_token - end - end - - config = client.configure do |c| - block_config = c - end - - assert_same block_config, config - assert_kind_of ::Google::Cloud::Redis::V1::CloudRedis::Rest::Client::Configuration, config - end -end diff --git a/owl-bot-staging/google-cloud-redis-v1/test/google/cloud/redis/v1/cloud_redis_test.rb b/owl-bot-staging/google-cloud-redis-v1/test/google/cloud/redis/v1/cloud_redis_test.rb deleted file mode 100644 index 12ec537f4770..000000000000 --- a/owl-bot-staging/google-cloud-redis-v1/test/google/cloud/redis/v1/cloud_redis_test.rb +++ /dev/null @@ -1,823 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -require "helper" - -require "gapic/grpc/service_stub" - -require "google/cloud/redis/v1/cloud_redis_pb" -require "google/cloud/redis/v1/cloud_redis" - -class ::Google::Cloud::Redis::V1::CloudRedis::ClientTest < Minitest::Test - class ClientStub - attr_accessor :call_rpc_count, :requests - - def initialize response, operation, &block - @response = response - @operation = operation - @block = block - @call_rpc_count = 0 - @requests = [] - end - - def call_rpc *args, **kwargs - @call_rpc_count += 1 - - @requests << @block&.call(*args, **kwargs) - - catch :response do - yield @response, @operation if block_given? - @response - end - end - - def endpoint - "endpoint.example.com" - end - - def universe_domain - "example.com" - end - - def stub_logger - nil - end - - def logger - nil - end - end - - def test_list_instances - # Create GRPC objects. - grpc_response = ::Google::Cloud::Redis::V1::ListInstancesResponse.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_instances_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :list_instances, name - assert_kind_of ::Google::Cloud::Redis::V1::ListInstancesRequest, 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_instances_client_stub do - # Create client - client = ::Google::Cloud::Redis::V1::CloudRedis::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.list_instances({ 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_instances 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_instances ::Google::Cloud::Redis::V1::ListInstancesRequest.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_instances({ 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_instances(::Google::Cloud::Redis::V1::ListInstancesRequest.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_instances_client_stub.call_rpc_count - end - end - - def test_get_instance - # Create GRPC objects. - grpc_response = ::Google::Cloud::Redis::V1::Instance.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_instance_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :get_instance, name - assert_kind_of ::Google::Cloud::Redis::V1::GetInstanceRequest, request - assert_equal "hello world", request["name"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, get_instance_client_stub do - # Create client - client = ::Google::Cloud::Redis::V1::CloudRedis::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.get_instance({ name: name }) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use named arguments - client.get_instance name: name do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object - client.get_instance ::Google::Cloud::Redis::V1::GetInstanceRequest.new(name: name) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use hash object with options - client.get_instance({ 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_instance(::Google::Cloud::Redis::V1::GetInstanceRequest.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_instance_client_stub.call_rpc_count - end - end - - def test_get_instance_auth_string - # Create GRPC objects. - grpc_response = ::Google::Cloud::Redis::V1::InstanceAuthString.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_instance_auth_string_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :get_instance_auth_string, name - assert_kind_of ::Google::Cloud::Redis::V1::GetInstanceAuthStringRequest, request - assert_equal "hello world", request["name"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, get_instance_auth_string_client_stub do - # Create client - client = ::Google::Cloud::Redis::V1::CloudRedis::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.get_instance_auth_string({ name: name }) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use named arguments - client.get_instance_auth_string name: name do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object - client.get_instance_auth_string ::Google::Cloud::Redis::V1::GetInstanceAuthStringRequest.new(name: name) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use hash object with options - client.get_instance_auth_string({ 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_instance_auth_string(::Google::Cloud::Redis::V1::GetInstanceAuthStringRequest.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_instance_auth_string_client_stub.call_rpc_count - end - end - - def test_create_instance - # 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" - instance_id = "hello world" - instance = {} - - create_instance_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :create_instance, name - assert_kind_of ::Google::Cloud::Redis::V1::CreateInstanceRequest, request - assert_equal "hello world", request["parent"] - assert_equal "hello world", request["instance_id"] - assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::Redis::V1::Instance), request["instance"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, create_instance_client_stub do - # Create client - client = ::Google::Cloud::Redis::V1::CloudRedis::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.create_instance({ parent: parent, instance_id: instance_id, instance: instance }) 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_instance parent: parent, instance_id: instance_id, instance: instance 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_instance ::Google::Cloud::Redis::V1::CreateInstanceRequest.new(parent: parent, instance_id: instance_id, instance: instance) 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_instance({ parent: parent, instance_id: instance_id, instance: instance }, 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_instance(::Google::Cloud::Redis::V1::CreateInstanceRequest.new(parent: parent, instance_id: instance_id, instance: instance), 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_instance_client_stub.call_rpc_count - end - end - - def test_update_instance - # 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. - update_mask = {} - instance = {} - - update_instance_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :update_instance, name - assert_kind_of ::Google::Cloud::Redis::V1::UpdateInstanceRequest, request - assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Protobuf::FieldMask), request["update_mask"] - assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::Redis::V1::Instance), request["instance"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, update_instance_client_stub do - # Create client - client = ::Google::Cloud::Redis::V1::CloudRedis::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.update_instance({ update_mask: update_mask, instance: instance }) 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_instance update_mask: update_mask, instance: instance 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_instance ::Google::Cloud::Redis::V1::UpdateInstanceRequest.new(update_mask: update_mask, instance: instance) 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_instance({ update_mask: update_mask, instance: instance }, 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_instance(::Google::Cloud::Redis::V1::UpdateInstanceRequest.new(update_mask: update_mask, instance: instance), 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_instance_client_stub.call_rpc_count - end - end - - def test_upgrade_instance - # 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" - redis_version = "hello world" - - upgrade_instance_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :upgrade_instance, name - assert_kind_of ::Google::Cloud::Redis::V1::UpgradeInstanceRequest, request - assert_equal "hello world", request["name"] - assert_equal "hello world", request["redis_version"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, upgrade_instance_client_stub do - # Create client - client = ::Google::Cloud::Redis::V1::CloudRedis::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.upgrade_instance({ name: name, redis_version: redis_version }) 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.upgrade_instance name: name, redis_version: redis_version 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.upgrade_instance ::Google::Cloud::Redis::V1::UpgradeInstanceRequest.new(name: name, redis_version: redis_version) 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.upgrade_instance({ name: name, redis_version: redis_version }, 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.upgrade_instance(::Google::Cloud::Redis::V1::UpgradeInstanceRequest.new(name: name, redis_version: redis_version), 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, upgrade_instance_client_stub.call_rpc_count - end - end - - def test_import_instance - # 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" - input_config = {} - - import_instance_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :import_instance, name - assert_kind_of ::Google::Cloud::Redis::V1::ImportInstanceRequest, request - assert_equal "hello world", request["name"] - assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::Redis::V1::InputConfig), request["input_config"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, import_instance_client_stub do - # Create client - client = ::Google::Cloud::Redis::V1::CloudRedis::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.import_instance({ name: name, input_config: input_config }) 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.import_instance name: name, input_config: input_config 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.import_instance ::Google::Cloud::Redis::V1::ImportInstanceRequest.new(name: name, input_config: input_config) 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.import_instance({ name: name, input_config: input_config }, 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.import_instance(::Google::Cloud::Redis::V1::ImportInstanceRequest.new(name: name, input_config: input_config), 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, import_instance_client_stub.call_rpc_count - end - end - - def test_export_instance - # 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" - output_config = {} - - export_instance_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :export_instance, name - assert_kind_of ::Google::Cloud::Redis::V1::ExportInstanceRequest, request - assert_equal "hello world", request["name"] - assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::Redis::V1::OutputConfig), request["output_config"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, export_instance_client_stub do - # Create client - client = ::Google::Cloud::Redis::V1::CloudRedis::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.export_instance({ name: name, output_config: output_config }) 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.export_instance name: name, output_config: output_config 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.export_instance ::Google::Cloud::Redis::V1::ExportInstanceRequest.new(name: name, output_config: output_config) 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.export_instance({ name: name, output_config: output_config }, 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.export_instance(::Google::Cloud::Redis::V1::ExportInstanceRequest.new(name: name, output_config: output_config), 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, export_instance_client_stub.call_rpc_count - end - end - - def test_failover_instance - # 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" - data_protection_mode = :DATA_PROTECTION_MODE_UNSPECIFIED - - failover_instance_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :failover_instance, name - assert_kind_of ::Google::Cloud::Redis::V1::FailoverInstanceRequest, request - assert_equal "hello world", request["name"] - assert_equal :DATA_PROTECTION_MODE_UNSPECIFIED, request["data_protection_mode"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, failover_instance_client_stub do - # Create client - client = ::Google::Cloud::Redis::V1::CloudRedis::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.failover_instance({ name: name, data_protection_mode: data_protection_mode }) 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.failover_instance name: name, data_protection_mode: data_protection_mode 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.failover_instance ::Google::Cloud::Redis::V1::FailoverInstanceRequest.new(name: name, data_protection_mode: data_protection_mode) 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.failover_instance({ name: name, data_protection_mode: data_protection_mode }, 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.failover_instance(::Google::Cloud::Redis::V1::FailoverInstanceRequest.new(name: name, data_protection_mode: data_protection_mode), 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, failover_instance_client_stub.call_rpc_count - end - end - - def test_delete_instance - # 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" - - delete_instance_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :delete_instance, name - assert_kind_of ::Google::Cloud::Redis::V1::DeleteInstanceRequest, request - assert_equal "hello world", request["name"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, delete_instance_client_stub do - # Create client - client = ::Google::Cloud::Redis::V1::CloudRedis::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.delete_instance({ 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.delete_instance 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.delete_instance ::Google::Cloud::Redis::V1::DeleteInstanceRequest.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.delete_instance({ 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.delete_instance(::Google::Cloud::Redis::V1::DeleteInstanceRequest.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, delete_instance_client_stub.call_rpc_count - end - end - - def test_reschedule_maintenance - # 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" - reschedule_type = :RESCHEDULE_TYPE_UNSPECIFIED - schedule_time = {} - - reschedule_maintenance_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :reschedule_maintenance, name - assert_kind_of ::Google::Cloud::Redis::V1::RescheduleMaintenanceRequest, request - assert_equal "hello world", request["name"] - assert_equal :RESCHEDULE_TYPE_UNSPECIFIED, request["reschedule_type"] - assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Protobuf::Timestamp), request["schedule_time"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, reschedule_maintenance_client_stub do - # Create client - client = ::Google::Cloud::Redis::V1::CloudRedis::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.reschedule_maintenance({ name: name, reschedule_type: reschedule_type, schedule_time: schedule_time }) 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.reschedule_maintenance name: name, reschedule_type: reschedule_type, schedule_time: schedule_time 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.reschedule_maintenance ::Google::Cloud::Redis::V1::RescheduleMaintenanceRequest.new(name: name, reschedule_type: reschedule_type, schedule_time: schedule_time) 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.reschedule_maintenance({ name: name, reschedule_type: reschedule_type, schedule_time: schedule_time }, 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.reschedule_maintenance(::Google::Cloud::Redis::V1::RescheduleMaintenanceRequest.new(name: name, reschedule_type: reschedule_type, schedule_time: schedule_time), 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, reschedule_maintenance_client_stub.call_rpc_count - end - end - - def test_configure - grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - - client = block_config = config = nil - dummy_stub = ClientStub.new nil, nil - Gapic::ServiceStub.stub :new, dummy_stub do - client = ::Google::Cloud::Redis::V1::CloudRedis::Client.new do |config| - config.credentials = grpc_channel - end - end - - config = client.configure do |c| - block_config = c - end - - assert_same block_config, config - assert_kind_of ::Google::Cloud::Redis::V1::CloudRedis::Client::Configuration, config - end - - def test_credentials - key = OpenSSL::PKey::RSA.new 2048 - cred_json = { - "private_key" => key.to_pem, - "client_email" => "app@developer.gserviceaccount.com", - "type" => "service_account" - } - key_file = StringIO.new cred_json.to_json - creds = Google::Auth::ServiceAccountCredentials.make_creds({ json_key_io: key_file }) - - dummy_stub = ClientStub.new nil, nil - Gapic::ServiceStub.stub :new, dummy_stub do - client = ::Google::Cloud::Redis::V1::CloudRedis::Client.new do |config| - config.credentials = creds - end - assert_kind_of ::Google::Cloud::Redis::V1::CloudRedis::Client, client - assert_equal creds, client.configure.credentials - end - end - - def test_operations_client - grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - - client = nil - dummy_stub = ClientStub.new nil, nil - Gapic::ServiceStub.stub :new, dummy_stub do - client = ::Google::Cloud::Redis::V1::CloudRedis::Client.new do |config| - config.credentials = grpc_channel - end - end - - assert_kind_of ::Google::Cloud::Redis::V1::CloudRedis::Operations, client.operations_client - end -end diff --git a/owl-bot-staging/google-cloud-redis-v1/test/helper.rb b/owl-bot-staging/google-cloud-redis-v1/test/helper.rb deleted file mode 100644 index 672b337030e7..000000000000 --- a/owl-bot-staging/google-cloud-redis-v1/test/helper.rb +++ /dev/null @@ -1,26 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -require "minitest/autorun" -require "minitest/focus" -require "minitest/mock" -require "minitest/rg" - -require "grpc" - -require "ostruct" diff --git a/owl-bot-staging/google-cloud-redis-v1beta1/.gitignore b/owl-bot-staging/google-cloud-redis-v1beta1/.gitignore deleted file mode 100644 index 0135b6bc6cfc..000000000000 --- a/owl-bot-staging/google-cloud-redis-v1beta1/.gitignore +++ /dev/null @@ -1,22 +0,0 @@ -# Ignore bundler lockfiles -Gemfile.lock -gems.locked - -# Ignore documentation output -doc/* -.yardoc/* - -# Ignore test output -coverage/* - -# Ignore build artifacts -pkg/* - -# Ignore files commonly present in certain dev environments -.vagrant -.DS_STORE -.idea -*.iml - -# Ignore synth output -__pycache__ diff --git a/owl-bot-staging/google-cloud-redis-v1beta1/.repo-metadata.json b/owl-bot-staging/google-cloud-redis-v1beta1/.repo-metadata.json deleted file mode 100644 index 748e58fe0e26..000000000000 --- a/owl-bot-staging/google-cloud-redis-v1beta1/.repo-metadata.json +++ /dev/null @@ -1,18 +0,0 @@ -{ - "api_id": "redis.googleapis.com", - "api_shortname": "redis", - "client_documentation": "https://cloud.google.com/ruby/docs/reference/google-cloud-redis-v1beta1/latest", - "distribution_name": "google-cloud-redis-v1beta1", - "is_cloud": true, - "language": "ruby", - "name": "redis", - "name_pretty": "Google Cloud Memorystore for Redis V1beta1 API", - "product_documentation": "https://cloud.google.com/memorystore/docs/redis", - "release_level": "unreleased", - "repo": "googleapis/google-cloud-ruby", - "requires_billing": true, - "ruby-cloud-description": "Creates and manages Redis instances on the Google Cloud Platform. Note that google-cloud-redis-v1beta1 is a version-specific client library. For most uses, we recommend installing the main client library google-cloud-redis instead. See the readme for more details.", - "ruby-cloud-env-prefix": "REDIS", - "ruby-cloud-product-url": "https://cloud.google.com/memorystore/docs/redis", - "library_type": "GAPIC_AUTO" -} diff --git a/owl-bot-staging/google-cloud-redis-v1beta1/.rubocop.yml b/owl-bot-staging/google-cloud-redis-v1beta1/.rubocop.yml deleted file mode 100644 index a11ddc031cc8..000000000000 --- a/owl-bot-staging/google-cloud-redis-v1beta1/.rubocop.yml +++ /dev/null @@ -1,33 +0,0 @@ -inherit_gem: - google-style: google-style.yml - -AllCops: - Exclude: - - "google-cloud-redis-v1beta1.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-redis-v1beta1.rb" diff --git a/owl-bot-staging/google-cloud-redis-v1beta1/.toys.rb b/owl-bot-staging/google-cloud-redis-v1beta1/.toys.rb deleted file mode 100644 index 177e22456e8a..000000000000 --- a/owl-bot-staging/google-cloud-redis-v1beta1/.toys.rb +++ /dev/null @@ -1,28 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -toys_version! ">= 0.15.3" - -if ENV["RUBY_COMMON_TOOLS"] - common_tools_dir = File.expand_path ENV["RUBY_COMMON_TOOLS"] - load File.join(common_tools_dir, "toys", "gapic") -else - load_git remote: "https://github.com/googleapis/ruby-common-tools.git", - path: "toys/gapic", - update: true -end diff --git a/owl-bot-staging/google-cloud-redis-v1beta1/.yardopts b/owl-bot-staging/google-cloud-redis-v1beta1/.yardopts deleted file mode 100644 index a0c18cb6bf60..000000000000 --- a/owl-bot-staging/google-cloud-redis-v1beta1/.yardopts +++ /dev/null @@ -1,12 +0,0 @@ ---no-private ---title="Google Cloud Memorystore for Redis V1beta1 API" ---exclude _pb\.rb$ ---markup markdown ---markup-provider redcarpet - -./lib/**/*.rb -./proto_docs/**/*.rb -- -README.md -LICENSE.md -AUTHENTICATION.md diff --git a/owl-bot-staging/google-cloud-redis-v1beta1/AUTHENTICATION.md b/owl-bot-staging/google-cloud-redis-v1beta1/AUTHENTICATION.md deleted file mode 100644 index 24935776f1eb..000000000000 --- a/owl-bot-staging/google-cloud-redis-v1beta1/AUTHENTICATION.md +++ /dev/null @@ -1,122 +0,0 @@ -# Authentication - -The recommended way to authenticate to the google-cloud-redis-v1beta1 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-redis-v1beta1 library provides several mechanisms to configure your system. -Generally, using Application Default Credentials to facilitate automatic -credentials discovery is the easist method. But if you need to explicitly specify -credentials, there are several methods available to you. - -Credentials are accepted in the following ways, in the following order or precedence: - -1. Credentials specified in method arguments -2. Credentials specified in configuration -3. Credentials pointed to or included in environment variables -4. Credentials found in local ADC file -5. Credentials returned by the metadata server for the attached service account (GCP) - -### Configuration - -You can configure a path to a JSON credentials file, either for an individual client object or -globally, for all client objects. The JSON file can contain credentials created for -[workload identity federation](https://cloud.google.com/iam/docs/workload-identity-federation), -[workforce identity federation](https://cloud.google.com/iam/docs/workforce-identity-federation), or a -[service account key](https://cloud.google.com/docs/authentication/provide-credentials-adc#local-key). - -Note: Service account keys are a security risk if not managed correctly. You should -[choose a more secure alternative to service account keys](https://cloud.google.com/docs/authentication#auth-decision-tree) -whenever possible. - -To configure a credentials file for an individual client initialization: - -```ruby -require "google/cloud/redis/v1beta1" - -client = ::Google::Cloud::Redis::V1beta1::CloudRedis::Client.new do |config| - config.credentials = "path/to/credentialfile.json" -end -``` - -To configure a credentials file globally for all clients: - -```ruby -require "google/cloud/redis/v1beta1" - -::Google::Cloud::Redis::V1beta1::CloudRedis::Client.configure do |config| - config.credentials = "path/to/credentialfile.json" -end - -client = ::Google::Cloud::Redis::V1beta1::CloudRedis::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-redis-v1beta1 -checks for credentials are: - -* `GOOGLE_CLOUD_CREDENTIALS` - Path to JSON file, or JSON contents -* `GOOGLE_APPLICATION_CREDENTIALS` - Path to JSON file - -```ruby -require "google/cloud/redis/v1beta1" - -ENV["GOOGLE_APPLICATION_CREDENTIALS"] = "path/to/credentialfile.json" - -client = ::Google::Cloud::Redis::V1beta1::CloudRedis::Client.new -``` - -### Local ADC file - -You can set up a local ADC file with your user credentials for authentication during -development. If credentials are not provided in code or in environment variables, -then the local ADC credentials are discovered. - -Follow the steps in [Quickstart](#quickstart) to set up a local ADC file. - -### Google Cloud Platform environments - -When running on Google Cloud Platform (GCP), including Google Compute Engine -(GCE), Google Kubernetes Engine (GKE), Google App Engine (GAE), Google Cloud -Functions (GCF) and Cloud Run, credentials are retrieved from the attached -service account automatically. Code should be written as if already authenticated. - -For more information, see -[Set up ADC for Google Cloud services](https://cloud.google.com/docs/authentication/provide-credentials-adc#attached-sa). diff --git a/owl-bot-staging/google-cloud-redis-v1beta1/CHANGELOG.md b/owl-bot-staging/google-cloud-redis-v1beta1/CHANGELOG.md deleted file mode 100644 index f88957a62ba2..000000000000 --- a/owl-bot-staging/google-cloud-redis-v1beta1/CHANGELOG.md +++ /dev/null @@ -1,2 +0,0 @@ -# Release History - diff --git a/owl-bot-staging/google-cloud-redis-v1beta1/Gemfile b/owl-bot-staging/google-cloud-redis-v1beta1/Gemfile deleted file mode 100644 index 1d08558908d8..000000000000 --- a/owl-bot-staging/google-cloud-redis-v1beta1/Gemfile +++ /dev/null @@ -1,14 +0,0 @@ -source "https://rubygems.org" - -gemspec - -gem "google-style", "~> 1.32.0" -gem "irb", "~> 1.17" -gem "minitest", "~> 6.0.2" -gem "minitest-focus", "~> 1.4" -gem "minitest-mock", "~> 5.27" -gem "minitest-rg", "~> 5.3" -gem "ostruct", "~> 0.5.5" -gem "rake", ">= 13.0" -gem "redcarpet", "~> 3.6" -gem "yard", "~> 0.9" diff --git a/owl-bot-staging/google-cloud-redis-v1beta1/LICENSE.md b/owl-bot-staging/google-cloud-redis-v1beta1/LICENSE.md deleted file mode 100644 index c261857ba6ad..000000000000 --- a/owl-bot-staging/google-cloud-redis-v1beta1/LICENSE.md +++ /dev/null @@ -1,201 +0,0 @@ - Apache License - Version 2.0, January 2004 - http://www.apache.org/licenses/ - - TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION - - 1. Definitions. - - "License" shall mean the terms and conditions for use, reproduction, - and distribution as defined by Sections 1 through 9 of this document. - - "Licensor" shall mean the copyright owner or entity authorized by - the copyright owner that is granting the License. - - "Legal Entity" shall mean the union of the acting entity and all - other entities that control, are controlled by, or are under common - control with that entity. For the purposes of this definition, - "control" means (i) the power, direct or indirect, to cause the - direction or management of such entity, whether by contract or - otherwise, or (ii) ownership of fifty percent (50%) or more of the - outstanding shares, or (iii) beneficial ownership of such entity. - - "You" (or "Your") shall mean an individual or Legal Entity - exercising permissions granted by this License. - - "Source" form shall mean the preferred form for making modifications, - including but not limited to software source code, documentation - source, and configuration files. - - "Object" form shall mean any form resulting from mechanical - transformation or translation of a Source form, including but - not limited to compiled object code, generated documentation, - and conversions to other media types. - - "Work" shall mean the work of authorship, whether in Source or - Object form, made available under the License, as indicated by a - copyright notice that is included in or attached to the work - (an example is provided in the Appendix below). - - "Derivative Works" shall mean any work, whether in Source or Object - form, that is based on (or derived from) the Work and for which the - editorial revisions, annotations, elaborations, or other modifications - represent, as a whole, an original work of authorship. For the purposes - of this License, Derivative Works shall not include works that remain - separable from, or merely link (or bind by name) to the interfaces of, - the Work and Derivative Works thereof. - - "Contribution" shall mean any work of authorship, including - the original version of the Work and any modifications or additions - to that Work or Derivative Works thereof, that is intentionally - submitted to Licensor for inclusion in the Work by the copyright owner - or by an individual or Legal Entity authorized to submit on behalf of - the copyright owner. For the purposes of this definition, "submitted" - means any form of electronic, verbal, or written communication sent - to the Licensor or its representatives, including but not limited to - communication on electronic mailing lists, source code control systems, - and issue tracking systems that are managed by, or on behalf of, the - Licensor for the purpose of discussing and improving the Work, but - excluding communication that is conspicuously marked or otherwise - designated in writing by the copyright owner as "Not a Contribution." - - "Contributor" shall mean Licensor and any individual or Legal Entity - on behalf of whom a Contribution has been received by Licensor and - subsequently incorporated within the Work. - - 2. Grant of Copyright License. Subject to the terms and conditions of - this License, each Contributor hereby grants to You a perpetual, - worldwide, non-exclusive, no-charge, royalty-free, irrevocable - copyright license to reproduce, prepare Derivative Works of, - publicly display, publicly perform, sublicense, and distribute the - Work and such Derivative Works in Source or Object form. - - 3. Grant of Patent License. Subject to the terms and conditions of - this License, each Contributor hereby grants to You a perpetual, - worldwide, non-exclusive, no-charge, royalty-free, irrevocable - (except as stated in this section) patent license to make, have made, - use, offer to sell, sell, import, and otherwise transfer the Work, - where such license applies only to those patent claims licensable - by such Contributor that are necessarily infringed by their - Contribution(s) alone or by combination of their Contribution(s) - with the Work to which such Contribution(s) was submitted. If You - institute patent litigation against any entity (including a - cross-claim or counterclaim in a lawsuit) alleging that the Work - or a Contribution incorporated within the Work constitutes direct - or contributory patent infringement, then any patent licenses - granted to You under this License for that Work shall terminate - as of the date such litigation is filed. - - 4. Redistribution. You may reproduce and distribute copies of the - Work or Derivative Works thereof in any medium, with or without - modifications, and in Source or Object form, provided that You - meet the following conditions: - - (a) You must give any other recipients of the Work or - Derivative Works a copy of this License; and - - (b) You must cause any modified files to carry prominent notices - stating that You changed the files; and - - (c) You must retain, in the Source form of any Derivative Works - that You distribute, all copyright, patent, trademark, and - attribution notices from the Source form of the Work, - excluding those notices that do not pertain to any part of - the Derivative Works; and - - (d) If the Work includes a "NOTICE" text file as part of its - distribution, then any Derivative Works that You distribute must - include a readable copy of the attribution notices contained - within such NOTICE file, excluding those notices that do not - pertain to any part of the Derivative Works, in at least one - of the following places: within a NOTICE text file distributed - as part of the Derivative Works; within the Source form or - documentation, if provided along with the Derivative Works; or, - within a display generated by the Derivative Works, if and - wherever such third-party notices normally appear. The contents - of the NOTICE file are for informational purposes only and - do not modify the License. You may add Your own attribution - notices within Derivative Works that You distribute, alongside - or as an addendum to the NOTICE text from the Work, provided - that such additional attribution notices cannot be construed - as modifying the License. - - You may add Your own copyright statement to Your modifications and - may provide additional or different license terms and conditions - for use, reproduction, or distribution of Your modifications, or - for any such Derivative Works as a whole, provided Your use, - reproduction, and distribution of the Work otherwise complies with - the conditions stated in this License. - - 5. Submission of Contributions. Unless You explicitly state otherwise, - any Contribution intentionally submitted for inclusion in the Work - by You to the Licensor shall be under the terms and conditions of - this License, without any additional terms or conditions. - Notwithstanding the above, nothing herein shall supersede or modify - the terms of any separate license agreement you may have executed - with Licensor regarding such Contributions. - - 6. Trademarks. This License does not grant permission to use the trade - names, trademarks, service marks, or product names of the Licensor, - except as required for reasonable and customary use in describing the - origin of the Work and reproducing the content of the NOTICE file. - - 7. Disclaimer of Warranty. Unless required by applicable law or - agreed to in writing, Licensor provides the Work (and each - Contributor provides its Contributions) on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or - implied, including, without limitation, any warranties or conditions - of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A - PARTICULAR PURPOSE. You are solely responsible for determining the - appropriateness of using or redistributing the Work and assume any - risks associated with Your exercise of permissions under this License. - - 8. Limitation of Liability. In no event and under no legal theory, - whether in tort (including negligence), contract, or otherwise, - unless required by applicable law (such as deliberate and grossly - negligent acts) or agreed to in writing, shall any Contributor be - liable to You for damages, including any direct, indirect, special, - incidental, or consequential damages of any character arising as a - result of this License or out of the use or inability to use the - Work (including but not limited to damages for loss of goodwill, - work stoppage, computer failure or malfunction, or any and all - other commercial damages or losses), even if such Contributor - has been advised of the possibility of such damages. - - 9. Accepting Warranty or Additional Liability. While redistributing - the Work or Derivative Works thereof, You may choose to offer, - and charge a fee for, acceptance of support, warranty, indemnity, - or other liability obligations and/or rights consistent with this - License. However, in accepting such obligations, You may act only - on Your own behalf and on Your sole responsibility, not on behalf - of any other Contributor, and only if You agree to indemnify, - defend, and hold each Contributor harmless for any liability - incurred by, or claims asserted against, such Contributor by reason - of your accepting any such warranty or additional liability. - - END OF TERMS AND CONDITIONS - - APPENDIX: How to apply the Apache License to your work. - - To apply the Apache License to your work, attach the following - boilerplate notice, with the fields enclosed by brackets "[]" - replaced with your own identifying information. (Don't include - the brackets!) The text should be enclosed in the appropriate - comment syntax for the file format. We also recommend that a - file or class name and description of purpose be included on the - same "printed page" as the copyright notice for easier - identification within third-party archives. - - Copyright [yyyy] [name of copyright owner] - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. diff --git a/owl-bot-staging/google-cloud-redis-v1beta1/README.md b/owl-bot-staging/google-cloud-redis-v1beta1/README.md deleted file mode 100644 index f99e2871ca0c..000000000000 --- a/owl-bot-staging/google-cloud-redis-v1beta1/README.md +++ /dev/null @@ -1,153 +0,0 @@ -# Ruby Client for the Google Cloud Memorystore for Redis V1beta1 API - -Creates and manages Redis instances on the Google Cloud Platform. - - -https://github.com/googleapis/google-cloud-ruby - -This gem is a _versioned_ client. It provides basic client classes for a -specific version of the Google Cloud Memorystore for Redis V1beta1 API. Most users should consider using -the main client gem, -[google-cloud-redis](https://rubygems.org/gems/google-cloud-redis). -See the section below titled *Which client should I use?* for more information. - -## Installation - -``` -$ gem install google-cloud-redis-v1beta1 -``` - -## 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/redis.googleapis.com) -1. [Set up authentication.](AUTHENTICATION.md) - -## Quick Start - -```ruby -require "google/cloud/redis/v1beta1" - -client = ::Google::Cloud::Redis::V1beta1::CloudRedis::Client.new -request = ::Google::Cloud::Redis::V1beta1::ListInstancesRequest.new # (request fields as keyword arguments...) -response = client.list_instances request -``` - -View the [Client Library Documentation](https://cloud.google.com/ruby/docs/reference/google-cloud-redis-v1beta1/latest) -for class and method documentation. - -See also the [Product Documentation](https://cloud.google.com/memorystore/docs/redis) -for general usage information. - -## Debug Logging - -This library comes with opt-in Debug Logging that can help you troubleshoot -your application's integration with the API. When logging is activated, key -events such as requests and responses, along with data payloads and metadata -such as headers and client configuration, are logged to the standard error -stream. - -**WARNING:** Client Library Debug Logging includes your data payloads in -plaintext, which could include sensitive data such as PII for yourself or your -customers, private keys, or other security data that could be compromising if -leaked. Always practice good data hygiene with your application logs, and follow -the principle of least access. Google also recommends that Client Library Debug -Logging be enabled only temporarily during active debugging, and not used -permanently in production. - -To enable logging, set the environment variable `GOOGLE_SDK_RUBY_LOGGING_GEMS` -to the value `all`. Alternatively, you can set the value to a comma-delimited -list of client library gem names. This will select the default logging behavior, -which writes logs to the standard error stream. On a local workstation, this may -result in logs appearing on the console. When running on a Google Cloud hosting -service such as [Google Cloud Run](https://cloud.google.com/run), this generally -results in logs appearing alongside your application logs in the -[Google Cloud Logging](https://cloud.google.com/logging/) service. - -You can customize logging by modifying the `logger` configuration when -constructing a client object. For example: - -```ruby -require "google/cloud/redis/v1beta1" -require "logger" - -client = ::Google::Cloud::Redis::V1beta1::CloudRedis::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-redis`, -and lower-level _versioned_ client libraries with names such as -`google-cloud-redis-v1beta1`. -_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-redis`. -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-redis-v1beta1`. - -### What about the google-apis- clients? - -Client library gems with names that begin with `google-apis-` are based on an -older code generation technology. They talk to a REST/JSON backend (whereas -most modern clients talk to a [gRPC](https://grpc.io/) backend) and they may -not offer the same performance, features, and ease of use provided by more -modern clients. - -The `google-apis-` clients have wide coverage across Google services, so you -might need to use one if there is no modern client available for the service. -However, if a modern client is available, we generally recommend it over the -older `google-apis-` clients. diff --git a/owl-bot-staging/google-cloud-redis-v1beta1/Rakefile b/owl-bot-staging/google-cloud-redis-v1beta1/Rakefile deleted file mode 100644 index 4ad30ddb21f5..000000000000 --- a/owl-bot-staging/google-cloud-redis-v1beta1/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-redis-v1beta1 acceptance tests." -task :acceptance, :project, :keyfile do |t, args| - project = args[:project] - project ||= - ENV["REDIS_TEST_PROJECT"] || - ENV["GCLOUD_TEST_PROJECT"] - keyfile = args[:keyfile] - keyfile ||= - ENV["REDIS_TEST_KEYFILE"] || - ENV["GCLOUD_TEST_KEYFILE"] - if keyfile - keyfile = File.read keyfile - else - keyfile ||= - ENV["REDIS_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 REDIS_TEST_PROJECT=test123 REDIS_TEST_KEYFILE=/path/to/keyfile.json rake acceptance" - end - require "google/cloud/redis/v1beta1/cloud_redis/credentials" - ::Google::Cloud::Redis::V1beta1::CloudRedis::Credentials.env_vars.each do |path| - ENV[path] = nil - end - ENV["REDIS_PROJECT"] = project - ENV["REDIS_TEST_PROJECT"] = project - ENV["REDIS_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-redis-v1beta1 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-redis-v1beta1 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-redis-v1beta1 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-redis-v1beta1 gem does not have doctest tests." -end - -desc "Run the CI build" -task :ci do - header "BUILDING google-cloud-redis-v1beta1" - header "google-cloud-redis-v1beta1 rubocop", "*" - Rake::Task[:rubocop].invoke - header "google-cloud-redis-v1beta1 yard", "*" - Rake::Task[:yard].invoke - header "google-cloud-redis-v1beta1 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-redis-v1beta1 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-redis-v1beta1 acceptance", "*" - Rake::Task[:acceptance].invoke - end - task :a do - # This is a handy shortcut to save typing - Rake::Task["ci:acceptance"].invoke - end -end - -task default: :test - -def header str, token = "#" - line_length = str.length + 8 - puts "" - puts token * line_length - puts "#{token * 3} #{str} #{token * 3}" - puts token * line_length - puts "" -end diff --git a/owl-bot-staging/google-cloud-redis-v1beta1/gapic_metadata.json b/owl-bot-staging/google-cloud-redis-v1beta1/gapic_metadata.json deleted file mode 100644 index ef24a8f379ea..000000000000 --- a/owl-bot-staging/google-cloud-redis-v1beta1/gapic_metadata.json +++ /dev/null @@ -1,73 +0,0 @@ -{ - "schema": "1.0", - "comment": "This file maps proto services/RPCs to the corresponding library clients/methods", - "language": "ruby", - "protoPackage": "google.cloud.redis.v1beta1", - "libraryPackage": "::Google::Cloud::Redis::V1beta1", - "services": { - "CloudRedis": { - "clients": { - "grpc": { - "libraryClient": "::Google::Cloud::Redis::V1beta1::CloudRedis::Client", - "rpcs": { - "ListInstances": { - "methods": [ - "list_instances" - ] - }, - "GetInstance": { - "methods": [ - "get_instance" - ] - }, - "GetInstanceAuthString": { - "methods": [ - "get_instance_auth_string" - ] - }, - "CreateInstance": { - "methods": [ - "create_instance" - ] - }, - "UpdateInstance": { - "methods": [ - "update_instance" - ] - }, - "UpgradeInstance": { - "methods": [ - "upgrade_instance" - ] - }, - "ImportInstance": { - "methods": [ - "import_instance" - ] - }, - "ExportInstance": { - "methods": [ - "export_instance" - ] - }, - "FailoverInstance": { - "methods": [ - "failover_instance" - ] - }, - "DeleteInstance": { - "methods": [ - "delete_instance" - ] - }, - "RescheduleMaintenance": { - "methods": [ - "reschedule_maintenance" - ] - } - } - } - } - } - } -} diff --git a/owl-bot-staging/google-cloud-redis-v1beta1/google-cloud-redis-v1beta1.gemspec b/owl-bot-staging/google-cloud-redis-v1beta1/google-cloud-redis-v1beta1.gemspec deleted file mode 100644 index 0e08c4300933..000000000000 --- a/owl-bot-staging/google-cloud-redis-v1beta1/google-cloud-redis-v1beta1.gemspec +++ /dev/null @@ -1,28 +0,0 @@ -# -*- ruby -*- -# encoding: utf-8 - -require File.expand_path("lib/google/cloud/redis/v1beta1/version", __dir__) - -Gem::Specification.new do |gem| - gem.name = "google-cloud-redis-v1beta1" - gem.version = Google::Cloud::Redis::V1beta1::VERSION - - gem.authors = ["Google LLC"] - gem.email = "googleapis-packages@google.com" - gem.description = "Creates and manages Redis instances on the Google Cloud Platform. Note that google-cloud-redis-v1beta1 is a version-specific client library. For most uses, we recommend installing the main client library google-cloud-redis instead. See the readme for more details." - gem.summary = "Creates and manages Redis instances on the Google Cloud Platform." - gem.homepage = "https://github.com/googleapis/google-cloud-ruby" - gem.license = "Apache-2.0" - - gem.platform = Gem::Platform::RUBY - - gem.files = `git ls-files -- lib/*`.split("\n") + - `git ls-files -- proto_docs/*`.split("\n") + - ["README.md", "LICENSE.md", "AUTHENTICATION.md", ".yardopts"] - gem.require_paths = ["lib"] - - gem.required_ruby_version = ">= 3.2" - - gem.add_dependency "gapic-common", "~> 1.2" - gem.add_dependency "google-cloud-errors", "~> 1.0" -end diff --git a/owl-bot-staging/google-cloud-redis-v1beta1/lib/google-cloud-redis-v1beta1.rb b/owl-bot-staging/google-cloud-redis-v1beta1/lib/google-cloud-redis-v1beta1.rb deleted file mode 100644 index d3f5814eb8fa..000000000000 --- a/owl-bot-staging/google-cloud-redis-v1beta1/lib/google-cloud-redis-v1beta1.rb +++ /dev/null @@ -1,21 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -# This gem does not autoload during Bundler.require. To load this gem, -# issue explicit require statements for the packages desired, e.g.: -# require "google/cloud/redis/v1beta1" diff --git a/owl-bot-staging/google-cloud-redis-v1beta1/lib/google/cloud/redis/v1beta1.rb b/owl-bot-staging/google-cloud-redis-v1beta1/lib/google/cloud/redis/v1beta1.rb deleted file mode 100644 index a5bbbbab1963..000000000000 --- a/owl-bot-staging/google-cloud-redis-v1beta1/lib/google/cloud/redis/v1beta1.rb +++ /dev/null @@ -1,45 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -require "google/cloud/redis/v1beta1/cloud_redis" -require "google/cloud/redis/v1beta1/version" - -module Google - module Cloud - module Redis - ## - # API client module. - # - # @example Load this package, including all its services, and instantiate a gRPC client - # - # require "google/cloud/redis/v1beta1" - # client = ::Google::Cloud::Redis::V1beta1::CloudRedis::Client.new - # - # @example Load this package, including all its services, and instantiate a REST client - # - # require "google/cloud/redis/v1beta1" - # client = ::Google::Cloud::Redis::V1beta1::CloudRedis::Rest::Client.new - # - module V1beta1 - end - end - end -end - -helper_path = ::File.join __dir__, "v1beta1", "_helpers.rb" -require "google/cloud/redis/v1beta1/_helpers" if ::File.file? helper_path diff --git a/owl-bot-staging/google-cloud-redis-v1beta1/lib/google/cloud/redis/v1beta1/cloud_redis.rb b/owl-bot-staging/google-cloud-redis-v1beta1/lib/google/cloud/redis/v1beta1/cloud_redis.rb deleted file mode 100644 index 8ed5649f09b6..000000000000 --- a/owl-bot-staging/google-cloud-redis-v1beta1/lib/google/cloud/redis/v1beta1/cloud_redis.rb +++ /dev/null @@ -1,70 +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/redis/v1beta1/version" - -require "google/cloud/redis/v1beta1/cloud_redis/credentials" -require "google/cloud/redis/v1beta1/cloud_redis/paths" -require "google/cloud/redis/v1beta1/cloud_redis/operations" -require "google/cloud/redis/v1beta1/cloud_redis/client" -require "google/cloud/redis/v1beta1/cloud_redis/rest" - -module Google - module Cloud - module Redis - module V1beta1 - ## - # Configures and manages Cloud Memorystore for Redis instances - # - # Google Cloud Memorystore for Redis v1beta1 - # - # The `redis.googleapis.com` service implements the Google Cloud Memorystore - # for Redis API and defines the following resource model for managing Redis - # instances: - # * The service works with a collection of cloud projects, named: `/projects/*` - # * Each project has a collection of available locations, named: `/locations/*` - # * Each location has a collection of Redis instances, named: `/instances/*` - # * As such, Redis instances are resources of the form: - # `/projects/{project_id}/locations/{location_id}/instances/{instance_id}` - # - # Note that location_id must be referring to a GCP `region`; for example: - # * `projects/redpepper-1290/locations/us-central1/instances/my-redis` - # - # @example Load this service and instantiate a gRPC client - # - # require "google/cloud/redis/v1beta1/cloud_redis" - # client = ::Google::Cloud::Redis::V1beta1::CloudRedis::Client.new - # - # @example Load this service and instantiate a REST client - # - # require "google/cloud/redis/v1beta1/cloud_redis/rest" - # client = ::Google::Cloud::Redis::V1beta1::CloudRedis::Rest::Client.new - # - module CloudRedis - end - end - end - end -end - -helper_path = ::File.join __dir__, "cloud_redis", "helpers.rb" -require "google/cloud/redis/v1beta1/cloud_redis/helpers" if ::File.file? helper_path diff --git a/owl-bot-staging/google-cloud-redis-v1beta1/lib/google/cloud/redis/v1beta1/cloud_redis/client.rb b/owl-bot-staging/google-cloud-redis-v1beta1/lib/google/cloud/redis/v1beta1/cloud_redis/client.rb deleted file mode 100644 index 540963a8d94c..000000000000 --- a/owl-bot-staging/google-cloud-redis-v1beta1/lib/google/cloud/redis/v1beta1/cloud_redis/client.rb +++ /dev/null @@ -1,1629 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -require "google/cloud/errors" -require "google/cloud/redis/v1beta1/cloud_redis_pb" - -module Google - module Cloud - module Redis - module V1beta1 - module CloudRedis - ## - # Client for the CloudRedis service. - # - # Configures and manages Cloud Memorystore for Redis instances - # - # Google Cloud Memorystore for Redis v1beta1 - # - # The `redis.googleapis.com` service implements the Google Cloud Memorystore - # for Redis API and defines the following resource model for managing Redis - # instances: - # * The service works with a collection of cloud projects, named: `/projects/*` - # * Each project has a collection of available locations, named: `/locations/*` - # * Each location has a collection of Redis instances, named: `/instances/*` - # * As such, Redis instances are resources of the form: - # `/projects/{project_id}/locations/{location_id}/instances/{instance_id}` - # - # Note that location_id must be referring to a GCP `region`; for example: - # * `projects/redpepper-1290/locations/us-central1/instances/my-redis` - # - class Client - # @private - API_VERSION = "" - - # @private - DEFAULT_ENDPOINT_TEMPLATE = "redis.$UNIVERSE_DOMAIN$" - - include Paths - - # @private - attr_reader :cloud_redis_stub - - ## - # Configure the CloudRedis Client class. - # - # See {::Google::Cloud::Redis::V1beta1::CloudRedis::Client::Configuration} - # for a description of the configuration fields. - # - # @example - # - # # Modify the configuration for all CloudRedis clients - # ::Google::Cloud::Redis::V1beta1::CloudRedis::Client.configure do |config| - # config.timeout = 10.0 - # end - # - # @yield [config] Configure the Client client. - # @yieldparam config [Client::Configuration] - # - # @return [Client::Configuration] - # - def self.configure - @configure ||= begin - namespace = ["Google", "Cloud", "Redis", "V1beta1"] - parent_config = while namespace.any? - parent_name = namespace.join "::" - parent_const = const_get parent_name - break parent_const.configure if parent_const.respond_to? :configure - namespace.pop - end - default_config = Client::Configuration.new parent_config - - default_config.rpcs.list_instances.timeout = 600.0 - - default_config.rpcs.get_instance.timeout = 600.0 - - default_config.rpcs.get_instance_auth_string.timeout = 600.0 - - default_config.rpcs.create_instance.timeout = 600.0 - - default_config.rpcs.update_instance.timeout = 600.0 - - default_config.rpcs.upgrade_instance.timeout = 600.0 - - default_config.rpcs.import_instance.timeout = 600.0 - - default_config.rpcs.export_instance.timeout = 600.0 - - default_config.rpcs.failover_instance.timeout = 600.0 - - default_config.rpcs.delete_instance.timeout = 600.0 - - default_config - end - yield @configure if block_given? - @configure - end - - ## - # Configure the CloudRedis Client instance. - # - # The configuration is set to the derived mode, meaning that values can be changed, - # but structural changes (adding new fields, etc.) are not allowed. Structural changes - # should be made on {Client.configure}. - # - # See {::Google::Cloud::Redis::V1beta1::CloudRedis::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 - @cloud_redis_stub.universe_domain - end - - ## - # Create a new CloudRedis client object. - # - # @example - # - # # Create a client using the default configuration - # client = ::Google::Cloud::Redis::V1beta1::CloudRedis::Client.new - # - # # Create a client using a custom configuration - # client = ::Google::Cloud::Redis::V1beta1::CloudRedis::Client.new do |config| - # config.timeout = 10.0 - # end - # - # @yield [config] Configure the CloudRedis client. - # @yieldparam config [Client::Configuration] - # - def initialize - # These require statements are intentionally placed here to initialize - # the gRPC module only when it's required. - # See https://github.com/googleapis/toolkit/issues/446 - require "gapic/grpc" - require "google/cloud/redis/v1beta1/cloud_redis_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 - - @cloud_redis_stub = ::Gapic::ServiceStub.new( - ::Google::Cloud::Redis::V1beta1::CloudRedis::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 - ) - - @cloud_redis_stub.stub_logger&.info do |entry| - entry.set_system_name - entry.set_service - entry.message = "Created client for #{entry.service}" - entry.set_credentials_fields credentials - entry.set "customEndpoint", @config.endpoint if @config.endpoint - entry.set "defaultTimeout", @config.timeout if @config.timeout - entry.set "quotaProject", @quota_project_id if @quota_project_id - end - end - - ## - # Get the associated client for long-running operations. - # - # @return [::Google::Cloud::Redis::V1beta1::CloudRedis::Operations] - # - attr_reader :operations_client - - ## - # The logger used for request/response debug logging. - # - # @return [Logger] - # - def logger - @cloud_redis_stub.logger - end - - # Service calls - - ## - # Lists all Redis instances owned by a project in either the specified - # location (region) or all locations. - # - # The location should have the following format: - # - # * `projects/{project_id}/locations/{location_id}` - # - # If `location_id` is specified as `-` (wildcard), then all regions - # available to the project are queried, and the results are aggregated. - # - # @overload list_instances(request, options = nil) - # Pass arguments to `list_instances` via a request object, either of type - # {::Google::Cloud::Redis::V1beta1::ListInstancesRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Redis::V1beta1::ListInstancesRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_instances(parent: nil, page_size: nil, page_token: nil) - # Pass arguments to `list_instances` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param parent [::String] - # Required. The resource name of the instance location using the form: - # `projects/{project_id}/locations/{location_id}` - # where `location_id` refers to a GCP region. - # @param page_size [::Integer] - # The maximum number of items to return. - # - # If not specified, a default value of 1000 will be used by the service. - # Regardless of the page_size value, the response may include a partial list - # and a caller should only rely on response's - # {::Google::Cloud::Redis::V1beta1::ListInstancesResponse#next_page_token `next_page_token`} - # to determine if there are more instances left to be queried. - # @param page_token [::String] - # The `next_page_token` value returned from a previous - # {::Google::Cloud::Redis::V1beta1::CloudRedis::Client#list_instances ListInstances} request, if any. - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Gapic::PagedEnumerable<::Google::Cloud::Redis::V1beta1::Instance>] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Gapic::PagedEnumerable<::Google::Cloud::Redis::V1beta1::Instance>] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/cloud/redis/v1beta1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Redis::V1beta1::CloudRedis::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Redis::V1beta1::ListInstancesRequest.new - # - # # Call the list_instances method. - # result = client.list_instances request - # - # # The returned object is of type Gapic::PagedEnumerable. You can iterate - # # over elements, and API calls will be issued to fetch pages as needed. - # result.each do |item| - # # Each element is of type ::Google::Cloud::Redis::V1beta1::Instance. - # p item - # end - # - def list_instances request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Redis::V1beta1::ListInstancesRequest - - # Converts hash 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_instances.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::Redis::V1beta1::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_instances.timeout, - metadata: metadata, - retry_policy: @config.rpcs.list_instances.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @cloud_redis_stub.call_rpc :list_instances, request, options: options do |response, operation| - response = ::Gapic::PagedEnumerable.new @cloud_redis_stub, :list_instances, request, response, operation, options - yield response, operation if block_given? - throw :response, response - end - rescue ::GRPC::BadStatus => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Gets the details of a specific Redis instance. - # - # @overload get_instance(request, options = nil) - # Pass arguments to `get_instance` via a request object, either of type - # {::Google::Cloud::Redis::V1beta1::GetInstanceRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Redis::V1beta1::GetInstanceRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_instance(name: nil) - # Pass arguments to `get_instance` via keyword arguments. Note that at - # least one keyword argument is 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. Redis instance resource name using the form: - # `projects/{project_id}/locations/{location_id}/instances/{instance_id}` - # where `location_id` refers to a GCP region. - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Google::Cloud::Redis::V1beta1::Instance] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Google::Cloud::Redis::V1beta1::Instance] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/cloud/redis/v1beta1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Redis::V1beta1::CloudRedis::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Redis::V1beta1::GetInstanceRequest.new - # - # # Call the get_instance method. - # result = client.get_instance request - # - # # The returned object is of type Google::Cloud::Redis::V1beta1::Instance. - # p result - # - def get_instance request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Redis::V1beta1::GetInstanceRequest - - # Converts hash 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_instance.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::Redis::V1beta1::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_instance.timeout, - metadata: metadata, - retry_policy: @config.rpcs.get_instance.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @cloud_redis_stub.call_rpc :get_instance, request, options: options do |response, operation| - yield response, operation if block_given? - end - rescue ::GRPC::BadStatus => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Gets the AUTH string for a Redis instance. If AUTH is not enabled for the - # instance the response will be empty. This information is not included in - # the details returned to GetInstance. - # - # @overload get_instance_auth_string(request, options = nil) - # Pass arguments to `get_instance_auth_string` via a request object, either of type - # {::Google::Cloud::Redis::V1beta1::GetInstanceAuthStringRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Redis::V1beta1::GetInstanceAuthStringRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_instance_auth_string(name: nil) - # Pass arguments to `get_instance_auth_string` via keyword arguments. Note that at - # least one keyword argument is 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. Redis instance resource name using the form: - # `projects/{project_id}/locations/{location_id}/instances/{instance_id}` - # where `location_id` refers to a GCP region. - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Google::Cloud::Redis::V1beta1::InstanceAuthString] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Google::Cloud::Redis::V1beta1::InstanceAuthString] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/cloud/redis/v1beta1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Redis::V1beta1::CloudRedis::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Redis::V1beta1::GetInstanceAuthStringRequest.new - # - # # Call the get_instance_auth_string method. - # result = client.get_instance_auth_string request - # - # # The returned object is of type Google::Cloud::Redis::V1beta1::InstanceAuthString. - # p result - # - def get_instance_auth_string request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Redis::V1beta1::GetInstanceAuthStringRequest - - # Converts hash 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_instance_auth_string.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::Redis::V1beta1::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_instance_auth_string.timeout, - metadata: metadata, - retry_policy: @config.rpcs.get_instance_auth_string.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @cloud_redis_stub.call_rpc :get_instance_auth_string, request, options: options do |response, operation| - yield response, operation if block_given? - end - rescue ::GRPC::BadStatus => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Creates a Redis instance based on the specified tier and memory size. - # - # By default, the instance is accessible from the project's - # [default network](https://cloud.google.com/vpc/docs/vpc). - # - # The creation is executed asynchronously and callers may check the returned - # operation to track its progress. Once the operation is completed the Redis - # instance will be fully functional. The completed longrunning.Operation will - # contain the new instance object in the response field. - # - # The returned operation is automatically deleted after a few hours, so there - # is no need to call DeleteOperation. - # - # @overload create_instance(request, options = nil) - # Pass arguments to `create_instance` via a request object, either of type - # {::Google::Cloud::Redis::V1beta1::CreateInstanceRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Redis::V1beta1::CreateInstanceRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_instance(parent: nil, instance_id: nil, instance: nil) - # Pass arguments to `create_instance` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param parent [::String] - # Required. The resource name of the instance location using the form: - # `projects/{project_id}/locations/{location_id}` - # where `location_id` refers to a GCP region. - # @param instance_id [::String] - # Required. The logical name of the Redis instance in the customer project - # with the following restrictions: - # - # * Must contain only lowercase letters, numbers, and hyphens. - # * Must start with a letter. - # * Must be between 1-40 characters. - # * Must end with a number or a letter. - # * Must be unique within the customer project / location - # @param instance [::Google::Cloud::Redis::V1beta1::Instance, ::Hash] - # Required. A Redis [Instance] 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/cloud/redis/v1beta1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Redis::V1beta1::CloudRedis::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Redis::V1beta1::CreateInstanceRequest.new - # - # # Call the create_instance method. - # result = client.create_instance 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_instance request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Redis::V1beta1::CreateInstanceRequest - - # Converts hash 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_instance.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::Redis::V1beta1::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_instance.timeout, - metadata: metadata, - retry_policy: @config.rpcs.create_instance.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @cloud_redis_stub.call_rpc :create_instance, request, options: options do |response, operation| - response = ::Gapic::Operation.new response, @operations_client, options: options - yield response, operation if block_given? - throw :response, response - end - rescue ::GRPC::BadStatus => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Updates the metadata and configuration of a specific Redis instance. - # - # Completed longrunning.Operation will contain the new instance object - # in the response field. The returned operation is automatically deleted - # after a few hours, so there is no need to call DeleteOperation. - # - # @overload update_instance(request, options = nil) - # Pass arguments to `update_instance` via a request object, either of type - # {::Google::Cloud::Redis::V1beta1::UpdateInstanceRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Redis::V1beta1::UpdateInstanceRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_instance(update_mask: nil, instance: nil) - # Pass arguments to `update_instance` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param update_mask [::Google::Protobuf::FieldMask, ::Hash] - # Required. Mask of fields to update. At least one path must be supplied in - # this field. The elements of the repeated paths field may only include these - # fields from {::Google::Cloud::Redis::V1beta1::Instance Instance}: - # - # * `displayName` - # * `labels` - # * `memorySizeGb` - # * `redisConfig` - # * `replica_count` - # @param instance [::Google::Cloud::Redis::V1beta1::Instance, ::Hash] - # Required. Update description. - # Only fields specified in update_mask are updated. - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Gapic::Operation] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Gapic::Operation] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/cloud/redis/v1beta1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Redis::V1beta1::CloudRedis::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Redis::V1beta1::UpdateInstanceRequest.new - # - # # Call the update_instance method. - # result = client.update_instance 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_instance request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Redis::V1beta1::UpdateInstanceRequest - - # Converts hash 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_instance.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::Redis::V1beta1::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.instance&.name - header_params["instance.name"] = request.instance.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_instance.timeout, - metadata: metadata, - retry_policy: @config.rpcs.update_instance.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @cloud_redis_stub.call_rpc :update_instance, 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 - - ## - # Upgrades Redis instance to the newer Redis version specified in the - # request. - # - # @overload upgrade_instance(request, options = nil) - # Pass arguments to `upgrade_instance` via a request object, either of type - # {::Google::Cloud::Redis::V1beta1::UpgradeInstanceRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Redis::V1beta1::UpgradeInstanceRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. - # - # @overload upgrade_instance(name: nil, redis_version: nil) - # Pass arguments to `upgrade_instance` via keyword arguments. Note that at - # least one keyword argument is 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. Redis instance resource name using the form: - # `projects/{project_id}/locations/{location_id}/instances/{instance_id}` - # where `location_id` refers to a GCP region. - # @param redis_version [::String] - # Required. Specifies the target version of Redis software to upgrade to. - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Gapic::Operation] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Gapic::Operation] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/cloud/redis/v1beta1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Redis::V1beta1::CloudRedis::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Redis::V1beta1::UpgradeInstanceRequest.new - # - # # Call the upgrade_instance method. - # result = client.upgrade_instance 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 upgrade_instance request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Redis::V1beta1::UpgradeInstanceRequest - - # Converts hash 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.upgrade_instance.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::Redis::V1beta1::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.upgrade_instance.timeout, - metadata: metadata, - retry_policy: @config.rpcs.upgrade_instance.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @cloud_redis_stub.call_rpc :upgrade_instance, 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 - - ## - # Import a Redis RDB snapshot file from Cloud Storage into a Redis instance. - # - # Redis may stop serving during this operation. Instance state will be - # IMPORTING for entire operation. When complete, the instance will contain - # only data from the imported file. - # - # The returned operation is automatically deleted after a few hours, so - # there is no need to call DeleteOperation. - # - # @overload import_instance(request, options = nil) - # Pass arguments to `import_instance` via a request object, either of type - # {::Google::Cloud::Redis::V1beta1::ImportInstanceRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Redis::V1beta1::ImportInstanceRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. - # - # @overload import_instance(name: nil, input_config: nil) - # Pass arguments to `import_instance` via keyword arguments. Note that at - # least one keyword argument is 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. Redis instance resource name using the form: - # `projects/{project_id}/locations/{location_id}/instances/{instance_id}` - # where `location_id` refers to a GCP region. - # @param input_config [::Google::Cloud::Redis::V1beta1::InputConfig, ::Hash] - # Required. Specify data to be imported. - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Gapic::Operation] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Gapic::Operation] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/cloud/redis/v1beta1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Redis::V1beta1::CloudRedis::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Redis::V1beta1::ImportInstanceRequest.new - # - # # Call the import_instance method. - # result = client.import_instance 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 import_instance request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Redis::V1beta1::ImportInstanceRequest - - # Converts hash 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.import_instance.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::Redis::V1beta1::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.import_instance.timeout, - metadata: metadata, - retry_policy: @config.rpcs.import_instance.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @cloud_redis_stub.call_rpc :import_instance, 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 - - ## - # Export Redis instance data into a Redis RDB format file in Cloud Storage. - # - # Redis will continue serving during this operation. - # - # The returned operation is automatically deleted after a few hours, so - # there is no need to call DeleteOperation. - # - # @overload export_instance(request, options = nil) - # Pass arguments to `export_instance` via a request object, either of type - # {::Google::Cloud::Redis::V1beta1::ExportInstanceRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Redis::V1beta1::ExportInstanceRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. - # - # @overload export_instance(name: nil, output_config: nil) - # Pass arguments to `export_instance` via keyword arguments. Note that at - # least one keyword argument is 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. Redis instance resource name using the form: - # `projects/{project_id}/locations/{location_id}/instances/{instance_id}` - # where `location_id` refers to a GCP region. - # @param output_config [::Google::Cloud::Redis::V1beta1::OutputConfig, ::Hash] - # Required. Specify data to be exported. - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Gapic::Operation] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Gapic::Operation] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/cloud/redis/v1beta1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Redis::V1beta1::CloudRedis::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Redis::V1beta1::ExportInstanceRequest.new - # - # # Call the export_instance method. - # result = client.export_instance 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 export_instance request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Redis::V1beta1::ExportInstanceRequest - - # Converts hash 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.export_instance.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::Redis::V1beta1::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.export_instance.timeout, - metadata: metadata, - retry_policy: @config.rpcs.export_instance.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @cloud_redis_stub.call_rpc :export_instance, 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 - - ## - # Initiates a failover of the primary node to current replica node for a - # specific STANDARD tier Cloud Memorystore for Redis instance. - # - # @overload failover_instance(request, options = nil) - # Pass arguments to `failover_instance` via a request object, either of type - # {::Google::Cloud::Redis::V1beta1::FailoverInstanceRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Redis::V1beta1::FailoverInstanceRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. - # - # @overload failover_instance(name: nil, data_protection_mode: nil) - # Pass arguments to `failover_instance` via keyword arguments. Note that at - # least one keyword argument is 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. Redis instance resource name using the form: - # `projects/{project_id}/locations/{location_id}/instances/{instance_id}` - # where `location_id` refers to a GCP region. - # @param data_protection_mode [::Google::Cloud::Redis::V1beta1::FailoverInstanceRequest::DataProtectionMode] - # Optional. Available data protection modes that the user can choose. If it's - # unspecified, data protection mode will be LIMITED_DATA_LOSS by default. - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Gapic::Operation] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Gapic::Operation] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/cloud/redis/v1beta1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Redis::V1beta1::CloudRedis::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Redis::V1beta1::FailoverInstanceRequest.new - # - # # Call the failover_instance method. - # result = client.failover_instance 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 failover_instance request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Redis::V1beta1::FailoverInstanceRequest - - # Converts hash 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.failover_instance.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::Redis::V1beta1::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.failover_instance.timeout, - metadata: metadata, - retry_policy: @config.rpcs.failover_instance.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @cloud_redis_stub.call_rpc :failover_instance, 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 specific Redis instance. Instance stops serving and data is - # deleted. - # - # @overload delete_instance(request, options = nil) - # Pass arguments to `delete_instance` via a request object, either of type - # {::Google::Cloud::Redis::V1beta1::DeleteInstanceRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Redis::V1beta1::DeleteInstanceRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_instance(name: nil) - # Pass arguments to `delete_instance` via keyword arguments. Note that at - # least one keyword argument is 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. Redis instance resource name using the form: - # `projects/{project_id}/locations/{location_id}/instances/{instance_id}` - # where `location_id` refers to a GCP region. - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Gapic::Operation] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Gapic::Operation] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/cloud/redis/v1beta1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Redis::V1beta1::CloudRedis::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Redis::V1beta1::DeleteInstanceRequest.new - # - # # Call the delete_instance method. - # result = client.delete_instance 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_instance request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Redis::V1beta1::DeleteInstanceRequest - - # Converts hash 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_instance.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::Redis::V1beta1::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_instance.timeout, - metadata: metadata, - retry_policy: @config.rpcs.delete_instance.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @cloud_redis_stub.call_rpc :delete_instance, 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 - - ## - # Reschedule maintenance for a given instance in a given project and - # location. - # - # @overload reschedule_maintenance(request, options = nil) - # Pass arguments to `reschedule_maintenance` via a request object, either of type - # {::Google::Cloud::Redis::V1beta1::RescheduleMaintenanceRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Redis::V1beta1::RescheduleMaintenanceRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. - # - # @overload reschedule_maintenance(name: nil, reschedule_type: nil, schedule_time: nil) - # Pass arguments to `reschedule_maintenance` via keyword arguments. Note that at - # least one keyword argument is 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. Redis instance resource name using the form: - # `projects/{project_id}/locations/{location_id}/instances/{instance_id}` - # where `location_id` refers to a GCP region. - # @param reschedule_type [::Google::Cloud::Redis::V1beta1::RescheduleMaintenanceRequest::RescheduleType] - # Required. If reschedule type is SPECIFIC_TIME, must set up schedule_time as well. - # @param schedule_time [::Google::Protobuf::Timestamp, ::Hash] - # Optional. Timestamp when the maintenance shall be rescheduled to if - # reschedule_type=SPECIFIC_TIME, in RFC 3339 format, for - # example `2012-11-15T16:19:00.094Z`. - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Gapic::Operation] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Gapic::Operation] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/cloud/redis/v1beta1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Redis::V1beta1::CloudRedis::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Redis::V1beta1::RescheduleMaintenanceRequest.new - # - # # Call the reschedule_maintenance method. - # result = client.reschedule_maintenance 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 reschedule_maintenance request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Redis::V1beta1::RescheduleMaintenanceRequest - - # Converts hash 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.reschedule_maintenance.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::Redis::V1beta1::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.reschedule_maintenance.timeout, - metadata: metadata, - retry_policy: @config.rpcs.reschedule_maintenance.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @cloud_redis_stub.call_rpc :reschedule_maintenance, 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 CloudRedis API. - # - # This class represents the configuration for CloudRedis, - # providing control over timeouts, retry behavior, logging, transport - # parameters, and other low-level controls. Certain parameters can also be - # applied individually to specific RPCs. See - # {::Google::Cloud::Redis::V1beta1::CloudRedis::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_instances to 20 seconds, - # # and all remaining timeouts to 10 seconds. - # ::Google::Cloud::Redis::V1beta1::CloudRedis::Client.configure do |config| - # config.timeout = 10.0 - # config.rpcs.list_instances.timeout = 20.0 - # end - # - # # Apply the above configuration only to a new client. - # client = ::Google::Cloud::Redis::V1beta1::CloudRedis::Client.new do |config| - # config.timeout = 10.0 - # config.rpcs.list_instances.timeout = 20.0 - # end - # - # @!attribute [rw] endpoint - # A custom service endpoint, as a hostname or hostname:port. The default is - # nil, indicating to use the default endpoint in the current universe domain. - # @return [::String,nil] - # @!attribute [rw] credentials - # Credentials to send with calls. You may provide any of the following types: - # * (`Google::Auth::Credentials`) A googleauth credentials object - # (see the [googleauth docs](https://rubydoc.info/gems/googleauth/Google/Auth/Credentials)) - # * (`Signet::OAuth2::Client`) A signet oauth2 client object - # (see the [signet docs](https://rubydoc.info/gems/signet/Signet/OAuth2/Client)) - # * (`GRPC::Core::Channel`) a gRPC channel with included credentials - # * (`GRPC::Core::ChannelCredentials`) a gRPC credentails object - # * (`nil`) indicating no credentials - # - # @note Warning: Passing a `String` to a keyfile path or a `Hash` of credentials - # is deprecated. Providing an unvalidated credential configuration to - # Google APIs can compromise the security of your systems and data. - # - # @example - # - # # The recommended way to provide credentials is to use the `make_creds` method - # # on the appropriate credentials class for your environment. - # - # require "googleauth" - # - # credentials = ::Google::Auth::ServiceAccountCredentials.make_creds( - # json_key_io: ::File.open("/path/to/keyfile.json") - # ) - # - # client = ::Google::Cloud::Redis::V1beta1::CloudRedis::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 = "redis.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 CloudRedis 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_instances` - # @return [::Gapic::Config::Method] - # - attr_reader :list_instances - ## - # RPC-specific configuration for `get_instance` - # @return [::Gapic::Config::Method] - # - attr_reader :get_instance - ## - # RPC-specific configuration for `get_instance_auth_string` - # @return [::Gapic::Config::Method] - # - attr_reader :get_instance_auth_string - ## - # RPC-specific configuration for `create_instance` - # @return [::Gapic::Config::Method] - # - attr_reader :create_instance - ## - # RPC-specific configuration for `update_instance` - # @return [::Gapic::Config::Method] - # - attr_reader :update_instance - ## - # RPC-specific configuration for `upgrade_instance` - # @return [::Gapic::Config::Method] - # - attr_reader :upgrade_instance - ## - # RPC-specific configuration for `import_instance` - # @return [::Gapic::Config::Method] - # - attr_reader :import_instance - ## - # RPC-specific configuration for `export_instance` - # @return [::Gapic::Config::Method] - # - attr_reader :export_instance - ## - # RPC-specific configuration for `failover_instance` - # @return [::Gapic::Config::Method] - # - attr_reader :failover_instance - ## - # RPC-specific configuration for `delete_instance` - # @return [::Gapic::Config::Method] - # - attr_reader :delete_instance - ## - # RPC-specific configuration for `reschedule_maintenance` - # @return [::Gapic::Config::Method] - # - attr_reader :reschedule_maintenance - - # @private - def initialize parent_rpcs = nil - list_instances_config = parent_rpcs.list_instances if parent_rpcs.respond_to? :list_instances - @list_instances = ::Gapic::Config::Method.new list_instances_config - get_instance_config = parent_rpcs.get_instance if parent_rpcs.respond_to? :get_instance - @get_instance = ::Gapic::Config::Method.new get_instance_config - get_instance_auth_string_config = parent_rpcs.get_instance_auth_string if parent_rpcs.respond_to? :get_instance_auth_string - @get_instance_auth_string = ::Gapic::Config::Method.new get_instance_auth_string_config - create_instance_config = parent_rpcs.create_instance if parent_rpcs.respond_to? :create_instance - @create_instance = ::Gapic::Config::Method.new create_instance_config - update_instance_config = parent_rpcs.update_instance if parent_rpcs.respond_to? :update_instance - @update_instance = ::Gapic::Config::Method.new update_instance_config - upgrade_instance_config = parent_rpcs.upgrade_instance if parent_rpcs.respond_to? :upgrade_instance - @upgrade_instance = ::Gapic::Config::Method.new upgrade_instance_config - import_instance_config = parent_rpcs.import_instance if parent_rpcs.respond_to? :import_instance - @import_instance = ::Gapic::Config::Method.new import_instance_config - export_instance_config = parent_rpcs.export_instance if parent_rpcs.respond_to? :export_instance - @export_instance = ::Gapic::Config::Method.new export_instance_config - failover_instance_config = parent_rpcs.failover_instance if parent_rpcs.respond_to? :failover_instance - @failover_instance = ::Gapic::Config::Method.new failover_instance_config - delete_instance_config = parent_rpcs.delete_instance if parent_rpcs.respond_to? :delete_instance - @delete_instance = ::Gapic::Config::Method.new delete_instance_config - reschedule_maintenance_config = parent_rpcs.reschedule_maintenance if parent_rpcs.respond_to? :reschedule_maintenance - @reschedule_maintenance = ::Gapic::Config::Method.new reschedule_maintenance_config - - yield self if block_given? - end - end - end - end - end - end - end - end -end diff --git a/owl-bot-staging/google-cloud-redis-v1beta1/lib/google/cloud/redis/v1beta1/cloud_redis/credentials.rb b/owl-bot-staging/google-cloud-redis-v1beta1/lib/google/cloud/redis/v1beta1/cloud_redis/credentials.rb deleted file mode 100644 index 149eca45d129..000000000000 --- a/owl-bot-staging/google-cloud-redis-v1beta1/lib/google/cloud/redis/v1beta1/cloud_redis/credentials.rb +++ /dev/null @@ -1,51 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -require "googleauth" - -module Google - module Cloud - module Redis - module V1beta1 - module CloudRedis - # Credentials for the CloudRedis API. - class Credentials < ::Google::Auth::Credentials - self.scope = [ - "https://www.googleapis.com/auth/cloud-platform" - ] - self.env_vars = [ - "REDIS_CREDENTIALS", - "REDIS_KEYFILE", - "GOOGLE_CLOUD_CREDENTIALS", - "GOOGLE_CLOUD_KEYFILE", - "GCLOUD_KEYFILE", - "REDIS_CREDENTIALS_JSON", - "REDIS_KEYFILE_JSON", - "GOOGLE_CLOUD_CREDENTIALS_JSON", - "GOOGLE_CLOUD_KEYFILE_JSON", - "GCLOUD_KEYFILE_JSON" - ] - self.paths = [ - "~/.config/google_cloud/application_default_credentials.json" - ] - end - end - end - end - end -end diff --git a/owl-bot-staging/google-cloud-redis-v1beta1/lib/google/cloud/redis/v1beta1/cloud_redis/operations.rb b/owl-bot-staging/google-cloud-redis-v1beta1/lib/google/cloud/redis/v1beta1/cloud_redis/operations.rb deleted file mode 100644 index 5236a92741fc..000000000000 --- a/owl-bot-staging/google-cloud-redis-v1beta1/lib/google/cloud/redis/v1beta1/cloud_redis/operations.rb +++ /dev/null @@ -1,841 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -require "gapic/operation" -require "google/longrunning/operations_pb" - -module Google - module Cloud - module Redis - module V1beta1 - module CloudRedis - # Service that implements Longrunning Operations API. - class Operations - # @private - API_VERSION = "" - - # @private - DEFAULT_ENDPOINT_TEMPLATE = "redis.$UNIVERSE_DOMAIN$" - - # @private - attr_reader :operations_stub - - ## - # Configuration for the CloudRedis 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 CloudRedis 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::Redis::V1beta1::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::Redis::V1beta1::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::Redis::V1beta1::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::Redis::V1beta1::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::Redis::V1beta1::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 = "redis.googleapis.com" - - config_attr :endpoint, nil, ::String, nil - config_attr :credentials, nil do |value| - allowed = [::String, ::Hash, ::Proc, ::Symbol, ::Google::Auth::Credentials, ::Google::Auth::BaseClient, ::Signet::OAuth2::Client, nil] - allowed += [::GRPC::Core::Channel, ::GRPC::Core::ChannelCredentials] if defined? ::GRPC::Core::Channel - allowed.any? { |klass| klass === value } - end - config_attr :scope, nil, ::String, ::Array, nil - config_attr :lib_name, nil, ::String, nil - config_attr :lib_version, nil, ::String, nil - config_attr(:channel_args, { "grpc.service_config_disable_resolution" => 1 }, ::Hash, nil) - config_attr :interceptors, nil, ::Array, nil - config_attr :timeout, nil, ::Numeric, nil - config_attr :metadata, nil, ::Hash, nil - config_attr :retry_policy, nil, ::Hash, ::Proc, nil - config_attr :quota_project, nil, ::String, nil - config_attr :universe_domain, nil, ::String, nil - config_attr :logger, :default, ::Logger, nil, :default - - # @private - def initialize parent_config = nil - @parent_config = parent_config unless parent_config.nil? - - yield self if block_given? - end - - ## - # Configurations for individual RPCs - # @return [Rpcs] - # - def rpcs - @rpcs ||= begin - parent_rpcs = nil - parent_rpcs = @parent_config.rpcs if defined?(@parent_config) && @parent_config.respond_to?(:rpcs) - Rpcs.new parent_rpcs - end - end - - ## - # Configuration for the channel pool - # @return [::Gapic::ServiceStub::ChannelPool::Configuration] - # - def channel_pool - @channel_pool ||= ::Gapic::ServiceStub::ChannelPool::Configuration.new - end - - ## - # Configuration RPC class for the Operations API. - # - # Includes fields providing the configuration for each RPC in this service. - # Each configuration object is of type `Gapic::Config::Method` and includes - # the following configuration fields: - # - # * `timeout` (*type:* `Numeric`) - The call timeout in seconds - # * `metadata` (*type:* `Hash{Symbol=>String}`) - Additional gRPC headers - # * `retry_policy (*type:* `Hash`) - The retry policy. The policy fields - # include the following keys: - # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds. - # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds. - # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier. - # * `:retry_codes` (*type:* `Array`) - The error codes that should - # trigger a retry. - # - class Rpcs - ## - # RPC-specific configuration for `list_operations` - # @return [::Gapic::Config::Method] - # - attr_reader :list_operations - ## - # RPC-specific configuration for `get_operation` - # @return [::Gapic::Config::Method] - # - attr_reader :get_operation - ## - # RPC-specific configuration for `delete_operation` - # @return [::Gapic::Config::Method] - # - attr_reader :delete_operation - ## - # RPC-specific configuration for `cancel_operation` - # @return [::Gapic::Config::Method] - # - attr_reader :cancel_operation - ## - # RPC-specific configuration for `wait_operation` - # @return [::Gapic::Config::Method] - # - attr_reader :wait_operation - - # @private - def initialize parent_rpcs = nil - list_operations_config = parent_rpcs.list_operations if parent_rpcs.respond_to? :list_operations - @list_operations = ::Gapic::Config::Method.new list_operations_config - get_operation_config = parent_rpcs.get_operation if parent_rpcs.respond_to? :get_operation - @get_operation = ::Gapic::Config::Method.new get_operation_config - delete_operation_config = parent_rpcs.delete_operation if parent_rpcs.respond_to? :delete_operation - @delete_operation = ::Gapic::Config::Method.new delete_operation_config - cancel_operation_config = parent_rpcs.cancel_operation if parent_rpcs.respond_to? :cancel_operation - @cancel_operation = ::Gapic::Config::Method.new cancel_operation_config - wait_operation_config = parent_rpcs.wait_operation if parent_rpcs.respond_to? :wait_operation - @wait_operation = ::Gapic::Config::Method.new wait_operation_config - - yield self if block_given? - end - end - end - end - end - end - end - end -end diff --git a/owl-bot-staging/google-cloud-redis-v1beta1/lib/google/cloud/redis/v1beta1/cloud_redis/paths.rb b/owl-bot-staging/google-cloud-redis-v1beta1/lib/google/cloud/redis/v1beta1/cloud_redis/paths.rb deleted file mode 100644 index ca975d23e644..000000000000 --- a/owl-bot-staging/google-cloud-redis-v1beta1/lib/google/cloud/redis/v1beta1/cloud_redis/paths.rb +++ /dev/null @@ -1,69 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - - -module Google - module Cloud - module Redis - module V1beta1 - module CloudRedis - # Path helper methods for the CloudRedis API. - module Paths - ## - # Create a fully-qualified Instance resource string. - # - # The resource will be in the following format: - # - # `projects/{project}/locations/{location}/instances/{instance}` - # - # @param project [String] - # @param location [String] - # @param instance [String] - # - # @return [::String] - def instance_path project:, location:, instance: - raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" - raise ::ArgumentError, "location cannot contain /" if location.to_s.include? "/" - - "projects/#{project}/locations/#{location}/instances/#{instance}" - 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 - - extend self - end - end - end - end - end -end diff --git a/owl-bot-staging/google-cloud-redis-v1beta1/lib/google/cloud/redis/v1beta1/cloud_redis/rest.rb b/owl-bot-staging/google-cloud-redis-v1beta1/lib/google/cloud/redis/v1beta1/cloud_redis/rest.rb deleted file mode 100644 index 26f9e4025d6a..000000000000 --- a/owl-bot-staging/google-cloud-redis-v1beta1/lib/google/cloud/redis/v1beta1/cloud_redis/rest.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 "gapic/rest" -require "gapic/config" -require "gapic/config/method" - -require "google/cloud/redis/v1beta1/version" - -require "google/cloud/redis/v1beta1/cloud_redis/credentials" -require "google/cloud/redis/v1beta1/cloud_redis/paths" -require "google/cloud/redis/v1beta1/cloud_redis/rest/operations" -require "google/cloud/redis/v1beta1/cloud_redis/rest/client" - -module Google - module Cloud - module Redis - module V1beta1 - ## - # Configures and manages Cloud Memorystore for Redis instances - # - # Google Cloud Memorystore for Redis v1beta1 - # - # The `redis.googleapis.com` service implements the Google Cloud Memorystore - # for Redis API and defines the following resource model for managing Redis - # instances: - # * The service works with a collection of cloud projects, named: `/projects/*` - # * Each project has a collection of available locations, named: `/locations/*` - # * Each location has a collection of Redis instances, named: `/instances/*` - # * As such, Redis instances are resources of the form: - # `/projects/{project_id}/locations/{location_id}/instances/{instance_id}` - # - # Note that location_id must be referring to a GCP `region`; for example: - # * `projects/redpepper-1290/locations/us-central1/instances/my-redis` - # - # To load this service and instantiate a REST client: - # - # require "google/cloud/redis/v1beta1/cloud_redis/rest" - # client = ::Google::Cloud::Redis::V1beta1::CloudRedis::Rest::Client.new - # - module CloudRedis - # Client for the REST transport - module Rest - end - end - end - end - end -end - -helper_path = ::File.join __dir__, "rest", "helpers.rb" -require "google/cloud/redis/v1beta1/cloud_redis/rest/helpers" if ::File.file? helper_path diff --git a/owl-bot-staging/google-cloud-redis-v1beta1/lib/google/cloud/redis/v1beta1/cloud_redis/rest/client.rb b/owl-bot-staging/google-cloud-redis-v1beta1/lib/google/cloud/redis/v1beta1/cloud_redis/rest/client.rb deleted file mode 100644 index 2b297cc75ede..000000000000 --- a/owl-bot-staging/google-cloud-redis-v1beta1/lib/google/cloud/redis/v1beta1/cloud_redis/rest/client.rb +++ /dev/null @@ -1,1509 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -require "google/cloud/errors" -require "google/cloud/redis/v1beta1/cloud_redis_pb" -require "google/cloud/redis/v1beta1/cloud_redis/rest/service_stub" - -module Google - module Cloud - module Redis - module V1beta1 - module CloudRedis - module Rest - ## - # REST client for the CloudRedis service. - # - # Configures and manages Cloud Memorystore for Redis instances - # - # Google Cloud Memorystore for Redis v1beta1 - # - # The `redis.googleapis.com` service implements the Google Cloud Memorystore - # for Redis API and defines the following resource model for managing Redis - # instances: - # * The service works with a collection of cloud projects, named: `/projects/*` - # * Each project has a collection of available locations, named: `/locations/*` - # * Each location has a collection of Redis instances, named: `/instances/*` - # * As such, Redis instances are resources of the form: - # `/projects/{project_id}/locations/{location_id}/instances/{instance_id}` - # - # Note that location_id must be referring to a GCP `region`; for example: - # * `projects/redpepper-1290/locations/us-central1/instances/my-redis` - # - class Client - # @private - API_VERSION = "" - - # @private - DEFAULT_ENDPOINT_TEMPLATE = "redis.$UNIVERSE_DOMAIN$" - - include Paths - - # @private - attr_reader :cloud_redis_stub - - ## - # Configure the CloudRedis Client class. - # - # See {::Google::Cloud::Redis::V1beta1::CloudRedis::Rest::Client::Configuration} - # for a description of the configuration fields. - # - # @example - # - # # Modify the configuration for all CloudRedis clients - # ::Google::Cloud::Redis::V1beta1::CloudRedis::Rest::Client.configure do |config| - # config.timeout = 10.0 - # end - # - # @yield [config] Configure the Client client. - # @yieldparam config [Client::Configuration] - # - # @return [Client::Configuration] - # - def self.configure - @configure ||= begin - namespace = ["Google", "Cloud", "Redis", "V1beta1"] - parent_config = while namespace.any? - parent_name = namespace.join "::" - parent_const = const_get parent_name - break parent_const.configure if parent_const.respond_to? :configure - namespace.pop - end - default_config = Client::Configuration.new parent_config - - default_config.rpcs.list_instances.timeout = 600.0 - - default_config.rpcs.get_instance.timeout = 600.0 - - default_config.rpcs.get_instance_auth_string.timeout = 600.0 - - default_config.rpcs.create_instance.timeout = 600.0 - - default_config.rpcs.update_instance.timeout = 600.0 - - default_config.rpcs.upgrade_instance.timeout = 600.0 - - default_config.rpcs.import_instance.timeout = 600.0 - - default_config.rpcs.export_instance.timeout = 600.0 - - default_config.rpcs.failover_instance.timeout = 600.0 - - default_config.rpcs.delete_instance.timeout = 600.0 - - default_config - end - yield @configure if block_given? - @configure - end - - ## - # Configure the CloudRedis Client instance. - # - # The configuration is set to the derived mode, meaning that values can be changed, - # but structural changes (adding new fields, etc.) are not allowed. Structural changes - # should be made on {Client.configure}. - # - # See {::Google::Cloud::Redis::V1beta1::CloudRedis::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 - @cloud_redis_stub.universe_domain - end - - ## - # Create a new CloudRedis REST client object. - # - # @example - # - # # Create a client using the default configuration - # client = ::Google::Cloud::Redis::V1beta1::CloudRedis::Rest::Client.new - # - # # Create a client using a custom configuration - # client = ::Google::Cloud::Redis::V1beta1::CloudRedis::Rest::Client.new do |config| - # config.timeout = 10.0 - # end - # - # @yield [config] Configure the CloudRedis client. - # @yieldparam config [Client::Configuration] - # - def initialize - # Create the configuration object - @config = Configuration.new Client.configure - - # Yield the configuration if needed - yield @config if block_given? - - # Create credentials - credentials = @config.credentials - # Use self-signed JWT if the endpoint is unchanged from default, - # but only if the default endpoint does not have a region prefix. - enable_self_signed_jwt = @config.endpoint.nil? || - (@config.endpoint == Configuration::DEFAULT_ENDPOINT && - !@config.endpoint.split(".").first.include?("-")) - credentials ||= Credentials.default scope: @config.scope, - enable_self_signed_jwt: enable_self_signed_jwt - if credentials.is_a?(::String) || credentials.is_a?(::Hash) - credentials = Credentials.new credentials, scope: @config.scope - end - - @quota_project_id = @config.quota_project - @quota_project_id ||= credentials.quota_project_id if credentials.respond_to? :quota_project_id - - @operations_client = ::Google::Cloud::Redis::V1beta1::CloudRedis::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 - - @cloud_redis_stub = ::Google::Cloud::Redis::V1beta1::CloudRedis::Rest::ServiceStub.new( - endpoint: @config.endpoint, - endpoint_template: DEFAULT_ENDPOINT_TEMPLATE, - universe_domain: @config.universe_domain, - credentials: credentials, - logger: @config.logger - ) - - @cloud_redis_stub.logger(stub: true)&.info do |entry| - entry.set_system_name - entry.set_service - entry.message = "Created client for #{entry.service}" - entry.set_credentials_fields credentials - entry.set "customEndpoint", @config.endpoint if @config.endpoint - entry.set "defaultTimeout", @config.timeout if @config.timeout - entry.set "quotaProject", @quota_project_id if @quota_project_id - end - end - - ## - # Get the associated client for long-running operations. - # - # @return [::Google::Cloud::Redis::V1beta1::CloudRedis::Rest::Operations] - # - attr_reader :operations_client - - ## - # The logger used for request/response debug logging. - # - # @return [Logger] - # - def logger - @cloud_redis_stub.logger - end - - # Service calls - - ## - # Lists all Redis instances owned by a project in either the specified - # location (region) or all locations. - # - # The location should have the following format: - # - # * `projects/{project_id}/locations/{location_id}` - # - # If `location_id` is specified as `-` (wildcard), then all regions - # available to the project are queried, and the results are aggregated. - # - # @overload list_instances(request, options = nil) - # Pass arguments to `list_instances` via a request object, either of type - # {::Google::Cloud::Redis::V1beta1::ListInstancesRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Redis::V1beta1::ListInstancesRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_instances(parent: nil, page_size: nil, page_token: nil) - # Pass arguments to `list_instances` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param parent [::String] - # Required. The resource name of the instance location using the form: - # `projects/{project_id}/locations/{location_id}` - # where `location_id` refers to a GCP region. - # @param page_size [::Integer] - # The maximum number of items to return. - # - # If not specified, a default value of 1000 will be used by the service. - # Regardless of the page_size value, the response may include a partial list - # and a caller should only rely on response's - # {::Google::Cloud::Redis::V1beta1::ListInstancesResponse#next_page_token `next_page_token`} - # to determine if there are more instances left to be queried. - # @param page_token [::String] - # The `next_page_token` value returned from a previous - # {::Google::Cloud::Redis::V1beta1::CloudRedis::Rest::Client#list_instances ListInstances} request, if any. - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Gapic::Rest::PagedEnumerable<::Google::Cloud::Redis::V1beta1::Instance>] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Gapic::Rest::PagedEnumerable<::Google::Cloud::Redis::V1beta1::Instance>] - # - # @raise [::Google::Cloud::Error] if the REST call is aborted. - # - # @example Basic example - # require "google/cloud/redis/v1beta1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Redis::V1beta1::CloudRedis::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Redis::V1beta1::ListInstancesRequest.new - # - # # Call the list_instances method. - # result = client.list_instances request - # - # # The returned object is of type Gapic::PagedEnumerable. You can iterate - # # over elements, and API calls will be issued to fetch pages as needed. - # result.each do |item| - # # Each element is of type ::Google::Cloud::Redis::V1beta1::Instance. - # p item - # end - # - def list_instances request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Redis::V1beta1::ListInstancesRequest - - # Converts hash 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_instances.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::Redis::V1beta1::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_instances.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.list_instances.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @cloud_redis_stub.list_instances request, options do |result, operation| - result = ::Gapic::Rest::PagedEnumerable.new @cloud_redis_stub, :list_instances, "instances", 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 details of a specific Redis instance. - # - # @overload get_instance(request, options = nil) - # Pass arguments to `get_instance` via a request object, either of type - # {::Google::Cloud::Redis::V1beta1::GetInstanceRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Redis::V1beta1::GetInstanceRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_instance(name: nil) - # Pass arguments to `get_instance` via keyword arguments. Note that at - # least one keyword argument is 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. Redis instance resource name using the form: - # `projects/{project_id}/locations/{location_id}/instances/{instance_id}` - # where `location_id` refers to a GCP region. - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Cloud::Redis::V1beta1::Instance] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::Redis::V1beta1::Instance] - # - # @raise [::Google::Cloud::Error] if the REST call is aborted. - # - # @example Basic example - # require "google/cloud/redis/v1beta1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Redis::V1beta1::CloudRedis::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Redis::V1beta1::GetInstanceRequest.new - # - # # Call the get_instance method. - # result = client.get_instance request - # - # # The returned object is of type Google::Cloud::Redis::V1beta1::Instance. - # p result - # - def get_instance request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Redis::V1beta1::GetInstanceRequest - - # Converts hash 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_instance.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::Redis::V1beta1::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_instance.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.get_instance.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @cloud_redis_stub.get_instance request, options do |result, operation| - yield result, operation if block_given? - end - rescue ::Gapic::Rest::Error => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Gets the AUTH string for a Redis instance. If AUTH is not enabled for the - # instance the response will be empty. This information is not included in - # the details returned to GetInstance. - # - # @overload get_instance_auth_string(request, options = nil) - # Pass arguments to `get_instance_auth_string` via a request object, either of type - # {::Google::Cloud::Redis::V1beta1::GetInstanceAuthStringRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Redis::V1beta1::GetInstanceAuthStringRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_instance_auth_string(name: nil) - # Pass arguments to `get_instance_auth_string` via keyword arguments. Note that at - # least one keyword argument is 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. Redis instance resource name using the form: - # `projects/{project_id}/locations/{location_id}/instances/{instance_id}` - # where `location_id` refers to a GCP region. - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Cloud::Redis::V1beta1::InstanceAuthString] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::Redis::V1beta1::InstanceAuthString] - # - # @raise [::Google::Cloud::Error] if the REST call is aborted. - # - # @example Basic example - # require "google/cloud/redis/v1beta1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Redis::V1beta1::CloudRedis::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Redis::V1beta1::GetInstanceAuthStringRequest.new - # - # # Call the get_instance_auth_string method. - # result = client.get_instance_auth_string request - # - # # The returned object is of type Google::Cloud::Redis::V1beta1::InstanceAuthString. - # p result - # - def get_instance_auth_string request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Redis::V1beta1::GetInstanceAuthStringRequest - - # Converts hash 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_instance_auth_string.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::Redis::V1beta1::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_instance_auth_string.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.get_instance_auth_string.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @cloud_redis_stub.get_instance_auth_string request, options do |result, operation| - yield result, operation if block_given? - end - rescue ::Gapic::Rest::Error => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Creates a Redis instance based on the specified tier and memory size. - # - # By default, the instance is accessible from the project's - # [default network](https://cloud.google.com/vpc/docs/vpc). - # - # The creation is executed asynchronously and callers may check the returned - # operation to track its progress. Once the operation is completed the Redis - # instance will be fully functional. The completed longrunning.Operation will - # contain the new instance object in the response field. - # - # The returned operation is automatically deleted after a few hours, so there - # is no need to call DeleteOperation. - # - # @overload create_instance(request, options = nil) - # Pass arguments to `create_instance` via a request object, either of type - # {::Google::Cloud::Redis::V1beta1::CreateInstanceRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Redis::V1beta1::CreateInstanceRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_instance(parent: nil, instance_id: nil, instance: nil) - # Pass arguments to `create_instance` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param parent [::String] - # Required. The resource name of the instance location using the form: - # `projects/{project_id}/locations/{location_id}` - # where `location_id` refers to a GCP region. - # @param instance_id [::String] - # Required. The logical name of the Redis instance in the customer project - # with the following restrictions: - # - # * Must contain only lowercase letters, numbers, and hyphens. - # * Must start with a letter. - # * Must be between 1-40 characters. - # * Must end with a number or a letter. - # * Must be unique within the customer project / location - # @param instance [::Google::Cloud::Redis::V1beta1::Instance, ::Hash] - # Required. A Redis [Instance] 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/cloud/redis/v1beta1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Redis::V1beta1::CloudRedis::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Redis::V1beta1::CreateInstanceRequest.new - # - # # Call the create_instance method. - # result = client.create_instance 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_instance request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Redis::V1beta1::CreateInstanceRequest - - # Converts hash 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_instance.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::Redis::V1beta1::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_instance.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.create_instance.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @cloud_redis_stub.create_instance 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 - - ## - # Updates the metadata and configuration of a specific Redis instance. - # - # Completed longrunning.Operation will contain the new instance object - # in the response field. The returned operation is automatically deleted - # after a few hours, so there is no need to call DeleteOperation. - # - # @overload update_instance(request, options = nil) - # Pass arguments to `update_instance` via a request object, either of type - # {::Google::Cloud::Redis::V1beta1::UpdateInstanceRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Redis::V1beta1::UpdateInstanceRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_instance(update_mask: nil, instance: nil) - # Pass arguments to `update_instance` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param update_mask [::Google::Protobuf::FieldMask, ::Hash] - # Required. Mask of fields to update. At least one path must be supplied in - # this field. The elements of the repeated paths field may only include these - # fields from {::Google::Cloud::Redis::V1beta1::Instance Instance}: - # - # * `displayName` - # * `labels` - # * `memorySizeGb` - # * `redisConfig` - # * `replica_count` - # @param instance [::Google::Cloud::Redis::V1beta1::Instance, ::Hash] - # Required. Update description. - # Only fields specified in update_mask are updated. - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Gapic::Operation] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Gapic::Operation] - # - # @raise [::Google::Cloud::Error] if the REST call is aborted. - # - # @example Basic example - # require "google/cloud/redis/v1beta1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Redis::V1beta1::CloudRedis::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Redis::V1beta1::UpdateInstanceRequest.new - # - # # Call the update_instance method. - # result = client.update_instance 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_instance request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Redis::V1beta1::UpdateInstanceRequest - - # Converts hash 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_instance.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::Redis::V1beta1::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_instance.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.update_instance.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @cloud_redis_stub.update_instance 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 - - ## - # Upgrades Redis instance to the newer Redis version specified in the - # request. - # - # @overload upgrade_instance(request, options = nil) - # Pass arguments to `upgrade_instance` via a request object, either of type - # {::Google::Cloud::Redis::V1beta1::UpgradeInstanceRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Redis::V1beta1::UpgradeInstanceRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @overload upgrade_instance(name: nil, redis_version: nil) - # Pass arguments to `upgrade_instance` via keyword arguments. Note that at - # least one keyword argument is 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. Redis instance resource name using the form: - # `projects/{project_id}/locations/{location_id}/instances/{instance_id}` - # where `location_id` refers to a GCP region. - # @param redis_version [::String] - # Required. Specifies the target version of Redis software to upgrade to. - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Gapic::Operation] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Gapic::Operation] - # - # @raise [::Google::Cloud::Error] if the REST call is aborted. - # - # @example Basic example - # require "google/cloud/redis/v1beta1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Redis::V1beta1::CloudRedis::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Redis::V1beta1::UpgradeInstanceRequest.new - # - # # Call the upgrade_instance method. - # result = client.upgrade_instance 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 upgrade_instance request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Redis::V1beta1::UpgradeInstanceRequest - - # Converts hash 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.upgrade_instance.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::Redis::V1beta1::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.upgrade_instance.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.upgrade_instance.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @cloud_redis_stub.upgrade_instance 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 - - ## - # Import a Redis RDB snapshot file from Cloud Storage into a Redis instance. - # - # Redis may stop serving during this operation. Instance state will be - # IMPORTING for entire operation. When complete, the instance will contain - # only data from the imported file. - # - # The returned operation is automatically deleted after a few hours, so - # there is no need to call DeleteOperation. - # - # @overload import_instance(request, options = nil) - # Pass arguments to `import_instance` via a request object, either of type - # {::Google::Cloud::Redis::V1beta1::ImportInstanceRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Redis::V1beta1::ImportInstanceRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @overload import_instance(name: nil, input_config: nil) - # Pass arguments to `import_instance` via keyword arguments. Note that at - # least one keyword argument is 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. Redis instance resource name using the form: - # `projects/{project_id}/locations/{location_id}/instances/{instance_id}` - # where `location_id` refers to a GCP region. - # @param input_config [::Google::Cloud::Redis::V1beta1::InputConfig, ::Hash] - # Required. Specify data to be imported. - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Gapic::Operation] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Gapic::Operation] - # - # @raise [::Google::Cloud::Error] if the REST call is aborted. - # - # @example Basic example - # require "google/cloud/redis/v1beta1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Redis::V1beta1::CloudRedis::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Redis::V1beta1::ImportInstanceRequest.new - # - # # Call the import_instance method. - # result = client.import_instance 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 import_instance request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Redis::V1beta1::ImportInstanceRequest - - # Converts hash 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.import_instance.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::Redis::V1beta1::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.import_instance.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.import_instance.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @cloud_redis_stub.import_instance 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 - - ## - # Export Redis instance data into a Redis RDB format file in Cloud Storage. - # - # Redis will continue serving during this operation. - # - # The returned operation is automatically deleted after a few hours, so - # there is no need to call DeleteOperation. - # - # @overload export_instance(request, options = nil) - # Pass arguments to `export_instance` via a request object, either of type - # {::Google::Cloud::Redis::V1beta1::ExportInstanceRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Redis::V1beta1::ExportInstanceRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @overload export_instance(name: nil, output_config: nil) - # Pass arguments to `export_instance` via keyword arguments. Note that at - # least one keyword argument is 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. Redis instance resource name using the form: - # `projects/{project_id}/locations/{location_id}/instances/{instance_id}` - # where `location_id` refers to a GCP region. - # @param output_config [::Google::Cloud::Redis::V1beta1::OutputConfig, ::Hash] - # Required. Specify data to be exported. - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Gapic::Operation] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Gapic::Operation] - # - # @raise [::Google::Cloud::Error] if the REST call is aborted. - # - # @example Basic example - # require "google/cloud/redis/v1beta1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Redis::V1beta1::CloudRedis::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Redis::V1beta1::ExportInstanceRequest.new - # - # # Call the export_instance method. - # result = client.export_instance 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 export_instance request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Redis::V1beta1::ExportInstanceRequest - - # Converts hash 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.export_instance.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::Redis::V1beta1::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.export_instance.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.export_instance.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @cloud_redis_stub.export_instance 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 - - ## - # Initiates a failover of the primary node to current replica node for a - # specific STANDARD tier Cloud Memorystore for Redis instance. - # - # @overload failover_instance(request, options = nil) - # Pass arguments to `failover_instance` via a request object, either of type - # {::Google::Cloud::Redis::V1beta1::FailoverInstanceRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Redis::V1beta1::FailoverInstanceRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @overload failover_instance(name: nil, data_protection_mode: nil) - # Pass arguments to `failover_instance` via keyword arguments. Note that at - # least one keyword argument is 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. Redis instance resource name using the form: - # `projects/{project_id}/locations/{location_id}/instances/{instance_id}` - # where `location_id` refers to a GCP region. - # @param data_protection_mode [::Google::Cloud::Redis::V1beta1::FailoverInstanceRequest::DataProtectionMode] - # Optional. Available data protection modes that the user can choose. If it's - # unspecified, data protection mode will be LIMITED_DATA_LOSS by default. - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Gapic::Operation] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Gapic::Operation] - # - # @raise [::Google::Cloud::Error] if the REST call is aborted. - # - # @example Basic example - # require "google/cloud/redis/v1beta1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Redis::V1beta1::CloudRedis::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Redis::V1beta1::FailoverInstanceRequest.new - # - # # Call the failover_instance method. - # result = client.failover_instance 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 failover_instance request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Redis::V1beta1::FailoverInstanceRequest - - # Converts hash 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.failover_instance.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::Redis::V1beta1::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.failover_instance.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.failover_instance.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @cloud_redis_stub.failover_instance 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 specific Redis instance. Instance stops serving and data is - # deleted. - # - # @overload delete_instance(request, options = nil) - # Pass arguments to `delete_instance` via a request object, either of type - # {::Google::Cloud::Redis::V1beta1::DeleteInstanceRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Redis::V1beta1::DeleteInstanceRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_instance(name: nil) - # Pass arguments to `delete_instance` via keyword arguments. Note that at - # least one keyword argument is 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. Redis instance resource name using the form: - # `projects/{project_id}/locations/{location_id}/instances/{instance_id}` - # where `location_id` refers to a GCP region. - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Gapic::Operation] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Gapic::Operation] - # - # @raise [::Google::Cloud::Error] if the REST call is aborted. - # - # @example Basic example - # require "google/cloud/redis/v1beta1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Redis::V1beta1::CloudRedis::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Redis::V1beta1::DeleteInstanceRequest.new - # - # # Call the delete_instance method. - # result = client.delete_instance 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_instance request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Redis::V1beta1::DeleteInstanceRequest - - # Converts hash 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_instance.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::Redis::V1beta1::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_instance.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.delete_instance.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @cloud_redis_stub.delete_instance 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 - - ## - # Reschedule maintenance for a given instance in a given project and - # location. - # - # @overload reschedule_maintenance(request, options = nil) - # Pass arguments to `reschedule_maintenance` via a request object, either of type - # {::Google::Cloud::Redis::V1beta1::RescheduleMaintenanceRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Redis::V1beta1::RescheduleMaintenanceRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @overload reschedule_maintenance(name: nil, reschedule_type: nil, schedule_time: nil) - # Pass arguments to `reschedule_maintenance` via keyword arguments. Note that at - # least one keyword argument is 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. Redis instance resource name using the form: - # `projects/{project_id}/locations/{location_id}/instances/{instance_id}` - # where `location_id` refers to a GCP region. - # @param reschedule_type [::Google::Cloud::Redis::V1beta1::RescheduleMaintenanceRequest::RescheduleType] - # Required. If reschedule type is SPECIFIC_TIME, must set up schedule_time as well. - # @param schedule_time [::Google::Protobuf::Timestamp, ::Hash] - # Optional. Timestamp when the maintenance shall be rescheduled to if - # reschedule_type=SPECIFIC_TIME, in RFC 3339 format, for - # example `2012-11-15T16:19:00.094Z`. - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Gapic::Operation] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Gapic::Operation] - # - # @raise [::Google::Cloud::Error] if the REST call is aborted. - # - # @example Basic example - # require "google/cloud/redis/v1beta1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Redis::V1beta1::CloudRedis::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Redis::V1beta1::RescheduleMaintenanceRequest.new - # - # # Call the reschedule_maintenance method. - # result = client.reschedule_maintenance 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 reschedule_maintenance request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Redis::V1beta1::RescheduleMaintenanceRequest - - # Converts hash 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.reschedule_maintenance.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::Redis::V1beta1::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.reschedule_maintenance.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.reschedule_maintenance.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @cloud_redis_stub.reschedule_maintenance 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 - - ## - # Configuration class for the CloudRedis REST API. - # - # This class represents the configuration for CloudRedis REST, - # providing control over timeouts, retry behavior, logging, transport - # parameters, and other low-level controls. Certain parameters can also be - # applied individually to specific RPCs. See - # {::Google::Cloud::Redis::V1beta1::CloudRedis::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_instances to 20 seconds, - # # and all remaining timeouts to 10 seconds. - # ::Google::Cloud::Redis::V1beta1::CloudRedis::Rest::Client.configure do |config| - # config.timeout = 10.0 - # config.rpcs.list_instances.timeout = 20.0 - # end - # - # # Apply the above configuration only to a new client. - # client = ::Google::Cloud::Redis::V1beta1::CloudRedis::Rest::Client.new do |config| - # config.timeout = 10.0 - # config.rpcs.list_instances.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 = "redis.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 CloudRedis 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_instances` - # @return [::Gapic::Config::Method] - # - attr_reader :list_instances - ## - # RPC-specific configuration for `get_instance` - # @return [::Gapic::Config::Method] - # - attr_reader :get_instance - ## - # RPC-specific configuration for `get_instance_auth_string` - # @return [::Gapic::Config::Method] - # - attr_reader :get_instance_auth_string - ## - # RPC-specific configuration for `create_instance` - # @return [::Gapic::Config::Method] - # - attr_reader :create_instance - ## - # RPC-specific configuration for `update_instance` - # @return [::Gapic::Config::Method] - # - attr_reader :update_instance - ## - # RPC-specific configuration for `upgrade_instance` - # @return [::Gapic::Config::Method] - # - attr_reader :upgrade_instance - ## - # RPC-specific configuration for `import_instance` - # @return [::Gapic::Config::Method] - # - attr_reader :import_instance - ## - # RPC-specific configuration for `export_instance` - # @return [::Gapic::Config::Method] - # - attr_reader :export_instance - ## - # RPC-specific configuration for `failover_instance` - # @return [::Gapic::Config::Method] - # - attr_reader :failover_instance - ## - # RPC-specific configuration for `delete_instance` - # @return [::Gapic::Config::Method] - # - attr_reader :delete_instance - ## - # RPC-specific configuration for `reschedule_maintenance` - # @return [::Gapic::Config::Method] - # - attr_reader :reschedule_maintenance - - # @private - def initialize parent_rpcs = nil - list_instances_config = parent_rpcs.list_instances if parent_rpcs.respond_to? :list_instances - @list_instances = ::Gapic::Config::Method.new list_instances_config - get_instance_config = parent_rpcs.get_instance if parent_rpcs.respond_to? :get_instance - @get_instance = ::Gapic::Config::Method.new get_instance_config - get_instance_auth_string_config = parent_rpcs.get_instance_auth_string if parent_rpcs.respond_to? :get_instance_auth_string - @get_instance_auth_string = ::Gapic::Config::Method.new get_instance_auth_string_config - create_instance_config = parent_rpcs.create_instance if parent_rpcs.respond_to? :create_instance - @create_instance = ::Gapic::Config::Method.new create_instance_config - update_instance_config = parent_rpcs.update_instance if parent_rpcs.respond_to? :update_instance - @update_instance = ::Gapic::Config::Method.new update_instance_config - upgrade_instance_config = parent_rpcs.upgrade_instance if parent_rpcs.respond_to? :upgrade_instance - @upgrade_instance = ::Gapic::Config::Method.new upgrade_instance_config - import_instance_config = parent_rpcs.import_instance if parent_rpcs.respond_to? :import_instance - @import_instance = ::Gapic::Config::Method.new import_instance_config - export_instance_config = parent_rpcs.export_instance if parent_rpcs.respond_to? :export_instance - @export_instance = ::Gapic::Config::Method.new export_instance_config - failover_instance_config = parent_rpcs.failover_instance if parent_rpcs.respond_to? :failover_instance - @failover_instance = ::Gapic::Config::Method.new failover_instance_config - delete_instance_config = parent_rpcs.delete_instance if parent_rpcs.respond_to? :delete_instance - @delete_instance = ::Gapic::Config::Method.new delete_instance_config - reschedule_maintenance_config = parent_rpcs.reschedule_maintenance if parent_rpcs.respond_to? :reschedule_maintenance - @reschedule_maintenance = ::Gapic::Config::Method.new reschedule_maintenance_config - - yield self if block_given? - end - end - end - end - end - end - end - end - end -end diff --git a/owl-bot-staging/google-cloud-redis-v1beta1/lib/google/cloud/redis/v1beta1/cloud_redis/rest/operations.rb b/owl-bot-staging/google-cloud-redis-v1beta1/lib/google/cloud/redis/v1beta1/cloud_redis/rest/operations.rb deleted file mode 100644 index 9a3cf4b317e2..000000000000 --- a/owl-bot-staging/google-cloud-redis-v1beta1/lib/google/cloud/redis/v1beta1/cloud_redis/rest/operations.rb +++ /dev/null @@ -1,924 +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 Cloud - module Redis - module V1beta1 - module CloudRedis - module Rest - # Service that implements Longrunning Operations API. - class Operations - # @private - API_VERSION = "" - - # @private - DEFAULT_ENDPOINT_TEMPLATE = "redis.$UNIVERSE_DOMAIN$" - - # @private - attr_reader :operations_stub - - ## - # Configuration for the CloudRedis 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 CloudRedis 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::Redis::V1beta1::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::Redis::V1beta1::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::Redis::V1beta1::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::Redis::V1beta1::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 = "redis.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: "/v1beta1/{name}/operations", - matches: [ - ["name", %r{^projects/[^/]+/locations/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the get_operation REST call - # - # @param request_pb [::Google::Longrunning::GetOperationRequest] - # A request object representing the call parameters. Required. - # @return [Array(String, [String, nil], Hash{String => String})] - # Uri, Body, Query string parameters - def self.transcode_get_operation_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :get, - uri_template: "/v1beta1/{name}", - matches: [ - ["name", %r{^projects/[^/]+/locations/[^/]+/operations/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the delete_operation REST call - # - # @param request_pb [::Google::Longrunning::DeleteOperationRequest] - # A request object representing the call parameters. Required. - # @return [Array(String, [String, nil], Hash{String => String})] - # Uri, Body, Query string parameters - def self.transcode_delete_operation_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :delete, - uri_template: "/v1beta1/{name}", - matches: [ - ["name", %r{^projects/[^/]+/locations/[^/]+/operations/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the cancel_operation REST call - # - # @param request_pb [::Google::Longrunning::CancelOperationRequest] - # A request object representing the call parameters. Required. - # @return [Array(String, [String, nil], Hash{String => String})] - # Uri, Body, Query string parameters - def self.transcode_cancel_operation_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :post, - uri_template: "/v1beta1/{name}:cancel", - matches: [ - ["name", %r{^projects/[^/]+/locations/[^/]+/operations/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - end - end - end - end - end - end -end diff --git a/owl-bot-staging/google-cloud-redis-v1beta1/lib/google/cloud/redis/v1beta1/cloud_redis/rest/service_stub.rb b/owl-bot-staging/google-cloud-redis-v1beta1/lib/google/cloud/redis/v1beta1/cloud_redis/rest/service_stub.rb deleted file mode 100644 index ff11c8a384e4..000000000000 --- a/owl-bot-staging/google-cloud-redis-v1beta1/lib/google/cloud/redis/v1beta1/cloud_redis/rest/service_stub.rb +++ /dev/null @@ -1,759 +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/redis/v1beta1/cloud_redis_pb" - -module Google - module Cloud - module Redis - module V1beta1 - module CloudRedis - module Rest - ## - # REST service stub for the CloudRedis service. - # Service stub contains baseline method implementations - # including transcoding, making the REST call, and deserialing the response. - # - class ServiceStub - # @private - def initialize endpoint:, endpoint_template:, universe_domain:, credentials:, logger: - # These require statements are intentionally placed here to initialize - # the REST modules only when it's required. - require "gapic/rest" - - @client_stub = ::Gapic::Rest::ClientStub.new endpoint: endpoint, - endpoint_template: endpoint_template, - universe_domain: universe_domain, - credentials: credentials, - numeric_enums: true, - service_name: self.class, - raise_faraday_errors: false, - logger: logger - end - - ## - # The effective universe domain - # - # @return [String] - # - def universe_domain - @client_stub.universe_domain - end - - ## - # The effective endpoint - # - # @return [String] - # - def endpoint - @client_stub.endpoint - end - - ## - # The logger used for request/response debug logging. - # - # @return [Logger] - # - def logger stub: false - stub ? @client_stub.stub_logger : @client_stub.logger - end - - ## - # Baseline implementation for the list_instances REST call - # - # @param request_pb [::Google::Cloud::Redis::V1beta1::ListInstancesRequest] - # A request object representing the call parameters. Required. - # @param options [::Gapic::CallOptions] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Cloud::Redis::V1beta1::ListInstancesResponse] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::Redis::V1beta1::ListInstancesResponse] - # A result object deserialized from the server's reply - def list_instances request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_list_instances_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_instances", - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Cloud::Redis::V1beta1::ListInstancesResponse.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_instance REST call - # - # @param request_pb [::Google::Cloud::Redis::V1beta1::GetInstanceRequest] - # A request object representing the call parameters. Required. - # @param options [::Gapic::CallOptions] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Cloud::Redis::V1beta1::Instance] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::Redis::V1beta1::Instance] - # A result object deserialized from the server's reply - def get_instance request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_get_instance_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_instance", - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Cloud::Redis::V1beta1::Instance.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_instance_auth_string REST call - # - # @param request_pb [::Google::Cloud::Redis::V1beta1::GetInstanceAuthStringRequest] - # A request object representing the call parameters. Required. - # @param options [::Gapic::CallOptions] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Cloud::Redis::V1beta1::InstanceAuthString] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::Redis::V1beta1::InstanceAuthString] - # A result object deserialized from the server's reply - def get_instance_auth_string request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_get_instance_auth_string_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_instance_auth_string", - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Cloud::Redis::V1beta1::InstanceAuthString.decode_json response.body, ignore_unknown_fields: true - catch :response do - yield result, operation if block_given? - result - end - end - - ## - # Baseline implementation for the create_instance REST call - # - # @param request_pb [::Google::Cloud::Redis::V1beta1::CreateInstanceRequest] - # 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_instance request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_create_instance_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_instance", - 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 update_instance REST call - # - # @param request_pb [::Google::Cloud::Redis::V1beta1::UpdateInstanceRequest] - # 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_instance request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_update_instance_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_instance", - 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 upgrade_instance REST call - # - # @param request_pb [::Google::Cloud::Redis::V1beta1::UpgradeInstanceRequest] - # 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 upgrade_instance request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_upgrade_instance_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: "upgrade_instance", - 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 import_instance REST call - # - # @param request_pb [::Google::Cloud::Redis::V1beta1::ImportInstanceRequest] - # 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 import_instance request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_import_instance_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: "import_instance", - 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 export_instance REST call - # - # @param request_pb [::Google::Cloud::Redis::V1beta1::ExportInstanceRequest] - # 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 export_instance request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_export_instance_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: "export_instance", - 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 failover_instance REST call - # - # @param request_pb [::Google::Cloud::Redis::V1beta1::FailoverInstanceRequest] - # 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 failover_instance request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_failover_instance_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: "failover_instance", - 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_instance REST call - # - # @param request_pb [::Google::Cloud::Redis::V1beta1::DeleteInstanceRequest] - # 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_instance request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_delete_instance_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_instance", - 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 reschedule_maintenance REST call - # - # @param request_pb [::Google::Cloud::Redis::V1beta1::RescheduleMaintenanceRequest] - # 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 reschedule_maintenance request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_reschedule_maintenance_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: "reschedule_maintenance", - 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 - - ## - # @private - # - # GRPC transcoding helper method for the list_instances REST call - # - # @param request_pb [::Google::Cloud::Redis::V1beta1::ListInstancesRequest] - # 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_instances_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :get, - uri_template: "/v1beta1/{parent}/instances", - matches: [ - ["parent", %r{^projects/[^/]+/locations/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the get_instance REST call - # - # @param request_pb [::Google::Cloud::Redis::V1beta1::GetInstanceRequest] - # 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_instance_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :get, - uri_template: "/v1beta1/{name}", - matches: [ - ["name", %r{^projects/[^/]+/locations/[^/]+/instances/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the get_instance_auth_string REST call - # - # @param request_pb [::Google::Cloud::Redis::V1beta1::GetInstanceAuthStringRequest] - # 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_instance_auth_string_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :get, - uri_template: "/v1beta1/{name}/authString", - matches: [ - ["name", %r{^projects/[^/]+/locations/[^/]+/instances/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the create_instance REST call - # - # @param request_pb [::Google::Cloud::Redis::V1beta1::CreateInstanceRequest] - # 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_instance_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :post, - uri_template: "/v1beta1/{parent}/instances", - body: "instance", - matches: [ - ["parent", %r{^projects/[^/]+/locations/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the update_instance REST call - # - # @param request_pb [::Google::Cloud::Redis::V1beta1::UpdateInstanceRequest] - # 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_instance_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :patch, - uri_template: "/v1beta1/{instance.name}", - body: "instance", - matches: [ - ["instance.name", %r{^projects/[^/]+/locations/[^/]+/instances/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the upgrade_instance REST call - # - # @param request_pb [::Google::Cloud::Redis::V1beta1::UpgradeInstanceRequest] - # A request object representing the call parameters. Required. - # @return [Array(String, [String, nil], Hash{String => String})] - # Uri, Body, Query string parameters - def self.transcode_upgrade_instance_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :post, - uri_template: "/v1beta1/{name}:upgrade", - body: "*", - matches: [ - ["name", %r{^projects/[^/]+/locations/[^/]+/instances/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the import_instance REST call - # - # @param request_pb [::Google::Cloud::Redis::V1beta1::ImportInstanceRequest] - # A request object representing the call parameters. Required. - # @return [Array(String, [String, nil], Hash{String => String})] - # Uri, Body, Query string parameters - def self.transcode_import_instance_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :post, - uri_template: "/v1beta1/{name}:import", - body: "*", - matches: [ - ["name", %r{^projects/[^/]+/locations/[^/]+/instances/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the export_instance REST call - # - # @param request_pb [::Google::Cloud::Redis::V1beta1::ExportInstanceRequest] - # A request object representing the call parameters. Required. - # @return [Array(String, [String, nil], Hash{String => String})] - # Uri, Body, Query string parameters - def self.transcode_export_instance_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :post, - uri_template: "/v1beta1/{name}:export", - body: "*", - matches: [ - ["name", %r{^projects/[^/]+/locations/[^/]+/instances/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the failover_instance REST call - # - # @param request_pb [::Google::Cloud::Redis::V1beta1::FailoverInstanceRequest] - # A request object representing the call parameters. Required. - # @return [Array(String, [String, nil], Hash{String => String})] - # Uri, Body, Query string parameters - def self.transcode_failover_instance_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :post, - uri_template: "/v1beta1/{name}:failover", - body: "*", - matches: [ - ["name", %r{^projects/[^/]+/locations/[^/]+/instances/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the delete_instance REST call - # - # @param request_pb [::Google::Cloud::Redis::V1beta1::DeleteInstanceRequest] - # 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_instance_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :delete, - uri_template: "/v1beta1/{name}", - matches: [ - ["name", %r{^projects/[^/]+/locations/[^/]+/instances/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the reschedule_maintenance REST call - # - # @param request_pb [::Google::Cloud::Redis::V1beta1::RescheduleMaintenanceRequest] - # A request object representing the call parameters. Required. - # @return [Array(String, [String, nil], Hash{String => String})] - # Uri, Body, Query string parameters - def self.transcode_reschedule_maintenance_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :post, - uri_template: "/v1beta1/{name}:rescheduleMaintenance", - body: "*", - matches: [ - ["name", %r{^projects/[^/]+/locations/[^/]+/instances/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - end - end - end - end - end - end -end diff --git a/owl-bot-staging/google-cloud-redis-v1beta1/lib/google/cloud/redis/v1beta1/cloud_redis_pb.rb b/owl-bot-staging/google-cloud-redis-v1beta1/lib/google/cloud/redis/v1beta1/cloud_redis_pb.rb deleted file mode 100644 index bfd14c1a2dc4..000000000000 --- a/owl-bot-staging/google-cloud-redis-v1beta1/lib/google/cloud/redis/v1beta1/cloud_redis_pb.rb +++ /dev/null @@ -1,66 +0,0 @@ -# frozen_string_literal: true -# Generated by the protocol buffer compiler. DO NOT EDIT! -# source: google/cloud/redis/v1beta1/cloud_redis.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/longrunning/operations_pb' -require 'google/protobuf/duration_pb' -require 'google/protobuf/field_mask_pb' -require 'google/protobuf/timestamp_pb' -require 'google/type/dayofweek_pb' -require 'google/type/timeofday_pb' - - -descriptor_data = "\n,google/cloud/redis/v1beta1/cloud_redis.proto\x12\x1agoogle.cloud.redis.v1beta1\x1a\x1cgoogle/api/annotations.proto\x1a\x17google/api/client.proto\x1a\x1fgoogle/api/field_behavior.proto\x1a\x19google/api/resource.proto\x1a#google/longrunning/operations.proto\x1a\x1egoogle/protobuf/duration.proto\x1a google/protobuf/field_mask.proto\x1a\x1fgoogle/protobuf/timestamp.proto\x1a\x1bgoogle/type/dayofweek.proto\x1a\x1bgoogle/type/timeofday.proto\".\n\x08NodeInfo\x12\x0f\n\x02id\x18\x01 \x01(\tB\x03\xe0\x41\x03\x12\x11\n\x04zone\x18\x02 \x01(\tB\x03\xe0\x41\x03\"\xa5\x11\n\x08Instance\x12\x11\n\x04name\x18\x01 \x01(\tB\x03\xe0\x41\x02\x12\x14\n\x0c\x64isplay_name\x18\x02 \x01(\t\x12@\n\x06labels\x18\x03 \x03(\x0b\x32\x30.google.cloud.redis.v1beta1.Instance.LabelsEntry\x12\x18\n\x0blocation_id\x18\x04 \x01(\tB\x03\xe0\x41\x01\x12$\n\x17\x61lternative_location_id\x18\x05 \x01(\tB\x03\xe0\x41\x01\x12\x1a\n\rredis_version\x18\x07 \x01(\tB\x03\xe0\x41\x01\x12\x1e\n\x11reserved_ip_range\x18\t \x01(\tB\x03\xe0\x41\x01\x12\x1f\n\x12secondary_ip_range\x18\x1e \x01(\tB\x03\xe0\x41\x01\x12\x11\n\x04host\x18\n \x01(\tB\x03\xe0\x41\x03\x12\x11\n\x04port\x18\x0b \x01(\x05\x42\x03\xe0\x41\x03\x12 \n\x13\x63urrent_location_id\x18\x0c \x01(\tB\x03\xe0\x41\x03\x12\x34\n\x0b\x63reate_time\x18\r \x01(\x0b\x32\x1a.google.protobuf.TimestampB\x03\xe0\x41\x03\x12>\n\x05state\x18\x0e \x01(\x0e\x32*.google.cloud.redis.v1beta1.Instance.StateB\x03\xe0\x41\x03\x12\x1b\n\x0estatus_message\x18\x0f \x01(\tB\x03\xe0\x41\x03\x12R\n\rredis_configs\x18\x10 \x03(\x0b\x32\x36.google.cloud.redis.v1beta1.Instance.RedisConfigsEntryB\x03\xe0\x41\x01\x12<\n\x04tier\x18\x11 \x01(\x0e\x32).google.cloud.redis.v1beta1.Instance.TierB\x03\xe0\x41\x02\x12\x1b\n\x0ememory_size_gb\x18\x12 \x01(\x05\x42\x03\xe0\x41\x02\x12\x1f\n\x12\x61uthorized_network\x18\x14 \x01(\tB\x03\xe0\x41\x01\x12%\n\x18persistence_iam_identity\x18\x15 \x01(\tB\x03\xe0\x41\x03\x12K\n\x0c\x63onnect_mode\x18\x16 \x01(\x0e\x32\x30.google.cloud.redis.v1beta1.Instance.ConnectModeB\x03\xe0\x41\x01\x12\x19\n\x0c\x61uth_enabled\x18\x17 \x01(\x08\x42\x03\xe0\x41\x01\x12H\n\x0fserver_ca_certs\x18\x19 \x03(\x0b\x32*.google.cloud.redis.v1beta1.TlsCertificateB\x03\xe0\x41\x03\x12`\n\x17transit_encryption_mode\x18\x1a \x01(\x0e\x32:.google.cloud.redis.v1beta1.Instance.TransitEncryptionModeB\x03\xe0\x41\x01\x12N\n\x12maintenance_policy\x18\x1b \x01(\x0b\x32-.google.cloud.redis.v1beta1.MaintenancePolicyB\x03\xe0\x41\x01\x12R\n\x14maintenance_schedule\x18\x1c \x01(\x0b\x32/.google.cloud.redis.v1beta1.MaintenanceScheduleB\x03\xe0\x41\x03\x12\x1a\n\rreplica_count\x18\x1f \x01(\x05\x42\x03\xe0\x41\x01\x12\x38\n\x05nodes\x18 \x03(\x0b\x32$.google.cloud.redis.v1beta1.NodeInfoB\x03\xe0\x41\x03\x12\x1a\n\rread_endpoint\x18! \x01(\tB\x03\xe0\x41\x03\x12\x1f\n\x12read_endpoint_port\x18\" \x01(\x05\x42\x03\xe0\x41\x03\x12V\n\x12read_replicas_mode\x18# \x01(\x0e\x32\x35.google.cloud.redis.v1beta1.Instance.ReadReplicasModeB\x03\xe0\x41\x01\x12N\n\x12persistence_config\x18% \x01(\x0b\x32-.google.cloud.redis.v1beta1.PersistenceConfigB\x03\xe0\x41\x01\x1a-\n\x0bLabelsEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12\r\n\x05value\x18\x02 \x01(\t:\x02\x38\x01\x1a\x33\n\x11RedisConfigsEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12\r\n\x05value\x18\x02 \x01(\t:\x02\x38\x01\"\x94\x01\n\x05State\x12\x15\n\x11STATE_UNSPECIFIED\x10\x00\x12\x0c\n\x08\x43REATING\x10\x01\x12\t\n\x05READY\x10\x02\x12\x0c\n\x08UPDATING\x10\x03\x12\x0c\n\x08\x44\x45LETING\x10\x04\x12\r\n\tREPAIRING\x10\x05\x12\x0f\n\x0bMAINTENANCE\x10\x06\x12\r\n\tIMPORTING\x10\x08\x12\x10\n\x0c\x46\x41ILING_OVER\x10\n\"8\n\x04Tier\x12\x14\n\x10TIER_UNSPECIFIED\x10\x00\x12\t\n\x05\x42\x41SIC\x10\x01\x12\x0f\n\x0bSTANDARD_HA\x10\x03\"[\n\x0b\x43onnectMode\x12\x1c\n\x18\x43ONNECT_MODE_UNSPECIFIED\x10\x00\x12\x12\n\x0e\x44IRECT_PEERING\x10\x01\x12\x1a\n\x16PRIVATE_SERVICE_ACCESS\x10\x02\"i\n\x15TransitEncryptionMode\x12\'\n#TRANSIT_ENCRYPTION_MODE_UNSPECIFIED\x10\x00\x12\x19\n\x15SERVER_AUTHENTICATION\x10\x01\x12\x0c\n\x08\x44ISABLED\x10\x02\"m\n\x10ReadReplicasMode\x12\"\n\x1eREAD_REPLICAS_MODE_UNSPECIFIED\x10\x00\x12\x1a\n\x16READ_REPLICAS_DISABLED\x10\x01\x12\x19\n\x15READ_REPLICAS_ENABLED\x10\x02:`\xea\x41]\n\x1dredis.googleapis.com/Instance\x12\"2/v1beta1/{parent=projects/*/locations/*}/instances:\x08instance\x12\x86\x02\n\x0eUpdateInstance\x12\x31.google.cloud.redis.v1beta1.UpdateInstanceRequest\x1a\x1d.google.longrunning.Operation\"\xa1\x01\xca\x41:\n#google.cloud.redis.v1beta1.Instance\x12\x13google.protobuf.Any\xda\x41\x14update_mask,instance\x82\xd3\xe4\x93\x02G2;/v1beta1/{instance.name=projects/*/locations/*/instances/*}:\x08instance\x12\xfe\x01\n\x0fUpgradeInstance\x12\x32.google.cloud.redis.v1beta1.UpgradeInstanceRequest\x1a\x1d.google.longrunning.Operation\"\x97\x01\xca\x41:\n#google.cloud.redis.v1beta1.Instance\x12\x13google.protobuf.Any\xda\x41\x12name,redis_version\x82\xd3\xe4\x93\x02?\":/v1beta1/{name=projects/*/locations/*/instances/*}:upgrade:\x01*\x12\xfa\x01\n\x0eImportInstance\x12\x31.google.cloud.redis.v1beta1.ImportInstanceRequest\x1a\x1d.google.longrunning.Operation\"\x95\x01\xca\x41:\n#google.cloud.redis.v1beta1.Instance\x12\x13google.protobuf.Any\xda\x41\x11name,input_config\x82\xd3\xe4\x93\x02>\"9/v1beta1/{name=projects/*/locations/*/instances/*}:import:\x01*\x12\xfb\x01\n\x0e\x45xportInstance\x12\x31.google.cloud.redis.v1beta1.ExportInstanceRequest\x1a\x1d.google.longrunning.Operation\"\x96\x01\xca\x41:\n#google.cloud.redis.v1beta1.Instance\x12\x13google.protobuf.Any\xda\x41\x12name,output_config\x82\xd3\xe4\x93\x02>\"9/v1beta1/{name=projects/*/locations/*/instances/*}:export:\x01*\x12\x88\x02\n\x10\x46\x61iloverInstance\x12\x33.google.cloud.redis.v1beta1.FailoverInstanceRequest\x1a\x1d.google.longrunning.Operation\"\x9f\x01\xca\x41:\n#google.cloud.redis.v1beta1.Instance\x12\x13google.protobuf.Any\xda\x41\x19name,data_protection_mode\x82\xd3\xe4\x93\x02@\";/v1beta1/{name=projects/*/locations/*/instances/*}:failover:\x01*\x12\xd4\x01\n\x0e\x44\x65leteInstance\x12\x31.google.cloud.redis.v1beta1.DeleteInstanceRequest\x1a\x1d.google.longrunning.Operation\"p\xca\x41,\n\x15google.protobuf.Empty\x12\x13google.protobuf.Any\xda\x41\x04name\x82\xd3\xe4\x93\x02\x34*2/v1beta1/{name=projects/*/locations/*/instances/*}\x12\xaa\x02\n\x15RescheduleMaintenance\x12\x38.google.cloud.redis.v1beta1.RescheduleMaintenanceRequest\x1a\x1d.google.longrunning.Operation\"\xb7\x01\xca\x41:\n#google.cloud.redis.v1beta1.Instance\x12\x13google.protobuf.Any\xda\x41$name, reschedule_type, schedule_time\x82\xd3\xe4\x93\x02M\"H/v1beta1/{name=projects/*/locations/*/instances/*}:rescheduleMaintenance:\x01*\x1aH\xca\x41\x14redis.googleapis.com\xd2\x41.https://www.googleapis.com/auth/cloud-platformBt\n\x1e\x63om.google.cloud.redis.v1beta1B\x1a\x43loudRedisServiceBetaProtoP\x01Z4cloud.google.com/go/redis/apiv1beta1/redispb;redispbb\x06proto3" - -pool = ::Google::Protobuf::DescriptorPool.generated_pool -pool.add_serialized_file(descriptor_data) - -module Google - module Cloud - module Redis - module V1beta1 - NodeInfo = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.redis.v1beta1.NodeInfo").msgclass - Instance = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.redis.v1beta1.Instance").msgclass - Instance::State = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.redis.v1beta1.Instance.State").enummodule - Instance::Tier = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.redis.v1beta1.Instance.Tier").enummodule - Instance::ConnectMode = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.redis.v1beta1.Instance.ConnectMode").enummodule - Instance::TransitEncryptionMode = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.redis.v1beta1.Instance.TransitEncryptionMode").enummodule - Instance::ReadReplicasMode = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.redis.v1beta1.Instance.ReadReplicasMode").enummodule - PersistenceConfig = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.redis.v1beta1.PersistenceConfig").msgclass - PersistenceConfig::PersistenceMode = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.redis.v1beta1.PersistenceConfig.PersistenceMode").enummodule - PersistenceConfig::SnapshotPeriod = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.redis.v1beta1.PersistenceConfig.SnapshotPeriod").enummodule - RescheduleMaintenanceRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.redis.v1beta1.RescheduleMaintenanceRequest").msgclass - RescheduleMaintenanceRequest::RescheduleType = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.redis.v1beta1.RescheduleMaintenanceRequest.RescheduleType").enummodule - MaintenancePolicy = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.redis.v1beta1.MaintenancePolicy").msgclass - WeeklyMaintenanceWindow = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.redis.v1beta1.WeeklyMaintenanceWindow").msgclass - MaintenanceSchedule = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.redis.v1beta1.MaintenanceSchedule").msgclass - ListInstancesRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.redis.v1beta1.ListInstancesRequest").msgclass - ListInstancesResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.redis.v1beta1.ListInstancesResponse").msgclass - GetInstanceRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.redis.v1beta1.GetInstanceRequest").msgclass - GetInstanceAuthStringRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.redis.v1beta1.GetInstanceAuthStringRequest").msgclass - InstanceAuthString = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.redis.v1beta1.InstanceAuthString").msgclass - CreateInstanceRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.redis.v1beta1.CreateInstanceRequest").msgclass - UpdateInstanceRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.redis.v1beta1.UpdateInstanceRequest").msgclass - UpgradeInstanceRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.redis.v1beta1.UpgradeInstanceRequest").msgclass - DeleteInstanceRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.redis.v1beta1.DeleteInstanceRequest").msgclass - GcsSource = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.redis.v1beta1.GcsSource").msgclass - InputConfig = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.redis.v1beta1.InputConfig").msgclass - ImportInstanceRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.redis.v1beta1.ImportInstanceRequest").msgclass - GcsDestination = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.redis.v1beta1.GcsDestination").msgclass - OutputConfig = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.redis.v1beta1.OutputConfig").msgclass - ExportInstanceRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.redis.v1beta1.ExportInstanceRequest").msgclass - FailoverInstanceRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.redis.v1beta1.FailoverInstanceRequest").msgclass - FailoverInstanceRequest::DataProtectionMode = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.redis.v1beta1.FailoverInstanceRequest.DataProtectionMode").enummodule - LocationMetadata = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.redis.v1beta1.LocationMetadata").msgclass - ZoneMetadata = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.redis.v1beta1.ZoneMetadata").msgclass - TlsCertificate = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.redis.v1beta1.TlsCertificate").msgclass - end - end - end -end diff --git a/owl-bot-staging/google-cloud-redis-v1beta1/lib/google/cloud/redis/v1beta1/cloud_redis_services_pb.rb b/owl-bot-staging/google-cloud-redis-v1beta1/lib/google/cloud/redis/v1beta1/cloud_redis_services_pb.rb deleted file mode 100644 index e52d7a5939b8..000000000000 --- a/owl-bot-staging/google-cloud-redis-v1beta1/lib/google/cloud/redis/v1beta1/cloud_redis_services_pb.rb +++ /dev/null @@ -1,120 +0,0 @@ -# Generated by the protocol buffer compiler. DO NOT EDIT! -# Source: google/cloud/redis/v1beta1/cloud_redis.proto for package 'google.cloud.redis.v1beta1' -# Original file comments: -# 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 -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. -# - -require 'grpc' -require 'google/cloud/redis/v1beta1/cloud_redis_pb' - -module Google - module Cloud - module Redis - module V1beta1 - module CloudRedis - # Configures and manages Cloud Memorystore for Redis instances - # - # Google Cloud Memorystore for Redis v1beta1 - # - # The `redis.googleapis.com` service implements the Google Cloud Memorystore - # for Redis API and defines the following resource model for managing Redis - # instances: - # * The service works with a collection of cloud projects, named: `/projects/*` - # * Each project has a collection of available locations, named: `/locations/*` - # * Each location has a collection of Redis instances, named: `/instances/*` - # * As such, Redis instances are resources of the form: - # `/projects/{project_id}/locations/{location_id}/instances/{instance_id}` - # - # Note that location_id must be referring to a GCP `region`; for example: - # * `projects/redpepper-1290/locations/us-central1/instances/my-redis` - class Service - - include ::GRPC::GenericService - - self.marshal_class_method = :encode - self.unmarshal_class_method = :decode - self.service_name = 'google.cloud.redis.v1beta1.CloudRedis' - - # Lists all Redis instances owned by a project in either the specified - # location (region) or all locations. - # - # The location should have the following format: - # - # * `projects/{project_id}/locations/{location_id}` - # - # If `location_id` is specified as `-` (wildcard), then all regions - # available to the project are queried, and the results are aggregated. - rpc :ListInstances, ::Google::Cloud::Redis::V1beta1::ListInstancesRequest, ::Google::Cloud::Redis::V1beta1::ListInstancesResponse - # Gets the details of a specific Redis instance. - rpc :GetInstance, ::Google::Cloud::Redis::V1beta1::GetInstanceRequest, ::Google::Cloud::Redis::V1beta1::Instance - # Gets the AUTH string for a Redis instance. If AUTH is not enabled for the - # instance the response will be empty. This information is not included in - # the details returned to GetInstance. - rpc :GetInstanceAuthString, ::Google::Cloud::Redis::V1beta1::GetInstanceAuthStringRequest, ::Google::Cloud::Redis::V1beta1::InstanceAuthString - # Creates a Redis instance based on the specified tier and memory size. - # - # By default, the instance is accessible from the project's - # [default network](https://cloud.google.com/vpc/docs/vpc). - # - # The creation is executed asynchronously and callers may check the returned - # operation to track its progress. Once the operation is completed the Redis - # instance will be fully functional. The completed longrunning.Operation will - # contain the new instance object in the response field. - # - # The returned operation is automatically deleted after a few hours, so there - # is no need to call DeleteOperation. - rpc :CreateInstance, ::Google::Cloud::Redis::V1beta1::CreateInstanceRequest, ::Google::Longrunning::Operation - # Updates the metadata and configuration of a specific Redis instance. - # - # Completed longrunning.Operation will contain the new instance object - # in the response field. The returned operation is automatically deleted - # after a few hours, so there is no need to call DeleteOperation. - rpc :UpdateInstance, ::Google::Cloud::Redis::V1beta1::UpdateInstanceRequest, ::Google::Longrunning::Operation - # Upgrades Redis instance to the newer Redis version specified in the - # request. - rpc :UpgradeInstance, ::Google::Cloud::Redis::V1beta1::UpgradeInstanceRequest, ::Google::Longrunning::Operation - # Import a Redis RDB snapshot file from Cloud Storage into a Redis instance. - # - # Redis may stop serving during this operation. Instance state will be - # IMPORTING for entire operation. When complete, the instance will contain - # only data from the imported file. - # - # The returned operation is automatically deleted after a few hours, so - # there is no need to call DeleteOperation. - rpc :ImportInstance, ::Google::Cloud::Redis::V1beta1::ImportInstanceRequest, ::Google::Longrunning::Operation - # Export Redis instance data into a Redis RDB format file in Cloud Storage. - # - # Redis will continue serving during this operation. - # - # The returned operation is automatically deleted after a few hours, so - # there is no need to call DeleteOperation. - rpc :ExportInstance, ::Google::Cloud::Redis::V1beta1::ExportInstanceRequest, ::Google::Longrunning::Operation - # Initiates a failover of the primary node to current replica node for a - # specific STANDARD tier Cloud Memorystore for Redis instance. - rpc :FailoverInstance, ::Google::Cloud::Redis::V1beta1::FailoverInstanceRequest, ::Google::Longrunning::Operation - # Deletes a specific Redis instance. Instance stops serving and data is - # deleted. - rpc :DeleteInstance, ::Google::Cloud::Redis::V1beta1::DeleteInstanceRequest, ::Google::Longrunning::Operation - # Reschedule maintenance for a given instance in a given project and - # location. - rpc :RescheduleMaintenance, ::Google::Cloud::Redis::V1beta1::RescheduleMaintenanceRequest, ::Google::Longrunning::Operation - end - - Stub = Service.rpc_stub_class - end - end - end - end -end diff --git a/owl-bot-staging/google-cloud-redis-v1beta1/lib/google/cloud/redis/v1beta1/rest.rb b/owl-bot-staging/google-cloud-redis-v1beta1/lib/google/cloud/redis/v1beta1/rest.rb deleted file mode 100644 index 9b35e0aedb1c..000000000000 --- a/owl-bot-staging/google-cloud-redis-v1beta1/lib/google/cloud/redis/v1beta1/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/cloud/redis/v1beta1/cloud_redis/rest" -require "google/cloud/redis/v1beta1/version" - -module Google - module Cloud - module Redis - ## - # To load just the REST part of this package, including all its services, and instantiate a REST client: - # - # @example - # - # require "google/cloud/redis/v1beta1/rest" - # client = ::Google::Cloud::Redis::V1beta1::CloudRedis::Rest::Client.new - # - module V1beta1 - end - end - end -end diff --git a/owl-bot-staging/google-cloud-redis-v1beta1/lib/google/cloud/redis/v1beta1/version.rb b/owl-bot-staging/google-cloud-redis-v1beta1/lib/google/cloud/redis/v1beta1/version.rb deleted file mode 100644 index 9b449a992d22..000000000000 --- a/owl-bot-staging/google-cloud-redis-v1beta1/lib/google/cloud/redis/v1beta1/version.rb +++ /dev/null @@ -1,28 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - - -module Google - module Cloud - module Redis - module V1beta1 - VERSION = "0.0.1" - end - end - end -end diff --git a/owl-bot-staging/google-cloud-redis-v1beta1/proto_docs/README.md b/owl-bot-staging/google-cloud-redis-v1beta1/proto_docs/README.md deleted file mode 100644 index 943c27706d6a..000000000000 --- a/owl-bot-staging/google-cloud-redis-v1beta1/proto_docs/README.md +++ /dev/null @@ -1,4 +0,0 @@ -# Google Cloud Memorystore for Redis V1beta1 Protocol Buffer Documentation - -These files are for the YARD documentation of the generated protobuf files. -They are not intended to be required or loaded at runtime. diff --git a/owl-bot-staging/google-cloud-redis-v1beta1/proto_docs/google/api/client.rb b/owl-bot-staging/google-cloud-redis-v1beta1/proto_docs/google/api/client.rb deleted file mode 100644 index 5089551e9ea4..000000000000 --- a/owl-bot-staging/google-cloud-redis-v1beta1/proto_docs/google/api/client.rb +++ /dev/null @@ -1,589 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - - -module Google - module Api - # Required information for every language. - # @!attribute [rw] reference_docs_uri - # @deprecated This field is deprecated and may be removed in the next major version update. - # @return [::String] - # Link to automatically generated reference documentation. Example: - # https://cloud.google.com/nodejs/docs/reference/asset/latest - # @!attribute [rw] destinations - # @return [::Array<::Google::Api::ClientLibraryDestination>] - # The destination where API teams want this client library to be published. - # @!attribute [rw] selective_gapic_generation - # @return [::Google::Api::SelectiveGapicGeneration] - # Configuration for which RPCs should be generated in the GAPIC client. - class CommonLanguageSettings - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Details about how and where to publish client libraries. - # @!attribute [rw] version - # @return [::String] - # Version of the API to apply these settings to. This is the full protobuf - # package for the API, ending in the version element. - # Examples: "google.cloud.speech.v1" and "google.spanner.admin.database.v1". - # @!attribute [rw] launch_stage - # @return [::Google::Api::LaunchStage] - # Launch stage of this version of the API. - # @!attribute [rw] rest_numeric_enums - # @return [::Boolean] - # When using transport=rest, the client request will encode enums as - # numbers rather than strings. - # @!attribute [rw] java_settings - # @return [::Google::Api::JavaSettings] - # Settings for legacy Java features, supported in the Service YAML. - # @!attribute [rw] cpp_settings - # @return [::Google::Api::CppSettings] - # Settings for C++ client libraries. - # @!attribute [rw] php_settings - # @return [::Google::Api::PhpSettings] - # Settings for PHP client libraries. - # @!attribute [rw] python_settings - # @return [::Google::Api::PythonSettings] - # Settings for Python client libraries. - # @!attribute [rw] node_settings - # @return [::Google::Api::NodeSettings] - # Settings for Node client libraries. - # @!attribute [rw] dotnet_settings - # @return [::Google::Api::DotnetSettings] - # Settings for .NET client libraries. - # @!attribute [rw] ruby_settings - # @return [::Google::Api::RubySettings] - # Settings for Ruby client libraries. - # @!attribute [rw] go_settings - # @return [::Google::Api::GoSettings] - # Settings for Go client libraries. - class ClientLibrarySettings - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # This message configures the settings for publishing [Google Cloud Client - # libraries](https://cloud.google.com/apis/docs/cloud-client-libraries) - # generated from the service config. - # @!attribute [rw] method_settings - # @return [::Array<::Google::Api::MethodSettings>] - # A list of API method settings, e.g. the behavior for methods that use the - # long-running operation pattern. - # @!attribute [rw] new_issue_uri - # @return [::String] - # Link to a *public* URI where users can report issues. Example: - # https://issuetracker.google.com/issues/new?component=190865&template=1161103 - # @!attribute [rw] documentation_uri - # @return [::String] - # Link to product home page. Example: - # https://cloud.google.com/asset-inventory/docs/overview - # @!attribute [rw] api_short_name - # @return [::String] - # Used as a tracking tag when collecting data about the APIs developer - # relations artifacts like docs, packages delivered to package managers, - # etc. Example: "speech". - # @!attribute [rw] github_label - # @return [::String] - # GitHub label to apply to issues and pull requests opened for this API. - # @!attribute [rw] codeowner_github_teams - # @return [::Array<::String>] - # GitHub teams to be added to CODEOWNERS in the directory in GitHub - # containing source code for the client libraries for this API. - # @!attribute [rw] doc_tag_prefix - # @return [::String] - # A prefix used in sample code when demarking regions to be included in - # documentation. - # @!attribute [rw] organization - # @return [::Google::Api::ClientLibraryOrganization] - # For whom the client library is being published. - # @!attribute [rw] library_settings - # @return [::Array<::Google::Api::ClientLibrarySettings>] - # Client library settings. If the same version string appears multiple - # times in this list, then the last one wins. Settings from earlier - # settings with the same version string are discarded. - # @!attribute [rw] proto_reference_documentation_uri - # @return [::String] - # Optional link to proto reference documentation. Example: - # https://cloud.google.com/pubsub/lite/docs/reference/rpc - # @!attribute [rw] rest_reference_documentation_uri - # @return [::String] - # Optional link to REST reference documentation. Example: - # https://cloud.google.com/pubsub/lite/docs/reference/rest - class Publishing - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Settings for Java client libraries. - # @!attribute [rw] library_package - # @return [::String] - # The package name to use in Java. Clobbers the java_package option - # set in the protobuf. This should be used **only** by APIs - # who have already set the language_settings.java.package_name" field - # in gapic.yaml. API teams should use the protobuf java_package option - # where possible. - # - # Example of a YAML configuration:: - # - # publishing: - # 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. - # @!attribute [rw] methods - # @return [::Array<::String>] - # An allowlist of the fully qualified names of RPCs that should be included - # on public client surfaces. - # @!attribute [rw] generate_omitted_as_internal - # @return [::Boolean] - # Setting this to true indicates to the client generators that methods - # that would be excluded from the generation should instead be generated - # in a way that indicates these methods should not be consumed by - # end users. How this is expressed is up to individual language - # implementations to decide. Some examples may be: added annotations, - # obfuscated identifiers, or other language idiomatic patterns. - class SelectiveGapicGeneration - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # `BatchingConfigProto` defines the batching configuration for an API method. - # @!attribute [rw] thresholds - # @return [::Google::Api::BatchingSettingsProto] - # The thresholds which trigger a batched request to be sent. - # @!attribute [rw] batch_descriptor - # @return [::Google::Api::BatchingDescriptorProto] - # The request and response fields used in batching. - class BatchingConfigProto - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # `BatchingSettingsProto` specifies a set of batching thresholds, each of - # which acts as a trigger to send a batch of messages as a request. At least - # one threshold must be positive nonzero. - # @!attribute [rw] element_count_threshold - # @return [::Integer] - # The number of elements of a field collected into a batch which, if - # exceeded, causes the batch to be sent. - # @!attribute [rw] request_byte_threshold - # @return [::Integer] - # The aggregated size of the batched field which, if exceeded, causes the - # batch to be sent. This size is computed by aggregating the sizes of the - # request field to be batched, not of the entire request message. - # @!attribute [rw] delay_threshold - # @return [::Google::Protobuf::Duration] - # The duration after which a batch should be sent, starting from the addition - # of the first message to that batch. - # @!attribute [rw] element_count_limit - # @return [::Integer] - # The maximum number of elements collected in a batch that could be accepted - # by server. - # @!attribute [rw] request_byte_limit - # @return [::Integer] - # The maximum size of the request that could be accepted by server. - # @!attribute [rw] flow_control_element_limit - # @return [::Integer] - # The maximum number of elements allowed by flow control. - # @!attribute [rw] flow_control_byte_limit - # @return [::Integer] - # The maximum size of data allowed by flow control. - # @!attribute [rw] flow_control_limit_exceeded_behavior - # @return [::Google::Api::FlowControlLimitExceededBehaviorProto] - # The behavior to take when the flow control limit is exceeded. - class BatchingSettingsProto - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # `BatchingDescriptorProto` specifies the fields of the request message to be - # used for batching, and, optionally, the fields of the response message to be - # used for demultiplexing. - # @!attribute [rw] batched_field - # @return [::String] - # The repeated field in the request message to be aggregated by batching. - # @!attribute [rw] discriminator_fields - # @return [::Array<::String>] - # A list of the fields in the request message. Two requests will be batched - # together only if the values of every field specified in - # `request_discriminator_fields` is equal between the two requests. - # @!attribute [rw] subresponse_field - # @return [::String] - # Optional. When present, indicates the field in the response message to be - # used to demultiplex the response into multiple response messages, in - # correspondence with the multiple request messages originally batched - # together. - class BatchingDescriptorProto - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # The organization for which the client libraries are being published. - # Affects the url where generated docs are published, etc. - module ClientLibraryOrganization - # Not useful. - CLIENT_LIBRARY_ORGANIZATION_UNSPECIFIED = 0 - - # Google Cloud Platform Org. - CLOUD = 1 - - # Ads (Advertising) Org. - ADS = 2 - - # Photos Org. - PHOTOS = 3 - - # Street View Org. - STREET_VIEW = 4 - - # Shopping Org. - SHOPPING = 5 - - # Geo Org. - GEO = 6 - - # Generative AI - https://developers.generativeai.google - GENERATIVE_AI = 7 - end - - # To where should client libraries be published? - module ClientLibraryDestination - # Client libraries will neither be generated nor published to package - # managers. - CLIENT_LIBRARY_DESTINATION_UNSPECIFIED = 0 - - # Generate the client library in a repo under github.com/googleapis, - # but don't publish it to package managers. - GITHUB = 10 - - # Publish the library to package managers like nuget.org and npmjs.com. - PACKAGE_MANAGER = 20 - end - - # The behavior to take when the flow control limit is exceeded. - module FlowControlLimitExceededBehaviorProto - # Default behavior, system-defined. - UNSET_BEHAVIOR = 0 - - # Stop operation, raise error. - THROW_EXCEPTION = 1 - - # Pause operation until limit clears. - BLOCK = 2 - - # Continue operation, disregard limit. - IGNORE = 3 - end - end -end diff --git a/owl-bot-staging/google-cloud-redis-v1beta1/proto_docs/google/api/field_behavior.rb b/owl-bot-staging/google-cloud-redis-v1beta1/proto_docs/google/api/field_behavior.rb deleted file mode 100644 index 582be187d115..000000000000 --- a/owl-bot-staging/google-cloud-redis-v1beta1/proto_docs/google/api/field_behavior.rb +++ /dev/null @@ -1,85 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - - -module Google - module Api - # An indicator of the behavior of a given field (for example, that a field - # is required in requests, or given as output but ignored as input). - # This **does not** change the behavior in protocol buffers itself; it only - # denotes the behavior and may affect how API tooling handles the field. - # - # Note: This enum **may** receive new values in the future. - module FieldBehavior - # Conventional default for enums. Do not use this. - FIELD_BEHAVIOR_UNSPECIFIED = 0 - - # Specifically denotes a field as optional. - # While all fields in protocol buffers are optional, this may be specified - # for emphasis if appropriate. - OPTIONAL = 1 - - # Denotes a field as required. - # This indicates that the field **must** be provided as part of the request, - # and failure to do so will cause an error (usually `INVALID_ARGUMENT`). - REQUIRED = 2 - - # Denotes a field as output only. - # This indicates that the field is provided in responses, but including the - # field in a request does nothing (the server *must* ignore it and - # *must not* throw an error as a result of the field's presence). - OUTPUT_ONLY = 3 - - # Denotes a field as input only. - # This indicates that the field is provided in requests, and the - # corresponding field is not included in output. - INPUT_ONLY = 4 - - # Denotes a field as immutable. - # This indicates that the field may be set once in a request to create a - # resource, but may not be changed thereafter. - IMMUTABLE = 5 - - # Denotes that a (repeated) field is an unordered list. - # This indicates that the service may provide the elements of the list - # in any arbitrary order, rather than the order the user originally - # provided. Additionally, the list's order may or may not be stable. - UNORDERED_LIST = 6 - - # Denotes that this field returns a non-empty default value if not set. - # This indicates that if the user provides the empty value in a request, - # a non-empty value will be returned. The user will not be aware of what - # non-empty value to expect. - NON_EMPTY_DEFAULT = 7 - - # Denotes that the field in a resource (a message annotated with - # google.api.resource) is used in the resource name to uniquely identify the - # resource. For AIP-compliant APIs, this should only be applied to the - # `name` field on the resource. - # - # This behavior should not be applied to references to other resources within - # the message. - # - # The identifier field of resources often have different field behavior - # depending on the request it is embedded in (e.g. for Create methods name - # is optional and unused, while for Update methods it is required). Instead - # of method-specific annotations, only `IDENTIFIER` is required. - IDENTIFIER = 8 - end - end -end diff --git a/owl-bot-staging/google-cloud-redis-v1beta1/proto_docs/google/api/launch_stage.rb b/owl-bot-staging/google-cloud-redis-v1beta1/proto_docs/google/api/launch_stage.rb deleted file mode 100644 index 9392a413fb1b..000000000000 --- a/owl-bot-staging/google-cloud-redis-v1beta1/proto_docs/google/api/launch_stage.rb +++ /dev/null @@ -1,71 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - - -module Google - module Api - # The launch stage as defined by [Google Cloud Platform - # Launch Stages](https://cloud.google.com/terms/launch-stages). - module LaunchStage - # Do not use this default value. - LAUNCH_STAGE_UNSPECIFIED = 0 - - # The feature is not yet implemented. Users can not use it. - UNIMPLEMENTED = 6 - - # Prelaunch features are hidden from users and are only visible internally. - PRELAUNCH = 7 - - # Early Access features are limited to a closed group of testers. To use - # these features, you must sign up in advance and sign a Trusted Tester - # agreement (which includes confidentiality provisions). These features may - # be unstable, changed in backward-incompatible ways, and are not - # guaranteed to be released. - EARLY_ACCESS = 1 - - # Alpha is a limited availability test for releases before they are cleared - # for widespread use. By Alpha, all significant design issues are resolved - # and we are in the process of verifying functionality. Alpha customers - # need to apply for access, agree to applicable terms, and have their - # projects allowlisted. Alpha releases don't have to be feature complete, - # no SLAs are provided, and there are no technical support obligations, but - # they will be far enough along that customers can actually use them in - # test environments or for limited-use tests -- just like they would in - # normal production cases. - ALPHA = 2 - - # Beta is the point at which we are ready to open a release for any - # customer to use. There are no SLA or technical support obligations in a - # Beta release. Products will be complete from a feature perspective, but - # may have some open outstanding issues. Beta releases are suitable for - # limited production use cases. - BETA = 3 - - # GA features are open to all developers and are considered stable and - # fully qualified for production use. - GA = 4 - - # Deprecated features are scheduled to be shut down and removed. For more - # information, see the "Deprecation Policy" section of our [Terms of - # Service](https://cloud.google.com/terms/) - # and the [Google Cloud Platform Subject to the Deprecation - # Policy](https://cloud.google.com/terms/deprecation) documentation. - DEPRECATED = 5 - end - end -end diff --git a/owl-bot-staging/google-cloud-redis-v1beta1/proto_docs/google/api/resource.rb b/owl-bot-staging/google-cloud-redis-v1beta1/proto_docs/google/api/resource.rb deleted file mode 100644 index 25dec4847ac1..000000000000 --- a/owl-bot-staging/google-cloud-redis-v1beta1/proto_docs/google/api/resource.rb +++ /dev/null @@ -1,227 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - - -module Google - module Api - # A simple descriptor of a resource type. - # - # ResourceDescriptor annotates a resource message (either by means of a - # protobuf annotation or use in the service config), and associates the - # resource's schema, the resource type, and the pattern of the resource name. - # - # Example: - # - # message Topic { - # // Indicates this message defines a resource schema. - # // Declares the resource type in the format of {service}/{kind}. - # // For Kubernetes resources, the format is {api group}/{kind}. - # option (google.api.resource) = { - # type: "pubsub.googleapis.com/Topic" - # pattern: "projects/{project}/topics/{topic}" - # }; - # } - # - # The ResourceDescriptor Yaml config will look like: - # - # resources: - # - type: "pubsub.googleapis.com/Topic" - # pattern: "projects/{project}/topics/{topic}" - # - # Sometimes, resources have multiple patterns, typically because they can - # live under multiple parents. - # - # Example: - # - # message LogEntry { - # option (google.api.resource) = { - # type: "logging.googleapis.com/LogEntry" - # pattern: "projects/{project}/logs/{log}" - # pattern: "folders/{folder}/logs/{log}" - # pattern: "organizations/{organization}/logs/{log}" - # pattern: "billingAccounts/{billing_account}/logs/{log}" - # }; - # } - # - # The ResourceDescriptor Yaml config will look like: - # - # resources: - # - type: 'logging.googleapis.com/LogEntry' - # pattern: "projects/{project}/logs/{log}" - # pattern: "folders/{folder}/logs/{log}" - # pattern: "organizations/{organization}/logs/{log}" - # pattern: "billingAccounts/{billing_account}/logs/{log}" - # @!attribute [rw] type - # @return [::String] - # The resource type. It must be in the format of - # \\{service_name}/\\{resource_type_kind}. The `resource_type_kind` must be - # singular and must not include version numbers. - # - # Example: `storage.googleapis.com/Bucket` - # - # The value of the resource_type_kind must follow the regular expression - # /[A-Za-z][a-zA-Z0-9]+/. It should start with an upper case character and - # should use PascalCase (UpperCamelCase). The maximum number of - # characters allowed for the `resource_type_kind` is 100. - # @!attribute [rw] pattern - # @return [::Array<::String>] - # Optional. The relative resource name pattern associated with this resource - # type. The DNS prefix of the full resource name shouldn't be specified here. - # - # The path pattern must follow the syntax, which aligns with HTTP binding - # syntax: - # - # Template = Segment { "/" Segment } ; - # Segment = LITERAL | Variable ; - # Variable = "{" LITERAL "}" ; - # - # Examples: - # - # - "projects/\\{project}/topics/\\{topic}" - # - "projects/\\{project}/knowledgeBases/\\{knowledge_base}" - # - # The components in braces correspond to the IDs for each resource in the - # hierarchy. It is expected that, if multiple patterns are provided, - # the same component name (e.g. "project") refers to IDs of the same - # type of resource. - # @!attribute [rw] name_field - # @return [::String] - # Optional. The field on the resource that designates the resource name - # field. If omitted, this is assumed to be "name". - # @!attribute [rw] history - # @return [::Google::Api::ResourceDescriptor::History] - # Optional. The historical or future-looking state of the resource pattern. - # - # Example: - # - # // The InspectTemplate message originally only supported resource - # // names with organization, and project was added later. - # message InspectTemplate { - # option (google.api.resource) = { - # type: "dlp.googleapis.com/InspectTemplate" - # pattern: - # "organizations/{organization}/inspectTemplates/{inspect_template}" - # pattern: "projects/{project}/inspectTemplates/{inspect_template}" - # history: ORIGINALLY_SINGLE_PATTERN - # }; - # } - # @!attribute [rw] plural - # @return [::String] - # The plural name used in the resource name and permission names, such as - # 'projects' for the resource name of 'projects/\\{project}' and the permission - # name of 'cloudresourcemanager.googleapis.com/projects.get'. One exception - # to this is for Nested Collections that have stuttering names, as defined - # in [AIP-122](https://google.aip.dev/122#nested-collections), where the - # collection ID in the resource name pattern does not necessarily directly - # match the `plural` value. - # - # It is the same concept of the `plural` field in k8s CRD spec - # https://kubernetes.io/docs/tasks/access-kubernetes-api/custom-resources/custom-resource-definitions/ - # - # Note: The plural form is required even for singleton resources. See - # https://aip.dev/156 - # @!attribute [rw] singular - # @return [::String] - # The same concept of the `singular` field in k8s CRD spec - # https://kubernetes.io/docs/tasks/access-kubernetes-api/custom-resources/custom-resource-definitions/ - # Such as "project" for the `resourcemanager.googleapis.com/Project` type. - # @!attribute [rw] style - # @return [::Array<::Google::Api::ResourceDescriptor::Style>] - # Style flag(s) for this resource. - # These indicate that a resource is expected to conform to a given - # style. See the specific style flags for additional information. - class ResourceDescriptor - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - - # A description of the historical or future-looking state of the - # resource pattern. - module History - # The "unset" value. - HISTORY_UNSPECIFIED = 0 - - # The resource originally had one pattern and launched as such, and - # additional patterns were added later. - ORIGINALLY_SINGLE_PATTERN = 1 - - # The resource has one pattern, but the API owner expects to add more - # later. (This is the inverse of ORIGINALLY_SINGLE_PATTERN, and prevents - # that from being necessary once there are multiple patterns.) - FUTURE_MULTI_PATTERN = 2 - end - - # A flag representing a specific style that a resource claims to conform to. - module Style - # The unspecified value. Do not use. - STYLE_UNSPECIFIED = 0 - - # This resource is intended to be "declarative-friendly". - # - # Declarative-friendly resources must be more strictly consistent, and - # setting this to true communicates to tools that this resource should - # adhere to declarative-friendly expectations. - # - # Note: This is used by the API linter (linter.aip.dev) to enable - # additional checks. - DECLARATIVE_FRIENDLY = 1 - end - end - - # Defines a proto annotation that describes a string field that refers to - # an API resource. - # @!attribute [rw] type - # @return [::String] - # The resource type that the annotated field references. - # - # Example: - # - # message Subscription { - # string topic = 2 [(google.api.resource_reference) = { - # type: "pubsub.googleapis.com/Topic" - # }]; - # } - # - # Occasionally, a field may reference an arbitrary resource. In this case, - # APIs use the special value * in their resource reference. - # - # Example: - # - # message GetIamPolicyRequest { - # string resource = 2 [(google.api.resource_reference) = { - # type: "*" - # }]; - # } - # @!attribute [rw] child_type - # @return [::String] - # The resource type of a child collection that the annotated field - # references. This is useful for annotating the `parent` field that - # doesn't have a fixed resource type. - # - # Example: - # - # message ListLogEntriesRequest { - # string parent = 1 [(google.api.resource_reference) = { - # child_type: "logging.googleapis.com/LogEntry" - # }; - # } - class ResourceReference - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - end -end diff --git a/owl-bot-staging/google-cloud-redis-v1beta1/proto_docs/google/cloud/redis/v1beta1/cloud_redis.rb b/owl-bot-staging/google-cloud-redis-v1beta1/proto_docs/google/cloud/redis/v1beta1/cloud_redis.rb deleted file mode 100644 index 148c8857d86c..000000000000 --- a/owl-bot-staging/google-cloud-redis-v1beta1/proto_docs/google/cloud/redis/v1beta1/cloud_redis.rb +++ /dev/null @@ -1,771 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - - -module Google - module Cloud - module Redis - module V1beta1 - # Node specific properties. - # @!attribute [r] id - # @return [::String] - # Output only. Node identifying string. e.g. 'node-0', 'node-1' - # @!attribute [r] zone - # @return [::String] - # Output only. Location of the node. - class NodeInfo - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # A Memorystore for Redis instance. - # @!attribute [rw] name - # @return [::String] - # Required. Unique name of the resource in this scope including project and - # location using the form: - # `projects/{project_id}/locations/{location_id}/instances/{instance_id}` - # - # Note: Redis instances are managed and addressed at regional level so - # location_id here refers to a GCP region; however, users may choose which - # specific zone (or collection of zones for cross-zone instances) an instance - # should be provisioned in. Refer to {::Google::Cloud::Redis::V1beta1::Instance#location_id location_id} and - # {::Google::Cloud::Redis::V1beta1::Instance#alternative_location_id alternative_location_id} fields for more details. - # @!attribute [rw] display_name - # @return [::String] - # An arbitrary and optional user-provided name for the instance. - # @!attribute [rw] labels - # @return [::Google::Protobuf::Map{::String => ::String}] - # Resource labels to represent user provided metadata - # @!attribute [rw] location_id - # @return [::String] - # Optional. The zone where the instance will be provisioned. If not provided, - # the service will choose a zone from the specified region for the instance. - # For standard tier, additional nodes will be added across multiple zones for - # protection against zonal failures. If specified, at least one node will be - # provisioned in this zone. - # @!attribute [rw] alternative_location_id - # @return [::String] - # Optional. If specified, at least one node will be provisioned in this zone - # in addition to the zone specified in location_id. Only applicable to - # standard tier. If provided, it must be a different zone from the one - # provided in [location_id]. Additional nodes beyond the first 2 will be - # placed in zones selected by the service. - # @!attribute [rw] redis_version - # @return [::String] - # Optional. The version of Redis software. - # If not provided, latest supported version will be used. Currently, the - # supported values are: - # - # * `REDIS_3_2` for Redis 3.2 compatibility - # * `REDIS_4_0` for Redis 4.0 compatibility (default) - # * `REDIS_5_0` for Redis 5.0 compatibility - # * `REDIS_6_X` for Redis 6.x compatibility - # @!attribute [rw] reserved_ip_range - # @return [::String] - # Optional. For DIRECT_PEERING mode, the CIDR range of internal addresses - # that are reserved for this instance. Range must - # be unique and non-overlapping with existing subnets in an authorized - # network. For PRIVATE_SERVICE_ACCESS mode, the name of one allocated IP - # address ranges associated with this private service access connection. - # If not provided, the service will choose an unused /29 block, for - # example, 10.0.0.0/29 or 192.168.0.0/29. For READ_REPLICAS_ENABLED - # the default block size is /28. - # @!attribute [rw] secondary_ip_range - # @return [::String] - # Optional. Additional IP range for node placement. Required when enabling read - # replicas on an existing instance. For DIRECT_PEERING mode value must be a - # CIDR range of size /28, or "auto". For PRIVATE_SERVICE_ACCESS mode value - # must be the name of an allocated address range associated with the private - # service access connection, or "auto". - # @!attribute [r] host - # @return [::String] - # Output only. Hostname or IP address of the exposed Redis endpoint used by - # clients to connect to the service. - # @!attribute [r] port - # @return [::Integer] - # Output only. The port number of the exposed Redis endpoint. - # @!attribute [r] current_location_id - # @return [::String] - # Output only. The current zone where the Redis primary node is located. In - # basic tier, this will always be the same as [location_id]. In - # standard tier, this can be the zone of any node in the instance. - # @!attribute [r] create_time - # @return [::Google::Protobuf::Timestamp] - # Output only. The time the instance was created. - # @!attribute [r] state - # @return [::Google::Cloud::Redis::V1beta1::Instance::State] - # Output only. The current state of this instance. - # @!attribute [r] status_message - # @return [::String] - # Output only. Additional information about the current status of this - # instance, if available. - # @!attribute [rw] redis_configs - # @return [::Google::Protobuf::Map{::String => ::String}] - # Optional. Redis configuration parameters, according to - # http://redis.io/topics/config. Currently, the only supported parameters - # are: - # - # Redis version 3.2 and newer: - # - # * maxmemory-policy - # * notify-keyspace-events - # - # Redis version 4.0 and newer: - # - # * activedefrag - # * lfu-decay-time - # * lfu-log-factor - # * maxmemory-gb - # - # Redis version 5.0 and newer: - # - # * stream-node-max-bytes - # * stream-node-max-entries - # @!attribute [rw] tier - # @return [::Google::Cloud::Redis::V1beta1::Instance::Tier] - # Required. The service tier of the instance. - # @!attribute [rw] memory_size_gb - # @return [::Integer] - # Required. Redis memory size in GiB. - # @!attribute [rw] authorized_network - # @return [::String] - # Optional. The full name of the Google Compute Engine - # [network](https://cloud.google.com/vpc/docs/vpc) to which the - # instance is connected. If left unspecified, the `default` network - # will be used. - # @!attribute [r] persistence_iam_identity - # @return [::String] - # Output only. Cloud IAM identity used by import / export operations to - # transfer data to/from Cloud Storage. Format is - # "serviceAccount:". The value may change over time - # for a given instance so should be checked before each import/export - # operation. - # @!attribute [rw] connect_mode - # @return [::Google::Cloud::Redis::V1beta1::Instance::ConnectMode] - # Optional. The network connect mode of the Redis instance. - # If not provided, the connect mode defaults to DIRECT_PEERING. - # @!attribute [rw] auth_enabled - # @return [::Boolean] - # Optional. Indicates whether OSS Redis AUTH is enabled for the instance. If set to - # "true" AUTH is enabled on the instance. Default value is "false" meaning - # AUTH is disabled. - # @!attribute [r] server_ca_certs - # @return [::Array<::Google::Cloud::Redis::V1beta1::TlsCertificate>] - # Output only. List of server CA certificates for the instance. - # @!attribute [rw] transit_encryption_mode - # @return [::Google::Cloud::Redis::V1beta1::Instance::TransitEncryptionMode] - # Optional. The TLS mode of the Redis instance. - # If not provided, TLS is disabled for the instance. - # @!attribute [rw] maintenance_policy - # @return [::Google::Cloud::Redis::V1beta1::MaintenancePolicy] - # Optional. The maintenance policy for the instance. If not provided, - # maintenance events can be performed at any time. - # @!attribute [r] maintenance_schedule - # @return [::Google::Cloud::Redis::V1beta1::MaintenanceSchedule] - # Output only. Date and time of upcoming maintenance events which have been - # scheduled. - # @!attribute [rw] replica_count - # @return [::Integer] - # Optional. The number of replica nodes. The valid range for the Standard Tier with - # read replicas enabled is [1-5] and defaults to 2. If read replicas are not - # enabled for a Standard Tier instance, the only valid value is 1 and the - # default is 1. The valid value for basic tier is 0 and the default is also - # 0. - # @!attribute [r] nodes - # @return [::Array<::Google::Cloud::Redis::V1beta1::NodeInfo>] - # Output only. Info per node. - # @!attribute [r] read_endpoint - # @return [::String] - # Output only. Hostname or IP address of the exposed readonly Redis - # endpoint. Standard tier only. Targets all healthy replica nodes in - # instance. Replication is asynchronous and replica nodes will exhibit some - # lag behind the primary. Write requests must target 'host'. - # @!attribute [r] read_endpoint_port - # @return [::Integer] - # Output only. The port number of the exposed readonly redis - # endpoint. Standard tier only. Write requests should target 'port'. - # @!attribute [rw] read_replicas_mode - # @return [::Google::Cloud::Redis::V1beta1::Instance::ReadReplicasMode] - # Optional. Read replicas mode for the instance. Defaults to READ_REPLICAS_DISABLED. - # @!attribute [rw] persistence_config - # @return [::Google::Cloud::Redis::V1beta1::PersistenceConfig] - # Optional. Persistence configuration parameters - class Instance - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - - # @!attribute [rw] key - # @return [::String] - # @!attribute [rw] value - # @return [::String] - class LabelsEntry - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # @!attribute [rw] key - # @return [::String] - # @!attribute [rw] value - # @return [::String] - class RedisConfigsEntry - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Represents the different states of a Redis instance. - module State - # Not set. - STATE_UNSPECIFIED = 0 - - # Redis instance is being created. - CREATING = 1 - - # Redis instance has been created and is fully usable. - READY = 2 - - # Redis instance configuration is being updated. Certain kinds of updates - # may cause the instance to become unusable while the update is in - # progress. - UPDATING = 3 - - # Redis instance is being deleted. - DELETING = 4 - - # Redis instance is being repaired and may be unusable. - REPAIRING = 5 - - # Maintenance is being performed on this Redis instance. - MAINTENANCE = 6 - - # Redis instance is importing data (availability may be affected). - IMPORTING = 8 - - # Redis instance is failing over (availability may be affected). - FAILING_OVER = 10 - end - - # Available service tiers to choose from - module Tier - # Not set. - TIER_UNSPECIFIED = 0 - - # BASIC tier: standalone instance - BASIC = 1 - - # STANDARD_HA tier: highly available primary/replica instances - STANDARD_HA = 3 - end - - # Available connection modes. - module ConnectMode - # Not set. - CONNECT_MODE_UNSPECIFIED = 0 - - # Connect via direct peering to the Memorystore for Redis hosted service. - DIRECT_PEERING = 1 - - # Connect your Memorystore for Redis instance using Private Service - # Access. Private services access provides an IP address range for multiple - # Google Cloud services, including Memorystore. - PRIVATE_SERVICE_ACCESS = 2 - end - - # Available TLS modes. - module TransitEncryptionMode - # Not set. - TRANSIT_ENCRYPTION_MODE_UNSPECIFIED = 0 - - # Client to Server traffic encryption enabled with server authentication. - SERVER_AUTHENTICATION = 1 - - # TLS is disabled for the instance. - DISABLED = 2 - end - - # Read replicas mode. - module ReadReplicasMode - # If not set, Memorystore Redis backend will default to - # READ_REPLICAS_DISABLED. - READ_REPLICAS_MODE_UNSPECIFIED = 0 - - # If disabled, read endpoint will not be provided and the instance cannot - # scale up or down the number of replicas. - READ_REPLICAS_DISABLED = 1 - - # If enabled, read endpoint will be provided and the instance can scale - # up and down the number of replicas. Not valid for basic tier. - READ_REPLICAS_ENABLED = 2 - end - end - - # Configuration of the persistence functionality. - # @!attribute [rw] persistence_mode - # @return [::Google::Cloud::Redis::V1beta1::PersistenceConfig::PersistenceMode] - # Optional. Controls whether Persistence features are enabled. - # If not provided, the existing value will be used. - # @!attribute [rw] rdb_snapshot_period - # @return [::Google::Cloud::Redis::V1beta1::PersistenceConfig::SnapshotPeriod] - # Optional. Period between RDB snapshots. Snapshots will be attempted every period - # starting from the provided snapshot start time. For example, a start time - # of 01/01/2033 06:45 and SIX_HOURS snapshot period will do nothing until - # 01/01/2033, and then trigger snapshots every day at 06:45, 12:45, 18:45, - # and 00:45 the next day, and so on. - # If not provided, TWENTY_FOUR_HOURS will be used as default. - # @!attribute [r] rdb_next_snapshot_time - # @return [::Google::Protobuf::Timestamp] - # Output only. The next time that a snapshot attempt is scheduled to occur. - # @!attribute [rw] rdb_snapshot_start_time - # @return [::Google::Protobuf::Timestamp] - # Optional. Date and time that the first snapshot was/will be attempted, and to which - # future snapshots will be aligned. - # If not provided, the current time will be used. - class PersistenceConfig - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - - # Available Persistence modes. - module PersistenceMode - # Not set. - PERSISTENCE_MODE_UNSPECIFIED = 0 - - # Persistence is disabled for the instance, - # and any existing snapshots are deleted. - DISABLED = 1 - - # RDB based Persistence is enabled. - RDB = 2 - end - - # Available snapshot periods for scheduling. - module SnapshotPeriod - # Not set. - SNAPSHOT_PERIOD_UNSPECIFIED = 0 - - # Snapshot every 1 hour. - ONE_HOUR = 3 - - # Snapshot every 6 hours. - SIX_HOURS = 4 - - # Snapshot every 12 hours. - TWELVE_HOURS = 5 - - # Snapshot every 24 hours. - TWENTY_FOUR_HOURS = 6 - end - end - - # Request for {::Google::Cloud::Redis::V1beta1::CloudRedis::Client#reschedule_maintenance RescheduleMaintenance}. - # @!attribute [rw] name - # @return [::String] - # Required. Redis instance resource name using the form: - # `projects/{project_id}/locations/{location_id}/instances/{instance_id}` - # where `location_id` refers to a GCP region. - # @!attribute [rw] reschedule_type - # @return [::Google::Cloud::Redis::V1beta1::RescheduleMaintenanceRequest::RescheduleType] - # Required. If reschedule type is SPECIFIC_TIME, must set up schedule_time as well. - # @!attribute [rw] schedule_time - # @return [::Google::Protobuf::Timestamp] - # Optional. Timestamp when the maintenance shall be rescheduled to if - # reschedule_type=SPECIFIC_TIME, in RFC 3339 format, for - # example `2012-11-15T16:19:00.094Z`. - class RescheduleMaintenanceRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - - # Reschedule options. - module RescheduleType - # Not set. - RESCHEDULE_TYPE_UNSPECIFIED = 0 - - # If the user wants to schedule the maintenance to happen now. - IMMEDIATE = 1 - - # If the user wants to use the existing maintenance policy to find the - # next available window. - NEXT_AVAILABLE_WINDOW = 2 - - # If the user wants to reschedule the maintenance to a specific time. - SPECIFIC_TIME = 3 - end - end - - # Maintenance policy for an instance. - # @!attribute [r] create_time - # @return [::Google::Protobuf::Timestamp] - # Output only. The time when the policy was created. - # @!attribute [r] update_time - # @return [::Google::Protobuf::Timestamp] - # Output only. The time when the policy was last updated. - # @!attribute [rw] description - # @return [::String] - # Optional. Description of what this policy is for. Create/Update methods - # return INVALID_ARGUMENT if the length is greater than 512. - # @!attribute [rw] weekly_maintenance_window - # @return [::Array<::Google::Cloud::Redis::V1beta1::WeeklyMaintenanceWindow>] - # Optional. Maintenance window that is applied to resources covered by this - # policy. Minimum 1. For the current version, the maximum number of - # weekly_window is expected to be one. - class MaintenancePolicy - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Time window in which disruptive maintenance updates occur. Non-disruptive - # updates can occur inside or outside this window. - # @!attribute [rw] day - # @return [::Google::Type::DayOfWeek] - # Required. The day of week that maintenance updates occur. - # @!attribute [rw] start_time - # @return [::Google::Type::TimeOfDay] - # Required. Start time of the window in UTC time. - # @!attribute [r] duration - # @return [::Google::Protobuf::Duration] - # Output only. Duration of the maintenance window. The current window is fixed at 1 hour. - class WeeklyMaintenanceWindow - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Upcoming maintenance schedule. If no maintenance is scheduled, fields are not - # populated. - # @!attribute [r] start_time - # @return [::Google::Protobuf::Timestamp] - # Output only. The start time of any upcoming scheduled maintenance for this instance. - # @!attribute [r] end_time - # @return [::Google::Protobuf::Timestamp] - # Output only. The end time of any upcoming scheduled maintenance for this instance. - # @!attribute [rw] can_reschedule - # @deprecated This field is deprecated and may be removed in the next major version update. - # @return [::Boolean] - # If the scheduled maintenance can be rescheduled, default is true. - # @!attribute [r] schedule_deadline_time - # @return [::Google::Protobuf::Timestamp] - # Output only. The deadline that the maintenance schedule start time can not go beyond, - # including reschedule. - class MaintenanceSchedule - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Request for {::Google::Cloud::Redis::V1beta1::CloudRedis::Client#list_instances ListInstances}. - # @!attribute [rw] parent - # @return [::String] - # Required. The resource name of the instance location using the form: - # `projects/{project_id}/locations/{location_id}` - # where `location_id` refers to a GCP region. - # @!attribute [rw] page_size - # @return [::Integer] - # The maximum number of items to return. - # - # If not specified, a default value of 1000 will be used by the service. - # Regardless of the page_size value, the response may include a partial list - # and a caller should only rely on response's - # {::Google::Cloud::Redis::V1beta1::ListInstancesResponse#next_page_token `next_page_token`} - # to determine if there are more instances left to be queried. - # @!attribute [rw] page_token - # @return [::String] - # The `next_page_token` value returned from a previous - # {::Google::Cloud::Redis::V1beta1::CloudRedis::Client#list_instances ListInstances} request, if any. - class ListInstancesRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Response for {::Google::Cloud::Redis::V1beta1::CloudRedis::Client#list_instances ListInstances}. - # @!attribute [rw] instances - # @return [::Array<::Google::Cloud::Redis::V1beta1::Instance>] - # A list of Redis instances in the project in the specified location, - # or across all locations. - # - # If the `location_id` in the parent field of the request is "-", all regions - # available to the project are queried, and the results aggregated. - # If in such an aggregated query a location is unavailable, a placeholder - # Redis entry is included in the response with the `name` field set to a - # value of the form - # `projects/{project_id}/locations/{location_id}/instances/`- and the - # `status` field set to ERROR and `status_message` field set to "location not - # available for ListInstances". - # @!attribute [rw] next_page_token - # @return [::String] - # Token to retrieve the next page of results, or empty if there are no more - # results in the list. - # @!attribute [rw] unreachable - # @return [::Array<::String>] - # Locations that could not be reached. - class ListInstancesResponse - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Request for {::Google::Cloud::Redis::V1beta1::CloudRedis::Client#get_instance GetInstance}. - # @!attribute [rw] name - # @return [::String] - # Required. Redis instance resource name using the form: - # `projects/{project_id}/locations/{location_id}/instances/{instance_id}` - # where `location_id` refers to a GCP region. - class GetInstanceRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Request for {::Google::Cloud::Redis::V1beta1::CloudRedis::Client#get_instance_auth_string GetInstanceAuthString}. - # @!attribute [rw] name - # @return [::String] - # Required. Redis instance resource name using the form: - # `projects/{project_id}/locations/{location_id}/instances/{instance_id}` - # where `location_id` refers to a GCP region. - class GetInstanceAuthStringRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Instance AUTH string details. - # @!attribute [rw] auth_string - # @return [::String] - # AUTH string set on the instance. - class InstanceAuthString - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Request for {::Google::Cloud::Redis::V1beta1::CloudRedis::Client#create_instance CreateInstance}. - # @!attribute [rw] parent - # @return [::String] - # Required. The resource name of the instance location using the form: - # `projects/{project_id}/locations/{location_id}` - # where `location_id` refers to a GCP region. - # @!attribute [rw] instance_id - # @return [::String] - # Required. The logical name of the Redis instance in the customer project - # with the following restrictions: - # - # * Must contain only lowercase letters, numbers, and hyphens. - # * Must start with a letter. - # * Must be between 1-40 characters. - # * Must end with a number or a letter. - # * Must be unique within the customer project / location - # @!attribute [rw] instance - # @return [::Google::Cloud::Redis::V1beta1::Instance] - # Required. A Redis [Instance] resource - class CreateInstanceRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Request for {::Google::Cloud::Redis::V1beta1::CloudRedis::Client#update_instance UpdateInstance}. - # @!attribute [rw] update_mask - # @return [::Google::Protobuf::FieldMask] - # Required. Mask of fields to update. At least one path must be supplied in - # this field. The elements of the repeated paths field may only include these - # fields from {::Google::Cloud::Redis::V1beta1::Instance Instance}: - # - # * `displayName` - # * `labels` - # * `memorySizeGb` - # * `redisConfig` - # * `replica_count` - # @!attribute [rw] instance - # @return [::Google::Cloud::Redis::V1beta1::Instance] - # Required. Update description. - # Only fields specified in update_mask are updated. - class UpdateInstanceRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Request for {::Google::Cloud::Redis::V1beta1::CloudRedis::Client#upgrade_instance UpgradeInstance}. - # @!attribute [rw] name - # @return [::String] - # Required. Redis instance resource name using the form: - # `projects/{project_id}/locations/{location_id}/instances/{instance_id}` - # where `location_id` refers to a GCP region. - # @!attribute [rw] redis_version - # @return [::String] - # Required. Specifies the target version of Redis software to upgrade to. - class UpgradeInstanceRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Request for {::Google::Cloud::Redis::V1beta1::CloudRedis::Client#delete_instance DeleteInstance}. - # @!attribute [rw] name - # @return [::String] - # Required. Redis instance resource name using the form: - # `projects/{project_id}/locations/{location_id}/instances/{instance_id}` - # where `location_id` refers to a GCP region. - class DeleteInstanceRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # The Cloud Storage location for the input content - # @!attribute [rw] uri - # @return [::String] - # Required. Source data URI. (e.g. 'gs://my_bucket/my_object'). - class GcsSource - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # The input content - # @!attribute [rw] gcs_source - # @return [::Google::Cloud::Redis::V1beta1::GcsSource] - # Google Cloud Storage location where input content is located. - class InputConfig - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Request for {::Google::Cloud::Redis::V1beta1::CloudRedis::Client#import_instance Import}. - # @!attribute [rw] name - # @return [::String] - # Required. Redis instance resource name using the form: - # `projects/{project_id}/locations/{location_id}/instances/{instance_id}` - # where `location_id` refers to a GCP region. - # @!attribute [rw] input_config - # @return [::Google::Cloud::Redis::V1beta1::InputConfig] - # Required. Specify data to be imported. - class ImportInstanceRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # The Cloud Storage location for the output content - # @!attribute [rw] uri - # @return [::String] - # Required. Data destination URI (e.g. - # 'gs://my_bucket/my_object'). Existing files will be overwritten. - class GcsDestination - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # The output content - # @!attribute [rw] gcs_destination - # @return [::Google::Cloud::Redis::V1beta1::GcsDestination] - # Google Cloud Storage destination for output content. - class OutputConfig - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Request for {::Google::Cloud::Redis::V1beta1::CloudRedis::Client#export_instance Export}. - # @!attribute [rw] name - # @return [::String] - # Required. Redis instance resource name using the form: - # `projects/{project_id}/locations/{location_id}/instances/{instance_id}` - # where `location_id` refers to a GCP region. - # @!attribute [rw] output_config - # @return [::Google::Cloud::Redis::V1beta1::OutputConfig] - # Required. Specify data to be exported. - class ExportInstanceRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Request for {::Google::Cloud::Redis::V1beta1::CloudRedis::Client#failover_instance Failover}. - # @!attribute [rw] name - # @return [::String] - # Required. Redis instance resource name using the form: - # `projects/{project_id}/locations/{location_id}/instances/{instance_id}` - # where `location_id` refers to a GCP region. - # @!attribute [rw] data_protection_mode - # @return [::Google::Cloud::Redis::V1beta1::FailoverInstanceRequest::DataProtectionMode] - # Optional. Available data protection modes that the user can choose. If it's - # unspecified, data protection mode will be LIMITED_DATA_LOSS by default. - class FailoverInstanceRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - - # Specifies different modes of operation in relation to the data retention. - module DataProtectionMode - # Defaults to LIMITED_DATA_LOSS if a data protection mode is not - # specified. - DATA_PROTECTION_MODE_UNSPECIFIED = 0 - - # Instance failover will be protected with data loss control. More - # specifically, the failover will only be performed if the current - # replication offset diff between primary and replica is under a certain - # threshold. - LIMITED_DATA_LOSS = 1 - - # Instance failover will be performed without data loss control. - FORCE_DATA_LOSS = 2 - end - end - - # This location metadata represents additional configuration options for a - # given location where a Redis instance may be created. All fields are output - # only. It is returned as content of the - # `google.cloud.location.Location.metadata` field. - # @!attribute [r] available_zones - # @return [::Google::Protobuf::Map{::String => ::Google::Cloud::Redis::V1beta1::ZoneMetadata}] - # Output only. The set of available zones in the location. The map is keyed - # by the lowercase ID of each zone, as defined by GCE. These keys can be - # specified in `location_id` or `alternative_location_id` fields when - # creating a Redis instance. - class LocationMetadata - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - - # @!attribute [rw] key - # @return [::String] - # @!attribute [rw] value - # @return [::Google::Cloud::Redis::V1beta1::ZoneMetadata] - class AvailableZonesEntry - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - end - - # Defines specific information for a particular zone. Currently empty and - # reserved for future use only. - class ZoneMetadata - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # TlsCertificate Resource - # @!attribute [rw] serial_number - # @return [::String] - # Serial number, as extracted from the certificate. - # @!attribute [rw] cert - # @return [::String] - # PEM representation. - # @!attribute [r] create_time - # @return [::Google::Protobuf::Timestamp] - # Output only. The time when the certificate was created in [RFC - # 3339](https://tools.ietf.org/html/rfc3339) format, for example - # `2020-05-18T00:00:00.094Z`. - # @!attribute [r] expire_time - # @return [::Google::Protobuf::Timestamp] - # Output only. The time when the certificate expires in [RFC - # 3339](https://tools.ietf.org/html/rfc3339) format, for example - # `2020-05-18T00:00:00.094Z`. - # @!attribute [rw] sha1_fingerprint - # @return [::String] - # Sha1 Fingerprint of the certificate. - class TlsCertificate - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - end - end - end -end diff --git a/owl-bot-staging/google-cloud-redis-v1beta1/proto_docs/google/longrunning/operations.rb b/owl-bot-staging/google-cloud-redis-v1beta1/proto_docs/google/longrunning/operations.rb deleted file mode 100644 index 7a757f512165..000000000000 --- a/owl-bot-staging/google-cloud-redis-v1beta1/proto_docs/google/longrunning/operations.rb +++ /dev/null @@ -1,191 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - - -module Google - module Longrunning - # This resource represents a long-running operation that is the result of a - # network API call. - # @!attribute [rw] name - # @return [::String] - # The server-assigned name, which is only unique within the same service that - # originally returns it. If you use the default HTTP mapping, the - # `name` should be a resource name ending with `operations/{unique_id}`. - # @!attribute [rw] metadata - # @return [::Google::Protobuf::Any] - # Service-specific metadata associated with the operation. It typically - # contains progress information and common metadata such as create time. - # Some services might not provide such metadata. Any method that returns a - # long-running operation should document the metadata type, if any. - # @!attribute [rw] done - # @return [::Boolean] - # If the value is `false`, it means the operation is still in progress. - # If `true`, the operation is completed, and either `error` or `response` is - # available. - # @!attribute [rw] error - # @return [::Google::Rpc::Status] - # The error result of the operation in case of failure or cancellation. - # - # Note: The following fields are mutually exclusive: `error`, `response`. If a field in that set is populated, all other fields in the set will automatically be cleared. - # @!attribute [rw] response - # @return [::Google::Protobuf::Any] - # The normal, successful response of the operation. If the original - # method returns no data on success, such as `Delete`, the response is - # `google.protobuf.Empty`. If the original method is standard - # `Get`/`Create`/`Update`, the response should be the resource. For other - # methods, the response should have the type `XxxResponse`, where `Xxx` - # is the original method name. For example, if the original method name - # is `TakeSnapshot()`, the inferred response type is - # `TakeSnapshotResponse`. - # - # Note: The following fields are mutually exclusive: `response`, `error`. If a field in that set is populated, all other fields in the set will automatically be cleared. - class Operation - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # The request message for - # Operations.GetOperation. - # @!attribute [rw] name - # @return [::String] - # The name of the operation resource. - class GetOperationRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # The request message for - # Operations.ListOperations. - # @!attribute [rw] name - # @return [::String] - # The name of the operation's parent resource. - # @!attribute [rw] filter - # @return [::String] - # The standard list filter. - # @!attribute [rw] page_size - # @return [::Integer] - # The standard list page size. - # @!attribute [rw] page_token - # @return [::String] - # The standard list page token. - # @!attribute [rw] return_partial_success - # @return [::Boolean] - # When set to `true`, operations that are reachable are returned as normal, - # and those that are unreachable are returned in the - # [ListOperationsResponse.unreachable] field. - # - # This can only be `true` when reading across collections e.g. when `parent` - # is set to `"projects/example/locations/-"`. - # - # This field is not by default supported and will result in an - # `UNIMPLEMENTED` error if set unless explicitly documented otherwise in - # service or product specific documentation. - class ListOperationsRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # The response message for - # Operations.ListOperations. - # @!attribute [rw] operations - # @return [::Array<::Google::Longrunning::Operation>] - # A list of operations that matches the specified filter in the request. - # @!attribute [rw] next_page_token - # @return [::String] - # The standard List next-page token. - # @!attribute [rw] unreachable - # @return [::Array<::String>] - # Unordered list. Unreachable resources. Populated when the request sets - # `ListOperationsRequest.return_partial_success` and reads across - # collections e.g. when attempting to list all resources across all supported - # locations. - class ListOperationsResponse - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # The request message for - # Operations.CancelOperation. - # @!attribute [rw] name - # @return [::String] - # The name of the operation resource to be cancelled. - class CancelOperationRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # The request message for - # Operations.DeleteOperation. - # @!attribute [rw] name - # @return [::String] - # The name of the operation resource to be deleted. - class DeleteOperationRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # The request message for - # Operations.WaitOperation. - # @!attribute [rw] name - # @return [::String] - # The name of the operation resource to wait on. - # @!attribute [rw] timeout - # @return [::Google::Protobuf::Duration] - # The maximum duration to wait before timing out. If left blank, the wait - # will be at most the time permitted by the underlying HTTP/RPC protocol. - # If RPC context deadline is also specified, the shorter one will be used. - class WaitOperationRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # A message representing the message types used by a long-running operation. - # - # Example: - # - # rpc Export(ExportRequest) returns (google.longrunning.Operation) { - # option (google.longrunning.operation_info) = { - # response_type: "ExportResponse" - # metadata_type: "ExportMetadata" - # }; - # } - # @!attribute [rw] response_type - # @return [::String] - # Required. The message name of the primary return type for this - # long-running operation. - # This type will be used to deserialize the LRO's response. - # - # If the response is in a different package from the rpc, a fully-qualified - # message name must be used (e.g. `google.protobuf.Struct`). - # - # Note: Altering this value constitutes a breaking change. - # @!attribute [rw] metadata_type - # @return [::String] - # Required. The message name of the metadata type for this long-running - # operation. - # - # If the response is in a different package from the rpc, a fully-qualified - # message name must be used (e.g. `google.protobuf.Struct`). - # - # Note: Altering this value constitutes a breaking change. - class OperationInfo - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - end -end diff --git a/owl-bot-staging/google-cloud-redis-v1beta1/proto_docs/google/protobuf/any.rb b/owl-bot-staging/google-cloud-redis-v1beta1/proto_docs/google/protobuf/any.rb deleted file mode 100644 index 58691995f02e..000000000000 --- a/owl-bot-staging/google-cloud-redis-v1beta1/proto_docs/google/protobuf/any.rb +++ /dev/null @@ -1,145 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - - -module Google - module Protobuf - # `Any` contains an arbitrary serialized protocol buffer message along with a - # URL that describes the type of the serialized message. - # - # Protobuf library provides support to pack/unpack Any values in the form - # of utility functions or additional generated methods of the Any type. - # - # Example 1: Pack and unpack a message in C++. - # - # Foo foo = ...; - # Any any; - # any.PackFrom(foo); - # ... - # if (any.UnpackTo(&foo)) { - # ... - # } - # - # Example 2: Pack and unpack a message in Java. - # - # Foo foo = ...; - # Any any = Any.pack(foo); - # ... - # if (any.is(Foo.class)) { - # foo = any.unpack(Foo.class); - # } - # // or ... - # if (any.isSameTypeAs(Foo.getDefaultInstance())) { - # foo = any.unpack(Foo.getDefaultInstance()); - # } - # - # Example 3: Pack and unpack a message in Python. - # - # foo = Foo(...) - # any = Any() - # any.Pack(foo) - # ... - # if any.Is(Foo.DESCRIPTOR): - # any.Unpack(foo) - # ... - # - # Example 4: Pack and unpack a message in Go - # - # foo := &pb.Foo{...} - # any, err := anypb.New(foo) - # if err != nil { - # ... - # } - # ... - # foo := &pb.Foo{} - # if err := any.UnmarshalTo(foo); err != nil { - # ... - # } - # - # The pack methods provided by protobuf library will by default use - # 'type.googleapis.com/full.type.name' as the type URL and the unpack - # methods only use the fully qualified type name after the last '/' - # in the type URL, for example "foo.bar.com/x/y.z" will yield type - # name "y.z". - # - # JSON - # ==== - # The JSON representation of an `Any` value uses the regular - # representation of the deserialized, embedded message, with an - # additional field `@type` which contains the type URL. Example: - # - # package google.profile; - # message Person { - # string first_name = 1; - # string last_name = 2; - # } - # - # { - # "@type": "type.googleapis.com/google.profile.Person", - # "firstName": , - # "lastName": - # } - # - # If the embedded message type is well-known and has a custom JSON - # representation, that representation will be embedded adding a field - # `value` which holds the custom JSON in addition to the `@type` - # field. Example (for message [google.protobuf.Duration][]): - # - # { - # "@type": "type.googleapis.com/google.protobuf.Duration", - # "value": "1.212s" - # } - # @!attribute [rw] type_url - # @return [::String] - # A URL/resource name that uniquely identifies the type of the serialized - # protocol buffer message. This string must contain at least - # one "/" character. The last segment of the URL's path must represent - # the fully qualified name of the type (as in - # `path/google.protobuf.Duration`). The name should be in a canonical form - # (e.g., leading "." is not accepted). - # - # In practice, teams usually precompile into the binary all types that they - # expect it to use in the context of Any. However, for URLs which use the - # scheme `http`, `https`, or no scheme, one can optionally set up a type - # server that maps type URLs to message definitions as follows: - # - # * If no scheme is provided, `https` is assumed. - # * An HTTP GET on the URL must yield a [google.protobuf.Type][] - # value in binary format, or produce an error. - # * Applications are allowed to cache lookup results based on the - # URL, or have them precompiled into a binary to avoid any - # lookup. Therefore, binary compatibility needs to be preserved - # on changes to types. (Use versioned type names to manage - # breaking changes.) - # - # Note: this functionality is not currently available in the official - # protobuf release, and it is not used for type URLs beginning with - # type.googleapis.com. As of May 2023, there are no widely used type server - # implementations and no plans to implement one. - # - # Schemes other than `http`, `https` (or the empty scheme) might be - # used with implementation specific semantics. - # @!attribute [rw] value - # @return [::String] - # Must be a valid serialized protocol buffer of the above specified type. - class Any - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - end -end diff --git a/owl-bot-staging/google-cloud-redis-v1beta1/proto_docs/google/protobuf/duration.rb b/owl-bot-staging/google-cloud-redis-v1beta1/proto_docs/google/protobuf/duration.rb deleted file mode 100644 index ea59f1f91daf..000000000000 --- a/owl-bot-staging/google-cloud-redis-v1beta1/proto_docs/google/protobuf/duration.rb +++ /dev/null @@ -1,98 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - - -module Google - module Protobuf - # A Duration represents a signed, fixed-length span of time represented - # as a count of seconds and fractions of seconds at nanosecond - # resolution. It is independent of any calendar and concepts like "day" - # or "month". It is related to Timestamp in that the difference between - # two Timestamp values is a Duration and it can be added or subtracted - # from a Timestamp. Range is approximately +-10,000 years. - # - # # Examples - # - # Example 1: Compute Duration from two Timestamps in pseudo code. - # - # Timestamp start = ...; - # Timestamp end = ...; - # Duration duration = ...; - # - # duration.seconds = end.seconds - start.seconds; - # duration.nanos = end.nanos - start.nanos; - # - # if (duration.seconds < 0 && duration.nanos > 0) { - # duration.seconds += 1; - # duration.nanos -= 1000000000; - # } else if (duration.seconds > 0 && duration.nanos < 0) { - # duration.seconds -= 1; - # duration.nanos += 1000000000; - # } - # - # Example 2: Compute Timestamp from Timestamp + Duration in pseudo code. - # - # Timestamp start = ...; - # Duration duration = ...; - # Timestamp end = ...; - # - # end.seconds = start.seconds + duration.seconds; - # end.nanos = start.nanos + duration.nanos; - # - # if (end.nanos < 0) { - # end.seconds -= 1; - # end.nanos += 1000000000; - # } else if (end.nanos >= 1000000000) { - # end.seconds += 1; - # end.nanos -= 1000000000; - # } - # - # Example 3: Compute Duration from datetime.timedelta in Python. - # - # td = datetime.timedelta(days=3, minutes=10) - # duration = Duration() - # duration.FromTimedelta(td) - # - # # JSON Mapping - # - # In JSON format, the Duration type is encoded as a string rather than an - # object, where the string ends in the suffix "s" (indicating seconds) and - # is preceded by the number of seconds, with nanoseconds expressed as - # fractional seconds. For example, 3 seconds with 0 nanoseconds should be - # encoded in JSON format as "3s", while 3 seconds and 1 nanosecond should - # be expressed in JSON format as "3.000000001s", and 3 seconds and 1 - # microsecond should be expressed in JSON format as "3.000001s". - # @!attribute [rw] seconds - # @return [::Integer] - # Signed seconds of the span of time. Must be from -315,576,000,000 - # to +315,576,000,000 inclusive. Note: these bounds are computed from: - # 60 sec/min * 60 min/hr * 24 hr/day * 365.25 days/year * 10000 years - # @!attribute [rw] nanos - # @return [::Integer] - # Signed fractions of a second at nanosecond resolution of the span - # of time. Durations less than one second are represented with a 0 - # `seconds` field and a positive or negative `nanos` field. For durations - # of one second or more, a non-zero value for the `nanos` field must be - # of the same sign as the `seconds` field. Must be from -999,999,999 - # to +999,999,999 inclusive. - class Duration - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - end -end diff --git a/owl-bot-staging/google-cloud-redis-v1beta1/proto_docs/google/protobuf/empty.rb b/owl-bot-staging/google-cloud-redis-v1beta1/proto_docs/google/protobuf/empty.rb deleted file mode 100644 index 83e4481834a6..000000000000 --- a/owl-bot-staging/google-cloud-redis-v1beta1/proto_docs/google/protobuf/empty.rb +++ /dev/null @@ -1,34 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - - -module Google - module Protobuf - # A generic empty message that you can re-use to avoid defining duplicated - # empty messages in your APIs. A typical example is to use it as the request - # or the response type of an API method. For instance: - # - # service Foo { - # rpc Bar(google.protobuf.Empty) returns (google.protobuf.Empty); - # } - class Empty - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - end -end diff --git a/owl-bot-staging/google-cloud-redis-v1beta1/proto_docs/google/protobuf/field_mask.rb b/owl-bot-staging/google-cloud-redis-v1beta1/proto_docs/google/protobuf/field_mask.rb deleted file mode 100644 index 7f3ffc78601a..000000000000 --- a/owl-bot-staging/google-cloud-redis-v1beta1/proto_docs/google/protobuf/field_mask.rb +++ /dev/null @@ -1,229 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - - -module Google - module Protobuf - # `FieldMask` represents a set of symbolic field paths, for example: - # - # paths: "f.a" - # paths: "f.b.d" - # - # Here `f` represents a field in some root message, `a` and `b` - # fields in the message found in `f`, and `d` a field found in the - # message in `f.b`. - # - # Field masks are used to specify a subset of fields that should be - # returned by a get operation or modified by an update operation. - # Field masks also have a custom JSON encoding (see below). - # - # # Field Masks in Projections - # - # When used in the context of a projection, a response message or - # sub-message is filtered by the API to only contain those fields as - # specified in the mask. For example, if the mask in the previous - # example is applied to a response message as follows: - # - # f { - # a : 22 - # b { - # d : 1 - # x : 2 - # } - # y : 13 - # } - # z: 8 - # - # The result will not contain specific values for fields x,y and z - # (their value will be set to the default, and omitted in proto text - # output): - # - # - # f { - # a : 22 - # b { - # d : 1 - # } - # } - # - # A repeated field is not allowed except at the last position of a - # paths string. - # - # If a FieldMask object is not present in a get operation, the - # operation applies to all fields (as if a FieldMask of all fields - # had been specified). - # - # Note that a field mask does not necessarily apply to the - # top-level response message. In case of a REST get operation, the - # field mask applies directly to the response, but in case of a REST - # list operation, the mask instead applies to each individual message - # in the returned resource list. In case of a REST custom method, - # other definitions may be used. Where the mask applies will be - # clearly documented together with its declaration in the API. In - # any case, the effect on the returned resource/resources is required - # behavior for APIs. - # - # # Field Masks in Update Operations - # - # A field mask in update operations specifies which fields of the - # targeted resource are going to be updated. The API is required - # to only change the values of the fields as specified in the mask - # and leave the others untouched. If a resource is passed in to - # describe the updated values, the API ignores the values of all - # fields not covered by the mask. - # - # If a repeated field is specified for an update operation, new values will - # be appended to the existing repeated field in the target resource. Note that - # a repeated field is only allowed in the last position of a `paths` string. - # - # If a sub-message is specified in the last position of the field mask for an - # update operation, then new value will be merged into the existing sub-message - # in the target resource. - # - # For example, given the target message: - # - # f { - # b { - # d: 1 - # x: 2 - # } - # c: [1] - # } - # - # And an update message: - # - # f { - # b { - # d: 10 - # } - # c: [2] - # } - # - # then if the field mask is: - # - # paths: ["f.b", "f.c"] - # - # then the result will be: - # - # f { - # b { - # d: 10 - # x: 2 - # } - # c: [1, 2] - # } - # - # An implementation may provide options to override this default behavior for - # repeated and message fields. - # - # In order to reset a field's value to the default, the field must - # be in the mask and set to the default value in the provided resource. - # Hence, in order to reset all fields of a resource, provide a default - # instance of the resource and set all fields in the mask, or do - # not provide a mask as described below. - # - # If a field mask is not present on update, the operation applies to - # all fields (as if a field mask of all fields has been specified). - # Note that in the presence of schema evolution, this may mean that - # fields the client does not know and has therefore not filled into - # the request will be reset to their default. If this is unwanted - # behavior, a specific service may require a client to always specify - # a field mask, producing an error if not. - # - # As with get operations, the location of the resource which - # describes the updated values in the request message depends on the - # operation kind. In any case, the effect of the field mask is - # required to be honored by the API. - # - # ## Considerations for HTTP REST - # - # The HTTP kind of an update operation which uses a field mask must - # be set to PATCH instead of PUT in order to satisfy HTTP semantics - # (PUT must only be used for full updates). - # - # # JSON Encoding of Field Masks - # - # In JSON, a field mask is encoded as a single string where paths are - # separated by a comma. Fields name in each path are converted - # to/from lower-camel naming conventions. - # - # As an example, consider the following message declarations: - # - # message Profile { - # User user = 1; - # Photo photo = 2; - # } - # message User { - # string display_name = 1; - # string address = 2; - # } - # - # In proto a field mask for `Profile` may look as such: - # - # mask { - # paths: "user.display_name" - # paths: "photo" - # } - # - # In JSON, the same mask is represented as below: - # - # { - # mask: "user.displayName,photo" - # } - # - # # Field Masks and Oneof Fields - # - # Field masks treat fields in oneofs just as regular fields. Consider the - # following message: - # - # message SampleMessage { - # oneof test_oneof { - # string name = 4; - # SubMessage sub_message = 9; - # } - # } - # - # The field mask can be: - # - # mask { - # paths: "name" - # } - # - # Or: - # - # mask { - # paths: "sub_message" - # } - # - # Note that oneof type names ("test_oneof" in this case) cannot be used in - # paths. - # - # ## Field Mask Verification - # - # The implementation of any API method which has a FieldMask type field in the - # request should verify the included field paths, and return an - # `INVALID_ARGUMENT` error if any path is unmappable. - # @!attribute [rw] paths - # @return [::Array<::String>] - # The set of field mask paths. - class FieldMask - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - end -end diff --git a/owl-bot-staging/google-cloud-redis-v1beta1/proto_docs/google/protobuf/timestamp.rb b/owl-bot-staging/google-cloud-redis-v1beta1/proto_docs/google/protobuf/timestamp.rb deleted file mode 100644 index 74352be9c58c..000000000000 --- a/owl-bot-staging/google-cloud-redis-v1beta1/proto_docs/google/protobuf/timestamp.rb +++ /dev/null @@ -1,127 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - - -module Google - module Protobuf - # A Timestamp represents a point in time independent of any time zone or local - # calendar, encoded as a count of seconds and fractions of seconds at - # nanosecond resolution. The count is relative to an epoch at UTC midnight on - # January 1, 1970, in the proleptic Gregorian calendar which extends the - # Gregorian calendar backwards to year one. - # - # All minutes are 60 seconds long. Leap seconds are "smeared" so that no leap - # second table is needed for interpretation, using a [24-hour linear - # smear](https://developers.google.com/time/smear). - # - # The range is from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59.999999999Z. By - # restricting to that range, we ensure that we can convert to and from [RFC - # 3339](https://www.ietf.org/rfc/rfc3339.txt) date strings. - # - # # Examples - # - # Example 1: Compute Timestamp from POSIX `time()`. - # - # Timestamp timestamp; - # timestamp.set_seconds(time(NULL)); - # timestamp.set_nanos(0); - # - # Example 2: Compute Timestamp from POSIX `gettimeofday()`. - # - # struct timeval tv; - # gettimeofday(&tv, NULL); - # - # Timestamp timestamp; - # timestamp.set_seconds(tv.tv_sec); - # timestamp.set_nanos(tv.tv_usec * 1000); - # - # Example 3: Compute Timestamp from Win32 `GetSystemTimeAsFileTime()`. - # - # FILETIME ft; - # GetSystemTimeAsFileTime(&ft); - # UINT64 ticks = (((UINT64)ft.dwHighDateTime) << 32) | ft.dwLowDateTime; - # - # // A Windows tick is 100 nanoseconds. Windows epoch 1601-01-01T00:00:00Z - # // is 11644473600 seconds before Unix epoch 1970-01-01T00:00:00Z. - # Timestamp timestamp; - # timestamp.set_seconds((INT64) ((ticks / 10000000) - 11644473600LL)); - # timestamp.set_nanos((INT32) ((ticks % 10000000) * 100)); - # - # Example 4: Compute Timestamp from Java `System.currentTimeMillis()`. - # - # long millis = System.currentTimeMillis(); - # - # Timestamp timestamp = Timestamp.newBuilder().setSeconds(millis / 1000) - # .setNanos((int) ((millis % 1000) * 1000000)).build(); - # - # Example 5: Compute Timestamp from Java `Instant.now()`. - # - # Instant now = Instant.now(); - # - # Timestamp timestamp = - # Timestamp.newBuilder().setSeconds(now.getEpochSecond()) - # .setNanos(now.getNano()).build(); - # - # Example 6: Compute Timestamp from current time in Python. - # - # timestamp = Timestamp() - # timestamp.GetCurrentTime() - # - # # JSON Mapping - # - # In JSON format, the Timestamp type is encoded as a string in the - # [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format. That is, the - # format is "\\{year}-\\{month}-\\{day}T\\{hour}:\\{min}:\\{sec}[.\\{frac_sec}]Z" - # where \\{year} is always expressed using four digits while \\{month}, \\{day}, - # \\{hour}, \\{min}, and \\{sec} are zero-padded to two digits each. The fractional - # seconds, which can go up to 9 digits (i.e. up to 1 nanosecond resolution), - # are optional. The "Z" suffix indicates the timezone ("UTC"); the timezone - # is required. A proto3 JSON serializer should always use UTC (as indicated by - # "Z") when printing the Timestamp type and a proto3 JSON parser should be - # able to accept both UTC and other timezones (as indicated by an offset). - # - # For example, "2017-01-15T01:30:15.01Z" encodes 15.01 seconds past - # 01:30 UTC on January 15, 2017. - # - # In JavaScript, one can convert a Date object to this format using the - # standard - # [toISOString()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toISOString) - # method. In Python, a standard `datetime.datetime` object can be converted - # to this format using - # [`strftime`](https://docs.python.org/2/library/time.html#time.strftime) with - # the time format spec '%Y-%m-%dT%H:%M:%S.%fZ'. Likewise, in Java, one can use - # the Joda Time's [`ISODateTimeFormat.dateTime()`]( - # http://joda-time.sourceforge.net/apidocs/org/joda/time/format/ISODateTimeFormat.html#dateTime() - # ) to obtain a formatter capable of generating timestamps in this format. - # @!attribute [rw] seconds - # @return [::Integer] - # Represents seconds of UTC time since Unix epoch - # 1970-01-01T00:00:00Z. Must be from 0001-01-01T00:00:00Z to - # 9999-12-31T23:59:59Z inclusive. - # @!attribute [rw] nanos - # @return [::Integer] - # Non-negative fractions of a second at nanosecond resolution. Negative - # second values with fractions must still have non-negative nanos values - # that count forward in time. Must be from 0 to 999,999,999 - # inclusive. - class Timestamp - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - end -end diff --git a/owl-bot-staging/google-cloud-redis-v1beta1/proto_docs/google/rpc/status.rb b/owl-bot-staging/google-cloud-redis-v1beta1/proto_docs/google/rpc/status.rb deleted file mode 100644 index c1a1c07eb2db..000000000000 --- a/owl-bot-staging/google-cloud-redis-v1beta1/proto_docs/google/rpc/status.rb +++ /dev/null @@ -1,48 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - - -module Google - module Rpc - # The `Status` type defines a logical error model that is suitable for - # different programming environments, including REST APIs and RPC APIs. It is - # used by [gRPC](https://github.com/grpc). Each `Status` message contains - # three pieces of data: error code, error message, and error details. - # - # You can find out more about this error model and how to work with it in the - # [API Design Guide](https://cloud.google.com/apis/design/errors). - # @!attribute [rw] code - # @return [::Integer] - # The status code, which should be an enum value of - # [google.rpc.Code][google.rpc.Code]. - # @!attribute [rw] message - # @return [::String] - # A developer-facing error message, which should be in English. Any - # user-facing error message should be localized and sent in the - # {::Google::Rpc::Status#details google.rpc.Status.details} field, or localized - # by the client. - # @!attribute [rw] details - # @return [::Array<::Google::Protobuf::Any>] - # A list of messages that carry the error details. There is a common set of - # message types for APIs to use. - class Status - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - end -end diff --git a/owl-bot-staging/google-cloud-redis-v1beta1/proto_docs/google/type/dayofweek.rb b/owl-bot-staging/google-cloud-redis-v1beta1/proto_docs/google/type/dayofweek.rb deleted file mode 100644 index 973211b9ffe7..000000000000 --- a/owl-bot-staging/google-cloud-redis-v1beta1/proto_docs/google/type/dayofweek.rb +++ /dev/null @@ -1,49 +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 day of the week. - module DayOfWeek - # The day of the week is unspecified. - DAY_OF_WEEK_UNSPECIFIED = 0 - - # Monday - MONDAY = 1 - - # Tuesday - TUESDAY = 2 - - # Wednesday - WEDNESDAY = 3 - - # Thursday - THURSDAY = 4 - - # Friday - FRIDAY = 5 - - # Saturday - SATURDAY = 6 - - # Sunday - SUNDAY = 7 - end - end -end diff --git a/owl-bot-staging/google-cloud-redis-v1beta1/proto_docs/google/type/timeofday.rb b/owl-bot-staging/google-cloud-redis-v1beta1/proto_docs/google/type/timeofday.rb deleted file mode 100644 index 8372dad8beb8..000000000000 --- a/owl-bot-staging/google-cloud-redis-v1beta1/proto_docs/google/type/timeofday.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! - - -module Google - module Type - # Represents a time of day. The date and time zone are either not significant - # or are specified elsewhere. An API may choose to allow leap seconds. Related - # types are [google.type.Date][google.type.Date] and - # `google.protobuf.Timestamp`. - # @!attribute [rw] hours - # @return [::Integer] - # Hours of day in 24 hour format. Should be from 0 to 23. An API may choose - # to allow the value "24:00:00" for scenarios like business closing time. - # @!attribute [rw] minutes - # @return [::Integer] - # Minutes of hour of day. Must be from 0 to 59. - # @!attribute [rw] seconds - # @return [::Integer] - # Seconds of minutes of the time. Must normally be from 0 to 59. An API may - # allow the value 60 if it allows leap-seconds. - # @!attribute [rw] nanos - # @return [::Integer] - # Fractions of seconds in nanoseconds. Must be from 0 to 999,999,999. - class TimeOfDay - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - end -end diff --git a/owl-bot-staging/google-cloud-redis-v1beta1/snippets/Gemfile b/owl-bot-staging/google-cloud-redis-v1beta1/snippets/Gemfile deleted file mode 100644 index 82019b5c9ffa..000000000000 --- a/owl-bot-staging/google-cloud-redis-v1beta1/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-redis-v1beta1", path: "../" -else - gem "google-cloud-redis-v1beta1" -end - -group :test do - gem "google-style", "~> 1.26.1" - gem "minitest", "~> 5.16" - gem "minitest-focus", "~> 1.1" - gem "minitest-hooks", "~> 1.5" -end diff --git a/owl-bot-staging/google-cloud-redis-v1beta1/snippets/cloud_redis/create_instance.rb b/owl-bot-staging/google-cloud-redis-v1beta1/snippets/cloud_redis/create_instance.rb deleted file mode 100644 index 236366af61dd..000000000000 --- a/owl-bot-staging/google-cloud-redis-v1beta1/snippets/cloud_redis/create_instance.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 redis_v1beta1_generated_CloudRedis_CreateInstance_sync] -require "google/cloud/redis/v1beta1" - -## -# Snippet for the create_instance call in the CloudRedis service -# -# This snippet has been automatically generated and should be regarded as a code -# template only. It will require modifications to work: -# - It may require correct/in-range values for request initialization. -# - It may require specifying regional endpoints when creating the service -# client as shown in https://cloud.google.com/ruby/docs/reference. -# -# This is an auto-generated example demonstrating basic usage of -# Google::Cloud::Redis::V1beta1::CloudRedis::Client#create_instance. -# -def create_instance - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::Redis::V1beta1::CloudRedis::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::Redis::V1beta1::CreateInstanceRequest.new - - # Call the create_instance method. - result = client.create_instance 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 redis_v1beta1_generated_CloudRedis_CreateInstance_sync] diff --git a/owl-bot-staging/google-cloud-redis-v1beta1/snippets/cloud_redis/delete_instance.rb b/owl-bot-staging/google-cloud-redis-v1beta1/snippets/cloud_redis/delete_instance.rb deleted file mode 100644 index a27474bd8d1d..000000000000 --- a/owl-bot-staging/google-cloud-redis-v1beta1/snippets/cloud_redis/delete_instance.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 redis_v1beta1_generated_CloudRedis_DeleteInstance_sync] -require "google/cloud/redis/v1beta1" - -## -# Snippet for the delete_instance call in the CloudRedis service -# -# This snippet has been automatically generated and should be regarded as a code -# template only. It will require modifications to work: -# - It may require correct/in-range values for request initialization. -# - It may require specifying regional endpoints when creating the service -# client as shown in https://cloud.google.com/ruby/docs/reference. -# -# This is an auto-generated example demonstrating basic usage of -# Google::Cloud::Redis::V1beta1::CloudRedis::Client#delete_instance. -# -def delete_instance - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::Redis::V1beta1::CloudRedis::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::Redis::V1beta1::DeleteInstanceRequest.new - - # Call the delete_instance method. - result = client.delete_instance 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 redis_v1beta1_generated_CloudRedis_DeleteInstance_sync] diff --git a/owl-bot-staging/google-cloud-redis-v1beta1/snippets/cloud_redis/export_instance.rb b/owl-bot-staging/google-cloud-redis-v1beta1/snippets/cloud_redis/export_instance.rb deleted file mode 100644 index 41baa222993d..000000000000 --- a/owl-bot-staging/google-cloud-redis-v1beta1/snippets/cloud_redis/export_instance.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 redis_v1beta1_generated_CloudRedis_ExportInstance_sync] -require "google/cloud/redis/v1beta1" - -## -# Snippet for the export_instance call in the CloudRedis service -# -# This snippet has been automatically generated and should be regarded as a code -# template only. It will require modifications to work: -# - It may require correct/in-range values for request initialization. -# - It may require specifying regional endpoints when creating the service -# client as shown in https://cloud.google.com/ruby/docs/reference. -# -# This is an auto-generated example demonstrating basic usage of -# Google::Cloud::Redis::V1beta1::CloudRedis::Client#export_instance. -# -def export_instance - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::Redis::V1beta1::CloudRedis::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::Redis::V1beta1::ExportInstanceRequest.new - - # Call the export_instance method. - result = client.export_instance 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 redis_v1beta1_generated_CloudRedis_ExportInstance_sync] diff --git a/owl-bot-staging/google-cloud-redis-v1beta1/snippets/cloud_redis/failover_instance.rb b/owl-bot-staging/google-cloud-redis-v1beta1/snippets/cloud_redis/failover_instance.rb deleted file mode 100644 index a3bf6763c961..000000000000 --- a/owl-bot-staging/google-cloud-redis-v1beta1/snippets/cloud_redis/failover_instance.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 redis_v1beta1_generated_CloudRedis_FailoverInstance_sync] -require "google/cloud/redis/v1beta1" - -## -# Snippet for the failover_instance call in the CloudRedis service -# -# This snippet has been automatically generated and should be regarded as a code -# template only. It will require modifications to work: -# - It may require correct/in-range values for request initialization. -# - It may require specifying regional endpoints when creating the service -# client as shown in https://cloud.google.com/ruby/docs/reference. -# -# This is an auto-generated example demonstrating basic usage of -# Google::Cloud::Redis::V1beta1::CloudRedis::Client#failover_instance. -# -def failover_instance - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::Redis::V1beta1::CloudRedis::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::Redis::V1beta1::FailoverInstanceRequest.new - - # Call the failover_instance method. - result = client.failover_instance 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 redis_v1beta1_generated_CloudRedis_FailoverInstance_sync] diff --git a/owl-bot-staging/google-cloud-redis-v1beta1/snippets/cloud_redis/get_instance.rb b/owl-bot-staging/google-cloud-redis-v1beta1/snippets/cloud_redis/get_instance.rb deleted file mode 100644 index b9dc2590c821..000000000000 --- a/owl-bot-staging/google-cloud-redis-v1beta1/snippets/cloud_redis/get_instance.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 redis_v1beta1_generated_CloudRedis_GetInstance_sync] -require "google/cloud/redis/v1beta1" - -## -# Snippet for the get_instance call in the CloudRedis service -# -# This snippet has been automatically generated and should be regarded as a code -# template only. It will require modifications to work: -# - It may require correct/in-range values for request initialization. -# - It may require specifying regional endpoints when creating the service -# client as shown in https://cloud.google.com/ruby/docs/reference. -# -# This is an auto-generated example demonstrating basic usage of -# Google::Cloud::Redis::V1beta1::CloudRedis::Client#get_instance. -# -def get_instance - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::Redis::V1beta1::CloudRedis::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::Redis::V1beta1::GetInstanceRequest.new - - # Call the get_instance method. - result = client.get_instance request - - # The returned object is of type Google::Cloud::Redis::V1beta1::Instance. - p result -end -# [END redis_v1beta1_generated_CloudRedis_GetInstance_sync] diff --git a/owl-bot-staging/google-cloud-redis-v1beta1/snippets/cloud_redis/get_instance_auth_string.rb b/owl-bot-staging/google-cloud-redis-v1beta1/snippets/cloud_redis/get_instance_auth_string.rb deleted file mode 100644 index 6242f65c1a07..000000000000 --- a/owl-bot-staging/google-cloud-redis-v1beta1/snippets/cloud_redis/get_instance_auth_string.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 redis_v1beta1_generated_CloudRedis_GetInstanceAuthString_sync] -require "google/cloud/redis/v1beta1" - -## -# Snippet for the get_instance_auth_string call in the CloudRedis service -# -# This snippet has been automatically generated and should be regarded as a code -# template only. It will require modifications to work: -# - It may require correct/in-range values for request initialization. -# - It may require specifying regional endpoints when creating the service -# client as shown in https://cloud.google.com/ruby/docs/reference. -# -# This is an auto-generated example demonstrating basic usage of -# Google::Cloud::Redis::V1beta1::CloudRedis::Client#get_instance_auth_string. -# -def get_instance_auth_string - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::Redis::V1beta1::CloudRedis::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::Redis::V1beta1::GetInstanceAuthStringRequest.new - - # Call the get_instance_auth_string method. - result = client.get_instance_auth_string request - - # The returned object is of type Google::Cloud::Redis::V1beta1::InstanceAuthString. - p result -end -# [END redis_v1beta1_generated_CloudRedis_GetInstanceAuthString_sync] diff --git a/owl-bot-staging/google-cloud-redis-v1beta1/snippets/cloud_redis/import_instance.rb b/owl-bot-staging/google-cloud-redis-v1beta1/snippets/cloud_redis/import_instance.rb deleted file mode 100644 index acd9211a720e..000000000000 --- a/owl-bot-staging/google-cloud-redis-v1beta1/snippets/cloud_redis/import_instance.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 redis_v1beta1_generated_CloudRedis_ImportInstance_sync] -require "google/cloud/redis/v1beta1" - -## -# Snippet for the import_instance call in the CloudRedis service -# -# This snippet has been automatically generated and should be regarded as a code -# template only. It will require modifications to work: -# - It may require correct/in-range values for request initialization. -# - It may require specifying regional endpoints when creating the service -# client as shown in https://cloud.google.com/ruby/docs/reference. -# -# This is an auto-generated example demonstrating basic usage of -# Google::Cloud::Redis::V1beta1::CloudRedis::Client#import_instance. -# -def import_instance - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::Redis::V1beta1::CloudRedis::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::Redis::V1beta1::ImportInstanceRequest.new - - # Call the import_instance method. - result = client.import_instance 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 redis_v1beta1_generated_CloudRedis_ImportInstance_sync] diff --git a/owl-bot-staging/google-cloud-redis-v1beta1/snippets/cloud_redis/list_instances.rb b/owl-bot-staging/google-cloud-redis-v1beta1/snippets/cloud_redis/list_instances.rb deleted file mode 100644 index 00d2697f339f..000000000000 --- a/owl-bot-staging/google-cloud-redis-v1beta1/snippets/cloud_redis/list_instances.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 redis_v1beta1_generated_CloudRedis_ListInstances_sync] -require "google/cloud/redis/v1beta1" - -## -# Snippet for the list_instances call in the CloudRedis service -# -# This snippet has been automatically generated and should be regarded as a code -# template only. It will require modifications to work: -# - It may require correct/in-range values for request initialization. -# - It may require specifying regional endpoints when creating the service -# client as shown in https://cloud.google.com/ruby/docs/reference. -# -# This is an auto-generated example demonstrating basic usage of -# Google::Cloud::Redis::V1beta1::CloudRedis::Client#list_instances. -# -def list_instances - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::Redis::V1beta1::CloudRedis::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::Redis::V1beta1::ListInstancesRequest.new - - # Call the list_instances method. - result = client.list_instances request - - # The returned object is of type Gapic::PagedEnumerable. You can iterate - # over elements, and API calls will be issued to fetch pages as needed. - result.each do |item| - # Each element is of type ::Google::Cloud::Redis::V1beta1::Instance. - p item - end -end -# [END redis_v1beta1_generated_CloudRedis_ListInstances_sync] diff --git a/owl-bot-staging/google-cloud-redis-v1beta1/snippets/cloud_redis/reschedule_maintenance.rb b/owl-bot-staging/google-cloud-redis-v1beta1/snippets/cloud_redis/reschedule_maintenance.rb deleted file mode 100644 index bbca3882e73b..000000000000 --- a/owl-bot-staging/google-cloud-redis-v1beta1/snippets/cloud_redis/reschedule_maintenance.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 redis_v1beta1_generated_CloudRedis_RescheduleMaintenance_sync] -require "google/cloud/redis/v1beta1" - -## -# Snippet for the reschedule_maintenance call in the CloudRedis service -# -# This snippet has been automatically generated and should be regarded as a code -# template only. It will require modifications to work: -# - It may require correct/in-range values for request initialization. -# - It may require specifying regional endpoints when creating the service -# client as shown in https://cloud.google.com/ruby/docs/reference. -# -# This is an auto-generated example demonstrating basic usage of -# Google::Cloud::Redis::V1beta1::CloudRedis::Client#reschedule_maintenance. -# -def reschedule_maintenance - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::Redis::V1beta1::CloudRedis::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::Redis::V1beta1::RescheduleMaintenanceRequest.new - - # Call the reschedule_maintenance method. - result = client.reschedule_maintenance 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 redis_v1beta1_generated_CloudRedis_RescheduleMaintenance_sync] diff --git a/owl-bot-staging/google-cloud-redis-v1beta1/snippets/cloud_redis/update_instance.rb b/owl-bot-staging/google-cloud-redis-v1beta1/snippets/cloud_redis/update_instance.rb deleted file mode 100644 index 3130d23543f9..000000000000 --- a/owl-bot-staging/google-cloud-redis-v1beta1/snippets/cloud_redis/update_instance.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 redis_v1beta1_generated_CloudRedis_UpdateInstance_sync] -require "google/cloud/redis/v1beta1" - -## -# Snippet for the update_instance call in the CloudRedis service -# -# This snippet has been automatically generated and should be regarded as a code -# template only. It will require modifications to work: -# - It may require correct/in-range values for request initialization. -# - It may require specifying regional endpoints when creating the service -# client as shown in https://cloud.google.com/ruby/docs/reference. -# -# This is an auto-generated example demonstrating basic usage of -# Google::Cloud::Redis::V1beta1::CloudRedis::Client#update_instance. -# -def update_instance - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::Redis::V1beta1::CloudRedis::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::Redis::V1beta1::UpdateInstanceRequest.new - - # Call the update_instance method. - result = client.update_instance 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 redis_v1beta1_generated_CloudRedis_UpdateInstance_sync] diff --git a/owl-bot-staging/google-cloud-redis-v1beta1/snippets/cloud_redis/upgrade_instance.rb b/owl-bot-staging/google-cloud-redis-v1beta1/snippets/cloud_redis/upgrade_instance.rb deleted file mode 100644 index cb50f737f6c8..000000000000 --- a/owl-bot-staging/google-cloud-redis-v1beta1/snippets/cloud_redis/upgrade_instance.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 redis_v1beta1_generated_CloudRedis_UpgradeInstance_sync] -require "google/cloud/redis/v1beta1" - -## -# Snippet for the upgrade_instance call in the CloudRedis service -# -# This snippet has been automatically generated and should be regarded as a code -# template only. It will require modifications to work: -# - It may require correct/in-range values for request initialization. -# - It may require specifying regional endpoints when creating the service -# client as shown in https://cloud.google.com/ruby/docs/reference. -# -# This is an auto-generated example demonstrating basic usage of -# Google::Cloud::Redis::V1beta1::CloudRedis::Client#upgrade_instance. -# -def upgrade_instance - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::Redis::V1beta1::CloudRedis::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::Redis::V1beta1::UpgradeInstanceRequest.new - - # Call the upgrade_instance method. - result = client.upgrade_instance 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 redis_v1beta1_generated_CloudRedis_UpgradeInstance_sync] diff --git a/owl-bot-staging/google-cloud-redis-v1beta1/snippets/snippet_metadata_google.cloud.redis.v1beta1.json b/owl-bot-staging/google-cloud-redis-v1beta1/snippets/snippet_metadata_google.cloud.redis.v1beta1.json deleted file mode 100644 index 56cb2a2de1d8..000000000000 --- a/owl-bot-staging/google-cloud-redis-v1beta1/snippets/snippet_metadata_google.cloud.redis.v1beta1.json +++ /dev/null @@ -1,455 +0,0 @@ -{ - "client_library": { - "name": "google-cloud-redis-v1beta1", - "version": "", - "language": "RUBY", - "apis": [ - { - "id": "google.cloud.redis.v1beta1", - "version": "v1beta1" - } - ] - }, - "snippets": [ - { - "region_tag": "redis_v1beta1_generated_CloudRedis_ListInstances_sync", - "title": "Snippet for the list_instances call in the CloudRedis service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Redis::V1beta1::CloudRedis::Client#list_instances.", - "file": "cloud_redis/list_instances.rb", - "language": "RUBY", - "client_method": { - "short_name": "list_instances", - "full_name": "::Google::Cloud::Redis::V1beta1::CloudRedis::Client#list_instances", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::Redis::V1beta1::ListInstancesRequest", - "name": "request" - } - ], - "result_type": "::Google::Cloud::Redis::V1beta1::ListInstancesResponse", - "client": { - "short_name": "CloudRedis::Client", - "full_name": "::Google::Cloud::Redis::V1beta1::CloudRedis::Client" - }, - "method": { - "short_name": "ListInstances", - "full_name": "google.cloud.redis.v1beta1.CloudRedis.ListInstances", - "service": { - "short_name": "CloudRedis", - "full_name": "google.cloud.redis.v1beta1.CloudRedis" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 50, - "type": "FULL" - } - ] - }, - { - "region_tag": "redis_v1beta1_generated_CloudRedis_GetInstance_sync", - "title": "Snippet for the get_instance call in the CloudRedis service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Redis::V1beta1::CloudRedis::Client#get_instance.", - "file": "cloud_redis/get_instance.rb", - "language": "RUBY", - "client_method": { - "short_name": "get_instance", - "full_name": "::Google::Cloud::Redis::V1beta1::CloudRedis::Client#get_instance", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::Redis::V1beta1::GetInstanceRequest", - "name": "request" - } - ], - "result_type": "::Google::Cloud::Redis::V1beta1::Instance", - "client": { - "short_name": "CloudRedis::Client", - "full_name": "::Google::Cloud::Redis::V1beta1::CloudRedis::Client" - }, - "method": { - "short_name": "GetInstance", - "full_name": "google.cloud.redis.v1beta1.CloudRedis.GetInstance", - "service": { - "short_name": "CloudRedis", - "full_name": "google.cloud.redis.v1beta1.CloudRedis" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 46, - "type": "FULL" - } - ] - }, - { - "region_tag": "redis_v1beta1_generated_CloudRedis_GetInstanceAuthString_sync", - "title": "Snippet for the get_instance_auth_string call in the CloudRedis service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Redis::V1beta1::CloudRedis::Client#get_instance_auth_string.", - "file": "cloud_redis/get_instance_auth_string.rb", - "language": "RUBY", - "client_method": { - "short_name": "get_instance_auth_string", - "full_name": "::Google::Cloud::Redis::V1beta1::CloudRedis::Client#get_instance_auth_string", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::Redis::V1beta1::GetInstanceAuthStringRequest", - "name": "request" - } - ], - "result_type": "::Google::Cloud::Redis::V1beta1::InstanceAuthString", - "client": { - "short_name": "CloudRedis::Client", - "full_name": "::Google::Cloud::Redis::V1beta1::CloudRedis::Client" - }, - "method": { - "short_name": "GetInstanceAuthString", - "full_name": "google.cloud.redis.v1beta1.CloudRedis.GetInstanceAuthString", - "service": { - "short_name": "CloudRedis", - "full_name": "google.cloud.redis.v1beta1.CloudRedis" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 46, - "type": "FULL" - } - ] - }, - { - "region_tag": "redis_v1beta1_generated_CloudRedis_CreateInstance_sync", - "title": "Snippet for the create_instance call in the CloudRedis service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Redis::V1beta1::CloudRedis::Client#create_instance.", - "file": "cloud_redis/create_instance.rb", - "language": "RUBY", - "client_method": { - "short_name": "create_instance", - "full_name": "::Google::Cloud::Redis::V1beta1::CloudRedis::Client#create_instance", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::Redis::V1beta1::CreateInstanceRequest", - "name": "request" - } - ], - "result_type": "::Google::Longrunning::Operation", - "client": { - "short_name": "CloudRedis::Client", - "full_name": "::Google::Cloud::Redis::V1beta1::CloudRedis::Client" - }, - "method": { - "short_name": "CreateInstance", - "full_name": "google.cloud.redis.v1beta1.CloudRedis.CreateInstance", - "service": { - "short_name": "CloudRedis", - "full_name": "google.cloud.redis.v1beta1.CloudRedis" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 53, - "type": "FULL" - } - ] - }, - { - "region_tag": "redis_v1beta1_generated_CloudRedis_UpdateInstance_sync", - "title": "Snippet for the update_instance call in the CloudRedis service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Redis::V1beta1::CloudRedis::Client#update_instance.", - "file": "cloud_redis/update_instance.rb", - "language": "RUBY", - "client_method": { - "short_name": "update_instance", - "full_name": "::Google::Cloud::Redis::V1beta1::CloudRedis::Client#update_instance", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::Redis::V1beta1::UpdateInstanceRequest", - "name": "request" - } - ], - "result_type": "::Google::Longrunning::Operation", - "client": { - "short_name": "CloudRedis::Client", - "full_name": "::Google::Cloud::Redis::V1beta1::CloudRedis::Client" - }, - "method": { - "short_name": "UpdateInstance", - "full_name": "google.cloud.redis.v1beta1.CloudRedis.UpdateInstance", - "service": { - "short_name": "CloudRedis", - "full_name": "google.cloud.redis.v1beta1.CloudRedis" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 53, - "type": "FULL" - } - ] - }, - { - "region_tag": "redis_v1beta1_generated_CloudRedis_UpgradeInstance_sync", - "title": "Snippet for the upgrade_instance call in the CloudRedis service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Redis::V1beta1::CloudRedis::Client#upgrade_instance.", - "file": "cloud_redis/upgrade_instance.rb", - "language": "RUBY", - "client_method": { - "short_name": "upgrade_instance", - "full_name": "::Google::Cloud::Redis::V1beta1::CloudRedis::Client#upgrade_instance", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::Redis::V1beta1::UpgradeInstanceRequest", - "name": "request" - } - ], - "result_type": "::Google::Longrunning::Operation", - "client": { - "short_name": "CloudRedis::Client", - "full_name": "::Google::Cloud::Redis::V1beta1::CloudRedis::Client" - }, - "method": { - "short_name": "UpgradeInstance", - "full_name": "google.cloud.redis.v1beta1.CloudRedis.UpgradeInstance", - "service": { - "short_name": "CloudRedis", - "full_name": "google.cloud.redis.v1beta1.CloudRedis" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 53, - "type": "FULL" - } - ] - }, - { - "region_tag": "redis_v1beta1_generated_CloudRedis_ImportInstance_sync", - "title": "Snippet for the import_instance call in the CloudRedis service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Redis::V1beta1::CloudRedis::Client#import_instance.", - "file": "cloud_redis/import_instance.rb", - "language": "RUBY", - "client_method": { - "short_name": "import_instance", - "full_name": "::Google::Cloud::Redis::V1beta1::CloudRedis::Client#import_instance", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::Redis::V1beta1::ImportInstanceRequest", - "name": "request" - } - ], - "result_type": "::Google::Longrunning::Operation", - "client": { - "short_name": "CloudRedis::Client", - "full_name": "::Google::Cloud::Redis::V1beta1::CloudRedis::Client" - }, - "method": { - "short_name": "ImportInstance", - "full_name": "google.cloud.redis.v1beta1.CloudRedis.ImportInstance", - "service": { - "short_name": "CloudRedis", - "full_name": "google.cloud.redis.v1beta1.CloudRedis" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 53, - "type": "FULL" - } - ] - }, - { - "region_tag": "redis_v1beta1_generated_CloudRedis_ExportInstance_sync", - "title": "Snippet for the export_instance call in the CloudRedis service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Redis::V1beta1::CloudRedis::Client#export_instance.", - "file": "cloud_redis/export_instance.rb", - "language": "RUBY", - "client_method": { - "short_name": "export_instance", - "full_name": "::Google::Cloud::Redis::V1beta1::CloudRedis::Client#export_instance", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::Redis::V1beta1::ExportInstanceRequest", - "name": "request" - } - ], - "result_type": "::Google::Longrunning::Operation", - "client": { - "short_name": "CloudRedis::Client", - "full_name": "::Google::Cloud::Redis::V1beta1::CloudRedis::Client" - }, - "method": { - "short_name": "ExportInstance", - "full_name": "google.cloud.redis.v1beta1.CloudRedis.ExportInstance", - "service": { - "short_name": "CloudRedis", - "full_name": "google.cloud.redis.v1beta1.CloudRedis" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 53, - "type": "FULL" - } - ] - }, - { - "region_tag": "redis_v1beta1_generated_CloudRedis_FailoverInstance_sync", - "title": "Snippet for the failover_instance call in the CloudRedis service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Redis::V1beta1::CloudRedis::Client#failover_instance.", - "file": "cloud_redis/failover_instance.rb", - "language": "RUBY", - "client_method": { - "short_name": "failover_instance", - "full_name": "::Google::Cloud::Redis::V1beta1::CloudRedis::Client#failover_instance", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::Redis::V1beta1::FailoverInstanceRequest", - "name": "request" - } - ], - "result_type": "::Google::Longrunning::Operation", - "client": { - "short_name": "CloudRedis::Client", - "full_name": "::Google::Cloud::Redis::V1beta1::CloudRedis::Client" - }, - "method": { - "short_name": "FailoverInstance", - "full_name": "google.cloud.redis.v1beta1.CloudRedis.FailoverInstance", - "service": { - "short_name": "CloudRedis", - "full_name": "google.cloud.redis.v1beta1.CloudRedis" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 53, - "type": "FULL" - } - ] - }, - { - "region_tag": "redis_v1beta1_generated_CloudRedis_DeleteInstance_sync", - "title": "Snippet for the delete_instance call in the CloudRedis service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Redis::V1beta1::CloudRedis::Client#delete_instance.", - "file": "cloud_redis/delete_instance.rb", - "language": "RUBY", - "client_method": { - "short_name": "delete_instance", - "full_name": "::Google::Cloud::Redis::V1beta1::CloudRedis::Client#delete_instance", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::Redis::V1beta1::DeleteInstanceRequest", - "name": "request" - } - ], - "result_type": "::Google::Longrunning::Operation", - "client": { - "short_name": "CloudRedis::Client", - "full_name": "::Google::Cloud::Redis::V1beta1::CloudRedis::Client" - }, - "method": { - "short_name": "DeleteInstance", - "full_name": "google.cloud.redis.v1beta1.CloudRedis.DeleteInstance", - "service": { - "short_name": "CloudRedis", - "full_name": "google.cloud.redis.v1beta1.CloudRedis" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 53, - "type": "FULL" - } - ] - }, - { - "region_tag": "redis_v1beta1_generated_CloudRedis_RescheduleMaintenance_sync", - "title": "Snippet for the reschedule_maintenance call in the CloudRedis service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Redis::V1beta1::CloudRedis::Client#reschedule_maintenance.", - "file": "cloud_redis/reschedule_maintenance.rb", - "language": "RUBY", - "client_method": { - "short_name": "reschedule_maintenance", - "full_name": "::Google::Cloud::Redis::V1beta1::CloudRedis::Client#reschedule_maintenance", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::Redis::V1beta1::RescheduleMaintenanceRequest", - "name": "request" - } - ], - "result_type": "::Google::Longrunning::Operation", - "client": { - "short_name": "CloudRedis::Client", - "full_name": "::Google::Cloud::Redis::V1beta1::CloudRedis::Client" - }, - "method": { - "short_name": "RescheduleMaintenance", - "full_name": "google.cloud.redis.v1beta1.CloudRedis.RescheduleMaintenance", - "service": { - "short_name": "CloudRedis", - "full_name": "google.cloud.redis.v1beta1.CloudRedis" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 53, - "type": "FULL" - } - ] - } - ] -} \ No newline at end of file diff --git a/owl-bot-staging/google-cloud-redis-v1beta1/test/google/cloud/redis/v1beta1/cloud_redis_operations_test.rb b/owl-bot-staging/google-cloud-redis-v1beta1/test/google/cloud/redis/v1beta1/cloud_redis_operations_test.rb deleted file mode 100644 index ede2f8416ae8..000000000000 --- a/owl-bot-staging/google-cloud-redis-v1beta1/test/google/cloud/redis/v1beta1/cloud_redis_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/cloud/redis/v1beta1/cloud_redis_pb" -require "google/cloud/redis/v1beta1/cloud_redis_services_pb" -require "google/cloud/redis/v1beta1/cloud_redis" - -class ::Google::Cloud::Redis::V1beta1::CloudRedis::OperationsTest < Minitest::Test - class ClientStub - attr_accessor :call_rpc_count, :requests - - def initialize response, operation, &block - @response = response - @operation = operation - @block = block - @call_rpc_count = 0 - @requests = [] - end - - def call_rpc *args, **kwargs - @call_rpc_count += 1 - - @requests << @block&.call(*args, **kwargs) - - catch :response do - yield @response, @operation if block_given? - @response - end - end - - def endpoint - "endpoint.example.com" - end - - def universe_domain - "example.com" - end - - def stub_logger - nil - end - - def logger - nil - end - end - - def test_list_operations - # Create GRPC objects. - grpc_response = ::Google::Longrunning::ListOperationsResponse.new - grpc_operation = GRPC::ActiveCall::Operation.new nil - grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - grpc_options = {} - - # Create request parameters for a unary method. - name = "hello world" - filter = "hello world" - page_size = 42 - page_token = "hello world" - return_partial_success = true - - list_operations_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :list_operations, name - assert_kind_of ::Google::Longrunning::ListOperationsRequest, request - assert_equal "hello world", request["name"] - assert_equal "hello world", request["filter"] - assert_equal 42, request["page_size"] - assert_equal "hello world", request["page_token"] - assert_equal true, request["return_partial_success"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, list_operations_client_stub do - # Create client - client = ::Google::Cloud::Redis::V1beta1::CloudRedis::Operations.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.list_operations({ name: name, filter: filter, page_size: page_size, page_token: page_token, return_partial_success: return_partial_success }) do |response, operation| - assert_kind_of Gapic::PagedEnumerable, response - assert_equal grpc_response, response.response - assert_equal grpc_operation, operation - end - - # Use named arguments - client.list_operations name: name, filter: filter, page_size: page_size, page_token: page_token, return_partial_success: return_partial_success do |response, operation| - assert_kind_of Gapic::PagedEnumerable, response - assert_equal grpc_response, response.response - assert_equal grpc_operation, operation - end - - # Use protobuf object - client.list_operations ::Google::Longrunning::ListOperationsRequest.new(name: name, filter: filter, page_size: page_size, page_token: page_token, return_partial_success: return_partial_success) do |response, operation| - assert_kind_of Gapic::PagedEnumerable, response - assert_equal grpc_response, response.response - assert_equal grpc_operation, operation - end - - # Use hash object with options - client.list_operations({ name: name, filter: filter, page_size: page_size, page_token: page_token, return_partial_success: return_partial_success }, grpc_options) do |response, operation| - assert_kind_of Gapic::PagedEnumerable, response - assert_equal grpc_response, response.response - assert_equal grpc_operation, operation - end - - # Use protobuf object with options - client.list_operations(::Google::Longrunning::ListOperationsRequest.new(name: name, filter: filter, page_size: page_size, page_token: page_token, return_partial_success: return_partial_success), grpc_options) do |response, operation| - assert_kind_of Gapic::PagedEnumerable, response - assert_equal grpc_response, response.response - assert_equal grpc_operation, operation - end - - # Verify method calls - assert_equal 5, list_operations_client_stub.call_rpc_count - end - end - - def test_get_operation - # Create GRPC objects. - grpc_response = ::Google::Longrunning::Operation.new - grpc_operation = GRPC::ActiveCall::Operation.new nil - grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - grpc_options = {} - - # Create request parameters for a unary method. - name = "hello world" - - get_operation_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :get_operation, name - assert_kind_of ::Google::Longrunning::GetOperationRequest, request - assert_equal "hello world", request["name"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, get_operation_client_stub do - # Create client - client = ::Google::Cloud::Redis::V1beta1::CloudRedis::Operations.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.get_operation({ name: name }) do |response, operation| - assert_kind_of Gapic::Operation, response - assert_equal grpc_response, response.grpc_op - assert_equal grpc_operation, operation - end - - # Use named arguments - client.get_operation name: name do |response, operation| - assert_kind_of Gapic::Operation, response - assert_equal grpc_response, response.grpc_op - assert_equal grpc_operation, operation - end - - # Use protobuf object - client.get_operation ::Google::Longrunning::GetOperationRequest.new(name: name) do |response, operation| - assert_kind_of Gapic::Operation, response - assert_equal grpc_response, response.grpc_op - assert_equal grpc_operation, operation - end - - # Use hash object with options - client.get_operation({ name: name }, grpc_options) do |response, operation| - assert_kind_of Gapic::Operation, response - assert_equal grpc_response, response.grpc_op - assert_equal grpc_operation, operation - end - - # Use protobuf object with options - client.get_operation(::Google::Longrunning::GetOperationRequest.new(name: name), grpc_options) do |response, operation| - assert_kind_of Gapic::Operation, response - assert_equal grpc_response, response.grpc_op - assert_equal grpc_operation, operation - end - - # Verify method calls - assert_equal 5, get_operation_client_stub.call_rpc_count - end - end - - def test_delete_operation - # Create GRPC objects. - grpc_response = ::Google::Protobuf::Empty.new - grpc_operation = GRPC::ActiveCall::Operation.new nil - grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - grpc_options = {} - - # Create request parameters for a unary method. - name = "hello world" - - delete_operation_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :delete_operation, name - assert_kind_of ::Google::Longrunning::DeleteOperationRequest, request - assert_equal "hello world", request["name"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, delete_operation_client_stub do - # Create client - client = ::Google::Cloud::Redis::V1beta1::CloudRedis::Operations.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.delete_operation({ name: name }) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use named arguments - client.delete_operation name: name do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object - client.delete_operation ::Google::Longrunning::DeleteOperationRequest.new(name: name) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use hash object with options - client.delete_operation({ name: name }, grpc_options) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object with options - client.delete_operation(::Google::Longrunning::DeleteOperationRequest.new(name: name), grpc_options) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Verify method calls - assert_equal 5, delete_operation_client_stub.call_rpc_count - end - end - - def test_cancel_operation - # Create GRPC objects. - grpc_response = ::Google::Protobuf::Empty.new - grpc_operation = GRPC::ActiveCall::Operation.new nil - grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - grpc_options = {} - - # Create request parameters for a unary method. - name = "hello world" - - cancel_operation_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :cancel_operation, name - assert_kind_of ::Google::Longrunning::CancelOperationRequest, request - assert_equal "hello world", request["name"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, cancel_operation_client_stub do - # Create client - client = ::Google::Cloud::Redis::V1beta1::CloudRedis::Operations.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.cancel_operation({ name: name }) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use named arguments - client.cancel_operation name: name do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object - client.cancel_operation ::Google::Longrunning::CancelOperationRequest.new(name: name) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use hash object with options - client.cancel_operation({ name: name }, grpc_options) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object with options - client.cancel_operation(::Google::Longrunning::CancelOperationRequest.new(name: name), grpc_options) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Verify method calls - assert_equal 5, cancel_operation_client_stub.call_rpc_count - end - end - - def test_wait_operation - # Create GRPC objects. - grpc_response = ::Google::Longrunning::Operation.new - grpc_operation = GRPC::ActiveCall::Operation.new nil - grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - grpc_options = {} - - # Create request parameters for a unary method. - name = "hello world" - timeout = {} - - wait_operation_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :wait_operation, name - assert_kind_of ::Google::Longrunning::WaitOperationRequest, request - assert_equal "hello world", request["name"] - assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Protobuf::Duration), request["timeout"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, wait_operation_client_stub do - # Create client - client = ::Google::Cloud::Redis::V1beta1::CloudRedis::Operations.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.wait_operation({ name: name, timeout: timeout }) do |response, operation| - assert_kind_of Gapic::Operation, response - assert_equal grpc_response, response.grpc_op - assert_equal grpc_operation, operation - end - - # Use named arguments - client.wait_operation name: name, timeout: timeout do |response, operation| - assert_kind_of Gapic::Operation, response - assert_equal grpc_response, response.grpc_op - assert_equal grpc_operation, operation - end - - # Use protobuf object - client.wait_operation ::Google::Longrunning::WaitOperationRequest.new(name: name, timeout: timeout) do |response, operation| - assert_kind_of Gapic::Operation, response - assert_equal grpc_response, response.grpc_op - assert_equal grpc_operation, operation - end - - # Use hash object with options - client.wait_operation({ name: name, timeout: timeout }, grpc_options) do |response, operation| - assert_kind_of Gapic::Operation, response - assert_equal grpc_response, response.grpc_op - assert_equal grpc_operation, operation - end - - # Use protobuf object with options - client.wait_operation(::Google::Longrunning::WaitOperationRequest.new(name: name, timeout: timeout), grpc_options) do |response, operation| - assert_kind_of Gapic::Operation, response - assert_equal grpc_response, response.grpc_op - assert_equal grpc_operation, operation - end - - # Verify method calls - assert_equal 5, wait_operation_client_stub.call_rpc_count - end - end - - def test_configure - grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - - client = block_config = config = nil - dummy_stub = ClientStub.new nil, nil - Gapic::ServiceStub.stub :new, dummy_stub do - client = ::Google::Cloud::Redis::V1beta1::CloudRedis::Operations.new do |config| - config.credentials = grpc_channel - end - end - - config = client.configure do |c| - block_config = c - end - - assert_same block_config, config - assert_kind_of ::Google::Cloud::Redis::V1beta1::CloudRedis::Operations::Configuration, config - end -end diff --git a/owl-bot-staging/google-cloud-redis-v1beta1/test/google/cloud/redis/v1beta1/cloud_redis_paths_test.rb b/owl-bot-staging/google-cloud-redis-v1beta1/test/google/cloud/redis/v1beta1/cloud_redis_paths_test.rb deleted file mode 100644 index c6bd60ae284f..000000000000 --- a/owl-bot-staging/google-cloud-redis-v1beta1/test/google/cloud/redis/v1beta1/cloud_redis_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/cloud/redis/v1beta1/cloud_redis" - -class ::Google::Cloud::Redis::V1beta1::CloudRedis::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_instance_path - grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - ::Gapic::ServiceStub.stub :new, DummyStub.new do - client = ::Google::Cloud::Redis::V1beta1::CloudRedis::Client.new do |config| - config.credentials = grpc_channel - end - - path = client.instance_path project: "value0", location: "value1", instance: "value2" - assert_equal "projects/value0/locations/value1/instances/value2", path - end - end - - def test_location_path - grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - ::Gapic::ServiceStub.stub :new, DummyStub.new do - client = ::Google::Cloud::Redis::V1beta1::CloudRedis::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 -end diff --git a/owl-bot-staging/google-cloud-redis-v1beta1/test/google/cloud/redis/v1beta1/cloud_redis_rest_test.rb b/owl-bot-staging/google-cloud-redis-v1beta1/test/google/cloud/redis/v1beta1/cloud_redis_rest_test.rb deleted file mode 100644 index 235dd23bd8a6..000000000000 --- a/owl-bot-staging/google-cloud-redis-v1beta1/test/google/cloud/redis/v1beta1/cloud_redis_rest_test.rb +++ /dev/null @@ -1,704 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -require "helper" -require "gapic/rest" -require "google/cloud/redis/v1beta1/cloud_redis_pb" -require "google/cloud/redis/v1beta1/cloud_redis/rest" - - -class ::Google::Cloud::Redis::V1beta1::CloudRedis::Rest::ClientTest < Minitest::Test - class ClientStub - attr_accessor :call_count, :requests - - def initialize response, &block - @response = response - @block = block - @call_count = 0 - @requests = [] - end - - def make_get_request uri:, params: {}, options: {}, method_name: nil - make_http_request :get, uri: uri, body: nil, params: params, options: options, method_name: method_name - end - - def make_delete_request uri:, params: {}, options: {}, method_name: nil - make_http_request :delete, uri: uri, body: nil, params: params, options: options, method_name: method_name - end - - def make_post_request uri:, body: nil, params: {}, options: {}, method_name: nil - make_http_request :post, uri: uri, body: body, params: params, options: options, method_name: method_name - end - - def make_patch_request uri:, body:, params: {}, options: {}, method_name: nil - make_http_request :patch, uri: uri, body: body, params: params, options: options, method_name: method_name - end - - def make_put_request uri:, body:, params: {}, options: {}, method_name: nil - make_http_request :put, uri: uri, body: body, params: params, options: options, method_name: method_name - end - - def make_http_request *args, **kwargs - @call_count += 1 - - @requests << @block&.call(*args, **kwargs) - - @response - end - - def endpoint - "endpoint.example.com" - end - - def universe_domain - "example.com" - end - - def stub_logger - nil - end - - def logger - nil - end - end - - def test_list_instances - # Create test objects. - client_result = ::Google::Cloud::Redis::V1beta1::ListInstancesResponse.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_instances_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| - assert options.metadata.key? :"x-goog-api-client" - assert options.metadata[:"x-goog-api-client"].include? "rest" - refute options.metadata[:"x-goog-api-client"].include? "grpc" - end - - ::Google::Cloud::Redis::V1beta1::CloudRedis::Rest::ServiceStub.stub :transcode_list_instances_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, list_instances_client_stub do - # Create client - client = ::Google::Cloud::Redis::V1beta1::CloudRedis::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - client.list_instances({ 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_instances 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_instances ::Google::Cloud::Redis::V1beta1::ListInstancesRequest.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_instances({ 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_instances(::Google::Cloud::Redis::V1beta1::ListInstancesRequest.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_instances_client_stub.call_count - end - end - end - - def test_get_instance - # Create test objects. - client_result = ::Google::Cloud::Redis::V1beta1::Instance.new - http_response = OpenStruct.new body: client_result.to_json - - call_options = {} - - # Create request parameters for a unary method. - name = "hello world" - - get_instance_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| - assert options.metadata.key? :"x-goog-api-client" - assert options.metadata[:"x-goog-api-client"].include? "rest" - refute options.metadata[:"x-goog-api-client"].include? "grpc" - end - - ::Google::Cloud::Redis::V1beta1::CloudRedis::Rest::ServiceStub.stub :transcode_get_instance_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, get_instance_client_stub do - # Create client - client = ::Google::Cloud::Redis::V1beta1::CloudRedis::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - client.get_instance({ name: name }) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use named arguments - client.get_instance name: name do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object - client.get_instance ::Google::Cloud::Redis::V1beta1::GetInstanceRequest.new(name: name) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use hash object with options - client.get_instance({ name: name }, call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object with options - client.get_instance(::Google::Cloud::Redis::V1beta1::GetInstanceRequest.new(name: name), call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Verify method calls - assert_equal 5, get_instance_client_stub.call_count - end - end - end - - def test_get_instance_auth_string - # Create test objects. - client_result = ::Google::Cloud::Redis::V1beta1::InstanceAuthString.new - http_response = OpenStruct.new body: client_result.to_json - - call_options = {} - - # Create request parameters for a unary method. - name = "hello world" - - get_instance_auth_string_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| - assert options.metadata.key? :"x-goog-api-client" - assert options.metadata[:"x-goog-api-client"].include? "rest" - refute options.metadata[:"x-goog-api-client"].include? "grpc" - end - - ::Google::Cloud::Redis::V1beta1::CloudRedis::Rest::ServiceStub.stub :transcode_get_instance_auth_string_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, get_instance_auth_string_client_stub do - # Create client - client = ::Google::Cloud::Redis::V1beta1::CloudRedis::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - client.get_instance_auth_string({ name: name }) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use named arguments - client.get_instance_auth_string name: name do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object - client.get_instance_auth_string ::Google::Cloud::Redis::V1beta1::GetInstanceAuthStringRequest.new(name: name) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use hash object with options - client.get_instance_auth_string({ name: name }, call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object with options - client.get_instance_auth_string(::Google::Cloud::Redis::V1beta1::GetInstanceAuthStringRequest.new(name: name), call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Verify method calls - assert_equal 5, get_instance_auth_string_client_stub.call_count - end - end - end - - def test_create_instance - # 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" - instance_id = "hello world" - instance = {} - - create_instance_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| - assert options.metadata.key? :"x-goog-api-client" - assert options.metadata[:"x-goog-api-client"].include? "rest" - refute options.metadata[:"x-goog-api-client"].include? "grpc" - end - - ::Google::Cloud::Redis::V1beta1::CloudRedis::Rest::ServiceStub.stub :transcode_create_instance_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, create_instance_client_stub do - # Create client - client = ::Google::Cloud::Redis::V1beta1::CloudRedis::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - client.create_instance({ parent: parent, instance_id: instance_id, instance: instance }) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use named arguments - client.create_instance parent: parent, instance_id: instance_id, instance: instance do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object - client.create_instance ::Google::Cloud::Redis::V1beta1::CreateInstanceRequest.new(parent: parent, instance_id: instance_id, instance: instance) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use hash object with options - client.create_instance({ parent: parent, instance_id: instance_id, instance: instance }, call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object with options - client.create_instance(::Google::Cloud::Redis::V1beta1::CreateInstanceRequest.new(parent: parent, instance_id: instance_id, instance: instance), call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Verify method calls - assert_equal 5, create_instance_client_stub.call_count - end - end - end - - def test_update_instance - # 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. - update_mask = {} - instance = {} - - update_instance_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| - assert options.metadata.key? :"x-goog-api-client" - assert options.metadata[:"x-goog-api-client"].include? "rest" - refute options.metadata[:"x-goog-api-client"].include? "grpc" - end - - ::Google::Cloud::Redis::V1beta1::CloudRedis::Rest::ServiceStub.stub :transcode_update_instance_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, update_instance_client_stub do - # Create client - client = ::Google::Cloud::Redis::V1beta1::CloudRedis::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - client.update_instance({ update_mask: update_mask, instance: instance }) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use named arguments - client.update_instance update_mask: update_mask, instance: instance do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object - client.update_instance ::Google::Cloud::Redis::V1beta1::UpdateInstanceRequest.new(update_mask: update_mask, instance: instance) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use hash object with options - client.update_instance({ update_mask: update_mask, instance: instance }, call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object with options - client.update_instance(::Google::Cloud::Redis::V1beta1::UpdateInstanceRequest.new(update_mask: update_mask, instance: instance), call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Verify method calls - assert_equal 5, update_instance_client_stub.call_count - end - end - end - - def test_upgrade_instance - # 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" - redis_version = "hello world" - - upgrade_instance_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| - assert options.metadata.key? :"x-goog-api-client" - assert options.metadata[:"x-goog-api-client"].include? "rest" - refute options.metadata[:"x-goog-api-client"].include? "grpc" - end - - ::Google::Cloud::Redis::V1beta1::CloudRedis::Rest::ServiceStub.stub :transcode_upgrade_instance_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, upgrade_instance_client_stub do - # Create client - client = ::Google::Cloud::Redis::V1beta1::CloudRedis::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - client.upgrade_instance({ name: name, redis_version: redis_version }) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use named arguments - client.upgrade_instance name: name, redis_version: redis_version do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object - client.upgrade_instance ::Google::Cloud::Redis::V1beta1::UpgradeInstanceRequest.new(name: name, redis_version: redis_version) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use hash object with options - client.upgrade_instance({ name: name, redis_version: redis_version }, call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object with options - client.upgrade_instance(::Google::Cloud::Redis::V1beta1::UpgradeInstanceRequest.new(name: name, redis_version: redis_version), call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Verify method calls - assert_equal 5, upgrade_instance_client_stub.call_count - end - end - end - - def test_import_instance - # 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" - input_config = {} - - import_instance_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| - assert options.metadata.key? :"x-goog-api-client" - assert options.metadata[:"x-goog-api-client"].include? "rest" - refute options.metadata[:"x-goog-api-client"].include? "grpc" - end - - ::Google::Cloud::Redis::V1beta1::CloudRedis::Rest::ServiceStub.stub :transcode_import_instance_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, import_instance_client_stub do - # Create client - client = ::Google::Cloud::Redis::V1beta1::CloudRedis::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - client.import_instance({ name: name, input_config: input_config }) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use named arguments - client.import_instance name: name, input_config: input_config do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object - client.import_instance ::Google::Cloud::Redis::V1beta1::ImportInstanceRequest.new(name: name, input_config: input_config) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use hash object with options - client.import_instance({ name: name, input_config: input_config }, call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object with options - client.import_instance(::Google::Cloud::Redis::V1beta1::ImportInstanceRequest.new(name: name, input_config: input_config), call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Verify method calls - assert_equal 5, import_instance_client_stub.call_count - end - end - end - - def test_export_instance - # 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" - output_config = {} - - export_instance_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| - assert options.metadata.key? :"x-goog-api-client" - assert options.metadata[:"x-goog-api-client"].include? "rest" - refute options.metadata[:"x-goog-api-client"].include? "grpc" - end - - ::Google::Cloud::Redis::V1beta1::CloudRedis::Rest::ServiceStub.stub :transcode_export_instance_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, export_instance_client_stub do - # Create client - client = ::Google::Cloud::Redis::V1beta1::CloudRedis::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - client.export_instance({ name: name, output_config: output_config }) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use named arguments - client.export_instance name: name, output_config: output_config do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object - client.export_instance ::Google::Cloud::Redis::V1beta1::ExportInstanceRequest.new(name: name, output_config: output_config) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use hash object with options - client.export_instance({ name: name, output_config: output_config }, call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object with options - client.export_instance(::Google::Cloud::Redis::V1beta1::ExportInstanceRequest.new(name: name, output_config: output_config), call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Verify method calls - assert_equal 5, export_instance_client_stub.call_count - end - end - end - - def test_failover_instance - # 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" - data_protection_mode = :DATA_PROTECTION_MODE_UNSPECIFIED - - failover_instance_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| - assert options.metadata.key? :"x-goog-api-client" - assert options.metadata[:"x-goog-api-client"].include? "rest" - refute options.metadata[:"x-goog-api-client"].include? "grpc" - end - - ::Google::Cloud::Redis::V1beta1::CloudRedis::Rest::ServiceStub.stub :transcode_failover_instance_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, failover_instance_client_stub do - # Create client - client = ::Google::Cloud::Redis::V1beta1::CloudRedis::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - client.failover_instance({ name: name, data_protection_mode: data_protection_mode }) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use named arguments - client.failover_instance name: name, data_protection_mode: data_protection_mode do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object - client.failover_instance ::Google::Cloud::Redis::V1beta1::FailoverInstanceRequest.new(name: name, data_protection_mode: data_protection_mode) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use hash object with options - client.failover_instance({ name: name, data_protection_mode: data_protection_mode }, call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object with options - client.failover_instance(::Google::Cloud::Redis::V1beta1::FailoverInstanceRequest.new(name: name, data_protection_mode: data_protection_mode), call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Verify method calls - assert_equal 5, failover_instance_client_stub.call_count - end - end - end - - def test_delete_instance - # 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" - - delete_instance_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| - assert options.metadata.key? :"x-goog-api-client" - assert options.metadata[:"x-goog-api-client"].include? "rest" - refute options.metadata[:"x-goog-api-client"].include? "grpc" - end - - ::Google::Cloud::Redis::V1beta1::CloudRedis::Rest::ServiceStub.stub :transcode_delete_instance_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, delete_instance_client_stub do - # Create client - client = ::Google::Cloud::Redis::V1beta1::CloudRedis::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - client.delete_instance({ name: name }) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use named arguments - client.delete_instance name: name do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object - client.delete_instance ::Google::Cloud::Redis::V1beta1::DeleteInstanceRequest.new(name: name) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use hash object with options - client.delete_instance({ name: name }, call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object with options - client.delete_instance(::Google::Cloud::Redis::V1beta1::DeleteInstanceRequest.new(name: name), call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Verify method calls - assert_equal 5, delete_instance_client_stub.call_count - end - end - end - - def test_reschedule_maintenance - # 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" - reschedule_type = :RESCHEDULE_TYPE_UNSPECIFIED - schedule_time = {} - - reschedule_maintenance_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| - assert options.metadata.key? :"x-goog-api-client" - assert options.metadata[:"x-goog-api-client"].include? "rest" - refute options.metadata[:"x-goog-api-client"].include? "grpc" - end - - ::Google::Cloud::Redis::V1beta1::CloudRedis::Rest::ServiceStub.stub :transcode_reschedule_maintenance_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, reschedule_maintenance_client_stub do - # Create client - client = ::Google::Cloud::Redis::V1beta1::CloudRedis::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - client.reschedule_maintenance({ name: name, reschedule_type: reschedule_type, schedule_time: schedule_time }) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use named arguments - client.reschedule_maintenance name: name, reschedule_type: reschedule_type, schedule_time: schedule_time do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object - client.reschedule_maintenance ::Google::Cloud::Redis::V1beta1::RescheduleMaintenanceRequest.new(name: name, reschedule_type: reschedule_type, schedule_time: schedule_time) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use hash object with options - client.reschedule_maintenance({ name: name, reschedule_type: reschedule_type, schedule_time: schedule_time }, call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object with options - client.reschedule_maintenance(::Google::Cloud::Redis::V1beta1::RescheduleMaintenanceRequest.new(name: name, reschedule_type: reschedule_type, schedule_time: schedule_time), call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Verify method calls - assert_equal 5, reschedule_maintenance_client_stub.call_count - end - end - end - - def test_configure - credentials_token = :dummy_value - - client = block_config = config = nil - dummy_stub = ClientStub.new nil - Gapic::Rest::ClientStub.stub :new, dummy_stub do - client = ::Google::Cloud::Redis::V1beta1::CloudRedis::Rest::Client.new do |config| - config.credentials = credentials_token - end - end - - config = client.configure do |c| - block_config = c - end - - assert_same block_config, config - assert_kind_of ::Google::Cloud::Redis::V1beta1::CloudRedis::Rest::Client::Configuration, config - end -end diff --git a/owl-bot-staging/google-cloud-redis-v1beta1/test/google/cloud/redis/v1beta1/cloud_redis_test.rb b/owl-bot-staging/google-cloud-redis-v1beta1/test/google/cloud/redis/v1beta1/cloud_redis_test.rb deleted file mode 100644 index 6e2eb3e6b755..000000000000 --- a/owl-bot-staging/google-cloud-redis-v1beta1/test/google/cloud/redis/v1beta1/cloud_redis_test.rb +++ /dev/null @@ -1,823 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -require "helper" - -require "gapic/grpc/service_stub" - -require "google/cloud/redis/v1beta1/cloud_redis_pb" -require "google/cloud/redis/v1beta1/cloud_redis" - -class ::Google::Cloud::Redis::V1beta1::CloudRedis::ClientTest < Minitest::Test - class ClientStub - attr_accessor :call_rpc_count, :requests - - def initialize response, operation, &block - @response = response - @operation = operation - @block = block - @call_rpc_count = 0 - @requests = [] - end - - def call_rpc *args, **kwargs - @call_rpc_count += 1 - - @requests << @block&.call(*args, **kwargs) - - catch :response do - yield @response, @operation if block_given? - @response - end - end - - def endpoint - "endpoint.example.com" - end - - def universe_domain - "example.com" - end - - def stub_logger - nil - end - - def logger - nil - end - end - - def test_list_instances - # Create GRPC objects. - grpc_response = ::Google::Cloud::Redis::V1beta1::ListInstancesResponse.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_instances_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :list_instances, name - assert_kind_of ::Google::Cloud::Redis::V1beta1::ListInstancesRequest, 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_instances_client_stub do - # Create client - client = ::Google::Cloud::Redis::V1beta1::CloudRedis::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.list_instances({ 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_instances 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_instances ::Google::Cloud::Redis::V1beta1::ListInstancesRequest.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_instances({ 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_instances(::Google::Cloud::Redis::V1beta1::ListInstancesRequest.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_instances_client_stub.call_rpc_count - end - end - - def test_get_instance - # Create GRPC objects. - grpc_response = ::Google::Cloud::Redis::V1beta1::Instance.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_instance_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :get_instance, name - assert_kind_of ::Google::Cloud::Redis::V1beta1::GetInstanceRequest, request - assert_equal "hello world", request["name"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, get_instance_client_stub do - # Create client - client = ::Google::Cloud::Redis::V1beta1::CloudRedis::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.get_instance({ name: name }) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use named arguments - client.get_instance name: name do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object - client.get_instance ::Google::Cloud::Redis::V1beta1::GetInstanceRequest.new(name: name) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use hash object with options - client.get_instance({ 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_instance(::Google::Cloud::Redis::V1beta1::GetInstanceRequest.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_instance_client_stub.call_rpc_count - end - end - - def test_get_instance_auth_string - # Create GRPC objects. - grpc_response = ::Google::Cloud::Redis::V1beta1::InstanceAuthString.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_instance_auth_string_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :get_instance_auth_string, name - assert_kind_of ::Google::Cloud::Redis::V1beta1::GetInstanceAuthStringRequest, request - assert_equal "hello world", request["name"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, get_instance_auth_string_client_stub do - # Create client - client = ::Google::Cloud::Redis::V1beta1::CloudRedis::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.get_instance_auth_string({ name: name }) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use named arguments - client.get_instance_auth_string name: name do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object - client.get_instance_auth_string ::Google::Cloud::Redis::V1beta1::GetInstanceAuthStringRequest.new(name: name) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use hash object with options - client.get_instance_auth_string({ 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_instance_auth_string(::Google::Cloud::Redis::V1beta1::GetInstanceAuthStringRequest.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_instance_auth_string_client_stub.call_rpc_count - end - end - - def test_create_instance - # 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" - instance_id = "hello world" - instance = {} - - create_instance_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :create_instance, name - assert_kind_of ::Google::Cloud::Redis::V1beta1::CreateInstanceRequest, request - assert_equal "hello world", request["parent"] - assert_equal "hello world", request["instance_id"] - assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::Redis::V1beta1::Instance), request["instance"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, create_instance_client_stub do - # Create client - client = ::Google::Cloud::Redis::V1beta1::CloudRedis::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.create_instance({ parent: parent, instance_id: instance_id, instance: instance }) 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_instance parent: parent, instance_id: instance_id, instance: instance 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_instance ::Google::Cloud::Redis::V1beta1::CreateInstanceRequest.new(parent: parent, instance_id: instance_id, instance: instance) 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_instance({ parent: parent, instance_id: instance_id, instance: instance }, 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_instance(::Google::Cloud::Redis::V1beta1::CreateInstanceRequest.new(parent: parent, instance_id: instance_id, instance: instance), 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_instance_client_stub.call_rpc_count - end - end - - def test_update_instance - # 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. - update_mask = {} - instance = {} - - update_instance_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :update_instance, name - assert_kind_of ::Google::Cloud::Redis::V1beta1::UpdateInstanceRequest, request - assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Protobuf::FieldMask), request["update_mask"] - assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::Redis::V1beta1::Instance), request["instance"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, update_instance_client_stub do - # Create client - client = ::Google::Cloud::Redis::V1beta1::CloudRedis::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.update_instance({ update_mask: update_mask, instance: instance }) 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_instance update_mask: update_mask, instance: instance 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_instance ::Google::Cloud::Redis::V1beta1::UpdateInstanceRequest.new(update_mask: update_mask, instance: instance) 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_instance({ update_mask: update_mask, instance: instance }, 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_instance(::Google::Cloud::Redis::V1beta1::UpdateInstanceRequest.new(update_mask: update_mask, instance: instance), 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_instance_client_stub.call_rpc_count - end - end - - def test_upgrade_instance - # 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" - redis_version = "hello world" - - upgrade_instance_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :upgrade_instance, name - assert_kind_of ::Google::Cloud::Redis::V1beta1::UpgradeInstanceRequest, request - assert_equal "hello world", request["name"] - assert_equal "hello world", request["redis_version"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, upgrade_instance_client_stub do - # Create client - client = ::Google::Cloud::Redis::V1beta1::CloudRedis::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.upgrade_instance({ name: name, redis_version: redis_version }) 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.upgrade_instance name: name, redis_version: redis_version 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.upgrade_instance ::Google::Cloud::Redis::V1beta1::UpgradeInstanceRequest.new(name: name, redis_version: redis_version) 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.upgrade_instance({ name: name, redis_version: redis_version }, 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.upgrade_instance(::Google::Cloud::Redis::V1beta1::UpgradeInstanceRequest.new(name: name, redis_version: redis_version), 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, upgrade_instance_client_stub.call_rpc_count - end - end - - def test_import_instance - # 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" - input_config = {} - - import_instance_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :import_instance, name - assert_kind_of ::Google::Cloud::Redis::V1beta1::ImportInstanceRequest, request - assert_equal "hello world", request["name"] - assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::Redis::V1beta1::InputConfig), request["input_config"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, import_instance_client_stub do - # Create client - client = ::Google::Cloud::Redis::V1beta1::CloudRedis::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.import_instance({ name: name, input_config: input_config }) 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.import_instance name: name, input_config: input_config 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.import_instance ::Google::Cloud::Redis::V1beta1::ImportInstanceRequest.new(name: name, input_config: input_config) 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.import_instance({ name: name, input_config: input_config }, 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.import_instance(::Google::Cloud::Redis::V1beta1::ImportInstanceRequest.new(name: name, input_config: input_config), 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, import_instance_client_stub.call_rpc_count - end - end - - def test_export_instance - # 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" - output_config = {} - - export_instance_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :export_instance, name - assert_kind_of ::Google::Cloud::Redis::V1beta1::ExportInstanceRequest, request - assert_equal "hello world", request["name"] - assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::Redis::V1beta1::OutputConfig), request["output_config"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, export_instance_client_stub do - # Create client - client = ::Google::Cloud::Redis::V1beta1::CloudRedis::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.export_instance({ name: name, output_config: output_config }) 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.export_instance name: name, output_config: output_config 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.export_instance ::Google::Cloud::Redis::V1beta1::ExportInstanceRequest.new(name: name, output_config: output_config) 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.export_instance({ name: name, output_config: output_config }, 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.export_instance(::Google::Cloud::Redis::V1beta1::ExportInstanceRequest.new(name: name, output_config: output_config), 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, export_instance_client_stub.call_rpc_count - end - end - - def test_failover_instance - # 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" - data_protection_mode = :DATA_PROTECTION_MODE_UNSPECIFIED - - failover_instance_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :failover_instance, name - assert_kind_of ::Google::Cloud::Redis::V1beta1::FailoverInstanceRequest, request - assert_equal "hello world", request["name"] - assert_equal :DATA_PROTECTION_MODE_UNSPECIFIED, request["data_protection_mode"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, failover_instance_client_stub do - # Create client - client = ::Google::Cloud::Redis::V1beta1::CloudRedis::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.failover_instance({ name: name, data_protection_mode: data_protection_mode }) 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.failover_instance name: name, data_protection_mode: data_protection_mode 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.failover_instance ::Google::Cloud::Redis::V1beta1::FailoverInstanceRequest.new(name: name, data_protection_mode: data_protection_mode) 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.failover_instance({ name: name, data_protection_mode: data_protection_mode }, 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.failover_instance(::Google::Cloud::Redis::V1beta1::FailoverInstanceRequest.new(name: name, data_protection_mode: data_protection_mode), 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, failover_instance_client_stub.call_rpc_count - end - end - - def test_delete_instance - # 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" - - delete_instance_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :delete_instance, name - assert_kind_of ::Google::Cloud::Redis::V1beta1::DeleteInstanceRequest, request - assert_equal "hello world", request["name"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, delete_instance_client_stub do - # Create client - client = ::Google::Cloud::Redis::V1beta1::CloudRedis::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.delete_instance({ 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.delete_instance 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.delete_instance ::Google::Cloud::Redis::V1beta1::DeleteInstanceRequest.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.delete_instance({ 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.delete_instance(::Google::Cloud::Redis::V1beta1::DeleteInstanceRequest.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, delete_instance_client_stub.call_rpc_count - end - end - - def test_reschedule_maintenance - # 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" - reschedule_type = :RESCHEDULE_TYPE_UNSPECIFIED - schedule_time = {} - - reschedule_maintenance_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :reschedule_maintenance, name - assert_kind_of ::Google::Cloud::Redis::V1beta1::RescheduleMaintenanceRequest, request - assert_equal "hello world", request["name"] - assert_equal :RESCHEDULE_TYPE_UNSPECIFIED, request["reschedule_type"] - assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Protobuf::Timestamp), request["schedule_time"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, reschedule_maintenance_client_stub do - # Create client - client = ::Google::Cloud::Redis::V1beta1::CloudRedis::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.reschedule_maintenance({ name: name, reschedule_type: reschedule_type, schedule_time: schedule_time }) 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.reschedule_maintenance name: name, reschedule_type: reschedule_type, schedule_time: schedule_time 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.reschedule_maintenance ::Google::Cloud::Redis::V1beta1::RescheduleMaintenanceRequest.new(name: name, reschedule_type: reschedule_type, schedule_time: schedule_time) 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.reschedule_maintenance({ name: name, reschedule_type: reschedule_type, schedule_time: schedule_time }, 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.reschedule_maintenance(::Google::Cloud::Redis::V1beta1::RescheduleMaintenanceRequest.new(name: name, reschedule_type: reschedule_type, schedule_time: schedule_time), 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, reschedule_maintenance_client_stub.call_rpc_count - end - end - - def test_configure - grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - - client = block_config = config = nil - dummy_stub = ClientStub.new nil, nil - Gapic::ServiceStub.stub :new, dummy_stub do - client = ::Google::Cloud::Redis::V1beta1::CloudRedis::Client.new do |config| - config.credentials = grpc_channel - end - end - - config = client.configure do |c| - block_config = c - end - - assert_same block_config, config - assert_kind_of ::Google::Cloud::Redis::V1beta1::CloudRedis::Client::Configuration, config - end - - def test_credentials - key = OpenSSL::PKey::RSA.new 2048 - cred_json = { - "private_key" => key.to_pem, - "client_email" => "app@developer.gserviceaccount.com", - "type" => "service_account" - } - key_file = StringIO.new cred_json.to_json - creds = Google::Auth::ServiceAccountCredentials.make_creds({ json_key_io: key_file }) - - dummy_stub = ClientStub.new nil, nil - Gapic::ServiceStub.stub :new, dummy_stub do - client = ::Google::Cloud::Redis::V1beta1::CloudRedis::Client.new do |config| - config.credentials = creds - end - assert_kind_of ::Google::Cloud::Redis::V1beta1::CloudRedis::Client, client - assert_equal creds, client.configure.credentials - end - end - - def test_operations_client - grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - - client = nil - dummy_stub = ClientStub.new nil, nil - Gapic::ServiceStub.stub :new, dummy_stub do - client = ::Google::Cloud::Redis::V1beta1::CloudRedis::Client.new do |config| - config.credentials = grpc_channel - end - end - - assert_kind_of ::Google::Cloud::Redis::V1beta1::CloudRedis::Operations, client.operations_client - end -end diff --git a/owl-bot-staging/google-cloud-redis-v1beta1/test/helper.rb b/owl-bot-staging/google-cloud-redis-v1beta1/test/helper.rb deleted file mode 100644 index 672b337030e7..000000000000 --- a/owl-bot-staging/google-cloud-redis-v1beta1/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" diff --git a/owl-bot-staging/google-cloud-resource_manager-v3/.gitignore b/owl-bot-staging/google-cloud-resource_manager-v3/.gitignore deleted file mode 100644 index 0135b6bc6cfc..000000000000 --- a/owl-bot-staging/google-cloud-resource_manager-v3/.gitignore +++ /dev/null @@ -1,22 +0,0 @@ -# Ignore bundler lockfiles -Gemfile.lock -gems.locked - -# Ignore documentation output -doc/* -.yardoc/* - -# Ignore test output -coverage/* - -# Ignore build artifacts -pkg/* - -# Ignore files commonly present in certain dev environments -.vagrant -.DS_STORE -.idea -*.iml - -# Ignore synth output -__pycache__ diff --git a/owl-bot-staging/google-cloud-resource_manager-v3/.repo-metadata.json b/owl-bot-staging/google-cloud-resource_manager-v3/.repo-metadata.json deleted file mode 100644 index 27f4a651eb95..000000000000 --- a/owl-bot-staging/google-cloud-resource_manager-v3/.repo-metadata.json +++ /dev/null @@ -1,18 +0,0 @@ -{ - "api_id": "cloudresourcemanager.googleapis.com", - "api_shortname": "cloudresourcemanager", - "client_documentation": "https://cloud.google.com/ruby/docs/reference/google-cloud-resource_manager-v3/latest", - "distribution_name": "google-cloud-resource_manager-v3", - "is_cloud": true, - "language": "ruby", - "name": "cloudresourcemanager", - "name_pretty": "Resource Manager V3 API", - "product_documentation": "https://cloud.google.com/resource-manager/", - "release_level": "unreleased", - "repo": "googleapis/google-cloud-ruby", - "requires_billing": true, - "ruby-cloud-description": "Google Cloud provides container resources such as organizations and projects that allow you to group and hierarchically organize other Google Cloud resources. This hierarchical organization helps you manage common aspects of your resources, such as access control and configuration settings. The Resource Manager API enables you to programmatically manage these container resources. Note that google-cloud-resource_manager-v3 is a version-specific client library. For most uses, we recommend installing the main client library google-cloud-resource_manager instead. See the readme for more details.", - "ruby-cloud-env-prefix": "RESOURCE_MANAGER", - "ruby-cloud-product-url": "https://cloud.google.com/resource-manager/", - "library_type": "GAPIC_AUTO" -} diff --git a/owl-bot-staging/google-cloud-resource_manager-v3/.rubocop.yml b/owl-bot-staging/google-cloud-resource_manager-v3/.rubocop.yml deleted file mode 100644 index f8826ca0a722..000000000000 --- a/owl-bot-staging/google-cloud-resource_manager-v3/.rubocop.yml +++ /dev/null @@ -1,33 +0,0 @@ -inherit_gem: - google-style: google-style.yml - -AllCops: - Exclude: - - "google-cloud-resource_manager-v3.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-resource_manager-v3.rb" diff --git a/owl-bot-staging/google-cloud-resource_manager-v3/.toys.rb b/owl-bot-staging/google-cloud-resource_manager-v3/.toys.rb deleted file mode 100644 index 177e22456e8a..000000000000 --- a/owl-bot-staging/google-cloud-resource_manager-v3/.toys.rb +++ /dev/null @@ -1,28 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -toys_version! ">= 0.15.3" - -if ENV["RUBY_COMMON_TOOLS"] - common_tools_dir = File.expand_path ENV["RUBY_COMMON_TOOLS"] - load File.join(common_tools_dir, "toys", "gapic") -else - load_git remote: "https://github.com/googleapis/ruby-common-tools.git", - path: "toys/gapic", - update: true -end diff --git a/owl-bot-staging/google-cloud-resource_manager-v3/.yardopts b/owl-bot-staging/google-cloud-resource_manager-v3/.yardopts deleted file mode 100644 index 107c153c5692..000000000000 --- a/owl-bot-staging/google-cloud-resource_manager-v3/.yardopts +++ /dev/null @@ -1,12 +0,0 @@ ---no-private ---title="Resource Manager V3 API" ---exclude _pb\.rb$ ---markup markdown ---markup-provider redcarpet - -./lib/**/*.rb -./proto_docs/**/*.rb -- -README.md -LICENSE.md -AUTHENTICATION.md diff --git a/owl-bot-staging/google-cloud-resource_manager-v3/AUTHENTICATION.md b/owl-bot-staging/google-cloud-resource_manager-v3/AUTHENTICATION.md deleted file mode 100644 index 89e504497d87..000000000000 --- a/owl-bot-staging/google-cloud-resource_manager-v3/AUTHENTICATION.md +++ /dev/null @@ -1,122 +0,0 @@ -# Authentication - -The recommended way to authenticate to the google-cloud-resource_manager-v3 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-resource_manager-v3 library provides several mechanisms to configure your system. -Generally, using Application Default Credentials to facilitate automatic -credentials discovery is the easist method. But if you need to explicitly specify -credentials, there are several methods available to you. - -Credentials are accepted in the following ways, in the following order or precedence: - -1. Credentials specified in method arguments -2. Credentials specified in configuration -3. Credentials pointed to or included in environment variables -4. Credentials found in local ADC file -5. Credentials returned by the metadata server for the attached service account (GCP) - -### Configuration - -You can configure a path to a JSON credentials file, either for an individual client object or -globally, for all client objects. The JSON file can contain credentials created for -[workload identity federation](https://cloud.google.com/iam/docs/workload-identity-federation), -[workforce identity federation](https://cloud.google.com/iam/docs/workforce-identity-federation), or a -[service account key](https://cloud.google.com/docs/authentication/provide-credentials-adc#local-key). - -Note: Service account keys are a security risk if not managed correctly. You should -[choose a more secure alternative to service account keys](https://cloud.google.com/docs/authentication#auth-decision-tree) -whenever possible. - -To configure a credentials file for an individual client initialization: - -```ruby -require "google/cloud/resource_manager/v3" - -client = ::Google::Cloud::ResourceManager::V3::Folders::Client.new do |config| - config.credentials = "path/to/credentialfile.json" -end -``` - -To configure a credentials file globally for all clients: - -```ruby -require "google/cloud/resource_manager/v3" - -::Google::Cloud::ResourceManager::V3::Folders::Client.configure do |config| - config.credentials = "path/to/credentialfile.json" -end - -client = ::Google::Cloud::ResourceManager::V3::Folders::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-resource_manager-v3 -checks for credentials are: - -* `GOOGLE_CLOUD_CREDENTIALS` - Path to JSON file, or JSON contents -* `GOOGLE_APPLICATION_CREDENTIALS` - Path to JSON file - -```ruby -require "google/cloud/resource_manager/v3" - -ENV["GOOGLE_APPLICATION_CREDENTIALS"] = "path/to/credentialfile.json" - -client = ::Google::Cloud::ResourceManager::V3::Folders::Client.new -``` - -### Local ADC file - -You can set up a local ADC file with your user credentials for authentication during -development. If credentials are not provided in code or in environment variables, -then the local ADC credentials are discovered. - -Follow the steps in [Quickstart](#quickstart) to set up a local ADC file. - -### Google Cloud Platform environments - -When running on Google Cloud Platform (GCP), including Google Compute Engine -(GCE), Google Kubernetes Engine (GKE), Google App Engine (GAE), Google Cloud -Functions (GCF) and Cloud Run, credentials are retrieved from the attached -service account automatically. Code should be written as if already authenticated. - -For more information, see -[Set up ADC for Google Cloud services](https://cloud.google.com/docs/authentication/provide-credentials-adc#attached-sa). diff --git a/owl-bot-staging/google-cloud-resource_manager-v3/CHANGELOG.md b/owl-bot-staging/google-cloud-resource_manager-v3/CHANGELOG.md deleted file mode 100644 index f88957a62ba2..000000000000 --- a/owl-bot-staging/google-cloud-resource_manager-v3/CHANGELOG.md +++ /dev/null @@ -1,2 +0,0 @@ -# Release History - diff --git a/owl-bot-staging/google-cloud-resource_manager-v3/Gemfile b/owl-bot-staging/google-cloud-resource_manager-v3/Gemfile deleted file mode 100644 index 1d08558908d8..000000000000 --- a/owl-bot-staging/google-cloud-resource_manager-v3/Gemfile +++ /dev/null @@ -1,14 +0,0 @@ -source "https://rubygems.org" - -gemspec - -gem "google-style", "~> 1.32.0" -gem "irb", "~> 1.17" -gem "minitest", "~> 6.0.2" -gem "minitest-focus", "~> 1.4" -gem "minitest-mock", "~> 5.27" -gem "minitest-rg", "~> 5.3" -gem "ostruct", "~> 0.5.5" -gem "rake", ">= 13.0" -gem "redcarpet", "~> 3.6" -gem "yard", "~> 0.9" diff --git a/owl-bot-staging/google-cloud-resource_manager-v3/LICENSE.md b/owl-bot-staging/google-cloud-resource_manager-v3/LICENSE.md deleted file mode 100644 index c261857ba6ad..000000000000 --- a/owl-bot-staging/google-cloud-resource_manager-v3/LICENSE.md +++ /dev/null @@ -1,201 +0,0 @@ - Apache License - Version 2.0, January 2004 - http://www.apache.org/licenses/ - - TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION - - 1. Definitions. - - "License" shall mean the terms and conditions for use, reproduction, - and distribution as defined by Sections 1 through 9 of this document. - - "Licensor" shall mean the copyright owner or entity authorized by - the copyright owner that is granting the License. - - "Legal Entity" shall mean the union of the acting entity and all - other entities that control, are controlled by, or are under common - control with that entity. For the purposes of this definition, - "control" means (i) the power, direct or indirect, to cause the - direction or management of such entity, whether by contract or - otherwise, or (ii) ownership of fifty percent (50%) or more of the - outstanding shares, or (iii) beneficial ownership of such entity. - - "You" (or "Your") shall mean an individual or Legal Entity - exercising permissions granted by this License. - - "Source" form shall mean the preferred form for making modifications, - including but not limited to software source code, documentation - source, and configuration files. - - "Object" form shall mean any form resulting from mechanical - transformation or translation of a Source form, including but - not limited to compiled object code, generated documentation, - and conversions to other media types. - - "Work" shall mean the work of authorship, whether in Source or - Object form, made available under the License, as indicated by a - copyright notice that is included in or attached to the work - (an example is provided in the Appendix below). - - "Derivative Works" shall mean any work, whether in Source or Object - form, that is based on (or derived from) the Work and for which the - editorial revisions, annotations, elaborations, or other modifications - represent, as a whole, an original work of authorship. For the purposes - of this License, Derivative Works shall not include works that remain - separable from, or merely link (or bind by name) to the interfaces of, - the Work and Derivative Works thereof. - - "Contribution" shall mean any work of authorship, including - the original version of the Work and any modifications or additions - to that Work or Derivative Works thereof, that is intentionally - submitted to Licensor for inclusion in the Work by the copyright owner - or by an individual or Legal Entity authorized to submit on behalf of - the copyright owner. For the purposes of this definition, "submitted" - means any form of electronic, verbal, or written communication sent - to the Licensor or its representatives, including but not limited to - communication on electronic mailing lists, source code control systems, - and issue tracking systems that are managed by, or on behalf of, the - Licensor for the purpose of discussing and improving the Work, but - excluding communication that is conspicuously marked or otherwise - designated in writing by the copyright owner as "Not a Contribution." - - "Contributor" shall mean Licensor and any individual or Legal Entity - on behalf of whom a Contribution has been received by Licensor and - subsequently incorporated within the Work. - - 2. Grant of Copyright License. Subject to the terms and conditions of - this License, each Contributor hereby grants to You a perpetual, - worldwide, non-exclusive, no-charge, royalty-free, irrevocable - copyright license to reproduce, prepare Derivative Works of, - publicly display, publicly perform, sublicense, and distribute the - Work and such Derivative Works in Source or Object form. - - 3. Grant of Patent License. Subject to the terms and conditions of - this License, each Contributor hereby grants to You a perpetual, - worldwide, non-exclusive, no-charge, royalty-free, irrevocable - (except as stated in this section) patent license to make, have made, - use, offer to sell, sell, import, and otherwise transfer the Work, - where such license applies only to those patent claims licensable - by such Contributor that are necessarily infringed by their - Contribution(s) alone or by combination of their Contribution(s) - with the Work to which such Contribution(s) was submitted. If You - institute patent litigation against any entity (including a - cross-claim or counterclaim in a lawsuit) alleging that the Work - or a Contribution incorporated within the Work constitutes direct - or contributory patent infringement, then any patent licenses - granted to You under this License for that Work shall terminate - as of the date such litigation is filed. - - 4. Redistribution. You may reproduce and distribute copies of the - Work or Derivative Works thereof in any medium, with or without - modifications, and in Source or Object form, provided that You - meet the following conditions: - - (a) You must give any other recipients of the Work or - Derivative Works a copy of this License; and - - (b) You must cause any modified files to carry prominent notices - stating that You changed the files; and - - (c) You must retain, in the Source form of any Derivative Works - that You distribute, all copyright, patent, trademark, and - attribution notices from the Source form of the Work, - excluding those notices that do not pertain to any part of - the Derivative Works; and - - (d) If the Work includes a "NOTICE" text file as part of its - distribution, then any Derivative Works that You distribute must - include a readable copy of the attribution notices contained - within such NOTICE file, excluding those notices that do not - pertain to any part of the Derivative Works, in at least one - of the following places: within a NOTICE text file distributed - as part of the Derivative Works; within the Source form or - documentation, if provided along with the Derivative Works; or, - within a display generated by the Derivative Works, if and - wherever such third-party notices normally appear. The contents - of the NOTICE file are for informational purposes only and - do not modify the License. You may add Your own attribution - notices within Derivative Works that You distribute, alongside - or as an addendum to the NOTICE text from the Work, provided - that such additional attribution notices cannot be construed - as modifying the License. - - You may add Your own copyright statement to Your modifications and - may provide additional or different license terms and conditions - for use, reproduction, or distribution of Your modifications, or - for any such Derivative Works as a whole, provided Your use, - reproduction, and distribution of the Work otherwise complies with - the conditions stated in this License. - - 5. Submission of Contributions. Unless You explicitly state otherwise, - any Contribution intentionally submitted for inclusion in the Work - by You to the Licensor shall be under the terms and conditions of - this License, without any additional terms or conditions. - Notwithstanding the above, nothing herein shall supersede or modify - the terms of any separate license agreement you may have executed - with Licensor regarding such Contributions. - - 6. Trademarks. This License does not grant permission to use the trade - names, trademarks, service marks, or product names of the Licensor, - except as required for reasonable and customary use in describing the - origin of the Work and reproducing the content of the NOTICE file. - - 7. Disclaimer of Warranty. Unless required by applicable law or - agreed to in writing, Licensor provides the Work (and each - Contributor provides its Contributions) on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or - implied, including, without limitation, any warranties or conditions - of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A - PARTICULAR PURPOSE. You are solely responsible for determining the - appropriateness of using or redistributing the Work and assume any - risks associated with Your exercise of permissions under this License. - - 8. Limitation of Liability. In no event and under no legal theory, - whether in tort (including negligence), contract, or otherwise, - unless required by applicable law (such as deliberate and grossly - negligent acts) or agreed to in writing, shall any Contributor be - liable to You for damages, including any direct, indirect, special, - incidental, or consequential damages of any character arising as a - result of this License or out of the use or inability to use the - Work (including but not limited to damages for loss of goodwill, - work stoppage, computer failure or malfunction, or any and all - other commercial damages or losses), even if such Contributor - has been advised of the possibility of such damages. - - 9. Accepting Warranty or Additional Liability. While redistributing - the Work or Derivative Works thereof, You may choose to offer, - and charge a fee for, acceptance of support, warranty, indemnity, - or other liability obligations and/or rights consistent with this - License. However, in accepting such obligations, You may act only - on Your own behalf and on Your sole responsibility, not on behalf - of any other Contributor, and only if You agree to indemnify, - defend, and hold each Contributor harmless for any liability - incurred by, or claims asserted against, such Contributor by reason - of your accepting any such warranty or additional liability. - - END OF TERMS AND CONDITIONS - - APPENDIX: How to apply the Apache License to your work. - - To apply the Apache License to your work, attach the following - boilerplate notice, with the fields enclosed by brackets "[]" - replaced with your own identifying information. (Don't include - the brackets!) The text should be enclosed in the appropriate - comment syntax for the file format. We also recommend that a - file or class name and description of purpose be included on the - same "printed page" as the copyright notice for easier - identification within third-party archives. - - Copyright [yyyy] [name of copyright owner] - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. diff --git a/owl-bot-staging/google-cloud-resource_manager-v3/README.md b/owl-bot-staging/google-cloud-resource_manager-v3/README.md deleted file mode 100644 index f787cb2aa5d4..000000000000 --- a/owl-bot-staging/google-cloud-resource_manager-v3/README.md +++ /dev/null @@ -1,154 +0,0 @@ -# Ruby Client for the Resource Manager V3 API - -Creates, reads, and updates metadata for Google Cloud Platform resource containers. - -Google Cloud provides container resources such as organizations and projects that allow you to group and hierarchically organize other Google Cloud resources. This hierarchical organization helps you manage common aspects of your resources, such as access control and configuration settings. The Resource Manager API enables you to programmatically manage these container resources. - -https://github.com/googleapis/google-cloud-ruby - -This gem is a _versioned_ client. It provides basic client classes for a -specific version of the Resource Manager V3 API. Most users should consider using -the main client gem, -[google-cloud-resource_manager](https://rubygems.org/gems/google-cloud-resource_manager). -See the section below titled *Which client should I use?* for more information. - -## Installation - -``` -$ gem install google-cloud-resource_manager-v3 -``` - -## 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/cloudresourcemanager.googleapis.com) -1. [Set up authentication.](AUTHENTICATION.md) - -## Quick Start - -```ruby -require "google/cloud/resource_manager/v3" - -client = ::Google::Cloud::ResourceManager::V3::Folders::Client.new -request = ::Google::Cloud::ResourceManager::V3::GetFolderRequest.new # (request fields as keyword arguments...) -response = client.get_folder request -``` - -View the [Client Library Documentation](https://cloud.google.com/ruby/docs/reference/google-cloud-resource_manager-v3/latest) -for class and method documentation. - -See also the [Product Documentation](https://cloud.google.com/resource-manager/) -for general usage information. - -## Debug Logging - -This library comes with opt-in Debug Logging that can help you troubleshoot -your application's integration with the API. When logging is activated, key -events such as requests and responses, along with data payloads and metadata -such as headers and client configuration, are logged to the standard error -stream. - -**WARNING:** Client Library Debug Logging includes your data payloads in -plaintext, which could include sensitive data such as PII for yourself or your -customers, private keys, or other security data that could be compromising if -leaked. Always practice good data hygiene with your application logs, and follow -the principle of least access. Google also recommends that Client Library Debug -Logging be enabled only temporarily during active debugging, and not used -permanently in production. - -To enable logging, set the environment variable `GOOGLE_SDK_RUBY_LOGGING_GEMS` -to the value `all`. Alternatively, you can set the value to a comma-delimited -list of client library gem names. This will select the default logging behavior, -which writes logs to the standard error stream. On a local workstation, this may -result in logs appearing on the console. When running on a Google Cloud hosting -service such as [Google Cloud Run](https://cloud.google.com/run), this generally -results in logs appearing alongside your application logs in the -[Google Cloud Logging](https://cloud.google.com/logging/) service. - -You can customize logging by modifying the `logger` configuration when -constructing a client object. For example: - -```ruby -require "google/cloud/resource_manager/v3" -require "logger" - -client = ::Google::Cloud::ResourceManager::V3::Folders::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-resource_manager`, -and lower-level _versioned_ client libraries with names such as -`google-cloud-resource_manager-v3`. -_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-resource_manager`. -The main client is recommended because it will embody the best practices for -accessing the service, and may also provide more convenient interfaces or -tighter integration into frameworks and third-party libraries. In addition, the -documentation and samples published by Google will generally demonstrate use of -the main client. - -### Why would I want to use a versioned client? - -You can use a versioned client if you are content with a possibly lower-level -class interface, you explicitly want to avoid features provided by the main -client, or you want to access a specific service version not be covered by the -main client. You can identify versioned client gems because the service version -is part of the name, e.g. `google-cloud-resource_manager-v3`. - -### What about the google-apis- clients? - -Client library gems with names that begin with `google-apis-` are based on an -older code generation technology. They talk to a REST/JSON backend (whereas -most modern clients talk to a [gRPC](https://grpc.io/) backend) and they may -not offer the same performance, features, and ease of use provided by more -modern clients. - -The `google-apis-` clients have wide coverage across Google services, so you -might need to use one if there is no modern client available for the service. -However, if a modern client is available, we generally recommend it over the -older `google-apis-` clients. diff --git a/owl-bot-staging/google-cloud-resource_manager-v3/Rakefile b/owl-bot-staging/google-cloud-resource_manager-v3/Rakefile deleted file mode 100644 index e5be77f3d0a1..000000000000 --- a/owl-bot-staging/google-cloud-resource_manager-v3/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-resource_manager-v3 acceptance tests." -task :acceptance, :project, :keyfile do |t, args| - project = args[:project] - project ||= - ENV["RESOURCE_MANAGER_TEST_PROJECT"] || - ENV["GCLOUD_TEST_PROJECT"] - keyfile = args[:keyfile] - keyfile ||= - ENV["RESOURCE_MANAGER_TEST_KEYFILE"] || - ENV["GCLOUD_TEST_KEYFILE"] - if keyfile - keyfile = File.read keyfile - else - keyfile ||= - ENV["RESOURCE_MANAGER_TEST_KEYFILE_JSON"] || - ENV["GCLOUD_TEST_KEYFILE_JSON"] - end - if project.nil? || keyfile.nil? - fail "You must provide a project and keyfile. e.g. rake acceptance[test123, /path/to/keyfile.json] or RESOURCE_MANAGER_TEST_PROJECT=test123 RESOURCE_MANAGER_TEST_KEYFILE=/path/to/keyfile.json rake acceptance" - end - require "google/cloud/resource_manager/v3/folders/credentials" - ::Google::Cloud::ResourceManager::V3::Folders::Credentials.env_vars.each do |path| - ENV[path] = nil - end - ENV["RESOURCE_MANAGER_PROJECT"] = project - ENV["RESOURCE_MANAGER_TEST_PROJECT"] = project - ENV["RESOURCE_MANAGER_KEYFILE_JSON"] = keyfile - - Rake::Task["acceptance:run"].invoke -end - -namespace :acceptance do - task :run do - if File.directory? "acceptance" - Rake::Task[:smoke_test].invoke - else - puts "The google-cloud-resource_manager-v3 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-resource_manager-v3 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-resource_manager-v3 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-resource_manager-v3 gem does not have doctest tests." -end - -desc "Run the CI build" -task :ci do - header "BUILDING google-cloud-resource_manager-v3" - header "google-cloud-resource_manager-v3 rubocop", "*" - Rake::Task[:rubocop].invoke - header "google-cloud-resource_manager-v3 yard", "*" - Rake::Task[:yard].invoke - header "google-cloud-resource_manager-v3 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-resource_manager-v3 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-resource_manager-v3 acceptance", "*" - Rake::Task[:acceptance].invoke - end - task :a do - # This is a handy shortcut to save typing - Rake::Task["ci:acceptance"].invoke - end -end - -task default: :test - -def header str, token = "#" - line_length = str.length + 8 - puts "" - puts token * line_length - puts "#{token * 3} #{str} #{token * 3}" - puts token * line_length - puts "" -end diff --git a/owl-bot-staging/google-cloud-resource_manager-v3/gapic_metadata.json b/owl-bot-staging/google-cloud-resource_manager-v3/gapic_metadata.json deleted file mode 100644 index 07aa5eb0d009..000000000000 --- a/owl-bot-staging/google-cloud-resource_manager-v3/gapic_metadata.json +++ /dev/null @@ -1,332 +0,0 @@ -{ - "schema": "1.0", - "comment": "This file maps proto services/RPCs to the corresponding library clients/methods", - "language": "ruby", - "protoPackage": "google.cloud.resourcemanager.v3", - "libraryPackage": "::Google::Cloud::ResourceManager::V3", - "services": { - "Folders": { - "clients": { - "grpc": { - "libraryClient": "::Google::Cloud::ResourceManager::V3::Folders::Client", - "rpcs": { - "GetFolder": { - "methods": [ - "get_folder" - ] - }, - "ListFolders": { - "methods": [ - "list_folders" - ] - }, - "SearchFolders": { - "methods": [ - "search_folders" - ] - }, - "CreateFolder": { - "methods": [ - "create_folder" - ] - }, - "UpdateFolder": { - "methods": [ - "update_folder" - ] - }, - "MoveFolder": { - "methods": [ - "move_folder" - ] - }, - "DeleteFolder": { - "methods": [ - "delete_folder" - ] - }, - "UndeleteFolder": { - "methods": [ - "undelete_folder" - ] - }, - "GetIamPolicy": { - "methods": [ - "get_iam_policy" - ] - }, - "SetIamPolicy": { - "methods": [ - "set_iam_policy" - ] - }, - "TestIamPermissions": { - "methods": [ - "test_iam_permissions" - ] - } - } - } - } - }, - "Organizations": { - "clients": { - "grpc": { - "libraryClient": "::Google::Cloud::ResourceManager::V3::Organizations::Client", - "rpcs": { - "GetOrganization": { - "methods": [ - "get_organization" - ] - }, - "SearchOrganizations": { - "methods": [ - "search_organizations" - ] - }, - "GetIamPolicy": { - "methods": [ - "get_iam_policy" - ] - }, - "SetIamPolicy": { - "methods": [ - "set_iam_policy" - ] - }, - "TestIamPermissions": { - "methods": [ - "test_iam_permissions" - ] - } - } - } - } - }, - "Projects": { - "clients": { - "grpc": { - "libraryClient": "::Google::Cloud::ResourceManager::V3::Projects::Client", - "rpcs": { - "GetProject": { - "methods": [ - "get_project" - ] - }, - "ListProjects": { - "methods": [ - "list_projects" - ] - }, - "SearchProjects": { - "methods": [ - "search_projects" - ] - }, - "CreateProject": { - "methods": [ - "create_project" - ] - }, - "UpdateProject": { - "methods": [ - "update_project" - ] - }, - "MoveProject": { - "methods": [ - "move_project" - ] - }, - "DeleteProject": { - "methods": [ - "delete_project" - ] - }, - "UndeleteProject": { - "methods": [ - "undelete_project" - ] - }, - "GetIamPolicy": { - "methods": [ - "get_iam_policy" - ] - }, - "SetIamPolicy": { - "methods": [ - "set_iam_policy" - ] - }, - "TestIamPermissions": { - "methods": [ - "test_iam_permissions" - ] - } - } - } - } - }, - "TagBindings": { - "clients": { - "grpc": { - "libraryClient": "::Google::Cloud::ResourceManager::V3::TagBindings::Client", - "rpcs": { - "ListTagBindings": { - "methods": [ - "list_tag_bindings" - ] - }, - "CreateTagBinding": { - "methods": [ - "create_tag_binding" - ] - }, - "DeleteTagBinding": { - "methods": [ - "delete_tag_binding" - ] - }, - "ListEffectiveTags": { - "methods": [ - "list_effective_tags" - ] - } - } - } - } - }, - "TagHolds": { - "clients": { - "grpc": { - "libraryClient": "::Google::Cloud::ResourceManager::V3::TagHolds::Client", - "rpcs": { - "CreateTagHold": { - "methods": [ - "create_tag_hold" - ] - }, - "DeleteTagHold": { - "methods": [ - "delete_tag_hold" - ] - }, - "ListTagHolds": { - "methods": [ - "list_tag_holds" - ] - } - } - } - } - }, - "TagKeys": { - "clients": { - "grpc": { - "libraryClient": "::Google::Cloud::ResourceManager::V3::TagKeys::Client", - "rpcs": { - "ListTagKeys": { - "methods": [ - "list_tag_keys" - ] - }, - "GetTagKey": { - "methods": [ - "get_tag_key" - ] - }, - "GetNamespacedTagKey": { - "methods": [ - "get_namespaced_tag_key" - ] - }, - "CreateTagKey": { - "methods": [ - "create_tag_key" - ] - }, - "UpdateTagKey": { - "methods": [ - "update_tag_key" - ] - }, - "DeleteTagKey": { - "methods": [ - "delete_tag_key" - ] - }, - "GetIamPolicy": { - "methods": [ - "get_iam_policy" - ] - }, - "SetIamPolicy": { - "methods": [ - "set_iam_policy" - ] - }, - "TestIamPermissions": { - "methods": [ - "test_iam_permissions" - ] - } - } - } - } - }, - "TagValues": { - "clients": { - "grpc": { - "libraryClient": "::Google::Cloud::ResourceManager::V3::TagValues::Client", - "rpcs": { - "ListTagValues": { - "methods": [ - "list_tag_values" - ] - }, - "GetTagValue": { - "methods": [ - "get_tag_value" - ] - }, - "GetNamespacedTagValue": { - "methods": [ - "get_namespaced_tag_value" - ] - }, - "CreateTagValue": { - "methods": [ - "create_tag_value" - ] - }, - "UpdateTagValue": { - "methods": [ - "update_tag_value" - ] - }, - "DeleteTagValue": { - "methods": [ - "delete_tag_value" - ] - }, - "GetIamPolicy": { - "methods": [ - "get_iam_policy" - ] - }, - "SetIamPolicy": { - "methods": [ - "set_iam_policy" - ] - }, - "TestIamPermissions": { - "methods": [ - "test_iam_permissions" - ] - } - } - } - } - } - } -} diff --git a/owl-bot-staging/google-cloud-resource_manager-v3/google-cloud-resource_manager-v3.gemspec b/owl-bot-staging/google-cloud-resource_manager-v3/google-cloud-resource_manager-v3.gemspec deleted file mode 100644 index a332bcd8d0f1..000000000000 --- a/owl-bot-staging/google-cloud-resource_manager-v3/google-cloud-resource_manager-v3.gemspec +++ /dev/null @@ -1,29 +0,0 @@ -# -*- ruby -*- -# encoding: utf-8 - -require File.expand_path("lib/google/cloud/resource_manager/v3/version", __dir__) - -Gem::Specification.new do |gem| - gem.name = "google-cloud-resource_manager-v3" - gem.version = Google::Cloud::ResourceManager::V3::VERSION - - gem.authors = ["Google LLC"] - gem.email = "googleapis-packages@google.com" - gem.description = "Google Cloud provides container resources such as organizations and projects that allow you to group and hierarchically organize other Google Cloud resources. This hierarchical organization helps you manage common aspects of your resources, such as access control and configuration settings. The Resource Manager API enables you to programmatically manage these container resources. Note that google-cloud-resource_manager-v3 is a version-specific client library. For most uses, we recommend installing the main client library google-cloud-resource_manager instead. See the readme for more details." - gem.summary = "Creates, reads, and updates metadata for Google Cloud Platform resource containers." - 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 "grpc-google-iam-v1", "~> 1.11" -end diff --git a/owl-bot-staging/google-cloud-resource_manager-v3/lib/google-cloud-resource_manager-v3.rb b/owl-bot-staging/google-cloud-resource_manager-v3/lib/google-cloud-resource_manager-v3.rb deleted file mode 100644 index 6e07803d3eab..000000000000 --- a/owl-bot-staging/google-cloud-resource_manager-v3/lib/google-cloud-resource_manager-v3.rb +++ /dev/null @@ -1,21 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -# This gem does not autoload during Bundler.require. To load this gem, -# issue explicit require statements for the packages desired, e.g.: -# require "google/cloud/resource_manager/v3" diff --git a/owl-bot-staging/google-cloud-resource_manager-v3/lib/google/cloud/resource_manager/v3.rb b/owl-bot-staging/google-cloud-resource_manager-v3/lib/google/cloud/resource_manager/v3.rb deleted file mode 100644 index 709c813ae71a..000000000000 --- a/owl-bot-staging/google-cloud-resource_manager-v3/lib/google/cloud/resource_manager/v3.rb +++ /dev/null @@ -1,51 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -require "google/cloud/resource_manager/v3/folders" -require "google/cloud/resource_manager/v3/organizations" -require "google/cloud/resource_manager/v3/projects" -require "google/cloud/resource_manager/v3/tag_bindings" -require "google/cloud/resource_manager/v3/tag_holds" -require "google/cloud/resource_manager/v3/tag_keys" -require "google/cloud/resource_manager/v3/tag_values" -require "google/cloud/resource_manager/v3/version" - -module Google - module Cloud - module ResourceManager - ## - # API client module. - # - # @example Load this package, including all its services, and instantiate a gRPC client - # - # require "google/cloud/resource_manager/v3" - # client = ::Google::Cloud::ResourceManager::V3::Folders::Client.new - # - # @example Load this package, including all its services, and instantiate a REST client - # - # require "google/cloud/resource_manager/v3" - # client = ::Google::Cloud::ResourceManager::V3::Folders::Rest::Client.new - # - module V3 - end - end - end -end - -helper_path = ::File.join __dir__, "v3", "_helpers.rb" -require "google/cloud/resource_manager/v3/_helpers" if ::File.file? helper_path diff --git a/owl-bot-staging/google-cloud-resource_manager-v3/lib/google/cloud/resource_manager/v3/folders.rb b/owl-bot-staging/google-cloud-resource_manager-v3/lib/google/cloud/resource_manager/v3/folders.rb deleted file mode 100644 index dd1e7845bd37..000000000000 --- a/owl-bot-staging/google-cloud-resource_manager-v3/lib/google/cloud/resource_manager/v3/folders.rb +++ /dev/null @@ -1,58 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -require "gapic/common" -require "gapic/config" -require "gapic/config/method" - -require "google/cloud/resource_manager/v3/version" - -require "google/cloud/resource_manager/v3/folders/credentials" -require "google/cloud/resource_manager/v3/folders/paths" -require "google/cloud/resource_manager/v3/folders/operations" -require "google/cloud/resource_manager/v3/folders/client" -require "google/cloud/resource_manager/v3/folders/rest" - -module Google - module Cloud - module ResourceManager - module V3 - ## - # Manages Cloud Platform folder resources. - # Folders can be used to organize the resources under an - # organization and to control the policies applied to groups of resources. - # - # @example Load this service and instantiate a gRPC client - # - # require "google/cloud/resource_manager/v3/folders" - # client = ::Google::Cloud::ResourceManager::V3::Folders::Client.new - # - # @example Load this service and instantiate a REST client - # - # require "google/cloud/resource_manager/v3/folders/rest" - # client = ::Google::Cloud::ResourceManager::V3::Folders::Rest::Client.new - # - module Folders - end - end - end - end -end - -helper_path = ::File.join __dir__, "folders", "helpers.rb" -require "google/cloud/resource_manager/v3/folders/helpers" if ::File.file? helper_path diff --git a/owl-bot-staging/google-cloud-resource_manager-v3/lib/google/cloud/resource_manager/v3/folders/client.rb b/owl-bot-staging/google-cloud-resource_manager-v3/lib/google/cloud/resource_manager/v3/folders/client.rb deleted file mode 100644 index b6cae8fe19c7..000000000000 --- a/owl-bot-staging/google-cloud-resource_manager-v3/lib/google/cloud/resource_manager/v3/folders/client.rb +++ /dev/null @@ -1,1668 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -require "google/cloud/errors" -require "google/cloud/resourcemanager/v3/folders_pb" - -module Google - module Cloud - module ResourceManager - module V3 - module Folders - ## - # Client for the Folders service. - # - # Manages Cloud Platform folder resources. - # Folders can be used to organize the resources under an - # organization and to control the policies applied to groups of resources. - # - class Client - # @private - API_VERSION = "" - - # @private - DEFAULT_ENDPOINT_TEMPLATE = "cloudresourcemanager.$UNIVERSE_DOMAIN$" - - include Paths - - # @private - attr_reader :folders_stub - - ## - # Configure the Folders Client class. - # - # See {::Google::Cloud::ResourceManager::V3::Folders::Client::Configuration} - # for a description of the configuration fields. - # - # @example - # - # # Modify the configuration for all Folders clients - # ::Google::Cloud::ResourceManager::V3::Folders::Client.configure do |config| - # config.timeout = 10.0 - # end - # - # @yield [config] Configure the Client client. - # @yieldparam config [Client::Configuration] - # - # @return [Client::Configuration] - # - def self.configure - @configure ||= begin - namespace = ["Google", "Cloud", "ResourceManager", "V3"] - 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.get_folder.timeout = 60.0 - default_config.rpcs.get_folder.retry_policy = { - initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [14] - } - - default_config.rpcs.list_folders.timeout = 60.0 - default_config.rpcs.list_folders.retry_policy = { - initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [14] - } - - default_config.rpcs.search_folders.timeout = 60.0 - - default_config.rpcs.create_folder.timeout = 60.0 - - default_config.rpcs.update_folder.timeout = 60.0 - - default_config.rpcs.move_folder.timeout = 60.0 - - default_config.rpcs.delete_folder.timeout = 60.0 - - default_config.rpcs.undelete_folder.timeout = 60.0 - - default_config.rpcs.get_iam_policy.timeout = 60.0 - default_config.rpcs.get_iam_policy.retry_policy = { - initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [14] - } - - default_config.rpcs.set_iam_policy.timeout = 60.0 - - default_config - end - yield @configure if block_given? - @configure - end - - ## - # Configure the Folders Client instance. - # - # The configuration is set to the derived mode, meaning that values can be changed, - # but structural changes (adding new fields, etc.) are not allowed. Structural changes - # should be made on {Client.configure}. - # - # See {::Google::Cloud::ResourceManager::V3::Folders::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 - @folders_stub.universe_domain - end - - ## - # Create a new Folders client object. - # - # @example - # - # # Create a client using the default configuration - # client = ::Google::Cloud::ResourceManager::V3::Folders::Client.new - # - # # Create a client using a custom configuration - # client = ::Google::Cloud::ResourceManager::V3::Folders::Client.new do |config| - # config.timeout = 10.0 - # end - # - # @yield [config] Configure the Folders client. - # @yieldparam config [Client::Configuration] - # - def initialize - # These require statements are intentionally placed here to initialize - # the gRPC module only when it's required. - # See https://github.com/googleapis/toolkit/issues/446 - require "gapic/grpc" - require "google/cloud/resourcemanager/v3/folders_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 - - @folders_stub = ::Gapic::ServiceStub.new( - ::Google::Cloud::ResourceManager::V3::Folders::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 - ) - - @folders_stub.stub_logger&.info do |entry| - entry.set_system_name - entry.set_service - entry.message = "Created client for #{entry.service}" - entry.set_credentials_fields credentials - entry.set "customEndpoint", @config.endpoint if @config.endpoint - entry.set "defaultTimeout", @config.timeout if @config.timeout - entry.set "quotaProject", @quota_project_id if @quota_project_id - end - end - - ## - # Get the associated client for long-running operations. - # - # @return [::Google::Cloud::ResourceManager::V3::Folders::Operations] - # - attr_reader :operations_client - - ## - # The logger used for request/response debug logging. - # - # @return [Logger] - # - def logger - @folders_stub.logger - end - - # Service calls - - ## - # Retrieves a folder identified by the supplied resource name. - # Valid folder resource names have the format `folders/{folder_id}` - # (for example, `folders/1234`). - # The caller must have `resourcemanager.folders.get` permission on the - # identified folder. - # - # @overload get_folder(request, options = nil) - # Pass arguments to `get_folder` via a request object, either of type - # {::Google::Cloud::ResourceManager::V3::GetFolderRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::ResourceManager::V3::GetFolderRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. - # - # @overload get_folder(name: nil) - # Pass arguments to `get_folder` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param name [::String] - # Required. The resource name of the folder to retrieve. - # Must be of the form `folders/{folder_id}`. - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Google::Cloud::ResourceManager::V3::Folder] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Google::Cloud::ResourceManager::V3::Folder] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/cloud/resource_manager/v3" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::ResourceManager::V3::Folders::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::ResourceManager::V3::GetFolderRequest.new - # - # # Call the get_folder method. - # result = client.get_folder request - # - # # The returned object is of type Google::Cloud::ResourceManager::V3::Folder. - # p result - # - def get_folder request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::ResourceManager::V3::GetFolderRequest - - # Converts hash and nil to an options object - options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h - - # Customize the options with defaults - metadata = @config.rpcs.get_folder.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::ResourceManager::V3::VERSION - metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - header_params = {} - if request.name - header_params["name"] = request.name - end - - request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") - metadata[:"x-goog-request-params"] ||= request_params_header - - options.apply_defaults timeout: @config.rpcs.get_folder.timeout, - metadata: metadata, - retry_policy: @config.rpcs.get_folder.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @folders_stub.call_rpc :get_folder, request, options: options do |response, operation| - yield response, operation if block_given? - end - rescue ::GRPC::BadStatus => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Lists the folders that are direct descendants of supplied parent resource. - # `list()` provides a strongly consistent view of the folders underneath - # the specified parent resource. - # `list()` returns folders sorted based upon the (ascending) lexical ordering - # of their display_name. - # The caller must have `resourcemanager.folders.list` permission on the - # identified parent. - # - # @overload list_folders(request, options = nil) - # Pass arguments to `list_folders` via a request object, either of type - # {::Google::Cloud::ResourceManager::V3::ListFoldersRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::ResourceManager::V3::ListFoldersRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. - # - # @overload list_folders(parent: nil, page_size: nil, page_token: nil, show_deleted: nil) - # Pass arguments to `list_folders` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param parent [::String] - # Required. The name of the parent resource whose folders are being listed. - # Only children of this parent resource are listed; descendants are not - # listed. - # - # If the parent is a folder, use the value `folders/{folder_id}`. If the - # parent is an organization, use the value `organizations/{org_id}`. - # - # Access to this method is controlled by checking the - # `resourcemanager.folders.list` permission on the `parent`. - # @param page_size [::Integer] - # Optional. The maximum number of folders to return in the response. The - # server can return fewer folders than requested. If unspecified, server - # picks an appropriate default. - # @param page_token [::String] - # Optional. A pagination token returned from a previous call to `ListFolders` - # that indicates where this listing should continue from. - # @param show_deleted [::Boolean] - # Optional. Controls whether folders in the - # {::Google::Cloud::ResourceManager::V3::Folder::State::DELETE_REQUESTED DELETE_REQUESTED} - # state should be returned. Defaults to false. - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Gapic::PagedEnumerable<::Google::Cloud::ResourceManager::V3::Folder>] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Gapic::PagedEnumerable<::Google::Cloud::ResourceManager::V3::Folder>] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/cloud/resource_manager/v3" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::ResourceManager::V3::Folders::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::ResourceManager::V3::ListFoldersRequest.new - # - # # Call the list_folders method. - # result = client.list_folders request - # - # # The returned object is of type Gapic::PagedEnumerable. You can iterate - # # over elements, and API calls will be issued to fetch pages as needed. - # result.each do |item| - # # Each element is of type ::Google::Cloud::ResourceManager::V3::Folder. - # p item - # end - # - def list_folders request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::ResourceManager::V3::ListFoldersRequest - - # Converts hash and nil to an options object - options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h - - # Customize the options with defaults - metadata = @config.rpcs.list_folders.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::ResourceManager::V3::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.list_folders.timeout, - metadata: metadata, - retry_policy: @config.rpcs.list_folders.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @folders_stub.call_rpc :list_folders, request, options: options do |response, operation| - response = ::Gapic::PagedEnumerable.new @folders_stub, :list_folders, request, response, operation, options - yield response, operation if block_given? - throw :response, response - end - rescue ::GRPC::BadStatus => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Search for folders that match specific filter criteria. - # `search()` provides an eventually consistent view of the folders a user has - # access to which meet the specified filter criteria. - # - # This will only return folders on which the caller has the - # permission `resourcemanager.folders.get`. - # - # @overload search_folders(request, options = nil) - # Pass arguments to `search_folders` via a request object, either of type - # {::Google::Cloud::ResourceManager::V3::SearchFoldersRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::ResourceManager::V3::SearchFoldersRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_folders(page_size: nil, page_token: nil, query: nil) - # Pass arguments to `search_folders` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param page_size [::Integer] - # Optional. The maximum number of folders to return in the response. The - # server can return fewer folders than requested. If unspecified, server - # picks an appropriate default. - # @param page_token [::String] - # Optional. A pagination token returned from a previous call to - # `SearchFolders` that indicates from where search should continue. - # @param query [::String] - # Optional. Search criteria used to select the folders to return. - # If no search criteria is specified then all accessible folders will be - # returned. - # - # Query expressions can be used to restrict results based upon displayName, - # state and parent, where the operators `=` (`:`) `NOT`, `AND` and `OR` - # can be used along with the suffix wildcard symbol `*`. - # - # The `displayName` field in a query expression should use escaped quotes - # for values that include whitespace to prevent unexpected behavior. - # - # ``` - # | Field | Description | - # |-------------------------|----------------------------------------| - # | displayName | Filters by displayName. | - # | parent | Filters by parent (for example: folders/123). | - # | state, lifecycleState | Filters by state. | - # ``` - # - # Some example queries are: - # - # * Query `displayName=Test*` returns Folder resources whose display name - # starts with "Test". - # * Query `state=ACTIVE` returns Folder resources with - # `state` set to `ACTIVE`. - # * Query `parent=folders/123` returns Folder resources that have - # `folders/123` as a parent resource. - # * Query `parent=folders/123 AND state=ACTIVE` returns active - # Folder resources that have `folders/123` as a parent resource. - # * Query `displayName=\\"Test String\\"` returns Folder resources with - # display names that include both "Test" and "String". - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Gapic::PagedEnumerable<::Google::Cloud::ResourceManager::V3::Folder>] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Gapic::PagedEnumerable<::Google::Cloud::ResourceManager::V3::Folder>] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/cloud/resource_manager/v3" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::ResourceManager::V3::Folders::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::ResourceManager::V3::SearchFoldersRequest.new - # - # # Call the search_folders method. - # result = client.search_folders request - # - # # The returned object is of type Gapic::PagedEnumerable. You can iterate - # # over elements, and API calls will be issued to fetch pages as needed. - # result.each do |item| - # # Each element is of type ::Google::Cloud::ResourceManager::V3::Folder. - # p item - # end - # - def search_folders request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::ResourceManager::V3::SearchFoldersRequest - - # Converts hash 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_folders.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::ResourceManager::V3::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.search_folders.timeout, - metadata: metadata, - retry_policy: @config.rpcs.search_folders.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @folders_stub.call_rpc :search_folders, request, options: options do |response, operation| - response = ::Gapic::PagedEnumerable.new @folders_stub, :search_folders, request, response, operation, options - yield response, operation if block_given? - throw :response, response - end - rescue ::GRPC::BadStatus => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Creates a folder in the resource hierarchy. - # Returns an `Operation` which can be used to track the progress of the - # folder creation workflow. - # Upon success, the `Operation.response` field will be populated with the - # created Folder. - # - # In order to succeed, the addition of this new folder must not violate - # the folder naming, height, or fanout constraints. - # - # + The folder's `display_name` must be distinct from all other folders that - # share its parent. - # + The addition of the folder must not cause the active folder hierarchy - # to exceed a height of 10. Note, the full active + deleted folder hierarchy - # is allowed to reach a height of 20; this provides additional headroom when - # moving folders that contain deleted folders. - # + The addition of the folder must not cause the total number of folders - # under its parent to exceed 300. - # - # If the operation fails due to a folder constraint violation, some errors - # may be returned by the `CreateFolder` request, with status code - # `FAILED_PRECONDITION` and an error description. Other folder constraint - # violations will be communicated in the `Operation`, with the specific - # `PreconditionFailure` returned in the details list in the `Operation.error` - # field. - # - # The caller must have `resourcemanager.folders.create` permission on the - # identified parent. - # - # @overload create_folder(request, options = nil) - # Pass arguments to `create_folder` via a request object, either of type - # {::Google::Cloud::ResourceManager::V3::CreateFolderRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::ResourceManager::V3::CreateFolderRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. - # - # @overload create_folder(folder: nil) - # Pass arguments to `create_folder` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param folder [::Google::Cloud::ResourceManager::V3::Folder, ::Hash] - # Required. The folder being created, only the display name and parent will - # be consulted. All other fields will be ignored. - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Gapic::Operation] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Gapic::Operation] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/cloud/resource_manager/v3" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::ResourceManager::V3::Folders::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::ResourceManager::V3::CreateFolderRequest.new - # - # # Call the create_folder method. - # result = client.create_folder request - # - # # The returned object is of type Gapic::Operation. You can use it to - # # check the status of an operation, cancel it, or wait for results. - # # Here is how to wait for a response. - # result.wait_until_done! timeout: 60 - # if result.response? - # p result.response - # else - # puts "No response received." - # end - # - def create_folder request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::ResourceManager::V3::CreateFolderRequest - - # Converts hash and nil to an options object - options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h - - # Customize the options with defaults - metadata = @config.rpcs.create_folder.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::ResourceManager::V3::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.create_folder.timeout, - metadata: metadata, - retry_policy: @config.rpcs.create_folder.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @folders_stub.call_rpc :create_folder, request, options: options do |response, operation| - response = ::Gapic::Operation.new response, @operations_client, options: options - yield response, operation if block_given? - throw :response, response - end - rescue ::GRPC::BadStatus => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Updates a folder, changing its `display_name`. - # Changes to the folder `display_name` will be rejected if they violate - # either the `display_name` formatting rules or the naming constraints - # described in the - # {::Google::Cloud::ResourceManager::V3::Folders::Client#create_folder CreateFolder} - # documentation. - # - # The folder's `display_name` must start and end with a letter or digit, - # may contain letters, digits, spaces, hyphens and underscores and can be - # between 3 and 30 characters. This is captured by the regular expression: - # `[\p{L}\p{N}][\p{L}\p{N}_- ]{1,28}[\p{L}\p{N}]`. - # The caller must have `resourcemanager.folders.update` permission on the - # identified folder. - # - # If the update fails due to the unique name constraint then a - # `PreconditionFailure` explaining this violation will be returned - # in the Status.details field. - # - # @overload update_folder(request, options = nil) - # Pass arguments to `update_folder` via a request object, either of type - # {::Google::Cloud::ResourceManager::V3::UpdateFolderRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::ResourceManager::V3::UpdateFolderRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. - # - # @overload update_folder(folder: nil, update_mask: nil) - # Pass arguments to `update_folder` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param folder [::Google::Cloud::ResourceManager::V3::Folder, ::Hash] - # Required. The new definition of the Folder. It must include the `name` - # field, which cannot be changed. - # @param update_mask [::Google::Protobuf::FieldMask, ::Hash] - # Required. Fields to be updated. - # Only the `display_name` can be updated. - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Gapic::Operation] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Gapic::Operation] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/cloud/resource_manager/v3" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::ResourceManager::V3::Folders::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::ResourceManager::V3::UpdateFolderRequest.new - # - # # Call the update_folder method. - # result = client.update_folder request - # - # # The returned object is of type Gapic::Operation. You can use it to - # # check the status of an operation, cancel it, or wait for results. - # # Here is how to wait for a response. - # result.wait_until_done! timeout: 60 - # if result.response? - # p result.response - # else - # puts "No response received." - # end - # - def update_folder request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::ResourceManager::V3::UpdateFolderRequest - - # Converts hash and nil to an options object - options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h - - # Customize the options with defaults - metadata = @config.rpcs.update_folder.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::ResourceManager::V3::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.folder&.name - header_params["folder.name"] = request.folder.name - end - - request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") - metadata[:"x-goog-request-params"] ||= request_params_header - - options.apply_defaults timeout: @config.rpcs.update_folder.timeout, - metadata: metadata, - retry_policy: @config.rpcs.update_folder.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @folders_stub.call_rpc :update_folder, request, options: options do |response, operation| - response = ::Gapic::Operation.new response, @operations_client, options: options - yield response, operation if block_given? - throw :response, response - end - rescue ::GRPC::BadStatus => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Moves a folder under a new resource parent. - # Returns an `Operation` which can be used to track the progress of the - # folder move workflow. - # Upon success, the `Operation.response` field will be populated with the - # moved folder. - # Upon failure, a `FolderOperationError` categorizing the failure cause will - # be returned - if the failure occurs synchronously then the - # `FolderOperationError` will be returned in the `Status.details` field. - # If it occurs asynchronously, then the FolderOperation will be returned - # in the `Operation.error` field. - # In addition, the `Operation.metadata` field will be populated with a - # `FolderOperation` message as an aid to stateless clients. - # Folder moves will be rejected if they violate either the naming, height, - # or fanout constraints described in the - # {::Google::Cloud::ResourceManager::V3::Folders::Client#create_folder CreateFolder} - # documentation. The caller must have `resourcemanager.folders.move` - # permission on the folder's current and proposed new parent. - # - # @overload move_folder(request, options = nil) - # Pass arguments to `move_folder` via a request object, either of type - # {::Google::Cloud::ResourceManager::V3::MoveFolderRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::ResourceManager::V3::MoveFolderRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. - # - # @overload move_folder(name: nil, destination_parent: nil) - # Pass arguments to `move_folder` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param name [::String] - # Required. The resource name of the Folder to move. - # Must be of the form folders/\\{folder_id} - # @param destination_parent [::String] - # Required. The resource name of the folder or organization which should be - # the folder's new parent. Must be of the form `folders/{folder_id}` or - # `organizations/{org_id}`. - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Gapic::Operation] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Gapic::Operation] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/cloud/resource_manager/v3" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::ResourceManager::V3::Folders::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::ResourceManager::V3::MoveFolderRequest.new - # - # # Call the move_folder method. - # result = client.move_folder request - # - # # The returned object is of type Gapic::Operation. You can use it to - # # check the status of an operation, cancel it, or wait for results. - # # Here is how to wait for a response. - # result.wait_until_done! timeout: 60 - # if result.response? - # p result.response - # else - # puts "No response received." - # end - # - def move_folder request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::ResourceManager::V3::MoveFolderRequest - - # Converts hash 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.move_folder.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::ResourceManager::V3::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.move_folder.timeout, - metadata: metadata, - retry_policy: @config.rpcs.move_folder.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @folders_stub.call_rpc :move_folder, request, options: options do |response, operation| - response = ::Gapic::Operation.new response, @operations_client, options: options - yield response, operation if block_given? - throw :response, response - end - rescue ::GRPC::BadStatus => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Requests deletion of a folder. The folder is moved into the - # {::Google::Cloud::ResourceManager::V3::Folder::State::DELETE_REQUESTED DELETE_REQUESTED} - # state immediately, and is deleted approximately 30 days later. This method - # may only be called on an empty folder, where a folder is empty if it - # doesn't contain any folders or projects in the - # {::Google::Cloud::ResourceManager::V3::Folder::State::ACTIVE ACTIVE} state. If - # called on a folder in - # {::Google::Cloud::ResourceManager::V3::Folder::State::DELETE_REQUESTED DELETE_REQUESTED} - # state the operation will result in a no-op success. - # The caller must have `resourcemanager.folders.delete` permission on the - # identified folder. - # - # @overload delete_folder(request, options = nil) - # Pass arguments to `delete_folder` via a request object, either of type - # {::Google::Cloud::ResourceManager::V3::DeleteFolderRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::ResourceManager::V3::DeleteFolderRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. - # - # @overload delete_folder(name: nil) - # Pass arguments to `delete_folder` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param name [::String] - # Required. The resource name of the folder to be deleted. - # Must be of the form `folders/{folder_id}`. - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Gapic::Operation] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Gapic::Operation] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/cloud/resource_manager/v3" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::ResourceManager::V3::Folders::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::ResourceManager::V3::DeleteFolderRequest.new - # - # # Call the delete_folder method. - # result = client.delete_folder request - # - # # The returned object is of type Gapic::Operation. You can use it to - # # check the status of an operation, cancel it, or wait for results. - # # Here is how to wait for a response. - # result.wait_until_done! timeout: 60 - # if result.response? - # p result.response - # else - # puts "No response received." - # end - # - def delete_folder request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::ResourceManager::V3::DeleteFolderRequest - - # Converts hash and nil to an options object - options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h - - # Customize the options with defaults - metadata = @config.rpcs.delete_folder.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::ResourceManager::V3::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_folder.timeout, - metadata: metadata, - retry_policy: @config.rpcs.delete_folder.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @folders_stub.call_rpc :delete_folder, request, options: options do |response, operation| - response = ::Gapic::Operation.new response, @operations_client, options: options - yield response, operation if block_given? - throw :response, response - end - rescue ::GRPC::BadStatus => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Cancels the deletion request for a folder. This method may be called on a - # folder in any state. If the folder is in the - # {::Google::Cloud::ResourceManager::V3::Folder::State::ACTIVE ACTIVE} state the - # result will be a no-op success. In order to succeed, the folder's parent - # must be in the - # {::Google::Cloud::ResourceManager::V3::Folder::State::ACTIVE ACTIVE} state. In - # addition, reintroducing the folder into the tree must not violate folder - # naming, height, and fanout constraints described in the - # {::Google::Cloud::ResourceManager::V3::Folders::Client#create_folder CreateFolder} - # documentation. The caller must have `resourcemanager.folders.undelete` - # permission on the identified folder. - # - # @overload undelete_folder(request, options = nil) - # Pass arguments to `undelete_folder` via a request object, either of type - # {::Google::Cloud::ResourceManager::V3::UndeleteFolderRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::ResourceManager::V3::UndeleteFolderRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. - # - # @overload undelete_folder(name: nil) - # Pass arguments to `undelete_folder` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param name [::String] - # Required. The resource name of the folder to undelete. - # Must be of the form `folders/{folder_id}`. - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Gapic::Operation] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Gapic::Operation] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/cloud/resource_manager/v3" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::ResourceManager::V3::Folders::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::ResourceManager::V3::UndeleteFolderRequest.new - # - # # Call the undelete_folder method. - # result = client.undelete_folder request - # - # # The returned object is of type Gapic::Operation. You can use it to - # # check the status of an operation, cancel it, or wait for results. - # # Here is how to wait for a response. - # result.wait_until_done! timeout: 60 - # if result.response? - # p result.response - # else - # puts "No response received." - # end - # - def undelete_folder request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::ResourceManager::V3::UndeleteFolderRequest - - # Converts hash 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.undelete_folder.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::ResourceManager::V3::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.undelete_folder.timeout, - metadata: metadata, - retry_policy: @config.rpcs.undelete_folder.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @folders_stub.call_rpc :undelete_folder, request, options: options do |response, operation| - response = ::Gapic::Operation.new response, @operations_client, options: options - yield response, operation if block_given? - throw :response, response - end - rescue ::GRPC::BadStatus => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Gets the access control policy for a folder. The returned policy may be - # empty if no such policy or resource exists. The `resource` field should - # be the folder's resource name, for example: "folders/1234". - # The caller must have `resourcemanager.folders.getIamPolicy` permission - # on the identified folder. - # - # @overload get_iam_policy(request, options = nil) - # Pass arguments to `get_iam_policy` via a request object, either of type - # {::Google::Iam::V1::GetIamPolicyRequest} or an equivalent Hash. - # - # @param request [::Google::Iam::V1::GetIamPolicyRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. - # - # @overload get_iam_policy(resource: nil, options: nil) - # Pass arguments to `get_iam_policy` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param resource [::String] - # REQUIRED: The resource for which the policy is being requested. - # See the operation documentation for the appropriate value for this field. - # @param options [::Google::Iam::V1::GetPolicyOptions, ::Hash] - # OPTIONAL: A `GetPolicyOptions` object for specifying options to - # `GetIamPolicy`. - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Google::Iam::V1::Policy] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Google::Iam::V1::Policy] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/cloud/resource_manager/v3" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::ResourceManager::V3::Folders::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Iam::V1::GetIamPolicyRequest.new - # - # # Call the get_iam_policy method. - # result = client.get_iam_policy request - # - # # The returned object is of type Google::Iam::V1::Policy. - # p result - # - def get_iam_policy request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Iam::V1::GetIamPolicyRequest - - # Converts hash and nil to an options object - options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h - - # Customize the options with defaults - metadata = @config.rpcs.get_iam_policy.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::ResourceManager::V3::VERSION - metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - header_params = {} - if request.resource - header_params["resource"] = request.resource - end - - request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") - metadata[:"x-goog-request-params"] ||= request_params_header - - options.apply_defaults timeout: @config.rpcs.get_iam_policy.timeout, - metadata: metadata, - retry_policy: @config.rpcs.get_iam_policy.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @folders_stub.call_rpc :get_iam_policy, request, options: options do |response, operation| - yield response, operation if block_given? - end - rescue ::GRPC::BadStatus => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Sets the access control policy on a folder, replacing any existing policy. - # The `resource` field should be the folder's resource name, for example: - # "folders/1234". - # The caller must have `resourcemanager.folders.setIamPolicy` permission - # on the identified folder. - # - # @overload set_iam_policy(request, options = nil) - # Pass arguments to `set_iam_policy` via a request object, either of type - # {::Google::Iam::V1::SetIamPolicyRequest} or an equivalent Hash. - # - # @param request [::Google::Iam::V1::SetIamPolicyRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. - # - # @overload set_iam_policy(resource: nil, policy: nil, update_mask: nil) - # Pass arguments to `set_iam_policy` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param resource [::String] - # REQUIRED: The resource for which the policy is being specified. - # See the operation documentation for the appropriate value for this field. - # @param policy [::Google::Iam::V1::Policy, ::Hash] - # REQUIRED: The complete policy to be applied to the `resource`. The size of - # the policy is limited to a few 10s of KB. An empty policy is a - # valid policy but certain Cloud Platform services (such as Projects) - # might reject them. - # @param update_mask [::Google::Protobuf::FieldMask, ::Hash] - # OPTIONAL: A FieldMask specifying which fields of the policy to modify. Only - # the fields in the mask will be modified. If no mask is provided, the - # following default mask is used: - # - # `paths: "bindings, etag"` - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Google::Iam::V1::Policy] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Google::Iam::V1::Policy] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/cloud/resource_manager/v3" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::ResourceManager::V3::Folders::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Iam::V1::SetIamPolicyRequest.new - # - # # Call the set_iam_policy method. - # result = client.set_iam_policy request - # - # # The returned object is of type Google::Iam::V1::Policy. - # p result - # - def set_iam_policy request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Iam::V1::SetIamPolicyRequest - - # Converts hash and nil to an options object - options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h - - # Customize the options with defaults - metadata = @config.rpcs.set_iam_policy.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::ResourceManager::V3::VERSION - metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - header_params = {} - if request.resource - header_params["resource"] = request.resource - end - - request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") - metadata[:"x-goog-request-params"] ||= request_params_header - - options.apply_defaults timeout: @config.rpcs.set_iam_policy.timeout, - metadata: metadata, - retry_policy: @config.rpcs.set_iam_policy.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @folders_stub.call_rpc :set_iam_policy, request, options: options do |response, operation| - yield response, operation if block_given? - end - rescue ::GRPC::BadStatus => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Returns permissions that a caller has on the specified folder. - # The `resource` field should be the folder's resource name, - # for example: "folders/1234". - # - # There are no permissions required for making this API call. - # - # @overload test_iam_permissions(request, options = nil) - # Pass arguments to `test_iam_permissions` via a request object, either of type - # {::Google::Iam::V1::TestIamPermissionsRequest} or an equivalent Hash. - # - # @param request [::Google::Iam::V1::TestIamPermissionsRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. - # - # @overload test_iam_permissions(resource: nil, permissions: nil) - # Pass arguments to `test_iam_permissions` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param resource [::String] - # REQUIRED: The resource for which the policy detail is being requested. - # See the operation documentation for the appropriate value for this field. - # @param permissions [::Array<::String>] - # The set of permissions to check for the `resource`. Permissions with - # wildcards (such as '*' or 'storage.*') are not allowed. For more - # information see - # [IAM Overview](https://cloud.google.com/iam/docs/overview#permissions). - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Google::Iam::V1::TestIamPermissionsResponse] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Google::Iam::V1::TestIamPermissionsResponse] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/cloud/resource_manager/v3" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::ResourceManager::V3::Folders::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Iam::V1::TestIamPermissionsRequest.new - # - # # Call the test_iam_permissions method. - # result = client.test_iam_permissions request - # - # # The returned object is of type Google::Iam::V1::TestIamPermissionsResponse. - # p result - # - def test_iam_permissions request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Iam::V1::TestIamPermissionsRequest - - # Converts hash and nil to an options object - options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h - - # Customize the options with defaults - metadata = @config.rpcs.test_iam_permissions.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::ResourceManager::V3::VERSION - metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - header_params = {} - if request.resource - header_params["resource"] = request.resource - end - - request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") - metadata[:"x-goog-request-params"] ||= request_params_header - - options.apply_defaults timeout: @config.rpcs.test_iam_permissions.timeout, - metadata: metadata, - retry_policy: @config.rpcs.test_iam_permissions.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @folders_stub.call_rpc :test_iam_permissions, request, options: options do |response, operation| - yield response, operation if block_given? - end - rescue ::GRPC::BadStatus => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Configuration class for the Folders API. - # - # This class represents the configuration for Folders, - # providing control over timeouts, retry behavior, logging, transport - # parameters, and other low-level controls. Certain parameters can also be - # applied individually to specific RPCs. See - # {::Google::Cloud::ResourceManager::V3::Folders::Client::Configuration::Rpcs} - # for a list of RPCs that can be configured independently. - # - # Configuration can be applied globally to all clients, or to a single client - # on construction. - # - # @example - # - # # Modify the global config, setting the timeout for - # # get_folder to 20 seconds, - # # and all remaining timeouts to 10 seconds. - # ::Google::Cloud::ResourceManager::V3::Folders::Client.configure do |config| - # config.timeout = 10.0 - # config.rpcs.get_folder.timeout = 20.0 - # end - # - # # Apply the above configuration only to a new client. - # client = ::Google::Cloud::ResourceManager::V3::Folders::Client.new do |config| - # config.timeout = 10.0 - # config.rpcs.get_folder.timeout = 20.0 - # end - # - # @!attribute [rw] endpoint - # A custom service endpoint, as a hostname or hostname:port. The default is - # nil, indicating to use the default endpoint in the current universe domain. - # @return [::String,nil] - # @!attribute [rw] credentials - # Credentials to send with calls. You may provide any of the following types: - # * (`Google::Auth::Credentials`) A googleauth credentials object - # (see the [googleauth docs](https://rubydoc.info/gems/googleauth/Google/Auth/Credentials)) - # * (`Signet::OAuth2::Client`) A signet oauth2 client object - # (see the [signet docs](https://rubydoc.info/gems/signet/Signet/OAuth2/Client)) - # * (`GRPC::Core::Channel`) a gRPC channel with included credentials - # * (`GRPC::Core::ChannelCredentials`) a gRPC credentails object - # * (`nil`) indicating no credentials - # - # @note Warning: Passing a `String` to a keyfile path or a `Hash` of credentials - # is deprecated. Providing an unvalidated credential configuration to - # Google APIs can compromise the security of your systems and data. - # - # @example - # - # # The recommended way to provide credentials is to use the `make_creds` method - # # on the appropriate credentials class for your environment. - # - # require "googleauth" - # - # credentials = ::Google::Auth::ServiceAccountCredentials.make_creds( - # json_key_io: ::File.open("/path/to/keyfile.json") - # ) - # - # client = ::Google::Cloud::ResourceManager::V3::Folders::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 = "cloudresourcemanager.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 Folders 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 `get_folder` - # @return [::Gapic::Config::Method] - # - attr_reader :get_folder - ## - # RPC-specific configuration for `list_folders` - # @return [::Gapic::Config::Method] - # - attr_reader :list_folders - ## - # RPC-specific configuration for `search_folders` - # @return [::Gapic::Config::Method] - # - attr_reader :search_folders - ## - # RPC-specific configuration for `create_folder` - # @return [::Gapic::Config::Method] - # - attr_reader :create_folder - ## - # RPC-specific configuration for `update_folder` - # @return [::Gapic::Config::Method] - # - attr_reader :update_folder - ## - # RPC-specific configuration for `move_folder` - # @return [::Gapic::Config::Method] - # - attr_reader :move_folder - ## - # RPC-specific configuration for `delete_folder` - # @return [::Gapic::Config::Method] - # - attr_reader :delete_folder - ## - # RPC-specific configuration for `undelete_folder` - # @return [::Gapic::Config::Method] - # - attr_reader :undelete_folder - ## - # RPC-specific configuration for `get_iam_policy` - # @return [::Gapic::Config::Method] - # - attr_reader :get_iam_policy - ## - # RPC-specific configuration for `set_iam_policy` - # @return [::Gapic::Config::Method] - # - attr_reader :set_iam_policy - ## - # RPC-specific configuration for `test_iam_permissions` - # @return [::Gapic::Config::Method] - # - attr_reader :test_iam_permissions - - # @private - def initialize parent_rpcs = nil - get_folder_config = parent_rpcs.get_folder if parent_rpcs.respond_to? :get_folder - @get_folder = ::Gapic::Config::Method.new get_folder_config - list_folders_config = parent_rpcs.list_folders if parent_rpcs.respond_to? :list_folders - @list_folders = ::Gapic::Config::Method.new list_folders_config - search_folders_config = parent_rpcs.search_folders if parent_rpcs.respond_to? :search_folders - @search_folders = ::Gapic::Config::Method.new search_folders_config - create_folder_config = parent_rpcs.create_folder if parent_rpcs.respond_to? :create_folder - @create_folder = ::Gapic::Config::Method.new create_folder_config - update_folder_config = parent_rpcs.update_folder if parent_rpcs.respond_to? :update_folder - @update_folder = ::Gapic::Config::Method.new update_folder_config - move_folder_config = parent_rpcs.move_folder if parent_rpcs.respond_to? :move_folder - @move_folder = ::Gapic::Config::Method.new move_folder_config - delete_folder_config = parent_rpcs.delete_folder if parent_rpcs.respond_to? :delete_folder - @delete_folder = ::Gapic::Config::Method.new delete_folder_config - undelete_folder_config = parent_rpcs.undelete_folder if parent_rpcs.respond_to? :undelete_folder - @undelete_folder = ::Gapic::Config::Method.new undelete_folder_config - get_iam_policy_config = parent_rpcs.get_iam_policy if parent_rpcs.respond_to? :get_iam_policy - @get_iam_policy = ::Gapic::Config::Method.new get_iam_policy_config - set_iam_policy_config = parent_rpcs.set_iam_policy if parent_rpcs.respond_to? :set_iam_policy - @set_iam_policy = ::Gapic::Config::Method.new set_iam_policy_config - test_iam_permissions_config = parent_rpcs.test_iam_permissions if parent_rpcs.respond_to? :test_iam_permissions - @test_iam_permissions = ::Gapic::Config::Method.new test_iam_permissions_config - - yield self if block_given? - end - end - end - end - end - end - end - end -end diff --git a/owl-bot-staging/google-cloud-resource_manager-v3/lib/google/cloud/resource_manager/v3/folders/credentials.rb b/owl-bot-staging/google-cloud-resource_manager-v3/lib/google/cloud/resource_manager/v3/folders/credentials.rb deleted file mode 100644 index 93719366c1f6..000000000000 --- a/owl-bot-staging/google-cloud-resource_manager-v3/lib/google/cloud/resource_manager/v3/folders/credentials.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 "googleauth" - -module Google - module Cloud - module ResourceManager - module V3 - module Folders - # Credentials for the Folders API. - class Credentials < ::Google::Auth::Credentials - self.scope = [ - "https://www.googleapis.com/auth/cloud-platform", - "https://www.googleapis.com/auth/cloud-platform.read-only" - ] - self.env_vars = [ - "RESOURCE_MANAGER_CREDENTIALS", - "RESOURCE_MANAGER_KEYFILE", - "GOOGLE_CLOUD_CREDENTIALS", - "GOOGLE_CLOUD_KEYFILE", - "GCLOUD_KEYFILE", - "RESOURCE_MANAGER_CREDENTIALS_JSON", - "RESOURCE_MANAGER_KEYFILE_JSON", - "GOOGLE_CLOUD_CREDENTIALS_JSON", - "GOOGLE_CLOUD_KEYFILE_JSON", - "GCLOUD_KEYFILE_JSON" - ] - self.paths = [ - "~/.config/google_cloud/application_default_credentials.json" - ] - end - end - end - end - end -end diff --git a/owl-bot-staging/google-cloud-resource_manager-v3/lib/google/cloud/resource_manager/v3/folders/operations.rb b/owl-bot-staging/google-cloud-resource_manager-v3/lib/google/cloud/resource_manager/v3/folders/operations.rb deleted file mode 100644 index 3fb94354db23..000000000000 --- a/owl-bot-staging/google-cloud-resource_manager-v3/lib/google/cloud/resource_manager/v3/folders/operations.rb +++ /dev/null @@ -1,841 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -require "gapic/operation" -require "google/longrunning/operations_pb" - -module Google - module Cloud - module ResourceManager - module V3 - module Folders - # Service that implements Longrunning Operations API. - class Operations - # @private - API_VERSION = "" - - # @private - DEFAULT_ENDPOINT_TEMPLATE = "cloudresourcemanager.$UNIVERSE_DOMAIN$" - - # @private - attr_reader :operations_stub - - ## - # Configuration for the Folders 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 Folders 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::ResourceManager::V3::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::ResourceManager::V3::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::ResourceManager::V3::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::ResourceManager::V3::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::ResourceManager::V3::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 = "cloudresourcemanager.googleapis.com" - - config_attr :endpoint, nil, ::String, nil - config_attr :credentials, nil do |value| - allowed = [::String, ::Hash, ::Proc, ::Symbol, ::Google::Auth::Credentials, ::Google::Auth::BaseClient, ::Signet::OAuth2::Client, nil] - allowed += [::GRPC::Core::Channel, ::GRPC::Core::ChannelCredentials] if defined? ::GRPC::Core::Channel - allowed.any? { |klass| klass === value } - end - config_attr :scope, nil, ::String, ::Array, nil - config_attr :lib_name, nil, ::String, nil - config_attr :lib_version, nil, ::String, nil - config_attr(:channel_args, { "grpc.service_config_disable_resolution" => 1 }, ::Hash, nil) - config_attr :interceptors, nil, ::Array, nil - config_attr :timeout, nil, ::Numeric, nil - config_attr :metadata, nil, ::Hash, nil - config_attr :retry_policy, nil, ::Hash, ::Proc, nil - config_attr :quota_project, nil, ::String, nil - config_attr :universe_domain, nil, ::String, nil - config_attr :logger, :default, ::Logger, nil, :default - - # @private - def initialize parent_config = nil - @parent_config = parent_config unless parent_config.nil? - - yield self if block_given? - end - - ## - # Configurations for individual RPCs - # @return [Rpcs] - # - def rpcs - @rpcs ||= begin - parent_rpcs = nil - parent_rpcs = @parent_config.rpcs if defined?(@parent_config) && @parent_config.respond_to?(:rpcs) - Rpcs.new parent_rpcs - end - end - - ## - # Configuration for the channel pool - # @return [::Gapic::ServiceStub::ChannelPool::Configuration] - # - def channel_pool - @channel_pool ||= ::Gapic::ServiceStub::ChannelPool::Configuration.new - end - - ## - # Configuration RPC class for the Operations API. - # - # Includes fields providing the configuration for each RPC in this service. - # Each configuration object is of type `Gapic::Config::Method` and includes - # the following configuration fields: - # - # * `timeout` (*type:* `Numeric`) - The call timeout in seconds - # * `metadata` (*type:* `Hash{Symbol=>String}`) - Additional gRPC headers - # * `retry_policy (*type:* `Hash`) - The retry policy. The policy fields - # include the following keys: - # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds. - # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds. - # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier. - # * `:retry_codes` (*type:* `Array`) - The error codes that should - # trigger a retry. - # - class Rpcs - ## - # RPC-specific configuration for `list_operations` - # @return [::Gapic::Config::Method] - # - attr_reader :list_operations - ## - # RPC-specific configuration for `get_operation` - # @return [::Gapic::Config::Method] - # - attr_reader :get_operation - ## - # RPC-specific configuration for `delete_operation` - # @return [::Gapic::Config::Method] - # - attr_reader :delete_operation - ## - # RPC-specific configuration for `cancel_operation` - # @return [::Gapic::Config::Method] - # - attr_reader :cancel_operation - ## - # RPC-specific configuration for `wait_operation` - # @return [::Gapic::Config::Method] - # - attr_reader :wait_operation - - # @private - def initialize parent_rpcs = nil - list_operations_config = parent_rpcs.list_operations if parent_rpcs.respond_to? :list_operations - @list_operations = ::Gapic::Config::Method.new list_operations_config - get_operation_config = parent_rpcs.get_operation if parent_rpcs.respond_to? :get_operation - @get_operation = ::Gapic::Config::Method.new get_operation_config - delete_operation_config = parent_rpcs.delete_operation if parent_rpcs.respond_to? :delete_operation - @delete_operation = ::Gapic::Config::Method.new delete_operation_config - cancel_operation_config = parent_rpcs.cancel_operation if parent_rpcs.respond_to? :cancel_operation - @cancel_operation = ::Gapic::Config::Method.new cancel_operation_config - wait_operation_config = parent_rpcs.wait_operation if parent_rpcs.respond_to? :wait_operation - @wait_operation = ::Gapic::Config::Method.new wait_operation_config - - yield self if block_given? - end - end - end - end - end - end - end - end -end diff --git a/owl-bot-staging/google-cloud-resource_manager-v3/lib/google/cloud/resource_manager/v3/folders/paths.rb b/owl-bot-staging/google-cloud-resource_manager-v3/lib/google/cloud/resource_manager/v3/folders/paths.rb deleted file mode 100644 index 30d27ba77546..000000000000 --- a/owl-bot-staging/google-cloud-resource_manager-v3/lib/google/cloud/resource_manager/v3/folders/paths.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! - - -module Google - module Cloud - module ResourceManager - module V3 - module Folders - # Path helper methods for the Folders API. - module Paths - ## - # Create a fully-qualified Folder resource string. - # - # The resource will be in the following format: - # - # `folders/{folder}` - # - # @param folder [String] - # - # @return [::String] - def folder_path folder: - "folders/#{folder}" - end - - extend self - end - end - end - end - end -end diff --git a/owl-bot-staging/google-cloud-resource_manager-v3/lib/google/cloud/resource_manager/v3/folders/rest.rb b/owl-bot-staging/google-cloud-resource_manager-v3/lib/google/cloud/resource_manager/v3/folders/rest.rb deleted file mode 100644 index c7eec82bdb15..000000000000 --- a/owl-bot-staging/google-cloud-resource_manager-v3/lib/google/cloud/resource_manager/v3/folders/rest.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/rest" -require "gapic/config" -require "gapic/config/method" - -require "google/cloud/resource_manager/v3/version" - -require "google/cloud/resource_manager/v3/folders/credentials" -require "google/cloud/resource_manager/v3/folders/paths" -require "google/cloud/resource_manager/v3/folders/rest/operations" -require "google/cloud/resource_manager/v3/folders/rest/client" - -module Google - module Cloud - module ResourceManager - module V3 - ## - # Manages Cloud Platform folder resources. - # Folders can be used to organize the resources under an - # organization and to control the policies applied to groups of resources. - # - # To load this service and instantiate a REST client: - # - # require "google/cloud/resource_manager/v3/folders/rest" - # client = ::Google::Cloud::ResourceManager::V3::Folders::Rest::Client.new - # - module Folders - # Client for the REST transport - module Rest - end - end - end - end - end -end - -helper_path = ::File.join __dir__, "rest", "helpers.rb" -require "google/cloud/resource_manager/v3/folders/rest/helpers" if ::File.file? helper_path diff --git a/owl-bot-staging/google-cloud-resource_manager-v3/lib/google/cloud/resource_manager/v3/folders/rest/client.rb b/owl-bot-staging/google-cloud-resource_manager-v3/lib/google/cloud/resource_manager/v3/folders/rest/client.rb deleted file mode 100644 index cadfcf7d1a79..000000000000 --- a/owl-bot-staging/google-cloud-resource_manager-v3/lib/google/cloud/resource_manager/v3/folders/rest/client.rb +++ /dev/null @@ -1,1572 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -require "google/cloud/errors" -require "google/cloud/resourcemanager/v3/folders_pb" -require "google/cloud/resource_manager/v3/folders/rest/service_stub" - -module Google - module Cloud - module ResourceManager - module V3 - module Folders - module Rest - ## - # REST client for the Folders service. - # - # Manages Cloud Platform folder resources. - # Folders can be used to organize the resources under an - # organization and to control the policies applied to groups of resources. - # - class Client - # @private - API_VERSION = "" - - # @private - DEFAULT_ENDPOINT_TEMPLATE = "cloudresourcemanager.$UNIVERSE_DOMAIN$" - - include Paths - - # @private - attr_reader :folders_stub - - ## - # Configure the Folders Client class. - # - # See {::Google::Cloud::ResourceManager::V3::Folders::Rest::Client::Configuration} - # for a description of the configuration fields. - # - # @example - # - # # Modify the configuration for all Folders clients - # ::Google::Cloud::ResourceManager::V3::Folders::Rest::Client.configure do |config| - # config.timeout = 10.0 - # end - # - # @yield [config] Configure the Client client. - # @yieldparam config [Client::Configuration] - # - # @return [Client::Configuration] - # - def self.configure - @configure ||= begin - namespace = ["Google", "Cloud", "ResourceManager", "V3"] - 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.get_folder.timeout = 60.0 - default_config.rpcs.get_folder.retry_policy = { - initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [14] - } - - default_config.rpcs.list_folders.timeout = 60.0 - default_config.rpcs.list_folders.retry_policy = { - initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [14] - } - - default_config.rpcs.search_folders.timeout = 60.0 - - default_config.rpcs.create_folder.timeout = 60.0 - - default_config.rpcs.update_folder.timeout = 60.0 - - default_config.rpcs.move_folder.timeout = 60.0 - - default_config.rpcs.delete_folder.timeout = 60.0 - - default_config.rpcs.undelete_folder.timeout = 60.0 - - default_config.rpcs.get_iam_policy.timeout = 60.0 - default_config.rpcs.get_iam_policy.retry_policy = { - initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [14] - } - - default_config.rpcs.set_iam_policy.timeout = 60.0 - - default_config - end - yield @configure if block_given? - @configure - end - - ## - # Configure the Folders Client instance. - # - # The configuration is set to the derived mode, meaning that values can be changed, - # but structural changes (adding new fields, etc.) are not allowed. Structural changes - # should be made on {Client.configure}. - # - # See {::Google::Cloud::ResourceManager::V3::Folders::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 - @folders_stub.universe_domain - end - - ## - # Create a new Folders REST client object. - # - # @example - # - # # Create a client using the default configuration - # client = ::Google::Cloud::ResourceManager::V3::Folders::Rest::Client.new - # - # # Create a client using a custom configuration - # client = ::Google::Cloud::ResourceManager::V3::Folders::Rest::Client.new do |config| - # config.timeout = 10.0 - # end - # - # @yield [config] Configure the Folders client. - # @yieldparam config [Client::Configuration] - # - def initialize - # Create the configuration object - @config = Configuration.new Client.configure - - # Yield the configuration if needed - yield @config if block_given? - - # Create credentials - credentials = @config.credentials - # Use self-signed JWT if the endpoint is unchanged from default, - # but only if the default endpoint does not have a region prefix. - enable_self_signed_jwt = @config.endpoint.nil? || - (@config.endpoint == Configuration::DEFAULT_ENDPOINT && - !@config.endpoint.split(".").first.include?("-")) - credentials ||= Credentials.default scope: @config.scope, - enable_self_signed_jwt: enable_self_signed_jwt - if credentials.is_a?(::String) || credentials.is_a?(::Hash) - credentials = Credentials.new credentials, scope: @config.scope - end - - @quota_project_id = @config.quota_project - @quota_project_id ||= credentials.quota_project_id if credentials.respond_to? :quota_project_id - - @operations_client = ::Google::Cloud::ResourceManager::V3::Folders::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 - - @folders_stub = ::Google::Cloud::ResourceManager::V3::Folders::Rest::ServiceStub.new( - endpoint: @config.endpoint, - endpoint_template: DEFAULT_ENDPOINT_TEMPLATE, - universe_domain: @config.universe_domain, - credentials: credentials, - logger: @config.logger - ) - - @folders_stub.logger(stub: true)&.info do |entry| - entry.set_system_name - entry.set_service - entry.message = "Created client for #{entry.service}" - entry.set_credentials_fields credentials - entry.set "customEndpoint", @config.endpoint if @config.endpoint - entry.set "defaultTimeout", @config.timeout if @config.timeout - entry.set "quotaProject", @quota_project_id if @quota_project_id - end - end - - ## - # Get the associated client for long-running operations. - # - # @return [::Google::Cloud::ResourceManager::V3::Folders::Rest::Operations] - # - attr_reader :operations_client - - ## - # The logger used for request/response debug logging. - # - # @return [Logger] - # - def logger - @folders_stub.logger - end - - # Service calls - - ## - # Retrieves a folder identified by the supplied resource name. - # Valid folder resource names have the format `folders/{folder_id}` - # (for example, `folders/1234`). - # The caller must have `resourcemanager.folders.get` permission on the - # identified folder. - # - # @overload get_folder(request, options = nil) - # Pass arguments to `get_folder` via a request object, either of type - # {::Google::Cloud::ResourceManager::V3::GetFolderRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::ResourceManager::V3::GetFolderRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @overload get_folder(name: nil) - # Pass arguments to `get_folder` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param name [::String] - # Required. The resource name of the folder to retrieve. - # Must be of the form `folders/{folder_id}`. - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Cloud::ResourceManager::V3::Folder] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::ResourceManager::V3::Folder] - # - # @raise [::Google::Cloud::Error] if the REST call is aborted. - # - # @example Basic example - # require "google/cloud/resource_manager/v3" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::ResourceManager::V3::Folders::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::ResourceManager::V3::GetFolderRequest.new - # - # # Call the get_folder method. - # result = client.get_folder request - # - # # The returned object is of type Google::Cloud::ResourceManager::V3::Folder. - # p result - # - def get_folder request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::ResourceManager::V3::GetFolderRequest - - # Converts hash and nil to an options object - options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h - - # Customize the options with defaults - call_metadata = @config.rpcs.get_folder.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::ResourceManager::V3::VERSION, - transports_version_send: [:rest] - - call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - options.apply_defaults timeout: @config.rpcs.get_folder.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.get_folder.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @folders_stub.get_folder request, options do |result, operation| - yield result, operation if block_given? - end - rescue ::Gapic::Rest::Error => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Lists the folders that are direct descendants of supplied parent resource. - # `list()` provides a strongly consistent view of the folders underneath - # the specified parent resource. - # `list()` returns folders sorted based upon the (ascending) lexical ordering - # of their display_name. - # The caller must have `resourcemanager.folders.list` permission on the - # identified parent. - # - # @overload list_folders(request, options = nil) - # Pass arguments to `list_folders` via a request object, either of type - # {::Google::Cloud::ResourceManager::V3::ListFoldersRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::ResourceManager::V3::ListFoldersRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @overload list_folders(parent: nil, page_size: nil, page_token: nil, show_deleted: nil) - # Pass arguments to `list_folders` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param parent [::String] - # Required. The name of the parent resource whose folders are being listed. - # Only children of this parent resource are listed; descendants are not - # listed. - # - # If the parent is a folder, use the value `folders/{folder_id}`. If the - # parent is an organization, use the value `organizations/{org_id}`. - # - # Access to this method is controlled by checking the - # `resourcemanager.folders.list` permission on the `parent`. - # @param page_size [::Integer] - # Optional. The maximum number of folders to return in the response. The - # server can return fewer folders than requested. If unspecified, server - # picks an appropriate default. - # @param page_token [::String] - # Optional. A pagination token returned from a previous call to `ListFolders` - # that indicates where this listing should continue from. - # @param show_deleted [::Boolean] - # Optional. Controls whether folders in the - # {::Google::Cloud::ResourceManager::V3::Folder::State::DELETE_REQUESTED DELETE_REQUESTED} - # state should be returned. Defaults to false. - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Gapic::Rest::PagedEnumerable<::Google::Cloud::ResourceManager::V3::Folder>] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Gapic::Rest::PagedEnumerable<::Google::Cloud::ResourceManager::V3::Folder>] - # - # @raise [::Google::Cloud::Error] if the REST call is aborted. - # - # @example Basic example - # require "google/cloud/resource_manager/v3" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::ResourceManager::V3::Folders::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::ResourceManager::V3::ListFoldersRequest.new - # - # # Call the list_folders method. - # result = client.list_folders request - # - # # The returned object is of type Gapic::PagedEnumerable. You can iterate - # # over elements, and API calls will be issued to fetch pages as needed. - # result.each do |item| - # # Each element is of type ::Google::Cloud::ResourceManager::V3::Folder. - # p item - # end - # - def list_folders request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::ResourceManager::V3::ListFoldersRequest - - # Converts hash and nil to an options object - options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h - - # Customize the options with defaults - call_metadata = @config.rpcs.list_folders.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::ResourceManager::V3::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_folders.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.list_folders.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @folders_stub.list_folders request, options do |result, operation| - result = ::Gapic::Rest::PagedEnumerable.new @folders_stub, :list_folders, "folders", 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 for folders that match specific filter criteria. - # `search()` provides an eventually consistent view of the folders a user has - # access to which meet the specified filter criteria. - # - # This will only return folders on which the caller has the - # permission `resourcemanager.folders.get`. - # - # @overload search_folders(request, options = nil) - # Pass arguments to `search_folders` via a request object, either of type - # {::Google::Cloud::ResourceManager::V3::SearchFoldersRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::ResourceManager::V3::SearchFoldersRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_folders(page_size: nil, page_token: nil, query: nil) - # Pass arguments to `search_folders` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param page_size [::Integer] - # Optional. The maximum number of folders to return in the response. The - # server can return fewer folders than requested. If unspecified, server - # picks an appropriate default. - # @param page_token [::String] - # Optional. A pagination token returned from a previous call to - # `SearchFolders` that indicates from where search should continue. - # @param query [::String] - # Optional. Search criteria used to select the folders to return. - # If no search criteria is specified then all accessible folders will be - # returned. - # - # Query expressions can be used to restrict results based upon displayName, - # state and parent, where the operators `=` (`:`) `NOT`, `AND` and `OR` - # can be used along with the suffix wildcard symbol `*`. - # - # The `displayName` field in a query expression should use escaped quotes - # for values that include whitespace to prevent unexpected behavior. - # - # ``` - # | Field | Description | - # |-------------------------|----------------------------------------| - # | displayName | Filters by displayName. | - # | parent | Filters by parent (for example: folders/123). | - # | state, lifecycleState | Filters by state. | - # ``` - # - # Some example queries are: - # - # * Query `displayName=Test*` returns Folder resources whose display name - # starts with "Test". - # * Query `state=ACTIVE` returns Folder resources with - # `state` set to `ACTIVE`. - # * Query `parent=folders/123` returns Folder resources that have - # `folders/123` as a parent resource. - # * Query `parent=folders/123 AND state=ACTIVE` returns active - # Folder resources that have `folders/123` as a parent resource. - # * Query `displayName=\\"Test String\\"` returns Folder resources with - # display names that include both "Test" and "String". - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Gapic::Rest::PagedEnumerable<::Google::Cloud::ResourceManager::V3::Folder>] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Gapic::Rest::PagedEnumerable<::Google::Cloud::ResourceManager::V3::Folder>] - # - # @raise [::Google::Cloud::Error] if the REST call is aborted. - # - # @example Basic example - # require "google/cloud/resource_manager/v3" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::ResourceManager::V3::Folders::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::ResourceManager::V3::SearchFoldersRequest.new - # - # # Call the search_folders method. - # result = client.search_folders request - # - # # The returned object is of type Gapic::PagedEnumerable. You can iterate - # # over elements, and API calls will be issued to fetch pages as needed. - # result.each do |item| - # # Each element is of type ::Google::Cloud::ResourceManager::V3::Folder. - # p item - # end - # - def search_folders request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::ResourceManager::V3::SearchFoldersRequest - - # Converts hash 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_folders.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::ResourceManager::V3::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_folders.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.search_folders.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @folders_stub.search_folders request, options do |result, operation| - result = ::Gapic::Rest::PagedEnumerable.new @folders_stub, :search_folders, "folders", request, result, options - yield result, operation if block_given? - throw :response, result - end - rescue ::Gapic::Rest::Error => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Creates a folder in the resource hierarchy. - # Returns an `Operation` which can be used to track the progress of the - # folder creation workflow. - # Upon success, the `Operation.response` field will be populated with the - # created Folder. - # - # In order to succeed, the addition of this new folder must not violate - # the folder naming, height, or fanout constraints. - # - # + The folder's `display_name` must be distinct from all other folders that - # share its parent. - # + The addition of the folder must not cause the active folder hierarchy - # to exceed a height of 10. Note, the full active + deleted folder hierarchy - # is allowed to reach a height of 20; this provides additional headroom when - # moving folders that contain deleted folders. - # + The addition of the folder must not cause the total number of folders - # under its parent to exceed 300. - # - # If the operation fails due to a folder constraint violation, some errors - # may be returned by the `CreateFolder` request, with status code - # `FAILED_PRECONDITION` and an error description. Other folder constraint - # violations will be communicated in the `Operation`, with the specific - # `PreconditionFailure` returned in the details list in the `Operation.error` - # field. - # - # The caller must have `resourcemanager.folders.create` permission on the - # identified parent. - # - # @overload create_folder(request, options = nil) - # Pass arguments to `create_folder` via a request object, either of type - # {::Google::Cloud::ResourceManager::V3::CreateFolderRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::ResourceManager::V3::CreateFolderRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @overload create_folder(folder: nil) - # Pass arguments to `create_folder` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param folder [::Google::Cloud::ResourceManager::V3::Folder, ::Hash] - # Required. The folder being created, only the display name and parent will - # be consulted. All other fields will be ignored. - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Gapic::Operation] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Gapic::Operation] - # - # @raise [::Google::Cloud::Error] if the REST call is aborted. - # - # @example Basic example - # require "google/cloud/resource_manager/v3" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::ResourceManager::V3::Folders::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::ResourceManager::V3::CreateFolderRequest.new - # - # # Call the create_folder method. - # result = client.create_folder request - # - # # The returned object is of type Gapic::Operation. You can use it to - # # check the status of an operation, cancel it, or wait for results. - # # Here is how to wait for a response. - # result.wait_until_done! timeout: 60 - # if result.response? - # p result.response - # else - # puts "No response received." - # end - # - def create_folder request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::ResourceManager::V3::CreateFolderRequest - - # Converts hash and nil to an options object - options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h - - # Customize the options with defaults - call_metadata = @config.rpcs.create_folder.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::ResourceManager::V3::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_folder.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.create_folder.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @folders_stub.create_folder 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 - - ## - # Updates a folder, changing its `display_name`. - # Changes to the folder `display_name` will be rejected if they violate - # either the `display_name` formatting rules or the naming constraints - # described in the - # {::Google::Cloud::ResourceManager::V3::Folders::Rest::Client#create_folder CreateFolder} - # documentation. - # - # The folder's `display_name` must start and end with a letter or digit, - # may contain letters, digits, spaces, hyphens and underscores and can be - # between 3 and 30 characters. This is captured by the regular expression: - # `[\p{L}\p{N}][\p{L}\p{N}_- ]{1,28}[\p{L}\p{N}]`. - # The caller must have `resourcemanager.folders.update` permission on the - # identified folder. - # - # If the update fails due to the unique name constraint then a - # `PreconditionFailure` explaining this violation will be returned - # in the Status.details field. - # - # @overload update_folder(request, options = nil) - # Pass arguments to `update_folder` via a request object, either of type - # {::Google::Cloud::ResourceManager::V3::UpdateFolderRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::ResourceManager::V3::UpdateFolderRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @overload update_folder(folder: nil, update_mask: nil) - # Pass arguments to `update_folder` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param folder [::Google::Cloud::ResourceManager::V3::Folder, ::Hash] - # Required. The new definition of the Folder. It must include the `name` - # field, which cannot be changed. - # @param update_mask [::Google::Protobuf::FieldMask, ::Hash] - # Required. Fields to be updated. - # Only the `display_name` can be updated. - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Gapic::Operation] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Gapic::Operation] - # - # @raise [::Google::Cloud::Error] if the REST call is aborted. - # - # @example Basic example - # require "google/cloud/resource_manager/v3" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::ResourceManager::V3::Folders::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::ResourceManager::V3::UpdateFolderRequest.new - # - # # Call the update_folder method. - # result = client.update_folder request - # - # # The returned object is of type Gapic::Operation. You can use it to - # # check the status of an operation, cancel it, or wait for results. - # # Here is how to wait for a response. - # result.wait_until_done! timeout: 60 - # if result.response? - # p result.response - # else - # puts "No response received." - # end - # - def update_folder request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::ResourceManager::V3::UpdateFolderRequest - - # Converts hash and nil to an options object - options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h - - # Customize the options with defaults - call_metadata = @config.rpcs.update_folder.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::ResourceManager::V3::VERSION, - transports_version_send: [:rest] - - call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - options.apply_defaults timeout: @config.rpcs.update_folder.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.update_folder.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @folders_stub.update_folder 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 - - ## - # Moves a folder under a new resource parent. - # Returns an `Operation` which can be used to track the progress of the - # folder move workflow. - # Upon success, the `Operation.response` field will be populated with the - # moved folder. - # Upon failure, a `FolderOperationError` categorizing the failure cause will - # be returned - if the failure occurs synchronously then the - # `FolderOperationError` will be returned in the `Status.details` field. - # If it occurs asynchronously, then the FolderOperation will be returned - # in the `Operation.error` field. - # In addition, the `Operation.metadata` field will be populated with a - # `FolderOperation` message as an aid to stateless clients. - # Folder moves will be rejected if they violate either the naming, height, - # or fanout constraints described in the - # {::Google::Cloud::ResourceManager::V3::Folders::Rest::Client#create_folder CreateFolder} - # documentation. The caller must have `resourcemanager.folders.move` - # permission on the folder's current and proposed new parent. - # - # @overload move_folder(request, options = nil) - # Pass arguments to `move_folder` via a request object, either of type - # {::Google::Cloud::ResourceManager::V3::MoveFolderRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::ResourceManager::V3::MoveFolderRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @overload move_folder(name: nil, destination_parent: nil) - # Pass arguments to `move_folder` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param name [::String] - # Required. The resource name of the Folder to move. - # Must be of the form folders/\\{folder_id} - # @param destination_parent [::String] - # Required. The resource name of the folder or organization which should be - # the folder's new parent. Must be of the form `folders/{folder_id}` or - # `organizations/{org_id}`. - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Gapic::Operation] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Gapic::Operation] - # - # @raise [::Google::Cloud::Error] if the REST call is aborted. - # - # @example Basic example - # require "google/cloud/resource_manager/v3" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::ResourceManager::V3::Folders::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::ResourceManager::V3::MoveFolderRequest.new - # - # # Call the move_folder method. - # result = client.move_folder request - # - # # The returned object is of type Gapic::Operation. You can use it to - # # check the status of an operation, cancel it, or wait for results. - # # Here is how to wait for a response. - # result.wait_until_done! timeout: 60 - # if result.response? - # p result.response - # else - # puts "No response received." - # end - # - def move_folder request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::ResourceManager::V3::MoveFolderRequest - - # Converts hash 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.move_folder.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::ResourceManager::V3::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.move_folder.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.move_folder.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @folders_stub.move_folder 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 - - ## - # Requests deletion of a folder. The folder is moved into the - # {::Google::Cloud::ResourceManager::V3::Folder::State::DELETE_REQUESTED DELETE_REQUESTED} - # state immediately, and is deleted approximately 30 days later. This method - # may only be called on an empty folder, where a folder is empty if it - # doesn't contain any folders or projects in the - # {::Google::Cloud::ResourceManager::V3::Folder::State::ACTIVE ACTIVE} state. If - # called on a folder in - # {::Google::Cloud::ResourceManager::V3::Folder::State::DELETE_REQUESTED DELETE_REQUESTED} - # state the operation will result in a no-op success. - # The caller must have `resourcemanager.folders.delete` permission on the - # identified folder. - # - # @overload delete_folder(request, options = nil) - # Pass arguments to `delete_folder` via a request object, either of type - # {::Google::Cloud::ResourceManager::V3::DeleteFolderRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::ResourceManager::V3::DeleteFolderRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @overload delete_folder(name: nil) - # Pass arguments to `delete_folder` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param name [::String] - # Required. The resource name of the folder to be deleted. - # Must be of the form `folders/{folder_id}`. - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Gapic::Operation] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Gapic::Operation] - # - # @raise [::Google::Cloud::Error] if the REST call is aborted. - # - # @example Basic example - # require "google/cloud/resource_manager/v3" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::ResourceManager::V3::Folders::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::ResourceManager::V3::DeleteFolderRequest.new - # - # # Call the delete_folder method. - # result = client.delete_folder request - # - # # The returned object is of type Gapic::Operation. You can use it to - # # check the status of an operation, cancel it, or wait for results. - # # Here is how to wait for a response. - # result.wait_until_done! timeout: 60 - # if result.response? - # p result.response - # else - # puts "No response received." - # end - # - def delete_folder request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::ResourceManager::V3::DeleteFolderRequest - - # Converts hash and nil to an options object - options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h - - # Customize the options with defaults - call_metadata = @config.rpcs.delete_folder.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::ResourceManager::V3::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_folder.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.delete_folder.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @folders_stub.delete_folder 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 - - ## - # Cancels the deletion request for a folder. This method may be called on a - # folder in any state. If the folder is in the - # {::Google::Cloud::ResourceManager::V3::Folder::State::ACTIVE ACTIVE} state the - # result will be a no-op success. In order to succeed, the folder's parent - # must be in the - # {::Google::Cloud::ResourceManager::V3::Folder::State::ACTIVE ACTIVE} state. In - # addition, reintroducing the folder into the tree must not violate folder - # naming, height, and fanout constraints described in the - # {::Google::Cloud::ResourceManager::V3::Folders::Rest::Client#create_folder CreateFolder} - # documentation. The caller must have `resourcemanager.folders.undelete` - # permission on the identified folder. - # - # @overload undelete_folder(request, options = nil) - # Pass arguments to `undelete_folder` via a request object, either of type - # {::Google::Cloud::ResourceManager::V3::UndeleteFolderRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::ResourceManager::V3::UndeleteFolderRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @overload undelete_folder(name: nil) - # Pass arguments to `undelete_folder` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param name [::String] - # Required. The resource name of the folder to undelete. - # Must be of the form `folders/{folder_id}`. - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Gapic::Operation] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Gapic::Operation] - # - # @raise [::Google::Cloud::Error] if the REST call is aborted. - # - # @example Basic example - # require "google/cloud/resource_manager/v3" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::ResourceManager::V3::Folders::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::ResourceManager::V3::UndeleteFolderRequest.new - # - # # Call the undelete_folder method. - # result = client.undelete_folder request - # - # # The returned object is of type Gapic::Operation. You can use it to - # # check the status of an operation, cancel it, or wait for results. - # # Here is how to wait for a response. - # result.wait_until_done! timeout: 60 - # if result.response? - # p result.response - # else - # puts "No response received." - # end - # - def undelete_folder request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::ResourceManager::V3::UndeleteFolderRequest - - # Converts hash 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.undelete_folder.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::ResourceManager::V3::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.undelete_folder.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.undelete_folder.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @folders_stub.undelete_folder 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 the access control policy for a folder. The returned policy may be - # empty if no such policy or resource exists. The `resource` field should - # be the folder's resource name, for example: "folders/1234". - # The caller must have `resourcemanager.folders.getIamPolicy` permission - # on the identified folder. - # - # @overload get_iam_policy(request, options = nil) - # Pass arguments to `get_iam_policy` via a request object, either of type - # {::Google::Iam::V1::GetIamPolicyRequest} or an equivalent Hash. - # - # @param request [::Google::Iam::V1::GetIamPolicyRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @overload get_iam_policy(resource: nil, options: nil) - # Pass arguments to `get_iam_policy` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param resource [::String] - # REQUIRED: The resource for which the policy is being requested. - # See the operation documentation for the appropriate value for this field. - # @param options [::Google::Iam::V1::GetPolicyOptions, ::Hash] - # OPTIONAL: A `GetPolicyOptions` object for specifying options to - # `GetIamPolicy`. - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Iam::V1::Policy] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Iam::V1::Policy] - # - # @raise [::Google::Cloud::Error] if the REST call is aborted. - # - # @example Basic example - # require "google/cloud/resource_manager/v3" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::ResourceManager::V3::Folders::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Iam::V1::GetIamPolicyRequest.new - # - # # Call the get_iam_policy method. - # result = client.get_iam_policy request - # - # # The returned object is of type Google::Iam::V1::Policy. - # p result - # - def get_iam_policy request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Iam::V1::GetIamPolicyRequest - - # Converts hash and nil to an options object - options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h - - # Customize the options with defaults - call_metadata = @config.rpcs.get_iam_policy.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::ResourceManager::V3::VERSION, - transports_version_send: [:rest] - - call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - options.apply_defaults timeout: @config.rpcs.get_iam_policy.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.get_iam_policy.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @folders_stub.get_iam_policy request, options do |result, operation| - yield result, operation if block_given? - end - rescue ::Gapic::Rest::Error => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Sets the access control policy on a folder, replacing any existing policy. - # The `resource` field should be the folder's resource name, for example: - # "folders/1234". - # The caller must have `resourcemanager.folders.setIamPolicy` permission - # on the identified folder. - # - # @overload set_iam_policy(request, options = nil) - # Pass arguments to `set_iam_policy` via a request object, either of type - # {::Google::Iam::V1::SetIamPolicyRequest} or an equivalent Hash. - # - # @param request [::Google::Iam::V1::SetIamPolicyRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @overload set_iam_policy(resource: nil, policy: nil, update_mask: nil) - # Pass arguments to `set_iam_policy` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param resource [::String] - # REQUIRED: The resource for which the policy is being specified. - # See the operation documentation for the appropriate value for this field. - # @param policy [::Google::Iam::V1::Policy, ::Hash] - # REQUIRED: The complete policy to be applied to the `resource`. The size of - # the policy is limited to a few 10s of KB. An empty policy is a - # valid policy but certain Cloud Platform services (such as Projects) - # might reject them. - # @param update_mask [::Google::Protobuf::FieldMask, ::Hash] - # OPTIONAL: A FieldMask specifying which fields of the policy to modify. Only - # the fields in the mask will be modified. If no mask is provided, the - # following default mask is used: - # - # `paths: "bindings, etag"` - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Iam::V1::Policy] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Iam::V1::Policy] - # - # @raise [::Google::Cloud::Error] if the REST call is aborted. - # - # @example Basic example - # require "google/cloud/resource_manager/v3" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::ResourceManager::V3::Folders::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Iam::V1::SetIamPolicyRequest.new - # - # # Call the set_iam_policy method. - # result = client.set_iam_policy request - # - # # The returned object is of type Google::Iam::V1::Policy. - # p result - # - def set_iam_policy request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Iam::V1::SetIamPolicyRequest - - # Converts hash and nil to an options object - options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h - - # Customize the options with defaults - call_metadata = @config.rpcs.set_iam_policy.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::ResourceManager::V3::VERSION, - transports_version_send: [:rest] - - call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - options.apply_defaults timeout: @config.rpcs.set_iam_policy.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.set_iam_policy.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @folders_stub.set_iam_policy request, options do |result, operation| - yield result, operation if block_given? - end - rescue ::Gapic::Rest::Error => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Returns permissions that a caller has on the specified folder. - # The `resource` field should be the folder's resource name, - # for example: "folders/1234". - # - # There are no permissions required for making this API call. - # - # @overload test_iam_permissions(request, options = nil) - # Pass arguments to `test_iam_permissions` via a request object, either of type - # {::Google::Iam::V1::TestIamPermissionsRequest} or an equivalent Hash. - # - # @param request [::Google::Iam::V1::TestIamPermissionsRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @overload test_iam_permissions(resource: nil, permissions: nil) - # Pass arguments to `test_iam_permissions` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param resource [::String] - # REQUIRED: The resource for which the policy detail is being requested. - # See the operation documentation for the appropriate value for this field. - # @param permissions [::Array<::String>] - # The set of permissions to check for the `resource`. Permissions with - # wildcards (such as '*' or 'storage.*') are not allowed. For more - # information see - # [IAM Overview](https://cloud.google.com/iam/docs/overview#permissions). - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Iam::V1::TestIamPermissionsResponse] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Iam::V1::TestIamPermissionsResponse] - # - # @raise [::Google::Cloud::Error] if the REST call is aborted. - # - # @example Basic example - # require "google/cloud/resource_manager/v3" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::ResourceManager::V3::Folders::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Iam::V1::TestIamPermissionsRequest.new - # - # # Call the test_iam_permissions method. - # result = client.test_iam_permissions request - # - # # The returned object is of type Google::Iam::V1::TestIamPermissionsResponse. - # p result - # - def test_iam_permissions request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Iam::V1::TestIamPermissionsRequest - - # Converts hash and nil to an options object - options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h - - # Customize the options with defaults - call_metadata = @config.rpcs.test_iam_permissions.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::ResourceManager::V3::VERSION, - transports_version_send: [:rest] - - call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - options.apply_defaults timeout: @config.rpcs.test_iam_permissions.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.test_iam_permissions.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @folders_stub.test_iam_permissions request, options do |result, operation| - yield result, operation if block_given? - end - rescue ::Gapic::Rest::Error => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Configuration class for the Folders REST API. - # - # This class represents the configuration for Folders REST, - # providing control over timeouts, retry behavior, logging, transport - # parameters, and other low-level controls. Certain parameters can also be - # applied individually to specific RPCs. See - # {::Google::Cloud::ResourceManager::V3::Folders::Rest::Client::Configuration::Rpcs} - # for a list of RPCs that can be configured independently. - # - # Configuration can be applied globally to all clients, or to a single client - # on construction. - # - # @example - # - # # Modify the global config, setting the timeout for - # # get_folder to 20 seconds, - # # and all remaining timeouts to 10 seconds. - # ::Google::Cloud::ResourceManager::V3::Folders::Rest::Client.configure do |config| - # config.timeout = 10.0 - # config.rpcs.get_folder.timeout = 20.0 - # end - # - # # Apply the above configuration only to a new client. - # client = ::Google::Cloud::ResourceManager::V3::Folders::Rest::Client.new do |config| - # config.timeout = 10.0 - # config.rpcs.get_folder.timeout = 20.0 - # end - # - # @!attribute [rw] endpoint - # A custom service endpoint, as a hostname or hostname:port. The default is - # nil, indicating to use the default endpoint in the current universe domain. - # @return [::String,nil] - # @!attribute [rw] credentials - # Credentials to send with calls. You may provide any of the following types: - # * (`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 = "cloudresourcemanager.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 Folders API. - # - # Includes fields providing the configuration for each RPC in this service. - # Each configuration object is of type `Gapic::Config::Method` and includes - # the following configuration fields: - # - # * `timeout` (*type:* `Numeric`) - The call timeout in seconds - # * `metadata` (*type:* `Hash{Symbol=>String}`) - Additional headers - # * `retry_policy (*type:* `Hash`) - The retry policy. The policy fields - # include the following keys: - # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds. - # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds. - # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier. - # * `:retry_codes` (*type:* `Array`) - The error codes that should - # trigger a retry. - # - class Rpcs - ## - # RPC-specific configuration for `get_folder` - # @return [::Gapic::Config::Method] - # - attr_reader :get_folder - ## - # RPC-specific configuration for `list_folders` - # @return [::Gapic::Config::Method] - # - attr_reader :list_folders - ## - # RPC-specific configuration for `search_folders` - # @return [::Gapic::Config::Method] - # - attr_reader :search_folders - ## - # RPC-specific configuration for `create_folder` - # @return [::Gapic::Config::Method] - # - attr_reader :create_folder - ## - # RPC-specific configuration for `update_folder` - # @return [::Gapic::Config::Method] - # - attr_reader :update_folder - ## - # RPC-specific configuration for `move_folder` - # @return [::Gapic::Config::Method] - # - attr_reader :move_folder - ## - # RPC-specific configuration for `delete_folder` - # @return [::Gapic::Config::Method] - # - attr_reader :delete_folder - ## - # RPC-specific configuration for `undelete_folder` - # @return [::Gapic::Config::Method] - # - attr_reader :undelete_folder - ## - # RPC-specific configuration for `get_iam_policy` - # @return [::Gapic::Config::Method] - # - attr_reader :get_iam_policy - ## - # RPC-specific configuration for `set_iam_policy` - # @return [::Gapic::Config::Method] - # - attr_reader :set_iam_policy - ## - # RPC-specific configuration for `test_iam_permissions` - # @return [::Gapic::Config::Method] - # - attr_reader :test_iam_permissions - - # @private - def initialize parent_rpcs = nil - get_folder_config = parent_rpcs.get_folder if parent_rpcs.respond_to? :get_folder - @get_folder = ::Gapic::Config::Method.new get_folder_config - list_folders_config = parent_rpcs.list_folders if parent_rpcs.respond_to? :list_folders - @list_folders = ::Gapic::Config::Method.new list_folders_config - search_folders_config = parent_rpcs.search_folders if parent_rpcs.respond_to? :search_folders - @search_folders = ::Gapic::Config::Method.new search_folders_config - create_folder_config = parent_rpcs.create_folder if parent_rpcs.respond_to? :create_folder - @create_folder = ::Gapic::Config::Method.new create_folder_config - update_folder_config = parent_rpcs.update_folder if parent_rpcs.respond_to? :update_folder - @update_folder = ::Gapic::Config::Method.new update_folder_config - move_folder_config = parent_rpcs.move_folder if parent_rpcs.respond_to? :move_folder - @move_folder = ::Gapic::Config::Method.new move_folder_config - delete_folder_config = parent_rpcs.delete_folder if parent_rpcs.respond_to? :delete_folder - @delete_folder = ::Gapic::Config::Method.new delete_folder_config - undelete_folder_config = parent_rpcs.undelete_folder if parent_rpcs.respond_to? :undelete_folder - @undelete_folder = ::Gapic::Config::Method.new undelete_folder_config - get_iam_policy_config = parent_rpcs.get_iam_policy if parent_rpcs.respond_to? :get_iam_policy - @get_iam_policy = ::Gapic::Config::Method.new get_iam_policy_config - set_iam_policy_config = parent_rpcs.set_iam_policy if parent_rpcs.respond_to? :set_iam_policy - @set_iam_policy = ::Gapic::Config::Method.new set_iam_policy_config - test_iam_permissions_config = parent_rpcs.test_iam_permissions if parent_rpcs.respond_to? :test_iam_permissions - @test_iam_permissions = ::Gapic::Config::Method.new test_iam_permissions_config - - yield self if block_given? - end - end - end - end - end - end - end - end - end -end diff --git a/owl-bot-staging/google-cloud-resource_manager-v3/lib/google/cloud/resource_manager/v3/folders/rest/operations.rb b/owl-bot-staging/google-cloud-resource_manager-v3/lib/google/cloud/resource_manager/v3/folders/rest/operations.rb deleted file mode 100644 index 29a56aadcc1b..000000000000 --- a/owl-bot-staging/google-cloud-resource_manager-v3/lib/google/cloud/resource_manager/v3/folders/rest/operations.rb +++ /dev/null @@ -1,925 +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 Cloud - module ResourceManager - module V3 - module Folders - module Rest - # Service that implements Longrunning Operations API. - class Operations - # @private - API_VERSION = "" - - # @private - DEFAULT_ENDPOINT_TEMPLATE = "cloudresourcemanager.$UNIVERSE_DOMAIN$" - - # @private - attr_reader :operations_stub - - ## - # Configuration for the Folders 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 Folders 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::ResourceManager::V3::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::ResourceManager::V3::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::ResourceManager::V3::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::ResourceManager::V3::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 = "cloudresourcemanager.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: "/v3/{name}", - matches: [ - ["name", %r{^operations(?:/.*)?$}, true] - ] - ) - 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 -end diff --git a/owl-bot-staging/google-cloud-resource_manager-v3/lib/google/cloud/resource_manager/v3/folders/rest/service_stub.rb b/owl-bot-staging/google-cloud-resource_manager-v3/lib/google/cloud/resource_manager/v3/folders/rest/service_stub.rb deleted file mode 100644 index 4536767d72e1..000000000000 --- a/owl-bot-staging/google-cloud-resource_manager-v3/lib/google/cloud/resource_manager/v3/folders/rest/service_stub.rb +++ /dev/null @@ -1,753 +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/resourcemanager/v3/folders_pb" - -module Google - module Cloud - module ResourceManager - module V3 - module Folders - module Rest - ## - # REST service stub for the Folders service. - # Service stub contains baseline method implementations - # including transcoding, making the REST call, and deserialing the response. - # - class ServiceStub - # @private - def initialize endpoint:, endpoint_template:, universe_domain:, credentials:, logger: - # These require statements are intentionally placed here to initialize - # the REST modules only when it's required. - require "gapic/rest" - - @client_stub = ::Gapic::Rest::ClientStub.new endpoint: endpoint, - endpoint_template: endpoint_template, - universe_domain: universe_domain, - credentials: credentials, - numeric_enums: true, - service_name: self.class, - raise_faraday_errors: false, - logger: logger - end - - ## - # The effective universe domain - # - # @return [String] - # - def universe_domain - @client_stub.universe_domain - end - - ## - # The effective endpoint - # - # @return [String] - # - def endpoint - @client_stub.endpoint - end - - ## - # The logger used for request/response debug logging. - # - # @return [Logger] - # - def logger stub: false - stub ? @client_stub.stub_logger : @client_stub.logger - end - - ## - # Baseline implementation for the get_folder REST call - # - # @param request_pb [::Google::Cloud::ResourceManager::V3::GetFolderRequest] - # A request object representing the call parameters. Required. - # @param options [::Gapic::CallOptions] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Cloud::ResourceManager::V3::Folder] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::ResourceManager::V3::Folder] - # A result object deserialized from the server's reply - def get_folder request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_get_folder_request request_pb - query_string_params = if query_string_params.any? - query_string_params.to_h { |p| p.split "=", 2 } - else - {} - end - - response = @client_stub.make_http_request( - verb, - uri: uri, - body: body || "", - params: query_string_params, - method_name: "get_folder", - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Cloud::ResourceManager::V3::Folder.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_folders REST call - # - # @param request_pb [::Google::Cloud::ResourceManager::V3::ListFoldersRequest] - # A request object representing the call parameters. Required. - # @param options [::Gapic::CallOptions] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Cloud::ResourceManager::V3::ListFoldersResponse] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::ResourceManager::V3::ListFoldersResponse] - # A result object deserialized from the server's reply - def list_folders request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_list_folders_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_folders", - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Cloud::ResourceManager::V3::ListFoldersResponse.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_folders REST call - # - # @param request_pb [::Google::Cloud::ResourceManager::V3::SearchFoldersRequest] - # A request object representing the call parameters. Required. - # @param options [::Gapic::CallOptions] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Cloud::ResourceManager::V3::SearchFoldersResponse] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::ResourceManager::V3::SearchFoldersResponse] - # A result object deserialized from the server's reply - def search_folders request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_search_folders_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_folders", - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Cloud::ResourceManager::V3::SearchFoldersResponse.decode_json response.body, ignore_unknown_fields: true - catch :response do - yield result, operation if block_given? - result - end - end - - ## - # Baseline implementation for the create_folder REST call - # - # @param request_pb [::Google::Cloud::ResourceManager::V3::CreateFolderRequest] - # 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_folder request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_create_folder_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_folder", - 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 update_folder REST call - # - # @param request_pb [::Google::Cloud::ResourceManager::V3::UpdateFolderRequest] - # 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_folder request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_update_folder_request request_pb - query_string_params = if query_string_params.any? - query_string_params.to_h { |p| p.split "=", 2 } - else - {} - end - - response = @client_stub.make_http_request( - verb, - uri: uri, - body: body || "", - params: query_string_params, - method_name: "update_folder", - 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 move_folder REST call - # - # @param request_pb [::Google::Cloud::ResourceManager::V3::MoveFolderRequest] - # 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 move_folder request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_move_folder_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: "move_folder", - 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_folder REST call - # - # @param request_pb [::Google::Cloud::ResourceManager::V3::DeleteFolderRequest] - # 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_folder request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_delete_folder_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_folder", - 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 undelete_folder REST call - # - # @param request_pb [::Google::Cloud::ResourceManager::V3::UndeleteFolderRequest] - # 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 undelete_folder request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_undelete_folder_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: "undelete_folder", - 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_iam_policy REST call - # - # @param request_pb [::Google::Iam::V1::GetIamPolicyRequest] - # A request object representing the call parameters. Required. - # @param options [::Gapic::CallOptions] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Iam::V1::Policy] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Iam::V1::Policy] - # A result object deserialized from the server's reply - def get_iam_policy request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_get_iam_policy_request request_pb - query_string_params = if query_string_params.any? - query_string_params.to_h { |p| p.split "=", 2 } - else - {} - end - - response = @client_stub.make_http_request( - verb, - uri: uri, - body: body || "", - params: query_string_params, - method_name: "get_iam_policy", - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Iam::V1::Policy.decode_json response.body, ignore_unknown_fields: true - catch :response do - yield result, operation if block_given? - result - end - end - - ## - # Baseline implementation for the set_iam_policy REST call - # - # @param request_pb [::Google::Iam::V1::SetIamPolicyRequest] - # A request object representing the call parameters. Required. - # @param options [::Gapic::CallOptions] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Iam::V1::Policy] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Iam::V1::Policy] - # A result object deserialized from the server's reply - def set_iam_policy request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_set_iam_policy_request request_pb - query_string_params = if query_string_params.any? - query_string_params.to_h { |p| p.split "=", 2 } - else - {} - end - - response = @client_stub.make_http_request( - verb, - uri: uri, - body: body || "", - params: query_string_params, - method_name: "set_iam_policy", - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Iam::V1::Policy.decode_json response.body, ignore_unknown_fields: true - catch :response do - yield result, operation if block_given? - result - end - end - - ## - # Baseline implementation for the test_iam_permissions REST call - # - # @param request_pb [::Google::Iam::V1::TestIamPermissionsRequest] - # A request object representing the call parameters. Required. - # @param options [::Gapic::CallOptions] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Iam::V1::TestIamPermissionsResponse] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Iam::V1::TestIamPermissionsResponse] - # A result object deserialized from the server's reply - def test_iam_permissions request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_test_iam_permissions_request request_pb - query_string_params = if query_string_params.any? - query_string_params.to_h { |p| p.split "=", 2 } - else - {} - end - - response = @client_stub.make_http_request( - verb, - uri: uri, - body: body || "", - params: query_string_params, - method_name: "test_iam_permissions", - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Iam::V1::TestIamPermissionsResponse.decode_json response.body, ignore_unknown_fields: true - catch :response do - yield result, operation if block_given? - result - end - end - - ## - # @private - # - # GRPC transcoding helper method for the get_folder REST call - # - # @param request_pb [::Google::Cloud::ResourceManager::V3::GetFolderRequest] - # A request object representing the call parameters. Required. - # @return [Array(String, [String, nil], Hash{String => String})] - # Uri, Body, Query string parameters - def self.transcode_get_folder_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :get, - uri_template: "/v3/{name}", - matches: [ - ["name", %r{^folders/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the list_folders REST call - # - # @param request_pb [::Google::Cloud::ResourceManager::V3::ListFoldersRequest] - # 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_folders_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :get, - uri_template: "/v3/folders", - matches: [] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the search_folders REST call - # - # @param request_pb [::Google::Cloud::ResourceManager::V3::SearchFoldersRequest] - # 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_folders_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :get, - uri_template: "/v3/folders:search", - matches: [] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the create_folder REST call - # - # @param request_pb [::Google::Cloud::ResourceManager::V3::CreateFolderRequest] - # 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_folder_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :post, - uri_template: "/v3/folders", - body: "folder", - matches: [] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the update_folder REST call - # - # @param request_pb [::Google::Cloud::ResourceManager::V3::UpdateFolderRequest] - # A request object representing the call parameters. Required. - # @return [Array(String, [String, nil], Hash{String => String})] - # Uri, Body, Query string parameters - def self.transcode_update_folder_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :patch, - uri_template: "/v3/{folder.name}", - body: "folder", - matches: [ - ["folder.name", %r{^folders/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the move_folder REST call - # - # @param request_pb [::Google::Cloud::ResourceManager::V3::MoveFolderRequest] - # A request object representing the call parameters. Required. - # @return [Array(String, [String, nil], Hash{String => String})] - # Uri, Body, Query string parameters - def self.transcode_move_folder_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :post, - uri_template: "/v3/{name}:move", - body: "*", - matches: [ - ["name", %r{^folders/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the delete_folder REST call - # - # @param request_pb [::Google::Cloud::ResourceManager::V3::DeleteFolderRequest] - # 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_folder_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :delete, - uri_template: "/v3/{name}", - matches: [ - ["name", %r{^folders/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the undelete_folder REST call - # - # @param request_pb [::Google::Cloud::ResourceManager::V3::UndeleteFolderRequest] - # A request object representing the call parameters. Required. - # @return [Array(String, [String, nil], Hash{String => String})] - # Uri, Body, Query string parameters - def self.transcode_undelete_folder_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :post, - uri_template: "/v3/{name}:undelete", - body: "*", - matches: [ - ["name", %r{^folders/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the get_iam_policy REST call - # - # @param request_pb [::Google::Iam::V1::GetIamPolicyRequest] - # A request object representing the call parameters. Required. - # @return [Array(String, [String, nil], Hash{String => String})] - # Uri, Body, Query string parameters - def self.transcode_get_iam_policy_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :post, - uri_template: "/v3/{resource}:getIamPolicy", - body: "*", - matches: [ - ["resource", %r{^folders/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the set_iam_policy REST call - # - # @param request_pb [::Google::Iam::V1::SetIamPolicyRequest] - # A request object representing the call parameters. Required. - # @return [Array(String, [String, nil], Hash{String => String})] - # Uri, Body, Query string parameters - def self.transcode_set_iam_policy_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :post, - uri_template: "/v3/{resource}:setIamPolicy", - body: "*", - matches: [ - ["resource", %r{^folders/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the test_iam_permissions REST call - # - # @param request_pb [::Google::Iam::V1::TestIamPermissionsRequest] - # A request object representing the call parameters. Required. - # @return [Array(String, [String, nil], Hash{String => String})] - # Uri, Body, Query string parameters - def self.transcode_test_iam_permissions_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :post, - uri_template: "/v3/{resource}:testIamPermissions", - body: "*", - matches: [ - ["resource", %r{^folders/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - end - end - end - end - end - end -end diff --git a/owl-bot-staging/google-cloud-resource_manager-v3/lib/google/cloud/resource_manager/v3/organizations.rb b/owl-bot-staging/google-cloud-resource_manager-v3/lib/google/cloud/resource_manager/v3/organizations.rb deleted file mode 100644 index 0c0988af5ffe..000000000000 --- a/owl-bot-staging/google-cloud-resource_manager-v3/lib/google/cloud/resource_manager/v3/organizations.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/resource_manager/v3/version" - -require "google/cloud/resource_manager/v3/organizations/credentials" -require "google/cloud/resource_manager/v3/organizations/paths" -require "google/cloud/resource_manager/v3/organizations/client" -require "google/cloud/resource_manager/v3/organizations/rest" - -module Google - module Cloud - module ResourceManager - module V3 - ## - # Allows users to manage their organization resources. - # - # @example Load this service and instantiate a gRPC client - # - # require "google/cloud/resource_manager/v3/organizations" - # client = ::Google::Cloud::ResourceManager::V3::Organizations::Client.new - # - # @example Load this service and instantiate a REST client - # - # require "google/cloud/resource_manager/v3/organizations/rest" - # client = ::Google::Cloud::ResourceManager::V3::Organizations::Rest::Client.new - # - module Organizations - end - end - end - end -end - -helper_path = ::File.join __dir__, "organizations", "helpers.rb" -require "google/cloud/resource_manager/v3/organizations/helpers" if ::File.file? helper_path diff --git a/owl-bot-staging/google-cloud-resource_manager-v3/lib/google/cloud/resource_manager/v3/organizations/client.rb b/owl-bot-staging/google-cloud-resource_manager-v3/lib/google/cloud/resource_manager/v3/organizations/client.rb deleted file mode 100644 index 4ad34ad98f78..000000000000 --- a/owl-bot-staging/google-cloud-resource_manager-v3/lib/google/cloud/resource_manager/v3/organizations/client.rb +++ /dev/null @@ -1,923 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -require "google/cloud/errors" -require "google/cloud/resourcemanager/v3/organizations_pb" - -module Google - module Cloud - module ResourceManager - module V3 - module Organizations - ## - # Client for the Organizations service. - # - # Allows users to manage their organization resources. - # - class Client - # @private - API_VERSION = "" - - # @private - DEFAULT_ENDPOINT_TEMPLATE = "cloudresourcemanager.$UNIVERSE_DOMAIN$" - - include Paths - - # @private - attr_reader :organizations_stub - - ## - # Configure the Organizations Client class. - # - # See {::Google::Cloud::ResourceManager::V3::Organizations::Client::Configuration} - # for a description of the configuration fields. - # - # @example - # - # # Modify the configuration for all Organizations clients - # ::Google::Cloud::ResourceManager::V3::Organizations::Client.configure do |config| - # config.timeout = 10.0 - # end - # - # @yield [config] Configure the Client client. - # @yieldparam config [Client::Configuration] - # - # @return [Client::Configuration] - # - def self.configure - @configure ||= begin - namespace = ["Google", "Cloud", "ResourceManager", "V3"] - 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.get_organization.timeout = 60.0 - default_config.rpcs.get_organization.retry_policy = { - initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [14] - } - - default_config.rpcs.search_organizations.timeout = 60.0 - - default_config.rpcs.get_iam_policy.timeout = 60.0 - default_config.rpcs.get_iam_policy.retry_policy = { - initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [14] - } - - default_config.rpcs.set_iam_policy.timeout = 60.0 - - default_config - end - yield @configure if block_given? - @configure - end - - ## - # Configure the Organizations Client instance. - # - # The configuration is set to the derived mode, meaning that values can be changed, - # but structural changes (adding new fields, etc.) are not allowed. Structural changes - # should be made on {Client.configure}. - # - # See {::Google::Cloud::ResourceManager::V3::Organizations::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 - @organizations_stub.universe_domain - end - - ## - # Create a new Organizations client object. - # - # @example - # - # # Create a client using the default configuration - # client = ::Google::Cloud::ResourceManager::V3::Organizations::Client.new - # - # # Create a client using a custom configuration - # client = ::Google::Cloud::ResourceManager::V3::Organizations::Client.new do |config| - # config.timeout = 10.0 - # end - # - # @yield [config] Configure the Organizations client. - # @yieldparam config [Client::Configuration] - # - def initialize - # These require statements are intentionally placed here to initialize - # the gRPC module only when it's required. - # See https://github.com/googleapis/toolkit/issues/446 - require "gapic/grpc" - require "google/cloud/resourcemanager/v3/organizations_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 - - @organizations_stub = ::Gapic::ServiceStub.new( - ::Google::Cloud::ResourceManager::V3::Organizations::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 - ) - - @organizations_stub.stub_logger&.info do |entry| - entry.set_system_name - entry.set_service - entry.message = "Created client for #{entry.service}" - entry.set_credentials_fields credentials - entry.set "customEndpoint", @config.endpoint if @config.endpoint - entry.set "defaultTimeout", @config.timeout if @config.timeout - entry.set "quotaProject", @quota_project_id if @quota_project_id - end - end - - ## - # The logger used for request/response debug logging. - # - # @return [Logger] - # - def logger - @organizations_stub.logger - end - - # Service calls - - ## - # Fetches an organization resource identified by the specified resource name. - # - # @overload get_organization(request, options = nil) - # Pass arguments to `get_organization` via a request object, either of type - # {::Google::Cloud::ResourceManager::V3::GetOrganizationRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::ResourceManager::V3::GetOrganizationRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. - # - # @overload get_organization(name: nil) - # Pass arguments to `get_organization` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param name [::String] - # Required. The resource name of the Organization to fetch. This is the - # organization's relative path in the API, formatted as - # "organizations/[organizationId]". For example, "organizations/1234". - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Google::Cloud::ResourceManager::V3::Organization] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Google::Cloud::ResourceManager::V3::Organization] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/cloud/resource_manager/v3" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::ResourceManager::V3::Organizations::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::ResourceManager::V3::GetOrganizationRequest.new - # - # # Call the get_organization method. - # result = client.get_organization request - # - # # The returned object is of type Google::Cloud::ResourceManager::V3::Organization. - # p result - # - def get_organization request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::ResourceManager::V3::GetOrganizationRequest - - # Converts hash and nil to an options object - options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h - - # Customize the options with defaults - metadata = @config.rpcs.get_organization.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::ResourceManager::V3::VERSION - metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - header_params = {} - if request.name - header_params["name"] = request.name - end - - request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") - metadata[:"x-goog-request-params"] ||= request_params_header - - options.apply_defaults timeout: @config.rpcs.get_organization.timeout, - metadata: metadata, - retry_policy: @config.rpcs.get_organization.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @organizations_stub.call_rpc :get_organization, 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 - - ## - # Searches organization resources that are visible to the user and satisfy - # the specified filter. This method returns organizations in an unspecified - # order. New organizations do not necessarily appear at the end of the - # results, and may take a small amount of time to appear. - # - # Search will only return organizations on which the user has the permission - # `resourcemanager.organizations.get` - # - # @overload search_organizations(request, options = nil) - # Pass arguments to `search_organizations` via a request object, either of type - # {::Google::Cloud::ResourceManager::V3::SearchOrganizationsRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::ResourceManager::V3::SearchOrganizationsRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_organizations(page_size: nil, page_token: nil, query: nil) - # Pass arguments to `search_organizations` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param page_size [::Integer] - # Optional. The maximum number of organizations to return in the response. - # The server can return fewer organizations than requested. If unspecified, - # server picks an appropriate default. - # @param page_token [::String] - # Optional. A pagination token returned from a previous call to - # `SearchOrganizations` that indicates from where listing should continue. - # @param query [::String] - # Optional. An optional query string used to filter the Organizations to - # return in the response. Query rules are case-insensitive. - # - # - # ``` - # | Field | Description | - # |------------------|--------------------------------------------| - # | directoryCustomerId, owner.directoryCustomerId | Filters by directory - # customer id. | - # | domain | Filters by domain. | - # ``` - # - # Organizations may be queried by `directoryCustomerId` or by - # `domain`, where the domain is a G Suite domain, for example: - # - # * Query `directorycustomerid:123456789` returns Organization - # resources with `owner.directory_customer_id` equal to `123456789`. - # * Query `domain:google.com` returns Organization resources corresponding - # to the domain `google.com`. - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Gapic::PagedEnumerable<::Google::Cloud::ResourceManager::V3::Organization>] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Gapic::PagedEnumerable<::Google::Cloud::ResourceManager::V3::Organization>] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/cloud/resource_manager/v3" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::ResourceManager::V3::Organizations::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::ResourceManager::V3::SearchOrganizationsRequest.new - # - # # Call the search_organizations method. - # result = client.search_organizations request - # - # # The returned object is of type Gapic::PagedEnumerable. You can iterate - # # over elements, and API calls will be issued to fetch pages as needed. - # result.each do |item| - # # Each element is of type ::Google::Cloud::ResourceManager::V3::Organization. - # p item - # end - # - def search_organizations request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::ResourceManager::V3::SearchOrganizationsRequest - - # Converts hash 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_organizations.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::ResourceManager::V3::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.search_organizations.timeout, - metadata: metadata, - retry_policy: @config.rpcs.search_organizations.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @organizations_stub.call_rpc :search_organizations, request, options: options do |response, operation| - response = ::Gapic::PagedEnumerable.new @organizations_stub, :search_organizations, request, response, operation, options - yield response, operation if block_given? - throw :response, response - end - rescue ::GRPC::BadStatus => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Gets the access control policy for an organization resource. The policy may - # be empty if no such policy or resource exists. The `resource` field should - # be the organization's resource name, for example: "organizations/123". - # - # Authorization requires the IAM permission - # `resourcemanager.organizations.getIamPolicy` on the specified organization. - # - # @overload get_iam_policy(request, options = nil) - # Pass arguments to `get_iam_policy` via a request object, either of type - # {::Google::Iam::V1::GetIamPolicyRequest} or an equivalent Hash. - # - # @param request [::Google::Iam::V1::GetIamPolicyRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. - # - # @overload get_iam_policy(resource: nil, options: nil) - # Pass arguments to `get_iam_policy` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param resource [::String] - # REQUIRED: The resource for which the policy is being requested. - # See the operation documentation for the appropriate value for this field. - # @param options [::Google::Iam::V1::GetPolicyOptions, ::Hash] - # OPTIONAL: A `GetPolicyOptions` object for specifying options to - # `GetIamPolicy`. - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Google::Iam::V1::Policy] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Google::Iam::V1::Policy] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/cloud/resource_manager/v3" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::ResourceManager::V3::Organizations::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Iam::V1::GetIamPolicyRequest.new - # - # # Call the get_iam_policy method. - # result = client.get_iam_policy request - # - # # The returned object is of type Google::Iam::V1::Policy. - # p result - # - def get_iam_policy request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Iam::V1::GetIamPolicyRequest - - # Converts hash and nil to an options object - options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h - - # Customize the options with defaults - metadata = @config.rpcs.get_iam_policy.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::ResourceManager::V3::VERSION - metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - header_params = {} - if request.resource - header_params["resource"] = request.resource - end - - request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") - metadata[:"x-goog-request-params"] ||= request_params_header - - options.apply_defaults timeout: @config.rpcs.get_iam_policy.timeout, - metadata: metadata, - retry_policy: @config.rpcs.get_iam_policy.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @organizations_stub.call_rpc :get_iam_policy, request, options: options do |response, operation| - yield response, operation if block_given? - end - rescue ::GRPC::BadStatus => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Sets the access control policy on an organization resource. Replaces any - # existing policy. The `resource` field should be the organization's resource - # name, for example: "organizations/123". - # - # Authorization requires the IAM permission - # `resourcemanager.organizations.setIamPolicy` on the specified organization. - # - # @overload set_iam_policy(request, options = nil) - # Pass arguments to `set_iam_policy` via a request object, either of type - # {::Google::Iam::V1::SetIamPolicyRequest} or an equivalent Hash. - # - # @param request [::Google::Iam::V1::SetIamPolicyRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. - # - # @overload set_iam_policy(resource: nil, policy: nil, update_mask: nil) - # Pass arguments to `set_iam_policy` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param resource [::String] - # REQUIRED: The resource for which the policy is being specified. - # See the operation documentation for the appropriate value for this field. - # @param policy [::Google::Iam::V1::Policy, ::Hash] - # REQUIRED: The complete policy to be applied to the `resource`. The size of - # the policy is limited to a few 10s of KB. An empty policy is a - # valid policy but certain Cloud Platform services (such as Projects) - # might reject them. - # @param update_mask [::Google::Protobuf::FieldMask, ::Hash] - # OPTIONAL: A FieldMask specifying which fields of the policy to modify. Only - # the fields in the mask will be modified. If no mask is provided, the - # following default mask is used: - # - # `paths: "bindings, etag"` - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Google::Iam::V1::Policy] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Google::Iam::V1::Policy] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/cloud/resource_manager/v3" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::ResourceManager::V3::Organizations::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Iam::V1::SetIamPolicyRequest.new - # - # # Call the set_iam_policy method. - # result = client.set_iam_policy request - # - # # The returned object is of type Google::Iam::V1::Policy. - # p result - # - def set_iam_policy request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Iam::V1::SetIamPolicyRequest - - # Converts hash and nil to an options object - options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h - - # Customize the options with defaults - metadata = @config.rpcs.set_iam_policy.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::ResourceManager::V3::VERSION - metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - header_params = {} - if request.resource - header_params["resource"] = request.resource - end - - request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") - metadata[:"x-goog-request-params"] ||= request_params_header - - options.apply_defaults timeout: @config.rpcs.set_iam_policy.timeout, - metadata: metadata, - retry_policy: @config.rpcs.set_iam_policy.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @organizations_stub.call_rpc :set_iam_policy, request, options: options do |response, operation| - yield response, operation if block_given? - end - rescue ::GRPC::BadStatus => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Returns the permissions that a caller has on the specified organization. - # The `resource` field should be the organization's resource name, - # for example: "organizations/123". - # - # There are no permissions required for making this API call. - # - # @overload test_iam_permissions(request, options = nil) - # Pass arguments to `test_iam_permissions` via a request object, either of type - # {::Google::Iam::V1::TestIamPermissionsRequest} or an equivalent Hash. - # - # @param request [::Google::Iam::V1::TestIamPermissionsRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. - # - # @overload test_iam_permissions(resource: nil, permissions: nil) - # Pass arguments to `test_iam_permissions` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param resource [::String] - # REQUIRED: The resource for which the policy detail is being requested. - # See the operation documentation for the appropriate value for this field. - # @param permissions [::Array<::String>] - # The set of permissions to check for the `resource`. Permissions with - # wildcards (such as '*' or 'storage.*') are not allowed. For more - # information see - # [IAM Overview](https://cloud.google.com/iam/docs/overview#permissions). - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Google::Iam::V1::TestIamPermissionsResponse] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Google::Iam::V1::TestIamPermissionsResponse] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/cloud/resource_manager/v3" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::ResourceManager::V3::Organizations::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Iam::V1::TestIamPermissionsRequest.new - # - # # Call the test_iam_permissions method. - # result = client.test_iam_permissions request - # - # # The returned object is of type Google::Iam::V1::TestIamPermissionsResponse. - # p result - # - def test_iam_permissions request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Iam::V1::TestIamPermissionsRequest - - # Converts hash and nil to an options object - options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h - - # Customize the options with defaults - metadata = @config.rpcs.test_iam_permissions.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::ResourceManager::V3::VERSION - metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - header_params = {} - if request.resource - header_params["resource"] = request.resource - end - - request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") - metadata[:"x-goog-request-params"] ||= request_params_header - - options.apply_defaults timeout: @config.rpcs.test_iam_permissions.timeout, - metadata: metadata, - retry_policy: @config.rpcs.test_iam_permissions.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @organizations_stub.call_rpc :test_iam_permissions, request, options: options do |response, operation| - yield response, operation if block_given? - end - rescue ::GRPC::BadStatus => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Configuration class for the Organizations API. - # - # This class represents the configuration for Organizations, - # providing control over timeouts, retry behavior, logging, transport - # parameters, and other low-level controls. Certain parameters can also be - # applied individually to specific RPCs. See - # {::Google::Cloud::ResourceManager::V3::Organizations::Client::Configuration::Rpcs} - # for a list of RPCs that can be configured independently. - # - # Configuration can be applied globally to all clients, or to a single client - # on construction. - # - # @example - # - # # Modify the global config, setting the timeout for - # # get_organization to 20 seconds, - # # and all remaining timeouts to 10 seconds. - # ::Google::Cloud::ResourceManager::V3::Organizations::Client.configure do |config| - # config.timeout = 10.0 - # config.rpcs.get_organization.timeout = 20.0 - # end - # - # # Apply the above configuration only to a new client. - # client = ::Google::Cloud::ResourceManager::V3::Organizations::Client.new do |config| - # config.timeout = 10.0 - # config.rpcs.get_organization.timeout = 20.0 - # end - # - # @!attribute [rw] endpoint - # A custom service endpoint, as a hostname or hostname:port. The default is - # nil, indicating to use the default endpoint in the current universe domain. - # @return [::String,nil] - # @!attribute [rw] credentials - # Credentials to send with calls. You may provide any of the following types: - # * (`Google::Auth::Credentials`) A googleauth credentials object - # (see the [googleauth docs](https://rubydoc.info/gems/googleauth/Google/Auth/Credentials)) - # * (`Signet::OAuth2::Client`) A signet oauth2 client object - # (see the [signet docs](https://rubydoc.info/gems/signet/Signet/OAuth2/Client)) - # * (`GRPC::Core::Channel`) a gRPC channel with included credentials - # * (`GRPC::Core::ChannelCredentials`) a gRPC credentails object - # * (`nil`) indicating no credentials - # - # @note Warning: Passing a `String` to a keyfile path or a `Hash` of credentials - # is deprecated. Providing an unvalidated credential configuration to - # Google APIs can compromise the security of your systems and data. - # - # @example - # - # # The recommended way to provide credentials is to use the `make_creds` method - # # on the appropriate credentials class for your environment. - # - # require "googleauth" - # - # credentials = ::Google::Auth::ServiceAccountCredentials.make_creds( - # json_key_io: ::File.open("/path/to/keyfile.json") - # ) - # - # client = ::Google::Cloud::ResourceManager::V3::Organizations::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 = "cloudresourcemanager.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 Organizations 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 `get_organization` - # @return [::Gapic::Config::Method] - # - attr_reader :get_organization - ## - # RPC-specific configuration for `search_organizations` - # @return [::Gapic::Config::Method] - # - attr_reader :search_organizations - ## - # RPC-specific configuration for `get_iam_policy` - # @return [::Gapic::Config::Method] - # - attr_reader :get_iam_policy - ## - # RPC-specific configuration for `set_iam_policy` - # @return [::Gapic::Config::Method] - # - attr_reader :set_iam_policy - ## - # RPC-specific configuration for `test_iam_permissions` - # @return [::Gapic::Config::Method] - # - attr_reader :test_iam_permissions - - # @private - def initialize parent_rpcs = nil - get_organization_config = parent_rpcs.get_organization if parent_rpcs.respond_to? :get_organization - @get_organization = ::Gapic::Config::Method.new get_organization_config - search_organizations_config = parent_rpcs.search_organizations if parent_rpcs.respond_to? :search_organizations - @search_organizations = ::Gapic::Config::Method.new search_organizations_config - get_iam_policy_config = parent_rpcs.get_iam_policy if parent_rpcs.respond_to? :get_iam_policy - @get_iam_policy = ::Gapic::Config::Method.new get_iam_policy_config - set_iam_policy_config = parent_rpcs.set_iam_policy if parent_rpcs.respond_to? :set_iam_policy - @set_iam_policy = ::Gapic::Config::Method.new set_iam_policy_config - test_iam_permissions_config = parent_rpcs.test_iam_permissions if parent_rpcs.respond_to? :test_iam_permissions - @test_iam_permissions = ::Gapic::Config::Method.new test_iam_permissions_config - - yield self if block_given? - end - end - end - end - end - end - end - end -end diff --git a/owl-bot-staging/google-cloud-resource_manager-v3/lib/google/cloud/resource_manager/v3/organizations/credentials.rb b/owl-bot-staging/google-cloud-resource_manager-v3/lib/google/cloud/resource_manager/v3/organizations/credentials.rb deleted file mode 100644 index 0d7777666a20..000000000000 --- a/owl-bot-staging/google-cloud-resource_manager-v3/lib/google/cloud/resource_manager/v3/organizations/credentials.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 "googleauth" - -module Google - module Cloud - module ResourceManager - module V3 - module Organizations - # Credentials for the Organizations API. - class Credentials < ::Google::Auth::Credentials - self.scope = [ - "https://www.googleapis.com/auth/cloud-platform", - "https://www.googleapis.com/auth/cloud-platform.read-only" - ] - self.env_vars = [ - "RESOURCE_MANAGER_CREDENTIALS", - "RESOURCE_MANAGER_KEYFILE", - "GOOGLE_CLOUD_CREDENTIALS", - "GOOGLE_CLOUD_KEYFILE", - "GCLOUD_KEYFILE", - "RESOURCE_MANAGER_CREDENTIALS_JSON", - "RESOURCE_MANAGER_KEYFILE_JSON", - "GOOGLE_CLOUD_CREDENTIALS_JSON", - "GOOGLE_CLOUD_KEYFILE_JSON", - "GCLOUD_KEYFILE_JSON" - ] - self.paths = [ - "~/.config/google_cloud/application_default_credentials.json" - ] - end - end - end - end - end -end diff --git a/owl-bot-staging/google-cloud-resource_manager-v3/lib/google/cloud/resource_manager/v3/organizations/paths.rb b/owl-bot-staging/google-cloud-resource_manager-v3/lib/google/cloud/resource_manager/v3/organizations/paths.rb deleted file mode 100644 index 48b0f4e9404a..000000000000 --- a/owl-bot-staging/google-cloud-resource_manager-v3/lib/google/cloud/resource_manager/v3/organizations/paths.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! - - -module Google - module Cloud - module ResourceManager - module V3 - module Organizations - # Path helper methods for the Organizations API. - module Paths - ## - # Create a fully-qualified Organization resource string. - # - # The resource will be in the following format: - # - # `organizations/{organization}` - # - # @param organization [String] - # - # @return [::String] - def organization_path organization: - "organizations/#{organization}" - end - - extend self - end - end - end - end - end -end diff --git a/owl-bot-staging/google-cloud-resource_manager-v3/lib/google/cloud/resource_manager/v3/organizations/rest.rb b/owl-bot-staging/google-cloud-resource_manager-v3/lib/google/cloud/resource_manager/v3/organizations/rest.rb deleted file mode 100644 index 1cd4740e1925..000000000000 --- a/owl-bot-staging/google-cloud-resource_manager-v3/lib/google/cloud/resource_manager/v3/organizations/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/resource_manager/v3/version" - -require "google/cloud/resource_manager/v3/organizations/credentials" -require "google/cloud/resource_manager/v3/organizations/paths" -require "google/cloud/resource_manager/v3/organizations/rest/client" - -module Google - module Cloud - module ResourceManager - module V3 - ## - # Allows users to manage their organization resources. - # - # To load this service and instantiate a REST client: - # - # require "google/cloud/resource_manager/v3/organizations/rest" - # client = ::Google::Cloud::ResourceManager::V3::Organizations::Rest::Client.new - # - module Organizations - # Client for the REST transport - module Rest - end - end - end - end - end -end - -helper_path = ::File.join __dir__, "rest", "helpers.rb" -require "google/cloud/resource_manager/v3/organizations/rest/helpers" if ::File.file? helper_path diff --git a/owl-bot-staging/google-cloud-resource_manager-v3/lib/google/cloud/resource_manager/v3/organizations/rest/client.rb b/owl-bot-staging/google-cloud-resource_manager-v3/lib/google/cloud/resource_manager/v3/organizations/rest/client.rb deleted file mode 100644 index 5f466d357a28..000000000000 --- a/owl-bot-staging/google-cloud-resource_manager-v3/lib/google/cloud/resource_manager/v3/organizations/rest/client.rb +++ /dev/null @@ -1,853 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -require "google/cloud/errors" -require "google/cloud/resourcemanager/v3/organizations_pb" -require "google/cloud/resource_manager/v3/organizations/rest/service_stub" - -module Google - module Cloud - module ResourceManager - module V3 - module Organizations - module Rest - ## - # REST client for the Organizations service. - # - # Allows users to manage their organization resources. - # - class Client - # @private - API_VERSION = "" - - # @private - DEFAULT_ENDPOINT_TEMPLATE = "cloudresourcemanager.$UNIVERSE_DOMAIN$" - - include Paths - - # @private - attr_reader :organizations_stub - - ## - # Configure the Organizations Client class. - # - # See {::Google::Cloud::ResourceManager::V3::Organizations::Rest::Client::Configuration} - # for a description of the configuration fields. - # - # @example - # - # # Modify the configuration for all Organizations clients - # ::Google::Cloud::ResourceManager::V3::Organizations::Rest::Client.configure do |config| - # config.timeout = 10.0 - # end - # - # @yield [config] Configure the Client client. - # @yieldparam config [Client::Configuration] - # - # @return [Client::Configuration] - # - def self.configure - @configure ||= begin - namespace = ["Google", "Cloud", "ResourceManager", "V3"] - 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.get_organization.timeout = 60.0 - default_config.rpcs.get_organization.retry_policy = { - initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [14] - } - - default_config.rpcs.search_organizations.timeout = 60.0 - - default_config.rpcs.get_iam_policy.timeout = 60.0 - default_config.rpcs.get_iam_policy.retry_policy = { - initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [14] - } - - default_config.rpcs.set_iam_policy.timeout = 60.0 - - default_config - end - yield @configure if block_given? - @configure - end - - ## - # Configure the Organizations Client instance. - # - # The configuration is set to the derived mode, meaning that values can be changed, - # but structural changes (adding new fields, etc.) are not allowed. Structural changes - # should be made on {Client.configure}. - # - # See {::Google::Cloud::ResourceManager::V3::Organizations::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 - @organizations_stub.universe_domain - end - - ## - # Create a new Organizations REST client object. - # - # @example - # - # # Create a client using the default configuration - # client = ::Google::Cloud::ResourceManager::V3::Organizations::Rest::Client.new - # - # # Create a client using a custom configuration - # client = ::Google::Cloud::ResourceManager::V3::Organizations::Rest::Client.new do |config| - # config.timeout = 10.0 - # end - # - # @yield [config] Configure the Organizations 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 - - @organizations_stub = ::Google::Cloud::ResourceManager::V3::Organizations::Rest::ServiceStub.new( - endpoint: @config.endpoint, - endpoint_template: DEFAULT_ENDPOINT_TEMPLATE, - universe_domain: @config.universe_domain, - credentials: credentials, - logger: @config.logger - ) - - @organizations_stub.logger(stub: true)&.info do |entry| - entry.set_system_name - entry.set_service - entry.message = "Created client for #{entry.service}" - entry.set_credentials_fields credentials - entry.set "customEndpoint", @config.endpoint if @config.endpoint - entry.set "defaultTimeout", @config.timeout if @config.timeout - entry.set "quotaProject", @quota_project_id if @quota_project_id - end - end - - ## - # The logger used for request/response debug logging. - # - # @return [Logger] - # - def logger - @organizations_stub.logger - end - - # Service calls - - ## - # Fetches an organization resource identified by the specified resource name. - # - # @overload get_organization(request, options = nil) - # Pass arguments to `get_organization` via a request object, either of type - # {::Google::Cloud::ResourceManager::V3::GetOrganizationRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::ResourceManager::V3::GetOrganizationRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @overload get_organization(name: nil) - # Pass arguments to `get_organization` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param name [::String] - # Required. The resource name of the Organization to fetch. This is the - # organization's relative path in the API, formatted as - # "organizations/[organizationId]". For example, "organizations/1234". - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Cloud::ResourceManager::V3::Organization] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::ResourceManager::V3::Organization] - # - # @raise [::Google::Cloud::Error] if the REST call is aborted. - # - # @example Basic example - # require "google/cloud/resource_manager/v3" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::ResourceManager::V3::Organizations::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::ResourceManager::V3::GetOrganizationRequest.new - # - # # Call the get_organization method. - # result = client.get_organization request - # - # # The returned object is of type Google::Cloud::ResourceManager::V3::Organization. - # p result - # - def get_organization request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::ResourceManager::V3::GetOrganizationRequest - - # Converts hash and nil to an options object - options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h - - # Customize the options with defaults - call_metadata = @config.rpcs.get_organization.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::ResourceManager::V3::VERSION, - transports_version_send: [:rest] - - call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - options.apply_defaults timeout: @config.rpcs.get_organization.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.get_organization.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @organizations_stub.get_organization 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 - - ## - # Searches organization resources that are visible to the user and satisfy - # the specified filter. This method returns organizations in an unspecified - # order. New organizations do not necessarily appear at the end of the - # results, and may take a small amount of time to appear. - # - # Search will only return organizations on which the user has the permission - # `resourcemanager.organizations.get` - # - # @overload search_organizations(request, options = nil) - # Pass arguments to `search_organizations` via a request object, either of type - # {::Google::Cloud::ResourceManager::V3::SearchOrganizationsRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::ResourceManager::V3::SearchOrganizationsRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_organizations(page_size: nil, page_token: nil, query: nil) - # Pass arguments to `search_organizations` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param page_size [::Integer] - # Optional. The maximum number of organizations to return in the response. - # The server can return fewer organizations than requested. If unspecified, - # server picks an appropriate default. - # @param page_token [::String] - # Optional. A pagination token returned from a previous call to - # `SearchOrganizations` that indicates from where listing should continue. - # @param query [::String] - # Optional. An optional query string used to filter the Organizations to - # return in the response. Query rules are case-insensitive. - # - # - # ``` - # | Field | Description | - # |------------------|--------------------------------------------| - # | directoryCustomerId, owner.directoryCustomerId | Filters by directory - # customer id. | - # | domain | Filters by domain. | - # ``` - # - # Organizations may be queried by `directoryCustomerId` or by - # `domain`, where the domain is a G Suite domain, for example: - # - # * Query `directorycustomerid:123456789` returns Organization - # resources with `owner.directory_customer_id` equal to `123456789`. - # * Query `domain:google.com` returns Organization resources corresponding - # to the domain `google.com`. - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Gapic::Rest::PagedEnumerable<::Google::Cloud::ResourceManager::V3::Organization>] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Gapic::Rest::PagedEnumerable<::Google::Cloud::ResourceManager::V3::Organization>] - # - # @raise [::Google::Cloud::Error] if the REST call is aborted. - # - # @example Basic example - # require "google/cloud/resource_manager/v3" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::ResourceManager::V3::Organizations::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::ResourceManager::V3::SearchOrganizationsRequest.new - # - # # Call the search_organizations method. - # result = client.search_organizations request - # - # # The returned object is of type Gapic::PagedEnumerable. You can iterate - # # over elements, and API calls will be issued to fetch pages as needed. - # result.each do |item| - # # Each element is of type ::Google::Cloud::ResourceManager::V3::Organization. - # p item - # end - # - def search_organizations request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::ResourceManager::V3::SearchOrganizationsRequest - - # Converts hash 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_organizations.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::ResourceManager::V3::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_organizations.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.search_organizations.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @organizations_stub.search_organizations request, options do |result, operation| - result = ::Gapic::Rest::PagedEnumerable.new @organizations_stub, :search_organizations, "organizations", 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 access control policy for an organization resource. The policy may - # be empty if no such policy or resource exists. The `resource` field should - # be the organization's resource name, for example: "organizations/123". - # - # Authorization requires the IAM permission - # `resourcemanager.organizations.getIamPolicy` on the specified organization. - # - # @overload get_iam_policy(request, options = nil) - # Pass arguments to `get_iam_policy` via a request object, either of type - # {::Google::Iam::V1::GetIamPolicyRequest} or an equivalent Hash. - # - # @param request [::Google::Iam::V1::GetIamPolicyRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @overload get_iam_policy(resource: nil, options: nil) - # Pass arguments to `get_iam_policy` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param resource [::String] - # REQUIRED: The resource for which the policy is being requested. - # See the operation documentation for the appropriate value for this field. - # @param options [::Google::Iam::V1::GetPolicyOptions, ::Hash] - # OPTIONAL: A `GetPolicyOptions` object for specifying options to - # `GetIamPolicy`. - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Iam::V1::Policy] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Iam::V1::Policy] - # - # @raise [::Google::Cloud::Error] if the REST call is aborted. - # - # @example Basic example - # require "google/cloud/resource_manager/v3" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::ResourceManager::V3::Organizations::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Iam::V1::GetIamPolicyRequest.new - # - # # Call the get_iam_policy method. - # result = client.get_iam_policy request - # - # # The returned object is of type Google::Iam::V1::Policy. - # p result - # - def get_iam_policy request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Iam::V1::GetIamPolicyRequest - - # Converts hash and nil to an options object - options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h - - # Customize the options with defaults - call_metadata = @config.rpcs.get_iam_policy.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::ResourceManager::V3::VERSION, - transports_version_send: [:rest] - - call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - options.apply_defaults timeout: @config.rpcs.get_iam_policy.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.get_iam_policy.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @organizations_stub.get_iam_policy request, options do |result, operation| - yield result, operation if block_given? - end - rescue ::Gapic::Rest::Error => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Sets the access control policy on an organization resource. Replaces any - # existing policy. The `resource` field should be the organization's resource - # name, for example: "organizations/123". - # - # Authorization requires the IAM permission - # `resourcemanager.organizations.setIamPolicy` on the specified organization. - # - # @overload set_iam_policy(request, options = nil) - # Pass arguments to `set_iam_policy` via a request object, either of type - # {::Google::Iam::V1::SetIamPolicyRequest} or an equivalent Hash. - # - # @param request [::Google::Iam::V1::SetIamPolicyRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @overload set_iam_policy(resource: nil, policy: nil, update_mask: nil) - # Pass arguments to `set_iam_policy` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param resource [::String] - # REQUIRED: The resource for which the policy is being specified. - # See the operation documentation for the appropriate value for this field. - # @param policy [::Google::Iam::V1::Policy, ::Hash] - # REQUIRED: The complete policy to be applied to the `resource`. The size of - # the policy is limited to a few 10s of KB. An empty policy is a - # valid policy but certain Cloud Platform services (such as Projects) - # might reject them. - # @param update_mask [::Google::Protobuf::FieldMask, ::Hash] - # OPTIONAL: A FieldMask specifying which fields of the policy to modify. Only - # the fields in the mask will be modified. If no mask is provided, the - # following default mask is used: - # - # `paths: "bindings, etag"` - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Iam::V1::Policy] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Iam::V1::Policy] - # - # @raise [::Google::Cloud::Error] if the REST call is aborted. - # - # @example Basic example - # require "google/cloud/resource_manager/v3" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::ResourceManager::V3::Organizations::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Iam::V1::SetIamPolicyRequest.new - # - # # Call the set_iam_policy method. - # result = client.set_iam_policy request - # - # # The returned object is of type Google::Iam::V1::Policy. - # p result - # - def set_iam_policy request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Iam::V1::SetIamPolicyRequest - - # Converts hash and nil to an options object - options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h - - # Customize the options with defaults - call_metadata = @config.rpcs.set_iam_policy.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::ResourceManager::V3::VERSION, - transports_version_send: [:rest] - - call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - options.apply_defaults timeout: @config.rpcs.set_iam_policy.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.set_iam_policy.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @organizations_stub.set_iam_policy request, options do |result, operation| - yield result, operation if block_given? - end - rescue ::Gapic::Rest::Error => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Returns the permissions that a caller has on the specified organization. - # The `resource` field should be the organization's resource name, - # for example: "organizations/123". - # - # There are no permissions required for making this API call. - # - # @overload test_iam_permissions(request, options = nil) - # Pass arguments to `test_iam_permissions` via a request object, either of type - # {::Google::Iam::V1::TestIamPermissionsRequest} or an equivalent Hash. - # - # @param request [::Google::Iam::V1::TestIamPermissionsRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @overload test_iam_permissions(resource: nil, permissions: nil) - # Pass arguments to `test_iam_permissions` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param resource [::String] - # REQUIRED: The resource for which the policy detail is being requested. - # See the operation documentation for the appropriate value for this field. - # @param permissions [::Array<::String>] - # The set of permissions to check for the `resource`. Permissions with - # wildcards (such as '*' or 'storage.*') are not allowed. For more - # information see - # [IAM Overview](https://cloud.google.com/iam/docs/overview#permissions). - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Iam::V1::TestIamPermissionsResponse] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Iam::V1::TestIamPermissionsResponse] - # - # @raise [::Google::Cloud::Error] if the REST call is aborted. - # - # @example Basic example - # require "google/cloud/resource_manager/v3" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::ResourceManager::V3::Organizations::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Iam::V1::TestIamPermissionsRequest.new - # - # # Call the test_iam_permissions method. - # result = client.test_iam_permissions request - # - # # The returned object is of type Google::Iam::V1::TestIamPermissionsResponse. - # p result - # - def test_iam_permissions request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Iam::V1::TestIamPermissionsRequest - - # Converts hash and nil to an options object - options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h - - # Customize the options with defaults - call_metadata = @config.rpcs.test_iam_permissions.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::ResourceManager::V3::VERSION, - transports_version_send: [:rest] - - call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - options.apply_defaults timeout: @config.rpcs.test_iam_permissions.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.test_iam_permissions.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @organizations_stub.test_iam_permissions request, options do |result, operation| - yield result, operation if block_given? - end - rescue ::Gapic::Rest::Error => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Configuration class for the Organizations REST API. - # - # This class represents the configuration for Organizations REST, - # providing control over timeouts, retry behavior, logging, transport - # parameters, and other low-level controls. Certain parameters can also be - # applied individually to specific RPCs. See - # {::Google::Cloud::ResourceManager::V3::Organizations::Rest::Client::Configuration::Rpcs} - # for a list of RPCs that can be configured independently. - # - # Configuration can be applied globally to all clients, or to a single client - # on construction. - # - # @example - # - # # Modify the global config, setting the timeout for - # # get_organization to 20 seconds, - # # and all remaining timeouts to 10 seconds. - # ::Google::Cloud::ResourceManager::V3::Organizations::Rest::Client.configure do |config| - # config.timeout = 10.0 - # config.rpcs.get_organization.timeout = 20.0 - # end - # - # # Apply the above configuration only to a new client. - # client = ::Google::Cloud::ResourceManager::V3::Organizations::Rest::Client.new do |config| - # config.timeout = 10.0 - # config.rpcs.get_organization.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 = "cloudresourcemanager.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 Organizations API. - # - # Includes fields providing the configuration for each RPC in this service. - # Each configuration object is of type `Gapic::Config::Method` and includes - # the following configuration fields: - # - # * `timeout` (*type:* `Numeric`) - The call timeout in seconds - # * `metadata` (*type:* `Hash{Symbol=>String}`) - Additional headers - # * `retry_policy (*type:* `Hash`) - The retry policy. The policy fields - # include the following keys: - # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds. - # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds. - # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier. - # * `:retry_codes` (*type:* `Array`) - The error codes that should - # trigger a retry. - # - class Rpcs - ## - # RPC-specific configuration for `get_organization` - # @return [::Gapic::Config::Method] - # - attr_reader :get_organization - ## - # RPC-specific configuration for `search_organizations` - # @return [::Gapic::Config::Method] - # - attr_reader :search_organizations - ## - # RPC-specific configuration for `get_iam_policy` - # @return [::Gapic::Config::Method] - # - attr_reader :get_iam_policy - ## - # RPC-specific configuration for `set_iam_policy` - # @return [::Gapic::Config::Method] - # - attr_reader :set_iam_policy - ## - # RPC-specific configuration for `test_iam_permissions` - # @return [::Gapic::Config::Method] - # - attr_reader :test_iam_permissions - - # @private - def initialize parent_rpcs = nil - get_organization_config = parent_rpcs.get_organization if parent_rpcs.respond_to? :get_organization - @get_organization = ::Gapic::Config::Method.new get_organization_config - search_organizations_config = parent_rpcs.search_organizations if parent_rpcs.respond_to? :search_organizations - @search_organizations = ::Gapic::Config::Method.new search_organizations_config - get_iam_policy_config = parent_rpcs.get_iam_policy if parent_rpcs.respond_to? :get_iam_policy - @get_iam_policy = ::Gapic::Config::Method.new get_iam_policy_config - set_iam_policy_config = parent_rpcs.set_iam_policy if parent_rpcs.respond_to? :set_iam_policy - @set_iam_policy = ::Gapic::Config::Method.new set_iam_policy_config - test_iam_permissions_config = parent_rpcs.test_iam_permissions if parent_rpcs.respond_to? :test_iam_permissions - @test_iam_permissions = ::Gapic::Config::Method.new test_iam_permissions_config - - yield self if block_given? - end - end - end - end - end - end - end - end - end -end diff --git a/owl-bot-staging/google-cloud-resource_manager-v3/lib/google/cloud/resource_manager/v3/organizations/rest/service_stub.rb b/owl-bot-staging/google-cloud-resource_manager-v3/lib/google/cloud/resource_manager/v3/organizations/rest/service_stub.rb deleted file mode 100644 index 75313856f8b5..000000000000 --- a/owl-bot-staging/google-cloud-resource_manager-v3/lib/google/cloud/resource_manager/v3/organizations/rest/service_stub.rb +++ /dev/null @@ -1,387 +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/resourcemanager/v3/organizations_pb" - -module Google - module Cloud - module ResourceManager - module V3 - module Organizations - module Rest - ## - # REST service stub for the Organizations service. - # Service stub contains baseline method implementations - # including transcoding, making the REST call, and deserialing the response. - # - class ServiceStub - # @private - def initialize endpoint:, endpoint_template:, universe_domain:, credentials:, logger: - # These require statements are intentionally placed here to initialize - # the REST modules only when it's required. - require "gapic/rest" - - @client_stub = ::Gapic::Rest::ClientStub.new endpoint: endpoint, - endpoint_template: endpoint_template, - universe_domain: universe_domain, - credentials: credentials, - numeric_enums: true, - service_name: self.class, - raise_faraday_errors: false, - logger: logger - end - - ## - # The effective universe domain - # - # @return [String] - # - def universe_domain - @client_stub.universe_domain - end - - ## - # The effective endpoint - # - # @return [String] - # - def endpoint - @client_stub.endpoint - end - - ## - # The logger used for request/response debug logging. - # - # @return [Logger] - # - def logger stub: false - stub ? @client_stub.stub_logger : @client_stub.logger - end - - ## - # Baseline implementation for the get_organization REST call - # - # @param request_pb [::Google::Cloud::ResourceManager::V3::GetOrganizationRequest] - # A request object representing the call parameters. Required. - # @param options [::Gapic::CallOptions] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Cloud::ResourceManager::V3::Organization] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::ResourceManager::V3::Organization] - # A result object deserialized from the server's reply - def get_organization request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_get_organization_request request_pb - query_string_params = if query_string_params.any? - query_string_params.to_h { |p| p.split "=", 2 } - else - {} - end - - response = @client_stub.make_http_request( - verb, - uri: uri, - body: body || "", - params: query_string_params, - method_name: "get_organization", - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Cloud::ResourceManager::V3::Organization.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_organizations REST call - # - # @param request_pb [::Google::Cloud::ResourceManager::V3::SearchOrganizationsRequest] - # A request object representing the call parameters. Required. - # @param options [::Gapic::CallOptions] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Cloud::ResourceManager::V3::SearchOrganizationsResponse] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::ResourceManager::V3::SearchOrganizationsResponse] - # A result object deserialized from the server's reply - def search_organizations request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_search_organizations_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_organizations", - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Cloud::ResourceManager::V3::SearchOrganizationsResponse.decode_json response.body, ignore_unknown_fields: true - catch :response do - yield result, operation if block_given? - result - end - end - - ## - # Baseline implementation for the get_iam_policy REST call - # - # @param request_pb [::Google::Iam::V1::GetIamPolicyRequest] - # A request object representing the call parameters. Required. - # @param options [::Gapic::CallOptions] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Iam::V1::Policy] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Iam::V1::Policy] - # A result object deserialized from the server's reply - def get_iam_policy request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_get_iam_policy_request request_pb - query_string_params = if query_string_params.any? - query_string_params.to_h { |p| p.split "=", 2 } - else - {} - end - - response = @client_stub.make_http_request( - verb, - uri: uri, - body: body || "", - params: query_string_params, - method_name: "get_iam_policy", - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Iam::V1::Policy.decode_json response.body, ignore_unknown_fields: true - catch :response do - yield result, operation if block_given? - result - end - end - - ## - # Baseline implementation for the set_iam_policy REST call - # - # @param request_pb [::Google::Iam::V1::SetIamPolicyRequest] - # A request object representing the call parameters. Required. - # @param options [::Gapic::CallOptions] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Iam::V1::Policy] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Iam::V1::Policy] - # A result object deserialized from the server's reply - def set_iam_policy request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_set_iam_policy_request request_pb - query_string_params = if query_string_params.any? - query_string_params.to_h { |p| p.split "=", 2 } - else - {} - end - - response = @client_stub.make_http_request( - verb, - uri: uri, - body: body || "", - params: query_string_params, - method_name: "set_iam_policy", - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Iam::V1::Policy.decode_json response.body, ignore_unknown_fields: true - catch :response do - yield result, operation if block_given? - result - end - end - - ## - # Baseline implementation for the test_iam_permissions REST call - # - # @param request_pb [::Google::Iam::V1::TestIamPermissionsRequest] - # A request object representing the call parameters. Required. - # @param options [::Gapic::CallOptions] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Iam::V1::TestIamPermissionsResponse] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Iam::V1::TestIamPermissionsResponse] - # A result object deserialized from the server's reply - def test_iam_permissions request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_test_iam_permissions_request request_pb - query_string_params = if query_string_params.any? - query_string_params.to_h { |p| p.split "=", 2 } - else - {} - end - - response = @client_stub.make_http_request( - verb, - uri: uri, - body: body || "", - params: query_string_params, - method_name: "test_iam_permissions", - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Iam::V1::TestIamPermissionsResponse.decode_json response.body, ignore_unknown_fields: true - catch :response do - yield result, operation if block_given? - result - end - end - - ## - # @private - # - # GRPC transcoding helper method for the get_organization REST call - # - # @param request_pb [::Google::Cloud::ResourceManager::V3::GetOrganizationRequest] - # A request object representing the call parameters. Required. - # @return [Array(String, [String, nil], Hash{String => String})] - # Uri, Body, Query string parameters - def self.transcode_get_organization_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :get, - uri_template: "/v3/{name}", - matches: [ - ["name", %r{^organizations/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the search_organizations REST call - # - # @param request_pb [::Google::Cloud::ResourceManager::V3::SearchOrganizationsRequest] - # 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_organizations_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :get, - uri_template: "/v3/organizations:search", - matches: [] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the get_iam_policy REST call - # - # @param request_pb [::Google::Iam::V1::GetIamPolicyRequest] - # A request object representing the call parameters. Required. - # @return [Array(String, [String, nil], Hash{String => String})] - # Uri, Body, Query string parameters - def self.transcode_get_iam_policy_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :post, - uri_template: "/v3/{resource}:getIamPolicy", - body: "*", - matches: [ - ["resource", %r{^organizations/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the set_iam_policy REST call - # - # @param request_pb [::Google::Iam::V1::SetIamPolicyRequest] - # A request object representing the call parameters. Required. - # @return [Array(String, [String, nil], Hash{String => String})] - # Uri, Body, Query string parameters - def self.transcode_set_iam_policy_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :post, - uri_template: "/v3/{resource}:setIamPolicy", - body: "*", - matches: [ - ["resource", %r{^organizations/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the test_iam_permissions REST call - # - # @param request_pb [::Google::Iam::V1::TestIamPermissionsRequest] - # A request object representing the call parameters. Required. - # @return [Array(String, [String, nil], Hash{String => String})] - # Uri, Body, Query string parameters - def self.transcode_test_iam_permissions_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :post, - uri_template: "/v3/{resource}:testIamPermissions", - body: "*", - matches: [ - ["resource", %r{^organizations/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - end - end - end - end - end - end -end diff --git a/owl-bot-staging/google-cloud-resource_manager-v3/lib/google/cloud/resource_manager/v3/projects.rb b/owl-bot-staging/google-cloud-resource_manager-v3/lib/google/cloud/resource_manager/v3/projects.rb deleted file mode 100644 index ccf8f95fcd28..000000000000 --- a/owl-bot-staging/google-cloud-resource_manager-v3/lib/google/cloud/resource_manager/v3/projects.rb +++ /dev/null @@ -1,56 +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/resource_manager/v3/version" - -require "google/cloud/resource_manager/v3/projects/credentials" -require "google/cloud/resource_manager/v3/projects/paths" -require "google/cloud/resource_manager/v3/projects/operations" -require "google/cloud/resource_manager/v3/projects/client" -require "google/cloud/resource_manager/v3/projects/rest" - -module Google - module Cloud - module ResourceManager - module V3 - ## - # Manages Google Cloud Projects. - # - # @example Load this service and instantiate a gRPC client - # - # require "google/cloud/resource_manager/v3/projects" - # client = ::Google::Cloud::ResourceManager::V3::Projects::Client.new - # - # @example Load this service and instantiate a REST client - # - # require "google/cloud/resource_manager/v3/projects/rest" - # client = ::Google::Cloud::ResourceManager::V3::Projects::Rest::Client.new - # - module Projects - end - end - end - end -end - -helper_path = ::File.join __dir__, "projects", "helpers.rb" -require "google/cloud/resource_manager/v3/projects/helpers" if ::File.file? helper_path diff --git a/owl-bot-staging/google-cloud-resource_manager-v3/lib/google/cloud/resource_manager/v3/projects/client.rb b/owl-bot-staging/google-cloud-resource_manager-v3/lib/google/cloud/resource_manager/v3/projects/client.rb deleted file mode 100644 index edbf92f12e3a..000000000000 --- a/owl-bot-staging/google-cloud-resource_manager-v3/lib/google/cloud/resource_manager/v3/projects/client.rb +++ /dev/null @@ -1,1685 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -require "google/cloud/errors" -require "google/cloud/resourcemanager/v3/projects_pb" - -module Google - module Cloud - module ResourceManager - module V3 - module Projects - ## - # Client for the Projects service. - # - # Manages Google Cloud Projects. - # - class Client - # @private - API_VERSION = "" - - # @private - DEFAULT_ENDPOINT_TEMPLATE = "cloudresourcemanager.$UNIVERSE_DOMAIN$" - - include Paths - - # @private - attr_reader :projects_stub - - ## - # Configure the Projects Client class. - # - # See {::Google::Cloud::ResourceManager::V3::Projects::Client::Configuration} - # for a description of the configuration fields. - # - # @example - # - # # Modify the configuration for all Projects clients - # ::Google::Cloud::ResourceManager::V3::Projects::Client.configure do |config| - # config.timeout = 10.0 - # end - # - # @yield [config] Configure the Client client. - # @yieldparam config [Client::Configuration] - # - # @return [Client::Configuration] - # - def self.configure - @configure ||= begin - namespace = ["Google", "Cloud", "ResourceManager", "V3"] - 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.get_project.timeout = 60.0 - default_config.rpcs.get_project.retry_policy = { - initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [14] - } - - default_config.rpcs.list_projects.timeout = 60.0 - default_config.rpcs.list_projects.retry_policy = { - initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [14] - } - - default_config.rpcs.search_projects.timeout = 60.0 - - default_config.rpcs.create_project.timeout = 60.0 - - default_config.rpcs.update_project.timeout = 60.0 - - default_config.rpcs.move_project.timeout = 60.0 - - default_config.rpcs.delete_project.timeout = 60.0 - - default_config.rpcs.undelete_project.timeout = 60.0 - - default_config.rpcs.get_iam_policy.timeout = 60.0 - default_config.rpcs.get_iam_policy.retry_policy = { - initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [14] - } - - default_config.rpcs.set_iam_policy.timeout = 60.0 - - default_config - end - yield @configure if block_given? - @configure - end - - ## - # Configure the Projects Client instance. - # - # The configuration is set to the derived mode, meaning that values can be changed, - # but structural changes (adding new fields, etc.) are not allowed. Structural changes - # should be made on {Client.configure}. - # - # See {::Google::Cloud::ResourceManager::V3::Projects::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 - @projects_stub.universe_domain - end - - ## - # Create a new Projects client object. - # - # @example - # - # # Create a client using the default configuration - # client = ::Google::Cloud::ResourceManager::V3::Projects::Client.new - # - # # Create a client using a custom configuration - # client = ::Google::Cloud::ResourceManager::V3::Projects::Client.new do |config| - # config.timeout = 10.0 - # end - # - # @yield [config] Configure the Projects client. - # @yieldparam config [Client::Configuration] - # - def initialize - # These require statements are intentionally placed here to initialize - # the gRPC module only when it's required. - # See https://github.com/googleapis/toolkit/issues/446 - require "gapic/grpc" - require "google/cloud/resourcemanager/v3/projects_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 - - @projects_stub = ::Gapic::ServiceStub.new( - ::Google::Cloud::ResourceManager::V3::Projects::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 - ) - - @projects_stub.stub_logger&.info do |entry| - entry.set_system_name - entry.set_service - entry.message = "Created client for #{entry.service}" - entry.set_credentials_fields credentials - entry.set "customEndpoint", @config.endpoint if @config.endpoint - entry.set "defaultTimeout", @config.timeout if @config.timeout - entry.set "quotaProject", @quota_project_id if @quota_project_id - end - end - - ## - # Get the associated client for long-running operations. - # - # @return [::Google::Cloud::ResourceManager::V3::Projects::Operations] - # - attr_reader :operations_client - - ## - # The logger used for request/response debug logging. - # - # @return [Logger] - # - def logger - @projects_stub.logger - end - - # Service calls - - ## - # Retrieves the project identified by the specified `name` (for example, - # `projects/415104041262`). - # - # The caller must have `resourcemanager.projects.get` permission - # for this project. - # - # @overload get_project(request, options = nil) - # Pass arguments to `get_project` via a request object, either of type - # {::Google::Cloud::ResourceManager::V3::GetProjectRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::ResourceManager::V3::GetProjectRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. - # - # @overload get_project(name: nil) - # Pass arguments to `get_project` via keyword arguments. Note that at - # least one keyword argument is 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 project (for example, `projects/415104041262`). - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Google::Cloud::ResourceManager::V3::Project] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Google::Cloud::ResourceManager::V3::Project] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/cloud/resource_manager/v3" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::ResourceManager::V3::Projects::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::ResourceManager::V3::GetProjectRequest.new - # - # # Call the get_project method. - # result = client.get_project request - # - # # The returned object is of type Google::Cloud::ResourceManager::V3::Project. - # p result - # - def get_project request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::ResourceManager::V3::GetProjectRequest - - # Converts hash and nil to an options object - options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h - - # Customize the options with defaults - metadata = @config.rpcs.get_project.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::ResourceManager::V3::VERSION - metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - header_params = {} - if request.name - header_params["name"] = request.name - end - - request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") - metadata[:"x-goog-request-params"] ||= request_params_header - - options.apply_defaults timeout: @config.rpcs.get_project.timeout, - metadata: metadata, - retry_policy: @config.rpcs.get_project.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @projects_stub.call_rpc :get_project, request, options: options do |response, operation| - yield response, operation if block_given? - end - rescue ::GRPC::BadStatus => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Lists projects that are direct children of the specified folder or - # organization resource. `list()` provides a strongly consistent view of the - # projects underneath the specified parent resource. `list()` returns - # projects sorted based upon the (ascending) lexical ordering of their - # `display_name`. The caller must have `resourcemanager.projects.list` - # permission on the identified parent. - # - # @overload list_projects(request, options = nil) - # Pass arguments to `list_projects` via a request object, either of type - # {::Google::Cloud::ResourceManager::V3::ListProjectsRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::ResourceManager::V3::ListProjectsRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_projects(parent: nil, page_token: nil, page_size: nil, show_deleted: nil) - # Pass arguments to `list_projects` via keyword arguments. Note that at - # least one keyword argument is 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 name of the parent resource whose projects are being listed. - # Only children of this parent resource are listed; descendants are not - # listed. - # - # If the parent is a folder, use the value `folders/{folder_id}`. If the - # parent is an organization, use the value `organizations/{org_id}`. - # @param page_token [::String] - # Optional. A pagination token returned from a previous call to - # [ListProjects] [google.cloud.resourcemanager.v3.Projects.ListProjects] that - # indicates from where listing should continue. - # @param page_size [::Integer] - # Optional. The maximum number of projects to return in the response. - # The server can return fewer projects than requested. - # If unspecified, server picks an appropriate default. - # @param show_deleted [::Boolean] - # Optional. Indicate that projects in the `DELETE_REQUESTED` state should - # also be returned. Normally only `ACTIVE` projects are returned. - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Gapic::PagedEnumerable<::Google::Cloud::ResourceManager::V3::Project>] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Gapic::PagedEnumerable<::Google::Cloud::ResourceManager::V3::Project>] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/cloud/resource_manager/v3" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::ResourceManager::V3::Projects::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::ResourceManager::V3::ListProjectsRequest.new - # - # # Call the list_projects method. - # result = client.list_projects request - # - # # The returned object is of type Gapic::PagedEnumerable. You can iterate - # # over elements, and API calls will be issued to fetch pages as needed. - # result.each do |item| - # # Each element is of type ::Google::Cloud::ResourceManager::V3::Project. - # p item - # end - # - def list_projects request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::ResourceManager::V3::ListProjectsRequest - - # Converts hash 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_projects.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::ResourceManager::V3::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.list_projects.timeout, - metadata: metadata, - retry_policy: @config.rpcs.list_projects.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @projects_stub.call_rpc :list_projects, request, options: options do |response, operation| - response = ::Gapic::PagedEnumerable.new @projects_stub, :list_projects, 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 for projects that the caller has both `resourcemanager.projects.get` - # permission on, and also satisfy the specified query. - # - # This method returns projects in an unspecified order. - # - # This method is eventually consistent with project mutations; this means - # that a newly created project may not appear in the results or recent - # updates to an existing project may not be reflected in the results. To - # retrieve the latest state of a project, use the - # {::Google::Cloud::ResourceManager::V3::Projects::Client#get_project GetProject} method. - # - # @overload search_projects(request, options = nil) - # Pass arguments to `search_projects` via a request object, either of type - # {::Google::Cloud::ResourceManager::V3::SearchProjectsRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::ResourceManager::V3::SearchProjectsRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_projects(query: nil, page_token: nil, page_size: nil) - # Pass arguments to `search_projects` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param query [::String] - # Optional. A query string for searching for projects that the caller has - # `resourcemanager.projects.get` permission to. If multiple fields are - # included in the query, then it will return results that match any of the - # fields. Some eligible fields are: - # - # - **`displayName`, `name`**: Filters by displayName. - # - **`parent`**: Project's parent (for example: `folders/123`, - # `organizations/*`). Prefer `parent` field over `parent.type` and - # `parent.id`. - # - **`parent.type`**: Parent's type: `folder` or `organization`. - # - **`parent.id`**: Parent's id number (for example: `123`). - # - **`id`, `projectId`**: Filters by projectId. - # - **`state`, `lifecycleState`**: Filters by state. - # - **`labels`**: Filters by label name or value. - # - **`labels.` (where `` is the name of a label)**: Filters by label - # name. - # - # Search expressions are case insensitive. - # - # Some examples queries: - # - # - # - **`name:how*`**: The project's name starts with "how". - # - **`name:Howl`**: The project's name is `Howl` or `howl`. - # - **`name:HOWL`**: Equivalent to above. - # - **`NAME:howl`**: Equivalent to above. - # - **`labels.color:*`**: The project has the label `color`. - # - **`labels.color:red`**: The project's label `color` has the value `red`. - # - **`labels.color:red labels.size:big`**: The project's label `color` has - # the value `red` or its label `size` has the value `big`. - # - # If no query is specified, the call will return projects for which the user - # has the `resourcemanager.projects.get` permission. - # @param page_token [::String] - # Optional. A pagination token returned from a previous call to - # [ListProjects] [google.cloud.resourcemanager.v3.Projects.ListProjects] that - # indicates from where listing should continue. - # @param page_size [::Integer] - # Optional. The maximum number of projects to return in the response. - # The server can return fewer projects than requested. - # If unspecified, server picks an appropriate default. - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Gapic::PagedEnumerable<::Google::Cloud::ResourceManager::V3::Project>] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Gapic::PagedEnumerable<::Google::Cloud::ResourceManager::V3::Project>] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/cloud/resource_manager/v3" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::ResourceManager::V3::Projects::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::ResourceManager::V3::SearchProjectsRequest.new - # - # # Call the search_projects method. - # result = client.search_projects request - # - # # The returned object is of type Gapic::PagedEnumerable. You can iterate - # # over elements, and API calls will be issued to fetch pages as needed. - # result.each do |item| - # # Each element is of type ::Google::Cloud::ResourceManager::V3::Project. - # p item - # end - # - def search_projects request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::ResourceManager::V3::SearchProjectsRequest - - # Converts hash 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_projects.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::ResourceManager::V3::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.search_projects.timeout, - metadata: metadata, - retry_policy: @config.rpcs.search_projects.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @projects_stub.call_rpc :search_projects, request, options: options do |response, operation| - response = ::Gapic::PagedEnumerable.new @projects_stub, :search_projects, 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 - - ## - # Request that a new project be created. The result is an `Operation` which - # can be used to track the creation process. This process usually takes a few - # seconds, but can sometimes take much longer. The tracking `Operation` is - # automatically deleted after a few hours, so there is no need to call - # `DeleteOperation`. - # - # @overload create_project(request, options = nil) - # Pass arguments to `create_project` via a request object, either of type - # {::Google::Cloud::ResourceManager::V3::CreateProjectRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::ResourceManager::V3::CreateProjectRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_project(project: nil) - # Pass arguments to `create_project` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param project [::Google::Cloud::ResourceManager::V3::Project, ::Hash] - # Required. The Project to create. - # - # Project ID is required. If the requested ID is unavailable, the request - # fails. - # - # If the `parent` field is set, the `resourcemanager.projects.create` - # permission is checked on the parent resource. If no parent is set and - # the authorization credentials belong to an Organization, the parent - # will be set to that Organization. - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Gapic::Operation] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Gapic::Operation] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/cloud/resource_manager/v3" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::ResourceManager::V3::Projects::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::ResourceManager::V3::CreateProjectRequest.new - # - # # Call the create_project method. - # result = client.create_project 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_project request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::ResourceManager::V3::CreateProjectRequest - - # Converts hash 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_project.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::ResourceManager::V3::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.create_project.timeout, - metadata: metadata, - retry_policy: @config.rpcs.create_project.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @projects_stub.call_rpc :create_project, request, options: options do |response, operation| - response = ::Gapic::Operation.new response, @operations_client, options: options - yield response, operation if block_given? - throw :response, response - end - rescue ::GRPC::BadStatus => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Updates the `display_name` and labels of the project identified by the - # specified `name` (for example, `projects/415104041262`). Deleting all - # labels requires an update mask for labels field. - # - # The caller must have `resourcemanager.projects.update` permission for this - # project. - # - # @overload update_project(request, options = nil) - # Pass arguments to `update_project` via a request object, either of type - # {::Google::Cloud::ResourceManager::V3::UpdateProjectRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::ResourceManager::V3::UpdateProjectRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. - # - # @overload update_project(project: nil, update_mask: nil) - # Pass arguments to `update_project` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param project [::Google::Cloud::ResourceManager::V3::Project, ::Hash] - # Required. The new definition of the project. - # @param update_mask [::Google::Protobuf::FieldMask, ::Hash] - # Optional. An update mask to selectively update fields. - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Gapic::Operation] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Gapic::Operation] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/cloud/resource_manager/v3" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::ResourceManager::V3::Projects::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::ResourceManager::V3::UpdateProjectRequest.new - # - # # Call the update_project method. - # result = client.update_project 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_project request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::ResourceManager::V3::UpdateProjectRequest - - # Converts hash and nil to an options object - options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h - - # Customize the options with defaults - metadata = @config.rpcs.update_project.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::ResourceManager::V3::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.project&.name - header_params["project.name"] = request.project.name - end - - request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") - metadata[:"x-goog-request-params"] ||= request_params_header - - options.apply_defaults timeout: @config.rpcs.update_project.timeout, - metadata: metadata, - retry_policy: @config.rpcs.update_project.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @projects_stub.call_rpc :update_project, 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 - - ## - # Move a project to another place in your resource hierarchy, under a new - # resource parent. - # - # Returns an operation which can be used to track the process of the project - # move workflow. - # Upon success, the `Operation.response` field will be populated with the - # moved project. - # - # The caller must have `resourcemanager.projects.move` permission on the - # project, on the project's current and proposed new parent. - # - # If project has no current parent, or it currently does not have an - # associated organization resource, you will also need the - # `resourcemanager.projects.setIamPolicy` permission in the project. - # - # @overload move_project(request, options = nil) - # Pass arguments to `move_project` via a request object, either of type - # {::Google::Cloud::ResourceManager::V3::MoveProjectRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::ResourceManager::V3::MoveProjectRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. - # - # @overload move_project(name: nil, destination_parent: nil) - # Pass arguments to `move_project` via keyword arguments. Note that at - # least one keyword argument is 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 project to move. - # @param destination_parent [::String] - # Required. The new parent to move the Project under. - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Gapic::Operation] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Gapic::Operation] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/cloud/resource_manager/v3" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::ResourceManager::V3::Projects::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::ResourceManager::V3::MoveProjectRequest.new - # - # # Call the move_project method. - # result = client.move_project 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 move_project request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::ResourceManager::V3::MoveProjectRequest - - # Converts hash 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.move_project.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::ResourceManager::V3::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.move_project.timeout, - metadata: metadata, - retry_policy: @config.rpcs.move_project.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @projects_stub.call_rpc :move_project, 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 - - ## - # Marks the project identified by the specified - # `name` (for example, `projects/415104041262`) for deletion. - # - # This method will only affect the project if it has a lifecycle state of - # {::Google::Cloud::ResourceManager::V3::Project::State::ACTIVE ACTIVE}. - # - # This method changes the Project's lifecycle state from - # {::Google::Cloud::ResourceManager::V3::Project::State::ACTIVE ACTIVE} - # to - # {::Google::Cloud::ResourceManager::V3::Project::State::DELETE_REQUESTED DELETE_REQUESTED}. - # The deletion starts at an unspecified time, - # at which point the Project is no longer accessible. - # - # Until the deletion completes, you can check the lifecycle state - # checked by retrieving the project with [GetProject] - # [google.cloud.resourcemanager.v3.Projects.GetProject], - # and the project remains visible to [ListProjects] - # [google.cloud.resourcemanager.v3.Projects.ListProjects]. - # However, you cannot update the project. - # - # After the deletion completes, the project is not retrievable by - # the [GetProject] - # [google.cloud.resourcemanager.v3.Projects.GetProject], - # [ListProjects] - # [google.cloud.resourcemanager.v3.Projects.ListProjects], and - # {::Google::Cloud::ResourceManager::V3::Projects::Client#search_projects SearchProjects} - # methods. - # - # This method behaves idempotently, such that deleting a `DELETE_REQUESTED` - # project will not cause an error, but also won't do anything. - # - # The caller must have `resourcemanager.projects.delete` permissions for this - # project. - # - # @overload delete_project(request, options = nil) - # Pass arguments to `delete_project` via a request object, either of type - # {::Google::Cloud::ResourceManager::V3::DeleteProjectRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::ResourceManager::V3::DeleteProjectRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_project(name: nil) - # Pass arguments to `delete_project` via keyword arguments. Note that at - # least one keyword argument is 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 Project (for example, `projects/415104041262`). - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Gapic::Operation] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Gapic::Operation] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/cloud/resource_manager/v3" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::ResourceManager::V3::Projects::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::ResourceManager::V3::DeleteProjectRequest.new - # - # # Call the delete_project method. - # result = client.delete_project 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_project request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::ResourceManager::V3::DeleteProjectRequest - - # Converts hash 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_project.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::ResourceManager::V3::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_project.timeout, - metadata: metadata, - retry_policy: @config.rpcs.delete_project.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @projects_stub.call_rpc :delete_project, 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 - - ## - # Restores the project identified by the specified - # `name` (for example, `projects/415104041262`). - # You can only use this method for a project that has a lifecycle state of - # [DELETE_REQUESTED] - # [Projects.State.DELETE_REQUESTED]. - # After deletion starts, the project cannot be restored. - # - # The caller must have `resourcemanager.projects.undelete` permission for - # this project. - # - # @overload undelete_project(request, options = nil) - # Pass arguments to `undelete_project` via a request object, either of type - # {::Google::Cloud::ResourceManager::V3::UndeleteProjectRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::ResourceManager::V3::UndeleteProjectRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. - # - # @overload undelete_project(name: nil) - # Pass arguments to `undelete_project` via keyword arguments. Note that at - # least one keyword argument is 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 project (for example, `projects/415104041262`). - # - # Required. - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Gapic::Operation] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Gapic::Operation] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/cloud/resource_manager/v3" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::ResourceManager::V3::Projects::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::ResourceManager::V3::UndeleteProjectRequest.new - # - # # Call the undelete_project method. - # result = client.undelete_project 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 undelete_project request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::ResourceManager::V3::UndeleteProjectRequest - - # Converts hash 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.undelete_project.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::ResourceManager::V3::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.undelete_project.timeout, - metadata: metadata, - retry_policy: @config.rpcs.undelete_project.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @projects_stub.call_rpc :undelete_project, request, options: options do |response, operation| - response = ::Gapic::Operation.new response, @operations_client, options: options - yield response, operation if block_given? - throw :response, response - end - rescue ::GRPC::BadStatus => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Returns the IAM access control policy for the specified project, in the - # format `projects/{ProjectIdOrNumber}` e.g. projects/123. - # Permission is denied if the policy or the resource do not exist. - # - # @overload get_iam_policy(request, options = nil) - # Pass arguments to `get_iam_policy` via a request object, either of type - # {::Google::Iam::V1::GetIamPolicyRequest} or an equivalent Hash. - # - # @param request [::Google::Iam::V1::GetIamPolicyRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. - # - # @overload get_iam_policy(resource: nil, options: nil) - # Pass arguments to `get_iam_policy` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param resource [::String] - # REQUIRED: The resource for which the policy is being requested. - # See the operation documentation for the appropriate value for this field. - # @param options [::Google::Iam::V1::GetPolicyOptions, ::Hash] - # OPTIONAL: A `GetPolicyOptions` object for specifying options to - # `GetIamPolicy`. - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Google::Iam::V1::Policy] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Google::Iam::V1::Policy] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/cloud/resource_manager/v3" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::ResourceManager::V3::Projects::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Iam::V1::GetIamPolicyRequest.new - # - # # Call the get_iam_policy method. - # result = client.get_iam_policy request - # - # # The returned object is of type Google::Iam::V1::Policy. - # p result - # - def get_iam_policy request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Iam::V1::GetIamPolicyRequest - - # Converts hash and nil to an options object - options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h - - # Customize the options with defaults - metadata = @config.rpcs.get_iam_policy.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::ResourceManager::V3::VERSION - metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - header_params = {} - if request.resource - header_params["resource"] = request.resource - end - - request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") - metadata[:"x-goog-request-params"] ||= request_params_header - - options.apply_defaults timeout: @config.rpcs.get_iam_policy.timeout, - metadata: metadata, - retry_policy: @config.rpcs.get_iam_policy.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @projects_stub.call_rpc :get_iam_policy, request, options: options do |response, operation| - yield response, operation if block_given? - end - rescue ::GRPC::BadStatus => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Sets the IAM access control policy for the specified project, in the - # format `projects/{ProjectIdOrNumber}` e.g. projects/123. - # - # CAUTION: This method will replace the existing policy, and cannot be used - # to append additional IAM settings. - # - # Note: Removing service accounts from policies or changing their roles can - # render services completely inoperable. It is important to understand how - # the service account is being used before removing or updating its roles. - # - # The following constraints apply when using `setIamPolicy()`: - # - # + Project does not support `allUsers` and `allAuthenticatedUsers` as - # `members` in a `Binding` of a `Policy`. - # - # + The owner role can be granted to a `user`, `serviceAccount`, or a group - # that is part of an organization. For example, - # group@myownpersonaldomain.com could be added as an owner to a project in - # the myownpersonaldomain.com organization, but not the examplepetstore.com - # organization. - # - # + Service accounts can be made owners of a project directly - # without any restrictions. However, to be added as an owner, a user must be - # invited using the Cloud Platform console and must accept the invitation. - # - # + A user cannot be granted the owner role using `setIamPolicy()`. The user - # must be granted the owner role using the Cloud Platform Console and must - # explicitly accept the invitation. - # - # + Invitations to grant the owner role cannot be sent using - # `setIamPolicy()`; - # they must be sent only using the Cloud Platform Console. - # - # + If the project is not part of an organization, there must be at least - # one owner who has accepted the Terms of Service (ToS) agreement in the - # policy. Calling `setIamPolicy()` to remove the last ToS-accepted owner - # from the policy will fail. This restriction also applies to legacy - # projects that no longer have owners who have accepted the ToS. Edits to - # IAM policies will be rejected until the lack of a ToS-accepting owner is - # rectified. If the project is part of an organization, you can remove all - # owners, potentially making the organization inaccessible. - # - # @overload set_iam_policy(request, options = nil) - # Pass arguments to `set_iam_policy` via a request object, either of type - # {::Google::Iam::V1::SetIamPolicyRequest} or an equivalent Hash. - # - # @param request [::Google::Iam::V1::SetIamPolicyRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. - # - # @overload set_iam_policy(resource: nil, policy: nil, update_mask: nil) - # Pass arguments to `set_iam_policy` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param resource [::String] - # REQUIRED: The resource for which the policy is being specified. - # See the operation documentation for the appropriate value for this field. - # @param policy [::Google::Iam::V1::Policy, ::Hash] - # REQUIRED: The complete policy to be applied to the `resource`. The size of - # the policy is limited to a few 10s of KB. An empty policy is a - # valid policy but certain Cloud Platform services (such as Projects) - # might reject them. - # @param update_mask [::Google::Protobuf::FieldMask, ::Hash] - # OPTIONAL: A FieldMask specifying which fields of the policy to modify. Only - # the fields in the mask will be modified. If no mask is provided, the - # following default mask is used: - # - # `paths: "bindings, etag"` - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Google::Iam::V1::Policy] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Google::Iam::V1::Policy] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/cloud/resource_manager/v3" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::ResourceManager::V3::Projects::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Iam::V1::SetIamPolicyRequest.new - # - # # Call the set_iam_policy method. - # result = client.set_iam_policy request - # - # # The returned object is of type Google::Iam::V1::Policy. - # p result - # - def set_iam_policy request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Iam::V1::SetIamPolicyRequest - - # Converts hash and nil to an options object - options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h - - # Customize the options with defaults - metadata = @config.rpcs.set_iam_policy.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::ResourceManager::V3::VERSION - metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - header_params = {} - if request.resource - header_params["resource"] = request.resource - end - - request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") - metadata[:"x-goog-request-params"] ||= request_params_header - - options.apply_defaults timeout: @config.rpcs.set_iam_policy.timeout, - metadata: metadata, - retry_policy: @config.rpcs.set_iam_policy.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @projects_stub.call_rpc :set_iam_policy, request, options: options do |response, operation| - yield response, operation if block_given? - end - rescue ::GRPC::BadStatus => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Returns permissions that a caller has on the specified project, in the - # format `projects/{ProjectIdOrNumber}` e.g. projects/123.. - # - # @overload test_iam_permissions(request, options = nil) - # Pass arguments to `test_iam_permissions` via a request object, either of type - # {::Google::Iam::V1::TestIamPermissionsRequest} or an equivalent Hash. - # - # @param request [::Google::Iam::V1::TestIamPermissionsRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. - # - # @overload test_iam_permissions(resource: nil, permissions: nil) - # Pass arguments to `test_iam_permissions` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param resource [::String] - # REQUIRED: The resource for which the policy detail is being requested. - # See the operation documentation for the appropriate value for this field. - # @param permissions [::Array<::String>] - # The set of permissions to check for the `resource`. Permissions with - # wildcards (such as '*' or 'storage.*') are not allowed. For more - # information see - # [IAM Overview](https://cloud.google.com/iam/docs/overview#permissions). - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Google::Iam::V1::TestIamPermissionsResponse] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Google::Iam::V1::TestIamPermissionsResponse] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/cloud/resource_manager/v3" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::ResourceManager::V3::Projects::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Iam::V1::TestIamPermissionsRequest.new - # - # # Call the test_iam_permissions method. - # result = client.test_iam_permissions request - # - # # The returned object is of type Google::Iam::V1::TestIamPermissionsResponse. - # p result - # - def test_iam_permissions request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Iam::V1::TestIamPermissionsRequest - - # Converts hash and nil to an options object - options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h - - # Customize the options with defaults - metadata = @config.rpcs.test_iam_permissions.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::ResourceManager::V3::VERSION - metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - header_params = {} - if request.resource - header_params["resource"] = request.resource - end - - request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") - metadata[:"x-goog-request-params"] ||= request_params_header - - options.apply_defaults timeout: @config.rpcs.test_iam_permissions.timeout, - metadata: metadata, - retry_policy: @config.rpcs.test_iam_permissions.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @projects_stub.call_rpc :test_iam_permissions, request, options: options do |response, operation| - yield response, operation if block_given? - end - rescue ::GRPC::BadStatus => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Configuration class for the Projects API. - # - # This class represents the configuration for Projects, - # providing control over timeouts, retry behavior, logging, transport - # parameters, and other low-level controls. Certain parameters can also be - # applied individually to specific RPCs. See - # {::Google::Cloud::ResourceManager::V3::Projects::Client::Configuration::Rpcs} - # for a list of RPCs that can be configured independently. - # - # Configuration can be applied globally to all clients, or to a single client - # on construction. - # - # @example - # - # # Modify the global config, setting the timeout for - # # get_project to 20 seconds, - # # and all remaining timeouts to 10 seconds. - # ::Google::Cloud::ResourceManager::V3::Projects::Client.configure do |config| - # config.timeout = 10.0 - # config.rpcs.get_project.timeout = 20.0 - # end - # - # # Apply the above configuration only to a new client. - # client = ::Google::Cloud::ResourceManager::V3::Projects::Client.new do |config| - # config.timeout = 10.0 - # config.rpcs.get_project.timeout = 20.0 - # end - # - # @!attribute [rw] endpoint - # A custom service endpoint, as a hostname or hostname:port. The default is - # nil, indicating to use the default endpoint in the current universe domain. - # @return [::String,nil] - # @!attribute [rw] credentials - # Credentials to send with calls. You may provide any of the following types: - # * (`Google::Auth::Credentials`) A googleauth credentials object - # (see the [googleauth docs](https://rubydoc.info/gems/googleauth/Google/Auth/Credentials)) - # * (`Signet::OAuth2::Client`) A signet oauth2 client object - # (see the [signet docs](https://rubydoc.info/gems/signet/Signet/OAuth2/Client)) - # * (`GRPC::Core::Channel`) a gRPC channel with included credentials - # * (`GRPC::Core::ChannelCredentials`) a gRPC credentails object - # * (`nil`) indicating no credentials - # - # @note Warning: Passing a `String` to a keyfile path or a `Hash` of credentials - # is deprecated. Providing an unvalidated credential configuration to - # Google APIs can compromise the security of your systems and data. - # - # @example - # - # # The recommended way to provide credentials is to use the `make_creds` method - # # on the appropriate credentials class for your environment. - # - # require "googleauth" - # - # credentials = ::Google::Auth::ServiceAccountCredentials.make_creds( - # json_key_io: ::File.open("/path/to/keyfile.json") - # ) - # - # client = ::Google::Cloud::ResourceManager::V3::Projects::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 = "cloudresourcemanager.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 Projects 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 `get_project` - # @return [::Gapic::Config::Method] - # - attr_reader :get_project - ## - # RPC-specific configuration for `list_projects` - # @return [::Gapic::Config::Method] - # - attr_reader :list_projects - ## - # RPC-specific configuration for `search_projects` - # @return [::Gapic::Config::Method] - # - attr_reader :search_projects - ## - # RPC-specific configuration for `create_project` - # @return [::Gapic::Config::Method] - # - attr_reader :create_project - ## - # RPC-specific configuration for `update_project` - # @return [::Gapic::Config::Method] - # - attr_reader :update_project - ## - # RPC-specific configuration for `move_project` - # @return [::Gapic::Config::Method] - # - attr_reader :move_project - ## - # RPC-specific configuration for `delete_project` - # @return [::Gapic::Config::Method] - # - attr_reader :delete_project - ## - # RPC-specific configuration for `undelete_project` - # @return [::Gapic::Config::Method] - # - attr_reader :undelete_project - ## - # RPC-specific configuration for `get_iam_policy` - # @return [::Gapic::Config::Method] - # - attr_reader :get_iam_policy - ## - # RPC-specific configuration for `set_iam_policy` - # @return [::Gapic::Config::Method] - # - attr_reader :set_iam_policy - ## - # RPC-specific configuration for `test_iam_permissions` - # @return [::Gapic::Config::Method] - # - attr_reader :test_iam_permissions - - # @private - def initialize parent_rpcs = nil - get_project_config = parent_rpcs.get_project if parent_rpcs.respond_to? :get_project - @get_project = ::Gapic::Config::Method.new get_project_config - list_projects_config = parent_rpcs.list_projects if parent_rpcs.respond_to? :list_projects - @list_projects = ::Gapic::Config::Method.new list_projects_config - search_projects_config = parent_rpcs.search_projects if parent_rpcs.respond_to? :search_projects - @search_projects = ::Gapic::Config::Method.new search_projects_config - create_project_config = parent_rpcs.create_project if parent_rpcs.respond_to? :create_project - @create_project = ::Gapic::Config::Method.new create_project_config - update_project_config = parent_rpcs.update_project if parent_rpcs.respond_to? :update_project - @update_project = ::Gapic::Config::Method.new update_project_config - move_project_config = parent_rpcs.move_project if parent_rpcs.respond_to? :move_project - @move_project = ::Gapic::Config::Method.new move_project_config - delete_project_config = parent_rpcs.delete_project if parent_rpcs.respond_to? :delete_project - @delete_project = ::Gapic::Config::Method.new delete_project_config - undelete_project_config = parent_rpcs.undelete_project if parent_rpcs.respond_to? :undelete_project - @undelete_project = ::Gapic::Config::Method.new undelete_project_config - get_iam_policy_config = parent_rpcs.get_iam_policy if parent_rpcs.respond_to? :get_iam_policy - @get_iam_policy = ::Gapic::Config::Method.new get_iam_policy_config - set_iam_policy_config = parent_rpcs.set_iam_policy if parent_rpcs.respond_to? :set_iam_policy - @set_iam_policy = ::Gapic::Config::Method.new set_iam_policy_config - test_iam_permissions_config = parent_rpcs.test_iam_permissions if parent_rpcs.respond_to? :test_iam_permissions - @test_iam_permissions = ::Gapic::Config::Method.new test_iam_permissions_config - - yield self if block_given? - end - end - end - end - end - end - end - end -end diff --git a/owl-bot-staging/google-cloud-resource_manager-v3/lib/google/cloud/resource_manager/v3/projects/credentials.rb b/owl-bot-staging/google-cloud-resource_manager-v3/lib/google/cloud/resource_manager/v3/projects/credentials.rb deleted file mode 100644 index b6b0e69ef9fd..000000000000 --- a/owl-bot-staging/google-cloud-resource_manager-v3/lib/google/cloud/resource_manager/v3/projects/credentials.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 "googleauth" - -module Google - module Cloud - module ResourceManager - module V3 - module Projects - # Credentials for the Projects API. - class Credentials < ::Google::Auth::Credentials - self.scope = [ - "https://www.googleapis.com/auth/cloud-platform", - "https://www.googleapis.com/auth/cloud-platform.read-only" - ] - self.env_vars = [ - "RESOURCE_MANAGER_CREDENTIALS", - "RESOURCE_MANAGER_KEYFILE", - "GOOGLE_CLOUD_CREDENTIALS", - "GOOGLE_CLOUD_KEYFILE", - "GCLOUD_KEYFILE", - "RESOURCE_MANAGER_CREDENTIALS_JSON", - "RESOURCE_MANAGER_KEYFILE_JSON", - "GOOGLE_CLOUD_CREDENTIALS_JSON", - "GOOGLE_CLOUD_KEYFILE_JSON", - "GCLOUD_KEYFILE_JSON" - ] - self.paths = [ - "~/.config/google_cloud/application_default_credentials.json" - ] - end - end - end - end - end -end diff --git a/owl-bot-staging/google-cloud-resource_manager-v3/lib/google/cloud/resource_manager/v3/projects/operations.rb b/owl-bot-staging/google-cloud-resource_manager-v3/lib/google/cloud/resource_manager/v3/projects/operations.rb deleted file mode 100644 index 2e803eae5742..000000000000 --- a/owl-bot-staging/google-cloud-resource_manager-v3/lib/google/cloud/resource_manager/v3/projects/operations.rb +++ /dev/null @@ -1,841 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -require "gapic/operation" -require "google/longrunning/operations_pb" - -module Google - module Cloud - module ResourceManager - module V3 - module Projects - # Service that implements Longrunning Operations API. - class Operations - # @private - API_VERSION = "" - - # @private - DEFAULT_ENDPOINT_TEMPLATE = "cloudresourcemanager.$UNIVERSE_DOMAIN$" - - # @private - attr_reader :operations_stub - - ## - # Configuration for the Projects 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 Projects 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::ResourceManager::V3::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::ResourceManager::V3::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::ResourceManager::V3::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::ResourceManager::V3::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::ResourceManager::V3::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 = "cloudresourcemanager.googleapis.com" - - config_attr :endpoint, nil, ::String, nil - config_attr :credentials, nil do |value| - allowed = [::String, ::Hash, ::Proc, ::Symbol, ::Google::Auth::Credentials, ::Google::Auth::BaseClient, ::Signet::OAuth2::Client, nil] - allowed += [::GRPC::Core::Channel, ::GRPC::Core::ChannelCredentials] if defined? ::GRPC::Core::Channel - allowed.any? { |klass| klass === value } - end - config_attr :scope, nil, ::String, ::Array, nil - config_attr :lib_name, nil, ::String, nil - config_attr :lib_version, nil, ::String, nil - config_attr(:channel_args, { "grpc.service_config_disable_resolution" => 1 }, ::Hash, nil) - config_attr :interceptors, nil, ::Array, nil - config_attr :timeout, nil, ::Numeric, nil - config_attr :metadata, nil, ::Hash, nil - config_attr :retry_policy, nil, ::Hash, ::Proc, nil - config_attr :quota_project, nil, ::String, nil - config_attr :universe_domain, nil, ::String, nil - config_attr :logger, :default, ::Logger, nil, :default - - # @private - def initialize parent_config = nil - @parent_config = parent_config unless parent_config.nil? - - yield self if block_given? - end - - ## - # Configurations for individual RPCs - # @return [Rpcs] - # - def rpcs - @rpcs ||= begin - parent_rpcs = nil - parent_rpcs = @parent_config.rpcs if defined?(@parent_config) && @parent_config.respond_to?(:rpcs) - Rpcs.new parent_rpcs - end - end - - ## - # Configuration for the channel pool - # @return [::Gapic::ServiceStub::ChannelPool::Configuration] - # - def channel_pool - @channel_pool ||= ::Gapic::ServiceStub::ChannelPool::Configuration.new - end - - ## - # Configuration RPC class for the Operations API. - # - # Includes fields providing the configuration for each RPC in this service. - # Each configuration object is of type `Gapic::Config::Method` and includes - # the following configuration fields: - # - # * `timeout` (*type:* `Numeric`) - The call timeout in seconds - # * `metadata` (*type:* `Hash{Symbol=>String}`) - Additional gRPC headers - # * `retry_policy (*type:* `Hash`) - The retry policy. The policy fields - # include the following keys: - # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds. - # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds. - # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier. - # * `:retry_codes` (*type:* `Array`) - The error codes that should - # trigger a retry. - # - class Rpcs - ## - # RPC-specific configuration for `list_operations` - # @return [::Gapic::Config::Method] - # - attr_reader :list_operations - ## - # RPC-specific configuration for `get_operation` - # @return [::Gapic::Config::Method] - # - attr_reader :get_operation - ## - # RPC-specific configuration for `delete_operation` - # @return [::Gapic::Config::Method] - # - attr_reader :delete_operation - ## - # RPC-specific configuration for `cancel_operation` - # @return [::Gapic::Config::Method] - # - attr_reader :cancel_operation - ## - # RPC-specific configuration for `wait_operation` - # @return [::Gapic::Config::Method] - # - attr_reader :wait_operation - - # @private - def initialize parent_rpcs = nil - list_operations_config = parent_rpcs.list_operations if parent_rpcs.respond_to? :list_operations - @list_operations = ::Gapic::Config::Method.new list_operations_config - get_operation_config = parent_rpcs.get_operation if parent_rpcs.respond_to? :get_operation - @get_operation = ::Gapic::Config::Method.new get_operation_config - delete_operation_config = parent_rpcs.delete_operation if parent_rpcs.respond_to? :delete_operation - @delete_operation = ::Gapic::Config::Method.new delete_operation_config - cancel_operation_config = parent_rpcs.cancel_operation if parent_rpcs.respond_to? :cancel_operation - @cancel_operation = ::Gapic::Config::Method.new cancel_operation_config - wait_operation_config = parent_rpcs.wait_operation if parent_rpcs.respond_to? :wait_operation - @wait_operation = ::Gapic::Config::Method.new wait_operation_config - - yield self if block_given? - end - end - end - end - end - end - end - end -end diff --git a/owl-bot-staging/google-cloud-resource_manager-v3/lib/google/cloud/resource_manager/v3/projects/paths.rb b/owl-bot-staging/google-cloud-resource_manager-v3/lib/google/cloud/resource_manager/v3/projects/paths.rb deleted file mode 100644 index d5bfba4cb1c3..000000000000 --- a/owl-bot-staging/google-cloud-resource_manager-v3/lib/google/cloud/resource_manager/v3/projects/paths.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! - - -module Google - module Cloud - module ResourceManager - module V3 - module Projects - # Path helper methods for the Projects API. - module Paths - ## - # Create a fully-qualified Project resource string. - # - # The resource will be in the following format: - # - # `projects/{project}` - # - # @param project [String] - # - # @return [::String] - def project_path project: - "projects/#{project}" - end - - extend self - end - end - end - end - end -end diff --git a/owl-bot-staging/google-cloud-resource_manager-v3/lib/google/cloud/resource_manager/v3/projects/rest.rb b/owl-bot-staging/google-cloud-resource_manager-v3/lib/google/cloud/resource_manager/v3/projects/rest.rb deleted file mode 100644 index a3b1ccf2f322..000000000000 --- a/owl-bot-staging/google-cloud-resource_manager-v3/lib/google/cloud/resource_manager/v3/projects/rest.rb +++ /dev/null @@ -1,53 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -require "gapic/rest" -require "gapic/config" -require "gapic/config/method" - -require "google/cloud/resource_manager/v3/version" - -require "google/cloud/resource_manager/v3/projects/credentials" -require "google/cloud/resource_manager/v3/projects/paths" -require "google/cloud/resource_manager/v3/projects/rest/operations" -require "google/cloud/resource_manager/v3/projects/rest/client" - -module Google - module Cloud - module ResourceManager - module V3 - ## - # Manages Google Cloud Projects. - # - # To load this service and instantiate a REST client: - # - # require "google/cloud/resource_manager/v3/projects/rest" - # client = ::Google::Cloud::ResourceManager::V3::Projects::Rest::Client.new - # - module Projects - # Client for the REST transport - module Rest - end - end - end - end - end -end - -helper_path = ::File.join __dir__, "rest", "helpers.rb" -require "google/cloud/resource_manager/v3/projects/rest/helpers" if ::File.file? helper_path diff --git a/owl-bot-staging/google-cloud-resource_manager-v3/lib/google/cloud/resource_manager/v3/projects/rest/client.rb b/owl-bot-staging/google-cloud-resource_manager-v3/lib/google/cloud/resource_manager/v3/projects/rest/client.rb deleted file mode 100644 index 6bda27ce384f..000000000000 --- a/owl-bot-staging/google-cloud-resource_manager-v3/lib/google/cloud/resource_manager/v3/projects/rest/client.rb +++ /dev/null @@ -1,1589 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -require "google/cloud/errors" -require "google/cloud/resourcemanager/v3/projects_pb" -require "google/cloud/resource_manager/v3/projects/rest/service_stub" - -module Google - module Cloud - module ResourceManager - module V3 - module Projects - module Rest - ## - # REST client for the Projects service. - # - # Manages Google Cloud Projects. - # - class Client - # @private - API_VERSION = "" - - # @private - DEFAULT_ENDPOINT_TEMPLATE = "cloudresourcemanager.$UNIVERSE_DOMAIN$" - - include Paths - - # @private - attr_reader :projects_stub - - ## - # Configure the Projects Client class. - # - # See {::Google::Cloud::ResourceManager::V3::Projects::Rest::Client::Configuration} - # for a description of the configuration fields. - # - # @example - # - # # Modify the configuration for all Projects clients - # ::Google::Cloud::ResourceManager::V3::Projects::Rest::Client.configure do |config| - # config.timeout = 10.0 - # end - # - # @yield [config] Configure the Client client. - # @yieldparam config [Client::Configuration] - # - # @return [Client::Configuration] - # - def self.configure - @configure ||= begin - namespace = ["Google", "Cloud", "ResourceManager", "V3"] - 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.get_project.timeout = 60.0 - default_config.rpcs.get_project.retry_policy = { - initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [14] - } - - default_config.rpcs.list_projects.timeout = 60.0 - default_config.rpcs.list_projects.retry_policy = { - initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [14] - } - - default_config.rpcs.search_projects.timeout = 60.0 - - default_config.rpcs.create_project.timeout = 60.0 - - default_config.rpcs.update_project.timeout = 60.0 - - default_config.rpcs.move_project.timeout = 60.0 - - default_config.rpcs.delete_project.timeout = 60.0 - - default_config.rpcs.undelete_project.timeout = 60.0 - - default_config.rpcs.get_iam_policy.timeout = 60.0 - default_config.rpcs.get_iam_policy.retry_policy = { - initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [14] - } - - default_config.rpcs.set_iam_policy.timeout = 60.0 - - default_config - end - yield @configure if block_given? - @configure - end - - ## - # Configure the Projects Client instance. - # - # The configuration is set to the derived mode, meaning that values can be changed, - # but structural changes (adding new fields, etc.) are not allowed. Structural changes - # should be made on {Client.configure}. - # - # See {::Google::Cloud::ResourceManager::V3::Projects::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 - @projects_stub.universe_domain - end - - ## - # Create a new Projects REST client object. - # - # @example - # - # # Create a client using the default configuration - # client = ::Google::Cloud::ResourceManager::V3::Projects::Rest::Client.new - # - # # Create a client using a custom configuration - # client = ::Google::Cloud::ResourceManager::V3::Projects::Rest::Client.new do |config| - # config.timeout = 10.0 - # end - # - # @yield [config] Configure the Projects client. - # @yieldparam config [Client::Configuration] - # - def initialize - # Create the configuration object - @config = Configuration.new Client.configure - - # Yield the configuration if needed - yield @config if block_given? - - # Create credentials - credentials = @config.credentials - # Use self-signed JWT if the endpoint is unchanged from default, - # but only if the default endpoint does not have a region prefix. - enable_self_signed_jwt = @config.endpoint.nil? || - (@config.endpoint == Configuration::DEFAULT_ENDPOINT && - !@config.endpoint.split(".").first.include?("-")) - credentials ||= Credentials.default scope: @config.scope, - enable_self_signed_jwt: enable_self_signed_jwt - if credentials.is_a?(::String) || credentials.is_a?(::Hash) - credentials = Credentials.new credentials, scope: @config.scope - end - - @quota_project_id = @config.quota_project - @quota_project_id ||= credentials.quota_project_id if credentials.respond_to? :quota_project_id - - @operations_client = ::Google::Cloud::ResourceManager::V3::Projects::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 - - @projects_stub = ::Google::Cloud::ResourceManager::V3::Projects::Rest::ServiceStub.new( - endpoint: @config.endpoint, - endpoint_template: DEFAULT_ENDPOINT_TEMPLATE, - universe_domain: @config.universe_domain, - credentials: credentials, - logger: @config.logger - ) - - @projects_stub.logger(stub: true)&.info do |entry| - entry.set_system_name - entry.set_service - entry.message = "Created client for #{entry.service}" - entry.set_credentials_fields credentials - entry.set "customEndpoint", @config.endpoint if @config.endpoint - entry.set "defaultTimeout", @config.timeout if @config.timeout - entry.set "quotaProject", @quota_project_id if @quota_project_id - end - end - - ## - # Get the associated client for long-running operations. - # - # @return [::Google::Cloud::ResourceManager::V3::Projects::Rest::Operations] - # - attr_reader :operations_client - - ## - # The logger used for request/response debug logging. - # - # @return [Logger] - # - def logger - @projects_stub.logger - end - - # Service calls - - ## - # Retrieves the project identified by the specified `name` (for example, - # `projects/415104041262`). - # - # The caller must have `resourcemanager.projects.get` permission - # for this project. - # - # @overload get_project(request, options = nil) - # Pass arguments to `get_project` via a request object, either of type - # {::Google::Cloud::ResourceManager::V3::GetProjectRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::ResourceManager::V3::GetProjectRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @overload get_project(name: nil) - # Pass arguments to `get_project` via keyword arguments. Note that at - # least one keyword argument is 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 project (for example, `projects/415104041262`). - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Cloud::ResourceManager::V3::Project] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::ResourceManager::V3::Project] - # - # @raise [::Google::Cloud::Error] if the REST call is aborted. - # - # @example Basic example - # require "google/cloud/resource_manager/v3" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::ResourceManager::V3::Projects::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::ResourceManager::V3::GetProjectRequest.new - # - # # Call the get_project method. - # result = client.get_project request - # - # # The returned object is of type Google::Cloud::ResourceManager::V3::Project. - # p result - # - def get_project request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::ResourceManager::V3::GetProjectRequest - - # Converts hash and nil to an options object - options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h - - # Customize the options with defaults - call_metadata = @config.rpcs.get_project.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::ResourceManager::V3::VERSION, - transports_version_send: [:rest] - - call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - options.apply_defaults timeout: @config.rpcs.get_project.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.get_project.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @projects_stub.get_project request, options do |result, operation| - yield result, operation if block_given? - end - rescue ::Gapic::Rest::Error => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Lists projects that are direct children of the specified folder or - # organization resource. `list()` provides a strongly consistent view of the - # projects underneath the specified parent resource. `list()` returns - # projects sorted based upon the (ascending) lexical ordering of their - # `display_name`. The caller must have `resourcemanager.projects.list` - # permission on the identified parent. - # - # @overload list_projects(request, options = nil) - # Pass arguments to `list_projects` via a request object, either of type - # {::Google::Cloud::ResourceManager::V3::ListProjectsRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::ResourceManager::V3::ListProjectsRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_projects(parent: nil, page_token: nil, page_size: nil, show_deleted: nil) - # Pass arguments to `list_projects` via keyword arguments. Note that at - # least one keyword argument is 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 name of the parent resource whose projects are being listed. - # Only children of this parent resource are listed; descendants are not - # listed. - # - # If the parent is a folder, use the value `folders/{folder_id}`. If the - # parent is an organization, use the value `organizations/{org_id}`. - # @param page_token [::String] - # Optional. A pagination token returned from a previous call to - # [ListProjects] [google.cloud.resourcemanager.v3.Projects.ListProjects] that - # indicates from where listing should continue. - # @param page_size [::Integer] - # Optional. The maximum number of projects to return in the response. - # The server can return fewer projects than requested. - # If unspecified, server picks an appropriate default. - # @param show_deleted [::Boolean] - # Optional. Indicate that projects in the `DELETE_REQUESTED` state should - # also be returned. Normally only `ACTIVE` projects are returned. - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Gapic::Rest::PagedEnumerable<::Google::Cloud::ResourceManager::V3::Project>] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Gapic::Rest::PagedEnumerable<::Google::Cloud::ResourceManager::V3::Project>] - # - # @raise [::Google::Cloud::Error] if the REST call is aborted. - # - # @example Basic example - # require "google/cloud/resource_manager/v3" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::ResourceManager::V3::Projects::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::ResourceManager::V3::ListProjectsRequest.new - # - # # Call the list_projects method. - # result = client.list_projects request - # - # # The returned object is of type Gapic::PagedEnumerable. You can iterate - # # over elements, and API calls will be issued to fetch pages as needed. - # result.each do |item| - # # Each element is of type ::Google::Cloud::ResourceManager::V3::Project. - # p item - # end - # - def list_projects request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::ResourceManager::V3::ListProjectsRequest - - # Converts hash 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_projects.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::ResourceManager::V3::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_projects.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.list_projects.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @projects_stub.list_projects request, options do |result, operation| - result = ::Gapic::Rest::PagedEnumerable.new @projects_stub, :list_projects, "projects", 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 for projects that the caller has both `resourcemanager.projects.get` - # permission on, and also satisfy the specified query. - # - # This method returns projects in an unspecified order. - # - # This method is eventually consistent with project mutations; this means - # that a newly created project may not appear in the results or recent - # updates to an existing project may not be reflected in the results. To - # retrieve the latest state of a project, use the - # {::Google::Cloud::ResourceManager::V3::Projects::Rest::Client#get_project GetProject} method. - # - # @overload search_projects(request, options = nil) - # Pass arguments to `search_projects` via a request object, either of type - # {::Google::Cloud::ResourceManager::V3::SearchProjectsRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::ResourceManager::V3::SearchProjectsRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_projects(query: nil, page_token: nil, page_size: nil) - # Pass arguments to `search_projects` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param query [::String] - # Optional. A query string for searching for projects that the caller has - # `resourcemanager.projects.get` permission to. If multiple fields are - # included in the query, then it will return results that match any of the - # fields. Some eligible fields are: - # - # - **`displayName`, `name`**: Filters by displayName. - # - **`parent`**: Project's parent (for example: `folders/123`, - # `organizations/*`). Prefer `parent` field over `parent.type` and - # `parent.id`. - # - **`parent.type`**: Parent's type: `folder` or `organization`. - # - **`parent.id`**: Parent's id number (for example: `123`). - # - **`id`, `projectId`**: Filters by projectId. - # - **`state`, `lifecycleState`**: Filters by state. - # - **`labels`**: Filters by label name or value. - # - **`labels.` (where `` is the name of a label)**: Filters by label - # name. - # - # Search expressions are case insensitive. - # - # Some examples queries: - # - # - # - **`name:how*`**: The project's name starts with "how". - # - **`name:Howl`**: The project's name is `Howl` or `howl`. - # - **`name:HOWL`**: Equivalent to above. - # - **`NAME:howl`**: Equivalent to above. - # - **`labels.color:*`**: The project has the label `color`. - # - **`labels.color:red`**: The project's label `color` has the value `red`. - # - **`labels.color:red labels.size:big`**: The project's label `color` has - # the value `red` or its label `size` has the value `big`. - # - # If no query is specified, the call will return projects for which the user - # has the `resourcemanager.projects.get` permission. - # @param page_token [::String] - # Optional. A pagination token returned from a previous call to - # [ListProjects] [google.cloud.resourcemanager.v3.Projects.ListProjects] that - # indicates from where listing should continue. - # @param page_size [::Integer] - # Optional. The maximum number of projects to return in the response. - # The server can return fewer projects than requested. - # If unspecified, server picks an appropriate default. - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Gapic::Rest::PagedEnumerable<::Google::Cloud::ResourceManager::V3::Project>] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Gapic::Rest::PagedEnumerable<::Google::Cloud::ResourceManager::V3::Project>] - # - # @raise [::Google::Cloud::Error] if the REST call is aborted. - # - # @example Basic example - # require "google/cloud/resource_manager/v3" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::ResourceManager::V3::Projects::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::ResourceManager::V3::SearchProjectsRequest.new - # - # # Call the search_projects method. - # result = client.search_projects request - # - # # The returned object is of type Gapic::PagedEnumerable. You can iterate - # # over elements, and API calls will be issued to fetch pages as needed. - # result.each do |item| - # # Each element is of type ::Google::Cloud::ResourceManager::V3::Project. - # p item - # end - # - def search_projects request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::ResourceManager::V3::SearchProjectsRequest - - # Converts hash 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_projects.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::ResourceManager::V3::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_projects.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.search_projects.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @projects_stub.search_projects request, options do |result, operation| - result = ::Gapic::Rest::PagedEnumerable.new @projects_stub, :search_projects, "projects", 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 - - ## - # Request that a new project be created. The result is an `Operation` which - # can be used to track the creation process. This process usually takes a few - # seconds, but can sometimes take much longer. The tracking `Operation` is - # automatically deleted after a few hours, so there is no need to call - # `DeleteOperation`. - # - # @overload create_project(request, options = nil) - # Pass arguments to `create_project` via a request object, either of type - # {::Google::Cloud::ResourceManager::V3::CreateProjectRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::ResourceManager::V3::CreateProjectRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_project(project: nil) - # Pass arguments to `create_project` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param project [::Google::Cloud::ResourceManager::V3::Project, ::Hash] - # Required. The Project to create. - # - # Project ID is required. If the requested ID is unavailable, the request - # fails. - # - # If the `parent` field is set, the `resourcemanager.projects.create` - # permission is checked on the parent resource. If no parent is set and - # the authorization credentials belong to an Organization, the parent - # will be set to that Organization. - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Gapic::Operation] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Gapic::Operation] - # - # @raise [::Google::Cloud::Error] if the REST call is aborted. - # - # @example Basic example - # require "google/cloud/resource_manager/v3" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::ResourceManager::V3::Projects::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::ResourceManager::V3::CreateProjectRequest.new - # - # # Call the create_project method. - # result = client.create_project 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_project request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::ResourceManager::V3::CreateProjectRequest - - # Converts hash 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_project.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::ResourceManager::V3::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_project.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.create_project.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @projects_stub.create_project 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 - - ## - # Updates the `display_name` and labels of the project identified by the - # specified `name` (for example, `projects/415104041262`). Deleting all - # labels requires an update mask for labels field. - # - # The caller must have `resourcemanager.projects.update` permission for this - # project. - # - # @overload update_project(request, options = nil) - # Pass arguments to `update_project` via a request object, either of type - # {::Google::Cloud::ResourceManager::V3::UpdateProjectRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::ResourceManager::V3::UpdateProjectRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @overload update_project(project: nil, update_mask: nil) - # Pass arguments to `update_project` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param project [::Google::Cloud::ResourceManager::V3::Project, ::Hash] - # Required. The new definition of the project. - # @param update_mask [::Google::Protobuf::FieldMask, ::Hash] - # Optional. An update mask to selectively update fields. - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Gapic::Operation] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Gapic::Operation] - # - # @raise [::Google::Cloud::Error] if the REST call is aborted. - # - # @example Basic example - # require "google/cloud/resource_manager/v3" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::ResourceManager::V3::Projects::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::ResourceManager::V3::UpdateProjectRequest.new - # - # # Call the update_project method. - # result = client.update_project 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_project request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::ResourceManager::V3::UpdateProjectRequest - - # Converts hash and nil to an options object - options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h - - # Customize the options with defaults - call_metadata = @config.rpcs.update_project.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::ResourceManager::V3::VERSION, - transports_version_send: [:rest] - - call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - options.apply_defaults timeout: @config.rpcs.update_project.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.update_project.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @projects_stub.update_project 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 - - ## - # Move a project to another place in your resource hierarchy, under a new - # resource parent. - # - # Returns an operation which can be used to track the process of the project - # move workflow. - # Upon success, the `Operation.response` field will be populated with the - # moved project. - # - # The caller must have `resourcemanager.projects.move` permission on the - # project, on the project's current and proposed new parent. - # - # If project has no current parent, or it currently does not have an - # associated organization resource, you will also need the - # `resourcemanager.projects.setIamPolicy` permission in the project. - # - # @overload move_project(request, options = nil) - # Pass arguments to `move_project` via a request object, either of type - # {::Google::Cloud::ResourceManager::V3::MoveProjectRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::ResourceManager::V3::MoveProjectRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @overload move_project(name: nil, destination_parent: nil) - # Pass arguments to `move_project` via keyword arguments. Note that at - # least one keyword argument is 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 project to move. - # @param destination_parent [::String] - # Required. The new parent to move the Project under. - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Gapic::Operation] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Gapic::Operation] - # - # @raise [::Google::Cloud::Error] if the REST call is aborted. - # - # @example Basic example - # require "google/cloud/resource_manager/v3" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::ResourceManager::V3::Projects::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::ResourceManager::V3::MoveProjectRequest.new - # - # # Call the move_project method. - # result = client.move_project 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 move_project request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::ResourceManager::V3::MoveProjectRequest - - # Converts hash 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.move_project.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::ResourceManager::V3::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.move_project.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.move_project.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @projects_stub.move_project 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 - - ## - # Marks the project identified by the specified - # `name` (for example, `projects/415104041262`) for deletion. - # - # This method will only affect the project if it has a lifecycle state of - # {::Google::Cloud::ResourceManager::V3::Project::State::ACTIVE ACTIVE}. - # - # This method changes the Project's lifecycle state from - # {::Google::Cloud::ResourceManager::V3::Project::State::ACTIVE ACTIVE} - # to - # {::Google::Cloud::ResourceManager::V3::Project::State::DELETE_REQUESTED DELETE_REQUESTED}. - # The deletion starts at an unspecified time, - # at which point the Project is no longer accessible. - # - # Until the deletion completes, you can check the lifecycle state - # checked by retrieving the project with [GetProject] - # [google.cloud.resourcemanager.v3.Projects.GetProject], - # and the project remains visible to [ListProjects] - # [google.cloud.resourcemanager.v3.Projects.ListProjects]. - # However, you cannot update the project. - # - # After the deletion completes, the project is not retrievable by - # the [GetProject] - # [google.cloud.resourcemanager.v3.Projects.GetProject], - # [ListProjects] - # [google.cloud.resourcemanager.v3.Projects.ListProjects], and - # {::Google::Cloud::ResourceManager::V3::Projects::Rest::Client#search_projects SearchProjects} - # methods. - # - # This method behaves idempotently, such that deleting a `DELETE_REQUESTED` - # project will not cause an error, but also won't do anything. - # - # The caller must have `resourcemanager.projects.delete` permissions for this - # project. - # - # @overload delete_project(request, options = nil) - # Pass arguments to `delete_project` via a request object, either of type - # {::Google::Cloud::ResourceManager::V3::DeleteProjectRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::ResourceManager::V3::DeleteProjectRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_project(name: nil) - # Pass arguments to `delete_project` via keyword arguments. Note that at - # least one keyword argument is 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 Project (for example, `projects/415104041262`). - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Gapic::Operation] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Gapic::Operation] - # - # @raise [::Google::Cloud::Error] if the REST call is aborted. - # - # @example Basic example - # require "google/cloud/resource_manager/v3" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::ResourceManager::V3::Projects::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::ResourceManager::V3::DeleteProjectRequest.new - # - # # Call the delete_project method. - # result = client.delete_project 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_project request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::ResourceManager::V3::DeleteProjectRequest - - # Converts hash 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_project.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::ResourceManager::V3::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_project.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.delete_project.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @projects_stub.delete_project 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 - - ## - # Restores the project identified by the specified - # `name` (for example, `projects/415104041262`). - # You can only use this method for a project that has a lifecycle state of - # [DELETE_REQUESTED] - # [Projects.State.DELETE_REQUESTED]. - # After deletion starts, the project cannot be restored. - # - # The caller must have `resourcemanager.projects.undelete` permission for - # this project. - # - # @overload undelete_project(request, options = nil) - # Pass arguments to `undelete_project` via a request object, either of type - # {::Google::Cloud::ResourceManager::V3::UndeleteProjectRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::ResourceManager::V3::UndeleteProjectRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @overload undelete_project(name: nil) - # Pass arguments to `undelete_project` via keyword arguments. Note that at - # least one keyword argument is 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 project (for example, `projects/415104041262`). - # - # Required. - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Gapic::Operation] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Gapic::Operation] - # - # @raise [::Google::Cloud::Error] if the REST call is aborted. - # - # @example Basic example - # require "google/cloud/resource_manager/v3" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::ResourceManager::V3::Projects::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::ResourceManager::V3::UndeleteProjectRequest.new - # - # # Call the undelete_project method. - # result = client.undelete_project 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 undelete_project request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::ResourceManager::V3::UndeleteProjectRequest - - # Converts hash 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.undelete_project.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::ResourceManager::V3::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.undelete_project.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.undelete_project.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @projects_stub.undelete_project 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 - - ## - # Returns the IAM access control policy for the specified project, in the - # format `projects/{ProjectIdOrNumber}` e.g. projects/123. - # Permission is denied if the policy or the resource do not exist. - # - # @overload get_iam_policy(request, options = nil) - # Pass arguments to `get_iam_policy` via a request object, either of type - # {::Google::Iam::V1::GetIamPolicyRequest} or an equivalent Hash. - # - # @param request [::Google::Iam::V1::GetIamPolicyRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @overload get_iam_policy(resource: nil, options: nil) - # Pass arguments to `get_iam_policy` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param resource [::String] - # REQUIRED: The resource for which the policy is being requested. - # See the operation documentation for the appropriate value for this field. - # @param options [::Google::Iam::V1::GetPolicyOptions, ::Hash] - # OPTIONAL: A `GetPolicyOptions` object for specifying options to - # `GetIamPolicy`. - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Iam::V1::Policy] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Iam::V1::Policy] - # - # @raise [::Google::Cloud::Error] if the REST call is aborted. - # - # @example Basic example - # require "google/cloud/resource_manager/v3" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::ResourceManager::V3::Projects::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Iam::V1::GetIamPolicyRequest.new - # - # # Call the get_iam_policy method. - # result = client.get_iam_policy request - # - # # The returned object is of type Google::Iam::V1::Policy. - # p result - # - def get_iam_policy request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Iam::V1::GetIamPolicyRequest - - # Converts hash and nil to an options object - options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h - - # Customize the options with defaults - call_metadata = @config.rpcs.get_iam_policy.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::ResourceManager::V3::VERSION, - transports_version_send: [:rest] - - call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - options.apply_defaults timeout: @config.rpcs.get_iam_policy.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.get_iam_policy.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @projects_stub.get_iam_policy request, options do |result, operation| - yield result, operation if block_given? - end - rescue ::Gapic::Rest::Error => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Sets the IAM access control policy for the specified project, in the - # format `projects/{ProjectIdOrNumber}` e.g. projects/123. - # - # CAUTION: This method will replace the existing policy, and cannot be used - # to append additional IAM settings. - # - # Note: Removing service accounts from policies or changing their roles can - # render services completely inoperable. It is important to understand how - # the service account is being used before removing or updating its roles. - # - # The following constraints apply when using `setIamPolicy()`: - # - # + Project does not support `allUsers` and `allAuthenticatedUsers` as - # `members` in a `Binding` of a `Policy`. - # - # + The owner role can be granted to a `user`, `serviceAccount`, or a group - # that is part of an organization. For example, - # group@myownpersonaldomain.com could be added as an owner to a project in - # the myownpersonaldomain.com organization, but not the examplepetstore.com - # organization. - # - # + Service accounts can be made owners of a project directly - # without any restrictions. However, to be added as an owner, a user must be - # invited using the Cloud Platform console and must accept the invitation. - # - # + A user cannot be granted the owner role using `setIamPolicy()`. The user - # must be granted the owner role using the Cloud Platform Console and must - # explicitly accept the invitation. - # - # + Invitations to grant the owner role cannot be sent using - # `setIamPolicy()`; - # they must be sent only using the Cloud Platform Console. - # - # + If the project is not part of an organization, there must be at least - # one owner who has accepted the Terms of Service (ToS) agreement in the - # policy. Calling `setIamPolicy()` to remove the last ToS-accepted owner - # from the policy will fail. This restriction also applies to legacy - # projects that no longer have owners who have accepted the ToS. Edits to - # IAM policies will be rejected until the lack of a ToS-accepting owner is - # rectified. If the project is part of an organization, you can remove all - # owners, potentially making the organization inaccessible. - # - # @overload set_iam_policy(request, options = nil) - # Pass arguments to `set_iam_policy` via a request object, either of type - # {::Google::Iam::V1::SetIamPolicyRequest} or an equivalent Hash. - # - # @param request [::Google::Iam::V1::SetIamPolicyRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @overload set_iam_policy(resource: nil, policy: nil, update_mask: nil) - # Pass arguments to `set_iam_policy` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param resource [::String] - # REQUIRED: The resource for which the policy is being specified. - # See the operation documentation for the appropriate value for this field. - # @param policy [::Google::Iam::V1::Policy, ::Hash] - # REQUIRED: The complete policy to be applied to the `resource`. The size of - # the policy is limited to a few 10s of KB. An empty policy is a - # valid policy but certain Cloud Platform services (such as Projects) - # might reject them. - # @param update_mask [::Google::Protobuf::FieldMask, ::Hash] - # OPTIONAL: A FieldMask specifying which fields of the policy to modify. Only - # the fields in the mask will be modified. If no mask is provided, the - # following default mask is used: - # - # `paths: "bindings, etag"` - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Iam::V1::Policy] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Iam::V1::Policy] - # - # @raise [::Google::Cloud::Error] if the REST call is aborted. - # - # @example Basic example - # require "google/cloud/resource_manager/v3" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::ResourceManager::V3::Projects::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Iam::V1::SetIamPolicyRequest.new - # - # # Call the set_iam_policy method. - # result = client.set_iam_policy request - # - # # The returned object is of type Google::Iam::V1::Policy. - # p result - # - def set_iam_policy request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Iam::V1::SetIamPolicyRequest - - # Converts hash and nil to an options object - options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h - - # Customize the options with defaults - call_metadata = @config.rpcs.set_iam_policy.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::ResourceManager::V3::VERSION, - transports_version_send: [:rest] - - call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - options.apply_defaults timeout: @config.rpcs.set_iam_policy.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.set_iam_policy.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @projects_stub.set_iam_policy request, options do |result, operation| - yield result, operation if block_given? - end - rescue ::Gapic::Rest::Error => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Returns permissions that a caller has on the specified project, in the - # format `projects/{ProjectIdOrNumber}` e.g. projects/123.. - # - # @overload test_iam_permissions(request, options = nil) - # Pass arguments to `test_iam_permissions` via a request object, either of type - # {::Google::Iam::V1::TestIamPermissionsRequest} or an equivalent Hash. - # - # @param request [::Google::Iam::V1::TestIamPermissionsRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @overload test_iam_permissions(resource: nil, permissions: nil) - # Pass arguments to `test_iam_permissions` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param resource [::String] - # REQUIRED: The resource for which the policy detail is being requested. - # See the operation documentation for the appropriate value for this field. - # @param permissions [::Array<::String>] - # The set of permissions to check for the `resource`. Permissions with - # wildcards (such as '*' or 'storage.*') are not allowed. For more - # information see - # [IAM Overview](https://cloud.google.com/iam/docs/overview#permissions). - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Iam::V1::TestIamPermissionsResponse] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Iam::V1::TestIamPermissionsResponse] - # - # @raise [::Google::Cloud::Error] if the REST call is aborted. - # - # @example Basic example - # require "google/cloud/resource_manager/v3" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::ResourceManager::V3::Projects::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Iam::V1::TestIamPermissionsRequest.new - # - # # Call the test_iam_permissions method. - # result = client.test_iam_permissions request - # - # # The returned object is of type Google::Iam::V1::TestIamPermissionsResponse. - # p result - # - def test_iam_permissions request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Iam::V1::TestIamPermissionsRequest - - # Converts hash and nil to an options object - options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h - - # Customize the options with defaults - call_metadata = @config.rpcs.test_iam_permissions.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::ResourceManager::V3::VERSION, - transports_version_send: [:rest] - - call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - options.apply_defaults timeout: @config.rpcs.test_iam_permissions.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.test_iam_permissions.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @projects_stub.test_iam_permissions request, options do |result, operation| - yield result, operation if block_given? - end - rescue ::Gapic::Rest::Error => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Configuration class for the Projects REST API. - # - # This class represents the configuration for Projects REST, - # providing control over timeouts, retry behavior, logging, transport - # parameters, and other low-level controls. Certain parameters can also be - # applied individually to specific RPCs. See - # {::Google::Cloud::ResourceManager::V3::Projects::Rest::Client::Configuration::Rpcs} - # for a list of RPCs that can be configured independently. - # - # Configuration can be applied globally to all clients, or to a single client - # on construction. - # - # @example - # - # # Modify the global config, setting the timeout for - # # get_project to 20 seconds, - # # and all remaining timeouts to 10 seconds. - # ::Google::Cloud::ResourceManager::V3::Projects::Rest::Client.configure do |config| - # config.timeout = 10.0 - # config.rpcs.get_project.timeout = 20.0 - # end - # - # # Apply the above configuration only to a new client. - # client = ::Google::Cloud::ResourceManager::V3::Projects::Rest::Client.new do |config| - # config.timeout = 10.0 - # config.rpcs.get_project.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 = "cloudresourcemanager.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 Projects API. - # - # Includes fields providing the configuration for each RPC in this service. - # Each configuration object is of type `Gapic::Config::Method` and includes - # the following configuration fields: - # - # * `timeout` (*type:* `Numeric`) - The call timeout in seconds - # * `metadata` (*type:* `Hash{Symbol=>String}`) - Additional headers - # * `retry_policy (*type:* `Hash`) - The retry policy. The policy fields - # include the following keys: - # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds. - # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds. - # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier. - # * `:retry_codes` (*type:* `Array`) - The error codes that should - # trigger a retry. - # - class Rpcs - ## - # RPC-specific configuration for `get_project` - # @return [::Gapic::Config::Method] - # - attr_reader :get_project - ## - # RPC-specific configuration for `list_projects` - # @return [::Gapic::Config::Method] - # - attr_reader :list_projects - ## - # RPC-specific configuration for `search_projects` - # @return [::Gapic::Config::Method] - # - attr_reader :search_projects - ## - # RPC-specific configuration for `create_project` - # @return [::Gapic::Config::Method] - # - attr_reader :create_project - ## - # RPC-specific configuration for `update_project` - # @return [::Gapic::Config::Method] - # - attr_reader :update_project - ## - # RPC-specific configuration for `move_project` - # @return [::Gapic::Config::Method] - # - attr_reader :move_project - ## - # RPC-specific configuration for `delete_project` - # @return [::Gapic::Config::Method] - # - attr_reader :delete_project - ## - # RPC-specific configuration for `undelete_project` - # @return [::Gapic::Config::Method] - # - attr_reader :undelete_project - ## - # RPC-specific configuration for `get_iam_policy` - # @return [::Gapic::Config::Method] - # - attr_reader :get_iam_policy - ## - # RPC-specific configuration for `set_iam_policy` - # @return [::Gapic::Config::Method] - # - attr_reader :set_iam_policy - ## - # RPC-specific configuration for `test_iam_permissions` - # @return [::Gapic::Config::Method] - # - attr_reader :test_iam_permissions - - # @private - def initialize parent_rpcs = nil - get_project_config = parent_rpcs.get_project if parent_rpcs.respond_to? :get_project - @get_project = ::Gapic::Config::Method.new get_project_config - list_projects_config = parent_rpcs.list_projects if parent_rpcs.respond_to? :list_projects - @list_projects = ::Gapic::Config::Method.new list_projects_config - search_projects_config = parent_rpcs.search_projects if parent_rpcs.respond_to? :search_projects - @search_projects = ::Gapic::Config::Method.new search_projects_config - create_project_config = parent_rpcs.create_project if parent_rpcs.respond_to? :create_project - @create_project = ::Gapic::Config::Method.new create_project_config - update_project_config = parent_rpcs.update_project if parent_rpcs.respond_to? :update_project - @update_project = ::Gapic::Config::Method.new update_project_config - move_project_config = parent_rpcs.move_project if parent_rpcs.respond_to? :move_project - @move_project = ::Gapic::Config::Method.new move_project_config - delete_project_config = parent_rpcs.delete_project if parent_rpcs.respond_to? :delete_project - @delete_project = ::Gapic::Config::Method.new delete_project_config - undelete_project_config = parent_rpcs.undelete_project if parent_rpcs.respond_to? :undelete_project - @undelete_project = ::Gapic::Config::Method.new undelete_project_config - get_iam_policy_config = parent_rpcs.get_iam_policy if parent_rpcs.respond_to? :get_iam_policy - @get_iam_policy = ::Gapic::Config::Method.new get_iam_policy_config - set_iam_policy_config = parent_rpcs.set_iam_policy if parent_rpcs.respond_to? :set_iam_policy - @set_iam_policy = ::Gapic::Config::Method.new set_iam_policy_config - test_iam_permissions_config = parent_rpcs.test_iam_permissions if parent_rpcs.respond_to? :test_iam_permissions - @test_iam_permissions = ::Gapic::Config::Method.new test_iam_permissions_config - - yield self if block_given? - end - end - end - end - end - end - end - end - end -end diff --git a/owl-bot-staging/google-cloud-resource_manager-v3/lib/google/cloud/resource_manager/v3/projects/rest/operations.rb b/owl-bot-staging/google-cloud-resource_manager-v3/lib/google/cloud/resource_manager/v3/projects/rest/operations.rb deleted file mode 100644 index ffba45494a07..000000000000 --- a/owl-bot-staging/google-cloud-resource_manager-v3/lib/google/cloud/resource_manager/v3/projects/rest/operations.rb +++ /dev/null @@ -1,925 +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 Cloud - module ResourceManager - module V3 - module Projects - module Rest - # Service that implements Longrunning Operations API. - class Operations - # @private - API_VERSION = "" - - # @private - DEFAULT_ENDPOINT_TEMPLATE = "cloudresourcemanager.$UNIVERSE_DOMAIN$" - - # @private - attr_reader :operations_stub - - ## - # Configuration for the Projects 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 Projects 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::ResourceManager::V3::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::ResourceManager::V3::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::ResourceManager::V3::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::ResourceManager::V3::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 = "cloudresourcemanager.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: "/v3/{name}", - matches: [ - ["name", %r{^operations(?:/.*)?$}, true] - ] - ) - 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 -end diff --git a/owl-bot-staging/google-cloud-resource_manager-v3/lib/google/cloud/resource_manager/v3/projects/rest/service_stub.rb b/owl-bot-staging/google-cloud-resource_manager-v3/lib/google/cloud/resource_manager/v3/projects/rest/service_stub.rb deleted file mode 100644 index 7a244012d0ff..000000000000 --- a/owl-bot-staging/google-cloud-resource_manager-v3/lib/google/cloud/resource_manager/v3/projects/rest/service_stub.rb +++ /dev/null @@ -1,753 +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/resourcemanager/v3/projects_pb" - -module Google - module Cloud - module ResourceManager - module V3 - module Projects - module Rest - ## - # REST service stub for the Projects service. - # Service stub contains baseline method implementations - # including transcoding, making the REST call, and deserialing the response. - # - class ServiceStub - # @private - def initialize endpoint:, endpoint_template:, universe_domain:, credentials:, logger: - # These require statements are intentionally placed here to initialize - # the REST modules only when it's required. - require "gapic/rest" - - @client_stub = ::Gapic::Rest::ClientStub.new endpoint: endpoint, - endpoint_template: endpoint_template, - universe_domain: universe_domain, - credentials: credentials, - numeric_enums: true, - service_name: self.class, - raise_faraday_errors: false, - logger: logger - end - - ## - # The effective universe domain - # - # @return [String] - # - def universe_domain - @client_stub.universe_domain - end - - ## - # The effective endpoint - # - # @return [String] - # - def endpoint - @client_stub.endpoint - end - - ## - # The logger used for request/response debug logging. - # - # @return [Logger] - # - def logger stub: false - stub ? @client_stub.stub_logger : @client_stub.logger - end - - ## - # Baseline implementation for the get_project REST call - # - # @param request_pb [::Google::Cloud::ResourceManager::V3::GetProjectRequest] - # A request object representing the call parameters. Required. - # @param options [::Gapic::CallOptions] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Cloud::ResourceManager::V3::Project] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::ResourceManager::V3::Project] - # A result object deserialized from the server's reply - def get_project request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_get_project_request request_pb - query_string_params = if query_string_params.any? - query_string_params.to_h { |p| p.split "=", 2 } - else - {} - end - - response = @client_stub.make_http_request( - verb, - uri: uri, - body: body || "", - params: query_string_params, - method_name: "get_project", - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Cloud::ResourceManager::V3::Project.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_projects REST call - # - # @param request_pb [::Google::Cloud::ResourceManager::V3::ListProjectsRequest] - # A request object representing the call parameters. Required. - # @param options [::Gapic::CallOptions] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Cloud::ResourceManager::V3::ListProjectsResponse] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::ResourceManager::V3::ListProjectsResponse] - # A result object deserialized from the server's reply - def list_projects request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_list_projects_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_projects", - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Cloud::ResourceManager::V3::ListProjectsResponse.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_projects REST call - # - # @param request_pb [::Google::Cloud::ResourceManager::V3::SearchProjectsRequest] - # A request object representing the call parameters. Required. - # @param options [::Gapic::CallOptions] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Cloud::ResourceManager::V3::SearchProjectsResponse] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::ResourceManager::V3::SearchProjectsResponse] - # A result object deserialized from the server's reply - def search_projects request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_search_projects_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_projects", - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Cloud::ResourceManager::V3::SearchProjectsResponse.decode_json response.body, ignore_unknown_fields: true - catch :response do - yield result, operation if block_given? - result - end - end - - ## - # Baseline implementation for the create_project REST call - # - # @param request_pb [::Google::Cloud::ResourceManager::V3::CreateProjectRequest] - # 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_project request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_create_project_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_project", - 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 update_project REST call - # - # @param request_pb [::Google::Cloud::ResourceManager::V3::UpdateProjectRequest] - # 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_project request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_update_project_request request_pb - query_string_params = if query_string_params.any? - query_string_params.to_h { |p| p.split "=", 2 } - else - {} - end - - response = @client_stub.make_http_request( - verb, - uri: uri, - body: body || "", - params: query_string_params, - method_name: "update_project", - 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 move_project REST call - # - # @param request_pb [::Google::Cloud::ResourceManager::V3::MoveProjectRequest] - # 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 move_project request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_move_project_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: "move_project", - 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_project REST call - # - # @param request_pb [::Google::Cloud::ResourceManager::V3::DeleteProjectRequest] - # 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_project request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_delete_project_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_project", - 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 undelete_project REST call - # - # @param request_pb [::Google::Cloud::ResourceManager::V3::UndeleteProjectRequest] - # 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 undelete_project request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_undelete_project_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: "undelete_project", - 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_iam_policy REST call - # - # @param request_pb [::Google::Iam::V1::GetIamPolicyRequest] - # A request object representing the call parameters. Required. - # @param options [::Gapic::CallOptions] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Iam::V1::Policy] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Iam::V1::Policy] - # A result object deserialized from the server's reply - def get_iam_policy request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_get_iam_policy_request request_pb - query_string_params = if query_string_params.any? - query_string_params.to_h { |p| p.split "=", 2 } - else - {} - end - - response = @client_stub.make_http_request( - verb, - uri: uri, - body: body || "", - params: query_string_params, - method_name: "get_iam_policy", - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Iam::V1::Policy.decode_json response.body, ignore_unknown_fields: true - catch :response do - yield result, operation if block_given? - result - end - end - - ## - # Baseline implementation for the set_iam_policy REST call - # - # @param request_pb [::Google::Iam::V1::SetIamPolicyRequest] - # A request object representing the call parameters. Required. - # @param options [::Gapic::CallOptions] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Iam::V1::Policy] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Iam::V1::Policy] - # A result object deserialized from the server's reply - def set_iam_policy request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_set_iam_policy_request request_pb - query_string_params = if query_string_params.any? - query_string_params.to_h { |p| p.split "=", 2 } - else - {} - end - - response = @client_stub.make_http_request( - verb, - uri: uri, - body: body || "", - params: query_string_params, - method_name: "set_iam_policy", - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Iam::V1::Policy.decode_json response.body, ignore_unknown_fields: true - catch :response do - yield result, operation if block_given? - result - end - end - - ## - # Baseline implementation for the test_iam_permissions REST call - # - # @param request_pb [::Google::Iam::V1::TestIamPermissionsRequest] - # A request object representing the call parameters. Required. - # @param options [::Gapic::CallOptions] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Iam::V1::TestIamPermissionsResponse] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Iam::V1::TestIamPermissionsResponse] - # A result object deserialized from the server's reply - def test_iam_permissions request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_test_iam_permissions_request request_pb - query_string_params = if query_string_params.any? - query_string_params.to_h { |p| p.split "=", 2 } - else - {} - end - - response = @client_stub.make_http_request( - verb, - uri: uri, - body: body || "", - params: query_string_params, - method_name: "test_iam_permissions", - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Iam::V1::TestIamPermissionsResponse.decode_json response.body, ignore_unknown_fields: true - catch :response do - yield result, operation if block_given? - result - end - end - - ## - # @private - # - # GRPC transcoding helper method for the get_project REST call - # - # @param request_pb [::Google::Cloud::ResourceManager::V3::GetProjectRequest] - # A request object representing the call parameters. Required. - # @return [Array(String, [String, nil], Hash{String => String})] - # Uri, Body, Query string parameters - def self.transcode_get_project_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :get, - uri_template: "/v3/{name}", - matches: [ - ["name", %r{^projects/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the list_projects REST call - # - # @param request_pb [::Google::Cloud::ResourceManager::V3::ListProjectsRequest] - # 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_projects_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :get, - uri_template: "/v3/projects", - matches: [] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the search_projects REST call - # - # @param request_pb [::Google::Cloud::ResourceManager::V3::SearchProjectsRequest] - # 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_projects_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :get, - uri_template: "/v3/projects:search", - matches: [] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the create_project REST call - # - # @param request_pb [::Google::Cloud::ResourceManager::V3::CreateProjectRequest] - # 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_project_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :post, - uri_template: "/v3/projects", - body: "project", - matches: [] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the update_project REST call - # - # @param request_pb [::Google::Cloud::ResourceManager::V3::UpdateProjectRequest] - # A request object representing the call parameters. Required. - # @return [Array(String, [String, nil], Hash{String => String})] - # Uri, Body, Query string parameters - def self.transcode_update_project_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :patch, - uri_template: "/v3/{project.name}", - body: "project", - matches: [ - ["project.name", %r{^projects/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the move_project REST call - # - # @param request_pb [::Google::Cloud::ResourceManager::V3::MoveProjectRequest] - # A request object representing the call parameters. Required. - # @return [Array(String, [String, nil], Hash{String => String})] - # Uri, Body, Query string parameters - def self.transcode_move_project_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :post, - uri_template: "/v3/{name}:move", - body: "*", - matches: [ - ["name", %r{^projects/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the delete_project REST call - # - # @param request_pb [::Google::Cloud::ResourceManager::V3::DeleteProjectRequest] - # 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_project_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :delete, - uri_template: "/v3/{name}", - matches: [ - ["name", %r{^projects/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the undelete_project REST call - # - # @param request_pb [::Google::Cloud::ResourceManager::V3::UndeleteProjectRequest] - # A request object representing the call parameters. Required. - # @return [Array(String, [String, nil], Hash{String => String})] - # Uri, Body, Query string parameters - def self.transcode_undelete_project_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :post, - uri_template: "/v3/{name}:undelete", - body: "*", - matches: [ - ["name", %r{^projects/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the get_iam_policy REST call - # - # @param request_pb [::Google::Iam::V1::GetIamPolicyRequest] - # A request object representing the call parameters. Required. - # @return [Array(String, [String, nil], Hash{String => String})] - # Uri, Body, Query string parameters - def self.transcode_get_iam_policy_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :post, - uri_template: "/v3/{resource}:getIamPolicy", - body: "*", - matches: [ - ["resource", %r{^projects/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the set_iam_policy REST call - # - # @param request_pb [::Google::Iam::V1::SetIamPolicyRequest] - # A request object representing the call parameters. Required. - # @return [Array(String, [String, nil], Hash{String => String})] - # Uri, Body, Query string parameters - def self.transcode_set_iam_policy_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :post, - uri_template: "/v3/{resource}:setIamPolicy", - body: "*", - matches: [ - ["resource", %r{^projects/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the test_iam_permissions REST call - # - # @param request_pb [::Google::Iam::V1::TestIamPermissionsRequest] - # A request object representing the call parameters. Required. - # @return [Array(String, [String, nil], Hash{String => String})] - # Uri, Body, Query string parameters - def self.transcode_test_iam_permissions_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :post, - uri_template: "/v3/{resource}:testIamPermissions", - body: "*", - matches: [ - ["resource", %r{^projects/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - end - end - end - end - end - end -end diff --git a/owl-bot-staging/google-cloud-resource_manager-v3/lib/google/cloud/resource_manager/v3/rest.rb b/owl-bot-staging/google-cloud-resource_manager-v3/lib/google/cloud/resource_manager/v3/rest.rb deleted file mode 100644 index e260723626e9..000000000000 --- a/owl-bot-staging/google-cloud-resource_manager-v3/lib/google/cloud/resource_manager/v3/rest.rb +++ /dev/null @@ -1,43 +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/resource_manager/v3/folders/rest" -require "google/cloud/resource_manager/v3/organizations/rest" -require "google/cloud/resource_manager/v3/projects/rest" -require "google/cloud/resource_manager/v3/tag_bindings/rest" -require "google/cloud/resource_manager/v3/tag_holds/rest" -require "google/cloud/resource_manager/v3/tag_keys/rest" -require "google/cloud/resource_manager/v3/tag_values/rest" -require "google/cloud/resource_manager/v3/version" - -module Google - module Cloud - module ResourceManager - ## - # To load just the REST part of this package, including all its services, and instantiate a REST client: - # - # @example - # - # require "google/cloud/resource_manager/v3/rest" - # client = ::Google::Cloud::ResourceManager::V3::Folders::Rest::Client.new - # - module V3 - end - end - end -end diff --git a/owl-bot-staging/google-cloud-resource_manager-v3/lib/google/cloud/resource_manager/v3/tag_bindings.rb b/owl-bot-staging/google-cloud-resource_manager-v3/lib/google/cloud/resource_manager/v3/tag_bindings.rb deleted file mode 100644 index a5209f7ec2d8..000000000000 --- a/owl-bot-staging/google-cloud-resource_manager-v3/lib/google/cloud/resource_manager/v3/tag_bindings.rb +++ /dev/null @@ -1,57 +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/resource_manager/v3/version" - -require "google/cloud/resource_manager/v3/tag_bindings/credentials" -require "google/cloud/resource_manager/v3/tag_bindings/paths" -require "google/cloud/resource_manager/v3/tag_bindings/operations" -require "google/cloud/resource_manager/v3/tag_bindings/client" -require "google/cloud/resource_manager/v3/tag_bindings/rest" - -module Google - module Cloud - module ResourceManager - module V3 - ## - # Allow users to create and manage TagBindings between TagValues and - # different Google Cloud resources throughout the GCP resource hierarchy. - # - # @example Load this service and instantiate a gRPC client - # - # require "google/cloud/resource_manager/v3/tag_bindings" - # client = ::Google::Cloud::ResourceManager::V3::TagBindings::Client.new - # - # @example Load this service and instantiate a REST client - # - # require "google/cloud/resource_manager/v3/tag_bindings/rest" - # client = ::Google::Cloud::ResourceManager::V3::TagBindings::Rest::Client.new - # - module TagBindings - end - end - end - end -end - -helper_path = ::File.join __dir__, "tag_bindings", "helpers.rb" -require "google/cloud/resource_manager/v3/tag_bindings/helpers" if ::File.file? helper_path diff --git a/owl-bot-staging/google-cloud-resource_manager-v3/lib/google/cloud/resource_manager/v3/tag_bindings/client.rb b/owl-bot-staging/google-cloud-resource_manager-v3/lib/google/cloud/resource_manager/v3/tag_bindings/client.rb deleted file mode 100644 index ae5223c50ad7..000000000000 --- a/owl-bot-staging/google-cloud-resource_manager-v3/lib/google/cloud/resource_manager/v3/tag_bindings/client.rb +++ /dev/null @@ -1,808 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -require "google/cloud/errors" -require "google/cloud/resourcemanager/v3/tag_bindings_pb" - -module Google - module Cloud - module ResourceManager - module V3 - module TagBindings - ## - # Client for the TagBindings service. - # - # Allow users to create and manage TagBindings between TagValues and - # different Google Cloud resources throughout the GCP resource hierarchy. - # - class Client - # @private - API_VERSION = "" - - # @private - DEFAULT_ENDPOINT_TEMPLATE = "cloudresourcemanager.$UNIVERSE_DOMAIN$" - - include Paths - - # @private - attr_reader :tag_bindings_stub - - ## - # Configure the TagBindings Client class. - # - # See {::Google::Cloud::ResourceManager::V3::TagBindings::Client::Configuration} - # for a description of the configuration fields. - # - # @example - # - # # Modify the configuration for all TagBindings clients - # ::Google::Cloud::ResourceManager::V3::TagBindings::Client.configure do |config| - # config.timeout = 10.0 - # end - # - # @yield [config] Configure the Client client. - # @yieldparam config [Client::Configuration] - # - # @return [Client::Configuration] - # - def self.configure - @configure ||= begin - namespace = ["Google", "Cloud", "ResourceManager", "V3"] - parent_config = while namespace.any? - parent_name = namespace.join "::" - parent_const = const_get parent_name - break parent_const.configure if parent_const.respond_to? :configure - namespace.pop - end - default_config = Client::Configuration.new parent_config - - default_config.rpcs.list_tag_bindings.timeout = 60.0 - default_config.rpcs.list_tag_bindings.retry_policy = { - initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [14] - } - - default_config.rpcs.create_tag_binding.timeout = 60.0 - - default_config.rpcs.delete_tag_binding.timeout = 60.0 - - default_config - end - yield @configure if block_given? - @configure - end - - ## - # Configure the TagBindings Client instance. - # - # The configuration is set to the derived mode, meaning that values can be changed, - # but structural changes (adding new fields, etc.) are not allowed. Structural changes - # should be made on {Client.configure}. - # - # See {::Google::Cloud::ResourceManager::V3::TagBindings::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 - @tag_bindings_stub.universe_domain - end - - ## - # Create a new TagBindings client object. - # - # @example - # - # # Create a client using the default configuration - # client = ::Google::Cloud::ResourceManager::V3::TagBindings::Client.new - # - # # Create a client using a custom configuration - # client = ::Google::Cloud::ResourceManager::V3::TagBindings::Client.new do |config| - # config.timeout = 10.0 - # end - # - # @yield [config] Configure the TagBindings client. - # @yieldparam config [Client::Configuration] - # - def initialize - # These require statements are intentionally placed here to initialize - # the gRPC module only when it's required. - # See https://github.com/googleapis/toolkit/issues/446 - require "gapic/grpc" - require "google/cloud/resourcemanager/v3/tag_bindings_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 - - @tag_bindings_stub = ::Gapic::ServiceStub.new( - ::Google::Cloud::ResourceManager::V3::TagBindings::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 - ) - - @tag_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 - end - - ## - # Get the associated client for long-running operations. - # - # @return [::Google::Cloud::ResourceManager::V3::TagBindings::Operations] - # - attr_reader :operations_client - - ## - # The logger used for request/response debug logging. - # - # @return [Logger] - # - def logger - @tag_bindings_stub.logger - end - - # Service calls - - ## - # Lists the TagBindings for the given Google Cloud resource, as specified - # with `parent`. - # - # NOTE: The `parent` field is expected to be a full resource name: - # https://cloud.google.com/apis/design/resource_names#full_resource_name - # - # @overload list_tag_bindings(request, options = nil) - # Pass arguments to `list_tag_bindings` via a request object, either of type - # {::Google::Cloud::ResourceManager::V3::ListTagBindingsRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::ResourceManager::V3::ListTagBindingsRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_tag_bindings(parent: nil, page_size: nil, page_token: nil) - # Pass arguments to `list_tag_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 full resource name of a resource for which you want to list - # existing TagBindings. E.g. - # "//cloudresourcemanager.googleapis.com/projects/123" - # @param page_size [::Integer] - # Optional. The maximum number of TagBindings to return in the response. The - # server allows a maximum of 300 TagBindings to return. If unspecified, the - # server will use 100 as the default. - # @param page_token [::String] - # Optional. A pagination token returned from a previous call to - # `ListTagBindings` that indicates where this listing should continue from. - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Gapic::PagedEnumerable<::Google::Cloud::ResourceManager::V3::TagBinding>] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Gapic::PagedEnumerable<::Google::Cloud::ResourceManager::V3::TagBinding>] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/cloud/resource_manager/v3" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::ResourceManager::V3::TagBindings::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::ResourceManager::V3::ListTagBindingsRequest.new - # - # # Call the list_tag_bindings method. - # result = client.list_tag_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::Cloud::ResourceManager::V3::TagBinding. - # p item - # end - # - def list_tag_bindings request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::ResourceManager::V3::ListTagBindingsRequest - - # Converts hash 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_tag_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::ResourceManager::V3::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.list_tag_bindings.timeout, - metadata: metadata, - retry_policy: @config.rpcs.list_tag_bindings.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @tag_bindings_stub.call_rpc :list_tag_bindings, request, options: options do |response, operation| - response = ::Gapic::PagedEnumerable.new @tag_bindings_stub, :list_tag_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 - - ## - # Creates a TagBinding between a TagValue and a Google Cloud resource. - # - # @overload create_tag_binding(request, options = nil) - # Pass arguments to `create_tag_binding` via a request object, either of type - # {::Google::Cloud::ResourceManager::V3::CreateTagBindingRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::ResourceManager::V3::CreateTagBindingRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_tag_binding(tag_binding: nil, validate_only: nil) - # Pass arguments to `create_tag_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 tag_binding [::Google::Cloud::ResourceManager::V3::TagBinding, ::Hash] - # Required. The TagBinding to be created. - # @param validate_only [::Boolean] - # Optional. Set to true to perform the validations necessary for creating the - # resource, but not actually perform the action. - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Gapic::Operation] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Gapic::Operation] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/cloud/resource_manager/v3" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::ResourceManager::V3::TagBindings::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::ResourceManager::V3::CreateTagBindingRequest.new - # - # # Call the create_tag_binding method. - # result = client.create_tag_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_tag_binding request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::ResourceManager::V3::CreateTagBindingRequest - - # Converts hash 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_tag_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::ResourceManager::V3::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.create_tag_binding.timeout, - metadata: metadata, - retry_policy: @config.rpcs.create_tag_binding.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @tag_bindings_stub.call_rpc :create_tag_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 TagBinding. - # - # @overload delete_tag_binding(request, options = nil) - # Pass arguments to `delete_tag_binding` via a request object, either of type - # {::Google::Cloud::ResourceManager::V3::DeleteTagBindingRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::ResourceManager::V3::DeleteTagBindingRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_tag_binding(name: nil) - # Pass arguments to `delete_tag_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 TagBinding. This is a String of the form: - # `tagBindings/{id}` (e.g. - # `tagBindings/%2F%2Fcloudresourcemanager.googleapis.com%2Fprojects%2F123/tagValues/456`). - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Gapic::Operation] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Gapic::Operation] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/cloud/resource_manager/v3" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::ResourceManager::V3::TagBindings::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::ResourceManager::V3::DeleteTagBindingRequest.new - # - # # Call the delete_tag_binding method. - # result = client.delete_tag_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_tag_binding request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::ResourceManager::V3::DeleteTagBindingRequest - - # Converts hash 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_tag_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::ResourceManager::V3::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_tag_binding.timeout, - metadata: metadata, - retry_policy: @config.rpcs.delete_tag_binding.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @tag_bindings_stub.call_rpc :delete_tag_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 - - ## - # Return a list of effective tags for the given Google Cloud resource, as - # specified in `parent`. - # - # @overload list_effective_tags(request, options = nil) - # Pass arguments to `list_effective_tags` via a request object, either of type - # {::Google::Cloud::ResourceManager::V3::ListEffectiveTagsRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::ResourceManager::V3::ListEffectiveTagsRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_effective_tags(parent: nil, page_size: nil, page_token: nil) - # Pass arguments to `list_effective_tags` via keyword arguments. Note that at - # least one keyword argument is 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 full resource name of a resource for which you want to list - # the effective tags. E.g. - # "//cloudresourcemanager.googleapis.com/projects/123" - # @param page_size [::Integer] - # Optional. The maximum number of effective tags to return in the response. - # The server allows a maximum of 300 effective tags to return in a single - # page. If unspecified, the server will use 100 as the default. - # @param page_token [::String] - # Optional. A pagination token returned from a previous call to - # `ListEffectiveTags` that indicates from where this listing should continue. - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Gapic::PagedEnumerable<::Google::Cloud::ResourceManager::V3::EffectiveTag>] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Gapic::PagedEnumerable<::Google::Cloud::ResourceManager::V3::EffectiveTag>] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/cloud/resource_manager/v3" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::ResourceManager::V3::TagBindings::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::ResourceManager::V3::ListEffectiveTagsRequest.new - # - # # Call the list_effective_tags method. - # result = client.list_effective_tags request - # - # # The returned object is of type Gapic::PagedEnumerable. You can iterate - # # over elements, and API calls will be issued to fetch pages as needed. - # result.each do |item| - # # Each element is of type ::Google::Cloud::ResourceManager::V3::EffectiveTag. - # p item - # end - # - def list_effective_tags request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::ResourceManager::V3::ListEffectiveTagsRequest - - # Converts hash 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_effective_tags.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::ResourceManager::V3::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.list_effective_tags.timeout, - metadata: metadata, - retry_policy: @config.rpcs.list_effective_tags.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @tag_bindings_stub.call_rpc :list_effective_tags, request, options: options do |response, operation| - response = ::Gapic::PagedEnumerable.new @tag_bindings_stub, :list_effective_tags, 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 TagBindings API. - # - # This class represents the configuration for TagBindings, - # providing control over timeouts, retry behavior, logging, transport - # parameters, and other low-level controls. Certain parameters can also be - # applied individually to specific RPCs. See - # {::Google::Cloud::ResourceManager::V3::TagBindings::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_tag_bindings to 20 seconds, - # # and all remaining timeouts to 10 seconds. - # ::Google::Cloud::ResourceManager::V3::TagBindings::Client.configure do |config| - # config.timeout = 10.0 - # config.rpcs.list_tag_bindings.timeout = 20.0 - # end - # - # # Apply the above configuration only to a new client. - # client = ::Google::Cloud::ResourceManager::V3::TagBindings::Client.new do |config| - # config.timeout = 10.0 - # config.rpcs.list_tag_bindings.timeout = 20.0 - # end - # - # @!attribute [rw] endpoint - # A custom service endpoint, as a hostname or hostname:port. The default is - # nil, indicating to use the default endpoint in the current universe domain. - # @return [::String,nil] - # @!attribute [rw] credentials - # Credentials to send with calls. You may provide any of the following types: - # * (`Google::Auth::Credentials`) A googleauth credentials object - # (see the [googleauth docs](https://rubydoc.info/gems/googleauth/Google/Auth/Credentials)) - # * (`Signet::OAuth2::Client`) A signet oauth2 client object - # (see the [signet docs](https://rubydoc.info/gems/signet/Signet/OAuth2/Client)) - # * (`GRPC::Core::Channel`) a gRPC channel with included credentials - # * (`GRPC::Core::ChannelCredentials`) a gRPC credentails object - # * (`nil`) indicating no credentials - # - # @note Warning: Passing a `String` to a keyfile path or a `Hash` of credentials - # is deprecated. Providing an unvalidated credential configuration to - # Google APIs can compromise the security of your systems and data. - # - # @example - # - # # The recommended way to provide credentials is to use the `make_creds` method - # # on the appropriate credentials class for your environment. - # - # require "googleauth" - # - # credentials = ::Google::Auth::ServiceAccountCredentials.make_creds( - # json_key_io: ::File.open("/path/to/keyfile.json") - # ) - # - # client = ::Google::Cloud::ResourceManager::V3::TagBindings::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 = "cloudresourcemanager.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 TagBindings 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_tag_bindings` - # @return [::Gapic::Config::Method] - # - attr_reader :list_tag_bindings - ## - # RPC-specific configuration for `create_tag_binding` - # @return [::Gapic::Config::Method] - # - attr_reader :create_tag_binding - ## - # RPC-specific configuration for `delete_tag_binding` - # @return [::Gapic::Config::Method] - # - attr_reader :delete_tag_binding - ## - # RPC-specific configuration for `list_effective_tags` - # @return [::Gapic::Config::Method] - # - attr_reader :list_effective_tags - - # @private - def initialize parent_rpcs = nil - list_tag_bindings_config = parent_rpcs.list_tag_bindings if parent_rpcs.respond_to? :list_tag_bindings - @list_tag_bindings = ::Gapic::Config::Method.new list_tag_bindings_config - create_tag_binding_config = parent_rpcs.create_tag_binding if parent_rpcs.respond_to? :create_tag_binding - @create_tag_binding = ::Gapic::Config::Method.new create_tag_binding_config - delete_tag_binding_config = parent_rpcs.delete_tag_binding if parent_rpcs.respond_to? :delete_tag_binding - @delete_tag_binding = ::Gapic::Config::Method.new delete_tag_binding_config - list_effective_tags_config = parent_rpcs.list_effective_tags if parent_rpcs.respond_to? :list_effective_tags - @list_effective_tags = ::Gapic::Config::Method.new list_effective_tags_config - - yield self if block_given? - end - end - end - end - end - end - end - end -end diff --git a/owl-bot-staging/google-cloud-resource_manager-v3/lib/google/cloud/resource_manager/v3/tag_bindings/credentials.rb b/owl-bot-staging/google-cloud-resource_manager-v3/lib/google/cloud/resource_manager/v3/tag_bindings/credentials.rb deleted file mode 100644 index 55d4cd3c87d7..000000000000 --- a/owl-bot-staging/google-cloud-resource_manager-v3/lib/google/cloud/resource_manager/v3/tag_bindings/credentials.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 "googleauth" - -module Google - module Cloud - module ResourceManager - module V3 - module TagBindings - # Credentials for the TagBindings API. - class Credentials < ::Google::Auth::Credentials - self.scope = [ - "https://www.googleapis.com/auth/cloud-platform", - "https://www.googleapis.com/auth/cloud-platform.read-only" - ] - self.env_vars = [ - "RESOURCE_MANAGER_CREDENTIALS", - "RESOURCE_MANAGER_KEYFILE", - "GOOGLE_CLOUD_CREDENTIALS", - "GOOGLE_CLOUD_KEYFILE", - "GCLOUD_KEYFILE", - "RESOURCE_MANAGER_CREDENTIALS_JSON", - "RESOURCE_MANAGER_KEYFILE_JSON", - "GOOGLE_CLOUD_CREDENTIALS_JSON", - "GOOGLE_CLOUD_KEYFILE_JSON", - "GCLOUD_KEYFILE_JSON" - ] - self.paths = [ - "~/.config/google_cloud/application_default_credentials.json" - ] - end - end - end - end - end -end diff --git a/owl-bot-staging/google-cloud-resource_manager-v3/lib/google/cloud/resource_manager/v3/tag_bindings/operations.rb b/owl-bot-staging/google-cloud-resource_manager-v3/lib/google/cloud/resource_manager/v3/tag_bindings/operations.rb deleted file mode 100644 index 9d53849d8b57..000000000000 --- a/owl-bot-staging/google-cloud-resource_manager-v3/lib/google/cloud/resource_manager/v3/tag_bindings/operations.rb +++ /dev/null @@ -1,841 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -require "gapic/operation" -require "google/longrunning/operations_pb" - -module Google - module Cloud - module ResourceManager - module V3 - module TagBindings - # Service that implements Longrunning Operations API. - class Operations - # @private - API_VERSION = "" - - # @private - DEFAULT_ENDPOINT_TEMPLATE = "cloudresourcemanager.$UNIVERSE_DOMAIN$" - - # @private - attr_reader :operations_stub - - ## - # Configuration for the TagBindings 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 TagBindings 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::ResourceManager::V3::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::ResourceManager::V3::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::ResourceManager::V3::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::ResourceManager::V3::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::ResourceManager::V3::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 = "cloudresourcemanager.googleapis.com" - - config_attr :endpoint, nil, ::String, nil - config_attr :credentials, nil do |value| - allowed = [::String, ::Hash, ::Proc, ::Symbol, ::Google::Auth::Credentials, ::Google::Auth::BaseClient, ::Signet::OAuth2::Client, nil] - allowed += [::GRPC::Core::Channel, ::GRPC::Core::ChannelCredentials] if defined? ::GRPC::Core::Channel - allowed.any? { |klass| klass === value } - end - config_attr :scope, nil, ::String, ::Array, nil - config_attr :lib_name, nil, ::String, nil - config_attr :lib_version, nil, ::String, nil - config_attr(:channel_args, { "grpc.service_config_disable_resolution" => 1 }, ::Hash, nil) - config_attr :interceptors, nil, ::Array, nil - config_attr :timeout, nil, ::Numeric, nil - config_attr :metadata, nil, ::Hash, nil - config_attr :retry_policy, nil, ::Hash, ::Proc, nil - config_attr :quota_project, nil, ::String, nil - config_attr :universe_domain, nil, ::String, nil - config_attr :logger, :default, ::Logger, nil, :default - - # @private - def initialize parent_config = nil - @parent_config = parent_config unless parent_config.nil? - - yield self if block_given? - end - - ## - # Configurations for individual RPCs - # @return [Rpcs] - # - def rpcs - @rpcs ||= begin - parent_rpcs = nil - parent_rpcs = @parent_config.rpcs if defined?(@parent_config) && @parent_config.respond_to?(:rpcs) - Rpcs.new parent_rpcs - end - end - - ## - # Configuration for the channel pool - # @return [::Gapic::ServiceStub::ChannelPool::Configuration] - # - def channel_pool - @channel_pool ||= ::Gapic::ServiceStub::ChannelPool::Configuration.new - end - - ## - # Configuration RPC class for the Operations API. - # - # Includes fields providing the configuration for each RPC in this service. - # Each configuration object is of type `Gapic::Config::Method` and includes - # the following configuration fields: - # - # * `timeout` (*type:* `Numeric`) - The call timeout in seconds - # * `metadata` (*type:* `Hash{Symbol=>String}`) - Additional gRPC headers - # * `retry_policy (*type:* `Hash`) - The retry policy. The policy fields - # include the following keys: - # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds. - # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds. - # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier. - # * `:retry_codes` (*type:* `Array`) - The error codes that should - # trigger a retry. - # - class Rpcs - ## - # RPC-specific configuration for `list_operations` - # @return [::Gapic::Config::Method] - # - attr_reader :list_operations - ## - # RPC-specific configuration for `get_operation` - # @return [::Gapic::Config::Method] - # - attr_reader :get_operation - ## - # RPC-specific configuration for `delete_operation` - # @return [::Gapic::Config::Method] - # - attr_reader :delete_operation - ## - # RPC-specific configuration for `cancel_operation` - # @return [::Gapic::Config::Method] - # - attr_reader :cancel_operation - ## - # RPC-specific configuration for `wait_operation` - # @return [::Gapic::Config::Method] - # - attr_reader :wait_operation - - # @private - def initialize parent_rpcs = nil - list_operations_config = parent_rpcs.list_operations if parent_rpcs.respond_to? :list_operations - @list_operations = ::Gapic::Config::Method.new list_operations_config - get_operation_config = parent_rpcs.get_operation if parent_rpcs.respond_to? :get_operation - @get_operation = ::Gapic::Config::Method.new get_operation_config - delete_operation_config = parent_rpcs.delete_operation if parent_rpcs.respond_to? :delete_operation - @delete_operation = ::Gapic::Config::Method.new delete_operation_config - cancel_operation_config = parent_rpcs.cancel_operation if parent_rpcs.respond_to? :cancel_operation - @cancel_operation = ::Gapic::Config::Method.new cancel_operation_config - wait_operation_config = parent_rpcs.wait_operation if parent_rpcs.respond_to? :wait_operation - @wait_operation = ::Gapic::Config::Method.new wait_operation_config - - yield self if block_given? - end - end - end - end - end - end - end - end -end diff --git a/owl-bot-staging/google-cloud-resource_manager-v3/lib/google/cloud/resource_manager/v3/tag_bindings/paths.rb b/owl-bot-staging/google-cloud-resource_manager-v3/lib/google/cloud/resource_manager/v3/tag_bindings/paths.rb deleted file mode 100644 index ec819af412f6..000000000000 --- a/owl-bot-staging/google-cloud-resource_manager-v3/lib/google/cloud/resource_manager/v3/tag_bindings/paths.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! - - -module Google - module Cloud - module ResourceManager - module V3 - module TagBindings - # Path helper methods for the TagBindings API. - module Paths - ## - # Create a fully-qualified TagBinding resource string. - # - # The resource will be in the following format: - # - # `tagBindings/{tag_binding}` - # - # @param tag_binding [String] - # - # @return [::String] - def tag_binding_path tag_binding: - "tagBindings/#{tag_binding}" - end - - extend self - end - end - end - end - end -end diff --git a/owl-bot-staging/google-cloud-resource_manager-v3/lib/google/cloud/resource_manager/v3/tag_bindings/rest.rb b/owl-bot-staging/google-cloud-resource_manager-v3/lib/google/cloud/resource_manager/v3/tag_bindings/rest.rb deleted file mode 100644 index 632a9a2cfb93..000000000000 --- a/owl-bot-staging/google-cloud-resource_manager-v3/lib/google/cloud/resource_manager/v3/tag_bindings/rest.rb +++ /dev/null @@ -1,54 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -require "gapic/rest" -require "gapic/config" -require "gapic/config/method" - -require "google/cloud/resource_manager/v3/version" - -require "google/cloud/resource_manager/v3/tag_bindings/credentials" -require "google/cloud/resource_manager/v3/tag_bindings/paths" -require "google/cloud/resource_manager/v3/tag_bindings/rest/operations" -require "google/cloud/resource_manager/v3/tag_bindings/rest/client" - -module Google - module Cloud - module ResourceManager - module V3 - ## - # Allow users to create and manage TagBindings between TagValues and - # different Google Cloud resources throughout the GCP resource hierarchy. - # - # To load this service and instantiate a REST client: - # - # require "google/cloud/resource_manager/v3/tag_bindings/rest" - # client = ::Google::Cloud::ResourceManager::V3::TagBindings::Rest::Client.new - # - module TagBindings - # Client for the REST transport - module Rest - end - end - end - end - end -end - -helper_path = ::File.join __dir__, "rest", "helpers.rb" -require "google/cloud/resource_manager/v3/tag_bindings/rest/helpers" if ::File.file? helper_path diff --git a/owl-bot-staging/google-cloud-resource_manager-v3/lib/google/cloud/resource_manager/v3/tag_bindings/rest/client.rb b/owl-bot-staging/google-cloud-resource_manager-v3/lib/google/cloud/resource_manager/v3/tag_bindings/rest/client.rb deleted file mode 100644 index 5d97e3b1840a..000000000000 --- a/owl-bot-staging/google-cloud-resource_manager-v3/lib/google/cloud/resource_manager/v3/tag_bindings/rest/client.rb +++ /dev/null @@ -1,761 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -require "google/cloud/errors" -require "google/cloud/resourcemanager/v3/tag_bindings_pb" -require "google/cloud/resource_manager/v3/tag_bindings/rest/service_stub" - -module Google - module Cloud - module ResourceManager - module V3 - module TagBindings - module Rest - ## - # REST client for the TagBindings service. - # - # Allow users to create and manage TagBindings between TagValues and - # different Google Cloud resources throughout the GCP resource hierarchy. - # - class Client - # @private - API_VERSION = "" - - # @private - DEFAULT_ENDPOINT_TEMPLATE = "cloudresourcemanager.$UNIVERSE_DOMAIN$" - - include Paths - - # @private - attr_reader :tag_bindings_stub - - ## - # Configure the TagBindings Client class. - # - # See {::Google::Cloud::ResourceManager::V3::TagBindings::Rest::Client::Configuration} - # for a description of the configuration fields. - # - # @example - # - # # Modify the configuration for all TagBindings clients - # ::Google::Cloud::ResourceManager::V3::TagBindings::Rest::Client.configure do |config| - # config.timeout = 10.0 - # end - # - # @yield [config] Configure the Client client. - # @yieldparam config [Client::Configuration] - # - # @return [Client::Configuration] - # - def self.configure - @configure ||= begin - namespace = ["Google", "Cloud", "ResourceManager", "V3"] - parent_config = while namespace.any? - parent_name = namespace.join "::" - parent_const = const_get parent_name - break parent_const.configure if parent_const.respond_to? :configure - namespace.pop - end - default_config = Client::Configuration.new parent_config - - default_config.rpcs.list_tag_bindings.timeout = 60.0 - default_config.rpcs.list_tag_bindings.retry_policy = { - initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [14] - } - - default_config.rpcs.create_tag_binding.timeout = 60.0 - - default_config.rpcs.delete_tag_binding.timeout = 60.0 - - default_config - end - yield @configure if block_given? - @configure - end - - ## - # Configure the TagBindings Client instance. - # - # The configuration is set to the derived mode, meaning that values can be changed, - # but structural changes (adding new fields, etc.) are not allowed. Structural changes - # should be made on {Client.configure}. - # - # See {::Google::Cloud::ResourceManager::V3::TagBindings::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 - @tag_bindings_stub.universe_domain - end - - ## - # Create a new TagBindings REST client object. - # - # @example - # - # # Create a client using the default configuration - # client = ::Google::Cloud::ResourceManager::V3::TagBindings::Rest::Client.new - # - # # Create a client using a custom configuration - # client = ::Google::Cloud::ResourceManager::V3::TagBindings::Rest::Client.new do |config| - # config.timeout = 10.0 - # end - # - # @yield [config] Configure the TagBindings client. - # @yieldparam config [Client::Configuration] - # - def initialize - # Create the configuration object - @config = Configuration.new Client.configure - - # Yield the configuration if needed - yield @config if block_given? - - # Create credentials - credentials = @config.credentials - # Use self-signed JWT if the endpoint is unchanged from default, - # but only if the default endpoint does not have a region prefix. - enable_self_signed_jwt = @config.endpoint.nil? || - (@config.endpoint == Configuration::DEFAULT_ENDPOINT && - !@config.endpoint.split(".").first.include?("-")) - credentials ||= Credentials.default scope: @config.scope, - enable_self_signed_jwt: enable_self_signed_jwt - if credentials.is_a?(::String) || credentials.is_a?(::Hash) - credentials = Credentials.new credentials, scope: @config.scope - end - - @quota_project_id = @config.quota_project - @quota_project_id ||= credentials.quota_project_id if credentials.respond_to? :quota_project_id - - @operations_client = ::Google::Cloud::ResourceManager::V3::TagBindings::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 - - @tag_bindings_stub = ::Google::Cloud::ResourceManager::V3::TagBindings::Rest::ServiceStub.new( - endpoint: @config.endpoint, - endpoint_template: DEFAULT_ENDPOINT_TEMPLATE, - universe_domain: @config.universe_domain, - credentials: credentials, - logger: @config.logger - ) - - @tag_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 - end - - ## - # Get the associated client for long-running operations. - # - # @return [::Google::Cloud::ResourceManager::V3::TagBindings::Rest::Operations] - # - attr_reader :operations_client - - ## - # The logger used for request/response debug logging. - # - # @return [Logger] - # - def logger - @tag_bindings_stub.logger - end - - # Service calls - - ## - # Lists the TagBindings for the given Google Cloud resource, as specified - # with `parent`. - # - # NOTE: The `parent` field is expected to be a full resource name: - # https://cloud.google.com/apis/design/resource_names#full_resource_name - # - # @overload list_tag_bindings(request, options = nil) - # Pass arguments to `list_tag_bindings` via a request object, either of type - # {::Google::Cloud::ResourceManager::V3::ListTagBindingsRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::ResourceManager::V3::ListTagBindingsRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_tag_bindings(parent: nil, page_size: nil, page_token: nil) - # Pass arguments to `list_tag_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 full resource name of a resource for which you want to list - # existing TagBindings. E.g. - # "//cloudresourcemanager.googleapis.com/projects/123" - # @param page_size [::Integer] - # Optional. The maximum number of TagBindings to return in the response. The - # server allows a maximum of 300 TagBindings to return. If unspecified, the - # server will use 100 as the default. - # @param page_token [::String] - # Optional. A pagination token returned from a previous call to - # `ListTagBindings` that indicates where this listing should continue from. - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Gapic::Rest::PagedEnumerable<::Google::Cloud::ResourceManager::V3::TagBinding>] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Gapic::Rest::PagedEnumerable<::Google::Cloud::ResourceManager::V3::TagBinding>] - # - # @raise [::Google::Cloud::Error] if the REST call is aborted. - # - # @example Basic example - # require "google/cloud/resource_manager/v3" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::ResourceManager::V3::TagBindings::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::ResourceManager::V3::ListTagBindingsRequest.new - # - # # Call the list_tag_bindings method. - # result = client.list_tag_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::Cloud::ResourceManager::V3::TagBinding. - # p item - # end - # - def list_tag_bindings request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::ResourceManager::V3::ListTagBindingsRequest - - # Converts hash 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_tag_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::ResourceManager::V3::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_tag_bindings.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.list_tag_bindings.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @tag_bindings_stub.list_tag_bindings request, options do |result, operation| - result = ::Gapic::Rest::PagedEnumerable.new @tag_bindings_stub, :list_tag_bindings, "tag_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 - - ## - # Creates a TagBinding between a TagValue and a Google Cloud resource. - # - # @overload create_tag_binding(request, options = nil) - # Pass arguments to `create_tag_binding` via a request object, either of type - # {::Google::Cloud::ResourceManager::V3::CreateTagBindingRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::ResourceManager::V3::CreateTagBindingRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_tag_binding(tag_binding: nil, validate_only: nil) - # Pass arguments to `create_tag_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 tag_binding [::Google::Cloud::ResourceManager::V3::TagBinding, ::Hash] - # Required. The TagBinding to be created. - # @param validate_only [::Boolean] - # Optional. Set to true to perform the validations necessary for creating the - # resource, but not actually perform the action. - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Gapic::Operation] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Gapic::Operation] - # - # @raise [::Google::Cloud::Error] if the REST call is aborted. - # - # @example Basic example - # require "google/cloud/resource_manager/v3" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::ResourceManager::V3::TagBindings::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::ResourceManager::V3::CreateTagBindingRequest.new - # - # # Call the create_tag_binding method. - # result = client.create_tag_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_tag_binding request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::ResourceManager::V3::CreateTagBindingRequest - - # Converts hash 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_tag_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::ResourceManager::V3::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_tag_binding.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.create_tag_binding.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @tag_bindings_stub.create_tag_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 TagBinding. - # - # @overload delete_tag_binding(request, options = nil) - # Pass arguments to `delete_tag_binding` via a request object, either of type - # {::Google::Cloud::ResourceManager::V3::DeleteTagBindingRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::ResourceManager::V3::DeleteTagBindingRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_tag_binding(name: nil) - # Pass arguments to `delete_tag_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 TagBinding. This is a String of the form: - # `tagBindings/{id}` (e.g. - # `tagBindings/%2F%2Fcloudresourcemanager.googleapis.com%2Fprojects%2F123/tagValues/456`). - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Gapic::Operation] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Gapic::Operation] - # - # @raise [::Google::Cloud::Error] if the REST call is aborted. - # - # @example Basic example - # require "google/cloud/resource_manager/v3" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::ResourceManager::V3::TagBindings::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::ResourceManager::V3::DeleteTagBindingRequest.new - # - # # Call the delete_tag_binding method. - # result = client.delete_tag_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_tag_binding request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::ResourceManager::V3::DeleteTagBindingRequest - - # Converts hash 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_tag_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::ResourceManager::V3::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_tag_binding.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.delete_tag_binding.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @tag_bindings_stub.delete_tag_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 - - ## - # Return a list of effective tags for the given Google Cloud resource, as - # specified in `parent`. - # - # @overload list_effective_tags(request, options = nil) - # Pass arguments to `list_effective_tags` via a request object, either of type - # {::Google::Cloud::ResourceManager::V3::ListEffectiveTagsRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::ResourceManager::V3::ListEffectiveTagsRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_effective_tags(parent: nil, page_size: nil, page_token: nil) - # Pass arguments to `list_effective_tags` via keyword arguments. Note that at - # least one keyword argument is 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 full resource name of a resource for which you want to list - # the effective tags. E.g. - # "//cloudresourcemanager.googleapis.com/projects/123" - # @param page_size [::Integer] - # Optional. The maximum number of effective tags to return in the response. - # The server allows a maximum of 300 effective tags to return in a single - # page. If unspecified, the server will use 100 as the default. - # @param page_token [::String] - # Optional. A pagination token returned from a previous call to - # `ListEffectiveTags` that indicates from where this listing should continue. - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Gapic::Rest::PagedEnumerable<::Google::Cloud::ResourceManager::V3::EffectiveTag>] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Gapic::Rest::PagedEnumerable<::Google::Cloud::ResourceManager::V3::EffectiveTag>] - # - # @raise [::Google::Cloud::Error] if the REST call is aborted. - # - # @example Basic example - # require "google/cloud/resource_manager/v3" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::ResourceManager::V3::TagBindings::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::ResourceManager::V3::ListEffectiveTagsRequest.new - # - # # Call the list_effective_tags method. - # result = client.list_effective_tags request - # - # # The returned object is of type Gapic::PagedEnumerable. You can iterate - # # over elements, and API calls will be issued to fetch pages as needed. - # result.each do |item| - # # Each element is of type ::Google::Cloud::ResourceManager::V3::EffectiveTag. - # p item - # end - # - def list_effective_tags request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::ResourceManager::V3::ListEffectiveTagsRequest - - # Converts hash 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_effective_tags.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::ResourceManager::V3::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_effective_tags.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.list_effective_tags.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @tag_bindings_stub.list_effective_tags request, options do |result, operation| - result = ::Gapic::Rest::PagedEnumerable.new @tag_bindings_stub, :list_effective_tags, "effective_tags", 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 TagBindings REST API. - # - # This class represents the configuration for TagBindings REST, - # providing control over timeouts, retry behavior, logging, transport - # parameters, and other low-level controls. Certain parameters can also be - # applied individually to specific RPCs. See - # {::Google::Cloud::ResourceManager::V3::TagBindings::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_tag_bindings to 20 seconds, - # # and all remaining timeouts to 10 seconds. - # ::Google::Cloud::ResourceManager::V3::TagBindings::Rest::Client.configure do |config| - # config.timeout = 10.0 - # config.rpcs.list_tag_bindings.timeout = 20.0 - # end - # - # # Apply the above configuration only to a new client. - # client = ::Google::Cloud::ResourceManager::V3::TagBindings::Rest::Client.new do |config| - # config.timeout = 10.0 - # config.rpcs.list_tag_bindings.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 = "cloudresourcemanager.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 TagBindings 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_tag_bindings` - # @return [::Gapic::Config::Method] - # - attr_reader :list_tag_bindings - ## - # RPC-specific configuration for `create_tag_binding` - # @return [::Gapic::Config::Method] - # - attr_reader :create_tag_binding - ## - # RPC-specific configuration for `delete_tag_binding` - # @return [::Gapic::Config::Method] - # - attr_reader :delete_tag_binding - ## - # RPC-specific configuration for `list_effective_tags` - # @return [::Gapic::Config::Method] - # - attr_reader :list_effective_tags - - # @private - def initialize parent_rpcs = nil - list_tag_bindings_config = parent_rpcs.list_tag_bindings if parent_rpcs.respond_to? :list_tag_bindings - @list_tag_bindings = ::Gapic::Config::Method.new list_tag_bindings_config - create_tag_binding_config = parent_rpcs.create_tag_binding if parent_rpcs.respond_to? :create_tag_binding - @create_tag_binding = ::Gapic::Config::Method.new create_tag_binding_config - delete_tag_binding_config = parent_rpcs.delete_tag_binding if parent_rpcs.respond_to? :delete_tag_binding - @delete_tag_binding = ::Gapic::Config::Method.new delete_tag_binding_config - list_effective_tags_config = parent_rpcs.list_effective_tags if parent_rpcs.respond_to? :list_effective_tags - @list_effective_tags = ::Gapic::Config::Method.new list_effective_tags_config - - yield self if block_given? - end - end - end - end - end - end - end - end - end -end diff --git a/owl-bot-staging/google-cloud-resource_manager-v3/lib/google/cloud/resource_manager/v3/tag_bindings/rest/operations.rb b/owl-bot-staging/google-cloud-resource_manager-v3/lib/google/cloud/resource_manager/v3/tag_bindings/rest/operations.rb deleted file mode 100644 index 24dca1e8fb88..000000000000 --- a/owl-bot-staging/google-cloud-resource_manager-v3/lib/google/cloud/resource_manager/v3/tag_bindings/rest/operations.rb +++ /dev/null @@ -1,925 +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 Cloud - module ResourceManager - module V3 - module TagBindings - module Rest - # Service that implements Longrunning Operations API. - class Operations - # @private - API_VERSION = "" - - # @private - DEFAULT_ENDPOINT_TEMPLATE = "cloudresourcemanager.$UNIVERSE_DOMAIN$" - - # @private - attr_reader :operations_stub - - ## - # Configuration for the TagBindings 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 TagBindings 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::ResourceManager::V3::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::ResourceManager::V3::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::ResourceManager::V3::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::ResourceManager::V3::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 = "cloudresourcemanager.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: "/v3/{name}", - matches: [ - ["name", %r{^operations(?:/.*)?$}, true] - ] - ) - 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 -end diff --git a/owl-bot-staging/google-cloud-resource_manager-v3/lib/google/cloud/resource_manager/v3/tag_bindings/rest/service_stub.rb b/owl-bot-staging/google-cloud-resource_manager-v3/lib/google/cloud/resource_manager/v3/tag_bindings/rest/service_stub.rb deleted file mode 100644 index ce15bb219df9..000000000000 --- a/owl-bot-staging/google-cloud-resource_manager-v3/lib/google/cloud/resource_manager/v3/tag_bindings/rest/service_stub.rb +++ /dev/null @@ -1,320 +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/resourcemanager/v3/tag_bindings_pb" - -module Google - module Cloud - module ResourceManager - module V3 - module TagBindings - module Rest - ## - # REST service stub for the TagBindings service. - # Service stub contains baseline method implementations - # including transcoding, making the REST call, and deserialing the response. - # - class ServiceStub - # @private - def initialize endpoint:, endpoint_template:, universe_domain:, credentials:, logger: - # These require statements are intentionally placed here to initialize - # the REST modules only when it's required. - require "gapic/rest" - - @client_stub = ::Gapic::Rest::ClientStub.new endpoint: endpoint, - endpoint_template: endpoint_template, - universe_domain: universe_domain, - credentials: credentials, - numeric_enums: true, - service_name: self.class, - raise_faraday_errors: false, - logger: logger - end - - ## - # The effective universe domain - # - # @return [String] - # - def universe_domain - @client_stub.universe_domain - end - - ## - # The effective endpoint - # - # @return [String] - # - def endpoint - @client_stub.endpoint - end - - ## - # The logger used for request/response debug logging. - # - # @return [Logger] - # - def logger stub: false - stub ? @client_stub.stub_logger : @client_stub.logger - end - - ## - # Baseline implementation for the list_tag_bindings REST call - # - # @param request_pb [::Google::Cloud::ResourceManager::V3::ListTagBindingsRequest] - # A request object representing the call parameters. Required. - # @param options [::Gapic::CallOptions] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Cloud::ResourceManager::V3::ListTagBindingsResponse] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::ResourceManager::V3::ListTagBindingsResponse] - # A result object deserialized from the server's reply - def list_tag_bindings request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_list_tag_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_tag_bindings", - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Cloud::ResourceManager::V3::ListTagBindingsResponse.decode_json response.body, ignore_unknown_fields: true - catch :response do - yield result, operation if block_given? - result - end - end - - ## - # Baseline implementation for the create_tag_binding REST call - # - # @param request_pb [::Google::Cloud::ResourceManager::V3::CreateTagBindingRequest] - # 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_tag_binding request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_create_tag_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_tag_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_tag_binding REST call - # - # @param request_pb [::Google::Cloud::ResourceManager::V3::DeleteTagBindingRequest] - # 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_tag_binding request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_delete_tag_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_tag_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_effective_tags REST call - # - # @param request_pb [::Google::Cloud::ResourceManager::V3::ListEffectiveTagsRequest] - # A request object representing the call parameters. Required. - # @param options [::Gapic::CallOptions] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Cloud::ResourceManager::V3::ListEffectiveTagsResponse] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::ResourceManager::V3::ListEffectiveTagsResponse] - # A result object deserialized from the server's reply - def list_effective_tags request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_list_effective_tags_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_effective_tags", - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Cloud::ResourceManager::V3::ListEffectiveTagsResponse.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_tag_bindings REST call - # - # @param request_pb [::Google::Cloud::ResourceManager::V3::ListTagBindingsRequest] - # 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_tag_bindings_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :get, - uri_template: "/v3/tagBindings", - matches: [] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the create_tag_binding REST call - # - # @param request_pb [::Google::Cloud::ResourceManager::V3::CreateTagBindingRequest] - # 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_tag_binding_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :post, - uri_template: "/v3/tagBindings", - body: "tag_binding", - matches: [] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the delete_tag_binding REST call - # - # @param request_pb [::Google::Cloud::ResourceManager::V3::DeleteTagBindingRequest] - # 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_tag_binding_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :delete, - uri_template: "/v3/{name}", - matches: [ - ["name", %r{^tagBindings(?:/.*)?$}, true] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the list_effective_tags REST call - # - # @param request_pb [::Google::Cloud::ResourceManager::V3::ListEffectiveTagsRequest] - # 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_effective_tags_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :get, - uri_template: "/v3/effectiveTags", - matches: [] - ) - transcoder.transcode request_pb - end - end - end - end - end - end - end -end diff --git a/owl-bot-staging/google-cloud-resource_manager-v3/lib/google/cloud/resource_manager/v3/tag_holds.rb b/owl-bot-staging/google-cloud-resource_manager-v3/lib/google/cloud/resource_manager/v3/tag_holds.rb deleted file mode 100644 index eb3948031b20..000000000000 --- a/owl-bot-staging/google-cloud-resource_manager-v3/lib/google/cloud/resource_manager/v3/tag_holds.rb +++ /dev/null @@ -1,60 +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/resource_manager/v3/version" - -require "google/cloud/resource_manager/v3/tag_holds/credentials" -require "google/cloud/resource_manager/v3/tag_holds/paths" -require "google/cloud/resource_manager/v3/tag_holds/operations" -require "google/cloud/resource_manager/v3/tag_holds/client" -require "google/cloud/resource_manager/v3/tag_holds/rest" - -module Google - module Cloud - module ResourceManager - module V3 - ## - # Allow users to create and manage TagHolds for TagValues. TagHolds represent - # the use of a Tag Value that is not captured by TagBindings but - # should still block TagValue deletion (such as a reference in a policy - # condition). This service provides isolated failure domains by cloud location - # so that TagHolds can be managed in the same location as their usage. - # - # @example Load this service and instantiate a gRPC client - # - # require "google/cloud/resource_manager/v3/tag_holds" - # client = ::Google::Cloud::ResourceManager::V3::TagHolds::Client.new - # - # @example Load this service and instantiate a REST client - # - # require "google/cloud/resource_manager/v3/tag_holds/rest" - # client = ::Google::Cloud::ResourceManager::V3::TagHolds::Rest::Client.new - # - module TagHolds - end - end - end - end -end - -helper_path = ::File.join __dir__, "tag_holds", "helpers.rb" -require "google/cloud/resource_manager/v3/tag_holds/helpers" if ::File.file? helper_path diff --git a/owl-bot-staging/google-cloud-resource_manager-v3/lib/google/cloud/resource_manager/v3/tag_holds/client.rb b/owl-bot-staging/google-cloud-resource_manager-v3/lib/google/cloud/resource_manager/v3/tag_holds/client.rb deleted file mode 100644 index 2c46a253724b..000000000000 --- a/owl-bot-staging/google-cloud-resource_manager-v3/lib/google/cloud/resource_manager/v3/tag_holds/client.rb +++ /dev/null @@ -1,731 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -require "google/cloud/errors" -require "google/cloud/resourcemanager/v3/tag_holds_pb" - -module Google - module Cloud - module ResourceManager - module V3 - module TagHolds - ## - # Client for the TagHolds service. - # - # Allow users to create and manage TagHolds for TagValues. TagHolds represent - # the use of a Tag Value that is not captured by TagBindings but - # should still block TagValue deletion (such as a reference in a policy - # condition). This service provides isolated failure domains by cloud location - # so that TagHolds can be managed in the same location as their usage. - # - class Client - # @private - API_VERSION = "" - - # @private - DEFAULT_ENDPOINT_TEMPLATE = "cloudresourcemanager.$UNIVERSE_DOMAIN$" - - include Paths - - # @private - attr_reader :tag_holds_stub - - ## - # Configure the TagHolds Client class. - # - # See {::Google::Cloud::ResourceManager::V3::TagHolds::Client::Configuration} - # for a description of the configuration fields. - # - # @example - # - # # Modify the configuration for all TagHolds clients - # ::Google::Cloud::ResourceManager::V3::TagHolds::Client.configure do |config| - # config.timeout = 10.0 - # end - # - # @yield [config] Configure the Client client. - # @yieldparam config [Client::Configuration] - # - # @return [Client::Configuration] - # - def self.configure - @configure ||= begin - namespace = ["Google", "Cloud", "ResourceManager", "V3"] - parent_config = while namespace.any? - parent_name = namespace.join "::" - parent_const = const_get parent_name - break parent_const.configure if parent_const.respond_to? :configure - namespace.pop - end - default_config = Client::Configuration.new parent_config - - default_config - end - yield @configure if block_given? - @configure - end - - ## - # Configure the TagHolds Client instance. - # - # The configuration is set to the derived mode, meaning that values can be changed, - # but structural changes (adding new fields, etc.) are not allowed. Structural changes - # should be made on {Client.configure}. - # - # See {::Google::Cloud::ResourceManager::V3::TagHolds::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 - @tag_holds_stub.universe_domain - end - - ## - # Create a new TagHolds client object. - # - # @example - # - # # Create a client using the default configuration - # client = ::Google::Cloud::ResourceManager::V3::TagHolds::Client.new - # - # # Create a client using a custom configuration - # client = ::Google::Cloud::ResourceManager::V3::TagHolds::Client.new do |config| - # config.timeout = 10.0 - # end - # - # @yield [config] Configure the TagHolds client. - # @yieldparam config [Client::Configuration] - # - def initialize - # These require statements are intentionally placed here to initialize - # the gRPC module only when it's required. - # See https://github.com/googleapis/toolkit/issues/446 - require "gapic/grpc" - require "google/cloud/resourcemanager/v3/tag_holds_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 - - @tag_holds_stub = ::Gapic::ServiceStub.new( - ::Google::Cloud::ResourceManager::V3::TagHolds::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 - ) - - @tag_holds_stub.stub_logger&.info do |entry| - entry.set_system_name - entry.set_service - entry.message = "Created client for #{entry.service}" - entry.set_credentials_fields credentials - entry.set "customEndpoint", @config.endpoint if @config.endpoint - entry.set "defaultTimeout", @config.timeout if @config.timeout - entry.set "quotaProject", @quota_project_id if @quota_project_id - end - end - - ## - # Get the associated client for long-running operations. - # - # @return [::Google::Cloud::ResourceManager::V3::TagHolds::Operations] - # - attr_reader :operations_client - - ## - # The logger used for request/response debug logging. - # - # @return [Logger] - # - def logger - @tag_holds_stub.logger - end - - # Service calls - - ## - # Creates a TagHold. Returns ALREADY_EXISTS if a TagHold with the same - # resource and origin exists under the same TagValue. - # - # @overload create_tag_hold(request, options = nil) - # Pass arguments to `create_tag_hold` via a request object, either of type - # {::Google::Cloud::ResourceManager::V3::CreateTagHoldRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::ResourceManager::V3::CreateTagHoldRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_tag_hold(parent: nil, tag_hold: nil, validate_only: nil) - # Pass arguments to `create_tag_hold` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param parent [::String] - # Required. The resource name of the TagHold's parent TagValue. Must be of - # the form: `tagValues/{tag-value-id}`. - # @param tag_hold [::Google::Cloud::ResourceManager::V3::TagHold, ::Hash] - # Required. The TagHold to be created. - # @param validate_only [::Boolean] - # Optional. Set to true to perform the validations necessary for creating the - # resource, but not actually perform the action. - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Gapic::Operation] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Gapic::Operation] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/cloud/resource_manager/v3" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::ResourceManager::V3::TagHolds::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::ResourceManager::V3::CreateTagHoldRequest.new - # - # # Call the create_tag_hold method. - # result = client.create_tag_hold 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_tag_hold request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::ResourceManager::V3::CreateTagHoldRequest - - # Converts hash 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_tag_hold.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::ResourceManager::V3::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_tag_hold.timeout, - metadata: metadata, - retry_policy: @config.rpcs.create_tag_hold.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @tag_holds_stub.call_rpc :create_tag_hold, 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 TagHold. - # - # @overload delete_tag_hold(request, options = nil) - # Pass arguments to `delete_tag_hold` via a request object, either of type - # {::Google::Cloud::ResourceManager::V3::DeleteTagHoldRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::ResourceManager::V3::DeleteTagHoldRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_tag_hold(name: nil, validate_only: nil) - # Pass arguments to `delete_tag_hold` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param name [::String] - # Required. The resource name of the TagHold to delete. Must be of the form: - # `tagValues/{tag-value-id}/tagHolds/{tag-hold-id}`. - # @param validate_only [::Boolean] - # Optional. Set to true to perform the validations necessary for deleting the - # resource, but not actually perform the action. - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Gapic::Operation] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Gapic::Operation] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/cloud/resource_manager/v3" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::ResourceManager::V3::TagHolds::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::ResourceManager::V3::DeleteTagHoldRequest.new - # - # # Call the delete_tag_hold method. - # result = client.delete_tag_hold 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_tag_hold request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::ResourceManager::V3::DeleteTagHoldRequest - - # Converts hash 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_tag_hold.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::ResourceManager::V3::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_tag_hold.timeout, - metadata: metadata, - retry_policy: @config.rpcs.delete_tag_hold.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @tag_holds_stub.call_rpc :delete_tag_hold, 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 TagHolds under a TagValue. - # - # @overload list_tag_holds(request, options = nil) - # Pass arguments to `list_tag_holds` via a request object, either of type - # {::Google::Cloud::ResourceManager::V3::ListTagHoldsRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::ResourceManager::V3::ListTagHoldsRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_tag_holds(parent: nil, page_size: nil, page_token: nil, filter: nil) - # Pass arguments to `list_tag_holds` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param parent [::String] - # Required. The resource name of the parent TagValue. Must be of the form: - # `tagValues/{tag-value-id}`. - # @param page_size [::Integer] - # Optional. The maximum number of TagHolds to return in the response. The - # server allows a maximum of 300 TagHolds to return. If unspecified, the - # server will use 100 as the default. - # @param page_token [::String] - # Optional. A pagination token returned from a previous call to - # `ListTagHolds` that indicates where this listing should continue from. - # @param filter [::String] - # Optional. Criteria used to select a subset of TagHolds parented by the - # TagValue to return. This field follows the syntax defined by aip.dev/160; - # the `holder` and `origin` fields are supported for filtering. Currently - # only `AND` syntax is supported. Some example queries are: - # - # * `holder = - # //compute.googleapis.com/compute/projects/myproject/regions/us-east-1/instanceGroupManagers/instance-group` - # * `origin = 35678234` - # * `holder = - # //compute.googleapis.com/compute/projects/myproject/regions/us-east-1/instanceGroupManagers/instance-group - # AND origin = 35678234` - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Gapic::PagedEnumerable<::Google::Cloud::ResourceManager::V3::TagHold>] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Gapic::PagedEnumerable<::Google::Cloud::ResourceManager::V3::TagHold>] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/cloud/resource_manager/v3" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::ResourceManager::V3::TagHolds::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::ResourceManager::V3::ListTagHoldsRequest.new - # - # # Call the list_tag_holds method. - # result = client.list_tag_holds request - # - # # The returned object is of type Gapic::PagedEnumerable. You can iterate - # # over elements, and API calls will be issued to fetch pages as needed. - # result.each do |item| - # # Each element is of type ::Google::Cloud::ResourceManager::V3::TagHold. - # p item - # end - # - def list_tag_holds request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::ResourceManager::V3::ListTagHoldsRequest - - # Converts hash 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_tag_holds.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::ResourceManager::V3::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_tag_holds.timeout, - metadata: metadata, - retry_policy: @config.rpcs.list_tag_holds.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @tag_holds_stub.call_rpc :list_tag_holds, request, options: options do |response, operation| - response = ::Gapic::PagedEnumerable.new @tag_holds_stub, :list_tag_holds, 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 TagHolds API. - # - # This class represents the configuration for TagHolds, - # providing control over timeouts, retry behavior, logging, transport - # parameters, and other low-level controls. Certain parameters can also be - # applied individually to specific RPCs. See - # {::Google::Cloud::ResourceManager::V3::TagHolds::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_tag_hold to 20 seconds, - # # and all remaining timeouts to 10 seconds. - # ::Google::Cloud::ResourceManager::V3::TagHolds::Client.configure do |config| - # config.timeout = 10.0 - # config.rpcs.create_tag_hold.timeout = 20.0 - # end - # - # # Apply the above configuration only to a new client. - # client = ::Google::Cloud::ResourceManager::V3::TagHolds::Client.new do |config| - # config.timeout = 10.0 - # config.rpcs.create_tag_hold.timeout = 20.0 - # end - # - # @!attribute [rw] endpoint - # A custom service endpoint, as a hostname or hostname:port. The default is - # nil, indicating to use the default endpoint in the current universe domain. - # @return [::String,nil] - # @!attribute [rw] credentials - # Credentials to send with calls. You may provide any of the following types: - # * (`Google::Auth::Credentials`) A googleauth credentials object - # (see the [googleauth docs](https://rubydoc.info/gems/googleauth/Google/Auth/Credentials)) - # * (`Signet::OAuth2::Client`) A signet oauth2 client object - # (see the [signet docs](https://rubydoc.info/gems/signet/Signet/OAuth2/Client)) - # * (`GRPC::Core::Channel`) a gRPC channel with included credentials - # * (`GRPC::Core::ChannelCredentials`) a gRPC credentails object - # * (`nil`) indicating no credentials - # - # @note Warning: Passing a `String` to a keyfile path or a `Hash` of credentials - # is deprecated. Providing an unvalidated credential configuration to - # Google APIs can compromise the security of your systems and data. - # - # @example - # - # # The recommended way to provide credentials is to use the `make_creds` method - # # on the appropriate credentials class for your environment. - # - # require "googleauth" - # - # credentials = ::Google::Auth::ServiceAccountCredentials.make_creds( - # json_key_io: ::File.open("/path/to/keyfile.json") - # ) - # - # client = ::Google::Cloud::ResourceManager::V3::TagHolds::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 = "cloudresourcemanager.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 TagHolds 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_tag_hold` - # @return [::Gapic::Config::Method] - # - attr_reader :create_tag_hold - ## - # RPC-specific configuration for `delete_tag_hold` - # @return [::Gapic::Config::Method] - # - attr_reader :delete_tag_hold - ## - # RPC-specific configuration for `list_tag_holds` - # @return [::Gapic::Config::Method] - # - attr_reader :list_tag_holds - - # @private - def initialize parent_rpcs = nil - create_tag_hold_config = parent_rpcs.create_tag_hold if parent_rpcs.respond_to? :create_tag_hold - @create_tag_hold = ::Gapic::Config::Method.new create_tag_hold_config - delete_tag_hold_config = parent_rpcs.delete_tag_hold if parent_rpcs.respond_to? :delete_tag_hold - @delete_tag_hold = ::Gapic::Config::Method.new delete_tag_hold_config - list_tag_holds_config = parent_rpcs.list_tag_holds if parent_rpcs.respond_to? :list_tag_holds - @list_tag_holds = ::Gapic::Config::Method.new list_tag_holds_config - - yield self if block_given? - end - end - end - end - end - end - end - end -end diff --git a/owl-bot-staging/google-cloud-resource_manager-v3/lib/google/cloud/resource_manager/v3/tag_holds/credentials.rb b/owl-bot-staging/google-cloud-resource_manager-v3/lib/google/cloud/resource_manager/v3/tag_holds/credentials.rb deleted file mode 100644 index 0df0322ec54e..000000000000 --- a/owl-bot-staging/google-cloud-resource_manager-v3/lib/google/cloud/resource_manager/v3/tag_holds/credentials.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 "googleauth" - -module Google - module Cloud - module ResourceManager - module V3 - module TagHolds - # Credentials for the TagHolds API. - class Credentials < ::Google::Auth::Credentials - self.scope = [ - "https://www.googleapis.com/auth/cloud-platform", - "https://www.googleapis.com/auth/cloud-platform.read-only" - ] - self.env_vars = [ - "RESOURCE_MANAGER_CREDENTIALS", - "RESOURCE_MANAGER_KEYFILE", - "GOOGLE_CLOUD_CREDENTIALS", - "GOOGLE_CLOUD_KEYFILE", - "GCLOUD_KEYFILE", - "RESOURCE_MANAGER_CREDENTIALS_JSON", - "RESOURCE_MANAGER_KEYFILE_JSON", - "GOOGLE_CLOUD_CREDENTIALS_JSON", - "GOOGLE_CLOUD_KEYFILE_JSON", - "GCLOUD_KEYFILE_JSON" - ] - self.paths = [ - "~/.config/google_cloud/application_default_credentials.json" - ] - end - end - end - end - end -end diff --git a/owl-bot-staging/google-cloud-resource_manager-v3/lib/google/cloud/resource_manager/v3/tag_holds/operations.rb b/owl-bot-staging/google-cloud-resource_manager-v3/lib/google/cloud/resource_manager/v3/tag_holds/operations.rb deleted file mode 100644 index 297d89e18866..000000000000 --- a/owl-bot-staging/google-cloud-resource_manager-v3/lib/google/cloud/resource_manager/v3/tag_holds/operations.rb +++ /dev/null @@ -1,841 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -require "gapic/operation" -require "google/longrunning/operations_pb" - -module Google - module Cloud - module ResourceManager - module V3 - module TagHolds - # Service that implements Longrunning Operations API. - class Operations - # @private - API_VERSION = "" - - # @private - DEFAULT_ENDPOINT_TEMPLATE = "cloudresourcemanager.$UNIVERSE_DOMAIN$" - - # @private - attr_reader :operations_stub - - ## - # Configuration for the TagHolds 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 TagHolds 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::ResourceManager::V3::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::ResourceManager::V3::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::ResourceManager::V3::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::ResourceManager::V3::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::ResourceManager::V3::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 = "cloudresourcemanager.googleapis.com" - - config_attr :endpoint, nil, ::String, nil - config_attr :credentials, nil do |value| - allowed = [::String, ::Hash, ::Proc, ::Symbol, ::Google::Auth::Credentials, ::Google::Auth::BaseClient, ::Signet::OAuth2::Client, nil] - allowed += [::GRPC::Core::Channel, ::GRPC::Core::ChannelCredentials] if defined? ::GRPC::Core::Channel - allowed.any? { |klass| klass === value } - end - config_attr :scope, nil, ::String, ::Array, nil - config_attr :lib_name, nil, ::String, nil - config_attr :lib_version, nil, ::String, nil - config_attr(:channel_args, { "grpc.service_config_disable_resolution" => 1 }, ::Hash, nil) - config_attr :interceptors, nil, ::Array, nil - config_attr :timeout, nil, ::Numeric, nil - config_attr :metadata, nil, ::Hash, nil - config_attr :retry_policy, nil, ::Hash, ::Proc, nil - config_attr :quota_project, nil, ::String, nil - config_attr :universe_domain, nil, ::String, nil - config_attr :logger, :default, ::Logger, nil, :default - - # @private - def initialize parent_config = nil - @parent_config = parent_config unless parent_config.nil? - - yield self if block_given? - end - - ## - # Configurations for individual RPCs - # @return [Rpcs] - # - def rpcs - @rpcs ||= begin - parent_rpcs = nil - parent_rpcs = @parent_config.rpcs if defined?(@parent_config) && @parent_config.respond_to?(:rpcs) - Rpcs.new parent_rpcs - end - end - - ## - # Configuration for the channel pool - # @return [::Gapic::ServiceStub::ChannelPool::Configuration] - # - def channel_pool - @channel_pool ||= ::Gapic::ServiceStub::ChannelPool::Configuration.new - end - - ## - # Configuration RPC class for the Operations API. - # - # Includes fields providing the configuration for each RPC in this service. - # Each configuration object is of type `Gapic::Config::Method` and includes - # the following configuration fields: - # - # * `timeout` (*type:* `Numeric`) - The call timeout in seconds - # * `metadata` (*type:* `Hash{Symbol=>String}`) - Additional gRPC headers - # * `retry_policy (*type:* `Hash`) - The retry policy. The policy fields - # include the following keys: - # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds. - # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds. - # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier. - # * `:retry_codes` (*type:* `Array`) - The error codes that should - # trigger a retry. - # - class Rpcs - ## - # RPC-specific configuration for `list_operations` - # @return [::Gapic::Config::Method] - # - attr_reader :list_operations - ## - # RPC-specific configuration for `get_operation` - # @return [::Gapic::Config::Method] - # - attr_reader :get_operation - ## - # RPC-specific configuration for `delete_operation` - # @return [::Gapic::Config::Method] - # - attr_reader :delete_operation - ## - # RPC-specific configuration for `cancel_operation` - # @return [::Gapic::Config::Method] - # - attr_reader :cancel_operation - ## - # RPC-specific configuration for `wait_operation` - # @return [::Gapic::Config::Method] - # - attr_reader :wait_operation - - # @private - def initialize parent_rpcs = nil - list_operations_config = parent_rpcs.list_operations if parent_rpcs.respond_to? :list_operations - @list_operations = ::Gapic::Config::Method.new list_operations_config - get_operation_config = parent_rpcs.get_operation if parent_rpcs.respond_to? :get_operation - @get_operation = ::Gapic::Config::Method.new get_operation_config - delete_operation_config = parent_rpcs.delete_operation if parent_rpcs.respond_to? :delete_operation - @delete_operation = ::Gapic::Config::Method.new delete_operation_config - cancel_operation_config = parent_rpcs.cancel_operation if parent_rpcs.respond_to? :cancel_operation - @cancel_operation = ::Gapic::Config::Method.new cancel_operation_config - wait_operation_config = parent_rpcs.wait_operation if parent_rpcs.respond_to? :wait_operation - @wait_operation = ::Gapic::Config::Method.new wait_operation_config - - yield self if block_given? - end - end - end - end - end - end - end - end -end diff --git a/owl-bot-staging/google-cloud-resource_manager-v3/lib/google/cloud/resource_manager/v3/tag_holds/paths.rb b/owl-bot-staging/google-cloud-resource_manager-v3/lib/google/cloud/resource_manager/v3/tag_holds/paths.rb deleted file mode 100644 index ea7ad8358ce4..000000000000 --- a/owl-bot-staging/google-cloud-resource_manager-v3/lib/google/cloud/resource_manager/v3/tag_holds/paths.rb +++ /dev/null @@ -1,64 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - - -module Google - module Cloud - module ResourceManager - module V3 - module TagHolds - # Path helper methods for the TagHolds API. - module Paths - ## - # Create a fully-qualified TagHold resource string. - # - # The resource will be in the following format: - # - # `tagValues/{tag_value}/tagHolds/{tag_hold}` - # - # @param tag_value [String] - # @param tag_hold [String] - # - # @return [::String] - def tag_hold_path tag_value:, tag_hold: - raise ::ArgumentError, "tag_value cannot contain /" if tag_value.to_s.include? "/" - - "tagValues/#{tag_value}/tagHolds/#{tag_hold}" - end - - ## - # Create a fully-qualified TagValue resource string. - # - # The resource will be in the following format: - # - # `tagValues/{tag_value}` - # - # @param tag_value [String] - # - # @return [::String] - def tag_value_path tag_value: - "tagValues/#{tag_value}" - end - - extend self - end - end - end - end - end -end diff --git a/owl-bot-staging/google-cloud-resource_manager-v3/lib/google/cloud/resource_manager/v3/tag_holds/rest.rb b/owl-bot-staging/google-cloud-resource_manager-v3/lib/google/cloud/resource_manager/v3/tag_holds/rest.rb deleted file mode 100644 index 47b03b2721f1..000000000000 --- a/owl-bot-staging/google-cloud-resource_manager-v3/lib/google/cloud/resource_manager/v3/tag_holds/rest.rb +++ /dev/null @@ -1,57 +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/resource_manager/v3/version" - -require "google/cloud/resource_manager/v3/tag_holds/credentials" -require "google/cloud/resource_manager/v3/tag_holds/paths" -require "google/cloud/resource_manager/v3/tag_holds/rest/operations" -require "google/cloud/resource_manager/v3/tag_holds/rest/client" - -module Google - module Cloud - module ResourceManager - module V3 - ## - # Allow users to create and manage TagHolds for TagValues. TagHolds represent - # the use of a Tag Value that is not captured by TagBindings but - # should still block TagValue deletion (such as a reference in a policy - # condition). This service provides isolated failure domains by cloud location - # so that TagHolds can be managed in the same location as their usage. - # - # To load this service and instantiate a REST client: - # - # require "google/cloud/resource_manager/v3/tag_holds/rest" - # client = ::Google::Cloud::ResourceManager::V3::TagHolds::Rest::Client.new - # - module TagHolds - # Client for the REST transport - module Rest - end - end - end - end - end -end - -helper_path = ::File.join __dir__, "rest", "helpers.rb" -require "google/cloud/resource_manager/v3/tag_holds/rest/helpers" if ::File.file? helper_path diff --git a/owl-bot-staging/google-cloud-resource_manager-v3/lib/google/cloud/resource_manager/v3/tag_holds/rest/client.rb b/owl-bot-staging/google-cloud-resource_manager-v3/lib/google/cloud/resource_manager/v3/tag_holds/rest/client.rb deleted file mode 100644 index a3741d8b8416..000000000000 --- a/owl-bot-staging/google-cloud-resource_manager-v3/lib/google/cloud/resource_manager/v3/tag_holds/rest/client.rb +++ /dev/null @@ -1,667 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -require "google/cloud/errors" -require "google/cloud/resourcemanager/v3/tag_holds_pb" -require "google/cloud/resource_manager/v3/tag_holds/rest/service_stub" - -module Google - module Cloud - module ResourceManager - module V3 - module TagHolds - module Rest - ## - # REST client for the TagHolds service. - # - # Allow users to create and manage TagHolds for TagValues. TagHolds represent - # the use of a Tag Value that is not captured by TagBindings but - # should still block TagValue deletion (such as a reference in a policy - # condition). This service provides isolated failure domains by cloud location - # so that TagHolds can be managed in the same location as their usage. - # - class Client - # @private - API_VERSION = "" - - # @private - DEFAULT_ENDPOINT_TEMPLATE = "cloudresourcemanager.$UNIVERSE_DOMAIN$" - - include Paths - - # @private - attr_reader :tag_holds_stub - - ## - # Configure the TagHolds Client class. - # - # See {::Google::Cloud::ResourceManager::V3::TagHolds::Rest::Client::Configuration} - # for a description of the configuration fields. - # - # @example - # - # # Modify the configuration for all TagHolds clients - # ::Google::Cloud::ResourceManager::V3::TagHolds::Rest::Client.configure do |config| - # config.timeout = 10.0 - # end - # - # @yield [config] Configure the Client client. - # @yieldparam config [Client::Configuration] - # - # @return [Client::Configuration] - # - def self.configure - @configure ||= begin - namespace = ["Google", "Cloud", "ResourceManager", "V3"] - parent_config = while namespace.any? - parent_name = namespace.join "::" - parent_const = const_get parent_name - break parent_const.configure if parent_const.respond_to? :configure - namespace.pop - end - default_config = Client::Configuration.new parent_config - - default_config - end - yield @configure if block_given? - @configure - end - - ## - # Configure the TagHolds Client instance. - # - # The configuration is set to the derived mode, meaning that values can be changed, - # but structural changes (adding new fields, etc.) are not allowed. Structural changes - # should be made on {Client.configure}. - # - # See {::Google::Cloud::ResourceManager::V3::TagHolds::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 - @tag_holds_stub.universe_domain - end - - ## - # Create a new TagHolds REST client object. - # - # @example - # - # # Create a client using the default configuration - # client = ::Google::Cloud::ResourceManager::V3::TagHolds::Rest::Client.new - # - # # Create a client using a custom configuration - # client = ::Google::Cloud::ResourceManager::V3::TagHolds::Rest::Client.new do |config| - # config.timeout = 10.0 - # end - # - # @yield [config] Configure the TagHolds client. - # @yieldparam config [Client::Configuration] - # - def initialize - # Create the configuration object - @config = Configuration.new Client.configure - - # Yield the configuration if needed - yield @config if block_given? - - # Create credentials - credentials = @config.credentials - # Use self-signed JWT if the endpoint is unchanged from default, - # but only if the default endpoint does not have a region prefix. - enable_self_signed_jwt = @config.endpoint.nil? || - (@config.endpoint == Configuration::DEFAULT_ENDPOINT && - !@config.endpoint.split(".").first.include?("-")) - credentials ||= Credentials.default scope: @config.scope, - enable_self_signed_jwt: enable_self_signed_jwt - if credentials.is_a?(::String) || credentials.is_a?(::Hash) - credentials = Credentials.new credentials, scope: @config.scope - end - - @quota_project_id = @config.quota_project - @quota_project_id ||= credentials.quota_project_id if credentials.respond_to? :quota_project_id - - @operations_client = ::Google::Cloud::ResourceManager::V3::TagHolds::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 - - @tag_holds_stub = ::Google::Cloud::ResourceManager::V3::TagHolds::Rest::ServiceStub.new( - endpoint: @config.endpoint, - endpoint_template: DEFAULT_ENDPOINT_TEMPLATE, - universe_domain: @config.universe_domain, - credentials: credentials, - logger: @config.logger - ) - - @tag_holds_stub.logger(stub: true)&.info do |entry| - entry.set_system_name - entry.set_service - entry.message = "Created client for #{entry.service}" - entry.set_credentials_fields credentials - entry.set "customEndpoint", @config.endpoint if @config.endpoint - entry.set "defaultTimeout", @config.timeout if @config.timeout - entry.set "quotaProject", @quota_project_id if @quota_project_id - end - end - - ## - # Get the associated client for long-running operations. - # - # @return [::Google::Cloud::ResourceManager::V3::TagHolds::Rest::Operations] - # - attr_reader :operations_client - - ## - # The logger used for request/response debug logging. - # - # @return [Logger] - # - def logger - @tag_holds_stub.logger - end - - # Service calls - - ## - # Creates a TagHold. Returns ALREADY_EXISTS if a TagHold with the same - # resource and origin exists under the same TagValue. - # - # @overload create_tag_hold(request, options = nil) - # Pass arguments to `create_tag_hold` via a request object, either of type - # {::Google::Cloud::ResourceManager::V3::CreateTagHoldRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::ResourceManager::V3::CreateTagHoldRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_tag_hold(parent: nil, tag_hold: nil, validate_only: nil) - # Pass arguments to `create_tag_hold` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param parent [::String] - # Required. The resource name of the TagHold's parent TagValue. Must be of - # the form: `tagValues/{tag-value-id}`. - # @param tag_hold [::Google::Cloud::ResourceManager::V3::TagHold, ::Hash] - # Required. The TagHold to be created. - # @param validate_only [::Boolean] - # Optional. Set to true to perform the validations necessary for creating the - # resource, but not actually perform the action. - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Gapic::Operation] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Gapic::Operation] - # - # @raise [::Google::Cloud::Error] if the REST call is aborted. - # - # @example Basic example - # require "google/cloud/resource_manager/v3" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::ResourceManager::V3::TagHolds::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::ResourceManager::V3::CreateTagHoldRequest.new - # - # # Call the create_tag_hold method. - # result = client.create_tag_hold 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_tag_hold request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::ResourceManager::V3::CreateTagHoldRequest - - # Converts hash 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_tag_hold.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::ResourceManager::V3::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_tag_hold.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.create_tag_hold.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @tag_holds_stub.create_tag_hold 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 TagHold. - # - # @overload delete_tag_hold(request, options = nil) - # Pass arguments to `delete_tag_hold` via a request object, either of type - # {::Google::Cloud::ResourceManager::V3::DeleteTagHoldRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::ResourceManager::V3::DeleteTagHoldRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_tag_hold(name: nil, validate_only: nil) - # Pass arguments to `delete_tag_hold` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param name [::String] - # Required. The resource name of the TagHold to delete. Must be of the form: - # `tagValues/{tag-value-id}/tagHolds/{tag-hold-id}`. - # @param validate_only [::Boolean] - # Optional. Set to true to perform the validations necessary for deleting the - # resource, but not actually perform the action. - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Gapic::Operation] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Gapic::Operation] - # - # @raise [::Google::Cloud::Error] if the REST call is aborted. - # - # @example Basic example - # require "google/cloud/resource_manager/v3" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::ResourceManager::V3::TagHolds::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::ResourceManager::V3::DeleteTagHoldRequest.new - # - # # Call the delete_tag_hold method. - # result = client.delete_tag_hold 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_tag_hold request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::ResourceManager::V3::DeleteTagHoldRequest - - # Converts hash 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_tag_hold.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::ResourceManager::V3::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_tag_hold.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.delete_tag_hold.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @tag_holds_stub.delete_tag_hold 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 TagHolds under a TagValue. - # - # @overload list_tag_holds(request, options = nil) - # Pass arguments to `list_tag_holds` via a request object, either of type - # {::Google::Cloud::ResourceManager::V3::ListTagHoldsRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::ResourceManager::V3::ListTagHoldsRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_tag_holds(parent: nil, page_size: nil, page_token: nil, filter: nil) - # Pass arguments to `list_tag_holds` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param parent [::String] - # Required. The resource name of the parent TagValue. Must be of the form: - # `tagValues/{tag-value-id}`. - # @param page_size [::Integer] - # Optional. The maximum number of TagHolds to return in the response. The - # server allows a maximum of 300 TagHolds to return. If unspecified, the - # server will use 100 as the default. - # @param page_token [::String] - # Optional. A pagination token returned from a previous call to - # `ListTagHolds` that indicates where this listing should continue from. - # @param filter [::String] - # Optional. Criteria used to select a subset of TagHolds parented by the - # TagValue to return. This field follows the syntax defined by aip.dev/160; - # the `holder` and `origin` fields are supported for filtering. Currently - # only `AND` syntax is supported. Some example queries are: - # - # * `holder = - # //compute.googleapis.com/compute/projects/myproject/regions/us-east-1/instanceGroupManagers/instance-group` - # * `origin = 35678234` - # * `holder = - # //compute.googleapis.com/compute/projects/myproject/regions/us-east-1/instanceGroupManagers/instance-group - # AND origin = 35678234` - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Gapic::Rest::PagedEnumerable<::Google::Cloud::ResourceManager::V3::TagHold>] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Gapic::Rest::PagedEnumerable<::Google::Cloud::ResourceManager::V3::TagHold>] - # - # @raise [::Google::Cloud::Error] if the REST call is aborted. - # - # @example Basic example - # require "google/cloud/resource_manager/v3" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::ResourceManager::V3::TagHolds::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::ResourceManager::V3::ListTagHoldsRequest.new - # - # # Call the list_tag_holds method. - # result = client.list_tag_holds request - # - # # The returned object is of type Gapic::PagedEnumerable. You can iterate - # # over elements, and API calls will be issued to fetch pages as needed. - # result.each do |item| - # # Each element is of type ::Google::Cloud::ResourceManager::V3::TagHold. - # p item - # end - # - def list_tag_holds request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::ResourceManager::V3::ListTagHoldsRequest - - # Converts hash 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_tag_holds.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::ResourceManager::V3::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_tag_holds.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.list_tag_holds.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @tag_holds_stub.list_tag_holds request, options do |result, operation| - result = ::Gapic::Rest::PagedEnumerable.new @tag_holds_stub, :list_tag_holds, "tag_holds", 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 TagHolds REST API. - # - # This class represents the configuration for TagHolds REST, - # providing control over timeouts, retry behavior, logging, transport - # parameters, and other low-level controls. Certain parameters can also be - # applied individually to specific RPCs. See - # {::Google::Cloud::ResourceManager::V3::TagHolds::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_tag_hold to 20 seconds, - # # and all remaining timeouts to 10 seconds. - # ::Google::Cloud::ResourceManager::V3::TagHolds::Rest::Client.configure do |config| - # config.timeout = 10.0 - # config.rpcs.create_tag_hold.timeout = 20.0 - # end - # - # # Apply the above configuration only to a new client. - # client = ::Google::Cloud::ResourceManager::V3::TagHolds::Rest::Client.new do |config| - # config.timeout = 10.0 - # config.rpcs.create_tag_hold.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 = "cloudresourcemanager.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 TagHolds 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_tag_hold` - # @return [::Gapic::Config::Method] - # - attr_reader :create_tag_hold - ## - # RPC-specific configuration for `delete_tag_hold` - # @return [::Gapic::Config::Method] - # - attr_reader :delete_tag_hold - ## - # RPC-specific configuration for `list_tag_holds` - # @return [::Gapic::Config::Method] - # - attr_reader :list_tag_holds - - # @private - def initialize parent_rpcs = nil - create_tag_hold_config = parent_rpcs.create_tag_hold if parent_rpcs.respond_to? :create_tag_hold - @create_tag_hold = ::Gapic::Config::Method.new create_tag_hold_config - delete_tag_hold_config = parent_rpcs.delete_tag_hold if parent_rpcs.respond_to? :delete_tag_hold - @delete_tag_hold = ::Gapic::Config::Method.new delete_tag_hold_config - list_tag_holds_config = parent_rpcs.list_tag_holds if parent_rpcs.respond_to? :list_tag_holds - @list_tag_holds = ::Gapic::Config::Method.new list_tag_holds_config - - yield self if block_given? - end - end - end - end - end - end - end - end - end -end diff --git a/owl-bot-staging/google-cloud-resource_manager-v3/lib/google/cloud/resource_manager/v3/tag_holds/rest/operations.rb b/owl-bot-staging/google-cloud-resource_manager-v3/lib/google/cloud/resource_manager/v3/tag_holds/rest/operations.rb deleted file mode 100644 index 190a3bbfc666..000000000000 --- a/owl-bot-staging/google-cloud-resource_manager-v3/lib/google/cloud/resource_manager/v3/tag_holds/rest/operations.rb +++ /dev/null @@ -1,925 +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 Cloud - module ResourceManager - module V3 - module TagHolds - module Rest - # Service that implements Longrunning Operations API. - class Operations - # @private - API_VERSION = "" - - # @private - DEFAULT_ENDPOINT_TEMPLATE = "cloudresourcemanager.$UNIVERSE_DOMAIN$" - - # @private - attr_reader :operations_stub - - ## - # Configuration for the TagHolds 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 TagHolds 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::ResourceManager::V3::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::ResourceManager::V3::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::ResourceManager::V3::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::ResourceManager::V3::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 = "cloudresourcemanager.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: "/v3/{name}", - matches: [ - ["name", %r{^operations(?:/.*)?$}, true] - ] - ) - 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 -end diff --git a/owl-bot-staging/google-cloud-resource_manager-v3/lib/google/cloud/resource_manager/v3/tag_holds/rest/service_stub.rb b/owl-bot-staging/google-cloud-resource_manager-v3/lib/google/cloud/resource_manager/v3/tag_holds/rest/service_stub.rb deleted file mode 100644 index c839e05338b9..000000000000 --- a/owl-bot-staging/google-cloud-resource_manager-v3/lib/google/cloud/resource_manager/v3/tag_holds/rest/service_stub.rb +++ /dev/null @@ -1,265 +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/resourcemanager/v3/tag_holds_pb" - -module Google - module Cloud - module ResourceManager - module V3 - module TagHolds - module Rest - ## - # REST service stub for the TagHolds 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_tag_hold REST call - # - # @param request_pb [::Google::Cloud::ResourceManager::V3::CreateTagHoldRequest] - # 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_tag_hold request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_create_tag_hold_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_tag_hold", - 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_tag_hold REST call - # - # @param request_pb [::Google::Cloud::ResourceManager::V3::DeleteTagHoldRequest] - # 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_tag_hold request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_delete_tag_hold_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_tag_hold", - 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_tag_holds REST call - # - # @param request_pb [::Google::Cloud::ResourceManager::V3::ListTagHoldsRequest] - # A request object representing the call parameters. Required. - # @param options [::Gapic::CallOptions] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Cloud::ResourceManager::V3::ListTagHoldsResponse] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::ResourceManager::V3::ListTagHoldsResponse] - # A result object deserialized from the server's reply - def list_tag_holds request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_list_tag_holds_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_tag_holds", - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Cloud::ResourceManager::V3::ListTagHoldsResponse.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_tag_hold REST call - # - # @param request_pb [::Google::Cloud::ResourceManager::V3::CreateTagHoldRequest] - # 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_tag_hold_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :post, - uri_template: "/v3/{parent}/tagHolds", - body: "tag_hold", - matches: [ - ["parent", %r{^tagValues/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the delete_tag_hold REST call - # - # @param request_pb [::Google::Cloud::ResourceManager::V3::DeleteTagHoldRequest] - # 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_tag_hold_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :delete, - uri_template: "/v3/{name}", - matches: [ - ["name", %r{^tagValues/[^/]+/tagHolds/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the list_tag_holds REST call - # - # @param request_pb [::Google::Cloud::ResourceManager::V3::ListTagHoldsRequest] - # 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_tag_holds_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :get, - uri_template: "/v3/{parent}/tagHolds", - matches: [ - ["parent", %r{^tagValues/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - end - end - end - end - end - end -end diff --git a/owl-bot-staging/google-cloud-resource_manager-v3/lib/google/cloud/resource_manager/v3/tag_keys.rb b/owl-bot-staging/google-cloud-resource_manager-v3/lib/google/cloud/resource_manager/v3/tag_keys.rb deleted file mode 100644 index 0829e8b4bf11..000000000000 --- a/owl-bot-staging/google-cloud-resource_manager-v3/lib/google/cloud/resource_manager/v3/tag_keys.rb +++ /dev/null @@ -1,56 +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/resource_manager/v3/version" - -require "google/cloud/resource_manager/v3/tag_keys/credentials" -require "google/cloud/resource_manager/v3/tag_keys/paths" -require "google/cloud/resource_manager/v3/tag_keys/operations" -require "google/cloud/resource_manager/v3/tag_keys/client" -require "google/cloud/resource_manager/v3/tag_keys/rest" - -module Google - module Cloud - module ResourceManager - module V3 - ## - # Allow users to create and manage tag keys. - # - # @example Load this service and instantiate a gRPC client - # - # require "google/cloud/resource_manager/v3/tag_keys" - # client = ::Google::Cloud::ResourceManager::V3::TagKeys::Client.new - # - # @example Load this service and instantiate a REST client - # - # require "google/cloud/resource_manager/v3/tag_keys/rest" - # client = ::Google::Cloud::ResourceManager::V3::TagKeys::Rest::Client.new - # - module TagKeys - end - end - end - end -end - -helper_path = ::File.join __dir__, "tag_keys", "helpers.rb" -require "google/cloud/resource_manager/v3/tag_keys/helpers" if ::File.file? helper_path diff --git a/owl-bot-staging/google-cloud-resource_manager-v3/lib/google/cloud/resource_manager/v3/tag_keys/client.rb b/owl-bot-staging/google-cloud-resource_manager-v3/lib/google/cloud/resource_manager/v3/tag_keys/client.rb deleted file mode 100644 index 7e46ff3cd69f..000000000000 --- a/owl-bot-staging/google-cloud-resource_manager-v3/lib/google/cloud/resource_manager/v3/tag_keys/client.rb +++ /dev/null @@ -1,1333 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -require "google/cloud/errors" -require "google/cloud/resourcemanager/v3/tag_keys_pb" - -module Google - module Cloud - module ResourceManager - module V3 - module TagKeys - ## - # Client for the TagKeys service. - # - # Allow users to create and manage tag keys. - # - class Client - # @private - API_VERSION = "" - - # @private - DEFAULT_ENDPOINT_TEMPLATE = "cloudresourcemanager.$UNIVERSE_DOMAIN$" - - include Paths - - # @private - attr_reader :tag_keys_stub - - ## - # Configure the TagKeys Client class. - # - # See {::Google::Cloud::ResourceManager::V3::TagKeys::Client::Configuration} - # for a description of the configuration fields. - # - # @example - # - # # Modify the configuration for all TagKeys clients - # ::Google::Cloud::ResourceManager::V3::TagKeys::Client.configure do |config| - # config.timeout = 10.0 - # end - # - # @yield [config] Configure the Client client. - # @yieldparam config [Client::Configuration] - # - # @return [Client::Configuration] - # - def self.configure - @configure ||= begin - namespace = ["Google", "Cloud", "ResourceManager", "V3"] - parent_config = while namespace.any? - parent_name = namespace.join "::" - parent_const = const_get parent_name - break parent_const.configure if parent_const.respond_to? :configure - namespace.pop - end - default_config = Client::Configuration.new parent_config - - default_config.rpcs.list_tag_keys.timeout = 60.0 - default_config.rpcs.list_tag_keys.retry_policy = { - initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [14] - } - - default_config.rpcs.get_tag_key.timeout = 60.0 - default_config.rpcs.get_tag_key.retry_policy = { - initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [14] - } - - default_config.rpcs.create_tag_key.timeout = 60.0 - - default_config.rpcs.update_tag_key.timeout = 60.0 - - default_config.rpcs.delete_tag_key.timeout = 60.0 - - default_config.rpcs.get_iam_policy.timeout = 60.0 - default_config.rpcs.get_iam_policy.retry_policy = { - initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [14] - } - - default_config.rpcs.set_iam_policy.timeout = 60.0 - - default_config - end - yield @configure if block_given? - @configure - end - - ## - # Configure the TagKeys Client instance. - # - # The configuration is set to the derived mode, meaning that values can be changed, - # but structural changes (adding new fields, etc.) are not allowed. Structural changes - # should be made on {Client.configure}. - # - # See {::Google::Cloud::ResourceManager::V3::TagKeys::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 - @tag_keys_stub.universe_domain - end - - ## - # Create a new TagKeys client object. - # - # @example - # - # # Create a client using the default configuration - # client = ::Google::Cloud::ResourceManager::V3::TagKeys::Client.new - # - # # Create a client using a custom configuration - # client = ::Google::Cloud::ResourceManager::V3::TagKeys::Client.new do |config| - # config.timeout = 10.0 - # end - # - # @yield [config] Configure the TagKeys client. - # @yieldparam config [Client::Configuration] - # - def initialize - # These require statements are intentionally placed here to initialize - # the gRPC module only when it's required. - # See https://github.com/googleapis/toolkit/issues/446 - require "gapic/grpc" - require "google/cloud/resourcemanager/v3/tag_keys_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 - - @tag_keys_stub = ::Gapic::ServiceStub.new( - ::Google::Cloud::ResourceManager::V3::TagKeys::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 - ) - - @tag_keys_stub.stub_logger&.info do |entry| - entry.set_system_name - entry.set_service - entry.message = "Created client for #{entry.service}" - entry.set_credentials_fields credentials - entry.set "customEndpoint", @config.endpoint if @config.endpoint - entry.set "defaultTimeout", @config.timeout if @config.timeout - entry.set "quotaProject", @quota_project_id if @quota_project_id - end - end - - ## - # Get the associated client for long-running operations. - # - # @return [::Google::Cloud::ResourceManager::V3::TagKeys::Operations] - # - attr_reader :operations_client - - ## - # The logger used for request/response debug logging. - # - # @return [Logger] - # - def logger - @tag_keys_stub.logger - end - - # Service calls - - ## - # Lists all TagKeys for a parent resource. - # - # @overload list_tag_keys(request, options = nil) - # Pass arguments to `list_tag_keys` via a request object, either of type - # {::Google::Cloud::ResourceManager::V3::ListTagKeysRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::ResourceManager::V3::ListTagKeysRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_tag_keys(parent: nil, page_size: nil, page_token: nil) - # Pass arguments to `list_tag_keys` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param parent [::String] - # Required. The resource name of the TagKey's parent. - # Must be of the form `organizations/{org_id}` or `projects/{project_id}` or - # `projects/{project_number}` - # @param page_size [::Integer] - # Optional. The maximum number of TagKeys to return in the response. The - # server allows a maximum of 300 TagKeys to return. If unspecified, the - # server will use 100 as the default. - # @param page_token [::String] - # Optional. A pagination token returned from a previous call to `ListTagKey` - # that indicates where this listing should continue from. - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Gapic::PagedEnumerable<::Google::Cloud::ResourceManager::V3::TagKey>] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Gapic::PagedEnumerable<::Google::Cloud::ResourceManager::V3::TagKey>] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/cloud/resource_manager/v3" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::ResourceManager::V3::TagKeys::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::ResourceManager::V3::ListTagKeysRequest.new - # - # # Call the list_tag_keys method. - # result = client.list_tag_keys request - # - # # The returned object is of type Gapic::PagedEnumerable. You can iterate - # # over elements, and API calls will be issued to fetch pages as needed. - # result.each do |item| - # # Each element is of type ::Google::Cloud::ResourceManager::V3::TagKey. - # p item - # end - # - def list_tag_keys request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::ResourceManager::V3::ListTagKeysRequest - - # Converts hash 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_tag_keys.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::ResourceManager::V3::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.list_tag_keys.timeout, - metadata: metadata, - retry_policy: @config.rpcs.list_tag_keys.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @tag_keys_stub.call_rpc :list_tag_keys, request, options: options do |response, operation| - response = ::Gapic::PagedEnumerable.new @tag_keys_stub, :list_tag_keys, 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 - - ## - # Retrieves a TagKey. This method will return `PERMISSION_DENIED` if the - # key does not exist or the user does not have permission to view it. - # - # @overload get_tag_key(request, options = nil) - # Pass arguments to `get_tag_key` via a request object, either of type - # {::Google::Cloud::ResourceManager::V3::GetTagKeyRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::ResourceManager::V3::GetTagKeyRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_tag_key(name: nil) - # Pass arguments to `get_tag_key` via keyword arguments. Note that at - # least one keyword argument is 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. A resource name in the format `tagKeys/{id}`, such as - # `tagKeys/123`. - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Google::Cloud::ResourceManager::V3::TagKey] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Google::Cloud::ResourceManager::V3::TagKey] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/cloud/resource_manager/v3" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::ResourceManager::V3::TagKeys::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::ResourceManager::V3::GetTagKeyRequest.new - # - # # Call the get_tag_key method. - # result = client.get_tag_key request - # - # # The returned object is of type Google::Cloud::ResourceManager::V3::TagKey. - # p result - # - def get_tag_key request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::ResourceManager::V3::GetTagKeyRequest - - # Converts hash 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_tag_key.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::ResourceManager::V3::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_tag_key.timeout, - metadata: metadata, - retry_policy: @config.rpcs.get_tag_key.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @tag_keys_stub.call_rpc :get_tag_key, request, options: options do |response, operation| - yield response, operation if block_given? - end - rescue ::GRPC::BadStatus => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Retrieves a TagKey by its namespaced name. - # This method will return `PERMISSION_DENIED` if the key does not exist - # or the user does not have permission to view it. - # - # @overload get_namespaced_tag_key(request, options = nil) - # Pass arguments to `get_namespaced_tag_key` via a request object, either of type - # {::Google::Cloud::ResourceManager::V3::GetNamespacedTagKeyRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::ResourceManager::V3::GetNamespacedTagKeyRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_namespaced_tag_key(name: nil) - # Pass arguments to `get_namespaced_tag_key` via keyword arguments. Note that at - # least one keyword argument is 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. A namespaced tag key name in the format - # `{parentId}/{tagKeyShort}`, such as `42/foo` for a key with short name - # "foo" under the organization with ID 42 or `r2-d2/bar` for a key with short - # name "bar" under the project `r2-d2`. - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Google::Cloud::ResourceManager::V3::TagKey] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Google::Cloud::ResourceManager::V3::TagKey] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/cloud/resource_manager/v3" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::ResourceManager::V3::TagKeys::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::ResourceManager::V3::GetNamespacedTagKeyRequest.new - # - # # Call the get_namespaced_tag_key method. - # result = client.get_namespaced_tag_key request - # - # # The returned object is of type Google::Cloud::ResourceManager::V3::TagKey. - # p result - # - def get_namespaced_tag_key request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::ResourceManager::V3::GetNamespacedTagKeyRequest - - # Converts hash 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_namespaced_tag_key.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::ResourceManager::V3::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.get_namespaced_tag_key.timeout, - metadata: metadata, - retry_policy: @config.rpcs.get_namespaced_tag_key.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @tag_keys_stub.call_rpc :get_namespaced_tag_key, request, options: options do |response, operation| - yield response, operation if block_given? - end - rescue ::GRPC::BadStatus => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Creates a new TagKey. If another request with the same parameters is - # sent while the original request is in process, the second request - # will receive an error. A maximum of 1000 TagKeys can exist under a parent - # at any given time. - # - # @overload create_tag_key(request, options = nil) - # Pass arguments to `create_tag_key` via a request object, either of type - # {::Google::Cloud::ResourceManager::V3::CreateTagKeyRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::ResourceManager::V3::CreateTagKeyRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_tag_key(tag_key: nil, validate_only: nil) - # Pass arguments to `create_tag_key` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param tag_key [::Google::Cloud::ResourceManager::V3::TagKey, ::Hash] - # Required. The TagKey to be created. Only fields `short_name`, - # `description`, and `parent` are considered during the creation request. - # @param validate_only [::Boolean] - # Optional. Set to true to perform validations necessary for creating the - # resource, but not actually perform the action. - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Gapic::Operation] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Gapic::Operation] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/cloud/resource_manager/v3" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::ResourceManager::V3::TagKeys::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::ResourceManager::V3::CreateTagKeyRequest.new - # - # # Call the create_tag_key method. - # result = client.create_tag_key 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_tag_key request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::ResourceManager::V3::CreateTagKeyRequest - - # Converts hash 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_tag_key.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::ResourceManager::V3::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.create_tag_key.timeout, - metadata: metadata, - retry_policy: @config.rpcs.create_tag_key.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @tag_keys_stub.call_rpc :create_tag_key, request, options: options do |response, operation| - response = ::Gapic::Operation.new response, @operations_client, options: options - yield response, operation if block_given? - throw :response, response - end - rescue ::GRPC::BadStatus => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Updates the attributes of the TagKey resource. - # - # @overload update_tag_key(request, options = nil) - # Pass arguments to `update_tag_key` via a request object, either of type - # {::Google::Cloud::ResourceManager::V3::UpdateTagKeyRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::ResourceManager::V3::UpdateTagKeyRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_tag_key(tag_key: nil, update_mask: nil, validate_only: nil) - # Pass arguments to `update_tag_key` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param tag_key [::Google::Cloud::ResourceManager::V3::TagKey, ::Hash] - # Required. The new definition of the TagKey. Only the `description` and - # `etag` fields can be updated by this request. If the `etag` field is not - # empty, it must match the `etag` field of the existing tag key. Otherwise, - # `ABORTED` will be returned. - # @param update_mask [::Google::Protobuf::FieldMask, ::Hash] - # Fields to be updated. The mask may only contain `description` or - # `etag`. If omitted entirely, both `description` and `etag` are assumed to - # be significant. - # @param validate_only [::Boolean] - # Set as true to perform validations necessary for updating the resource, but - # not actually perform the action. - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Gapic::Operation] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Gapic::Operation] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/cloud/resource_manager/v3" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::ResourceManager::V3::TagKeys::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::ResourceManager::V3::UpdateTagKeyRequest.new - # - # # Call the update_tag_key method. - # result = client.update_tag_key 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_tag_key request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::ResourceManager::V3::UpdateTagKeyRequest - - # Converts hash 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_tag_key.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::ResourceManager::V3::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.tag_key&.name - header_params["tag_key.name"] = request.tag_key.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_tag_key.timeout, - metadata: metadata, - retry_policy: @config.rpcs.update_tag_key.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @tag_keys_stub.call_rpc :update_tag_key, 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 TagKey. The TagKey cannot be deleted if it has any child - # TagValues. - # - # @overload delete_tag_key(request, options = nil) - # Pass arguments to `delete_tag_key` via a request object, either of type - # {::Google::Cloud::ResourceManager::V3::DeleteTagKeyRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::ResourceManager::V3::DeleteTagKeyRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_tag_key(name: nil, validate_only: nil, etag: nil) - # Pass arguments to `delete_tag_key` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param name [::String] - # Required. The resource name of a TagKey to be deleted in the format - # `tagKeys/123`. The TagKey cannot be a parent of any existing TagValues or - # it will not be deleted successfully. - # @param validate_only [::Boolean] - # Optional. Set as true to perform validations necessary for deletion, but - # not actually perform the action. - # @param etag [::String] - # Optional. The etag known to the client for the expected state of the - # TagKey. This is to be used for optimistic concurrency. - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Gapic::Operation] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Gapic::Operation] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/cloud/resource_manager/v3" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::ResourceManager::V3::TagKeys::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::ResourceManager::V3::DeleteTagKeyRequest.new - # - # # Call the delete_tag_key method. - # result = client.delete_tag_key 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_tag_key request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::ResourceManager::V3::DeleteTagKeyRequest - - # Converts hash 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_tag_key.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::ResourceManager::V3::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_tag_key.timeout, - metadata: metadata, - retry_policy: @config.rpcs.delete_tag_key.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @tag_keys_stub.call_rpc :delete_tag_key, 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 the access control policy for a TagKey. The returned policy may be - # empty if no such policy or resource exists. The `resource` field should - # be the TagKey's resource name. For example, "tagKeys/1234". - # The caller must have - # `cloudresourcemanager.googleapis.com/tagKeys.getIamPolicy` permission on - # the specified TagKey. - # - # @overload get_iam_policy(request, options = nil) - # Pass arguments to `get_iam_policy` via a request object, either of type - # {::Google::Iam::V1::GetIamPolicyRequest} or an equivalent Hash. - # - # @param request [::Google::Iam::V1::GetIamPolicyRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. - # - # @overload get_iam_policy(resource: nil, options: nil) - # Pass arguments to `get_iam_policy` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param resource [::String] - # REQUIRED: The resource for which the policy is being requested. - # See the operation documentation for the appropriate value for this field. - # @param options [::Google::Iam::V1::GetPolicyOptions, ::Hash] - # OPTIONAL: A `GetPolicyOptions` object for specifying options to - # `GetIamPolicy`. - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Google::Iam::V1::Policy] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Google::Iam::V1::Policy] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/cloud/resource_manager/v3" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::ResourceManager::V3::TagKeys::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Iam::V1::GetIamPolicyRequest.new - # - # # Call the get_iam_policy method. - # result = client.get_iam_policy request - # - # # The returned object is of type Google::Iam::V1::Policy. - # p result - # - def get_iam_policy request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Iam::V1::GetIamPolicyRequest - - # Converts hash and nil to an options object - options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h - - # Customize the options with defaults - metadata = @config.rpcs.get_iam_policy.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::ResourceManager::V3::VERSION - metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - header_params = {} - if request.resource - header_params["resource"] = request.resource - end - - request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") - metadata[:"x-goog-request-params"] ||= request_params_header - - options.apply_defaults timeout: @config.rpcs.get_iam_policy.timeout, - metadata: metadata, - retry_policy: @config.rpcs.get_iam_policy.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @tag_keys_stub.call_rpc :get_iam_policy, request, options: options do |response, operation| - yield response, operation if block_given? - end - rescue ::GRPC::BadStatus => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Sets the access control policy on a TagKey, replacing any existing - # policy. The `resource` field should be the TagKey's resource name. - # For example, "tagKeys/1234". - # The caller must have `resourcemanager.tagKeys.setIamPolicy` permission - # on the identified tagValue. - # - # @overload set_iam_policy(request, options = nil) - # Pass arguments to `set_iam_policy` via a request object, either of type - # {::Google::Iam::V1::SetIamPolicyRequest} or an equivalent Hash. - # - # @param request [::Google::Iam::V1::SetIamPolicyRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. - # - # @overload set_iam_policy(resource: nil, policy: nil, update_mask: nil) - # Pass arguments to `set_iam_policy` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param resource [::String] - # REQUIRED: The resource for which the policy is being specified. - # See the operation documentation for the appropriate value for this field. - # @param policy [::Google::Iam::V1::Policy, ::Hash] - # REQUIRED: The complete policy to be applied to the `resource`. The size of - # the policy is limited to a few 10s of KB. An empty policy is a - # valid policy but certain Cloud Platform services (such as Projects) - # might reject them. - # @param update_mask [::Google::Protobuf::FieldMask, ::Hash] - # OPTIONAL: A FieldMask specifying which fields of the policy to modify. Only - # the fields in the mask will be modified. If no mask is provided, the - # following default mask is used: - # - # `paths: "bindings, etag"` - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Google::Iam::V1::Policy] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Google::Iam::V1::Policy] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/cloud/resource_manager/v3" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::ResourceManager::V3::TagKeys::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Iam::V1::SetIamPolicyRequest.new - # - # # Call the set_iam_policy method. - # result = client.set_iam_policy request - # - # # The returned object is of type Google::Iam::V1::Policy. - # p result - # - def set_iam_policy request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Iam::V1::SetIamPolicyRequest - - # Converts hash and nil to an options object - options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h - - # Customize the options with defaults - metadata = @config.rpcs.set_iam_policy.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::ResourceManager::V3::VERSION - metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - header_params = {} - if request.resource - header_params["resource"] = request.resource - end - - request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") - metadata[:"x-goog-request-params"] ||= request_params_header - - options.apply_defaults timeout: @config.rpcs.set_iam_policy.timeout, - metadata: metadata, - retry_policy: @config.rpcs.set_iam_policy.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @tag_keys_stub.call_rpc :set_iam_policy, request, options: options do |response, operation| - yield response, operation if block_given? - end - rescue ::GRPC::BadStatus => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Returns permissions that a caller has on the specified TagKey. - # The `resource` field should be the TagKey's resource name. - # For example, "tagKeys/1234". - # - # There are no permissions required for making this API call. - # - # @overload test_iam_permissions(request, options = nil) - # Pass arguments to `test_iam_permissions` via a request object, either of type - # {::Google::Iam::V1::TestIamPermissionsRequest} or an equivalent Hash. - # - # @param request [::Google::Iam::V1::TestIamPermissionsRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. - # - # @overload test_iam_permissions(resource: nil, permissions: nil) - # Pass arguments to `test_iam_permissions` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param resource [::String] - # REQUIRED: The resource for which the policy detail is being requested. - # See the operation documentation for the appropriate value for this field. - # @param permissions [::Array<::String>] - # The set of permissions to check for the `resource`. Permissions with - # wildcards (such as '*' or 'storage.*') are not allowed. For more - # information see - # [IAM Overview](https://cloud.google.com/iam/docs/overview#permissions). - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Google::Iam::V1::TestIamPermissionsResponse] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Google::Iam::V1::TestIamPermissionsResponse] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/cloud/resource_manager/v3" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::ResourceManager::V3::TagKeys::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Iam::V1::TestIamPermissionsRequest.new - # - # # Call the test_iam_permissions method. - # result = client.test_iam_permissions request - # - # # The returned object is of type Google::Iam::V1::TestIamPermissionsResponse. - # p result - # - def test_iam_permissions request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Iam::V1::TestIamPermissionsRequest - - # Converts hash and nil to an options object - options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h - - # Customize the options with defaults - metadata = @config.rpcs.test_iam_permissions.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::ResourceManager::V3::VERSION - metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - header_params = {} - if request.resource - header_params["resource"] = request.resource - end - - request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") - metadata[:"x-goog-request-params"] ||= request_params_header - - options.apply_defaults timeout: @config.rpcs.test_iam_permissions.timeout, - metadata: metadata, - retry_policy: @config.rpcs.test_iam_permissions.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @tag_keys_stub.call_rpc :test_iam_permissions, request, options: options do |response, operation| - yield response, operation if block_given? - end - rescue ::GRPC::BadStatus => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Configuration class for the TagKeys API. - # - # This class represents the configuration for TagKeys, - # providing control over timeouts, retry behavior, logging, transport - # parameters, and other low-level controls. Certain parameters can also be - # applied individually to specific RPCs. See - # {::Google::Cloud::ResourceManager::V3::TagKeys::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_tag_keys to 20 seconds, - # # and all remaining timeouts to 10 seconds. - # ::Google::Cloud::ResourceManager::V3::TagKeys::Client.configure do |config| - # config.timeout = 10.0 - # config.rpcs.list_tag_keys.timeout = 20.0 - # end - # - # # Apply the above configuration only to a new client. - # client = ::Google::Cloud::ResourceManager::V3::TagKeys::Client.new do |config| - # config.timeout = 10.0 - # config.rpcs.list_tag_keys.timeout = 20.0 - # end - # - # @!attribute [rw] endpoint - # A custom service endpoint, as a hostname or hostname:port. The default is - # nil, indicating to use the default endpoint in the current universe domain. - # @return [::String,nil] - # @!attribute [rw] credentials - # Credentials to send with calls. You may provide any of the following types: - # * (`Google::Auth::Credentials`) A googleauth credentials object - # (see the [googleauth docs](https://rubydoc.info/gems/googleauth/Google/Auth/Credentials)) - # * (`Signet::OAuth2::Client`) A signet oauth2 client object - # (see the [signet docs](https://rubydoc.info/gems/signet/Signet/OAuth2/Client)) - # * (`GRPC::Core::Channel`) a gRPC channel with included credentials - # * (`GRPC::Core::ChannelCredentials`) a gRPC credentails object - # * (`nil`) indicating no credentials - # - # @note Warning: Passing a `String` to a keyfile path or a `Hash` of credentials - # is deprecated. Providing an unvalidated credential configuration to - # Google APIs can compromise the security of your systems and data. - # - # @example - # - # # The recommended way to provide credentials is to use the `make_creds` method - # # on the appropriate credentials class for your environment. - # - # require "googleauth" - # - # credentials = ::Google::Auth::ServiceAccountCredentials.make_creds( - # json_key_io: ::File.open("/path/to/keyfile.json") - # ) - # - # client = ::Google::Cloud::ResourceManager::V3::TagKeys::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 = "cloudresourcemanager.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 TagKeys 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_tag_keys` - # @return [::Gapic::Config::Method] - # - attr_reader :list_tag_keys - ## - # RPC-specific configuration for `get_tag_key` - # @return [::Gapic::Config::Method] - # - attr_reader :get_tag_key - ## - # RPC-specific configuration for `get_namespaced_tag_key` - # @return [::Gapic::Config::Method] - # - attr_reader :get_namespaced_tag_key - ## - # RPC-specific configuration for `create_tag_key` - # @return [::Gapic::Config::Method] - # - attr_reader :create_tag_key - ## - # RPC-specific configuration for `update_tag_key` - # @return [::Gapic::Config::Method] - # - attr_reader :update_tag_key - ## - # RPC-specific configuration for `delete_tag_key` - # @return [::Gapic::Config::Method] - # - attr_reader :delete_tag_key - ## - # RPC-specific configuration for `get_iam_policy` - # @return [::Gapic::Config::Method] - # - attr_reader :get_iam_policy - ## - # RPC-specific configuration for `set_iam_policy` - # @return [::Gapic::Config::Method] - # - attr_reader :set_iam_policy - ## - # RPC-specific configuration for `test_iam_permissions` - # @return [::Gapic::Config::Method] - # - attr_reader :test_iam_permissions - - # @private - def initialize parent_rpcs = nil - list_tag_keys_config = parent_rpcs.list_tag_keys if parent_rpcs.respond_to? :list_tag_keys - @list_tag_keys = ::Gapic::Config::Method.new list_tag_keys_config - get_tag_key_config = parent_rpcs.get_tag_key if parent_rpcs.respond_to? :get_tag_key - @get_tag_key = ::Gapic::Config::Method.new get_tag_key_config - get_namespaced_tag_key_config = parent_rpcs.get_namespaced_tag_key if parent_rpcs.respond_to? :get_namespaced_tag_key - @get_namespaced_tag_key = ::Gapic::Config::Method.new get_namespaced_tag_key_config - create_tag_key_config = parent_rpcs.create_tag_key if parent_rpcs.respond_to? :create_tag_key - @create_tag_key = ::Gapic::Config::Method.new create_tag_key_config - update_tag_key_config = parent_rpcs.update_tag_key if parent_rpcs.respond_to? :update_tag_key - @update_tag_key = ::Gapic::Config::Method.new update_tag_key_config - delete_tag_key_config = parent_rpcs.delete_tag_key if parent_rpcs.respond_to? :delete_tag_key - @delete_tag_key = ::Gapic::Config::Method.new delete_tag_key_config - get_iam_policy_config = parent_rpcs.get_iam_policy if parent_rpcs.respond_to? :get_iam_policy - @get_iam_policy = ::Gapic::Config::Method.new get_iam_policy_config - set_iam_policy_config = parent_rpcs.set_iam_policy if parent_rpcs.respond_to? :set_iam_policy - @set_iam_policy = ::Gapic::Config::Method.new set_iam_policy_config - test_iam_permissions_config = parent_rpcs.test_iam_permissions if parent_rpcs.respond_to? :test_iam_permissions - @test_iam_permissions = ::Gapic::Config::Method.new test_iam_permissions_config - - yield self if block_given? - end - end - end - end - end - end - end - end -end diff --git a/owl-bot-staging/google-cloud-resource_manager-v3/lib/google/cloud/resource_manager/v3/tag_keys/credentials.rb b/owl-bot-staging/google-cloud-resource_manager-v3/lib/google/cloud/resource_manager/v3/tag_keys/credentials.rb deleted file mode 100644 index 5236a2bf5c74..000000000000 --- a/owl-bot-staging/google-cloud-resource_manager-v3/lib/google/cloud/resource_manager/v3/tag_keys/credentials.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 "googleauth" - -module Google - module Cloud - module ResourceManager - module V3 - module TagKeys - # Credentials for the TagKeys API. - class Credentials < ::Google::Auth::Credentials - self.scope = [ - "https://www.googleapis.com/auth/cloud-platform", - "https://www.googleapis.com/auth/cloud-platform.read-only" - ] - self.env_vars = [ - "RESOURCE_MANAGER_CREDENTIALS", - "RESOURCE_MANAGER_KEYFILE", - "GOOGLE_CLOUD_CREDENTIALS", - "GOOGLE_CLOUD_KEYFILE", - "GCLOUD_KEYFILE", - "RESOURCE_MANAGER_CREDENTIALS_JSON", - "RESOURCE_MANAGER_KEYFILE_JSON", - "GOOGLE_CLOUD_CREDENTIALS_JSON", - "GOOGLE_CLOUD_KEYFILE_JSON", - "GCLOUD_KEYFILE_JSON" - ] - self.paths = [ - "~/.config/google_cloud/application_default_credentials.json" - ] - end - end - end - end - end -end diff --git a/owl-bot-staging/google-cloud-resource_manager-v3/lib/google/cloud/resource_manager/v3/tag_keys/operations.rb b/owl-bot-staging/google-cloud-resource_manager-v3/lib/google/cloud/resource_manager/v3/tag_keys/operations.rb deleted file mode 100644 index 411f5dd02ac3..000000000000 --- a/owl-bot-staging/google-cloud-resource_manager-v3/lib/google/cloud/resource_manager/v3/tag_keys/operations.rb +++ /dev/null @@ -1,841 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -require "gapic/operation" -require "google/longrunning/operations_pb" - -module Google - module Cloud - module ResourceManager - module V3 - module TagKeys - # Service that implements Longrunning Operations API. - class Operations - # @private - API_VERSION = "" - - # @private - DEFAULT_ENDPOINT_TEMPLATE = "cloudresourcemanager.$UNIVERSE_DOMAIN$" - - # @private - attr_reader :operations_stub - - ## - # Configuration for the TagKeys 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 TagKeys 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::ResourceManager::V3::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::ResourceManager::V3::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::ResourceManager::V3::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::ResourceManager::V3::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::ResourceManager::V3::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 = "cloudresourcemanager.googleapis.com" - - config_attr :endpoint, nil, ::String, nil - config_attr :credentials, nil do |value| - allowed = [::String, ::Hash, ::Proc, ::Symbol, ::Google::Auth::Credentials, ::Google::Auth::BaseClient, ::Signet::OAuth2::Client, nil] - allowed += [::GRPC::Core::Channel, ::GRPC::Core::ChannelCredentials] if defined? ::GRPC::Core::Channel - allowed.any? { |klass| klass === value } - end - config_attr :scope, nil, ::String, ::Array, nil - config_attr :lib_name, nil, ::String, nil - config_attr :lib_version, nil, ::String, nil - config_attr(:channel_args, { "grpc.service_config_disable_resolution" => 1 }, ::Hash, nil) - config_attr :interceptors, nil, ::Array, nil - config_attr :timeout, nil, ::Numeric, nil - config_attr :metadata, nil, ::Hash, nil - config_attr :retry_policy, nil, ::Hash, ::Proc, nil - config_attr :quota_project, nil, ::String, nil - config_attr :universe_domain, nil, ::String, nil - config_attr :logger, :default, ::Logger, nil, :default - - # @private - def initialize parent_config = nil - @parent_config = parent_config unless parent_config.nil? - - yield self if block_given? - end - - ## - # Configurations for individual RPCs - # @return [Rpcs] - # - def rpcs - @rpcs ||= begin - parent_rpcs = nil - parent_rpcs = @parent_config.rpcs if defined?(@parent_config) && @parent_config.respond_to?(:rpcs) - Rpcs.new parent_rpcs - end - end - - ## - # Configuration for the channel pool - # @return [::Gapic::ServiceStub::ChannelPool::Configuration] - # - def channel_pool - @channel_pool ||= ::Gapic::ServiceStub::ChannelPool::Configuration.new - end - - ## - # Configuration RPC class for the Operations API. - # - # Includes fields providing the configuration for each RPC in this service. - # Each configuration object is of type `Gapic::Config::Method` and includes - # the following configuration fields: - # - # * `timeout` (*type:* `Numeric`) - The call timeout in seconds - # * `metadata` (*type:* `Hash{Symbol=>String}`) - Additional gRPC headers - # * `retry_policy (*type:* `Hash`) - The retry policy. The policy fields - # include the following keys: - # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds. - # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds. - # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier. - # * `:retry_codes` (*type:* `Array`) - The error codes that should - # trigger a retry. - # - class Rpcs - ## - # RPC-specific configuration for `list_operations` - # @return [::Gapic::Config::Method] - # - attr_reader :list_operations - ## - # RPC-specific configuration for `get_operation` - # @return [::Gapic::Config::Method] - # - attr_reader :get_operation - ## - # RPC-specific configuration for `delete_operation` - # @return [::Gapic::Config::Method] - # - attr_reader :delete_operation - ## - # RPC-specific configuration for `cancel_operation` - # @return [::Gapic::Config::Method] - # - attr_reader :cancel_operation - ## - # RPC-specific configuration for `wait_operation` - # @return [::Gapic::Config::Method] - # - attr_reader :wait_operation - - # @private - def initialize parent_rpcs = nil - list_operations_config = parent_rpcs.list_operations if parent_rpcs.respond_to? :list_operations - @list_operations = ::Gapic::Config::Method.new list_operations_config - get_operation_config = parent_rpcs.get_operation if parent_rpcs.respond_to? :get_operation - @get_operation = ::Gapic::Config::Method.new get_operation_config - delete_operation_config = parent_rpcs.delete_operation if parent_rpcs.respond_to? :delete_operation - @delete_operation = ::Gapic::Config::Method.new delete_operation_config - cancel_operation_config = parent_rpcs.cancel_operation if parent_rpcs.respond_to? :cancel_operation - @cancel_operation = ::Gapic::Config::Method.new cancel_operation_config - wait_operation_config = parent_rpcs.wait_operation if parent_rpcs.respond_to? :wait_operation - @wait_operation = ::Gapic::Config::Method.new wait_operation_config - - yield self if block_given? - end - end - end - end - end - end - end - end -end diff --git a/owl-bot-staging/google-cloud-resource_manager-v3/lib/google/cloud/resource_manager/v3/tag_keys/paths.rb b/owl-bot-staging/google-cloud-resource_manager-v3/lib/google/cloud/resource_manager/v3/tag_keys/paths.rb deleted file mode 100644 index 47fb1b73c8ba..000000000000 --- a/owl-bot-staging/google-cloud-resource_manager-v3/lib/google/cloud/resource_manager/v3/tag_keys/paths.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! - - -module Google - module Cloud - module ResourceManager - module V3 - module TagKeys - # Path helper methods for the TagKeys API. - module Paths - ## - # Create a fully-qualified TagKey resource string. - # - # The resource will be in the following format: - # - # `tagKeys/{tag_key}` - # - # @param tag_key [String] - # - # @return [::String] - def tag_key_path tag_key: - "tagKeys/#{tag_key}" - end - - extend self - end - end - end - end - end -end diff --git a/owl-bot-staging/google-cloud-resource_manager-v3/lib/google/cloud/resource_manager/v3/tag_keys/rest.rb b/owl-bot-staging/google-cloud-resource_manager-v3/lib/google/cloud/resource_manager/v3/tag_keys/rest.rb deleted file mode 100644 index f82f5c05233d..000000000000 --- a/owl-bot-staging/google-cloud-resource_manager-v3/lib/google/cloud/resource_manager/v3/tag_keys/rest.rb +++ /dev/null @@ -1,53 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -require "gapic/rest" -require "gapic/config" -require "gapic/config/method" - -require "google/cloud/resource_manager/v3/version" - -require "google/cloud/resource_manager/v3/tag_keys/credentials" -require "google/cloud/resource_manager/v3/tag_keys/paths" -require "google/cloud/resource_manager/v3/tag_keys/rest/operations" -require "google/cloud/resource_manager/v3/tag_keys/rest/client" - -module Google - module Cloud - module ResourceManager - module V3 - ## - # Allow users to create and manage tag keys. - # - # To load this service and instantiate a REST client: - # - # require "google/cloud/resource_manager/v3/tag_keys/rest" - # client = ::Google::Cloud::ResourceManager::V3::TagKeys::Rest::Client.new - # - module TagKeys - # Client for the REST transport - module Rest - end - end - end - end - end -end - -helper_path = ::File.join __dir__, "rest", "helpers.rb" -require "google/cloud/resource_manager/v3/tag_keys/rest/helpers" if ::File.file? helper_path diff --git a/owl-bot-staging/google-cloud-resource_manager-v3/lib/google/cloud/resource_manager/v3/tag_keys/rest/client.rb b/owl-bot-staging/google-cloud-resource_manager-v3/lib/google/cloud/resource_manager/v3/tag_keys/rest/client.rb deleted file mode 100644 index 89ae77b9bf88..000000000000 --- a/owl-bot-staging/google-cloud-resource_manager-v3/lib/google/cloud/resource_manager/v3/tag_keys/rest/client.rb +++ /dev/null @@ -1,1251 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -require "google/cloud/errors" -require "google/cloud/resourcemanager/v3/tag_keys_pb" -require "google/cloud/resource_manager/v3/tag_keys/rest/service_stub" - -module Google - module Cloud - module ResourceManager - module V3 - module TagKeys - module Rest - ## - # REST client for the TagKeys service. - # - # Allow users to create and manage tag keys. - # - class Client - # @private - API_VERSION = "" - - # @private - DEFAULT_ENDPOINT_TEMPLATE = "cloudresourcemanager.$UNIVERSE_DOMAIN$" - - include Paths - - # @private - attr_reader :tag_keys_stub - - ## - # Configure the TagKeys Client class. - # - # See {::Google::Cloud::ResourceManager::V3::TagKeys::Rest::Client::Configuration} - # for a description of the configuration fields. - # - # @example - # - # # Modify the configuration for all TagKeys clients - # ::Google::Cloud::ResourceManager::V3::TagKeys::Rest::Client.configure do |config| - # config.timeout = 10.0 - # end - # - # @yield [config] Configure the Client client. - # @yieldparam config [Client::Configuration] - # - # @return [Client::Configuration] - # - def self.configure - @configure ||= begin - namespace = ["Google", "Cloud", "ResourceManager", "V3"] - parent_config = while namespace.any? - parent_name = namespace.join "::" - parent_const = const_get parent_name - break parent_const.configure if parent_const.respond_to? :configure - namespace.pop - end - default_config = Client::Configuration.new parent_config - - default_config.rpcs.list_tag_keys.timeout = 60.0 - default_config.rpcs.list_tag_keys.retry_policy = { - initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [14] - } - - default_config.rpcs.get_tag_key.timeout = 60.0 - default_config.rpcs.get_tag_key.retry_policy = { - initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [14] - } - - default_config.rpcs.create_tag_key.timeout = 60.0 - - default_config.rpcs.update_tag_key.timeout = 60.0 - - default_config.rpcs.delete_tag_key.timeout = 60.0 - - default_config.rpcs.get_iam_policy.timeout = 60.0 - default_config.rpcs.get_iam_policy.retry_policy = { - initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [14] - } - - default_config.rpcs.set_iam_policy.timeout = 60.0 - - default_config - end - yield @configure if block_given? - @configure - end - - ## - # Configure the TagKeys Client instance. - # - # The configuration is set to the derived mode, meaning that values can be changed, - # but structural changes (adding new fields, etc.) are not allowed. Structural changes - # should be made on {Client.configure}. - # - # See {::Google::Cloud::ResourceManager::V3::TagKeys::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 - @tag_keys_stub.universe_domain - end - - ## - # Create a new TagKeys REST client object. - # - # @example - # - # # Create a client using the default configuration - # client = ::Google::Cloud::ResourceManager::V3::TagKeys::Rest::Client.new - # - # # Create a client using a custom configuration - # client = ::Google::Cloud::ResourceManager::V3::TagKeys::Rest::Client.new do |config| - # config.timeout = 10.0 - # end - # - # @yield [config] Configure the TagKeys client. - # @yieldparam config [Client::Configuration] - # - def initialize - # Create the configuration object - @config = Configuration.new Client.configure - - # Yield the configuration if needed - yield @config if block_given? - - # Create credentials - credentials = @config.credentials - # Use self-signed JWT if the endpoint is unchanged from default, - # but only if the default endpoint does not have a region prefix. - enable_self_signed_jwt = @config.endpoint.nil? || - (@config.endpoint == Configuration::DEFAULT_ENDPOINT && - !@config.endpoint.split(".").first.include?("-")) - credentials ||= Credentials.default scope: @config.scope, - enable_self_signed_jwt: enable_self_signed_jwt - if credentials.is_a?(::String) || credentials.is_a?(::Hash) - credentials = Credentials.new credentials, scope: @config.scope - end - - @quota_project_id = @config.quota_project - @quota_project_id ||= credentials.quota_project_id if credentials.respond_to? :quota_project_id - - @operations_client = ::Google::Cloud::ResourceManager::V3::TagKeys::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 - - @tag_keys_stub = ::Google::Cloud::ResourceManager::V3::TagKeys::Rest::ServiceStub.new( - endpoint: @config.endpoint, - endpoint_template: DEFAULT_ENDPOINT_TEMPLATE, - universe_domain: @config.universe_domain, - credentials: credentials, - logger: @config.logger - ) - - @tag_keys_stub.logger(stub: true)&.info do |entry| - entry.set_system_name - entry.set_service - entry.message = "Created client for #{entry.service}" - entry.set_credentials_fields credentials - entry.set "customEndpoint", @config.endpoint if @config.endpoint - entry.set "defaultTimeout", @config.timeout if @config.timeout - entry.set "quotaProject", @quota_project_id if @quota_project_id - end - end - - ## - # Get the associated client for long-running operations. - # - # @return [::Google::Cloud::ResourceManager::V3::TagKeys::Rest::Operations] - # - attr_reader :operations_client - - ## - # The logger used for request/response debug logging. - # - # @return [Logger] - # - def logger - @tag_keys_stub.logger - end - - # Service calls - - ## - # Lists all TagKeys for a parent resource. - # - # @overload list_tag_keys(request, options = nil) - # Pass arguments to `list_tag_keys` via a request object, either of type - # {::Google::Cloud::ResourceManager::V3::ListTagKeysRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::ResourceManager::V3::ListTagKeysRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_tag_keys(parent: nil, page_size: nil, page_token: nil) - # Pass arguments to `list_tag_keys` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param parent [::String] - # Required. The resource name of the TagKey's parent. - # Must be of the form `organizations/{org_id}` or `projects/{project_id}` or - # `projects/{project_number}` - # @param page_size [::Integer] - # Optional. The maximum number of TagKeys to return in the response. The - # server allows a maximum of 300 TagKeys to return. If unspecified, the - # server will use 100 as the default. - # @param page_token [::String] - # Optional. A pagination token returned from a previous call to `ListTagKey` - # that indicates where this listing should continue from. - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Gapic::Rest::PagedEnumerable<::Google::Cloud::ResourceManager::V3::TagKey>] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Gapic::Rest::PagedEnumerable<::Google::Cloud::ResourceManager::V3::TagKey>] - # - # @raise [::Google::Cloud::Error] if the REST call is aborted. - # - # @example Basic example - # require "google/cloud/resource_manager/v3" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::ResourceManager::V3::TagKeys::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::ResourceManager::V3::ListTagKeysRequest.new - # - # # Call the list_tag_keys method. - # result = client.list_tag_keys request - # - # # The returned object is of type Gapic::PagedEnumerable. You can iterate - # # over elements, and API calls will be issued to fetch pages as needed. - # result.each do |item| - # # Each element is of type ::Google::Cloud::ResourceManager::V3::TagKey. - # p item - # end - # - def list_tag_keys request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::ResourceManager::V3::ListTagKeysRequest - - # Converts hash 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_tag_keys.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::ResourceManager::V3::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_tag_keys.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.list_tag_keys.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @tag_keys_stub.list_tag_keys request, options do |result, operation| - result = ::Gapic::Rest::PagedEnumerable.new @tag_keys_stub, :list_tag_keys, "tag_keys", 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 - - ## - # Retrieves a TagKey. This method will return `PERMISSION_DENIED` if the - # key does not exist or the user does not have permission to view it. - # - # @overload get_tag_key(request, options = nil) - # Pass arguments to `get_tag_key` via a request object, either of type - # {::Google::Cloud::ResourceManager::V3::GetTagKeyRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::ResourceManager::V3::GetTagKeyRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_tag_key(name: nil) - # Pass arguments to `get_tag_key` via keyword arguments. Note that at - # least one keyword argument is 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. A resource name in the format `tagKeys/{id}`, such as - # `tagKeys/123`. - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Cloud::ResourceManager::V3::TagKey] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::ResourceManager::V3::TagKey] - # - # @raise [::Google::Cloud::Error] if the REST call is aborted. - # - # @example Basic example - # require "google/cloud/resource_manager/v3" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::ResourceManager::V3::TagKeys::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::ResourceManager::V3::GetTagKeyRequest.new - # - # # Call the get_tag_key method. - # result = client.get_tag_key request - # - # # The returned object is of type Google::Cloud::ResourceManager::V3::TagKey. - # p result - # - def get_tag_key request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::ResourceManager::V3::GetTagKeyRequest - - # Converts hash 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_tag_key.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::ResourceManager::V3::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_tag_key.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.get_tag_key.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @tag_keys_stub.get_tag_key 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 - - ## - # Retrieves a TagKey by its namespaced name. - # This method will return `PERMISSION_DENIED` if the key does not exist - # or the user does not have permission to view it. - # - # @overload get_namespaced_tag_key(request, options = nil) - # Pass arguments to `get_namespaced_tag_key` via a request object, either of type - # {::Google::Cloud::ResourceManager::V3::GetNamespacedTagKeyRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::ResourceManager::V3::GetNamespacedTagKeyRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_namespaced_tag_key(name: nil) - # Pass arguments to `get_namespaced_tag_key` via keyword arguments. Note that at - # least one keyword argument is 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. A namespaced tag key name in the format - # `{parentId}/{tagKeyShort}`, such as `42/foo` for a key with short name - # "foo" under the organization with ID 42 or `r2-d2/bar` for a key with short - # name "bar" under the project `r2-d2`. - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Cloud::ResourceManager::V3::TagKey] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::ResourceManager::V3::TagKey] - # - # @raise [::Google::Cloud::Error] if the REST call is aborted. - # - # @example Basic example - # require "google/cloud/resource_manager/v3" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::ResourceManager::V3::TagKeys::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::ResourceManager::V3::GetNamespacedTagKeyRequest.new - # - # # Call the get_namespaced_tag_key method. - # result = client.get_namespaced_tag_key request - # - # # The returned object is of type Google::Cloud::ResourceManager::V3::TagKey. - # p result - # - def get_namespaced_tag_key request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::ResourceManager::V3::GetNamespacedTagKeyRequest - - # Converts hash 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_namespaced_tag_key.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::ResourceManager::V3::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_namespaced_tag_key.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.get_namespaced_tag_key.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @tag_keys_stub.get_namespaced_tag_key request, options do |result, operation| - yield result, operation if block_given? - end - rescue ::Gapic::Rest::Error => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Creates a new TagKey. If another request with the same parameters is - # sent while the original request is in process, the second request - # will receive an error. A maximum of 1000 TagKeys can exist under a parent - # at any given time. - # - # @overload create_tag_key(request, options = nil) - # Pass arguments to `create_tag_key` via a request object, either of type - # {::Google::Cloud::ResourceManager::V3::CreateTagKeyRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::ResourceManager::V3::CreateTagKeyRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_tag_key(tag_key: nil, validate_only: nil) - # Pass arguments to `create_tag_key` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param tag_key [::Google::Cloud::ResourceManager::V3::TagKey, ::Hash] - # Required. The TagKey to be created. Only fields `short_name`, - # `description`, and `parent` are considered during the creation request. - # @param validate_only [::Boolean] - # Optional. Set to true to perform validations necessary for creating the - # resource, but not actually perform the action. - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Gapic::Operation] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Gapic::Operation] - # - # @raise [::Google::Cloud::Error] if the REST call is aborted. - # - # @example Basic example - # require "google/cloud/resource_manager/v3" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::ResourceManager::V3::TagKeys::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::ResourceManager::V3::CreateTagKeyRequest.new - # - # # Call the create_tag_key method. - # result = client.create_tag_key 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_tag_key request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::ResourceManager::V3::CreateTagKeyRequest - - # Converts hash 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_tag_key.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::ResourceManager::V3::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_tag_key.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.create_tag_key.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @tag_keys_stub.create_tag_key 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 - - ## - # Updates the attributes of the TagKey resource. - # - # @overload update_tag_key(request, options = nil) - # Pass arguments to `update_tag_key` via a request object, either of type - # {::Google::Cloud::ResourceManager::V3::UpdateTagKeyRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::ResourceManager::V3::UpdateTagKeyRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_tag_key(tag_key: nil, update_mask: nil, validate_only: nil) - # Pass arguments to `update_tag_key` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param tag_key [::Google::Cloud::ResourceManager::V3::TagKey, ::Hash] - # Required. The new definition of the TagKey. Only the `description` and - # `etag` fields can be updated by this request. If the `etag` field is not - # empty, it must match the `etag` field of the existing tag key. Otherwise, - # `ABORTED` will be returned. - # @param update_mask [::Google::Protobuf::FieldMask, ::Hash] - # Fields to be updated. The mask may only contain `description` or - # `etag`. If omitted entirely, both `description` and `etag` are assumed to - # be significant. - # @param validate_only [::Boolean] - # Set as true to perform validations necessary for updating the resource, but - # not actually perform the action. - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Gapic::Operation] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Gapic::Operation] - # - # @raise [::Google::Cloud::Error] if the REST call is aborted. - # - # @example Basic example - # require "google/cloud/resource_manager/v3" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::ResourceManager::V3::TagKeys::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::ResourceManager::V3::UpdateTagKeyRequest.new - # - # # Call the update_tag_key method. - # result = client.update_tag_key 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_tag_key request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::ResourceManager::V3::UpdateTagKeyRequest - - # Converts hash 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_tag_key.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::ResourceManager::V3::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_tag_key.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.update_tag_key.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @tag_keys_stub.update_tag_key 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 TagKey. The TagKey cannot be deleted if it has any child - # TagValues. - # - # @overload delete_tag_key(request, options = nil) - # Pass arguments to `delete_tag_key` via a request object, either of type - # {::Google::Cloud::ResourceManager::V3::DeleteTagKeyRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::ResourceManager::V3::DeleteTagKeyRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_tag_key(name: nil, validate_only: nil, etag: nil) - # Pass arguments to `delete_tag_key` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param name [::String] - # Required. The resource name of a TagKey to be deleted in the format - # `tagKeys/123`. The TagKey cannot be a parent of any existing TagValues or - # it will not be deleted successfully. - # @param validate_only [::Boolean] - # Optional. Set as true to perform validations necessary for deletion, but - # not actually perform the action. - # @param etag [::String] - # Optional. The etag known to the client for the expected state of the - # TagKey. This is to be used for optimistic concurrency. - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Gapic::Operation] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Gapic::Operation] - # - # @raise [::Google::Cloud::Error] if the REST call is aborted. - # - # @example Basic example - # require "google/cloud/resource_manager/v3" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::ResourceManager::V3::TagKeys::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::ResourceManager::V3::DeleteTagKeyRequest.new - # - # # Call the delete_tag_key method. - # result = client.delete_tag_key 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_tag_key request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::ResourceManager::V3::DeleteTagKeyRequest - - # Converts hash 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_tag_key.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::ResourceManager::V3::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_tag_key.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.delete_tag_key.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @tag_keys_stub.delete_tag_key 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 the access control policy for a TagKey. The returned policy may be - # empty if no such policy or resource exists. The `resource` field should - # be the TagKey's resource name. For example, "tagKeys/1234". - # The caller must have - # `cloudresourcemanager.googleapis.com/tagKeys.getIamPolicy` permission on - # the specified TagKey. - # - # @overload get_iam_policy(request, options = nil) - # Pass arguments to `get_iam_policy` via a request object, either of type - # {::Google::Iam::V1::GetIamPolicyRequest} or an equivalent Hash. - # - # @param request [::Google::Iam::V1::GetIamPolicyRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @overload get_iam_policy(resource: nil, options: nil) - # Pass arguments to `get_iam_policy` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param resource [::String] - # REQUIRED: The resource for which the policy is being requested. - # See the operation documentation for the appropriate value for this field. - # @param options [::Google::Iam::V1::GetPolicyOptions, ::Hash] - # OPTIONAL: A `GetPolicyOptions` object for specifying options to - # `GetIamPolicy`. - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Iam::V1::Policy] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Iam::V1::Policy] - # - # @raise [::Google::Cloud::Error] if the REST call is aborted. - # - # @example Basic example - # require "google/cloud/resource_manager/v3" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::ResourceManager::V3::TagKeys::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Iam::V1::GetIamPolicyRequest.new - # - # # Call the get_iam_policy method. - # result = client.get_iam_policy request - # - # # The returned object is of type Google::Iam::V1::Policy. - # p result - # - def get_iam_policy request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Iam::V1::GetIamPolicyRequest - - # Converts hash and nil to an options object - options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h - - # Customize the options with defaults - call_metadata = @config.rpcs.get_iam_policy.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::ResourceManager::V3::VERSION, - transports_version_send: [:rest] - - call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - options.apply_defaults timeout: @config.rpcs.get_iam_policy.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.get_iam_policy.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @tag_keys_stub.get_iam_policy request, options do |result, operation| - yield result, operation if block_given? - end - rescue ::Gapic::Rest::Error => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Sets the access control policy on a TagKey, replacing any existing - # policy. The `resource` field should be the TagKey's resource name. - # For example, "tagKeys/1234". - # The caller must have `resourcemanager.tagKeys.setIamPolicy` permission - # on the identified tagValue. - # - # @overload set_iam_policy(request, options = nil) - # Pass arguments to `set_iam_policy` via a request object, either of type - # {::Google::Iam::V1::SetIamPolicyRequest} or an equivalent Hash. - # - # @param request [::Google::Iam::V1::SetIamPolicyRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @overload set_iam_policy(resource: nil, policy: nil, update_mask: nil) - # Pass arguments to `set_iam_policy` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param resource [::String] - # REQUIRED: The resource for which the policy is being specified. - # See the operation documentation for the appropriate value for this field. - # @param policy [::Google::Iam::V1::Policy, ::Hash] - # REQUIRED: The complete policy to be applied to the `resource`. The size of - # the policy is limited to a few 10s of KB. An empty policy is a - # valid policy but certain Cloud Platform services (such as Projects) - # might reject them. - # @param update_mask [::Google::Protobuf::FieldMask, ::Hash] - # OPTIONAL: A FieldMask specifying which fields of the policy to modify. Only - # the fields in the mask will be modified. If no mask is provided, the - # following default mask is used: - # - # `paths: "bindings, etag"` - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Iam::V1::Policy] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Iam::V1::Policy] - # - # @raise [::Google::Cloud::Error] if the REST call is aborted. - # - # @example Basic example - # require "google/cloud/resource_manager/v3" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::ResourceManager::V3::TagKeys::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Iam::V1::SetIamPolicyRequest.new - # - # # Call the set_iam_policy method. - # result = client.set_iam_policy request - # - # # The returned object is of type Google::Iam::V1::Policy. - # p result - # - def set_iam_policy request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Iam::V1::SetIamPolicyRequest - - # Converts hash and nil to an options object - options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h - - # Customize the options with defaults - call_metadata = @config.rpcs.set_iam_policy.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::ResourceManager::V3::VERSION, - transports_version_send: [:rest] - - call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - options.apply_defaults timeout: @config.rpcs.set_iam_policy.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.set_iam_policy.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @tag_keys_stub.set_iam_policy request, options do |result, operation| - yield result, operation if block_given? - end - rescue ::Gapic::Rest::Error => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Returns permissions that a caller has on the specified TagKey. - # The `resource` field should be the TagKey's resource name. - # For example, "tagKeys/1234". - # - # There are no permissions required for making this API call. - # - # @overload test_iam_permissions(request, options = nil) - # Pass arguments to `test_iam_permissions` via a request object, either of type - # {::Google::Iam::V1::TestIamPermissionsRequest} or an equivalent Hash. - # - # @param request [::Google::Iam::V1::TestIamPermissionsRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @overload test_iam_permissions(resource: nil, permissions: nil) - # Pass arguments to `test_iam_permissions` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param resource [::String] - # REQUIRED: The resource for which the policy detail is being requested. - # See the operation documentation for the appropriate value for this field. - # @param permissions [::Array<::String>] - # The set of permissions to check for the `resource`. Permissions with - # wildcards (such as '*' or 'storage.*') are not allowed. For more - # information see - # [IAM Overview](https://cloud.google.com/iam/docs/overview#permissions). - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Iam::V1::TestIamPermissionsResponse] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Iam::V1::TestIamPermissionsResponse] - # - # @raise [::Google::Cloud::Error] if the REST call is aborted. - # - # @example Basic example - # require "google/cloud/resource_manager/v3" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::ResourceManager::V3::TagKeys::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Iam::V1::TestIamPermissionsRequest.new - # - # # Call the test_iam_permissions method. - # result = client.test_iam_permissions request - # - # # The returned object is of type Google::Iam::V1::TestIamPermissionsResponse. - # p result - # - def test_iam_permissions request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Iam::V1::TestIamPermissionsRequest - - # Converts hash and nil to an options object - options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h - - # Customize the options with defaults - call_metadata = @config.rpcs.test_iam_permissions.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::ResourceManager::V3::VERSION, - transports_version_send: [:rest] - - call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - options.apply_defaults timeout: @config.rpcs.test_iam_permissions.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.test_iam_permissions.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @tag_keys_stub.test_iam_permissions request, options do |result, operation| - yield result, operation if block_given? - end - rescue ::Gapic::Rest::Error => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Configuration class for the TagKeys REST API. - # - # This class represents the configuration for TagKeys REST, - # providing control over timeouts, retry behavior, logging, transport - # parameters, and other low-level controls. Certain parameters can also be - # applied individually to specific RPCs. See - # {::Google::Cloud::ResourceManager::V3::TagKeys::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_tag_keys to 20 seconds, - # # and all remaining timeouts to 10 seconds. - # ::Google::Cloud::ResourceManager::V3::TagKeys::Rest::Client.configure do |config| - # config.timeout = 10.0 - # config.rpcs.list_tag_keys.timeout = 20.0 - # end - # - # # Apply the above configuration only to a new client. - # client = ::Google::Cloud::ResourceManager::V3::TagKeys::Rest::Client.new do |config| - # config.timeout = 10.0 - # config.rpcs.list_tag_keys.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 = "cloudresourcemanager.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 TagKeys 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_tag_keys` - # @return [::Gapic::Config::Method] - # - attr_reader :list_tag_keys - ## - # RPC-specific configuration for `get_tag_key` - # @return [::Gapic::Config::Method] - # - attr_reader :get_tag_key - ## - # RPC-specific configuration for `get_namespaced_tag_key` - # @return [::Gapic::Config::Method] - # - attr_reader :get_namespaced_tag_key - ## - # RPC-specific configuration for `create_tag_key` - # @return [::Gapic::Config::Method] - # - attr_reader :create_tag_key - ## - # RPC-specific configuration for `update_tag_key` - # @return [::Gapic::Config::Method] - # - attr_reader :update_tag_key - ## - # RPC-specific configuration for `delete_tag_key` - # @return [::Gapic::Config::Method] - # - attr_reader :delete_tag_key - ## - # RPC-specific configuration for `get_iam_policy` - # @return [::Gapic::Config::Method] - # - attr_reader :get_iam_policy - ## - # RPC-specific configuration for `set_iam_policy` - # @return [::Gapic::Config::Method] - # - attr_reader :set_iam_policy - ## - # RPC-specific configuration for `test_iam_permissions` - # @return [::Gapic::Config::Method] - # - attr_reader :test_iam_permissions - - # @private - def initialize parent_rpcs = nil - list_tag_keys_config = parent_rpcs.list_tag_keys if parent_rpcs.respond_to? :list_tag_keys - @list_tag_keys = ::Gapic::Config::Method.new list_tag_keys_config - get_tag_key_config = parent_rpcs.get_tag_key if parent_rpcs.respond_to? :get_tag_key - @get_tag_key = ::Gapic::Config::Method.new get_tag_key_config - get_namespaced_tag_key_config = parent_rpcs.get_namespaced_tag_key if parent_rpcs.respond_to? :get_namespaced_tag_key - @get_namespaced_tag_key = ::Gapic::Config::Method.new get_namespaced_tag_key_config - create_tag_key_config = parent_rpcs.create_tag_key if parent_rpcs.respond_to? :create_tag_key - @create_tag_key = ::Gapic::Config::Method.new create_tag_key_config - update_tag_key_config = parent_rpcs.update_tag_key if parent_rpcs.respond_to? :update_tag_key - @update_tag_key = ::Gapic::Config::Method.new update_tag_key_config - delete_tag_key_config = parent_rpcs.delete_tag_key if parent_rpcs.respond_to? :delete_tag_key - @delete_tag_key = ::Gapic::Config::Method.new delete_tag_key_config - get_iam_policy_config = parent_rpcs.get_iam_policy if parent_rpcs.respond_to? :get_iam_policy - @get_iam_policy = ::Gapic::Config::Method.new get_iam_policy_config - set_iam_policy_config = parent_rpcs.set_iam_policy if parent_rpcs.respond_to? :set_iam_policy - @set_iam_policy = ::Gapic::Config::Method.new set_iam_policy_config - test_iam_permissions_config = parent_rpcs.test_iam_permissions if parent_rpcs.respond_to? :test_iam_permissions - @test_iam_permissions = ::Gapic::Config::Method.new test_iam_permissions_config - - yield self if block_given? - end - end - end - end - end - end - end - end - end -end diff --git a/owl-bot-staging/google-cloud-resource_manager-v3/lib/google/cloud/resource_manager/v3/tag_keys/rest/operations.rb b/owl-bot-staging/google-cloud-resource_manager-v3/lib/google/cloud/resource_manager/v3/tag_keys/rest/operations.rb deleted file mode 100644 index 69cb1d2bef7b..000000000000 --- a/owl-bot-staging/google-cloud-resource_manager-v3/lib/google/cloud/resource_manager/v3/tag_keys/rest/operations.rb +++ /dev/null @@ -1,925 +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 Cloud - module ResourceManager - module V3 - module TagKeys - module Rest - # Service that implements Longrunning Operations API. - class Operations - # @private - API_VERSION = "" - - # @private - DEFAULT_ENDPOINT_TEMPLATE = "cloudresourcemanager.$UNIVERSE_DOMAIN$" - - # @private - attr_reader :operations_stub - - ## - # Configuration for the TagKeys 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 TagKeys 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::ResourceManager::V3::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::ResourceManager::V3::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::ResourceManager::V3::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::ResourceManager::V3::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 = "cloudresourcemanager.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: "/v3/{name}", - matches: [ - ["name", %r{^operations(?:/.*)?$}, true] - ] - ) - 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 -end diff --git a/owl-bot-staging/google-cloud-resource_manager-v3/lib/google/cloud/resource_manager/v3/tag_keys/rest/service_stub.rb b/owl-bot-staging/google-cloud-resource_manager-v3/lib/google/cloud/resource_manager/v3/tag_keys/rest/service_stub.rb deleted file mode 100644 index f462be179ffc..000000000000 --- a/owl-bot-staging/google-cloud-resource_manager-v3/lib/google/cloud/resource_manager/v3/tag_keys/rest/service_stub.rb +++ /dev/null @@ -1,629 +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/resourcemanager/v3/tag_keys_pb" - -module Google - module Cloud - module ResourceManager - module V3 - module TagKeys - module Rest - ## - # REST service stub for the TagKeys service. - # Service stub contains baseline method implementations - # including transcoding, making the REST call, and deserialing the response. - # - class ServiceStub - # @private - def initialize endpoint:, endpoint_template:, universe_domain:, credentials:, logger: - # These require statements are intentionally placed here to initialize - # the REST modules only when it's required. - require "gapic/rest" - - @client_stub = ::Gapic::Rest::ClientStub.new endpoint: endpoint, - endpoint_template: endpoint_template, - universe_domain: universe_domain, - credentials: credentials, - numeric_enums: true, - service_name: self.class, - raise_faraday_errors: false, - logger: logger - end - - ## - # The effective universe domain - # - # @return [String] - # - def universe_domain - @client_stub.universe_domain - end - - ## - # The effective endpoint - # - # @return [String] - # - def endpoint - @client_stub.endpoint - end - - ## - # The logger used for request/response debug logging. - # - # @return [Logger] - # - def logger stub: false - stub ? @client_stub.stub_logger : @client_stub.logger - end - - ## - # Baseline implementation for the list_tag_keys REST call - # - # @param request_pb [::Google::Cloud::ResourceManager::V3::ListTagKeysRequest] - # A request object representing the call parameters. Required. - # @param options [::Gapic::CallOptions] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Cloud::ResourceManager::V3::ListTagKeysResponse] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::ResourceManager::V3::ListTagKeysResponse] - # A result object deserialized from the server's reply - def list_tag_keys request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_list_tag_keys_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_tag_keys", - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Cloud::ResourceManager::V3::ListTagKeysResponse.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_tag_key REST call - # - # @param request_pb [::Google::Cloud::ResourceManager::V3::GetTagKeyRequest] - # A request object representing the call parameters. Required. - # @param options [::Gapic::CallOptions] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Cloud::ResourceManager::V3::TagKey] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::ResourceManager::V3::TagKey] - # A result object deserialized from the server's reply - def get_tag_key request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_get_tag_key_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_tag_key", - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Cloud::ResourceManager::V3::TagKey.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_namespaced_tag_key REST call - # - # @param request_pb [::Google::Cloud::ResourceManager::V3::GetNamespacedTagKeyRequest] - # A request object representing the call parameters. Required. - # @param options [::Gapic::CallOptions] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Cloud::ResourceManager::V3::TagKey] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::ResourceManager::V3::TagKey] - # A result object deserialized from the server's reply - def get_namespaced_tag_key request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_get_namespaced_tag_key_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_namespaced_tag_key", - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Cloud::ResourceManager::V3::TagKey.decode_json response.body, ignore_unknown_fields: true - catch :response do - yield result, operation if block_given? - result - end - end - - ## - # Baseline implementation for the create_tag_key REST call - # - # @param request_pb [::Google::Cloud::ResourceManager::V3::CreateTagKeyRequest] - # 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_tag_key request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_create_tag_key_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_tag_key", - 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 update_tag_key REST call - # - # @param request_pb [::Google::Cloud::ResourceManager::V3::UpdateTagKeyRequest] - # 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_tag_key request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_update_tag_key_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_tag_key", - 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_tag_key REST call - # - # @param request_pb [::Google::Cloud::ResourceManager::V3::DeleteTagKeyRequest] - # 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_tag_key request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_delete_tag_key_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_tag_key", - 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_iam_policy REST call - # - # @param request_pb [::Google::Iam::V1::GetIamPolicyRequest] - # A request object representing the call parameters. Required. - # @param options [::Gapic::CallOptions] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Iam::V1::Policy] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Iam::V1::Policy] - # A result object deserialized from the server's reply - def get_iam_policy request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_get_iam_policy_request request_pb - query_string_params = if query_string_params.any? - query_string_params.to_h { |p| p.split "=", 2 } - else - {} - end - - response = @client_stub.make_http_request( - verb, - uri: uri, - body: body || "", - params: query_string_params, - method_name: "get_iam_policy", - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Iam::V1::Policy.decode_json response.body, ignore_unknown_fields: true - catch :response do - yield result, operation if block_given? - result - end - end - - ## - # Baseline implementation for the set_iam_policy REST call - # - # @param request_pb [::Google::Iam::V1::SetIamPolicyRequest] - # A request object representing the call parameters. Required. - # @param options [::Gapic::CallOptions] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Iam::V1::Policy] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Iam::V1::Policy] - # A result object deserialized from the server's reply - def set_iam_policy request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_set_iam_policy_request request_pb - query_string_params = if query_string_params.any? - query_string_params.to_h { |p| p.split "=", 2 } - else - {} - end - - response = @client_stub.make_http_request( - verb, - uri: uri, - body: body || "", - params: query_string_params, - method_name: "set_iam_policy", - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Iam::V1::Policy.decode_json response.body, ignore_unknown_fields: true - catch :response do - yield result, operation if block_given? - result - end - end - - ## - # Baseline implementation for the test_iam_permissions REST call - # - # @param request_pb [::Google::Iam::V1::TestIamPermissionsRequest] - # A request object representing the call parameters. Required. - # @param options [::Gapic::CallOptions] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Iam::V1::TestIamPermissionsResponse] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Iam::V1::TestIamPermissionsResponse] - # A result object deserialized from the server's reply - def test_iam_permissions request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_test_iam_permissions_request request_pb - query_string_params = if query_string_params.any? - query_string_params.to_h { |p| p.split "=", 2 } - else - {} - end - - response = @client_stub.make_http_request( - verb, - uri: uri, - body: body || "", - params: query_string_params, - method_name: "test_iam_permissions", - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Iam::V1::TestIamPermissionsResponse.decode_json response.body, ignore_unknown_fields: true - catch :response do - yield result, operation if block_given? - result - end - end - - ## - # @private - # - # GRPC transcoding helper method for the list_tag_keys REST call - # - # @param request_pb [::Google::Cloud::ResourceManager::V3::ListTagKeysRequest] - # 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_tag_keys_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :get, - uri_template: "/v3/tagKeys", - matches: [] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the get_tag_key REST call - # - # @param request_pb [::Google::Cloud::ResourceManager::V3::GetTagKeyRequest] - # 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_tag_key_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :get, - uri_template: "/v3/{name}", - matches: [ - ["name", %r{^tagKeys/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the get_namespaced_tag_key REST call - # - # @param request_pb [::Google::Cloud::ResourceManager::V3::GetNamespacedTagKeyRequest] - # 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_namespaced_tag_key_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :get, - uri_template: "/v3/tagKeys/namespaced", - matches: [] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the create_tag_key REST call - # - # @param request_pb [::Google::Cloud::ResourceManager::V3::CreateTagKeyRequest] - # 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_tag_key_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :post, - uri_template: "/v3/tagKeys", - body: "tag_key", - matches: [] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the update_tag_key REST call - # - # @param request_pb [::Google::Cloud::ResourceManager::V3::UpdateTagKeyRequest] - # 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_tag_key_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :patch, - uri_template: "/v3/{tag_key.name}", - body: "tag_key", - matches: [ - ["tag_key.name", %r{^tagKeys/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the delete_tag_key REST call - # - # @param request_pb [::Google::Cloud::ResourceManager::V3::DeleteTagKeyRequest] - # 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_tag_key_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :delete, - uri_template: "/v3/{name}", - matches: [ - ["name", %r{^tagKeys/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the get_iam_policy REST call - # - # @param request_pb [::Google::Iam::V1::GetIamPolicyRequest] - # A request object representing the call parameters. Required. - # @return [Array(String, [String, nil], Hash{String => String})] - # Uri, Body, Query string parameters - def self.transcode_get_iam_policy_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :post, - uri_template: "/v3/{resource}:getIamPolicy", - body: "*", - matches: [ - ["resource", %r{^tagKeys/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the set_iam_policy REST call - # - # @param request_pb [::Google::Iam::V1::SetIamPolicyRequest] - # A request object representing the call parameters. Required. - # @return [Array(String, [String, nil], Hash{String => String})] - # Uri, Body, Query string parameters - def self.transcode_set_iam_policy_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :post, - uri_template: "/v3/{resource}:setIamPolicy", - body: "*", - matches: [ - ["resource", %r{^tagKeys/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the test_iam_permissions REST call - # - # @param request_pb [::Google::Iam::V1::TestIamPermissionsRequest] - # A request object representing the call parameters. Required. - # @return [Array(String, [String, nil], Hash{String => String})] - # Uri, Body, Query string parameters - def self.transcode_test_iam_permissions_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :post, - uri_template: "/v3/{resource}:testIamPermissions", - body: "*", - matches: [ - ["resource", %r{^tagKeys/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - end - end - end - end - end - end -end diff --git a/owl-bot-staging/google-cloud-resource_manager-v3/lib/google/cloud/resource_manager/v3/tag_values.rb b/owl-bot-staging/google-cloud-resource_manager-v3/lib/google/cloud/resource_manager/v3/tag_values.rb deleted file mode 100644 index 3ad105b69960..000000000000 --- a/owl-bot-staging/google-cloud-resource_manager-v3/lib/google/cloud/resource_manager/v3/tag_values.rb +++ /dev/null @@ -1,56 +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/resource_manager/v3/version" - -require "google/cloud/resource_manager/v3/tag_values/credentials" -require "google/cloud/resource_manager/v3/tag_values/paths" -require "google/cloud/resource_manager/v3/tag_values/operations" -require "google/cloud/resource_manager/v3/tag_values/client" -require "google/cloud/resource_manager/v3/tag_values/rest" - -module Google - module Cloud - module ResourceManager - module V3 - ## - # Allow users to create and manage tag values. - # - # @example Load this service and instantiate a gRPC client - # - # require "google/cloud/resource_manager/v3/tag_values" - # client = ::Google::Cloud::ResourceManager::V3::TagValues::Client.new - # - # @example Load this service and instantiate a REST client - # - # require "google/cloud/resource_manager/v3/tag_values/rest" - # client = ::Google::Cloud::ResourceManager::V3::TagValues::Rest::Client.new - # - module TagValues - end - end - end - end -end - -helper_path = ::File.join __dir__, "tag_values", "helpers.rb" -require "google/cloud/resource_manager/v3/tag_values/helpers" if ::File.file? helper_path diff --git a/owl-bot-staging/google-cloud-resource_manager-v3/lib/google/cloud/resource_manager/v3/tag_values/client.rb b/owl-bot-staging/google-cloud-resource_manager-v3/lib/google/cloud/resource_manager/v3/tag_values/client.rb deleted file mode 100644 index 20452134318b..000000000000 --- a/owl-bot-staging/google-cloud-resource_manager-v3/lib/google/cloud/resource_manager/v3/tag_values/client.rb +++ /dev/null @@ -1,1333 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -require "google/cloud/errors" -require "google/cloud/resourcemanager/v3/tag_values_pb" - -module Google - module Cloud - module ResourceManager - module V3 - module TagValues - ## - # Client for the TagValues service. - # - # Allow users to create and manage tag values. - # - class Client - # @private - API_VERSION = "" - - # @private - DEFAULT_ENDPOINT_TEMPLATE = "cloudresourcemanager.$UNIVERSE_DOMAIN$" - - include Paths - - # @private - attr_reader :tag_values_stub - - ## - # Configure the TagValues Client class. - # - # See {::Google::Cloud::ResourceManager::V3::TagValues::Client::Configuration} - # for a description of the configuration fields. - # - # @example - # - # # Modify the configuration for all TagValues clients - # ::Google::Cloud::ResourceManager::V3::TagValues::Client.configure do |config| - # config.timeout = 10.0 - # end - # - # @yield [config] Configure the Client client. - # @yieldparam config [Client::Configuration] - # - # @return [Client::Configuration] - # - def self.configure - @configure ||= begin - namespace = ["Google", "Cloud", "ResourceManager", "V3"] - parent_config = while namespace.any? - parent_name = namespace.join "::" - parent_const = const_get parent_name - break parent_const.configure if parent_const.respond_to? :configure - namespace.pop - end - default_config = Client::Configuration.new parent_config - - default_config.rpcs.list_tag_values.timeout = 60.0 - default_config.rpcs.list_tag_values.retry_policy = { - initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [14] - } - - default_config.rpcs.get_tag_value.timeout = 60.0 - default_config.rpcs.get_tag_value.retry_policy = { - initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [14] - } - - default_config.rpcs.create_tag_value.timeout = 60.0 - - default_config.rpcs.update_tag_value.timeout = 60.0 - - default_config.rpcs.delete_tag_value.timeout = 60.0 - - default_config.rpcs.get_iam_policy.timeout = 60.0 - default_config.rpcs.get_iam_policy.retry_policy = { - initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [14] - } - - default_config.rpcs.set_iam_policy.timeout = 60.0 - - default_config - end - yield @configure if block_given? - @configure - end - - ## - # Configure the TagValues Client instance. - # - # The configuration is set to the derived mode, meaning that values can be changed, - # but structural changes (adding new fields, etc.) are not allowed. Structural changes - # should be made on {Client.configure}. - # - # See {::Google::Cloud::ResourceManager::V3::TagValues::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 - @tag_values_stub.universe_domain - end - - ## - # Create a new TagValues client object. - # - # @example - # - # # Create a client using the default configuration - # client = ::Google::Cloud::ResourceManager::V3::TagValues::Client.new - # - # # Create a client using a custom configuration - # client = ::Google::Cloud::ResourceManager::V3::TagValues::Client.new do |config| - # config.timeout = 10.0 - # end - # - # @yield [config] Configure the TagValues client. - # @yieldparam config [Client::Configuration] - # - def initialize - # These require statements are intentionally placed here to initialize - # the gRPC module only when it's required. - # See https://github.com/googleapis/toolkit/issues/446 - require "gapic/grpc" - require "google/cloud/resourcemanager/v3/tag_values_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 - - @tag_values_stub = ::Gapic::ServiceStub.new( - ::Google::Cloud::ResourceManager::V3::TagValues::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 - ) - - @tag_values_stub.stub_logger&.info do |entry| - entry.set_system_name - entry.set_service - entry.message = "Created client for #{entry.service}" - entry.set_credentials_fields credentials - entry.set "customEndpoint", @config.endpoint if @config.endpoint - entry.set "defaultTimeout", @config.timeout if @config.timeout - entry.set "quotaProject", @quota_project_id if @quota_project_id - end - end - - ## - # Get the associated client for long-running operations. - # - # @return [::Google::Cloud::ResourceManager::V3::TagValues::Operations] - # - attr_reader :operations_client - - ## - # The logger used for request/response debug logging. - # - # @return [Logger] - # - def logger - @tag_values_stub.logger - end - - # Service calls - - ## - # Lists all TagValues for a specific TagKey. - # - # @overload list_tag_values(request, options = nil) - # Pass arguments to `list_tag_values` via a request object, either of type - # {::Google::Cloud::ResourceManager::V3::ListTagValuesRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::ResourceManager::V3::ListTagValuesRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_tag_values(parent: nil, page_size: nil, page_token: nil) - # Pass arguments to `list_tag_values` via keyword arguments. Note that at - # least one keyword argument is 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. - # @param page_size [::Integer] - # Optional. The maximum number of TagValues to return in the response. The - # server allows a maximum of 300 TagValues to return. If unspecified, the - # server will use 100 as the default. - # @param page_token [::String] - # Optional. A pagination token returned from a previous call to - # `ListTagValues` that indicates where this listing should continue from. - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Gapic::PagedEnumerable<::Google::Cloud::ResourceManager::V3::TagValue>] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Gapic::PagedEnumerable<::Google::Cloud::ResourceManager::V3::TagValue>] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/cloud/resource_manager/v3" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::ResourceManager::V3::TagValues::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::ResourceManager::V3::ListTagValuesRequest.new - # - # # Call the list_tag_values method. - # result = client.list_tag_values request - # - # # The returned object is of type Gapic::PagedEnumerable. You can iterate - # # over elements, and API calls will be issued to fetch pages as needed. - # result.each do |item| - # # Each element is of type ::Google::Cloud::ResourceManager::V3::TagValue. - # p item - # end - # - def list_tag_values request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::ResourceManager::V3::ListTagValuesRequest - - # Converts hash 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_tag_values.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::ResourceManager::V3::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.list_tag_values.timeout, - metadata: metadata, - retry_policy: @config.rpcs.list_tag_values.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @tag_values_stub.call_rpc :list_tag_values, request, options: options do |response, operation| - response = ::Gapic::PagedEnumerable.new @tag_values_stub, :list_tag_values, 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 - - ## - # Retrieves a TagValue. This method will return `PERMISSION_DENIED` if the - # value does not exist or the user does not have permission to view it. - # - # @overload get_tag_value(request, options = nil) - # Pass arguments to `get_tag_value` via a request object, either of type - # {::Google::Cloud::ResourceManager::V3::GetTagValueRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::ResourceManager::V3::GetTagValueRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_tag_value(name: nil) - # Pass arguments to `get_tag_value` via keyword arguments. Note that at - # least one keyword argument is 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. Resource name for TagValue to be fetched in the format - # `tagValues/456`. - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Google::Cloud::ResourceManager::V3::TagValue] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Google::Cloud::ResourceManager::V3::TagValue] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/cloud/resource_manager/v3" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::ResourceManager::V3::TagValues::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::ResourceManager::V3::GetTagValueRequest.new - # - # # Call the get_tag_value method. - # result = client.get_tag_value request - # - # # The returned object is of type Google::Cloud::ResourceManager::V3::TagValue. - # p result - # - def get_tag_value request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::ResourceManager::V3::GetTagValueRequest - - # Converts hash 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_tag_value.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::ResourceManager::V3::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_tag_value.timeout, - metadata: metadata, - retry_policy: @config.rpcs.get_tag_value.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @tag_values_stub.call_rpc :get_tag_value, request, options: options do |response, operation| - yield response, operation if block_given? - end - rescue ::GRPC::BadStatus => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Retrieves a TagValue by its namespaced name. - # This method will return `PERMISSION_DENIED` if the value does not exist - # or the user does not have permission to view it. - # - # @overload get_namespaced_tag_value(request, options = nil) - # Pass arguments to `get_namespaced_tag_value` via a request object, either of type - # {::Google::Cloud::ResourceManager::V3::GetNamespacedTagValueRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::ResourceManager::V3::GetNamespacedTagValueRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_namespaced_tag_value(name: nil) - # Pass arguments to `get_namespaced_tag_value` via keyword arguments. Note that at - # least one keyword argument is 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. A namespaced tag value name in the following format: - # - # `{parentId}/{tagKeyShort}/{tagValueShort}` - # - # Examples: - # - `42/foo/abc` for a value with short name "abc" under the key with short - # name "foo" under the organization with ID 42 - # - `r2-d2/bar/xyz` for a value with short name "xyz" under the key with - # short name "bar" under the project with ID "r2-d2" - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Google::Cloud::ResourceManager::V3::TagValue] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Google::Cloud::ResourceManager::V3::TagValue] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/cloud/resource_manager/v3" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::ResourceManager::V3::TagValues::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::ResourceManager::V3::GetNamespacedTagValueRequest.new - # - # # Call the get_namespaced_tag_value method. - # result = client.get_namespaced_tag_value request - # - # # The returned object is of type Google::Cloud::ResourceManager::V3::TagValue. - # p result - # - def get_namespaced_tag_value request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::ResourceManager::V3::GetNamespacedTagValueRequest - - # Converts hash 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_namespaced_tag_value.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::ResourceManager::V3::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.get_namespaced_tag_value.timeout, - metadata: metadata, - retry_policy: @config.rpcs.get_namespaced_tag_value.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @tag_values_stub.call_rpc :get_namespaced_tag_value, request, options: options do |response, operation| - yield response, operation if block_given? - end - rescue ::GRPC::BadStatus => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Creates a TagValue as a child of the specified TagKey. If a another - # request with the same parameters is sent while the original request is in - # process the second request will receive an error. A maximum of 1000 - # TagValues can exist under a TagKey at any given time. - # - # @overload create_tag_value(request, options = nil) - # Pass arguments to `create_tag_value` via a request object, either of type - # {::Google::Cloud::ResourceManager::V3::CreateTagValueRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::ResourceManager::V3::CreateTagValueRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_tag_value(tag_value: nil, validate_only: nil) - # Pass arguments to `create_tag_value` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param tag_value [::Google::Cloud::ResourceManager::V3::TagValue, ::Hash] - # Required. The TagValue to be created. Only fields `short_name`, - # `description`, and `parent` are considered during the creation request. - # @param validate_only [::Boolean] - # Optional. Set as true to perform the validations necessary for creating the - # resource, but not actually perform the action. - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Gapic::Operation] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Gapic::Operation] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/cloud/resource_manager/v3" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::ResourceManager::V3::TagValues::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::ResourceManager::V3::CreateTagValueRequest.new - # - # # Call the create_tag_value method. - # result = client.create_tag_value 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_tag_value request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::ResourceManager::V3::CreateTagValueRequest - - # Converts hash 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_tag_value.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::ResourceManager::V3::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.create_tag_value.timeout, - metadata: metadata, - retry_policy: @config.rpcs.create_tag_value.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @tag_values_stub.call_rpc :create_tag_value, request, options: options do |response, operation| - response = ::Gapic::Operation.new response, @operations_client, options: options - yield response, operation if block_given? - throw :response, response - end - rescue ::GRPC::BadStatus => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Updates the attributes of the TagValue resource. - # - # @overload update_tag_value(request, options = nil) - # Pass arguments to `update_tag_value` via a request object, either of type - # {::Google::Cloud::ResourceManager::V3::UpdateTagValueRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::ResourceManager::V3::UpdateTagValueRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_tag_value(tag_value: nil, update_mask: nil, validate_only: nil) - # Pass arguments to `update_tag_value` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param tag_value [::Google::Cloud::ResourceManager::V3::TagValue, ::Hash] - # Required. The new definition of the TagValue. Only fields `description` and - # `etag` fields can be updated by this request. If the `etag` field is - # nonempty, it must match the `etag` field of the existing ControlGroup. - # Otherwise, `ABORTED` will be returned. - # @param update_mask [::Google::Protobuf::FieldMask, ::Hash] - # Optional. Fields to be updated. - # @param validate_only [::Boolean] - # Optional. True to perform validations necessary for updating the resource, - # but not actually perform the action. - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Gapic::Operation] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Gapic::Operation] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/cloud/resource_manager/v3" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::ResourceManager::V3::TagValues::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::ResourceManager::V3::UpdateTagValueRequest.new - # - # # Call the update_tag_value method. - # result = client.update_tag_value 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_tag_value request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::ResourceManager::V3::UpdateTagValueRequest - - # Converts hash 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_tag_value.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::ResourceManager::V3::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.tag_value&.name - header_params["tag_value.name"] = request.tag_value.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_tag_value.timeout, - metadata: metadata, - retry_policy: @config.rpcs.update_tag_value.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @tag_values_stub.call_rpc :update_tag_value, 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 TagValue. The TagValue cannot have any bindings when it is - # deleted. - # - # @overload delete_tag_value(request, options = nil) - # Pass arguments to `delete_tag_value` via a request object, either of type - # {::Google::Cloud::ResourceManager::V3::DeleteTagValueRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::ResourceManager::V3::DeleteTagValueRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_tag_value(name: nil, validate_only: nil, etag: nil) - # Pass arguments to `delete_tag_value` via keyword arguments. Note that at - # least one keyword argument is 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. Resource name for TagValue to be deleted in the format - # tagValues/456. - # @param validate_only [::Boolean] - # Optional. Set as true to perform the validations necessary for deletion, - # but not actually perform the action. - # @param etag [::String] - # Optional. The etag known to the client for the expected state of the - # TagValue. This is to be used for optimistic concurrency. - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Gapic::Operation] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Gapic::Operation] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/cloud/resource_manager/v3" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::ResourceManager::V3::TagValues::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::ResourceManager::V3::DeleteTagValueRequest.new - # - # # Call the delete_tag_value method. - # result = client.delete_tag_value 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_tag_value request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::ResourceManager::V3::DeleteTagValueRequest - - # Converts hash 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_tag_value.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::ResourceManager::V3::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_tag_value.timeout, - metadata: metadata, - retry_policy: @config.rpcs.delete_tag_value.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @tag_values_stub.call_rpc :delete_tag_value, 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 the access control policy for a TagValue. The returned policy may be - # empty if no such policy or resource exists. The `resource` field should - # be the TagValue's resource name. For example: `tagValues/1234`. - # The caller must have the - # `cloudresourcemanager.googleapis.com/tagValues.getIamPolicy` permission on - # the identified TagValue to get the access control policy. - # - # @overload get_iam_policy(request, options = nil) - # Pass arguments to `get_iam_policy` via a request object, either of type - # {::Google::Iam::V1::GetIamPolicyRequest} or an equivalent Hash. - # - # @param request [::Google::Iam::V1::GetIamPolicyRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. - # - # @overload get_iam_policy(resource: nil, options: nil) - # Pass arguments to `get_iam_policy` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param resource [::String] - # REQUIRED: The resource for which the policy is being requested. - # See the operation documentation for the appropriate value for this field. - # @param options [::Google::Iam::V1::GetPolicyOptions, ::Hash] - # OPTIONAL: A `GetPolicyOptions` object for specifying options to - # `GetIamPolicy`. - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Google::Iam::V1::Policy] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Google::Iam::V1::Policy] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/cloud/resource_manager/v3" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::ResourceManager::V3::TagValues::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Iam::V1::GetIamPolicyRequest.new - # - # # Call the get_iam_policy method. - # result = client.get_iam_policy request - # - # # The returned object is of type Google::Iam::V1::Policy. - # p result - # - def get_iam_policy request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Iam::V1::GetIamPolicyRequest - - # Converts hash and nil to an options object - options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h - - # Customize the options with defaults - metadata = @config.rpcs.get_iam_policy.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::ResourceManager::V3::VERSION - metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - header_params = {} - if request.resource - header_params["resource"] = request.resource - end - - request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") - metadata[:"x-goog-request-params"] ||= request_params_header - - options.apply_defaults timeout: @config.rpcs.get_iam_policy.timeout, - metadata: metadata, - retry_policy: @config.rpcs.get_iam_policy.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @tag_values_stub.call_rpc :get_iam_policy, request, options: options do |response, operation| - yield response, operation if block_given? - end - rescue ::GRPC::BadStatus => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Sets the access control policy on a TagValue, replacing any existing - # policy. The `resource` field should be the TagValue's resource name. - # For example: `tagValues/1234`. - # The caller must have `resourcemanager.tagValues.setIamPolicy` permission - # on the identified tagValue. - # - # @overload set_iam_policy(request, options = nil) - # Pass arguments to `set_iam_policy` via a request object, either of type - # {::Google::Iam::V1::SetIamPolicyRequest} or an equivalent Hash. - # - # @param request [::Google::Iam::V1::SetIamPolicyRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. - # - # @overload set_iam_policy(resource: nil, policy: nil, update_mask: nil) - # Pass arguments to `set_iam_policy` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param resource [::String] - # REQUIRED: The resource for which the policy is being specified. - # See the operation documentation for the appropriate value for this field. - # @param policy [::Google::Iam::V1::Policy, ::Hash] - # REQUIRED: The complete policy to be applied to the `resource`. The size of - # the policy is limited to a few 10s of KB. An empty policy is a - # valid policy but certain Cloud Platform services (such as Projects) - # might reject them. - # @param update_mask [::Google::Protobuf::FieldMask, ::Hash] - # OPTIONAL: A FieldMask specifying which fields of the policy to modify. Only - # the fields in the mask will be modified. If no mask is provided, the - # following default mask is used: - # - # `paths: "bindings, etag"` - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Google::Iam::V1::Policy] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Google::Iam::V1::Policy] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/cloud/resource_manager/v3" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::ResourceManager::V3::TagValues::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Iam::V1::SetIamPolicyRequest.new - # - # # Call the set_iam_policy method. - # result = client.set_iam_policy request - # - # # The returned object is of type Google::Iam::V1::Policy. - # p result - # - def set_iam_policy request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Iam::V1::SetIamPolicyRequest - - # Converts hash and nil to an options object - options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h - - # Customize the options with defaults - metadata = @config.rpcs.set_iam_policy.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::ResourceManager::V3::VERSION - metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - header_params = {} - if request.resource - header_params["resource"] = request.resource - end - - request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") - metadata[:"x-goog-request-params"] ||= request_params_header - - options.apply_defaults timeout: @config.rpcs.set_iam_policy.timeout, - metadata: metadata, - retry_policy: @config.rpcs.set_iam_policy.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @tag_values_stub.call_rpc :set_iam_policy, request, options: options do |response, operation| - yield response, operation if block_given? - end - rescue ::GRPC::BadStatus => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Returns permissions that a caller has on the specified TagValue. - # The `resource` field should be the TagValue's resource name. For example: - # `tagValues/1234`. - # - # There are no permissions required for making this API call. - # - # @overload test_iam_permissions(request, options = nil) - # Pass arguments to `test_iam_permissions` via a request object, either of type - # {::Google::Iam::V1::TestIamPermissionsRequest} or an equivalent Hash. - # - # @param request [::Google::Iam::V1::TestIamPermissionsRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. - # - # @overload test_iam_permissions(resource: nil, permissions: nil) - # Pass arguments to `test_iam_permissions` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param resource [::String] - # REQUIRED: The resource for which the policy detail is being requested. - # See the operation documentation for the appropriate value for this field. - # @param permissions [::Array<::String>] - # The set of permissions to check for the `resource`. Permissions with - # wildcards (such as '*' or 'storage.*') are not allowed. For more - # information see - # [IAM Overview](https://cloud.google.com/iam/docs/overview#permissions). - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Google::Iam::V1::TestIamPermissionsResponse] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Google::Iam::V1::TestIamPermissionsResponse] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/cloud/resource_manager/v3" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::ResourceManager::V3::TagValues::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Iam::V1::TestIamPermissionsRequest.new - # - # # Call the test_iam_permissions method. - # result = client.test_iam_permissions request - # - # # The returned object is of type Google::Iam::V1::TestIamPermissionsResponse. - # p result - # - def test_iam_permissions request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Iam::V1::TestIamPermissionsRequest - - # Converts hash and nil to an options object - options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h - - # Customize the options with defaults - metadata = @config.rpcs.test_iam_permissions.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::ResourceManager::V3::VERSION - metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - header_params = {} - if request.resource - header_params["resource"] = request.resource - end - - request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") - metadata[:"x-goog-request-params"] ||= request_params_header - - options.apply_defaults timeout: @config.rpcs.test_iam_permissions.timeout, - metadata: metadata, - retry_policy: @config.rpcs.test_iam_permissions.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @tag_values_stub.call_rpc :test_iam_permissions, request, options: options do |response, operation| - yield response, operation if block_given? - end - rescue ::GRPC::BadStatus => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Configuration class for the TagValues API. - # - # This class represents the configuration for TagValues, - # providing control over timeouts, retry behavior, logging, transport - # parameters, and other low-level controls. Certain parameters can also be - # applied individually to specific RPCs. See - # {::Google::Cloud::ResourceManager::V3::TagValues::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_tag_values to 20 seconds, - # # and all remaining timeouts to 10 seconds. - # ::Google::Cloud::ResourceManager::V3::TagValues::Client.configure do |config| - # config.timeout = 10.0 - # config.rpcs.list_tag_values.timeout = 20.0 - # end - # - # # Apply the above configuration only to a new client. - # client = ::Google::Cloud::ResourceManager::V3::TagValues::Client.new do |config| - # config.timeout = 10.0 - # config.rpcs.list_tag_values.timeout = 20.0 - # end - # - # @!attribute [rw] endpoint - # A custom service endpoint, as a hostname or hostname:port. The default is - # nil, indicating to use the default endpoint in the current universe domain. - # @return [::String,nil] - # @!attribute [rw] credentials - # Credentials to send with calls. You may provide any of the following types: - # * (`Google::Auth::Credentials`) A googleauth credentials object - # (see the [googleauth docs](https://rubydoc.info/gems/googleauth/Google/Auth/Credentials)) - # * (`Signet::OAuth2::Client`) A signet oauth2 client object - # (see the [signet docs](https://rubydoc.info/gems/signet/Signet/OAuth2/Client)) - # * (`GRPC::Core::Channel`) a gRPC channel with included credentials - # * (`GRPC::Core::ChannelCredentials`) a gRPC credentails object - # * (`nil`) indicating no credentials - # - # @note Warning: Passing a `String` to a keyfile path or a `Hash` of credentials - # is deprecated. Providing an unvalidated credential configuration to - # Google APIs can compromise the security of your systems and data. - # - # @example - # - # # The recommended way to provide credentials is to use the `make_creds` method - # # on the appropriate credentials class for your environment. - # - # require "googleauth" - # - # credentials = ::Google::Auth::ServiceAccountCredentials.make_creds( - # json_key_io: ::File.open("/path/to/keyfile.json") - # ) - # - # client = ::Google::Cloud::ResourceManager::V3::TagValues::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 = "cloudresourcemanager.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 TagValues 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_tag_values` - # @return [::Gapic::Config::Method] - # - attr_reader :list_tag_values - ## - # RPC-specific configuration for `get_tag_value` - # @return [::Gapic::Config::Method] - # - attr_reader :get_tag_value - ## - # RPC-specific configuration for `get_namespaced_tag_value` - # @return [::Gapic::Config::Method] - # - attr_reader :get_namespaced_tag_value - ## - # RPC-specific configuration for `create_tag_value` - # @return [::Gapic::Config::Method] - # - attr_reader :create_tag_value - ## - # RPC-specific configuration for `update_tag_value` - # @return [::Gapic::Config::Method] - # - attr_reader :update_tag_value - ## - # RPC-specific configuration for `delete_tag_value` - # @return [::Gapic::Config::Method] - # - attr_reader :delete_tag_value - ## - # RPC-specific configuration for `get_iam_policy` - # @return [::Gapic::Config::Method] - # - attr_reader :get_iam_policy - ## - # RPC-specific configuration for `set_iam_policy` - # @return [::Gapic::Config::Method] - # - attr_reader :set_iam_policy - ## - # RPC-specific configuration for `test_iam_permissions` - # @return [::Gapic::Config::Method] - # - attr_reader :test_iam_permissions - - # @private - def initialize parent_rpcs = nil - list_tag_values_config = parent_rpcs.list_tag_values if parent_rpcs.respond_to? :list_tag_values - @list_tag_values = ::Gapic::Config::Method.new list_tag_values_config - get_tag_value_config = parent_rpcs.get_tag_value if parent_rpcs.respond_to? :get_tag_value - @get_tag_value = ::Gapic::Config::Method.new get_tag_value_config - get_namespaced_tag_value_config = parent_rpcs.get_namespaced_tag_value if parent_rpcs.respond_to? :get_namespaced_tag_value - @get_namespaced_tag_value = ::Gapic::Config::Method.new get_namespaced_tag_value_config - create_tag_value_config = parent_rpcs.create_tag_value if parent_rpcs.respond_to? :create_tag_value - @create_tag_value = ::Gapic::Config::Method.new create_tag_value_config - update_tag_value_config = parent_rpcs.update_tag_value if parent_rpcs.respond_to? :update_tag_value - @update_tag_value = ::Gapic::Config::Method.new update_tag_value_config - delete_tag_value_config = parent_rpcs.delete_tag_value if parent_rpcs.respond_to? :delete_tag_value - @delete_tag_value = ::Gapic::Config::Method.new delete_tag_value_config - get_iam_policy_config = parent_rpcs.get_iam_policy if parent_rpcs.respond_to? :get_iam_policy - @get_iam_policy = ::Gapic::Config::Method.new get_iam_policy_config - set_iam_policy_config = parent_rpcs.set_iam_policy if parent_rpcs.respond_to? :set_iam_policy - @set_iam_policy = ::Gapic::Config::Method.new set_iam_policy_config - test_iam_permissions_config = parent_rpcs.test_iam_permissions if parent_rpcs.respond_to? :test_iam_permissions - @test_iam_permissions = ::Gapic::Config::Method.new test_iam_permissions_config - - yield self if block_given? - end - end - end - end - end - end - end - end -end diff --git a/owl-bot-staging/google-cloud-resource_manager-v3/lib/google/cloud/resource_manager/v3/tag_values/credentials.rb b/owl-bot-staging/google-cloud-resource_manager-v3/lib/google/cloud/resource_manager/v3/tag_values/credentials.rb deleted file mode 100644 index 4eddb68dc221..000000000000 --- a/owl-bot-staging/google-cloud-resource_manager-v3/lib/google/cloud/resource_manager/v3/tag_values/credentials.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 "googleauth" - -module Google - module Cloud - module ResourceManager - module V3 - module TagValues - # Credentials for the TagValues API. - class Credentials < ::Google::Auth::Credentials - self.scope = [ - "https://www.googleapis.com/auth/cloud-platform", - "https://www.googleapis.com/auth/cloud-platform.read-only" - ] - self.env_vars = [ - "RESOURCE_MANAGER_CREDENTIALS", - "RESOURCE_MANAGER_KEYFILE", - "GOOGLE_CLOUD_CREDENTIALS", - "GOOGLE_CLOUD_KEYFILE", - "GCLOUD_KEYFILE", - "RESOURCE_MANAGER_CREDENTIALS_JSON", - "RESOURCE_MANAGER_KEYFILE_JSON", - "GOOGLE_CLOUD_CREDENTIALS_JSON", - "GOOGLE_CLOUD_KEYFILE_JSON", - "GCLOUD_KEYFILE_JSON" - ] - self.paths = [ - "~/.config/google_cloud/application_default_credentials.json" - ] - end - end - end - end - end -end diff --git a/owl-bot-staging/google-cloud-resource_manager-v3/lib/google/cloud/resource_manager/v3/tag_values/operations.rb b/owl-bot-staging/google-cloud-resource_manager-v3/lib/google/cloud/resource_manager/v3/tag_values/operations.rb deleted file mode 100644 index 64fb7719d479..000000000000 --- a/owl-bot-staging/google-cloud-resource_manager-v3/lib/google/cloud/resource_manager/v3/tag_values/operations.rb +++ /dev/null @@ -1,841 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -require "gapic/operation" -require "google/longrunning/operations_pb" - -module Google - module Cloud - module ResourceManager - module V3 - module TagValues - # Service that implements Longrunning Operations API. - class Operations - # @private - API_VERSION = "" - - # @private - DEFAULT_ENDPOINT_TEMPLATE = "cloudresourcemanager.$UNIVERSE_DOMAIN$" - - # @private - attr_reader :operations_stub - - ## - # Configuration for the TagValues 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 TagValues 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::ResourceManager::V3::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::ResourceManager::V3::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::ResourceManager::V3::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::ResourceManager::V3::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::ResourceManager::V3::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 = "cloudresourcemanager.googleapis.com" - - config_attr :endpoint, nil, ::String, nil - config_attr :credentials, nil do |value| - allowed = [::String, ::Hash, ::Proc, ::Symbol, ::Google::Auth::Credentials, ::Google::Auth::BaseClient, ::Signet::OAuth2::Client, nil] - allowed += [::GRPC::Core::Channel, ::GRPC::Core::ChannelCredentials] if defined? ::GRPC::Core::Channel - allowed.any? { |klass| klass === value } - end - config_attr :scope, nil, ::String, ::Array, nil - config_attr :lib_name, nil, ::String, nil - config_attr :lib_version, nil, ::String, nil - config_attr(:channel_args, { "grpc.service_config_disable_resolution" => 1 }, ::Hash, nil) - config_attr :interceptors, nil, ::Array, nil - config_attr :timeout, nil, ::Numeric, nil - config_attr :metadata, nil, ::Hash, nil - config_attr :retry_policy, nil, ::Hash, ::Proc, nil - config_attr :quota_project, nil, ::String, nil - config_attr :universe_domain, nil, ::String, nil - config_attr :logger, :default, ::Logger, nil, :default - - # @private - def initialize parent_config = nil - @parent_config = parent_config unless parent_config.nil? - - yield self if block_given? - end - - ## - # Configurations for individual RPCs - # @return [Rpcs] - # - def rpcs - @rpcs ||= begin - parent_rpcs = nil - parent_rpcs = @parent_config.rpcs if defined?(@parent_config) && @parent_config.respond_to?(:rpcs) - Rpcs.new parent_rpcs - end - end - - ## - # Configuration for the channel pool - # @return [::Gapic::ServiceStub::ChannelPool::Configuration] - # - def channel_pool - @channel_pool ||= ::Gapic::ServiceStub::ChannelPool::Configuration.new - end - - ## - # Configuration RPC class for the Operations API. - # - # Includes fields providing the configuration for each RPC in this service. - # Each configuration object is of type `Gapic::Config::Method` and includes - # the following configuration fields: - # - # * `timeout` (*type:* `Numeric`) - The call timeout in seconds - # * `metadata` (*type:* `Hash{Symbol=>String}`) - Additional gRPC headers - # * `retry_policy (*type:* `Hash`) - The retry policy. The policy fields - # include the following keys: - # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds. - # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds. - # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier. - # * `:retry_codes` (*type:* `Array`) - The error codes that should - # trigger a retry. - # - class Rpcs - ## - # RPC-specific configuration for `list_operations` - # @return [::Gapic::Config::Method] - # - attr_reader :list_operations - ## - # RPC-specific configuration for `get_operation` - # @return [::Gapic::Config::Method] - # - attr_reader :get_operation - ## - # RPC-specific configuration for `delete_operation` - # @return [::Gapic::Config::Method] - # - attr_reader :delete_operation - ## - # RPC-specific configuration for `cancel_operation` - # @return [::Gapic::Config::Method] - # - attr_reader :cancel_operation - ## - # RPC-specific configuration for `wait_operation` - # @return [::Gapic::Config::Method] - # - attr_reader :wait_operation - - # @private - def initialize parent_rpcs = nil - list_operations_config = parent_rpcs.list_operations if parent_rpcs.respond_to? :list_operations - @list_operations = ::Gapic::Config::Method.new list_operations_config - get_operation_config = parent_rpcs.get_operation if parent_rpcs.respond_to? :get_operation - @get_operation = ::Gapic::Config::Method.new get_operation_config - delete_operation_config = parent_rpcs.delete_operation if parent_rpcs.respond_to? :delete_operation - @delete_operation = ::Gapic::Config::Method.new delete_operation_config - cancel_operation_config = parent_rpcs.cancel_operation if parent_rpcs.respond_to? :cancel_operation - @cancel_operation = ::Gapic::Config::Method.new cancel_operation_config - wait_operation_config = parent_rpcs.wait_operation if parent_rpcs.respond_to? :wait_operation - @wait_operation = ::Gapic::Config::Method.new wait_operation_config - - yield self if block_given? - end - end - end - end - end - end - end - end -end diff --git a/owl-bot-staging/google-cloud-resource_manager-v3/lib/google/cloud/resource_manager/v3/tag_values/paths.rb b/owl-bot-staging/google-cloud-resource_manager-v3/lib/google/cloud/resource_manager/v3/tag_values/paths.rb deleted file mode 100644 index 07f732d41df2..000000000000 --- a/owl-bot-staging/google-cloud-resource_manager-v3/lib/google/cloud/resource_manager/v3/tag_values/paths.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! - - -module Google - module Cloud - module ResourceManager - module V3 - module TagValues - # Path helper methods for the TagValues API. - module Paths - ## - # Create a fully-qualified TagValue resource string. - # - # The resource will be in the following format: - # - # `tagValues/{tag_value}` - # - # @param tag_value [String] - # - # @return [::String] - def tag_value_path tag_value: - "tagValues/#{tag_value}" - end - - extend self - end - end - end - end - end -end diff --git a/owl-bot-staging/google-cloud-resource_manager-v3/lib/google/cloud/resource_manager/v3/tag_values/rest.rb b/owl-bot-staging/google-cloud-resource_manager-v3/lib/google/cloud/resource_manager/v3/tag_values/rest.rb deleted file mode 100644 index 0bc46ddc107f..000000000000 --- a/owl-bot-staging/google-cloud-resource_manager-v3/lib/google/cloud/resource_manager/v3/tag_values/rest.rb +++ /dev/null @@ -1,53 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -require "gapic/rest" -require "gapic/config" -require "gapic/config/method" - -require "google/cloud/resource_manager/v3/version" - -require "google/cloud/resource_manager/v3/tag_values/credentials" -require "google/cloud/resource_manager/v3/tag_values/paths" -require "google/cloud/resource_manager/v3/tag_values/rest/operations" -require "google/cloud/resource_manager/v3/tag_values/rest/client" - -module Google - module Cloud - module ResourceManager - module V3 - ## - # Allow users to create and manage tag values. - # - # To load this service and instantiate a REST client: - # - # require "google/cloud/resource_manager/v3/tag_values/rest" - # client = ::Google::Cloud::ResourceManager::V3::TagValues::Rest::Client.new - # - module TagValues - # Client for the REST transport - module Rest - end - end - end - end - end -end - -helper_path = ::File.join __dir__, "rest", "helpers.rb" -require "google/cloud/resource_manager/v3/tag_values/rest/helpers" if ::File.file? helper_path diff --git a/owl-bot-staging/google-cloud-resource_manager-v3/lib/google/cloud/resource_manager/v3/tag_values/rest/client.rb b/owl-bot-staging/google-cloud-resource_manager-v3/lib/google/cloud/resource_manager/v3/tag_values/rest/client.rb deleted file mode 100644 index dfe8b2265922..000000000000 --- a/owl-bot-staging/google-cloud-resource_manager-v3/lib/google/cloud/resource_manager/v3/tag_values/rest/client.rb +++ /dev/null @@ -1,1251 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -require "google/cloud/errors" -require "google/cloud/resourcemanager/v3/tag_values_pb" -require "google/cloud/resource_manager/v3/tag_values/rest/service_stub" - -module Google - module Cloud - module ResourceManager - module V3 - module TagValues - module Rest - ## - # REST client for the TagValues service. - # - # Allow users to create and manage tag values. - # - class Client - # @private - API_VERSION = "" - - # @private - DEFAULT_ENDPOINT_TEMPLATE = "cloudresourcemanager.$UNIVERSE_DOMAIN$" - - include Paths - - # @private - attr_reader :tag_values_stub - - ## - # Configure the TagValues Client class. - # - # See {::Google::Cloud::ResourceManager::V3::TagValues::Rest::Client::Configuration} - # for a description of the configuration fields. - # - # @example - # - # # Modify the configuration for all TagValues clients - # ::Google::Cloud::ResourceManager::V3::TagValues::Rest::Client.configure do |config| - # config.timeout = 10.0 - # end - # - # @yield [config] Configure the Client client. - # @yieldparam config [Client::Configuration] - # - # @return [Client::Configuration] - # - def self.configure - @configure ||= begin - namespace = ["Google", "Cloud", "ResourceManager", "V3"] - parent_config = while namespace.any? - parent_name = namespace.join "::" - parent_const = const_get parent_name - break parent_const.configure if parent_const.respond_to? :configure - namespace.pop - end - default_config = Client::Configuration.new parent_config - - default_config.rpcs.list_tag_values.timeout = 60.0 - default_config.rpcs.list_tag_values.retry_policy = { - initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [14] - } - - default_config.rpcs.get_tag_value.timeout = 60.0 - default_config.rpcs.get_tag_value.retry_policy = { - initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [14] - } - - default_config.rpcs.create_tag_value.timeout = 60.0 - - default_config.rpcs.update_tag_value.timeout = 60.0 - - default_config.rpcs.delete_tag_value.timeout = 60.0 - - default_config.rpcs.get_iam_policy.timeout = 60.0 - default_config.rpcs.get_iam_policy.retry_policy = { - initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [14] - } - - default_config.rpcs.set_iam_policy.timeout = 60.0 - - default_config - end - yield @configure if block_given? - @configure - end - - ## - # Configure the TagValues Client instance. - # - # The configuration is set to the derived mode, meaning that values can be changed, - # but structural changes (adding new fields, etc.) are not allowed. Structural changes - # should be made on {Client.configure}. - # - # See {::Google::Cloud::ResourceManager::V3::TagValues::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 - @tag_values_stub.universe_domain - end - - ## - # Create a new TagValues REST client object. - # - # @example - # - # # Create a client using the default configuration - # client = ::Google::Cloud::ResourceManager::V3::TagValues::Rest::Client.new - # - # # Create a client using a custom configuration - # client = ::Google::Cloud::ResourceManager::V3::TagValues::Rest::Client.new do |config| - # config.timeout = 10.0 - # end - # - # @yield [config] Configure the TagValues client. - # @yieldparam config [Client::Configuration] - # - def initialize - # Create the configuration object - @config = Configuration.new Client.configure - - # Yield the configuration if needed - yield @config if block_given? - - # Create credentials - credentials = @config.credentials - # Use self-signed JWT if the endpoint is unchanged from default, - # but only if the default endpoint does not have a region prefix. - enable_self_signed_jwt = @config.endpoint.nil? || - (@config.endpoint == Configuration::DEFAULT_ENDPOINT && - !@config.endpoint.split(".").first.include?("-")) - credentials ||= Credentials.default scope: @config.scope, - enable_self_signed_jwt: enable_self_signed_jwt - if credentials.is_a?(::String) || credentials.is_a?(::Hash) - credentials = Credentials.new credentials, scope: @config.scope - end - - @quota_project_id = @config.quota_project - @quota_project_id ||= credentials.quota_project_id if credentials.respond_to? :quota_project_id - - @operations_client = ::Google::Cloud::ResourceManager::V3::TagValues::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 - - @tag_values_stub = ::Google::Cloud::ResourceManager::V3::TagValues::Rest::ServiceStub.new( - endpoint: @config.endpoint, - endpoint_template: DEFAULT_ENDPOINT_TEMPLATE, - universe_domain: @config.universe_domain, - credentials: credentials, - logger: @config.logger - ) - - @tag_values_stub.logger(stub: true)&.info do |entry| - entry.set_system_name - entry.set_service - entry.message = "Created client for #{entry.service}" - entry.set_credentials_fields credentials - entry.set "customEndpoint", @config.endpoint if @config.endpoint - entry.set "defaultTimeout", @config.timeout if @config.timeout - entry.set "quotaProject", @quota_project_id if @quota_project_id - end - end - - ## - # Get the associated client for long-running operations. - # - # @return [::Google::Cloud::ResourceManager::V3::TagValues::Rest::Operations] - # - attr_reader :operations_client - - ## - # The logger used for request/response debug logging. - # - # @return [Logger] - # - def logger - @tag_values_stub.logger - end - - # Service calls - - ## - # Lists all TagValues for a specific TagKey. - # - # @overload list_tag_values(request, options = nil) - # Pass arguments to `list_tag_values` via a request object, either of type - # {::Google::Cloud::ResourceManager::V3::ListTagValuesRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::ResourceManager::V3::ListTagValuesRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_tag_values(parent: nil, page_size: nil, page_token: nil) - # Pass arguments to `list_tag_values` via keyword arguments. Note that at - # least one keyword argument is 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. - # @param page_size [::Integer] - # Optional. The maximum number of TagValues to return in the response. The - # server allows a maximum of 300 TagValues to return. If unspecified, the - # server will use 100 as the default. - # @param page_token [::String] - # Optional. A pagination token returned from a previous call to - # `ListTagValues` that indicates where this listing should continue from. - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Gapic::Rest::PagedEnumerable<::Google::Cloud::ResourceManager::V3::TagValue>] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Gapic::Rest::PagedEnumerable<::Google::Cloud::ResourceManager::V3::TagValue>] - # - # @raise [::Google::Cloud::Error] if the REST call is aborted. - # - # @example Basic example - # require "google/cloud/resource_manager/v3" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::ResourceManager::V3::TagValues::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::ResourceManager::V3::ListTagValuesRequest.new - # - # # Call the list_tag_values method. - # result = client.list_tag_values request - # - # # The returned object is of type Gapic::PagedEnumerable. You can iterate - # # over elements, and API calls will be issued to fetch pages as needed. - # result.each do |item| - # # Each element is of type ::Google::Cloud::ResourceManager::V3::TagValue. - # p item - # end - # - def list_tag_values request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::ResourceManager::V3::ListTagValuesRequest - - # Converts hash 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_tag_values.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::ResourceManager::V3::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_tag_values.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.list_tag_values.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @tag_values_stub.list_tag_values request, options do |result, operation| - result = ::Gapic::Rest::PagedEnumerable.new @tag_values_stub, :list_tag_values, "tag_values", 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 - - ## - # Retrieves a TagValue. This method will return `PERMISSION_DENIED` if the - # value does not exist or the user does not have permission to view it. - # - # @overload get_tag_value(request, options = nil) - # Pass arguments to `get_tag_value` via a request object, either of type - # {::Google::Cloud::ResourceManager::V3::GetTagValueRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::ResourceManager::V3::GetTagValueRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_tag_value(name: nil) - # Pass arguments to `get_tag_value` via keyword arguments. Note that at - # least one keyword argument is 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. Resource name for TagValue to be fetched in the format - # `tagValues/456`. - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Cloud::ResourceManager::V3::TagValue] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::ResourceManager::V3::TagValue] - # - # @raise [::Google::Cloud::Error] if the REST call is aborted. - # - # @example Basic example - # require "google/cloud/resource_manager/v3" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::ResourceManager::V3::TagValues::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::ResourceManager::V3::GetTagValueRequest.new - # - # # Call the get_tag_value method. - # result = client.get_tag_value request - # - # # The returned object is of type Google::Cloud::ResourceManager::V3::TagValue. - # p result - # - def get_tag_value request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::ResourceManager::V3::GetTagValueRequest - - # Converts hash 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_tag_value.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::ResourceManager::V3::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_tag_value.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.get_tag_value.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @tag_values_stub.get_tag_value 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 - - ## - # Retrieves a TagValue by its namespaced name. - # This method will return `PERMISSION_DENIED` if the value does not exist - # or the user does not have permission to view it. - # - # @overload get_namespaced_tag_value(request, options = nil) - # Pass arguments to `get_namespaced_tag_value` via a request object, either of type - # {::Google::Cloud::ResourceManager::V3::GetNamespacedTagValueRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::ResourceManager::V3::GetNamespacedTagValueRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_namespaced_tag_value(name: nil) - # Pass arguments to `get_namespaced_tag_value` via keyword arguments. Note that at - # least one keyword argument is 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. A namespaced tag value name in the following format: - # - # `{parentId}/{tagKeyShort}/{tagValueShort}` - # - # Examples: - # - `42/foo/abc` for a value with short name "abc" under the key with short - # name "foo" under the organization with ID 42 - # - `r2-d2/bar/xyz` for a value with short name "xyz" under the key with - # short name "bar" under the project with ID "r2-d2" - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Cloud::ResourceManager::V3::TagValue] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::ResourceManager::V3::TagValue] - # - # @raise [::Google::Cloud::Error] if the REST call is aborted. - # - # @example Basic example - # require "google/cloud/resource_manager/v3" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::ResourceManager::V3::TagValues::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::ResourceManager::V3::GetNamespacedTagValueRequest.new - # - # # Call the get_namespaced_tag_value method. - # result = client.get_namespaced_tag_value request - # - # # The returned object is of type Google::Cloud::ResourceManager::V3::TagValue. - # p result - # - def get_namespaced_tag_value request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::ResourceManager::V3::GetNamespacedTagValueRequest - - # Converts hash 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_namespaced_tag_value.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::ResourceManager::V3::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_namespaced_tag_value.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.get_namespaced_tag_value.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @tag_values_stub.get_namespaced_tag_value request, options do |result, operation| - yield result, operation if block_given? - end - rescue ::Gapic::Rest::Error => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Creates a TagValue as a child of the specified TagKey. If a another - # request with the same parameters is sent while the original request is in - # process the second request will receive an error. A maximum of 1000 - # TagValues can exist under a TagKey at any given time. - # - # @overload create_tag_value(request, options = nil) - # Pass arguments to `create_tag_value` via a request object, either of type - # {::Google::Cloud::ResourceManager::V3::CreateTagValueRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::ResourceManager::V3::CreateTagValueRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_tag_value(tag_value: nil, validate_only: nil) - # Pass arguments to `create_tag_value` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param tag_value [::Google::Cloud::ResourceManager::V3::TagValue, ::Hash] - # Required. The TagValue to be created. Only fields `short_name`, - # `description`, and `parent` are considered during the creation request. - # @param validate_only [::Boolean] - # Optional. Set as true to perform the validations necessary for creating the - # resource, but not actually perform the action. - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Gapic::Operation] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Gapic::Operation] - # - # @raise [::Google::Cloud::Error] if the REST call is aborted. - # - # @example Basic example - # require "google/cloud/resource_manager/v3" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::ResourceManager::V3::TagValues::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::ResourceManager::V3::CreateTagValueRequest.new - # - # # Call the create_tag_value method. - # result = client.create_tag_value 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_tag_value request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::ResourceManager::V3::CreateTagValueRequest - - # Converts hash 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_tag_value.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::ResourceManager::V3::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_tag_value.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.create_tag_value.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @tag_values_stub.create_tag_value 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 - - ## - # Updates the attributes of the TagValue resource. - # - # @overload update_tag_value(request, options = nil) - # Pass arguments to `update_tag_value` via a request object, either of type - # {::Google::Cloud::ResourceManager::V3::UpdateTagValueRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::ResourceManager::V3::UpdateTagValueRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_tag_value(tag_value: nil, update_mask: nil, validate_only: nil) - # Pass arguments to `update_tag_value` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param tag_value [::Google::Cloud::ResourceManager::V3::TagValue, ::Hash] - # Required. The new definition of the TagValue. Only fields `description` and - # `etag` fields can be updated by this request. If the `etag` field is - # nonempty, it must match the `etag` field of the existing ControlGroup. - # Otherwise, `ABORTED` will be returned. - # @param update_mask [::Google::Protobuf::FieldMask, ::Hash] - # Optional. Fields to be updated. - # @param validate_only [::Boolean] - # Optional. True to perform validations necessary for updating the resource, - # but not actually perform the action. - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Gapic::Operation] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Gapic::Operation] - # - # @raise [::Google::Cloud::Error] if the REST call is aborted. - # - # @example Basic example - # require "google/cloud/resource_manager/v3" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::ResourceManager::V3::TagValues::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::ResourceManager::V3::UpdateTagValueRequest.new - # - # # Call the update_tag_value method. - # result = client.update_tag_value 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_tag_value request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::ResourceManager::V3::UpdateTagValueRequest - - # Converts hash 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_tag_value.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::ResourceManager::V3::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_tag_value.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.update_tag_value.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @tag_values_stub.update_tag_value 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 TagValue. The TagValue cannot have any bindings when it is - # deleted. - # - # @overload delete_tag_value(request, options = nil) - # Pass arguments to `delete_tag_value` via a request object, either of type - # {::Google::Cloud::ResourceManager::V3::DeleteTagValueRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::ResourceManager::V3::DeleteTagValueRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_tag_value(name: nil, validate_only: nil, etag: nil) - # Pass arguments to `delete_tag_value` via keyword arguments. Note that at - # least one keyword argument is 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. Resource name for TagValue to be deleted in the format - # tagValues/456. - # @param validate_only [::Boolean] - # Optional. Set as true to perform the validations necessary for deletion, - # but not actually perform the action. - # @param etag [::String] - # Optional. The etag known to the client for the expected state of the - # TagValue. This is to be used for optimistic concurrency. - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Gapic::Operation] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Gapic::Operation] - # - # @raise [::Google::Cloud::Error] if the REST call is aborted. - # - # @example Basic example - # require "google/cloud/resource_manager/v3" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::ResourceManager::V3::TagValues::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::ResourceManager::V3::DeleteTagValueRequest.new - # - # # Call the delete_tag_value method. - # result = client.delete_tag_value 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_tag_value request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::ResourceManager::V3::DeleteTagValueRequest - - # Converts hash 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_tag_value.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::ResourceManager::V3::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_tag_value.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.delete_tag_value.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @tag_values_stub.delete_tag_value 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 the access control policy for a TagValue. The returned policy may be - # empty if no such policy or resource exists. The `resource` field should - # be the TagValue's resource name. For example: `tagValues/1234`. - # The caller must have the - # `cloudresourcemanager.googleapis.com/tagValues.getIamPolicy` permission on - # the identified TagValue to get the access control policy. - # - # @overload get_iam_policy(request, options = nil) - # Pass arguments to `get_iam_policy` via a request object, either of type - # {::Google::Iam::V1::GetIamPolicyRequest} or an equivalent Hash. - # - # @param request [::Google::Iam::V1::GetIamPolicyRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @overload get_iam_policy(resource: nil, options: nil) - # Pass arguments to `get_iam_policy` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param resource [::String] - # REQUIRED: The resource for which the policy is being requested. - # See the operation documentation for the appropriate value for this field. - # @param options [::Google::Iam::V1::GetPolicyOptions, ::Hash] - # OPTIONAL: A `GetPolicyOptions` object for specifying options to - # `GetIamPolicy`. - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Iam::V1::Policy] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Iam::V1::Policy] - # - # @raise [::Google::Cloud::Error] if the REST call is aborted. - # - # @example Basic example - # require "google/cloud/resource_manager/v3" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::ResourceManager::V3::TagValues::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Iam::V1::GetIamPolicyRequest.new - # - # # Call the get_iam_policy method. - # result = client.get_iam_policy request - # - # # The returned object is of type Google::Iam::V1::Policy. - # p result - # - def get_iam_policy request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Iam::V1::GetIamPolicyRequest - - # Converts hash and nil to an options object - options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h - - # Customize the options with defaults - call_metadata = @config.rpcs.get_iam_policy.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::ResourceManager::V3::VERSION, - transports_version_send: [:rest] - - call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - options.apply_defaults timeout: @config.rpcs.get_iam_policy.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.get_iam_policy.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @tag_values_stub.get_iam_policy request, options do |result, operation| - yield result, operation if block_given? - end - rescue ::Gapic::Rest::Error => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Sets the access control policy on a TagValue, replacing any existing - # policy. The `resource` field should be the TagValue's resource name. - # For example: `tagValues/1234`. - # The caller must have `resourcemanager.tagValues.setIamPolicy` permission - # on the identified tagValue. - # - # @overload set_iam_policy(request, options = nil) - # Pass arguments to `set_iam_policy` via a request object, either of type - # {::Google::Iam::V1::SetIamPolicyRequest} or an equivalent Hash. - # - # @param request [::Google::Iam::V1::SetIamPolicyRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @overload set_iam_policy(resource: nil, policy: nil, update_mask: nil) - # Pass arguments to `set_iam_policy` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param resource [::String] - # REQUIRED: The resource for which the policy is being specified. - # See the operation documentation for the appropriate value for this field. - # @param policy [::Google::Iam::V1::Policy, ::Hash] - # REQUIRED: The complete policy to be applied to the `resource`. The size of - # the policy is limited to a few 10s of KB. An empty policy is a - # valid policy but certain Cloud Platform services (such as Projects) - # might reject them. - # @param update_mask [::Google::Protobuf::FieldMask, ::Hash] - # OPTIONAL: A FieldMask specifying which fields of the policy to modify. Only - # the fields in the mask will be modified. If no mask is provided, the - # following default mask is used: - # - # `paths: "bindings, etag"` - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Iam::V1::Policy] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Iam::V1::Policy] - # - # @raise [::Google::Cloud::Error] if the REST call is aborted. - # - # @example Basic example - # require "google/cloud/resource_manager/v3" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::ResourceManager::V3::TagValues::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Iam::V1::SetIamPolicyRequest.new - # - # # Call the set_iam_policy method. - # result = client.set_iam_policy request - # - # # The returned object is of type Google::Iam::V1::Policy. - # p result - # - def set_iam_policy request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Iam::V1::SetIamPolicyRequest - - # Converts hash and nil to an options object - options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h - - # Customize the options with defaults - call_metadata = @config.rpcs.set_iam_policy.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::ResourceManager::V3::VERSION, - transports_version_send: [:rest] - - call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - options.apply_defaults timeout: @config.rpcs.set_iam_policy.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.set_iam_policy.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @tag_values_stub.set_iam_policy request, options do |result, operation| - yield result, operation if block_given? - end - rescue ::Gapic::Rest::Error => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Returns permissions that a caller has on the specified TagValue. - # The `resource` field should be the TagValue's resource name. For example: - # `tagValues/1234`. - # - # There are no permissions required for making this API call. - # - # @overload test_iam_permissions(request, options = nil) - # Pass arguments to `test_iam_permissions` via a request object, either of type - # {::Google::Iam::V1::TestIamPermissionsRequest} or an equivalent Hash. - # - # @param request [::Google::Iam::V1::TestIamPermissionsRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @overload test_iam_permissions(resource: nil, permissions: nil) - # Pass arguments to `test_iam_permissions` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param resource [::String] - # REQUIRED: The resource for which the policy detail is being requested. - # See the operation documentation for the appropriate value for this field. - # @param permissions [::Array<::String>] - # The set of permissions to check for the `resource`. Permissions with - # wildcards (such as '*' or 'storage.*') are not allowed. For more - # information see - # [IAM Overview](https://cloud.google.com/iam/docs/overview#permissions). - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Iam::V1::TestIamPermissionsResponse] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Iam::V1::TestIamPermissionsResponse] - # - # @raise [::Google::Cloud::Error] if the REST call is aborted. - # - # @example Basic example - # require "google/cloud/resource_manager/v3" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::ResourceManager::V3::TagValues::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Iam::V1::TestIamPermissionsRequest.new - # - # # Call the test_iam_permissions method. - # result = client.test_iam_permissions request - # - # # The returned object is of type Google::Iam::V1::TestIamPermissionsResponse. - # p result - # - def test_iam_permissions request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Iam::V1::TestIamPermissionsRequest - - # Converts hash and nil to an options object - options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h - - # Customize the options with defaults - call_metadata = @config.rpcs.test_iam_permissions.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::ResourceManager::V3::VERSION, - transports_version_send: [:rest] - - call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - options.apply_defaults timeout: @config.rpcs.test_iam_permissions.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.test_iam_permissions.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @tag_values_stub.test_iam_permissions request, options do |result, operation| - yield result, operation if block_given? - end - rescue ::Gapic::Rest::Error => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Configuration class for the TagValues REST API. - # - # This class represents the configuration for TagValues REST, - # providing control over timeouts, retry behavior, logging, transport - # parameters, and other low-level controls. Certain parameters can also be - # applied individually to specific RPCs. See - # {::Google::Cloud::ResourceManager::V3::TagValues::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_tag_values to 20 seconds, - # # and all remaining timeouts to 10 seconds. - # ::Google::Cloud::ResourceManager::V3::TagValues::Rest::Client.configure do |config| - # config.timeout = 10.0 - # config.rpcs.list_tag_values.timeout = 20.0 - # end - # - # # Apply the above configuration only to a new client. - # client = ::Google::Cloud::ResourceManager::V3::TagValues::Rest::Client.new do |config| - # config.timeout = 10.0 - # config.rpcs.list_tag_values.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 = "cloudresourcemanager.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 TagValues 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_tag_values` - # @return [::Gapic::Config::Method] - # - attr_reader :list_tag_values - ## - # RPC-specific configuration for `get_tag_value` - # @return [::Gapic::Config::Method] - # - attr_reader :get_tag_value - ## - # RPC-specific configuration for `get_namespaced_tag_value` - # @return [::Gapic::Config::Method] - # - attr_reader :get_namespaced_tag_value - ## - # RPC-specific configuration for `create_tag_value` - # @return [::Gapic::Config::Method] - # - attr_reader :create_tag_value - ## - # RPC-specific configuration for `update_tag_value` - # @return [::Gapic::Config::Method] - # - attr_reader :update_tag_value - ## - # RPC-specific configuration for `delete_tag_value` - # @return [::Gapic::Config::Method] - # - attr_reader :delete_tag_value - ## - # RPC-specific configuration for `get_iam_policy` - # @return [::Gapic::Config::Method] - # - attr_reader :get_iam_policy - ## - # RPC-specific configuration for `set_iam_policy` - # @return [::Gapic::Config::Method] - # - attr_reader :set_iam_policy - ## - # RPC-specific configuration for `test_iam_permissions` - # @return [::Gapic::Config::Method] - # - attr_reader :test_iam_permissions - - # @private - def initialize parent_rpcs = nil - list_tag_values_config = parent_rpcs.list_tag_values if parent_rpcs.respond_to? :list_tag_values - @list_tag_values = ::Gapic::Config::Method.new list_tag_values_config - get_tag_value_config = parent_rpcs.get_tag_value if parent_rpcs.respond_to? :get_tag_value - @get_tag_value = ::Gapic::Config::Method.new get_tag_value_config - get_namespaced_tag_value_config = parent_rpcs.get_namespaced_tag_value if parent_rpcs.respond_to? :get_namespaced_tag_value - @get_namespaced_tag_value = ::Gapic::Config::Method.new get_namespaced_tag_value_config - create_tag_value_config = parent_rpcs.create_tag_value if parent_rpcs.respond_to? :create_tag_value - @create_tag_value = ::Gapic::Config::Method.new create_tag_value_config - update_tag_value_config = parent_rpcs.update_tag_value if parent_rpcs.respond_to? :update_tag_value - @update_tag_value = ::Gapic::Config::Method.new update_tag_value_config - delete_tag_value_config = parent_rpcs.delete_tag_value if parent_rpcs.respond_to? :delete_tag_value - @delete_tag_value = ::Gapic::Config::Method.new delete_tag_value_config - get_iam_policy_config = parent_rpcs.get_iam_policy if parent_rpcs.respond_to? :get_iam_policy - @get_iam_policy = ::Gapic::Config::Method.new get_iam_policy_config - set_iam_policy_config = parent_rpcs.set_iam_policy if parent_rpcs.respond_to? :set_iam_policy - @set_iam_policy = ::Gapic::Config::Method.new set_iam_policy_config - test_iam_permissions_config = parent_rpcs.test_iam_permissions if parent_rpcs.respond_to? :test_iam_permissions - @test_iam_permissions = ::Gapic::Config::Method.new test_iam_permissions_config - - yield self if block_given? - end - end - end - end - end - end - end - end - end -end diff --git a/owl-bot-staging/google-cloud-resource_manager-v3/lib/google/cloud/resource_manager/v3/tag_values/rest/operations.rb b/owl-bot-staging/google-cloud-resource_manager-v3/lib/google/cloud/resource_manager/v3/tag_values/rest/operations.rb deleted file mode 100644 index f27a3d939b2c..000000000000 --- a/owl-bot-staging/google-cloud-resource_manager-v3/lib/google/cloud/resource_manager/v3/tag_values/rest/operations.rb +++ /dev/null @@ -1,925 +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 Cloud - module ResourceManager - module V3 - module TagValues - module Rest - # Service that implements Longrunning Operations API. - class Operations - # @private - API_VERSION = "" - - # @private - DEFAULT_ENDPOINT_TEMPLATE = "cloudresourcemanager.$UNIVERSE_DOMAIN$" - - # @private - attr_reader :operations_stub - - ## - # Configuration for the TagValues 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 TagValues 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::ResourceManager::V3::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::ResourceManager::V3::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::ResourceManager::V3::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::ResourceManager::V3::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 = "cloudresourcemanager.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: "/v3/{name}", - matches: [ - ["name", %r{^operations(?:/.*)?$}, true] - ] - ) - 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 -end diff --git a/owl-bot-staging/google-cloud-resource_manager-v3/lib/google/cloud/resource_manager/v3/tag_values/rest/service_stub.rb b/owl-bot-staging/google-cloud-resource_manager-v3/lib/google/cloud/resource_manager/v3/tag_values/rest/service_stub.rb deleted file mode 100644 index 85d0829d0e89..000000000000 --- a/owl-bot-staging/google-cloud-resource_manager-v3/lib/google/cloud/resource_manager/v3/tag_values/rest/service_stub.rb +++ /dev/null @@ -1,629 +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/resourcemanager/v3/tag_values_pb" - -module Google - module Cloud - module ResourceManager - module V3 - module TagValues - module Rest - ## - # REST service stub for the TagValues service. - # Service stub contains baseline method implementations - # including transcoding, making the REST call, and deserialing the response. - # - class ServiceStub - # @private - def initialize endpoint:, endpoint_template:, universe_domain:, credentials:, logger: - # These require statements are intentionally placed here to initialize - # the REST modules only when it's required. - require "gapic/rest" - - @client_stub = ::Gapic::Rest::ClientStub.new endpoint: endpoint, - endpoint_template: endpoint_template, - universe_domain: universe_domain, - credentials: credentials, - numeric_enums: true, - service_name: self.class, - raise_faraday_errors: false, - logger: logger - end - - ## - # The effective universe domain - # - # @return [String] - # - def universe_domain - @client_stub.universe_domain - end - - ## - # The effective endpoint - # - # @return [String] - # - def endpoint - @client_stub.endpoint - end - - ## - # The logger used for request/response debug logging. - # - # @return [Logger] - # - def logger stub: false - stub ? @client_stub.stub_logger : @client_stub.logger - end - - ## - # Baseline implementation for the list_tag_values REST call - # - # @param request_pb [::Google::Cloud::ResourceManager::V3::ListTagValuesRequest] - # A request object representing the call parameters. Required. - # @param options [::Gapic::CallOptions] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Cloud::ResourceManager::V3::ListTagValuesResponse] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::ResourceManager::V3::ListTagValuesResponse] - # A result object deserialized from the server's reply - def list_tag_values request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_list_tag_values_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_tag_values", - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Cloud::ResourceManager::V3::ListTagValuesResponse.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_tag_value REST call - # - # @param request_pb [::Google::Cloud::ResourceManager::V3::GetTagValueRequest] - # A request object representing the call parameters. Required. - # @param options [::Gapic::CallOptions] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Cloud::ResourceManager::V3::TagValue] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::ResourceManager::V3::TagValue] - # A result object deserialized from the server's reply - def get_tag_value request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_get_tag_value_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_tag_value", - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Cloud::ResourceManager::V3::TagValue.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_namespaced_tag_value REST call - # - # @param request_pb [::Google::Cloud::ResourceManager::V3::GetNamespacedTagValueRequest] - # A request object representing the call parameters. Required. - # @param options [::Gapic::CallOptions] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Cloud::ResourceManager::V3::TagValue] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::ResourceManager::V3::TagValue] - # A result object deserialized from the server's reply - def get_namespaced_tag_value request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_get_namespaced_tag_value_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_namespaced_tag_value", - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Cloud::ResourceManager::V3::TagValue.decode_json response.body, ignore_unknown_fields: true - catch :response do - yield result, operation if block_given? - result - end - end - - ## - # Baseline implementation for the create_tag_value REST call - # - # @param request_pb [::Google::Cloud::ResourceManager::V3::CreateTagValueRequest] - # 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_tag_value request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_create_tag_value_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_tag_value", - 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 update_tag_value REST call - # - # @param request_pb [::Google::Cloud::ResourceManager::V3::UpdateTagValueRequest] - # 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_tag_value request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_update_tag_value_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_tag_value", - 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_tag_value REST call - # - # @param request_pb [::Google::Cloud::ResourceManager::V3::DeleteTagValueRequest] - # 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_tag_value request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_delete_tag_value_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_tag_value", - 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_iam_policy REST call - # - # @param request_pb [::Google::Iam::V1::GetIamPolicyRequest] - # A request object representing the call parameters. Required. - # @param options [::Gapic::CallOptions] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Iam::V1::Policy] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Iam::V1::Policy] - # A result object deserialized from the server's reply - def get_iam_policy request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_get_iam_policy_request request_pb - query_string_params = if query_string_params.any? - query_string_params.to_h { |p| p.split "=", 2 } - else - {} - end - - response = @client_stub.make_http_request( - verb, - uri: uri, - body: body || "", - params: query_string_params, - method_name: "get_iam_policy", - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Iam::V1::Policy.decode_json response.body, ignore_unknown_fields: true - catch :response do - yield result, operation if block_given? - result - end - end - - ## - # Baseline implementation for the set_iam_policy REST call - # - # @param request_pb [::Google::Iam::V1::SetIamPolicyRequest] - # A request object representing the call parameters. Required. - # @param options [::Gapic::CallOptions] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Iam::V1::Policy] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Iam::V1::Policy] - # A result object deserialized from the server's reply - def set_iam_policy request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_set_iam_policy_request request_pb - query_string_params = if query_string_params.any? - query_string_params.to_h { |p| p.split "=", 2 } - else - {} - end - - response = @client_stub.make_http_request( - verb, - uri: uri, - body: body || "", - params: query_string_params, - method_name: "set_iam_policy", - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Iam::V1::Policy.decode_json response.body, ignore_unknown_fields: true - catch :response do - yield result, operation if block_given? - result - end - end - - ## - # Baseline implementation for the test_iam_permissions REST call - # - # @param request_pb [::Google::Iam::V1::TestIamPermissionsRequest] - # A request object representing the call parameters. Required. - # @param options [::Gapic::CallOptions] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Iam::V1::TestIamPermissionsResponse] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Iam::V1::TestIamPermissionsResponse] - # A result object deserialized from the server's reply - def test_iam_permissions request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_test_iam_permissions_request request_pb - query_string_params = if query_string_params.any? - query_string_params.to_h { |p| p.split "=", 2 } - else - {} - end - - response = @client_stub.make_http_request( - verb, - uri: uri, - body: body || "", - params: query_string_params, - method_name: "test_iam_permissions", - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Iam::V1::TestIamPermissionsResponse.decode_json response.body, ignore_unknown_fields: true - catch :response do - yield result, operation if block_given? - result - end - end - - ## - # @private - # - # GRPC transcoding helper method for the list_tag_values REST call - # - # @param request_pb [::Google::Cloud::ResourceManager::V3::ListTagValuesRequest] - # 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_tag_values_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :get, - uri_template: "/v3/tagValues", - matches: [] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the get_tag_value REST call - # - # @param request_pb [::Google::Cloud::ResourceManager::V3::GetTagValueRequest] - # 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_tag_value_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :get, - uri_template: "/v3/{name}", - matches: [ - ["name", %r{^tagValues/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the get_namespaced_tag_value REST call - # - # @param request_pb [::Google::Cloud::ResourceManager::V3::GetNamespacedTagValueRequest] - # 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_namespaced_tag_value_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :get, - uri_template: "/v3/tagValues/namespaced", - matches: [] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the create_tag_value REST call - # - # @param request_pb [::Google::Cloud::ResourceManager::V3::CreateTagValueRequest] - # 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_tag_value_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :post, - uri_template: "/v3/tagValues", - body: "tag_value", - matches: [] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the update_tag_value REST call - # - # @param request_pb [::Google::Cloud::ResourceManager::V3::UpdateTagValueRequest] - # 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_tag_value_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :patch, - uri_template: "/v3/{tag_value.name}", - body: "tag_value", - matches: [ - ["tag_value.name", %r{^tagValues/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the delete_tag_value REST call - # - # @param request_pb [::Google::Cloud::ResourceManager::V3::DeleteTagValueRequest] - # 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_tag_value_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :delete, - uri_template: "/v3/{name}", - matches: [ - ["name", %r{^tagValues/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the get_iam_policy REST call - # - # @param request_pb [::Google::Iam::V1::GetIamPolicyRequest] - # A request object representing the call parameters. Required. - # @return [Array(String, [String, nil], Hash{String => String})] - # Uri, Body, Query string parameters - def self.transcode_get_iam_policy_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :post, - uri_template: "/v3/{resource}:getIamPolicy", - body: "*", - matches: [ - ["resource", %r{^tagValues/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the set_iam_policy REST call - # - # @param request_pb [::Google::Iam::V1::SetIamPolicyRequest] - # A request object representing the call parameters. Required. - # @return [Array(String, [String, nil], Hash{String => String})] - # Uri, Body, Query string parameters - def self.transcode_set_iam_policy_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :post, - uri_template: "/v3/{resource}:setIamPolicy", - body: "*", - matches: [ - ["resource", %r{^tagValues/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the test_iam_permissions REST call - # - # @param request_pb [::Google::Iam::V1::TestIamPermissionsRequest] - # A request object representing the call parameters. Required. - # @return [Array(String, [String, nil], Hash{String => String})] - # Uri, Body, Query string parameters - def self.transcode_test_iam_permissions_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :post, - uri_template: "/v3/{resource}:testIamPermissions", - body: "*", - matches: [ - ["resource", %r{^tagValues/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - end - end - end - end - end - end -end diff --git a/owl-bot-staging/google-cloud-resource_manager-v3/lib/google/cloud/resource_manager/v3/version.rb b/owl-bot-staging/google-cloud-resource_manager-v3/lib/google/cloud/resource_manager/v3/version.rb deleted file mode 100644 index bf45ffb960b0..000000000000 --- a/owl-bot-staging/google-cloud-resource_manager-v3/lib/google/cloud/resource_manager/v3/version.rb +++ /dev/null @@ -1,28 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - - -module Google - module Cloud - module ResourceManager - module V3 - VERSION = "0.0.1" - end - end - end -end diff --git a/owl-bot-staging/google-cloud-resource_manager-v3/lib/google/cloud/resourcemanager/v3/folders_pb.rb b/owl-bot-staging/google-cloud-resource_manager-v3/lib/google/cloud/resourcemanager/v3/folders_pb.rb deleted file mode 100644 index b7e70d4e8069..000000000000 --- a/owl-bot-staging/google-cloud-resource_manager-v3/lib/google/cloud/resourcemanager/v3/folders_pb.rb +++ /dev/null @@ -1,47 +0,0 @@ -# frozen_string_literal: true -# Generated by the protocol buffer compiler. DO NOT EDIT! -# source: google/cloud/resourcemanager/v3/folders.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/v1/iam_policy_pb' -require 'google/iam/v1/policy_pb' -require 'google/longrunning/operations_pb' -require 'google/protobuf/field_mask_pb' -require 'google/protobuf/timestamp_pb' - - -descriptor_data = "\n-google/cloud/resourcemanager/v3/folders.proto\x12\x1fgoogle.cloud.resourcemanager.v3\x1a\x1cgoogle/api/annotations.proto\x1a\x17google/api/client.proto\x1a\x1fgoogle/api/field_behavior.proto\x1a\x19google/api/resource.proto\x1a\x1egoogle/iam/v1/iam_policy.proto\x1a\x1agoogle/iam/v1/policy.proto\x1a#google/longrunning/operations.proto\x1a google/protobuf/field_mask.proto\x1a\x1fgoogle/protobuf/timestamp.proto\"\xc6\x03\n\x06\x46older\x12\x11\n\x04name\x18\x01 \x01(\tB\x03\xe0\x41\x03\x12\x13\n\x06parent\x18\x02 \x01(\tB\x03\xe0\x41\x02\x12\x14\n\x0c\x64isplay_name\x18\x03 \x01(\t\x12\x41\n\x05state\x18\x04 \x01(\x0e\x32-.google.cloud.resourcemanager.v3.Folder.StateB\x03\xe0\x41\x03\x12\x34\n\x0b\x63reate_time\x18\x05 \x01(\x0b\x32\x1a.google.protobuf.TimestampB\x03\xe0\x41\x03\x12\x34\n\x0bupdate_time\x18\x06 \x01(\x0b\x32\x1a.google.protobuf.TimestampB\x03\xe0\x41\x03\x12\x34\n\x0b\x64\x65lete_time\x18\x07 \x01(\x0b\x32\x1a.google.protobuf.TimestampB\x03\xe0\x41\x03\x12\x11\n\x04\x65tag\x18\x08 \x01(\tB\x03\xe0\x41\x03\"@\n\x05State\x12\x15\n\x11STATE_UNSPECIFIED\x10\x00\x12\n\n\x06\x41\x43TIVE\x10\x01\x12\x14\n\x10\x44\x45LETE_REQUESTED\x10\x02:D\xea\x41\x41\n*cloudresourcemanager.googleapis.com/Folder\x12\x10\x66olders/{folder}R\x01\x01\"T\n\x10GetFolderRequest\x12@\n\x04name\x18\x01 \x01(\tB2\xe0\x41\x02\xfa\x41,\n*cloudresourcemanager.googleapis.com/Folder\"{\n\x12ListFoldersRequest\x12\x19\n\x06parent\x18\x01 \x01(\tB\t\xe0\x41\x02\xfa\x41\x03\x12\x01*\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\x19\n\x0cshow_deleted\x18\x04 \x01(\x08\x42\x03\xe0\x41\x01\"h\n\x13ListFoldersResponse\x12\x38\n\x07\x66olders\x18\x01 \x03(\x0b\x32\'.google.cloud.resourcemanager.v3.Folder\x12\x17\n\x0fnext_page_token\x18\x02 \x01(\t\"[\n\x14SearchFoldersRequest\x12\x16\n\tpage_size\x18\x01 \x01(\x05\x42\x03\xe0\x41\x01\x12\x17\n\npage_token\x18\x02 \x01(\tB\x03\xe0\x41\x01\x12\x12\n\x05query\x18\x03 \x01(\tB\x03\xe0\x41\x01\"j\n\x15SearchFoldersResponse\x12\x38\n\x07\x66olders\x18\x01 \x03(\x0b\x32\'.google.cloud.resourcemanager.v3.Folder\x12\x17\n\x0fnext_page_token\x18\x02 \x01(\t\"S\n\x13\x43reateFolderRequest\x12<\n\x06\x66older\x18\x02 \x01(\x0b\x32\'.google.cloud.resourcemanager.v3.FolderB\x03\xe0\x41\x02\"<\n\x14\x43reateFolderMetadata\x12\x14\n\x0c\x64isplay_name\x18\x01 \x01(\t\x12\x0e\n\x06parent\x18\x02 \x01(\t\"\x89\x01\n\x13UpdateFolderRequest\x12<\n\x06\x66older\x18\x01 \x01(\x0b\x32\'.google.cloud.resourcemanager.v3.FolderB\x03\xe0\x41\x02\x12\x34\n\x0bupdate_mask\x18\x02 \x01(\x0b\x32\x1a.google.protobuf.FieldMaskB\x03\xe0\x41\x02\"\x16\n\x14UpdateFolderMetadata\"|\n\x11MoveFolderRequest\x12@\n\x04name\x18\x01 \x01(\tB2\xe0\x41\x02\xfa\x41,\n*cloudresourcemanager.googleapis.com/Folder\x12%\n\x12\x64\x65stination_parent\x18\x02 \x01(\tB\t\xe0\x41\x02\xfa\x41\x03\x12\x01*\"]\n\x12MoveFolderMetadata\x12\x14\n\x0c\x64isplay_name\x18\x01 \x01(\t\x12\x15\n\rsource_parent\x18\x02 \x01(\t\x12\x1a\n\x12\x64\x65stination_parent\x18\x03 \x01(\t\"W\n\x13\x44\x65leteFolderRequest\x12@\n\x04name\x18\x01 \x01(\tB2\xe0\x41\x02\xfa\x41,\n*cloudresourcemanager.googleapis.com/Folder\"\x16\n\x14\x44\x65leteFolderMetadata\"Y\n\x15UndeleteFolderRequest\x12@\n\x04name\x18\x01 \x01(\tB2\xe0\x41\x02\xfa\x41,\n*cloudresourcemanager.googleapis.com/Folder\"\x18\n\x16UndeleteFolderMetadata2\xde\x0f\n\x07\x46olders\x12\x8c\x01\n\tGetFolder\x12\x31.google.cloud.resourcemanager.v3.GetFolderRequest\x1a\'.google.cloud.resourcemanager.v3.Folder\"#\xda\x41\x04name\x82\xd3\xe4\x93\x02\x16\x12\x14/v3/{name=folders/*}\x12\x96\x01\n\x0bListFolders\x12\x33.google.cloud.resourcemanager.v3.ListFoldersRequest\x1a\x34.google.cloud.resourcemanager.v3.ListFoldersResponse\"\x1c\xda\x41\x06parent\x82\xd3\xe4\x93\x02\r\x12\x0b/v3/folders\x12\xa2\x01\n\rSearchFolders\x12\x35.google.cloud.resourcemanager.v3.SearchFoldersRequest\x1a\x36.google.cloud.resourcemanager.v3.SearchFoldersResponse\"\"\xda\x41\x05query\x82\xd3\xe4\x93\x02\x14\x12\x12/v3/folders:search\x12\xaa\x01\n\x0c\x43reateFolder\x12\x34.google.cloud.resourcemanager.v3.CreateFolderRequest\x1a\x1d.google.longrunning.Operation\"E\xca\x41\x1e\n\x06\x46older\x12\x14\x43reateFolderMetadata\xda\x41\x06\x66older\x82\xd3\xe4\x93\x02\x15\"\x0b/v3/folders:\x06\x66older\x12\xc6\x01\n\x0cUpdateFolder\x12\x34.google.cloud.resourcemanager.v3.UpdateFolderRequest\x1a\x1d.google.longrunning.Operation\"a\xca\x41\x1e\n\x06\x46older\x12\x14UpdateFolderMetadata\xda\x41\x12\x66older,update_mask\x82\xd3\xe4\x93\x02%2\x1b/v3/{folder.name=folders/*}:\x06\x66older\x12\xbe\x01\n\nMoveFolder\x12\x32.google.cloud.resourcemanager.v3.MoveFolderRequest\x1a\x1d.google.longrunning.Operation\"]\xca\x41\x1c\n\x06\x46older\x12\x12MoveFolderMetadata\xda\x41\x17name,destination_parent\x82\xd3\xe4\x93\x02\x1e\"\x19/v3/{name=folders/*}:move:\x01*\x12\xa9\x01\n\x0c\x44\x65leteFolder\x12\x34.google.cloud.resourcemanager.v3.DeleteFolderRequest\x1a\x1d.google.longrunning.Operation\"D\xca\x41\x1e\n\x06\x46older\x12\x14\x44\x65leteFolderMetadata\xda\x41\x04name\x82\xd3\xe4\x93\x02\x16*\x14/v3/{name=folders/*}\x12\xbb\x01\n\x0eUndeleteFolder\x12\x36.google.cloud.resourcemanager.v3.UndeleteFolderRequest\x1a\x1d.google.longrunning.Operation\"R\xca\x41 \n\x06\x46older\x12\x16UndeleteFolderMetadata\xda\x41\x04name\x82\xd3\xe4\x93\x02\"\"\x1d/v3/{name=folders/*}:undelete:\x01*\x12\x86\x01\n\x0cGetIamPolicy\x12\".google.iam.v1.GetIamPolicyRequest\x1a\x15.google.iam.v1.Policy\";\xda\x41\x08resource\x82\xd3\xe4\x93\x02*\"%/v3/{resource=folders/*}:getIamPolicy:\x01*\x12\x8d\x01\n\x0cSetIamPolicy\x12\".google.iam.v1.SetIamPolicyRequest\x1a\x15.google.iam.v1.Policy\"B\xda\x41\x0fresource,policy\x82\xd3\xe4\x93\x02*\"%/v3/{resource=folders/*}:setIamPolicy:\x01*\x12\xb8\x01\n\x12TestIamPermissions\x12(.google.iam.v1.TestIamPermissionsRequest\x1a).google.iam.v1.TestIamPermissionsResponse\"M\xda\x41\x14resource,permissions\x82\xd3\xe4\x93\x02\x30\"+/v3/{resource=folders/*}:testIamPermissions:\x01*\x1a\x90\x01\xca\x41#cloudresourcemanager.googleapis.com\xd2\x41ghttps://www.googleapis.com/auth/cloud-platform,https://www.googleapis.com/auth/cloud-platform.read-onlyB\xed\x01\n#com.google.cloud.resourcemanager.v3B\x0c\x46oldersProtoP\x01ZMcloud.google.com/go/resourcemanager/apiv3/resourcemanagerpb;resourcemanagerpb\xaa\x02\x1fGoogle.Cloud.ResourceManager.V3\xca\x02\x1fGoogle\\Cloud\\ResourceManager\\V3\xea\x02\"Google::Cloud::ResourceManager::V3b\x06proto3" - -pool = ::Google::Protobuf::DescriptorPool.generated_pool -pool.add_serialized_file(descriptor_data) - -module Google - module Cloud - module ResourceManager - module V3 - Folder = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.resourcemanager.v3.Folder").msgclass - Folder::State = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.resourcemanager.v3.Folder.State").enummodule - GetFolderRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.resourcemanager.v3.GetFolderRequest").msgclass - ListFoldersRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.resourcemanager.v3.ListFoldersRequest").msgclass - ListFoldersResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.resourcemanager.v3.ListFoldersResponse").msgclass - SearchFoldersRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.resourcemanager.v3.SearchFoldersRequest").msgclass - SearchFoldersResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.resourcemanager.v3.SearchFoldersResponse").msgclass - CreateFolderRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.resourcemanager.v3.CreateFolderRequest").msgclass - CreateFolderMetadata = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.resourcemanager.v3.CreateFolderMetadata").msgclass - UpdateFolderRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.resourcemanager.v3.UpdateFolderRequest").msgclass - UpdateFolderMetadata = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.resourcemanager.v3.UpdateFolderMetadata").msgclass - MoveFolderRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.resourcemanager.v3.MoveFolderRequest").msgclass - MoveFolderMetadata = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.resourcemanager.v3.MoveFolderMetadata").msgclass - DeleteFolderRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.resourcemanager.v3.DeleteFolderRequest").msgclass - DeleteFolderMetadata = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.resourcemanager.v3.DeleteFolderMetadata").msgclass - UndeleteFolderRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.resourcemanager.v3.UndeleteFolderRequest").msgclass - UndeleteFolderMetadata = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.resourcemanager.v3.UndeleteFolderMetadata").msgclass - end - end - end -end diff --git a/owl-bot-staging/google-cloud-resource_manager-v3/lib/google/cloud/resourcemanager/v3/folders_services_pb.rb b/owl-bot-staging/google-cloud-resource_manager-v3/lib/google/cloud/resourcemanager/v3/folders_services_pb.rb deleted file mode 100644 index fe0f94b58654..000000000000 --- a/owl-bot-staging/google-cloud-resource_manager-v3/lib/google/cloud/resourcemanager/v3/folders_services_pb.rb +++ /dev/null @@ -1,172 +0,0 @@ -# Generated by the protocol buffer compiler. DO NOT EDIT! -# Source: google/cloud/resourcemanager/v3/folders.proto for package 'Google.Cloud.ResourceManager.V3' -# Original file comments: -# 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 -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. -# - -require 'grpc' -require 'google/cloud/resourcemanager/v3/folders_pb' - -module Google - module Cloud - module ResourceManager - module V3 - module Folders - # Manages Cloud Platform folder resources. - # Folders can be used to organize the resources under an - # organization and to control the policies applied to groups of resources. - class Service - - include ::GRPC::GenericService - - self.marshal_class_method = :encode - self.unmarshal_class_method = :decode - self.service_name = 'google.cloud.resourcemanager.v3.Folders' - - # Retrieves a folder identified by the supplied resource name. - # Valid folder resource names have the format `folders/{folder_id}` - # (for example, `folders/1234`). - # The caller must have `resourcemanager.folders.get` permission on the - # identified folder. - rpc :GetFolder, ::Google::Cloud::ResourceManager::V3::GetFolderRequest, ::Google::Cloud::ResourceManager::V3::Folder - # Lists the folders that are direct descendants of supplied parent resource. - # `list()` provides a strongly consistent view of the folders underneath - # the specified parent resource. - # `list()` returns folders sorted based upon the (ascending) lexical ordering - # of their display_name. - # The caller must have `resourcemanager.folders.list` permission on the - # identified parent. - rpc :ListFolders, ::Google::Cloud::ResourceManager::V3::ListFoldersRequest, ::Google::Cloud::ResourceManager::V3::ListFoldersResponse - # Search for folders that match specific filter criteria. - # `search()` provides an eventually consistent view of the folders a user has - # access to which meet the specified filter criteria. - # - # This will only return folders on which the caller has the - # permission `resourcemanager.folders.get`. - rpc :SearchFolders, ::Google::Cloud::ResourceManager::V3::SearchFoldersRequest, ::Google::Cloud::ResourceManager::V3::SearchFoldersResponse - # Creates a folder in the resource hierarchy. - # Returns an `Operation` which can be used to track the progress of the - # folder creation workflow. - # Upon success, the `Operation.response` field will be populated with the - # created Folder. - # - # In order to succeed, the addition of this new folder must not violate - # the folder naming, height, or fanout constraints. - # - # + The folder's `display_name` must be distinct from all other folders that - # share its parent. - # + The addition of the folder must not cause the active folder hierarchy - # to exceed a height of 10. Note, the full active + deleted folder hierarchy - # is allowed to reach a height of 20; this provides additional headroom when - # moving folders that contain deleted folders. - # + The addition of the folder must not cause the total number of folders - # under its parent to exceed 300. - # - # If the operation fails due to a folder constraint violation, some errors - # may be returned by the `CreateFolder` request, with status code - # `FAILED_PRECONDITION` and an error description. Other folder constraint - # violations will be communicated in the `Operation`, with the specific - # `PreconditionFailure` returned in the details list in the `Operation.error` - # field. - # - # The caller must have `resourcemanager.folders.create` permission on the - # identified parent. - rpc :CreateFolder, ::Google::Cloud::ResourceManager::V3::CreateFolderRequest, ::Google::Longrunning::Operation - # Updates a folder, changing its `display_name`. - # Changes to the folder `display_name` will be rejected if they violate - # either the `display_name` formatting rules or the naming constraints - # described in the - # [CreateFolder][google.cloud.resourcemanager.v3.Folders.CreateFolder] - # documentation. - # - # The folder's `display_name` must start and end with a letter or digit, - # may contain letters, digits, spaces, hyphens and underscores and can be - # between 3 and 30 characters. This is captured by the regular expression: - # `[\p{L}\p{N}][\p{L}\p{N}_- ]{1,28}[\p{L}\p{N}]`. - # The caller must have `resourcemanager.folders.update` permission on the - # identified folder. - # - # If the update fails due to the unique name constraint then a - # `PreconditionFailure` explaining this violation will be returned - # in the Status.details field. - rpc :UpdateFolder, ::Google::Cloud::ResourceManager::V3::UpdateFolderRequest, ::Google::Longrunning::Operation - # Moves a folder under a new resource parent. - # Returns an `Operation` which can be used to track the progress of the - # folder move workflow. - # Upon success, the `Operation.response` field will be populated with the - # moved folder. - # Upon failure, a `FolderOperationError` categorizing the failure cause will - # be returned - if the failure occurs synchronously then the - # `FolderOperationError` will be returned in the `Status.details` field. - # If it occurs asynchronously, then the FolderOperation will be returned - # in the `Operation.error` field. - # In addition, the `Operation.metadata` field will be populated with a - # `FolderOperation` message as an aid to stateless clients. - # Folder moves will be rejected if they violate either the naming, height, - # or fanout constraints described in the - # [CreateFolder][google.cloud.resourcemanager.v3.Folders.CreateFolder] - # documentation. The caller must have `resourcemanager.folders.move` - # permission on the folder's current and proposed new parent. - rpc :MoveFolder, ::Google::Cloud::ResourceManager::V3::MoveFolderRequest, ::Google::Longrunning::Operation - # Requests deletion of a folder. The folder is moved into the - # [DELETE_REQUESTED][google.cloud.resourcemanager.v3.Folder.State.DELETE_REQUESTED] - # state immediately, and is deleted approximately 30 days later. This method - # may only be called on an empty folder, where a folder is empty if it - # doesn't contain any folders or projects in the - # [ACTIVE][google.cloud.resourcemanager.v3.Folder.State.ACTIVE] state. If - # called on a folder in - # [DELETE_REQUESTED][google.cloud.resourcemanager.v3.Folder.State.DELETE_REQUESTED] - # state the operation will result in a no-op success. - # The caller must have `resourcemanager.folders.delete` permission on the - # identified folder. - rpc :DeleteFolder, ::Google::Cloud::ResourceManager::V3::DeleteFolderRequest, ::Google::Longrunning::Operation - # Cancels the deletion request for a folder. This method may be called on a - # folder in any state. If the folder is in the - # [ACTIVE][google.cloud.resourcemanager.v3.Folder.State.ACTIVE] state the - # result will be a no-op success. In order to succeed, the folder's parent - # must be in the - # [ACTIVE][google.cloud.resourcemanager.v3.Folder.State.ACTIVE] state. In - # addition, reintroducing the folder into the tree must not violate folder - # naming, height, and fanout constraints described in the - # [CreateFolder][google.cloud.resourcemanager.v3.Folders.CreateFolder] - # documentation. The caller must have `resourcemanager.folders.undelete` - # permission on the identified folder. - rpc :UndeleteFolder, ::Google::Cloud::ResourceManager::V3::UndeleteFolderRequest, ::Google::Longrunning::Operation - # Gets the access control policy for a folder. The returned policy may be - # empty if no such policy or resource exists. The `resource` field should - # be the folder's resource name, for example: "folders/1234". - # The caller must have `resourcemanager.folders.getIamPolicy` permission - # on the identified folder. - rpc :GetIamPolicy, ::Google::Iam::V1::GetIamPolicyRequest, ::Google::Iam::V1::Policy - # Sets the access control policy on a folder, replacing any existing policy. - # The `resource` field should be the folder's resource name, for example: - # "folders/1234". - # The caller must have `resourcemanager.folders.setIamPolicy` permission - # on the identified folder. - rpc :SetIamPolicy, ::Google::Iam::V1::SetIamPolicyRequest, ::Google::Iam::V1::Policy - # Returns permissions that a caller has on the specified folder. - # The `resource` field should be the folder's resource name, - # for example: "folders/1234". - # - # There are no permissions required for making this API call. - rpc :TestIamPermissions, ::Google::Iam::V1::TestIamPermissionsRequest, ::Google::Iam::V1::TestIamPermissionsResponse - end - - Stub = Service.rpc_stub_class - end - end - end - end -end diff --git a/owl-bot-staging/google-cloud-resource_manager-v3/lib/google/cloud/resourcemanager/v3/organizations_pb.rb b/owl-bot-staging/google-cloud-resource_manager-v3/lib/google/cloud/resourcemanager/v3/organizations_pb.rb deleted file mode 100644 index 7c469455103e..000000000000 --- a/owl-bot-staging/google-cloud-resource_manager-v3/lib/google/cloud/resourcemanager/v3/organizations_pb.rb +++ /dev/null @@ -1,35 +0,0 @@ -# frozen_string_literal: true -# Generated by the protocol buffer compiler. DO NOT EDIT! -# source: google/cloud/resourcemanager/v3/organizations.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/v1/iam_policy_pb' -require 'google/iam/v1/policy_pb' -require 'google/protobuf/timestamp_pb' - - -descriptor_data = "\n3google/cloud/resourcemanager/v3/organizations.proto\x12\x1fgoogle.cloud.resourcemanager.v3\x1a\x1cgoogle/api/annotations.proto\x1a\x17google/api/client.proto\x1a\x1fgoogle/api/field_behavior.proto\x1a\x19google/api/resource.proto\x1a\x1egoogle/iam/v1/iam_policy.proto\x1a\x1agoogle/iam/v1/policy.proto\x1a\x1fgoogle/protobuf/timestamp.proto\"\x83\x04\n\x0cOrganization\x12\x11\n\x04name\x18\x01 \x01(\tB\x03\xe0\x41\x03\x12\x19\n\x0c\x64isplay_name\x18\x02 \x01(\tB\x03\xe0\x41\x03\x12$\n\x15\x64irectory_customer_id\x18\x03 \x01(\tB\x03\xe0\x41\x05H\x00\x12G\n\x05state\x18\x04 \x01(\x0e\x32\x33.google.cloud.resourcemanager.v3.Organization.StateB\x03\xe0\x41\x03\x12\x34\n\x0b\x63reate_time\x18\x05 \x01(\x0b\x32\x1a.google.protobuf.TimestampB\x03\xe0\x41\x03\x12\x34\n\x0bupdate_time\x18\x06 \x01(\x0b\x32\x1a.google.protobuf.TimestampB\x03\xe0\x41\x03\x12\x34\n\x0b\x64\x65lete_time\x18\x07 \x01(\x0b\x32\x1a.google.protobuf.TimestampB\x03\xe0\x41\x03\x12\x11\n\x04\x65tag\x18\x08 \x01(\tB\x03\xe0\x41\x03\"@\n\x05State\x12\x15\n\x11STATE_UNSPECIFIED\x10\x00\x12\n\n\x06\x41\x43TIVE\x10\x01\x12\x14\n\x10\x44\x45LETE_REQUESTED\x10\x02:V\xea\x41S\n0cloudresourcemanager.googleapis.com/Organization\x12\x1corganizations/{organization}R\x01\x01\x42\x07\n\x05owner\"`\n\x16GetOrganizationRequest\x12\x46\n\x04name\x18\x01 \x01(\tB8\xe0\x41\x02\xfa\x41\x32\n0cloudresourcemanager.googleapis.com/Organization\"a\n\x1aSearchOrganizationsRequest\x12\x16\n\tpage_size\x18\x01 \x01(\x05\x42\x03\xe0\x41\x01\x12\x17\n\npage_token\x18\x02 \x01(\tB\x03\xe0\x41\x01\x12\x12\n\x05query\x18\x03 \x01(\tB\x03\xe0\x41\x01\"|\n\x1bSearchOrganizationsResponse\x12\x44\n\rorganizations\x18\x01 \x03(\x0b\x32-.google.cloud.resourcemanager.v3.Organization\x12\x17\n\x0fnext_page_token\x18\x02 \x01(\t\"\x1c\n\x1a\x44\x65leteOrganizationMetadata\"\x1e\n\x1cUndeleteOrganizationMetadata2\xe5\x07\n\rOrganizations\x12\xa4\x01\n\x0fGetOrganization\x12\x37.google.cloud.resourcemanager.v3.GetOrganizationRequest\x1a-.google.cloud.resourcemanager.v3.Organization\")\xda\x41\x04name\x82\xd3\xe4\x93\x02\x1c\x12\x1a/v3/{name=organizations/*}\x12\xba\x01\n\x13SearchOrganizations\x12;.google.cloud.resourcemanager.v3.SearchOrganizationsRequest\x1a<.google.cloud.resourcemanager.v3.SearchOrganizationsResponse\"(\xda\x41\x05query\x82\xd3\xe4\x93\x02\x1a\x12\x18/v3/organizations:search\x12\x8c\x01\n\x0cGetIamPolicy\x12\".google.iam.v1.GetIamPolicyRequest\x1a\x15.google.iam.v1.Policy\"A\xda\x41\x08resource\x82\xd3\xe4\x93\x02\x30\"+/v3/{resource=organizations/*}:getIamPolicy:\x01*\x12\x8c\x01\n\x0cSetIamPolicy\x12\".google.iam.v1.SetIamPolicyRequest\x1a\x15.google.iam.v1.Policy\"A\xda\x41\x08resource\x82\xd3\xe4\x93\x02\x30\"+/v3/{resource=organizations/*}:setIamPolicy:\x01*\x12\xbe\x01\n\x12TestIamPermissions\x12(.google.iam.v1.TestIamPermissionsRequest\x1a).google.iam.v1.TestIamPermissionsResponse\"S\xda\x41\x14resource,permissions\x82\xd3\xe4\x93\x02\x36\"1/v3/{resource=organizations/*}:testIamPermissions:\x01*\x1a\x90\x01\xca\x41#cloudresourcemanager.googleapis.com\xd2\x41ghttps://www.googleapis.com/auth/cloud-platform,https://www.googleapis.com/auth/cloud-platform.read-onlyB\xf3\x01\n#com.google.cloud.resourcemanager.v3B\x12OrganizationsProtoP\x01ZMcloud.google.com/go/resourcemanager/apiv3/resourcemanagerpb;resourcemanagerpb\xaa\x02\x1fGoogle.Cloud.ResourceManager.V3\xca\x02\x1fGoogle\\Cloud\\ResourceManager\\V3\xea\x02\"Google::Cloud::ResourceManager::V3b\x06proto3" - -pool = ::Google::Protobuf::DescriptorPool.generated_pool -pool.add_serialized_file(descriptor_data) - -module Google - module Cloud - module ResourceManager - module V3 - Organization = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.resourcemanager.v3.Organization").msgclass - Organization::State = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.resourcemanager.v3.Organization.State").enummodule - GetOrganizationRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.resourcemanager.v3.GetOrganizationRequest").msgclass - SearchOrganizationsRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.resourcemanager.v3.SearchOrganizationsRequest").msgclass - SearchOrganizationsResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.resourcemanager.v3.SearchOrganizationsResponse").msgclass - DeleteOrganizationMetadata = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.resourcemanager.v3.DeleteOrganizationMetadata").msgclass - UndeleteOrganizationMetadata = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.resourcemanager.v3.UndeleteOrganizationMetadata").msgclass - end - end - end -end diff --git a/owl-bot-staging/google-cloud-resource_manager-v3/lib/google/cloud/resourcemanager/v3/organizations_services_pb.rb b/owl-bot-staging/google-cloud-resource_manager-v3/lib/google/cloud/resourcemanager/v3/organizations_services_pb.rb deleted file mode 100644 index 815d51c587a5..000000000000 --- a/owl-bot-staging/google-cloud-resource_manager-v3/lib/google/cloud/resourcemanager/v3/organizations_services_pb.rb +++ /dev/null @@ -1,73 +0,0 @@ -# Generated by the protocol buffer compiler. DO NOT EDIT! -# Source: google/cloud/resourcemanager/v3/organizations.proto for package 'Google.Cloud.ResourceManager.V3' -# Original file comments: -# 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 -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. -# - -require 'grpc' -require 'google/cloud/resourcemanager/v3/organizations_pb' - -module Google - module Cloud - module ResourceManager - module V3 - module Organizations - # Allows users to manage their organization resources. - class Service - - include ::GRPC::GenericService - - self.marshal_class_method = :encode - self.unmarshal_class_method = :decode - self.service_name = 'google.cloud.resourcemanager.v3.Organizations' - - # Fetches an organization resource identified by the specified resource name. - rpc :GetOrganization, ::Google::Cloud::ResourceManager::V3::GetOrganizationRequest, ::Google::Cloud::ResourceManager::V3::Organization - # Searches organization resources that are visible to the user and satisfy - # the specified filter. This method returns organizations in an unspecified - # order. New organizations do not necessarily appear at the end of the - # results, and may take a small amount of time to appear. - # - # Search will only return organizations on which the user has the permission - # `resourcemanager.organizations.get` - rpc :SearchOrganizations, ::Google::Cloud::ResourceManager::V3::SearchOrganizationsRequest, ::Google::Cloud::ResourceManager::V3::SearchOrganizationsResponse - # Gets the access control policy for an organization resource. The policy may - # be empty if no such policy or resource exists. The `resource` field should - # be the organization's resource name, for example: "organizations/123". - # - # Authorization requires the IAM permission - # `resourcemanager.organizations.getIamPolicy` on the specified organization. - rpc :GetIamPolicy, ::Google::Iam::V1::GetIamPolicyRequest, ::Google::Iam::V1::Policy - # Sets the access control policy on an organization resource. Replaces any - # existing policy. The `resource` field should be the organization's resource - # name, for example: "organizations/123". - # - # Authorization requires the IAM permission - # `resourcemanager.organizations.setIamPolicy` on the specified organization. - rpc :SetIamPolicy, ::Google::Iam::V1::SetIamPolicyRequest, ::Google::Iam::V1::Policy - # Returns the permissions that a caller has on the specified organization. - # The `resource` field should be the organization's resource name, - # for example: "organizations/123". - # - # There are no permissions required for making this API call. - rpc :TestIamPermissions, ::Google::Iam::V1::TestIamPermissionsRequest, ::Google::Iam::V1::TestIamPermissionsResponse - end - - Stub = Service.rpc_stub_class - end - end - end - end -end diff --git a/owl-bot-staging/google-cloud-resource_manager-v3/lib/google/cloud/resourcemanager/v3/projects_pb.rb b/owl-bot-staging/google-cloud-resource_manager-v3/lib/google/cloud/resourcemanager/v3/projects_pb.rb deleted file mode 100644 index beb22f43c8d7..000000000000 --- a/owl-bot-staging/google-cloud-resource_manager-v3/lib/google/cloud/resourcemanager/v3/projects_pb.rb +++ /dev/null @@ -1,47 +0,0 @@ -# frozen_string_literal: true -# Generated by the protocol buffer compiler. DO NOT EDIT! -# source: google/cloud/resourcemanager/v3/projects.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/v1/iam_policy_pb' -require 'google/iam/v1/policy_pb' -require 'google/longrunning/operations_pb' -require 'google/protobuf/field_mask_pb' -require 'google/protobuf/timestamp_pb' - - -descriptor_data = "\n.google/cloud/resourcemanager/v3/projects.proto\x12\x1fgoogle.cloud.resourcemanager.v3\x1a\x1cgoogle/api/annotations.proto\x1a\x17google/api/client.proto\x1a\x1fgoogle/api/field_behavior.proto\x1a\x19google/api/resource.proto\x1a\x1egoogle/iam/v1/iam_policy.proto\x1a\x1agoogle/iam/v1/policy.proto\x1a#google/longrunning/operations.proto\x1a google/protobuf/field_mask.proto\x1a\x1fgoogle/protobuf/timestamp.proto\"\xe3\x04\n\x07Project\x12\x11\n\x04name\x18\x01 \x01(\tB\x03\xe0\x41\x03\x12\x13\n\x06parent\x18\x02 \x01(\tB\x03\xe0\x41\x01\x12\x17\n\nproject_id\x18\x03 \x01(\tB\x03\xe0\x41\x05\x12\x42\n\x05state\x18\x04 \x01(\x0e\x32..google.cloud.resourcemanager.v3.Project.StateB\x03\xe0\x41\x03\x12\x19\n\x0c\x64isplay_name\x18\x05 \x01(\tB\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\x34\n\x0b\x64\x65lete_time\x18\x08 \x01(\x0b\x32\x1a.google.protobuf.TimestampB\x03\xe0\x41\x03\x12\x11\n\x04\x65tag\x18\t \x01(\tB\x03\xe0\x41\x03\x12I\n\x06labels\x18\n \x03(\x0b\x32\x34.google.cloud.resourcemanager.v3.Project.LabelsEntryB\x03\xe0\x41\x01\x1a-\n\x0bLabelsEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12\r\n\x05value\x18\x02 \x01(\t:\x02\x38\x01\"@\n\x05State\x12\x15\n\x11STATE_UNSPECIFIED\x10\x00\x12\n\n\x06\x41\x43TIVE\x10\x01\x12\x14\n\x10\x44\x45LETE_REQUESTED\x10\x02:G\xea\x41\x44\n+cloudresourcemanager.googleapis.com/Project\x12\x12projects/{project}R\x01\x01\"V\n\x11GetProjectRequest\x12\x41\n\x04name\x18\x01 \x01(\tB3\xe0\x41\x02\xfa\x41-\n+cloudresourcemanager.googleapis.com/Project\"|\n\x13ListProjectsRequest\x12\x19\n\x06parent\x18\x01 \x01(\tB\t\xe0\x41\x02\xfa\x41\x03\x12\x01*\x12\x17\n\npage_token\x18\x02 \x01(\tB\x03\xe0\x41\x01\x12\x16\n\tpage_size\x18\x03 \x01(\x05\x42\x03\xe0\x41\x01\x12\x19\n\x0cshow_deleted\x18\x04 \x01(\x08\x42\x03\xe0\x41\x01\"k\n\x14ListProjectsResponse\x12:\n\x08projects\x18\x01 \x03(\x0b\x32(.google.cloud.resourcemanager.v3.Project\x12\x17\n\x0fnext_page_token\x18\x02 \x01(\t\"\\\n\x15SearchProjectsRequest\x12\x12\n\x05query\x18\x01 \x01(\tB\x03\xe0\x41\x01\x12\x17\n\npage_token\x18\x02 \x01(\tB\x03\xe0\x41\x01\x12\x16\n\tpage_size\x18\x03 \x01(\x05\x42\x03\xe0\x41\x01\"m\n\x16SearchProjectsResponse\x12:\n\x08projects\x18\x01 \x03(\x0b\x32(.google.cloud.resourcemanager.v3.Project\x12\x17\n\x0fnext_page_token\x18\x02 \x01(\t\"V\n\x14\x43reateProjectRequest\x12>\n\x07project\x18\x01 \x01(\x0b\x32(.google.cloud.resourcemanager.v3.ProjectB\x03\xe0\x41\x02\"i\n\x15\x43reateProjectMetadata\x12/\n\x0b\x63reate_time\x18\x01 \x01(\x0b\x32\x1a.google.protobuf.Timestamp\x12\x10\n\x08gettable\x18\x02 \x01(\x08\x12\r\n\x05ready\x18\x03 \x01(\x08\"\x8c\x01\n\x14UpdateProjectRequest\x12>\n\x07project\x18\x01 \x01(\x0b\x32(.google.cloud.resourcemanager.v3.ProjectB\x03\xe0\x41\x02\x12\x34\n\x0bupdate_mask\x18\x02 \x01(\x0b\x32\x1a.google.protobuf.FieldMaskB\x03\xe0\x41\x01\"\x17\n\x15UpdateProjectMetadata\"~\n\x12MoveProjectRequest\x12\x41\n\x04name\x18\x01 \x01(\tB3\xe0\x41\x02\xfa\x41-\n+cloudresourcemanager.googleapis.com/Project\x12%\n\x12\x64\x65stination_parent\x18\x02 \x01(\tB\t\xe0\x41\x02\xfa\x41\x03\x12\x01*\"\x15\n\x13MoveProjectMetadata\"Y\n\x14\x44\x65leteProjectRequest\x12\x41\n\x04name\x18\x01 \x01(\tB3\xe0\x41\x02\xfa\x41-\n+cloudresourcemanager.googleapis.com/Project\"\x17\n\x15\x44\x65leteProjectMetadata\"[\n\x16UndeleteProjectRequest\x12\x41\n\x04name\x18\x01 \x01(\tB3\xe0\x41\x02\xfa\x41-\n+cloudresourcemanager.googleapis.com/Project\"\x19\n\x17UndeleteProjectMetadata2\x8f\x10\n\x08Projects\x12\x90\x01\n\nGetProject\x12\x32.google.cloud.resourcemanager.v3.GetProjectRequest\x1a(.google.cloud.resourcemanager.v3.Project\"$\xda\x41\x04name\x82\xd3\xe4\x93\x02\x17\x12\x15/v3/{name=projects/*}\x12\x9a\x01\n\x0cListProjects\x12\x34.google.cloud.resourcemanager.v3.ListProjectsRequest\x1a\x35.google.cloud.resourcemanager.v3.ListProjectsResponse\"\x1d\xda\x41\x06parent\x82\xd3\xe4\x93\x02\x0e\x12\x0c/v3/projects\x12\xa6\x01\n\x0eSearchProjects\x12\x36.google.cloud.resourcemanager.v3.SearchProjectsRequest\x1a\x37.google.cloud.resourcemanager.v3.SearchProjectsResponse\"#\xda\x41\x05query\x82\xd3\xe4\x93\x02\x15\x12\x13/v3/projects:search\x12\xb1\x01\n\rCreateProject\x12\x35.google.cloud.resourcemanager.v3.CreateProjectRequest\x1a\x1d.google.longrunning.Operation\"J\xca\x41 \n\x07Project\x12\x15\x43reateProjectMetadata\xda\x41\x07project\x82\xd3\xe4\x93\x02\x17\"\x0c/v3/projects:\x07project\x12\xce\x01\n\rUpdateProject\x12\x35.google.cloud.resourcemanager.v3.UpdateProjectRequest\x1a\x1d.google.longrunning.Operation\"g\xca\x41 \n\x07Project\x12\x15UpdateProjectMetadata\xda\x41\x13project,update_mask\x82\xd3\xe4\x93\x02(2\x1d/v3/{project.name=projects/*}:\x07project\x12\xc4\x01\n\x0bMoveProject\x12\x33.google.cloud.resourcemanager.v3.MoveProjectRequest\x1a\x1d.google.longrunning.Operation\"a\xca\x41\x1e\n\x07Project\x12\x13MoveProjectMetadata\xda\x41\x18name, destination_parent\x82\xd3\xe4\x93\x02\x1f\"\x1a/v3/{name=projects/*}:move:\x01*\x12\xae\x01\n\rDeleteProject\x12\x35.google.cloud.resourcemanager.v3.DeleteProjectRequest\x1a\x1d.google.longrunning.Operation\"G\xca\x41 \n\x07Project\x12\x15\x44\x65leteProjectMetadata\xda\x41\x04name\x82\xd3\xe4\x93\x02\x17*\x15/v3/{name=projects/*}\x12\xc0\x01\n\x0fUndeleteProject\x12\x37.google.cloud.resourcemanager.v3.UndeleteProjectRequest\x1a\x1d.google.longrunning.Operation\"U\xca\x41\"\n\x07Project\x12\x17UndeleteProjectMetadata\xda\x41\x04name\x82\xd3\xe4\x93\x02#\"\x1e/v3/{name=projects/*}:undelete:\x01*\x12\x87\x01\n\x0cGetIamPolicy\x12\".google.iam.v1.GetIamPolicyRequest\x1a\x15.google.iam.v1.Policy\"<\xda\x41\x08resource\x82\xd3\xe4\x93\x02+\"&/v3/{resource=projects/*}:getIamPolicy:\x01*\x12\x8f\x01\n\x0cSetIamPolicy\x12\".google.iam.v1.SetIamPolicyRequest\x1a\x15.google.iam.v1.Policy\"D\xda\x41\x10resource, policy\x82\xd3\xe4\x93\x02+\"&/v3/{resource=projects/*}:setIamPolicy:\x01*\x12\xba\x01\n\x12TestIamPermissions\x12(.google.iam.v1.TestIamPermissionsRequest\x1a).google.iam.v1.TestIamPermissionsResponse\"O\xda\x41\x15resource, permissions\x82\xd3\xe4\x93\x02\x31\",/v3/{resource=projects/*}:testIamPermissions:\x01*\x1a\x90\x01\xca\x41#cloudresourcemanager.googleapis.com\xd2\x41ghttps://www.googleapis.com/auth/cloud-platform,https://www.googleapis.com/auth/cloud-platform.read-onlyB\xee\x01\n#com.google.cloud.resourcemanager.v3B\rProjectsProtoP\x01ZMcloud.google.com/go/resourcemanager/apiv3/resourcemanagerpb;resourcemanagerpb\xaa\x02\x1fGoogle.Cloud.ResourceManager.V3\xca\x02\x1fGoogle\\Cloud\\ResourceManager\\V3\xea\x02\"Google::Cloud::ResourceManager::V3b\x06proto3" - -pool = ::Google::Protobuf::DescriptorPool.generated_pool -pool.add_serialized_file(descriptor_data) - -module Google - module Cloud - module ResourceManager - module V3 - Project = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.resourcemanager.v3.Project").msgclass - Project::State = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.resourcemanager.v3.Project.State").enummodule - GetProjectRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.resourcemanager.v3.GetProjectRequest").msgclass - ListProjectsRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.resourcemanager.v3.ListProjectsRequest").msgclass - ListProjectsResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.resourcemanager.v3.ListProjectsResponse").msgclass - SearchProjectsRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.resourcemanager.v3.SearchProjectsRequest").msgclass - SearchProjectsResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.resourcemanager.v3.SearchProjectsResponse").msgclass - CreateProjectRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.resourcemanager.v3.CreateProjectRequest").msgclass - CreateProjectMetadata = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.resourcemanager.v3.CreateProjectMetadata").msgclass - UpdateProjectRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.resourcemanager.v3.UpdateProjectRequest").msgclass - UpdateProjectMetadata = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.resourcemanager.v3.UpdateProjectMetadata").msgclass - MoveProjectRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.resourcemanager.v3.MoveProjectRequest").msgclass - MoveProjectMetadata = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.resourcemanager.v3.MoveProjectMetadata").msgclass - DeleteProjectRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.resourcemanager.v3.DeleteProjectRequest").msgclass - DeleteProjectMetadata = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.resourcemanager.v3.DeleteProjectMetadata").msgclass - UndeleteProjectRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.resourcemanager.v3.UndeleteProjectRequest").msgclass - UndeleteProjectMetadata = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.resourcemanager.v3.UndeleteProjectMetadata").msgclass - end - end - end -end diff --git a/owl-bot-staging/google-cloud-resource_manager-v3/lib/google/cloud/resourcemanager/v3/projects_services_pb.rb b/owl-bot-staging/google-cloud-resource_manager-v3/lib/google/cloud/resourcemanager/v3/projects_services_pb.rb deleted file mode 100644 index afbf3b81b1da..000000000000 --- a/owl-bot-staging/google-cloud-resource_manager-v3/lib/google/cloud/resourcemanager/v3/projects_services_pb.rb +++ /dev/null @@ -1,190 +0,0 @@ -# Generated by the protocol buffer compiler. DO NOT EDIT! -# Source: google/cloud/resourcemanager/v3/projects.proto for package 'Google.Cloud.ResourceManager.V3' -# Original file comments: -# 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 -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. -# - -require 'grpc' -require 'google/cloud/resourcemanager/v3/projects_pb' - -module Google - module Cloud - module ResourceManager - module V3 - module Projects - # Manages Google Cloud Projects. - class Service - - include ::GRPC::GenericService - - self.marshal_class_method = :encode - self.unmarshal_class_method = :decode - self.service_name = 'google.cloud.resourcemanager.v3.Projects' - - # Retrieves the project identified by the specified `name` (for example, - # `projects/415104041262`). - # - # The caller must have `resourcemanager.projects.get` permission - # for this project. - rpc :GetProject, ::Google::Cloud::ResourceManager::V3::GetProjectRequest, ::Google::Cloud::ResourceManager::V3::Project - # Lists projects that are direct children of the specified folder or - # organization resource. `list()` provides a strongly consistent view of the - # projects underneath the specified parent resource. `list()` returns - # projects sorted based upon the (ascending) lexical ordering of their - # `display_name`. The caller must have `resourcemanager.projects.list` - # permission on the identified parent. - rpc :ListProjects, ::Google::Cloud::ResourceManager::V3::ListProjectsRequest, ::Google::Cloud::ResourceManager::V3::ListProjectsResponse - # Search for projects that the caller has both `resourcemanager.projects.get` - # permission on, and also satisfy the specified query. - # - # This method returns projects in an unspecified order. - # - # This method is eventually consistent with project mutations; this means - # that a newly created project may not appear in the results or recent - # updates to an existing project may not be reflected in the results. To - # retrieve the latest state of a project, use the - # [GetProject][google.cloud.resourcemanager.v3.Projects.GetProject] method. - rpc :SearchProjects, ::Google::Cloud::ResourceManager::V3::SearchProjectsRequest, ::Google::Cloud::ResourceManager::V3::SearchProjectsResponse - # Request that a new project be created. The result is an `Operation` which - # can be used to track the creation process. This process usually takes a few - # seconds, but can sometimes take much longer. The tracking `Operation` is - # automatically deleted after a few hours, so there is no need to call - # `DeleteOperation`. - rpc :CreateProject, ::Google::Cloud::ResourceManager::V3::CreateProjectRequest, ::Google::Longrunning::Operation - # Updates the `display_name` and labels of the project identified by the - # specified `name` (for example, `projects/415104041262`). Deleting all - # labels requires an update mask for labels field. - # - # The caller must have `resourcemanager.projects.update` permission for this - # project. - rpc :UpdateProject, ::Google::Cloud::ResourceManager::V3::UpdateProjectRequest, ::Google::Longrunning::Operation - # Move a project to another place in your resource hierarchy, under a new - # resource parent. - # - # Returns an operation which can be used to track the process of the project - # move workflow. - # Upon success, the `Operation.response` field will be populated with the - # moved project. - # - # The caller must have `resourcemanager.projects.move` permission on the - # project, on the project's current and proposed new parent. - # - # If project has no current parent, or it currently does not have an - # associated organization resource, you will also need the - # `resourcemanager.projects.setIamPolicy` permission in the project. - # - # - rpc :MoveProject, ::Google::Cloud::ResourceManager::V3::MoveProjectRequest, ::Google::Longrunning::Operation - # Marks the project identified by the specified - # `name` (for example, `projects/415104041262`) for deletion. - # - # This method will only affect the project if it has a lifecycle state of - # [ACTIVE][google.cloud.resourcemanager.v3.Project.State.ACTIVE]. - # - # This method changes the Project's lifecycle state from - # [ACTIVE][google.cloud.resourcemanager.v3.Project.State.ACTIVE] - # to - # [DELETE_REQUESTED][google.cloud.resourcemanager.v3.Project.State.DELETE_REQUESTED]. - # The deletion starts at an unspecified time, - # at which point the Project is no longer accessible. - # - # Until the deletion completes, you can check the lifecycle state - # checked by retrieving the project with [GetProject] - # [google.cloud.resourcemanager.v3.Projects.GetProject], - # and the project remains visible to [ListProjects] - # [google.cloud.resourcemanager.v3.Projects.ListProjects]. - # However, you cannot update the project. - # - # After the deletion completes, the project is not retrievable by - # the [GetProject] - # [google.cloud.resourcemanager.v3.Projects.GetProject], - # [ListProjects] - # [google.cloud.resourcemanager.v3.Projects.ListProjects], and - # [SearchProjects][google.cloud.resourcemanager.v3.Projects.SearchProjects] - # methods. - # - # This method behaves idempotently, such that deleting a `DELETE_REQUESTED` - # project will not cause an error, but also won't do anything. - # - # The caller must have `resourcemanager.projects.delete` permissions for this - # project. - rpc :DeleteProject, ::Google::Cloud::ResourceManager::V3::DeleteProjectRequest, ::Google::Longrunning::Operation - # Restores the project identified by the specified - # `name` (for example, `projects/415104041262`). - # You can only use this method for a project that has a lifecycle state of - # [DELETE_REQUESTED] - # [Projects.State.DELETE_REQUESTED]. - # After deletion starts, the project cannot be restored. - # - # The caller must have `resourcemanager.projects.undelete` permission for - # this project. - rpc :UndeleteProject, ::Google::Cloud::ResourceManager::V3::UndeleteProjectRequest, ::Google::Longrunning::Operation - # Returns the IAM access control policy for the specified project, in the - # format `projects/{ProjectIdOrNumber}` e.g. projects/123. - # Permission is denied if the policy or the resource do not exist. - rpc :GetIamPolicy, ::Google::Iam::V1::GetIamPolicyRequest, ::Google::Iam::V1::Policy - # Sets the IAM access control policy for the specified project, in the - # format `projects/{ProjectIdOrNumber}` e.g. projects/123. - # - # CAUTION: This method will replace the existing policy, and cannot be used - # to append additional IAM settings. - # - # Note: Removing service accounts from policies or changing their roles can - # render services completely inoperable. It is important to understand how - # the service account is being used before removing or updating its roles. - # - # The following constraints apply when using `setIamPolicy()`: - # - # + Project does not support `allUsers` and `allAuthenticatedUsers` as - # `members` in a `Binding` of a `Policy`. - # - # + The owner role can be granted to a `user`, `serviceAccount`, or a group - # that is part of an organization. For example, - # group@myownpersonaldomain.com could be added as an owner to a project in - # the myownpersonaldomain.com organization, but not the examplepetstore.com - # organization. - # - # + Service accounts can be made owners of a project directly - # without any restrictions. However, to be added as an owner, a user must be - # invited using the Cloud Platform console and must accept the invitation. - # - # + A user cannot be granted the owner role using `setIamPolicy()`. The user - # must be granted the owner role using the Cloud Platform Console and must - # explicitly accept the invitation. - # - # + Invitations to grant the owner role cannot be sent using - # `setIamPolicy()`; - # they must be sent only using the Cloud Platform Console. - # - # + If the project is not part of an organization, there must be at least - # one owner who has accepted the Terms of Service (ToS) agreement in the - # policy. Calling `setIamPolicy()` to remove the last ToS-accepted owner - # from the policy will fail. This restriction also applies to legacy - # projects that no longer have owners who have accepted the ToS. Edits to - # IAM policies will be rejected until the lack of a ToS-accepting owner is - # rectified. If the project is part of an organization, you can remove all - # owners, potentially making the organization inaccessible. - rpc :SetIamPolicy, ::Google::Iam::V1::SetIamPolicyRequest, ::Google::Iam::V1::Policy - # Returns permissions that a caller has on the specified project, in the - # format `projects/{ProjectIdOrNumber}` e.g. projects/123.. - rpc :TestIamPermissions, ::Google::Iam::V1::TestIamPermissionsRequest, ::Google::Iam::V1::TestIamPermissionsResponse - end - - Stub = Service.rpc_stub_class - end - end - end - end -end diff --git a/owl-bot-staging/google-cloud-resource_manager-v3/lib/google/cloud/resourcemanager/v3/tag_bindings_pb.rb b/owl-bot-staging/google-cloud-resource_manager-v3/lib/google/cloud/resourcemanager/v3/tag_bindings_pb.rb deleted file mode 100644 index 72df2774a4b3..000000000000 --- a/owl-bot-staging/google-cloud-resource_manager-v3/lib/google/cloud/resourcemanager/v3/tag_bindings_pb.rb +++ /dev/null @@ -1,37 +0,0 @@ -# frozen_string_literal: true -# Generated by the protocol buffer compiler. DO NOT EDIT! -# source: google/cloud/resourcemanager/v3/tag_bindings.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/longrunning/operations_pb' -require 'google/protobuf/empty_pb' - - -descriptor_data = "\n2google/cloud/resourcemanager/v3/tag_bindings.proto\x12\x1fgoogle.cloud.resourcemanager.v3\x1a\x1cgoogle/api/annotations.proto\x1a\x17google/api/client.proto\x1a\x1fgoogle/api/field_behavior.proto\x1a\x19google/api/resource.proto\x1a#google/longrunning/operations.proto\x1a\x1bgoogle/protobuf/empty.proto\"\xb5\x01\n\nTagBinding\x12\x11\n\x04name\x18\x01 \x01(\tB\x03\xe0\x41\x03\x12\x0e\n\x06parent\x18\x02 \x01(\t\x12\x11\n\ttag_value\x18\x03 \x01(\t\x12!\n\x19tag_value_namespaced_name\x18\x04 \x01(\t:N\xea\x41K\n.cloudresourcemanager.googleapis.com/TagBinding\x12\x19tagBindings/{tag_binding}\"\x1a\n\x18\x43reateTagBindingMetadata\"|\n\x17\x43reateTagBindingRequest\x12\x45\n\x0btag_binding\x18\x01 \x01(\x0b\x32+.google.cloud.resourcemanager.v3.TagBindingB\x03\xe0\x41\x02\x12\x1a\n\rvalidate_only\x18\x02 \x01(\x08\x42\x03\xe0\x41\x01\"\x1a\n\x18\x44\x65leteTagBindingMetadata\"_\n\x17\x44\x65leteTagBindingRequest\x12\x44\n\x04name\x18\x01 \x01(\tB6\xe0\x41\x02\xfa\x41\x30\n.cloudresourcemanager.googleapis.com/TagBinding\"d\n\x16ListTagBindingsRequest\x12\x19\n\x06parent\x18\x01 \x01(\tB\t\xe0\x41\x02\xfa\x41\x03\x12\x01*\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\"u\n\x17ListTagBindingsResponse\x12\x41\n\x0ctag_bindings\x18\x01 \x03(\x0b\x32+.google.cloud.resourcemanager.v3.TagBinding\x12\x17\n\x0fnext_page_token\x18\x02 \x01(\t\"`\n\x18ListEffectiveTagsRequest\x12\x13\n\x06parent\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\"{\n\x19ListEffectiveTagsResponse\x12\x45\n\x0e\x65\x66\x66\x65\x63tive_tags\x18\x01 \x03(\x0b\x32-.google.cloud.resourcemanager.v3.EffectiveTag\x12\x17\n\x0fnext_page_token\x18\x02 \x01(\t\"\x80\x02\n\x0c\x45\x66\x66\x65\x63tiveTag\x12\x44\n\ttag_value\x18\x01 \x01(\tB1\xfa\x41.\n,cloudresourcemanager.googleapis.com/TagValue\x12\x1c\n\x14namespaced_tag_value\x18\x02 \x01(\t\x12@\n\x07tag_key\x18\x03 \x01(\tB/\xfa\x41,\n*cloudresourcemanager.googleapis.com/TagKey\x12\x1a\n\x12namespaced_tag_key\x18\x04 \x01(\t\x12\x1b\n\x13tag_key_parent_name\x18\x06 \x01(\t\x12\x11\n\tinherited\x18\x05 \x01(\x08\x32\x91\x07\n\x0bTagBindings\x12\xa6\x01\n\x0fListTagBindings\x12\x37.google.cloud.resourcemanager.v3.ListTagBindingsRequest\x1a\x38.google.cloud.resourcemanager.v3.ListTagBindingsResponse\" \xda\x41\x06parent\x82\xd3\xe4\x93\x02\x11\x12\x0f/v3/tagBindings\x12\xc8\x01\n\x10\x43reateTagBinding\x12\x38.google.cloud.resourcemanager.v3.CreateTagBindingRequest\x1a\x1d.google.longrunning.Operation\"[\xca\x41&\n\nTagBinding\x12\x18\x43reateTagBindingMetadata\xda\x41\x0btag_binding\x82\xd3\xe4\x93\x02\x1e\"\x0f/v3/tagBindings:\x0btag_binding\x12\xc9\x01\n\x10\x44\x65leteTagBinding\x12\x38.google.cloud.resourcemanager.v3.DeleteTagBindingRequest\x1a\x1d.google.longrunning.Operation\"\\\xca\x41\x31\n\x15google.protobuf.Empty\x12\x18\x44\x65leteTagBindingMetadata\xda\x41\x04name\x82\xd3\xe4\x93\x02\x1b*\x19/v3/{name=tagBindings/**}\x12\xae\x01\n\x11ListEffectiveTags\x12\x39.google.cloud.resourcemanager.v3.ListEffectiveTagsRequest\x1a:.google.cloud.resourcemanager.v3.ListEffectiveTagsResponse\"\"\xda\x41\x06parent\x82\xd3\xe4\x93\x02\x13\x12\x11/v3/effectiveTags\x1a\x90\x01\xca\x41#cloudresourcemanager.googleapis.com\xd2\x41ghttps://www.googleapis.com/auth/cloud-platform,https://www.googleapis.com/auth/cloud-platform.read-onlyB\xf1\x01\n#com.google.cloud.resourcemanager.v3B\x10TagBindingsProtoP\x01ZMcloud.google.com/go/resourcemanager/apiv3/resourcemanagerpb;resourcemanagerpb\xaa\x02\x1fGoogle.Cloud.ResourceManager.V3\xca\x02\x1fGoogle\\Cloud\\ResourceManager\\V3\xea\x02\"Google::Cloud::ResourceManager::V3b\x06proto3" - -pool = ::Google::Protobuf::DescriptorPool.generated_pool -pool.add_serialized_file(descriptor_data) - -module Google - module Cloud - module ResourceManager - module V3 - TagBinding = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.resourcemanager.v3.TagBinding").msgclass - CreateTagBindingMetadata = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.resourcemanager.v3.CreateTagBindingMetadata").msgclass - CreateTagBindingRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.resourcemanager.v3.CreateTagBindingRequest").msgclass - DeleteTagBindingMetadata = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.resourcemanager.v3.DeleteTagBindingMetadata").msgclass - DeleteTagBindingRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.resourcemanager.v3.DeleteTagBindingRequest").msgclass - ListTagBindingsRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.resourcemanager.v3.ListTagBindingsRequest").msgclass - ListTagBindingsResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.resourcemanager.v3.ListTagBindingsResponse").msgclass - ListEffectiveTagsRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.resourcemanager.v3.ListEffectiveTagsRequest").msgclass - ListEffectiveTagsResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.resourcemanager.v3.ListEffectiveTagsResponse").msgclass - EffectiveTag = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.resourcemanager.v3.EffectiveTag").msgclass - end - end - end -end diff --git a/owl-bot-staging/google-cloud-resource_manager-v3/lib/google/cloud/resourcemanager/v3/tag_bindings_services_pb.rb b/owl-bot-staging/google-cloud-resource_manager-v3/lib/google/cloud/resourcemanager/v3/tag_bindings_services_pb.rb deleted file mode 100644 index 146298d792c5..000000000000 --- a/owl-bot-staging/google-cloud-resource_manager-v3/lib/google/cloud/resourcemanager/v3/tag_bindings_services_pb.rb +++ /dev/null @@ -1,57 +0,0 @@ -# Generated by the protocol buffer compiler. DO NOT EDIT! -# Source: google/cloud/resourcemanager/v3/tag_bindings.proto for package 'Google.Cloud.ResourceManager.V3' -# Original file comments: -# 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 -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. -# - -require 'grpc' -require 'google/cloud/resourcemanager/v3/tag_bindings_pb' - -module Google - module Cloud - module ResourceManager - module V3 - module TagBindings - # Allow users to create and manage TagBindings between TagValues and - # different Google Cloud resources throughout the GCP resource hierarchy. - class Service - - include ::GRPC::GenericService - - self.marshal_class_method = :encode - self.unmarshal_class_method = :decode - self.service_name = 'google.cloud.resourcemanager.v3.TagBindings' - - # Lists the TagBindings for the given Google Cloud resource, as specified - # with `parent`. - # - # NOTE: The `parent` field is expected to be a full resource name: - # https://cloud.google.com/apis/design/resource_names#full_resource_name - rpc :ListTagBindings, ::Google::Cloud::ResourceManager::V3::ListTagBindingsRequest, ::Google::Cloud::ResourceManager::V3::ListTagBindingsResponse - # Creates a TagBinding between a TagValue and a Google Cloud resource. - rpc :CreateTagBinding, ::Google::Cloud::ResourceManager::V3::CreateTagBindingRequest, ::Google::Longrunning::Operation - # Deletes a TagBinding. - rpc :DeleteTagBinding, ::Google::Cloud::ResourceManager::V3::DeleteTagBindingRequest, ::Google::Longrunning::Operation - # Return a list of effective tags for the given Google Cloud resource, as - # specified in `parent`. - rpc :ListEffectiveTags, ::Google::Cloud::ResourceManager::V3::ListEffectiveTagsRequest, ::Google::Cloud::ResourceManager::V3::ListEffectiveTagsResponse - end - - Stub = Service.rpc_stub_class - end - end - end - end -end diff --git a/owl-bot-staging/google-cloud-resource_manager-v3/lib/google/cloud/resourcemanager/v3/tag_holds_pb.rb b/owl-bot-staging/google-cloud-resource_manager-v3/lib/google/cloud/resourcemanager/v3/tag_holds_pb.rb deleted file mode 100644 index 4ec85e2889d5..000000000000 --- a/owl-bot-staging/google-cloud-resource_manager-v3/lib/google/cloud/resourcemanager/v3/tag_holds_pb.rb +++ /dev/null @@ -1,35 +0,0 @@ -# frozen_string_literal: true -# Generated by the protocol buffer compiler. DO NOT EDIT! -# source: google/cloud/resourcemanager/v3/tag_holds.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/longrunning/operations_pb' -require 'google/protobuf/empty_pb' -require 'google/protobuf/timestamp_pb' - - -descriptor_data = "\n/google/cloud/resourcemanager/v3/tag_holds.proto\x12\x1fgoogle.cloud.resourcemanager.v3\x1a\x1cgoogle/api/annotations.proto\x1a\x17google/api/client.proto\x1a\x1fgoogle/api/field_behavior.proto\x1a\x19google/api/resource.proto\x1a#google/longrunning/operations.proto\x1a\x1bgoogle/protobuf/empty.proto\x1a\x1fgoogle/protobuf/timestamp.proto\"\xf1\x01\n\x07TagHold\x12\x11\n\x04name\x18\x01 \x01(\tB\x03\xe0\x41\x03\x12\x13\n\x06holder\x18\x02 \x01(\tB\x03\xe0\x41\x02\x12\x13\n\x06origin\x18\x03 \x01(\tB\x03\xe0\x41\x01\x12\x16\n\thelp_link\x18\x04 \x01(\tB\x03\xe0\x41\x01\x12\x34\n\x0b\x63reate_time\x18\x05 \x01(\x0b\x32\x1a.google.protobuf.TimestampB\x03\xe0\x41\x03:[\xea\x41X\n+cloudresourcemanager.googleapis.com/TagHold\x12)tagValues/{tag_value}/tagHolds/{tag_hold}\"\xb8\x01\n\x14\x43reateTagHoldRequest\x12\x43\n\x06parent\x18\x01 \x01(\tB3\xe0\x41\x02\xfa\x41-\x12+cloudresourcemanager.googleapis.com/TagHold\x12?\n\x08tag_hold\x18\x02 \x01(\x0b\x32(.google.cloud.resourcemanager.v3.TagHoldB\x03\xe0\x41\x02\x12\x1a\n\rvalidate_only\x18\x03 \x01(\x08\x42\x03\xe0\x41\x01\"\x17\n\x15\x43reateTagHoldMetadata\"u\n\x14\x44\x65leteTagHoldRequest\x12\x41\n\x04name\x18\x01 \x01(\tB3\xe0\x41\x02\xfa\x41-\n+cloudresourcemanager.googleapis.com/TagHold\x12\x1a\n\rvalidate_only\x18\x02 \x01(\x08\x42\x03\xe0\x41\x01\"\x17\n\x15\x44\x65leteTagHoldMetadata\"\xa0\x01\n\x13ListTagHoldsRequest\x12\x43\n\x06parent\x18\x01 \x01(\tB3\xe0\x41\x02\xfa\x41-\x12+cloudresourcemanager.googleapis.com/TagHold\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\"l\n\x14ListTagHoldsResponse\x12;\n\ttag_holds\x18\x01 \x03(\x0b\x32(.google.cloud.resourcemanager.v3.TagHold\x12\x17\n\x0fnext_page_token\x18\x02 \x01(\t2\xec\x05\n\x08TagHolds\x12\xcf\x01\n\rCreateTagHold\x12\x35.google.cloud.resourcemanager.v3.CreateTagHoldRequest\x1a\x1d.google.longrunning.Operation\"h\xca\x41 \n\x07TagHold\x12\x15\x43reateTagHoldMetadata\xda\x41\x0fparent,tag_hold\x82\xd3\xe4\x93\x02-\"!/v3/{parent=tagValues/*}/tagHolds:\x08tag_hold\x12\xc8\x01\n\rDeleteTagHold\x12\x35.google.cloud.resourcemanager.v3.DeleteTagHoldRequest\x1a\x1d.google.longrunning.Operation\"a\xca\x41.\n\x15google.protobuf.Empty\x12\x15\x44\x65leteTagHoldMetadata\xda\x41\x04name\x82\xd3\xe4\x93\x02#*!/v3/{name=tagValues/*/tagHolds/*}\x12\xaf\x01\n\x0cListTagHolds\x12\x34.google.cloud.resourcemanager.v3.ListTagHoldsRequest\x1a\x35.google.cloud.resourcemanager.v3.ListTagHoldsResponse\"2\xda\x41\x06parent\x82\xd3\xe4\x93\x02#\x12!/v3/{parent=tagValues/*}/tagHolds\x1a\x90\x01\xca\x41#cloudresourcemanager.googleapis.com\xd2\x41ghttps://www.googleapis.com/auth/cloud-platform,https://www.googleapis.com/auth/cloud-platform.read-onlyB\xee\x01\n#com.google.cloud.resourcemanager.v3B\rTagHoldsProtoP\x01ZMcloud.google.com/go/resourcemanager/apiv3/resourcemanagerpb;resourcemanagerpb\xaa\x02\x1fGoogle.Cloud.ResourceManager.V3\xca\x02\x1fGoogle\\Cloud\\ResourceManager\\V3\xea\x02\"Google::Cloud::ResourceManager::V3b\x06proto3" - -pool = ::Google::Protobuf::DescriptorPool.generated_pool -pool.add_serialized_file(descriptor_data) - -module Google - module Cloud - module ResourceManager - module V3 - TagHold = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.resourcemanager.v3.TagHold").msgclass - CreateTagHoldRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.resourcemanager.v3.CreateTagHoldRequest").msgclass - CreateTagHoldMetadata = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.resourcemanager.v3.CreateTagHoldMetadata").msgclass - DeleteTagHoldRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.resourcemanager.v3.DeleteTagHoldRequest").msgclass - DeleteTagHoldMetadata = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.resourcemanager.v3.DeleteTagHoldMetadata").msgclass - ListTagHoldsRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.resourcemanager.v3.ListTagHoldsRequest").msgclass - ListTagHoldsResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.resourcemanager.v3.ListTagHoldsResponse").msgclass - end - end - end -end diff --git a/owl-bot-staging/google-cloud-resource_manager-v3/lib/google/cloud/resourcemanager/v3/tag_holds_services_pb.rb b/owl-bot-staging/google-cloud-resource_manager-v3/lib/google/cloud/resourcemanager/v3/tag_holds_services_pb.rb deleted file mode 100644 index 16dcb5b0a2d7..000000000000 --- a/owl-bot-staging/google-cloud-resource_manager-v3/lib/google/cloud/resourcemanager/v3/tag_holds_services_pb.rb +++ /dev/null @@ -1,54 +0,0 @@ -# Generated by the protocol buffer compiler. DO NOT EDIT! -# Source: google/cloud/resourcemanager/v3/tag_holds.proto for package 'Google.Cloud.ResourceManager.V3' -# Original file comments: -# 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 -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. -# - -require 'grpc' -require 'google/cloud/resourcemanager/v3/tag_holds_pb' - -module Google - module Cloud - module ResourceManager - module V3 - module TagHolds - # Allow users to create and manage TagHolds for TagValues. TagHolds represent - # the use of a Tag Value that is not captured by TagBindings but - # should still block TagValue deletion (such as a reference in a policy - # condition). This service provides isolated failure domains by cloud location - # so that TagHolds can be managed in the same location as their usage. - class Service - - include ::GRPC::GenericService - - self.marshal_class_method = :encode - self.unmarshal_class_method = :decode - self.service_name = 'google.cloud.resourcemanager.v3.TagHolds' - - # Creates a TagHold. Returns ALREADY_EXISTS if a TagHold with the same - # resource and origin exists under the same TagValue. - rpc :CreateTagHold, ::Google::Cloud::ResourceManager::V3::CreateTagHoldRequest, ::Google::Longrunning::Operation - # Deletes a TagHold. - rpc :DeleteTagHold, ::Google::Cloud::ResourceManager::V3::DeleteTagHoldRequest, ::Google::Longrunning::Operation - # Lists TagHolds under a TagValue. - rpc :ListTagHolds, ::Google::Cloud::ResourceManager::V3::ListTagHoldsRequest, ::Google::Cloud::ResourceManager::V3::ListTagHoldsResponse - end - - Stub = Service.rpc_stub_class - end - end - end - end -end diff --git a/owl-bot-staging/google-cloud-resource_manager-v3/lib/google/cloud/resourcemanager/v3/tag_keys_pb.rb b/owl-bot-staging/google-cloud-resource_manager-v3/lib/google/cloud/resourcemanager/v3/tag_keys_pb.rb deleted file mode 100644 index 0c22c53a55b5..000000000000 --- a/owl-bot-staging/google-cloud-resource_manager-v3/lib/google/cloud/resourcemanager/v3/tag_keys_pb.rb +++ /dev/null @@ -1,42 +0,0 @@ -# frozen_string_literal: true -# Generated by the protocol buffer compiler. DO NOT EDIT! -# source: google/cloud/resourcemanager/v3/tag_keys.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/v1/iam_policy_pb' -require 'google/iam/v1/policy_pb' -require 'google/longrunning/operations_pb' -require 'google/protobuf/field_mask_pb' -require 'google/protobuf/timestamp_pb' - - -descriptor_data = "\n.google/cloud/resourcemanager/v3/tag_keys.proto\x12\x1fgoogle.cloud.resourcemanager.v3\x1a\x1cgoogle/api/annotations.proto\x1a\x17google/api/client.proto\x1a\x1fgoogle/api/field_behavior.proto\x1a\x19google/api/resource.proto\x1a\x1egoogle/iam/v1/iam_policy.proto\x1a\x1agoogle/iam/v1/policy.proto\x1a#google/longrunning/operations.proto\x1a google/protobuf/field_mask.proto\x1a\x1fgoogle/protobuf/timestamp.proto\"\x96\x04\n\x06TagKey\x12\x11\n\x04name\x18\x01 \x01(\tB\x03\xe0\x41\x05\x12\x13\n\x06parent\x18\x02 \x01(\tB\x03\xe0\x41\x05\x12\x1a\n\nshort_name\x18\x03 \x01(\tB\x06\xe0\x41\x02\xe0\x41\x05\x12\x1f\n\x0fnamespaced_name\x18\x04 \x01(\tB\x06\xe0\x41\x03\xe0\x41\x05\x12\x18\n\x0b\x64\x65scription\x18\x05 \x01(\tB\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\x11\n\x04\x65tag\x18\x08 \x01(\tB\x03\xe0\x41\x01\x12>\n\x07purpose\x18\x0b \x01(\x0e\x32(.google.cloud.resourcemanager.v3.PurposeB\x03\xe0\x41\x01\x12S\n\x0cpurpose_data\x18\x0c \x03(\x0b\x32\x38.google.cloud.resourcemanager.v3.TagKey.PurposeDataEntryB\x03\xe0\x41\x01\x1a\x32\n\x10PurposeDataEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12\r\n\x05value\x18\x02 \x01(\t:\x02\x38\x01:E\xea\x41\x42\n*cloudresourcemanager.googleapis.com/TagKey\x12\x11tagKeys/{tag_key}R\x01\x01\"`\n\x12ListTagKeysRequest\x12\x19\n\x06parent\x18\x01 \x01(\tB\t\xe0\x41\x02\xfa\x41\x03\x12\x01*\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\"i\n\x13ListTagKeysResponse\x12\x39\n\x08tag_keys\x18\x01 \x03(\x0b\x32\'.google.cloud.resourcemanager.v3.TagKey\x12\x17\n\x0fnext_page_token\x18\x02 \x01(\t\"T\n\x10GetTagKeyRequest\x12@\n\x04name\x18\x01 \x01(\tB2\xe0\x41\x02\xfa\x41,\n*cloudresourcemanager.googleapis.com/TagKey\"^\n\x1aGetNamespacedTagKeyRequest\x12@\n\x04name\x18\x01 \x01(\tB2\xe0\x41\x02\xfa\x41,\n*cloudresourcemanager.googleapis.com/TagKey\"p\n\x13\x43reateTagKeyRequest\x12=\n\x07tag_key\x18\x01 \x01(\x0b\x32\'.google.cloud.resourcemanager.v3.TagKeyB\x03\xe0\x41\x02\x12\x1a\n\rvalidate_only\x18\x02 \x01(\x08\x42\x03\xe0\x41\x01\"\x16\n\x14\x43reateTagKeyMetadata\"\x9c\x01\n\x13UpdateTagKeyRequest\x12=\n\x07tag_key\x18\x01 \x01(\x0b\x32\'.google.cloud.resourcemanager.v3.TagKeyB\x03\xe0\x41\x02\x12/\n\x0bupdate_mask\x18\x02 \x01(\x0b\x32\x1a.google.protobuf.FieldMask\x12\x15\n\rvalidate_only\x18\x03 \x01(\x08\"\x16\n\x14UpdateTagKeyMetadata\"\x86\x01\n\x13\x44\x65leteTagKeyRequest\x12@\n\x04name\x18\x01 \x01(\tB2\xe0\x41\x02\xfa\x41,\n*cloudresourcemanager.googleapis.com/TagKey\x12\x1a\n\rvalidate_only\x18\x02 \x01(\x08\x42\x03\xe0\x41\x01\x12\x11\n\x04\x65tag\x18\x03 \x01(\tB\x03\xe0\x41\x01\"\x16\n\x14\x44\x65leteTagKeyMetadata*4\n\x07Purpose\x12\x17\n\x13PURPOSE_UNSPECIFIED\x10\x00\x12\x10\n\x0cGCE_FIREWALL\x10\x01\x32\xe4\x0c\n\x07TagKeys\x12\x96\x01\n\x0bListTagKeys\x12\x33.google.cloud.resourcemanager.v3.ListTagKeysRequest\x1a\x34.google.cloud.resourcemanager.v3.ListTagKeysResponse\"\x1c\xda\x41\x06parent\x82\xd3\xe4\x93\x02\r\x12\x0b/v3/tagKeys\x12\x8c\x01\n\tGetTagKey\x12\x31.google.cloud.resourcemanager.v3.GetTagKeyRequest\x1a\'.google.cloud.resourcemanager.v3.TagKey\"#\xda\x41\x04name\x82\xd3\xe4\x93\x02\x16\x12\x14/v3/{name=tagKeys/*}\x12\xa2\x01\n\x13GetNamespacedTagKey\x12;.google.cloud.resourcemanager.v3.GetNamespacedTagKeyRequest\x1a\'.google.cloud.resourcemanager.v3.TagKey\"%\xda\x41\x04name\x82\xd3\xe4\x93\x02\x18\x12\x16/v3/tagKeys/namespaced\x12\xac\x01\n\x0c\x43reateTagKey\x12\x34.google.cloud.resourcemanager.v3.CreateTagKeyRequest\x1a\x1d.google.longrunning.Operation\"G\xca\x41\x1e\n\x06TagKey\x12\x14\x43reateTagKeyMetadata\xda\x41\x07tag_key\x82\xd3\xe4\x93\x02\x16\"\x0b/v3/tagKeys:\x07tag_key\x12\xc9\x01\n\x0cUpdateTagKey\x12\x34.google.cloud.resourcemanager.v3.UpdateTagKeyRequest\x1a\x1d.google.longrunning.Operation\"d\xca\x41\x1e\n\x06TagKey\x12\x14UpdateTagKeyMetadata\xda\x41\x13tag_key,update_mask\x82\xd3\xe4\x93\x02\'2\x1c/v3/{tag_key.name=tagKeys/*}:\x07tag_key\x12\xa9\x01\n\x0c\x44\x65leteTagKey\x12\x34.google.cloud.resourcemanager.v3.DeleteTagKeyRequest\x1a\x1d.google.longrunning.Operation\"D\xca\x41\x1e\n\x06TagKey\x12\x14\x44\x65leteTagKeyMetadata\xda\x41\x04name\x82\xd3\xe4\x93\x02\x16*\x14/v3/{name=tagKeys/*}\x12\x86\x01\n\x0cGetIamPolicy\x12\".google.iam.v1.GetIamPolicyRequest\x1a\x15.google.iam.v1.Policy\";\xda\x41\x08resource\x82\xd3\xe4\x93\x02*\"%/v3/{resource=tagKeys/*}:getIamPolicy:\x01*\x12\x8d\x01\n\x0cSetIamPolicy\x12\".google.iam.v1.SetIamPolicyRequest\x1a\x15.google.iam.v1.Policy\"B\xda\x41\x0fresource,policy\x82\xd3\xe4\x93\x02*\"%/v3/{resource=tagKeys/*}:setIamPolicy:\x01*\x12\xb8\x01\n\x12TestIamPermissions\x12(.google.iam.v1.TestIamPermissionsRequest\x1a).google.iam.v1.TestIamPermissionsResponse\"M\xda\x41\x14resource,permissions\x82\xd3\xe4\x93\x02\x30\"+/v3/{resource=tagKeys/*}:testIamPermissions:\x01*\x1a\x90\x01\xca\x41#cloudresourcemanager.googleapis.com\xd2\x41ghttps://www.googleapis.com/auth/cloud-platform,https://www.googleapis.com/auth/cloud-platform.read-onlyB\xed\x01\n#com.google.cloud.resourcemanager.v3B\x0cTagKeysProtoP\x01ZMcloud.google.com/go/resourcemanager/apiv3/resourcemanagerpb;resourcemanagerpb\xaa\x02\x1fGoogle.Cloud.ResourceManager.V3\xca\x02\x1fGoogle\\Cloud\\ResourceManager\\V3\xea\x02\"Google::Cloud::ResourceManager::V3b\x06proto3" - -pool = ::Google::Protobuf::DescriptorPool.generated_pool -pool.add_serialized_file(descriptor_data) - -module Google - module Cloud - module ResourceManager - module V3 - TagKey = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.resourcemanager.v3.TagKey").msgclass - ListTagKeysRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.resourcemanager.v3.ListTagKeysRequest").msgclass - ListTagKeysResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.resourcemanager.v3.ListTagKeysResponse").msgclass - GetTagKeyRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.resourcemanager.v3.GetTagKeyRequest").msgclass - GetNamespacedTagKeyRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.resourcemanager.v3.GetNamespacedTagKeyRequest").msgclass - CreateTagKeyRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.resourcemanager.v3.CreateTagKeyRequest").msgclass - CreateTagKeyMetadata = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.resourcemanager.v3.CreateTagKeyMetadata").msgclass - UpdateTagKeyRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.resourcemanager.v3.UpdateTagKeyRequest").msgclass - UpdateTagKeyMetadata = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.resourcemanager.v3.UpdateTagKeyMetadata").msgclass - DeleteTagKeyRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.resourcemanager.v3.DeleteTagKeyRequest").msgclass - DeleteTagKeyMetadata = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.resourcemanager.v3.DeleteTagKeyMetadata").msgclass - Purpose = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.resourcemanager.v3.Purpose").enummodule - end - end - end -end diff --git a/owl-bot-staging/google-cloud-resource_manager-v3/lib/google/cloud/resourcemanager/v3/tag_keys_services_pb.rb b/owl-bot-staging/google-cloud-resource_manager-v3/lib/google/cloud/resourcemanager/v3/tag_keys_services_pb.rb deleted file mode 100644 index d737da48dbaa..000000000000 --- a/owl-bot-staging/google-cloud-resource_manager-v3/lib/google/cloud/resourcemanager/v3/tag_keys_services_pb.rb +++ /dev/null @@ -1,81 +0,0 @@ -# Generated by the protocol buffer compiler. DO NOT EDIT! -# Source: google/cloud/resourcemanager/v3/tag_keys.proto for package 'Google.Cloud.ResourceManager.V3' -# Original file comments: -# 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 -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. -# - -require 'grpc' -require 'google/cloud/resourcemanager/v3/tag_keys_pb' - -module Google - module Cloud - module ResourceManager - module V3 - module TagKeys - # Allow users to create and manage tag keys. - class Service - - include ::GRPC::GenericService - - self.marshal_class_method = :encode - self.unmarshal_class_method = :decode - self.service_name = 'google.cloud.resourcemanager.v3.TagKeys' - - # Lists all TagKeys for a parent resource. - rpc :ListTagKeys, ::Google::Cloud::ResourceManager::V3::ListTagKeysRequest, ::Google::Cloud::ResourceManager::V3::ListTagKeysResponse - # Retrieves a TagKey. This method will return `PERMISSION_DENIED` if the - # key does not exist or the user does not have permission to view it. - rpc :GetTagKey, ::Google::Cloud::ResourceManager::V3::GetTagKeyRequest, ::Google::Cloud::ResourceManager::V3::TagKey - # Retrieves a TagKey by its namespaced name. - # This method will return `PERMISSION_DENIED` if the key does not exist - # or the user does not have permission to view it. - rpc :GetNamespacedTagKey, ::Google::Cloud::ResourceManager::V3::GetNamespacedTagKeyRequest, ::Google::Cloud::ResourceManager::V3::TagKey - # Creates a new TagKey. If another request with the same parameters is - # sent while the original request is in process, the second request - # will receive an error. A maximum of 1000 TagKeys can exist under a parent - # at any given time. - rpc :CreateTagKey, ::Google::Cloud::ResourceManager::V3::CreateTagKeyRequest, ::Google::Longrunning::Operation - # Updates the attributes of the TagKey resource. - rpc :UpdateTagKey, ::Google::Cloud::ResourceManager::V3::UpdateTagKeyRequest, ::Google::Longrunning::Operation - # Deletes a TagKey. The TagKey cannot be deleted if it has any child - # TagValues. - rpc :DeleteTagKey, ::Google::Cloud::ResourceManager::V3::DeleteTagKeyRequest, ::Google::Longrunning::Operation - # Gets the access control policy for a TagKey. The returned policy may be - # empty if no such policy or resource exists. The `resource` field should - # be the TagKey's resource name. For example, "tagKeys/1234". - # The caller must have - # `cloudresourcemanager.googleapis.com/tagKeys.getIamPolicy` permission on - # the specified TagKey. - rpc :GetIamPolicy, ::Google::Iam::V1::GetIamPolicyRequest, ::Google::Iam::V1::Policy - # Sets the access control policy on a TagKey, replacing any existing - # policy. The `resource` field should be the TagKey's resource name. - # For example, "tagKeys/1234". - # The caller must have `resourcemanager.tagKeys.setIamPolicy` permission - # on the identified tagValue. - rpc :SetIamPolicy, ::Google::Iam::V1::SetIamPolicyRequest, ::Google::Iam::V1::Policy - # Returns permissions that a caller has on the specified TagKey. - # The `resource` field should be the TagKey's resource name. - # For example, "tagKeys/1234". - # - # There are no permissions required for making this API call. - rpc :TestIamPermissions, ::Google::Iam::V1::TestIamPermissionsRequest, ::Google::Iam::V1::TestIamPermissionsResponse - end - - Stub = Service.rpc_stub_class - end - end - end - end -end diff --git a/owl-bot-staging/google-cloud-resource_manager-v3/lib/google/cloud/resourcemanager/v3/tag_values_pb.rb b/owl-bot-staging/google-cloud-resource_manager-v3/lib/google/cloud/resourcemanager/v3/tag_values_pb.rb deleted file mode 100644 index 95fd5f7ff020..000000000000 --- a/owl-bot-staging/google-cloud-resource_manager-v3/lib/google/cloud/resourcemanager/v3/tag_values_pb.rb +++ /dev/null @@ -1,41 +0,0 @@ -# frozen_string_literal: true -# Generated by the protocol buffer compiler. DO NOT EDIT! -# source: google/cloud/resourcemanager/v3/tag_values.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/v1/iam_policy_pb' -require 'google/iam/v1/policy_pb' -require 'google/longrunning/operations_pb' -require 'google/protobuf/field_mask_pb' -require 'google/protobuf/timestamp_pb' - - -descriptor_data = "\n0google/cloud/resourcemanager/v3/tag_values.proto\x12\x1fgoogle.cloud.resourcemanager.v3\x1a\x1cgoogle/api/annotations.proto\x1a\x17google/api/client.proto\x1a\x1fgoogle/api/field_behavior.proto\x1a\x19google/api/resource.proto\x1a\x1egoogle/iam/v1/iam_policy.proto\x1a\x1agoogle/iam/v1/policy.proto\x1a#google/longrunning/operations.proto\x1a google/protobuf/field_mask.proto\x1a\x1fgoogle/protobuf/timestamp.proto\"\xd2\x02\n\x08TagValue\x12\x11\n\x04name\x18\x01 \x01(\tB\x03\xe0\x41\x05\x12\x13\n\x06parent\x18\x02 \x01(\tB\x03\xe0\x41\x05\x12\x1a\n\nshort_name\x18\x03 \x01(\tB\x06\xe0\x41\x02\xe0\x41\x05\x12\x1c\n\x0fnamespaced_name\x18\x04 \x01(\tB\x03\xe0\x41\x03\x12\x18\n\x0b\x64\x65scription\x18\x05 \x01(\tB\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\x11\n\x04\x65tag\x18\x08 \x01(\tB\x03\xe0\x41\x01:K\xea\x41H\n,cloudresourcemanager.googleapis.com/TagValue\x12\x15tagValues/{tag_value}R\x01\x01\"b\n\x14ListTagValuesRequest\x12\x19\n\x06parent\x18\x01 \x01(\tB\t\xe0\x41\x02\xfa\x41\x03\x12\x01*\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\"o\n\x15ListTagValuesResponse\x12=\n\ntag_values\x18\x01 \x03(\x0b\x32).google.cloud.resourcemanager.v3.TagValue\x12\x17\n\x0fnext_page_token\x18\x02 \x01(\t\"X\n\x12GetTagValueRequest\x12\x42\n\x04name\x18\x01 \x01(\tB4\xe0\x41\x02\xfa\x41.\n,cloudresourcemanager.googleapis.com/TagValue\"b\n\x1cGetNamespacedTagValueRequest\x12\x42\n\x04name\x18\x01 \x01(\tB4\xe0\x41\x02\xfa\x41.\n,cloudresourcemanager.googleapis.com/TagValue\"v\n\x15\x43reateTagValueRequest\x12\x41\n\ttag_value\x18\x01 \x01(\x0b\x32).google.cloud.resourcemanager.v3.TagValueB\x03\xe0\x41\x02\x12\x1a\n\rvalidate_only\x18\x02 \x01(\x08\x42\x03\xe0\x41\x01\"\x18\n\x16\x43reateTagValueMetadata\"\xac\x01\n\x15UpdateTagValueRequest\x12\x41\n\ttag_value\x18\x01 \x01(\x0b\x32).google.cloud.resourcemanager.v3.TagValueB\x03\xe0\x41\x02\x12\x34\n\x0bupdate_mask\x18\x02 \x01(\x0b\x32\x1a.google.protobuf.FieldMaskB\x03\xe0\x41\x01\x12\x1a\n\rvalidate_only\x18\x03 \x01(\x08\x42\x03\xe0\x41\x01\"\x18\n\x16UpdateTagValueMetadata\"\x8a\x01\n\x15\x44\x65leteTagValueRequest\x12\x42\n\x04name\x18\x01 \x01(\tB4\xe0\x41\x02\xfa\x41.\n,cloudresourcemanager.googleapis.com/TagValue\x12\x1a\n\rvalidate_only\x18\x02 \x01(\x08\x42\x03\xe0\x41\x01\x12\x11\n\x04\x65tag\x18\x03 \x01(\tB\x03\xe0\x41\x01\"\x18\n\x16\x44\x65leteTagValueMetadata2\xac\r\n\tTagValues\x12\x9e\x01\n\rListTagValues\x12\x35.google.cloud.resourcemanager.v3.ListTagValuesRequest\x1a\x36.google.cloud.resourcemanager.v3.ListTagValuesResponse\"\x1e\xda\x41\x06parent\x82\xd3\xe4\x93\x02\x0f\x12\r/v3/tagValues\x12\x94\x01\n\x0bGetTagValue\x12\x33.google.cloud.resourcemanager.v3.GetTagValueRequest\x1a).google.cloud.resourcemanager.v3.TagValue\"%\xda\x41\x04name\x82\xd3\xe4\x93\x02\x18\x12\x16/v3/{name=tagValues/*}\x12\xaa\x01\n\x15GetNamespacedTagValue\x12=.google.cloud.resourcemanager.v3.GetNamespacedTagValueRequest\x1a).google.cloud.resourcemanager.v3.TagValue\"\'\xda\x41\x04name\x82\xd3\xe4\x93\x02\x1a\x12\x18/v3/tagValues/namespaced\x12\xba\x01\n\x0e\x43reateTagValue\x12\x36.google.cloud.resourcemanager.v3.CreateTagValueRequest\x1a\x1d.google.longrunning.Operation\"Q\xca\x41\"\n\x08TagValue\x12\x16\x43reateTagValueMetadata\xda\x41\ttag_value\x82\xd3\xe4\x93\x02\x1a\"\r/v3/tagValues:\ttag_value\x12\xd9\x01\n\x0eUpdateTagValue\x12\x36.google.cloud.resourcemanager.v3.UpdateTagValueRequest\x1a\x1d.google.longrunning.Operation\"p\xca\x41\"\n\x08TagValue\x12\x16UpdateTagValueMetadata\xda\x41\x15tag_value,update_mask\x82\xd3\xe4\x93\x02-2 /v3/{tag_value.name=tagValues/*}:\ttag_value\x12\xb3\x01\n\x0e\x44\x65leteTagValue\x12\x36.google.cloud.resourcemanager.v3.DeleteTagValueRequest\x1a\x1d.google.longrunning.Operation\"J\xca\x41\"\n\x08TagValue\x12\x16\x44\x65leteTagValueMetadata\xda\x41\x04name\x82\xd3\xe4\x93\x02\x18*\x16/v3/{name=tagValues/*}\x12\x88\x01\n\x0cGetIamPolicy\x12\".google.iam.v1.GetIamPolicyRequest\x1a\x15.google.iam.v1.Policy\"=\xda\x41\x08resource\x82\xd3\xe4\x93\x02,\"\'/v3/{resource=tagValues/*}:getIamPolicy:\x01*\x12\x8f\x01\n\x0cSetIamPolicy\x12\".google.iam.v1.SetIamPolicyRequest\x1a\x15.google.iam.v1.Policy\"D\xda\x41\x0fresource,policy\x82\xd3\xe4\x93\x02,\"\'/v3/{resource=tagValues/*}:setIamPolicy:\x01*\x12\xba\x01\n\x12TestIamPermissions\x12(.google.iam.v1.TestIamPermissionsRequest\x1a).google.iam.v1.TestIamPermissionsResponse\"O\xda\x41\x14resource,permissions\x82\xd3\xe4\x93\x02\x32\"-/v3/{resource=tagValues/*}:testIamPermissions:\x01*\x1a\x90\x01\xca\x41#cloudresourcemanager.googleapis.com\xd2\x41ghttps://www.googleapis.com/auth/cloud-platform,https://www.googleapis.com/auth/cloud-platform.read-onlyB\xef\x01\n#com.google.cloud.resourcemanager.v3B\x0eTagValuesProtoP\x01ZMcloud.google.com/go/resourcemanager/apiv3/resourcemanagerpb;resourcemanagerpb\xaa\x02\x1fGoogle.Cloud.ResourceManager.V3\xca\x02\x1fGoogle\\Cloud\\ResourceManager\\V3\xea\x02\"Google::Cloud::ResourceManager::V3b\x06proto3" - -pool = ::Google::Protobuf::DescriptorPool.generated_pool -pool.add_serialized_file(descriptor_data) - -module Google - module Cloud - module ResourceManager - module V3 - TagValue = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.resourcemanager.v3.TagValue").msgclass - ListTagValuesRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.resourcemanager.v3.ListTagValuesRequest").msgclass - ListTagValuesResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.resourcemanager.v3.ListTagValuesResponse").msgclass - GetTagValueRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.resourcemanager.v3.GetTagValueRequest").msgclass - GetNamespacedTagValueRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.resourcemanager.v3.GetNamespacedTagValueRequest").msgclass - CreateTagValueRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.resourcemanager.v3.CreateTagValueRequest").msgclass - CreateTagValueMetadata = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.resourcemanager.v3.CreateTagValueMetadata").msgclass - UpdateTagValueRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.resourcemanager.v3.UpdateTagValueRequest").msgclass - UpdateTagValueMetadata = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.resourcemanager.v3.UpdateTagValueMetadata").msgclass - DeleteTagValueRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.resourcemanager.v3.DeleteTagValueRequest").msgclass - DeleteTagValueMetadata = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.resourcemanager.v3.DeleteTagValueMetadata").msgclass - end - end - end -end diff --git a/owl-bot-staging/google-cloud-resource_manager-v3/lib/google/cloud/resourcemanager/v3/tag_values_services_pb.rb b/owl-bot-staging/google-cloud-resource_manager-v3/lib/google/cloud/resourcemanager/v3/tag_values_services_pb.rb deleted file mode 100644 index b1abd0a6ebbd..000000000000 --- a/owl-bot-staging/google-cloud-resource_manager-v3/lib/google/cloud/resourcemanager/v3/tag_values_services_pb.rb +++ /dev/null @@ -1,81 +0,0 @@ -# Generated by the protocol buffer compiler. DO NOT EDIT! -# Source: google/cloud/resourcemanager/v3/tag_values.proto for package 'Google.Cloud.ResourceManager.V3' -# Original file comments: -# 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 -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. -# - -require 'grpc' -require 'google/cloud/resourcemanager/v3/tag_values_pb' - -module Google - module Cloud - module ResourceManager - module V3 - module TagValues - # Allow users to create and manage tag values. - class Service - - include ::GRPC::GenericService - - self.marshal_class_method = :encode - self.unmarshal_class_method = :decode - self.service_name = 'google.cloud.resourcemanager.v3.TagValues' - - # Lists all TagValues for a specific TagKey. - rpc :ListTagValues, ::Google::Cloud::ResourceManager::V3::ListTagValuesRequest, ::Google::Cloud::ResourceManager::V3::ListTagValuesResponse - # Retrieves a TagValue. This method will return `PERMISSION_DENIED` if the - # value does not exist or the user does not have permission to view it. - rpc :GetTagValue, ::Google::Cloud::ResourceManager::V3::GetTagValueRequest, ::Google::Cloud::ResourceManager::V3::TagValue - # Retrieves a TagValue by its namespaced name. - # This method will return `PERMISSION_DENIED` if the value does not exist - # or the user does not have permission to view it. - rpc :GetNamespacedTagValue, ::Google::Cloud::ResourceManager::V3::GetNamespacedTagValueRequest, ::Google::Cloud::ResourceManager::V3::TagValue - # Creates a TagValue as a child of the specified TagKey. If a another - # request with the same parameters is sent while the original request is in - # process the second request will receive an error. A maximum of 1000 - # TagValues can exist under a TagKey at any given time. - rpc :CreateTagValue, ::Google::Cloud::ResourceManager::V3::CreateTagValueRequest, ::Google::Longrunning::Operation - # Updates the attributes of the TagValue resource. - rpc :UpdateTagValue, ::Google::Cloud::ResourceManager::V3::UpdateTagValueRequest, ::Google::Longrunning::Operation - # Deletes a TagValue. The TagValue cannot have any bindings when it is - # deleted. - rpc :DeleteTagValue, ::Google::Cloud::ResourceManager::V3::DeleteTagValueRequest, ::Google::Longrunning::Operation - # Gets the access control policy for a TagValue. The returned policy may be - # empty if no such policy or resource exists. The `resource` field should - # be the TagValue's resource name. For example: `tagValues/1234`. - # The caller must have the - # `cloudresourcemanager.googleapis.com/tagValues.getIamPolicy` permission on - # the identified TagValue to get the access control policy. - rpc :GetIamPolicy, ::Google::Iam::V1::GetIamPolicyRequest, ::Google::Iam::V1::Policy - # Sets the access control policy on a TagValue, replacing any existing - # policy. The `resource` field should be the TagValue's resource name. - # For example: `tagValues/1234`. - # The caller must have `resourcemanager.tagValues.setIamPolicy` permission - # on the identified tagValue. - rpc :SetIamPolicy, ::Google::Iam::V1::SetIamPolicyRequest, ::Google::Iam::V1::Policy - # Returns permissions that a caller has on the specified TagValue. - # The `resource` field should be the TagValue's resource name. For example: - # `tagValues/1234`. - # - # There are no permissions required for making this API call. - rpc :TestIamPermissions, ::Google::Iam::V1::TestIamPermissionsRequest, ::Google::Iam::V1::TestIamPermissionsResponse - end - - Stub = Service.rpc_stub_class - end - end - end - end -end diff --git a/owl-bot-staging/google-cloud-resource_manager-v3/proto_docs/README.md b/owl-bot-staging/google-cloud-resource_manager-v3/proto_docs/README.md deleted file mode 100644 index 0265d4e57b17..000000000000 --- a/owl-bot-staging/google-cloud-resource_manager-v3/proto_docs/README.md +++ /dev/null @@ -1,4 +0,0 @@ -# Resource Manager V3 Protocol Buffer Documentation - -These files are for the YARD documentation of the generated protobuf files. -They are not intended to be required or loaded at runtime. diff --git a/owl-bot-staging/google-cloud-resource_manager-v3/proto_docs/google/api/client.rb b/owl-bot-staging/google-cloud-resource_manager-v3/proto_docs/google/api/client.rb deleted file mode 100644 index 5089551e9ea4..000000000000 --- a/owl-bot-staging/google-cloud-resource_manager-v3/proto_docs/google/api/client.rb +++ /dev/null @@ -1,589 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - - -module Google - module Api - # Required information for every language. - # @!attribute [rw] reference_docs_uri - # @deprecated This field is deprecated and may be removed in the next major version update. - # @return [::String] - # Link to automatically generated reference documentation. Example: - # https://cloud.google.com/nodejs/docs/reference/asset/latest - # @!attribute [rw] destinations - # @return [::Array<::Google::Api::ClientLibraryDestination>] - # The destination where API teams want this client library to be published. - # @!attribute [rw] selective_gapic_generation - # @return [::Google::Api::SelectiveGapicGeneration] - # Configuration for which RPCs should be generated in the GAPIC client. - class CommonLanguageSettings - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Details about how and where to publish client libraries. - # @!attribute [rw] version - # @return [::String] - # Version of the API to apply these settings to. This is the full protobuf - # package for the API, ending in the version element. - # Examples: "google.cloud.speech.v1" and "google.spanner.admin.database.v1". - # @!attribute [rw] launch_stage - # @return [::Google::Api::LaunchStage] - # Launch stage of this version of the API. - # @!attribute [rw] rest_numeric_enums - # @return [::Boolean] - # When using transport=rest, the client request will encode enums as - # numbers rather than strings. - # @!attribute [rw] java_settings - # @return [::Google::Api::JavaSettings] - # Settings for legacy Java features, supported in the Service YAML. - # @!attribute [rw] cpp_settings - # @return [::Google::Api::CppSettings] - # Settings for C++ client libraries. - # @!attribute [rw] php_settings - # @return [::Google::Api::PhpSettings] - # Settings for PHP client libraries. - # @!attribute [rw] python_settings - # @return [::Google::Api::PythonSettings] - # Settings for Python client libraries. - # @!attribute [rw] node_settings - # @return [::Google::Api::NodeSettings] - # Settings for Node client libraries. - # @!attribute [rw] dotnet_settings - # @return [::Google::Api::DotnetSettings] - # Settings for .NET client libraries. - # @!attribute [rw] ruby_settings - # @return [::Google::Api::RubySettings] - # Settings for Ruby client libraries. - # @!attribute [rw] go_settings - # @return [::Google::Api::GoSettings] - # Settings for Go client libraries. - class ClientLibrarySettings - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # This message configures the settings for publishing [Google Cloud Client - # libraries](https://cloud.google.com/apis/docs/cloud-client-libraries) - # generated from the service config. - # @!attribute [rw] method_settings - # @return [::Array<::Google::Api::MethodSettings>] - # A list of API method settings, e.g. the behavior for methods that use the - # long-running operation pattern. - # @!attribute [rw] new_issue_uri - # @return [::String] - # Link to a *public* URI where users can report issues. Example: - # https://issuetracker.google.com/issues/new?component=190865&template=1161103 - # @!attribute [rw] documentation_uri - # @return [::String] - # Link to product home page. Example: - # https://cloud.google.com/asset-inventory/docs/overview - # @!attribute [rw] api_short_name - # @return [::String] - # Used as a tracking tag when collecting data about the APIs developer - # relations artifacts like docs, packages delivered to package managers, - # etc. Example: "speech". - # @!attribute [rw] github_label - # @return [::String] - # GitHub label to apply to issues and pull requests opened for this API. - # @!attribute [rw] codeowner_github_teams - # @return [::Array<::String>] - # GitHub teams to be added to CODEOWNERS in the directory in GitHub - # containing source code for the client libraries for this API. - # @!attribute [rw] doc_tag_prefix - # @return [::String] - # A prefix used in sample code when demarking regions to be included in - # documentation. - # @!attribute [rw] organization - # @return [::Google::Api::ClientLibraryOrganization] - # For whom the client library is being published. - # @!attribute [rw] library_settings - # @return [::Array<::Google::Api::ClientLibrarySettings>] - # Client library settings. If the same version string appears multiple - # times in this list, then the last one wins. Settings from earlier - # settings with the same version string are discarded. - # @!attribute [rw] proto_reference_documentation_uri - # @return [::String] - # Optional link to proto reference documentation. Example: - # https://cloud.google.com/pubsub/lite/docs/reference/rpc - # @!attribute [rw] rest_reference_documentation_uri - # @return [::String] - # Optional link to REST reference documentation. Example: - # https://cloud.google.com/pubsub/lite/docs/reference/rest - class Publishing - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Settings for Java client libraries. - # @!attribute [rw] library_package - # @return [::String] - # The package name to use in Java. Clobbers the java_package option - # set in the protobuf. This should be used **only** by APIs - # who have already set the language_settings.java.package_name" field - # in gapic.yaml. API teams should use the protobuf java_package option - # where possible. - # - # Example of a YAML configuration:: - # - # publishing: - # 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. - # @!attribute [rw] methods - # @return [::Array<::String>] - # An allowlist of the fully qualified names of RPCs that should be included - # on public client surfaces. - # @!attribute [rw] generate_omitted_as_internal - # @return [::Boolean] - # Setting this to true indicates to the client generators that methods - # that would be excluded from the generation should instead be generated - # in a way that indicates these methods should not be consumed by - # end users. How this is expressed is up to individual language - # implementations to decide. Some examples may be: added annotations, - # obfuscated identifiers, or other language idiomatic patterns. - class SelectiveGapicGeneration - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # `BatchingConfigProto` defines the batching configuration for an API method. - # @!attribute [rw] thresholds - # @return [::Google::Api::BatchingSettingsProto] - # The thresholds which trigger a batched request to be sent. - # @!attribute [rw] batch_descriptor - # @return [::Google::Api::BatchingDescriptorProto] - # The request and response fields used in batching. - class BatchingConfigProto - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # `BatchingSettingsProto` specifies a set of batching thresholds, each of - # which acts as a trigger to send a batch of messages as a request. At least - # one threshold must be positive nonzero. - # @!attribute [rw] element_count_threshold - # @return [::Integer] - # The number of elements of a field collected into a batch which, if - # exceeded, causes the batch to be sent. - # @!attribute [rw] request_byte_threshold - # @return [::Integer] - # The aggregated size of the batched field which, if exceeded, causes the - # batch to be sent. This size is computed by aggregating the sizes of the - # request field to be batched, not of the entire request message. - # @!attribute [rw] delay_threshold - # @return [::Google::Protobuf::Duration] - # The duration after which a batch should be sent, starting from the addition - # of the first message to that batch. - # @!attribute [rw] element_count_limit - # @return [::Integer] - # The maximum number of elements collected in a batch that could be accepted - # by server. - # @!attribute [rw] request_byte_limit - # @return [::Integer] - # The maximum size of the request that could be accepted by server. - # @!attribute [rw] flow_control_element_limit - # @return [::Integer] - # The maximum number of elements allowed by flow control. - # @!attribute [rw] flow_control_byte_limit - # @return [::Integer] - # The maximum size of data allowed by flow control. - # @!attribute [rw] flow_control_limit_exceeded_behavior - # @return [::Google::Api::FlowControlLimitExceededBehaviorProto] - # The behavior to take when the flow control limit is exceeded. - class BatchingSettingsProto - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # `BatchingDescriptorProto` specifies the fields of the request message to be - # used for batching, and, optionally, the fields of the response message to be - # used for demultiplexing. - # @!attribute [rw] batched_field - # @return [::String] - # The repeated field in the request message to be aggregated by batching. - # @!attribute [rw] discriminator_fields - # @return [::Array<::String>] - # A list of the fields in the request message. Two requests will be batched - # together only if the values of every field specified in - # `request_discriminator_fields` is equal between the two requests. - # @!attribute [rw] subresponse_field - # @return [::String] - # Optional. When present, indicates the field in the response message to be - # used to demultiplex the response into multiple response messages, in - # correspondence with the multiple request messages originally batched - # together. - class BatchingDescriptorProto - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # The organization for which the client libraries are being published. - # Affects the url where generated docs are published, etc. - module ClientLibraryOrganization - # Not useful. - CLIENT_LIBRARY_ORGANIZATION_UNSPECIFIED = 0 - - # Google Cloud Platform Org. - CLOUD = 1 - - # Ads (Advertising) Org. - ADS = 2 - - # Photos Org. - PHOTOS = 3 - - # Street View Org. - STREET_VIEW = 4 - - # Shopping Org. - SHOPPING = 5 - - # Geo Org. - GEO = 6 - - # Generative AI - https://developers.generativeai.google - GENERATIVE_AI = 7 - end - - # To where should client libraries be published? - module ClientLibraryDestination - # Client libraries will neither be generated nor published to package - # managers. - CLIENT_LIBRARY_DESTINATION_UNSPECIFIED = 0 - - # Generate the client library in a repo under github.com/googleapis, - # but don't publish it to package managers. - GITHUB = 10 - - # Publish the library to package managers like nuget.org and npmjs.com. - PACKAGE_MANAGER = 20 - end - - # The behavior to take when the flow control limit is exceeded. - module FlowControlLimitExceededBehaviorProto - # Default behavior, system-defined. - UNSET_BEHAVIOR = 0 - - # Stop operation, raise error. - THROW_EXCEPTION = 1 - - # Pause operation until limit clears. - BLOCK = 2 - - # Continue operation, disregard limit. - IGNORE = 3 - end - end -end diff --git a/owl-bot-staging/google-cloud-resource_manager-v3/proto_docs/google/api/field_behavior.rb b/owl-bot-staging/google-cloud-resource_manager-v3/proto_docs/google/api/field_behavior.rb deleted file mode 100644 index 582be187d115..000000000000 --- a/owl-bot-staging/google-cloud-resource_manager-v3/proto_docs/google/api/field_behavior.rb +++ /dev/null @@ -1,85 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - - -module Google - module Api - # An indicator of the behavior of a given field (for example, that a field - # is required in requests, or given as output but ignored as input). - # This **does not** change the behavior in protocol buffers itself; it only - # denotes the behavior and may affect how API tooling handles the field. - # - # Note: This enum **may** receive new values in the future. - module FieldBehavior - # Conventional default for enums. Do not use this. - FIELD_BEHAVIOR_UNSPECIFIED = 0 - - # Specifically denotes a field as optional. - # While all fields in protocol buffers are optional, this may be specified - # for emphasis if appropriate. - OPTIONAL = 1 - - # Denotes a field as required. - # This indicates that the field **must** be provided as part of the request, - # and failure to do so will cause an error (usually `INVALID_ARGUMENT`). - REQUIRED = 2 - - # Denotes a field as output only. - # This indicates that the field is provided in responses, but including the - # field in a request does nothing (the server *must* ignore it and - # *must not* throw an error as a result of the field's presence). - OUTPUT_ONLY = 3 - - # Denotes a field as input only. - # This indicates that the field is provided in requests, and the - # corresponding field is not included in output. - INPUT_ONLY = 4 - - # Denotes a field as immutable. - # This indicates that the field may be set once in a request to create a - # resource, but may not be changed thereafter. - IMMUTABLE = 5 - - # Denotes that a (repeated) field is an unordered list. - # This indicates that the service may provide the elements of the list - # in any arbitrary order, rather than the order the user originally - # provided. Additionally, the list's order may or may not be stable. - UNORDERED_LIST = 6 - - # Denotes that this field returns a non-empty default value if not set. - # This indicates that if the user provides the empty value in a request, - # a non-empty value will be returned. The user will not be aware of what - # non-empty value to expect. - NON_EMPTY_DEFAULT = 7 - - # Denotes that the field in a resource (a message annotated with - # google.api.resource) is used in the resource name to uniquely identify the - # resource. For AIP-compliant APIs, this should only be applied to the - # `name` field on the resource. - # - # This behavior should not be applied to references to other resources within - # the message. - # - # The identifier field of resources often have different field behavior - # depending on the request it is embedded in (e.g. for Create methods name - # is optional and unused, while for Update methods it is required). Instead - # of method-specific annotations, only `IDENTIFIER` is required. - IDENTIFIER = 8 - end - end -end diff --git a/owl-bot-staging/google-cloud-resource_manager-v3/proto_docs/google/api/launch_stage.rb b/owl-bot-staging/google-cloud-resource_manager-v3/proto_docs/google/api/launch_stage.rb deleted file mode 100644 index 9392a413fb1b..000000000000 --- a/owl-bot-staging/google-cloud-resource_manager-v3/proto_docs/google/api/launch_stage.rb +++ /dev/null @@ -1,71 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - - -module Google - module Api - # The launch stage as defined by [Google Cloud Platform - # Launch Stages](https://cloud.google.com/terms/launch-stages). - module LaunchStage - # Do not use this default value. - LAUNCH_STAGE_UNSPECIFIED = 0 - - # The feature is not yet implemented. Users can not use it. - UNIMPLEMENTED = 6 - - # Prelaunch features are hidden from users and are only visible internally. - PRELAUNCH = 7 - - # Early Access features are limited to a closed group of testers. To use - # these features, you must sign up in advance and sign a Trusted Tester - # agreement (which includes confidentiality provisions). These features may - # be unstable, changed in backward-incompatible ways, and are not - # guaranteed to be released. - EARLY_ACCESS = 1 - - # Alpha is a limited availability test for releases before they are cleared - # for widespread use. By Alpha, all significant design issues are resolved - # and we are in the process of verifying functionality. Alpha customers - # need to apply for access, agree to applicable terms, and have their - # projects allowlisted. Alpha releases don't have to be feature complete, - # no SLAs are provided, and there are no technical support obligations, but - # they will be far enough along that customers can actually use them in - # test environments or for limited-use tests -- just like they would in - # normal production cases. - ALPHA = 2 - - # Beta is the point at which we are ready to open a release for any - # customer to use. There are no SLA or technical support obligations in a - # Beta release. Products will be complete from a feature perspective, but - # may have some open outstanding issues. Beta releases are suitable for - # limited production use cases. - BETA = 3 - - # GA features are open to all developers and are considered stable and - # fully qualified for production use. - GA = 4 - - # Deprecated features are scheduled to be shut down and removed. For more - # information, see the "Deprecation Policy" section of our [Terms of - # Service](https://cloud.google.com/terms/) - # and the [Google Cloud Platform Subject to the Deprecation - # Policy](https://cloud.google.com/terms/deprecation) documentation. - DEPRECATED = 5 - end - end -end diff --git a/owl-bot-staging/google-cloud-resource_manager-v3/proto_docs/google/api/resource.rb b/owl-bot-staging/google-cloud-resource_manager-v3/proto_docs/google/api/resource.rb deleted file mode 100644 index 25dec4847ac1..000000000000 --- a/owl-bot-staging/google-cloud-resource_manager-v3/proto_docs/google/api/resource.rb +++ /dev/null @@ -1,227 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - - -module Google - module Api - # A simple descriptor of a resource type. - # - # ResourceDescriptor annotates a resource message (either by means of a - # protobuf annotation or use in the service config), and associates the - # resource's schema, the resource type, and the pattern of the resource name. - # - # Example: - # - # message Topic { - # // Indicates this message defines a resource schema. - # // Declares the resource type in the format of {service}/{kind}. - # // For Kubernetes resources, the format is {api group}/{kind}. - # option (google.api.resource) = { - # type: "pubsub.googleapis.com/Topic" - # pattern: "projects/{project}/topics/{topic}" - # }; - # } - # - # The ResourceDescriptor Yaml config will look like: - # - # resources: - # - type: "pubsub.googleapis.com/Topic" - # pattern: "projects/{project}/topics/{topic}" - # - # Sometimes, resources have multiple patterns, typically because they can - # live under multiple parents. - # - # Example: - # - # message LogEntry { - # option (google.api.resource) = { - # type: "logging.googleapis.com/LogEntry" - # pattern: "projects/{project}/logs/{log}" - # pattern: "folders/{folder}/logs/{log}" - # pattern: "organizations/{organization}/logs/{log}" - # pattern: "billingAccounts/{billing_account}/logs/{log}" - # }; - # } - # - # The ResourceDescriptor Yaml config will look like: - # - # resources: - # - type: 'logging.googleapis.com/LogEntry' - # pattern: "projects/{project}/logs/{log}" - # pattern: "folders/{folder}/logs/{log}" - # pattern: "organizations/{organization}/logs/{log}" - # pattern: "billingAccounts/{billing_account}/logs/{log}" - # @!attribute [rw] type - # @return [::String] - # The resource type. It must be in the format of - # \\{service_name}/\\{resource_type_kind}. The `resource_type_kind` must be - # singular and must not include version numbers. - # - # Example: `storage.googleapis.com/Bucket` - # - # The value of the resource_type_kind must follow the regular expression - # /[A-Za-z][a-zA-Z0-9]+/. It should start with an upper case character and - # should use PascalCase (UpperCamelCase). The maximum number of - # characters allowed for the `resource_type_kind` is 100. - # @!attribute [rw] pattern - # @return [::Array<::String>] - # Optional. The relative resource name pattern associated with this resource - # type. The DNS prefix of the full resource name shouldn't be specified here. - # - # The path pattern must follow the syntax, which aligns with HTTP binding - # syntax: - # - # Template = Segment { "/" Segment } ; - # Segment = LITERAL | Variable ; - # Variable = "{" LITERAL "}" ; - # - # Examples: - # - # - "projects/\\{project}/topics/\\{topic}" - # - "projects/\\{project}/knowledgeBases/\\{knowledge_base}" - # - # The components in braces correspond to the IDs for each resource in the - # hierarchy. It is expected that, if multiple patterns are provided, - # the same component name (e.g. "project") refers to IDs of the same - # type of resource. - # @!attribute [rw] name_field - # @return [::String] - # Optional. The field on the resource that designates the resource name - # field. If omitted, this is assumed to be "name". - # @!attribute [rw] history - # @return [::Google::Api::ResourceDescriptor::History] - # Optional. The historical or future-looking state of the resource pattern. - # - # Example: - # - # // The InspectTemplate message originally only supported resource - # // names with organization, and project was added later. - # message InspectTemplate { - # option (google.api.resource) = { - # type: "dlp.googleapis.com/InspectTemplate" - # pattern: - # "organizations/{organization}/inspectTemplates/{inspect_template}" - # pattern: "projects/{project}/inspectTemplates/{inspect_template}" - # history: ORIGINALLY_SINGLE_PATTERN - # }; - # } - # @!attribute [rw] plural - # @return [::String] - # The plural name used in the resource name and permission names, such as - # 'projects' for the resource name of 'projects/\\{project}' and the permission - # name of 'cloudresourcemanager.googleapis.com/projects.get'. One exception - # to this is for Nested Collections that have stuttering names, as defined - # in [AIP-122](https://google.aip.dev/122#nested-collections), where the - # collection ID in the resource name pattern does not necessarily directly - # match the `plural` value. - # - # It is the same concept of the `plural` field in k8s CRD spec - # https://kubernetes.io/docs/tasks/access-kubernetes-api/custom-resources/custom-resource-definitions/ - # - # Note: The plural form is required even for singleton resources. See - # https://aip.dev/156 - # @!attribute [rw] singular - # @return [::String] - # The same concept of the `singular` field in k8s CRD spec - # https://kubernetes.io/docs/tasks/access-kubernetes-api/custom-resources/custom-resource-definitions/ - # Such as "project" for the `resourcemanager.googleapis.com/Project` type. - # @!attribute [rw] style - # @return [::Array<::Google::Api::ResourceDescriptor::Style>] - # Style flag(s) for this resource. - # These indicate that a resource is expected to conform to a given - # style. See the specific style flags for additional information. - class ResourceDescriptor - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - - # A description of the historical or future-looking state of the - # resource pattern. - module History - # The "unset" value. - HISTORY_UNSPECIFIED = 0 - - # The resource originally had one pattern and launched as such, and - # additional patterns were added later. - ORIGINALLY_SINGLE_PATTERN = 1 - - # The resource has one pattern, but the API owner expects to add more - # later. (This is the inverse of ORIGINALLY_SINGLE_PATTERN, and prevents - # that from being necessary once there are multiple patterns.) - FUTURE_MULTI_PATTERN = 2 - end - - # A flag representing a specific style that a resource claims to conform to. - module Style - # The unspecified value. Do not use. - STYLE_UNSPECIFIED = 0 - - # This resource is intended to be "declarative-friendly". - # - # Declarative-friendly resources must be more strictly consistent, and - # setting this to true communicates to tools that this resource should - # adhere to declarative-friendly expectations. - # - # Note: This is used by the API linter (linter.aip.dev) to enable - # additional checks. - DECLARATIVE_FRIENDLY = 1 - end - end - - # Defines a proto annotation that describes a string field that refers to - # an API resource. - # @!attribute [rw] type - # @return [::String] - # The resource type that the annotated field references. - # - # Example: - # - # message Subscription { - # string topic = 2 [(google.api.resource_reference) = { - # type: "pubsub.googleapis.com/Topic" - # }]; - # } - # - # Occasionally, a field may reference an arbitrary resource. In this case, - # APIs use the special value * in their resource reference. - # - # Example: - # - # message GetIamPolicyRequest { - # string resource = 2 [(google.api.resource_reference) = { - # type: "*" - # }]; - # } - # @!attribute [rw] child_type - # @return [::String] - # The resource type of a child collection that the annotated field - # references. This is useful for annotating the `parent` field that - # doesn't have a fixed resource type. - # - # Example: - # - # message ListLogEntriesRequest { - # string parent = 1 [(google.api.resource_reference) = { - # child_type: "logging.googleapis.com/LogEntry" - # }; - # } - class ResourceReference - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - end -end diff --git a/owl-bot-staging/google-cloud-resource_manager-v3/proto_docs/google/cloud/resourcemanager/v3/folders.rb b/owl-bot-staging/google-cloud-resource_manager-v3/proto_docs/google/cloud/resourcemanager/v3/folders.rb deleted file mode 100644 index d5ca09d8579e..000000000000 --- a/owl-bot-staging/google-cloud-resource_manager-v3/proto_docs/google/cloud/resourcemanager/v3/folders.rb +++ /dev/null @@ -1,315 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - - -module Google - module Cloud - module ResourceManager - module V3 - # A folder in an organization's resource hierarchy, used to - # organize that organization's resources. - # @!attribute [r] name - # @return [::String] - # Output only. The resource name of the folder. - # Its format is `folders/{folder_id}`, for example: "folders/1234". - # @!attribute [rw] parent - # @return [::String] - # Required. The folder's parent's resource name. - # Updates to the folder's parent must be performed using - # {::Google::Cloud::ResourceManager::V3::Folders::Client#move_folder MoveFolder}. - # @!attribute [rw] display_name - # @return [::String] - # The folder's display name. - # A folder's display name must be unique amongst its siblings. For example, - # no two folders with the same parent can share the same display name. - # The display name must start and end with a letter or digit, may contain - # letters, digits, spaces, hyphens and underscores and can be no longer - # than 30 characters. This is captured by the regular expression: - # `[\p{L}\p{N}]([\p{L}\p{N}_- ]{0,28}[\p{L}\p{N}])?`. - # @!attribute [r] state - # @return [::Google::Cloud::ResourceManager::V3::Folder::State] - # Output only. The lifecycle state of the folder. - # Updates to the state must be performed using - # {::Google::Cloud::ResourceManager::V3::Folders::Client#delete_folder DeleteFolder} and - # {::Google::Cloud::ResourceManager::V3::Folders::Client#undelete_folder UndeleteFolder}. - # @!attribute [r] create_time - # @return [::Google::Protobuf::Timestamp] - # Output only. Timestamp when the folder was created. - # @!attribute [r] update_time - # @return [::Google::Protobuf::Timestamp] - # Output only. Timestamp when the folder was last modified. - # @!attribute [r] delete_time - # @return [::Google::Protobuf::Timestamp] - # Output only. Timestamp when the folder was requested to be deleted. - # @!attribute [r] etag - # @return [::String] - # Output only. A checksum computed by the server based on the current value - # of the folder resource. This may be sent on update and delete requests to - # ensure the client has an up-to-date value before proceeding. - class Folder - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - - # Folder lifecycle states. - module State - # Unspecified state. - STATE_UNSPECIFIED = 0 - - # The normal and active state. - ACTIVE = 1 - - # The folder has been marked for deletion by the user. - DELETE_REQUESTED = 2 - end - end - - # The GetFolder request message. - # @!attribute [rw] name - # @return [::String] - # Required. The resource name of the folder to retrieve. - # Must be of the form `folders/{folder_id}`. - class GetFolderRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # The ListFolders request message. - # @!attribute [rw] parent - # @return [::String] - # Required. The name of the parent resource whose folders are being listed. - # Only children of this parent resource are listed; descendants are not - # listed. - # - # If the parent is a folder, use the value `folders/{folder_id}`. If the - # parent is an organization, use the value `organizations/{org_id}`. - # - # Access to this method is controlled by checking the - # `resourcemanager.folders.list` permission on the `parent`. - # @!attribute [rw] page_size - # @return [::Integer] - # Optional. The maximum number of folders to return in the response. The - # server can return fewer folders than requested. If unspecified, server - # picks an appropriate default. - # @!attribute [rw] page_token - # @return [::String] - # Optional. A pagination token returned from a previous call to `ListFolders` - # that indicates where this listing should continue from. - # @!attribute [rw] show_deleted - # @return [::Boolean] - # Optional. Controls whether folders in the - # {::Google::Cloud::ResourceManager::V3::Folder::State::DELETE_REQUESTED DELETE_REQUESTED} - # state should be returned. Defaults to false. - class ListFoldersRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # The ListFolders response message. - # @!attribute [rw] folders - # @return [::Array<::Google::Cloud::ResourceManager::V3::Folder>] - # A possibly paginated list of folders that are direct descendants of - # the specified parent resource. - # @!attribute [rw] next_page_token - # @return [::String] - # A pagination token returned from a previous call to `ListFolders` - # that indicates from where listing should continue. - class ListFoldersResponse - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # The request message for searching folders. - # @!attribute [rw] page_size - # @return [::Integer] - # Optional. The maximum number of folders to return in the response. The - # server can return fewer folders than requested. If unspecified, server - # picks an appropriate default. - # @!attribute [rw] page_token - # @return [::String] - # Optional. A pagination token returned from a previous call to - # `SearchFolders` that indicates from where search should continue. - # @!attribute [rw] query - # @return [::String] - # Optional. Search criteria used to select the folders to return. - # If no search criteria is specified then all accessible folders will be - # returned. - # - # Query expressions can be used to restrict results based upon displayName, - # state and parent, where the operators `=` (`:`) `NOT`, `AND` and `OR` - # can be used along with the suffix wildcard symbol `*`. - # - # The `displayName` field in a query expression should use escaped quotes - # for values that include whitespace to prevent unexpected behavior. - # - # ``` - # | Field | Description | - # |-------------------------|----------------------------------------| - # | displayName | Filters by displayName. | - # | parent | Filters by parent (for example: folders/123). | - # | state, lifecycleState | Filters by state. | - # ``` - # - # Some example queries are: - # - # * Query `displayName=Test*` returns Folder resources whose display name - # starts with "Test". - # * Query `state=ACTIVE` returns Folder resources with - # `state` set to `ACTIVE`. - # * Query `parent=folders/123` returns Folder resources that have - # `folders/123` as a parent resource. - # * Query `parent=folders/123 AND state=ACTIVE` returns active - # Folder resources that have `folders/123` as a parent resource. - # * Query `displayName=\\"Test String\\"` returns Folder resources with - # display names that include both "Test" and "String". - class SearchFoldersRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # The response message for searching folders. - # @!attribute [rw] folders - # @return [::Array<::Google::Cloud::ResourceManager::V3::Folder>] - # A possibly paginated folder search results. - # the specified parent resource. - # @!attribute [rw] next_page_token - # @return [::String] - # A pagination token returned from a previous call to `SearchFolders` - # that indicates from where searching should continue. - class SearchFoldersResponse - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # The CreateFolder request message. - # @!attribute [rw] folder - # @return [::Google::Cloud::ResourceManager::V3::Folder] - # Required. The folder being created, only the display name and parent will - # be consulted. All other fields will be ignored. - class CreateFolderRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Metadata pertaining to the Folder creation process. - # @!attribute [rw] display_name - # @return [::String] - # The display name of the folder. - # @!attribute [rw] parent - # @return [::String] - # The resource name of the folder or organization we are creating the folder - # under. - class CreateFolderMetadata - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # The request sent to the - # [UpdateFolder][google.cloud.resourcemanager.v3.Folder.UpdateFolder] - # method. - # - # Only the `display_name` field can be changed. All other fields will be - # ignored. Use the - # {::Google::Cloud::ResourceManager::V3::Folders::Client#move_folder MoveFolder} method to - # change the `parent` field. - # @!attribute [rw] folder - # @return [::Google::Cloud::ResourceManager::V3::Folder] - # Required. The new definition of the Folder. It must include the `name` - # field, which cannot be changed. - # @!attribute [rw] update_mask - # @return [::Google::Protobuf::FieldMask] - # Required. Fields to be updated. - # Only the `display_name` can be updated. - class UpdateFolderRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # A status object which is used as the `metadata` field for the Operation - # returned by UpdateFolder. - class UpdateFolderMetadata - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # The MoveFolder request message. - # @!attribute [rw] name - # @return [::String] - # Required. The resource name of the Folder to move. - # Must be of the form folders/\\{folder_id} - # @!attribute [rw] destination_parent - # @return [::String] - # Required. The resource name of the folder or organization which should be - # the folder's new parent. Must be of the form `folders/{folder_id}` or - # `organizations/{org_id}`. - class MoveFolderRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Metadata pertaining to the folder move process. - # @!attribute [rw] display_name - # @return [::String] - # The display name of the folder. - # @!attribute [rw] source_parent - # @return [::String] - # The resource name of the folder's parent. - # @!attribute [rw] destination_parent - # @return [::String] - # The resource name of the folder or organization to move the folder to. - class MoveFolderMetadata - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # The DeleteFolder request message. - # @!attribute [rw] name - # @return [::String] - # Required. The resource name of the folder to be deleted. - # Must be of the form `folders/{folder_id}`. - class DeleteFolderRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # A status object which is used as the `metadata` field for the `Operation` - # returned by `DeleteFolder`. - class DeleteFolderMetadata - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # The UndeleteFolder request message. - # @!attribute [rw] name - # @return [::String] - # Required. The resource name of the folder to undelete. - # Must be of the form `folders/{folder_id}`. - class UndeleteFolderRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # A status object which is used as the `metadata` field for the `Operation` - # returned by `UndeleteFolder`. - class UndeleteFolderMetadata - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - end - end - end -end diff --git a/owl-bot-staging/google-cloud-resource_manager-v3/proto_docs/google/cloud/resourcemanager/v3/organizations.rb b/owl-bot-staging/google-cloud-resource_manager-v3/proto_docs/google/cloud/resourcemanager/v3/organizations.rb deleted file mode 100644 index 6133679362e8..000000000000 --- a/owl-bot-staging/google-cloud-resource_manager-v3/proto_docs/google/cloud/resourcemanager/v3/organizations.rb +++ /dev/null @@ -1,155 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - - -module Google - module Cloud - module ResourceManager - module V3 - # The root node in the resource hierarchy to which a particular entity's - # (a company, for example) resources belong. - # @!attribute [r] name - # @return [::String] - # Output only. The resource name of the organization. This is the - # organization's relative path in the API. Its format is - # "organizations/[organization_id]". For example, "organizations/1234". - # @!attribute [r] display_name - # @return [::String] - # Output only. A human-readable string that refers to the organization in the - # Google Cloud Console. This string is set by the server and cannot be - # changed. The string will be set to the primary domain (for example, - # "google.com") of the Google Workspace customer that owns the organization. - # @!attribute [rw] directory_customer_id - # @return [::String] - # Immutable. The G Suite / Workspace customer id used in the Directory API. - # @!attribute [r] state - # @return [::Google::Cloud::ResourceManager::V3::Organization::State] - # Output only. The organization's current lifecycle state. - # @!attribute [r] create_time - # @return [::Google::Protobuf::Timestamp] - # Output only. Timestamp when the Organization was created. - # @!attribute [r] update_time - # @return [::Google::Protobuf::Timestamp] - # Output only. Timestamp when the Organization was last modified. - # @!attribute [r] delete_time - # @return [::Google::Protobuf::Timestamp] - # Output only. Timestamp when the Organization was requested for deletion. - # @!attribute [r] etag - # @return [::String] - # Output only. A checksum computed by the server based on the current value - # of the Organization resource. This may be sent on update and delete - # requests to ensure the client has an up-to-date value before proceeding. - class Organization - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - - # Organization lifecycle states. - module State - # Unspecified state. This is only useful for distinguishing unset values. - STATE_UNSPECIFIED = 0 - - # The normal and active state. - ACTIVE = 1 - - # The organization has been marked for deletion by the user. - DELETE_REQUESTED = 2 - end - end - - # The request sent to the `GetOrganization` method. The `name` field is - # required. `organization_id` is no longer accepted. - # @!attribute [rw] name - # @return [::String] - # Required. The resource name of the Organization to fetch. This is the - # organization's relative path in the API, formatted as - # "organizations/[organizationId]". For example, "organizations/1234". - class GetOrganizationRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # The request sent to the `SearchOrganizations` method. - # @!attribute [rw] page_size - # @return [::Integer] - # Optional. The maximum number of organizations to return in the response. - # The server can return fewer organizations than requested. If unspecified, - # server picks an appropriate default. - # @!attribute [rw] page_token - # @return [::String] - # Optional. A pagination token returned from a previous call to - # `SearchOrganizations` that indicates from where listing should continue. - # @!attribute [rw] query - # @return [::String] - # Optional. An optional query string used to filter the Organizations to - # return in the response. Query rules are case-insensitive. - # - # - # ``` - # | Field | Description | - # |------------------|--------------------------------------------| - # | directoryCustomerId, owner.directoryCustomerId | Filters by directory - # customer id. | - # | domain | Filters by domain. | - # ``` - # - # Organizations may be queried by `directoryCustomerId` or by - # `domain`, where the domain is a G Suite domain, for example: - # - # * Query `directorycustomerid:123456789` returns Organization - # resources with `owner.directory_customer_id` equal to `123456789`. - # * Query `domain:google.com` returns Organization resources corresponding - # to the domain `google.com`. - class SearchOrganizationsRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # The response returned from the `SearchOrganizations` method. - # @!attribute [rw] organizations - # @return [::Array<::Google::Cloud::ResourceManager::V3::Organization>] - # The list of Organizations that matched the search query, possibly - # paginated. - # @!attribute [rw] next_page_token - # @return [::String] - # A pagination token to be used to retrieve the next page of results. If the - # result is too large to fit within the page size specified in the request, - # this field will be set with a token that can be used to fetch the next page - # of results. If this field is empty, it indicates that this response - # contains the last page of results. - class SearchOrganizationsResponse - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # A status object which is used as the `metadata` field for the operation - # returned by DeleteOrganization. - class DeleteOrganizationMetadata - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # A status object which is used as the `metadata` field for the Operation - # returned by UndeleteOrganization. - class UndeleteOrganizationMetadata - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - end - end - end -end diff --git a/owl-bot-staging/google-cloud-resource_manager-v3/proto_docs/google/cloud/resourcemanager/v3/projects.rb b/owl-bot-staging/google-cloud-resource_manager-v3/proto_docs/google/cloud/resourcemanager/v3/projects.rb deleted file mode 100644 index 24e7433803a9..000000000000 --- a/owl-bot-staging/google-cloud-resource_manager-v3/proto_docs/google/cloud/resourcemanager/v3/projects.rb +++ /dev/null @@ -1,395 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - - -module Google - module Cloud - module ResourceManager - module V3 - # A project is a high-level Google Cloud entity. It is a - # container for ACLs, APIs, App Engine Apps, VMs, and other - # Google Cloud Platform resources. - # @!attribute [r] name - # @return [::String] - # Output only. The unique resource name of the project. It is an int64 - # generated number prefixed by "projects/". - # - # Example: `projects/415104041262` - # @!attribute [rw] parent - # @return [::String] - # Optional. A reference to a parent Resource. eg., `organizations/123` or - # `folders/876`. - # @!attribute [rw] project_id - # @return [::String] - # Immutable. The unique, user-assigned id of the project. - # It must be 6 to 30 lowercase ASCII letters, digits, or hyphens. - # It must start with a letter. - # Trailing hyphens are prohibited. - # - # Example: `tokyo-rain-123` - # @!attribute [r] state - # @return [::Google::Cloud::ResourceManager::V3::Project::State] - # Output only. The project lifecycle state. - # @!attribute [rw] display_name - # @return [::String] - # Optional. A user-assigned display name of the project. - # When present it must be between 4 to 30 characters. - # Allowed characters are: lowercase and uppercase letters, numbers, - # hyphen, single-quote, double-quote, space, and exclamation point. - # - # Example: `My Project` - # @!attribute [r] create_time - # @return [::Google::Protobuf::Timestamp] - # Output only. Creation time. - # @!attribute [r] update_time - # @return [::Google::Protobuf::Timestamp] - # Output only. The most recent time this resource was modified. - # @!attribute [r] delete_time - # @return [::Google::Protobuf::Timestamp] - # Output only. The time at which this resource was requested for deletion. - # @!attribute [r] etag - # @return [::String] - # Output only. A checksum computed by the server based on the current value - # of the Project resource. This may be sent on update and delete requests to - # ensure the client has an up-to-date value before proceeding. - # @!attribute [rw] labels - # @return [::Google::Protobuf::Map{::String => ::String}] - # Optional. The labels associated with this project. - # - # Label keys must be between 1 and 63 characters long and must conform - # to the following regular expression: \[a-z\](\[-a-z0-9\]*\[a-z0-9\])?. - # - # Label values must be between 0 and 63 characters long and must conform - # to the regular expression (\[a-z\](\[-a-z0-9\]*\[a-z0-9\])?)?. - # - # No more than 64 labels can be associated with a given resource. - # - # Clients should store labels in a representation such as JSON that does not - # depend on specific characters being disallowed. - # - # Example: `"myBusinessDimension" : "businessValue"` - class Project - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - - # @!attribute [rw] key - # @return [::String] - # @!attribute [rw] value - # @return [::String] - class LabelsEntry - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Project lifecycle states. - module State - # Unspecified state. This is only used/useful for distinguishing - # unset values. - STATE_UNSPECIFIED = 0 - - # The normal and active state. - ACTIVE = 1 - - # The project has been marked for deletion by the user - # (by invoking - # {::Google::Cloud::ResourceManager::V3::Projects::Client#delete_project DeleteProject}) - # or by the system (Google Cloud Platform). - # This can generally be reversed by invoking [UndeleteProject] - # [google.cloud.resourcemanager.v3.Projects.UndeleteProject]. - DELETE_REQUESTED = 2 - end - end - - # The request sent to the - # {::Google::Cloud::ResourceManager::V3::Projects::Client#get_project GetProject} - # method. - # @!attribute [rw] name - # @return [::String] - # Required. The name of the project (for example, `projects/415104041262`). - class GetProjectRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # The request sent to the - # {::Google::Cloud::ResourceManager::V3::Projects::Client#list_projects ListProjects} - # method. - # @!attribute [rw] parent - # @return [::String] - # Required. The name of the parent resource whose projects are being listed. - # Only children of this parent resource are listed; descendants are not - # listed. - # - # If the parent is a folder, use the value `folders/{folder_id}`. If the - # parent is an organization, use the value `organizations/{org_id}`. - # @!attribute [rw] page_token - # @return [::String] - # Optional. A pagination token returned from a previous call to - # [ListProjects] [google.cloud.resourcemanager.v3.Projects.ListProjects] that - # indicates from where listing should continue. - # @!attribute [rw] page_size - # @return [::Integer] - # Optional. The maximum number of projects to return in the response. - # The server can return fewer projects than requested. - # If unspecified, server picks an appropriate default. - # @!attribute [rw] show_deleted - # @return [::Boolean] - # Optional. Indicate that projects in the `DELETE_REQUESTED` state should - # also be returned. Normally only `ACTIVE` projects are returned. - class ListProjectsRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # A page of the response received from the - # {::Google::Cloud::ResourceManager::V3::Projects::Client#list_projects ListProjects} - # method. - # - # A paginated response where more pages are available has - # `next_page_token` set. This token can be used in a subsequent request to - # retrieve the next request page. - # - # NOTE: A response may contain fewer elements than the request `page_size` and - # still have a `next_page_token`. - # @!attribute [rw] projects - # @return [::Array<::Google::Cloud::ResourceManager::V3::Project>] - # The list of Projects under the parent. This list can be paginated. - # @!attribute [rw] next_page_token - # @return [::String] - # Pagination token. - # - # If the result set is too large to fit in a single response, this token - # is returned. It encodes the position of the current result cursor. - # Feeding this value into a new list request with the `page_token` parameter - # gives the next page of the results. - # - # When `next_page_token` is not filled in, there is no next page and - # the list returned is the last page in the result set. - # - # Pagination tokens have a limited lifetime. - class ListProjectsResponse - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # The request sent to the - # {::Google::Cloud::ResourceManager::V3::Projects::Client#search_projects SearchProjects} - # method. - # @!attribute [rw] query - # @return [::String] - # Optional. A query string for searching for projects that the caller has - # `resourcemanager.projects.get` permission to. If multiple fields are - # included in the query, then it will return results that match any of the - # fields. Some eligible fields are: - # - # - **`displayName`, `name`**: Filters by displayName. - # - **`parent`**: Project's parent (for example: `folders/123`, - # `organizations/*`). Prefer `parent` field over `parent.type` and - # `parent.id`. - # - **`parent.type`**: Parent's type: `folder` or `organization`. - # - **`parent.id`**: Parent's id number (for example: `123`). - # - **`id`, `projectId`**: Filters by projectId. - # - **`state`, `lifecycleState`**: Filters by state. - # - **`labels`**: Filters by label name or value. - # - **`labels.` (where `` is the name of a label)**: Filters by label - # name. - # - # Search expressions are case insensitive. - # - # Some examples queries: - # - # - # - **`name:how*`**: The project's name starts with "how". - # - **`name:Howl`**: The project's name is `Howl` or `howl`. - # - **`name:HOWL`**: Equivalent to above. - # - **`NAME:howl`**: Equivalent to above. - # - **`labels.color:*`**: The project has the label `color`. - # - **`labels.color:red`**: The project's label `color` has the value `red`. - # - **`labels.color:red labels.size:big`**: The project's label `color` has - # the value `red` or its label `size` has the value `big`. - # - # If no query is specified, the call will return projects for which the user - # has the `resourcemanager.projects.get` permission. - # @!attribute [rw] page_token - # @return [::String] - # Optional. A pagination token returned from a previous call to - # [ListProjects] [google.cloud.resourcemanager.v3.Projects.ListProjects] that - # indicates from where listing should continue. - # @!attribute [rw] page_size - # @return [::Integer] - # Optional. The maximum number of projects to return in the response. - # The server can return fewer projects than requested. - # If unspecified, server picks an appropriate default. - class SearchProjectsRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # A page of the response received from the - # {::Google::Cloud::ResourceManager::V3::Projects::Client#search_projects SearchProjects} - # method. - # - # A paginated response where more pages are available has - # `next_page_token` set. This token can be used in a subsequent request to - # retrieve the next request page. - # @!attribute [rw] projects - # @return [::Array<::Google::Cloud::ResourceManager::V3::Project>] - # The list of Projects that matched the list filter query. This list can - # be paginated. - # @!attribute [rw] next_page_token - # @return [::String] - # Pagination token. - # - # If the result set is too large to fit in a single response, this token - # is returned. It encodes the position of the current result cursor. - # Feeding this value into a new list request with the `page_token` parameter - # gives the next page of the results. - # - # When `next_page_token` is not filled in, there is no next page and - # the list returned is the last page in the result set. - # - # Pagination tokens have a limited lifetime. - class SearchProjectsResponse - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # The request sent to the - # {::Google::Cloud::ResourceManager::V3::Projects::Client#create_project CreateProject} - # method. - # @!attribute [rw] project - # @return [::Google::Cloud::ResourceManager::V3::Project] - # Required. The Project to create. - # - # Project ID is required. If the requested ID is unavailable, the request - # fails. - # - # If the `parent` field is set, the `resourcemanager.projects.create` - # permission is checked on the parent resource. If no parent is set and - # the authorization credentials belong to an Organization, the parent - # will be set to that Organization. - class CreateProjectRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # A status object which is used as the `metadata` field for the Operation - # returned by CreateProject. It provides insight for when significant phases of - # Project creation have completed. - # @!attribute [rw] create_time - # @return [::Google::Protobuf::Timestamp] - # Creation time of the project creation workflow. - # @!attribute [rw] gettable - # @return [::Boolean] - # True if the project can be retrieved using `GetProject`. No other - # operations on the project are guaranteed to work until the project creation - # is complete. - # @!attribute [rw] ready - # @return [::Boolean] - # True if the project creation process is complete. - class CreateProjectMetadata - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # The request sent to the - # {::Google::Cloud::ResourceManager::V3::Projects::Client#update_project UpdateProject} - # method. - # - # Only the `display_name` and `labels` fields can be change. Use the - # {::Google::Cloud::ResourceManager::V3::Projects::Client#move_project MoveProject} method to - # change the `parent` field. - # @!attribute [rw] project - # @return [::Google::Cloud::ResourceManager::V3::Project] - # Required. The new definition of the project. - # @!attribute [rw] update_mask - # @return [::Google::Protobuf::FieldMask] - # Optional. An update mask to selectively update fields. - class UpdateProjectRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # A status object which is used as the `metadata` field for the Operation - # returned by UpdateProject. - class UpdateProjectMetadata - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # The request sent to - # {::Google::Cloud::ResourceManager::V3::Projects::Client#move_project MoveProject} - # method. - # @!attribute [rw] name - # @return [::String] - # Required. The name of the project to move. - # @!attribute [rw] destination_parent - # @return [::String] - # Required. The new parent to move the Project under. - class MoveProjectRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # A status object which is used as the `metadata` field for the Operation - # returned by MoveProject. - class MoveProjectMetadata - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # {::Google::Cloud::ResourceManager::V3::Projects::Client#delete_project DeleteProject} - # method. - # @!attribute [rw] name - # @return [::String] - # Required. The name of the Project (for example, `projects/415104041262`). - class DeleteProjectRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # A status object which is used as the `metadata` field for the Operation - # returned by `DeleteProject`. - class DeleteProjectMetadata - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # The request sent to the [UndeleteProject] - # [google.cloud.resourcemanager.v3.Projects.UndeleteProject] - # method. - # @!attribute [rw] name - # @return [::String] - # Required. The name of the project (for example, `projects/415104041262`). - # - # Required. - class UndeleteProjectRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # A status object which is used as the `metadata` field for the Operation - # returned by `UndeleteProject`. - class UndeleteProjectMetadata - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - end - end - end -end diff --git a/owl-bot-staging/google-cloud-resource_manager-v3/proto_docs/google/cloud/resourcemanager/v3/tag_bindings.rb b/owl-bot-staging/google-cloud-resource_manager-v3/proto_docs/google/cloud/resourcemanager/v3/tag_bindings.rb deleted file mode 100644 index 8db56693b941..000000000000 --- a/owl-bot-staging/google-cloud-resource_manager-v3/proto_docs/google/cloud/resourcemanager/v3/tag_bindings.rb +++ /dev/null @@ -1,216 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - - -module Google - module Cloud - module ResourceManager - module V3 - # A TagBinding represents a connection between a TagValue and a cloud - # resource Once a TagBinding is created, the TagValue is applied to all the - # descendants of the Google Cloud resource. - # @!attribute [r] name - # @return [::String] - # Output only. The name of the TagBinding. This is a String of the form: - # `tagBindings/{full-resource-name}/{tag-value-name}` (e.g. - # `tagBindings/%2F%2Fcloudresourcemanager.googleapis.com%2Fprojects%2F123/tagValues/456`). - # @!attribute [rw] parent - # @return [::String] - # The full resource name of the resource the TagValue is bound to. - # E.g. `//cloudresourcemanager.googleapis.com/projects/123` - # @!attribute [rw] tag_value - # @return [::String] - # The TagValue of the TagBinding. - # Must be of the form `tagValues/456`. - # @!attribute [rw] tag_value_namespaced_name - # @return [::String] - # The namespaced name for the TagValue of the TagBinding. - # Must be in the format - # `{parent_id}/{tag_key_short_name}/{short_name}`. - # - # For methods that support TagValue namespaced name, only one of - # tag_value_namespaced_name or tag_value may be filled. Requests with both - # fields will be rejected. - class TagBinding - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Runtime operation information for creating a TagValue. - class CreateTagBindingMetadata - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # The request message to create a TagBinding. - # @!attribute [rw] tag_binding - # @return [::Google::Cloud::ResourceManager::V3::TagBinding] - # Required. The TagBinding to be created. - # @!attribute [rw] validate_only - # @return [::Boolean] - # Optional. Set to true to perform the validations necessary for creating the - # resource, but not actually perform the action. - class CreateTagBindingRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Runtime operation information for deleting a TagBinding. - class DeleteTagBindingMetadata - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # The request message to delete a TagBinding. - # @!attribute [rw] name - # @return [::String] - # Required. The name of the TagBinding. This is a String of the form: - # `tagBindings/{id}` (e.g. - # `tagBindings/%2F%2Fcloudresourcemanager.googleapis.com%2Fprojects%2F123/tagValues/456`). - class DeleteTagBindingRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # The request message to list all TagBindings for a parent. - # @!attribute [rw] parent - # @return [::String] - # Required. The full resource name of a resource for which you want to list - # existing TagBindings. E.g. - # "//cloudresourcemanager.googleapis.com/projects/123" - # @!attribute [rw] page_size - # @return [::Integer] - # Optional. The maximum number of TagBindings to return in the response. The - # server allows a maximum of 300 TagBindings to return. If unspecified, the - # server will use 100 as the default. - # @!attribute [rw] page_token - # @return [::String] - # Optional. A pagination token returned from a previous call to - # `ListTagBindings` that indicates where this listing should continue from. - class ListTagBindingsRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # The ListTagBindings response. - # @!attribute [rw] tag_bindings - # @return [::Array<::Google::Cloud::ResourceManager::V3::TagBinding>] - # A possibly paginated list of TagBindings for the specified resource. - # @!attribute [rw] next_page_token - # @return [::String] - # Pagination token. - # - # If the result set is too large to fit in a single response, this token - # is returned. It encodes the position of the current result cursor. - # Feeding this value into a new list request with the `page_token` parameter - # gives the next page of the results. - # - # When `next_page_token` is not filled in, there is no next page and - # the list returned is the last page in the result set. - # - # Pagination tokens have a limited lifetime. - class ListTagBindingsResponse - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # The request message to ListEffectiveTags - # @!attribute [rw] parent - # @return [::String] - # Required. The full resource name of a resource for which you want to list - # the effective tags. E.g. - # "//cloudresourcemanager.googleapis.com/projects/123" - # @!attribute [rw] page_size - # @return [::Integer] - # Optional. The maximum number of effective tags to return in the response. - # The server allows a maximum of 300 effective tags to return in a single - # page. If unspecified, the server will use 100 as the default. - # @!attribute [rw] page_token - # @return [::String] - # Optional. A pagination token returned from a previous call to - # `ListEffectiveTags` that indicates from where this listing should continue. - class ListEffectiveTagsRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # The response of ListEffectiveTags. - # @!attribute [rw] effective_tags - # @return [::Array<::Google::Cloud::ResourceManager::V3::EffectiveTag>] - # A possibly paginated list of effective tags for the specified resource. - # @!attribute [rw] next_page_token - # @return [::String] - # Pagination token. - # - # If the result set is too large to fit in a single response, this token - # is returned. It encodes the position of the current result cursor. - # Feeding this value into a new list request with the `page_token` parameter - # gives the next page of the results. - # - # When `next_page_token` is not filled in, there is no next page and - # the list returned is the last page in the result set. - # - # Pagination tokens have a limited lifetime. - class ListEffectiveTagsResponse - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # An EffectiveTag represents a tag that applies to a resource during policy - # evaluation. Tags can be either directly bound to a resource or inherited from - # its ancestor. EffectiveTag contains the name and - # namespaced_name of the tag value and tag key, with additional fields of - # `inherited` to indicate the inheritance status of the effective tag. - # @!attribute [rw] tag_value - # @return [::String] - # Resource name for TagValue in the format `tagValues/456`. - # @!attribute [rw] namespaced_tag_value - # @return [::String] - # The namespaced name of the TagValue. Can be in the form - # `{organization_id}/{tag_key_short_name}/{tag_value_short_name}` or - # `{project_id}/{tag_key_short_name}/{tag_value_short_name}` or - # `{project_number}/{tag_key_short_name}/{tag_value_short_name}`. - # @!attribute [rw] tag_key - # @return [::String] - # The name of the TagKey, in the format `tagKeys/{id}`, such as - # `tagKeys/123`. - # @!attribute [rw] namespaced_tag_key - # @return [::String] - # The namespaced name of the TagKey. Can be in the form - # `{organization_id}/{tag_key_short_name}` or - # `{project_id}/{tag_key_short_name}` or - # `{project_number}/{tag_key_short_name}`. - # @!attribute [rw] tag_key_parent_name - # @return [::String] - # The parent name of the tag key. - # Must be in the format `organizations/{organization_id}` or - # `projects/{project_number}` - # @!attribute [rw] inherited - # @return [::Boolean] - # Indicates the inheritance status of a tag value - # attached to the given resource. If the tag value is inherited from one of - # the resource's ancestors, inherited will be true. If false, then the tag - # value is directly attached to the resource, inherited will be false. - class EffectiveTag - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - end - end - end -end diff --git a/owl-bot-staging/google-cloud-resource_manager-v3/proto_docs/google/cloud/resourcemanager/v3/tag_holds.rb b/owl-bot-staging/google-cloud-resource_manager-v3/proto_docs/google/cloud/resourcemanager/v3/tag_holds.rb deleted file mode 100644 index 09705e00166b..000000000000 --- a/owl-bot-staging/google-cloud-resource_manager-v3/proto_docs/google/cloud/resourcemanager/v3/tag_holds.rb +++ /dev/null @@ -1,161 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - - -module Google - module Cloud - module ResourceManager - module V3 - # A TagHold represents the use of a TagValue that is not captured by - # TagBindings. If a TagValue has any TagHolds, deletion will be blocked. - # This resource is intended to be created in the same cloud location as the - # `holder`. - # @!attribute [r] name - # @return [::String] - # Output only. The resource name of a TagHold. This is a String of the form: - # `tagValues/{tag-value-id}/tagHolds/{tag-hold-id}` - # (e.g. `tagValues/123/tagHolds/456`). This resource name is generated by - # the server. - # @!attribute [rw] holder - # @return [::String] - # Required. The name of the resource where the TagValue is being used. Must - # be less than 200 characters. E.g. - # `//compute.googleapis.com/compute/projects/myproject/regions/us-east-1/instanceGroupManagers/instance-group` - # @!attribute [rw] origin - # @return [::String] - # Optional. An optional string representing the origin of this request. This - # field should include human-understandable information to distinguish - # origins from each other. Must be less than 200 characters. E.g. - # `migs-35678234` - # @!attribute [rw] help_link - # @return [::String] - # Optional. A URL where an end user can learn more about removing this hold. - # E.g. - # `https://cloud.google.com/resource-manager/docs/tags/tags-creating-and-managing` - # @!attribute [r] create_time - # @return [::Google::Protobuf::Timestamp] - # Output only. The time this TagHold was created. - class TagHold - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # The request message to create a TagHold. - # @!attribute [rw] parent - # @return [::String] - # Required. The resource name of the TagHold's parent TagValue. Must be of - # the form: `tagValues/{tag-value-id}`. - # @!attribute [rw] tag_hold - # @return [::Google::Cloud::ResourceManager::V3::TagHold] - # Required. The TagHold to be created. - # @!attribute [rw] validate_only - # @return [::Boolean] - # Optional. Set to true to perform the validations necessary for creating the - # resource, but not actually perform the action. - class CreateTagHoldRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Runtime operation information for creating a TagHold. - # (-- The metadata is currently empty, but may include information in the - # future. --) - class CreateTagHoldMetadata - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # The request message to delete a TagHold. - # @!attribute [rw] name - # @return [::String] - # Required. The resource name of the TagHold to delete. Must be of the form: - # `tagValues/{tag-value-id}/tagHolds/{tag-hold-id}`. - # @!attribute [rw] validate_only - # @return [::Boolean] - # Optional. Set to true to perform the validations necessary for deleting the - # resource, but not actually perform the action. - class DeleteTagHoldRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Runtime operation information for deleting a TagHold. - # (-- The metadata is currently empty, but may include information in the - # future. --) - class DeleteTagHoldMetadata - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # The request message for listing the TagHolds under a TagValue. - # @!attribute [rw] parent - # @return [::String] - # Required. The resource name of the parent TagValue. Must be of the form: - # `tagValues/{tag-value-id}`. - # @!attribute [rw] page_size - # @return [::Integer] - # Optional. The maximum number of TagHolds to return in the response. The - # server allows a maximum of 300 TagHolds to return. If unspecified, the - # server will use 100 as the default. - # @!attribute [rw] page_token - # @return [::String] - # Optional. A pagination token returned from a previous call to - # `ListTagHolds` that indicates where this listing should continue from. - # @!attribute [rw] filter - # @return [::String] - # Optional. Criteria used to select a subset of TagHolds parented by the - # TagValue to return. This field follows the syntax defined by aip.dev/160; - # the `holder` and `origin` fields are supported for filtering. Currently - # only `AND` syntax is supported. Some example queries are: - # - # * `holder = - # //compute.googleapis.com/compute/projects/myproject/regions/us-east-1/instanceGroupManagers/instance-group` - # * `origin = 35678234` - # * `holder = - # //compute.googleapis.com/compute/projects/myproject/regions/us-east-1/instanceGroupManagers/instance-group - # AND origin = 35678234` - class ListTagHoldsRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # The ListTagHolds response. - # @!attribute [rw] tag_holds - # @return [::Array<::Google::Cloud::ResourceManager::V3::TagHold>] - # A possibly paginated list of TagHolds. - # @!attribute [rw] next_page_token - # @return [::String] - # Pagination token. - # - # If the result set is too large to fit in a single response, this token - # is returned. It encodes the position of the current result cursor. - # Feeding this value into a new list request with the `page_token` parameter - # gives the next page of the results. - # - # When `next_page_token` is not filled in, there is no next page and - # the list returned is the last page in the result set. - # - # Pagination tokens have a limited lifetime. - class ListTagHoldsResponse - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - end - end - end -end diff --git a/owl-bot-staging/google-cloud-resource_manager-v3/proto_docs/google/cloud/resourcemanager/v3/tag_keys.rb b/owl-bot-staging/google-cloud-resource_manager-v3/proto_docs/google/cloud/resourcemanager/v3/tag_keys.rb deleted file mode 100644 index 0c2b4bf3e7b2..000000000000 --- a/owl-bot-staging/google-cloud-resource_manager-v3/proto_docs/google/cloud/resourcemanager/v3/tag_keys.rb +++ /dev/null @@ -1,247 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - - -module Google - module Cloud - module ResourceManager - module V3 - # A TagKey, used to group a set of TagValues. - # @!attribute [rw] name - # @return [::String] - # Immutable. The resource name for a TagKey. Must be in the format - # `tagKeys/{tag_key_id}`, where `tag_key_id` is the generated numeric id for - # the TagKey. - # @!attribute [rw] parent - # @return [::String] - # Immutable. The resource name of the TagKey's parent. A TagKey can be - # parented by an Organization or a Project. For a TagKey parented by an - # Organization, its parent must be in the form `organizations/{org_id}`. For - # a TagKey parented by a Project, its parent can be in the form - # `projects/{project_id}` or `projects/{project_number}`. - # @!attribute [rw] short_name - # @return [::String] - # Required. Immutable. The user friendly name for a TagKey. The short name - # should be unique for TagKeys within the same tag namespace. - # - # The short name must be 1-63 characters, beginning and ending with - # an alphanumeric character ([a-z0-9A-Z]) with dashes (-), underscores (_), - # dots (.), and alphanumerics between. - # @!attribute [r] namespaced_name - # @return [::String] - # Output only. Immutable. Namespaced name of the TagKey. - # @!attribute [rw] description - # @return [::String] - # Optional. User-assigned description of the TagKey. Must not exceed 256 - # characters. - # - # Read-write. - # @!attribute [r] create_time - # @return [::Google::Protobuf::Timestamp] - # Output only. Creation time. - # @!attribute [r] update_time - # @return [::Google::Protobuf::Timestamp] - # Output only. Update time. - # @!attribute [rw] etag - # @return [::String] - # Optional. Entity tag which users can pass to prevent race conditions. This - # field is always set in server responses. See UpdateTagKeyRequest for - # details. - # @!attribute [rw] purpose - # @return [::Google::Cloud::ResourceManager::V3::Purpose] - # Optional. A purpose denotes that this Tag is intended for use in policies - # of a specific policy engine, and will involve that policy engine in - # management operations involving this Tag. A purpose does not grant a - # policy engine exclusive rights to the Tag, and it may be referenced by - # other policy engines. - # - # A purpose cannot be changed once set. - # @!attribute [rw] purpose_data - # @return [::Google::Protobuf::Map{::String => ::String}] - # Optional. Purpose data corresponds to the policy system that the tag is - # intended for. See documentation for `Purpose` for formatting of this field. - # - # Purpose data cannot be changed once set. - class TagKey - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - - # @!attribute [rw] key - # @return [::String] - # @!attribute [rw] value - # @return [::String] - class PurposeDataEntry - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - end - - # The request message for listing all TagKeys under a parent resource. - # @!attribute [rw] parent - # @return [::String] - # Required. The resource name of the TagKey's parent. - # Must be of the form `organizations/{org_id}` or `projects/{project_id}` or - # `projects/{project_number}` - # @!attribute [rw] page_size - # @return [::Integer] - # Optional. The maximum number of TagKeys to return in the response. The - # server allows a maximum of 300 TagKeys to return. If unspecified, the - # server will use 100 as the default. - # @!attribute [rw] page_token - # @return [::String] - # Optional. A pagination token returned from a previous call to `ListTagKey` - # that indicates where this listing should continue from. - class ListTagKeysRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # The ListTagKeys response message. - # @!attribute [rw] tag_keys - # @return [::Array<::Google::Cloud::ResourceManager::V3::TagKey>] - # List of TagKeys that live under the specified parent in the request. - # @!attribute [rw] next_page_token - # @return [::String] - # A pagination token returned from a previous call to `ListTagKeys` - # that indicates from where listing should continue. - class ListTagKeysResponse - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # The request message for getting a TagKey. - # @!attribute [rw] name - # @return [::String] - # Required. A resource name in the format `tagKeys/{id}`, such as - # `tagKeys/123`. - class GetTagKeyRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # The request message for getting a TagKey by its namespaced name. - # @!attribute [rw] name - # @return [::String] - # Required. A namespaced tag key name in the format - # `{parentId}/{tagKeyShort}`, such as `42/foo` for a key with short name - # "foo" under the organization with ID 42 or `r2-d2/bar` for a key with short - # name "bar" under the project `r2-d2`. - class GetNamespacedTagKeyRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # The request message for creating a TagKey. - # @!attribute [rw] tag_key - # @return [::Google::Cloud::ResourceManager::V3::TagKey] - # Required. The TagKey to be created. Only fields `short_name`, - # `description`, and `parent` are considered during the creation request. - # @!attribute [rw] validate_only - # @return [::Boolean] - # Optional. Set to true to perform validations necessary for creating the - # resource, but not actually perform the action. - class CreateTagKeyRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Runtime operation information for creating a TagKey. - class CreateTagKeyMetadata - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # The request message for updating a TagKey. - # @!attribute [rw] tag_key - # @return [::Google::Cloud::ResourceManager::V3::TagKey] - # Required. The new definition of the TagKey. Only the `description` and - # `etag` fields can be updated by this request. If the `etag` field is not - # empty, it must match the `etag` field of the existing tag key. Otherwise, - # `ABORTED` will be returned. - # @!attribute [rw] update_mask - # @return [::Google::Protobuf::FieldMask] - # Fields to be updated. The mask may only contain `description` or - # `etag`. If omitted entirely, both `description` and `etag` are assumed to - # be significant. - # @!attribute [rw] validate_only - # @return [::Boolean] - # Set as true to perform validations necessary for updating the resource, but - # not actually perform the action. - class UpdateTagKeyRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Runtime operation information for updating a TagKey. - class UpdateTagKeyMetadata - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # The request message for deleting a TagKey. - # @!attribute [rw] name - # @return [::String] - # Required. The resource name of a TagKey to be deleted in the format - # `tagKeys/123`. The TagKey cannot be a parent of any existing TagValues or - # it will not be deleted successfully. - # @!attribute [rw] validate_only - # @return [::Boolean] - # Optional. Set as true to perform validations necessary for deletion, but - # not actually perform the action. - # @!attribute [rw] etag - # @return [::String] - # Optional. The etag known to the client for the expected state of the - # TagKey. This is to be used for optimistic concurrency. - class DeleteTagKeyRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Runtime operation information for deleting a TagKey. - class DeleteTagKeyMetadata - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # A purpose for each policy engine requiring such an integration. A single - # policy engine may have multiple purposes defined, however a TagKey may only - # specify a single purpose. - module Purpose - # Unspecified purpose. - PURPOSE_UNSPECIFIED = 0 - - # Purpose for Compute Engine firewalls. - # A corresponding `purpose_data` should be set for the network the tag is - # intended for. The key should be `network` and the value should be in - # either of these two formats: - # - # - - # `https://www.googleapis.com/compute/{compute_version}/projects/{project_id}/global/networks/{network_id}` - # - `{project_id}/{network_name}` - # - # Examples: - # - # - - # `https://www.googleapis.com/compute/staging_v1/projects/fail-closed-load-testing/global/networks/6992953698831725600` - # - `fail-closed-load-testing/load-testing-network` - GCE_FIREWALL = 1 - end - end - end - end -end diff --git a/owl-bot-staging/google-cloud-resource_manager-v3/proto_docs/google/cloud/resourcemanager/v3/tag_values.rb b/owl-bot-staging/google-cloud-resource_manager-v3/proto_docs/google/cloud/resourcemanager/v3/tag_values.rb deleted file mode 100644 index 3e7ea8cc3717..000000000000 --- a/owl-bot-staging/google-cloud-resource_manager-v3/proto_docs/google/cloud/resourcemanager/v3/tag_values.rb +++ /dev/null @@ -1,202 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - - -module Google - module Cloud - module ResourceManager - module V3 - # A TagValue is a child of a particular TagKey. This is used to group - # cloud resources for the purpose of controlling them using policies. - # @!attribute [rw] name - # @return [::String] - # Immutable. Resource name for TagValue in the format `tagValues/456`. - # @!attribute [rw] parent - # @return [::String] - # Immutable. The resource name of the new TagValue's parent TagKey. - # Must be of the form `tagKeys/{tag_key_id}`. - # @!attribute [rw] short_name - # @return [::String] - # Required. Immutable. User-assigned short name for TagValue. The short name - # should be unique for TagValues within the same parent TagKey. - # - # The short name must be 63 characters or less, beginning and ending with - # an alphanumeric character ([a-z0-9A-Z]) with dashes (-), underscores (_), - # dots (.), and alphanumerics between. - # @!attribute [r] namespaced_name - # @return [::String] - # Output only. The namespaced name of the TagValue. Can be in the form - # `{organization_id}/{tag_key_short_name}/{tag_value_short_name}` or - # `{project_id}/{tag_key_short_name}/{tag_value_short_name}` or - # `{project_number}/{tag_key_short_name}/{tag_value_short_name}`. - # @!attribute [rw] description - # @return [::String] - # Optional. User-assigned description of the TagValue. - # Must not exceed 256 characters. - # - # Read-write. - # @!attribute [r] create_time - # @return [::Google::Protobuf::Timestamp] - # Output only. Creation time. - # @!attribute [r] update_time - # @return [::Google::Protobuf::Timestamp] - # Output only. Update time. - # @!attribute [rw] etag - # @return [::String] - # Optional. Entity tag which users can pass to prevent race conditions. This - # field is always set in server responses. See UpdateTagValueRequest for - # details. - class TagValue - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # The request message for listing TagValues for the specified TagKey. - # Resource name for TagKey, parent of the TagValues to be listed, - # in the format `tagKeys/123`. - # @!attribute [rw] parent - # @return [::String] - # Required. - # @!attribute [rw] page_size - # @return [::Integer] - # Optional. The maximum number of TagValues to return in the response. The - # server allows a maximum of 300 TagValues to return. If unspecified, the - # server will use 100 as the default. - # @!attribute [rw] page_token - # @return [::String] - # Optional. A pagination token returned from a previous call to - # `ListTagValues` that indicates where this listing should continue from. - class ListTagValuesRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # The ListTagValues response. - # @!attribute [rw] tag_values - # @return [::Array<::Google::Cloud::ResourceManager::V3::TagValue>] - # A possibly paginated list of TagValues that are direct descendants of - # the specified parent TagKey. - # @!attribute [rw] next_page_token - # @return [::String] - # A pagination token returned from a previous call to `ListTagValues` - # that indicates from where listing should continue. This is currently not - # used, but the server may at any point start supplying a valid token. - class ListTagValuesResponse - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # The request message for getting a TagValue. - # @!attribute [rw] name - # @return [::String] - # Required. Resource name for TagValue to be fetched in the format - # `tagValues/456`. - class GetTagValueRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # The request message for getting a TagValue by its namespaced name. - # @!attribute [rw] name - # @return [::String] - # Required. A namespaced tag value name in the following format: - # - # `{parentId}/{tagKeyShort}/{tagValueShort}` - # - # Examples: - # - `42/foo/abc` for a value with short name "abc" under the key with short - # name "foo" under the organization with ID 42 - # - `r2-d2/bar/xyz` for a value with short name "xyz" under the key with - # short name "bar" under the project with ID "r2-d2" - class GetNamespacedTagValueRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # The request message for creating a TagValue. - # @!attribute [rw] tag_value - # @return [::Google::Cloud::ResourceManager::V3::TagValue] - # Required. The TagValue to be created. Only fields `short_name`, - # `description`, and `parent` are considered during the creation request. - # @!attribute [rw] validate_only - # @return [::Boolean] - # Optional. Set as true to perform the validations necessary for creating the - # resource, but not actually perform the action. - class CreateTagValueRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Runtime operation information for creating a TagValue. - class CreateTagValueMetadata - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # The request message for updating a TagValue. - # @!attribute [rw] tag_value - # @return [::Google::Cloud::ResourceManager::V3::TagValue] - # Required. The new definition of the TagValue. Only fields `description` and - # `etag` fields can be updated by this request. If the `etag` field is - # nonempty, it must match the `etag` field of the existing ControlGroup. - # Otherwise, `ABORTED` will be returned. - # @!attribute [rw] update_mask - # @return [::Google::Protobuf::FieldMask] - # Optional. Fields to be updated. - # @!attribute [rw] validate_only - # @return [::Boolean] - # Optional. True to perform validations necessary for updating the resource, - # but not actually perform the action. - class UpdateTagValueRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Runtime operation information for updating a TagValue. - class UpdateTagValueMetadata - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # The request message for deleting a TagValue. - # @!attribute [rw] name - # @return [::String] - # Required. Resource name for TagValue to be deleted in the format - # tagValues/456. - # @!attribute [rw] validate_only - # @return [::Boolean] - # Optional. Set as true to perform the validations necessary for deletion, - # but not actually perform the action. - # @!attribute [rw] etag - # @return [::String] - # Optional. The etag known to the client for the expected state of the - # TagValue. This is to be used for optimistic concurrency. - class DeleteTagValueRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Runtime operation information for deleting a TagValue. - class DeleteTagValueMetadata - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - end - end - end -end diff --git a/owl-bot-staging/google-cloud-resource_manager-v3/proto_docs/google/iam/v1/iam_policy.rb b/owl-bot-staging/google-cloud-resource_manager-v3/proto_docs/google/iam/v1/iam_policy.rb deleted file mode 100644 index 5445c77f8258..000000000000 --- a/owl-bot-staging/google-cloud-resource_manager-v3/proto_docs/google/iam/v1/iam_policy.rb +++ /dev/null @@ -1,87 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - - -module Google - module Iam - module V1 - # Request message for `SetIamPolicy` method. - # @!attribute [rw] resource - # @return [::String] - # REQUIRED: The resource for which the policy is being specified. - # See the operation documentation for the appropriate value for this field. - # @!attribute [rw] policy - # @return [::Google::Iam::V1::Policy] - # REQUIRED: The complete policy to be applied to the `resource`. The size of - # the policy is limited to a few 10s of KB. An empty policy is a - # valid policy but certain Cloud Platform services (such as Projects) - # might reject them. - # @!attribute [rw] update_mask - # @return [::Google::Protobuf::FieldMask] - # OPTIONAL: A FieldMask specifying which fields of the policy to modify. Only - # the fields in the mask will be modified. If no mask is provided, the - # following default mask is used: - # - # `paths: "bindings, etag"` - class SetIamPolicyRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Request message for `GetIamPolicy` method. - # @!attribute [rw] resource - # @return [::String] - # REQUIRED: The resource for which the policy is being requested. - # See the operation documentation for the appropriate value for this field. - # @!attribute [rw] options - # @return [::Google::Iam::V1::GetPolicyOptions] - # OPTIONAL: A `GetPolicyOptions` object for specifying options to - # `GetIamPolicy`. - class GetIamPolicyRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Request message for `TestIamPermissions` method. - # @!attribute [rw] resource - # @return [::String] - # REQUIRED: The resource for which the policy detail is being requested. - # See the operation documentation for the appropriate value for this field. - # @!attribute [rw] permissions - # @return [::Array<::String>] - # The set of permissions to check for the `resource`. Permissions with - # wildcards (such as '*' or 'storage.*') are not allowed. For more - # information see - # [IAM Overview](https://cloud.google.com/iam/docs/overview#permissions). - class TestIamPermissionsRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Response message for `TestIamPermissions` method. - # @!attribute [rw] permissions - # @return [::Array<::String>] - # A subset of `TestPermissionsRequest.permissions` that the caller is - # allowed. - class TestIamPermissionsResponse - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - end - end -end diff --git a/owl-bot-staging/google-cloud-resource_manager-v3/proto_docs/google/iam/v1/options.rb b/owl-bot-staging/google-cloud-resource_manager-v3/proto_docs/google/iam/v1/options.rb deleted file mode 100644 index 60713d995b86..000000000000 --- a/owl-bot-staging/google-cloud-resource_manager-v3/proto_docs/google/iam/v1/options.rb +++ /dev/null @@ -1,50 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - - -module Google - module Iam - module V1 - # Encapsulates settings provided to GetIamPolicy. - # @!attribute [rw] requested_policy_version - # @return [::Integer] - # Optional. The maximum policy version that will be used to format the - # policy. - # - # Valid values are 0, 1, and 3. Requests specifying an invalid value will be - # rejected. - # - # Requests for policies with any conditional role bindings must specify - # version 3. Policies with no conditional role bindings may specify any valid - # value or leave the field unset. - # - # The policy in the response might use the policy version that you specified, - # or it might use a lower policy version. For example, if you specify version - # 3, but the policy has no conditional role bindings, the response uses - # version 1. - # - # To learn which resources support conditions in their IAM policies, see the - # [IAM - # documentation](https://cloud.google.com/iam/help/conditions/resource-policies). - class GetPolicyOptions - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - end - end -end diff --git a/owl-bot-staging/google-cloud-resource_manager-v3/proto_docs/google/iam/v1/policy.rb b/owl-bot-staging/google-cloud-resource_manager-v3/proto_docs/google/iam/v1/policy.rb deleted file mode 100644 index 999575b797df..000000000000 --- a/owl-bot-staging/google-cloud-resource_manager-v3/proto_docs/google/iam/v1/policy.rb +++ /dev/null @@ -1,426 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - - -module Google - module Iam - module V1 - # An Identity and Access Management (IAM) policy, which specifies access - # controls for Google Cloud resources. - # - # - # A `Policy` is a collection of `bindings`. A `binding` binds one or more - # `members`, or principals, to a single `role`. Principals can be user - # accounts, service accounts, Google groups, and domains (such as G Suite). A - # `role` is a named list of permissions; each `role` can be an IAM predefined - # role or a user-created custom role. - # - # For some types of Google Cloud resources, a `binding` can also specify a - # `condition`, which is a logical expression that allows access to a resource - # only if the expression evaluates to `true`. A condition can add constraints - # based on attributes of the request, the resource, or both. To learn which - # resources support conditions in their IAM policies, see the - # [IAM - # documentation](https://cloud.google.com/iam/help/conditions/resource-policies). - # - # **JSON example:** - # - # ``` - # { - # "bindings": [ - # { - # "role": "roles/resourcemanager.organizationAdmin", - # "members": [ - # "user:mike@example.com", - # "group:admins@example.com", - # "domain:google.com", - # "serviceAccount:my-project-id@appspot.gserviceaccount.com" - # ] - # }, - # { - # "role": "roles/resourcemanager.organizationViewer", - # "members": [ - # "user:eve@example.com" - # ], - # "condition": { - # "title": "expirable access", - # "description": "Does not grant access after Sep 2020", - # "expression": "request.time < - # timestamp('2020-10-01T00:00:00.000Z')", - # } - # } - # ], - # "etag": "BwWWja0YfJA=", - # "version": 3 - # } - # ``` - # - # **YAML example:** - # - # ``` - # bindings: - # - members: - # - user:mike@example.com - # - group:admins@example.com - # - domain:google.com - # - serviceAccount:my-project-id@appspot.gserviceaccount.com - # role: roles/resourcemanager.organizationAdmin - # - members: - # - user:eve@example.com - # role: roles/resourcemanager.organizationViewer - # condition: - # title: expirable access - # description: Does not grant access after Sep 2020 - # expression: request.time < timestamp('2020-10-01T00:00:00.000Z') - # etag: BwWWja0YfJA= - # version: 3 - # ``` - # - # For a description of IAM and its features, see the - # [IAM documentation](https://cloud.google.com/iam/docs/). - # @!attribute [rw] version - # @return [::Integer] - # Specifies the format of the policy. - # - # Valid values are `0`, `1`, and `3`. Requests that specify an invalid value - # are rejected. - # - # Any operation that affects conditional role bindings must specify version - # `3`. This requirement applies to the following operations: - # - # * Getting a policy that includes a conditional role binding - # * Adding a conditional role binding to a policy - # * Changing a conditional role binding in a policy - # * Removing any role binding, with or without a condition, from a policy - # that includes conditions - # - # **Important:** If you use IAM Conditions, you must include the `etag` field - # whenever you call `setIamPolicy`. If you omit this field, then IAM allows - # you to overwrite a version `3` policy with a version `1` policy, and all of - # the conditions in the version `3` policy are lost. - # - # If a policy does not include any conditions, operations on that policy may - # specify any valid version or leave the field unset. - # - # To learn which resources support conditions in their IAM policies, see the - # [IAM - # documentation](https://cloud.google.com/iam/help/conditions/resource-policies). - # @!attribute [rw] bindings - # @return [::Array<::Google::Iam::V1::Binding>] - # Associates a list of `members`, or principals, with a `role`. Optionally, - # may specify a `condition` that determines how and when the `bindings` are - # applied. Each of the `bindings` must contain at least one principal. - # - # The `bindings` in a `Policy` can refer to up to 1,500 principals; up to 250 - # of these principals can be Google groups. Each occurrence of a principal - # counts towards these limits. For example, if the `bindings` grant 50 - # different roles to `user:alice@example.com`, and not to any other - # principal, then you can add another 1,450 principals to the `bindings` in - # the `Policy`. - # @!attribute [rw] audit_configs - # @return [::Array<::Google::Iam::V1::AuditConfig>] - # Specifies cloud audit logging configuration for this policy. - # @!attribute [rw] etag - # @return [::String] - # `etag` is used for optimistic concurrency control as a way to help - # prevent simultaneous updates of a policy from overwriting each other. - # It is strongly suggested that systems make use of the `etag` in the - # read-modify-write cycle to perform policy updates in order to avoid race - # conditions: An `etag` is returned in the response to `getIamPolicy`, and - # systems are expected to put that etag in the request to `setIamPolicy` to - # ensure that their change will be applied to the same version of the policy. - # - # **Important:** If you use IAM Conditions, you must include the `etag` field - # whenever you call `setIamPolicy`. If you omit this field, then IAM allows - # you to overwrite a version `3` policy with a version `1` policy, and all of - # the conditions in the version `3` policy are lost. - class Policy - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Associates `members`, or principals, with a `role`. - # @!attribute [rw] role - # @return [::String] - # Role that is assigned to the list of `members`, or principals. - # For example, `roles/viewer`, `roles/editor`, or `roles/owner`. - # @!attribute [rw] members - # @return [::Array<::String>] - # Specifies the principals requesting access for a Google Cloud resource. - # `members` can have the following values: - # - # * `allUsers`: A special identifier that represents anyone who is - # on the internet; with or without a Google account. - # - # * `allAuthenticatedUsers`: A special identifier that represents anyone - # who is authenticated with a Google account or a service account. - # - # * `user:{emailid}`: An email address that represents a specific Google - # account. For example, `alice@example.com` . - # - # - # * `serviceAccount:{emailid}`: An email address that represents a service - # account. For example, `my-other-app@appspot.gserviceaccount.com`. - # - # * `group:{emailid}`: An email address that represents a Google group. - # For example, `admins@example.com`. - # - # * `deleted:user:{emailid}?uid={uniqueid}`: An email address (plus unique - # identifier) representing a user that has been recently deleted. For - # example, `alice@example.com?uid=123456789012345678901`. If the user is - # recovered, this value reverts to `user:{emailid}` and the recovered user - # retains the role in the binding. - # - # * `deleted:serviceAccount:{emailid}?uid={uniqueid}`: An email address (plus - # unique identifier) representing a service account that has been recently - # deleted. For example, - # `my-other-app@appspot.gserviceaccount.com?uid=123456789012345678901`. - # If the service account is undeleted, this value reverts to - # `serviceAccount:{emailid}` and the undeleted service account retains the - # role in the binding. - # - # * `deleted:group:{emailid}?uid={uniqueid}`: An email address (plus unique - # identifier) representing a Google group that has been recently - # deleted. For example, `admins@example.com?uid=123456789012345678901`. If - # the group is recovered, this value reverts to `group:{emailid}` and the - # recovered group retains the role in the binding. - # - # - # * `domain:{domain}`: The G Suite domain (primary) that represents all the - # users of that domain. For example, `google.com` or `example.com`. - # @!attribute [rw] condition - # @return [::Google::Type::Expr] - # The condition that is associated with this binding. - # - # If the condition evaluates to `true`, then this binding applies to the - # current request. - # - # If the condition evaluates to `false`, then this binding does not apply to - # the current request. However, a different role binding might grant the same - # role to one or more of the principals in this binding. - # - # To learn which resources support conditions in their IAM policies, see the - # [IAM - # documentation](https://cloud.google.com/iam/help/conditions/resource-policies). - class Binding - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Specifies the audit configuration for a service. - # The configuration determines which permission types are logged, and what - # identities, if any, are exempted from logging. - # An AuditConfig must have one or more AuditLogConfigs. - # - # If there are AuditConfigs for both `allServices` and a specific service, - # the union of the two AuditConfigs is used for that service: the log_types - # specified in each AuditConfig are enabled, and the exempted_members in each - # AuditLogConfig are exempted. - # - # Example Policy with multiple AuditConfigs: - # - # { - # "audit_configs": [ - # { - # "service": "allServices", - # "audit_log_configs": [ - # { - # "log_type": "DATA_READ", - # "exempted_members": [ - # "user:jose@example.com" - # ] - # }, - # { - # "log_type": "DATA_WRITE" - # }, - # { - # "log_type": "ADMIN_READ" - # } - # ] - # }, - # { - # "service": "sampleservice.googleapis.com", - # "audit_log_configs": [ - # { - # "log_type": "DATA_READ" - # }, - # { - # "log_type": "DATA_WRITE", - # "exempted_members": [ - # "user:aliya@example.com" - # ] - # } - # ] - # } - # ] - # } - # - # For sampleservice, this policy enables DATA_READ, DATA_WRITE and ADMIN_READ - # logging. It also exempts `jose@example.com` from DATA_READ logging, and - # `aliya@example.com` from DATA_WRITE logging. - # @!attribute [rw] service - # @return [::String] - # Specifies a service that will be enabled for audit logging. - # For example, `storage.googleapis.com`, `cloudsql.googleapis.com`. - # `allServices` is a special value that covers all services. - # @!attribute [rw] audit_log_configs - # @return [::Array<::Google::Iam::V1::AuditLogConfig>] - # The configuration for logging of each type of permission. - class AuditConfig - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Provides the configuration for logging a type of permissions. - # Example: - # - # { - # "audit_log_configs": [ - # { - # "log_type": "DATA_READ", - # "exempted_members": [ - # "user:jose@example.com" - # ] - # }, - # { - # "log_type": "DATA_WRITE" - # } - # ] - # } - # - # This enables 'DATA_READ' and 'DATA_WRITE' logging, while exempting - # jose@example.com from DATA_READ logging. - # @!attribute [rw] log_type - # @return [::Google::Iam::V1::AuditLogConfig::LogType] - # The log type that this config enables. - # @!attribute [rw] exempted_members - # @return [::Array<::String>] - # Specifies the identities that do not cause logging for this type of - # permission. - # Follows the same format of - # [Binding.members][google.iam.v1.Binding.members]. - class AuditLogConfig - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - - # The list of valid permission types for which logging can be configured. - # Admin writes are always logged, and are not configurable. - module LogType - # Default case. Should never be this. - LOG_TYPE_UNSPECIFIED = 0 - - # Admin reads. Example: CloudIAM getIamPolicy - ADMIN_READ = 1 - - # Data writes. Example: CloudSQL Users create - DATA_WRITE = 2 - - # Data reads. Example: CloudSQL Users list - DATA_READ = 3 - end - end - - # The difference delta between two policies. - # @!attribute [rw] binding_deltas - # @return [::Array<::Google::Iam::V1::BindingDelta>] - # The delta for Bindings between two policies. - # @!attribute [rw] audit_config_deltas - # @return [::Array<::Google::Iam::V1::AuditConfigDelta>] - # The delta for AuditConfigs between two policies. - class PolicyDelta - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # One delta entry for Binding. Each individual change (only one member in each - # entry) to a binding will be a separate entry. - # @!attribute [rw] action - # @return [::Google::Iam::V1::BindingDelta::Action] - # The action that was performed on a Binding. - # Required - # @!attribute [rw] role - # @return [::String] - # Role that is assigned to `members`. - # For example, `roles/viewer`, `roles/editor`, or `roles/owner`. - # Required - # @!attribute [rw] member - # @return [::String] - # A single identity requesting access for a Google Cloud resource. - # Follows the same format of Binding.members. - # Required - # @!attribute [rw] condition - # @return [::Google::Type::Expr] - # The condition that is associated with this binding. - class BindingDelta - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - - # The type of action performed on a Binding in a policy. - module Action - # Unspecified. - ACTION_UNSPECIFIED = 0 - - # Addition of a Binding. - ADD = 1 - - # Removal of a Binding. - REMOVE = 2 - end - end - - # One delta entry for AuditConfig. Each individual change (only one - # exempted_member in each entry) to a AuditConfig will be a separate entry. - # @!attribute [rw] action - # @return [::Google::Iam::V1::AuditConfigDelta::Action] - # The action that was performed on an audit configuration in a policy. - # Required - # @!attribute [rw] service - # @return [::String] - # Specifies a service that was configured for Cloud Audit Logging. - # For example, `storage.googleapis.com`, `cloudsql.googleapis.com`. - # `allServices` is a special value that covers all services. - # Required - # @!attribute [rw] exempted_member - # @return [::String] - # A single identity that is exempted from "data access" audit - # logging for the `service` specified above. - # Follows the same format of Binding.members. - # @!attribute [rw] log_type - # @return [::String] - # Specifies the log_type that was be enabled. ADMIN_ACTIVITY is always - # enabled, and cannot be configured. - # Required - class AuditConfigDelta - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - - # The type of action performed on an audit configuration in a policy. - module Action - # Unspecified. - ACTION_UNSPECIFIED = 0 - - # Addition of an audit configuration. - ADD = 1 - - # Removal of an audit configuration. - REMOVE = 2 - end - end - end - end -end diff --git a/owl-bot-staging/google-cloud-resource_manager-v3/proto_docs/google/longrunning/operations.rb b/owl-bot-staging/google-cloud-resource_manager-v3/proto_docs/google/longrunning/operations.rb deleted file mode 100644 index 7a757f512165..000000000000 --- a/owl-bot-staging/google-cloud-resource_manager-v3/proto_docs/google/longrunning/operations.rb +++ /dev/null @@ -1,191 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - - -module Google - module Longrunning - # This resource represents a long-running operation that is the result of a - # network API call. - # @!attribute [rw] name - # @return [::String] - # The server-assigned name, which is only unique within the same service that - # originally returns it. If you use the default HTTP mapping, the - # `name` should be a resource name ending with `operations/{unique_id}`. - # @!attribute [rw] metadata - # @return [::Google::Protobuf::Any] - # Service-specific metadata associated with the operation. It typically - # contains progress information and common metadata such as create time. - # Some services might not provide such metadata. Any method that returns a - # long-running operation should document the metadata type, if any. - # @!attribute [rw] done - # @return [::Boolean] - # If the value is `false`, it means the operation is still in progress. - # If `true`, the operation is completed, and either `error` or `response` is - # available. - # @!attribute [rw] error - # @return [::Google::Rpc::Status] - # The error result of the operation in case of failure or cancellation. - # - # Note: The following fields are mutually exclusive: `error`, `response`. If a field in that set is populated, all other fields in the set will automatically be cleared. - # @!attribute [rw] response - # @return [::Google::Protobuf::Any] - # The normal, successful response of the operation. If the original - # method returns no data on success, such as `Delete`, the response is - # `google.protobuf.Empty`. If the original method is standard - # `Get`/`Create`/`Update`, the response should be the resource. For other - # methods, the response should have the type `XxxResponse`, where `Xxx` - # is the original method name. For example, if the original method name - # is `TakeSnapshot()`, the inferred response type is - # `TakeSnapshotResponse`. - # - # Note: The following fields are mutually exclusive: `response`, `error`. If a field in that set is populated, all other fields in the set will automatically be cleared. - class Operation - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # The request message for - # Operations.GetOperation. - # @!attribute [rw] name - # @return [::String] - # The name of the operation resource. - class GetOperationRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # The request message for - # Operations.ListOperations. - # @!attribute [rw] name - # @return [::String] - # The name of the operation's parent resource. - # @!attribute [rw] filter - # @return [::String] - # The standard list filter. - # @!attribute [rw] page_size - # @return [::Integer] - # The standard list page size. - # @!attribute [rw] page_token - # @return [::String] - # The standard list page token. - # @!attribute [rw] return_partial_success - # @return [::Boolean] - # When set to `true`, operations that are reachable are returned as normal, - # and those that are unreachable are returned in the - # [ListOperationsResponse.unreachable] field. - # - # This can only be `true` when reading across collections e.g. when `parent` - # is set to `"projects/example/locations/-"`. - # - # This field is not by default supported and will result in an - # `UNIMPLEMENTED` error if set unless explicitly documented otherwise in - # service or product specific documentation. - class ListOperationsRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # The response message for - # Operations.ListOperations. - # @!attribute [rw] operations - # @return [::Array<::Google::Longrunning::Operation>] - # A list of operations that matches the specified filter in the request. - # @!attribute [rw] next_page_token - # @return [::String] - # The standard List next-page token. - # @!attribute [rw] unreachable - # @return [::Array<::String>] - # Unordered list. Unreachable resources. Populated when the request sets - # `ListOperationsRequest.return_partial_success` and reads across - # collections e.g. when attempting to list all resources across all supported - # locations. - class ListOperationsResponse - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # The request message for - # Operations.CancelOperation. - # @!attribute [rw] name - # @return [::String] - # The name of the operation resource to be cancelled. - class CancelOperationRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # The request message for - # Operations.DeleteOperation. - # @!attribute [rw] name - # @return [::String] - # The name of the operation resource to be deleted. - class DeleteOperationRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # The request message for - # Operations.WaitOperation. - # @!attribute [rw] name - # @return [::String] - # The name of the operation resource to wait on. - # @!attribute [rw] timeout - # @return [::Google::Protobuf::Duration] - # The maximum duration to wait before timing out. If left blank, the wait - # will be at most the time permitted by the underlying HTTP/RPC protocol. - # If RPC context deadline is also specified, the shorter one will be used. - class WaitOperationRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # A message representing the message types used by a long-running operation. - # - # Example: - # - # rpc Export(ExportRequest) returns (google.longrunning.Operation) { - # option (google.longrunning.operation_info) = { - # response_type: "ExportResponse" - # metadata_type: "ExportMetadata" - # }; - # } - # @!attribute [rw] response_type - # @return [::String] - # Required. The message name of the primary return type for this - # long-running operation. - # This type will be used to deserialize the LRO's response. - # - # If the response is in a different package from the rpc, a fully-qualified - # message name must be used (e.g. `google.protobuf.Struct`). - # - # Note: Altering this value constitutes a breaking change. - # @!attribute [rw] metadata_type - # @return [::String] - # Required. The message name of the metadata type for this long-running - # operation. - # - # If the response is in a different package from the rpc, a fully-qualified - # message name must be used (e.g. `google.protobuf.Struct`). - # - # Note: Altering this value constitutes a breaking change. - class OperationInfo - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - end -end diff --git a/owl-bot-staging/google-cloud-resource_manager-v3/proto_docs/google/protobuf/any.rb b/owl-bot-staging/google-cloud-resource_manager-v3/proto_docs/google/protobuf/any.rb deleted file mode 100644 index 58691995f02e..000000000000 --- a/owl-bot-staging/google-cloud-resource_manager-v3/proto_docs/google/protobuf/any.rb +++ /dev/null @@ -1,145 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - - -module Google - module Protobuf - # `Any` contains an arbitrary serialized protocol buffer message along with a - # URL that describes the type of the serialized message. - # - # Protobuf library provides support to pack/unpack Any values in the form - # of utility functions or additional generated methods of the Any type. - # - # Example 1: Pack and unpack a message in C++. - # - # Foo foo = ...; - # Any any; - # any.PackFrom(foo); - # ... - # if (any.UnpackTo(&foo)) { - # ... - # } - # - # Example 2: Pack and unpack a message in Java. - # - # Foo foo = ...; - # Any any = Any.pack(foo); - # ... - # if (any.is(Foo.class)) { - # foo = any.unpack(Foo.class); - # } - # // or ... - # if (any.isSameTypeAs(Foo.getDefaultInstance())) { - # foo = any.unpack(Foo.getDefaultInstance()); - # } - # - # Example 3: Pack and unpack a message in Python. - # - # foo = Foo(...) - # any = Any() - # any.Pack(foo) - # ... - # if any.Is(Foo.DESCRIPTOR): - # any.Unpack(foo) - # ... - # - # Example 4: Pack and unpack a message in Go - # - # foo := &pb.Foo{...} - # any, err := anypb.New(foo) - # if err != nil { - # ... - # } - # ... - # foo := &pb.Foo{} - # if err := any.UnmarshalTo(foo); err != nil { - # ... - # } - # - # The pack methods provided by protobuf library will by default use - # 'type.googleapis.com/full.type.name' as the type URL and the unpack - # methods only use the fully qualified type name after the last '/' - # in the type URL, for example "foo.bar.com/x/y.z" will yield type - # name "y.z". - # - # JSON - # ==== - # The JSON representation of an `Any` value uses the regular - # representation of the deserialized, embedded message, with an - # additional field `@type` which contains the type URL. Example: - # - # package google.profile; - # message Person { - # string first_name = 1; - # string last_name = 2; - # } - # - # { - # "@type": "type.googleapis.com/google.profile.Person", - # "firstName": , - # "lastName": - # } - # - # If the embedded message type is well-known and has a custom JSON - # representation, that representation will be embedded adding a field - # `value` which holds the custom JSON in addition to the `@type` - # field. Example (for message [google.protobuf.Duration][]): - # - # { - # "@type": "type.googleapis.com/google.protobuf.Duration", - # "value": "1.212s" - # } - # @!attribute [rw] type_url - # @return [::String] - # A URL/resource name that uniquely identifies the type of the serialized - # protocol buffer message. This string must contain at least - # one "/" character. The last segment of the URL's path must represent - # the fully qualified name of the type (as in - # `path/google.protobuf.Duration`). The name should be in a canonical form - # (e.g., leading "." is not accepted). - # - # In practice, teams usually precompile into the binary all types that they - # expect it to use in the context of Any. However, for URLs which use the - # scheme `http`, `https`, or no scheme, one can optionally set up a type - # server that maps type URLs to message definitions as follows: - # - # * If no scheme is provided, `https` is assumed. - # * An HTTP GET on the URL must yield a [google.protobuf.Type][] - # value in binary format, or produce an error. - # * Applications are allowed to cache lookup results based on the - # URL, or have them precompiled into a binary to avoid any - # lookup. Therefore, binary compatibility needs to be preserved - # on changes to types. (Use versioned type names to manage - # breaking changes.) - # - # Note: this functionality is not currently available in the official - # protobuf release, and it is not used for type URLs beginning with - # type.googleapis.com. As of May 2023, there are no widely used type server - # implementations and no plans to implement one. - # - # Schemes other than `http`, `https` (or the empty scheme) might be - # used with implementation specific semantics. - # @!attribute [rw] value - # @return [::String] - # Must be a valid serialized protocol buffer of the above specified type. - class Any - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - end -end diff --git a/owl-bot-staging/google-cloud-resource_manager-v3/proto_docs/google/protobuf/duration.rb b/owl-bot-staging/google-cloud-resource_manager-v3/proto_docs/google/protobuf/duration.rb deleted file mode 100644 index ea59f1f91daf..000000000000 --- a/owl-bot-staging/google-cloud-resource_manager-v3/proto_docs/google/protobuf/duration.rb +++ /dev/null @@ -1,98 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - - -module Google - module Protobuf - # A Duration represents a signed, fixed-length span of time represented - # as a count of seconds and fractions of seconds at nanosecond - # resolution. It is independent of any calendar and concepts like "day" - # or "month". It is related to Timestamp in that the difference between - # two Timestamp values is a Duration and it can be added or subtracted - # from a Timestamp. Range is approximately +-10,000 years. - # - # # Examples - # - # Example 1: Compute Duration from two Timestamps in pseudo code. - # - # Timestamp start = ...; - # Timestamp end = ...; - # Duration duration = ...; - # - # duration.seconds = end.seconds - start.seconds; - # duration.nanos = end.nanos - start.nanos; - # - # if (duration.seconds < 0 && duration.nanos > 0) { - # duration.seconds += 1; - # duration.nanos -= 1000000000; - # } else if (duration.seconds > 0 && duration.nanos < 0) { - # duration.seconds -= 1; - # duration.nanos += 1000000000; - # } - # - # Example 2: Compute Timestamp from Timestamp + Duration in pseudo code. - # - # Timestamp start = ...; - # Duration duration = ...; - # Timestamp end = ...; - # - # end.seconds = start.seconds + duration.seconds; - # end.nanos = start.nanos + duration.nanos; - # - # if (end.nanos < 0) { - # end.seconds -= 1; - # end.nanos += 1000000000; - # } else if (end.nanos >= 1000000000) { - # end.seconds += 1; - # end.nanos -= 1000000000; - # } - # - # Example 3: Compute Duration from datetime.timedelta in Python. - # - # td = datetime.timedelta(days=3, minutes=10) - # duration = Duration() - # duration.FromTimedelta(td) - # - # # JSON Mapping - # - # In JSON format, the Duration type is encoded as a string rather than an - # object, where the string ends in the suffix "s" (indicating seconds) and - # is preceded by the number of seconds, with nanoseconds expressed as - # fractional seconds. For example, 3 seconds with 0 nanoseconds should be - # encoded in JSON format as "3s", while 3 seconds and 1 nanosecond should - # be expressed in JSON format as "3.000000001s", and 3 seconds and 1 - # microsecond should be expressed in JSON format as "3.000001s". - # @!attribute [rw] seconds - # @return [::Integer] - # Signed seconds of the span of time. Must be from -315,576,000,000 - # to +315,576,000,000 inclusive. Note: these bounds are computed from: - # 60 sec/min * 60 min/hr * 24 hr/day * 365.25 days/year * 10000 years - # @!attribute [rw] nanos - # @return [::Integer] - # Signed fractions of a second at nanosecond resolution of the span - # of time. Durations less than one second are represented with a 0 - # `seconds` field and a positive or negative `nanos` field. For durations - # of one second or more, a non-zero value for the `nanos` field must be - # of the same sign as the `seconds` field. Must be from -999,999,999 - # to +999,999,999 inclusive. - class Duration - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - end -end diff --git a/owl-bot-staging/google-cloud-resource_manager-v3/proto_docs/google/protobuf/empty.rb b/owl-bot-staging/google-cloud-resource_manager-v3/proto_docs/google/protobuf/empty.rb deleted file mode 100644 index 83e4481834a6..000000000000 --- a/owl-bot-staging/google-cloud-resource_manager-v3/proto_docs/google/protobuf/empty.rb +++ /dev/null @@ -1,34 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - - -module Google - module Protobuf - # A generic empty message that you can re-use to avoid defining duplicated - # empty messages in your APIs. A typical example is to use it as the request - # or the response type of an API method. For instance: - # - # service Foo { - # rpc Bar(google.protobuf.Empty) returns (google.protobuf.Empty); - # } - class Empty - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - end -end diff --git a/owl-bot-staging/google-cloud-resource_manager-v3/proto_docs/google/protobuf/field_mask.rb b/owl-bot-staging/google-cloud-resource_manager-v3/proto_docs/google/protobuf/field_mask.rb deleted file mode 100644 index 7f3ffc78601a..000000000000 --- a/owl-bot-staging/google-cloud-resource_manager-v3/proto_docs/google/protobuf/field_mask.rb +++ /dev/null @@ -1,229 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - - -module Google - module Protobuf - # `FieldMask` represents a set of symbolic field paths, for example: - # - # paths: "f.a" - # paths: "f.b.d" - # - # Here `f` represents a field in some root message, `a` and `b` - # fields in the message found in `f`, and `d` a field found in the - # message in `f.b`. - # - # Field masks are used to specify a subset of fields that should be - # returned by a get operation or modified by an update operation. - # Field masks also have a custom JSON encoding (see below). - # - # # Field Masks in Projections - # - # When used in the context of a projection, a response message or - # sub-message is filtered by the API to only contain those fields as - # specified in the mask. For example, if the mask in the previous - # example is applied to a response message as follows: - # - # f { - # a : 22 - # b { - # d : 1 - # x : 2 - # } - # y : 13 - # } - # z: 8 - # - # The result will not contain specific values for fields x,y and z - # (their value will be set to the default, and omitted in proto text - # output): - # - # - # f { - # a : 22 - # b { - # d : 1 - # } - # } - # - # A repeated field is not allowed except at the last position of a - # paths string. - # - # If a FieldMask object is not present in a get operation, the - # operation applies to all fields (as if a FieldMask of all fields - # had been specified). - # - # Note that a field mask does not necessarily apply to the - # top-level response message. In case of a REST get operation, the - # field mask applies directly to the response, but in case of a REST - # list operation, the mask instead applies to each individual message - # in the returned resource list. In case of a REST custom method, - # other definitions may be used. Where the mask applies will be - # clearly documented together with its declaration in the API. In - # any case, the effect on the returned resource/resources is required - # behavior for APIs. - # - # # Field Masks in Update Operations - # - # A field mask in update operations specifies which fields of the - # targeted resource are going to be updated. The API is required - # to only change the values of the fields as specified in the mask - # and leave the others untouched. If a resource is passed in to - # describe the updated values, the API ignores the values of all - # fields not covered by the mask. - # - # If a repeated field is specified for an update operation, new values will - # be appended to the existing repeated field in the target resource. Note that - # a repeated field is only allowed in the last position of a `paths` string. - # - # If a sub-message is specified in the last position of the field mask for an - # update operation, then new value will be merged into the existing sub-message - # in the target resource. - # - # For example, given the target message: - # - # f { - # b { - # d: 1 - # x: 2 - # } - # c: [1] - # } - # - # And an update message: - # - # f { - # b { - # d: 10 - # } - # c: [2] - # } - # - # then if the field mask is: - # - # paths: ["f.b", "f.c"] - # - # then the result will be: - # - # f { - # b { - # d: 10 - # x: 2 - # } - # c: [1, 2] - # } - # - # An implementation may provide options to override this default behavior for - # repeated and message fields. - # - # In order to reset a field's value to the default, the field must - # be in the mask and set to the default value in the provided resource. - # Hence, in order to reset all fields of a resource, provide a default - # instance of the resource and set all fields in the mask, or do - # not provide a mask as described below. - # - # If a field mask is not present on update, the operation applies to - # all fields (as if a field mask of all fields has been specified). - # Note that in the presence of schema evolution, this may mean that - # fields the client does not know and has therefore not filled into - # the request will be reset to their default. If this is unwanted - # behavior, a specific service may require a client to always specify - # a field mask, producing an error if not. - # - # As with get operations, the location of the resource which - # describes the updated values in the request message depends on the - # operation kind. In any case, the effect of the field mask is - # required to be honored by the API. - # - # ## Considerations for HTTP REST - # - # The HTTP kind of an update operation which uses a field mask must - # be set to PATCH instead of PUT in order to satisfy HTTP semantics - # (PUT must only be used for full updates). - # - # # JSON Encoding of Field Masks - # - # In JSON, a field mask is encoded as a single string where paths are - # separated by a comma. Fields name in each path are converted - # to/from lower-camel naming conventions. - # - # As an example, consider the following message declarations: - # - # message Profile { - # User user = 1; - # Photo photo = 2; - # } - # message User { - # string display_name = 1; - # string address = 2; - # } - # - # In proto a field mask for `Profile` may look as such: - # - # mask { - # paths: "user.display_name" - # paths: "photo" - # } - # - # In JSON, the same mask is represented as below: - # - # { - # mask: "user.displayName,photo" - # } - # - # # Field Masks and Oneof Fields - # - # Field masks treat fields in oneofs just as regular fields. Consider the - # following message: - # - # message SampleMessage { - # oneof test_oneof { - # string name = 4; - # SubMessage sub_message = 9; - # } - # } - # - # The field mask can be: - # - # mask { - # paths: "name" - # } - # - # Or: - # - # mask { - # paths: "sub_message" - # } - # - # Note that oneof type names ("test_oneof" in this case) cannot be used in - # paths. - # - # ## Field Mask Verification - # - # The implementation of any API method which has a FieldMask type field in the - # request should verify the included field paths, and return an - # `INVALID_ARGUMENT` error if any path is unmappable. - # @!attribute [rw] paths - # @return [::Array<::String>] - # The set of field mask paths. - class FieldMask - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - end -end diff --git a/owl-bot-staging/google-cloud-resource_manager-v3/proto_docs/google/protobuf/timestamp.rb b/owl-bot-staging/google-cloud-resource_manager-v3/proto_docs/google/protobuf/timestamp.rb deleted file mode 100644 index 74352be9c58c..000000000000 --- a/owl-bot-staging/google-cloud-resource_manager-v3/proto_docs/google/protobuf/timestamp.rb +++ /dev/null @@ -1,127 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - - -module Google - module Protobuf - # A Timestamp represents a point in time independent of any time zone or local - # calendar, encoded as a count of seconds and fractions of seconds at - # nanosecond resolution. The count is relative to an epoch at UTC midnight on - # January 1, 1970, in the proleptic Gregorian calendar which extends the - # Gregorian calendar backwards to year one. - # - # All minutes are 60 seconds long. Leap seconds are "smeared" so that no leap - # second table is needed for interpretation, using a [24-hour linear - # smear](https://developers.google.com/time/smear). - # - # The range is from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59.999999999Z. By - # restricting to that range, we ensure that we can convert to and from [RFC - # 3339](https://www.ietf.org/rfc/rfc3339.txt) date strings. - # - # # Examples - # - # Example 1: Compute Timestamp from POSIX `time()`. - # - # Timestamp timestamp; - # timestamp.set_seconds(time(NULL)); - # timestamp.set_nanos(0); - # - # Example 2: Compute Timestamp from POSIX `gettimeofday()`. - # - # struct timeval tv; - # gettimeofday(&tv, NULL); - # - # Timestamp timestamp; - # timestamp.set_seconds(tv.tv_sec); - # timestamp.set_nanos(tv.tv_usec * 1000); - # - # Example 3: Compute Timestamp from Win32 `GetSystemTimeAsFileTime()`. - # - # FILETIME ft; - # GetSystemTimeAsFileTime(&ft); - # UINT64 ticks = (((UINT64)ft.dwHighDateTime) << 32) | ft.dwLowDateTime; - # - # // A Windows tick is 100 nanoseconds. Windows epoch 1601-01-01T00:00:00Z - # // is 11644473600 seconds before Unix epoch 1970-01-01T00:00:00Z. - # Timestamp timestamp; - # timestamp.set_seconds((INT64) ((ticks / 10000000) - 11644473600LL)); - # timestamp.set_nanos((INT32) ((ticks % 10000000) * 100)); - # - # Example 4: Compute Timestamp from Java `System.currentTimeMillis()`. - # - # long millis = System.currentTimeMillis(); - # - # Timestamp timestamp = Timestamp.newBuilder().setSeconds(millis / 1000) - # .setNanos((int) ((millis % 1000) * 1000000)).build(); - # - # Example 5: Compute Timestamp from Java `Instant.now()`. - # - # Instant now = Instant.now(); - # - # Timestamp timestamp = - # Timestamp.newBuilder().setSeconds(now.getEpochSecond()) - # .setNanos(now.getNano()).build(); - # - # Example 6: Compute Timestamp from current time in Python. - # - # timestamp = Timestamp() - # timestamp.GetCurrentTime() - # - # # JSON Mapping - # - # In JSON format, the Timestamp type is encoded as a string in the - # [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format. That is, the - # format is "\\{year}-\\{month}-\\{day}T\\{hour}:\\{min}:\\{sec}[.\\{frac_sec}]Z" - # where \\{year} is always expressed using four digits while \\{month}, \\{day}, - # \\{hour}, \\{min}, and \\{sec} are zero-padded to two digits each. The fractional - # seconds, which can go up to 9 digits (i.e. up to 1 nanosecond resolution), - # are optional. The "Z" suffix indicates the timezone ("UTC"); the timezone - # is required. A proto3 JSON serializer should always use UTC (as indicated by - # "Z") when printing the Timestamp type and a proto3 JSON parser should be - # able to accept both UTC and other timezones (as indicated by an offset). - # - # For example, "2017-01-15T01:30:15.01Z" encodes 15.01 seconds past - # 01:30 UTC on January 15, 2017. - # - # In JavaScript, one can convert a Date object to this format using the - # standard - # [toISOString()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toISOString) - # method. In Python, a standard `datetime.datetime` object can be converted - # to this format using - # [`strftime`](https://docs.python.org/2/library/time.html#time.strftime) with - # the time format spec '%Y-%m-%dT%H:%M:%S.%fZ'. Likewise, in Java, one can use - # the Joda Time's [`ISODateTimeFormat.dateTime()`]( - # http://joda-time.sourceforge.net/apidocs/org/joda/time/format/ISODateTimeFormat.html#dateTime() - # ) to obtain a formatter capable of generating timestamps in this format. - # @!attribute [rw] seconds - # @return [::Integer] - # Represents seconds of UTC time since Unix epoch - # 1970-01-01T00:00:00Z. Must be from 0001-01-01T00:00:00Z to - # 9999-12-31T23:59:59Z inclusive. - # @!attribute [rw] nanos - # @return [::Integer] - # Non-negative fractions of a second at nanosecond resolution. Negative - # second values with fractions must still have non-negative nanos values - # that count forward in time. Must be from 0 to 999,999,999 - # inclusive. - class Timestamp - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - end -end diff --git a/owl-bot-staging/google-cloud-resource_manager-v3/proto_docs/google/rpc/status.rb b/owl-bot-staging/google-cloud-resource_manager-v3/proto_docs/google/rpc/status.rb deleted file mode 100644 index c1a1c07eb2db..000000000000 --- a/owl-bot-staging/google-cloud-resource_manager-v3/proto_docs/google/rpc/status.rb +++ /dev/null @@ -1,48 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - - -module Google - module Rpc - # The `Status` type defines a logical error model that is suitable for - # different programming environments, including REST APIs and RPC APIs. It is - # used by [gRPC](https://github.com/grpc). Each `Status` message contains - # three pieces of data: error code, error message, and error details. - # - # You can find out more about this error model and how to work with it in the - # [API Design Guide](https://cloud.google.com/apis/design/errors). - # @!attribute [rw] code - # @return [::Integer] - # The status code, which should be an enum value of - # [google.rpc.Code][google.rpc.Code]. - # @!attribute [rw] message - # @return [::String] - # A developer-facing error message, which should be in English. Any - # user-facing error message should be localized and sent in the - # {::Google::Rpc::Status#details google.rpc.Status.details} field, or localized - # by the client. - # @!attribute [rw] details - # @return [::Array<::Google::Protobuf::Any>] - # A list of messages that carry the error details. There is a common set of - # message types for APIs to use. - class Status - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - end -end diff --git a/owl-bot-staging/google-cloud-resource_manager-v3/proto_docs/google/type/expr.rb b/owl-bot-staging/google-cloud-resource_manager-v3/proto_docs/google/type/expr.rb deleted file mode 100644 index 53e7733b6592..000000000000 --- a/owl-bot-staging/google-cloud-resource_manager-v3/proto_docs/google/type/expr.rb +++ /dev/null @@ -1,75 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - - -module Google - module Type - # Represents a textual expression in the Common Expression Language (CEL) - # syntax. CEL is a C-like expression language. The syntax and semantics of CEL - # are documented at https://github.com/google/cel-spec. - # - # Example (Comparison): - # - # title: "Summary size limit" - # description: "Determines if a summary is less than 100 chars" - # expression: "document.summary.size() < 100" - # - # Example (Equality): - # - # title: "Requestor is owner" - # description: "Determines if requestor is the document owner" - # expression: "document.owner == request.auth.claims.email" - # - # Example (Logic): - # - # title: "Public documents" - # description: "Determine whether the document should be publicly visible" - # expression: "document.type != 'private' && document.type != 'internal'" - # - # Example (Data Manipulation): - # - # title: "Notification string" - # description: "Create a notification string with a timestamp." - # expression: "'New message received at ' + string(document.create_time)" - # - # The exact variables and functions that may be referenced within an expression - # are determined by the service that evaluates it. See the service - # documentation for additional information. - # @!attribute [rw] expression - # @return [::String] - # Textual representation of an expression in Common Expression Language - # syntax. - # @!attribute [rw] title - # @return [::String] - # Optional. Title for the expression, i.e. a short string describing - # its purpose. This can be used e.g. in UIs which allow to enter the - # expression. - # @!attribute [rw] description - # @return [::String] - # Optional. Description of the expression. This is a longer text which - # describes the expression, e.g. when hovered over it in a UI. - # @!attribute [rw] location - # @return [::String] - # Optional. String indicating the location of the expression for error - # reporting, e.g. a file name and a position in the file. - class Expr - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - end -end diff --git a/owl-bot-staging/google-cloud-resource_manager-v3/snippets/Gemfile b/owl-bot-staging/google-cloud-resource_manager-v3/snippets/Gemfile deleted file mode 100644 index 128b7f729ebc..000000000000 --- a/owl-bot-staging/google-cloud-resource_manager-v3/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-resource_manager-v3", path: "../" -else - gem "google-cloud-resource_manager-v3" -end - -group :test do - gem "google-style", "~> 1.26.1" - gem "minitest", "~> 5.16" - gem "minitest-focus", "~> 1.1" - gem "minitest-hooks", "~> 1.5" -end diff --git a/owl-bot-staging/google-cloud-resource_manager-v3/snippets/folders/create_folder.rb b/owl-bot-staging/google-cloud-resource_manager-v3/snippets/folders/create_folder.rb deleted file mode 100644 index d3012301474e..000000000000 --- a/owl-bot-staging/google-cloud-resource_manager-v3/snippets/folders/create_folder.rb +++ /dev/null @@ -1,54 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -# [START cloudresourcemanager_v3_generated_Folders_CreateFolder_sync] -require "google/cloud/resource_manager/v3" - -## -# Snippet for the create_folder call in the Folders service -# -# This snippet has been automatically generated and should be regarded as a code -# template only. It will require modifications to work: -# - It may require correct/in-range values for request initialization. -# - It may require specifying regional endpoints when creating the service -# client as shown in https://cloud.google.com/ruby/docs/reference. -# -# This is an auto-generated example demonstrating basic usage of -# Google::Cloud::ResourceManager::V3::Folders::Client#create_folder. -# -def create_folder - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::ResourceManager::V3::Folders::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::ResourceManager::V3::CreateFolderRequest.new - - # Call the create_folder method. - result = client.create_folder request - - # The returned object is of type Gapic::Operation. You can use it to - # check the status of an operation, cancel it, or wait for results. - # Here is how to wait for a response. - result.wait_until_done! timeout: 60 - if result.response? - p result.response - else - puts "No response received." - end -end -# [END cloudresourcemanager_v3_generated_Folders_CreateFolder_sync] diff --git a/owl-bot-staging/google-cloud-resource_manager-v3/snippets/folders/delete_folder.rb b/owl-bot-staging/google-cloud-resource_manager-v3/snippets/folders/delete_folder.rb deleted file mode 100644 index 3a25238e52b5..000000000000 --- a/owl-bot-staging/google-cloud-resource_manager-v3/snippets/folders/delete_folder.rb +++ /dev/null @@ -1,54 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -# [START cloudresourcemanager_v3_generated_Folders_DeleteFolder_sync] -require "google/cloud/resource_manager/v3" - -## -# Snippet for the delete_folder call in the Folders service -# -# This snippet has been automatically generated and should be regarded as a code -# template only. It will require modifications to work: -# - It may require correct/in-range values for request initialization. -# - It may require specifying regional endpoints when creating the service -# client as shown in https://cloud.google.com/ruby/docs/reference. -# -# This is an auto-generated example demonstrating basic usage of -# Google::Cloud::ResourceManager::V3::Folders::Client#delete_folder. -# -def delete_folder - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::ResourceManager::V3::Folders::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::ResourceManager::V3::DeleteFolderRequest.new - - # Call the delete_folder method. - result = client.delete_folder request - - # The returned object is of type Gapic::Operation. You can use it to - # check the status of an operation, cancel it, or wait for results. - # Here is how to wait for a response. - result.wait_until_done! timeout: 60 - if result.response? - p result.response - else - puts "No response received." - end -end -# [END cloudresourcemanager_v3_generated_Folders_DeleteFolder_sync] diff --git a/owl-bot-staging/google-cloud-resource_manager-v3/snippets/folders/get_folder.rb b/owl-bot-staging/google-cloud-resource_manager-v3/snippets/folders/get_folder.rb deleted file mode 100644 index 910c79072b8a..000000000000 --- a/owl-bot-staging/google-cloud-resource_manager-v3/snippets/folders/get_folder.rb +++ /dev/null @@ -1,47 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -# [START cloudresourcemanager_v3_generated_Folders_GetFolder_sync] -require "google/cloud/resource_manager/v3" - -## -# Snippet for the get_folder call in the Folders service -# -# This snippet has been automatically generated and should be regarded as a code -# template only. It will require modifications to work: -# - It may require correct/in-range values for request initialization. -# - It may require specifying regional endpoints when creating the service -# client as shown in https://cloud.google.com/ruby/docs/reference. -# -# This is an auto-generated example demonstrating basic usage of -# Google::Cloud::ResourceManager::V3::Folders::Client#get_folder. -# -def get_folder - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::ResourceManager::V3::Folders::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::ResourceManager::V3::GetFolderRequest.new - - # Call the get_folder method. - result = client.get_folder request - - # The returned object is of type Google::Cloud::ResourceManager::V3::Folder. - p result -end -# [END cloudresourcemanager_v3_generated_Folders_GetFolder_sync] diff --git a/owl-bot-staging/google-cloud-resource_manager-v3/snippets/folders/get_iam_policy.rb b/owl-bot-staging/google-cloud-resource_manager-v3/snippets/folders/get_iam_policy.rb deleted file mode 100644 index 5792a996c39c..000000000000 --- a/owl-bot-staging/google-cloud-resource_manager-v3/snippets/folders/get_iam_policy.rb +++ /dev/null @@ -1,47 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -# [START cloudresourcemanager_v3_generated_Folders_GetIamPolicy_sync] -require "google/cloud/resource_manager/v3" - -## -# Snippet for the get_iam_policy call in the Folders service -# -# This snippet has been automatically generated and should be regarded as a code -# template only. It will require modifications to work: -# - It may require correct/in-range values for request initialization. -# - It may require specifying regional endpoints when creating the service -# client as shown in https://cloud.google.com/ruby/docs/reference. -# -# This is an auto-generated example demonstrating basic usage of -# Google::Cloud::ResourceManager::V3::Folders::Client#get_iam_policy. -# -def get_iam_policy - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::ResourceManager::V3::Folders::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Iam::V1::GetIamPolicyRequest.new - - # Call the get_iam_policy method. - result = client.get_iam_policy request - - # The returned object is of type Google::Iam::V1::Policy. - p result -end -# [END cloudresourcemanager_v3_generated_Folders_GetIamPolicy_sync] diff --git a/owl-bot-staging/google-cloud-resource_manager-v3/snippets/folders/list_folders.rb b/owl-bot-staging/google-cloud-resource_manager-v3/snippets/folders/list_folders.rb deleted file mode 100644 index 278c2e261ea1..000000000000 --- a/owl-bot-staging/google-cloud-resource_manager-v3/snippets/folders/list_folders.rb +++ /dev/null @@ -1,51 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -# [START cloudresourcemanager_v3_generated_Folders_ListFolders_sync] -require "google/cloud/resource_manager/v3" - -## -# Snippet for the list_folders call in the Folders service -# -# This snippet has been automatically generated and should be regarded as a code -# template only. It will require modifications to work: -# - It may require correct/in-range values for request initialization. -# - It may require specifying regional endpoints when creating the service -# client as shown in https://cloud.google.com/ruby/docs/reference. -# -# This is an auto-generated example demonstrating basic usage of -# Google::Cloud::ResourceManager::V3::Folders::Client#list_folders. -# -def list_folders - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::ResourceManager::V3::Folders::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::ResourceManager::V3::ListFoldersRequest.new - - # Call the list_folders method. - result = client.list_folders request - - # The returned object is of type Gapic::PagedEnumerable. You can iterate - # over elements, and API calls will be issued to fetch pages as needed. - result.each do |item| - # Each element is of type ::Google::Cloud::ResourceManager::V3::Folder. - p item - end -end -# [END cloudresourcemanager_v3_generated_Folders_ListFolders_sync] diff --git a/owl-bot-staging/google-cloud-resource_manager-v3/snippets/folders/move_folder.rb b/owl-bot-staging/google-cloud-resource_manager-v3/snippets/folders/move_folder.rb deleted file mode 100644 index fa3c39da9167..000000000000 --- a/owl-bot-staging/google-cloud-resource_manager-v3/snippets/folders/move_folder.rb +++ /dev/null @@ -1,54 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -# [START cloudresourcemanager_v3_generated_Folders_MoveFolder_sync] -require "google/cloud/resource_manager/v3" - -## -# Snippet for the move_folder call in the Folders service -# -# This snippet has been automatically generated and should be regarded as a code -# template only. It will require modifications to work: -# - It may require correct/in-range values for request initialization. -# - It may require specifying regional endpoints when creating the service -# client as shown in https://cloud.google.com/ruby/docs/reference. -# -# This is an auto-generated example demonstrating basic usage of -# Google::Cloud::ResourceManager::V3::Folders::Client#move_folder. -# -def move_folder - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::ResourceManager::V3::Folders::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::ResourceManager::V3::MoveFolderRequest.new - - # Call the move_folder method. - result = client.move_folder request - - # The returned object is of type Gapic::Operation. You can use it to - # check the status of an operation, cancel it, or wait for results. - # Here is how to wait for a response. - result.wait_until_done! timeout: 60 - if result.response? - p result.response - else - puts "No response received." - end -end -# [END cloudresourcemanager_v3_generated_Folders_MoveFolder_sync] diff --git a/owl-bot-staging/google-cloud-resource_manager-v3/snippets/folders/search_folders.rb b/owl-bot-staging/google-cloud-resource_manager-v3/snippets/folders/search_folders.rb deleted file mode 100644 index 6647cbb197f5..000000000000 --- a/owl-bot-staging/google-cloud-resource_manager-v3/snippets/folders/search_folders.rb +++ /dev/null @@ -1,51 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -# [START cloudresourcemanager_v3_generated_Folders_SearchFolders_sync] -require "google/cloud/resource_manager/v3" - -## -# Snippet for the search_folders call in the Folders service -# -# This snippet has been automatically generated and should be regarded as a code -# template only. It will require modifications to work: -# - It may require correct/in-range values for request initialization. -# - It may require specifying regional endpoints when creating the service -# client as shown in https://cloud.google.com/ruby/docs/reference. -# -# This is an auto-generated example demonstrating basic usage of -# Google::Cloud::ResourceManager::V3::Folders::Client#search_folders. -# -def search_folders - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::ResourceManager::V3::Folders::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::ResourceManager::V3::SearchFoldersRequest.new - - # Call the search_folders method. - result = client.search_folders request - - # The returned object is of type Gapic::PagedEnumerable. You can iterate - # over elements, and API calls will be issued to fetch pages as needed. - result.each do |item| - # Each element is of type ::Google::Cloud::ResourceManager::V3::Folder. - p item - end -end -# [END cloudresourcemanager_v3_generated_Folders_SearchFolders_sync] diff --git a/owl-bot-staging/google-cloud-resource_manager-v3/snippets/folders/set_iam_policy.rb b/owl-bot-staging/google-cloud-resource_manager-v3/snippets/folders/set_iam_policy.rb deleted file mode 100644 index 4a0b84555e3e..000000000000 --- a/owl-bot-staging/google-cloud-resource_manager-v3/snippets/folders/set_iam_policy.rb +++ /dev/null @@ -1,47 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -# [START cloudresourcemanager_v3_generated_Folders_SetIamPolicy_sync] -require "google/cloud/resource_manager/v3" - -## -# Snippet for the set_iam_policy call in the Folders service -# -# This snippet has been automatically generated and should be regarded as a code -# template only. It will require modifications to work: -# - It may require correct/in-range values for request initialization. -# - It may require specifying regional endpoints when creating the service -# client as shown in https://cloud.google.com/ruby/docs/reference. -# -# This is an auto-generated example demonstrating basic usage of -# Google::Cloud::ResourceManager::V3::Folders::Client#set_iam_policy. -# -def set_iam_policy - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::ResourceManager::V3::Folders::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Iam::V1::SetIamPolicyRequest.new - - # Call the set_iam_policy method. - result = client.set_iam_policy request - - # The returned object is of type Google::Iam::V1::Policy. - p result -end -# [END cloudresourcemanager_v3_generated_Folders_SetIamPolicy_sync] diff --git a/owl-bot-staging/google-cloud-resource_manager-v3/snippets/folders/test_iam_permissions.rb b/owl-bot-staging/google-cloud-resource_manager-v3/snippets/folders/test_iam_permissions.rb deleted file mode 100644 index abd81f513e9b..000000000000 --- a/owl-bot-staging/google-cloud-resource_manager-v3/snippets/folders/test_iam_permissions.rb +++ /dev/null @@ -1,47 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -# [START cloudresourcemanager_v3_generated_Folders_TestIamPermissions_sync] -require "google/cloud/resource_manager/v3" - -## -# Snippet for the test_iam_permissions call in the Folders service -# -# This snippet has been automatically generated and should be regarded as a code -# template only. It will require modifications to work: -# - It may require correct/in-range values for request initialization. -# - It may require specifying regional endpoints when creating the service -# client as shown in https://cloud.google.com/ruby/docs/reference. -# -# This is an auto-generated example demonstrating basic usage of -# Google::Cloud::ResourceManager::V3::Folders::Client#test_iam_permissions. -# -def test_iam_permissions - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::ResourceManager::V3::Folders::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Iam::V1::TestIamPermissionsRequest.new - - # Call the test_iam_permissions method. - result = client.test_iam_permissions request - - # The returned object is of type Google::Iam::V1::TestIamPermissionsResponse. - p result -end -# [END cloudresourcemanager_v3_generated_Folders_TestIamPermissions_sync] diff --git a/owl-bot-staging/google-cloud-resource_manager-v3/snippets/folders/undelete_folder.rb b/owl-bot-staging/google-cloud-resource_manager-v3/snippets/folders/undelete_folder.rb deleted file mode 100644 index 0bdd869f25f6..000000000000 --- a/owl-bot-staging/google-cloud-resource_manager-v3/snippets/folders/undelete_folder.rb +++ /dev/null @@ -1,54 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -# [START cloudresourcemanager_v3_generated_Folders_UndeleteFolder_sync] -require "google/cloud/resource_manager/v3" - -## -# Snippet for the undelete_folder call in the Folders service -# -# This snippet has been automatically generated and should be regarded as a code -# template only. It will require modifications to work: -# - It may require correct/in-range values for request initialization. -# - It may require specifying regional endpoints when creating the service -# client as shown in https://cloud.google.com/ruby/docs/reference. -# -# This is an auto-generated example demonstrating basic usage of -# Google::Cloud::ResourceManager::V3::Folders::Client#undelete_folder. -# -def undelete_folder - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::ResourceManager::V3::Folders::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::ResourceManager::V3::UndeleteFolderRequest.new - - # Call the undelete_folder method. - result = client.undelete_folder request - - # The returned object is of type Gapic::Operation. You can use it to - # check the status of an operation, cancel it, or wait for results. - # Here is how to wait for a response. - result.wait_until_done! timeout: 60 - if result.response? - p result.response - else - puts "No response received." - end -end -# [END cloudresourcemanager_v3_generated_Folders_UndeleteFolder_sync] diff --git a/owl-bot-staging/google-cloud-resource_manager-v3/snippets/folders/update_folder.rb b/owl-bot-staging/google-cloud-resource_manager-v3/snippets/folders/update_folder.rb deleted file mode 100644 index ff425f85216e..000000000000 --- a/owl-bot-staging/google-cloud-resource_manager-v3/snippets/folders/update_folder.rb +++ /dev/null @@ -1,54 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -# [START cloudresourcemanager_v3_generated_Folders_UpdateFolder_sync] -require "google/cloud/resource_manager/v3" - -## -# Snippet for the update_folder call in the Folders service -# -# This snippet has been automatically generated and should be regarded as a code -# template only. It will require modifications to work: -# - It may require correct/in-range values for request initialization. -# - It may require specifying regional endpoints when creating the service -# client as shown in https://cloud.google.com/ruby/docs/reference. -# -# This is an auto-generated example demonstrating basic usage of -# Google::Cloud::ResourceManager::V3::Folders::Client#update_folder. -# -def update_folder - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::ResourceManager::V3::Folders::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::ResourceManager::V3::UpdateFolderRequest.new - - # Call the update_folder method. - result = client.update_folder request - - # The returned object is of type Gapic::Operation. You can use it to - # check the status of an operation, cancel it, or wait for results. - # Here is how to wait for a response. - result.wait_until_done! timeout: 60 - if result.response? - p result.response - else - puts "No response received." - end -end -# [END cloudresourcemanager_v3_generated_Folders_UpdateFolder_sync] diff --git a/owl-bot-staging/google-cloud-resource_manager-v3/snippets/organizations/get_iam_policy.rb b/owl-bot-staging/google-cloud-resource_manager-v3/snippets/organizations/get_iam_policy.rb deleted file mode 100644 index 6cae03a852ab..000000000000 --- a/owl-bot-staging/google-cloud-resource_manager-v3/snippets/organizations/get_iam_policy.rb +++ /dev/null @@ -1,47 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -# [START cloudresourcemanager_v3_generated_Organizations_GetIamPolicy_sync] -require "google/cloud/resource_manager/v3" - -## -# Snippet for the get_iam_policy call in the Organizations service -# -# This snippet has been automatically generated and should be regarded as a code -# template only. It will require modifications to work: -# - It may require correct/in-range values for request initialization. -# - It may require specifying regional endpoints when creating the service -# client as shown in https://cloud.google.com/ruby/docs/reference. -# -# This is an auto-generated example demonstrating basic usage of -# Google::Cloud::ResourceManager::V3::Organizations::Client#get_iam_policy. -# -def get_iam_policy - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::ResourceManager::V3::Organizations::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Iam::V1::GetIamPolicyRequest.new - - # Call the get_iam_policy method. - result = client.get_iam_policy request - - # The returned object is of type Google::Iam::V1::Policy. - p result -end -# [END cloudresourcemanager_v3_generated_Organizations_GetIamPolicy_sync] diff --git a/owl-bot-staging/google-cloud-resource_manager-v3/snippets/organizations/get_organization.rb b/owl-bot-staging/google-cloud-resource_manager-v3/snippets/organizations/get_organization.rb deleted file mode 100644 index b23884e4e193..000000000000 --- a/owl-bot-staging/google-cloud-resource_manager-v3/snippets/organizations/get_organization.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 cloudresourcemanager_v3_generated_Organizations_GetOrganization_sync] -require "google/cloud/resource_manager/v3" - -## -# Snippet for the get_organization call in the Organizations service -# -# This snippet has been automatically generated and should be regarded as a code -# template only. It will require modifications to work: -# - It may require correct/in-range values for request initialization. -# - It may require specifying regional endpoints when creating the service -# client as shown in https://cloud.google.com/ruby/docs/reference. -# -# This is an auto-generated example demonstrating basic usage of -# Google::Cloud::ResourceManager::V3::Organizations::Client#get_organization. -# -def get_organization - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::ResourceManager::V3::Organizations::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::ResourceManager::V3::GetOrganizationRequest.new - - # Call the get_organization method. - result = client.get_organization request - - # The returned object is of type Google::Cloud::ResourceManager::V3::Organization. - p result -end -# [END cloudresourcemanager_v3_generated_Organizations_GetOrganization_sync] diff --git a/owl-bot-staging/google-cloud-resource_manager-v3/snippets/organizations/search_organizations.rb b/owl-bot-staging/google-cloud-resource_manager-v3/snippets/organizations/search_organizations.rb deleted file mode 100644 index 51f2ab2ef75a..000000000000 --- a/owl-bot-staging/google-cloud-resource_manager-v3/snippets/organizations/search_organizations.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 cloudresourcemanager_v3_generated_Organizations_SearchOrganizations_sync] -require "google/cloud/resource_manager/v3" - -## -# Snippet for the search_organizations call in the Organizations service -# -# This snippet has been automatically generated and should be regarded as a code -# template only. It will require modifications to work: -# - It may require correct/in-range values for request initialization. -# - It may require specifying regional endpoints when creating the service -# client as shown in https://cloud.google.com/ruby/docs/reference. -# -# This is an auto-generated example demonstrating basic usage of -# Google::Cloud::ResourceManager::V3::Organizations::Client#search_organizations. -# -def search_organizations - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::ResourceManager::V3::Organizations::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::ResourceManager::V3::SearchOrganizationsRequest.new - - # Call the search_organizations method. - result = client.search_organizations request - - # The returned object is of type Gapic::PagedEnumerable. You can iterate - # over elements, and API calls will be issued to fetch pages as needed. - result.each do |item| - # Each element is of type ::Google::Cloud::ResourceManager::V3::Organization. - p item - end -end -# [END cloudresourcemanager_v3_generated_Organizations_SearchOrganizations_sync] diff --git a/owl-bot-staging/google-cloud-resource_manager-v3/snippets/organizations/set_iam_policy.rb b/owl-bot-staging/google-cloud-resource_manager-v3/snippets/organizations/set_iam_policy.rb deleted file mode 100644 index 5b3897026ec1..000000000000 --- a/owl-bot-staging/google-cloud-resource_manager-v3/snippets/organizations/set_iam_policy.rb +++ /dev/null @@ -1,47 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -# [START cloudresourcemanager_v3_generated_Organizations_SetIamPolicy_sync] -require "google/cloud/resource_manager/v3" - -## -# Snippet for the set_iam_policy call in the Organizations service -# -# This snippet has been automatically generated and should be regarded as a code -# template only. It will require modifications to work: -# - It may require correct/in-range values for request initialization. -# - It may require specifying regional endpoints when creating the service -# client as shown in https://cloud.google.com/ruby/docs/reference. -# -# This is an auto-generated example demonstrating basic usage of -# Google::Cloud::ResourceManager::V3::Organizations::Client#set_iam_policy. -# -def set_iam_policy - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::ResourceManager::V3::Organizations::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Iam::V1::SetIamPolicyRequest.new - - # Call the set_iam_policy method. - result = client.set_iam_policy request - - # The returned object is of type Google::Iam::V1::Policy. - p result -end -# [END cloudresourcemanager_v3_generated_Organizations_SetIamPolicy_sync] diff --git a/owl-bot-staging/google-cloud-resource_manager-v3/snippets/organizations/test_iam_permissions.rb b/owl-bot-staging/google-cloud-resource_manager-v3/snippets/organizations/test_iam_permissions.rb deleted file mode 100644 index b62815b436b7..000000000000 --- a/owl-bot-staging/google-cloud-resource_manager-v3/snippets/organizations/test_iam_permissions.rb +++ /dev/null @@ -1,47 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -# [START cloudresourcemanager_v3_generated_Organizations_TestIamPermissions_sync] -require "google/cloud/resource_manager/v3" - -## -# Snippet for the test_iam_permissions call in the Organizations service -# -# This snippet has been automatically generated and should be regarded as a code -# template only. It will require modifications to work: -# - It may require correct/in-range values for request initialization. -# - It may require specifying regional endpoints when creating the service -# client as shown in https://cloud.google.com/ruby/docs/reference. -# -# This is an auto-generated example demonstrating basic usage of -# Google::Cloud::ResourceManager::V3::Organizations::Client#test_iam_permissions. -# -def test_iam_permissions - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::ResourceManager::V3::Organizations::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Iam::V1::TestIamPermissionsRequest.new - - # Call the test_iam_permissions method. - result = client.test_iam_permissions request - - # The returned object is of type Google::Iam::V1::TestIamPermissionsResponse. - p result -end -# [END cloudresourcemanager_v3_generated_Organizations_TestIamPermissions_sync] diff --git a/owl-bot-staging/google-cloud-resource_manager-v3/snippets/projects/create_project.rb b/owl-bot-staging/google-cloud-resource_manager-v3/snippets/projects/create_project.rb deleted file mode 100644 index 6dccb1421506..000000000000 --- a/owl-bot-staging/google-cloud-resource_manager-v3/snippets/projects/create_project.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 cloudresourcemanager_v3_generated_Projects_CreateProject_sync] -require "google/cloud/resource_manager/v3" - -## -# Snippet for the create_project call in the Projects service -# -# This snippet has been automatically generated and should be regarded as a code -# template only. It will require modifications to work: -# - It may require correct/in-range values for request initialization. -# - It may require specifying regional endpoints when creating the service -# client as shown in https://cloud.google.com/ruby/docs/reference. -# -# This is an auto-generated example demonstrating basic usage of -# Google::Cloud::ResourceManager::V3::Projects::Client#create_project. -# -def create_project - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::ResourceManager::V3::Projects::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::ResourceManager::V3::CreateProjectRequest.new - - # Call the create_project method. - result = client.create_project 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 cloudresourcemanager_v3_generated_Projects_CreateProject_sync] diff --git a/owl-bot-staging/google-cloud-resource_manager-v3/snippets/projects/delete_project.rb b/owl-bot-staging/google-cloud-resource_manager-v3/snippets/projects/delete_project.rb deleted file mode 100644 index a95cfa04c506..000000000000 --- a/owl-bot-staging/google-cloud-resource_manager-v3/snippets/projects/delete_project.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 cloudresourcemanager_v3_generated_Projects_DeleteProject_sync] -require "google/cloud/resource_manager/v3" - -## -# Snippet for the delete_project call in the Projects service -# -# This snippet has been automatically generated and should be regarded as a code -# template only. It will require modifications to work: -# - It may require correct/in-range values for request initialization. -# - It may require specifying regional endpoints when creating the service -# client as shown in https://cloud.google.com/ruby/docs/reference. -# -# This is an auto-generated example demonstrating basic usage of -# Google::Cloud::ResourceManager::V3::Projects::Client#delete_project. -# -def delete_project - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::ResourceManager::V3::Projects::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::ResourceManager::V3::DeleteProjectRequest.new - - # Call the delete_project method. - result = client.delete_project 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 cloudresourcemanager_v3_generated_Projects_DeleteProject_sync] diff --git a/owl-bot-staging/google-cloud-resource_manager-v3/snippets/projects/get_iam_policy.rb b/owl-bot-staging/google-cloud-resource_manager-v3/snippets/projects/get_iam_policy.rb deleted file mode 100644 index d2228583022c..000000000000 --- a/owl-bot-staging/google-cloud-resource_manager-v3/snippets/projects/get_iam_policy.rb +++ /dev/null @@ -1,47 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -# [START cloudresourcemanager_v3_generated_Projects_GetIamPolicy_sync] -require "google/cloud/resource_manager/v3" - -## -# Snippet for the get_iam_policy call in the Projects service -# -# This snippet has been automatically generated and should be regarded as a code -# template only. It will require modifications to work: -# - It may require correct/in-range values for request initialization. -# - It may require specifying regional endpoints when creating the service -# client as shown in https://cloud.google.com/ruby/docs/reference. -# -# This is an auto-generated example demonstrating basic usage of -# Google::Cloud::ResourceManager::V3::Projects::Client#get_iam_policy. -# -def get_iam_policy - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::ResourceManager::V3::Projects::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Iam::V1::GetIamPolicyRequest.new - - # Call the get_iam_policy method. - result = client.get_iam_policy request - - # The returned object is of type Google::Iam::V1::Policy. - p result -end -# [END cloudresourcemanager_v3_generated_Projects_GetIamPolicy_sync] diff --git a/owl-bot-staging/google-cloud-resource_manager-v3/snippets/projects/get_project.rb b/owl-bot-staging/google-cloud-resource_manager-v3/snippets/projects/get_project.rb deleted file mode 100644 index 59925415335d..000000000000 --- a/owl-bot-staging/google-cloud-resource_manager-v3/snippets/projects/get_project.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 cloudresourcemanager_v3_generated_Projects_GetProject_sync] -require "google/cloud/resource_manager/v3" - -## -# Snippet for the get_project call in the Projects service -# -# This snippet has been automatically generated and should be regarded as a code -# template only. It will require modifications to work: -# - It may require correct/in-range values for request initialization. -# - It may require specifying regional endpoints when creating the service -# client as shown in https://cloud.google.com/ruby/docs/reference. -# -# This is an auto-generated example demonstrating basic usage of -# Google::Cloud::ResourceManager::V3::Projects::Client#get_project. -# -def get_project - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::ResourceManager::V3::Projects::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::ResourceManager::V3::GetProjectRequest.new - - # Call the get_project method. - result = client.get_project request - - # The returned object is of type Google::Cloud::ResourceManager::V3::Project. - p result -end -# [END cloudresourcemanager_v3_generated_Projects_GetProject_sync] diff --git a/owl-bot-staging/google-cloud-resource_manager-v3/snippets/projects/list_projects.rb b/owl-bot-staging/google-cloud-resource_manager-v3/snippets/projects/list_projects.rb deleted file mode 100644 index af7344c950c5..000000000000 --- a/owl-bot-staging/google-cloud-resource_manager-v3/snippets/projects/list_projects.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 cloudresourcemanager_v3_generated_Projects_ListProjects_sync] -require "google/cloud/resource_manager/v3" - -## -# Snippet for the list_projects call in the Projects service -# -# This snippet has been automatically generated and should be regarded as a code -# template only. It will require modifications to work: -# - It may require correct/in-range values for request initialization. -# - It may require specifying regional endpoints when creating the service -# client as shown in https://cloud.google.com/ruby/docs/reference. -# -# This is an auto-generated example demonstrating basic usage of -# Google::Cloud::ResourceManager::V3::Projects::Client#list_projects. -# -def list_projects - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::ResourceManager::V3::Projects::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::ResourceManager::V3::ListProjectsRequest.new - - # Call the list_projects method. - result = client.list_projects request - - # The returned object is of type Gapic::PagedEnumerable. You can iterate - # over elements, and API calls will be issued to fetch pages as needed. - result.each do |item| - # Each element is of type ::Google::Cloud::ResourceManager::V3::Project. - p item - end -end -# [END cloudresourcemanager_v3_generated_Projects_ListProjects_sync] diff --git a/owl-bot-staging/google-cloud-resource_manager-v3/snippets/projects/move_project.rb b/owl-bot-staging/google-cloud-resource_manager-v3/snippets/projects/move_project.rb deleted file mode 100644 index 1586935905c7..000000000000 --- a/owl-bot-staging/google-cloud-resource_manager-v3/snippets/projects/move_project.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 cloudresourcemanager_v3_generated_Projects_MoveProject_sync] -require "google/cloud/resource_manager/v3" - -## -# Snippet for the move_project call in the Projects service -# -# This snippet has been automatically generated and should be regarded as a code -# template only. It will require modifications to work: -# - It may require correct/in-range values for request initialization. -# - It may require specifying regional endpoints when creating the service -# client as shown in https://cloud.google.com/ruby/docs/reference. -# -# This is an auto-generated example demonstrating basic usage of -# Google::Cloud::ResourceManager::V3::Projects::Client#move_project. -# -def move_project - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::ResourceManager::V3::Projects::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::ResourceManager::V3::MoveProjectRequest.new - - # Call the move_project method. - result = client.move_project 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 cloudresourcemanager_v3_generated_Projects_MoveProject_sync] diff --git a/owl-bot-staging/google-cloud-resource_manager-v3/snippets/projects/search_projects.rb b/owl-bot-staging/google-cloud-resource_manager-v3/snippets/projects/search_projects.rb deleted file mode 100644 index f44af41c3e38..000000000000 --- a/owl-bot-staging/google-cloud-resource_manager-v3/snippets/projects/search_projects.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 cloudresourcemanager_v3_generated_Projects_SearchProjects_sync] -require "google/cloud/resource_manager/v3" - -## -# Snippet for the search_projects call in the Projects service -# -# This snippet has been automatically generated and should be regarded as a code -# template only. It will require modifications to work: -# - It may require correct/in-range values for request initialization. -# - It may require specifying regional endpoints when creating the service -# client as shown in https://cloud.google.com/ruby/docs/reference. -# -# This is an auto-generated example demonstrating basic usage of -# Google::Cloud::ResourceManager::V3::Projects::Client#search_projects. -# -def search_projects - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::ResourceManager::V3::Projects::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::ResourceManager::V3::SearchProjectsRequest.new - - # Call the search_projects method. - result = client.search_projects request - - # The returned object is of type Gapic::PagedEnumerable. You can iterate - # over elements, and API calls will be issued to fetch pages as needed. - result.each do |item| - # Each element is of type ::Google::Cloud::ResourceManager::V3::Project. - p item - end -end -# [END cloudresourcemanager_v3_generated_Projects_SearchProjects_sync] diff --git a/owl-bot-staging/google-cloud-resource_manager-v3/snippets/projects/set_iam_policy.rb b/owl-bot-staging/google-cloud-resource_manager-v3/snippets/projects/set_iam_policy.rb deleted file mode 100644 index ee005a807434..000000000000 --- a/owl-bot-staging/google-cloud-resource_manager-v3/snippets/projects/set_iam_policy.rb +++ /dev/null @@ -1,47 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -# [START cloudresourcemanager_v3_generated_Projects_SetIamPolicy_sync] -require "google/cloud/resource_manager/v3" - -## -# Snippet for the set_iam_policy call in the Projects service -# -# This snippet has been automatically generated and should be regarded as a code -# template only. It will require modifications to work: -# - It may require correct/in-range values for request initialization. -# - It may require specifying regional endpoints when creating the service -# client as shown in https://cloud.google.com/ruby/docs/reference. -# -# This is an auto-generated example demonstrating basic usage of -# Google::Cloud::ResourceManager::V3::Projects::Client#set_iam_policy. -# -def set_iam_policy - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::ResourceManager::V3::Projects::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Iam::V1::SetIamPolicyRequest.new - - # Call the set_iam_policy method. - result = client.set_iam_policy request - - # The returned object is of type Google::Iam::V1::Policy. - p result -end -# [END cloudresourcemanager_v3_generated_Projects_SetIamPolicy_sync] diff --git a/owl-bot-staging/google-cloud-resource_manager-v3/snippets/projects/test_iam_permissions.rb b/owl-bot-staging/google-cloud-resource_manager-v3/snippets/projects/test_iam_permissions.rb deleted file mode 100644 index b0ec47a40445..000000000000 --- a/owl-bot-staging/google-cloud-resource_manager-v3/snippets/projects/test_iam_permissions.rb +++ /dev/null @@ -1,47 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -# [START cloudresourcemanager_v3_generated_Projects_TestIamPermissions_sync] -require "google/cloud/resource_manager/v3" - -## -# Snippet for the test_iam_permissions call in the Projects service -# -# This snippet has been automatically generated and should be regarded as a code -# template only. It will require modifications to work: -# - It may require correct/in-range values for request initialization. -# - It may require specifying regional endpoints when creating the service -# client as shown in https://cloud.google.com/ruby/docs/reference. -# -# This is an auto-generated example demonstrating basic usage of -# Google::Cloud::ResourceManager::V3::Projects::Client#test_iam_permissions. -# -def test_iam_permissions - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::ResourceManager::V3::Projects::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Iam::V1::TestIamPermissionsRequest.new - - # Call the test_iam_permissions method. - result = client.test_iam_permissions request - - # The returned object is of type Google::Iam::V1::TestIamPermissionsResponse. - p result -end -# [END cloudresourcemanager_v3_generated_Projects_TestIamPermissions_sync] diff --git a/owl-bot-staging/google-cloud-resource_manager-v3/snippets/projects/undelete_project.rb b/owl-bot-staging/google-cloud-resource_manager-v3/snippets/projects/undelete_project.rb deleted file mode 100644 index 4ecdc3c8cb2e..000000000000 --- a/owl-bot-staging/google-cloud-resource_manager-v3/snippets/projects/undelete_project.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 cloudresourcemanager_v3_generated_Projects_UndeleteProject_sync] -require "google/cloud/resource_manager/v3" - -## -# Snippet for the undelete_project call in the Projects service -# -# This snippet has been automatically generated and should be regarded as a code -# template only. It will require modifications to work: -# - It may require correct/in-range values for request initialization. -# - It may require specifying regional endpoints when creating the service -# client as shown in https://cloud.google.com/ruby/docs/reference. -# -# This is an auto-generated example demonstrating basic usage of -# Google::Cloud::ResourceManager::V3::Projects::Client#undelete_project. -# -def undelete_project - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::ResourceManager::V3::Projects::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::ResourceManager::V3::UndeleteProjectRequest.new - - # Call the undelete_project method. - result = client.undelete_project 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 cloudresourcemanager_v3_generated_Projects_UndeleteProject_sync] diff --git a/owl-bot-staging/google-cloud-resource_manager-v3/snippets/projects/update_project.rb b/owl-bot-staging/google-cloud-resource_manager-v3/snippets/projects/update_project.rb deleted file mode 100644 index 49dd2e37d67c..000000000000 --- a/owl-bot-staging/google-cloud-resource_manager-v3/snippets/projects/update_project.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 cloudresourcemanager_v3_generated_Projects_UpdateProject_sync] -require "google/cloud/resource_manager/v3" - -## -# Snippet for the update_project call in the Projects service -# -# This snippet has been automatically generated and should be regarded as a code -# template only. It will require modifications to work: -# - It may require correct/in-range values for request initialization. -# - It may require specifying regional endpoints when creating the service -# client as shown in https://cloud.google.com/ruby/docs/reference. -# -# This is an auto-generated example demonstrating basic usage of -# Google::Cloud::ResourceManager::V3::Projects::Client#update_project. -# -def update_project - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::ResourceManager::V3::Projects::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::ResourceManager::V3::UpdateProjectRequest.new - - # Call the update_project method. - result = client.update_project 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 cloudresourcemanager_v3_generated_Projects_UpdateProject_sync] diff --git a/owl-bot-staging/google-cloud-resource_manager-v3/snippets/snippet_metadata_google.cloud.resourcemanager.v3.json b/owl-bot-staging/google-cloud-resource_manager-v3/snippets/snippet_metadata_google.cloud.resourcemanager.v3.json deleted file mode 100644 index cc4c8a9301e5..000000000000 --- a/owl-bot-staging/google-cloud-resource_manager-v3/snippets/snippet_metadata_google.cloud.resourcemanager.v3.json +++ /dev/null @@ -1,2095 +0,0 @@ -{ - "client_library": { - "name": "google-cloud-resource_manager-v3", - "version": "", - "language": "RUBY", - "apis": [ - { - "id": "google.cloud.resourcemanager.v3", - "version": "v3" - } - ] - }, - "snippets": [ - { - "region_tag": "cloudresourcemanager_v3_generated_Folders_GetFolder_sync", - "title": "Snippet for the get_folder call in the Folders service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::ResourceManager::V3::Folders::Client#get_folder.", - "file": "folders/get_folder.rb", - "language": "RUBY", - "client_method": { - "short_name": "get_folder", - "full_name": "::Google::Cloud::ResourceManager::V3::Folders::Client#get_folder", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::ResourceManager::V3::GetFolderRequest", - "name": "request" - } - ], - "result_type": "::Google::Cloud::ResourceManager::V3::Folder", - "client": { - "short_name": "Folders::Client", - "full_name": "::Google::Cloud::ResourceManager::V3::Folders::Client" - }, - "method": { - "short_name": "GetFolder", - "full_name": "google.cloud.resourcemanager.v3.Folders.GetFolder", - "service": { - "short_name": "Folders", - "full_name": "google.cloud.resourcemanager.v3.Folders" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 46, - "type": "FULL" - } - ] - }, - { - "region_tag": "cloudresourcemanager_v3_generated_Folders_ListFolders_sync", - "title": "Snippet for the list_folders call in the Folders service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::ResourceManager::V3::Folders::Client#list_folders.", - "file": "folders/list_folders.rb", - "language": "RUBY", - "client_method": { - "short_name": "list_folders", - "full_name": "::Google::Cloud::ResourceManager::V3::Folders::Client#list_folders", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::ResourceManager::V3::ListFoldersRequest", - "name": "request" - } - ], - "result_type": "::Google::Cloud::ResourceManager::V3::ListFoldersResponse", - "client": { - "short_name": "Folders::Client", - "full_name": "::Google::Cloud::ResourceManager::V3::Folders::Client" - }, - "method": { - "short_name": "ListFolders", - "full_name": "google.cloud.resourcemanager.v3.Folders.ListFolders", - "service": { - "short_name": "Folders", - "full_name": "google.cloud.resourcemanager.v3.Folders" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 50, - "type": "FULL" - } - ] - }, - { - "region_tag": "cloudresourcemanager_v3_generated_Folders_SearchFolders_sync", - "title": "Snippet for the search_folders call in the Folders service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::ResourceManager::V3::Folders::Client#search_folders.", - "file": "folders/search_folders.rb", - "language": "RUBY", - "client_method": { - "short_name": "search_folders", - "full_name": "::Google::Cloud::ResourceManager::V3::Folders::Client#search_folders", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::ResourceManager::V3::SearchFoldersRequest", - "name": "request" - } - ], - "result_type": "::Google::Cloud::ResourceManager::V3::SearchFoldersResponse", - "client": { - "short_name": "Folders::Client", - "full_name": "::Google::Cloud::ResourceManager::V3::Folders::Client" - }, - "method": { - "short_name": "SearchFolders", - "full_name": "google.cloud.resourcemanager.v3.Folders.SearchFolders", - "service": { - "short_name": "Folders", - "full_name": "google.cloud.resourcemanager.v3.Folders" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 50, - "type": "FULL" - } - ] - }, - { - "region_tag": "cloudresourcemanager_v3_generated_Folders_CreateFolder_sync", - "title": "Snippet for the create_folder call in the Folders service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::ResourceManager::V3::Folders::Client#create_folder.", - "file": "folders/create_folder.rb", - "language": "RUBY", - "client_method": { - "short_name": "create_folder", - "full_name": "::Google::Cloud::ResourceManager::V3::Folders::Client#create_folder", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::ResourceManager::V3::CreateFolderRequest", - "name": "request" - } - ], - "result_type": "::Google::Longrunning::Operation", - "client": { - "short_name": "Folders::Client", - "full_name": "::Google::Cloud::ResourceManager::V3::Folders::Client" - }, - "method": { - "short_name": "CreateFolder", - "full_name": "google.cloud.resourcemanager.v3.Folders.CreateFolder", - "service": { - "short_name": "Folders", - "full_name": "google.cloud.resourcemanager.v3.Folders" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 53, - "type": "FULL" - } - ] - }, - { - "region_tag": "cloudresourcemanager_v3_generated_Folders_UpdateFolder_sync", - "title": "Snippet for the update_folder call in the Folders service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::ResourceManager::V3::Folders::Client#update_folder.", - "file": "folders/update_folder.rb", - "language": "RUBY", - "client_method": { - "short_name": "update_folder", - "full_name": "::Google::Cloud::ResourceManager::V3::Folders::Client#update_folder", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::ResourceManager::V3::UpdateFolderRequest", - "name": "request" - } - ], - "result_type": "::Google::Longrunning::Operation", - "client": { - "short_name": "Folders::Client", - "full_name": "::Google::Cloud::ResourceManager::V3::Folders::Client" - }, - "method": { - "short_name": "UpdateFolder", - "full_name": "google.cloud.resourcemanager.v3.Folders.UpdateFolder", - "service": { - "short_name": "Folders", - "full_name": "google.cloud.resourcemanager.v3.Folders" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 53, - "type": "FULL" - } - ] - }, - { - "region_tag": "cloudresourcemanager_v3_generated_Folders_MoveFolder_sync", - "title": "Snippet for the move_folder call in the Folders service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::ResourceManager::V3::Folders::Client#move_folder.", - "file": "folders/move_folder.rb", - "language": "RUBY", - "client_method": { - "short_name": "move_folder", - "full_name": "::Google::Cloud::ResourceManager::V3::Folders::Client#move_folder", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::ResourceManager::V3::MoveFolderRequest", - "name": "request" - } - ], - "result_type": "::Google::Longrunning::Operation", - "client": { - "short_name": "Folders::Client", - "full_name": "::Google::Cloud::ResourceManager::V3::Folders::Client" - }, - "method": { - "short_name": "MoveFolder", - "full_name": "google.cloud.resourcemanager.v3.Folders.MoveFolder", - "service": { - "short_name": "Folders", - "full_name": "google.cloud.resourcemanager.v3.Folders" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 53, - "type": "FULL" - } - ] - }, - { - "region_tag": "cloudresourcemanager_v3_generated_Folders_DeleteFolder_sync", - "title": "Snippet for the delete_folder call in the Folders service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::ResourceManager::V3::Folders::Client#delete_folder.", - "file": "folders/delete_folder.rb", - "language": "RUBY", - "client_method": { - "short_name": "delete_folder", - "full_name": "::Google::Cloud::ResourceManager::V3::Folders::Client#delete_folder", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::ResourceManager::V3::DeleteFolderRequest", - "name": "request" - } - ], - "result_type": "::Google::Longrunning::Operation", - "client": { - "short_name": "Folders::Client", - "full_name": "::Google::Cloud::ResourceManager::V3::Folders::Client" - }, - "method": { - "short_name": "DeleteFolder", - "full_name": "google.cloud.resourcemanager.v3.Folders.DeleteFolder", - "service": { - "short_name": "Folders", - "full_name": "google.cloud.resourcemanager.v3.Folders" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 53, - "type": "FULL" - } - ] - }, - { - "region_tag": "cloudresourcemanager_v3_generated_Folders_UndeleteFolder_sync", - "title": "Snippet for the undelete_folder call in the Folders service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::ResourceManager::V3::Folders::Client#undelete_folder.", - "file": "folders/undelete_folder.rb", - "language": "RUBY", - "client_method": { - "short_name": "undelete_folder", - "full_name": "::Google::Cloud::ResourceManager::V3::Folders::Client#undelete_folder", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::ResourceManager::V3::UndeleteFolderRequest", - "name": "request" - } - ], - "result_type": "::Google::Longrunning::Operation", - "client": { - "short_name": "Folders::Client", - "full_name": "::Google::Cloud::ResourceManager::V3::Folders::Client" - }, - "method": { - "short_name": "UndeleteFolder", - "full_name": "google.cloud.resourcemanager.v3.Folders.UndeleteFolder", - "service": { - "short_name": "Folders", - "full_name": "google.cloud.resourcemanager.v3.Folders" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 53, - "type": "FULL" - } - ] - }, - { - "region_tag": "cloudresourcemanager_v3_generated_Folders_GetIamPolicy_sync", - "title": "Snippet for the get_iam_policy call in the Folders service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::ResourceManager::V3::Folders::Client#get_iam_policy.", - "file": "folders/get_iam_policy.rb", - "language": "RUBY", - "client_method": { - "short_name": "get_iam_policy", - "full_name": "::Google::Cloud::ResourceManager::V3::Folders::Client#get_iam_policy", - "async": false, - "parameters": [ - { - "type": "::Google::Iam::V1::GetIamPolicyRequest", - "name": "request" - } - ], - "result_type": "::Google::Iam::V1::Policy", - "client": { - "short_name": "Folders::Client", - "full_name": "::Google::Cloud::ResourceManager::V3::Folders::Client" - }, - "method": { - "short_name": "GetIamPolicy", - "full_name": "google.cloud.resourcemanager.v3.Folders.GetIamPolicy", - "service": { - "short_name": "Folders", - "full_name": "google.cloud.resourcemanager.v3.Folders" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 46, - "type": "FULL" - } - ] - }, - { - "region_tag": "cloudresourcemanager_v3_generated_Folders_SetIamPolicy_sync", - "title": "Snippet for the set_iam_policy call in the Folders service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::ResourceManager::V3::Folders::Client#set_iam_policy.", - "file": "folders/set_iam_policy.rb", - "language": "RUBY", - "client_method": { - "short_name": "set_iam_policy", - "full_name": "::Google::Cloud::ResourceManager::V3::Folders::Client#set_iam_policy", - "async": false, - "parameters": [ - { - "type": "::Google::Iam::V1::SetIamPolicyRequest", - "name": "request" - } - ], - "result_type": "::Google::Iam::V1::Policy", - "client": { - "short_name": "Folders::Client", - "full_name": "::Google::Cloud::ResourceManager::V3::Folders::Client" - }, - "method": { - "short_name": "SetIamPolicy", - "full_name": "google.cloud.resourcemanager.v3.Folders.SetIamPolicy", - "service": { - "short_name": "Folders", - "full_name": "google.cloud.resourcemanager.v3.Folders" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 46, - "type": "FULL" - } - ] - }, - { - "region_tag": "cloudresourcemanager_v3_generated_Folders_TestIamPermissions_sync", - "title": "Snippet for the test_iam_permissions call in the Folders service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::ResourceManager::V3::Folders::Client#test_iam_permissions.", - "file": "folders/test_iam_permissions.rb", - "language": "RUBY", - "client_method": { - "short_name": "test_iam_permissions", - "full_name": "::Google::Cloud::ResourceManager::V3::Folders::Client#test_iam_permissions", - "async": false, - "parameters": [ - { - "type": "::Google::Iam::V1::TestIamPermissionsRequest", - "name": "request" - } - ], - "result_type": "::Google::Iam::V1::TestIamPermissionsResponse", - "client": { - "short_name": "Folders::Client", - "full_name": "::Google::Cloud::ResourceManager::V3::Folders::Client" - }, - "method": { - "short_name": "TestIamPermissions", - "full_name": "google.cloud.resourcemanager.v3.Folders.TestIamPermissions", - "service": { - "short_name": "Folders", - "full_name": "google.cloud.resourcemanager.v3.Folders" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 46, - "type": "FULL" - } - ] - }, - { - "region_tag": "cloudresourcemanager_v3_generated_Organizations_GetOrganization_sync", - "title": "Snippet for the get_organization call in the Organizations service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::ResourceManager::V3::Organizations::Client#get_organization.", - "file": "organizations/get_organization.rb", - "language": "RUBY", - "client_method": { - "short_name": "get_organization", - "full_name": "::Google::Cloud::ResourceManager::V3::Organizations::Client#get_organization", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::ResourceManager::V3::GetOrganizationRequest", - "name": "request" - } - ], - "result_type": "::Google::Cloud::ResourceManager::V3::Organization", - "client": { - "short_name": "Organizations::Client", - "full_name": "::Google::Cloud::ResourceManager::V3::Organizations::Client" - }, - "method": { - "short_name": "GetOrganization", - "full_name": "google.cloud.resourcemanager.v3.Organizations.GetOrganization", - "service": { - "short_name": "Organizations", - "full_name": "google.cloud.resourcemanager.v3.Organizations" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 46, - "type": "FULL" - } - ] - }, - { - "region_tag": "cloudresourcemanager_v3_generated_Organizations_SearchOrganizations_sync", - "title": "Snippet for the search_organizations call in the Organizations service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::ResourceManager::V3::Organizations::Client#search_organizations.", - "file": "organizations/search_organizations.rb", - "language": "RUBY", - "client_method": { - "short_name": "search_organizations", - "full_name": "::Google::Cloud::ResourceManager::V3::Organizations::Client#search_organizations", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::ResourceManager::V3::SearchOrganizationsRequest", - "name": "request" - } - ], - "result_type": "::Google::Cloud::ResourceManager::V3::SearchOrganizationsResponse", - "client": { - "short_name": "Organizations::Client", - "full_name": "::Google::Cloud::ResourceManager::V3::Organizations::Client" - }, - "method": { - "short_name": "SearchOrganizations", - "full_name": "google.cloud.resourcemanager.v3.Organizations.SearchOrganizations", - "service": { - "short_name": "Organizations", - "full_name": "google.cloud.resourcemanager.v3.Organizations" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 50, - "type": "FULL" - } - ] - }, - { - "region_tag": "cloudresourcemanager_v3_generated_Organizations_GetIamPolicy_sync", - "title": "Snippet for the get_iam_policy call in the Organizations service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::ResourceManager::V3::Organizations::Client#get_iam_policy.", - "file": "organizations/get_iam_policy.rb", - "language": "RUBY", - "client_method": { - "short_name": "get_iam_policy", - "full_name": "::Google::Cloud::ResourceManager::V3::Organizations::Client#get_iam_policy", - "async": false, - "parameters": [ - { - "type": "::Google::Iam::V1::GetIamPolicyRequest", - "name": "request" - } - ], - "result_type": "::Google::Iam::V1::Policy", - "client": { - "short_name": "Organizations::Client", - "full_name": "::Google::Cloud::ResourceManager::V3::Organizations::Client" - }, - "method": { - "short_name": "GetIamPolicy", - "full_name": "google.cloud.resourcemanager.v3.Organizations.GetIamPolicy", - "service": { - "short_name": "Organizations", - "full_name": "google.cloud.resourcemanager.v3.Organizations" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 46, - "type": "FULL" - } - ] - }, - { - "region_tag": "cloudresourcemanager_v3_generated_Organizations_SetIamPolicy_sync", - "title": "Snippet for the set_iam_policy call in the Organizations service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::ResourceManager::V3::Organizations::Client#set_iam_policy.", - "file": "organizations/set_iam_policy.rb", - "language": "RUBY", - "client_method": { - "short_name": "set_iam_policy", - "full_name": "::Google::Cloud::ResourceManager::V3::Organizations::Client#set_iam_policy", - "async": false, - "parameters": [ - { - "type": "::Google::Iam::V1::SetIamPolicyRequest", - "name": "request" - } - ], - "result_type": "::Google::Iam::V1::Policy", - "client": { - "short_name": "Organizations::Client", - "full_name": "::Google::Cloud::ResourceManager::V3::Organizations::Client" - }, - "method": { - "short_name": "SetIamPolicy", - "full_name": "google.cloud.resourcemanager.v3.Organizations.SetIamPolicy", - "service": { - "short_name": "Organizations", - "full_name": "google.cloud.resourcemanager.v3.Organizations" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 46, - "type": "FULL" - } - ] - }, - { - "region_tag": "cloudresourcemanager_v3_generated_Organizations_TestIamPermissions_sync", - "title": "Snippet for the test_iam_permissions call in the Organizations service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::ResourceManager::V3::Organizations::Client#test_iam_permissions.", - "file": "organizations/test_iam_permissions.rb", - "language": "RUBY", - "client_method": { - "short_name": "test_iam_permissions", - "full_name": "::Google::Cloud::ResourceManager::V3::Organizations::Client#test_iam_permissions", - "async": false, - "parameters": [ - { - "type": "::Google::Iam::V1::TestIamPermissionsRequest", - "name": "request" - } - ], - "result_type": "::Google::Iam::V1::TestIamPermissionsResponse", - "client": { - "short_name": "Organizations::Client", - "full_name": "::Google::Cloud::ResourceManager::V3::Organizations::Client" - }, - "method": { - "short_name": "TestIamPermissions", - "full_name": "google.cloud.resourcemanager.v3.Organizations.TestIamPermissions", - "service": { - "short_name": "Organizations", - "full_name": "google.cloud.resourcemanager.v3.Organizations" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 46, - "type": "FULL" - } - ] - }, - { - "region_tag": "cloudresourcemanager_v3_generated_Projects_GetProject_sync", - "title": "Snippet for the get_project call in the Projects service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::ResourceManager::V3::Projects::Client#get_project.", - "file": "projects/get_project.rb", - "language": "RUBY", - "client_method": { - "short_name": "get_project", - "full_name": "::Google::Cloud::ResourceManager::V3::Projects::Client#get_project", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::ResourceManager::V3::GetProjectRequest", - "name": "request" - } - ], - "result_type": "::Google::Cloud::ResourceManager::V3::Project", - "client": { - "short_name": "Projects::Client", - "full_name": "::Google::Cloud::ResourceManager::V3::Projects::Client" - }, - "method": { - "short_name": "GetProject", - "full_name": "google.cloud.resourcemanager.v3.Projects.GetProject", - "service": { - "short_name": "Projects", - "full_name": "google.cloud.resourcemanager.v3.Projects" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 46, - "type": "FULL" - } - ] - }, - { - "region_tag": "cloudresourcemanager_v3_generated_Projects_ListProjects_sync", - "title": "Snippet for the list_projects call in the Projects service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::ResourceManager::V3::Projects::Client#list_projects.", - "file": "projects/list_projects.rb", - "language": "RUBY", - "client_method": { - "short_name": "list_projects", - "full_name": "::Google::Cloud::ResourceManager::V3::Projects::Client#list_projects", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::ResourceManager::V3::ListProjectsRequest", - "name": "request" - } - ], - "result_type": "::Google::Cloud::ResourceManager::V3::ListProjectsResponse", - "client": { - "short_name": "Projects::Client", - "full_name": "::Google::Cloud::ResourceManager::V3::Projects::Client" - }, - "method": { - "short_name": "ListProjects", - "full_name": "google.cloud.resourcemanager.v3.Projects.ListProjects", - "service": { - "short_name": "Projects", - "full_name": "google.cloud.resourcemanager.v3.Projects" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 50, - "type": "FULL" - } - ] - }, - { - "region_tag": "cloudresourcemanager_v3_generated_Projects_SearchProjects_sync", - "title": "Snippet for the search_projects call in the Projects service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::ResourceManager::V3::Projects::Client#search_projects.", - "file": "projects/search_projects.rb", - "language": "RUBY", - "client_method": { - "short_name": "search_projects", - "full_name": "::Google::Cloud::ResourceManager::V3::Projects::Client#search_projects", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::ResourceManager::V3::SearchProjectsRequest", - "name": "request" - } - ], - "result_type": "::Google::Cloud::ResourceManager::V3::SearchProjectsResponse", - "client": { - "short_name": "Projects::Client", - "full_name": "::Google::Cloud::ResourceManager::V3::Projects::Client" - }, - "method": { - "short_name": "SearchProjects", - "full_name": "google.cloud.resourcemanager.v3.Projects.SearchProjects", - "service": { - "short_name": "Projects", - "full_name": "google.cloud.resourcemanager.v3.Projects" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 50, - "type": "FULL" - } - ] - }, - { - "region_tag": "cloudresourcemanager_v3_generated_Projects_CreateProject_sync", - "title": "Snippet for the create_project call in the Projects service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::ResourceManager::V3::Projects::Client#create_project.", - "file": "projects/create_project.rb", - "language": "RUBY", - "client_method": { - "short_name": "create_project", - "full_name": "::Google::Cloud::ResourceManager::V3::Projects::Client#create_project", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::ResourceManager::V3::CreateProjectRequest", - "name": "request" - } - ], - "result_type": "::Google::Longrunning::Operation", - "client": { - "short_name": "Projects::Client", - "full_name": "::Google::Cloud::ResourceManager::V3::Projects::Client" - }, - "method": { - "short_name": "CreateProject", - "full_name": "google.cloud.resourcemanager.v3.Projects.CreateProject", - "service": { - "short_name": "Projects", - "full_name": "google.cloud.resourcemanager.v3.Projects" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 53, - "type": "FULL" - } - ] - }, - { - "region_tag": "cloudresourcemanager_v3_generated_Projects_UpdateProject_sync", - "title": "Snippet for the update_project call in the Projects service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::ResourceManager::V3::Projects::Client#update_project.", - "file": "projects/update_project.rb", - "language": "RUBY", - "client_method": { - "short_name": "update_project", - "full_name": "::Google::Cloud::ResourceManager::V3::Projects::Client#update_project", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::ResourceManager::V3::UpdateProjectRequest", - "name": "request" - } - ], - "result_type": "::Google::Longrunning::Operation", - "client": { - "short_name": "Projects::Client", - "full_name": "::Google::Cloud::ResourceManager::V3::Projects::Client" - }, - "method": { - "short_name": "UpdateProject", - "full_name": "google.cloud.resourcemanager.v3.Projects.UpdateProject", - "service": { - "short_name": "Projects", - "full_name": "google.cloud.resourcemanager.v3.Projects" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 53, - "type": "FULL" - } - ] - }, - { - "region_tag": "cloudresourcemanager_v3_generated_Projects_MoveProject_sync", - "title": "Snippet for the move_project call in the Projects service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::ResourceManager::V3::Projects::Client#move_project.", - "file": "projects/move_project.rb", - "language": "RUBY", - "client_method": { - "short_name": "move_project", - "full_name": "::Google::Cloud::ResourceManager::V3::Projects::Client#move_project", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::ResourceManager::V3::MoveProjectRequest", - "name": "request" - } - ], - "result_type": "::Google::Longrunning::Operation", - "client": { - "short_name": "Projects::Client", - "full_name": "::Google::Cloud::ResourceManager::V3::Projects::Client" - }, - "method": { - "short_name": "MoveProject", - "full_name": "google.cloud.resourcemanager.v3.Projects.MoveProject", - "service": { - "short_name": "Projects", - "full_name": "google.cloud.resourcemanager.v3.Projects" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 53, - "type": "FULL" - } - ] - }, - { - "region_tag": "cloudresourcemanager_v3_generated_Projects_DeleteProject_sync", - "title": "Snippet for the delete_project call in the Projects service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::ResourceManager::V3::Projects::Client#delete_project.", - "file": "projects/delete_project.rb", - "language": "RUBY", - "client_method": { - "short_name": "delete_project", - "full_name": "::Google::Cloud::ResourceManager::V3::Projects::Client#delete_project", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::ResourceManager::V3::DeleteProjectRequest", - "name": "request" - } - ], - "result_type": "::Google::Longrunning::Operation", - "client": { - "short_name": "Projects::Client", - "full_name": "::Google::Cloud::ResourceManager::V3::Projects::Client" - }, - "method": { - "short_name": "DeleteProject", - "full_name": "google.cloud.resourcemanager.v3.Projects.DeleteProject", - "service": { - "short_name": "Projects", - "full_name": "google.cloud.resourcemanager.v3.Projects" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 53, - "type": "FULL" - } - ] - }, - { - "region_tag": "cloudresourcemanager_v3_generated_Projects_UndeleteProject_sync", - "title": "Snippet for the undelete_project call in the Projects service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::ResourceManager::V3::Projects::Client#undelete_project.", - "file": "projects/undelete_project.rb", - "language": "RUBY", - "client_method": { - "short_name": "undelete_project", - "full_name": "::Google::Cloud::ResourceManager::V3::Projects::Client#undelete_project", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::ResourceManager::V3::UndeleteProjectRequest", - "name": "request" - } - ], - "result_type": "::Google::Longrunning::Operation", - "client": { - "short_name": "Projects::Client", - "full_name": "::Google::Cloud::ResourceManager::V3::Projects::Client" - }, - "method": { - "short_name": "UndeleteProject", - "full_name": "google.cloud.resourcemanager.v3.Projects.UndeleteProject", - "service": { - "short_name": "Projects", - "full_name": "google.cloud.resourcemanager.v3.Projects" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 53, - "type": "FULL" - } - ] - }, - { - "region_tag": "cloudresourcemanager_v3_generated_Projects_GetIamPolicy_sync", - "title": "Snippet for the get_iam_policy call in the Projects service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::ResourceManager::V3::Projects::Client#get_iam_policy.", - "file": "projects/get_iam_policy.rb", - "language": "RUBY", - "client_method": { - "short_name": "get_iam_policy", - "full_name": "::Google::Cloud::ResourceManager::V3::Projects::Client#get_iam_policy", - "async": false, - "parameters": [ - { - "type": "::Google::Iam::V1::GetIamPolicyRequest", - "name": "request" - } - ], - "result_type": "::Google::Iam::V1::Policy", - "client": { - "short_name": "Projects::Client", - "full_name": "::Google::Cloud::ResourceManager::V3::Projects::Client" - }, - "method": { - "short_name": "GetIamPolicy", - "full_name": "google.cloud.resourcemanager.v3.Projects.GetIamPolicy", - "service": { - "short_name": "Projects", - "full_name": "google.cloud.resourcemanager.v3.Projects" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 46, - "type": "FULL" - } - ] - }, - { - "region_tag": "cloudresourcemanager_v3_generated_Projects_SetIamPolicy_sync", - "title": "Snippet for the set_iam_policy call in the Projects service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::ResourceManager::V3::Projects::Client#set_iam_policy.", - "file": "projects/set_iam_policy.rb", - "language": "RUBY", - "client_method": { - "short_name": "set_iam_policy", - "full_name": "::Google::Cloud::ResourceManager::V3::Projects::Client#set_iam_policy", - "async": false, - "parameters": [ - { - "type": "::Google::Iam::V1::SetIamPolicyRequest", - "name": "request" - } - ], - "result_type": "::Google::Iam::V1::Policy", - "client": { - "short_name": "Projects::Client", - "full_name": "::Google::Cloud::ResourceManager::V3::Projects::Client" - }, - "method": { - "short_name": "SetIamPolicy", - "full_name": "google.cloud.resourcemanager.v3.Projects.SetIamPolicy", - "service": { - "short_name": "Projects", - "full_name": "google.cloud.resourcemanager.v3.Projects" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 46, - "type": "FULL" - } - ] - }, - { - "region_tag": "cloudresourcemanager_v3_generated_Projects_TestIamPermissions_sync", - "title": "Snippet for the test_iam_permissions call in the Projects service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::ResourceManager::V3::Projects::Client#test_iam_permissions.", - "file": "projects/test_iam_permissions.rb", - "language": "RUBY", - "client_method": { - "short_name": "test_iam_permissions", - "full_name": "::Google::Cloud::ResourceManager::V3::Projects::Client#test_iam_permissions", - "async": false, - "parameters": [ - { - "type": "::Google::Iam::V1::TestIamPermissionsRequest", - "name": "request" - } - ], - "result_type": "::Google::Iam::V1::TestIamPermissionsResponse", - "client": { - "short_name": "Projects::Client", - "full_name": "::Google::Cloud::ResourceManager::V3::Projects::Client" - }, - "method": { - "short_name": "TestIamPermissions", - "full_name": "google.cloud.resourcemanager.v3.Projects.TestIamPermissions", - "service": { - "short_name": "Projects", - "full_name": "google.cloud.resourcemanager.v3.Projects" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 46, - "type": "FULL" - } - ] - }, - { - "region_tag": "cloudresourcemanager_v3_generated_TagBindings_ListTagBindings_sync", - "title": "Snippet for the list_tag_bindings call in the TagBindings service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::ResourceManager::V3::TagBindings::Client#list_tag_bindings.", - "file": "tag_bindings/list_tag_bindings.rb", - "language": "RUBY", - "client_method": { - "short_name": "list_tag_bindings", - "full_name": "::Google::Cloud::ResourceManager::V3::TagBindings::Client#list_tag_bindings", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::ResourceManager::V3::ListTagBindingsRequest", - "name": "request" - } - ], - "result_type": "::Google::Cloud::ResourceManager::V3::ListTagBindingsResponse", - "client": { - "short_name": "TagBindings::Client", - "full_name": "::Google::Cloud::ResourceManager::V3::TagBindings::Client" - }, - "method": { - "short_name": "ListTagBindings", - "full_name": "google.cloud.resourcemanager.v3.TagBindings.ListTagBindings", - "service": { - "short_name": "TagBindings", - "full_name": "google.cloud.resourcemanager.v3.TagBindings" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 50, - "type": "FULL" - } - ] - }, - { - "region_tag": "cloudresourcemanager_v3_generated_TagBindings_CreateTagBinding_sync", - "title": "Snippet for the create_tag_binding call in the TagBindings service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::ResourceManager::V3::TagBindings::Client#create_tag_binding.", - "file": "tag_bindings/create_tag_binding.rb", - "language": "RUBY", - "client_method": { - "short_name": "create_tag_binding", - "full_name": "::Google::Cloud::ResourceManager::V3::TagBindings::Client#create_tag_binding", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::ResourceManager::V3::CreateTagBindingRequest", - "name": "request" - } - ], - "result_type": "::Google::Longrunning::Operation", - "client": { - "short_name": "TagBindings::Client", - "full_name": "::Google::Cloud::ResourceManager::V3::TagBindings::Client" - }, - "method": { - "short_name": "CreateTagBinding", - "full_name": "google.cloud.resourcemanager.v3.TagBindings.CreateTagBinding", - "service": { - "short_name": "TagBindings", - "full_name": "google.cloud.resourcemanager.v3.TagBindings" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 53, - "type": "FULL" - } - ] - }, - { - "region_tag": "cloudresourcemanager_v3_generated_TagBindings_DeleteTagBinding_sync", - "title": "Snippet for the delete_tag_binding call in the TagBindings service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::ResourceManager::V3::TagBindings::Client#delete_tag_binding.", - "file": "tag_bindings/delete_tag_binding.rb", - "language": "RUBY", - "client_method": { - "short_name": "delete_tag_binding", - "full_name": "::Google::Cloud::ResourceManager::V3::TagBindings::Client#delete_tag_binding", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::ResourceManager::V3::DeleteTagBindingRequest", - "name": "request" - } - ], - "result_type": "::Google::Longrunning::Operation", - "client": { - "short_name": "TagBindings::Client", - "full_name": "::Google::Cloud::ResourceManager::V3::TagBindings::Client" - }, - "method": { - "short_name": "DeleteTagBinding", - "full_name": "google.cloud.resourcemanager.v3.TagBindings.DeleteTagBinding", - "service": { - "short_name": "TagBindings", - "full_name": "google.cloud.resourcemanager.v3.TagBindings" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 53, - "type": "FULL" - } - ] - }, - { - "region_tag": "cloudresourcemanager_v3_generated_TagBindings_ListEffectiveTags_sync", - "title": "Snippet for the list_effective_tags call in the TagBindings service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::ResourceManager::V3::TagBindings::Client#list_effective_tags.", - "file": "tag_bindings/list_effective_tags.rb", - "language": "RUBY", - "client_method": { - "short_name": "list_effective_tags", - "full_name": "::Google::Cloud::ResourceManager::V3::TagBindings::Client#list_effective_tags", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::ResourceManager::V3::ListEffectiveTagsRequest", - "name": "request" - } - ], - "result_type": "::Google::Cloud::ResourceManager::V3::ListEffectiveTagsResponse", - "client": { - "short_name": "TagBindings::Client", - "full_name": "::Google::Cloud::ResourceManager::V3::TagBindings::Client" - }, - "method": { - "short_name": "ListEffectiveTags", - "full_name": "google.cloud.resourcemanager.v3.TagBindings.ListEffectiveTags", - "service": { - "short_name": "TagBindings", - "full_name": "google.cloud.resourcemanager.v3.TagBindings" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 50, - "type": "FULL" - } - ] - }, - { - "region_tag": "cloudresourcemanager_v3_generated_TagHolds_CreateTagHold_sync", - "title": "Snippet for the create_tag_hold call in the TagHolds service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::ResourceManager::V3::TagHolds::Client#create_tag_hold.", - "file": "tag_holds/create_tag_hold.rb", - "language": "RUBY", - "client_method": { - "short_name": "create_tag_hold", - "full_name": "::Google::Cloud::ResourceManager::V3::TagHolds::Client#create_tag_hold", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::ResourceManager::V3::CreateTagHoldRequest", - "name": "request" - } - ], - "result_type": "::Google::Longrunning::Operation", - "client": { - "short_name": "TagHolds::Client", - "full_name": "::Google::Cloud::ResourceManager::V3::TagHolds::Client" - }, - "method": { - "short_name": "CreateTagHold", - "full_name": "google.cloud.resourcemanager.v3.TagHolds.CreateTagHold", - "service": { - "short_name": "TagHolds", - "full_name": "google.cloud.resourcemanager.v3.TagHolds" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 53, - "type": "FULL" - } - ] - }, - { - "region_tag": "cloudresourcemanager_v3_generated_TagHolds_DeleteTagHold_sync", - "title": "Snippet for the delete_tag_hold call in the TagHolds service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::ResourceManager::V3::TagHolds::Client#delete_tag_hold.", - "file": "tag_holds/delete_tag_hold.rb", - "language": "RUBY", - "client_method": { - "short_name": "delete_tag_hold", - "full_name": "::Google::Cloud::ResourceManager::V3::TagHolds::Client#delete_tag_hold", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::ResourceManager::V3::DeleteTagHoldRequest", - "name": "request" - } - ], - "result_type": "::Google::Longrunning::Operation", - "client": { - "short_name": "TagHolds::Client", - "full_name": "::Google::Cloud::ResourceManager::V3::TagHolds::Client" - }, - "method": { - "short_name": "DeleteTagHold", - "full_name": "google.cloud.resourcemanager.v3.TagHolds.DeleteTagHold", - "service": { - "short_name": "TagHolds", - "full_name": "google.cloud.resourcemanager.v3.TagHolds" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 53, - "type": "FULL" - } - ] - }, - { - "region_tag": "cloudresourcemanager_v3_generated_TagHolds_ListTagHolds_sync", - "title": "Snippet for the list_tag_holds call in the TagHolds service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::ResourceManager::V3::TagHolds::Client#list_tag_holds.", - "file": "tag_holds/list_tag_holds.rb", - "language": "RUBY", - "client_method": { - "short_name": "list_tag_holds", - "full_name": "::Google::Cloud::ResourceManager::V3::TagHolds::Client#list_tag_holds", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::ResourceManager::V3::ListTagHoldsRequest", - "name": "request" - } - ], - "result_type": "::Google::Cloud::ResourceManager::V3::ListTagHoldsResponse", - "client": { - "short_name": "TagHolds::Client", - "full_name": "::Google::Cloud::ResourceManager::V3::TagHolds::Client" - }, - "method": { - "short_name": "ListTagHolds", - "full_name": "google.cloud.resourcemanager.v3.TagHolds.ListTagHolds", - "service": { - "short_name": "TagHolds", - "full_name": "google.cloud.resourcemanager.v3.TagHolds" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 50, - "type": "FULL" - } - ] - }, - { - "region_tag": "cloudresourcemanager_v3_generated_TagKeys_ListTagKeys_sync", - "title": "Snippet for the list_tag_keys call in the TagKeys service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::ResourceManager::V3::TagKeys::Client#list_tag_keys.", - "file": "tag_keys/list_tag_keys.rb", - "language": "RUBY", - "client_method": { - "short_name": "list_tag_keys", - "full_name": "::Google::Cloud::ResourceManager::V3::TagKeys::Client#list_tag_keys", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::ResourceManager::V3::ListTagKeysRequest", - "name": "request" - } - ], - "result_type": "::Google::Cloud::ResourceManager::V3::ListTagKeysResponse", - "client": { - "short_name": "TagKeys::Client", - "full_name": "::Google::Cloud::ResourceManager::V3::TagKeys::Client" - }, - "method": { - "short_name": "ListTagKeys", - "full_name": "google.cloud.resourcemanager.v3.TagKeys.ListTagKeys", - "service": { - "short_name": "TagKeys", - "full_name": "google.cloud.resourcemanager.v3.TagKeys" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 50, - "type": "FULL" - } - ] - }, - { - "region_tag": "cloudresourcemanager_v3_generated_TagKeys_GetTagKey_sync", - "title": "Snippet for the get_tag_key call in the TagKeys service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::ResourceManager::V3::TagKeys::Client#get_tag_key.", - "file": "tag_keys/get_tag_key.rb", - "language": "RUBY", - "client_method": { - "short_name": "get_tag_key", - "full_name": "::Google::Cloud::ResourceManager::V3::TagKeys::Client#get_tag_key", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::ResourceManager::V3::GetTagKeyRequest", - "name": "request" - } - ], - "result_type": "::Google::Cloud::ResourceManager::V3::TagKey", - "client": { - "short_name": "TagKeys::Client", - "full_name": "::Google::Cloud::ResourceManager::V3::TagKeys::Client" - }, - "method": { - "short_name": "GetTagKey", - "full_name": "google.cloud.resourcemanager.v3.TagKeys.GetTagKey", - "service": { - "short_name": "TagKeys", - "full_name": "google.cloud.resourcemanager.v3.TagKeys" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 46, - "type": "FULL" - } - ] - }, - { - "region_tag": "cloudresourcemanager_v3_generated_TagKeys_GetNamespacedTagKey_sync", - "title": "Snippet for the get_namespaced_tag_key call in the TagKeys service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::ResourceManager::V3::TagKeys::Client#get_namespaced_tag_key.", - "file": "tag_keys/get_namespaced_tag_key.rb", - "language": "RUBY", - "client_method": { - "short_name": "get_namespaced_tag_key", - "full_name": "::Google::Cloud::ResourceManager::V3::TagKeys::Client#get_namespaced_tag_key", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::ResourceManager::V3::GetNamespacedTagKeyRequest", - "name": "request" - } - ], - "result_type": "::Google::Cloud::ResourceManager::V3::TagKey", - "client": { - "short_name": "TagKeys::Client", - "full_name": "::Google::Cloud::ResourceManager::V3::TagKeys::Client" - }, - "method": { - "short_name": "GetNamespacedTagKey", - "full_name": "google.cloud.resourcemanager.v3.TagKeys.GetNamespacedTagKey", - "service": { - "short_name": "TagKeys", - "full_name": "google.cloud.resourcemanager.v3.TagKeys" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 46, - "type": "FULL" - } - ] - }, - { - "region_tag": "cloudresourcemanager_v3_generated_TagKeys_CreateTagKey_sync", - "title": "Snippet for the create_tag_key call in the TagKeys service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::ResourceManager::V3::TagKeys::Client#create_tag_key.", - "file": "tag_keys/create_tag_key.rb", - "language": "RUBY", - "client_method": { - "short_name": "create_tag_key", - "full_name": "::Google::Cloud::ResourceManager::V3::TagKeys::Client#create_tag_key", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::ResourceManager::V3::CreateTagKeyRequest", - "name": "request" - } - ], - "result_type": "::Google::Longrunning::Operation", - "client": { - "short_name": "TagKeys::Client", - "full_name": "::Google::Cloud::ResourceManager::V3::TagKeys::Client" - }, - "method": { - "short_name": "CreateTagKey", - "full_name": "google.cloud.resourcemanager.v3.TagKeys.CreateTagKey", - "service": { - "short_name": "TagKeys", - "full_name": "google.cloud.resourcemanager.v3.TagKeys" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 53, - "type": "FULL" - } - ] - }, - { - "region_tag": "cloudresourcemanager_v3_generated_TagKeys_UpdateTagKey_sync", - "title": "Snippet for the update_tag_key call in the TagKeys service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::ResourceManager::V3::TagKeys::Client#update_tag_key.", - "file": "tag_keys/update_tag_key.rb", - "language": "RUBY", - "client_method": { - "short_name": "update_tag_key", - "full_name": "::Google::Cloud::ResourceManager::V3::TagKeys::Client#update_tag_key", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::ResourceManager::V3::UpdateTagKeyRequest", - "name": "request" - } - ], - "result_type": "::Google::Longrunning::Operation", - "client": { - "short_name": "TagKeys::Client", - "full_name": "::Google::Cloud::ResourceManager::V3::TagKeys::Client" - }, - "method": { - "short_name": "UpdateTagKey", - "full_name": "google.cloud.resourcemanager.v3.TagKeys.UpdateTagKey", - "service": { - "short_name": "TagKeys", - "full_name": "google.cloud.resourcemanager.v3.TagKeys" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 53, - "type": "FULL" - } - ] - }, - { - "region_tag": "cloudresourcemanager_v3_generated_TagKeys_DeleteTagKey_sync", - "title": "Snippet for the delete_tag_key call in the TagKeys service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::ResourceManager::V3::TagKeys::Client#delete_tag_key.", - "file": "tag_keys/delete_tag_key.rb", - "language": "RUBY", - "client_method": { - "short_name": "delete_tag_key", - "full_name": "::Google::Cloud::ResourceManager::V3::TagKeys::Client#delete_tag_key", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::ResourceManager::V3::DeleteTagKeyRequest", - "name": "request" - } - ], - "result_type": "::Google::Longrunning::Operation", - "client": { - "short_name": "TagKeys::Client", - "full_name": "::Google::Cloud::ResourceManager::V3::TagKeys::Client" - }, - "method": { - "short_name": "DeleteTagKey", - "full_name": "google.cloud.resourcemanager.v3.TagKeys.DeleteTagKey", - "service": { - "short_name": "TagKeys", - "full_name": "google.cloud.resourcemanager.v3.TagKeys" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 53, - "type": "FULL" - } - ] - }, - { - "region_tag": "cloudresourcemanager_v3_generated_TagKeys_GetIamPolicy_sync", - "title": "Snippet for the get_iam_policy call in the TagKeys service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::ResourceManager::V3::TagKeys::Client#get_iam_policy.", - "file": "tag_keys/get_iam_policy.rb", - "language": "RUBY", - "client_method": { - "short_name": "get_iam_policy", - "full_name": "::Google::Cloud::ResourceManager::V3::TagKeys::Client#get_iam_policy", - "async": false, - "parameters": [ - { - "type": "::Google::Iam::V1::GetIamPolicyRequest", - "name": "request" - } - ], - "result_type": "::Google::Iam::V1::Policy", - "client": { - "short_name": "TagKeys::Client", - "full_name": "::Google::Cloud::ResourceManager::V3::TagKeys::Client" - }, - "method": { - "short_name": "GetIamPolicy", - "full_name": "google.cloud.resourcemanager.v3.TagKeys.GetIamPolicy", - "service": { - "short_name": "TagKeys", - "full_name": "google.cloud.resourcemanager.v3.TagKeys" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 46, - "type": "FULL" - } - ] - }, - { - "region_tag": "cloudresourcemanager_v3_generated_TagKeys_SetIamPolicy_sync", - "title": "Snippet for the set_iam_policy call in the TagKeys service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::ResourceManager::V3::TagKeys::Client#set_iam_policy.", - "file": "tag_keys/set_iam_policy.rb", - "language": "RUBY", - "client_method": { - "short_name": "set_iam_policy", - "full_name": "::Google::Cloud::ResourceManager::V3::TagKeys::Client#set_iam_policy", - "async": false, - "parameters": [ - { - "type": "::Google::Iam::V1::SetIamPolicyRequest", - "name": "request" - } - ], - "result_type": "::Google::Iam::V1::Policy", - "client": { - "short_name": "TagKeys::Client", - "full_name": "::Google::Cloud::ResourceManager::V3::TagKeys::Client" - }, - "method": { - "short_name": "SetIamPolicy", - "full_name": "google.cloud.resourcemanager.v3.TagKeys.SetIamPolicy", - "service": { - "short_name": "TagKeys", - "full_name": "google.cloud.resourcemanager.v3.TagKeys" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 46, - "type": "FULL" - } - ] - }, - { - "region_tag": "cloudresourcemanager_v3_generated_TagKeys_TestIamPermissions_sync", - "title": "Snippet for the test_iam_permissions call in the TagKeys service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::ResourceManager::V3::TagKeys::Client#test_iam_permissions.", - "file": "tag_keys/test_iam_permissions.rb", - "language": "RUBY", - "client_method": { - "short_name": "test_iam_permissions", - "full_name": "::Google::Cloud::ResourceManager::V3::TagKeys::Client#test_iam_permissions", - "async": false, - "parameters": [ - { - "type": "::Google::Iam::V1::TestIamPermissionsRequest", - "name": "request" - } - ], - "result_type": "::Google::Iam::V1::TestIamPermissionsResponse", - "client": { - "short_name": "TagKeys::Client", - "full_name": "::Google::Cloud::ResourceManager::V3::TagKeys::Client" - }, - "method": { - "short_name": "TestIamPermissions", - "full_name": "google.cloud.resourcemanager.v3.TagKeys.TestIamPermissions", - "service": { - "short_name": "TagKeys", - "full_name": "google.cloud.resourcemanager.v3.TagKeys" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 46, - "type": "FULL" - } - ] - }, - { - "region_tag": "cloudresourcemanager_v3_generated_TagValues_ListTagValues_sync", - "title": "Snippet for the list_tag_values call in the TagValues service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::ResourceManager::V3::TagValues::Client#list_tag_values.", - "file": "tag_values/list_tag_values.rb", - "language": "RUBY", - "client_method": { - "short_name": "list_tag_values", - "full_name": "::Google::Cloud::ResourceManager::V3::TagValues::Client#list_tag_values", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::ResourceManager::V3::ListTagValuesRequest", - "name": "request" - } - ], - "result_type": "::Google::Cloud::ResourceManager::V3::ListTagValuesResponse", - "client": { - "short_name": "TagValues::Client", - "full_name": "::Google::Cloud::ResourceManager::V3::TagValues::Client" - }, - "method": { - "short_name": "ListTagValues", - "full_name": "google.cloud.resourcemanager.v3.TagValues.ListTagValues", - "service": { - "short_name": "TagValues", - "full_name": "google.cloud.resourcemanager.v3.TagValues" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 50, - "type": "FULL" - } - ] - }, - { - "region_tag": "cloudresourcemanager_v3_generated_TagValues_GetTagValue_sync", - "title": "Snippet for the get_tag_value call in the TagValues service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::ResourceManager::V3::TagValues::Client#get_tag_value.", - "file": "tag_values/get_tag_value.rb", - "language": "RUBY", - "client_method": { - "short_name": "get_tag_value", - "full_name": "::Google::Cloud::ResourceManager::V3::TagValues::Client#get_tag_value", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::ResourceManager::V3::GetTagValueRequest", - "name": "request" - } - ], - "result_type": "::Google::Cloud::ResourceManager::V3::TagValue", - "client": { - "short_name": "TagValues::Client", - "full_name": "::Google::Cloud::ResourceManager::V3::TagValues::Client" - }, - "method": { - "short_name": "GetTagValue", - "full_name": "google.cloud.resourcemanager.v3.TagValues.GetTagValue", - "service": { - "short_name": "TagValues", - "full_name": "google.cloud.resourcemanager.v3.TagValues" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 46, - "type": "FULL" - } - ] - }, - { - "region_tag": "cloudresourcemanager_v3_generated_TagValues_GetNamespacedTagValue_sync", - "title": "Snippet for the get_namespaced_tag_value call in the TagValues service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::ResourceManager::V3::TagValues::Client#get_namespaced_tag_value.", - "file": "tag_values/get_namespaced_tag_value.rb", - "language": "RUBY", - "client_method": { - "short_name": "get_namespaced_tag_value", - "full_name": "::Google::Cloud::ResourceManager::V3::TagValues::Client#get_namespaced_tag_value", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::ResourceManager::V3::GetNamespacedTagValueRequest", - "name": "request" - } - ], - "result_type": "::Google::Cloud::ResourceManager::V3::TagValue", - "client": { - "short_name": "TagValues::Client", - "full_name": "::Google::Cloud::ResourceManager::V3::TagValues::Client" - }, - "method": { - "short_name": "GetNamespacedTagValue", - "full_name": "google.cloud.resourcemanager.v3.TagValues.GetNamespacedTagValue", - "service": { - "short_name": "TagValues", - "full_name": "google.cloud.resourcemanager.v3.TagValues" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 46, - "type": "FULL" - } - ] - }, - { - "region_tag": "cloudresourcemanager_v3_generated_TagValues_CreateTagValue_sync", - "title": "Snippet for the create_tag_value call in the TagValues service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::ResourceManager::V3::TagValues::Client#create_tag_value.", - "file": "tag_values/create_tag_value.rb", - "language": "RUBY", - "client_method": { - "short_name": "create_tag_value", - "full_name": "::Google::Cloud::ResourceManager::V3::TagValues::Client#create_tag_value", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::ResourceManager::V3::CreateTagValueRequest", - "name": "request" - } - ], - "result_type": "::Google::Longrunning::Operation", - "client": { - "short_name": "TagValues::Client", - "full_name": "::Google::Cloud::ResourceManager::V3::TagValues::Client" - }, - "method": { - "short_name": "CreateTagValue", - "full_name": "google.cloud.resourcemanager.v3.TagValues.CreateTagValue", - "service": { - "short_name": "TagValues", - "full_name": "google.cloud.resourcemanager.v3.TagValues" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 53, - "type": "FULL" - } - ] - }, - { - "region_tag": "cloudresourcemanager_v3_generated_TagValues_UpdateTagValue_sync", - "title": "Snippet for the update_tag_value call in the TagValues service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::ResourceManager::V3::TagValues::Client#update_tag_value.", - "file": "tag_values/update_tag_value.rb", - "language": "RUBY", - "client_method": { - "short_name": "update_tag_value", - "full_name": "::Google::Cloud::ResourceManager::V3::TagValues::Client#update_tag_value", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::ResourceManager::V3::UpdateTagValueRequest", - "name": "request" - } - ], - "result_type": "::Google::Longrunning::Operation", - "client": { - "short_name": "TagValues::Client", - "full_name": "::Google::Cloud::ResourceManager::V3::TagValues::Client" - }, - "method": { - "short_name": "UpdateTagValue", - "full_name": "google.cloud.resourcemanager.v3.TagValues.UpdateTagValue", - "service": { - "short_name": "TagValues", - "full_name": "google.cloud.resourcemanager.v3.TagValues" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 53, - "type": "FULL" - } - ] - }, - { - "region_tag": "cloudresourcemanager_v3_generated_TagValues_DeleteTagValue_sync", - "title": "Snippet for the delete_tag_value call in the TagValues service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::ResourceManager::V3::TagValues::Client#delete_tag_value.", - "file": "tag_values/delete_tag_value.rb", - "language": "RUBY", - "client_method": { - "short_name": "delete_tag_value", - "full_name": "::Google::Cloud::ResourceManager::V3::TagValues::Client#delete_tag_value", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::ResourceManager::V3::DeleteTagValueRequest", - "name": "request" - } - ], - "result_type": "::Google::Longrunning::Operation", - "client": { - "short_name": "TagValues::Client", - "full_name": "::Google::Cloud::ResourceManager::V3::TagValues::Client" - }, - "method": { - "short_name": "DeleteTagValue", - "full_name": "google.cloud.resourcemanager.v3.TagValues.DeleteTagValue", - "service": { - "short_name": "TagValues", - "full_name": "google.cloud.resourcemanager.v3.TagValues" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 53, - "type": "FULL" - } - ] - }, - { - "region_tag": "cloudresourcemanager_v3_generated_TagValues_GetIamPolicy_sync", - "title": "Snippet for the get_iam_policy call in the TagValues service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::ResourceManager::V3::TagValues::Client#get_iam_policy.", - "file": "tag_values/get_iam_policy.rb", - "language": "RUBY", - "client_method": { - "short_name": "get_iam_policy", - "full_name": "::Google::Cloud::ResourceManager::V3::TagValues::Client#get_iam_policy", - "async": false, - "parameters": [ - { - "type": "::Google::Iam::V1::GetIamPolicyRequest", - "name": "request" - } - ], - "result_type": "::Google::Iam::V1::Policy", - "client": { - "short_name": "TagValues::Client", - "full_name": "::Google::Cloud::ResourceManager::V3::TagValues::Client" - }, - "method": { - "short_name": "GetIamPolicy", - "full_name": "google.cloud.resourcemanager.v3.TagValues.GetIamPolicy", - "service": { - "short_name": "TagValues", - "full_name": "google.cloud.resourcemanager.v3.TagValues" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 46, - "type": "FULL" - } - ] - }, - { - "region_tag": "cloudresourcemanager_v3_generated_TagValues_SetIamPolicy_sync", - "title": "Snippet for the set_iam_policy call in the TagValues service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::ResourceManager::V3::TagValues::Client#set_iam_policy.", - "file": "tag_values/set_iam_policy.rb", - "language": "RUBY", - "client_method": { - "short_name": "set_iam_policy", - "full_name": "::Google::Cloud::ResourceManager::V3::TagValues::Client#set_iam_policy", - "async": false, - "parameters": [ - { - "type": "::Google::Iam::V1::SetIamPolicyRequest", - "name": "request" - } - ], - "result_type": "::Google::Iam::V1::Policy", - "client": { - "short_name": "TagValues::Client", - "full_name": "::Google::Cloud::ResourceManager::V3::TagValues::Client" - }, - "method": { - "short_name": "SetIamPolicy", - "full_name": "google.cloud.resourcemanager.v3.TagValues.SetIamPolicy", - "service": { - "short_name": "TagValues", - "full_name": "google.cloud.resourcemanager.v3.TagValues" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 46, - "type": "FULL" - } - ] - }, - { - "region_tag": "cloudresourcemanager_v3_generated_TagValues_TestIamPermissions_sync", - "title": "Snippet for the test_iam_permissions call in the TagValues service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::ResourceManager::V3::TagValues::Client#test_iam_permissions.", - "file": "tag_values/test_iam_permissions.rb", - "language": "RUBY", - "client_method": { - "short_name": "test_iam_permissions", - "full_name": "::Google::Cloud::ResourceManager::V3::TagValues::Client#test_iam_permissions", - "async": false, - "parameters": [ - { - "type": "::Google::Iam::V1::TestIamPermissionsRequest", - "name": "request" - } - ], - "result_type": "::Google::Iam::V1::TestIamPermissionsResponse", - "client": { - "short_name": "TagValues::Client", - "full_name": "::Google::Cloud::ResourceManager::V3::TagValues::Client" - }, - "method": { - "short_name": "TestIamPermissions", - "full_name": "google.cloud.resourcemanager.v3.TagValues.TestIamPermissions", - "service": { - "short_name": "TagValues", - "full_name": "google.cloud.resourcemanager.v3.TagValues" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 46, - "type": "FULL" - } - ] - } - ] -} \ No newline at end of file diff --git a/owl-bot-staging/google-cloud-resource_manager-v3/snippets/tag_bindings/create_tag_binding.rb b/owl-bot-staging/google-cloud-resource_manager-v3/snippets/tag_bindings/create_tag_binding.rb deleted file mode 100644 index a1b89b01f010..000000000000 --- a/owl-bot-staging/google-cloud-resource_manager-v3/snippets/tag_bindings/create_tag_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 cloudresourcemanager_v3_generated_TagBindings_CreateTagBinding_sync] -require "google/cloud/resource_manager/v3" - -## -# Snippet for the create_tag_binding call in the TagBindings service -# -# This snippet has been automatically generated and should be regarded as a code -# template only. It will require modifications to work: -# - It may require correct/in-range values for request initialization. -# - It may require specifying regional endpoints when creating the service -# client as shown in https://cloud.google.com/ruby/docs/reference. -# -# This is an auto-generated example demonstrating basic usage of -# Google::Cloud::ResourceManager::V3::TagBindings::Client#create_tag_binding. -# -def create_tag_binding - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::ResourceManager::V3::TagBindings::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::ResourceManager::V3::CreateTagBindingRequest.new - - # Call the create_tag_binding method. - result = client.create_tag_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 cloudresourcemanager_v3_generated_TagBindings_CreateTagBinding_sync] diff --git a/owl-bot-staging/google-cloud-resource_manager-v3/snippets/tag_bindings/delete_tag_binding.rb b/owl-bot-staging/google-cloud-resource_manager-v3/snippets/tag_bindings/delete_tag_binding.rb deleted file mode 100644 index b7278bc6d63c..000000000000 --- a/owl-bot-staging/google-cloud-resource_manager-v3/snippets/tag_bindings/delete_tag_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 cloudresourcemanager_v3_generated_TagBindings_DeleteTagBinding_sync] -require "google/cloud/resource_manager/v3" - -## -# Snippet for the delete_tag_binding call in the TagBindings service -# -# This snippet has been automatically generated and should be regarded as a code -# template only. It will require modifications to work: -# - It may require correct/in-range values for request initialization. -# - It may require specifying regional endpoints when creating the service -# client as shown in https://cloud.google.com/ruby/docs/reference. -# -# This is an auto-generated example demonstrating basic usage of -# Google::Cloud::ResourceManager::V3::TagBindings::Client#delete_tag_binding. -# -def delete_tag_binding - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::ResourceManager::V3::TagBindings::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::ResourceManager::V3::DeleteTagBindingRequest.new - - # Call the delete_tag_binding method. - result = client.delete_tag_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 cloudresourcemanager_v3_generated_TagBindings_DeleteTagBinding_sync] diff --git a/owl-bot-staging/google-cloud-resource_manager-v3/snippets/tag_bindings/list_effective_tags.rb b/owl-bot-staging/google-cloud-resource_manager-v3/snippets/tag_bindings/list_effective_tags.rb deleted file mode 100644 index c9a1e268616a..000000000000 --- a/owl-bot-staging/google-cloud-resource_manager-v3/snippets/tag_bindings/list_effective_tags.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 cloudresourcemanager_v3_generated_TagBindings_ListEffectiveTags_sync] -require "google/cloud/resource_manager/v3" - -## -# Snippet for the list_effective_tags call in the TagBindings service -# -# This snippet has been automatically generated and should be regarded as a code -# template only. It will require modifications to work: -# - It may require correct/in-range values for request initialization. -# - It may require specifying regional endpoints when creating the service -# client as shown in https://cloud.google.com/ruby/docs/reference. -# -# This is an auto-generated example demonstrating basic usage of -# Google::Cloud::ResourceManager::V3::TagBindings::Client#list_effective_tags. -# -def list_effective_tags - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::ResourceManager::V3::TagBindings::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::ResourceManager::V3::ListEffectiveTagsRequest.new - - # Call the list_effective_tags method. - result = client.list_effective_tags request - - # The returned object is of type Gapic::PagedEnumerable. You can iterate - # over elements, and API calls will be issued to fetch pages as needed. - result.each do |item| - # Each element is of type ::Google::Cloud::ResourceManager::V3::EffectiveTag. - p item - end -end -# [END cloudresourcemanager_v3_generated_TagBindings_ListEffectiveTags_sync] diff --git a/owl-bot-staging/google-cloud-resource_manager-v3/snippets/tag_bindings/list_tag_bindings.rb b/owl-bot-staging/google-cloud-resource_manager-v3/snippets/tag_bindings/list_tag_bindings.rb deleted file mode 100644 index af5a789e0119..000000000000 --- a/owl-bot-staging/google-cloud-resource_manager-v3/snippets/tag_bindings/list_tag_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 cloudresourcemanager_v3_generated_TagBindings_ListTagBindings_sync] -require "google/cloud/resource_manager/v3" - -## -# Snippet for the list_tag_bindings call in the TagBindings service -# -# This snippet has been automatically generated and should be regarded as a code -# template only. It will require modifications to work: -# - It may require correct/in-range values for request initialization. -# - It may require specifying regional endpoints when creating the service -# client as shown in https://cloud.google.com/ruby/docs/reference. -# -# This is an auto-generated example demonstrating basic usage of -# Google::Cloud::ResourceManager::V3::TagBindings::Client#list_tag_bindings. -# -def list_tag_bindings - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::ResourceManager::V3::TagBindings::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::ResourceManager::V3::ListTagBindingsRequest.new - - # Call the list_tag_bindings method. - result = client.list_tag_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::Cloud::ResourceManager::V3::TagBinding. - p item - end -end -# [END cloudresourcemanager_v3_generated_TagBindings_ListTagBindings_sync] diff --git a/owl-bot-staging/google-cloud-resource_manager-v3/snippets/tag_holds/create_tag_hold.rb b/owl-bot-staging/google-cloud-resource_manager-v3/snippets/tag_holds/create_tag_hold.rb deleted file mode 100644 index bdf4ffb7066d..000000000000 --- a/owl-bot-staging/google-cloud-resource_manager-v3/snippets/tag_holds/create_tag_hold.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 cloudresourcemanager_v3_generated_TagHolds_CreateTagHold_sync] -require "google/cloud/resource_manager/v3" - -## -# Snippet for the create_tag_hold call in the TagHolds service -# -# This snippet has been automatically generated and should be regarded as a code -# template only. It will require modifications to work: -# - It may require correct/in-range values for request initialization. -# - It may require specifying regional endpoints when creating the service -# client as shown in https://cloud.google.com/ruby/docs/reference. -# -# This is an auto-generated example demonstrating basic usage of -# Google::Cloud::ResourceManager::V3::TagHolds::Client#create_tag_hold. -# -def create_tag_hold - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::ResourceManager::V3::TagHolds::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::ResourceManager::V3::CreateTagHoldRequest.new - - # Call the create_tag_hold method. - result = client.create_tag_hold 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 cloudresourcemanager_v3_generated_TagHolds_CreateTagHold_sync] diff --git a/owl-bot-staging/google-cloud-resource_manager-v3/snippets/tag_holds/delete_tag_hold.rb b/owl-bot-staging/google-cloud-resource_manager-v3/snippets/tag_holds/delete_tag_hold.rb deleted file mode 100644 index 5690a1fac388..000000000000 --- a/owl-bot-staging/google-cloud-resource_manager-v3/snippets/tag_holds/delete_tag_hold.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 cloudresourcemanager_v3_generated_TagHolds_DeleteTagHold_sync] -require "google/cloud/resource_manager/v3" - -## -# Snippet for the delete_tag_hold call in the TagHolds service -# -# This snippet has been automatically generated and should be regarded as a code -# template only. It will require modifications to work: -# - It may require correct/in-range values for request initialization. -# - It may require specifying regional endpoints when creating the service -# client as shown in https://cloud.google.com/ruby/docs/reference. -# -# This is an auto-generated example demonstrating basic usage of -# Google::Cloud::ResourceManager::V3::TagHolds::Client#delete_tag_hold. -# -def delete_tag_hold - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::ResourceManager::V3::TagHolds::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::ResourceManager::V3::DeleteTagHoldRequest.new - - # Call the delete_tag_hold method. - result = client.delete_tag_hold 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 cloudresourcemanager_v3_generated_TagHolds_DeleteTagHold_sync] diff --git a/owl-bot-staging/google-cloud-resource_manager-v3/snippets/tag_holds/list_tag_holds.rb b/owl-bot-staging/google-cloud-resource_manager-v3/snippets/tag_holds/list_tag_holds.rb deleted file mode 100644 index b140a6f03956..000000000000 --- a/owl-bot-staging/google-cloud-resource_manager-v3/snippets/tag_holds/list_tag_holds.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 cloudresourcemanager_v3_generated_TagHolds_ListTagHolds_sync] -require "google/cloud/resource_manager/v3" - -## -# Snippet for the list_tag_holds call in the TagHolds service -# -# This snippet has been automatically generated and should be regarded as a code -# template only. It will require modifications to work: -# - It may require correct/in-range values for request initialization. -# - It may require specifying regional endpoints when creating the service -# client as shown in https://cloud.google.com/ruby/docs/reference. -# -# This is an auto-generated example demonstrating basic usage of -# Google::Cloud::ResourceManager::V3::TagHolds::Client#list_tag_holds. -# -def list_tag_holds - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::ResourceManager::V3::TagHolds::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::ResourceManager::V3::ListTagHoldsRequest.new - - # Call the list_tag_holds method. - result = client.list_tag_holds request - - # The returned object is of type Gapic::PagedEnumerable. You can iterate - # over elements, and API calls will be issued to fetch pages as needed. - result.each do |item| - # Each element is of type ::Google::Cloud::ResourceManager::V3::TagHold. - p item - end -end -# [END cloudresourcemanager_v3_generated_TagHolds_ListTagHolds_sync] diff --git a/owl-bot-staging/google-cloud-resource_manager-v3/snippets/tag_keys/create_tag_key.rb b/owl-bot-staging/google-cloud-resource_manager-v3/snippets/tag_keys/create_tag_key.rb deleted file mode 100644 index 2cd527fb10cf..000000000000 --- a/owl-bot-staging/google-cloud-resource_manager-v3/snippets/tag_keys/create_tag_key.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 cloudresourcemanager_v3_generated_TagKeys_CreateTagKey_sync] -require "google/cloud/resource_manager/v3" - -## -# Snippet for the create_tag_key call in the TagKeys service -# -# This snippet has been automatically generated and should be regarded as a code -# template only. It will require modifications to work: -# - It may require correct/in-range values for request initialization. -# - It may require specifying regional endpoints when creating the service -# client as shown in https://cloud.google.com/ruby/docs/reference. -# -# This is an auto-generated example demonstrating basic usage of -# Google::Cloud::ResourceManager::V3::TagKeys::Client#create_tag_key. -# -def create_tag_key - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::ResourceManager::V3::TagKeys::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::ResourceManager::V3::CreateTagKeyRequest.new - - # Call the create_tag_key method. - result = client.create_tag_key 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 cloudresourcemanager_v3_generated_TagKeys_CreateTagKey_sync] diff --git a/owl-bot-staging/google-cloud-resource_manager-v3/snippets/tag_keys/delete_tag_key.rb b/owl-bot-staging/google-cloud-resource_manager-v3/snippets/tag_keys/delete_tag_key.rb deleted file mode 100644 index 85f13dc5dbaf..000000000000 --- a/owl-bot-staging/google-cloud-resource_manager-v3/snippets/tag_keys/delete_tag_key.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 cloudresourcemanager_v3_generated_TagKeys_DeleteTagKey_sync] -require "google/cloud/resource_manager/v3" - -## -# Snippet for the delete_tag_key call in the TagKeys service -# -# This snippet has been automatically generated and should be regarded as a code -# template only. It will require modifications to work: -# - It may require correct/in-range values for request initialization. -# - It may require specifying regional endpoints when creating the service -# client as shown in https://cloud.google.com/ruby/docs/reference. -# -# This is an auto-generated example demonstrating basic usage of -# Google::Cloud::ResourceManager::V3::TagKeys::Client#delete_tag_key. -# -def delete_tag_key - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::ResourceManager::V3::TagKeys::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::ResourceManager::V3::DeleteTagKeyRequest.new - - # Call the delete_tag_key method. - result = client.delete_tag_key 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 cloudresourcemanager_v3_generated_TagKeys_DeleteTagKey_sync] diff --git a/owl-bot-staging/google-cloud-resource_manager-v3/snippets/tag_keys/get_iam_policy.rb b/owl-bot-staging/google-cloud-resource_manager-v3/snippets/tag_keys/get_iam_policy.rb deleted file mode 100644 index 0029b84faabd..000000000000 --- a/owl-bot-staging/google-cloud-resource_manager-v3/snippets/tag_keys/get_iam_policy.rb +++ /dev/null @@ -1,47 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -# [START cloudresourcemanager_v3_generated_TagKeys_GetIamPolicy_sync] -require "google/cloud/resource_manager/v3" - -## -# Snippet for the get_iam_policy call in the TagKeys service -# -# This snippet has been automatically generated and should be regarded as a code -# template only. It will require modifications to work: -# - It may require correct/in-range values for request initialization. -# - It may require specifying regional endpoints when creating the service -# client as shown in https://cloud.google.com/ruby/docs/reference. -# -# This is an auto-generated example demonstrating basic usage of -# Google::Cloud::ResourceManager::V3::TagKeys::Client#get_iam_policy. -# -def get_iam_policy - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::ResourceManager::V3::TagKeys::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Iam::V1::GetIamPolicyRequest.new - - # Call the get_iam_policy method. - result = client.get_iam_policy request - - # The returned object is of type Google::Iam::V1::Policy. - p result -end -# [END cloudresourcemanager_v3_generated_TagKeys_GetIamPolicy_sync] diff --git a/owl-bot-staging/google-cloud-resource_manager-v3/snippets/tag_keys/get_namespaced_tag_key.rb b/owl-bot-staging/google-cloud-resource_manager-v3/snippets/tag_keys/get_namespaced_tag_key.rb deleted file mode 100644 index ec354144b777..000000000000 --- a/owl-bot-staging/google-cloud-resource_manager-v3/snippets/tag_keys/get_namespaced_tag_key.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 cloudresourcemanager_v3_generated_TagKeys_GetNamespacedTagKey_sync] -require "google/cloud/resource_manager/v3" - -## -# Snippet for the get_namespaced_tag_key call in the TagKeys service -# -# This snippet has been automatically generated and should be regarded as a code -# template only. It will require modifications to work: -# - It may require correct/in-range values for request initialization. -# - It may require specifying regional endpoints when creating the service -# client as shown in https://cloud.google.com/ruby/docs/reference. -# -# This is an auto-generated example demonstrating basic usage of -# Google::Cloud::ResourceManager::V3::TagKeys::Client#get_namespaced_tag_key. -# -def get_namespaced_tag_key - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::ResourceManager::V3::TagKeys::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::ResourceManager::V3::GetNamespacedTagKeyRequest.new - - # Call the get_namespaced_tag_key method. - result = client.get_namespaced_tag_key request - - # The returned object is of type Google::Cloud::ResourceManager::V3::TagKey. - p result -end -# [END cloudresourcemanager_v3_generated_TagKeys_GetNamespacedTagKey_sync] diff --git a/owl-bot-staging/google-cloud-resource_manager-v3/snippets/tag_keys/get_tag_key.rb b/owl-bot-staging/google-cloud-resource_manager-v3/snippets/tag_keys/get_tag_key.rb deleted file mode 100644 index 2657cb43dd01..000000000000 --- a/owl-bot-staging/google-cloud-resource_manager-v3/snippets/tag_keys/get_tag_key.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 cloudresourcemanager_v3_generated_TagKeys_GetTagKey_sync] -require "google/cloud/resource_manager/v3" - -## -# Snippet for the get_tag_key call in the TagKeys service -# -# This snippet has been automatically generated and should be regarded as a code -# template only. It will require modifications to work: -# - It may require correct/in-range values for request initialization. -# - It may require specifying regional endpoints when creating the service -# client as shown in https://cloud.google.com/ruby/docs/reference. -# -# This is an auto-generated example demonstrating basic usage of -# Google::Cloud::ResourceManager::V3::TagKeys::Client#get_tag_key. -# -def get_tag_key - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::ResourceManager::V3::TagKeys::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::ResourceManager::V3::GetTagKeyRequest.new - - # Call the get_tag_key method. - result = client.get_tag_key request - - # The returned object is of type Google::Cloud::ResourceManager::V3::TagKey. - p result -end -# [END cloudresourcemanager_v3_generated_TagKeys_GetTagKey_sync] diff --git a/owl-bot-staging/google-cloud-resource_manager-v3/snippets/tag_keys/list_tag_keys.rb b/owl-bot-staging/google-cloud-resource_manager-v3/snippets/tag_keys/list_tag_keys.rb deleted file mode 100644 index 1b5b6da36dc5..000000000000 --- a/owl-bot-staging/google-cloud-resource_manager-v3/snippets/tag_keys/list_tag_keys.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 cloudresourcemanager_v3_generated_TagKeys_ListTagKeys_sync] -require "google/cloud/resource_manager/v3" - -## -# Snippet for the list_tag_keys call in the TagKeys service -# -# This snippet has been automatically generated and should be regarded as a code -# template only. It will require modifications to work: -# - It may require correct/in-range values for request initialization. -# - It may require specifying regional endpoints when creating the service -# client as shown in https://cloud.google.com/ruby/docs/reference. -# -# This is an auto-generated example demonstrating basic usage of -# Google::Cloud::ResourceManager::V3::TagKeys::Client#list_tag_keys. -# -def list_tag_keys - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::ResourceManager::V3::TagKeys::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::ResourceManager::V3::ListTagKeysRequest.new - - # Call the list_tag_keys method. - result = client.list_tag_keys request - - # The returned object is of type Gapic::PagedEnumerable. You can iterate - # over elements, and API calls will be issued to fetch pages as needed. - result.each do |item| - # Each element is of type ::Google::Cloud::ResourceManager::V3::TagKey. - p item - end -end -# [END cloudresourcemanager_v3_generated_TagKeys_ListTagKeys_sync] diff --git a/owl-bot-staging/google-cloud-resource_manager-v3/snippets/tag_keys/set_iam_policy.rb b/owl-bot-staging/google-cloud-resource_manager-v3/snippets/tag_keys/set_iam_policy.rb deleted file mode 100644 index 5095a2df35a5..000000000000 --- a/owl-bot-staging/google-cloud-resource_manager-v3/snippets/tag_keys/set_iam_policy.rb +++ /dev/null @@ -1,47 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -# [START cloudresourcemanager_v3_generated_TagKeys_SetIamPolicy_sync] -require "google/cloud/resource_manager/v3" - -## -# Snippet for the set_iam_policy call in the TagKeys service -# -# This snippet has been automatically generated and should be regarded as a code -# template only. It will require modifications to work: -# - It may require correct/in-range values for request initialization. -# - It may require specifying regional endpoints when creating the service -# client as shown in https://cloud.google.com/ruby/docs/reference. -# -# This is an auto-generated example demonstrating basic usage of -# Google::Cloud::ResourceManager::V3::TagKeys::Client#set_iam_policy. -# -def set_iam_policy - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::ResourceManager::V3::TagKeys::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Iam::V1::SetIamPolicyRequest.new - - # Call the set_iam_policy method. - result = client.set_iam_policy request - - # The returned object is of type Google::Iam::V1::Policy. - p result -end -# [END cloudresourcemanager_v3_generated_TagKeys_SetIamPolicy_sync] diff --git a/owl-bot-staging/google-cloud-resource_manager-v3/snippets/tag_keys/test_iam_permissions.rb b/owl-bot-staging/google-cloud-resource_manager-v3/snippets/tag_keys/test_iam_permissions.rb deleted file mode 100644 index 2165b1a22ce5..000000000000 --- a/owl-bot-staging/google-cloud-resource_manager-v3/snippets/tag_keys/test_iam_permissions.rb +++ /dev/null @@ -1,47 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -# [START cloudresourcemanager_v3_generated_TagKeys_TestIamPermissions_sync] -require "google/cloud/resource_manager/v3" - -## -# Snippet for the test_iam_permissions call in the TagKeys service -# -# This snippet has been automatically generated and should be regarded as a code -# template only. It will require modifications to work: -# - It may require correct/in-range values for request initialization. -# - It may require specifying regional endpoints when creating the service -# client as shown in https://cloud.google.com/ruby/docs/reference. -# -# This is an auto-generated example demonstrating basic usage of -# Google::Cloud::ResourceManager::V3::TagKeys::Client#test_iam_permissions. -# -def test_iam_permissions - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::ResourceManager::V3::TagKeys::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Iam::V1::TestIamPermissionsRequest.new - - # Call the test_iam_permissions method. - result = client.test_iam_permissions request - - # The returned object is of type Google::Iam::V1::TestIamPermissionsResponse. - p result -end -# [END cloudresourcemanager_v3_generated_TagKeys_TestIamPermissions_sync] diff --git a/owl-bot-staging/google-cloud-resource_manager-v3/snippets/tag_keys/update_tag_key.rb b/owl-bot-staging/google-cloud-resource_manager-v3/snippets/tag_keys/update_tag_key.rb deleted file mode 100644 index 9d7650953889..000000000000 --- a/owl-bot-staging/google-cloud-resource_manager-v3/snippets/tag_keys/update_tag_key.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 cloudresourcemanager_v3_generated_TagKeys_UpdateTagKey_sync] -require "google/cloud/resource_manager/v3" - -## -# Snippet for the update_tag_key call in the TagKeys service -# -# This snippet has been automatically generated and should be regarded as a code -# template only. It will require modifications to work: -# - It may require correct/in-range values for request initialization. -# - It may require specifying regional endpoints when creating the service -# client as shown in https://cloud.google.com/ruby/docs/reference. -# -# This is an auto-generated example demonstrating basic usage of -# Google::Cloud::ResourceManager::V3::TagKeys::Client#update_tag_key. -# -def update_tag_key - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::ResourceManager::V3::TagKeys::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::ResourceManager::V3::UpdateTagKeyRequest.new - - # Call the update_tag_key method. - result = client.update_tag_key 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 cloudresourcemanager_v3_generated_TagKeys_UpdateTagKey_sync] diff --git a/owl-bot-staging/google-cloud-resource_manager-v3/snippets/tag_values/create_tag_value.rb b/owl-bot-staging/google-cloud-resource_manager-v3/snippets/tag_values/create_tag_value.rb deleted file mode 100644 index 943ab348b4ba..000000000000 --- a/owl-bot-staging/google-cloud-resource_manager-v3/snippets/tag_values/create_tag_value.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 cloudresourcemanager_v3_generated_TagValues_CreateTagValue_sync] -require "google/cloud/resource_manager/v3" - -## -# Snippet for the create_tag_value call in the TagValues service -# -# This snippet has been automatically generated and should be regarded as a code -# template only. It will require modifications to work: -# - It may require correct/in-range values for request initialization. -# - It may require specifying regional endpoints when creating the service -# client as shown in https://cloud.google.com/ruby/docs/reference. -# -# This is an auto-generated example demonstrating basic usage of -# Google::Cloud::ResourceManager::V3::TagValues::Client#create_tag_value. -# -def create_tag_value - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::ResourceManager::V3::TagValues::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::ResourceManager::V3::CreateTagValueRequest.new - - # Call the create_tag_value method. - result = client.create_tag_value 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 cloudresourcemanager_v3_generated_TagValues_CreateTagValue_sync] diff --git a/owl-bot-staging/google-cloud-resource_manager-v3/snippets/tag_values/delete_tag_value.rb b/owl-bot-staging/google-cloud-resource_manager-v3/snippets/tag_values/delete_tag_value.rb deleted file mode 100644 index 75dc92373be8..000000000000 --- a/owl-bot-staging/google-cloud-resource_manager-v3/snippets/tag_values/delete_tag_value.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 cloudresourcemanager_v3_generated_TagValues_DeleteTagValue_sync] -require "google/cloud/resource_manager/v3" - -## -# Snippet for the delete_tag_value call in the TagValues service -# -# This snippet has been automatically generated and should be regarded as a code -# template only. It will require modifications to work: -# - It may require correct/in-range values for request initialization. -# - It may require specifying regional endpoints when creating the service -# client as shown in https://cloud.google.com/ruby/docs/reference. -# -# This is an auto-generated example demonstrating basic usage of -# Google::Cloud::ResourceManager::V3::TagValues::Client#delete_tag_value. -# -def delete_tag_value - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::ResourceManager::V3::TagValues::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::ResourceManager::V3::DeleteTagValueRequest.new - - # Call the delete_tag_value method. - result = client.delete_tag_value 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 cloudresourcemanager_v3_generated_TagValues_DeleteTagValue_sync] diff --git a/owl-bot-staging/google-cloud-resource_manager-v3/snippets/tag_values/get_iam_policy.rb b/owl-bot-staging/google-cloud-resource_manager-v3/snippets/tag_values/get_iam_policy.rb deleted file mode 100644 index ae6682790f3a..000000000000 --- a/owl-bot-staging/google-cloud-resource_manager-v3/snippets/tag_values/get_iam_policy.rb +++ /dev/null @@ -1,47 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -# [START cloudresourcemanager_v3_generated_TagValues_GetIamPolicy_sync] -require "google/cloud/resource_manager/v3" - -## -# Snippet for the get_iam_policy call in the TagValues service -# -# This snippet has been automatically generated and should be regarded as a code -# template only. It will require modifications to work: -# - It may require correct/in-range values for request initialization. -# - It may require specifying regional endpoints when creating the service -# client as shown in https://cloud.google.com/ruby/docs/reference. -# -# This is an auto-generated example demonstrating basic usage of -# Google::Cloud::ResourceManager::V3::TagValues::Client#get_iam_policy. -# -def get_iam_policy - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::ResourceManager::V3::TagValues::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Iam::V1::GetIamPolicyRequest.new - - # Call the get_iam_policy method. - result = client.get_iam_policy request - - # The returned object is of type Google::Iam::V1::Policy. - p result -end -# [END cloudresourcemanager_v3_generated_TagValues_GetIamPolicy_sync] diff --git a/owl-bot-staging/google-cloud-resource_manager-v3/snippets/tag_values/get_namespaced_tag_value.rb b/owl-bot-staging/google-cloud-resource_manager-v3/snippets/tag_values/get_namespaced_tag_value.rb deleted file mode 100644 index 68c0d13e6dc2..000000000000 --- a/owl-bot-staging/google-cloud-resource_manager-v3/snippets/tag_values/get_namespaced_tag_value.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 cloudresourcemanager_v3_generated_TagValues_GetNamespacedTagValue_sync] -require "google/cloud/resource_manager/v3" - -## -# Snippet for the get_namespaced_tag_value call in the TagValues service -# -# This snippet has been automatically generated and should be regarded as a code -# template only. It will require modifications to work: -# - It may require correct/in-range values for request initialization. -# - It may require specifying regional endpoints when creating the service -# client as shown in https://cloud.google.com/ruby/docs/reference. -# -# This is an auto-generated example demonstrating basic usage of -# Google::Cloud::ResourceManager::V3::TagValues::Client#get_namespaced_tag_value. -# -def get_namespaced_tag_value - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::ResourceManager::V3::TagValues::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::ResourceManager::V3::GetNamespacedTagValueRequest.new - - # Call the get_namespaced_tag_value method. - result = client.get_namespaced_tag_value request - - # The returned object is of type Google::Cloud::ResourceManager::V3::TagValue. - p result -end -# [END cloudresourcemanager_v3_generated_TagValues_GetNamespacedTagValue_sync] diff --git a/owl-bot-staging/google-cloud-resource_manager-v3/snippets/tag_values/get_tag_value.rb b/owl-bot-staging/google-cloud-resource_manager-v3/snippets/tag_values/get_tag_value.rb deleted file mode 100644 index 55347ce706cd..000000000000 --- a/owl-bot-staging/google-cloud-resource_manager-v3/snippets/tag_values/get_tag_value.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 cloudresourcemanager_v3_generated_TagValues_GetTagValue_sync] -require "google/cloud/resource_manager/v3" - -## -# Snippet for the get_tag_value call in the TagValues service -# -# This snippet has been automatically generated and should be regarded as a code -# template only. It will require modifications to work: -# - It may require correct/in-range values for request initialization. -# - It may require specifying regional endpoints when creating the service -# client as shown in https://cloud.google.com/ruby/docs/reference. -# -# This is an auto-generated example demonstrating basic usage of -# Google::Cloud::ResourceManager::V3::TagValues::Client#get_tag_value. -# -def get_tag_value - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::ResourceManager::V3::TagValues::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::ResourceManager::V3::GetTagValueRequest.new - - # Call the get_tag_value method. - result = client.get_tag_value request - - # The returned object is of type Google::Cloud::ResourceManager::V3::TagValue. - p result -end -# [END cloudresourcemanager_v3_generated_TagValues_GetTagValue_sync] diff --git a/owl-bot-staging/google-cloud-resource_manager-v3/snippets/tag_values/list_tag_values.rb b/owl-bot-staging/google-cloud-resource_manager-v3/snippets/tag_values/list_tag_values.rb deleted file mode 100644 index c8c99a2abaa2..000000000000 --- a/owl-bot-staging/google-cloud-resource_manager-v3/snippets/tag_values/list_tag_values.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 cloudresourcemanager_v3_generated_TagValues_ListTagValues_sync] -require "google/cloud/resource_manager/v3" - -## -# Snippet for the list_tag_values call in the TagValues service -# -# This snippet has been automatically generated and should be regarded as a code -# template only. It will require modifications to work: -# - It may require correct/in-range values for request initialization. -# - It may require specifying regional endpoints when creating the service -# client as shown in https://cloud.google.com/ruby/docs/reference. -# -# This is an auto-generated example demonstrating basic usage of -# Google::Cloud::ResourceManager::V3::TagValues::Client#list_tag_values. -# -def list_tag_values - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::ResourceManager::V3::TagValues::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::ResourceManager::V3::ListTagValuesRequest.new - - # Call the list_tag_values method. - result = client.list_tag_values request - - # The returned object is of type Gapic::PagedEnumerable. You can iterate - # over elements, and API calls will be issued to fetch pages as needed. - result.each do |item| - # Each element is of type ::Google::Cloud::ResourceManager::V3::TagValue. - p item - end -end -# [END cloudresourcemanager_v3_generated_TagValues_ListTagValues_sync] diff --git a/owl-bot-staging/google-cloud-resource_manager-v3/snippets/tag_values/set_iam_policy.rb b/owl-bot-staging/google-cloud-resource_manager-v3/snippets/tag_values/set_iam_policy.rb deleted file mode 100644 index c9c9a74edabe..000000000000 --- a/owl-bot-staging/google-cloud-resource_manager-v3/snippets/tag_values/set_iam_policy.rb +++ /dev/null @@ -1,47 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -# [START cloudresourcemanager_v3_generated_TagValues_SetIamPolicy_sync] -require "google/cloud/resource_manager/v3" - -## -# Snippet for the set_iam_policy call in the TagValues service -# -# This snippet has been automatically generated and should be regarded as a code -# template only. It will require modifications to work: -# - It may require correct/in-range values for request initialization. -# - It may require specifying regional endpoints when creating the service -# client as shown in https://cloud.google.com/ruby/docs/reference. -# -# This is an auto-generated example demonstrating basic usage of -# Google::Cloud::ResourceManager::V3::TagValues::Client#set_iam_policy. -# -def set_iam_policy - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::ResourceManager::V3::TagValues::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Iam::V1::SetIamPolicyRequest.new - - # Call the set_iam_policy method. - result = client.set_iam_policy request - - # The returned object is of type Google::Iam::V1::Policy. - p result -end -# [END cloudresourcemanager_v3_generated_TagValues_SetIamPolicy_sync] diff --git a/owl-bot-staging/google-cloud-resource_manager-v3/snippets/tag_values/test_iam_permissions.rb b/owl-bot-staging/google-cloud-resource_manager-v3/snippets/tag_values/test_iam_permissions.rb deleted file mode 100644 index 92c9f8ebde65..000000000000 --- a/owl-bot-staging/google-cloud-resource_manager-v3/snippets/tag_values/test_iam_permissions.rb +++ /dev/null @@ -1,47 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -# [START cloudresourcemanager_v3_generated_TagValues_TestIamPermissions_sync] -require "google/cloud/resource_manager/v3" - -## -# Snippet for the test_iam_permissions call in the TagValues service -# -# This snippet has been automatically generated and should be regarded as a code -# template only. It will require modifications to work: -# - It may require correct/in-range values for request initialization. -# - It may require specifying regional endpoints when creating the service -# client as shown in https://cloud.google.com/ruby/docs/reference. -# -# This is an auto-generated example demonstrating basic usage of -# Google::Cloud::ResourceManager::V3::TagValues::Client#test_iam_permissions. -# -def test_iam_permissions - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::ResourceManager::V3::TagValues::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Iam::V1::TestIamPermissionsRequest.new - - # Call the test_iam_permissions method. - result = client.test_iam_permissions request - - # The returned object is of type Google::Iam::V1::TestIamPermissionsResponse. - p result -end -# [END cloudresourcemanager_v3_generated_TagValues_TestIamPermissions_sync] diff --git a/owl-bot-staging/google-cloud-resource_manager-v3/snippets/tag_values/update_tag_value.rb b/owl-bot-staging/google-cloud-resource_manager-v3/snippets/tag_values/update_tag_value.rb deleted file mode 100644 index 1fa003855844..000000000000 --- a/owl-bot-staging/google-cloud-resource_manager-v3/snippets/tag_values/update_tag_value.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 cloudresourcemanager_v3_generated_TagValues_UpdateTagValue_sync] -require "google/cloud/resource_manager/v3" - -## -# Snippet for the update_tag_value call in the TagValues service -# -# This snippet has been automatically generated and should be regarded as a code -# template only. It will require modifications to work: -# - It may require correct/in-range values for request initialization. -# - It may require specifying regional endpoints when creating the service -# client as shown in https://cloud.google.com/ruby/docs/reference. -# -# This is an auto-generated example demonstrating basic usage of -# Google::Cloud::ResourceManager::V3::TagValues::Client#update_tag_value. -# -def update_tag_value - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::ResourceManager::V3::TagValues::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::ResourceManager::V3::UpdateTagValueRequest.new - - # Call the update_tag_value method. - result = client.update_tag_value 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 cloudresourcemanager_v3_generated_TagValues_UpdateTagValue_sync] diff --git a/owl-bot-staging/google-cloud-resource_manager-v3/test/google/cloud/resource_manager/v3/folders_operations_test.rb b/owl-bot-staging/google-cloud-resource_manager-v3/test/google/cloud/resource_manager/v3/folders_operations_test.rb deleted file mode 100644 index a6024a1e4623..000000000000 --- a/owl-bot-staging/google-cloud-resource_manager-v3/test/google/cloud/resource_manager/v3/folders_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/cloud/resourcemanager/v3/folders_pb" -require "google/cloud/resourcemanager/v3/folders_services_pb" -require "google/cloud/resource_manager/v3/folders" - -class ::Google::Cloud::ResourceManager::V3::Folders::OperationsTest < Minitest::Test - class ClientStub - attr_accessor :call_rpc_count, :requests - - def initialize response, operation, &block - @response = response - @operation = operation - @block = block - @call_rpc_count = 0 - @requests = [] - end - - def call_rpc *args, **kwargs - @call_rpc_count += 1 - - @requests << @block&.call(*args, **kwargs) - - catch :response do - yield @response, @operation if block_given? - @response - end - end - - def endpoint - "endpoint.example.com" - end - - def universe_domain - "example.com" - end - - def stub_logger - nil - end - - def logger - nil - end - end - - def test_list_operations - # Create GRPC objects. - grpc_response = ::Google::Longrunning::ListOperationsResponse.new - grpc_operation = GRPC::ActiveCall::Operation.new nil - grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - grpc_options = {} - - # Create request parameters for a unary method. - name = "hello world" - filter = "hello world" - page_size = 42 - page_token = "hello world" - return_partial_success = true - - list_operations_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :list_operations, name - assert_kind_of ::Google::Longrunning::ListOperationsRequest, request - assert_equal "hello world", request["name"] - assert_equal "hello world", request["filter"] - assert_equal 42, request["page_size"] - assert_equal "hello world", request["page_token"] - assert_equal true, request["return_partial_success"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, list_operations_client_stub do - # Create client - client = ::Google::Cloud::ResourceManager::V3::Folders::Operations.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.list_operations({ name: name, filter: filter, page_size: page_size, page_token: page_token, return_partial_success: return_partial_success }) do |response, operation| - assert_kind_of Gapic::PagedEnumerable, response - assert_equal grpc_response, response.response - assert_equal grpc_operation, operation - end - - # Use named arguments - client.list_operations name: name, filter: filter, page_size: page_size, page_token: page_token, return_partial_success: return_partial_success do |response, operation| - assert_kind_of Gapic::PagedEnumerable, response - assert_equal grpc_response, response.response - assert_equal grpc_operation, operation - end - - # Use protobuf object - client.list_operations ::Google::Longrunning::ListOperationsRequest.new(name: name, filter: filter, page_size: page_size, page_token: page_token, return_partial_success: return_partial_success) do |response, operation| - assert_kind_of Gapic::PagedEnumerable, response - assert_equal grpc_response, response.response - assert_equal grpc_operation, operation - end - - # Use hash object with options - client.list_operations({ name: name, filter: filter, page_size: page_size, page_token: page_token, return_partial_success: return_partial_success }, grpc_options) do |response, operation| - assert_kind_of Gapic::PagedEnumerable, response - assert_equal grpc_response, response.response - assert_equal grpc_operation, operation - end - - # Use protobuf object with options - client.list_operations(::Google::Longrunning::ListOperationsRequest.new(name: name, filter: filter, page_size: page_size, page_token: page_token, return_partial_success: return_partial_success), grpc_options) do |response, operation| - assert_kind_of Gapic::PagedEnumerable, response - assert_equal grpc_response, response.response - assert_equal grpc_operation, operation - end - - # Verify method calls - assert_equal 5, list_operations_client_stub.call_rpc_count - end - end - - def test_get_operation - # Create GRPC objects. - grpc_response = ::Google::Longrunning::Operation.new - grpc_operation = GRPC::ActiveCall::Operation.new nil - grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - grpc_options = {} - - # Create request parameters for a unary method. - name = "hello world" - - get_operation_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :get_operation, name - assert_kind_of ::Google::Longrunning::GetOperationRequest, request - assert_equal "hello world", request["name"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, get_operation_client_stub do - # Create client - client = ::Google::Cloud::ResourceManager::V3::Folders::Operations.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.get_operation({ name: name }) do |response, operation| - assert_kind_of Gapic::Operation, response - assert_equal grpc_response, response.grpc_op - assert_equal grpc_operation, operation - end - - # Use named arguments - client.get_operation name: name do |response, operation| - assert_kind_of Gapic::Operation, response - assert_equal grpc_response, response.grpc_op - assert_equal grpc_operation, operation - end - - # Use protobuf object - client.get_operation ::Google::Longrunning::GetOperationRequest.new(name: name) do |response, operation| - assert_kind_of Gapic::Operation, response - assert_equal grpc_response, response.grpc_op - assert_equal grpc_operation, operation - end - - # Use hash object with options - client.get_operation({ name: name }, grpc_options) do |response, operation| - assert_kind_of Gapic::Operation, response - assert_equal grpc_response, response.grpc_op - assert_equal grpc_operation, operation - end - - # Use protobuf object with options - client.get_operation(::Google::Longrunning::GetOperationRequest.new(name: name), grpc_options) do |response, operation| - assert_kind_of Gapic::Operation, response - assert_equal grpc_response, response.grpc_op - assert_equal grpc_operation, operation - end - - # Verify method calls - assert_equal 5, get_operation_client_stub.call_rpc_count - end - end - - def test_delete_operation - # Create GRPC objects. - grpc_response = ::Google::Protobuf::Empty.new - grpc_operation = GRPC::ActiveCall::Operation.new nil - grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - grpc_options = {} - - # Create request parameters for a unary method. - name = "hello world" - - delete_operation_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :delete_operation, name - assert_kind_of ::Google::Longrunning::DeleteOperationRequest, request - assert_equal "hello world", request["name"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, delete_operation_client_stub do - # Create client - client = ::Google::Cloud::ResourceManager::V3::Folders::Operations.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.delete_operation({ name: name }) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use named arguments - client.delete_operation name: name do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object - client.delete_operation ::Google::Longrunning::DeleteOperationRequest.new(name: name) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use hash object with options - client.delete_operation({ name: name }, grpc_options) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object with options - client.delete_operation(::Google::Longrunning::DeleteOperationRequest.new(name: name), grpc_options) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Verify method calls - assert_equal 5, delete_operation_client_stub.call_rpc_count - end - end - - def test_cancel_operation - # Create GRPC objects. - grpc_response = ::Google::Protobuf::Empty.new - grpc_operation = GRPC::ActiveCall::Operation.new nil - grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - grpc_options = {} - - # Create request parameters for a unary method. - name = "hello world" - - cancel_operation_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :cancel_operation, name - assert_kind_of ::Google::Longrunning::CancelOperationRequest, request - assert_equal "hello world", request["name"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, cancel_operation_client_stub do - # Create client - client = ::Google::Cloud::ResourceManager::V3::Folders::Operations.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.cancel_operation({ name: name }) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use named arguments - client.cancel_operation name: name do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object - client.cancel_operation ::Google::Longrunning::CancelOperationRequest.new(name: name) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use hash object with options - client.cancel_operation({ name: name }, grpc_options) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object with options - client.cancel_operation(::Google::Longrunning::CancelOperationRequest.new(name: name), grpc_options) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Verify method calls - assert_equal 5, cancel_operation_client_stub.call_rpc_count - end - end - - def test_wait_operation - # Create GRPC objects. - grpc_response = ::Google::Longrunning::Operation.new - grpc_operation = GRPC::ActiveCall::Operation.new nil - grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - grpc_options = {} - - # Create request parameters for a unary method. - name = "hello world" - timeout = {} - - wait_operation_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :wait_operation, name - assert_kind_of ::Google::Longrunning::WaitOperationRequest, request - assert_equal "hello world", request["name"] - assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Protobuf::Duration), request["timeout"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, wait_operation_client_stub do - # Create client - client = ::Google::Cloud::ResourceManager::V3::Folders::Operations.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.wait_operation({ name: name, timeout: timeout }) do |response, operation| - assert_kind_of Gapic::Operation, response - assert_equal grpc_response, response.grpc_op - assert_equal grpc_operation, operation - end - - # Use named arguments - client.wait_operation name: name, timeout: timeout do |response, operation| - assert_kind_of Gapic::Operation, response - assert_equal grpc_response, response.grpc_op - assert_equal grpc_operation, operation - end - - # Use protobuf object - client.wait_operation ::Google::Longrunning::WaitOperationRequest.new(name: name, timeout: timeout) do |response, operation| - assert_kind_of Gapic::Operation, response - assert_equal grpc_response, response.grpc_op - assert_equal grpc_operation, operation - end - - # Use hash object with options - client.wait_operation({ name: name, timeout: timeout }, grpc_options) do |response, operation| - assert_kind_of Gapic::Operation, response - assert_equal grpc_response, response.grpc_op - assert_equal grpc_operation, operation - end - - # Use protobuf object with options - client.wait_operation(::Google::Longrunning::WaitOperationRequest.new(name: name, timeout: timeout), grpc_options) do |response, operation| - assert_kind_of Gapic::Operation, response - assert_equal grpc_response, response.grpc_op - assert_equal grpc_operation, operation - end - - # Verify method calls - assert_equal 5, wait_operation_client_stub.call_rpc_count - end - end - - def test_configure - grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - - client = block_config = config = nil - dummy_stub = ClientStub.new nil, nil - Gapic::ServiceStub.stub :new, dummy_stub do - client = ::Google::Cloud::ResourceManager::V3::Folders::Operations.new do |config| - config.credentials = grpc_channel - end - end - - config = client.configure do |c| - block_config = c - end - - assert_same block_config, config - assert_kind_of ::Google::Cloud::ResourceManager::V3::Folders::Operations::Configuration, config - end -end diff --git a/owl-bot-staging/google-cloud-resource_manager-v3/test/google/cloud/resource_manager/v3/folders_paths_test.rb b/owl-bot-staging/google-cloud-resource_manager-v3/test/google/cloud/resource_manager/v3/folders_paths_test.rb deleted file mode 100644 index d9004604858b..000000000000 --- a/owl-bot-staging/google-cloud-resource_manager-v3/test/google/cloud/resource_manager/v3/folders_paths_test.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 "helper" - -require "gapic/grpc/service_stub" - -require "google/cloud/resource_manager/v3/folders" - -class ::Google::Cloud::ResourceManager::V3::Folders::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_path - grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - ::Gapic::ServiceStub.stub :new, DummyStub.new do - client = ::Google::Cloud::ResourceManager::V3::Folders::Client.new do |config| - config.credentials = grpc_channel - end - - path = client.folder_path folder: "value0" - assert_equal "folders/value0", path - end - end -end diff --git a/owl-bot-staging/google-cloud-resource_manager-v3/test/google/cloud/resource_manager/v3/folders_rest_test.rb b/owl-bot-staging/google-cloud-resource_manager-v3/test/google/cloud/resource_manager/v3/folders_rest_test.rb deleted file mode 100644 index 30a2816a99b1..000000000000 --- a/owl-bot-staging/google-cloud-resource_manager-v3/test/google/cloud/resource_manager/v3/folders_rest_test.rb +++ /dev/null @@ -1,704 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -require "helper" -require "gapic/rest" -require "google/cloud/resourcemanager/v3/folders_pb" -require "google/cloud/resource_manager/v3/folders/rest" - - -class ::Google::Cloud::ResourceManager::V3::Folders::Rest::ClientTest < Minitest::Test - class ClientStub - attr_accessor :call_count, :requests - - def initialize response, &block - @response = response - @block = block - @call_count = 0 - @requests = [] - end - - def make_get_request uri:, params: {}, options: {}, method_name: nil - make_http_request :get, uri: uri, body: nil, params: params, options: options, method_name: method_name - end - - def make_delete_request uri:, params: {}, options: {}, method_name: nil - make_http_request :delete, uri: uri, body: nil, params: params, options: options, method_name: method_name - end - - def make_post_request uri:, body: nil, params: {}, options: {}, method_name: nil - make_http_request :post, uri: uri, body: body, params: params, options: options, method_name: method_name - end - - def make_patch_request uri:, body:, params: {}, options: {}, method_name: nil - make_http_request :patch, uri: uri, body: body, params: params, options: options, method_name: method_name - end - - def make_put_request uri:, body:, params: {}, options: {}, method_name: nil - make_http_request :put, uri: uri, body: body, params: params, options: options, method_name: method_name - end - - def make_http_request *args, **kwargs - @call_count += 1 - - @requests << @block&.call(*args, **kwargs) - - @response - end - - def endpoint - "endpoint.example.com" - end - - def universe_domain - "example.com" - end - - def stub_logger - nil - end - - def logger - nil - end - end - - def test_get_folder - # Create test objects. - client_result = ::Google::Cloud::ResourceManager::V3::Folder.new - http_response = OpenStruct.new body: client_result.to_json - - call_options = {} - - # Create request parameters for a unary method. - name = "hello world" - - get_folder_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| - assert options.metadata.key? :"x-goog-api-client" - assert options.metadata[:"x-goog-api-client"].include? "rest" - refute options.metadata[:"x-goog-api-client"].include? "grpc" - end - - ::Google::Cloud::ResourceManager::V3::Folders::Rest::ServiceStub.stub :transcode_get_folder_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, get_folder_client_stub do - # Create client - client = ::Google::Cloud::ResourceManager::V3::Folders::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - client.get_folder({ name: name }) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use named arguments - client.get_folder name: name do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object - client.get_folder ::Google::Cloud::ResourceManager::V3::GetFolderRequest.new(name: name) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use hash object with options - client.get_folder({ name: name }, call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object with options - client.get_folder(::Google::Cloud::ResourceManager::V3::GetFolderRequest.new(name: name), call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Verify method calls - assert_equal 5, get_folder_client_stub.call_count - end - end - end - - def test_list_folders - # Create test objects. - client_result = ::Google::Cloud::ResourceManager::V3::ListFoldersResponse.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" - show_deleted = true - - list_folders_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| - assert options.metadata.key? :"x-goog-api-client" - assert options.metadata[:"x-goog-api-client"].include? "rest" - refute options.metadata[:"x-goog-api-client"].include? "grpc" - end - - ::Google::Cloud::ResourceManager::V3::Folders::Rest::ServiceStub.stub :transcode_list_folders_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, list_folders_client_stub do - # Create client - client = ::Google::Cloud::ResourceManager::V3::Folders::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - client.list_folders({ parent: parent, page_size: page_size, page_token: page_token, show_deleted: show_deleted }) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use named arguments - client.list_folders parent: parent, page_size: page_size, page_token: page_token, show_deleted: show_deleted do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object - client.list_folders ::Google::Cloud::ResourceManager::V3::ListFoldersRequest.new(parent: parent, page_size: page_size, page_token: page_token, show_deleted: show_deleted) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use hash object with options - client.list_folders({ parent: parent, page_size: page_size, page_token: page_token, show_deleted: show_deleted }, call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object with options - client.list_folders(::Google::Cloud::ResourceManager::V3::ListFoldersRequest.new(parent: parent, page_size: page_size, page_token: page_token, show_deleted: show_deleted), call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Verify method calls - assert_equal 5, list_folders_client_stub.call_count - end - end - end - - def test_search_folders - # Create test objects. - client_result = ::Google::Cloud::ResourceManager::V3::SearchFoldersResponse.new - http_response = OpenStruct.new body: client_result.to_json - - call_options = {} - - # Create request parameters for a unary method. - page_size = 42 - page_token = "hello world" - query = "hello world" - - search_folders_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| - assert options.metadata.key? :"x-goog-api-client" - assert options.metadata[:"x-goog-api-client"].include? "rest" - refute options.metadata[:"x-goog-api-client"].include? "grpc" - end - - ::Google::Cloud::ResourceManager::V3::Folders::Rest::ServiceStub.stub :transcode_search_folders_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, search_folders_client_stub do - # Create client - client = ::Google::Cloud::ResourceManager::V3::Folders::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - client.search_folders({ page_size: page_size, page_token: page_token, query: query }) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use named arguments - client.search_folders page_size: page_size, page_token: page_token, query: query do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object - client.search_folders ::Google::Cloud::ResourceManager::V3::SearchFoldersRequest.new(page_size: page_size, page_token: page_token, query: query) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use hash object with options - client.search_folders({ page_size: page_size, page_token: page_token, query: query }, call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object with options - client.search_folders(::Google::Cloud::ResourceManager::V3::SearchFoldersRequest.new(page_size: page_size, page_token: page_token, query: query), call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Verify method calls - assert_equal 5, search_folders_client_stub.call_count - end - end - end - - def test_create_folder - # 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. - folder = {} - - create_folder_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| - assert options.metadata.key? :"x-goog-api-client" - assert options.metadata[:"x-goog-api-client"].include? "rest" - refute options.metadata[:"x-goog-api-client"].include? "grpc" - end - - ::Google::Cloud::ResourceManager::V3::Folders::Rest::ServiceStub.stub :transcode_create_folder_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, create_folder_client_stub do - # Create client - client = ::Google::Cloud::ResourceManager::V3::Folders::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - client.create_folder({ folder: folder }) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use named arguments - client.create_folder folder: folder do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object - client.create_folder ::Google::Cloud::ResourceManager::V3::CreateFolderRequest.new(folder: folder) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use hash object with options - client.create_folder({ folder: folder }, call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object with options - client.create_folder(::Google::Cloud::ResourceManager::V3::CreateFolderRequest.new(folder: folder), call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Verify method calls - assert_equal 5, create_folder_client_stub.call_count - end - end - end - - def test_update_folder - # 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. - folder = {} - update_mask = {} - - update_folder_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| - assert options.metadata.key? :"x-goog-api-client" - assert options.metadata[:"x-goog-api-client"].include? "rest" - refute options.metadata[:"x-goog-api-client"].include? "grpc" - end - - ::Google::Cloud::ResourceManager::V3::Folders::Rest::ServiceStub.stub :transcode_update_folder_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, update_folder_client_stub do - # Create client - client = ::Google::Cloud::ResourceManager::V3::Folders::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - client.update_folder({ folder: folder, update_mask: update_mask }) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use named arguments - client.update_folder folder: folder, update_mask: update_mask do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object - client.update_folder ::Google::Cloud::ResourceManager::V3::UpdateFolderRequest.new(folder: folder, update_mask: update_mask) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use hash object with options - client.update_folder({ folder: folder, update_mask: update_mask }, call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object with options - client.update_folder(::Google::Cloud::ResourceManager::V3::UpdateFolderRequest.new(folder: folder, update_mask: update_mask), call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Verify method calls - assert_equal 5, update_folder_client_stub.call_count - end - end - end - - def test_move_folder - # 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" - destination_parent = "hello world" - - move_folder_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| - assert options.metadata.key? :"x-goog-api-client" - assert options.metadata[:"x-goog-api-client"].include? "rest" - refute options.metadata[:"x-goog-api-client"].include? "grpc" - end - - ::Google::Cloud::ResourceManager::V3::Folders::Rest::ServiceStub.stub :transcode_move_folder_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, move_folder_client_stub do - # Create client - client = ::Google::Cloud::ResourceManager::V3::Folders::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - client.move_folder({ name: name, destination_parent: destination_parent }) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use named arguments - client.move_folder name: name, destination_parent: destination_parent do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object - client.move_folder ::Google::Cloud::ResourceManager::V3::MoveFolderRequest.new(name: name, destination_parent: destination_parent) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use hash object with options - client.move_folder({ name: name, destination_parent: destination_parent }, call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object with options - client.move_folder(::Google::Cloud::ResourceManager::V3::MoveFolderRequest.new(name: name, destination_parent: destination_parent), call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Verify method calls - assert_equal 5, move_folder_client_stub.call_count - end - end - end - - def test_delete_folder - # 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" - - delete_folder_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| - assert options.metadata.key? :"x-goog-api-client" - assert options.metadata[:"x-goog-api-client"].include? "rest" - refute options.metadata[:"x-goog-api-client"].include? "grpc" - end - - ::Google::Cloud::ResourceManager::V3::Folders::Rest::ServiceStub.stub :transcode_delete_folder_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, delete_folder_client_stub do - # Create client - client = ::Google::Cloud::ResourceManager::V3::Folders::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - client.delete_folder({ name: name }) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use named arguments - client.delete_folder name: name do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object - client.delete_folder ::Google::Cloud::ResourceManager::V3::DeleteFolderRequest.new(name: name) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use hash object with options - client.delete_folder({ name: name }, call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object with options - client.delete_folder(::Google::Cloud::ResourceManager::V3::DeleteFolderRequest.new(name: name), call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Verify method calls - assert_equal 5, delete_folder_client_stub.call_count - end - end - end - - def test_undelete_folder - # 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" - - undelete_folder_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| - assert options.metadata.key? :"x-goog-api-client" - assert options.metadata[:"x-goog-api-client"].include? "rest" - refute options.metadata[:"x-goog-api-client"].include? "grpc" - end - - ::Google::Cloud::ResourceManager::V3::Folders::Rest::ServiceStub.stub :transcode_undelete_folder_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, undelete_folder_client_stub do - # Create client - client = ::Google::Cloud::ResourceManager::V3::Folders::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - client.undelete_folder({ name: name }) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use named arguments - client.undelete_folder name: name do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object - client.undelete_folder ::Google::Cloud::ResourceManager::V3::UndeleteFolderRequest.new(name: name) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use hash object with options - client.undelete_folder({ name: name }, call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object with options - client.undelete_folder(::Google::Cloud::ResourceManager::V3::UndeleteFolderRequest.new(name: name), call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Verify method calls - assert_equal 5, undelete_folder_client_stub.call_count - end - end - end - - def test_get_iam_policy - # Create test objects. - client_result = ::Google::Iam::V1::Policy.new - http_response = OpenStruct.new body: client_result.to_json - - call_options = {} - - # Create request parameters for a unary method. - resource = "hello world" - options = {} - - get_iam_policy_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| - assert options.metadata.key? :"x-goog-api-client" - assert options.metadata[:"x-goog-api-client"].include? "rest" - refute options.metadata[:"x-goog-api-client"].include? "grpc" - end - - ::Google::Cloud::ResourceManager::V3::Folders::Rest::ServiceStub.stub :transcode_get_iam_policy_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, get_iam_policy_client_stub do - # Create client - client = ::Google::Cloud::ResourceManager::V3::Folders::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - client.get_iam_policy({ resource: resource, options: options }) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use named arguments - client.get_iam_policy resource: resource, options: options do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object - client.get_iam_policy ::Google::Iam::V1::GetIamPolicyRequest.new(resource: resource, options: options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use hash object with options - client.get_iam_policy({ resource: resource, options: options }, call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object with options - client.get_iam_policy(::Google::Iam::V1::GetIamPolicyRequest.new(resource: resource, options: options), call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Verify method calls - assert_equal 5, get_iam_policy_client_stub.call_count - end - end - end - - def test_set_iam_policy - # Create test objects. - client_result = ::Google::Iam::V1::Policy.new - http_response = OpenStruct.new body: client_result.to_json - - call_options = {} - - # Create request parameters for a unary method. - resource = "hello world" - policy = {} - update_mask = {} - - set_iam_policy_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| - assert options.metadata.key? :"x-goog-api-client" - assert options.metadata[:"x-goog-api-client"].include? "rest" - refute options.metadata[:"x-goog-api-client"].include? "grpc" - end - - ::Google::Cloud::ResourceManager::V3::Folders::Rest::ServiceStub.stub :transcode_set_iam_policy_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, set_iam_policy_client_stub do - # Create client - client = ::Google::Cloud::ResourceManager::V3::Folders::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - client.set_iam_policy({ resource: resource, policy: policy, update_mask: update_mask }) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use named arguments - client.set_iam_policy resource: resource, policy: policy, update_mask: update_mask do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object - client.set_iam_policy ::Google::Iam::V1::SetIamPolicyRequest.new(resource: resource, policy: policy, update_mask: update_mask) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use hash object with options - client.set_iam_policy({ resource: resource, policy: policy, update_mask: update_mask }, call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object with options - client.set_iam_policy(::Google::Iam::V1::SetIamPolicyRequest.new(resource: resource, policy: policy, update_mask: update_mask), call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Verify method calls - assert_equal 5, set_iam_policy_client_stub.call_count - end - end - end - - def test_test_iam_permissions - # Create test objects. - client_result = ::Google::Iam::V1::TestIamPermissionsResponse.new - http_response = OpenStruct.new body: client_result.to_json - - call_options = {} - - # Create request parameters for a unary method. - resource = "hello world" - permissions = ["hello world"] - - test_iam_permissions_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| - assert options.metadata.key? :"x-goog-api-client" - assert options.metadata[:"x-goog-api-client"].include? "rest" - refute options.metadata[:"x-goog-api-client"].include? "grpc" - end - - ::Google::Cloud::ResourceManager::V3::Folders::Rest::ServiceStub.stub :transcode_test_iam_permissions_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, test_iam_permissions_client_stub do - # Create client - client = ::Google::Cloud::ResourceManager::V3::Folders::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - client.test_iam_permissions({ resource: resource, permissions: permissions }) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use named arguments - client.test_iam_permissions resource: resource, permissions: permissions do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object - client.test_iam_permissions ::Google::Iam::V1::TestIamPermissionsRequest.new(resource: resource, permissions: permissions) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use hash object with options - client.test_iam_permissions({ resource: resource, permissions: permissions }, call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object with options - client.test_iam_permissions(::Google::Iam::V1::TestIamPermissionsRequest.new(resource: resource, permissions: permissions), call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Verify method calls - assert_equal 5, test_iam_permissions_client_stub.call_count - end - end - end - - def test_configure - credentials_token = :dummy_value - - client = block_config = config = nil - dummy_stub = ClientStub.new nil - Gapic::Rest::ClientStub.stub :new, dummy_stub do - client = ::Google::Cloud::ResourceManager::V3::Folders::Rest::Client.new do |config| - config.credentials = credentials_token - end - end - - config = client.configure do |c| - block_config = c - end - - assert_same block_config, config - assert_kind_of ::Google::Cloud::ResourceManager::V3::Folders::Rest::Client::Configuration, config - end -end diff --git a/owl-bot-staging/google-cloud-resource_manager-v3/test/google/cloud/resource_manager/v3/folders_test.rb b/owl-bot-staging/google-cloud-resource_manager-v3/test/google/cloud/resource_manager/v3/folders_test.rb deleted file mode 100644 index 8e90b470f0c2..000000000000 --- a/owl-bot-staging/google-cloud-resource_manager-v3/test/google/cloud/resource_manager/v3/folders_test.rb +++ /dev/null @@ -1,813 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -require "helper" - -require "gapic/grpc/service_stub" - -require "google/cloud/resourcemanager/v3/folders_pb" -require "google/cloud/resource_manager/v3/folders" - -class ::Google::Cloud::ResourceManager::V3::Folders::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_get_folder - # Create GRPC objects. - grpc_response = ::Google::Cloud::ResourceManager::V3::Folder.new - grpc_operation = GRPC::ActiveCall::Operation.new nil - grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - grpc_options = {} - - # Create request parameters for a unary method. - name = "hello world" - - get_folder_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :get_folder, name - assert_kind_of ::Google::Cloud::ResourceManager::V3::GetFolderRequest, request - assert_equal "hello world", request["name"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, get_folder_client_stub do - # Create client - client = ::Google::Cloud::ResourceManager::V3::Folders::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.get_folder({ name: name }) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use named arguments - client.get_folder name: name do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object - client.get_folder ::Google::Cloud::ResourceManager::V3::GetFolderRequest.new(name: name) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use hash object with options - client.get_folder({ name: name }, grpc_options) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object with options - client.get_folder(::Google::Cloud::ResourceManager::V3::GetFolderRequest.new(name: name), grpc_options) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Verify method calls - assert_equal 5, get_folder_client_stub.call_rpc_count - end - end - - def test_list_folders - # Create GRPC objects. - grpc_response = ::Google::Cloud::ResourceManager::V3::ListFoldersResponse.new - grpc_operation = GRPC::ActiveCall::Operation.new nil - grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - grpc_options = {} - - # Create request parameters for a unary method. - parent = "hello world" - page_size = 42 - page_token = "hello world" - show_deleted = true - - list_folders_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :list_folders, name - assert_kind_of ::Google::Cloud::ResourceManager::V3::ListFoldersRequest, request - assert_equal "hello world", request["parent"] - assert_equal 42, request["page_size"] - assert_equal "hello world", request["page_token"] - assert_equal true, request["show_deleted"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, list_folders_client_stub do - # Create client - client = ::Google::Cloud::ResourceManager::V3::Folders::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.list_folders({ parent: parent, page_size: page_size, page_token: page_token, show_deleted: show_deleted }) do |response, operation| - assert_kind_of Gapic::PagedEnumerable, response - assert_equal grpc_response, response.response - assert_equal grpc_operation, operation - end - - # Use named arguments - client.list_folders parent: parent, page_size: page_size, page_token: page_token, show_deleted: show_deleted do |response, operation| - assert_kind_of Gapic::PagedEnumerable, response - assert_equal grpc_response, response.response - assert_equal grpc_operation, operation - end - - # Use protobuf object - client.list_folders ::Google::Cloud::ResourceManager::V3::ListFoldersRequest.new(parent: parent, page_size: page_size, page_token: page_token, show_deleted: show_deleted) do |response, operation| - assert_kind_of Gapic::PagedEnumerable, response - assert_equal grpc_response, response.response - assert_equal grpc_operation, operation - end - - # Use hash object with options - client.list_folders({ parent: parent, page_size: page_size, page_token: page_token, show_deleted: show_deleted }, grpc_options) do |response, operation| - assert_kind_of Gapic::PagedEnumerable, response - assert_equal grpc_response, response.response - assert_equal grpc_operation, operation - end - - # Use protobuf object with options - client.list_folders(::Google::Cloud::ResourceManager::V3::ListFoldersRequest.new(parent: parent, page_size: page_size, page_token: page_token, show_deleted: show_deleted), grpc_options) do |response, operation| - assert_kind_of Gapic::PagedEnumerable, response - assert_equal grpc_response, response.response - assert_equal grpc_operation, operation - end - - # Verify method calls - assert_equal 5, list_folders_client_stub.call_rpc_count - end - end - - def test_search_folders - # Create GRPC objects. - grpc_response = ::Google::Cloud::ResourceManager::V3::SearchFoldersResponse.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. - page_size = 42 - page_token = "hello world" - query = "hello world" - - search_folders_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :search_folders, name - assert_kind_of ::Google::Cloud::ResourceManager::V3::SearchFoldersRequest, request - assert_equal 42, request["page_size"] - assert_equal "hello world", request["page_token"] - assert_equal "hello world", request["query"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, search_folders_client_stub do - # Create client - client = ::Google::Cloud::ResourceManager::V3::Folders::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.search_folders({ page_size: page_size, page_token: page_token, query: query }) 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_folders page_size: page_size, page_token: page_token, query: query 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_folders ::Google::Cloud::ResourceManager::V3::SearchFoldersRequest.new(page_size: page_size, page_token: page_token, query: query) 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_folders({ page_size: page_size, page_token: page_token, query: query }, 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_folders(::Google::Cloud::ResourceManager::V3::SearchFoldersRequest.new(page_size: page_size, page_token: page_token, query: query), 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_folders_client_stub.call_rpc_count - end - end - - def test_create_folder - # Create GRPC objects. - grpc_response = ::Google::Longrunning::Operation.new - grpc_operation = GRPC::ActiveCall::Operation.new nil - grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - grpc_options = {} - - # Create request parameters for a unary method. - folder = {} - - create_folder_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :create_folder, name - assert_kind_of ::Google::Cloud::ResourceManager::V3::CreateFolderRequest, request - assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::ResourceManager::V3::Folder), request["folder"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, create_folder_client_stub do - # Create client - client = ::Google::Cloud::ResourceManager::V3::Folders::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.create_folder({ folder: folder }) 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_folder folder: folder 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_folder ::Google::Cloud::ResourceManager::V3::CreateFolderRequest.new(folder: folder) 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_folder({ folder: folder }, 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_folder(::Google::Cloud::ResourceManager::V3::CreateFolderRequest.new(folder: folder), 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_folder_client_stub.call_rpc_count - end - end - - def test_update_folder - # Create GRPC objects. - grpc_response = ::Google::Longrunning::Operation.new - grpc_operation = GRPC::ActiveCall::Operation.new nil - grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - grpc_options = {} - - # Create request parameters for a unary method. - folder = {} - update_mask = {} - - update_folder_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :update_folder, name - assert_kind_of ::Google::Cloud::ResourceManager::V3::UpdateFolderRequest, request - assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::ResourceManager::V3::Folder), request["folder"] - assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Protobuf::FieldMask), request["update_mask"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, update_folder_client_stub do - # Create client - client = ::Google::Cloud::ResourceManager::V3::Folders::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.update_folder({ folder: folder, 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_folder folder: folder, 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_folder ::Google::Cloud::ResourceManager::V3::UpdateFolderRequest.new(folder: folder, 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_folder({ folder: folder, 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_folder(::Google::Cloud::ResourceManager::V3::UpdateFolderRequest.new(folder: folder, 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_folder_client_stub.call_rpc_count - end - end - - def test_move_folder - # Create GRPC objects. - grpc_response = ::Google::Longrunning::Operation.new - grpc_operation = GRPC::ActiveCall::Operation.new nil - grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - grpc_options = {} - - # Create request parameters for a unary method. - name = "hello world" - destination_parent = "hello world" - - move_folder_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :move_folder, name - assert_kind_of ::Google::Cloud::ResourceManager::V3::MoveFolderRequest, request - assert_equal "hello world", request["name"] - assert_equal "hello world", request["destination_parent"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, move_folder_client_stub do - # Create client - client = ::Google::Cloud::ResourceManager::V3::Folders::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.move_folder({ name: name, destination_parent: destination_parent }) 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.move_folder name: name, destination_parent: destination_parent 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.move_folder ::Google::Cloud::ResourceManager::V3::MoveFolderRequest.new(name: name, destination_parent: destination_parent) 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.move_folder({ name: name, destination_parent: destination_parent }, 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.move_folder(::Google::Cloud::ResourceManager::V3::MoveFolderRequest.new(name: name, destination_parent: destination_parent), 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, move_folder_client_stub.call_rpc_count - end - end - - def test_delete_folder - # Create GRPC objects. - grpc_response = ::Google::Longrunning::Operation.new - grpc_operation = GRPC::ActiveCall::Operation.new nil - grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - grpc_options = {} - - # Create request parameters for a unary method. - name = "hello world" - - delete_folder_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :delete_folder, name - assert_kind_of ::Google::Cloud::ResourceManager::V3::DeleteFolderRequest, request - assert_equal "hello world", request["name"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, delete_folder_client_stub do - # Create client - client = ::Google::Cloud::ResourceManager::V3::Folders::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.delete_folder({ 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.delete_folder 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.delete_folder ::Google::Cloud::ResourceManager::V3::DeleteFolderRequest.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.delete_folder({ 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.delete_folder(::Google::Cloud::ResourceManager::V3::DeleteFolderRequest.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, delete_folder_client_stub.call_rpc_count - end - end - - def test_undelete_folder - # Create GRPC objects. - grpc_response = ::Google::Longrunning::Operation.new - grpc_operation = GRPC::ActiveCall::Operation.new nil - grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - grpc_options = {} - - # Create request parameters for a unary method. - name = "hello world" - - undelete_folder_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :undelete_folder, name - assert_kind_of ::Google::Cloud::ResourceManager::V3::UndeleteFolderRequest, request - assert_equal "hello world", request["name"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, undelete_folder_client_stub do - # Create client - client = ::Google::Cloud::ResourceManager::V3::Folders::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.undelete_folder({ 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.undelete_folder 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.undelete_folder ::Google::Cloud::ResourceManager::V3::UndeleteFolderRequest.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.undelete_folder({ 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.undelete_folder(::Google::Cloud::ResourceManager::V3::UndeleteFolderRequest.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, undelete_folder_client_stub.call_rpc_count - end - end - - def test_get_iam_policy - # Create GRPC objects. - grpc_response = ::Google::Iam::V1::Policy.new - grpc_operation = GRPC::ActiveCall::Operation.new nil - grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - grpc_options = {} - - # Create request parameters for a unary method. - resource = "hello world" - options = {} - - get_iam_policy_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :get_iam_policy, name - assert_kind_of ::Google::Iam::V1::GetIamPolicyRequest, request - assert_equal "hello world", request["resource"] - assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Iam::V1::GetPolicyOptions), request["options"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, get_iam_policy_client_stub do - # Create client - client = ::Google::Cloud::ResourceManager::V3::Folders::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.get_iam_policy({ resource: resource, options: options }) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use named arguments - client.get_iam_policy resource: resource, options: options do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object - client.get_iam_policy ::Google::Iam::V1::GetIamPolicyRequest.new(resource: resource, options: options) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use hash object with options - client.get_iam_policy({ resource: resource, options: options }, grpc_options) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object with options - client.get_iam_policy(::Google::Iam::V1::GetIamPolicyRequest.new(resource: resource, options: options), grpc_options) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Verify method calls - assert_equal 5, get_iam_policy_client_stub.call_rpc_count - end - end - - def test_set_iam_policy - # Create GRPC objects. - grpc_response = ::Google::Iam::V1::Policy.new - grpc_operation = GRPC::ActiveCall::Operation.new nil - grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - grpc_options = {} - - # Create request parameters for a unary method. - resource = "hello world" - policy = {} - update_mask = {} - - set_iam_policy_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :set_iam_policy, name - assert_kind_of ::Google::Iam::V1::SetIamPolicyRequest, request - assert_equal "hello world", request["resource"] - assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Iam::V1::Policy), request["policy"] - assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Protobuf::FieldMask), request["update_mask"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, set_iam_policy_client_stub do - # Create client - client = ::Google::Cloud::ResourceManager::V3::Folders::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.set_iam_policy({ resource: resource, policy: policy, update_mask: update_mask }) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use named arguments - client.set_iam_policy resource: resource, policy: policy, update_mask: update_mask do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object - client.set_iam_policy ::Google::Iam::V1::SetIamPolicyRequest.new(resource: resource, policy: policy, update_mask: update_mask) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use hash object with options - client.set_iam_policy({ resource: resource, policy: policy, update_mask: update_mask }, grpc_options) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object with options - client.set_iam_policy(::Google::Iam::V1::SetIamPolicyRequest.new(resource: resource, policy: policy, update_mask: update_mask), grpc_options) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Verify method calls - assert_equal 5, set_iam_policy_client_stub.call_rpc_count - end - end - - def test_test_iam_permissions - # Create GRPC objects. - grpc_response = ::Google::Iam::V1::TestIamPermissionsResponse.new - grpc_operation = GRPC::ActiveCall::Operation.new nil - grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - grpc_options = {} - - # Create request parameters for a unary method. - resource = "hello world" - permissions = ["hello world"] - - test_iam_permissions_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :test_iam_permissions, name - assert_kind_of ::Google::Iam::V1::TestIamPermissionsRequest, request - assert_equal "hello world", request["resource"] - assert_equal ["hello world"], request["permissions"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, test_iam_permissions_client_stub do - # Create client - client = ::Google::Cloud::ResourceManager::V3::Folders::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.test_iam_permissions({ resource: resource, permissions: permissions }) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use named arguments - client.test_iam_permissions resource: resource, permissions: permissions do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object - client.test_iam_permissions ::Google::Iam::V1::TestIamPermissionsRequest.new(resource: resource, permissions: permissions) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use hash object with options - client.test_iam_permissions({ resource: resource, permissions: permissions }, grpc_options) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object with options - client.test_iam_permissions(::Google::Iam::V1::TestIamPermissionsRequest.new(resource: resource, permissions: permissions), grpc_options) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Verify method calls - assert_equal 5, test_iam_permissions_client_stub.call_rpc_count - end - end - - def test_configure - grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - - client = block_config = config = nil - dummy_stub = ClientStub.new nil, nil - Gapic::ServiceStub.stub :new, dummy_stub do - client = ::Google::Cloud::ResourceManager::V3::Folders::Client.new do |config| - config.credentials = grpc_channel - end - end - - config = client.configure do |c| - block_config = c - end - - assert_same block_config, config - assert_kind_of ::Google::Cloud::ResourceManager::V3::Folders::Client::Configuration, config - end - - def test_credentials - key = OpenSSL::PKey::RSA.new 2048 - cred_json = { - "private_key" => key.to_pem, - "client_email" => "app@developer.gserviceaccount.com", - "type" => "service_account" - } - key_file = StringIO.new cred_json.to_json - creds = Google::Auth::ServiceAccountCredentials.make_creds({ json_key_io: key_file }) - - dummy_stub = ClientStub.new nil, nil - Gapic::ServiceStub.stub :new, dummy_stub do - client = ::Google::Cloud::ResourceManager::V3::Folders::Client.new do |config| - config.credentials = creds - end - assert_kind_of ::Google::Cloud::ResourceManager::V3::Folders::Client, client - assert_equal creds, client.configure.credentials - end - end - - def test_operations_client - grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - - client = nil - dummy_stub = ClientStub.new nil, nil - Gapic::ServiceStub.stub :new, dummy_stub do - client = ::Google::Cloud::ResourceManager::V3::Folders::Client.new do |config| - config.credentials = grpc_channel - end - end - - assert_kind_of ::Google::Cloud::ResourceManager::V3::Folders::Operations, client.operations_client - end -end diff --git a/owl-bot-staging/google-cloud-resource_manager-v3/test/google/cloud/resource_manager/v3/organizations_paths_test.rb b/owl-bot-staging/google-cloud-resource_manager-v3/test/google/cloud/resource_manager/v3/organizations_paths_test.rb deleted file mode 100644 index ebf070ca894a..000000000000 --- a/owl-bot-staging/google-cloud-resource_manager-v3/test/google/cloud/resource_manager/v3/organizations_paths_test.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 "helper" - -require "gapic/grpc/service_stub" - -require "google/cloud/resource_manager/v3/organizations" - -class ::Google::Cloud::ResourceManager::V3::Organizations::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_path - grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - ::Gapic::ServiceStub.stub :new, DummyStub.new do - client = ::Google::Cloud::ResourceManager::V3::Organizations::Client.new do |config| - config.credentials = grpc_channel - end - - path = client.organization_path organization: "value0" - assert_equal "organizations/value0", path - end - end -end diff --git a/owl-bot-staging/google-cloud-resource_manager-v3/test/google/cloud/resource_manager/v3/organizations_rest_test.rb b/owl-bot-staging/google-cloud-resource_manager-v3/test/google/cloud/resource_manager/v3/organizations_rest_test.rb deleted file mode 100644 index 59d2404dff49..000000000000 --- a/owl-bot-staging/google-cloud-resource_manager-v3/test/google/cloud/resource_manager/v3/organizations_rest_test.rb +++ /dev/null @@ -1,375 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -require "helper" -require "gapic/rest" -require "google/cloud/resourcemanager/v3/organizations_pb" -require "google/cloud/resource_manager/v3/organizations/rest" - - -class ::Google::Cloud::ResourceManager::V3::Organizations::Rest::ClientTest < Minitest::Test - class ClientStub - attr_accessor :call_count, :requests - - def initialize response, &block - @response = response - @block = block - @call_count = 0 - @requests = [] - end - - def make_get_request uri:, params: {}, options: {}, method_name: nil - make_http_request :get, uri: uri, body: nil, params: params, options: options, method_name: method_name - end - - def make_delete_request uri:, params: {}, options: {}, method_name: nil - make_http_request :delete, uri: uri, body: nil, params: params, options: options, method_name: method_name - end - - def make_post_request uri:, body: nil, params: {}, options: {}, method_name: nil - make_http_request :post, uri: uri, body: body, params: params, options: options, method_name: method_name - end - - def make_patch_request uri:, body:, params: {}, options: {}, method_name: nil - make_http_request :patch, uri: uri, body: body, params: params, options: options, method_name: method_name - end - - def make_put_request uri:, body:, params: {}, options: {}, method_name: nil - make_http_request :put, uri: uri, body: body, params: params, options: options, method_name: method_name - end - - def make_http_request *args, **kwargs - @call_count += 1 - - @requests << @block&.call(*args, **kwargs) - - @response - end - - def endpoint - "endpoint.example.com" - end - - def universe_domain - "example.com" - end - - def stub_logger - nil - end - - def logger - nil - end - end - - def test_get_organization - # Create test objects. - client_result = ::Google::Cloud::ResourceManager::V3::Organization.new - http_response = OpenStruct.new body: client_result.to_json - - call_options = {} - - # Create request parameters for a unary method. - name = "hello world" - - get_organization_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| - assert options.metadata.key? :"x-goog-api-client" - assert options.metadata[:"x-goog-api-client"].include? "rest" - refute options.metadata[:"x-goog-api-client"].include? "grpc" - end - - ::Google::Cloud::ResourceManager::V3::Organizations::Rest::ServiceStub.stub :transcode_get_organization_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, get_organization_client_stub do - # Create client - client = ::Google::Cloud::ResourceManager::V3::Organizations::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - client.get_organization({ name: name }) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use named arguments - client.get_organization name: name do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object - client.get_organization ::Google::Cloud::ResourceManager::V3::GetOrganizationRequest.new(name: name) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use hash object with options - client.get_organization({ name: name }, call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object with options - client.get_organization(::Google::Cloud::ResourceManager::V3::GetOrganizationRequest.new(name: name), call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Verify method calls - assert_equal 5, get_organization_client_stub.call_count - end - end - end - - def test_search_organizations - # Create test objects. - client_result = ::Google::Cloud::ResourceManager::V3::SearchOrganizationsResponse.new - http_response = OpenStruct.new body: client_result.to_json - - call_options = {} - - # Create request parameters for a unary method. - page_size = 42 - page_token = "hello world" - query = "hello world" - - search_organizations_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| - assert options.metadata.key? :"x-goog-api-client" - assert options.metadata[:"x-goog-api-client"].include? "rest" - refute options.metadata[:"x-goog-api-client"].include? "grpc" - end - - ::Google::Cloud::ResourceManager::V3::Organizations::Rest::ServiceStub.stub :transcode_search_organizations_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, search_organizations_client_stub do - # Create client - client = ::Google::Cloud::ResourceManager::V3::Organizations::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - client.search_organizations({ page_size: page_size, page_token: page_token, query: query }) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use named arguments - client.search_organizations page_size: page_size, page_token: page_token, query: query do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object - client.search_organizations ::Google::Cloud::ResourceManager::V3::SearchOrganizationsRequest.new(page_size: page_size, page_token: page_token, query: query) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use hash object with options - client.search_organizations({ page_size: page_size, page_token: page_token, query: query }, call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object with options - client.search_organizations(::Google::Cloud::ResourceManager::V3::SearchOrganizationsRequest.new(page_size: page_size, page_token: page_token, query: query), call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Verify method calls - assert_equal 5, search_organizations_client_stub.call_count - end - end - end - - def test_get_iam_policy - # Create test objects. - client_result = ::Google::Iam::V1::Policy.new - http_response = OpenStruct.new body: client_result.to_json - - call_options = {} - - # Create request parameters for a unary method. - resource = "hello world" - options = {} - - get_iam_policy_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| - assert options.metadata.key? :"x-goog-api-client" - assert options.metadata[:"x-goog-api-client"].include? "rest" - refute options.metadata[:"x-goog-api-client"].include? "grpc" - end - - ::Google::Cloud::ResourceManager::V3::Organizations::Rest::ServiceStub.stub :transcode_get_iam_policy_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, get_iam_policy_client_stub do - # Create client - client = ::Google::Cloud::ResourceManager::V3::Organizations::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - client.get_iam_policy({ resource: resource, options: options }) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use named arguments - client.get_iam_policy resource: resource, options: options do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object - client.get_iam_policy ::Google::Iam::V1::GetIamPolicyRequest.new(resource: resource, options: options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use hash object with options - client.get_iam_policy({ resource: resource, options: options }, call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object with options - client.get_iam_policy(::Google::Iam::V1::GetIamPolicyRequest.new(resource: resource, options: options), call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Verify method calls - assert_equal 5, get_iam_policy_client_stub.call_count - end - end - end - - def test_set_iam_policy - # Create test objects. - client_result = ::Google::Iam::V1::Policy.new - http_response = OpenStruct.new body: client_result.to_json - - call_options = {} - - # Create request parameters for a unary method. - resource = "hello world" - policy = {} - update_mask = {} - - set_iam_policy_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| - assert options.metadata.key? :"x-goog-api-client" - assert options.metadata[:"x-goog-api-client"].include? "rest" - refute options.metadata[:"x-goog-api-client"].include? "grpc" - end - - ::Google::Cloud::ResourceManager::V3::Organizations::Rest::ServiceStub.stub :transcode_set_iam_policy_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, set_iam_policy_client_stub do - # Create client - client = ::Google::Cloud::ResourceManager::V3::Organizations::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - client.set_iam_policy({ resource: resource, policy: policy, update_mask: update_mask }) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use named arguments - client.set_iam_policy resource: resource, policy: policy, update_mask: update_mask do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object - client.set_iam_policy ::Google::Iam::V1::SetIamPolicyRequest.new(resource: resource, policy: policy, update_mask: update_mask) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use hash object with options - client.set_iam_policy({ resource: resource, policy: policy, update_mask: update_mask }, call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object with options - client.set_iam_policy(::Google::Iam::V1::SetIamPolicyRequest.new(resource: resource, policy: policy, update_mask: update_mask), call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Verify method calls - assert_equal 5, set_iam_policy_client_stub.call_count - end - end - end - - def test_test_iam_permissions - # Create test objects. - client_result = ::Google::Iam::V1::TestIamPermissionsResponse.new - http_response = OpenStruct.new body: client_result.to_json - - call_options = {} - - # Create request parameters for a unary method. - resource = "hello world" - permissions = ["hello world"] - - test_iam_permissions_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| - assert options.metadata.key? :"x-goog-api-client" - assert options.metadata[:"x-goog-api-client"].include? "rest" - refute options.metadata[:"x-goog-api-client"].include? "grpc" - end - - ::Google::Cloud::ResourceManager::V3::Organizations::Rest::ServiceStub.stub :transcode_test_iam_permissions_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, test_iam_permissions_client_stub do - # Create client - client = ::Google::Cloud::ResourceManager::V3::Organizations::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - client.test_iam_permissions({ resource: resource, permissions: permissions }) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use named arguments - client.test_iam_permissions resource: resource, permissions: permissions do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object - client.test_iam_permissions ::Google::Iam::V1::TestIamPermissionsRequest.new(resource: resource, permissions: permissions) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use hash object with options - client.test_iam_permissions({ resource: resource, permissions: permissions }, call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object with options - client.test_iam_permissions(::Google::Iam::V1::TestIamPermissionsRequest.new(resource: resource, permissions: permissions), call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Verify method calls - assert_equal 5, test_iam_permissions_client_stub.call_count - end - end - end - - def test_configure - credentials_token = :dummy_value - - client = block_config = config = nil - dummy_stub = ClientStub.new nil - Gapic::Rest::ClientStub.stub :new, dummy_stub do - client = ::Google::Cloud::ResourceManager::V3::Organizations::Rest::Client.new do |config| - config.credentials = credentials_token - end - end - - config = client.configure do |c| - block_config = c - end - - assert_same block_config, config - assert_kind_of ::Google::Cloud::ResourceManager::V3::Organizations::Rest::Client::Configuration, config - end -end diff --git a/owl-bot-staging/google-cloud-resource_manager-v3/test/google/cloud/resource_manager/v3/organizations_test.rb b/owl-bot-staging/google-cloud-resource_manager-v3/test/google/cloud/resource_manager/v3/organizations_test.rb deleted file mode 100644 index 347358f430a8..000000000000 --- a/owl-bot-staging/google-cloud-resource_manager-v3/test/google/cloud/resource_manager/v3/organizations_test.rb +++ /dev/null @@ -1,411 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -require "helper" - -require "gapic/grpc/service_stub" - -require "google/cloud/resourcemanager/v3/organizations_pb" -require "google/cloud/resource_manager/v3/organizations" - -class ::Google::Cloud::ResourceManager::V3::Organizations::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_get_organization - # Create GRPC objects. - grpc_response = ::Google::Cloud::ResourceManager::V3::Organization.new - grpc_operation = GRPC::ActiveCall::Operation.new nil - grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - grpc_options = {} - - # Create request parameters for a unary method. - name = "hello world" - - get_organization_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :get_organization, name - assert_kind_of ::Google::Cloud::ResourceManager::V3::GetOrganizationRequest, request - assert_equal "hello world", request["name"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, get_organization_client_stub do - # Create client - client = ::Google::Cloud::ResourceManager::V3::Organizations::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.get_organization({ name: name }) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use named arguments - client.get_organization name: name do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object - client.get_organization ::Google::Cloud::ResourceManager::V3::GetOrganizationRequest.new(name: name) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use hash object with options - client.get_organization({ name: name }, grpc_options) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object with options - client.get_organization(::Google::Cloud::ResourceManager::V3::GetOrganizationRequest.new(name: name), grpc_options) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Verify method calls - assert_equal 5, get_organization_client_stub.call_rpc_count - end - end - - def test_search_organizations - # Create GRPC objects. - grpc_response = ::Google::Cloud::ResourceManager::V3::SearchOrganizationsResponse.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. - page_size = 42 - page_token = "hello world" - query = "hello world" - - search_organizations_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :search_organizations, name - assert_kind_of ::Google::Cloud::ResourceManager::V3::SearchOrganizationsRequest, request - assert_equal 42, request["page_size"] - assert_equal "hello world", request["page_token"] - assert_equal "hello world", request["query"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, search_organizations_client_stub do - # Create client - client = ::Google::Cloud::ResourceManager::V3::Organizations::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.search_organizations({ page_size: page_size, page_token: page_token, query: query }) 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_organizations page_size: page_size, page_token: page_token, query: query 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_organizations ::Google::Cloud::ResourceManager::V3::SearchOrganizationsRequest.new(page_size: page_size, page_token: page_token, query: query) 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_organizations({ page_size: page_size, page_token: page_token, query: query }, 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_organizations(::Google::Cloud::ResourceManager::V3::SearchOrganizationsRequest.new(page_size: page_size, page_token: page_token, query: query), 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_organizations_client_stub.call_rpc_count - end - end - - def test_get_iam_policy - # Create GRPC objects. - grpc_response = ::Google::Iam::V1::Policy.new - grpc_operation = GRPC::ActiveCall::Operation.new nil - grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - grpc_options = {} - - # Create request parameters for a unary method. - resource = "hello world" - options = {} - - get_iam_policy_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :get_iam_policy, name - assert_kind_of ::Google::Iam::V1::GetIamPolicyRequest, request - assert_equal "hello world", request["resource"] - assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Iam::V1::GetPolicyOptions), request["options"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, get_iam_policy_client_stub do - # Create client - client = ::Google::Cloud::ResourceManager::V3::Organizations::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.get_iam_policy({ resource: resource, options: options }) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use named arguments - client.get_iam_policy resource: resource, options: options do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object - client.get_iam_policy ::Google::Iam::V1::GetIamPolicyRequest.new(resource: resource, options: options) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use hash object with options - client.get_iam_policy({ resource: resource, options: options }, grpc_options) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object with options - client.get_iam_policy(::Google::Iam::V1::GetIamPolicyRequest.new(resource: resource, options: options), grpc_options) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Verify method calls - assert_equal 5, get_iam_policy_client_stub.call_rpc_count - end - end - - def test_set_iam_policy - # Create GRPC objects. - grpc_response = ::Google::Iam::V1::Policy.new - grpc_operation = GRPC::ActiveCall::Operation.new nil - grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - grpc_options = {} - - # Create request parameters for a unary method. - resource = "hello world" - policy = {} - update_mask = {} - - set_iam_policy_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :set_iam_policy, name - assert_kind_of ::Google::Iam::V1::SetIamPolicyRequest, request - assert_equal "hello world", request["resource"] - assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Iam::V1::Policy), request["policy"] - assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Protobuf::FieldMask), request["update_mask"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, set_iam_policy_client_stub do - # Create client - client = ::Google::Cloud::ResourceManager::V3::Organizations::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.set_iam_policy({ resource: resource, policy: policy, update_mask: update_mask }) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use named arguments - client.set_iam_policy resource: resource, policy: policy, update_mask: update_mask do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object - client.set_iam_policy ::Google::Iam::V1::SetIamPolicyRequest.new(resource: resource, policy: policy, update_mask: update_mask) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use hash object with options - client.set_iam_policy({ resource: resource, policy: policy, update_mask: update_mask }, grpc_options) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object with options - client.set_iam_policy(::Google::Iam::V1::SetIamPolicyRequest.new(resource: resource, policy: policy, update_mask: update_mask), grpc_options) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Verify method calls - assert_equal 5, set_iam_policy_client_stub.call_rpc_count - end - end - - def test_test_iam_permissions - # Create GRPC objects. - grpc_response = ::Google::Iam::V1::TestIamPermissionsResponse.new - grpc_operation = GRPC::ActiveCall::Operation.new nil - grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - grpc_options = {} - - # Create request parameters for a unary method. - resource = "hello world" - permissions = ["hello world"] - - test_iam_permissions_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :test_iam_permissions, name - assert_kind_of ::Google::Iam::V1::TestIamPermissionsRequest, request - assert_equal "hello world", request["resource"] - assert_equal ["hello world"], request["permissions"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, test_iam_permissions_client_stub do - # Create client - client = ::Google::Cloud::ResourceManager::V3::Organizations::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.test_iam_permissions({ resource: resource, permissions: permissions }) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use named arguments - client.test_iam_permissions resource: resource, permissions: permissions do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object - client.test_iam_permissions ::Google::Iam::V1::TestIamPermissionsRequest.new(resource: resource, permissions: permissions) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use hash object with options - client.test_iam_permissions({ resource: resource, permissions: permissions }, grpc_options) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object with options - client.test_iam_permissions(::Google::Iam::V1::TestIamPermissionsRequest.new(resource: resource, permissions: permissions), grpc_options) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Verify method calls - assert_equal 5, test_iam_permissions_client_stub.call_rpc_count - end - end - - def test_configure - grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - - client = block_config = config = nil - dummy_stub = ClientStub.new nil, nil - Gapic::ServiceStub.stub :new, dummy_stub do - client = ::Google::Cloud::ResourceManager::V3::Organizations::Client.new do |config| - config.credentials = grpc_channel - end - end - - config = client.configure do |c| - block_config = c - end - - assert_same block_config, config - assert_kind_of ::Google::Cloud::ResourceManager::V3::Organizations::Client::Configuration, config - end - - def test_credentials - key = OpenSSL::PKey::RSA.new 2048 - cred_json = { - "private_key" => key.to_pem, - "client_email" => "app@developer.gserviceaccount.com", - "type" => "service_account" - } - key_file = StringIO.new cred_json.to_json - creds = Google::Auth::ServiceAccountCredentials.make_creds({ json_key_io: key_file }) - - dummy_stub = ClientStub.new nil, nil - Gapic::ServiceStub.stub :new, dummy_stub do - client = ::Google::Cloud::ResourceManager::V3::Organizations::Client.new do |config| - config.credentials = creds - end - assert_kind_of ::Google::Cloud::ResourceManager::V3::Organizations::Client, client - assert_equal creds, client.configure.credentials - end - end -end diff --git a/owl-bot-staging/google-cloud-resource_manager-v3/test/google/cloud/resource_manager/v3/projects_operations_test.rb b/owl-bot-staging/google-cloud-resource_manager-v3/test/google/cloud/resource_manager/v3/projects_operations_test.rb deleted file mode 100644 index 6e716395fcc5..000000000000 --- a/owl-bot-staging/google-cloud-resource_manager-v3/test/google/cloud/resource_manager/v3/projects_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/cloud/resourcemanager/v3/projects_pb" -require "google/cloud/resourcemanager/v3/projects_services_pb" -require "google/cloud/resource_manager/v3/projects" - -class ::Google::Cloud::ResourceManager::V3::Projects::OperationsTest < Minitest::Test - class ClientStub - attr_accessor :call_rpc_count, :requests - - def initialize response, operation, &block - @response = response - @operation = operation - @block = block - @call_rpc_count = 0 - @requests = [] - end - - def call_rpc *args, **kwargs - @call_rpc_count += 1 - - @requests << @block&.call(*args, **kwargs) - - catch :response do - yield @response, @operation if block_given? - @response - end - end - - def endpoint - "endpoint.example.com" - end - - def universe_domain - "example.com" - end - - def stub_logger - nil - end - - def logger - nil - end - end - - def test_list_operations - # Create GRPC objects. - grpc_response = ::Google::Longrunning::ListOperationsResponse.new - grpc_operation = GRPC::ActiveCall::Operation.new nil - grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - grpc_options = {} - - # Create request parameters for a unary method. - name = "hello world" - filter = "hello world" - page_size = 42 - page_token = "hello world" - return_partial_success = true - - list_operations_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :list_operations, name - assert_kind_of ::Google::Longrunning::ListOperationsRequest, request - assert_equal "hello world", request["name"] - assert_equal "hello world", request["filter"] - assert_equal 42, request["page_size"] - assert_equal "hello world", request["page_token"] - assert_equal true, request["return_partial_success"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, list_operations_client_stub do - # Create client - client = ::Google::Cloud::ResourceManager::V3::Projects::Operations.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.list_operations({ name: name, filter: filter, page_size: page_size, page_token: page_token, return_partial_success: return_partial_success }) do |response, operation| - assert_kind_of Gapic::PagedEnumerable, response - assert_equal grpc_response, response.response - assert_equal grpc_operation, operation - end - - # Use named arguments - client.list_operations name: name, filter: filter, page_size: page_size, page_token: page_token, return_partial_success: return_partial_success do |response, operation| - assert_kind_of Gapic::PagedEnumerable, response - assert_equal grpc_response, response.response - assert_equal grpc_operation, operation - end - - # Use protobuf object - client.list_operations ::Google::Longrunning::ListOperationsRequest.new(name: name, filter: filter, page_size: page_size, page_token: page_token, return_partial_success: return_partial_success) do |response, operation| - assert_kind_of Gapic::PagedEnumerable, response - assert_equal grpc_response, response.response - assert_equal grpc_operation, operation - end - - # Use hash object with options - client.list_operations({ name: name, filter: filter, page_size: page_size, page_token: page_token, return_partial_success: return_partial_success }, grpc_options) do |response, operation| - assert_kind_of Gapic::PagedEnumerable, response - assert_equal grpc_response, response.response - assert_equal grpc_operation, operation - end - - # Use protobuf object with options - client.list_operations(::Google::Longrunning::ListOperationsRequest.new(name: name, filter: filter, page_size: page_size, page_token: page_token, return_partial_success: return_partial_success), grpc_options) do |response, operation| - assert_kind_of Gapic::PagedEnumerable, response - assert_equal grpc_response, response.response - assert_equal grpc_operation, operation - end - - # Verify method calls - assert_equal 5, list_operations_client_stub.call_rpc_count - end - end - - def test_get_operation - # Create GRPC objects. - grpc_response = ::Google::Longrunning::Operation.new - grpc_operation = GRPC::ActiveCall::Operation.new nil - grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - grpc_options = {} - - # Create request parameters for a unary method. - name = "hello world" - - get_operation_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :get_operation, name - assert_kind_of ::Google::Longrunning::GetOperationRequest, request - assert_equal "hello world", request["name"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, get_operation_client_stub do - # Create client - client = ::Google::Cloud::ResourceManager::V3::Projects::Operations.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.get_operation({ name: name }) do |response, operation| - assert_kind_of Gapic::Operation, response - assert_equal grpc_response, response.grpc_op - assert_equal grpc_operation, operation - end - - # Use named arguments - client.get_operation name: name do |response, operation| - assert_kind_of Gapic::Operation, response - assert_equal grpc_response, response.grpc_op - assert_equal grpc_operation, operation - end - - # Use protobuf object - client.get_operation ::Google::Longrunning::GetOperationRequest.new(name: name) do |response, operation| - assert_kind_of Gapic::Operation, response - assert_equal grpc_response, response.grpc_op - assert_equal grpc_operation, operation - end - - # Use hash object with options - client.get_operation({ name: name }, grpc_options) do |response, operation| - assert_kind_of Gapic::Operation, response - assert_equal grpc_response, response.grpc_op - assert_equal grpc_operation, operation - end - - # Use protobuf object with options - client.get_operation(::Google::Longrunning::GetOperationRequest.new(name: name), grpc_options) do |response, operation| - assert_kind_of Gapic::Operation, response - assert_equal grpc_response, response.grpc_op - assert_equal grpc_operation, operation - end - - # Verify method calls - assert_equal 5, get_operation_client_stub.call_rpc_count - end - end - - def test_delete_operation - # Create GRPC objects. - grpc_response = ::Google::Protobuf::Empty.new - grpc_operation = GRPC::ActiveCall::Operation.new nil - grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - grpc_options = {} - - # Create request parameters for a unary method. - name = "hello world" - - delete_operation_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :delete_operation, name - assert_kind_of ::Google::Longrunning::DeleteOperationRequest, request - assert_equal "hello world", request["name"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, delete_operation_client_stub do - # Create client - client = ::Google::Cloud::ResourceManager::V3::Projects::Operations.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.delete_operation({ name: name }) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use named arguments - client.delete_operation name: name do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object - client.delete_operation ::Google::Longrunning::DeleteOperationRequest.new(name: name) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use hash object with options - client.delete_operation({ name: name }, grpc_options) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object with options - client.delete_operation(::Google::Longrunning::DeleteOperationRequest.new(name: name), grpc_options) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Verify method calls - assert_equal 5, delete_operation_client_stub.call_rpc_count - end - end - - def test_cancel_operation - # Create GRPC objects. - grpc_response = ::Google::Protobuf::Empty.new - grpc_operation = GRPC::ActiveCall::Operation.new nil - grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - grpc_options = {} - - # Create request parameters for a unary method. - name = "hello world" - - cancel_operation_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :cancel_operation, name - assert_kind_of ::Google::Longrunning::CancelOperationRequest, request - assert_equal "hello world", request["name"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, cancel_operation_client_stub do - # Create client - client = ::Google::Cloud::ResourceManager::V3::Projects::Operations.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.cancel_operation({ name: name }) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use named arguments - client.cancel_operation name: name do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object - client.cancel_operation ::Google::Longrunning::CancelOperationRequest.new(name: name) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use hash object with options - client.cancel_operation({ name: name }, grpc_options) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object with options - client.cancel_operation(::Google::Longrunning::CancelOperationRequest.new(name: name), grpc_options) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Verify method calls - assert_equal 5, cancel_operation_client_stub.call_rpc_count - end - end - - def test_wait_operation - # Create GRPC objects. - grpc_response = ::Google::Longrunning::Operation.new - grpc_operation = GRPC::ActiveCall::Operation.new nil - grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - grpc_options = {} - - # Create request parameters for a unary method. - name = "hello world" - timeout = {} - - wait_operation_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :wait_operation, name - assert_kind_of ::Google::Longrunning::WaitOperationRequest, request - assert_equal "hello world", request["name"] - assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Protobuf::Duration), request["timeout"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, wait_operation_client_stub do - # Create client - client = ::Google::Cloud::ResourceManager::V3::Projects::Operations.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.wait_operation({ name: name, timeout: timeout }) do |response, operation| - assert_kind_of Gapic::Operation, response - assert_equal grpc_response, response.grpc_op - assert_equal grpc_operation, operation - end - - # Use named arguments - client.wait_operation name: name, timeout: timeout do |response, operation| - assert_kind_of Gapic::Operation, response - assert_equal grpc_response, response.grpc_op - assert_equal grpc_operation, operation - end - - # Use protobuf object - client.wait_operation ::Google::Longrunning::WaitOperationRequest.new(name: name, timeout: timeout) do |response, operation| - assert_kind_of Gapic::Operation, response - assert_equal grpc_response, response.grpc_op - assert_equal grpc_operation, operation - end - - # Use hash object with options - client.wait_operation({ name: name, timeout: timeout }, grpc_options) do |response, operation| - assert_kind_of Gapic::Operation, response - assert_equal grpc_response, response.grpc_op - assert_equal grpc_operation, operation - end - - # Use protobuf object with options - client.wait_operation(::Google::Longrunning::WaitOperationRequest.new(name: name, timeout: timeout), grpc_options) do |response, operation| - assert_kind_of Gapic::Operation, response - assert_equal grpc_response, response.grpc_op - assert_equal grpc_operation, operation - end - - # Verify method calls - assert_equal 5, wait_operation_client_stub.call_rpc_count - end - end - - def test_configure - grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - - client = block_config = config = nil - dummy_stub = ClientStub.new nil, nil - Gapic::ServiceStub.stub :new, dummy_stub do - client = ::Google::Cloud::ResourceManager::V3::Projects::Operations.new do |config| - config.credentials = grpc_channel - end - end - - config = client.configure do |c| - block_config = c - end - - assert_same block_config, config - assert_kind_of ::Google::Cloud::ResourceManager::V3::Projects::Operations::Configuration, config - end -end diff --git a/owl-bot-staging/google-cloud-resource_manager-v3/test/google/cloud/resource_manager/v3/projects_paths_test.rb b/owl-bot-staging/google-cloud-resource_manager-v3/test/google/cloud/resource_manager/v3/projects_paths_test.rb deleted file mode 100644 index d7a8eddcea5c..000000000000 --- a/owl-bot-staging/google-cloud-resource_manager-v3/test/google/cloud/resource_manager/v3/projects_paths_test.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 "helper" - -require "gapic/grpc/service_stub" - -require "google/cloud/resource_manager/v3/projects" - -class ::Google::Cloud::ResourceManager::V3::Projects::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_project_path - grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - ::Gapic::ServiceStub.stub :new, DummyStub.new do - client = ::Google::Cloud::ResourceManager::V3::Projects::Client.new do |config| - config.credentials = grpc_channel - end - - path = client.project_path project: "value0" - assert_equal "projects/value0", path - end - end -end diff --git a/owl-bot-staging/google-cloud-resource_manager-v3/test/google/cloud/resource_manager/v3/projects_rest_test.rb b/owl-bot-staging/google-cloud-resource_manager-v3/test/google/cloud/resource_manager/v3/projects_rest_test.rb deleted file mode 100644 index 71932681beca..000000000000 --- a/owl-bot-staging/google-cloud-resource_manager-v3/test/google/cloud/resource_manager/v3/projects_rest_test.rb +++ /dev/null @@ -1,704 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -require "helper" -require "gapic/rest" -require "google/cloud/resourcemanager/v3/projects_pb" -require "google/cloud/resource_manager/v3/projects/rest" - - -class ::Google::Cloud::ResourceManager::V3::Projects::Rest::ClientTest < Minitest::Test - class ClientStub - attr_accessor :call_count, :requests - - def initialize response, &block - @response = response - @block = block - @call_count = 0 - @requests = [] - end - - def make_get_request uri:, params: {}, options: {}, method_name: nil - make_http_request :get, uri: uri, body: nil, params: params, options: options, method_name: method_name - end - - def make_delete_request uri:, params: {}, options: {}, method_name: nil - make_http_request :delete, uri: uri, body: nil, params: params, options: options, method_name: method_name - end - - def make_post_request uri:, body: nil, params: {}, options: {}, method_name: nil - make_http_request :post, uri: uri, body: body, params: params, options: options, method_name: method_name - end - - def make_patch_request uri:, body:, params: {}, options: {}, method_name: nil - make_http_request :patch, uri: uri, body: body, params: params, options: options, method_name: method_name - end - - def make_put_request uri:, body:, params: {}, options: {}, method_name: nil - make_http_request :put, uri: uri, body: body, params: params, options: options, method_name: method_name - end - - def make_http_request *args, **kwargs - @call_count += 1 - - @requests << @block&.call(*args, **kwargs) - - @response - end - - def endpoint - "endpoint.example.com" - end - - def universe_domain - "example.com" - end - - def stub_logger - nil - end - - def logger - nil - end - end - - def test_get_project - # Create test objects. - client_result = ::Google::Cloud::ResourceManager::V3::Project.new - http_response = OpenStruct.new body: client_result.to_json - - call_options = {} - - # Create request parameters for a unary method. - name = "hello world" - - get_project_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| - assert options.metadata.key? :"x-goog-api-client" - assert options.metadata[:"x-goog-api-client"].include? "rest" - refute options.metadata[:"x-goog-api-client"].include? "grpc" - end - - ::Google::Cloud::ResourceManager::V3::Projects::Rest::ServiceStub.stub :transcode_get_project_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, get_project_client_stub do - # Create client - client = ::Google::Cloud::ResourceManager::V3::Projects::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - client.get_project({ name: name }) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use named arguments - client.get_project name: name do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object - client.get_project ::Google::Cloud::ResourceManager::V3::GetProjectRequest.new(name: name) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use hash object with options - client.get_project({ name: name }, call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object with options - client.get_project(::Google::Cloud::ResourceManager::V3::GetProjectRequest.new(name: name), call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Verify method calls - assert_equal 5, get_project_client_stub.call_count - end - end - end - - def test_list_projects - # Create test objects. - client_result = ::Google::Cloud::ResourceManager::V3::ListProjectsResponse.new - http_response = OpenStruct.new body: client_result.to_json - - call_options = {} - - # Create request parameters for a unary method. - parent = "hello world" - page_token = "hello world" - page_size = 42 - show_deleted = true - - list_projects_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| - assert options.metadata.key? :"x-goog-api-client" - assert options.metadata[:"x-goog-api-client"].include? "rest" - refute options.metadata[:"x-goog-api-client"].include? "grpc" - end - - ::Google::Cloud::ResourceManager::V3::Projects::Rest::ServiceStub.stub :transcode_list_projects_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, list_projects_client_stub do - # Create client - client = ::Google::Cloud::ResourceManager::V3::Projects::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - client.list_projects({ parent: parent, page_token: page_token, page_size: page_size, show_deleted: show_deleted }) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use named arguments - client.list_projects parent: parent, page_token: page_token, page_size: page_size, show_deleted: show_deleted do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object - client.list_projects ::Google::Cloud::ResourceManager::V3::ListProjectsRequest.new(parent: parent, page_token: page_token, page_size: page_size, show_deleted: show_deleted) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use hash object with options - client.list_projects({ parent: parent, page_token: page_token, page_size: page_size, show_deleted: show_deleted }, call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object with options - client.list_projects(::Google::Cloud::ResourceManager::V3::ListProjectsRequest.new(parent: parent, page_token: page_token, page_size: page_size, show_deleted: show_deleted), call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Verify method calls - assert_equal 5, list_projects_client_stub.call_count - end - end - end - - def test_search_projects - # Create test objects. - client_result = ::Google::Cloud::ResourceManager::V3::SearchProjectsResponse.new - http_response = OpenStruct.new body: client_result.to_json - - call_options = {} - - # Create request parameters for a unary method. - query = "hello world" - page_token = "hello world" - page_size = 42 - - search_projects_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| - assert options.metadata.key? :"x-goog-api-client" - assert options.metadata[:"x-goog-api-client"].include? "rest" - refute options.metadata[:"x-goog-api-client"].include? "grpc" - end - - ::Google::Cloud::ResourceManager::V3::Projects::Rest::ServiceStub.stub :transcode_search_projects_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, search_projects_client_stub do - # Create client - client = ::Google::Cloud::ResourceManager::V3::Projects::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - client.search_projects({ query: query, page_token: page_token, page_size: page_size }) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use named arguments - client.search_projects query: query, page_token: page_token, page_size: page_size do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object - client.search_projects ::Google::Cloud::ResourceManager::V3::SearchProjectsRequest.new(query: query, page_token: page_token, page_size: page_size) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use hash object with options - client.search_projects({ query: query, page_token: page_token, page_size: page_size }, call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object with options - client.search_projects(::Google::Cloud::ResourceManager::V3::SearchProjectsRequest.new(query: query, page_token: page_token, page_size: page_size), call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Verify method calls - assert_equal 5, search_projects_client_stub.call_count - end - end - end - - def test_create_project - # 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. - project = {} - - create_project_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| - assert options.metadata.key? :"x-goog-api-client" - assert options.metadata[:"x-goog-api-client"].include? "rest" - refute options.metadata[:"x-goog-api-client"].include? "grpc" - end - - ::Google::Cloud::ResourceManager::V3::Projects::Rest::ServiceStub.stub :transcode_create_project_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, create_project_client_stub do - # Create client - client = ::Google::Cloud::ResourceManager::V3::Projects::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - client.create_project({ project: project }) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use named arguments - client.create_project project: project do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object - client.create_project ::Google::Cloud::ResourceManager::V3::CreateProjectRequest.new(project: project) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use hash object with options - client.create_project({ project: project }, call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object with options - client.create_project(::Google::Cloud::ResourceManager::V3::CreateProjectRequest.new(project: project), call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Verify method calls - assert_equal 5, create_project_client_stub.call_count - end - end - end - - def test_update_project - # 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. - project = {} - update_mask = {} - - update_project_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| - assert options.metadata.key? :"x-goog-api-client" - assert options.metadata[:"x-goog-api-client"].include? "rest" - refute options.metadata[:"x-goog-api-client"].include? "grpc" - end - - ::Google::Cloud::ResourceManager::V3::Projects::Rest::ServiceStub.stub :transcode_update_project_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, update_project_client_stub do - # Create client - client = ::Google::Cloud::ResourceManager::V3::Projects::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - client.update_project({ project: project, update_mask: update_mask }) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use named arguments - client.update_project project: project, update_mask: update_mask do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object - client.update_project ::Google::Cloud::ResourceManager::V3::UpdateProjectRequest.new(project: project, update_mask: update_mask) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use hash object with options - client.update_project({ project: project, update_mask: update_mask }, call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object with options - client.update_project(::Google::Cloud::ResourceManager::V3::UpdateProjectRequest.new(project: project, update_mask: update_mask), call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Verify method calls - assert_equal 5, update_project_client_stub.call_count - end - end - end - - def test_move_project - # 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" - destination_parent = "hello world" - - move_project_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| - assert options.metadata.key? :"x-goog-api-client" - assert options.metadata[:"x-goog-api-client"].include? "rest" - refute options.metadata[:"x-goog-api-client"].include? "grpc" - end - - ::Google::Cloud::ResourceManager::V3::Projects::Rest::ServiceStub.stub :transcode_move_project_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, move_project_client_stub do - # Create client - client = ::Google::Cloud::ResourceManager::V3::Projects::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - client.move_project({ name: name, destination_parent: destination_parent }) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use named arguments - client.move_project name: name, destination_parent: destination_parent do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object - client.move_project ::Google::Cloud::ResourceManager::V3::MoveProjectRequest.new(name: name, destination_parent: destination_parent) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use hash object with options - client.move_project({ name: name, destination_parent: destination_parent }, call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object with options - client.move_project(::Google::Cloud::ResourceManager::V3::MoveProjectRequest.new(name: name, destination_parent: destination_parent), call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Verify method calls - assert_equal 5, move_project_client_stub.call_count - end - end - end - - def test_delete_project - # 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" - - delete_project_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| - assert options.metadata.key? :"x-goog-api-client" - assert options.metadata[:"x-goog-api-client"].include? "rest" - refute options.metadata[:"x-goog-api-client"].include? "grpc" - end - - ::Google::Cloud::ResourceManager::V3::Projects::Rest::ServiceStub.stub :transcode_delete_project_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, delete_project_client_stub do - # Create client - client = ::Google::Cloud::ResourceManager::V3::Projects::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - client.delete_project({ name: name }) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use named arguments - client.delete_project name: name do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object - client.delete_project ::Google::Cloud::ResourceManager::V3::DeleteProjectRequest.new(name: name) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use hash object with options - client.delete_project({ name: name }, call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object with options - client.delete_project(::Google::Cloud::ResourceManager::V3::DeleteProjectRequest.new(name: name), call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Verify method calls - assert_equal 5, delete_project_client_stub.call_count - end - end - end - - def test_undelete_project - # 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" - - undelete_project_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| - assert options.metadata.key? :"x-goog-api-client" - assert options.metadata[:"x-goog-api-client"].include? "rest" - refute options.metadata[:"x-goog-api-client"].include? "grpc" - end - - ::Google::Cloud::ResourceManager::V3::Projects::Rest::ServiceStub.stub :transcode_undelete_project_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, undelete_project_client_stub do - # Create client - client = ::Google::Cloud::ResourceManager::V3::Projects::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - client.undelete_project({ name: name }) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use named arguments - client.undelete_project name: name do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object - client.undelete_project ::Google::Cloud::ResourceManager::V3::UndeleteProjectRequest.new(name: name) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use hash object with options - client.undelete_project({ name: name }, call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object with options - client.undelete_project(::Google::Cloud::ResourceManager::V3::UndeleteProjectRequest.new(name: name), call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Verify method calls - assert_equal 5, undelete_project_client_stub.call_count - end - end - end - - def test_get_iam_policy - # Create test objects. - client_result = ::Google::Iam::V1::Policy.new - http_response = OpenStruct.new body: client_result.to_json - - call_options = {} - - # Create request parameters for a unary method. - resource = "hello world" - options = {} - - get_iam_policy_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| - assert options.metadata.key? :"x-goog-api-client" - assert options.metadata[:"x-goog-api-client"].include? "rest" - refute options.metadata[:"x-goog-api-client"].include? "grpc" - end - - ::Google::Cloud::ResourceManager::V3::Projects::Rest::ServiceStub.stub :transcode_get_iam_policy_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, get_iam_policy_client_stub do - # Create client - client = ::Google::Cloud::ResourceManager::V3::Projects::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - client.get_iam_policy({ resource: resource, options: options }) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use named arguments - client.get_iam_policy resource: resource, options: options do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object - client.get_iam_policy ::Google::Iam::V1::GetIamPolicyRequest.new(resource: resource, options: options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use hash object with options - client.get_iam_policy({ resource: resource, options: options }, call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object with options - client.get_iam_policy(::Google::Iam::V1::GetIamPolicyRequest.new(resource: resource, options: options), call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Verify method calls - assert_equal 5, get_iam_policy_client_stub.call_count - end - end - end - - def test_set_iam_policy - # Create test objects. - client_result = ::Google::Iam::V1::Policy.new - http_response = OpenStruct.new body: client_result.to_json - - call_options = {} - - # Create request parameters for a unary method. - resource = "hello world" - policy = {} - update_mask = {} - - set_iam_policy_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| - assert options.metadata.key? :"x-goog-api-client" - assert options.metadata[:"x-goog-api-client"].include? "rest" - refute options.metadata[:"x-goog-api-client"].include? "grpc" - end - - ::Google::Cloud::ResourceManager::V3::Projects::Rest::ServiceStub.stub :transcode_set_iam_policy_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, set_iam_policy_client_stub do - # Create client - client = ::Google::Cloud::ResourceManager::V3::Projects::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - client.set_iam_policy({ resource: resource, policy: policy, update_mask: update_mask }) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use named arguments - client.set_iam_policy resource: resource, policy: policy, update_mask: update_mask do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object - client.set_iam_policy ::Google::Iam::V1::SetIamPolicyRequest.new(resource: resource, policy: policy, update_mask: update_mask) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use hash object with options - client.set_iam_policy({ resource: resource, policy: policy, update_mask: update_mask }, call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object with options - client.set_iam_policy(::Google::Iam::V1::SetIamPolicyRequest.new(resource: resource, policy: policy, update_mask: update_mask), call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Verify method calls - assert_equal 5, set_iam_policy_client_stub.call_count - end - end - end - - def test_test_iam_permissions - # Create test objects. - client_result = ::Google::Iam::V1::TestIamPermissionsResponse.new - http_response = OpenStruct.new body: client_result.to_json - - call_options = {} - - # Create request parameters for a unary method. - resource = "hello world" - permissions = ["hello world"] - - test_iam_permissions_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| - assert options.metadata.key? :"x-goog-api-client" - assert options.metadata[:"x-goog-api-client"].include? "rest" - refute options.metadata[:"x-goog-api-client"].include? "grpc" - end - - ::Google::Cloud::ResourceManager::V3::Projects::Rest::ServiceStub.stub :transcode_test_iam_permissions_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, test_iam_permissions_client_stub do - # Create client - client = ::Google::Cloud::ResourceManager::V3::Projects::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - client.test_iam_permissions({ resource: resource, permissions: permissions }) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use named arguments - client.test_iam_permissions resource: resource, permissions: permissions do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object - client.test_iam_permissions ::Google::Iam::V1::TestIamPermissionsRequest.new(resource: resource, permissions: permissions) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use hash object with options - client.test_iam_permissions({ resource: resource, permissions: permissions }, call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object with options - client.test_iam_permissions(::Google::Iam::V1::TestIamPermissionsRequest.new(resource: resource, permissions: permissions), call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Verify method calls - assert_equal 5, test_iam_permissions_client_stub.call_count - end - end - end - - def test_configure - credentials_token = :dummy_value - - client = block_config = config = nil - dummy_stub = ClientStub.new nil - Gapic::Rest::ClientStub.stub :new, dummy_stub do - client = ::Google::Cloud::ResourceManager::V3::Projects::Rest::Client.new do |config| - config.credentials = credentials_token - end - end - - config = client.configure do |c| - block_config = c - end - - assert_same block_config, config - assert_kind_of ::Google::Cloud::ResourceManager::V3::Projects::Rest::Client::Configuration, config - end -end diff --git a/owl-bot-staging/google-cloud-resource_manager-v3/test/google/cloud/resource_manager/v3/projects_test.rb b/owl-bot-staging/google-cloud-resource_manager-v3/test/google/cloud/resource_manager/v3/projects_test.rb deleted file mode 100644 index 40a0dac92373..000000000000 --- a/owl-bot-staging/google-cloud-resource_manager-v3/test/google/cloud/resource_manager/v3/projects_test.rb +++ /dev/null @@ -1,813 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -require "helper" - -require "gapic/grpc/service_stub" - -require "google/cloud/resourcemanager/v3/projects_pb" -require "google/cloud/resource_manager/v3/projects" - -class ::Google::Cloud::ResourceManager::V3::Projects::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_get_project - # Create GRPC objects. - grpc_response = ::Google::Cloud::ResourceManager::V3::Project.new - grpc_operation = GRPC::ActiveCall::Operation.new nil - grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - grpc_options = {} - - # Create request parameters for a unary method. - name = "hello world" - - get_project_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :get_project, name - assert_kind_of ::Google::Cloud::ResourceManager::V3::GetProjectRequest, request - assert_equal "hello world", request["name"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, get_project_client_stub do - # Create client - client = ::Google::Cloud::ResourceManager::V3::Projects::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.get_project({ name: name }) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use named arguments - client.get_project name: name do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object - client.get_project ::Google::Cloud::ResourceManager::V3::GetProjectRequest.new(name: name) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use hash object with options - client.get_project({ name: name }, grpc_options) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object with options - client.get_project(::Google::Cloud::ResourceManager::V3::GetProjectRequest.new(name: name), grpc_options) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Verify method calls - assert_equal 5, get_project_client_stub.call_rpc_count - end - end - - def test_list_projects - # Create GRPC objects. - grpc_response = ::Google::Cloud::ResourceManager::V3::ListProjectsResponse.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_token = "hello world" - page_size = 42 - show_deleted = true - - list_projects_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :list_projects, name - assert_kind_of ::Google::Cloud::ResourceManager::V3::ListProjectsRequest, request - assert_equal "hello world", request["parent"] - assert_equal "hello world", request["page_token"] - assert_equal 42, request["page_size"] - assert_equal true, request["show_deleted"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, list_projects_client_stub do - # Create client - client = ::Google::Cloud::ResourceManager::V3::Projects::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.list_projects({ parent: parent, page_token: page_token, page_size: page_size, show_deleted: show_deleted }) 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_projects parent: parent, page_token: page_token, page_size: page_size, show_deleted: show_deleted 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_projects ::Google::Cloud::ResourceManager::V3::ListProjectsRequest.new(parent: parent, page_token: page_token, page_size: page_size, show_deleted: show_deleted) 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_projects({ parent: parent, page_token: page_token, page_size: page_size, show_deleted: show_deleted }, 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_projects(::Google::Cloud::ResourceManager::V3::ListProjectsRequest.new(parent: parent, page_token: page_token, page_size: page_size, show_deleted: show_deleted), 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_projects_client_stub.call_rpc_count - end - end - - def test_search_projects - # Create GRPC objects. - grpc_response = ::Google::Cloud::ResourceManager::V3::SearchProjectsResponse.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. - query = "hello world" - page_token = "hello world" - page_size = 42 - - search_projects_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :search_projects, name - assert_kind_of ::Google::Cloud::ResourceManager::V3::SearchProjectsRequest, request - assert_equal "hello world", request["query"] - assert_equal "hello world", request["page_token"] - assert_equal 42, request["page_size"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, search_projects_client_stub do - # Create client - client = ::Google::Cloud::ResourceManager::V3::Projects::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.search_projects({ query: query, page_token: page_token, page_size: page_size }) 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_projects query: query, page_token: page_token, page_size: page_size 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_projects ::Google::Cloud::ResourceManager::V3::SearchProjectsRequest.new(query: query, page_token: page_token, page_size: page_size) 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_projects({ query: query, page_token: page_token, page_size: page_size }, 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_projects(::Google::Cloud::ResourceManager::V3::SearchProjectsRequest.new(query: query, page_token: page_token, page_size: page_size), 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_projects_client_stub.call_rpc_count - end - end - - def test_create_project - # 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. - project = {} - - create_project_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :create_project, name - assert_kind_of ::Google::Cloud::ResourceManager::V3::CreateProjectRequest, request - assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::ResourceManager::V3::Project), request["project"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, create_project_client_stub do - # Create client - client = ::Google::Cloud::ResourceManager::V3::Projects::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.create_project({ project: project }) 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_project project: project 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_project ::Google::Cloud::ResourceManager::V3::CreateProjectRequest.new(project: project) 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_project({ project: project }, 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_project(::Google::Cloud::ResourceManager::V3::CreateProjectRequest.new(project: project), 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_project_client_stub.call_rpc_count - end - end - - def test_update_project - # 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. - project = {} - update_mask = {} - - update_project_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :update_project, name - assert_kind_of ::Google::Cloud::ResourceManager::V3::UpdateProjectRequest, request - assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::ResourceManager::V3::Project), request["project"] - assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Protobuf::FieldMask), request["update_mask"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, update_project_client_stub do - # Create client - client = ::Google::Cloud::ResourceManager::V3::Projects::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.update_project({ project: project, 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_project project: project, 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_project ::Google::Cloud::ResourceManager::V3::UpdateProjectRequest.new(project: project, 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_project({ project: project, 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_project(::Google::Cloud::ResourceManager::V3::UpdateProjectRequest.new(project: project, 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_project_client_stub.call_rpc_count - end - end - - def test_move_project - # Create GRPC objects. - grpc_response = ::Google::Longrunning::Operation.new - grpc_operation = GRPC::ActiveCall::Operation.new nil - grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - grpc_options = {} - - # Create request parameters for a unary method. - name = "hello world" - destination_parent = "hello world" - - move_project_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :move_project, name - assert_kind_of ::Google::Cloud::ResourceManager::V3::MoveProjectRequest, request - assert_equal "hello world", request["name"] - assert_equal "hello world", request["destination_parent"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, move_project_client_stub do - # Create client - client = ::Google::Cloud::ResourceManager::V3::Projects::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.move_project({ name: name, destination_parent: destination_parent }) 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.move_project name: name, destination_parent: destination_parent 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.move_project ::Google::Cloud::ResourceManager::V3::MoveProjectRequest.new(name: name, destination_parent: destination_parent) 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.move_project({ name: name, destination_parent: destination_parent }, 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.move_project(::Google::Cloud::ResourceManager::V3::MoveProjectRequest.new(name: name, destination_parent: destination_parent), 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, move_project_client_stub.call_rpc_count - end - end - - def test_delete_project - # 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" - - delete_project_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :delete_project, name - assert_kind_of ::Google::Cloud::ResourceManager::V3::DeleteProjectRequest, request - assert_equal "hello world", request["name"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, delete_project_client_stub do - # Create client - client = ::Google::Cloud::ResourceManager::V3::Projects::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.delete_project({ 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.delete_project 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.delete_project ::Google::Cloud::ResourceManager::V3::DeleteProjectRequest.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.delete_project({ 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.delete_project(::Google::Cloud::ResourceManager::V3::DeleteProjectRequest.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, delete_project_client_stub.call_rpc_count - end - end - - def test_undelete_project - # 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" - - undelete_project_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :undelete_project, name - assert_kind_of ::Google::Cloud::ResourceManager::V3::UndeleteProjectRequest, request - assert_equal "hello world", request["name"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, undelete_project_client_stub do - # Create client - client = ::Google::Cloud::ResourceManager::V3::Projects::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.undelete_project({ 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.undelete_project 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.undelete_project ::Google::Cloud::ResourceManager::V3::UndeleteProjectRequest.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.undelete_project({ 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.undelete_project(::Google::Cloud::ResourceManager::V3::UndeleteProjectRequest.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, undelete_project_client_stub.call_rpc_count - end - end - - def test_get_iam_policy - # Create GRPC objects. - grpc_response = ::Google::Iam::V1::Policy.new - grpc_operation = GRPC::ActiveCall::Operation.new nil - grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - grpc_options = {} - - # Create request parameters for a unary method. - resource = "hello world" - options = {} - - get_iam_policy_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :get_iam_policy, name - assert_kind_of ::Google::Iam::V1::GetIamPolicyRequest, request - assert_equal "hello world", request["resource"] - assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Iam::V1::GetPolicyOptions), request["options"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, get_iam_policy_client_stub do - # Create client - client = ::Google::Cloud::ResourceManager::V3::Projects::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.get_iam_policy({ resource: resource, options: options }) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use named arguments - client.get_iam_policy resource: resource, options: options do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object - client.get_iam_policy ::Google::Iam::V1::GetIamPolicyRequest.new(resource: resource, options: options) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use hash object with options - client.get_iam_policy({ resource: resource, options: options }, grpc_options) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object with options - client.get_iam_policy(::Google::Iam::V1::GetIamPolicyRequest.new(resource: resource, options: options), grpc_options) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Verify method calls - assert_equal 5, get_iam_policy_client_stub.call_rpc_count - end - end - - def test_set_iam_policy - # Create GRPC objects. - grpc_response = ::Google::Iam::V1::Policy.new - grpc_operation = GRPC::ActiveCall::Operation.new nil - grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - grpc_options = {} - - # Create request parameters for a unary method. - resource = "hello world" - policy = {} - update_mask = {} - - set_iam_policy_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :set_iam_policy, name - assert_kind_of ::Google::Iam::V1::SetIamPolicyRequest, request - assert_equal "hello world", request["resource"] - assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Iam::V1::Policy), request["policy"] - assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Protobuf::FieldMask), request["update_mask"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, set_iam_policy_client_stub do - # Create client - client = ::Google::Cloud::ResourceManager::V3::Projects::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.set_iam_policy({ resource: resource, policy: policy, update_mask: update_mask }) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use named arguments - client.set_iam_policy resource: resource, policy: policy, update_mask: update_mask do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object - client.set_iam_policy ::Google::Iam::V1::SetIamPolicyRequest.new(resource: resource, policy: policy, update_mask: update_mask) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use hash object with options - client.set_iam_policy({ resource: resource, policy: policy, update_mask: update_mask }, grpc_options) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object with options - client.set_iam_policy(::Google::Iam::V1::SetIamPolicyRequest.new(resource: resource, policy: policy, update_mask: update_mask), grpc_options) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Verify method calls - assert_equal 5, set_iam_policy_client_stub.call_rpc_count - end - end - - def test_test_iam_permissions - # Create GRPC objects. - grpc_response = ::Google::Iam::V1::TestIamPermissionsResponse.new - grpc_operation = GRPC::ActiveCall::Operation.new nil - grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - grpc_options = {} - - # Create request parameters for a unary method. - resource = "hello world" - permissions = ["hello world"] - - test_iam_permissions_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :test_iam_permissions, name - assert_kind_of ::Google::Iam::V1::TestIamPermissionsRequest, request - assert_equal "hello world", request["resource"] - assert_equal ["hello world"], request["permissions"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, test_iam_permissions_client_stub do - # Create client - client = ::Google::Cloud::ResourceManager::V3::Projects::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.test_iam_permissions({ resource: resource, permissions: permissions }) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use named arguments - client.test_iam_permissions resource: resource, permissions: permissions do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object - client.test_iam_permissions ::Google::Iam::V1::TestIamPermissionsRequest.new(resource: resource, permissions: permissions) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use hash object with options - client.test_iam_permissions({ resource: resource, permissions: permissions }, grpc_options) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object with options - client.test_iam_permissions(::Google::Iam::V1::TestIamPermissionsRequest.new(resource: resource, permissions: permissions), grpc_options) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Verify method calls - assert_equal 5, test_iam_permissions_client_stub.call_rpc_count - end - end - - def test_configure - grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - - client = block_config = config = nil - dummy_stub = ClientStub.new nil, nil - Gapic::ServiceStub.stub :new, dummy_stub do - client = ::Google::Cloud::ResourceManager::V3::Projects::Client.new do |config| - config.credentials = grpc_channel - end - end - - config = client.configure do |c| - block_config = c - end - - assert_same block_config, config - assert_kind_of ::Google::Cloud::ResourceManager::V3::Projects::Client::Configuration, config - end - - def test_credentials - key = OpenSSL::PKey::RSA.new 2048 - cred_json = { - "private_key" => key.to_pem, - "client_email" => "app@developer.gserviceaccount.com", - "type" => "service_account" - } - key_file = StringIO.new cred_json.to_json - creds = Google::Auth::ServiceAccountCredentials.make_creds({ json_key_io: key_file }) - - dummy_stub = ClientStub.new nil, nil - Gapic::ServiceStub.stub :new, dummy_stub do - client = ::Google::Cloud::ResourceManager::V3::Projects::Client.new do |config| - config.credentials = creds - end - assert_kind_of ::Google::Cloud::ResourceManager::V3::Projects::Client, client - assert_equal creds, client.configure.credentials - end - end - - def test_operations_client - grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - - client = nil - dummy_stub = ClientStub.new nil, nil - Gapic::ServiceStub.stub :new, dummy_stub do - client = ::Google::Cloud::ResourceManager::V3::Projects::Client.new do |config| - config.credentials = grpc_channel - end - end - - assert_kind_of ::Google::Cloud::ResourceManager::V3::Projects::Operations, client.operations_client - end -end diff --git a/owl-bot-staging/google-cloud-resource_manager-v3/test/google/cloud/resource_manager/v3/tag_bindings_operations_test.rb b/owl-bot-staging/google-cloud-resource_manager-v3/test/google/cloud/resource_manager/v3/tag_bindings_operations_test.rb deleted file mode 100644 index a2626e3b2e5c..000000000000 --- a/owl-bot-staging/google-cloud-resource_manager-v3/test/google/cloud/resource_manager/v3/tag_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/cloud/resourcemanager/v3/tag_bindings_pb" -require "google/cloud/resourcemanager/v3/tag_bindings_services_pb" -require "google/cloud/resource_manager/v3/tag_bindings" - -class ::Google::Cloud::ResourceManager::V3::TagBindings::OperationsTest < Minitest::Test - class ClientStub - attr_accessor :call_rpc_count, :requests - - def initialize response, operation, &block - @response = response - @operation = operation - @block = block - @call_rpc_count = 0 - @requests = [] - end - - def call_rpc *args, **kwargs - @call_rpc_count += 1 - - @requests << @block&.call(*args, **kwargs) - - catch :response do - yield @response, @operation if block_given? - @response - end - end - - def endpoint - "endpoint.example.com" - end - - def universe_domain - "example.com" - end - - def stub_logger - nil - end - - def logger - nil - end - end - - def test_list_operations - # Create GRPC objects. - grpc_response = ::Google::Longrunning::ListOperationsResponse.new - grpc_operation = GRPC::ActiveCall::Operation.new nil - grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - grpc_options = {} - - # Create request parameters for a unary method. - name = "hello world" - filter = "hello world" - page_size = 42 - page_token = "hello world" - return_partial_success = true - - list_operations_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :list_operations, name - assert_kind_of ::Google::Longrunning::ListOperationsRequest, request - assert_equal "hello world", request["name"] - assert_equal "hello world", request["filter"] - assert_equal 42, request["page_size"] - assert_equal "hello world", request["page_token"] - assert_equal true, request["return_partial_success"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, list_operations_client_stub do - # Create client - client = ::Google::Cloud::ResourceManager::V3::TagBindings::Operations.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.list_operations({ name: name, filter: filter, page_size: page_size, page_token: page_token, return_partial_success: return_partial_success }) do |response, operation| - assert_kind_of Gapic::PagedEnumerable, response - assert_equal grpc_response, response.response - assert_equal grpc_operation, operation - end - - # Use named arguments - client.list_operations name: name, filter: filter, page_size: page_size, page_token: page_token, return_partial_success: return_partial_success do |response, operation| - assert_kind_of Gapic::PagedEnumerable, response - assert_equal grpc_response, response.response - assert_equal grpc_operation, operation - end - - # Use protobuf object - client.list_operations ::Google::Longrunning::ListOperationsRequest.new(name: name, filter: filter, page_size: page_size, page_token: page_token, return_partial_success: return_partial_success) do |response, operation| - assert_kind_of Gapic::PagedEnumerable, response - assert_equal grpc_response, response.response - assert_equal grpc_operation, operation - end - - # Use hash object with options - client.list_operations({ name: name, filter: filter, page_size: page_size, page_token: page_token, return_partial_success: return_partial_success }, grpc_options) do |response, operation| - assert_kind_of Gapic::PagedEnumerable, response - assert_equal grpc_response, response.response - assert_equal grpc_operation, operation - end - - # Use protobuf object with options - client.list_operations(::Google::Longrunning::ListOperationsRequest.new(name: name, filter: filter, page_size: page_size, page_token: page_token, return_partial_success: return_partial_success), grpc_options) do |response, operation| - assert_kind_of Gapic::PagedEnumerable, response - assert_equal grpc_response, response.response - assert_equal grpc_operation, operation - end - - # Verify method calls - assert_equal 5, list_operations_client_stub.call_rpc_count - end - end - - def test_get_operation - # Create GRPC objects. - grpc_response = ::Google::Longrunning::Operation.new - grpc_operation = GRPC::ActiveCall::Operation.new nil - grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - grpc_options = {} - - # Create request parameters for a unary method. - name = "hello world" - - get_operation_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :get_operation, name - assert_kind_of ::Google::Longrunning::GetOperationRequest, request - assert_equal "hello world", request["name"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, get_operation_client_stub do - # Create client - client = ::Google::Cloud::ResourceManager::V3::TagBindings::Operations.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.get_operation({ name: name }) do |response, operation| - assert_kind_of Gapic::Operation, response - assert_equal grpc_response, response.grpc_op - assert_equal grpc_operation, operation - end - - # Use named arguments - client.get_operation name: name do |response, operation| - assert_kind_of Gapic::Operation, response - assert_equal grpc_response, response.grpc_op - assert_equal grpc_operation, operation - end - - # Use protobuf object - client.get_operation ::Google::Longrunning::GetOperationRequest.new(name: name) do |response, operation| - assert_kind_of Gapic::Operation, response - assert_equal grpc_response, response.grpc_op - assert_equal grpc_operation, operation - end - - # Use hash object with options - client.get_operation({ name: name }, grpc_options) do |response, operation| - assert_kind_of Gapic::Operation, response - assert_equal grpc_response, response.grpc_op - assert_equal grpc_operation, operation - end - - # Use protobuf object with options - client.get_operation(::Google::Longrunning::GetOperationRequest.new(name: name), grpc_options) do |response, operation| - assert_kind_of Gapic::Operation, response - assert_equal grpc_response, response.grpc_op - assert_equal grpc_operation, operation - end - - # Verify method calls - assert_equal 5, get_operation_client_stub.call_rpc_count - end - end - - def test_delete_operation - # Create GRPC objects. - grpc_response = ::Google::Protobuf::Empty.new - grpc_operation = GRPC::ActiveCall::Operation.new nil - grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - grpc_options = {} - - # Create request parameters for a unary method. - name = "hello world" - - delete_operation_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :delete_operation, name - assert_kind_of ::Google::Longrunning::DeleteOperationRequest, request - assert_equal "hello world", request["name"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, delete_operation_client_stub do - # Create client - client = ::Google::Cloud::ResourceManager::V3::TagBindings::Operations.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.delete_operation({ name: name }) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use named arguments - client.delete_operation name: name do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object - client.delete_operation ::Google::Longrunning::DeleteOperationRequest.new(name: name) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use hash object with options - client.delete_operation({ name: name }, grpc_options) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object with options - client.delete_operation(::Google::Longrunning::DeleteOperationRequest.new(name: name), grpc_options) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Verify method calls - assert_equal 5, delete_operation_client_stub.call_rpc_count - end - end - - def test_cancel_operation - # Create GRPC objects. - grpc_response = ::Google::Protobuf::Empty.new - grpc_operation = GRPC::ActiveCall::Operation.new nil - grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - grpc_options = {} - - # Create request parameters for a unary method. - name = "hello world" - - cancel_operation_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :cancel_operation, name - assert_kind_of ::Google::Longrunning::CancelOperationRequest, request - assert_equal "hello world", request["name"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, cancel_operation_client_stub do - # Create client - client = ::Google::Cloud::ResourceManager::V3::TagBindings::Operations.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.cancel_operation({ name: name }) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use named arguments - client.cancel_operation name: name do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object - client.cancel_operation ::Google::Longrunning::CancelOperationRequest.new(name: name) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use hash object with options - client.cancel_operation({ name: name }, grpc_options) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object with options - client.cancel_operation(::Google::Longrunning::CancelOperationRequest.new(name: name), grpc_options) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Verify method calls - assert_equal 5, cancel_operation_client_stub.call_rpc_count - end - end - - def test_wait_operation - # Create GRPC objects. - grpc_response = ::Google::Longrunning::Operation.new - grpc_operation = GRPC::ActiveCall::Operation.new nil - grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - grpc_options = {} - - # Create request parameters for a unary method. - name = "hello world" - timeout = {} - - wait_operation_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :wait_operation, name - assert_kind_of ::Google::Longrunning::WaitOperationRequest, request - assert_equal "hello world", request["name"] - assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Protobuf::Duration), request["timeout"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, wait_operation_client_stub do - # Create client - client = ::Google::Cloud::ResourceManager::V3::TagBindings::Operations.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.wait_operation({ name: name, timeout: timeout }) do |response, operation| - assert_kind_of Gapic::Operation, response - assert_equal grpc_response, response.grpc_op - assert_equal grpc_operation, operation - end - - # Use named arguments - client.wait_operation name: name, timeout: timeout do |response, operation| - assert_kind_of Gapic::Operation, response - assert_equal grpc_response, response.grpc_op - assert_equal grpc_operation, operation - end - - # Use protobuf object - client.wait_operation ::Google::Longrunning::WaitOperationRequest.new(name: name, timeout: timeout) do |response, operation| - assert_kind_of Gapic::Operation, response - assert_equal grpc_response, response.grpc_op - assert_equal grpc_operation, operation - end - - # Use hash object with options - client.wait_operation({ name: name, timeout: timeout }, grpc_options) do |response, operation| - assert_kind_of Gapic::Operation, response - assert_equal grpc_response, response.grpc_op - assert_equal grpc_operation, operation - end - - # Use protobuf object with options - client.wait_operation(::Google::Longrunning::WaitOperationRequest.new(name: name, timeout: timeout), grpc_options) do |response, operation| - assert_kind_of Gapic::Operation, response - assert_equal grpc_response, response.grpc_op - assert_equal grpc_operation, operation - end - - # Verify method calls - assert_equal 5, wait_operation_client_stub.call_rpc_count - end - end - - def test_configure - grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - - client = block_config = config = nil - dummy_stub = ClientStub.new nil, nil - Gapic::ServiceStub.stub :new, dummy_stub do - client = ::Google::Cloud::ResourceManager::V3::TagBindings::Operations.new do |config| - config.credentials = grpc_channel - end - end - - config = client.configure do |c| - block_config = c - end - - assert_same block_config, config - assert_kind_of ::Google::Cloud::ResourceManager::V3::TagBindings::Operations::Configuration, config - end -end diff --git a/owl-bot-staging/google-cloud-resource_manager-v3/test/google/cloud/resource_manager/v3/tag_bindings_paths_test.rb b/owl-bot-staging/google-cloud-resource_manager-v3/test/google/cloud/resource_manager/v3/tag_bindings_paths_test.rb deleted file mode 100644 index a67fdda9f061..000000000000 --- a/owl-bot-staging/google-cloud-resource_manager-v3/test/google/cloud/resource_manager/v3/tag_bindings_paths_test.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 "helper" - -require "gapic/grpc/service_stub" - -require "google/cloud/resource_manager/v3/tag_bindings" - -class ::Google::Cloud::ResourceManager::V3::TagBindings::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_tag_binding_path - grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - ::Gapic::ServiceStub.stub :new, DummyStub.new do - client = ::Google::Cloud::ResourceManager::V3::TagBindings::Client.new do |config| - config.credentials = grpc_channel - end - - path = client.tag_binding_path tag_binding: "value0" - assert_equal "tagBindings/value0", path - end - end -end diff --git a/owl-bot-staging/google-cloud-resource_manager-v3/test/google/cloud/resource_manager/v3/tag_bindings_rest_test.rb b/owl-bot-staging/google-cloud-resource_manager-v3/test/google/cloud/resource_manager/v3/tag_bindings_rest_test.rb deleted file mode 100644 index 83ca80f81e0f..000000000000 --- a/owl-bot-staging/google-cloud-resource_manager-v3/test/google/cloud/resource_manager/v3/tag_bindings_rest_test.rb +++ /dev/null @@ -1,320 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -require "helper" -require "gapic/rest" -require "google/cloud/resourcemanager/v3/tag_bindings_pb" -require "google/cloud/resource_manager/v3/tag_bindings/rest" - - -class ::Google::Cloud::ResourceManager::V3::TagBindings::Rest::ClientTest < Minitest::Test - class ClientStub - attr_accessor :call_count, :requests - - def initialize response, &block - @response = response - @block = block - @call_count = 0 - @requests = [] - end - - def make_get_request uri:, params: {}, options: {}, method_name: nil - make_http_request :get, uri: uri, body: nil, params: params, options: options, method_name: method_name - end - - def make_delete_request uri:, params: {}, options: {}, method_name: nil - make_http_request :delete, uri: uri, body: nil, params: params, options: options, method_name: method_name - end - - def make_post_request uri:, body: nil, params: {}, options: {}, method_name: nil - make_http_request :post, uri: uri, body: body, params: params, options: options, method_name: method_name - end - - def make_patch_request uri:, body:, params: {}, options: {}, method_name: nil - make_http_request :patch, uri: uri, body: body, params: params, options: options, method_name: method_name - end - - def make_put_request uri:, body:, params: {}, options: {}, method_name: nil - make_http_request :put, uri: uri, body: body, params: params, options: options, method_name: method_name - end - - def make_http_request *args, **kwargs - @call_count += 1 - - @requests << @block&.call(*args, **kwargs) - - @response - end - - def endpoint - "endpoint.example.com" - end - - def universe_domain - "example.com" - end - - def stub_logger - nil - end - - def logger - nil - end - end - - def test_list_tag_bindings - # Create test objects. - client_result = ::Google::Cloud::ResourceManager::V3::ListTagBindingsResponse.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_tag_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::Cloud::ResourceManager::V3::TagBindings::Rest::ServiceStub.stub :transcode_list_tag_bindings_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, list_tag_bindings_client_stub do - # Create client - client = ::Google::Cloud::ResourceManager::V3::TagBindings::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - client.list_tag_bindings({ 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_tag_bindings 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_tag_bindings ::Google::Cloud::ResourceManager::V3::ListTagBindingsRequest.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_tag_bindings({ 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_tag_bindings(::Google::Cloud::ResourceManager::V3::ListTagBindingsRequest.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_tag_bindings_client_stub.call_count - end - end - end - - def test_create_tag_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. - tag_binding = {} - validate_only = true - - create_tag_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::Cloud::ResourceManager::V3::TagBindings::Rest::ServiceStub.stub :transcode_create_tag_binding_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, create_tag_binding_client_stub do - # Create client - client = ::Google::Cloud::ResourceManager::V3::TagBindings::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - client.create_tag_binding({ tag_binding: tag_binding, validate_only: validate_only }) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use named arguments - client.create_tag_binding tag_binding: tag_binding, validate_only: validate_only do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object - client.create_tag_binding ::Google::Cloud::ResourceManager::V3::CreateTagBindingRequest.new(tag_binding: tag_binding, validate_only: validate_only) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use hash object with options - client.create_tag_binding({ tag_binding: tag_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_tag_binding(::Google::Cloud::ResourceManager::V3::CreateTagBindingRequest.new(tag_binding: tag_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_tag_binding_client_stub.call_count - end - end - end - - def test_delete_tag_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" - - delete_tag_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::Cloud::ResourceManager::V3::TagBindings::Rest::ServiceStub.stub :transcode_delete_tag_binding_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, delete_tag_binding_client_stub do - # Create client - client = ::Google::Cloud::ResourceManager::V3::TagBindings::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - client.delete_tag_binding({ name: name }) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use named arguments - client.delete_tag_binding name: name do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object - client.delete_tag_binding ::Google::Cloud::ResourceManager::V3::DeleteTagBindingRequest.new(name: name) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use hash object with options - client.delete_tag_binding({ name: name }, call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object with options - client.delete_tag_binding(::Google::Cloud::ResourceManager::V3::DeleteTagBindingRequest.new(name: name), call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Verify method calls - assert_equal 5, delete_tag_binding_client_stub.call_count - end - end - end - - def test_list_effective_tags - # Create test objects. - client_result = ::Google::Cloud::ResourceManager::V3::ListEffectiveTagsResponse.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_effective_tags_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| - assert options.metadata.key? :"x-goog-api-client" - assert options.metadata[:"x-goog-api-client"].include? "rest" - refute options.metadata[:"x-goog-api-client"].include? "grpc" - end - - ::Google::Cloud::ResourceManager::V3::TagBindings::Rest::ServiceStub.stub :transcode_list_effective_tags_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, list_effective_tags_client_stub do - # Create client - client = ::Google::Cloud::ResourceManager::V3::TagBindings::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - client.list_effective_tags({ 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_effective_tags 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_effective_tags ::Google::Cloud::ResourceManager::V3::ListEffectiveTagsRequest.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_effective_tags({ 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_effective_tags(::Google::Cloud::ResourceManager::V3::ListEffectiveTagsRequest.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_effective_tags_client_stub.call_count - end - end - end - - def test_configure - credentials_token = :dummy_value - - client = block_config = config = nil - dummy_stub = ClientStub.new nil - Gapic::Rest::ClientStub.stub :new, dummy_stub do - client = ::Google::Cloud::ResourceManager::V3::TagBindings::Rest::Client.new do |config| - config.credentials = credentials_token - end - end - - config = client.configure do |c| - block_config = c - end - - assert_same block_config, config - assert_kind_of ::Google::Cloud::ResourceManager::V3::TagBindings::Rest::Client::Configuration, config - end -end diff --git a/owl-bot-staging/google-cloud-resource_manager-v3/test/google/cloud/resource_manager/v3/tag_bindings_test.rb b/owl-bot-staging/google-cloud-resource_manager-v3/test/google/cloud/resource_manager/v3/tag_bindings_test.rb deleted file mode 100644 index e6edf1976870..000000000000 --- a/owl-bot-staging/google-cloud-resource_manager-v3/test/google/cloud/resource_manager/v3/tag_bindings_test.rb +++ /dev/null @@ -1,380 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -require "helper" - -require "gapic/grpc/service_stub" - -require "google/cloud/resourcemanager/v3/tag_bindings_pb" -require "google/cloud/resource_manager/v3/tag_bindings" - -class ::Google::Cloud::ResourceManager::V3::TagBindings::ClientTest < Minitest::Test - class ClientStub - attr_accessor :call_rpc_count, :requests - - def initialize response, operation, &block - @response = response - @operation = operation - @block = block - @call_rpc_count = 0 - @requests = [] - end - - def call_rpc *args, **kwargs - @call_rpc_count += 1 - - @requests << @block&.call(*args, **kwargs) - - catch :response do - yield @response, @operation if block_given? - @response - end - end - - def endpoint - "endpoint.example.com" - end - - def universe_domain - "example.com" - end - - def stub_logger - nil - end - - def logger - nil - end - end - - def test_list_tag_bindings - # Create GRPC objects. - grpc_response = ::Google::Cloud::ResourceManager::V3::ListTagBindingsResponse.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_tag_bindings_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :list_tag_bindings, name - assert_kind_of ::Google::Cloud::ResourceManager::V3::ListTagBindingsRequest, 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_tag_bindings_client_stub do - # Create client - client = ::Google::Cloud::ResourceManager::V3::TagBindings::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.list_tag_bindings({ 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_tag_bindings 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_tag_bindings ::Google::Cloud::ResourceManager::V3::ListTagBindingsRequest.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_tag_bindings({ 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_tag_bindings(::Google::Cloud::ResourceManager::V3::ListTagBindingsRequest.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_tag_bindings_client_stub.call_rpc_count - end - end - - def test_create_tag_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. - tag_binding = {} - validate_only = true - - create_tag_binding_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :create_tag_binding, name - assert_kind_of ::Google::Cloud::ResourceManager::V3::CreateTagBindingRequest, request - assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::ResourceManager::V3::TagBinding), request["tag_binding"] - assert_equal true, request["validate_only"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, create_tag_binding_client_stub do - # Create client - client = ::Google::Cloud::ResourceManager::V3::TagBindings::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.create_tag_binding({ tag_binding: tag_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_tag_binding tag_binding: tag_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_tag_binding ::Google::Cloud::ResourceManager::V3::CreateTagBindingRequest.new(tag_binding: tag_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_tag_binding({ tag_binding: tag_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_tag_binding(::Google::Cloud::ResourceManager::V3::CreateTagBindingRequest.new(tag_binding: tag_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_tag_binding_client_stub.call_rpc_count - end - end - - def test_delete_tag_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" - - delete_tag_binding_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :delete_tag_binding, name - assert_kind_of ::Google::Cloud::ResourceManager::V3::DeleteTagBindingRequest, request - assert_equal "hello world", request["name"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, delete_tag_binding_client_stub do - # Create client - client = ::Google::Cloud::ResourceManager::V3::TagBindings::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.delete_tag_binding({ 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.delete_tag_binding 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.delete_tag_binding ::Google::Cloud::ResourceManager::V3::DeleteTagBindingRequest.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.delete_tag_binding({ 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.delete_tag_binding(::Google::Cloud::ResourceManager::V3::DeleteTagBindingRequest.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, delete_tag_binding_client_stub.call_rpc_count - end - end - - def test_list_effective_tags - # Create GRPC objects. - grpc_response = ::Google::Cloud::ResourceManager::V3::ListEffectiveTagsResponse.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_effective_tags_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :list_effective_tags, name - assert_kind_of ::Google::Cloud::ResourceManager::V3::ListEffectiveTagsRequest, 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_effective_tags_client_stub do - # Create client - client = ::Google::Cloud::ResourceManager::V3::TagBindings::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.list_effective_tags({ 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_effective_tags 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_effective_tags ::Google::Cloud::ResourceManager::V3::ListEffectiveTagsRequest.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_effective_tags({ 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_effective_tags(::Google::Cloud::ResourceManager::V3::ListEffectiveTagsRequest.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_effective_tags_client_stub.call_rpc_count - end - end - - def test_configure - grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - - client = block_config = config = nil - dummy_stub = ClientStub.new nil, nil - Gapic::ServiceStub.stub :new, dummy_stub do - client = ::Google::Cloud::ResourceManager::V3::TagBindings::Client.new do |config| - config.credentials = grpc_channel - end - end - - config = client.configure do |c| - block_config = c - end - - assert_same block_config, config - assert_kind_of ::Google::Cloud::ResourceManager::V3::TagBindings::Client::Configuration, config - end - - def test_credentials - key = OpenSSL::PKey::RSA.new 2048 - cred_json = { - "private_key" => key.to_pem, - "client_email" => "app@developer.gserviceaccount.com", - "type" => "service_account" - } - key_file = StringIO.new cred_json.to_json - creds = Google::Auth::ServiceAccountCredentials.make_creds({ json_key_io: key_file }) - - dummy_stub = ClientStub.new nil, nil - Gapic::ServiceStub.stub :new, dummy_stub do - client = ::Google::Cloud::ResourceManager::V3::TagBindings::Client.new do |config| - config.credentials = creds - end - assert_kind_of ::Google::Cloud::ResourceManager::V3::TagBindings::Client, client - assert_equal creds, client.configure.credentials - end - end - - def test_operations_client - grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - - client = nil - dummy_stub = ClientStub.new nil, nil - Gapic::ServiceStub.stub :new, dummy_stub do - client = ::Google::Cloud::ResourceManager::V3::TagBindings::Client.new do |config| - config.credentials = grpc_channel - end - end - - assert_kind_of ::Google::Cloud::ResourceManager::V3::TagBindings::Operations, client.operations_client - end -end diff --git a/owl-bot-staging/google-cloud-resource_manager-v3/test/google/cloud/resource_manager/v3/tag_holds_operations_test.rb b/owl-bot-staging/google-cloud-resource_manager-v3/test/google/cloud/resource_manager/v3/tag_holds_operations_test.rb deleted file mode 100644 index 4a4cd95893bc..000000000000 --- a/owl-bot-staging/google-cloud-resource_manager-v3/test/google/cloud/resource_manager/v3/tag_holds_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/cloud/resourcemanager/v3/tag_holds_pb" -require "google/cloud/resourcemanager/v3/tag_holds_services_pb" -require "google/cloud/resource_manager/v3/tag_holds" - -class ::Google::Cloud::ResourceManager::V3::TagHolds::OperationsTest < Minitest::Test - class ClientStub - attr_accessor :call_rpc_count, :requests - - def initialize response, operation, &block - @response = response - @operation = operation - @block = block - @call_rpc_count = 0 - @requests = [] - end - - def call_rpc *args, **kwargs - @call_rpc_count += 1 - - @requests << @block&.call(*args, **kwargs) - - catch :response do - yield @response, @operation if block_given? - @response - end - end - - def endpoint - "endpoint.example.com" - end - - def universe_domain - "example.com" - end - - def stub_logger - nil - end - - def logger - nil - end - end - - def test_list_operations - # Create GRPC objects. - grpc_response = ::Google::Longrunning::ListOperationsResponse.new - grpc_operation = GRPC::ActiveCall::Operation.new nil - grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - grpc_options = {} - - # Create request parameters for a unary method. - name = "hello world" - filter = "hello world" - page_size = 42 - page_token = "hello world" - return_partial_success = true - - list_operations_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :list_operations, name - assert_kind_of ::Google::Longrunning::ListOperationsRequest, request - assert_equal "hello world", request["name"] - assert_equal "hello world", request["filter"] - assert_equal 42, request["page_size"] - assert_equal "hello world", request["page_token"] - assert_equal true, request["return_partial_success"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, list_operations_client_stub do - # Create client - client = ::Google::Cloud::ResourceManager::V3::TagHolds::Operations.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.list_operations({ name: name, filter: filter, page_size: page_size, page_token: page_token, return_partial_success: return_partial_success }) do |response, operation| - assert_kind_of Gapic::PagedEnumerable, response - assert_equal grpc_response, response.response - assert_equal grpc_operation, operation - end - - # Use named arguments - client.list_operations name: name, filter: filter, page_size: page_size, page_token: page_token, return_partial_success: return_partial_success do |response, operation| - assert_kind_of Gapic::PagedEnumerable, response - assert_equal grpc_response, response.response - assert_equal grpc_operation, operation - end - - # Use protobuf object - client.list_operations ::Google::Longrunning::ListOperationsRequest.new(name: name, filter: filter, page_size: page_size, page_token: page_token, return_partial_success: return_partial_success) do |response, operation| - assert_kind_of Gapic::PagedEnumerable, response - assert_equal grpc_response, response.response - assert_equal grpc_operation, operation - end - - # Use hash object with options - client.list_operations({ name: name, filter: filter, page_size: page_size, page_token: page_token, return_partial_success: return_partial_success }, grpc_options) do |response, operation| - assert_kind_of Gapic::PagedEnumerable, response - assert_equal grpc_response, response.response - assert_equal grpc_operation, operation - end - - # Use protobuf object with options - client.list_operations(::Google::Longrunning::ListOperationsRequest.new(name: name, filter: filter, page_size: page_size, page_token: page_token, return_partial_success: return_partial_success), grpc_options) do |response, operation| - assert_kind_of Gapic::PagedEnumerable, response - assert_equal grpc_response, response.response - assert_equal grpc_operation, operation - end - - # Verify method calls - assert_equal 5, list_operations_client_stub.call_rpc_count - end - end - - def test_get_operation - # Create GRPC objects. - grpc_response = ::Google::Longrunning::Operation.new - grpc_operation = GRPC::ActiveCall::Operation.new nil - grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - grpc_options = {} - - # Create request parameters for a unary method. - name = "hello world" - - get_operation_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :get_operation, name - assert_kind_of ::Google::Longrunning::GetOperationRequest, request - assert_equal "hello world", request["name"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, get_operation_client_stub do - # Create client - client = ::Google::Cloud::ResourceManager::V3::TagHolds::Operations.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.get_operation({ name: name }) do |response, operation| - assert_kind_of Gapic::Operation, response - assert_equal grpc_response, response.grpc_op - assert_equal grpc_operation, operation - end - - # Use named arguments - client.get_operation name: name do |response, operation| - assert_kind_of Gapic::Operation, response - assert_equal grpc_response, response.grpc_op - assert_equal grpc_operation, operation - end - - # Use protobuf object - client.get_operation ::Google::Longrunning::GetOperationRequest.new(name: name) do |response, operation| - assert_kind_of Gapic::Operation, response - assert_equal grpc_response, response.grpc_op - assert_equal grpc_operation, operation - end - - # Use hash object with options - client.get_operation({ name: name }, grpc_options) do |response, operation| - assert_kind_of Gapic::Operation, response - assert_equal grpc_response, response.grpc_op - assert_equal grpc_operation, operation - end - - # Use protobuf object with options - client.get_operation(::Google::Longrunning::GetOperationRequest.new(name: name), grpc_options) do |response, operation| - assert_kind_of Gapic::Operation, response - assert_equal grpc_response, response.grpc_op - assert_equal grpc_operation, operation - end - - # Verify method calls - assert_equal 5, get_operation_client_stub.call_rpc_count - end - end - - def test_delete_operation - # Create GRPC objects. - grpc_response = ::Google::Protobuf::Empty.new - grpc_operation = GRPC::ActiveCall::Operation.new nil - grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - grpc_options = {} - - # Create request parameters for a unary method. - name = "hello world" - - delete_operation_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :delete_operation, name - assert_kind_of ::Google::Longrunning::DeleteOperationRequest, request - assert_equal "hello world", request["name"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, delete_operation_client_stub do - # Create client - client = ::Google::Cloud::ResourceManager::V3::TagHolds::Operations.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.delete_operation({ name: name }) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use named arguments - client.delete_operation name: name do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object - client.delete_operation ::Google::Longrunning::DeleteOperationRequest.new(name: name) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use hash object with options - client.delete_operation({ name: name }, grpc_options) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object with options - client.delete_operation(::Google::Longrunning::DeleteOperationRequest.new(name: name), grpc_options) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Verify method calls - assert_equal 5, delete_operation_client_stub.call_rpc_count - end - end - - def test_cancel_operation - # Create GRPC objects. - grpc_response = ::Google::Protobuf::Empty.new - grpc_operation = GRPC::ActiveCall::Operation.new nil - grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - grpc_options = {} - - # Create request parameters for a unary method. - name = "hello world" - - cancel_operation_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :cancel_operation, name - assert_kind_of ::Google::Longrunning::CancelOperationRequest, request - assert_equal "hello world", request["name"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, cancel_operation_client_stub do - # Create client - client = ::Google::Cloud::ResourceManager::V3::TagHolds::Operations.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.cancel_operation({ name: name }) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use named arguments - client.cancel_operation name: name do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object - client.cancel_operation ::Google::Longrunning::CancelOperationRequest.new(name: name) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use hash object with options - client.cancel_operation({ name: name }, grpc_options) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object with options - client.cancel_operation(::Google::Longrunning::CancelOperationRequest.new(name: name), grpc_options) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Verify method calls - assert_equal 5, cancel_operation_client_stub.call_rpc_count - end - end - - def test_wait_operation - # Create GRPC objects. - grpc_response = ::Google::Longrunning::Operation.new - grpc_operation = GRPC::ActiveCall::Operation.new nil - grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - grpc_options = {} - - # Create request parameters for a unary method. - name = "hello world" - timeout = {} - - wait_operation_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :wait_operation, name - assert_kind_of ::Google::Longrunning::WaitOperationRequest, request - assert_equal "hello world", request["name"] - assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Protobuf::Duration), request["timeout"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, wait_operation_client_stub do - # Create client - client = ::Google::Cloud::ResourceManager::V3::TagHolds::Operations.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.wait_operation({ name: name, timeout: timeout }) do |response, operation| - assert_kind_of Gapic::Operation, response - assert_equal grpc_response, response.grpc_op - assert_equal grpc_operation, operation - end - - # Use named arguments - client.wait_operation name: name, timeout: timeout do |response, operation| - assert_kind_of Gapic::Operation, response - assert_equal grpc_response, response.grpc_op - assert_equal grpc_operation, operation - end - - # Use protobuf object - client.wait_operation ::Google::Longrunning::WaitOperationRequest.new(name: name, timeout: timeout) do |response, operation| - assert_kind_of Gapic::Operation, response - assert_equal grpc_response, response.grpc_op - assert_equal grpc_operation, operation - end - - # Use hash object with options - client.wait_operation({ name: name, timeout: timeout }, grpc_options) do |response, operation| - assert_kind_of Gapic::Operation, response - assert_equal grpc_response, response.grpc_op - assert_equal grpc_operation, operation - end - - # Use protobuf object with options - client.wait_operation(::Google::Longrunning::WaitOperationRequest.new(name: name, timeout: timeout), grpc_options) do |response, operation| - assert_kind_of Gapic::Operation, response - assert_equal grpc_response, response.grpc_op - assert_equal grpc_operation, operation - end - - # Verify method calls - assert_equal 5, wait_operation_client_stub.call_rpc_count - end - end - - def test_configure - grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - - client = block_config = config = nil - dummy_stub = ClientStub.new nil, nil - Gapic::ServiceStub.stub :new, dummy_stub do - client = ::Google::Cloud::ResourceManager::V3::TagHolds::Operations.new do |config| - config.credentials = grpc_channel - end - end - - config = client.configure do |c| - block_config = c - end - - assert_same block_config, config - assert_kind_of ::Google::Cloud::ResourceManager::V3::TagHolds::Operations::Configuration, config - end -end diff --git a/owl-bot-staging/google-cloud-resource_manager-v3/test/google/cloud/resource_manager/v3/tag_holds_paths_test.rb b/owl-bot-staging/google-cloud-resource_manager-v3/test/google/cloud/resource_manager/v3/tag_holds_paths_test.rb deleted file mode 100644 index 896ad53b457d..000000000000 --- a/owl-bot-staging/google-cloud-resource_manager-v3/test/google/cloud/resource_manager/v3/tag_holds_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/cloud/resource_manager/v3/tag_holds" - -class ::Google::Cloud::ResourceManager::V3::TagHolds::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_tag_hold_path - grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - ::Gapic::ServiceStub.stub :new, DummyStub.new do - client = ::Google::Cloud::ResourceManager::V3::TagHolds::Client.new do |config| - config.credentials = grpc_channel - end - - path = client.tag_hold_path tag_value: "value0", tag_hold: "value1" - assert_equal "tagValues/value0/tagHolds/value1", path - end - end - - def test_tag_value_path - grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - ::Gapic::ServiceStub.stub :new, DummyStub.new do - client = ::Google::Cloud::ResourceManager::V3::TagHolds::Client.new do |config| - config.credentials = grpc_channel - end - - path = client.tag_value_path tag_value: "value0" - assert_equal "tagValues/value0", path - end - end -end diff --git a/owl-bot-staging/google-cloud-resource_manager-v3/test/google/cloud/resource_manager/v3/tag_holds_rest_test.rb b/owl-bot-staging/google-cloud-resource_manager-v3/test/google/cloud/resource_manager/v3/tag_holds_rest_test.rb deleted file mode 100644 index 3958e2ec0f3b..000000000000 --- a/owl-bot-staging/google-cloud-resource_manager-v3/test/google/cloud/resource_manager/v3/tag_holds_rest_test.rb +++ /dev/null @@ -1,267 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -require "helper" -require "gapic/rest" -require "google/cloud/resourcemanager/v3/tag_holds_pb" -require "google/cloud/resource_manager/v3/tag_holds/rest" - - -class ::Google::Cloud::ResourceManager::V3::TagHolds::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_tag_hold - # 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" - tag_hold = {} - validate_only = true - - create_tag_hold_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| - assert options.metadata.key? :"x-goog-api-client" - assert options.metadata[:"x-goog-api-client"].include? "rest" - refute options.metadata[:"x-goog-api-client"].include? "grpc" - end - - ::Google::Cloud::ResourceManager::V3::TagHolds::Rest::ServiceStub.stub :transcode_create_tag_hold_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, create_tag_hold_client_stub do - # Create client - client = ::Google::Cloud::ResourceManager::V3::TagHolds::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - client.create_tag_hold({ parent: parent, tag_hold: tag_hold, validate_only: validate_only }) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use named arguments - client.create_tag_hold parent: parent, tag_hold: tag_hold, validate_only: validate_only do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object - client.create_tag_hold ::Google::Cloud::ResourceManager::V3::CreateTagHoldRequest.new(parent: parent, tag_hold: tag_hold, validate_only: validate_only) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use hash object with options - client.create_tag_hold({ parent: parent, tag_hold: tag_hold, validate_only: validate_only }, call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object with options - client.create_tag_hold(::Google::Cloud::ResourceManager::V3::CreateTagHoldRequest.new(parent: parent, tag_hold: tag_hold, validate_only: validate_only), call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Verify method calls - assert_equal 5, create_tag_hold_client_stub.call_count - end - end - end - - def test_delete_tag_hold - # 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" - validate_only = true - - delete_tag_hold_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| - assert options.metadata.key? :"x-goog-api-client" - assert options.metadata[:"x-goog-api-client"].include? "rest" - refute options.metadata[:"x-goog-api-client"].include? "grpc" - end - - ::Google::Cloud::ResourceManager::V3::TagHolds::Rest::ServiceStub.stub :transcode_delete_tag_hold_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, delete_tag_hold_client_stub do - # Create client - client = ::Google::Cloud::ResourceManager::V3::TagHolds::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - client.delete_tag_hold({ name: name, validate_only: validate_only }) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use named arguments - client.delete_tag_hold name: name, validate_only: validate_only do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object - client.delete_tag_hold ::Google::Cloud::ResourceManager::V3::DeleteTagHoldRequest.new(name: name, validate_only: validate_only) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use hash object with options - client.delete_tag_hold({ name: name, validate_only: validate_only }, call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object with options - client.delete_tag_hold(::Google::Cloud::ResourceManager::V3::DeleteTagHoldRequest.new(name: name, validate_only: validate_only), call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Verify method calls - assert_equal 5, delete_tag_hold_client_stub.call_count - end - end - end - - def test_list_tag_holds - # Create test objects. - client_result = ::Google::Cloud::ResourceManager::V3::ListTagHoldsResponse.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_tag_holds_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| - assert options.metadata.key? :"x-goog-api-client" - assert options.metadata[:"x-goog-api-client"].include? "rest" - refute options.metadata[:"x-goog-api-client"].include? "grpc" - end - - ::Google::Cloud::ResourceManager::V3::TagHolds::Rest::ServiceStub.stub :transcode_list_tag_holds_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, list_tag_holds_client_stub do - # Create client - client = ::Google::Cloud::ResourceManager::V3::TagHolds::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - client.list_tag_holds({ 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_tag_holds 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_tag_holds ::Google::Cloud::ResourceManager::V3::ListTagHoldsRequest.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_tag_holds({ 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_tag_holds(::Google::Cloud::ResourceManager::V3::ListTagHoldsRequest.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_tag_holds_client_stub.call_count - end - end - end - - def test_configure - credentials_token = :dummy_value - - client = block_config = config = nil - dummy_stub = ClientStub.new nil - Gapic::Rest::ClientStub.stub :new, dummy_stub do - client = ::Google::Cloud::ResourceManager::V3::TagHolds::Rest::Client.new do |config| - config.credentials = credentials_token - end - end - - config = client.configure do |c| - block_config = c - end - - assert_same block_config, config - assert_kind_of ::Google::Cloud::ResourceManager::V3::TagHolds::Rest::Client::Configuration, config - end -end diff --git a/owl-bot-staging/google-cloud-resource_manager-v3/test/google/cloud/resource_manager/v3/tag_holds_test.rb b/owl-bot-staging/google-cloud-resource_manager-v3/test/google/cloud/resource_manager/v3/tag_holds_test.rb deleted file mode 100644 index ac648fdfa9ca..000000000000 --- a/owl-bot-staging/google-cloud-resource_manager-v3/test/google/cloud/resource_manager/v3/tag_holds_test.rb +++ /dev/null @@ -1,319 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -require "helper" - -require "gapic/grpc/service_stub" - -require "google/cloud/resourcemanager/v3/tag_holds_pb" -require "google/cloud/resource_manager/v3/tag_holds" - -class ::Google::Cloud::ResourceManager::V3::TagHolds::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_tag_hold - # 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" - tag_hold = {} - validate_only = true - - create_tag_hold_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :create_tag_hold, name - assert_kind_of ::Google::Cloud::ResourceManager::V3::CreateTagHoldRequest, request - assert_equal "hello world", request["parent"] - assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::ResourceManager::V3::TagHold), request["tag_hold"] - assert_equal true, request["validate_only"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, create_tag_hold_client_stub do - # Create client - client = ::Google::Cloud::ResourceManager::V3::TagHolds::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.create_tag_hold({ parent: parent, tag_hold: tag_hold, 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_tag_hold parent: parent, tag_hold: tag_hold, 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_tag_hold ::Google::Cloud::ResourceManager::V3::CreateTagHoldRequest.new(parent: parent, tag_hold: tag_hold, 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_tag_hold({ parent: parent, tag_hold: tag_hold, 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_tag_hold(::Google::Cloud::ResourceManager::V3::CreateTagHoldRequest.new(parent: parent, tag_hold: tag_hold, 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_tag_hold_client_stub.call_rpc_count - end - end - - def test_delete_tag_hold - # 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" - validate_only = true - - delete_tag_hold_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :delete_tag_hold, name - assert_kind_of ::Google::Cloud::ResourceManager::V3::DeleteTagHoldRequest, request - assert_equal "hello world", request["name"] - assert_equal true, request["validate_only"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, delete_tag_hold_client_stub do - # Create client - client = ::Google::Cloud::ResourceManager::V3::TagHolds::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.delete_tag_hold({ name: name, 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_tag_hold name: name, 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_tag_hold ::Google::Cloud::ResourceManager::V3::DeleteTagHoldRequest.new(name: name, 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_tag_hold({ name: name, 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_tag_hold(::Google::Cloud::ResourceManager::V3::DeleteTagHoldRequest.new(name: name, 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_tag_hold_client_stub.call_rpc_count - end - end - - def test_list_tag_holds - # Create GRPC objects. - grpc_response = ::Google::Cloud::ResourceManager::V3::ListTagHoldsResponse.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_tag_holds_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :list_tag_holds, name - assert_kind_of ::Google::Cloud::ResourceManager::V3::ListTagHoldsRequest, 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_tag_holds_client_stub do - # Create client - client = ::Google::Cloud::ResourceManager::V3::TagHolds::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.list_tag_holds({ 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_tag_holds 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_tag_holds ::Google::Cloud::ResourceManager::V3::ListTagHoldsRequest.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_tag_holds({ 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_tag_holds(::Google::Cloud::ResourceManager::V3::ListTagHoldsRequest.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_tag_holds_client_stub.call_rpc_count - end - end - - def test_configure - grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - - client = block_config = config = nil - dummy_stub = ClientStub.new nil, nil - Gapic::ServiceStub.stub :new, dummy_stub do - client = ::Google::Cloud::ResourceManager::V3::TagHolds::Client.new do |config| - config.credentials = grpc_channel - end - end - - config = client.configure do |c| - block_config = c - end - - assert_same block_config, config - assert_kind_of ::Google::Cloud::ResourceManager::V3::TagHolds::Client::Configuration, config - end - - def test_credentials - key = OpenSSL::PKey::RSA.new 2048 - cred_json = { - "private_key" => key.to_pem, - "client_email" => "app@developer.gserviceaccount.com", - "type" => "service_account" - } - key_file = StringIO.new cred_json.to_json - creds = Google::Auth::ServiceAccountCredentials.make_creds({ json_key_io: key_file }) - - dummy_stub = ClientStub.new nil, nil - Gapic::ServiceStub.stub :new, dummy_stub do - client = ::Google::Cloud::ResourceManager::V3::TagHolds::Client.new do |config| - config.credentials = creds - end - assert_kind_of ::Google::Cloud::ResourceManager::V3::TagHolds::Client, client - assert_equal creds, client.configure.credentials - end - end - - def test_operations_client - grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - - client = nil - dummy_stub = ClientStub.new nil, nil - Gapic::ServiceStub.stub :new, dummy_stub do - client = ::Google::Cloud::ResourceManager::V3::TagHolds::Client.new do |config| - config.credentials = grpc_channel - end - end - - assert_kind_of ::Google::Cloud::ResourceManager::V3::TagHolds::Operations, client.operations_client - end -end diff --git a/owl-bot-staging/google-cloud-resource_manager-v3/test/google/cloud/resource_manager/v3/tag_keys_operations_test.rb b/owl-bot-staging/google-cloud-resource_manager-v3/test/google/cloud/resource_manager/v3/tag_keys_operations_test.rb deleted file mode 100644 index a8f64f70ac47..000000000000 --- a/owl-bot-staging/google-cloud-resource_manager-v3/test/google/cloud/resource_manager/v3/tag_keys_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/cloud/resourcemanager/v3/tag_keys_pb" -require "google/cloud/resourcemanager/v3/tag_keys_services_pb" -require "google/cloud/resource_manager/v3/tag_keys" - -class ::Google::Cloud::ResourceManager::V3::TagKeys::OperationsTest < Minitest::Test - class ClientStub - attr_accessor :call_rpc_count, :requests - - def initialize response, operation, &block - @response = response - @operation = operation - @block = block - @call_rpc_count = 0 - @requests = [] - end - - def call_rpc *args, **kwargs - @call_rpc_count += 1 - - @requests << @block&.call(*args, **kwargs) - - catch :response do - yield @response, @operation if block_given? - @response - end - end - - def endpoint - "endpoint.example.com" - end - - def universe_domain - "example.com" - end - - def stub_logger - nil - end - - def logger - nil - end - end - - def test_list_operations - # Create GRPC objects. - grpc_response = ::Google::Longrunning::ListOperationsResponse.new - grpc_operation = GRPC::ActiveCall::Operation.new nil - grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - grpc_options = {} - - # Create request parameters for a unary method. - name = "hello world" - filter = "hello world" - page_size = 42 - page_token = "hello world" - return_partial_success = true - - list_operations_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :list_operations, name - assert_kind_of ::Google::Longrunning::ListOperationsRequest, request - assert_equal "hello world", request["name"] - assert_equal "hello world", request["filter"] - assert_equal 42, request["page_size"] - assert_equal "hello world", request["page_token"] - assert_equal true, request["return_partial_success"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, list_operations_client_stub do - # Create client - client = ::Google::Cloud::ResourceManager::V3::TagKeys::Operations.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.list_operations({ name: name, filter: filter, page_size: page_size, page_token: page_token, return_partial_success: return_partial_success }) do |response, operation| - assert_kind_of Gapic::PagedEnumerable, response - assert_equal grpc_response, response.response - assert_equal grpc_operation, operation - end - - # Use named arguments - client.list_operations name: name, filter: filter, page_size: page_size, page_token: page_token, return_partial_success: return_partial_success do |response, operation| - assert_kind_of Gapic::PagedEnumerable, response - assert_equal grpc_response, response.response - assert_equal grpc_operation, operation - end - - # Use protobuf object - client.list_operations ::Google::Longrunning::ListOperationsRequest.new(name: name, filter: filter, page_size: page_size, page_token: page_token, return_partial_success: return_partial_success) do |response, operation| - assert_kind_of Gapic::PagedEnumerable, response - assert_equal grpc_response, response.response - assert_equal grpc_operation, operation - end - - # Use hash object with options - client.list_operations({ name: name, filter: filter, page_size: page_size, page_token: page_token, return_partial_success: return_partial_success }, grpc_options) do |response, operation| - assert_kind_of Gapic::PagedEnumerable, response - assert_equal grpc_response, response.response - assert_equal grpc_operation, operation - end - - # Use protobuf object with options - client.list_operations(::Google::Longrunning::ListOperationsRequest.new(name: name, filter: filter, page_size: page_size, page_token: page_token, return_partial_success: return_partial_success), grpc_options) do |response, operation| - assert_kind_of Gapic::PagedEnumerable, response - assert_equal grpc_response, response.response - assert_equal grpc_operation, operation - end - - # Verify method calls - assert_equal 5, list_operations_client_stub.call_rpc_count - end - end - - def test_get_operation - # Create GRPC objects. - grpc_response = ::Google::Longrunning::Operation.new - grpc_operation = GRPC::ActiveCall::Operation.new nil - grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - grpc_options = {} - - # Create request parameters for a unary method. - name = "hello world" - - get_operation_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :get_operation, name - assert_kind_of ::Google::Longrunning::GetOperationRequest, request - assert_equal "hello world", request["name"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, get_operation_client_stub do - # Create client - client = ::Google::Cloud::ResourceManager::V3::TagKeys::Operations.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.get_operation({ name: name }) do |response, operation| - assert_kind_of Gapic::Operation, response - assert_equal grpc_response, response.grpc_op - assert_equal grpc_operation, operation - end - - # Use named arguments - client.get_operation name: name do |response, operation| - assert_kind_of Gapic::Operation, response - assert_equal grpc_response, response.grpc_op - assert_equal grpc_operation, operation - end - - # Use protobuf object - client.get_operation ::Google::Longrunning::GetOperationRequest.new(name: name) do |response, operation| - assert_kind_of Gapic::Operation, response - assert_equal grpc_response, response.grpc_op - assert_equal grpc_operation, operation - end - - # Use hash object with options - client.get_operation({ name: name }, grpc_options) do |response, operation| - assert_kind_of Gapic::Operation, response - assert_equal grpc_response, response.grpc_op - assert_equal grpc_operation, operation - end - - # Use protobuf object with options - client.get_operation(::Google::Longrunning::GetOperationRequest.new(name: name), grpc_options) do |response, operation| - assert_kind_of Gapic::Operation, response - assert_equal grpc_response, response.grpc_op - assert_equal grpc_operation, operation - end - - # Verify method calls - assert_equal 5, get_operation_client_stub.call_rpc_count - end - end - - def test_delete_operation - # Create GRPC objects. - grpc_response = ::Google::Protobuf::Empty.new - grpc_operation = GRPC::ActiveCall::Operation.new nil - grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - grpc_options = {} - - # Create request parameters for a unary method. - name = "hello world" - - delete_operation_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :delete_operation, name - assert_kind_of ::Google::Longrunning::DeleteOperationRequest, request - assert_equal "hello world", request["name"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, delete_operation_client_stub do - # Create client - client = ::Google::Cloud::ResourceManager::V3::TagKeys::Operations.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.delete_operation({ name: name }) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use named arguments - client.delete_operation name: name do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object - client.delete_operation ::Google::Longrunning::DeleteOperationRequest.new(name: name) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use hash object with options - client.delete_operation({ name: name }, grpc_options) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object with options - client.delete_operation(::Google::Longrunning::DeleteOperationRequest.new(name: name), grpc_options) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Verify method calls - assert_equal 5, delete_operation_client_stub.call_rpc_count - end - end - - def test_cancel_operation - # Create GRPC objects. - grpc_response = ::Google::Protobuf::Empty.new - grpc_operation = GRPC::ActiveCall::Operation.new nil - grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - grpc_options = {} - - # Create request parameters for a unary method. - name = "hello world" - - cancel_operation_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :cancel_operation, name - assert_kind_of ::Google::Longrunning::CancelOperationRequest, request - assert_equal "hello world", request["name"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, cancel_operation_client_stub do - # Create client - client = ::Google::Cloud::ResourceManager::V3::TagKeys::Operations.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.cancel_operation({ name: name }) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use named arguments - client.cancel_operation name: name do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object - client.cancel_operation ::Google::Longrunning::CancelOperationRequest.new(name: name) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use hash object with options - client.cancel_operation({ name: name }, grpc_options) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object with options - client.cancel_operation(::Google::Longrunning::CancelOperationRequest.new(name: name), grpc_options) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Verify method calls - assert_equal 5, cancel_operation_client_stub.call_rpc_count - end - end - - def test_wait_operation - # Create GRPC objects. - grpc_response = ::Google::Longrunning::Operation.new - grpc_operation = GRPC::ActiveCall::Operation.new nil - grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - grpc_options = {} - - # Create request parameters for a unary method. - name = "hello world" - timeout = {} - - wait_operation_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :wait_operation, name - assert_kind_of ::Google::Longrunning::WaitOperationRequest, request - assert_equal "hello world", request["name"] - assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Protobuf::Duration), request["timeout"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, wait_operation_client_stub do - # Create client - client = ::Google::Cloud::ResourceManager::V3::TagKeys::Operations.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.wait_operation({ name: name, timeout: timeout }) do |response, operation| - assert_kind_of Gapic::Operation, response - assert_equal grpc_response, response.grpc_op - assert_equal grpc_operation, operation - end - - # Use named arguments - client.wait_operation name: name, timeout: timeout do |response, operation| - assert_kind_of Gapic::Operation, response - assert_equal grpc_response, response.grpc_op - assert_equal grpc_operation, operation - end - - # Use protobuf object - client.wait_operation ::Google::Longrunning::WaitOperationRequest.new(name: name, timeout: timeout) do |response, operation| - assert_kind_of Gapic::Operation, response - assert_equal grpc_response, response.grpc_op - assert_equal grpc_operation, operation - end - - # Use hash object with options - client.wait_operation({ name: name, timeout: timeout }, grpc_options) do |response, operation| - assert_kind_of Gapic::Operation, response - assert_equal grpc_response, response.grpc_op - assert_equal grpc_operation, operation - end - - # Use protobuf object with options - client.wait_operation(::Google::Longrunning::WaitOperationRequest.new(name: name, timeout: timeout), grpc_options) do |response, operation| - assert_kind_of Gapic::Operation, response - assert_equal grpc_response, response.grpc_op - assert_equal grpc_operation, operation - end - - # Verify method calls - assert_equal 5, wait_operation_client_stub.call_rpc_count - end - end - - def test_configure - grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - - client = block_config = config = nil - dummy_stub = ClientStub.new nil, nil - Gapic::ServiceStub.stub :new, dummy_stub do - client = ::Google::Cloud::ResourceManager::V3::TagKeys::Operations.new do |config| - config.credentials = grpc_channel - end - end - - config = client.configure do |c| - block_config = c - end - - assert_same block_config, config - assert_kind_of ::Google::Cloud::ResourceManager::V3::TagKeys::Operations::Configuration, config - end -end diff --git a/owl-bot-staging/google-cloud-resource_manager-v3/test/google/cloud/resource_manager/v3/tag_keys_paths_test.rb b/owl-bot-staging/google-cloud-resource_manager-v3/test/google/cloud/resource_manager/v3/tag_keys_paths_test.rb deleted file mode 100644 index 3b9b1b258030..000000000000 --- a/owl-bot-staging/google-cloud-resource_manager-v3/test/google/cloud/resource_manager/v3/tag_keys_paths_test.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 "helper" - -require "gapic/grpc/service_stub" - -require "google/cloud/resource_manager/v3/tag_keys" - -class ::Google::Cloud::ResourceManager::V3::TagKeys::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_tag_key_path - grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - ::Gapic::ServiceStub.stub :new, DummyStub.new do - client = ::Google::Cloud::ResourceManager::V3::TagKeys::Client.new do |config| - config.credentials = grpc_channel - end - - path = client.tag_key_path tag_key: "value0" - assert_equal "tagKeys/value0", path - end - end -end diff --git a/owl-bot-staging/google-cloud-resource_manager-v3/test/google/cloud/resource_manager/v3/tag_keys_rest_test.rb b/owl-bot-staging/google-cloud-resource_manager-v3/test/google/cloud/resource_manager/v3/tag_keys_rest_test.rb deleted file mode 100644 index df8d4b17eb18..000000000000 --- a/owl-bot-staging/google-cloud-resource_manager-v3/test/google/cloud/resource_manager/v3/tag_keys_rest_test.rb +++ /dev/null @@ -1,596 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -require "helper" -require "gapic/rest" -require "google/cloud/resourcemanager/v3/tag_keys_pb" -require "google/cloud/resource_manager/v3/tag_keys/rest" - - -class ::Google::Cloud::ResourceManager::V3::TagKeys::Rest::ClientTest < Minitest::Test - class ClientStub - attr_accessor :call_count, :requests - - def initialize response, &block - @response = response - @block = block - @call_count = 0 - @requests = [] - end - - def make_get_request uri:, params: {}, options: {}, method_name: nil - make_http_request :get, uri: uri, body: nil, params: params, options: options, method_name: method_name - end - - def make_delete_request uri:, params: {}, options: {}, method_name: nil - make_http_request :delete, uri: uri, body: nil, params: params, options: options, method_name: method_name - end - - def make_post_request uri:, body: nil, params: {}, options: {}, method_name: nil - make_http_request :post, uri: uri, body: body, params: params, options: options, method_name: method_name - end - - def make_patch_request uri:, body:, params: {}, options: {}, method_name: nil - make_http_request :patch, uri: uri, body: body, params: params, options: options, method_name: method_name - end - - def make_put_request uri:, body:, params: {}, options: {}, method_name: nil - make_http_request :put, uri: uri, body: body, params: params, options: options, method_name: method_name - end - - def make_http_request *args, **kwargs - @call_count += 1 - - @requests << @block&.call(*args, **kwargs) - - @response - end - - def endpoint - "endpoint.example.com" - end - - def universe_domain - "example.com" - end - - def stub_logger - nil - end - - def logger - nil - end - end - - def test_list_tag_keys - # Create test objects. - client_result = ::Google::Cloud::ResourceManager::V3::ListTagKeysResponse.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_tag_keys_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| - assert options.metadata.key? :"x-goog-api-client" - assert options.metadata[:"x-goog-api-client"].include? "rest" - refute options.metadata[:"x-goog-api-client"].include? "grpc" - end - - ::Google::Cloud::ResourceManager::V3::TagKeys::Rest::ServiceStub.stub :transcode_list_tag_keys_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, list_tag_keys_client_stub do - # Create client - client = ::Google::Cloud::ResourceManager::V3::TagKeys::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - client.list_tag_keys({ 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_tag_keys 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_tag_keys ::Google::Cloud::ResourceManager::V3::ListTagKeysRequest.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_tag_keys({ 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_tag_keys(::Google::Cloud::ResourceManager::V3::ListTagKeysRequest.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_tag_keys_client_stub.call_count - end - end - end - - def test_get_tag_key - # Create test objects. - client_result = ::Google::Cloud::ResourceManager::V3::TagKey.new - http_response = OpenStruct.new body: client_result.to_json - - call_options = {} - - # Create request parameters for a unary method. - name = "hello world" - - get_tag_key_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| - assert options.metadata.key? :"x-goog-api-client" - assert options.metadata[:"x-goog-api-client"].include? "rest" - refute options.metadata[:"x-goog-api-client"].include? "grpc" - end - - ::Google::Cloud::ResourceManager::V3::TagKeys::Rest::ServiceStub.stub :transcode_get_tag_key_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, get_tag_key_client_stub do - # Create client - client = ::Google::Cloud::ResourceManager::V3::TagKeys::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - client.get_tag_key({ name: name }) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use named arguments - client.get_tag_key name: name do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object - client.get_tag_key ::Google::Cloud::ResourceManager::V3::GetTagKeyRequest.new(name: name) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use hash object with options - client.get_tag_key({ name: name }, call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object with options - client.get_tag_key(::Google::Cloud::ResourceManager::V3::GetTagKeyRequest.new(name: name), call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Verify method calls - assert_equal 5, get_tag_key_client_stub.call_count - end - end - end - - def test_get_namespaced_tag_key - # Create test objects. - client_result = ::Google::Cloud::ResourceManager::V3::TagKey.new - http_response = OpenStruct.new body: client_result.to_json - - call_options = {} - - # Create request parameters for a unary method. - name = "hello world" - - get_namespaced_tag_key_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| - assert options.metadata.key? :"x-goog-api-client" - assert options.metadata[:"x-goog-api-client"].include? "rest" - refute options.metadata[:"x-goog-api-client"].include? "grpc" - end - - ::Google::Cloud::ResourceManager::V3::TagKeys::Rest::ServiceStub.stub :transcode_get_namespaced_tag_key_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, get_namespaced_tag_key_client_stub do - # Create client - client = ::Google::Cloud::ResourceManager::V3::TagKeys::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - client.get_namespaced_tag_key({ name: name }) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use named arguments - client.get_namespaced_tag_key name: name do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object - client.get_namespaced_tag_key ::Google::Cloud::ResourceManager::V3::GetNamespacedTagKeyRequest.new(name: name) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use hash object with options - client.get_namespaced_tag_key({ name: name }, call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object with options - client.get_namespaced_tag_key(::Google::Cloud::ResourceManager::V3::GetNamespacedTagKeyRequest.new(name: name), call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Verify method calls - assert_equal 5, get_namespaced_tag_key_client_stub.call_count - end - end - end - - def test_create_tag_key - # 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. - tag_key = {} - validate_only = true - - create_tag_key_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| - assert options.metadata.key? :"x-goog-api-client" - assert options.metadata[:"x-goog-api-client"].include? "rest" - refute options.metadata[:"x-goog-api-client"].include? "grpc" - end - - ::Google::Cloud::ResourceManager::V3::TagKeys::Rest::ServiceStub.stub :transcode_create_tag_key_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, create_tag_key_client_stub do - # Create client - client = ::Google::Cloud::ResourceManager::V3::TagKeys::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - client.create_tag_key({ tag_key: tag_key, validate_only: validate_only }) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use named arguments - client.create_tag_key tag_key: tag_key, validate_only: validate_only do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object - client.create_tag_key ::Google::Cloud::ResourceManager::V3::CreateTagKeyRequest.new(tag_key: tag_key, validate_only: validate_only) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use hash object with options - client.create_tag_key({ tag_key: tag_key, validate_only: validate_only }, call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object with options - client.create_tag_key(::Google::Cloud::ResourceManager::V3::CreateTagKeyRequest.new(tag_key: tag_key, validate_only: validate_only), call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Verify method calls - assert_equal 5, create_tag_key_client_stub.call_count - end - end - end - - def test_update_tag_key - # 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. - tag_key = {} - update_mask = {} - validate_only = true - - update_tag_key_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| - assert options.metadata.key? :"x-goog-api-client" - assert options.metadata[:"x-goog-api-client"].include? "rest" - refute options.metadata[:"x-goog-api-client"].include? "grpc" - end - - ::Google::Cloud::ResourceManager::V3::TagKeys::Rest::ServiceStub.stub :transcode_update_tag_key_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, update_tag_key_client_stub do - # Create client - client = ::Google::Cloud::ResourceManager::V3::TagKeys::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - client.update_tag_key({ tag_key: tag_key, update_mask: update_mask, validate_only: validate_only }) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use named arguments - client.update_tag_key tag_key: tag_key, update_mask: update_mask, validate_only: validate_only do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object - client.update_tag_key ::Google::Cloud::ResourceManager::V3::UpdateTagKeyRequest.new(tag_key: tag_key, update_mask: update_mask, validate_only: validate_only) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use hash object with options - client.update_tag_key({ tag_key: tag_key, update_mask: update_mask, validate_only: validate_only }, call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object with options - client.update_tag_key(::Google::Cloud::ResourceManager::V3::UpdateTagKeyRequest.new(tag_key: tag_key, update_mask: update_mask, validate_only: validate_only), call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Verify method calls - assert_equal 5, update_tag_key_client_stub.call_count - end - end - end - - def test_delete_tag_key - # 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" - validate_only = true - etag = "hello world" - - delete_tag_key_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| - assert options.metadata.key? :"x-goog-api-client" - assert options.metadata[:"x-goog-api-client"].include? "rest" - refute options.metadata[:"x-goog-api-client"].include? "grpc" - end - - ::Google::Cloud::ResourceManager::V3::TagKeys::Rest::ServiceStub.stub :transcode_delete_tag_key_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, delete_tag_key_client_stub do - # Create client - client = ::Google::Cloud::ResourceManager::V3::TagKeys::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - client.delete_tag_key({ name: name, validate_only: validate_only, etag: etag }) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use named arguments - client.delete_tag_key name: name, validate_only: validate_only, etag: etag do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object - client.delete_tag_key ::Google::Cloud::ResourceManager::V3::DeleteTagKeyRequest.new(name: name, validate_only: validate_only, etag: etag) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use hash object with options - client.delete_tag_key({ name: name, validate_only: validate_only, etag: etag }, call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object with options - client.delete_tag_key(::Google::Cloud::ResourceManager::V3::DeleteTagKeyRequest.new(name: name, validate_only: validate_only, etag: etag), call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Verify method calls - assert_equal 5, delete_tag_key_client_stub.call_count - end - end - end - - def test_get_iam_policy - # Create test objects. - client_result = ::Google::Iam::V1::Policy.new - http_response = OpenStruct.new body: client_result.to_json - - call_options = {} - - # Create request parameters for a unary method. - resource = "hello world" - options = {} - - get_iam_policy_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| - assert options.metadata.key? :"x-goog-api-client" - assert options.metadata[:"x-goog-api-client"].include? "rest" - refute options.metadata[:"x-goog-api-client"].include? "grpc" - end - - ::Google::Cloud::ResourceManager::V3::TagKeys::Rest::ServiceStub.stub :transcode_get_iam_policy_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, get_iam_policy_client_stub do - # Create client - client = ::Google::Cloud::ResourceManager::V3::TagKeys::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - client.get_iam_policy({ resource: resource, options: options }) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use named arguments - client.get_iam_policy resource: resource, options: options do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object - client.get_iam_policy ::Google::Iam::V1::GetIamPolicyRequest.new(resource: resource, options: options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use hash object with options - client.get_iam_policy({ resource: resource, options: options }, call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object with options - client.get_iam_policy(::Google::Iam::V1::GetIamPolicyRequest.new(resource: resource, options: options), call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Verify method calls - assert_equal 5, get_iam_policy_client_stub.call_count - end - end - end - - def test_set_iam_policy - # Create test objects. - client_result = ::Google::Iam::V1::Policy.new - http_response = OpenStruct.new body: client_result.to_json - - call_options = {} - - # Create request parameters for a unary method. - resource = "hello world" - policy = {} - update_mask = {} - - set_iam_policy_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| - assert options.metadata.key? :"x-goog-api-client" - assert options.metadata[:"x-goog-api-client"].include? "rest" - refute options.metadata[:"x-goog-api-client"].include? "grpc" - end - - ::Google::Cloud::ResourceManager::V3::TagKeys::Rest::ServiceStub.stub :transcode_set_iam_policy_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, set_iam_policy_client_stub do - # Create client - client = ::Google::Cloud::ResourceManager::V3::TagKeys::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - client.set_iam_policy({ resource: resource, policy: policy, update_mask: update_mask }) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use named arguments - client.set_iam_policy resource: resource, policy: policy, update_mask: update_mask do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object - client.set_iam_policy ::Google::Iam::V1::SetIamPolicyRequest.new(resource: resource, policy: policy, update_mask: update_mask) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use hash object with options - client.set_iam_policy({ resource: resource, policy: policy, update_mask: update_mask }, call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object with options - client.set_iam_policy(::Google::Iam::V1::SetIamPolicyRequest.new(resource: resource, policy: policy, update_mask: update_mask), call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Verify method calls - assert_equal 5, set_iam_policy_client_stub.call_count - end - end - end - - def test_test_iam_permissions - # Create test objects. - client_result = ::Google::Iam::V1::TestIamPermissionsResponse.new - http_response = OpenStruct.new body: client_result.to_json - - call_options = {} - - # Create request parameters for a unary method. - resource = "hello world" - permissions = ["hello world"] - - test_iam_permissions_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| - assert options.metadata.key? :"x-goog-api-client" - assert options.metadata[:"x-goog-api-client"].include? "rest" - refute options.metadata[:"x-goog-api-client"].include? "grpc" - end - - ::Google::Cloud::ResourceManager::V3::TagKeys::Rest::ServiceStub.stub :transcode_test_iam_permissions_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, test_iam_permissions_client_stub do - # Create client - client = ::Google::Cloud::ResourceManager::V3::TagKeys::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - client.test_iam_permissions({ resource: resource, permissions: permissions }) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use named arguments - client.test_iam_permissions resource: resource, permissions: permissions do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object - client.test_iam_permissions ::Google::Iam::V1::TestIamPermissionsRequest.new(resource: resource, permissions: permissions) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use hash object with options - client.test_iam_permissions({ resource: resource, permissions: permissions }, call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object with options - client.test_iam_permissions(::Google::Iam::V1::TestIamPermissionsRequest.new(resource: resource, permissions: permissions), call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Verify method calls - assert_equal 5, test_iam_permissions_client_stub.call_count - end - end - end - - def test_configure - credentials_token = :dummy_value - - client = block_config = config = nil - dummy_stub = ClientStub.new nil - Gapic::Rest::ClientStub.stub :new, dummy_stub do - client = ::Google::Cloud::ResourceManager::V3::TagKeys::Rest::Client.new do |config| - config.credentials = credentials_token - end - end - - config = client.configure do |c| - block_config = c - end - - assert_same block_config, config - assert_kind_of ::Google::Cloud::ResourceManager::V3::TagKeys::Rest::Client::Configuration, config - end -end diff --git a/owl-bot-staging/google-cloud-resource_manager-v3/test/google/cloud/resource_manager/v3/tag_keys_test.rb b/owl-bot-staging/google-cloud-resource_manager-v3/test/google/cloud/resource_manager/v3/tag_keys_test.rb deleted file mode 100644 index 60e31fc80d1f..000000000000 --- a/owl-bot-staging/google-cloud-resource_manager-v3/test/google/cloud/resource_manager/v3/tag_keys_test.rb +++ /dev/null @@ -1,682 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -require "helper" - -require "gapic/grpc/service_stub" - -require "google/cloud/resourcemanager/v3/tag_keys_pb" -require "google/cloud/resource_manager/v3/tag_keys" - -class ::Google::Cloud::ResourceManager::V3::TagKeys::ClientTest < Minitest::Test - class ClientStub - attr_accessor :call_rpc_count, :requests - - def initialize response, operation, &block - @response = response - @operation = operation - @block = block - @call_rpc_count = 0 - @requests = [] - end - - def call_rpc *args, **kwargs - @call_rpc_count += 1 - - @requests << @block&.call(*args, **kwargs) - - catch :response do - yield @response, @operation if block_given? - @response - end - end - - def endpoint - "endpoint.example.com" - end - - def universe_domain - "example.com" - end - - def stub_logger - nil - end - - def logger - nil - end - end - - def test_list_tag_keys - # Create GRPC objects. - grpc_response = ::Google::Cloud::ResourceManager::V3::ListTagKeysResponse.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_tag_keys_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :list_tag_keys, name - assert_kind_of ::Google::Cloud::ResourceManager::V3::ListTagKeysRequest, 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_tag_keys_client_stub do - # Create client - client = ::Google::Cloud::ResourceManager::V3::TagKeys::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.list_tag_keys({ 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_tag_keys 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_tag_keys ::Google::Cloud::ResourceManager::V3::ListTagKeysRequest.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_tag_keys({ 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_tag_keys(::Google::Cloud::ResourceManager::V3::ListTagKeysRequest.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_tag_keys_client_stub.call_rpc_count - end - end - - def test_get_tag_key - # Create GRPC objects. - grpc_response = ::Google::Cloud::ResourceManager::V3::TagKey.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_tag_key_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :get_tag_key, name - assert_kind_of ::Google::Cloud::ResourceManager::V3::GetTagKeyRequest, request - assert_equal "hello world", request["name"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, get_tag_key_client_stub do - # Create client - client = ::Google::Cloud::ResourceManager::V3::TagKeys::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.get_tag_key({ name: name }) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use named arguments - client.get_tag_key name: name do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object - client.get_tag_key ::Google::Cloud::ResourceManager::V3::GetTagKeyRequest.new(name: name) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use hash object with options - client.get_tag_key({ 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_tag_key(::Google::Cloud::ResourceManager::V3::GetTagKeyRequest.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_tag_key_client_stub.call_rpc_count - end - end - - def test_get_namespaced_tag_key - # Create GRPC objects. - grpc_response = ::Google::Cloud::ResourceManager::V3::TagKey.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_namespaced_tag_key_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :get_namespaced_tag_key, name - assert_kind_of ::Google::Cloud::ResourceManager::V3::GetNamespacedTagKeyRequest, request - assert_equal "hello world", request["name"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, get_namespaced_tag_key_client_stub do - # Create client - client = ::Google::Cloud::ResourceManager::V3::TagKeys::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.get_namespaced_tag_key({ name: name }) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use named arguments - client.get_namespaced_tag_key name: name do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object - client.get_namespaced_tag_key ::Google::Cloud::ResourceManager::V3::GetNamespacedTagKeyRequest.new(name: name) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use hash object with options - client.get_namespaced_tag_key({ 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_namespaced_tag_key(::Google::Cloud::ResourceManager::V3::GetNamespacedTagKeyRequest.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_namespaced_tag_key_client_stub.call_rpc_count - end - end - - def test_create_tag_key - # 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. - tag_key = {} - validate_only = true - - create_tag_key_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :create_tag_key, name - assert_kind_of ::Google::Cloud::ResourceManager::V3::CreateTagKeyRequest, request - assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::ResourceManager::V3::TagKey), request["tag_key"] - assert_equal true, request["validate_only"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, create_tag_key_client_stub do - # Create client - client = ::Google::Cloud::ResourceManager::V3::TagKeys::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.create_tag_key({ tag_key: tag_key, 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_tag_key tag_key: tag_key, 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_tag_key ::Google::Cloud::ResourceManager::V3::CreateTagKeyRequest.new(tag_key: tag_key, 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_tag_key({ tag_key: tag_key, 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_tag_key(::Google::Cloud::ResourceManager::V3::CreateTagKeyRequest.new(tag_key: tag_key, 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_tag_key_client_stub.call_rpc_count - end - end - - def test_update_tag_key - # 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. - tag_key = {} - update_mask = {} - validate_only = true - - update_tag_key_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :update_tag_key, name - assert_kind_of ::Google::Cloud::ResourceManager::V3::UpdateTagKeyRequest, request - assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::ResourceManager::V3::TagKey), request["tag_key"] - assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Protobuf::FieldMask), request["update_mask"] - assert_equal true, request["validate_only"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, update_tag_key_client_stub do - # Create client - client = ::Google::Cloud::ResourceManager::V3::TagKeys::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.update_tag_key({ tag_key: tag_key, update_mask: update_mask, 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_tag_key tag_key: tag_key, update_mask: update_mask, 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_tag_key ::Google::Cloud::ResourceManager::V3::UpdateTagKeyRequest.new(tag_key: tag_key, update_mask: update_mask, 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_tag_key({ tag_key: tag_key, update_mask: update_mask, 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_tag_key(::Google::Cloud::ResourceManager::V3::UpdateTagKeyRequest.new(tag_key: tag_key, update_mask: update_mask, 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_tag_key_client_stub.call_rpc_count - end - end - - def test_delete_tag_key - # 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" - validate_only = true - etag = "hello world" - - delete_tag_key_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :delete_tag_key, name - assert_kind_of ::Google::Cloud::ResourceManager::V3::DeleteTagKeyRequest, request - assert_equal "hello world", request["name"] - assert_equal true, request["validate_only"] - assert_equal "hello world", request["etag"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, delete_tag_key_client_stub do - # Create client - client = ::Google::Cloud::ResourceManager::V3::TagKeys::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.delete_tag_key({ name: name, validate_only: validate_only, etag: etag }) 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_tag_key name: name, validate_only: validate_only, etag: etag 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_tag_key ::Google::Cloud::ResourceManager::V3::DeleteTagKeyRequest.new(name: name, validate_only: validate_only, etag: etag) 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_tag_key({ name: name, validate_only: validate_only, etag: etag }, 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_tag_key(::Google::Cloud::ResourceManager::V3::DeleteTagKeyRequest.new(name: name, validate_only: validate_only, etag: etag), 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_tag_key_client_stub.call_rpc_count - end - end - - def test_get_iam_policy - # Create GRPC objects. - grpc_response = ::Google::Iam::V1::Policy.new - grpc_operation = GRPC::ActiveCall::Operation.new nil - grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - grpc_options = {} - - # Create request parameters for a unary method. - resource = "hello world" - options = {} - - get_iam_policy_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :get_iam_policy, name - assert_kind_of ::Google::Iam::V1::GetIamPolicyRequest, request - assert_equal "hello world", request["resource"] - assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Iam::V1::GetPolicyOptions), request["options"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, get_iam_policy_client_stub do - # Create client - client = ::Google::Cloud::ResourceManager::V3::TagKeys::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.get_iam_policy({ resource: resource, options: options }) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use named arguments - client.get_iam_policy resource: resource, options: options do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object - client.get_iam_policy ::Google::Iam::V1::GetIamPolicyRequest.new(resource: resource, options: options) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use hash object with options - client.get_iam_policy({ resource: resource, options: options }, grpc_options) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object with options - client.get_iam_policy(::Google::Iam::V1::GetIamPolicyRequest.new(resource: resource, options: options), grpc_options) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Verify method calls - assert_equal 5, get_iam_policy_client_stub.call_rpc_count - end - end - - def test_set_iam_policy - # Create GRPC objects. - grpc_response = ::Google::Iam::V1::Policy.new - grpc_operation = GRPC::ActiveCall::Operation.new nil - grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - grpc_options = {} - - # Create request parameters for a unary method. - resource = "hello world" - policy = {} - update_mask = {} - - set_iam_policy_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :set_iam_policy, name - assert_kind_of ::Google::Iam::V1::SetIamPolicyRequest, request - assert_equal "hello world", request["resource"] - assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Iam::V1::Policy), request["policy"] - assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Protobuf::FieldMask), request["update_mask"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, set_iam_policy_client_stub do - # Create client - client = ::Google::Cloud::ResourceManager::V3::TagKeys::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.set_iam_policy({ resource: resource, policy: policy, update_mask: update_mask }) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use named arguments - client.set_iam_policy resource: resource, policy: policy, update_mask: update_mask do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object - client.set_iam_policy ::Google::Iam::V1::SetIamPolicyRequest.new(resource: resource, policy: policy, update_mask: update_mask) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use hash object with options - client.set_iam_policy({ resource: resource, policy: policy, update_mask: update_mask }, grpc_options) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object with options - client.set_iam_policy(::Google::Iam::V1::SetIamPolicyRequest.new(resource: resource, policy: policy, update_mask: update_mask), grpc_options) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Verify method calls - assert_equal 5, set_iam_policy_client_stub.call_rpc_count - end - end - - def test_test_iam_permissions - # Create GRPC objects. - grpc_response = ::Google::Iam::V1::TestIamPermissionsResponse.new - grpc_operation = GRPC::ActiveCall::Operation.new nil - grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - grpc_options = {} - - # Create request parameters for a unary method. - resource = "hello world" - permissions = ["hello world"] - - test_iam_permissions_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :test_iam_permissions, name - assert_kind_of ::Google::Iam::V1::TestIamPermissionsRequest, request - assert_equal "hello world", request["resource"] - assert_equal ["hello world"], request["permissions"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, test_iam_permissions_client_stub do - # Create client - client = ::Google::Cloud::ResourceManager::V3::TagKeys::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.test_iam_permissions({ resource: resource, permissions: permissions }) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use named arguments - client.test_iam_permissions resource: resource, permissions: permissions do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object - client.test_iam_permissions ::Google::Iam::V1::TestIamPermissionsRequest.new(resource: resource, permissions: permissions) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use hash object with options - client.test_iam_permissions({ resource: resource, permissions: permissions }, grpc_options) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object with options - client.test_iam_permissions(::Google::Iam::V1::TestIamPermissionsRequest.new(resource: resource, permissions: permissions), grpc_options) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Verify method calls - assert_equal 5, test_iam_permissions_client_stub.call_rpc_count - end - end - - def test_configure - grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - - client = block_config = config = nil - dummy_stub = ClientStub.new nil, nil - Gapic::ServiceStub.stub :new, dummy_stub do - client = ::Google::Cloud::ResourceManager::V3::TagKeys::Client.new do |config| - config.credentials = grpc_channel - end - end - - config = client.configure do |c| - block_config = c - end - - assert_same block_config, config - assert_kind_of ::Google::Cloud::ResourceManager::V3::TagKeys::Client::Configuration, config - end - - def test_credentials - key = OpenSSL::PKey::RSA.new 2048 - cred_json = { - "private_key" => key.to_pem, - "client_email" => "app@developer.gserviceaccount.com", - "type" => "service_account" - } - key_file = StringIO.new cred_json.to_json - creds = Google::Auth::ServiceAccountCredentials.make_creds({ json_key_io: key_file }) - - dummy_stub = ClientStub.new nil, nil - Gapic::ServiceStub.stub :new, dummy_stub do - client = ::Google::Cloud::ResourceManager::V3::TagKeys::Client.new do |config| - config.credentials = creds - end - assert_kind_of ::Google::Cloud::ResourceManager::V3::TagKeys::Client, client - assert_equal creds, client.configure.credentials - end - end - - def test_operations_client - grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - - client = nil - dummy_stub = ClientStub.new nil, nil - Gapic::ServiceStub.stub :new, dummy_stub do - client = ::Google::Cloud::ResourceManager::V3::TagKeys::Client.new do |config| - config.credentials = grpc_channel - end - end - - assert_kind_of ::Google::Cloud::ResourceManager::V3::TagKeys::Operations, client.operations_client - end -end diff --git a/owl-bot-staging/google-cloud-resource_manager-v3/test/google/cloud/resource_manager/v3/tag_values_operations_test.rb b/owl-bot-staging/google-cloud-resource_manager-v3/test/google/cloud/resource_manager/v3/tag_values_operations_test.rb deleted file mode 100644 index 392537d303dc..000000000000 --- a/owl-bot-staging/google-cloud-resource_manager-v3/test/google/cloud/resource_manager/v3/tag_values_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/cloud/resourcemanager/v3/tag_values_pb" -require "google/cloud/resourcemanager/v3/tag_values_services_pb" -require "google/cloud/resource_manager/v3/tag_values" - -class ::Google::Cloud::ResourceManager::V3::TagValues::OperationsTest < Minitest::Test - class ClientStub - attr_accessor :call_rpc_count, :requests - - def initialize response, operation, &block - @response = response - @operation = operation - @block = block - @call_rpc_count = 0 - @requests = [] - end - - def call_rpc *args, **kwargs - @call_rpc_count += 1 - - @requests << @block&.call(*args, **kwargs) - - catch :response do - yield @response, @operation if block_given? - @response - end - end - - def endpoint - "endpoint.example.com" - end - - def universe_domain - "example.com" - end - - def stub_logger - nil - end - - def logger - nil - end - end - - def test_list_operations - # Create GRPC objects. - grpc_response = ::Google::Longrunning::ListOperationsResponse.new - grpc_operation = GRPC::ActiveCall::Operation.new nil - grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - grpc_options = {} - - # Create request parameters for a unary method. - name = "hello world" - filter = "hello world" - page_size = 42 - page_token = "hello world" - return_partial_success = true - - list_operations_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :list_operations, name - assert_kind_of ::Google::Longrunning::ListOperationsRequest, request - assert_equal "hello world", request["name"] - assert_equal "hello world", request["filter"] - assert_equal 42, request["page_size"] - assert_equal "hello world", request["page_token"] - assert_equal true, request["return_partial_success"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, list_operations_client_stub do - # Create client - client = ::Google::Cloud::ResourceManager::V3::TagValues::Operations.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.list_operations({ name: name, filter: filter, page_size: page_size, page_token: page_token, return_partial_success: return_partial_success }) do |response, operation| - assert_kind_of Gapic::PagedEnumerable, response - assert_equal grpc_response, response.response - assert_equal grpc_operation, operation - end - - # Use named arguments - client.list_operations name: name, filter: filter, page_size: page_size, page_token: page_token, return_partial_success: return_partial_success do |response, operation| - assert_kind_of Gapic::PagedEnumerable, response - assert_equal grpc_response, response.response - assert_equal grpc_operation, operation - end - - # Use protobuf object - client.list_operations ::Google::Longrunning::ListOperationsRequest.new(name: name, filter: filter, page_size: page_size, page_token: page_token, return_partial_success: return_partial_success) do |response, operation| - assert_kind_of Gapic::PagedEnumerable, response - assert_equal grpc_response, response.response - assert_equal grpc_operation, operation - end - - # Use hash object with options - client.list_operations({ name: name, filter: filter, page_size: page_size, page_token: page_token, return_partial_success: return_partial_success }, grpc_options) do |response, operation| - assert_kind_of Gapic::PagedEnumerable, response - assert_equal grpc_response, response.response - assert_equal grpc_operation, operation - end - - # Use protobuf object with options - client.list_operations(::Google::Longrunning::ListOperationsRequest.new(name: name, filter: filter, page_size: page_size, page_token: page_token, return_partial_success: return_partial_success), grpc_options) do |response, operation| - assert_kind_of Gapic::PagedEnumerable, response - assert_equal grpc_response, response.response - assert_equal grpc_operation, operation - end - - # Verify method calls - assert_equal 5, list_operations_client_stub.call_rpc_count - end - end - - def test_get_operation - # Create GRPC objects. - grpc_response = ::Google::Longrunning::Operation.new - grpc_operation = GRPC::ActiveCall::Operation.new nil - grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - grpc_options = {} - - # Create request parameters for a unary method. - name = "hello world" - - get_operation_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :get_operation, name - assert_kind_of ::Google::Longrunning::GetOperationRequest, request - assert_equal "hello world", request["name"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, get_operation_client_stub do - # Create client - client = ::Google::Cloud::ResourceManager::V3::TagValues::Operations.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.get_operation({ name: name }) do |response, operation| - assert_kind_of Gapic::Operation, response - assert_equal grpc_response, response.grpc_op - assert_equal grpc_operation, operation - end - - # Use named arguments - client.get_operation name: name do |response, operation| - assert_kind_of Gapic::Operation, response - assert_equal grpc_response, response.grpc_op - assert_equal grpc_operation, operation - end - - # Use protobuf object - client.get_operation ::Google::Longrunning::GetOperationRequest.new(name: name) do |response, operation| - assert_kind_of Gapic::Operation, response - assert_equal grpc_response, response.grpc_op - assert_equal grpc_operation, operation - end - - # Use hash object with options - client.get_operation({ name: name }, grpc_options) do |response, operation| - assert_kind_of Gapic::Operation, response - assert_equal grpc_response, response.grpc_op - assert_equal grpc_operation, operation - end - - # Use protobuf object with options - client.get_operation(::Google::Longrunning::GetOperationRequest.new(name: name), grpc_options) do |response, operation| - assert_kind_of Gapic::Operation, response - assert_equal grpc_response, response.grpc_op - assert_equal grpc_operation, operation - end - - # Verify method calls - assert_equal 5, get_operation_client_stub.call_rpc_count - end - end - - def test_delete_operation - # Create GRPC objects. - grpc_response = ::Google::Protobuf::Empty.new - grpc_operation = GRPC::ActiveCall::Operation.new nil - grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - grpc_options = {} - - # Create request parameters for a unary method. - name = "hello world" - - delete_operation_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :delete_operation, name - assert_kind_of ::Google::Longrunning::DeleteOperationRequest, request - assert_equal "hello world", request["name"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, delete_operation_client_stub do - # Create client - client = ::Google::Cloud::ResourceManager::V3::TagValues::Operations.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.delete_operation({ name: name }) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use named arguments - client.delete_operation name: name do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object - client.delete_operation ::Google::Longrunning::DeleteOperationRequest.new(name: name) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use hash object with options - client.delete_operation({ name: name }, grpc_options) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object with options - client.delete_operation(::Google::Longrunning::DeleteOperationRequest.new(name: name), grpc_options) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Verify method calls - assert_equal 5, delete_operation_client_stub.call_rpc_count - end - end - - def test_cancel_operation - # Create GRPC objects. - grpc_response = ::Google::Protobuf::Empty.new - grpc_operation = GRPC::ActiveCall::Operation.new nil - grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - grpc_options = {} - - # Create request parameters for a unary method. - name = "hello world" - - cancel_operation_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :cancel_operation, name - assert_kind_of ::Google::Longrunning::CancelOperationRequest, request - assert_equal "hello world", request["name"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, cancel_operation_client_stub do - # Create client - client = ::Google::Cloud::ResourceManager::V3::TagValues::Operations.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.cancel_operation({ name: name }) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use named arguments - client.cancel_operation name: name do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object - client.cancel_operation ::Google::Longrunning::CancelOperationRequest.new(name: name) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use hash object with options - client.cancel_operation({ name: name }, grpc_options) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object with options - client.cancel_operation(::Google::Longrunning::CancelOperationRequest.new(name: name), grpc_options) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Verify method calls - assert_equal 5, cancel_operation_client_stub.call_rpc_count - end - end - - def test_wait_operation - # Create GRPC objects. - grpc_response = ::Google::Longrunning::Operation.new - grpc_operation = GRPC::ActiveCall::Operation.new nil - grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - grpc_options = {} - - # Create request parameters for a unary method. - name = "hello world" - timeout = {} - - wait_operation_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :wait_operation, name - assert_kind_of ::Google::Longrunning::WaitOperationRequest, request - assert_equal "hello world", request["name"] - assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Protobuf::Duration), request["timeout"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, wait_operation_client_stub do - # Create client - client = ::Google::Cloud::ResourceManager::V3::TagValues::Operations.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.wait_operation({ name: name, timeout: timeout }) do |response, operation| - assert_kind_of Gapic::Operation, response - assert_equal grpc_response, response.grpc_op - assert_equal grpc_operation, operation - end - - # Use named arguments - client.wait_operation name: name, timeout: timeout do |response, operation| - assert_kind_of Gapic::Operation, response - assert_equal grpc_response, response.grpc_op - assert_equal grpc_operation, operation - end - - # Use protobuf object - client.wait_operation ::Google::Longrunning::WaitOperationRequest.new(name: name, timeout: timeout) do |response, operation| - assert_kind_of Gapic::Operation, response - assert_equal grpc_response, response.grpc_op - assert_equal grpc_operation, operation - end - - # Use hash object with options - client.wait_operation({ name: name, timeout: timeout }, grpc_options) do |response, operation| - assert_kind_of Gapic::Operation, response - assert_equal grpc_response, response.grpc_op - assert_equal grpc_operation, operation - end - - # Use protobuf object with options - client.wait_operation(::Google::Longrunning::WaitOperationRequest.new(name: name, timeout: timeout), grpc_options) do |response, operation| - assert_kind_of Gapic::Operation, response - assert_equal grpc_response, response.grpc_op - assert_equal grpc_operation, operation - end - - # Verify method calls - assert_equal 5, wait_operation_client_stub.call_rpc_count - end - end - - def test_configure - grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - - client = block_config = config = nil - dummy_stub = ClientStub.new nil, nil - Gapic::ServiceStub.stub :new, dummy_stub do - client = ::Google::Cloud::ResourceManager::V3::TagValues::Operations.new do |config| - config.credentials = grpc_channel - end - end - - config = client.configure do |c| - block_config = c - end - - assert_same block_config, config - assert_kind_of ::Google::Cloud::ResourceManager::V3::TagValues::Operations::Configuration, config - end -end diff --git a/owl-bot-staging/google-cloud-resource_manager-v3/test/google/cloud/resource_manager/v3/tag_values_paths_test.rb b/owl-bot-staging/google-cloud-resource_manager-v3/test/google/cloud/resource_manager/v3/tag_values_paths_test.rb deleted file mode 100644 index b40a31dac3dd..000000000000 --- a/owl-bot-staging/google-cloud-resource_manager-v3/test/google/cloud/resource_manager/v3/tag_values_paths_test.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 "helper" - -require "gapic/grpc/service_stub" - -require "google/cloud/resource_manager/v3/tag_values" - -class ::Google::Cloud::ResourceManager::V3::TagValues::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_tag_value_path - grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - ::Gapic::ServiceStub.stub :new, DummyStub.new do - client = ::Google::Cloud::ResourceManager::V3::TagValues::Client.new do |config| - config.credentials = grpc_channel - end - - path = client.tag_value_path tag_value: "value0" - assert_equal "tagValues/value0", path - end - end -end diff --git a/owl-bot-staging/google-cloud-resource_manager-v3/test/google/cloud/resource_manager/v3/tag_values_rest_test.rb b/owl-bot-staging/google-cloud-resource_manager-v3/test/google/cloud/resource_manager/v3/tag_values_rest_test.rb deleted file mode 100644 index b683e106ec9a..000000000000 --- a/owl-bot-staging/google-cloud-resource_manager-v3/test/google/cloud/resource_manager/v3/tag_values_rest_test.rb +++ /dev/null @@ -1,596 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -require "helper" -require "gapic/rest" -require "google/cloud/resourcemanager/v3/tag_values_pb" -require "google/cloud/resource_manager/v3/tag_values/rest" - - -class ::Google::Cloud::ResourceManager::V3::TagValues::Rest::ClientTest < Minitest::Test - class ClientStub - attr_accessor :call_count, :requests - - def initialize response, &block - @response = response - @block = block - @call_count = 0 - @requests = [] - end - - def make_get_request uri:, params: {}, options: {}, method_name: nil - make_http_request :get, uri: uri, body: nil, params: params, options: options, method_name: method_name - end - - def make_delete_request uri:, params: {}, options: {}, method_name: nil - make_http_request :delete, uri: uri, body: nil, params: params, options: options, method_name: method_name - end - - def make_post_request uri:, body: nil, params: {}, options: {}, method_name: nil - make_http_request :post, uri: uri, body: body, params: params, options: options, method_name: method_name - end - - def make_patch_request uri:, body:, params: {}, options: {}, method_name: nil - make_http_request :patch, uri: uri, body: body, params: params, options: options, method_name: method_name - end - - def make_put_request uri:, body:, params: {}, options: {}, method_name: nil - make_http_request :put, uri: uri, body: body, params: params, options: options, method_name: method_name - end - - def make_http_request *args, **kwargs - @call_count += 1 - - @requests << @block&.call(*args, **kwargs) - - @response - end - - def endpoint - "endpoint.example.com" - end - - def universe_domain - "example.com" - end - - def stub_logger - nil - end - - def logger - nil - end - end - - def test_list_tag_values - # Create test objects. - client_result = ::Google::Cloud::ResourceManager::V3::ListTagValuesResponse.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_tag_values_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| - assert options.metadata.key? :"x-goog-api-client" - assert options.metadata[:"x-goog-api-client"].include? "rest" - refute options.metadata[:"x-goog-api-client"].include? "grpc" - end - - ::Google::Cloud::ResourceManager::V3::TagValues::Rest::ServiceStub.stub :transcode_list_tag_values_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, list_tag_values_client_stub do - # Create client - client = ::Google::Cloud::ResourceManager::V3::TagValues::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - client.list_tag_values({ 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_tag_values 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_tag_values ::Google::Cloud::ResourceManager::V3::ListTagValuesRequest.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_tag_values({ 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_tag_values(::Google::Cloud::ResourceManager::V3::ListTagValuesRequest.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_tag_values_client_stub.call_count - end - end - end - - def test_get_tag_value - # Create test objects. - client_result = ::Google::Cloud::ResourceManager::V3::TagValue.new - http_response = OpenStruct.new body: client_result.to_json - - call_options = {} - - # Create request parameters for a unary method. - name = "hello world" - - get_tag_value_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| - assert options.metadata.key? :"x-goog-api-client" - assert options.metadata[:"x-goog-api-client"].include? "rest" - refute options.metadata[:"x-goog-api-client"].include? "grpc" - end - - ::Google::Cloud::ResourceManager::V3::TagValues::Rest::ServiceStub.stub :transcode_get_tag_value_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, get_tag_value_client_stub do - # Create client - client = ::Google::Cloud::ResourceManager::V3::TagValues::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - client.get_tag_value({ name: name }) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use named arguments - client.get_tag_value name: name do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object - client.get_tag_value ::Google::Cloud::ResourceManager::V3::GetTagValueRequest.new(name: name) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use hash object with options - client.get_tag_value({ name: name }, call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object with options - client.get_tag_value(::Google::Cloud::ResourceManager::V3::GetTagValueRequest.new(name: name), call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Verify method calls - assert_equal 5, get_tag_value_client_stub.call_count - end - end - end - - def test_get_namespaced_tag_value - # Create test objects. - client_result = ::Google::Cloud::ResourceManager::V3::TagValue.new - http_response = OpenStruct.new body: client_result.to_json - - call_options = {} - - # Create request parameters for a unary method. - name = "hello world" - - get_namespaced_tag_value_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| - assert options.metadata.key? :"x-goog-api-client" - assert options.metadata[:"x-goog-api-client"].include? "rest" - refute options.metadata[:"x-goog-api-client"].include? "grpc" - end - - ::Google::Cloud::ResourceManager::V3::TagValues::Rest::ServiceStub.stub :transcode_get_namespaced_tag_value_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, get_namespaced_tag_value_client_stub do - # Create client - client = ::Google::Cloud::ResourceManager::V3::TagValues::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - client.get_namespaced_tag_value({ name: name }) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use named arguments - client.get_namespaced_tag_value name: name do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object - client.get_namespaced_tag_value ::Google::Cloud::ResourceManager::V3::GetNamespacedTagValueRequest.new(name: name) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use hash object with options - client.get_namespaced_tag_value({ name: name }, call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object with options - client.get_namespaced_tag_value(::Google::Cloud::ResourceManager::V3::GetNamespacedTagValueRequest.new(name: name), call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Verify method calls - assert_equal 5, get_namespaced_tag_value_client_stub.call_count - end - end - end - - def test_create_tag_value - # 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. - tag_value = {} - validate_only = true - - create_tag_value_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| - assert options.metadata.key? :"x-goog-api-client" - assert options.metadata[:"x-goog-api-client"].include? "rest" - refute options.metadata[:"x-goog-api-client"].include? "grpc" - end - - ::Google::Cloud::ResourceManager::V3::TagValues::Rest::ServiceStub.stub :transcode_create_tag_value_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, create_tag_value_client_stub do - # Create client - client = ::Google::Cloud::ResourceManager::V3::TagValues::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - client.create_tag_value({ tag_value: tag_value, validate_only: validate_only }) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use named arguments - client.create_tag_value tag_value: tag_value, validate_only: validate_only do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object - client.create_tag_value ::Google::Cloud::ResourceManager::V3::CreateTagValueRequest.new(tag_value: tag_value, validate_only: validate_only) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use hash object with options - client.create_tag_value({ tag_value: tag_value, validate_only: validate_only }, call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object with options - client.create_tag_value(::Google::Cloud::ResourceManager::V3::CreateTagValueRequest.new(tag_value: tag_value, validate_only: validate_only), call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Verify method calls - assert_equal 5, create_tag_value_client_stub.call_count - end - end - end - - def test_update_tag_value - # 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. - tag_value = {} - update_mask = {} - validate_only = true - - update_tag_value_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| - assert options.metadata.key? :"x-goog-api-client" - assert options.metadata[:"x-goog-api-client"].include? "rest" - refute options.metadata[:"x-goog-api-client"].include? "grpc" - end - - ::Google::Cloud::ResourceManager::V3::TagValues::Rest::ServiceStub.stub :transcode_update_tag_value_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, update_tag_value_client_stub do - # Create client - client = ::Google::Cloud::ResourceManager::V3::TagValues::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - client.update_tag_value({ tag_value: tag_value, update_mask: update_mask, validate_only: validate_only }) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use named arguments - client.update_tag_value tag_value: tag_value, update_mask: update_mask, validate_only: validate_only do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object - client.update_tag_value ::Google::Cloud::ResourceManager::V3::UpdateTagValueRequest.new(tag_value: tag_value, update_mask: update_mask, validate_only: validate_only) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use hash object with options - client.update_tag_value({ tag_value: tag_value, update_mask: update_mask, validate_only: validate_only }, call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object with options - client.update_tag_value(::Google::Cloud::ResourceManager::V3::UpdateTagValueRequest.new(tag_value: tag_value, update_mask: update_mask, validate_only: validate_only), call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Verify method calls - assert_equal 5, update_tag_value_client_stub.call_count - end - end - end - - def test_delete_tag_value - # 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" - validate_only = true - etag = "hello world" - - delete_tag_value_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| - assert options.metadata.key? :"x-goog-api-client" - assert options.metadata[:"x-goog-api-client"].include? "rest" - refute options.metadata[:"x-goog-api-client"].include? "grpc" - end - - ::Google::Cloud::ResourceManager::V3::TagValues::Rest::ServiceStub.stub :transcode_delete_tag_value_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, delete_tag_value_client_stub do - # Create client - client = ::Google::Cloud::ResourceManager::V3::TagValues::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - client.delete_tag_value({ name: name, validate_only: validate_only, etag: etag }) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use named arguments - client.delete_tag_value name: name, validate_only: validate_only, etag: etag do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object - client.delete_tag_value ::Google::Cloud::ResourceManager::V3::DeleteTagValueRequest.new(name: name, validate_only: validate_only, etag: etag) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use hash object with options - client.delete_tag_value({ name: name, validate_only: validate_only, etag: etag }, call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object with options - client.delete_tag_value(::Google::Cloud::ResourceManager::V3::DeleteTagValueRequest.new(name: name, validate_only: validate_only, etag: etag), call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Verify method calls - assert_equal 5, delete_tag_value_client_stub.call_count - end - end - end - - def test_get_iam_policy - # Create test objects. - client_result = ::Google::Iam::V1::Policy.new - http_response = OpenStruct.new body: client_result.to_json - - call_options = {} - - # Create request parameters for a unary method. - resource = "hello world" - options = {} - - get_iam_policy_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| - assert options.metadata.key? :"x-goog-api-client" - assert options.metadata[:"x-goog-api-client"].include? "rest" - refute options.metadata[:"x-goog-api-client"].include? "grpc" - end - - ::Google::Cloud::ResourceManager::V3::TagValues::Rest::ServiceStub.stub :transcode_get_iam_policy_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, get_iam_policy_client_stub do - # Create client - client = ::Google::Cloud::ResourceManager::V3::TagValues::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - client.get_iam_policy({ resource: resource, options: options }) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use named arguments - client.get_iam_policy resource: resource, options: options do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object - client.get_iam_policy ::Google::Iam::V1::GetIamPolicyRequest.new(resource: resource, options: options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use hash object with options - client.get_iam_policy({ resource: resource, options: options }, call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object with options - client.get_iam_policy(::Google::Iam::V1::GetIamPolicyRequest.new(resource: resource, options: options), call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Verify method calls - assert_equal 5, get_iam_policy_client_stub.call_count - end - end - end - - def test_set_iam_policy - # Create test objects. - client_result = ::Google::Iam::V1::Policy.new - http_response = OpenStruct.new body: client_result.to_json - - call_options = {} - - # Create request parameters for a unary method. - resource = "hello world" - policy = {} - update_mask = {} - - set_iam_policy_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| - assert options.metadata.key? :"x-goog-api-client" - assert options.metadata[:"x-goog-api-client"].include? "rest" - refute options.metadata[:"x-goog-api-client"].include? "grpc" - end - - ::Google::Cloud::ResourceManager::V3::TagValues::Rest::ServiceStub.stub :transcode_set_iam_policy_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, set_iam_policy_client_stub do - # Create client - client = ::Google::Cloud::ResourceManager::V3::TagValues::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - client.set_iam_policy({ resource: resource, policy: policy, update_mask: update_mask }) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use named arguments - client.set_iam_policy resource: resource, policy: policy, update_mask: update_mask do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object - client.set_iam_policy ::Google::Iam::V1::SetIamPolicyRequest.new(resource: resource, policy: policy, update_mask: update_mask) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use hash object with options - client.set_iam_policy({ resource: resource, policy: policy, update_mask: update_mask }, call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object with options - client.set_iam_policy(::Google::Iam::V1::SetIamPolicyRequest.new(resource: resource, policy: policy, update_mask: update_mask), call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Verify method calls - assert_equal 5, set_iam_policy_client_stub.call_count - end - end - end - - def test_test_iam_permissions - # Create test objects. - client_result = ::Google::Iam::V1::TestIamPermissionsResponse.new - http_response = OpenStruct.new body: client_result.to_json - - call_options = {} - - # Create request parameters for a unary method. - resource = "hello world" - permissions = ["hello world"] - - test_iam_permissions_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| - assert options.metadata.key? :"x-goog-api-client" - assert options.metadata[:"x-goog-api-client"].include? "rest" - refute options.metadata[:"x-goog-api-client"].include? "grpc" - end - - ::Google::Cloud::ResourceManager::V3::TagValues::Rest::ServiceStub.stub :transcode_test_iam_permissions_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, test_iam_permissions_client_stub do - # Create client - client = ::Google::Cloud::ResourceManager::V3::TagValues::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - client.test_iam_permissions({ resource: resource, permissions: permissions }) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use named arguments - client.test_iam_permissions resource: resource, permissions: permissions do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object - client.test_iam_permissions ::Google::Iam::V1::TestIamPermissionsRequest.new(resource: resource, permissions: permissions) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use hash object with options - client.test_iam_permissions({ resource: resource, permissions: permissions }, call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object with options - client.test_iam_permissions(::Google::Iam::V1::TestIamPermissionsRequest.new(resource: resource, permissions: permissions), call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Verify method calls - assert_equal 5, test_iam_permissions_client_stub.call_count - end - end - end - - def test_configure - credentials_token = :dummy_value - - client = block_config = config = nil - dummy_stub = ClientStub.new nil - Gapic::Rest::ClientStub.stub :new, dummy_stub do - client = ::Google::Cloud::ResourceManager::V3::TagValues::Rest::Client.new do |config| - config.credentials = credentials_token - end - end - - config = client.configure do |c| - block_config = c - end - - assert_same block_config, config - assert_kind_of ::Google::Cloud::ResourceManager::V3::TagValues::Rest::Client::Configuration, config - end -end diff --git a/owl-bot-staging/google-cloud-resource_manager-v3/test/google/cloud/resource_manager/v3/tag_values_test.rb b/owl-bot-staging/google-cloud-resource_manager-v3/test/google/cloud/resource_manager/v3/tag_values_test.rb deleted file mode 100644 index 7c18b7c21ddb..000000000000 --- a/owl-bot-staging/google-cloud-resource_manager-v3/test/google/cloud/resource_manager/v3/tag_values_test.rb +++ /dev/null @@ -1,682 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -require "helper" - -require "gapic/grpc/service_stub" - -require "google/cloud/resourcemanager/v3/tag_values_pb" -require "google/cloud/resource_manager/v3/tag_values" - -class ::Google::Cloud::ResourceManager::V3::TagValues::ClientTest < Minitest::Test - class ClientStub - attr_accessor :call_rpc_count, :requests - - def initialize response, operation, &block - @response = response - @operation = operation - @block = block - @call_rpc_count = 0 - @requests = [] - end - - def call_rpc *args, **kwargs - @call_rpc_count += 1 - - @requests << @block&.call(*args, **kwargs) - - catch :response do - yield @response, @operation if block_given? - @response - end - end - - def endpoint - "endpoint.example.com" - end - - def universe_domain - "example.com" - end - - def stub_logger - nil - end - - def logger - nil - end - end - - def test_list_tag_values - # Create GRPC objects. - grpc_response = ::Google::Cloud::ResourceManager::V3::ListTagValuesResponse.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_tag_values_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :list_tag_values, name - assert_kind_of ::Google::Cloud::ResourceManager::V3::ListTagValuesRequest, 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_tag_values_client_stub do - # Create client - client = ::Google::Cloud::ResourceManager::V3::TagValues::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.list_tag_values({ 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_tag_values 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_tag_values ::Google::Cloud::ResourceManager::V3::ListTagValuesRequest.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_tag_values({ 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_tag_values(::Google::Cloud::ResourceManager::V3::ListTagValuesRequest.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_tag_values_client_stub.call_rpc_count - end - end - - def test_get_tag_value - # Create GRPC objects. - grpc_response = ::Google::Cloud::ResourceManager::V3::TagValue.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_tag_value_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :get_tag_value, name - assert_kind_of ::Google::Cloud::ResourceManager::V3::GetTagValueRequest, request - assert_equal "hello world", request["name"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, get_tag_value_client_stub do - # Create client - client = ::Google::Cloud::ResourceManager::V3::TagValues::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.get_tag_value({ name: name }) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use named arguments - client.get_tag_value name: name do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object - client.get_tag_value ::Google::Cloud::ResourceManager::V3::GetTagValueRequest.new(name: name) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use hash object with options - client.get_tag_value({ 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_tag_value(::Google::Cloud::ResourceManager::V3::GetTagValueRequest.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_tag_value_client_stub.call_rpc_count - end - end - - def test_get_namespaced_tag_value - # Create GRPC objects. - grpc_response = ::Google::Cloud::ResourceManager::V3::TagValue.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_namespaced_tag_value_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :get_namespaced_tag_value, name - assert_kind_of ::Google::Cloud::ResourceManager::V3::GetNamespacedTagValueRequest, request - assert_equal "hello world", request["name"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, get_namespaced_tag_value_client_stub do - # Create client - client = ::Google::Cloud::ResourceManager::V3::TagValues::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.get_namespaced_tag_value({ name: name }) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use named arguments - client.get_namespaced_tag_value name: name do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object - client.get_namespaced_tag_value ::Google::Cloud::ResourceManager::V3::GetNamespacedTagValueRequest.new(name: name) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use hash object with options - client.get_namespaced_tag_value({ 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_namespaced_tag_value(::Google::Cloud::ResourceManager::V3::GetNamespacedTagValueRequest.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_namespaced_tag_value_client_stub.call_rpc_count - end - end - - def test_create_tag_value - # 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. - tag_value = {} - validate_only = true - - create_tag_value_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :create_tag_value, name - assert_kind_of ::Google::Cloud::ResourceManager::V3::CreateTagValueRequest, request - assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::ResourceManager::V3::TagValue), request["tag_value"] - assert_equal true, request["validate_only"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, create_tag_value_client_stub do - # Create client - client = ::Google::Cloud::ResourceManager::V3::TagValues::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.create_tag_value({ tag_value: tag_value, 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_tag_value tag_value: tag_value, 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_tag_value ::Google::Cloud::ResourceManager::V3::CreateTagValueRequest.new(tag_value: tag_value, 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_tag_value({ tag_value: tag_value, 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_tag_value(::Google::Cloud::ResourceManager::V3::CreateTagValueRequest.new(tag_value: tag_value, 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_tag_value_client_stub.call_rpc_count - end - end - - def test_update_tag_value - # 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. - tag_value = {} - update_mask = {} - validate_only = true - - update_tag_value_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :update_tag_value, name - assert_kind_of ::Google::Cloud::ResourceManager::V3::UpdateTagValueRequest, request - assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::ResourceManager::V3::TagValue), request["tag_value"] - assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Protobuf::FieldMask), request["update_mask"] - assert_equal true, request["validate_only"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, update_tag_value_client_stub do - # Create client - client = ::Google::Cloud::ResourceManager::V3::TagValues::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.update_tag_value({ tag_value: tag_value, update_mask: update_mask, 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_tag_value tag_value: tag_value, update_mask: update_mask, 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_tag_value ::Google::Cloud::ResourceManager::V3::UpdateTagValueRequest.new(tag_value: tag_value, update_mask: update_mask, 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_tag_value({ tag_value: tag_value, update_mask: update_mask, 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_tag_value(::Google::Cloud::ResourceManager::V3::UpdateTagValueRequest.new(tag_value: tag_value, update_mask: update_mask, 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_tag_value_client_stub.call_rpc_count - end - end - - def test_delete_tag_value - # 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" - validate_only = true - etag = "hello world" - - delete_tag_value_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :delete_tag_value, name - assert_kind_of ::Google::Cloud::ResourceManager::V3::DeleteTagValueRequest, request - assert_equal "hello world", request["name"] - assert_equal true, request["validate_only"] - assert_equal "hello world", request["etag"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, delete_tag_value_client_stub do - # Create client - client = ::Google::Cloud::ResourceManager::V3::TagValues::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.delete_tag_value({ name: name, validate_only: validate_only, etag: etag }) 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_tag_value name: name, validate_only: validate_only, etag: etag 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_tag_value ::Google::Cloud::ResourceManager::V3::DeleteTagValueRequest.new(name: name, validate_only: validate_only, etag: etag) 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_tag_value({ name: name, validate_only: validate_only, etag: etag }, 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_tag_value(::Google::Cloud::ResourceManager::V3::DeleteTagValueRequest.new(name: name, validate_only: validate_only, etag: etag), 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_tag_value_client_stub.call_rpc_count - end - end - - def test_get_iam_policy - # Create GRPC objects. - grpc_response = ::Google::Iam::V1::Policy.new - grpc_operation = GRPC::ActiveCall::Operation.new nil - grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - grpc_options = {} - - # Create request parameters for a unary method. - resource = "hello world" - options = {} - - get_iam_policy_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :get_iam_policy, name - assert_kind_of ::Google::Iam::V1::GetIamPolicyRequest, request - assert_equal "hello world", request["resource"] - assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Iam::V1::GetPolicyOptions), request["options"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, get_iam_policy_client_stub do - # Create client - client = ::Google::Cloud::ResourceManager::V3::TagValues::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.get_iam_policy({ resource: resource, options: options }) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use named arguments - client.get_iam_policy resource: resource, options: options do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object - client.get_iam_policy ::Google::Iam::V1::GetIamPolicyRequest.new(resource: resource, options: options) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use hash object with options - client.get_iam_policy({ resource: resource, options: options }, grpc_options) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object with options - client.get_iam_policy(::Google::Iam::V1::GetIamPolicyRequest.new(resource: resource, options: options), grpc_options) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Verify method calls - assert_equal 5, get_iam_policy_client_stub.call_rpc_count - end - end - - def test_set_iam_policy - # Create GRPC objects. - grpc_response = ::Google::Iam::V1::Policy.new - grpc_operation = GRPC::ActiveCall::Operation.new nil - grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - grpc_options = {} - - # Create request parameters for a unary method. - resource = "hello world" - policy = {} - update_mask = {} - - set_iam_policy_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :set_iam_policy, name - assert_kind_of ::Google::Iam::V1::SetIamPolicyRequest, request - assert_equal "hello world", request["resource"] - assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Iam::V1::Policy), request["policy"] - assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Protobuf::FieldMask), request["update_mask"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, set_iam_policy_client_stub do - # Create client - client = ::Google::Cloud::ResourceManager::V3::TagValues::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.set_iam_policy({ resource: resource, policy: policy, update_mask: update_mask }) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use named arguments - client.set_iam_policy resource: resource, policy: policy, update_mask: update_mask do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object - client.set_iam_policy ::Google::Iam::V1::SetIamPolicyRequest.new(resource: resource, policy: policy, update_mask: update_mask) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use hash object with options - client.set_iam_policy({ resource: resource, policy: policy, update_mask: update_mask }, grpc_options) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object with options - client.set_iam_policy(::Google::Iam::V1::SetIamPolicyRequest.new(resource: resource, policy: policy, update_mask: update_mask), grpc_options) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Verify method calls - assert_equal 5, set_iam_policy_client_stub.call_rpc_count - end - end - - def test_test_iam_permissions - # Create GRPC objects. - grpc_response = ::Google::Iam::V1::TestIamPermissionsResponse.new - grpc_operation = GRPC::ActiveCall::Operation.new nil - grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - grpc_options = {} - - # Create request parameters for a unary method. - resource = "hello world" - permissions = ["hello world"] - - test_iam_permissions_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :test_iam_permissions, name - assert_kind_of ::Google::Iam::V1::TestIamPermissionsRequest, request - assert_equal "hello world", request["resource"] - assert_equal ["hello world"], request["permissions"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, test_iam_permissions_client_stub do - # Create client - client = ::Google::Cloud::ResourceManager::V3::TagValues::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.test_iam_permissions({ resource: resource, permissions: permissions }) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use named arguments - client.test_iam_permissions resource: resource, permissions: permissions do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object - client.test_iam_permissions ::Google::Iam::V1::TestIamPermissionsRequest.new(resource: resource, permissions: permissions) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use hash object with options - client.test_iam_permissions({ resource: resource, permissions: permissions }, grpc_options) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object with options - client.test_iam_permissions(::Google::Iam::V1::TestIamPermissionsRequest.new(resource: resource, permissions: permissions), grpc_options) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Verify method calls - assert_equal 5, test_iam_permissions_client_stub.call_rpc_count - end - end - - def test_configure - grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - - client = block_config = config = nil - dummy_stub = ClientStub.new nil, nil - Gapic::ServiceStub.stub :new, dummy_stub do - client = ::Google::Cloud::ResourceManager::V3::TagValues::Client.new do |config| - config.credentials = grpc_channel - end - end - - config = client.configure do |c| - block_config = c - end - - assert_same block_config, config - assert_kind_of ::Google::Cloud::ResourceManager::V3::TagValues::Client::Configuration, config - end - - def test_credentials - key = OpenSSL::PKey::RSA.new 2048 - cred_json = { - "private_key" => key.to_pem, - "client_email" => "app@developer.gserviceaccount.com", - "type" => "service_account" - } - key_file = StringIO.new cred_json.to_json - creds = Google::Auth::ServiceAccountCredentials.make_creds({ json_key_io: key_file }) - - dummy_stub = ClientStub.new nil, nil - Gapic::ServiceStub.stub :new, dummy_stub do - client = ::Google::Cloud::ResourceManager::V3::TagValues::Client.new do |config| - config.credentials = creds - end - assert_kind_of ::Google::Cloud::ResourceManager::V3::TagValues::Client, client - assert_equal creds, client.configure.credentials - end - end - - def test_operations_client - grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - - client = nil - dummy_stub = ClientStub.new nil, nil - Gapic::ServiceStub.stub :new, dummy_stub do - client = ::Google::Cloud::ResourceManager::V3::TagValues::Client.new do |config| - config.credentials = grpc_channel - end - end - - assert_kind_of ::Google::Cloud::ResourceManager::V3::TagValues::Operations, client.operations_client - end -end diff --git a/owl-bot-staging/google-cloud-resource_manager-v3/test/helper.rb b/owl-bot-staging/google-cloud-resource_manager-v3/test/helper.rb deleted file mode 100644 index 672b337030e7..000000000000 --- a/owl-bot-staging/google-cloud-resource_manager-v3/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" diff --git a/owl-bot-staging/google-cloud-retail-v2/.gitignore b/owl-bot-staging/google-cloud-retail-v2/.gitignore deleted file mode 100644 index 0135b6bc6cfc..000000000000 --- a/owl-bot-staging/google-cloud-retail-v2/.gitignore +++ /dev/null @@ -1,22 +0,0 @@ -# Ignore bundler lockfiles -Gemfile.lock -gems.locked - -# Ignore documentation output -doc/* -.yardoc/* - -# Ignore test output -coverage/* - -# Ignore build artifacts -pkg/* - -# Ignore files commonly present in certain dev environments -.vagrant -.DS_STORE -.idea -*.iml - -# Ignore synth output -__pycache__ diff --git a/owl-bot-staging/google-cloud-retail-v2/.repo-metadata.json b/owl-bot-staging/google-cloud-retail-v2/.repo-metadata.json deleted file mode 100644 index 034a00868333..000000000000 --- a/owl-bot-staging/google-cloud-retail-v2/.repo-metadata.json +++ /dev/null @@ -1,18 +0,0 @@ -{ - "api_id": "retail.googleapis.com", - "api_shortname": "retail", - "client_documentation": "https://cloud.google.com/ruby/docs/reference/google-cloud-retail-v2/latest", - "distribution_name": "google-cloud-retail-v2", - "is_cloud": true, - "language": "ruby", - "name": "retail", - "name_pretty": "Retail V2 API", - "product_documentation": "https://cloud.google.com/retail/docs/apis", - "release_level": "unreleased", - "repo": "googleapis/google-cloud-ruby", - "requires_billing": true, - "ruby-cloud-description": "Retail enables you to build an end-to-end personalized recommendation system based on state-of-the-art deep learning ML models, without a need for expertise in ML or recommendation systems. Note that google-cloud-retail-v2 is a version-specific client library. For most uses, we recommend installing the main client library google-cloud-retail instead. See the readme for more details.", - "ruby-cloud-env-prefix": "RETAIL", - "ruby-cloud-product-url": "https://cloud.google.com/retail/docs/apis", - "library_type": "GAPIC_AUTO" -} diff --git a/owl-bot-staging/google-cloud-retail-v2/.rubocop.yml b/owl-bot-staging/google-cloud-retail-v2/.rubocop.yml deleted file mode 100644 index def961aa4ee5..000000000000 --- a/owl-bot-staging/google-cloud-retail-v2/.rubocop.yml +++ /dev/null @@ -1,33 +0,0 @@ -inherit_gem: - google-style: google-style.yml - -AllCops: - Exclude: - - "google-cloud-retail-v2.gemspec" - - "lib/**/*_pb.rb" - - "proto_docs/**/*" - - "test/**/*" - - "acceptance/**/*" - - "samples/acceptance/**/*" - - "Rakefile" - -Layout/LineLength: - Enabled: false -Metrics/AbcSize: - Enabled: false -Metrics/ClassLength: - Enabled: false -Metrics/CyclomaticComplexity: - Enabled: false -Metrics/MethodLength: - Enabled: false -Metrics/ModuleLength: - Enabled: false -Metrics/PerceivedComplexity: - Enabled: false -Naming/AccessorMethodName: - Exclude: - - "snippets/**/*.rb" -Naming/FileName: - Exclude: - - "lib/google-cloud-retail-v2.rb" diff --git a/owl-bot-staging/google-cloud-retail-v2/.toys.rb b/owl-bot-staging/google-cloud-retail-v2/.toys.rb deleted file mode 100644 index 177e22456e8a..000000000000 --- a/owl-bot-staging/google-cloud-retail-v2/.toys.rb +++ /dev/null @@ -1,28 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -toys_version! ">= 0.15.3" - -if ENV["RUBY_COMMON_TOOLS"] - common_tools_dir = File.expand_path ENV["RUBY_COMMON_TOOLS"] - load File.join(common_tools_dir, "toys", "gapic") -else - load_git remote: "https://github.com/googleapis/ruby-common-tools.git", - path: "toys/gapic", - update: true -end diff --git a/owl-bot-staging/google-cloud-retail-v2/.yardopts b/owl-bot-staging/google-cloud-retail-v2/.yardopts deleted file mode 100644 index 038190b897cc..000000000000 --- a/owl-bot-staging/google-cloud-retail-v2/.yardopts +++ /dev/null @@ -1,12 +0,0 @@ ---no-private ---title="Retail V2 API" ---exclude _pb\.rb$ ---markup markdown ---markup-provider redcarpet - -./lib/**/*.rb -./proto_docs/**/*.rb -- -README.md -LICENSE.md -AUTHENTICATION.md diff --git a/owl-bot-staging/google-cloud-retail-v2/AUTHENTICATION.md b/owl-bot-staging/google-cloud-retail-v2/AUTHENTICATION.md deleted file mode 100644 index 8862a3fae853..000000000000 --- a/owl-bot-staging/google-cloud-retail-v2/AUTHENTICATION.md +++ /dev/null @@ -1,122 +0,0 @@ -# Authentication - -The recommended way to authenticate to the google-cloud-retail-v2 library is to use -[Application Default Credentials (ADC)](https://cloud.google.com/docs/authentication/application-default-credentials). -To review all of your authentication options, see [Credentials lookup](#credential-lookup). - -## Quickstart - -The following example shows how to set up authentication for a local development -environment with your user credentials. - -**NOTE:** This method is _not_ recommended for running in production. User credentials -should be used only during development. - -1. [Download and install the Google Cloud CLI](https://cloud.google.com/sdk). -2. Set up a local ADC file with your user credentials: - -```sh -gcloud auth application-default login -``` - -3. Write code as if already authenticated. - -For more information about setting up authentication for a local development environment, see -[Set up Application Default Credentials](https://cloud.google.com/docs/authentication/provide-credentials-adc#local-dev). - -## Credential Lookup - -The google-cloud-retail-v2 library provides several mechanisms to configure your system. -Generally, using Application Default Credentials to facilitate automatic -credentials discovery is the easist method. But if you need to explicitly specify -credentials, there are several methods available to you. - -Credentials are accepted in the following ways, in the following order or precedence: - -1. Credentials specified in method arguments -2. Credentials specified in configuration -3. Credentials pointed to or included in environment variables -4. Credentials found in local ADC file -5. Credentials returned by the metadata server for the attached service account (GCP) - -### Configuration - -You can configure a path to a JSON credentials file, either for an individual client object or -globally, for all client objects. The JSON file can contain credentials created for -[workload identity federation](https://cloud.google.com/iam/docs/workload-identity-federation), -[workforce identity federation](https://cloud.google.com/iam/docs/workforce-identity-federation), or a -[service account key](https://cloud.google.com/docs/authentication/provide-credentials-adc#local-key). - -Note: Service account keys are a security risk if not managed correctly. You should -[choose a more secure alternative to service account keys](https://cloud.google.com/docs/authentication#auth-decision-tree) -whenever possible. - -To configure a credentials file for an individual client initialization: - -```ruby -require "google/cloud/retail/v2" - -client = ::Google::Cloud::Retail::V2::AnalyticsService::Client.new do |config| - config.credentials = "path/to/credentialfile.json" -end -``` - -To configure a credentials file globally for all clients: - -```ruby -require "google/cloud/retail/v2" - -::Google::Cloud::Retail::V2::AnalyticsService::Client.configure do |config| - config.credentials = "path/to/credentialfile.json" -end - -client = ::Google::Cloud::Retail::V2::AnalyticsService::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-retail-v2 -checks for credentials are: - -* `GOOGLE_CLOUD_CREDENTIALS` - Path to JSON file, or JSON contents -* `GOOGLE_APPLICATION_CREDENTIALS` - Path to JSON file - -```ruby -require "google/cloud/retail/v2" - -ENV["GOOGLE_APPLICATION_CREDENTIALS"] = "path/to/credentialfile.json" - -client = ::Google::Cloud::Retail::V2::AnalyticsService::Client.new -``` - -### Local ADC file - -You can set up a local ADC file with your user credentials for authentication during -development. If credentials are not provided in code or in environment variables, -then the local ADC credentials are discovered. - -Follow the steps in [Quickstart](#quickstart) to set up a local ADC file. - -### Google Cloud Platform environments - -When running on Google Cloud Platform (GCP), including Google Compute Engine -(GCE), Google Kubernetes Engine (GKE), Google App Engine (GAE), Google Cloud -Functions (GCF) and Cloud Run, credentials are retrieved from the attached -service account automatically. Code should be written as if already authenticated. - -For more information, see -[Set up ADC for Google Cloud services](https://cloud.google.com/docs/authentication/provide-credentials-adc#attached-sa). diff --git a/owl-bot-staging/google-cloud-retail-v2/CHANGELOG.md b/owl-bot-staging/google-cloud-retail-v2/CHANGELOG.md deleted file mode 100644 index f88957a62ba2..000000000000 --- a/owl-bot-staging/google-cloud-retail-v2/CHANGELOG.md +++ /dev/null @@ -1,2 +0,0 @@ -# Release History - diff --git a/owl-bot-staging/google-cloud-retail-v2/Gemfile b/owl-bot-staging/google-cloud-retail-v2/Gemfile deleted file mode 100644 index 1d08558908d8..000000000000 --- a/owl-bot-staging/google-cloud-retail-v2/Gemfile +++ /dev/null @@ -1,14 +0,0 @@ -source "https://rubygems.org" - -gemspec - -gem "google-style", "~> 1.32.0" -gem "irb", "~> 1.17" -gem "minitest", "~> 6.0.2" -gem "minitest-focus", "~> 1.4" -gem "minitest-mock", "~> 5.27" -gem "minitest-rg", "~> 5.3" -gem "ostruct", "~> 0.5.5" -gem "rake", ">= 13.0" -gem "redcarpet", "~> 3.6" -gem "yard", "~> 0.9" diff --git a/owl-bot-staging/google-cloud-retail-v2/LICENSE.md b/owl-bot-staging/google-cloud-retail-v2/LICENSE.md deleted file mode 100644 index c261857ba6ad..000000000000 --- a/owl-bot-staging/google-cloud-retail-v2/LICENSE.md +++ /dev/null @@ -1,201 +0,0 @@ - Apache License - Version 2.0, January 2004 - http://www.apache.org/licenses/ - - TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION - - 1. Definitions. - - "License" shall mean the terms and conditions for use, reproduction, - and distribution as defined by Sections 1 through 9 of this document. - - "Licensor" shall mean the copyright owner or entity authorized by - the copyright owner that is granting the License. - - "Legal Entity" shall mean the union of the acting entity and all - other entities that control, are controlled by, or are under common - control with that entity. For the purposes of this definition, - "control" means (i) the power, direct or indirect, to cause the - direction or management of such entity, whether by contract or - otherwise, or (ii) ownership of fifty percent (50%) or more of the - outstanding shares, or (iii) beneficial ownership of such entity. - - "You" (or "Your") shall mean an individual or Legal Entity - exercising permissions granted by this License. - - "Source" form shall mean the preferred form for making modifications, - including but not limited to software source code, documentation - source, and configuration files. - - "Object" form shall mean any form resulting from mechanical - transformation or translation of a Source form, including but - not limited to compiled object code, generated documentation, - and conversions to other media types. - - "Work" shall mean the work of authorship, whether in Source or - Object form, made available under the License, as indicated by a - copyright notice that is included in or attached to the work - (an example is provided in the Appendix below). - - "Derivative Works" shall mean any work, whether in Source or Object - form, that is based on (or derived from) the Work and for which the - editorial revisions, annotations, elaborations, or other modifications - represent, as a whole, an original work of authorship. For the purposes - of this License, Derivative Works shall not include works that remain - separable from, or merely link (or bind by name) to the interfaces of, - the Work and Derivative Works thereof. - - "Contribution" shall mean any work of authorship, including - the original version of the Work and any modifications or additions - to that Work or Derivative Works thereof, that is intentionally - submitted to Licensor for inclusion in the Work by the copyright owner - or by an individual or Legal Entity authorized to submit on behalf of - the copyright owner. For the purposes of this definition, "submitted" - means any form of electronic, verbal, or written communication sent - to the Licensor or its representatives, including but not limited to - communication on electronic mailing lists, source code control systems, - and issue tracking systems that are managed by, or on behalf of, the - Licensor for the purpose of discussing and improving the Work, but - excluding communication that is conspicuously marked or otherwise - designated in writing by the copyright owner as "Not a Contribution." - - "Contributor" shall mean Licensor and any individual or Legal Entity - on behalf of whom a Contribution has been received by Licensor and - subsequently incorporated within the Work. - - 2. Grant of Copyright License. Subject to the terms and conditions of - this License, each Contributor hereby grants to You a perpetual, - worldwide, non-exclusive, no-charge, royalty-free, irrevocable - copyright license to reproduce, prepare Derivative Works of, - publicly display, publicly perform, sublicense, and distribute the - Work and such Derivative Works in Source or Object form. - - 3. Grant of Patent License. Subject to the terms and conditions of - this License, each Contributor hereby grants to You a perpetual, - worldwide, non-exclusive, no-charge, royalty-free, irrevocable - (except as stated in this section) patent license to make, have made, - use, offer to sell, sell, import, and otherwise transfer the Work, - where such license applies only to those patent claims licensable - by such Contributor that are necessarily infringed by their - Contribution(s) alone or by combination of their Contribution(s) - with the Work to which such Contribution(s) was submitted. If You - institute patent litigation against any entity (including a - cross-claim or counterclaim in a lawsuit) alleging that the Work - or a Contribution incorporated within the Work constitutes direct - or contributory patent infringement, then any patent licenses - granted to You under this License for that Work shall terminate - as of the date such litigation is filed. - - 4. Redistribution. You may reproduce and distribute copies of the - Work or Derivative Works thereof in any medium, with or without - modifications, and in Source or Object form, provided that You - meet the following conditions: - - (a) You must give any other recipients of the Work or - Derivative Works a copy of this License; and - - (b) You must cause any modified files to carry prominent notices - stating that You changed the files; and - - (c) You must retain, in the Source form of any Derivative Works - that You distribute, all copyright, patent, trademark, and - attribution notices from the Source form of the Work, - excluding those notices that do not pertain to any part of - the Derivative Works; and - - (d) If the Work includes a "NOTICE" text file as part of its - distribution, then any Derivative Works that You distribute must - include a readable copy of the attribution notices contained - within such NOTICE file, excluding those notices that do not - pertain to any part of the Derivative Works, in at least one - of the following places: within a NOTICE text file distributed - as part of the Derivative Works; within the Source form or - documentation, if provided along with the Derivative Works; or, - within a display generated by the Derivative Works, if and - wherever such third-party notices normally appear. The contents - of the NOTICE file are for informational purposes only and - do not modify the License. You may add Your own attribution - notices within Derivative Works that You distribute, alongside - or as an addendum to the NOTICE text from the Work, provided - that such additional attribution notices cannot be construed - as modifying the License. - - You may add Your own copyright statement to Your modifications and - may provide additional or different license terms and conditions - for use, reproduction, or distribution of Your modifications, or - for any such Derivative Works as a whole, provided Your use, - reproduction, and distribution of the Work otherwise complies with - the conditions stated in this License. - - 5. Submission of Contributions. Unless You explicitly state otherwise, - any Contribution intentionally submitted for inclusion in the Work - by You to the Licensor shall be under the terms and conditions of - this License, without any additional terms or conditions. - Notwithstanding the above, nothing herein shall supersede or modify - the terms of any separate license agreement you may have executed - with Licensor regarding such Contributions. - - 6. Trademarks. This License does not grant permission to use the trade - names, trademarks, service marks, or product names of the Licensor, - except as required for reasonable and customary use in describing the - origin of the Work and reproducing the content of the NOTICE file. - - 7. Disclaimer of Warranty. Unless required by applicable law or - agreed to in writing, Licensor provides the Work (and each - Contributor provides its Contributions) on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or - implied, including, without limitation, any warranties or conditions - of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A - PARTICULAR PURPOSE. You are solely responsible for determining the - appropriateness of using or redistributing the Work and assume any - risks associated with Your exercise of permissions under this License. - - 8. Limitation of Liability. In no event and under no legal theory, - whether in tort (including negligence), contract, or otherwise, - unless required by applicable law (such as deliberate and grossly - negligent acts) or agreed to in writing, shall any Contributor be - liable to You for damages, including any direct, indirect, special, - incidental, or consequential damages of any character arising as a - result of this License or out of the use or inability to use the - Work (including but not limited to damages for loss of goodwill, - work stoppage, computer failure or malfunction, or any and all - other commercial damages or losses), even if such Contributor - has been advised of the possibility of such damages. - - 9. Accepting Warranty or Additional Liability. While redistributing - the Work or Derivative Works thereof, You may choose to offer, - and charge a fee for, acceptance of support, warranty, indemnity, - or other liability obligations and/or rights consistent with this - License. However, in accepting such obligations, You may act only - on Your own behalf and on Your sole responsibility, not on behalf - of any other Contributor, and only if You agree to indemnify, - defend, and hold each Contributor harmless for any liability - incurred by, or claims asserted against, such Contributor by reason - of your accepting any such warranty or additional liability. - - END OF TERMS AND CONDITIONS - - APPENDIX: How to apply the Apache License to your work. - - To apply the Apache License to your work, attach the following - boilerplate notice, with the fields enclosed by brackets "[]" - replaced with your own identifying information. (Don't include - the brackets!) The text should be enclosed in the appropriate - comment syntax for the file format. We also recommend that a - file or class name and description of purpose be included on the - same "printed page" as the copyright notice for easier - identification within third-party archives. - - Copyright [yyyy] [name of copyright owner] - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. diff --git a/owl-bot-staging/google-cloud-retail-v2/README.md b/owl-bot-staging/google-cloud-retail-v2/README.md deleted file mode 100644 index 58694f8a7645..000000000000 --- a/owl-bot-staging/google-cloud-retail-v2/README.md +++ /dev/null @@ -1,154 +0,0 @@ -# Ruby Client for the Retail V2 API - -Vertex AI Search for commerce API is made up of Retail Search, Browse and Recommendations. These discovery AI solutions help you implement personalized search, browse and recommendations, based on machine learning models, across your websites and mobile applications. - -Retail enables you to build an end-to-end personalized recommendation system based on state-of-the-art deep learning ML models, without a need for expertise in ML or recommendation systems. - -https://github.com/googleapis/google-cloud-ruby - -This gem is a _versioned_ client. It provides basic client classes for a -specific version of the Retail V2 API. Most users should consider using -the main client gem, -[google-cloud-retail](https://rubygems.org/gems/google-cloud-retail). -See the section below titled *Which client should I use?* for more information. - -## Installation - -``` -$ gem install google-cloud-retail-v2 -``` - -## Before You Begin - -In order to use this library, you first need to go through the following steps: - -1. [Select or create a Cloud Platform project.](https://console.cloud.google.com/project) -1. [Enable billing for your project.](https://cloud.google.com/billing/docs/how-to/modify-project#enable_billing_for_a_project) -1. [Enable the API.](https://console.cloud.google.com/apis/library/retail.googleapis.com) -1. [Set up authentication.](AUTHENTICATION.md) - -## Quick Start - -```ruby -require "google/cloud/retail/v2" - -client = ::Google::Cloud::Retail::V2::AnalyticsService::Client.new -request = ::Google::Cloud::Retail::V2::ExportAnalyticsMetricsRequest.new # (request fields as keyword arguments...) -response = client.export_analytics_metrics request -``` - -View the [Client Library Documentation](https://cloud.google.com/ruby/docs/reference/google-cloud-retail-v2/latest) -for class and method documentation. - -See also the [Product Documentation](https://cloud.google.com/retail/docs/apis) -for general usage information. - -## Debug Logging - -This library comes with opt-in Debug Logging that can help you troubleshoot -your application's integration with the API. When logging is activated, key -events such as requests and responses, along with data payloads and metadata -such as headers and client configuration, are logged to the standard error -stream. - -**WARNING:** Client Library Debug Logging includes your data payloads in -plaintext, which could include sensitive data such as PII for yourself or your -customers, private keys, or other security data that could be compromising if -leaked. Always practice good data hygiene with your application logs, and follow -the principle of least access. Google also recommends that Client Library Debug -Logging be enabled only temporarily during active debugging, and not used -permanently in production. - -To enable logging, set the environment variable `GOOGLE_SDK_RUBY_LOGGING_GEMS` -to the value `all`. Alternatively, you can set the value to a comma-delimited -list of client library gem names. This will select the default logging behavior, -which writes logs to the standard error stream. On a local workstation, this may -result in logs appearing on the console. When running on a Google Cloud hosting -service such as [Google Cloud Run](https://cloud.google.com/run), this generally -results in logs appearing alongside your application logs in the -[Google Cloud Logging](https://cloud.google.com/logging/) service. - -You can customize logging by modifying the `logger` configuration when -constructing a client object. For example: - -```ruby -require "google/cloud/retail/v2" -require "logger" - -client = ::Google::Cloud::Retail::V2::AnalyticsService::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-retail`, -and lower-level _versioned_ client libraries with names such as -`google-cloud-retail-v2`. -_In most cases, you should install the main client._ - -### What's the difference between the main client and a versioned client? - -A _versioned client_ provides a basic set of data types and client classes for -a _single version_ of a specific service. (That is, for a service with multiple -versions, there might be a separate versioned client for each service version.) -Most versioned clients are written and maintained by a code generator. - -The _main client_ is designed to provide you with the _recommended_ client -interfaces for the service. There will be only one main client for any given -service, even a service with multiple versions. The main client includes -factory methods for constructing the client objects we recommend for most -users. In some cases, those will be classes provided by an underlying versioned -client; in other cases, they will be handwritten higher-level client objects -with additional capabilities, convenience methods, or best practices built in. -Generally, the main client will default to a recommended service version, -although in some cases you can override this if you need to talk to a specific -service version. - -### Why would I want to use the main client? - -We recommend that most users install the main client gem for a service. You can -identify this gem as the one _without_ a version in its name, e.g. -`google-cloud-retail`. -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-retail-v2`. - -### What about the google-apis- clients? - -Client library gems with names that begin with `google-apis-` are based on an -older code generation technology. They talk to a REST/JSON backend (whereas -most modern clients talk to a [gRPC](https://grpc.io/) backend) and they may -not offer the same performance, features, and ease of use provided by more -modern clients. - -The `google-apis-` clients have wide coverage across Google services, so you -might need to use one if there is no modern client available for the service. -However, if a modern client is available, we generally recommend it over the -older `google-apis-` clients. diff --git a/owl-bot-staging/google-cloud-retail-v2/Rakefile b/owl-bot-staging/google-cloud-retail-v2/Rakefile deleted file mode 100644 index b4e6091ef9cd..000000000000 --- a/owl-bot-staging/google-cloud-retail-v2/Rakefile +++ /dev/null @@ -1,169 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -require "bundler/setup" -require "bundler/gem_tasks" - -require "rubocop/rake_task" -RuboCop::RakeTask.new - -require "rake/testtask" -desc "Run tests." -Rake::TestTask.new do |t| - t.libs << "test" - t.test_files = FileList["test/**/*_test.rb"] - t.warning = false -end - -desc "Runs the smoke tests." -Rake::TestTask.new :smoke_test do |t| - t.test_files = FileList["acceptance/**/*smoke_test.rb"] - t.warning = false -end - -# Acceptance tests -desc "Run the google-cloud-retail-v2 acceptance tests." -task :acceptance, :project, :keyfile do |t, args| - project = args[:project] - project ||= - ENV["RETAIL_TEST_PROJECT"] || - ENV["GCLOUD_TEST_PROJECT"] - keyfile = args[:keyfile] - keyfile ||= - ENV["RETAIL_TEST_KEYFILE"] || - ENV["GCLOUD_TEST_KEYFILE"] - if keyfile - keyfile = File.read keyfile - else - keyfile ||= - ENV["RETAIL_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 RETAIL_TEST_PROJECT=test123 RETAIL_TEST_KEYFILE=/path/to/keyfile.json rake acceptance" - end - require "google/cloud/retail/v2/analytics_service/credentials" - ::Google::Cloud::Retail::V2::AnalyticsService::Credentials.env_vars.each do |path| - ENV[path] = nil - end - ENV["RETAIL_PROJECT"] = project - ENV["RETAIL_TEST_PROJECT"] = project - ENV["RETAIL_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-retail-v2 gem has no acceptance tests." - end - end - - desc "Run acceptance cleanup." - task :cleanup do - end -end - -task :samples do - Rake::Task["samples:latest"].invoke -end - -namespace :samples do - task :latest do - if File.directory? "samples" - Dir.chdir "samples" do - Bundler.with_clean_env do - ENV["GOOGLE_CLOUD_SAMPLES_TEST"] = "not_master" - sh "bundle update" - sh "bundle exec rake test" - end - end - else - puts "The google-cloud-retail-v2 gem has no samples to test." - end - end - - task :master do - if File.directory? "samples" - Dir.chdir "samples" do - Bundler.with_clean_env do - ENV["GOOGLE_CLOUD_SAMPLES_TEST"] = "master" - sh "bundle update" - sh "bundle exec rake test" - end - end - else - puts "The google-cloud-retail-v2 gem has no samples to test." - end - end -end - -require "yard" -require "yard/rake/yardoc_task" -YARD::Rake::YardocTask.new do |y| - y.options << "--fail-on-warning" -end - -desc "Run yard-doctest example tests." -task :doctest do - puts "The google-cloud-retail-v2 gem does not have doctest tests." -end - -desc "Run the CI build" -task :ci do - header "BUILDING google-cloud-retail-v2" - header "google-cloud-retail-v2 rubocop", "*" - Rake::Task[:rubocop].invoke - header "google-cloud-retail-v2 yard", "*" - Rake::Task[:yard].invoke - header "google-cloud-retail-v2 test", "*" - Rake::Task[:test].invoke -end - -namespace :ci do - desc "Run the CI build, with smoke tests." - task :smoke_test do - Rake::Task[:ci].invoke - header "google-cloud-retail-v2 smoke_test", "*" - Rake::Task[:smoke_test].invoke - end - desc "Run the CI build, with acceptance tests." - task :acceptance do - Rake::Task[:ci].invoke - header "google-cloud-retail-v2 acceptance", "*" - Rake::Task[:acceptance].invoke - end - task :a do - # This is a handy shortcut to save typing - Rake::Task["ci:acceptance"].invoke - end -end - -task default: :test - -def header str, token = "#" - line_length = str.length + 8 - puts "" - puts token * line_length - puts "#{token * 3} #{str} #{token * 3}" - puts token * line_length - puts "" -end diff --git a/owl-bot-staging/google-cloud-retail-v2/gapic_metadata.json b/owl-bot-staging/google-cloud-retail-v2/gapic_metadata.json deleted file mode 100644 index d2b8ccdd6732..000000000000 --- a/owl-bot-staging/google-cloud-retail-v2/gapic_metadata.json +++ /dev/null @@ -1,412 +0,0 @@ -{ - "schema": "1.0", - "comment": "This file maps proto services/RPCs to the corresponding library clients/methods", - "language": "ruby", - "protoPackage": "google.cloud.retail.v2", - "libraryPackage": "::Google::Cloud::Retail::V2", - "services": { - "AnalyticsService": { - "clients": { - "grpc": { - "libraryClient": "::Google::Cloud::Retail::V2::AnalyticsService::Client", - "rpcs": { - "ExportAnalyticsMetrics": { - "methods": [ - "export_analytics_metrics" - ] - } - } - } - } - }, - "CatalogService": { - "clients": { - "grpc": { - "libraryClient": "::Google::Cloud::Retail::V2::CatalogService::Client", - "rpcs": { - "ListCatalogs": { - "methods": [ - "list_catalogs" - ] - }, - "UpdateCatalog": { - "methods": [ - "update_catalog" - ] - }, - "SetDefaultBranch": { - "methods": [ - "set_default_branch" - ] - }, - "GetDefaultBranch": { - "methods": [ - "get_default_branch" - ] - }, - "GetCompletionConfig": { - "methods": [ - "get_completion_config" - ] - }, - "UpdateCompletionConfig": { - "methods": [ - "update_completion_config" - ] - }, - "GetAttributesConfig": { - "methods": [ - "get_attributes_config" - ] - }, - "UpdateAttributesConfig": { - "methods": [ - "update_attributes_config" - ] - }, - "AddCatalogAttribute": { - "methods": [ - "add_catalog_attribute" - ] - }, - "RemoveCatalogAttribute": { - "methods": [ - "remove_catalog_attribute" - ] - }, - "ReplaceCatalogAttribute": { - "methods": [ - "replace_catalog_attribute" - ] - } - } - } - } - }, - "CompletionService": { - "clients": { - "grpc": { - "libraryClient": "::Google::Cloud::Retail::V2::CompletionService::Client", - "rpcs": { - "CompleteQuery": { - "methods": [ - "complete_query" - ] - }, - "ImportCompletionData": { - "methods": [ - "import_completion_data" - ] - } - } - } - } - }, - "ControlService": { - "clients": { - "grpc": { - "libraryClient": "::Google::Cloud::Retail::V2::ControlService::Client", - "rpcs": { - "CreateControl": { - "methods": [ - "create_control" - ] - }, - "DeleteControl": { - "methods": [ - "delete_control" - ] - }, - "UpdateControl": { - "methods": [ - "update_control" - ] - }, - "GetControl": { - "methods": [ - "get_control" - ] - }, - "ListControls": { - "methods": [ - "list_controls" - ] - } - } - } - } - }, - "SearchService": { - "clients": { - "grpc": { - "libraryClient": "::Google::Cloud::Retail::V2::SearchService::Client", - "rpcs": { - "Search": { - "methods": [ - "search" - ] - } - } - } - } - }, - "ConversationalSearchService": { - "clients": { - "grpc": { - "libraryClient": "::Google::Cloud::Retail::V2::ConversationalSearchService::Client", - "rpcs": { - "ConversationalSearch": { - "methods": [ - "conversational_search" - ] - } - } - } - } - }, - "GenerativeQuestionService": { - "clients": { - "grpc": { - "libraryClient": "::Google::Cloud::Retail::V2::GenerativeQuestionService::Client", - "rpcs": { - "UpdateGenerativeQuestionsFeatureConfig": { - "methods": [ - "update_generative_questions_feature_config" - ] - }, - "GetGenerativeQuestionsFeatureConfig": { - "methods": [ - "get_generative_questions_feature_config" - ] - }, - "ListGenerativeQuestionConfigs": { - "methods": [ - "list_generative_question_configs" - ] - }, - "UpdateGenerativeQuestionConfig": { - "methods": [ - "update_generative_question_config" - ] - }, - "BatchUpdateGenerativeQuestionConfigs": { - "methods": [ - "batch_update_generative_question_configs" - ] - } - } - } - } - }, - "ModelService": { - "clients": { - "grpc": { - "libraryClient": "::Google::Cloud::Retail::V2::ModelService::Client", - "rpcs": { - "CreateModel": { - "methods": [ - "create_model" - ] - }, - "GetModel": { - "methods": [ - "get_model" - ] - }, - "PauseModel": { - "methods": [ - "pause_model" - ] - }, - "ResumeModel": { - "methods": [ - "resume_model" - ] - }, - "DeleteModel": { - "methods": [ - "delete_model" - ] - }, - "ListModels": { - "methods": [ - "list_models" - ] - }, - "UpdateModel": { - "methods": [ - "update_model" - ] - }, - "TuneModel": { - "methods": [ - "tune_model" - ] - } - } - } - } - }, - "PredictionService": { - "clients": { - "grpc": { - "libraryClient": "::Google::Cloud::Retail::V2::PredictionService::Client", - "rpcs": { - "Predict": { - "methods": [ - "predict" - ] - } - } - } - } - }, - "ProductService": { - "clients": { - "grpc": { - "libraryClient": "::Google::Cloud::Retail::V2::ProductService::Client", - "rpcs": { - "CreateProduct": { - "methods": [ - "create_product" - ] - }, - "GetProduct": { - "methods": [ - "get_product" - ] - }, - "ListProducts": { - "methods": [ - "list_products" - ] - }, - "UpdateProduct": { - "methods": [ - "update_product" - ] - }, - "DeleteProduct": { - "methods": [ - "delete_product" - ] - }, - "PurgeProducts": { - "methods": [ - "purge_products" - ] - }, - "ImportProducts": { - "methods": [ - "import_products" - ] - }, - "SetInventory": { - "methods": [ - "set_inventory" - ] - }, - "AddFulfillmentPlaces": { - "methods": [ - "add_fulfillment_places" - ] - }, - "RemoveFulfillmentPlaces": { - "methods": [ - "remove_fulfillment_places" - ] - }, - "AddLocalInventories": { - "methods": [ - "add_local_inventories" - ] - }, - "RemoveLocalInventories": { - "methods": [ - "remove_local_inventories" - ] - } - } - } - } - }, - "ServingConfigService": { - "clients": { - "grpc": { - "libraryClient": "::Google::Cloud::Retail::V2::ServingConfigService::Client", - "rpcs": { - "CreateServingConfig": { - "methods": [ - "create_serving_config" - ] - }, - "DeleteServingConfig": { - "methods": [ - "delete_serving_config" - ] - }, - "UpdateServingConfig": { - "methods": [ - "update_serving_config" - ] - }, - "GetServingConfig": { - "methods": [ - "get_serving_config" - ] - }, - "ListServingConfigs": { - "methods": [ - "list_serving_configs" - ] - }, - "AddControl": { - "methods": [ - "add_control" - ] - }, - "RemoveControl": { - "methods": [ - "remove_control" - ] - } - } - } - } - }, - "UserEventService": { - "clients": { - "grpc": { - "libraryClient": "::Google::Cloud::Retail::V2::UserEventService::Client", - "rpcs": { - "WriteUserEvent": { - "methods": [ - "write_user_event" - ] - }, - "CollectUserEvent": { - "methods": [ - "collect_user_event" - ] - }, - "PurgeUserEvents": { - "methods": [ - "purge_user_events" - ] - }, - "ImportUserEvents": { - "methods": [ - "import_user_events" - ] - }, - "RejoinUserEvents": { - "methods": [ - "rejoin_user_events" - ] - } - } - } - } - } - } -} diff --git a/owl-bot-staging/google-cloud-retail-v2/google-cloud-retail-v2.gemspec b/owl-bot-staging/google-cloud-retail-v2/google-cloud-retail-v2.gemspec deleted file mode 100644 index 215a2f8ac3e2..000000000000 --- a/owl-bot-staging/google-cloud-retail-v2/google-cloud-retail-v2.gemspec +++ /dev/null @@ -1,29 +0,0 @@ -# -*- ruby -*- -# encoding: utf-8 - -require File.expand_path("lib/google/cloud/retail/v2/version", __dir__) - -Gem::Specification.new do |gem| - gem.name = "google-cloud-retail-v2" - gem.version = Google::Cloud::Retail::V2::VERSION - - gem.authors = ["Google LLC"] - gem.email = "googleapis-packages@google.com" - gem.description = "Retail enables you to build an end-to-end personalized recommendation system based on state-of-the-art deep learning ML models, without a need for expertise in ML or recommendation systems. Note that google-cloud-retail-v2 is a version-specific client library. For most uses, we recommend installing the main client library google-cloud-retail instead. See the readme for more details." - gem.summary = "Vertex AI Search for commerce API is made up of Retail Search, Browse and Recommendations. These discovery AI solutions help you implement personalized search, browse and recommendations, based on machine learning models, across your websites and mobile applications." - 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-cloud-retail-v2/lib/google-cloud-retail-v2.rb b/owl-bot-staging/google-cloud-retail-v2/lib/google-cloud-retail-v2.rb deleted file mode 100644 index 45db4898f66c..000000000000 --- a/owl-bot-staging/google-cloud-retail-v2/lib/google-cloud-retail-v2.rb +++ /dev/null @@ -1,21 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -# This gem does not autoload during Bundler.require. To load this gem, -# issue explicit require statements for the packages desired, e.g.: -# require "google/cloud/retail/v2" diff --git a/owl-bot-staging/google-cloud-retail-v2/lib/google/cloud/retail/v2.rb b/owl-bot-staging/google-cloud-retail-v2/lib/google/cloud/retail/v2.rb deleted file mode 100644 index 4214f1307e58..000000000000 --- a/owl-bot-staging/google-cloud-retail-v2/lib/google/cloud/retail/v2.rb +++ /dev/null @@ -1,56 +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/retail/v2/analytics_service" -require "google/cloud/retail/v2/catalog_service" -require "google/cloud/retail/v2/completion_service" -require "google/cloud/retail/v2/control_service" -require "google/cloud/retail/v2/search_service" -require "google/cloud/retail/v2/conversational_search_service" -require "google/cloud/retail/v2/generative_question_service" -require "google/cloud/retail/v2/model_service" -require "google/cloud/retail/v2/prediction_service" -require "google/cloud/retail/v2/product_service" -require "google/cloud/retail/v2/serving_config_service" -require "google/cloud/retail/v2/user_event_service" -require "google/cloud/retail/v2/version" - -module Google - module Cloud - module Retail - ## - # API client module. - # - # @example Load this package, including all its services, and instantiate a gRPC client - # - # require "google/cloud/retail/v2" - # client = ::Google::Cloud::Retail::V2::AnalyticsService::Client.new - # - # @example Load this package, including all its services, and instantiate a REST client - # - # require "google/cloud/retail/v2" - # client = ::Google::Cloud::Retail::V2::AnalyticsService::Rest::Client.new - # - module V2 - end - end - end -end - -helper_path = ::File.join __dir__, "v2", "_helpers.rb" -require "google/cloud/retail/v2/_helpers" if ::File.file? helper_path diff --git a/owl-bot-staging/google-cloud-retail-v2/lib/google/cloud/retail/v2/analytics_service.rb b/owl-bot-staging/google-cloud-retail-v2/lib/google/cloud/retail/v2/analytics_service.rb deleted file mode 100644 index 3eb7f4cce88a..000000000000 --- a/owl-bot-staging/google-cloud-retail-v2/lib/google/cloud/retail/v2/analytics_service.rb +++ /dev/null @@ -1,56 +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/retail/v2/version" - -require "google/cloud/retail/v2/analytics_service/credentials" -require "google/cloud/retail/v2/analytics_service/operations" -require "google/cloud/retail/v2/analytics_service/client" -require "google/cloud/retail/v2/analytics_service/rest" - -module Google - module Cloud - module Retail - module V2 - ## - # Service for managing & accessing retail search business metric. - # Retail recommendation business metric is currently not available. - # - # @example Load this service and instantiate a gRPC client - # - # require "google/cloud/retail/v2/analytics_service" - # client = ::Google::Cloud::Retail::V2::AnalyticsService::Client.new - # - # @example Load this service and instantiate a REST client - # - # require "google/cloud/retail/v2/analytics_service/rest" - # client = ::Google::Cloud::Retail::V2::AnalyticsService::Rest::Client.new - # - module AnalyticsService - end - end - end - end -end - -helper_path = ::File.join __dir__, "analytics_service", "helpers.rb" -require "google/cloud/retail/v2/analytics_service/helpers" if ::File.file? helper_path diff --git a/owl-bot-staging/google-cloud-retail-v2/lib/google/cloud/retail/v2/analytics_service/client.rb b/owl-bot-staging/google-cloud-retail-v2/lib/google/cloud/retail/v2/analytics_service/client.rb deleted file mode 100644 index ab974412fd14..000000000000 --- a/owl-bot-staging/google-cloud-retail-v2/lib/google/cloud/retail/v2/analytics_service/client.rb +++ /dev/null @@ -1,541 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -require "google/cloud/errors" -require "google/cloud/retail/v2/analytics_service_pb" -require "google/cloud/location" - -module Google - module Cloud - module Retail - module V2 - module AnalyticsService - ## - # Client for the AnalyticsService service. - # - # Service for managing & accessing retail search business metric. - # Retail recommendation business metric is currently not available. - # - class Client - # @private - API_VERSION = "" - - # @private - DEFAULT_ENDPOINT_TEMPLATE = "retail.$UNIVERSE_DOMAIN$" - - # @private - attr_reader :analytics_service_stub - - ## - # Configure the AnalyticsService Client class. - # - # See {::Google::Cloud::Retail::V2::AnalyticsService::Client::Configuration} - # for a description of the configuration fields. - # - # @example - # - # # Modify the configuration for all AnalyticsService clients - # ::Google::Cloud::Retail::V2::AnalyticsService::Client.configure do |config| - # config.timeout = 10.0 - # end - # - # @yield [config] Configure the Client client. - # @yieldparam config [Client::Configuration] - # - # @return [Client::Configuration] - # - def self.configure - @configure ||= begin - namespace = ["Google", "Cloud", "Retail", "V2"] - parent_config = while namespace.any? - parent_name = namespace.join "::" - parent_const = const_get parent_name - break parent_const.configure if parent_const.respond_to? :configure - namespace.pop - end - default_config = Client::Configuration.new parent_config - - default_config.rpcs.export_analytics_metrics.timeout = 60.0 - default_config.rpcs.export_analytics_metrics.retry_policy = { - initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [14, 4] - } - - default_config - end - yield @configure if block_given? - @configure - end - - ## - # Configure the AnalyticsService Client instance. - # - # The configuration is set to the derived mode, meaning that values can be changed, - # but structural changes (adding new fields, etc.) are not allowed. Structural changes - # should be made on {Client.configure}. - # - # See {::Google::Cloud::Retail::V2::AnalyticsService::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 - @analytics_service_stub.universe_domain - end - - ## - # Create a new AnalyticsService client object. - # - # @example - # - # # Create a client using the default configuration - # client = ::Google::Cloud::Retail::V2::AnalyticsService::Client.new - # - # # Create a client using a custom configuration - # client = ::Google::Cloud::Retail::V2::AnalyticsService::Client.new do |config| - # config.timeout = 10.0 - # end - # - # @yield [config] Configure the AnalyticsService client. - # @yieldparam config [Client::Configuration] - # - def initialize - # These require statements are intentionally placed here to initialize - # the gRPC module only when it's required. - # See https://github.com/googleapis/toolkit/issues/446 - require "gapic/grpc" - require "google/cloud/retail/v2/analytics_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 - - @analytics_service_stub = ::Gapic::ServiceStub.new( - ::Google::Cloud::Retail::V2::AnalyticsService::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 - ) - - @analytics_service_stub.stub_logger&.info do |entry| - entry.set_system_name - entry.set_service - entry.message = "Created client for #{entry.service}" - entry.set_credentials_fields credentials - entry.set "customEndpoint", @config.endpoint if @config.endpoint - entry.set "defaultTimeout", @config.timeout if @config.timeout - entry.set "quotaProject", @quota_project_id if @quota_project_id - end - - @location_client = Google::Cloud::Location::Locations::Client.new do |config| - config.credentials = credentials - config.quota_project = @quota_project_id - config.endpoint = @analytics_service_stub.endpoint - config.universe_domain = @analytics_service_stub.universe_domain - config.logger = @analytics_service_stub.logger if config.respond_to? :logger= - end - end - - ## - # Get the associated client for long-running operations. - # - # @return [::Google::Cloud::Retail::V2::AnalyticsService::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 - @analytics_service_stub.logger - end - - # Service calls - - ## - # Exports analytics metrics. - # - # `Operation.response` is of type `ExportAnalyticsMetricsResponse`. - # `Operation.metadata` is of type `ExportMetadata`. - # - # @overload export_analytics_metrics(request, options = nil) - # Pass arguments to `export_analytics_metrics` via a request object, either of type - # {::Google::Cloud::Retail::V2::ExportAnalyticsMetricsRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Retail::V2::ExportAnalyticsMetricsRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. - # - # @overload export_analytics_metrics(catalog: nil, output_config: nil, filter: nil) - # Pass arguments to `export_analytics_metrics` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param catalog [::String] - # Required. Full resource name of the parent catalog. - # Expected format: `projects/*/locations/*/catalogs/*` - # @param output_config [::Google::Cloud::Retail::V2::OutputConfig, ::Hash] - # Required. The output location of the data. - # @param filter [::String] - # A filtering expression to specify restrictions on returned metrics. - # The expression is a sequence of terms. Each term applies a restriction to - # the returned metrics. Use this expression to restrict results to a - # specific time range. - # - # Currently we expect only one types of fields: - # - # * `timestamp`: This can be specified twice, once with a - # less than operator and once with a greater than operator. The - # `timestamp` restriction should result in one, contiguous, valid, - # `timestamp` range. - # - # Some examples of valid filters expressions: - # - # * Example 1: `timestamp > "2012-04-23T18:25:43.511Z" - # timestamp < "2012-04-23T18:30:43.511Z"` - # * Example 2: `timestamp > "2012-04-23T18:25:43.511Z"` - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Gapic::Operation] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Gapic::Operation] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/cloud/retail/v2" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Retail::V2::AnalyticsService::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Retail::V2::ExportAnalyticsMetricsRequest.new - # - # # Call the export_analytics_metrics method. - # result = client.export_analytics_metrics 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 export_analytics_metrics request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Retail::V2::ExportAnalyticsMetricsRequest - - # Converts hash 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.export_analytics_metrics.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::Retail::V2::VERSION - metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - header_params = {} - if request.catalog - header_params["catalog"] = request.catalog - 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.export_analytics_metrics.timeout, - metadata: metadata, - retry_policy: @config.rpcs.export_analytics_metrics.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @analytics_service_stub.call_rpc :export_analytics_metrics, 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 AnalyticsService API. - # - # This class represents the configuration for AnalyticsService, - # providing control over timeouts, retry behavior, logging, transport - # parameters, and other low-level controls. Certain parameters can also be - # applied individually to specific RPCs. See - # {::Google::Cloud::Retail::V2::AnalyticsService::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 - # # export_analytics_metrics to 20 seconds, - # # and all remaining timeouts to 10 seconds. - # ::Google::Cloud::Retail::V2::AnalyticsService::Client.configure do |config| - # config.timeout = 10.0 - # config.rpcs.export_analytics_metrics.timeout = 20.0 - # end - # - # # Apply the above configuration only to a new client. - # client = ::Google::Cloud::Retail::V2::AnalyticsService::Client.new do |config| - # config.timeout = 10.0 - # config.rpcs.export_analytics_metrics.timeout = 20.0 - # end - # - # @!attribute [rw] endpoint - # A custom service endpoint, as a hostname or hostname:port. The default is - # nil, indicating to use the default endpoint in the current universe domain. - # @return [::String,nil] - # @!attribute [rw] credentials - # Credentials to send with calls. You may provide any of the following types: - # * (`Google::Auth::Credentials`) A googleauth credentials object - # (see the [googleauth docs](https://rubydoc.info/gems/googleauth/Google/Auth/Credentials)) - # * (`Signet::OAuth2::Client`) A signet oauth2 client object - # (see the [signet docs](https://rubydoc.info/gems/signet/Signet/OAuth2/Client)) - # * (`GRPC::Core::Channel`) a gRPC channel with included credentials - # * (`GRPC::Core::ChannelCredentials`) a gRPC credentails object - # * (`nil`) indicating no credentials - # - # @note Warning: Passing a `String` to a keyfile path or a `Hash` of credentials - # is deprecated. Providing an unvalidated credential configuration to - # Google APIs can compromise the security of your systems and data. - # - # @example - # - # # The recommended way to provide credentials is to use the `make_creds` method - # # on the appropriate credentials class for your environment. - # - # require "googleauth" - # - # credentials = ::Google::Auth::ServiceAccountCredentials.make_creds( - # json_key_io: ::File.open("/path/to/keyfile.json") - # ) - # - # client = ::Google::Cloud::Retail::V2::AnalyticsService::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 = "retail.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 AnalyticsService 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 `export_analytics_metrics` - # @return [::Gapic::Config::Method] - # - attr_reader :export_analytics_metrics - - # @private - def initialize parent_rpcs = nil - export_analytics_metrics_config = parent_rpcs.export_analytics_metrics if parent_rpcs.respond_to? :export_analytics_metrics - @export_analytics_metrics = ::Gapic::Config::Method.new export_analytics_metrics_config - - yield self if block_given? - end - end - end - end - end - end - end - end -end diff --git a/owl-bot-staging/google-cloud-retail-v2/lib/google/cloud/retail/v2/analytics_service/credentials.rb b/owl-bot-staging/google-cloud-retail-v2/lib/google/cloud/retail/v2/analytics_service/credentials.rb deleted file mode 100644 index 89a3470cd910..000000000000 --- a/owl-bot-staging/google-cloud-retail-v2/lib/google/cloud/retail/v2/analytics_service/credentials.rb +++ /dev/null @@ -1,51 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -require "googleauth" - -module Google - module Cloud - module Retail - module V2 - module AnalyticsService - # Credentials for the AnalyticsService API. - class Credentials < ::Google::Auth::Credentials - self.scope = [ - "https://www.googleapis.com/auth/cloud-platform" - ] - self.env_vars = [ - "RETAIL_CREDENTIALS", - "RETAIL_KEYFILE", - "GOOGLE_CLOUD_CREDENTIALS", - "GOOGLE_CLOUD_KEYFILE", - "GCLOUD_KEYFILE", - "RETAIL_CREDENTIALS_JSON", - "RETAIL_KEYFILE_JSON", - "GOOGLE_CLOUD_CREDENTIALS_JSON", - "GOOGLE_CLOUD_KEYFILE_JSON", - "GCLOUD_KEYFILE_JSON" - ] - self.paths = [ - "~/.config/google_cloud/application_default_credentials.json" - ] - end - end - end - end - end -end diff --git a/owl-bot-staging/google-cloud-retail-v2/lib/google/cloud/retail/v2/analytics_service/operations.rb b/owl-bot-staging/google-cloud-retail-v2/lib/google/cloud/retail/v2/analytics_service/operations.rb deleted file mode 100644 index 0eb1403cc2f0..000000000000 --- a/owl-bot-staging/google-cloud-retail-v2/lib/google/cloud/retail/v2/analytics_service/operations.rb +++ /dev/null @@ -1,841 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -require "gapic/operation" -require "google/longrunning/operations_pb" - -module Google - module Cloud - module Retail - module V2 - module AnalyticsService - # Service that implements Longrunning Operations API. - class Operations - # @private - API_VERSION = "" - - # @private - DEFAULT_ENDPOINT_TEMPLATE = "retail.$UNIVERSE_DOMAIN$" - - # @private - attr_reader :operations_stub - - ## - # Configuration for the AnalyticsService 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 AnalyticsService 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::Retail::V2::VERSION - metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - header_params = {} - if request.name - header_params["name"] = request.name - end - - request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") - metadata[:"x-goog-request-params"] ||= request_params_header - - options.apply_defaults timeout: @config.rpcs.list_operations.timeout, - metadata: metadata, - retry_policy: @config.rpcs.list_operations.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @operations_stub.call_rpc :list_operations, request, options: options do |response, operation| - wrap_lro_operation = ->(op_response) { ::Gapic::Operation.new op_response, @operations_client } - response = ::Gapic::PagedEnumerable.new @operations_stub, :list_operations, request, response, operation, options, format_resource: wrap_lro_operation - yield response, operation if block_given? - throw :response, response - end - rescue ::GRPC::BadStatus => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Gets the latest state of a long-running operation. Clients can use this - # method to poll the operation result at intervals as recommended by the API - # service. - # - # @overload get_operation(request, options = nil) - # Pass arguments to `get_operation` via a request object, either of type - # {::Google::Longrunning::GetOperationRequest} or an equivalent Hash. - # - # @param request [::Google::Longrunning::GetOperationRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. - # - # @overload get_operation(name: nil) - # Pass arguments to `get_operation` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param name [::String] - # The name of the operation resource. - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Gapic::Operation] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Gapic::Operation] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/longrunning" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Longrunning::Operations::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Longrunning::GetOperationRequest.new - # - # # Call the get_operation method. - # result = client.get_operation request - # - # # The returned object is of type Gapic::Operation. You can use it to - # # check the status of an operation, cancel it, or wait for results. - # # Here is how to wait for a response. - # result.wait_until_done! timeout: 60 - # if result.response? - # p result.response - # else - # puts "No response received." - # end - # - def get_operation request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Longrunning::GetOperationRequest - - # Converts hash and nil to an options object - options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h - - # Customize the options with defaults - metadata = @config.rpcs.get_operation.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::Retail::V2::VERSION - metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - header_params = {} - if request.name - header_params["name"] = request.name - end - - request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") - metadata[:"x-goog-request-params"] ||= request_params_header - - options.apply_defaults timeout: @config.rpcs.get_operation.timeout, - metadata: metadata, - retry_policy: @config.rpcs.get_operation.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @operations_stub.call_rpc :get_operation, request, options: options do |response, operation| - response = ::Gapic::Operation.new response, @operations_client, options: options - yield response, operation if block_given? - throw :response, response - end - rescue ::GRPC::BadStatus => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Deletes a long-running operation. This method indicates that the client is - # no longer interested in the operation result. It does not cancel the - # operation. If the server doesn't support this method, it returns - # `google.rpc.Code.UNIMPLEMENTED`. - # - # @overload delete_operation(request, options = nil) - # Pass arguments to `delete_operation` via a request object, either of type - # {::Google::Longrunning::DeleteOperationRequest} or an equivalent Hash. - # - # @param request [::Google::Longrunning::DeleteOperationRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. - # - # @overload delete_operation(name: nil) - # Pass arguments to `delete_operation` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param name [::String] - # The name of the operation resource to be deleted. - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Google::Protobuf::Empty] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Google::Protobuf::Empty] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/longrunning" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Longrunning::Operations::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Longrunning::DeleteOperationRequest.new - # - # # Call the delete_operation method. - # result = client.delete_operation request - # - # # The returned object is of type Google::Protobuf::Empty. - # p result - # - def delete_operation request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Longrunning::DeleteOperationRequest - - # Converts hash and nil to an options object - options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h - - # Customize the options with defaults - metadata = @config.rpcs.delete_operation.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::Retail::V2::VERSION - metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - header_params = {} - if request.name - header_params["name"] = request.name - end - - request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") - metadata[:"x-goog-request-params"] ||= request_params_header - - options.apply_defaults timeout: @config.rpcs.delete_operation.timeout, - metadata: metadata, - retry_policy: @config.rpcs.delete_operation.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @operations_stub.call_rpc :delete_operation, request, options: options do |response, operation| - yield response, operation if block_given? - end - rescue ::GRPC::BadStatus => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Starts asynchronous cancellation on a long-running operation. The server - # makes a best effort to cancel the operation, but success is not - # guaranteed. If the server doesn't support this method, it returns - # `google.rpc.Code.UNIMPLEMENTED`. Clients can use - # Operations.GetOperation or - # other methods to check whether the cancellation succeeded or whether the - # operation completed despite cancellation. On successful cancellation, - # the operation is not deleted; instead, it becomes an operation with - # an {::Google::Longrunning::Operation#error Operation.error} value with a - # {::Google::Rpc::Status#code google.rpc.Status.code} of `1`, corresponding to - # `Code.CANCELLED`. - # - # @overload cancel_operation(request, options = nil) - # Pass arguments to `cancel_operation` via a request object, either of type - # {::Google::Longrunning::CancelOperationRequest} or an equivalent Hash. - # - # @param request [::Google::Longrunning::CancelOperationRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. - # - # @overload cancel_operation(name: nil) - # Pass arguments to `cancel_operation` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param name [::String] - # The name of the operation resource to be cancelled. - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Google::Protobuf::Empty] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Google::Protobuf::Empty] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/longrunning" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Longrunning::Operations::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Longrunning::CancelOperationRequest.new - # - # # Call the cancel_operation method. - # result = client.cancel_operation request - # - # # The returned object is of type Google::Protobuf::Empty. - # p result - # - def cancel_operation request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Longrunning::CancelOperationRequest - - # Converts hash and nil to an options object - options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h - - # Customize the options with defaults - metadata = @config.rpcs.cancel_operation.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::Retail::V2::VERSION - metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - header_params = {} - if request.name - header_params["name"] = request.name - end - - request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") - metadata[:"x-goog-request-params"] ||= request_params_header - - options.apply_defaults timeout: @config.rpcs.cancel_operation.timeout, - metadata: metadata, - retry_policy: @config.rpcs.cancel_operation.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @operations_stub.call_rpc :cancel_operation, request, options: options do |response, operation| - yield response, operation if block_given? - end - rescue ::GRPC::BadStatus => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Waits until the specified long-running operation is done or reaches at most - # a specified timeout, returning the latest state. If the operation is - # already done, the latest state is immediately returned. If the timeout - # specified is greater than the default HTTP/RPC timeout, the HTTP/RPC - # timeout is used. If the server does not support this method, it returns - # `google.rpc.Code.UNIMPLEMENTED`. - # Note that this method is on a best-effort basis. It may return the latest - # state before the specified timeout (including immediately), meaning even an - # immediate response is no guarantee that the operation is done. - # - # @overload wait_operation(request, options = nil) - # Pass arguments to `wait_operation` via a request object, either of type - # {::Google::Longrunning::WaitOperationRequest} or an equivalent Hash. - # - # @param request [::Google::Longrunning::WaitOperationRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. - # - # @overload wait_operation(name: nil, timeout: nil) - # Pass arguments to `wait_operation` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param name [::String] - # The name of the operation resource to wait on. - # @param timeout [::Google::Protobuf::Duration, ::Hash] - # The maximum duration to wait before timing out. If left blank, the wait - # will be at most the time permitted by the underlying HTTP/RPC protocol. - # If RPC context deadline is also specified, the shorter one will be used. - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Gapic::Operation] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Gapic::Operation] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/longrunning" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Longrunning::Operations::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Longrunning::WaitOperationRequest.new - # - # # Call the wait_operation method. - # result = client.wait_operation request - # - # # The returned object is of type Gapic::Operation. You can use it to - # # check the status of an operation, cancel it, or wait for results. - # # Here is how to wait for a response. - # result.wait_until_done! timeout: 60 - # if result.response? - # p result.response - # else - # puts "No response received." - # end - # - def wait_operation request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Longrunning::WaitOperationRequest - - # Converts hash and nil to an options object - options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h - - # Customize the options with defaults - metadata = @config.rpcs.wait_operation.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::Retail::V2::VERSION - metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - options.apply_defaults timeout: @config.rpcs.wait_operation.timeout, - metadata: metadata, - retry_policy: @config.rpcs.wait_operation.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @operations_stub.call_rpc :wait_operation, request, options: options do |response, operation| - response = ::Gapic::Operation.new response, @operations_client, options: options - yield response, operation if block_given? - throw :response, response - end - rescue ::GRPC::BadStatus => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Configuration class for the Operations API. - # - # This class represents the configuration for Operations, - # providing control over timeouts, retry behavior, logging, transport - # parameters, and other low-level controls. Certain parameters can also be - # applied individually to specific RPCs. See - # {::Google::Longrunning::Operations::Client::Configuration::Rpcs} - # for a list of RPCs that can be configured independently. - # - # Configuration can be applied globally to all clients, or to a single client - # on construction. - # - # @example - # - # # Modify the global config, setting the timeout for - # # list_operations to 20 seconds, - # # and all remaining timeouts to 10 seconds. - # ::Google::Longrunning::Operations::Client.configure do |config| - # config.timeout = 10.0 - # config.rpcs.list_operations.timeout = 20.0 - # end - # - # # Apply the above configuration only to a new client. - # client = ::Google::Longrunning::Operations::Client.new do |config| - # config.timeout = 10.0 - # config.rpcs.list_operations.timeout = 20.0 - # end - # - # @!attribute [rw] endpoint - # A custom service endpoint, as a hostname or hostname:port. The default is - # nil, indicating to use the default endpoint in the current universe domain. - # @return [::String,nil] - # @!attribute [rw] credentials - # Credentials to send with calls. You may provide any of the following types: - # * (`Google::Auth::Credentials`) A googleauth credentials object - # (see the [googleauth docs](https://rubydoc.info/gems/googleauth/Google/Auth/Credentials)) - # * (`Signet::OAuth2::Client`) A signet oauth2 client object - # (see the [signet docs](https://rubydoc.info/gems/signet/Signet/OAuth2/Client)) - # * (`GRPC::Core::Channel`) a gRPC channel with included credentials - # * (`GRPC::Core::ChannelCredentials`) a gRPC credentails object - # * (`nil`) indicating no credentials - # - # @note Warning: Passing a `String` to a keyfile path or a `Hash` of credentials - # is deprecated. Providing an unvalidated credential configuration to - # Google APIs can compromise the security of your systems and data. - # - # @example - # - # # The recommended way to provide credentials is to use the `make_creds` method - # # on the appropriate credentials class for your environment. - # - # require "googleauth" - # - # credentials = ::Google::Auth::ServiceAccountCredentials.make_creds( - # json_key_io: ::File.open("/path/to/keyfile.json") - # ) - # - # client = ::Google::Longrunning::Operations::Client.new do |config| - # config.credentials = credentials - # end - # - # @note Warning: If you accept a credential configuration (JSON file or Hash) from an - # external source for authentication to Google Cloud, you must validate it before - # providing it to a Google API client library. Providing an unvalidated credential - # configuration to Google APIs can compromise the security of your systems and data. - # For more information, refer to [Validate credential configurations from external - # sources](https://cloud.google.com/docs/authentication/external/externally-sourced-credentials). - # @return [::Object] - # @!attribute [rw] scope - # The OAuth scopes - # @return [::Array<::String>] - # @!attribute [rw] lib_name - # The library name as recorded in instrumentation and logging - # @return [::String] - # @!attribute [rw] lib_version - # The library version as recorded in instrumentation and logging - # @return [::String] - # @!attribute [rw] channel_args - # Extra parameters passed to the gRPC channel. Note: this is ignored if a - # `GRPC::Core::Channel` object is provided as the credential. - # @return [::Hash] - # @!attribute [rw] interceptors - # An array of interceptors that are run before calls are executed. - # @return [::Array<::GRPC::ClientInterceptor>] - # @!attribute [rw] timeout - # The call timeout in seconds. - # @return [::Numeric] - # @!attribute [rw] metadata - # Additional gRPC headers to be sent with the call. - # @return [::Hash{::Symbol=>::String}] - # @!attribute [rw] retry_policy - # The retry policy. The value is a hash with the following keys: - # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds. - # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds. - # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier. - # * `:retry_codes` (*type:* `Array`) - The error codes that should - # trigger a retry. - # @return [::Hash] - # @!attribute [rw] quota_project - # A separate project against which to charge quota. - # @return [::String] - # @!attribute [rw] universe_domain - # The universe domain within which to make requests. This determines the - # default endpoint URL. The default value of nil uses the environment - # universe (usually the default "googleapis.com" universe). - # @return [::String,nil] - # @!attribute [rw] logger - # A custom logger to use for request/response debug logging, or the value - # `:default` (the default) to construct a default logger, or `nil` to - # explicitly disable logging. - # @return [::Logger,:default,nil] - # - class Configuration - extend ::Gapic::Config - - # @private - # The endpoint specific to the default "googleapis.com" universe. Deprecated. - DEFAULT_ENDPOINT = "retail.googleapis.com" - - config_attr :endpoint, nil, ::String, nil - config_attr :credentials, nil do |value| - allowed = [::String, ::Hash, ::Proc, ::Symbol, ::Google::Auth::Credentials, ::Google::Auth::BaseClient, ::Signet::OAuth2::Client, nil] - allowed += [::GRPC::Core::Channel, ::GRPC::Core::ChannelCredentials] if defined? ::GRPC::Core::Channel - allowed.any? { |klass| klass === value } - end - config_attr :scope, nil, ::String, ::Array, nil - config_attr :lib_name, nil, ::String, nil - config_attr :lib_version, nil, ::String, nil - config_attr(:channel_args, { "grpc.service_config_disable_resolution" => 1 }, ::Hash, nil) - config_attr :interceptors, nil, ::Array, nil - config_attr :timeout, nil, ::Numeric, nil - config_attr :metadata, nil, ::Hash, nil - config_attr :retry_policy, nil, ::Hash, ::Proc, nil - config_attr :quota_project, nil, ::String, nil - config_attr :universe_domain, nil, ::String, nil - config_attr :logger, :default, ::Logger, nil, :default - - # @private - def initialize parent_config = nil - @parent_config = parent_config unless parent_config.nil? - - yield self if block_given? - end - - ## - # Configurations for individual RPCs - # @return [Rpcs] - # - def rpcs - @rpcs ||= begin - parent_rpcs = nil - parent_rpcs = @parent_config.rpcs if defined?(@parent_config) && @parent_config.respond_to?(:rpcs) - Rpcs.new parent_rpcs - end - end - - ## - # Configuration for the channel pool - # @return [::Gapic::ServiceStub::ChannelPool::Configuration] - # - def channel_pool - @channel_pool ||= ::Gapic::ServiceStub::ChannelPool::Configuration.new - end - - ## - # Configuration RPC class for the Operations API. - # - # Includes fields providing the configuration for each RPC in this service. - # Each configuration object is of type `Gapic::Config::Method` and includes - # the following configuration fields: - # - # * `timeout` (*type:* `Numeric`) - The call timeout in seconds - # * `metadata` (*type:* `Hash{Symbol=>String}`) - Additional gRPC headers - # * `retry_policy (*type:* `Hash`) - The retry policy. The policy fields - # include the following keys: - # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds. - # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds. - # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier. - # * `:retry_codes` (*type:* `Array`) - The error codes that should - # trigger a retry. - # - class Rpcs - ## - # RPC-specific configuration for `list_operations` - # @return [::Gapic::Config::Method] - # - attr_reader :list_operations - ## - # RPC-specific configuration for `get_operation` - # @return [::Gapic::Config::Method] - # - attr_reader :get_operation - ## - # RPC-specific configuration for `delete_operation` - # @return [::Gapic::Config::Method] - # - attr_reader :delete_operation - ## - # RPC-specific configuration for `cancel_operation` - # @return [::Gapic::Config::Method] - # - attr_reader :cancel_operation - ## - # RPC-specific configuration for `wait_operation` - # @return [::Gapic::Config::Method] - # - attr_reader :wait_operation - - # @private - def initialize parent_rpcs = nil - list_operations_config = parent_rpcs.list_operations if parent_rpcs.respond_to? :list_operations - @list_operations = ::Gapic::Config::Method.new list_operations_config - get_operation_config = parent_rpcs.get_operation if parent_rpcs.respond_to? :get_operation - @get_operation = ::Gapic::Config::Method.new get_operation_config - delete_operation_config = parent_rpcs.delete_operation if parent_rpcs.respond_to? :delete_operation - @delete_operation = ::Gapic::Config::Method.new delete_operation_config - cancel_operation_config = parent_rpcs.cancel_operation if parent_rpcs.respond_to? :cancel_operation - @cancel_operation = ::Gapic::Config::Method.new cancel_operation_config - wait_operation_config = parent_rpcs.wait_operation if parent_rpcs.respond_to? :wait_operation - @wait_operation = ::Gapic::Config::Method.new wait_operation_config - - yield self if block_given? - end - end - end - end - end - end - end - end -end diff --git a/owl-bot-staging/google-cloud-retail-v2/lib/google/cloud/retail/v2/analytics_service/rest.rb b/owl-bot-staging/google-cloud-retail-v2/lib/google/cloud/retail/v2/analytics_service/rest.rb deleted file mode 100644 index df3ab00fece5..000000000000 --- a/owl-bot-staging/google-cloud-retail-v2/lib/google/cloud/retail/v2/analytics_service/rest.rb +++ /dev/null @@ -1,53 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -require "gapic/rest" -require "gapic/config" -require "gapic/config/method" - -require "google/cloud/retail/v2/version" - -require "google/cloud/retail/v2/analytics_service/credentials" -require "google/cloud/retail/v2/analytics_service/rest/operations" -require "google/cloud/retail/v2/analytics_service/rest/client" - -module Google - module Cloud - module Retail - module V2 - ## - # Service for managing & accessing retail search business metric. - # Retail recommendation business metric is currently not available. - # - # To load this service and instantiate a REST client: - # - # require "google/cloud/retail/v2/analytics_service/rest" - # client = ::Google::Cloud::Retail::V2::AnalyticsService::Rest::Client.new - # - module AnalyticsService - # Client for the REST transport - module Rest - end - end - end - end - end -end - -helper_path = ::File.join __dir__, "rest", "helpers.rb" -require "google/cloud/retail/v2/analytics_service/rest/helpers" if ::File.file? helper_path diff --git a/owl-bot-staging/google-cloud-retail-v2/lib/google/cloud/retail/v2/analytics_service/rest/client.rb b/owl-bot-staging/google-cloud-retail-v2/lib/google/cloud/retail/v2/analytics_service/rest/client.rb deleted file mode 100644 index ecfefea1a530..000000000000 --- a/owl-bot-staging/google-cloud-retail-v2/lib/google/cloud/retail/v2/analytics_service/rest/client.rb +++ /dev/null @@ -1,491 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -require "google/cloud/errors" -require "google/cloud/retail/v2/analytics_service_pb" -require "google/cloud/retail/v2/analytics_service/rest/service_stub" -require "google/cloud/location/rest" - -module Google - module Cloud - module Retail - module V2 - module AnalyticsService - module Rest - ## - # REST client for the AnalyticsService service. - # - # Service for managing & accessing retail search business metric. - # Retail recommendation business metric is currently not available. - # - class Client - # @private - API_VERSION = "" - - # @private - DEFAULT_ENDPOINT_TEMPLATE = "retail.$UNIVERSE_DOMAIN$" - - # @private - attr_reader :analytics_service_stub - - ## - # Configure the AnalyticsService Client class. - # - # See {::Google::Cloud::Retail::V2::AnalyticsService::Rest::Client::Configuration} - # for a description of the configuration fields. - # - # @example - # - # # Modify the configuration for all AnalyticsService clients - # ::Google::Cloud::Retail::V2::AnalyticsService::Rest::Client.configure do |config| - # config.timeout = 10.0 - # end - # - # @yield [config] Configure the Client client. - # @yieldparam config [Client::Configuration] - # - # @return [Client::Configuration] - # - def self.configure - @configure ||= begin - namespace = ["Google", "Cloud", "Retail", "V2"] - parent_config = while namespace.any? - parent_name = namespace.join "::" - parent_const = const_get parent_name - break parent_const.configure if parent_const.respond_to? :configure - namespace.pop - end - default_config = Client::Configuration.new parent_config - - default_config.rpcs.export_analytics_metrics.timeout = 60.0 - default_config.rpcs.export_analytics_metrics.retry_policy = { - initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [14, 4] - } - - default_config - end - yield @configure if block_given? - @configure - end - - ## - # Configure the AnalyticsService Client instance. - # - # The configuration is set to the derived mode, meaning that values can be changed, - # but structural changes (adding new fields, etc.) are not allowed. Structural changes - # should be made on {Client.configure}. - # - # See {::Google::Cloud::Retail::V2::AnalyticsService::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 - @analytics_service_stub.universe_domain - end - - ## - # Create a new AnalyticsService REST client object. - # - # @example - # - # # Create a client using the default configuration - # client = ::Google::Cloud::Retail::V2::AnalyticsService::Rest::Client.new - # - # # Create a client using a custom configuration - # client = ::Google::Cloud::Retail::V2::AnalyticsService::Rest::Client.new do |config| - # config.timeout = 10.0 - # end - # - # @yield [config] Configure the AnalyticsService client. - # @yieldparam config [Client::Configuration] - # - def initialize - # Create the configuration object - @config = Configuration.new Client.configure - - # Yield the configuration if needed - yield @config if block_given? - - # Create credentials - credentials = @config.credentials - # Use self-signed JWT if the endpoint is unchanged from default, - # but only if the default endpoint does not have a region prefix. - enable_self_signed_jwt = @config.endpoint.nil? || - (@config.endpoint == Configuration::DEFAULT_ENDPOINT && - !@config.endpoint.split(".").first.include?("-")) - credentials ||= Credentials.default scope: @config.scope, - enable_self_signed_jwt: enable_self_signed_jwt - if credentials.is_a?(::String) || credentials.is_a?(::Hash) - credentials = Credentials.new credentials, scope: @config.scope - end - - @quota_project_id = @config.quota_project - @quota_project_id ||= credentials.quota_project_id if credentials.respond_to? :quota_project_id - - @operations_client = ::Google::Cloud::Retail::V2::AnalyticsService::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 - - @analytics_service_stub = ::Google::Cloud::Retail::V2::AnalyticsService::Rest::ServiceStub.new( - endpoint: @config.endpoint, - endpoint_template: DEFAULT_ENDPOINT_TEMPLATE, - universe_domain: @config.universe_domain, - credentials: credentials, - logger: @config.logger - ) - - @analytics_service_stub.logger(stub: true)&.info do |entry| - entry.set_system_name - entry.set_service - entry.message = "Created client for #{entry.service}" - entry.set_credentials_fields credentials - entry.set "customEndpoint", @config.endpoint if @config.endpoint - entry.set "defaultTimeout", @config.timeout if @config.timeout - entry.set "quotaProject", @quota_project_id if @quota_project_id - end - - @location_client = Google::Cloud::Location::Locations::Rest::Client.new do |config| - config.credentials = credentials - config.quota_project = @quota_project_id - config.endpoint = @analytics_service_stub.endpoint - config.universe_domain = @analytics_service_stub.universe_domain - config.logger = @analytics_service_stub.logger if config.respond_to? :logger= - end - end - - ## - # Get the associated client for long-running operations. - # - # @return [::Google::Cloud::Retail::V2::AnalyticsService::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 - @analytics_service_stub.logger - end - - # Service calls - - ## - # Exports analytics metrics. - # - # `Operation.response` is of type `ExportAnalyticsMetricsResponse`. - # `Operation.metadata` is of type `ExportMetadata`. - # - # @overload export_analytics_metrics(request, options = nil) - # Pass arguments to `export_analytics_metrics` via a request object, either of type - # {::Google::Cloud::Retail::V2::ExportAnalyticsMetricsRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Retail::V2::ExportAnalyticsMetricsRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @overload export_analytics_metrics(catalog: nil, output_config: nil, filter: nil) - # Pass arguments to `export_analytics_metrics` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param catalog [::String] - # Required. Full resource name of the parent catalog. - # Expected format: `projects/*/locations/*/catalogs/*` - # @param output_config [::Google::Cloud::Retail::V2::OutputConfig, ::Hash] - # Required. The output location of the data. - # @param filter [::String] - # A filtering expression to specify restrictions on returned metrics. - # The expression is a sequence of terms. Each term applies a restriction to - # the returned metrics. Use this expression to restrict results to a - # specific time range. - # - # Currently we expect only one types of fields: - # - # * `timestamp`: This can be specified twice, once with a - # less than operator and once with a greater than operator. The - # `timestamp` restriction should result in one, contiguous, valid, - # `timestamp` range. - # - # Some examples of valid filters expressions: - # - # * Example 1: `timestamp > "2012-04-23T18:25:43.511Z" - # timestamp < "2012-04-23T18:30:43.511Z"` - # * Example 2: `timestamp > "2012-04-23T18:25:43.511Z"` - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Gapic::Operation] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Gapic::Operation] - # - # @raise [::Google::Cloud::Error] if the REST call is aborted. - # - # @example Basic example - # require "google/cloud/retail/v2" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Retail::V2::AnalyticsService::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Retail::V2::ExportAnalyticsMetricsRequest.new - # - # # Call the export_analytics_metrics method. - # result = client.export_analytics_metrics 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 export_analytics_metrics request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Retail::V2::ExportAnalyticsMetricsRequest - - # Converts hash 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.export_analytics_metrics.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::Retail::V2::VERSION, - transports_version_send: [:rest] - - call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - options.apply_defaults timeout: @config.rpcs.export_analytics_metrics.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.export_analytics_metrics.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @analytics_service_stub.export_analytics_metrics 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 - - ## - # Configuration class for the AnalyticsService REST API. - # - # This class represents the configuration for AnalyticsService REST, - # providing control over timeouts, retry behavior, logging, transport - # parameters, and other low-level controls. Certain parameters can also be - # applied individually to specific RPCs. See - # {::Google::Cloud::Retail::V2::AnalyticsService::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 - # # export_analytics_metrics to 20 seconds, - # # and all remaining timeouts to 10 seconds. - # ::Google::Cloud::Retail::V2::AnalyticsService::Rest::Client.configure do |config| - # config.timeout = 10.0 - # config.rpcs.export_analytics_metrics.timeout = 20.0 - # end - # - # # Apply the above configuration only to a new client. - # client = ::Google::Cloud::Retail::V2::AnalyticsService::Rest::Client.new do |config| - # config.timeout = 10.0 - # config.rpcs.export_analytics_metrics.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 = "retail.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 AnalyticsService 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 `export_analytics_metrics` - # @return [::Gapic::Config::Method] - # - attr_reader :export_analytics_metrics - - # @private - def initialize parent_rpcs = nil - export_analytics_metrics_config = parent_rpcs.export_analytics_metrics if parent_rpcs.respond_to? :export_analytics_metrics - @export_analytics_metrics = ::Gapic::Config::Method.new export_analytics_metrics_config - - yield self if block_given? - end - end - end - end - end - end - end - end - end -end diff --git a/owl-bot-staging/google-cloud-retail-v2/lib/google/cloud/retail/v2/analytics_service/rest/operations.rb b/owl-bot-staging/google-cloud-retail-v2/lib/google/cloud/retail/v2/analytics_service/rest/operations.rb deleted file mode 100644 index 90ab3b1baaba..000000000000 --- a/owl-bot-staging/google-cloud-retail-v2/lib/google/cloud/retail/v2/analytics_service/rest/operations.rb +++ /dev/null @@ -1,960 +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 Cloud - module Retail - module V2 - module AnalyticsService - module Rest - # Service that implements Longrunning Operations API. - class Operations - # @private - API_VERSION = "" - - # @private - DEFAULT_ENDPOINT_TEMPLATE = "retail.$UNIVERSE_DOMAIN$" - - # @private - attr_reader :operations_stub - - ## - # Configuration for the AnalyticsService 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 AnalyticsService 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::Retail::V2::VERSION, - transports_version_send: [:rest] - - call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - options.apply_defaults timeout: @config.rpcs.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::Retail::V2::VERSION, - transports_version_send: [:rest] - - call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - options.apply_defaults timeout: @config.rpcs.get_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::Retail::V2::VERSION, - transports_version_send: [:rest] - - call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - options.apply_defaults timeout: @config.rpcs.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::Retail::V2::VERSION, - transports_version_send: [:rest] - - call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - options.apply_defaults timeout: @config.rpcs.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 = "retail.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: "/v2/{name}/operations", - matches: [ - ["name", %r{^projects/[^/]+/locations/[^/]+/?$}, false] - ] - ) - .with_bindings( - uri_method: :get, - uri_template: "/v2/{name}/operations", - matches: [ - ["name", %r{^projects/[^/]+/locations/[^/]+/catalogs/[^/]+/?$}, false] - ] - ) - .with_bindings( - uri_method: :get, - uri_template: "/v2/{name}/operations", - matches: [ - ["name", %r{^projects/[^/]+/?$}, 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: "/v2/{name}", - matches: [ - ["name", %r{^projects/[^/]+/locations/[^/]+/operations/[^/]+/?$}, false] - ] - ) - .with_bindings( - uri_method: :get, - uri_template: "/v2/{name}", - matches: [ - ["name", %r{^projects/[^/]+/locations/[^/]+/catalogs/[^/]+/branches/[^/]+/operations/[^/]+/?$}, false] - ] - ) - .with_bindings( - uri_method: :get, - uri_template: "/v2/{name}", - matches: [ - ["name", %r{^projects/[^/]+/locations/[^/]+/catalogs/[^/]+/operations/[^/]+/?$}, false] - ] - ) - .with_bindings( - uri_method: :get, - uri_template: "/v2/{name}", - matches: [ - ["name", %r{^projects/[^/]+/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 -end diff --git a/owl-bot-staging/google-cloud-retail-v2/lib/google/cloud/retail/v2/analytics_service/rest/service_stub.rb b/owl-bot-staging/google-cloud-retail-v2/lib/google/cloud/retail/v2/analytics_service/rest/service_stub.rb deleted file mode 100644 index b35aff3ed4cc..000000000000 --- a/owl-bot-staging/google-cloud-retail-v2/lib/google/cloud/retail/v2/analytics_service/rest/service_stub.rb +++ /dev/null @@ -1,143 +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/retail/v2/analytics_service_pb" - -module Google - module Cloud - module Retail - module V2 - module AnalyticsService - module Rest - ## - # REST service stub for the AnalyticsService 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 export_analytics_metrics REST call - # - # @param request_pb [::Google::Cloud::Retail::V2::ExportAnalyticsMetricsRequest] - # 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 export_analytics_metrics request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_export_analytics_metrics_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: "export_analytics_metrics", - 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 - - ## - # @private - # - # GRPC transcoding helper method for the export_analytics_metrics REST call - # - # @param request_pb [::Google::Cloud::Retail::V2::ExportAnalyticsMetricsRequest] - # A request object representing the call parameters. Required. - # @return [Array(String, [String, nil], Hash{String => String})] - # Uri, Body, Query string parameters - def self.transcode_export_analytics_metrics_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :post, - uri_template: "/v2/{catalog}:exportAnalyticsMetrics", - body: "*", - matches: [ - ["catalog", %r{^projects/[^/]+/locations/[^/]+/catalogs/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - end - end - end - end - end - end -end diff --git a/owl-bot-staging/google-cloud-retail-v2/lib/google/cloud/retail/v2/analytics_service_pb.rb b/owl-bot-staging/google-cloud-retail-v2/lib/google/cloud/retail/v2/analytics_service_pb.rb deleted file mode 100644 index 8ce3ddaf6f69..000000000000 --- a/owl-bot-staging/google-cloud-retail-v2/lib/google/cloud/retail/v2/analytics_service_pb.rb +++ /dev/null @@ -1,27 +0,0 @@ -# frozen_string_literal: true -# Generated by the protocol buffer compiler. DO NOT EDIT! -# source: google/cloud/retail/v2/analytics_service.proto - -require 'google/protobuf' - -require 'google/api/annotations_pb' -require 'google/api/client_pb' -require 'google/api/field_behavior_pb' -require 'google/api/resource_pb' -require 'google/cloud/retail/v2/export_config_pb' -require 'google/longrunning/operations_pb' - - -descriptor_data = "\n.google/cloud/retail/v2/analytics_service.proto\x12\x16google.cloud.retail.v2\x1a\x1cgoogle/api/annotations.proto\x1a\x17google/api/client.proto\x1a\x1fgoogle/api/field_behavior.proto\x1a\x19google/api/resource.proto\x1a*google/cloud/retail/v2/export_config.proto\x1a#google/longrunning/operations.proto2\x83\x03\n\x10\x41nalyticsService\x12\xa3\x02\n\x16\x45xportAnalyticsMetrics\x12\x35.google.cloud.retail.v2.ExportAnalyticsMetricsRequest\x1a\x1d.google.longrunning.Operation\"\xb2\x01\xca\x41^\n5google.cloud.retail.v2.ExportAnalyticsMetricsResponse\x12%google.cloud.retail.v2.ExportMetadata\x82\xd3\xe4\x93\x02K\"F/v2/{catalog=projects/*/locations/*/catalogs/*}:exportAnalyticsMetrics:\x01*\x1aI\xca\x41\x15retail.googleapis.com\xd2\x41.https://www.googleapis.com/auth/cloud-platformB\xc0\x01\n\x1a\x63om.google.cloud.retail.v2B\x15\x41nalyticsServiceProtoP\x01Z2cloud.google.com/go/retail/apiv2/retailpb;retailpb\xa2\x02\x06RETAIL\xaa\x02\x16Google.Cloud.Retail.V2\xca\x02\x16Google\\Cloud\\Retail\\V2\xea\x02\x19Google::Cloud::Retail::V2b\x06proto3" - -pool = ::Google::Protobuf::DescriptorPool.generated_pool -pool.add_serialized_file(descriptor_data) - -module Google - module Cloud - module Retail - module V2 - end - end - end -end diff --git a/owl-bot-staging/google-cloud-retail-v2/lib/google/cloud/retail/v2/analytics_service_services_pb.rb b/owl-bot-staging/google-cloud-retail-v2/lib/google/cloud/retail/v2/analytics_service_services_pb.rb deleted file mode 100644 index b9425168a3f7..000000000000 --- a/owl-bot-staging/google-cloud-retail-v2/lib/google/cloud/retail/v2/analytics_service_services_pb.rb +++ /dev/null @@ -1,49 +0,0 @@ -# Generated by the protocol buffer compiler. DO NOT EDIT! -# Source: google/cloud/retail/v2/analytics_service.proto for package 'Google.Cloud.Retail.V2' -# Original file comments: -# 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 -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. -# - -require 'grpc' -require 'google/cloud/retail/v2/analytics_service_pb' - -module Google - module Cloud - module Retail - module V2 - module AnalyticsService - # Service for managing & accessing retail search business metric. - # Retail recommendation business metric is currently not available. - class Service - - include ::GRPC::GenericService - - self.marshal_class_method = :encode - self.unmarshal_class_method = :decode - self.service_name = 'google.cloud.retail.v2.AnalyticsService' - - # Exports analytics metrics. - # - # `Operation.response` is of type `ExportAnalyticsMetricsResponse`. - # `Operation.metadata` is of type `ExportMetadata`. - rpc :ExportAnalyticsMetrics, ::Google::Cloud::Retail::V2::ExportAnalyticsMetricsRequest, ::Google::Longrunning::Operation - end - - Stub = Service.rpc_stub_class - end - end - end - end -end diff --git a/owl-bot-staging/google-cloud-retail-v2/lib/google/cloud/retail/v2/catalog_pb.rb b/owl-bot-staging/google-cloud-retail-v2/lib/google/cloud/retail/v2/catalog_pb.rb deleted file mode 100644 index 251f19b9f439..000000000000 --- a/owl-bot-staging/google-cloud-retail-v2/lib/google/cloud/retail/v2/catalog_pb.rb +++ /dev/null @@ -1,42 +0,0 @@ -# frozen_string_literal: true -# Generated by the protocol buffer compiler. DO NOT EDIT! -# source: google/cloud/retail/v2/catalog.proto - -require 'google/protobuf' - -require 'google/api/field_behavior_pb' -require 'google/api/resource_pb' -require 'google/cloud/retail/v2/common_pb' -require 'google/cloud/retail/v2/import_config_pb' -require 'google/protobuf/timestamp_pb' - - -descriptor_data = "\n$google/cloud/retail/v2/catalog.proto\x12\x16google.cloud.retail.v2\x1a\x1fgoogle/api/field_behavior.proto\x1a\x19google/api/resource.proto\x1a#google/cloud/retail/v2/common.proto\x1a*google/cloud/retail/v2/import_config.proto\x1a\x1fgoogle/protobuf/timestamp.proto\"^\n\x12ProductLevelConfig\x12\x1e\n\x16ingestion_product_type\x18\x01 \x01(\t\x12(\n merchant_center_product_id_field\x18\x02 \x01(\t\"\xf7\x0f\n\x10\x43\x61talogAttribute\x12\x10\n\x03key\x18\x01 \x01(\tB\x03\xe0\x41\x02\x12\x13\n\x06in_use\x18\t \x01(\x08\x42\x03\xe0\x41\x03\x12I\n\x04type\x18\n \x01(\x0e\x32\x36.google.cloud.retail.v2.CatalogAttribute.AttributeTypeB\x03\xe0\x41\x03\x12R\n\x10indexable_option\x18\x05 \x01(\x0e\x32\x38.google.cloud.retail.v2.CatalogAttribute.IndexableOption\x12\x61\n\x18\x64ynamic_facetable_option\x18\x06 \x01(\x0e\x32?.google.cloud.retail.v2.CatalogAttribute.DynamicFacetableOption\x12T\n\x11searchable_option\x18\x07 \x01(\x0e\x32\x39.google.cloud.retail.v2.CatalogAttribute.SearchableOption\x12_\n\x17\x65xact_searchable_option\x18\x0b \x01(\x0e\x32>.google.cloud.retail.v2.CatalogAttribute.ExactSearchableOption\x12V\n\x12retrievable_option\x18\x0c \x01(\x0e\x32:.google.cloud.retail.v2.CatalogAttribute.RetrievableOption\x12J\n\x0c\x66\x61\x63\x65t_config\x18\r \x01(\x0b\x32\x34.google.cloud.retail.v2.CatalogAttribute.FacetConfig\x1a\xe9\x05\n\x0b\x46\x61\x63\x65tConfig\x12\x39\n\x0f\x66\x61\x63\x65t_intervals\x18\x01 \x03(\x0b\x32 .google.cloud.retail.v2.Interval\x12\x65\n\x14ignored_facet_values\x18\x02 \x03(\x0b\x32G.google.cloud.retail.v2.CatalogAttribute.FacetConfig.IgnoredFacetValues\x12\x62\n\x13merged_facet_values\x18\x03 \x03(\x0b\x32\x45.google.cloud.retail.v2.CatalogAttribute.FacetConfig.MergedFacetValue\x12V\n\x0cmerged_facet\x18\x04 \x01(\x0b\x32@.google.cloud.retail.v2.CatalogAttribute.FacetConfig.MergedFacet\x12X\n\rrerank_config\x18\x05 \x01(\x0b\x32\x41.google.cloud.retail.v2.CatalogAttribute.FacetConfig.RerankConfig\x1a\x82\x01\n\x12IgnoredFacetValues\x12\x0e\n\x06values\x18\x01 \x03(\t\x12.\n\nstart_time\x18\x02 \x01(\x0b\x32\x1a.google.protobuf.Timestamp\x12,\n\x08\x65nd_time\x18\x03 \x01(\x0b\x32\x1a.google.protobuf.Timestamp\x1a\x38\n\x10MergedFacetValue\x12\x0e\n\x06values\x18\x01 \x03(\t\x12\x14\n\x0cmerged_value\x18\x02 \x01(\t\x1a\'\n\x0bMergedFacet\x12\x18\n\x10merged_facet_key\x18\x01 \x01(\t\x1a:\n\x0cRerankConfig\x12\x14\n\x0crerank_facet\x18\x01 \x01(\x08\x12\x14\n\x0c\x66\x61\x63\x65t_values\x18\x02 \x03(\t\"8\n\rAttributeType\x12\x0b\n\x07UNKNOWN\x10\x00\x12\x0b\n\x07TEXTUAL\x10\x01\x12\r\n\tNUMERICAL\x10\x02\"b\n\x0fIndexableOption\x12 \n\x1cINDEXABLE_OPTION_UNSPECIFIED\x10\x00\x12\x15\n\x11INDEXABLE_ENABLED\x10\x01\x12\x16\n\x12INDEXABLE_DISABLED\x10\x02\"\x81\x01\n\x16\x44ynamicFacetableOption\x12(\n$DYNAMIC_FACETABLE_OPTION_UNSPECIFIED\x10\x00\x12\x1d\n\x19\x44YNAMIC_FACETABLE_ENABLED\x10\x01\x12\x1e\n\x1a\x44YNAMIC_FACETABLE_DISABLED\x10\x02\"f\n\x10SearchableOption\x12!\n\x1dSEARCHABLE_OPTION_UNSPECIFIED\x10\x00\x12\x16\n\x12SEARCHABLE_ENABLED\x10\x01\x12\x17\n\x13SEARCHABLE_DISABLED\x10\x02\"}\n\x15\x45xactSearchableOption\x12\'\n#EXACT_SEARCHABLE_OPTION_UNSPECIFIED\x10\x00\x12\x1c\n\x18\x45XACT_SEARCHABLE_ENABLED\x10\x01\x12\x1d\n\x19\x45XACT_SEARCHABLE_DISABLED\x10\x02\"j\n\x11RetrievableOption\x12\"\n\x1eRETRIEVABLE_OPTION_UNSPECIFIED\x10\x00\x12\x17\n\x13RETRIEVABLE_ENABLED\x10\x01\x12\x18\n\x14RETRIEVABLE_DISABLED\x10\x02\"\xb6\x03\n\x10\x41ttributesConfig\x12\x14\n\x04name\x18\x01 \x01(\tB\x06\xe0\x41\x02\xe0\x41\x05\x12[\n\x12\x63\x61talog_attributes\x18\x02 \x03(\x0b\x32?.google.cloud.retail.v2.AttributesConfig.CatalogAttributesEntry\x12Q\n\x16\x61ttribute_config_level\x18\x03 \x01(\x0e\x32,.google.cloud.retail.v2.AttributeConfigLevelB\x03\xe0\x41\x03\x1a\x62\n\x16\x43\x61talogAttributesEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12\x37\n\x05value\x18\x02 \x01(\x0b\x32(.google.cloud.retail.v2.CatalogAttribute:\x02\x38\x01:x\xea\x41u\n&retail.googleapis.com/AttributesConfig\x12Kprojects/{project}/locations/{location}/catalogs/{catalog}/attributesConfig\"\x99\x05\n\x10\x43ompletionConfig\x12\x14\n\x04name\x18\x01 \x01(\tB\x06\xe0\x41\x02\xe0\x41\x05\x12\x16\n\x0ematching_order\x18\x02 \x01(\t\x12\x17\n\x0fmax_suggestions\x18\x03 \x01(\x05\x12\x19\n\x11min_prefix_length\x18\x04 \x01(\x05\x12\x15\n\rauto_learning\x18\x0b \x01(\x08\x12X\n\x18suggestions_input_config\x18\x05 \x01(\x0b\x32\x31.google.cloud.retail.v2.CompletionDataInputConfigB\x03\xe0\x41\x03\x12.\n!last_suggestions_import_operation\x18\x06 \x01(\tB\x03\xe0\x41\x03\x12U\n\x15\x64\x65nylist_input_config\x18\x07 \x01(\x0b\x32\x31.google.cloud.retail.v2.CompletionDataInputConfigB\x03\xe0\x41\x03\x12+\n\x1elast_denylist_import_operation\x18\x08 \x01(\tB\x03\xe0\x41\x03\x12V\n\x16\x61llowlist_input_config\x18\t \x01(\x0b\x32\x31.google.cloud.retail.v2.CompletionDataInputConfigB\x03\xe0\x41\x03\x12,\n\x1flast_allowlist_import_operation\x18\n \x01(\tB\x03\xe0\x41\x03:x\xea\x41u\n&retail.googleapis.com/CompletionConfig\x12Kprojects/{project}/locations/{location}/catalogs/{catalog}/completionConfig\"\xec\x01\n\x07\x43\x61talog\x12\x14\n\x04name\x18\x01 \x01(\tB\x06\xe0\x41\x02\xe0\x41\x05\x12\x1c\n\x0c\x64isplay_name\x18\x02 \x01(\tB\x06\xe0\x41\x02\xe0\x41\x05\x12M\n\x14product_level_config\x18\x04 \x01(\x0b\x32*.google.cloud.retail.v2.ProductLevelConfigB\x03\xe0\x41\x02:^\xea\x41[\n\x1dretail.googleapis.com/Catalog\x12:projects/{project}/locations/{location}/catalogs/{catalog}B\xb7\x01\n\x1a\x63om.google.cloud.retail.v2B\x0c\x43\x61talogProtoP\x01Z2cloud.google.com/go/retail/apiv2/retailpb;retailpb\xa2\x02\x06RETAIL\xaa\x02\x16Google.Cloud.Retail.V2\xca\x02\x16Google\\Cloud\\Retail\\V2\xea\x02\x19Google::Cloud::Retail::V2b\x06proto3" - -pool = ::Google::Protobuf::DescriptorPool.generated_pool -pool.add_serialized_file(descriptor_data) - -module Google - module Cloud - module Retail - module V2 - ProductLevelConfig = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.retail.v2.ProductLevelConfig").msgclass - CatalogAttribute = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.retail.v2.CatalogAttribute").msgclass - CatalogAttribute::FacetConfig = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.retail.v2.CatalogAttribute.FacetConfig").msgclass - CatalogAttribute::FacetConfig::IgnoredFacetValues = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.retail.v2.CatalogAttribute.FacetConfig.IgnoredFacetValues").msgclass - CatalogAttribute::FacetConfig::MergedFacetValue = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.retail.v2.CatalogAttribute.FacetConfig.MergedFacetValue").msgclass - CatalogAttribute::FacetConfig::MergedFacet = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.retail.v2.CatalogAttribute.FacetConfig.MergedFacet").msgclass - CatalogAttribute::FacetConfig::RerankConfig = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.retail.v2.CatalogAttribute.FacetConfig.RerankConfig").msgclass - CatalogAttribute::AttributeType = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.retail.v2.CatalogAttribute.AttributeType").enummodule - CatalogAttribute::IndexableOption = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.retail.v2.CatalogAttribute.IndexableOption").enummodule - CatalogAttribute::DynamicFacetableOption = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.retail.v2.CatalogAttribute.DynamicFacetableOption").enummodule - CatalogAttribute::SearchableOption = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.retail.v2.CatalogAttribute.SearchableOption").enummodule - CatalogAttribute::ExactSearchableOption = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.retail.v2.CatalogAttribute.ExactSearchableOption").enummodule - CatalogAttribute::RetrievableOption = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.retail.v2.CatalogAttribute.RetrievableOption").enummodule - AttributesConfig = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.retail.v2.AttributesConfig").msgclass - CompletionConfig = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.retail.v2.CompletionConfig").msgclass - Catalog = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.retail.v2.Catalog").msgclass - end - end - end -end diff --git a/owl-bot-staging/google-cloud-retail-v2/lib/google/cloud/retail/v2/catalog_service.rb b/owl-bot-staging/google-cloud-retail-v2/lib/google/cloud/retail/v2/catalog_service.rb deleted file mode 100644 index a11f97aecb81..000000000000 --- a/owl-bot-staging/google-cloud-retail-v2/lib/google/cloud/retail/v2/catalog_service.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/retail/v2/version" - -require "google/cloud/retail/v2/catalog_service/credentials" -require "google/cloud/retail/v2/catalog_service/paths" -require "google/cloud/retail/v2/catalog_service/client" -require "google/cloud/retail/v2/catalog_service/rest" - -module Google - module Cloud - module Retail - module V2 - ## - # Service for managing catalog configuration. - # - # @example Load this service and instantiate a gRPC client - # - # require "google/cloud/retail/v2/catalog_service" - # client = ::Google::Cloud::Retail::V2::CatalogService::Client.new - # - # @example Load this service and instantiate a REST client - # - # require "google/cloud/retail/v2/catalog_service/rest" - # client = ::Google::Cloud::Retail::V2::CatalogService::Rest::Client.new - # - module CatalogService - end - end - end - end -end - -helper_path = ::File.join __dir__, "catalog_service", "helpers.rb" -require "google/cloud/retail/v2/catalog_service/helpers" if ::File.file? helper_path diff --git a/owl-bot-staging/google-cloud-retail-v2/lib/google/cloud/retail/v2/catalog_service/client.rb b/owl-bot-staging/google-cloud-retail-v2/lib/google/cloud/retail/v2/catalog_service/client.rb deleted file mode 100644 index c217ac55540f..000000000000 --- a/owl-bot-staging/google-cloud-retail-v2/lib/google/cloud/retail/v2/catalog_service/client.rb +++ /dev/null @@ -1,1588 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -require "google/cloud/errors" -require "google/cloud/retail/v2/catalog_service_pb" -require "google/cloud/location" - -module Google - module Cloud - module Retail - module V2 - module CatalogService - ## - # Client for the CatalogService service. - # - # Service for managing catalog configuration. - # - class Client - # @private - API_VERSION = "" - - # @private - DEFAULT_ENDPOINT_TEMPLATE = "retail.$UNIVERSE_DOMAIN$" - - include Paths - - # @private - attr_reader :catalog_service_stub - - ## - # Configure the CatalogService Client class. - # - # See {::Google::Cloud::Retail::V2::CatalogService::Client::Configuration} - # for a description of the configuration fields. - # - # @example - # - # # Modify the configuration for all CatalogService clients - # ::Google::Cloud::Retail::V2::CatalogService::Client.configure do |config| - # config.timeout = 10.0 - # end - # - # @yield [config] Configure the Client client. - # @yieldparam config [Client::Configuration] - # - # @return [Client::Configuration] - # - def self.configure - @configure ||= begin - namespace = ["Google", "Cloud", "Retail", "V2"] - parent_config = while namespace.any? - parent_name = namespace.join "::" - parent_const = const_get parent_name - break parent_const.configure if parent_const.respond_to? :configure - namespace.pop - end - default_config = Client::Configuration.new parent_config - - default_config.timeout = 5.0 - default_config.retry_policy = { - initial_delay: 0.1, max_delay: 5.0, multiplier: 1.3, retry_codes: [14, 4] - } - - default_config - end - yield @configure if block_given? - @configure - end - - ## - # Configure the CatalogService Client instance. - # - # The configuration is set to the derived mode, meaning that values can be changed, - # but structural changes (adding new fields, etc.) are not allowed. Structural changes - # should be made on {Client.configure}. - # - # See {::Google::Cloud::Retail::V2::CatalogService::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 - @catalog_service_stub.universe_domain - end - - ## - # Create a new CatalogService client object. - # - # @example - # - # # Create a client using the default configuration - # client = ::Google::Cloud::Retail::V2::CatalogService::Client.new - # - # # Create a client using a custom configuration - # client = ::Google::Cloud::Retail::V2::CatalogService::Client.new do |config| - # config.timeout = 10.0 - # end - # - # @yield [config] Configure the CatalogService client. - # @yieldparam config [Client::Configuration] - # - def initialize - # These require statements are intentionally placed here to initialize - # the gRPC module only when it's required. - # See https://github.com/googleapis/toolkit/issues/446 - require "gapic/grpc" - require "google/cloud/retail/v2/catalog_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 - - @catalog_service_stub = ::Gapic::ServiceStub.new( - ::Google::Cloud::Retail::V2::CatalogService::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 - ) - - @catalog_service_stub.stub_logger&.info do |entry| - entry.set_system_name - entry.set_service - entry.message = "Created client for #{entry.service}" - entry.set_credentials_fields credentials - entry.set "customEndpoint", @config.endpoint if @config.endpoint - entry.set "defaultTimeout", @config.timeout if @config.timeout - entry.set "quotaProject", @quota_project_id if @quota_project_id - end - - @location_client = Google::Cloud::Location::Locations::Client.new do |config| - config.credentials = credentials - config.quota_project = @quota_project_id - config.endpoint = @catalog_service_stub.endpoint - config.universe_domain = @catalog_service_stub.universe_domain - config.logger = @catalog_service_stub.logger if config.respond_to? :logger= - end - end - - ## - # Get the associated client for mix-in of the Locations. - # - # @return [Google::Cloud::Location::Locations::Client] - # - attr_reader :location_client - - ## - # The logger used for request/response debug logging. - # - # @return [Logger] - # - def logger - @catalog_service_stub.logger - end - - # Service calls - - ## - # Lists all the {::Google::Cloud::Retail::V2::Catalog Catalog}s associated with - # the project. - # - # @overload list_catalogs(request, options = nil) - # Pass arguments to `list_catalogs` via a request object, either of type - # {::Google::Cloud::Retail::V2::ListCatalogsRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Retail::V2::ListCatalogsRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_catalogs(parent: nil, page_size: nil, page_token: nil) - # Pass arguments to `list_catalogs` via keyword arguments. Note that at - # least one keyword argument is 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 account resource name with an associated location. - # - # If the caller does not have permission to list - # {::Google::Cloud::Retail::V2::Catalog Catalog}s under this location, regardless - # of whether or not this location exists, a PERMISSION_DENIED error is - # returned. - # @param page_size [::Integer] - # Maximum number of {::Google::Cloud::Retail::V2::Catalog Catalog}s to return. If - # unspecified, defaults to 50. The maximum allowed value is 1000. Values - # above 1000 will be coerced to 1000. - # - # If this field is negative, an INVALID_ARGUMENT is returned. - # @param page_token [::String] - # A page token - # {::Google::Cloud::Retail::V2::ListCatalogsResponse#next_page_token ListCatalogsResponse.next_page_token}, - # received from a previous - # {::Google::Cloud::Retail::V2::CatalogService::Client#list_catalogs CatalogService.ListCatalogs} - # call. Provide this to retrieve the subsequent page. - # - # When paginating, all other parameters provided to - # {::Google::Cloud::Retail::V2::CatalogService::Client#list_catalogs CatalogService.ListCatalogs} - # must match the call that provided the page token. Otherwise, an - # INVALID_ARGUMENT error is returned. - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Gapic::PagedEnumerable<::Google::Cloud::Retail::V2::Catalog>] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Gapic::PagedEnumerable<::Google::Cloud::Retail::V2::Catalog>] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/cloud/retail/v2" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Retail::V2::CatalogService::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Retail::V2::ListCatalogsRequest.new - # - # # Call the list_catalogs method. - # result = client.list_catalogs request - # - # # The returned object is of type Gapic::PagedEnumerable. You can iterate - # # over elements, and API calls will be issued to fetch pages as needed. - # result.each do |item| - # # Each element is of type ::Google::Cloud::Retail::V2::Catalog. - # p item - # end - # - def list_catalogs request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Retail::V2::ListCatalogsRequest - - # Converts hash 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_catalogs.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::Retail::V2::VERSION - metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - header_params = {} - if request.parent - 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_catalogs.timeout, - metadata: metadata, - retry_policy: @config.rpcs.list_catalogs.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @catalog_service_stub.call_rpc :list_catalogs, request, options: options do |response, operation| - response = ::Gapic::PagedEnumerable.new @catalog_service_stub, :list_catalogs, 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 - - ## - # Updates the {::Google::Cloud::Retail::V2::Catalog Catalog}s. - # - # @overload update_catalog(request, options = nil) - # Pass arguments to `update_catalog` via a request object, either of type - # {::Google::Cloud::Retail::V2::UpdateCatalogRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Retail::V2::UpdateCatalogRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_catalog(catalog: nil, update_mask: nil) - # Pass arguments to `update_catalog` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param catalog [::Google::Cloud::Retail::V2::Catalog, ::Hash] - # Required. The {::Google::Cloud::Retail::V2::Catalog Catalog} to update. - # - # If the caller does not have permission to update the - # {::Google::Cloud::Retail::V2::Catalog Catalog}, regardless of whether or not it - # exists, a PERMISSION_DENIED error is returned. - # - # If the {::Google::Cloud::Retail::V2::Catalog Catalog} to update does not exist, - # a NOT_FOUND error is returned. - # @param update_mask [::Google::Protobuf::FieldMask, ::Hash] - # Indicates which fields in the provided - # {::Google::Cloud::Retail::V2::Catalog Catalog} to update. - # - # If an unsupported or unknown field is provided, an INVALID_ARGUMENT error - # is returned. - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Google::Cloud::Retail::V2::Catalog] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Google::Cloud::Retail::V2::Catalog] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/cloud/retail/v2" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Retail::V2::CatalogService::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Retail::V2::UpdateCatalogRequest.new - # - # # Call the update_catalog method. - # result = client.update_catalog request - # - # # The returned object is of type Google::Cloud::Retail::V2::Catalog. - # p result - # - def update_catalog request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Retail::V2::UpdateCatalogRequest - - # Converts hash 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_catalog.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::Retail::V2::VERSION - metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - header_params = {} - if request.catalog&.name - header_params["catalog.name"] = request.catalog.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_catalog.timeout, - metadata: metadata, - retry_policy: @config.rpcs.update_catalog.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @catalog_service_stub.call_rpc :update_catalog, 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 - - ## - # Set a specified branch id as default branch. API methods such as - # {::Google::Cloud::Retail::V2::SearchService::Client#search SearchService.Search}, - # {::Google::Cloud::Retail::V2::ProductService::Client#get_product ProductService.GetProduct}, - # {::Google::Cloud::Retail::V2::ProductService::Client#list_products ProductService.ListProducts} - # will treat requests using "default_branch" to the actual branch id set as - # default. - # - # For example, if `projects/*/locations/*/catalogs/*/branches/1` is set as - # default, setting - # {::Google::Cloud::Retail::V2::SearchRequest#branch SearchRequest.branch} to - # `projects/*/locations/*/catalogs/*/branches/default_branch` is equivalent - # to setting - # {::Google::Cloud::Retail::V2::SearchRequest#branch SearchRequest.branch} to - # `projects/*/locations/*/catalogs/*/branches/1`. - # - # Using multiple branches can be useful when developers would like - # to have a staging branch to test and verify for future usage. When it - # becomes ready, developers switch on the staging branch using this API - # while keeping using - # `projects/*/locations/*/catalogs/*/branches/default_branch` as - # {::Google::Cloud::Retail::V2::SearchRequest#branch SearchRequest.branch} to - # route the traffic to this staging branch. - # - # CAUTION: If you have live predict/search traffic, switching the default - # branch could potentially cause outages if the ID space of the new branch - # is very different from the old one. - # - # More specifically: - # - # * PredictionService will only return product IDs from branch \\{newBranch}. - # * SearchService will only return product IDs from branch \\{newBranch} - # (if branch is not explicitly set). - # * UserEventService will only join events with products from branch - # \\{newBranch}. - # - # @overload set_default_branch(request, options = nil) - # Pass arguments to `set_default_branch` via a request object, either of type - # {::Google::Cloud::Retail::V2::SetDefaultBranchRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Retail::V2::SetDefaultBranchRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. - # - # @overload set_default_branch(catalog: nil, branch_id: nil, note: nil, force: nil) - # Pass arguments to `set_default_branch` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param catalog [::String] - # Full resource name of the catalog, such as - # `projects/*/locations/global/catalogs/default_catalog`. - # @param branch_id [::String] - # The final component of the resource name of a branch. - # - # This field must be one of "0", "1" or "2". Otherwise, an INVALID_ARGUMENT - # error is returned. - # - # If there are no sufficient active products in the targeted branch and - # {::Google::Cloud::Retail::V2::SetDefaultBranchRequest#force force} is not set, a - # FAILED_PRECONDITION error is returned. - # @param note [::String] - # Some note on this request, this can be retrieved by - # {::Google::Cloud::Retail::V2::CatalogService::Client#get_default_branch CatalogService.GetDefaultBranch} - # before next valid default branch set occurs. - # - # This field must be a UTF-8 encoded string with a length limit of 1,000 - # characters. Otherwise, an INVALID_ARGUMENT error is returned. - # @param force [::Boolean] - # If set to true, it permits switching to a branch with - # {::Google::Cloud::Retail::V2::SetDefaultBranchRequest#branch_id branch_id} even - # if it has no sufficient active products. - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Google::Protobuf::Empty] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Google::Protobuf::Empty] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/cloud/retail/v2" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Retail::V2::CatalogService::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Retail::V2::SetDefaultBranchRequest.new - # - # # Call the set_default_branch method. - # result = client.set_default_branch request - # - # # The returned object is of type Google::Protobuf::Empty. - # p result - # - def set_default_branch request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Retail::V2::SetDefaultBranchRequest - - # Converts hash and nil to an options object - options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h - - # Customize the options with defaults - metadata = @config.rpcs.set_default_branch.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::Retail::V2::VERSION - metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - header_params = {} - if request.catalog - header_params["catalog"] = request.catalog - end - - request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") - metadata[:"x-goog-request-params"] ||= request_params_header - - options.apply_defaults timeout: @config.rpcs.set_default_branch.timeout, - metadata: metadata, - retry_policy: @config.rpcs.set_default_branch.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @catalog_service_stub.call_rpc :set_default_branch, 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 - - ## - # Get which branch is currently default branch set by - # {::Google::Cloud::Retail::V2::CatalogService::Client#set_default_branch CatalogService.SetDefaultBranch} - # method under a specified parent catalog. - # - # @overload get_default_branch(request, options = nil) - # Pass arguments to `get_default_branch` via a request object, either of type - # {::Google::Cloud::Retail::V2::GetDefaultBranchRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Retail::V2::GetDefaultBranchRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_default_branch(catalog: nil) - # Pass arguments to `get_default_branch` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param catalog [::String] - # The parent catalog resource name, such as - # `projects/*/locations/global/catalogs/default_catalog`. - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Google::Cloud::Retail::V2::GetDefaultBranchResponse] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Google::Cloud::Retail::V2::GetDefaultBranchResponse] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/cloud/retail/v2" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Retail::V2::CatalogService::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Retail::V2::GetDefaultBranchRequest.new - # - # # Call the get_default_branch method. - # result = client.get_default_branch request - # - # # The returned object is of type Google::Cloud::Retail::V2::GetDefaultBranchResponse. - # p result - # - def get_default_branch request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Retail::V2::GetDefaultBranchRequest - - # Converts hash 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_default_branch.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::Retail::V2::VERSION - metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - header_params = {} - if request.catalog - header_params["catalog"] = request.catalog - 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_default_branch.timeout, - metadata: metadata, - retry_policy: @config.rpcs.get_default_branch.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @catalog_service_stub.call_rpc :get_default_branch, request, options: options do |response, operation| - yield response, operation if block_given? - end - rescue ::GRPC::BadStatus => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Gets a {::Google::Cloud::Retail::V2::CompletionConfig CompletionConfig}. - # - # @overload get_completion_config(request, options = nil) - # Pass arguments to `get_completion_config` via a request object, either of type - # {::Google::Cloud::Retail::V2::GetCompletionConfigRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Retail::V2::GetCompletionConfigRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_completion_config(name: nil) - # Pass arguments to `get_completion_config` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param name [::String] - # Required. Full CompletionConfig resource name. Format: - # `projects/{project_number}/locations/{location_id}/catalogs/{catalog_id}/completionConfig` - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Google::Cloud::Retail::V2::CompletionConfig] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Google::Cloud::Retail::V2::CompletionConfig] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/cloud/retail/v2" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Retail::V2::CatalogService::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Retail::V2::GetCompletionConfigRequest.new - # - # # Call the get_completion_config method. - # result = client.get_completion_config request - # - # # The returned object is of type Google::Cloud::Retail::V2::CompletionConfig. - # p result - # - def get_completion_config request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Retail::V2::GetCompletionConfigRequest - - # Converts hash 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_completion_config.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::Retail::V2::VERSION - metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - header_params = {} - if request.name - header_params["name"] = request.name - end - - request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") - metadata[:"x-goog-request-params"] ||= request_params_header - - options.apply_defaults timeout: @config.rpcs.get_completion_config.timeout, - metadata: metadata, - retry_policy: @config.rpcs.get_completion_config.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @catalog_service_stub.call_rpc :get_completion_config, request, options: options do |response, operation| - yield response, operation if block_given? - end - rescue ::GRPC::BadStatus => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Updates the {::Google::Cloud::Retail::V2::CompletionConfig CompletionConfig}s. - # - # @overload update_completion_config(request, options = nil) - # Pass arguments to `update_completion_config` via a request object, either of type - # {::Google::Cloud::Retail::V2::UpdateCompletionConfigRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Retail::V2::UpdateCompletionConfigRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_completion_config(completion_config: nil, update_mask: nil) - # Pass arguments to `update_completion_config` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param completion_config [::Google::Cloud::Retail::V2::CompletionConfig, ::Hash] - # Required. The {::Google::Cloud::Retail::V2::CompletionConfig CompletionConfig} - # to update. - # - # If the caller does not have permission to update the - # {::Google::Cloud::Retail::V2::CompletionConfig CompletionConfig}, then a - # PERMISSION_DENIED error is returned. - # - # If the {::Google::Cloud::Retail::V2::CompletionConfig CompletionConfig} to - # update does not exist, a NOT_FOUND error is returned. - # @param update_mask [::Google::Protobuf::FieldMask, ::Hash] - # Indicates which fields in the provided - # {::Google::Cloud::Retail::V2::CompletionConfig CompletionConfig} to update. The - # following are the only supported fields: - # - # * {::Google::Cloud::Retail::V2::CompletionConfig#matching_order CompletionConfig.matching_order} - # * {::Google::Cloud::Retail::V2::CompletionConfig#max_suggestions CompletionConfig.max_suggestions} - # * {::Google::Cloud::Retail::V2::CompletionConfig#min_prefix_length CompletionConfig.min_prefix_length} - # * {::Google::Cloud::Retail::V2::CompletionConfig#auto_learning CompletionConfig.auto_learning} - # - # If not set, all supported fields are updated. - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Google::Cloud::Retail::V2::CompletionConfig] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Google::Cloud::Retail::V2::CompletionConfig] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/cloud/retail/v2" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Retail::V2::CatalogService::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Retail::V2::UpdateCompletionConfigRequest.new - # - # # Call the update_completion_config method. - # result = client.update_completion_config request - # - # # The returned object is of type Google::Cloud::Retail::V2::CompletionConfig. - # p result - # - def update_completion_config request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Retail::V2::UpdateCompletionConfigRequest - - # Converts hash 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_completion_config.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::Retail::V2::VERSION - metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - header_params = {} - if request.completion_config&.name - header_params["completion_config.name"] = request.completion_config.name - end - - request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") - metadata[:"x-goog-request-params"] ||= request_params_header - - options.apply_defaults timeout: @config.rpcs.update_completion_config.timeout, - metadata: metadata, - retry_policy: @config.rpcs.update_completion_config.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @catalog_service_stub.call_rpc :update_completion_config, request, options: options do |response, operation| - yield response, operation if block_given? - end - rescue ::GRPC::BadStatus => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Gets an {::Google::Cloud::Retail::V2::AttributesConfig AttributesConfig}. - # - # @overload get_attributes_config(request, options = nil) - # Pass arguments to `get_attributes_config` via a request object, either of type - # {::Google::Cloud::Retail::V2::GetAttributesConfigRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Retail::V2::GetAttributesConfigRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_attributes_config(name: nil) - # Pass arguments to `get_attributes_config` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param name [::String] - # Required. Full AttributesConfig resource name. Format: - # `projects/{project_number}/locations/{location_id}/catalogs/{catalog_id}/attributesConfig` - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Google::Cloud::Retail::V2::AttributesConfig] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Google::Cloud::Retail::V2::AttributesConfig] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/cloud/retail/v2" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Retail::V2::CatalogService::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Retail::V2::GetAttributesConfigRequest.new - # - # # Call the get_attributes_config method. - # result = client.get_attributes_config request - # - # # The returned object is of type Google::Cloud::Retail::V2::AttributesConfig. - # p result - # - def get_attributes_config request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Retail::V2::GetAttributesConfigRequest - - # Converts hash 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_attributes_config.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::Retail::V2::VERSION - metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - header_params = {} - if request.name - header_params["name"] = request.name - end - - request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") - metadata[:"x-goog-request-params"] ||= request_params_header - - options.apply_defaults timeout: @config.rpcs.get_attributes_config.timeout, - metadata: metadata, - retry_policy: @config.rpcs.get_attributes_config.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @catalog_service_stub.call_rpc :get_attributes_config, request, options: options do |response, operation| - yield response, operation if block_given? - end - rescue ::GRPC::BadStatus => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Updates the {::Google::Cloud::Retail::V2::AttributesConfig AttributesConfig}. - # - # The catalog attributes in the request will be updated in the catalog, or - # inserted if they do not exist. Existing catalog attributes not included in - # the request will remain unchanged. Attributes that are assigned to - # products, but do not exist at the catalog level, are always included in the - # response. The product attribute is assigned default values for missing - # catalog attribute fields, e.g., searchable and dynamic facetable options. - # - # @overload update_attributes_config(request, options = nil) - # Pass arguments to `update_attributes_config` via a request object, either of type - # {::Google::Cloud::Retail::V2::UpdateAttributesConfigRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Retail::V2::UpdateAttributesConfigRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_attributes_config(attributes_config: nil, update_mask: nil) - # Pass arguments to `update_attributes_config` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param attributes_config [::Google::Cloud::Retail::V2::AttributesConfig, ::Hash] - # Required. The {::Google::Cloud::Retail::V2::AttributesConfig AttributesConfig} - # to update. - # @param update_mask [::Google::Protobuf::FieldMask, ::Hash] - # Indicates which fields in the provided - # {::Google::Cloud::Retail::V2::AttributesConfig AttributesConfig} to update. The - # following is the only supported field: - # - # * {::Google::Cloud::Retail::V2::AttributesConfig#catalog_attributes AttributesConfig.catalog_attributes} - # - # If not set, all supported fields are updated. - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Google::Cloud::Retail::V2::AttributesConfig] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Google::Cloud::Retail::V2::AttributesConfig] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/cloud/retail/v2" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Retail::V2::CatalogService::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Retail::V2::UpdateAttributesConfigRequest.new - # - # # Call the update_attributes_config method. - # result = client.update_attributes_config request - # - # # The returned object is of type Google::Cloud::Retail::V2::AttributesConfig. - # p result - # - def update_attributes_config request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Retail::V2::UpdateAttributesConfigRequest - - # Converts hash 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_attributes_config.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::Retail::V2::VERSION - metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - header_params = {} - if request.attributes_config&.name - header_params["attributes_config.name"] = request.attributes_config.name - end - - request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") - metadata[:"x-goog-request-params"] ||= request_params_header - - options.apply_defaults timeout: @config.rpcs.update_attributes_config.timeout, - metadata: metadata, - retry_policy: @config.rpcs.update_attributes_config.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @catalog_service_stub.call_rpc :update_attributes_config, request, options: options do |response, operation| - yield response, operation if block_given? - end - rescue ::GRPC::BadStatus => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Adds the specified - # {::Google::Cloud::Retail::V2::CatalogAttribute CatalogAttribute} to the - # {::Google::Cloud::Retail::V2::AttributesConfig AttributesConfig}. - # - # If the {::Google::Cloud::Retail::V2::CatalogAttribute CatalogAttribute} to add - # already exists, an ALREADY_EXISTS error is returned. - # - # @overload add_catalog_attribute(request, options = nil) - # Pass arguments to `add_catalog_attribute` via a request object, either of type - # {::Google::Cloud::Retail::V2::AddCatalogAttributeRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Retail::V2::AddCatalogAttributeRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. - # - # @overload add_catalog_attribute(attributes_config: nil, catalog_attribute: nil) - # Pass arguments to `add_catalog_attribute` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param attributes_config [::String] - # Required. Full AttributesConfig resource name. Format: - # `projects/{project_number}/locations/{location_id}/catalogs/{catalog_id}/attributesConfig` - # @param catalog_attribute [::Google::Cloud::Retail::V2::CatalogAttribute, ::Hash] - # Required. The {::Google::Cloud::Retail::V2::CatalogAttribute CatalogAttribute} - # to add. - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Google::Cloud::Retail::V2::AttributesConfig] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Google::Cloud::Retail::V2::AttributesConfig] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/cloud/retail/v2" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Retail::V2::CatalogService::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Retail::V2::AddCatalogAttributeRequest.new - # - # # Call the add_catalog_attribute method. - # result = client.add_catalog_attribute request - # - # # The returned object is of type Google::Cloud::Retail::V2::AttributesConfig. - # p result - # - def add_catalog_attribute request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Retail::V2::AddCatalogAttributeRequest - - # Converts hash and nil to an options object - options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h - - # Customize the options with defaults - metadata = @config.rpcs.add_catalog_attribute.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::Retail::V2::VERSION - metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - header_params = {} - if request.attributes_config - header_params["attributes_config"] = request.attributes_config - end - - request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") - metadata[:"x-goog-request-params"] ||= request_params_header - - options.apply_defaults timeout: @config.rpcs.add_catalog_attribute.timeout, - metadata: metadata, - retry_policy: @config.rpcs.add_catalog_attribute.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @catalog_service_stub.call_rpc :add_catalog_attribute, 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 - - ## - # Removes the specified - # {::Google::Cloud::Retail::V2::CatalogAttribute CatalogAttribute} from the - # {::Google::Cloud::Retail::V2::AttributesConfig AttributesConfig}. - # - # If the {::Google::Cloud::Retail::V2::CatalogAttribute CatalogAttribute} to - # remove does not exist, a NOT_FOUND error is returned. - # - # @overload remove_catalog_attribute(request, options = nil) - # Pass arguments to `remove_catalog_attribute` via a request object, either of type - # {::Google::Cloud::Retail::V2::RemoveCatalogAttributeRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Retail::V2::RemoveCatalogAttributeRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. - # - # @overload remove_catalog_attribute(attributes_config: nil, key: nil) - # Pass arguments to `remove_catalog_attribute` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param attributes_config [::String] - # Required. Full AttributesConfig resource name. Format: - # `projects/{project_number}/locations/{location_id}/catalogs/{catalog_id}/attributesConfig` - # @param key [::String] - # Required. The attribute name key of the - # {::Google::Cloud::Retail::V2::CatalogAttribute CatalogAttribute} to remove. - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Google::Cloud::Retail::V2::AttributesConfig] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Google::Cloud::Retail::V2::AttributesConfig] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/cloud/retail/v2" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Retail::V2::CatalogService::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Retail::V2::RemoveCatalogAttributeRequest.new - # - # # Call the remove_catalog_attribute method. - # result = client.remove_catalog_attribute request - # - # # The returned object is of type Google::Cloud::Retail::V2::AttributesConfig. - # p result - # - def remove_catalog_attribute request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Retail::V2::RemoveCatalogAttributeRequest - - # Converts hash 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.remove_catalog_attribute.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::Retail::V2::VERSION - metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - header_params = {} - if request.attributes_config - header_params["attributes_config"] = request.attributes_config - 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.remove_catalog_attribute.timeout, - metadata: metadata, - retry_policy: @config.rpcs.remove_catalog_attribute.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @catalog_service_stub.call_rpc :remove_catalog_attribute, 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 - - ## - # Replaces the specified - # {::Google::Cloud::Retail::V2::CatalogAttribute CatalogAttribute} in the - # {::Google::Cloud::Retail::V2::AttributesConfig AttributesConfig} by updating the - # catalog attribute with the same - # {::Google::Cloud::Retail::V2::CatalogAttribute#key CatalogAttribute.key}. - # - # If the {::Google::Cloud::Retail::V2::CatalogAttribute CatalogAttribute} to - # replace does not exist, a NOT_FOUND error is returned. - # - # @overload replace_catalog_attribute(request, options = nil) - # Pass arguments to `replace_catalog_attribute` via a request object, either of type - # {::Google::Cloud::Retail::V2::ReplaceCatalogAttributeRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Retail::V2::ReplaceCatalogAttributeRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. - # - # @overload replace_catalog_attribute(attributes_config: nil, catalog_attribute: nil, update_mask: nil) - # Pass arguments to `replace_catalog_attribute` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param attributes_config [::String] - # Required. Full AttributesConfig resource name. Format: - # `projects/{project_number}/locations/{location_id}/catalogs/{catalog_id}/attributesConfig` - # @param catalog_attribute [::Google::Cloud::Retail::V2::CatalogAttribute, ::Hash] - # Required. The updated - # {::Google::Cloud::Retail::V2::CatalogAttribute CatalogAttribute}. - # @param update_mask [::Google::Protobuf::FieldMask, ::Hash] - # Indicates which fields in the provided - # {::Google::Cloud::Retail::V2::CatalogAttribute CatalogAttribute} to update. The - # following are NOT supported: - # - # * {::Google::Cloud::Retail::V2::CatalogAttribute#key CatalogAttribute.key} - # - # If not set, all supported fields are updated. - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Google::Cloud::Retail::V2::AttributesConfig] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Google::Cloud::Retail::V2::AttributesConfig] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/cloud/retail/v2" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Retail::V2::CatalogService::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Retail::V2::ReplaceCatalogAttributeRequest.new - # - # # Call the replace_catalog_attribute method. - # result = client.replace_catalog_attribute request - # - # # The returned object is of type Google::Cloud::Retail::V2::AttributesConfig. - # p result - # - def replace_catalog_attribute request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Retail::V2::ReplaceCatalogAttributeRequest - - # Converts hash 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.replace_catalog_attribute.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::Retail::V2::VERSION - metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - header_params = {} - if request.attributes_config - header_params["attributes_config"] = request.attributes_config - 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.replace_catalog_attribute.timeout, - metadata: metadata, - retry_policy: @config.rpcs.replace_catalog_attribute.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @catalog_service_stub.call_rpc :replace_catalog_attribute, request, options: options do |response, operation| - yield response, operation if block_given? - end - rescue ::GRPC::BadStatus => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Configuration class for the CatalogService API. - # - # This class represents the configuration for CatalogService, - # providing control over timeouts, retry behavior, logging, transport - # parameters, and other low-level controls. Certain parameters can also be - # applied individually to specific RPCs. See - # {::Google::Cloud::Retail::V2::CatalogService::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_catalogs to 20 seconds, - # # and all remaining timeouts to 10 seconds. - # ::Google::Cloud::Retail::V2::CatalogService::Client.configure do |config| - # config.timeout = 10.0 - # config.rpcs.list_catalogs.timeout = 20.0 - # end - # - # # Apply the above configuration only to a new client. - # client = ::Google::Cloud::Retail::V2::CatalogService::Client.new do |config| - # config.timeout = 10.0 - # config.rpcs.list_catalogs.timeout = 20.0 - # end - # - # @!attribute [rw] endpoint - # A custom service endpoint, as a hostname or hostname:port. The default is - # nil, indicating to use the default endpoint in the current universe domain. - # @return [::String,nil] - # @!attribute [rw] credentials - # Credentials to send with calls. You may provide any of the following types: - # * (`Google::Auth::Credentials`) A googleauth credentials object - # (see the [googleauth docs](https://rubydoc.info/gems/googleauth/Google/Auth/Credentials)) - # * (`Signet::OAuth2::Client`) A signet oauth2 client object - # (see the [signet docs](https://rubydoc.info/gems/signet/Signet/OAuth2/Client)) - # * (`GRPC::Core::Channel`) a gRPC channel with included credentials - # * (`GRPC::Core::ChannelCredentials`) a gRPC credentails object - # * (`nil`) indicating no credentials - # - # @note Warning: Passing a `String` to a keyfile path or a `Hash` of credentials - # is deprecated. Providing an unvalidated credential configuration to - # Google APIs can compromise the security of your systems and data. - # - # @example - # - # # The recommended way to provide credentials is to use the `make_creds` method - # # on the appropriate credentials class for your environment. - # - # require "googleauth" - # - # credentials = ::Google::Auth::ServiceAccountCredentials.make_creds( - # json_key_io: ::File.open("/path/to/keyfile.json") - # ) - # - # client = ::Google::Cloud::Retail::V2::CatalogService::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 = "retail.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 CatalogService 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_catalogs` - # @return [::Gapic::Config::Method] - # - attr_reader :list_catalogs - ## - # RPC-specific configuration for `update_catalog` - # @return [::Gapic::Config::Method] - # - attr_reader :update_catalog - ## - # RPC-specific configuration for `set_default_branch` - # @return [::Gapic::Config::Method] - # - attr_reader :set_default_branch - ## - # RPC-specific configuration for `get_default_branch` - # @return [::Gapic::Config::Method] - # - attr_reader :get_default_branch - ## - # RPC-specific configuration for `get_completion_config` - # @return [::Gapic::Config::Method] - # - attr_reader :get_completion_config - ## - # RPC-specific configuration for `update_completion_config` - # @return [::Gapic::Config::Method] - # - attr_reader :update_completion_config - ## - # RPC-specific configuration for `get_attributes_config` - # @return [::Gapic::Config::Method] - # - attr_reader :get_attributes_config - ## - # RPC-specific configuration for `update_attributes_config` - # @return [::Gapic::Config::Method] - # - attr_reader :update_attributes_config - ## - # RPC-specific configuration for `add_catalog_attribute` - # @return [::Gapic::Config::Method] - # - attr_reader :add_catalog_attribute - ## - # RPC-specific configuration for `remove_catalog_attribute` - # @return [::Gapic::Config::Method] - # - attr_reader :remove_catalog_attribute - ## - # RPC-specific configuration for `replace_catalog_attribute` - # @return [::Gapic::Config::Method] - # - attr_reader :replace_catalog_attribute - - # @private - def initialize parent_rpcs = nil - list_catalogs_config = parent_rpcs.list_catalogs if parent_rpcs.respond_to? :list_catalogs - @list_catalogs = ::Gapic::Config::Method.new list_catalogs_config - update_catalog_config = parent_rpcs.update_catalog if parent_rpcs.respond_to? :update_catalog - @update_catalog = ::Gapic::Config::Method.new update_catalog_config - set_default_branch_config = parent_rpcs.set_default_branch if parent_rpcs.respond_to? :set_default_branch - @set_default_branch = ::Gapic::Config::Method.new set_default_branch_config - get_default_branch_config = parent_rpcs.get_default_branch if parent_rpcs.respond_to? :get_default_branch - @get_default_branch = ::Gapic::Config::Method.new get_default_branch_config - get_completion_config_config = parent_rpcs.get_completion_config if parent_rpcs.respond_to? :get_completion_config - @get_completion_config = ::Gapic::Config::Method.new get_completion_config_config - update_completion_config_config = parent_rpcs.update_completion_config if parent_rpcs.respond_to? :update_completion_config - @update_completion_config = ::Gapic::Config::Method.new update_completion_config_config - get_attributes_config_config = parent_rpcs.get_attributes_config if parent_rpcs.respond_to? :get_attributes_config - @get_attributes_config = ::Gapic::Config::Method.new get_attributes_config_config - update_attributes_config_config = parent_rpcs.update_attributes_config if parent_rpcs.respond_to? :update_attributes_config - @update_attributes_config = ::Gapic::Config::Method.new update_attributes_config_config - add_catalog_attribute_config = parent_rpcs.add_catalog_attribute if parent_rpcs.respond_to? :add_catalog_attribute - @add_catalog_attribute = ::Gapic::Config::Method.new add_catalog_attribute_config - remove_catalog_attribute_config = parent_rpcs.remove_catalog_attribute if parent_rpcs.respond_to? :remove_catalog_attribute - @remove_catalog_attribute = ::Gapic::Config::Method.new remove_catalog_attribute_config - replace_catalog_attribute_config = parent_rpcs.replace_catalog_attribute if parent_rpcs.respond_to? :replace_catalog_attribute - @replace_catalog_attribute = ::Gapic::Config::Method.new replace_catalog_attribute_config - - yield self if block_given? - end - end - end - end - end - end - end - end -end diff --git a/owl-bot-staging/google-cloud-retail-v2/lib/google/cloud/retail/v2/catalog_service/credentials.rb b/owl-bot-staging/google-cloud-retail-v2/lib/google/cloud/retail/v2/catalog_service/credentials.rb deleted file mode 100644 index 181a310393b3..000000000000 --- a/owl-bot-staging/google-cloud-retail-v2/lib/google/cloud/retail/v2/catalog_service/credentials.rb +++ /dev/null @@ -1,51 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -require "googleauth" - -module Google - module Cloud - module Retail - module V2 - module CatalogService - # Credentials for the CatalogService API. - class Credentials < ::Google::Auth::Credentials - self.scope = [ - "https://www.googleapis.com/auth/cloud-platform" - ] - self.env_vars = [ - "RETAIL_CREDENTIALS", - "RETAIL_KEYFILE", - "GOOGLE_CLOUD_CREDENTIALS", - "GOOGLE_CLOUD_KEYFILE", - "GCLOUD_KEYFILE", - "RETAIL_CREDENTIALS_JSON", - "RETAIL_KEYFILE_JSON", - "GOOGLE_CLOUD_CREDENTIALS_JSON", - "GOOGLE_CLOUD_KEYFILE_JSON", - "GCLOUD_KEYFILE_JSON" - ] - self.paths = [ - "~/.config/google_cloud/application_default_credentials.json" - ] - end - end - end - end - end -end diff --git a/owl-bot-staging/google-cloud-retail-v2/lib/google/cloud/retail/v2/catalog_service/paths.rb b/owl-bot-staging/google-cloud-retail-v2/lib/google/cloud/retail/v2/catalog_service/paths.rb deleted file mode 100644 index 19287ee026f3..000000000000 --- a/owl-bot-staging/google-cloud-retail-v2/lib/google/cloud/retail/v2/catalog_service/paths.rb +++ /dev/null @@ -1,128 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - - -module Google - module Cloud - module Retail - module V2 - module CatalogService - # Path helper methods for the CatalogService API. - module Paths - ## - # Create a fully-qualified AttributesConfig resource string. - # - # The resource will be in the following format: - # - # `projects/{project}/locations/{location}/catalogs/{catalog}/attributesConfig` - # - # @param project [String] - # @param location [String] - # @param catalog [String] - # - # @return [::String] - def attributes_config_path project:, location:, catalog: - raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" - raise ::ArgumentError, "location cannot contain /" if location.to_s.include? "/" - - "projects/#{project}/locations/#{location}/catalogs/#{catalog}/attributesConfig" - end - - ## - # Create a fully-qualified Branch resource string. - # - # The resource will be in the following format: - # - # `projects/{project}/locations/{location}/catalogs/{catalog}/branches/{branch}` - # - # @param project [String] - # @param location [String] - # @param catalog [String] - # @param branch [String] - # - # @return [::String] - def branch_path project:, location:, catalog:, branch: - raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" - raise ::ArgumentError, "location cannot contain /" if location.to_s.include? "/" - raise ::ArgumentError, "catalog cannot contain /" if catalog.to_s.include? "/" - - "projects/#{project}/locations/#{location}/catalogs/#{catalog}/branches/#{branch}" - end - - ## - # Create a fully-qualified Catalog resource string. - # - # The resource will be in the following format: - # - # `projects/{project}/locations/{location}/catalogs/{catalog}` - # - # @param project [String] - # @param location [String] - # @param catalog [String] - # - # @return [::String] - def catalog_path project:, location:, catalog: - raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" - raise ::ArgumentError, "location cannot contain /" if location.to_s.include? "/" - - "projects/#{project}/locations/#{location}/catalogs/#{catalog}" - end - - ## - # Create a fully-qualified CompletionConfig resource string. - # - # The resource will be in the following format: - # - # `projects/{project}/locations/{location}/catalogs/{catalog}/completionConfig` - # - # @param project [String] - # @param location [String] - # @param catalog [String] - # - # @return [::String] - def completion_config_path project:, location:, catalog: - raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" - raise ::ArgumentError, "location cannot contain /" if location.to_s.include? "/" - - "projects/#{project}/locations/#{location}/catalogs/#{catalog}/completionConfig" - 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 - - extend self - end - end - end - end - end -end diff --git a/owl-bot-staging/google-cloud-retail-v2/lib/google/cloud/retail/v2/catalog_service/rest.rb b/owl-bot-staging/google-cloud-retail-v2/lib/google/cloud/retail/v2/catalog_service/rest.rb deleted file mode 100644 index ea2c8cf3fcef..000000000000 --- a/owl-bot-staging/google-cloud-retail-v2/lib/google/cloud/retail/v2/catalog_service/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/retail/v2/version" - -require "google/cloud/retail/v2/catalog_service/credentials" -require "google/cloud/retail/v2/catalog_service/paths" -require "google/cloud/retail/v2/catalog_service/rest/client" - -module Google - module Cloud - module Retail - module V2 - ## - # Service for managing catalog configuration. - # - # To load this service and instantiate a REST client: - # - # require "google/cloud/retail/v2/catalog_service/rest" - # client = ::Google::Cloud::Retail::V2::CatalogService::Rest::Client.new - # - module CatalogService - # Client for the REST transport - module Rest - end - end - end - end - end -end - -helper_path = ::File.join __dir__, "rest", "helpers.rb" -require "google/cloud/retail/v2/catalog_service/rest/helpers" if ::File.file? helper_path diff --git a/owl-bot-staging/google-cloud-retail-v2/lib/google/cloud/retail/v2/catalog_service/rest/client.rb b/owl-bot-staging/google-cloud-retail-v2/lib/google/cloud/retail/v2/catalog_service/rest/client.rb deleted file mode 100644 index 447cb7247d8e..000000000000 --- a/owl-bot-staging/google-cloud-retail-v2/lib/google/cloud/retail/v2/catalog_service/rest/client.rb +++ /dev/null @@ -1,1468 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -require "google/cloud/errors" -require "google/cloud/retail/v2/catalog_service_pb" -require "google/cloud/retail/v2/catalog_service/rest/service_stub" -require "google/cloud/location/rest" - -module Google - module Cloud - module Retail - module V2 - module CatalogService - module Rest - ## - # REST client for the CatalogService service. - # - # Service for managing catalog configuration. - # - class Client - # @private - API_VERSION = "" - - # @private - DEFAULT_ENDPOINT_TEMPLATE = "retail.$UNIVERSE_DOMAIN$" - - include Paths - - # @private - attr_reader :catalog_service_stub - - ## - # Configure the CatalogService Client class. - # - # See {::Google::Cloud::Retail::V2::CatalogService::Rest::Client::Configuration} - # for a description of the configuration fields. - # - # @example - # - # # Modify the configuration for all CatalogService clients - # ::Google::Cloud::Retail::V2::CatalogService::Rest::Client.configure do |config| - # config.timeout = 10.0 - # end - # - # @yield [config] Configure the Client client. - # @yieldparam config [Client::Configuration] - # - # @return [Client::Configuration] - # - def self.configure - @configure ||= begin - namespace = ["Google", "Cloud", "Retail", "V2"] - parent_config = while namespace.any? - parent_name = namespace.join "::" - parent_const = const_get parent_name - break parent_const.configure if parent_const.respond_to? :configure - namespace.pop - end - default_config = Client::Configuration.new parent_config - - default_config.timeout = 5.0 - default_config.retry_policy = { - initial_delay: 0.1, max_delay: 5.0, multiplier: 1.3, retry_codes: [14, 4] - } - - default_config - end - yield @configure if block_given? - @configure - end - - ## - # Configure the CatalogService Client instance. - # - # The configuration is set to the derived mode, meaning that values can be changed, - # but structural changes (adding new fields, etc.) are not allowed. Structural changes - # should be made on {Client.configure}. - # - # See {::Google::Cloud::Retail::V2::CatalogService::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 - @catalog_service_stub.universe_domain - end - - ## - # Create a new CatalogService REST client object. - # - # @example - # - # # Create a client using the default configuration - # client = ::Google::Cloud::Retail::V2::CatalogService::Rest::Client.new - # - # # Create a client using a custom configuration - # client = ::Google::Cloud::Retail::V2::CatalogService::Rest::Client.new do |config| - # config.timeout = 10.0 - # end - # - # @yield [config] Configure the CatalogService 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 - - @catalog_service_stub = ::Google::Cloud::Retail::V2::CatalogService::Rest::ServiceStub.new( - endpoint: @config.endpoint, - endpoint_template: DEFAULT_ENDPOINT_TEMPLATE, - universe_domain: @config.universe_domain, - credentials: credentials, - logger: @config.logger - ) - - @catalog_service_stub.logger(stub: true)&.info do |entry| - entry.set_system_name - entry.set_service - entry.message = "Created client for #{entry.service}" - entry.set_credentials_fields credentials - entry.set "customEndpoint", @config.endpoint if @config.endpoint - entry.set "defaultTimeout", @config.timeout if @config.timeout - entry.set "quotaProject", @quota_project_id if @quota_project_id - end - - @location_client = Google::Cloud::Location::Locations::Rest::Client.new do |config| - config.credentials = credentials - config.quota_project = @quota_project_id - config.endpoint = @catalog_service_stub.endpoint - config.universe_domain = @catalog_service_stub.universe_domain - config.logger = @catalog_service_stub.logger if config.respond_to? :logger= - end - end - - ## - # Get the associated client for mix-in of the Locations. - # - # @return [Google::Cloud::Location::Locations::Rest::Client] - # - attr_reader :location_client - - ## - # The logger used for request/response debug logging. - # - # @return [Logger] - # - def logger - @catalog_service_stub.logger - end - - # Service calls - - ## - # Lists all the {::Google::Cloud::Retail::V2::Catalog Catalog}s associated with - # the project. - # - # @overload list_catalogs(request, options = nil) - # Pass arguments to `list_catalogs` via a request object, either of type - # {::Google::Cloud::Retail::V2::ListCatalogsRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Retail::V2::ListCatalogsRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_catalogs(parent: nil, page_size: nil, page_token: nil) - # Pass arguments to `list_catalogs` via keyword arguments. Note that at - # least one keyword argument is 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 account resource name with an associated location. - # - # If the caller does not have permission to list - # {::Google::Cloud::Retail::V2::Catalog Catalog}s under this location, regardless - # of whether or not this location exists, a PERMISSION_DENIED error is - # returned. - # @param page_size [::Integer] - # Maximum number of {::Google::Cloud::Retail::V2::Catalog Catalog}s to return. If - # unspecified, defaults to 50. The maximum allowed value is 1000. Values - # above 1000 will be coerced to 1000. - # - # If this field is negative, an INVALID_ARGUMENT is returned. - # @param page_token [::String] - # A page token - # {::Google::Cloud::Retail::V2::ListCatalogsResponse#next_page_token ListCatalogsResponse.next_page_token}, - # received from a previous - # {::Google::Cloud::Retail::V2::CatalogService::Rest::Client#list_catalogs CatalogService.ListCatalogs} - # call. Provide this to retrieve the subsequent page. - # - # When paginating, all other parameters provided to - # {::Google::Cloud::Retail::V2::CatalogService::Rest::Client#list_catalogs CatalogService.ListCatalogs} - # must match the call that provided the page token. Otherwise, an - # INVALID_ARGUMENT error is returned. - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Gapic::Rest::PagedEnumerable<::Google::Cloud::Retail::V2::Catalog>] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Gapic::Rest::PagedEnumerable<::Google::Cloud::Retail::V2::Catalog>] - # - # @raise [::Google::Cloud::Error] if the REST call is aborted. - # - # @example Basic example - # require "google/cloud/retail/v2" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Retail::V2::CatalogService::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Retail::V2::ListCatalogsRequest.new - # - # # Call the list_catalogs method. - # result = client.list_catalogs request - # - # # The returned object is of type Gapic::PagedEnumerable. You can iterate - # # over elements, and API calls will be issued to fetch pages as needed. - # result.each do |item| - # # Each element is of type ::Google::Cloud::Retail::V2::Catalog. - # p item - # end - # - def list_catalogs request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Retail::V2::ListCatalogsRequest - - # Converts hash 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_catalogs.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::Retail::V2::VERSION, - transports_version_send: [:rest] - - call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - options.apply_defaults timeout: @config.rpcs.list_catalogs.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.list_catalogs.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @catalog_service_stub.list_catalogs request, options do |result, operation| - result = ::Gapic::Rest::PagedEnumerable.new @catalog_service_stub, :list_catalogs, "catalogs", 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 - - ## - # Updates the {::Google::Cloud::Retail::V2::Catalog Catalog}s. - # - # @overload update_catalog(request, options = nil) - # Pass arguments to `update_catalog` via a request object, either of type - # {::Google::Cloud::Retail::V2::UpdateCatalogRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Retail::V2::UpdateCatalogRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_catalog(catalog: nil, update_mask: nil) - # Pass arguments to `update_catalog` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param catalog [::Google::Cloud::Retail::V2::Catalog, ::Hash] - # Required. The {::Google::Cloud::Retail::V2::Catalog Catalog} to update. - # - # If the caller does not have permission to update the - # {::Google::Cloud::Retail::V2::Catalog Catalog}, regardless of whether or not it - # exists, a PERMISSION_DENIED error is returned. - # - # If the {::Google::Cloud::Retail::V2::Catalog Catalog} to update does not exist, - # a NOT_FOUND error is returned. - # @param update_mask [::Google::Protobuf::FieldMask, ::Hash] - # Indicates which fields in the provided - # {::Google::Cloud::Retail::V2::Catalog Catalog} to update. - # - # If an unsupported or unknown field is provided, an INVALID_ARGUMENT error - # is returned. - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Cloud::Retail::V2::Catalog] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::Retail::V2::Catalog] - # - # @raise [::Google::Cloud::Error] if the REST call is aborted. - # - # @example Basic example - # require "google/cloud/retail/v2" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Retail::V2::CatalogService::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Retail::V2::UpdateCatalogRequest.new - # - # # Call the update_catalog method. - # result = client.update_catalog request - # - # # The returned object is of type Google::Cloud::Retail::V2::Catalog. - # p result - # - def update_catalog request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Retail::V2::UpdateCatalogRequest - - # Converts hash 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_catalog.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::Retail::V2::VERSION, - transports_version_send: [:rest] - - call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - options.apply_defaults timeout: @config.rpcs.update_catalog.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.update_catalog.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @catalog_service_stub.update_catalog 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 - - ## - # Set a specified branch id as default branch. API methods such as - # {::Google::Cloud::Retail::V2::SearchService::Rest::Client#search SearchService.Search}, - # {::Google::Cloud::Retail::V2::ProductService::Rest::Client#get_product ProductService.GetProduct}, - # {::Google::Cloud::Retail::V2::ProductService::Rest::Client#list_products ProductService.ListProducts} - # will treat requests using "default_branch" to the actual branch id set as - # default. - # - # For example, if `projects/*/locations/*/catalogs/*/branches/1` is set as - # default, setting - # {::Google::Cloud::Retail::V2::SearchRequest#branch SearchRequest.branch} to - # `projects/*/locations/*/catalogs/*/branches/default_branch` is equivalent - # to setting - # {::Google::Cloud::Retail::V2::SearchRequest#branch SearchRequest.branch} to - # `projects/*/locations/*/catalogs/*/branches/1`. - # - # Using multiple branches can be useful when developers would like - # to have a staging branch to test and verify for future usage. When it - # becomes ready, developers switch on the staging branch using this API - # while keeping using - # `projects/*/locations/*/catalogs/*/branches/default_branch` as - # {::Google::Cloud::Retail::V2::SearchRequest#branch SearchRequest.branch} to - # route the traffic to this staging branch. - # - # CAUTION: If you have live predict/search traffic, switching the default - # branch could potentially cause outages if the ID space of the new branch - # is very different from the old one. - # - # More specifically: - # - # * PredictionService will only return product IDs from branch \\{newBranch}. - # * SearchService will only return product IDs from branch \\{newBranch} - # (if branch is not explicitly set). - # * UserEventService will only join events with products from branch - # \\{newBranch}. - # - # @overload set_default_branch(request, options = nil) - # Pass arguments to `set_default_branch` via a request object, either of type - # {::Google::Cloud::Retail::V2::SetDefaultBranchRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Retail::V2::SetDefaultBranchRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @overload set_default_branch(catalog: nil, branch_id: nil, note: nil, force: nil) - # Pass arguments to `set_default_branch` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param catalog [::String] - # Full resource name of the catalog, such as - # `projects/*/locations/global/catalogs/default_catalog`. - # @param branch_id [::String] - # The final component of the resource name of a branch. - # - # This field must be one of "0", "1" or "2". Otherwise, an INVALID_ARGUMENT - # error is returned. - # - # If there are no sufficient active products in the targeted branch and - # {::Google::Cloud::Retail::V2::SetDefaultBranchRequest#force force} is not set, a - # FAILED_PRECONDITION error is returned. - # @param note [::String] - # Some note on this request, this can be retrieved by - # {::Google::Cloud::Retail::V2::CatalogService::Rest::Client#get_default_branch CatalogService.GetDefaultBranch} - # before next valid default branch set occurs. - # - # This field must be a UTF-8 encoded string with a length limit of 1,000 - # characters. Otherwise, an INVALID_ARGUMENT error is returned. - # @param force [::Boolean] - # If set to true, it permits switching to a branch with - # {::Google::Cloud::Retail::V2::SetDefaultBranchRequest#branch_id branch_id} even - # if it has no sufficient active products. - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Protobuf::Empty] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Protobuf::Empty] - # - # @raise [::Google::Cloud::Error] if the REST call is aborted. - # - # @example Basic example - # require "google/cloud/retail/v2" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Retail::V2::CatalogService::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Retail::V2::SetDefaultBranchRequest.new - # - # # Call the set_default_branch method. - # result = client.set_default_branch request - # - # # The returned object is of type Google::Protobuf::Empty. - # p result - # - def set_default_branch request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Retail::V2::SetDefaultBranchRequest - - # Converts hash and nil to an options object - options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h - - # Customize the options with defaults - call_metadata = @config.rpcs.set_default_branch.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::Retail::V2::VERSION, - transports_version_send: [:rest] - - call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - options.apply_defaults timeout: @config.rpcs.set_default_branch.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.set_default_branch.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @catalog_service_stub.set_default_branch 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 - - ## - # Get which branch is currently default branch set by - # {::Google::Cloud::Retail::V2::CatalogService::Rest::Client#set_default_branch CatalogService.SetDefaultBranch} - # method under a specified parent catalog. - # - # @overload get_default_branch(request, options = nil) - # Pass arguments to `get_default_branch` via a request object, either of type - # {::Google::Cloud::Retail::V2::GetDefaultBranchRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Retail::V2::GetDefaultBranchRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_default_branch(catalog: nil) - # Pass arguments to `get_default_branch` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param catalog [::String] - # The parent catalog resource name, such as - # `projects/*/locations/global/catalogs/default_catalog`. - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Cloud::Retail::V2::GetDefaultBranchResponse] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::Retail::V2::GetDefaultBranchResponse] - # - # @raise [::Google::Cloud::Error] if the REST call is aborted. - # - # @example Basic example - # require "google/cloud/retail/v2" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Retail::V2::CatalogService::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Retail::V2::GetDefaultBranchRequest.new - # - # # Call the get_default_branch method. - # result = client.get_default_branch request - # - # # The returned object is of type Google::Cloud::Retail::V2::GetDefaultBranchResponse. - # p result - # - def get_default_branch request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Retail::V2::GetDefaultBranchRequest - - # Converts hash 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_default_branch.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::Retail::V2::VERSION, - transports_version_send: [:rest] - - call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - options.apply_defaults timeout: @config.rpcs.get_default_branch.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.get_default_branch.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @catalog_service_stub.get_default_branch request, options do |result, operation| - yield result, operation if block_given? - end - rescue ::Gapic::Rest::Error => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Gets a {::Google::Cloud::Retail::V2::CompletionConfig CompletionConfig}. - # - # @overload get_completion_config(request, options = nil) - # Pass arguments to `get_completion_config` via a request object, either of type - # {::Google::Cloud::Retail::V2::GetCompletionConfigRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Retail::V2::GetCompletionConfigRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_completion_config(name: nil) - # Pass arguments to `get_completion_config` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param name [::String] - # Required. Full CompletionConfig resource name. Format: - # `projects/{project_number}/locations/{location_id}/catalogs/{catalog_id}/completionConfig` - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Cloud::Retail::V2::CompletionConfig] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::Retail::V2::CompletionConfig] - # - # @raise [::Google::Cloud::Error] if the REST call is aborted. - # - # @example Basic example - # require "google/cloud/retail/v2" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Retail::V2::CatalogService::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Retail::V2::GetCompletionConfigRequest.new - # - # # Call the get_completion_config method. - # result = client.get_completion_config request - # - # # The returned object is of type Google::Cloud::Retail::V2::CompletionConfig. - # p result - # - def get_completion_config request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Retail::V2::GetCompletionConfigRequest - - # Converts hash 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_completion_config.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::Retail::V2::VERSION, - transports_version_send: [:rest] - - call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - options.apply_defaults timeout: @config.rpcs.get_completion_config.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.get_completion_config.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @catalog_service_stub.get_completion_config request, options do |result, operation| - yield result, operation if block_given? - end - rescue ::Gapic::Rest::Error => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Updates the {::Google::Cloud::Retail::V2::CompletionConfig CompletionConfig}s. - # - # @overload update_completion_config(request, options = nil) - # Pass arguments to `update_completion_config` via a request object, either of type - # {::Google::Cloud::Retail::V2::UpdateCompletionConfigRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Retail::V2::UpdateCompletionConfigRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_completion_config(completion_config: nil, update_mask: nil) - # Pass arguments to `update_completion_config` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param completion_config [::Google::Cloud::Retail::V2::CompletionConfig, ::Hash] - # Required. The {::Google::Cloud::Retail::V2::CompletionConfig CompletionConfig} - # to update. - # - # If the caller does not have permission to update the - # {::Google::Cloud::Retail::V2::CompletionConfig CompletionConfig}, then a - # PERMISSION_DENIED error is returned. - # - # If the {::Google::Cloud::Retail::V2::CompletionConfig CompletionConfig} to - # update does not exist, a NOT_FOUND error is returned. - # @param update_mask [::Google::Protobuf::FieldMask, ::Hash] - # Indicates which fields in the provided - # {::Google::Cloud::Retail::V2::CompletionConfig CompletionConfig} to update. The - # following are the only supported fields: - # - # * {::Google::Cloud::Retail::V2::CompletionConfig#matching_order CompletionConfig.matching_order} - # * {::Google::Cloud::Retail::V2::CompletionConfig#max_suggestions CompletionConfig.max_suggestions} - # * {::Google::Cloud::Retail::V2::CompletionConfig#min_prefix_length CompletionConfig.min_prefix_length} - # * {::Google::Cloud::Retail::V2::CompletionConfig#auto_learning CompletionConfig.auto_learning} - # - # If not set, all supported fields are updated. - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Cloud::Retail::V2::CompletionConfig] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::Retail::V2::CompletionConfig] - # - # @raise [::Google::Cloud::Error] if the REST call is aborted. - # - # @example Basic example - # require "google/cloud/retail/v2" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Retail::V2::CatalogService::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Retail::V2::UpdateCompletionConfigRequest.new - # - # # Call the update_completion_config method. - # result = client.update_completion_config request - # - # # The returned object is of type Google::Cloud::Retail::V2::CompletionConfig. - # p result - # - def update_completion_config request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Retail::V2::UpdateCompletionConfigRequest - - # Converts hash 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_completion_config.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::Retail::V2::VERSION, - transports_version_send: [:rest] - - call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - options.apply_defaults timeout: @config.rpcs.update_completion_config.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.update_completion_config.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @catalog_service_stub.update_completion_config request, options do |result, operation| - yield result, operation if block_given? - end - rescue ::Gapic::Rest::Error => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Gets an {::Google::Cloud::Retail::V2::AttributesConfig AttributesConfig}. - # - # @overload get_attributes_config(request, options = nil) - # Pass arguments to `get_attributes_config` via a request object, either of type - # {::Google::Cloud::Retail::V2::GetAttributesConfigRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Retail::V2::GetAttributesConfigRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_attributes_config(name: nil) - # Pass arguments to `get_attributes_config` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param name [::String] - # Required. Full AttributesConfig resource name. Format: - # `projects/{project_number}/locations/{location_id}/catalogs/{catalog_id}/attributesConfig` - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Cloud::Retail::V2::AttributesConfig] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::Retail::V2::AttributesConfig] - # - # @raise [::Google::Cloud::Error] if the REST call is aborted. - # - # @example Basic example - # require "google/cloud/retail/v2" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Retail::V2::CatalogService::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Retail::V2::GetAttributesConfigRequest.new - # - # # Call the get_attributes_config method. - # result = client.get_attributes_config request - # - # # The returned object is of type Google::Cloud::Retail::V2::AttributesConfig. - # p result - # - def get_attributes_config request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Retail::V2::GetAttributesConfigRequest - - # Converts hash 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_attributes_config.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::Retail::V2::VERSION, - transports_version_send: [:rest] - - call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - options.apply_defaults timeout: @config.rpcs.get_attributes_config.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.get_attributes_config.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @catalog_service_stub.get_attributes_config request, options do |result, operation| - yield result, operation if block_given? - end - rescue ::Gapic::Rest::Error => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Updates the {::Google::Cloud::Retail::V2::AttributesConfig AttributesConfig}. - # - # The catalog attributes in the request will be updated in the catalog, or - # inserted if they do not exist. Existing catalog attributes not included in - # the request will remain unchanged. Attributes that are assigned to - # products, but do not exist at the catalog level, are always included in the - # response. The product attribute is assigned default values for missing - # catalog attribute fields, e.g., searchable and dynamic facetable options. - # - # @overload update_attributes_config(request, options = nil) - # Pass arguments to `update_attributes_config` via a request object, either of type - # {::Google::Cloud::Retail::V2::UpdateAttributesConfigRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Retail::V2::UpdateAttributesConfigRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_attributes_config(attributes_config: nil, update_mask: nil) - # Pass arguments to `update_attributes_config` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param attributes_config [::Google::Cloud::Retail::V2::AttributesConfig, ::Hash] - # Required. The {::Google::Cloud::Retail::V2::AttributesConfig AttributesConfig} - # to update. - # @param update_mask [::Google::Protobuf::FieldMask, ::Hash] - # Indicates which fields in the provided - # {::Google::Cloud::Retail::V2::AttributesConfig AttributesConfig} to update. The - # following is the only supported field: - # - # * {::Google::Cloud::Retail::V2::AttributesConfig#catalog_attributes AttributesConfig.catalog_attributes} - # - # If not set, all supported fields are updated. - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Cloud::Retail::V2::AttributesConfig] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::Retail::V2::AttributesConfig] - # - # @raise [::Google::Cloud::Error] if the REST call is aborted. - # - # @example Basic example - # require "google/cloud/retail/v2" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Retail::V2::CatalogService::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Retail::V2::UpdateAttributesConfigRequest.new - # - # # Call the update_attributes_config method. - # result = client.update_attributes_config request - # - # # The returned object is of type Google::Cloud::Retail::V2::AttributesConfig. - # p result - # - def update_attributes_config request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Retail::V2::UpdateAttributesConfigRequest - - # Converts hash 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_attributes_config.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::Retail::V2::VERSION, - transports_version_send: [:rest] - - call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - options.apply_defaults timeout: @config.rpcs.update_attributes_config.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.update_attributes_config.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @catalog_service_stub.update_attributes_config request, options do |result, operation| - yield result, operation if block_given? - end - rescue ::Gapic::Rest::Error => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Adds the specified - # {::Google::Cloud::Retail::V2::CatalogAttribute CatalogAttribute} to the - # {::Google::Cloud::Retail::V2::AttributesConfig AttributesConfig}. - # - # If the {::Google::Cloud::Retail::V2::CatalogAttribute CatalogAttribute} to add - # already exists, an ALREADY_EXISTS error is returned. - # - # @overload add_catalog_attribute(request, options = nil) - # Pass arguments to `add_catalog_attribute` via a request object, either of type - # {::Google::Cloud::Retail::V2::AddCatalogAttributeRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Retail::V2::AddCatalogAttributeRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @overload add_catalog_attribute(attributes_config: nil, catalog_attribute: nil) - # Pass arguments to `add_catalog_attribute` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param attributes_config [::String] - # Required. Full AttributesConfig resource name. Format: - # `projects/{project_number}/locations/{location_id}/catalogs/{catalog_id}/attributesConfig` - # @param catalog_attribute [::Google::Cloud::Retail::V2::CatalogAttribute, ::Hash] - # Required. The {::Google::Cloud::Retail::V2::CatalogAttribute CatalogAttribute} - # to add. - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Cloud::Retail::V2::AttributesConfig] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::Retail::V2::AttributesConfig] - # - # @raise [::Google::Cloud::Error] if the REST call is aborted. - # - # @example Basic example - # require "google/cloud/retail/v2" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Retail::V2::CatalogService::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Retail::V2::AddCatalogAttributeRequest.new - # - # # Call the add_catalog_attribute method. - # result = client.add_catalog_attribute request - # - # # The returned object is of type Google::Cloud::Retail::V2::AttributesConfig. - # p result - # - def add_catalog_attribute request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Retail::V2::AddCatalogAttributeRequest - - # Converts hash and nil to an options object - options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h - - # Customize the options with defaults - call_metadata = @config.rpcs.add_catalog_attribute.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::Retail::V2::VERSION, - transports_version_send: [:rest] - - call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - options.apply_defaults timeout: @config.rpcs.add_catalog_attribute.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.add_catalog_attribute.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @catalog_service_stub.add_catalog_attribute 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 - - ## - # Removes the specified - # {::Google::Cloud::Retail::V2::CatalogAttribute CatalogAttribute} from the - # {::Google::Cloud::Retail::V2::AttributesConfig AttributesConfig}. - # - # If the {::Google::Cloud::Retail::V2::CatalogAttribute CatalogAttribute} to - # remove does not exist, a NOT_FOUND error is returned. - # - # @overload remove_catalog_attribute(request, options = nil) - # Pass arguments to `remove_catalog_attribute` via a request object, either of type - # {::Google::Cloud::Retail::V2::RemoveCatalogAttributeRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Retail::V2::RemoveCatalogAttributeRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @overload remove_catalog_attribute(attributes_config: nil, key: nil) - # Pass arguments to `remove_catalog_attribute` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param attributes_config [::String] - # Required. Full AttributesConfig resource name. Format: - # `projects/{project_number}/locations/{location_id}/catalogs/{catalog_id}/attributesConfig` - # @param key [::String] - # Required. The attribute name key of the - # {::Google::Cloud::Retail::V2::CatalogAttribute CatalogAttribute} to remove. - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Cloud::Retail::V2::AttributesConfig] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::Retail::V2::AttributesConfig] - # - # @raise [::Google::Cloud::Error] if the REST call is aborted. - # - # @example Basic example - # require "google/cloud/retail/v2" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Retail::V2::CatalogService::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Retail::V2::RemoveCatalogAttributeRequest.new - # - # # Call the remove_catalog_attribute method. - # result = client.remove_catalog_attribute request - # - # # The returned object is of type Google::Cloud::Retail::V2::AttributesConfig. - # p result - # - def remove_catalog_attribute request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Retail::V2::RemoveCatalogAttributeRequest - - # Converts hash 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.remove_catalog_attribute.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::Retail::V2::VERSION, - transports_version_send: [:rest] - - call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - options.apply_defaults timeout: @config.rpcs.remove_catalog_attribute.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.remove_catalog_attribute.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @catalog_service_stub.remove_catalog_attribute 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 - - ## - # Replaces the specified - # {::Google::Cloud::Retail::V2::CatalogAttribute CatalogAttribute} in the - # {::Google::Cloud::Retail::V2::AttributesConfig AttributesConfig} by updating the - # catalog attribute with the same - # {::Google::Cloud::Retail::V2::CatalogAttribute#key CatalogAttribute.key}. - # - # If the {::Google::Cloud::Retail::V2::CatalogAttribute CatalogAttribute} to - # replace does not exist, a NOT_FOUND error is returned. - # - # @overload replace_catalog_attribute(request, options = nil) - # Pass arguments to `replace_catalog_attribute` via a request object, either of type - # {::Google::Cloud::Retail::V2::ReplaceCatalogAttributeRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Retail::V2::ReplaceCatalogAttributeRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @overload replace_catalog_attribute(attributes_config: nil, catalog_attribute: nil, update_mask: nil) - # Pass arguments to `replace_catalog_attribute` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param attributes_config [::String] - # Required. Full AttributesConfig resource name. Format: - # `projects/{project_number}/locations/{location_id}/catalogs/{catalog_id}/attributesConfig` - # @param catalog_attribute [::Google::Cloud::Retail::V2::CatalogAttribute, ::Hash] - # Required. The updated - # {::Google::Cloud::Retail::V2::CatalogAttribute CatalogAttribute}. - # @param update_mask [::Google::Protobuf::FieldMask, ::Hash] - # Indicates which fields in the provided - # {::Google::Cloud::Retail::V2::CatalogAttribute CatalogAttribute} to update. The - # following are NOT supported: - # - # * {::Google::Cloud::Retail::V2::CatalogAttribute#key CatalogAttribute.key} - # - # If not set, all supported fields are updated. - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Cloud::Retail::V2::AttributesConfig] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::Retail::V2::AttributesConfig] - # - # @raise [::Google::Cloud::Error] if the REST call is aborted. - # - # @example Basic example - # require "google/cloud/retail/v2" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Retail::V2::CatalogService::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Retail::V2::ReplaceCatalogAttributeRequest.new - # - # # Call the replace_catalog_attribute method. - # result = client.replace_catalog_attribute request - # - # # The returned object is of type Google::Cloud::Retail::V2::AttributesConfig. - # p result - # - def replace_catalog_attribute request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Retail::V2::ReplaceCatalogAttributeRequest - - # Converts hash 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.replace_catalog_attribute.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::Retail::V2::VERSION, - transports_version_send: [:rest] - - call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - options.apply_defaults timeout: @config.rpcs.replace_catalog_attribute.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.replace_catalog_attribute.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @catalog_service_stub.replace_catalog_attribute 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 CatalogService REST API. - # - # This class represents the configuration for CatalogService REST, - # providing control over timeouts, retry behavior, logging, transport - # parameters, and other low-level controls. Certain parameters can also be - # applied individually to specific RPCs. See - # {::Google::Cloud::Retail::V2::CatalogService::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_catalogs to 20 seconds, - # # and all remaining timeouts to 10 seconds. - # ::Google::Cloud::Retail::V2::CatalogService::Rest::Client.configure do |config| - # config.timeout = 10.0 - # config.rpcs.list_catalogs.timeout = 20.0 - # end - # - # # Apply the above configuration only to a new client. - # client = ::Google::Cloud::Retail::V2::CatalogService::Rest::Client.new do |config| - # config.timeout = 10.0 - # config.rpcs.list_catalogs.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 = "retail.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 CatalogService 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_catalogs` - # @return [::Gapic::Config::Method] - # - attr_reader :list_catalogs - ## - # RPC-specific configuration for `update_catalog` - # @return [::Gapic::Config::Method] - # - attr_reader :update_catalog - ## - # RPC-specific configuration for `set_default_branch` - # @return [::Gapic::Config::Method] - # - attr_reader :set_default_branch - ## - # RPC-specific configuration for `get_default_branch` - # @return [::Gapic::Config::Method] - # - attr_reader :get_default_branch - ## - # RPC-specific configuration for `get_completion_config` - # @return [::Gapic::Config::Method] - # - attr_reader :get_completion_config - ## - # RPC-specific configuration for `update_completion_config` - # @return [::Gapic::Config::Method] - # - attr_reader :update_completion_config - ## - # RPC-specific configuration for `get_attributes_config` - # @return [::Gapic::Config::Method] - # - attr_reader :get_attributes_config - ## - # RPC-specific configuration for `update_attributes_config` - # @return [::Gapic::Config::Method] - # - attr_reader :update_attributes_config - ## - # RPC-specific configuration for `add_catalog_attribute` - # @return [::Gapic::Config::Method] - # - attr_reader :add_catalog_attribute - ## - # RPC-specific configuration for `remove_catalog_attribute` - # @return [::Gapic::Config::Method] - # - attr_reader :remove_catalog_attribute - ## - # RPC-specific configuration for `replace_catalog_attribute` - # @return [::Gapic::Config::Method] - # - attr_reader :replace_catalog_attribute - - # @private - def initialize parent_rpcs = nil - list_catalogs_config = parent_rpcs.list_catalogs if parent_rpcs.respond_to? :list_catalogs - @list_catalogs = ::Gapic::Config::Method.new list_catalogs_config - update_catalog_config = parent_rpcs.update_catalog if parent_rpcs.respond_to? :update_catalog - @update_catalog = ::Gapic::Config::Method.new update_catalog_config - set_default_branch_config = parent_rpcs.set_default_branch if parent_rpcs.respond_to? :set_default_branch - @set_default_branch = ::Gapic::Config::Method.new set_default_branch_config - get_default_branch_config = parent_rpcs.get_default_branch if parent_rpcs.respond_to? :get_default_branch - @get_default_branch = ::Gapic::Config::Method.new get_default_branch_config - get_completion_config_config = parent_rpcs.get_completion_config if parent_rpcs.respond_to? :get_completion_config - @get_completion_config = ::Gapic::Config::Method.new get_completion_config_config - update_completion_config_config = parent_rpcs.update_completion_config if parent_rpcs.respond_to? :update_completion_config - @update_completion_config = ::Gapic::Config::Method.new update_completion_config_config - get_attributes_config_config = parent_rpcs.get_attributes_config if parent_rpcs.respond_to? :get_attributes_config - @get_attributes_config = ::Gapic::Config::Method.new get_attributes_config_config - update_attributes_config_config = parent_rpcs.update_attributes_config if parent_rpcs.respond_to? :update_attributes_config - @update_attributes_config = ::Gapic::Config::Method.new update_attributes_config_config - add_catalog_attribute_config = parent_rpcs.add_catalog_attribute if parent_rpcs.respond_to? :add_catalog_attribute - @add_catalog_attribute = ::Gapic::Config::Method.new add_catalog_attribute_config - remove_catalog_attribute_config = parent_rpcs.remove_catalog_attribute if parent_rpcs.respond_to? :remove_catalog_attribute - @remove_catalog_attribute = ::Gapic::Config::Method.new remove_catalog_attribute_config - replace_catalog_attribute_config = parent_rpcs.replace_catalog_attribute if parent_rpcs.respond_to? :replace_catalog_attribute - @replace_catalog_attribute = ::Gapic::Config::Method.new replace_catalog_attribute_config - - yield self if block_given? - end - end - end - end - end - end - end - end - end -end diff --git a/owl-bot-staging/google-cloud-retail-v2/lib/google/cloud/retail/v2/catalog_service/rest/service_stub.rb b/owl-bot-staging/google-cloud-retail-v2/lib/google/cloud/retail/v2/catalog_service/rest/service_stub.rb deleted file mode 100644 index aba96c79d1c5..000000000000 --- a/owl-bot-staging/google-cloud-retail-v2/lib/google/cloud/retail/v2/catalog_service/rest/service_stub.rb +++ /dev/null @@ -1,759 +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/retail/v2/catalog_service_pb" - -module Google - module Cloud - module Retail - module V2 - module CatalogService - module Rest - ## - # REST service stub for the CatalogService service. - # Service stub contains baseline method implementations - # including transcoding, making the REST call, and deserialing the response. - # - class ServiceStub - # @private - def initialize endpoint:, endpoint_template:, universe_domain:, credentials:, logger: - # These require statements are intentionally placed here to initialize - # the REST modules only when it's required. - require "gapic/rest" - - @client_stub = ::Gapic::Rest::ClientStub.new endpoint: endpoint, - endpoint_template: endpoint_template, - universe_domain: universe_domain, - credentials: credentials, - numeric_enums: true, - service_name: self.class, - raise_faraday_errors: false, - logger: logger - end - - ## - # The effective universe domain - # - # @return [String] - # - def universe_domain - @client_stub.universe_domain - end - - ## - # The effective endpoint - # - # @return [String] - # - def endpoint - @client_stub.endpoint - end - - ## - # The logger used for request/response debug logging. - # - # @return [Logger] - # - def logger stub: false - stub ? @client_stub.stub_logger : @client_stub.logger - end - - ## - # Baseline implementation for the list_catalogs REST call - # - # @param request_pb [::Google::Cloud::Retail::V2::ListCatalogsRequest] - # A request object representing the call parameters. Required. - # @param options [::Gapic::CallOptions] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Cloud::Retail::V2::ListCatalogsResponse] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::Retail::V2::ListCatalogsResponse] - # A result object deserialized from the server's reply - def list_catalogs request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_list_catalogs_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_catalogs", - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Cloud::Retail::V2::ListCatalogsResponse.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_catalog REST call - # - # @param request_pb [::Google::Cloud::Retail::V2::UpdateCatalogRequest] - # A request object representing the call parameters. Required. - # @param options [::Gapic::CallOptions] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Cloud::Retail::V2::Catalog] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::Retail::V2::Catalog] - # A result object deserialized from the server's reply - def update_catalog request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_update_catalog_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_catalog", - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Cloud::Retail::V2::Catalog.decode_json response.body, ignore_unknown_fields: true - catch :response do - yield result, operation if block_given? - result - end - end - - ## - # Baseline implementation for the set_default_branch REST call - # - # @param request_pb [::Google::Cloud::Retail::V2::SetDefaultBranchRequest] - # 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 set_default_branch request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_set_default_branch_request request_pb - query_string_params = if query_string_params.any? - query_string_params.to_h { |p| p.split "=", 2 } - else - {} - end - - response = @client_stub.make_http_request( - verb, - uri: uri, - body: body || "", - params: query_string_params, - method_name: "set_default_branch", - 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 get_default_branch REST call - # - # @param request_pb [::Google::Cloud::Retail::V2::GetDefaultBranchRequest] - # A request object representing the call parameters. Required. - # @param options [::Gapic::CallOptions] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Cloud::Retail::V2::GetDefaultBranchResponse] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::Retail::V2::GetDefaultBranchResponse] - # A result object deserialized from the server's reply - def get_default_branch request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_get_default_branch_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_default_branch", - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Cloud::Retail::V2::GetDefaultBranchResponse.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_completion_config REST call - # - # @param request_pb [::Google::Cloud::Retail::V2::GetCompletionConfigRequest] - # A request object representing the call parameters. Required. - # @param options [::Gapic::CallOptions] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Cloud::Retail::V2::CompletionConfig] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::Retail::V2::CompletionConfig] - # A result object deserialized from the server's reply - def get_completion_config request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_get_completion_config_request request_pb - query_string_params = if query_string_params.any? - query_string_params.to_h { |p| p.split "=", 2 } - else - {} - end - - response = @client_stub.make_http_request( - verb, - uri: uri, - body: body || "", - params: query_string_params, - method_name: "get_completion_config", - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Cloud::Retail::V2::CompletionConfig.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_completion_config REST call - # - # @param request_pb [::Google::Cloud::Retail::V2::UpdateCompletionConfigRequest] - # A request object representing the call parameters. Required. - # @param options [::Gapic::CallOptions] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Cloud::Retail::V2::CompletionConfig] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::Retail::V2::CompletionConfig] - # A result object deserialized from the server's reply - def update_completion_config request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_update_completion_config_request request_pb - query_string_params = if query_string_params.any? - query_string_params.to_h { |p| p.split "=", 2 } - else - {} - end - - response = @client_stub.make_http_request( - verb, - uri: uri, - body: body || "", - params: query_string_params, - method_name: "update_completion_config", - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Cloud::Retail::V2::CompletionConfig.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_attributes_config REST call - # - # @param request_pb [::Google::Cloud::Retail::V2::GetAttributesConfigRequest] - # A request object representing the call parameters. Required. - # @param options [::Gapic::CallOptions] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Cloud::Retail::V2::AttributesConfig] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::Retail::V2::AttributesConfig] - # A result object deserialized from the server's reply - def get_attributes_config request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_get_attributes_config_request request_pb - query_string_params = if query_string_params.any? - query_string_params.to_h { |p| p.split "=", 2 } - else - {} - end - - response = @client_stub.make_http_request( - verb, - uri: uri, - body: body || "", - params: query_string_params, - method_name: "get_attributes_config", - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Cloud::Retail::V2::AttributesConfig.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_attributes_config REST call - # - # @param request_pb [::Google::Cloud::Retail::V2::UpdateAttributesConfigRequest] - # A request object representing the call parameters. Required. - # @param options [::Gapic::CallOptions] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Cloud::Retail::V2::AttributesConfig] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::Retail::V2::AttributesConfig] - # A result object deserialized from the server's reply - def update_attributes_config request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_update_attributes_config_request request_pb - query_string_params = if query_string_params.any? - query_string_params.to_h { |p| p.split "=", 2 } - else - {} - end - - response = @client_stub.make_http_request( - verb, - uri: uri, - body: body || "", - params: query_string_params, - method_name: "update_attributes_config", - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Cloud::Retail::V2::AttributesConfig.decode_json response.body, ignore_unknown_fields: true - catch :response do - yield result, operation if block_given? - result - end - end - - ## - # Baseline implementation for the add_catalog_attribute REST call - # - # @param request_pb [::Google::Cloud::Retail::V2::AddCatalogAttributeRequest] - # A request object representing the call parameters. Required. - # @param options [::Gapic::CallOptions] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Cloud::Retail::V2::AttributesConfig] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::Retail::V2::AttributesConfig] - # A result object deserialized from the server's reply - def add_catalog_attribute request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_add_catalog_attribute_request request_pb - query_string_params = if query_string_params.any? - query_string_params.to_h { |p| p.split "=", 2 } - else - {} - end - - response = @client_stub.make_http_request( - verb, - uri: uri, - body: body || "", - params: query_string_params, - method_name: "add_catalog_attribute", - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Cloud::Retail::V2::AttributesConfig.decode_json response.body, ignore_unknown_fields: true - catch :response do - yield result, operation if block_given? - result - end - end - - ## - # Baseline implementation for the remove_catalog_attribute REST call - # - # @param request_pb [::Google::Cloud::Retail::V2::RemoveCatalogAttributeRequest] - # A request object representing the call parameters. Required. - # @param options [::Gapic::CallOptions] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Cloud::Retail::V2::AttributesConfig] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::Retail::V2::AttributesConfig] - # A result object deserialized from the server's reply - def remove_catalog_attribute request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_remove_catalog_attribute_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: "remove_catalog_attribute", - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Cloud::Retail::V2::AttributesConfig.decode_json response.body, ignore_unknown_fields: true - catch :response do - yield result, operation if block_given? - result - end - end - - ## - # Baseline implementation for the replace_catalog_attribute REST call - # - # @param request_pb [::Google::Cloud::Retail::V2::ReplaceCatalogAttributeRequest] - # A request object representing the call parameters. Required. - # @param options [::Gapic::CallOptions] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Cloud::Retail::V2::AttributesConfig] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::Retail::V2::AttributesConfig] - # A result object deserialized from the server's reply - def replace_catalog_attribute request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_replace_catalog_attribute_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: "replace_catalog_attribute", - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Cloud::Retail::V2::AttributesConfig.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_catalogs REST call - # - # @param request_pb [::Google::Cloud::Retail::V2::ListCatalogsRequest] - # 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_catalogs_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :get, - uri_template: "/v2/{parent}/catalogs", - matches: [ - ["parent", %r{^projects/[^/]+/locations/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the update_catalog REST call - # - # @param request_pb [::Google::Cloud::Retail::V2::UpdateCatalogRequest] - # 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_catalog_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :patch, - uri_template: "/v2/{catalog.name}", - body: "catalog", - matches: [ - ["catalog.name", %r{^projects/[^/]+/locations/[^/]+/catalogs/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the set_default_branch REST call - # - # @param request_pb [::Google::Cloud::Retail::V2::SetDefaultBranchRequest] - # A request object representing the call parameters. Required. - # @return [Array(String, [String, nil], Hash{String => String})] - # Uri, Body, Query string parameters - def self.transcode_set_default_branch_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :post, - uri_template: "/v2/{catalog}:setDefaultBranch", - body: "*", - matches: [ - ["catalog", %r{^projects/[^/]+/locations/[^/]+/catalogs/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the get_default_branch REST call - # - # @param request_pb [::Google::Cloud::Retail::V2::GetDefaultBranchRequest] - # 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_default_branch_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :get, - uri_template: "/v2/{catalog}:getDefaultBranch", - matches: [ - ["catalog", %r{^projects/[^/]+/locations/[^/]+/catalogs/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the get_completion_config REST call - # - # @param request_pb [::Google::Cloud::Retail::V2::GetCompletionConfigRequest] - # 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_completion_config_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :get, - uri_template: "/v2/{name}", - matches: [ - ["name", %r{^projects/[^/]+/locations/[^/]+/catalogs/[^/]+/completionConfig/?$}, false] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the update_completion_config REST call - # - # @param request_pb [::Google::Cloud::Retail::V2::UpdateCompletionConfigRequest] - # 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_completion_config_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :patch, - uri_template: "/v2/{completion_config.name}", - body: "completion_config", - matches: [ - ["completion_config.name", %r{^projects/[^/]+/locations/[^/]+/catalogs/[^/]+/completionConfig/?$}, false] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the get_attributes_config REST call - # - # @param request_pb [::Google::Cloud::Retail::V2::GetAttributesConfigRequest] - # 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_attributes_config_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :get, - uri_template: "/v2/{name}", - matches: [ - ["name", %r{^projects/[^/]+/locations/[^/]+/catalogs/[^/]+/attributesConfig/?$}, false] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the update_attributes_config REST call - # - # @param request_pb [::Google::Cloud::Retail::V2::UpdateAttributesConfigRequest] - # 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_attributes_config_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :patch, - uri_template: "/v2/{attributes_config.name}", - body: "attributes_config", - matches: [ - ["attributes_config.name", %r{^projects/[^/]+/locations/[^/]+/catalogs/[^/]+/attributesConfig/?$}, false] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the add_catalog_attribute REST call - # - # @param request_pb [::Google::Cloud::Retail::V2::AddCatalogAttributeRequest] - # A request object representing the call parameters. Required. - # @return [Array(String, [String, nil], Hash{String => String})] - # Uri, Body, Query string parameters - def self.transcode_add_catalog_attribute_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :post, - uri_template: "/v2/{attributes_config}:addCatalogAttribute", - body: "*", - matches: [ - ["attributes_config", %r{^projects/[^/]+/locations/[^/]+/catalogs/[^/]+/attributesConfig/?$}, false] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the remove_catalog_attribute REST call - # - # @param request_pb [::Google::Cloud::Retail::V2::RemoveCatalogAttributeRequest] - # A request object representing the call parameters. Required. - # @return [Array(String, [String, nil], Hash{String => String})] - # Uri, Body, Query string parameters - def self.transcode_remove_catalog_attribute_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :post, - uri_template: "/v2/{attributes_config}:removeCatalogAttribute", - body: "*", - matches: [ - ["attributes_config", %r{^projects/[^/]+/locations/[^/]+/catalogs/[^/]+/attributesConfig/?$}, false] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the replace_catalog_attribute REST call - # - # @param request_pb [::Google::Cloud::Retail::V2::ReplaceCatalogAttributeRequest] - # A request object representing the call parameters. Required. - # @return [Array(String, [String, nil], Hash{String => String})] - # Uri, Body, Query string parameters - def self.transcode_replace_catalog_attribute_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :post, - uri_template: "/v2/{attributes_config}:replaceCatalogAttribute", - body: "*", - matches: [ - ["attributes_config", %r{^projects/[^/]+/locations/[^/]+/catalogs/[^/]+/attributesConfig/?$}, false] - ] - ) - transcoder.transcode request_pb - end - end - end - end - end - end - end -end diff --git a/owl-bot-staging/google-cloud-retail-v2/lib/google/cloud/retail/v2/catalog_service_pb.rb b/owl-bot-staging/google-cloud-retail-v2/lib/google/cloud/retail/v2/catalog_service_pb.rb deleted file mode 100644 index 13226293301e..000000000000 --- a/owl-bot-staging/google-cloud-retail-v2/lib/google/cloud/retail/v2/catalog_service_pb.rb +++ /dev/null @@ -1,42 +0,0 @@ -# frozen_string_literal: true -# Generated by the protocol buffer compiler. DO NOT EDIT! -# source: google/cloud/retail/v2/catalog_service.proto - -require 'google/protobuf' - -require 'google/api/annotations_pb' -require 'google/api/client_pb' -require 'google/api/field_behavior_pb' -require 'google/api/resource_pb' -require 'google/cloud/retail/v2/catalog_pb' -require 'google/protobuf/empty_pb' -require 'google/protobuf/field_mask_pb' -require 'google/protobuf/timestamp_pb' - - -descriptor_data = "\n,google/cloud/retail/v2/catalog_service.proto\x12\x16google.cloud.retail.v2\x1a\x1cgoogle/api/annotations.proto\x1a\x17google/api/client.proto\x1a\x1fgoogle/api/field_behavior.proto\x1a\x19google/api/resource.proto\x1a$google/cloud/retail/v2/catalog.proto\x1a\x1bgoogle/protobuf/empty.proto\x1a google/protobuf/field_mask.proto\x1a\x1fgoogle/protobuf/timestamp.proto\"w\n\x13ListCatalogsRequest\x12\x39\n\x06parent\x18\x01 \x01(\tB)\xe0\x41\x02\xfa\x41#\n!locations.googleapis.com/Location\x12\x11\n\tpage_size\x18\x02 \x01(\x05\x12\x12\n\npage_token\x18\x03 \x01(\t\"b\n\x14ListCatalogsResponse\x12\x31\n\x08\x63\x61talogs\x18\x01 \x03(\x0b\x32\x1f.google.cloud.retail.v2.Catalog\x12\x17\n\x0fnext_page_token\x18\x02 \x01(\t\"~\n\x14UpdateCatalogRequest\x12\x35\n\x07\x63\x61talog\x18\x01 \x01(\x0b\x32\x1f.google.cloud.retail.v2.CatalogB\x03\xe0\x41\x02\x12/\n\x0bupdate_mask\x18\x02 \x01(\x0b\x32\x1a.google.protobuf.FieldMask\"\xa1\x01\n\x17SetDefaultBranchRequest\x12\x33\n\x07\x63\x61talog\x18\x01 \x01(\tB\"\xfa\x41\x1f\n\x1dretail.googleapis.com/Catalog\x12\x34\n\tbranch_id\x18\x02 \x01(\tB!\xfa\x41\x1e\n\x1cretail.googleapis.com/Branch\x12\x0c\n\x04note\x18\x03 \x01(\t\x12\r\n\x05\x66orce\x18\x04 \x01(\x08\"N\n\x17GetDefaultBranchRequest\x12\x33\n\x07\x63\x61talog\x18\x01 \x01(\tB\"\xfa\x41\x1f\n\x1dretail.googleapis.com/Catalog\"\x89\x01\n\x18GetDefaultBranchResponse\x12\x31\n\x06\x62ranch\x18\x01 \x01(\tB!\xfa\x41\x1e\n\x1cretail.googleapis.com/Branch\x12,\n\x08set_time\x18\x02 \x01(\x0b\x32\x1a.google.protobuf.Timestamp\x12\x0c\n\x04note\x18\x03 \x01(\t\"Z\n\x1aGetCompletionConfigRequest\x12<\n\x04name\x18\x01 \x01(\tB.\xe0\x41\x02\xfa\x41(\n&retail.googleapis.com/CompletionConfig\"\x9a\x01\n\x1dUpdateCompletionConfigRequest\x12H\n\x11\x63ompletion_config\x18\x01 \x01(\x0b\x32(.google.cloud.retail.v2.CompletionConfigB\x03\xe0\x41\x02\x12/\n\x0bupdate_mask\x18\x02 \x01(\x0b\x32\x1a.google.protobuf.FieldMask\"Z\n\x1aGetAttributesConfigRequest\x12<\n\x04name\x18\x01 \x01(\tB.\xe0\x41\x02\xfa\x41(\n&retail.googleapis.com/AttributesConfig\"\x9a\x01\n\x1dUpdateAttributesConfigRequest\x12H\n\x11\x61ttributes_config\x18\x01 \x01(\x0b\x32(.google.cloud.retail.v2.AttributesConfigB\x03\xe0\x41\x02\x12/\n\x0bupdate_mask\x18\x02 \x01(\x0b\x32\x1a.google.protobuf.FieldMask\"\xb1\x01\n\x1a\x41\x64\x64\x43\x61talogAttributeRequest\x12I\n\x11\x61ttributes_config\x18\x01 \x01(\tB.\xe0\x41\x02\xfa\x41(\n&retail.googleapis.com/AttributesConfig\x12H\n\x11\x63\x61talog_attribute\x18\x02 \x01(\x0b\x32(.google.cloud.retail.v2.CatalogAttributeB\x03\xe0\x41\x02\"|\n\x1dRemoveCatalogAttributeRequest\x12I\n\x11\x61ttributes_config\x18\x01 \x01(\tB.\xe0\x41\x02\xfa\x41(\n&retail.googleapis.com/AttributesConfig\x12\x10\n\x03key\x18\x02 \x01(\tB\x03\xe0\x41\x02\"\xe6\x01\n\x1eReplaceCatalogAttributeRequest\x12I\n\x11\x61ttributes_config\x18\x01 \x01(\tB.\xe0\x41\x02\xfa\x41(\n&retail.googleapis.com/AttributesConfig\x12H\n\x11\x63\x61talog_attribute\x18\x02 \x01(\x0b\x32(.google.cloud.retail.v2.CatalogAttributeB\x03\xe0\x41\x02\x12/\n\x0bupdate_mask\x18\x03 \x01(\x0b\x32\x1a.google.protobuf.FieldMask2\x97\x13\n\x0e\x43\x61talogService\x12\xa8\x01\n\x0cListCatalogs\x12+.google.cloud.retail.v2.ListCatalogsRequest\x1a,.google.cloud.retail.v2.ListCatalogsResponse\"=\xda\x41\x06parent\x82\xd3\xe4\x93\x02.\x12,/v2/{parent=projects/*/locations/*}/catalogs\x12\xbb\x01\n\rUpdateCatalog\x12,.google.cloud.retail.v2.UpdateCatalogRequest\x1a\x1f.google.cloud.retail.v2.Catalog\"[\xda\x41\x13\x63\x61talog,update_mask\x82\xd3\xe4\x93\x02?24/v2/{catalog.name=projects/*/locations/*/catalogs/*}:\x07\x63\x61talog\x12\xb2\x01\n\x10SetDefaultBranch\x12/.google.cloud.retail.v2.SetDefaultBranchRequest\x1a\x16.google.protobuf.Empty\"U\xda\x41\x07\x63\x61talog\x82\xd3\xe4\x93\x02\x45\"@/v2/{catalog=projects/*/locations/*/catalogs/*}:setDefaultBranch:\x01*\x12\xc9\x01\n\x10GetDefaultBranch\x12/.google.cloud.retail.v2.GetDefaultBranchRequest\x1a\x30.google.cloud.retail.v2.GetDefaultBranchResponse\"R\xda\x41\x07\x63\x61talog\x82\xd3\xe4\x93\x02\x42\x12@/v2/{catalog=projects/*/locations/*/catalogs/*}:getDefaultBranch\x12\xc1\x01\n\x13GetCompletionConfig\x12\x32.google.cloud.retail.v2.GetCompletionConfigRequest\x1a(.google.cloud.retail.v2.CompletionConfig\"L\xda\x41\x04name\x82\xd3\xe4\x93\x02?\x12=/v2/{name=projects/*/locations/*/catalogs/*/completionConfig}\x12\x86\x02\n\x16UpdateCompletionConfig\x12\x35.google.cloud.retail.v2.UpdateCompletionConfigRequest\x1a(.google.cloud.retail.v2.CompletionConfig\"\x8a\x01\xda\x41\x1d\x63ompletion_config,update_mask\x82\xd3\xe4\x93\x02\x64\x32O/v2/{completion_config.name=projects/*/locations/*/catalogs/*/completionConfig}:\x11\x63ompletion_config\x12\xc1\x01\n\x13GetAttributesConfig\x12\x32.google.cloud.retail.v2.GetAttributesConfigRequest\x1a(.google.cloud.retail.v2.AttributesConfig\"L\xda\x41\x04name\x82\xd3\xe4\x93\x02?\x12=/v2/{name=projects/*/locations/*/catalogs/*/attributesConfig}\x12\x86\x02\n\x16UpdateAttributesConfig\x12\x35.google.cloud.retail.v2.UpdateAttributesConfigRequest\x1a(.google.cloud.retail.v2.AttributesConfig\"\x8a\x01\xda\x41\x1d\x61ttributes_config,update_mask\x82\xd3\xe4\x93\x02\x64\x32O/v2/{attributes_config.name=projects/*/locations/*/catalogs/*/attributesConfig}:\x11\x61ttributes_config\x12\xde\x01\n\x13\x41\x64\x64\x43\x61talogAttribute\x12\x32.google.cloud.retail.v2.AddCatalogAttributeRequest\x1a(.google.cloud.retail.v2.AttributesConfig\"i\x82\xd3\xe4\x93\x02\x63\"^/v2/{attributes_config=projects/*/locations/*/catalogs/*/attributesConfig}:addCatalogAttribute:\x01*\x12\xe7\x01\n\x16RemoveCatalogAttribute\x12\x35.google.cloud.retail.v2.RemoveCatalogAttributeRequest\x1a(.google.cloud.retail.v2.AttributesConfig\"l\x82\xd3\xe4\x93\x02\x66\"a/v2/{attributes_config=projects/*/locations/*/catalogs/*/attributesConfig}:removeCatalogAttribute:\x01*\x12\xea\x01\n\x17ReplaceCatalogAttribute\x12\x36.google.cloud.retail.v2.ReplaceCatalogAttributeRequest\x1a(.google.cloud.retail.v2.AttributesConfig\"m\x82\xd3\xe4\x93\x02g\"b/v2/{attributes_config=projects/*/locations/*/catalogs/*/attributesConfig}:replaceCatalogAttribute:\x01*\x1aI\xca\x41\x15retail.googleapis.com\xd2\x41.https://www.googleapis.com/auth/cloud-platformB\xbe\x01\n\x1a\x63om.google.cloud.retail.v2B\x13\x43\x61talogServiceProtoP\x01Z2cloud.google.com/go/retail/apiv2/retailpb;retailpb\xa2\x02\x06RETAIL\xaa\x02\x16Google.Cloud.Retail.V2\xca\x02\x16Google\\Cloud\\Retail\\V2\xea\x02\x19Google::Cloud::Retail::V2b\x06proto3" - -pool = ::Google::Protobuf::DescriptorPool.generated_pool -pool.add_serialized_file(descriptor_data) - -module Google - module Cloud - module Retail - module V2 - ListCatalogsRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.retail.v2.ListCatalogsRequest").msgclass - ListCatalogsResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.retail.v2.ListCatalogsResponse").msgclass - UpdateCatalogRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.retail.v2.UpdateCatalogRequest").msgclass - SetDefaultBranchRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.retail.v2.SetDefaultBranchRequest").msgclass - GetDefaultBranchRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.retail.v2.GetDefaultBranchRequest").msgclass - GetDefaultBranchResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.retail.v2.GetDefaultBranchResponse").msgclass - GetCompletionConfigRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.retail.v2.GetCompletionConfigRequest").msgclass - UpdateCompletionConfigRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.retail.v2.UpdateCompletionConfigRequest").msgclass - GetAttributesConfigRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.retail.v2.GetAttributesConfigRequest").msgclass - UpdateAttributesConfigRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.retail.v2.UpdateAttributesConfigRequest").msgclass - AddCatalogAttributeRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.retail.v2.AddCatalogAttributeRequest").msgclass - RemoveCatalogAttributeRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.retail.v2.RemoveCatalogAttributeRequest").msgclass - ReplaceCatalogAttributeRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.retail.v2.ReplaceCatalogAttributeRequest").msgclass - end - end - end -end diff --git a/owl-bot-staging/google-cloud-retail-v2/lib/google/cloud/retail/v2/catalog_service_services_pb.rb b/owl-bot-staging/google-cloud-retail-v2/lib/google/cloud/retail/v2/catalog_service_services_pb.rb deleted file mode 100644 index bfd199b2e5c5..000000000000 --- a/owl-bot-staging/google-cloud-retail-v2/lib/google/cloud/retail/v2/catalog_service_services_pb.rb +++ /dev/null @@ -1,125 +0,0 @@ -# Generated by the protocol buffer compiler. DO NOT EDIT! -# Source: google/cloud/retail/v2/catalog_service.proto for package 'Google.Cloud.Retail.V2' -# Original file comments: -# 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 -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. -# - -require 'grpc' -require 'google/cloud/retail/v2/catalog_service_pb' - -module Google - module Cloud - module Retail - module V2 - module CatalogService - # Service for managing catalog configuration. - class Service - - include ::GRPC::GenericService - - self.marshal_class_method = :encode - self.unmarshal_class_method = :decode - self.service_name = 'google.cloud.retail.v2.CatalogService' - - # Lists all the [Catalog][google.cloud.retail.v2.Catalog]s associated with - # the project. - rpc :ListCatalogs, ::Google::Cloud::Retail::V2::ListCatalogsRequest, ::Google::Cloud::Retail::V2::ListCatalogsResponse - # Updates the [Catalog][google.cloud.retail.v2.Catalog]s. - rpc :UpdateCatalog, ::Google::Cloud::Retail::V2::UpdateCatalogRequest, ::Google::Cloud::Retail::V2::Catalog - # Set a specified branch id as default branch. API methods such as - # [SearchService.Search][google.cloud.retail.v2.SearchService.Search], - # [ProductService.GetProduct][google.cloud.retail.v2.ProductService.GetProduct], - # [ProductService.ListProducts][google.cloud.retail.v2.ProductService.ListProducts] - # will treat requests using "default_branch" to the actual branch id set as - # default. - # - # For example, if `projects/*/locations/*/catalogs/*/branches/1` is set as - # default, setting - # [SearchRequest.branch][google.cloud.retail.v2.SearchRequest.branch] to - # `projects/*/locations/*/catalogs/*/branches/default_branch` is equivalent - # to setting - # [SearchRequest.branch][google.cloud.retail.v2.SearchRequest.branch] to - # `projects/*/locations/*/catalogs/*/branches/1`. - # - # Using multiple branches can be useful when developers would like - # to have a staging branch to test and verify for future usage. When it - # becomes ready, developers switch on the staging branch using this API - # while keeping using - # `projects/*/locations/*/catalogs/*/branches/default_branch` as - # [SearchRequest.branch][google.cloud.retail.v2.SearchRequest.branch] to - # route the traffic to this staging branch. - # - # CAUTION: If you have live predict/search traffic, switching the default - # branch could potentially cause outages if the ID space of the new branch - # is very different from the old one. - # - # More specifically: - # - # * PredictionService will only return product IDs from branch {newBranch}. - # * SearchService will only return product IDs from branch {newBranch} - # (if branch is not explicitly set). - # * UserEventService will only join events with products from branch - # {newBranch}. - rpc :SetDefaultBranch, ::Google::Cloud::Retail::V2::SetDefaultBranchRequest, ::Google::Protobuf::Empty - # Get which branch is currently default branch set by - # [CatalogService.SetDefaultBranch][google.cloud.retail.v2.CatalogService.SetDefaultBranch] - # method under a specified parent catalog. - rpc :GetDefaultBranch, ::Google::Cloud::Retail::V2::GetDefaultBranchRequest, ::Google::Cloud::Retail::V2::GetDefaultBranchResponse - # Gets a [CompletionConfig][google.cloud.retail.v2.CompletionConfig]. - rpc :GetCompletionConfig, ::Google::Cloud::Retail::V2::GetCompletionConfigRequest, ::Google::Cloud::Retail::V2::CompletionConfig - # Updates the [CompletionConfig][google.cloud.retail.v2.CompletionConfig]s. - rpc :UpdateCompletionConfig, ::Google::Cloud::Retail::V2::UpdateCompletionConfigRequest, ::Google::Cloud::Retail::V2::CompletionConfig - # Gets an [AttributesConfig][google.cloud.retail.v2.AttributesConfig]. - rpc :GetAttributesConfig, ::Google::Cloud::Retail::V2::GetAttributesConfigRequest, ::Google::Cloud::Retail::V2::AttributesConfig - # Updates the [AttributesConfig][google.cloud.retail.v2.AttributesConfig]. - # - # The catalog attributes in the request will be updated in the catalog, or - # inserted if they do not exist. Existing catalog attributes not included in - # the request will remain unchanged. Attributes that are assigned to - # products, but do not exist at the catalog level, are always included in the - # response. The product attribute is assigned default values for missing - # catalog attribute fields, e.g., searchable and dynamic facetable options. - rpc :UpdateAttributesConfig, ::Google::Cloud::Retail::V2::UpdateAttributesConfigRequest, ::Google::Cloud::Retail::V2::AttributesConfig - # Adds the specified - # [CatalogAttribute][google.cloud.retail.v2.CatalogAttribute] to the - # [AttributesConfig][google.cloud.retail.v2.AttributesConfig]. - # - # If the [CatalogAttribute][google.cloud.retail.v2.CatalogAttribute] to add - # already exists, an ALREADY_EXISTS error is returned. - rpc :AddCatalogAttribute, ::Google::Cloud::Retail::V2::AddCatalogAttributeRequest, ::Google::Cloud::Retail::V2::AttributesConfig - # Removes the specified - # [CatalogAttribute][google.cloud.retail.v2.CatalogAttribute] from the - # [AttributesConfig][google.cloud.retail.v2.AttributesConfig]. - # - # If the [CatalogAttribute][google.cloud.retail.v2.CatalogAttribute] to - # remove does not exist, a NOT_FOUND error is returned. - rpc :RemoveCatalogAttribute, ::Google::Cloud::Retail::V2::RemoveCatalogAttributeRequest, ::Google::Cloud::Retail::V2::AttributesConfig - # Replaces the specified - # [CatalogAttribute][google.cloud.retail.v2.CatalogAttribute] in the - # [AttributesConfig][google.cloud.retail.v2.AttributesConfig] by updating the - # catalog attribute with the same - # [CatalogAttribute.key][google.cloud.retail.v2.CatalogAttribute.key]. - # - # If the [CatalogAttribute][google.cloud.retail.v2.CatalogAttribute] to - # replace does not exist, a NOT_FOUND error is returned. - rpc :ReplaceCatalogAttribute, ::Google::Cloud::Retail::V2::ReplaceCatalogAttributeRequest, ::Google::Cloud::Retail::V2::AttributesConfig - end - - Stub = Service.rpc_stub_class - end - end - end - end -end diff --git a/owl-bot-staging/google-cloud-retail-v2/lib/google/cloud/retail/v2/common_pb.rb b/owl-bot-staging/google-cloud-retail-v2/lib/google/cloud/retail/v2/common_pb.rb deleted file mode 100644 index 275dd759e9cb..000000000000 --- a/owl-bot-staging/google-cloud-retail-v2/lib/google/cloud/retail/v2/common_pb.rb +++ /dev/null @@ -1,58 +0,0 @@ -# frozen_string_literal: true -# Generated by the protocol buffer compiler. DO NOT EDIT! -# source: google/cloud/retail/v2/common.proto - -require 'google/protobuf' - -require 'google/api/field_behavior_pb' -require 'google/protobuf/timestamp_pb' - - -descriptor_data = "\n#google/cloud/retail/v2/common.proto\x12\x16google.cloud.retail.v2\x1a\x1fgoogle/api/field_behavior.proto\x1a\x1fgoogle/protobuf/timestamp.proto\"\xc9\x02\n\tCondition\x12@\n\x0bquery_terms\x18\x01 \x03(\x0b\x32+.google.cloud.retail.v2.Condition.QueryTerm\x12\x46\n\x11\x61\x63tive_time_range\x18\x03 \x03(\x0b\x32+.google.cloud.retail.v2.Condition.TimeRange\x12\x17\n\x0fpage_categories\x18\x04 \x03(\t\x1a.\n\tQueryTerm\x12\r\n\x05value\x18\x01 \x01(\t\x12\x12\n\nfull_match\x18\x02 \x01(\x08\x1ai\n\tTimeRange\x12.\n\nstart_time\x18\x01 \x01(\x0b\x32\x1a.google.protobuf.Timestamp\x12,\n\x08\x65nd_time\x18\x02 \x01(\x0b\x32\x1a.google.protobuf.Timestamp\"\xea\r\n\x04Rule\x12@\n\x0c\x62oost_action\x18\x02 \x01(\x0b\x32(.google.cloud.retail.v2.Rule.BoostActionH\x00\x12\x46\n\x0fredirect_action\x18\x03 \x01(\x0b\x32+.google.cloud.retail.v2.Rule.RedirectActionH\x00\x12S\n\x16oneway_synonyms_action\x18\x06 \x01(\x0b\x32\x31.google.cloud.retail.v2.Rule.OnewaySynonymsActionH\x00\x12T\n\x17\x64o_not_associate_action\x18\x07 \x01(\x0b\x32\x31.google.cloud.retail.v2.Rule.DoNotAssociateActionH\x00\x12L\n\x12replacement_action\x18\x08 \x01(\x0b\x32..google.cloud.retail.v2.Rule.ReplacementActionH\x00\x12\x42\n\rignore_action\x18\t \x01(\x0b\x32).google.cloud.retail.v2.Rule.IgnoreActionH\x00\x12\x42\n\rfilter_action\x18\n \x01(\x0b\x32).google.cloud.retail.v2.Rule.FilterActionH\x00\x12S\n\x16twoway_synonyms_action\x18\x0b \x01(\x0b\x32\x31.google.cloud.retail.v2.Rule.TwowaySynonymsActionH\x00\x12X\n\x19\x66orce_return_facet_action\x18\x0c \x01(\x0b\x32\x33.google.cloud.retail.v2.Rule.ForceReturnFacetActionH\x00\x12M\n\x13remove_facet_action\x18\r \x01(\x0b\x32..google.cloud.retail.v2.Rule.RemoveFacetActionH\x00\x12<\n\npin_action\x18\x0e \x01(\x0b\x32&.google.cloud.retail.v2.Rule.PinActionH\x00\x12\x39\n\tcondition\x18\x01 \x01(\x0b\x32!.google.cloud.retail.v2.ConditionB\x03\xe0\x41\x02\x1a\x35\n\x0b\x42oostAction\x12\r\n\x05\x62oost\x18\x01 \x01(\x02\x12\x17\n\x0fproducts_filter\x18\x02 \x01(\t\x1a\x1e\n\x0c\x46ilterAction\x12\x0e\n\x06\x66ilter\x18\x01 \x01(\t\x1a&\n\x0eRedirectAction\x12\x14\n\x0credirect_uri\x18\x01 \x01(\t\x1a(\n\x14TwowaySynonymsAction\x12\x10\n\x08synonyms\x18\x01 \x03(\t\x1aS\n\x14OnewaySynonymsAction\x12\x13\n\x0bquery_terms\x18\x03 \x03(\t\x12\x10\n\x08synonyms\x18\x04 \x03(\t\x12\x14\n\x0coneway_terms\x18\x02 \x03(\t\x1aZ\n\x14\x44oNotAssociateAction\x12\x13\n\x0bquery_terms\x18\x02 \x03(\t\x12\x1e\n\x16\x64o_not_associate_terms\x18\x03 \x03(\t\x12\r\n\x05terms\x18\x01 \x03(\t\x1aP\n\x11ReplacementAction\x12\x13\n\x0bquery_terms\x18\x02 \x03(\t\x12\x18\n\x10replacement_term\x18\x03 \x01(\t\x12\x0c\n\x04term\x18\x01 \x01(\t\x1a$\n\x0cIgnoreAction\x12\x14\n\x0cignore_terms\x18\x01 \x03(\t\x1a\xce\x01\n\x16\x46orceReturnFacetAction\x12o\n\x1a\x66\x61\x63\x65t_position_adjustments\x18\x01 \x03(\x0b\x32K.google.cloud.retail.v2.Rule.ForceReturnFacetAction.FacetPositionAdjustment\x1a\x43\n\x17\x46\x61\x63\x65tPositionAdjustment\x12\x16\n\x0e\x61ttribute_name\x18\x01 \x01(\t\x12\x10\n\x08position\x18\x02 \x01(\x05\x1a,\n\x11RemoveFacetAction\x12\x17\n\x0f\x61ttribute_names\x18\x01 \x03(\t\x1a\x84\x01\n\tPinAction\x12H\n\x07pin_map\x18\x01 \x03(\x0b\x32\x32.google.cloud.retail.v2.Rule.PinAction.PinMapEntryB\x03\xe0\x41\x02\x1a-\n\x0bPinMapEntry\x12\x0b\n\x03key\x18\x01 \x01(\x03\x12\r\n\x05value\x18\x02 \x01(\t:\x02\x38\x01\x42\x08\n\x06\x61\x63tion\"/\n\x08\x41udience\x12\x0f\n\x07genders\x18\x01 \x03(\t\x12\x12\n\nage_groups\x18\x02 \x03(\t\"3\n\tColorInfo\x12\x16\n\x0e\x63olor_families\x18\x01 \x03(\t\x12\x0e\n\x06\x63olors\x18\x02 \x03(\t\"\x86\x01\n\x0f\x43ustomAttribute\x12\x0c\n\x04text\x18\x01 \x03(\t\x12\x0f\n\x07numbers\x18\x02 \x03(\x01\x12\x1b\n\nsearchable\x18\x03 \x01(\x08\x42\x02\x18\x01H\x00\x88\x01\x01\x12\x1a\n\tindexable\x18\x04 \x01(\x08\x42\x02\x18\x01H\x01\x88\x01\x01\x42\r\n\x0b_searchableB\x0c\n\n_indexable\"2\n\x0f\x46ulfillmentInfo\x12\x0c\n\x04type\x18\x01 \x01(\t\x12\x11\n\tplace_ids\x18\x02 \x03(\t\"8\n\x05Image\x12\x10\n\x03uri\x18\x01 \x01(\tB\x03\xe0\x41\x02\x12\x0e\n\x06height\x18\x02 \x01(\x05\x12\r\n\x05width\x18\x03 \x01(\x05\"x\n\x08Interval\x12\x11\n\x07minimum\x18\x01 \x01(\x01H\x00\x12\x1b\n\x11\x65xclusive_minimum\x18\x02 \x01(\x01H\x00\x12\x11\n\x07maximum\x18\x03 \x01(\x01H\x01\x12\x1b\n\x11\x65xclusive_maximum\x18\x04 \x01(\x01H\x01\x42\x05\n\x03minB\x05\n\x03max\"\x89\x03\n\tPriceInfo\x12\x15\n\rcurrency_code\x18\x01 \x01(\t\x12\r\n\x05price\x18\x02 \x01(\x02\x12\x16\n\x0eoriginal_price\x18\x03 \x01(\x02\x12\x0c\n\x04\x63ost\x18\x04 \x01(\x02\x12\x38\n\x14price_effective_time\x18\x05 \x01(\x0b\x32\x1a.google.protobuf.Timestamp\x12\x35\n\x11price_expire_time\x18\x06 \x01(\x0b\x32\x1a.google.protobuf.Timestamp\x12\x46\n\x0bprice_range\x18\x07 \x01(\x0b\x32,.google.cloud.retail.v2.PriceInfo.PriceRangeB\x03\xe0\x41\x03\x1aw\n\nPriceRange\x12/\n\x05price\x18\x01 \x01(\x0b\x32 .google.cloud.retail.v2.Interval\x12\x38\n\x0eoriginal_price\x18\x02 \x01(\x0b\x32 .google.cloud.retail.v2.Interval\"P\n\x06Rating\x12\x14\n\x0crating_count\x18\x01 \x01(\x05\x12\x16\n\x0e\x61verage_rating\x18\x02 \x01(\x02\x12\x18\n\x10rating_histogram\x18\x03 \x03(\x05\"`\n\x08UserInfo\x12\x0f\n\x07user_id\x18\x01 \x01(\t\x12\x12\n\nip_address\x18\x02 \x01(\t\x12\x12\n\nuser_agent\x18\x03 \x01(\t\x12\x1b\n\x13\x64irect_user_request\x18\x04 \x01(\x08\"\xb0\x02\n\x0eLocalInventory\x12\x15\n\x08place_id\x18\x01 \x01(\tB\x03\xe0\x41\x01\x12:\n\nprice_info\x18\x02 \x01(\x0b\x32!.google.cloud.retail.v2.PriceInfoB\x03\xe0\x41\x01\x12O\n\nattributes\x18\x03 \x03(\x0b\x32\x36.google.cloud.retail.v2.LocalInventory.AttributesEntryB\x03\xe0\x41\x01\x12\x1e\n\x11\x66ulfillment_types\x18\x04 \x03(\tB\x03\xe0\x41\x01\x1aZ\n\x0f\x41ttributesEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12\x36\n\x05value\x18\x02 \x01(\x0b\x32\'.google.cloud.retail.v2.CustomAttribute:\x02\x38\x01\"\xbf\x03\n\x12PinControlMetadata\x12X\n\x10\x61ll_matched_pins\x18\x01 \x03(\x0b\x32>.google.cloud.retail.v2.PinControlMetadata.AllMatchedPinsEntry\x12Q\n\x0c\x64ropped_pins\x18\x02 \x03(\x0b\x32;.google.cloud.retail.v2.PinControlMetadata.DroppedPinsEntry\x1a!\n\x0bProductPins\x12\x12\n\nproduct_id\x18\x01 \x03(\t\x1am\n\x13\x41llMatchedPinsEntry\x12\x0b\n\x03key\x18\x01 \x01(\x03\x12\x45\n\x05value\x18\x02 \x01(\x0b\x32\x36.google.cloud.retail.v2.PinControlMetadata.ProductPins:\x02\x38\x01\x1aj\n\x10\x44roppedPinsEntry\x12\x0b\n\x03key\x18\x01 \x01(\x03\x12\x45\n\x05value\x18\x02 \x01(\x0b\x32\x36.google.cloud.retail.v2.PinControlMetadata.ProductPins:\x02\x38\x01\"\x1c\n\nStringList\x12\x0e\n\x06values\x18\x01 \x03(\t\"\x1c\n\nDoubleList\x12\x0e\n\x06values\x18\x01 \x03(\x01*\x86\x01\n\x14\x41ttributeConfigLevel\x12&\n\"ATTRIBUTE_CONFIG_LEVEL_UNSPECIFIED\x10\x00\x12\"\n\x1ePRODUCT_LEVEL_ATTRIBUTE_CONFIG\x10\x01\x12\"\n\x1e\x43\x41TALOG_LEVEL_ATTRIBUTE_CONFIG\x10\x02*i\n\x0cSolutionType\x12\x1d\n\x19SOLUTION_TYPE_UNSPECIFIED\x10\x00\x12 \n\x1cSOLUTION_TYPE_RECOMMENDATION\x10\x01\x12\x18\n\x14SOLUTION_TYPE_SEARCH\x10\x02*\xa1\x01\n\x1eRecommendationsFilteringOption\x12\x30\n,RECOMMENDATIONS_FILTERING_OPTION_UNSPECIFIED\x10\x00\x12&\n\"RECOMMENDATIONS_FILTERING_DISABLED\x10\x01\x12%\n!RECOMMENDATIONS_FILTERING_ENABLED\x10\x03*\x8b\x01\n\x15SearchSolutionUseCase\x12(\n$SEARCH_SOLUTION_USE_CASE_UNSPECIFIED\x10\x00\x12#\n\x1fSEARCH_SOLUTION_USE_CASE_SEARCH\x10\x01\x12#\n\x1fSEARCH_SOLUTION_USE_CASE_BROWSE\x10\x02\x42\xb6\x01\n\x1a\x63om.google.cloud.retail.v2B\x0b\x43ommonProtoP\x01Z2cloud.google.com/go/retail/apiv2/retailpb;retailpb\xa2\x02\x06RETAIL\xaa\x02\x16Google.Cloud.Retail.V2\xca\x02\x16Google\\Cloud\\Retail\\V2\xea\x02\x19Google::Cloud::Retail::V2b\x06proto3" - -pool = ::Google::Protobuf::DescriptorPool.generated_pool -pool.add_serialized_file(descriptor_data) - -module Google - module Cloud - module Retail - module V2 - Condition = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.retail.v2.Condition").msgclass - Condition::QueryTerm = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.retail.v2.Condition.QueryTerm").msgclass - Condition::TimeRange = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.retail.v2.Condition.TimeRange").msgclass - Rule = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.retail.v2.Rule").msgclass - Rule::BoostAction = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.retail.v2.Rule.BoostAction").msgclass - Rule::FilterAction = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.retail.v2.Rule.FilterAction").msgclass - Rule::RedirectAction = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.retail.v2.Rule.RedirectAction").msgclass - Rule::TwowaySynonymsAction = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.retail.v2.Rule.TwowaySynonymsAction").msgclass - Rule::OnewaySynonymsAction = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.retail.v2.Rule.OnewaySynonymsAction").msgclass - Rule::DoNotAssociateAction = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.retail.v2.Rule.DoNotAssociateAction").msgclass - Rule::ReplacementAction = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.retail.v2.Rule.ReplacementAction").msgclass - Rule::IgnoreAction = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.retail.v2.Rule.IgnoreAction").msgclass - Rule::ForceReturnFacetAction = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.retail.v2.Rule.ForceReturnFacetAction").msgclass - Rule::ForceReturnFacetAction::FacetPositionAdjustment = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.retail.v2.Rule.ForceReturnFacetAction.FacetPositionAdjustment").msgclass - Rule::RemoveFacetAction = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.retail.v2.Rule.RemoveFacetAction").msgclass - Rule::PinAction = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.retail.v2.Rule.PinAction").msgclass - Audience = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.retail.v2.Audience").msgclass - ColorInfo = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.retail.v2.ColorInfo").msgclass - CustomAttribute = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.retail.v2.CustomAttribute").msgclass - FulfillmentInfo = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.retail.v2.FulfillmentInfo").msgclass - Image = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.retail.v2.Image").msgclass - Interval = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.retail.v2.Interval").msgclass - PriceInfo = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.retail.v2.PriceInfo").msgclass - PriceInfo::PriceRange = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.retail.v2.PriceInfo.PriceRange").msgclass - Rating = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.retail.v2.Rating").msgclass - UserInfo = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.retail.v2.UserInfo").msgclass - LocalInventory = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.retail.v2.LocalInventory").msgclass - PinControlMetadata = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.retail.v2.PinControlMetadata").msgclass - PinControlMetadata::ProductPins = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.retail.v2.PinControlMetadata.ProductPins").msgclass - StringList = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.retail.v2.StringList").msgclass - DoubleList = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.retail.v2.DoubleList").msgclass - AttributeConfigLevel = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.retail.v2.AttributeConfigLevel").enummodule - SolutionType = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.retail.v2.SolutionType").enummodule - RecommendationsFilteringOption = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.retail.v2.RecommendationsFilteringOption").enummodule - SearchSolutionUseCase = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.retail.v2.SearchSolutionUseCase").enummodule - end - end - end -end diff --git a/owl-bot-staging/google-cloud-retail-v2/lib/google/cloud/retail/v2/completion_service.rb b/owl-bot-staging/google-cloud-retail-v2/lib/google/cloud/retail/v2/completion_service.rb deleted file mode 100644 index 910963175533..000000000000 --- a/owl-bot-staging/google-cloud-retail-v2/lib/google/cloud/retail/v2/completion_service.rb +++ /dev/null @@ -1,59 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -require "gapic/common" -require "gapic/config" -require "gapic/config/method" - -require "google/cloud/retail/v2/version" - -require "google/cloud/retail/v2/completion_service/credentials" -require "google/cloud/retail/v2/completion_service/paths" -require "google/cloud/retail/v2/completion_service/operations" -require "google/cloud/retail/v2/completion_service/client" -require "google/cloud/retail/v2/completion_service/rest" - -module Google - module Cloud - module Retail - module V2 - ## - # Autocomplete service for retail. - # - # This feature is only available for users who have Retail Search enabled. - # Enable Retail Search on Cloud Console before using this feature. - # - # @example Load this service and instantiate a gRPC client - # - # require "google/cloud/retail/v2/completion_service" - # client = ::Google::Cloud::Retail::V2::CompletionService::Client.new - # - # @example Load this service and instantiate a REST client - # - # require "google/cloud/retail/v2/completion_service/rest" - # client = ::Google::Cloud::Retail::V2::CompletionService::Rest::Client.new - # - module CompletionService - end - end - end - end -end - -helper_path = ::File.join __dir__, "completion_service", "helpers.rb" -require "google/cloud/retail/v2/completion_service/helpers" if ::File.file? helper_path diff --git a/owl-bot-staging/google-cloud-retail-v2/lib/google/cloud/retail/v2/completion_service/client.rb b/owl-bot-staging/google-cloud-retail-v2/lib/google/cloud/retail/v2/completion_service/client.rb deleted file mode 100644 index 28ee2fda07b6..000000000000 --- a/owl-bot-staging/google-cloud-retail-v2/lib/google/cloud/retail/v2/completion_service/client.rb +++ /dev/null @@ -1,714 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -require "google/cloud/errors" -require "google/cloud/retail/v2/completion_service_pb" -require "google/cloud/location" - -module Google - module Cloud - module Retail - module V2 - module CompletionService - ## - # Client for the CompletionService service. - # - # Autocomplete service for retail. - # - # This feature is only available for users who have Retail Search enabled. - # Enable Retail Search on Cloud Console before using this feature. - # - class Client - # @private - API_VERSION = "" - - # @private - DEFAULT_ENDPOINT_TEMPLATE = "retail.$UNIVERSE_DOMAIN$" - - include Paths - - # @private - attr_reader :completion_service_stub - - ## - # Configure the CompletionService Client class. - # - # See {::Google::Cloud::Retail::V2::CompletionService::Client::Configuration} - # for a description of the configuration fields. - # - # @example - # - # # Modify the configuration for all CompletionService clients - # ::Google::Cloud::Retail::V2::CompletionService::Client.configure do |config| - # config.timeout = 10.0 - # end - # - # @yield [config] Configure the Client client. - # @yieldparam config [Client::Configuration] - # - # @return [Client::Configuration] - # - def self.configure - @configure ||= begin - namespace = ["Google", "Cloud", "Retail", "V2"] - parent_config = while namespace.any? - parent_name = namespace.join "::" - parent_const = const_get parent_name - break parent_const.configure if parent_const.respond_to? :configure - namespace.pop - end - default_config = Client::Configuration.new parent_config - - default_config.timeout = 5.0 - default_config.retry_policy = { - initial_delay: 0.1, max_delay: 5.0, multiplier: 1.3, retry_codes: [14, 4] - } - - default_config - end - yield @configure if block_given? - @configure - end - - ## - # Configure the CompletionService Client instance. - # - # The configuration is set to the derived mode, meaning that values can be changed, - # but structural changes (adding new fields, etc.) are not allowed. Structural changes - # should be made on {Client.configure}. - # - # See {::Google::Cloud::Retail::V2::CompletionService::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 - @completion_service_stub.universe_domain - end - - ## - # Create a new CompletionService client object. - # - # @example - # - # # Create a client using the default configuration - # client = ::Google::Cloud::Retail::V2::CompletionService::Client.new - # - # # Create a client using a custom configuration - # client = ::Google::Cloud::Retail::V2::CompletionService::Client.new do |config| - # config.timeout = 10.0 - # end - # - # @yield [config] Configure the CompletionService client. - # @yieldparam config [Client::Configuration] - # - def initialize - # These require statements are intentionally placed here to initialize - # the gRPC module only when it's required. - # See https://github.com/googleapis/toolkit/issues/446 - require "gapic/grpc" - require "google/cloud/retail/v2/completion_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 - - @completion_service_stub = ::Gapic::ServiceStub.new( - ::Google::Cloud::Retail::V2::CompletionService::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 - ) - - @completion_service_stub.stub_logger&.info do |entry| - entry.set_system_name - entry.set_service - entry.message = "Created client for #{entry.service}" - entry.set_credentials_fields credentials - entry.set "customEndpoint", @config.endpoint if @config.endpoint - entry.set "defaultTimeout", @config.timeout if @config.timeout - entry.set "quotaProject", @quota_project_id if @quota_project_id - end - - @location_client = Google::Cloud::Location::Locations::Client.new do |config| - config.credentials = credentials - config.quota_project = @quota_project_id - config.endpoint = @completion_service_stub.endpoint - config.universe_domain = @completion_service_stub.universe_domain - config.logger = @completion_service_stub.logger if config.respond_to? :logger= - end - end - - ## - # Get the associated client for long-running operations. - # - # @return [::Google::Cloud::Retail::V2::CompletionService::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 - @completion_service_stub.logger - end - - # Service calls - - ## - # Completes the specified prefix with keyword suggestions. - # - # This feature is only available for users who have Retail Search enabled. - # Enable Retail Search on Cloud Console before using this feature. - # - # @overload complete_query(request, options = nil) - # Pass arguments to `complete_query` via a request object, either of type - # {::Google::Cloud::Retail::V2::CompleteQueryRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Retail::V2::CompleteQueryRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. - # - # @overload complete_query(catalog: nil, query: nil, visitor_id: nil, language_codes: nil, device_type: nil, dataset: nil, max_suggestions: nil, enable_attribute_suggestions: nil, entity: nil) - # Pass arguments to `complete_query` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param catalog [::String] - # Required. Catalog for which the completion is performed. - # - # Full resource name of catalog, such as - # `projects/*/locations/global/catalogs/default_catalog`. - # @param query [::String] - # Required. The query used to generate suggestions. - # - # The maximum number of allowed characters is 255. - # @param visitor_id [::String] - # Recommended field. A unique identifier for tracking visitors. For example, - # this could be implemented with an HTTP cookie, which should be able to - # uniquely identify a visitor on a single device. This unique identifier - # should not change if the visitor logs in or out of the website. - # - # The field must be a UTF-8 encoded string with a length limit of 128 - # characters. Otherwise, an INVALID_ARGUMENT error is returned. - # @param language_codes [::Array<::String>] - # Note that this field applies for `user-data` dataset only. For requests - # with `cloud-retail` dataset, setting this field has no effect. - # - # The language filters applied to the output suggestions. If set, it should - # contain the language of the query. If not set, suggestions are returned - # without considering language restrictions. This is the BCP-47 language - # code, such as "en-US" or "sr-Latn". For more information, see [Tags for - # Identifying Languages](https://tools.ietf.org/html/bcp47). The maximum - # number of language codes is 3. - # @param device_type [::String] - # The device type context for completion suggestions. We recommend that you - # leave this field empty. - # - # It can apply different suggestions on different device types, e.g. - # `DESKTOP`, `MOBILE`. If it is empty, the suggestions are across all device - # types. - # - # Supported formats: - # - # * `UNKNOWN_DEVICE_TYPE` - # - # * `DESKTOP` - # - # * `MOBILE` - # - # * A customized string starts with `OTHER_`, e.g. `OTHER_IPHONE`. - # @param dataset [::String] - # Determines which dataset to use for fetching completion. "user-data" will - # use the dataset imported through - # {::Google::Cloud::Retail::V2::CompletionService::Client#import_completion_data CompletionService.ImportCompletionData}. - # `cloud-retail` will use the dataset generated by Cloud Retail based on user - # events. If left empty, completions will be fetched from the `user-data` - # dataset. - # - # Current supported values: - # - # * user-data - # - # * cloud-retail: - # This option requires enabling auto-learning function first. See - # [guidelines](https://cloud.google.com/retail/docs/completion-overview#generated-completion-dataset). - # @param max_suggestions [::Integer] - # Completion max suggestions. If left unset or set to 0, then will fallback - # to the configured value - # {::Google::Cloud::Retail::V2::CompletionConfig#max_suggestions CompletionConfig.max_suggestions}. - # - # The maximum allowed max suggestions is 20. If it is set higher, it will be - # capped by 20. - # @param enable_attribute_suggestions [::Boolean] - # If true, attribute suggestions are enabled and provided in the response. - # - # This field is only available for the `cloud-retail` dataset. - # @param entity [::String] - # The entity for customers who run multiple entities, domains, sites, or - # regions, for example, `Google US`, `Google Ads`, `Waymo`, - # `google.com`, `youtube.com`, etc. - # If this is set, it must be an exact match with - # {::Google::Cloud::Retail::V2::UserEvent#entity UserEvent.entity} to get - # per-entity autocomplete results. This field will be applied to - # `completion_results` only. It has no effect on the `attribute_results`. - # Also, this entity should be limited to 256 characters, if too long, it will - # be truncated to 256 characters in both generation and serving time, and may - # lead to mis-match. To ensure it works, please set the entity with string - # within 256 characters. - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Google::Cloud::Retail::V2::CompleteQueryResponse] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Google::Cloud::Retail::V2::CompleteQueryResponse] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/cloud/retail/v2" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Retail::V2::CompletionService::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Retail::V2::CompleteQueryRequest.new - # - # # Call the complete_query method. - # result = client.complete_query request - # - # # The returned object is of type Google::Cloud::Retail::V2::CompleteQueryResponse. - # p result - # - def complete_query request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Retail::V2::CompleteQueryRequest - - # Converts hash 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.complete_query.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::Retail::V2::VERSION - metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - header_params = {} - if request.catalog - header_params["catalog"] = request.catalog - 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.complete_query.timeout, - metadata: metadata, - retry_policy: @config.rpcs.complete_query.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @completion_service_stub.call_rpc :complete_query, 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 - - ## - # Bulk import of processed completion dataset. - # - # Request processing is asynchronous. Partial updating is not supported. - # - # The operation is successfully finished only after the imported suggestions - # are indexed successfully and ready for serving. The process takes hours. - # - # This feature is only available for users who have Retail Search enabled. - # Enable Retail Search on Cloud Console before using this feature. - # - # @overload import_completion_data(request, options = nil) - # Pass arguments to `import_completion_data` via a request object, either of type - # {::Google::Cloud::Retail::V2::ImportCompletionDataRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Retail::V2::ImportCompletionDataRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. - # - # @overload import_completion_data(parent: nil, input_config: nil, notification_pubsub_topic: nil) - # Pass arguments to `import_completion_data` via keyword arguments. Note that at - # least one keyword argument is 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 catalog which the suggestions dataset belongs to. - # - # Format: `projects/1234/locations/global/catalogs/default_catalog`. - # @param input_config [::Google::Cloud::Retail::V2::CompletionDataInputConfig, ::Hash] - # Required. The desired input location of the data. - # @param notification_pubsub_topic [::String] - # Pub/Sub topic for receiving notification. If this field is set, - # when the import is finished, a notification is sent to - # specified Pub/Sub topic. The message data is JSON string of a - # {::Google::Longrunning::Operation Operation}. - # Format of the Pub/Sub topic is `projects/{project}/topics/{topic}`. - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Gapic::Operation] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Gapic::Operation] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/cloud/retail/v2" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Retail::V2::CompletionService::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Retail::V2::ImportCompletionDataRequest.new - # - # # Call the import_completion_data method. - # result = client.import_completion_data 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 import_completion_data request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Retail::V2::ImportCompletionDataRequest - - # Converts hash 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.import_completion_data.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::Retail::V2::VERSION - metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - header_params = {} - if request.parent - 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.import_completion_data.timeout, - metadata: metadata, - retry_policy: @config.rpcs.import_completion_data.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @completion_service_stub.call_rpc :import_completion_data, 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 CompletionService API. - # - # This class represents the configuration for CompletionService, - # providing control over timeouts, retry behavior, logging, transport - # parameters, and other low-level controls. Certain parameters can also be - # applied individually to specific RPCs. See - # {::Google::Cloud::Retail::V2::CompletionService::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 - # # complete_query to 20 seconds, - # # and all remaining timeouts to 10 seconds. - # ::Google::Cloud::Retail::V2::CompletionService::Client.configure do |config| - # config.timeout = 10.0 - # config.rpcs.complete_query.timeout = 20.0 - # end - # - # # Apply the above configuration only to a new client. - # client = ::Google::Cloud::Retail::V2::CompletionService::Client.new do |config| - # config.timeout = 10.0 - # config.rpcs.complete_query.timeout = 20.0 - # end - # - # @!attribute [rw] endpoint - # A custom service endpoint, as a hostname or hostname:port. The default is - # nil, indicating to use the default endpoint in the current universe domain. - # @return [::String,nil] - # @!attribute [rw] credentials - # Credentials to send with calls. You may provide any of the following types: - # * (`Google::Auth::Credentials`) A googleauth credentials object - # (see the [googleauth docs](https://rubydoc.info/gems/googleauth/Google/Auth/Credentials)) - # * (`Signet::OAuth2::Client`) A signet oauth2 client object - # (see the [signet docs](https://rubydoc.info/gems/signet/Signet/OAuth2/Client)) - # * (`GRPC::Core::Channel`) a gRPC channel with included credentials - # * (`GRPC::Core::ChannelCredentials`) a gRPC credentails object - # * (`nil`) indicating no credentials - # - # @note Warning: Passing a `String` to a keyfile path or a `Hash` of credentials - # is deprecated. Providing an unvalidated credential configuration to - # Google APIs can compromise the security of your systems and data. - # - # @example - # - # # The recommended way to provide credentials is to use the `make_creds` method - # # on the appropriate credentials class for your environment. - # - # require "googleauth" - # - # credentials = ::Google::Auth::ServiceAccountCredentials.make_creds( - # json_key_io: ::File.open("/path/to/keyfile.json") - # ) - # - # client = ::Google::Cloud::Retail::V2::CompletionService::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 = "retail.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 CompletionService 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 `complete_query` - # @return [::Gapic::Config::Method] - # - attr_reader :complete_query - ## - # RPC-specific configuration for `import_completion_data` - # @return [::Gapic::Config::Method] - # - attr_reader :import_completion_data - - # @private - def initialize parent_rpcs = nil - complete_query_config = parent_rpcs.complete_query if parent_rpcs.respond_to? :complete_query - @complete_query = ::Gapic::Config::Method.new complete_query_config - import_completion_data_config = parent_rpcs.import_completion_data if parent_rpcs.respond_to? :import_completion_data - @import_completion_data = ::Gapic::Config::Method.new import_completion_data_config - - yield self if block_given? - end - end - end - end - end - end - end - end -end diff --git a/owl-bot-staging/google-cloud-retail-v2/lib/google/cloud/retail/v2/completion_service/credentials.rb b/owl-bot-staging/google-cloud-retail-v2/lib/google/cloud/retail/v2/completion_service/credentials.rb deleted file mode 100644 index fad74ea58827..000000000000 --- a/owl-bot-staging/google-cloud-retail-v2/lib/google/cloud/retail/v2/completion_service/credentials.rb +++ /dev/null @@ -1,51 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -require "googleauth" - -module Google - module Cloud - module Retail - module V2 - module CompletionService - # Credentials for the CompletionService API. - class Credentials < ::Google::Auth::Credentials - self.scope = [ - "https://www.googleapis.com/auth/cloud-platform" - ] - self.env_vars = [ - "RETAIL_CREDENTIALS", - "RETAIL_KEYFILE", - "GOOGLE_CLOUD_CREDENTIALS", - "GOOGLE_CLOUD_KEYFILE", - "GCLOUD_KEYFILE", - "RETAIL_CREDENTIALS_JSON", - "RETAIL_KEYFILE_JSON", - "GOOGLE_CLOUD_CREDENTIALS_JSON", - "GOOGLE_CLOUD_KEYFILE_JSON", - "GCLOUD_KEYFILE_JSON" - ] - self.paths = [ - "~/.config/google_cloud/application_default_credentials.json" - ] - end - end - end - end - end -end diff --git a/owl-bot-staging/google-cloud-retail-v2/lib/google/cloud/retail/v2/completion_service/operations.rb b/owl-bot-staging/google-cloud-retail-v2/lib/google/cloud/retail/v2/completion_service/operations.rb deleted file mode 100644 index b79837b617c2..000000000000 --- a/owl-bot-staging/google-cloud-retail-v2/lib/google/cloud/retail/v2/completion_service/operations.rb +++ /dev/null @@ -1,841 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -require "gapic/operation" -require "google/longrunning/operations_pb" - -module Google - module Cloud - module Retail - module V2 - module CompletionService - # Service that implements Longrunning Operations API. - class Operations - # @private - API_VERSION = "" - - # @private - DEFAULT_ENDPOINT_TEMPLATE = "retail.$UNIVERSE_DOMAIN$" - - # @private - attr_reader :operations_stub - - ## - # Configuration for the CompletionService 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 CompletionService 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::Retail::V2::VERSION - metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - header_params = {} - if request.name - header_params["name"] = request.name - end - - request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") - metadata[:"x-goog-request-params"] ||= request_params_header - - options.apply_defaults timeout: @config.rpcs.list_operations.timeout, - metadata: metadata, - retry_policy: @config.rpcs.list_operations.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @operations_stub.call_rpc :list_operations, request, options: options do |response, operation| - wrap_lro_operation = ->(op_response) { ::Gapic::Operation.new op_response, @operations_client } - response = ::Gapic::PagedEnumerable.new @operations_stub, :list_operations, request, response, operation, options, format_resource: wrap_lro_operation - yield response, operation if block_given? - throw :response, response - end - rescue ::GRPC::BadStatus => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Gets the latest state of a long-running operation. Clients can use this - # method to poll the operation result at intervals as recommended by the API - # service. - # - # @overload get_operation(request, options = nil) - # Pass arguments to `get_operation` via a request object, either of type - # {::Google::Longrunning::GetOperationRequest} or an equivalent Hash. - # - # @param request [::Google::Longrunning::GetOperationRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. - # - # @overload get_operation(name: nil) - # Pass arguments to `get_operation` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param name [::String] - # The name of the operation resource. - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Gapic::Operation] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Gapic::Operation] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/longrunning" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Longrunning::Operations::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Longrunning::GetOperationRequest.new - # - # # Call the get_operation method. - # result = client.get_operation request - # - # # The returned object is of type Gapic::Operation. You can use it to - # # check the status of an operation, cancel it, or wait for results. - # # Here is how to wait for a response. - # result.wait_until_done! timeout: 60 - # if result.response? - # p result.response - # else - # puts "No response received." - # end - # - def get_operation request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Longrunning::GetOperationRequest - - # Converts hash and nil to an options object - options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h - - # Customize the options with defaults - metadata = @config.rpcs.get_operation.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::Retail::V2::VERSION - metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - header_params = {} - if request.name - header_params["name"] = request.name - end - - request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") - metadata[:"x-goog-request-params"] ||= request_params_header - - options.apply_defaults timeout: @config.rpcs.get_operation.timeout, - metadata: metadata, - retry_policy: @config.rpcs.get_operation.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @operations_stub.call_rpc :get_operation, request, options: options do |response, operation| - response = ::Gapic::Operation.new response, @operations_client, options: options - yield response, operation if block_given? - throw :response, response - end - rescue ::GRPC::BadStatus => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Deletes a long-running operation. This method indicates that the client is - # no longer interested in the operation result. It does not cancel the - # operation. If the server doesn't support this method, it returns - # `google.rpc.Code.UNIMPLEMENTED`. - # - # @overload delete_operation(request, options = nil) - # Pass arguments to `delete_operation` via a request object, either of type - # {::Google::Longrunning::DeleteOperationRequest} or an equivalent Hash. - # - # @param request [::Google::Longrunning::DeleteOperationRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. - # - # @overload delete_operation(name: nil) - # Pass arguments to `delete_operation` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param name [::String] - # The name of the operation resource to be deleted. - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Google::Protobuf::Empty] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Google::Protobuf::Empty] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/longrunning" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Longrunning::Operations::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Longrunning::DeleteOperationRequest.new - # - # # Call the delete_operation method. - # result = client.delete_operation request - # - # # The returned object is of type Google::Protobuf::Empty. - # p result - # - def delete_operation request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Longrunning::DeleteOperationRequest - - # Converts hash and nil to an options object - options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h - - # Customize the options with defaults - metadata = @config.rpcs.delete_operation.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::Retail::V2::VERSION - metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - header_params = {} - if request.name - header_params["name"] = request.name - end - - request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") - metadata[:"x-goog-request-params"] ||= request_params_header - - options.apply_defaults timeout: @config.rpcs.delete_operation.timeout, - metadata: metadata, - retry_policy: @config.rpcs.delete_operation.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @operations_stub.call_rpc :delete_operation, request, options: options do |response, operation| - yield response, operation if block_given? - end - rescue ::GRPC::BadStatus => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Starts asynchronous cancellation on a long-running operation. The server - # makes a best effort to cancel the operation, but success is not - # guaranteed. If the server doesn't support this method, it returns - # `google.rpc.Code.UNIMPLEMENTED`. Clients can use - # Operations.GetOperation or - # other methods to check whether the cancellation succeeded or whether the - # operation completed despite cancellation. On successful cancellation, - # the operation is not deleted; instead, it becomes an operation with - # an {::Google::Longrunning::Operation#error Operation.error} value with a - # {::Google::Rpc::Status#code google.rpc.Status.code} of `1`, corresponding to - # `Code.CANCELLED`. - # - # @overload cancel_operation(request, options = nil) - # Pass arguments to `cancel_operation` via a request object, either of type - # {::Google::Longrunning::CancelOperationRequest} or an equivalent Hash. - # - # @param request [::Google::Longrunning::CancelOperationRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. - # - # @overload cancel_operation(name: nil) - # Pass arguments to `cancel_operation` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param name [::String] - # The name of the operation resource to be cancelled. - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Google::Protobuf::Empty] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Google::Protobuf::Empty] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/longrunning" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Longrunning::Operations::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Longrunning::CancelOperationRequest.new - # - # # Call the cancel_operation method. - # result = client.cancel_operation request - # - # # The returned object is of type Google::Protobuf::Empty. - # p result - # - def cancel_operation request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Longrunning::CancelOperationRequest - - # Converts hash and nil to an options object - options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h - - # Customize the options with defaults - metadata = @config.rpcs.cancel_operation.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::Retail::V2::VERSION - metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - header_params = {} - if request.name - header_params["name"] = request.name - end - - request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") - metadata[:"x-goog-request-params"] ||= request_params_header - - options.apply_defaults timeout: @config.rpcs.cancel_operation.timeout, - metadata: metadata, - retry_policy: @config.rpcs.cancel_operation.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @operations_stub.call_rpc :cancel_operation, request, options: options do |response, operation| - yield response, operation if block_given? - end - rescue ::GRPC::BadStatus => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Waits until the specified long-running operation is done or reaches at most - # a specified timeout, returning the latest state. If the operation is - # already done, the latest state is immediately returned. If the timeout - # specified is greater than the default HTTP/RPC timeout, the HTTP/RPC - # timeout is used. If the server does not support this method, it returns - # `google.rpc.Code.UNIMPLEMENTED`. - # Note that this method is on a best-effort basis. It may return the latest - # state before the specified timeout (including immediately), meaning even an - # immediate response is no guarantee that the operation is done. - # - # @overload wait_operation(request, options = nil) - # Pass arguments to `wait_operation` via a request object, either of type - # {::Google::Longrunning::WaitOperationRequest} or an equivalent Hash. - # - # @param request [::Google::Longrunning::WaitOperationRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. - # - # @overload wait_operation(name: nil, timeout: nil) - # Pass arguments to `wait_operation` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param name [::String] - # The name of the operation resource to wait on. - # @param timeout [::Google::Protobuf::Duration, ::Hash] - # The maximum duration to wait before timing out. If left blank, the wait - # will be at most the time permitted by the underlying HTTP/RPC protocol. - # If RPC context deadline is also specified, the shorter one will be used. - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Gapic::Operation] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Gapic::Operation] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/longrunning" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Longrunning::Operations::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Longrunning::WaitOperationRequest.new - # - # # Call the wait_operation method. - # result = client.wait_operation request - # - # # The returned object is of type Gapic::Operation. You can use it to - # # check the status of an operation, cancel it, or wait for results. - # # Here is how to wait for a response. - # result.wait_until_done! timeout: 60 - # if result.response? - # p result.response - # else - # puts "No response received." - # end - # - def wait_operation request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Longrunning::WaitOperationRequest - - # Converts hash and nil to an options object - options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h - - # Customize the options with defaults - metadata = @config.rpcs.wait_operation.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::Retail::V2::VERSION - metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - options.apply_defaults timeout: @config.rpcs.wait_operation.timeout, - metadata: metadata, - retry_policy: @config.rpcs.wait_operation.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @operations_stub.call_rpc :wait_operation, request, options: options do |response, operation| - response = ::Gapic::Operation.new response, @operations_client, options: options - yield response, operation if block_given? - throw :response, response - end - rescue ::GRPC::BadStatus => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Configuration class for the Operations API. - # - # This class represents the configuration for Operations, - # providing control over timeouts, retry behavior, logging, transport - # parameters, and other low-level controls. Certain parameters can also be - # applied individually to specific RPCs. See - # {::Google::Longrunning::Operations::Client::Configuration::Rpcs} - # for a list of RPCs that can be configured independently. - # - # Configuration can be applied globally to all clients, or to a single client - # on construction. - # - # @example - # - # # Modify the global config, setting the timeout for - # # list_operations to 20 seconds, - # # and all remaining timeouts to 10 seconds. - # ::Google::Longrunning::Operations::Client.configure do |config| - # config.timeout = 10.0 - # config.rpcs.list_operations.timeout = 20.0 - # end - # - # # Apply the above configuration only to a new client. - # client = ::Google::Longrunning::Operations::Client.new do |config| - # config.timeout = 10.0 - # config.rpcs.list_operations.timeout = 20.0 - # end - # - # @!attribute [rw] endpoint - # A custom service endpoint, as a hostname or hostname:port. The default is - # nil, indicating to use the default endpoint in the current universe domain. - # @return [::String,nil] - # @!attribute [rw] credentials - # Credentials to send with calls. You may provide any of the following types: - # * (`Google::Auth::Credentials`) A googleauth credentials object - # (see the [googleauth docs](https://rubydoc.info/gems/googleauth/Google/Auth/Credentials)) - # * (`Signet::OAuth2::Client`) A signet oauth2 client object - # (see the [signet docs](https://rubydoc.info/gems/signet/Signet/OAuth2/Client)) - # * (`GRPC::Core::Channel`) a gRPC channel with included credentials - # * (`GRPC::Core::ChannelCredentials`) a gRPC credentails object - # * (`nil`) indicating no credentials - # - # @note Warning: Passing a `String` to a keyfile path or a `Hash` of credentials - # is deprecated. Providing an unvalidated credential configuration to - # Google APIs can compromise the security of your systems and data. - # - # @example - # - # # The recommended way to provide credentials is to use the `make_creds` method - # # on the appropriate credentials class for your environment. - # - # require "googleauth" - # - # credentials = ::Google::Auth::ServiceAccountCredentials.make_creds( - # json_key_io: ::File.open("/path/to/keyfile.json") - # ) - # - # client = ::Google::Longrunning::Operations::Client.new do |config| - # config.credentials = credentials - # end - # - # @note Warning: If you accept a credential configuration (JSON file or Hash) from an - # external source for authentication to Google Cloud, you must validate it before - # providing it to a Google API client library. Providing an unvalidated credential - # configuration to Google APIs can compromise the security of your systems and data. - # For more information, refer to [Validate credential configurations from external - # sources](https://cloud.google.com/docs/authentication/external/externally-sourced-credentials). - # @return [::Object] - # @!attribute [rw] scope - # The OAuth scopes - # @return [::Array<::String>] - # @!attribute [rw] lib_name - # The library name as recorded in instrumentation and logging - # @return [::String] - # @!attribute [rw] lib_version - # The library version as recorded in instrumentation and logging - # @return [::String] - # @!attribute [rw] channel_args - # Extra parameters passed to the gRPC channel. Note: this is ignored if a - # `GRPC::Core::Channel` object is provided as the credential. - # @return [::Hash] - # @!attribute [rw] interceptors - # An array of interceptors that are run before calls are executed. - # @return [::Array<::GRPC::ClientInterceptor>] - # @!attribute [rw] timeout - # The call timeout in seconds. - # @return [::Numeric] - # @!attribute [rw] metadata - # Additional gRPC headers to be sent with the call. - # @return [::Hash{::Symbol=>::String}] - # @!attribute [rw] retry_policy - # The retry policy. The value is a hash with the following keys: - # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds. - # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds. - # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier. - # * `:retry_codes` (*type:* `Array`) - The error codes that should - # trigger a retry. - # @return [::Hash] - # @!attribute [rw] quota_project - # A separate project against which to charge quota. - # @return [::String] - # @!attribute [rw] universe_domain - # The universe domain within which to make requests. This determines the - # default endpoint URL. The default value of nil uses the environment - # universe (usually the default "googleapis.com" universe). - # @return [::String,nil] - # @!attribute [rw] logger - # A custom logger to use for request/response debug logging, or the value - # `:default` (the default) to construct a default logger, or `nil` to - # explicitly disable logging. - # @return [::Logger,:default,nil] - # - class Configuration - extend ::Gapic::Config - - # @private - # The endpoint specific to the default "googleapis.com" universe. Deprecated. - DEFAULT_ENDPOINT = "retail.googleapis.com" - - config_attr :endpoint, nil, ::String, nil - config_attr :credentials, nil do |value| - allowed = [::String, ::Hash, ::Proc, ::Symbol, ::Google::Auth::Credentials, ::Google::Auth::BaseClient, ::Signet::OAuth2::Client, nil] - allowed += [::GRPC::Core::Channel, ::GRPC::Core::ChannelCredentials] if defined? ::GRPC::Core::Channel - allowed.any? { |klass| klass === value } - end - config_attr :scope, nil, ::String, ::Array, nil - config_attr :lib_name, nil, ::String, nil - config_attr :lib_version, nil, ::String, nil - config_attr(:channel_args, { "grpc.service_config_disable_resolution" => 1 }, ::Hash, nil) - config_attr :interceptors, nil, ::Array, nil - config_attr :timeout, nil, ::Numeric, nil - config_attr :metadata, nil, ::Hash, nil - config_attr :retry_policy, nil, ::Hash, ::Proc, nil - config_attr :quota_project, nil, ::String, nil - config_attr :universe_domain, nil, ::String, nil - config_attr :logger, :default, ::Logger, nil, :default - - # @private - def initialize parent_config = nil - @parent_config = parent_config unless parent_config.nil? - - yield self if block_given? - end - - ## - # Configurations for individual RPCs - # @return [Rpcs] - # - def rpcs - @rpcs ||= begin - parent_rpcs = nil - parent_rpcs = @parent_config.rpcs if defined?(@parent_config) && @parent_config.respond_to?(:rpcs) - Rpcs.new parent_rpcs - end - end - - ## - # Configuration for the channel pool - # @return [::Gapic::ServiceStub::ChannelPool::Configuration] - # - def channel_pool - @channel_pool ||= ::Gapic::ServiceStub::ChannelPool::Configuration.new - end - - ## - # Configuration RPC class for the Operations API. - # - # Includes fields providing the configuration for each RPC in this service. - # Each configuration object is of type `Gapic::Config::Method` and includes - # the following configuration fields: - # - # * `timeout` (*type:* `Numeric`) - The call timeout in seconds - # * `metadata` (*type:* `Hash{Symbol=>String}`) - Additional gRPC headers - # * `retry_policy (*type:* `Hash`) - The retry policy. The policy fields - # include the following keys: - # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds. - # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds. - # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier. - # * `:retry_codes` (*type:* `Array`) - The error codes that should - # trigger a retry. - # - class Rpcs - ## - # RPC-specific configuration for `list_operations` - # @return [::Gapic::Config::Method] - # - attr_reader :list_operations - ## - # RPC-specific configuration for `get_operation` - # @return [::Gapic::Config::Method] - # - attr_reader :get_operation - ## - # RPC-specific configuration for `delete_operation` - # @return [::Gapic::Config::Method] - # - attr_reader :delete_operation - ## - # RPC-specific configuration for `cancel_operation` - # @return [::Gapic::Config::Method] - # - attr_reader :cancel_operation - ## - # RPC-specific configuration for `wait_operation` - # @return [::Gapic::Config::Method] - # - attr_reader :wait_operation - - # @private - def initialize parent_rpcs = nil - list_operations_config = parent_rpcs.list_operations if parent_rpcs.respond_to? :list_operations - @list_operations = ::Gapic::Config::Method.new list_operations_config - get_operation_config = parent_rpcs.get_operation if parent_rpcs.respond_to? :get_operation - @get_operation = ::Gapic::Config::Method.new get_operation_config - delete_operation_config = parent_rpcs.delete_operation if parent_rpcs.respond_to? :delete_operation - @delete_operation = ::Gapic::Config::Method.new delete_operation_config - cancel_operation_config = parent_rpcs.cancel_operation if parent_rpcs.respond_to? :cancel_operation - @cancel_operation = ::Gapic::Config::Method.new cancel_operation_config - wait_operation_config = parent_rpcs.wait_operation if parent_rpcs.respond_to? :wait_operation - @wait_operation = ::Gapic::Config::Method.new wait_operation_config - - yield self if block_given? - end - end - end - end - end - end - end - end -end diff --git a/owl-bot-staging/google-cloud-retail-v2/lib/google/cloud/retail/v2/completion_service/paths.rb b/owl-bot-staging/google-cloud-retail-v2/lib/google/cloud/retail/v2/completion_service/paths.rb deleted file mode 100644 index 600b86ed9a0d..000000000000 --- a/owl-bot-staging/google-cloud-retail-v2/lib/google/cloud/retail/v2/completion_service/paths.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! - - -module Google - module Cloud - module Retail - module V2 - module CompletionService - # Path helper methods for the CompletionService API. - module Paths - ## - # Create a fully-qualified Catalog resource string. - # - # The resource will be in the following format: - # - # `projects/{project}/locations/{location}/catalogs/{catalog}` - # - # @param project [String] - # @param location [String] - # @param catalog [String] - # - # @return [::String] - def catalog_path project:, location:, catalog: - raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" - raise ::ArgumentError, "location cannot contain /" if location.to_s.include? "/" - - "projects/#{project}/locations/#{location}/catalogs/#{catalog}" - end - - extend self - end - end - end - end - end -end diff --git a/owl-bot-staging/google-cloud-retail-v2/lib/google/cloud/retail/v2/completion_service/rest.rb b/owl-bot-staging/google-cloud-retail-v2/lib/google/cloud/retail/v2/completion_service/rest.rb deleted file mode 100644 index 1cf8247a53be..000000000000 --- a/owl-bot-staging/google-cloud-retail-v2/lib/google/cloud/retail/v2/completion_service/rest.rb +++ /dev/null @@ -1,56 +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/retail/v2/version" - -require "google/cloud/retail/v2/completion_service/credentials" -require "google/cloud/retail/v2/completion_service/paths" -require "google/cloud/retail/v2/completion_service/rest/operations" -require "google/cloud/retail/v2/completion_service/rest/client" - -module Google - module Cloud - module Retail - module V2 - ## - # Autocomplete service for retail. - # - # This feature is only available for users who have Retail Search enabled. - # Enable Retail Search on Cloud Console before using this feature. - # - # To load this service and instantiate a REST client: - # - # require "google/cloud/retail/v2/completion_service/rest" - # client = ::Google::Cloud::Retail::V2::CompletionService::Rest::Client.new - # - module CompletionService - # Client for the REST transport - module Rest - end - end - end - end - end -end - -helper_path = ::File.join __dir__, "rest", "helpers.rb" -require "google/cloud/retail/v2/completion_service/rest/helpers" if ::File.file? helper_path diff --git a/owl-bot-staging/google-cloud-retail-v2/lib/google/cloud/retail/v2/completion_service/rest/client.rb b/owl-bot-staging/google-cloud-retail-v2/lib/google/cloud/retail/v2/completion_service/rest/client.rb deleted file mode 100644 index cd346f670de0..000000000000 --- a/owl-bot-staging/google-cloud-retail-v2/lib/google/cloud/retail/v2/completion_service/rest/client.rb +++ /dev/null @@ -1,657 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -require "google/cloud/errors" -require "google/cloud/retail/v2/completion_service_pb" -require "google/cloud/retail/v2/completion_service/rest/service_stub" -require "google/cloud/location/rest" - -module Google - module Cloud - module Retail - module V2 - module CompletionService - module Rest - ## - # REST client for the CompletionService service. - # - # Autocomplete service for retail. - # - # This feature is only available for users who have Retail Search enabled. - # Enable Retail Search on Cloud Console before using this feature. - # - class Client - # @private - API_VERSION = "" - - # @private - DEFAULT_ENDPOINT_TEMPLATE = "retail.$UNIVERSE_DOMAIN$" - - include Paths - - # @private - attr_reader :completion_service_stub - - ## - # Configure the CompletionService Client class. - # - # See {::Google::Cloud::Retail::V2::CompletionService::Rest::Client::Configuration} - # for a description of the configuration fields. - # - # @example - # - # # Modify the configuration for all CompletionService clients - # ::Google::Cloud::Retail::V2::CompletionService::Rest::Client.configure do |config| - # config.timeout = 10.0 - # end - # - # @yield [config] Configure the Client client. - # @yieldparam config [Client::Configuration] - # - # @return [Client::Configuration] - # - def self.configure - @configure ||= begin - namespace = ["Google", "Cloud", "Retail", "V2"] - parent_config = while namespace.any? - parent_name = namespace.join "::" - parent_const = const_get parent_name - break parent_const.configure if parent_const.respond_to? :configure - namespace.pop - end - default_config = Client::Configuration.new parent_config - - default_config.timeout = 5.0 - default_config.retry_policy = { - initial_delay: 0.1, max_delay: 5.0, multiplier: 1.3, retry_codes: [14, 4] - } - - default_config - end - yield @configure if block_given? - @configure - end - - ## - # Configure the CompletionService Client instance. - # - # The configuration is set to the derived mode, meaning that values can be changed, - # but structural changes (adding new fields, etc.) are not allowed. Structural changes - # should be made on {Client.configure}. - # - # See {::Google::Cloud::Retail::V2::CompletionService::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 - @completion_service_stub.universe_domain - end - - ## - # Create a new CompletionService REST client object. - # - # @example - # - # # Create a client using the default configuration - # client = ::Google::Cloud::Retail::V2::CompletionService::Rest::Client.new - # - # # Create a client using a custom configuration - # client = ::Google::Cloud::Retail::V2::CompletionService::Rest::Client.new do |config| - # config.timeout = 10.0 - # end - # - # @yield [config] Configure the CompletionService client. - # @yieldparam config [Client::Configuration] - # - def initialize - # Create the configuration object - @config = Configuration.new Client.configure - - # Yield the configuration if needed - yield @config if block_given? - - # Create credentials - credentials = @config.credentials - # Use self-signed JWT if the endpoint is unchanged from default, - # but only if the default endpoint does not have a region prefix. - enable_self_signed_jwt = @config.endpoint.nil? || - (@config.endpoint == Configuration::DEFAULT_ENDPOINT && - !@config.endpoint.split(".").first.include?("-")) - credentials ||= Credentials.default scope: @config.scope, - enable_self_signed_jwt: enable_self_signed_jwt - if credentials.is_a?(::String) || credentials.is_a?(::Hash) - credentials = Credentials.new credentials, scope: @config.scope - end - - @quota_project_id = @config.quota_project - @quota_project_id ||= credentials.quota_project_id if credentials.respond_to? :quota_project_id - - @operations_client = ::Google::Cloud::Retail::V2::CompletionService::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 - - @completion_service_stub = ::Google::Cloud::Retail::V2::CompletionService::Rest::ServiceStub.new( - endpoint: @config.endpoint, - endpoint_template: DEFAULT_ENDPOINT_TEMPLATE, - universe_domain: @config.universe_domain, - credentials: credentials, - logger: @config.logger - ) - - @completion_service_stub.logger(stub: true)&.info do |entry| - entry.set_system_name - entry.set_service - entry.message = "Created client for #{entry.service}" - entry.set_credentials_fields credentials - entry.set "customEndpoint", @config.endpoint if @config.endpoint - entry.set "defaultTimeout", @config.timeout if @config.timeout - entry.set "quotaProject", @quota_project_id if @quota_project_id - end - - @location_client = Google::Cloud::Location::Locations::Rest::Client.new do |config| - config.credentials = credentials - config.quota_project = @quota_project_id - config.endpoint = @completion_service_stub.endpoint - config.universe_domain = @completion_service_stub.universe_domain - config.logger = @completion_service_stub.logger if config.respond_to? :logger= - end - end - - ## - # Get the associated client for long-running operations. - # - # @return [::Google::Cloud::Retail::V2::CompletionService::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 - @completion_service_stub.logger - end - - # Service calls - - ## - # Completes the specified prefix with keyword suggestions. - # - # This feature is only available for users who have Retail Search enabled. - # Enable Retail Search on Cloud Console before using this feature. - # - # @overload complete_query(request, options = nil) - # Pass arguments to `complete_query` via a request object, either of type - # {::Google::Cloud::Retail::V2::CompleteQueryRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Retail::V2::CompleteQueryRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @overload complete_query(catalog: nil, query: nil, visitor_id: nil, language_codes: nil, device_type: nil, dataset: nil, max_suggestions: nil, enable_attribute_suggestions: nil, entity: nil) - # Pass arguments to `complete_query` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param catalog [::String] - # Required. Catalog for which the completion is performed. - # - # Full resource name of catalog, such as - # `projects/*/locations/global/catalogs/default_catalog`. - # @param query [::String] - # Required. The query used to generate suggestions. - # - # The maximum number of allowed characters is 255. - # @param visitor_id [::String] - # Recommended field. A unique identifier for tracking visitors. For example, - # this could be implemented with an HTTP cookie, which should be able to - # uniquely identify a visitor on a single device. This unique identifier - # should not change if the visitor logs in or out of the website. - # - # The field must be a UTF-8 encoded string with a length limit of 128 - # characters. Otherwise, an INVALID_ARGUMENT error is returned. - # @param language_codes [::Array<::String>] - # Note that this field applies for `user-data` dataset only. For requests - # with `cloud-retail` dataset, setting this field has no effect. - # - # The language filters applied to the output suggestions. If set, it should - # contain the language of the query. If not set, suggestions are returned - # without considering language restrictions. This is the BCP-47 language - # code, such as "en-US" or "sr-Latn". For more information, see [Tags for - # Identifying Languages](https://tools.ietf.org/html/bcp47). The maximum - # number of language codes is 3. - # @param device_type [::String] - # The device type context for completion suggestions. We recommend that you - # leave this field empty. - # - # It can apply different suggestions on different device types, e.g. - # `DESKTOP`, `MOBILE`. If it is empty, the suggestions are across all device - # types. - # - # Supported formats: - # - # * `UNKNOWN_DEVICE_TYPE` - # - # * `DESKTOP` - # - # * `MOBILE` - # - # * A customized string starts with `OTHER_`, e.g. `OTHER_IPHONE`. - # @param dataset [::String] - # Determines which dataset to use for fetching completion. "user-data" will - # use the dataset imported through - # {::Google::Cloud::Retail::V2::CompletionService::Rest::Client#import_completion_data CompletionService.ImportCompletionData}. - # `cloud-retail` will use the dataset generated by Cloud Retail based on user - # events. If left empty, completions will be fetched from the `user-data` - # dataset. - # - # Current supported values: - # - # * user-data - # - # * cloud-retail: - # This option requires enabling auto-learning function first. See - # [guidelines](https://cloud.google.com/retail/docs/completion-overview#generated-completion-dataset). - # @param max_suggestions [::Integer] - # Completion max suggestions. If left unset or set to 0, then will fallback - # to the configured value - # {::Google::Cloud::Retail::V2::CompletionConfig#max_suggestions CompletionConfig.max_suggestions}. - # - # The maximum allowed max suggestions is 20. If it is set higher, it will be - # capped by 20. - # @param enable_attribute_suggestions [::Boolean] - # If true, attribute suggestions are enabled and provided in the response. - # - # This field is only available for the `cloud-retail` dataset. - # @param entity [::String] - # The entity for customers who run multiple entities, domains, sites, or - # regions, for example, `Google US`, `Google Ads`, `Waymo`, - # `google.com`, `youtube.com`, etc. - # If this is set, it must be an exact match with - # {::Google::Cloud::Retail::V2::UserEvent#entity UserEvent.entity} to get - # per-entity autocomplete results. This field will be applied to - # `completion_results` only. It has no effect on the `attribute_results`. - # Also, this entity should be limited to 256 characters, if too long, it will - # be truncated to 256 characters in both generation and serving time, and may - # lead to mis-match. To ensure it works, please set the entity with string - # within 256 characters. - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Cloud::Retail::V2::CompleteQueryResponse] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::Retail::V2::CompleteQueryResponse] - # - # @raise [::Google::Cloud::Error] if the REST call is aborted. - # - # @example Basic example - # require "google/cloud/retail/v2" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Retail::V2::CompletionService::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Retail::V2::CompleteQueryRequest.new - # - # # Call the complete_query method. - # result = client.complete_query request - # - # # The returned object is of type Google::Cloud::Retail::V2::CompleteQueryResponse. - # p result - # - def complete_query request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Retail::V2::CompleteQueryRequest - - # Converts hash 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.complete_query.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::Retail::V2::VERSION, - transports_version_send: [:rest] - - call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - options.apply_defaults timeout: @config.rpcs.complete_query.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.complete_query.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @completion_service_stub.complete_query 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 - - ## - # Bulk import of processed completion dataset. - # - # Request processing is asynchronous. Partial updating is not supported. - # - # The operation is successfully finished only after the imported suggestions - # are indexed successfully and ready for serving. The process takes hours. - # - # This feature is only available for users who have Retail Search enabled. - # Enable Retail Search on Cloud Console before using this feature. - # - # @overload import_completion_data(request, options = nil) - # Pass arguments to `import_completion_data` via a request object, either of type - # {::Google::Cloud::Retail::V2::ImportCompletionDataRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Retail::V2::ImportCompletionDataRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @overload import_completion_data(parent: nil, input_config: nil, notification_pubsub_topic: nil) - # Pass arguments to `import_completion_data` via keyword arguments. Note that at - # least one keyword argument is 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 catalog which the suggestions dataset belongs to. - # - # Format: `projects/1234/locations/global/catalogs/default_catalog`. - # @param input_config [::Google::Cloud::Retail::V2::CompletionDataInputConfig, ::Hash] - # Required. The desired input location of the data. - # @param notification_pubsub_topic [::String] - # Pub/Sub topic for receiving notification. If this field is set, - # when the import is finished, a notification is sent to - # specified Pub/Sub topic. The message data is JSON string of a - # {::Google::Longrunning::Operation Operation}. - # Format of the Pub/Sub topic is `projects/{project}/topics/{topic}`. - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Gapic::Operation] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Gapic::Operation] - # - # @raise [::Google::Cloud::Error] if the REST call is aborted. - # - # @example Basic example - # require "google/cloud/retail/v2" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Retail::V2::CompletionService::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Retail::V2::ImportCompletionDataRequest.new - # - # # Call the import_completion_data method. - # result = client.import_completion_data 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 import_completion_data request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Retail::V2::ImportCompletionDataRequest - - # Converts hash 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.import_completion_data.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::Retail::V2::VERSION, - transports_version_send: [:rest] - - call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - options.apply_defaults timeout: @config.rpcs.import_completion_data.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.import_completion_data.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @completion_service_stub.import_completion_data 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 - - ## - # Configuration class for the CompletionService REST API. - # - # This class represents the configuration for CompletionService REST, - # providing control over timeouts, retry behavior, logging, transport - # parameters, and other low-level controls. Certain parameters can also be - # applied individually to specific RPCs. See - # {::Google::Cloud::Retail::V2::CompletionService::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 - # # complete_query to 20 seconds, - # # and all remaining timeouts to 10 seconds. - # ::Google::Cloud::Retail::V2::CompletionService::Rest::Client.configure do |config| - # config.timeout = 10.0 - # config.rpcs.complete_query.timeout = 20.0 - # end - # - # # Apply the above configuration only to a new client. - # client = ::Google::Cloud::Retail::V2::CompletionService::Rest::Client.new do |config| - # config.timeout = 10.0 - # config.rpcs.complete_query.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 = "retail.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 CompletionService 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 `complete_query` - # @return [::Gapic::Config::Method] - # - attr_reader :complete_query - ## - # RPC-specific configuration for `import_completion_data` - # @return [::Gapic::Config::Method] - # - attr_reader :import_completion_data - - # @private - def initialize parent_rpcs = nil - complete_query_config = parent_rpcs.complete_query if parent_rpcs.respond_to? :complete_query - @complete_query = ::Gapic::Config::Method.new complete_query_config - import_completion_data_config = parent_rpcs.import_completion_data if parent_rpcs.respond_to? :import_completion_data - @import_completion_data = ::Gapic::Config::Method.new import_completion_data_config - - yield self if block_given? - end - end - end - end - end - end - end - end - end -end diff --git a/owl-bot-staging/google-cloud-retail-v2/lib/google/cloud/retail/v2/completion_service/rest/operations.rb b/owl-bot-staging/google-cloud-retail-v2/lib/google/cloud/retail/v2/completion_service/rest/operations.rb deleted file mode 100644 index 09106f92ce9f..000000000000 --- a/owl-bot-staging/google-cloud-retail-v2/lib/google/cloud/retail/v2/completion_service/rest/operations.rb +++ /dev/null @@ -1,960 +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 Cloud - module Retail - module V2 - module CompletionService - module Rest - # Service that implements Longrunning Operations API. - class Operations - # @private - API_VERSION = "" - - # @private - DEFAULT_ENDPOINT_TEMPLATE = "retail.$UNIVERSE_DOMAIN$" - - # @private - attr_reader :operations_stub - - ## - # Configuration for the CompletionService 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 CompletionService 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::Retail::V2::VERSION, - transports_version_send: [:rest] - - call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - options.apply_defaults timeout: @config.rpcs.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::Retail::V2::VERSION, - transports_version_send: [:rest] - - call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - options.apply_defaults timeout: @config.rpcs.get_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::Retail::V2::VERSION, - transports_version_send: [:rest] - - call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - options.apply_defaults timeout: @config.rpcs.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::Retail::V2::VERSION, - transports_version_send: [:rest] - - call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - options.apply_defaults timeout: @config.rpcs.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 = "retail.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: "/v2/{name}/operations", - matches: [ - ["name", %r{^projects/[^/]+/locations/[^/]+/?$}, false] - ] - ) - .with_bindings( - uri_method: :get, - uri_template: "/v2/{name}/operations", - matches: [ - ["name", %r{^projects/[^/]+/locations/[^/]+/catalogs/[^/]+/?$}, false] - ] - ) - .with_bindings( - uri_method: :get, - uri_template: "/v2/{name}/operations", - matches: [ - ["name", %r{^projects/[^/]+/?$}, 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: "/v2/{name}", - matches: [ - ["name", %r{^projects/[^/]+/locations/[^/]+/operations/[^/]+/?$}, false] - ] - ) - .with_bindings( - uri_method: :get, - uri_template: "/v2/{name}", - matches: [ - ["name", %r{^projects/[^/]+/locations/[^/]+/catalogs/[^/]+/branches/[^/]+/operations/[^/]+/?$}, false] - ] - ) - .with_bindings( - uri_method: :get, - uri_template: "/v2/{name}", - matches: [ - ["name", %r{^projects/[^/]+/locations/[^/]+/catalogs/[^/]+/operations/[^/]+/?$}, false] - ] - ) - .with_bindings( - uri_method: :get, - uri_template: "/v2/{name}", - matches: [ - ["name", %r{^projects/[^/]+/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 -end diff --git a/owl-bot-staging/google-cloud-retail-v2/lib/google/cloud/retail/v2/completion_service/rest/service_stub.rb b/owl-bot-staging/google-cloud-retail-v2/lib/google/cloud/retail/v2/completion_service/rest/service_stub.rb deleted file mode 100644 index 31957d90f097..000000000000 --- a/owl-bot-staging/google-cloud-retail-v2/lib/google/cloud/retail/v2/completion_service/rest/service_stub.rb +++ /dev/null @@ -1,204 +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/retail/v2/completion_service_pb" - -module Google - module Cloud - module Retail - module V2 - module CompletionService - module Rest - ## - # REST service stub for the CompletionService 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 complete_query REST call - # - # @param request_pb [::Google::Cloud::Retail::V2::CompleteQueryRequest] - # A request object representing the call parameters. Required. - # @param options [::Gapic::CallOptions] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Cloud::Retail::V2::CompleteQueryResponse] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::Retail::V2::CompleteQueryResponse] - # A result object deserialized from the server's reply - def complete_query request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_complete_query_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: "complete_query", - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Cloud::Retail::V2::CompleteQueryResponse.decode_json response.body, ignore_unknown_fields: true - catch :response do - yield result, operation if block_given? - result - end - end - - ## - # Baseline implementation for the import_completion_data REST call - # - # @param request_pb [::Google::Cloud::Retail::V2::ImportCompletionDataRequest] - # 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 import_completion_data request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_import_completion_data_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: "import_completion_data", - 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 - - ## - # @private - # - # GRPC transcoding helper method for the complete_query REST call - # - # @param request_pb [::Google::Cloud::Retail::V2::CompleteQueryRequest] - # A request object representing the call parameters. Required. - # @return [Array(String, [String, nil], Hash{String => String})] - # Uri, Body, Query string parameters - def self.transcode_complete_query_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :get, - uri_template: "/v2/{catalog}:completeQuery", - matches: [ - ["catalog", %r{^projects/[^/]+/locations/[^/]+/catalogs/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the import_completion_data REST call - # - # @param request_pb [::Google::Cloud::Retail::V2::ImportCompletionDataRequest] - # A request object representing the call parameters. Required. - # @return [Array(String, [String, nil], Hash{String => String})] - # Uri, Body, Query string parameters - def self.transcode_import_completion_data_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :post, - uri_template: "/v2/{parent}/completionData:import", - body: "*", - matches: [ - ["parent", %r{^projects/[^/]+/locations/[^/]+/catalogs/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - end - end - end - end - end - end -end diff --git a/owl-bot-staging/google-cloud-retail-v2/lib/google/cloud/retail/v2/completion_service_pb.rb b/owl-bot-staging/google-cloud-retail-v2/lib/google/cloud/retail/v2/completion_service_pb.rb deleted file mode 100644 index 6f2a2a1fdade..000000000000 --- a/owl-bot-staging/google-cloud-retail-v2/lib/google/cloud/retail/v2/completion_service_pb.rb +++ /dev/null @@ -1,33 +0,0 @@ -# frozen_string_literal: true -# Generated by the protocol buffer compiler. DO NOT EDIT! -# source: google/cloud/retail/v2/completion_service.proto - -require 'google/protobuf' - -require 'google/api/annotations_pb' -require 'google/api/client_pb' -require 'google/api/field_behavior_pb' -require 'google/api/resource_pb' -require 'google/cloud/retail/v2/common_pb' -require 'google/cloud/retail/v2/import_config_pb' -require 'google/longrunning/operations_pb' - - -descriptor_data = "\n/google/cloud/retail/v2/completion_service.proto\x12\x16google.cloud.retail.v2\x1a\x1cgoogle/api/annotations.proto\x1a\x17google/api/client.proto\x1a\x1fgoogle/api/field_behavior.proto\x1a\x19google/api/resource.proto\x1a#google/cloud/retail/v2/common.proto\x1a*google/cloud/retail/v2/import_config.proto\x1a#google/longrunning/operations.proto\"\x83\x02\n\x14\x43ompleteQueryRequest\x12\x36\n\x07\x63\x61talog\x18\x01 \x01(\tB%\xe0\x41\x02\xfa\x41\x1f\n\x1dretail.googleapis.com/Catalog\x12\x12\n\x05query\x18\x02 \x01(\tB\x03\xe0\x41\x02\x12\x12\n\nvisitor_id\x18\x07 \x01(\t\x12\x16\n\x0elanguage_codes\x18\x03 \x03(\t\x12\x13\n\x0b\x64\x65vice_type\x18\x04 \x01(\t\x12\x0f\n\x07\x64\x61taset\x18\x06 \x01(\t\x12\x17\n\x0fmax_suggestions\x18\x05 \x01(\x05\x12$\n\x1c\x65nable_attribute_suggestions\x18\t \x01(\x08\x12\x0e\n\x06\x65ntity\x18\n \x01(\t\"\x8d\x06\n\x15\x43ompleteQueryResponse\x12Z\n\x12\x63ompletion_results\x18\x01 \x03(\x0b\x32>.google.cloud.retail.v2.CompleteQueryResponse.CompletionResult\x12\x19\n\x11\x61ttribution_token\x18\x02 \x01(\t\x12\x63\n\x15recent_search_results\x18\x03 \x03(\x0b\x32@.google.cloud.retail.v2.CompleteQueryResponse.RecentSearchResultB\x02\x18\x01\x12^\n\x11\x61ttribute_results\x18\x04 \x03(\x0b\x32\x43.google.cloud.retail.v2.CompleteQueryResponse.AttributeResultsEntry\x1a\xe6\x01\n\x10\x43ompletionResult\x12\x12\n\nsuggestion\x18\x01 \x01(\t\x12\x62\n\nattributes\x18\x02 \x03(\x0b\x32N.google.cloud.retail.v2.CompleteQueryResponse.CompletionResult.AttributesEntry\x1aZ\n\x0f\x41ttributesEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12\x36\n\x05value\x18\x02 \x01(\x0b\x32\'.google.cloud.retail.v2.CustomAttribute:\x02\x38\x01\x1a/\n\x12RecentSearchResult\x12\x15\n\rrecent_search\x18\x01 \x01(\t:\x02\x18\x01\x1a&\n\x0f\x41ttributeResult\x12\x13\n\x0bsuggestions\x18\x01 \x03(\t\x1av\n\x15\x41ttributeResultsEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12L\n\x05value\x18\x02 \x01(\x0b\x32=.google.cloud.retail.v2.CompleteQueryResponse.AttributeResult:\x02\x38\x01\x32\xb2\x04\n\x11\x43ompletionService\x12\xb3\x01\n\rCompleteQuery\x12,.google.cloud.retail.v2.CompleteQueryRequest\x1a-.google.cloud.retail.v2.CompleteQueryResponse\"E\x82\xd3\xe4\x93\x02?\x12=/v2/{catalog=projects/*/locations/*/catalogs/*}:completeQuery\x12\x9b\x02\n\x14ImportCompletionData\x12\x33.google.cloud.retail.v2.ImportCompletionDataRequest\x1a\x1d.google.longrunning.Operation\"\xae\x01\xca\x41\\\n3google.cloud.retail.v2.ImportCompletionDataResponse\x12%google.cloud.retail.v2.ImportMetadata\x82\xd3\xe4\x93\x02I\"D/v2/{parent=projects/*/locations/*/catalogs/*}/completionData:import:\x01*\x1aI\xca\x41\x15retail.googleapis.com\xd2\x41.https://www.googleapis.com/auth/cloud-platformB\xc1\x01\n\x1a\x63om.google.cloud.retail.v2B\x16\x43ompletionServiceProtoP\x01Z2cloud.google.com/go/retail/apiv2/retailpb;retailpb\xa2\x02\x06RETAIL\xaa\x02\x16Google.Cloud.Retail.V2\xca\x02\x16Google\\Cloud\\Retail\\V2\xea\x02\x19Google::Cloud::Retail::V2b\x06proto3" - -pool = ::Google::Protobuf::DescriptorPool.generated_pool -pool.add_serialized_file(descriptor_data) - -module Google - module Cloud - module Retail - module V2 - CompleteQueryRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.retail.v2.CompleteQueryRequest").msgclass - CompleteQueryResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.retail.v2.CompleteQueryResponse").msgclass - CompleteQueryResponse::CompletionResult = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.retail.v2.CompleteQueryResponse.CompletionResult").msgclass - CompleteQueryResponse::RecentSearchResult = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.retail.v2.CompleteQueryResponse.RecentSearchResult").msgclass - CompleteQueryResponse::AttributeResult = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.retail.v2.CompleteQueryResponse.AttributeResult").msgclass - end - end - end -end diff --git a/owl-bot-staging/google-cloud-retail-v2/lib/google/cloud/retail/v2/completion_service_services_pb.rb b/owl-bot-staging/google-cloud-retail-v2/lib/google/cloud/retail/v2/completion_service_services_pb.rb deleted file mode 100644 index 64e7fdaa4af5..000000000000 --- a/owl-bot-staging/google-cloud-retail-v2/lib/google/cloud/retail/v2/completion_service_services_pb.rb +++ /dev/null @@ -1,61 +0,0 @@ -# Generated by the protocol buffer compiler. DO NOT EDIT! -# Source: google/cloud/retail/v2/completion_service.proto for package 'Google.Cloud.Retail.V2' -# Original file comments: -# 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 -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. -# - -require 'grpc' -require 'google/cloud/retail/v2/completion_service_pb' - -module Google - module Cloud - module Retail - module V2 - module CompletionService - # Autocomplete service for retail. - # - # This feature is only available for users who have Retail Search enabled. - # Enable Retail Search on Cloud Console before using this feature. - class Service - - include ::GRPC::GenericService - - self.marshal_class_method = :encode - self.unmarshal_class_method = :decode - self.service_name = 'google.cloud.retail.v2.CompletionService' - - # Completes the specified prefix with keyword suggestions. - # - # This feature is only available for users who have Retail Search enabled. - # Enable Retail Search on Cloud Console before using this feature. - rpc :CompleteQuery, ::Google::Cloud::Retail::V2::CompleteQueryRequest, ::Google::Cloud::Retail::V2::CompleteQueryResponse - # Bulk import of processed completion dataset. - # - # Request processing is asynchronous. Partial updating is not supported. - # - # The operation is successfully finished only after the imported suggestions - # are indexed successfully and ready for serving. The process takes hours. - # - # This feature is only available for users who have Retail Search enabled. - # Enable Retail Search on Cloud Console before using this feature. - rpc :ImportCompletionData, ::Google::Cloud::Retail::V2::ImportCompletionDataRequest, ::Google::Longrunning::Operation - end - - Stub = Service.rpc_stub_class - end - end - end - end -end diff --git a/owl-bot-staging/google-cloud-retail-v2/lib/google/cloud/retail/v2/control_pb.rb b/owl-bot-staging/google-cloud-retail-v2/lib/google/cloud/retail/v2/control_pb.rb deleted file mode 100644 index 6b4f341f7d2a..000000000000 --- a/owl-bot-staging/google-cloud-retail-v2/lib/google/cloud/retail/v2/control_pb.rb +++ /dev/null @@ -1,25 +0,0 @@ -# frozen_string_literal: true -# Generated by the protocol buffer compiler. DO NOT EDIT! -# source: google/cloud/retail/v2/control.proto - -require 'google/protobuf' - -require 'google/api/field_behavior_pb' -require 'google/api/resource_pb' -require 'google/cloud/retail/v2/common_pb' - - -descriptor_data = "\n$google/cloud/retail/v2/control.proto\x12\x16google.cloud.retail.v2\x1a\x1fgoogle/api/field_behavior.proto\x1a\x19google/api/resource.proto\x1a#google/cloud/retail/v2/common.proto\"\xa6\x03\n\x07\x43ontrol\x12,\n\x04rule\x18\x04 \x01(\x0b\x32\x1c.google.cloud.retail.v2.RuleH\x00\x12\x11\n\x04name\x18\x01 \x01(\tB\x03\xe0\x41\x05\x12\x19\n\x0c\x64isplay_name\x18\x02 \x01(\tB\x03\xe0\x41\x02\x12*\n\x1d\x61ssociated_serving_config_ids\x18\x05 \x03(\tB\x03\xe0\x41\x03\x12\x44\n\x0esolution_types\x18\x06 \x03(\x0e\x32$.google.cloud.retail.v2.SolutionTypeB\x06\xe0\x41\x02\xe0\x41\x05\x12O\n\x18search_solution_use_case\x18\x07 \x03(\x0e\x32-.google.cloud.retail.v2.SearchSolutionUseCase:q\xea\x41n\n\x1dretail.googleapis.com/Control\x12Mprojects/{project}/locations/{location}/catalogs/{catalog}/controls/{control}B\t\n\x07\x63ontrolB\xb7\x01\n\x1a\x63om.google.cloud.retail.v2B\x0c\x43ontrolProtoP\x01Z2cloud.google.com/go/retail/apiv2/retailpb;retailpb\xa2\x02\x06RETAIL\xaa\x02\x16Google.Cloud.Retail.V2\xca\x02\x16Google\\Cloud\\Retail\\V2\xea\x02\x19Google::Cloud::Retail::V2b\x06proto3" - -pool = ::Google::Protobuf::DescriptorPool.generated_pool -pool.add_serialized_file(descriptor_data) - -module Google - module Cloud - module Retail - module V2 - Control = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.retail.v2.Control").msgclass - end - end - end -end diff --git a/owl-bot-staging/google-cloud-retail-v2/lib/google/cloud/retail/v2/control_service.rb b/owl-bot-staging/google-cloud-retail-v2/lib/google/cloud/retail/v2/control_service.rb deleted file mode 100644 index e93086f0a231..000000000000 --- a/owl-bot-staging/google-cloud-retail-v2/lib/google/cloud/retail/v2/control_service.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/retail/v2/version" - -require "google/cloud/retail/v2/control_service/credentials" -require "google/cloud/retail/v2/control_service/paths" -require "google/cloud/retail/v2/control_service/client" -require "google/cloud/retail/v2/control_service/rest" - -module Google - module Cloud - module Retail - module V2 - ## - # Service for modifying Control. - # - # @example Load this service and instantiate a gRPC client - # - # require "google/cloud/retail/v2/control_service" - # client = ::Google::Cloud::Retail::V2::ControlService::Client.new - # - # @example Load this service and instantiate a REST client - # - # require "google/cloud/retail/v2/control_service/rest" - # client = ::Google::Cloud::Retail::V2::ControlService::Rest::Client.new - # - module ControlService - end - end - end - end -end - -helper_path = ::File.join __dir__, "control_service", "helpers.rb" -require "google/cloud/retail/v2/control_service/helpers" if ::File.file? helper_path diff --git a/owl-bot-staging/google-cloud-retail-v2/lib/google/cloud/retail/v2/control_service/client.rb b/owl-bot-staging/google-cloud-retail-v2/lib/google/cloud/retail/v2/control_service/client.rb deleted file mode 100644 index 718eaa29f3e1..000000000000 --- a/owl-bot-staging/google-cloud-retail-v2/lib/google/cloud/retail/v2/control_service/client.rb +++ /dev/null @@ -1,909 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -require "google/cloud/errors" -require "google/cloud/retail/v2/control_service_pb" -require "google/cloud/location" - -module Google - module Cloud - module Retail - module V2 - module ControlService - ## - # Client for the ControlService service. - # - # Service for modifying Control. - # - class Client - # @private - API_VERSION = "" - - # @private - DEFAULT_ENDPOINT_TEMPLATE = "retail.$UNIVERSE_DOMAIN$" - - include Paths - - # @private - attr_reader :control_service_stub - - ## - # Configure the ControlService Client class. - # - # See {::Google::Cloud::Retail::V2::ControlService::Client::Configuration} - # for a description of the configuration fields. - # - # @example - # - # # Modify the configuration for all ControlService clients - # ::Google::Cloud::Retail::V2::ControlService::Client.configure do |config| - # config.timeout = 10.0 - # end - # - # @yield [config] Configure the Client client. - # @yieldparam config [Client::Configuration] - # - # @return [Client::Configuration] - # - def self.configure - @configure ||= begin - namespace = ["Google", "Cloud", "Retail", "V2"] - parent_config = while namespace.any? - parent_name = namespace.join "::" - parent_const = const_get parent_name - break parent_const.configure if parent_const.respond_to? :configure - namespace.pop - end - default_config = Client::Configuration.new parent_config - - default_config - end - yield @configure if block_given? - @configure - end - - ## - # Configure the ControlService Client instance. - # - # The configuration is set to the derived mode, meaning that values can be changed, - # but structural changes (adding new fields, etc.) are not allowed. Structural changes - # should be made on {Client.configure}. - # - # See {::Google::Cloud::Retail::V2::ControlService::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 - @control_service_stub.universe_domain - end - - ## - # Create a new ControlService client object. - # - # @example - # - # # Create a client using the default configuration - # client = ::Google::Cloud::Retail::V2::ControlService::Client.new - # - # # Create a client using a custom configuration - # client = ::Google::Cloud::Retail::V2::ControlService::Client.new do |config| - # config.timeout = 10.0 - # end - # - # @yield [config] Configure the ControlService client. - # @yieldparam config [Client::Configuration] - # - def initialize - # These require statements are intentionally placed here to initialize - # the gRPC module only when it's required. - # See https://github.com/googleapis/toolkit/issues/446 - require "gapic/grpc" - require "google/cloud/retail/v2/control_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 - - @control_service_stub = ::Gapic::ServiceStub.new( - ::Google::Cloud::Retail::V2::ControlService::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 - ) - - @control_service_stub.stub_logger&.info do |entry| - entry.set_system_name - entry.set_service - entry.message = "Created client for #{entry.service}" - entry.set_credentials_fields credentials - entry.set "customEndpoint", @config.endpoint if @config.endpoint - entry.set "defaultTimeout", @config.timeout if @config.timeout - entry.set "quotaProject", @quota_project_id if @quota_project_id - end - - @location_client = Google::Cloud::Location::Locations::Client.new do |config| - config.credentials = credentials - config.quota_project = @quota_project_id - config.endpoint = @control_service_stub.endpoint - config.universe_domain = @control_service_stub.universe_domain - config.logger = @control_service_stub.logger if config.respond_to? :logger= - end - end - - ## - # Get the associated client for mix-in of the Locations. - # - # @return [Google::Cloud::Location::Locations::Client] - # - attr_reader :location_client - - ## - # The logger used for request/response debug logging. - # - # @return [Logger] - # - def logger - @control_service_stub.logger - end - - # Service calls - - ## - # Creates a Control. - # - # If the {::Google::Cloud::Retail::V2::Control Control} to create already exists, - # an ALREADY_EXISTS error is returned. - # - # @overload create_control(request, options = nil) - # Pass arguments to `create_control` via a request object, either of type - # {::Google::Cloud::Retail::V2::CreateControlRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Retail::V2::CreateControlRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_control(parent: nil, control: nil, control_id: nil) - # Pass arguments to `create_control` via keyword arguments. Note that at - # least one keyword argument is 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. Full resource name of parent catalog. Format: - # `projects/{project_number}/locations/{location_id}/catalogs/{catalog_id}` - # @param control [::Google::Cloud::Retail::V2::Control, ::Hash] - # Required. The Control to create. - # @param control_id [::String] - # Required. The ID to use for the Control, which will become the final - # component of the Control's resource name. - # - # This value should be 4-63 characters, and valid characters - # are /[a-z][0-9]-_/. - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Google::Cloud::Retail::V2::Control] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Google::Cloud::Retail::V2::Control] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/cloud/retail/v2" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Retail::V2::ControlService::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Retail::V2::CreateControlRequest.new - # - # # Call the create_control method. - # result = client.create_control request - # - # # The returned object is of type Google::Cloud::Retail::V2::Control. - # p result - # - def create_control request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Retail::V2::CreateControlRequest - - # Converts hash 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_control.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::Retail::V2::VERSION - metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - header_params = {} - if request.parent - 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_control.timeout, - metadata: metadata, - retry_policy: @config.rpcs.create_control.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @control_service_stub.call_rpc :create_control, request, options: options do |response, operation| - yield response, operation if block_given? - end - rescue ::GRPC::BadStatus => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Deletes a Control. - # - # If the {::Google::Cloud::Retail::V2::Control Control} to delete does not exist, - # a NOT_FOUND error is returned. - # - # @overload delete_control(request, options = nil) - # Pass arguments to `delete_control` via a request object, either of type - # {::Google::Cloud::Retail::V2::DeleteControlRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Retail::V2::DeleteControlRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_control(name: nil) - # Pass arguments to `delete_control` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param name [::String] - # Required. The resource name of the Control to delete. Format: - # `projects/{project_number}/locations/{location_id}/catalogs/{catalog_id}/controls/{control_id}` - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Google::Protobuf::Empty] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Google::Protobuf::Empty] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/cloud/retail/v2" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Retail::V2::ControlService::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Retail::V2::DeleteControlRequest.new - # - # # Call the delete_control method. - # result = client.delete_control request - # - # # The returned object is of type Google::Protobuf::Empty. - # p result - # - def delete_control request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Retail::V2::DeleteControlRequest - - # Converts hash 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_control.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::Retail::V2::VERSION - metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - header_params = {} - if request.name - header_params["name"] = request.name - end - - request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") - metadata[:"x-goog-request-params"] ||= request_params_header - - options.apply_defaults timeout: @config.rpcs.delete_control.timeout, - metadata: metadata, - retry_policy: @config.rpcs.delete_control.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @control_service_stub.call_rpc :delete_control, 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 Control. - # - # {::Google::Cloud::Retail::V2::Control Control} cannot be set to a different - # oneof field, if so an INVALID_ARGUMENT is returned. If the - # {::Google::Cloud::Retail::V2::Control Control} to update does not exist, a - # NOT_FOUND error is returned. - # - # @overload update_control(request, options = nil) - # Pass arguments to `update_control` via a request object, either of type - # {::Google::Cloud::Retail::V2::UpdateControlRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Retail::V2::UpdateControlRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_control(control: nil, update_mask: nil) - # Pass arguments to `update_control` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param control [::Google::Cloud::Retail::V2::Control, ::Hash] - # Required. The Control to update. - # @param update_mask [::Google::Protobuf::FieldMask, ::Hash] - # Indicates which fields in the provided - # {::Google::Cloud::Retail::V2::Control Control} to update. The following are NOT - # supported: - # - # * {::Google::Cloud::Retail::V2::Control#name Control.name} - # - # If not set or empty, all supported fields are updated. - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Google::Cloud::Retail::V2::Control] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Google::Cloud::Retail::V2::Control] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/cloud/retail/v2" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Retail::V2::ControlService::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Retail::V2::UpdateControlRequest.new - # - # # Call the update_control method. - # result = client.update_control request - # - # # The returned object is of type Google::Cloud::Retail::V2::Control. - # p result - # - def update_control request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Retail::V2::UpdateControlRequest - - # Converts hash 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_control.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::Retail::V2::VERSION - metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - header_params = {} - if request.control&.name - header_params["control.name"] = request.control.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_control.timeout, - metadata: metadata, - retry_policy: @config.rpcs.update_control.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @control_service_stub.call_rpc :update_control, request, options: options do |response, operation| - yield response, operation if block_given? - end - rescue ::GRPC::BadStatus => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Gets a Control. - # - # @overload get_control(request, options = nil) - # Pass arguments to `get_control` via a request object, either of type - # {::Google::Cloud::Retail::V2::GetControlRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Retail::V2::GetControlRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_control(name: nil) - # Pass arguments to `get_control` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param name [::String] - # Required. The resource name of the Control to get. Format: - # `projects/{project_number}/locations/{location_id}/catalogs/{catalog_id}/controls/{control_id}` - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Google::Cloud::Retail::V2::Control] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Google::Cloud::Retail::V2::Control] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/cloud/retail/v2" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Retail::V2::ControlService::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Retail::V2::GetControlRequest.new - # - # # Call the get_control method. - # result = client.get_control request - # - # # The returned object is of type Google::Cloud::Retail::V2::Control. - # p result - # - def get_control request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Retail::V2::GetControlRequest - - # Converts hash 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_control.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::Retail::V2::VERSION - metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - header_params = {} - if request.name - header_params["name"] = request.name - end - - request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") - metadata[:"x-goog-request-params"] ||= request_params_header - - options.apply_defaults timeout: @config.rpcs.get_control.timeout, - metadata: metadata, - retry_policy: @config.rpcs.get_control.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @control_service_stub.call_rpc :get_control, request, options: options do |response, operation| - yield response, operation if block_given? - end - rescue ::GRPC::BadStatus => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Lists all Controls by their parent - # {::Google::Cloud::Retail::V2::Catalog Catalog}. - # - # @overload list_controls(request, options = nil) - # Pass arguments to `list_controls` via a request object, either of type - # {::Google::Cloud::Retail::V2::ListControlsRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Retail::V2::ListControlsRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_controls(parent: nil, page_size: nil, page_token: nil, filter: nil) - # Pass arguments to `list_controls` via keyword arguments. Note that at - # least one keyword argument is 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 catalog resource name. Format: - # `projects/{project_number}/locations/{location_id}/catalogs/{catalog_id}` - # @param page_size [::Integer] - # Optional. Maximum number of results to return. If unspecified, defaults - # to 50. Max allowed value is 1000. - # @param page_token [::String] - # Optional. A page token, received from a previous `ListControls` call. - # Provide this to retrieve the subsequent page. - # @param filter [::String] - # Optional. A filter to apply on the list results. Supported features: - # - # * List all the products under the parent branch if - # {::Google::Cloud::Retail::V2::ListControlsRequest#filter filter} is unset. - # * List controls that are used in a single ServingConfig: - # 'serving_config = "boosted_home_page_cvr"' - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Gapic::PagedEnumerable<::Google::Cloud::Retail::V2::Control>] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Gapic::PagedEnumerable<::Google::Cloud::Retail::V2::Control>] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/cloud/retail/v2" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Retail::V2::ControlService::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Retail::V2::ListControlsRequest.new - # - # # Call the list_controls method. - # result = client.list_controls request - # - # # The returned object is of type Gapic::PagedEnumerable. You can iterate - # # over elements, and API calls will be issued to fetch pages as needed. - # result.each do |item| - # # Each element is of type ::Google::Cloud::Retail::V2::Control. - # p item - # end - # - def list_controls request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Retail::V2::ListControlsRequest - - # Converts hash 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_controls.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::Retail::V2::VERSION - metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - header_params = {} - if request.parent - 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_controls.timeout, - metadata: metadata, - retry_policy: @config.rpcs.list_controls.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @control_service_stub.call_rpc :list_controls, request, options: options do |response, operation| - response = ::Gapic::PagedEnumerable.new @control_service_stub, :list_controls, 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 ControlService API. - # - # This class represents the configuration for ControlService, - # providing control over timeouts, retry behavior, logging, transport - # parameters, and other low-level controls. Certain parameters can also be - # applied individually to specific RPCs. See - # {::Google::Cloud::Retail::V2::ControlService::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_control to 20 seconds, - # # and all remaining timeouts to 10 seconds. - # ::Google::Cloud::Retail::V2::ControlService::Client.configure do |config| - # config.timeout = 10.0 - # config.rpcs.create_control.timeout = 20.0 - # end - # - # # Apply the above configuration only to a new client. - # client = ::Google::Cloud::Retail::V2::ControlService::Client.new do |config| - # config.timeout = 10.0 - # config.rpcs.create_control.timeout = 20.0 - # end - # - # @!attribute [rw] endpoint - # A custom service endpoint, as a hostname or hostname:port. The default is - # nil, indicating to use the default endpoint in the current universe domain. - # @return [::String,nil] - # @!attribute [rw] credentials - # Credentials to send with calls. You may provide any of the following types: - # * (`Google::Auth::Credentials`) A googleauth credentials object - # (see the [googleauth docs](https://rubydoc.info/gems/googleauth/Google/Auth/Credentials)) - # * (`Signet::OAuth2::Client`) A signet oauth2 client object - # (see the [signet docs](https://rubydoc.info/gems/signet/Signet/OAuth2/Client)) - # * (`GRPC::Core::Channel`) a gRPC channel with included credentials - # * (`GRPC::Core::ChannelCredentials`) a gRPC credentails object - # * (`nil`) indicating no credentials - # - # @note Warning: Passing a `String` to a keyfile path or a `Hash` of credentials - # is deprecated. Providing an unvalidated credential configuration to - # Google APIs can compromise the security of your systems and data. - # - # @example - # - # # The recommended way to provide credentials is to use the `make_creds` method - # # on the appropriate credentials class for your environment. - # - # require "googleauth" - # - # credentials = ::Google::Auth::ServiceAccountCredentials.make_creds( - # json_key_io: ::File.open("/path/to/keyfile.json") - # ) - # - # client = ::Google::Cloud::Retail::V2::ControlService::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 = "retail.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 ControlService 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_control` - # @return [::Gapic::Config::Method] - # - attr_reader :create_control - ## - # RPC-specific configuration for `delete_control` - # @return [::Gapic::Config::Method] - # - attr_reader :delete_control - ## - # RPC-specific configuration for `update_control` - # @return [::Gapic::Config::Method] - # - attr_reader :update_control - ## - # RPC-specific configuration for `get_control` - # @return [::Gapic::Config::Method] - # - attr_reader :get_control - ## - # RPC-specific configuration for `list_controls` - # @return [::Gapic::Config::Method] - # - attr_reader :list_controls - - # @private - def initialize parent_rpcs = nil - create_control_config = parent_rpcs.create_control if parent_rpcs.respond_to? :create_control - @create_control = ::Gapic::Config::Method.new create_control_config - delete_control_config = parent_rpcs.delete_control if parent_rpcs.respond_to? :delete_control - @delete_control = ::Gapic::Config::Method.new delete_control_config - update_control_config = parent_rpcs.update_control if parent_rpcs.respond_to? :update_control - @update_control = ::Gapic::Config::Method.new update_control_config - get_control_config = parent_rpcs.get_control if parent_rpcs.respond_to? :get_control - @get_control = ::Gapic::Config::Method.new get_control_config - list_controls_config = parent_rpcs.list_controls if parent_rpcs.respond_to? :list_controls - @list_controls = ::Gapic::Config::Method.new list_controls_config - - yield self if block_given? - end - end - end - end - end - end - end - end -end diff --git a/owl-bot-staging/google-cloud-retail-v2/lib/google/cloud/retail/v2/control_service/credentials.rb b/owl-bot-staging/google-cloud-retail-v2/lib/google/cloud/retail/v2/control_service/credentials.rb deleted file mode 100644 index 127904154fe5..000000000000 --- a/owl-bot-staging/google-cloud-retail-v2/lib/google/cloud/retail/v2/control_service/credentials.rb +++ /dev/null @@ -1,51 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -require "googleauth" - -module Google - module Cloud - module Retail - module V2 - module ControlService - # Credentials for the ControlService API. - class Credentials < ::Google::Auth::Credentials - self.scope = [ - "https://www.googleapis.com/auth/cloud-platform" - ] - self.env_vars = [ - "RETAIL_CREDENTIALS", - "RETAIL_KEYFILE", - "GOOGLE_CLOUD_CREDENTIALS", - "GOOGLE_CLOUD_KEYFILE", - "GCLOUD_KEYFILE", - "RETAIL_CREDENTIALS_JSON", - "RETAIL_KEYFILE_JSON", - "GOOGLE_CLOUD_CREDENTIALS_JSON", - "GOOGLE_CLOUD_KEYFILE_JSON", - "GCLOUD_KEYFILE_JSON" - ] - self.paths = [ - "~/.config/google_cloud/application_default_credentials.json" - ] - end - end - end - end - end -end diff --git a/owl-bot-staging/google-cloud-retail-v2/lib/google/cloud/retail/v2/control_service/paths.rb b/owl-bot-staging/google-cloud-retail-v2/lib/google/cloud/retail/v2/control_service/paths.rb deleted file mode 100644 index 464e5d03b5ba..000000000000 --- a/owl-bot-staging/google-cloud-retail-v2/lib/google/cloud/retail/v2/control_service/paths.rb +++ /dev/null @@ -1,73 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - - -module Google - module Cloud - module Retail - module V2 - module ControlService - # Path helper methods for the ControlService API. - module Paths - ## - # Create a fully-qualified Catalog resource string. - # - # The resource will be in the following format: - # - # `projects/{project}/locations/{location}/catalogs/{catalog}` - # - # @param project [String] - # @param location [String] - # @param catalog [String] - # - # @return [::String] - def catalog_path project:, location:, catalog: - raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" - raise ::ArgumentError, "location cannot contain /" if location.to_s.include? "/" - - "projects/#{project}/locations/#{location}/catalogs/#{catalog}" - end - - ## - # Create a fully-qualified Control resource string. - # - # The resource will be in the following format: - # - # `projects/{project}/locations/{location}/catalogs/{catalog}/controls/{control}` - # - # @param project [String] - # @param location [String] - # @param catalog [String] - # @param control [String] - # - # @return [::String] - def control_path project:, location:, catalog:, control: - raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" - raise ::ArgumentError, "location cannot contain /" if location.to_s.include? "/" - raise ::ArgumentError, "catalog cannot contain /" if catalog.to_s.include? "/" - - "projects/#{project}/locations/#{location}/catalogs/#{catalog}/controls/#{control}" - end - - extend self - end - end - end - end - end -end diff --git a/owl-bot-staging/google-cloud-retail-v2/lib/google/cloud/retail/v2/control_service/rest.rb b/owl-bot-staging/google-cloud-retail-v2/lib/google/cloud/retail/v2/control_service/rest.rb deleted file mode 100644 index 31828796abd0..000000000000 --- a/owl-bot-staging/google-cloud-retail-v2/lib/google/cloud/retail/v2/control_service/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/retail/v2/version" - -require "google/cloud/retail/v2/control_service/credentials" -require "google/cloud/retail/v2/control_service/paths" -require "google/cloud/retail/v2/control_service/rest/client" - -module Google - module Cloud - module Retail - module V2 - ## - # Service for modifying Control. - # - # To load this service and instantiate a REST client: - # - # require "google/cloud/retail/v2/control_service/rest" - # client = ::Google::Cloud::Retail::V2::ControlService::Rest::Client.new - # - module ControlService - # Client for the REST transport - module Rest - end - end - end - end - end -end - -helper_path = ::File.join __dir__, "rest", "helpers.rb" -require "google/cloud/retail/v2/control_service/rest/helpers" if ::File.file? helper_path diff --git a/owl-bot-staging/google-cloud-retail-v2/lib/google/cloud/retail/v2/control_service/rest/client.rb b/owl-bot-staging/google-cloud-retail-v2/lib/google/cloud/retail/v2/control_service/rest/client.rb deleted file mode 100644 index 5586ba036cd8..000000000000 --- a/owl-bot-staging/google-cloud-retail-v2/lib/google/cloud/retail/v2/control_service/rest/client.rb +++ /dev/null @@ -1,831 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -require "google/cloud/errors" -require "google/cloud/retail/v2/control_service_pb" -require "google/cloud/retail/v2/control_service/rest/service_stub" -require "google/cloud/location/rest" - -module Google - module Cloud - module Retail - module V2 - module ControlService - module Rest - ## - # REST client for the ControlService service. - # - # Service for modifying Control. - # - class Client - # @private - API_VERSION = "" - - # @private - DEFAULT_ENDPOINT_TEMPLATE = "retail.$UNIVERSE_DOMAIN$" - - include Paths - - # @private - attr_reader :control_service_stub - - ## - # Configure the ControlService Client class. - # - # See {::Google::Cloud::Retail::V2::ControlService::Rest::Client::Configuration} - # for a description of the configuration fields. - # - # @example - # - # # Modify the configuration for all ControlService clients - # ::Google::Cloud::Retail::V2::ControlService::Rest::Client.configure do |config| - # config.timeout = 10.0 - # end - # - # @yield [config] Configure the Client client. - # @yieldparam config [Client::Configuration] - # - # @return [Client::Configuration] - # - def self.configure - @configure ||= begin - namespace = ["Google", "Cloud", "Retail", "V2"] - parent_config = while namespace.any? - parent_name = namespace.join "::" - parent_const = const_get parent_name - break parent_const.configure if parent_const.respond_to? :configure - namespace.pop - end - default_config = Client::Configuration.new parent_config - - default_config - end - yield @configure if block_given? - @configure - end - - ## - # Configure the ControlService Client instance. - # - # The configuration is set to the derived mode, meaning that values can be changed, - # but structural changes (adding new fields, etc.) are not allowed. Structural changes - # should be made on {Client.configure}. - # - # See {::Google::Cloud::Retail::V2::ControlService::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 - @control_service_stub.universe_domain - end - - ## - # Create a new ControlService REST client object. - # - # @example - # - # # Create a client using the default configuration - # client = ::Google::Cloud::Retail::V2::ControlService::Rest::Client.new - # - # # Create a client using a custom configuration - # client = ::Google::Cloud::Retail::V2::ControlService::Rest::Client.new do |config| - # config.timeout = 10.0 - # end - # - # @yield [config] Configure the ControlService 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 - - @control_service_stub = ::Google::Cloud::Retail::V2::ControlService::Rest::ServiceStub.new( - endpoint: @config.endpoint, - endpoint_template: DEFAULT_ENDPOINT_TEMPLATE, - universe_domain: @config.universe_domain, - credentials: credentials, - logger: @config.logger - ) - - @control_service_stub.logger(stub: true)&.info do |entry| - entry.set_system_name - entry.set_service - entry.message = "Created client for #{entry.service}" - entry.set_credentials_fields credentials - entry.set "customEndpoint", @config.endpoint if @config.endpoint - entry.set "defaultTimeout", @config.timeout if @config.timeout - entry.set "quotaProject", @quota_project_id if @quota_project_id - end - - @location_client = Google::Cloud::Location::Locations::Rest::Client.new do |config| - config.credentials = credentials - config.quota_project = @quota_project_id - config.endpoint = @control_service_stub.endpoint - config.universe_domain = @control_service_stub.universe_domain - config.logger = @control_service_stub.logger if config.respond_to? :logger= - end - end - - ## - # Get the associated client for mix-in of the Locations. - # - # @return [Google::Cloud::Location::Locations::Rest::Client] - # - attr_reader :location_client - - ## - # The logger used for request/response debug logging. - # - # @return [Logger] - # - def logger - @control_service_stub.logger - end - - # Service calls - - ## - # Creates a Control. - # - # If the {::Google::Cloud::Retail::V2::Control Control} to create already exists, - # an ALREADY_EXISTS error is returned. - # - # @overload create_control(request, options = nil) - # Pass arguments to `create_control` via a request object, either of type - # {::Google::Cloud::Retail::V2::CreateControlRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Retail::V2::CreateControlRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_control(parent: nil, control: nil, control_id: nil) - # Pass arguments to `create_control` via keyword arguments. Note that at - # least one keyword argument is 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. Full resource name of parent catalog. Format: - # `projects/{project_number}/locations/{location_id}/catalogs/{catalog_id}` - # @param control [::Google::Cloud::Retail::V2::Control, ::Hash] - # Required. The Control to create. - # @param control_id [::String] - # Required. The ID to use for the Control, which will become the final - # component of the Control's resource name. - # - # This value should be 4-63 characters, and valid characters - # are /[a-z][0-9]-_/. - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Cloud::Retail::V2::Control] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::Retail::V2::Control] - # - # @raise [::Google::Cloud::Error] if the REST call is aborted. - # - # @example Basic example - # require "google/cloud/retail/v2" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Retail::V2::ControlService::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Retail::V2::CreateControlRequest.new - # - # # Call the create_control method. - # result = client.create_control request - # - # # The returned object is of type Google::Cloud::Retail::V2::Control. - # p result - # - def create_control request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Retail::V2::CreateControlRequest - - # Converts hash 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_control.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::Retail::V2::VERSION, - transports_version_send: [:rest] - - call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - options.apply_defaults timeout: @config.rpcs.create_control.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.create_control.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @control_service_stub.create_control request, options do |result, operation| - yield result, operation if block_given? - end - rescue ::Gapic::Rest::Error => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Deletes a Control. - # - # If the {::Google::Cloud::Retail::V2::Control Control} to delete does not exist, - # a NOT_FOUND error is returned. - # - # @overload delete_control(request, options = nil) - # Pass arguments to `delete_control` via a request object, either of type - # {::Google::Cloud::Retail::V2::DeleteControlRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Retail::V2::DeleteControlRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_control(name: nil) - # Pass arguments to `delete_control` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param name [::String] - # Required. The resource name of the Control to delete. Format: - # `projects/{project_number}/locations/{location_id}/catalogs/{catalog_id}/controls/{control_id}` - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Protobuf::Empty] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Protobuf::Empty] - # - # @raise [::Google::Cloud::Error] if the REST call is aborted. - # - # @example Basic example - # require "google/cloud/retail/v2" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Retail::V2::ControlService::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Retail::V2::DeleteControlRequest.new - # - # # Call the delete_control method. - # result = client.delete_control request - # - # # The returned object is of type Google::Protobuf::Empty. - # p result - # - def delete_control request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Retail::V2::DeleteControlRequest - - # Converts hash 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_control.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::Retail::V2::VERSION, - transports_version_send: [:rest] - - call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - options.apply_defaults timeout: @config.rpcs.delete_control.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.delete_control.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @control_service_stub.delete_control 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 Control. - # - # {::Google::Cloud::Retail::V2::Control Control} cannot be set to a different - # oneof field, if so an INVALID_ARGUMENT is returned. If the - # {::Google::Cloud::Retail::V2::Control Control} to update does not exist, a - # NOT_FOUND error is returned. - # - # @overload update_control(request, options = nil) - # Pass arguments to `update_control` via a request object, either of type - # {::Google::Cloud::Retail::V2::UpdateControlRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Retail::V2::UpdateControlRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_control(control: nil, update_mask: nil) - # Pass arguments to `update_control` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param control [::Google::Cloud::Retail::V2::Control, ::Hash] - # Required. The Control to update. - # @param update_mask [::Google::Protobuf::FieldMask, ::Hash] - # Indicates which fields in the provided - # {::Google::Cloud::Retail::V2::Control Control} to update. The following are NOT - # supported: - # - # * {::Google::Cloud::Retail::V2::Control#name Control.name} - # - # If not set or empty, all supported fields are updated. - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Cloud::Retail::V2::Control] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::Retail::V2::Control] - # - # @raise [::Google::Cloud::Error] if the REST call is aborted. - # - # @example Basic example - # require "google/cloud/retail/v2" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Retail::V2::ControlService::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Retail::V2::UpdateControlRequest.new - # - # # Call the update_control method. - # result = client.update_control request - # - # # The returned object is of type Google::Cloud::Retail::V2::Control. - # p result - # - def update_control request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Retail::V2::UpdateControlRequest - - # Converts hash 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_control.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::Retail::V2::VERSION, - transports_version_send: [:rest] - - call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - options.apply_defaults timeout: @config.rpcs.update_control.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.update_control.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @control_service_stub.update_control request, options do |result, operation| - yield result, operation if block_given? - end - rescue ::Gapic::Rest::Error => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Gets a Control. - # - # @overload get_control(request, options = nil) - # Pass arguments to `get_control` via a request object, either of type - # {::Google::Cloud::Retail::V2::GetControlRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Retail::V2::GetControlRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_control(name: nil) - # Pass arguments to `get_control` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param name [::String] - # Required. The resource name of the Control to get. Format: - # `projects/{project_number}/locations/{location_id}/catalogs/{catalog_id}/controls/{control_id}` - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Cloud::Retail::V2::Control] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::Retail::V2::Control] - # - # @raise [::Google::Cloud::Error] if the REST call is aborted. - # - # @example Basic example - # require "google/cloud/retail/v2" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Retail::V2::ControlService::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Retail::V2::GetControlRequest.new - # - # # Call the get_control method. - # result = client.get_control request - # - # # The returned object is of type Google::Cloud::Retail::V2::Control. - # p result - # - def get_control request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Retail::V2::GetControlRequest - - # Converts hash 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_control.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::Retail::V2::VERSION, - transports_version_send: [:rest] - - call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - options.apply_defaults timeout: @config.rpcs.get_control.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.get_control.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @control_service_stub.get_control request, options do |result, operation| - yield result, operation if block_given? - end - rescue ::Gapic::Rest::Error => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Lists all Controls by their parent - # {::Google::Cloud::Retail::V2::Catalog Catalog}. - # - # @overload list_controls(request, options = nil) - # Pass arguments to `list_controls` via a request object, either of type - # {::Google::Cloud::Retail::V2::ListControlsRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Retail::V2::ListControlsRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_controls(parent: nil, page_size: nil, page_token: nil, filter: nil) - # Pass arguments to `list_controls` via keyword arguments. Note that at - # least one keyword argument is 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 catalog resource name. Format: - # `projects/{project_number}/locations/{location_id}/catalogs/{catalog_id}` - # @param page_size [::Integer] - # Optional. Maximum number of results to return. If unspecified, defaults - # to 50. Max allowed value is 1000. - # @param page_token [::String] - # Optional. A page token, received from a previous `ListControls` call. - # Provide this to retrieve the subsequent page. - # @param filter [::String] - # Optional. A filter to apply on the list results. Supported features: - # - # * List all the products under the parent branch if - # {::Google::Cloud::Retail::V2::ListControlsRequest#filter filter} is unset. - # * List controls that are used in a single ServingConfig: - # 'serving_config = "boosted_home_page_cvr"' - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Gapic::Rest::PagedEnumerable<::Google::Cloud::Retail::V2::Control>] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Gapic::Rest::PagedEnumerable<::Google::Cloud::Retail::V2::Control>] - # - # @raise [::Google::Cloud::Error] if the REST call is aborted. - # - # @example Basic example - # require "google/cloud/retail/v2" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Retail::V2::ControlService::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Retail::V2::ListControlsRequest.new - # - # # Call the list_controls method. - # result = client.list_controls request - # - # # The returned object is of type Gapic::PagedEnumerable. You can iterate - # # over elements, and API calls will be issued to fetch pages as needed. - # result.each do |item| - # # Each element is of type ::Google::Cloud::Retail::V2::Control. - # p item - # end - # - def list_controls request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Retail::V2::ListControlsRequest - - # Converts hash 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_controls.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::Retail::V2::VERSION, - transports_version_send: [:rest] - - call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - options.apply_defaults timeout: @config.rpcs.list_controls.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.list_controls.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @control_service_stub.list_controls request, options do |result, operation| - result = ::Gapic::Rest::PagedEnumerable.new @control_service_stub, :list_controls, "controls", 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 ControlService REST API. - # - # This class represents the configuration for ControlService REST, - # providing control over timeouts, retry behavior, logging, transport - # parameters, and other low-level controls. Certain parameters can also be - # applied individually to specific RPCs. See - # {::Google::Cloud::Retail::V2::ControlService::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_control to 20 seconds, - # # and all remaining timeouts to 10 seconds. - # ::Google::Cloud::Retail::V2::ControlService::Rest::Client.configure do |config| - # config.timeout = 10.0 - # config.rpcs.create_control.timeout = 20.0 - # end - # - # # Apply the above configuration only to a new client. - # client = ::Google::Cloud::Retail::V2::ControlService::Rest::Client.new do |config| - # config.timeout = 10.0 - # config.rpcs.create_control.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 = "retail.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 ControlService 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_control` - # @return [::Gapic::Config::Method] - # - attr_reader :create_control - ## - # RPC-specific configuration for `delete_control` - # @return [::Gapic::Config::Method] - # - attr_reader :delete_control - ## - # RPC-specific configuration for `update_control` - # @return [::Gapic::Config::Method] - # - attr_reader :update_control - ## - # RPC-specific configuration for `get_control` - # @return [::Gapic::Config::Method] - # - attr_reader :get_control - ## - # RPC-specific configuration for `list_controls` - # @return [::Gapic::Config::Method] - # - attr_reader :list_controls - - # @private - def initialize parent_rpcs = nil - create_control_config = parent_rpcs.create_control if parent_rpcs.respond_to? :create_control - @create_control = ::Gapic::Config::Method.new create_control_config - delete_control_config = parent_rpcs.delete_control if parent_rpcs.respond_to? :delete_control - @delete_control = ::Gapic::Config::Method.new delete_control_config - update_control_config = parent_rpcs.update_control if parent_rpcs.respond_to? :update_control - @update_control = ::Gapic::Config::Method.new update_control_config - get_control_config = parent_rpcs.get_control if parent_rpcs.respond_to? :get_control - @get_control = ::Gapic::Config::Method.new get_control_config - list_controls_config = parent_rpcs.list_controls if parent_rpcs.respond_to? :list_controls - @list_controls = ::Gapic::Config::Method.new list_controls_config - - yield self if block_given? - end - end - end - end - end - end - end - end - end -end diff --git a/owl-bot-staging/google-cloud-retail-v2/lib/google/cloud/retail/v2/control_service/rest/service_stub.rb b/owl-bot-staging/google-cloud-retail-v2/lib/google/cloud/retail/v2/control_service/rest/service_stub.rb deleted file mode 100644 index 61b0a0f77df2..000000000000 --- a/owl-bot-staging/google-cloud-retail-v2/lib/google/cloud/retail/v2/control_service/rest/service_stub.rb +++ /dev/null @@ -1,388 +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/retail/v2/control_service_pb" - -module Google - module Cloud - module Retail - module V2 - module ControlService - module Rest - ## - # REST service stub for the ControlService 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_control REST call - # - # @param request_pb [::Google::Cloud::Retail::V2::CreateControlRequest] - # A request object representing the call parameters. Required. - # @param options [::Gapic::CallOptions] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Cloud::Retail::V2::Control] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::Retail::V2::Control] - # A result object deserialized from the server's reply - def create_control request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_create_control_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_control", - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Cloud::Retail::V2::Control.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_control REST call - # - # @param request_pb [::Google::Cloud::Retail::V2::DeleteControlRequest] - # 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_control request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_delete_control_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_control", - 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 update_control REST call - # - # @param request_pb [::Google::Cloud::Retail::V2::UpdateControlRequest] - # A request object representing the call parameters. Required. - # @param options [::Gapic::CallOptions] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Cloud::Retail::V2::Control] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::Retail::V2::Control] - # A result object deserialized from the server's reply - def update_control request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_update_control_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_control", - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Cloud::Retail::V2::Control.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_control REST call - # - # @param request_pb [::Google::Cloud::Retail::V2::GetControlRequest] - # A request object representing the call parameters. Required. - # @param options [::Gapic::CallOptions] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Cloud::Retail::V2::Control] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::Retail::V2::Control] - # A result object deserialized from the server's reply - def get_control request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_get_control_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_control", - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Cloud::Retail::V2::Control.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_controls REST call - # - # @param request_pb [::Google::Cloud::Retail::V2::ListControlsRequest] - # A request object representing the call parameters. Required. - # @param options [::Gapic::CallOptions] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Cloud::Retail::V2::ListControlsResponse] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::Retail::V2::ListControlsResponse] - # A result object deserialized from the server's reply - def list_controls request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_list_controls_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_controls", - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Cloud::Retail::V2::ListControlsResponse.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_control REST call - # - # @param request_pb [::Google::Cloud::Retail::V2::CreateControlRequest] - # 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_control_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :post, - uri_template: "/v2/{parent}/controls", - body: "control", - matches: [ - ["parent", %r{^projects/[^/]+/locations/[^/]+/catalogs/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the delete_control REST call - # - # @param request_pb [::Google::Cloud::Retail::V2::DeleteControlRequest] - # 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_control_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :delete, - uri_template: "/v2/{name}", - matches: [ - ["name", %r{^projects/[^/]+/locations/[^/]+/catalogs/[^/]+/controls/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the update_control REST call - # - # @param request_pb [::Google::Cloud::Retail::V2::UpdateControlRequest] - # 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_control_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :patch, - uri_template: "/v2/{control.name}", - body: "control", - matches: [ - ["control.name", %r{^projects/[^/]+/locations/[^/]+/catalogs/[^/]+/controls/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the get_control REST call - # - # @param request_pb [::Google::Cloud::Retail::V2::GetControlRequest] - # 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_control_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :get, - uri_template: "/v2/{name}", - matches: [ - ["name", %r{^projects/[^/]+/locations/[^/]+/catalogs/[^/]+/controls/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the list_controls REST call - # - # @param request_pb [::Google::Cloud::Retail::V2::ListControlsRequest] - # 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_controls_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :get, - uri_template: "/v2/{parent}/controls", - matches: [ - ["parent", %r{^projects/[^/]+/locations/[^/]+/catalogs/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - end - end - end - end - end - end -end diff --git a/owl-bot-staging/google-cloud-retail-v2/lib/google/cloud/retail/v2/control_service_pb.rb b/owl-bot-staging/google-cloud-retail-v2/lib/google/cloud/retail/v2/control_service_pb.rb deleted file mode 100644 index 4af2840862e1..000000000000 --- a/owl-bot-staging/google-cloud-retail-v2/lib/google/cloud/retail/v2/control_service_pb.rb +++ /dev/null @@ -1,34 +0,0 @@ -# frozen_string_literal: true -# Generated by the protocol buffer compiler. DO NOT EDIT! -# source: google/cloud/retail/v2/control_service.proto - -require 'google/protobuf' - -require 'google/api/annotations_pb' -require 'google/api/client_pb' -require 'google/api/field_behavior_pb' -require 'google/api/resource_pb' -require 'google/cloud/retail/v2/control_pb' -require 'google/protobuf/empty_pb' -require 'google/protobuf/field_mask_pb' - - -descriptor_data = "\n,google/cloud/retail/v2/control_service.proto\x12\x16google.cloud.retail.v2\x1a\x1cgoogle/api/annotations.proto\x1a\x17google/api/client.proto\x1a\x1fgoogle/api/field_behavior.proto\x1a\x19google/api/resource.proto\x1a$google/cloud/retail/v2/control.proto\x1a\x1bgoogle/protobuf/empty.proto\x1a google/protobuf/field_mask.proto\"\x9d\x01\n\x14\x43reateControlRequest\x12\x35\n\x06parent\x18\x01 \x01(\tB%\xe0\x41\x02\xfa\x41\x1f\n\x1dretail.googleapis.com/Catalog\x12\x35\n\x07\x63ontrol\x18\x02 \x01(\x0b\x32\x1f.google.cloud.retail.v2.ControlB\x03\xe0\x41\x02\x12\x17\n\ncontrol_id\x18\x03 \x01(\tB\x03\xe0\x41\x02\"~\n\x14UpdateControlRequest\x12\x35\n\x07\x63ontrol\x18\x01 \x01(\x0b\x32\x1f.google.cloud.retail.v2.ControlB\x03\xe0\x41\x02\x12/\n\x0bupdate_mask\x18\x02 \x01(\x0b\x32\x1a.google.protobuf.FieldMask\"K\n\x14\x44\x65leteControlRequest\x12\x33\n\x04name\x18\x01 \x01(\tB%\xe0\x41\x02\xfa\x41\x1f\n\x1dretail.googleapis.com/Control\"H\n\x11GetControlRequest\x12\x33\n\x04name\x18\x01 \x01(\tB%\xe0\x41\x02\xfa\x41\x1f\n\x1dretail.googleapis.com/Control\"\x92\x01\n\x13ListControlsRequest\x12\x35\n\x06parent\x18\x01 \x01(\tB%\xe0\x41\x02\xfa\x41\x1f\n\x1dretail.googleapis.com/Catalog\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\"b\n\x14ListControlsResponse\x12\x31\n\x08\x63ontrols\x18\x01 \x03(\x0b\x32\x1f.google.cloud.retail.v2.Control\x12\x17\n\x0fnext_page_token\x18\x02 \x01(\t2\xe4\x07\n\x0e\x43ontrolService\x12\xc4\x01\n\rCreateControl\x12,.google.cloud.retail.v2.CreateControlRequest\x1a\x1f.google.cloud.retail.v2.Control\"d\xda\x41\x19parent,control,control_id\x82\xd3\xe4\x93\x02\x42\"7/v2/{parent=projects/*/locations/*/catalogs/*}/controls:\x07\x63ontrol\x12\x9d\x01\n\rDeleteControl\x12,.google.cloud.retail.v2.DeleteControlRequest\x1a\x16.google.protobuf.Empty\"F\xda\x41\x04name\x82\xd3\xe4\x93\x02\x39*7/v2/{name=projects/*/locations/*/catalogs/*/controls/*}\x12\xc6\x01\n\rUpdateControl\x12,.google.cloud.retail.v2.UpdateControlRequest\x1a\x1f.google.cloud.retail.v2.Control\"f\xda\x41\x13\x63ontrol,update_mask\x82\xd3\xe4\x93\x02J2?/v2/{control.name=projects/*/locations/*/catalogs/*/controls/*}:\x07\x63ontrol\x12\xa0\x01\n\nGetControl\x12).google.cloud.retail.v2.GetControlRequest\x1a\x1f.google.cloud.retail.v2.Control\"F\xda\x41\x04name\x82\xd3\xe4\x93\x02\x39\x12\x37/v2/{name=projects/*/locations/*/catalogs/*/controls/*}\x12\xb3\x01\n\x0cListControls\x12+.google.cloud.retail.v2.ListControlsRequest\x1a,.google.cloud.retail.v2.ListControlsResponse\"H\xda\x41\x06parent\x82\xd3\xe4\x93\x02\x39\x12\x37/v2/{parent=projects/*/locations/*/catalogs/*}/controls\x1aI\xca\x41\x15retail.googleapis.com\xd2\x41.https://www.googleapis.com/auth/cloud-platformB\xbe\x01\n\x1a\x63om.google.cloud.retail.v2B\x13\x43ontrolServiceProtoP\x01Z2cloud.google.com/go/retail/apiv2/retailpb;retailpb\xa2\x02\x06RETAIL\xaa\x02\x16Google.Cloud.Retail.V2\xca\x02\x16Google\\Cloud\\Retail\\V2\xea\x02\x19Google::Cloud::Retail::V2b\x06proto3" - -pool = ::Google::Protobuf::DescriptorPool.generated_pool -pool.add_serialized_file(descriptor_data) - -module Google - module Cloud - module Retail - module V2 - CreateControlRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.retail.v2.CreateControlRequest").msgclass - UpdateControlRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.retail.v2.UpdateControlRequest").msgclass - DeleteControlRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.retail.v2.DeleteControlRequest").msgclass - GetControlRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.retail.v2.GetControlRequest").msgclass - ListControlsRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.retail.v2.ListControlsRequest").msgclass - ListControlsResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.retail.v2.ListControlsResponse").msgclass - end - end - end -end diff --git a/owl-bot-staging/google-cloud-retail-v2/lib/google/cloud/retail/v2/control_service_services_pb.rb b/owl-bot-staging/google-cloud-retail-v2/lib/google/cloud/retail/v2/control_service_services_pb.rb deleted file mode 100644 index bcef36f6b4c1..000000000000 --- a/owl-bot-staging/google-cloud-retail-v2/lib/google/cloud/retail/v2/control_service_services_pb.rb +++ /dev/null @@ -1,65 +0,0 @@ -# Generated by the protocol buffer compiler. DO NOT EDIT! -# Source: google/cloud/retail/v2/control_service.proto for package 'Google.Cloud.Retail.V2' -# Original file comments: -# 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 -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. -# - -require 'grpc' -require 'google/cloud/retail/v2/control_service_pb' - -module Google - module Cloud - module Retail - module V2 - module ControlService - # Service for modifying Control. - class Service - - include ::GRPC::GenericService - - self.marshal_class_method = :encode - self.unmarshal_class_method = :decode - self.service_name = 'google.cloud.retail.v2.ControlService' - - # Creates a Control. - # - # If the [Control][google.cloud.retail.v2.Control] to create already exists, - # an ALREADY_EXISTS error is returned. - rpc :CreateControl, ::Google::Cloud::Retail::V2::CreateControlRequest, ::Google::Cloud::Retail::V2::Control - # Deletes a Control. - # - # If the [Control][google.cloud.retail.v2.Control] to delete does not exist, - # a NOT_FOUND error is returned. - rpc :DeleteControl, ::Google::Cloud::Retail::V2::DeleteControlRequest, ::Google::Protobuf::Empty - # Updates a Control. - # - # [Control][google.cloud.retail.v2.Control] cannot be set to a different - # oneof field, if so an INVALID_ARGUMENT is returned. If the - # [Control][google.cloud.retail.v2.Control] to update does not exist, a - # NOT_FOUND error is returned. - rpc :UpdateControl, ::Google::Cloud::Retail::V2::UpdateControlRequest, ::Google::Cloud::Retail::V2::Control - # Gets a Control. - rpc :GetControl, ::Google::Cloud::Retail::V2::GetControlRequest, ::Google::Cloud::Retail::V2::Control - # Lists all Controls by their parent - # [Catalog][google.cloud.retail.v2.Catalog]. - rpc :ListControls, ::Google::Cloud::Retail::V2::ListControlsRequest, ::Google::Cloud::Retail::V2::ListControlsResponse - end - - Stub = Service.rpc_stub_class - end - end - end - end -end diff --git a/owl-bot-staging/google-cloud-retail-v2/lib/google/cloud/retail/v2/conversational_search_service.rb b/owl-bot-staging/google-cloud-retail-v2/lib/google/cloud/retail/v2/conversational_search_service.rb deleted file mode 100644 index c3b86da366b9..000000000000 --- a/owl-bot-staging/google-cloud-retail-v2/lib/google/cloud/retail/v2/conversational_search_service.rb +++ /dev/null @@ -1,59 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -require "gapic/common" -require "gapic/config" -require "gapic/config/method" - -require "google/cloud/retail/v2/version" - -require "google/cloud/retail/v2/conversational_search_service/credentials" -require "google/cloud/retail/v2/conversational_search_service/paths" -require "google/cloud/retail/v2/conversational_search_service/client" -require "google/cloud/retail/v2/conversational_search_service/rest" - -module Google - module Cloud - module Retail - module V2 - ## - # Service for retail conversational search. - # - # This feature is only available for users who have Retail Conversational - # Search enabled. Enable Retail Conversational Search on Cloud Console - # before using this feature. - # - # @example Load this service and instantiate a gRPC client - # - # require "google/cloud/retail/v2/conversational_search_service" - # client = ::Google::Cloud::Retail::V2::ConversationalSearchService::Client.new - # - # @example Load this service and instantiate a REST client - # - # require "google/cloud/retail/v2/conversational_search_service/rest" - # client = ::Google::Cloud::Retail::V2::ConversationalSearchService::Rest::Client.new - # - module ConversationalSearchService - end - end - end - end -end - -helper_path = ::File.join __dir__, "conversational_search_service", "helpers.rb" -require "google/cloud/retail/v2/conversational_search_service/helpers" if ::File.file? helper_path diff --git a/owl-bot-staging/google-cloud-retail-v2/lib/google/cloud/retail/v2/conversational_search_service/client.rb b/owl-bot-staging/google-cloud-retail-v2/lib/google/cloud/retail/v2/conversational_search_service/client.rb deleted file mode 100644 index ed6ffe7ac650..000000000000 --- a/owl-bot-staging/google-cloud-retail-v2/lib/google/cloud/retail/v2/conversational_search_service/client.rb +++ /dev/null @@ -1,574 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -require "google/cloud/errors" -require "google/cloud/retail/v2/conversational_search_service_pb" -require "google/cloud/location" - -module Google - module Cloud - module Retail - module V2 - module ConversationalSearchService - ## - # Client for the ConversationalSearchService service. - # - # Service for retail conversational search. - # - # This feature is only available for users who have Retail Conversational - # Search enabled. Enable Retail Conversational Search on Cloud Console - # before using this feature. - # - class Client - # @private - API_VERSION = "" - - # @private - DEFAULT_ENDPOINT_TEMPLATE = "retail.$UNIVERSE_DOMAIN$" - - include Paths - - # @private - attr_reader :conversational_search_service_stub - - ## - # Configure the ConversationalSearchService Client class. - # - # See {::Google::Cloud::Retail::V2::ConversationalSearchService::Client::Configuration} - # for a description of the configuration fields. - # - # @example - # - # # Modify the configuration for all ConversationalSearchService clients - # ::Google::Cloud::Retail::V2::ConversationalSearchService::Client.configure do |config| - # config.timeout = 10.0 - # end - # - # @yield [config] Configure the Client client. - # @yieldparam config [Client::Configuration] - # - # @return [Client::Configuration] - # - def self.configure - @configure ||= begin - namespace = ["Google", "Cloud", "Retail", "V2"] - parent_config = while namespace.any? - parent_name = namespace.join "::" - parent_const = const_get parent_name - break parent_const.configure if parent_const.respond_to? :configure - namespace.pop - end - default_config = Client::Configuration.new parent_config - - default_config - end - yield @configure if block_given? - @configure - end - - ## - # Configure the ConversationalSearchService Client instance. - # - # The configuration is set to the derived mode, meaning that values can be changed, - # but structural changes (adding new fields, etc.) are not allowed. Structural changes - # should be made on {Client.configure}. - # - # See {::Google::Cloud::Retail::V2::ConversationalSearchService::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 - @conversational_search_service_stub.universe_domain - end - - ## - # Create a new ConversationalSearchService client object. - # - # @example - # - # # Create a client using the default configuration - # client = ::Google::Cloud::Retail::V2::ConversationalSearchService::Client.new - # - # # Create a client using a custom configuration - # client = ::Google::Cloud::Retail::V2::ConversationalSearchService::Client.new do |config| - # config.timeout = 10.0 - # end - # - # @yield [config] Configure the ConversationalSearchService client. - # @yieldparam config [Client::Configuration] - # - def initialize - # These require statements are intentionally placed here to initialize - # the gRPC module only when it's required. - # See https://github.com/googleapis/toolkit/issues/446 - require "gapic/grpc" - require "google/cloud/retail/v2/conversational_search_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 - - @conversational_search_service_stub = ::Gapic::ServiceStub.new( - ::Google::Cloud::Retail::V2::ConversationalSearchService::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 - ) - - @conversational_search_service_stub.stub_logger&.info do |entry| - entry.set_system_name - entry.set_service - entry.message = "Created client for #{entry.service}" - entry.set_credentials_fields credentials - entry.set "customEndpoint", @config.endpoint if @config.endpoint - entry.set "defaultTimeout", @config.timeout if @config.timeout - entry.set "quotaProject", @quota_project_id if @quota_project_id - end - - @location_client = Google::Cloud::Location::Locations::Client.new do |config| - config.credentials = credentials - config.quota_project = @quota_project_id - config.endpoint = @conversational_search_service_stub.endpoint - config.universe_domain = @conversational_search_service_stub.universe_domain - config.logger = @conversational_search_service_stub.logger if config.respond_to? :logger= - end - end - - ## - # Get the associated client for mix-in of the Locations. - # - # @return [Google::Cloud::Location::Locations::Client] - # - attr_reader :location_client - - ## - # The logger used for request/response debug logging. - # - # @return [Logger] - # - def logger - @conversational_search_service_stub.logger - end - - # Service calls - - ## - # Performs a conversational search. - # - # This feature is only available for users who have Conversational Search - # enabled. - # - # @overload conversational_search(request, options = nil) - # Pass arguments to `conversational_search` via a request object, either of type - # {::Google::Cloud::Retail::V2::ConversationalSearchRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Retail::V2::ConversationalSearchRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. - # - # @overload conversational_search(placement: nil, branch: nil, query: nil, page_categories: nil, conversation_id: nil, search_params: nil, visitor_id: nil, user_info: nil, conversational_filtering_spec: nil, user_labels: nil, safety_settings: nil) - # Pass arguments to `conversational_search` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param placement [::String] - # Required. The resource name of the search engine placement, such as - # `projects/*/locations/global/catalogs/default_catalog/placements/default_search` - # or - # `projects/*/locations/global/catalogs/default_catalog/servingConfigs/default_serving_config` - # This field is used to identify the serving config name and the set - # of models that will be used to make the search. - # @param branch [::String] - # Required. The branch resource name, such as - # `projects/*/locations/global/catalogs/default_catalog/branches/0`. - # - # Use "default_branch" as the branch ID or leave this field empty, to search - # products under the default branch. - # @param query [::String] - # Optional. Raw search query to be searched for. - # - # If this field is empty, the request is considered a category browsing - # request. - # @param page_categories [::Array<::String>] - # Optional. The categories associated with a category page. Must be set for - # category navigation queries to achieve good search quality. The format - # should be the same as - # {::Google::Cloud::Retail::V2::UserEvent#page_categories UserEvent.page_categories}; - # - # To represent full path of category, use '>' sign to separate different - # hierarchies. If '>' is part of the category name, replace it with - # other character(s). - # - # Category pages include special pages such as sales or promotions. For - # instance, a special sale page may have the category hierarchy: - # "pageCategories" : ["Sales > 2017 Black Friday Deals"]. - # @param conversation_id [::String] - # Optional. This field specifies the conversation id, which maintains the - # state of the conversation between client side and server side. Use the - # value from the previous - # {::Google::Cloud::Retail::V2::ConversationalSearchResponse#conversation_id ConversationalSearchResponse.conversation_id}. - # For the initial request, this should be empty. - # @param search_params [::Google::Cloud::Retail::V2::ConversationalSearchRequest::SearchParams, ::Hash] - # Optional. Search parameters. - # @param visitor_id [::String] - # Required. A unique identifier for tracking visitors. For example, this - # could be implemented with an HTTP cookie, which should be able to uniquely - # identify a visitor on a single device. This unique identifier should not - # change if the visitor logs in or out of the website. - # - # This should be the same identifier as - # {::Google::Cloud::Retail::V2::UserEvent#visitor_id UserEvent.visitor_id}. - # - # The field must be a UTF-8 encoded string with a length limit of 128 - # characters. Otherwise, an INVALID_ARGUMENT error is returned. - # @param user_info [::Google::Cloud::Retail::V2::UserInfo, ::Hash] - # Optional. User information. - # @param conversational_filtering_spec [::Google::Cloud::Retail::V2::ConversationalSearchRequest::ConversationalFilteringSpec, ::Hash] - # Optional. This field specifies all conversational filtering related - # parameters. - # @param user_labels [::Hash{::String => ::String}] - # Optional. The user labels applied to a resource must meet the following - # requirements: - # - # * Each resource can have multiple labels, up to a maximum of 64. - # * Each label must be a key-value pair. - # * Keys have a minimum length of 1 character and a maximum length of 63 - # characters and cannot be empty. Values can be empty and have a maximum - # length of 63 characters. - # * Keys and values can contain only lowercase letters, numeric characters, - # underscores, and dashes. All characters must use UTF-8 encoding, and - # international characters are allowed. - # * The key portion of a label must be unique. However, you can use the same - # key with multiple resources. - # * Keys must start with a lowercase letter or international character. - # - # See [Google Cloud - # Document](https://cloud.google.com/resource-manager/docs/creating-managing-labels#requirements) - # for more details. - # @param safety_settings [::Array<::Google::Cloud::Retail::V2::SafetySetting, ::Hash>] - # Optional. The safety settings to be applied to the generated content. - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Enumerable<::Google::Cloud::Retail::V2::ConversationalSearchResponse>] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Enumerable<::Google::Cloud::Retail::V2::ConversationalSearchResponse>] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/cloud/retail/v2" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Retail::V2::ConversationalSearchService::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Retail::V2::ConversationalSearchRequest.new - # - # # Call the conversational_search method to start streaming. - # output = client.conversational_search request - # - # # The returned object is a streamed enumerable yielding elements of type - # # ::Google::Cloud::Retail::V2::ConversationalSearchResponse - # output.each do |current_response| - # p current_response - # end - # - def conversational_search request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Retail::V2::ConversationalSearchRequest - - # Converts hash 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.conversational_search.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::Retail::V2::VERSION - metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - header_params = {} - if request.placement - header_params["placement"] = request.placement - 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.conversational_search.timeout, - metadata: metadata, - retry_policy: @config.rpcs.conversational_search.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @conversational_search_service_stub.call_rpc :conversational_search, request, options: options do |response, operation| - yield response, operation if block_given? - end - rescue ::GRPC::BadStatus => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Configuration class for the ConversationalSearchService API. - # - # This class represents the configuration for ConversationalSearchService, - # providing control over timeouts, retry behavior, logging, transport - # parameters, and other low-level controls. Certain parameters can also be - # applied individually to specific RPCs. See - # {::Google::Cloud::Retail::V2::ConversationalSearchService::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 - # # conversational_search to 20 seconds, - # # and all remaining timeouts to 10 seconds. - # ::Google::Cloud::Retail::V2::ConversationalSearchService::Client.configure do |config| - # config.timeout = 10.0 - # config.rpcs.conversational_search.timeout = 20.0 - # end - # - # # Apply the above configuration only to a new client. - # client = ::Google::Cloud::Retail::V2::ConversationalSearchService::Client.new do |config| - # config.timeout = 10.0 - # config.rpcs.conversational_search.timeout = 20.0 - # end - # - # @!attribute [rw] endpoint - # A custom service endpoint, as a hostname or hostname:port. The default is - # nil, indicating to use the default endpoint in the current universe domain. - # @return [::String,nil] - # @!attribute [rw] credentials - # Credentials to send with calls. You may provide any of the following types: - # * (`Google::Auth::Credentials`) A googleauth credentials object - # (see the [googleauth docs](https://rubydoc.info/gems/googleauth/Google/Auth/Credentials)) - # * (`Signet::OAuth2::Client`) A signet oauth2 client object - # (see the [signet docs](https://rubydoc.info/gems/signet/Signet/OAuth2/Client)) - # * (`GRPC::Core::Channel`) a gRPC channel with included credentials - # * (`GRPC::Core::ChannelCredentials`) a gRPC credentails object - # * (`nil`) indicating no credentials - # - # @note Warning: Passing a `String` to a keyfile path or a `Hash` of credentials - # is deprecated. Providing an unvalidated credential configuration to - # Google APIs can compromise the security of your systems and data. - # - # @example - # - # # The recommended way to provide credentials is to use the `make_creds` method - # # on the appropriate credentials class for your environment. - # - # require "googleauth" - # - # credentials = ::Google::Auth::ServiceAccountCredentials.make_creds( - # json_key_io: ::File.open("/path/to/keyfile.json") - # ) - # - # client = ::Google::Cloud::Retail::V2::ConversationalSearchService::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 = "retail.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 ConversationalSearchService 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 `conversational_search` - # @return [::Gapic::Config::Method] - # - attr_reader :conversational_search - - # @private - def initialize parent_rpcs = nil - conversational_search_config = parent_rpcs.conversational_search if parent_rpcs.respond_to? :conversational_search - @conversational_search = ::Gapic::Config::Method.new conversational_search_config - - yield self if block_given? - end - end - end - end - end - end - end - end -end diff --git a/owl-bot-staging/google-cloud-retail-v2/lib/google/cloud/retail/v2/conversational_search_service/credentials.rb b/owl-bot-staging/google-cloud-retail-v2/lib/google/cloud/retail/v2/conversational_search_service/credentials.rb deleted file mode 100644 index ccd5e02152d8..000000000000 --- a/owl-bot-staging/google-cloud-retail-v2/lib/google/cloud/retail/v2/conversational_search_service/credentials.rb +++ /dev/null @@ -1,51 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -require "googleauth" - -module Google - module Cloud - module Retail - module V2 - module ConversationalSearchService - # Credentials for the ConversationalSearchService API. - class Credentials < ::Google::Auth::Credentials - self.scope = [ - "https://www.googleapis.com/auth/cloud-platform" - ] - self.env_vars = [ - "RETAIL_CREDENTIALS", - "RETAIL_KEYFILE", - "GOOGLE_CLOUD_CREDENTIALS", - "GOOGLE_CLOUD_KEYFILE", - "GCLOUD_KEYFILE", - "RETAIL_CREDENTIALS_JSON", - "RETAIL_KEYFILE_JSON", - "GOOGLE_CLOUD_CREDENTIALS_JSON", - "GOOGLE_CLOUD_KEYFILE_JSON", - "GCLOUD_KEYFILE_JSON" - ] - self.paths = [ - "~/.config/google_cloud/application_default_credentials.json" - ] - end - end - end - end - end -end diff --git a/owl-bot-staging/google-cloud-retail-v2/lib/google/cloud/retail/v2/conversational_search_service/paths.rb b/owl-bot-staging/google-cloud-retail-v2/lib/google/cloud/retail/v2/conversational_search_service/paths.rb deleted file mode 100644 index f19dca726f47..000000000000 --- a/owl-bot-staging/google-cloud-retail-v2/lib/google/cloud/retail/v2/conversational_search_service/paths.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! - - -module Google - module Cloud - module Retail - module V2 - module ConversationalSearchService - # Path helper methods for the ConversationalSearchService API. - module Paths - ## - # Create a fully-qualified Branch resource string. - # - # The resource will be in the following format: - # - # `projects/{project}/locations/{location}/catalogs/{catalog}/branches/{branch}` - # - # @param project [String] - # @param location [String] - # @param catalog [String] - # @param branch [String] - # - # @return [::String] - def branch_path project:, location:, catalog:, branch: - raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" - raise ::ArgumentError, "location cannot contain /" if location.to_s.include? "/" - raise ::ArgumentError, "catalog cannot contain /" if catalog.to_s.include? "/" - - "projects/#{project}/locations/#{location}/catalogs/#{catalog}/branches/#{branch}" - end - - extend self - end - end - end - end - end -end diff --git a/owl-bot-staging/google-cloud-retail-v2/lib/google/cloud/retail/v2/conversational_search_service/rest.rb b/owl-bot-staging/google-cloud-retail-v2/lib/google/cloud/retail/v2/conversational_search_service/rest.rb deleted file mode 100644 index 2177b82399f5..000000000000 --- a/owl-bot-staging/google-cloud-retail-v2/lib/google/cloud/retail/v2/conversational_search_service/rest.rb +++ /dev/null @@ -1,56 +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/retail/v2/version" - -require "google/cloud/retail/v2/conversational_search_service/credentials" -require "google/cloud/retail/v2/conversational_search_service/paths" -require "google/cloud/retail/v2/conversational_search_service/rest/client" - -module Google - module Cloud - module Retail - module V2 - ## - # Service for retail conversational search. - # - # This feature is only available for users who have Retail Conversational - # Search enabled. Enable Retail Conversational Search on Cloud Console - # before using this feature. - # - # To load this service and instantiate a REST client: - # - # require "google/cloud/retail/v2/conversational_search_service/rest" - # client = ::Google::Cloud::Retail::V2::ConversationalSearchService::Rest::Client.new - # - module ConversationalSearchService - # Client for the REST transport - module Rest - end - end - end - end - end -end - -helper_path = ::File.join __dir__, "rest", "helpers.rb" -require "google/cloud/retail/v2/conversational_search_service/rest/helpers" if ::File.file? helper_path diff --git a/owl-bot-staging/google-cloud-retail-v2/lib/google/cloud/retail/v2/conversational_search_service/rest/client.rb b/owl-bot-staging/google-cloud-retail-v2/lib/google/cloud/retail/v2/conversational_search_service/rest/client.rb deleted file mode 100644 index 4145b1924def..000000000000 --- a/owl-bot-staging/google-cloud-retail-v2/lib/google/cloud/retail/v2/conversational_search_service/rest/client.rb +++ /dev/null @@ -1,526 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -require "google/cloud/errors" -require "google/cloud/retail/v2/conversational_search_service_pb" -require "google/cloud/retail/v2/conversational_search_service/rest/service_stub" -require "google/cloud/location/rest" - -module Google - module Cloud - module Retail - module V2 - module ConversationalSearchService - module Rest - ## - # REST client for the ConversationalSearchService service. - # - # Service for retail conversational search. - # - # This feature is only available for users who have Retail Conversational - # Search enabled. Enable Retail Conversational Search on Cloud Console - # before using this feature. - # - class Client - # @private - API_VERSION = "" - - # @private - DEFAULT_ENDPOINT_TEMPLATE = "retail.$UNIVERSE_DOMAIN$" - - include Paths - - # @private - attr_reader :conversational_search_service_stub - - ## - # Configure the ConversationalSearchService Client class. - # - # See {::Google::Cloud::Retail::V2::ConversationalSearchService::Rest::Client::Configuration} - # for a description of the configuration fields. - # - # @example - # - # # Modify the configuration for all ConversationalSearchService clients - # ::Google::Cloud::Retail::V2::ConversationalSearchService::Rest::Client.configure do |config| - # config.timeout = 10.0 - # end - # - # @yield [config] Configure the Client client. - # @yieldparam config [Client::Configuration] - # - # @return [Client::Configuration] - # - def self.configure - @configure ||= begin - namespace = ["Google", "Cloud", "Retail", "V2"] - parent_config = while namespace.any? - parent_name = namespace.join "::" - parent_const = const_get parent_name - break parent_const.configure if parent_const.respond_to? :configure - namespace.pop - end - default_config = Client::Configuration.new parent_config - - default_config - end - yield @configure if block_given? - @configure - end - - ## - # Configure the ConversationalSearchService Client instance. - # - # The configuration is set to the derived mode, meaning that values can be changed, - # but structural changes (adding new fields, etc.) are not allowed. Structural changes - # should be made on {Client.configure}. - # - # See {::Google::Cloud::Retail::V2::ConversationalSearchService::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 - @conversational_search_service_stub.universe_domain - end - - ## - # Create a new ConversationalSearchService REST client object. - # - # @example - # - # # Create a client using the default configuration - # client = ::Google::Cloud::Retail::V2::ConversationalSearchService::Rest::Client.new - # - # # Create a client using a custom configuration - # client = ::Google::Cloud::Retail::V2::ConversationalSearchService::Rest::Client.new do |config| - # config.timeout = 10.0 - # end - # - # @yield [config] Configure the ConversationalSearchService 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 - - @conversational_search_service_stub = ::Google::Cloud::Retail::V2::ConversationalSearchService::Rest::ServiceStub.new( - endpoint: @config.endpoint, - endpoint_template: DEFAULT_ENDPOINT_TEMPLATE, - universe_domain: @config.universe_domain, - credentials: credentials, - logger: @config.logger - ) - - @conversational_search_service_stub.logger(stub: true)&.info do |entry| - entry.set_system_name - entry.set_service - entry.message = "Created client for #{entry.service}" - entry.set_credentials_fields credentials - entry.set "customEndpoint", @config.endpoint if @config.endpoint - entry.set "defaultTimeout", @config.timeout if @config.timeout - entry.set "quotaProject", @quota_project_id if @quota_project_id - end - - @location_client = Google::Cloud::Location::Locations::Rest::Client.new do |config| - config.credentials = credentials - config.quota_project = @quota_project_id - config.endpoint = @conversational_search_service_stub.endpoint - config.universe_domain = @conversational_search_service_stub.universe_domain - config.logger = @conversational_search_service_stub.logger if config.respond_to? :logger= - end - end - - ## - # Get the associated client for mix-in of the Locations. - # - # @return [Google::Cloud::Location::Locations::Rest::Client] - # - attr_reader :location_client - - ## - # The logger used for request/response debug logging. - # - # @return [Logger] - # - def logger - @conversational_search_service_stub.logger - end - - # Service calls - - ## - # Performs a conversational search. - # - # This feature is only available for users who have Conversational Search - # enabled. - # - # @overload conversational_search(request, options = nil) - # Pass arguments to `conversational_search` via a request object, either of type - # {::Google::Cloud::Retail::V2::ConversationalSearchRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Retail::V2::ConversationalSearchRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @overload conversational_search(placement: nil, branch: nil, query: nil, page_categories: nil, conversation_id: nil, search_params: nil, visitor_id: nil, user_info: nil, conversational_filtering_spec: nil, user_labels: nil, safety_settings: nil) - # Pass arguments to `conversational_search` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param placement [::String] - # Required. The resource name of the search engine placement, such as - # `projects/*/locations/global/catalogs/default_catalog/placements/default_search` - # or - # `projects/*/locations/global/catalogs/default_catalog/servingConfigs/default_serving_config` - # This field is used to identify the serving config name and the set - # of models that will be used to make the search. - # @param branch [::String] - # Required. The branch resource name, such as - # `projects/*/locations/global/catalogs/default_catalog/branches/0`. - # - # Use "default_branch" as the branch ID or leave this field empty, to search - # products under the default branch. - # @param query [::String] - # Optional. Raw search query to be searched for. - # - # If this field is empty, the request is considered a category browsing - # request. - # @param page_categories [::Array<::String>] - # Optional. The categories associated with a category page. Must be set for - # category navigation queries to achieve good search quality. The format - # should be the same as - # {::Google::Cloud::Retail::V2::UserEvent#page_categories UserEvent.page_categories}; - # - # To represent full path of category, use '>' sign to separate different - # hierarchies. If '>' is part of the category name, replace it with - # other character(s). - # - # Category pages include special pages such as sales or promotions. For - # instance, a special sale page may have the category hierarchy: - # "pageCategories" : ["Sales > 2017 Black Friday Deals"]. - # @param conversation_id [::String] - # Optional. This field specifies the conversation id, which maintains the - # state of the conversation between client side and server side. Use the - # value from the previous - # {::Google::Cloud::Retail::V2::ConversationalSearchResponse#conversation_id ConversationalSearchResponse.conversation_id}. - # For the initial request, this should be empty. - # @param search_params [::Google::Cloud::Retail::V2::ConversationalSearchRequest::SearchParams, ::Hash] - # Optional. Search parameters. - # @param visitor_id [::String] - # Required. A unique identifier for tracking visitors. For example, this - # could be implemented with an HTTP cookie, which should be able to uniquely - # identify a visitor on a single device. This unique identifier should not - # change if the visitor logs in or out of the website. - # - # This should be the same identifier as - # {::Google::Cloud::Retail::V2::UserEvent#visitor_id UserEvent.visitor_id}. - # - # The field must be a UTF-8 encoded string with a length limit of 128 - # characters. Otherwise, an INVALID_ARGUMENT error is returned. - # @param user_info [::Google::Cloud::Retail::V2::UserInfo, ::Hash] - # Optional. User information. - # @param conversational_filtering_spec [::Google::Cloud::Retail::V2::ConversationalSearchRequest::ConversationalFilteringSpec, ::Hash] - # Optional. This field specifies all conversational filtering related - # parameters. - # @param user_labels [::Hash{::String => ::String}] - # Optional. The user labels applied to a resource must meet the following - # requirements: - # - # * Each resource can have multiple labels, up to a maximum of 64. - # * Each label must be a key-value pair. - # * Keys have a minimum length of 1 character and a maximum length of 63 - # characters and cannot be empty. Values can be empty and have a maximum - # length of 63 characters. - # * Keys and values can contain only lowercase letters, numeric characters, - # underscores, and dashes. All characters must use UTF-8 encoding, and - # international characters are allowed. - # * The key portion of a label must be unique. However, you can use the same - # key with multiple resources. - # * Keys must start with a lowercase letter or international character. - # - # See [Google Cloud - # Document](https://cloud.google.com/resource-manager/docs/creating-managing-labels#requirements) - # for more details. - # @param safety_settings [::Array<::Google::Cloud::Retail::V2::SafetySetting, ::Hash>] - # Optional. The safety settings to be applied to the generated content. - # @return [::Enumerable<::Google::Cloud::Retail::V2::ConversationalSearchResponse>] - # - # @raise [::Google::Cloud::Error] if the REST call is aborted. - # - # @example Basic example - # require "google/cloud/retail/v2" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Retail::V2::ConversationalSearchService::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Retail::V2::ConversationalSearchRequest.new - # - # # Call the conversational_search method to start streaming. - # output = client.conversational_search request - # - # # The returned object is a streamed enumerable yielding elements of type - # # ::Google::Cloud::Retail::V2::ConversationalSearchResponse - # output.each do |current_response| - # p current_response - # end - # - def conversational_search request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Retail::V2::ConversationalSearchRequest - - # Converts hash 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.conversational_search.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::Retail::V2::VERSION, - transports_version_send: [:rest] - - call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - options.apply_defaults timeout: @config.rpcs.conversational_search.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.conversational_search.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - ::Gapic::Rest::ServerStream.new( - ::Google::Cloud::Retail::V2::ConversationalSearchResponse, - ::Gapic::Rest::ThreadedEnumerator.new do |in_q, out_q| - @conversational_search_service_stub.conversational_search request, options do |chunk| - in_q.deq - out_q.enq chunk - end - end - ) - rescue ::Gapic::Rest::Error => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Configuration class for the ConversationalSearchService REST API. - # - # This class represents the configuration for ConversationalSearchService REST, - # providing control over timeouts, retry behavior, logging, transport - # parameters, and other low-level controls. Certain parameters can also be - # applied individually to specific RPCs. See - # {::Google::Cloud::Retail::V2::ConversationalSearchService::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 - # # conversational_search to 20 seconds, - # # and all remaining timeouts to 10 seconds. - # ::Google::Cloud::Retail::V2::ConversationalSearchService::Rest::Client.configure do |config| - # config.timeout = 10.0 - # config.rpcs.conversational_search.timeout = 20.0 - # end - # - # # Apply the above configuration only to a new client. - # client = ::Google::Cloud::Retail::V2::ConversationalSearchService::Rest::Client.new do |config| - # config.timeout = 10.0 - # config.rpcs.conversational_search.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 = "retail.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 ConversationalSearchService 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 `conversational_search` - # @return [::Gapic::Config::Method] - # - attr_reader :conversational_search - - # @private - def initialize parent_rpcs = nil - conversational_search_config = parent_rpcs.conversational_search if parent_rpcs.respond_to? :conversational_search - @conversational_search = ::Gapic::Config::Method.new conversational_search_config - - yield self if block_given? - end - end - end - end - end - end - end - end - end -end diff --git a/owl-bot-staging/google-cloud-retail-v2/lib/google/cloud/retail/v2/conversational_search_service/rest/service_stub.rb b/owl-bot-staging/google-cloud-retail-v2/lib/google/cloud/retail/v2/conversational_search_service/rest/service_stub.rb deleted file mode 100644 index 45338f592c0b..000000000000 --- a/owl-bot-staging/google-cloud-retail-v2/lib/google/cloud/retail/v2/conversational_search_service/rest/service_stub.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! - -require "google/cloud/retail/v2/conversational_search_service_pb" - -module Google - module Cloud - module Retail - module V2 - module ConversationalSearchService - module Rest - ## - # REST service stub for the ConversationalSearchService 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 conversational_search REST call - # - # @param request_pb [::Google::Cloud::Retail::V2::ConversationalSearchRequest] - # 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. - # - # @yieldparam chunk [::String] The chunk of data received during server streaming. - # - # @return [::Gapic::Rest::TransportOperation] - def conversational_search(request_pb, options = nil, &) - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_conversational_search_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: "conversational_search", - options: options, - is_server_streaming: true, - & - ) - ::Gapic::Rest::TransportOperation.new response - end - - ## - # @private - # - # GRPC transcoding helper method for the conversational_search REST call - # - # @param request_pb [::Google::Cloud::Retail::V2::ConversationalSearchRequest] - # A request object representing the call parameters. Required. - # @return [Array(String, [String, nil], Hash{String => String})] - # Uri, Body, Query string parameters - def self.transcode_conversational_search_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :post, - uri_template: "/v2/{placement}:conversationalSearch", - body: "*", - matches: [ - ["placement", %r{^projects/[^/]+/locations/[^/]+/catalogs/[^/]+/placements/[^/]+/?$}, false] - ] - ) - .with_bindings( - uri_method: :post, - uri_template: "/v2/{placement}:conversationalSearch", - body: "*", - matches: [ - ["placement", %r{^projects/[^/]+/locations/[^/]+/catalogs/[^/]+/servingConfigs/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - end - end - end - end - end - end -end diff --git a/owl-bot-staging/google-cloud-retail-v2/lib/google/cloud/retail/v2/conversational_search_service_pb.rb b/owl-bot-staging/google-cloud-retail-v2/lib/google/cloud/retail/v2/conversational_search_service_pb.rb deleted file mode 100644 index 9bdaad5fdf84..000000000000 --- a/owl-bot-staging/google-cloud-retail-v2/lib/google/cloud/retail/v2/conversational_search_service_pb.rb +++ /dev/null @@ -1,41 +0,0 @@ -# frozen_string_literal: true -# Generated by the protocol buffer compiler. DO NOT EDIT! -# source: google/cloud/retail/v2/conversational_search_service.proto - -require 'google/protobuf' - -require 'google/api/annotations_pb' -require 'google/api/client_pb' -require 'google/api/field_behavior_pb' -require 'google/api/resource_pb' -require 'google/cloud/retail/v2/common_pb' -require 'google/cloud/retail/v2/safety_pb' -require 'google/cloud/retail/v2/search_service_pb' - - -descriptor_data = "\n:google/cloud/retail/v2/conversational_search_service.proto\x12\x16google.cloud.retail.v2\x1a\x1cgoogle/api/annotations.proto\x1a\x17google/api/client.proto\x1a\x1fgoogle/api/field_behavior.proto\x1a\x19google/api/resource.proto\x1a#google/cloud/retail/v2/common.proto\x1a#google/cloud/retail/v2/safety.proto\x1a+google/cloud/retail/v2/search_service.proto\"\xef\x0b\n\x1b\x43onversationalSearchRequest\x12\x16\n\tplacement\x18\x01 \x01(\tB\x03\xe0\x41\x02\x12\x34\n\x06\x62ranch\x18\x02 \x01(\tB$\xe0\x41\x02\xfa\x41\x1e\n\x1cretail.googleapis.com/Branch\x12\x12\n\x05query\x18\x03 \x01(\tB\x03\xe0\x41\x01\x12\x1c\n\x0fpage_categories\x18\x04 \x03(\tB\x03\xe0\x41\x01\x12\x1c\n\x0f\x63onversation_id\x18\x05 \x01(\tB\x03\xe0\x41\x01\x12\\\n\rsearch_params\x18\x06 \x01(\x0b\x32@.google.cloud.retail.v2.ConversationalSearchRequest.SearchParamsB\x03\xe0\x41\x01\x12\x17\n\nvisitor_id\x18\t \x01(\tB\x03\xe0\x41\x02\x12\x38\n\tuser_info\x18\x07 \x01(\x0b\x32 .google.cloud.retail.v2.UserInfoB\x03\xe0\x41\x01\x12{\n\x1d\x63onversational_filtering_spec\x18\x08 \x01(\x0b\x32O.google.cloud.retail.v2.ConversationalSearchRequest.ConversationalFilteringSpecB\x03\xe0\x41\x01\x12]\n\x0buser_labels\x18\x0c \x03(\x0b\x32\x43.google.cloud.retail.v2.ConversationalSearchRequest.UserLabelsEntryB\x03\xe0\x41\x01\x12\x43\n\x0fsafety_settings\x18\x0e \x03(\x0b\x32%.google.cloud.retail.v2.SafetySettingB\x03\xe0\x41\x01\x1a\xa2\x01\n\x0cSearchParams\x12\x13\n\x06\x66ilter\x18\x01 \x01(\tB\x03\xe0\x41\x01\x12\x1d\n\x10\x63\x61nonical_filter\x18\x02 \x01(\tB\x03\xe0\x41\x01\x12\x14\n\x07sort_by\x18\x03 \x01(\tB\x03\xe0\x41\x01\x12H\n\nboost_spec\x18\x04 \x01(\x0b\x32/.google.cloud.retail.v2.SearchRequest.BoostSpecB\x03\xe0\x41\x01\x1a\x81\x02\n\nUserAnswer\x12\x15\n\x0btext_answer\x18\x01 \x01(\tH\x00\x12m\n\x0fselected_answer\x18\x02 \x01(\x0b\x32M.google.cloud.retail.v2.ConversationalSearchRequest.UserAnswer.SelectedAnswerB\x03\xe0\x41\x01H\x00\x1a\x65\n\x0eSelectedAnswer\x12S\n\x17product_attribute_value\x18\x01 \x01(\x0b\x32-.google.cloud.retail.v2.ProductAttributeValueB\x03\xe0\x41\x01\x42\x06\n\x04type\x1a\x83\x03\n\x1b\x43onversationalFilteringSpec\x12.\n\x1f\x65nable_conversational_filtering\x18\x01 \x01(\x08\x42\x05\x18\x01\xe0\x41\x01\x12X\n\x0buser_answer\x18\x02 \x01(\x0b\x32>.google.cloud.retail.v2.ConversationalSearchRequest.UserAnswerB\x03\xe0\x41\x01\x12\x80\x01\n\x1d\x63onversational_filtering_mode\x18\x04 \x01(\x0e\x32T.google.cloud.retail.v2.ConversationalSearchRequest.ConversationalFilteringSpec.ModeB\x03\xe0\x41\x01\"W\n\x04Mode\x12\x14\n\x10MODE_UNSPECIFIED\x10\x00\x12\x0c\n\x08\x44ISABLED\x10\x01\x12\x0b\n\x07\x45NABLED\x10\x02\x12\x1e\n\x1a\x43ONVERSATIONAL_FILTER_ONLY\x10\x03\x1a\x31\n\x0fUserLabelsEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12\r\n\x05value\x18\x02 \x01(\t:\x02\x38\x01\"\xcd\t\n\x1c\x43onversationalSearchResponse\x12\x18\n\x10user_query_types\x18\n \x03(\t\x12$\n\x1c\x63onversational_text_response\x18\x02 \x01(\t\x12`\n\x11\x66ollowup_question\x18\x03 \x01(\x0b\x32\x45.google.cloud.retail.v2.ConversationalSearchResponse.FollowupQuestion\x12\x17\n\x0f\x63onversation_id\x18\x04 \x01(\t\x12Z\n\x0erefined_search\x18\x06 \x03(\x0b\x32\x42.google.cloud.retail.v2.ConversationalSearchResponse.RefinedSearch\x12{\n\x1f\x63onversational_filtering_result\x18\x07 \x01(\x0b\x32R.google.cloud.retail.v2.ConversationalSearchResponse.ConversationalFilteringResult\x12N\n\x05state\x18\t \x01(\x0e\x32:.google.cloud.retail.v2.ConversationalSearchResponse.StateB\x03\xe0\x41\x03\x1a\x82\x02\n\x10\x46ollowupQuestion\x12\x19\n\x11\x66ollowup_question\x18\x01 \x01(\t\x12p\n\x11suggested_answers\x18\x02 \x03(\x0b\x32U.google.cloud.retail.v2.ConversationalSearchResponse.FollowupQuestion.SuggestedAnswer\x1a\x61\n\x0fSuggestedAnswer\x12N\n\x17product_attribute_value\x18\x01 \x01(\x0b\x32-.google.cloud.retail.v2.ProductAttributeValue\x1a\x1e\n\rRefinedSearch\x12\r\n\x05query\x18\x01 \x01(\t\x1a\xe5\x02\n\x1d\x43onversationalFilteringResult\x12`\n\x11\x66ollowup_question\x18\x01 \x01(\x0b\x32\x45.google.cloud.retail.v2.ConversationalSearchResponse.FollowupQuestion\x12~\n\x11\x61\x64\x64itional_filter\x18\x02 \x01(\x0b\x32\x63.google.cloud.retail.v2.ConversationalSearchResponse.ConversationalFilteringResult.AdditionalFilter\x1a\x62\n\x10\x41\x64\x64itionalFilter\x12N\n\x17product_attribute_value\x18\x01 \x01(\x0b\x32-.google.cloud.retail.v2.ProductAttributeValue\"<\n\x05State\x12\x15\n\x11STATE_UNSPECIFIED\x10\x00\x12\r\n\tSTREAMING\x10\x01\x12\r\n\tSUCCEEDED\x10\x02\x32\xae\x03\n\x1b\x43onversationalSearchService\x12\xc3\x02\n\x14\x43onversationalSearch\x12\x33.google.cloud.retail.v2.ConversationalSearchRequest\x1a\x34.google.cloud.retail.v2.ConversationalSearchResponse\"\xbd\x01\x82\xd3\xe4\x93\x02\xb6\x01\"S/v2/{placement=projects/*/locations/*/catalogs/*/placements/*}:conversationalSearch:\x01*Z\\\"W/v2/{placement=projects/*/locations/*/catalogs/*/servingConfigs/*}:conversationalSearch:\x01*0\x01\x1aI\xca\x41\x15retail.googleapis.com\xd2\x41.https://www.googleapis.com/auth/cloud-platformB\xcb\x01\n\x1a\x63om.google.cloud.retail.v2B ConversationalSearchServiceProtoP\x01Z2cloud.google.com/go/retail/apiv2/retailpb;retailpb\xa2\x02\x06RETAIL\xaa\x02\x16Google.Cloud.Retail.V2\xca\x02\x16Google\\Cloud\\Retail\\V2\xea\x02\x19Google::Cloud::Retail::V2b\x06proto3" - -pool = ::Google::Protobuf::DescriptorPool.generated_pool -pool.add_serialized_file(descriptor_data) - -module Google - module Cloud - module Retail - module V2 - ConversationalSearchRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.retail.v2.ConversationalSearchRequest").msgclass - ConversationalSearchRequest::SearchParams = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.retail.v2.ConversationalSearchRequest.SearchParams").msgclass - ConversationalSearchRequest::UserAnswer = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.retail.v2.ConversationalSearchRequest.UserAnswer").msgclass - ConversationalSearchRequest::UserAnswer::SelectedAnswer = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.retail.v2.ConversationalSearchRequest.UserAnswer.SelectedAnswer").msgclass - ConversationalSearchRequest::ConversationalFilteringSpec = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.retail.v2.ConversationalSearchRequest.ConversationalFilteringSpec").msgclass - ConversationalSearchRequest::ConversationalFilteringSpec::Mode = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.retail.v2.ConversationalSearchRequest.ConversationalFilteringSpec.Mode").enummodule - ConversationalSearchResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.retail.v2.ConversationalSearchResponse").msgclass - ConversationalSearchResponse::FollowupQuestion = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.retail.v2.ConversationalSearchResponse.FollowupQuestion").msgclass - ConversationalSearchResponse::FollowupQuestion::SuggestedAnswer = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.retail.v2.ConversationalSearchResponse.FollowupQuestion.SuggestedAnswer").msgclass - ConversationalSearchResponse::RefinedSearch = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.retail.v2.ConversationalSearchResponse.RefinedSearch").msgclass - ConversationalSearchResponse::ConversationalFilteringResult = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.retail.v2.ConversationalSearchResponse.ConversationalFilteringResult").msgclass - ConversationalSearchResponse::ConversationalFilteringResult::AdditionalFilter = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.retail.v2.ConversationalSearchResponse.ConversationalFilteringResult.AdditionalFilter").msgclass - ConversationalSearchResponse::State = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.retail.v2.ConversationalSearchResponse.State").enummodule - end - end - end -end diff --git a/owl-bot-staging/google-cloud-retail-v2/lib/google/cloud/retail/v2/conversational_search_service_services_pb.rb b/owl-bot-staging/google-cloud-retail-v2/lib/google/cloud/retail/v2/conversational_search_service_services_pb.rb deleted file mode 100644 index f89ba3e94889..000000000000 --- a/owl-bot-staging/google-cloud-retail-v2/lib/google/cloud/retail/v2/conversational_search_service_services_pb.rb +++ /dev/null @@ -1,52 +0,0 @@ -# Generated by the protocol buffer compiler. DO NOT EDIT! -# Source: google/cloud/retail/v2/conversational_search_service.proto for package 'Google.Cloud.Retail.V2' -# Original file comments: -# 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 -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. -# - -require 'grpc' -require 'google/cloud/retail/v2/conversational_search_service_pb' - -module Google - module Cloud - module Retail - module V2 - module ConversationalSearchService - # Service for retail conversational search. - # - # This feature is only available for users who have Retail Conversational - # Search enabled. Enable Retail Conversational Search on Cloud Console - # before using this feature. - class Service - - include ::GRPC::GenericService - - self.marshal_class_method = :encode - self.unmarshal_class_method = :decode - self.service_name = 'google.cloud.retail.v2.ConversationalSearchService' - - # Performs a conversational search. - # - # This feature is only available for users who have Conversational Search - # enabled. - rpc :ConversationalSearch, ::Google::Cloud::Retail::V2::ConversationalSearchRequest, stream(::Google::Cloud::Retail::V2::ConversationalSearchResponse) - end - - Stub = Service.rpc_stub_class - end - end - end - end -end diff --git a/owl-bot-staging/google-cloud-retail-v2/lib/google/cloud/retail/v2/export_config_pb.rb b/owl-bot-staging/google-cloud-retail-v2/lib/google/cloud/retail/v2/export_config_pb.rb deleted file mode 100644 index 0799bfb12534..000000000000 --- a/owl-bot-staging/google-cloud-retail-v2/lib/google/cloud/retail/v2/export_config_pb.rb +++ /dev/null @@ -1,35 +0,0 @@ -# frozen_string_literal: true -# Generated by the protocol buffer compiler. DO NOT EDIT! -# source: google/cloud/retail/v2/export_config.proto - -require 'google/protobuf' - -require 'google/api/field_behavior_pb' -require 'google/api/resource_pb' -require 'google/protobuf/timestamp_pb' -require 'google/rpc/status_pb' - - -descriptor_data = "\n*google/cloud/retail/v2/export_config.proto\x12\x16google.cloud.retail.v2\x1a\x1fgoogle/api/field_behavior.proto\x1a\x19google/api/resource.proto\x1a\x1fgoogle/protobuf/timestamp.proto\x1a\x17google/rpc/status.proto\"\xe0\x02\n\x0cOutputConfig\x12N\n\x0fgcs_destination\x18\x01 \x01(\x0b\x32\x33.google.cloud.retail.v2.OutputConfig.GcsDestinationH\x00\x12X\n\x14\x62igquery_destination\x18\x02 \x01(\x0b\x32\x38.google.cloud.retail.v2.OutputConfig.BigQueryDestinationH\x00\x1a\x30\n\x0eGcsDestination\x12\x1e\n\x11output_uri_prefix\x18\x01 \x01(\tB\x03\xe0\x41\x02\x1a\x65\n\x13\x42igQueryDestination\x12\x17\n\ndataset_id\x18\x01 \x01(\tB\x03\xe0\x41\x02\x12\x1c\n\x0ftable_id_prefix\x18\x02 \x01(\tB\x03\xe0\x41\x02\x12\x17\n\ntable_type\x18\x03 \x01(\tB\x03\xe0\x41\x02\x42\r\n\x0b\x64\x65stination\"9\n\x12\x45xportErrorsConfig\x12\x14\n\ngcs_prefix\x18\x01 \x01(\tH\x00\x42\r\n\x0b\x64\x65stination\"\x87\x01\n\x1d\x45xportAnalyticsMetricsRequest\x12\x14\n\x07\x63\x61talog\x18\x01 \x01(\tB\x03\xe0\x41\x02\x12@\n\routput_config\x18\x02 \x01(\x0b\x32$.google.cloud.retail.v2.OutputConfigB\x03\xe0\x41\x02\x12\x0e\n\x06\x66ilter\x18\x03 \x01(\t\"r\n\x0e\x45xportMetadata\x12/\n\x0b\x63reate_time\x18\x01 \x01(\x0b\x32\x1a.google.protobuf.Timestamp\x12/\n\x0bupdate_time\x18\x02 \x01(\x0b\x32\x1a.google.protobuf.Timestamp\"\xcb\x01\n\x1e\x45xportAnalyticsMetricsResponse\x12)\n\rerror_samples\x18\x01 \x03(\x0b\x32\x12.google.rpc.Status\x12\x41\n\rerrors_config\x18\x02 \x01(\x0b\x32*.google.cloud.retail.v2.ExportErrorsConfig\x12;\n\routput_result\x18\x03 \x01(\x0b\x32$.google.cloud.retail.v2.OutputResult\"\x92\x01\n\x0cOutputResult\x12\x45\n\x0f\x62igquery_result\x18\x01 \x03(\x0b\x32,.google.cloud.retail.v2.BigQueryOutputResult\x12;\n\ngcs_result\x18\x02 \x03(\x0b\x32\'.google.cloud.retail.v2.GcsOutputResult\"<\n\x14\x42igQueryOutputResult\x12\x12\n\ndataset_id\x18\x01 \x01(\t\x12\x10\n\x08table_id\x18\x02 \x01(\t\"%\n\x0fGcsOutputResult\x12\x12\n\noutput_uri\x18\x01 \x01(\tB\xbc\x01\n\x1a\x63om.google.cloud.retail.v2B\x11\x45xportConfigProtoP\x01Z2cloud.google.com/go/retail/apiv2/retailpb;retailpb\xa2\x02\x06RETAIL\xaa\x02\x16Google.Cloud.Retail.V2\xca\x02\x16Google\\Cloud\\Retail\\V2\xea\x02\x19Google::Cloud::Retail::V2b\x06proto3" - -pool = ::Google::Protobuf::DescriptorPool.generated_pool -pool.add_serialized_file(descriptor_data) - -module Google - module Cloud - module Retail - module V2 - OutputConfig = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.retail.v2.OutputConfig").msgclass - OutputConfig::GcsDestination = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.retail.v2.OutputConfig.GcsDestination").msgclass - OutputConfig::BigQueryDestination = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.retail.v2.OutputConfig.BigQueryDestination").msgclass - ExportErrorsConfig = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.retail.v2.ExportErrorsConfig").msgclass - ExportAnalyticsMetricsRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.retail.v2.ExportAnalyticsMetricsRequest").msgclass - ExportMetadata = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.retail.v2.ExportMetadata").msgclass - ExportAnalyticsMetricsResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.retail.v2.ExportAnalyticsMetricsResponse").msgclass - OutputResult = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.retail.v2.OutputResult").msgclass - BigQueryOutputResult = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.retail.v2.BigQueryOutputResult").msgclass - GcsOutputResult = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.retail.v2.GcsOutputResult").msgclass - end - end - end -end diff --git a/owl-bot-staging/google-cloud-retail-v2/lib/google/cloud/retail/v2/generative_question_pb.rb b/owl-bot-staging/google-cloud-retail-v2/lib/google/cloud/retail/v2/generative_question_pb.rb deleted file mode 100644 index 39063cf59e06..000000000000 --- a/owl-bot-staging/google-cloud-retail-v2/lib/google/cloud/retail/v2/generative_question_pb.rb +++ /dev/null @@ -1,24 +0,0 @@ -# frozen_string_literal: true -# Generated by the protocol buffer compiler. DO NOT EDIT! -# source: google/cloud/retail/v2/generative_question.proto - -require 'google/protobuf' - -require 'google/api/field_behavior_pb' - - -descriptor_data = "\n0google/cloud/retail/v2/generative_question.proto\x12\x16google.cloud.retail.v2\x1a\x1fgoogle/api/field_behavior.proto\"u\n GenerativeQuestionsFeatureConfig\x12\x14\n\x07\x63\x61talog\x18\x01 \x01(\tB\x03\xe0\x41\x02\x12\x1c\n\x0f\x66\x65\x61ture_enabled\x18\x02 \x01(\x08\x42\x03\xe0\x41\x01\x12\x1d\n\x10minimum_products\x18\x03 \x01(\x05\x42\x03\xe0\x41\x01\"\xdd\x01\n\x18GenerativeQuestionConfig\x12\x14\n\x07\x63\x61talog\x18\x01 \x01(\tB\x03\xe0\x41\x02\x12\x12\n\x05\x66\x61\x63\x65t\x18\x02 \x01(\tB\x03\xe0\x41\x02\x12\x1f\n\x12generated_question\x18\x03 \x01(\tB\x03\xe0\x41\x03\x12\x1b\n\x0e\x66inal_question\x18\x04 \x01(\tB\x03\xe0\x41\x01\x12\x1b\n\x0e\x65xample_values\x18\x05 \x03(\tB\x03\xe0\x41\x03\x12\x16\n\tfrequency\x18\x06 \x01(\x02\x42\x03\xe0\x41\x03\x12$\n\x17\x61llowed_in_conversation\x18\x07 \x01(\x08\x42\x03\xe0\x41\x01\x42\xc2\x01\n\x1a\x63om.google.cloud.retail.v2B\x17GenerativeQuestionProtoP\x01Z2cloud.google.com/go/retail/apiv2/retailpb;retailpb\xa2\x02\x06RETAIL\xaa\x02\x16Google.Cloud.Retail.V2\xca\x02\x16Google\\Cloud\\Retail\\V2\xea\x02\x19Google::Cloud::Retail::V2b\x06proto3" - -pool = ::Google::Protobuf::DescriptorPool.generated_pool -pool.add_serialized_file(descriptor_data) - -module Google - module Cloud - module Retail - module V2 - GenerativeQuestionsFeatureConfig = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.retail.v2.GenerativeQuestionsFeatureConfig").msgclass - GenerativeQuestionConfig = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.retail.v2.GenerativeQuestionConfig").msgclass - end - end - end -end diff --git a/owl-bot-staging/google-cloud-retail-v2/lib/google/cloud/retail/v2/generative_question_service.rb b/owl-bot-staging/google-cloud-retail-v2/lib/google/cloud/retail/v2/generative_question_service.rb deleted file mode 100644 index 820d713f4e45..000000000000 --- a/owl-bot-staging/google-cloud-retail-v2/lib/google/cloud/retail/v2/generative_question_service.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/retail/v2/version" - -require "google/cloud/retail/v2/generative_question_service/credentials" -require "google/cloud/retail/v2/generative_question_service/paths" -require "google/cloud/retail/v2/generative_question_service/client" -require "google/cloud/retail/v2/generative_question_service/rest" - -module Google - module Cloud - module Retail - module V2 - ## - # Service for managing LLM generated questions in search serving. - # - # @example Load this service and instantiate a gRPC client - # - # require "google/cloud/retail/v2/generative_question_service" - # client = ::Google::Cloud::Retail::V2::GenerativeQuestionService::Client.new - # - # @example Load this service and instantiate a REST client - # - # require "google/cloud/retail/v2/generative_question_service/rest" - # client = ::Google::Cloud::Retail::V2::GenerativeQuestionService::Rest::Client.new - # - module GenerativeQuestionService - end - end - end - end -end - -helper_path = ::File.join __dir__, "generative_question_service", "helpers.rb" -require "google/cloud/retail/v2/generative_question_service/helpers" if ::File.file? helper_path diff --git a/owl-bot-staging/google-cloud-retail-v2/lib/google/cloud/retail/v2/generative_question_service/client.rb b/owl-bot-staging/google-cloud-retail-v2/lib/google/cloud/retail/v2/generative_question_service/client.rb deleted file mode 100644 index 9167224e564f..000000000000 --- a/owl-bot-staging/google-cloud-retail-v2/lib/google/cloud/retail/v2/generative_question_service/client.rb +++ /dev/null @@ -1,877 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -require "google/cloud/errors" -require "google/cloud/retail/v2/generative_question_service_pb" -require "google/cloud/location" - -module Google - module Cloud - module Retail - module V2 - module GenerativeQuestionService - ## - # Client for the GenerativeQuestionService service. - # - # Service for managing LLM generated questions in search serving. - # - class Client - # @private - API_VERSION = "" - - # @private - DEFAULT_ENDPOINT_TEMPLATE = "retail.$UNIVERSE_DOMAIN$" - - include Paths - - # @private - attr_reader :generative_question_service_stub - - ## - # Configure the GenerativeQuestionService Client class. - # - # See {::Google::Cloud::Retail::V2::GenerativeQuestionService::Client::Configuration} - # for a description of the configuration fields. - # - # @example - # - # # Modify the configuration for all GenerativeQuestionService clients - # ::Google::Cloud::Retail::V2::GenerativeQuestionService::Client.configure do |config| - # config.timeout = 10.0 - # end - # - # @yield [config] Configure the Client client. - # @yieldparam config [Client::Configuration] - # - # @return [Client::Configuration] - # - def self.configure - @configure ||= begin - namespace = ["Google", "Cloud", "Retail", "V2"] - parent_config = while namespace.any? - parent_name = namespace.join "::" - parent_const = const_get parent_name - break parent_const.configure if parent_const.respond_to? :configure - namespace.pop - end - default_config = Client::Configuration.new parent_config - - default_config - end - yield @configure if block_given? - @configure - end - - ## - # Configure the GenerativeQuestionService Client instance. - # - # The configuration is set to the derived mode, meaning that values can be changed, - # but structural changes (adding new fields, etc.) are not allowed. Structural changes - # should be made on {Client.configure}. - # - # See {::Google::Cloud::Retail::V2::GenerativeQuestionService::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 - @generative_question_service_stub.universe_domain - end - - ## - # Create a new GenerativeQuestionService client object. - # - # @example - # - # # Create a client using the default configuration - # client = ::Google::Cloud::Retail::V2::GenerativeQuestionService::Client.new - # - # # Create a client using a custom configuration - # client = ::Google::Cloud::Retail::V2::GenerativeQuestionService::Client.new do |config| - # config.timeout = 10.0 - # end - # - # @yield [config] Configure the GenerativeQuestionService client. - # @yieldparam config [Client::Configuration] - # - def initialize - # These require statements are intentionally placed here to initialize - # the gRPC module only when it's required. - # See https://github.com/googleapis/toolkit/issues/446 - require "gapic/grpc" - require "google/cloud/retail/v2/generative_question_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 - - @generative_question_service_stub = ::Gapic::ServiceStub.new( - ::Google::Cloud::Retail::V2::GenerativeQuestionService::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 - ) - - @generative_question_service_stub.stub_logger&.info do |entry| - entry.set_system_name - entry.set_service - entry.message = "Created client for #{entry.service}" - entry.set_credentials_fields credentials - entry.set "customEndpoint", @config.endpoint if @config.endpoint - entry.set "defaultTimeout", @config.timeout if @config.timeout - entry.set "quotaProject", @quota_project_id if @quota_project_id - end - - @location_client = Google::Cloud::Location::Locations::Client.new do |config| - config.credentials = credentials - config.quota_project = @quota_project_id - config.endpoint = @generative_question_service_stub.endpoint - config.universe_domain = @generative_question_service_stub.universe_domain - config.logger = @generative_question_service_stub.logger if config.respond_to? :logger= - end - end - - ## - # Get the associated client for mix-in of the Locations. - # - # @return [Google::Cloud::Location::Locations::Client] - # - attr_reader :location_client - - ## - # The logger used for request/response debug logging. - # - # @return [Logger] - # - def logger - @generative_question_service_stub.logger - end - - # Service calls - - ## - # Manages overal generative question feature state -- enables toggling - # feature on and off. - # - # @overload update_generative_questions_feature_config(request, options = nil) - # Pass arguments to `update_generative_questions_feature_config` via a request object, either of type - # {::Google::Cloud::Retail::V2::UpdateGenerativeQuestionsFeatureConfigRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Retail::V2::UpdateGenerativeQuestionsFeatureConfigRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_generative_questions_feature_config(generative_questions_feature_config: nil, update_mask: nil) - # Pass arguments to `update_generative_questions_feature_config` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param generative_questions_feature_config [::Google::Cloud::Retail::V2::GenerativeQuestionsFeatureConfig, ::Hash] - # Required. The configuration managing the feature state. - # @param update_mask [::Google::Protobuf::FieldMask, ::Hash] - # Optional. Indicates which fields in the provided - # {::Google::Cloud::Retail::V2::GenerativeQuestionsFeatureConfig GenerativeQuestionsFeatureConfig} - # to update. If not set or empty, all supported fields are updated. - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Google::Cloud::Retail::V2::GenerativeQuestionsFeatureConfig] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Google::Cloud::Retail::V2::GenerativeQuestionsFeatureConfig] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/cloud/retail/v2" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Retail::V2::GenerativeQuestionService::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Retail::V2::UpdateGenerativeQuestionsFeatureConfigRequest.new - # - # # Call the update_generative_questions_feature_config method. - # result = client.update_generative_questions_feature_config request - # - # # The returned object is of type Google::Cloud::Retail::V2::GenerativeQuestionsFeatureConfig. - # p result - # - def update_generative_questions_feature_config request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Retail::V2::UpdateGenerativeQuestionsFeatureConfigRequest - - # Converts hash 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_generative_questions_feature_config.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::Retail::V2::VERSION - metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - header_params = {} - if request.generative_questions_feature_config&.catalog - header_params["generative_questions_feature_config.catalog"] = request.generative_questions_feature_config.catalog - 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_generative_questions_feature_config.timeout, - metadata: metadata, - retry_policy: @config.rpcs.update_generative_questions_feature_config.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @generative_question_service_stub.call_rpc :update_generative_questions_feature_config, request, options: options do |response, operation| - yield response, operation if block_given? - end - rescue ::GRPC::BadStatus => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Manages overal generative question feature state -- enables toggling - # feature on and off. - # - # @overload get_generative_questions_feature_config(request, options = nil) - # Pass arguments to `get_generative_questions_feature_config` via a request object, either of type - # {::Google::Cloud::Retail::V2::GetGenerativeQuestionsFeatureConfigRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Retail::V2::GetGenerativeQuestionsFeatureConfigRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_generative_questions_feature_config(catalog: nil) - # Pass arguments to `get_generative_questions_feature_config` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param catalog [::String] - # Required. Resource name of the parent catalog. - # Format: projects/\\{project}/locations/\\{location}/catalogs/\\{catalog} - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Google::Cloud::Retail::V2::GenerativeQuestionsFeatureConfig] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Google::Cloud::Retail::V2::GenerativeQuestionsFeatureConfig] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/cloud/retail/v2" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Retail::V2::GenerativeQuestionService::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Retail::V2::GetGenerativeQuestionsFeatureConfigRequest.new - # - # # Call the get_generative_questions_feature_config method. - # result = client.get_generative_questions_feature_config request - # - # # The returned object is of type Google::Cloud::Retail::V2::GenerativeQuestionsFeatureConfig. - # p result - # - def get_generative_questions_feature_config request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Retail::V2::GetGenerativeQuestionsFeatureConfigRequest - - # Converts hash 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_generative_questions_feature_config.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::Retail::V2::VERSION - metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - header_params = {} - if request.catalog - header_params["catalog"] = request.catalog - 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_generative_questions_feature_config.timeout, - metadata: metadata, - retry_policy: @config.rpcs.get_generative_questions_feature_config.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @generative_question_service_stub.call_rpc :get_generative_questions_feature_config, request, options: options do |response, operation| - yield response, operation if block_given? - end - rescue ::GRPC::BadStatus => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Returns all questions for a given catalog. - # - # @overload list_generative_question_configs(request, options = nil) - # Pass arguments to `list_generative_question_configs` via a request object, either of type - # {::Google::Cloud::Retail::V2::ListGenerativeQuestionConfigsRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Retail::V2::ListGenerativeQuestionConfigsRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_generative_question_configs(parent: nil) - # Pass arguments to `list_generative_question_configs` via keyword arguments. Note that at - # least one keyword argument is 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. Resource name of the parent catalog. - # Format: projects/\\{project}/locations/\\{location}/catalogs/\\{catalog} - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Google::Cloud::Retail::V2::ListGenerativeQuestionConfigsResponse] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Google::Cloud::Retail::V2::ListGenerativeQuestionConfigsResponse] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/cloud/retail/v2" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Retail::V2::GenerativeQuestionService::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Retail::V2::ListGenerativeQuestionConfigsRequest.new - # - # # Call the list_generative_question_configs method. - # result = client.list_generative_question_configs request - # - # # The returned object is of type Google::Cloud::Retail::V2::ListGenerativeQuestionConfigsResponse. - # p result - # - def list_generative_question_configs request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Retail::V2::ListGenerativeQuestionConfigsRequest - - # Converts hash 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_generative_question_configs.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::Retail::V2::VERSION - metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - header_params = {} - if request.parent - 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_generative_question_configs.timeout, - metadata: metadata, - retry_policy: @config.rpcs.list_generative_question_configs.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @generative_question_service_stub.call_rpc :list_generative_question_configs, 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 - - ## - # Allows management of individual questions. - # - # @overload update_generative_question_config(request, options = nil) - # Pass arguments to `update_generative_question_config` via a request object, either of type - # {::Google::Cloud::Retail::V2::UpdateGenerativeQuestionConfigRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Retail::V2::UpdateGenerativeQuestionConfigRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_generative_question_config(generative_question_config: nil, update_mask: nil) - # Pass arguments to `update_generative_question_config` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param generative_question_config [::Google::Cloud::Retail::V2::GenerativeQuestionConfig, ::Hash] - # Required. The question to update. - # @param update_mask [::Google::Protobuf::FieldMask, ::Hash] - # Optional. Indicates which fields in the provided - # {::Google::Cloud::Retail::V2::GenerativeQuestionConfig GenerativeQuestionConfig} - # to update. The following are NOT supported: - # - # * {::Google::Cloud::Retail::V2::GenerativeQuestionConfig#frequency GenerativeQuestionConfig.frequency} - # - # If not set or empty, all supported fields are updated. - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Google::Cloud::Retail::V2::GenerativeQuestionConfig] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Google::Cloud::Retail::V2::GenerativeQuestionConfig] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/cloud/retail/v2" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Retail::V2::GenerativeQuestionService::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Retail::V2::UpdateGenerativeQuestionConfigRequest.new - # - # # Call the update_generative_question_config method. - # result = client.update_generative_question_config request - # - # # The returned object is of type Google::Cloud::Retail::V2::GenerativeQuestionConfig. - # p result - # - def update_generative_question_config request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Retail::V2::UpdateGenerativeQuestionConfigRequest - - # Converts hash 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_generative_question_config.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::Retail::V2::VERSION - metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - header_params = {} - if request.generative_question_config&.catalog - header_params["generative_question_config.catalog"] = request.generative_question_config.catalog - 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_generative_question_config.timeout, - metadata: metadata, - retry_policy: @config.rpcs.update_generative_question_config.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @generative_question_service_stub.call_rpc :update_generative_question_config, request, options: options do |response, operation| - yield response, operation if block_given? - end - rescue ::GRPC::BadStatus => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Allows management of multiple questions. - # - # @overload batch_update_generative_question_configs(request, options = nil) - # Pass arguments to `batch_update_generative_question_configs` via a request object, either of type - # {::Google::Cloud::Retail::V2::BatchUpdateGenerativeQuestionConfigsRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Retail::V2::BatchUpdateGenerativeQuestionConfigsRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. - # - # @overload batch_update_generative_question_configs(parent: nil, requests: nil) - # Pass arguments to `batch_update_generative_question_configs` via keyword arguments. Note that at - # least one keyword argument is 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] - # Optional. Resource name of the parent catalog. - # Format: projects/\\{project}/locations/\\{location}/catalogs/\\{catalog} - # @param requests [::Array<::Google::Cloud::Retail::V2::UpdateGenerativeQuestionConfigRequest, ::Hash>] - # Required. The updates question configs. - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Google::Cloud::Retail::V2::BatchUpdateGenerativeQuestionConfigsResponse] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Google::Cloud::Retail::V2::BatchUpdateGenerativeQuestionConfigsResponse] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/cloud/retail/v2" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Retail::V2::GenerativeQuestionService::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Retail::V2::BatchUpdateGenerativeQuestionConfigsRequest.new - # - # # Call the batch_update_generative_question_configs method. - # result = client.batch_update_generative_question_configs request - # - # # The returned object is of type Google::Cloud::Retail::V2::BatchUpdateGenerativeQuestionConfigsResponse. - # p result - # - def batch_update_generative_question_configs request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Retail::V2::BatchUpdateGenerativeQuestionConfigsRequest - - # Converts hash 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.batch_update_generative_question_configs.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::Retail::V2::VERSION - metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - header_params = {} - if request.parent - 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.batch_update_generative_question_configs.timeout, - metadata: metadata, - retry_policy: @config.rpcs.batch_update_generative_question_configs.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @generative_question_service_stub.call_rpc :batch_update_generative_question_configs, request, options: options do |response, operation| - yield response, operation if block_given? - end - rescue ::GRPC::BadStatus => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Configuration class for the GenerativeQuestionService API. - # - # This class represents the configuration for GenerativeQuestionService, - # providing control over timeouts, retry behavior, logging, transport - # parameters, and other low-level controls. Certain parameters can also be - # applied individually to specific RPCs. See - # {::Google::Cloud::Retail::V2::GenerativeQuestionService::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 - # # update_generative_questions_feature_config to 20 seconds, - # # and all remaining timeouts to 10 seconds. - # ::Google::Cloud::Retail::V2::GenerativeQuestionService::Client.configure do |config| - # config.timeout = 10.0 - # config.rpcs.update_generative_questions_feature_config.timeout = 20.0 - # end - # - # # Apply the above configuration only to a new client. - # client = ::Google::Cloud::Retail::V2::GenerativeQuestionService::Client.new do |config| - # config.timeout = 10.0 - # config.rpcs.update_generative_questions_feature_config.timeout = 20.0 - # end - # - # @!attribute [rw] endpoint - # A custom service endpoint, as a hostname or hostname:port. The default is - # nil, indicating to use the default endpoint in the current universe domain. - # @return [::String,nil] - # @!attribute [rw] credentials - # Credentials to send with calls. You may provide any of the following types: - # * (`Google::Auth::Credentials`) A googleauth credentials object - # (see the [googleauth docs](https://rubydoc.info/gems/googleauth/Google/Auth/Credentials)) - # * (`Signet::OAuth2::Client`) A signet oauth2 client object - # (see the [signet docs](https://rubydoc.info/gems/signet/Signet/OAuth2/Client)) - # * (`GRPC::Core::Channel`) a gRPC channel with included credentials - # * (`GRPC::Core::ChannelCredentials`) a gRPC credentails object - # * (`nil`) indicating no credentials - # - # @note Warning: Passing a `String` to a keyfile path or a `Hash` of credentials - # is deprecated. Providing an unvalidated credential configuration to - # Google APIs can compromise the security of your systems and data. - # - # @example - # - # # The recommended way to provide credentials is to use the `make_creds` method - # # on the appropriate credentials class for your environment. - # - # require "googleauth" - # - # credentials = ::Google::Auth::ServiceAccountCredentials.make_creds( - # json_key_io: ::File.open("/path/to/keyfile.json") - # ) - # - # client = ::Google::Cloud::Retail::V2::GenerativeQuestionService::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 = "retail.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 GenerativeQuestionService 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 `update_generative_questions_feature_config` - # @return [::Gapic::Config::Method] - # - attr_reader :update_generative_questions_feature_config - ## - # RPC-specific configuration for `get_generative_questions_feature_config` - # @return [::Gapic::Config::Method] - # - attr_reader :get_generative_questions_feature_config - ## - # RPC-specific configuration for `list_generative_question_configs` - # @return [::Gapic::Config::Method] - # - attr_reader :list_generative_question_configs - ## - # RPC-specific configuration for `update_generative_question_config` - # @return [::Gapic::Config::Method] - # - attr_reader :update_generative_question_config - ## - # RPC-specific configuration for `batch_update_generative_question_configs` - # @return [::Gapic::Config::Method] - # - attr_reader :batch_update_generative_question_configs - - # @private - def initialize parent_rpcs = nil - update_generative_questions_feature_config_config = parent_rpcs.update_generative_questions_feature_config if parent_rpcs.respond_to? :update_generative_questions_feature_config - @update_generative_questions_feature_config = ::Gapic::Config::Method.new update_generative_questions_feature_config_config - get_generative_questions_feature_config_config = parent_rpcs.get_generative_questions_feature_config if parent_rpcs.respond_to? :get_generative_questions_feature_config - @get_generative_questions_feature_config = ::Gapic::Config::Method.new get_generative_questions_feature_config_config - list_generative_question_configs_config = parent_rpcs.list_generative_question_configs if parent_rpcs.respond_to? :list_generative_question_configs - @list_generative_question_configs = ::Gapic::Config::Method.new list_generative_question_configs_config - update_generative_question_config_config = parent_rpcs.update_generative_question_config if parent_rpcs.respond_to? :update_generative_question_config - @update_generative_question_config = ::Gapic::Config::Method.new update_generative_question_config_config - batch_update_generative_question_configs_config = parent_rpcs.batch_update_generative_question_configs if parent_rpcs.respond_to? :batch_update_generative_question_configs - @batch_update_generative_question_configs = ::Gapic::Config::Method.new batch_update_generative_question_configs_config - - yield self if block_given? - end - end - end - end - end - end - end - end -end diff --git a/owl-bot-staging/google-cloud-retail-v2/lib/google/cloud/retail/v2/generative_question_service/credentials.rb b/owl-bot-staging/google-cloud-retail-v2/lib/google/cloud/retail/v2/generative_question_service/credentials.rb deleted file mode 100644 index 15af3d895c06..000000000000 --- a/owl-bot-staging/google-cloud-retail-v2/lib/google/cloud/retail/v2/generative_question_service/credentials.rb +++ /dev/null @@ -1,51 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -require "googleauth" - -module Google - module Cloud - module Retail - module V2 - module GenerativeQuestionService - # Credentials for the GenerativeQuestionService API. - class Credentials < ::Google::Auth::Credentials - self.scope = [ - "https://www.googleapis.com/auth/cloud-platform" - ] - self.env_vars = [ - "RETAIL_CREDENTIALS", - "RETAIL_KEYFILE", - "GOOGLE_CLOUD_CREDENTIALS", - "GOOGLE_CLOUD_KEYFILE", - "GCLOUD_KEYFILE", - "RETAIL_CREDENTIALS_JSON", - "RETAIL_KEYFILE_JSON", - "GOOGLE_CLOUD_CREDENTIALS_JSON", - "GOOGLE_CLOUD_KEYFILE_JSON", - "GCLOUD_KEYFILE_JSON" - ] - self.paths = [ - "~/.config/google_cloud/application_default_credentials.json" - ] - end - end - end - end - end -end diff --git a/owl-bot-staging/google-cloud-retail-v2/lib/google/cloud/retail/v2/generative_question_service/paths.rb b/owl-bot-staging/google-cloud-retail-v2/lib/google/cloud/retail/v2/generative_question_service/paths.rb deleted file mode 100644 index a01a45d7d88f..000000000000 --- a/owl-bot-staging/google-cloud-retail-v2/lib/google/cloud/retail/v2/generative_question_service/paths.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! - - -module Google - module Cloud - module Retail - module V2 - module GenerativeQuestionService - # Path helper methods for the GenerativeQuestionService API. - module Paths - ## - # Create a fully-qualified Catalog resource string. - # - # The resource will be in the following format: - # - # `projects/{project}/locations/{location}/catalogs/{catalog}` - # - # @param project [String] - # @param location [String] - # @param catalog [String] - # - # @return [::String] - def catalog_path project:, location:, catalog: - raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" - raise ::ArgumentError, "location cannot contain /" if location.to_s.include? "/" - - "projects/#{project}/locations/#{location}/catalogs/#{catalog}" - end - - extend self - end - end - end - end - end -end diff --git a/owl-bot-staging/google-cloud-retail-v2/lib/google/cloud/retail/v2/generative_question_service/rest.rb b/owl-bot-staging/google-cloud-retail-v2/lib/google/cloud/retail/v2/generative_question_service/rest.rb deleted file mode 100644 index a4599e934284..000000000000 --- a/owl-bot-staging/google-cloud-retail-v2/lib/google/cloud/retail/v2/generative_question_service/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/retail/v2/version" - -require "google/cloud/retail/v2/generative_question_service/credentials" -require "google/cloud/retail/v2/generative_question_service/paths" -require "google/cloud/retail/v2/generative_question_service/rest/client" - -module Google - module Cloud - module Retail - module V2 - ## - # Service for managing LLM generated questions in search serving. - # - # To load this service and instantiate a REST client: - # - # require "google/cloud/retail/v2/generative_question_service/rest" - # client = ::Google::Cloud::Retail::V2::GenerativeQuestionService::Rest::Client.new - # - module GenerativeQuestionService - # Client for the REST transport - module Rest - end - end - end - end - end -end - -helper_path = ::File.join __dir__, "rest", "helpers.rb" -require "google/cloud/retail/v2/generative_question_service/rest/helpers" if ::File.file? helper_path diff --git a/owl-bot-staging/google-cloud-retail-v2/lib/google/cloud/retail/v2/generative_question_service/rest/client.rb b/owl-bot-staging/google-cloud-retail-v2/lib/google/cloud/retail/v2/generative_question_service/rest/client.rb deleted file mode 100644 index 5e1bcd01164d..000000000000 --- a/owl-bot-staging/google-cloud-retail-v2/lib/google/cloud/retail/v2/generative_question_service/rest/client.rb +++ /dev/null @@ -1,799 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -require "google/cloud/errors" -require "google/cloud/retail/v2/generative_question_service_pb" -require "google/cloud/retail/v2/generative_question_service/rest/service_stub" -require "google/cloud/location/rest" - -module Google - module Cloud - module Retail - module V2 - module GenerativeQuestionService - module Rest - ## - # REST client for the GenerativeQuestionService service. - # - # Service for managing LLM generated questions in search serving. - # - class Client - # @private - API_VERSION = "" - - # @private - DEFAULT_ENDPOINT_TEMPLATE = "retail.$UNIVERSE_DOMAIN$" - - include Paths - - # @private - attr_reader :generative_question_service_stub - - ## - # Configure the GenerativeQuestionService Client class. - # - # See {::Google::Cloud::Retail::V2::GenerativeQuestionService::Rest::Client::Configuration} - # for a description of the configuration fields. - # - # @example - # - # # Modify the configuration for all GenerativeQuestionService clients - # ::Google::Cloud::Retail::V2::GenerativeQuestionService::Rest::Client.configure do |config| - # config.timeout = 10.0 - # end - # - # @yield [config] Configure the Client client. - # @yieldparam config [Client::Configuration] - # - # @return [Client::Configuration] - # - def self.configure - @configure ||= begin - namespace = ["Google", "Cloud", "Retail", "V2"] - parent_config = while namespace.any? - parent_name = namespace.join "::" - parent_const = const_get parent_name - break parent_const.configure if parent_const.respond_to? :configure - namespace.pop - end - default_config = Client::Configuration.new parent_config - - default_config - end - yield @configure if block_given? - @configure - end - - ## - # Configure the GenerativeQuestionService Client instance. - # - # The configuration is set to the derived mode, meaning that values can be changed, - # but structural changes (adding new fields, etc.) are not allowed. Structural changes - # should be made on {Client.configure}. - # - # See {::Google::Cloud::Retail::V2::GenerativeQuestionService::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 - @generative_question_service_stub.universe_domain - end - - ## - # Create a new GenerativeQuestionService REST client object. - # - # @example - # - # # Create a client using the default configuration - # client = ::Google::Cloud::Retail::V2::GenerativeQuestionService::Rest::Client.new - # - # # Create a client using a custom configuration - # client = ::Google::Cloud::Retail::V2::GenerativeQuestionService::Rest::Client.new do |config| - # config.timeout = 10.0 - # end - # - # @yield [config] Configure the GenerativeQuestionService 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 - - @generative_question_service_stub = ::Google::Cloud::Retail::V2::GenerativeQuestionService::Rest::ServiceStub.new( - endpoint: @config.endpoint, - endpoint_template: DEFAULT_ENDPOINT_TEMPLATE, - universe_domain: @config.universe_domain, - credentials: credentials, - logger: @config.logger - ) - - @generative_question_service_stub.logger(stub: true)&.info do |entry| - entry.set_system_name - entry.set_service - entry.message = "Created client for #{entry.service}" - entry.set_credentials_fields credentials - entry.set "customEndpoint", @config.endpoint if @config.endpoint - entry.set "defaultTimeout", @config.timeout if @config.timeout - entry.set "quotaProject", @quota_project_id if @quota_project_id - end - - @location_client = Google::Cloud::Location::Locations::Rest::Client.new do |config| - config.credentials = credentials - config.quota_project = @quota_project_id - config.endpoint = @generative_question_service_stub.endpoint - config.universe_domain = @generative_question_service_stub.universe_domain - config.logger = @generative_question_service_stub.logger if config.respond_to? :logger= - end - end - - ## - # Get the associated client for mix-in of the Locations. - # - # @return [Google::Cloud::Location::Locations::Rest::Client] - # - attr_reader :location_client - - ## - # The logger used for request/response debug logging. - # - # @return [Logger] - # - def logger - @generative_question_service_stub.logger - end - - # Service calls - - ## - # Manages overal generative question feature state -- enables toggling - # feature on and off. - # - # @overload update_generative_questions_feature_config(request, options = nil) - # Pass arguments to `update_generative_questions_feature_config` via a request object, either of type - # {::Google::Cloud::Retail::V2::UpdateGenerativeQuestionsFeatureConfigRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Retail::V2::UpdateGenerativeQuestionsFeatureConfigRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_generative_questions_feature_config(generative_questions_feature_config: nil, update_mask: nil) - # Pass arguments to `update_generative_questions_feature_config` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param generative_questions_feature_config [::Google::Cloud::Retail::V2::GenerativeQuestionsFeatureConfig, ::Hash] - # Required. The configuration managing the feature state. - # @param update_mask [::Google::Protobuf::FieldMask, ::Hash] - # Optional. Indicates which fields in the provided - # {::Google::Cloud::Retail::V2::GenerativeQuestionsFeatureConfig GenerativeQuestionsFeatureConfig} - # to update. If not set or empty, all supported fields are updated. - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Cloud::Retail::V2::GenerativeQuestionsFeatureConfig] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::Retail::V2::GenerativeQuestionsFeatureConfig] - # - # @raise [::Google::Cloud::Error] if the REST call is aborted. - # - # @example Basic example - # require "google/cloud/retail/v2" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Retail::V2::GenerativeQuestionService::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Retail::V2::UpdateGenerativeQuestionsFeatureConfigRequest.new - # - # # Call the update_generative_questions_feature_config method. - # result = client.update_generative_questions_feature_config request - # - # # The returned object is of type Google::Cloud::Retail::V2::GenerativeQuestionsFeatureConfig. - # p result - # - def update_generative_questions_feature_config request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Retail::V2::UpdateGenerativeQuestionsFeatureConfigRequest - - # Converts hash 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_generative_questions_feature_config.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::Retail::V2::VERSION, - transports_version_send: [:rest] - - call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - options.apply_defaults timeout: @config.rpcs.update_generative_questions_feature_config.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.update_generative_questions_feature_config.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @generative_question_service_stub.update_generative_questions_feature_config request, options do |result, operation| - yield result, operation if block_given? - end - rescue ::Gapic::Rest::Error => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Manages overal generative question feature state -- enables toggling - # feature on and off. - # - # @overload get_generative_questions_feature_config(request, options = nil) - # Pass arguments to `get_generative_questions_feature_config` via a request object, either of type - # {::Google::Cloud::Retail::V2::GetGenerativeQuestionsFeatureConfigRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Retail::V2::GetGenerativeQuestionsFeatureConfigRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_generative_questions_feature_config(catalog: nil) - # Pass arguments to `get_generative_questions_feature_config` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param catalog [::String] - # Required. Resource name of the parent catalog. - # Format: projects/\\{project}/locations/\\{location}/catalogs/\\{catalog} - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Cloud::Retail::V2::GenerativeQuestionsFeatureConfig] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::Retail::V2::GenerativeQuestionsFeatureConfig] - # - # @raise [::Google::Cloud::Error] if the REST call is aborted. - # - # @example Basic example - # require "google/cloud/retail/v2" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Retail::V2::GenerativeQuestionService::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Retail::V2::GetGenerativeQuestionsFeatureConfigRequest.new - # - # # Call the get_generative_questions_feature_config method. - # result = client.get_generative_questions_feature_config request - # - # # The returned object is of type Google::Cloud::Retail::V2::GenerativeQuestionsFeatureConfig. - # p result - # - def get_generative_questions_feature_config request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Retail::V2::GetGenerativeQuestionsFeatureConfigRequest - - # Converts hash 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_generative_questions_feature_config.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::Retail::V2::VERSION, - transports_version_send: [:rest] - - call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - options.apply_defaults timeout: @config.rpcs.get_generative_questions_feature_config.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.get_generative_questions_feature_config.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @generative_question_service_stub.get_generative_questions_feature_config request, options do |result, operation| - yield result, operation if block_given? - end - rescue ::Gapic::Rest::Error => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Returns all questions for a given catalog. - # - # @overload list_generative_question_configs(request, options = nil) - # Pass arguments to `list_generative_question_configs` via a request object, either of type - # {::Google::Cloud::Retail::V2::ListGenerativeQuestionConfigsRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Retail::V2::ListGenerativeQuestionConfigsRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_generative_question_configs(parent: nil) - # Pass arguments to `list_generative_question_configs` via keyword arguments. Note that at - # least one keyword argument is 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. Resource name of the parent catalog. - # Format: projects/\\{project}/locations/\\{location}/catalogs/\\{catalog} - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Cloud::Retail::V2::ListGenerativeQuestionConfigsResponse] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::Retail::V2::ListGenerativeQuestionConfigsResponse] - # - # @raise [::Google::Cloud::Error] if the REST call is aborted. - # - # @example Basic example - # require "google/cloud/retail/v2" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Retail::V2::GenerativeQuestionService::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Retail::V2::ListGenerativeQuestionConfigsRequest.new - # - # # Call the list_generative_question_configs method. - # result = client.list_generative_question_configs request - # - # # The returned object is of type Google::Cloud::Retail::V2::ListGenerativeQuestionConfigsResponse. - # p result - # - def list_generative_question_configs request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Retail::V2::ListGenerativeQuestionConfigsRequest - - # Converts hash 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_generative_question_configs.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::Retail::V2::VERSION, - transports_version_send: [:rest] - - call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - options.apply_defaults timeout: @config.rpcs.list_generative_question_configs.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.list_generative_question_configs.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @generative_question_service_stub.list_generative_question_configs 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 - - ## - # Allows management of individual questions. - # - # @overload update_generative_question_config(request, options = nil) - # Pass arguments to `update_generative_question_config` via a request object, either of type - # {::Google::Cloud::Retail::V2::UpdateGenerativeQuestionConfigRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Retail::V2::UpdateGenerativeQuestionConfigRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_generative_question_config(generative_question_config: nil, update_mask: nil) - # Pass arguments to `update_generative_question_config` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param generative_question_config [::Google::Cloud::Retail::V2::GenerativeQuestionConfig, ::Hash] - # Required. The question to update. - # @param update_mask [::Google::Protobuf::FieldMask, ::Hash] - # Optional. Indicates which fields in the provided - # {::Google::Cloud::Retail::V2::GenerativeQuestionConfig GenerativeQuestionConfig} - # to update. The following are NOT supported: - # - # * {::Google::Cloud::Retail::V2::GenerativeQuestionConfig#frequency GenerativeQuestionConfig.frequency} - # - # If not set or empty, all supported fields are updated. - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Cloud::Retail::V2::GenerativeQuestionConfig] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::Retail::V2::GenerativeQuestionConfig] - # - # @raise [::Google::Cloud::Error] if the REST call is aborted. - # - # @example Basic example - # require "google/cloud/retail/v2" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Retail::V2::GenerativeQuestionService::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Retail::V2::UpdateGenerativeQuestionConfigRequest.new - # - # # Call the update_generative_question_config method. - # result = client.update_generative_question_config request - # - # # The returned object is of type Google::Cloud::Retail::V2::GenerativeQuestionConfig. - # p result - # - def update_generative_question_config request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Retail::V2::UpdateGenerativeQuestionConfigRequest - - # Converts hash 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_generative_question_config.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::Retail::V2::VERSION, - transports_version_send: [:rest] - - call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - options.apply_defaults timeout: @config.rpcs.update_generative_question_config.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.update_generative_question_config.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @generative_question_service_stub.update_generative_question_config request, options do |result, operation| - yield result, operation if block_given? - end - rescue ::Gapic::Rest::Error => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Allows management of multiple questions. - # - # @overload batch_update_generative_question_configs(request, options = nil) - # Pass arguments to `batch_update_generative_question_configs` via a request object, either of type - # {::Google::Cloud::Retail::V2::BatchUpdateGenerativeQuestionConfigsRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Retail::V2::BatchUpdateGenerativeQuestionConfigsRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @overload batch_update_generative_question_configs(parent: nil, requests: nil) - # Pass arguments to `batch_update_generative_question_configs` via keyword arguments. Note that at - # least one keyword argument is 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] - # Optional. Resource name of the parent catalog. - # Format: projects/\\{project}/locations/\\{location}/catalogs/\\{catalog} - # @param requests [::Array<::Google::Cloud::Retail::V2::UpdateGenerativeQuestionConfigRequest, ::Hash>] - # Required. The updates question configs. - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Cloud::Retail::V2::BatchUpdateGenerativeQuestionConfigsResponse] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::Retail::V2::BatchUpdateGenerativeQuestionConfigsResponse] - # - # @raise [::Google::Cloud::Error] if the REST call is aborted. - # - # @example Basic example - # require "google/cloud/retail/v2" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Retail::V2::GenerativeQuestionService::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Retail::V2::BatchUpdateGenerativeQuestionConfigsRequest.new - # - # # Call the batch_update_generative_question_configs method. - # result = client.batch_update_generative_question_configs request - # - # # The returned object is of type Google::Cloud::Retail::V2::BatchUpdateGenerativeQuestionConfigsResponse. - # p result - # - def batch_update_generative_question_configs request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Retail::V2::BatchUpdateGenerativeQuestionConfigsRequest - - # Converts hash 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.batch_update_generative_question_configs.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::Retail::V2::VERSION, - transports_version_send: [:rest] - - call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - options.apply_defaults timeout: @config.rpcs.batch_update_generative_question_configs.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.batch_update_generative_question_configs.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @generative_question_service_stub.batch_update_generative_question_configs 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 GenerativeQuestionService REST API. - # - # This class represents the configuration for GenerativeQuestionService REST, - # providing control over timeouts, retry behavior, logging, transport - # parameters, and other low-level controls. Certain parameters can also be - # applied individually to specific RPCs. See - # {::Google::Cloud::Retail::V2::GenerativeQuestionService::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 - # # update_generative_questions_feature_config to 20 seconds, - # # and all remaining timeouts to 10 seconds. - # ::Google::Cloud::Retail::V2::GenerativeQuestionService::Rest::Client.configure do |config| - # config.timeout = 10.0 - # config.rpcs.update_generative_questions_feature_config.timeout = 20.0 - # end - # - # # Apply the above configuration only to a new client. - # client = ::Google::Cloud::Retail::V2::GenerativeQuestionService::Rest::Client.new do |config| - # config.timeout = 10.0 - # config.rpcs.update_generative_questions_feature_config.timeout = 20.0 - # end - # - # @!attribute [rw] endpoint - # A custom service endpoint, as a hostname or hostname:port. The default is - # nil, indicating to use the default endpoint in the current universe domain. - # @return [::String,nil] - # @!attribute [rw] credentials - # Credentials to send with calls. You may provide any of the following types: - # * (`String`) The path to a service account key file in JSON format - # * (`Hash`) A service account key as a Hash - # * (`Google::Auth::Credentials`) A googleauth credentials object - # (see the [googleauth docs](https://rubydoc.info/gems/googleauth/Google/Auth/Credentials)) - # * (`Signet::OAuth2::Client`) A signet oauth2 client object - # (see the [signet docs](https://rubydoc.info/gems/signet/Signet/OAuth2/Client)) - # * (`nil`) indicating no credentials - # - # Warning: If you accept a credential configuration (JSON file or Hash) from an - # external source for authentication to Google Cloud, you must validate it before - # providing it to a Google API client library. Providing an unvalidated credential - # configuration to Google APIs can compromise the security of your systems and data. - # For more information, refer to [Validate credential configurations from external - # sources](https://cloud.google.com/docs/authentication/external/externally-sourced-credentials). - # @return [::Object] - # @!attribute [rw] scope - # The OAuth scopes - # @return [::Array<::String>] - # @!attribute [rw] lib_name - # The library name as recorded in instrumentation and logging - # @return [::String] - # @!attribute [rw] lib_version - # The library version as recorded in instrumentation and logging - # @return [::String] - # @!attribute [rw] timeout - # The call timeout in seconds. - # @return [::Numeric] - # @!attribute [rw] metadata - # Additional headers to be sent with the call. - # @return [::Hash{::Symbol=>::String}] - # @!attribute [rw] retry_policy - # The retry policy. The value is a hash with the following keys: - # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds. - # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds. - # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier. - # * `:retry_codes` (*type:* `Array`) - The error codes that should - # trigger a retry. - # @return [::Hash] - # @!attribute [rw] quota_project - # A separate project against which to charge quota. - # @return [::String] - # @!attribute [rw] universe_domain - # The universe domain within which to make requests. This determines the - # default endpoint URL. The default value of nil uses the environment - # universe (usually the default "googleapis.com" universe). - # @return [::String,nil] - # @!attribute [rw] logger - # A custom logger to use for request/response debug logging, or the value - # `:default` (the default) to construct a default logger, or `nil` to - # explicitly disable logging. - # @return [::Logger,:default,nil] - # - class Configuration - extend ::Gapic::Config - - # @private - # The endpoint specific to the default "googleapis.com" universe. Deprecated. - DEFAULT_ENDPOINT = "retail.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 GenerativeQuestionService 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 `update_generative_questions_feature_config` - # @return [::Gapic::Config::Method] - # - attr_reader :update_generative_questions_feature_config - ## - # RPC-specific configuration for `get_generative_questions_feature_config` - # @return [::Gapic::Config::Method] - # - attr_reader :get_generative_questions_feature_config - ## - # RPC-specific configuration for `list_generative_question_configs` - # @return [::Gapic::Config::Method] - # - attr_reader :list_generative_question_configs - ## - # RPC-specific configuration for `update_generative_question_config` - # @return [::Gapic::Config::Method] - # - attr_reader :update_generative_question_config - ## - # RPC-specific configuration for `batch_update_generative_question_configs` - # @return [::Gapic::Config::Method] - # - attr_reader :batch_update_generative_question_configs - - # @private - def initialize parent_rpcs = nil - update_generative_questions_feature_config_config = parent_rpcs.update_generative_questions_feature_config if parent_rpcs.respond_to? :update_generative_questions_feature_config - @update_generative_questions_feature_config = ::Gapic::Config::Method.new update_generative_questions_feature_config_config - get_generative_questions_feature_config_config = parent_rpcs.get_generative_questions_feature_config if parent_rpcs.respond_to? :get_generative_questions_feature_config - @get_generative_questions_feature_config = ::Gapic::Config::Method.new get_generative_questions_feature_config_config - list_generative_question_configs_config = parent_rpcs.list_generative_question_configs if parent_rpcs.respond_to? :list_generative_question_configs - @list_generative_question_configs = ::Gapic::Config::Method.new list_generative_question_configs_config - update_generative_question_config_config = parent_rpcs.update_generative_question_config if parent_rpcs.respond_to? :update_generative_question_config - @update_generative_question_config = ::Gapic::Config::Method.new update_generative_question_config_config - batch_update_generative_question_configs_config = parent_rpcs.batch_update_generative_question_configs if parent_rpcs.respond_to? :batch_update_generative_question_configs - @batch_update_generative_question_configs = ::Gapic::Config::Method.new batch_update_generative_question_configs_config - - yield self if block_given? - end - end - end - end - end - end - end - end - end -end diff --git a/owl-bot-staging/google-cloud-retail-v2/lib/google/cloud/retail/v2/generative_question_service/rest/service_stub.rb b/owl-bot-staging/google-cloud-retail-v2/lib/google/cloud/retail/v2/generative_question_service/rest/service_stub.rb deleted file mode 100644 index 28bb60081ea8..000000000000 --- a/owl-bot-staging/google-cloud-retail-v2/lib/google/cloud/retail/v2/generative_question_service/rest/service_stub.rb +++ /dev/null @@ -1,389 +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/retail/v2/generative_question_service_pb" - -module Google - module Cloud - module Retail - module V2 - module GenerativeQuestionService - module Rest - ## - # REST service stub for the GenerativeQuestionService 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 update_generative_questions_feature_config REST call - # - # @param request_pb [::Google::Cloud::Retail::V2::UpdateGenerativeQuestionsFeatureConfigRequest] - # A request object representing the call parameters. Required. - # @param options [::Gapic::CallOptions] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Cloud::Retail::V2::GenerativeQuestionsFeatureConfig] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::Retail::V2::GenerativeQuestionsFeatureConfig] - # A result object deserialized from the server's reply - def update_generative_questions_feature_config request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_update_generative_questions_feature_config_request request_pb - query_string_params = if query_string_params.any? - query_string_params.to_h { |p| p.split "=", 2 } - else - {} - end - - response = @client_stub.make_http_request( - verb, - uri: uri, - body: body || "", - params: query_string_params, - method_name: "update_generative_questions_feature_config", - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Cloud::Retail::V2::GenerativeQuestionsFeatureConfig.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_generative_questions_feature_config REST call - # - # @param request_pb [::Google::Cloud::Retail::V2::GetGenerativeQuestionsFeatureConfigRequest] - # A request object representing the call parameters. Required. - # @param options [::Gapic::CallOptions] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Cloud::Retail::V2::GenerativeQuestionsFeatureConfig] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::Retail::V2::GenerativeQuestionsFeatureConfig] - # A result object deserialized from the server's reply - def get_generative_questions_feature_config request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_get_generative_questions_feature_config_request request_pb - query_string_params = if query_string_params.any? - query_string_params.to_h { |p| p.split "=", 2 } - else - {} - end - - response = @client_stub.make_http_request( - verb, - uri: uri, - body: body || "", - params: query_string_params, - method_name: "get_generative_questions_feature_config", - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Cloud::Retail::V2::GenerativeQuestionsFeatureConfig.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_generative_question_configs REST call - # - # @param request_pb [::Google::Cloud::Retail::V2::ListGenerativeQuestionConfigsRequest] - # A request object representing the call parameters. Required. - # @param options [::Gapic::CallOptions] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Cloud::Retail::V2::ListGenerativeQuestionConfigsResponse] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::Retail::V2::ListGenerativeQuestionConfigsResponse] - # A result object deserialized from the server's reply - def list_generative_question_configs request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_list_generative_question_configs_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_generative_question_configs", - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Cloud::Retail::V2::ListGenerativeQuestionConfigsResponse.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_generative_question_config REST call - # - # @param request_pb [::Google::Cloud::Retail::V2::UpdateGenerativeQuestionConfigRequest] - # A request object representing the call parameters. Required. - # @param options [::Gapic::CallOptions] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Cloud::Retail::V2::GenerativeQuestionConfig] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::Retail::V2::GenerativeQuestionConfig] - # A result object deserialized from the server's reply - def update_generative_question_config request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_update_generative_question_config_request request_pb - query_string_params = if query_string_params.any? - query_string_params.to_h { |p| p.split "=", 2 } - else - {} - end - - response = @client_stub.make_http_request( - verb, - uri: uri, - body: body || "", - params: query_string_params, - method_name: "update_generative_question_config", - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Cloud::Retail::V2::GenerativeQuestionConfig.decode_json response.body, ignore_unknown_fields: true - catch :response do - yield result, operation if block_given? - result - end - end - - ## - # Baseline implementation for the batch_update_generative_question_configs REST call - # - # @param request_pb [::Google::Cloud::Retail::V2::BatchUpdateGenerativeQuestionConfigsRequest] - # A request object representing the call parameters. Required. - # @param options [::Gapic::CallOptions] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Cloud::Retail::V2::BatchUpdateGenerativeQuestionConfigsResponse] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::Retail::V2::BatchUpdateGenerativeQuestionConfigsResponse] - # A result object deserialized from the server's reply - def batch_update_generative_question_configs request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_batch_update_generative_question_configs_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: "batch_update_generative_question_configs", - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Cloud::Retail::V2::BatchUpdateGenerativeQuestionConfigsResponse.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 update_generative_questions_feature_config REST call - # - # @param request_pb [::Google::Cloud::Retail::V2::UpdateGenerativeQuestionsFeatureConfigRequest] - # 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_generative_questions_feature_config_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :patch, - uri_template: "/v2/{generative_questions_feature_config.catalog}/generativeQuestionFeature", - body: "generative_questions_feature_config", - matches: [ - ["generative_questions_feature_config.catalog", %r{^projects/[^/]+/locations/[^/]+/catalogs/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the get_generative_questions_feature_config REST call - # - # @param request_pb [::Google::Cloud::Retail::V2::GetGenerativeQuestionsFeatureConfigRequest] - # 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_generative_questions_feature_config_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :get, - uri_template: "/v2/{catalog}/generativeQuestionFeature", - matches: [ - ["catalog", %r{^projects/[^/]+/locations/[^/]+/catalogs/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the list_generative_question_configs REST call - # - # @param request_pb [::Google::Cloud::Retail::V2::ListGenerativeQuestionConfigsRequest] - # 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_generative_question_configs_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :get, - uri_template: "/v2/{parent}/generativeQuestions", - matches: [ - ["parent", %r{^projects/[^/]+/locations/[^/]+/catalogs/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the update_generative_question_config REST call - # - # @param request_pb [::Google::Cloud::Retail::V2::UpdateGenerativeQuestionConfigRequest] - # 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_generative_question_config_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :patch, - uri_template: "/v2/{generative_question_config.catalog}/generativeQuestion", - body: "generative_question_config", - matches: [ - ["generative_question_config.catalog", %r{^projects/[^/]+/locations/[^/]+/catalogs/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the batch_update_generative_question_configs REST call - # - # @param request_pb [::Google::Cloud::Retail::V2::BatchUpdateGenerativeQuestionConfigsRequest] - # A request object representing the call parameters. Required. - # @return [Array(String, [String, nil], Hash{String => String})] - # Uri, Body, Query string parameters - def self.transcode_batch_update_generative_question_configs_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :post, - uri_template: "/v2/{parent}/generativeQuestion:batchUpdate", - body: "*", - matches: [ - ["parent", %r{^projects/[^/]+/locations/[^/]+/catalogs/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - end - end - end - end - end - end -end diff --git a/owl-bot-staging/google-cloud-retail-v2/lib/google/cloud/retail/v2/generative_question_service_pb.rb b/owl-bot-staging/google-cloud-retail-v2/lib/google/cloud/retail/v2/generative_question_service_pb.rb deleted file mode 100644 index 36ad39b3e786..000000000000 --- a/owl-bot-staging/google-cloud-retail-v2/lib/google/cloud/retail/v2/generative_question_service_pb.rb +++ /dev/null @@ -1,34 +0,0 @@ -# frozen_string_literal: true -# Generated by the protocol buffer compiler. DO NOT EDIT! -# source: google/cloud/retail/v2/generative_question_service.proto - -require 'google/protobuf' - -require 'google/api/annotations_pb' -require 'google/api/client_pb' -require 'google/api/field_behavior_pb' -require 'google/api/resource_pb' -require 'google/cloud/retail/v2/generative_question_pb' -require 'google/protobuf/field_mask_pb' - - -descriptor_data = "\n8google/cloud/retail/v2/generative_question_service.proto\x12\x16google.cloud.retail.v2\x1a\x1cgoogle/api/annotations.proto\x1a\x17google/api/client.proto\x1a\x1fgoogle/api/field_behavior.proto\x1a\x19google/api/resource.proto\x1a\x30google/cloud/retail/v2/generative_question.proto\x1a google/protobuf/field_mask.proto\"\xd1\x01\n-UpdateGenerativeQuestionsFeatureConfigRequest\x12j\n#generative_questions_feature_config\x18\x02 \x01(\x0b\x32\x38.google.cloud.retail.v2.GenerativeQuestionsFeatureConfigB\x03\xe0\x41\x02\x12\x34\n\x0bupdate_mask\x18\x04 \x01(\x0b\x32\x1a.google.protobuf.FieldMaskB\x03\xe0\x41\x01\"d\n*GetGenerativeQuestionsFeatureConfigRequest\x12\x36\n\x07\x63\x61talog\x18\x01 \x01(\tB%\xe0\x41\x02\xfa\x41\x1f\n\x1dretail.googleapis.com/Catalog\"]\n$ListGenerativeQuestionConfigsRequest\x12\x35\n\x06parent\x18\x01 \x01(\tB%\xe0\x41\x02\xfa\x41\x1f\n\x1dretail.googleapis.com/Catalog\"~\n%ListGenerativeQuestionConfigsResponse\x12U\n\x1bgenerative_question_configs\x18\x01 \x03(\x0b\x32\x30.google.cloud.retail.v2.GenerativeQuestionConfig\"\xb8\x01\n%UpdateGenerativeQuestionConfigRequest\x12Y\n\x1agenerative_question_config\x18\x03 \x01(\x0b\x32\x30.google.cloud.retail.v2.GenerativeQuestionConfigB\x03\xe0\x41\x02\x12\x34\n\x0bupdate_mask\x18\x04 \x01(\x0b\x32\x1a.google.protobuf.FieldMaskB\x03\xe0\x41\x01\"\xba\x01\n+BatchUpdateGenerativeQuestionConfigsRequest\x12\x35\n\x06parent\x18\x01 \x01(\tB%\xe0\x41\x01\xfa\x41\x1f\n\x1dretail.googleapis.com/Catalog\x12T\n\x08requests\x18\x02 \x03(\x0b\x32=.google.cloud.retail.v2.UpdateGenerativeQuestionConfigRequestB\x03\xe0\x41\x02\"\x8a\x01\n,BatchUpdateGenerativeQuestionConfigsResponse\x12Z\n\x1bgenerative_question_configs\x18\x01 \x03(\x0b\x32\x30.google.cloud.retail.v2.GenerativeQuestionConfigB\x03\xe0\x41\x01\x32\xba\x0c\n\x19GenerativeQuestionService\x12\xf9\x02\n&UpdateGenerativeQuestionsFeatureConfig\x12\x45.google.cloud.retail.v2.UpdateGenerativeQuestionsFeatureConfigRequest\x1a\x38.google.cloud.retail.v2.GenerativeQuestionsFeatureConfig\"\xcd\x01\xda\x41/generative_questions_feature_config,update_mask\x82\xd3\xe4\x93\x02\x94\x01\x32m/v2/{generative_questions_feature_config.catalog=projects/*/locations/*/catalogs/*}/generativeQuestionFeature:#generative_questions_feature_config\x12\x80\x02\n#GetGenerativeQuestionsFeatureConfig\x12\x42.google.cloud.retail.v2.GetGenerativeQuestionsFeatureConfigRequest\x1a\x38.google.cloud.retail.v2.GenerativeQuestionsFeatureConfig\"[\xda\x41\x07\x63\x61talog\x82\xd3\xe4\x93\x02K\x12I/v2/{catalog=projects/*/locations/*/catalogs/*}/generativeQuestionFeature\x12\xf1\x01\n\x1dListGenerativeQuestionConfigs\x12<.google.cloud.retail.v2.ListGenerativeQuestionConfigsRequest\x1a=.google.cloud.retail.v2.ListGenerativeQuestionConfigsResponse\"S\xda\x41\x06parent\x82\xd3\xe4\x93\x02\x44\x12\x42/v2/{parent=projects/*/locations/*/catalogs/*}/generativeQuestions\x12\xbe\x02\n\x1eUpdateGenerativeQuestionConfig\x12=.google.cloud.retail.v2.UpdateGenerativeQuestionConfigRequest\x1a\x30.google.cloud.retail.v2.GenerativeQuestionConfig\"\xaa\x01\xda\x41&generative_question_config,update_mask\x82\xd3\xe4\x93\x02{2]/v2/{generative_question_config.catalog=projects/*/locations/*/catalogs/*}/generativeQuestion:\x1agenerative_question_config\x12\x9d\x02\n$BatchUpdateGenerativeQuestionConfigs\x12\x43.google.cloud.retail.v2.BatchUpdateGenerativeQuestionConfigsRequest\x1a\x44.google.cloud.retail.v2.BatchUpdateGenerativeQuestionConfigsResponse\"j\xda\x41\x0fparent,requests\x82\xd3\xe4\x93\x02R\"M/v2/{parent=projects/*/locations/*/catalogs/*}/generativeQuestion:batchUpdate:\x01*\x1aI\xca\x41\x15retail.googleapis.com\xd2\x41.https://www.googleapis.com/auth/cloud-platformB\xc9\x01\n\x1a\x63om.google.cloud.retail.v2B\x1eGenerativeQuestionServiceProtoP\x01Z2cloud.google.com/go/retail/apiv2/retailpb;retailpb\xa2\x02\x06RETAIL\xaa\x02\x16Google.Cloud.Retail.V2\xca\x02\x16Google\\Cloud\\Retail\\V2\xea\x02\x19Google::Cloud::Retail::V2b\x06proto3" - -pool = ::Google::Protobuf::DescriptorPool.generated_pool -pool.add_serialized_file(descriptor_data) - -module Google - module Cloud - module Retail - module V2 - UpdateGenerativeQuestionsFeatureConfigRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.retail.v2.UpdateGenerativeQuestionsFeatureConfigRequest").msgclass - GetGenerativeQuestionsFeatureConfigRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.retail.v2.GetGenerativeQuestionsFeatureConfigRequest").msgclass - ListGenerativeQuestionConfigsRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.retail.v2.ListGenerativeQuestionConfigsRequest").msgclass - ListGenerativeQuestionConfigsResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.retail.v2.ListGenerativeQuestionConfigsResponse").msgclass - UpdateGenerativeQuestionConfigRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.retail.v2.UpdateGenerativeQuestionConfigRequest").msgclass - BatchUpdateGenerativeQuestionConfigsRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.retail.v2.BatchUpdateGenerativeQuestionConfigsRequest").msgclass - BatchUpdateGenerativeQuestionConfigsResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.retail.v2.BatchUpdateGenerativeQuestionConfigsResponse").msgclass - end - end - end -end diff --git a/owl-bot-staging/google-cloud-retail-v2/lib/google/cloud/retail/v2/generative_question_service_services_pb.rb b/owl-bot-staging/google-cloud-retail-v2/lib/google/cloud/retail/v2/generative_question_service_services_pb.rb deleted file mode 100644 index 259ede2d8557..000000000000 --- a/owl-bot-staging/google-cloud-retail-v2/lib/google/cloud/retail/v2/generative_question_service_services_pb.rb +++ /dev/null @@ -1,55 +0,0 @@ -# Generated by the protocol buffer compiler. DO NOT EDIT! -# Source: google/cloud/retail/v2/generative_question_service.proto for package 'Google.Cloud.Retail.V2' -# Original file comments: -# 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 -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. -# - -require 'grpc' -require 'google/cloud/retail/v2/generative_question_service_pb' - -module Google - module Cloud - module Retail - module V2 - module GenerativeQuestionService - # Service for managing LLM generated questions in search serving. - class Service - - include ::GRPC::GenericService - - self.marshal_class_method = :encode - self.unmarshal_class_method = :decode - self.service_name = 'google.cloud.retail.v2.GenerativeQuestionService' - - # Manages overal generative question feature state -- enables toggling - # feature on and off. - rpc :UpdateGenerativeQuestionsFeatureConfig, ::Google::Cloud::Retail::V2::UpdateGenerativeQuestionsFeatureConfigRequest, ::Google::Cloud::Retail::V2::GenerativeQuestionsFeatureConfig - # Manages overal generative question feature state -- enables toggling - # feature on and off. - rpc :GetGenerativeQuestionsFeatureConfig, ::Google::Cloud::Retail::V2::GetGenerativeQuestionsFeatureConfigRequest, ::Google::Cloud::Retail::V2::GenerativeQuestionsFeatureConfig - # Returns all questions for a given catalog. - rpc :ListGenerativeQuestionConfigs, ::Google::Cloud::Retail::V2::ListGenerativeQuestionConfigsRequest, ::Google::Cloud::Retail::V2::ListGenerativeQuestionConfigsResponse - # Allows management of individual questions. - rpc :UpdateGenerativeQuestionConfig, ::Google::Cloud::Retail::V2::UpdateGenerativeQuestionConfigRequest, ::Google::Cloud::Retail::V2::GenerativeQuestionConfig - # Allows management of multiple questions. - rpc :BatchUpdateGenerativeQuestionConfigs, ::Google::Cloud::Retail::V2::BatchUpdateGenerativeQuestionConfigsRequest, ::Google::Cloud::Retail::V2::BatchUpdateGenerativeQuestionConfigsResponse - end - - Stub = Service.rpc_stub_class - end - end - end - end -end diff --git a/owl-bot-staging/google-cloud-retail-v2/lib/google/cloud/retail/v2/import_config_pb.rb b/owl-bot-staging/google-cloud-retail-v2/lib/google/cloud/retail/v2/import_config_pb.rb deleted file mode 100644 index 8dacabe59008..000000000000 --- a/owl-bot-staging/google-cloud-retail-v2/lib/google/cloud/retail/v2/import_config_pb.rb +++ /dev/null @@ -1,46 +0,0 @@ -# frozen_string_literal: true -# Generated by the protocol buffer compiler. DO NOT EDIT! -# source: google/cloud/retail/v2/import_config.proto - -require 'google/protobuf' - -require 'google/api/field_behavior_pb' -require 'google/api/resource_pb' -require 'google/cloud/retail/v2/product_pb' -require 'google/cloud/retail/v2/user_event_pb' -require 'google/protobuf/field_mask_pb' -require 'google/protobuf/timestamp_pb' -require 'google/rpc/status_pb' -require 'google/type/date_pb' - - -descriptor_data = "\n*google/cloud/retail/v2/import_config.proto\x12\x16google.cloud.retail.v2\x1a\x1fgoogle/api/field_behavior.proto\x1a\x19google/api/resource.proto\x1a$google/cloud/retail/v2/product.proto\x1a\'google/cloud/retail/v2/user_event.proto\x1a google/protobuf/field_mask.proto\x1a\x1fgoogle/protobuf/timestamp.proto\x1a\x17google/rpc/status.proto\x1a\x16google/type/date.proto\"9\n\tGcsSource\x12\x17\n\ninput_uris\x18\x01 \x03(\tB\x03\xe0\x41\x02\x12\x13\n\x0b\x64\x61ta_schema\x18\x02 \x01(\t\"\xbc\x01\n\x0e\x42igQuerySource\x12+\n\x0epartition_date\x18\x06 \x01(\x0b\x32\x11.google.type.DateH\x00\x12\x12\n\nproject_id\x18\x05 \x01(\t\x12\x17\n\ndataset_id\x18\x01 \x01(\tB\x03\xe0\x41\x02\x12\x15\n\x08table_id\x18\x02 \x01(\tB\x03\xe0\x41\x02\x12\x17\n\x0fgcs_staging_dir\x18\x03 \x01(\t\x12\x13\n\x0b\x64\x61ta_schema\x18\x04 \x01(\tB\x0b\n\tpartition\"M\n\x13ProductInlineSource\x12\x36\n\x08products\x18\x01 \x03(\x0b\x32\x1f.google.cloud.retail.v2.ProductB\x03\xe0\x41\x02\"T\n\x15UserEventInlineSource\x12;\n\x0buser_events\x18\x01 \x03(\x0b\x32!.google.cloud.retail.v2.UserEventB\x03\xe0\x41\x02\"9\n\x12ImportErrorsConfig\x12\x14\n\ngcs_prefix\x18\x01 \x01(\tH\x00\x42\r\n\x0b\x64\x65stination\"\xf8\x03\n\x15ImportProductsRequest\x12\x34\n\x06parent\x18\x01 \x01(\tB$\xe0\x41\x02\xfa\x41\x1e\n\x1cretail.googleapis.com/Branch\x12\x16\n\nrequest_id\x18\x06 \x01(\tB\x02\x18\x01\x12\x45\n\x0cinput_config\x18\x02 \x01(\x0b\x32*.google.cloud.retail.v2.ProductInputConfigB\x03\xe0\x41\x02\x12\x41\n\rerrors_config\x18\x03 \x01(\x0b\x32*.google.cloud.retail.v2.ImportErrorsConfig\x12/\n\x0bupdate_mask\x18\x04 \x01(\x0b\x32\x1a.google.protobuf.FieldMask\x12]\n\x13reconciliation_mode\x18\x05 \x01(\x0e\x32@.google.cloud.retail.v2.ImportProductsRequest.ReconciliationMode\x12!\n\x19notification_pubsub_topic\x18\x07 \x01(\t\"T\n\x12ReconciliationMode\x12#\n\x1fRECONCILIATION_MODE_UNSPECIFIED\x10\x00\x12\x0f\n\x0bINCREMENTAL\x10\x01\x12\x08\n\x04\x46ULL\x10\x02\"\xdc\x01\n\x17ImportUserEventsRequest\x12\x35\n\x06parent\x18\x01 \x01(\tB%\xe0\x41\x02\xfa\x41\x1f\n\x1dretail.googleapis.com/Catalog\x12G\n\x0cinput_config\x18\x02 \x01(\x0b\x32,.google.cloud.retail.v2.UserEventInputConfigB\x03\xe0\x41\x02\x12\x41\n\rerrors_config\x18\x03 \x01(\x0b\x32*.google.cloud.retail.v2.ImportErrorsConfig\"\xc5\x01\n\x1bImportCompletionDataRequest\x12\x35\n\x06parent\x18\x01 \x01(\tB%\xe0\x41\x02\xfa\x41\x1f\n\x1dretail.googleapis.com/Catalog\x12L\n\x0cinput_config\x18\x02 \x01(\x0b\x32\x31.google.cloud.retail.v2.CompletionDataInputConfigB\x03\xe0\x41\x02\x12!\n\x19notification_pubsub_topic\x18\x03 \x01(\t\"\xe9\x01\n\x12ProductInputConfig\x12L\n\x15product_inline_source\x18\x01 \x01(\x0b\x32+.google.cloud.retail.v2.ProductInlineSourceH\x00\x12\x37\n\ngcs_source\x18\x02 \x01(\x0b\x32!.google.cloud.retail.v2.GcsSourceH\x00\x12\x42\n\x10\x62ig_query_source\x18\x03 \x01(\x0b\x32&.google.cloud.retail.v2.BigQuerySourceH\x00\x42\x08\n\x06source\"\xff\x01\n\x14UserEventInputConfig\x12V\n\x18user_event_inline_source\x18\x01 \x01(\x0b\x32-.google.cloud.retail.v2.UserEventInlineSourceB\x03\xe0\x41\x02H\x00\x12<\n\ngcs_source\x18\x02 \x01(\x0b\x32!.google.cloud.retail.v2.GcsSourceB\x03\xe0\x41\x02H\x00\x12G\n\x10\x62ig_query_source\x18\x03 \x01(\x0b\x32&.google.cloud.retail.v2.BigQuerySourceB\x03\xe0\x41\x02H\x00\x42\x08\n\x06source\"n\n\x19\x43ompletionDataInputConfig\x12G\n\x10\x62ig_query_source\x18\x01 \x01(\x0b\x32&.google.cloud.retail.v2.BigQuerySourceB\x03\xe0\x41\x02H\x00\x42\x08\n\x06source\"\xdb\x01\n\x0eImportMetadata\x12/\n\x0b\x63reate_time\x18\x01 \x01(\x0b\x32\x1a.google.protobuf.Timestamp\x12/\n\x0bupdate_time\x18\x02 \x01(\x0b\x32\x1a.google.protobuf.Timestamp\x12\x15\n\rsuccess_count\x18\x03 \x01(\x03\x12\x15\n\rfailure_count\x18\x04 \x01(\x03\x12\x16\n\nrequest_id\x18\x05 \x01(\tB\x02\x18\x01\x12!\n\x19notification_pubsub_topic\x18\x06 \x01(\t\"\x86\x01\n\x16ImportProductsResponse\x12)\n\rerror_samples\x18\x01 \x03(\x0b\x32\x12.google.rpc.Status\x12\x41\n\rerrors_config\x18\x02 \x01(\x0b\x32*.google.cloud.retail.v2.ImportErrorsConfig\"\xd0\x01\n\x18ImportUserEventsResponse\x12)\n\rerror_samples\x18\x01 \x03(\x0b\x32\x12.google.rpc.Status\x12\x41\n\rerrors_config\x18\x02 \x01(\x0b\x32*.google.cloud.retail.v2.ImportErrorsConfig\x12\x46\n\x0eimport_summary\x18\x03 \x01(\x0b\x32..google.cloud.retail.v2.UserEventImportSummary\"T\n\x16UserEventImportSummary\x12\x1b\n\x13joined_events_count\x18\x01 \x01(\x03\x12\x1d\n\x15unjoined_events_count\x18\x02 \x01(\x03\"I\n\x1cImportCompletionDataResponse\x12)\n\rerror_samples\x18\x01 \x03(\x0b\x32\x12.google.rpc.StatusB\xbc\x01\n\x1a\x63om.google.cloud.retail.v2B\x11ImportConfigProtoP\x01Z2cloud.google.com/go/retail/apiv2/retailpb;retailpb\xa2\x02\x06RETAIL\xaa\x02\x16Google.Cloud.Retail.V2\xca\x02\x16Google\\Cloud\\Retail\\V2\xea\x02\x19Google::Cloud::Retail::V2b\x06proto3" - -pool = ::Google::Protobuf::DescriptorPool.generated_pool -pool.add_serialized_file(descriptor_data) - -module Google - module Cloud - module Retail - module V2 - GcsSource = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.retail.v2.GcsSource").msgclass - BigQuerySource = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.retail.v2.BigQuerySource").msgclass - ProductInlineSource = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.retail.v2.ProductInlineSource").msgclass - UserEventInlineSource = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.retail.v2.UserEventInlineSource").msgclass - ImportErrorsConfig = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.retail.v2.ImportErrorsConfig").msgclass - ImportProductsRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.retail.v2.ImportProductsRequest").msgclass - ImportProductsRequest::ReconciliationMode = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.retail.v2.ImportProductsRequest.ReconciliationMode").enummodule - ImportUserEventsRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.retail.v2.ImportUserEventsRequest").msgclass - ImportCompletionDataRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.retail.v2.ImportCompletionDataRequest").msgclass - ProductInputConfig = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.retail.v2.ProductInputConfig").msgclass - UserEventInputConfig = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.retail.v2.UserEventInputConfig").msgclass - CompletionDataInputConfig = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.retail.v2.CompletionDataInputConfig").msgclass - ImportMetadata = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.retail.v2.ImportMetadata").msgclass - ImportProductsResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.retail.v2.ImportProductsResponse").msgclass - ImportUserEventsResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.retail.v2.ImportUserEventsResponse").msgclass - UserEventImportSummary = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.retail.v2.UserEventImportSummary").msgclass - ImportCompletionDataResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.retail.v2.ImportCompletionDataResponse").msgclass - end - end - end -end diff --git a/owl-bot-staging/google-cloud-retail-v2/lib/google/cloud/retail/v2/model_pb.rb b/owl-bot-staging/google-cloud-retail-v2/lib/google/cloud/retail/v2/model_pb.rb deleted file mode 100644 index 037bc3c8d29c..000000000000 --- a/owl-bot-staging/google-cloud-retail-v2/lib/google/cloud/retail/v2/model_pb.rb +++ /dev/null @@ -1,34 +0,0 @@ -# frozen_string_literal: true -# Generated by the protocol buffer compiler. DO NOT EDIT! -# source: google/cloud/retail/v2/model.proto - -require 'google/protobuf' - -require 'google/api/field_behavior_pb' -require 'google/api/resource_pb' -require 'google/cloud/retail/v2/common_pb' -require 'google/protobuf/timestamp_pb' - - -descriptor_data = "\n\"google/cloud/retail/v2/model.proto\x12\x16google.cloud.retail.v2\x1a\x1fgoogle/api/field_behavior.proto\x1a\x19google/api/resource.proto\x1a#google/cloud/retail/v2/common.proto\x1a\x1fgoogle/protobuf/timestamp.proto\"\x97\x0e\n\x05Model\x12\x11\n\x04name\x18\x01 \x01(\tB\x03\xe0\x41\x02\x12\x19\n\x0c\x64isplay_name\x18\x02 \x01(\tB\x03\xe0\x41\x02\x12H\n\x0etraining_state\x18\x03 \x01(\x0e\x32+.google.cloud.retail.v2.Model.TrainingStateB\x03\xe0\x41\x01\x12\x46\n\rserving_state\x18\x04 \x01(\x0e\x32*.google.cloud.retail.v2.Model.ServingStateB\x03\xe0\x41\x03\x12\x34\n\x0b\x63reate_time\x18\x05 \x01(\x0b\x32\x1a.google.protobuf.TimestampB\x03\xe0\x41\x03\x12\x34\n\x0bupdate_time\x18\x06 \x01(\x0b\x32\x1a.google.protobuf.TimestampB\x03\xe0\x41\x03\x12\x11\n\x04type\x18\x07 \x01(\tB\x03\xe0\x41\x02\x12#\n\x16optimization_objective\x18\x08 \x01(\tB\x03\xe0\x41\x01\x12U\n\x15periodic_tuning_state\x18\x0b \x01(\x0e\x32\x31.google.cloud.retail.v2.Model.PeriodicTuningStateB\x03\xe0\x41\x01\x12\x37\n\x0elast_tune_time\x18\x0c \x01(\x0b\x32\x1a.google.protobuf.TimestampB\x03\xe0\x41\x03\x12\x1d\n\x10tuning_operation\x18\x0f \x01(\tB\x03\xe0\x41\x03\x12@\n\ndata_state\x18\x10 \x01(\x0e\x32\'.google.cloud.retail.v2.Model.DataStateB\x03\xe0\x41\x03\x12U\n\x10\x66iltering_option\x18\x12 \x01(\x0e\x32\x36.google.cloud.retail.v2.RecommendationsFilteringOptionB\x03\xe0\x41\x01\x12R\n\x14serving_config_lists\x18\x13 \x03(\x0b\x32/.google.cloud.retail.v2.Model.ServingConfigListB\x03\xe0\x41\x03\x12U\n\x15model_features_config\x18\x16 \x01(\x0b\x32\x31.google.cloud.retail.v2.Model.ModelFeaturesConfigB\x03\xe0\x41\x01\x1a\x34\n\x11ServingConfigList\x12\x1f\n\x12serving_config_ids\x18\x01 \x03(\tB\x03\xe0\x41\x01\x1a\x7f\n&FrequentlyBoughtTogetherFeaturesConfig\x12U\n\x15\x63ontext_products_type\x18\x02 \x01(\x0e\x32\x31.google.cloud.retail.v2.Model.ContextProductsTypeB\x03\xe0\x41\x01\x1a\xa1\x01\n\x13ModelFeaturesConfig\x12q\n!frequently_bought_together_config\x18\x01 \x01(\x0b\x32\x44.google.cloud.retail.v2.Model.FrequentlyBoughtTogetherFeaturesConfigH\x00\x42\x17\n\x15type_dedicated_config\"R\n\x0cServingState\x12\x1d\n\x19SERVING_STATE_UNSPECIFIED\x10\x00\x12\x0c\n\x08INACTIVE\x10\x01\x12\n\n\x06\x41\x43TIVE\x10\x02\x12\t\n\x05TUNED\x10\x03\"I\n\rTrainingState\x12\x1e\n\x1aTRAINING_STATE_UNSPECIFIED\x10\x00\x12\n\n\x06PAUSED\x10\x01\x12\x0c\n\x08TRAINING\x10\x02\"\x90\x01\n\x13PeriodicTuningState\x12%\n!PERIODIC_TUNING_STATE_UNSPECIFIED\x10\x00\x12\x1c\n\x18PERIODIC_TUNING_DISABLED\x10\x01\x12\x17\n\x13\x41LL_TUNING_DISABLED\x10\x03\x12\x1b\n\x17PERIODIC_TUNING_ENABLED\x10\x02\"D\n\tDataState\x12\x1a\n\x16\x44\x41TA_STATE_UNSPECIFIED\x10\x00\x12\x0b\n\x07\x44\x41TA_OK\x10\x01\x12\x0e\n\nDATA_ERROR\x10\x02\"w\n\x13\x43ontextProductsType\x12%\n!CONTEXT_PRODUCTS_TYPE_UNSPECIFIED\x10\x00\x12\x1a\n\x16SINGLE_CONTEXT_PRODUCT\x10\x01\x12\x1d\n\x19MULTIPLE_CONTEXT_PRODUCTS\x10\x02:k\xea\x41h\n\x1bretail.googleapis.com/Model\x12Iprojects/{project}/locations/{location}/catalogs/{catalog}/models/{model}B\xb5\x01\n\x1a\x63om.google.cloud.retail.v2B\nModelProtoP\x01Z2cloud.google.com/go/retail/apiv2/retailpb;retailpb\xa2\x02\x06RETAIL\xaa\x02\x16Google.Cloud.Retail.V2\xca\x02\x16Google\\Cloud\\Retail\\V2\xea\x02\x19Google::Cloud::Retail::V2b\x06proto3" - -pool = ::Google::Protobuf::DescriptorPool.generated_pool -pool.add_serialized_file(descriptor_data) - -module Google - module Cloud - module Retail - module V2 - Model = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.retail.v2.Model").msgclass - Model::ServingConfigList = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.retail.v2.Model.ServingConfigList").msgclass - Model::FrequentlyBoughtTogetherFeaturesConfig = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.retail.v2.Model.FrequentlyBoughtTogetherFeaturesConfig").msgclass - Model::ModelFeaturesConfig = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.retail.v2.Model.ModelFeaturesConfig").msgclass - Model::ServingState = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.retail.v2.Model.ServingState").enummodule - Model::TrainingState = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.retail.v2.Model.TrainingState").enummodule - Model::PeriodicTuningState = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.retail.v2.Model.PeriodicTuningState").enummodule - Model::DataState = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.retail.v2.Model.DataState").enummodule - Model::ContextProductsType = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.retail.v2.Model.ContextProductsType").enummodule - end - end - end -end diff --git a/owl-bot-staging/google-cloud-retail-v2/lib/google/cloud/retail/v2/model_service.rb b/owl-bot-staging/google-cloud-retail-v2/lib/google/cloud/retail/v2/model_service.rb deleted file mode 100644 index 7494180ffbb2..000000000000 --- a/owl-bot-staging/google-cloud-retail-v2/lib/google/cloud/retail/v2/model_service.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 "gapic/common" -require "gapic/config" -require "gapic/config/method" - -require "google/cloud/retail/v2/version" - -require "google/cloud/retail/v2/model_service/credentials" -require "google/cloud/retail/v2/model_service/paths" -require "google/cloud/retail/v2/model_service/operations" -require "google/cloud/retail/v2/model_service/client" -require "google/cloud/retail/v2/model_service/rest" - -module Google - module Cloud - module Retail - module V2 - ## - # Service for performing CRUD operations on models. - # Recommendation models contain all the metadata necessary to generate a set of - # models for the `Predict()` API. A model is queried - # indirectly via a ServingConfig, which associates a model with a - # given Placement (e.g. Frequently Bought Together on Home Page). - # - # This service allows you to do the following: - # - # * Initiate training of a model. - # * Pause training of an existing model. - # * List all the available models along with their metadata. - # * Control their tuning schedule. - # - # @example Load this service and instantiate a gRPC client - # - # require "google/cloud/retail/v2/model_service" - # client = ::Google::Cloud::Retail::V2::ModelService::Client.new - # - # @example Load this service and instantiate a REST client - # - # require "google/cloud/retail/v2/model_service/rest" - # client = ::Google::Cloud::Retail::V2::ModelService::Rest::Client.new - # - module ModelService - end - end - end - end -end - -helper_path = ::File.join __dir__, "model_service", "helpers.rb" -require "google/cloud/retail/v2/model_service/helpers" if ::File.file? helper_path diff --git a/owl-bot-staging/google-cloud-retail-v2/lib/google/cloud/retail/v2/model_service/client.rb b/owl-bot-staging/google-cloud-retail-v2/lib/google/cloud/retail/v2/model_service/client.rb deleted file mode 100644 index 0e6782b10c3c..000000000000 --- a/owl-bot-staging/google-cloud-retail-v2/lib/google/cloud/retail/v2/model_service/client.rb +++ /dev/null @@ -1,1219 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -require "google/cloud/errors" -require "google/cloud/retail/v2/model_service_pb" -require "google/cloud/location" - -module Google - module Cloud - module Retail - module V2 - module ModelService - ## - # Client for the ModelService service. - # - # Service for performing CRUD operations on models. - # Recommendation models contain all the metadata necessary to generate a set of - # models for the `Predict()` API. A model is queried - # indirectly via a ServingConfig, which associates a model with a - # given Placement (e.g. Frequently Bought Together on Home Page). - # - # This service allows you to do the following: - # - # * Initiate training of a model. - # * Pause training of an existing model. - # * List all the available models along with their metadata. - # * Control their tuning schedule. - # - class Client - # @private - API_VERSION = "" - - # @private - DEFAULT_ENDPOINT_TEMPLATE = "retail.$UNIVERSE_DOMAIN$" - - include Paths - - # @private - attr_reader :model_service_stub - - ## - # Configure the ModelService Client class. - # - # See {::Google::Cloud::Retail::V2::ModelService::Client::Configuration} - # for a description of the configuration fields. - # - # @example - # - # # Modify the configuration for all ModelService clients - # ::Google::Cloud::Retail::V2::ModelService::Client.configure do |config| - # config.timeout = 10.0 - # end - # - # @yield [config] Configure the Client client. - # @yieldparam config [Client::Configuration] - # - # @return [Client::Configuration] - # - def self.configure - @configure ||= begin - namespace = ["Google", "Cloud", "Retail", "V2"] - parent_config = while namespace.any? - parent_name = namespace.join "::" - parent_const = const_get parent_name - break parent_const.configure if parent_const.respond_to? :configure - namespace.pop - end - default_config = Client::Configuration.new parent_config - - default_config.timeout = 60.0 - default_config.retry_policy = { - initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [14, 4] - } - - default_config - end - yield @configure if block_given? - @configure - end - - ## - # Configure the ModelService Client instance. - # - # The configuration is set to the derived mode, meaning that values can be changed, - # but structural changes (adding new fields, etc.) are not allowed. Structural changes - # should be made on {Client.configure}. - # - # See {::Google::Cloud::Retail::V2::ModelService::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 - @model_service_stub.universe_domain - end - - ## - # Create a new ModelService client object. - # - # @example - # - # # Create a client using the default configuration - # client = ::Google::Cloud::Retail::V2::ModelService::Client.new - # - # # Create a client using a custom configuration - # client = ::Google::Cloud::Retail::V2::ModelService::Client.new do |config| - # config.timeout = 10.0 - # end - # - # @yield [config] Configure the ModelService client. - # @yieldparam config [Client::Configuration] - # - def initialize - # These require statements are intentionally placed here to initialize - # the gRPC module only when it's required. - # See https://github.com/googleapis/toolkit/issues/446 - require "gapic/grpc" - require "google/cloud/retail/v2/model_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 - - @model_service_stub = ::Gapic::ServiceStub.new( - ::Google::Cloud::Retail::V2::ModelService::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 - ) - - @model_service_stub.stub_logger&.info do |entry| - entry.set_system_name - entry.set_service - entry.message = "Created client for #{entry.service}" - entry.set_credentials_fields credentials - entry.set "customEndpoint", @config.endpoint if @config.endpoint - entry.set "defaultTimeout", @config.timeout if @config.timeout - entry.set "quotaProject", @quota_project_id if @quota_project_id - end - - @location_client = Google::Cloud::Location::Locations::Client.new do |config| - config.credentials = credentials - config.quota_project = @quota_project_id - config.endpoint = @model_service_stub.endpoint - config.universe_domain = @model_service_stub.universe_domain - config.logger = @model_service_stub.logger if config.respond_to? :logger= - end - end - - ## - # Get the associated client for long-running operations. - # - # @return [::Google::Cloud::Retail::V2::ModelService::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 - @model_service_stub.logger - end - - # Service calls - - ## - # Creates a new model. - # - # @overload create_model(request, options = nil) - # Pass arguments to `create_model` via a request object, either of type - # {::Google::Cloud::Retail::V2::CreateModelRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Retail::V2::CreateModelRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_model(parent: nil, model: nil, dry_run: nil) - # Pass arguments to `create_model` via keyword arguments. Note that at - # least one keyword argument is 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 under which to create the model. Format: - # `projects/{project_number}/locations/{location_id}/catalogs/{catalog_id}` - # @param model [::Google::Cloud::Retail::V2::Model, ::Hash] - # Required. The payload of the {::Google::Cloud::Retail::V2::Model Model} to - # create. - # @param dry_run [::Boolean] - # Optional. Whether to run a dry run to validate the request (without - # actually creating the model). - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Gapic::Operation] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Gapic::Operation] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/cloud/retail/v2" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Retail::V2::ModelService::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Retail::V2::CreateModelRequest.new - # - # # Call the create_model method. - # result = client.create_model 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_model request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Retail::V2::CreateModelRequest - - # Converts hash 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_model.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::Retail::V2::VERSION - metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - header_params = {} - if request.parent - 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_model.timeout, - metadata: metadata, - retry_policy: @config.rpcs.create_model.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @model_service_stub.call_rpc :create_model, 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 model. - # - # @overload get_model(request, options = nil) - # Pass arguments to `get_model` via a request object, either of type - # {::Google::Cloud::Retail::V2::GetModelRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Retail::V2::GetModelRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_model(name: nil) - # Pass arguments to `get_model` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param name [::String] - # Required. The resource name of the {::Google::Cloud::Retail::V2::Model Model} to - # get. Format: - # `projects/{project_number}/locations/{location_id}/catalogs/{catalog}/models/{model_id}` - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Google::Cloud::Retail::V2::Model] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Google::Cloud::Retail::V2::Model] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/cloud/retail/v2" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Retail::V2::ModelService::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Retail::V2::GetModelRequest.new - # - # # Call the get_model method. - # result = client.get_model request - # - # # The returned object is of type Google::Cloud::Retail::V2::Model. - # p result - # - def get_model request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Retail::V2::GetModelRequest - - # Converts hash 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_model.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::Retail::V2::VERSION - metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - header_params = {} - if request.name - header_params["name"] = request.name - end - - request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") - metadata[:"x-goog-request-params"] ||= request_params_header - - options.apply_defaults timeout: @config.rpcs.get_model.timeout, - metadata: metadata, - retry_policy: @config.rpcs.get_model.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @model_service_stub.call_rpc :get_model, request, options: options do |response, operation| - yield response, operation if block_given? - end - rescue ::GRPC::BadStatus => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Pauses the training of an existing model. - # - # @overload pause_model(request, options = nil) - # Pass arguments to `pause_model` via a request object, either of type - # {::Google::Cloud::Retail::V2::PauseModelRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Retail::V2::PauseModelRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. - # - # @overload pause_model(name: nil) - # Pass arguments to `pause_model` via keyword arguments. Note that at - # least one keyword argument is 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 model to pause. - # Format: - # `projects/{project_number}/locations/{location_id}/catalogs/{catalog_id}/models/{model_id}` - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Google::Cloud::Retail::V2::Model] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Google::Cloud::Retail::V2::Model] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/cloud/retail/v2" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Retail::V2::ModelService::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Retail::V2::PauseModelRequest.new - # - # # Call the pause_model method. - # result = client.pause_model request - # - # # The returned object is of type Google::Cloud::Retail::V2::Model. - # p result - # - def pause_model request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Retail::V2::PauseModelRequest - - # Converts hash and nil to an options object - options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h - - # Customize the options with defaults - metadata = @config.rpcs.pause_model.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::Retail::V2::VERSION - metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - header_params = {} - if request.name - header_params["name"] = request.name - end - - request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") - metadata[:"x-goog-request-params"] ||= request_params_header - - options.apply_defaults timeout: @config.rpcs.pause_model.timeout, - metadata: metadata, - retry_policy: @config.rpcs.pause_model.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @model_service_stub.call_rpc :pause_model, request, options: options do |response, operation| - yield response, operation if block_given? - end - rescue ::GRPC::BadStatus => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Resumes the training of an existing model. - # - # @overload resume_model(request, options = nil) - # Pass arguments to `resume_model` via a request object, either of type - # {::Google::Cloud::Retail::V2::ResumeModelRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Retail::V2::ResumeModelRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. - # - # @overload resume_model(name: nil) - # Pass arguments to `resume_model` via keyword arguments. Note that at - # least one keyword argument is 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 model to resume. - # Format: - # `projects/{project_number}/locations/{location_id}/catalogs/{catalog_id}/models/{model_id}` - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Google::Cloud::Retail::V2::Model] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Google::Cloud::Retail::V2::Model] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/cloud/retail/v2" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Retail::V2::ModelService::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Retail::V2::ResumeModelRequest.new - # - # # Call the resume_model method. - # result = client.resume_model request - # - # # The returned object is of type Google::Cloud::Retail::V2::Model. - # p result - # - def resume_model request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Retail::V2::ResumeModelRequest - - # Converts hash and nil to an options object - options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h - - # Customize the options with defaults - metadata = @config.rpcs.resume_model.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::Retail::V2::VERSION - metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - header_params = {} - if request.name - header_params["name"] = request.name - end - - request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") - metadata[:"x-goog-request-params"] ||= request_params_header - - options.apply_defaults timeout: @config.rpcs.resume_model.timeout, - metadata: metadata, - retry_policy: @config.rpcs.resume_model.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @model_service_stub.call_rpc :resume_model, request, options: options do |response, operation| - yield response, operation if block_given? - end - rescue ::GRPC::BadStatus => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Deletes an existing model. - # - # @overload delete_model(request, options = nil) - # Pass arguments to `delete_model` via a request object, either of type - # {::Google::Cloud::Retail::V2::DeleteModelRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Retail::V2::DeleteModelRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_model(name: nil) - # Pass arguments to `delete_model` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param name [::String] - # Required. The resource name of the {::Google::Cloud::Retail::V2::Model Model} to - # delete. Format: - # `projects/{project_number}/locations/{location_id}/catalogs/{catalog_id}/models/{model_id}` - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Google::Protobuf::Empty] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Google::Protobuf::Empty] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/cloud/retail/v2" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Retail::V2::ModelService::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Retail::V2::DeleteModelRequest.new - # - # # Call the delete_model method. - # result = client.delete_model request - # - # # The returned object is of type Google::Protobuf::Empty. - # p result - # - def delete_model request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Retail::V2::DeleteModelRequest - - # Converts hash 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_model.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::Retail::V2::VERSION - metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - header_params = {} - if request.name - header_params["name"] = request.name - end - - request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") - metadata[:"x-goog-request-params"] ||= request_params_header - - options.apply_defaults timeout: @config.rpcs.delete_model.timeout, - metadata: metadata, - retry_policy: @config.rpcs.delete_model.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @model_service_stub.call_rpc :delete_model, request, options: options do |response, operation| - yield response, operation if block_given? - end - rescue ::GRPC::BadStatus => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Lists all the models linked to this event store. - # - # @overload list_models(request, options = nil) - # Pass arguments to `list_models` via a request object, either of type - # {::Google::Cloud::Retail::V2::ListModelsRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Retail::V2::ListModelsRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_models(parent: nil, page_size: nil, page_token: nil) - # Pass arguments to `list_models` via keyword arguments. Note that at - # least one keyword argument is 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 for which to list models. - # Format: - # `projects/{project_number}/locations/{location_id}/catalogs/{catalog_id}` - # @param page_size [::Integer] - # Optional. Maximum number of results to return. If unspecified, defaults - # to 50. Max allowed value is 1000. - # @param page_token [::String] - # Optional. A page token, received from a previous `ListModels` - # call. Provide this to retrieve the subsequent page. - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Gapic::PagedEnumerable<::Google::Cloud::Retail::V2::Model>] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Gapic::PagedEnumerable<::Google::Cloud::Retail::V2::Model>] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/cloud/retail/v2" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Retail::V2::ModelService::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Retail::V2::ListModelsRequest.new - # - # # Call the list_models method. - # result = client.list_models request - # - # # The returned object is of type Gapic::PagedEnumerable. You can iterate - # # over elements, and API calls will be issued to fetch pages as needed. - # result.each do |item| - # # Each element is of type ::Google::Cloud::Retail::V2::Model. - # p item - # end - # - def list_models request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Retail::V2::ListModelsRequest - - # Converts hash 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_models.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::Retail::V2::VERSION - metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - header_params = {} - if request.parent - 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_models.timeout, - metadata: metadata, - retry_policy: @config.rpcs.list_models.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @model_service_stub.call_rpc :list_models, request, options: options do |response, operation| - response = ::Gapic::PagedEnumerable.new @model_service_stub, :list_models, 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 - - ## - # Update of model metadata. Only fields that - # currently can be updated are: `filtering_option` and - # `periodic_tuning_state`. - # If other values are provided, this API method ignores them. - # - # @overload update_model(request, options = nil) - # Pass arguments to `update_model` via a request object, either of type - # {::Google::Cloud::Retail::V2::UpdateModelRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Retail::V2::UpdateModelRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_model(model: nil, update_mask: nil) - # Pass arguments to `update_model` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param model [::Google::Cloud::Retail::V2::Model, ::Hash] - # Required. The body of the updated {::Google::Cloud::Retail::V2::Model Model}. - # @param update_mask [::Google::Protobuf::FieldMask, ::Hash] - # Optional. Indicates which fields in the provided 'model' to - # update. If not set, by default updates all fields. - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Google::Cloud::Retail::V2::Model] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Google::Cloud::Retail::V2::Model] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/cloud/retail/v2" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Retail::V2::ModelService::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Retail::V2::UpdateModelRequest.new - # - # # Call the update_model method. - # result = client.update_model request - # - # # The returned object is of type Google::Cloud::Retail::V2::Model. - # p result - # - def update_model request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Retail::V2::UpdateModelRequest - - # Converts hash 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_model.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::Retail::V2::VERSION - metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - header_params = {} - if request.model&.name - header_params["model.name"] = request.model.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_model.timeout, - metadata: metadata, - retry_policy: @config.rpcs.update_model.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @model_service_stub.call_rpc :update_model, 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 - - ## - # Tunes an existing model. - # - # @overload tune_model(request, options = nil) - # Pass arguments to `tune_model` via a request object, either of type - # {::Google::Cloud::Retail::V2::TuneModelRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Retail::V2::TuneModelRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. - # - # @overload tune_model(name: nil) - # Pass arguments to `tune_model` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param name [::String] - # Required. The resource name of the model to tune. - # Format: - # `projects/{project_number}/locations/{location_id}/catalogs/{catalog_id}/models/{model_id}` - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Gapic::Operation] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Gapic::Operation] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/cloud/retail/v2" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Retail::V2::ModelService::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Retail::V2::TuneModelRequest.new - # - # # Call the tune_model method. - # result = client.tune_model 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 tune_model request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Retail::V2::TuneModelRequest - - # Converts hash 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.tune_model.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::Retail::V2::VERSION - metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - header_params = {} - if request.name - header_params["name"] = request.name - end - - request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") - metadata[:"x-goog-request-params"] ||= request_params_header - - options.apply_defaults timeout: @config.rpcs.tune_model.timeout, - metadata: metadata, - retry_policy: @config.rpcs.tune_model.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @model_service_stub.call_rpc :tune_model, 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 ModelService API. - # - # This class represents the configuration for ModelService, - # providing control over timeouts, retry behavior, logging, transport - # parameters, and other low-level controls. Certain parameters can also be - # applied individually to specific RPCs. See - # {::Google::Cloud::Retail::V2::ModelService::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_model to 20 seconds, - # # and all remaining timeouts to 10 seconds. - # ::Google::Cloud::Retail::V2::ModelService::Client.configure do |config| - # config.timeout = 10.0 - # config.rpcs.create_model.timeout = 20.0 - # end - # - # # Apply the above configuration only to a new client. - # client = ::Google::Cloud::Retail::V2::ModelService::Client.new do |config| - # config.timeout = 10.0 - # config.rpcs.create_model.timeout = 20.0 - # end - # - # @!attribute [rw] endpoint - # A custom service endpoint, as a hostname or hostname:port. The default is - # nil, indicating to use the default endpoint in the current universe domain. - # @return [::String,nil] - # @!attribute [rw] credentials - # Credentials to send with calls. You may provide any of the following types: - # * (`Google::Auth::Credentials`) A googleauth credentials object - # (see the [googleauth docs](https://rubydoc.info/gems/googleauth/Google/Auth/Credentials)) - # * (`Signet::OAuth2::Client`) A signet oauth2 client object - # (see the [signet docs](https://rubydoc.info/gems/signet/Signet/OAuth2/Client)) - # * (`GRPC::Core::Channel`) a gRPC channel with included credentials - # * (`GRPC::Core::ChannelCredentials`) a gRPC credentails object - # * (`nil`) indicating no credentials - # - # @note Warning: Passing a `String` to a keyfile path or a `Hash` of credentials - # is deprecated. Providing an unvalidated credential configuration to - # Google APIs can compromise the security of your systems and data. - # - # @example - # - # # The recommended way to provide credentials is to use the `make_creds` method - # # on the appropriate credentials class for your environment. - # - # require "googleauth" - # - # credentials = ::Google::Auth::ServiceAccountCredentials.make_creds( - # json_key_io: ::File.open("/path/to/keyfile.json") - # ) - # - # client = ::Google::Cloud::Retail::V2::ModelService::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 = "retail.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 ModelService 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_model` - # @return [::Gapic::Config::Method] - # - attr_reader :create_model - ## - # RPC-specific configuration for `get_model` - # @return [::Gapic::Config::Method] - # - attr_reader :get_model - ## - # RPC-specific configuration for `pause_model` - # @return [::Gapic::Config::Method] - # - attr_reader :pause_model - ## - # RPC-specific configuration for `resume_model` - # @return [::Gapic::Config::Method] - # - attr_reader :resume_model - ## - # RPC-specific configuration for `delete_model` - # @return [::Gapic::Config::Method] - # - attr_reader :delete_model - ## - # RPC-specific configuration for `list_models` - # @return [::Gapic::Config::Method] - # - attr_reader :list_models - ## - # RPC-specific configuration for `update_model` - # @return [::Gapic::Config::Method] - # - attr_reader :update_model - ## - # RPC-specific configuration for `tune_model` - # @return [::Gapic::Config::Method] - # - attr_reader :tune_model - - # @private - def initialize parent_rpcs = nil - create_model_config = parent_rpcs.create_model if parent_rpcs.respond_to? :create_model - @create_model = ::Gapic::Config::Method.new create_model_config - get_model_config = parent_rpcs.get_model if parent_rpcs.respond_to? :get_model - @get_model = ::Gapic::Config::Method.new get_model_config - pause_model_config = parent_rpcs.pause_model if parent_rpcs.respond_to? :pause_model - @pause_model = ::Gapic::Config::Method.new pause_model_config - resume_model_config = parent_rpcs.resume_model if parent_rpcs.respond_to? :resume_model - @resume_model = ::Gapic::Config::Method.new resume_model_config - delete_model_config = parent_rpcs.delete_model if parent_rpcs.respond_to? :delete_model - @delete_model = ::Gapic::Config::Method.new delete_model_config - list_models_config = parent_rpcs.list_models if parent_rpcs.respond_to? :list_models - @list_models = ::Gapic::Config::Method.new list_models_config - update_model_config = parent_rpcs.update_model if parent_rpcs.respond_to? :update_model - @update_model = ::Gapic::Config::Method.new update_model_config - tune_model_config = parent_rpcs.tune_model if parent_rpcs.respond_to? :tune_model - @tune_model = ::Gapic::Config::Method.new tune_model_config - - yield self if block_given? - end - end - end - end - end - end - end - end -end diff --git a/owl-bot-staging/google-cloud-retail-v2/lib/google/cloud/retail/v2/model_service/credentials.rb b/owl-bot-staging/google-cloud-retail-v2/lib/google/cloud/retail/v2/model_service/credentials.rb deleted file mode 100644 index acf6300e811b..000000000000 --- a/owl-bot-staging/google-cloud-retail-v2/lib/google/cloud/retail/v2/model_service/credentials.rb +++ /dev/null @@ -1,51 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -require "googleauth" - -module Google - module Cloud - module Retail - module V2 - module ModelService - # Credentials for the ModelService API. - class Credentials < ::Google::Auth::Credentials - self.scope = [ - "https://www.googleapis.com/auth/cloud-platform" - ] - self.env_vars = [ - "RETAIL_CREDENTIALS", - "RETAIL_KEYFILE", - "GOOGLE_CLOUD_CREDENTIALS", - "GOOGLE_CLOUD_KEYFILE", - "GCLOUD_KEYFILE", - "RETAIL_CREDENTIALS_JSON", - "RETAIL_KEYFILE_JSON", - "GOOGLE_CLOUD_CREDENTIALS_JSON", - "GOOGLE_CLOUD_KEYFILE_JSON", - "GCLOUD_KEYFILE_JSON" - ] - self.paths = [ - "~/.config/google_cloud/application_default_credentials.json" - ] - end - end - end - end - end -end diff --git a/owl-bot-staging/google-cloud-retail-v2/lib/google/cloud/retail/v2/model_service/operations.rb b/owl-bot-staging/google-cloud-retail-v2/lib/google/cloud/retail/v2/model_service/operations.rb deleted file mode 100644 index 0366921a292a..000000000000 --- a/owl-bot-staging/google-cloud-retail-v2/lib/google/cloud/retail/v2/model_service/operations.rb +++ /dev/null @@ -1,841 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -require "gapic/operation" -require "google/longrunning/operations_pb" - -module Google - module Cloud - module Retail - module V2 - module ModelService - # Service that implements Longrunning Operations API. - class Operations - # @private - API_VERSION = "" - - # @private - DEFAULT_ENDPOINT_TEMPLATE = "retail.$UNIVERSE_DOMAIN$" - - # @private - attr_reader :operations_stub - - ## - # Configuration for the ModelService 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 ModelService 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::Retail::V2::VERSION - metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - header_params = {} - if request.name - header_params["name"] = request.name - end - - request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") - metadata[:"x-goog-request-params"] ||= request_params_header - - options.apply_defaults timeout: @config.rpcs.list_operations.timeout, - metadata: metadata, - retry_policy: @config.rpcs.list_operations.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @operations_stub.call_rpc :list_operations, request, options: options do |response, operation| - wrap_lro_operation = ->(op_response) { ::Gapic::Operation.new op_response, @operations_client } - response = ::Gapic::PagedEnumerable.new @operations_stub, :list_operations, request, response, operation, options, format_resource: wrap_lro_operation - yield response, operation if block_given? - throw :response, response - end - rescue ::GRPC::BadStatus => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Gets the latest state of a long-running operation. Clients can use this - # method to poll the operation result at intervals as recommended by the API - # service. - # - # @overload get_operation(request, options = nil) - # Pass arguments to `get_operation` via a request object, either of type - # {::Google::Longrunning::GetOperationRequest} or an equivalent Hash. - # - # @param request [::Google::Longrunning::GetOperationRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. - # - # @overload get_operation(name: nil) - # Pass arguments to `get_operation` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param name [::String] - # The name of the operation resource. - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Gapic::Operation] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Gapic::Operation] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/longrunning" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Longrunning::Operations::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Longrunning::GetOperationRequest.new - # - # # Call the get_operation method. - # result = client.get_operation request - # - # # The returned object is of type Gapic::Operation. You can use it to - # # check the status of an operation, cancel it, or wait for results. - # # Here is how to wait for a response. - # result.wait_until_done! timeout: 60 - # if result.response? - # p result.response - # else - # puts "No response received." - # end - # - def get_operation request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Longrunning::GetOperationRequest - - # Converts hash and nil to an options object - options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h - - # Customize the options with defaults - metadata = @config.rpcs.get_operation.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::Retail::V2::VERSION - metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - header_params = {} - if request.name - header_params["name"] = request.name - end - - request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") - metadata[:"x-goog-request-params"] ||= request_params_header - - options.apply_defaults timeout: @config.rpcs.get_operation.timeout, - metadata: metadata, - retry_policy: @config.rpcs.get_operation.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @operations_stub.call_rpc :get_operation, request, options: options do |response, operation| - response = ::Gapic::Operation.new response, @operations_client, options: options - yield response, operation if block_given? - throw :response, response - end - rescue ::GRPC::BadStatus => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Deletes a long-running operation. This method indicates that the client is - # no longer interested in the operation result. It does not cancel the - # operation. If the server doesn't support this method, it returns - # `google.rpc.Code.UNIMPLEMENTED`. - # - # @overload delete_operation(request, options = nil) - # Pass arguments to `delete_operation` via a request object, either of type - # {::Google::Longrunning::DeleteOperationRequest} or an equivalent Hash. - # - # @param request [::Google::Longrunning::DeleteOperationRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. - # - # @overload delete_operation(name: nil) - # Pass arguments to `delete_operation` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param name [::String] - # The name of the operation resource to be deleted. - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Google::Protobuf::Empty] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Google::Protobuf::Empty] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/longrunning" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Longrunning::Operations::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Longrunning::DeleteOperationRequest.new - # - # # Call the delete_operation method. - # result = client.delete_operation request - # - # # The returned object is of type Google::Protobuf::Empty. - # p result - # - def delete_operation request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Longrunning::DeleteOperationRequest - - # Converts hash and nil to an options object - options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h - - # Customize the options with defaults - metadata = @config.rpcs.delete_operation.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::Retail::V2::VERSION - metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - header_params = {} - if request.name - header_params["name"] = request.name - end - - request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") - metadata[:"x-goog-request-params"] ||= request_params_header - - options.apply_defaults timeout: @config.rpcs.delete_operation.timeout, - metadata: metadata, - retry_policy: @config.rpcs.delete_operation.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @operations_stub.call_rpc :delete_operation, request, options: options do |response, operation| - yield response, operation if block_given? - end - rescue ::GRPC::BadStatus => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Starts asynchronous cancellation on a long-running operation. The server - # makes a best effort to cancel the operation, but success is not - # guaranteed. If the server doesn't support this method, it returns - # `google.rpc.Code.UNIMPLEMENTED`. Clients can use - # Operations.GetOperation or - # other methods to check whether the cancellation succeeded or whether the - # operation completed despite cancellation. On successful cancellation, - # the operation is not deleted; instead, it becomes an operation with - # an {::Google::Longrunning::Operation#error Operation.error} value with a - # {::Google::Rpc::Status#code google.rpc.Status.code} of `1`, corresponding to - # `Code.CANCELLED`. - # - # @overload cancel_operation(request, options = nil) - # Pass arguments to `cancel_operation` via a request object, either of type - # {::Google::Longrunning::CancelOperationRequest} or an equivalent Hash. - # - # @param request [::Google::Longrunning::CancelOperationRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. - # - # @overload cancel_operation(name: nil) - # Pass arguments to `cancel_operation` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param name [::String] - # The name of the operation resource to be cancelled. - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Google::Protobuf::Empty] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Google::Protobuf::Empty] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/longrunning" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Longrunning::Operations::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Longrunning::CancelOperationRequest.new - # - # # Call the cancel_operation method. - # result = client.cancel_operation request - # - # # The returned object is of type Google::Protobuf::Empty. - # p result - # - def cancel_operation request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Longrunning::CancelOperationRequest - - # Converts hash and nil to an options object - options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h - - # Customize the options with defaults - metadata = @config.rpcs.cancel_operation.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::Retail::V2::VERSION - metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - header_params = {} - if request.name - header_params["name"] = request.name - end - - request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") - metadata[:"x-goog-request-params"] ||= request_params_header - - options.apply_defaults timeout: @config.rpcs.cancel_operation.timeout, - metadata: metadata, - retry_policy: @config.rpcs.cancel_operation.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @operations_stub.call_rpc :cancel_operation, request, options: options do |response, operation| - yield response, operation if block_given? - end - rescue ::GRPC::BadStatus => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Waits until the specified long-running operation is done or reaches at most - # a specified timeout, returning the latest state. If the operation is - # already done, the latest state is immediately returned. If the timeout - # specified is greater than the default HTTP/RPC timeout, the HTTP/RPC - # timeout is used. If the server does not support this method, it returns - # `google.rpc.Code.UNIMPLEMENTED`. - # Note that this method is on a best-effort basis. It may return the latest - # state before the specified timeout (including immediately), meaning even an - # immediate response is no guarantee that the operation is done. - # - # @overload wait_operation(request, options = nil) - # Pass arguments to `wait_operation` via a request object, either of type - # {::Google::Longrunning::WaitOperationRequest} or an equivalent Hash. - # - # @param request [::Google::Longrunning::WaitOperationRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. - # - # @overload wait_operation(name: nil, timeout: nil) - # Pass arguments to `wait_operation` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param name [::String] - # The name of the operation resource to wait on. - # @param timeout [::Google::Protobuf::Duration, ::Hash] - # The maximum duration to wait before timing out. If left blank, the wait - # will be at most the time permitted by the underlying HTTP/RPC protocol. - # If RPC context deadline is also specified, the shorter one will be used. - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Gapic::Operation] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Gapic::Operation] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/longrunning" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Longrunning::Operations::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Longrunning::WaitOperationRequest.new - # - # # Call the wait_operation method. - # result = client.wait_operation request - # - # # The returned object is of type Gapic::Operation. You can use it to - # # check the status of an operation, cancel it, or wait for results. - # # Here is how to wait for a response. - # result.wait_until_done! timeout: 60 - # if result.response? - # p result.response - # else - # puts "No response received." - # end - # - def wait_operation request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Longrunning::WaitOperationRequest - - # Converts hash and nil to an options object - options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h - - # Customize the options with defaults - metadata = @config.rpcs.wait_operation.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::Retail::V2::VERSION - metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - options.apply_defaults timeout: @config.rpcs.wait_operation.timeout, - metadata: metadata, - retry_policy: @config.rpcs.wait_operation.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @operations_stub.call_rpc :wait_operation, request, options: options do |response, operation| - response = ::Gapic::Operation.new response, @operations_client, options: options - yield response, operation if block_given? - throw :response, response - end - rescue ::GRPC::BadStatus => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Configuration class for the Operations API. - # - # This class represents the configuration for Operations, - # providing control over timeouts, retry behavior, logging, transport - # parameters, and other low-level controls. Certain parameters can also be - # applied individually to specific RPCs. See - # {::Google::Longrunning::Operations::Client::Configuration::Rpcs} - # for a list of RPCs that can be configured independently. - # - # Configuration can be applied globally to all clients, or to a single client - # on construction. - # - # @example - # - # # Modify the global config, setting the timeout for - # # list_operations to 20 seconds, - # # and all remaining timeouts to 10 seconds. - # ::Google::Longrunning::Operations::Client.configure do |config| - # config.timeout = 10.0 - # config.rpcs.list_operations.timeout = 20.0 - # end - # - # # Apply the above configuration only to a new client. - # client = ::Google::Longrunning::Operations::Client.new do |config| - # config.timeout = 10.0 - # config.rpcs.list_operations.timeout = 20.0 - # end - # - # @!attribute [rw] endpoint - # A custom service endpoint, as a hostname or hostname:port. The default is - # nil, indicating to use the default endpoint in the current universe domain. - # @return [::String,nil] - # @!attribute [rw] credentials - # Credentials to send with calls. You may provide any of the following types: - # * (`Google::Auth::Credentials`) A googleauth credentials object - # (see the [googleauth docs](https://rubydoc.info/gems/googleauth/Google/Auth/Credentials)) - # * (`Signet::OAuth2::Client`) A signet oauth2 client object - # (see the [signet docs](https://rubydoc.info/gems/signet/Signet/OAuth2/Client)) - # * (`GRPC::Core::Channel`) a gRPC channel with included credentials - # * (`GRPC::Core::ChannelCredentials`) a gRPC credentails object - # * (`nil`) indicating no credentials - # - # @note Warning: Passing a `String` to a keyfile path or a `Hash` of credentials - # is deprecated. Providing an unvalidated credential configuration to - # Google APIs can compromise the security of your systems and data. - # - # @example - # - # # The recommended way to provide credentials is to use the `make_creds` method - # # on the appropriate credentials class for your environment. - # - # require "googleauth" - # - # credentials = ::Google::Auth::ServiceAccountCredentials.make_creds( - # json_key_io: ::File.open("/path/to/keyfile.json") - # ) - # - # client = ::Google::Longrunning::Operations::Client.new do |config| - # config.credentials = credentials - # end - # - # @note Warning: If you accept a credential configuration (JSON file or Hash) from an - # external source for authentication to Google Cloud, you must validate it before - # providing it to a Google API client library. Providing an unvalidated credential - # configuration to Google APIs can compromise the security of your systems and data. - # For more information, refer to [Validate credential configurations from external - # sources](https://cloud.google.com/docs/authentication/external/externally-sourced-credentials). - # @return [::Object] - # @!attribute [rw] scope - # The OAuth scopes - # @return [::Array<::String>] - # @!attribute [rw] lib_name - # The library name as recorded in instrumentation and logging - # @return [::String] - # @!attribute [rw] lib_version - # The library version as recorded in instrumentation and logging - # @return [::String] - # @!attribute [rw] channel_args - # Extra parameters passed to the gRPC channel. Note: this is ignored if a - # `GRPC::Core::Channel` object is provided as the credential. - # @return [::Hash] - # @!attribute [rw] interceptors - # An array of interceptors that are run before calls are executed. - # @return [::Array<::GRPC::ClientInterceptor>] - # @!attribute [rw] timeout - # The call timeout in seconds. - # @return [::Numeric] - # @!attribute [rw] metadata - # Additional gRPC headers to be sent with the call. - # @return [::Hash{::Symbol=>::String}] - # @!attribute [rw] retry_policy - # The retry policy. The value is a hash with the following keys: - # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds. - # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds. - # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier. - # * `:retry_codes` (*type:* `Array`) - The error codes that should - # trigger a retry. - # @return [::Hash] - # @!attribute [rw] quota_project - # A separate project against which to charge quota. - # @return [::String] - # @!attribute [rw] universe_domain - # The universe domain within which to make requests. This determines the - # default endpoint URL. The default value of nil uses the environment - # universe (usually the default "googleapis.com" universe). - # @return [::String,nil] - # @!attribute [rw] logger - # A custom logger to use for request/response debug logging, or the value - # `:default` (the default) to construct a default logger, or `nil` to - # explicitly disable logging. - # @return [::Logger,:default,nil] - # - class Configuration - extend ::Gapic::Config - - # @private - # The endpoint specific to the default "googleapis.com" universe. Deprecated. - DEFAULT_ENDPOINT = "retail.googleapis.com" - - config_attr :endpoint, nil, ::String, nil - config_attr :credentials, nil do |value| - allowed = [::String, ::Hash, ::Proc, ::Symbol, ::Google::Auth::Credentials, ::Google::Auth::BaseClient, ::Signet::OAuth2::Client, nil] - allowed += [::GRPC::Core::Channel, ::GRPC::Core::ChannelCredentials] if defined? ::GRPC::Core::Channel - allowed.any? { |klass| klass === value } - end - config_attr :scope, nil, ::String, ::Array, nil - config_attr :lib_name, nil, ::String, nil - config_attr :lib_version, nil, ::String, nil - config_attr(:channel_args, { "grpc.service_config_disable_resolution" => 1 }, ::Hash, nil) - config_attr :interceptors, nil, ::Array, nil - config_attr :timeout, nil, ::Numeric, nil - config_attr :metadata, nil, ::Hash, nil - config_attr :retry_policy, nil, ::Hash, ::Proc, nil - config_attr :quota_project, nil, ::String, nil - config_attr :universe_domain, nil, ::String, nil - config_attr :logger, :default, ::Logger, nil, :default - - # @private - def initialize parent_config = nil - @parent_config = parent_config unless parent_config.nil? - - yield self if block_given? - end - - ## - # Configurations for individual RPCs - # @return [Rpcs] - # - def rpcs - @rpcs ||= begin - parent_rpcs = nil - parent_rpcs = @parent_config.rpcs if defined?(@parent_config) && @parent_config.respond_to?(:rpcs) - Rpcs.new parent_rpcs - end - end - - ## - # Configuration for the channel pool - # @return [::Gapic::ServiceStub::ChannelPool::Configuration] - # - def channel_pool - @channel_pool ||= ::Gapic::ServiceStub::ChannelPool::Configuration.new - end - - ## - # Configuration RPC class for the Operations API. - # - # Includes fields providing the configuration for each RPC in this service. - # Each configuration object is of type `Gapic::Config::Method` and includes - # the following configuration fields: - # - # * `timeout` (*type:* `Numeric`) - The call timeout in seconds - # * `metadata` (*type:* `Hash{Symbol=>String}`) - Additional gRPC headers - # * `retry_policy (*type:* `Hash`) - The retry policy. The policy fields - # include the following keys: - # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds. - # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds. - # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier. - # * `:retry_codes` (*type:* `Array`) - The error codes that should - # trigger a retry. - # - class Rpcs - ## - # RPC-specific configuration for `list_operations` - # @return [::Gapic::Config::Method] - # - attr_reader :list_operations - ## - # RPC-specific configuration for `get_operation` - # @return [::Gapic::Config::Method] - # - attr_reader :get_operation - ## - # RPC-specific configuration for `delete_operation` - # @return [::Gapic::Config::Method] - # - attr_reader :delete_operation - ## - # RPC-specific configuration for `cancel_operation` - # @return [::Gapic::Config::Method] - # - attr_reader :cancel_operation - ## - # RPC-specific configuration for `wait_operation` - # @return [::Gapic::Config::Method] - # - attr_reader :wait_operation - - # @private - def initialize parent_rpcs = nil - list_operations_config = parent_rpcs.list_operations if parent_rpcs.respond_to? :list_operations - @list_operations = ::Gapic::Config::Method.new list_operations_config - get_operation_config = parent_rpcs.get_operation if parent_rpcs.respond_to? :get_operation - @get_operation = ::Gapic::Config::Method.new get_operation_config - delete_operation_config = parent_rpcs.delete_operation if parent_rpcs.respond_to? :delete_operation - @delete_operation = ::Gapic::Config::Method.new delete_operation_config - cancel_operation_config = parent_rpcs.cancel_operation if parent_rpcs.respond_to? :cancel_operation - @cancel_operation = ::Gapic::Config::Method.new cancel_operation_config - wait_operation_config = parent_rpcs.wait_operation if parent_rpcs.respond_to? :wait_operation - @wait_operation = ::Gapic::Config::Method.new wait_operation_config - - yield self if block_given? - end - end - end - end - end - end - end - end -end diff --git a/owl-bot-staging/google-cloud-retail-v2/lib/google/cloud/retail/v2/model_service/paths.rb b/owl-bot-staging/google-cloud-retail-v2/lib/google/cloud/retail/v2/model_service/paths.rb deleted file mode 100644 index dfac159c4ef5..000000000000 --- a/owl-bot-staging/google-cloud-retail-v2/lib/google/cloud/retail/v2/model_service/paths.rb +++ /dev/null @@ -1,73 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - - -module Google - module Cloud - module Retail - module V2 - module ModelService - # Path helper methods for the ModelService API. - module Paths - ## - # Create a fully-qualified Catalog resource string. - # - # The resource will be in the following format: - # - # `projects/{project}/locations/{location}/catalogs/{catalog}` - # - # @param project [String] - # @param location [String] - # @param catalog [String] - # - # @return [::String] - def catalog_path project:, location:, catalog: - raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" - raise ::ArgumentError, "location cannot contain /" if location.to_s.include? "/" - - "projects/#{project}/locations/#{location}/catalogs/#{catalog}" - end - - ## - # Create a fully-qualified Model resource string. - # - # The resource will be in the following format: - # - # `projects/{project}/locations/{location}/catalogs/{catalog}/models/{model}` - # - # @param project [String] - # @param location [String] - # @param catalog [String] - # @param model [String] - # - # @return [::String] - def model_path project:, location:, catalog:, model: - raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" - raise ::ArgumentError, "location cannot contain /" if location.to_s.include? "/" - raise ::ArgumentError, "catalog cannot contain /" if catalog.to_s.include? "/" - - "projects/#{project}/locations/#{location}/catalogs/#{catalog}/models/#{model}" - end - - extend self - end - end - end - end - end -end diff --git a/owl-bot-staging/google-cloud-retail-v2/lib/google/cloud/retail/v2/model_service/rest.rb b/owl-bot-staging/google-cloud-retail-v2/lib/google/cloud/retail/v2/model_service/rest.rb deleted file mode 100644 index 09cc5600da6e..000000000000 --- a/owl-bot-staging/google-cloud-retail-v2/lib/google/cloud/retail/v2/model_service/rest.rb +++ /dev/null @@ -1,64 +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/retail/v2/version" - -require "google/cloud/retail/v2/model_service/credentials" -require "google/cloud/retail/v2/model_service/paths" -require "google/cloud/retail/v2/model_service/rest/operations" -require "google/cloud/retail/v2/model_service/rest/client" - -module Google - module Cloud - module Retail - module V2 - ## - # Service for performing CRUD operations on models. - # Recommendation models contain all the metadata necessary to generate a set of - # models for the `Predict()` API. A model is queried - # indirectly via a ServingConfig, which associates a model with a - # given Placement (e.g. Frequently Bought Together on Home Page). - # - # This service allows you to do the following: - # - # * Initiate training of a model. - # * Pause training of an existing model. - # * List all the available models along with their metadata. - # * Control their tuning schedule. - # - # To load this service and instantiate a REST client: - # - # require "google/cloud/retail/v2/model_service/rest" - # client = ::Google::Cloud::Retail::V2::ModelService::Rest::Client.new - # - module ModelService - # Client for the REST transport - module Rest - end - end - end - end - end -end - -helper_path = ::File.join __dir__, "rest", "helpers.rb" -require "google/cloud/retail/v2/model_service/rest/helpers" if ::File.file? helper_path diff --git a/owl-bot-staging/google-cloud-retail-v2/lib/google/cloud/retail/v2/model_service/rest/client.rb b/owl-bot-staging/google-cloud-retail-v2/lib/google/cloud/retail/v2/model_service/rest/client.rb deleted file mode 100644 index 71a202fe4e3d..000000000000 --- a/owl-bot-staging/google-cloud-retail-v2/lib/google/cloud/retail/v2/model_service/rest/client.rb +++ /dev/null @@ -1,1120 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -require "google/cloud/errors" -require "google/cloud/retail/v2/model_service_pb" -require "google/cloud/retail/v2/model_service/rest/service_stub" -require "google/cloud/location/rest" - -module Google - module Cloud - module Retail - module V2 - module ModelService - module Rest - ## - # REST client for the ModelService service. - # - # Service for performing CRUD operations on models. - # Recommendation models contain all the metadata necessary to generate a set of - # models for the `Predict()` API. A model is queried - # indirectly via a ServingConfig, which associates a model with a - # given Placement (e.g. Frequently Bought Together on Home Page). - # - # This service allows you to do the following: - # - # * Initiate training of a model. - # * Pause training of an existing model. - # * List all the available models along with their metadata. - # * Control their tuning schedule. - # - class Client - # @private - API_VERSION = "" - - # @private - DEFAULT_ENDPOINT_TEMPLATE = "retail.$UNIVERSE_DOMAIN$" - - include Paths - - # @private - attr_reader :model_service_stub - - ## - # Configure the ModelService Client class. - # - # See {::Google::Cloud::Retail::V2::ModelService::Rest::Client::Configuration} - # for a description of the configuration fields. - # - # @example - # - # # Modify the configuration for all ModelService clients - # ::Google::Cloud::Retail::V2::ModelService::Rest::Client.configure do |config| - # config.timeout = 10.0 - # end - # - # @yield [config] Configure the Client client. - # @yieldparam config [Client::Configuration] - # - # @return [Client::Configuration] - # - def self.configure - @configure ||= begin - namespace = ["Google", "Cloud", "Retail", "V2"] - parent_config = while namespace.any? - parent_name = namespace.join "::" - parent_const = const_get parent_name - break parent_const.configure if parent_const.respond_to? :configure - namespace.pop - end - default_config = Client::Configuration.new parent_config - - default_config.timeout = 60.0 - default_config.retry_policy = { - initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [14, 4] - } - - default_config - end - yield @configure if block_given? - @configure - end - - ## - # Configure the ModelService Client instance. - # - # The configuration is set to the derived mode, meaning that values can be changed, - # but structural changes (adding new fields, etc.) are not allowed. Structural changes - # should be made on {Client.configure}. - # - # See {::Google::Cloud::Retail::V2::ModelService::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 - @model_service_stub.universe_domain - end - - ## - # Create a new ModelService REST client object. - # - # @example - # - # # Create a client using the default configuration - # client = ::Google::Cloud::Retail::V2::ModelService::Rest::Client.new - # - # # Create a client using a custom configuration - # client = ::Google::Cloud::Retail::V2::ModelService::Rest::Client.new do |config| - # config.timeout = 10.0 - # end - # - # @yield [config] Configure the ModelService client. - # @yieldparam config [Client::Configuration] - # - def initialize - # Create the configuration object - @config = Configuration.new Client.configure - - # Yield the configuration if needed - yield @config if block_given? - - # Create credentials - credentials = @config.credentials - # Use self-signed JWT if the endpoint is unchanged from default, - # but only if the default endpoint does not have a region prefix. - enable_self_signed_jwt = @config.endpoint.nil? || - (@config.endpoint == Configuration::DEFAULT_ENDPOINT && - !@config.endpoint.split(".").first.include?("-")) - credentials ||= Credentials.default scope: @config.scope, - enable_self_signed_jwt: enable_self_signed_jwt - if credentials.is_a?(::String) || credentials.is_a?(::Hash) - credentials = Credentials.new credentials, scope: @config.scope - end - - @quota_project_id = @config.quota_project - @quota_project_id ||= credentials.quota_project_id if credentials.respond_to? :quota_project_id - - @operations_client = ::Google::Cloud::Retail::V2::ModelService::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 - - @model_service_stub = ::Google::Cloud::Retail::V2::ModelService::Rest::ServiceStub.new( - endpoint: @config.endpoint, - endpoint_template: DEFAULT_ENDPOINT_TEMPLATE, - universe_domain: @config.universe_domain, - credentials: credentials, - logger: @config.logger - ) - - @model_service_stub.logger(stub: true)&.info do |entry| - entry.set_system_name - entry.set_service - entry.message = "Created client for #{entry.service}" - entry.set_credentials_fields credentials - entry.set "customEndpoint", @config.endpoint if @config.endpoint - entry.set "defaultTimeout", @config.timeout if @config.timeout - entry.set "quotaProject", @quota_project_id if @quota_project_id - end - - @location_client = Google::Cloud::Location::Locations::Rest::Client.new do |config| - config.credentials = credentials - config.quota_project = @quota_project_id - config.endpoint = @model_service_stub.endpoint - config.universe_domain = @model_service_stub.universe_domain - config.logger = @model_service_stub.logger if config.respond_to? :logger= - end - end - - ## - # Get the associated client for long-running operations. - # - # @return [::Google::Cloud::Retail::V2::ModelService::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 - @model_service_stub.logger - end - - # Service calls - - ## - # Creates a new model. - # - # @overload create_model(request, options = nil) - # Pass arguments to `create_model` via a request object, either of type - # {::Google::Cloud::Retail::V2::CreateModelRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Retail::V2::CreateModelRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_model(parent: nil, model: nil, dry_run: nil) - # Pass arguments to `create_model` via keyword arguments. Note that at - # least one keyword argument is 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 under which to create the model. Format: - # `projects/{project_number}/locations/{location_id}/catalogs/{catalog_id}` - # @param model [::Google::Cloud::Retail::V2::Model, ::Hash] - # Required. The payload of the {::Google::Cloud::Retail::V2::Model Model} to - # create. - # @param dry_run [::Boolean] - # Optional. Whether to run a dry run to validate the request (without - # actually creating the model). - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Gapic::Operation] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Gapic::Operation] - # - # @raise [::Google::Cloud::Error] if the REST call is aborted. - # - # @example Basic example - # require "google/cloud/retail/v2" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Retail::V2::ModelService::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Retail::V2::CreateModelRequest.new - # - # # Call the create_model method. - # result = client.create_model 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_model request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Retail::V2::CreateModelRequest - - # Converts hash 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_model.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::Retail::V2::VERSION, - transports_version_send: [:rest] - - call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - options.apply_defaults timeout: @config.rpcs.create_model.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.create_model.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @model_service_stub.create_model 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 model. - # - # @overload get_model(request, options = nil) - # Pass arguments to `get_model` via a request object, either of type - # {::Google::Cloud::Retail::V2::GetModelRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Retail::V2::GetModelRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_model(name: nil) - # Pass arguments to `get_model` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param name [::String] - # Required. The resource name of the {::Google::Cloud::Retail::V2::Model Model} to - # get. Format: - # `projects/{project_number}/locations/{location_id}/catalogs/{catalog}/models/{model_id}` - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Cloud::Retail::V2::Model] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::Retail::V2::Model] - # - # @raise [::Google::Cloud::Error] if the REST call is aborted. - # - # @example Basic example - # require "google/cloud/retail/v2" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Retail::V2::ModelService::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Retail::V2::GetModelRequest.new - # - # # Call the get_model method. - # result = client.get_model request - # - # # The returned object is of type Google::Cloud::Retail::V2::Model. - # p result - # - def get_model request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Retail::V2::GetModelRequest - - # Converts hash 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_model.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::Retail::V2::VERSION, - transports_version_send: [:rest] - - call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - options.apply_defaults timeout: @config.rpcs.get_model.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.get_model.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @model_service_stub.get_model 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 - - ## - # Pauses the training of an existing model. - # - # @overload pause_model(request, options = nil) - # Pass arguments to `pause_model` via a request object, either of type - # {::Google::Cloud::Retail::V2::PauseModelRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Retail::V2::PauseModelRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @overload pause_model(name: nil) - # Pass arguments to `pause_model` via keyword arguments. Note that at - # least one keyword argument is 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 model to pause. - # Format: - # `projects/{project_number}/locations/{location_id}/catalogs/{catalog_id}/models/{model_id}` - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Cloud::Retail::V2::Model] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::Retail::V2::Model] - # - # @raise [::Google::Cloud::Error] if the REST call is aborted. - # - # @example Basic example - # require "google/cloud/retail/v2" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Retail::V2::ModelService::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Retail::V2::PauseModelRequest.new - # - # # Call the pause_model method. - # result = client.pause_model request - # - # # The returned object is of type Google::Cloud::Retail::V2::Model. - # p result - # - def pause_model request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Retail::V2::PauseModelRequest - - # Converts hash 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.pause_model.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::Retail::V2::VERSION, - transports_version_send: [:rest] - - call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - options.apply_defaults timeout: @config.rpcs.pause_model.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.pause_model.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @model_service_stub.pause_model 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 - - ## - # Resumes the training of an existing model. - # - # @overload resume_model(request, options = nil) - # Pass arguments to `resume_model` via a request object, either of type - # {::Google::Cloud::Retail::V2::ResumeModelRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Retail::V2::ResumeModelRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @overload resume_model(name: nil) - # Pass arguments to `resume_model` via keyword arguments. Note that at - # least one keyword argument is 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 model to resume. - # Format: - # `projects/{project_number}/locations/{location_id}/catalogs/{catalog_id}/models/{model_id}` - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Cloud::Retail::V2::Model] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::Retail::V2::Model] - # - # @raise [::Google::Cloud::Error] if the REST call is aborted. - # - # @example Basic example - # require "google/cloud/retail/v2" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Retail::V2::ModelService::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Retail::V2::ResumeModelRequest.new - # - # # Call the resume_model method. - # result = client.resume_model request - # - # # The returned object is of type Google::Cloud::Retail::V2::Model. - # p result - # - def resume_model request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Retail::V2::ResumeModelRequest - - # Converts hash 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.resume_model.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::Retail::V2::VERSION, - transports_version_send: [:rest] - - call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - options.apply_defaults timeout: @config.rpcs.resume_model.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.resume_model.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @model_service_stub.resume_model request, options do |result, operation| - yield result, operation if block_given? - end - rescue ::Gapic::Rest::Error => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Deletes an existing model. - # - # @overload delete_model(request, options = nil) - # Pass arguments to `delete_model` via a request object, either of type - # {::Google::Cloud::Retail::V2::DeleteModelRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Retail::V2::DeleteModelRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_model(name: nil) - # Pass arguments to `delete_model` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param name [::String] - # Required. The resource name of the {::Google::Cloud::Retail::V2::Model Model} to - # delete. Format: - # `projects/{project_number}/locations/{location_id}/catalogs/{catalog_id}/models/{model_id}` - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Protobuf::Empty] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Protobuf::Empty] - # - # @raise [::Google::Cloud::Error] if the REST call is aborted. - # - # @example Basic example - # require "google/cloud/retail/v2" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Retail::V2::ModelService::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Retail::V2::DeleteModelRequest.new - # - # # Call the delete_model method. - # result = client.delete_model request - # - # # The returned object is of type Google::Protobuf::Empty. - # p result - # - def delete_model request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Retail::V2::DeleteModelRequest - - # Converts hash 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_model.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::Retail::V2::VERSION, - transports_version_send: [:rest] - - call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - options.apply_defaults timeout: @config.rpcs.delete_model.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.delete_model.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @model_service_stub.delete_model request, options do |result, operation| - yield result, operation if block_given? - end - rescue ::Gapic::Rest::Error => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Lists all the models linked to this event store. - # - # @overload list_models(request, options = nil) - # Pass arguments to `list_models` via a request object, either of type - # {::Google::Cloud::Retail::V2::ListModelsRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Retail::V2::ListModelsRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_models(parent: nil, page_size: nil, page_token: nil) - # Pass arguments to `list_models` via keyword arguments. Note that at - # least one keyword argument is 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 for which to list models. - # Format: - # `projects/{project_number}/locations/{location_id}/catalogs/{catalog_id}` - # @param page_size [::Integer] - # Optional. Maximum number of results to return. If unspecified, defaults - # to 50. Max allowed value is 1000. - # @param page_token [::String] - # Optional. A page token, received from a previous `ListModels` - # call. Provide this to retrieve the subsequent page. - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Gapic::Rest::PagedEnumerable<::Google::Cloud::Retail::V2::Model>] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Gapic::Rest::PagedEnumerable<::Google::Cloud::Retail::V2::Model>] - # - # @raise [::Google::Cloud::Error] if the REST call is aborted. - # - # @example Basic example - # require "google/cloud/retail/v2" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Retail::V2::ModelService::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Retail::V2::ListModelsRequest.new - # - # # Call the list_models method. - # result = client.list_models request - # - # # The returned object is of type Gapic::PagedEnumerable. You can iterate - # # over elements, and API calls will be issued to fetch pages as needed. - # result.each do |item| - # # Each element is of type ::Google::Cloud::Retail::V2::Model. - # p item - # end - # - def list_models request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Retail::V2::ListModelsRequest - - # Converts hash 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_models.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::Retail::V2::VERSION, - transports_version_send: [:rest] - - call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - options.apply_defaults timeout: @config.rpcs.list_models.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.list_models.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @model_service_stub.list_models request, options do |result, operation| - result = ::Gapic::Rest::PagedEnumerable.new @model_service_stub, :list_models, "models", 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 - - ## - # Update of model metadata. Only fields that - # currently can be updated are: `filtering_option` and - # `periodic_tuning_state`. - # If other values are provided, this API method ignores them. - # - # @overload update_model(request, options = nil) - # Pass arguments to `update_model` via a request object, either of type - # {::Google::Cloud::Retail::V2::UpdateModelRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Retail::V2::UpdateModelRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_model(model: nil, update_mask: nil) - # Pass arguments to `update_model` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param model [::Google::Cloud::Retail::V2::Model, ::Hash] - # Required. The body of the updated {::Google::Cloud::Retail::V2::Model Model}. - # @param update_mask [::Google::Protobuf::FieldMask, ::Hash] - # Optional. Indicates which fields in the provided 'model' to - # update. If not set, by default updates all fields. - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Cloud::Retail::V2::Model] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::Retail::V2::Model] - # - # @raise [::Google::Cloud::Error] if the REST call is aborted. - # - # @example Basic example - # require "google/cloud/retail/v2" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Retail::V2::ModelService::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Retail::V2::UpdateModelRequest.new - # - # # Call the update_model method. - # result = client.update_model request - # - # # The returned object is of type Google::Cloud::Retail::V2::Model. - # p result - # - def update_model request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Retail::V2::UpdateModelRequest - - # Converts hash 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_model.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::Retail::V2::VERSION, - transports_version_send: [:rest] - - call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - options.apply_defaults timeout: @config.rpcs.update_model.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.update_model.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @model_service_stub.update_model 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 - - ## - # Tunes an existing model. - # - # @overload tune_model(request, options = nil) - # Pass arguments to `tune_model` via a request object, either of type - # {::Google::Cloud::Retail::V2::TuneModelRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Retail::V2::TuneModelRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @overload tune_model(name: nil) - # Pass arguments to `tune_model` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param name [::String] - # Required. The resource name of the model to tune. - # Format: - # `projects/{project_number}/locations/{location_id}/catalogs/{catalog_id}/models/{model_id}` - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Gapic::Operation] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Gapic::Operation] - # - # @raise [::Google::Cloud::Error] if the REST call is aborted. - # - # @example Basic example - # require "google/cloud/retail/v2" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Retail::V2::ModelService::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Retail::V2::TuneModelRequest.new - # - # # Call the tune_model method. - # result = client.tune_model 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 tune_model request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Retail::V2::TuneModelRequest - - # Converts hash 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.tune_model.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::Retail::V2::VERSION, - transports_version_send: [:rest] - - call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - options.apply_defaults timeout: @config.rpcs.tune_model.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.tune_model.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @model_service_stub.tune_model 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 - - ## - # Configuration class for the ModelService REST API. - # - # This class represents the configuration for ModelService REST, - # providing control over timeouts, retry behavior, logging, transport - # parameters, and other low-level controls. Certain parameters can also be - # applied individually to specific RPCs. See - # {::Google::Cloud::Retail::V2::ModelService::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_model to 20 seconds, - # # and all remaining timeouts to 10 seconds. - # ::Google::Cloud::Retail::V2::ModelService::Rest::Client.configure do |config| - # config.timeout = 10.0 - # config.rpcs.create_model.timeout = 20.0 - # end - # - # # Apply the above configuration only to a new client. - # client = ::Google::Cloud::Retail::V2::ModelService::Rest::Client.new do |config| - # config.timeout = 10.0 - # config.rpcs.create_model.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 = "retail.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 ModelService 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_model` - # @return [::Gapic::Config::Method] - # - attr_reader :create_model - ## - # RPC-specific configuration for `get_model` - # @return [::Gapic::Config::Method] - # - attr_reader :get_model - ## - # RPC-specific configuration for `pause_model` - # @return [::Gapic::Config::Method] - # - attr_reader :pause_model - ## - # RPC-specific configuration for `resume_model` - # @return [::Gapic::Config::Method] - # - attr_reader :resume_model - ## - # RPC-specific configuration for `delete_model` - # @return [::Gapic::Config::Method] - # - attr_reader :delete_model - ## - # RPC-specific configuration for `list_models` - # @return [::Gapic::Config::Method] - # - attr_reader :list_models - ## - # RPC-specific configuration for `update_model` - # @return [::Gapic::Config::Method] - # - attr_reader :update_model - ## - # RPC-specific configuration for `tune_model` - # @return [::Gapic::Config::Method] - # - attr_reader :tune_model - - # @private - def initialize parent_rpcs = nil - create_model_config = parent_rpcs.create_model if parent_rpcs.respond_to? :create_model - @create_model = ::Gapic::Config::Method.new create_model_config - get_model_config = parent_rpcs.get_model if parent_rpcs.respond_to? :get_model - @get_model = ::Gapic::Config::Method.new get_model_config - pause_model_config = parent_rpcs.pause_model if parent_rpcs.respond_to? :pause_model - @pause_model = ::Gapic::Config::Method.new pause_model_config - resume_model_config = parent_rpcs.resume_model if parent_rpcs.respond_to? :resume_model - @resume_model = ::Gapic::Config::Method.new resume_model_config - delete_model_config = parent_rpcs.delete_model if parent_rpcs.respond_to? :delete_model - @delete_model = ::Gapic::Config::Method.new delete_model_config - list_models_config = parent_rpcs.list_models if parent_rpcs.respond_to? :list_models - @list_models = ::Gapic::Config::Method.new list_models_config - update_model_config = parent_rpcs.update_model if parent_rpcs.respond_to? :update_model - @update_model = ::Gapic::Config::Method.new update_model_config - tune_model_config = parent_rpcs.tune_model if parent_rpcs.respond_to? :tune_model - @tune_model = ::Gapic::Config::Method.new tune_model_config - - yield self if block_given? - end - end - end - end - end - end - end - end - end -end diff --git a/owl-bot-staging/google-cloud-retail-v2/lib/google/cloud/retail/v2/model_service/rest/operations.rb b/owl-bot-staging/google-cloud-retail-v2/lib/google/cloud/retail/v2/model_service/rest/operations.rb deleted file mode 100644 index 466ab095ea82..000000000000 --- a/owl-bot-staging/google-cloud-retail-v2/lib/google/cloud/retail/v2/model_service/rest/operations.rb +++ /dev/null @@ -1,960 +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 Cloud - module Retail - module V2 - module ModelService - module Rest - # Service that implements Longrunning Operations API. - class Operations - # @private - API_VERSION = "" - - # @private - DEFAULT_ENDPOINT_TEMPLATE = "retail.$UNIVERSE_DOMAIN$" - - # @private - attr_reader :operations_stub - - ## - # Configuration for the ModelService 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 ModelService 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::Retail::V2::VERSION, - transports_version_send: [:rest] - - call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - options.apply_defaults timeout: @config.rpcs.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::Retail::V2::VERSION, - transports_version_send: [:rest] - - call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - options.apply_defaults timeout: @config.rpcs.get_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::Retail::V2::VERSION, - transports_version_send: [:rest] - - call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - options.apply_defaults timeout: @config.rpcs.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::Retail::V2::VERSION, - transports_version_send: [:rest] - - call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - options.apply_defaults timeout: @config.rpcs.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 = "retail.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: "/v2/{name}/operations", - matches: [ - ["name", %r{^projects/[^/]+/locations/[^/]+/?$}, false] - ] - ) - .with_bindings( - uri_method: :get, - uri_template: "/v2/{name}/operations", - matches: [ - ["name", %r{^projects/[^/]+/locations/[^/]+/catalogs/[^/]+/?$}, false] - ] - ) - .with_bindings( - uri_method: :get, - uri_template: "/v2/{name}/operations", - matches: [ - ["name", %r{^projects/[^/]+/?$}, 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: "/v2/{name}", - matches: [ - ["name", %r{^projects/[^/]+/locations/[^/]+/operations/[^/]+/?$}, false] - ] - ) - .with_bindings( - uri_method: :get, - uri_template: "/v2/{name}", - matches: [ - ["name", %r{^projects/[^/]+/locations/[^/]+/catalogs/[^/]+/branches/[^/]+/operations/[^/]+/?$}, false] - ] - ) - .with_bindings( - uri_method: :get, - uri_template: "/v2/{name}", - matches: [ - ["name", %r{^projects/[^/]+/locations/[^/]+/catalogs/[^/]+/operations/[^/]+/?$}, false] - ] - ) - .with_bindings( - uri_method: :get, - uri_template: "/v2/{name}", - matches: [ - ["name", %r{^projects/[^/]+/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 -end diff --git a/owl-bot-staging/google-cloud-retail-v2/lib/google/cloud/retail/v2/model_service/rest/service_stub.rb b/owl-bot-staging/google-cloud-retail-v2/lib/google/cloud/retail/v2/model_service/rest/service_stub.rb deleted file mode 100644 index fec1a150075d..000000000000 --- a/owl-bot-staging/google-cloud-retail-v2/lib/google/cloud/retail/v2/model_service/rest/service_stub.rb +++ /dev/null @@ -1,574 +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/retail/v2/model_service_pb" - -module Google - module Cloud - module Retail - module V2 - module ModelService - module Rest - ## - # REST service stub for the ModelService 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_model REST call - # - # @param request_pb [::Google::Cloud::Retail::V2::CreateModelRequest] - # 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_model request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_create_model_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_model", - 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_model REST call - # - # @param request_pb [::Google::Cloud::Retail::V2::GetModelRequest] - # A request object representing the call parameters. Required. - # @param options [::Gapic::CallOptions] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Cloud::Retail::V2::Model] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::Retail::V2::Model] - # A result object deserialized from the server's reply - def get_model request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_get_model_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_model", - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Cloud::Retail::V2::Model.decode_json response.body, ignore_unknown_fields: true - catch :response do - yield result, operation if block_given? - result - end - end - - ## - # Baseline implementation for the pause_model REST call - # - # @param request_pb [::Google::Cloud::Retail::V2::PauseModelRequest] - # A request object representing the call parameters. Required. - # @param options [::Gapic::CallOptions] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Cloud::Retail::V2::Model] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::Retail::V2::Model] - # A result object deserialized from the server's reply - def pause_model request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_pause_model_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: "pause_model", - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Cloud::Retail::V2::Model.decode_json response.body, ignore_unknown_fields: true - catch :response do - yield result, operation if block_given? - result - end - end - - ## - # Baseline implementation for the resume_model REST call - # - # @param request_pb [::Google::Cloud::Retail::V2::ResumeModelRequest] - # A request object representing the call parameters. Required. - # @param options [::Gapic::CallOptions] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Cloud::Retail::V2::Model] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::Retail::V2::Model] - # A result object deserialized from the server's reply - def resume_model request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_resume_model_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: "resume_model", - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Cloud::Retail::V2::Model.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_model REST call - # - # @param request_pb [::Google::Cloud::Retail::V2::DeleteModelRequest] - # 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_model request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_delete_model_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_model", - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Protobuf::Empty.decode_json response.body, ignore_unknown_fields: true - catch :response do - yield result, operation if block_given? - result - end - end - - ## - # Baseline implementation for the list_models REST call - # - # @param request_pb [::Google::Cloud::Retail::V2::ListModelsRequest] - # A request object representing the call parameters. Required. - # @param options [::Gapic::CallOptions] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Cloud::Retail::V2::ListModelsResponse] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::Retail::V2::ListModelsResponse] - # A result object deserialized from the server's reply - def list_models request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_list_models_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_models", - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Cloud::Retail::V2::ListModelsResponse.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_model REST call - # - # @param request_pb [::Google::Cloud::Retail::V2::UpdateModelRequest] - # A request object representing the call parameters. Required. - # @param options [::Gapic::CallOptions] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Cloud::Retail::V2::Model] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::Retail::V2::Model] - # A result object deserialized from the server's reply - def update_model request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_update_model_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_model", - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Cloud::Retail::V2::Model.decode_json response.body, ignore_unknown_fields: true - catch :response do - yield result, operation if block_given? - result - end - end - - ## - # Baseline implementation for the tune_model REST call - # - # @param request_pb [::Google::Cloud::Retail::V2::TuneModelRequest] - # 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 tune_model request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_tune_model_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: "tune_model", - 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 - - ## - # @private - # - # GRPC transcoding helper method for the create_model REST call - # - # @param request_pb [::Google::Cloud::Retail::V2::CreateModelRequest] - # 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_model_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :post, - uri_template: "/v2/{parent}/models", - body: "model", - matches: [ - ["parent", %r{^projects/[^/]+/locations/[^/]+/catalogs/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the get_model REST call - # - # @param request_pb [::Google::Cloud::Retail::V2::GetModelRequest] - # 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_model_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :get, - uri_template: "/v2/{name}", - matches: [ - ["name", %r{^projects/[^/]+/locations/[^/]+/catalogs/[^/]+/models/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the pause_model REST call - # - # @param request_pb [::Google::Cloud::Retail::V2::PauseModelRequest] - # A request object representing the call parameters. Required. - # @return [Array(String, [String, nil], Hash{String => String})] - # Uri, Body, Query string parameters - def self.transcode_pause_model_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :post, - uri_template: "/v2/{name}:pause", - body: "*", - matches: [ - ["name", %r{^projects/[^/]+/locations/[^/]+/catalogs/[^/]+/models/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the resume_model REST call - # - # @param request_pb [::Google::Cloud::Retail::V2::ResumeModelRequest] - # A request object representing the call parameters. Required. - # @return [Array(String, [String, nil], Hash{String => String})] - # Uri, Body, Query string parameters - def self.transcode_resume_model_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :post, - uri_template: "/v2/{name}:resume", - body: "*", - matches: [ - ["name", %r{^projects/[^/]+/locations/[^/]+/catalogs/[^/]+/models/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the delete_model REST call - # - # @param request_pb [::Google::Cloud::Retail::V2::DeleteModelRequest] - # 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_model_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :delete, - uri_template: "/v2/{name}", - matches: [ - ["name", %r{^projects/[^/]+/locations/[^/]+/catalogs/[^/]+/models/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the list_models REST call - # - # @param request_pb [::Google::Cloud::Retail::V2::ListModelsRequest] - # 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_models_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :get, - uri_template: "/v2/{parent}/models", - matches: [ - ["parent", %r{^projects/[^/]+/locations/[^/]+/catalogs/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the update_model REST call - # - # @param request_pb [::Google::Cloud::Retail::V2::UpdateModelRequest] - # 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_model_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :patch, - uri_template: "/v2/{model.name}", - body: "model", - matches: [ - ["model.name", %r{^projects/[^/]+/locations/[^/]+/catalogs/[^/]+/models/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the tune_model REST call - # - # @param request_pb [::Google::Cloud::Retail::V2::TuneModelRequest] - # A request object representing the call parameters. Required. - # @return [Array(String, [String, nil], Hash{String => String})] - # Uri, Body, Query string parameters - def self.transcode_tune_model_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :post, - uri_template: "/v2/{name}:tune", - body: "*", - matches: [ - ["name", %r{^projects/[^/]+/locations/[^/]+/catalogs/[^/]+/models/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - end - end - end - end - end - end -end diff --git a/owl-bot-staging/google-cloud-retail-v2/lib/google/cloud/retail/v2/model_service_pb.rb b/owl-bot-staging/google-cloud-retail-v2/lib/google/cloud/retail/v2/model_service_pb.rb deleted file mode 100644 index 5b5f20690bb3..000000000000 --- a/owl-bot-staging/google-cloud-retail-v2/lib/google/cloud/retail/v2/model_service_pb.rb +++ /dev/null @@ -1,41 +0,0 @@ -# frozen_string_literal: true -# Generated by the protocol buffer compiler. DO NOT EDIT! -# source: google/cloud/retail/v2/model_service.proto - -require 'google/protobuf' - -require 'google/api/annotations_pb' -require 'google/api/client_pb' -require 'google/api/field_behavior_pb' -require 'google/api/resource_pb' -require 'google/cloud/retail/v2/model_pb' -require 'google/longrunning/operations_pb' -require 'google/protobuf/empty_pb' -require 'google/protobuf/field_mask_pb' - - -descriptor_data = "\n*google/cloud/retail/v2/model_service.proto\x12\x16google.cloud.retail.v2\x1a\x1cgoogle/api/annotations.proto\x1a\x17google/api/client.proto\x1a\x1fgoogle/api/field_behavior.proto\x1a\x19google/api/resource.proto\x1a\"google/cloud/retail/v2/model.proto\x1a#google/longrunning/operations.proto\x1a\x1bgoogle/protobuf/empty.proto\x1a google/protobuf/field_mask.proto\"\x94\x01\n\x12\x43reateModelRequest\x12\x35\n\x06parent\x18\x01 \x01(\tB%\xe0\x41\x02\xfa\x41\x1f\n\x1dretail.googleapis.com/Catalog\x12\x31\n\x05model\x18\x02 \x01(\x0b\x32\x1d.google.cloud.retail.v2.ModelB\x03\xe0\x41\x02\x12\x14\n\x07\x64ry_run\x18\x03 \x01(\x08\x42\x03\xe0\x41\x01\"}\n\x12UpdateModelRequest\x12\x31\n\x05model\x18\x01 \x01(\x0b\x32\x1d.google.cloud.retail.v2.ModelB\x03\xe0\x41\x02\x12\x34\n\x0bupdate_mask\x18\x02 \x01(\x0b\x32\x1a.google.protobuf.FieldMaskB\x03\xe0\x41\x01\"D\n\x0fGetModelRequest\x12\x31\n\x04name\x18\x01 \x01(\tB#\xe0\x41\x02\xfa\x41\x1d\n\x1bretail.googleapis.com/Model\"F\n\x11PauseModelRequest\x12\x31\n\x04name\x18\x01 \x01(\tB#\xe0\x41\x02\xfa\x41\x1d\n\x1bretail.googleapis.com/Model\"\'\n\x12ResumeModelRequest\x12\x11\n\x04name\x18\x01 \x01(\tB\x03\xe0\x41\x02\"{\n\x11ListModelsRequest\x12\x35\n\x06parent\x18\x01 \x01(\tB%\xe0\x41\x02\xfa\x41\x1f\n\x1dretail.googleapis.com/Catalog\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\"G\n\x12\x44\x65leteModelRequest\x12\x31\n\x04name\x18\x01 \x01(\tB#\xe0\x41\x02\xfa\x41\x1d\n\x1bretail.googleapis.com/Model\"\\\n\x12ListModelsResponse\x12-\n\x06models\x18\x01 \x03(\x0b\x32\x1d.google.cloud.retail.v2.Model\x12\x17\n\x0fnext_page_token\x18\x02 \x01(\t\"E\n\x10TuneModelRequest\x12\x31\n\x04name\x18\x01 \x01(\tB#\xe0\x41\x02\xfa\x41\x1d\n\x1bretail.googleapis.com/Model\"$\n\x13\x43reateModelMetadata\x12\r\n\x05model\x18\x01 \x01(\t\"\"\n\x11TuneModelMetadata\x12\r\n\x05model\x18\x01 \x01(\t\"\x13\n\x11TuneModelResponse2\xc5\x0c\n\x0cModelService\x12\xfb\x01\n\x0b\x43reateModel\x12*.google.cloud.retail.v2.CreateModelRequest\x1a\x1d.google.longrunning.Operation\"\xa0\x01\xca\x41J\n\x1cgoogle.cloud.retail.v2.Model\x12*google.cloud.retail.v2.CreateModelMetadata\xda\x41\x0cparent,model\x82\xd3\xe4\x93\x02>\"5/v2/{parent=projects/*/locations/*/catalogs/*}/models:\x05model\x12\x98\x01\n\x08GetModel\x12\'.google.cloud.retail.v2.GetModelRequest\x1a\x1d.google.cloud.retail.v2.Model\"D\xda\x41\x04name\x82\xd3\xe4\x93\x02\x37\x12\x35/v2/{name=projects/*/locations/*/catalogs/*/models/*}\x12\xa5\x01\n\nPauseModel\x12).google.cloud.retail.v2.PauseModelRequest\x1a\x1d.google.cloud.retail.v2.Model\"M\xda\x41\x04name\x82\xd3\xe4\x93\x02@\";/v2/{name=projects/*/locations/*/catalogs/*/models/*}:pause:\x01*\x12\xa8\x01\n\x0bResumeModel\x12*.google.cloud.retail.v2.ResumeModelRequest\x1a\x1d.google.cloud.retail.v2.Model\"N\xda\x41\x04name\x82\xd3\xe4\x93\x02\x41\" ::Google::Protobuf::Value, ::Hash}] - # Additional domain specific parameters for the predictions. - # - # Allowed values: - # - # * `returnProduct`: Boolean. If set to true, the associated product - # object will be returned in the `results.metadata` field in the - # prediction response. - # * `returnScore`: Boolean. If set to true, the prediction 'score' - # corresponding to each returned product will be set in the - # `results.metadata` field in the prediction response. The given - # 'score' indicates the probability of a product being clicked/purchased - # given the user's context and history. - # * `strictFiltering`: Boolean. True by default. If set to false, the service - # will return generic (unfiltered) popular products instead of empty if - # your filter blocks all prediction results. - # * `priceRerankLevel`: String. Default empty. If set to be non-empty, then - # it needs to be one of {'no-price-reranking', 'low-price-reranking', - # 'medium-price-reranking', 'high-price-reranking'}. This gives - # request-level control and adjusts prediction results based on product - # price. - # * `diversityLevel`: String. Default empty. If set to be non-empty, then - # it needs to be one of {'no-diversity', 'low-diversity', - # 'medium-diversity', 'high-diversity', 'auto-diversity'}. This gives - # request-level control and adjusts prediction results based on product - # category. - # * `filterSyntaxV2`: Boolean. False by default. If set to true, the `filter` - # field is interpreteted according to the new, attribute-based syntax. - # @param labels [::Hash{::String => ::String}] - # The labels applied to a resource must meet the following requirements: - # - # * Each resource can have multiple labels, up to a maximum of 64. - # * Each label must be a key-value pair. - # * Keys have a minimum length of 1 character and a maximum length of 63 - # characters and cannot be empty. Values can be empty and have a maximum - # length of 63 characters. - # * Keys and values can contain only lowercase letters, numeric characters, - # underscores, and dashes. All characters must use UTF-8 encoding, and - # international characters are allowed. - # * The key portion of a label must be unique. However, you can use the same - # key with multiple resources. - # * Keys must start with a lowercase letter or international character. - # - # See [Google Cloud - # Document](https://cloud.google.com/resource-manager/docs/creating-managing-labels#requirements) - # for more details. - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Google::Cloud::Retail::V2::PredictResponse] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Google::Cloud::Retail::V2::PredictResponse] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/cloud/retail/v2" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Retail::V2::PredictionService::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Retail::V2::PredictRequest.new - # - # # Call the predict method. - # result = client.predict request - # - # # The returned object is of type Google::Cloud::Retail::V2::PredictResponse. - # p result - # - def predict request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Retail::V2::PredictRequest - - # Converts hash 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.predict.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::Retail::V2::VERSION - metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - header_params = {} - if request.placement - header_params["placement"] = request.placement - 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.predict.timeout, - metadata: metadata, - retry_policy: @config.rpcs.predict.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @prediction_service_stub.call_rpc :predict, request, options: options do |response, operation| - yield response, operation if block_given? - end - rescue ::GRPC::BadStatus => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Configuration class for the PredictionService API. - # - # This class represents the configuration for PredictionService, - # providing control over timeouts, retry behavior, logging, transport - # parameters, and other low-level controls. Certain parameters can also be - # applied individually to specific RPCs. See - # {::Google::Cloud::Retail::V2::PredictionService::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 - # # predict to 20 seconds, - # # and all remaining timeouts to 10 seconds. - # ::Google::Cloud::Retail::V2::PredictionService::Client.configure do |config| - # config.timeout = 10.0 - # config.rpcs.predict.timeout = 20.0 - # end - # - # # Apply the above configuration only to a new client. - # client = ::Google::Cloud::Retail::V2::PredictionService::Client.new do |config| - # config.timeout = 10.0 - # config.rpcs.predict.timeout = 20.0 - # end - # - # @!attribute [rw] endpoint - # A custom service endpoint, as a hostname or hostname:port. The default is - # nil, indicating to use the default endpoint in the current universe domain. - # @return [::String,nil] - # @!attribute [rw] credentials - # Credentials to send with calls. You may provide any of the following types: - # * (`Google::Auth::Credentials`) A googleauth credentials object - # (see the [googleauth docs](https://rubydoc.info/gems/googleauth/Google/Auth/Credentials)) - # * (`Signet::OAuth2::Client`) A signet oauth2 client object - # (see the [signet docs](https://rubydoc.info/gems/signet/Signet/OAuth2/Client)) - # * (`GRPC::Core::Channel`) a gRPC channel with included credentials - # * (`GRPC::Core::ChannelCredentials`) a gRPC credentails object - # * (`nil`) indicating no credentials - # - # @note Warning: Passing a `String` to a keyfile path or a `Hash` of credentials - # is deprecated. Providing an unvalidated credential configuration to - # Google APIs can compromise the security of your systems and data. - # - # @example - # - # # The recommended way to provide credentials is to use the `make_creds` method - # # on the appropriate credentials class for your environment. - # - # require "googleauth" - # - # credentials = ::Google::Auth::ServiceAccountCredentials.make_creds( - # json_key_io: ::File.open("/path/to/keyfile.json") - # ) - # - # client = ::Google::Cloud::Retail::V2::PredictionService::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 = "retail.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 PredictionService 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 `predict` - # @return [::Gapic::Config::Method] - # - attr_reader :predict - - # @private - def initialize parent_rpcs = nil - predict_config = parent_rpcs.predict if parent_rpcs.respond_to? :predict - @predict = ::Gapic::Config::Method.new predict_config - - yield self if block_given? - end - end - end - end - end - end - end - end -end diff --git a/owl-bot-staging/google-cloud-retail-v2/lib/google/cloud/retail/v2/prediction_service/credentials.rb b/owl-bot-staging/google-cloud-retail-v2/lib/google/cloud/retail/v2/prediction_service/credentials.rb deleted file mode 100644 index 1da276c819f4..000000000000 --- a/owl-bot-staging/google-cloud-retail-v2/lib/google/cloud/retail/v2/prediction_service/credentials.rb +++ /dev/null @@ -1,51 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -require "googleauth" - -module Google - module Cloud - module Retail - module V2 - module PredictionService - # Credentials for the PredictionService API. - class Credentials < ::Google::Auth::Credentials - self.scope = [ - "https://www.googleapis.com/auth/cloud-platform" - ] - self.env_vars = [ - "RETAIL_CREDENTIALS", - "RETAIL_KEYFILE", - "GOOGLE_CLOUD_CREDENTIALS", - "GOOGLE_CLOUD_KEYFILE", - "GCLOUD_KEYFILE", - "RETAIL_CREDENTIALS_JSON", - "RETAIL_KEYFILE_JSON", - "GOOGLE_CLOUD_CREDENTIALS_JSON", - "GOOGLE_CLOUD_KEYFILE_JSON", - "GCLOUD_KEYFILE_JSON" - ] - self.paths = [ - "~/.config/google_cloud/application_default_credentials.json" - ] - end - end - end - end - end -end diff --git a/owl-bot-staging/google-cloud-retail-v2/lib/google/cloud/retail/v2/prediction_service/paths.rb b/owl-bot-staging/google-cloud-retail-v2/lib/google/cloud/retail/v2/prediction_service/paths.rb deleted file mode 100644 index 26277b36936a..000000000000 --- a/owl-bot-staging/google-cloud-retail-v2/lib/google/cloud/retail/v2/prediction_service/paths.rb +++ /dev/null @@ -1,56 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - - -module Google - module Cloud - module Retail - module V2 - module PredictionService - # Path helper methods for the PredictionService API. - module Paths - ## - # Create a fully-qualified Product resource string. - # - # The resource will be in the following format: - # - # `projects/{project}/locations/{location}/catalogs/{catalog}/branches/{branch}/products/{product}` - # - # @param project [String] - # @param location [String] - # @param catalog [String] - # @param branch [String] - # @param product [String] - # - # @return [::String] - def product_path project:, location:, catalog:, branch:, product: - raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" - raise ::ArgumentError, "location cannot contain /" if location.to_s.include? "/" - raise ::ArgumentError, "catalog cannot contain /" if catalog.to_s.include? "/" - raise ::ArgumentError, "branch cannot contain /" if branch.to_s.include? "/" - - "projects/#{project}/locations/#{location}/catalogs/#{catalog}/branches/#{branch}/products/#{product}" - end - - extend self - end - end - end - end - end -end diff --git a/owl-bot-staging/google-cloud-retail-v2/lib/google/cloud/retail/v2/prediction_service/rest.rb b/owl-bot-staging/google-cloud-retail-v2/lib/google/cloud/retail/v2/prediction_service/rest.rb deleted file mode 100644 index 351e68db6577..000000000000 --- a/owl-bot-staging/google-cloud-retail-v2/lib/google/cloud/retail/v2/prediction_service/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/retail/v2/version" - -require "google/cloud/retail/v2/prediction_service/credentials" -require "google/cloud/retail/v2/prediction_service/paths" -require "google/cloud/retail/v2/prediction_service/rest/client" - -module Google - module Cloud - module Retail - module V2 - ## - # Service for making recommendation prediction. - # - # To load this service and instantiate a REST client: - # - # require "google/cloud/retail/v2/prediction_service/rest" - # client = ::Google::Cloud::Retail::V2::PredictionService::Rest::Client.new - # - module PredictionService - # Client for the REST transport - module Rest - end - end - end - end - end -end - -helper_path = ::File.join __dir__, "rest", "helpers.rb" -require "google/cloud/retail/v2/prediction_service/rest/helpers" if ::File.file? helper_path diff --git a/owl-bot-staging/google-cloud-retail-v2/lib/google/cloud/retail/v2/prediction_service/rest/client.rb b/owl-bot-staging/google-cloud-retail-v2/lib/google/cloud/retail/v2/prediction_service/rest/client.rb deleted file mode 100644 index d4a6255d51bc..000000000000 --- a/owl-bot-staging/google-cloud-retail-v2/lib/google/cloud/retail/v2/prediction_service/rest/client.rb +++ /dev/null @@ -1,571 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -require "google/cloud/errors" -require "google/cloud/retail/v2/prediction_service_pb" -require "google/cloud/retail/v2/prediction_service/rest/service_stub" -require "google/cloud/location/rest" - -module Google - module Cloud - module Retail - module V2 - module PredictionService - module Rest - ## - # REST client for the PredictionService service. - # - # Service for making recommendation prediction. - # - class Client - # @private - API_VERSION = "" - - # @private - DEFAULT_ENDPOINT_TEMPLATE = "retail.$UNIVERSE_DOMAIN$" - - include Paths - - # @private - attr_reader :prediction_service_stub - - ## - # Configure the PredictionService Client class. - # - # See {::Google::Cloud::Retail::V2::PredictionService::Rest::Client::Configuration} - # for a description of the configuration fields. - # - # @example - # - # # Modify the configuration for all PredictionService clients - # ::Google::Cloud::Retail::V2::PredictionService::Rest::Client.configure do |config| - # config.timeout = 10.0 - # end - # - # @yield [config] Configure the Client client. - # @yieldparam config [Client::Configuration] - # - # @return [Client::Configuration] - # - def self.configure - @configure ||= begin - namespace = ["Google", "Cloud", "Retail", "V2"] - parent_config = while namespace.any? - parent_name = namespace.join "::" - parent_const = const_get parent_name - break parent_const.configure if parent_const.respond_to? :configure - namespace.pop - end - default_config = Client::Configuration.new parent_config - - default_config.timeout = 5.0 - default_config.retry_policy = { - initial_delay: 0.1, max_delay: 5.0, multiplier: 1.3, retry_codes: [14, 4] - } - - default_config - end - yield @configure if block_given? - @configure - end - - ## - # Configure the PredictionService Client instance. - # - # The configuration is set to the derived mode, meaning that values can be changed, - # but structural changes (adding new fields, etc.) are not allowed. Structural changes - # should be made on {Client.configure}. - # - # See {::Google::Cloud::Retail::V2::PredictionService::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 - @prediction_service_stub.universe_domain - end - - ## - # Create a new PredictionService REST client object. - # - # @example - # - # # Create a client using the default configuration - # client = ::Google::Cloud::Retail::V2::PredictionService::Rest::Client.new - # - # # Create a client using a custom configuration - # client = ::Google::Cloud::Retail::V2::PredictionService::Rest::Client.new do |config| - # config.timeout = 10.0 - # end - # - # @yield [config] Configure the PredictionService 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 - - @prediction_service_stub = ::Google::Cloud::Retail::V2::PredictionService::Rest::ServiceStub.new( - endpoint: @config.endpoint, - endpoint_template: DEFAULT_ENDPOINT_TEMPLATE, - universe_domain: @config.universe_domain, - credentials: credentials, - logger: @config.logger - ) - - @prediction_service_stub.logger(stub: true)&.info do |entry| - entry.set_system_name - entry.set_service - entry.message = "Created client for #{entry.service}" - entry.set_credentials_fields credentials - entry.set "customEndpoint", @config.endpoint if @config.endpoint - entry.set "defaultTimeout", @config.timeout if @config.timeout - entry.set "quotaProject", @quota_project_id if @quota_project_id - end - - @location_client = Google::Cloud::Location::Locations::Rest::Client.new do |config| - config.credentials = credentials - config.quota_project = @quota_project_id - config.endpoint = @prediction_service_stub.endpoint - config.universe_domain = @prediction_service_stub.universe_domain - config.logger = @prediction_service_stub.logger if config.respond_to? :logger= - end - end - - ## - # Get the associated client for mix-in of the Locations. - # - # @return [Google::Cloud::Location::Locations::Rest::Client] - # - attr_reader :location_client - - ## - # The logger used for request/response debug logging. - # - # @return [Logger] - # - def logger - @prediction_service_stub.logger - end - - # Service calls - - ## - # Makes a recommendation prediction. - # - # @overload predict(request, options = nil) - # Pass arguments to `predict` via a request object, either of type - # {::Google::Cloud::Retail::V2::PredictRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Retail::V2::PredictRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @overload predict(placement: nil, user_event: nil, page_size: nil, page_token: nil, filter: nil, validate_only: nil, params: nil, labels: nil) - # Pass arguments to `predict` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param placement [::String] - # Required. Full resource name of the format: - # `{placement=projects/*/locations/global/catalogs/default_catalog/servingConfigs/*}` - # or - # `{placement=projects/*/locations/global/catalogs/default_catalog/placements/*}`. - # We recommend using the `servingConfigs` resource. `placements` is a legacy - # resource. - # The ID of the Recommendations AI serving config or placement. - # Before you can request predictions from your model, you must create at - # least one serving config or placement for it. For more information, see - # [Manage serving configs] - # (https://cloud.google.com/retail/docs/manage-configs). - # - # The full list of available serving configs can be seen at - # https://console.cloud.google.com/ai/retail/catalogs/default_catalog/configs - # @param user_event [::Google::Cloud::Retail::V2::UserEvent, ::Hash] - # Required. Context about the user, what they are looking at and what action - # they took to trigger the predict request. Note that this user event detail - # won't be ingested to userEvent logs. Thus, a separate userEvent write - # request is required for event logging. - # - # Don't set - # {::Google::Cloud::Retail::V2::UserEvent#visitor_id UserEvent.visitor_id} or - # {::Google::Cloud::Retail::V2::UserInfo#user_id UserInfo.user_id} to the same - # fixed ID for different users. If you are trying to receive non-personalized - # recommendations (not recommended; this can negatively impact model - # performance), instead set - # {::Google::Cloud::Retail::V2::UserEvent#visitor_id UserEvent.visitor_id} to a - # random unique ID and leave - # {::Google::Cloud::Retail::V2::UserInfo#user_id UserInfo.user_id} unset. - # @param page_size [::Integer] - # Maximum number of results to return. Set this property to the number of - # prediction results needed. If zero, the service will choose a reasonable - # default. The maximum allowed value is 100. Values above 100 will be coerced - # to 100. - # @param page_token [::String] - # This field is not used; leave it unset. - # @param filter [::String] - # Filter for restricting prediction results with a length limit of 5,000 - # characters. Accepts values for tags and the `filterOutOfStockItems` flag. - # - # * Tag expressions. Restricts predictions to products that match all of the - # specified tags. Boolean operators `OR` and `NOT` are supported if the - # expression is enclosed in parentheses, and must be separated from the - # tag values by a space. `-"tagA"` is also supported and is equivalent to - # `NOT "tagA"`. Tag values must be double quoted UTF-8 encoded strings - # with a size limit of 1,000 characters. - # - # Note: "Recently viewed" models don't support tag filtering at the - # moment. - # - # * filterOutOfStockItems. Restricts predictions to products that do not - # have a - # stockState value of OUT_OF_STOCK. - # - # Examples: - # - # * tag=("Red" OR "Blue") tag="New-Arrival" tag=(NOT "promotional") - # * filterOutOfStockItems tag=(-"promotional") - # * filterOutOfStockItems - # - # If your filter blocks all prediction results, the API will return *no* - # results. If instead you want empty result sets to return generic - # (unfiltered) popular products, set `strictFiltering` to False in - # `PredictRequest.params`. Note that the API will never return items with - # storageStatus of "EXPIRED" or "DELETED" regardless of filter choices. - # - # If `filterSyntaxV2` is set to true under the `params` field, then - # attribute-based expressions are expected instead of the above described - # tag-based syntax. Examples: - # - # * (colors: ANY("Red", "Blue")) AND NOT (categories: ANY("Phones")) - # * (availability: ANY("IN_STOCK")) AND - # (colors: ANY("Red") OR categories: ANY("Phones")) - # - # For more information, see - # [Filter recommendations](https://cloud.google.com/retail/docs/filter-recs). - # @param validate_only [::Boolean] - # Use validate only mode for this prediction query. If set to true, a - # dummy model will be used that returns arbitrary products. - # Note that the validate only mode should only be used for testing the API, - # or if the model is not ready. - # @param params [::Hash{::String => ::Google::Protobuf::Value, ::Hash}] - # Additional domain specific parameters for the predictions. - # - # Allowed values: - # - # * `returnProduct`: Boolean. If set to true, the associated product - # object will be returned in the `results.metadata` field in the - # prediction response. - # * `returnScore`: Boolean. If set to true, the prediction 'score' - # corresponding to each returned product will be set in the - # `results.metadata` field in the prediction response. The given - # 'score' indicates the probability of a product being clicked/purchased - # given the user's context and history. - # * `strictFiltering`: Boolean. True by default. If set to false, the service - # will return generic (unfiltered) popular products instead of empty if - # your filter blocks all prediction results. - # * `priceRerankLevel`: String. Default empty. If set to be non-empty, then - # it needs to be one of {'no-price-reranking', 'low-price-reranking', - # 'medium-price-reranking', 'high-price-reranking'}. This gives - # request-level control and adjusts prediction results based on product - # price. - # * `diversityLevel`: String. Default empty. If set to be non-empty, then - # it needs to be one of {'no-diversity', 'low-diversity', - # 'medium-diversity', 'high-diversity', 'auto-diversity'}. This gives - # request-level control and adjusts prediction results based on product - # category. - # * `filterSyntaxV2`: Boolean. False by default. If set to true, the `filter` - # field is interpreteted according to the new, attribute-based syntax. - # @param labels [::Hash{::String => ::String}] - # The labels applied to a resource must meet the following requirements: - # - # * Each resource can have multiple labels, up to a maximum of 64. - # * Each label must be a key-value pair. - # * Keys have a minimum length of 1 character and a maximum length of 63 - # characters and cannot be empty. Values can be empty and have a maximum - # length of 63 characters. - # * Keys and values can contain only lowercase letters, numeric characters, - # underscores, and dashes. All characters must use UTF-8 encoding, and - # international characters are allowed. - # * The key portion of a label must be unique. However, you can use the same - # key with multiple resources. - # * Keys must start with a lowercase letter or international character. - # - # See [Google Cloud - # Document](https://cloud.google.com/resource-manager/docs/creating-managing-labels#requirements) - # for more details. - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Cloud::Retail::V2::PredictResponse] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::Retail::V2::PredictResponse] - # - # @raise [::Google::Cloud::Error] if the REST call is aborted. - # - # @example Basic example - # require "google/cloud/retail/v2" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Retail::V2::PredictionService::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Retail::V2::PredictRequest.new - # - # # Call the predict method. - # result = client.predict request - # - # # The returned object is of type Google::Cloud::Retail::V2::PredictResponse. - # p result - # - def predict request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Retail::V2::PredictRequest - - # Converts hash 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.predict.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::Retail::V2::VERSION, - transports_version_send: [:rest] - - call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - options.apply_defaults timeout: @config.rpcs.predict.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.predict.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @prediction_service_stub.predict 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 PredictionService REST API. - # - # This class represents the configuration for PredictionService REST, - # providing control over timeouts, retry behavior, logging, transport - # parameters, and other low-level controls. Certain parameters can also be - # applied individually to specific RPCs. See - # {::Google::Cloud::Retail::V2::PredictionService::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 - # # predict to 20 seconds, - # # and all remaining timeouts to 10 seconds. - # ::Google::Cloud::Retail::V2::PredictionService::Rest::Client.configure do |config| - # config.timeout = 10.0 - # config.rpcs.predict.timeout = 20.0 - # end - # - # # Apply the above configuration only to a new client. - # client = ::Google::Cloud::Retail::V2::PredictionService::Rest::Client.new do |config| - # config.timeout = 10.0 - # config.rpcs.predict.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 = "retail.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 PredictionService 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 `predict` - # @return [::Gapic::Config::Method] - # - attr_reader :predict - - # @private - def initialize parent_rpcs = nil - predict_config = parent_rpcs.predict if parent_rpcs.respond_to? :predict - @predict = ::Gapic::Config::Method.new predict_config - - yield self if block_given? - end - end - end - end - end - end - end - end - end -end diff --git a/owl-bot-staging/google-cloud-retail-v2/lib/google/cloud/retail/v2/prediction_service/rest/service_stub.rb b/owl-bot-staging/google-cloud-retail-v2/lib/google/cloud/retail/v2/prediction_service/rest/service_stub.rb deleted file mode 100644 index 4717b50f2d91..000000000000 --- a/owl-bot-staging/google-cloud-retail-v2/lib/google/cloud/retail/v2/prediction_service/rest/service_stub.rb +++ /dev/null @@ -1,151 +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/retail/v2/prediction_service_pb" - -module Google - module Cloud - module Retail - module V2 - module PredictionService - module Rest - ## - # REST service stub for the PredictionService 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 predict REST call - # - # @param request_pb [::Google::Cloud::Retail::V2::PredictRequest] - # A request object representing the call parameters. Required. - # @param options [::Gapic::CallOptions] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Cloud::Retail::V2::PredictResponse] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::Retail::V2::PredictResponse] - # A result object deserialized from the server's reply - def predict request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_predict_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: "predict", - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Cloud::Retail::V2::PredictResponse.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 predict REST call - # - # @param request_pb [::Google::Cloud::Retail::V2::PredictRequest] - # A request object representing the call parameters. Required. - # @return [Array(String, [String, nil], Hash{String => String})] - # Uri, Body, Query string parameters - def self.transcode_predict_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :post, - uri_template: "/v2/{placement}:predict", - body: "*", - matches: [ - ["placement", %r{^projects/[^/]+/locations/[^/]+/catalogs/[^/]+/placements/[^/]+/?$}, false] - ] - ) - .with_bindings( - uri_method: :post, - uri_template: "/v2/{placement}:predict", - body: "*", - matches: [ - ["placement", %r{^projects/[^/]+/locations/[^/]+/catalogs/[^/]+/servingConfigs/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - end - end - end - end - end - end -end diff --git a/owl-bot-staging/google-cloud-retail-v2/lib/google/cloud/retail/v2/prediction_service_pb.rb b/owl-bot-staging/google-cloud-retail-v2/lib/google/cloud/retail/v2/prediction_service_pb.rb deleted file mode 100644 index 5953dae20b84..000000000000 --- a/owl-bot-staging/google-cloud-retail-v2/lib/google/cloud/retail/v2/prediction_service_pb.rb +++ /dev/null @@ -1,30 +0,0 @@ -# frozen_string_literal: true -# Generated by the protocol buffer compiler. DO NOT EDIT! -# source: google/cloud/retail/v2/prediction_service.proto - -require 'google/protobuf' - -require 'google/api/annotations_pb' -require 'google/api/client_pb' -require 'google/api/field_behavior_pb' -require 'google/api/resource_pb' -require 'google/cloud/retail/v2/user_event_pb' -require 'google/protobuf/struct_pb' - - -descriptor_data = "\n/google/cloud/retail/v2/prediction_service.proto\x12\x16google.cloud.retail.v2\x1a\x1cgoogle/api/annotations.proto\x1a\x17google/api/client.proto\x1a\x1fgoogle/api/field_behavior.proto\x1a\x19google/api/resource.proto\x1a\'google/cloud/retail/v2/user_event.proto\x1a\x1cgoogle/protobuf/struct.proto\"\xb4\x03\n\x0ePredictRequest\x12\x16\n\tplacement\x18\x01 \x01(\tB\x03\xe0\x41\x02\x12:\n\nuser_event\x18\x02 \x01(\x0b\x32!.google.cloud.retail.v2.UserEventB\x03\xe0\x41\x02\x12\x11\n\tpage_size\x18\x03 \x01(\x05\x12\x16\n\npage_token\x18\x04 \x01(\tB\x02\x18\x01\x12\x0e\n\x06\x66ilter\x18\x05 \x01(\t\x12\x15\n\rvalidate_only\x18\x06 \x01(\x08\x12\x42\n\x06params\x18\x07 \x03(\x0b\x32\x32.google.cloud.retail.v2.PredictRequest.ParamsEntry\x12\x42\n\x06labels\x18\x08 \x03(\x0b\x32\x32.google.cloud.retail.v2.PredictRequest.LabelsEntry\x1a\x45\n\x0bParamsEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12%\n\x05value\x18\x02 \x01(\x0b\x32\x16.google.protobuf.Value:\x02\x38\x01\x1a-\n\x0bLabelsEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12\r\n\x05value\x18\x02 \x01(\t:\x02\x38\x01\"\xe7\x02\n\x0fPredictResponse\x12I\n\x07results\x18\x01 \x03(\x0b\x32\x38.google.cloud.retail.v2.PredictResponse.PredictionResult\x12\x19\n\x11\x61ttribution_token\x18\x02 \x01(\t\x12\x13\n\x0bmissing_ids\x18\x03 \x03(\t\x12\x15\n\rvalidate_only\x18\x04 \x01(\x08\x1a\xc1\x01\n\x10PredictionResult\x12\n\n\x02id\x18\x01 \x01(\t\x12X\n\x08metadata\x18\x02 \x03(\x0b\x32\x46.google.cloud.retail.v2.PredictResponse.PredictionResult.MetadataEntry\x1aG\n\rMetadataEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12%\n\x05value\x18\x02 \x01(\x0b\x32\x16.google.protobuf.Value:\x02\x38\x01\x32\xe1\x02\n\x11PredictionService\x12\x80\x02\n\x07Predict\x12&.google.cloud.retail.v2.PredictRequest\x1a\'.google.cloud.retail.v2.PredictResponse\"\xa3\x01\x82\xd3\xe4\x93\x02\x9c\x01\"F/v2/{placement=projects/*/locations/*/catalogs/*/placements/*}:predict:\x01*ZO\"J/v2/{placement=projects/*/locations/*/catalogs/*/servingConfigs/*}:predict:\x01*\x1aI\xca\x41\x15retail.googleapis.com\xd2\x41.https://www.googleapis.com/auth/cloud-platformB\xc1\x01\n\x1a\x63om.google.cloud.retail.v2B\x16PredictionServiceProtoP\x01Z2cloud.google.com/go/retail/apiv2/retailpb;retailpb\xa2\x02\x06RETAIL\xaa\x02\x16Google.Cloud.Retail.V2\xca\x02\x16Google\\Cloud\\Retail\\V2\xea\x02\x19Google::Cloud::Retail::V2b\x06proto3" - -pool = ::Google::Protobuf::DescriptorPool.generated_pool -pool.add_serialized_file(descriptor_data) - -module Google - module Cloud - module Retail - module V2 - PredictRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.retail.v2.PredictRequest").msgclass - PredictResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.retail.v2.PredictResponse").msgclass - PredictResponse::PredictionResult = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.retail.v2.PredictResponse.PredictionResult").msgclass - end - end - end -end diff --git a/owl-bot-staging/google-cloud-retail-v2/lib/google/cloud/retail/v2/prediction_service_services_pb.rb b/owl-bot-staging/google-cloud-retail-v2/lib/google/cloud/retail/v2/prediction_service_services_pb.rb deleted file mode 100644 index 050119438d40..000000000000 --- a/owl-bot-staging/google-cloud-retail-v2/lib/google/cloud/retail/v2/prediction_service_services_pb.rb +++ /dev/null @@ -1,45 +0,0 @@ -# Generated by the protocol buffer compiler. DO NOT EDIT! -# Source: google/cloud/retail/v2/prediction_service.proto for package 'Google.Cloud.Retail.V2' -# Original file comments: -# 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 -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. -# - -require 'grpc' -require 'google/cloud/retail/v2/prediction_service_pb' - -module Google - module Cloud - module Retail - module V2 - module PredictionService - # Service for making recommendation prediction. - class Service - - include ::GRPC::GenericService - - self.marshal_class_method = :encode - self.unmarshal_class_method = :decode - self.service_name = 'google.cloud.retail.v2.PredictionService' - - # Makes a recommendation prediction. - rpc :Predict, ::Google::Cloud::Retail::V2::PredictRequest, ::Google::Cloud::Retail::V2::PredictResponse - end - - Stub = Service.rpc_stub_class - end - end - end - end -end diff --git a/owl-bot-staging/google-cloud-retail-v2/lib/google/cloud/retail/v2/product_pb.rb b/owl-bot-staging/google-cloud-retail-v2/lib/google/cloud/retail/v2/product_pb.rb deleted file mode 100644 index fd072d651729..000000000000 --- a/owl-bot-staging/google-cloud-retail-v2/lib/google/cloud/retail/v2/product_pb.rb +++ /dev/null @@ -1,32 +0,0 @@ -# frozen_string_literal: true -# Generated by the protocol buffer compiler. DO NOT EDIT! -# source: google/cloud/retail/v2/product.proto - -require 'google/protobuf' - -require 'google/api/field_behavior_pb' -require 'google/api/resource_pb' -require 'google/cloud/retail/v2/common_pb' -require 'google/cloud/retail/v2/promotion_pb' -require 'google/protobuf/duration_pb' -require 'google/protobuf/field_mask_pb' -require 'google/protobuf/timestamp_pb' -require 'google/protobuf/wrappers_pb' - - -descriptor_data = "\n$google/cloud/retail/v2/product.proto\x12\x16google.cloud.retail.v2\x1a\x1fgoogle/api/field_behavior.proto\x1a\x19google/api/resource.proto\x1a#google/cloud/retail/v2/common.proto\x1a&google/cloud/retail/v2/promotion.proto\x1a\x1egoogle/protobuf/duration.proto\x1a google/protobuf/field_mask.proto\x1a\x1fgoogle/protobuf/timestamp.proto\x1a\x1egoogle/protobuf/wrappers.proto\"\xdb\r\n\x07Product\x12\x31\n\x0b\x65xpire_time\x18\x10 \x01(\x0b\x32\x1a.google.protobuf.TimestampH\x00\x12-\n\x03ttl\x18\x11 \x01(\x0b\x32\x19.google.protobuf.DurationB\x03\xe0\x41\x04H\x00\x12\x11\n\x04name\x18\x01 \x01(\tB\x03\xe0\x41\x05\x12\x0f\n\x02id\x18\x02 \x01(\tB\x03\xe0\x41\x05\x12\x37\n\x04type\x18\x03 \x01(\x0e\x32$.google.cloud.retail.v2.Product.TypeB\x03\xe0\x41\x05\x12\x1a\n\x12primary_product_id\x18\x04 \x01(\t\x12\x1d\n\x15\x63ollection_member_ids\x18\x05 \x03(\t\x12\x0c\n\x04gtin\x18\x06 \x01(\t\x12\x12\n\ncategories\x18\x07 \x03(\t\x12\x12\n\x05title\x18\x08 \x01(\tB\x03\xe0\x41\x02\x12\x0e\n\x06\x62rands\x18\t \x03(\t\x12\x13\n\x0b\x64\x65scription\x18\n \x01(\t\x12\x15\n\rlanguage_code\x18\x0b \x01(\t\x12\x43\n\nattributes\x18\x0c \x03(\x0b\x32/.google.cloud.retail.v2.Product.AttributesEntry\x12\x0c\n\x04tags\x18\r \x03(\t\x12\x35\n\nprice_info\x18\x0e \x01(\x0b\x32!.google.cloud.retail.v2.PriceInfo\x12.\n\x06rating\x18\x0f \x01(\x0b\x32\x1e.google.cloud.retail.v2.Rating\x12\x32\n\x0e\x61vailable_time\x18\x12 \x01(\x0b\x32\x1a.google.protobuf.Timestamp\x12\x42\n\x0c\x61vailability\x18\x13 \x01(\x0e\x32,.google.cloud.retail.v2.Product.Availability\x12\x37\n\x12\x61vailable_quantity\x18\x14 \x01(\x0b\x32\x1b.google.protobuf.Int32Value\x12\x41\n\x10\x66ulfillment_info\x18\x15 \x03(\x0b\x32\'.google.cloud.retail.v2.FulfillmentInfo\x12\x0b\n\x03uri\x18\x16 \x01(\t\x12-\n\x06images\x18\x17 \x03(\x0b\x32\x1d.google.cloud.retail.v2.Image\x12\x32\n\x08\x61udience\x18\x18 \x01(\x0b\x32 .google.cloud.retail.v2.Audience\x12\x35\n\ncolor_info\x18\x19 \x01(\x0b\x32!.google.cloud.retail.v2.ColorInfo\x12\r\n\x05sizes\x18\x1a \x03(\t\x12\x11\n\tmaterials\x18\x1b \x03(\t\x12\x10\n\x08patterns\x18\x1c \x03(\t\x12\x12\n\nconditions\x18\x1d \x03(\t\x12\x35\n\npromotions\x18\" \x03(\x0b\x32!.google.cloud.retail.v2.Promotion\x12\x30\n\x0cpublish_time\x18! \x01(\x0b\x32\x1a.google.protobuf.Timestamp\x12:\n\x12retrievable_fields\x18\x1e \x01(\x0b\x32\x1a.google.protobuf.FieldMaskB\x02\x18\x01\x12\x36\n\x08variants\x18\x1f \x03(\x0b\x32\x1f.google.cloud.retail.v2.ProductB\x03\xe0\x41\x03\x12\x46\n\x11local_inventories\x18# \x03(\x0b\x32&.google.cloud.retail.v2.LocalInventoryB\x03\xe0\x41\x03\x1aZ\n\x0f\x41ttributesEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12\x36\n\x05value\x18\x02 \x01(\x0b\x32\'.google.cloud.retail.v2.CustomAttribute:\x02\x38\x01\"F\n\x04Type\x12\x14\n\x10TYPE_UNSPECIFIED\x10\x00\x12\x0b\n\x07PRIMARY\x10\x01\x12\x0b\n\x07VARIANT\x10\x02\x12\x0e\n\nCOLLECTION\x10\x03\"i\n\x0c\x41vailability\x12\x1c\n\x18\x41VAILABILITY_UNSPECIFIED\x10\x00\x12\x0c\n\x08IN_STOCK\x10\x01\x12\x10\n\x0cOUT_OF_STOCK\x10\x02\x12\x0c\n\x08PREORDER\x10\x03\x12\r\n\tBACKORDER\x10\x04:\x84\x01\xea\x41\x80\x01\n\x1dretail.googleapis.com/Product\x12_projects/{project}/locations/{location}/catalogs/{catalog}/branches/{branch}/products/{product}B\x0c\n\nexpirationB\xa6\x02\n\x1a\x63om.google.cloud.retail.v2B\x0cProductProtoP\x01Z2cloud.google.com/go/retail/apiv2/retailpb;retailpb\xa2\x02\x06RETAIL\xaa\x02\x16Google.Cloud.Retail.V2\xca\x02\x16Google\\Cloud\\Retail\\V2\xea\x02\x19Google::Cloud::Retail::V2\xea\x41l\n\x1cretail.googleapis.com/Branch\x12Lprojects/{project}/locations/{location}/catalogs/{catalog}/branches/{branch}b\x06proto3" - -pool = ::Google::Protobuf::DescriptorPool.generated_pool -pool.add_serialized_file(descriptor_data) - -module Google - module Cloud - module Retail - module V2 - Product = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.retail.v2.Product").msgclass - Product::Type = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.retail.v2.Product.Type").enummodule - Product::Availability = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.retail.v2.Product.Availability").enummodule - end - end - end -end diff --git a/owl-bot-staging/google-cloud-retail-v2/lib/google/cloud/retail/v2/product_service.rb b/owl-bot-staging/google-cloud-retail-v2/lib/google/cloud/retail/v2/product_service.rb deleted file mode 100644 index b0bca826b962..000000000000 --- a/owl-bot-staging/google-cloud-retail-v2/lib/google/cloud/retail/v2/product_service.rb +++ /dev/null @@ -1,57 +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/retail/v2/version" - -require "google/cloud/retail/v2/product_service/credentials" -require "google/cloud/retail/v2/product_service/paths" -require "google/cloud/retail/v2/product_service/operations" -require "google/cloud/retail/v2/product_service/client" -require "google/cloud/retail/v2/product_service/rest" - -module Google - module Cloud - module Retail - module V2 - ## - # Service for ingesting {::Google::Cloud::Retail::V2::Product Product} information - # of the customer's website. - # - # @example Load this service and instantiate a gRPC client - # - # require "google/cloud/retail/v2/product_service" - # client = ::Google::Cloud::Retail::V2::ProductService::Client.new - # - # @example Load this service and instantiate a REST client - # - # require "google/cloud/retail/v2/product_service/rest" - # client = ::Google::Cloud::Retail::V2::ProductService::Rest::Client.new - # - module ProductService - end - end - end - end -end - -helper_path = ::File.join __dir__, "product_service", "helpers.rb" -require "google/cloud/retail/v2/product_service/helpers" if ::File.file? helper_path diff --git a/owl-bot-staging/google-cloud-retail-v2/lib/google/cloud/retail/v2/product_service/client.rb b/owl-bot-staging/google-cloud-retail-v2/lib/google/cloud/retail/v2/product_service/client.rb deleted file mode 100644 index 59efdf52763f..000000000000 --- a/owl-bot-staging/google-cloud-retail-v2/lib/google/cloud/retail/v2/product_service/client.rb +++ /dev/null @@ -1,2237 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -require "google/cloud/errors" -require "google/cloud/retail/v2/product_service_pb" -require "google/cloud/location" - -module Google - module Cloud - module Retail - module V2 - module ProductService - ## - # Client for the ProductService service. - # - # Service for ingesting {::Google::Cloud::Retail::V2::Product Product} information - # of the customer's website. - # - class Client - # @private - API_VERSION = "" - - # @private - DEFAULT_ENDPOINT_TEMPLATE = "retail.$UNIVERSE_DOMAIN$" - - include Paths - - # @private - attr_reader :product_service_stub - - ## - # Configure the ProductService Client class. - # - # See {::Google::Cloud::Retail::V2::ProductService::Client::Configuration} - # for a description of the configuration fields. - # - # @example - # - # # Modify the configuration for all ProductService clients - # ::Google::Cloud::Retail::V2::ProductService::Client.configure do |config| - # config.timeout = 10.0 - # end - # - # @yield [config] Configure the Client client. - # @yieldparam config [Client::Configuration] - # - # @return [Client::Configuration] - # - def self.configure - @configure ||= begin - namespace = ["Google", "Cloud", "Retail", "V2"] - parent_config = while namespace.any? - parent_name = namespace.join "::" - parent_const = const_get parent_name - break parent_const.configure if parent_const.respond_to? :configure - namespace.pop - end - default_config = Client::Configuration.new parent_config - - default_config.timeout = 30.0 - default_config.retry_policy = { - initial_delay: 0.1, max_delay: 30.0, multiplier: 1.3, retry_codes: [14, 4] - } - - default_config.rpcs.import_products.timeout = 300.0 - default_config.rpcs.import_products.retry_policy = { - initial_delay: 0.1, max_delay: 300.0, multiplier: 1.3, retry_codes: [14, 4] - } - - default_config - end - yield @configure if block_given? - @configure - end - - ## - # Configure the ProductService Client instance. - # - # The configuration is set to the derived mode, meaning that values can be changed, - # but structural changes (adding new fields, etc.) are not allowed. Structural changes - # should be made on {Client.configure}. - # - # See {::Google::Cloud::Retail::V2::ProductService::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 - @product_service_stub.universe_domain - end - - ## - # Create a new ProductService client object. - # - # @example - # - # # Create a client using the default configuration - # client = ::Google::Cloud::Retail::V2::ProductService::Client.new - # - # # Create a client using a custom configuration - # client = ::Google::Cloud::Retail::V2::ProductService::Client.new do |config| - # config.timeout = 10.0 - # end - # - # @yield [config] Configure the ProductService client. - # @yieldparam config [Client::Configuration] - # - def initialize - # These require statements are intentionally placed here to initialize - # the gRPC module only when it's required. - # See https://github.com/googleapis/toolkit/issues/446 - require "gapic/grpc" - require "google/cloud/retail/v2/product_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 - - @product_service_stub = ::Gapic::ServiceStub.new( - ::Google::Cloud::Retail::V2::ProductService::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 - ) - - @product_service_stub.stub_logger&.info do |entry| - entry.set_system_name - entry.set_service - entry.message = "Created client for #{entry.service}" - entry.set_credentials_fields credentials - entry.set "customEndpoint", @config.endpoint if @config.endpoint - entry.set "defaultTimeout", @config.timeout if @config.timeout - entry.set "quotaProject", @quota_project_id if @quota_project_id - end - - @location_client = Google::Cloud::Location::Locations::Client.new do |config| - config.credentials = credentials - config.quota_project = @quota_project_id - config.endpoint = @product_service_stub.endpoint - config.universe_domain = @product_service_stub.universe_domain - config.logger = @product_service_stub.logger if config.respond_to? :logger= - end - end - - ## - # Get the associated client for long-running operations. - # - # @return [::Google::Cloud::Retail::V2::ProductService::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 - @product_service_stub.logger - end - - # Service calls - - ## - # Creates a {::Google::Cloud::Retail::V2::Product Product}. - # - # @overload create_product(request, options = nil) - # Pass arguments to `create_product` via a request object, either of type - # {::Google::Cloud::Retail::V2::CreateProductRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Retail::V2::CreateProductRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_product(parent: nil, product: nil, product_id: nil) - # Pass arguments to `create_product` via keyword arguments. Note that at - # least one keyword argument is 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 catalog resource name, such as - # `projects/*/locations/global/catalogs/default_catalog/branches/default_branch`. - # @param product [::Google::Cloud::Retail::V2::Product, ::Hash] - # Required. The {::Google::Cloud::Retail::V2::Product Product} to create. - # @param product_id [::String] - # Required. The ID to use for the {::Google::Cloud::Retail::V2::Product Product}, - # which will become the final component of the - # {::Google::Cloud::Retail::V2::Product#name Product.name}. - # - # If the caller does not have permission to create the - # {::Google::Cloud::Retail::V2::Product Product}, regardless of whether or not it - # exists, a PERMISSION_DENIED error is returned. - # - # This field must be unique among all - # {::Google::Cloud::Retail::V2::Product Product}s with the same - # {::Google::Cloud::Retail::V2::CreateProductRequest#parent parent}. Otherwise, an - # ALREADY_EXISTS error is returned. - # - # This field must be a UTF-8 encoded string with a length limit of 128 - # characters. Otherwise, an INVALID_ARGUMENT error is returned. - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Google::Cloud::Retail::V2::Product] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Google::Cloud::Retail::V2::Product] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/cloud/retail/v2" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Retail::V2::ProductService::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Retail::V2::CreateProductRequest.new - # - # # Call the create_product method. - # result = client.create_product request - # - # # The returned object is of type Google::Cloud::Retail::V2::Product. - # p result - # - def create_product request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Retail::V2::CreateProductRequest - - # Converts hash 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_product.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::Retail::V2::VERSION - metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - header_params = {} - if request.parent - 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_product.timeout, - metadata: metadata, - retry_policy: @config.rpcs.create_product.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @product_service_stub.call_rpc :create_product, request, options: options do |response, operation| - yield response, operation if block_given? - end - rescue ::GRPC::BadStatus => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Gets a {::Google::Cloud::Retail::V2::Product Product}. - # - # @overload get_product(request, options = nil) - # Pass arguments to `get_product` via a request object, either of type - # {::Google::Cloud::Retail::V2::GetProductRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Retail::V2::GetProductRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_product(name: nil) - # Pass arguments to `get_product` via keyword arguments. Note that at - # least one keyword argument is 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. Full resource name of {::Google::Cloud::Retail::V2::Product Product}, - # such as - # `projects/*/locations/global/catalogs/default_catalog/branches/default_branch/products/some_product_id`. - # - # If the caller does not have permission to access the - # {::Google::Cloud::Retail::V2::Product Product}, regardless of whether or not it - # exists, a PERMISSION_DENIED error is returned. - # - # If the requested {::Google::Cloud::Retail::V2::Product Product} does not exist, - # a NOT_FOUND error is returned. - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Google::Cloud::Retail::V2::Product] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Google::Cloud::Retail::V2::Product] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/cloud/retail/v2" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Retail::V2::ProductService::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Retail::V2::GetProductRequest.new - # - # # Call the get_product method. - # result = client.get_product request - # - # # The returned object is of type Google::Cloud::Retail::V2::Product. - # p result - # - def get_product request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Retail::V2::GetProductRequest - - # Converts hash 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_product.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::Retail::V2::VERSION - metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - header_params = {} - if request.name - header_params["name"] = request.name - end - - request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") - metadata[:"x-goog-request-params"] ||= request_params_header - - options.apply_defaults timeout: @config.rpcs.get_product.timeout, - metadata: metadata, - retry_policy: @config.rpcs.get_product.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @product_service_stub.call_rpc :get_product, request, options: options do |response, operation| - yield response, operation if block_given? - end - rescue ::GRPC::BadStatus => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Gets a list of {::Google::Cloud::Retail::V2::Product Product}s. - # - # @overload list_products(request, options = nil) - # Pass arguments to `list_products` via a request object, either of type - # {::Google::Cloud::Retail::V2::ListProductsRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Retail::V2::ListProductsRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_products(parent: nil, page_size: nil, page_token: nil, filter: nil, read_mask: nil) - # Pass arguments to `list_products` via keyword arguments. Note that at - # least one keyword argument is 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 branch resource name, such as - # `projects/*/locations/global/catalogs/default_catalog/branches/0`. Use - # `default_branch` as the branch ID, to list products under the default - # branch. - # - # If the caller does not have permission to list - # {::Google::Cloud::Retail::V2::Product Product}s under this branch, regardless of - # whether or not this branch exists, a PERMISSION_DENIED error is returned. - # @param page_size [::Integer] - # Maximum number of {::Google::Cloud::Retail::V2::Product Product}s to return. If - # unspecified, defaults to 100. The maximum allowed value is 1000. Values - # above 1000 will be coerced to 1000. - # - # If this field is negative, an INVALID_ARGUMENT error is returned. - # @param page_token [::String] - # A page token - # {::Google::Cloud::Retail::V2::ListProductsResponse#next_page_token ListProductsResponse.next_page_token}, - # received from a previous - # {::Google::Cloud::Retail::V2::ProductService::Client#list_products ProductService.ListProducts} - # call. Provide this to retrieve the subsequent page. - # - # When paginating, all other parameters provided to - # {::Google::Cloud::Retail::V2::ProductService::Client#list_products ProductService.ListProducts} - # must match the call that provided the page token. Otherwise, an - # INVALID_ARGUMENT error is returned. - # @param filter [::String] - # A filter to apply on the list results. Supported features: - # - # * List all the products under the parent branch if - # {::Google::Cloud::Retail::V2::ListProductsRequest#filter filter} is unset. - # * List {::Google::Cloud::Retail::V2::Product::Type::VARIANT Product.Type.VARIANT} - # {::Google::Cloud::Retail::V2::Product Product}s sharing the same - # {::Google::Cloud::Retail::V2::Product::Type::PRIMARY Product.Type.PRIMARY} - # {::Google::Cloud::Retail::V2::Product Product}. For example: - # `primary_product_id = "some_product_id"` - # * List {::Google::Cloud::Retail::V2::Product Product}s bundled in a - # {::Google::Cloud::Retail::V2::Product::Type::COLLECTION Product.Type.COLLECTION} - # {::Google::Cloud::Retail::V2::Product Product}. - # For example: - # `collection_product_id = "some_product_id"` - # * List {::Google::Cloud::Retail::V2::Product Product}s with a partibular type. - # For example: - # `type = "PRIMARY"` - # `type = "VARIANT"` - # `type = "COLLECTION"` - # - # If the field is unrecognizable, an INVALID_ARGUMENT error is returned. - # - # If the specified - # {::Google::Cloud::Retail::V2::Product::Type::PRIMARY Product.Type.PRIMARY} - # {::Google::Cloud::Retail::V2::Product Product} or - # {::Google::Cloud::Retail::V2::Product::Type::COLLECTION Product.Type.COLLECTION} - # {::Google::Cloud::Retail::V2::Product Product} does not exist, a NOT_FOUND error - # is returned. - # @param read_mask [::Google::Protobuf::FieldMask, ::Hash] - # The fields of {::Google::Cloud::Retail::V2::Product Product} to return in the - # responses. If not set or empty, the following fields are returned: - # - # * {::Google::Cloud::Retail::V2::Product#name Product.name} - # * {::Google::Cloud::Retail::V2::Product#id Product.id} - # * {::Google::Cloud::Retail::V2::Product#title Product.title} - # * {::Google::Cloud::Retail::V2::Product#uri Product.uri} - # * {::Google::Cloud::Retail::V2::Product#images Product.images} - # * {::Google::Cloud::Retail::V2::Product#price_info Product.price_info} - # * {::Google::Cloud::Retail::V2::Product#brands Product.brands} - # - # If "*" is provided, all fields are returned. - # {::Google::Cloud::Retail::V2::Product#name Product.name} is always returned no - # matter what mask is set. - # - # If an unsupported or unknown field is provided, an INVALID_ARGUMENT error - # is returned. - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Gapic::PagedEnumerable<::Google::Cloud::Retail::V2::Product>] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Gapic::PagedEnumerable<::Google::Cloud::Retail::V2::Product>] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/cloud/retail/v2" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Retail::V2::ProductService::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Retail::V2::ListProductsRequest.new - # - # # Call the list_products method. - # result = client.list_products request - # - # # The returned object is of type Gapic::PagedEnumerable. You can iterate - # # over elements, and API calls will be issued to fetch pages as needed. - # result.each do |item| - # # Each element is of type ::Google::Cloud::Retail::V2::Product. - # p item - # end - # - def list_products request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Retail::V2::ListProductsRequest - - # Converts hash 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_products.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::Retail::V2::VERSION - metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - header_params = {} - if request.parent - 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_products.timeout, - metadata: metadata, - retry_policy: @config.rpcs.list_products.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @product_service_stub.call_rpc :list_products, request, options: options do |response, operation| - response = ::Gapic::PagedEnumerable.new @product_service_stub, :list_products, 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 - - ## - # Updates a {::Google::Cloud::Retail::V2::Product Product}. - # - # @overload update_product(request, options = nil) - # Pass arguments to `update_product` via a request object, either of type - # {::Google::Cloud::Retail::V2::UpdateProductRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Retail::V2::UpdateProductRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_product(product: nil, update_mask: nil, allow_missing: nil) - # Pass arguments to `update_product` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param product [::Google::Cloud::Retail::V2::Product, ::Hash] - # Required. The product to update/create. - # - # If the caller does not have permission to update the - # {::Google::Cloud::Retail::V2::Product Product}, regardless of whether or not it - # exists, a PERMISSION_DENIED error is returned. - # - # If the {::Google::Cloud::Retail::V2::Product Product} to update does not exist - # and - # {::Google::Cloud::Retail::V2::UpdateProductRequest#allow_missing allow_missing} - # is not set, a NOT_FOUND error is returned. - # @param update_mask [::Google::Protobuf::FieldMask, ::Hash] - # Indicates which fields in the provided - # {::Google::Cloud::Retail::V2::Product Product} to update. The immutable and - # output only fields are NOT supported. If not set, all supported fields (the - # fields that are neither immutable nor output only) are updated. - # - # If an unsupported or unknown field is provided, an INVALID_ARGUMENT error - # is returned. - # - # The attribute key can be updated by setting the mask path as - # "attributes.$\\{key_name}". If a key name is present in the mask but not in - # the patching product from the request, this key will be deleted after the - # update. - # @param allow_missing [::Boolean] - # If set to true, and the {::Google::Cloud::Retail::V2::Product Product} is not - # found, a new {::Google::Cloud::Retail::V2::Product Product} will be created. In - # this situation, `update_mask` is ignored. - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Google::Cloud::Retail::V2::Product] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Google::Cloud::Retail::V2::Product] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/cloud/retail/v2" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Retail::V2::ProductService::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Retail::V2::UpdateProductRequest.new - # - # # Call the update_product method. - # result = client.update_product request - # - # # The returned object is of type Google::Cloud::Retail::V2::Product. - # p result - # - def update_product request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Retail::V2::UpdateProductRequest - - # Converts hash 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_product.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::Retail::V2::VERSION - metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - header_params = {} - if request.product&.name - header_params["product.name"] = request.product.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_product.timeout, - metadata: metadata, - retry_policy: @config.rpcs.update_product.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @product_service_stub.call_rpc :update_product, request, options: options do |response, operation| - yield response, operation if block_given? - end - rescue ::GRPC::BadStatus => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Deletes a {::Google::Cloud::Retail::V2::Product Product}. - # - # @overload delete_product(request, options = nil) - # Pass arguments to `delete_product` via a request object, either of type - # {::Google::Cloud::Retail::V2::DeleteProductRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Retail::V2::DeleteProductRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_product(name: nil) - # Pass arguments to `delete_product` via keyword arguments. Note that at - # least one keyword argument is 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. Full resource name of {::Google::Cloud::Retail::V2::Product Product}, - # such as - # `projects/*/locations/global/catalogs/default_catalog/branches/default_branch/products/some_product_id`. - # - # If the caller does not have permission to delete the - # {::Google::Cloud::Retail::V2::Product Product}, regardless of whether or not it - # exists, a PERMISSION_DENIED error is returned. - # - # If the {::Google::Cloud::Retail::V2::Product Product} to delete does not exist, - # a NOT_FOUND error is returned. - # - # The {::Google::Cloud::Retail::V2::Product Product} to delete can neither be a - # {::Google::Cloud::Retail::V2::Product::Type::COLLECTION Product.Type.COLLECTION} - # {::Google::Cloud::Retail::V2::Product Product} member nor a - # {::Google::Cloud::Retail::V2::Product::Type::PRIMARY Product.Type.PRIMARY} - # {::Google::Cloud::Retail::V2::Product Product} with more than one - # {::Google::Cloud::Retail::V2::Product::Type::VARIANT variants}. Otherwise, an - # INVALID_ARGUMENT error is returned. - # - # All inventory information for the named - # {::Google::Cloud::Retail::V2::Product Product} will 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/cloud/retail/v2" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Retail::V2::ProductService::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Retail::V2::DeleteProductRequest.new - # - # # Call the delete_product method. - # result = client.delete_product request - # - # # The returned object is of type Google::Protobuf::Empty. - # p result - # - def delete_product request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Retail::V2::DeleteProductRequest - - # Converts hash 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_product.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::Retail::V2::VERSION - metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - header_params = {} - if request.name - header_params["name"] = request.name - end - - request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") - metadata[:"x-goog-request-params"] ||= request_params_header - - options.apply_defaults timeout: @config.rpcs.delete_product.timeout, - metadata: metadata, - retry_policy: @config.rpcs.delete_product.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @product_service_stub.call_rpc :delete_product, request, options: options do |response, operation| - yield response, operation if block_given? - end - rescue ::GRPC::BadStatus => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Permanently deletes all selected {::Google::Cloud::Retail::V2::Product Product}s - # under a branch. - # - # This process is asynchronous. If the request is valid, the removal will be - # enqueued and processed offline. Depending on the number of - # {::Google::Cloud::Retail::V2::Product Product}s, this operation could take hours - # to complete. Before the operation completes, some - # {::Google::Cloud::Retail::V2::Product Product}s may still be returned by - # {::Google::Cloud::Retail::V2::ProductService::Client#get_product ProductService.GetProduct} - # or - # {::Google::Cloud::Retail::V2::ProductService::Client#list_products ProductService.ListProducts}. - # - # Depending on the number of {::Google::Cloud::Retail::V2::Product Product}s, this - # operation could take hours to complete. To get a sample of - # {::Google::Cloud::Retail::V2::Product Product}s that would be deleted, set - # {::Google::Cloud::Retail::V2::PurgeProductsRequest#force PurgeProductsRequest.force} - # to false. - # - # @overload purge_products(request, options = nil) - # Pass arguments to `purge_products` via a request object, either of type - # {::Google::Cloud::Retail::V2::PurgeProductsRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Retail::V2::PurgeProductsRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. - # - # @overload purge_products(parent: nil, filter: nil, force: nil) - # Pass arguments to `purge_products` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param parent [::String] - # Required. The resource name of the branch under which the products are - # created. The format is - # `projects/${projectId}/locations/global/catalogs/${catalogId}/branches/${branchId}` - # @param filter [::String] - # Required. The filter string to specify the products to be deleted with a - # length limit of 5,000 characters. - # - # Empty string filter is not allowed. "*" implies delete all items in a - # branch. - # - # The eligible fields for filtering are: - # - # * `availability`: Double quoted - # {::Google::Cloud::Retail::V2::Product#availability Product.availability} string. - # * `create_time` : in ISO 8601 "zulu" format. - # - # Supported syntax: - # - # * Comparators (">", "<", ">=", "<=", "="). - # Examples: - # * create_time <= "2015-02-13T17:05:46Z" - # * availability = "IN_STOCK" - # - # * Conjunctions ("AND") - # Examples: - # * create_time <= "2015-02-13T17:05:46Z" AND availability = "PREORDER" - # - # * Disjunctions ("OR") - # Examples: - # * create_time <= "2015-02-13T17:05:46Z" OR availability = "IN_STOCK" - # - # * Can support nested queries. - # Examples: - # * (create_time <= "2015-02-13T17:05:46Z" AND availability = "PREORDER") - # OR (create_time >= "2015-02-14T13:03:32Z" AND availability = "IN_STOCK") - # - # * Filter Limits: - # * Filter should not contain more than 6 conditions. - # * Max nesting depth should not exceed 2 levels. - # - # Examples queries: - # * Delete back order products created before a timestamp. - # create_time <= "2015-02-13T17:05:46Z" OR availability = "BACKORDER" - # @param force [::Boolean] - # Actually perform the purge. - # If `force` is set to false, the method will return the expected purge count - # without deleting any products. - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Gapic::Operation] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Gapic::Operation] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/cloud/retail/v2" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Retail::V2::ProductService::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Retail::V2::PurgeProductsRequest.new - # - # # Call the purge_products method. - # result = client.purge_products 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 purge_products request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Retail::V2::PurgeProductsRequest - - # Converts hash 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.purge_products.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::Retail::V2::VERSION - metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - header_params = {} - if request.parent - 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.purge_products.timeout, - metadata: metadata, - retry_policy: @config.rpcs.purge_products.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @product_service_stub.call_rpc :purge_products, 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 - - ## - # Bulk import of multiple {::Google::Cloud::Retail::V2::Product Product}s. - # - # Request processing may be synchronous. - # Non-existing items are created. - # - # Note that it is possible for a subset of the - # {::Google::Cloud::Retail::V2::Product Product}s to be successfully updated. - # - # @overload import_products(request, options = nil) - # Pass arguments to `import_products` via a request object, either of type - # {::Google::Cloud::Retail::V2::ImportProductsRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Retail::V2::ImportProductsRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. - # - # @overload import_products(parent: nil, request_id: nil, input_config: nil, errors_config: nil, update_mask: nil, reconciliation_mode: nil, notification_pubsub_topic: nil) - # Pass arguments to `import_products` via keyword arguments. Note that at - # least one keyword argument is 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. - # `projects/1234/locations/global/catalogs/default_catalog/branches/default_branch` - # - # If no updateMask is specified, requires products.create permission. - # If updateMask is specified, requires products.update permission. - # @param request_id [::String] - # Deprecated. This field has no effect. - # @param input_config [::Google::Cloud::Retail::V2::ProductInputConfig, ::Hash] - # Required. The desired input location of the data. - # @param errors_config [::Google::Cloud::Retail::V2::ImportErrorsConfig, ::Hash] - # The desired location of errors incurred during the Import. - # @param update_mask [::Google::Protobuf::FieldMask, ::Hash] - # Indicates which fields in the provided imported `products` to update. If - # not set, all fields are updated. If provided, only the existing product - # fields are updated. Missing products will not be created. - # @param reconciliation_mode [::Google::Cloud::Retail::V2::ImportProductsRequest::ReconciliationMode] - # The mode of reconciliation between existing products and the products to be - # imported. Defaults to - # {::Google::Cloud::Retail::V2::ImportProductsRequest::ReconciliationMode::INCREMENTAL ReconciliationMode.INCREMENTAL}. - # @param notification_pubsub_topic [::String] - # Full Pub/Sub topic name for receiving notification. If this field is set, - # when the import is finished, a notification is sent to - # specified Pub/Sub topic. The message data is JSON string of a - # {::Google::Longrunning::Operation Operation}. - # - # Format of the Pub/Sub topic is `projects/{project}/topics/{topic}`. It has - # to be within the same project as - # {::Google::Cloud::Retail::V2::ImportProductsRequest#parent ImportProductsRequest.parent}. - # Make sure that both - # `cloud-retail-customer-data-access@system.gserviceaccount.com` and - # `service-@gcp-sa-retail.iam.gserviceaccount.com` - # have the `pubsub.topics.publish` IAM permission on the topic. - # - # Only supported when - # {::Google::Cloud::Retail::V2::ImportProductsRequest#reconciliation_mode ImportProductsRequest.reconciliation_mode} - # is set to `FULL`. - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Gapic::Operation] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Gapic::Operation] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/cloud/retail/v2" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Retail::V2::ProductService::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Retail::V2::ImportProductsRequest.new - # - # # Call the import_products method. - # result = client.import_products 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 import_products request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Retail::V2::ImportProductsRequest - - # Converts hash 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.import_products.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::Retail::V2::VERSION - metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - header_params = {} - if request.parent - 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.import_products.timeout, - metadata: metadata, - retry_policy: @config.rpcs.import_products.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @product_service_stub.call_rpc :import_products, request, options: options do |response, operation| - response = ::Gapic::Operation.new response, @operations_client, options: options - yield response, operation if block_given? - throw :response, response - end - rescue ::GRPC::BadStatus => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Updates inventory information for a - # {::Google::Cloud::Retail::V2::Product Product} while respecting the last update - # timestamps of each inventory field. - # - # This process is asynchronous and does not require the - # {::Google::Cloud::Retail::V2::Product Product} to exist before updating - # fulfillment information. If the request is valid, the update is enqueued - # and processed downstream. As a consequence, when a response is returned, - # updates are not immediately manifested in the - # {::Google::Cloud::Retail::V2::Product Product} queried by - # {::Google::Cloud::Retail::V2::ProductService::Client#get_product ProductService.GetProduct} - # or - # {::Google::Cloud::Retail::V2::ProductService::Client#list_products ProductService.ListProducts}. - # - # When inventory is updated with - # {::Google::Cloud::Retail::V2::ProductService::Client#create_product ProductService.CreateProduct} - # and - # {::Google::Cloud::Retail::V2::ProductService::Client#update_product ProductService.UpdateProduct}, - # the specified inventory field value(s) overwrite any existing value(s) - # while ignoring the last update time for this field. Furthermore, the last - # update times for the specified inventory fields are overwritten by the - # times of the - # {::Google::Cloud::Retail::V2::ProductService::Client#create_product ProductService.CreateProduct} - # or - # {::Google::Cloud::Retail::V2::ProductService::Client#update_product ProductService.UpdateProduct} - # request. - # - # If no inventory fields are set in - # {::Google::Cloud::Retail::V2::CreateProductRequest#product CreateProductRequest.product}, - # then any pre-existing inventory information for this product is used. - # - # If no inventory fields are set in - # {::Google::Cloud::Retail::V2::SetInventoryRequest#set_mask SetInventoryRequest.set_mask}, - # then any existing inventory information is preserved. - # - # Pre-existing inventory information can only be updated with - # {::Google::Cloud::Retail::V2::ProductService::Client#set_inventory ProductService.SetInventory}, - # {::Google::Cloud::Retail::V2::ProductService::Client#add_fulfillment_places ProductService.AddFulfillmentPlaces}, - # and - # {::Google::Cloud::Retail::V2::ProductService::Client#remove_fulfillment_places ProductService.RemoveFulfillmentPlaces}. - # - # The returned {::Google::Longrunning::Operation Operation}s is obsolete after - # one day, and the GetOperation - # API returns `NOT_FOUND` afterwards. - # - # If conflicting updates are issued, the - # {::Google::Longrunning::Operation Operation}s associated with the stale - # updates are not marked as {::Google::Longrunning::Operation#done done} until - # they are obsolete. - # - # @overload set_inventory(request, options = nil) - # Pass arguments to `set_inventory` via a request object, either of type - # {::Google::Cloud::Retail::V2::SetInventoryRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Retail::V2::SetInventoryRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. - # - # @overload set_inventory(inventory: nil, set_mask: nil, set_time: nil, allow_missing: nil) - # Pass arguments to `set_inventory` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param inventory [::Google::Cloud::Retail::V2::Product, ::Hash] - # Required. The inventory information to update. The allowable fields to - # update are: - # - # * {::Google::Cloud::Retail::V2::Product#price_info Product.price_info} - # * {::Google::Cloud::Retail::V2::Product#availability Product.availability} - # * {::Google::Cloud::Retail::V2::Product#available_quantity Product.available_quantity} - # * {::Google::Cloud::Retail::V2::Product#fulfillment_info Product.fulfillment_info} - # The updated inventory fields must be specified in - # {::Google::Cloud::Retail::V2::SetInventoryRequest#set_mask SetInventoryRequest.set_mask}. - # - # If - # {::Google::Cloud::Retail::V2::Product#name SetInventoryRequest.inventory.name} - # is empty or invalid, an INVALID_ARGUMENT error is returned. - # - # If the caller does not have permission to update the - # {::Google::Cloud::Retail::V2::Product Product} named in - # {::Google::Cloud::Retail::V2::Product#name Product.name}, regardless of whether - # or not it exists, a PERMISSION_DENIED error is returned. - # - # If the {::Google::Cloud::Retail::V2::Product Product} to update does not have - # existing inventory information, the provided inventory information will be - # inserted. - # - # If the {::Google::Cloud::Retail::V2::Product Product} to update has existing - # inventory information, the provided inventory information will be merged - # while respecting the last update time for each inventory field, using the - # provided or default value for - # {::Google::Cloud::Retail::V2::SetInventoryRequest#set_time SetInventoryRequest.set_time}. - # - # The caller can replace place IDs for a subset of fulfillment types in the - # following ways: - # - # * Adds "fulfillment_info" in - # {::Google::Cloud::Retail::V2::SetInventoryRequest#set_mask SetInventoryRequest.set_mask} - # * Specifies only the desired fulfillment types and corresponding place IDs - # to update in - # {::Google::Cloud::Retail::V2::Product#fulfillment_info SetInventoryRequest.inventory.fulfillment_info} - # - # The caller can clear all place IDs from a subset of fulfillment types in - # the following ways: - # - # * Adds "fulfillment_info" in - # {::Google::Cloud::Retail::V2::SetInventoryRequest#set_mask SetInventoryRequest.set_mask} - # * Specifies only the desired fulfillment types to clear in - # {::Google::Cloud::Retail::V2::Product#fulfillment_info SetInventoryRequest.inventory.fulfillment_info} - # * Checks that only the desired fulfillment info types have empty - # {::Google::Cloud::Retail::V2::FulfillmentInfo#place_ids SetInventoryRequest.inventory.fulfillment_info.place_ids} - # - # The last update time is recorded for the following inventory fields: - # * {::Google::Cloud::Retail::V2::Product#price_info Product.price_info} - # * {::Google::Cloud::Retail::V2::Product#availability Product.availability} - # * {::Google::Cloud::Retail::V2::Product#available_quantity Product.available_quantity} - # * {::Google::Cloud::Retail::V2::Product#fulfillment_info Product.fulfillment_info} - # - # If a full overwrite of inventory information while ignoring timestamps is - # needed, - # {::Google::Cloud::Retail::V2::ProductService::Client#update_product ProductService.UpdateProduct} - # should be invoked instead. - # @param set_mask [::Google::Protobuf::FieldMask, ::Hash] - # Indicates which inventory fields in the provided - # {::Google::Cloud::Retail::V2::Product Product} to update. - # - # At least one field must be provided. - # - # If an unsupported or unknown field is provided, an INVALID_ARGUMENT error - # is returned and the entire update will be ignored. - # @param set_time [::Google::Protobuf::Timestamp, ::Hash] - # The time when the request is issued, used to prevent - # out-of-order updates on inventory fields with the last update time - # recorded. If not provided, the internal system time will be used. - # @param allow_missing [::Boolean] - # If set to true, and the {::Google::Cloud::Retail::V2::Product Product} with name - # {::Google::Cloud::Retail::V2::Product#name Product.name} is not found, the - # inventory update will still be processed and retained for at most 1 day - # until the {::Google::Cloud::Retail::V2::Product Product} is created. If set to - # false, a NOT_FOUND error is returned if the - # {::Google::Cloud::Retail::V2::Product Product} is not found. - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Gapic::Operation] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Gapic::Operation] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/cloud/retail/v2" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Retail::V2::ProductService::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Retail::V2::SetInventoryRequest.new - # - # # Call the set_inventory method. - # result = client.set_inventory 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 set_inventory request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Retail::V2::SetInventoryRequest - - # Converts hash and nil to an options object - options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h - - # Customize the options with defaults - metadata = @config.rpcs.set_inventory.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::Retail::V2::VERSION - metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - header_params = {} - if request.inventory&.name - header_params["inventory.name"] = request.inventory.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.set_inventory.timeout, - metadata: metadata, - retry_policy: @config.rpcs.set_inventory.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @product_service_stub.call_rpc :set_inventory, 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 - - ## - # We recommend that you use the - # {::Google::Cloud::Retail::V2::ProductService::Client#add_local_inventories ProductService.AddLocalInventories} - # method instead of the - # {::Google::Cloud::Retail::V2::ProductService::Client#add_fulfillment_places ProductService.AddFulfillmentPlaces} - # method. - # {::Google::Cloud::Retail::V2::ProductService::Client#add_local_inventories ProductService.AddLocalInventories} - # achieves the same results but provides more fine-grained control over - # ingesting local inventory data. - # - # Incrementally adds place IDs to - # {::Google::Cloud::Retail::V2::FulfillmentInfo#place_ids Product.fulfillment_info.place_ids}. - # - # This process is asynchronous and does not require the - # {::Google::Cloud::Retail::V2::Product Product} to exist before updating - # fulfillment information. If the request is valid, the update will be - # enqueued and processed downstream. As a consequence, when a response is - # returned, the added place IDs are not immediately manifested in the - # {::Google::Cloud::Retail::V2::Product Product} queried by - # {::Google::Cloud::Retail::V2::ProductService::Client#get_product ProductService.GetProduct} - # or - # {::Google::Cloud::Retail::V2::ProductService::Client#list_products ProductService.ListProducts}. - # - # The returned {::Google::Longrunning::Operation Operation}s will be obsolete - # after 1 day, and GetOperation - # API will return NOT_FOUND afterwards. - # - # If conflicting updates are issued, the - # {::Google::Longrunning::Operation Operation}s associated with the stale - # updates will not be marked as {::Google::Longrunning::Operation#done done} - # until being obsolete. - # - # @overload add_fulfillment_places(request, options = nil) - # Pass arguments to `add_fulfillment_places` via a request object, either of type - # {::Google::Cloud::Retail::V2::AddFulfillmentPlacesRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Retail::V2::AddFulfillmentPlacesRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. - # - # @overload add_fulfillment_places(product: nil, type: nil, place_ids: nil, add_time: nil, allow_missing: nil) - # Pass arguments to `add_fulfillment_places` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param product [::String] - # Required. Full resource name of {::Google::Cloud::Retail::V2::Product Product}, - # such as - # `projects/*/locations/global/catalogs/default_catalog/branches/default_branch/products/some_product_id`. - # - # If the caller does not have permission to access the - # {::Google::Cloud::Retail::V2::Product Product}, regardless of whether or not it - # exists, a PERMISSION_DENIED error is returned. - # @param type [::String] - # Required. The fulfillment type, including commonly used types (such as - # pickup in store and same day delivery), and custom types. - # - # Supported values: - # - # * "pickup-in-store" - # * "ship-to-store" - # * "same-day-delivery" - # * "next-day-delivery" - # * "custom-type-1" - # * "custom-type-2" - # * "custom-type-3" - # * "custom-type-4" - # * "custom-type-5" - # - # If this field is set to an invalid value other than these, an - # INVALID_ARGUMENT error is returned. - # - # This field directly corresponds to - # {::Google::Cloud::Retail::V2::FulfillmentInfo#type Product.fulfillment_info.type}. - # @param place_ids [::Array<::String>] - # Required. The IDs for this - # {::Google::Cloud::Retail::V2::AddFulfillmentPlacesRequest#type type}, such as - # the store IDs for "pickup-in-store" or the region IDs for - # "same-day-delivery" to be added for this - # {::Google::Cloud::Retail::V2::AddFulfillmentPlacesRequest#type type}. Duplicate - # IDs will be automatically ignored. - # - # At least 1 value is required, and a maximum of 2000 values are allowed. - # Each value must be a string with a length limit of 10 characters, matching - # the pattern `[a-zA-Z0-9_-]+`, such as "store1" or "REGION-2". Otherwise, an - # INVALID_ARGUMENT error is returned. - # - # If the total number of place IDs exceeds 2000 for this - # {::Google::Cloud::Retail::V2::AddFulfillmentPlacesRequest#type type} after - # adding, then the update will be rejected. - # @param add_time [::Google::Protobuf::Timestamp, ::Hash] - # The time when the fulfillment updates are issued, used to prevent - # out-of-order updates on fulfillment information. If not provided, the - # internal system time will be used. - # @param allow_missing [::Boolean] - # If set to true, and the {::Google::Cloud::Retail::V2::Product Product} is not - # found, the fulfillment information will still be processed and retained for - # at most 1 day and processed once the - # {::Google::Cloud::Retail::V2::Product Product} is created. If set to false, a - # NOT_FOUND error is returned if the - # {::Google::Cloud::Retail::V2::Product Product} is not found. - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Gapic::Operation] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Gapic::Operation] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/cloud/retail/v2" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Retail::V2::ProductService::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Retail::V2::AddFulfillmentPlacesRequest.new - # - # # Call the add_fulfillment_places method. - # result = client.add_fulfillment_places 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 add_fulfillment_places request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Retail::V2::AddFulfillmentPlacesRequest - - # Converts hash and nil to an options object - options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h - - # Customize the options with defaults - metadata = @config.rpcs.add_fulfillment_places.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::Retail::V2::VERSION - metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - header_params = {} - if request.product - header_params["product"] = request.product - end - - request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") - metadata[:"x-goog-request-params"] ||= request_params_header - - options.apply_defaults timeout: @config.rpcs.add_fulfillment_places.timeout, - metadata: metadata, - retry_policy: @config.rpcs.add_fulfillment_places.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @product_service_stub.call_rpc :add_fulfillment_places, 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 - - ## - # We recommend that you use the - # {::Google::Cloud::Retail::V2::ProductService::Client#remove_local_inventories ProductService.RemoveLocalInventories} - # method instead of the - # {::Google::Cloud::Retail::V2::ProductService::Client#remove_fulfillment_places ProductService.RemoveFulfillmentPlaces} - # method. - # {::Google::Cloud::Retail::V2::ProductService::Client#remove_local_inventories ProductService.RemoveLocalInventories} - # achieves the same results but provides more fine-grained control over - # ingesting local inventory data. - # - # Incrementally removes place IDs from a - # {::Google::Cloud::Retail::V2::FulfillmentInfo#place_ids Product.fulfillment_info.place_ids}. - # - # This process is asynchronous and does not require the - # {::Google::Cloud::Retail::V2::Product Product} to exist before updating - # fulfillment information. If the request is valid, the update will be - # enqueued and processed downstream. As a consequence, when a response is - # returned, the removed place IDs are not immediately manifested in the - # {::Google::Cloud::Retail::V2::Product Product} queried by - # {::Google::Cloud::Retail::V2::ProductService::Client#get_product ProductService.GetProduct} - # or - # {::Google::Cloud::Retail::V2::ProductService::Client#list_products ProductService.ListProducts}. - # - # The returned {::Google::Longrunning::Operation Operation}s will be obsolete - # after 1 day, and GetOperation - # API will return NOT_FOUND afterwards. - # - # If conflicting updates are issued, the - # {::Google::Longrunning::Operation Operation}s associated with the stale - # updates will not be marked as {::Google::Longrunning::Operation#done done} - # until being obsolete. - # - # @overload remove_fulfillment_places(request, options = nil) - # Pass arguments to `remove_fulfillment_places` via a request object, either of type - # {::Google::Cloud::Retail::V2::RemoveFulfillmentPlacesRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Retail::V2::RemoveFulfillmentPlacesRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. - # - # @overload remove_fulfillment_places(product: nil, type: nil, place_ids: nil, remove_time: nil, allow_missing: nil) - # Pass arguments to `remove_fulfillment_places` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param product [::String] - # Required. Full resource name of {::Google::Cloud::Retail::V2::Product Product}, - # such as - # `projects/*/locations/global/catalogs/default_catalog/branches/default_branch/products/some_product_id`. - # - # If the caller does not have permission to access the - # {::Google::Cloud::Retail::V2::Product Product}, regardless of whether or not it - # exists, a PERMISSION_DENIED error is returned. - # @param type [::String] - # Required. The fulfillment type, including commonly used types (such as - # pickup in store and same day delivery), and custom types. - # - # Supported values: - # - # * "pickup-in-store" - # * "ship-to-store" - # * "same-day-delivery" - # * "next-day-delivery" - # * "custom-type-1" - # * "custom-type-2" - # * "custom-type-3" - # * "custom-type-4" - # * "custom-type-5" - # - # If this field is set to an invalid value other than these, an - # INVALID_ARGUMENT error is returned. - # - # This field directly corresponds to - # {::Google::Cloud::Retail::V2::FulfillmentInfo#type Product.fulfillment_info.type}. - # @param place_ids [::Array<::String>] - # Required. The IDs for this - # {::Google::Cloud::Retail::V2::RemoveFulfillmentPlacesRequest#type type}, such as - # the store IDs for "pickup-in-store" or the region IDs for - # "same-day-delivery", to be removed for this - # {::Google::Cloud::Retail::V2::RemoveFulfillmentPlacesRequest#type type}. - # - # At least 1 value is required, and a maximum of 2000 values are allowed. - # Each value must be a string with a length limit of 10 characters, matching - # the pattern `[a-zA-Z0-9_-]+`, such as "store1" or "REGION-2". Otherwise, an - # INVALID_ARGUMENT error is returned. - # @param remove_time [::Google::Protobuf::Timestamp, ::Hash] - # The time when the fulfillment updates are issued, used to prevent - # out-of-order updates on fulfillment information. If not provided, the - # internal system time will be used. - # @param allow_missing [::Boolean] - # If set to true, and the {::Google::Cloud::Retail::V2::Product Product} is not - # found, the fulfillment information will still be processed and retained for - # at most 1 day and processed once the - # {::Google::Cloud::Retail::V2::Product Product} is created. If set to false, a - # NOT_FOUND error is returned if the - # {::Google::Cloud::Retail::V2::Product Product} is not found. - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Gapic::Operation] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Gapic::Operation] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/cloud/retail/v2" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Retail::V2::ProductService::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Retail::V2::RemoveFulfillmentPlacesRequest.new - # - # # Call the remove_fulfillment_places method. - # result = client.remove_fulfillment_places 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 remove_fulfillment_places request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Retail::V2::RemoveFulfillmentPlacesRequest - - # Converts hash 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.remove_fulfillment_places.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::Retail::V2::VERSION - metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - header_params = {} - if request.product - header_params["product"] = request.product - 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.remove_fulfillment_places.timeout, - metadata: metadata, - retry_policy: @config.rpcs.remove_fulfillment_places.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @product_service_stub.call_rpc :remove_fulfillment_places, request, options: options do |response, operation| - response = ::Gapic::Operation.new response, @operations_client, options: options - yield response, operation if block_given? - throw :response, response - end - rescue ::GRPC::BadStatus => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Updates local inventory information for a - # {::Google::Cloud::Retail::V2::Product Product} at a list of places, while - # respecting the last update timestamps of each inventory field. - # - # This process is asynchronous and does not require the - # {::Google::Cloud::Retail::V2::Product Product} to exist before updating - # inventory information. If the request is valid, the update will be enqueued - # and processed downstream. As a consequence, when a response is returned, - # updates are not immediately manifested in the - # {::Google::Cloud::Retail::V2::Product Product} queried by - # {::Google::Cloud::Retail::V2::ProductService::Client#get_product ProductService.GetProduct} - # or - # {::Google::Cloud::Retail::V2::ProductService::Client#list_products ProductService.ListProducts}. - # - # Local inventory information can only be modified using this method. - # {::Google::Cloud::Retail::V2::ProductService::Client#create_product ProductService.CreateProduct} - # and - # {::Google::Cloud::Retail::V2::ProductService::Client#update_product ProductService.UpdateProduct} - # has no effect on local inventories. - # - # The returned {::Google::Longrunning::Operation Operation}s will be obsolete - # after 1 day, and GetOperation - # API will return NOT_FOUND afterwards. - # - # If conflicting updates are issued, the - # {::Google::Longrunning::Operation Operation}s associated with the stale - # updates will not be marked as {::Google::Longrunning::Operation#done done} - # until being obsolete. - # - # @overload add_local_inventories(request, options = nil) - # Pass arguments to `add_local_inventories` via a request object, either of type - # {::Google::Cloud::Retail::V2::AddLocalInventoriesRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Retail::V2::AddLocalInventoriesRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. - # - # @overload add_local_inventories(product: nil, local_inventories: nil, add_mask: nil, add_time: nil, allow_missing: nil) - # Pass arguments to `add_local_inventories` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param product [::String] - # Required. Full resource name of {::Google::Cloud::Retail::V2::Product Product}, - # such as - # `projects/*/locations/global/catalogs/default_catalog/branches/default_branch/products/some_product_id`. - # - # If the caller does not have permission to access the - # {::Google::Cloud::Retail::V2::Product Product}, regardless of whether or not it - # exists, a PERMISSION_DENIED error is returned. - # @param local_inventories [::Array<::Google::Cloud::Retail::V2::LocalInventory, ::Hash>] - # Required. A list of inventory information at difference places. Each place - # is identified by its place ID. At most 3000 inventories are allowed per - # request. - # @param add_mask [::Google::Protobuf::FieldMask, ::Hash] - # Indicates which inventory fields in the provided list of - # {::Google::Cloud::Retail::V2::LocalInventory LocalInventory} to update. The - # field is updated to the provided value. - # - # If a field is set while the place does not have a previous local inventory, - # the local inventory at that store is created. - # - # If a field is set while the value of that field is not provided, the - # original field value, if it exists, is deleted. - # - # If the mask is not set or set with empty paths, all inventory fields will - # be updated. - # - # If an unsupported or unknown field is provided, an INVALID_ARGUMENT error - # is returned and the entire update will be ignored. - # @param add_time [::Google::Protobuf::Timestamp, ::Hash] - # The time when the inventory updates are issued. Used to prevent - # out-of-order updates on local inventory fields. If not provided, the - # internal system time will be used. - # @param allow_missing [::Boolean] - # If set to true, and the {::Google::Cloud::Retail::V2::Product Product} is not - # found, the local inventory will still be processed and retained for at most - # 1 day and processed once the {::Google::Cloud::Retail::V2::Product Product} is - # created. If set to false, a NOT_FOUND error is returned if the - # {::Google::Cloud::Retail::V2::Product Product} is not found. - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Gapic::Operation] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Gapic::Operation] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/cloud/retail/v2" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Retail::V2::ProductService::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Retail::V2::AddLocalInventoriesRequest.new - # - # # Call the add_local_inventories method. - # result = client.add_local_inventories 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 add_local_inventories request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Retail::V2::AddLocalInventoriesRequest - - # Converts hash and nil to an options object - options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h - - # Customize the options with defaults - metadata = @config.rpcs.add_local_inventories.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::Retail::V2::VERSION - metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - header_params = {} - if request.product - header_params["product"] = request.product - end - - request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") - metadata[:"x-goog-request-params"] ||= request_params_header - - options.apply_defaults timeout: @config.rpcs.add_local_inventories.timeout, - metadata: metadata, - retry_policy: @config.rpcs.add_local_inventories.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @product_service_stub.call_rpc :add_local_inventories, 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 - - ## - # Remove local inventory information for a - # {::Google::Cloud::Retail::V2::Product Product} at a list of places at a removal - # timestamp. - # - # This process is asynchronous. If the request is valid, the removal will be - # enqueued and processed downstream. As a consequence, when a response is - # returned, removals are not immediately manifested in the - # {::Google::Cloud::Retail::V2::Product Product} queried by - # {::Google::Cloud::Retail::V2::ProductService::Client#get_product ProductService.GetProduct} - # or - # {::Google::Cloud::Retail::V2::ProductService::Client#list_products ProductService.ListProducts}. - # - # Local inventory information can only be removed using this method. - # {::Google::Cloud::Retail::V2::ProductService::Client#create_product ProductService.CreateProduct} - # and - # {::Google::Cloud::Retail::V2::ProductService::Client#update_product ProductService.UpdateProduct} - # has no effect on local inventories. - # - # The returned {::Google::Longrunning::Operation Operation}s will be obsolete - # after 1 day, and GetOperation - # API will return NOT_FOUND afterwards. - # - # If conflicting updates are issued, the - # {::Google::Longrunning::Operation Operation}s associated with the stale - # updates will not be marked as {::Google::Longrunning::Operation#done done} - # until being obsolete. - # - # @overload remove_local_inventories(request, options = nil) - # Pass arguments to `remove_local_inventories` via a request object, either of type - # {::Google::Cloud::Retail::V2::RemoveLocalInventoriesRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Retail::V2::RemoveLocalInventoriesRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. - # - # @overload remove_local_inventories(product: nil, place_ids: nil, remove_time: nil, allow_missing: nil) - # Pass arguments to `remove_local_inventories` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param product [::String] - # Required. Full resource name of {::Google::Cloud::Retail::V2::Product Product}, - # such as - # `projects/*/locations/global/catalogs/default_catalog/branches/default_branch/products/some_product_id`. - # - # If the caller does not have permission to access the - # {::Google::Cloud::Retail::V2::Product Product}, regardless of whether or not it - # exists, a PERMISSION_DENIED error is returned. - # @param place_ids [::Array<::String>] - # Required. A list of place IDs to have their inventory deleted. - # At most 3000 place IDs are allowed per request. - # @param remove_time [::Google::Protobuf::Timestamp, ::Hash] - # The time when the inventory deletions are issued. Used to prevent - # out-of-order updates and deletions on local inventory fields. If not - # provided, the internal system time will be used. - # @param allow_missing [::Boolean] - # If set to true, and the {::Google::Cloud::Retail::V2::Product Product} is not - # found, the local inventory removal request will still be processed and - # retained for at most 1 day and processed once the - # {::Google::Cloud::Retail::V2::Product Product} is created. If set to false, a - # NOT_FOUND error is returned if the - # {::Google::Cloud::Retail::V2::Product Product} is not found. - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Gapic::Operation] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Gapic::Operation] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/cloud/retail/v2" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Retail::V2::ProductService::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Retail::V2::RemoveLocalInventoriesRequest.new - # - # # Call the remove_local_inventories method. - # result = client.remove_local_inventories 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 remove_local_inventories request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Retail::V2::RemoveLocalInventoriesRequest - - # Converts hash 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.remove_local_inventories.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::Retail::V2::VERSION - metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - header_params = {} - if request.product - header_params["product"] = request.product - 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.remove_local_inventories.timeout, - metadata: metadata, - retry_policy: @config.rpcs.remove_local_inventories.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @product_service_stub.call_rpc :remove_local_inventories, 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 ProductService API. - # - # This class represents the configuration for ProductService, - # providing control over timeouts, retry behavior, logging, transport - # parameters, and other low-level controls. Certain parameters can also be - # applied individually to specific RPCs. See - # {::Google::Cloud::Retail::V2::ProductService::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_product to 20 seconds, - # # and all remaining timeouts to 10 seconds. - # ::Google::Cloud::Retail::V2::ProductService::Client.configure do |config| - # config.timeout = 10.0 - # config.rpcs.create_product.timeout = 20.0 - # end - # - # # Apply the above configuration only to a new client. - # client = ::Google::Cloud::Retail::V2::ProductService::Client.new do |config| - # config.timeout = 10.0 - # config.rpcs.create_product.timeout = 20.0 - # end - # - # @!attribute [rw] endpoint - # A custom service endpoint, as a hostname or hostname:port. The default is - # nil, indicating to use the default endpoint in the current universe domain. - # @return [::String,nil] - # @!attribute [rw] credentials - # Credentials to send with calls. You may provide any of the following types: - # * (`Google::Auth::Credentials`) A googleauth credentials object - # (see the [googleauth docs](https://rubydoc.info/gems/googleauth/Google/Auth/Credentials)) - # * (`Signet::OAuth2::Client`) A signet oauth2 client object - # (see the [signet docs](https://rubydoc.info/gems/signet/Signet/OAuth2/Client)) - # * (`GRPC::Core::Channel`) a gRPC channel with included credentials - # * (`GRPC::Core::ChannelCredentials`) a gRPC credentails object - # * (`nil`) indicating no credentials - # - # @note Warning: Passing a `String` to a keyfile path or a `Hash` of credentials - # is deprecated. Providing an unvalidated credential configuration to - # Google APIs can compromise the security of your systems and data. - # - # @example - # - # # The recommended way to provide credentials is to use the `make_creds` method - # # on the appropriate credentials class for your environment. - # - # require "googleauth" - # - # credentials = ::Google::Auth::ServiceAccountCredentials.make_creds( - # json_key_io: ::File.open("/path/to/keyfile.json") - # ) - # - # client = ::Google::Cloud::Retail::V2::ProductService::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 = "retail.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 ProductService 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_product` - # @return [::Gapic::Config::Method] - # - attr_reader :create_product - ## - # RPC-specific configuration for `get_product` - # @return [::Gapic::Config::Method] - # - attr_reader :get_product - ## - # RPC-specific configuration for `list_products` - # @return [::Gapic::Config::Method] - # - attr_reader :list_products - ## - # RPC-specific configuration for `update_product` - # @return [::Gapic::Config::Method] - # - attr_reader :update_product - ## - # RPC-specific configuration for `delete_product` - # @return [::Gapic::Config::Method] - # - attr_reader :delete_product - ## - # RPC-specific configuration for `purge_products` - # @return [::Gapic::Config::Method] - # - attr_reader :purge_products - ## - # RPC-specific configuration for `import_products` - # @return [::Gapic::Config::Method] - # - attr_reader :import_products - ## - # RPC-specific configuration for `set_inventory` - # @return [::Gapic::Config::Method] - # - attr_reader :set_inventory - ## - # RPC-specific configuration for `add_fulfillment_places` - # @return [::Gapic::Config::Method] - # - attr_reader :add_fulfillment_places - ## - # RPC-specific configuration for `remove_fulfillment_places` - # @return [::Gapic::Config::Method] - # - attr_reader :remove_fulfillment_places - ## - # RPC-specific configuration for `add_local_inventories` - # @return [::Gapic::Config::Method] - # - attr_reader :add_local_inventories - ## - # RPC-specific configuration for `remove_local_inventories` - # @return [::Gapic::Config::Method] - # - attr_reader :remove_local_inventories - - # @private - def initialize parent_rpcs = nil - create_product_config = parent_rpcs.create_product if parent_rpcs.respond_to? :create_product - @create_product = ::Gapic::Config::Method.new create_product_config - get_product_config = parent_rpcs.get_product if parent_rpcs.respond_to? :get_product - @get_product = ::Gapic::Config::Method.new get_product_config - list_products_config = parent_rpcs.list_products if parent_rpcs.respond_to? :list_products - @list_products = ::Gapic::Config::Method.new list_products_config - update_product_config = parent_rpcs.update_product if parent_rpcs.respond_to? :update_product - @update_product = ::Gapic::Config::Method.new update_product_config - delete_product_config = parent_rpcs.delete_product if parent_rpcs.respond_to? :delete_product - @delete_product = ::Gapic::Config::Method.new delete_product_config - purge_products_config = parent_rpcs.purge_products if parent_rpcs.respond_to? :purge_products - @purge_products = ::Gapic::Config::Method.new purge_products_config - import_products_config = parent_rpcs.import_products if parent_rpcs.respond_to? :import_products - @import_products = ::Gapic::Config::Method.new import_products_config - set_inventory_config = parent_rpcs.set_inventory if parent_rpcs.respond_to? :set_inventory - @set_inventory = ::Gapic::Config::Method.new set_inventory_config - add_fulfillment_places_config = parent_rpcs.add_fulfillment_places if parent_rpcs.respond_to? :add_fulfillment_places - @add_fulfillment_places = ::Gapic::Config::Method.new add_fulfillment_places_config - remove_fulfillment_places_config = parent_rpcs.remove_fulfillment_places if parent_rpcs.respond_to? :remove_fulfillment_places - @remove_fulfillment_places = ::Gapic::Config::Method.new remove_fulfillment_places_config - add_local_inventories_config = parent_rpcs.add_local_inventories if parent_rpcs.respond_to? :add_local_inventories - @add_local_inventories = ::Gapic::Config::Method.new add_local_inventories_config - remove_local_inventories_config = parent_rpcs.remove_local_inventories if parent_rpcs.respond_to? :remove_local_inventories - @remove_local_inventories = ::Gapic::Config::Method.new remove_local_inventories_config - - yield self if block_given? - end - end - end - end - end - end - end - end -end diff --git a/owl-bot-staging/google-cloud-retail-v2/lib/google/cloud/retail/v2/product_service/credentials.rb b/owl-bot-staging/google-cloud-retail-v2/lib/google/cloud/retail/v2/product_service/credentials.rb deleted file mode 100644 index 1a4d7700391f..000000000000 --- a/owl-bot-staging/google-cloud-retail-v2/lib/google/cloud/retail/v2/product_service/credentials.rb +++ /dev/null @@ -1,51 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -require "googleauth" - -module Google - module Cloud - module Retail - module V2 - module ProductService - # Credentials for the ProductService API. - class Credentials < ::Google::Auth::Credentials - self.scope = [ - "https://www.googleapis.com/auth/cloud-platform" - ] - self.env_vars = [ - "RETAIL_CREDENTIALS", - "RETAIL_KEYFILE", - "GOOGLE_CLOUD_CREDENTIALS", - "GOOGLE_CLOUD_KEYFILE", - "GCLOUD_KEYFILE", - "RETAIL_CREDENTIALS_JSON", - "RETAIL_KEYFILE_JSON", - "GOOGLE_CLOUD_CREDENTIALS_JSON", - "GOOGLE_CLOUD_KEYFILE_JSON", - "GCLOUD_KEYFILE_JSON" - ] - self.paths = [ - "~/.config/google_cloud/application_default_credentials.json" - ] - end - end - end - end - end -end diff --git a/owl-bot-staging/google-cloud-retail-v2/lib/google/cloud/retail/v2/product_service/operations.rb b/owl-bot-staging/google-cloud-retail-v2/lib/google/cloud/retail/v2/product_service/operations.rb deleted file mode 100644 index b091c3939452..000000000000 --- a/owl-bot-staging/google-cloud-retail-v2/lib/google/cloud/retail/v2/product_service/operations.rb +++ /dev/null @@ -1,841 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -require "gapic/operation" -require "google/longrunning/operations_pb" - -module Google - module Cloud - module Retail - module V2 - module ProductService - # Service that implements Longrunning Operations API. - class Operations - # @private - API_VERSION = "" - - # @private - DEFAULT_ENDPOINT_TEMPLATE = "retail.$UNIVERSE_DOMAIN$" - - # @private - attr_reader :operations_stub - - ## - # Configuration for the ProductService 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 ProductService 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::Retail::V2::VERSION - metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - header_params = {} - if request.name - header_params["name"] = request.name - end - - request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") - metadata[:"x-goog-request-params"] ||= request_params_header - - options.apply_defaults timeout: @config.rpcs.list_operations.timeout, - metadata: metadata, - retry_policy: @config.rpcs.list_operations.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @operations_stub.call_rpc :list_operations, request, options: options do |response, operation| - wrap_lro_operation = ->(op_response) { ::Gapic::Operation.new op_response, @operations_client } - response = ::Gapic::PagedEnumerable.new @operations_stub, :list_operations, request, response, operation, options, format_resource: wrap_lro_operation - yield response, operation if block_given? - throw :response, response - end - rescue ::GRPC::BadStatus => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Gets the latest state of a long-running operation. Clients can use this - # method to poll the operation result at intervals as recommended by the API - # service. - # - # @overload get_operation(request, options = nil) - # Pass arguments to `get_operation` via a request object, either of type - # {::Google::Longrunning::GetOperationRequest} or an equivalent Hash. - # - # @param request [::Google::Longrunning::GetOperationRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. - # - # @overload get_operation(name: nil) - # Pass arguments to `get_operation` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param name [::String] - # The name of the operation resource. - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Gapic::Operation] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Gapic::Operation] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/longrunning" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Longrunning::Operations::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Longrunning::GetOperationRequest.new - # - # # Call the get_operation method. - # result = client.get_operation request - # - # # The returned object is of type Gapic::Operation. You can use it to - # # check the status of an operation, cancel it, or wait for results. - # # Here is how to wait for a response. - # result.wait_until_done! timeout: 60 - # if result.response? - # p result.response - # else - # puts "No response received." - # end - # - def get_operation request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Longrunning::GetOperationRequest - - # Converts hash and nil to an options object - options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h - - # Customize the options with defaults - metadata = @config.rpcs.get_operation.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::Retail::V2::VERSION - metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - header_params = {} - if request.name - header_params["name"] = request.name - end - - request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") - metadata[:"x-goog-request-params"] ||= request_params_header - - options.apply_defaults timeout: @config.rpcs.get_operation.timeout, - metadata: metadata, - retry_policy: @config.rpcs.get_operation.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @operations_stub.call_rpc :get_operation, request, options: options do |response, operation| - response = ::Gapic::Operation.new response, @operations_client, options: options - yield response, operation if block_given? - throw :response, response - end - rescue ::GRPC::BadStatus => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Deletes a long-running operation. This method indicates that the client is - # no longer interested in the operation result. It does not cancel the - # operation. If the server doesn't support this method, it returns - # `google.rpc.Code.UNIMPLEMENTED`. - # - # @overload delete_operation(request, options = nil) - # Pass arguments to `delete_operation` via a request object, either of type - # {::Google::Longrunning::DeleteOperationRequest} or an equivalent Hash. - # - # @param request [::Google::Longrunning::DeleteOperationRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. - # - # @overload delete_operation(name: nil) - # Pass arguments to `delete_operation` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param name [::String] - # The name of the operation resource to be deleted. - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Google::Protobuf::Empty] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Google::Protobuf::Empty] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/longrunning" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Longrunning::Operations::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Longrunning::DeleteOperationRequest.new - # - # # Call the delete_operation method. - # result = client.delete_operation request - # - # # The returned object is of type Google::Protobuf::Empty. - # p result - # - def delete_operation request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Longrunning::DeleteOperationRequest - - # Converts hash and nil to an options object - options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h - - # Customize the options with defaults - metadata = @config.rpcs.delete_operation.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::Retail::V2::VERSION - metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - header_params = {} - if request.name - header_params["name"] = request.name - end - - request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") - metadata[:"x-goog-request-params"] ||= request_params_header - - options.apply_defaults timeout: @config.rpcs.delete_operation.timeout, - metadata: metadata, - retry_policy: @config.rpcs.delete_operation.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @operations_stub.call_rpc :delete_operation, request, options: options do |response, operation| - yield response, operation if block_given? - end - rescue ::GRPC::BadStatus => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Starts asynchronous cancellation on a long-running operation. The server - # makes a best effort to cancel the operation, but success is not - # guaranteed. If the server doesn't support this method, it returns - # `google.rpc.Code.UNIMPLEMENTED`. Clients can use - # Operations.GetOperation or - # other methods to check whether the cancellation succeeded or whether the - # operation completed despite cancellation. On successful cancellation, - # the operation is not deleted; instead, it becomes an operation with - # an {::Google::Longrunning::Operation#error Operation.error} value with a - # {::Google::Rpc::Status#code google.rpc.Status.code} of `1`, corresponding to - # `Code.CANCELLED`. - # - # @overload cancel_operation(request, options = nil) - # Pass arguments to `cancel_operation` via a request object, either of type - # {::Google::Longrunning::CancelOperationRequest} or an equivalent Hash. - # - # @param request [::Google::Longrunning::CancelOperationRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. - # - # @overload cancel_operation(name: nil) - # Pass arguments to `cancel_operation` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param name [::String] - # The name of the operation resource to be cancelled. - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Google::Protobuf::Empty] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Google::Protobuf::Empty] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/longrunning" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Longrunning::Operations::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Longrunning::CancelOperationRequest.new - # - # # Call the cancel_operation method. - # result = client.cancel_operation request - # - # # The returned object is of type Google::Protobuf::Empty. - # p result - # - def cancel_operation request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Longrunning::CancelOperationRequest - - # Converts hash and nil to an options object - options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h - - # Customize the options with defaults - metadata = @config.rpcs.cancel_operation.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::Retail::V2::VERSION - metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - header_params = {} - if request.name - header_params["name"] = request.name - end - - request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") - metadata[:"x-goog-request-params"] ||= request_params_header - - options.apply_defaults timeout: @config.rpcs.cancel_operation.timeout, - metadata: metadata, - retry_policy: @config.rpcs.cancel_operation.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @operations_stub.call_rpc :cancel_operation, request, options: options do |response, operation| - yield response, operation if block_given? - end - rescue ::GRPC::BadStatus => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Waits until the specified long-running operation is done or reaches at most - # a specified timeout, returning the latest state. If the operation is - # already done, the latest state is immediately returned. If the timeout - # specified is greater than the default HTTP/RPC timeout, the HTTP/RPC - # timeout is used. If the server does not support this method, it returns - # `google.rpc.Code.UNIMPLEMENTED`. - # Note that this method is on a best-effort basis. It may return the latest - # state before the specified timeout (including immediately), meaning even an - # immediate response is no guarantee that the operation is done. - # - # @overload wait_operation(request, options = nil) - # Pass arguments to `wait_operation` via a request object, either of type - # {::Google::Longrunning::WaitOperationRequest} or an equivalent Hash. - # - # @param request [::Google::Longrunning::WaitOperationRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. - # - # @overload wait_operation(name: nil, timeout: nil) - # Pass arguments to `wait_operation` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param name [::String] - # The name of the operation resource to wait on. - # @param timeout [::Google::Protobuf::Duration, ::Hash] - # The maximum duration to wait before timing out. If left blank, the wait - # will be at most the time permitted by the underlying HTTP/RPC protocol. - # If RPC context deadline is also specified, the shorter one will be used. - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Gapic::Operation] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Gapic::Operation] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/longrunning" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Longrunning::Operations::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Longrunning::WaitOperationRequest.new - # - # # Call the wait_operation method. - # result = client.wait_operation request - # - # # The returned object is of type Gapic::Operation. You can use it to - # # check the status of an operation, cancel it, or wait for results. - # # Here is how to wait for a response. - # result.wait_until_done! timeout: 60 - # if result.response? - # p result.response - # else - # puts "No response received." - # end - # - def wait_operation request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Longrunning::WaitOperationRequest - - # Converts hash and nil to an options object - options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h - - # Customize the options with defaults - metadata = @config.rpcs.wait_operation.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::Retail::V2::VERSION - metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - options.apply_defaults timeout: @config.rpcs.wait_operation.timeout, - metadata: metadata, - retry_policy: @config.rpcs.wait_operation.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @operations_stub.call_rpc :wait_operation, request, options: options do |response, operation| - response = ::Gapic::Operation.new response, @operations_client, options: options - yield response, operation if block_given? - throw :response, response - end - rescue ::GRPC::BadStatus => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Configuration class for the Operations API. - # - # This class represents the configuration for Operations, - # providing control over timeouts, retry behavior, logging, transport - # parameters, and other low-level controls. Certain parameters can also be - # applied individually to specific RPCs. See - # {::Google::Longrunning::Operations::Client::Configuration::Rpcs} - # for a list of RPCs that can be configured independently. - # - # Configuration can be applied globally to all clients, or to a single client - # on construction. - # - # @example - # - # # Modify the global config, setting the timeout for - # # list_operations to 20 seconds, - # # and all remaining timeouts to 10 seconds. - # ::Google::Longrunning::Operations::Client.configure do |config| - # config.timeout = 10.0 - # config.rpcs.list_operations.timeout = 20.0 - # end - # - # # Apply the above configuration only to a new client. - # client = ::Google::Longrunning::Operations::Client.new do |config| - # config.timeout = 10.0 - # config.rpcs.list_operations.timeout = 20.0 - # end - # - # @!attribute [rw] endpoint - # A custom service endpoint, as a hostname or hostname:port. The default is - # nil, indicating to use the default endpoint in the current universe domain. - # @return [::String,nil] - # @!attribute [rw] credentials - # Credentials to send with calls. You may provide any of the following types: - # * (`Google::Auth::Credentials`) A googleauth credentials object - # (see the [googleauth docs](https://rubydoc.info/gems/googleauth/Google/Auth/Credentials)) - # * (`Signet::OAuth2::Client`) A signet oauth2 client object - # (see the [signet docs](https://rubydoc.info/gems/signet/Signet/OAuth2/Client)) - # * (`GRPC::Core::Channel`) a gRPC channel with included credentials - # * (`GRPC::Core::ChannelCredentials`) a gRPC credentails object - # * (`nil`) indicating no credentials - # - # @note Warning: Passing a `String` to a keyfile path or a `Hash` of credentials - # is deprecated. Providing an unvalidated credential configuration to - # Google APIs can compromise the security of your systems and data. - # - # @example - # - # # The recommended way to provide credentials is to use the `make_creds` method - # # on the appropriate credentials class for your environment. - # - # require "googleauth" - # - # credentials = ::Google::Auth::ServiceAccountCredentials.make_creds( - # json_key_io: ::File.open("/path/to/keyfile.json") - # ) - # - # client = ::Google::Longrunning::Operations::Client.new do |config| - # config.credentials = credentials - # end - # - # @note Warning: If you accept a credential configuration (JSON file or Hash) from an - # external source for authentication to Google Cloud, you must validate it before - # providing it to a Google API client library. Providing an unvalidated credential - # configuration to Google APIs can compromise the security of your systems and data. - # For more information, refer to [Validate credential configurations from external - # sources](https://cloud.google.com/docs/authentication/external/externally-sourced-credentials). - # @return [::Object] - # @!attribute [rw] scope - # The OAuth scopes - # @return [::Array<::String>] - # @!attribute [rw] lib_name - # The library name as recorded in instrumentation and logging - # @return [::String] - # @!attribute [rw] lib_version - # The library version as recorded in instrumentation and logging - # @return [::String] - # @!attribute [rw] channel_args - # Extra parameters passed to the gRPC channel. Note: this is ignored if a - # `GRPC::Core::Channel` object is provided as the credential. - # @return [::Hash] - # @!attribute [rw] interceptors - # An array of interceptors that are run before calls are executed. - # @return [::Array<::GRPC::ClientInterceptor>] - # @!attribute [rw] timeout - # The call timeout in seconds. - # @return [::Numeric] - # @!attribute [rw] metadata - # Additional gRPC headers to be sent with the call. - # @return [::Hash{::Symbol=>::String}] - # @!attribute [rw] retry_policy - # The retry policy. The value is a hash with the following keys: - # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds. - # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds. - # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier. - # * `:retry_codes` (*type:* `Array`) - The error codes that should - # trigger a retry. - # @return [::Hash] - # @!attribute [rw] quota_project - # A separate project against which to charge quota. - # @return [::String] - # @!attribute [rw] universe_domain - # The universe domain within which to make requests. This determines the - # default endpoint URL. The default value of nil uses the environment - # universe (usually the default "googleapis.com" universe). - # @return [::String,nil] - # @!attribute [rw] logger - # A custom logger to use for request/response debug logging, or the value - # `:default` (the default) to construct a default logger, or `nil` to - # explicitly disable logging. - # @return [::Logger,:default,nil] - # - class Configuration - extend ::Gapic::Config - - # @private - # The endpoint specific to the default "googleapis.com" universe. Deprecated. - DEFAULT_ENDPOINT = "retail.googleapis.com" - - config_attr :endpoint, nil, ::String, nil - config_attr :credentials, nil do |value| - allowed = [::String, ::Hash, ::Proc, ::Symbol, ::Google::Auth::Credentials, ::Google::Auth::BaseClient, ::Signet::OAuth2::Client, nil] - allowed += [::GRPC::Core::Channel, ::GRPC::Core::ChannelCredentials] if defined? ::GRPC::Core::Channel - allowed.any? { |klass| klass === value } - end - config_attr :scope, nil, ::String, ::Array, nil - config_attr :lib_name, nil, ::String, nil - config_attr :lib_version, nil, ::String, nil - config_attr(:channel_args, { "grpc.service_config_disable_resolution" => 1 }, ::Hash, nil) - config_attr :interceptors, nil, ::Array, nil - config_attr :timeout, nil, ::Numeric, nil - config_attr :metadata, nil, ::Hash, nil - config_attr :retry_policy, nil, ::Hash, ::Proc, nil - config_attr :quota_project, nil, ::String, nil - config_attr :universe_domain, nil, ::String, nil - config_attr :logger, :default, ::Logger, nil, :default - - # @private - def initialize parent_config = nil - @parent_config = parent_config unless parent_config.nil? - - yield self if block_given? - end - - ## - # Configurations for individual RPCs - # @return [Rpcs] - # - def rpcs - @rpcs ||= begin - parent_rpcs = nil - parent_rpcs = @parent_config.rpcs if defined?(@parent_config) && @parent_config.respond_to?(:rpcs) - Rpcs.new parent_rpcs - end - end - - ## - # Configuration for the channel pool - # @return [::Gapic::ServiceStub::ChannelPool::Configuration] - # - def channel_pool - @channel_pool ||= ::Gapic::ServiceStub::ChannelPool::Configuration.new - end - - ## - # Configuration RPC class for the Operations API. - # - # Includes fields providing the configuration for each RPC in this service. - # Each configuration object is of type `Gapic::Config::Method` and includes - # the following configuration fields: - # - # * `timeout` (*type:* `Numeric`) - The call timeout in seconds - # * `metadata` (*type:* `Hash{Symbol=>String}`) - Additional gRPC headers - # * `retry_policy (*type:* `Hash`) - The retry policy. The policy fields - # include the following keys: - # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds. - # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds. - # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier. - # * `:retry_codes` (*type:* `Array`) - The error codes that should - # trigger a retry. - # - class Rpcs - ## - # RPC-specific configuration for `list_operations` - # @return [::Gapic::Config::Method] - # - attr_reader :list_operations - ## - # RPC-specific configuration for `get_operation` - # @return [::Gapic::Config::Method] - # - attr_reader :get_operation - ## - # RPC-specific configuration for `delete_operation` - # @return [::Gapic::Config::Method] - # - attr_reader :delete_operation - ## - # RPC-specific configuration for `cancel_operation` - # @return [::Gapic::Config::Method] - # - attr_reader :cancel_operation - ## - # RPC-specific configuration for `wait_operation` - # @return [::Gapic::Config::Method] - # - attr_reader :wait_operation - - # @private - def initialize parent_rpcs = nil - list_operations_config = parent_rpcs.list_operations if parent_rpcs.respond_to? :list_operations - @list_operations = ::Gapic::Config::Method.new list_operations_config - get_operation_config = parent_rpcs.get_operation if parent_rpcs.respond_to? :get_operation - @get_operation = ::Gapic::Config::Method.new get_operation_config - delete_operation_config = parent_rpcs.delete_operation if parent_rpcs.respond_to? :delete_operation - @delete_operation = ::Gapic::Config::Method.new delete_operation_config - cancel_operation_config = parent_rpcs.cancel_operation if parent_rpcs.respond_to? :cancel_operation - @cancel_operation = ::Gapic::Config::Method.new cancel_operation_config - wait_operation_config = parent_rpcs.wait_operation if parent_rpcs.respond_to? :wait_operation - @wait_operation = ::Gapic::Config::Method.new wait_operation_config - - yield self if block_given? - end - end - end - end - end - end - end - end -end diff --git a/owl-bot-staging/google-cloud-retail-v2/lib/google/cloud/retail/v2/product_service/paths.rb b/owl-bot-staging/google-cloud-retail-v2/lib/google/cloud/retail/v2/product_service/paths.rb deleted file mode 100644 index c0f4efbe2230..000000000000 --- a/owl-bot-staging/google-cloud-retail-v2/lib/google/cloud/retail/v2/product_service/paths.rb +++ /dev/null @@ -1,77 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - - -module Google - module Cloud - module Retail - module V2 - module ProductService - # Path helper methods for the ProductService API. - module Paths - ## - # Create a fully-qualified Branch resource string. - # - # The resource will be in the following format: - # - # `projects/{project}/locations/{location}/catalogs/{catalog}/branches/{branch}` - # - # @param project [String] - # @param location [String] - # @param catalog [String] - # @param branch [String] - # - # @return [::String] - def branch_path project:, location:, catalog:, branch: - raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" - raise ::ArgumentError, "location cannot contain /" if location.to_s.include? "/" - raise ::ArgumentError, "catalog cannot contain /" if catalog.to_s.include? "/" - - "projects/#{project}/locations/#{location}/catalogs/#{catalog}/branches/#{branch}" - end - - ## - # Create a fully-qualified Product resource string. - # - # The resource will be in the following format: - # - # `projects/{project}/locations/{location}/catalogs/{catalog}/branches/{branch}/products/{product}` - # - # @param project [String] - # @param location [String] - # @param catalog [String] - # @param branch [String] - # @param product [String] - # - # @return [::String] - def product_path project:, location:, catalog:, branch:, product: - raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" - raise ::ArgumentError, "location cannot contain /" if location.to_s.include? "/" - raise ::ArgumentError, "catalog cannot contain /" if catalog.to_s.include? "/" - raise ::ArgumentError, "branch cannot contain /" if branch.to_s.include? "/" - - "projects/#{project}/locations/#{location}/catalogs/#{catalog}/branches/#{branch}/products/#{product}" - end - - extend self - end - end - end - end - end -end diff --git a/owl-bot-staging/google-cloud-retail-v2/lib/google/cloud/retail/v2/product_service/rest.rb b/owl-bot-staging/google-cloud-retail-v2/lib/google/cloud/retail/v2/product_service/rest.rb deleted file mode 100644 index 1a50a1c1e9fd..000000000000 --- a/owl-bot-staging/google-cloud-retail-v2/lib/google/cloud/retail/v2/product_service/rest.rb +++ /dev/null @@ -1,54 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -require "gapic/rest" -require "gapic/config" -require "gapic/config/method" - -require "google/cloud/retail/v2/version" - -require "google/cloud/retail/v2/product_service/credentials" -require "google/cloud/retail/v2/product_service/paths" -require "google/cloud/retail/v2/product_service/rest/operations" -require "google/cloud/retail/v2/product_service/rest/client" - -module Google - module Cloud - module Retail - module V2 - ## - # Service for ingesting {::Google::Cloud::Retail::V2::Product Product} information - # of the customer's website. - # - # To load this service and instantiate a REST client: - # - # require "google/cloud/retail/v2/product_service/rest" - # client = ::Google::Cloud::Retail::V2::ProductService::Rest::Client.new - # - module ProductService - # Client for the REST transport - module Rest - end - end - end - end - end -end - -helper_path = ::File.join __dir__, "rest", "helpers.rb" -require "google/cloud/retail/v2/product_service/rest/helpers" if ::File.file? helper_path diff --git a/owl-bot-staging/google-cloud-retail-v2/lib/google/cloud/retail/v2/product_service/rest/client.rb b/owl-bot-staging/google-cloud-retail-v2/lib/google/cloud/retail/v2/product_service/rest/client.rb deleted file mode 100644 index 78f4b04b610d..000000000000 --- a/owl-bot-staging/google-cloud-retail-v2/lib/google/cloud/retail/v2/product_service/rest/client.rb +++ /dev/null @@ -1,2110 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -require "google/cloud/errors" -require "google/cloud/retail/v2/product_service_pb" -require "google/cloud/retail/v2/product_service/rest/service_stub" -require "google/cloud/location/rest" - -module Google - module Cloud - module Retail - module V2 - module ProductService - module Rest - ## - # REST client for the ProductService service. - # - # Service for ingesting {::Google::Cloud::Retail::V2::Product Product} information - # of the customer's website. - # - class Client - # @private - API_VERSION = "" - - # @private - DEFAULT_ENDPOINT_TEMPLATE = "retail.$UNIVERSE_DOMAIN$" - - include Paths - - # @private - attr_reader :product_service_stub - - ## - # Configure the ProductService Client class. - # - # See {::Google::Cloud::Retail::V2::ProductService::Rest::Client::Configuration} - # for a description of the configuration fields. - # - # @example - # - # # Modify the configuration for all ProductService clients - # ::Google::Cloud::Retail::V2::ProductService::Rest::Client.configure do |config| - # config.timeout = 10.0 - # end - # - # @yield [config] Configure the Client client. - # @yieldparam config [Client::Configuration] - # - # @return [Client::Configuration] - # - def self.configure - @configure ||= begin - namespace = ["Google", "Cloud", "Retail", "V2"] - parent_config = while namespace.any? - parent_name = namespace.join "::" - parent_const = const_get parent_name - break parent_const.configure if parent_const.respond_to? :configure - namespace.pop - end - default_config = Client::Configuration.new parent_config - - default_config.timeout = 30.0 - default_config.retry_policy = { - initial_delay: 0.1, max_delay: 30.0, multiplier: 1.3, retry_codes: [14, 4] - } - - default_config.rpcs.import_products.timeout = 300.0 - default_config.rpcs.import_products.retry_policy = { - initial_delay: 0.1, max_delay: 300.0, multiplier: 1.3, retry_codes: [14, 4] - } - - default_config - end - yield @configure if block_given? - @configure - end - - ## - # Configure the ProductService Client instance. - # - # The configuration is set to the derived mode, meaning that values can be changed, - # but structural changes (adding new fields, etc.) are not allowed. Structural changes - # should be made on {Client.configure}. - # - # See {::Google::Cloud::Retail::V2::ProductService::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 - @product_service_stub.universe_domain - end - - ## - # Create a new ProductService REST client object. - # - # @example - # - # # Create a client using the default configuration - # client = ::Google::Cloud::Retail::V2::ProductService::Rest::Client.new - # - # # Create a client using a custom configuration - # client = ::Google::Cloud::Retail::V2::ProductService::Rest::Client.new do |config| - # config.timeout = 10.0 - # end - # - # @yield [config] Configure the ProductService client. - # @yieldparam config [Client::Configuration] - # - def initialize - # Create the configuration object - @config = Configuration.new Client.configure - - # Yield the configuration if needed - yield @config if block_given? - - # Create credentials - credentials = @config.credentials - # Use self-signed JWT if the endpoint is unchanged from default, - # but only if the default endpoint does not have a region prefix. - enable_self_signed_jwt = @config.endpoint.nil? || - (@config.endpoint == Configuration::DEFAULT_ENDPOINT && - !@config.endpoint.split(".").first.include?("-")) - credentials ||= Credentials.default scope: @config.scope, - enable_self_signed_jwt: enable_self_signed_jwt - if credentials.is_a?(::String) || credentials.is_a?(::Hash) - credentials = Credentials.new credentials, scope: @config.scope - end - - @quota_project_id = @config.quota_project - @quota_project_id ||= credentials.quota_project_id if credentials.respond_to? :quota_project_id - - @operations_client = ::Google::Cloud::Retail::V2::ProductService::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 - - @product_service_stub = ::Google::Cloud::Retail::V2::ProductService::Rest::ServiceStub.new( - endpoint: @config.endpoint, - endpoint_template: DEFAULT_ENDPOINT_TEMPLATE, - universe_domain: @config.universe_domain, - credentials: credentials, - logger: @config.logger - ) - - @product_service_stub.logger(stub: true)&.info do |entry| - entry.set_system_name - entry.set_service - entry.message = "Created client for #{entry.service}" - entry.set_credentials_fields credentials - entry.set "customEndpoint", @config.endpoint if @config.endpoint - entry.set "defaultTimeout", @config.timeout if @config.timeout - entry.set "quotaProject", @quota_project_id if @quota_project_id - end - - @location_client = Google::Cloud::Location::Locations::Rest::Client.new do |config| - config.credentials = credentials - config.quota_project = @quota_project_id - config.endpoint = @product_service_stub.endpoint - config.universe_domain = @product_service_stub.universe_domain - config.logger = @product_service_stub.logger if config.respond_to? :logger= - end - end - - ## - # Get the associated client for long-running operations. - # - # @return [::Google::Cloud::Retail::V2::ProductService::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 - @product_service_stub.logger - end - - # Service calls - - ## - # Creates a {::Google::Cloud::Retail::V2::Product Product}. - # - # @overload create_product(request, options = nil) - # Pass arguments to `create_product` via a request object, either of type - # {::Google::Cloud::Retail::V2::CreateProductRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Retail::V2::CreateProductRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_product(parent: nil, product: nil, product_id: nil) - # Pass arguments to `create_product` via keyword arguments. Note that at - # least one keyword argument is 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 catalog resource name, such as - # `projects/*/locations/global/catalogs/default_catalog/branches/default_branch`. - # @param product [::Google::Cloud::Retail::V2::Product, ::Hash] - # Required. The {::Google::Cloud::Retail::V2::Product Product} to create. - # @param product_id [::String] - # Required. The ID to use for the {::Google::Cloud::Retail::V2::Product Product}, - # which will become the final component of the - # {::Google::Cloud::Retail::V2::Product#name Product.name}. - # - # If the caller does not have permission to create the - # {::Google::Cloud::Retail::V2::Product Product}, regardless of whether or not it - # exists, a PERMISSION_DENIED error is returned. - # - # This field must be unique among all - # {::Google::Cloud::Retail::V2::Product Product}s with the same - # {::Google::Cloud::Retail::V2::CreateProductRequest#parent parent}. Otherwise, an - # ALREADY_EXISTS error is returned. - # - # This field must be a UTF-8 encoded string with a length limit of 128 - # characters. Otherwise, an INVALID_ARGUMENT error is returned. - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Cloud::Retail::V2::Product] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::Retail::V2::Product] - # - # @raise [::Google::Cloud::Error] if the REST call is aborted. - # - # @example Basic example - # require "google/cloud/retail/v2" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Retail::V2::ProductService::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Retail::V2::CreateProductRequest.new - # - # # Call the create_product method. - # result = client.create_product request - # - # # The returned object is of type Google::Cloud::Retail::V2::Product. - # p result - # - def create_product request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Retail::V2::CreateProductRequest - - # Converts hash 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_product.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::Retail::V2::VERSION, - transports_version_send: [:rest] - - call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - options.apply_defaults timeout: @config.rpcs.create_product.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.create_product.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @product_service_stub.create_product request, options do |result, operation| - yield result, operation if block_given? - end - rescue ::Gapic::Rest::Error => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Gets a {::Google::Cloud::Retail::V2::Product Product}. - # - # @overload get_product(request, options = nil) - # Pass arguments to `get_product` via a request object, either of type - # {::Google::Cloud::Retail::V2::GetProductRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Retail::V2::GetProductRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_product(name: nil) - # Pass arguments to `get_product` via keyword arguments. Note that at - # least one keyword argument is 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. Full resource name of {::Google::Cloud::Retail::V2::Product Product}, - # such as - # `projects/*/locations/global/catalogs/default_catalog/branches/default_branch/products/some_product_id`. - # - # If the caller does not have permission to access the - # {::Google::Cloud::Retail::V2::Product Product}, regardless of whether or not it - # exists, a PERMISSION_DENIED error is returned. - # - # If the requested {::Google::Cloud::Retail::V2::Product Product} does not exist, - # a NOT_FOUND error is returned. - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Cloud::Retail::V2::Product] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::Retail::V2::Product] - # - # @raise [::Google::Cloud::Error] if the REST call is aborted. - # - # @example Basic example - # require "google/cloud/retail/v2" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Retail::V2::ProductService::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Retail::V2::GetProductRequest.new - # - # # Call the get_product method. - # result = client.get_product request - # - # # The returned object is of type Google::Cloud::Retail::V2::Product. - # p result - # - def get_product request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Retail::V2::GetProductRequest - - # Converts hash 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_product.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::Retail::V2::VERSION, - transports_version_send: [:rest] - - call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - options.apply_defaults timeout: @config.rpcs.get_product.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.get_product.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @product_service_stub.get_product request, options do |result, operation| - yield result, operation if block_given? - end - rescue ::Gapic::Rest::Error => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Gets a list of {::Google::Cloud::Retail::V2::Product Product}s. - # - # @overload list_products(request, options = nil) - # Pass arguments to `list_products` via a request object, either of type - # {::Google::Cloud::Retail::V2::ListProductsRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Retail::V2::ListProductsRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_products(parent: nil, page_size: nil, page_token: nil, filter: nil, read_mask: nil) - # Pass arguments to `list_products` via keyword arguments. Note that at - # least one keyword argument is 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 branch resource name, such as - # `projects/*/locations/global/catalogs/default_catalog/branches/0`. Use - # `default_branch` as the branch ID, to list products under the default - # branch. - # - # If the caller does not have permission to list - # {::Google::Cloud::Retail::V2::Product Product}s under this branch, regardless of - # whether or not this branch exists, a PERMISSION_DENIED error is returned. - # @param page_size [::Integer] - # Maximum number of {::Google::Cloud::Retail::V2::Product Product}s to return. If - # unspecified, defaults to 100. The maximum allowed value is 1000. Values - # above 1000 will be coerced to 1000. - # - # If this field is negative, an INVALID_ARGUMENT error is returned. - # @param page_token [::String] - # A page token - # {::Google::Cloud::Retail::V2::ListProductsResponse#next_page_token ListProductsResponse.next_page_token}, - # received from a previous - # {::Google::Cloud::Retail::V2::ProductService::Rest::Client#list_products ProductService.ListProducts} - # call. Provide this to retrieve the subsequent page. - # - # When paginating, all other parameters provided to - # {::Google::Cloud::Retail::V2::ProductService::Rest::Client#list_products ProductService.ListProducts} - # must match the call that provided the page token. Otherwise, an - # INVALID_ARGUMENT error is returned. - # @param filter [::String] - # A filter to apply on the list results. Supported features: - # - # * List all the products under the parent branch if - # {::Google::Cloud::Retail::V2::ListProductsRequest#filter filter} is unset. - # * List {::Google::Cloud::Retail::V2::Product::Type::VARIANT Product.Type.VARIANT} - # {::Google::Cloud::Retail::V2::Product Product}s sharing the same - # {::Google::Cloud::Retail::V2::Product::Type::PRIMARY Product.Type.PRIMARY} - # {::Google::Cloud::Retail::V2::Product Product}. For example: - # `primary_product_id = "some_product_id"` - # * List {::Google::Cloud::Retail::V2::Product Product}s bundled in a - # {::Google::Cloud::Retail::V2::Product::Type::COLLECTION Product.Type.COLLECTION} - # {::Google::Cloud::Retail::V2::Product Product}. - # For example: - # `collection_product_id = "some_product_id"` - # * List {::Google::Cloud::Retail::V2::Product Product}s with a partibular type. - # For example: - # `type = "PRIMARY"` - # `type = "VARIANT"` - # `type = "COLLECTION"` - # - # If the field is unrecognizable, an INVALID_ARGUMENT error is returned. - # - # If the specified - # {::Google::Cloud::Retail::V2::Product::Type::PRIMARY Product.Type.PRIMARY} - # {::Google::Cloud::Retail::V2::Product Product} or - # {::Google::Cloud::Retail::V2::Product::Type::COLLECTION Product.Type.COLLECTION} - # {::Google::Cloud::Retail::V2::Product Product} does not exist, a NOT_FOUND error - # is returned. - # @param read_mask [::Google::Protobuf::FieldMask, ::Hash] - # The fields of {::Google::Cloud::Retail::V2::Product Product} to return in the - # responses. If not set or empty, the following fields are returned: - # - # * {::Google::Cloud::Retail::V2::Product#name Product.name} - # * {::Google::Cloud::Retail::V2::Product#id Product.id} - # * {::Google::Cloud::Retail::V2::Product#title Product.title} - # * {::Google::Cloud::Retail::V2::Product#uri Product.uri} - # * {::Google::Cloud::Retail::V2::Product#images Product.images} - # * {::Google::Cloud::Retail::V2::Product#price_info Product.price_info} - # * {::Google::Cloud::Retail::V2::Product#brands Product.brands} - # - # If "*" is provided, all fields are returned. - # {::Google::Cloud::Retail::V2::Product#name Product.name} is always returned no - # matter what mask is set. - # - # If an unsupported or unknown field is provided, an INVALID_ARGUMENT error - # is returned. - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Gapic::Rest::PagedEnumerable<::Google::Cloud::Retail::V2::Product>] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Gapic::Rest::PagedEnumerable<::Google::Cloud::Retail::V2::Product>] - # - # @raise [::Google::Cloud::Error] if the REST call is aborted. - # - # @example Basic example - # require "google/cloud/retail/v2" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Retail::V2::ProductService::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Retail::V2::ListProductsRequest.new - # - # # Call the list_products method. - # result = client.list_products request - # - # # The returned object is of type Gapic::PagedEnumerable. You can iterate - # # over elements, and API calls will be issued to fetch pages as needed. - # result.each do |item| - # # Each element is of type ::Google::Cloud::Retail::V2::Product. - # p item - # end - # - def list_products request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Retail::V2::ListProductsRequest - - # Converts hash 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_products.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::Retail::V2::VERSION, - transports_version_send: [:rest] - - call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - options.apply_defaults timeout: @config.rpcs.list_products.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.list_products.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @product_service_stub.list_products request, options do |result, operation| - result = ::Gapic::Rest::PagedEnumerable.new @product_service_stub, :list_products, "products", 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 - - ## - # Updates a {::Google::Cloud::Retail::V2::Product Product}. - # - # @overload update_product(request, options = nil) - # Pass arguments to `update_product` via a request object, either of type - # {::Google::Cloud::Retail::V2::UpdateProductRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Retail::V2::UpdateProductRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_product(product: nil, update_mask: nil, allow_missing: nil) - # Pass arguments to `update_product` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param product [::Google::Cloud::Retail::V2::Product, ::Hash] - # Required. The product to update/create. - # - # If the caller does not have permission to update the - # {::Google::Cloud::Retail::V2::Product Product}, regardless of whether or not it - # exists, a PERMISSION_DENIED error is returned. - # - # If the {::Google::Cloud::Retail::V2::Product Product} to update does not exist - # and - # {::Google::Cloud::Retail::V2::UpdateProductRequest#allow_missing allow_missing} - # is not set, a NOT_FOUND error is returned. - # @param update_mask [::Google::Protobuf::FieldMask, ::Hash] - # Indicates which fields in the provided - # {::Google::Cloud::Retail::V2::Product Product} to update. The immutable and - # output only fields are NOT supported. If not set, all supported fields (the - # fields that are neither immutable nor output only) are updated. - # - # If an unsupported or unknown field is provided, an INVALID_ARGUMENT error - # is returned. - # - # The attribute key can be updated by setting the mask path as - # "attributes.$\\{key_name}". If a key name is present in the mask but not in - # the patching product from the request, this key will be deleted after the - # update. - # @param allow_missing [::Boolean] - # If set to true, and the {::Google::Cloud::Retail::V2::Product Product} is not - # found, a new {::Google::Cloud::Retail::V2::Product Product} will be created. In - # this situation, `update_mask` is ignored. - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Cloud::Retail::V2::Product] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::Retail::V2::Product] - # - # @raise [::Google::Cloud::Error] if the REST call is aborted. - # - # @example Basic example - # require "google/cloud/retail/v2" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Retail::V2::ProductService::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Retail::V2::UpdateProductRequest.new - # - # # Call the update_product method. - # result = client.update_product request - # - # # The returned object is of type Google::Cloud::Retail::V2::Product. - # p result - # - def update_product request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Retail::V2::UpdateProductRequest - - # Converts hash 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_product.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::Retail::V2::VERSION, - transports_version_send: [:rest] - - call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - options.apply_defaults timeout: @config.rpcs.update_product.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.update_product.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @product_service_stub.update_product request, options do |result, operation| - yield result, operation if block_given? - end - rescue ::Gapic::Rest::Error => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Deletes a {::Google::Cloud::Retail::V2::Product Product}. - # - # @overload delete_product(request, options = nil) - # Pass arguments to `delete_product` via a request object, either of type - # {::Google::Cloud::Retail::V2::DeleteProductRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Retail::V2::DeleteProductRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_product(name: nil) - # Pass arguments to `delete_product` via keyword arguments. Note that at - # least one keyword argument is 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. Full resource name of {::Google::Cloud::Retail::V2::Product Product}, - # such as - # `projects/*/locations/global/catalogs/default_catalog/branches/default_branch/products/some_product_id`. - # - # If the caller does not have permission to delete the - # {::Google::Cloud::Retail::V2::Product Product}, regardless of whether or not it - # exists, a PERMISSION_DENIED error is returned. - # - # If the {::Google::Cloud::Retail::V2::Product Product} to delete does not exist, - # a NOT_FOUND error is returned. - # - # The {::Google::Cloud::Retail::V2::Product Product} to delete can neither be a - # {::Google::Cloud::Retail::V2::Product::Type::COLLECTION Product.Type.COLLECTION} - # {::Google::Cloud::Retail::V2::Product Product} member nor a - # {::Google::Cloud::Retail::V2::Product::Type::PRIMARY Product.Type.PRIMARY} - # {::Google::Cloud::Retail::V2::Product Product} with more than one - # {::Google::Cloud::Retail::V2::Product::Type::VARIANT variants}. Otherwise, an - # INVALID_ARGUMENT error is returned. - # - # All inventory information for the named - # {::Google::Cloud::Retail::V2::Product Product} will 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/cloud/retail/v2" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Retail::V2::ProductService::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Retail::V2::DeleteProductRequest.new - # - # # Call the delete_product method. - # result = client.delete_product request - # - # # The returned object is of type Google::Protobuf::Empty. - # p result - # - def delete_product request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Retail::V2::DeleteProductRequest - - # Converts hash 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_product.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::Retail::V2::VERSION, - transports_version_send: [:rest] - - call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - options.apply_defaults timeout: @config.rpcs.delete_product.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.delete_product.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @product_service_stub.delete_product 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 - - ## - # Permanently deletes all selected {::Google::Cloud::Retail::V2::Product Product}s - # under a branch. - # - # This process is asynchronous. If the request is valid, the removal will be - # enqueued and processed offline. Depending on the number of - # {::Google::Cloud::Retail::V2::Product Product}s, this operation could take hours - # to complete. Before the operation completes, some - # {::Google::Cloud::Retail::V2::Product Product}s may still be returned by - # {::Google::Cloud::Retail::V2::ProductService::Rest::Client#get_product ProductService.GetProduct} - # or - # {::Google::Cloud::Retail::V2::ProductService::Rest::Client#list_products ProductService.ListProducts}. - # - # Depending on the number of {::Google::Cloud::Retail::V2::Product Product}s, this - # operation could take hours to complete. To get a sample of - # {::Google::Cloud::Retail::V2::Product Product}s that would be deleted, set - # {::Google::Cloud::Retail::V2::PurgeProductsRequest#force PurgeProductsRequest.force} - # to false. - # - # @overload purge_products(request, options = nil) - # Pass arguments to `purge_products` via a request object, either of type - # {::Google::Cloud::Retail::V2::PurgeProductsRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Retail::V2::PurgeProductsRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @overload purge_products(parent: nil, filter: nil, force: nil) - # Pass arguments to `purge_products` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param parent [::String] - # Required. The resource name of the branch under which the products are - # created. The format is - # `projects/${projectId}/locations/global/catalogs/${catalogId}/branches/${branchId}` - # @param filter [::String] - # Required. The filter string to specify the products to be deleted with a - # length limit of 5,000 characters. - # - # Empty string filter is not allowed. "*" implies delete all items in a - # branch. - # - # The eligible fields for filtering are: - # - # * `availability`: Double quoted - # {::Google::Cloud::Retail::V2::Product#availability Product.availability} string. - # * `create_time` : in ISO 8601 "zulu" format. - # - # Supported syntax: - # - # * Comparators (">", "<", ">=", "<=", "="). - # Examples: - # * create_time <= "2015-02-13T17:05:46Z" - # * availability = "IN_STOCK" - # - # * Conjunctions ("AND") - # Examples: - # * create_time <= "2015-02-13T17:05:46Z" AND availability = "PREORDER" - # - # * Disjunctions ("OR") - # Examples: - # * create_time <= "2015-02-13T17:05:46Z" OR availability = "IN_STOCK" - # - # * Can support nested queries. - # Examples: - # * (create_time <= "2015-02-13T17:05:46Z" AND availability = "PREORDER") - # OR (create_time >= "2015-02-14T13:03:32Z" AND availability = "IN_STOCK") - # - # * Filter Limits: - # * Filter should not contain more than 6 conditions. - # * Max nesting depth should not exceed 2 levels. - # - # Examples queries: - # * Delete back order products created before a timestamp. - # create_time <= "2015-02-13T17:05:46Z" OR availability = "BACKORDER" - # @param force [::Boolean] - # Actually perform the purge. - # If `force` is set to false, the method will return the expected purge count - # without deleting any products. - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Gapic::Operation] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Gapic::Operation] - # - # @raise [::Google::Cloud::Error] if the REST call is aborted. - # - # @example Basic example - # require "google/cloud/retail/v2" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Retail::V2::ProductService::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Retail::V2::PurgeProductsRequest.new - # - # # Call the purge_products method. - # result = client.purge_products 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 purge_products request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Retail::V2::PurgeProductsRequest - - # Converts hash 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.purge_products.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::Retail::V2::VERSION, - transports_version_send: [:rest] - - call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - options.apply_defaults timeout: @config.rpcs.purge_products.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.purge_products.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @product_service_stub.purge_products 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 - - ## - # Bulk import of multiple {::Google::Cloud::Retail::V2::Product Product}s. - # - # Request processing may be synchronous. - # Non-existing items are created. - # - # Note that it is possible for a subset of the - # {::Google::Cloud::Retail::V2::Product Product}s to be successfully updated. - # - # @overload import_products(request, options = nil) - # Pass arguments to `import_products` via a request object, either of type - # {::Google::Cloud::Retail::V2::ImportProductsRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Retail::V2::ImportProductsRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @overload import_products(parent: nil, request_id: nil, input_config: nil, errors_config: nil, update_mask: nil, reconciliation_mode: nil, notification_pubsub_topic: nil) - # Pass arguments to `import_products` via keyword arguments. Note that at - # least one keyword argument is 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. - # `projects/1234/locations/global/catalogs/default_catalog/branches/default_branch` - # - # If no updateMask is specified, requires products.create permission. - # If updateMask is specified, requires products.update permission. - # @param request_id [::String] - # Deprecated. This field has no effect. - # @param input_config [::Google::Cloud::Retail::V2::ProductInputConfig, ::Hash] - # Required. The desired input location of the data. - # @param errors_config [::Google::Cloud::Retail::V2::ImportErrorsConfig, ::Hash] - # The desired location of errors incurred during the Import. - # @param update_mask [::Google::Protobuf::FieldMask, ::Hash] - # Indicates which fields in the provided imported `products` to update. If - # not set, all fields are updated. If provided, only the existing product - # fields are updated. Missing products will not be created. - # @param reconciliation_mode [::Google::Cloud::Retail::V2::ImportProductsRequest::ReconciliationMode] - # The mode of reconciliation between existing products and the products to be - # imported. Defaults to - # {::Google::Cloud::Retail::V2::ImportProductsRequest::ReconciliationMode::INCREMENTAL ReconciliationMode.INCREMENTAL}. - # @param notification_pubsub_topic [::String] - # Full Pub/Sub topic name for receiving notification. If this field is set, - # when the import is finished, a notification is sent to - # specified Pub/Sub topic. The message data is JSON string of a - # {::Google::Longrunning::Operation Operation}. - # - # Format of the Pub/Sub topic is `projects/{project}/topics/{topic}`. It has - # to be within the same project as - # {::Google::Cloud::Retail::V2::ImportProductsRequest#parent ImportProductsRequest.parent}. - # Make sure that both - # `cloud-retail-customer-data-access@system.gserviceaccount.com` and - # `service-@gcp-sa-retail.iam.gserviceaccount.com` - # have the `pubsub.topics.publish` IAM permission on the topic. - # - # Only supported when - # {::Google::Cloud::Retail::V2::ImportProductsRequest#reconciliation_mode ImportProductsRequest.reconciliation_mode} - # is set to `FULL`. - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Gapic::Operation] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Gapic::Operation] - # - # @raise [::Google::Cloud::Error] if the REST call is aborted. - # - # @example Basic example - # require "google/cloud/retail/v2" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Retail::V2::ProductService::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Retail::V2::ImportProductsRequest.new - # - # # Call the import_products method. - # result = client.import_products 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 import_products request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Retail::V2::ImportProductsRequest - - # Converts hash 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.import_products.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::Retail::V2::VERSION, - transports_version_send: [:rest] - - call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - options.apply_defaults timeout: @config.rpcs.import_products.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.import_products.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @product_service_stub.import_products 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 - - ## - # Updates inventory information for a - # {::Google::Cloud::Retail::V2::Product Product} while respecting the last update - # timestamps of each inventory field. - # - # This process is asynchronous and does not require the - # {::Google::Cloud::Retail::V2::Product Product} to exist before updating - # fulfillment information. If the request is valid, the update is enqueued - # and processed downstream. As a consequence, when a response is returned, - # updates are not immediately manifested in the - # {::Google::Cloud::Retail::V2::Product Product} queried by - # {::Google::Cloud::Retail::V2::ProductService::Rest::Client#get_product ProductService.GetProduct} - # or - # {::Google::Cloud::Retail::V2::ProductService::Rest::Client#list_products ProductService.ListProducts}. - # - # When inventory is updated with - # {::Google::Cloud::Retail::V2::ProductService::Rest::Client#create_product ProductService.CreateProduct} - # and - # {::Google::Cloud::Retail::V2::ProductService::Rest::Client#update_product ProductService.UpdateProduct}, - # the specified inventory field value(s) overwrite any existing value(s) - # while ignoring the last update time for this field. Furthermore, the last - # update times for the specified inventory fields are overwritten by the - # times of the - # {::Google::Cloud::Retail::V2::ProductService::Rest::Client#create_product ProductService.CreateProduct} - # or - # {::Google::Cloud::Retail::V2::ProductService::Rest::Client#update_product ProductService.UpdateProduct} - # request. - # - # If no inventory fields are set in - # {::Google::Cloud::Retail::V2::CreateProductRequest#product CreateProductRequest.product}, - # then any pre-existing inventory information for this product is used. - # - # If no inventory fields are set in - # {::Google::Cloud::Retail::V2::SetInventoryRequest#set_mask SetInventoryRequest.set_mask}, - # then any existing inventory information is preserved. - # - # Pre-existing inventory information can only be updated with - # {::Google::Cloud::Retail::V2::ProductService::Rest::Client#set_inventory ProductService.SetInventory}, - # {::Google::Cloud::Retail::V2::ProductService::Rest::Client#add_fulfillment_places ProductService.AddFulfillmentPlaces}, - # and - # {::Google::Cloud::Retail::V2::ProductService::Rest::Client#remove_fulfillment_places ProductService.RemoveFulfillmentPlaces}. - # - # The returned {::Google::Longrunning::Operation Operation}s is obsolete after - # one day, and the GetOperation - # API returns `NOT_FOUND` afterwards. - # - # If conflicting updates are issued, the - # {::Google::Longrunning::Operation Operation}s associated with the stale - # updates are not marked as {::Google::Longrunning::Operation#done done} until - # they are obsolete. - # - # @overload set_inventory(request, options = nil) - # Pass arguments to `set_inventory` via a request object, either of type - # {::Google::Cloud::Retail::V2::SetInventoryRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Retail::V2::SetInventoryRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @overload set_inventory(inventory: nil, set_mask: nil, set_time: nil, allow_missing: nil) - # Pass arguments to `set_inventory` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param inventory [::Google::Cloud::Retail::V2::Product, ::Hash] - # Required. The inventory information to update. The allowable fields to - # update are: - # - # * {::Google::Cloud::Retail::V2::Product#price_info Product.price_info} - # * {::Google::Cloud::Retail::V2::Product#availability Product.availability} - # * {::Google::Cloud::Retail::V2::Product#available_quantity Product.available_quantity} - # * {::Google::Cloud::Retail::V2::Product#fulfillment_info Product.fulfillment_info} - # The updated inventory fields must be specified in - # {::Google::Cloud::Retail::V2::SetInventoryRequest#set_mask SetInventoryRequest.set_mask}. - # - # If - # {::Google::Cloud::Retail::V2::Product#name SetInventoryRequest.inventory.name} - # is empty or invalid, an INVALID_ARGUMENT error is returned. - # - # If the caller does not have permission to update the - # {::Google::Cloud::Retail::V2::Product Product} named in - # {::Google::Cloud::Retail::V2::Product#name Product.name}, regardless of whether - # or not it exists, a PERMISSION_DENIED error is returned. - # - # If the {::Google::Cloud::Retail::V2::Product Product} to update does not have - # existing inventory information, the provided inventory information will be - # inserted. - # - # If the {::Google::Cloud::Retail::V2::Product Product} to update has existing - # inventory information, the provided inventory information will be merged - # while respecting the last update time for each inventory field, using the - # provided or default value for - # {::Google::Cloud::Retail::V2::SetInventoryRequest#set_time SetInventoryRequest.set_time}. - # - # The caller can replace place IDs for a subset of fulfillment types in the - # following ways: - # - # * Adds "fulfillment_info" in - # {::Google::Cloud::Retail::V2::SetInventoryRequest#set_mask SetInventoryRequest.set_mask} - # * Specifies only the desired fulfillment types and corresponding place IDs - # to update in - # {::Google::Cloud::Retail::V2::Product#fulfillment_info SetInventoryRequest.inventory.fulfillment_info} - # - # The caller can clear all place IDs from a subset of fulfillment types in - # the following ways: - # - # * Adds "fulfillment_info" in - # {::Google::Cloud::Retail::V2::SetInventoryRequest#set_mask SetInventoryRequest.set_mask} - # * Specifies only the desired fulfillment types to clear in - # {::Google::Cloud::Retail::V2::Product#fulfillment_info SetInventoryRequest.inventory.fulfillment_info} - # * Checks that only the desired fulfillment info types have empty - # {::Google::Cloud::Retail::V2::FulfillmentInfo#place_ids SetInventoryRequest.inventory.fulfillment_info.place_ids} - # - # The last update time is recorded for the following inventory fields: - # * {::Google::Cloud::Retail::V2::Product#price_info Product.price_info} - # * {::Google::Cloud::Retail::V2::Product#availability Product.availability} - # * {::Google::Cloud::Retail::V2::Product#available_quantity Product.available_quantity} - # * {::Google::Cloud::Retail::V2::Product#fulfillment_info Product.fulfillment_info} - # - # If a full overwrite of inventory information while ignoring timestamps is - # needed, - # {::Google::Cloud::Retail::V2::ProductService::Rest::Client#update_product ProductService.UpdateProduct} - # should be invoked instead. - # @param set_mask [::Google::Protobuf::FieldMask, ::Hash] - # Indicates which inventory fields in the provided - # {::Google::Cloud::Retail::V2::Product Product} to update. - # - # At least one field must be provided. - # - # If an unsupported or unknown field is provided, an INVALID_ARGUMENT error - # is returned and the entire update will be ignored. - # @param set_time [::Google::Protobuf::Timestamp, ::Hash] - # The time when the request is issued, used to prevent - # out-of-order updates on inventory fields with the last update time - # recorded. If not provided, the internal system time will be used. - # @param allow_missing [::Boolean] - # If set to true, and the {::Google::Cloud::Retail::V2::Product Product} with name - # {::Google::Cloud::Retail::V2::Product#name Product.name} is not found, the - # inventory update will still be processed and retained for at most 1 day - # until the {::Google::Cloud::Retail::V2::Product Product} is created. If set to - # false, a NOT_FOUND error is returned if the - # {::Google::Cloud::Retail::V2::Product Product} is not found. - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Gapic::Operation] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Gapic::Operation] - # - # @raise [::Google::Cloud::Error] if the REST call is aborted. - # - # @example Basic example - # require "google/cloud/retail/v2" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Retail::V2::ProductService::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Retail::V2::SetInventoryRequest.new - # - # # Call the set_inventory method. - # result = client.set_inventory 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 set_inventory request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Retail::V2::SetInventoryRequest - - # Converts hash and nil to an options object - options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h - - # Customize the options with defaults - call_metadata = @config.rpcs.set_inventory.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::Retail::V2::VERSION, - transports_version_send: [:rest] - - call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - options.apply_defaults timeout: @config.rpcs.set_inventory.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.set_inventory.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @product_service_stub.set_inventory 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 - - ## - # We recommend that you use the - # {::Google::Cloud::Retail::V2::ProductService::Rest::Client#add_local_inventories ProductService.AddLocalInventories} - # method instead of the - # {::Google::Cloud::Retail::V2::ProductService::Rest::Client#add_fulfillment_places ProductService.AddFulfillmentPlaces} - # method. - # {::Google::Cloud::Retail::V2::ProductService::Rest::Client#add_local_inventories ProductService.AddLocalInventories} - # achieves the same results but provides more fine-grained control over - # ingesting local inventory data. - # - # Incrementally adds place IDs to - # {::Google::Cloud::Retail::V2::FulfillmentInfo#place_ids Product.fulfillment_info.place_ids}. - # - # This process is asynchronous and does not require the - # {::Google::Cloud::Retail::V2::Product Product} to exist before updating - # fulfillment information. If the request is valid, the update will be - # enqueued and processed downstream. As a consequence, when a response is - # returned, the added place IDs are not immediately manifested in the - # {::Google::Cloud::Retail::V2::Product Product} queried by - # {::Google::Cloud::Retail::V2::ProductService::Rest::Client#get_product ProductService.GetProduct} - # or - # {::Google::Cloud::Retail::V2::ProductService::Rest::Client#list_products ProductService.ListProducts}. - # - # The returned {::Google::Longrunning::Operation Operation}s will be obsolete - # after 1 day, and GetOperation - # API will return NOT_FOUND afterwards. - # - # If conflicting updates are issued, the - # {::Google::Longrunning::Operation Operation}s associated with the stale - # updates will not be marked as {::Google::Longrunning::Operation#done done} - # until being obsolete. - # - # @overload add_fulfillment_places(request, options = nil) - # Pass arguments to `add_fulfillment_places` via a request object, either of type - # {::Google::Cloud::Retail::V2::AddFulfillmentPlacesRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Retail::V2::AddFulfillmentPlacesRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @overload add_fulfillment_places(product: nil, type: nil, place_ids: nil, add_time: nil, allow_missing: nil) - # Pass arguments to `add_fulfillment_places` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param product [::String] - # Required. Full resource name of {::Google::Cloud::Retail::V2::Product Product}, - # such as - # `projects/*/locations/global/catalogs/default_catalog/branches/default_branch/products/some_product_id`. - # - # If the caller does not have permission to access the - # {::Google::Cloud::Retail::V2::Product Product}, regardless of whether or not it - # exists, a PERMISSION_DENIED error is returned. - # @param type [::String] - # Required. The fulfillment type, including commonly used types (such as - # pickup in store and same day delivery), and custom types. - # - # Supported values: - # - # * "pickup-in-store" - # * "ship-to-store" - # * "same-day-delivery" - # * "next-day-delivery" - # * "custom-type-1" - # * "custom-type-2" - # * "custom-type-3" - # * "custom-type-4" - # * "custom-type-5" - # - # If this field is set to an invalid value other than these, an - # INVALID_ARGUMENT error is returned. - # - # This field directly corresponds to - # {::Google::Cloud::Retail::V2::FulfillmentInfo#type Product.fulfillment_info.type}. - # @param place_ids [::Array<::String>] - # Required. The IDs for this - # {::Google::Cloud::Retail::V2::AddFulfillmentPlacesRequest#type type}, such as - # the store IDs for "pickup-in-store" or the region IDs for - # "same-day-delivery" to be added for this - # {::Google::Cloud::Retail::V2::AddFulfillmentPlacesRequest#type type}. Duplicate - # IDs will be automatically ignored. - # - # At least 1 value is required, and a maximum of 2000 values are allowed. - # Each value must be a string with a length limit of 10 characters, matching - # the pattern `[a-zA-Z0-9_-]+`, such as "store1" or "REGION-2". Otherwise, an - # INVALID_ARGUMENT error is returned. - # - # If the total number of place IDs exceeds 2000 for this - # {::Google::Cloud::Retail::V2::AddFulfillmentPlacesRequest#type type} after - # adding, then the update will be rejected. - # @param add_time [::Google::Protobuf::Timestamp, ::Hash] - # The time when the fulfillment updates are issued, used to prevent - # out-of-order updates on fulfillment information. If not provided, the - # internal system time will be used. - # @param allow_missing [::Boolean] - # If set to true, and the {::Google::Cloud::Retail::V2::Product Product} is not - # found, the fulfillment information will still be processed and retained for - # at most 1 day and processed once the - # {::Google::Cloud::Retail::V2::Product Product} is created. If set to false, a - # NOT_FOUND error is returned if the - # {::Google::Cloud::Retail::V2::Product Product} is not found. - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Gapic::Operation] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Gapic::Operation] - # - # @raise [::Google::Cloud::Error] if the REST call is aborted. - # - # @example Basic example - # require "google/cloud/retail/v2" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Retail::V2::ProductService::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Retail::V2::AddFulfillmentPlacesRequest.new - # - # # Call the add_fulfillment_places method. - # result = client.add_fulfillment_places 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 add_fulfillment_places request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Retail::V2::AddFulfillmentPlacesRequest - - # Converts hash and nil to an options object - options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h - - # Customize the options with defaults - call_metadata = @config.rpcs.add_fulfillment_places.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::Retail::V2::VERSION, - transports_version_send: [:rest] - - call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - options.apply_defaults timeout: @config.rpcs.add_fulfillment_places.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.add_fulfillment_places.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @product_service_stub.add_fulfillment_places 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 - - ## - # We recommend that you use the - # {::Google::Cloud::Retail::V2::ProductService::Rest::Client#remove_local_inventories ProductService.RemoveLocalInventories} - # method instead of the - # {::Google::Cloud::Retail::V2::ProductService::Rest::Client#remove_fulfillment_places ProductService.RemoveFulfillmentPlaces} - # method. - # {::Google::Cloud::Retail::V2::ProductService::Rest::Client#remove_local_inventories ProductService.RemoveLocalInventories} - # achieves the same results but provides more fine-grained control over - # ingesting local inventory data. - # - # Incrementally removes place IDs from a - # {::Google::Cloud::Retail::V2::FulfillmentInfo#place_ids Product.fulfillment_info.place_ids}. - # - # This process is asynchronous and does not require the - # {::Google::Cloud::Retail::V2::Product Product} to exist before updating - # fulfillment information. If the request is valid, the update will be - # enqueued and processed downstream. As a consequence, when a response is - # returned, the removed place IDs are not immediately manifested in the - # {::Google::Cloud::Retail::V2::Product Product} queried by - # {::Google::Cloud::Retail::V2::ProductService::Rest::Client#get_product ProductService.GetProduct} - # or - # {::Google::Cloud::Retail::V2::ProductService::Rest::Client#list_products ProductService.ListProducts}. - # - # The returned {::Google::Longrunning::Operation Operation}s will be obsolete - # after 1 day, and GetOperation - # API will return NOT_FOUND afterwards. - # - # If conflicting updates are issued, the - # {::Google::Longrunning::Operation Operation}s associated with the stale - # updates will not be marked as {::Google::Longrunning::Operation#done done} - # until being obsolete. - # - # @overload remove_fulfillment_places(request, options = nil) - # Pass arguments to `remove_fulfillment_places` via a request object, either of type - # {::Google::Cloud::Retail::V2::RemoveFulfillmentPlacesRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Retail::V2::RemoveFulfillmentPlacesRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @overload remove_fulfillment_places(product: nil, type: nil, place_ids: nil, remove_time: nil, allow_missing: nil) - # Pass arguments to `remove_fulfillment_places` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param product [::String] - # Required. Full resource name of {::Google::Cloud::Retail::V2::Product Product}, - # such as - # `projects/*/locations/global/catalogs/default_catalog/branches/default_branch/products/some_product_id`. - # - # If the caller does not have permission to access the - # {::Google::Cloud::Retail::V2::Product Product}, regardless of whether or not it - # exists, a PERMISSION_DENIED error is returned. - # @param type [::String] - # Required. The fulfillment type, including commonly used types (such as - # pickup in store and same day delivery), and custom types. - # - # Supported values: - # - # * "pickup-in-store" - # * "ship-to-store" - # * "same-day-delivery" - # * "next-day-delivery" - # * "custom-type-1" - # * "custom-type-2" - # * "custom-type-3" - # * "custom-type-4" - # * "custom-type-5" - # - # If this field is set to an invalid value other than these, an - # INVALID_ARGUMENT error is returned. - # - # This field directly corresponds to - # {::Google::Cloud::Retail::V2::FulfillmentInfo#type Product.fulfillment_info.type}. - # @param place_ids [::Array<::String>] - # Required. The IDs for this - # {::Google::Cloud::Retail::V2::RemoveFulfillmentPlacesRequest#type type}, such as - # the store IDs for "pickup-in-store" or the region IDs for - # "same-day-delivery", to be removed for this - # {::Google::Cloud::Retail::V2::RemoveFulfillmentPlacesRequest#type type}. - # - # At least 1 value is required, and a maximum of 2000 values are allowed. - # Each value must be a string with a length limit of 10 characters, matching - # the pattern `[a-zA-Z0-9_-]+`, such as "store1" or "REGION-2". Otherwise, an - # INVALID_ARGUMENT error is returned. - # @param remove_time [::Google::Protobuf::Timestamp, ::Hash] - # The time when the fulfillment updates are issued, used to prevent - # out-of-order updates on fulfillment information. If not provided, the - # internal system time will be used. - # @param allow_missing [::Boolean] - # If set to true, and the {::Google::Cloud::Retail::V2::Product Product} is not - # found, the fulfillment information will still be processed and retained for - # at most 1 day and processed once the - # {::Google::Cloud::Retail::V2::Product Product} is created. If set to false, a - # NOT_FOUND error is returned if the - # {::Google::Cloud::Retail::V2::Product Product} is not found. - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Gapic::Operation] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Gapic::Operation] - # - # @raise [::Google::Cloud::Error] if the REST call is aborted. - # - # @example Basic example - # require "google/cloud/retail/v2" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Retail::V2::ProductService::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Retail::V2::RemoveFulfillmentPlacesRequest.new - # - # # Call the remove_fulfillment_places method. - # result = client.remove_fulfillment_places 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 remove_fulfillment_places request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Retail::V2::RemoveFulfillmentPlacesRequest - - # Converts hash 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.remove_fulfillment_places.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::Retail::V2::VERSION, - transports_version_send: [:rest] - - call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - options.apply_defaults timeout: @config.rpcs.remove_fulfillment_places.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.remove_fulfillment_places.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @product_service_stub.remove_fulfillment_places 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 - - ## - # Updates local inventory information for a - # {::Google::Cloud::Retail::V2::Product Product} at a list of places, while - # respecting the last update timestamps of each inventory field. - # - # This process is asynchronous and does not require the - # {::Google::Cloud::Retail::V2::Product Product} to exist before updating - # inventory information. If the request is valid, the update will be enqueued - # and processed downstream. As a consequence, when a response is returned, - # updates are not immediately manifested in the - # {::Google::Cloud::Retail::V2::Product Product} queried by - # {::Google::Cloud::Retail::V2::ProductService::Rest::Client#get_product ProductService.GetProduct} - # or - # {::Google::Cloud::Retail::V2::ProductService::Rest::Client#list_products ProductService.ListProducts}. - # - # Local inventory information can only be modified using this method. - # {::Google::Cloud::Retail::V2::ProductService::Rest::Client#create_product ProductService.CreateProduct} - # and - # {::Google::Cloud::Retail::V2::ProductService::Rest::Client#update_product ProductService.UpdateProduct} - # has no effect on local inventories. - # - # The returned {::Google::Longrunning::Operation Operation}s will be obsolete - # after 1 day, and GetOperation - # API will return NOT_FOUND afterwards. - # - # If conflicting updates are issued, the - # {::Google::Longrunning::Operation Operation}s associated with the stale - # updates will not be marked as {::Google::Longrunning::Operation#done done} - # until being obsolete. - # - # @overload add_local_inventories(request, options = nil) - # Pass arguments to `add_local_inventories` via a request object, either of type - # {::Google::Cloud::Retail::V2::AddLocalInventoriesRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Retail::V2::AddLocalInventoriesRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @overload add_local_inventories(product: nil, local_inventories: nil, add_mask: nil, add_time: nil, allow_missing: nil) - # Pass arguments to `add_local_inventories` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param product [::String] - # Required. Full resource name of {::Google::Cloud::Retail::V2::Product Product}, - # such as - # `projects/*/locations/global/catalogs/default_catalog/branches/default_branch/products/some_product_id`. - # - # If the caller does not have permission to access the - # {::Google::Cloud::Retail::V2::Product Product}, regardless of whether or not it - # exists, a PERMISSION_DENIED error is returned. - # @param local_inventories [::Array<::Google::Cloud::Retail::V2::LocalInventory, ::Hash>] - # Required. A list of inventory information at difference places. Each place - # is identified by its place ID. At most 3000 inventories are allowed per - # request. - # @param add_mask [::Google::Protobuf::FieldMask, ::Hash] - # Indicates which inventory fields in the provided list of - # {::Google::Cloud::Retail::V2::LocalInventory LocalInventory} to update. The - # field is updated to the provided value. - # - # If a field is set while the place does not have a previous local inventory, - # the local inventory at that store is created. - # - # If a field is set while the value of that field is not provided, the - # original field value, if it exists, is deleted. - # - # If the mask is not set or set with empty paths, all inventory fields will - # be updated. - # - # If an unsupported or unknown field is provided, an INVALID_ARGUMENT error - # is returned and the entire update will be ignored. - # @param add_time [::Google::Protobuf::Timestamp, ::Hash] - # The time when the inventory updates are issued. Used to prevent - # out-of-order updates on local inventory fields. If not provided, the - # internal system time will be used. - # @param allow_missing [::Boolean] - # If set to true, and the {::Google::Cloud::Retail::V2::Product Product} is not - # found, the local inventory will still be processed and retained for at most - # 1 day and processed once the {::Google::Cloud::Retail::V2::Product Product} is - # created. If set to false, a NOT_FOUND error is returned if the - # {::Google::Cloud::Retail::V2::Product Product} is not found. - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Gapic::Operation] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Gapic::Operation] - # - # @raise [::Google::Cloud::Error] if the REST call is aborted. - # - # @example Basic example - # require "google/cloud/retail/v2" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Retail::V2::ProductService::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Retail::V2::AddLocalInventoriesRequest.new - # - # # Call the add_local_inventories method. - # result = client.add_local_inventories 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 add_local_inventories request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Retail::V2::AddLocalInventoriesRequest - - # Converts hash and nil to an options object - options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h - - # Customize the options with defaults - call_metadata = @config.rpcs.add_local_inventories.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::Retail::V2::VERSION, - transports_version_send: [:rest] - - call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - options.apply_defaults timeout: @config.rpcs.add_local_inventories.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.add_local_inventories.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @product_service_stub.add_local_inventories 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 - - ## - # Remove local inventory information for a - # {::Google::Cloud::Retail::V2::Product Product} at a list of places at a removal - # timestamp. - # - # This process is asynchronous. If the request is valid, the removal will be - # enqueued and processed downstream. As a consequence, when a response is - # returned, removals are not immediately manifested in the - # {::Google::Cloud::Retail::V2::Product Product} queried by - # {::Google::Cloud::Retail::V2::ProductService::Rest::Client#get_product ProductService.GetProduct} - # or - # {::Google::Cloud::Retail::V2::ProductService::Rest::Client#list_products ProductService.ListProducts}. - # - # Local inventory information can only be removed using this method. - # {::Google::Cloud::Retail::V2::ProductService::Rest::Client#create_product ProductService.CreateProduct} - # and - # {::Google::Cloud::Retail::V2::ProductService::Rest::Client#update_product ProductService.UpdateProduct} - # has no effect on local inventories. - # - # The returned {::Google::Longrunning::Operation Operation}s will be obsolete - # after 1 day, and GetOperation - # API will return NOT_FOUND afterwards. - # - # If conflicting updates are issued, the - # {::Google::Longrunning::Operation Operation}s associated with the stale - # updates will not be marked as {::Google::Longrunning::Operation#done done} - # until being obsolete. - # - # @overload remove_local_inventories(request, options = nil) - # Pass arguments to `remove_local_inventories` via a request object, either of type - # {::Google::Cloud::Retail::V2::RemoveLocalInventoriesRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Retail::V2::RemoveLocalInventoriesRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @overload remove_local_inventories(product: nil, place_ids: nil, remove_time: nil, allow_missing: nil) - # Pass arguments to `remove_local_inventories` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param product [::String] - # Required. Full resource name of {::Google::Cloud::Retail::V2::Product Product}, - # such as - # `projects/*/locations/global/catalogs/default_catalog/branches/default_branch/products/some_product_id`. - # - # If the caller does not have permission to access the - # {::Google::Cloud::Retail::V2::Product Product}, regardless of whether or not it - # exists, a PERMISSION_DENIED error is returned. - # @param place_ids [::Array<::String>] - # Required. A list of place IDs to have their inventory deleted. - # At most 3000 place IDs are allowed per request. - # @param remove_time [::Google::Protobuf::Timestamp, ::Hash] - # The time when the inventory deletions are issued. Used to prevent - # out-of-order updates and deletions on local inventory fields. If not - # provided, the internal system time will be used. - # @param allow_missing [::Boolean] - # If set to true, and the {::Google::Cloud::Retail::V2::Product Product} is not - # found, the local inventory removal request will still be processed and - # retained for at most 1 day and processed once the - # {::Google::Cloud::Retail::V2::Product Product} is created. If set to false, a - # NOT_FOUND error is returned if the - # {::Google::Cloud::Retail::V2::Product Product} is not found. - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Gapic::Operation] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Gapic::Operation] - # - # @raise [::Google::Cloud::Error] if the REST call is aborted. - # - # @example Basic example - # require "google/cloud/retail/v2" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Retail::V2::ProductService::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Retail::V2::RemoveLocalInventoriesRequest.new - # - # # Call the remove_local_inventories method. - # result = client.remove_local_inventories 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 remove_local_inventories request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Retail::V2::RemoveLocalInventoriesRequest - - # Converts hash 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.remove_local_inventories.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::Retail::V2::VERSION, - transports_version_send: [:rest] - - call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - options.apply_defaults timeout: @config.rpcs.remove_local_inventories.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.remove_local_inventories.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @product_service_stub.remove_local_inventories 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 - - ## - # Configuration class for the ProductService REST API. - # - # This class represents the configuration for ProductService REST, - # providing control over timeouts, retry behavior, logging, transport - # parameters, and other low-level controls. Certain parameters can also be - # applied individually to specific RPCs. See - # {::Google::Cloud::Retail::V2::ProductService::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_product to 20 seconds, - # # and all remaining timeouts to 10 seconds. - # ::Google::Cloud::Retail::V2::ProductService::Rest::Client.configure do |config| - # config.timeout = 10.0 - # config.rpcs.create_product.timeout = 20.0 - # end - # - # # Apply the above configuration only to a new client. - # client = ::Google::Cloud::Retail::V2::ProductService::Rest::Client.new do |config| - # config.timeout = 10.0 - # config.rpcs.create_product.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 = "retail.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 ProductService 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_product` - # @return [::Gapic::Config::Method] - # - attr_reader :create_product - ## - # RPC-specific configuration for `get_product` - # @return [::Gapic::Config::Method] - # - attr_reader :get_product - ## - # RPC-specific configuration for `list_products` - # @return [::Gapic::Config::Method] - # - attr_reader :list_products - ## - # RPC-specific configuration for `update_product` - # @return [::Gapic::Config::Method] - # - attr_reader :update_product - ## - # RPC-specific configuration for `delete_product` - # @return [::Gapic::Config::Method] - # - attr_reader :delete_product - ## - # RPC-specific configuration for `purge_products` - # @return [::Gapic::Config::Method] - # - attr_reader :purge_products - ## - # RPC-specific configuration for `import_products` - # @return [::Gapic::Config::Method] - # - attr_reader :import_products - ## - # RPC-specific configuration for `set_inventory` - # @return [::Gapic::Config::Method] - # - attr_reader :set_inventory - ## - # RPC-specific configuration for `add_fulfillment_places` - # @return [::Gapic::Config::Method] - # - attr_reader :add_fulfillment_places - ## - # RPC-specific configuration for `remove_fulfillment_places` - # @return [::Gapic::Config::Method] - # - attr_reader :remove_fulfillment_places - ## - # RPC-specific configuration for `add_local_inventories` - # @return [::Gapic::Config::Method] - # - attr_reader :add_local_inventories - ## - # RPC-specific configuration for `remove_local_inventories` - # @return [::Gapic::Config::Method] - # - attr_reader :remove_local_inventories - - # @private - def initialize parent_rpcs = nil - create_product_config = parent_rpcs.create_product if parent_rpcs.respond_to? :create_product - @create_product = ::Gapic::Config::Method.new create_product_config - get_product_config = parent_rpcs.get_product if parent_rpcs.respond_to? :get_product - @get_product = ::Gapic::Config::Method.new get_product_config - list_products_config = parent_rpcs.list_products if parent_rpcs.respond_to? :list_products - @list_products = ::Gapic::Config::Method.new list_products_config - update_product_config = parent_rpcs.update_product if parent_rpcs.respond_to? :update_product - @update_product = ::Gapic::Config::Method.new update_product_config - delete_product_config = parent_rpcs.delete_product if parent_rpcs.respond_to? :delete_product - @delete_product = ::Gapic::Config::Method.new delete_product_config - purge_products_config = parent_rpcs.purge_products if parent_rpcs.respond_to? :purge_products - @purge_products = ::Gapic::Config::Method.new purge_products_config - import_products_config = parent_rpcs.import_products if parent_rpcs.respond_to? :import_products - @import_products = ::Gapic::Config::Method.new import_products_config - set_inventory_config = parent_rpcs.set_inventory if parent_rpcs.respond_to? :set_inventory - @set_inventory = ::Gapic::Config::Method.new set_inventory_config - add_fulfillment_places_config = parent_rpcs.add_fulfillment_places if parent_rpcs.respond_to? :add_fulfillment_places - @add_fulfillment_places = ::Gapic::Config::Method.new add_fulfillment_places_config - remove_fulfillment_places_config = parent_rpcs.remove_fulfillment_places if parent_rpcs.respond_to? :remove_fulfillment_places - @remove_fulfillment_places = ::Gapic::Config::Method.new remove_fulfillment_places_config - add_local_inventories_config = parent_rpcs.add_local_inventories if parent_rpcs.respond_to? :add_local_inventories - @add_local_inventories = ::Gapic::Config::Method.new add_local_inventories_config - remove_local_inventories_config = parent_rpcs.remove_local_inventories if parent_rpcs.respond_to? :remove_local_inventories - @remove_local_inventories = ::Gapic::Config::Method.new remove_local_inventories_config - - yield self if block_given? - end - end - end - end - end - end - end - end - end -end diff --git a/owl-bot-staging/google-cloud-retail-v2/lib/google/cloud/retail/v2/product_service/rest/operations.rb b/owl-bot-staging/google-cloud-retail-v2/lib/google/cloud/retail/v2/product_service/rest/operations.rb deleted file mode 100644 index 4c8a1a539e9a..000000000000 --- a/owl-bot-staging/google-cloud-retail-v2/lib/google/cloud/retail/v2/product_service/rest/operations.rb +++ /dev/null @@ -1,960 +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 Cloud - module Retail - module V2 - module ProductService - module Rest - # Service that implements Longrunning Operations API. - class Operations - # @private - API_VERSION = "" - - # @private - DEFAULT_ENDPOINT_TEMPLATE = "retail.$UNIVERSE_DOMAIN$" - - # @private - attr_reader :operations_stub - - ## - # Configuration for the ProductService 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 ProductService 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::Retail::V2::VERSION, - transports_version_send: [:rest] - - call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - options.apply_defaults timeout: @config.rpcs.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::Retail::V2::VERSION, - transports_version_send: [:rest] - - call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - options.apply_defaults timeout: @config.rpcs.get_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::Retail::V2::VERSION, - transports_version_send: [:rest] - - call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - options.apply_defaults timeout: @config.rpcs.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::Retail::V2::VERSION, - transports_version_send: [:rest] - - call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - options.apply_defaults timeout: @config.rpcs.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 = "retail.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: "/v2/{name}/operations", - matches: [ - ["name", %r{^projects/[^/]+/locations/[^/]+/?$}, false] - ] - ) - .with_bindings( - uri_method: :get, - uri_template: "/v2/{name}/operations", - matches: [ - ["name", %r{^projects/[^/]+/locations/[^/]+/catalogs/[^/]+/?$}, false] - ] - ) - .with_bindings( - uri_method: :get, - uri_template: "/v2/{name}/operations", - matches: [ - ["name", %r{^projects/[^/]+/?$}, 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: "/v2/{name}", - matches: [ - ["name", %r{^projects/[^/]+/locations/[^/]+/operations/[^/]+/?$}, false] - ] - ) - .with_bindings( - uri_method: :get, - uri_template: "/v2/{name}", - matches: [ - ["name", %r{^projects/[^/]+/locations/[^/]+/catalogs/[^/]+/branches/[^/]+/operations/[^/]+/?$}, false] - ] - ) - .with_bindings( - uri_method: :get, - uri_template: "/v2/{name}", - matches: [ - ["name", %r{^projects/[^/]+/locations/[^/]+/catalogs/[^/]+/operations/[^/]+/?$}, false] - ] - ) - .with_bindings( - uri_method: :get, - uri_template: "/v2/{name}", - matches: [ - ["name", %r{^projects/[^/]+/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 -end diff --git a/owl-bot-staging/google-cloud-retail-v2/lib/google/cloud/retail/v2/product_service/rest/service_stub.rb b/owl-bot-staging/google-cloud-retail-v2/lib/google/cloud/retail/v2/product_service/rest/service_stub.rb deleted file mode 100644 index 6c786d4e6c0c..000000000000 --- a/owl-bot-staging/google-cloud-retail-v2/lib/google/cloud/retail/v2/product_service/rest/service_stub.rb +++ /dev/null @@ -1,822 +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/retail/v2/product_service_pb" - -module Google - module Cloud - module Retail - module V2 - module ProductService - module Rest - ## - # REST service stub for the ProductService 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_product REST call - # - # @param request_pb [::Google::Cloud::Retail::V2::CreateProductRequest] - # A request object representing the call parameters. Required. - # @param options [::Gapic::CallOptions] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Cloud::Retail::V2::Product] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::Retail::V2::Product] - # A result object deserialized from the server's reply - def create_product request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_create_product_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_product", - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Cloud::Retail::V2::Product.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_product REST call - # - # @param request_pb [::Google::Cloud::Retail::V2::GetProductRequest] - # A request object representing the call parameters. Required. - # @param options [::Gapic::CallOptions] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Cloud::Retail::V2::Product] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::Retail::V2::Product] - # A result object deserialized from the server's reply - def get_product request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_get_product_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_product", - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Cloud::Retail::V2::Product.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_products REST call - # - # @param request_pb [::Google::Cloud::Retail::V2::ListProductsRequest] - # A request object representing the call parameters. Required. - # @param options [::Gapic::CallOptions] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Cloud::Retail::V2::ListProductsResponse] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::Retail::V2::ListProductsResponse] - # A result object deserialized from the server's reply - def list_products request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_list_products_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_products", - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Cloud::Retail::V2::ListProductsResponse.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_product REST call - # - # @param request_pb [::Google::Cloud::Retail::V2::UpdateProductRequest] - # A request object representing the call parameters. Required. - # @param options [::Gapic::CallOptions] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Cloud::Retail::V2::Product] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::Retail::V2::Product] - # A result object deserialized from the server's reply - def update_product request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_update_product_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_product", - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Cloud::Retail::V2::Product.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_product REST call - # - # @param request_pb [::Google::Cloud::Retail::V2::DeleteProductRequest] - # 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_product request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_delete_product_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_product", - 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 purge_products REST call - # - # @param request_pb [::Google::Cloud::Retail::V2::PurgeProductsRequest] - # 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 purge_products request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_purge_products_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: "purge_products", - 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 import_products REST call - # - # @param request_pb [::Google::Cloud::Retail::V2::ImportProductsRequest] - # 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 import_products request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_import_products_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: "import_products", - 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 set_inventory REST call - # - # @param request_pb [::Google::Cloud::Retail::V2::SetInventoryRequest] - # 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 set_inventory request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_set_inventory_request request_pb - query_string_params = if query_string_params.any? - query_string_params.to_h { |p| p.split "=", 2 } - else - {} - end - - response = @client_stub.make_http_request( - verb, - uri: uri, - body: body || "", - params: query_string_params, - method_name: "set_inventory", - 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 add_fulfillment_places REST call - # - # @param request_pb [::Google::Cloud::Retail::V2::AddFulfillmentPlacesRequest] - # 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 add_fulfillment_places request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_add_fulfillment_places_request request_pb - query_string_params = if query_string_params.any? - query_string_params.to_h { |p| p.split "=", 2 } - else - {} - end - - response = @client_stub.make_http_request( - verb, - uri: uri, - body: body || "", - params: query_string_params, - method_name: "add_fulfillment_places", - 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 remove_fulfillment_places REST call - # - # @param request_pb [::Google::Cloud::Retail::V2::RemoveFulfillmentPlacesRequest] - # 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 remove_fulfillment_places request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_remove_fulfillment_places_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: "remove_fulfillment_places", - 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 add_local_inventories REST call - # - # @param request_pb [::Google::Cloud::Retail::V2::AddLocalInventoriesRequest] - # 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 add_local_inventories request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_add_local_inventories_request request_pb - query_string_params = if query_string_params.any? - query_string_params.to_h { |p| p.split "=", 2 } - else - {} - end - - response = @client_stub.make_http_request( - verb, - uri: uri, - body: body || "", - params: query_string_params, - method_name: "add_local_inventories", - 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 remove_local_inventories REST call - # - # @param request_pb [::Google::Cloud::Retail::V2::RemoveLocalInventoriesRequest] - # 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 remove_local_inventories request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_remove_local_inventories_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: "remove_local_inventories", - 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 - - ## - # @private - # - # GRPC transcoding helper method for the create_product REST call - # - # @param request_pb [::Google::Cloud::Retail::V2::CreateProductRequest] - # 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_product_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :post, - uri_template: "/v2/{parent}/products", - body: "product", - matches: [ - ["parent", %r{^projects/[^/]+/locations/[^/]+/catalogs/[^/]+/branches/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the get_product REST call - # - # @param request_pb [::Google::Cloud::Retail::V2::GetProductRequest] - # 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_product_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :get, - uri_template: "/v2/{name}", - matches: [ - ["name", %r{^projects/[^/]+/locations/[^/]+/catalogs/[^/]+/branches/[^/]+/products(?:/.*)?$}, true] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the list_products REST call - # - # @param request_pb [::Google::Cloud::Retail::V2::ListProductsRequest] - # 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_products_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :get, - uri_template: "/v2/{parent}/products", - matches: [ - ["parent", %r{^projects/[^/]+/locations/[^/]+/catalogs/[^/]+/branches/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the update_product REST call - # - # @param request_pb [::Google::Cloud::Retail::V2::UpdateProductRequest] - # 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_product_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :patch, - uri_template: "/v2/{product.name}", - body: "product", - matches: [ - ["product.name", %r{^projects/[^/]+/locations/[^/]+/catalogs/[^/]+/branches/[^/]+/products(?:/.*)?$}, true] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the delete_product REST call - # - # @param request_pb [::Google::Cloud::Retail::V2::DeleteProductRequest] - # 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_product_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :delete, - uri_template: "/v2/{name}", - matches: [ - ["name", %r{^projects/[^/]+/locations/[^/]+/catalogs/[^/]+/branches/[^/]+/products(?:/.*)?$}, true] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the purge_products REST call - # - # @param request_pb [::Google::Cloud::Retail::V2::PurgeProductsRequest] - # A request object representing the call parameters. Required. - # @return [Array(String, [String, nil], Hash{String => String})] - # Uri, Body, Query string parameters - def self.transcode_purge_products_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :post, - uri_template: "/v2/{parent}/products:purge", - body: "*", - matches: [ - ["parent", %r{^projects/[^/]+/locations/[^/]+/catalogs/[^/]+/branches/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the import_products REST call - # - # @param request_pb [::Google::Cloud::Retail::V2::ImportProductsRequest] - # A request object representing the call parameters. Required. - # @return [Array(String, [String, nil], Hash{String => String})] - # Uri, Body, Query string parameters - def self.transcode_import_products_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :post, - uri_template: "/v2/{parent}/products:import", - body: "*", - matches: [ - ["parent", %r{^projects/[^/]+/locations/[^/]+/catalogs/[^/]+/branches/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the set_inventory REST call - # - # @param request_pb [::Google::Cloud::Retail::V2::SetInventoryRequest] - # A request object representing the call parameters. Required. - # @return [Array(String, [String, nil], Hash{String => String})] - # Uri, Body, Query string parameters - def self.transcode_set_inventory_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :post, - uri_template: "/v2/{inventory.name}:setInventory", - body: "*", - matches: [ - ["inventory.name", %r{^projects/[^/]+/locations/[^/]+/catalogs/[^/]+/branches/[^/]+/products(?:/.*)?$}, true] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the add_fulfillment_places REST call - # - # @param request_pb [::Google::Cloud::Retail::V2::AddFulfillmentPlacesRequest] - # A request object representing the call parameters. Required. - # @return [Array(String, [String, nil], Hash{String => String})] - # Uri, Body, Query string parameters - def self.transcode_add_fulfillment_places_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :post, - uri_template: "/v2/{product}:addFulfillmentPlaces", - body: "*", - matches: [ - ["product", %r{^projects/[^/]+/locations/[^/]+/catalogs/[^/]+/branches/[^/]+/products(?:/.*)?$}, true] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the remove_fulfillment_places REST call - # - # @param request_pb [::Google::Cloud::Retail::V2::RemoveFulfillmentPlacesRequest] - # A request object representing the call parameters. Required. - # @return [Array(String, [String, nil], Hash{String => String})] - # Uri, Body, Query string parameters - def self.transcode_remove_fulfillment_places_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :post, - uri_template: "/v2/{product}:removeFulfillmentPlaces", - body: "*", - matches: [ - ["product", %r{^projects/[^/]+/locations/[^/]+/catalogs/[^/]+/branches/[^/]+/products(?:/.*)?$}, true] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the add_local_inventories REST call - # - # @param request_pb [::Google::Cloud::Retail::V2::AddLocalInventoriesRequest] - # A request object representing the call parameters. Required. - # @return [Array(String, [String, nil], Hash{String => String})] - # Uri, Body, Query string parameters - def self.transcode_add_local_inventories_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :post, - uri_template: "/v2/{product}:addLocalInventories", - body: "*", - matches: [ - ["product", %r{^projects/[^/]+/locations/[^/]+/catalogs/[^/]+/branches/[^/]+/products(?:/.*)?$}, true] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the remove_local_inventories REST call - # - # @param request_pb [::Google::Cloud::Retail::V2::RemoveLocalInventoriesRequest] - # A request object representing the call parameters. Required. - # @return [Array(String, [String, nil], Hash{String => String})] - # Uri, Body, Query string parameters - def self.transcode_remove_local_inventories_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :post, - uri_template: "/v2/{product}:removeLocalInventories", - body: "*", - matches: [ - ["product", %r{^projects/[^/]+/locations/[^/]+/catalogs/[^/]+/branches/[^/]+/products(?:/.*)?$}, true] - ] - ) - transcoder.transcode request_pb - end - end - end - end - end - end - end -end diff --git a/owl-bot-staging/google-cloud-retail-v2/lib/google/cloud/retail/v2/product_service_pb.rb b/owl-bot-staging/google-cloud-retail-v2/lib/google/cloud/retail/v2/product_service_pb.rb deleted file mode 100644 index aee2b57676bc..000000000000 --- a/owl-bot-staging/google-cloud-retail-v2/lib/google/cloud/retail/v2/product_service_pb.rb +++ /dev/null @@ -1,54 +0,0 @@ -# frozen_string_literal: true -# Generated by the protocol buffer compiler. DO NOT EDIT! -# source: google/cloud/retail/v2/product_service.proto - -require 'google/protobuf' - -require 'google/api/annotations_pb' -require 'google/api/client_pb' -require 'google/api/field_behavior_pb' -require 'google/api/resource_pb' -require 'google/cloud/retail/v2/common_pb' -require 'google/cloud/retail/v2/import_config_pb' -require 'google/cloud/retail/v2/product_pb' -require 'google/cloud/retail/v2/purge_config_pb' -require 'google/longrunning/operations_pb' -require 'google/protobuf/empty_pb' -require 'google/protobuf/field_mask_pb' -require 'google/protobuf/timestamp_pb' - - -descriptor_data = "\n,google/cloud/retail/v2/product_service.proto\x12\x16google.cloud.retail.v2\x1a\x1cgoogle/api/annotations.proto\x1a\x17google/api/client.proto\x1a\x1fgoogle/api/field_behavior.proto\x1a\x19google/api/resource.proto\x1a#google/cloud/retail/v2/common.proto\x1a*google/cloud/retail/v2/import_config.proto\x1a$google/cloud/retail/v2/product.proto\x1a)google/cloud/retail/v2/purge_config.proto\x1a#google/longrunning/operations.proto\x1a\x1bgoogle/protobuf/empty.proto\x1a google/protobuf/field_mask.proto\x1a\x1fgoogle/protobuf/timestamp.proto\"\x9c\x01\n\x14\x43reateProductRequest\x12\x34\n\x06parent\x18\x01 \x01(\tB$\xe0\x41\x02\xfa\x41\x1e\n\x1cretail.googleapis.com/Branch\x12\x35\n\x07product\x18\x02 \x01(\x0b\x32\x1f.google.cloud.retail.v2.ProductB\x03\xe0\x41\x02\x12\x17\n\nproduct_id\x18\x03 \x01(\tB\x03\xe0\x41\x02\"H\n\x11GetProductRequest\x12\x33\n\x04name\x18\x01 \x01(\tB%\xe0\x41\x02\xfa\x41\x1f\n\x1dretail.googleapis.com/Product\"\x95\x01\n\x14UpdateProductRequest\x12\x35\n\x07product\x18\x01 \x01(\x0b\x32\x1f.google.cloud.retail.v2.ProductB\x03\xe0\x41\x02\x12/\n\x0bupdate_mask\x18\x02 \x01(\x0b\x32\x1a.google.protobuf.FieldMask\x12\x15\n\rallow_missing\x18\x03 \x01(\x08\"K\n\x14\x44\x65leteProductRequest\x12\x33\n\x04name\x18\x01 \x01(\tB%\xe0\x41\x02\xfa\x41\x1f\n\x1dretail.googleapis.com/Product\"\xb1\x01\n\x13ListProductsRequest\x12\x34\n\x06parent\x18\x01 \x01(\tB$\xe0\x41\x02\xfa\x41\x1e\n\x1cretail.googleapis.com/Branch\x12\x11\n\tpage_size\x18\x02 \x01(\x05\x12\x12\n\npage_token\x18\x03 \x01(\t\x12\x0e\n\x06\x66ilter\x18\x04 \x01(\t\x12-\n\tread_mask\x18\x05 \x01(\x0b\x32\x1a.google.protobuf.FieldMask\"b\n\x14ListProductsResponse\x12\x31\n\x08products\x18\x01 \x03(\x0b\x32\x1f.google.cloud.retail.v2.Product\x12\x17\n\x0fnext_page_token\x18\x02 \x01(\t\"\xc1\x01\n\x13SetInventoryRequest\x12\x37\n\tinventory\x18\x01 \x01(\x0b\x32\x1f.google.cloud.retail.v2.ProductB\x03\xe0\x41\x02\x12,\n\x08set_mask\x18\x02 \x01(\x0b\x32\x1a.google.protobuf.FieldMask\x12,\n\x08set_time\x18\x03 \x01(\x0b\x32\x1a.google.protobuf.Timestamp\x12\x15\n\rallow_missing\x18\x04 \x01(\x08\"\x16\n\x14SetInventoryMetadata\"\x16\n\x14SetInventoryResponse\"\xc5\x01\n\x1b\x41\x64\x64\x46ulfillmentPlacesRequest\x12\x36\n\x07product\x18\x01 \x01(\tB%\xe0\x41\x02\xfa\x41\x1f\n\x1dretail.googleapis.com/Product\x12\x11\n\x04type\x18\x02 \x01(\tB\x03\xe0\x41\x02\x12\x16\n\tplace_ids\x18\x03 \x03(\tB\x03\xe0\x41\x02\x12,\n\x08\x61\x64\x64_time\x18\x04 \x01(\x0b\x32\x1a.google.protobuf.Timestamp\x12\x15\n\rallow_missing\x18\x05 \x01(\x08\"\x1e\n\x1c\x41\x64\x64\x46ulfillmentPlacesMetadata\"\x1e\n\x1c\x41\x64\x64\x46ulfillmentPlacesResponse\"\x8f\x02\n\x1a\x41\x64\x64LocalInventoriesRequest\x12\x36\n\x07product\x18\x01 \x01(\tB%\xe0\x41\x02\xfa\x41\x1f\n\x1dretail.googleapis.com/Product\x12\x46\n\x11local_inventories\x18\x02 \x03(\x0b\x32&.google.cloud.retail.v2.LocalInventoryB\x03\xe0\x41\x02\x12,\n\x08\x61\x64\x64_mask\x18\x04 \x01(\x0b\x32\x1a.google.protobuf.FieldMask\x12,\n\x08\x61\x64\x64_time\x18\x05 \x01(\x0b\x32\x1a.google.protobuf.Timestamp\x12\x15\n\rallow_missing\x18\x06 \x01(\x08\"\x1d\n\x1b\x41\x64\x64LocalInventoriesMetadata\"\x1d\n\x1b\x41\x64\x64LocalInventoriesResponse\"\xb7\x01\n\x1dRemoveLocalInventoriesRequest\x12\x36\n\x07product\x18\x01 \x01(\tB%\xe0\x41\x02\xfa\x41\x1f\n\x1dretail.googleapis.com/Product\x12\x16\n\tplace_ids\x18\x02 \x03(\tB\x03\xe0\x41\x02\x12/\n\x0bremove_time\x18\x05 \x01(\x0b\x32\x1a.google.protobuf.Timestamp\x12\x15\n\rallow_missing\x18\x03 \x01(\x08\" \n\x1eRemoveLocalInventoriesMetadata\" \n\x1eRemoveLocalInventoriesResponse\"\xcb\x01\n\x1eRemoveFulfillmentPlacesRequest\x12\x36\n\x07product\x18\x01 \x01(\tB%\xe0\x41\x02\xfa\x41\x1f\n\x1dretail.googleapis.com/Product\x12\x11\n\x04type\x18\x02 \x01(\tB\x03\xe0\x41\x02\x12\x16\n\tplace_ids\x18\x03 \x03(\tB\x03\xe0\x41\x02\x12/\n\x0bremove_time\x18\x04 \x01(\x0b\x32\x1a.google.protobuf.Timestamp\x12\x15\n\rallow_missing\x18\x05 \x01(\x08\"!\n\x1fRemoveFulfillmentPlacesMetadata\"!\n\x1fRemoveFulfillmentPlacesResponse2\xc2\x19\n\x0eProductService\x12\xcf\x01\n\rCreateProduct\x12,.google.cloud.retail.v2.CreateProductRequest\x1a\x1f.google.cloud.retail.v2.Product\"o\xda\x41\x19parent,product,product_id\x82\xd3\xe4\x93\x02M\"B/v2/{parent=projects/*/locations/*/catalogs/*/branches/*}/products:\x07product\x12\xac\x01\n\nGetProduct\x12).google.cloud.retail.v2.GetProductRequest\x1a\x1f.google.cloud.retail.v2.Product\"R\xda\x41\x04name\x82\xd3\xe4\x93\x02\x45\x12\x43/v2/{name=projects/*/locations/*/catalogs/*/branches/*/products/**}\x12\xbe\x01\n\x0cListProducts\x12+.google.cloud.retail.v2.ListProductsRequest\x1a,.google.cloud.retail.v2.ListProductsResponse\"S\xda\x41\x06parent\x82\xd3\xe4\x93\x02\x44\x12\x42/v2/{parent=projects/*/locations/*/catalogs/*/branches/*}/products\x12\xd2\x01\n\rUpdateProduct\x12,.google.cloud.retail.v2.UpdateProductRequest\x1a\x1f.google.cloud.retail.v2.Product\"r\xda\x41\x13product,update_mask\x82\xd3\xe4\x93\x02V2K/v2/{product.name=projects/*/locations/*/catalogs/*/branches/*/products/**}:\x07product\x12\xa9\x01\n\rDeleteProduct\x12,.google.cloud.retail.v2.DeleteProductRequest\x1a\x16.google.protobuf.Empty\"R\xda\x41\x04name\x82\xd3\xe4\x93\x02\x45*C/v2/{name=projects/*/locations/*/catalogs/*/branches/*/products/**}\x12\x91\x02\n\rPurgeProducts\x12,.google.cloud.retail.v2.PurgeProductsRequest\x1a\x1d.google.longrunning.Operation\"\xb2\x01\xca\x41\\\n,google.cloud.retail.v2.PurgeProductsResponse\x12,google.cloud.retail.v2.PurgeProductsMetadata\x82\xd3\xe4\x93\x02M\"H/v2/{parent=projects/*/locations/*/catalogs/*/branches/*}/products:purge:\x01*\x12\x8e\x02\n\x0eImportProducts\x12-.google.cloud.retail.v2.ImportProductsRequest\x1a\x1d.google.longrunning.Operation\"\xad\x01\xca\x41V\n-google.cloud.retail.v2.ImportProductsResponse\x12%google.cloud.retail.v2.ImportMetadata\x82\xd3\xe4\x93\x02N\"I/v2/{parent=projects/*/locations/*/catalogs/*/branches/*}/products:import:\x01*\x12\xb4\x02\n\x0cSetInventory\x12+.google.cloud.retail.v2.SetInventoryRequest\x1a\x1d.google.longrunning.Operation\"\xd7\x01\xca\x41Z\n+google.cloud.retail.v2.SetInventoryResponse\x12+google.cloud.retail.v2.SetInventoryMetadata\xda\x41\x12inventory,set_mask\x82\xd3\xe4\x93\x02_\"Z/v2/{inventory.name=projects/*/locations/*/catalogs/*/branches/*/products/**}:setInventory:\x01*\x12\xca\x02\n\x14\x41\x64\x64\x46ulfillmentPlaces\x12\x33.google.cloud.retail.v2.AddFulfillmentPlacesRequest\x1a\x1d.google.longrunning.Operation\"\xdd\x01\xca\x41j\n3google.cloud.retail.v2.AddFulfillmentPlacesResponse\x12\x33google.cloud.retail.v2.AddFulfillmentPlacesMetadata\xda\x41\x07product\x82\xd3\xe4\x93\x02`\"[/v2/{product=projects/*/locations/*/catalogs/*/branches/*/products/**}:addFulfillmentPlaces:\x01*\x12\xd9\x02\n\x17RemoveFulfillmentPlaces\x12\x36.google.cloud.retail.v2.RemoveFulfillmentPlacesRequest\x1a\x1d.google.longrunning.Operation\"\xe6\x01\xca\x41p\n6google.cloud.retail.v2.RemoveFulfillmentPlacesResponse\x12\x36google.cloud.retail.v2.RemoveFulfillmentPlacesMetadata\xda\x41\x07product\x82\xd3\xe4\x93\x02\x63\"^/v2/{product=projects/*/locations/*/catalogs/*/branches/*/products/**}:removeFulfillmentPlaces:\x01*\x12\xc5\x02\n\x13\x41\x64\x64LocalInventories\x12\x32.google.cloud.retail.v2.AddLocalInventoriesRequest\x1a\x1d.google.longrunning.Operation\"\xda\x01\xca\x41h\n2google.cloud.retail.v2.AddLocalInventoriesResponse\x12\x32google.cloud.retail.v2.AddLocalInventoriesMetadata\xda\x41\x07product\x82\xd3\xe4\x93\x02_\"Z/v2/{product=projects/*/locations/*/catalogs/*/branches/*/products/**}:addLocalInventories:\x01*\x12\xd4\x02\n\x16RemoveLocalInventories\x12\x35.google.cloud.retail.v2.RemoveLocalInventoriesRequest\x1a\x1d.google.longrunning.Operation\"\xe3\x01\xca\x41n\n5google.cloud.retail.v2.RemoveLocalInventoriesResponse\x12\x35google.cloud.retail.v2.RemoveLocalInventoriesMetadata\xda\x41\x07product\x82\xd3\xe4\x93\x02\x62\"]/v2/{product=projects/*/locations/*/catalogs/*/branches/*/products/**}:removeLocalInventories:\x01*\x1aI\xca\x41\x15retail.googleapis.com\xd2\x41.https://www.googleapis.com/auth/cloud-platformB\xbe\x01\n\x1a\x63om.google.cloud.retail.v2B\x13ProductServiceProtoP\x01Z2cloud.google.com/go/retail/apiv2/retailpb;retailpb\xa2\x02\x06RETAIL\xaa\x02\x16Google.Cloud.Retail.V2\xca\x02\x16Google\\Cloud\\Retail\\V2\xea\x02\x19Google::Cloud::Retail::V2b\x06proto3" - -pool = ::Google::Protobuf::DescriptorPool.generated_pool -pool.add_serialized_file(descriptor_data) - -module Google - module Cloud - module Retail - module V2 - CreateProductRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.retail.v2.CreateProductRequest").msgclass - GetProductRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.retail.v2.GetProductRequest").msgclass - UpdateProductRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.retail.v2.UpdateProductRequest").msgclass - DeleteProductRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.retail.v2.DeleteProductRequest").msgclass - ListProductsRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.retail.v2.ListProductsRequest").msgclass - ListProductsResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.retail.v2.ListProductsResponse").msgclass - SetInventoryRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.retail.v2.SetInventoryRequest").msgclass - SetInventoryMetadata = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.retail.v2.SetInventoryMetadata").msgclass - SetInventoryResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.retail.v2.SetInventoryResponse").msgclass - AddFulfillmentPlacesRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.retail.v2.AddFulfillmentPlacesRequest").msgclass - AddFulfillmentPlacesMetadata = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.retail.v2.AddFulfillmentPlacesMetadata").msgclass - AddFulfillmentPlacesResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.retail.v2.AddFulfillmentPlacesResponse").msgclass - AddLocalInventoriesRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.retail.v2.AddLocalInventoriesRequest").msgclass - AddLocalInventoriesMetadata = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.retail.v2.AddLocalInventoriesMetadata").msgclass - AddLocalInventoriesResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.retail.v2.AddLocalInventoriesResponse").msgclass - RemoveLocalInventoriesRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.retail.v2.RemoveLocalInventoriesRequest").msgclass - RemoveLocalInventoriesMetadata = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.retail.v2.RemoveLocalInventoriesMetadata").msgclass - RemoveLocalInventoriesResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.retail.v2.RemoveLocalInventoriesResponse").msgclass - RemoveFulfillmentPlacesRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.retail.v2.RemoveFulfillmentPlacesRequest").msgclass - RemoveFulfillmentPlacesMetadata = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.retail.v2.RemoveFulfillmentPlacesMetadata").msgclass - RemoveFulfillmentPlacesResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.retail.v2.RemoveFulfillmentPlacesResponse").msgclass - end - end - end -end diff --git a/owl-bot-staging/google-cloud-retail-v2/lib/google/cloud/retail/v2/product_service_services_pb.rb b/owl-bot-staging/google-cloud-retail-v2/lib/google/cloud/retail/v2/product_service_services_pb.rb deleted file mode 100644 index 5ae098e9d214..000000000000 --- a/owl-bot-staging/google-cloud-retail-v2/lib/google/cloud/retail/v2/product_service_services_pb.rb +++ /dev/null @@ -1,248 +0,0 @@ -# Generated by the protocol buffer compiler. DO NOT EDIT! -# Source: google/cloud/retail/v2/product_service.proto for package 'Google.Cloud.Retail.V2' -# Original file comments: -# 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 -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. -# - -require 'grpc' -require 'google/cloud/retail/v2/product_service_pb' - -module Google - module Cloud - module Retail - module V2 - module ProductService - # Service for ingesting [Product][google.cloud.retail.v2.Product] information - # of the customer's website. - class Service - - include ::GRPC::GenericService - - self.marshal_class_method = :encode - self.unmarshal_class_method = :decode - self.service_name = 'google.cloud.retail.v2.ProductService' - - # Creates a [Product][google.cloud.retail.v2.Product]. - rpc :CreateProduct, ::Google::Cloud::Retail::V2::CreateProductRequest, ::Google::Cloud::Retail::V2::Product - # Gets a [Product][google.cloud.retail.v2.Product]. - rpc :GetProduct, ::Google::Cloud::Retail::V2::GetProductRequest, ::Google::Cloud::Retail::V2::Product - # Gets a list of [Product][google.cloud.retail.v2.Product]s. - rpc :ListProducts, ::Google::Cloud::Retail::V2::ListProductsRequest, ::Google::Cloud::Retail::V2::ListProductsResponse - # Updates a [Product][google.cloud.retail.v2.Product]. - rpc :UpdateProduct, ::Google::Cloud::Retail::V2::UpdateProductRequest, ::Google::Cloud::Retail::V2::Product - # Deletes a [Product][google.cloud.retail.v2.Product]. - rpc :DeleteProduct, ::Google::Cloud::Retail::V2::DeleteProductRequest, ::Google::Protobuf::Empty - # Permanently deletes all selected [Product][google.cloud.retail.v2.Product]s - # under a branch. - # - # This process is asynchronous. If the request is valid, the removal will be - # enqueued and processed offline. Depending on the number of - # [Product][google.cloud.retail.v2.Product]s, this operation could take hours - # to complete. Before the operation completes, some - # [Product][google.cloud.retail.v2.Product]s may still be returned by - # [ProductService.GetProduct][google.cloud.retail.v2.ProductService.GetProduct] - # or - # [ProductService.ListProducts][google.cloud.retail.v2.ProductService.ListProducts]. - # - # Depending on the number of [Product][google.cloud.retail.v2.Product]s, this - # operation could take hours to complete. To get a sample of - # [Product][google.cloud.retail.v2.Product]s that would be deleted, set - # [PurgeProductsRequest.force][google.cloud.retail.v2.PurgeProductsRequest.force] - # to false. - rpc :PurgeProducts, ::Google::Cloud::Retail::V2::PurgeProductsRequest, ::Google::Longrunning::Operation - # Bulk import of multiple [Product][google.cloud.retail.v2.Product]s. - # - # Request processing may be synchronous. - # Non-existing items are created. - # - # Note that it is possible for a subset of the - # [Product][google.cloud.retail.v2.Product]s to be successfully updated. - rpc :ImportProducts, ::Google::Cloud::Retail::V2::ImportProductsRequest, ::Google::Longrunning::Operation - # Updates inventory information for a - # [Product][google.cloud.retail.v2.Product] while respecting the last update - # timestamps of each inventory field. - # - # This process is asynchronous and does not require the - # [Product][google.cloud.retail.v2.Product] to exist before updating - # fulfillment information. If the request is valid, the update is enqueued - # and processed downstream. As a consequence, when a response is returned, - # updates are not immediately manifested in the - # [Product][google.cloud.retail.v2.Product] queried by - # [ProductService.GetProduct][google.cloud.retail.v2.ProductService.GetProduct] - # or - # [ProductService.ListProducts][google.cloud.retail.v2.ProductService.ListProducts]. - # - # When inventory is updated with - # [ProductService.CreateProduct][google.cloud.retail.v2.ProductService.CreateProduct] - # and - # [ProductService.UpdateProduct][google.cloud.retail.v2.ProductService.UpdateProduct], - # the specified inventory field value(s) overwrite any existing value(s) - # while ignoring the last update time for this field. Furthermore, the last - # update times for the specified inventory fields are overwritten by the - # times of the - # [ProductService.CreateProduct][google.cloud.retail.v2.ProductService.CreateProduct] - # or - # [ProductService.UpdateProduct][google.cloud.retail.v2.ProductService.UpdateProduct] - # request. - # - # If no inventory fields are set in - # [CreateProductRequest.product][google.cloud.retail.v2.CreateProductRequest.product], - # then any pre-existing inventory information for this product is used. - # - # If no inventory fields are set in - # [SetInventoryRequest.set_mask][google.cloud.retail.v2.SetInventoryRequest.set_mask], - # then any existing inventory information is preserved. - # - # Pre-existing inventory information can only be updated with - # [ProductService.SetInventory][google.cloud.retail.v2.ProductService.SetInventory], - # [ProductService.AddFulfillmentPlaces][google.cloud.retail.v2.ProductService.AddFulfillmentPlaces], - # and - # [ProductService.RemoveFulfillmentPlaces][google.cloud.retail.v2.ProductService.RemoveFulfillmentPlaces]. - # - # The returned [Operation][google.longrunning.Operation]s is obsolete after - # one day, and the [GetOperation][google.longrunning.Operations.GetOperation] - # API returns `NOT_FOUND` afterwards. - # - # If conflicting updates are issued, the - # [Operation][google.longrunning.Operation]s associated with the stale - # updates are not marked as [done][google.longrunning.Operation.done] until - # they are obsolete. - rpc :SetInventory, ::Google::Cloud::Retail::V2::SetInventoryRequest, ::Google::Longrunning::Operation - # We recommend that you use the - # [ProductService.AddLocalInventories][google.cloud.retail.v2.ProductService.AddLocalInventories] - # method instead of the - # [ProductService.AddFulfillmentPlaces][google.cloud.retail.v2.ProductService.AddFulfillmentPlaces] - # method. - # [ProductService.AddLocalInventories][google.cloud.retail.v2.ProductService.AddLocalInventories] - # achieves the same results but provides more fine-grained control over - # ingesting local inventory data. - # - # Incrementally adds place IDs to - # [Product.fulfillment_info.place_ids][google.cloud.retail.v2.FulfillmentInfo.place_ids]. - # - # This process is asynchronous and does not require the - # [Product][google.cloud.retail.v2.Product] to exist before updating - # fulfillment information. If the request is valid, the update will be - # enqueued and processed downstream. As a consequence, when a response is - # returned, the added place IDs are not immediately manifested in the - # [Product][google.cloud.retail.v2.Product] queried by - # [ProductService.GetProduct][google.cloud.retail.v2.ProductService.GetProduct] - # or - # [ProductService.ListProducts][google.cloud.retail.v2.ProductService.ListProducts]. - # - # The returned [Operation][google.longrunning.Operation]s will be obsolete - # after 1 day, and [GetOperation][google.longrunning.Operations.GetOperation] - # API will return NOT_FOUND afterwards. - # - # If conflicting updates are issued, the - # [Operation][google.longrunning.Operation]s associated with the stale - # updates will not be marked as [done][google.longrunning.Operation.done] - # until being obsolete. - rpc :AddFulfillmentPlaces, ::Google::Cloud::Retail::V2::AddFulfillmentPlacesRequest, ::Google::Longrunning::Operation - # We recommend that you use the - # [ProductService.RemoveLocalInventories][google.cloud.retail.v2.ProductService.RemoveLocalInventories] - # method instead of the - # [ProductService.RemoveFulfillmentPlaces][google.cloud.retail.v2.ProductService.RemoveFulfillmentPlaces] - # method. - # [ProductService.RemoveLocalInventories][google.cloud.retail.v2.ProductService.RemoveLocalInventories] - # achieves the same results but provides more fine-grained control over - # ingesting local inventory data. - # - # Incrementally removes place IDs from a - # [Product.fulfillment_info.place_ids][google.cloud.retail.v2.FulfillmentInfo.place_ids]. - # - # This process is asynchronous and does not require the - # [Product][google.cloud.retail.v2.Product] to exist before updating - # fulfillment information. If the request is valid, the update will be - # enqueued and processed downstream. As a consequence, when a response is - # returned, the removed place IDs are not immediately manifested in the - # [Product][google.cloud.retail.v2.Product] queried by - # [ProductService.GetProduct][google.cloud.retail.v2.ProductService.GetProduct] - # or - # [ProductService.ListProducts][google.cloud.retail.v2.ProductService.ListProducts]. - # - # The returned [Operation][google.longrunning.Operation]s will be obsolete - # after 1 day, and [GetOperation][google.longrunning.Operations.GetOperation] - # API will return NOT_FOUND afterwards. - # - # If conflicting updates are issued, the - # [Operation][google.longrunning.Operation]s associated with the stale - # updates will not be marked as [done][google.longrunning.Operation.done] - # until being obsolete. - rpc :RemoveFulfillmentPlaces, ::Google::Cloud::Retail::V2::RemoveFulfillmentPlacesRequest, ::Google::Longrunning::Operation - # Updates local inventory information for a - # [Product][google.cloud.retail.v2.Product] at a list of places, while - # respecting the last update timestamps of each inventory field. - # - # This process is asynchronous and does not require the - # [Product][google.cloud.retail.v2.Product] to exist before updating - # inventory information. If the request is valid, the update will be enqueued - # and processed downstream. As a consequence, when a response is returned, - # updates are not immediately manifested in the - # [Product][google.cloud.retail.v2.Product] queried by - # [ProductService.GetProduct][google.cloud.retail.v2.ProductService.GetProduct] - # or - # [ProductService.ListProducts][google.cloud.retail.v2.ProductService.ListProducts]. - # - # Local inventory information can only be modified using this method. - # [ProductService.CreateProduct][google.cloud.retail.v2.ProductService.CreateProduct] - # and - # [ProductService.UpdateProduct][google.cloud.retail.v2.ProductService.UpdateProduct] - # has no effect on local inventories. - # - # The returned [Operation][google.longrunning.Operation]s will be obsolete - # after 1 day, and [GetOperation][google.longrunning.Operations.GetOperation] - # API will return NOT_FOUND afterwards. - # - # If conflicting updates are issued, the - # [Operation][google.longrunning.Operation]s associated with the stale - # updates will not be marked as [done][google.longrunning.Operation.done] - # until being obsolete. - rpc :AddLocalInventories, ::Google::Cloud::Retail::V2::AddLocalInventoriesRequest, ::Google::Longrunning::Operation - # Remove local inventory information for a - # [Product][google.cloud.retail.v2.Product] at a list of places at a removal - # timestamp. - # - # This process is asynchronous. If the request is valid, the removal will be - # enqueued and processed downstream. As a consequence, when a response is - # returned, removals are not immediately manifested in the - # [Product][google.cloud.retail.v2.Product] queried by - # [ProductService.GetProduct][google.cloud.retail.v2.ProductService.GetProduct] - # or - # [ProductService.ListProducts][google.cloud.retail.v2.ProductService.ListProducts]. - # - # Local inventory information can only be removed using this method. - # [ProductService.CreateProduct][google.cloud.retail.v2.ProductService.CreateProduct] - # and - # [ProductService.UpdateProduct][google.cloud.retail.v2.ProductService.UpdateProduct] - # has no effect on local inventories. - # - # The returned [Operation][google.longrunning.Operation]s will be obsolete - # after 1 day, and [GetOperation][google.longrunning.Operations.GetOperation] - # API will return NOT_FOUND afterwards. - # - # If conflicting updates are issued, the - # [Operation][google.longrunning.Operation]s associated with the stale - # updates will not be marked as [done][google.longrunning.Operation.done] - # until being obsolete. - rpc :RemoveLocalInventories, ::Google::Cloud::Retail::V2::RemoveLocalInventoriesRequest, ::Google::Longrunning::Operation - end - - Stub = Service.rpc_stub_class - end - end - end - end -end diff --git a/owl-bot-staging/google-cloud-retail-v2/lib/google/cloud/retail/v2/promotion_pb.rb b/owl-bot-staging/google-cloud-retail-v2/lib/google/cloud/retail/v2/promotion_pb.rb deleted file mode 100644 index ae0f81f377b7..000000000000 --- a/owl-bot-staging/google-cloud-retail-v2/lib/google/cloud/retail/v2/promotion_pb.rb +++ /dev/null @@ -1,21 +0,0 @@ -# frozen_string_literal: true -# Generated by the protocol buffer compiler. DO NOT EDIT! -# source: google/cloud/retail/v2/promotion.proto - -require 'google/protobuf' - - -descriptor_data = "\n&google/cloud/retail/v2/promotion.proto\x12\x16google.cloud.retail.v2\"!\n\tPromotion\x12\x14\n\x0cpromotion_id\x18\x01 \x01(\tB\xb9\x01\n\x1a\x63om.google.cloud.retail.v2B\x0ePromotionProtoP\x01Z2cloud.google.com/go/retail/apiv2/retailpb;retailpb\xa2\x02\x06RETAIL\xaa\x02\x16Google.Cloud.Retail.V2\xca\x02\x16Google\\Cloud\\Retail\\V2\xea\x02\x19Google::Cloud::Retail::V2b\x06proto3" - -pool = ::Google::Protobuf::DescriptorPool.generated_pool -pool.add_serialized_file(descriptor_data) - -module Google - module Cloud - module Retail - module V2 - Promotion = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.retail.v2.Promotion").msgclass - end - end - end -end diff --git a/owl-bot-staging/google-cloud-retail-v2/lib/google/cloud/retail/v2/purge_config_pb.rb b/owl-bot-staging/google-cloud-retail-v2/lib/google/cloud/retail/v2/purge_config_pb.rb deleted file mode 100644 index 786696cf2180..000000000000 --- a/owl-bot-staging/google-cloud-retail-v2/lib/google/cloud/retail/v2/purge_config_pb.rb +++ /dev/null @@ -1,30 +0,0 @@ -# frozen_string_literal: true -# Generated by the protocol buffer compiler. DO NOT EDIT! -# source: google/cloud/retail/v2/purge_config.proto - -require 'google/protobuf' - -require 'google/api/field_behavior_pb' -require 'google/api/resource_pb' -require 'google/protobuf/timestamp_pb' - - -descriptor_data = "\n)google/cloud/retail/v2/purge_config.proto\x12\x16google.cloud.retail.v2\x1a\x1fgoogle/api/field_behavior.proto\x1a\x19google/api/resource.proto\x1a\x1fgoogle/protobuf/timestamp.proto\"\x0f\n\rPurgeMetadata\"\xa7\x01\n\x15PurgeProductsMetadata\x12/\n\x0b\x63reate_time\x18\x01 \x01(\x0b\x32\x1a.google.protobuf.Timestamp\x12/\n\x0bupdate_time\x18\x02 \x01(\x0b\x32\x1a.google.protobuf.Timestamp\x12\x15\n\rsuccess_count\x18\x03 \x01(\x03\x12\x15\n\rfailure_count\x18\x04 \x01(\x03\"p\n\x14PurgeProductsRequest\x12\x34\n\x06parent\x18\x01 \x01(\tB$\xe0\x41\x02\xfa\x41\x1e\n\x1cretail.googleapis.com/Branch\x12\x13\n\x06\x66ilter\x18\x02 \x01(\tB\x03\xe0\x41\x02\x12\r\n\x05\x66orce\x18\x03 \x01(\x08\"f\n\x15PurgeProductsResponse\x12\x13\n\x0bpurge_count\x18\x01 \x01(\x03\x12\x38\n\x0cpurge_sample\x18\x02 \x03(\tB\"\xfa\x41\x1f\n\x1dretail.googleapis.com/Product\"s\n\x16PurgeUserEventsRequest\x12\x35\n\x06parent\x18\x01 \x01(\tB%\xe0\x41\x02\xfa\x41\x1f\n\x1dretail.googleapis.com/Catalog\x12\x13\n\x06\x66ilter\x18\x02 \x01(\tB\x03\xe0\x41\x02\x12\r\n\x05\x66orce\x18\x03 \x01(\x08\"6\n\x17PurgeUserEventsResponse\x12\x1b\n\x13purged_events_count\x18\x01 \x01(\x03\x42\xbb\x01\n\x1a\x63om.google.cloud.retail.v2B\x10PurgeConfigProtoP\x01Z2cloud.google.com/go/retail/apiv2/retailpb;retailpb\xa2\x02\x06RETAIL\xaa\x02\x16Google.Cloud.Retail.V2\xca\x02\x16Google\\Cloud\\Retail\\V2\xea\x02\x19Google::Cloud::Retail::V2b\x06proto3" - -pool = ::Google::Protobuf::DescriptorPool.generated_pool -pool.add_serialized_file(descriptor_data) - -module Google - module Cloud - module Retail - module V2 - PurgeMetadata = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.retail.v2.PurgeMetadata").msgclass - PurgeProductsMetadata = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.retail.v2.PurgeProductsMetadata").msgclass - PurgeProductsRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.retail.v2.PurgeProductsRequest").msgclass - PurgeProductsResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.retail.v2.PurgeProductsResponse").msgclass - PurgeUserEventsRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.retail.v2.PurgeUserEventsRequest").msgclass - PurgeUserEventsResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.retail.v2.PurgeUserEventsResponse").msgclass - end - end - end -end diff --git a/owl-bot-staging/google-cloud-retail-v2/lib/google/cloud/retail/v2/rest.rb b/owl-bot-staging/google-cloud-retail-v2/lib/google/cloud/retail/v2/rest.rb deleted file mode 100644 index 47b06c36e7ba..000000000000 --- a/owl-bot-staging/google-cloud-retail-v2/lib/google/cloud/retail/v2/rest.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! - -require "google/cloud/retail/v2/analytics_service/rest" -require "google/cloud/retail/v2/catalog_service/rest" -require "google/cloud/retail/v2/completion_service/rest" -require "google/cloud/retail/v2/control_service/rest" -require "google/cloud/retail/v2/search_service/rest" -require "google/cloud/retail/v2/conversational_search_service/rest" -require "google/cloud/retail/v2/generative_question_service/rest" -require "google/cloud/retail/v2/model_service/rest" -require "google/cloud/retail/v2/prediction_service/rest" -require "google/cloud/retail/v2/product_service/rest" -require "google/cloud/retail/v2/serving_config_service/rest" -require "google/cloud/retail/v2/user_event_service/rest" -require "google/cloud/retail/v2/version" - -module Google - module Cloud - module Retail - ## - # To load just the REST part of this package, including all its services, and instantiate a REST client: - # - # @example - # - # require "google/cloud/retail/v2/rest" - # client = ::Google::Cloud::Retail::V2::AnalyticsService::Rest::Client.new - # - module V2 - end - end - end -end diff --git a/owl-bot-staging/google-cloud-retail-v2/lib/google/cloud/retail/v2/safety_pb.rb b/owl-bot-staging/google-cloud-retail-v2/lib/google/cloud/retail/v2/safety_pb.rb deleted file mode 100644 index 9cf4cbf18eaa..000000000000 --- a/owl-bot-staging/google-cloud-retail-v2/lib/google/cloud/retail/v2/safety_pb.rb +++ /dev/null @@ -1,26 +0,0 @@ -# frozen_string_literal: true -# Generated by the protocol buffer compiler. DO NOT EDIT! -# source: google/cloud/retail/v2/safety.proto - -require 'google/protobuf' - -require 'google/api/field_behavior_pb' - - -descriptor_data = "\n#google/cloud/retail/v2/safety.proto\x12\x16google.cloud.retail.v2\x1a\x1fgoogle/api/field_behavior.proto\"\xd5\x03\n\rSafetySetting\x12\x36\n\x08\x63\x61tegory\x18\x01 \x01(\x0e\x32$.google.cloud.retail.v2.HarmCategory\x12K\n\tthreshold\x18\x02 \x01(\x0e\x32\x38.google.cloud.retail.v2.SafetySetting.HarmBlockThreshold\x12J\n\x06method\x18\x03 \x01(\x0e\x32\x35.google.cloud.retail.v2.SafetySetting.HarmBlockMethodB\x03\xe0\x41\x01\"\x9d\x01\n\x12HarmBlockThreshold\x12$\n HARM_BLOCK_THRESHOLD_UNSPECIFIED\x10\x00\x12\x17\n\x13\x42LOCK_LOW_AND_ABOVE\x10\x01\x12\x1a\n\x16\x42LOCK_MEDIUM_AND_ABOVE\x10\x02\x12\x13\n\x0f\x42LOCK_ONLY_HIGH\x10\x03\x12\x0e\n\nBLOCK_NONE\x10\x04\x12\x07\n\x03OFF\x10\x05\"S\n\x0fHarmBlockMethod\x12!\n\x1dHARM_BLOCK_METHOD_UNSPECIFIED\x10\x00\x12\x0c\n\x08SEVERITY\x10\x01\x12\x0f\n\x0bPROBABILITY\x10\x02*\xd7\x01\n\x0cHarmCategory\x12\x1d\n\x19HARM_CATEGORY_UNSPECIFIED\x10\x00\x12\x1d\n\x19HARM_CATEGORY_HATE_SPEECH\x10\x01\x12#\n\x1fHARM_CATEGORY_DANGEROUS_CONTENT\x10\x02\x12\x1c\n\x18HARM_CATEGORY_HARASSMENT\x10\x03\x12#\n\x1fHARM_CATEGORY_SEXUALLY_EXPLICIT\x10\x04\x12!\n\x1dHARM_CATEGORY_CIVIC_INTEGRITY\x10\x05\x42\xb6\x01\n\x1a\x63om.google.cloud.retail.v2B\x0bSafetyProtoP\x01Z2cloud.google.com/go/retail/apiv2/retailpb;retailpb\xa2\x02\x06RETAIL\xaa\x02\x16Google.Cloud.Retail.V2\xca\x02\x16Google\\Cloud\\Retail\\V2\xea\x02\x19Google::Cloud::Retail::V2b\x06proto3" - -pool = ::Google::Protobuf::DescriptorPool.generated_pool -pool.add_serialized_file(descriptor_data) - -module Google - module Cloud - module Retail - module V2 - SafetySetting = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.retail.v2.SafetySetting").msgclass - SafetySetting::HarmBlockThreshold = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.retail.v2.SafetySetting.HarmBlockThreshold").enummodule - SafetySetting::HarmBlockMethod = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.retail.v2.SafetySetting.HarmBlockMethod").enummodule - HarmCategory = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.retail.v2.HarmCategory").enummodule - end - end - end -end diff --git a/owl-bot-staging/google-cloud-retail-v2/lib/google/cloud/retail/v2/search_service.rb b/owl-bot-staging/google-cloud-retail-v2/lib/google/cloud/retail/v2/search_service.rb deleted file mode 100644 index dae214f30163..000000000000 --- a/owl-bot-staging/google-cloud-retail-v2/lib/google/cloud/retail/v2/search_service.rb +++ /dev/null @@ -1,58 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -require "gapic/common" -require "gapic/config" -require "gapic/config/method" - -require "google/cloud/retail/v2/version" - -require "google/cloud/retail/v2/search_service/credentials" -require "google/cloud/retail/v2/search_service/paths" -require "google/cloud/retail/v2/search_service/client" -require "google/cloud/retail/v2/search_service/rest" - -module Google - module Cloud - module Retail - module V2 - ## - # Service for search. - # - # This feature is only available for users who have Retail Search enabled. - # Enable Retail Search on Cloud Console before using this feature. - # - # @example Load this service and instantiate a gRPC client - # - # require "google/cloud/retail/v2/search_service" - # client = ::Google::Cloud::Retail::V2::SearchService::Client.new - # - # @example Load this service and instantiate a REST client - # - # require "google/cloud/retail/v2/search_service/rest" - # client = ::Google::Cloud::Retail::V2::SearchService::Rest::Client.new - # - module SearchService - end - end - end - end -end - -helper_path = ::File.join __dir__, "search_service", "helpers.rb" -require "google/cloud/retail/v2/search_service/helpers" if ::File.file? helper_path diff --git a/owl-bot-staging/google-cloud-retail-v2/lib/google/cloud/retail/v2/search_service/client.rb b/owl-bot-staging/google-cloud-retail-v2/lib/google/cloud/retail/v2/search_service/client.rb deleted file mode 100644 index 8c7193d8f5c0..000000000000 --- a/owl-bot-staging/google-cloud-retail-v2/lib/google/cloud/retail/v2/search_service/client.rb +++ /dev/null @@ -1,787 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -require "google/cloud/errors" -require "google/cloud/retail/v2/search_service_pb" -require "google/cloud/location" - -module Google - module Cloud - module Retail - module V2 - module SearchService - ## - # Client for the SearchService service. - # - # Service for search. - # - # This feature is only available for users who have Retail Search enabled. - # Enable Retail Search on Cloud Console before using this feature. - # - class Client - # @private - API_VERSION = "" - - # @private - DEFAULT_ENDPOINT_TEMPLATE = "retail.$UNIVERSE_DOMAIN$" - - include Paths - - # @private - attr_reader :search_service_stub - - ## - # Configure the SearchService Client class. - # - # See {::Google::Cloud::Retail::V2::SearchService::Client::Configuration} - # for a description of the configuration fields. - # - # @example - # - # # Modify the configuration for all SearchService clients - # ::Google::Cloud::Retail::V2::SearchService::Client.configure do |config| - # config.timeout = 10.0 - # end - # - # @yield [config] Configure the Client client. - # @yieldparam config [Client::Configuration] - # - # @return [Client::Configuration] - # - def self.configure - @configure ||= begin - namespace = ["Google", "Cloud", "Retail", "V2"] - parent_config = while namespace.any? - parent_name = namespace.join "::" - parent_const = const_get parent_name - break parent_const.configure if parent_const.respond_to? :configure - namespace.pop - end - default_config = Client::Configuration.new parent_config - - default_config.timeout = 5.0 - default_config.retry_policy = { - initial_delay: 0.1, max_delay: 5.0, multiplier: 1.3, retry_codes: [14, 4] - } - - default_config - end - yield @configure if block_given? - @configure - end - - ## - # Configure the SearchService Client instance. - # - # The configuration is set to the derived mode, meaning that values can be changed, - # but structural changes (adding new fields, etc.) are not allowed. Structural changes - # should be made on {Client.configure}. - # - # See {::Google::Cloud::Retail::V2::SearchService::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 - @search_service_stub.universe_domain - end - - ## - # Create a new SearchService client object. - # - # @example - # - # # Create a client using the default configuration - # client = ::Google::Cloud::Retail::V2::SearchService::Client.new - # - # # Create a client using a custom configuration - # client = ::Google::Cloud::Retail::V2::SearchService::Client.new do |config| - # config.timeout = 10.0 - # end - # - # @yield [config] Configure the SearchService client. - # @yieldparam config [Client::Configuration] - # - def initialize - # These require statements are intentionally placed here to initialize - # the gRPC module only when it's required. - # See https://github.com/googleapis/toolkit/issues/446 - require "gapic/grpc" - require "google/cloud/retail/v2/search_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 - - @search_service_stub = ::Gapic::ServiceStub.new( - ::Google::Cloud::Retail::V2::SearchService::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 - ) - - @search_service_stub.stub_logger&.info do |entry| - entry.set_system_name - entry.set_service - entry.message = "Created client for #{entry.service}" - entry.set_credentials_fields credentials - entry.set "customEndpoint", @config.endpoint if @config.endpoint - entry.set "defaultTimeout", @config.timeout if @config.timeout - entry.set "quotaProject", @quota_project_id if @quota_project_id - end - - @location_client = Google::Cloud::Location::Locations::Client.new do |config| - config.credentials = credentials - config.quota_project = @quota_project_id - config.endpoint = @search_service_stub.endpoint - config.universe_domain = @search_service_stub.universe_domain - config.logger = @search_service_stub.logger if config.respond_to? :logger= - end - end - - ## - # Get the associated client for mix-in of the Locations. - # - # @return [Google::Cloud::Location::Locations::Client] - # - attr_reader :location_client - - ## - # The logger used for request/response debug logging. - # - # @return [Logger] - # - def logger - @search_service_stub.logger - end - - # Service calls - - ## - # Performs a search. - # - # This feature is only available for users who have Retail Search enabled. - # Enable Retail Search on Cloud Console before using this feature. - # - # @overload search(request, options = nil) - # Pass arguments to `search` via a request object, either of type - # {::Google::Cloud::Retail::V2::SearchRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Retail::V2::SearchRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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(placement: nil, branch: nil, query: nil, visitor_id: nil, user_info: nil, page_size: nil, page_token: nil, offset: nil, filter: nil, canonical_filter: nil, order_by: nil, facet_specs: nil, dynamic_facet_spec: nil, boost_spec: nil, query_expansion_spec: nil, variant_rollup_keys: nil, page_categories: nil, search_mode: nil, personalization_spec: nil, labels: nil, spell_correction_spec: nil, entity: nil, conversational_search_spec: nil, tile_navigation_spec: nil, language_code: nil, region_code: nil, place_id: nil, user_attributes: nil) - # Pass arguments to `search` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param placement [::String] - # Required. The resource name of the Retail Search serving config, such as - # `projects/*/locations/global/catalogs/default_catalog/servingConfigs/default_serving_config` - # or the name of the legacy placement resource, such as - # `projects/*/locations/global/catalogs/default_catalog/placements/default_search`. - # This field is used to identify the serving config name and the set - # of models that are used to make the search. - # @param branch [::String] - # The branch resource name, such as - # `projects/*/locations/global/catalogs/default_catalog/branches/0`. - # - # Use "default_branch" as the branch ID or leave this field empty, to search - # products under the default branch. - # @param query [::String] - # Raw search query. - # - # If this field is empty, the request is considered a category browsing - # request and returned results are based on - # {::Google::Cloud::Retail::V2::SearchRequest#filter filter} and - # {::Google::Cloud::Retail::V2::SearchRequest#page_categories page_categories}. - # @param visitor_id [::String] - # Required. A unique identifier for tracking visitors. For example, this - # could be implemented with an HTTP cookie, which should be able to uniquely - # identify a visitor on a single device. This unique identifier should not - # change if the visitor logs in or out of the website. - # - # This should be the same identifier as - # {::Google::Cloud::Retail::V2::UserEvent#visitor_id UserEvent.visitor_id}. - # - # The field must be a UTF-8 encoded string with a length limit of 128 - # characters. Otherwise, an INVALID_ARGUMENT error is returned. - # @param user_info [::Google::Cloud::Retail::V2::UserInfo, ::Hash] - # User information. - # @param page_size [::Integer] - # Maximum number of {::Google::Cloud::Retail::V2::Product Product}s to return. If - # unspecified, defaults to a reasonable value. The maximum allowed value is - # 120. Values above 120 will be coerced to 120. - # - # If this field is negative, an INVALID_ARGUMENT is returned. - # @param page_token [::String] - # A page token - # {::Google::Cloud::Retail::V2::SearchResponse#next_page_token SearchResponse.next_page_token}, - # received from a previous - # {::Google::Cloud::Retail::V2::SearchService::Client#search SearchService.Search} call. - # Provide this to retrieve the subsequent page. - # - # When paginating, all other parameters provided to - # {::Google::Cloud::Retail::V2::SearchService::Client#search SearchService.Search} must - # match the call that provided the page token. Otherwise, an INVALID_ARGUMENT - # error is returned. - # @param offset [::Integer] - # A 0-indexed integer that specifies the current offset (that is, starting - # result location, amongst the {::Google::Cloud::Retail::V2::Product Product}s - # deemed by the API as relevant) in search results. This field is only - # considered if {::Google::Cloud::Retail::V2::SearchRequest#page_token page_token} - # is unset. - # - # If this field is negative, an INVALID_ARGUMENT is returned. - # @param filter [::String] - # The filter syntax consists of an expression language for constructing a - # predicate from one or more fields of the products being filtered. Filter - # expression is case-sensitive. For more information, see - # [Filter](https://cloud.google.com/retail/docs/filter-and-order#filter). - # - # If this field is unrecognizable, an INVALID_ARGUMENT is returned. - # @param canonical_filter [::String] - # The default filter that is applied when a user performs a search without - # checking any filters on the search page. - # - # The filter applied to every search request when quality improvement such as - # query expansion is needed. In the case a query does not have a sufficient - # amount of results this filter will be used to determine whether or not to - # enable the query expansion flow. The original filter will still be used for - # the query expanded search. - # This field is strongly recommended to achieve high search quality. - # - # For more information about filter syntax, see - # {::Google::Cloud::Retail::V2::SearchRequest#filter SearchRequest.filter}. - # @param order_by [::String] - # The order in which products are returned. Products can be ordered by - # a field in an {::Google::Cloud::Retail::V2::Product Product} object. Leave it - # unset if ordered by relevance. OrderBy expression is case-sensitive. For - # more information, see - # [Order](https://cloud.google.com/retail/docs/filter-and-order#order). - # - # If this field is unrecognizable, an INVALID_ARGUMENT is returned. - # @param facet_specs [::Array<::Google::Cloud::Retail::V2::SearchRequest::FacetSpec, ::Hash>] - # Facet specifications for faceted search. If empty, no facets are returned. - # - # A maximum of 200 values are allowed. Otherwise, an INVALID_ARGUMENT error - # is returned. - # @param dynamic_facet_spec [::Google::Cloud::Retail::V2::SearchRequest::DynamicFacetSpec, ::Hash] - # Deprecated. Refer to https://cloud.google.com/retail/docs/configs#dynamic - # to enable dynamic facets. Do not set this field. - # - # The specification for dynamically generated facets. Notice that only - # textual facets can be dynamically generated. - # @param boost_spec [::Google::Cloud::Retail::V2::SearchRequest::BoostSpec, ::Hash] - # Boost specification to boost certain products. For more information, see - # [Boost results](https://cloud.google.com/retail/docs/boosting). - # - # Notice that if both - # {::Google::Cloud::Retail::V2::ServingConfig#boost_control_ids ServingConfig.boost_control_ids} - # and - # {::Google::Cloud::Retail::V2::SearchRequest#boost_spec SearchRequest.boost_spec} - # are set, the boost conditions from both places are evaluated. If a search - # request matches multiple boost conditions, the final boost score is equal - # to the sum of the boost scores from all matched boost conditions. - # @param query_expansion_spec [::Google::Cloud::Retail::V2::SearchRequest::QueryExpansionSpec, ::Hash] - # The query expansion specification that specifies the conditions under which - # query expansion occurs. For more information, see [Query - # expansion](https://cloud.google.com/retail/docs/result-size#query_expansion). - # @param variant_rollup_keys [::Array<::String>] - # The keys to fetch and rollup the matching - # {::Google::Cloud::Retail::V2::Product::Type::VARIANT variant} - # {::Google::Cloud::Retail::V2::Product Product}s attributes, - # {::Google::Cloud::Retail::V2::FulfillmentInfo FulfillmentInfo} or - # {::Google::Cloud::Retail::V2::LocalInventory LocalInventory}s attributes. The - # attributes from all the matching - # {::Google::Cloud::Retail::V2::Product::Type::VARIANT variant} - # {::Google::Cloud::Retail::V2::Product Product}s or - # {::Google::Cloud::Retail::V2::LocalInventory LocalInventory}s are merged and - # de-duplicated. Notice that rollup attributes will lead to extra query - # latency. Maximum number of keys is 30. - # - # For {::Google::Cloud::Retail::V2::FulfillmentInfo FulfillmentInfo}, a - # fulfillment type and a fulfillment ID must be provided in the format of - # "fulfillmentType.fulfillmentId". E.g., in "pickupInStore.store123", - # "pickupInStore" is fulfillment type and "store123" is the store ID. - # - # Supported keys are: - # - # * colorFamilies - # * price - # * originalPrice - # * discount - # * variantId - # * inventory(place_id,price) - # * inventory(place_id,original_price) - # * inventory(place_id,attributes.key), where key is any key in the - # {::Google::Cloud::Retail::V2::LocalInventory#attributes Product.local_inventories.attributes} - # map. - # * attributes.key, where key is any key in the - # {::Google::Cloud::Retail::V2::Product#attributes Product.attributes} map. - # * pickupInStore.id, where id is any - # {::Google::Cloud::Retail::V2::FulfillmentInfo#place_ids FulfillmentInfo.place_ids} - # for {::Google::Cloud::Retail::V2::FulfillmentInfo#type FulfillmentInfo.type} - # "pickup-in-store". - # * shipToStore.id, where id is any - # {::Google::Cloud::Retail::V2::FulfillmentInfo#place_ids FulfillmentInfo.place_ids} - # for {::Google::Cloud::Retail::V2::FulfillmentInfo#type FulfillmentInfo.type} - # "ship-to-store". - # * sameDayDelivery.id, where id is any - # {::Google::Cloud::Retail::V2::FulfillmentInfo#place_ids FulfillmentInfo.place_ids} - # for {::Google::Cloud::Retail::V2::FulfillmentInfo#type FulfillmentInfo.type} - # "same-day-delivery". - # * nextDayDelivery.id, where id is any - # {::Google::Cloud::Retail::V2::FulfillmentInfo#place_ids FulfillmentInfo.place_ids} - # for {::Google::Cloud::Retail::V2::FulfillmentInfo#type FulfillmentInfo.type} - # "next-day-delivery". - # * customFulfillment1.id, where id is any - # {::Google::Cloud::Retail::V2::FulfillmentInfo#place_ids FulfillmentInfo.place_ids} - # for {::Google::Cloud::Retail::V2::FulfillmentInfo#type FulfillmentInfo.type} - # "custom-type-1". - # * customFulfillment2.id, where id is any - # {::Google::Cloud::Retail::V2::FulfillmentInfo#place_ids FulfillmentInfo.place_ids} - # for {::Google::Cloud::Retail::V2::FulfillmentInfo#type FulfillmentInfo.type} - # "custom-type-2". - # * customFulfillment3.id, where id is any - # {::Google::Cloud::Retail::V2::FulfillmentInfo#place_ids FulfillmentInfo.place_ids} - # for {::Google::Cloud::Retail::V2::FulfillmentInfo#type FulfillmentInfo.type} - # "custom-type-3". - # * customFulfillment4.id, where id is any - # {::Google::Cloud::Retail::V2::FulfillmentInfo#place_ids FulfillmentInfo.place_ids} - # for {::Google::Cloud::Retail::V2::FulfillmentInfo#type FulfillmentInfo.type} - # "custom-type-4". - # * customFulfillment5.id, where id is any - # {::Google::Cloud::Retail::V2::FulfillmentInfo#place_ids FulfillmentInfo.place_ids} - # for {::Google::Cloud::Retail::V2::FulfillmentInfo#type FulfillmentInfo.type} - # "custom-type-5". - # - # If this field is set to an invalid value other than these, an - # INVALID_ARGUMENT error is returned. - # @param page_categories [::Array<::String>] - # The categories associated with a category page. Must be set for category - # navigation queries to achieve good search quality. The format should be - # the same as - # {::Google::Cloud::Retail::V2::UserEvent#page_categories UserEvent.page_categories}; - # - # To represent full path of category, use '>' sign to separate different - # hierarchies. If '>' is part of the category name, replace it with - # other character(s). - # - # Category pages include special pages such as sales or promotions. For - # instance, a special sale page may have the category hierarchy: - # "pageCategories" : ["Sales > 2017 Black Friday Deals"]. - # @param search_mode [::Google::Cloud::Retail::V2::SearchRequest::SearchMode] - # The search mode of the search request. If not specified, a single search - # request triggers both product search and faceted search. - # @param personalization_spec [::Google::Cloud::Retail::V2::SearchRequest::PersonalizationSpec, ::Hash] - # The specification for personalization. - # - # Notice that if both - # {::Google::Cloud::Retail::V2::ServingConfig#personalization_spec ServingConfig.personalization_spec} - # and - # {::Google::Cloud::Retail::V2::SearchRequest#personalization_spec SearchRequest.personalization_spec} - # are set. - # {::Google::Cloud::Retail::V2::SearchRequest#personalization_spec SearchRequest.personalization_spec} - # will override - # {::Google::Cloud::Retail::V2::ServingConfig#personalization_spec ServingConfig.personalization_spec}. - # @param labels [::Hash{::String => ::String}] - # The labels applied to a resource must meet the following requirements: - # - # * Each resource can have multiple labels, up to a maximum of 64. - # * Each label must be a key-value pair. - # * Keys have a minimum length of 1 character and a maximum length of 63 - # characters and cannot be empty. Values can be empty and have a maximum - # length of 63 characters. - # * Keys and values can contain only lowercase letters, numeric characters, - # underscores, and dashes. All characters must use UTF-8 encoding, and - # international characters are allowed. - # * The key portion of a label must be unique. However, you can use the same - # key with multiple resources. - # * Keys must start with a lowercase letter or international character. - # - # For more information, see [Requirements for - # labels](https://cloud.google.com/resource-manager/docs/creating-managing-labels#requirements) - # in the Resource Manager documentation. - # @param spell_correction_spec [::Google::Cloud::Retail::V2::SearchRequest::SpellCorrectionSpec, ::Hash] - # The spell correction specification that specifies the mode under - # which spell correction will take effect. - # @param entity [::String] - # The entity for customers that may run multiple different entities, domains, - # sites or regions, for example, `Google US`, `Google Ads`, `Waymo`, - # `google.com`, `youtube.com`, etc. - # If this is set, it should be exactly matched with - # {::Google::Cloud::Retail::V2::UserEvent#entity UserEvent.entity} to get search - # results boosted by entity. - # @param conversational_search_spec [::Google::Cloud::Retail::V2::SearchRequest::ConversationalSearchSpec, ::Hash] - # Optional. This field specifies all conversational related parameters - # addition to traditional retail search. - # @param tile_navigation_spec [::Google::Cloud::Retail::V2::SearchRequest::TileNavigationSpec, ::Hash] - # Optional. This field specifies tile navigation related parameters. - # @param language_code [::String] - # Optional. The BCP-47 language code, such as "en-US" or "sr-Latn" - # [list](https://www.unicode.org/cldr/charts/46/summary/root.html). For more - # information, see [Standardized codes](https://google.aip.dev/143). This - # field helps to better interpret the query. If a value isn't specified, the - # query language code is automatically detected, which may not be accurate. - # @param region_code [::String] - # Optional. The Unicode country/region code (CLDR) of a location, such as - # "US" and "419" - # [list](https://www.unicode.org/cldr/charts/46/supplemental/territory_information.html). - # For more information, see [Standardized codes](https://google.aip.dev/143). - # If set, then results will be boosted based on the region_code provided. - # @param place_id [::String] - # Optional. An id corresponding to a place, such as a store id or region id. - # When specified, we use the price from the local inventory with the matching - # product's - # {::Google::Cloud::Retail::V2::LocalInventory#place_id LocalInventory.place_id} - # for revenue optimization. - # @param user_attributes [::Hash{::String => ::Google::Cloud::Retail::V2::StringList, ::Hash}] - # Optional. The user attributes that could be used for personalization of - # search results. - # * Populate at most 100 key-value pairs per query. - # * Only supports string keys and repeated string values. - # * Duplcate keys are not allowed within a single query. - # - # Example: - # user_attributes: [ - # { key: "pets" - # value { - # values: "dog" - # values: "cat" - # } - # }, - # { key: "state" - # value { - # values: "CA" - # } - # } - # ] - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Gapic::PagedEnumerable<::Google::Cloud::Retail::V2::SearchResponse::SearchResult>] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Gapic::PagedEnumerable<::Google::Cloud::Retail::V2::SearchResponse::SearchResult>] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/cloud/retail/v2" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Retail::V2::SearchService::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Retail::V2::SearchRequest.new - # - # # Call the search method. - # result = client.search request - # - # # The returned object is of type Gapic::PagedEnumerable. You can iterate - # # over elements, and API calls will be issued to fetch pages as needed. - # result.each do |item| - # # Each element is of type ::Google::Cloud::Retail::V2::SearchResponse::SearchResult. - # p item - # end - # - def search request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Retail::V2::SearchRequest - - # Converts hash 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.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::Retail::V2::VERSION - metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - header_params = {} - if request.placement - header_params["placement"] = request.placement - 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.timeout, - metadata: metadata, - retry_policy: @config.rpcs.search.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @search_service_stub.call_rpc :search, request, options: options do |response, operation| - response = ::Gapic::PagedEnumerable.new @search_service_stub, :search, 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 SearchService API. - # - # This class represents the configuration for SearchService, - # providing control over timeouts, retry behavior, logging, transport - # parameters, and other low-level controls. Certain parameters can also be - # applied individually to specific RPCs. See - # {::Google::Cloud::Retail::V2::SearchService::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 - # # search to 20 seconds, - # # and all remaining timeouts to 10 seconds. - # ::Google::Cloud::Retail::V2::SearchService::Client.configure do |config| - # config.timeout = 10.0 - # config.rpcs.search.timeout = 20.0 - # end - # - # # Apply the above configuration only to a new client. - # client = ::Google::Cloud::Retail::V2::SearchService::Client.new do |config| - # config.timeout = 10.0 - # config.rpcs.search.timeout = 20.0 - # end - # - # @!attribute [rw] endpoint - # A custom service endpoint, as a hostname or hostname:port. The default is - # nil, indicating to use the default endpoint in the current universe domain. - # @return [::String,nil] - # @!attribute [rw] credentials - # Credentials to send with calls. You may provide any of the following types: - # * (`Google::Auth::Credentials`) A googleauth credentials object - # (see the [googleauth docs](https://rubydoc.info/gems/googleauth/Google/Auth/Credentials)) - # * (`Signet::OAuth2::Client`) A signet oauth2 client object - # (see the [signet docs](https://rubydoc.info/gems/signet/Signet/OAuth2/Client)) - # * (`GRPC::Core::Channel`) a gRPC channel with included credentials - # * (`GRPC::Core::ChannelCredentials`) a gRPC credentails object - # * (`nil`) indicating no credentials - # - # @note Warning: Passing a `String` to a keyfile path or a `Hash` of credentials - # is deprecated. Providing an unvalidated credential configuration to - # Google APIs can compromise the security of your systems and data. - # - # @example - # - # # The recommended way to provide credentials is to use the `make_creds` method - # # on the appropriate credentials class for your environment. - # - # require "googleauth" - # - # credentials = ::Google::Auth::ServiceAccountCredentials.make_creds( - # json_key_io: ::File.open("/path/to/keyfile.json") - # ) - # - # client = ::Google::Cloud::Retail::V2::SearchService::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 = "retail.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 SearchService 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 `search` - # @return [::Gapic::Config::Method] - # - attr_reader :search - - # @private - def initialize parent_rpcs = nil - search_config = parent_rpcs.search if parent_rpcs.respond_to? :search - @search = ::Gapic::Config::Method.new search_config - - yield self if block_given? - end - end - end - end - end - end - end - end -end diff --git a/owl-bot-staging/google-cloud-retail-v2/lib/google/cloud/retail/v2/search_service/credentials.rb b/owl-bot-staging/google-cloud-retail-v2/lib/google/cloud/retail/v2/search_service/credentials.rb deleted file mode 100644 index cac1d6f0827c..000000000000 --- a/owl-bot-staging/google-cloud-retail-v2/lib/google/cloud/retail/v2/search_service/credentials.rb +++ /dev/null @@ -1,51 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -require "googleauth" - -module Google - module Cloud - module Retail - module V2 - module SearchService - # Credentials for the SearchService API. - class Credentials < ::Google::Auth::Credentials - self.scope = [ - "https://www.googleapis.com/auth/cloud-platform" - ] - self.env_vars = [ - "RETAIL_CREDENTIALS", - "RETAIL_KEYFILE", - "GOOGLE_CLOUD_CREDENTIALS", - "GOOGLE_CLOUD_KEYFILE", - "GCLOUD_KEYFILE", - "RETAIL_CREDENTIALS_JSON", - "RETAIL_KEYFILE_JSON", - "GOOGLE_CLOUD_CREDENTIALS_JSON", - "GOOGLE_CLOUD_KEYFILE_JSON", - "GCLOUD_KEYFILE_JSON" - ] - self.paths = [ - "~/.config/google_cloud/application_default_credentials.json" - ] - end - end - end - end - end -end diff --git a/owl-bot-staging/google-cloud-retail-v2/lib/google/cloud/retail/v2/search_service/paths.rb b/owl-bot-staging/google-cloud-retail-v2/lib/google/cloud/retail/v2/search_service/paths.rb deleted file mode 100644 index 9bc8dfbe2895..000000000000 --- a/owl-bot-staging/google-cloud-retail-v2/lib/google/cloud/retail/v2/search_service/paths.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! - - -module Google - module Cloud - module Retail - module V2 - module SearchService - # Path helper methods for the SearchService API. - module Paths - ## - # Create a fully-qualified Branch resource string. - # - # The resource will be in the following format: - # - # `projects/{project}/locations/{location}/catalogs/{catalog}/branches/{branch}` - # - # @param project [String] - # @param location [String] - # @param catalog [String] - # @param branch [String] - # - # @return [::String] - def branch_path project:, location:, catalog:, branch: - raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" - raise ::ArgumentError, "location cannot contain /" if location.to_s.include? "/" - raise ::ArgumentError, "catalog cannot contain /" if catalog.to_s.include? "/" - - "projects/#{project}/locations/#{location}/catalogs/#{catalog}/branches/#{branch}" - end - - extend self - end - end - end - end - end -end diff --git a/owl-bot-staging/google-cloud-retail-v2/lib/google/cloud/retail/v2/search_service/rest.rb b/owl-bot-staging/google-cloud-retail-v2/lib/google/cloud/retail/v2/search_service/rest.rb deleted file mode 100644 index b7b1de13989c..000000000000 --- a/owl-bot-staging/google-cloud-retail-v2/lib/google/cloud/retail/v2/search_service/rest.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/rest" -require "gapic/config" -require "gapic/config/method" - -require "google/cloud/retail/v2/version" - -require "google/cloud/retail/v2/search_service/credentials" -require "google/cloud/retail/v2/search_service/paths" -require "google/cloud/retail/v2/search_service/rest/client" - -module Google - module Cloud - module Retail - module V2 - ## - # Service for search. - # - # This feature is only available for users who have Retail Search enabled. - # Enable Retail Search on Cloud Console before using this feature. - # - # To load this service and instantiate a REST client: - # - # require "google/cloud/retail/v2/search_service/rest" - # client = ::Google::Cloud::Retail::V2::SearchService::Rest::Client.new - # - module SearchService - # Client for the REST transport - module Rest - end - end - end - end - end -end - -helper_path = ::File.join __dir__, "rest", "helpers.rb" -require "google/cloud/retail/v2/search_service/rest/helpers" if ::File.file? helper_path diff --git a/owl-bot-staging/google-cloud-retail-v2/lib/google/cloud/retail/v2/search_service/rest/client.rb b/owl-bot-staging/google-cloud-retail-v2/lib/google/cloud/retail/v2/search_service/rest/client.rb deleted file mode 100644 index 2afc3a5a7cfe..000000000000 --- a/owl-bot-staging/google-cloud-retail-v2/lib/google/cloud/retail/v2/search_service/rest/client.rb +++ /dev/null @@ -1,737 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -require "google/cloud/errors" -require "google/cloud/retail/v2/search_service_pb" -require "google/cloud/retail/v2/search_service/rest/service_stub" -require "google/cloud/location/rest" - -module Google - module Cloud - module Retail - module V2 - module SearchService - module Rest - ## - # REST client for the SearchService service. - # - # Service for search. - # - # This feature is only available for users who have Retail Search enabled. - # Enable Retail Search on Cloud Console before using this feature. - # - class Client - # @private - API_VERSION = "" - - # @private - DEFAULT_ENDPOINT_TEMPLATE = "retail.$UNIVERSE_DOMAIN$" - - include Paths - - # @private - attr_reader :search_service_stub - - ## - # Configure the SearchService Client class. - # - # See {::Google::Cloud::Retail::V2::SearchService::Rest::Client::Configuration} - # for a description of the configuration fields. - # - # @example - # - # # Modify the configuration for all SearchService clients - # ::Google::Cloud::Retail::V2::SearchService::Rest::Client.configure do |config| - # config.timeout = 10.0 - # end - # - # @yield [config] Configure the Client client. - # @yieldparam config [Client::Configuration] - # - # @return [Client::Configuration] - # - def self.configure - @configure ||= begin - namespace = ["Google", "Cloud", "Retail", "V2"] - parent_config = while namespace.any? - parent_name = namespace.join "::" - parent_const = const_get parent_name - break parent_const.configure if parent_const.respond_to? :configure - namespace.pop - end - default_config = Client::Configuration.new parent_config - - default_config.timeout = 5.0 - default_config.retry_policy = { - initial_delay: 0.1, max_delay: 5.0, multiplier: 1.3, retry_codes: [14, 4] - } - - default_config - end - yield @configure if block_given? - @configure - end - - ## - # Configure the SearchService Client instance. - # - # The configuration is set to the derived mode, meaning that values can be changed, - # but structural changes (adding new fields, etc.) are not allowed. Structural changes - # should be made on {Client.configure}. - # - # See {::Google::Cloud::Retail::V2::SearchService::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 - @search_service_stub.universe_domain - end - - ## - # Create a new SearchService REST client object. - # - # @example - # - # # Create a client using the default configuration - # client = ::Google::Cloud::Retail::V2::SearchService::Rest::Client.new - # - # # Create a client using a custom configuration - # client = ::Google::Cloud::Retail::V2::SearchService::Rest::Client.new do |config| - # config.timeout = 10.0 - # end - # - # @yield [config] Configure the SearchService 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 - - @search_service_stub = ::Google::Cloud::Retail::V2::SearchService::Rest::ServiceStub.new( - endpoint: @config.endpoint, - endpoint_template: DEFAULT_ENDPOINT_TEMPLATE, - universe_domain: @config.universe_domain, - credentials: credentials, - logger: @config.logger - ) - - @search_service_stub.logger(stub: true)&.info do |entry| - entry.set_system_name - entry.set_service - entry.message = "Created client for #{entry.service}" - entry.set_credentials_fields credentials - entry.set "customEndpoint", @config.endpoint if @config.endpoint - entry.set "defaultTimeout", @config.timeout if @config.timeout - entry.set "quotaProject", @quota_project_id if @quota_project_id - end - - @location_client = Google::Cloud::Location::Locations::Rest::Client.new do |config| - config.credentials = credentials - config.quota_project = @quota_project_id - config.endpoint = @search_service_stub.endpoint - config.universe_domain = @search_service_stub.universe_domain - config.logger = @search_service_stub.logger if config.respond_to? :logger= - end - end - - ## - # Get the associated client for mix-in of the Locations. - # - # @return [Google::Cloud::Location::Locations::Rest::Client] - # - attr_reader :location_client - - ## - # The logger used for request/response debug logging. - # - # @return [Logger] - # - def logger - @search_service_stub.logger - end - - # Service calls - - ## - # Performs a search. - # - # This feature is only available for users who have Retail Search enabled. - # Enable Retail Search on Cloud Console before using this feature. - # - # @overload search(request, options = nil) - # Pass arguments to `search` via a request object, either of type - # {::Google::Cloud::Retail::V2::SearchRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Retail::V2::SearchRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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(placement: nil, branch: nil, query: nil, visitor_id: nil, user_info: nil, page_size: nil, page_token: nil, offset: nil, filter: nil, canonical_filter: nil, order_by: nil, facet_specs: nil, dynamic_facet_spec: nil, boost_spec: nil, query_expansion_spec: nil, variant_rollup_keys: nil, page_categories: nil, search_mode: nil, personalization_spec: nil, labels: nil, spell_correction_spec: nil, entity: nil, conversational_search_spec: nil, tile_navigation_spec: nil, language_code: nil, region_code: nil, place_id: nil, user_attributes: nil) - # Pass arguments to `search` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param placement [::String] - # Required. The resource name of the Retail Search serving config, such as - # `projects/*/locations/global/catalogs/default_catalog/servingConfigs/default_serving_config` - # or the name of the legacy placement resource, such as - # `projects/*/locations/global/catalogs/default_catalog/placements/default_search`. - # This field is used to identify the serving config name and the set - # of models that are used to make the search. - # @param branch [::String] - # The branch resource name, such as - # `projects/*/locations/global/catalogs/default_catalog/branches/0`. - # - # Use "default_branch" as the branch ID or leave this field empty, to search - # products under the default branch. - # @param query [::String] - # Raw search query. - # - # If this field is empty, the request is considered a category browsing - # request and returned results are based on - # {::Google::Cloud::Retail::V2::SearchRequest#filter filter} and - # {::Google::Cloud::Retail::V2::SearchRequest#page_categories page_categories}. - # @param visitor_id [::String] - # Required. A unique identifier for tracking visitors. For example, this - # could be implemented with an HTTP cookie, which should be able to uniquely - # identify a visitor on a single device. This unique identifier should not - # change if the visitor logs in or out of the website. - # - # This should be the same identifier as - # {::Google::Cloud::Retail::V2::UserEvent#visitor_id UserEvent.visitor_id}. - # - # The field must be a UTF-8 encoded string with a length limit of 128 - # characters. Otherwise, an INVALID_ARGUMENT error is returned. - # @param user_info [::Google::Cloud::Retail::V2::UserInfo, ::Hash] - # User information. - # @param page_size [::Integer] - # Maximum number of {::Google::Cloud::Retail::V2::Product Product}s to return. If - # unspecified, defaults to a reasonable value. The maximum allowed value is - # 120. Values above 120 will be coerced to 120. - # - # If this field is negative, an INVALID_ARGUMENT is returned. - # @param page_token [::String] - # A page token - # {::Google::Cloud::Retail::V2::SearchResponse#next_page_token SearchResponse.next_page_token}, - # received from a previous - # {::Google::Cloud::Retail::V2::SearchService::Rest::Client#search SearchService.Search} call. - # Provide this to retrieve the subsequent page. - # - # When paginating, all other parameters provided to - # {::Google::Cloud::Retail::V2::SearchService::Rest::Client#search SearchService.Search} must - # match the call that provided the page token. Otherwise, an INVALID_ARGUMENT - # error is returned. - # @param offset [::Integer] - # A 0-indexed integer that specifies the current offset (that is, starting - # result location, amongst the {::Google::Cloud::Retail::V2::Product Product}s - # deemed by the API as relevant) in search results. This field is only - # considered if {::Google::Cloud::Retail::V2::SearchRequest#page_token page_token} - # is unset. - # - # If this field is negative, an INVALID_ARGUMENT is returned. - # @param filter [::String] - # The filter syntax consists of an expression language for constructing a - # predicate from one or more fields of the products being filtered. Filter - # expression is case-sensitive. For more information, see - # [Filter](https://cloud.google.com/retail/docs/filter-and-order#filter). - # - # If this field is unrecognizable, an INVALID_ARGUMENT is returned. - # @param canonical_filter [::String] - # The default filter that is applied when a user performs a search without - # checking any filters on the search page. - # - # The filter applied to every search request when quality improvement such as - # query expansion is needed. In the case a query does not have a sufficient - # amount of results this filter will be used to determine whether or not to - # enable the query expansion flow. The original filter will still be used for - # the query expanded search. - # This field is strongly recommended to achieve high search quality. - # - # For more information about filter syntax, see - # {::Google::Cloud::Retail::V2::SearchRequest#filter SearchRequest.filter}. - # @param order_by [::String] - # The order in which products are returned. Products can be ordered by - # a field in an {::Google::Cloud::Retail::V2::Product Product} object. Leave it - # unset if ordered by relevance. OrderBy expression is case-sensitive. For - # more information, see - # [Order](https://cloud.google.com/retail/docs/filter-and-order#order). - # - # If this field is unrecognizable, an INVALID_ARGUMENT is returned. - # @param facet_specs [::Array<::Google::Cloud::Retail::V2::SearchRequest::FacetSpec, ::Hash>] - # Facet specifications for faceted search. If empty, no facets are returned. - # - # A maximum of 200 values are allowed. Otherwise, an INVALID_ARGUMENT error - # is returned. - # @param dynamic_facet_spec [::Google::Cloud::Retail::V2::SearchRequest::DynamicFacetSpec, ::Hash] - # Deprecated. Refer to https://cloud.google.com/retail/docs/configs#dynamic - # to enable dynamic facets. Do not set this field. - # - # The specification for dynamically generated facets. Notice that only - # textual facets can be dynamically generated. - # @param boost_spec [::Google::Cloud::Retail::V2::SearchRequest::BoostSpec, ::Hash] - # Boost specification to boost certain products. For more information, see - # [Boost results](https://cloud.google.com/retail/docs/boosting). - # - # Notice that if both - # {::Google::Cloud::Retail::V2::ServingConfig#boost_control_ids ServingConfig.boost_control_ids} - # and - # {::Google::Cloud::Retail::V2::SearchRequest#boost_spec SearchRequest.boost_spec} - # are set, the boost conditions from both places are evaluated. If a search - # request matches multiple boost conditions, the final boost score is equal - # to the sum of the boost scores from all matched boost conditions. - # @param query_expansion_spec [::Google::Cloud::Retail::V2::SearchRequest::QueryExpansionSpec, ::Hash] - # The query expansion specification that specifies the conditions under which - # query expansion occurs. For more information, see [Query - # expansion](https://cloud.google.com/retail/docs/result-size#query_expansion). - # @param variant_rollup_keys [::Array<::String>] - # The keys to fetch and rollup the matching - # {::Google::Cloud::Retail::V2::Product::Type::VARIANT variant} - # {::Google::Cloud::Retail::V2::Product Product}s attributes, - # {::Google::Cloud::Retail::V2::FulfillmentInfo FulfillmentInfo} or - # {::Google::Cloud::Retail::V2::LocalInventory LocalInventory}s attributes. The - # attributes from all the matching - # {::Google::Cloud::Retail::V2::Product::Type::VARIANT variant} - # {::Google::Cloud::Retail::V2::Product Product}s or - # {::Google::Cloud::Retail::V2::LocalInventory LocalInventory}s are merged and - # de-duplicated. Notice that rollup attributes will lead to extra query - # latency. Maximum number of keys is 30. - # - # For {::Google::Cloud::Retail::V2::FulfillmentInfo FulfillmentInfo}, a - # fulfillment type and a fulfillment ID must be provided in the format of - # "fulfillmentType.fulfillmentId". E.g., in "pickupInStore.store123", - # "pickupInStore" is fulfillment type and "store123" is the store ID. - # - # Supported keys are: - # - # * colorFamilies - # * price - # * originalPrice - # * discount - # * variantId - # * inventory(place_id,price) - # * inventory(place_id,original_price) - # * inventory(place_id,attributes.key), where key is any key in the - # {::Google::Cloud::Retail::V2::LocalInventory#attributes Product.local_inventories.attributes} - # map. - # * attributes.key, where key is any key in the - # {::Google::Cloud::Retail::V2::Product#attributes Product.attributes} map. - # * pickupInStore.id, where id is any - # {::Google::Cloud::Retail::V2::FulfillmentInfo#place_ids FulfillmentInfo.place_ids} - # for {::Google::Cloud::Retail::V2::FulfillmentInfo#type FulfillmentInfo.type} - # "pickup-in-store". - # * shipToStore.id, where id is any - # {::Google::Cloud::Retail::V2::FulfillmentInfo#place_ids FulfillmentInfo.place_ids} - # for {::Google::Cloud::Retail::V2::FulfillmentInfo#type FulfillmentInfo.type} - # "ship-to-store". - # * sameDayDelivery.id, where id is any - # {::Google::Cloud::Retail::V2::FulfillmentInfo#place_ids FulfillmentInfo.place_ids} - # for {::Google::Cloud::Retail::V2::FulfillmentInfo#type FulfillmentInfo.type} - # "same-day-delivery". - # * nextDayDelivery.id, where id is any - # {::Google::Cloud::Retail::V2::FulfillmentInfo#place_ids FulfillmentInfo.place_ids} - # for {::Google::Cloud::Retail::V2::FulfillmentInfo#type FulfillmentInfo.type} - # "next-day-delivery". - # * customFulfillment1.id, where id is any - # {::Google::Cloud::Retail::V2::FulfillmentInfo#place_ids FulfillmentInfo.place_ids} - # for {::Google::Cloud::Retail::V2::FulfillmentInfo#type FulfillmentInfo.type} - # "custom-type-1". - # * customFulfillment2.id, where id is any - # {::Google::Cloud::Retail::V2::FulfillmentInfo#place_ids FulfillmentInfo.place_ids} - # for {::Google::Cloud::Retail::V2::FulfillmentInfo#type FulfillmentInfo.type} - # "custom-type-2". - # * customFulfillment3.id, where id is any - # {::Google::Cloud::Retail::V2::FulfillmentInfo#place_ids FulfillmentInfo.place_ids} - # for {::Google::Cloud::Retail::V2::FulfillmentInfo#type FulfillmentInfo.type} - # "custom-type-3". - # * customFulfillment4.id, where id is any - # {::Google::Cloud::Retail::V2::FulfillmentInfo#place_ids FulfillmentInfo.place_ids} - # for {::Google::Cloud::Retail::V2::FulfillmentInfo#type FulfillmentInfo.type} - # "custom-type-4". - # * customFulfillment5.id, where id is any - # {::Google::Cloud::Retail::V2::FulfillmentInfo#place_ids FulfillmentInfo.place_ids} - # for {::Google::Cloud::Retail::V2::FulfillmentInfo#type FulfillmentInfo.type} - # "custom-type-5". - # - # If this field is set to an invalid value other than these, an - # INVALID_ARGUMENT error is returned. - # @param page_categories [::Array<::String>] - # The categories associated with a category page. Must be set for category - # navigation queries to achieve good search quality. The format should be - # the same as - # {::Google::Cloud::Retail::V2::UserEvent#page_categories UserEvent.page_categories}; - # - # To represent full path of category, use '>' sign to separate different - # hierarchies. If '>' is part of the category name, replace it with - # other character(s). - # - # Category pages include special pages such as sales or promotions. For - # instance, a special sale page may have the category hierarchy: - # "pageCategories" : ["Sales > 2017 Black Friday Deals"]. - # @param search_mode [::Google::Cloud::Retail::V2::SearchRequest::SearchMode] - # The search mode of the search request. If not specified, a single search - # request triggers both product search and faceted search. - # @param personalization_spec [::Google::Cloud::Retail::V2::SearchRequest::PersonalizationSpec, ::Hash] - # The specification for personalization. - # - # Notice that if both - # {::Google::Cloud::Retail::V2::ServingConfig#personalization_spec ServingConfig.personalization_spec} - # and - # {::Google::Cloud::Retail::V2::SearchRequest#personalization_spec SearchRequest.personalization_spec} - # are set. - # {::Google::Cloud::Retail::V2::SearchRequest#personalization_spec SearchRequest.personalization_spec} - # will override - # {::Google::Cloud::Retail::V2::ServingConfig#personalization_spec ServingConfig.personalization_spec}. - # @param labels [::Hash{::String => ::String}] - # The labels applied to a resource must meet the following requirements: - # - # * Each resource can have multiple labels, up to a maximum of 64. - # * Each label must be a key-value pair. - # * Keys have a minimum length of 1 character and a maximum length of 63 - # characters and cannot be empty. Values can be empty and have a maximum - # length of 63 characters. - # * Keys and values can contain only lowercase letters, numeric characters, - # underscores, and dashes. All characters must use UTF-8 encoding, and - # international characters are allowed. - # * The key portion of a label must be unique. However, you can use the same - # key with multiple resources. - # * Keys must start with a lowercase letter or international character. - # - # For more information, see [Requirements for - # labels](https://cloud.google.com/resource-manager/docs/creating-managing-labels#requirements) - # in the Resource Manager documentation. - # @param spell_correction_spec [::Google::Cloud::Retail::V2::SearchRequest::SpellCorrectionSpec, ::Hash] - # The spell correction specification that specifies the mode under - # which spell correction will take effect. - # @param entity [::String] - # The entity for customers that may run multiple different entities, domains, - # sites or regions, for example, `Google US`, `Google Ads`, `Waymo`, - # `google.com`, `youtube.com`, etc. - # If this is set, it should be exactly matched with - # {::Google::Cloud::Retail::V2::UserEvent#entity UserEvent.entity} to get search - # results boosted by entity. - # @param conversational_search_spec [::Google::Cloud::Retail::V2::SearchRequest::ConversationalSearchSpec, ::Hash] - # Optional. This field specifies all conversational related parameters - # addition to traditional retail search. - # @param tile_navigation_spec [::Google::Cloud::Retail::V2::SearchRequest::TileNavigationSpec, ::Hash] - # Optional. This field specifies tile navigation related parameters. - # @param language_code [::String] - # Optional. The BCP-47 language code, such as "en-US" or "sr-Latn" - # [list](https://www.unicode.org/cldr/charts/46/summary/root.html). For more - # information, see [Standardized codes](https://google.aip.dev/143). This - # field helps to better interpret the query. If a value isn't specified, the - # query language code is automatically detected, which may not be accurate. - # @param region_code [::String] - # Optional. The Unicode country/region code (CLDR) of a location, such as - # "US" and "419" - # [list](https://www.unicode.org/cldr/charts/46/supplemental/territory_information.html). - # For more information, see [Standardized codes](https://google.aip.dev/143). - # If set, then results will be boosted based on the region_code provided. - # @param place_id [::String] - # Optional. An id corresponding to a place, such as a store id or region id. - # When specified, we use the price from the local inventory with the matching - # product's - # {::Google::Cloud::Retail::V2::LocalInventory#place_id LocalInventory.place_id} - # for revenue optimization. - # @param user_attributes [::Hash{::String => ::Google::Cloud::Retail::V2::StringList, ::Hash}] - # Optional. The user attributes that could be used for personalization of - # search results. - # * Populate at most 100 key-value pairs per query. - # * Only supports string keys and repeated string values. - # * Duplcate keys are not allowed within a single query. - # - # Example: - # user_attributes: [ - # { key: "pets" - # value { - # values: "dog" - # values: "cat" - # } - # }, - # { key: "state" - # value { - # values: "CA" - # } - # } - # ] - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Gapic::Rest::PagedEnumerable<::Google::Cloud::Retail::V2::SearchResponse::SearchResult>] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Gapic::Rest::PagedEnumerable<::Google::Cloud::Retail::V2::SearchResponse::SearchResult>] - # - # @raise [::Google::Cloud::Error] if the REST call is aborted. - # - # @example Basic example - # require "google/cloud/retail/v2" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Retail::V2::SearchService::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Retail::V2::SearchRequest.new - # - # # Call the search method. - # result = client.search request - # - # # The returned object is of type Gapic::PagedEnumerable. You can iterate - # # over elements, and API calls will be issued to fetch pages as needed. - # result.each do |item| - # # Each element is of type ::Google::Cloud::Retail::V2::SearchResponse::SearchResult. - # p item - # end - # - def search request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Retail::V2::SearchRequest - - # Converts hash 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.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::Retail::V2::VERSION, - transports_version_send: [:rest] - - call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - options.apply_defaults timeout: @config.rpcs.search.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.search.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @search_service_stub.search request, options do |result, operation| - result = ::Gapic::Rest::PagedEnumerable.new @search_service_stub, :search, "results", 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 SearchService REST API. - # - # This class represents the configuration for SearchService REST, - # providing control over timeouts, retry behavior, logging, transport - # parameters, and other low-level controls. Certain parameters can also be - # applied individually to specific RPCs. See - # {::Google::Cloud::Retail::V2::SearchService::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 - # # search to 20 seconds, - # # and all remaining timeouts to 10 seconds. - # ::Google::Cloud::Retail::V2::SearchService::Rest::Client.configure do |config| - # config.timeout = 10.0 - # config.rpcs.search.timeout = 20.0 - # end - # - # # Apply the above configuration only to a new client. - # client = ::Google::Cloud::Retail::V2::SearchService::Rest::Client.new do |config| - # config.timeout = 10.0 - # config.rpcs.search.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 = "retail.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 SearchService 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 `search` - # @return [::Gapic::Config::Method] - # - attr_reader :search - - # @private - def initialize parent_rpcs = nil - search_config = parent_rpcs.search if parent_rpcs.respond_to? :search - @search = ::Gapic::Config::Method.new search_config - - yield self if block_given? - end - end - end - end - end - end - end - end - end -end diff --git a/owl-bot-staging/google-cloud-retail-v2/lib/google/cloud/retail/v2/search_service/rest/service_stub.rb b/owl-bot-staging/google-cloud-retail-v2/lib/google/cloud/retail/v2/search_service/rest/service_stub.rb deleted file mode 100644 index 826122ca8f8d..000000000000 --- a/owl-bot-staging/google-cloud-retail-v2/lib/google/cloud/retail/v2/search_service/rest/service_stub.rb +++ /dev/null @@ -1,151 +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/retail/v2/search_service_pb" - -module Google - module Cloud - module Retail - module V2 - module SearchService - module Rest - ## - # REST service stub for the SearchService 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 search REST call - # - # @param request_pb [::Google::Cloud::Retail::V2::SearchRequest] - # A request object representing the call parameters. Required. - # @param options [::Gapic::CallOptions] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Cloud::Retail::V2::SearchResponse] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::Retail::V2::SearchResponse] - # A result object deserialized from the server's reply - def search request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_search_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", - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Cloud::Retail::V2::SearchResponse.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 search REST call - # - # @param request_pb [::Google::Cloud::Retail::V2::SearchRequest] - # 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_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :post, - uri_template: "/v2/{placement}:search", - body: "*", - matches: [ - ["placement", %r{^projects/[^/]+/locations/[^/]+/catalogs/[^/]+/placements/[^/]+/?$}, false] - ] - ) - .with_bindings( - uri_method: :post, - uri_template: "/v2/{placement}:search", - body: "*", - matches: [ - ["placement", %r{^projects/[^/]+/locations/[^/]+/catalogs/[^/]+/servingConfigs/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - end - end - end - end - end - end -end diff --git a/owl-bot-staging/google-cloud-retail-v2/lib/google/cloud/retail/v2/search_service_pb.rb b/owl-bot-staging/google-cloud-retail-v2/lib/google/cloud/retail/v2/search_service_pb.rb deleted file mode 100644 index 286deb6e40e7..000000000000 --- a/owl-bot-staging/google-cloud-retail-v2/lib/google/cloud/retail/v2/search_service_pb.rb +++ /dev/null @@ -1,61 +0,0 @@ -# frozen_string_literal: true -# Generated by the protocol buffer compiler. DO NOT EDIT! -# source: google/cloud/retail/v2/search_service.proto - -require 'google/protobuf' - -require 'google/api/annotations_pb' -require 'google/api/client_pb' -require 'google/api/field_behavior_pb' -require 'google/api/resource_pb' -require 'google/cloud/retail/v2/common_pb' -require 'google/cloud/retail/v2/product_pb' -require 'google/protobuf/field_mask_pb' -require 'google/protobuf/struct_pb' - - -descriptor_data = "\n+google/cloud/retail/v2/search_service.proto\x12\x16google.cloud.retail.v2\x1a\x1cgoogle/api/annotations.proto\x1a\x17google/api/client.proto\x1a\x1fgoogle/api/field_behavior.proto\x1a\x19google/api/resource.proto\x1a#google/cloud/retail/v2/common.proto\x1a$google/cloud/retail/v2/product.proto\x1a google/protobuf/field_mask.proto\x1a\x1cgoogle/protobuf/struct.proto\"4\n\x15ProductAttributeValue\x12\x0c\n\x04name\x18\x01 \x01(\t\x12\r\n\x05value\x18\x02 \x01(\t\"\\\n\x18ProductAttributeInterval\x12\x0c\n\x04name\x18\x01 \x01(\t\x12\x32\n\x08interval\x18\x02 \x01(\x0b\x32 .google.cloud.retail.v2.Interval\"\xe8\x01\n\x04Tile\x12P\n\x17product_attribute_value\x18\x01 \x01(\x0b\x32-.google.cloud.retail.v2.ProductAttributeValueH\x00\x12V\n\x1aproduct_attribute_interval\x18\x02 \x01(\x0b\x32\x30.google.cloud.retail.v2.ProductAttributeIntervalH\x00\x12!\n\x19representative_product_id\x18\x03 \x01(\tB\x13\n\x11product_attribute\"\x8d\x1c\n\rSearchRequest\x12\x16\n\tplacement\x18\x01 \x01(\tB\x03\xe0\x41\x02\x12\x31\n\x06\x62ranch\x18\x02 \x01(\tB!\xfa\x41\x1e\n\x1cretail.googleapis.com/Branch\x12\r\n\x05query\x18\x03 \x01(\t\x12\x17\n\nvisitor_id\x18\x04 \x01(\tB\x03\xe0\x41\x02\x12\x33\n\tuser_info\x18\x05 \x01(\x0b\x32 .google.cloud.retail.v2.UserInfo\x12\x11\n\tpage_size\x18\x07 \x01(\x05\x12\x12\n\npage_token\x18\x08 \x01(\t\x12\x0e\n\x06offset\x18\t \x01(\x05\x12\x0e\n\x06\x66ilter\x18\n \x01(\t\x12\x18\n\x10\x63\x61nonical_filter\x18\x1c \x01(\t\x12\x10\n\x08order_by\x18\x0b \x01(\t\x12\x44\n\x0b\x66\x61\x63\x65t_specs\x18\x0c \x03(\x0b\x32/.google.cloud.retail.v2.SearchRequest.FacetSpec\x12V\n\x12\x64ynamic_facet_spec\x18\x15 \x01(\x0b\x32\x36.google.cloud.retail.v2.SearchRequest.DynamicFacetSpecB\x02\x18\x01\x12\x43\n\nboost_spec\x18\r \x01(\x0b\x32/.google.cloud.retail.v2.SearchRequest.BoostSpec\x12V\n\x14query_expansion_spec\x18\x0e \x01(\x0b\x32\x38.google.cloud.retail.v2.SearchRequest.QueryExpansionSpec\x12\x1b\n\x13variant_rollup_keys\x18\x11 \x03(\t\x12\x17\n\x0fpage_categories\x18\x17 \x03(\t\x12\x45\n\x0bsearch_mode\x18\x1f \x01(\x0e\x32\x30.google.cloud.retail.v2.SearchRequest.SearchMode\x12W\n\x14personalization_spec\x18 \x01(\x0b\x32\x39.google.cloud.retail.v2.SearchRequest.PersonalizationSpec\x12\x41\n\x06labels\x18\" \x03(\x0b\x32\x31.google.cloud.retail.v2.SearchRequest.LabelsEntry\x12]\n\x15spell_correction_spec\x18# \x01(\x0b\x32\x39.google.cloud.retail.v2.SearchRequest.SpellCorrectionSpecH\x00\x88\x01\x01\x12\x0e\n\x06\x65ntity\x18& \x01(\t\x12g\n\x1a\x63onversational_search_spec\x18( \x01(\x0b\x32>.google.cloud.retail.v2.SearchRequest.ConversationalSearchSpecB\x03\xe0\x41\x01\x12[\n\x14tile_navigation_spec\x18) \x01(\x0b\x32\x38.google.cloud.retail.v2.SearchRequest.TileNavigationSpecB\x03\xe0\x41\x01\x12\x1a\n\rlanguage_code\x18+ \x01(\tB\x03\xe0\x41\x01\x12\x18\n\x0bregion_code\x18, \x01(\tB\x03\xe0\x41\x01\x12\x15\n\x08place_id\x18. \x01(\tB\x03\xe0\x41\x01\x12W\n\x0fuser_attributes\x18/ \x03(\x0b\x32\x39.google.cloud.retail.v2.SearchRequest.UserAttributesEntryB\x03\xe0\x41\x01\x1a\x91\x03\n\tFacetSpec\x12P\n\tfacet_key\x18\x01 \x01(\x0b\x32\x38.google.cloud.retail.v2.SearchRequest.FacetSpec.FacetKeyB\x03\xe0\x41\x02\x12\r\n\x05limit\x18\x02 \x01(\x05\x12\x1c\n\x14\x65xcluded_filter_keys\x18\x03 \x03(\t\x12\x1f\n\x17\x65nable_dynamic_position\x18\x04 \x01(\x08\x1a\xe3\x01\n\x08\x46\x61\x63\x65tKey\x12\x10\n\x03key\x18\x01 \x01(\tB\x03\xe0\x41\x02\x12\x33\n\tintervals\x18\x02 \x03(\x0b\x32 .google.cloud.retail.v2.Interval\x12\x19\n\x11restricted_values\x18\x03 \x03(\t\x12\x10\n\x08prefixes\x18\x08 \x03(\t\x12\x10\n\x08\x63ontains\x18\t \x03(\t\x12\x18\n\x10\x63\x61se_insensitive\x18\n \x01(\x08\x12\x10\n\x08order_by\x18\x04 \x01(\t\x12\r\n\x05query\x18\x05 \x01(\t\x12\x16\n\x0ereturn_min_max\x18\x0b \x01(\x08\x1a\x96\x01\n\x10\x44ynamicFacetSpec\x12I\n\x04mode\x18\x01 \x01(\x0e\x32;.google.cloud.retail.v2.SearchRequest.DynamicFacetSpec.Mode\"7\n\x04Mode\x12\x14\n\x10MODE_UNSPECIFIED\x10\x00\x12\x0c\n\x08\x44ISABLED\x10\x01\x12\x0b\n\x07\x45NABLED\x10\x02\x1a\xee\x01\n\tBoostSpec\x12\x61\n\x15\x63ondition_boost_specs\x18\x01 \x03(\x0b\x32\x42.google.cloud.retail.v2.SearchRequest.BoostSpec.ConditionBoostSpec\x12\'\n\x1askip_boost_spec_validation\x18\x02 \x01(\x08H\x00\x88\x01\x01\x1a\x36\n\x12\x43onditionBoostSpec\x12\x11\n\tcondition\x18\x01 \x01(\t\x12\r\n\x05\x62oost\x18\x02 \x01(\x02\x42\x1d\n\x1b_skip_boost_spec_validation\x1a\xcb\x01\n\x12QueryExpansionSpec\x12U\n\tcondition\x18\x01 \x01(\x0e\x32\x42.google.cloud.retail.v2.SearchRequest.QueryExpansionSpec.Condition\x12\x1e\n\x16pin_unexpanded_results\x18\x02 \x01(\x08\">\n\tCondition\x12\x19\n\x15\x43ONDITION_UNSPECIFIED\x10\x00\x12\x0c\n\x08\x44ISABLED\x10\x01\x12\x08\n\x04\x41UTO\x10\x03\x1a\x99\x01\n\x13PersonalizationSpec\x12L\n\x04mode\x18\x01 \x01(\x0e\x32>.google.cloud.retail.v2.SearchRequest.PersonalizationSpec.Mode\"4\n\x04Mode\x12\x14\n\x10MODE_UNSPECIFIED\x10\x00\x12\x08\n\x04\x41UTO\x10\x01\x12\x0c\n\x08\x44ISABLED\x10\x02\x1a\xa0\x01\n\x13SpellCorrectionSpec\x12L\n\x04mode\x18\x01 \x01(\x0e\x32>.google.cloud.retail.v2.SearchRequest.SpellCorrectionSpec.Mode\";\n\x04Mode\x12\x14\n\x10MODE_UNSPECIFIED\x10\x00\x12\x13\n\x0fSUGGESTION_ONLY\x10\x01\x12\x08\n\x04\x41UTO\x10\x02\x1a\x97\x04\n\x18\x43onversationalSearchSpec\x12\'\n\x1f\x66ollowup_conversation_requested\x18\x01 \x01(\x08\x12\x17\n\x0f\x63onversation_id\x18\x02 \x01(\t\x12^\n\x0buser_answer\x18\x03 \x01(\x0b\x32I.google.cloud.retail.v2.SearchRequest.ConversationalSearchSpec.UserAnswer\x1a\xd8\x02\n\nUserAnswer\x12\x15\n\x0btext_answer\x18\x01 \x01(\tH\x00\x12s\n\x0fselected_answer\x18\x02 \x01(\x0b\x32X.google.cloud.retail.v2.SearchRequest.ConversationalSearchSpec.UserAnswer.SelectedAnswerH\x00\x1a\xb5\x01\n\x0eSelectedAnswer\x12S\n\x18product_attribute_values\x18\x01 \x03(\x0b\x32-.google.cloud.retail.v2.ProductAttributeValueB\x02\x18\x01\x12N\n\x17product_attribute_value\x18\x02 \x01(\x0b\x32-.google.cloud.retail.v2.ProductAttributeValueB\x06\n\x04type\x1al\n\x12TileNavigationSpec\x12!\n\x19tile_navigation_requested\x18\x01 \x01(\x08\x12\x33\n\rapplied_tiles\x18\x02 \x03(\x0b\x32\x1c.google.cloud.retail.v2.Tile\x1a-\n\x0bLabelsEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12\r\n\x05value\x18\x02 \x01(\t:\x02\x38\x01\x1aY\n\x13UserAttributesEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12\x31\n\x05value\x18\x02 \x01(\x0b\x32\".google.cloud.retail.v2.StringList:\x02\x38\x01\"[\n\nSearchMode\x12\x1b\n\x17SEARCH_MODE_UNSPECIFIED\x10\x00\x12\x17\n\x13PRODUCT_SEARCH_ONLY\x10\x01\x12\x17\n\x13\x46\x41\x43\x45TED_SEARCH_ONLY\x10\x02\x42\x18\n\x16_spell_correction_spec\"\xa5\x14\n\x0eSearchResponse\x12\x44\n\x07results\x18\x01 \x03(\x0b\x32\x33.google.cloud.retail.v2.SearchResponse.SearchResult\x12<\n\x06\x66\x61\x63\x65ts\x18\x02 \x03(\x0b\x32,.google.cloud.retail.v2.SearchResponse.Facet\x12\x12\n\ntotal_size\x18\x03 \x01(\x05\x12\x17\n\x0f\x63orrected_query\x18\x04 \x01(\t\x12\x19\n\x11\x61ttribution_token\x18\x05 \x01(\t\x12\x17\n\x0fnext_page_token\x18\x06 \x01(\t\x12W\n\x14query_expansion_info\x18\x07 \x01(\x0b\x32\x39.google.cloud.retail.v2.SearchResponse.QueryExpansionInfo\x12\x14\n\x0credirect_uri\x18\n \x01(\t\x12\x18\n\x10\x61pplied_controls\x18\x0c \x03(\t\x12H\n\x14pin_control_metadata\x18\x16 \x01(\x0b\x32*.google.cloud.retail.v2.PinControlMetadata\x12i\n\x1dinvalid_condition_boost_specs\x18\x0e \x03(\x0b\x32\x42.google.cloud.retail.v2.SearchRequest.BoostSpec.ConditionBoostSpec\x12?\n\x0f\x65xperiment_info\x18\x11 \x03(\x0b\x32&.google.cloud.retail.v2.ExperimentInfo\x12g\n\x1c\x63onversational_search_result\x18\x12 \x01(\x0b\x32\x41.google.cloud.retail.v2.SearchResponse.ConversationalSearchResult\x12[\n\x16tile_navigation_result\x18\x13 \x01(\x0b\x32;.google.cloud.retail.v2.SearchResponse.TileNavigationResult\x1a\xc5\x05\n\x0cSearchResult\x12\n\n\x02id\x18\x01 \x01(\t\x12\x30\n\x07product\x18\x02 \x01(\x0b\x32\x1f.google.cloud.retail.v2.Product\x12\x1e\n\x16matching_variant_count\x18\x03 \x01(\x05\x12o\n\x17matching_variant_fields\x18\x04 \x03(\x0b\x32N.google.cloud.retail.v2.SearchResponse.SearchResult.MatchingVariantFieldsEntry\x12k\n\x15variant_rollup_values\x18\x05 \x03(\x0b\x32L.google.cloud.retail.v2.SearchResponse.SearchResult.VariantRollupValuesEntry\x12\x17\n\x0fpersonal_labels\x18\x07 \x03(\t\x12Z\n\x0cmodel_scores\x18\x08 \x03(\x0b\x32\x44.google.cloud.retail.v2.SearchResponse.SearchResult.ModelScoresEntry\x1aX\n\x1aMatchingVariantFieldsEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12)\n\x05value\x18\x02 \x01(\x0b\x32\x1a.google.protobuf.FieldMask:\x02\x38\x01\x1aR\n\x18VariantRollupValuesEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12%\n\x05value\x18\x02 \x01(\x0b\x32\x16.google.protobuf.Value:\x02\x38\x01\x1aV\n\x10ModelScoresEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12\x31\n\x05value\x18\x02 \x01(\x0b\x32\".google.cloud.retail.v2.DoubleList:\x02\x38\x01\x1a\x8e\x02\n\x05\x46\x61\x63\x65t\x12\x0b\n\x03key\x18\x01 \x01(\t\x12G\n\x06values\x18\x02 \x03(\x0b\x32\x37.google.cloud.retail.v2.SearchResponse.Facet.FacetValue\x12\x15\n\rdynamic_facet\x18\x03 \x01(\x08\x1a\x97\x01\n\nFacetValue\x12\x0f\n\x05value\x18\x01 \x01(\tH\x00\x12\x34\n\x08interval\x18\x02 \x01(\x0b\x32 .google.cloud.retail.v2.IntervalH\x00\x12\r\n\x05\x63ount\x18\x03 \x01(\x03\x12\x11\n\tmin_value\x18\x05 \x01(\x01\x12\x11\n\tmax_value\x18\x06 \x01(\x01\x42\r\n\x0b\x66\x61\x63\x65t_value\x1aI\n\x12QueryExpansionInfo\x12\x16\n\x0e\x65xpanded_query\x18\x01 \x01(\x08\x12\x1b\n\x13pinned_result_count\x18\x02 \x01(\x03\x1a\xff\x04\n\x1a\x43onversationalSearchResult\x12\x17\n\x0f\x63onversation_id\x18\x01 \x01(\t\x12\x15\n\rrefined_query\x18\x02 \x01(\t\x12r\n\x12\x61\x64\x64itional_filters\x18\x03 \x03(\x0b\x32R.google.cloud.retail.v2.SearchResponse.ConversationalSearchResult.AdditionalFilterB\x02\x18\x01\x12\x19\n\x11\x66ollowup_question\x18\x04 \x01(\t\x12l\n\x11suggested_answers\x18\x05 \x03(\x0b\x32Q.google.cloud.retail.v2.SearchResponse.ConversationalSearchResult.SuggestedAnswer\x12m\n\x11\x61\x64\x64itional_filter\x18\x06 \x01(\x0b\x32R.google.cloud.retail.v2.SearchResponse.ConversationalSearchResult.AdditionalFilter\x1a\x61\n\x0fSuggestedAnswer\x12N\n\x17product_attribute_value\x18\x01 \x01(\x0b\x32-.google.cloud.retail.v2.ProductAttributeValue\x1a\x62\n\x10\x41\x64\x64itionalFilter\x12N\n\x17product_attribute_value\x18\x01 \x01(\x0b\x32-.google.cloud.retail.v2.ProductAttributeValue\x1a\x43\n\x14TileNavigationResult\x12+\n\x05tiles\x18\x01 \x03(\x0b\x32\x1c.google.cloud.retail.v2.Tile\"\xfb\x02\n\x0e\x45xperimentInfo\x12\x63\n\x19serving_config_experiment\x18\x02 \x01(\x0b\x32>.google.cloud.retail.v2.ExperimentInfo.ServingConfigExperimentH\x00\x12\x39\n\nexperiment\x18\x01 \x01(\tB%\xfa\x41\"\n retail.googleapis.com/Experiment\x1a\xb1\x01\n\x17ServingConfigExperiment\x12I\n\x17original_serving_config\x18\x01 \x01(\tB(\xfa\x41%\n#retail.googleapis.com/ServingConfig\x12K\n\x19\x65xperiment_serving_config\x18\x02 \x01(\tB(\xfa\x41%\n#retail.googleapis.com/ServingConfigB\x15\n\x13\x65xperiment_metadata2\xd8\x02\n\rSearchService\x12\xfb\x01\n\x06Search\x12%.google.cloud.retail.v2.SearchRequest\x1a&.google.cloud.retail.v2.SearchResponse\"\xa1\x01\x82\xd3\xe4\x93\x02\x9a\x01\"E/v2/{placement=projects/*/locations/*/catalogs/*/placements/*}:search:\x01*ZN\"I/v2/{placement=projects/*/locations/*/catalogs/*/servingConfigs/*}:search:\x01*\x1aI\xca\x41\x15retail.googleapis.com\xd2\x41.https://www.googleapis.com/auth/cloud-platformB\xb7\x02\n\x1a\x63om.google.cloud.retail.v2B\x12SearchServiceProtoP\x01Z2cloud.google.com/go/retail/apiv2/retailpb;retailpb\xa2\x02\x06RETAIL\xaa\x02\x16Google.Cloud.Retail.V2\xca\x02\x16Google\\Cloud\\Retail\\V2\xea\x02\x19Google::Cloud::Retail::V2\xea\x41w\n retail.googleapis.com/Experiment\x12Sprojects/{project}/locations/{location}/catalogs/{catalog}/experiments/{experiment}b\x06proto3" - -pool = ::Google::Protobuf::DescriptorPool.generated_pool -pool.add_serialized_file(descriptor_data) - -module Google - module Cloud - module Retail - module V2 - ProductAttributeValue = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.retail.v2.ProductAttributeValue").msgclass - ProductAttributeInterval = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.retail.v2.ProductAttributeInterval").msgclass - Tile = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.retail.v2.Tile").msgclass - SearchRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.retail.v2.SearchRequest").msgclass - SearchRequest::FacetSpec = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.retail.v2.SearchRequest.FacetSpec").msgclass - SearchRequest::FacetSpec::FacetKey = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.retail.v2.SearchRequest.FacetSpec.FacetKey").msgclass - SearchRequest::DynamicFacetSpec = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.retail.v2.SearchRequest.DynamicFacetSpec").msgclass - SearchRequest::DynamicFacetSpec::Mode = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.retail.v2.SearchRequest.DynamicFacetSpec.Mode").enummodule - SearchRequest::BoostSpec = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.retail.v2.SearchRequest.BoostSpec").msgclass - SearchRequest::BoostSpec::ConditionBoostSpec = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.retail.v2.SearchRequest.BoostSpec.ConditionBoostSpec").msgclass - SearchRequest::QueryExpansionSpec = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.retail.v2.SearchRequest.QueryExpansionSpec").msgclass - SearchRequest::QueryExpansionSpec::Condition = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.retail.v2.SearchRequest.QueryExpansionSpec.Condition").enummodule - SearchRequest::PersonalizationSpec = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.retail.v2.SearchRequest.PersonalizationSpec").msgclass - SearchRequest::PersonalizationSpec::Mode = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.retail.v2.SearchRequest.PersonalizationSpec.Mode").enummodule - SearchRequest::SpellCorrectionSpec = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.retail.v2.SearchRequest.SpellCorrectionSpec").msgclass - SearchRequest::SpellCorrectionSpec::Mode = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.retail.v2.SearchRequest.SpellCorrectionSpec.Mode").enummodule - SearchRequest::ConversationalSearchSpec = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.retail.v2.SearchRequest.ConversationalSearchSpec").msgclass - SearchRequest::ConversationalSearchSpec::UserAnswer = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.retail.v2.SearchRequest.ConversationalSearchSpec.UserAnswer").msgclass - SearchRequest::ConversationalSearchSpec::UserAnswer::SelectedAnswer = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.retail.v2.SearchRequest.ConversationalSearchSpec.UserAnswer.SelectedAnswer").msgclass - SearchRequest::TileNavigationSpec = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.retail.v2.SearchRequest.TileNavigationSpec").msgclass - SearchRequest::SearchMode = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.retail.v2.SearchRequest.SearchMode").enummodule - SearchResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.retail.v2.SearchResponse").msgclass - SearchResponse::SearchResult = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.retail.v2.SearchResponse.SearchResult").msgclass - SearchResponse::Facet = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.retail.v2.SearchResponse.Facet").msgclass - SearchResponse::Facet::FacetValue = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.retail.v2.SearchResponse.Facet.FacetValue").msgclass - SearchResponse::QueryExpansionInfo = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.retail.v2.SearchResponse.QueryExpansionInfo").msgclass - SearchResponse::ConversationalSearchResult = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.retail.v2.SearchResponse.ConversationalSearchResult").msgclass - SearchResponse::ConversationalSearchResult::SuggestedAnswer = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.retail.v2.SearchResponse.ConversationalSearchResult.SuggestedAnswer").msgclass - SearchResponse::ConversationalSearchResult::AdditionalFilter = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.retail.v2.SearchResponse.ConversationalSearchResult.AdditionalFilter").msgclass - SearchResponse::TileNavigationResult = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.retail.v2.SearchResponse.TileNavigationResult").msgclass - ExperimentInfo = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.retail.v2.ExperimentInfo").msgclass - ExperimentInfo::ServingConfigExperiment = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.retail.v2.ExperimentInfo.ServingConfigExperiment").msgclass - end - end - end -end diff --git a/owl-bot-staging/google-cloud-retail-v2/lib/google/cloud/retail/v2/search_service_services_pb.rb b/owl-bot-staging/google-cloud-retail-v2/lib/google/cloud/retail/v2/search_service_services_pb.rb deleted file mode 100644 index 48bf05ab1516..000000000000 --- a/owl-bot-staging/google-cloud-retail-v2/lib/google/cloud/retail/v2/search_service_services_pb.rb +++ /dev/null @@ -1,51 +0,0 @@ -# Generated by the protocol buffer compiler. DO NOT EDIT! -# Source: google/cloud/retail/v2/search_service.proto for package 'Google.Cloud.Retail.V2' -# Original file comments: -# 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 -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. -# - -require 'grpc' -require 'google/cloud/retail/v2/search_service_pb' - -module Google - module Cloud - module Retail - module V2 - module SearchService - # Service for search. - # - # This feature is only available for users who have Retail Search enabled. - # Enable Retail Search on Cloud Console before using this feature. - class Service - - include ::GRPC::GenericService - - self.marshal_class_method = :encode - self.unmarshal_class_method = :decode - self.service_name = 'google.cloud.retail.v2.SearchService' - - # Performs a search. - # - # This feature is only available for users who have Retail Search enabled. - # Enable Retail Search on Cloud Console before using this feature. - rpc :Search, ::Google::Cloud::Retail::V2::SearchRequest, ::Google::Cloud::Retail::V2::SearchResponse - end - - Stub = Service.rpc_stub_class - end - end - end - end -end diff --git a/owl-bot-staging/google-cloud-retail-v2/lib/google/cloud/retail/v2/serving_config_pb.rb b/owl-bot-staging/google-cloud-retail-v2/lib/google/cloud/retail/v2/serving_config_pb.rb deleted file mode 100644 index 151bee6ebbef..000000000000 --- a/owl-bot-staging/google-cloud-retail-v2/lib/google/cloud/retail/v2/serving_config_pb.rb +++ /dev/null @@ -1,27 +0,0 @@ -# frozen_string_literal: true -# Generated by the protocol buffer compiler. DO NOT EDIT! -# source: google/cloud/retail/v2/serving_config.proto - -require 'google/protobuf' - -require 'google/api/field_behavior_pb' -require 'google/api/resource_pb' -require 'google/cloud/retail/v2/common_pb' -require 'google/cloud/retail/v2/search_service_pb' - - -descriptor_data = "\n+google/cloud/retail/v2/serving_config.proto\x12\x16google.cloud.retail.v2\x1a\x1fgoogle/api/field_behavior.proto\x1a\x19google/api/resource.proto\x1a#google/cloud/retail/v2/common.proto\x1a+google/cloud/retail/v2/search_service.proto\"\x96\x08\n\rServingConfig\x12\x11\n\x04name\x18\x01 \x01(\tB\x03\xe0\x41\x05\x12\x19\n\x0c\x64isplay_name\x18\x02 \x01(\tB\x03\xe0\x41\x02\x12\x10\n\x08model_id\x18\x03 \x01(\t\x12\x1d\n\x15price_reranking_level\x18\x04 \x01(\t\x12\x19\n\x11\x66\x61\x63\x65t_control_ids\x18\x05 \x03(\t\x12R\n\x12\x64ynamic_facet_spec\x18\x06 \x01(\x0b\x32\x36.google.cloud.retail.v2.SearchRequest.DynamicFacetSpec\x12\x19\n\x11\x62oost_control_ids\x18\x07 \x03(\t\x12\x1a\n\x12\x66ilter_control_ids\x18\t \x03(\t\x12\x1c\n\x14redirect_control_ids\x18\n \x03(\t\x12#\n\x1btwoway_synonyms_control_ids\x18\x12 \x03(\t\x12#\n\x1boneway_synonyms_control_ids\x18\x0c \x03(\t\x12$\n\x1c\x64o_not_associate_control_ids\x18\r \x03(\t\x12\x1f\n\x17replacement_control_ids\x18\x0e \x03(\t\x12\x1a\n\x12ignore_control_ids\x18\x0f \x03(\t\x12\x17\n\x0f\x64iversity_level\x18\x08 \x01(\t\x12K\n\x0e\x64iversity_type\x18\x14 \x01(\x0e\x32\x33.google.cloud.retail.v2.ServingConfig.DiversityType\x12$\n\x1c\x65nable_category_filter_level\x18\x10 \x01(\t\x12\x1c\n\x14ignore_recs_denylist\x18\x18 \x01(\x08\x12W\n\x14personalization_spec\x18\x15 \x01(\x0b\x32\x39.google.cloud.retail.v2.SearchRequest.PersonalizationSpec\x12\x44\n\x0esolution_types\x18\x13 \x03(\x0e\x32$.google.cloud.retail.v2.SolutionTypeB\x06\xe0\x41\x02\xe0\x41\x05\"d\n\rDiversityType\x12\x1e\n\x1a\x44IVERSITY_TYPE_UNSPECIFIED\x10\x00\x12\x18\n\x14RULE_BASED_DIVERSITY\x10\x02\x12\x19\n\x15\x44\x41TA_DRIVEN_DIVERSITY\x10\x03:\x85\x01\xea\x41\x81\x01\n#retail.googleapis.com/ServingConfig\x12Zprojects/{project}/locations/{location}/catalogs/{catalog}/servingConfigs/{serving_config}B\xbd\x01\n\x1a\x63om.google.cloud.retail.v2B\x12ServingConfigProtoP\x01Z2cloud.google.com/go/retail/apiv2/retailpb;retailpb\xa2\x02\x06RETAIL\xaa\x02\x16Google.Cloud.Retail.V2\xca\x02\x16Google\\Cloud\\Retail\\V2\xea\x02\x19Google::Cloud::Retail::V2b\x06proto3" - -pool = ::Google::Protobuf::DescriptorPool.generated_pool -pool.add_serialized_file(descriptor_data) - -module Google - module Cloud - module Retail - module V2 - ServingConfig = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.retail.v2.ServingConfig").msgclass - ServingConfig::DiversityType = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.retail.v2.ServingConfig.DiversityType").enummodule - end - end - end -end diff --git a/owl-bot-staging/google-cloud-retail-v2/lib/google/cloud/retail/v2/serving_config_service.rb b/owl-bot-staging/google-cloud-retail-v2/lib/google/cloud/retail/v2/serving_config_service.rb deleted file mode 100644 index 4a0503a4322d..000000000000 --- a/owl-bot-staging/google-cloud-retail-v2/lib/google/cloud/retail/v2/serving_config_service.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/retail/v2/version" - -require "google/cloud/retail/v2/serving_config_service/credentials" -require "google/cloud/retail/v2/serving_config_service/paths" -require "google/cloud/retail/v2/serving_config_service/client" -require "google/cloud/retail/v2/serving_config_service/rest" - -module Google - module Cloud - module Retail - module V2 - ## - # Service for modifying ServingConfig. - # - # @example Load this service and instantiate a gRPC client - # - # require "google/cloud/retail/v2/serving_config_service" - # client = ::Google::Cloud::Retail::V2::ServingConfigService::Client.new - # - # @example Load this service and instantiate a REST client - # - # require "google/cloud/retail/v2/serving_config_service/rest" - # client = ::Google::Cloud::Retail::V2::ServingConfigService::Rest::Client.new - # - module ServingConfigService - end - end - end - end -end - -helper_path = ::File.join __dir__, "serving_config_service", "helpers.rb" -require "google/cloud/retail/v2/serving_config_service/helpers" if ::File.file? helper_path diff --git a/owl-bot-staging/google-cloud-retail-v2/lib/google/cloud/retail/v2/serving_config_service/client.rb b/owl-bot-staging/google-cloud-retail-v2/lib/google/cloud/retail/v2/serving_config_service/client.rb deleted file mode 100644 index 76f012dfb52e..000000000000 --- a/owl-bot-staging/google-cloud-retail-v2/lib/google/cloud/retail/v2/serving_config_service/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/cloud/retail/v2/serving_config_service_pb" -require "google/cloud/location" - -module Google - module Cloud - module Retail - module V2 - module ServingConfigService - ## - # Client for the ServingConfigService service. - # - # Service for modifying ServingConfig. - # - class Client - # @private - API_VERSION = "" - - # @private - DEFAULT_ENDPOINT_TEMPLATE = "retail.$UNIVERSE_DOMAIN$" - - include Paths - - # @private - attr_reader :serving_config_service_stub - - ## - # Configure the ServingConfigService Client class. - # - # See {::Google::Cloud::Retail::V2::ServingConfigService::Client::Configuration} - # for a description of the configuration fields. - # - # @example - # - # # Modify the configuration for all ServingConfigService clients - # ::Google::Cloud::Retail::V2::ServingConfigService::Client.configure do |config| - # config.timeout = 10.0 - # end - # - # @yield [config] Configure the Client client. - # @yieldparam config [Client::Configuration] - # - # @return [Client::Configuration] - # - def self.configure - @configure ||= begin - namespace = ["Google", "Cloud", "Retail", "V2"] - parent_config = while namespace.any? - parent_name = namespace.join "::" - parent_const = const_get parent_name - break parent_const.configure if parent_const.respond_to? :configure - namespace.pop - end - default_config = Client::Configuration.new parent_config - - default_config - end - yield @configure if block_given? - @configure - end - - ## - # Configure the ServingConfigService Client instance. - # - # The configuration is set to the derived mode, meaning that values can be changed, - # but structural changes (adding new fields, etc.) are not allowed. Structural changes - # should be made on {Client.configure}. - # - # See {::Google::Cloud::Retail::V2::ServingConfigService::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 - @serving_config_service_stub.universe_domain - end - - ## - # Create a new ServingConfigService client object. - # - # @example - # - # # Create a client using the default configuration - # client = ::Google::Cloud::Retail::V2::ServingConfigService::Client.new - # - # # Create a client using a custom configuration - # client = ::Google::Cloud::Retail::V2::ServingConfigService::Client.new do |config| - # config.timeout = 10.0 - # end - # - # @yield [config] Configure the ServingConfigService client. - # @yieldparam config [Client::Configuration] - # - def initialize - # These require statements are intentionally placed here to initialize - # the gRPC module only when it's required. - # See https://github.com/googleapis/toolkit/issues/446 - require "gapic/grpc" - require "google/cloud/retail/v2/serving_config_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 - - @serving_config_service_stub = ::Gapic::ServiceStub.new( - ::Google::Cloud::Retail::V2::ServingConfigService::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 - ) - - @serving_config_service_stub.stub_logger&.info do |entry| - entry.set_system_name - entry.set_service - entry.message = "Created client for #{entry.service}" - entry.set_credentials_fields credentials - entry.set "customEndpoint", @config.endpoint if @config.endpoint - entry.set "defaultTimeout", @config.timeout if @config.timeout - entry.set "quotaProject", @quota_project_id if @quota_project_id - end - - @location_client = Google::Cloud::Location::Locations::Client.new do |config| - config.credentials = credentials - config.quota_project = @quota_project_id - config.endpoint = @serving_config_service_stub.endpoint - config.universe_domain = @serving_config_service_stub.universe_domain - config.logger = @serving_config_service_stub.logger if config.respond_to? :logger= - end - end - - ## - # Get the associated client for mix-in of the Locations. - # - # @return [Google::Cloud::Location::Locations::Client] - # - attr_reader :location_client - - ## - # The logger used for request/response debug logging. - # - # @return [Logger] - # - def logger - @serving_config_service_stub.logger - end - - # Service calls - - ## - # Creates a ServingConfig. - # - # A maximum of 100 {::Google::Cloud::Retail::V2::ServingConfig ServingConfig}s are - # allowed in a {::Google::Cloud::Retail::V2::Catalog Catalog}, otherwise a - # FAILED_PRECONDITION error is returned. - # - # @overload create_serving_config(request, options = nil) - # Pass arguments to `create_serving_config` via a request object, either of type - # {::Google::Cloud::Retail::V2::CreateServingConfigRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Retail::V2::CreateServingConfigRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_serving_config(parent: nil, serving_config: nil, serving_config_id: nil) - # Pass arguments to `create_serving_config` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param parent [::String] - # Required. Full resource name of parent. Format: - # `projects/{project_number}/locations/{location_id}/catalogs/{catalog_id}` - # @param serving_config [::Google::Cloud::Retail::V2::ServingConfig, ::Hash] - # Required. The ServingConfig to create. - # @param serving_config_id [::String] - # Required. The ID to use for the ServingConfig, which will become the final - # component of the ServingConfig's resource name. - # - # This value should be 4-63 characters, and valid characters - # are /[a-z][0-9]-_/. - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Google::Cloud::Retail::V2::ServingConfig] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Google::Cloud::Retail::V2::ServingConfig] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/cloud/retail/v2" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Retail::V2::ServingConfigService::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Retail::V2::CreateServingConfigRequest.new - # - # # Call the create_serving_config method. - # result = client.create_serving_config request - # - # # The returned object is of type Google::Cloud::Retail::V2::ServingConfig. - # p result - # - def create_serving_config request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Retail::V2::CreateServingConfigRequest - - # Converts hash 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_serving_config.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::Retail::V2::VERSION - metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - header_params = {} - if request.parent - 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_serving_config.timeout, - metadata: metadata, - retry_policy: @config.rpcs.create_serving_config.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @serving_config_service_stub.call_rpc :create_serving_config, request, options: options do |response, operation| - yield response, operation if block_given? - end - rescue ::GRPC::BadStatus => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Deletes a ServingConfig. - # - # Returns a NotFound error if the ServingConfig does not exist. - # - # @overload delete_serving_config(request, options = nil) - # Pass arguments to `delete_serving_config` via a request object, either of type - # {::Google::Cloud::Retail::V2::DeleteServingConfigRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Retail::V2::DeleteServingConfigRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_serving_config(name: nil) - # Pass arguments to `delete_serving_config` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param name [::String] - # Required. The resource name of the ServingConfig to delete. Format: - # `projects/{project_number}/locations/{location_id}/catalogs/{catalog_id}/servingConfigs/{serving_config_id}` - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Google::Protobuf::Empty] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Google::Protobuf::Empty] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/cloud/retail/v2" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Retail::V2::ServingConfigService::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Retail::V2::DeleteServingConfigRequest.new - # - # # Call the delete_serving_config method. - # result = client.delete_serving_config request - # - # # The returned object is of type Google::Protobuf::Empty. - # p result - # - def delete_serving_config request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Retail::V2::DeleteServingConfigRequest - - # Converts hash 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_serving_config.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::Retail::V2::VERSION - metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - header_params = {} - if request.name - header_params["name"] = request.name - end - - request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") - metadata[:"x-goog-request-params"] ||= request_params_header - - options.apply_defaults timeout: @config.rpcs.delete_serving_config.timeout, - metadata: metadata, - retry_policy: @config.rpcs.delete_serving_config.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @serving_config_service_stub.call_rpc :delete_serving_config, request, options: options do |response, operation| - yield response, operation if block_given? - end - rescue ::GRPC::BadStatus => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Updates a ServingConfig. - # - # @overload update_serving_config(request, options = nil) - # Pass arguments to `update_serving_config` via a request object, either of type - # {::Google::Cloud::Retail::V2::UpdateServingConfigRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Retail::V2::UpdateServingConfigRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_serving_config(serving_config: nil, update_mask: nil) - # Pass arguments to `update_serving_config` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param serving_config [::Google::Cloud::Retail::V2::ServingConfig, ::Hash] - # Required. The ServingConfig to update. - # @param update_mask [::Google::Protobuf::FieldMask, ::Hash] - # Indicates which fields in the provided - # {::Google::Cloud::Retail::V2::ServingConfig ServingConfig} to update. The - # following are NOT supported: - # - # * {::Google::Cloud::Retail::V2::ServingConfig#name ServingConfig.name} - # - # If not set, all supported fields are updated. - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Google::Cloud::Retail::V2::ServingConfig] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Google::Cloud::Retail::V2::ServingConfig] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/cloud/retail/v2" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Retail::V2::ServingConfigService::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Retail::V2::UpdateServingConfigRequest.new - # - # # Call the update_serving_config method. - # result = client.update_serving_config request - # - # # The returned object is of type Google::Cloud::Retail::V2::ServingConfig. - # p result - # - def update_serving_config request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Retail::V2::UpdateServingConfigRequest - - # Converts hash 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_serving_config.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::Retail::V2::VERSION - metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - header_params = {} - if request.serving_config&.name - header_params["serving_config.name"] = request.serving_config.name - end - - request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") - metadata[:"x-goog-request-params"] ||= request_params_header - - options.apply_defaults timeout: @config.rpcs.update_serving_config.timeout, - metadata: metadata, - retry_policy: @config.rpcs.update_serving_config.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @serving_config_service_stub.call_rpc :update_serving_config, request, options: options do |response, operation| - yield response, operation if block_given? - end - rescue ::GRPC::BadStatus => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Gets a ServingConfig. - # - # Returns a NotFound error if the ServingConfig does not exist. - # - # @overload get_serving_config(request, options = nil) - # Pass arguments to `get_serving_config` via a request object, either of type - # {::Google::Cloud::Retail::V2::GetServingConfigRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Retail::V2::GetServingConfigRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_serving_config(name: nil) - # Pass arguments to `get_serving_config` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param name [::String] - # Required. The resource name of the ServingConfig to get. Format: - # `projects/{project_number}/locations/{location_id}/catalogs/{catalog_id}/servingConfigs/{serving_config_id}` - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Google::Cloud::Retail::V2::ServingConfig] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Google::Cloud::Retail::V2::ServingConfig] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/cloud/retail/v2" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Retail::V2::ServingConfigService::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Retail::V2::GetServingConfigRequest.new - # - # # Call the get_serving_config method. - # result = client.get_serving_config request - # - # # The returned object is of type Google::Cloud::Retail::V2::ServingConfig. - # p result - # - def get_serving_config request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Retail::V2::GetServingConfigRequest - - # Converts hash 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_serving_config.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::Retail::V2::VERSION - metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - header_params = {} - if request.name - header_params["name"] = request.name - end - - request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") - metadata[:"x-goog-request-params"] ||= request_params_header - - options.apply_defaults timeout: @config.rpcs.get_serving_config.timeout, - metadata: metadata, - retry_policy: @config.rpcs.get_serving_config.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @serving_config_service_stub.call_rpc :get_serving_config, request, options: options do |response, operation| - yield response, operation if block_given? - end - rescue ::GRPC::BadStatus => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Lists all ServingConfigs linked to this catalog. - # - # @overload list_serving_configs(request, options = nil) - # Pass arguments to `list_serving_configs` via a request object, either of type - # {::Google::Cloud::Retail::V2::ListServingConfigsRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Retail::V2::ListServingConfigsRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_serving_configs(parent: nil, page_size: nil, page_token: nil) - # Pass arguments to `list_serving_configs` via keyword arguments. Note that at - # least one keyword argument is 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 catalog resource name. Format: - # `projects/{project_number}/locations/{location_id}/catalogs/{catalog_id}` - # @param page_size [::Integer] - # Optional. Maximum number of results to return. If unspecified, defaults - # to 100. If a value greater than 100 is provided, at most 100 results are - # returned. - # @param page_token [::String] - # Optional. A page token, received from a previous `ListServingConfigs` call. - # Provide this to retrieve the subsequent page. - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Gapic::PagedEnumerable<::Google::Cloud::Retail::V2::ServingConfig>] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Gapic::PagedEnumerable<::Google::Cloud::Retail::V2::ServingConfig>] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/cloud/retail/v2" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Retail::V2::ServingConfigService::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Retail::V2::ListServingConfigsRequest.new - # - # # Call the list_serving_configs method. - # result = client.list_serving_configs request - # - # # The returned object is of type Gapic::PagedEnumerable. You can iterate - # # over elements, and API calls will be issued to fetch pages as needed. - # result.each do |item| - # # Each element is of type ::Google::Cloud::Retail::V2::ServingConfig. - # p item - # end - # - def list_serving_configs request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Retail::V2::ListServingConfigsRequest - - # Converts hash 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_serving_configs.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::Retail::V2::VERSION - metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - header_params = {} - if request.parent - 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_serving_configs.timeout, - metadata: metadata, - retry_policy: @config.rpcs.list_serving_configs.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @serving_config_service_stub.call_rpc :list_serving_configs, request, options: options do |response, operation| - response = ::Gapic::PagedEnumerable.new @serving_config_service_stub, :list_serving_configs, 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 - - ## - # Enables a Control on the specified ServingConfig. - # The control is added in the last position of the list of controls - # it belongs to (e.g. if it's a facet spec control it will be applied - # in the last position of servingConfig.facetSpecIds) - # Returns a ALREADY_EXISTS error if the control has already been applied. - # Returns a FAILED_PRECONDITION error if the addition could exceed maximum - # number of control allowed for that type of control. - # - # @overload add_control(request, options = nil) - # Pass arguments to `add_control` via a request object, either of type - # {::Google::Cloud::Retail::V2::AddControlRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Retail::V2::AddControlRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. - # - # @overload add_control(serving_config: nil, control_id: nil) - # Pass arguments to `add_control` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param serving_config [::String] - # Required. The source ServingConfig resource name . Format: - # `projects/{project_number}/locations/{location_id}/catalogs/{catalog_id}/servingConfigs/{serving_config_id}` - # @param control_id [::String] - # Required. The id of the control to apply. Assumed to be in the same catalog - # as the serving config - if id is not found a NOT_FOUND error is returned. - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Google::Cloud::Retail::V2::ServingConfig] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Google::Cloud::Retail::V2::ServingConfig] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/cloud/retail/v2" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Retail::V2::ServingConfigService::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Retail::V2::AddControlRequest.new - # - # # Call the add_control method. - # result = client.add_control request - # - # # The returned object is of type Google::Cloud::Retail::V2::ServingConfig. - # p result - # - def add_control request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Retail::V2::AddControlRequest - - # Converts hash and nil to an options object - options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h - - # Customize the options with defaults - metadata = @config.rpcs.add_control.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::Retail::V2::VERSION - metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - header_params = {} - if request.serving_config - header_params["serving_config"] = request.serving_config - end - - request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") - metadata[:"x-goog-request-params"] ||= request_params_header - - options.apply_defaults timeout: @config.rpcs.add_control.timeout, - metadata: metadata, - retry_policy: @config.rpcs.add_control.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @serving_config_service_stub.call_rpc :add_control, request, options: options do |response, operation| - yield response, operation if block_given? - end - rescue ::GRPC::BadStatus => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Disables a Control on the specified ServingConfig. - # The control is removed from the ServingConfig. - # Returns a NOT_FOUND error if the Control is not enabled for the - # ServingConfig. - # - # @overload remove_control(request, options = nil) - # Pass arguments to `remove_control` via a request object, either of type - # {::Google::Cloud::Retail::V2::RemoveControlRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Retail::V2::RemoveControlRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. - # - # @overload remove_control(serving_config: nil, control_id: nil) - # Pass arguments to `remove_control` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param serving_config [::String] - # Required. The source ServingConfig resource name . Format: - # `projects/{project_number}/locations/{location_id}/catalogs/{catalog_id}/servingConfigs/{serving_config_id}` - # @param control_id [::String] - # Required. The id of the control to apply. Assumed to be in the same catalog - # as the serving config. - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Google::Cloud::Retail::V2::ServingConfig] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Google::Cloud::Retail::V2::ServingConfig] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/cloud/retail/v2" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Retail::V2::ServingConfigService::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Retail::V2::RemoveControlRequest.new - # - # # Call the remove_control method. - # result = client.remove_control request - # - # # The returned object is of type Google::Cloud::Retail::V2::ServingConfig. - # p result - # - def remove_control request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Retail::V2::RemoveControlRequest - - # Converts hash 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.remove_control.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::Retail::V2::VERSION - metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - header_params = {} - if request.serving_config - header_params["serving_config"] = request.serving_config - 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.remove_control.timeout, - metadata: metadata, - retry_policy: @config.rpcs.remove_control.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @serving_config_service_stub.call_rpc :remove_control, request, options: options do |response, operation| - yield response, operation if block_given? - end - rescue ::GRPC::BadStatus => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Configuration class for the ServingConfigService API. - # - # This class represents the configuration for ServingConfigService, - # providing control over timeouts, retry behavior, logging, transport - # parameters, and other low-level controls. Certain parameters can also be - # applied individually to specific RPCs. See - # {::Google::Cloud::Retail::V2::ServingConfigService::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_serving_config to 20 seconds, - # # and all remaining timeouts to 10 seconds. - # ::Google::Cloud::Retail::V2::ServingConfigService::Client.configure do |config| - # config.timeout = 10.0 - # config.rpcs.create_serving_config.timeout = 20.0 - # end - # - # # Apply the above configuration only to a new client. - # client = ::Google::Cloud::Retail::V2::ServingConfigService::Client.new do |config| - # config.timeout = 10.0 - # config.rpcs.create_serving_config.timeout = 20.0 - # end - # - # @!attribute [rw] endpoint - # A custom service endpoint, as a hostname or hostname:port. The default is - # nil, indicating to use the default endpoint in the current universe domain. - # @return [::String,nil] - # @!attribute [rw] credentials - # Credentials to send with calls. You may provide any of the following types: - # * (`Google::Auth::Credentials`) A googleauth credentials object - # (see the [googleauth docs](https://rubydoc.info/gems/googleauth/Google/Auth/Credentials)) - # * (`Signet::OAuth2::Client`) A signet oauth2 client object - # (see the [signet docs](https://rubydoc.info/gems/signet/Signet/OAuth2/Client)) - # * (`GRPC::Core::Channel`) a gRPC channel with included credentials - # * (`GRPC::Core::ChannelCredentials`) a gRPC credentails object - # * (`nil`) indicating no credentials - # - # @note Warning: Passing a `String` to a keyfile path or a `Hash` of credentials - # is deprecated. Providing an unvalidated credential configuration to - # Google APIs can compromise the security of your systems and data. - # - # @example - # - # # The recommended way to provide credentials is to use the `make_creds` method - # # on the appropriate credentials class for your environment. - # - # require "googleauth" - # - # credentials = ::Google::Auth::ServiceAccountCredentials.make_creds( - # json_key_io: ::File.open("/path/to/keyfile.json") - # ) - # - # client = ::Google::Cloud::Retail::V2::ServingConfigService::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 = "retail.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 ServingConfigService 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_serving_config` - # @return [::Gapic::Config::Method] - # - attr_reader :create_serving_config - ## - # RPC-specific configuration for `delete_serving_config` - # @return [::Gapic::Config::Method] - # - attr_reader :delete_serving_config - ## - # RPC-specific configuration for `update_serving_config` - # @return [::Gapic::Config::Method] - # - attr_reader :update_serving_config - ## - # RPC-specific configuration for `get_serving_config` - # @return [::Gapic::Config::Method] - # - attr_reader :get_serving_config - ## - # RPC-specific configuration for `list_serving_configs` - # @return [::Gapic::Config::Method] - # - attr_reader :list_serving_configs - ## - # RPC-specific configuration for `add_control` - # @return [::Gapic::Config::Method] - # - attr_reader :add_control - ## - # RPC-specific configuration for `remove_control` - # @return [::Gapic::Config::Method] - # - attr_reader :remove_control - - # @private - def initialize parent_rpcs = nil - create_serving_config_config = parent_rpcs.create_serving_config if parent_rpcs.respond_to? :create_serving_config - @create_serving_config = ::Gapic::Config::Method.new create_serving_config_config - delete_serving_config_config = parent_rpcs.delete_serving_config if parent_rpcs.respond_to? :delete_serving_config - @delete_serving_config = ::Gapic::Config::Method.new delete_serving_config_config - update_serving_config_config = parent_rpcs.update_serving_config if parent_rpcs.respond_to? :update_serving_config - @update_serving_config = ::Gapic::Config::Method.new update_serving_config_config - get_serving_config_config = parent_rpcs.get_serving_config if parent_rpcs.respond_to? :get_serving_config - @get_serving_config = ::Gapic::Config::Method.new get_serving_config_config - list_serving_configs_config = parent_rpcs.list_serving_configs if parent_rpcs.respond_to? :list_serving_configs - @list_serving_configs = ::Gapic::Config::Method.new list_serving_configs_config - add_control_config = parent_rpcs.add_control if parent_rpcs.respond_to? :add_control - @add_control = ::Gapic::Config::Method.new add_control_config - remove_control_config = parent_rpcs.remove_control if parent_rpcs.respond_to? :remove_control - @remove_control = ::Gapic::Config::Method.new remove_control_config - - yield self if block_given? - end - end - end - end - end - end - end - end -end diff --git a/owl-bot-staging/google-cloud-retail-v2/lib/google/cloud/retail/v2/serving_config_service/credentials.rb b/owl-bot-staging/google-cloud-retail-v2/lib/google/cloud/retail/v2/serving_config_service/credentials.rb deleted file mode 100644 index c42ba1c10eee..000000000000 --- a/owl-bot-staging/google-cloud-retail-v2/lib/google/cloud/retail/v2/serving_config_service/credentials.rb +++ /dev/null @@ -1,51 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -require "googleauth" - -module Google - module Cloud - module Retail - module V2 - module ServingConfigService - # Credentials for the ServingConfigService API. - class Credentials < ::Google::Auth::Credentials - self.scope = [ - "https://www.googleapis.com/auth/cloud-platform" - ] - self.env_vars = [ - "RETAIL_CREDENTIALS", - "RETAIL_KEYFILE", - "GOOGLE_CLOUD_CREDENTIALS", - "GOOGLE_CLOUD_KEYFILE", - "GCLOUD_KEYFILE", - "RETAIL_CREDENTIALS_JSON", - "RETAIL_KEYFILE_JSON", - "GOOGLE_CLOUD_CREDENTIALS_JSON", - "GOOGLE_CLOUD_KEYFILE_JSON", - "GCLOUD_KEYFILE_JSON" - ] - self.paths = [ - "~/.config/google_cloud/application_default_credentials.json" - ] - end - end - end - end - end -end diff --git a/owl-bot-staging/google-cloud-retail-v2/lib/google/cloud/retail/v2/serving_config_service/paths.rb b/owl-bot-staging/google-cloud-retail-v2/lib/google/cloud/retail/v2/serving_config_service/paths.rb deleted file mode 100644 index bb9d885a6589..000000000000 --- a/owl-bot-staging/google-cloud-retail-v2/lib/google/cloud/retail/v2/serving_config_service/paths.rb +++ /dev/null @@ -1,73 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - - -module Google - module Cloud - module Retail - module V2 - module ServingConfigService - # Path helper methods for the ServingConfigService API. - module Paths - ## - # Create a fully-qualified Catalog resource string. - # - # The resource will be in the following format: - # - # `projects/{project}/locations/{location}/catalogs/{catalog}` - # - # @param project [String] - # @param location [String] - # @param catalog [String] - # - # @return [::String] - def catalog_path project:, location:, catalog: - raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" - raise ::ArgumentError, "location cannot contain /" if location.to_s.include? "/" - - "projects/#{project}/locations/#{location}/catalogs/#{catalog}" - end - - ## - # Create a fully-qualified ServingConfig resource string. - # - # The resource will be in the following format: - # - # `projects/{project}/locations/{location}/catalogs/{catalog}/servingConfigs/{serving_config}` - # - # @param project [String] - # @param location [String] - # @param catalog [String] - # @param serving_config [String] - # - # @return [::String] - def serving_config_path project:, location:, catalog:, serving_config: - raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" - raise ::ArgumentError, "location cannot contain /" if location.to_s.include? "/" - raise ::ArgumentError, "catalog cannot contain /" if catalog.to_s.include? "/" - - "projects/#{project}/locations/#{location}/catalogs/#{catalog}/servingConfigs/#{serving_config}" - end - - extend self - end - end - end - end - end -end diff --git a/owl-bot-staging/google-cloud-retail-v2/lib/google/cloud/retail/v2/serving_config_service/rest.rb b/owl-bot-staging/google-cloud-retail-v2/lib/google/cloud/retail/v2/serving_config_service/rest.rb deleted file mode 100644 index f2b31df2bbc7..000000000000 --- a/owl-bot-staging/google-cloud-retail-v2/lib/google/cloud/retail/v2/serving_config_service/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/retail/v2/version" - -require "google/cloud/retail/v2/serving_config_service/credentials" -require "google/cloud/retail/v2/serving_config_service/paths" -require "google/cloud/retail/v2/serving_config_service/rest/client" - -module Google - module Cloud - module Retail - module V2 - ## - # Service for modifying ServingConfig. - # - # To load this service and instantiate a REST client: - # - # require "google/cloud/retail/v2/serving_config_service/rest" - # client = ::Google::Cloud::Retail::V2::ServingConfigService::Rest::Client.new - # - module ServingConfigService - # Client for the REST transport - module Rest - end - end - end - end - end -end - -helper_path = ::File.join __dir__, "rest", "helpers.rb" -require "google/cloud/retail/v2/serving_config_service/rest/helpers" if ::File.file? helper_path diff --git a/owl-bot-staging/google-cloud-retail-v2/lib/google/cloud/retail/v2/serving_config_service/rest/client.rb b/owl-bot-staging/google-cloud-retail-v2/lib/google/cloud/retail/v2/serving_config_service/rest/client.rb deleted file mode 100644 index c519c160aea0..000000000000 --- a/owl-bot-staging/google-cloud-retail-v2/lib/google/cloud/retail/v2/serving_config_service/rest/client.rb +++ /dev/null @@ -1,1008 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -require "google/cloud/errors" -require "google/cloud/retail/v2/serving_config_service_pb" -require "google/cloud/retail/v2/serving_config_service/rest/service_stub" -require "google/cloud/location/rest" - -module Google - module Cloud - module Retail - module V2 - module ServingConfigService - module Rest - ## - # REST client for the ServingConfigService service. - # - # Service for modifying ServingConfig. - # - class Client - # @private - API_VERSION = "" - - # @private - DEFAULT_ENDPOINT_TEMPLATE = "retail.$UNIVERSE_DOMAIN$" - - include Paths - - # @private - attr_reader :serving_config_service_stub - - ## - # Configure the ServingConfigService Client class. - # - # See {::Google::Cloud::Retail::V2::ServingConfigService::Rest::Client::Configuration} - # for a description of the configuration fields. - # - # @example - # - # # Modify the configuration for all ServingConfigService clients - # ::Google::Cloud::Retail::V2::ServingConfigService::Rest::Client.configure do |config| - # config.timeout = 10.0 - # end - # - # @yield [config] Configure the Client client. - # @yieldparam config [Client::Configuration] - # - # @return [Client::Configuration] - # - def self.configure - @configure ||= begin - namespace = ["Google", "Cloud", "Retail", "V2"] - parent_config = while namespace.any? - parent_name = namespace.join "::" - parent_const = const_get parent_name - break parent_const.configure if parent_const.respond_to? :configure - namespace.pop - end - default_config = Client::Configuration.new parent_config - - default_config - end - yield @configure if block_given? - @configure - end - - ## - # Configure the ServingConfigService Client instance. - # - # The configuration is set to the derived mode, meaning that values can be changed, - # but structural changes (adding new fields, etc.) are not allowed. Structural changes - # should be made on {Client.configure}. - # - # See {::Google::Cloud::Retail::V2::ServingConfigService::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 - @serving_config_service_stub.universe_domain - end - - ## - # Create a new ServingConfigService REST client object. - # - # @example - # - # # Create a client using the default configuration - # client = ::Google::Cloud::Retail::V2::ServingConfigService::Rest::Client.new - # - # # Create a client using a custom configuration - # client = ::Google::Cloud::Retail::V2::ServingConfigService::Rest::Client.new do |config| - # config.timeout = 10.0 - # end - # - # @yield [config] Configure the ServingConfigService 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 - - @serving_config_service_stub = ::Google::Cloud::Retail::V2::ServingConfigService::Rest::ServiceStub.new( - endpoint: @config.endpoint, - endpoint_template: DEFAULT_ENDPOINT_TEMPLATE, - universe_domain: @config.universe_domain, - credentials: credentials, - logger: @config.logger - ) - - @serving_config_service_stub.logger(stub: true)&.info do |entry| - entry.set_system_name - entry.set_service - entry.message = "Created client for #{entry.service}" - entry.set_credentials_fields credentials - entry.set "customEndpoint", @config.endpoint if @config.endpoint - entry.set "defaultTimeout", @config.timeout if @config.timeout - entry.set "quotaProject", @quota_project_id if @quota_project_id - end - - @location_client = Google::Cloud::Location::Locations::Rest::Client.new do |config| - config.credentials = credentials - config.quota_project = @quota_project_id - config.endpoint = @serving_config_service_stub.endpoint - config.universe_domain = @serving_config_service_stub.universe_domain - config.logger = @serving_config_service_stub.logger if config.respond_to? :logger= - end - end - - ## - # Get the associated client for mix-in of the Locations. - # - # @return [Google::Cloud::Location::Locations::Rest::Client] - # - attr_reader :location_client - - ## - # The logger used for request/response debug logging. - # - # @return [Logger] - # - def logger - @serving_config_service_stub.logger - end - - # Service calls - - ## - # Creates a ServingConfig. - # - # A maximum of 100 {::Google::Cloud::Retail::V2::ServingConfig ServingConfig}s are - # allowed in a {::Google::Cloud::Retail::V2::Catalog Catalog}, otherwise a - # FAILED_PRECONDITION error is returned. - # - # @overload create_serving_config(request, options = nil) - # Pass arguments to `create_serving_config` via a request object, either of type - # {::Google::Cloud::Retail::V2::CreateServingConfigRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Retail::V2::CreateServingConfigRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_serving_config(parent: nil, serving_config: nil, serving_config_id: nil) - # Pass arguments to `create_serving_config` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param parent [::String] - # Required. Full resource name of parent. Format: - # `projects/{project_number}/locations/{location_id}/catalogs/{catalog_id}` - # @param serving_config [::Google::Cloud::Retail::V2::ServingConfig, ::Hash] - # Required. The ServingConfig to create. - # @param serving_config_id [::String] - # Required. The ID to use for the ServingConfig, which will become the final - # component of the ServingConfig's resource name. - # - # This value should be 4-63 characters, and valid characters - # are /[a-z][0-9]-_/. - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Cloud::Retail::V2::ServingConfig] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::Retail::V2::ServingConfig] - # - # @raise [::Google::Cloud::Error] if the REST call is aborted. - # - # @example Basic example - # require "google/cloud/retail/v2" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Retail::V2::ServingConfigService::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Retail::V2::CreateServingConfigRequest.new - # - # # Call the create_serving_config method. - # result = client.create_serving_config request - # - # # The returned object is of type Google::Cloud::Retail::V2::ServingConfig. - # p result - # - def create_serving_config request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Retail::V2::CreateServingConfigRequest - - # Converts hash 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_serving_config.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::Retail::V2::VERSION, - transports_version_send: [:rest] - - call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - options.apply_defaults timeout: @config.rpcs.create_serving_config.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.create_serving_config.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @serving_config_service_stub.create_serving_config request, options do |result, operation| - yield result, operation if block_given? - end - rescue ::Gapic::Rest::Error => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Deletes a ServingConfig. - # - # Returns a NotFound error if the ServingConfig does not exist. - # - # @overload delete_serving_config(request, options = nil) - # Pass arguments to `delete_serving_config` via a request object, either of type - # {::Google::Cloud::Retail::V2::DeleteServingConfigRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Retail::V2::DeleteServingConfigRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_serving_config(name: nil) - # Pass arguments to `delete_serving_config` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param name [::String] - # Required. The resource name of the ServingConfig to delete. Format: - # `projects/{project_number}/locations/{location_id}/catalogs/{catalog_id}/servingConfigs/{serving_config_id}` - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Protobuf::Empty] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Protobuf::Empty] - # - # @raise [::Google::Cloud::Error] if the REST call is aborted. - # - # @example Basic example - # require "google/cloud/retail/v2" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Retail::V2::ServingConfigService::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Retail::V2::DeleteServingConfigRequest.new - # - # # Call the delete_serving_config method. - # result = client.delete_serving_config request - # - # # The returned object is of type Google::Protobuf::Empty. - # p result - # - def delete_serving_config request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Retail::V2::DeleteServingConfigRequest - - # Converts hash 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_serving_config.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::Retail::V2::VERSION, - transports_version_send: [:rest] - - call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - options.apply_defaults timeout: @config.rpcs.delete_serving_config.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.delete_serving_config.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @serving_config_service_stub.delete_serving_config request, options do |result, operation| - yield result, operation if block_given? - end - rescue ::Gapic::Rest::Error => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Updates a ServingConfig. - # - # @overload update_serving_config(request, options = nil) - # Pass arguments to `update_serving_config` via a request object, either of type - # {::Google::Cloud::Retail::V2::UpdateServingConfigRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Retail::V2::UpdateServingConfigRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_serving_config(serving_config: nil, update_mask: nil) - # Pass arguments to `update_serving_config` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param serving_config [::Google::Cloud::Retail::V2::ServingConfig, ::Hash] - # Required. The ServingConfig to update. - # @param update_mask [::Google::Protobuf::FieldMask, ::Hash] - # Indicates which fields in the provided - # {::Google::Cloud::Retail::V2::ServingConfig ServingConfig} to update. The - # following are NOT supported: - # - # * {::Google::Cloud::Retail::V2::ServingConfig#name ServingConfig.name} - # - # If not set, all supported fields are updated. - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Cloud::Retail::V2::ServingConfig] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::Retail::V2::ServingConfig] - # - # @raise [::Google::Cloud::Error] if the REST call is aborted. - # - # @example Basic example - # require "google/cloud/retail/v2" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Retail::V2::ServingConfigService::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Retail::V2::UpdateServingConfigRequest.new - # - # # Call the update_serving_config method. - # result = client.update_serving_config request - # - # # The returned object is of type Google::Cloud::Retail::V2::ServingConfig. - # p result - # - def update_serving_config request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Retail::V2::UpdateServingConfigRequest - - # Converts hash 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_serving_config.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::Retail::V2::VERSION, - transports_version_send: [:rest] - - call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - options.apply_defaults timeout: @config.rpcs.update_serving_config.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.update_serving_config.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @serving_config_service_stub.update_serving_config request, options do |result, operation| - yield result, operation if block_given? - end - rescue ::Gapic::Rest::Error => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Gets a ServingConfig. - # - # Returns a NotFound error if the ServingConfig does not exist. - # - # @overload get_serving_config(request, options = nil) - # Pass arguments to `get_serving_config` via a request object, either of type - # {::Google::Cloud::Retail::V2::GetServingConfigRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Retail::V2::GetServingConfigRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_serving_config(name: nil) - # Pass arguments to `get_serving_config` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param name [::String] - # Required. The resource name of the ServingConfig to get. Format: - # `projects/{project_number}/locations/{location_id}/catalogs/{catalog_id}/servingConfigs/{serving_config_id}` - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Cloud::Retail::V2::ServingConfig] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::Retail::V2::ServingConfig] - # - # @raise [::Google::Cloud::Error] if the REST call is aborted. - # - # @example Basic example - # require "google/cloud/retail/v2" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Retail::V2::ServingConfigService::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Retail::V2::GetServingConfigRequest.new - # - # # Call the get_serving_config method. - # result = client.get_serving_config request - # - # # The returned object is of type Google::Cloud::Retail::V2::ServingConfig. - # p result - # - def get_serving_config request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Retail::V2::GetServingConfigRequest - - # Converts hash 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_serving_config.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::Retail::V2::VERSION, - transports_version_send: [:rest] - - call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - options.apply_defaults timeout: @config.rpcs.get_serving_config.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.get_serving_config.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @serving_config_service_stub.get_serving_config request, options do |result, operation| - yield result, operation if block_given? - end - rescue ::Gapic::Rest::Error => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Lists all ServingConfigs linked to this catalog. - # - # @overload list_serving_configs(request, options = nil) - # Pass arguments to `list_serving_configs` via a request object, either of type - # {::Google::Cloud::Retail::V2::ListServingConfigsRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Retail::V2::ListServingConfigsRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_serving_configs(parent: nil, page_size: nil, page_token: nil) - # Pass arguments to `list_serving_configs` via keyword arguments. Note that at - # least one keyword argument is 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 catalog resource name. Format: - # `projects/{project_number}/locations/{location_id}/catalogs/{catalog_id}` - # @param page_size [::Integer] - # Optional. Maximum number of results to return. If unspecified, defaults - # to 100. If a value greater than 100 is provided, at most 100 results are - # returned. - # @param page_token [::String] - # Optional. A page token, received from a previous `ListServingConfigs` call. - # Provide this to retrieve the subsequent page. - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Gapic::Rest::PagedEnumerable<::Google::Cloud::Retail::V2::ServingConfig>] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Gapic::Rest::PagedEnumerable<::Google::Cloud::Retail::V2::ServingConfig>] - # - # @raise [::Google::Cloud::Error] if the REST call is aborted. - # - # @example Basic example - # require "google/cloud/retail/v2" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Retail::V2::ServingConfigService::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Retail::V2::ListServingConfigsRequest.new - # - # # Call the list_serving_configs method. - # result = client.list_serving_configs request - # - # # The returned object is of type Gapic::PagedEnumerable. You can iterate - # # over elements, and API calls will be issued to fetch pages as needed. - # result.each do |item| - # # Each element is of type ::Google::Cloud::Retail::V2::ServingConfig. - # p item - # end - # - def list_serving_configs request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Retail::V2::ListServingConfigsRequest - - # Converts hash 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_serving_configs.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::Retail::V2::VERSION, - transports_version_send: [:rest] - - call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - options.apply_defaults timeout: @config.rpcs.list_serving_configs.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.list_serving_configs.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @serving_config_service_stub.list_serving_configs request, options do |result, operation| - result = ::Gapic::Rest::PagedEnumerable.new @serving_config_service_stub, :list_serving_configs, "serving_configs", 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 - - ## - # Enables a Control on the specified ServingConfig. - # The control is added in the last position of the list of controls - # it belongs to (e.g. if it's a facet spec control it will be applied - # in the last position of servingConfig.facetSpecIds) - # Returns a ALREADY_EXISTS error if the control has already been applied. - # Returns a FAILED_PRECONDITION error if the addition could exceed maximum - # number of control allowed for that type of control. - # - # @overload add_control(request, options = nil) - # Pass arguments to `add_control` via a request object, either of type - # {::Google::Cloud::Retail::V2::AddControlRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Retail::V2::AddControlRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @overload add_control(serving_config: nil, control_id: nil) - # Pass arguments to `add_control` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param serving_config [::String] - # Required. The source ServingConfig resource name . Format: - # `projects/{project_number}/locations/{location_id}/catalogs/{catalog_id}/servingConfigs/{serving_config_id}` - # @param control_id [::String] - # Required. The id of the control to apply. Assumed to be in the same catalog - # as the serving config - if id is not found a NOT_FOUND error is returned. - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Cloud::Retail::V2::ServingConfig] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::Retail::V2::ServingConfig] - # - # @raise [::Google::Cloud::Error] if the REST call is aborted. - # - # @example Basic example - # require "google/cloud/retail/v2" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Retail::V2::ServingConfigService::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Retail::V2::AddControlRequest.new - # - # # Call the add_control method. - # result = client.add_control request - # - # # The returned object is of type Google::Cloud::Retail::V2::ServingConfig. - # p result - # - def add_control request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Retail::V2::AddControlRequest - - # Converts hash and nil to an options object - options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h - - # Customize the options with defaults - call_metadata = @config.rpcs.add_control.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::Retail::V2::VERSION, - transports_version_send: [:rest] - - call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - options.apply_defaults timeout: @config.rpcs.add_control.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.add_control.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @serving_config_service_stub.add_control request, options do |result, operation| - yield result, operation if block_given? - end - rescue ::Gapic::Rest::Error => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Disables a Control on the specified ServingConfig. - # The control is removed from the ServingConfig. - # Returns a NOT_FOUND error if the Control is not enabled for the - # ServingConfig. - # - # @overload remove_control(request, options = nil) - # Pass arguments to `remove_control` via a request object, either of type - # {::Google::Cloud::Retail::V2::RemoveControlRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Retail::V2::RemoveControlRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @overload remove_control(serving_config: nil, control_id: nil) - # Pass arguments to `remove_control` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param serving_config [::String] - # Required. The source ServingConfig resource name . Format: - # `projects/{project_number}/locations/{location_id}/catalogs/{catalog_id}/servingConfigs/{serving_config_id}` - # @param control_id [::String] - # Required. The id of the control to apply. Assumed to be in the same catalog - # as the serving config. - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Cloud::Retail::V2::ServingConfig] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::Retail::V2::ServingConfig] - # - # @raise [::Google::Cloud::Error] if the REST call is aborted. - # - # @example Basic example - # require "google/cloud/retail/v2" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Retail::V2::ServingConfigService::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Retail::V2::RemoveControlRequest.new - # - # # Call the remove_control method. - # result = client.remove_control request - # - # # The returned object is of type Google::Cloud::Retail::V2::ServingConfig. - # p result - # - def remove_control request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Retail::V2::RemoveControlRequest - - # Converts hash 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.remove_control.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::Retail::V2::VERSION, - transports_version_send: [:rest] - - call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - options.apply_defaults timeout: @config.rpcs.remove_control.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.remove_control.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @serving_config_service_stub.remove_control 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 ServingConfigService REST API. - # - # This class represents the configuration for ServingConfigService REST, - # providing control over timeouts, retry behavior, logging, transport - # parameters, and other low-level controls. Certain parameters can also be - # applied individually to specific RPCs. See - # {::Google::Cloud::Retail::V2::ServingConfigService::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_serving_config to 20 seconds, - # # and all remaining timeouts to 10 seconds. - # ::Google::Cloud::Retail::V2::ServingConfigService::Rest::Client.configure do |config| - # config.timeout = 10.0 - # config.rpcs.create_serving_config.timeout = 20.0 - # end - # - # # Apply the above configuration only to a new client. - # client = ::Google::Cloud::Retail::V2::ServingConfigService::Rest::Client.new do |config| - # config.timeout = 10.0 - # config.rpcs.create_serving_config.timeout = 20.0 - # end - # - # @!attribute [rw] endpoint - # A custom service endpoint, as a hostname or hostname:port. The default is - # nil, indicating to use the default endpoint in the current universe domain. - # @return [::String,nil] - # @!attribute [rw] credentials - # Credentials to send with calls. You may provide any of the following types: - # * (`String`) The path to a service account key file in JSON format - # * (`Hash`) A service account key as a Hash - # * (`Google::Auth::Credentials`) A googleauth credentials object - # (see the [googleauth docs](https://rubydoc.info/gems/googleauth/Google/Auth/Credentials)) - # * (`Signet::OAuth2::Client`) A signet oauth2 client object - # (see the [signet docs](https://rubydoc.info/gems/signet/Signet/OAuth2/Client)) - # * (`nil`) indicating no credentials - # - # Warning: If you accept a credential configuration (JSON file or Hash) from an - # external source for authentication to Google Cloud, you must validate it before - # providing it to a Google API client library. Providing an unvalidated credential - # configuration to Google APIs can compromise the security of your systems and data. - # For more information, refer to [Validate credential configurations from external - # sources](https://cloud.google.com/docs/authentication/external/externally-sourced-credentials). - # @return [::Object] - # @!attribute [rw] scope - # The OAuth scopes - # @return [::Array<::String>] - # @!attribute [rw] lib_name - # The library name as recorded in instrumentation and logging - # @return [::String] - # @!attribute [rw] lib_version - # The library version as recorded in instrumentation and logging - # @return [::String] - # @!attribute [rw] timeout - # The call timeout in seconds. - # @return [::Numeric] - # @!attribute [rw] metadata - # Additional headers to be sent with the call. - # @return [::Hash{::Symbol=>::String}] - # @!attribute [rw] retry_policy - # The retry policy. The value is a hash with the following keys: - # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds. - # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds. - # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier. - # * `:retry_codes` (*type:* `Array`) - The error codes that should - # trigger a retry. - # @return [::Hash] - # @!attribute [rw] quota_project - # A separate project against which to charge quota. - # @return [::String] - # @!attribute [rw] universe_domain - # The universe domain within which to make requests. This determines the - # default endpoint URL. The default value of nil uses the environment - # universe (usually the default "googleapis.com" universe). - # @return [::String,nil] - # @!attribute [rw] logger - # A custom logger to use for request/response debug logging, or the value - # `:default` (the default) to construct a default logger, or `nil` to - # explicitly disable logging. - # @return [::Logger,:default,nil] - # - class Configuration - extend ::Gapic::Config - - # @private - # The endpoint specific to the default "googleapis.com" universe. Deprecated. - DEFAULT_ENDPOINT = "retail.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 ServingConfigService 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_serving_config` - # @return [::Gapic::Config::Method] - # - attr_reader :create_serving_config - ## - # RPC-specific configuration for `delete_serving_config` - # @return [::Gapic::Config::Method] - # - attr_reader :delete_serving_config - ## - # RPC-specific configuration for `update_serving_config` - # @return [::Gapic::Config::Method] - # - attr_reader :update_serving_config - ## - # RPC-specific configuration for `get_serving_config` - # @return [::Gapic::Config::Method] - # - attr_reader :get_serving_config - ## - # RPC-specific configuration for `list_serving_configs` - # @return [::Gapic::Config::Method] - # - attr_reader :list_serving_configs - ## - # RPC-specific configuration for `add_control` - # @return [::Gapic::Config::Method] - # - attr_reader :add_control - ## - # RPC-specific configuration for `remove_control` - # @return [::Gapic::Config::Method] - # - attr_reader :remove_control - - # @private - def initialize parent_rpcs = nil - create_serving_config_config = parent_rpcs.create_serving_config if parent_rpcs.respond_to? :create_serving_config - @create_serving_config = ::Gapic::Config::Method.new create_serving_config_config - delete_serving_config_config = parent_rpcs.delete_serving_config if parent_rpcs.respond_to? :delete_serving_config - @delete_serving_config = ::Gapic::Config::Method.new delete_serving_config_config - update_serving_config_config = parent_rpcs.update_serving_config if parent_rpcs.respond_to? :update_serving_config - @update_serving_config = ::Gapic::Config::Method.new update_serving_config_config - get_serving_config_config = parent_rpcs.get_serving_config if parent_rpcs.respond_to? :get_serving_config - @get_serving_config = ::Gapic::Config::Method.new get_serving_config_config - list_serving_configs_config = parent_rpcs.list_serving_configs if parent_rpcs.respond_to? :list_serving_configs - @list_serving_configs = ::Gapic::Config::Method.new list_serving_configs_config - add_control_config = parent_rpcs.add_control if parent_rpcs.respond_to? :add_control - @add_control = ::Gapic::Config::Method.new add_control_config - remove_control_config = parent_rpcs.remove_control if parent_rpcs.respond_to? :remove_control - @remove_control = ::Gapic::Config::Method.new remove_control_config - - yield self if block_given? - end - end - end - end - end - end - end - end - end -end diff --git a/owl-bot-staging/google-cloud-retail-v2/lib/google/cloud/retail/v2/serving_config_service/rest/service_stub.rb b/owl-bot-staging/google-cloud-retail-v2/lib/google/cloud/retail/v2/serving_config_service/rest/service_stub.rb deleted file mode 100644 index ade51caaf6b9..000000000000 --- a/owl-bot-staging/google-cloud-retail-v2/lib/google/cloud/retail/v2/serving_config_service/rest/service_stub.rb +++ /dev/null @@ -1,512 +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/retail/v2/serving_config_service_pb" - -module Google - module Cloud - module Retail - module V2 - module ServingConfigService - module Rest - ## - # REST service stub for the ServingConfigService 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_serving_config REST call - # - # @param request_pb [::Google::Cloud::Retail::V2::CreateServingConfigRequest] - # A request object representing the call parameters. Required. - # @param options [::Gapic::CallOptions] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Cloud::Retail::V2::ServingConfig] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::Retail::V2::ServingConfig] - # A result object deserialized from the server's reply - def create_serving_config request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_create_serving_config_request request_pb - query_string_params = if query_string_params.any? - query_string_params.to_h { |p| p.split "=", 2 } - else - {} - end - - response = @client_stub.make_http_request( - verb, - uri: uri, - body: body || "", - params: query_string_params, - method_name: "create_serving_config", - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Cloud::Retail::V2::ServingConfig.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_serving_config REST call - # - # @param request_pb [::Google::Cloud::Retail::V2::DeleteServingConfigRequest] - # 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_serving_config request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_delete_serving_config_request request_pb - query_string_params = if query_string_params.any? - query_string_params.to_h { |p| p.split "=", 2 } - else - {} - end - - response = @client_stub.make_http_request( - verb, - uri: uri, - body: body || "", - params: query_string_params, - method_name: "delete_serving_config", - 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 update_serving_config REST call - # - # @param request_pb [::Google::Cloud::Retail::V2::UpdateServingConfigRequest] - # A request object representing the call parameters. Required. - # @param options [::Gapic::CallOptions] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Cloud::Retail::V2::ServingConfig] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::Retail::V2::ServingConfig] - # A result object deserialized from the server's reply - def update_serving_config request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_update_serving_config_request request_pb - query_string_params = if query_string_params.any? - query_string_params.to_h { |p| p.split "=", 2 } - else - {} - end - - response = @client_stub.make_http_request( - verb, - uri: uri, - body: body || "", - params: query_string_params, - method_name: "update_serving_config", - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Cloud::Retail::V2::ServingConfig.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_serving_config REST call - # - # @param request_pb [::Google::Cloud::Retail::V2::GetServingConfigRequest] - # A request object representing the call parameters. Required. - # @param options [::Gapic::CallOptions] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Cloud::Retail::V2::ServingConfig] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::Retail::V2::ServingConfig] - # A result object deserialized from the server's reply - def get_serving_config request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_get_serving_config_request request_pb - query_string_params = if query_string_params.any? - query_string_params.to_h { |p| p.split "=", 2 } - else - {} - end - - response = @client_stub.make_http_request( - verb, - uri: uri, - body: body || "", - params: query_string_params, - method_name: "get_serving_config", - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Cloud::Retail::V2::ServingConfig.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_serving_configs REST call - # - # @param request_pb [::Google::Cloud::Retail::V2::ListServingConfigsRequest] - # A request object representing the call parameters. Required. - # @param options [::Gapic::CallOptions] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Cloud::Retail::V2::ListServingConfigsResponse] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::Retail::V2::ListServingConfigsResponse] - # A result object deserialized from the server's reply - def list_serving_configs request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_list_serving_configs_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_serving_configs", - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Cloud::Retail::V2::ListServingConfigsResponse.decode_json response.body, ignore_unknown_fields: true - catch :response do - yield result, operation if block_given? - result - end - end - - ## - # Baseline implementation for the add_control REST call - # - # @param request_pb [::Google::Cloud::Retail::V2::AddControlRequest] - # A request object representing the call parameters. Required. - # @param options [::Gapic::CallOptions] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Cloud::Retail::V2::ServingConfig] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::Retail::V2::ServingConfig] - # A result object deserialized from the server's reply - def add_control request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_add_control_request request_pb - query_string_params = if query_string_params.any? - query_string_params.to_h { |p| p.split "=", 2 } - else - {} - end - - response = @client_stub.make_http_request( - verb, - uri: uri, - body: body || "", - params: query_string_params, - method_name: "add_control", - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Cloud::Retail::V2::ServingConfig.decode_json response.body, ignore_unknown_fields: true - catch :response do - yield result, operation if block_given? - result - end - end - - ## - # Baseline implementation for the remove_control REST call - # - # @param request_pb [::Google::Cloud::Retail::V2::RemoveControlRequest] - # A request object representing the call parameters. Required. - # @param options [::Gapic::CallOptions] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Cloud::Retail::V2::ServingConfig] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::Retail::V2::ServingConfig] - # A result object deserialized from the server's reply - def remove_control request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_remove_control_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: "remove_control", - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Cloud::Retail::V2::ServingConfig.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_serving_config REST call - # - # @param request_pb [::Google::Cloud::Retail::V2::CreateServingConfigRequest] - # 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_serving_config_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :post, - uri_template: "/v2/{parent}/servingConfigs", - body: "serving_config", - matches: [ - ["parent", %r{^projects/[^/]+/locations/[^/]+/catalogs/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the delete_serving_config REST call - # - # @param request_pb [::Google::Cloud::Retail::V2::DeleteServingConfigRequest] - # 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_serving_config_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :delete, - uri_template: "/v2/{name}", - matches: [ - ["name", %r{^projects/[^/]+/locations/[^/]+/catalogs/[^/]+/servingConfigs/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the update_serving_config REST call - # - # @param request_pb [::Google::Cloud::Retail::V2::UpdateServingConfigRequest] - # 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_serving_config_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :patch, - uri_template: "/v2/{serving_config.name}", - body: "serving_config", - matches: [ - ["serving_config.name", %r{^projects/[^/]+/locations/[^/]+/catalogs/[^/]+/servingConfigs/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the get_serving_config REST call - # - # @param request_pb [::Google::Cloud::Retail::V2::GetServingConfigRequest] - # 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_serving_config_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :get, - uri_template: "/v2/{name}", - matches: [ - ["name", %r{^projects/[^/]+/locations/[^/]+/catalogs/[^/]+/servingConfigs/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the list_serving_configs REST call - # - # @param request_pb [::Google::Cloud::Retail::V2::ListServingConfigsRequest] - # 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_serving_configs_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :get, - uri_template: "/v2/{parent}/servingConfigs", - matches: [ - ["parent", %r{^projects/[^/]+/locations/[^/]+/catalogs/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the add_control REST call - # - # @param request_pb [::Google::Cloud::Retail::V2::AddControlRequest] - # A request object representing the call parameters. Required. - # @return [Array(String, [String, nil], Hash{String => String})] - # Uri, Body, Query string parameters - def self.transcode_add_control_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :post, - uri_template: "/v2/{serving_config}:addControl", - body: "*", - matches: [ - ["serving_config", %r{^projects/[^/]+/locations/[^/]+/catalogs/[^/]+/servingConfigs/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the remove_control REST call - # - # @param request_pb [::Google::Cloud::Retail::V2::RemoveControlRequest] - # A request object representing the call parameters. Required. - # @return [Array(String, [String, nil], Hash{String => String})] - # Uri, Body, Query string parameters - def self.transcode_remove_control_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :post, - uri_template: "/v2/{serving_config}:removeControl", - body: "*", - matches: [ - ["serving_config", %r{^projects/[^/]+/locations/[^/]+/catalogs/[^/]+/servingConfigs/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - end - end - end - end - end - end -end diff --git a/owl-bot-staging/google-cloud-retail-v2/lib/google/cloud/retail/v2/serving_config_service_pb.rb b/owl-bot-staging/google-cloud-retail-v2/lib/google/cloud/retail/v2/serving_config_service_pb.rb deleted file mode 100644 index 8fb9b76b0e85..000000000000 --- a/owl-bot-staging/google-cloud-retail-v2/lib/google/cloud/retail/v2/serving_config_service_pb.rb +++ /dev/null @@ -1,36 +0,0 @@ -# frozen_string_literal: true -# Generated by the protocol buffer compiler. DO NOT EDIT! -# source: google/cloud/retail/v2/serving_config_service.proto - -require 'google/protobuf' - -require 'google/api/annotations_pb' -require 'google/api/client_pb' -require 'google/api/field_behavior_pb' -require 'google/api/resource_pb' -require 'google/cloud/retail/v2/serving_config_pb' -require 'google/protobuf/empty_pb' -require 'google/protobuf/field_mask_pb' - - -descriptor_data = "\n3google/cloud/retail/v2/serving_config_service.proto\x12\x16google.cloud.retail.v2\x1a\x1cgoogle/api/annotations.proto\x1a\x17google/api/client.proto\x1a\x1fgoogle/api/field_behavior.proto\x1a\x19google/api/resource.proto\x1a+google/cloud/retail/v2/serving_config.proto\x1a\x1bgoogle/protobuf/empty.proto\x1a google/protobuf/field_mask.proto\"\xb7\x01\n\x1a\x43reateServingConfigRequest\x12\x35\n\x06parent\x18\x01 \x01(\tB%\xe0\x41\x02\xfa\x41\x1f\n\x1dretail.googleapis.com/Catalog\x12\x42\n\x0eserving_config\x18\x02 \x01(\x0b\x32%.google.cloud.retail.v2.ServingConfigB\x03\xe0\x41\x02\x12\x1e\n\x11serving_config_id\x18\x03 \x01(\tB\x03\xe0\x41\x02\"\x91\x01\n\x1aUpdateServingConfigRequest\x12\x42\n\x0eserving_config\x18\x01 \x01(\x0b\x32%.google.cloud.retail.v2.ServingConfigB\x03\xe0\x41\x02\x12/\n\x0bupdate_mask\x18\x02 \x01(\x0b\x32\x1a.google.protobuf.FieldMask\"W\n\x1a\x44\x65leteServingConfigRequest\x12\x39\n\x04name\x18\x01 \x01(\tB+\xe0\x41\x02\xfa\x41%\n#retail.googleapis.com/ServingConfig\"T\n\x17GetServingConfigRequest\x12\x39\n\x04name\x18\x01 \x01(\tB+\xe0\x41\x02\xfa\x41%\n#retail.googleapis.com/ServingConfig\"\x83\x01\n\x19ListServingConfigsRequest\x12\x35\n\x06parent\x18\x01 \x01(\tB%\xe0\x41\x02\xfa\x41\x1f\n\x1dretail.googleapis.com/Catalog\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\"u\n\x1aListServingConfigsResponse\x12>\n\x0fserving_configs\x18\x01 \x03(\x0b\x32%.google.cloud.retail.v2.ServingConfig\x12\x17\n\x0fnext_page_token\x18\x02 \x01(\t\"q\n\x11\x41\x64\x64\x43ontrolRequest\x12\x43\n\x0eserving_config\x18\x01 \x01(\tB+\xe0\x41\x02\xfa\x41%\n#retail.googleapis.com/ServingConfig\x12\x17\n\ncontrol_id\x18\x02 \x01(\tB\x03\xe0\x41\x02\"t\n\x14RemoveControlRequest\x12\x43\n\x0eserving_config\x18\x01 \x01(\tB+\xe0\x41\x02\xfa\x41%\n#retail.googleapis.com/ServingConfig\x12\x17\n\ncontrol_id\x18\x02 \x01(\tB\x03\xe0\x41\x02\x32\xb2\x0c\n\x14ServingConfigService\x12\xf1\x01\n\x13\x43reateServingConfig\x12\x32.google.cloud.retail.v2.CreateServingConfigRequest\x1a%.google.cloud.retail.v2.ServingConfig\"\x7f\xda\x41\'parent,serving_config,serving_config_id\x82\xd3\xe4\x93\x02O\"=/v2/{parent=projects/*/locations/*/catalogs/*}/servingConfigs:\x0eserving_config\x12\xaf\x01\n\x13\x44\x65leteServingConfig\x12\x32.google.cloud.retail.v2.DeleteServingConfigRequest\x1a\x16.google.protobuf.Empty\"L\xda\x41\x04name\x82\xd3\xe4\x93\x02?*=/v2/{name=projects/*/locations/*/catalogs/*/servingConfigs/*}\x12\xf4\x01\n\x13UpdateServingConfig\x12\x32.google.cloud.retail.v2.UpdateServingConfigRequest\x1a%.google.cloud.retail.v2.ServingConfig\"\x81\x01\xda\x41\x1aserving_config,update_mask\x82\xd3\xe4\x93\x02^2L/v2/{serving_config.name=projects/*/locations/*/catalogs/*/servingConfigs/*}:\x0eserving_config\x12\xb8\x01\n\x10GetServingConfig\x12/.google.cloud.retail.v2.GetServingConfigRequest\x1a%.google.cloud.retail.v2.ServingConfig\"L\xda\x41\x04name\x82\xd3\xe4\x93\x02?\x12=/v2/{name=projects/*/locations/*/catalogs/*/servingConfigs/*}\x12\xcb\x01\n\x12ListServingConfigs\x12\x31.google.cloud.retail.v2.ListServingConfigsRequest\x1a\x32.google.cloud.retail.v2.ListServingConfigsResponse\"N\xda\x41\x06parent\x82\xd3\xe4\x93\x02?\x12=/v2/{parent=projects/*/locations/*/catalogs/*}/servingConfigs\x12\xce\x01\n\nAddControl\x12).google.cloud.retail.v2.AddControlRequest\x1a%.google.cloud.retail.v2.ServingConfig\"n\xda\x41\x0eserving_config\x82\xd3\xe4\x93\x02W\"R/v2/{serving_config=projects/*/locations/*/catalogs/*/servingConfigs/*}:addControl:\x01*\x12\xd7\x01\n\rRemoveControl\x12,.google.cloud.retail.v2.RemoveControlRequest\x1a%.google.cloud.retail.v2.ServingConfig\"q\xda\x41\x0eserving_config\x82\xd3\xe4\x93\x02Z\"U/v2/{serving_config=projects/*/locations/*/catalogs/*/servingConfigs/*}:removeControl:\x01*\x1aI\xca\x41\x15retail.googleapis.com\xd2\x41.https://www.googleapis.com/auth/cloud-platformB\xc4\x01\n\x1a\x63om.google.cloud.retail.v2B\x19ServingConfigServiceProtoP\x01Z2cloud.google.com/go/retail/apiv2/retailpb;retailpb\xa2\x02\x06RETAIL\xaa\x02\x16Google.Cloud.Retail.V2\xca\x02\x16Google\\Cloud\\Retail\\V2\xea\x02\x19Google::Cloud::Retail::V2b\x06proto3" - -pool = ::Google::Protobuf::DescriptorPool.generated_pool -pool.add_serialized_file(descriptor_data) - -module Google - module Cloud - module Retail - module V2 - CreateServingConfigRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.retail.v2.CreateServingConfigRequest").msgclass - UpdateServingConfigRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.retail.v2.UpdateServingConfigRequest").msgclass - DeleteServingConfigRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.retail.v2.DeleteServingConfigRequest").msgclass - GetServingConfigRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.retail.v2.GetServingConfigRequest").msgclass - ListServingConfigsRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.retail.v2.ListServingConfigsRequest").msgclass - ListServingConfigsResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.retail.v2.ListServingConfigsResponse").msgclass - AddControlRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.retail.v2.AddControlRequest").msgclass - RemoveControlRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.retail.v2.RemoveControlRequest").msgclass - end - end - end -end diff --git a/owl-bot-staging/google-cloud-retail-v2/lib/google/cloud/retail/v2/serving_config_service_services_pb.rb b/owl-bot-staging/google-cloud-retail-v2/lib/google/cloud/retail/v2/serving_config_service_services_pb.rb deleted file mode 100644 index ae1db2fde215..000000000000 --- a/owl-bot-staging/google-cloud-retail-v2/lib/google/cloud/retail/v2/serving_config_service_services_pb.rb +++ /dev/null @@ -1,74 +0,0 @@ -# Generated by the protocol buffer compiler. DO NOT EDIT! -# Source: google/cloud/retail/v2/serving_config_service.proto for package 'Google.Cloud.Retail.V2' -# Original file comments: -# 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 -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. -# - -require 'grpc' -require 'google/cloud/retail/v2/serving_config_service_pb' - -module Google - module Cloud - module Retail - module V2 - module ServingConfigService - # Service for modifying ServingConfig. - class Service - - include ::GRPC::GenericService - - self.marshal_class_method = :encode - self.unmarshal_class_method = :decode - self.service_name = 'google.cloud.retail.v2.ServingConfigService' - - # Creates a ServingConfig. - # - # A maximum of 100 [ServingConfig][google.cloud.retail.v2.ServingConfig]s are - # allowed in a [Catalog][google.cloud.retail.v2.Catalog], otherwise a - # FAILED_PRECONDITION error is returned. - rpc :CreateServingConfig, ::Google::Cloud::Retail::V2::CreateServingConfigRequest, ::Google::Cloud::Retail::V2::ServingConfig - # Deletes a ServingConfig. - # - # Returns a NotFound error if the ServingConfig does not exist. - rpc :DeleteServingConfig, ::Google::Cloud::Retail::V2::DeleteServingConfigRequest, ::Google::Protobuf::Empty - # Updates a ServingConfig. - rpc :UpdateServingConfig, ::Google::Cloud::Retail::V2::UpdateServingConfigRequest, ::Google::Cloud::Retail::V2::ServingConfig - # Gets a ServingConfig. - # - # Returns a NotFound error if the ServingConfig does not exist. - rpc :GetServingConfig, ::Google::Cloud::Retail::V2::GetServingConfigRequest, ::Google::Cloud::Retail::V2::ServingConfig - # Lists all ServingConfigs linked to this catalog. - rpc :ListServingConfigs, ::Google::Cloud::Retail::V2::ListServingConfigsRequest, ::Google::Cloud::Retail::V2::ListServingConfigsResponse - # Enables a Control on the specified ServingConfig. - # The control is added in the last position of the list of controls - # it belongs to (e.g. if it's a facet spec control it will be applied - # in the last position of servingConfig.facetSpecIds) - # Returns a ALREADY_EXISTS error if the control has already been applied. - # Returns a FAILED_PRECONDITION error if the addition could exceed maximum - # number of control allowed for that type of control. - rpc :AddControl, ::Google::Cloud::Retail::V2::AddControlRequest, ::Google::Cloud::Retail::V2::ServingConfig - # Disables a Control on the specified ServingConfig. - # The control is removed from the ServingConfig. - # Returns a NOT_FOUND error if the Control is not enabled for the - # ServingConfig. - rpc :RemoveControl, ::Google::Cloud::Retail::V2::RemoveControlRequest, ::Google::Cloud::Retail::V2::ServingConfig - end - - Stub = Service.rpc_stub_class - end - end - end - end -end diff --git a/owl-bot-staging/google-cloud-retail-v2/lib/google/cloud/retail/v2/user_event_pb.rb b/owl-bot-staging/google-cloud-retail-v2/lib/google/cloud/retail/v2/user_event_pb.rb deleted file mode 100644 index f7da172ecbbd..000000000000 --- a/owl-bot-staging/google-cloud-retail-v2/lib/google/cloud/retail/v2/user_event_pb.rb +++ /dev/null @@ -1,30 +0,0 @@ -# frozen_string_literal: true -# Generated by the protocol buffer compiler. DO NOT EDIT! -# source: google/cloud/retail/v2/user_event.proto - -require 'google/protobuf' - -require 'google/api/field_behavior_pb' -require 'google/cloud/retail/v2/common_pb' -require 'google/cloud/retail/v2/product_pb' -require 'google/protobuf/timestamp_pb' -require 'google/protobuf/wrappers_pb' - - -descriptor_data = "\n\'google/cloud/retail/v2/user_event.proto\x12\x16google.cloud.retail.v2\x1a\x1fgoogle/api/field_behavior.proto\x1a#google/cloud/retail/v2/common.proto\x1a$google/cloud/retail/v2/product.proto\x1a\x1fgoogle/protobuf/timestamp.proto\x1a\x1egoogle/protobuf/wrappers.proto\"\x97\x06\n\tUserEvent\x12\x17\n\nevent_type\x18\x01 \x01(\tB\x03\xe0\x41\x02\x12\x17\n\nvisitor_id\x18\x02 \x01(\tB\x03\xe0\x41\x02\x12\x12\n\nsession_id\x18\x15 \x01(\t\x12.\n\nevent_time\x18\x03 \x01(\x0b\x32\x1a.google.protobuf.Timestamp\x12\x16\n\x0e\x65xperiment_ids\x18\x04 \x03(\t\x12\x19\n\x11\x61ttribution_token\x18\x05 \x01(\t\x12>\n\x0fproduct_details\x18\x06 \x03(\x0b\x32%.google.cloud.retail.v2.ProductDetail\x12\x43\n\x11\x63ompletion_detail\x18\x16 \x01(\x0b\x32(.google.cloud.retail.v2.CompletionDetail\x12\x45\n\nattributes\x18\x07 \x03(\x0b\x32\x31.google.cloud.retail.v2.UserEvent.AttributesEntry\x12\x0f\n\x07\x63\x61rt_id\x18\x08 \x01(\t\x12I\n\x14purchase_transaction\x18\t \x01(\x0b\x32+.google.cloud.retail.v2.PurchaseTransaction\x12\x14\n\x0csearch_query\x18\n \x01(\t\x12\x0e\n\x06\x66ilter\x18\x10 \x01(\t\x12\x10\n\x08order_by\x18\x11 \x01(\t\x12\x0e\n\x06offset\x18\x12 \x01(\x05\x12\x17\n\x0fpage_categories\x18\x0b \x03(\t\x12\x33\n\tuser_info\x18\x0c \x01(\x0b\x32 .google.cloud.retail.v2.UserInfo\x12\x0b\n\x03uri\x18\r \x01(\t\x12\x14\n\x0creferrer_uri\x18\x0e \x01(\t\x12\x14\n\x0cpage_view_id\x18\x0f \x01(\t\x12\x0e\n\x06\x65ntity\x18\x17 \x01(\t\x1aZ\n\x0f\x41ttributesEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12\x36\n\x05value\x18\x02 \x01(\x0b\x32\'.google.cloud.retail.v2.CustomAttribute:\x02\x38\x01\"u\n\rProductDetail\x12\x35\n\x07product\x18\x01 \x01(\x0b\x32\x1f.google.cloud.retail.v2.ProductB\x03\xe0\x41\x02\x12-\n\x08quantity\x18\x02 \x01(\x0b\x32\x1b.google.protobuf.Int32Value\"p\n\x10\x43ompletionDetail\x12$\n\x1c\x63ompletion_attribution_token\x18\x01 \x01(\t\x12\x1b\n\x13selected_suggestion\x18\x02 \x01(\t\x12\x19\n\x11selected_position\x18\x03 \x01(\x05\"n\n\x13PurchaseTransaction\x12\n\n\x02id\x18\x01 \x01(\t\x12\x14\n\x07revenue\x18\x02 \x01(\x02\x42\x03\xe0\x41\x02\x12\x0b\n\x03tax\x18\x03 \x01(\x02\x12\x0c\n\x04\x63ost\x18\x04 \x01(\x02\x12\x1a\n\rcurrency_code\x18\x05 \x01(\tB\x03\xe0\x41\x02\x42\xb9\x01\n\x1a\x63om.google.cloud.retail.v2B\x0eUserEventProtoP\x01Z2cloud.google.com/go/retail/apiv2/retailpb;retailpb\xa2\x02\x06RETAIL\xaa\x02\x16Google.Cloud.Retail.V2\xca\x02\x16Google\\Cloud\\Retail\\V2\xea\x02\x19Google::Cloud::Retail::V2b\x06proto3" - -pool = ::Google::Protobuf::DescriptorPool.generated_pool -pool.add_serialized_file(descriptor_data) - -module Google - module Cloud - module Retail - module V2 - UserEvent = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.retail.v2.UserEvent").msgclass - ProductDetail = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.retail.v2.ProductDetail").msgclass - CompletionDetail = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.retail.v2.CompletionDetail").msgclass - PurchaseTransaction = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.retail.v2.PurchaseTransaction").msgclass - end - end - end -end diff --git a/owl-bot-staging/google-cloud-retail-v2/lib/google/cloud/retail/v2/user_event_service.rb b/owl-bot-staging/google-cloud-retail-v2/lib/google/cloud/retail/v2/user_event_service.rb deleted file mode 100644 index 7ff44608d216..000000000000 --- a/owl-bot-staging/google-cloud-retail-v2/lib/google/cloud/retail/v2/user_event_service.rb +++ /dev/null @@ -1,56 +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/retail/v2/version" - -require "google/cloud/retail/v2/user_event_service/credentials" -require "google/cloud/retail/v2/user_event_service/paths" -require "google/cloud/retail/v2/user_event_service/operations" -require "google/cloud/retail/v2/user_event_service/client" -require "google/cloud/retail/v2/user_event_service/rest" - -module Google - module Cloud - module Retail - module V2 - ## - # Service for ingesting end user actions on the customer website. - # - # @example Load this service and instantiate a gRPC client - # - # require "google/cloud/retail/v2/user_event_service" - # client = ::Google::Cloud::Retail::V2::UserEventService::Client.new - # - # @example Load this service and instantiate a REST client - # - # require "google/cloud/retail/v2/user_event_service/rest" - # client = ::Google::Cloud::Retail::V2::UserEventService::Rest::Client.new - # - module UserEventService - end - end - end - end -end - -helper_path = ::File.join __dir__, "user_event_service", "helpers.rb" -require "google/cloud/retail/v2/user_event_service/helpers" if ::File.file? helper_path diff --git a/owl-bot-staging/google-cloud-retail-v2/lib/google/cloud/retail/v2/user_event_service/client.rb b/owl-bot-staging/google-cloud-retail-v2/lib/google/cloud/retail/v2/user_event_service/client.rb deleted file mode 100644 index 9f024823a893..000000000000 --- a/owl-bot-staging/google-cloud-retail-v2/lib/google/cloud/retail/v2/user_event_service/client.rb +++ /dev/null @@ -1,1006 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -require "google/cloud/errors" -require "google/cloud/retail/v2/user_event_service_pb" -require "google/cloud/location" - -module Google - module Cloud - module Retail - module V2 - module UserEventService - ## - # Client for the UserEventService service. - # - # Service for ingesting end user actions on the customer website. - # - class Client - # @private - API_VERSION = "" - - # @private - DEFAULT_ENDPOINT_TEMPLATE = "retail.$UNIVERSE_DOMAIN$" - - include Paths - - # @private - attr_reader :user_event_service_stub - - ## - # Configure the UserEventService Client class. - # - # See {::Google::Cloud::Retail::V2::UserEventService::Client::Configuration} - # for a description of the configuration fields. - # - # @example - # - # # Modify the configuration for all UserEventService clients - # ::Google::Cloud::Retail::V2::UserEventService::Client.configure do |config| - # config.timeout = 10.0 - # end - # - # @yield [config] Configure the Client client. - # @yieldparam config [Client::Configuration] - # - # @return [Client::Configuration] - # - def self.configure - @configure ||= begin - namespace = ["Google", "Cloud", "Retail", "V2"] - parent_config = while namespace.any? - parent_name = namespace.join "::" - parent_const = const_get parent_name - break parent_const.configure if parent_const.respond_to? :configure - namespace.pop - end - default_config = Client::Configuration.new parent_config - - default_config.timeout = 10.0 - default_config.retry_policy = { - initial_delay: 0.1, max_delay: 5.0, multiplier: 1.3, retry_codes: [14, 4] - } - - default_config.rpcs.purge_user_events.timeout = 30.0 - default_config.rpcs.purge_user_events.retry_policy = { - initial_delay: 0.1, max_delay: 30.0, multiplier: 1.3, retry_codes: [14, 4] - } - - default_config.rpcs.import_user_events.timeout = 600.0 - default_config.rpcs.import_user_events.retry_policy = { - initial_delay: 0.1, max_delay: 300.0, multiplier: 1.3, retry_codes: [14, 4] - } - - default_config - end - yield @configure if block_given? - @configure - end - - ## - # Configure the UserEventService Client instance. - # - # The configuration is set to the derived mode, meaning that values can be changed, - # but structural changes (adding new fields, etc.) are not allowed. Structural changes - # should be made on {Client.configure}. - # - # See {::Google::Cloud::Retail::V2::UserEventService::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 - @user_event_service_stub.universe_domain - end - - ## - # Create a new UserEventService client object. - # - # @example - # - # # Create a client using the default configuration - # client = ::Google::Cloud::Retail::V2::UserEventService::Client.new - # - # # Create a client using a custom configuration - # client = ::Google::Cloud::Retail::V2::UserEventService::Client.new do |config| - # config.timeout = 10.0 - # end - # - # @yield [config] Configure the UserEventService client. - # @yieldparam config [Client::Configuration] - # - def initialize - # These require statements are intentionally placed here to initialize - # the gRPC module only when it's required. - # See https://github.com/googleapis/toolkit/issues/446 - require "gapic/grpc" - require "google/cloud/retail/v2/user_event_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 - - @user_event_service_stub = ::Gapic::ServiceStub.new( - ::Google::Cloud::Retail::V2::UserEventService::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 - ) - - @user_event_service_stub.stub_logger&.info do |entry| - entry.set_system_name - entry.set_service - entry.message = "Created client for #{entry.service}" - entry.set_credentials_fields credentials - entry.set "customEndpoint", @config.endpoint if @config.endpoint - entry.set "defaultTimeout", @config.timeout if @config.timeout - entry.set "quotaProject", @quota_project_id if @quota_project_id - end - - @location_client = Google::Cloud::Location::Locations::Client.new do |config| - config.credentials = credentials - config.quota_project = @quota_project_id - config.endpoint = @user_event_service_stub.endpoint - config.universe_domain = @user_event_service_stub.universe_domain - config.logger = @user_event_service_stub.logger if config.respond_to? :logger= - end - end - - ## - # Get the associated client for long-running operations. - # - # @return [::Google::Cloud::Retail::V2::UserEventService::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 - @user_event_service_stub.logger - end - - # Service calls - - ## - # Writes a single user event. - # - # @overload write_user_event(request, options = nil) - # Pass arguments to `write_user_event` via a request object, either of type - # {::Google::Cloud::Retail::V2::WriteUserEventRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Retail::V2::WriteUserEventRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. - # - # @overload write_user_event(parent: nil, user_event: nil, write_async: nil) - # Pass arguments to `write_user_event` via keyword arguments. Note that at - # least one keyword argument is 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 catalog resource name, such as - # `projects/1234/locations/global/catalogs/default_catalog`. - # @param user_event [::Google::Cloud::Retail::V2::UserEvent, ::Hash] - # Required. User event to write. - # @param write_async [::Boolean] - # If set to true, the user event will be written asynchronously after - # validation, and the API will respond without waiting for the write. - # Therefore, silent failures can occur even if the API returns success. In - # case of silent failures, error messages can be found in Stackdriver logs. - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Google::Cloud::Retail::V2::UserEvent] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Google::Cloud::Retail::V2::UserEvent] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/cloud/retail/v2" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Retail::V2::UserEventService::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Retail::V2::WriteUserEventRequest.new - # - # # Call the write_user_event method. - # result = client.write_user_event request - # - # # The returned object is of type Google::Cloud::Retail::V2::UserEvent. - # p result - # - def write_user_event request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Retail::V2::WriteUserEventRequest - - # Converts hash 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.write_user_event.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::Retail::V2::VERSION - metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - header_params = {} - if request.parent - 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.write_user_event.timeout, - metadata: metadata, - retry_policy: @config.rpcs.write_user_event.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @user_event_service_stub.call_rpc :write_user_event, 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 - - ## - # Writes a single user event from the browser. - # - # For larger user event payload over 16 KB, the POST method should be used - # instead, otherwise a 400 Bad Request error is returned. - # - # This method is used only by the Retail API JavaScript pixel and Google Tag - # Manager. Users should not call this method directly. - # - # @overload collect_user_event(request, options = nil) - # Pass arguments to `collect_user_event` via a request object, either of type - # {::Google::Cloud::Retail::V2::CollectUserEventRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Retail::V2::CollectUserEventRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. - # - # @overload collect_user_event(prebuilt_rule: nil, parent: nil, user_event: nil, uri: nil, ets: nil, raw_json: nil) - # Pass arguments to `collect_user_event` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param prebuilt_rule [::String] - # The prebuilt rule name that can convert a specific type of raw_json. - # For example: "ga4_bq" rule for the GA4 user event schema. - # @param parent [::String] - # Required. The parent catalog name, such as - # `projects/1234/locations/global/catalogs/default_catalog`. - # @param user_event [::String] - # Required. URL encoded UserEvent proto with a length limit of 2,000,000 - # characters. - # @param uri [::String] - # The URL including cgi-parameters but excluding the hash fragment with a - # length limit of 5,000 characters. This is often more useful than the - # referer URL, because many browsers only send the domain for 3rd party - # requests. - # @param ets [::Integer] - # The event timestamp in milliseconds. This prevents browser caching of - # otherwise identical get requests. The name is abbreviated to reduce the - # payload bytes. - # @param raw_json [::String] - # An arbitrary serialized JSON string that contains necessary information - # that can comprise a user event. When this field is specified, the - # user_event field will be ignored. Note: line-delimited JSON is not - # supported, a single JSON only. - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Google::Api::HttpBody] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Google::Api::HttpBody] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/cloud/retail/v2" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Retail::V2::UserEventService::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Retail::V2::CollectUserEventRequest.new - # - # # Call the collect_user_event method. - # result = client.collect_user_event request - # - # # The returned object is of type Google::Api::HttpBody. - # p result - # - def collect_user_event request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Retail::V2::CollectUserEventRequest - - # Converts hash 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.collect_user_event.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::Retail::V2::VERSION - metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - header_params = {} - if request.parent - 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.collect_user_event.timeout, - metadata: metadata, - retry_policy: @config.rpcs.collect_user_event.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @user_event_service_stub.call_rpc :collect_user_event, request, options: options do |response, operation| - yield response, operation if block_given? - end - rescue ::GRPC::BadStatus => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Deletes permanently all user events specified by the filter provided. - # Depending on the number of events specified by the filter, this operation - # could take hours or days to complete. To test a filter, use the list - # command first. - # - # @overload purge_user_events(request, options = nil) - # Pass arguments to `purge_user_events` via a request object, either of type - # {::Google::Cloud::Retail::V2::PurgeUserEventsRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Retail::V2::PurgeUserEventsRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. - # - # @overload purge_user_events(parent: nil, filter: nil, force: nil) - # Pass arguments to `purge_user_events` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param parent [::String] - # Required. The resource name of the catalog under which the events are - # created. The format is - # `projects/${projectId}/locations/global/catalogs/${catalogId}` - # @param filter [::String] - # Required. The filter string to specify the events to be deleted with a - # length limit of 5,000 characters. Empty string filter is not allowed. The - # eligible fields for filtering are: - # - # * `eventType`: Double quoted - # {::Google::Cloud::Retail::V2::UserEvent#event_type UserEvent.event_type} string. - # * `eventTime`: in ISO 8601 "zulu" format. - # * `visitorId`: Double quoted string. Specifying this will delete all - # events associated with a visitor. - # * `userId`: Double quoted string. Specifying this will delete all events - # associated with a user. - # - # Examples: - # - # * Deleting all events in a time range: - # `eventTime > "2012-04-23T18:25:43.511Z" - # eventTime < "2012-04-23T18:30:43.511Z"` - # * Deleting specific eventType in time range: - # `eventTime > "2012-04-23T18:25:43.511Z" eventType = "detail-page-view"` - # * Deleting all events for a specific visitor: - # `visitorId = "visitor1024"` - # - # The filtering fields are assumed to have an implicit AND. - # @param force [::Boolean] - # Actually perform the purge. - # If `force` is set to false, the method will return the expected purge count - # without deleting any user events. - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Gapic::Operation] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Gapic::Operation] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/cloud/retail/v2" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Retail::V2::UserEventService::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Retail::V2::PurgeUserEventsRequest.new - # - # # Call the purge_user_events method. - # result = client.purge_user_events 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 purge_user_events request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Retail::V2::PurgeUserEventsRequest - - # Converts hash 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.purge_user_events.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::Retail::V2::VERSION - metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - header_params = {} - if request.parent - 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.purge_user_events.timeout, - metadata: metadata, - retry_policy: @config.rpcs.purge_user_events.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @user_event_service_stub.call_rpc :purge_user_events, 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 - - ## - # Bulk import of User events. Request processing might be - # synchronous. Events that already exist are skipped. - # Use this method for backfilling historical user events. - # - # `Operation.response` is of type `ImportResponse`. Note that it is - # possible for a subset of the items to be successfully inserted. - # `Operation.metadata` is of type `ImportMetadata`. - # - # @overload import_user_events(request, options = nil) - # Pass arguments to `import_user_events` via a request object, either of type - # {::Google::Cloud::Retail::V2::ImportUserEventsRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Retail::V2::ImportUserEventsRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. - # - # @overload import_user_events(parent: nil, input_config: nil, errors_config: nil) - # Pass arguments to `import_user_events` via keyword arguments. Note that at - # least one keyword argument is 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. `projects/1234/locations/global/catalogs/default_catalog` - # @param input_config [::Google::Cloud::Retail::V2::UserEventInputConfig, ::Hash] - # Required. The desired input location of the data. - # @param errors_config [::Google::Cloud::Retail::V2::ImportErrorsConfig, ::Hash] - # The desired location of errors incurred during the Import. Cannot be set - # for inline user event imports. - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Gapic::Operation] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Gapic::Operation] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/cloud/retail/v2" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Retail::V2::UserEventService::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Retail::V2::ImportUserEventsRequest.new - # - # # Call the import_user_events method. - # result = client.import_user_events 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 import_user_events request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Retail::V2::ImportUserEventsRequest - - # Converts hash 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.import_user_events.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::Retail::V2::VERSION - metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - header_params = {} - if request.parent - 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.import_user_events.timeout, - metadata: metadata, - retry_policy: @config.rpcs.import_user_events.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @user_event_service_stub.call_rpc :import_user_events, 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 - - ## - # Starts a user-event rejoin operation with latest product catalog. Events - # are not annotated with detailed product information for products that are - # missing from the catalog when the user event is ingested. These - # events are stored as unjoined events with limited usage on training and - # serving. You can use this method to start a join operation on specified - # events with the latest version of product catalog. You can also use this - # method to correct events joined with the wrong product catalog. A rejoin - # operation can take hours or days to complete. - # - # @overload rejoin_user_events(request, options = nil) - # Pass arguments to `rejoin_user_events` via a request object, either of type - # {::Google::Cloud::Retail::V2::RejoinUserEventsRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Retail::V2::RejoinUserEventsRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. - # - # @overload rejoin_user_events(parent: nil, user_event_rejoin_scope: nil) - # Pass arguments to `rejoin_user_events` via keyword arguments. Note that at - # least one keyword argument is 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 catalog resource name, such as - # `projects/1234/locations/global/catalogs/default_catalog`. - # @param user_event_rejoin_scope [::Google::Cloud::Retail::V2::RejoinUserEventsRequest::UserEventRejoinScope] - # The type of the user event rejoin to define the scope and range of the user - # events to be rejoined with the latest product catalog. Defaults to - # `USER_EVENT_REJOIN_SCOPE_UNSPECIFIED` if this field is not set, or set to - # an invalid integer value. - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Gapic::Operation] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Gapic::Operation] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/cloud/retail/v2" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Retail::V2::UserEventService::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Retail::V2::RejoinUserEventsRequest.new - # - # # Call the rejoin_user_events method. - # result = client.rejoin_user_events 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 rejoin_user_events request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Retail::V2::RejoinUserEventsRequest - - # Converts hash 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.rejoin_user_events.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::Retail::V2::VERSION - metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - header_params = {} - if request.parent - 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.rejoin_user_events.timeout, - metadata: metadata, - retry_policy: @config.rpcs.rejoin_user_events.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @user_event_service_stub.call_rpc :rejoin_user_events, 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 UserEventService API. - # - # This class represents the configuration for UserEventService, - # providing control over timeouts, retry behavior, logging, transport - # parameters, and other low-level controls. Certain parameters can also be - # applied individually to specific RPCs. See - # {::Google::Cloud::Retail::V2::UserEventService::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 - # # write_user_event to 20 seconds, - # # and all remaining timeouts to 10 seconds. - # ::Google::Cloud::Retail::V2::UserEventService::Client.configure do |config| - # config.timeout = 10.0 - # config.rpcs.write_user_event.timeout = 20.0 - # end - # - # # Apply the above configuration only to a new client. - # client = ::Google::Cloud::Retail::V2::UserEventService::Client.new do |config| - # config.timeout = 10.0 - # config.rpcs.write_user_event.timeout = 20.0 - # end - # - # @!attribute [rw] endpoint - # A custom service endpoint, as a hostname or hostname:port. The default is - # nil, indicating to use the default endpoint in the current universe domain. - # @return [::String,nil] - # @!attribute [rw] credentials - # Credentials to send with calls. You may provide any of the following types: - # * (`Google::Auth::Credentials`) A googleauth credentials object - # (see the [googleauth docs](https://rubydoc.info/gems/googleauth/Google/Auth/Credentials)) - # * (`Signet::OAuth2::Client`) A signet oauth2 client object - # (see the [signet docs](https://rubydoc.info/gems/signet/Signet/OAuth2/Client)) - # * (`GRPC::Core::Channel`) a gRPC channel with included credentials - # * (`GRPC::Core::ChannelCredentials`) a gRPC credentails object - # * (`nil`) indicating no credentials - # - # @note Warning: Passing a `String` to a keyfile path or a `Hash` of credentials - # is deprecated. Providing an unvalidated credential configuration to - # Google APIs can compromise the security of your systems and data. - # - # @example - # - # # The recommended way to provide credentials is to use the `make_creds` method - # # on the appropriate credentials class for your environment. - # - # require "googleauth" - # - # credentials = ::Google::Auth::ServiceAccountCredentials.make_creds( - # json_key_io: ::File.open("/path/to/keyfile.json") - # ) - # - # client = ::Google::Cloud::Retail::V2::UserEventService::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 = "retail.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 UserEventService 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 `write_user_event` - # @return [::Gapic::Config::Method] - # - attr_reader :write_user_event - ## - # RPC-specific configuration for `collect_user_event` - # @return [::Gapic::Config::Method] - # - attr_reader :collect_user_event - ## - # RPC-specific configuration for `purge_user_events` - # @return [::Gapic::Config::Method] - # - attr_reader :purge_user_events - ## - # RPC-specific configuration for `import_user_events` - # @return [::Gapic::Config::Method] - # - attr_reader :import_user_events - ## - # RPC-specific configuration for `rejoin_user_events` - # @return [::Gapic::Config::Method] - # - attr_reader :rejoin_user_events - - # @private - def initialize parent_rpcs = nil - write_user_event_config = parent_rpcs.write_user_event if parent_rpcs.respond_to? :write_user_event - @write_user_event = ::Gapic::Config::Method.new write_user_event_config - collect_user_event_config = parent_rpcs.collect_user_event if parent_rpcs.respond_to? :collect_user_event - @collect_user_event = ::Gapic::Config::Method.new collect_user_event_config - purge_user_events_config = parent_rpcs.purge_user_events if parent_rpcs.respond_to? :purge_user_events - @purge_user_events = ::Gapic::Config::Method.new purge_user_events_config - import_user_events_config = parent_rpcs.import_user_events if parent_rpcs.respond_to? :import_user_events - @import_user_events = ::Gapic::Config::Method.new import_user_events_config - rejoin_user_events_config = parent_rpcs.rejoin_user_events if parent_rpcs.respond_to? :rejoin_user_events - @rejoin_user_events = ::Gapic::Config::Method.new rejoin_user_events_config - - yield self if block_given? - end - end - end - end - end - end - end - end -end diff --git a/owl-bot-staging/google-cloud-retail-v2/lib/google/cloud/retail/v2/user_event_service/credentials.rb b/owl-bot-staging/google-cloud-retail-v2/lib/google/cloud/retail/v2/user_event_service/credentials.rb deleted file mode 100644 index d7842cfcb893..000000000000 --- a/owl-bot-staging/google-cloud-retail-v2/lib/google/cloud/retail/v2/user_event_service/credentials.rb +++ /dev/null @@ -1,51 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -require "googleauth" - -module Google - module Cloud - module Retail - module V2 - module UserEventService - # Credentials for the UserEventService API. - class Credentials < ::Google::Auth::Credentials - self.scope = [ - "https://www.googleapis.com/auth/cloud-platform" - ] - self.env_vars = [ - "RETAIL_CREDENTIALS", - "RETAIL_KEYFILE", - "GOOGLE_CLOUD_CREDENTIALS", - "GOOGLE_CLOUD_KEYFILE", - "GCLOUD_KEYFILE", - "RETAIL_CREDENTIALS_JSON", - "RETAIL_KEYFILE_JSON", - "GOOGLE_CLOUD_CREDENTIALS_JSON", - "GOOGLE_CLOUD_KEYFILE_JSON", - "GCLOUD_KEYFILE_JSON" - ] - self.paths = [ - "~/.config/google_cloud/application_default_credentials.json" - ] - end - end - end - end - end -end diff --git a/owl-bot-staging/google-cloud-retail-v2/lib/google/cloud/retail/v2/user_event_service/operations.rb b/owl-bot-staging/google-cloud-retail-v2/lib/google/cloud/retail/v2/user_event_service/operations.rb deleted file mode 100644 index 53cb1582033d..000000000000 --- a/owl-bot-staging/google-cloud-retail-v2/lib/google/cloud/retail/v2/user_event_service/operations.rb +++ /dev/null @@ -1,841 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -require "gapic/operation" -require "google/longrunning/operations_pb" - -module Google - module Cloud - module Retail - module V2 - module UserEventService - # Service that implements Longrunning Operations API. - class Operations - # @private - API_VERSION = "" - - # @private - DEFAULT_ENDPOINT_TEMPLATE = "retail.$UNIVERSE_DOMAIN$" - - # @private - attr_reader :operations_stub - - ## - # Configuration for the UserEventService 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 UserEventService 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::Retail::V2::VERSION - metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - header_params = {} - if request.name - header_params["name"] = request.name - end - - request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") - metadata[:"x-goog-request-params"] ||= request_params_header - - options.apply_defaults timeout: @config.rpcs.list_operations.timeout, - metadata: metadata, - retry_policy: @config.rpcs.list_operations.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @operations_stub.call_rpc :list_operations, request, options: options do |response, operation| - wrap_lro_operation = ->(op_response) { ::Gapic::Operation.new op_response, @operations_client } - response = ::Gapic::PagedEnumerable.new @operations_stub, :list_operations, request, response, operation, options, format_resource: wrap_lro_operation - yield response, operation if block_given? - throw :response, response - end - rescue ::GRPC::BadStatus => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Gets the latest state of a long-running operation. Clients can use this - # method to poll the operation result at intervals as recommended by the API - # service. - # - # @overload get_operation(request, options = nil) - # Pass arguments to `get_operation` via a request object, either of type - # {::Google::Longrunning::GetOperationRequest} or an equivalent Hash. - # - # @param request [::Google::Longrunning::GetOperationRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. - # - # @overload get_operation(name: nil) - # Pass arguments to `get_operation` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param name [::String] - # The name of the operation resource. - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Gapic::Operation] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Gapic::Operation] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/longrunning" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Longrunning::Operations::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Longrunning::GetOperationRequest.new - # - # # Call the get_operation method. - # result = client.get_operation request - # - # # The returned object is of type Gapic::Operation. You can use it to - # # check the status of an operation, cancel it, or wait for results. - # # Here is how to wait for a response. - # result.wait_until_done! timeout: 60 - # if result.response? - # p result.response - # else - # puts "No response received." - # end - # - def get_operation request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Longrunning::GetOperationRequest - - # Converts hash and nil to an options object - options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h - - # Customize the options with defaults - metadata = @config.rpcs.get_operation.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::Retail::V2::VERSION - metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - header_params = {} - if request.name - header_params["name"] = request.name - end - - request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") - metadata[:"x-goog-request-params"] ||= request_params_header - - options.apply_defaults timeout: @config.rpcs.get_operation.timeout, - metadata: metadata, - retry_policy: @config.rpcs.get_operation.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @operations_stub.call_rpc :get_operation, request, options: options do |response, operation| - response = ::Gapic::Operation.new response, @operations_client, options: options - yield response, operation if block_given? - throw :response, response - end - rescue ::GRPC::BadStatus => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Deletes a long-running operation. This method indicates that the client is - # no longer interested in the operation result. It does not cancel the - # operation. If the server doesn't support this method, it returns - # `google.rpc.Code.UNIMPLEMENTED`. - # - # @overload delete_operation(request, options = nil) - # Pass arguments to `delete_operation` via a request object, either of type - # {::Google::Longrunning::DeleteOperationRequest} or an equivalent Hash. - # - # @param request [::Google::Longrunning::DeleteOperationRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. - # - # @overload delete_operation(name: nil) - # Pass arguments to `delete_operation` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param name [::String] - # The name of the operation resource to be deleted. - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Google::Protobuf::Empty] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Google::Protobuf::Empty] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/longrunning" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Longrunning::Operations::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Longrunning::DeleteOperationRequest.new - # - # # Call the delete_operation method. - # result = client.delete_operation request - # - # # The returned object is of type Google::Protobuf::Empty. - # p result - # - def delete_operation request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Longrunning::DeleteOperationRequest - - # Converts hash and nil to an options object - options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h - - # Customize the options with defaults - metadata = @config.rpcs.delete_operation.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::Retail::V2::VERSION - metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - header_params = {} - if request.name - header_params["name"] = request.name - end - - request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") - metadata[:"x-goog-request-params"] ||= request_params_header - - options.apply_defaults timeout: @config.rpcs.delete_operation.timeout, - metadata: metadata, - retry_policy: @config.rpcs.delete_operation.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @operations_stub.call_rpc :delete_operation, request, options: options do |response, operation| - yield response, operation if block_given? - end - rescue ::GRPC::BadStatus => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Starts asynchronous cancellation on a long-running operation. The server - # makes a best effort to cancel the operation, but success is not - # guaranteed. If the server doesn't support this method, it returns - # `google.rpc.Code.UNIMPLEMENTED`. Clients can use - # Operations.GetOperation or - # other methods to check whether the cancellation succeeded or whether the - # operation completed despite cancellation. On successful cancellation, - # the operation is not deleted; instead, it becomes an operation with - # an {::Google::Longrunning::Operation#error Operation.error} value with a - # {::Google::Rpc::Status#code google.rpc.Status.code} of `1`, corresponding to - # `Code.CANCELLED`. - # - # @overload cancel_operation(request, options = nil) - # Pass arguments to `cancel_operation` via a request object, either of type - # {::Google::Longrunning::CancelOperationRequest} or an equivalent Hash. - # - # @param request [::Google::Longrunning::CancelOperationRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. - # - # @overload cancel_operation(name: nil) - # Pass arguments to `cancel_operation` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param name [::String] - # The name of the operation resource to be cancelled. - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Google::Protobuf::Empty] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Google::Protobuf::Empty] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/longrunning" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Longrunning::Operations::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Longrunning::CancelOperationRequest.new - # - # # Call the cancel_operation method. - # result = client.cancel_operation request - # - # # The returned object is of type Google::Protobuf::Empty. - # p result - # - def cancel_operation request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Longrunning::CancelOperationRequest - - # Converts hash and nil to an options object - options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h - - # Customize the options with defaults - metadata = @config.rpcs.cancel_operation.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::Retail::V2::VERSION - metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - header_params = {} - if request.name - header_params["name"] = request.name - end - - request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") - metadata[:"x-goog-request-params"] ||= request_params_header - - options.apply_defaults timeout: @config.rpcs.cancel_operation.timeout, - metadata: metadata, - retry_policy: @config.rpcs.cancel_operation.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @operations_stub.call_rpc :cancel_operation, request, options: options do |response, operation| - yield response, operation if block_given? - end - rescue ::GRPC::BadStatus => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Waits until the specified long-running operation is done or reaches at most - # a specified timeout, returning the latest state. If the operation is - # already done, the latest state is immediately returned. If the timeout - # specified is greater than the default HTTP/RPC timeout, the HTTP/RPC - # timeout is used. If the server does not support this method, it returns - # `google.rpc.Code.UNIMPLEMENTED`. - # Note that this method is on a best-effort basis. It may return the latest - # state before the specified timeout (including immediately), meaning even an - # immediate response is no guarantee that the operation is done. - # - # @overload wait_operation(request, options = nil) - # Pass arguments to `wait_operation` via a request object, either of type - # {::Google::Longrunning::WaitOperationRequest} or an equivalent Hash. - # - # @param request [::Google::Longrunning::WaitOperationRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. - # - # @overload wait_operation(name: nil, timeout: nil) - # Pass arguments to `wait_operation` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param name [::String] - # The name of the operation resource to wait on. - # @param timeout [::Google::Protobuf::Duration, ::Hash] - # The maximum duration to wait before timing out. If left blank, the wait - # will be at most the time permitted by the underlying HTTP/RPC protocol. - # If RPC context deadline is also specified, the shorter one will be used. - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Gapic::Operation] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Gapic::Operation] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/longrunning" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Longrunning::Operations::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Longrunning::WaitOperationRequest.new - # - # # Call the wait_operation method. - # result = client.wait_operation request - # - # # The returned object is of type Gapic::Operation. You can use it to - # # check the status of an operation, cancel it, or wait for results. - # # Here is how to wait for a response. - # result.wait_until_done! timeout: 60 - # if result.response? - # p result.response - # else - # puts "No response received." - # end - # - def wait_operation request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Longrunning::WaitOperationRequest - - # Converts hash and nil to an options object - options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h - - # Customize the options with defaults - metadata = @config.rpcs.wait_operation.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::Retail::V2::VERSION - metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - options.apply_defaults timeout: @config.rpcs.wait_operation.timeout, - metadata: metadata, - retry_policy: @config.rpcs.wait_operation.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @operations_stub.call_rpc :wait_operation, request, options: options do |response, operation| - response = ::Gapic::Operation.new response, @operations_client, options: options - yield response, operation if block_given? - throw :response, response - end - rescue ::GRPC::BadStatus => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Configuration class for the Operations API. - # - # This class represents the configuration for Operations, - # providing control over timeouts, retry behavior, logging, transport - # parameters, and other low-level controls. Certain parameters can also be - # applied individually to specific RPCs. See - # {::Google::Longrunning::Operations::Client::Configuration::Rpcs} - # for a list of RPCs that can be configured independently. - # - # Configuration can be applied globally to all clients, or to a single client - # on construction. - # - # @example - # - # # Modify the global config, setting the timeout for - # # list_operations to 20 seconds, - # # and all remaining timeouts to 10 seconds. - # ::Google::Longrunning::Operations::Client.configure do |config| - # config.timeout = 10.0 - # config.rpcs.list_operations.timeout = 20.0 - # end - # - # # Apply the above configuration only to a new client. - # client = ::Google::Longrunning::Operations::Client.new do |config| - # config.timeout = 10.0 - # config.rpcs.list_operations.timeout = 20.0 - # end - # - # @!attribute [rw] endpoint - # A custom service endpoint, as a hostname or hostname:port. The default is - # nil, indicating to use the default endpoint in the current universe domain. - # @return [::String,nil] - # @!attribute [rw] credentials - # Credentials to send with calls. You may provide any of the following types: - # * (`Google::Auth::Credentials`) A googleauth credentials object - # (see the [googleauth docs](https://rubydoc.info/gems/googleauth/Google/Auth/Credentials)) - # * (`Signet::OAuth2::Client`) A signet oauth2 client object - # (see the [signet docs](https://rubydoc.info/gems/signet/Signet/OAuth2/Client)) - # * (`GRPC::Core::Channel`) a gRPC channel with included credentials - # * (`GRPC::Core::ChannelCredentials`) a gRPC credentails object - # * (`nil`) indicating no credentials - # - # @note Warning: Passing a `String` to a keyfile path or a `Hash` of credentials - # is deprecated. Providing an unvalidated credential configuration to - # Google APIs can compromise the security of your systems and data. - # - # @example - # - # # The recommended way to provide credentials is to use the `make_creds` method - # # on the appropriate credentials class for your environment. - # - # require "googleauth" - # - # credentials = ::Google::Auth::ServiceAccountCredentials.make_creds( - # json_key_io: ::File.open("/path/to/keyfile.json") - # ) - # - # client = ::Google::Longrunning::Operations::Client.new do |config| - # config.credentials = credentials - # end - # - # @note Warning: If you accept a credential configuration (JSON file or Hash) from an - # external source for authentication to Google Cloud, you must validate it before - # providing it to a Google API client library. Providing an unvalidated credential - # configuration to Google APIs can compromise the security of your systems and data. - # For more information, refer to [Validate credential configurations from external - # sources](https://cloud.google.com/docs/authentication/external/externally-sourced-credentials). - # @return [::Object] - # @!attribute [rw] scope - # The OAuth scopes - # @return [::Array<::String>] - # @!attribute [rw] lib_name - # The library name as recorded in instrumentation and logging - # @return [::String] - # @!attribute [rw] lib_version - # The library version as recorded in instrumentation and logging - # @return [::String] - # @!attribute [rw] channel_args - # Extra parameters passed to the gRPC channel. Note: this is ignored if a - # `GRPC::Core::Channel` object is provided as the credential. - # @return [::Hash] - # @!attribute [rw] interceptors - # An array of interceptors that are run before calls are executed. - # @return [::Array<::GRPC::ClientInterceptor>] - # @!attribute [rw] timeout - # The call timeout in seconds. - # @return [::Numeric] - # @!attribute [rw] metadata - # Additional gRPC headers to be sent with the call. - # @return [::Hash{::Symbol=>::String}] - # @!attribute [rw] retry_policy - # The retry policy. The value is a hash with the following keys: - # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds. - # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds. - # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier. - # * `:retry_codes` (*type:* `Array`) - The error codes that should - # trigger a retry. - # @return [::Hash] - # @!attribute [rw] quota_project - # A separate project against which to charge quota. - # @return [::String] - # @!attribute [rw] universe_domain - # The universe domain within which to make requests. This determines the - # default endpoint URL. The default value of nil uses the environment - # universe (usually the default "googleapis.com" universe). - # @return [::String,nil] - # @!attribute [rw] logger - # A custom logger to use for request/response debug logging, or the value - # `:default` (the default) to construct a default logger, or `nil` to - # explicitly disable logging. - # @return [::Logger,:default,nil] - # - class Configuration - extend ::Gapic::Config - - # @private - # The endpoint specific to the default "googleapis.com" universe. Deprecated. - DEFAULT_ENDPOINT = "retail.googleapis.com" - - config_attr :endpoint, nil, ::String, nil - config_attr :credentials, nil do |value| - allowed = [::String, ::Hash, ::Proc, ::Symbol, ::Google::Auth::Credentials, ::Google::Auth::BaseClient, ::Signet::OAuth2::Client, nil] - allowed += [::GRPC::Core::Channel, ::GRPC::Core::ChannelCredentials] if defined? ::GRPC::Core::Channel - allowed.any? { |klass| klass === value } - end - config_attr :scope, nil, ::String, ::Array, nil - config_attr :lib_name, nil, ::String, nil - config_attr :lib_version, nil, ::String, nil - config_attr(:channel_args, { "grpc.service_config_disable_resolution" => 1 }, ::Hash, nil) - config_attr :interceptors, nil, ::Array, nil - config_attr :timeout, nil, ::Numeric, nil - config_attr :metadata, nil, ::Hash, nil - config_attr :retry_policy, nil, ::Hash, ::Proc, nil - config_attr :quota_project, nil, ::String, nil - config_attr :universe_domain, nil, ::String, nil - config_attr :logger, :default, ::Logger, nil, :default - - # @private - def initialize parent_config = nil - @parent_config = parent_config unless parent_config.nil? - - yield self if block_given? - end - - ## - # Configurations for individual RPCs - # @return [Rpcs] - # - def rpcs - @rpcs ||= begin - parent_rpcs = nil - parent_rpcs = @parent_config.rpcs if defined?(@parent_config) && @parent_config.respond_to?(:rpcs) - Rpcs.new parent_rpcs - end - end - - ## - # Configuration for the channel pool - # @return [::Gapic::ServiceStub::ChannelPool::Configuration] - # - def channel_pool - @channel_pool ||= ::Gapic::ServiceStub::ChannelPool::Configuration.new - end - - ## - # Configuration RPC class for the Operations API. - # - # Includes fields providing the configuration for each RPC in this service. - # Each configuration object is of type `Gapic::Config::Method` and includes - # the following configuration fields: - # - # * `timeout` (*type:* `Numeric`) - The call timeout in seconds - # * `metadata` (*type:* `Hash{Symbol=>String}`) - Additional gRPC headers - # * `retry_policy (*type:* `Hash`) - The retry policy. The policy fields - # include the following keys: - # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds. - # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds. - # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier. - # * `:retry_codes` (*type:* `Array`) - The error codes that should - # trigger a retry. - # - class Rpcs - ## - # RPC-specific configuration for `list_operations` - # @return [::Gapic::Config::Method] - # - attr_reader :list_operations - ## - # RPC-specific configuration for `get_operation` - # @return [::Gapic::Config::Method] - # - attr_reader :get_operation - ## - # RPC-specific configuration for `delete_operation` - # @return [::Gapic::Config::Method] - # - attr_reader :delete_operation - ## - # RPC-specific configuration for `cancel_operation` - # @return [::Gapic::Config::Method] - # - attr_reader :cancel_operation - ## - # RPC-specific configuration for `wait_operation` - # @return [::Gapic::Config::Method] - # - attr_reader :wait_operation - - # @private - def initialize parent_rpcs = nil - list_operations_config = parent_rpcs.list_operations if parent_rpcs.respond_to? :list_operations - @list_operations = ::Gapic::Config::Method.new list_operations_config - get_operation_config = parent_rpcs.get_operation if parent_rpcs.respond_to? :get_operation - @get_operation = ::Gapic::Config::Method.new get_operation_config - delete_operation_config = parent_rpcs.delete_operation if parent_rpcs.respond_to? :delete_operation - @delete_operation = ::Gapic::Config::Method.new delete_operation_config - cancel_operation_config = parent_rpcs.cancel_operation if parent_rpcs.respond_to? :cancel_operation - @cancel_operation = ::Gapic::Config::Method.new cancel_operation_config - wait_operation_config = parent_rpcs.wait_operation if parent_rpcs.respond_to? :wait_operation - @wait_operation = ::Gapic::Config::Method.new wait_operation_config - - yield self if block_given? - end - end - end - end - end - end - end - end -end diff --git a/owl-bot-staging/google-cloud-retail-v2/lib/google/cloud/retail/v2/user_event_service/paths.rb b/owl-bot-staging/google-cloud-retail-v2/lib/google/cloud/retail/v2/user_event_service/paths.rb deleted file mode 100644 index 83bc1611ec7f..000000000000 --- a/owl-bot-staging/google-cloud-retail-v2/lib/google/cloud/retail/v2/user_event_service/paths.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 Cloud - module Retail - module V2 - module UserEventService - # Path helper methods for the UserEventService API. - module Paths - ## - # Create a fully-qualified Catalog resource string. - # - # The resource will be in the following format: - # - # `projects/{project}/locations/{location}/catalogs/{catalog}` - # - # @param project [String] - # @param location [String] - # @param catalog [String] - # - # @return [::String] - def catalog_path project:, location:, catalog: - raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" - raise ::ArgumentError, "location cannot contain /" if location.to_s.include? "/" - - "projects/#{project}/locations/#{location}/catalogs/#{catalog}" - end - - ## - # Create a fully-qualified Product resource string. - # - # The resource will be in the following format: - # - # `projects/{project}/locations/{location}/catalogs/{catalog}/branches/{branch}/products/{product}` - # - # @param project [String] - # @param location [String] - # @param catalog [String] - # @param branch [String] - # @param product [String] - # - # @return [::String] - def product_path project:, location:, catalog:, branch:, product: - raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" - raise ::ArgumentError, "location cannot contain /" if location.to_s.include? "/" - raise ::ArgumentError, "catalog cannot contain /" if catalog.to_s.include? "/" - raise ::ArgumentError, "branch cannot contain /" if branch.to_s.include? "/" - - "projects/#{project}/locations/#{location}/catalogs/#{catalog}/branches/#{branch}/products/#{product}" - end - - extend self - end - end - end - end - end -end diff --git a/owl-bot-staging/google-cloud-retail-v2/lib/google/cloud/retail/v2/user_event_service/rest.rb b/owl-bot-staging/google-cloud-retail-v2/lib/google/cloud/retail/v2/user_event_service/rest.rb deleted file mode 100644 index dfa91294298f..000000000000 --- a/owl-bot-staging/google-cloud-retail-v2/lib/google/cloud/retail/v2/user_event_service/rest.rb +++ /dev/null @@ -1,53 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -require "gapic/rest" -require "gapic/config" -require "gapic/config/method" - -require "google/cloud/retail/v2/version" - -require "google/cloud/retail/v2/user_event_service/credentials" -require "google/cloud/retail/v2/user_event_service/paths" -require "google/cloud/retail/v2/user_event_service/rest/operations" -require "google/cloud/retail/v2/user_event_service/rest/client" - -module Google - module Cloud - module Retail - module V2 - ## - # Service for ingesting end user actions on the customer website. - # - # To load this service and instantiate a REST client: - # - # require "google/cloud/retail/v2/user_event_service/rest" - # client = ::Google::Cloud::Retail::V2::UserEventService::Rest::Client.new - # - module UserEventService - # Client for the REST transport - module Rest - end - end - end - end - end -end - -helper_path = ::File.join __dir__, "rest", "helpers.rb" -require "google/cloud/retail/v2/user_event_service/rest/helpers" if ::File.file? helper_path diff --git a/owl-bot-staging/google-cloud-retail-v2/lib/google/cloud/retail/v2/user_event_service/rest/client.rb b/owl-bot-staging/google-cloud-retail-v2/lib/google/cloud/retail/v2/user_event_service/rest/client.rb deleted file mode 100644 index 758920156bf4..000000000000 --- a/owl-bot-staging/google-cloud-retail-v2/lib/google/cloud/retail/v2/user_event_service/rest/client.rb +++ /dev/null @@ -1,928 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -require "google/cloud/errors" -require "google/cloud/retail/v2/user_event_service_pb" -require "google/cloud/retail/v2/user_event_service/rest/service_stub" -require "google/cloud/location/rest" - -module Google - module Cloud - module Retail - module V2 - module UserEventService - module Rest - ## - # REST client for the UserEventService service. - # - # Service for ingesting end user actions on the customer website. - # - class Client - # @private - API_VERSION = "" - - # @private - DEFAULT_ENDPOINT_TEMPLATE = "retail.$UNIVERSE_DOMAIN$" - - include Paths - - # @private - attr_reader :user_event_service_stub - - ## - # Configure the UserEventService Client class. - # - # See {::Google::Cloud::Retail::V2::UserEventService::Rest::Client::Configuration} - # for a description of the configuration fields. - # - # @example - # - # # Modify the configuration for all UserEventService clients - # ::Google::Cloud::Retail::V2::UserEventService::Rest::Client.configure do |config| - # config.timeout = 10.0 - # end - # - # @yield [config] Configure the Client client. - # @yieldparam config [Client::Configuration] - # - # @return [Client::Configuration] - # - def self.configure - @configure ||= begin - namespace = ["Google", "Cloud", "Retail", "V2"] - parent_config = while namespace.any? - parent_name = namespace.join "::" - parent_const = const_get parent_name - break parent_const.configure if parent_const.respond_to? :configure - namespace.pop - end - default_config = Client::Configuration.new parent_config - - default_config.timeout = 10.0 - default_config.retry_policy = { - initial_delay: 0.1, max_delay: 5.0, multiplier: 1.3, retry_codes: [14, 4] - } - - default_config.rpcs.purge_user_events.timeout = 30.0 - default_config.rpcs.purge_user_events.retry_policy = { - initial_delay: 0.1, max_delay: 30.0, multiplier: 1.3, retry_codes: [14, 4] - } - - default_config.rpcs.import_user_events.timeout = 600.0 - default_config.rpcs.import_user_events.retry_policy = { - initial_delay: 0.1, max_delay: 300.0, multiplier: 1.3, retry_codes: [14, 4] - } - - default_config - end - yield @configure if block_given? - @configure - end - - ## - # Configure the UserEventService Client instance. - # - # The configuration is set to the derived mode, meaning that values can be changed, - # but structural changes (adding new fields, etc.) are not allowed. Structural changes - # should be made on {Client.configure}. - # - # See {::Google::Cloud::Retail::V2::UserEventService::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 - @user_event_service_stub.universe_domain - end - - ## - # Create a new UserEventService REST client object. - # - # @example - # - # # Create a client using the default configuration - # client = ::Google::Cloud::Retail::V2::UserEventService::Rest::Client.new - # - # # Create a client using a custom configuration - # client = ::Google::Cloud::Retail::V2::UserEventService::Rest::Client.new do |config| - # config.timeout = 10.0 - # end - # - # @yield [config] Configure the UserEventService client. - # @yieldparam config [Client::Configuration] - # - def initialize - # Create the configuration object - @config = Configuration.new Client.configure - - # Yield the configuration if needed - yield @config if block_given? - - # Create credentials - credentials = @config.credentials - # Use self-signed JWT if the endpoint is unchanged from default, - # but only if the default endpoint does not have a region prefix. - enable_self_signed_jwt = @config.endpoint.nil? || - (@config.endpoint == Configuration::DEFAULT_ENDPOINT && - !@config.endpoint.split(".").first.include?("-")) - credentials ||= Credentials.default scope: @config.scope, - enable_self_signed_jwt: enable_self_signed_jwt - if credentials.is_a?(::String) || credentials.is_a?(::Hash) - credentials = Credentials.new credentials, scope: @config.scope - end - - @quota_project_id = @config.quota_project - @quota_project_id ||= credentials.quota_project_id if credentials.respond_to? :quota_project_id - - @operations_client = ::Google::Cloud::Retail::V2::UserEventService::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 - - @user_event_service_stub = ::Google::Cloud::Retail::V2::UserEventService::Rest::ServiceStub.new( - endpoint: @config.endpoint, - endpoint_template: DEFAULT_ENDPOINT_TEMPLATE, - universe_domain: @config.universe_domain, - credentials: credentials, - logger: @config.logger - ) - - @user_event_service_stub.logger(stub: true)&.info do |entry| - entry.set_system_name - entry.set_service - entry.message = "Created client for #{entry.service}" - entry.set_credentials_fields credentials - entry.set "customEndpoint", @config.endpoint if @config.endpoint - entry.set "defaultTimeout", @config.timeout if @config.timeout - entry.set "quotaProject", @quota_project_id if @quota_project_id - end - - @location_client = Google::Cloud::Location::Locations::Rest::Client.new do |config| - config.credentials = credentials - config.quota_project = @quota_project_id - config.endpoint = @user_event_service_stub.endpoint - config.universe_domain = @user_event_service_stub.universe_domain - config.logger = @user_event_service_stub.logger if config.respond_to? :logger= - end - end - - ## - # Get the associated client for long-running operations. - # - # @return [::Google::Cloud::Retail::V2::UserEventService::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 - @user_event_service_stub.logger - end - - # Service calls - - ## - # Writes a single user event. - # - # @overload write_user_event(request, options = nil) - # Pass arguments to `write_user_event` via a request object, either of type - # {::Google::Cloud::Retail::V2::WriteUserEventRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Retail::V2::WriteUserEventRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @overload write_user_event(parent: nil, user_event: nil, write_async: nil) - # Pass arguments to `write_user_event` via keyword arguments. Note that at - # least one keyword argument is 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 catalog resource name, such as - # `projects/1234/locations/global/catalogs/default_catalog`. - # @param user_event [::Google::Cloud::Retail::V2::UserEvent, ::Hash] - # Required. User event to write. - # @param write_async [::Boolean] - # If set to true, the user event will be written asynchronously after - # validation, and the API will respond without waiting for the write. - # Therefore, silent failures can occur even if the API returns success. In - # case of silent failures, error messages can be found in Stackdriver logs. - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Cloud::Retail::V2::UserEvent] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::Retail::V2::UserEvent] - # - # @raise [::Google::Cloud::Error] if the REST call is aborted. - # - # @example Basic example - # require "google/cloud/retail/v2" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Retail::V2::UserEventService::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Retail::V2::WriteUserEventRequest.new - # - # # Call the write_user_event method. - # result = client.write_user_event request - # - # # The returned object is of type Google::Cloud::Retail::V2::UserEvent. - # p result - # - def write_user_event request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Retail::V2::WriteUserEventRequest - - # Converts hash 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.write_user_event.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::Retail::V2::VERSION, - transports_version_send: [:rest] - - call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - options.apply_defaults timeout: @config.rpcs.write_user_event.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.write_user_event.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @user_event_service_stub.write_user_event 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 - - ## - # Writes a single user event from the browser. - # - # For larger user event payload over 16 KB, the POST method should be used - # instead, otherwise a 400 Bad Request error is returned. - # - # This method is used only by the Retail API JavaScript pixel and Google Tag - # Manager. Users should not call this method directly. - # - # @overload collect_user_event(request, options = nil) - # Pass arguments to `collect_user_event` via a request object, either of type - # {::Google::Cloud::Retail::V2::CollectUserEventRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Retail::V2::CollectUserEventRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @overload collect_user_event(prebuilt_rule: nil, parent: nil, user_event: nil, uri: nil, ets: nil, raw_json: nil) - # Pass arguments to `collect_user_event` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param prebuilt_rule [::String] - # The prebuilt rule name that can convert a specific type of raw_json. - # For example: "ga4_bq" rule for the GA4 user event schema. - # @param parent [::String] - # Required. The parent catalog name, such as - # `projects/1234/locations/global/catalogs/default_catalog`. - # @param user_event [::String] - # Required. URL encoded UserEvent proto with a length limit of 2,000,000 - # characters. - # @param uri [::String] - # The URL including cgi-parameters but excluding the hash fragment with a - # length limit of 5,000 characters. This is often more useful than the - # referer URL, because many browsers only send the domain for 3rd party - # requests. - # @param ets [::Integer] - # The event timestamp in milliseconds. This prevents browser caching of - # otherwise identical get requests. The name is abbreviated to reduce the - # payload bytes. - # @param raw_json [::String] - # An arbitrary serialized JSON string that contains necessary information - # that can comprise a user event. When this field is specified, the - # user_event field will be ignored. Note: line-delimited JSON is not - # supported, a single JSON only. - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Api::HttpBody] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Api::HttpBody] - # - # @raise [::Google::Cloud::Error] if the REST call is aborted. - # - # @example Basic example - # require "google/cloud/retail/v2" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Retail::V2::UserEventService::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Retail::V2::CollectUserEventRequest.new - # - # # Call the collect_user_event method. - # result = client.collect_user_event request - # - # # The returned object is of type Google::Api::HttpBody. - # p result - # - def collect_user_event request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Retail::V2::CollectUserEventRequest - - # Converts hash 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.collect_user_event.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::Retail::V2::VERSION, - transports_version_send: [:rest] - - call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - options.apply_defaults timeout: @config.rpcs.collect_user_event.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.collect_user_event.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @user_event_service_stub.collect_user_event request, options do |result, operation| - yield result, operation if block_given? - end - rescue ::Gapic::Rest::Error => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Deletes permanently all user events specified by the filter provided. - # Depending on the number of events specified by the filter, this operation - # could take hours or days to complete. To test a filter, use the list - # command first. - # - # @overload purge_user_events(request, options = nil) - # Pass arguments to `purge_user_events` via a request object, either of type - # {::Google::Cloud::Retail::V2::PurgeUserEventsRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Retail::V2::PurgeUserEventsRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @overload purge_user_events(parent: nil, filter: nil, force: nil) - # Pass arguments to `purge_user_events` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param parent [::String] - # Required. The resource name of the catalog under which the events are - # created. The format is - # `projects/${projectId}/locations/global/catalogs/${catalogId}` - # @param filter [::String] - # Required. The filter string to specify the events to be deleted with a - # length limit of 5,000 characters. Empty string filter is not allowed. The - # eligible fields for filtering are: - # - # * `eventType`: Double quoted - # {::Google::Cloud::Retail::V2::UserEvent#event_type UserEvent.event_type} string. - # * `eventTime`: in ISO 8601 "zulu" format. - # * `visitorId`: Double quoted string. Specifying this will delete all - # events associated with a visitor. - # * `userId`: Double quoted string. Specifying this will delete all events - # associated with a user. - # - # Examples: - # - # * Deleting all events in a time range: - # `eventTime > "2012-04-23T18:25:43.511Z" - # eventTime < "2012-04-23T18:30:43.511Z"` - # * Deleting specific eventType in time range: - # `eventTime > "2012-04-23T18:25:43.511Z" eventType = "detail-page-view"` - # * Deleting all events for a specific visitor: - # `visitorId = "visitor1024"` - # - # The filtering fields are assumed to have an implicit AND. - # @param force [::Boolean] - # Actually perform the purge. - # If `force` is set to false, the method will return the expected purge count - # without deleting any user events. - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Gapic::Operation] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Gapic::Operation] - # - # @raise [::Google::Cloud::Error] if the REST call is aborted. - # - # @example Basic example - # require "google/cloud/retail/v2" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Retail::V2::UserEventService::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Retail::V2::PurgeUserEventsRequest.new - # - # # Call the purge_user_events method. - # result = client.purge_user_events 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 purge_user_events request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Retail::V2::PurgeUserEventsRequest - - # Converts hash 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.purge_user_events.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::Retail::V2::VERSION, - transports_version_send: [:rest] - - call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - options.apply_defaults timeout: @config.rpcs.purge_user_events.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.purge_user_events.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @user_event_service_stub.purge_user_events 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 - - ## - # Bulk import of User events. Request processing might be - # synchronous. Events that already exist are skipped. - # Use this method for backfilling historical user events. - # - # `Operation.response` is of type `ImportResponse`. Note that it is - # possible for a subset of the items to be successfully inserted. - # `Operation.metadata` is of type `ImportMetadata`. - # - # @overload import_user_events(request, options = nil) - # Pass arguments to `import_user_events` via a request object, either of type - # {::Google::Cloud::Retail::V2::ImportUserEventsRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Retail::V2::ImportUserEventsRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @overload import_user_events(parent: nil, input_config: nil, errors_config: nil) - # Pass arguments to `import_user_events` via keyword arguments. Note that at - # least one keyword argument is 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. `projects/1234/locations/global/catalogs/default_catalog` - # @param input_config [::Google::Cloud::Retail::V2::UserEventInputConfig, ::Hash] - # Required. The desired input location of the data. - # @param errors_config [::Google::Cloud::Retail::V2::ImportErrorsConfig, ::Hash] - # The desired location of errors incurred during the Import. Cannot be set - # for inline user event imports. - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Gapic::Operation] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Gapic::Operation] - # - # @raise [::Google::Cloud::Error] if the REST call is aborted. - # - # @example Basic example - # require "google/cloud/retail/v2" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Retail::V2::UserEventService::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Retail::V2::ImportUserEventsRequest.new - # - # # Call the import_user_events method. - # result = client.import_user_events 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 import_user_events request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Retail::V2::ImportUserEventsRequest - - # Converts hash 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.import_user_events.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::Retail::V2::VERSION, - transports_version_send: [:rest] - - call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - options.apply_defaults timeout: @config.rpcs.import_user_events.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.import_user_events.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @user_event_service_stub.import_user_events 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 - - ## - # Starts a user-event rejoin operation with latest product catalog. Events - # are not annotated with detailed product information for products that are - # missing from the catalog when the user event is ingested. These - # events are stored as unjoined events with limited usage on training and - # serving. You can use this method to start a join operation on specified - # events with the latest version of product catalog. You can also use this - # method to correct events joined with the wrong product catalog. A rejoin - # operation can take hours or days to complete. - # - # @overload rejoin_user_events(request, options = nil) - # Pass arguments to `rejoin_user_events` via a request object, either of type - # {::Google::Cloud::Retail::V2::RejoinUserEventsRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Retail::V2::RejoinUserEventsRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @overload rejoin_user_events(parent: nil, user_event_rejoin_scope: nil) - # Pass arguments to `rejoin_user_events` via keyword arguments. Note that at - # least one keyword argument is 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 catalog resource name, such as - # `projects/1234/locations/global/catalogs/default_catalog`. - # @param user_event_rejoin_scope [::Google::Cloud::Retail::V2::RejoinUserEventsRequest::UserEventRejoinScope] - # The type of the user event rejoin to define the scope and range of the user - # events to be rejoined with the latest product catalog. Defaults to - # `USER_EVENT_REJOIN_SCOPE_UNSPECIFIED` if this field is not set, or set to - # an invalid integer value. - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Gapic::Operation] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Gapic::Operation] - # - # @raise [::Google::Cloud::Error] if the REST call is aborted. - # - # @example Basic example - # require "google/cloud/retail/v2" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Retail::V2::UserEventService::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Retail::V2::RejoinUserEventsRequest.new - # - # # Call the rejoin_user_events method. - # result = client.rejoin_user_events 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 rejoin_user_events request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Retail::V2::RejoinUserEventsRequest - - # Converts hash 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.rejoin_user_events.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::Retail::V2::VERSION, - transports_version_send: [:rest] - - call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - options.apply_defaults timeout: @config.rpcs.rejoin_user_events.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.rejoin_user_events.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @user_event_service_stub.rejoin_user_events 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 - - ## - # Configuration class for the UserEventService REST API. - # - # This class represents the configuration for UserEventService REST, - # providing control over timeouts, retry behavior, logging, transport - # parameters, and other low-level controls. Certain parameters can also be - # applied individually to specific RPCs. See - # {::Google::Cloud::Retail::V2::UserEventService::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 - # # write_user_event to 20 seconds, - # # and all remaining timeouts to 10 seconds. - # ::Google::Cloud::Retail::V2::UserEventService::Rest::Client.configure do |config| - # config.timeout = 10.0 - # config.rpcs.write_user_event.timeout = 20.0 - # end - # - # # Apply the above configuration only to a new client. - # client = ::Google::Cloud::Retail::V2::UserEventService::Rest::Client.new do |config| - # config.timeout = 10.0 - # config.rpcs.write_user_event.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 = "retail.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 UserEventService 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 `write_user_event` - # @return [::Gapic::Config::Method] - # - attr_reader :write_user_event - ## - # RPC-specific configuration for `collect_user_event` - # @return [::Gapic::Config::Method] - # - attr_reader :collect_user_event - ## - # RPC-specific configuration for `purge_user_events` - # @return [::Gapic::Config::Method] - # - attr_reader :purge_user_events - ## - # RPC-specific configuration for `import_user_events` - # @return [::Gapic::Config::Method] - # - attr_reader :import_user_events - ## - # RPC-specific configuration for `rejoin_user_events` - # @return [::Gapic::Config::Method] - # - attr_reader :rejoin_user_events - - # @private - def initialize parent_rpcs = nil - write_user_event_config = parent_rpcs.write_user_event if parent_rpcs.respond_to? :write_user_event - @write_user_event = ::Gapic::Config::Method.new write_user_event_config - collect_user_event_config = parent_rpcs.collect_user_event if parent_rpcs.respond_to? :collect_user_event - @collect_user_event = ::Gapic::Config::Method.new collect_user_event_config - purge_user_events_config = parent_rpcs.purge_user_events if parent_rpcs.respond_to? :purge_user_events - @purge_user_events = ::Gapic::Config::Method.new purge_user_events_config - import_user_events_config = parent_rpcs.import_user_events if parent_rpcs.respond_to? :import_user_events - @import_user_events = ::Gapic::Config::Method.new import_user_events_config - rejoin_user_events_config = parent_rpcs.rejoin_user_events if parent_rpcs.respond_to? :rejoin_user_events - @rejoin_user_events = ::Gapic::Config::Method.new rejoin_user_events_config - - yield self if block_given? - end - end - end - end - end - end - end - end - end -end diff --git a/owl-bot-staging/google-cloud-retail-v2/lib/google/cloud/retail/v2/user_event_service/rest/operations.rb b/owl-bot-staging/google-cloud-retail-v2/lib/google/cloud/retail/v2/user_event_service/rest/operations.rb deleted file mode 100644 index 093c7c3864c3..000000000000 --- a/owl-bot-staging/google-cloud-retail-v2/lib/google/cloud/retail/v2/user_event_service/rest/operations.rb +++ /dev/null @@ -1,960 +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 Cloud - module Retail - module V2 - module UserEventService - module Rest - # Service that implements Longrunning Operations API. - class Operations - # @private - API_VERSION = "" - - # @private - DEFAULT_ENDPOINT_TEMPLATE = "retail.$UNIVERSE_DOMAIN$" - - # @private - attr_reader :operations_stub - - ## - # Configuration for the UserEventService 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 UserEventService 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::Retail::V2::VERSION, - transports_version_send: [:rest] - - call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - options.apply_defaults timeout: @config.rpcs.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::Retail::V2::VERSION, - transports_version_send: [:rest] - - call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - options.apply_defaults timeout: @config.rpcs.get_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::Retail::V2::VERSION, - transports_version_send: [:rest] - - call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - options.apply_defaults timeout: @config.rpcs.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::Retail::V2::VERSION, - transports_version_send: [:rest] - - call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - options.apply_defaults timeout: @config.rpcs.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 = "retail.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: "/v2/{name}/operations", - matches: [ - ["name", %r{^projects/[^/]+/locations/[^/]+/?$}, false] - ] - ) - .with_bindings( - uri_method: :get, - uri_template: "/v2/{name}/operations", - matches: [ - ["name", %r{^projects/[^/]+/locations/[^/]+/catalogs/[^/]+/?$}, false] - ] - ) - .with_bindings( - uri_method: :get, - uri_template: "/v2/{name}/operations", - matches: [ - ["name", %r{^projects/[^/]+/?$}, 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: "/v2/{name}", - matches: [ - ["name", %r{^projects/[^/]+/locations/[^/]+/operations/[^/]+/?$}, false] - ] - ) - .with_bindings( - uri_method: :get, - uri_template: "/v2/{name}", - matches: [ - ["name", %r{^projects/[^/]+/locations/[^/]+/catalogs/[^/]+/branches/[^/]+/operations/[^/]+/?$}, false] - ] - ) - .with_bindings( - uri_method: :get, - uri_template: "/v2/{name}", - matches: [ - ["name", %r{^projects/[^/]+/locations/[^/]+/catalogs/[^/]+/operations/[^/]+/?$}, false] - ] - ) - .with_bindings( - uri_method: :get, - uri_template: "/v2/{name}", - matches: [ - ["name", %r{^projects/[^/]+/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 -end diff --git a/owl-bot-staging/google-cloud-retail-v2/lib/google/cloud/retail/v2/user_event_service/rest/service_stub.rb b/owl-bot-staging/google-cloud-retail-v2/lib/google/cloud/retail/v2/user_event_service/rest/service_stub.rb deleted file mode 100644 index d2603e85207f..000000000000 --- a/owl-bot-staging/google-cloud-retail-v2/lib/google/cloud/retail/v2/user_event_service/rest/service_stub.rb +++ /dev/null @@ -1,398 +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/retail/v2/user_event_service_pb" - -module Google - module Cloud - module Retail - module V2 - module UserEventService - module Rest - ## - # REST service stub for the UserEventService 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 write_user_event REST call - # - # @param request_pb [::Google::Cloud::Retail::V2::WriteUserEventRequest] - # A request object representing the call parameters. Required. - # @param options [::Gapic::CallOptions] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Cloud::Retail::V2::UserEvent] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::Retail::V2::UserEvent] - # A result object deserialized from the server's reply - def write_user_event request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_write_user_event_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: "write_user_event", - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Cloud::Retail::V2::UserEvent.decode_json response.body, ignore_unknown_fields: true - catch :response do - yield result, operation if block_given? - result - end - end - - ## - # Baseline implementation for the collect_user_event REST call - # - # @param request_pb [::Google::Cloud::Retail::V2::CollectUserEventRequest] - # 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::Api::HttpBody] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Api::HttpBody] - # A result object deserialized from the server's reply - def collect_user_event request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_collect_user_event_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: "collect_user_event", - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Api::HttpBody.decode_json response.body, ignore_unknown_fields: true - catch :response do - yield result, operation if block_given? - result - end - end - - ## - # Baseline implementation for the purge_user_events REST call - # - # @param request_pb [::Google::Cloud::Retail::V2::PurgeUserEventsRequest] - # 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 purge_user_events request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_purge_user_events_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: "purge_user_events", - 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 import_user_events REST call - # - # @param request_pb [::Google::Cloud::Retail::V2::ImportUserEventsRequest] - # 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 import_user_events request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_import_user_events_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: "import_user_events", - 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 rejoin_user_events REST call - # - # @param request_pb [::Google::Cloud::Retail::V2::RejoinUserEventsRequest] - # 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 rejoin_user_events request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_rejoin_user_events_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: "rejoin_user_events", - 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 - - ## - # @private - # - # GRPC transcoding helper method for the write_user_event REST call - # - # @param request_pb [::Google::Cloud::Retail::V2::WriteUserEventRequest] - # A request object representing the call parameters. Required. - # @return [Array(String, [String, nil], Hash{String => String})] - # Uri, Body, Query string parameters - def self.transcode_write_user_event_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :post, - uri_template: "/v2/{parent}/userEvents:write", - body: "user_event", - matches: [ - ["parent", %r{^projects/[^/]+/locations/[^/]+/catalogs/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the collect_user_event REST call - # - # @param request_pb [::Google::Cloud::Retail::V2::CollectUserEventRequest] - # A request object representing the call parameters. Required. - # @return [Array(String, [String, nil], Hash{String => String})] - # Uri, Body, Query string parameters - def self.transcode_collect_user_event_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :get, - uri_template: "/v2/{parent}/userEvents:collect", - matches: [ - ["parent", %r{^projects/[^/]+/locations/[^/]+/catalogs/[^/]+/?$}, false] - ] - ) - .with_bindings( - uri_method: :post, - uri_template: "/v2/{parent}/userEvents:collect", - body: "*", - matches: [ - ["parent", %r{^projects/[^/]+/locations/[^/]+/catalogs/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the purge_user_events REST call - # - # @param request_pb [::Google::Cloud::Retail::V2::PurgeUserEventsRequest] - # A request object representing the call parameters. Required. - # @return [Array(String, [String, nil], Hash{String => String})] - # Uri, Body, Query string parameters - def self.transcode_purge_user_events_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :post, - uri_template: "/v2/{parent}/userEvents:purge", - body: "*", - matches: [ - ["parent", %r{^projects/[^/]+/locations/[^/]+/catalogs/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the import_user_events REST call - # - # @param request_pb [::Google::Cloud::Retail::V2::ImportUserEventsRequest] - # A request object representing the call parameters. Required. - # @return [Array(String, [String, nil], Hash{String => String})] - # Uri, Body, Query string parameters - def self.transcode_import_user_events_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :post, - uri_template: "/v2/{parent}/userEvents:import", - body: "*", - matches: [ - ["parent", %r{^projects/[^/]+/locations/[^/]+/catalogs/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the rejoin_user_events REST call - # - # @param request_pb [::Google::Cloud::Retail::V2::RejoinUserEventsRequest] - # A request object representing the call parameters. Required. - # @return [Array(String, [String, nil], Hash{String => String})] - # Uri, Body, Query string parameters - def self.transcode_rejoin_user_events_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :post, - uri_template: "/v2/{parent}/userEvents:rejoin", - body: "*", - matches: [ - ["parent", %r{^projects/[^/]+/locations/[^/]+/catalogs/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - end - end - end - end - end - end -end diff --git a/owl-bot-staging/google-cloud-retail-v2/lib/google/cloud/retail/v2/user_event_service_pb.rb b/owl-bot-staging/google-cloud-retail-v2/lib/google/cloud/retail/v2/user_event_service_pb.rb deleted file mode 100644 index 69dbde1899d7..000000000000 --- a/owl-bot-staging/google-cloud-retail-v2/lib/google/cloud/retail/v2/user_event_service_pb.rb +++ /dev/null @@ -1,36 +0,0 @@ -# frozen_string_literal: true -# Generated by the protocol buffer compiler. DO NOT EDIT! -# source: google/cloud/retail/v2/user_event_service.proto - -require 'google/protobuf' - -require 'google/api/annotations_pb' -require 'google/api/client_pb' -require 'google/api/field_behavior_pb' -require 'google/api/httpbody_pb' -require 'google/api/resource_pb' -require 'google/cloud/retail/v2/import_config_pb' -require 'google/cloud/retail/v2/purge_config_pb' -require 'google/cloud/retail/v2/user_event_pb' -require 'google/longrunning/operations_pb' - - -descriptor_data = "\n/google/cloud/retail/v2/user_event_service.proto\x12\x16google.cloud.retail.v2\x1a\x1cgoogle/api/annotations.proto\x1a\x17google/api/client.proto\x1a\x1fgoogle/api/field_behavior.proto\x1a\x19google/api/httpbody.proto\x1a\x19google/api/resource.proto\x1a*google/cloud/retail/v2/import_config.proto\x1a)google/cloud/retail/v2/purge_config.proto\x1a\'google/cloud/retail/v2/user_event.proto\x1a#google/longrunning/operations.proto\"}\n\x15WriteUserEventRequest\x12\x13\n\x06parent\x18\x01 \x01(\tB\x03\xe0\x41\x02\x12:\n\nuser_event\x18\x02 \x01(\x0b\x32!.google.cloud.retail.v2.UserEventB\x03\xe0\x41\x02\x12\x13\n\x0bwrite_async\x18\x03 \x01(\x08\"\x9f\x01\n\x17\x43ollectUserEventRequest\x12\x17\n\rprebuilt_rule\x18\x06 \x01(\tH\x00\x12\x13\n\x06parent\x18\x01 \x01(\tB\x03\xe0\x41\x02\x12\x17\n\nuser_event\x18\x02 \x01(\tB\x03\xe0\x41\x02\x12\x0b\n\x03uri\x18\x03 \x01(\t\x12\x0b\n\x03\x65ts\x18\x04 \x01(\x03\x12\x10\n\x08raw_json\x18\x05 \x01(\tB\x11\n\x0f\x63onversion_rule\"\xfe\x01\n\x17RejoinUserEventsRequest\x12\x13\n\x06parent\x18\x01 \x01(\tB\x03\xe0\x41\x02\x12\x65\n\x17user_event_rejoin_scope\x18\x02 \x01(\x0e\x32\x44.google.cloud.retail.v2.RejoinUserEventsRequest.UserEventRejoinScope\"g\n\x14UserEventRejoinScope\x12\'\n#USER_EVENT_REJOIN_SCOPE_UNSPECIFIED\x10\x00\x12\x11\n\rJOINED_EVENTS\x10\x01\x12\x13\n\x0fUNJOINED_EVENTS\x10\x02\">\n\x18RejoinUserEventsResponse\x12\"\n\x1arejoined_user_events_count\x18\x01 \x01(\x03\"\x1a\n\x18RejoinUserEventsMetadata2\x89\n\n\x10UserEventService\x12\xb7\x01\n\x0eWriteUserEvent\x12-.google.cloud.retail.v2.WriteUserEventRequest\x1a!.google.cloud.retail.v2.UserEvent\"S\x82\xd3\xe4\x93\x02M\"?/v2/{parent=projects/*/locations/*/catalogs/*}/userEvents:write:\nuser_event\x12\xee\x01\n\x10\x43ollectUserEvent\x12/.google.cloud.retail.v2.CollectUserEventRequest\x1a\x14.google.api.HttpBody\"\x92\x01\x82\xd3\xe4\x93\x02\x8b\x01\x12\x41/v2/{parent=projects/*/locations/*/catalogs/*}/userEvents:collectZF\"A/v2/{parent=projects/*/locations/*/catalogs/*}/userEvents:collect:\x01*\x12\x86\x02\n\x0fPurgeUserEvents\x12..google.cloud.retail.v2.PurgeUserEventsRequest\x1a\x1d.google.longrunning.Operation\"\xa3\x01\xca\x41V\n.google.cloud.retail.v2.PurgeUserEventsResponse\x12$google.cloud.retail.v2.PurgeMetadata\x82\xd3\xe4\x93\x02\x44\"?/v2/{parent=projects/*/locations/*/catalogs/*}/userEvents:purge:\x01*\x12\x8b\x02\n\x10ImportUserEvents\x12/.google.cloud.retail.v2.ImportUserEventsRequest\x1a\x1d.google.longrunning.Operation\"\xa6\x01\xca\x41X\n/google.cloud.retail.v2.ImportUserEventsResponse\x12%google.cloud.retail.v2.ImportMetadata\x82\xd3\xe4\x93\x02\x45\"@/v2/{parent=projects/*/locations/*/catalogs/*}/userEvents:import:\x01*\x12\xe7\x01\n\x10RejoinUserEvents\x12/.google.cloud.retail.v2.RejoinUserEventsRequest\x1a\x1d.google.longrunning.Operation\"\x82\x01\xca\x41\x34\n\x18RejoinUserEventsResponse\x12\x18RejoinUserEventsMetadata\x82\xd3\xe4\x93\x02\x45\"@/v2/{parent=projects/*/locations/*/catalogs/*}/userEvents:rejoin:\x01*\x1aI\xca\x41\x15retail.googleapis.com\xd2\x41.https://www.googleapis.com/auth/cloud-platformB\xc0\x01\n\x1a\x63om.google.cloud.retail.v2B\x15UserEventServiceProtoP\x01Z2cloud.google.com/go/retail/apiv2/retailpb;retailpb\xa2\x02\x06RETAIL\xaa\x02\x16Google.Cloud.Retail.V2\xca\x02\x16Google\\Cloud\\Retail\\V2\xea\x02\x19Google::Cloud::Retail::V2b\x06proto3" - -pool = ::Google::Protobuf::DescriptorPool.generated_pool -pool.add_serialized_file(descriptor_data) - -module Google - module Cloud - module Retail - module V2 - WriteUserEventRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.retail.v2.WriteUserEventRequest").msgclass - CollectUserEventRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.retail.v2.CollectUserEventRequest").msgclass - RejoinUserEventsRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.retail.v2.RejoinUserEventsRequest").msgclass - RejoinUserEventsRequest::UserEventRejoinScope = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.retail.v2.RejoinUserEventsRequest.UserEventRejoinScope").enummodule - RejoinUserEventsResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.retail.v2.RejoinUserEventsResponse").msgclass - RejoinUserEventsMetadata = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.retail.v2.RejoinUserEventsMetadata").msgclass - end - end - end -end diff --git a/owl-bot-staging/google-cloud-retail-v2/lib/google/cloud/retail/v2/user_event_service_services_pb.rb b/owl-bot-staging/google-cloud-retail-v2/lib/google/cloud/retail/v2/user_event_service_services_pb.rb deleted file mode 100644 index 65e9fe4b7c1f..000000000000 --- a/owl-bot-staging/google-cloud-retail-v2/lib/google/cloud/retail/v2/user_event_service_services_pb.rb +++ /dev/null @@ -1,75 +0,0 @@ -# Generated by the protocol buffer compiler. DO NOT EDIT! -# Source: google/cloud/retail/v2/user_event_service.proto for package 'Google.Cloud.Retail.V2' -# Original file comments: -# 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 -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. -# - -require 'grpc' -require 'google/cloud/retail/v2/user_event_service_pb' - -module Google - module Cloud - module Retail - module V2 - module UserEventService - # Service for ingesting end user actions on the customer website. - class Service - - include ::GRPC::GenericService - - self.marshal_class_method = :encode - self.unmarshal_class_method = :decode - self.service_name = 'google.cloud.retail.v2.UserEventService' - - # Writes a single user event. - rpc :WriteUserEvent, ::Google::Cloud::Retail::V2::WriteUserEventRequest, ::Google::Cloud::Retail::V2::UserEvent - # Writes a single user event from the browser. - # - # For larger user event payload over 16 KB, the POST method should be used - # instead, otherwise a 400 Bad Request error is returned. - # - # This method is used only by the Retail API JavaScript pixel and Google Tag - # Manager. Users should not call this method directly. - rpc :CollectUserEvent, ::Google::Cloud::Retail::V2::CollectUserEventRequest, ::Google::Api::HttpBody - # Deletes permanently all user events specified by the filter provided. - # Depending on the number of events specified by the filter, this operation - # could take hours or days to complete. To test a filter, use the list - # command first. - rpc :PurgeUserEvents, ::Google::Cloud::Retail::V2::PurgeUserEventsRequest, ::Google::Longrunning::Operation - # Bulk import of User events. Request processing might be - # synchronous. Events that already exist are skipped. - # Use this method for backfilling historical user events. - # - # `Operation.response` is of type `ImportResponse`. Note that it is - # possible for a subset of the items to be successfully inserted. - # `Operation.metadata` is of type `ImportMetadata`. - rpc :ImportUserEvents, ::Google::Cloud::Retail::V2::ImportUserEventsRequest, ::Google::Longrunning::Operation - # Starts a user-event rejoin operation with latest product catalog. Events - # are not annotated with detailed product information for products that are - # missing from the catalog when the user event is ingested. These - # events are stored as unjoined events with limited usage on training and - # serving. You can use this method to start a join operation on specified - # events with the latest version of product catalog. You can also use this - # method to correct events joined with the wrong product catalog. A rejoin - # operation can take hours or days to complete. - rpc :RejoinUserEvents, ::Google::Cloud::Retail::V2::RejoinUserEventsRequest, ::Google::Longrunning::Operation - end - - Stub = Service.rpc_stub_class - end - end - end - end -end diff --git a/owl-bot-staging/google-cloud-retail-v2/lib/google/cloud/retail/v2/version.rb b/owl-bot-staging/google-cloud-retail-v2/lib/google/cloud/retail/v2/version.rb deleted file mode 100644 index ea00c998505d..000000000000 --- a/owl-bot-staging/google-cloud-retail-v2/lib/google/cloud/retail/v2/version.rb +++ /dev/null @@ -1,28 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - - -module Google - module Cloud - module Retail - module V2 - VERSION = "0.0.1" - end - end - end -end diff --git a/owl-bot-staging/google-cloud-retail-v2/proto_docs/README.md b/owl-bot-staging/google-cloud-retail-v2/proto_docs/README.md deleted file mode 100644 index 339fa1264598..000000000000 --- a/owl-bot-staging/google-cloud-retail-v2/proto_docs/README.md +++ /dev/null @@ -1,4 +0,0 @@ -# Retail V2 Protocol Buffer Documentation - -These files are for the YARD documentation of the generated protobuf files. -They are not intended to be required or loaded at runtime. diff --git a/owl-bot-staging/google-cloud-retail-v2/proto_docs/google/api/client.rb b/owl-bot-staging/google-cloud-retail-v2/proto_docs/google/api/client.rb deleted file mode 100644 index 5089551e9ea4..000000000000 --- a/owl-bot-staging/google-cloud-retail-v2/proto_docs/google/api/client.rb +++ /dev/null @@ -1,589 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - - -module Google - module Api - # Required information for every language. - # @!attribute [rw] reference_docs_uri - # @deprecated This field is deprecated and may be removed in the next major version update. - # @return [::String] - # Link to automatically generated reference documentation. Example: - # https://cloud.google.com/nodejs/docs/reference/asset/latest - # @!attribute [rw] destinations - # @return [::Array<::Google::Api::ClientLibraryDestination>] - # The destination where API teams want this client library to be published. - # @!attribute [rw] selective_gapic_generation - # @return [::Google::Api::SelectiveGapicGeneration] - # Configuration for which RPCs should be generated in the GAPIC client. - class CommonLanguageSettings - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Details about how and where to publish client libraries. - # @!attribute [rw] version - # @return [::String] - # Version of the API to apply these settings to. This is the full protobuf - # package for the API, ending in the version element. - # Examples: "google.cloud.speech.v1" and "google.spanner.admin.database.v1". - # @!attribute [rw] launch_stage - # @return [::Google::Api::LaunchStage] - # Launch stage of this version of the API. - # @!attribute [rw] rest_numeric_enums - # @return [::Boolean] - # When using transport=rest, the client request will encode enums as - # numbers rather than strings. - # @!attribute [rw] java_settings - # @return [::Google::Api::JavaSettings] - # Settings for legacy Java features, supported in the Service YAML. - # @!attribute [rw] cpp_settings - # @return [::Google::Api::CppSettings] - # Settings for C++ client libraries. - # @!attribute [rw] php_settings - # @return [::Google::Api::PhpSettings] - # Settings for PHP client libraries. - # @!attribute [rw] python_settings - # @return [::Google::Api::PythonSettings] - # Settings for Python client libraries. - # @!attribute [rw] node_settings - # @return [::Google::Api::NodeSettings] - # Settings for Node client libraries. - # @!attribute [rw] dotnet_settings - # @return [::Google::Api::DotnetSettings] - # Settings for .NET client libraries. - # @!attribute [rw] ruby_settings - # @return [::Google::Api::RubySettings] - # Settings for Ruby client libraries. - # @!attribute [rw] go_settings - # @return [::Google::Api::GoSettings] - # Settings for Go client libraries. - class ClientLibrarySettings - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # This message configures the settings for publishing [Google Cloud Client - # libraries](https://cloud.google.com/apis/docs/cloud-client-libraries) - # generated from the service config. - # @!attribute [rw] method_settings - # @return [::Array<::Google::Api::MethodSettings>] - # A list of API method settings, e.g. the behavior for methods that use the - # long-running operation pattern. - # @!attribute [rw] new_issue_uri - # @return [::String] - # Link to a *public* URI where users can report issues. Example: - # https://issuetracker.google.com/issues/new?component=190865&template=1161103 - # @!attribute [rw] documentation_uri - # @return [::String] - # Link to product home page. Example: - # https://cloud.google.com/asset-inventory/docs/overview - # @!attribute [rw] api_short_name - # @return [::String] - # Used as a tracking tag when collecting data about the APIs developer - # relations artifacts like docs, packages delivered to package managers, - # etc. Example: "speech". - # @!attribute [rw] github_label - # @return [::String] - # GitHub label to apply to issues and pull requests opened for this API. - # @!attribute [rw] codeowner_github_teams - # @return [::Array<::String>] - # GitHub teams to be added to CODEOWNERS in the directory in GitHub - # containing source code for the client libraries for this API. - # @!attribute [rw] doc_tag_prefix - # @return [::String] - # A prefix used in sample code when demarking regions to be included in - # documentation. - # @!attribute [rw] organization - # @return [::Google::Api::ClientLibraryOrganization] - # For whom the client library is being published. - # @!attribute [rw] library_settings - # @return [::Array<::Google::Api::ClientLibrarySettings>] - # Client library settings. If the same version string appears multiple - # times in this list, then the last one wins. Settings from earlier - # settings with the same version string are discarded. - # @!attribute [rw] proto_reference_documentation_uri - # @return [::String] - # Optional link to proto reference documentation. Example: - # https://cloud.google.com/pubsub/lite/docs/reference/rpc - # @!attribute [rw] rest_reference_documentation_uri - # @return [::String] - # Optional link to REST reference documentation. Example: - # https://cloud.google.com/pubsub/lite/docs/reference/rest - class Publishing - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Settings for Java client libraries. - # @!attribute [rw] library_package - # @return [::String] - # The package name to use in Java. Clobbers the java_package option - # set in the protobuf. This should be used **only** by APIs - # who have already set the language_settings.java.package_name" field - # in gapic.yaml. API teams should use the protobuf java_package option - # where possible. - # - # Example of a YAML configuration:: - # - # publishing: - # 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. - # @!attribute [rw] methods - # @return [::Array<::String>] - # An allowlist of the fully qualified names of RPCs that should be included - # on public client surfaces. - # @!attribute [rw] generate_omitted_as_internal - # @return [::Boolean] - # Setting this to true indicates to the client generators that methods - # that would be excluded from the generation should instead be generated - # in a way that indicates these methods should not be consumed by - # end users. How this is expressed is up to individual language - # implementations to decide. Some examples may be: added annotations, - # obfuscated identifiers, or other language idiomatic patterns. - class SelectiveGapicGeneration - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # `BatchingConfigProto` defines the batching configuration for an API method. - # @!attribute [rw] thresholds - # @return [::Google::Api::BatchingSettingsProto] - # The thresholds which trigger a batched request to be sent. - # @!attribute [rw] batch_descriptor - # @return [::Google::Api::BatchingDescriptorProto] - # The request and response fields used in batching. - class BatchingConfigProto - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # `BatchingSettingsProto` specifies a set of batching thresholds, each of - # which acts as a trigger to send a batch of messages as a request. At least - # one threshold must be positive nonzero. - # @!attribute [rw] element_count_threshold - # @return [::Integer] - # The number of elements of a field collected into a batch which, if - # exceeded, causes the batch to be sent. - # @!attribute [rw] request_byte_threshold - # @return [::Integer] - # The aggregated size of the batched field which, if exceeded, causes the - # batch to be sent. This size is computed by aggregating the sizes of the - # request field to be batched, not of the entire request message. - # @!attribute [rw] delay_threshold - # @return [::Google::Protobuf::Duration] - # The duration after which a batch should be sent, starting from the addition - # of the first message to that batch. - # @!attribute [rw] element_count_limit - # @return [::Integer] - # The maximum number of elements collected in a batch that could be accepted - # by server. - # @!attribute [rw] request_byte_limit - # @return [::Integer] - # The maximum size of the request that could be accepted by server. - # @!attribute [rw] flow_control_element_limit - # @return [::Integer] - # The maximum number of elements allowed by flow control. - # @!attribute [rw] flow_control_byte_limit - # @return [::Integer] - # The maximum size of data allowed by flow control. - # @!attribute [rw] flow_control_limit_exceeded_behavior - # @return [::Google::Api::FlowControlLimitExceededBehaviorProto] - # The behavior to take when the flow control limit is exceeded. - class BatchingSettingsProto - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # `BatchingDescriptorProto` specifies the fields of the request message to be - # used for batching, and, optionally, the fields of the response message to be - # used for demultiplexing. - # @!attribute [rw] batched_field - # @return [::String] - # The repeated field in the request message to be aggregated by batching. - # @!attribute [rw] discriminator_fields - # @return [::Array<::String>] - # A list of the fields in the request message. Two requests will be batched - # together only if the values of every field specified in - # `request_discriminator_fields` is equal between the two requests. - # @!attribute [rw] subresponse_field - # @return [::String] - # Optional. When present, indicates the field in the response message to be - # used to demultiplex the response into multiple response messages, in - # correspondence with the multiple request messages originally batched - # together. - class BatchingDescriptorProto - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # The organization for which the client libraries are being published. - # Affects the url where generated docs are published, etc. - module ClientLibraryOrganization - # Not useful. - CLIENT_LIBRARY_ORGANIZATION_UNSPECIFIED = 0 - - # Google Cloud Platform Org. - CLOUD = 1 - - # Ads (Advertising) Org. - ADS = 2 - - # Photos Org. - PHOTOS = 3 - - # Street View Org. - STREET_VIEW = 4 - - # Shopping Org. - SHOPPING = 5 - - # Geo Org. - GEO = 6 - - # Generative AI - https://developers.generativeai.google - GENERATIVE_AI = 7 - end - - # To where should client libraries be published? - module ClientLibraryDestination - # Client libraries will neither be generated nor published to package - # managers. - CLIENT_LIBRARY_DESTINATION_UNSPECIFIED = 0 - - # Generate the client library in a repo under github.com/googleapis, - # but don't publish it to package managers. - GITHUB = 10 - - # Publish the library to package managers like nuget.org and npmjs.com. - PACKAGE_MANAGER = 20 - end - - # The behavior to take when the flow control limit is exceeded. - module FlowControlLimitExceededBehaviorProto - # Default behavior, system-defined. - UNSET_BEHAVIOR = 0 - - # Stop operation, raise error. - THROW_EXCEPTION = 1 - - # Pause operation until limit clears. - BLOCK = 2 - - # Continue operation, disregard limit. - IGNORE = 3 - end - end -end diff --git a/owl-bot-staging/google-cloud-retail-v2/proto_docs/google/api/field_behavior.rb b/owl-bot-staging/google-cloud-retail-v2/proto_docs/google/api/field_behavior.rb deleted file mode 100644 index 582be187d115..000000000000 --- a/owl-bot-staging/google-cloud-retail-v2/proto_docs/google/api/field_behavior.rb +++ /dev/null @@ -1,85 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - - -module Google - module Api - # An indicator of the behavior of a given field (for example, that a field - # is required in requests, or given as output but ignored as input). - # This **does not** change the behavior in protocol buffers itself; it only - # denotes the behavior and may affect how API tooling handles the field. - # - # Note: This enum **may** receive new values in the future. - module FieldBehavior - # Conventional default for enums. Do not use this. - FIELD_BEHAVIOR_UNSPECIFIED = 0 - - # Specifically denotes a field as optional. - # While all fields in protocol buffers are optional, this may be specified - # for emphasis if appropriate. - OPTIONAL = 1 - - # Denotes a field as required. - # This indicates that the field **must** be provided as part of the request, - # and failure to do so will cause an error (usually `INVALID_ARGUMENT`). - REQUIRED = 2 - - # Denotes a field as output only. - # This indicates that the field is provided in responses, but including the - # field in a request does nothing (the server *must* ignore it and - # *must not* throw an error as a result of the field's presence). - OUTPUT_ONLY = 3 - - # Denotes a field as input only. - # This indicates that the field is provided in requests, and the - # corresponding field is not included in output. - INPUT_ONLY = 4 - - # Denotes a field as immutable. - # This indicates that the field may be set once in a request to create a - # resource, but may not be changed thereafter. - IMMUTABLE = 5 - - # Denotes that a (repeated) field is an unordered list. - # This indicates that the service may provide the elements of the list - # in any arbitrary order, rather than the order the user originally - # provided. Additionally, the list's order may or may not be stable. - UNORDERED_LIST = 6 - - # Denotes that this field returns a non-empty default value if not set. - # This indicates that if the user provides the empty value in a request, - # a non-empty value will be returned. The user will not be aware of what - # non-empty value to expect. - NON_EMPTY_DEFAULT = 7 - - # Denotes that the field in a resource (a message annotated with - # google.api.resource) is used in the resource name to uniquely identify the - # resource. For AIP-compliant APIs, this should only be applied to the - # `name` field on the resource. - # - # This behavior should not be applied to references to other resources within - # the message. - # - # The identifier field of resources often have different field behavior - # depending on the request it is embedded in (e.g. for Create methods name - # is optional and unused, while for Update methods it is required). Instead - # of method-specific annotations, only `IDENTIFIER` is required. - IDENTIFIER = 8 - end - end -end diff --git a/owl-bot-staging/google-cloud-retail-v2/proto_docs/google/api/httpbody.rb b/owl-bot-staging/google-cloud-retail-v2/proto_docs/google/api/httpbody.rb deleted file mode 100644 index 938f7ac6b2fd..000000000000 --- a/owl-bot-staging/google-cloud-retail-v2/proto_docs/google/api/httpbody.rb +++ /dev/null @@ -1,80 +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 - # Message that represents an arbitrary HTTP body. It should only be used for - # payload formats that can't be represented as JSON, such as raw binary or - # an HTML page. - # - # - # This message can be used both in streaming and non-streaming API methods in - # the request as well as the response. - # - # It can be used as a top-level request field, which is convenient if one - # wants to extract parameters from either the URL or HTTP template into the - # request fields and also want access to the raw HTTP body. - # - # Example: - # - # message GetResourceRequest { - # // A unique request id. - # string request_id = 1; - # - # // The raw HTTP body is bound to this field. - # google.api.HttpBody http_body = 2; - # - # } - # - # service ResourceService { - # rpc GetResource(GetResourceRequest) - # returns (google.api.HttpBody); - # rpc UpdateResource(google.api.HttpBody) - # returns (google.protobuf.Empty); - # - # } - # - # Example with streaming methods: - # - # service CaldavService { - # rpc GetCalendar(stream google.api.HttpBody) - # returns (stream google.api.HttpBody); - # rpc UpdateCalendar(stream google.api.HttpBody) - # returns (stream google.api.HttpBody); - # - # } - # - # Use of this type only changes how the request and response bodies are - # handled, all other features will continue to work unchanged. - # @!attribute [rw] content_type - # @return [::String] - # The HTTP Content-Type header value specifying the content type of the body. - # @!attribute [rw] data - # @return [::String] - # The HTTP request/response body as raw binary. - # @!attribute [rw] extensions - # @return [::Array<::Google::Protobuf::Any>] - # Application specific response metadata. Must be set in the first response - # for streaming APIs. - class HttpBody - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - end -end diff --git a/owl-bot-staging/google-cloud-retail-v2/proto_docs/google/api/launch_stage.rb b/owl-bot-staging/google-cloud-retail-v2/proto_docs/google/api/launch_stage.rb deleted file mode 100644 index 9392a413fb1b..000000000000 --- a/owl-bot-staging/google-cloud-retail-v2/proto_docs/google/api/launch_stage.rb +++ /dev/null @@ -1,71 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - - -module Google - module Api - # The launch stage as defined by [Google Cloud Platform - # Launch Stages](https://cloud.google.com/terms/launch-stages). - module LaunchStage - # Do not use this default value. - LAUNCH_STAGE_UNSPECIFIED = 0 - - # The feature is not yet implemented. Users can not use it. - UNIMPLEMENTED = 6 - - # Prelaunch features are hidden from users and are only visible internally. - PRELAUNCH = 7 - - # Early Access features are limited to a closed group of testers. To use - # these features, you must sign up in advance and sign a Trusted Tester - # agreement (which includes confidentiality provisions). These features may - # be unstable, changed in backward-incompatible ways, and are not - # guaranteed to be released. - EARLY_ACCESS = 1 - - # Alpha is a limited availability test for releases before they are cleared - # for widespread use. By Alpha, all significant design issues are resolved - # and we are in the process of verifying functionality. Alpha customers - # need to apply for access, agree to applicable terms, and have their - # projects allowlisted. Alpha releases don't have to be feature complete, - # no SLAs are provided, and there are no technical support obligations, but - # they will be far enough along that customers can actually use them in - # test environments or for limited-use tests -- just like they would in - # normal production cases. - ALPHA = 2 - - # Beta is the point at which we are ready to open a release for any - # customer to use. There are no SLA or technical support obligations in a - # Beta release. Products will be complete from a feature perspective, but - # may have some open outstanding issues. Beta releases are suitable for - # limited production use cases. - BETA = 3 - - # GA features are open to all developers and are considered stable and - # fully qualified for production use. - GA = 4 - - # Deprecated features are scheduled to be shut down and removed. For more - # information, see the "Deprecation Policy" section of our [Terms of - # Service](https://cloud.google.com/terms/) - # and the [Google Cloud Platform Subject to the Deprecation - # Policy](https://cloud.google.com/terms/deprecation) documentation. - DEPRECATED = 5 - end - end -end diff --git a/owl-bot-staging/google-cloud-retail-v2/proto_docs/google/api/resource.rb b/owl-bot-staging/google-cloud-retail-v2/proto_docs/google/api/resource.rb deleted file mode 100644 index 25dec4847ac1..000000000000 --- a/owl-bot-staging/google-cloud-retail-v2/proto_docs/google/api/resource.rb +++ /dev/null @@ -1,227 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - - -module Google - module Api - # A simple descriptor of a resource type. - # - # ResourceDescriptor annotates a resource message (either by means of a - # protobuf annotation or use in the service config), and associates the - # resource's schema, the resource type, and the pattern of the resource name. - # - # Example: - # - # message Topic { - # // Indicates this message defines a resource schema. - # // Declares the resource type in the format of {service}/{kind}. - # // For Kubernetes resources, the format is {api group}/{kind}. - # option (google.api.resource) = { - # type: "pubsub.googleapis.com/Topic" - # pattern: "projects/{project}/topics/{topic}" - # }; - # } - # - # The ResourceDescriptor Yaml config will look like: - # - # resources: - # - type: "pubsub.googleapis.com/Topic" - # pattern: "projects/{project}/topics/{topic}" - # - # Sometimes, resources have multiple patterns, typically because they can - # live under multiple parents. - # - # Example: - # - # message LogEntry { - # option (google.api.resource) = { - # type: "logging.googleapis.com/LogEntry" - # pattern: "projects/{project}/logs/{log}" - # pattern: "folders/{folder}/logs/{log}" - # pattern: "organizations/{organization}/logs/{log}" - # pattern: "billingAccounts/{billing_account}/logs/{log}" - # }; - # } - # - # The ResourceDescriptor Yaml config will look like: - # - # resources: - # - type: 'logging.googleapis.com/LogEntry' - # pattern: "projects/{project}/logs/{log}" - # pattern: "folders/{folder}/logs/{log}" - # pattern: "organizations/{organization}/logs/{log}" - # pattern: "billingAccounts/{billing_account}/logs/{log}" - # @!attribute [rw] type - # @return [::String] - # The resource type. It must be in the format of - # \\{service_name}/\\{resource_type_kind}. The `resource_type_kind` must be - # singular and must not include version numbers. - # - # Example: `storage.googleapis.com/Bucket` - # - # The value of the resource_type_kind must follow the regular expression - # /[A-Za-z][a-zA-Z0-9]+/. It should start with an upper case character and - # should use PascalCase (UpperCamelCase). The maximum number of - # characters allowed for the `resource_type_kind` is 100. - # @!attribute [rw] pattern - # @return [::Array<::String>] - # Optional. The relative resource name pattern associated with this resource - # type. The DNS prefix of the full resource name shouldn't be specified here. - # - # The path pattern must follow the syntax, which aligns with HTTP binding - # syntax: - # - # Template = Segment { "/" Segment } ; - # Segment = LITERAL | Variable ; - # Variable = "{" LITERAL "}" ; - # - # Examples: - # - # - "projects/\\{project}/topics/\\{topic}" - # - "projects/\\{project}/knowledgeBases/\\{knowledge_base}" - # - # The components in braces correspond to the IDs for each resource in the - # hierarchy. It is expected that, if multiple patterns are provided, - # the same component name (e.g. "project") refers to IDs of the same - # type of resource. - # @!attribute [rw] name_field - # @return [::String] - # Optional. The field on the resource that designates the resource name - # field. If omitted, this is assumed to be "name". - # @!attribute [rw] history - # @return [::Google::Api::ResourceDescriptor::History] - # Optional. The historical or future-looking state of the resource pattern. - # - # Example: - # - # // The InspectTemplate message originally only supported resource - # // names with organization, and project was added later. - # message InspectTemplate { - # option (google.api.resource) = { - # type: "dlp.googleapis.com/InspectTemplate" - # pattern: - # "organizations/{organization}/inspectTemplates/{inspect_template}" - # pattern: "projects/{project}/inspectTemplates/{inspect_template}" - # history: ORIGINALLY_SINGLE_PATTERN - # }; - # } - # @!attribute [rw] plural - # @return [::String] - # The plural name used in the resource name and permission names, such as - # 'projects' for the resource name of 'projects/\\{project}' and the permission - # name of 'cloudresourcemanager.googleapis.com/projects.get'. One exception - # to this is for Nested Collections that have stuttering names, as defined - # in [AIP-122](https://google.aip.dev/122#nested-collections), where the - # collection ID in the resource name pattern does not necessarily directly - # match the `plural` value. - # - # It is the same concept of the `plural` field in k8s CRD spec - # https://kubernetes.io/docs/tasks/access-kubernetes-api/custom-resources/custom-resource-definitions/ - # - # Note: The plural form is required even for singleton resources. See - # https://aip.dev/156 - # @!attribute [rw] singular - # @return [::String] - # The same concept of the `singular` field in k8s CRD spec - # https://kubernetes.io/docs/tasks/access-kubernetes-api/custom-resources/custom-resource-definitions/ - # Such as "project" for the `resourcemanager.googleapis.com/Project` type. - # @!attribute [rw] style - # @return [::Array<::Google::Api::ResourceDescriptor::Style>] - # Style flag(s) for this resource. - # These indicate that a resource is expected to conform to a given - # style. See the specific style flags for additional information. - class ResourceDescriptor - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - - # A description of the historical or future-looking state of the - # resource pattern. - module History - # The "unset" value. - HISTORY_UNSPECIFIED = 0 - - # The resource originally had one pattern and launched as such, and - # additional patterns were added later. - ORIGINALLY_SINGLE_PATTERN = 1 - - # The resource has one pattern, but the API owner expects to add more - # later. (This is the inverse of ORIGINALLY_SINGLE_PATTERN, and prevents - # that from being necessary once there are multiple patterns.) - FUTURE_MULTI_PATTERN = 2 - end - - # A flag representing a specific style that a resource claims to conform to. - module Style - # The unspecified value. Do not use. - STYLE_UNSPECIFIED = 0 - - # This resource is intended to be "declarative-friendly". - # - # Declarative-friendly resources must be more strictly consistent, and - # setting this to true communicates to tools that this resource should - # adhere to declarative-friendly expectations. - # - # Note: This is used by the API linter (linter.aip.dev) to enable - # additional checks. - DECLARATIVE_FRIENDLY = 1 - end - end - - # Defines a proto annotation that describes a string field that refers to - # an API resource. - # @!attribute [rw] type - # @return [::String] - # The resource type that the annotated field references. - # - # Example: - # - # message Subscription { - # string topic = 2 [(google.api.resource_reference) = { - # type: "pubsub.googleapis.com/Topic" - # }]; - # } - # - # Occasionally, a field may reference an arbitrary resource. In this case, - # APIs use the special value * in their resource reference. - # - # Example: - # - # message GetIamPolicyRequest { - # string resource = 2 [(google.api.resource_reference) = { - # type: "*" - # }]; - # } - # @!attribute [rw] child_type - # @return [::String] - # The resource type of a child collection that the annotated field - # references. This is useful for annotating the `parent` field that - # doesn't have a fixed resource type. - # - # Example: - # - # message ListLogEntriesRequest { - # string parent = 1 [(google.api.resource_reference) = { - # child_type: "logging.googleapis.com/LogEntry" - # }; - # } - class ResourceReference - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - end -end diff --git a/owl-bot-staging/google-cloud-retail-v2/proto_docs/google/cloud/retail/v2/catalog.rb b/owl-bot-staging/google-cloud-retail-v2/proto_docs/google/cloud/retail/v2/catalog.rb deleted file mode 100644 index 40edde6ddced..000000000000 --- a/owl-bot-staging/google-cloud-retail-v2/proto_docs/google/cloud/retail/v2/catalog.rb +++ /dev/null @@ -1,516 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - - -module Google - module Cloud - module Retail - module V2 - # Configures what level the product should be uploaded with regards to - # how users will be send events and how predictions will be made. - # @!attribute [rw] ingestion_product_type - # @return [::String] - # The type of {::Google::Cloud::Retail::V2::Product Product}s allowed to be - # ingested into the catalog. Acceptable values are: - # - # * `primary` (default): You can ingest - # {::Google::Cloud::Retail::V2::Product Product}s of all types. When - # ingesting a {::Google::Cloud::Retail::V2::Product Product}, its type will - # default to - # {::Google::Cloud::Retail::V2::Product::Type::PRIMARY Product.Type.PRIMARY} if - # unset. - # * `variant` (incompatible with Retail Search): You can only - # ingest - # {::Google::Cloud::Retail::V2::Product::Type::VARIANT Product.Type.VARIANT} - # {::Google::Cloud::Retail::V2::Product Product}s. This means - # {::Google::Cloud::Retail::V2::Product#primary_product_id Product.primary_product_id} - # cannot be empty. - # - # If this field is set to an invalid value other than these, an - # INVALID_ARGUMENT error is returned. - # - # If this field is `variant` and - # {::Google::Cloud::Retail::V2::ProductLevelConfig#merchant_center_product_id_field merchant_center_product_id_field} - # is `itemGroupId`, an INVALID_ARGUMENT error is returned. - # - # See [Product - # levels](https://cloud.google.com/retail/docs/catalog#product-levels) - # for more details. - # @!attribute [rw] merchant_center_product_id_field - # @return [::String] - # Which field of [Merchant Center - # Product](/bigquery-transfer/docs/merchant-center-products-schema) should be - # imported as {::Google::Cloud::Retail::V2::Product#id Product.id}. Acceptable - # values are: - # - # * `offerId` (default): Import `offerId` as the product ID. - # * `itemGroupId`: Import `itemGroupId` as the product ID. Notice that Retail - # API will choose one item from the ones with the same `itemGroupId`, and - # use it to represent the item group. - # - # If this field is set to an invalid value other than these, an - # INVALID_ARGUMENT error is returned. - # - # If this field is `itemGroupId` and - # {::Google::Cloud::Retail::V2::ProductLevelConfig#ingestion_product_type ingestion_product_type} - # is `variant`, an INVALID_ARGUMENT error is returned. - # - # See [Product - # levels](https://cloud.google.com/retail/docs/catalog#product-levels) - # for more details. - class ProductLevelConfig - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Catalog level attribute config for an attribute. For example, if customers - # want to enable/disable facet for a specific attribute. - # @!attribute [rw] key - # @return [::String] - # Required. Attribute name. - # For example: `color`, `brands`, `attributes.custom_attribute`, such as - # `attributes.xyz`. - # To be indexable, the attribute name can contain only alpha-numeric - # characters and underscores. For example, an attribute named - # `attributes.abc_xyz` can be indexed, but an attribute named - # `attributes.abc-xyz` cannot be indexed. - # - # If the attribute key starts with `attributes.`, then the attribute is a - # custom attribute. Attributes such as `brands`, `patterns`, and `title` are - # built-in and called system attributes. - # @!attribute [r] in_use - # @return [::Boolean] - # Output only. Indicates whether this attribute has been used by any - # products. `True` if at least one {::Google::Cloud::Retail::V2::Product Product} - # is using this attribute in - # {::Google::Cloud::Retail::V2::Product#attributes Product.attributes}. Otherwise, - # this field is `False`. - # - # {::Google::Cloud::Retail::V2::CatalogAttribute CatalogAttribute} can be - # pre-loaded by using - # {::Google::Cloud::Retail::V2::CatalogService::Client#add_catalog_attribute CatalogService.AddCatalogAttribute} - # or - # {::Google::Cloud::Retail::V2::CatalogService::Client#update_attributes_config CatalogService.UpdateAttributesConfig} - # APIs. This field is `False` for pre-loaded - # {::Google::Cloud::Retail::V2::CatalogAttribute CatalogAttribute}s. - # - # Only pre-loaded [catalog - # attributes][google.cloud.retail.v2.CatalogAttribute] that are neither in - # use by products nor predefined can be deleted. [Catalog - # attributes][google.cloud.retail.v2.CatalogAttribute] that are - # either in use by products or are predefined attributes cannot be deleted; - # however, their configuration properties will reset to default values upon - # removal request. - # - # After catalog changes, it takes about 10 minutes for this field to update. - # @!attribute [r] type - # @return [::Google::Cloud::Retail::V2::CatalogAttribute::AttributeType] - # Output only. The type of this attribute. This is derived from the attribute - # in {::Google::Cloud::Retail::V2::Product#attributes Product.attributes}. - # @!attribute [rw] indexable_option - # @return [::Google::Cloud::Retail::V2::CatalogAttribute::IndexableOption] - # When - # {::Google::Cloud::Retail::V2::AttributesConfig#attribute_config_level AttributesConfig.attribute_config_level} - # is CATALOG_LEVEL_ATTRIBUTE_CONFIG, if INDEXABLE_ENABLED attribute values - # are indexed so that it can be filtered, faceted, or boosted in - # {::Google::Cloud::Retail::V2::SearchService::Client#search SearchService.Search}. - # - # Must be specified when - # {::Google::Cloud::Retail::V2::AttributesConfig#attribute_config_level AttributesConfig.attribute_config_level} - # is CATALOG_LEVEL_ATTRIBUTE_CONFIG, otherwise throws INVALID_FORMAT error. - # @!attribute [rw] dynamic_facetable_option - # @return [::Google::Cloud::Retail::V2::CatalogAttribute::DynamicFacetableOption] - # If DYNAMIC_FACETABLE_ENABLED, attribute values are available for dynamic - # facet. Could only be DYNAMIC_FACETABLE_DISABLED if - # {::Google::Cloud::Retail::V2::CatalogAttribute#indexable_option CatalogAttribute.indexable_option} - # is INDEXABLE_DISABLED. Otherwise, an INVALID_ARGUMENT error is returned. - # - # Must be specified, otherwise throws INVALID_FORMAT error. - # @!attribute [rw] searchable_option - # @return [::Google::Cloud::Retail::V2::CatalogAttribute::SearchableOption] - # When - # {::Google::Cloud::Retail::V2::AttributesConfig#attribute_config_level AttributesConfig.attribute_config_level} - # is CATALOG_LEVEL_ATTRIBUTE_CONFIG, if SEARCHABLE_ENABLED, attribute values - # are searchable by text queries in - # {::Google::Cloud::Retail::V2::SearchService::Client#search SearchService.Search}. - # - # If SEARCHABLE_ENABLED but attribute type is numerical, attribute values - # will not be searchable by text queries in - # {::Google::Cloud::Retail::V2::SearchService::Client#search SearchService.Search}, as - # there are no text values associated to numerical attributes. - # - # Must be specified, when - # {::Google::Cloud::Retail::V2::AttributesConfig#attribute_config_level AttributesConfig.attribute_config_level} - # is CATALOG_LEVEL_ATTRIBUTE_CONFIG, otherwise throws INVALID_FORMAT error. - # @!attribute [rw] exact_searchable_option - # @return [::Google::Cloud::Retail::V2::CatalogAttribute::ExactSearchableOption] - # If EXACT_SEARCHABLE_ENABLED, attribute values will be exact searchable. - # This property only applies to textual custom attributes and requires - # indexable set to enabled to enable exact-searchable. If unset, the server - # behavior defaults to - # {::Google::Cloud::Retail::V2::CatalogAttribute::ExactSearchableOption::EXACT_SEARCHABLE_DISABLED EXACT_SEARCHABLE_DISABLED}. - # @!attribute [rw] retrievable_option - # @return [::Google::Cloud::Retail::V2::CatalogAttribute::RetrievableOption] - # If RETRIEVABLE_ENABLED, attribute values are retrievable in the search - # results. If unset, the server behavior defaults to - # {::Google::Cloud::Retail::V2::CatalogAttribute::RetrievableOption::RETRIEVABLE_DISABLED RETRIEVABLE_DISABLED}. - # @!attribute [rw] facet_config - # @return [::Google::Cloud::Retail::V2::CatalogAttribute::FacetConfig] - # Contains facet options. - class CatalogAttribute - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - - # Possible options for the facet that corresponds to the current attribute - # config. - # @!attribute [rw] facet_intervals - # @return [::Array<::Google::Cloud::Retail::V2::Interval>] - # If you don't set the facet - # {::Google::Cloud::Retail::V2::SearchRequest::FacetSpec::FacetKey#intervals SearchRequest.FacetSpec.FacetKey.intervals} - # in the request to a numerical attribute, then we use the computed - # intervals with rounded bounds obtained from all its product numerical - # attribute values. The computed intervals might not be ideal for some - # attributes. Therefore, we give you the option to overwrite them with the - # facet_intervals field. The maximum of facet intervals per - # {::Google::Cloud::Retail::V2::CatalogAttribute CatalogAttribute} is 40. Each - # interval must have a lower bound or an upper bound. If both bounds are - # provided, then the lower bound must be smaller or equal than the upper - # bound. - # @!attribute [rw] ignored_facet_values - # @return [::Array<::Google::Cloud::Retail::V2::CatalogAttribute::FacetConfig::IgnoredFacetValues>] - # Each instance represents a list of attribute values to ignore as facet - # values for a specific time range. The maximum number of instances per - # {::Google::Cloud::Retail::V2::CatalogAttribute CatalogAttribute} is 25. - # @!attribute [rw] merged_facet_values - # @return [::Array<::Google::Cloud::Retail::V2::CatalogAttribute::FacetConfig::MergedFacetValue>] - # Each instance replaces a list of facet values by a merged facet - # value. If a facet value is not in any list, then it will stay the same. - # To avoid conflicts, only paths of length 1 are accepted. In other words, - # if "dark_blue" merged into "BLUE", then the latter can't merge into - # "blues" because this would create a path of length 2. The maximum number - # of instances of MergedFacetValue per - # {::Google::Cloud::Retail::V2::CatalogAttribute CatalogAttribute} is 100. This - # feature is available only for textual custom attributes. - # @!attribute [rw] merged_facet - # @return [::Google::Cloud::Retail::V2::CatalogAttribute::FacetConfig::MergedFacet] - # Use this field only if you want to merge a facet key into another facet - # key. - # @!attribute [rw] rerank_config - # @return [::Google::Cloud::Retail::V2::CatalogAttribute::FacetConfig::RerankConfig] - # Set this field only if you want to rerank based on facet values engaged - # by the user for the current key. This option is only possible for custom - # facetable textual keys. - class FacetConfig - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - - # {::Google::Cloud::Retail::V2::SearchResponse::Facet#values Facet values} to - # ignore on {::Google::Cloud::Retail::V2::SearchResponse::Facet facets} during - # the specified time range for the given - # {::Google::Cloud::Retail::V2::SearchResponse::Facet#key SearchResponse.Facet.key} - # attribute. - # @!attribute [rw] values - # @return [::Array<::String>] - # List of facet values to ignore for the following time range. The facet - # values are the same as the attribute values. There is a limit of 10 - # values per instance of IgnoredFacetValues. Each value can have at most - # 128 characters. - # @!attribute [rw] start_time - # @return [::Google::Protobuf::Timestamp] - # Time range for the current list of facet values to ignore. - # If multiple time ranges are specified for an facet value for the - # current attribute, consider all of them. If both are empty, ignore - # always. If start time and end time are set, then start time - # must be before end time. - # If start time is not empty and end time is empty, then will ignore - # these facet values after the start time. - # @!attribute [rw] end_time - # @return [::Google::Protobuf::Timestamp] - # If start time is empty and end time is not empty, then ignore these - # facet values before end time. - class IgnoredFacetValues - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Replaces a set of textual facet values by the same (possibly different) - # merged facet value. Each facet value should appear at most once as a - # value per {::Google::Cloud::Retail::V2::CatalogAttribute CatalogAttribute}. - # This feature is available only for textual custom attributes. - # @!attribute [rw] values - # @return [::Array<::String>] - # All the facet values that are replaces by the same - # {::Google::Cloud::Retail::V2::CatalogAttribute::FacetConfig::MergedFacetValue#merged_value merged_value} - # that follows. The maximum number of values per MergedFacetValue is 25. - # Each value can have up to 128 characters. - # @!attribute [rw] merged_value - # @return [::String] - # All the previous values are replaced by this merged facet value. - # This merged_value must be non-empty and can have up to 128 characters. - class MergedFacetValue - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # The current facet key (i.e. attribute config) maps into the - # {::Google::Cloud::Retail::V2::CatalogAttribute::FacetConfig::MergedFacet#merged_facet_key merged_facet_key}. - # A facet key can have at most one child. The current facet key and the - # merged facet key need both to be textual custom attributes or both - # numerical custom attributes (same type). - # @!attribute [rw] merged_facet_key - # @return [::String] - # The merged facet key should be a valid facet key that is different than - # the facet key of the current catalog attribute. We refer this is - # merged facet key as the child of the current catalog attribute. This - # merged facet key can't be a parent of another facet key (i.e. no - # directed path of length 2). This merged facet key needs to be either a - # textual custom attribute or a numerical custom attribute. - class MergedFacet - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Options to rerank based on facet values engaged by the user for the - # current key. That key needs to be a custom textual key and facetable. - # To use this control, you also need to pass all the facet keys engaged by - # the user in the request using the field [SearchRequest.FacetSpec]. In - # particular, if you don't pass the facet keys engaged that you want to - # rerank on, this control won't be effective. Moreover, to obtain better - # results, the facet values that you want to rerank on should be close to - # English (ideally made of words, underscores, and spaces). - # @!attribute [rw] rerank_facet - # @return [::Boolean] - # If set to true, then we also rerank the dynamic facets based on the - # facet values engaged by the user for the current attribute key during - # serving. - # @!attribute [rw] facet_values - # @return [::Array<::String>] - # If empty, rerank on all facet values for the current key. Otherwise, - # will rerank on the facet values from this list only. - class RerankConfig - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - end - - # The type of an attribute. - module AttributeType - # The type of the attribute is unknown. - # - # Used when type cannot be derived from attribute that is not - # {::Google::Cloud::Retail::V2::CatalogAttribute#in_use in_use}. - UNKNOWN = 0 - - # Textual attribute. - TEXTUAL = 1 - - # Numerical attribute. - NUMERICAL = 2 - end - - # The status of the indexable option of a catalog attribute. - module IndexableOption - # Value used when unset. - INDEXABLE_OPTION_UNSPECIFIED = 0 - - # Indexable option enabled for an attribute. - INDEXABLE_ENABLED = 1 - - # Indexable option disabled for an attribute. - INDEXABLE_DISABLED = 2 - end - - # The status of the dynamic facetable option of a catalog attribute. - module DynamicFacetableOption - # Value used when unset. - DYNAMIC_FACETABLE_OPTION_UNSPECIFIED = 0 - - # Dynamic facetable option enabled for an attribute. - DYNAMIC_FACETABLE_ENABLED = 1 - - # Dynamic facetable option disabled for an attribute. - DYNAMIC_FACETABLE_DISABLED = 2 - end - - # The status of the searchable option of a catalog attribute. - module SearchableOption - # Value used when unset. - SEARCHABLE_OPTION_UNSPECIFIED = 0 - - # Searchable option enabled for an attribute. - SEARCHABLE_ENABLED = 1 - - # Searchable option disabled for an attribute. - SEARCHABLE_DISABLED = 2 - end - - # The status of the exact-searchable option of a catalog attribute. - module ExactSearchableOption - # Value used when unset. - EXACT_SEARCHABLE_OPTION_UNSPECIFIED = 0 - - # Exact searchable option enabled for an attribute. - EXACT_SEARCHABLE_ENABLED = 1 - - # Exact searchable option disabled for an attribute. - EXACT_SEARCHABLE_DISABLED = 2 - end - - # The status of the retrievable option of a catalog attribute. - module RetrievableOption - # Value used when unset. - RETRIEVABLE_OPTION_UNSPECIFIED = 0 - - # Retrievable option enabled for an attribute. - RETRIEVABLE_ENABLED = 1 - - # Retrievable option disabled for an attribute. - RETRIEVABLE_DISABLED = 2 - end - end - - # Catalog level attribute config. - # @!attribute [rw] name - # @return [::String] - # Required. Immutable. The fully qualified resource name of the attribute - # config. Format: `projects/*/locations/*/catalogs/*/attributesConfig` - # @!attribute [rw] catalog_attributes - # @return [::Google::Protobuf::Map{::String => ::Google::Cloud::Retail::V2::CatalogAttribute}] - # Enable attribute(s) config at catalog level. - # For example, indexable, dynamic_facetable, or searchable for each - # attribute. - # - # The key is catalog attribute's name. - # For example: `color`, `brands`, `attributes.custom_attribute`, such as - # `attributes.xyz`. - # - # The maximum number of catalog attributes allowed in a request is 1000. - # @!attribute [r] attribute_config_level - # @return [::Google::Cloud::Retail::V2::AttributeConfigLevel] - # Output only. The - # {::Google::Cloud::Retail::V2::AttributeConfigLevel AttributeConfigLevel} used - # for this catalog. - class AttributesConfig - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - - # @!attribute [rw] key - # @return [::String] - # @!attribute [rw] value - # @return [::Google::Cloud::Retail::V2::CatalogAttribute] - class CatalogAttributesEntry - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - end - - # Catalog level autocomplete config for customers to customize autocomplete - # feature's settings. - # @!attribute [rw] name - # @return [::String] - # Required. Immutable. Fully qualified name - # `projects/*/locations/*/catalogs/*/completionConfig` - # @!attribute [rw] matching_order - # @return [::String] - # Specifies the matching order for autocomplete suggestions, e.g., a query - # consisting of 'sh' with 'out-of-order' specified would suggest "women's - # shoes", whereas a query of 'red s' with 'exact-prefix' specified would - # suggest "red shoes". Currently supported values: - # - # * 'out-of-order' - # * 'exact-prefix' - # - # Default value: 'exact-prefix'. - # @!attribute [rw] max_suggestions - # @return [::Integer] - # The maximum number of autocomplete suggestions returned per term. Default - # value is 20. If left unset or set to 0, then will fallback to default - # value. - # - # Value range is 1 to 20. - # @!attribute [rw] min_prefix_length - # @return [::Integer] - # The minimum number of characters needed to be typed in order to get - # suggestions. Default value is 2. If left unset or set to 0, then will - # fallback to default value. - # - # Value range is 1 to 20. - # @!attribute [rw] auto_learning - # @return [::Boolean] - # If set to true, the auto learning function is enabled. Auto learning uses - # user data to generate suggestions using ML techniques. Default value is - # false. Only after enabling auto learning can users use `cloud-retail` - # data in - # {::Google::Cloud::Retail::V2::CompleteQueryRequest CompleteQueryRequest}. - # @!attribute [r] suggestions_input_config - # @return [::Google::Cloud::Retail::V2::CompletionDataInputConfig] - # Output only. The source data for the latest import of the autocomplete - # suggestion phrases. - # @!attribute [r] last_suggestions_import_operation - # @return [::String] - # Output only. Name of the LRO corresponding to the latest suggestion terms - # list import. - # - # Can use GetOperation API - # method to retrieve the latest state of the Long Running Operation. - # @!attribute [r] denylist_input_config - # @return [::Google::Cloud::Retail::V2::CompletionDataInputConfig] - # Output only. The source data for the latest import of the autocomplete - # denylist phrases. - # @!attribute [r] last_denylist_import_operation - # @return [::String] - # Output only. Name of the LRO corresponding to the latest denylist import. - # - # Can use GetOperation API to - # retrieve the latest state of the Long Running Operation. - # @!attribute [r] allowlist_input_config - # @return [::Google::Cloud::Retail::V2::CompletionDataInputConfig] - # Output only. The source data for the latest import of the autocomplete - # allowlist phrases. - # @!attribute [r] last_allowlist_import_operation - # @return [::String] - # Output only. Name of the LRO corresponding to the latest allowlist import. - # - # Can use GetOperation API to - # retrieve the latest state of the Long Running Operation. - class CompletionConfig - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # The catalog configuration. - # @!attribute [rw] name - # @return [::String] - # Required. Immutable. The fully qualified resource name of the catalog. - # @!attribute [rw] display_name - # @return [::String] - # Required. Immutable. The catalog display name. - # - # This field must be a UTF-8 encoded string with a length limit of 128 - # characters. Otherwise, an INVALID_ARGUMENT error is returned. - # @!attribute [rw] product_level_config - # @return [::Google::Cloud::Retail::V2::ProductLevelConfig] - # Required. The product level configuration. - class Catalog - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - end - end - end -end diff --git a/owl-bot-staging/google-cloud-retail-v2/proto_docs/google/cloud/retail/v2/catalog_service.rb b/owl-bot-staging/google-cloud-retail-v2/proto_docs/google/cloud/retail/v2/catalog_service.rb deleted file mode 100644 index 062dd48b9cbe..000000000000 --- a/owl-bot-staging/google-cloud-retail-v2/proto_docs/google/cloud/retail/v2/catalog_service.rb +++ /dev/null @@ -1,297 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - - -module Google - module Cloud - module Retail - module V2 - # Request for - # {::Google::Cloud::Retail::V2::CatalogService::Client#list_catalogs CatalogService.ListCatalogs} - # method. - # @!attribute [rw] parent - # @return [::String] - # Required. The account resource name with an associated location. - # - # If the caller does not have permission to list - # {::Google::Cloud::Retail::V2::Catalog Catalog}s under this location, regardless - # of whether or not this location exists, a PERMISSION_DENIED error is - # returned. - # @!attribute [rw] page_size - # @return [::Integer] - # Maximum number of {::Google::Cloud::Retail::V2::Catalog Catalog}s to return. If - # unspecified, defaults to 50. The maximum allowed value is 1000. Values - # above 1000 will be coerced to 1000. - # - # If this field is negative, an INVALID_ARGUMENT is returned. - # @!attribute [rw] page_token - # @return [::String] - # A page token - # {::Google::Cloud::Retail::V2::ListCatalogsResponse#next_page_token ListCatalogsResponse.next_page_token}, - # received from a previous - # {::Google::Cloud::Retail::V2::CatalogService::Client#list_catalogs CatalogService.ListCatalogs} - # call. Provide this to retrieve the subsequent page. - # - # When paginating, all other parameters provided to - # {::Google::Cloud::Retail::V2::CatalogService::Client#list_catalogs CatalogService.ListCatalogs} - # must match the call that provided the page token. Otherwise, an - # INVALID_ARGUMENT error is returned. - class ListCatalogsRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Response for - # {::Google::Cloud::Retail::V2::CatalogService::Client#list_catalogs CatalogService.ListCatalogs} - # method. - # @!attribute [rw] catalogs - # @return [::Array<::Google::Cloud::Retail::V2::Catalog>] - # All the customer's {::Google::Cloud::Retail::V2::Catalog Catalog}s. - # @!attribute [rw] next_page_token - # @return [::String] - # A token that can be sent as - # {::Google::Cloud::Retail::V2::ListCatalogsRequest#page_token ListCatalogsRequest.page_token} - # to retrieve the next page. If this field is omitted, there are no - # subsequent pages. - class ListCatalogsResponse - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Request for - # {::Google::Cloud::Retail::V2::CatalogService::Client#update_catalog CatalogService.UpdateCatalog} - # method. - # @!attribute [rw] catalog - # @return [::Google::Cloud::Retail::V2::Catalog] - # Required. The {::Google::Cloud::Retail::V2::Catalog Catalog} to update. - # - # If the caller does not have permission to update the - # {::Google::Cloud::Retail::V2::Catalog Catalog}, regardless of whether or not it - # exists, a PERMISSION_DENIED error is returned. - # - # If the {::Google::Cloud::Retail::V2::Catalog Catalog} to update does not exist, - # a NOT_FOUND error is returned. - # @!attribute [rw] update_mask - # @return [::Google::Protobuf::FieldMask] - # Indicates which fields in the provided - # {::Google::Cloud::Retail::V2::Catalog Catalog} to update. - # - # If an unsupported or unknown field is provided, an INVALID_ARGUMENT error - # is returned. - class UpdateCatalogRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Request message to set a specified branch as new default_branch. - # @!attribute [rw] catalog - # @return [::String] - # Full resource name of the catalog, such as - # `projects/*/locations/global/catalogs/default_catalog`. - # @!attribute [rw] branch_id - # @return [::String] - # The final component of the resource name of a branch. - # - # This field must be one of "0", "1" or "2". Otherwise, an INVALID_ARGUMENT - # error is returned. - # - # If there are no sufficient active products in the targeted branch and - # {::Google::Cloud::Retail::V2::SetDefaultBranchRequest#force force} is not set, a - # FAILED_PRECONDITION error is returned. - # @!attribute [rw] note - # @return [::String] - # Some note on this request, this can be retrieved by - # {::Google::Cloud::Retail::V2::CatalogService::Client#get_default_branch CatalogService.GetDefaultBranch} - # before next valid default branch set occurs. - # - # This field must be a UTF-8 encoded string with a length limit of 1,000 - # characters. Otherwise, an INVALID_ARGUMENT error is returned. - # @!attribute [rw] force - # @return [::Boolean] - # If set to true, it permits switching to a branch with - # {::Google::Cloud::Retail::V2::SetDefaultBranchRequest#branch_id branch_id} even - # if it has no sufficient active products. - class SetDefaultBranchRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Request message to show which branch is currently the default branch. - # @!attribute [rw] catalog - # @return [::String] - # The parent catalog resource name, such as - # `projects/*/locations/global/catalogs/default_catalog`. - class GetDefaultBranchRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Response message of - # {::Google::Cloud::Retail::V2::CatalogService::Client#get_default_branch CatalogService.GetDefaultBranch}. - # @!attribute [rw] branch - # @return [::String] - # Full resource name of the branch id currently set as default branch. - # @!attribute [rw] set_time - # @return [::Google::Protobuf::Timestamp] - # The time when this branch is set to default. - # @!attribute [rw] note - # @return [::String] - # This corresponds to - # {::Google::Cloud::Retail::V2::SetDefaultBranchRequest#note SetDefaultBranchRequest.note} - # field, when this branch was set as default. - class GetDefaultBranchResponse - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Request for - # {::Google::Cloud::Retail::V2::CatalogService::Client#get_completion_config CatalogService.GetCompletionConfig} - # method. - # @!attribute [rw] name - # @return [::String] - # Required. Full CompletionConfig resource name. Format: - # `projects/{project_number}/locations/{location_id}/catalogs/{catalog_id}/completionConfig` - class GetCompletionConfigRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Request for - # {::Google::Cloud::Retail::V2::CatalogService::Client#update_completion_config CatalogService.UpdateCompletionConfig} - # method. - # @!attribute [rw] completion_config - # @return [::Google::Cloud::Retail::V2::CompletionConfig] - # Required. The {::Google::Cloud::Retail::V2::CompletionConfig CompletionConfig} - # to update. - # - # If the caller does not have permission to update the - # {::Google::Cloud::Retail::V2::CompletionConfig CompletionConfig}, then a - # PERMISSION_DENIED error is returned. - # - # If the {::Google::Cloud::Retail::V2::CompletionConfig CompletionConfig} to - # update does not exist, a NOT_FOUND error is returned. - # @!attribute [rw] update_mask - # @return [::Google::Protobuf::FieldMask] - # Indicates which fields in the provided - # {::Google::Cloud::Retail::V2::CompletionConfig CompletionConfig} to update. The - # following are the only supported fields: - # - # * {::Google::Cloud::Retail::V2::CompletionConfig#matching_order CompletionConfig.matching_order} - # * {::Google::Cloud::Retail::V2::CompletionConfig#max_suggestions CompletionConfig.max_suggestions} - # * {::Google::Cloud::Retail::V2::CompletionConfig#min_prefix_length CompletionConfig.min_prefix_length} - # * {::Google::Cloud::Retail::V2::CompletionConfig#auto_learning CompletionConfig.auto_learning} - # - # If not set, all supported fields are updated. - class UpdateCompletionConfigRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Request for - # {::Google::Cloud::Retail::V2::CatalogService::Client#get_attributes_config CatalogService.GetAttributesConfig} - # method. - # @!attribute [rw] name - # @return [::String] - # Required. Full AttributesConfig resource name. Format: - # `projects/{project_number}/locations/{location_id}/catalogs/{catalog_id}/attributesConfig` - class GetAttributesConfigRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Request for - # {::Google::Cloud::Retail::V2::CatalogService::Client#update_attributes_config CatalogService.UpdateAttributesConfig} - # method. - # @!attribute [rw] attributes_config - # @return [::Google::Cloud::Retail::V2::AttributesConfig] - # Required. The {::Google::Cloud::Retail::V2::AttributesConfig AttributesConfig} - # to update. - # @!attribute [rw] update_mask - # @return [::Google::Protobuf::FieldMask] - # Indicates which fields in the provided - # {::Google::Cloud::Retail::V2::AttributesConfig AttributesConfig} to update. The - # following is the only supported field: - # - # * {::Google::Cloud::Retail::V2::AttributesConfig#catalog_attributes AttributesConfig.catalog_attributes} - # - # If not set, all supported fields are updated. - class UpdateAttributesConfigRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Request for - # {::Google::Cloud::Retail::V2::CatalogService::Client#add_catalog_attribute CatalogService.AddCatalogAttribute} - # method. - # @!attribute [rw] attributes_config - # @return [::String] - # Required. Full AttributesConfig resource name. Format: - # `projects/{project_number}/locations/{location_id}/catalogs/{catalog_id}/attributesConfig` - # @!attribute [rw] catalog_attribute - # @return [::Google::Cloud::Retail::V2::CatalogAttribute] - # Required. The {::Google::Cloud::Retail::V2::CatalogAttribute CatalogAttribute} - # to add. - class AddCatalogAttributeRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Request for - # {::Google::Cloud::Retail::V2::CatalogService::Client#remove_catalog_attribute CatalogService.RemoveCatalogAttribute} - # method. - # @!attribute [rw] attributes_config - # @return [::String] - # Required. Full AttributesConfig resource name. Format: - # `projects/{project_number}/locations/{location_id}/catalogs/{catalog_id}/attributesConfig` - # @!attribute [rw] key - # @return [::String] - # Required. The attribute name key of the - # {::Google::Cloud::Retail::V2::CatalogAttribute CatalogAttribute} to remove. - class RemoveCatalogAttributeRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Request for - # {::Google::Cloud::Retail::V2::CatalogService::Client#replace_catalog_attribute CatalogService.ReplaceCatalogAttribute} - # method. - # @!attribute [rw] attributes_config - # @return [::String] - # Required. Full AttributesConfig resource name. Format: - # `projects/{project_number}/locations/{location_id}/catalogs/{catalog_id}/attributesConfig` - # @!attribute [rw] catalog_attribute - # @return [::Google::Cloud::Retail::V2::CatalogAttribute] - # Required. The updated - # {::Google::Cloud::Retail::V2::CatalogAttribute CatalogAttribute}. - # @!attribute [rw] update_mask - # @return [::Google::Protobuf::FieldMask] - # Indicates which fields in the provided - # {::Google::Cloud::Retail::V2::CatalogAttribute CatalogAttribute} to update. The - # following are NOT supported: - # - # * {::Google::Cloud::Retail::V2::CatalogAttribute#key CatalogAttribute.key} - # - # If not set, all supported fields are updated. - class ReplaceCatalogAttributeRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - end - end - end -end diff --git a/owl-bot-staging/google-cloud-retail-v2/proto_docs/google/cloud/retail/v2/common.rb b/owl-bot-staging/google-cloud-retail-v2/proto_docs/google/cloud/retail/v2/common.rb deleted file mode 100644 index d73fe6763594..000000000000 --- a/owl-bot-staging/google-cloud-retail-v2/proto_docs/google/cloud/retail/v2/common.rb +++ /dev/null @@ -1,1085 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - - -module Google - module Cloud - module Retail - module V2 - # Metadata that is used to define a condition that triggers an action. - # A valid condition must specify at least one of 'query_terms' or - # 'products_filter'. If multiple fields are specified, the condition is met if - # all the fields are satisfied e.g. if a set of query terms and product_filter - # are set, then only items matching the product_filter for requests with a - # query matching the query terms wil get boosted. - # @!attribute [rw] query_terms - # @return [::Array<::Google::Cloud::Retail::V2::Condition::QueryTerm>] - # A list (up to 10 entries) of terms to match the query on. If not - # specified, match all queries. - # If many query terms are specified, the condition - # is matched if any of the terms is a match (i.e. using the OR operator). - # @!attribute [rw] active_time_range - # @return [::Array<::Google::Cloud::Retail::V2::Condition::TimeRange>] - # Range of time(s) specifying when Condition is active. - # Condition true if any time range matches. - # @!attribute [rw] page_categories - # @return [::Array<::String>] - # Used to support browse uses cases. - # A list (up to 10 entries) of categories or departments. - # The format should be the same as - # {::Google::Cloud::Retail::V2::UserEvent#page_categories UserEvent.page_categories}; - class Condition - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - - # Query terms that we want to match on. - # @!attribute [rw] value - # @return [::String] - # The value of the term to match on. - # Value cannot be empty. - # Value can have at most 3 terms if specified as a partial match. Each - # space separated string is considered as one term. - # For example, "a b c" is 3 terms and allowed, but " a b c d" is 4 terms - # and not allowed for a partial match. - # @!attribute [rw] full_match - # @return [::Boolean] - # Whether this is supposed to be a full or partial match. - class QueryTerm - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Used for time-dependent conditions. - # Example: Want to have rule applied for week long sale. - # @!attribute [rw] start_time - # @return [::Google::Protobuf::Timestamp] - # Start of time range. Range is inclusive. - # @!attribute [rw] end_time - # @return [::Google::Protobuf::Timestamp] - # End of time range. Range is inclusive. - class TimeRange - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - end - - # A rule is a condition-action pair - # - # * A condition defines when a rule is to be triggered. - # * An action specifies what occurs on that trigger. - # Currently rules only work for {::Google::Cloud::Retail::V2::Control controls} with - # {::Google::Cloud::Retail::V2::SolutionType::SOLUTION_TYPE_SEARCH SOLUTION_TYPE_SEARCH}. - # @!attribute [rw] boost_action - # @return [::Google::Cloud::Retail::V2::Rule::BoostAction] - # A boost action. - # - # Note: The following fields are mutually exclusive: `boost_action`, `redirect_action`, `oneway_synonyms_action`, `do_not_associate_action`, `replacement_action`, `ignore_action`, `filter_action`, `twoway_synonyms_action`, `force_return_facet_action`, `remove_facet_action`, `pin_action`. If a field in that set is populated, all other fields in the set will automatically be cleared. - # @!attribute [rw] redirect_action - # @return [::Google::Cloud::Retail::V2::Rule::RedirectAction] - # Redirects a shopper to a specific page. - # - # Note: The following fields are mutually exclusive: `redirect_action`, `boost_action`, `oneway_synonyms_action`, `do_not_associate_action`, `replacement_action`, `ignore_action`, `filter_action`, `twoway_synonyms_action`, `force_return_facet_action`, `remove_facet_action`, `pin_action`. If a field in that set is populated, all other fields in the set will automatically be cleared. - # @!attribute [rw] oneway_synonyms_action - # @return [::Google::Cloud::Retail::V2::Rule::OnewaySynonymsAction] - # Treats specific term as a synonym with a group of terms. - # Group of terms will not be treated as synonyms with the specific term. - # - # Note: The following fields are mutually exclusive: `oneway_synonyms_action`, `boost_action`, `redirect_action`, `do_not_associate_action`, `replacement_action`, `ignore_action`, `filter_action`, `twoway_synonyms_action`, `force_return_facet_action`, `remove_facet_action`, `pin_action`. If a field in that set is populated, all other fields in the set will automatically be cleared. - # @!attribute [rw] do_not_associate_action - # @return [::Google::Cloud::Retail::V2::Rule::DoNotAssociateAction] - # Prevents term from being associated with other terms. - # - # Note: The following fields are mutually exclusive: `do_not_associate_action`, `boost_action`, `redirect_action`, `oneway_synonyms_action`, `replacement_action`, `ignore_action`, `filter_action`, `twoway_synonyms_action`, `force_return_facet_action`, `remove_facet_action`, `pin_action`. If a field in that set is populated, all other fields in the set will automatically be cleared. - # @!attribute [rw] replacement_action - # @return [::Google::Cloud::Retail::V2::Rule::ReplacementAction] - # Replaces specific terms in the query. - # - # Note: The following fields are mutually exclusive: `replacement_action`, `boost_action`, `redirect_action`, `oneway_synonyms_action`, `do_not_associate_action`, `ignore_action`, `filter_action`, `twoway_synonyms_action`, `force_return_facet_action`, `remove_facet_action`, `pin_action`. If a field in that set is populated, all other fields in the set will automatically be cleared. - # @!attribute [rw] ignore_action - # @return [::Google::Cloud::Retail::V2::Rule::IgnoreAction] - # Ignores specific terms from query during search. - # - # Note: The following fields are mutually exclusive: `ignore_action`, `boost_action`, `redirect_action`, `oneway_synonyms_action`, `do_not_associate_action`, `replacement_action`, `filter_action`, `twoway_synonyms_action`, `force_return_facet_action`, `remove_facet_action`, `pin_action`. If a field in that set is populated, all other fields in the set will automatically be cleared. - # @!attribute [rw] filter_action - # @return [::Google::Cloud::Retail::V2::Rule::FilterAction] - # Filters results. - # - # Note: The following fields are mutually exclusive: `filter_action`, `boost_action`, `redirect_action`, `oneway_synonyms_action`, `do_not_associate_action`, `replacement_action`, `ignore_action`, `twoway_synonyms_action`, `force_return_facet_action`, `remove_facet_action`, `pin_action`. If a field in that set is populated, all other fields in the set will automatically be cleared. - # @!attribute [rw] twoway_synonyms_action - # @return [::Google::Cloud::Retail::V2::Rule::TwowaySynonymsAction] - # Treats a set of terms as synonyms of one another. - # - # Note: The following fields are mutually exclusive: `twoway_synonyms_action`, `boost_action`, `redirect_action`, `oneway_synonyms_action`, `do_not_associate_action`, `replacement_action`, `ignore_action`, `filter_action`, `force_return_facet_action`, `remove_facet_action`, `pin_action`. If a field in that set is populated, all other fields in the set will automatically be cleared. - # @!attribute [rw] force_return_facet_action - # @return [::Google::Cloud::Retail::V2::Rule::ForceReturnFacetAction] - # Force returns an attribute as a facet in the request. - # - # Note: The following fields are mutually exclusive: `force_return_facet_action`, `boost_action`, `redirect_action`, `oneway_synonyms_action`, `do_not_associate_action`, `replacement_action`, `ignore_action`, `filter_action`, `twoway_synonyms_action`, `remove_facet_action`, `pin_action`. If a field in that set is populated, all other fields in the set will automatically be cleared. - # @!attribute [rw] remove_facet_action - # @return [::Google::Cloud::Retail::V2::Rule::RemoveFacetAction] - # Remove an attribute as a facet in the request (if present). - # - # Note: The following fields are mutually exclusive: `remove_facet_action`, `boost_action`, `redirect_action`, `oneway_synonyms_action`, `do_not_associate_action`, `replacement_action`, `ignore_action`, `filter_action`, `twoway_synonyms_action`, `force_return_facet_action`, `pin_action`. If a field in that set is populated, all other fields in the set will automatically be cleared. - # @!attribute [rw] pin_action - # @return [::Google::Cloud::Retail::V2::Rule::PinAction] - # Pins one or more specified products to a specific position in the - # results. - # - # Note: The following fields are mutually exclusive: `pin_action`, `boost_action`, `redirect_action`, `oneway_synonyms_action`, `do_not_associate_action`, `replacement_action`, `ignore_action`, `filter_action`, `twoway_synonyms_action`, `force_return_facet_action`, `remove_facet_action`. If a field in that set is populated, all other fields in the set will automatically be cleared. - # @!attribute [rw] condition - # @return [::Google::Cloud::Retail::V2::Condition] - # Required. The condition that triggers the rule. - # If the condition is empty, the rule will always apply. - class Rule - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - - # A boost action to apply to results matching condition specified above. - # @!attribute [rw] boost - # @return [::Float] - # Strength of the condition boost, which must be in [-1, 1]. Negative - # boost means demotion. Default is 0.0. - # - # Setting to 1.0 gives the item a big promotion. However, it does not - # necessarily mean that the boosted item will be the top result at all - # times, nor that other items will be excluded. Results could still be - # shown even when none of them matches the condition. And results that - # are significantly more relevant to the search query can still trump - # your heavily favored but irrelevant items. - # - # Setting to -1.0 gives the item a big demotion. However, results that - # are deeply relevant might still be shown. The item will have an - # upstream battle to get a fairly high ranking, but it is not blocked out - # completely. - # - # Setting to 0.0 means no boost applied. The boosting condition is - # ignored. - # @!attribute [rw] products_filter - # @return [::String] - # The filter can have a max size of 5000 characters. - # An expression which specifies which products to apply an action to. - # The syntax and supported fields are the same as a filter expression. See - # {::Google::Cloud::Retail::V2::SearchRequest#filter SearchRequest.filter} for - # detail syntax and limitations. - # - # Examples: - # - # * To boost products with product ID "product_1" or "product_2", and - # color - # "Red" or "Blue":
- # *(id: ANY("product_1", "product_2"))
* - # *AND
* - # *(colorFamilies: ANY("Red", "Blue"))
* - class BoostAction - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # * Rule Condition: - # - No - # {::Google::Cloud::Retail::V2::Condition#query_terms Condition.query_terms} - # provided is a global match. - # - 1 or more - # {::Google::Cloud::Retail::V2::Condition#query_terms Condition.query_terms} - # provided are combined with OR operator. - # - # * Action Input: The request query and filter that are applied to the - # retrieved products, in addition to any filters already provided with the - # SearchRequest. The AND operator is used to combine the query's existing - # filters with the filter rule(s). NOTE: May result in 0 results when - # filters conflict. - # - # * Action Result: Filters the returned objects to be ONLY those that passed - # the filter. - # @!attribute [rw] filter - # @return [::String] - # A filter to apply on the matching condition results. Supported features: - # - # * {::Google::Cloud::Retail::V2::Rule::FilterAction#filter filter} must be set. - # * Filter syntax is identical to - # {::Google::Cloud::Retail::V2::SearchRequest#filter SearchRequest.filter}. For - # more - # information, see [Filter](/retail/docs/filter-and-order#filter). - # * To filter products with product ID "product_1" or "product_2", and - # color - # "Red" or "Blue":
- # *(id: ANY("product_1", "product_2"))
* - # *AND
* - # *(colorFamilies: ANY("Red", "Blue"))
* - class FilterAction - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Redirects a shopper to a specific page. - # - # * Rule Condition: - # Must specify - # {::Google::Cloud::Retail::V2::Condition#query_terms Condition.query_terms}. - # * Action Input: Request Query - # * Action Result: Redirects shopper to provided uri. - # @!attribute [rw] redirect_uri - # @return [::String] - # URL must have length equal or less than 2000 characters. - class RedirectAction - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Creates a set of terms that will be treated as synonyms of each other. - # Example: synonyms of "sneakers" and "shoes": - # - # * "sneakers" will use a synonym of "shoes". - # * "shoes" will use a synonym of "sneakers". - # @!attribute [rw] synonyms - # @return [::Array<::String>] - # Defines a set of synonyms. - # Can specify up to 100 synonyms. - # Must specify at least 2 synonyms. - class TwowaySynonymsAction - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Maps a set of terms to a set of synonyms. - # Set of synonyms will be treated as synonyms of each query term only. - # `query_terms` will not be treated as synonyms of each other. - # Example: "sneakers" will use a synonym of "shoes". - # "shoes" will not use a synonym of "sneakers". - # @!attribute [rw] query_terms - # @return [::Array<::String>] - # Terms from the search query. - # Will treat synonyms as their synonyms. - # Not themselves synonyms of the synonyms. - # Can specify up to 100 terms. - # @!attribute [rw] synonyms - # @return [::Array<::String>] - # Defines a set of synonyms. - # Cannot contain duplicates. - # Can specify up to 100 synonyms. - # @!attribute [rw] oneway_terms - # @return [::Array<::String>] - # Will be [deprecated = true] post migration; - class OnewaySynonymsAction - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Prevents `query_term` from being associated with specified terms during - # search. - # Example: Don't associate "gShoe" and "cheap". - # @!attribute [rw] query_terms - # @return [::Array<::String>] - # Terms from the search query. - # Will not consider do_not_associate_terms for search if in search query. - # Can specify up to 100 terms. - # @!attribute [rw] do_not_associate_terms - # @return [::Array<::String>] - # Cannot contain duplicates or the query term. - # Can specify up to 100 terms. - # @!attribute [rw] terms - # @return [::Array<::String>] - # Will be [deprecated = true] post migration; - class DoNotAssociateAction - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Replaces a term in the query. Multiple replacement candidates can be - # specified. All `query_terms` will be replaced with the replacement term. - # Example: Replace "gShoe" with "google shoe". - # @!attribute [rw] query_terms - # @return [::Array<::String>] - # Terms from the search query. - # Will be replaced by replacement term. - # Can specify up to 100 terms. - # @!attribute [rw] replacement_term - # @return [::String] - # Term that will be used for replacement. - # @!attribute [rw] term - # @return [::String] - # Will be [deprecated = true] post migration; - class ReplacementAction - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Prevents a term in the query from being used in search. - # Example: Don't search for "shoddy". - # @!attribute [rw] ignore_terms - # @return [::Array<::String>] - # Terms to ignore in the search query. - class IgnoreAction - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Force returns an attribute/facet in the request around a certain position - # or above. - # - # * Rule Condition: - # Must specify non-empty - # {::Google::Cloud::Retail::V2::Condition#query_terms Condition.query_terms} - # (for search only) or - # {::Google::Cloud::Retail::V2::Condition#page_categories Condition.page_categories} - # (for browse only), but can't specify both. - # - # * Action Inputs: attribute name, position - # - # * Action Result: Will force return a facet key around a certain position - # or above if the condition is satisfied. - # - # Example: Suppose the query is "shoes", the - # {::Google::Cloud::Retail::V2::Condition#query_terms Condition.query_terms} is - # "shoes", the - # {::Google::Cloud::Retail::V2::Rule::ForceReturnFacetAction::FacetPositionAdjustment#attribute_name ForceReturnFacetAction.FacetPositionAdjustment.attribute_name} - # is "size" and the - # {::Google::Cloud::Retail::V2::Rule::ForceReturnFacetAction::FacetPositionAdjustment#position ForceReturnFacetAction.FacetPositionAdjustment.position} - # is 8. - # - # Two cases: a) The facet key "size" is not already in the top 8 slots, then - # the facet "size" will appear at a position close to 8. b) The facet key - # "size" in among the top 8 positions in the request, then it will stay at - # its current rank. - # @!attribute [rw] facet_position_adjustments - # @return [::Array<::Google::Cloud::Retail::V2::Rule::ForceReturnFacetAction::FacetPositionAdjustment>] - # Each instance corresponds to a force return attribute for the given - # condition. There can't be more 15 instances here. - class ForceReturnFacetAction - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - - # Each facet position adjustment consists of a single attribute name (i.e. - # facet key) along with a specified position. - # @!attribute [rw] attribute_name - # @return [::String] - # The attribute name to force return as a facet. Each attribute name - # should be a valid attribute name, be non-empty and contain at most 80 - # characters long. - # @!attribute [rw] position - # @return [::Integer] - # This is the position in the request as explained above. It should be - # strictly positive be at most 100. - class FacetPositionAdjustment - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - end - - # Removes an attribute/facet in the request if is present. - # - # * Rule Condition: - # Must specify non-empty - # {::Google::Cloud::Retail::V2::Condition#query_terms Condition.query_terms} - # (for search only) or - # {::Google::Cloud::Retail::V2::Condition#page_categories Condition.page_categories} - # (for browse only), but can't specify both. - # - # * Action Input: attribute name - # - # * Action Result: Will remove the attribute (as a facet) from the request - # if it is present. - # - # Example: Suppose the query is "shoes", the - # {::Google::Cloud::Retail::V2::Condition#query_terms Condition.query_terms} is - # "shoes" and the attribute name "size", then facet key "size" will be - # removed from the request (if it is present). - # @!attribute [rw] attribute_names - # @return [::Array<::String>] - # The attribute names (i.e. facet keys) to remove from the dynamic facets - # (if present in the request). There can't be more 3 attribute names. - # Each attribute name should be a valid attribute name, be non-empty and - # contain at most 80 characters. - class RemoveFacetAction - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Pins one or more specified products to a specific position in the - # results. - # - # * Rule Condition: - # Must specify non-empty - # {::Google::Cloud::Retail::V2::Condition#query_terms Condition.query_terms} - # (for search only) or - # {::Google::Cloud::Retail::V2::Condition#page_categories Condition.page_categories} - # (for browse only), but can't specify both. - # - # * Action Input: mapping of `[pin_position, product_id]` pairs (pin position - # uses 1-based indexing). - # - # * Action Result: Will pin products with matching ids to the position - # specified in the final result order. - # - # Example: Suppose the query is `shoes`, the - # {::Google::Cloud::Retail::V2::Condition#query_terms Condition.query_terms} is - # `shoes` and the pin_map has `{1, "pid1"}`, then product with `pid1` will be - # pinned to the top position in the final results. - # - # If multiple PinActions are matched to a single request the actions will - # be processed from most to least recently updated. - # - # Pins to positions larger than the max allowed page size of 120 are not - # allowed. - # @!attribute [rw] pin_map - # @return [::Google::Protobuf::Map{::Integer => ::String}] - # Required. A map of positions to product_ids. - # - # Partial matches per action are allowed, if a certain position in the map - # is already filled that `[position, product_id]` pair will be ignored - # but the rest may still be applied. This case will only occur if multiple - # pin actions are matched to a single request, as the map guarantees that - # pin positions are unique within the same action. - # - # Duplicate product_ids are not permitted within a single pin map. - # - # The max size of this map is 120, equivalent to the max [request page - # size](https://cloud.google.com/retail/docs/reference/rest/v2/projects.locations.catalogs.placements/search#request-body). - class PinAction - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - - # @!attribute [rw] key - # @return [::Integer] - # @!attribute [rw] value - # @return [::String] - class PinMapEntry - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - end - end - - # An intended audience of the {::Google::Cloud::Retail::V2::Product Product} for - # whom it's sold. - # @!attribute [rw] genders - # @return [::Array<::String>] - # The genders of the audience. Strongly encouraged to use the standard - # values: "male", "female", "unisex". - # - # At most 5 values are allowed. Each value must be a UTF-8 encoded string - # with a length limit of 128 characters. Otherwise, an INVALID_ARGUMENT error - # is returned. - # - # Google Merchant Center property - # [gender](https://support.google.com/merchants/answer/6324479). Schema.org - # property - # [Product.audience.suggestedGender](https://schema.org/suggestedGender). - # @!attribute [rw] age_groups - # @return [::Array<::String>] - # The age groups of the audience. Strongly encouraged to use the standard - # values: "newborn" (up to 3 months old), "infant" (3–12 months old), - # "toddler" (1–5 years old), "kids" (5–13 years old), "adult" (typically - # teens or older). - # - # At most 5 values are allowed. Each value must be a UTF-8 encoded string - # with a length limit of 128 characters. Otherwise, an INVALID_ARGUMENT error - # is returned. - # - # Google Merchant Center property - # [age_group](https://support.google.com/merchants/answer/6324463). - # Schema.org property - # [Product.audience.suggestedMinAge](https://schema.org/suggestedMinAge) and - # [Product.audience.suggestedMaxAge](https://schema.org/suggestedMaxAge). - class Audience - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # The color information of a {::Google::Cloud::Retail::V2::Product Product}. - # @!attribute [rw] color_families - # @return [::Array<::String>] - # The standard color families. Strongly recommended to use the following - # standard color groups: "Red", "Pink", "Orange", "Yellow", "Purple", - # "Green", "Cyan", "Blue", "Brown", "White", "Gray", "Black" and "Mixed". - # Normally it is expected to have only 1 color family. May consider using - # single "Mixed" instead of multiple values. - # - # A maximum of 5 values are allowed. Each value must be a UTF-8 encoded - # string with a length limit of 128 characters. Otherwise, an - # INVALID_ARGUMENT error is returned. - # - # Google Merchant Center property - # [color](https://support.google.com/merchants/answer/6324487). Schema.org - # property [Product.color](https://schema.org/color). - # - # The colorFamilies field as a system attribute is not a required field but - # strongly recommended to be specified. Google Search models treat this field - # as more important than a custom product attribute when specified. - # @!attribute [rw] colors - # @return [::Array<::String>] - # The color display names, which may be different from standard color family - # names, such as the color aliases used in the website frontend. Normally - # it is expected to have only 1 color. May consider using single "Mixed" - # instead of multiple values. - # - # A maximum of 75 colors are allowed. Each value must be a UTF-8 encoded - # string with a length limit of 128 characters. Otherwise, an - # INVALID_ARGUMENT error is returned. - # - # Google Merchant Center property - # [color](https://support.google.com/merchants/answer/6324487). Schema.org - # property [Product.color](https://schema.org/color). - class ColorInfo - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # A custom attribute that is not explicitly modeled in - # {::Google::Cloud::Retail::V2::Product Product}. - # @!attribute [rw] text - # @return [::Array<::String>] - # The textual values of this custom attribute. For example, `["yellow", - # "green"]` when the key is "color". - # - # Empty string is not allowed. Otherwise, an INVALID_ARGUMENT error is - # returned. - # - # Exactly one of {::Google::Cloud::Retail::V2::CustomAttribute#text text} or - # {::Google::Cloud::Retail::V2::CustomAttribute#numbers numbers} should be set. - # Otherwise, an INVALID_ARGUMENT error is returned. - # @!attribute [rw] numbers - # @return [::Array<::Float>] - # The numerical values of this custom attribute. For example, `[2.3, 15.4]` - # when the key is "lengths_cm". - # - # Exactly one of {::Google::Cloud::Retail::V2::CustomAttribute#text text} or - # {::Google::Cloud::Retail::V2::CustomAttribute#numbers numbers} should be set. - # Otherwise, an INVALID_ARGUMENT error is returned. - # @!attribute [rw] searchable - # @deprecated This field is deprecated and may be removed in the next major version update. - # @return [::Boolean] - # This field is normally ignored unless - # {::Google::Cloud::Retail::V2::AttributesConfig#attribute_config_level AttributesConfig.attribute_config_level} - # of the {::Google::Cloud::Retail::V2::Catalog Catalog} is set to the deprecated - # 'PRODUCT_LEVEL_ATTRIBUTE_CONFIG' mode. For information about product-level - # attribute configuration, see [Configuration - # modes](https://cloud.google.com/retail/docs/attribute-config#config-modes). - # If true, custom attribute values are searchable by text queries in - # {::Google::Cloud::Retail::V2::SearchService::Client#search SearchService.Search}. - # - # This field is ignored in a {::Google::Cloud::Retail::V2::UserEvent UserEvent}. - # - # Only set if type {::Google::Cloud::Retail::V2::CustomAttribute#text text} is - # set. Otherwise, a INVALID_ARGUMENT error is returned. - # @!attribute [rw] indexable - # @deprecated This field is deprecated and may be removed in the next major version update. - # @return [::Boolean] - # This field is normally ignored unless - # {::Google::Cloud::Retail::V2::AttributesConfig#attribute_config_level AttributesConfig.attribute_config_level} - # of the {::Google::Cloud::Retail::V2::Catalog Catalog} is set to the deprecated - # 'PRODUCT_LEVEL_ATTRIBUTE_CONFIG' mode. For information about product-level - # attribute configuration, see [Configuration - # modes](https://cloud.google.com/retail/docs/attribute-config#config-modes). - # If true, custom attribute values are indexed, so that they can be filtered, - # faceted or boosted in - # {::Google::Cloud::Retail::V2::SearchService::Client#search SearchService.Search}. - # - # This field is ignored in a {::Google::Cloud::Retail::V2::UserEvent UserEvent}. - # - # See {::Google::Cloud::Retail::V2::SearchRequest#filter SearchRequest.filter}, - # {::Google::Cloud::Retail::V2::SearchRequest#facet_specs SearchRequest.facet_specs} - # and - # {::Google::Cloud::Retail::V2::SearchRequest#boost_spec SearchRequest.boost_spec} - # for more details. - class CustomAttribute - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Fulfillment information, such as the store IDs for in-store pickup or region - # IDs for different shipping methods. - # @!attribute [rw] type - # @return [::String] - # The fulfillment type, including commonly used types (such as pickup in - # store and same day delivery), and custom types. Customers have to map - # custom types to their display names before rendering UI. - # - # Supported values: - # - # * "pickup-in-store" - # * "ship-to-store" - # * "same-day-delivery" - # * "next-day-delivery" - # * "custom-type-1" - # * "custom-type-2" - # * "custom-type-3" - # * "custom-type-4" - # * "custom-type-5" - # - # If this field is set to an invalid value other than these, an - # INVALID_ARGUMENT error is returned. - # @!attribute [rw] place_ids - # @return [::Array<::String>] - # The IDs for this {::Google::Cloud::Retail::V2::FulfillmentInfo#type type}, such - # as the store IDs for - # {::Google::Cloud::Retail::V2::FulfillmentInfo#type FulfillmentInfo.type.pickup-in-store} - # or the region IDs for - # {::Google::Cloud::Retail::V2::FulfillmentInfo#type FulfillmentInfo.type.same-day-delivery}. - # - # A maximum of 3000 values are allowed. Each value must be a string with a - # length limit of 30 characters, matching the pattern `[a-zA-Z0-9_-]+`, such - # as "store1" or "REGION-2". Otherwise, an INVALID_ARGUMENT error is - # returned. - class FulfillmentInfo - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # {::Google::Cloud::Retail::V2::Product Product} image. Recommendations AI and - # Retail Search use product images to improve prediction and search results. - # Product images can be returned in results, and are shown in prediction or - # search previews in the console. Please try to provide correct product images - # and avoid using images with size too small. - # @!attribute [rw] uri - # @return [::String] - # Required. URI of the image. - # - # This field must be a valid UTF-8 encoded URI with a length limit of 5,000 - # characters. Otherwise, an INVALID_ARGUMENT error is returned. - # - # Google Merchant Center property - # [image_link](https://support.google.com/merchants/answer/6324350). - # Schema.org property [Product.image](https://schema.org/image). - # @!attribute [rw] height - # @return [::Integer] - # Height of the image in number of pixels. - # - # This field must be nonnegative. Otherwise, an INVALID_ARGUMENT error is - # returned. - # @!attribute [rw] width - # @return [::Integer] - # Width of the image in number of pixels. - # - # This field must be nonnegative. Otherwise, an INVALID_ARGUMENT error is - # returned. - class Image - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # A floating point interval. - # @!attribute [rw] minimum - # @return [::Float] - # Inclusive lower bound. - # - # Note: The following fields are mutually exclusive: `minimum`, `exclusive_minimum`. If a field in that set is populated, all other fields in the set will automatically be cleared. - # @!attribute [rw] exclusive_minimum - # @return [::Float] - # Exclusive lower bound. - # - # Note: The following fields are mutually exclusive: `exclusive_minimum`, `minimum`. If a field in that set is populated, all other fields in the set will automatically be cleared. - # @!attribute [rw] maximum - # @return [::Float] - # Inclusive upper bound. - # - # Note: The following fields are mutually exclusive: `maximum`, `exclusive_maximum`. If a field in that set is populated, all other fields in the set will automatically be cleared. - # @!attribute [rw] exclusive_maximum - # @return [::Float] - # Exclusive upper bound. - # - # Note: The following fields are mutually exclusive: `exclusive_maximum`, `maximum`. If a field in that set is populated, all other fields in the set will automatically be cleared. - class Interval - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # The price information of a {::Google::Cloud::Retail::V2::Product Product}. - # @!attribute [rw] currency_code - # @return [::String] - # The 3-letter currency code defined in [ISO - # 4217](https://www.iso.org/iso-4217-currency-codes.html). - # - # If this field is an unrecognizable currency code, an INVALID_ARGUMENT - # error is returned. - # - # The {::Google::Cloud::Retail::V2::Product::Type::VARIANT Product.Type.VARIANT} - # {::Google::Cloud::Retail::V2::Product Product}s with the same - # {::Google::Cloud::Retail::V2::Product#primary_product_id Product.primary_product_id} - # must share the same - # {::Google::Cloud::Retail::V2::PriceInfo#currency_code currency_code}. Otherwise, - # a FAILED_PRECONDITION error is returned. - # @!attribute [rw] price - # @return [::Float] - # Price of the product. - # - # Google Merchant Center property - # [price](https://support.google.com/merchants/answer/6324371). Schema.org - # property [Offer.price](https://schema.org/price). - # @!attribute [rw] original_price - # @return [::Float] - # Price of the product without any discount. If zero, by default set to be - # the {::Google::Cloud::Retail::V2::PriceInfo#price price}. If set, - # {::Google::Cloud::Retail::V2::PriceInfo#original_price original_price} should be - # greater than or equal to {::Google::Cloud::Retail::V2::PriceInfo#price price}, - # otherwise an INVALID_ARGUMENT error is thrown. - # @!attribute [rw] cost - # @return [::Float] - # The costs associated with the sale of a particular product. Used for gross - # profit reporting. - # - # * Profit = {::Google::Cloud::Retail::V2::PriceInfo#price price} - - # {::Google::Cloud::Retail::V2::PriceInfo#cost cost} - # - # Google Merchant Center property - # [cost_of_goods_sold](https://support.google.com/merchants/answer/9017895). - # @!attribute [rw] price_effective_time - # @return [::Google::Protobuf::Timestamp] - # The timestamp when the {::Google::Cloud::Retail::V2::PriceInfo#price price} - # starts to be effective. This can be set as a future timestamp, and the - # {::Google::Cloud::Retail::V2::PriceInfo#price price} is only used for search - # after - # {::Google::Cloud::Retail::V2::PriceInfo#price_effective_time price_effective_time}. - # If so, the - # {::Google::Cloud::Retail::V2::PriceInfo#original_price original_price} must be - # set and {::Google::Cloud::Retail::V2::PriceInfo#original_price original_price} - # is used before - # {::Google::Cloud::Retail::V2::PriceInfo#price_effective_time price_effective_time}. - # - # Do not set if {::Google::Cloud::Retail::V2::PriceInfo#price price} is always - # effective because it will cause additional latency during search. - # @!attribute [rw] price_expire_time - # @return [::Google::Protobuf::Timestamp] - # The timestamp when the {::Google::Cloud::Retail::V2::PriceInfo#price price} - # stops to be effective. The {::Google::Cloud::Retail::V2::PriceInfo#price price} - # is used for search before - # {::Google::Cloud::Retail::V2::PriceInfo#price_expire_time price_expire_time}. If - # this field is set, the - # {::Google::Cloud::Retail::V2::PriceInfo#original_price original_price} must be - # set and {::Google::Cloud::Retail::V2::PriceInfo#original_price original_price} - # is used after - # {::Google::Cloud::Retail::V2::PriceInfo#price_expire_time price_expire_time}. - # - # Do not set if {::Google::Cloud::Retail::V2::PriceInfo#price price} is always - # effective because it will cause additional latency during search. - # @!attribute [r] price_range - # @return [::Google::Cloud::Retail::V2::PriceInfo::PriceRange] - # Output only. The price range of all the child - # {::Google::Cloud::Retail::V2::Product::Type::VARIANT Product.Type.VARIANT} - # {::Google::Cloud::Retail::V2::Product Product}s grouped together on the - # {::Google::Cloud::Retail::V2::Product::Type::PRIMARY Product.Type.PRIMARY} - # {::Google::Cloud::Retail::V2::Product Product}. Only populated for - # {::Google::Cloud::Retail::V2::Product::Type::PRIMARY Product.Type.PRIMARY} - # {::Google::Cloud::Retail::V2::Product Product}s. - # - # Note: This field is OUTPUT_ONLY for - # {::Google::Cloud::Retail::V2::ProductService::Client#get_product ProductService.GetProduct}. - # Do not set this field in API requests. - class PriceInfo - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - - # The price range of all - # {::Google::Cloud::Retail::V2::Product::Type::VARIANT variant} - # {::Google::Cloud::Retail::V2::Product Product} having the same - # {::Google::Cloud::Retail::V2::Product#primary_product_id Product.primary_product_id}. - # @!attribute [rw] price - # @return [::Google::Cloud::Retail::V2::Interval] - # The inclusive - # {::Google::Cloud::Retail::V2::PriceInfo#price Product.pricing_info.price} - # interval of all {::Google::Cloud::Retail::V2::Product::Type::VARIANT variant} - # {::Google::Cloud::Retail::V2::Product Product} having the same - # {::Google::Cloud::Retail::V2::Product#primary_product_id Product.primary_product_id}. - # @!attribute [rw] original_price - # @return [::Google::Cloud::Retail::V2::Interval] - # The inclusive - # {::Google::Cloud::Retail::V2::PriceInfo#original_price Product.pricing_info.original_price} - # internal of all {::Google::Cloud::Retail::V2::Product::Type::VARIANT variant} - # {::Google::Cloud::Retail::V2::Product Product} having the same - # {::Google::Cloud::Retail::V2::Product#primary_product_id Product.primary_product_id}. - class PriceRange - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - end - - # The rating of a {::Google::Cloud::Retail::V2::Product Product}. - # @!attribute [rw] rating_count - # @return [::Integer] - # The total number of ratings. This value is independent of the value of - # {::Google::Cloud::Retail::V2::Rating#rating_histogram rating_histogram}. - # - # This value must be nonnegative. Otherwise, an INVALID_ARGUMENT error is - # returned. - # @!attribute [rw] average_rating - # @return [::Float] - # The average rating of the {::Google::Cloud::Retail::V2::Product Product}. - # - # The rating is scaled at 1-5. Otherwise, an INVALID_ARGUMENT error is - # returned. - # @!attribute [rw] rating_histogram - # @return [::Array<::Integer>] - # List of rating counts per rating value (index = rating - 1). The list is - # empty if there is no rating. If the list is non-empty, its size is - # always 5. Otherwise, an INVALID_ARGUMENT error is returned. - # - # For example, [41, 14, 13, 47, 303]. It means that the - # {::Google::Cloud::Retail::V2::Product Product} got 41 ratings with 1 star, 14 - # ratings with 2 star, and so on. - class Rating - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Information of an end user. - # @!attribute [rw] user_id - # @return [::String] - # Highly recommended for logged-in users. Unique identifier for logged-in - # user, such as a user name. Don't set for anonymous users. - # - # Always use a hashed value for this ID. - # - # Don't set the field to the same fixed ID for different users. This mixes - # the event history of those users together, which results in degraded - # model quality. - # - # The field must be a UTF-8 encoded string with a length limit of 128 - # characters. Otherwise, an INVALID_ARGUMENT error is returned. - # @!attribute [rw] ip_address - # @return [::String] - # The end user's IP address. This field is used to extract location - # information for personalization. - # - # This field must be either an IPv4 address (e.g. "104.133.9.80") or an IPv6 - # address (e.g. "2001:0db8:85a3:0000:0000:8a2e:0370:7334"). Otherwise, an - # INVALID_ARGUMENT error is returned. - # - # This should not be set when: - # - # * setting - # {::Google::Cloud::Retail::V2::SearchRequest#user_info SearchRequest.user_info}. - # * using the JavaScript tag in - # {::Google::Cloud::Retail::V2::UserEventService::Client#collect_user_event UserEventService.CollectUserEvent} - # or if - # {::Google::Cloud::Retail::V2::UserInfo#direct_user_request direct_user_request} - # is set. - # @!attribute [rw] user_agent - # @return [::String] - # User agent as included in the HTTP header. - # The field must be a UTF-8 encoded string with a length limit of 1,000 - # characters. Otherwise, an INVALID_ARGUMENT error is returned. - # - # This should not be set when using the client side event reporting with - # GTM or JavaScript tag in - # {::Google::Cloud::Retail::V2::UserEventService::Client#collect_user_event UserEventService.CollectUserEvent} - # or if - # {::Google::Cloud::Retail::V2::UserInfo#direct_user_request direct_user_request} - # is set. - # @!attribute [rw] direct_user_request - # @return [::Boolean] - # True if the request is made directly from the end user, in which case the - # {::Google::Cloud::Retail::V2::UserInfo#ip_address ip_address} and - # {::Google::Cloud::Retail::V2::UserInfo#user_agent user_agent} can be populated - # from the HTTP request. This flag should be set only if the API request is - # made directly from the end user such as a mobile app (and not if a gateway - # or a server is processing and pushing the user events). - # - # This should not be set when using the JavaScript tag in - # {::Google::Cloud::Retail::V2::UserEventService::Client#collect_user_event UserEventService.CollectUserEvent}. - class UserInfo - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # The inventory information at a place (e.g. a store) identified - # by a place ID. - # @!attribute [rw] place_id - # @return [::String] - # Optional. The place ID for the current set of inventory information. - # @!attribute [rw] price_info - # @return [::Google::Cloud::Retail::V2::PriceInfo] - # Optional. Product price and cost information. - # - # Google Merchant Center property - # [price](https://support.google.com/merchants/answer/6324371). - # @!attribute [rw] attributes - # @return [::Google::Protobuf::Map{::String => ::Google::Cloud::Retail::V2::CustomAttribute}] - # Optional. Additional local inventory attributes, for example, store name, - # promotion tags, etc. - # - # This field needs to pass all below criteria, otherwise an INVALID_ARGUMENT - # error is returned: - # - # * At most 30 attributes are allowed. - # * The key must be a UTF-8 encoded string with a length limit of 32 - # characters. - # * The key must match the pattern: `[a-zA-Z0-9][a-zA-Z0-9_]*`. For example, - # key0LikeThis or KEY_1_LIKE_THIS. - # * The attribute values must be of the same type (text or number). - # * Only 1 value is allowed for each attribute. - # * For text values, the length limit is 256 UTF-8 characters. - # * The attribute does not support search. The `searchable` field should be - # unset or set to false. - # * The max summed total bytes of custom attribute keys and values per - # product is 5MiB. - # @!attribute [rw] fulfillment_types - # @return [::Array<::String>] - # Optional. Supported fulfillment types. Valid fulfillment type values - # include commonly used types (such as pickup in store and same day - # delivery), and custom types. Customers have to map custom types to their - # display names before rendering UI. - # - # Supported values: - # - # * "pickup-in-store" - # * "ship-to-store" - # * "same-day-delivery" - # * "next-day-delivery" - # * "custom-type-1" - # * "custom-type-2" - # * "custom-type-3" - # * "custom-type-4" - # * "custom-type-5" - # - # If this field is set to an invalid value other than these, an - # INVALID_ARGUMENT error is returned. - # - # All the elements must be distinct. Otherwise, an INVALID_ARGUMENT error is - # returned. - class LocalInventory - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - - # @!attribute [rw] key - # @return [::String] - # @!attribute [rw] value - # @return [::Google::Cloud::Retail::V2::CustomAttribute] - class AttributesEntry - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - end - - # Metadata for pinning to be returned in the response. - # This is used for distinguishing between applied vs dropped pins. - # @!attribute [rw] all_matched_pins - # @return [::Google::Protobuf::Map{::Integer => ::Google::Cloud::Retail::V2::PinControlMetadata::ProductPins}] - # Map of all matched pins, keyed by pin position. - # @!attribute [rw] dropped_pins - # @return [::Google::Protobuf::Map{::Integer => ::Google::Cloud::Retail::V2::PinControlMetadata::ProductPins}] - # Map of pins that were dropped due to overlap with other matching pins, - # keyed by pin position. - class PinControlMetadata - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - - # List of product ids which have associated pins. - # @!attribute [rw] product_id - # @return [::Array<::String>] - # List of product ids which have associated pins. - class ProductPins - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # @!attribute [rw] key - # @return [::Integer] - # @!attribute [rw] value - # @return [::Google::Cloud::Retail::V2::PinControlMetadata::ProductPins] - class AllMatchedPinsEntry - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # @!attribute [rw] key - # @return [::Integer] - # @!attribute [rw] value - # @return [::Google::Cloud::Retail::V2::PinControlMetadata::ProductPins] - class DroppedPinsEntry - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - end - - # A list of string values. - # @!attribute [rw] values - # @return [::Array<::String>] - # String values. - class StringList - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # A message with a list of double values. - # @!attribute [rw] values - # @return [::Array<::Float>] - # The list of double values. - class DoubleList - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # At which level we offer configuration for attributes. - module AttributeConfigLevel - # Value used when unset. In this case, server behavior defaults to - # {::Google::Cloud::Retail::V2::AttributeConfigLevel::CATALOG_LEVEL_ATTRIBUTE_CONFIG CATALOG_LEVEL_ATTRIBUTE_CONFIG}. - ATTRIBUTE_CONFIG_LEVEL_UNSPECIFIED = 0 - - # At this level, we honor the attribute configurations set in - # {::Google::Cloud::Retail::V2::Product#attributes Product.attributes}. - PRODUCT_LEVEL_ATTRIBUTE_CONFIG = 1 - - # At this level, we honor the attribute configurations set in - # `CatalogConfig.attribute_configs`. - CATALOG_LEVEL_ATTRIBUTE_CONFIG = 2 - end - - # The type of solution. - module SolutionType - # Default value. - SOLUTION_TYPE_UNSPECIFIED = 0 - - # Used for Recommendations AI. - SOLUTION_TYPE_RECOMMENDATION = 1 - - # Used for Retail Search. - SOLUTION_TYPE_SEARCH = 2 - end - - # If filtering for recommendations is enabled. - module RecommendationsFilteringOption - # Value used when unset. - # In this case, server behavior defaults to - # {::Google::Cloud::Retail::V2::RecommendationsFilteringOption::RECOMMENDATIONS_FILTERING_DISABLED RECOMMENDATIONS_FILTERING_DISABLED}. - RECOMMENDATIONS_FILTERING_OPTION_UNSPECIFIED = 0 - - # Recommendation filtering is disabled. - RECOMMENDATIONS_FILTERING_DISABLED = 1 - - # Recommendation filtering is enabled. - RECOMMENDATIONS_FILTERING_ENABLED = 3 - end - - # The use case of Cloud Retail Search. - module SearchSolutionUseCase - # The value when it's unspecified. In this case, server behavior defaults to - # {::Google::Cloud::Retail::V2::SearchSolutionUseCase::SEARCH_SOLUTION_USE_CASE_SEARCH SEARCH_SOLUTION_USE_CASE_SEARCH}. - SEARCH_SOLUTION_USE_CASE_UNSPECIFIED = 0 - - # Search use case. Expects the traffic has a non-empty - # {::Google::Cloud::Retail::V2::SearchRequest#query query}. - SEARCH_SOLUTION_USE_CASE_SEARCH = 1 - - # Browse use case. Expects the traffic has an empty - # {::Google::Cloud::Retail::V2::SearchRequest#query query}. - SEARCH_SOLUTION_USE_CASE_BROWSE = 2 - end - end - end - end -end diff --git a/owl-bot-staging/google-cloud-retail-v2/proto_docs/google/cloud/retail/v2/completion_service.rb b/owl-bot-staging/google-cloud-retail-v2/proto_docs/google/cloud/retail/v2/completion_service.rb deleted file mode 100644 index b0608b79614d..000000000000 --- a/owl-bot-staging/google-cloud-retail-v2/proto_docs/google/cloud/retail/v2/completion_service.rb +++ /dev/null @@ -1,230 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - - -module Google - module Cloud - module Retail - module V2 - # Autocomplete parameters. - # @!attribute [rw] catalog - # @return [::String] - # Required. Catalog for which the completion is performed. - # - # Full resource name of catalog, such as - # `projects/*/locations/global/catalogs/default_catalog`. - # @!attribute [rw] query - # @return [::String] - # Required. The query used to generate suggestions. - # - # The maximum number of allowed characters is 255. - # @!attribute [rw] visitor_id - # @return [::String] - # Recommended field. A unique identifier for tracking visitors. For example, - # this could be implemented with an HTTP cookie, which should be able to - # uniquely identify a visitor on a single device. This unique identifier - # should not change if the visitor logs in or out of the website. - # - # The field must be a UTF-8 encoded string with a length limit of 128 - # characters. Otherwise, an INVALID_ARGUMENT error is returned. - # @!attribute [rw] language_codes - # @return [::Array<::String>] - # Note that this field applies for `user-data` dataset only. For requests - # with `cloud-retail` dataset, setting this field has no effect. - # - # The language filters applied to the output suggestions. If set, it should - # contain the language of the query. If not set, suggestions are returned - # without considering language restrictions. This is the BCP-47 language - # code, such as "en-US" or "sr-Latn". For more information, see [Tags for - # Identifying Languages](https://tools.ietf.org/html/bcp47). The maximum - # number of language codes is 3. - # @!attribute [rw] device_type - # @return [::String] - # The device type context for completion suggestions. We recommend that you - # leave this field empty. - # - # It can apply different suggestions on different device types, e.g. - # `DESKTOP`, `MOBILE`. If it is empty, the suggestions are across all device - # types. - # - # Supported formats: - # - # * `UNKNOWN_DEVICE_TYPE` - # - # * `DESKTOP` - # - # * `MOBILE` - # - # * A customized string starts with `OTHER_`, e.g. `OTHER_IPHONE`. - # @!attribute [rw] dataset - # @return [::String] - # Determines which dataset to use for fetching completion. "user-data" will - # use the dataset imported through - # {::Google::Cloud::Retail::V2::CompletionService::Client#import_completion_data CompletionService.ImportCompletionData}. - # `cloud-retail` will use the dataset generated by Cloud Retail based on user - # events. If left empty, completions will be fetched from the `user-data` - # dataset. - # - # Current supported values: - # - # * user-data - # - # * cloud-retail: - # This option requires enabling auto-learning function first. See - # [guidelines](https://cloud.google.com/retail/docs/completion-overview#generated-completion-dataset). - # @!attribute [rw] max_suggestions - # @return [::Integer] - # Completion max suggestions. If left unset or set to 0, then will fallback - # to the configured value - # {::Google::Cloud::Retail::V2::CompletionConfig#max_suggestions CompletionConfig.max_suggestions}. - # - # The maximum allowed max suggestions is 20. If it is set higher, it will be - # capped by 20. - # @!attribute [rw] enable_attribute_suggestions - # @return [::Boolean] - # If true, attribute suggestions are enabled and provided in the response. - # - # This field is only available for the `cloud-retail` dataset. - # @!attribute [rw] entity - # @return [::String] - # The entity for customers who run multiple entities, domains, sites, or - # regions, for example, `Google US`, `Google Ads`, `Waymo`, - # `google.com`, `youtube.com`, etc. - # If this is set, it must be an exact match with - # {::Google::Cloud::Retail::V2::UserEvent#entity UserEvent.entity} to get - # per-entity autocomplete results. This field will be applied to - # `completion_results` only. It has no effect on the `attribute_results`. - # Also, this entity should be limited to 256 characters, if too long, it will - # be truncated to 256 characters in both generation and serving time, and may - # lead to mis-match. To ensure it works, please set the entity with string - # within 256 characters. - class CompleteQueryRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Response of the autocomplete query. - # @!attribute [rw] completion_results - # @return [::Array<::Google::Cloud::Retail::V2::CompleteQueryResponse::CompletionResult>] - # Results of the matching suggestions. The result list is ordered and the - # first result is top suggestion. - # @!attribute [rw] attribution_token - # @return [::String] - # A unique complete token. This should be included in the - # {::Google::Cloud::Retail::V2::UserEvent#completion_detail UserEvent.completion_detail} - # for search events resulting from this completion, which enables accurate - # attribution of complete model performance. - # @!attribute [rw] recent_search_results - # @deprecated This field is deprecated and may be removed in the next major version update. - # @return [::Array<::Google::Cloud::Retail::V2::CompleteQueryResponse::RecentSearchResult>] - # Deprecated. Matched recent searches of this user. The maximum number of - # recent searches is 10. This field is a restricted feature. If you want to - # enable it, contact Retail Search support. - # - # This feature is only available when - # {::Google::Cloud::Retail::V2::CompleteQueryRequest#visitor_id CompleteQueryRequest.visitor_id} - # field is set and {::Google::Cloud::Retail::V2::UserEvent UserEvent} is imported. - # The recent searches satisfy the follow rules: - # - # * They are ordered from latest to oldest. - # - # * They are matched with - # {::Google::Cloud::Retail::V2::CompleteQueryRequest#query CompleteQueryRequest.query} - # case insensitively. - # - # * They are transformed to lower case. - # - # * They are UTF-8 safe. - # - # Recent searches are deduplicated. More recent searches will be reserved - # when duplication happens. - # @!attribute [rw] attribute_results - # @return [::Google::Protobuf::Map{::String => ::Google::Cloud::Retail::V2::CompleteQueryResponse::AttributeResult}] - # A map of matched attribute suggestions. This field is only available for - # `cloud-retail` dataset. - # - # Current supported keys: - # - # * `brands` - # - # * `categories` - class CompleteQueryResponse - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - - # Resource that represents completion results. - # @!attribute [rw] suggestion - # @return [::String] - # The suggestion for the query. - # @!attribute [rw] attributes - # @return [::Google::Protobuf::Map{::String => ::Google::Cloud::Retail::V2::CustomAttribute}] - # Custom attributes for the suggestion term. - # - # * For `user-data`, the attributes are additional custom attributes - # ingested through BigQuery. - # - # * For `cloud-retail`, the attributes are product attributes generated - # by Cloud Retail. It requires - # {::Google::Cloud::Retail::V2::UserEvent#product_details UserEvent.product_details} - # is imported properly. - class CompletionResult - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - - # @!attribute [rw] key - # @return [::String] - # @!attribute [rw] value - # @return [::Google::Cloud::Retail::V2::CustomAttribute] - class AttributesEntry - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - end - - # Deprecated: Recent search of this user. - # @deprecated This message is deprecated and may be removed in the next major version update. - # @!attribute [rw] recent_search - # @return [::String] - # The recent search query. - class RecentSearchResult - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Resource that represents attribute results. - # @!attribute [rw] suggestions - # @return [::Array<::String>] - # The list of suggestions for the attribute. - class AttributeResult - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # @!attribute [rw] key - # @return [::String] - # @!attribute [rw] value - # @return [::Google::Cloud::Retail::V2::CompleteQueryResponse::AttributeResult] - class AttributeResultsEntry - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - end - end - end - end -end diff --git a/owl-bot-staging/google-cloud-retail-v2/proto_docs/google/cloud/retail/v2/control.rb b/owl-bot-staging/google-cloud-retail-v2/proto_docs/google/cloud/retail/v2/control.rb deleted file mode 100644 index 8a377de74e6d..000000000000 --- a/owl-bot-staging/google-cloud-retail-v2/proto_docs/google/cloud/retail/v2/control.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 Cloud - module Retail - module V2 - # Configures dynamic metadata that can be linked to a - # {::Google::Cloud::Retail::V2::ServingConfig ServingConfig} and affect search or - # recommendation results at serving time. - # @!attribute [rw] rule - # @return [::Google::Cloud::Retail::V2::Rule] - # A rule control - a condition-action pair. - # Enacts a set action when the condition is triggered. - # For example: Boost "gShoe" when query full matches "Running Shoes". - # @!attribute [rw] name - # @return [::String] - # Immutable. Fully qualified name - # `projects/*/locations/global/catalogs/*/controls/*` - # @!attribute [rw] display_name - # @return [::String] - # Required. The human readable control display name. Used in Retail UI. - # - # This field must be a UTF-8 encoded string with a length limit of 128 - # characters. Otherwise, an INVALID_ARGUMENT error is thrown. - # @!attribute [r] associated_serving_config_ids - # @return [::Array<::String>] - # Output only. List of {::Google::Cloud::Retail::V2::ServingConfig serving config} - # ids that are associated with this control in the same - # {::Google::Cloud::Retail::V2::Catalog Catalog}. - # - # Note the association is managed via the - # {::Google::Cloud::Retail::V2::ServingConfig ServingConfig}, this is an output - # only denormalized view. - # @!attribute [rw] solution_types - # @return [::Array<::Google::Cloud::Retail::V2::SolutionType>] - # Required. Immutable. The solution types that the control is used for. - # Currently we support setting only one type of solution at creation time. - # - # Only `SOLUTION_TYPE_SEARCH` value is supported at the moment. - # If no solution type is provided at creation time, will default to - # {::Google::Cloud::Retail::V2::SolutionType::SOLUTION_TYPE_SEARCH SOLUTION_TYPE_SEARCH}. - # @!attribute [rw] search_solution_use_case - # @return [::Array<::Google::Cloud::Retail::V2::SearchSolutionUseCase>] - # Specifies the use case for the control. - # Affects what condition fields can be set. - # Only settable by search controls. - # Will default to - # {::Google::Cloud::Retail::V2::SearchSolutionUseCase::SEARCH_SOLUTION_USE_CASE_SEARCH SEARCH_SOLUTION_USE_CASE_SEARCH} - # if not specified. Currently only allow one search_solution_use_case per - # control. - class Control - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - end - end - end -end diff --git a/owl-bot-staging/google-cloud-retail-v2/proto_docs/google/cloud/retail/v2/control_service.rb b/owl-bot-staging/google-cloud-retail-v2/proto_docs/google/cloud/retail/v2/control_service.rb deleted file mode 100644 index 317de6e4a175..000000000000 --- a/owl-bot-staging/google-cloud-retail-v2/proto_docs/google/cloud/retail/v2/control_service.rb +++ /dev/null @@ -1,122 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - - -module Google - module Cloud - module Retail - module V2 - # Request for CreateControl method. - # @!attribute [rw] parent - # @return [::String] - # Required. Full resource name of parent catalog. Format: - # `projects/{project_number}/locations/{location_id}/catalogs/{catalog_id}` - # @!attribute [rw] control - # @return [::Google::Cloud::Retail::V2::Control] - # Required. The Control to create. - # @!attribute [rw] control_id - # @return [::String] - # Required. The ID to use for the Control, which will become the final - # component of the Control's resource name. - # - # This value should be 4-63 characters, and valid characters - # are /[a-z][0-9]-_/. - class CreateControlRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Request for UpdateControl method. - # @!attribute [rw] control - # @return [::Google::Cloud::Retail::V2::Control] - # Required. The Control to update. - # @!attribute [rw] update_mask - # @return [::Google::Protobuf::FieldMask] - # Indicates which fields in the provided - # {::Google::Cloud::Retail::V2::Control Control} to update. The following are NOT - # supported: - # - # * {::Google::Cloud::Retail::V2::Control#name Control.name} - # - # If not set or empty, all supported fields are updated. - class UpdateControlRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Request for DeleteControl method. - # @!attribute [rw] name - # @return [::String] - # Required. The resource name of the Control to delete. Format: - # `projects/{project_number}/locations/{location_id}/catalogs/{catalog_id}/controls/{control_id}` - class DeleteControlRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Request for GetControl method. - # @!attribute [rw] name - # @return [::String] - # Required. The resource name of the Control to get. Format: - # `projects/{project_number}/locations/{location_id}/catalogs/{catalog_id}/controls/{control_id}` - class GetControlRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Request for ListControls method. - # @!attribute [rw] parent - # @return [::String] - # Required. The catalog resource name. Format: - # `projects/{project_number}/locations/{location_id}/catalogs/{catalog_id}` - # @!attribute [rw] page_size - # @return [::Integer] - # Optional. Maximum number of results to return. If unspecified, defaults - # to 50. Max allowed value is 1000. - # @!attribute [rw] page_token - # @return [::String] - # Optional. A page token, received from a previous `ListControls` call. - # Provide this to retrieve the subsequent page. - # @!attribute [rw] filter - # @return [::String] - # Optional. A filter to apply on the list results. Supported features: - # - # * List all the products under the parent branch if - # {::Google::Cloud::Retail::V2::ListControlsRequest#filter filter} is unset. - # * List controls that are used in a single ServingConfig: - # 'serving_config = "boosted_home_page_cvr"' - class ListControlsRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Response for ListControls method. - # @!attribute [rw] controls - # @return [::Array<::Google::Cloud::Retail::V2::Control>] - # All the Controls for a given catalog. - # @!attribute [rw] next_page_token - # @return [::String] - # Pagination token, if not returned indicates the last page. - class ListControlsResponse - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - end - end - end -end diff --git a/owl-bot-staging/google-cloud-retail-v2/proto_docs/google/cloud/retail/v2/conversational_search_service.rb b/owl-bot-staging/google-cloud-retail-v2/proto_docs/google/cloud/retail/v2/conversational_search_service.rb deleted file mode 100644 index 5d3753d8f9ec..000000000000 --- a/owl-bot-staging/google-cloud-retail-v2/proto_docs/google/cloud/retail/v2/conversational_search_service.rb +++ /dev/null @@ -1,358 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - - -module Google - module Cloud - module Retail - module V2 - # Request message for - # {::Google::Cloud::Retail::V2::ConversationalSearchService::Client#conversational_search ConversationalSearchService.ConversationalSearch} - # method. - # @!attribute [rw] placement - # @return [::String] - # Required. The resource name of the search engine placement, such as - # `projects/*/locations/global/catalogs/default_catalog/placements/default_search` - # or - # `projects/*/locations/global/catalogs/default_catalog/servingConfigs/default_serving_config` - # This field is used to identify the serving config name and the set - # of models that will be used to make the search. - # @!attribute [rw] branch - # @return [::String] - # Required. The branch resource name, such as - # `projects/*/locations/global/catalogs/default_catalog/branches/0`. - # - # Use "default_branch" as the branch ID or leave this field empty, to search - # products under the default branch. - # @!attribute [rw] query - # @return [::String] - # Optional. Raw search query to be searched for. - # - # If this field is empty, the request is considered a category browsing - # request. - # @!attribute [rw] page_categories - # @return [::Array<::String>] - # Optional. The categories associated with a category page. Must be set for - # category navigation queries to achieve good search quality. The format - # should be the same as - # {::Google::Cloud::Retail::V2::UserEvent#page_categories UserEvent.page_categories}; - # - # To represent full path of category, use '>' sign to separate different - # hierarchies. If '>' is part of the category name, replace it with - # other character(s). - # - # Category pages include special pages such as sales or promotions. For - # instance, a special sale page may have the category hierarchy: - # "pageCategories" : ["Sales > 2017 Black Friday Deals"]. - # @!attribute [rw] conversation_id - # @return [::String] - # Optional. This field specifies the conversation id, which maintains the - # state of the conversation between client side and server side. Use the - # value from the previous - # {::Google::Cloud::Retail::V2::ConversationalSearchResponse#conversation_id ConversationalSearchResponse.conversation_id}. - # For the initial request, this should be empty. - # @!attribute [rw] search_params - # @return [::Google::Cloud::Retail::V2::ConversationalSearchRequest::SearchParams] - # Optional. Search parameters. - # @!attribute [rw] visitor_id - # @return [::String] - # Required. A unique identifier for tracking visitors. For example, this - # could be implemented with an HTTP cookie, which should be able to uniquely - # identify a visitor on a single device. This unique identifier should not - # change if the visitor logs in or out of the website. - # - # This should be the same identifier as - # {::Google::Cloud::Retail::V2::UserEvent#visitor_id UserEvent.visitor_id}. - # - # The field must be a UTF-8 encoded string with a length limit of 128 - # characters. Otherwise, an INVALID_ARGUMENT error is returned. - # @!attribute [rw] user_info - # @return [::Google::Cloud::Retail::V2::UserInfo] - # Optional. User information. - # @!attribute [rw] conversational_filtering_spec - # @return [::Google::Cloud::Retail::V2::ConversationalSearchRequest::ConversationalFilteringSpec] - # Optional. This field specifies all conversational filtering related - # parameters. - # @!attribute [rw] user_labels - # @return [::Google::Protobuf::Map{::String => ::String}] - # Optional. The user labels applied to a resource must meet the following - # requirements: - # - # * Each resource can have multiple labels, up to a maximum of 64. - # * Each label must be a key-value pair. - # * Keys have a minimum length of 1 character and a maximum length of 63 - # characters and cannot be empty. Values can be empty and have a maximum - # length of 63 characters. - # * Keys and values can contain only lowercase letters, numeric characters, - # underscores, and dashes. All characters must use UTF-8 encoding, and - # international characters are allowed. - # * The key portion of a label must be unique. However, you can use the same - # key with multiple resources. - # * Keys must start with a lowercase letter or international character. - # - # See [Google Cloud - # Document](https://cloud.google.com/resource-manager/docs/creating-managing-labels#requirements) - # for more details. - # @!attribute [rw] safety_settings - # @return [::Array<::Google::Cloud::Retail::V2::SafetySetting>] - # Optional. The safety settings to be applied to the generated content. - class ConversationalSearchRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - - # Search parameters. - # @!attribute [rw] filter - # @return [::String] - # Optional. The filter string to restrict search results. - # - # The syntax of the filter string is the same as - # {::Google::Cloud::Retail::V2::SearchRequest#filter SearchRequest.filter}. - # @!attribute [rw] canonical_filter - # @return [::String] - # Optional. The canonical filter string to restrict search results. - # - # The syntax of the canonical filter string is the same as - # {::Google::Cloud::Retail::V2::SearchRequest#canonical_filter SearchRequest.canonical_filter}. - # @!attribute [rw] sort_by - # @return [::String] - # Optional. The sort string to specify the sorting of search results. - # - # The syntax of the sort string is the same as - # [SearchRequest.sort][]. - # @!attribute [rw] boost_spec - # @return [::Google::Cloud::Retail::V2::SearchRequest::BoostSpec] - # Optional. The boost spec to specify the boosting of search results. - # - # The syntax of the boost spec is the same as - # {::Google::Cloud::Retail::V2::SearchRequest#boost_spec SearchRequest.boost_spec}. - class SearchParams - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # This field specifies the current user answer during the conversational - # filtering search. This can be either user selected from suggested answers - # or user input plain text. - # @!attribute [rw] text_answer - # @return [::String] - # This field specifies the incremental input text from the user during - # the conversational search. - # - # Note: The following fields are mutually exclusive: `text_answer`, `selected_answer`. If a field in that set is populated, all other fields in the set will automatically be cleared. - # @!attribute [rw] selected_answer - # @return [::Google::Cloud::Retail::V2::ConversationalSearchRequest::UserAnswer::SelectedAnswer] - # Optional. This field specifies the selected answer during the - # conversational search. This should be a subset of - # [ConversationalSearchResponse.followup_question.suggested_answers][]. - # - # Note: The following fields are mutually exclusive: `selected_answer`, `text_answer`. If a field in that set is populated, all other fields in the set will automatically be cleared. - class UserAnswer - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - - # This field specifies the selected answers during the conversational - # search. - # @!attribute [rw] product_attribute_value - # @return [::Google::Cloud::Retail::V2::ProductAttributeValue] - # Optional. This field specifies the selected answer which is a attribute - # key-value. - class SelectedAnswer - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - end - - # This field specifies all conversational filtering related parameters - # addition to conversational retail search. - # @!attribute [rw] enable_conversational_filtering - # @deprecated This field is deprecated and may be removed in the next major version update. - # @return [::Boolean] - # Optional. This field is deprecated. Please use - # {::Google::Cloud::Retail::V2::ConversationalSearchRequest::ConversationalFilteringSpec#conversational_filtering_mode ConversationalFilteringSpec.conversational_filtering_mode} - # instead. - # @!attribute [rw] user_answer - # @return [::Google::Cloud::Retail::V2::ConversationalSearchRequest::UserAnswer] - # Optional. This field specifies the current user answer during the - # conversational filtering search. It can be either user selected from - # suggested answers or user input plain text. - # @!attribute [rw] conversational_filtering_mode - # @return [::Google::Cloud::Retail::V2::ConversationalSearchRequest::ConversationalFilteringSpec::Mode] - # Optional. Mode to control Conversational Filtering. - # Defaults to - # {::Google::Cloud::Retail::V2::ConversationalSearchRequest::ConversationalFilteringSpec::Mode::DISABLED Mode.DISABLED} - # if it's unset. - class ConversationalFilteringSpec - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - - # Enum to control Conversational Filtering mode. - # A single conversation session including multiple turns supports modes for - # Conversational Search OR Conversational Filtering without - # Conversational Search, but not both. - module Mode - # Default value. - MODE_UNSPECIFIED = 0 - - # Disables Conversational Filtering when using Conversational Search. - DISABLED = 1 - - # Enables Conversational Filtering when using Conversational Search. - ENABLED = 2 - - # Enables Conversational Filtering without Conversational Search. - CONVERSATIONAL_FILTER_ONLY = 3 - end - end - - # @!attribute [rw] key - # @return [::String] - # @!attribute [rw] value - # @return [::String] - class UserLabelsEntry - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - end - - # Response message for - # {::Google::Cloud::Retail::V2::ConversationalSearchService::Client#conversational_search ConversationalSearchService.ConversationalSearch} - # method. - # @!attribute [rw] user_query_types - # @return [::Array<::String>] - # The types Retail classifies the search query as. - # - # Supported values are: - # - # - "ORDER_SUPPORT" - # - "SIMPLE_PRODUCT_SEARCH" - # - "INTENT_REFINEMENT" - # - "PRODUCT_DETAILS" - # - "PRODUCT_COMPARISON" - # - "DEALS_AND_COUPONS" - # - "STORE_RELEVANT" - # - "BLOCKLISTED" - # - "BEST_PRODUCT" - # - "RETAIL_SUPPORT" - # - "DISABLED" - # @!attribute [rw] conversational_text_response - # @return [::String] - # The conversational answer-based text response generated by the Server. - # @!attribute [rw] followup_question - # @return [::Google::Cloud::Retail::V2::ConversationalSearchResponse::FollowupQuestion] - # The conversational followup question generated for Intent refinement. - # @!attribute [rw] conversation_id - # @return [::String] - # Conversation UUID. This field will be stored in client side storage to - # maintain the conversation session with server and will be used for next - # search request's - # {::Google::Cloud::Retail::V2::ConversationalSearchRequest#conversation_id ConversationalSearchRequest.conversation_id} - # to restore conversation state in server. - # @!attribute [rw] refined_search - # @return [::Array<::Google::Cloud::Retail::V2::ConversationalSearchResponse::RefinedSearch>] - # The proposed refined search queries. They can be used to fetch the relevant - # search results. When using CONVERSATIONAL_FILTER_ONLY mode, the - # refined_query from search response will be populated here. - # @!attribute [rw] conversational_filtering_result - # @return [::Google::Cloud::Retail::V2::ConversationalSearchResponse::ConversationalFilteringResult] - # This field specifies all related information that is needed on client - # side for UI rendering of conversational filtering search. - # @!attribute [r] state - # @return [::Google::Cloud::Retail::V2::ConversationalSearchResponse::State] - # Output only. The state of the response generation. - class ConversationalSearchResponse - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - - # The conversational followup question generated for Intent refinement. - # @!attribute [rw] followup_question - # @return [::String] - # The conversational followup question generated for Intent refinement. - # @!attribute [rw] suggested_answers - # @return [::Array<::Google::Cloud::Retail::V2::ConversationalSearchResponse::FollowupQuestion::SuggestedAnswer>] - # The answer options provided to client for the follow-up question. - class FollowupQuestion - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - - # Suggested answers to the follow-up question. - # If it's numerical attribute, only ProductAttributeInterval will be set. - # If it's textual attribute, only productAttributeValue will be set. - # @!attribute [rw] product_attribute_value - # @return [::Google::Cloud::Retail::V2::ProductAttributeValue] - # Product attribute value, including an attribute key and an - # attribute value. Other types can be added here in the future. - class SuggestedAnswer - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - end - - # The proposed refined search for intent-refinement/bundled shopping - # conversation. When using CONVERSATIONAL_FILTER_ONLY mode, the - # refined_query from search response will be populated here. - # @!attribute [rw] query - # @return [::String] - # The query to be used for search. - class RefinedSearch - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # This field specifies all related information that is needed on client - # side for UI rendering of conversational filtering search. - # @!attribute [rw] followup_question - # @return [::Google::Cloud::Retail::V2::ConversationalSearchResponse::FollowupQuestion] - # The conversational filtering question. - # @!attribute [rw] additional_filter - # @return [::Google::Cloud::Retail::V2::ConversationalSearchResponse::ConversationalFilteringResult::AdditionalFilter] - # This is the incremental additional filters implied from the current - # user answer. User should add the suggested addition filters to the - # previous [ConversationalSearchRequest.search_params.filter][] and - # {::Google::Cloud::Retail::V2::SearchRequest#filter SearchRequest.filter}, and - # use the merged filter in the follow up requests. - class ConversationalFilteringResult - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - - # Additional filter that client side need to apply. - # @!attribute [rw] product_attribute_value - # @return [::Google::Cloud::Retail::V2::ProductAttributeValue] - # Product attribute value, including an attribute key and an - # attribute value. Other types can be added here in the future. - class AdditionalFilter - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - end - - # The state of the response generation. - module State - # Unknown. - STATE_UNSPECIFIED = 0 - - # Response generation is being streamed. - STREAMING = 1 - - # Response generation has succeeded. - SUCCEEDED = 2 - end - end - end - end - end -end diff --git a/owl-bot-staging/google-cloud-retail-v2/proto_docs/google/cloud/retail/v2/export_config.rb b/owl-bot-staging/google-cloud-retail-v2/proto_docs/google/cloud/retail/v2/export_config.rb deleted file mode 100644 index 913e07ef4121..000000000000 --- a/owl-bot-staging/google-cloud-retail-v2/proto_docs/google/cloud/retail/v2/export_config.rb +++ /dev/null @@ -1,184 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - - -module Google - module Cloud - module Retail - module V2 - # The output configuration setting. - # @!attribute [rw] gcs_destination - # @return [::Google::Cloud::Retail::V2::OutputConfig::GcsDestination] - # The Google Cloud Storage location where the output is to be written to. - # - # Note: The following fields are mutually exclusive: `gcs_destination`, `bigquery_destination`. If a field in that set is populated, all other fields in the set will automatically be cleared. - # @!attribute [rw] bigquery_destination - # @return [::Google::Cloud::Retail::V2::OutputConfig::BigQueryDestination] - # The BigQuery location where the output is to be written to. - # - # Note: The following fields are mutually exclusive: `bigquery_destination`, `gcs_destination`. If a field in that set is populated, all other fields in the set will automatically be cleared. - class OutputConfig - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - - # The Google Cloud Storage output destination configuration. - # @!attribute [rw] output_uri_prefix - # @return [::String] - # Required. The output uri prefix for saving output data to json files. - # Some mapping examples are as follows: - # output_uri_prefix sample output(assuming the object is foo.json) - # ======================== ============================================= - # gs://bucket/ gs://bucket/foo.json - # gs://bucket/folder/ gs://bucket/folder/foo.json - # gs://bucket/folder/item_ gs://bucket/folder/item_foo.json - class GcsDestination - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # The BigQuery output destination configuration. - # @!attribute [rw] dataset_id - # @return [::String] - # Required. The ID of a BigQuery Dataset. - # @!attribute [rw] table_id_prefix - # @return [::String] - # Required. The prefix of exported BigQuery tables. - # @!attribute [rw] table_type - # @return [::String] - # Required. Describes the table type. The following values are supported: - # - # * `table`: A BigQuery native table. - # * `view`: A virtual table defined by a SQL query. - class BigQueryDestination - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - end - - # Configuration of destination for Export related errors. - # @!attribute [rw] gcs_prefix - # @return [::String] - # Google Cloud Storage path for import errors. This must be an empty, - # existing Cloud Storage bucket. Export errors will be written to a file in - # this bucket, one per line, as a JSON-encoded - # `google.rpc.Status` message. - class ExportErrorsConfig - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Request message for the `ExportAnalyticsMetrics` method. - # @!attribute [rw] catalog - # @return [::String] - # Required. Full resource name of the parent catalog. - # Expected format: `projects/*/locations/*/catalogs/*` - # @!attribute [rw] output_config - # @return [::Google::Cloud::Retail::V2::OutputConfig] - # Required. The output location of the data. - # @!attribute [rw] filter - # @return [::String] - # A filtering expression to specify restrictions on returned metrics. - # The expression is a sequence of terms. Each term applies a restriction to - # the returned metrics. Use this expression to restrict results to a - # specific time range. - # - # Currently we expect only one types of fields: - # - # * `timestamp`: This can be specified twice, once with a - # less than operator and once with a greater than operator. The - # `timestamp` restriction should result in one, contiguous, valid, - # `timestamp` range. - # - # Some examples of valid filters expressions: - # - # * Example 1: `timestamp > "2012-04-23T18:25:43.511Z" - # timestamp < "2012-04-23T18:30:43.511Z"` - # * Example 2: `timestamp > "2012-04-23T18:25:43.511Z"` - class ExportAnalyticsMetricsRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Metadata related to the progress of the Export operation. This is - # returned by the google.longrunning.Operation.metadata field. - # @!attribute [rw] create_time - # @return [::Google::Protobuf::Timestamp] - # Operation create time. - # @!attribute [rw] update_time - # @return [::Google::Protobuf::Timestamp] - # Operation last update time. If the operation is done, this is also the - # finish time. - class ExportMetadata - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Response of the ExportAnalyticsMetricsRequest. If the long running - # operation was successful, then this message is returned by the - # google.longrunning.Operations.response field if the operation was successful. - # @!attribute [rw] error_samples - # @return [::Array<::Google::Rpc::Status>] - # A sample of errors encountered while processing the request. - # @!attribute [rw] errors_config - # @return [::Google::Cloud::Retail::V2::ExportErrorsConfig] - # This field is never set. - # @!attribute [rw] output_result - # @return [::Google::Cloud::Retail::V2::OutputResult] - # Output result indicating where the data were exported to. - class ExportAnalyticsMetricsResponse - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Output result that stores the information about where the exported data is - # stored. - # @!attribute [rw] bigquery_result - # @return [::Array<::Google::Cloud::Retail::V2::BigQueryOutputResult>] - # The BigQuery location where the result is stored. - # @!attribute [rw] gcs_result - # @return [::Array<::Google::Cloud::Retail::V2::GcsOutputResult>] - # The Google Cloud Storage location where the result is stored. - class OutputResult - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # A BigQuery output result. - # @!attribute [rw] dataset_id - # @return [::String] - # The ID of a BigQuery Dataset. - # @!attribute [rw] table_id - # @return [::String] - # The ID of a BigQuery Table. - class BigQueryOutputResult - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # A Gcs output result. - # @!attribute [rw] output_uri - # @return [::String] - # The uri of Gcs output - class GcsOutputResult - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - end - end - end -end diff --git a/owl-bot-staging/google-cloud-retail-v2/proto_docs/google/cloud/retail/v2/generative_question.rb b/owl-bot-staging/google-cloud-retail-v2/proto_docs/google/cloud/retail/v2/generative_question.rb deleted file mode 100644 index 7a58a54f8f3c..000000000000 --- a/owl-bot-staging/google-cloud-retail-v2/proto_docs/google/cloud/retail/v2/generative_question.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 Cloud - module Retail - module V2 - # Configuration for overall generative question feature state. - # @!attribute [rw] catalog - # @return [::String] - # Required. Resource name of the affected catalog. - # Format: projects/\\{project}/locations/\\{location}/catalogs/\\{catalog} - # @!attribute [rw] feature_enabled - # @return [::Boolean] - # Optional. Determines whether questions will be used at serving time. - # Note: This feature cannot be enabled until initial data requirements are - # satisfied. - # @!attribute [rw] minimum_products - # @return [::Integer] - # Optional. Minimum number of products in the response to trigger follow-up - # questions. Value must be 0 or positive. - class GenerativeQuestionsFeatureConfig - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Configuration for a single generated question. - # @!attribute [rw] catalog - # @return [::String] - # Required. Resource name of the catalog. - # Format: projects/\\{project}/locations/\\{location}/catalogs/\\{catalog} - # @!attribute [rw] facet - # @return [::String] - # Required. The facet to which the question is associated. - # @!attribute [r] generated_question - # @return [::String] - # Output only. The LLM generated question. - # @!attribute [rw] final_question - # @return [::String] - # Optional. The question that will be used at serving time. - # Question can have a max length of 300 bytes. - # When not populated, generated_question should be used. - # @!attribute [r] example_values - # @return [::Array<::String>] - # Output only. Values that can be used to answer the question. - # @!attribute [r] frequency - # @return [::Float] - # Output only. The ratio of how often a question was asked. - # @!attribute [rw] allowed_in_conversation - # @return [::Boolean] - # Optional. Whether the question is asked at serving time. - class GenerativeQuestionConfig - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - end - end - end -end diff --git a/owl-bot-staging/google-cloud-retail-v2/proto_docs/google/cloud/retail/v2/generative_question_service.rb b/owl-bot-staging/google-cloud-retail-v2/proto_docs/google/cloud/retail/v2/generative_question_service.rb deleted file mode 100644 index dcd3144bc211..000000000000 --- a/owl-bot-staging/google-cloud-retail-v2/proto_docs/google/cloud/retail/v2/generative_question_service.rb +++ /dev/null @@ -1,109 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - - -module Google - module Cloud - module Retail - module V2 - # Request for UpdateGenerativeQuestionsFeatureConfig method. - # @!attribute [rw] generative_questions_feature_config - # @return [::Google::Cloud::Retail::V2::GenerativeQuestionsFeatureConfig] - # Required. The configuration managing the feature state. - # @!attribute [rw] update_mask - # @return [::Google::Protobuf::FieldMask] - # Optional. Indicates which fields in the provided - # {::Google::Cloud::Retail::V2::GenerativeQuestionsFeatureConfig GenerativeQuestionsFeatureConfig} - # to update. If not set or empty, all supported fields are updated. - class UpdateGenerativeQuestionsFeatureConfigRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Request for GetGenerativeQuestionsFeatureConfig method. - # @!attribute [rw] catalog - # @return [::String] - # Required. Resource name of the parent catalog. - # Format: projects/\\{project}/locations/\\{location}/catalogs/\\{catalog} - class GetGenerativeQuestionsFeatureConfigRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Request for ListQuestions method. - # @!attribute [rw] parent - # @return [::String] - # Required. Resource name of the parent catalog. - # Format: projects/\\{project}/locations/\\{location}/catalogs/\\{catalog} - class ListGenerativeQuestionConfigsRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Response for ListQuestions method. - # @!attribute [rw] generative_question_configs - # @return [::Array<::Google::Cloud::Retail::V2::GenerativeQuestionConfig>] - # All the questions for a given catalog. - class ListGenerativeQuestionConfigsResponse - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Request for UpdateGenerativeQuestionConfig method. - # @!attribute [rw] generative_question_config - # @return [::Google::Cloud::Retail::V2::GenerativeQuestionConfig] - # Required. The question to update. - # @!attribute [rw] update_mask - # @return [::Google::Protobuf::FieldMask] - # Optional. Indicates which fields in the provided - # {::Google::Cloud::Retail::V2::GenerativeQuestionConfig GenerativeQuestionConfig} - # to update. The following are NOT supported: - # - # * {::Google::Cloud::Retail::V2::GenerativeQuestionConfig#frequency GenerativeQuestionConfig.frequency} - # - # If not set or empty, all supported fields are updated. - class UpdateGenerativeQuestionConfigRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Request for BatchUpdateGenerativeQuestionConfig method. - # @!attribute [rw] parent - # @return [::String] - # Optional. Resource name of the parent catalog. - # Format: projects/\\{project}/locations/\\{location}/catalogs/\\{catalog} - # @!attribute [rw] requests - # @return [::Array<::Google::Cloud::Retail::V2::UpdateGenerativeQuestionConfigRequest>] - # Required. The updates question configs. - class BatchUpdateGenerativeQuestionConfigsRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Aggregated response for UpdateGenerativeQuestionConfig method. - # @!attribute [rw] generative_question_configs - # @return [::Array<::Google::Cloud::Retail::V2::GenerativeQuestionConfig>] - # Optional. The updates question configs. - class BatchUpdateGenerativeQuestionConfigsResponse - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - end - end - end -end diff --git a/owl-bot-staging/google-cloud-retail-v2/proto_docs/google/cloud/retail/v2/import_config.rb b/owl-bot-staging/google-cloud-retail-v2/proto_docs/google/cloud/retail/v2/import_config.rb deleted file mode 100644 index e95a50d7e11c..000000000000 --- a/owl-bot-staging/google-cloud-retail-v2/proto_docs/google/cloud/retail/v2/import_config.rb +++ /dev/null @@ -1,404 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - - -module Google - module Cloud - module Retail - module V2 - # Google Cloud Storage location for input content. - # @!attribute [rw] input_uris - # @return [::Array<::String>] - # Required. Google Cloud Storage URIs to input files. URI can be up to - # 2000 characters long. URIs can match the full object path (for example, - # `gs://bucket/directory/object.json`) or a pattern matching one or more - # files, such as `gs://bucket/directory/*.json`. A request can - # contain at most 100 files, and each file can be up to 2 GB. See - # [Importing product - # information](https://cloud.google.com/retail/recommendations-ai/docs/upload-catalog) - # for the expected file format and setup instructions. - # @!attribute [rw] data_schema - # @return [::String] - # The schema to use when parsing the data from the source. - # - # Supported values for product imports: - # - # * `product` (default): One JSON {::Google::Cloud::Retail::V2::Product Product} - # per line. Each product must - # have a valid {::Google::Cloud::Retail::V2::Product#id Product.id}. - # * `product_merchant_center`: See [Importing catalog data from Merchant - # Center](https://cloud.google.com/retail/recommendations-ai/docs/upload-catalog#mc). - # - # Supported values for user events imports: - # - # * `user_event` (default): One JSON - # {::Google::Cloud::Retail::V2::UserEvent UserEvent} per line. - # * `user_event_ga360`: Using - # https://support.google.com/analytics/answer/3437719. - # - # Supported values for control imports: - # - # * `control` (default): One JSON {::Google::Cloud::Retail::V2::Control Control} - # per line. - # - # Supported values for catalog attribute imports: - # - # * `catalog_attribute` (default): One CSV - # {::Google::Cloud::Retail::V2::CatalogAttribute CatalogAttribute} per line. - class GcsSource - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # BigQuery source import data from. - # @!attribute [rw] partition_date - # @return [::Google::Type::Date] - # BigQuery time partitioned table's _PARTITIONDATE in YYYY-MM-DD format. - # @!attribute [rw] project_id - # @return [::String] - # The project ID (can be project # or ID) that the BigQuery source is in with - # a length limit of 128 characters. If not specified, inherits the project - # ID from the parent request. - # @!attribute [rw] dataset_id - # @return [::String] - # Required. The BigQuery data set to copy the data from with a length limit - # of 1,024 characters. - # @!attribute [rw] table_id - # @return [::String] - # Required. The BigQuery table to copy the data from with a length limit of - # 1,024 characters. - # @!attribute [rw] gcs_staging_dir - # @return [::String] - # Intermediate Cloud Storage directory used for the import with a length - # limit of 2,000 characters. Can be specified if one wants to have the - # BigQuery export to a specific Cloud Storage directory. - # @!attribute [rw] data_schema - # @return [::String] - # The schema to use when parsing the data from the source. - # - # Supported values for product imports: - # - # * `product` (default): One JSON {::Google::Cloud::Retail::V2::Product Product} - # per line. Each product must - # have a valid {::Google::Cloud::Retail::V2::Product#id Product.id}. - # * `product_merchant_center`: See [Importing catalog data from Merchant - # Center](https://cloud.google.com/retail/recommendations-ai/docs/upload-catalog#mc). - # - # Supported values for user events imports: - # - # * `user_event` (default): One JSON - # {::Google::Cloud::Retail::V2::UserEvent UserEvent} per line. - # * `user_event_ga360`: - # The schema is available here: - # https://support.google.com/analytics/answer/3437719. - # * `user_event_ga4`: - # The schema is available here: - # https://support.google.com/analytics/answer/7029846. - # - # Supported values for autocomplete imports: - # - # * `suggestions` (default): One JSON completion suggestion per line. - # * `denylist`: One JSON deny suggestion per line. - # * `allowlist`: One JSON allow suggestion per line. - class BigQuerySource - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # The inline source for the input config for ImportProducts method. - # @!attribute [rw] products - # @return [::Array<::Google::Cloud::Retail::V2::Product>] - # Required. A list of products to update/create. Each product must have a - # valid {::Google::Cloud::Retail::V2::Product#id Product.id}. Recommended max of - # 100 items. - class ProductInlineSource - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # The inline source for the input config for ImportUserEvents method. - # @!attribute [rw] user_events - # @return [::Array<::Google::Cloud::Retail::V2::UserEvent>] - # Required. A list of user events to import. Recommended max of 10k items. - class UserEventInlineSource - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Configuration of destination for Import related errors. - # @!attribute [rw] gcs_prefix - # @return [::String] - # Google Cloud Storage prefix for import errors. This must be an empty, - # existing Cloud Storage directory. Import errors are written to - # sharded files in this directory, one per line, as a JSON-encoded - # `google.rpc.Status` message. - class ImportErrorsConfig - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Request message for Import methods. - # @!attribute [rw] parent - # @return [::String] - # Required. - # `projects/1234/locations/global/catalogs/default_catalog/branches/default_branch` - # - # If no updateMask is specified, requires products.create permission. - # If updateMask is specified, requires products.update permission. - # @!attribute [rw] request_id - # @deprecated This field is deprecated and may be removed in the next major version update. - # @return [::String] - # Deprecated. This field has no effect. - # @!attribute [rw] input_config - # @return [::Google::Cloud::Retail::V2::ProductInputConfig] - # Required. The desired input location of the data. - # @!attribute [rw] errors_config - # @return [::Google::Cloud::Retail::V2::ImportErrorsConfig] - # The desired location of errors incurred during the Import. - # @!attribute [rw] update_mask - # @return [::Google::Protobuf::FieldMask] - # Indicates which fields in the provided imported `products` to update. If - # not set, all fields are updated. If provided, only the existing product - # fields are updated. Missing products will not be created. - # @!attribute [rw] reconciliation_mode - # @return [::Google::Cloud::Retail::V2::ImportProductsRequest::ReconciliationMode] - # The mode of reconciliation between existing products and the products to be - # imported. Defaults to - # {::Google::Cloud::Retail::V2::ImportProductsRequest::ReconciliationMode::INCREMENTAL ReconciliationMode.INCREMENTAL}. - # @!attribute [rw] notification_pubsub_topic - # @return [::String] - # Full Pub/Sub topic name for receiving notification. If this field is set, - # when the import is finished, a notification is sent to - # specified Pub/Sub topic. The message data is JSON string of a - # {::Google::Longrunning::Operation Operation}. - # - # Format of the Pub/Sub topic is `projects/{project}/topics/{topic}`. It has - # to be within the same project as - # {::Google::Cloud::Retail::V2::ImportProductsRequest#parent ImportProductsRequest.parent}. - # Make sure that both - # `cloud-retail-customer-data-access@system.gserviceaccount.com` and - # `service-@gcp-sa-retail.iam.gserviceaccount.com` - # have the `pubsub.topics.publish` IAM permission on the topic. - # - # Only supported when - # {::Google::Cloud::Retail::V2::ImportProductsRequest#reconciliation_mode ImportProductsRequest.reconciliation_mode} - # is set to `FULL`. - class ImportProductsRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - - # Indicates how imported products are reconciled with the existing products - # created or imported before. - module ReconciliationMode - # Defaults to INCREMENTAL. - RECONCILIATION_MODE_UNSPECIFIED = 0 - - # Inserts new products or updates existing products. - INCREMENTAL = 1 - - # Calculates diff and replaces the entire product dataset. Existing - # products may be deleted if they are not present in the source location. - FULL = 2 - end - end - - # Request message for the ImportUserEvents request. - # @!attribute [rw] parent - # @return [::String] - # Required. `projects/1234/locations/global/catalogs/default_catalog` - # @!attribute [rw] input_config - # @return [::Google::Cloud::Retail::V2::UserEventInputConfig] - # Required. The desired input location of the data. - # @!attribute [rw] errors_config - # @return [::Google::Cloud::Retail::V2::ImportErrorsConfig] - # The desired location of errors incurred during the Import. Cannot be set - # for inline user event imports. - class ImportUserEventsRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Request message for ImportCompletionData methods. - # @!attribute [rw] parent - # @return [::String] - # Required. The catalog which the suggestions dataset belongs to. - # - # Format: `projects/1234/locations/global/catalogs/default_catalog`. - # @!attribute [rw] input_config - # @return [::Google::Cloud::Retail::V2::CompletionDataInputConfig] - # Required. The desired input location of the data. - # @!attribute [rw] notification_pubsub_topic - # @return [::String] - # Pub/Sub topic for receiving notification. If this field is set, - # when the import is finished, a notification is sent to - # specified Pub/Sub topic. The message data is JSON string of a - # {::Google::Longrunning::Operation Operation}. - # Format of the Pub/Sub topic is `projects/{project}/topics/{topic}`. - class ImportCompletionDataRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # The input config source for products. - # @!attribute [rw] product_inline_source - # @return [::Google::Cloud::Retail::V2::ProductInlineSource] - # The Inline source for the input content for products. - # - # Note: The following fields are mutually exclusive: `product_inline_source`, `gcs_source`, `big_query_source`. If a field in that set is populated, all other fields in the set will automatically be cleared. - # @!attribute [rw] gcs_source - # @return [::Google::Cloud::Retail::V2::GcsSource] - # Google Cloud Storage location for the input content. - # - # Note: The following fields are mutually exclusive: `gcs_source`, `product_inline_source`, `big_query_source`. If a field in that set is populated, all other fields in the set will automatically be cleared. - # @!attribute [rw] big_query_source - # @return [::Google::Cloud::Retail::V2::BigQuerySource] - # BigQuery input source. - # - # Note: The following fields are mutually exclusive: `big_query_source`, `product_inline_source`, `gcs_source`. If a field in that set is populated, all other fields in the set will automatically be cleared. - class ProductInputConfig - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # The input config source for user events. - # @!attribute [rw] user_event_inline_source - # @return [::Google::Cloud::Retail::V2::UserEventInlineSource] - # Required. The Inline source for the input content for UserEvents. - # - # Note: The following fields are mutually exclusive: `user_event_inline_source`, `gcs_source`, `big_query_source`. If a field in that set is populated, all other fields in the set will automatically be cleared. - # @!attribute [rw] gcs_source - # @return [::Google::Cloud::Retail::V2::GcsSource] - # Required. Google Cloud Storage location for the input content. - # - # Note: The following fields are mutually exclusive: `gcs_source`, `user_event_inline_source`, `big_query_source`. If a field in that set is populated, all other fields in the set will automatically be cleared. - # @!attribute [rw] big_query_source - # @return [::Google::Cloud::Retail::V2::BigQuerySource] - # Required. BigQuery input source. - # - # Note: The following fields are mutually exclusive: `big_query_source`, `user_event_inline_source`, `gcs_source`. If a field in that set is populated, all other fields in the set will automatically be cleared. - class UserEventInputConfig - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # The input config source for completion data. - # @!attribute [rw] big_query_source - # @return [::Google::Cloud::Retail::V2::BigQuerySource] - # Required. BigQuery input source. - # - # Add the IAM permission "BigQuery Data Viewer" for - # cloud-retail-customer-data-access@system.gserviceaccount.com before - # using this feature otherwise an error is thrown. - class CompletionDataInputConfig - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Metadata related to the progress of the Import operation. This is - # returned by the google.longrunning.Operation.metadata field. - # @!attribute [rw] create_time - # @return [::Google::Protobuf::Timestamp] - # Operation create time. - # @!attribute [rw] update_time - # @return [::Google::Protobuf::Timestamp] - # Operation last update time. If the operation is done, this is also the - # finish time. - # @!attribute [rw] success_count - # @return [::Integer] - # Count of entries that were processed successfully. - # @!attribute [rw] failure_count - # @return [::Integer] - # Count of entries that encountered errors while processing. - # @!attribute [rw] request_id - # @deprecated This field is deprecated and may be removed in the next major version update. - # @return [::String] - # Deprecated. This field is never set. - # @!attribute [rw] notification_pubsub_topic - # @return [::String] - # Pub/Sub topic for receiving notification. If this field is set, - # when the import is finished, a notification is sent to - # specified Pub/Sub topic. The message data is JSON string of a - # {::Google::Longrunning::Operation Operation}. - # Format of the Pub/Sub topic is `projects/{project}/topics/{topic}`. - class ImportMetadata - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Response of the - # {::Google::Cloud::Retail::V2::ImportProductsRequest ImportProductsRequest}. If the - # long running operation is done, then this message is returned by the - # google.longrunning.Operations.response field if the operation was successful. - # @!attribute [rw] error_samples - # @return [::Array<::Google::Rpc::Status>] - # A sample of errors encountered while processing the request. - # @!attribute [rw] errors_config - # @return [::Google::Cloud::Retail::V2::ImportErrorsConfig] - # Echoes the destination for the complete errors in the request if set. - class ImportProductsResponse - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Response of the ImportUserEventsRequest. If the long running - # operation was successful, then this message is returned by the - # google.longrunning.Operations.response field if the operation was successful. - # @!attribute [rw] error_samples - # @return [::Array<::Google::Rpc::Status>] - # A sample of errors encountered while processing the request. - # @!attribute [rw] errors_config - # @return [::Google::Cloud::Retail::V2::ImportErrorsConfig] - # Echoes the destination for the complete errors if this field was set in - # the request. - # @!attribute [rw] import_summary - # @return [::Google::Cloud::Retail::V2::UserEventImportSummary] - # Aggregated statistics of user event import status. - class ImportUserEventsResponse - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # A summary of import result. The UserEventImportSummary summarizes - # the import status for user events. - # @!attribute [rw] joined_events_count - # @return [::Integer] - # Count of user events imported with complete existing catalog information. - # @!attribute [rw] unjoined_events_count - # @return [::Integer] - # Count of user events imported, but with catalog information not found - # in the imported catalog. - class UserEventImportSummary - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Response of the - # {::Google::Cloud::Retail::V2::ImportCompletionDataRequest ImportCompletionDataRequest}. - # If the long running operation is done, this message is returned by the - # google.longrunning.Operations.response field if the operation is successful. - # @!attribute [rw] error_samples - # @return [::Array<::Google::Rpc::Status>] - # A sample of errors encountered while processing the request. - class ImportCompletionDataResponse - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - end - end - end -end diff --git a/owl-bot-staging/google-cloud-retail-v2/proto_docs/google/cloud/retail/v2/model.rb b/owl-bot-staging/google-cloud-retail-v2/proto_docs/google/cloud/retail/v2/model.rb deleted file mode 100644 index 76ac3160ed3b..000000000000 --- a/owl-bot-staging/google-cloud-retail-v2/proto_docs/google/cloud/retail/v2/model.rb +++ /dev/null @@ -1,267 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - - -module Google - module Cloud - module Retail - module V2 - # Metadata that describes the training and serving parameters of a - # {::Google::Cloud::Retail::V2::Model Model}. A - # {::Google::Cloud::Retail::V2::Model Model} can be associated with a - # {::Google::Cloud::Retail::V2::ServingConfig ServingConfig} and then queried - # through the Predict API. - # @!attribute [rw] name - # @return [::String] - # Required. The fully qualified resource name of the model. - # - # Format: - # `projects/{project_number}/locations/{location_id}/catalogs/{catalog_id}/models/{model_id}` - # catalog_id has char limit of 50. - # recommendation_model_id has char limit of 40. - # @!attribute [rw] display_name - # @return [::String] - # Required. The display name of the model. - # - # Should be human readable, used to display Recommendation Models in the - # Retail Cloud Console Dashboard. UTF-8 encoded string with limit of 1024 - # characters. - # @!attribute [rw] training_state - # @return [::Google::Cloud::Retail::V2::Model::TrainingState] - # Optional. The training state that the model is in (e.g. - # `TRAINING` or `PAUSED`). - # - # Since part of the cost of running the service - # is frequency of training - this can be used to determine when to train - # model in order to control cost. If not specified: the default value for - # `CreateModel` method is `TRAINING`. The default value for - # `UpdateModel` method is to keep the state the same as before. - # @!attribute [r] serving_state - # @return [::Google::Cloud::Retail::V2::Model::ServingState] - # Output only. The serving state of the model: `ACTIVE`, `NOT_ACTIVE`. - # @!attribute [r] create_time - # @return [::Google::Protobuf::Timestamp] - # Output only. Timestamp the Recommendation Model was created at. - # @!attribute [r] update_time - # @return [::Google::Protobuf::Timestamp] - # Output only. Timestamp the Recommendation Model was last updated. E.g. - # if a Recommendation Model was paused - this would be the time the pause was - # initiated. - # @!attribute [rw] type - # @return [::String] - # Required. The type of model e.g. `home-page`. - # - # Currently supported values: `recommended-for-you`, `others-you-may-like`, - # `frequently-bought-together`, `page-optimization`, `similar-items`, - # `buy-it-again`, `on-sale-items`, and `recently-viewed`(readonly value). - # - # This field together with - # {::Google::Cloud::Retail::V2::Model#optimization_objective optimization_objective} - # describe model metadata to use to control model training and serving. - # See https://cloud.google.com/retail/docs/models - # for more details on what the model metadata control and which combination - # of parameters are valid. For invalid combinations of parameters (e.g. type - # = `frequently-bought-together` and optimization_objective = `ctr`), you - # receive an error 400 if you try to create/update a recommendation with - # this set of knobs. - # @!attribute [rw] optimization_objective - # @return [::String] - # Optional. The optimization objective e.g. `cvr`. - # - # Currently supported - # values: `ctr`, `cvr`, `revenue-per-order`. - # - # If not specified, we choose default based on model type. - # Default depends on type of recommendation: - # - # `recommended-for-you` => `ctr` - # - # `others-you-may-like` => `ctr` - # - # `frequently-bought-together` => `revenue_per_order` - # - # This field together with - # {::Google::Cloud::Retail::V2::Model#type optimization_objective} - # describe model metadata to use to control model training and serving. - # See https://cloud.google.com/retail/docs/models - # for more details on what the model metadata control and which combination - # of parameters are valid. For invalid combinations of parameters (e.g. type - # = `frequently-bought-together` and optimization_objective = `ctr`), you - # receive an error 400 if you try to create/update a recommendation with - # this set of knobs. - # @!attribute [rw] periodic_tuning_state - # @return [::Google::Cloud::Retail::V2::Model::PeriodicTuningState] - # Optional. The state of periodic tuning. - # - # The period we use is 3 months - to do a - # one-off tune earlier use the `TuneModel` method. Default value - # is `PERIODIC_TUNING_ENABLED`. - # @!attribute [r] last_tune_time - # @return [::Google::Protobuf::Timestamp] - # Output only. The timestamp when the latest successful tune finished. - # @!attribute [r] tuning_operation - # @return [::String] - # Output only. The tune operation associated with the model. - # - # Can be used to determine if there is an ongoing tune for this - # recommendation. Empty field implies no tune is goig on. - # @!attribute [r] data_state - # @return [::Google::Cloud::Retail::V2::Model::DataState] - # Output only. The state of data requirements for this model: `DATA_OK` and - # `DATA_ERROR`. - # - # Recommendation model cannot be trained if the data is in - # `DATA_ERROR` state. Recommendation model can have `DATA_ERROR` state even - # if serving state is `ACTIVE`: models were trained successfully before, but - # cannot be refreshed because model no longer has sufficient - # data for training. - # @!attribute [rw] filtering_option - # @return [::Google::Cloud::Retail::V2::RecommendationsFilteringOption] - # Optional. If `RECOMMENDATIONS_FILTERING_ENABLED`, recommendation filtering - # by attributes is enabled for the model. - # @!attribute [r] serving_config_lists - # @return [::Array<::Google::Cloud::Retail::V2::Model::ServingConfigList>] - # Output only. The list of valid serving configs associated with the - # PageOptimizationConfig. - # @!attribute [rw] model_features_config - # @return [::Google::Cloud::Retail::V2::Model::ModelFeaturesConfig] - # Optional. Additional model features config. - class Model - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - - # Represents an ordered combination of valid serving configs, which - # can be used for `PAGE_OPTIMIZATION` recommendations. - # @!attribute [rw] serving_config_ids - # @return [::Array<::String>] - # Optional. A set of valid serving configs that may be used for - # `PAGE_OPTIMIZATION`. - class ServingConfigList - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Additional configs for the frequently-bought-together model type. - # @!attribute [rw] context_products_type - # @return [::Google::Cloud::Retail::V2::Model::ContextProductsType] - # Optional. Specifies the context of the model when it is used in predict - # requests. Can only be set for the `frequently-bought-together` type. If - # it isn't specified, it defaults to - # {::Google::Cloud::Retail::V2::Model::ContextProductsType::MULTIPLE_CONTEXT_PRODUCTS MULTIPLE_CONTEXT_PRODUCTS}. - class FrequentlyBoughtTogetherFeaturesConfig - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Additional model features config. - # @!attribute [rw] frequently_bought_together_config - # @return [::Google::Cloud::Retail::V2::Model::FrequentlyBoughtTogetherFeaturesConfig] - # Additional configs for frequently-bought-together models. - class ModelFeaturesConfig - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # The serving state of the model. - module ServingState - # Unspecified serving state. - SERVING_STATE_UNSPECIFIED = 0 - - # The model is not serving. - INACTIVE = 1 - - # The model is serving and can be queried. - ACTIVE = 2 - - # The model is trained on tuned hyperparameters and can be - # queried. - TUNED = 3 - end - - # The training state of the model. - module TrainingState - # Unspecified training state. - TRAINING_STATE_UNSPECIFIED = 0 - - # The model training is paused. - PAUSED = 1 - - # The model is training. - TRAINING = 2 - end - - # Describes whether periodic tuning is enabled for this model - # or not. Periodic tuning is scheduled at most every three months. You can - # start a tuning process manually by using the `TuneModel` - # method, which starts a tuning process immediately and resets the quarterly - # schedule. Enabling or disabling periodic tuning does not affect any - # current tuning processes. - module PeriodicTuningState - # Unspecified default value, should never be explicitly set. - PERIODIC_TUNING_STATE_UNSPECIFIED = 0 - - # The model has periodic tuning disabled. Tuning - # can be reenabled by calling the `EnableModelPeriodicTuning` - # method or by calling the `TuneModel` method. - PERIODIC_TUNING_DISABLED = 1 - - # The model cannot be tuned with periodic tuning OR the - # `TuneModel` method. Hide the options in customer UI and - # reject any requests through the backend self serve API. - ALL_TUNING_DISABLED = 3 - - # The model has periodic tuning enabled. Tuning - # can be disabled by calling the `DisableModelPeriodicTuning` - # method. - PERIODIC_TUNING_ENABLED = 2 - end - - # Describes whether this model have sufficient training data - # to be continuously trained. - module DataState - # Unspecified default value, should never be explicitly set. - DATA_STATE_UNSPECIFIED = 0 - - # The model has sufficient training data. - DATA_OK = 1 - - # The model does not have sufficient training data. Error - # messages can be queried via Stackdriver. - DATA_ERROR = 2 - end - - # Use single or multiple context products for recommendations. - module ContextProductsType - # Unspecified default value, should never be explicitly set. - # Defaults to - # {::Google::Cloud::Retail::V2::Model::ContextProductsType::MULTIPLE_CONTEXT_PRODUCTS MULTIPLE_CONTEXT_PRODUCTS}. - CONTEXT_PRODUCTS_TYPE_UNSPECIFIED = 0 - - # Use only a single product as context for the recommendation. Typically - # used on pages like add-to-cart or product details. - SINGLE_CONTEXT_PRODUCT = 1 - - # Use one or multiple products as context for the recommendation. Typically - # used on shopping cart pages. - MULTIPLE_CONTEXT_PRODUCTS = 2 - end - end - end - end - end -end diff --git a/owl-bot-staging/google-cloud-retail-v2/proto_docs/google/cloud/retail/v2/model_service.rb b/owl-bot-staging/google-cloud-retail-v2/proto_docs/google/cloud/retail/v2/model_service.rb deleted file mode 100644 index 0fe12a4770c2..000000000000 --- a/owl-bot-staging/google-cloud-retail-v2/proto_docs/google/cloud/retail/v2/model_service.rb +++ /dev/null @@ -1,172 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - - -module Google - module Cloud - module Retail - module V2 - # Request for creating a model. - # @!attribute [rw] parent - # @return [::String] - # Required. The parent resource under which to create the model. Format: - # `projects/{project_number}/locations/{location_id}/catalogs/{catalog_id}` - # @!attribute [rw] model - # @return [::Google::Cloud::Retail::V2::Model] - # Required. The payload of the {::Google::Cloud::Retail::V2::Model Model} to - # create. - # @!attribute [rw] dry_run - # @return [::Boolean] - # Optional. Whether to run a dry run to validate the request (without - # actually creating the model). - class CreateModelRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Request for updating an existing model. - # @!attribute [rw] model - # @return [::Google::Cloud::Retail::V2::Model] - # Required. The body of the updated {::Google::Cloud::Retail::V2::Model Model}. - # @!attribute [rw] update_mask - # @return [::Google::Protobuf::FieldMask] - # Optional. Indicates which fields in the provided 'model' to - # update. If not set, by default updates all fields. - class UpdateModelRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Request for getting a model. - # @!attribute [rw] name - # @return [::String] - # Required. The resource name of the {::Google::Cloud::Retail::V2::Model Model} to - # get. Format: - # `projects/{project_number}/locations/{location_id}/catalogs/{catalog}/models/{model_id}` - class GetModelRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Request for pausing training of a model. - # @!attribute [rw] name - # @return [::String] - # Required. The name of the model to pause. - # Format: - # `projects/{project_number}/locations/{location_id}/catalogs/{catalog_id}/models/{model_id}` - class PauseModelRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Request for resuming training of a model. - # @!attribute [rw] name - # @return [::String] - # Required. The name of the model to resume. - # Format: - # `projects/{project_number}/locations/{location_id}/catalogs/{catalog_id}/models/{model_id}` - class ResumeModelRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Request for listing models associated with a resource. - # @!attribute [rw] parent - # @return [::String] - # Required. The parent for which to list models. - # Format: - # `projects/{project_number}/locations/{location_id}/catalogs/{catalog_id}` - # @!attribute [rw] page_size - # @return [::Integer] - # Optional. Maximum number of results to return. If unspecified, defaults - # to 50. Max allowed value is 1000. - # @!attribute [rw] page_token - # @return [::String] - # Optional. A page token, received from a previous `ListModels` - # call. Provide this to retrieve the subsequent page. - class ListModelsRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Request for deleting a model. - # @!attribute [rw] name - # @return [::String] - # Required. The resource name of the {::Google::Cloud::Retail::V2::Model Model} to - # delete. Format: - # `projects/{project_number}/locations/{location_id}/catalogs/{catalog_id}/models/{model_id}` - class DeleteModelRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Response to a ListModelRequest. - # @!attribute [rw] models - # @return [::Array<::Google::Cloud::Retail::V2::Model>] - # List of Models. - # @!attribute [rw] next_page_token - # @return [::String] - # Pagination token, if not returned indicates the last page. - class ListModelsResponse - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Request to manually start a tuning process now (instead of waiting for - # the periodically scheduled tuning to happen). - # @!attribute [rw] name - # @return [::String] - # Required. The resource name of the model to tune. - # Format: - # `projects/{project_number}/locations/{location_id}/catalogs/{catalog_id}/models/{model_id}` - class TuneModelRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Metadata associated with a create operation. - # @!attribute [rw] model - # @return [::String] - # The resource name of the model that this create applies to. - # Format: - # `projects/{project_number}/locations/{location_id}/catalogs/{catalog_id}/models/{model_id}` - class CreateModelMetadata - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Metadata associated with a tune operation. - # @!attribute [rw] model - # @return [::String] - # The resource name of the model that this tune applies to. - # Format: - # `projects/{project_number}/locations/{location_id}/catalogs/{catalog_id}/models/{model_id}` - class TuneModelMetadata - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Response associated with a tune operation. - class TuneModelResponse - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - end - end - end -end diff --git a/owl-bot-staging/google-cloud-retail-v2/proto_docs/google/cloud/retail/v2/prediction_service.rb b/owl-bot-staging/google-cloud-retail-v2/proto_docs/google/cloud/retail/v2/prediction_service.rb deleted file mode 100644 index 53e46e58df05..000000000000 --- a/owl-bot-staging/google-cloud-retail-v2/proto_docs/google/cloud/retail/v2/prediction_service.rb +++ /dev/null @@ -1,237 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - - -module Google - module Cloud - module Retail - module V2 - # Request message for Predict method. - # @!attribute [rw] placement - # @return [::String] - # Required. Full resource name of the format: - # `{placement=projects/*/locations/global/catalogs/default_catalog/servingConfigs/*}` - # or - # `{placement=projects/*/locations/global/catalogs/default_catalog/placements/*}`. - # We recommend using the `servingConfigs` resource. `placements` is a legacy - # resource. - # The ID of the Recommendations AI serving config or placement. - # Before you can request predictions from your model, you must create at - # least one serving config or placement for it. For more information, see - # [Manage serving configs] - # (https://cloud.google.com/retail/docs/manage-configs). - # - # The full list of available serving configs can be seen at - # https://console.cloud.google.com/ai/retail/catalogs/default_catalog/configs - # @!attribute [rw] user_event - # @return [::Google::Cloud::Retail::V2::UserEvent] - # Required. Context about the user, what they are looking at and what action - # they took to trigger the predict request. Note that this user event detail - # won't be ingested to userEvent logs. Thus, a separate userEvent write - # request is required for event logging. - # - # Don't set - # {::Google::Cloud::Retail::V2::UserEvent#visitor_id UserEvent.visitor_id} or - # {::Google::Cloud::Retail::V2::UserInfo#user_id UserInfo.user_id} to the same - # fixed ID for different users. If you are trying to receive non-personalized - # recommendations (not recommended; this can negatively impact model - # performance), instead set - # {::Google::Cloud::Retail::V2::UserEvent#visitor_id UserEvent.visitor_id} to a - # random unique ID and leave - # {::Google::Cloud::Retail::V2::UserInfo#user_id UserInfo.user_id} unset. - # @!attribute [rw] page_size - # @return [::Integer] - # Maximum number of results to return. Set this property to the number of - # prediction results needed. If zero, the service will choose a reasonable - # default. The maximum allowed value is 100. Values above 100 will be coerced - # to 100. - # @!attribute [rw] page_token - # @deprecated This field is deprecated and may be removed in the next major version update. - # @return [::String] - # This field is not used; leave it unset. - # @!attribute [rw] filter - # @return [::String] - # Filter for restricting prediction results with a length limit of 5,000 - # characters. Accepts values for tags and the `filterOutOfStockItems` flag. - # - # * Tag expressions. Restricts predictions to products that match all of the - # specified tags. Boolean operators `OR` and `NOT` are supported if the - # expression is enclosed in parentheses, and must be separated from the - # tag values by a space. `-"tagA"` is also supported and is equivalent to - # `NOT "tagA"`. Tag values must be double quoted UTF-8 encoded strings - # with a size limit of 1,000 characters. - # - # Note: "Recently viewed" models don't support tag filtering at the - # moment. - # - # * filterOutOfStockItems. Restricts predictions to products that do not - # have a - # stockState value of OUT_OF_STOCK. - # - # Examples: - # - # * tag=("Red" OR "Blue") tag="New-Arrival" tag=(NOT "promotional") - # * filterOutOfStockItems tag=(-"promotional") - # * filterOutOfStockItems - # - # If your filter blocks all prediction results, the API will return *no* - # results. If instead you want empty result sets to return generic - # (unfiltered) popular products, set `strictFiltering` to False in - # `PredictRequest.params`. Note that the API will never return items with - # storageStatus of "EXPIRED" or "DELETED" regardless of filter choices. - # - # If `filterSyntaxV2` is set to true under the `params` field, then - # attribute-based expressions are expected instead of the above described - # tag-based syntax. Examples: - # - # * (colors: ANY("Red", "Blue")) AND NOT (categories: ANY("Phones")) - # * (availability: ANY("IN_STOCK")) AND - # (colors: ANY("Red") OR categories: ANY("Phones")) - # - # For more information, see - # [Filter recommendations](https://cloud.google.com/retail/docs/filter-recs). - # @!attribute [rw] validate_only - # @return [::Boolean] - # Use validate only mode for this prediction query. If set to true, a - # dummy model will be used that returns arbitrary products. - # Note that the validate only mode should only be used for testing the API, - # or if the model is not ready. - # @!attribute [rw] params - # @return [::Google::Protobuf::Map{::String => ::Google::Protobuf::Value}] - # Additional domain specific parameters for the predictions. - # - # Allowed values: - # - # * `returnProduct`: Boolean. If set to true, the associated product - # object will be returned in the `results.metadata` field in the - # prediction response. - # * `returnScore`: Boolean. If set to true, the prediction 'score' - # corresponding to each returned product will be set in the - # `results.metadata` field in the prediction response. The given - # 'score' indicates the probability of a product being clicked/purchased - # given the user's context and history. - # * `strictFiltering`: Boolean. True by default. If set to false, the service - # will return generic (unfiltered) popular products instead of empty if - # your filter blocks all prediction results. - # * `priceRerankLevel`: String. Default empty. If set to be non-empty, then - # it needs to be one of {'no-price-reranking', 'low-price-reranking', - # 'medium-price-reranking', 'high-price-reranking'}. This gives - # request-level control and adjusts prediction results based on product - # price. - # * `diversityLevel`: String. Default empty. If set to be non-empty, then - # it needs to be one of {'no-diversity', 'low-diversity', - # 'medium-diversity', 'high-diversity', 'auto-diversity'}. This gives - # request-level control and adjusts prediction results based on product - # category. - # * `filterSyntaxV2`: Boolean. False by default. If set to true, the `filter` - # field is interpreteted according to the new, attribute-based syntax. - # @!attribute [rw] labels - # @return [::Google::Protobuf::Map{::String => ::String}] - # The labels applied to a resource must meet the following requirements: - # - # * Each resource can have multiple labels, up to a maximum of 64. - # * Each label must be a key-value pair. - # * Keys have a minimum length of 1 character and a maximum length of 63 - # characters and cannot be empty. Values can be empty and have a maximum - # length of 63 characters. - # * Keys and values can contain only lowercase letters, numeric characters, - # underscores, and dashes. All characters must use UTF-8 encoding, and - # international characters are allowed. - # * The key portion of a label must be unique. However, you can use the same - # key with multiple resources. - # * Keys must start with a lowercase letter or international character. - # - # See [Google Cloud - # Document](https://cloud.google.com/resource-manager/docs/creating-managing-labels#requirements) - # for more details. - class PredictRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - - # @!attribute [rw] key - # @return [::String] - # @!attribute [rw] value - # @return [::Google::Protobuf::Value] - class ParamsEntry - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # @!attribute [rw] key - # @return [::String] - # @!attribute [rw] value - # @return [::String] - class LabelsEntry - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - end - - # Response message for predict method. - # @!attribute [rw] results - # @return [::Array<::Google::Cloud::Retail::V2::PredictResponse::PredictionResult>] - # A list of recommended products. The order represents the ranking (from the - # most relevant product to the least). - # @!attribute [rw] attribution_token - # @return [::String] - # A unique attribution token. This should be included in the - # {::Google::Cloud::Retail::V2::UserEvent UserEvent} logs resulting from this - # recommendation, which enables accurate attribution of recommendation model - # performance. - # @!attribute [rw] missing_ids - # @return [::Array<::String>] - # IDs of products in the request that were missing from the inventory. - # @!attribute [rw] validate_only - # @return [::Boolean] - # True if the validateOnly property was set in the request. - class PredictResponse - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - - # PredictionResult represents the recommendation prediction results. - # @!attribute [rw] id - # @return [::String] - # ID of the recommended product - # @!attribute [rw] metadata - # @return [::Google::Protobuf::Map{::String => ::Google::Protobuf::Value}] - # Additional product metadata / annotations. - # - # Possible values: - # - # * `product`: JSON representation of the product. Is set if - # `returnProduct` is set to true in `PredictRequest.params`. - # * `score`: Prediction score in double value. Is set if - # `returnScore` is set to true in `PredictRequest.params`. - class PredictionResult - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - - # @!attribute [rw] key - # @return [::String] - # @!attribute [rw] value - # @return [::Google::Protobuf::Value] - class MetadataEntry - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - end - end - end - end - end -end diff --git a/owl-bot-staging/google-cloud-retail-v2/proto_docs/google/cloud/retail/v2/product.rb b/owl-bot-staging/google-cloud-retail-v2/proto_docs/google/cloud/retail/v2/product.rb deleted file mode 100644 index a5c89f524c45..000000000000 --- a/owl-bot-staging/google-cloud-retail-v2/proto_docs/google/cloud/retail/v2/product.rb +++ /dev/null @@ -1,588 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - - -module Google - module Cloud - module Retail - module V2 - # Product captures all metadata information of items to be recommended or - # searched. - # @!attribute [rw] expire_time - # @return [::Google::Protobuf::Timestamp] - # Note that this field is applied in the following ways: - # - # * If the {::Google::Cloud::Retail::V2::Product Product} is already expired - # when it is uploaded, this product - # is not indexed for search. - # - # * If the {::Google::Cloud::Retail::V2::Product Product} is not expired when it - # is uploaded, only the - # {::Google::Cloud::Retail::V2::Product::Type::PRIMARY Type.PRIMARY}'s and - # {::Google::Cloud::Retail::V2::Product::Type::COLLECTION Type.COLLECTION}'s - # expireTime is respected, and - # {::Google::Cloud::Retail::V2::Product::Type::VARIANT Type.VARIANT}'s - # expireTime is not used. - # - # In general, we suggest the users to delete the stale - # products explicitly, instead of using this field to determine staleness. - # - # {::Google::Cloud::Retail::V2::Product#expire_time expire_time} must be later - # than {::Google::Cloud::Retail::V2::Product#available_time available_time} and - # {::Google::Cloud::Retail::V2::Product#publish_time publish_time}, otherwise an - # INVALID_ARGUMENT error is thrown. - # - # Corresponding properties: Google Merchant Center property - # [expiration_date](https://support.google.com/merchants/answer/6324499). - # - # Note: The following fields are mutually exclusive: `expire_time`, `ttl`. If a field in that set is populated, all other fields in the set will automatically be cleared. - # @!attribute [rw] ttl - # @return [::Google::Protobuf::Duration] - # Input only. The TTL (time to live) of the product. Note that this is only - # applicable to {::Google::Cloud::Retail::V2::Product::Type::PRIMARY Type.PRIMARY} - # and {::Google::Cloud::Retail::V2::Product::Type::COLLECTION Type.COLLECTION}, - # and ignored for - # {::Google::Cloud::Retail::V2::Product::Type::VARIANT Type.VARIANT}. In general, - # we suggest the users to delete the stale products explicitly, instead of - # using this field to determine staleness. - # - # If it is set, it must be a non-negative value, and - # {::Google::Cloud::Retail::V2::Product#expire_time expire_time} is set as - # current timestamp plus {::Google::Cloud::Retail::V2::Product#ttl ttl}. The - # derived {::Google::Cloud::Retail::V2::Product#expire_time expire_time} is - # returned in the output and {::Google::Cloud::Retail::V2::Product#ttl ttl} is - # left blank when retrieving the {::Google::Cloud::Retail::V2::Product Product}. - # - # If it is set, the product is not available for - # {::Google::Cloud::Retail::V2::SearchService::Client#search SearchService.Search} after - # current timestamp plus {::Google::Cloud::Retail::V2::Product#ttl ttl}. - # However, the product can still be retrieved by - # {::Google::Cloud::Retail::V2::ProductService::Client#get_product ProductService.GetProduct} - # and - # {::Google::Cloud::Retail::V2::ProductService::Client#list_products ProductService.ListProducts}. - # - # Note: The following fields are mutually exclusive: `ttl`, `expire_time`. If a field in that set is populated, all other fields in the set will automatically be cleared. - # @!attribute [rw] name - # @return [::String] - # Immutable. Full resource name of the product, such as - # `projects/*/locations/global/catalogs/default_catalog/branches/default_branch/products/product_id`. - # @!attribute [rw] id - # @return [::String] - # Immutable. {::Google::Cloud::Retail::V2::Product Product} identifier, which is - # the final component of {::Google::Cloud::Retail::V2::Product#name name}. For - # example, this field is "id_1", if - # {::Google::Cloud::Retail::V2::Product#name name} is - # `projects/*/locations/global/catalogs/default_catalog/branches/default_branch/products/id_1`. - # - # This field must be a UTF-8 encoded string with a length limit of 128 - # characters. Otherwise, an INVALID_ARGUMENT error is returned. - # - # Corresponding properties: Google Merchant Center property - # [id](https://support.google.com/merchants/answer/6324405). Schema.org - # property [Product.sku](https://schema.org/sku). - # @!attribute [rw] type - # @return [::Google::Cloud::Retail::V2::Product::Type] - # Immutable. The type of the product. Default to - # {::Google::Cloud::Retail::V2::ProductLevelConfig#ingestion_product_type Catalog.product_level_config.ingestion_product_type} - # if unset. - # @!attribute [rw] primary_product_id - # @return [::String] - # Variant group identifier. Must be an - # {::Google::Cloud::Retail::V2::Product#id id}, with the same parent branch with - # this product. Otherwise, an error is thrown. - # - # For {::Google::Cloud::Retail::V2::Product::Type::PRIMARY Type.PRIMARY} - # {::Google::Cloud::Retail::V2::Product Product}s, this field can only be empty or - # set to the same value as {::Google::Cloud::Retail::V2::Product#id id}. - # - # For VARIANT {::Google::Cloud::Retail::V2::Product Product}s, this field cannot - # be empty. A maximum of 2,000 products are allowed to share the same - # {::Google::Cloud::Retail::V2::Product::Type::PRIMARY Type.PRIMARY} - # {::Google::Cloud::Retail::V2::Product Product}. Otherwise, an INVALID_ARGUMENT - # error is returned. - # - # Corresponding properties: Google Merchant Center property - # [item_group_id](https://support.google.com/merchants/answer/6324507). - # Schema.org property - # [Product.inProductGroupWithID](https://schema.org/inProductGroupWithID). - # @!attribute [rw] collection_member_ids - # @return [::Array<::String>] - # The {::Google::Cloud::Retail::V2::Product#id id} of the collection members when - # {::Google::Cloud::Retail::V2::Product#type type} is - # {::Google::Cloud::Retail::V2::Product::Type::COLLECTION Type.COLLECTION}. - # - # Non-existent product ids are allowed. - # The {::Google::Cloud::Retail::V2::Product#type type} of the members must be - # either {::Google::Cloud::Retail::V2::Product::Type::PRIMARY Type.PRIMARY} or - # {::Google::Cloud::Retail::V2::Product::Type::VARIANT Type.VARIANT} otherwise an - # INVALID_ARGUMENT error is thrown. Should not set it for other types. A - # maximum of 1000 values are allowed. Otherwise, an INVALID_ARGUMENT error is - # return. - # @!attribute [rw] gtin - # @return [::String] - # The Global Trade Item Number (GTIN) of the product. - # - # This field must be a UTF-8 encoded string with a length limit of 128 - # characters. Otherwise, an INVALID_ARGUMENT error is returned. - # - # This field must be a Unigram. Otherwise, an INVALID_ARGUMENT error is - # returned. - # - # Corresponding properties: Google Merchant Center property - # [gtin](https://support.google.com/merchants/answer/6324461). - # Schema.org property - # [Product.isbn](https://schema.org/isbn), - # [Product.gtin8](https://schema.org/gtin8), - # [Product.gtin12](https://schema.org/gtin12), - # [Product.gtin13](https://schema.org/gtin13), or - # [Product.gtin14](https://schema.org/gtin14). - # - # If the value is not a valid GTIN, an INVALID_ARGUMENT error is returned. - # @!attribute [rw] categories - # @return [::Array<::String>] - # Product categories. This field is repeated for supporting one product - # belonging to several parallel categories. Strongly recommended using the - # full path for better search / recommendation quality. - # - # - # To represent full path of category, use '>' sign to separate different - # hierarchies. If '>' is part of the category name, replace it with - # other character(s). - # - # For example, if a shoes product belongs to both - # ["Shoes & Accessories" -> "Shoes"] and - # ["Sports & Fitness" -> "Athletic Clothing" -> "Shoes"], it could be - # represented as: - # - # "categories": [ - # "Shoes & Accessories > Shoes", - # "Sports & Fitness > Athletic Clothing > Shoes" - # ] - # - # Must be set for {::Google::Cloud::Retail::V2::Product::Type::PRIMARY Type.PRIMARY} - # {::Google::Cloud::Retail::V2::Product Product} otherwise an INVALID_ARGUMENT - # error is returned. - # - # At most 250 values are allowed per - # {::Google::Cloud::Retail::V2::Product Product} unless overridden through the - # Google Cloud console. Empty values are not allowed. Each value must be a - # UTF-8 encoded string with a length limit of 5,000 characters. Otherwise, an - # INVALID_ARGUMENT error is returned. - # - # Corresponding properties: Google Merchant Center property - # [google_product_category][mc_google_product_category]. Schema.org property - # [Product.category] (https://schema.org/category). - # - # [mc_google_product_category]: - # https://support.google.com/merchants/answer/6324436 - # @!attribute [rw] title - # @return [::String] - # Required. Product title. - # - # This field must be a UTF-8 encoded string with a length limit of 1,000 - # characters. Otherwise, an INVALID_ARGUMENT error is returned. - # - # Corresponding properties: Google Merchant Center property - # [title](https://support.google.com/merchants/answer/6324415). Schema.org - # property [Product.name](https://schema.org/name). - # @!attribute [rw] brands - # @return [::Array<::String>] - # The brands of the product. - # - # A maximum of 30 brands are allowed unless overridden through the Google - # Cloud console. Each - # brand must be a UTF-8 encoded string with a length limit of 1,000 - # characters. Otherwise, an INVALID_ARGUMENT error is returned. - # - # Corresponding properties: Google Merchant Center property - # [brand](https://support.google.com/merchants/answer/6324351). Schema.org - # property [Product.brand](https://schema.org/brand). - # @!attribute [rw] description - # @return [::String] - # Product description. - # - # This field must be a UTF-8 encoded string with a length limit of 5,000 - # characters. Otherwise, an INVALID_ARGUMENT error is returned. - # - # Corresponding properties: Google Merchant Center property - # [description](https://support.google.com/merchants/answer/6324468). - # Schema.org property [Product.description](https://schema.org/description). - # @!attribute [rw] language_code - # @return [::String] - # Language of the title/description and other string attributes. Use language - # tags defined by [BCP 47](https://www.rfc-editor.org/rfc/bcp/bcp47.txt). - # - # For product prediction, this field is ignored and the model automatically - # detects the text language. The {::Google::Cloud::Retail::V2::Product Product} - # can include text in different languages, but duplicating - # {::Google::Cloud::Retail::V2::Product Product}s to provide text in multiple - # languages can result in degraded model performance. - # - # For product search this field is in use. It defaults to "en-US" if unset. - # @!attribute [rw] attributes - # @return [::Google::Protobuf::Map{::String => ::Google::Cloud::Retail::V2::CustomAttribute}] - # Highly encouraged. Extra product attributes to be included. For example, - # for products, this could include the store name, vendor, style, color, etc. - # These are very strong signals for recommendation model, thus we highly - # recommend providing the attributes here. - # - # Features that can take on one of a limited number of possible values. Two - # types of features can be set are: - # - # Textual features. some examples would be the brand/maker of a product, or - # country of a customer. Numerical features. Some examples would be the - # height/weight of a product, or age of a customer. - # - # For example: `{ "vendor": {"text": ["vendor123", "vendor456"]}, - # "lengths_cm": \\{"numbers":[2.3, 15.4]}, "heights_cm": \\{"numbers":[8.1, 6.4]} - # }`. - # - # This field needs to pass all below criteria, otherwise an INVALID_ARGUMENT - # error is returned: - # - # * Max entries count: 200. - # * The key must be a UTF-8 encoded string with a length limit of 128 - # characters. - # * For indexable attribute, the key must match the pattern: - # `[a-zA-Z0-9][a-zA-Z0-9_]*`. For example, `key0LikeThis` or - # `KEY_1_LIKE_THIS`. - # * For text attributes, at most 400 values are allowed. Empty values are not - # allowed. Each value must be a non-empty UTF-8 encoded string with a - # length limit of 256 characters. - # * For number attributes, at most 400 values are allowed. - # @!attribute [rw] tags - # @return [::Array<::String>] - # Custom tags associated with the product. - # - # At most 250 values are allowed per - # {::Google::Cloud::Retail::V2::Product Product}. This value must be a UTF-8 - # encoded string with a length limit of 1,000 characters. Otherwise, an - # INVALID_ARGUMENT error is returned. - # - # This tag can be used for filtering recommendation results by passing the - # tag as part of the - # {::Google::Cloud::Retail::V2::PredictRequest#filter PredictRequest.filter}. - # - # Corresponding properties: Google Merchant Center property - # [custom_label_0–4](https://support.google.com/merchants/answer/6324473). - # @!attribute [rw] price_info - # @return [::Google::Cloud::Retail::V2::PriceInfo] - # Product price and cost information. - # - # Corresponding properties: Google Merchant Center property - # [price](https://support.google.com/merchants/answer/6324371). - # @!attribute [rw] rating - # @return [::Google::Cloud::Retail::V2::Rating] - # The rating of this product. - # @!attribute [rw] available_time - # @return [::Google::Protobuf::Timestamp] - # The timestamp when this {::Google::Cloud::Retail::V2::Product Product} becomes - # available for - # {::Google::Cloud::Retail::V2::SearchService::Client#search SearchService.Search}. Note - # that this is only applicable to - # {::Google::Cloud::Retail::V2::Product::Type::PRIMARY Type.PRIMARY} and - # {::Google::Cloud::Retail::V2::Product::Type::COLLECTION Type.COLLECTION}, and - # ignored for {::Google::Cloud::Retail::V2::Product::Type::VARIANT Type.VARIANT}. - # @!attribute [rw] availability - # @return [::Google::Cloud::Retail::V2::Product::Availability] - # The online availability of the {::Google::Cloud::Retail::V2::Product Product}. - # Default to - # {::Google::Cloud::Retail::V2::Product::Availability::IN_STOCK Availability.IN_STOCK}. - # - # For primary products with variants set the availability of the primary as - # {::Google::Cloud::Retail::V2::Product::Availability::OUT_OF_STOCK Availability.OUT_OF_STOCK} - # and set the true availability at the variant level. This way the primary - # product will be considered "in stock" as long as it has at least one - # variant in stock. - # - # For primary products with no variants set the true availability at the - # primary level. - # - # Corresponding properties: Google Merchant Center property - # [availability](https://support.google.com/merchants/answer/6324448). - # Schema.org property [Offer.availability](https://schema.org/availability). - # @!attribute [rw] available_quantity - # @return [::Google::Protobuf::Int32Value] - # The available quantity of the item. - # @!attribute [rw] fulfillment_info - # @return [::Array<::Google::Cloud::Retail::V2::FulfillmentInfo>] - # Fulfillment information, such as the store IDs for in-store pickup or - # region IDs for different shipping methods. - # - # All the elements must have distinct - # {::Google::Cloud::Retail::V2::FulfillmentInfo#type FulfillmentInfo.type}. - # Otherwise, an INVALID_ARGUMENT error is returned. - # @!attribute [rw] uri - # @return [::String] - # Canonical URL directly linking to the product detail page. - # - # It is strongly recommended to provide a valid uri for the product, - # otherwise the service performance could be significantly degraded. - # - # This field must be a UTF-8 encoded string with a length limit of 5,000 - # characters. Otherwise, an INVALID_ARGUMENT error is returned. - # - # Corresponding properties: Google Merchant Center property - # [link](https://support.google.com/merchants/answer/6324416). Schema.org - # property [Offer.url](https://schema.org/url). - # @!attribute [rw] images - # @return [::Array<::Google::Cloud::Retail::V2::Image>] - # Product images for the product. We highly recommend putting the main - # image first. - # - # A maximum of 300 images are allowed. - # - # Corresponding properties: Google Merchant Center property - # [image_link](https://support.google.com/merchants/answer/6324350). - # Schema.org property [Product.image](https://schema.org/image). - # @!attribute [rw] audience - # @return [::Google::Cloud::Retail::V2::Audience] - # The target group associated with a given audience (e.g. male, veterans, - # car owners, musicians, etc.) of the product. - # @!attribute [rw] color_info - # @return [::Google::Cloud::Retail::V2::ColorInfo] - # The color of the product. - # - # Corresponding properties: Google Merchant Center property - # [color](https://support.google.com/merchants/answer/6324487). Schema.org - # property [Product.color](https://schema.org/color). - # @!attribute [rw] sizes - # @return [::Array<::String>] - # The size of the product. To represent different size systems or size types, - # consider using this format: [[[size_system:]size_type:]size_value]. - # - # For example, in "US:MENS:M", "US" represents size system; "MENS" represents - # size type; "M" represents size value. In "GIRLS:27", size system is empty; - # "GIRLS" represents size type; "27" represents size value. In "32 inches", - # both size system and size type are empty, while size value is "32 inches". - # - # A maximum of 20 values are allowed per - # {::Google::Cloud::Retail::V2::Product Product}. Each value must be a UTF-8 - # encoded string with a length limit of 128 characters. Otherwise, an - # INVALID_ARGUMENT error is returned. - # - # Corresponding properties: Google Merchant Center property - # [size](https://support.google.com/merchants/answer/6324492), - # [size_type](https://support.google.com/merchants/answer/6324497), and - # [size_system](https://support.google.com/merchants/answer/6324502). - # Schema.org property [Product.size](https://schema.org/size). - # @!attribute [rw] materials - # @return [::Array<::String>] - # The material of the product. For example, "leather", "wooden". - # - # A maximum of 20 values are allowed. Each value must be a UTF-8 encoded - # string with a length limit of 200 characters. Otherwise, an - # INVALID_ARGUMENT error is returned. - # - # Corresponding properties: Google Merchant Center property - # [material](https://support.google.com/merchants/answer/6324410). Schema.org - # property [Product.material](https://schema.org/material). - # @!attribute [rw] patterns - # @return [::Array<::String>] - # The pattern or graphic print of the product. For example, "striped", "polka - # dot", "paisley". - # - # A maximum of 20 values are allowed per - # {::Google::Cloud::Retail::V2::Product Product}. Each value must be a UTF-8 - # encoded string with a length limit of 128 characters. Otherwise, an - # INVALID_ARGUMENT error is returned. - # - # Corresponding properties: Google Merchant Center property - # [pattern](https://support.google.com/merchants/answer/6324483). Schema.org - # property [Product.pattern](https://schema.org/pattern). - # @!attribute [rw] conditions - # @return [::Array<::String>] - # The condition of the product. Strongly encouraged to use the standard - # values: "new", "refurbished", "used". - # - # A maximum of 1 value is allowed per - # {::Google::Cloud::Retail::V2::Product Product}. Each value must be a UTF-8 - # encoded string with a length limit of 128 characters. Otherwise, an - # INVALID_ARGUMENT error is returned. - # - # Corresponding properties: Google Merchant Center property - # [condition](https://support.google.com/merchants/answer/6324469). - # Schema.org property - # [Offer.itemCondition](https://schema.org/itemCondition). - # @!attribute [rw] promotions - # @return [::Array<::Google::Cloud::Retail::V2::Promotion>] - # The promotions applied to the product. A maximum of 10 values are allowed - # per {::Google::Cloud::Retail::V2::Product Product}. Only - # {::Google::Cloud::Retail::V2::Promotion#promotion_id Promotion.promotion_id} - # will be used, other fields will be ignored if set. - # @!attribute [rw] publish_time - # @return [::Google::Protobuf::Timestamp] - # The timestamp when the product is published by the retailer for the first - # time, which indicates the freshness of the products. Note that this field - # is different from - # {::Google::Cloud::Retail::V2::Product#available_time available_time}, given it - # purely describes product freshness regardless of when it is available on - # search and recommendation. - # @!attribute [rw] retrievable_fields - # @deprecated This field is deprecated and may be removed in the next major version update. - # @return [::Google::Protobuf::FieldMask] - # Indicates which fields in the {::Google::Cloud::Retail::V2::Product Product}s - # are returned in {::Google::Cloud::Retail::V2::SearchResponse SearchResponse}. - # - # Supported fields for all {::Google::Cloud::Retail::V2::Product#type type}s: - # - # * {::Google::Cloud::Retail::V2::Product#audience audience} - # * {::Google::Cloud::Retail::V2::Product#availability availability} - # * {::Google::Cloud::Retail::V2::Product#brands brands} - # * {::Google::Cloud::Retail::V2::Product#color_info color_info} - # * {::Google::Cloud::Retail::V2::Product#conditions conditions} - # * {::Google::Cloud::Retail::V2::Product#gtin gtin} - # * {::Google::Cloud::Retail::V2::Product#materials materials} - # * {::Google::Cloud::Retail::V2::Product#name name} - # * {::Google::Cloud::Retail::V2::Product#patterns patterns} - # * {::Google::Cloud::Retail::V2::Product#price_info price_info} - # * {::Google::Cloud::Retail::V2::Product#rating rating} - # * {::Google::Cloud::Retail::V2::Product#sizes sizes} - # * {::Google::Cloud::Retail::V2::Product#title title} - # * {::Google::Cloud::Retail::V2::Product#uri uri} - # - # Supported fields only for - # {::Google::Cloud::Retail::V2::Product::Type::PRIMARY Type.PRIMARY} and - # {::Google::Cloud::Retail::V2::Product::Type::COLLECTION Type.COLLECTION}: - # - # * {::Google::Cloud::Retail::V2::Product#categories categories} - # * {::Google::Cloud::Retail::V2::Product#description description} - # * {::Google::Cloud::Retail::V2::Product#images images} - # - # Supported fields only for - # {::Google::Cloud::Retail::V2::Product::Type::VARIANT Type.VARIANT}: - # - # * Only the first image in {::Google::Cloud::Retail::V2::Product#images images} - # - # To mark {::Google::Cloud::Retail::V2::Product#attributes attributes} as - # retrievable, include paths of the form "attributes.key" where "key" is the - # key of a custom attribute, as specified in - # {::Google::Cloud::Retail::V2::Product#attributes attributes}. - # - # For {::Google::Cloud::Retail::V2::Product::Type::PRIMARY Type.PRIMARY} and - # {::Google::Cloud::Retail::V2::Product::Type::COLLECTION Type.COLLECTION}, the - # following fields are always returned in - # {::Google::Cloud::Retail::V2::SearchResponse SearchResponse} by default: - # - # * {::Google::Cloud::Retail::V2::Product#name name} - # - # For {::Google::Cloud::Retail::V2::Product::Type::VARIANT Type.VARIANT}, the - # following fields are always returned in by default: - # - # * {::Google::Cloud::Retail::V2::Product#name name} - # * {::Google::Cloud::Retail::V2::Product#color_info color_info} - # - # Note: Returning more fields in - # {::Google::Cloud::Retail::V2::SearchResponse SearchResponse} can increase - # response payload size and serving latency. - # - # This field is deprecated. Use the retrievable site-wide control instead. - # @!attribute [r] variants - # @return [::Array<::Google::Cloud::Retail::V2::Product>] - # Output only. Product variants grouped together on primary product which - # share similar product attributes. It's automatically grouped by - # {::Google::Cloud::Retail::V2::Product#primary_product_id primary_product_id} for - # all the product variants. Only populated for - # {::Google::Cloud::Retail::V2::Product::Type::PRIMARY Type.PRIMARY} - # {::Google::Cloud::Retail::V2::Product Product}s. - # - # Note: This field is OUTPUT_ONLY for - # {::Google::Cloud::Retail::V2::ProductService::Client#get_product ProductService.GetProduct}. - # Do not set this field in API requests. - # @!attribute [r] local_inventories - # @return [::Array<::Google::Cloud::Retail::V2::LocalInventory>] - # Output only. A list of local inventories specific to different places. - # - # This field can be managed by - # {::Google::Cloud::Retail::V2::ProductService::Client#add_local_inventories ProductService.AddLocalInventories} - # and - # {::Google::Cloud::Retail::V2::ProductService::Client#remove_local_inventories ProductService.RemoveLocalInventories} - # APIs if fine-grained, high-volume updates are necessary. - class Product - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - - # @!attribute [rw] key - # @return [::String] - # @!attribute [rw] value - # @return [::Google::Cloud::Retail::V2::CustomAttribute] - class AttributesEntry - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # The type of this product. - module Type - # Default value. Default to - # {::Google::Cloud::Retail::V2::ProductLevelConfig#ingestion_product_type Catalog.product_level_config.ingestion_product_type} - # if unset. - TYPE_UNSPECIFIED = 0 - - # The primary type. - # - # As the primary unit for predicting, indexing and search serving, a - # {::Google::Cloud::Retail::V2::Product::Type::PRIMARY Type.PRIMARY} - # {::Google::Cloud::Retail::V2::Product Product} is grouped with multiple - # {::Google::Cloud::Retail::V2::Product::Type::VARIANT Type.VARIANT} - # {::Google::Cloud::Retail::V2::Product Product}s. - PRIMARY = 1 - - # The variant type. - # - # {::Google::Cloud::Retail::V2::Product::Type::VARIANT Type.VARIANT} - # {::Google::Cloud::Retail::V2::Product Product}s usually share some common - # attributes on the same - # {::Google::Cloud::Retail::V2::Product::Type::PRIMARY Type.PRIMARY} - # {::Google::Cloud::Retail::V2::Product Product}s, but they have variant - # attributes like different colors, sizes and prices, etc. - VARIANT = 2 - - # The collection type. Collection products are bundled - # {::Google::Cloud::Retail::V2::Product::Type::PRIMARY Type.PRIMARY} - # {::Google::Cloud::Retail::V2::Product Product}s or - # {::Google::Cloud::Retail::V2::Product::Type::VARIANT Type.VARIANT} - # {::Google::Cloud::Retail::V2::Product Product}s that are sold together, such - # as a jewelry set with necklaces, earrings and rings, etc. - COLLECTION = 3 - end - - # Product availability. If this field is unspecified, the product is - # assumed to be in stock. - module Availability - # Default product availability. Default to - # {::Google::Cloud::Retail::V2::Product::Availability::IN_STOCK Availability.IN_STOCK} - # if unset. - AVAILABILITY_UNSPECIFIED = 0 - - # Product in stock. - IN_STOCK = 1 - - # Product out of stock. - OUT_OF_STOCK = 2 - - # Product that is in pre-order state. - PREORDER = 3 - - # Product that is back-ordered (i.e. temporarily out of stock). - BACKORDER = 4 - end - end - end - end - end -end diff --git a/owl-bot-staging/google-cloud-retail-v2/proto_docs/google/cloud/retail/v2/product_service.rb b/owl-bot-staging/google-cloud-retail-v2/proto_docs/google/cloud/retail/v2/product_service.rb deleted file mode 100644 index c6fb71059137..000000000000 --- a/owl-bot-staging/google-cloud-retail-v2/proto_docs/google/cloud/retail/v2/product_service.rb +++ /dev/null @@ -1,653 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - - -module Google - module Cloud - module Retail - module V2 - # Request message for - # {::Google::Cloud::Retail::V2::ProductService::Client#create_product ProductService.CreateProduct} - # method. - # @!attribute [rw] parent - # @return [::String] - # Required. The parent catalog resource name, such as - # `projects/*/locations/global/catalogs/default_catalog/branches/default_branch`. - # @!attribute [rw] product - # @return [::Google::Cloud::Retail::V2::Product] - # Required. The {::Google::Cloud::Retail::V2::Product Product} to create. - # @!attribute [rw] product_id - # @return [::String] - # Required. The ID to use for the {::Google::Cloud::Retail::V2::Product Product}, - # which will become the final component of the - # {::Google::Cloud::Retail::V2::Product#name Product.name}. - # - # If the caller does not have permission to create the - # {::Google::Cloud::Retail::V2::Product Product}, regardless of whether or not it - # exists, a PERMISSION_DENIED error is returned. - # - # This field must be unique among all - # {::Google::Cloud::Retail::V2::Product Product}s with the same - # {::Google::Cloud::Retail::V2::CreateProductRequest#parent parent}. Otherwise, an - # ALREADY_EXISTS error is returned. - # - # This field must be a UTF-8 encoded string with a length limit of 128 - # characters. Otherwise, an INVALID_ARGUMENT error is returned. - class CreateProductRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Request message for - # {::Google::Cloud::Retail::V2::ProductService::Client#get_product ProductService.GetProduct} - # method. - # @!attribute [rw] name - # @return [::String] - # Required. Full resource name of {::Google::Cloud::Retail::V2::Product Product}, - # such as - # `projects/*/locations/global/catalogs/default_catalog/branches/default_branch/products/some_product_id`. - # - # If the caller does not have permission to access the - # {::Google::Cloud::Retail::V2::Product Product}, regardless of whether or not it - # exists, a PERMISSION_DENIED error is returned. - # - # If the requested {::Google::Cloud::Retail::V2::Product Product} does not exist, - # a NOT_FOUND error is returned. - class GetProductRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Request message for - # {::Google::Cloud::Retail::V2::ProductService::Client#update_product ProductService.UpdateProduct} - # method. - # @!attribute [rw] product - # @return [::Google::Cloud::Retail::V2::Product] - # Required. The product to update/create. - # - # If the caller does not have permission to update the - # {::Google::Cloud::Retail::V2::Product Product}, regardless of whether or not it - # exists, a PERMISSION_DENIED error is returned. - # - # If the {::Google::Cloud::Retail::V2::Product Product} to update does not exist - # and - # {::Google::Cloud::Retail::V2::UpdateProductRequest#allow_missing allow_missing} - # is not set, a NOT_FOUND error is returned. - # @!attribute [rw] update_mask - # @return [::Google::Protobuf::FieldMask] - # Indicates which fields in the provided - # {::Google::Cloud::Retail::V2::Product Product} to update. The immutable and - # output only fields are NOT supported. If not set, all supported fields (the - # fields that are neither immutable nor output only) are updated. - # - # If an unsupported or unknown field is provided, an INVALID_ARGUMENT error - # is returned. - # - # The attribute key can be updated by setting the mask path as - # "attributes.$\\{key_name}". If a key name is present in the mask but not in - # the patching product from the request, this key will be deleted after the - # update. - # @!attribute [rw] allow_missing - # @return [::Boolean] - # If set to true, and the {::Google::Cloud::Retail::V2::Product Product} is not - # found, a new {::Google::Cloud::Retail::V2::Product Product} will be created. In - # this situation, `update_mask` is ignored. - class UpdateProductRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Request message for - # {::Google::Cloud::Retail::V2::ProductService::Client#delete_product ProductService.DeleteProduct} - # method. - # @!attribute [rw] name - # @return [::String] - # Required. Full resource name of {::Google::Cloud::Retail::V2::Product Product}, - # such as - # `projects/*/locations/global/catalogs/default_catalog/branches/default_branch/products/some_product_id`. - # - # If the caller does not have permission to delete the - # {::Google::Cloud::Retail::V2::Product Product}, regardless of whether or not it - # exists, a PERMISSION_DENIED error is returned. - # - # If the {::Google::Cloud::Retail::V2::Product Product} to delete does not exist, - # a NOT_FOUND error is returned. - # - # The {::Google::Cloud::Retail::V2::Product Product} to delete can neither be a - # {::Google::Cloud::Retail::V2::Product::Type::COLLECTION Product.Type.COLLECTION} - # {::Google::Cloud::Retail::V2::Product Product} member nor a - # {::Google::Cloud::Retail::V2::Product::Type::PRIMARY Product.Type.PRIMARY} - # {::Google::Cloud::Retail::V2::Product Product} with more than one - # {::Google::Cloud::Retail::V2::Product::Type::VARIANT variants}. Otherwise, an - # INVALID_ARGUMENT error is returned. - # - # All inventory information for the named - # {::Google::Cloud::Retail::V2::Product Product} will be deleted. - class DeleteProductRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Request message for - # {::Google::Cloud::Retail::V2::ProductService::Client#list_products ProductService.ListProducts} - # method. - # @!attribute [rw] parent - # @return [::String] - # Required. The parent branch resource name, such as - # `projects/*/locations/global/catalogs/default_catalog/branches/0`. Use - # `default_branch` as the branch ID, to list products under the default - # branch. - # - # If the caller does not have permission to list - # {::Google::Cloud::Retail::V2::Product Product}s under this branch, regardless of - # whether or not this branch exists, a PERMISSION_DENIED error is returned. - # @!attribute [rw] page_size - # @return [::Integer] - # Maximum number of {::Google::Cloud::Retail::V2::Product Product}s to return. If - # unspecified, defaults to 100. The maximum allowed value is 1000. Values - # above 1000 will be coerced to 1000. - # - # If this field is negative, an INVALID_ARGUMENT error is returned. - # @!attribute [rw] page_token - # @return [::String] - # A page token - # {::Google::Cloud::Retail::V2::ListProductsResponse#next_page_token ListProductsResponse.next_page_token}, - # received from a previous - # {::Google::Cloud::Retail::V2::ProductService::Client#list_products ProductService.ListProducts} - # call. Provide this to retrieve the subsequent page. - # - # When paginating, all other parameters provided to - # {::Google::Cloud::Retail::V2::ProductService::Client#list_products ProductService.ListProducts} - # must match the call that provided the page token. Otherwise, an - # INVALID_ARGUMENT error is returned. - # @!attribute [rw] filter - # @return [::String] - # A filter to apply on the list results. Supported features: - # - # * List all the products under the parent branch if - # {::Google::Cloud::Retail::V2::ListProductsRequest#filter filter} is unset. - # * List {::Google::Cloud::Retail::V2::Product::Type::VARIANT Product.Type.VARIANT} - # {::Google::Cloud::Retail::V2::Product Product}s sharing the same - # {::Google::Cloud::Retail::V2::Product::Type::PRIMARY Product.Type.PRIMARY} - # {::Google::Cloud::Retail::V2::Product Product}. For example: - # `primary_product_id = "some_product_id"` - # * List {::Google::Cloud::Retail::V2::Product Product}s bundled in a - # {::Google::Cloud::Retail::V2::Product::Type::COLLECTION Product.Type.COLLECTION} - # {::Google::Cloud::Retail::V2::Product Product}. - # For example: - # `collection_product_id = "some_product_id"` - # * List {::Google::Cloud::Retail::V2::Product Product}s with a partibular type. - # For example: - # `type = "PRIMARY"` - # `type = "VARIANT"` - # `type = "COLLECTION"` - # - # If the field is unrecognizable, an INVALID_ARGUMENT error is returned. - # - # If the specified - # {::Google::Cloud::Retail::V2::Product::Type::PRIMARY Product.Type.PRIMARY} - # {::Google::Cloud::Retail::V2::Product Product} or - # {::Google::Cloud::Retail::V2::Product::Type::COLLECTION Product.Type.COLLECTION} - # {::Google::Cloud::Retail::V2::Product Product} does not exist, a NOT_FOUND error - # is returned. - # @!attribute [rw] read_mask - # @return [::Google::Protobuf::FieldMask] - # The fields of {::Google::Cloud::Retail::V2::Product Product} to return in the - # responses. If not set or empty, the following fields are returned: - # - # * {::Google::Cloud::Retail::V2::Product#name Product.name} - # * {::Google::Cloud::Retail::V2::Product#id Product.id} - # * {::Google::Cloud::Retail::V2::Product#title Product.title} - # * {::Google::Cloud::Retail::V2::Product#uri Product.uri} - # * {::Google::Cloud::Retail::V2::Product#images Product.images} - # * {::Google::Cloud::Retail::V2::Product#price_info Product.price_info} - # * {::Google::Cloud::Retail::V2::Product#brands Product.brands} - # - # If "*" is provided, all fields are returned. - # {::Google::Cloud::Retail::V2::Product#name Product.name} is always returned no - # matter what mask is set. - # - # If an unsupported or unknown field is provided, an INVALID_ARGUMENT error - # is returned. - class ListProductsRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Response message for - # {::Google::Cloud::Retail::V2::ProductService::Client#list_products ProductService.ListProducts} - # method. - # @!attribute [rw] products - # @return [::Array<::Google::Cloud::Retail::V2::Product>] - # The {::Google::Cloud::Retail::V2::Product Product}s. - # @!attribute [rw] next_page_token - # @return [::String] - # A token that can be sent as - # {::Google::Cloud::Retail::V2::ListProductsRequest#page_token ListProductsRequest.page_token} - # to retrieve the next page. If this field is omitted, there are no - # subsequent pages. - class ListProductsResponse - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Request message for - # {::Google::Cloud::Retail::V2::ProductService::Client#set_inventory ProductService.SetInventory} - # method. - # @!attribute [rw] inventory - # @return [::Google::Cloud::Retail::V2::Product] - # Required. The inventory information to update. The allowable fields to - # update are: - # - # * {::Google::Cloud::Retail::V2::Product#price_info Product.price_info} - # * {::Google::Cloud::Retail::V2::Product#availability Product.availability} - # * {::Google::Cloud::Retail::V2::Product#available_quantity Product.available_quantity} - # * {::Google::Cloud::Retail::V2::Product#fulfillment_info Product.fulfillment_info} - # The updated inventory fields must be specified in - # {::Google::Cloud::Retail::V2::SetInventoryRequest#set_mask SetInventoryRequest.set_mask}. - # - # If - # {::Google::Cloud::Retail::V2::Product#name SetInventoryRequest.inventory.name} - # is empty or invalid, an INVALID_ARGUMENT error is returned. - # - # If the caller does not have permission to update the - # {::Google::Cloud::Retail::V2::Product Product} named in - # {::Google::Cloud::Retail::V2::Product#name Product.name}, regardless of whether - # or not it exists, a PERMISSION_DENIED error is returned. - # - # If the {::Google::Cloud::Retail::V2::Product Product} to update does not have - # existing inventory information, the provided inventory information will be - # inserted. - # - # If the {::Google::Cloud::Retail::V2::Product Product} to update has existing - # inventory information, the provided inventory information will be merged - # while respecting the last update time for each inventory field, using the - # provided or default value for - # {::Google::Cloud::Retail::V2::SetInventoryRequest#set_time SetInventoryRequest.set_time}. - # - # The caller can replace place IDs for a subset of fulfillment types in the - # following ways: - # - # * Adds "fulfillment_info" in - # {::Google::Cloud::Retail::V2::SetInventoryRequest#set_mask SetInventoryRequest.set_mask} - # * Specifies only the desired fulfillment types and corresponding place IDs - # to update in - # {::Google::Cloud::Retail::V2::Product#fulfillment_info SetInventoryRequest.inventory.fulfillment_info} - # - # The caller can clear all place IDs from a subset of fulfillment types in - # the following ways: - # - # * Adds "fulfillment_info" in - # {::Google::Cloud::Retail::V2::SetInventoryRequest#set_mask SetInventoryRequest.set_mask} - # * Specifies only the desired fulfillment types to clear in - # {::Google::Cloud::Retail::V2::Product#fulfillment_info SetInventoryRequest.inventory.fulfillment_info} - # * Checks that only the desired fulfillment info types have empty - # {::Google::Cloud::Retail::V2::FulfillmentInfo#place_ids SetInventoryRequest.inventory.fulfillment_info.place_ids} - # - # The last update time is recorded for the following inventory fields: - # * {::Google::Cloud::Retail::V2::Product#price_info Product.price_info} - # * {::Google::Cloud::Retail::V2::Product#availability Product.availability} - # * {::Google::Cloud::Retail::V2::Product#available_quantity Product.available_quantity} - # * {::Google::Cloud::Retail::V2::Product#fulfillment_info Product.fulfillment_info} - # - # If a full overwrite of inventory information while ignoring timestamps is - # needed, - # {::Google::Cloud::Retail::V2::ProductService::Client#update_product ProductService.UpdateProduct} - # should be invoked instead. - # @!attribute [rw] set_mask - # @return [::Google::Protobuf::FieldMask] - # Indicates which inventory fields in the provided - # {::Google::Cloud::Retail::V2::Product Product} to update. - # - # At least one field must be provided. - # - # If an unsupported or unknown field is provided, an INVALID_ARGUMENT error - # is returned and the entire update will be ignored. - # @!attribute [rw] set_time - # @return [::Google::Protobuf::Timestamp] - # The time when the request is issued, used to prevent - # out-of-order updates on inventory fields with the last update time - # recorded. If not provided, the internal system time will be used. - # @!attribute [rw] allow_missing - # @return [::Boolean] - # If set to true, and the {::Google::Cloud::Retail::V2::Product Product} with name - # {::Google::Cloud::Retail::V2::Product#name Product.name} is not found, the - # inventory update will still be processed and retained for at most 1 day - # until the {::Google::Cloud::Retail::V2::Product Product} is created. If set to - # false, a NOT_FOUND error is returned if the - # {::Google::Cloud::Retail::V2::Product Product} is not found. - class SetInventoryRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Metadata related to the progress of the SetInventory operation. - # Currently empty because there is no meaningful metadata populated from the - # {::Google::Cloud::Retail::V2::ProductService::Client#set_inventory ProductService.SetInventory} - # method. - class SetInventoryMetadata - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Response of the SetInventoryRequest. Currently empty because - # there is no meaningful response populated from the - # {::Google::Cloud::Retail::V2::ProductService::Client#set_inventory ProductService.SetInventory} - # method. - class SetInventoryResponse - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Request message for - # {::Google::Cloud::Retail::V2::ProductService::Client#add_fulfillment_places ProductService.AddFulfillmentPlaces} - # method. - # @!attribute [rw] product - # @return [::String] - # Required. Full resource name of {::Google::Cloud::Retail::V2::Product Product}, - # such as - # `projects/*/locations/global/catalogs/default_catalog/branches/default_branch/products/some_product_id`. - # - # If the caller does not have permission to access the - # {::Google::Cloud::Retail::V2::Product Product}, regardless of whether or not it - # exists, a PERMISSION_DENIED error is returned. - # @!attribute [rw] type - # @return [::String] - # Required. The fulfillment type, including commonly used types (such as - # pickup in store and same day delivery), and custom types. - # - # Supported values: - # - # * "pickup-in-store" - # * "ship-to-store" - # * "same-day-delivery" - # * "next-day-delivery" - # * "custom-type-1" - # * "custom-type-2" - # * "custom-type-3" - # * "custom-type-4" - # * "custom-type-5" - # - # If this field is set to an invalid value other than these, an - # INVALID_ARGUMENT error is returned. - # - # This field directly corresponds to - # {::Google::Cloud::Retail::V2::FulfillmentInfo#type Product.fulfillment_info.type}. - # @!attribute [rw] place_ids - # @return [::Array<::String>] - # Required. The IDs for this - # {::Google::Cloud::Retail::V2::AddFulfillmentPlacesRequest#type type}, such as - # the store IDs for "pickup-in-store" or the region IDs for - # "same-day-delivery" to be added for this - # {::Google::Cloud::Retail::V2::AddFulfillmentPlacesRequest#type type}. Duplicate - # IDs will be automatically ignored. - # - # At least 1 value is required, and a maximum of 2000 values are allowed. - # Each value must be a string with a length limit of 10 characters, matching - # the pattern `[a-zA-Z0-9_-]+`, such as "store1" or "REGION-2". Otherwise, an - # INVALID_ARGUMENT error is returned. - # - # If the total number of place IDs exceeds 2000 for this - # {::Google::Cloud::Retail::V2::AddFulfillmentPlacesRequest#type type} after - # adding, then the update will be rejected. - # @!attribute [rw] add_time - # @return [::Google::Protobuf::Timestamp] - # The time when the fulfillment updates are issued, used to prevent - # out-of-order updates on fulfillment information. If not provided, the - # internal system time will be used. - # @!attribute [rw] allow_missing - # @return [::Boolean] - # If set to true, and the {::Google::Cloud::Retail::V2::Product Product} is not - # found, the fulfillment information will still be processed and retained for - # at most 1 day and processed once the - # {::Google::Cloud::Retail::V2::Product Product} is created. If set to false, a - # NOT_FOUND error is returned if the - # {::Google::Cloud::Retail::V2::Product Product} is not found. - class AddFulfillmentPlacesRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Metadata related to the progress of the AddFulfillmentPlaces operation. - # Currently empty because there is no meaningful metadata populated from the - # {::Google::Cloud::Retail::V2::ProductService::Client#add_fulfillment_places ProductService.AddFulfillmentPlaces} - # method. - class AddFulfillmentPlacesMetadata - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Response of the AddFulfillmentPlacesRequest. Currently empty because - # there is no meaningful response populated from the - # {::Google::Cloud::Retail::V2::ProductService::Client#add_fulfillment_places ProductService.AddFulfillmentPlaces} - # method. - class AddFulfillmentPlacesResponse - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Request message for - # {::Google::Cloud::Retail::V2::ProductService::Client#add_local_inventories ProductService.AddLocalInventories} - # method. - # @!attribute [rw] product - # @return [::String] - # Required. Full resource name of {::Google::Cloud::Retail::V2::Product Product}, - # such as - # `projects/*/locations/global/catalogs/default_catalog/branches/default_branch/products/some_product_id`. - # - # If the caller does not have permission to access the - # {::Google::Cloud::Retail::V2::Product Product}, regardless of whether or not it - # exists, a PERMISSION_DENIED error is returned. - # @!attribute [rw] local_inventories - # @return [::Array<::Google::Cloud::Retail::V2::LocalInventory>] - # Required. A list of inventory information at difference places. Each place - # is identified by its place ID. At most 3000 inventories are allowed per - # request. - # @!attribute [rw] add_mask - # @return [::Google::Protobuf::FieldMask] - # Indicates which inventory fields in the provided list of - # {::Google::Cloud::Retail::V2::LocalInventory LocalInventory} to update. The - # field is updated to the provided value. - # - # If a field is set while the place does not have a previous local inventory, - # the local inventory at that store is created. - # - # If a field is set while the value of that field is not provided, the - # original field value, if it exists, is deleted. - # - # If the mask is not set or set with empty paths, all inventory fields will - # be updated. - # - # If an unsupported or unknown field is provided, an INVALID_ARGUMENT error - # is returned and the entire update will be ignored. - # @!attribute [rw] add_time - # @return [::Google::Protobuf::Timestamp] - # The time when the inventory updates are issued. Used to prevent - # out-of-order updates on local inventory fields. If not provided, the - # internal system time will be used. - # @!attribute [rw] allow_missing - # @return [::Boolean] - # If set to true, and the {::Google::Cloud::Retail::V2::Product Product} is not - # found, the local inventory will still be processed and retained for at most - # 1 day and processed once the {::Google::Cloud::Retail::V2::Product Product} is - # created. If set to false, a NOT_FOUND error is returned if the - # {::Google::Cloud::Retail::V2::Product Product} is not found. - class AddLocalInventoriesRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Metadata related to the progress of the AddLocalInventories operation. - # Currently empty because there is no meaningful metadata populated from the - # {::Google::Cloud::Retail::V2::ProductService::Client#add_local_inventories ProductService.AddLocalInventories} - # method. - class AddLocalInventoriesMetadata - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Response of the - # {::Google::Cloud::Retail::V2::ProductService::Client#add_local_inventories ProductService.AddLocalInventories} - # API. Currently empty because there is no meaningful response populated from - # the - # {::Google::Cloud::Retail::V2::ProductService::Client#add_local_inventories ProductService.AddLocalInventories} - # method. - class AddLocalInventoriesResponse - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Request message for - # {::Google::Cloud::Retail::V2::ProductService::Client#remove_local_inventories ProductService.RemoveLocalInventories} - # method. - # @!attribute [rw] product - # @return [::String] - # Required. Full resource name of {::Google::Cloud::Retail::V2::Product Product}, - # such as - # `projects/*/locations/global/catalogs/default_catalog/branches/default_branch/products/some_product_id`. - # - # If the caller does not have permission to access the - # {::Google::Cloud::Retail::V2::Product Product}, regardless of whether or not it - # exists, a PERMISSION_DENIED error is returned. - # @!attribute [rw] place_ids - # @return [::Array<::String>] - # Required. A list of place IDs to have their inventory deleted. - # At most 3000 place IDs are allowed per request. - # @!attribute [rw] remove_time - # @return [::Google::Protobuf::Timestamp] - # The time when the inventory deletions are issued. Used to prevent - # out-of-order updates and deletions on local inventory fields. If not - # provided, the internal system time will be used. - # @!attribute [rw] allow_missing - # @return [::Boolean] - # If set to true, and the {::Google::Cloud::Retail::V2::Product Product} is not - # found, the local inventory removal request will still be processed and - # retained for at most 1 day and processed once the - # {::Google::Cloud::Retail::V2::Product Product} is created. If set to false, a - # NOT_FOUND error is returned if the - # {::Google::Cloud::Retail::V2::Product Product} is not found. - class RemoveLocalInventoriesRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Metadata related to the progress of the RemoveLocalInventories operation. - # Currently empty because there is no meaningful metadata populated from the - # {::Google::Cloud::Retail::V2::ProductService::Client#remove_local_inventories ProductService.RemoveLocalInventories} - # method. - class RemoveLocalInventoriesMetadata - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Response of the - # {::Google::Cloud::Retail::V2::ProductService::Client#remove_local_inventories ProductService.RemoveLocalInventories} - # API. Currently empty because there is no meaningful response populated from - # the - # {::Google::Cloud::Retail::V2::ProductService::Client#remove_local_inventories ProductService.RemoveLocalInventories} - # method. - class RemoveLocalInventoriesResponse - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Request message for - # {::Google::Cloud::Retail::V2::ProductService::Client#remove_fulfillment_places ProductService.RemoveFulfillmentPlaces} - # method. - # @!attribute [rw] product - # @return [::String] - # Required. Full resource name of {::Google::Cloud::Retail::V2::Product Product}, - # such as - # `projects/*/locations/global/catalogs/default_catalog/branches/default_branch/products/some_product_id`. - # - # If the caller does not have permission to access the - # {::Google::Cloud::Retail::V2::Product Product}, regardless of whether or not it - # exists, a PERMISSION_DENIED error is returned. - # @!attribute [rw] type - # @return [::String] - # Required. The fulfillment type, including commonly used types (such as - # pickup in store and same day delivery), and custom types. - # - # Supported values: - # - # * "pickup-in-store" - # * "ship-to-store" - # * "same-day-delivery" - # * "next-day-delivery" - # * "custom-type-1" - # * "custom-type-2" - # * "custom-type-3" - # * "custom-type-4" - # * "custom-type-5" - # - # If this field is set to an invalid value other than these, an - # INVALID_ARGUMENT error is returned. - # - # This field directly corresponds to - # {::Google::Cloud::Retail::V2::FulfillmentInfo#type Product.fulfillment_info.type}. - # @!attribute [rw] place_ids - # @return [::Array<::String>] - # Required. The IDs for this - # {::Google::Cloud::Retail::V2::RemoveFulfillmentPlacesRequest#type type}, such as - # the store IDs for "pickup-in-store" or the region IDs for - # "same-day-delivery", to be removed for this - # {::Google::Cloud::Retail::V2::RemoveFulfillmentPlacesRequest#type type}. - # - # At least 1 value is required, and a maximum of 2000 values are allowed. - # Each value must be a string with a length limit of 10 characters, matching - # the pattern `[a-zA-Z0-9_-]+`, such as "store1" or "REGION-2". Otherwise, an - # INVALID_ARGUMENT error is returned. - # @!attribute [rw] remove_time - # @return [::Google::Protobuf::Timestamp] - # The time when the fulfillment updates are issued, used to prevent - # out-of-order updates on fulfillment information. If not provided, the - # internal system time will be used. - # @!attribute [rw] allow_missing - # @return [::Boolean] - # If set to true, and the {::Google::Cloud::Retail::V2::Product Product} is not - # found, the fulfillment information will still be processed and retained for - # at most 1 day and processed once the - # {::Google::Cloud::Retail::V2::Product Product} is created. If set to false, a - # NOT_FOUND error is returned if the - # {::Google::Cloud::Retail::V2::Product Product} is not found. - class RemoveFulfillmentPlacesRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Metadata related to the progress of the RemoveFulfillmentPlaces operation. - # Currently empty because there is no meaningful metadata populated from the - # {::Google::Cloud::Retail::V2::ProductService::Client#remove_fulfillment_places ProductService.RemoveFulfillmentPlaces} - # method. - class RemoveFulfillmentPlacesMetadata - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Response of the RemoveFulfillmentPlacesRequest. Currently empty because there - # is no meaningful response populated from the - # {::Google::Cloud::Retail::V2::ProductService::Client#remove_fulfillment_places ProductService.RemoveFulfillmentPlaces} - # method. - class RemoveFulfillmentPlacesResponse - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - end - end - end -end diff --git a/owl-bot-staging/google-cloud-retail-v2/proto_docs/google/cloud/retail/v2/promotion.rb b/owl-bot-staging/google-cloud-retail-v2/proto_docs/google/cloud/retail/v2/promotion.rb deleted file mode 100644 index 1b9a47b22ebd..000000000000 --- a/owl-bot-staging/google-cloud-retail-v2/proto_docs/google/cloud/retail/v2/promotion.rb +++ /dev/null @@ -1,43 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - - -module Google - module Cloud - module Retail - module V2 - # Promotion information. - # @!attribute [rw] promotion_id - # @return [::String] - # ID of the promotion. For example, "free gift". - # - # The value must be a UTF-8 encoded string with a length limit of 128 - # characters, and match the pattern: `[a-zA-Z][a-zA-Z0-9_]*`. For example, - # id0LikeThis or ID_1_LIKE_THIS. Otherwise, an INVALID_ARGUMENT error is - # returned. - # - # Corresponds to Google Merchant Center property - # [promotion_id](https://support.google.com/merchants/answer/7050148). - class Promotion - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - end - end - end -end diff --git a/owl-bot-staging/google-cloud-retail-v2/proto_docs/google/cloud/retail/v2/purge_config.rb b/owl-bot-staging/google-cloud-retail-v2/proto_docs/google/cloud/retail/v2/purge_config.rb deleted file mode 100644 index cfeb05692659..000000000000 --- a/owl-bot-staging/google-cloud-retail-v2/proto_docs/google/cloud/retail/v2/purge_config.rb +++ /dev/null @@ -1,178 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - - -module Google - module Cloud - module Retail - module V2 - # Metadata related to the progress of the Purge operation. - # This will be returned by the google.longrunning.Operation.metadata field. - class PurgeMetadata - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Metadata related to the progress of the PurgeProducts operation. - # This will be returned by the google.longrunning.Operation.metadata field. - # @!attribute [rw] create_time - # @return [::Google::Protobuf::Timestamp] - # Operation create time. - # @!attribute [rw] update_time - # @return [::Google::Protobuf::Timestamp] - # Operation last update time. If the operation is done, this is also the - # finish time. - # @!attribute [rw] success_count - # @return [::Integer] - # Count of entries that were deleted successfully. - # @!attribute [rw] failure_count - # @return [::Integer] - # Count of entries that encountered errors while processing. - class PurgeProductsMetadata - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Request message for PurgeProducts method. - # @!attribute [rw] parent - # @return [::String] - # Required. The resource name of the branch under which the products are - # created. The format is - # `projects/${projectId}/locations/global/catalogs/${catalogId}/branches/${branchId}` - # @!attribute [rw] filter - # @return [::String] - # Required. The filter string to specify the products to be deleted with a - # length limit of 5,000 characters. - # - # Empty string filter is not allowed. "*" implies delete all items in a - # branch. - # - # The eligible fields for filtering are: - # - # * `availability`: Double quoted - # {::Google::Cloud::Retail::V2::Product#availability Product.availability} string. - # * `create_time` : in ISO 8601 "zulu" format. - # - # Supported syntax: - # - # * Comparators (">", "<", ">=", "<=", "="). - # Examples: - # * create_time <= "2015-02-13T17:05:46Z" - # * availability = "IN_STOCK" - # - # * Conjunctions ("AND") - # Examples: - # * create_time <= "2015-02-13T17:05:46Z" AND availability = "PREORDER" - # - # * Disjunctions ("OR") - # Examples: - # * create_time <= "2015-02-13T17:05:46Z" OR availability = "IN_STOCK" - # - # * Can support nested queries. - # Examples: - # * (create_time <= "2015-02-13T17:05:46Z" AND availability = "PREORDER") - # OR (create_time >= "2015-02-14T13:03:32Z" AND availability = "IN_STOCK") - # - # * Filter Limits: - # * Filter should not contain more than 6 conditions. - # * Max nesting depth should not exceed 2 levels. - # - # Examples queries: - # * Delete back order products created before a timestamp. - # create_time <= "2015-02-13T17:05:46Z" OR availability = "BACKORDER" - # @!attribute [rw] force - # @return [::Boolean] - # Actually perform the purge. - # If `force` is set to false, the method will return the expected purge count - # without deleting any products. - class PurgeProductsRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Response of the PurgeProductsRequest. If the long running operation is - # successfully done, then this message is returned by the - # google.longrunning.Operations.response field. - # @!attribute [rw] purge_count - # @return [::Integer] - # The total count of products purged as a result of the operation. - # @!attribute [rw] purge_sample - # @return [::Array<::String>] - # A sample of the product names that will be deleted. - # Only populated if `force` is set to false. A max of 100 names will be - # returned and the names are chosen at random. - class PurgeProductsResponse - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Request message for PurgeUserEvents method. - # @!attribute [rw] parent - # @return [::String] - # Required. The resource name of the catalog under which the events are - # created. The format is - # `projects/${projectId}/locations/global/catalogs/${catalogId}` - # @!attribute [rw] filter - # @return [::String] - # Required. The filter string to specify the events to be deleted with a - # length limit of 5,000 characters. Empty string filter is not allowed. The - # eligible fields for filtering are: - # - # * `eventType`: Double quoted - # {::Google::Cloud::Retail::V2::UserEvent#event_type UserEvent.event_type} string. - # * `eventTime`: in ISO 8601 "zulu" format. - # * `visitorId`: Double quoted string. Specifying this will delete all - # events associated with a visitor. - # * `userId`: Double quoted string. Specifying this will delete all events - # associated with a user. - # - # Examples: - # - # * Deleting all events in a time range: - # `eventTime > "2012-04-23T18:25:43.511Z" - # eventTime < "2012-04-23T18:30:43.511Z"` - # * Deleting specific eventType in time range: - # `eventTime > "2012-04-23T18:25:43.511Z" eventType = "detail-page-view"` - # * Deleting all events for a specific visitor: - # `visitorId = "visitor1024"` - # - # The filtering fields are assumed to have an implicit AND. - # @!attribute [rw] force - # @return [::Boolean] - # Actually perform the purge. - # If `force` is set to false, the method will return the expected purge count - # without deleting any user events. - class PurgeUserEventsRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Response of the PurgeUserEventsRequest. If the long running operation is - # successfully done, then this message is returned by the - # google.longrunning.Operations.response field. - # @!attribute [rw] purged_events_count - # @return [::Integer] - # The total count of events purged as a result of the operation. - class PurgeUserEventsResponse - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - end - end - end -end diff --git a/owl-bot-staging/google-cloud-retail-v2/proto_docs/google/cloud/retail/v2/safety.rb b/owl-bot-staging/google-cloud-retail-v2/proto_docs/google/cloud/retail/v2/safety.rb deleted file mode 100644 index c4c11c6cbd93..000000000000 --- a/owl-bot-staging/google-cloud-retail-v2/proto_docs/google/cloud/retail/v2/safety.rb +++ /dev/null @@ -1,96 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - - -module Google - module Cloud - module Retail - module V2 - # Safety settings. - # @!attribute [rw] category - # @return [::Google::Cloud::Retail::V2::HarmCategory] - # Harm category. - # @!attribute [rw] threshold - # @return [::Google::Cloud::Retail::V2::SafetySetting::HarmBlockThreshold] - # The harm block threshold. - # @!attribute [rw] method - # @return [::Google::Cloud::Retail::V2::SafetySetting::HarmBlockMethod] - # Optional. Specify if the threshold is used for probability or severity - # score. If not specified, the threshold is used for probability score. - class SafetySetting - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - - # Probability based thresholds levels for blocking. - module HarmBlockThreshold - # Unspecified harm block threshold. - HARM_BLOCK_THRESHOLD_UNSPECIFIED = 0 - - # Block low threshold and above (i.e. block more). - BLOCK_LOW_AND_ABOVE = 1 - - # Block medium threshold and above. - BLOCK_MEDIUM_AND_ABOVE = 2 - - # Block only high threshold (i.e. block less). - BLOCK_ONLY_HIGH = 3 - - # Block none. - BLOCK_NONE = 4 - - # Turn off the safety filter. - OFF = 5 - end - - # Probability vs severity. - module HarmBlockMethod - # The harm block method is unspecified. - HARM_BLOCK_METHOD_UNSPECIFIED = 0 - - # The harm block method uses both probability and severity scores. - SEVERITY = 1 - - # The harm block method uses the probability score. - PROBABILITY = 2 - end - end - - # Harm categories that will block the content. - module HarmCategory - # The harm category is unspecified. - HARM_CATEGORY_UNSPECIFIED = 0 - - # The harm category is hate speech. - HARM_CATEGORY_HATE_SPEECH = 1 - - # The harm category is dangerous content. - HARM_CATEGORY_DANGEROUS_CONTENT = 2 - - # The harm category is harassment. - HARM_CATEGORY_HARASSMENT = 3 - - # The harm category is sexually explicit content. - HARM_CATEGORY_SEXUALLY_EXPLICIT = 4 - - # The harm category is civic integrity. - HARM_CATEGORY_CIVIC_INTEGRITY = 5 - end - end - end - end -end diff --git a/owl-bot-staging/google-cloud-retail-v2/proto_docs/google/cloud/retail/v2/search_service.rb b/owl-bot-staging/google-cloud-retail-v2/proto_docs/google/cloud/retail/v2/search_service.rb deleted file mode 100644 index beb964cfdc66..000000000000 --- a/owl-bot-staging/google-cloud-retail-v2/proto_docs/google/cloud/retail/v2/search_service.rb +++ /dev/null @@ -1,1301 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - - -module Google - module Cloud - module Retail - module V2 - # Product attribute which structured by an attribute name and value. This - # structure is used in conversational search filters and answers. For example, - # if we have `name=color` and `value=red`, this means that the color is `red`. - # @!attribute [rw] name - # @return [::String] - # The attribute name. - # @!attribute [rw] value - # @return [::String] - # The attribute value. - class ProductAttributeValue - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Product attribute name and numeric interval. - # @!attribute [rw] name - # @return [::String] - # The attribute name (e.g. "length") - # @!attribute [rw] interval - # @return [::Google::Cloud::Retail::V2::Interval] - # The numeric interval (e.g. [10, 20)) - class ProductAttributeInterval - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # This field specifies the tile information including an attribute key, - # attribute value. More fields will be added in the future, eg: product id - # or product counts, etc. - # @!attribute [rw] product_attribute_value - # @return [::Google::Cloud::Retail::V2::ProductAttributeValue] - # The product attribute key-value. - # - # Note: The following fields are mutually exclusive: `product_attribute_value`, `product_attribute_interval`. If a field in that set is populated, all other fields in the set will automatically be cleared. - # @!attribute [rw] product_attribute_interval - # @return [::Google::Cloud::Retail::V2::ProductAttributeInterval] - # The product attribute key-numeric interval. - # - # Note: The following fields are mutually exclusive: `product_attribute_interval`, `product_attribute_value`. If a field in that set is populated, all other fields in the set will automatically be cleared. - # @!attribute [rw] representative_product_id - # @return [::String] - # The representative product id for this tile. - class Tile - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Request message for - # {::Google::Cloud::Retail::V2::SearchService::Client#search SearchService.Search} method. - # @!attribute [rw] placement - # @return [::String] - # Required. The resource name of the Retail Search serving config, such as - # `projects/*/locations/global/catalogs/default_catalog/servingConfigs/default_serving_config` - # or the name of the legacy placement resource, such as - # `projects/*/locations/global/catalogs/default_catalog/placements/default_search`. - # This field is used to identify the serving config name and the set - # of models that are used to make the search. - # @!attribute [rw] branch - # @return [::String] - # The branch resource name, such as - # `projects/*/locations/global/catalogs/default_catalog/branches/0`. - # - # Use "default_branch" as the branch ID or leave this field empty, to search - # products under the default branch. - # @!attribute [rw] query - # @return [::String] - # Raw search query. - # - # If this field is empty, the request is considered a category browsing - # request and returned results are based on - # {::Google::Cloud::Retail::V2::SearchRequest#filter filter} and - # {::Google::Cloud::Retail::V2::SearchRequest#page_categories page_categories}. - # @!attribute [rw] visitor_id - # @return [::String] - # Required. A unique identifier for tracking visitors. For example, this - # could be implemented with an HTTP cookie, which should be able to uniquely - # identify a visitor on a single device. This unique identifier should not - # change if the visitor logs in or out of the website. - # - # This should be the same identifier as - # {::Google::Cloud::Retail::V2::UserEvent#visitor_id UserEvent.visitor_id}. - # - # The field must be a UTF-8 encoded string with a length limit of 128 - # characters. Otherwise, an INVALID_ARGUMENT error is returned. - # @!attribute [rw] user_info - # @return [::Google::Cloud::Retail::V2::UserInfo] - # User information. - # @!attribute [rw] page_size - # @return [::Integer] - # Maximum number of {::Google::Cloud::Retail::V2::Product Product}s to return. If - # unspecified, defaults to a reasonable value. The maximum allowed value is - # 120. Values above 120 will be coerced to 120. - # - # If this field is negative, an INVALID_ARGUMENT is returned. - # @!attribute [rw] page_token - # @return [::String] - # A page token - # {::Google::Cloud::Retail::V2::SearchResponse#next_page_token SearchResponse.next_page_token}, - # received from a previous - # {::Google::Cloud::Retail::V2::SearchService::Client#search SearchService.Search} call. - # Provide this to retrieve the subsequent page. - # - # When paginating, all other parameters provided to - # {::Google::Cloud::Retail::V2::SearchService::Client#search SearchService.Search} must - # match the call that provided the page token. Otherwise, an INVALID_ARGUMENT - # error is returned. - # @!attribute [rw] offset - # @return [::Integer] - # A 0-indexed integer that specifies the current offset (that is, starting - # result location, amongst the {::Google::Cloud::Retail::V2::Product Product}s - # deemed by the API as relevant) in search results. This field is only - # considered if {::Google::Cloud::Retail::V2::SearchRequest#page_token page_token} - # is unset. - # - # If this field is negative, an INVALID_ARGUMENT is returned. - # @!attribute [rw] filter - # @return [::String] - # The filter syntax consists of an expression language for constructing a - # predicate from one or more fields of the products being filtered. Filter - # expression is case-sensitive. For more information, see - # [Filter](https://cloud.google.com/retail/docs/filter-and-order#filter). - # - # If this field is unrecognizable, an INVALID_ARGUMENT is returned. - # @!attribute [rw] canonical_filter - # @return [::String] - # The default filter that is applied when a user performs a search without - # checking any filters on the search page. - # - # The filter applied to every search request when quality improvement such as - # query expansion is needed. In the case a query does not have a sufficient - # amount of results this filter will be used to determine whether or not to - # enable the query expansion flow. The original filter will still be used for - # the query expanded search. - # This field is strongly recommended to achieve high search quality. - # - # For more information about filter syntax, see - # {::Google::Cloud::Retail::V2::SearchRequest#filter SearchRequest.filter}. - # @!attribute [rw] order_by - # @return [::String] - # The order in which products are returned. Products can be ordered by - # a field in an {::Google::Cloud::Retail::V2::Product Product} object. Leave it - # unset if ordered by relevance. OrderBy expression is case-sensitive. For - # more information, see - # [Order](https://cloud.google.com/retail/docs/filter-and-order#order). - # - # If this field is unrecognizable, an INVALID_ARGUMENT is returned. - # @!attribute [rw] facet_specs - # @return [::Array<::Google::Cloud::Retail::V2::SearchRequest::FacetSpec>] - # Facet specifications for faceted search. If empty, no facets are returned. - # - # A maximum of 200 values are allowed. Otherwise, an INVALID_ARGUMENT error - # is returned. - # @!attribute [rw] dynamic_facet_spec - # @deprecated This field is deprecated and may be removed in the next major version update. - # @return [::Google::Cloud::Retail::V2::SearchRequest::DynamicFacetSpec] - # Deprecated. Refer to https://cloud.google.com/retail/docs/configs#dynamic - # to enable dynamic facets. Do not set this field. - # - # The specification for dynamically generated facets. Notice that only - # textual facets can be dynamically generated. - # @!attribute [rw] boost_spec - # @return [::Google::Cloud::Retail::V2::SearchRequest::BoostSpec] - # Boost specification to boost certain products. For more information, see - # [Boost results](https://cloud.google.com/retail/docs/boosting). - # - # Notice that if both - # {::Google::Cloud::Retail::V2::ServingConfig#boost_control_ids ServingConfig.boost_control_ids} - # and - # {::Google::Cloud::Retail::V2::SearchRequest#boost_spec SearchRequest.boost_spec} - # are set, the boost conditions from both places are evaluated. If a search - # request matches multiple boost conditions, the final boost score is equal - # to the sum of the boost scores from all matched boost conditions. - # @!attribute [rw] query_expansion_spec - # @return [::Google::Cloud::Retail::V2::SearchRequest::QueryExpansionSpec] - # The query expansion specification that specifies the conditions under which - # query expansion occurs. For more information, see [Query - # expansion](https://cloud.google.com/retail/docs/result-size#query_expansion). - # @!attribute [rw] variant_rollup_keys - # @return [::Array<::String>] - # The keys to fetch and rollup the matching - # {::Google::Cloud::Retail::V2::Product::Type::VARIANT variant} - # {::Google::Cloud::Retail::V2::Product Product}s attributes, - # {::Google::Cloud::Retail::V2::FulfillmentInfo FulfillmentInfo} or - # {::Google::Cloud::Retail::V2::LocalInventory LocalInventory}s attributes. The - # attributes from all the matching - # {::Google::Cloud::Retail::V2::Product::Type::VARIANT variant} - # {::Google::Cloud::Retail::V2::Product Product}s or - # {::Google::Cloud::Retail::V2::LocalInventory LocalInventory}s are merged and - # de-duplicated. Notice that rollup attributes will lead to extra query - # latency. Maximum number of keys is 30. - # - # For {::Google::Cloud::Retail::V2::FulfillmentInfo FulfillmentInfo}, a - # fulfillment type and a fulfillment ID must be provided in the format of - # "fulfillmentType.fulfillmentId". E.g., in "pickupInStore.store123", - # "pickupInStore" is fulfillment type and "store123" is the store ID. - # - # Supported keys are: - # - # * colorFamilies - # * price - # * originalPrice - # * discount - # * variantId - # * inventory(place_id,price) - # * inventory(place_id,original_price) - # * inventory(place_id,attributes.key), where key is any key in the - # {::Google::Cloud::Retail::V2::LocalInventory#attributes Product.local_inventories.attributes} - # map. - # * attributes.key, where key is any key in the - # {::Google::Cloud::Retail::V2::Product#attributes Product.attributes} map. - # * pickupInStore.id, where id is any - # {::Google::Cloud::Retail::V2::FulfillmentInfo#place_ids FulfillmentInfo.place_ids} - # for {::Google::Cloud::Retail::V2::FulfillmentInfo#type FulfillmentInfo.type} - # "pickup-in-store". - # * shipToStore.id, where id is any - # {::Google::Cloud::Retail::V2::FulfillmentInfo#place_ids FulfillmentInfo.place_ids} - # for {::Google::Cloud::Retail::V2::FulfillmentInfo#type FulfillmentInfo.type} - # "ship-to-store". - # * sameDayDelivery.id, where id is any - # {::Google::Cloud::Retail::V2::FulfillmentInfo#place_ids FulfillmentInfo.place_ids} - # for {::Google::Cloud::Retail::V2::FulfillmentInfo#type FulfillmentInfo.type} - # "same-day-delivery". - # * nextDayDelivery.id, where id is any - # {::Google::Cloud::Retail::V2::FulfillmentInfo#place_ids FulfillmentInfo.place_ids} - # for {::Google::Cloud::Retail::V2::FulfillmentInfo#type FulfillmentInfo.type} - # "next-day-delivery". - # * customFulfillment1.id, where id is any - # {::Google::Cloud::Retail::V2::FulfillmentInfo#place_ids FulfillmentInfo.place_ids} - # for {::Google::Cloud::Retail::V2::FulfillmentInfo#type FulfillmentInfo.type} - # "custom-type-1". - # * customFulfillment2.id, where id is any - # {::Google::Cloud::Retail::V2::FulfillmentInfo#place_ids FulfillmentInfo.place_ids} - # for {::Google::Cloud::Retail::V2::FulfillmentInfo#type FulfillmentInfo.type} - # "custom-type-2". - # * customFulfillment3.id, where id is any - # {::Google::Cloud::Retail::V2::FulfillmentInfo#place_ids FulfillmentInfo.place_ids} - # for {::Google::Cloud::Retail::V2::FulfillmentInfo#type FulfillmentInfo.type} - # "custom-type-3". - # * customFulfillment4.id, where id is any - # {::Google::Cloud::Retail::V2::FulfillmentInfo#place_ids FulfillmentInfo.place_ids} - # for {::Google::Cloud::Retail::V2::FulfillmentInfo#type FulfillmentInfo.type} - # "custom-type-4". - # * customFulfillment5.id, where id is any - # {::Google::Cloud::Retail::V2::FulfillmentInfo#place_ids FulfillmentInfo.place_ids} - # for {::Google::Cloud::Retail::V2::FulfillmentInfo#type FulfillmentInfo.type} - # "custom-type-5". - # - # If this field is set to an invalid value other than these, an - # INVALID_ARGUMENT error is returned. - # @!attribute [rw] page_categories - # @return [::Array<::String>] - # The categories associated with a category page. Must be set for category - # navigation queries to achieve good search quality. The format should be - # the same as - # {::Google::Cloud::Retail::V2::UserEvent#page_categories UserEvent.page_categories}; - # - # To represent full path of category, use '>' sign to separate different - # hierarchies. If '>' is part of the category name, replace it with - # other character(s). - # - # Category pages include special pages such as sales or promotions. For - # instance, a special sale page may have the category hierarchy: - # "pageCategories" : ["Sales > 2017 Black Friday Deals"]. - # @!attribute [rw] search_mode - # @return [::Google::Cloud::Retail::V2::SearchRequest::SearchMode] - # The search mode of the search request. If not specified, a single search - # request triggers both product search and faceted search. - # @!attribute [rw] personalization_spec - # @return [::Google::Cloud::Retail::V2::SearchRequest::PersonalizationSpec] - # The specification for personalization. - # - # Notice that if both - # {::Google::Cloud::Retail::V2::ServingConfig#personalization_spec ServingConfig.personalization_spec} - # and - # {::Google::Cloud::Retail::V2::SearchRequest#personalization_spec SearchRequest.personalization_spec} - # are set. - # {::Google::Cloud::Retail::V2::SearchRequest#personalization_spec SearchRequest.personalization_spec} - # will override - # {::Google::Cloud::Retail::V2::ServingConfig#personalization_spec ServingConfig.personalization_spec}. - # @!attribute [rw] labels - # @return [::Google::Protobuf::Map{::String => ::String}] - # The labels applied to a resource must meet the following requirements: - # - # * Each resource can have multiple labels, up to a maximum of 64. - # * Each label must be a key-value pair. - # * Keys have a minimum length of 1 character and a maximum length of 63 - # characters and cannot be empty. Values can be empty and have a maximum - # length of 63 characters. - # * Keys and values can contain only lowercase letters, numeric characters, - # underscores, and dashes. All characters must use UTF-8 encoding, and - # international characters are allowed. - # * The key portion of a label must be unique. However, you can use the same - # key with multiple resources. - # * Keys must start with a lowercase letter or international character. - # - # For more information, see [Requirements for - # labels](https://cloud.google.com/resource-manager/docs/creating-managing-labels#requirements) - # in the Resource Manager documentation. - # @!attribute [rw] spell_correction_spec - # @return [::Google::Cloud::Retail::V2::SearchRequest::SpellCorrectionSpec] - # The spell correction specification that specifies the mode under - # which spell correction will take effect. - # @!attribute [rw] entity - # @return [::String] - # The entity for customers that may run multiple different entities, domains, - # sites or regions, for example, `Google US`, `Google Ads`, `Waymo`, - # `google.com`, `youtube.com`, etc. - # If this is set, it should be exactly matched with - # {::Google::Cloud::Retail::V2::UserEvent#entity UserEvent.entity} to get search - # results boosted by entity. - # @!attribute [rw] conversational_search_spec - # @return [::Google::Cloud::Retail::V2::SearchRequest::ConversationalSearchSpec] - # Optional. This field specifies all conversational related parameters - # addition to traditional retail search. - # @!attribute [rw] tile_navigation_spec - # @return [::Google::Cloud::Retail::V2::SearchRequest::TileNavigationSpec] - # Optional. This field specifies tile navigation related parameters. - # @!attribute [rw] language_code - # @return [::String] - # Optional. The BCP-47 language code, such as "en-US" or "sr-Latn" - # [list](https://www.unicode.org/cldr/charts/46/summary/root.html). For more - # information, see [Standardized codes](https://google.aip.dev/143). This - # field helps to better interpret the query. If a value isn't specified, the - # query language code is automatically detected, which may not be accurate. - # @!attribute [rw] region_code - # @return [::String] - # Optional. The Unicode country/region code (CLDR) of a location, such as - # "US" and "419" - # [list](https://www.unicode.org/cldr/charts/46/supplemental/territory_information.html). - # For more information, see [Standardized codes](https://google.aip.dev/143). - # If set, then results will be boosted based on the region_code provided. - # @!attribute [rw] place_id - # @return [::String] - # Optional. An id corresponding to a place, such as a store id or region id. - # When specified, we use the price from the local inventory with the matching - # product's - # {::Google::Cloud::Retail::V2::LocalInventory#place_id LocalInventory.place_id} - # for revenue optimization. - # @!attribute [rw] user_attributes - # @return [::Google::Protobuf::Map{::String => ::Google::Cloud::Retail::V2::StringList}] - # Optional. The user attributes that could be used for personalization of - # search results. - # * Populate at most 100 key-value pairs per query. - # * Only supports string keys and repeated string values. - # * Duplcate keys are not allowed within a single query. - # - # Example: - # user_attributes: [ - # { key: "pets" - # value { - # values: "dog" - # values: "cat" - # } - # }, - # { key: "state" - # value { - # values: "CA" - # } - # } - # ] - class SearchRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - - # A facet specification to perform faceted search. - # @!attribute [rw] facet_key - # @return [::Google::Cloud::Retail::V2::SearchRequest::FacetSpec::FacetKey] - # Required. The facet key specification. - # @!attribute [rw] limit - # @return [::Integer] - # Maximum of facet values that should be returned for this facet. If - # unspecified, defaults to 50. The maximum allowed value is 300. Values - # above 300 will be coerced to 300. - # - # If this field is negative, an INVALID_ARGUMENT is returned. - # @!attribute [rw] excluded_filter_keys - # @return [::Array<::String>] - # List of keys to exclude when faceting. - # - # By default, - # {::Google::Cloud::Retail::V2::SearchRequest::FacetSpec::FacetKey#key FacetKey.key} - # is not excluded from the filter unless it is listed in this field. - # - # Listing a facet key in this field allows its values to appear as facet - # results, even when they are filtered out of search results. Using this - # field does not affect what search results are returned. - # - # For example, suppose there are 100 products with the color facet "Red" - # and 200 products with the color facet "Blue". A query containing the - # filter "colorFamilies:ANY("Red")" and having "colorFamilies" as - # {::Google::Cloud::Retail::V2::SearchRequest::FacetSpec::FacetKey#key FacetKey.key} - # would by default return only "Red" products in the search results, and - # also return "Red" with count 100 as the only color facet. Although there - # are also blue products available, "Blue" would not be shown as an - # available facet value. - # - # If "colorFamilies" is listed in "excludedFilterKeys", then the query - # returns the facet values "Red" with count 100 and "Blue" with count - # 200, because the "colorFamilies" key is now excluded from the filter. - # Because this field doesn't affect search results, the search results - # are still correctly filtered to return only "Red" products. - # - # A maximum of 100 values are allowed. Otherwise, an INVALID_ARGUMENT error - # is returned. - # @!attribute [rw] enable_dynamic_position - # @return [::Boolean] - # Enables dynamic position for this facet. If set to true, the position of - # this facet among all facets in the response is determined by Google - # Retail Search. It is ordered together with dynamic facets if dynamic - # facets is enabled. If set to false, the position of this facet in the - # response is the same as in the request, and it is ranked before - # the facets with dynamic position enable and all dynamic facets. - # - # For example, you may always want to have rating facet returned in - # the response, but it's not necessarily to always display the rating facet - # at the top. In that case, you can set enable_dynamic_position to true so - # that the position of rating facet in response is determined by - # Google Retail Search. - # - # Another example, assuming you have the following facets in the request: - # - # * "rating", enable_dynamic_position = true - # - # * "price", enable_dynamic_position = false - # - # * "brands", enable_dynamic_position = false - # - # And also you have a dynamic facets enable, which generates a facet - # "gender". Then, the final order of the facets in the response can be - # ("price", "brands", "rating", "gender") or ("price", "brands", "gender", - # "rating") depends on how Google Retail Search orders "gender" and - # "rating" facets. However, notice that "price" and "brands" are always - # ranked at first and second position because their enable_dynamic_position - # values are false. - class FacetSpec - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - - # Specifies how a facet is computed. - # @!attribute [rw] key - # @return [::String] - # Required. Supported textual and numerical facet keys in - # {::Google::Cloud::Retail::V2::Product Product} object, over which the facet - # values are computed. Facet key is case-sensitive. - # - # Allowed facet keys when - # {::Google::Cloud::Retail::V2::SearchRequest::FacetSpec::FacetKey#query FacetKey.query} - # is not specified: - # - # * textual_field = - # * "brands" - # * "categories" - # * "genders" - # * "ageGroups" - # * "availability" - # * "colorFamilies" - # * "colors" - # * "sizes" - # * "materials" - # * "patterns" - # * "conditions" - # * "attributes.key" - # * "pickupInStore" - # * "shipToStore" - # * "sameDayDelivery" - # * "nextDayDelivery" - # * "customFulfillment1" - # * "customFulfillment2" - # * "customFulfillment3" - # * "customFulfillment4" - # * "customFulfillment5" - # * "inventory(place_id,attributes.key)" - # - # * numerical_field = - # * "price" - # * "discount" - # * "rating" - # * "ratingCount" - # * "attributes.key" - # * "inventory(place_id,price)" - # * "inventory(place_id,original_price)" - # * "inventory(place_id,attributes.key)" - # @!attribute [rw] intervals - # @return [::Array<::Google::Cloud::Retail::V2::Interval>] - # Set only if values should be bucketized into intervals. Must be set - # for facets with numerical values. Must not be set for facet with text - # values. Maximum number of intervals is 40. - # - # For all numerical facet keys that appear in the list of products from - # the catalog, the percentiles 0, 10, 30, 50, 70, 90, and 100 are - # computed from their distribution weekly. If the model assigns a high - # score to a numerical facet key and its intervals are not specified in - # the search request, these percentiles become the bounds - # for its intervals and are returned in the response. If the - # facet key intervals are specified in the request, then the specified - # intervals are returned instead. - # @!attribute [rw] restricted_values - # @return [::Array<::String>] - # Only get facet for the given restricted values. For example, when using - # "pickupInStore" as key and set restricted values to - # ["store123", "store456"], only facets for "store123" and "store456" are - # returned. Only supported on predefined textual fields, custom textual - # attributes and fulfillments. Maximum is 20. - # - # Must be set for the fulfillment facet keys: - # - # * pickupInStore - # - # * shipToStore - # - # * sameDayDelivery - # - # * nextDayDelivery - # - # * customFulfillment1 - # - # * customFulfillment2 - # - # * customFulfillment3 - # - # * customFulfillment4 - # - # * customFulfillment5 - # @!attribute [rw] prefixes - # @return [::Array<::String>] - # Only get facet values that start with the given string prefix. For - # example, suppose "categories" has three values "Women > Shoe", - # "Women > Dress" and "Men > Shoe". If set "prefixes" to "Women", the - # "categories" facet gives only "Women > Shoe" and "Women > Dress". - # Only supported on textual fields. Maximum is 10. - # @!attribute [rw] contains - # @return [::Array<::String>] - # Only get facet values that contains the given strings. For example, - # suppose "categories" has three values "Women > Shoe", - # "Women > Dress" and "Men > Shoe". If set "contains" to "Shoe", the - # "categories" facet gives only "Women > Shoe" and "Men > Shoe". - # Only supported on textual fields. Maximum is 10. - # @!attribute [rw] case_insensitive - # @return [::Boolean] - # True to make facet keys case insensitive when getting faceting - # values with prefixes or contains; false otherwise. - # @!attribute [rw] order_by - # @return [::String] - # The order in which - # {::Google::Cloud::Retail::V2::SearchResponse::Facet#values SearchResponse.Facet.values} - # are returned. - # - # Allowed values are: - # - # * "count desc", which means order by - # {::Google::Cloud::Retail::V2::SearchResponse::Facet::FacetValue#count SearchResponse.Facet.values.count} - # descending. - # - # * "value desc", which means order by - # {::Google::Cloud::Retail::V2::SearchResponse::Facet::FacetValue#value SearchResponse.Facet.values.value} - # descending. - # Only applies to textual facets. - # - # If not set, textual values are sorted in [natural - # order](https://en.wikipedia.org/wiki/Natural_sort_order); numerical - # intervals are sorted in the order given by - # {::Google::Cloud::Retail::V2::SearchRequest::FacetSpec::FacetKey#intervals FacetSpec.FacetKey.intervals}; - # {::Google::Cloud::Retail::V2::FulfillmentInfo#place_ids FulfillmentInfo.place_ids} - # are sorted in the order given by - # {::Google::Cloud::Retail::V2::SearchRequest::FacetSpec::FacetKey#restricted_values FacetSpec.FacetKey.restricted_values}. - # @!attribute [rw] query - # @return [::String] - # The query that is used to compute facet for the given facet key. - # When provided, it overrides the default behavior of facet - # computation. The query syntax is the same as a filter expression. See - # {::Google::Cloud::Retail::V2::SearchRequest#filter SearchRequest.filter} for - # detail syntax and limitations. Notice that there is no limitation on - # {::Google::Cloud::Retail::V2::SearchRequest::FacetSpec::FacetKey#key FacetKey.key} - # when query is specified. - # - # In the response, - # {::Google::Cloud::Retail::V2::SearchResponse::Facet::FacetValue#value SearchResponse.Facet.values.value} - # is always "1" and - # {::Google::Cloud::Retail::V2::SearchResponse::Facet::FacetValue#count SearchResponse.Facet.values.count} - # is the number of results that match the query. - # - # For example, you can set a customized facet for "shipToStore", - # where - # {::Google::Cloud::Retail::V2::SearchRequest::FacetSpec::FacetKey#key FacetKey.key} - # is "customizedShipToStore", and - # {::Google::Cloud::Retail::V2::SearchRequest::FacetSpec::FacetKey#query FacetKey.query} - # is "availability: ANY(\"IN_STOCK\") AND shipToStore: ANY(\"123\")". - # Then the facet counts the products that are both in stock and ship - # to store "123". - # @!attribute [rw] return_min_max - # @return [::Boolean] - # Returns the min and max value for each numerical facet intervals. - # Ignored for textual facets. - class FacetKey - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - end - - # The specifications of dynamically generated facets. - # @!attribute [rw] mode - # @return [::Google::Cloud::Retail::V2::SearchRequest::DynamicFacetSpec::Mode] - # Mode of the DynamicFacet feature. - # Defaults to - # {::Google::Cloud::Retail::V2::SearchRequest::DynamicFacetSpec::Mode::DISABLED Mode.DISABLED} - # if it's unset. - class DynamicFacetSpec - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - - # Enum to control DynamicFacet mode - module Mode - # Default value. - MODE_UNSPECIFIED = 0 - - # Disable Dynamic Facet. - DISABLED = 1 - - # Automatic mode built by Google Retail Search. - ENABLED = 2 - end - end - - # Boost specification to boost certain items. - # @!attribute [rw] condition_boost_specs - # @return [::Array<::Google::Cloud::Retail::V2::SearchRequest::BoostSpec::ConditionBoostSpec>] - # Condition boost specifications. If a product matches multiple conditions - # in the specifications, boost scores from these specifications are all - # applied and combined in a non-linear way. Maximum number of - # specifications is 20. - # @!attribute [rw] skip_boost_spec_validation - # @return [::Boolean] - # Whether to skip boostspec validation. If this field is set to true, - # invalid - # {::Google::Cloud::Retail::V2::SearchRequest::BoostSpec#condition_boost_specs BoostSpec.condition_boost_specs} - # will be ignored and valid - # {::Google::Cloud::Retail::V2::SearchRequest::BoostSpec#condition_boost_specs BoostSpec.condition_boost_specs} - # will still be applied. - class BoostSpec - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - - # Boost applies to products which match a condition. - # @!attribute [rw] condition - # @return [::String] - # An expression which specifies a boost condition. The syntax and - # supported fields are the same as a filter expression. See - # {::Google::Cloud::Retail::V2::SearchRequest#filter SearchRequest.filter} for - # detail syntax and limitations. - # - # Examples: - # - # * To boost products with product ID "product_1" or "product_2", and - # color - # "Red" or "Blue": - # * (id: ANY("product_1", "product_2")) AND (colorFamilies: - # ANY("Red","Blue")) - # @!attribute [rw] boost - # @return [::Float] - # Strength of the condition boost, which should be in [-1, 1]. Negative - # boost means demotion. Default is 0.0. - # - # Setting to 1.0 gives the item a big promotion. However, it does not - # necessarily mean that the boosted item will be the top result at all - # times, nor that other items will be excluded. Results could still be - # shown even when none of them matches the condition. And results that - # are significantly more relevant to the search query can still trump - # your heavily favored but irrelevant items. - # - # Setting to -1.0 gives the item a big demotion. However, results that - # are deeply relevant might still be shown. The item will have an - # upstream battle to get a fairly high ranking, but it is not blocked out - # completely. - # - # Setting to 0.0 means no boost applied. The boosting condition is - # ignored. - class ConditionBoostSpec - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - end - - # Specification to determine under which conditions query expansion should - # occur. - # @!attribute [rw] condition - # @return [::Google::Cloud::Retail::V2::SearchRequest::QueryExpansionSpec::Condition] - # The condition under which query expansion should occur. Default to - # {::Google::Cloud::Retail::V2::SearchRequest::QueryExpansionSpec::Condition::DISABLED Condition.DISABLED}. - # @!attribute [rw] pin_unexpanded_results - # @return [::Boolean] - # Whether to pin unexpanded results. The default value is false. If this - # field is set to true, - # unexpanded products are always at the top of the search results, followed - # by the expanded results. - class QueryExpansionSpec - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - - # Enum describing under which condition query expansion should occur. - module Condition - # Unspecified query expansion condition. In this case, server behavior - # defaults to - # {::Google::Cloud::Retail::V2::SearchRequest::QueryExpansionSpec::Condition::DISABLED Condition.DISABLED}. - CONDITION_UNSPECIFIED = 0 - - # Disabled query expansion. Only the exact search query is used, even if - # {::Google::Cloud::Retail::V2::SearchResponse#total_size SearchResponse.total_size} - # is zero. - DISABLED = 1 - - # Automatic query expansion built by Google Retail Search. - AUTO = 3 - end - end - - # The specification for personalization. - # @!attribute [rw] mode - # @return [::Google::Cloud::Retail::V2::SearchRequest::PersonalizationSpec::Mode] - # Defaults to - # {::Google::Cloud::Retail::V2::SearchRequest::PersonalizationSpec::Mode::AUTO Mode.AUTO}. - class PersonalizationSpec - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - - # The personalization mode of each search request. - module Mode - # Default value. In this case, server behavior defaults to - # {::Google::Cloud::Retail::V2::SearchRequest::PersonalizationSpec::Mode::AUTO Mode.AUTO}. - MODE_UNSPECIFIED = 0 - - # Let CRS decide whether to use personalization based on quality of user - # event data. - AUTO = 1 - - # Disable personalization. - DISABLED = 2 - end - end - - # The specification for query spell correction. - # @!attribute [rw] mode - # @return [::Google::Cloud::Retail::V2::SearchRequest::SpellCorrectionSpec::Mode] - # The mode under which spell correction should take effect to - # replace the original search query. Default to - # {::Google::Cloud::Retail::V2::SearchRequest::SpellCorrectionSpec::Mode::AUTO Mode.AUTO}. - class SpellCorrectionSpec - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - - # Enum describing under which mode spell correction should occur. - module Mode - # Unspecified spell correction mode. In this case, server behavior - # defaults to - # {::Google::Cloud::Retail::V2::SearchRequest::SpellCorrectionSpec::Mode::AUTO Mode.AUTO}. - MODE_UNSPECIFIED = 0 - - # Google Retail Search will try to find a spell suggestion if there - # is any and put in the - # {::Google::Cloud::Retail::V2::SearchResponse#corrected_query SearchResponse.corrected_query}. - # The spell suggestion will not be used as the search query. - SUGGESTION_ONLY = 1 - - # Automatic spell correction built by Google Retail Search. Search will - # be based on the corrected query if found. - AUTO = 2 - end - end - - # This field specifies all conversational related parameters addition to - # traditional retail search. - # @!attribute [rw] followup_conversation_requested - # @return [::Boolean] - # This field specifies whether the customer would like to do conversational - # search. If this field is set to true, conversational related extra - # information will be returned from server side, including follow-up - # question, answer options, etc. - # @!attribute [rw] conversation_id - # @return [::String] - # This field specifies the conversation id, which maintains the state of - # the conversation between client side and server side. Use the value from - # the previous [ConversationalSearchResult.conversation_id][]. For the - # initial request, this should be empty. - # @!attribute [rw] user_answer - # @return [::Google::Cloud::Retail::V2::SearchRequest::ConversationalSearchSpec::UserAnswer] - # This field specifies the current user answer during the conversational - # search. This can be either user selected from suggested answers or user - # input plain text. - class ConversationalSearchSpec - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - - # This field specifies the current user answer during the conversational - # search. This can be either user selected from suggested answers or user - # input plain text. - # @!attribute [rw] text_answer - # @return [::String] - # This field specifies the incremental input text from the user during - # the conversational search. - # - # Note: The following fields are mutually exclusive: `text_answer`, `selected_answer`. If a field in that set is populated, all other fields in the set will automatically be cleared. - # @!attribute [rw] selected_answer - # @return [::Google::Cloud::Retail::V2::SearchRequest::ConversationalSearchSpec::UserAnswer::SelectedAnswer] - # This field specifies the selected attributes during the - # conversational search. This should be a subset of - # [ConversationalSearchResult.suggested_answers][]. - # - # Note: The following fields are mutually exclusive: `selected_answer`, `text_answer`. If a field in that set is populated, all other fields in the set will automatically be cleared. - class UserAnswer - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - - # This field specifies the selected answers during the conversational - # search. - # @!attribute [rw] product_attribute_values - # @deprecated This field is deprecated and may be removed in the next major version update. - # @return [::Array<::Google::Cloud::Retail::V2::ProductAttributeValue>] - # This field is deprecated and should not be set. - # @!attribute [rw] product_attribute_value - # @return [::Google::Cloud::Retail::V2::ProductAttributeValue] - # This field specifies the selected answer which is a attribute - # key-value. - class SelectedAnswer - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - end - end - - # This field specifies tile navigation related parameters. - # @!attribute [rw] tile_navigation_requested - # @return [::Boolean] - # This field specifies whether the customer would like to request tile - # navigation. - # @!attribute [rw] applied_tiles - # @return [::Array<::Google::Cloud::Retail::V2::Tile>] - # This optional field specifies the tiles which are already clicked in - # client side. While the feature works without this field set, particularly - # for an initial query, it is highly recommended to set this field because - # it can improve the quality of the search response and removes possible - # duplicate tiles. - # - # NOTE: This field is not being used for filtering search - # products. Client side should also put all the applied tiles in - # {::Google::Cloud::Retail::V2::SearchRequest#filter SearchRequest.filter}. - class TileNavigationSpec - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # @!attribute [rw] key - # @return [::String] - # @!attribute [rw] value - # @return [::String] - class LabelsEntry - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # @!attribute [rw] key - # @return [::String] - # @!attribute [rw] value - # @return [::Google::Cloud::Retail::V2::StringList] - class UserAttributesEntry - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # The search mode of each search request. - module SearchMode - # Default value. In this case both product search and faceted search will - # be performed. Both - # {::Google::Cloud::Retail::V2::SearchResponse::SearchResult SearchResponse.SearchResult} - # and {::Google::Cloud::Retail::V2::SearchResponse::Facet SearchResponse.Facet} - # will be returned. - SEARCH_MODE_UNSPECIFIED = 0 - - # Only product search will be performed. The faceted search will be - # disabled. - # - # Only - # {::Google::Cloud::Retail::V2::SearchResponse::SearchResult SearchResponse.SearchResult} - # will be returned. - # {::Google::Cloud::Retail::V2::SearchResponse::Facet SearchResponse.Facet} will - # not be returned, even if - # {::Google::Cloud::Retail::V2::SearchRequest#facet_specs SearchRequest.facet_specs} - # or - # {::Google::Cloud::Retail::V2::SearchRequest#dynamic_facet_spec SearchRequest.dynamic_facet_spec} - # is set. - PRODUCT_SEARCH_ONLY = 1 - - # Only faceted search will be performed. The product search will be - # disabled. - # - # When in this mode, one or both of - # {::Google::Cloud::Retail::V2::SearchRequest#facet_specs SearchRequest.facet_specs} - # and - # {::Google::Cloud::Retail::V2::SearchRequest#dynamic_facet_spec SearchRequest.dynamic_facet_spec} - # should be set. Otherwise, an INVALID_ARGUMENT error is returned. Only - # {::Google::Cloud::Retail::V2::SearchResponse::Facet SearchResponse.Facet} will - # be returned. - # {::Google::Cloud::Retail::V2::SearchResponse::SearchResult SearchResponse.SearchResult} - # will not be returned. - FACETED_SEARCH_ONLY = 2 - end - end - - # Response message for - # {::Google::Cloud::Retail::V2::SearchService::Client#search SearchService.Search} method. - # @!attribute [rw] results - # @return [::Array<::Google::Cloud::Retail::V2::SearchResponse::SearchResult>] - # A list of matched items. The order represents the ranking. - # @!attribute [rw] facets - # @return [::Array<::Google::Cloud::Retail::V2::SearchResponse::Facet>] - # Results of facets requested by user. - # @!attribute [rw] total_size - # @return [::Integer] - # The estimated total count of matched items irrespective of pagination. The - # count of {::Google::Cloud::Retail::V2::SearchResponse#results results} returned - # by pagination may be less than the - # {::Google::Cloud::Retail::V2::SearchResponse#total_size total_size} that - # matches. - # @!attribute [rw] corrected_query - # @return [::String] - # Contains the spell corrected query, if found. If the spell correction type - # is AUTOMATIC, then the search results are based on corrected_query. - # Otherwise the original query is used for search. - # @!attribute [rw] attribution_token - # @return [::String] - # A unique search token. This should be included in the - # {::Google::Cloud::Retail::V2::UserEvent UserEvent} logs resulting from this - # search, which enables accurate attribution of search model performance. - # @!attribute [rw] next_page_token - # @return [::String] - # A token that can be sent as - # {::Google::Cloud::Retail::V2::SearchRequest#page_token SearchRequest.page_token} - # to retrieve the next page. If this field is omitted, there are no - # subsequent pages. - # @!attribute [rw] query_expansion_info - # @return [::Google::Cloud::Retail::V2::SearchResponse::QueryExpansionInfo] - # Query expansion information for the returned results. - # @!attribute [rw] redirect_uri - # @return [::String] - # The URI of a customer-defined redirect page. If redirect action is - # triggered, no search is performed, and only - # {::Google::Cloud::Retail::V2::SearchResponse#redirect_uri redirect_uri} and - # {::Google::Cloud::Retail::V2::SearchResponse#attribution_token attribution_token} - # are set in the response. - # @!attribute [rw] applied_controls - # @return [::Array<::String>] - # The fully qualified resource name of applied - # [controls](https://cloud.google.com/retail/docs/serving-control-rules). - # @!attribute [rw] pin_control_metadata - # @return [::Google::Cloud::Retail::V2::PinControlMetadata] - # Metadata for pin controls which were applicable to the request. - # This contains two map fields, one for all matched pins and one for pins - # which were matched but not applied. - # - # The two maps are keyed by pin position, and the values are the product ids - # which were matched to that pin. - # @!attribute [rw] invalid_condition_boost_specs - # @return [::Array<::Google::Cloud::Retail::V2::SearchRequest::BoostSpec::ConditionBoostSpec>] - # The invalid - # {::Google::Cloud::Retail::V2::SearchRequest::BoostSpec#condition_boost_specs SearchRequest.BoostSpec.condition_boost_specs} - # that are not applied during serving. - # @!attribute [rw] experiment_info - # @return [::Array<::Google::Cloud::Retail::V2::ExperimentInfo>] - # Metadata related to A/B testing experiment associated with this - # response. Only exists when an experiment is triggered. - # @!attribute [rw] conversational_search_result - # @return [::Google::Cloud::Retail::V2::SearchResponse::ConversationalSearchResult] - # This field specifies all related information that is needed on client - # side for UI rendering of conversational retail search. - # @!attribute [rw] tile_navigation_result - # @return [::Google::Cloud::Retail::V2::SearchResponse::TileNavigationResult] - # This field specifies all related information for tile navigation that will - # be used in client side. - class SearchResponse - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - - # Represents the search results. - # @!attribute [rw] id - # @return [::String] - # {::Google::Cloud::Retail::V2::Product#id Product.id} of the searched - # {::Google::Cloud::Retail::V2::Product Product}. - # @!attribute [rw] product - # @return [::Google::Cloud::Retail::V2::Product] - # The product data snippet in the search response. Only - # {::Google::Cloud::Retail::V2::Product#name Product.name} is guaranteed to be - # populated. - # - # {::Google::Cloud::Retail::V2::Product#variants Product.variants} contains the - # product variants that match the search query. If there are multiple - # product variants matching the query, top 5 most relevant product variants - # are returned and ordered by relevancy. - # - # If relevancy can be deternmined, use - # {::Google::Cloud::Retail::V2::SearchResponse::SearchResult#matching_variant_fields matching_variant_fields} - # to look up matched product variants fields. If relevancy cannot be - # determined, e.g. when searching "shoe" all products in a shoe product can - # be a match, 5 product variants are returned but order is meaningless. - # @!attribute [rw] matching_variant_count - # @return [::Integer] - # The count of matched - # {::Google::Cloud::Retail::V2::Product::Type::VARIANT variant} - # {::Google::Cloud::Retail::V2::Product Product}s. - # @!attribute [rw] matching_variant_fields - # @return [::Google::Protobuf::Map{::String => ::Google::Protobuf::FieldMask}] - # If a {::Google::Cloud::Retail::V2::Product::Type::VARIANT variant} - # {::Google::Cloud::Retail::V2::Product Product} matches the search query, this - # map indicates which {::Google::Cloud::Retail::V2::Product Product} fields are - # matched. The key is the - # {::Google::Cloud::Retail::V2::Product#name Product.name}, the value is a field - # mask of the matched {::Google::Cloud::Retail::V2::Product Product} fields. If - # matched attributes cannot be determined, this map will be empty. - # - # For example, a key "sku1" with field mask - # "products.color_info" indicates there is a match between - # "sku1" {::Google::Cloud::Retail::V2::ColorInfo ColorInfo} and the query. - # @!attribute [rw] variant_rollup_values - # @return [::Google::Protobuf::Map{::String => ::Google::Protobuf::Value}] - # The rollup matching - # {::Google::Cloud::Retail::V2::Product::Type::VARIANT variant} - # {::Google::Cloud::Retail::V2::Product Product} attributes. The key is one of - # the - # {::Google::Cloud::Retail::V2::SearchRequest#variant_rollup_keys SearchRequest.variant_rollup_keys}. - # The values are the merged and de-duplicated - # {::Google::Cloud::Retail::V2::Product Product} attributes. Notice that the - # rollup values are respect filter. For example, when filtering by - # "colorFamilies:ANY(\"red\")" and rollup "colorFamilies", only "red" is - # returned. - # - # For textual and numerical attributes, the rollup values is a list of - # string or double values with type - # {::Google::Protobuf::ListValue google.protobuf.ListValue}. For example, if - # there are two variants with colors "red" and "blue", the rollup values - # are - # - # { key: "colorFamilies" - # value { - # list_value { - # values { string_value: "red" } - # values { string_value: "blue" } - # } - # } - # } - # - # For {::Google::Cloud::Retail::V2::FulfillmentInfo FulfillmentInfo}, the rollup - # values is a double value with type - # {::Google::Protobuf::Value google.protobuf.Value}. For example, - # `{key: "pickupInStore.store1" value { number_value: 10 }}` means a there - # are 10 variants in this product are available in the store "store1". - # @!attribute [rw] personal_labels - # @return [::Array<::String>] - # Specifies previous events related to this product for this user based on - # {::Google::Cloud::Retail::V2::UserEvent UserEvent} with same - # {::Google::Cloud::Retail::V2::SearchRequest#visitor_id SearchRequest.visitor_id} - # or {::Google::Cloud::Retail::V2::UserInfo#user_id UserInfo.user_id}. - # - # This is set only when - # {::Google::Cloud::Retail::V2::SearchRequest::PersonalizationSpec#mode SearchRequest.PersonalizationSpec.mode} - # is - # {::Google::Cloud::Retail::V2::SearchRequest::PersonalizationSpec::Mode::AUTO SearchRequest.PersonalizationSpec.Mode.AUTO}. - # - # Possible values: - # - # * `purchased`: Indicates that this product has been purchased before. - # @!attribute [rw] model_scores - # @return [::Google::Protobuf::Map{::String => ::Google::Cloud::Retail::V2::DoubleList}] - # Google provided available scores. - class SearchResult - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - - # @!attribute [rw] key - # @return [::String] - # @!attribute [rw] value - # @return [::Google::Protobuf::FieldMask] - class MatchingVariantFieldsEntry - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # @!attribute [rw] key - # @return [::String] - # @!attribute [rw] value - # @return [::Google::Protobuf::Value] - class VariantRollupValuesEntry - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # @!attribute [rw] key - # @return [::String] - # @!attribute [rw] value - # @return [::Google::Cloud::Retail::V2::DoubleList] - class ModelScoresEntry - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - end - - # A facet result. - # @!attribute [rw] key - # @return [::String] - # The key for this facet. E.g., "colorFamilies" or "price" or - # "attributes.attr1". - # @!attribute [rw] values - # @return [::Array<::Google::Cloud::Retail::V2::SearchResponse::Facet::FacetValue>] - # The facet values for this field. - # @!attribute [rw] dynamic_facet - # @return [::Boolean] - # Whether the facet is dynamically generated. - class Facet - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - - # A facet value which contains value names and their count. - # @!attribute [rw] value - # @return [::String] - # Text value of a facet, such as "Black" for facet "colorFamilies". - # - # Note: The following fields are mutually exclusive: `value`, `interval`. If a field in that set is populated, all other fields in the set will automatically be cleared. - # @!attribute [rw] interval - # @return [::Google::Cloud::Retail::V2::Interval] - # Interval value for a facet, such as [10, 20) for facet "price". - # - # Note: The following fields are mutually exclusive: `interval`, `value`. If a field in that set is populated, all other fields in the set will automatically be cleared. - # @!attribute [rw] count - # @return [::Integer] - # Number of items that have this facet value. - # @!attribute [rw] min_value - # @return [::Float] - # The minimum value in the - # {::Google::Cloud::Retail::V2::SearchResponse::Facet::FacetValue#interval FacetValue.interval}. - # Only supported on numerical facets and returned if - # {::Google::Cloud::Retail::V2::SearchRequest::FacetSpec::FacetKey#return_min_max SearchRequest.FacetSpec.FacetKey.return_min_max} - # is true. - # @!attribute [rw] max_value - # @return [::Float] - # The maximum value in the - # {::Google::Cloud::Retail::V2::SearchResponse::Facet::FacetValue#interval FacetValue.interval}. - # Only supported on numerical facets and returned if - # {::Google::Cloud::Retail::V2::SearchRequest::FacetSpec::FacetKey#return_min_max SearchRequest.FacetSpec.FacetKey.return_min_max} - # is true. - class FacetValue - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - end - - # Information describing query expansion including whether expansion has - # occurred. - # @!attribute [rw] expanded_query - # @return [::Boolean] - # Bool describing whether query expansion has occurred. - # @!attribute [rw] pinned_result_count - # @return [::Integer] - # Number of pinned results. This field will only be set when expansion - # happens and - # {::Google::Cloud::Retail::V2::SearchRequest::QueryExpansionSpec#pin_unexpanded_results SearchRequest.QueryExpansionSpec.pin_unexpanded_results} - # is set to true. - class QueryExpansionInfo - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # This field specifies all related information that is needed on client - # side for UI rendering of conversational retail search. - # @!attribute [rw] conversation_id - # @return [::String] - # Conversation UUID. This field will be stored in client side storage to - # maintain the conversation session with server and will be used for next - # search request's - # {::Google::Cloud::Retail::V2::SearchRequest::ConversationalSearchSpec#conversation_id SearchRequest.ConversationalSearchSpec.conversation_id} - # to restore conversation state in server. - # @!attribute [rw] refined_query - # @return [::String] - # The current refined query for the conversational search. This field - # will be used in customer UI that the query in the search bar should be - # replaced with the refined query. For example, if - # {::Google::Cloud::Retail::V2::SearchRequest#query SearchRequest.query} is - # `dress` and next - # {::Google::Cloud::Retail::V2::SearchRequest::ConversationalSearchSpec::UserAnswer#text_answer SearchRequest.ConversationalSearchSpec.UserAnswer.text_answer} - # is `red color`, which does not match any product attribute value filters, - # the refined query will be `dress, red color`. - # @!attribute [rw] additional_filters - # @deprecated This field is deprecated and may be removed in the next major version update. - # @return [::Array<::Google::Cloud::Retail::V2::SearchResponse::ConversationalSearchResult::AdditionalFilter>] - # This field is deprecated but will be kept for backward compatibility. - # There is expected to have only one additional filter and the value will - # be the same to the same as field `additional_filter`. - # @!attribute [rw] followup_question - # @return [::String] - # The follow-up question. e.g., `What is the color?` - # @!attribute [rw] suggested_answers - # @return [::Array<::Google::Cloud::Retail::V2::SearchResponse::ConversationalSearchResult::SuggestedAnswer>] - # The answer options provided to client for the follow-up question. - # @!attribute [rw] additional_filter - # @return [::Google::Cloud::Retail::V2::SearchResponse::ConversationalSearchResult::AdditionalFilter] - # This is the incremental additional filters implied from the current - # user answer. User should add the suggested addition filters to the - # previous - # {::Google::Cloud::Retail::V2::SearchRequest#filter SearchRequest.filter}, and - # use the merged filter in the follow up search request. - class ConversationalSearchResult - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - - # Suggested answers to the follow-up question. - # @!attribute [rw] product_attribute_value - # @return [::Google::Cloud::Retail::V2::ProductAttributeValue] - # Product attribute value, including an attribute key and an - # attribute value. Other types can be added here in the future. - class SuggestedAnswer - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Additional filter that client side need to apply. - # @!attribute [rw] product_attribute_value - # @return [::Google::Cloud::Retail::V2::ProductAttributeValue] - # Product attribute value, including an attribute key and an - # attribute value. Other types can be added here in the future. - class AdditionalFilter - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - end - - # This field specifies all related information for tile navigation that will - # be used in client side. - # @!attribute [rw] tiles - # @return [::Array<::Google::Cloud::Retail::V2::Tile>] - # The current tiles that are used for tile navigation, sorted by - # engagement. - class TileNavigationResult - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - end - - # Metadata for active A/B testing experiment. - # @!attribute [rw] serving_config_experiment - # @return [::Google::Cloud::Retail::V2::ExperimentInfo::ServingConfigExperiment] - # A/B test between existing Cloud Retail Search - # {::Google::Cloud::Retail::V2::ServingConfig ServingConfig}s. - # @!attribute [rw] experiment - # @return [::String] - # The fully qualified resource name of the experiment that provides the - # serving config under test, should an active experiment exist. For example: - # `projects/*/locations/global/catalogs/default_catalog/experiments/experiment_id` - class ExperimentInfo - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - - # Metadata for active serving config A/B tests. - # @!attribute [rw] original_serving_config - # @return [::String] - # The fully qualified resource name of the original - # {::Google::Cloud::Retail::V2::SearchRequest#placement SearchRequest.placement} - # in the search request prior to reassignment by experiment API. For - # example: `projects/*/locations/*/catalogs/*/servingConfigs/*`. - # @!attribute [rw] experiment_serving_config - # @return [::String] - # The fully qualified resource name of the serving config - # `Experiment.VariantArm.serving_config_id` responsible for generating - # the search response. For example: - # `projects/*/locations/*/catalogs/*/servingConfigs/*`. - class ServingConfigExperiment - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - end - end - end - end -end diff --git a/owl-bot-staging/google-cloud-retail-v2/proto_docs/google/cloud/retail/v2/serving_config.rb b/owl-bot-staging/google-cloud-retail-v2/proto_docs/google/cloud/retail/v2/serving_config.rb deleted file mode 100644 index 2237b3c08193..000000000000 --- a/owl-bot-staging/google-cloud-retail-v2/proto_docs/google/cloud/retail/v2/serving_config.rb +++ /dev/null @@ -1,259 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - - -module Google - module Cloud - module Retail - module V2 - # Configures metadata that is used to generate serving time results (e.g. - # search results or recommendation predictions). - # @!attribute [rw] name - # @return [::String] - # Immutable. Fully qualified name - # `projects/*/locations/global/catalogs/*/servingConfig/*` - # @!attribute [rw] display_name - # @return [::String] - # Required. The human readable serving config display name. Used in Retail - # UI. - # - # This field must be a UTF-8 encoded string with a length limit of 128 - # characters. Otherwise, an INVALID_ARGUMENT error is returned. - # @!attribute [rw] model_id - # @return [::String] - # The id of the model in the same {::Google::Cloud::Retail::V2::Catalog Catalog} - # to use at serving time. Currently only RecommendationModels are supported: - # https://cloud.google.com/retail/recommendations-ai/docs/create-models - # Can be changed but only to a compatible model (e.g. - # others-you-may-like CTR to others-you-may-like CVR). - # - # Required when - # {::Google::Cloud::Retail::V2::ServingConfig#solution_types solution_types} is - # {::Google::Cloud::Retail::V2::SolutionType::SOLUTION_TYPE_RECOMMENDATION SOLUTION_TYPE_RECOMMENDATION}. - # @!attribute [rw] price_reranking_level - # @return [::String] - # How much price ranking we want in serving results. - # Price reranking causes product items with a similar - # recommendation probability to be ordered by price, with the - # highest-priced items first. This setting could result in a decrease in - # click-through and conversion rates. - # Allowed values are: - # - # * `no-price-reranking` - # * `low-price-reranking` - # * `medium-price-reranking` - # * `high-price-reranking` - # - # If not specified, we choose default based on model type. Default value: - # `no-price-reranking`. - # - # Can only be set if - # {::Google::Cloud::Retail::V2::ServingConfig#solution_types solution_types} is - # {::Google::Cloud::Retail::V2::SolutionType::SOLUTION_TYPE_RECOMMENDATION SOLUTION_TYPE_RECOMMENDATION}. - # @!attribute [rw] facet_control_ids - # @return [::Array<::String>] - # Facet specifications for faceted search. If empty, no facets are returned. - # The ids refer to the ids of {::Google::Cloud::Retail::V2::Control Control} - # resources with only the Facet control set. These controls are assumed to be - # in the same {::Google::Cloud::Retail::V2::Catalog Catalog} as the - # {::Google::Cloud::Retail::V2::ServingConfig ServingConfig}. - # A maximum of 100 values are allowed. Otherwise, an INVALID_ARGUMENT error - # is returned. - # - # Can only be set if - # {::Google::Cloud::Retail::V2::ServingConfig#solution_types solution_types} is - # {::Google::Cloud::Retail::V2::SolutionType::SOLUTION_TYPE_SEARCH SOLUTION_TYPE_SEARCH}. - # @!attribute [rw] dynamic_facet_spec - # @return [::Google::Cloud::Retail::V2::SearchRequest::DynamicFacetSpec] - # The specification for dynamically generated facets. Notice that only - # textual facets can be dynamically generated. - # - # Can only be set if - # {::Google::Cloud::Retail::V2::ServingConfig#solution_types solution_types} is - # {::Google::Cloud::Retail::V2::SolutionType::SOLUTION_TYPE_SEARCH SOLUTION_TYPE_SEARCH}. - # @!attribute [rw] boost_control_ids - # @return [::Array<::String>] - # Condition boost specifications. If a product matches multiple conditions - # in the specifications, boost scores from these specifications are all - # applied and combined in a non-linear way. Maximum number of - # specifications is 100. - # - # Notice that if both - # {::Google::Cloud::Retail::V2::ServingConfig#boost_control_ids ServingConfig.boost_control_ids} - # and - # {::Google::Cloud::Retail::V2::SearchRequest#boost_spec SearchRequest.boost_spec} - # are set, the boost conditions from both places are evaluated. If a search - # request matches multiple boost conditions, the final boost score is equal - # to the sum of the boost scores from all matched boost conditions. - # - # Can only be set if - # {::Google::Cloud::Retail::V2::ServingConfig#solution_types solution_types} is - # {::Google::Cloud::Retail::V2::SolutionType::SOLUTION_TYPE_SEARCH SOLUTION_TYPE_SEARCH}. - # @!attribute [rw] filter_control_ids - # @return [::Array<::String>] - # Condition filter specifications. If a product matches multiple conditions - # in the specifications, filters from these specifications are all - # applied and combined via the AND operator. Maximum number of - # specifications is 100. - # - # Can only be set if - # {::Google::Cloud::Retail::V2::ServingConfig#solution_types solution_types} is - # {::Google::Cloud::Retail::V2::SolutionType::SOLUTION_TYPE_SEARCH SOLUTION_TYPE_SEARCH}. - # @!attribute [rw] redirect_control_ids - # @return [::Array<::String>] - # Condition redirect specifications. Only the first triggered redirect action - # is applied, even if multiple apply. Maximum number of specifications is - # 1000. - # - # Can only be set if - # {::Google::Cloud::Retail::V2::ServingConfig#solution_types solution_types} is - # {::Google::Cloud::Retail::V2::SolutionType::SOLUTION_TYPE_SEARCH SOLUTION_TYPE_SEARCH}. - # @!attribute [rw] twoway_synonyms_control_ids - # @return [::Array<::String>] - # Condition synonyms specifications. If multiple syonyms conditions match, - # all matching synonyms control in the list will execute. Order of controls - # in the list will not matter. Maximum number of specifications is - # 100. - # - # Can only be set if - # {::Google::Cloud::Retail::V2::ServingConfig#solution_types solution_types} is - # {::Google::Cloud::Retail::V2::SolutionType::SOLUTION_TYPE_SEARCH SOLUTION_TYPE_SEARCH}. - # @!attribute [rw] oneway_synonyms_control_ids - # @return [::Array<::String>] - # Condition oneway synonyms specifications. If multiple oneway synonyms - # conditions match, all matching oneway synonyms controls in the list will - # execute. Order of controls in the list will not matter. Maximum number of - # specifications is 100. - # - # Can only be set if - # {::Google::Cloud::Retail::V2::ServingConfig#solution_types solution_types} is - # {::Google::Cloud::Retail::V2::SolutionType::SOLUTION_TYPE_SEARCH SOLUTION_TYPE_SEARCH}. - # @!attribute [rw] do_not_associate_control_ids - # @return [::Array<::String>] - # Condition do not associate specifications. If multiple do not associate - # conditions match, all matching do not associate controls in the list will - # execute. - # - Order does not matter. - # - Maximum number of specifications is 100. - # - # Can only be set if - # {::Google::Cloud::Retail::V2::ServingConfig#solution_types solution_types} is - # {::Google::Cloud::Retail::V2::SolutionType::SOLUTION_TYPE_SEARCH SOLUTION_TYPE_SEARCH}. - # @!attribute [rw] replacement_control_ids - # @return [::Array<::String>] - # Condition replacement specifications. - # - Applied according to the order in the list. - # - A previously replaced term can not be re-replaced. - # - Maximum number of specifications is 100. - # - # Can only be set if - # {::Google::Cloud::Retail::V2::ServingConfig#solution_types solution_types} is - # {::Google::Cloud::Retail::V2::SolutionType::SOLUTION_TYPE_SEARCH SOLUTION_TYPE_SEARCH}. - # @!attribute [rw] ignore_control_ids - # @return [::Array<::String>] - # Condition ignore specifications. If multiple ignore - # conditions match, all matching ignore controls in the list will - # execute. - # - Order does not matter. - # - Maximum number of specifications is 100. - # - # Can only be set if - # {::Google::Cloud::Retail::V2::ServingConfig#solution_types solution_types} is - # {::Google::Cloud::Retail::V2::SolutionType::SOLUTION_TYPE_SEARCH SOLUTION_TYPE_SEARCH}. - # @!attribute [rw] diversity_level - # @return [::String] - # How much diversity to use in recommendation model results e.g. - # `medium-diversity` or `high-diversity`. Currently supported values: - # - # * `no-diversity` - # * `low-diversity` - # * `medium-diversity` - # * `high-diversity` - # * `auto-diversity` - # - # If not specified, we choose default based on recommendation model - # type. Default value: `no-diversity`. - # - # Can only be set if - # {::Google::Cloud::Retail::V2::ServingConfig#solution_types solution_types} is - # {::Google::Cloud::Retail::V2::SolutionType::SOLUTION_TYPE_RECOMMENDATION SOLUTION_TYPE_RECOMMENDATION}. - # @!attribute [rw] diversity_type - # @return [::Google::Cloud::Retail::V2::ServingConfig::DiversityType] - # What kind of diversity to use - data driven or rule based. If unset, the - # server behavior defaults to - # {::Google::Cloud::Retail::V2::ServingConfig::DiversityType::RULE_BASED_DIVERSITY RULE_BASED_DIVERSITY}. - # @!attribute [rw] enable_category_filter_level - # @return [::String] - # Whether to add additional category filters on the `similar-items` model. - # If not specified, we enable it by default. - # Allowed values are: - # - # * `no-category-match`: No additional filtering of original results from - # the model and the customer's filters. - # * `relaxed-category-match`: Only keep results with categories that match - # at least one item categories in the PredictRequests's context item. - # * If customer also sends filters in the PredictRequest, then the results - # will satisfy both conditions (user given and category match). - # - # Can only be set if - # {::Google::Cloud::Retail::V2::ServingConfig#solution_types solution_types} is - # {::Google::Cloud::Retail::V2::SolutionType::SOLUTION_TYPE_RECOMMENDATION SOLUTION_TYPE_RECOMMENDATION}. - # @!attribute [rw] ignore_recs_denylist - # @return [::Boolean] - # When the flag is enabled, the products in the denylist will not be filtered - # out in the recommendation filtering results. - # @!attribute [rw] personalization_spec - # @return [::Google::Cloud::Retail::V2::SearchRequest::PersonalizationSpec] - # The specification for personalization spec. - # - # Can only be set if - # {::Google::Cloud::Retail::V2::ServingConfig#solution_types solution_types} is - # {::Google::Cloud::Retail::V2::SolutionType::SOLUTION_TYPE_SEARCH SOLUTION_TYPE_SEARCH}. - # - # Notice that if both - # {::Google::Cloud::Retail::V2::ServingConfig#personalization_spec ServingConfig.personalization_spec} - # and - # {::Google::Cloud::Retail::V2::SearchRequest#personalization_spec SearchRequest.personalization_spec} - # are set. - # {::Google::Cloud::Retail::V2::SearchRequest#personalization_spec SearchRequest.personalization_spec} - # will override - # {::Google::Cloud::Retail::V2::ServingConfig#personalization_spec ServingConfig.personalization_spec}. - # @!attribute [rw] solution_types - # @return [::Array<::Google::Cloud::Retail::V2::SolutionType>] - # Required. Immutable. Specifies the solution types that a serving config can - # be associated with. Currently we support setting only one type of solution. - class ServingConfig - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - - # What type of diversity - data or rule based. - module DiversityType - # Default value. - DIVERSITY_TYPE_UNSPECIFIED = 0 - - # Rule based diversity. - RULE_BASED_DIVERSITY = 2 - - # Data driven diversity. - DATA_DRIVEN_DIVERSITY = 3 - end - end - end - end - end -end diff --git a/owl-bot-staging/google-cloud-retail-v2/proto_docs/google/cloud/retail/v2/serving_config_service.rb b/owl-bot-staging/google-cloud-retail-v2/proto_docs/google/cloud/retail/v2/serving_config_service.rb deleted file mode 100644 index 943913f2996e..000000000000 --- a/owl-bot-staging/google-cloud-retail-v2/proto_docs/google/cloud/retail/v2/serving_config_service.rb +++ /dev/null @@ -1,143 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - - -module Google - module Cloud - module Retail - module V2 - # Request for CreateServingConfig method. - # @!attribute [rw] parent - # @return [::String] - # Required. Full resource name of parent. Format: - # `projects/{project_number}/locations/{location_id}/catalogs/{catalog_id}` - # @!attribute [rw] serving_config - # @return [::Google::Cloud::Retail::V2::ServingConfig] - # Required. The ServingConfig to create. - # @!attribute [rw] serving_config_id - # @return [::String] - # Required. The ID to use for the ServingConfig, which will become the final - # component of the ServingConfig's resource name. - # - # This value should be 4-63 characters, and valid characters - # are /[a-z][0-9]-_/. - class CreateServingConfigRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Request for UpdateServingConfig method. - # @!attribute [rw] serving_config - # @return [::Google::Cloud::Retail::V2::ServingConfig] - # Required. The ServingConfig to update. - # @!attribute [rw] update_mask - # @return [::Google::Protobuf::FieldMask] - # Indicates which fields in the provided - # {::Google::Cloud::Retail::V2::ServingConfig ServingConfig} to update. The - # following are NOT supported: - # - # * {::Google::Cloud::Retail::V2::ServingConfig#name ServingConfig.name} - # - # If not set, all supported fields are updated. - class UpdateServingConfigRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Request for DeleteServingConfig method. - # @!attribute [rw] name - # @return [::String] - # Required. The resource name of the ServingConfig to delete. Format: - # `projects/{project_number}/locations/{location_id}/catalogs/{catalog_id}/servingConfigs/{serving_config_id}` - class DeleteServingConfigRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Request for GetServingConfig method. - # @!attribute [rw] name - # @return [::String] - # Required. The resource name of the ServingConfig to get. Format: - # `projects/{project_number}/locations/{location_id}/catalogs/{catalog_id}/servingConfigs/{serving_config_id}` - class GetServingConfigRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Request for ListServingConfigs method. - # @!attribute [rw] parent - # @return [::String] - # Required. The catalog resource name. Format: - # `projects/{project_number}/locations/{location_id}/catalogs/{catalog_id}` - # @!attribute [rw] page_size - # @return [::Integer] - # Optional. Maximum number of results to return. If unspecified, defaults - # to 100. If a value greater than 100 is provided, at most 100 results are - # returned. - # @!attribute [rw] page_token - # @return [::String] - # Optional. A page token, received from a previous `ListServingConfigs` call. - # Provide this to retrieve the subsequent page. - class ListServingConfigsRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Response for ListServingConfigs method. - # @!attribute [rw] serving_configs - # @return [::Array<::Google::Cloud::Retail::V2::ServingConfig>] - # All the ServingConfigs for a given catalog. - # @!attribute [rw] next_page_token - # @return [::String] - # Pagination token, if not returned indicates the last page. - class ListServingConfigsResponse - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Request for AddControl method. - # @!attribute [rw] serving_config - # @return [::String] - # Required. The source ServingConfig resource name . Format: - # `projects/{project_number}/locations/{location_id}/catalogs/{catalog_id}/servingConfigs/{serving_config_id}` - # @!attribute [rw] control_id - # @return [::String] - # Required. The id of the control to apply. Assumed to be in the same catalog - # as the serving config - if id is not found a NOT_FOUND error is returned. - class AddControlRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Request for RemoveControl method. - # @!attribute [rw] serving_config - # @return [::String] - # Required. The source ServingConfig resource name . Format: - # `projects/{project_number}/locations/{location_id}/catalogs/{catalog_id}/servingConfigs/{serving_config_id}` - # @!attribute [rw] control_id - # @return [::String] - # Required. The id of the control to apply. Assumed to be in the same catalog - # as the serving config. - class RemoveControlRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - end - end - end -end diff --git a/owl-bot-staging/google-cloud-retail-v2/proto_docs/google/cloud/retail/v2/user_event.rb b/owl-bot-staging/google-cloud-retail-v2/proto_docs/google/cloud/retail/v2/user_event.rb deleted file mode 100644 index 2c119fd76473..000000000000 --- a/owl-bot-staging/google-cloud-retail-v2/proto_docs/google/cloud/retail/v2/user_event.rb +++ /dev/null @@ -1,364 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - - -module Google - module Cloud - module Retail - module V2 - # UserEvent captures all metadata information Retail API needs to know about - # how end users interact with customers' website. - # @!attribute [rw] event_type - # @return [::String] - # Required. User event type. Allowed values are: - # - # * `add-to-cart`: Products being added to cart. - # * `remove-from-cart`: Products being removed from cart. - # * `category-page-view`: Special pages such as sale or promotion pages - # viewed. - # * `detail-page-view`: Products detail page viewed. - # * `home-page-view`: Homepage viewed. - # * `purchase-complete`: User finishing a purchase. - # * `search`: Product search. - # * `shopping-cart-page-view`: User viewing a shopping cart. - # @!attribute [rw] visitor_id - # @return [::String] - # Required. A unique identifier for tracking visitors. - # - # For example, this could be implemented with an HTTP cookie, which should be - # able to uniquely identify a visitor on a single device. This unique - # identifier should not change if the visitor log in/out of the website. - # - # Don't set the field to the same fixed ID for different users. This mixes - # the event history of those users together, which results in degraded model - # quality. - # - # The field must be a UTF-8 encoded string with a length limit of 128 - # characters. Otherwise, an INVALID_ARGUMENT error is returned. - # - # The field should not contain PII or user-data. We recommend to use Google - # Analytics [Client - # ID](https://developers.google.com/analytics/devguides/collection/analyticsjs/field-reference#clientId) - # for this field. - # @!attribute [rw] session_id - # @return [::String] - # A unique identifier for tracking a visitor session with a length limit of - # 128 bytes. A session is an aggregation of an end user behavior in a time - # span. - # - # A general guideline to populate the session_id: - # 1. If user has no activity for 30 min, a new session_id should be assigned. - # 2. The session_id should be unique across users, suggest use uuid or add - # visitor_id as prefix. - # @!attribute [rw] event_time - # @return [::Google::Protobuf::Timestamp] - # Only required for - # {::Google::Cloud::Retail::V2::UserEventService::Client#import_user_events UserEventService.ImportUserEvents} - # method. Timestamp of when the user event happened. - # @!attribute [rw] experiment_ids - # @return [::Array<::String>] - # A list of identifiers for the independent experiment groups this user event - # belongs to. This is used to distinguish between user events associated with - # different experiment setups (e.g. using Retail API, using different - # recommendation models). - # @!attribute [rw] attribution_token - # @return [::String] - # Highly recommended for user events that are the result of - # {::Google::Cloud::Retail::V2::PredictionService::Client#predict PredictionService.Predict}. - # This field enables accurate attribution of recommendation model - # performance. - # - # The value must be a valid - # {::Google::Cloud::Retail::V2::PredictResponse#attribution_token PredictResponse.attribution_token} - # for user events that are the result of - # {::Google::Cloud::Retail::V2::PredictionService::Client#predict PredictionService.Predict}. - # The value must be a valid - # {::Google::Cloud::Retail::V2::SearchResponse#attribution_token SearchResponse.attribution_token} - # for user events that are the result of - # {::Google::Cloud::Retail::V2::SearchService::Client#search SearchService.Search}. - # - # This token enables us to accurately attribute page view or purchase back to - # the event and the particular predict response containing this - # clicked/purchased product. If user clicks on product K in the - # recommendation results, pass - # {::Google::Cloud::Retail::V2::PredictResponse#attribution_token PredictResponse.attribution_token} - # as a URL parameter to product K's page. When recording events on product - # K's page, log the - # {::Google::Cloud::Retail::V2::PredictResponse#attribution_token PredictResponse.attribution_token} - # to this field. - # @!attribute [rw] product_details - # @return [::Array<::Google::Cloud::Retail::V2::ProductDetail>] - # The main product details related to the event. - # - # This field is optional except for the following event types: - # - # * `add-to-cart` - # * `detail-page-view` - # * `purchase-complete` - # - # In a `search` event, this field represents the products returned to the end - # user on the current page (the end user may have not finished browsing the - # whole page yet). When a new page is returned to the end user, after - # pagination/filtering/ordering even for the same query, a new `search` event - # with different - # {::Google::Cloud::Retail::V2::UserEvent#product_details product_details} is - # desired. The end user may have not finished browsing the whole page yet. - # @!attribute [rw] completion_detail - # @return [::Google::Cloud::Retail::V2::CompletionDetail] - # The main auto-completion details related to the event. - # - # This field should be set for `search` event when autocomplete function is - # enabled and the user clicks a suggestion for search. - # @!attribute [rw] attributes - # @return [::Google::Protobuf::Map{::String => ::Google::Cloud::Retail::V2::CustomAttribute}] - # Extra user event features to include in the recommendation model. - # - # If you provide custom attributes for ingested user events, also include - # them in the user events that you associate with prediction requests. Custom - # attribute formatting must be consistent between imported events and events - # provided with prediction requests. This lets the Retail API use - # those custom attributes when training models and serving predictions, which - # helps improve recommendation quality. - # - # This field needs to pass all below criteria, otherwise an INVALID_ARGUMENT - # error is returned: - # - # * The key must be a UTF-8 encoded string with a length limit of 5,000 - # characters. - # * For text attributes, at most 400 values are allowed. Empty values are not - # allowed. Each value must be a UTF-8 encoded string with a length limit of - # 256 characters. - # * For number attributes, at most 400 values are allowed. - # - # For product recommendations, an example of extra user information is - # traffic_channel, which is how a user arrives at the site. Users can arrive - # at the site by coming to the site directly, coming through Google - # search, or in other ways. - # @!attribute [rw] cart_id - # @return [::String] - # The ID or name of the associated shopping cart. This ID is used - # to associate multiple items added or present in the cart before purchase. - # - # This can only be set for `add-to-cart`, `purchase-complete`, or - # `shopping-cart-page-view` events. - # @!attribute [rw] purchase_transaction - # @return [::Google::Cloud::Retail::V2::PurchaseTransaction] - # A transaction represents the entire purchase transaction. - # - # Required for `purchase-complete` events. Other event types should not set - # this field. Otherwise, an INVALID_ARGUMENT error is returned. - # @!attribute [rw] search_query - # @return [::String] - # The user's search query. - # - # See {::Google::Cloud::Retail::V2::SearchRequest#query SearchRequest.query} for - # definition. - # - # The value must be a UTF-8 encoded string with a length limit of 5,000 - # characters. Otherwise, an INVALID_ARGUMENT error is returned. - # - # At least one of - # {::Google::Cloud::Retail::V2::UserEvent#search_query search_query} or - # {::Google::Cloud::Retail::V2::UserEvent#page_categories page_categories} is - # required for `search` events. Other event types should not set this field. - # Otherwise, an INVALID_ARGUMENT error is returned. - # @!attribute [rw] filter - # @return [::String] - # The filter syntax consists of an expression language for constructing a - # predicate from one or more fields of the products being filtered. - # - # See {::Google::Cloud::Retail::V2::SearchRequest#filter SearchRequest.filter} for - # definition and syntax. - # - # The value must be a UTF-8 encoded string with a length limit of 1,000 - # characters. Otherwise, an INVALID_ARGUMENT error is returned. - # @!attribute [rw] order_by - # @return [::String] - # The order in which products are returned. - # - # See {::Google::Cloud::Retail::V2::SearchRequest#order_by SearchRequest.order_by} - # for definition and syntax. - # - # The value must be a UTF-8 encoded string with a length limit of 1,000 - # characters. Otherwise, an INVALID_ARGUMENT error is returned. - # - # This can only be set for `search` events. Other event types should not set - # this field. Otherwise, an INVALID_ARGUMENT error is returned. - # @!attribute [rw] offset - # @return [::Integer] - # An integer that specifies the current offset for pagination (the 0-indexed - # starting location, amongst the products deemed by the API as relevant). - # - # See {::Google::Cloud::Retail::V2::SearchRequest#offset SearchRequest.offset} for - # definition. - # - # If this field is negative, an INVALID_ARGUMENT is returned. - # - # This can only be set for `search` events. Other event types should not set - # this field. Otherwise, an INVALID_ARGUMENT error is returned. - # @!attribute [rw] page_categories - # @return [::Array<::String>] - # The categories associated with a category page. - # - # To represent full path of category, use '>' sign to separate different - # hierarchies. If '>' is part of the category name, replace it with - # other character(s). - # - # Category pages include special pages such as sales or promotions. For - # instance, a special sale page may have the category hierarchy: - # "pageCategories" : ["Sales > 2017 Black Friday Deals"]. - # - # Required for `category-page-view` events. At least one of - # {::Google::Cloud::Retail::V2::UserEvent#search_query search_query} or - # {::Google::Cloud::Retail::V2::UserEvent#page_categories page_categories} is - # required for `search` events. Other event types should not set this field. - # Otherwise, an INVALID_ARGUMENT error is returned. - # @!attribute [rw] user_info - # @return [::Google::Cloud::Retail::V2::UserInfo] - # User information. - # @!attribute [rw] uri - # @return [::String] - # Complete URL (window.location.href) of the user's current page. - # - # When using the client side event reporting with JavaScript pixel and Google - # Tag Manager, this value is filled in automatically. Maximum length 5,000 - # characters. - # @!attribute [rw] referrer_uri - # @return [::String] - # The referrer URL of the current page. - # - # When using the client side event reporting with JavaScript pixel and Google - # Tag Manager, this value is filled in automatically. - # @!attribute [rw] page_view_id - # @return [::String] - # A unique ID of a web page view. - # - # This should be kept the same for all user events triggered from the same - # pageview. For example, an item detail page view could trigger multiple - # events as the user is browsing the page. The `pageViewId` property should - # be kept the same for all these events so that they can be grouped together - # properly. - # - # When using the client side event reporting with JavaScript pixel and Google - # Tag Manager, this value is filled in automatically. - # @!attribute [rw] entity - # @return [::String] - # The entity for customers that may run multiple different entities, domains, - # sites or regions, for example, `Google US`, `Google Ads`, `Waymo`, - # `google.com`, `youtube.com`, etc. - # We recommend that you set this field to get better per-entity search, - # completion, and prediction results. - class UserEvent - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - - # @!attribute [rw] key - # @return [::String] - # @!attribute [rw] value - # @return [::Google::Cloud::Retail::V2::CustomAttribute] - class AttributesEntry - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - end - - # Detailed product information associated with a user event. - # @!attribute [rw] product - # @return [::Google::Cloud::Retail::V2::Product] - # Required. {::Google::Cloud::Retail::V2::Product Product} information. - # - # Required field(s): - # - # * {::Google::Cloud::Retail::V2::Product#id Product.id} - # - # Optional override field(s): - # - # * {::Google::Cloud::Retail::V2::Product#price_info Product.price_info} - # - # If any supported optional fields are provided, we will treat them as a full - # override when looking up product information from the catalog. Thus, it is - # important to ensure that the overriding fields are accurate and - # complete. - # - # All other product fields are ignored and instead populated via catalog - # lookup after event ingestion. - # @!attribute [rw] quantity - # @return [::Google::Protobuf::Int32Value] - # Quantity of the product associated with the user event. - # - # For example, this field will be 2 if two products are added to the shopping - # cart for `purchase-complete` event. Required for `add-to-cart` and - # `purchase-complete` event types. - class ProductDetail - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Detailed completion information including completion attribution token and - # clicked completion info. - # @!attribute [rw] completion_attribution_token - # @return [::String] - # Completion attribution token in - # {::Google::Cloud::Retail::V2::CompleteQueryResponse#attribution_token CompleteQueryResponse.attribution_token}. - # @!attribute [rw] selected_suggestion - # @return [::String] - # End user selected - # {::Google::Cloud::Retail::V2::CompleteQueryResponse::CompletionResult#suggestion CompleteQueryResponse.CompletionResult.suggestion}. - # @!attribute [rw] selected_position - # @return [::Integer] - # End user selected - # {::Google::Cloud::Retail::V2::CompleteQueryResponse::CompletionResult#suggestion CompleteQueryResponse.CompletionResult.suggestion} - # position, starting from 0. - class CompletionDetail - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # A transaction represents the entire purchase transaction. - # @!attribute [rw] id - # @return [::String] - # The transaction ID with a length limit of 128 characters. - # @!attribute [rw] revenue - # @return [::Float] - # Required. Total non-zero revenue or grand total associated with the - # transaction. This value include shipping, tax, or other adjustments to - # total revenue that you want to include as part of your revenue - # calculations. - # @!attribute [rw] tax - # @return [::Float] - # All the taxes associated with the transaction. - # @!attribute [rw] cost - # @return [::Float] - # All the costs associated with the products. These can be manufacturing - # costs, shipping expenses not borne by the end user, or any other costs, - # such that: - # - # * Profit = {::Google::Cloud::Retail::V2::PurchaseTransaction#revenue revenue} - - # {::Google::Cloud::Retail::V2::PurchaseTransaction#tax tax} - - # {::Google::Cloud::Retail::V2::PurchaseTransaction#cost cost} - # @!attribute [rw] currency_code - # @return [::String] - # Required. Currency code. Use three-character ISO-4217 code. - class PurchaseTransaction - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - end - end - end -end diff --git a/owl-bot-staging/google-cloud-retail-v2/proto_docs/google/cloud/retail/v2/user_event_service.rb b/owl-bot-staging/google-cloud-retail-v2/proto_docs/google/cloud/retail/v2/user_event_service.rb deleted file mode 100644 index cb0896f85338..000000000000 --- a/owl-bot-staging/google-cloud-retail-v2/proto_docs/google/cloud/retail/v2/user_event_service.rb +++ /dev/null @@ -1,130 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - - -module Google - module Cloud - module Retail - module V2 - # Request message for WriteUserEvent method. - # @!attribute [rw] parent - # @return [::String] - # Required. The parent catalog resource name, such as - # `projects/1234/locations/global/catalogs/default_catalog`. - # @!attribute [rw] user_event - # @return [::Google::Cloud::Retail::V2::UserEvent] - # Required. User event to write. - # @!attribute [rw] write_async - # @return [::Boolean] - # If set to true, the user event will be written asynchronously after - # validation, and the API will respond without waiting for the write. - # Therefore, silent failures can occur even if the API returns success. In - # case of silent failures, error messages can be found in Stackdriver logs. - class WriteUserEventRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Request message for CollectUserEvent method. - # @!attribute [rw] prebuilt_rule - # @return [::String] - # The prebuilt rule name that can convert a specific type of raw_json. - # For example: "ga4_bq" rule for the GA4 user event schema. - # @!attribute [rw] parent - # @return [::String] - # Required. The parent catalog name, such as - # `projects/1234/locations/global/catalogs/default_catalog`. - # @!attribute [rw] user_event - # @return [::String] - # Required. URL encoded UserEvent proto with a length limit of 2,000,000 - # characters. - # @!attribute [rw] uri - # @return [::String] - # The URL including cgi-parameters but excluding the hash fragment with a - # length limit of 5,000 characters. This is often more useful than the - # referer URL, because many browsers only send the domain for 3rd party - # requests. - # @!attribute [rw] ets - # @return [::Integer] - # The event timestamp in milliseconds. This prevents browser caching of - # otherwise identical get requests. The name is abbreviated to reduce the - # payload bytes. - # @!attribute [rw] raw_json - # @return [::String] - # An arbitrary serialized JSON string that contains necessary information - # that can comprise a user event. When this field is specified, the - # user_event field will be ignored. Note: line-delimited JSON is not - # supported, a single JSON only. - class CollectUserEventRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Request message for RejoinUserEvents method. - # @!attribute [rw] parent - # @return [::String] - # Required. The parent catalog resource name, such as - # `projects/1234/locations/global/catalogs/default_catalog`. - # @!attribute [rw] user_event_rejoin_scope - # @return [::Google::Cloud::Retail::V2::RejoinUserEventsRequest::UserEventRejoinScope] - # The type of the user event rejoin to define the scope and range of the user - # events to be rejoined with the latest product catalog. Defaults to - # `USER_EVENT_REJOIN_SCOPE_UNSPECIFIED` if this field is not set, or set to - # an invalid integer value. - class RejoinUserEventsRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - - # The scope of user events to be rejoined with the latest product catalog. - # If the rejoining aims at reducing number of unjoined events, set - # `UserEventRejoinScope` to `UNJOINED_EVENTS`. - # If the rejoining aims at correcting product catalog information in joined - # events, set `UserEventRejoinScope` to `JOINED_EVENTS`. - # If all events needs to be rejoined, set `UserEventRejoinScope` to - # `USER_EVENT_REJOIN_SCOPE_UNSPECIFIED`. - module UserEventRejoinScope - # Rejoin all events with the latest product catalog, including both joined - # events and unjoined events. - USER_EVENT_REJOIN_SCOPE_UNSPECIFIED = 0 - - # Only rejoin joined events with the latest product catalog. - JOINED_EVENTS = 1 - - # Only rejoin unjoined events with the latest product catalog. - UNJOINED_EVENTS = 2 - end - end - - # Response message for `RejoinUserEvents` method. - # @!attribute [rw] rejoined_user_events_count - # @return [::Integer] - # Number of user events that were joined with latest product catalog. - class RejoinUserEventsResponse - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Metadata for `RejoinUserEvents` method. - class RejoinUserEventsMetadata - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - end - end - end -end diff --git a/owl-bot-staging/google-cloud-retail-v2/proto_docs/google/longrunning/operations.rb b/owl-bot-staging/google-cloud-retail-v2/proto_docs/google/longrunning/operations.rb deleted file mode 100644 index 7a757f512165..000000000000 --- a/owl-bot-staging/google-cloud-retail-v2/proto_docs/google/longrunning/operations.rb +++ /dev/null @@ -1,191 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - - -module Google - module Longrunning - # This resource represents a long-running operation that is the result of a - # network API call. - # @!attribute [rw] name - # @return [::String] - # The server-assigned name, which is only unique within the same service that - # originally returns it. If you use the default HTTP mapping, the - # `name` should be a resource name ending with `operations/{unique_id}`. - # @!attribute [rw] metadata - # @return [::Google::Protobuf::Any] - # Service-specific metadata associated with the operation. It typically - # contains progress information and common metadata such as create time. - # Some services might not provide such metadata. Any method that returns a - # long-running operation should document the metadata type, if any. - # @!attribute [rw] done - # @return [::Boolean] - # If the value is `false`, it means the operation is still in progress. - # If `true`, the operation is completed, and either `error` or `response` is - # available. - # @!attribute [rw] error - # @return [::Google::Rpc::Status] - # The error result of the operation in case of failure or cancellation. - # - # Note: The following fields are mutually exclusive: `error`, `response`. If a field in that set is populated, all other fields in the set will automatically be cleared. - # @!attribute [rw] response - # @return [::Google::Protobuf::Any] - # The normal, successful response of the operation. If the original - # method returns no data on success, such as `Delete`, the response is - # `google.protobuf.Empty`. If the original method is standard - # `Get`/`Create`/`Update`, the response should be the resource. For other - # methods, the response should have the type `XxxResponse`, where `Xxx` - # is the original method name. For example, if the original method name - # is `TakeSnapshot()`, the inferred response type is - # `TakeSnapshotResponse`. - # - # Note: The following fields are mutually exclusive: `response`, `error`. If a field in that set is populated, all other fields in the set will automatically be cleared. - class Operation - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # The request message for - # Operations.GetOperation. - # @!attribute [rw] name - # @return [::String] - # The name of the operation resource. - class GetOperationRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # The request message for - # Operations.ListOperations. - # @!attribute [rw] name - # @return [::String] - # The name of the operation's parent resource. - # @!attribute [rw] filter - # @return [::String] - # The standard list filter. - # @!attribute [rw] page_size - # @return [::Integer] - # The standard list page size. - # @!attribute [rw] page_token - # @return [::String] - # The standard list page token. - # @!attribute [rw] return_partial_success - # @return [::Boolean] - # When set to `true`, operations that are reachable are returned as normal, - # and those that are unreachable are returned in the - # [ListOperationsResponse.unreachable] field. - # - # This can only be `true` when reading across collections e.g. when `parent` - # is set to `"projects/example/locations/-"`. - # - # This field is not by default supported and will result in an - # `UNIMPLEMENTED` error if set unless explicitly documented otherwise in - # service or product specific documentation. - class ListOperationsRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # The response message for - # Operations.ListOperations. - # @!attribute [rw] operations - # @return [::Array<::Google::Longrunning::Operation>] - # A list of operations that matches the specified filter in the request. - # @!attribute [rw] next_page_token - # @return [::String] - # The standard List next-page token. - # @!attribute [rw] unreachable - # @return [::Array<::String>] - # Unordered list. Unreachable resources. Populated when the request sets - # `ListOperationsRequest.return_partial_success` and reads across - # collections e.g. when attempting to list all resources across all supported - # locations. - class ListOperationsResponse - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # The request message for - # Operations.CancelOperation. - # @!attribute [rw] name - # @return [::String] - # The name of the operation resource to be cancelled. - class CancelOperationRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # The request message for - # Operations.DeleteOperation. - # @!attribute [rw] name - # @return [::String] - # The name of the operation resource to be deleted. - class DeleteOperationRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # The request message for - # Operations.WaitOperation. - # @!attribute [rw] name - # @return [::String] - # The name of the operation resource to wait on. - # @!attribute [rw] timeout - # @return [::Google::Protobuf::Duration] - # The maximum duration to wait before timing out. If left blank, the wait - # will be at most the time permitted by the underlying HTTP/RPC protocol. - # If RPC context deadline is also specified, the shorter one will be used. - class WaitOperationRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # A message representing the message types used by a long-running operation. - # - # Example: - # - # rpc Export(ExportRequest) returns (google.longrunning.Operation) { - # option (google.longrunning.operation_info) = { - # response_type: "ExportResponse" - # metadata_type: "ExportMetadata" - # }; - # } - # @!attribute [rw] response_type - # @return [::String] - # Required. The message name of the primary return type for this - # long-running operation. - # This type will be used to deserialize the LRO's response. - # - # If the response is in a different package from the rpc, a fully-qualified - # message name must be used (e.g. `google.protobuf.Struct`). - # - # Note: Altering this value constitutes a breaking change. - # @!attribute [rw] metadata_type - # @return [::String] - # Required. The message name of the metadata type for this long-running - # operation. - # - # If the response is in a different package from the rpc, a fully-qualified - # message name must be used (e.g. `google.protobuf.Struct`). - # - # Note: Altering this value constitutes a breaking change. - class OperationInfo - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - end -end diff --git a/owl-bot-staging/google-cloud-retail-v2/proto_docs/google/protobuf/any.rb b/owl-bot-staging/google-cloud-retail-v2/proto_docs/google/protobuf/any.rb deleted file mode 100644 index 58691995f02e..000000000000 --- a/owl-bot-staging/google-cloud-retail-v2/proto_docs/google/protobuf/any.rb +++ /dev/null @@ -1,145 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - - -module Google - module Protobuf - # `Any` contains an arbitrary serialized protocol buffer message along with a - # URL that describes the type of the serialized message. - # - # Protobuf library provides support to pack/unpack Any values in the form - # of utility functions or additional generated methods of the Any type. - # - # Example 1: Pack and unpack a message in C++. - # - # Foo foo = ...; - # Any any; - # any.PackFrom(foo); - # ... - # if (any.UnpackTo(&foo)) { - # ... - # } - # - # Example 2: Pack and unpack a message in Java. - # - # Foo foo = ...; - # Any any = Any.pack(foo); - # ... - # if (any.is(Foo.class)) { - # foo = any.unpack(Foo.class); - # } - # // or ... - # if (any.isSameTypeAs(Foo.getDefaultInstance())) { - # foo = any.unpack(Foo.getDefaultInstance()); - # } - # - # Example 3: Pack and unpack a message in Python. - # - # foo = Foo(...) - # any = Any() - # any.Pack(foo) - # ... - # if any.Is(Foo.DESCRIPTOR): - # any.Unpack(foo) - # ... - # - # Example 4: Pack and unpack a message in Go - # - # foo := &pb.Foo{...} - # any, err := anypb.New(foo) - # if err != nil { - # ... - # } - # ... - # foo := &pb.Foo{} - # if err := any.UnmarshalTo(foo); err != nil { - # ... - # } - # - # The pack methods provided by protobuf library will by default use - # 'type.googleapis.com/full.type.name' as the type URL and the unpack - # methods only use the fully qualified type name after the last '/' - # in the type URL, for example "foo.bar.com/x/y.z" will yield type - # name "y.z". - # - # JSON - # ==== - # The JSON representation of an `Any` value uses the regular - # representation of the deserialized, embedded message, with an - # additional field `@type` which contains the type URL. Example: - # - # package google.profile; - # message Person { - # string first_name = 1; - # string last_name = 2; - # } - # - # { - # "@type": "type.googleapis.com/google.profile.Person", - # "firstName": , - # "lastName": - # } - # - # If the embedded message type is well-known and has a custom JSON - # representation, that representation will be embedded adding a field - # `value` which holds the custom JSON in addition to the `@type` - # field. Example (for message [google.protobuf.Duration][]): - # - # { - # "@type": "type.googleapis.com/google.protobuf.Duration", - # "value": "1.212s" - # } - # @!attribute [rw] type_url - # @return [::String] - # A URL/resource name that uniquely identifies the type of the serialized - # protocol buffer message. This string must contain at least - # one "/" character. The last segment of the URL's path must represent - # the fully qualified name of the type (as in - # `path/google.protobuf.Duration`). The name should be in a canonical form - # (e.g., leading "." is not accepted). - # - # In practice, teams usually precompile into the binary all types that they - # expect it to use in the context of Any. However, for URLs which use the - # scheme `http`, `https`, or no scheme, one can optionally set up a type - # server that maps type URLs to message definitions as follows: - # - # * If no scheme is provided, `https` is assumed. - # * An HTTP GET on the URL must yield a [google.protobuf.Type][] - # value in binary format, or produce an error. - # * Applications are allowed to cache lookup results based on the - # URL, or have them precompiled into a binary to avoid any - # lookup. Therefore, binary compatibility needs to be preserved - # on changes to types. (Use versioned type names to manage - # breaking changes.) - # - # Note: this functionality is not currently available in the official - # protobuf release, and it is not used for type URLs beginning with - # type.googleapis.com. As of May 2023, there are no widely used type server - # implementations and no plans to implement one. - # - # Schemes other than `http`, `https` (or the empty scheme) might be - # used with implementation specific semantics. - # @!attribute [rw] value - # @return [::String] - # Must be a valid serialized protocol buffer of the above specified type. - class Any - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - end -end diff --git a/owl-bot-staging/google-cloud-retail-v2/proto_docs/google/protobuf/duration.rb b/owl-bot-staging/google-cloud-retail-v2/proto_docs/google/protobuf/duration.rb deleted file mode 100644 index ea59f1f91daf..000000000000 --- a/owl-bot-staging/google-cloud-retail-v2/proto_docs/google/protobuf/duration.rb +++ /dev/null @@ -1,98 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - - -module Google - module Protobuf - # A Duration represents a signed, fixed-length span of time represented - # as a count of seconds and fractions of seconds at nanosecond - # resolution. It is independent of any calendar and concepts like "day" - # or "month". It is related to Timestamp in that the difference between - # two Timestamp values is a Duration and it can be added or subtracted - # from a Timestamp. Range is approximately +-10,000 years. - # - # # Examples - # - # Example 1: Compute Duration from two Timestamps in pseudo code. - # - # Timestamp start = ...; - # Timestamp end = ...; - # Duration duration = ...; - # - # duration.seconds = end.seconds - start.seconds; - # duration.nanos = end.nanos - start.nanos; - # - # if (duration.seconds < 0 && duration.nanos > 0) { - # duration.seconds += 1; - # duration.nanos -= 1000000000; - # } else if (duration.seconds > 0 && duration.nanos < 0) { - # duration.seconds -= 1; - # duration.nanos += 1000000000; - # } - # - # Example 2: Compute Timestamp from Timestamp + Duration in pseudo code. - # - # Timestamp start = ...; - # Duration duration = ...; - # Timestamp end = ...; - # - # end.seconds = start.seconds + duration.seconds; - # end.nanos = start.nanos + duration.nanos; - # - # if (end.nanos < 0) { - # end.seconds -= 1; - # end.nanos += 1000000000; - # } else if (end.nanos >= 1000000000) { - # end.seconds += 1; - # end.nanos -= 1000000000; - # } - # - # Example 3: Compute Duration from datetime.timedelta in Python. - # - # td = datetime.timedelta(days=3, minutes=10) - # duration = Duration() - # duration.FromTimedelta(td) - # - # # JSON Mapping - # - # In JSON format, the Duration type is encoded as a string rather than an - # object, where the string ends in the suffix "s" (indicating seconds) and - # is preceded by the number of seconds, with nanoseconds expressed as - # fractional seconds. For example, 3 seconds with 0 nanoseconds should be - # encoded in JSON format as "3s", while 3 seconds and 1 nanosecond should - # be expressed in JSON format as "3.000000001s", and 3 seconds and 1 - # microsecond should be expressed in JSON format as "3.000001s". - # @!attribute [rw] seconds - # @return [::Integer] - # Signed seconds of the span of time. Must be from -315,576,000,000 - # to +315,576,000,000 inclusive. Note: these bounds are computed from: - # 60 sec/min * 60 min/hr * 24 hr/day * 365.25 days/year * 10000 years - # @!attribute [rw] nanos - # @return [::Integer] - # Signed fractions of a second at nanosecond resolution of the span - # of time. Durations less than one second are represented with a 0 - # `seconds` field and a positive or negative `nanos` field. For durations - # of one second or more, a non-zero value for the `nanos` field must be - # of the same sign as the `seconds` field. Must be from -999,999,999 - # to +999,999,999 inclusive. - class Duration - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - end -end diff --git a/owl-bot-staging/google-cloud-retail-v2/proto_docs/google/protobuf/empty.rb b/owl-bot-staging/google-cloud-retail-v2/proto_docs/google/protobuf/empty.rb deleted file mode 100644 index 83e4481834a6..000000000000 --- a/owl-bot-staging/google-cloud-retail-v2/proto_docs/google/protobuf/empty.rb +++ /dev/null @@ -1,34 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - - -module Google - module Protobuf - # A generic empty message that you can re-use to avoid defining duplicated - # empty messages in your APIs. A typical example is to use it as the request - # or the response type of an API method. For instance: - # - # service Foo { - # rpc Bar(google.protobuf.Empty) returns (google.protobuf.Empty); - # } - class Empty - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - end -end diff --git a/owl-bot-staging/google-cloud-retail-v2/proto_docs/google/protobuf/field_mask.rb b/owl-bot-staging/google-cloud-retail-v2/proto_docs/google/protobuf/field_mask.rb deleted file mode 100644 index 7f3ffc78601a..000000000000 --- a/owl-bot-staging/google-cloud-retail-v2/proto_docs/google/protobuf/field_mask.rb +++ /dev/null @@ -1,229 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - - -module Google - module Protobuf - # `FieldMask` represents a set of symbolic field paths, for example: - # - # paths: "f.a" - # paths: "f.b.d" - # - # Here `f` represents a field in some root message, `a` and `b` - # fields in the message found in `f`, and `d` a field found in the - # message in `f.b`. - # - # Field masks are used to specify a subset of fields that should be - # returned by a get operation or modified by an update operation. - # Field masks also have a custom JSON encoding (see below). - # - # # Field Masks in Projections - # - # When used in the context of a projection, a response message or - # sub-message is filtered by the API to only contain those fields as - # specified in the mask. For example, if the mask in the previous - # example is applied to a response message as follows: - # - # f { - # a : 22 - # b { - # d : 1 - # x : 2 - # } - # y : 13 - # } - # z: 8 - # - # The result will not contain specific values for fields x,y and z - # (their value will be set to the default, and omitted in proto text - # output): - # - # - # f { - # a : 22 - # b { - # d : 1 - # } - # } - # - # A repeated field is not allowed except at the last position of a - # paths string. - # - # If a FieldMask object is not present in a get operation, the - # operation applies to all fields (as if a FieldMask of all fields - # had been specified). - # - # Note that a field mask does not necessarily apply to the - # top-level response message. In case of a REST get operation, the - # field mask applies directly to the response, but in case of a REST - # list operation, the mask instead applies to each individual message - # in the returned resource list. In case of a REST custom method, - # other definitions may be used. Where the mask applies will be - # clearly documented together with its declaration in the API. In - # any case, the effect on the returned resource/resources is required - # behavior for APIs. - # - # # Field Masks in Update Operations - # - # A field mask in update operations specifies which fields of the - # targeted resource are going to be updated. The API is required - # to only change the values of the fields as specified in the mask - # and leave the others untouched. If a resource is passed in to - # describe the updated values, the API ignores the values of all - # fields not covered by the mask. - # - # If a repeated field is specified for an update operation, new values will - # be appended to the existing repeated field in the target resource. Note that - # a repeated field is only allowed in the last position of a `paths` string. - # - # If a sub-message is specified in the last position of the field mask for an - # update operation, then new value will be merged into the existing sub-message - # in the target resource. - # - # For example, given the target message: - # - # f { - # b { - # d: 1 - # x: 2 - # } - # c: [1] - # } - # - # And an update message: - # - # f { - # b { - # d: 10 - # } - # c: [2] - # } - # - # then if the field mask is: - # - # paths: ["f.b", "f.c"] - # - # then the result will be: - # - # f { - # b { - # d: 10 - # x: 2 - # } - # c: [1, 2] - # } - # - # An implementation may provide options to override this default behavior for - # repeated and message fields. - # - # In order to reset a field's value to the default, the field must - # be in the mask and set to the default value in the provided resource. - # Hence, in order to reset all fields of a resource, provide a default - # instance of the resource and set all fields in the mask, or do - # not provide a mask as described below. - # - # If a field mask is not present on update, the operation applies to - # all fields (as if a field mask of all fields has been specified). - # Note that in the presence of schema evolution, this may mean that - # fields the client does not know and has therefore not filled into - # the request will be reset to their default. If this is unwanted - # behavior, a specific service may require a client to always specify - # a field mask, producing an error if not. - # - # As with get operations, the location of the resource which - # describes the updated values in the request message depends on the - # operation kind. In any case, the effect of the field mask is - # required to be honored by the API. - # - # ## Considerations for HTTP REST - # - # The HTTP kind of an update operation which uses a field mask must - # be set to PATCH instead of PUT in order to satisfy HTTP semantics - # (PUT must only be used for full updates). - # - # # JSON Encoding of Field Masks - # - # In JSON, a field mask is encoded as a single string where paths are - # separated by a comma. Fields name in each path are converted - # to/from lower-camel naming conventions. - # - # As an example, consider the following message declarations: - # - # message Profile { - # User user = 1; - # Photo photo = 2; - # } - # message User { - # string display_name = 1; - # string address = 2; - # } - # - # In proto a field mask for `Profile` may look as such: - # - # mask { - # paths: "user.display_name" - # paths: "photo" - # } - # - # In JSON, the same mask is represented as below: - # - # { - # mask: "user.displayName,photo" - # } - # - # # Field Masks and Oneof Fields - # - # Field masks treat fields in oneofs just as regular fields. Consider the - # following message: - # - # message SampleMessage { - # oneof test_oneof { - # string name = 4; - # SubMessage sub_message = 9; - # } - # } - # - # The field mask can be: - # - # mask { - # paths: "name" - # } - # - # Or: - # - # mask { - # paths: "sub_message" - # } - # - # Note that oneof type names ("test_oneof" in this case) cannot be used in - # paths. - # - # ## Field Mask Verification - # - # The implementation of any API method which has a FieldMask type field in the - # request should verify the included field paths, and return an - # `INVALID_ARGUMENT` error if any path is unmappable. - # @!attribute [rw] paths - # @return [::Array<::String>] - # The set of field mask paths. - class FieldMask - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - end -end diff --git a/owl-bot-staging/google-cloud-retail-v2/proto_docs/google/protobuf/struct.rb b/owl-bot-staging/google-cloud-retail-v2/proto_docs/google/protobuf/struct.rb deleted file mode 100644 index 39e1aca868d2..000000000000 --- a/owl-bot-staging/google-cloud-retail-v2/proto_docs/google/protobuf/struct.rb +++ /dev/null @@ -1,108 +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 - # `Struct` represents a structured data value, consisting of fields - # which map to dynamically typed values. In some languages, `Struct` - # might be supported by a native representation. For example, in - # scripting languages like JS a struct is represented as an - # object. The details of that representation are described together - # with the proto support for the language. - # - # The JSON representation for `Struct` is JSON object. - # @!attribute [rw] fields - # @return [::Google::Protobuf::Map{::String => ::Google::Protobuf::Value}] - # Unordered map of dynamically typed values. - class Struct - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - - # @!attribute [rw] key - # @return [::String] - # @!attribute [rw] value - # @return [::Google::Protobuf::Value] - class FieldsEntry - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - end - - # `Value` represents a dynamically typed value which can be either - # null, a number, a string, a boolean, a recursive struct value, or a - # list of values. A producer of value is expected to set one of these - # variants. Absence of any variant indicates an error. - # - # The JSON representation for `Value` is JSON value. - # @!attribute [rw] null_value - # @return [::Google::Protobuf::NullValue] - # Represents a null value. - # - # Note: The following fields are mutually exclusive: `null_value`, `number_value`, `string_value`, `bool_value`, `struct_value`, `list_value`. If a field in that set is populated, all other fields in the set will automatically be cleared. - # @!attribute [rw] number_value - # @return [::Float] - # Represents a double value. - # - # Note: The following fields are mutually exclusive: `number_value`, `null_value`, `string_value`, `bool_value`, `struct_value`, `list_value`. If a field in that set is populated, all other fields in the set will automatically be cleared. - # @!attribute [rw] string_value - # @return [::String] - # Represents a string value. - # - # Note: The following fields are mutually exclusive: `string_value`, `null_value`, `number_value`, `bool_value`, `struct_value`, `list_value`. If a field in that set is populated, all other fields in the set will automatically be cleared. - # @!attribute [rw] bool_value - # @return [::Boolean] - # Represents a boolean value. - # - # Note: The following fields are mutually exclusive: `bool_value`, `null_value`, `number_value`, `string_value`, `struct_value`, `list_value`. If a field in that set is populated, all other fields in the set will automatically be cleared. - # @!attribute [rw] struct_value - # @return [::Google::Protobuf::Struct] - # Represents a structured value. - # - # Note: The following fields are mutually exclusive: `struct_value`, `null_value`, `number_value`, `string_value`, `bool_value`, `list_value`. If a field in that set is populated, all other fields in the set will automatically be cleared. - # @!attribute [rw] list_value - # @return [::Google::Protobuf::ListValue] - # Represents a repeated `Value`. - # - # Note: The following fields are mutually exclusive: `list_value`, `null_value`, `number_value`, `string_value`, `bool_value`, `struct_value`. If a field in that set is populated, all other fields in the set will automatically be cleared. - class Value - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # `ListValue` is a wrapper around a repeated field of values. - # - # The JSON representation for `ListValue` is JSON array. - # @!attribute [rw] values - # @return [::Array<::Google::Protobuf::Value>] - # Repeated field of dynamically typed values. - class ListValue - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # `NullValue` is a singleton enumeration to represent the null value for the - # `Value` type union. - # - # The JSON representation for `NullValue` is JSON `null`. - module NullValue - # Null value. - NULL_VALUE = 0 - end - end -end diff --git a/owl-bot-staging/google-cloud-retail-v2/proto_docs/google/protobuf/timestamp.rb b/owl-bot-staging/google-cloud-retail-v2/proto_docs/google/protobuf/timestamp.rb deleted file mode 100644 index 74352be9c58c..000000000000 --- a/owl-bot-staging/google-cloud-retail-v2/proto_docs/google/protobuf/timestamp.rb +++ /dev/null @@ -1,127 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - - -module Google - module Protobuf - # A Timestamp represents a point in time independent of any time zone or local - # calendar, encoded as a count of seconds and fractions of seconds at - # nanosecond resolution. The count is relative to an epoch at UTC midnight on - # January 1, 1970, in the proleptic Gregorian calendar which extends the - # Gregorian calendar backwards to year one. - # - # All minutes are 60 seconds long. Leap seconds are "smeared" so that no leap - # second table is needed for interpretation, using a [24-hour linear - # smear](https://developers.google.com/time/smear). - # - # The range is from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59.999999999Z. By - # restricting to that range, we ensure that we can convert to and from [RFC - # 3339](https://www.ietf.org/rfc/rfc3339.txt) date strings. - # - # # Examples - # - # Example 1: Compute Timestamp from POSIX `time()`. - # - # Timestamp timestamp; - # timestamp.set_seconds(time(NULL)); - # timestamp.set_nanos(0); - # - # Example 2: Compute Timestamp from POSIX `gettimeofday()`. - # - # struct timeval tv; - # gettimeofday(&tv, NULL); - # - # Timestamp timestamp; - # timestamp.set_seconds(tv.tv_sec); - # timestamp.set_nanos(tv.tv_usec * 1000); - # - # Example 3: Compute Timestamp from Win32 `GetSystemTimeAsFileTime()`. - # - # FILETIME ft; - # GetSystemTimeAsFileTime(&ft); - # UINT64 ticks = (((UINT64)ft.dwHighDateTime) << 32) | ft.dwLowDateTime; - # - # // A Windows tick is 100 nanoseconds. Windows epoch 1601-01-01T00:00:00Z - # // is 11644473600 seconds before Unix epoch 1970-01-01T00:00:00Z. - # Timestamp timestamp; - # timestamp.set_seconds((INT64) ((ticks / 10000000) - 11644473600LL)); - # timestamp.set_nanos((INT32) ((ticks % 10000000) * 100)); - # - # Example 4: Compute Timestamp from Java `System.currentTimeMillis()`. - # - # long millis = System.currentTimeMillis(); - # - # Timestamp timestamp = Timestamp.newBuilder().setSeconds(millis / 1000) - # .setNanos((int) ((millis % 1000) * 1000000)).build(); - # - # Example 5: Compute Timestamp from Java `Instant.now()`. - # - # Instant now = Instant.now(); - # - # Timestamp timestamp = - # Timestamp.newBuilder().setSeconds(now.getEpochSecond()) - # .setNanos(now.getNano()).build(); - # - # Example 6: Compute Timestamp from current time in Python. - # - # timestamp = Timestamp() - # timestamp.GetCurrentTime() - # - # # JSON Mapping - # - # In JSON format, the Timestamp type is encoded as a string in the - # [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format. That is, the - # format is "\\{year}-\\{month}-\\{day}T\\{hour}:\\{min}:\\{sec}[.\\{frac_sec}]Z" - # where \\{year} is always expressed using four digits while \\{month}, \\{day}, - # \\{hour}, \\{min}, and \\{sec} are zero-padded to two digits each. The fractional - # seconds, which can go up to 9 digits (i.e. up to 1 nanosecond resolution), - # are optional. The "Z" suffix indicates the timezone ("UTC"); the timezone - # is required. A proto3 JSON serializer should always use UTC (as indicated by - # "Z") when printing the Timestamp type and a proto3 JSON parser should be - # able to accept both UTC and other timezones (as indicated by an offset). - # - # For example, "2017-01-15T01:30:15.01Z" encodes 15.01 seconds past - # 01:30 UTC on January 15, 2017. - # - # In JavaScript, one can convert a Date object to this format using the - # standard - # [toISOString()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toISOString) - # method. In Python, a standard `datetime.datetime` object can be converted - # to this format using - # [`strftime`](https://docs.python.org/2/library/time.html#time.strftime) with - # the time format spec '%Y-%m-%dT%H:%M:%S.%fZ'. Likewise, in Java, one can use - # the Joda Time's [`ISODateTimeFormat.dateTime()`]( - # http://joda-time.sourceforge.net/apidocs/org/joda/time/format/ISODateTimeFormat.html#dateTime() - # ) to obtain a formatter capable of generating timestamps in this format. - # @!attribute [rw] seconds - # @return [::Integer] - # Represents seconds of UTC time since Unix epoch - # 1970-01-01T00:00:00Z. Must be from 0001-01-01T00:00:00Z to - # 9999-12-31T23:59:59Z inclusive. - # @!attribute [rw] nanos - # @return [::Integer] - # Non-negative fractions of a second at nanosecond resolution. Negative - # second values with fractions must still have non-negative nanos values - # that count forward in time. Must be from 0 to 999,999,999 - # inclusive. - class Timestamp - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - end -end diff --git a/owl-bot-staging/google-cloud-retail-v2/proto_docs/google/protobuf/wrappers.rb b/owl-bot-staging/google-cloud-retail-v2/proto_docs/google/protobuf/wrappers.rb deleted file mode 100644 index 9a7c0269fa42..000000000000 --- a/owl-bot-staging/google-cloud-retail-v2/proto_docs/google/protobuf/wrappers.rb +++ /dev/null @@ -1,148 +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 - # Wrapper message for `double`. - # - # The JSON representation for `DoubleValue` is JSON number. - # - # Not recommended for use in new APIs, but still useful for legacy APIs and - # has no plan to be removed. - # @!attribute [rw] value - # @return [::Float] - # The double value. - class DoubleValue - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Wrapper message for `float`. - # - # The JSON representation for `FloatValue` is JSON number. - # - # Not recommended for use in new APIs, but still useful for legacy APIs and - # has no plan to be removed. - # @!attribute [rw] value - # @return [::Float] - # The float value. - class FloatValue - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Wrapper message for `int64`. - # - # The JSON representation for `Int64Value` is JSON string. - # - # Not recommended for use in new APIs, but still useful for legacy APIs and - # has no plan to be removed. - # @!attribute [rw] value - # @return [::Integer] - # The int64 value. - class Int64Value - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Wrapper message for `uint64`. - # - # The JSON representation for `UInt64Value` is JSON string. - # - # Not recommended for use in new APIs, but still useful for legacy APIs and - # has no plan to be removed. - # @!attribute [rw] value - # @return [::Integer] - # The uint64 value. - class UInt64Value - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Wrapper message for `int32`. - # - # The JSON representation for `Int32Value` is JSON number. - # - # Not recommended for use in new APIs, but still useful for legacy APIs and - # has no plan to be removed. - # @!attribute [rw] value - # @return [::Integer] - # The int32 value. - class Int32Value - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Wrapper message for `uint32`. - # - # The JSON representation for `UInt32Value` is JSON number. - # - # Not recommended for use in new APIs, but still useful for legacy APIs and - # has no plan to be removed. - # @!attribute [rw] value - # @return [::Integer] - # The uint32 value. - class UInt32Value - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Wrapper message for `bool`. - # - # The JSON representation for `BoolValue` is JSON `true` and `false`. - # - # Not recommended for use in new APIs, but still useful for legacy APIs and - # has no plan to be removed. - # @!attribute [rw] value - # @return [::Boolean] - # The bool value. - class BoolValue - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Wrapper message for `string`. - # - # The JSON representation for `StringValue` is JSON string. - # - # Not recommended for use in new APIs, but still useful for legacy APIs and - # has no plan to be removed. - # @!attribute [rw] value - # @return [::String] - # The string value. - class StringValue - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Wrapper message for `bytes`. - # - # The JSON representation for `BytesValue` is JSON string. - # - # Not recommended for use in new APIs, but still useful for legacy APIs and - # has no plan to be removed. - # @!attribute [rw] value - # @return [::String] - # The bytes value. - class BytesValue - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - end -end diff --git a/owl-bot-staging/google-cloud-retail-v2/proto_docs/google/rpc/status.rb b/owl-bot-staging/google-cloud-retail-v2/proto_docs/google/rpc/status.rb deleted file mode 100644 index c1a1c07eb2db..000000000000 --- a/owl-bot-staging/google-cloud-retail-v2/proto_docs/google/rpc/status.rb +++ /dev/null @@ -1,48 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - - -module Google - module Rpc - # The `Status` type defines a logical error model that is suitable for - # different programming environments, including REST APIs and RPC APIs. It is - # used by [gRPC](https://github.com/grpc). Each `Status` message contains - # three pieces of data: error code, error message, and error details. - # - # You can find out more about this error model and how to work with it in the - # [API Design Guide](https://cloud.google.com/apis/design/errors). - # @!attribute [rw] code - # @return [::Integer] - # The status code, which should be an enum value of - # [google.rpc.Code][google.rpc.Code]. - # @!attribute [rw] message - # @return [::String] - # A developer-facing error message, which should be in English. Any - # user-facing error message should be localized and sent in the - # {::Google::Rpc::Status#details google.rpc.Status.details} field, or localized - # by the client. - # @!attribute [rw] details - # @return [::Array<::Google::Protobuf::Any>] - # A list of messages that carry the error details. There is a common set of - # message types for APIs to use. - class Status - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - end -end diff --git a/owl-bot-staging/google-cloud-retail-v2/proto_docs/google/type/date.rb b/owl-bot-staging/google-cloud-retail-v2/proto_docs/google/type/date.rb deleted file mode 100644 index 1d0a9780457f..000000000000 --- a/owl-bot-staging/google-cloud-retail-v2/proto_docs/google/type/date.rb +++ /dev/null @@ -1,53 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - - -module Google - module Type - # Represents a whole or partial calendar date, such as a birthday. The time of - # day and time zone are either specified elsewhere or are insignificant. The - # date is relative to the Gregorian Calendar. This can represent one of the - # following: - # - # * A full date, with non-zero year, month, and day values - # * A month and day value, with a zero year, such as an anniversary - # * A year on its own, with zero month and day values - # * A year and month value, with a zero day, such as a credit card expiration - # date - # - # Related types are [google.type.TimeOfDay][google.type.TimeOfDay] and - # `google.protobuf.Timestamp`. - # @!attribute [rw] year - # @return [::Integer] - # Year of the date. Must be from 1 to 9999, or 0 to specify a date without - # a year. - # @!attribute [rw] month - # @return [::Integer] - # Month of a year. Must be from 1 to 12, or 0 to specify a year without a - # month and day. - # @!attribute [rw] day - # @return [::Integer] - # Day of a month. Must be from 1 to 31 and valid for the year and month, or 0 - # to specify a year by itself or a year and month where the day isn't - # significant. - class Date - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - end -end diff --git a/owl-bot-staging/google-cloud-retail-v2/snippets/Gemfile b/owl-bot-staging/google-cloud-retail-v2/snippets/Gemfile deleted file mode 100644 index d2cc0c1eb2ed..000000000000 --- a/owl-bot-staging/google-cloud-retail-v2/snippets/Gemfile +++ /dev/null @@ -1,32 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -source "https://rubygems.org" - -if ENV["GOOGLE_CLOUD_SAMPLES_TEST"] == "master" - gem "google-cloud-retail-v2", path: "../" -else - gem "google-cloud-retail-v2" -end - -group :test do - gem "google-style", "~> 1.26.1" - gem "minitest", "~> 5.16" - gem "minitest-focus", "~> 1.1" - gem "minitest-hooks", "~> 1.5" -end diff --git a/owl-bot-staging/google-cloud-retail-v2/snippets/analytics_service/export_analytics_metrics.rb b/owl-bot-staging/google-cloud-retail-v2/snippets/analytics_service/export_analytics_metrics.rb deleted file mode 100644 index f5249b7f1e32..000000000000 --- a/owl-bot-staging/google-cloud-retail-v2/snippets/analytics_service/export_analytics_metrics.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 retail_v2_generated_AnalyticsService_ExportAnalyticsMetrics_sync] -require "google/cloud/retail/v2" - -## -# Snippet for the export_analytics_metrics call in the AnalyticsService service -# -# This snippet has been automatically generated and should be regarded as a code -# template only. It will require modifications to work: -# - It may require correct/in-range values for request initialization. -# - It may require specifying regional endpoints when creating the service -# client as shown in https://cloud.google.com/ruby/docs/reference. -# -# This is an auto-generated example demonstrating basic usage of -# Google::Cloud::Retail::V2::AnalyticsService::Client#export_analytics_metrics. -# -def export_analytics_metrics - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::Retail::V2::AnalyticsService::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::Retail::V2::ExportAnalyticsMetricsRequest.new - - # Call the export_analytics_metrics method. - result = client.export_analytics_metrics 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 retail_v2_generated_AnalyticsService_ExportAnalyticsMetrics_sync] diff --git a/owl-bot-staging/google-cloud-retail-v2/snippets/catalog_service/add_catalog_attribute.rb b/owl-bot-staging/google-cloud-retail-v2/snippets/catalog_service/add_catalog_attribute.rb deleted file mode 100644 index dc85a92e6277..000000000000 --- a/owl-bot-staging/google-cloud-retail-v2/snippets/catalog_service/add_catalog_attribute.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 retail_v2_generated_CatalogService_AddCatalogAttribute_sync] -require "google/cloud/retail/v2" - -## -# Snippet for the add_catalog_attribute call in the CatalogService service -# -# This snippet has been automatically generated and should be regarded as a code -# template only. It will require modifications to work: -# - It may require correct/in-range values for request initialization. -# - It may require specifying regional endpoints when creating the service -# client as shown in https://cloud.google.com/ruby/docs/reference. -# -# This is an auto-generated example demonstrating basic usage of -# Google::Cloud::Retail::V2::CatalogService::Client#add_catalog_attribute. -# -def add_catalog_attribute - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::Retail::V2::CatalogService::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::Retail::V2::AddCatalogAttributeRequest.new - - # Call the add_catalog_attribute method. - result = client.add_catalog_attribute request - - # The returned object is of type Google::Cloud::Retail::V2::AttributesConfig. - p result -end -# [END retail_v2_generated_CatalogService_AddCatalogAttribute_sync] diff --git a/owl-bot-staging/google-cloud-retail-v2/snippets/catalog_service/get_attributes_config.rb b/owl-bot-staging/google-cloud-retail-v2/snippets/catalog_service/get_attributes_config.rb deleted file mode 100644 index cb21a1f8e879..000000000000 --- a/owl-bot-staging/google-cloud-retail-v2/snippets/catalog_service/get_attributes_config.rb +++ /dev/null @@ -1,47 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -# [START retail_v2_generated_CatalogService_GetAttributesConfig_sync] -require "google/cloud/retail/v2" - -## -# Snippet for the get_attributes_config call in the CatalogService service -# -# This snippet has been automatically generated and should be regarded as a code -# template only. It will require modifications to work: -# - It may require correct/in-range values for request initialization. -# - It may require specifying regional endpoints when creating the service -# client as shown in https://cloud.google.com/ruby/docs/reference. -# -# This is an auto-generated example demonstrating basic usage of -# Google::Cloud::Retail::V2::CatalogService::Client#get_attributes_config. -# -def get_attributes_config - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::Retail::V2::CatalogService::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::Retail::V2::GetAttributesConfigRequest.new - - # Call the get_attributes_config method. - result = client.get_attributes_config request - - # The returned object is of type Google::Cloud::Retail::V2::AttributesConfig. - p result -end -# [END retail_v2_generated_CatalogService_GetAttributesConfig_sync] diff --git a/owl-bot-staging/google-cloud-retail-v2/snippets/catalog_service/get_completion_config.rb b/owl-bot-staging/google-cloud-retail-v2/snippets/catalog_service/get_completion_config.rb deleted file mode 100644 index 1668c703deda..000000000000 --- a/owl-bot-staging/google-cloud-retail-v2/snippets/catalog_service/get_completion_config.rb +++ /dev/null @@ -1,47 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -# [START retail_v2_generated_CatalogService_GetCompletionConfig_sync] -require "google/cloud/retail/v2" - -## -# Snippet for the get_completion_config call in the CatalogService service -# -# This snippet has been automatically generated and should be regarded as a code -# template only. It will require modifications to work: -# - It may require correct/in-range values for request initialization. -# - It may require specifying regional endpoints when creating the service -# client as shown in https://cloud.google.com/ruby/docs/reference. -# -# This is an auto-generated example demonstrating basic usage of -# Google::Cloud::Retail::V2::CatalogService::Client#get_completion_config. -# -def get_completion_config - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::Retail::V2::CatalogService::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::Retail::V2::GetCompletionConfigRequest.new - - # Call the get_completion_config method. - result = client.get_completion_config request - - # The returned object is of type Google::Cloud::Retail::V2::CompletionConfig. - p result -end -# [END retail_v2_generated_CatalogService_GetCompletionConfig_sync] diff --git a/owl-bot-staging/google-cloud-retail-v2/snippets/catalog_service/get_default_branch.rb b/owl-bot-staging/google-cloud-retail-v2/snippets/catalog_service/get_default_branch.rb deleted file mode 100644 index a7c5c47a999d..000000000000 --- a/owl-bot-staging/google-cloud-retail-v2/snippets/catalog_service/get_default_branch.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 retail_v2_generated_CatalogService_GetDefaultBranch_sync] -require "google/cloud/retail/v2" - -## -# Snippet for the get_default_branch call in the CatalogService service -# -# This snippet has been automatically generated and should be regarded as a code -# template only. It will require modifications to work: -# - It may require correct/in-range values for request initialization. -# - It may require specifying regional endpoints when creating the service -# client as shown in https://cloud.google.com/ruby/docs/reference. -# -# This is an auto-generated example demonstrating basic usage of -# Google::Cloud::Retail::V2::CatalogService::Client#get_default_branch. -# -def get_default_branch - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::Retail::V2::CatalogService::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::Retail::V2::GetDefaultBranchRequest.new - - # Call the get_default_branch method. - result = client.get_default_branch request - - # The returned object is of type Google::Cloud::Retail::V2::GetDefaultBranchResponse. - p result -end -# [END retail_v2_generated_CatalogService_GetDefaultBranch_sync] diff --git a/owl-bot-staging/google-cloud-retail-v2/snippets/catalog_service/list_catalogs.rb b/owl-bot-staging/google-cloud-retail-v2/snippets/catalog_service/list_catalogs.rb deleted file mode 100644 index 27f668be91bd..000000000000 --- a/owl-bot-staging/google-cloud-retail-v2/snippets/catalog_service/list_catalogs.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 retail_v2_generated_CatalogService_ListCatalogs_sync] -require "google/cloud/retail/v2" - -## -# Snippet for the list_catalogs call in the CatalogService service -# -# This snippet has been automatically generated and should be regarded as a code -# template only. It will require modifications to work: -# - It may require correct/in-range values for request initialization. -# - It may require specifying regional endpoints when creating the service -# client as shown in https://cloud.google.com/ruby/docs/reference. -# -# This is an auto-generated example demonstrating basic usage of -# Google::Cloud::Retail::V2::CatalogService::Client#list_catalogs. -# -def list_catalogs - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::Retail::V2::CatalogService::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::Retail::V2::ListCatalogsRequest.new - - # Call the list_catalogs method. - result = client.list_catalogs request - - # The returned object is of type Gapic::PagedEnumerable. You can iterate - # over elements, and API calls will be issued to fetch pages as needed. - result.each do |item| - # Each element is of type ::Google::Cloud::Retail::V2::Catalog. - p item - end -end -# [END retail_v2_generated_CatalogService_ListCatalogs_sync] diff --git a/owl-bot-staging/google-cloud-retail-v2/snippets/catalog_service/remove_catalog_attribute.rb b/owl-bot-staging/google-cloud-retail-v2/snippets/catalog_service/remove_catalog_attribute.rb deleted file mode 100644 index 7e0a01dc5446..000000000000 --- a/owl-bot-staging/google-cloud-retail-v2/snippets/catalog_service/remove_catalog_attribute.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 retail_v2_generated_CatalogService_RemoveCatalogAttribute_sync] -require "google/cloud/retail/v2" - -## -# Snippet for the remove_catalog_attribute call in the CatalogService service -# -# This snippet has been automatically generated and should be regarded as a code -# template only. It will require modifications to work: -# - It may require correct/in-range values for request initialization. -# - It may require specifying regional endpoints when creating the service -# client as shown in https://cloud.google.com/ruby/docs/reference. -# -# This is an auto-generated example demonstrating basic usage of -# Google::Cloud::Retail::V2::CatalogService::Client#remove_catalog_attribute. -# -def remove_catalog_attribute - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::Retail::V2::CatalogService::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::Retail::V2::RemoveCatalogAttributeRequest.new - - # Call the remove_catalog_attribute method. - result = client.remove_catalog_attribute request - - # The returned object is of type Google::Cloud::Retail::V2::AttributesConfig. - p result -end -# [END retail_v2_generated_CatalogService_RemoveCatalogAttribute_sync] diff --git a/owl-bot-staging/google-cloud-retail-v2/snippets/catalog_service/replace_catalog_attribute.rb b/owl-bot-staging/google-cloud-retail-v2/snippets/catalog_service/replace_catalog_attribute.rb deleted file mode 100644 index 7b7e35e9755b..000000000000 --- a/owl-bot-staging/google-cloud-retail-v2/snippets/catalog_service/replace_catalog_attribute.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 retail_v2_generated_CatalogService_ReplaceCatalogAttribute_sync] -require "google/cloud/retail/v2" - -## -# Snippet for the replace_catalog_attribute call in the CatalogService service -# -# This snippet has been automatically generated and should be regarded as a code -# template only. It will require modifications to work: -# - It may require correct/in-range values for request initialization. -# - It may require specifying regional endpoints when creating the service -# client as shown in https://cloud.google.com/ruby/docs/reference. -# -# This is an auto-generated example demonstrating basic usage of -# Google::Cloud::Retail::V2::CatalogService::Client#replace_catalog_attribute. -# -def replace_catalog_attribute - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::Retail::V2::CatalogService::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::Retail::V2::ReplaceCatalogAttributeRequest.new - - # Call the replace_catalog_attribute method. - result = client.replace_catalog_attribute request - - # The returned object is of type Google::Cloud::Retail::V2::AttributesConfig. - p result -end -# [END retail_v2_generated_CatalogService_ReplaceCatalogAttribute_sync] diff --git a/owl-bot-staging/google-cloud-retail-v2/snippets/catalog_service/set_default_branch.rb b/owl-bot-staging/google-cloud-retail-v2/snippets/catalog_service/set_default_branch.rb deleted file mode 100644 index 9c0d64022fa4..000000000000 --- a/owl-bot-staging/google-cloud-retail-v2/snippets/catalog_service/set_default_branch.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 retail_v2_generated_CatalogService_SetDefaultBranch_sync] -require "google/cloud/retail/v2" - -## -# Snippet for the set_default_branch call in the CatalogService service -# -# This snippet has been automatically generated and should be regarded as a code -# template only. It will require modifications to work: -# - It may require correct/in-range values for request initialization. -# - It may require specifying regional endpoints when creating the service -# client as shown in https://cloud.google.com/ruby/docs/reference. -# -# This is an auto-generated example demonstrating basic usage of -# Google::Cloud::Retail::V2::CatalogService::Client#set_default_branch. -# -def set_default_branch - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::Retail::V2::CatalogService::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::Retail::V2::SetDefaultBranchRequest.new - - # Call the set_default_branch method. - result = client.set_default_branch request - - # The returned object is of type Google::Protobuf::Empty. - p result -end -# [END retail_v2_generated_CatalogService_SetDefaultBranch_sync] diff --git a/owl-bot-staging/google-cloud-retail-v2/snippets/catalog_service/update_attributes_config.rb b/owl-bot-staging/google-cloud-retail-v2/snippets/catalog_service/update_attributes_config.rb deleted file mode 100644 index 1b5fc7f4253a..000000000000 --- a/owl-bot-staging/google-cloud-retail-v2/snippets/catalog_service/update_attributes_config.rb +++ /dev/null @@ -1,47 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -# [START retail_v2_generated_CatalogService_UpdateAttributesConfig_sync] -require "google/cloud/retail/v2" - -## -# Snippet for the update_attributes_config call in the CatalogService service -# -# This snippet has been automatically generated and should be regarded as a code -# template only. It will require modifications to work: -# - It may require correct/in-range values for request initialization. -# - It may require specifying regional endpoints when creating the service -# client as shown in https://cloud.google.com/ruby/docs/reference. -# -# This is an auto-generated example demonstrating basic usage of -# Google::Cloud::Retail::V2::CatalogService::Client#update_attributes_config. -# -def update_attributes_config - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::Retail::V2::CatalogService::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::Retail::V2::UpdateAttributesConfigRequest.new - - # Call the update_attributes_config method. - result = client.update_attributes_config request - - # The returned object is of type Google::Cloud::Retail::V2::AttributesConfig. - p result -end -# [END retail_v2_generated_CatalogService_UpdateAttributesConfig_sync] diff --git a/owl-bot-staging/google-cloud-retail-v2/snippets/catalog_service/update_catalog.rb b/owl-bot-staging/google-cloud-retail-v2/snippets/catalog_service/update_catalog.rb deleted file mode 100644 index ea0eaa4f2b83..000000000000 --- a/owl-bot-staging/google-cloud-retail-v2/snippets/catalog_service/update_catalog.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 retail_v2_generated_CatalogService_UpdateCatalog_sync] -require "google/cloud/retail/v2" - -## -# Snippet for the update_catalog call in the CatalogService service -# -# This snippet has been automatically generated and should be regarded as a code -# template only. It will require modifications to work: -# - It may require correct/in-range values for request initialization. -# - It may require specifying regional endpoints when creating the service -# client as shown in https://cloud.google.com/ruby/docs/reference. -# -# This is an auto-generated example demonstrating basic usage of -# Google::Cloud::Retail::V2::CatalogService::Client#update_catalog. -# -def update_catalog - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::Retail::V2::CatalogService::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::Retail::V2::UpdateCatalogRequest.new - - # Call the update_catalog method. - result = client.update_catalog request - - # The returned object is of type Google::Cloud::Retail::V2::Catalog. - p result -end -# [END retail_v2_generated_CatalogService_UpdateCatalog_sync] diff --git a/owl-bot-staging/google-cloud-retail-v2/snippets/catalog_service/update_completion_config.rb b/owl-bot-staging/google-cloud-retail-v2/snippets/catalog_service/update_completion_config.rb deleted file mode 100644 index 5d8036e6732d..000000000000 --- a/owl-bot-staging/google-cloud-retail-v2/snippets/catalog_service/update_completion_config.rb +++ /dev/null @@ -1,47 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -# [START retail_v2_generated_CatalogService_UpdateCompletionConfig_sync] -require "google/cloud/retail/v2" - -## -# Snippet for the update_completion_config call in the CatalogService service -# -# This snippet has been automatically generated and should be regarded as a code -# template only. It will require modifications to work: -# - It may require correct/in-range values for request initialization. -# - It may require specifying regional endpoints when creating the service -# client as shown in https://cloud.google.com/ruby/docs/reference. -# -# This is an auto-generated example demonstrating basic usage of -# Google::Cloud::Retail::V2::CatalogService::Client#update_completion_config. -# -def update_completion_config - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::Retail::V2::CatalogService::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::Retail::V2::UpdateCompletionConfigRequest.new - - # Call the update_completion_config method. - result = client.update_completion_config request - - # The returned object is of type Google::Cloud::Retail::V2::CompletionConfig. - p result -end -# [END retail_v2_generated_CatalogService_UpdateCompletionConfig_sync] diff --git a/owl-bot-staging/google-cloud-retail-v2/snippets/completion_service/complete_query.rb b/owl-bot-staging/google-cloud-retail-v2/snippets/completion_service/complete_query.rb deleted file mode 100644 index 874d7cee8d67..000000000000 --- a/owl-bot-staging/google-cloud-retail-v2/snippets/completion_service/complete_query.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 retail_v2_generated_CompletionService_CompleteQuery_sync] -require "google/cloud/retail/v2" - -## -# Snippet for the complete_query call in the CompletionService service -# -# This snippet has been automatically generated and should be regarded as a code -# template only. It will require modifications to work: -# - It may require correct/in-range values for request initialization. -# - It may require specifying regional endpoints when creating the service -# client as shown in https://cloud.google.com/ruby/docs/reference. -# -# This is an auto-generated example demonstrating basic usage of -# Google::Cloud::Retail::V2::CompletionService::Client#complete_query. -# -def complete_query - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::Retail::V2::CompletionService::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::Retail::V2::CompleteQueryRequest.new - - # Call the complete_query method. - result = client.complete_query request - - # The returned object is of type Google::Cloud::Retail::V2::CompleteQueryResponse. - p result -end -# [END retail_v2_generated_CompletionService_CompleteQuery_sync] diff --git a/owl-bot-staging/google-cloud-retail-v2/snippets/completion_service/import_completion_data.rb b/owl-bot-staging/google-cloud-retail-v2/snippets/completion_service/import_completion_data.rb deleted file mode 100644 index fe1f28f0844e..000000000000 --- a/owl-bot-staging/google-cloud-retail-v2/snippets/completion_service/import_completion_data.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 retail_v2_generated_CompletionService_ImportCompletionData_sync] -require "google/cloud/retail/v2" - -## -# Snippet for the import_completion_data call in the CompletionService service -# -# This snippet has been automatically generated and should be regarded as a code -# template only. It will require modifications to work: -# - It may require correct/in-range values for request initialization. -# - It may require specifying regional endpoints when creating the service -# client as shown in https://cloud.google.com/ruby/docs/reference. -# -# This is an auto-generated example demonstrating basic usage of -# Google::Cloud::Retail::V2::CompletionService::Client#import_completion_data. -# -def import_completion_data - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::Retail::V2::CompletionService::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::Retail::V2::ImportCompletionDataRequest.new - - # Call the import_completion_data method. - result = client.import_completion_data 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 retail_v2_generated_CompletionService_ImportCompletionData_sync] diff --git a/owl-bot-staging/google-cloud-retail-v2/snippets/control_service/create_control.rb b/owl-bot-staging/google-cloud-retail-v2/snippets/control_service/create_control.rb deleted file mode 100644 index 32b89537acd9..000000000000 --- a/owl-bot-staging/google-cloud-retail-v2/snippets/control_service/create_control.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 retail_v2_generated_ControlService_CreateControl_sync] -require "google/cloud/retail/v2" - -## -# Snippet for the create_control call in the ControlService service -# -# This snippet has been automatically generated and should be regarded as a code -# template only. It will require modifications to work: -# - It may require correct/in-range values for request initialization. -# - It may require specifying regional endpoints when creating the service -# client as shown in https://cloud.google.com/ruby/docs/reference. -# -# This is an auto-generated example demonstrating basic usage of -# Google::Cloud::Retail::V2::ControlService::Client#create_control. -# -def create_control - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::Retail::V2::ControlService::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::Retail::V2::CreateControlRequest.new - - # Call the create_control method. - result = client.create_control request - - # The returned object is of type Google::Cloud::Retail::V2::Control. - p result -end -# [END retail_v2_generated_ControlService_CreateControl_sync] diff --git a/owl-bot-staging/google-cloud-retail-v2/snippets/control_service/delete_control.rb b/owl-bot-staging/google-cloud-retail-v2/snippets/control_service/delete_control.rb deleted file mode 100644 index 42aa73e1063a..000000000000 --- a/owl-bot-staging/google-cloud-retail-v2/snippets/control_service/delete_control.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 retail_v2_generated_ControlService_DeleteControl_sync] -require "google/cloud/retail/v2" - -## -# Snippet for the delete_control call in the ControlService service -# -# This snippet has been automatically generated and should be regarded as a code -# template only. It will require modifications to work: -# - It may require correct/in-range values for request initialization. -# - It may require specifying regional endpoints when creating the service -# client as shown in https://cloud.google.com/ruby/docs/reference. -# -# This is an auto-generated example demonstrating basic usage of -# Google::Cloud::Retail::V2::ControlService::Client#delete_control. -# -def delete_control - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::Retail::V2::ControlService::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::Retail::V2::DeleteControlRequest.new - - # Call the delete_control method. - result = client.delete_control request - - # The returned object is of type Google::Protobuf::Empty. - p result -end -# [END retail_v2_generated_ControlService_DeleteControl_sync] diff --git a/owl-bot-staging/google-cloud-retail-v2/snippets/control_service/get_control.rb b/owl-bot-staging/google-cloud-retail-v2/snippets/control_service/get_control.rb deleted file mode 100644 index 2785feb65202..000000000000 --- a/owl-bot-staging/google-cloud-retail-v2/snippets/control_service/get_control.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 retail_v2_generated_ControlService_GetControl_sync] -require "google/cloud/retail/v2" - -## -# Snippet for the get_control call in the ControlService service -# -# This snippet has been automatically generated and should be regarded as a code -# template only. It will require modifications to work: -# - It may require correct/in-range values for request initialization. -# - It may require specifying regional endpoints when creating the service -# client as shown in https://cloud.google.com/ruby/docs/reference. -# -# This is an auto-generated example demonstrating basic usage of -# Google::Cloud::Retail::V2::ControlService::Client#get_control. -# -def get_control - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::Retail::V2::ControlService::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::Retail::V2::GetControlRequest.new - - # Call the get_control method. - result = client.get_control request - - # The returned object is of type Google::Cloud::Retail::V2::Control. - p result -end -# [END retail_v2_generated_ControlService_GetControl_sync] diff --git a/owl-bot-staging/google-cloud-retail-v2/snippets/control_service/list_controls.rb b/owl-bot-staging/google-cloud-retail-v2/snippets/control_service/list_controls.rb deleted file mode 100644 index 7394fdd3076a..000000000000 --- a/owl-bot-staging/google-cloud-retail-v2/snippets/control_service/list_controls.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 retail_v2_generated_ControlService_ListControls_sync] -require "google/cloud/retail/v2" - -## -# Snippet for the list_controls call in the ControlService service -# -# This snippet has been automatically generated and should be regarded as a code -# template only. It will require modifications to work: -# - It may require correct/in-range values for request initialization. -# - It may require specifying regional endpoints when creating the service -# client as shown in https://cloud.google.com/ruby/docs/reference. -# -# This is an auto-generated example demonstrating basic usage of -# Google::Cloud::Retail::V2::ControlService::Client#list_controls. -# -def list_controls - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::Retail::V2::ControlService::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::Retail::V2::ListControlsRequest.new - - # Call the list_controls method. - result = client.list_controls request - - # The returned object is of type Gapic::PagedEnumerable. You can iterate - # over elements, and API calls will be issued to fetch pages as needed. - result.each do |item| - # Each element is of type ::Google::Cloud::Retail::V2::Control. - p item - end -end -# [END retail_v2_generated_ControlService_ListControls_sync] diff --git a/owl-bot-staging/google-cloud-retail-v2/snippets/control_service/update_control.rb b/owl-bot-staging/google-cloud-retail-v2/snippets/control_service/update_control.rb deleted file mode 100644 index f3bf5821b03b..000000000000 --- a/owl-bot-staging/google-cloud-retail-v2/snippets/control_service/update_control.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 retail_v2_generated_ControlService_UpdateControl_sync] -require "google/cloud/retail/v2" - -## -# Snippet for the update_control call in the ControlService service -# -# This snippet has been automatically generated and should be regarded as a code -# template only. It will require modifications to work: -# - It may require correct/in-range values for request initialization. -# - It may require specifying regional endpoints when creating the service -# client as shown in https://cloud.google.com/ruby/docs/reference. -# -# This is an auto-generated example demonstrating basic usage of -# Google::Cloud::Retail::V2::ControlService::Client#update_control. -# -def update_control - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::Retail::V2::ControlService::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::Retail::V2::UpdateControlRequest.new - - # Call the update_control method. - result = client.update_control request - - # The returned object is of type Google::Cloud::Retail::V2::Control. - p result -end -# [END retail_v2_generated_ControlService_UpdateControl_sync] diff --git a/owl-bot-staging/google-cloud-retail-v2/snippets/conversational_search_service/conversational_search.rb b/owl-bot-staging/google-cloud-retail-v2/snippets/conversational_search_service/conversational_search.rb deleted file mode 100644 index 19ab711ac479..000000000000 --- a/owl-bot-staging/google-cloud-retail-v2/snippets/conversational_search_service/conversational_search.rb +++ /dev/null @@ -1,50 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -# [START retail_v2_generated_ConversationalSearchService_ConversationalSearch_sync] -require "google/cloud/retail/v2" - -## -# Snippet for the conversational_search call in the ConversationalSearchService service -# -# This snippet has been automatically generated and should be regarded as a code -# template only. It will require modifications to work: -# - It may require correct/in-range values for request initialization. -# - It may require specifying regional endpoints when creating the service -# client as shown in https://cloud.google.com/ruby/docs/reference. -# -# This is an auto-generated example demonstrating basic usage of -# Google::Cloud::Retail::V2::ConversationalSearchService::Client#conversational_search. -# -def conversational_search - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::Retail::V2::ConversationalSearchService::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::Retail::V2::ConversationalSearchRequest.new - - # Call the conversational_search method to start streaming. - output = client.conversational_search request - - # The returned object is a streamed enumerable yielding elements of type - # ::Google::Cloud::Retail::V2::ConversationalSearchResponse - output.each do |current_response| - p current_response - end -end -# [END retail_v2_generated_ConversationalSearchService_ConversationalSearch_sync] diff --git a/owl-bot-staging/google-cloud-retail-v2/snippets/generative_question_service/batch_update_generative_question_configs.rb b/owl-bot-staging/google-cloud-retail-v2/snippets/generative_question_service/batch_update_generative_question_configs.rb deleted file mode 100644 index ec7f82414dea..000000000000 --- a/owl-bot-staging/google-cloud-retail-v2/snippets/generative_question_service/batch_update_generative_question_configs.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 retail_v2_generated_GenerativeQuestionService_BatchUpdateGenerativeQuestionConfigs_sync] -require "google/cloud/retail/v2" - -## -# Snippet for the batch_update_generative_question_configs call in the GenerativeQuestionService service -# -# This snippet has been automatically generated and should be regarded as a code -# template only. It will require modifications to work: -# - It may require correct/in-range values for request initialization. -# - It may require specifying regional endpoints when creating the service -# client as shown in https://cloud.google.com/ruby/docs/reference. -# -# This is an auto-generated example demonstrating basic usage of -# Google::Cloud::Retail::V2::GenerativeQuestionService::Client#batch_update_generative_question_configs. -# -def batch_update_generative_question_configs - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::Retail::V2::GenerativeQuestionService::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::Retail::V2::BatchUpdateGenerativeQuestionConfigsRequest.new - - # Call the batch_update_generative_question_configs method. - result = client.batch_update_generative_question_configs request - - # The returned object is of type Google::Cloud::Retail::V2::BatchUpdateGenerativeQuestionConfigsResponse. - p result -end -# [END retail_v2_generated_GenerativeQuestionService_BatchUpdateGenerativeQuestionConfigs_sync] diff --git a/owl-bot-staging/google-cloud-retail-v2/snippets/generative_question_service/get_generative_questions_feature_config.rb b/owl-bot-staging/google-cloud-retail-v2/snippets/generative_question_service/get_generative_questions_feature_config.rb deleted file mode 100644 index d9b400ceed6d..000000000000 --- a/owl-bot-staging/google-cloud-retail-v2/snippets/generative_question_service/get_generative_questions_feature_config.rb +++ /dev/null @@ -1,47 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -# [START retail_v2_generated_GenerativeQuestionService_GetGenerativeQuestionsFeatureConfig_sync] -require "google/cloud/retail/v2" - -## -# Snippet for the get_generative_questions_feature_config call in the GenerativeQuestionService service -# -# This snippet has been automatically generated and should be regarded as a code -# template only. It will require modifications to work: -# - It may require correct/in-range values for request initialization. -# - It may require specifying regional endpoints when creating the service -# client as shown in https://cloud.google.com/ruby/docs/reference. -# -# This is an auto-generated example demonstrating basic usage of -# Google::Cloud::Retail::V2::GenerativeQuestionService::Client#get_generative_questions_feature_config. -# -def get_generative_questions_feature_config - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::Retail::V2::GenerativeQuestionService::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::Retail::V2::GetGenerativeQuestionsFeatureConfigRequest.new - - # Call the get_generative_questions_feature_config method. - result = client.get_generative_questions_feature_config request - - # The returned object is of type Google::Cloud::Retail::V2::GenerativeQuestionsFeatureConfig. - p result -end -# [END retail_v2_generated_GenerativeQuestionService_GetGenerativeQuestionsFeatureConfig_sync] diff --git a/owl-bot-staging/google-cloud-retail-v2/snippets/generative_question_service/list_generative_question_configs.rb b/owl-bot-staging/google-cloud-retail-v2/snippets/generative_question_service/list_generative_question_configs.rb deleted file mode 100644 index 66d6f2d20042..000000000000 --- a/owl-bot-staging/google-cloud-retail-v2/snippets/generative_question_service/list_generative_question_configs.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 retail_v2_generated_GenerativeQuestionService_ListGenerativeQuestionConfigs_sync] -require "google/cloud/retail/v2" - -## -# Snippet for the list_generative_question_configs call in the GenerativeQuestionService service -# -# This snippet has been automatically generated and should be regarded as a code -# template only. It will require modifications to work: -# - It may require correct/in-range values for request initialization. -# - It may require specifying regional endpoints when creating the service -# client as shown in https://cloud.google.com/ruby/docs/reference. -# -# This is an auto-generated example demonstrating basic usage of -# Google::Cloud::Retail::V2::GenerativeQuestionService::Client#list_generative_question_configs. -# -def list_generative_question_configs - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::Retail::V2::GenerativeQuestionService::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::Retail::V2::ListGenerativeQuestionConfigsRequest.new - - # Call the list_generative_question_configs method. - result = client.list_generative_question_configs request - - # The returned object is of type Google::Cloud::Retail::V2::ListGenerativeQuestionConfigsResponse. - p result -end -# [END retail_v2_generated_GenerativeQuestionService_ListGenerativeQuestionConfigs_sync] diff --git a/owl-bot-staging/google-cloud-retail-v2/snippets/generative_question_service/update_generative_question_config.rb b/owl-bot-staging/google-cloud-retail-v2/snippets/generative_question_service/update_generative_question_config.rb deleted file mode 100644 index 73faa0a00347..000000000000 --- a/owl-bot-staging/google-cloud-retail-v2/snippets/generative_question_service/update_generative_question_config.rb +++ /dev/null @@ -1,47 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -# [START retail_v2_generated_GenerativeQuestionService_UpdateGenerativeQuestionConfig_sync] -require "google/cloud/retail/v2" - -## -# Snippet for the update_generative_question_config call in the GenerativeQuestionService service -# -# This snippet has been automatically generated and should be regarded as a code -# template only. It will require modifications to work: -# - It may require correct/in-range values for request initialization. -# - It may require specifying regional endpoints when creating the service -# client as shown in https://cloud.google.com/ruby/docs/reference. -# -# This is an auto-generated example demonstrating basic usage of -# Google::Cloud::Retail::V2::GenerativeQuestionService::Client#update_generative_question_config. -# -def update_generative_question_config - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::Retail::V2::GenerativeQuestionService::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::Retail::V2::UpdateGenerativeQuestionConfigRequest.new - - # Call the update_generative_question_config method. - result = client.update_generative_question_config request - - # The returned object is of type Google::Cloud::Retail::V2::GenerativeQuestionConfig. - p result -end -# [END retail_v2_generated_GenerativeQuestionService_UpdateGenerativeQuestionConfig_sync] diff --git a/owl-bot-staging/google-cloud-retail-v2/snippets/generative_question_service/update_generative_questions_feature_config.rb b/owl-bot-staging/google-cloud-retail-v2/snippets/generative_question_service/update_generative_questions_feature_config.rb deleted file mode 100644 index edec3d61d8a8..000000000000 --- a/owl-bot-staging/google-cloud-retail-v2/snippets/generative_question_service/update_generative_questions_feature_config.rb +++ /dev/null @@ -1,47 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -# [START retail_v2_generated_GenerativeQuestionService_UpdateGenerativeQuestionsFeatureConfig_sync] -require "google/cloud/retail/v2" - -## -# Snippet for the update_generative_questions_feature_config call in the GenerativeQuestionService service -# -# This snippet has been automatically generated and should be regarded as a code -# template only. It will require modifications to work: -# - It may require correct/in-range values for request initialization. -# - It may require specifying regional endpoints when creating the service -# client as shown in https://cloud.google.com/ruby/docs/reference. -# -# This is an auto-generated example demonstrating basic usage of -# Google::Cloud::Retail::V2::GenerativeQuestionService::Client#update_generative_questions_feature_config. -# -def update_generative_questions_feature_config - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::Retail::V2::GenerativeQuestionService::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::Retail::V2::UpdateGenerativeQuestionsFeatureConfigRequest.new - - # Call the update_generative_questions_feature_config method. - result = client.update_generative_questions_feature_config request - - # The returned object is of type Google::Cloud::Retail::V2::GenerativeQuestionsFeatureConfig. - p result -end -# [END retail_v2_generated_GenerativeQuestionService_UpdateGenerativeQuestionsFeatureConfig_sync] diff --git a/owl-bot-staging/google-cloud-retail-v2/snippets/model_service/create_model.rb b/owl-bot-staging/google-cloud-retail-v2/snippets/model_service/create_model.rb deleted file mode 100644 index ffbfd59f4a13..000000000000 --- a/owl-bot-staging/google-cloud-retail-v2/snippets/model_service/create_model.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 retail_v2_generated_ModelService_CreateModel_sync] -require "google/cloud/retail/v2" - -## -# Snippet for the create_model call in the ModelService service -# -# This snippet has been automatically generated and should be regarded as a code -# template only. It will require modifications to work: -# - It may require correct/in-range values for request initialization. -# - It may require specifying regional endpoints when creating the service -# client as shown in https://cloud.google.com/ruby/docs/reference. -# -# This is an auto-generated example demonstrating basic usage of -# Google::Cloud::Retail::V2::ModelService::Client#create_model. -# -def create_model - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::Retail::V2::ModelService::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::Retail::V2::CreateModelRequest.new - - # Call the create_model method. - result = client.create_model 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 retail_v2_generated_ModelService_CreateModel_sync] diff --git a/owl-bot-staging/google-cloud-retail-v2/snippets/model_service/delete_model.rb b/owl-bot-staging/google-cloud-retail-v2/snippets/model_service/delete_model.rb deleted file mode 100644 index 8a92e3fe6c8e..000000000000 --- a/owl-bot-staging/google-cloud-retail-v2/snippets/model_service/delete_model.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 retail_v2_generated_ModelService_DeleteModel_sync] -require "google/cloud/retail/v2" - -## -# Snippet for the delete_model call in the ModelService service -# -# This snippet has been automatically generated and should be regarded as a code -# template only. It will require modifications to work: -# - It may require correct/in-range values for request initialization. -# - It may require specifying regional endpoints when creating the service -# client as shown in https://cloud.google.com/ruby/docs/reference. -# -# This is an auto-generated example demonstrating basic usage of -# Google::Cloud::Retail::V2::ModelService::Client#delete_model. -# -def delete_model - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::Retail::V2::ModelService::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::Retail::V2::DeleteModelRequest.new - - # Call the delete_model method. - result = client.delete_model request - - # The returned object is of type Google::Protobuf::Empty. - p result -end -# [END retail_v2_generated_ModelService_DeleteModel_sync] diff --git a/owl-bot-staging/google-cloud-retail-v2/snippets/model_service/get_model.rb b/owl-bot-staging/google-cloud-retail-v2/snippets/model_service/get_model.rb deleted file mode 100644 index 8ca949873471..000000000000 --- a/owl-bot-staging/google-cloud-retail-v2/snippets/model_service/get_model.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 retail_v2_generated_ModelService_GetModel_sync] -require "google/cloud/retail/v2" - -## -# Snippet for the get_model call in the ModelService service -# -# This snippet has been automatically generated and should be regarded as a code -# template only. It will require modifications to work: -# - It may require correct/in-range values for request initialization. -# - It may require specifying regional endpoints when creating the service -# client as shown in https://cloud.google.com/ruby/docs/reference. -# -# This is an auto-generated example demonstrating basic usage of -# Google::Cloud::Retail::V2::ModelService::Client#get_model. -# -def get_model - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::Retail::V2::ModelService::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::Retail::V2::GetModelRequest.new - - # Call the get_model method. - result = client.get_model request - - # The returned object is of type Google::Cloud::Retail::V2::Model. - p result -end -# [END retail_v2_generated_ModelService_GetModel_sync] diff --git a/owl-bot-staging/google-cloud-retail-v2/snippets/model_service/list_models.rb b/owl-bot-staging/google-cloud-retail-v2/snippets/model_service/list_models.rb deleted file mode 100644 index a652ccbdc26a..000000000000 --- a/owl-bot-staging/google-cloud-retail-v2/snippets/model_service/list_models.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 retail_v2_generated_ModelService_ListModels_sync] -require "google/cloud/retail/v2" - -## -# Snippet for the list_models call in the ModelService service -# -# This snippet has been automatically generated and should be regarded as a code -# template only. It will require modifications to work: -# - It may require correct/in-range values for request initialization. -# - It may require specifying regional endpoints when creating the service -# client as shown in https://cloud.google.com/ruby/docs/reference. -# -# This is an auto-generated example demonstrating basic usage of -# Google::Cloud::Retail::V2::ModelService::Client#list_models. -# -def list_models - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::Retail::V2::ModelService::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::Retail::V2::ListModelsRequest.new - - # Call the list_models method. - result = client.list_models request - - # The returned object is of type Gapic::PagedEnumerable. You can iterate - # over elements, and API calls will be issued to fetch pages as needed. - result.each do |item| - # Each element is of type ::Google::Cloud::Retail::V2::Model. - p item - end -end -# [END retail_v2_generated_ModelService_ListModels_sync] diff --git a/owl-bot-staging/google-cloud-retail-v2/snippets/model_service/pause_model.rb b/owl-bot-staging/google-cloud-retail-v2/snippets/model_service/pause_model.rb deleted file mode 100644 index d563bf2a6c88..000000000000 --- a/owl-bot-staging/google-cloud-retail-v2/snippets/model_service/pause_model.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 retail_v2_generated_ModelService_PauseModel_sync] -require "google/cloud/retail/v2" - -## -# Snippet for the pause_model call in the ModelService service -# -# This snippet has been automatically generated and should be regarded as a code -# template only. It will require modifications to work: -# - It may require correct/in-range values for request initialization. -# - It may require specifying regional endpoints when creating the service -# client as shown in https://cloud.google.com/ruby/docs/reference. -# -# This is an auto-generated example demonstrating basic usage of -# Google::Cloud::Retail::V2::ModelService::Client#pause_model. -# -def pause_model - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::Retail::V2::ModelService::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::Retail::V2::PauseModelRequest.new - - # Call the pause_model method. - result = client.pause_model request - - # The returned object is of type Google::Cloud::Retail::V2::Model. - p result -end -# [END retail_v2_generated_ModelService_PauseModel_sync] diff --git a/owl-bot-staging/google-cloud-retail-v2/snippets/model_service/resume_model.rb b/owl-bot-staging/google-cloud-retail-v2/snippets/model_service/resume_model.rb deleted file mode 100644 index 175e84817b36..000000000000 --- a/owl-bot-staging/google-cloud-retail-v2/snippets/model_service/resume_model.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 retail_v2_generated_ModelService_ResumeModel_sync] -require "google/cloud/retail/v2" - -## -# Snippet for the resume_model call in the ModelService service -# -# This snippet has been automatically generated and should be regarded as a code -# template only. It will require modifications to work: -# - It may require correct/in-range values for request initialization. -# - It may require specifying regional endpoints when creating the service -# client as shown in https://cloud.google.com/ruby/docs/reference. -# -# This is an auto-generated example demonstrating basic usage of -# Google::Cloud::Retail::V2::ModelService::Client#resume_model. -# -def resume_model - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::Retail::V2::ModelService::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::Retail::V2::ResumeModelRequest.new - - # Call the resume_model method. - result = client.resume_model request - - # The returned object is of type Google::Cloud::Retail::V2::Model. - p result -end -# [END retail_v2_generated_ModelService_ResumeModel_sync] diff --git a/owl-bot-staging/google-cloud-retail-v2/snippets/model_service/tune_model.rb b/owl-bot-staging/google-cloud-retail-v2/snippets/model_service/tune_model.rb deleted file mode 100644 index 8b60f30ed5ee..000000000000 --- a/owl-bot-staging/google-cloud-retail-v2/snippets/model_service/tune_model.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 retail_v2_generated_ModelService_TuneModel_sync] -require "google/cloud/retail/v2" - -## -# Snippet for the tune_model call in the ModelService service -# -# This snippet has been automatically generated and should be regarded as a code -# template only. It will require modifications to work: -# - It may require correct/in-range values for request initialization. -# - It may require specifying regional endpoints when creating the service -# client as shown in https://cloud.google.com/ruby/docs/reference. -# -# This is an auto-generated example demonstrating basic usage of -# Google::Cloud::Retail::V2::ModelService::Client#tune_model. -# -def tune_model - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::Retail::V2::ModelService::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::Retail::V2::TuneModelRequest.new - - # Call the tune_model method. - result = client.tune_model 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 retail_v2_generated_ModelService_TuneModel_sync] diff --git a/owl-bot-staging/google-cloud-retail-v2/snippets/model_service/update_model.rb b/owl-bot-staging/google-cloud-retail-v2/snippets/model_service/update_model.rb deleted file mode 100644 index 0648bf6ab25e..000000000000 --- a/owl-bot-staging/google-cloud-retail-v2/snippets/model_service/update_model.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 retail_v2_generated_ModelService_UpdateModel_sync] -require "google/cloud/retail/v2" - -## -# Snippet for the update_model call in the ModelService service -# -# This snippet has been automatically generated and should be regarded as a code -# template only. It will require modifications to work: -# - It may require correct/in-range values for request initialization. -# - It may require specifying regional endpoints when creating the service -# client as shown in https://cloud.google.com/ruby/docs/reference. -# -# This is an auto-generated example demonstrating basic usage of -# Google::Cloud::Retail::V2::ModelService::Client#update_model. -# -def update_model - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::Retail::V2::ModelService::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::Retail::V2::UpdateModelRequest.new - - # Call the update_model method. - result = client.update_model request - - # The returned object is of type Google::Cloud::Retail::V2::Model. - p result -end -# [END retail_v2_generated_ModelService_UpdateModel_sync] diff --git a/owl-bot-staging/google-cloud-retail-v2/snippets/prediction_service/predict.rb b/owl-bot-staging/google-cloud-retail-v2/snippets/prediction_service/predict.rb deleted file mode 100644 index da0cc34c34ab..000000000000 --- a/owl-bot-staging/google-cloud-retail-v2/snippets/prediction_service/predict.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 retail_v2_generated_PredictionService_Predict_sync] -require "google/cloud/retail/v2" - -## -# Snippet for the predict call in the PredictionService service -# -# This snippet has been automatically generated and should be regarded as a code -# template only. It will require modifications to work: -# - It may require correct/in-range values for request initialization. -# - It may require specifying regional endpoints when creating the service -# client as shown in https://cloud.google.com/ruby/docs/reference. -# -# This is an auto-generated example demonstrating basic usage of -# Google::Cloud::Retail::V2::PredictionService::Client#predict. -# -def predict - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::Retail::V2::PredictionService::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::Retail::V2::PredictRequest.new - - # Call the predict method. - result = client.predict request - - # The returned object is of type Google::Cloud::Retail::V2::PredictResponse. - p result -end -# [END retail_v2_generated_PredictionService_Predict_sync] diff --git a/owl-bot-staging/google-cloud-retail-v2/snippets/product_service/add_fulfillment_places.rb b/owl-bot-staging/google-cloud-retail-v2/snippets/product_service/add_fulfillment_places.rb deleted file mode 100644 index 4ec26b4419f7..000000000000 --- a/owl-bot-staging/google-cloud-retail-v2/snippets/product_service/add_fulfillment_places.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 retail_v2_generated_ProductService_AddFulfillmentPlaces_sync] -require "google/cloud/retail/v2" - -## -# Snippet for the add_fulfillment_places call in the ProductService service -# -# This snippet has been automatically generated and should be regarded as a code -# template only. It will require modifications to work: -# - It may require correct/in-range values for request initialization. -# - It may require specifying regional endpoints when creating the service -# client as shown in https://cloud.google.com/ruby/docs/reference. -# -# This is an auto-generated example demonstrating basic usage of -# Google::Cloud::Retail::V2::ProductService::Client#add_fulfillment_places. -# -def add_fulfillment_places - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::Retail::V2::ProductService::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::Retail::V2::AddFulfillmentPlacesRequest.new - - # Call the add_fulfillment_places method. - result = client.add_fulfillment_places 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 retail_v2_generated_ProductService_AddFulfillmentPlaces_sync] diff --git a/owl-bot-staging/google-cloud-retail-v2/snippets/product_service/add_local_inventories.rb b/owl-bot-staging/google-cloud-retail-v2/snippets/product_service/add_local_inventories.rb deleted file mode 100644 index 2f4627281ccb..000000000000 --- a/owl-bot-staging/google-cloud-retail-v2/snippets/product_service/add_local_inventories.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 retail_v2_generated_ProductService_AddLocalInventories_sync] -require "google/cloud/retail/v2" - -## -# Snippet for the add_local_inventories call in the ProductService service -# -# This snippet has been automatically generated and should be regarded as a code -# template only. It will require modifications to work: -# - It may require correct/in-range values for request initialization. -# - It may require specifying regional endpoints when creating the service -# client as shown in https://cloud.google.com/ruby/docs/reference. -# -# This is an auto-generated example demonstrating basic usage of -# Google::Cloud::Retail::V2::ProductService::Client#add_local_inventories. -# -def add_local_inventories - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::Retail::V2::ProductService::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::Retail::V2::AddLocalInventoriesRequest.new - - # Call the add_local_inventories method. - result = client.add_local_inventories 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 retail_v2_generated_ProductService_AddLocalInventories_sync] diff --git a/owl-bot-staging/google-cloud-retail-v2/snippets/product_service/create_product.rb b/owl-bot-staging/google-cloud-retail-v2/snippets/product_service/create_product.rb deleted file mode 100644 index 4042ed4becf7..000000000000 --- a/owl-bot-staging/google-cloud-retail-v2/snippets/product_service/create_product.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 retail_v2_generated_ProductService_CreateProduct_sync] -require "google/cloud/retail/v2" - -## -# Snippet for the create_product call in the ProductService service -# -# This snippet has been automatically generated and should be regarded as a code -# template only. It will require modifications to work: -# - It may require correct/in-range values for request initialization. -# - It may require specifying regional endpoints when creating the service -# client as shown in https://cloud.google.com/ruby/docs/reference. -# -# This is an auto-generated example demonstrating basic usage of -# Google::Cloud::Retail::V2::ProductService::Client#create_product. -# -def create_product - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::Retail::V2::ProductService::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::Retail::V2::CreateProductRequest.new - - # Call the create_product method. - result = client.create_product request - - # The returned object is of type Google::Cloud::Retail::V2::Product. - p result -end -# [END retail_v2_generated_ProductService_CreateProduct_sync] diff --git a/owl-bot-staging/google-cloud-retail-v2/snippets/product_service/delete_product.rb b/owl-bot-staging/google-cloud-retail-v2/snippets/product_service/delete_product.rb deleted file mode 100644 index 6a95e9192bfa..000000000000 --- a/owl-bot-staging/google-cloud-retail-v2/snippets/product_service/delete_product.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 retail_v2_generated_ProductService_DeleteProduct_sync] -require "google/cloud/retail/v2" - -## -# Snippet for the delete_product call in the ProductService service -# -# This snippet has been automatically generated and should be regarded as a code -# template only. It will require modifications to work: -# - It may require correct/in-range values for request initialization. -# - It may require specifying regional endpoints when creating the service -# client as shown in https://cloud.google.com/ruby/docs/reference. -# -# This is an auto-generated example demonstrating basic usage of -# Google::Cloud::Retail::V2::ProductService::Client#delete_product. -# -def delete_product - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::Retail::V2::ProductService::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::Retail::V2::DeleteProductRequest.new - - # Call the delete_product method. - result = client.delete_product request - - # The returned object is of type Google::Protobuf::Empty. - p result -end -# [END retail_v2_generated_ProductService_DeleteProduct_sync] diff --git a/owl-bot-staging/google-cloud-retail-v2/snippets/product_service/get_product.rb b/owl-bot-staging/google-cloud-retail-v2/snippets/product_service/get_product.rb deleted file mode 100644 index 72fa221658aa..000000000000 --- a/owl-bot-staging/google-cloud-retail-v2/snippets/product_service/get_product.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 retail_v2_generated_ProductService_GetProduct_sync] -require "google/cloud/retail/v2" - -## -# Snippet for the get_product call in the ProductService service -# -# This snippet has been automatically generated and should be regarded as a code -# template only. It will require modifications to work: -# - It may require correct/in-range values for request initialization. -# - It may require specifying regional endpoints when creating the service -# client as shown in https://cloud.google.com/ruby/docs/reference. -# -# This is an auto-generated example demonstrating basic usage of -# Google::Cloud::Retail::V2::ProductService::Client#get_product. -# -def get_product - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::Retail::V2::ProductService::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::Retail::V2::GetProductRequest.new - - # Call the get_product method. - result = client.get_product request - - # The returned object is of type Google::Cloud::Retail::V2::Product. - p result -end -# [END retail_v2_generated_ProductService_GetProduct_sync] diff --git a/owl-bot-staging/google-cloud-retail-v2/snippets/product_service/import_products.rb b/owl-bot-staging/google-cloud-retail-v2/snippets/product_service/import_products.rb deleted file mode 100644 index 1db99c203a0e..000000000000 --- a/owl-bot-staging/google-cloud-retail-v2/snippets/product_service/import_products.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 retail_v2_generated_ProductService_ImportProducts_sync] -require "google/cloud/retail/v2" - -## -# Snippet for the import_products call in the ProductService service -# -# This snippet has been automatically generated and should be regarded as a code -# template only. It will require modifications to work: -# - It may require correct/in-range values for request initialization. -# - It may require specifying regional endpoints when creating the service -# client as shown in https://cloud.google.com/ruby/docs/reference. -# -# This is an auto-generated example demonstrating basic usage of -# Google::Cloud::Retail::V2::ProductService::Client#import_products. -# -def import_products - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::Retail::V2::ProductService::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::Retail::V2::ImportProductsRequest.new - - # Call the import_products method. - result = client.import_products 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 retail_v2_generated_ProductService_ImportProducts_sync] diff --git a/owl-bot-staging/google-cloud-retail-v2/snippets/product_service/list_products.rb b/owl-bot-staging/google-cloud-retail-v2/snippets/product_service/list_products.rb deleted file mode 100644 index 3c55a501794a..000000000000 --- a/owl-bot-staging/google-cloud-retail-v2/snippets/product_service/list_products.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 retail_v2_generated_ProductService_ListProducts_sync] -require "google/cloud/retail/v2" - -## -# Snippet for the list_products call in the ProductService service -# -# This snippet has been automatically generated and should be regarded as a code -# template only. It will require modifications to work: -# - It may require correct/in-range values for request initialization. -# - It may require specifying regional endpoints when creating the service -# client as shown in https://cloud.google.com/ruby/docs/reference. -# -# This is an auto-generated example demonstrating basic usage of -# Google::Cloud::Retail::V2::ProductService::Client#list_products. -# -def list_products - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::Retail::V2::ProductService::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::Retail::V2::ListProductsRequest.new - - # Call the list_products method. - result = client.list_products request - - # The returned object is of type Gapic::PagedEnumerable. You can iterate - # over elements, and API calls will be issued to fetch pages as needed. - result.each do |item| - # Each element is of type ::Google::Cloud::Retail::V2::Product. - p item - end -end -# [END retail_v2_generated_ProductService_ListProducts_sync] diff --git a/owl-bot-staging/google-cloud-retail-v2/snippets/product_service/purge_products.rb b/owl-bot-staging/google-cloud-retail-v2/snippets/product_service/purge_products.rb deleted file mode 100644 index 6ba93cc5c41b..000000000000 --- a/owl-bot-staging/google-cloud-retail-v2/snippets/product_service/purge_products.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 retail_v2_generated_ProductService_PurgeProducts_sync] -require "google/cloud/retail/v2" - -## -# Snippet for the purge_products call in the ProductService service -# -# This snippet has been automatically generated and should be regarded as a code -# template only. It will require modifications to work: -# - It may require correct/in-range values for request initialization. -# - It may require specifying regional endpoints when creating the service -# client as shown in https://cloud.google.com/ruby/docs/reference. -# -# This is an auto-generated example demonstrating basic usage of -# Google::Cloud::Retail::V2::ProductService::Client#purge_products. -# -def purge_products - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::Retail::V2::ProductService::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::Retail::V2::PurgeProductsRequest.new - - # Call the purge_products method. - result = client.purge_products 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 retail_v2_generated_ProductService_PurgeProducts_sync] diff --git a/owl-bot-staging/google-cloud-retail-v2/snippets/product_service/remove_fulfillment_places.rb b/owl-bot-staging/google-cloud-retail-v2/snippets/product_service/remove_fulfillment_places.rb deleted file mode 100644 index 7e48ed058cec..000000000000 --- a/owl-bot-staging/google-cloud-retail-v2/snippets/product_service/remove_fulfillment_places.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 retail_v2_generated_ProductService_RemoveFulfillmentPlaces_sync] -require "google/cloud/retail/v2" - -## -# Snippet for the remove_fulfillment_places call in the ProductService service -# -# This snippet has been automatically generated and should be regarded as a code -# template only. It will require modifications to work: -# - It may require correct/in-range values for request initialization. -# - It may require specifying regional endpoints when creating the service -# client as shown in https://cloud.google.com/ruby/docs/reference. -# -# This is an auto-generated example demonstrating basic usage of -# Google::Cloud::Retail::V2::ProductService::Client#remove_fulfillment_places. -# -def remove_fulfillment_places - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::Retail::V2::ProductService::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::Retail::V2::RemoveFulfillmentPlacesRequest.new - - # Call the remove_fulfillment_places method. - result = client.remove_fulfillment_places 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 retail_v2_generated_ProductService_RemoveFulfillmentPlaces_sync] diff --git a/owl-bot-staging/google-cloud-retail-v2/snippets/product_service/remove_local_inventories.rb b/owl-bot-staging/google-cloud-retail-v2/snippets/product_service/remove_local_inventories.rb deleted file mode 100644 index 348089c03910..000000000000 --- a/owl-bot-staging/google-cloud-retail-v2/snippets/product_service/remove_local_inventories.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 retail_v2_generated_ProductService_RemoveLocalInventories_sync] -require "google/cloud/retail/v2" - -## -# Snippet for the remove_local_inventories call in the ProductService service -# -# This snippet has been automatically generated and should be regarded as a code -# template only. It will require modifications to work: -# - It may require correct/in-range values for request initialization. -# - It may require specifying regional endpoints when creating the service -# client as shown in https://cloud.google.com/ruby/docs/reference. -# -# This is an auto-generated example demonstrating basic usage of -# Google::Cloud::Retail::V2::ProductService::Client#remove_local_inventories. -# -def remove_local_inventories - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::Retail::V2::ProductService::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::Retail::V2::RemoveLocalInventoriesRequest.new - - # Call the remove_local_inventories method. - result = client.remove_local_inventories 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 retail_v2_generated_ProductService_RemoveLocalInventories_sync] diff --git a/owl-bot-staging/google-cloud-retail-v2/snippets/product_service/set_inventory.rb b/owl-bot-staging/google-cloud-retail-v2/snippets/product_service/set_inventory.rb deleted file mode 100644 index bae7bf9a57e5..000000000000 --- a/owl-bot-staging/google-cloud-retail-v2/snippets/product_service/set_inventory.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 retail_v2_generated_ProductService_SetInventory_sync] -require "google/cloud/retail/v2" - -## -# Snippet for the set_inventory call in the ProductService service -# -# This snippet has been automatically generated and should be regarded as a code -# template only. It will require modifications to work: -# - It may require correct/in-range values for request initialization. -# - It may require specifying regional endpoints when creating the service -# client as shown in https://cloud.google.com/ruby/docs/reference. -# -# This is an auto-generated example demonstrating basic usage of -# Google::Cloud::Retail::V2::ProductService::Client#set_inventory. -# -def set_inventory - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::Retail::V2::ProductService::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::Retail::V2::SetInventoryRequest.new - - # Call the set_inventory method. - result = client.set_inventory 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 retail_v2_generated_ProductService_SetInventory_sync] diff --git a/owl-bot-staging/google-cloud-retail-v2/snippets/product_service/update_product.rb b/owl-bot-staging/google-cloud-retail-v2/snippets/product_service/update_product.rb deleted file mode 100644 index 36642534fa9e..000000000000 --- a/owl-bot-staging/google-cloud-retail-v2/snippets/product_service/update_product.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 retail_v2_generated_ProductService_UpdateProduct_sync] -require "google/cloud/retail/v2" - -## -# Snippet for the update_product call in the ProductService service -# -# This snippet has been automatically generated and should be regarded as a code -# template only. It will require modifications to work: -# - It may require correct/in-range values for request initialization. -# - It may require specifying regional endpoints when creating the service -# client as shown in https://cloud.google.com/ruby/docs/reference. -# -# This is an auto-generated example demonstrating basic usage of -# Google::Cloud::Retail::V2::ProductService::Client#update_product. -# -def update_product - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::Retail::V2::ProductService::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::Retail::V2::UpdateProductRequest.new - - # Call the update_product method. - result = client.update_product request - - # The returned object is of type Google::Cloud::Retail::V2::Product. - p result -end -# [END retail_v2_generated_ProductService_UpdateProduct_sync] diff --git a/owl-bot-staging/google-cloud-retail-v2/snippets/search_service/search.rb b/owl-bot-staging/google-cloud-retail-v2/snippets/search_service/search.rb deleted file mode 100644 index 5dc88c9cf583..000000000000 --- a/owl-bot-staging/google-cloud-retail-v2/snippets/search_service/search.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 retail_v2_generated_SearchService_Search_sync] -require "google/cloud/retail/v2" - -## -# Snippet for the search call in the SearchService service -# -# This snippet has been automatically generated and should be regarded as a code -# template only. It will require modifications to work: -# - It may require correct/in-range values for request initialization. -# - It may require specifying regional endpoints when creating the service -# client as shown in https://cloud.google.com/ruby/docs/reference. -# -# This is an auto-generated example demonstrating basic usage of -# Google::Cloud::Retail::V2::SearchService::Client#search. -# -def search - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::Retail::V2::SearchService::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::Retail::V2::SearchRequest.new - - # Call the search method. - result = client.search request - - # The returned object is of type Gapic::PagedEnumerable. You can iterate - # over elements, and API calls will be issued to fetch pages as needed. - result.each do |item| - # Each element is of type ::Google::Cloud::Retail::V2::SearchResponse::SearchResult. - p item - end -end -# [END retail_v2_generated_SearchService_Search_sync] diff --git a/owl-bot-staging/google-cloud-retail-v2/snippets/serving_config_service/add_control.rb b/owl-bot-staging/google-cloud-retail-v2/snippets/serving_config_service/add_control.rb deleted file mode 100644 index 220931b22733..000000000000 --- a/owl-bot-staging/google-cloud-retail-v2/snippets/serving_config_service/add_control.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 retail_v2_generated_ServingConfigService_AddControl_sync] -require "google/cloud/retail/v2" - -## -# Snippet for the add_control call in the ServingConfigService service -# -# This snippet has been automatically generated and should be regarded as a code -# template only. It will require modifications to work: -# - It may require correct/in-range values for request initialization. -# - It may require specifying regional endpoints when creating the service -# client as shown in https://cloud.google.com/ruby/docs/reference. -# -# This is an auto-generated example demonstrating basic usage of -# Google::Cloud::Retail::V2::ServingConfigService::Client#add_control. -# -def add_control - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::Retail::V2::ServingConfigService::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::Retail::V2::AddControlRequest.new - - # Call the add_control method. - result = client.add_control request - - # The returned object is of type Google::Cloud::Retail::V2::ServingConfig. - p result -end -# [END retail_v2_generated_ServingConfigService_AddControl_sync] diff --git a/owl-bot-staging/google-cloud-retail-v2/snippets/serving_config_service/create_serving_config.rb b/owl-bot-staging/google-cloud-retail-v2/snippets/serving_config_service/create_serving_config.rb deleted file mode 100644 index 83294bf46733..000000000000 --- a/owl-bot-staging/google-cloud-retail-v2/snippets/serving_config_service/create_serving_config.rb +++ /dev/null @@ -1,47 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -# [START retail_v2_generated_ServingConfigService_CreateServingConfig_sync] -require "google/cloud/retail/v2" - -## -# Snippet for the create_serving_config call in the ServingConfigService service -# -# This snippet has been automatically generated and should be regarded as a code -# template only. It will require modifications to work: -# - It may require correct/in-range values for request initialization. -# - It may require specifying regional endpoints when creating the service -# client as shown in https://cloud.google.com/ruby/docs/reference. -# -# This is an auto-generated example demonstrating basic usage of -# Google::Cloud::Retail::V2::ServingConfigService::Client#create_serving_config. -# -def create_serving_config - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::Retail::V2::ServingConfigService::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::Retail::V2::CreateServingConfigRequest.new - - # Call the create_serving_config method. - result = client.create_serving_config request - - # The returned object is of type Google::Cloud::Retail::V2::ServingConfig. - p result -end -# [END retail_v2_generated_ServingConfigService_CreateServingConfig_sync] diff --git a/owl-bot-staging/google-cloud-retail-v2/snippets/serving_config_service/delete_serving_config.rb b/owl-bot-staging/google-cloud-retail-v2/snippets/serving_config_service/delete_serving_config.rb deleted file mode 100644 index 40f9a2606fca..000000000000 --- a/owl-bot-staging/google-cloud-retail-v2/snippets/serving_config_service/delete_serving_config.rb +++ /dev/null @@ -1,47 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -# [START retail_v2_generated_ServingConfigService_DeleteServingConfig_sync] -require "google/cloud/retail/v2" - -## -# Snippet for the delete_serving_config call in the ServingConfigService service -# -# This snippet has been automatically generated and should be regarded as a code -# template only. It will require modifications to work: -# - It may require correct/in-range values for request initialization. -# - It may require specifying regional endpoints when creating the service -# client as shown in https://cloud.google.com/ruby/docs/reference. -# -# This is an auto-generated example demonstrating basic usage of -# Google::Cloud::Retail::V2::ServingConfigService::Client#delete_serving_config. -# -def delete_serving_config - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::Retail::V2::ServingConfigService::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::Retail::V2::DeleteServingConfigRequest.new - - # Call the delete_serving_config method. - result = client.delete_serving_config request - - # The returned object is of type Google::Protobuf::Empty. - p result -end -# [END retail_v2_generated_ServingConfigService_DeleteServingConfig_sync] diff --git a/owl-bot-staging/google-cloud-retail-v2/snippets/serving_config_service/get_serving_config.rb b/owl-bot-staging/google-cloud-retail-v2/snippets/serving_config_service/get_serving_config.rb deleted file mode 100644 index c2f3df505c5f..000000000000 --- a/owl-bot-staging/google-cloud-retail-v2/snippets/serving_config_service/get_serving_config.rb +++ /dev/null @@ -1,47 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -# [START retail_v2_generated_ServingConfigService_GetServingConfig_sync] -require "google/cloud/retail/v2" - -## -# Snippet for the get_serving_config call in the ServingConfigService service -# -# This snippet has been automatically generated and should be regarded as a code -# template only. It will require modifications to work: -# - It may require correct/in-range values for request initialization. -# - It may require specifying regional endpoints when creating the service -# client as shown in https://cloud.google.com/ruby/docs/reference. -# -# This is an auto-generated example demonstrating basic usage of -# Google::Cloud::Retail::V2::ServingConfigService::Client#get_serving_config. -# -def get_serving_config - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::Retail::V2::ServingConfigService::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::Retail::V2::GetServingConfigRequest.new - - # Call the get_serving_config method. - result = client.get_serving_config request - - # The returned object is of type Google::Cloud::Retail::V2::ServingConfig. - p result -end -# [END retail_v2_generated_ServingConfigService_GetServingConfig_sync] diff --git a/owl-bot-staging/google-cloud-retail-v2/snippets/serving_config_service/list_serving_configs.rb b/owl-bot-staging/google-cloud-retail-v2/snippets/serving_config_service/list_serving_configs.rb deleted file mode 100644 index 1c0c7dcdf923..000000000000 --- a/owl-bot-staging/google-cloud-retail-v2/snippets/serving_config_service/list_serving_configs.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 retail_v2_generated_ServingConfigService_ListServingConfigs_sync] -require "google/cloud/retail/v2" - -## -# Snippet for the list_serving_configs call in the ServingConfigService service -# -# This snippet has been automatically generated and should be regarded as a code -# template only. It will require modifications to work: -# - It may require correct/in-range values for request initialization. -# - It may require specifying regional endpoints when creating the service -# client as shown in https://cloud.google.com/ruby/docs/reference. -# -# This is an auto-generated example demonstrating basic usage of -# Google::Cloud::Retail::V2::ServingConfigService::Client#list_serving_configs. -# -def list_serving_configs - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::Retail::V2::ServingConfigService::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::Retail::V2::ListServingConfigsRequest.new - - # Call the list_serving_configs method. - result = client.list_serving_configs request - - # The returned object is of type Gapic::PagedEnumerable. You can iterate - # over elements, and API calls will be issued to fetch pages as needed. - result.each do |item| - # Each element is of type ::Google::Cloud::Retail::V2::ServingConfig. - p item - end -end -# [END retail_v2_generated_ServingConfigService_ListServingConfigs_sync] diff --git a/owl-bot-staging/google-cloud-retail-v2/snippets/serving_config_service/remove_control.rb b/owl-bot-staging/google-cloud-retail-v2/snippets/serving_config_service/remove_control.rb deleted file mode 100644 index 7917bea15485..000000000000 --- a/owl-bot-staging/google-cloud-retail-v2/snippets/serving_config_service/remove_control.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 retail_v2_generated_ServingConfigService_RemoveControl_sync] -require "google/cloud/retail/v2" - -## -# Snippet for the remove_control call in the ServingConfigService service -# -# This snippet has been automatically generated and should be regarded as a code -# template only. It will require modifications to work: -# - It may require correct/in-range values for request initialization. -# - It may require specifying regional endpoints when creating the service -# client as shown in https://cloud.google.com/ruby/docs/reference. -# -# This is an auto-generated example demonstrating basic usage of -# Google::Cloud::Retail::V2::ServingConfigService::Client#remove_control. -# -def remove_control - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::Retail::V2::ServingConfigService::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::Retail::V2::RemoveControlRequest.new - - # Call the remove_control method. - result = client.remove_control request - - # The returned object is of type Google::Cloud::Retail::V2::ServingConfig. - p result -end -# [END retail_v2_generated_ServingConfigService_RemoveControl_sync] diff --git a/owl-bot-staging/google-cloud-retail-v2/snippets/serving_config_service/update_serving_config.rb b/owl-bot-staging/google-cloud-retail-v2/snippets/serving_config_service/update_serving_config.rb deleted file mode 100644 index 669a5bd2a303..000000000000 --- a/owl-bot-staging/google-cloud-retail-v2/snippets/serving_config_service/update_serving_config.rb +++ /dev/null @@ -1,47 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -# [START retail_v2_generated_ServingConfigService_UpdateServingConfig_sync] -require "google/cloud/retail/v2" - -## -# Snippet for the update_serving_config call in the ServingConfigService service -# -# This snippet has been automatically generated and should be regarded as a code -# template only. It will require modifications to work: -# - It may require correct/in-range values for request initialization. -# - It may require specifying regional endpoints when creating the service -# client as shown in https://cloud.google.com/ruby/docs/reference. -# -# This is an auto-generated example demonstrating basic usage of -# Google::Cloud::Retail::V2::ServingConfigService::Client#update_serving_config. -# -def update_serving_config - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::Retail::V2::ServingConfigService::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::Retail::V2::UpdateServingConfigRequest.new - - # Call the update_serving_config method. - result = client.update_serving_config request - - # The returned object is of type Google::Cloud::Retail::V2::ServingConfig. - p result -end -# [END retail_v2_generated_ServingConfigService_UpdateServingConfig_sync] diff --git a/owl-bot-staging/google-cloud-retail-v2/snippets/snippet_metadata_google.cloud.retail.v2.json b/owl-bot-staging/google-cloud-retail-v2/snippets/snippet_metadata_google.cloud.retail.v2.json deleted file mode 100644 index 3903e19ad375..000000000000 --- a/owl-bot-staging/google-cloud-retail-v2/snippets/snippet_metadata_google.cloud.retail.v2.json +++ /dev/null @@ -1,2375 +0,0 @@ -{ - "client_library": { - "name": "google-cloud-retail-v2", - "version": "", - "language": "RUBY", - "apis": [ - { - "id": "google.cloud.retail.v2", - "version": "v2" - } - ] - }, - "snippets": [ - { - "region_tag": "retail_v2_generated_AnalyticsService_ExportAnalyticsMetrics_sync", - "title": "Snippet for the export_analytics_metrics call in the AnalyticsService service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Retail::V2::AnalyticsService::Client#export_analytics_metrics.", - "file": "analytics_service/export_analytics_metrics.rb", - "language": "RUBY", - "client_method": { - "short_name": "export_analytics_metrics", - "full_name": "::Google::Cloud::Retail::V2::AnalyticsService::Client#export_analytics_metrics", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::Retail::V2::ExportAnalyticsMetricsRequest", - "name": "request" - } - ], - "result_type": "::Google::Longrunning::Operation", - "client": { - "short_name": "AnalyticsService::Client", - "full_name": "::Google::Cloud::Retail::V2::AnalyticsService::Client" - }, - "method": { - "short_name": "ExportAnalyticsMetrics", - "full_name": "google.cloud.retail.v2.AnalyticsService.ExportAnalyticsMetrics", - "service": { - "short_name": "AnalyticsService", - "full_name": "google.cloud.retail.v2.AnalyticsService" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 53, - "type": "FULL" - } - ] - }, - { - "region_tag": "retail_v2_generated_CatalogService_ListCatalogs_sync", - "title": "Snippet for the list_catalogs call in the CatalogService service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Retail::V2::CatalogService::Client#list_catalogs.", - "file": "catalog_service/list_catalogs.rb", - "language": "RUBY", - "client_method": { - "short_name": "list_catalogs", - "full_name": "::Google::Cloud::Retail::V2::CatalogService::Client#list_catalogs", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::Retail::V2::ListCatalogsRequest", - "name": "request" - } - ], - "result_type": "::Google::Cloud::Retail::V2::ListCatalogsResponse", - "client": { - "short_name": "CatalogService::Client", - "full_name": "::Google::Cloud::Retail::V2::CatalogService::Client" - }, - "method": { - "short_name": "ListCatalogs", - "full_name": "google.cloud.retail.v2.CatalogService.ListCatalogs", - "service": { - "short_name": "CatalogService", - "full_name": "google.cloud.retail.v2.CatalogService" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 50, - "type": "FULL" - } - ] - }, - { - "region_tag": "retail_v2_generated_CatalogService_UpdateCatalog_sync", - "title": "Snippet for the update_catalog call in the CatalogService service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Retail::V2::CatalogService::Client#update_catalog.", - "file": "catalog_service/update_catalog.rb", - "language": "RUBY", - "client_method": { - "short_name": "update_catalog", - "full_name": "::Google::Cloud::Retail::V2::CatalogService::Client#update_catalog", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::Retail::V2::UpdateCatalogRequest", - "name": "request" - } - ], - "result_type": "::Google::Cloud::Retail::V2::Catalog", - "client": { - "short_name": "CatalogService::Client", - "full_name": "::Google::Cloud::Retail::V2::CatalogService::Client" - }, - "method": { - "short_name": "UpdateCatalog", - "full_name": "google.cloud.retail.v2.CatalogService.UpdateCatalog", - "service": { - "short_name": "CatalogService", - "full_name": "google.cloud.retail.v2.CatalogService" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 46, - "type": "FULL" - } - ] - }, - { - "region_tag": "retail_v2_generated_CatalogService_SetDefaultBranch_sync", - "title": "Snippet for the set_default_branch call in the CatalogService service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Retail::V2::CatalogService::Client#set_default_branch.", - "file": "catalog_service/set_default_branch.rb", - "language": "RUBY", - "client_method": { - "short_name": "set_default_branch", - "full_name": "::Google::Cloud::Retail::V2::CatalogService::Client#set_default_branch", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::Retail::V2::SetDefaultBranchRequest", - "name": "request" - } - ], - "result_type": "::Google::Protobuf::Empty", - "client": { - "short_name": "CatalogService::Client", - "full_name": "::Google::Cloud::Retail::V2::CatalogService::Client" - }, - "method": { - "short_name": "SetDefaultBranch", - "full_name": "google.cloud.retail.v2.CatalogService.SetDefaultBranch", - "service": { - "short_name": "CatalogService", - "full_name": "google.cloud.retail.v2.CatalogService" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 46, - "type": "FULL" - } - ] - }, - { - "region_tag": "retail_v2_generated_CatalogService_GetDefaultBranch_sync", - "title": "Snippet for the get_default_branch call in the CatalogService service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Retail::V2::CatalogService::Client#get_default_branch.", - "file": "catalog_service/get_default_branch.rb", - "language": "RUBY", - "client_method": { - "short_name": "get_default_branch", - "full_name": "::Google::Cloud::Retail::V2::CatalogService::Client#get_default_branch", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::Retail::V2::GetDefaultBranchRequest", - "name": "request" - } - ], - "result_type": "::Google::Cloud::Retail::V2::GetDefaultBranchResponse", - "client": { - "short_name": "CatalogService::Client", - "full_name": "::Google::Cloud::Retail::V2::CatalogService::Client" - }, - "method": { - "short_name": "GetDefaultBranch", - "full_name": "google.cloud.retail.v2.CatalogService.GetDefaultBranch", - "service": { - "short_name": "CatalogService", - "full_name": "google.cloud.retail.v2.CatalogService" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 46, - "type": "FULL" - } - ] - }, - { - "region_tag": "retail_v2_generated_CatalogService_GetCompletionConfig_sync", - "title": "Snippet for the get_completion_config call in the CatalogService service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Retail::V2::CatalogService::Client#get_completion_config.", - "file": "catalog_service/get_completion_config.rb", - "language": "RUBY", - "client_method": { - "short_name": "get_completion_config", - "full_name": "::Google::Cloud::Retail::V2::CatalogService::Client#get_completion_config", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::Retail::V2::GetCompletionConfigRequest", - "name": "request" - } - ], - "result_type": "::Google::Cloud::Retail::V2::CompletionConfig", - "client": { - "short_name": "CatalogService::Client", - "full_name": "::Google::Cloud::Retail::V2::CatalogService::Client" - }, - "method": { - "short_name": "GetCompletionConfig", - "full_name": "google.cloud.retail.v2.CatalogService.GetCompletionConfig", - "service": { - "short_name": "CatalogService", - "full_name": "google.cloud.retail.v2.CatalogService" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 46, - "type": "FULL" - } - ] - }, - { - "region_tag": "retail_v2_generated_CatalogService_UpdateCompletionConfig_sync", - "title": "Snippet for the update_completion_config call in the CatalogService service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Retail::V2::CatalogService::Client#update_completion_config.", - "file": "catalog_service/update_completion_config.rb", - "language": "RUBY", - "client_method": { - "short_name": "update_completion_config", - "full_name": "::Google::Cloud::Retail::V2::CatalogService::Client#update_completion_config", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::Retail::V2::UpdateCompletionConfigRequest", - "name": "request" - } - ], - "result_type": "::Google::Cloud::Retail::V2::CompletionConfig", - "client": { - "short_name": "CatalogService::Client", - "full_name": "::Google::Cloud::Retail::V2::CatalogService::Client" - }, - "method": { - "short_name": "UpdateCompletionConfig", - "full_name": "google.cloud.retail.v2.CatalogService.UpdateCompletionConfig", - "service": { - "short_name": "CatalogService", - "full_name": "google.cloud.retail.v2.CatalogService" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 46, - "type": "FULL" - } - ] - }, - { - "region_tag": "retail_v2_generated_CatalogService_GetAttributesConfig_sync", - "title": "Snippet for the get_attributes_config call in the CatalogService service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Retail::V2::CatalogService::Client#get_attributes_config.", - "file": "catalog_service/get_attributes_config.rb", - "language": "RUBY", - "client_method": { - "short_name": "get_attributes_config", - "full_name": "::Google::Cloud::Retail::V2::CatalogService::Client#get_attributes_config", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::Retail::V2::GetAttributesConfigRequest", - "name": "request" - } - ], - "result_type": "::Google::Cloud::Retail::V2::AttributesConfig", - "client": { - "short_name": "CatalogService::Client", - "full_name": "::Google::Cloud::Retail::V2::CatalogService::Client" - }, - "method": { - "short_name": "GetAttributesConfig", - "full_name": "google.cloud.retail.v2.CatalogService.GetAttributesConfig", - "service": { - "short_name": "CatalogService", - "full_name": "google.cloud.retail.v2.CatalogService" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 46, - "type": "FULL" - } - ] - }, - { - "region_tag": "retail_v2_generated_CatalogService_UpdateAttributesConfig_sync", - "title": "Snippet for the update_attributes_config call in the CatalogService service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Retail::V2::CatalogService::Client#update_attributes_config.", - "file": "catalog_service/update_attributes_config.rb", - "language": "RUBY", - "client_method": { - "short_name": "update_attributes_config", - "full_name": "::Google::Cloud::Retail::V2::CatalogService::Client#update_attributes_config", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::Retail::V2::UpdateAttributesConfigRequest", - "name": "request" - } - ], - "result_type": "::Google::Cloud::Retail::V2::AttributesConfig", - "client": { - "short_name": "CatalogService::Client", - "full_name": "::Google::Cloud::Retail::V2::CatalogService::Client" - }, - "method": { - "short_name": "UpdateAttributesConfig", - "full_name": "google.cloud.retail.v2.CatalogService.UpdateAttributesConfig", - "service": { - "short_name": "CatalogService", - "full_name": "google.cloud.retail.v2.CatalogService" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 46, - "type": "FULL" - } - ] - }, - { - "region_tag": "retail_v2_generated_CatalogService_AddCatalogAttribute_sync", - "title": "Snippet for the add_catalog_attribute call in the CatalogService service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Retail::V2::CatalogService::Client#add_catalog_attribute.", - "file": "catalog_service/add_catalog_attribute.rb", - "language": "RUBY", - "client_method": { - "short_name": "add_catalog_attribute", - "full_name": "::Google::Cloud::Retail::V2::CatalogService::Client#add_catalog_attribute", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::Retail::V2::AddCatalogAttributeRequest", - "name": "request" - } - ], - "result_type": "::Google::Cloud::Retail::V2::AttributesConfig", - "client": { - "short_name": "CatalogService::Client", - "full_name": "::Google::Cloud::Retail::V2::CatalogService::Client" - }, - "method": { - "short_name": "AddCatalogAttribute", - "full_name": "google.cloud.retail.v2.CatalogService.AddCatalogAttribute", - "service": { - "short_name": "CatalogService", - "full_name": "google.cloud.retail.v2.CatalogService" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 46, - "type": "FULL" - } - ] - }, - { - "region_tag": "retail_v2_generated_CatalogService_RemoveCatalogAttribute_sync", - "title": "Snippet for the remove_catalog_attribute call in the CatalogService service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Retail::V2::CatalogService::Client#remove_catalog_attribute.", - "file": "catalog_service/remove_catalog_attribute.rb", - "language": "RUBY", - "client_method": { - "short_name": "remove_catalog_attribute", - "full_name": "::Google::Cloud::Retail::V2::CatalogService::Client#remove_catalog_attribute", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::Retail::V2::RemoveCatalogAttributeRequest", - "name": "request" - } - ], - "result_type": "::Google::Cloud::Retail::V2::AttributesConfig", - "client": { - "short_name": "CatalogService::Client", - "full_name": "::Google::Cloud::Retail::V2::CatalogService::Client" - }, - "method": { - "short_name": "RemoveCatalogAttribute", - "full_name": "google.cloud.retail.v2.CatalogService.RemoveCatalogAttribute", - "service": { - "short_name": "CatalogService", - "full_name": "google.cloud.retail.v2.CatalogService" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 46, - "type": "FULL" - } - ] - }, - { - "region_tag": "retail_v2_generated_CatalogService_ReplaceCatalogAttribute_sync", - "title": "Snippet for the replace_catalog_attribute call in the CatalogService service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Retail::V2::CatalogService::Client#replace_catalog_attribute.", - "file": "catalog_service/replace_catalog_attribute.rb", - "language": "RUBY", - "client_method": { - "short_name": "replace_catalog_attribute", - "full_name": "::Google::Cloud::Retail::V2::CatalogService::Client#replace_catalog_attribute", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::Retail::V2::ReplaceCatalogAttributeRequest", - "name": "request" - } - ], - "result_type": "::Google::Cloud::Retail::V2::AttributesConfig", - "client": { - "short_name": "CatalogService::Client", - "full_name": "::Google::Cloud::Retail::V2::CatalogService::Client" - }, - "method": { - "short_name": "ReplaceCatalogAttribute", - "full_name": "google.cloud.retail.v2.CatalogService.ReplaceCatalogAttribute", - "service": { - "short_name": "CatalogService", - "full_name": "google.cloud.retail.v2.CatalogService" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 46, - "type": "FULL" - } - ] - }, - { - "region_tag": "retail_v2_generated_CompletionService_CompleteQuery_sync", - "title": "Snippet for the complete_query call in the CompletionService service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Retail::V2::CompletionService::Client#complete_query.", - "file": "completion_service/complete_query.rb", - "language": "RUBY", - "client_method": { - "short_name": "complete_query", - "full_name": "::Google::Cloud::Retail::V2::CompletionService::Client#complete_query", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::Retail::V2::CompleteQueryRequest", - "name": "request" - } - ], - "result_type": "::Google::Cloud::Retail::V2::CompleteQueryResponse", - "client": { - "short_name": "CompletionService::Client", - "full_name": "::Google::Cloud::Retail::V2::CompletionService::Client" - }, - "method": { - "short_name": "CompleteQuery", - "full_name": "google.cloud.retail.v2.CompletionService.CompleteQuery", - "service": { - "short_name": "CompletionService", - "full_name": "google.cloud.retail.v2.CompletionService" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 46, - "type": "FULL" - } - ] - }, - { - "region_tag": "retail_v2_generated_CompletionService_ImportCompletionData_sync", - "title": "Snippet for the import_completion_data call in the CompletionService service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Retail::V2::CompletionService::Client#import_completion_data.", - "file": "completion_service/import_completion_data.rb", - "language": "RUBY", - "client_method": { - "short_name": "import_completion_data", - "full_name": "::Google::Cloud::Retail::V2::CompletionService::Client#import_completion_data", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::Retail::V2::ImportCompletionDataRequest", - "name": "request" - } - ], - "result_type": "::Google::Longrunning::Operation", - "client": { - "short_name": "CompletionService::Client", - "full_name": "::Google::Cloud::Retail::V2::CompletionService::Client" - }, - "method": { - "short_name": "ImportCompletionData", - "full_name": "google.cloud.retail.v2.CompletionService.ImportCompletionData", - "service": { - "short_name": "CompletionService", - "full_name": "google.cloud.retail.v2.CompletionService" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 53, - "type": "FULL" - } - ] - }, - { - "region_tag": "retail_v2_generated_ControlService_CreateControl_sync", - "title": "Snippet for the create_control call in the ControlService service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Retail::V2::ControlService::Client#create_control.", - "file": "control_service/create_control.rb", - "language": "RUBY", - "client_method": { - "short_name": "create_control", - "full_name": "::Google::Cloud::Retail::V2::ControlService::Client#create_control", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::Retail::V2::CreateControlRequest", - "name": "request" - } - ], - "result_type": "::Google::Cloud::Retail::V2::Control", - "client": { - "short_name": "ControlService::Client", - "full_name": "::Google::Cloud::Retail::V2::ControlService::Client" - }, - "method": { - "short_name": "CreateControl", - "full_name": "google.cloud.retail.v2.ControlService.CreateControl", - "service": { - "short_name": "ControlService", - "full_name": "google.cloud.retail.v2.ControlService" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 46, - "type": "FULL" - } - ] - }, - { - "region_tag": "retail_v2_generated_ControlService_DeleteControl_sync", - "title": "Snippet for the delete_control call in the ControlService service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Retail::V2::ControlService::Client#delete_control.", - "file": "control_service/delete_control.rb", - "language": "RUBY", - "client_method": { - "short_name": "delete_control", - "full_name": "::Google::Cloud::Retail::V2::ControlService::Client#delete_control", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::Retail::V2::DeleteControlRequest", - "name": "request" - } - ], - "result_type": "::Google::Protobuf::Empty", - "client": { - "short_name": "ControlService::Client", - "full_name": "::Google::Cloud::Retail::V2::ControlService::Client" - }, - "method": { - "short_name": "DeleteControl", - "full_name": "google.cloud.retail.v2.ControlService.DeleteControl", - "service": { - "short_name": "ControlService", - "full_name": "google.cloud.retail.v2.ControlService" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 46, - "type": "FULL" - } - ] - }, - { - "region_tag": "retail_v2_generated_ControlService_UpdateControl_sync", - "title": "Snippet for the update_control call in the ControlService service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Retail::V2::ControlService::Client#update_control.", - "file": "control_service/update_control.rb", - "language": "RUBY", - "client_method": { - "short_name": "update_control", - "full_name": "::Google::Cloud::Retail::V2::ControlService::Client#update_control", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::Retail::V2::UpdateControlRequest", - "name": "request" - } - ], - "result_type": "::Google::Cloud::Retail::V2::Control", - "client": { - "short_name": "ControlService::Client", - "full_name": "::Google::Cloud::Retail::V2::ControlService::Client" - }, - "method": { - "short_name": "UpdateControl", - "full_name": "google.cloud.retail.v2.ControlService.UpdateControl", - "service": { - "short_name": "ControlService", - "full_name": "google.cloud.retail.v2.ControlService" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 46, - "type": "FULL" - } - ] - }, - { - "region_tag": "retail_v2_generated_ControlService_GetControl_sync", - "title": "Snippet for the get_control call in the ControlService service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Retail::V2::ControlService::Client#get_control.", - "file": "control_service/get_control.rb", - "language": "RUBY", - "client_method": { - "short_name": "get_control", - "full_name": "::Google::Cloud::Retail::V2::ControlService::Client#get_control", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::Retail::V2::GetControlRequest", - "name": "request" - } - ], - "result_type": "::Google::Cloud::Retail::V2::Control", - "client": { - "short_name": "ControlService::Client", - "full_name": "::Google::Cloud::Retail::V2::ControlService::Client" - }, - "method": { - "short_name": "GetControl", - "full_name": "google.cloud.retail.v2.ControlService.GetControl", - "service": { - "short_name": "ControlService", - "full_name": "google.cloud.retail.v2.ControlService" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 46, - "type": "FULL" - } - ] - }, - { - "region_tag": "retail_v2_generated_ControlService_ListControls_sync", - "title": "Snippet for the list_controls call in the ControlService service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Retail::V2::ControlService::Client#list_controls.", - "file": "control_service/list_controls.rb", - "language": "RUBY", - "client_method": { - "short_name": "list_controls", - "full_name": "::Google::Cloud::Retail::V2::ControlService::Client#list_controls", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::Retail::V2::ListControlsRequest", - "name": "request" - } - ], - "result_type": "::Google::Cloud::Retail::V2::ListControlsResponse", - "client": { - "short_name": "ControlService::Client", - "full_name": "::Google::Cloud::Retail::V2::ControlService::Client" - }, - "method": { - "short_name": "ListControls", - "full_name": "google.cloud.retail.v2.ControlService.ListControls", - "service": { - "short_name": "ControlService", - "full_name": "google.cloud.retail.v2.ControlService" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 50, - "type": "FULL" - } - ] - }, - { - "region_tag": "retail_v2_generated_SearchService_Search_sync", - "title": "Snippet for the search call in the SearchService service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Retail::V2::SearchService::Client#search.", - "file": "search_service/search.rb", - "language": "RUBY", - "client_method": { - "short_name": "search", - "full_name": "::Google::Cloud::Retail::V2::SearchService::Client#search", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::Retail::V2::SearchRequest", - "name": "request" - } - ], - "result_type": "::Google::Cloud::Retail::V2::SearchResponse", - "client": { - "short_name": "SearchService::Client", - "full_name": "::Google::Cloud::Retail::V2::SearchService::Client" - }, - "method": { - "short_name": "Search", - "full_name": "google.cloud.retail.v2.SearchService.Search", - "service": { - "short_name": "SearchService", - "full_name": "google.cloud.retail.v2.SearchService" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 50, - "type": "FULL" - } - ] - }, - { - "region_tag": "retail_v2_generated_ConversationalSearchService_ConversationalSearch_sync", - "title": "Snippet for the conversational_search call in the ConversationalSearchService service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Retail::V2::ConversationalSearchService::Client#conversational_search.", - "file": "conversational_search_service/conversational_search.rb", - "language": "RUBY", - "client_method": { - "short_name": "conversational_search", - "full_name": "::Google::Cloud::Retail::V2::ConversationalSearchService::Client#conversational_search", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::Retail::V2::ConversationalSearchRequest", - "name": "request" - } - ], - "result_type": "::Google::Cloud::Retail::V2::ConversationalSearchResponse", - "client": { - "short_name": "ConversationalSearchService::Client", - "full_name": "::Google::Cloud::Retail::V2::ConversationalSearchService::Client" - }, - "method": { - "short_name": "ConversationalSearch", - "full_name": "google.cloud.retail.v2.ConversationalSearchService.ConversationalSearch", - "service": { - "short_name": "ConversationalSearchService", - "full_name": "google.cloud.retail.v2.ConversationalSearchService" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 49, - "type": "FULL" - } - ] - }, - { - "region_tag": "retail_v2_generated_GenerativeQuestionService_UpdateGenerativeQuestionsFeatureConfig_sync", - "title": "Snippet for the update_generative_questions_feature_config call in the GenerativeQuestionService service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Retail::V2::GenerativeQuestionService::Client#update_generative_questions_feature_config.", - "file": "generative_question_service/update_generative_questions_feature_config.rb", - "language": "RUBY", - "client_method": { - "short_name": "update_generative_questions_feature_config", - "full_name": "::Google::Cloud::Retail::V2::GenerativeQuestionService::Client#update_generative_questions_feature_config", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::Retail::V2::UpdateGenerativeQuestionsFeatureConfigRequest", - "name": "request" - } - ], - "result_type": "::Google::Cloud::Retail::V2::GenerativeQuestionsFeatureConfig", - "client": { - "short_name": "GenerativeQuestionService::Client", - "full_name": "::Google::Cloud::Retail::V2::GenerativeQuestionService::Client" - }, - "method": { - "short_name": "UpdateGenerativeQuestionsFeatureConfig", - "full_name": "google.cloud.retail.v2.GenerativeQuestionService.UpdateGenerativeQuestionsFeatureConfig", - "service": { - "short_name": "GenerativeQuestionService", - "full_name": "google.cloud.retail.v2.GenerativeQuestionService" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 46, - "type": "FULL" - } - ] - }, - { - "region_tag": "retail_v2_generated_GenerativeQuestionService_GetGenerativeQuestionsFeatureConfig_sync", - "title": "Snippet for the get_generative_questions_feature_config call in the GenerativeQuestionService service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Retail::V2::GenerativeQuestionService::Client#get_generative_questions_feature_config.", - "file": "generative_question_service/get_generative_questions_feature_config.rb", - "language": "RUBY", - "client_method": { - "short_name": "get_generative_questions_feature_config", - "full_name": "::Google::Cloud::Retail::V2::GenerativeQuestionService::Client#get_generative_questions_feature_config", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::Retail::V2::GetGenerativeQuestionsFeatureConfigRequest", - "name": "request" - } - ], - "result_type": "::Google::Cloud::Retail::V2::GenerativeQuestionsFeatureConfig", - "client": { - "short_name": "GenerativeQuestionService::Client", - "full_name": "::Google::Cloud::Retail::V2::GenerativeQuestionService::Client" - }, - "method": { - "short_name": "GetGenerativeQuestionsFeatureConfig", - "full_name": "google.cloud.retail.v2.GenerativeQuestionService.GetGenerativeQuestionsFeatureConfig", - "service": { - "short_name": "GenerativeQuestionService", - "full_name": "google.cloud.retail.v2.GenerativeQuestionService" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 46, - "type": "FULL" - } - ] - }, - { - "region_tag": "retail_v2_generated_GenerativeQuestionService_ListGenerativeQuestionConfigs_sync", - "title": "Snippet for the list_generative_question_configs call in the GenerativeQuestionService service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Retail::V2::GenerativeQuestionService::Client#list_generative_question_configs.", - "file": "generative_question_service/list_generative_question_configs.rb", - "language": "RUBY", - "client_method": { - "short_name": "list_generative_question_configs", - "full_name": "::Google::Cloud::Retail::V2::GenerativeQuestionService::Client#list_generative_question_configs", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::Retail::V2::ListGenerativeQuestionConfigsRequest", - "name": "request" - } - ], - "result_type": "::Google::Cloud::Retail::V2::ListGenerativeQuestionConfigsResponse", - "client": { - "short_name": "GenerativeQuestionService::Client", - "full_name": "::Google::Cloud::Retail::V2::GenerativeQuestionService::Client" - }, - "method": { - "short_name": "ListGenerativeQuestionConfigs", - "full_name": "google.cloud.retail.v2.GenerativeQuestionService.ListGenerativeQuestionConfigs", - "service": { - "short_name": "GenerativeQuestionService", - "full_name": "google.cloud.retail.v2.GenerativeQuestionService" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 46, - "type": "FULL" - } - ] - }, - { - "region_tag": "retail_v2_generated_GenerativeQuestionService_UpdateGenerativeQuestionConfig_sync", - "title": "Snippet for the update_generative_question_config call in the GenerativeQuestionService service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Retail::V2::GenerativeQuestionService::Client#update_generative_question_config.", - "file": "generative_question_service/update_generative_question_config.rb", - "language": "RUBY", - "client_method": { - "short_name": "update_generative_question_config", - "full_name": "::Google::Cloud::Retail::V2::GenerativeQuestionService::Client#update_generative_question_config", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::Retail::V2::UpdateGenerativeQuestionConfigRequest", - "name": "request" - } - ], - "result_type": "::Google::Cloud::Retail::V2::GenerativeQuestionConfig", - "client": { - "short_name": "GenerativeQuestionService::Client", - "full_name": "::Google::Cloud::Retail::V2::GenerativeQuestionService::Client" - }, - "method": { - "short_name": "UpdateGenerativeQuestionConfig", - "full_name": "google.cloud.retail.v2.GenerativeQuestionService.UpdateGenerativeQuestionConfig", - "service": { - "short_name": "GenerativeQuestionService", - "full_name": "google.cloud.retail.v2.GenerativeQuestionService" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 46, - "type": "FULL" - } - ] - }, - { - "region_tag": "retail_v2_generated_GenerativeQuestionService_BatchUpdateGenerativeQuestionConfigs_sync", - "title": "Snippet for the batch_update_generative_question_configs call in the GenerativeQuestionService service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Retail::V2::GenerativeQuestionService::Client#batch_update_generative_question_configs.", - "file": "generative_question_service/batch_update_generative_question_configs.rb", - "language": "RUBY", - "client_method": { - "short_name": "batch_update_generative_question_configs", - "full_name": "::Google::Cloud::Retail::V2::GenerativeQuestionService::Client#batch_update_generative_question_configs", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::Retail::V2::BatchUpdateGenerativeQuestionConfigsRequest", - "name": "request" - } - ], - "result_type": "::Google::Cloud::Retail::V2::BatchUpdateGenerativeQuestionConfigsResponse", - "client": { - "short_name": "GenerativeQuestionService::Client", - "full_name": "::Google::Cloud::Retail::V2::GenerativeQuestionService::Client" - }, - "method": { - "short_name": "BatchUpdateGenerativeQuestionConfigs", - "full_name": "google.cloud.retail.v2.GenerativeQuestionService.BatchUpdateGenerativeQuestionConfigs", - "service": { - "short_name": "GenerativeQuestionService", - "full_name": "google.cloud.retail.v2.GenerativeQuestionService" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 46, - "type": "FULL" - } - ] - }, - { - "region_tag": "retail_v2_generated_ModelService_CreateModel_sync", - "title": "Snippet for the create_model call in the ModelService service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Retail::V2::ModelService::Client#create_model.", - "file": "model_service/create_model.rb", - "language": "RUBY", - "client_method": { - "short_name": "create_model", - "full_name": "::Google::Cloud::Retail::V2::ModelService::Client#create_model", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::Retail::V2::CreateModelRequest", - "name": "request" - } - ], - "result_type": "::Google::Longrunning::Operation", - "client": { - "short_name": "ModelService::Client", - "full_name": "::Google::Cloud::Retail::V2::ModelService::Client" - }, - "method": { - "short_name": "CreateModel", - "full_name": "google.cloud.retail.v2.ModelService.CreateModel", - "service": { - "short_name": "ModelService", - "full_name": "google.cloud.retail.v2.ModelService" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 53, - "type": "FULL" - } - ] - }, - { - "region_tag": "retail_v2_generated_ModelService_GetModel_sync", - "title": "Snippet for the get_model call in the ModelService service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Retail::V2::ModelService::Client#get_model.", - "file": "model_service/get_model.rb", - "language": "RUBY", - "client_method": { - "short_name": "get_model", - "full_name": "::Google::Cloud::Retail::V2::ModelService::Client#get_model", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::Retail::V2::GetModelRequest", - "name": "request" - } - ], - "result_type": "::Google::Cloud::Retail::V2::Model", - "client": { - "short_name": "ModelService::Client", - "full_name": "::Google::Cloud::Retail::V2::ModelService::Client" - }, - "method": { - "short_name": "GetModel", - "full_name": "google.cloud.retail.v2.ModelService.GetModel", - "service": { - "short_name": "ModelService", - "full_name": "google.cloud.retail.v2.ModelService" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 46, - "type": "FULL" - } - ] - }, - { - "region_tag": "retail_v2_generated_ModelService_PauseModel_sync", - "title": "Snippet for the pause_model call in the ModelService service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Retail::V2::ModelService::Client#pause_model.", - "file": "model_service/pause_model.rb", - "language": "RUBY", - "client_method": { - "short_name": "pause_model", - "full_name": "::Google::Cloud::Retail::V2::ModelService::Client#pause_model", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::Retail::V2::PauseModelRequest", - "name": "request" - } - ], - "result_type": "::Google::Cloud::Retail::V2::Model", - "client": { - "short_name": "ModelService::Client", - "full_name": "::Google::Cloud::Retail::V2::ModelService::Client" - }, - "method": { - "short_name": "PauseModel", - "full_name": "google.cloud.retail.v2.ModelService.PauseModel", - "service": { - "short_name": "ModelService", - "full_name": "google.cloud.retail.v2.ModelService" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 46, - "type": "FULL" - } - ] - }, - { - "region_tag": "retail_v2_generated_ModelService_ResumeModel_sync", - "title": "Snippet for the resume_model call in the ModelService service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Retail::V2::ModelService::Client#resume_model.", - "file": "model_service/resume_model.rb", - "language": "RUBY", - "client_method": { - "short_name": "resume_model", - "full_name": "::Google::Cloud::Retail::V2::ModelService::Client#resume_model", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::Retail::V2::ResumeModelRequest", - "name": "request" - } - ], - "result_type": "::Google::Cloud::Retail::V2::Model", - "client": { - "short_name": "ModelService::Client", - "full_name": "::Google::Cloud::Retail::V2::ModelService::Client" - }, - "method": { - "short_name": "ResumeModel", - "full_name": "google.cloud.retail.v2.ModelService.ResumeModel", - "service": { - "short_name": "ModelService", - "full_name": "google.cloud.retail.v2.ModelService" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 46, - "type": "FULL" - } - ] - }, - { - "region_tag": "retail_v2_generated_ModelService_DeleteModel_sync", - "title": "Snippet for the delete_model call in the ModelService service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Retail::V2::ModelService::Client#delete_model.", - "file": "model_service/delete_model.rb", - "language": "RUBY", - "client_method": { - "short_name": "delete_model", - "full_name": "::Google::Cloud::Retail::V2::ModelService::Client#delete_model", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::Retail::V2::DeleteModelRequest", - "name": "request" - } - ], - "result_type": "::Google::Protobuf::Empty", - "client": { - "short_name": "ModelService::Client", - "full_name": "::Google::Cloud::Retail::V2::ModelService::Client" - }, - "method": { - "short_name": "DeleteModel", - "full_name": "google.cloud.retail.v2.ModelService.DeleteModel", - "service": { - "short_name": "ModelService", - "full_name": "google.cloud.retail.v2.ModelService" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 46, - "type": "FULL" - } - ] - }, - { - "region_tag": "retail_v2_generated_ModelService_ListModels_sync", - "title": "Snippet for the list_models call in the ModelService service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Retail::V2::ModelService::Client#list_models.", - "file": "model_service/list_models.rb", - "language": "RUBY", - "client_method": { - "short_name": "list_models", - "full_name": "::Google::Cloud::Retail::V2::ModelService::Client#list_models", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::Retail::V2::ListModelsRequest", - "name": "request" - } - ], - "result_type": "::Google::Cloud::Retail::V2::ListModelsResponse", - "client": { - "short_name": "ModelService::Client", - "full_name": "::Google::Cloud::Retail::V2::ModelService::Client" - }, - "method": { - "short_name": "ListModels", - "full_name": "google.cloud.retail.v2.ModelService.ListModels", - "service": { - "short_name": "ModelService", - "full_name": "google.cloud.retail.v2.ModelService" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 50, - "type": "FULL" - } - ] - }, - { - "region_tag": "retail_v2_generated_ModelService_UpdateModel_sync", - "title": "Snippet for the update_model call in the ModelService service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Retail::V2::ModelService::Client#update_model.", - "file": "model_service/update_model.rb", - "language": "RUBY", - "client_method": { - "short_name": "update_model", - "full_name": "::Google::Cloud::Retail::V2::ModelService::Client#update_model", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::Retail::V2::UpdateModelRequest", - "name": "request" - } - ], - "result_type": "::Google::Cloud::Retail::V2::Model", - "client": { - "short_name": "ModelService::Client", - "full_name": "::Google::Cloud::Retail::V2::ModelService::Client" - }, - "method": { - "short_name": "UpdateModel", - "full_name": "google.cloud.retail.v2.ModelService.UpdateModel", - "service": { - "short_name": "ModelService", - "full_name": "google.cloud.retail.v2.ModelService" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 46, - "type": "FULL" - } - ] - }, - { - "region_tag": "retail_v2_generated_ModelService_TuneModel_sync", - "title": "Snippet for the tune_model call in the ModelService service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Retail::V2::ModelService::Client#tune_model.", - "file": "model_service/tune_model.rb", - "language": "RUBY", - "client_method": { - "short_name": "tune_model", - "full_name": "::Google::Cloud::Retail::V2::ModelService::Client#tune_model", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::Retail::V2::TuneModelRequest", - "name": "request" - } - ], - "result_type": "::Google::Longrunning::Operation", - "client": { - "short_name": "ModelService::Client", - "full_name": "::Google::Cloud::Retail::V2::ModelService::Client" - }, - "method": { - "short_name": "TuneModel", - "full_name": "google.cloud.retail.v2.ModelService.TuneModel", - "service": { - "short_name": "ModelService", - "full_name": "google.cloud.retail.v2.ModelService" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 53, - "type": "FULL" - } - ] - }, - { - "region_tag": "retail_v2_generated_PredictionService_Predict_sync", - "title": "Snippet for the predict call in the PredictionService service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Retail::V2::PredictionService::Client#predict.", - "file": "prediction_service/predict.rb", - "language": "RUBY", - "client_method": { - "short_name": "predict", - "full_name": "::Google::Cloud::Retail::V2::PredictionService::Client#predict", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::Retail::V2::PredictRequest", - "name": "request" - } - ], - "result_type": "::Google::Cloud::Retail::V2::PredictResponse", - "client": { - "short_name": "PredictionService::Client", - "full_name": "::Google::Cloud::Retail::V2::PredictionService::Client" - }, - "method": { - "short_name": "Predict", - "full_name": "google.cloud.retail.v2.PredictionService.Predict", - "service": { - "short_name": "PredictionService", - "full_name": "google.cloud.retail.v2.PredictionService" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 46, - "type": "FULL" - } - ] - }, - { - "region_tag": "retail_v2_generated_ProductService_CreateProduct_sync", - "title": "Snippet for the create_product call in the ProductService service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Retail::V2::ProductService::Client#create_product.", - "file": "product_service/create_product.rb", - "language": "RUBY", - "client_method": { - "short_name": "create_product", - "full_name": "::Google::Cloud::Retail::V2::ProductService::Client#create_product", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::Retail::V2::CreateProductRequest", - "name": "request" - } - ], - "result_type": "::Google::Cloud::Retail::V2::Product", - "client": { - "short_name": "ProductService::Client", - "full_name": "::Google::Cloud::Retail::V2::ProductService::Client" - }, - "method": { - "short_name": "CreateProduct", - "full_name": "google.cloud.retail.v2.ProductService.CreateProduct", - "service": { - "short_name": "ProductService", - "full_name": "google.cloud.retail.v2.ProductService" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 46, - "type": "FULL" - } - ] - }, - { - "region_tag": "retail_v2_generated_ProductService_GetProduct_sync", - "title": "Snippet for the get_product call in the ProductService service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Retail::V2::ProductService::Client#get_product.", - "file": "product_service/get_product.rb", - "language": "RUBY", - "client_method": { - "short_name": "get_product", - "full_name": "::Google::Cloud::Retail::V2::ProductService::Client#get_product", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::Retail::V2::GetProductRequest", - "name": "request" - } - ], - "result_type": "::Google::Cloud::Retail::V2::Product", - "client": { - "short_name": "ProductService::Client", - "full_name": "::Google::Cloud::Retail::V2::ProductService::Client" - }, - "method": { - "short_name": "GetProduct", - "full_name": "google.cloud.retail.v2.ProductService.GetProduct", - "service": { - "short_name": "ProductService", - "full_name": "google.cloud.retail.v2.ProductService" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 46, - "type": "FULL" - } - ] - }, - { - "region_tag": "retail_v2_generated_ProductService_ListProducts_sync", - "title": "Snippet for the list_products call in the ProductService service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Retail::V2::ProductService::Client#list_products.", - "file": "product_service/list_products.rb", - "language": "RUBY", - "client_method": { - "short_name": "list_products", - "full_name": "::Google::Cloud::Retail::V2::ProductService::Client#list_products", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::Retail::V2::ListProductsRequest", - "name": "request" - } - ], - "result_type": "::Google::Cloud::Retail::V2::ListProductsResponse", - "client": { - "short_name": "ProductService::Client", - "full_name": "::Google::Cloud::Retail::V2::ProductService::Client" - }, - "method": { - "short_name": "ListProducts", - "full_name": "google.cloud.retail.v2.ProductService.ListProducts", - "service": { - "short_name": "ProductService", - "full_name": "google.cloud.retail.v2.ProductService" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 50, - "type": "FULL" - } - ] - }, - { - "region_tag": "retail_v2_generated_ProductService_UpdateProduct_sync", - "title": "Snippet for the update_product call in the ProductService service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Retail::V2::ProductService::Client#update_product.", - "file": "product_service/update_product.rb", - "language": "RUBY", - "client_method": { - "short_name": "update_product", - "full_name": "::Google::Cloud::Retail::V2::ProductService::Client#update_product", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::Retail::V2::UpdateProductRequest", - "name": "request" - } - ], - "result_type": "::Google::Cloud::Retail::V2::Product", - "client": { - "short_name": "ProductService::Client", - "full_name": "::Google::Cloud::Retail::V2::ProductService::Client" - }, - "method": { - "short_name": "UpdateProduct", - "full_name": "google.cloud.retail.v2.ProductService.UpdateProduct", - "service": { - "short_name": "ProductService", - "full_name": "google.cloud.retail.v2.ProductService" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 46, - "type": "FULL" - } - ] - }, - { - "region_tag": "retail_v2_generated_ProductService_DeleteProduct_sync", - "title": "Snippet for the delete_product call in the ProductService service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Retail::V2::ProductService::Client#delete_product.", - "file": "product_service/delete_product.rb", - "language": "RUBY", - "client_method": { - "short_name": "delete_product", - "full_name": "::Google::Cloud::Retail::V2::ProductService::Client#delete_product", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::Retail::V2::DeleteProductRequest", - "name": "request" - } - ], - "result_type": "::Google::Protobuf::Empty", - "client": { - "short_name": "ProductService::Client", - "full_name": "::Google::Cloud::Retail::V2::ProductService::Client" - }, - "method": { - "short_name": "DeleteProduct", - "full_name": "google.cloud.retail.v2.ProductService.DeleteProduct", - "service": { - "short_name": "ProductService", - "full_name": "google.cloud.retail.v2.ProductService" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 46, - "type": "FULL" - } - ] - }, - { - "region_tag": "retail_v2_generated_ProductService_PurgeProducts_sync", - "title": "Snippet for the purge_products call in the ProductService service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Retail::V2::ProductService::Client#purge_products.", - "file": "product_service/purge_products.rb", - "language": "RUBY", - "client_method": { - "short_name": "purge_products", - "full_name": "::Google::Cloud::Retail::V2::ProductService::Client#purge_products", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::Retail::V2::PurgeProductsRequest", - "name": "request" - } - ], - "result_type": "::Google::Longrunning::Operation", - "client": { - "short_name": "ProductService::Client", - "full_name": "::Google::Cloud::Retail::V2::ProductService::Client" - }, - "method": { - "short_name": "PurgeProducts", - "full_name": "google.cloud.retail.v2.ProductService.PurgeProducts", - "service": { - "short_name": "ProductService", - "full_name": "google.cloud.retail.v2.ProductService" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 53, - "type": "FULL" - } - ] - }, - { - "region_tag": "retail_v2_generated_ProductService_ImportProducts_sync", - "title": "Snippet for the import_products call in the ProductService service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Retail::V2::ProductService::Client#import_products.", - "file": "product_service/import_products.rb", - "language": "RUBY", - "client_method": { - "short_name": "import_products", - "full_name": "::Google::Cloud::Retail::V2::ProductService::Client#import_products", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::Retail::V2::ImportProductsRequest", - "name": "request" - } - ], - "result_type": "::Google::Longrunning::Operation", - "client": { - "short_name": "ProductService::Client", - "full_name": "::Google::Cloud::Retail::V2::ProductService::Client" - }, - "method": { - "short_name": "ImportProducts", - "full_name": "google.cloud.retail.v2.ProductService.ImportProducts", - "service": { - "short_name": "ProductService", - "full_name": "google.cloud.retail.v2.ProductService" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 53, - "type": "FULL" - } - ] - }, - { - "region_tag": "retail_v2_generated_ProductService_SetInventory_sync", - "title": "Snippet for the set_inventory call in the ProductService service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Retail::V2::ProductService::Client#set_inventory.", - "file": "product_service/set_inventory.rb", - "language": "RUBY", - "client_method": { - "short_name": "set_inventory", - "full_name": "::Google::Cloud::Retail::V2::ProductService::Client#set_inventory", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::Retail::V2::SetInventoryRequest", - "name": "request" - } - ], - "result_type": "::Google::Longrunning::Operation", - "client": { - "short_name": "ProductService::Client", - "full_name": "::Google::Cloud::Retail::V2::ProductService::Client" - }, - "method": { - "short_name": "SetInventory", - "full_name": "google.cloud.retail.v2.ProductService.SetInventory", - "service": { - "short_name": "ProductService", - "full_name": "google.cloud.retail.v2.ProductService" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 53, - "type": "FULL" - } - ] - }, - { - "region_tag": "retail_v2_generated_ProductService_AddFulfillmentPlaces_sync", - "title": "Snippet for the add_fulfillment_places call in the ProductService service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Retail::V2::ProductService::Client#add_fulfillment_places.", - "file": "product_service/add_fulfillment_places.rb", - "language": "RUBY", - "client_method": { - "short_name": "add_fulfillment_places", - "full_name": "::Google::Cloud::Retail::V2::ProductService::Client#add_fulfillment_places", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::Retail::V2::AddFulfillmentPlacesRequest", - "name": "request" - } - ], - "result_type": "::Google::Longrunning::Operation", - "client": { - "short_name": "ProductService::Client", - "full_name": "::Google::Cloud::Retail::V2::ProductService::Client" - }, - "method": { - "short_name": "AddFulfillmentPlaces", - "full_name": "google.cloud.retail.v2.ProductService.AddFulfillmentPlaces", - "service": { - "short_name": "ProductService", - "full_name": "google.cloud.retail.v2.ProductService" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 53, - "type": "FULL" - } - ] - }, - { - "region_tag": "retail_v2_generated_ProductService_RemoveFulfillmentPlaces_sync", - "title": "Snippet for the remove_fulfillment_places call in the ProductService service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Retail::V2::ProductService::Client#remove_fulfillment_places.", - "file": "product_service/remove_fulfillment_places.rb", - "language": "RUBY", - "client_method": { - "short_name": "remove_fulfillment_places", - "full_name": "::Google::Cloud::Retail::V2::ProductService::Client#remove_fulfillment_places", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::Retail::V2::RemoveFulfillmentPlacesRequest", - "name": "request" - } - ], - "result_type": "::Google::Longrunning::Operation", - "client": { - "short_name": "ProductService::Client", - "full_name": "::Google::Cloud::Retail::V2::ProductService::Client" - }, - "method": { - "short_name": "RemoveFulfillmentPlaces", - "full_name": "google.cloud.retail.v2.ProductService.RemoveFulfillmentPlaces", - "service": { - "short_name": "ProductService", - "full_name": "google.cloud.retail.v2.ProductService" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 53, - "type": "FULL" - } - ] - }, - { - "region_tag": "retail_v2_generated_ProductService_AddLocalInventories_sync", - "title": "Snippet for the add_local_inventories call in the ProductService service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Retail::V2::ProductService::Client#add_local_inventories.", - "file": "product_service/add_local_inventories.rb", - "language": "RUBY", - "client_method": { - "short_name": "add_local_inventories", - "full_name": "::Google::Cloud::Retail::V2::ProductService::Client#add_local_inventories", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::Retail::V2::AddLocalInventoriesRequest", - "name": "request" - } - ], - "result_type": "::Google::Longrunning::Operation", - "client": { - "short_name": "ProductService::Client", - "full_name": "::Google::Cloud::Retail::V2::ProductService::Client" - }, - "method": { - "short_name": "AddLocalInventories", - "full_name": "google.cloud.retail.v2.ProductService.AddLocalInventories", - "service": { - "short_name": "ProductService", - "full_name": "google.cloud.retail.v2.ProductService" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 53, - "type": "FULL" - } - ] - }, - { - "region_tag": "retail_v2_generated_ProductService_RemoveLocalInventories_sync", - "title": "Snippet for the remove_local_inventories call in the ProductService service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Retail::V2::ProductService::Client#remove_local_inventories.", - "file": "product_service/remove_local_inventories.rb", - "language": "RUBY", - "client_method": { - "short_name": "remove_local_inventories", - "full_name": "::Google::Cloud::Retail::V2::ProductService::Client#remove_local_inventories", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::Retail::V2::RemoveLocalInventoriesRequest", - "name": "request" - } - ], - "result_type": "::Google::Longrunning::Operation", - "client": { - "short_name": "ProductService::Client", - "full_name": "::Google::Cloud::Retail::V2::ProductService::Client" - }, - "method": { - "short_name": "RemoveLocalInventories", - "full_name": "google.cloud.retail.v2.ProductService.RemoveLocalInventories", - "service": { - "short_name": "ProductService", - "full_name": "google.cloud.retail.v2.ProductService" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 53, - "type": "FULL" - } - ] - }, - { - "region_tag": "retail_v2_generated_ServingConfigService_CreateServingConfig_sync", - "title": "Snippet for the create_serving_config call in the ServingConfigService service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Retail::V2::ServingConfigService::Client#create_serving_config.", - "file": "serving_config_service/create_serving_config.rb", - "language": "RUBY", - "client_method": { - "short_name": "create_serving_config", - "full_name": "::Google::Cloud::Retail::V2::ServingConfigService::Client#create_serving_config", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::Retail::V2::CreateServingConfigRequest", - "name": "request" - } - ], - "result_type": "::Google::Cloud::Retail::V2::ServingConfig", - "client": { - "short_name": "ServingConfigService::Client", - "full_name": "::Google::Cloud::Retail::V2::ServingConfigService::Client" - }, - "method": { - "short_name": "CreateServingConfig", - "full_name": "google.cloud.retail.v2.ServingConfigService.CreateServingConfig", - "service": { - "short_name": "ServingConfigService", - "full_name": "google.cloud.retail.v2.ServingConfigService" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 46, - "type": "FULL" - } - ] - }, - { - "region_tag": "retail_v2_generated_ServingConfigService_DeleteServingConfig_sync", - "title": "Snippet for the delete_serving_config call in the ServingConfigService service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Retail::V2::ServingConfigService::Client#delete_serving_config.", - "file": "serving_config_service/delete_serving_config.rb", - "language": "RUBY", - "client_method": { - "short_name": "delete_serving_config", - "full_name": "::Google::Cloud::Retail::V2::ServingConfigService::Client#delete_serving_config", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::Retail::V2::DeleteServingConfigRequest", - "name": "request" - } - ], - "result_type": "::Google::Protobuf::Empty", - "client": { - "short_name": "ServingConfigService::Client", - "full_name": "::Google::Cloud::Retail::V2::ServingConfigService::Client" - }, - "method": { - "short_name": "DeleteServingConfig", - "full_name": "google.cloud.retail.v2.ServingConfigService.DeleteServingConfig", - "service": { - "short_name": "ServingConfigService", - "full_name": "google.cloud.retail.v2.ServingConfigService" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 46, - "type": "FULL" - } - ] - }, - { - "region_tag": "retail_v2_generated_ServingConfigService_UpdateServingConfig_sync", - "title": "Snippet for the update_serving_config call in the ServingConfigService service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Retail::V2::ServingConfigService::Client#update_serving_config.", - "file": "serving_config_service/update_serving_config.rb", - "language": "RUBY", - "client_method": { - "short_name": "update_serving_config", - "full_name": "::Google::Cloud::Retail::V2::ServingConfigService::Client#update_serving_config", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::Retail::V2::UpdateServingConfigRequest", - "name": "request" - } - ], - "result_type": "::Google::Cloud::Retail::V2::ServingConfig", - "client": { - "short_name": "ServingConfigService::Client", - "full_name": "::Google::Cloud::Retail::V2::ServingConfigService::Client" - }, - "method": { - "short_name": "UpdateServingConfig", - "full_name": "google.cloud.retail.v2.ServingConfigService.UpdateServingConfig", - "service": { - "short_name": "ServingConfigService", - "full_name": "google.cloud.retail.v2.ServingConfigService" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 46, - "type": "FULL" - } - ] - }, - { - "region_tag": "retail_v2_generated_ServingConfigService_GetServingConfig_sync", - "title": "Snippet for the get_serving_config call in the ServingConfigService service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Retail::V2::ServingConfigService::Client#get_serving_config.", - "file": "serving_config_service/get_serving_config.rb", - "language": "RUBY", - "client_method": { - "short_name": "get_serving_config", - "full_name": "::Google::Cloud::Retail::V2::ServingConfigService::Client#get_serving_config", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::Retail::V2::GetServingConfigRequest", - "name": "request" - } - ], - "result_type": "::Google::Cloud::Retail::V2::ServingConfig", - "client": { - "short_name": "ServingConfigService::Client", - "full_name": "::Google::Cloud::Retail::V2::ServingConfigService::Client" - }, - "method": { - "short_name": "GetServingConfig", - "full_name": "google.cloud.retail.v2.ServingConfigService.GetServingConfig", - "service": { - "short_name": "ServingConfigService", - "full_name": "google.cloud.retail.v2.ServingConfigService" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 46, - "type": "FULL" - } - ] - }, - { - "region_tag": "retail_v2_generated_ServingConfigService_ListServingConfigs_sync", - "title": "Snippet for the list_serving_configs call in the ServingConfigService service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Retail::V2::ServingConfigService::Client#list_serving_configs.", - "file": "serving_config_service/list_serving_configs.rb", - "language": "RUBY", - "client_method": { - "short_name": "list_serving_configs", - "full_name": "::Google::Cloud::Retail::V2::ServingConfigService::Client#list_serving_configs", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::Retail::V2::ListServingConfigsRequest", - "name": "request" - } - ], - "result_type": "::Google::Cloud::Retail::V2::ListServingConfigsResponse", - "client": { - "short_name": "ServingConfigService::Client", - "full_name": "::Google::Cloud::Retail::V2::ServingConfigService::Client" - }, - "method": { - "short_name": "ListServingConfigs", - "full_name": "google.cloud.retail.v2.ServingConfigService.ListServingConfigs", - "service": { - "short_name": "ServingConfigService", - "full_name": "google.cloud.retail.v2.ServingConfigService" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 50, - "type": "FULL" - } - ] - }, - { - "region_tag": "retail_v2_generated_ServingConfigService_AddControl_sync", - "title": "Snippet for the add_control call in the ServingConfigService service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Retail::V2::ServingConfigService::Client#add_control.", - "file": "serving_config_service/add_control.rb", - "language": "RUBY", - "client_method": { - "short_name": "add_control", - "full_name": "::Google::Cloud::Retail::V2::ServingConfigService::Client#add_control", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::Retail::V2::AddControlRequest", - "name": "request" - } - ], - "result_type": "::Google::Cloud::Retail::V2::ServingConfig", - "client": { - "short_name": "ServingConfigService::Client", - "full_name": "::Google::Cloud::Retail::V2::ServingConfigService::Client" - }, - "method": { - "short_name": "AddControl", - "full_name": "google.cloud.retail.v2.ServingConfigService.AddControl", - "service": { - "short_name": "ServingConfigService", - "full_name": "google.cloud.retail.v2.ServingConfigService" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 46, - "type": "FULL" - } - ] - }, - { - "region_tag": "retail_v2_generated_ServingConfigService_RemoveControl_sync", - "title": "Snippet for the remove_control call in the ServingConfigService service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Retail::V2::ServingConfigService::Client#remove_control.", - "file": "serving_config_service/remove_control.rb", - "language": "RUBY", - "client_method": { - "short_name": "remove_control", - "full_name": "::Google::Cloud::Retail::V2::ServingConfigService::Client#remove_control", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::Retail::V2::RemoveControlRequest", - "name": "request" - } - ], - "result_type": "::Google::Cloud::Retail::V2::ServingConfig", - "client": { - "short_name": "ServingConfigService::Client", - "full_name": "::Google::Cloud::Retail::V2::ServingConfigService::Client" - }, - "method": { - "short_name": "RemoveControl", - "full_name": "google.cloud.retail.v2.ServingConfigService.RemoveControl", - "service": { - "short_name": "ServingConfigService", - "full_name": "google.cloud.retail.v2.ServingConfigService" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 46, - "type": "FULL" - } - ] - }, - { - "region_tag": "retail_v2_generated_UserEventService_WriteUserEvent_sync", - "title": "Snippet for the write_user_event call in the UserEventService service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Retail::V2::UserEventService::Client#write_user_event.", - "file": "user_event_service/write_user_event.rb", - "language": "RUBY", - "client_method": { - "short_name": "write_user_event", - "full_name": "::Google::Cloud::Retail::V2::UserEventService::Client#write_user_event", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::Retail::V2::WriteUserEventRequest", - "name": "request" - } - ], - "result_type": "::Google::Cloud::Retail::V2::UserEvent", - "client": { - "short_name": "UserEventService::Client", - "full_name": "::Google::Cloud::Retail::V2::UserEventService::Client" - }, - "method": { - "short_name": "WriteUserEvent", - "full_name": "google.cloud.retail.v2.UserEventService.WriteUserEvent", - "service": { - "short_name": "UserEventService", - "full_name": "google.cloud.retail.v2.UserEventService" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 46, - "type": "FULL" - } - ] - }, - { - "region_tag": "retail_v2_generated_UserEventService_CollectUserEvent_sync", - "title": "Snippet for the collect_user_event call in the UserEventService service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Retail::V2::UserEventService::Client#collect_user_event.", - "file": "user_event_service/collect_user_event.rb", - "language": "RUBY", - "client_method": { - "short_name": "collect_user_event", - "full_name": "::Google::Cloud::Retail::V2::UserEventService::Client#collect_user_event", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::Retail::V2::CollectUserEventRequest", - "name": "request" - } - ], - "result_type": "::Google::Api::HttpBody", - "client": { - "short_name": "UserEventService::Client", - "full_name": "::Google::Cloud::Retail::V2::UserEventService::Client" - }, - "method": { - "short_name": "CollectUserEvent", - "full_name": "google.cloud.retail.v2.UserEventService.CollectUserEvent", - "service": { - "short_name": "UserEventService", - "full_name": "google.cloud.retail.v2.UserEventService" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 46, - "type": "FULL" - } - ] - }, - { - "region_tag": "retail_v2_generated_UserEventService_PurgeUserEvents_sync", - "title": "Snippet for the purge_user_events call in the UserEventService service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Retail::V2::UserEventService::Client#purge_user_events.", - "file": "user_event_service/purge_user_events.rb", - "language": "RUBY", - "client_method": { - "short_name": "purge_user_events", - "full_name": "::Google::Cloud::Retail::V2::UserEventService::Client#purge_user_events", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::Retail::V2::PurgeUserEventsRequest", - "name": "request" - } - ], - "result_type": "::Google::Longrunning::Operation", - "client": { - "short_name": "UserEventService::Client", - "full_name": "::Google::Cloud::Retail::V2::UserEventService::Client" - }, - "method": { - "short_name": "PurgeUserEvents", - "full_name": "google.cloud.retail.v2.UserEventService.PurgeUserEvents", - "service": { - "short_name": "UserEventService", - "full_name": "google.cloud.retail.v2.UserEventService" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 53, - "type": "FULL" - } - ] - }, - { - "region_tag": "retail_v2_generated_UserEventService_ImportUserEvents_sync", - "title": "Snippet for the import_user_events call in the UserEventService service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Retail::V2::UserEventService::Client#import_user_events.", - "file": "user_event_service/import_user_events.rb", - "language": "RUBY", - "client_method": { - "short_name": "import_user_events", - "full_name": "::Google::Cloud::Retail::V2::UserEventService::Client#import_user_events", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::Retail::V2::ImportUserEventsRequest", - "name": "request" - } - ], - "result_type": "::Google::Longrunning::Operation", - "client": { - "short_name": "UserEventService::Client", - "full_name": "::Google::Cloud::Retail::V2::UserEventService::Client" - }, - "method": { - "short_name": "ImportUserEvents", - "full_name": "google.cloud.retail.v2.UserEventService.ImportUserEvents", - "service": { - "short_name": "UserEventService", - "full_name": "google.cloud.retail.v2.UserEventService" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 53, - "type": "FULL" - } - ] - }, - { - "region_tag": "retail_v2_generated_UserEventService_RejoinUserEvents_sync", - "title": "Snippet for the rejoin_user_events call in the UserEventService service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Retail::V2::UserEventService::Client#rejoin_user_events.", - "file": "user_event_service/rejoin_user_events.rb", - "language": "RUBY", - "client_method": { - "short_name": "rejoin_user_events", - "full_name": "::Google::Cloud::Retail::V2::UserEventService::Client#rejoin_user_events", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::Retail::V2::RejoinUserEventsRequest", - "name": "request" - } - ], - "result_type": "::Google::Longrunning::Operation", - "client": { - "short_name": "UserEventService::Client", - "full_name": "::Google::Cloud::Retail::V2::UserEventService::Client" - }, - "method": { - "short_name": "RejoinUserEvents", - "full_name": "google.cloud.retail.v2.UserEventService.RejoinUserEvents", - "service": { - "short_name": "UserEventService", - "full_name": "google.cloud.retail.v2.UserEventService" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 53, - "type": "FULL" - } - ] - } - ] -} \ No newline at end of file diff --git a/owl-bot-staging/google-cloud-retail-v2/snippets/user_event_service/collect_user_event.rb b/owl-bot-staging/google-cloud-retail-v2/snippets/user_event_service/collect_user_event.rb deleted file mode 100644 index ee81b5ede9b4..000000000000 --- a/owl-bot-staging/google-cloud-retail-v2/snippets/user_event_service/collect_user_event.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 retail_v2_generated_UserEventService_CollectUserEvent_sync] -require "google/cloud/retail/v2" - -## -# Snippet for the collect_user_event call in the UserEventService service -# -# This snippet has been automatically generated and should be regarded as a code -# template only. It will require modifications to work: -# - It may require correct/in-range values for request initialization. -# - It may require specifying regional endpoints when creating the service -# client as shown in https://cloud.google.com/ruby/docs/reference. -# -# This is an auto-generated example demonstrating basic usage of -# Google::Cloud::Retail::V2::UserEventService::Client#collect_user_event. -# -def collect_user_event - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::Retail::V2::UserEventService::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::Retail::V2::CollectUserEventRequest.new - - # Call the collect_user_event method. - result = client.collect_user_event request - - # The returned object is of type Google::Api::HttpBody. - p result -end -# [END retail_v2_generated_UserEventService_CollectUserEvent_sync] diff --git a/owl-bot-staging/google-cloud-retail-v2/snippets/user_event_service/import_user_events.rb b/owl-bot-staging/google-cloud-retail-v2/snippets/user_event_service/import_user_events.rb deleted file mode 100644 index 4c20c5a126d4..000000000000 --- a/owl-bot-staging/google-cloud-retail-v2/snippets/user_event_service/import_user_events.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 retail_v2_generated_UserEventService_ImportUserEvents_sync] -require "google/cloud/retail/v2" - -## -# Snippet for the import_user_events call in the UserEventService service -# -# This snippet has been automatically generated and should be regarded as a code -# template only. It will require modifications to work: -# - It may require correct/in-range values for request initialization. -# - It may require specifying regional endpoints when creating the service -# client as shown in https://cloud.google.com/ruby/docs/reference. -# -# This is an auto-generated example demonstrating basic usage of -# Google::Cloud::Retail::V2::UserEventService::Client#import_user_events. -# -def import_user_events - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::Retail::V2::UserEventService::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::Retail::V2::ImportUserEventsRequest.new - - # Call the import_user_events method. - result = client.import_user_events 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 retail_v2_generated_UserEventService_ImportUserEvents_sync] diff --git a/owl-bot-staging/google-cloud-retail-v2/snippets/user_event_service/purge_user_events.rb b/owl-bot-staging/google-cloud-retail-v2/snippets/user_event_service/purge_user_events.rb deleted file mode 100644 index 7d7df5d779bd..000000000000 --- a/owl-bot-staging/google-cloud-retail-v2/snippets/user_event_service/purge_user_events.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 retail_v2_generated_UserEventService_PurgeUserEvents_sync] -require "google/cloud/retail/v2" - -## -# Snippet for the purge_user_events call in the UserEventService service -# -# This snippet has been automatically generated and should be regarded as a code -# template only. It will require modifications to work: -# - It may require correct/in-range values for request initialization. -# - It may require specifying regional endpoints when creating the service -# client as shown in https://cloud.google.com/ruby/docs/reference. -# -# This is an auto-generated example demonstrating basic usage of -# Google::Cloud::Retail::V2::UserEventService::Client#purge_user_events. -# -def purge_user_events - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::Retail::V2::UserEventService::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::Retail::V2::PurgeUserEventsRequest.new - - # Call the purge_user_events method. - result = client.purge_user_events 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 retail_v2_generated_UserEventService_PurgeUserEvents_sync] diff --git a/owl-bot-staging/google-cloud-retail-v2/snippets/user_event_service/rejoin_user_events.rb b/owl-bot-staging/google-cloud-retail-v2/snippets/user_event_service/rejoin_user_events.rb deleted file mode 100644 index 38e48c8b00d3..000000000000 --- a/owl-bot-staging/google-cloud-retail-v2/snippets/user_event_service/rejoin_user_events.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 retail_v2_generated_UserEventService_RejoinUserEvents_sync] -require "google/cloud/retail/v2" - -## -# Snippet for the rejoin_user_events call in the UserEventService service -# -# This snippet has been automatically generated and should be regarded as a code -# template only. It will require modifications to work: -# - It may require correct/in-range values for request initialization. -# - It may require specifying regional endpoints when creating the service -# client as shown in https://cloud.google.com/ruby/docs/reference. -# -# This is an auto-generated example demonstrating basic usage of -# Google::Cloud::Retail::V2::UserEventService::Client#rejoin_user_events. -# -def rejoin_user_events - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::Retail::V2::UserEventService::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::Retail::V2::RejoinUserEventsRequest.new - - # Call the rejoin_user_events method. - result = client.rejoin_user_events 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 retail_v2_generated_UserEventService_RejoinUserEvents_sync] diff --git a/owl-bot-staging/google-cloud-retail-v2/snippets/user_event_service/write_user_event.rb b/owl-bot-staging/google-cloud-retail-v2/snippets/user_event_service/write_user_event.rb deleted file mode 100644 index e1946f8c6a8d..000000000000 --- a/owl-bot-staging/google-cloud-retail-v2/snippets/user_event_service/write_user_event.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 retail_v2_generated_UserEventService_WriteUserEvent_sync] -require "google/cloud/retail/v2" - -## -# Snippet for the write_user_event call in the UserEventService service -# -# This snippet has been automatically generated and should be regarded as a code -# template only. It will require modifications to work: -# - It may require correct/in-range values for request initialization. -# - It may require specifying regional endpoints when creating the service -# client as shown in https://cloud.google.com/ruby/docs/reference. -# -# This is an auto-generated example demonstrating basic usage of -# Google::Cloud::Retail::V2::UserEventService::Client#write_user_event. -# -def write_user_event - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::Retail::V2::UserEventService::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::Retail::V2::WriteUserEventRequest.new - - # Call the write_user_event method. - result = client.write_user_event request - - # The returned object is of type Google::Cloud::Retail::V2::UserEvent. - p result -end -# [END retail_v2_generated_UserEventService_WriteUserEvent_sync] diff --git a/owl-bot-staging/google-cloud-retail-v2/test/google/cloud/retail/v2/analytics_service_operations_test.rb b/owl-bot-staging/google-cloud-retail-v2/test/google/cloud/retail/v2/analytics_service_operations_test.rb deleted file mode 100644 index 98720382d56c..000000000000 --- a/owl-bot-staging/google-cloud-retail-v2/test/google/cloud/retail/v2/analytics_service_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/cloud/retail/v2/analytics_service_pb" -require "google/cloud/retail/v2/analytics_service_services_pb" -require "google/cloud/retail/v2/analytics_service" - -class ::Google::Cloud::Retail::V2::AnalyticsService::OperationsTest < Minitest::Test - class ClientStub - attr_accessor :call_rpc_count, :requests - - def initialize response, operation, &block - @response = response - @operation = operation - @block = block - @call_rpc_count = 0 - @requests = [] - end - - def call_rpc *args, **kwargs - @call_rpc_count += 1 - - @requests << @block&.call(*args, **kwargs) - - catch :response do - yield @response, @operation if block_given? - @response - end - end - - def endpoint - "endpoint.example.com" - end - - def universe_domain - "example.com" - end - - def stub_logger - nil - end - - def logger - nil - end - end - - def test_list_operations - # Create GRPC objects. - grpc_response = ::Google::Longrunning::ListOperationsResponse.new - grpc_operation = GRPC::ActiveCall::Operation.new nil - grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - grpc_options = {} - - # Create request parameters for a unary method. - name = "hello world" - filter = "hello world" - page_size = 42 - page_token = "hello world" - return_partial_success = true - - list_operations_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :list_operations, name - assert_kind_of ::Google::Longrunning::ListOperationsRequest, request - assert_equal "hello world", request["name"] - assert_equal "hello world", request["filter"] - assert_equal 42, request["page_size"] - assert_equal "hello world", request["page_token"] - assert_equal true, request["return_partial_success"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, list_operations_client_stub do - # Create client - client = ::Google::Cloud::Retail::V2::AnalyticsService::Operations.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.list_operations({ name: name, filter: filter, page_size: page_size, page_token: page_token, return_partial_success: return_partial_success }) do |response, operation| - assert_kind_of Gapic::PagedEnumerable, response - assert_equal grpc_response, response.response - assert_equal grpc_operation, operation - end - - # Use named arguments - client.list_operations name: name, filter: filter, page_size: page_size, page_token: page_token, return_partial_success: return_partial_success do |response, operation| - assert_kind_of Gapic::PagedEnumerable, response - assert_equal grpc_response, response.response - assert_equal grpc_operation, operation - end - - # Use protobuf object - client.list_operations ::Google::Longrunning::ListOperationsRequest.new(name: name, filter: filter, page_size: page_size, page_token: page_token, return_partial_success: return_partial_success) do |response, operation| - assert_kind_of Gapic::PagedEnumerable, response - assert_equal grpc_response, response.response - assert_equal grpc_operation, operation - end - - # Use hash object with options - client.list_operations({ name: name, filter: filter, page_size: page_size, page_token: page_token, return_partial_success: return_partial_success }, grpc_options) do |response, operation| - assert_kind_of Gapic::PagedEnumerable, response - assert_equal grpc_response, response.response - assert_equal grpc_operation, operation - end - - # Use protobuf object with options - client.list_operations(::Google::Longrunning::ListOperationsRequest.new(name: name, filter: filter, page_size: page_size, page_token: page_token, return_partial_success: return_partial_success), grpc_options) do |response, operation| - assert_kind_of Gapic::PagedEnumerable, response - assert_equal grpc_response, response.response - assert_equal grpc_operation, operation - end - - # Verify method calls - assert_equal 5, list_operations_client_stub.call_rpc_count - end - end - - def test_get_operation - # Create GRPC objects. - grpc_response = ::Google::Longrunning::Operation.new - grpc_operation = GRPC::ActiveCall::Operation.new nil - grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - grpc_options = {} - - # Create request parameters for a unary method. - name = "hello world" - - get_operation_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :get_operation, name - assert_kind_of ::Google::Longrunning::GetOperationRequest, request - assert_equal "hello world", request["name"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, get_operation_client_stub do - # Create client - client = ::Google::Cloud::Retail::V2::AnalyticsService::Operations.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.get_operation({ name: name }) do |response, operation| - assert_kind_of Gapic::Operation, response - assert_equal grpc_response, response.grpc_op - assert_equal grpc_operation, operation - end - - # Use named arguments - client.get_operation name: name do |response, operation| - assert_kind_of Gapic::Operation, response - assert_equal grpc_response, response.grpc_op - assert_equal grpc_operation, operation - end - - # Use protobuf object - client.get_operation ::Google::Longrunning::GetOperationRequest.new(name: name) do |response, operation| - assert_kind_of Gapic::Operation, response - assert_equal grpc_response, response.grpc_op - assert_equal grpc_operation, operation - end - - # Use hash object with options - client.get_operation({ name: name }, grpc_options) do |response, operation| - assert_kind_of Gapic::Operation, response - assert_equal grpc_response, response.grpc_op - assert_equal grpc_operation, operation - end - - # Use protobuf object with options - client.get_operation(::Google::Longrunning::GetOperationRequest.new(name: name), grpc_options) do |response, operation| - assert_kind_of Gapic::Operation, response - assert_equal grpc_response, response.grpc_op - assert_equal grpc_operation, operation - end - - # Verify method calls - assert_equal 5, get_operation_client_stub.call_rpc_count - end - end - - def test_delete_operation - # Create GRPC objects. - grpc_response = ::Google::Protobuf::Empty.new - grpc_operation = GRPC::ActiveCall::Operation.new nil - grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - grpc_options = {} - - # Create request parameters for a unary method. - name = "hello world" - - delete_operation_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :delete_operation, name - assert_kind_of ::Google::Longrunning::DeleteOperationRequest, request - assert_equal "hello world", request["name"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, delete_operation_client_stub do - # Create client - client = ::Google::Cloud::Retail::V2::AnalyticsService::Operations.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.delete_operation({ name: name }) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use named arguments - client.delete_operation name: name do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object - client.delete_operation ::Google::Longrunning::DeleteOperationRequest.new(name: name) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use hash object with options - client.delete_operation({ name: name }, grpc_options) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object with options - client.delete_operation(::Google::Longrunning::DeleteOperationRequest.new(name: name), grpc_options) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Verify method calls - assert_equal 5, delete_operation_client_stub.call_rpc_count - end - end - - def test_cancel_operation - # Create GRPC objects. - grpc_response = ::Google::Protobuf::Empty.new - grpc_operation = GRPC::ActiveCall::Operation.new nil - grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - grpc_options = {} - - # Create request parameters for a unary method. - name = "hello world" - - cancel_operation_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :cancel_operation, name - assert_kind_of ::Google::Longrunning::CancelOperationRequest, request - assert_equal "hello world", request["name"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, cancel_operation_client_stub do - # Create client - client = ::Google::Cloud::Retail::V2::AnalyticsService::Operations.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.cancel_operation({ name: name }) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use named arguments - client.cancel_operation name: name do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object - client.cancel_operation ::Google::Longrunning::CancelOperationRequest.new(name: name) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use hash object with options - client.cancel_operation({ name: name }, grpc_options) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object with options - client.cancel_operation(::Google::Longrunning::CancelOperationRequest.new(name: name), grpc_options) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Verify method calls - assert_equal 5, cancel_operation_client_stub.call_rpc_count - end - end - - def test_wait_operation - # Create GRPC objects. - grpc_response = ::Google::Longrunning::Operation.new - grpc_operation = GRPC::ActiveCall::Operation.new nil - grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - grpc_options = {} - - # Create request parameters for a unary method. - name = "hello world" - timeout = {} - - wait_operation_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :wait_operation, name - assert_kind_of ::Google::Longrunning::WaitOperationRequest, request - assert_equal "hello world", request["name"] - assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Protobuf::Duration), request["timeout"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, wait_operation_client_stub do - # Create client - client = ::Google::Cloud::Retail::V2::AnalyticsService::Operations.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.wait_operation({ name: name, timeout: timeout }) do |response, operation| - assert_kind_of Gapic::Operation, response - assert_equal grpc_response, response.grpc_op - assert_equal grpc_operation, operation - end - - # Use named arguments - client.wait_operation name: name, timeout: timeout do |response, operation| - assert_kind_of Gapic::Operation, response - assert_equal grpc_response, response.grpc_op - assert_equal grpc_operation, operation - end - - # Use protobuf object - client.wait_operation ::Google::Longrunning::WaitOperationRequest.new(name: name, timeout: timeout) do |response, operation| - assert_kind_of Gapic::Operation, response - assert_equal grpc_response, response.grpc_op - assert_equal grpc_operation, operation - end - - # Use hash object with options - client.wait_operation({ name: name, timeout: timeout }, grpc_options) do |response, operation| - assert_kind_of Gapic::Operation, response - assert_equal grpc_response, response.grpc_op - assert_equal grpc_operation, operation - end - - # Use protobuf object with options - client.wait_operation(::Google::Longrunning::WaitOperationRequest.new(name: name, timeout: timeout), grpc_options) do |response, operation| - assert_kind_of Gapic::Operation, response - assert_equal grpc_response, response.grpc_op - assert_equal grpc_operation, operation - end - - # Verify method calls - assert_equal 5, wait_operation_client_stub.call_rpc_count - end - end - - def test_configure - grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - - client = block_config = config = nil - dummy_stub = ClientStub.new nil, nil - Gapic::ServiceStub.stub :new, dummy_stub do - client = ::Google::Cloud::Retail::V2::AnalyticsService::Operations.new do |config| - config.credentials = grpc_channel - end - end - - config = client.configure do |c| - block_config = c - end - - assert_same block_config, config - assert_kind_of ::Google::Cloud::Retail::V2::AnalyticsService::Operations::Configuration, config - end -end diff --git a/owl-bot-staging/google-cloud-retail-v2/test/google/cloud/retail/v2/analytics_service_rest_test.rb b/owl-bot-staging/google-cloud-retail-v2/test/google/cloud/retail/v2/analytics_service_rest_test.rb deleted file mode 100644 index f24138baeb71..000000000000 --- a/owl-bot-staging/google-cloud-retail-v2/test/google/cloud/retail/v2/analytics_service_rest_test.rb +++ /dev/null @@ -1,155 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -require "helper" -require "gapic/rest" -require "google/cloud/retail/v2/analytics_service_pb" -require "google/cloud/retail/v2/analytics_service/rest" - - -class ::Google::Cloud::Retail::V2::AnalyticsService::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_export_analytics_metrics - # 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. - catalog = "hello world" - output_config = {} - filter = "hello world" - - export_analytics_metrics_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| - assert options.metadata.key? :"x-goog-api-client" - assert options.metadata[:"x-goog-api-client"].include? "rest" - refute options.metadata[:"x-goog-api-client"].include? "grpc" - end - - ::Google::Cloud::Retail::V2::AnalyticsService::Rest::ServiceStub.stub :transcode_export_analytics_metrics_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, export_analytics_metrics_client_stub do - # Create client - client = ::Google::Cloud::Retail::V2::AnalyticsService::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - client.export_analytics_metrics({ catalog: catalog, output_config: output_config, filter: filter }) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use named arguments - client.export_analytics_metrics catalog: catalog, output_config: output_config, filter: filter do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object - client.export_analytics_metrics ::Google::Cloud::Retail::V2::ExportAnalyticsMetricsRequest.new(catalog: catalog, output_config: output_config, filter: filter) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use hash object with options - client.export_analytics_metrics({ catalog: catalog, output_config: output_config, filter: filter }, call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object with options - client.export_analytics_metrics(::Google::Cloud::Retail::V2::ExportAnalyticsMetricsRequest.new(catalog: catalog, output_config: output_config, filter: filter), call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Verify method calls - assert_equal 5, export_analytics_metrics_client_stub.call_count - end - end - end - - def test_configure - credentials_token = :dummy_value - - client = block_config = config = nil - dummy_stub = ClientStub.new nil - Gapic::Rest::ClientStub.stub :new, dummy_stub do - client = ::Google::Cloud::Retail::V2::AnalyticsService::Rest::Client.new do |config| - config.credentials = credentials_token - end - end - - config = client.configure do |c| - block_config = c - end - - assert_same block_config, config - assert_kind_of ::Google::Cloud::Retail::V2::AnalyticsService::Rest::Client::Configuration, config - end -end diff --git a/owl-bot-staging/google-cloud-retail-v2/test/google/cloud/retail/v2/analytics_service_test.rb b/owl-bot-staging/google-cloud-retail-v2/test/google/cloud/retail/v2/analytics_service_test.rb deleted file mode 100644 index 05797bd8a20f..000000000000 --- a/owl-bot-staging/google-cloud-retail-v2/test/google/cloud/retail/v2/analytics_service_test.rb +++ /dev/null @@ -1,185 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -require "helper" - -require "gapic/grpc/service_stub" - -require "google/cloud/retail/v2/analytics_service_pb" -require "google/cloud/retail/v2/analytics_service" - -class ::Google::Cloud::Retail::V2::AnalyticsService::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_export_analytics_metrics - # 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. - catalog = "hello world" - output_config = {} - filter = "hello world" - - export_analytics_metrics_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :export_analytics_metrics, name - assert_kind_of ::Google::Cloud::Retail::V2::ExportAnalyticsMetricsRequest, request - assert_equal "hello world", request["catalog"] - assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::Retail::V2::OutputConfig), request["output_config"] - assert_equal "hello world", request["filter"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, export_analytics_metrics_client_stub do - # Create client - client = ::Google::Cloud::Retail::V2::AnalyticsService::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.export_analytics_metrics({ catalog: catalog, output_config: output_config, filter: filter }) 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.export_analytics_metrics catalog: catalog, output_config: output_config, filter: filter 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.export_analytics_metrics ::Google::Cloud::Retail::V2::ExportAnalyticsMetricsRequest.new(catalog: catalog, output_config: output_config, filter: filter) 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.export_analytics_metrics({ catalog: catalog, output_config: output_config, filter: filter }, 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.export_analytics_metrics(::Google::Cloud::Retail::V2::ExportAnalyticsMetricsRequest.new(catalog: catalog, output_config: output_config, filter: filter), 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, export_analytics_metrics_client_stub.call_rpc_count - end - end - - def test_configure - grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - - client = block_config = config = nil - dummy_stub = ClientStub.new nil, nil - Gapic::ServiceStub.stub :new, dummy_stub do - client = ::Google::Cloud::Retail::V2::AnalyticsService::Client.new do |config| - config.credentials = grpc_channel - end - end - - config = client.configure do |c| - block_config = c - end - - assert_same block_config, config - assert_kind_of ::Google::Cloud::Retail::V2::AnalyticsService::Client::Configuration, config - end - - def test_credentials - key = OpenSSL::PKey::RSA.new 2048 - cred_json = { - "private_key" => key.to_pem, - "client_email" => "app@developer.gserviceaccount.com", - "type" => "service_account" - } - key_file = StringIO.new cred_json.to_json - creds = Google::Auth::ServiceAccountCredentials.make_creds({ json_key_io: key_file }) - - dummy_stub = ClientStub.new nil, nil - Gapic::ServiceStub.stub :new, dummy_stub do - client = ::Google::Cloud::Retail::V2::AnalyticsService::Client.new do |config| - config.credentials = creds - end - assert_kind_of ::Google::Cloud::Retail::V2::AnalyticsService::Client, client - assert_equal creds, client.configure.credentials - end - end - - def test_operations_client - grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - - client = nil - dummy_stub = ClientStub.new nil, nil - Gapic::ServiceStub.stub :new, dummy_stub do - client = ::Google::Cloud::Retail::V2::AnalyticsService::Client.new do |config| - config.credentials = grpc_channel - end - end - - assert_kind_of ::Google::Cloud::Retail::V2::AnalyticsService::Operations, client.operations_client - end -end diff --git a/owl-bot-staging/google-cloud-retail-v2/test/google/cloud/retail/v2/catalog_service_paths_test.rb b/owl-bot-staging/google-cloud-retail-v2/test/google/cloud/retail/v2/catalog_service_paths_test.rb deleted file mode 100644 index e107597737b1..000000000000 --- a/owl-bot-staging/google-cloud-retail-v2/test/google/cloud/retail/v2/catalog_service_paths_test.rb +++ /dev/null @@ -1,103 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -require "helper" - -require "gapic/grpc/service_stub" - -require "google/cloud/retail/v2/catalog_service" - -class ::Google::Cloud::Retail::V2::CatalogService::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_attributes_config_path - grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - ::Gapic::ServiceStub.stub :new, DummyStub.new do - client = ::Google::Cloud::Retail::V2::CatalogService::Client.new do |config| - config.credentials = grpc_channel - end - - path = client.attributes_config_path project: "value0", location: "value1", catalog: "value2" - assert_equal "projects/value0/locations/value1/catalogs/value2/attributesConfig", path - end - end - - def test_branch_path - grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - ::Gapic::ServiceStub.stub :new, DummyStub.new do - client = ::Google::Cloud::Retail::V2::CatalogService::Client.new do |config| - config.credentials = grpc_channel - end - - path = client.branch_path project: "value0", location: "value1", catalog: "value2", branch: "value3" - assert_equal "projects/value0/locations/value1/catalogs/value2/branches/value3", path - end - end - - def test_catalog_path - grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - ::Gapic::ServiceStub.stub :new, DummyStub.new do - client = ::Google::Cloud::Retail::V2::CatalogService::Client.new do |config| - config.credentials = grpc_channel - end - - path = client.catalog_path project: "value0", location: "value1", catalog: "value2" - assert_equal "projects/value0/locations/value1/catalogs/value2", path - end - end - - def test_completion_config_path - grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - ::Gapic::ServiceStub.stub :new, DummyStub.new do - client = ::Google::Cloud::Retail::V2::CatalogService::Client.new do |config| - config.credentials = grpc_channel - end - - path = client.completion_config_path project: "value0", location: "value1", catalog: "value2" - assert_equal "projects/value0/locations/value1/catalogs/value2/completionConfig", path - end - end - - def test_location_path - grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - ::Gapic::ServiceStub.stub :new, DummyStub.new do - client = ::Google::Cloud::Retail::V2::CatalogService::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 -end diff --git a/owl-bot-staging/google-cloud-retail-v2/test/google/cloud/retail/v2/catalog_service_rest_test.rb b/owl-bot-staging/google-cloud-retail-v2/test/google/cloud/retail/v2/catalog_service_rest_test.rb deleted file mode 100644 index 5bdadb8726ab..000000000000 --- a/owl-bot-staging/google-cloud-retail-v2/test/google/cloud/retail/v2/catalog_service_rest_test.rb +++ /dev/null @@ -1,705 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -require "helper" -require "gapic/rest" -require "google/cloud/retail/v2/catalog_service_pb" -require "google/cloud/retail/v2/catalog_service/rest" - - -class ::Google::Cloud::Retail::V2::CatalogService::Rest::ClientTest < Minitest::Test - class ClientStub - attr_accessor :call_count, :requests - - def initialize response, &block - @response = response - @block = block - @call_count = 0 - @requests = [] - end - - def make_get_request uri:, params: {}, options: {}, method_name: nil - make_http_request :get, uri: uri, body: nil, params: params, options: options, method_name: method_name - end - - def make_delete_request uri:, params: {}, options: {}, method_name: nil - make_http_request :delete, uri: uri, body: nil, params: params, options: options, method_name: method_name - end - - def make_post_request uri:, body: nil, params: {}, options: {}, method_name: nil - make_http_request :post, uri: uri, body: body, params: params, options: options, method_name: method_name - end - - def make_patch_request uri:, body:, params: {}, options: {}, method_name: nil - make_http_request :patch, uri: uri, body: body, params: params, options: options, method_name: method_name - end - - def make_put_request uri:, body:, params: {}, options: {}, method_name: nil - make_http_request :put, uri: uri, body: body, params: params, options: options, method_name: method_name - end - - def make_http_request *args, **kwargs - @call_count += 1 - - @requests << @block&.call(*args, **kwargs) - - @response - end - - def endpoint - "endpoint.example.com" - end - - def universe_domain - "example.com" - end - - def stub_logger - nil - end - - def logger - nil - end - end - - def test_list_catalogs - # Create test objects. - client_result = ::Google::Cloud::Retail::V2::ListCatalogsResponse.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_catalogs_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| - assert options.metadata.key? :"x-goog-api-client" - assert options.metadata[:"x-goog-api-client"].include? "rest" - refute options.metadata[:"x-goog-api-client"].include? "grpc" - end - - ::Google::Cloud::Retail::V2::CatalogService::Rest::ServiceStub.stub :transcode_list_catalogs_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, list_catalogs_client_stub do - # Create client - client = ::Google::Cloud::Retail::V2::CatalogService::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - client.list_catalogs({ 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_catalogs 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_catalogs ::Google::Cloud::Retail::V2::ListCatalogsRequest.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_catalogs({ 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_catalogs(::Google::Cloud::Retail::V2::ListCatalogsRequest.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_catalogs_client_stub.call_count - end - end - end - - def test_update_catalog - # Create test objects. - client_result = ::Google::Cloud::Retail::V2::Catalog.new - http_response = OpenStruct.new body: client_result.to_json - - call_options = {} - - # Create request parameters for a unary method. - catalog = {} - update_mask = {} - - update_catalog_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| - assert options.metadata.key? :"x-goog-api-client" - assert options.metadata[:"x-goog-api-client"].include? "rest" - refute options.metadata[:"x-goog-api-client"].include? "grpc" - end - - ::Google::Cloud::Retail::V2::CatalogService::Rest::ServiceStub.stub :transcode_update_catalog_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, update_catalog_client_stub do - # Create client - client = ::Google::Cloud::Retail::V2::CatalogService::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - client.update_catalog({ catalog: catalog, update_mask: update_mask }) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use named arguments - client.update_catalog catalog: catalog, update_mask: update_mask do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object - client.update_catalog ::Google::Cloud::Retail::V2::UpdateCatalogRequest.new(catalog: catalog, update_mask: update_mask) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use hash object with options - client.update_catalog({ catalog: catalog, update_mask: update_mask }, call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object with options - client.update_catalog(::Google::Cloud::Retail::V2::UpdateCatalogRequest.new(catalog: catalog, update_mask: update_mask), call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Verify method calls - assert_equal 5, update_catalog_client_stub.call_count - end - end - end - - def test_set_default_branch - # Create test objects. - client_result = ::Google::Protobuf::Empty.new - http_response = OpenStruct.new body: client_result.to_json - - call_options = {} - - # Create request parameters for a unary method. - catalog = "hello world" - branch_id = "hello world" - note = "hello world" - force = true - - set_default_branch_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| - assert options.metadata.key? :"x-goog-api-client" - assert options.metadata[:"x-goog-api-client"].include? "rest" - refute options.metadata[:"x-goog-api-client"].include? "grpc" - end - - ::Google::Cloud::Retail::V2::CatalogService::Rest::ServiceStub.stub :transcode_set_default_branch_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, set_default_branch_client_stub do - # Create client - client = ::Google::Cloud::Retail::V2::CatalogService::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - client.set_default_branch({ catalog: catalog, branch_id: branch_id, note: note, force: force }) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use named arguments - client.set_default_branch catalog: catalog, branch_id: branch_id, note: note, force: force do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object - client.set_default_branch ::Google::Cloud::Retail::V2::SetDefaultBranchRequest.new(catalog: catalog, branch_id: branch_id, note: note, force: force) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use hash object with options - client.set_default_branch({ catalog: catalog, branch_id: branch_id, note: note, force: force }, call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object with options - client.set_default_branch(::Google::Cloud::Retail::V2::SetDefaultBranchRequest.new(catalog: catalog, branch_id: branch_id, note: note, force: force), call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Verify method calls - assert_equal 5, set_default_branch_client_stub.call_count - end - end - end - - def test_get_default_branch - # Create test objects. - client_result = ::Google::Cloud::Retail::V2::GetDefaultBranchResponse.new - http_response = OpenStruct.new body: client_result.to_json - - call_options = {} - - # Create request parameters for a unary method. - catalog = "hello world" - - get_default_branch_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| - assert options.metadata.key? :"x-goog-api-client" - assert options.metadata[:"x-goog-api-client"].include? "rest" - refute options.metadata[:"x-goog-api-client"].include? "grpc" - end - - ::Google::Cloud::Retail::V2::CatalogService::Rest::ServiceStub.stub :transcode_get_default_branch_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, get_default_branch_client_stub do - # Create client - client = ::Google::Cloud::Retail::V2::CatalogService::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - client.get_default_branch({ catalog: catalog }) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use named arguments - client.get_default_branch catalog: catalog do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object - client.get_default_branch ::Google::Cloud::Retail::V2::GetDefaultBranchRequest.new(catalog: catalog) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use hash object with options - client.get_default_branch({ catalog: catalog }, call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object with options - client.get_default_branch(::Google::Cloud::Retail::V2::GetDefaultBranchRequest.new(catalog: catalog), call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Verify method calls - assert_equal 5, get_default_branch_client_stub.call_count - end - end - end - - def test_get_completion_config - # Create test objects. - client_result = ::Google::Cloud::Retail::V2::CompletionConfig.new - http_response = OpenStruct.new body: client_result.to_json - - call_options = {} - - # Create request parameters for a unary method. - name = "hello world" - - get_completion_config_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| - assert options.metadata.key? :"x-goog-api-client" - assert options.metadata[:"x-goog-api-client"].include? "rest" - refute options.metadata[:"x-goog-api-client"].include? "grpc" - end - - ::Google::Cloud::Retail::V2::CatalogService::Rest::ServiceStub.stub :transcode_get_completion_config_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, get_completion_config_client_stub do - # Create client - client = ::Google::Cloud::Retail::V2::CatalogService::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - client.get_completion_config({ name: name }) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use named arguments - client.get_completion_config name: name do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object - client.get_completion_config ::Google::Cloud::Retail::V2::GetCompletionConfigRequest.new(name: name) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use hash object with options - client.get_completion_config({ name: name }, call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object with options - client.get_completion_config(::Google::Cloud::Retail::V2::GetCompletionConfigRequest.new(name: name), call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Verify method calls - assert_equal 5, get_completion_config_client_stub.call_count - end - end - end - - def test_update_completion_config - # Create test objects. - client_result = ::Google::Cloud::Retail::V2::CompletionConfig.new - http_response = OpenStruct.new body: client_result.to_json - - call_options = {} - - # Create request parameters for a unary method. - completion_config = {} - update_mask = {} - - update_completion_config_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| - assert options.metadata.key? :"x-goog-api-client" - assert options.metadata[:"x-goog-api-client"].include? "rest" - refute options.metadata[:"x-goog-api-client"].include? "grpc" - end - - ::Google::Cloud::Retail::V2::CatalogService::Rest::ServiceStub.stub :transcode_update_completion_config_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, update_completion_config_client_stub do - # Create client - client = ::Google::Cloud::Retail::V2::CatalogService::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - client.update_completion_config({ completion_config: completion_config, update_mask: update_mask }) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use named arguments - client.update_completion_config completion_config: completion_config, update_mask: update_mask do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object - client.update_completion_config ::Google::Cloud::Retail::V2::UpdateCompletionConfigRequest.new(completion_config: completion_config, update_mask: update_mask) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use hash object with options - client.update_completion_config({ completion_config: completion_config, update_mask: update_mask }, call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object with options - client.update_completion_config(::Google::Cloud::Retail::V2::UpdateCompletionConfigRequest.new(completion_config: completion_config, update_mask: update_mask), call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Verify method calls - assert_equal 5, update_completion_config_client_stub.call_count - end - end - end - - def test_get_attributes_config - # Create test objects. - client_result = ::Google::Cloud::Retail::V2::AttributesConfig.new - http_response = OpenStruct.new body: client_result.to_json - - call_options = {} - - # Create request parameters for a unary method. - name = "hello world" - - get_attributes_config_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| - assert options.metadata.key? :"x-goog-api-client" - assert options.metadata[:"x-goog-api-client"].include? "rest" - refute options.metadata[:"x-goog-api-client"].include? "grpc" - end - - ::Google::Cloud::Retail::V2::CatalogService::Rest::ServiceStub.stub :transcode_get_attributes_config_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, get_attributes_config_client_stub do - # Create client - client = ::Google::Cloud::Retail::V2::CatalogService::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - client.get_attributes_config({ name: name }) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use named arguments - client.get_attributes_config name: name do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object - client.get_attributes_config ::Google::Cloud::Retail::V2::GetAttributesConfigRequest.new(name: name) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use hash object with options - client.get_attributes_config({ name: name }, call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object with options - client.get_attributes_config(::Google::Cloud::Retail::V2::GetAttributesConfigRequest.new(name: name), call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Verify method calls - assert_equal 5, get_attributes_config_client_stub.call_count - end - end - end - - def test_update_attributes_config - # Create test objects. - client_result = ::Google::Cloud::Retail::V2::AttributesConfig.new - http_response = OpenStruct.new body: client_result.to_json - - call_options = {} - - # Create request parameters for a unary method. - attributes_config = {} - update_mask = {} - - update_attributes_config_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| - assert options.metadata.key? :"x-goog-api-client" - assert options.metadata[:"x-goog-api-client"].include? "rest" - refute options.metadata[:"x-goog-api-client"].include? "grpc" - end - - ::Google::Cloud::Retail::V2::CatalogService::Rest::ServiceStub.stub :transcode_update_attributes_config_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, update_attributes_config_client_stub do - # Create client - client = ::Google::Cloud::Retail::V2::CatalogService::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - client.update_attributes_config({ attributes_config: attributes_config, update_mask: update_mask }) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use named arguments - client.update_attributes_config attributes_config: attributes_config, update_mask: update_mask do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object - client.update_attributes_config ::Google::Cloud::Retail::V2::UpdateAttributesConfigRequest.new(attributes_config: attributes_config, update_mask: update_mask) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use hash object with options - client.update_attributes_config({ attributes_config: attributes_config, update_mask: update_mask }, call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object with options - client.update_attributes_config(::Google::Cloud::Retail::V2::UpdateAttributesConfigRequest.new(attributes_config: attributes_config, update_mask: update_mask), call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Verify method calls - assert_equal 5, update_attributes_config_client_stub.call_count - end - end - end - - def test_add_catalog_attribute - # Create test objects. - client_result = ::Google::Cloud::Retail::V2::AttributesConfig.new - http_response = OpenStruct.new body: client_result.to_json - - call_options = {} - - # Create request parameters for a unary method. - attributes_config = "hello world" - catalog_attribute = {} - - add_catalog_attribute_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| - assert options.metadata.key? :"x-goog-api-client" - assert options.metadata[:"x-goog-api-client"].include? "rest" - refute options.metadata[:"x-goog-api-client"].include? "grpc" - end - - ::Google::Cloud::Retail::V2::CatalogService::Rest::ServiceStub.stub :transcode_add_catalog_attribute_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, add_catalog_attribute_client_stub do - # Create client - client = ::Google::Cloud::Retail::V2::CatalogService::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - client.add_catalog_attribute({ attributes_config: attributes_config, catalog_attribute: catalog_attribute }) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use named arguments - client.add_catalog_attribute attributes_config: attributes_config, catalog_attribute: catalog_attribute do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object - client.add_catalog_attribute ::Google::Cloud::Retail::V2::AddCatalogAttributeRequest.new(attributes_config: attributes_config, catalog_attribute: catalog_attribute) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use hash object with options - client.add_catalog_attribute({ attributes_config: attributes_config, catalog_attribute: catalog_attribute }, call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object with options - client.add_catalog_attribute(::Google::Cloud::Retail::V2::AddCatalogAttributeRequest.new(attributes_config: attributes_config, catalog_attribute: catalog_attribute), call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Verify method calls - assert_equal 5, add_catalog_attribute_client_stub.call_count - end - end - end - - def test_remove_catalog_attribute - # Create test objects. - client_result = ::Google::Cloud::Retail::V2::AttributesConfig.new - http_response = OpenStruct.new body: client_result.to_json - - call_options = {} - - # Create request parameters for a unary method. - attributes_config = "hello world" - key = "hello world" - - remove_catalog_attribute_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| - assert options.metadata.key? :"x-goog-api-client" - assert options.metadata[:"x-goog-api-client"].include? "rest" - refute options.metadata[:"x-goog-api-client"].include? "grpc" - end - - ::Google::Cloud::Retail::V2::CatalogService::Rest::ServiceStub.stub :transcode_remove_catalog_attribute_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, remove_catalog_attribute_client_stub do - # Create client - client = ::Google::Cloud::Retail::V2::CatalogService::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - client.remove_catalog_attribute({ attributes_config: attributes_config, key: key }) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use named arguments - client.remove_catalog_attribute attributes_config: attributes_config, key: key do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object - client.remove_catalog_attribute ::Google::Cloud::Retail::V2::RemoveCatalogAttributeRequest.new(attributes_config: attributes_config, key: key) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use hash object with options - client.remove_catalog_attribute({ attributes_config: attributes_config, key: key }, call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object with options - client.remove_catalog_attribute(::Google::Cloud::Retail::V2::RemoveCatalogAttributeRequest.new(attributes_config: attributes_config, key: key), call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Verify method calls - assert_equal 5, remove_catalog_attribute_client_stub.call_count - end - end - end - - def test_replace_catalog_attribute - # Create test objects. - client_result = ::Google::Cloud::Retail::V2::AttributesConfig.new - http_response = OpenStruct.new body: client_result.to_json - - call_options = {} - - # Create request parameters for a unary method. - attributes_config = "hello world" - catalog_attribute = {} - update_mask = {} - - replace_catalog_attribute_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| - assert options.metadata.key? :"x-goog-api-client" - assert options.metadata[:"x-goog-api-client"].include? "rest" - refute options.metadata[:"x-goog-api-client"].include? "grpc" - end - - ::Google::Cloud::Retail::V2::CatalogService::Rest::ServiceStub.stub :transcode_replace_catalog_attribute_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, replace_catalog_attribute_client_stub do - # Create client - client = ::Google::Cloud::Retail::V2::CatalogService::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - client.replace_catalog_attribute({ attributes_config: attributes_config, catalog_attribute: catalog_attribute, update_mask: update_mask }) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use named arguments - client.replace_catalog_attribute attributes_config: attributes_config, catalog_attribute: catalog_attribute, update_mask: update_mask do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object - client.replace_catalog_attribute ::Google::Cloud::Retail::V2::ReplaceCatalogAttributeRequest.new(attributes_config: attributes_config, catalog_attribute: catalog_attribute, update_mask: update_mask) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use hash object with options - client.replace_catalog_attribute({ attributes_config: attributes_config, catalog_attribute: catalog_attribute, update_mask: update_mask }, call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object with options - client.replace_catalog_attribute(::Google::Cloud::Retail::V2::ReplaceCatalogAttributeRequest.new(attributes_config: attributes_config, catalog_attribute: catalog_attribute, update_mask: update_mask), call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Verify method calls - assert_equal 5, replace_catalog_attribute_client_stub.call_count - end - end - end - - def test_configure - credentials_token = :dummy_value - - client = block_config = config = nil - dummy_stub = ClientStub.new nil - Gapic::Rest::ClientStub.stub :new, dummy_stub do - client = ::Google::Cloud::Retail::V2::CatalogService::Rest::Client.new do |config| - config.credentials = credentials_token - end - end - - config = client.configure do |c| - block_config = c - end - - assert_same block_config, config - assert_kind_of ::Google::Cloud::Retail::V2::CatalogService::Rest::Client::Configuration, config - end -end diff --git a/owl-bot-staging/google-cloud-retail-v2/test/google/cloud/retail/v2/catalog_service_test.rb b/owl-bot-staging/google-cloud-retail-v2/test/google/cloud/retail/v2/catalog_service_test.rb deleted file mode 100644 index 7e89b2083b1a..000000000000 --- a/owl-bot-staging/google-cloud-retail-v2/test/google/cloud/retail/v2/catalog_service_test.rb +++ /dev/null @@ -1,771 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -require "helper" - -require "gapic/grpc/service_stub" - -require "google/cloud/retail/v2/catalog_service_pb" -require "google/cloud/retail/v2/catalog_service" - -class ::Google::Cloud::Retail::V2::CatalogService::ClientTest < Minitest::Test - class ClientStub - attr_accessor :call_rpc_count, :requests - - def initialize response, operation, &block - @response = response - @operation = operation - @block = block - @call_rpc_count = 0 - @requests = [] - end - - def call_rpc *args, **kwargs - @call_rpc_count += 1 - - @requests << @block&.call(*args, **kwargs) - - catch :response do - yield @response, @operation if block_given? - @response - end - end - - def endpoint - "endpoint.example.com" - end - - def universe_domain - "example.com" - end - - def stub_logger - nil - end - - def logger - nil - end - end - - def test_list_catalogs - # Create GRPC objects. - grpc_response = ::Google::Cloud::Retail::V2::ListCatalogsResponse.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_catalogs_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :list_catalogs, name - assert_kind_of ::Google::Cloud::Retail::V2::ListCatalogsRequest, 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_catalogs_client_stub do - # Create client - client = ::Google::Cloud::Retail::V2::CatalogService::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.list_catalogs({ 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_catalogs 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_catalogs ::Google::Cloud::Retail::V2::ListCatalogsRequest.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_catalogs({ 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_catalogs(::Google::Cloud::Retail::V2::ListCatalogsRequest.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_catalogs_client_stub.call_rpc_count - end - end - - def test_update_catalog - # Create GRPC objects. - grpc_response = ::Google::Cloud::Retail::V2::Catalog.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. - catalog = {} - update_mask = {} - - update_catalog_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :update_catalog, name - assert_kind_of ::Google::Cloud::Retail::V2::UpdateCatalogRequest, request - assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::Retail::V2::Catalog), request["catalog"] - assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Protobuf::FieldMask), request["update_mask"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, update_catalog_client_stub do - # Create client - client = ::Google::Cloud::Retail::V2::CatalogService::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.update_catalog({ catalog: catalog, update_mask: update_mask }) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use named arguments - client.update_catalog catalog: catalog, update_mask: update_mask do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object - client.update_catalog ::Google::Cloud::Retail::V2::UpdateCatalogRequest.new(catalog: catalog, update_mask: update_mask) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use hash object with options - client.update_catalog({ catalog: catalog, update_mask: update_mask }, grpc_options) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object with options - client.update_catalog(::Google::Cloud::Retail::V2::UpdateCatalogRequest.new(catalog: catalog, update_mask: update_mask), grpc_options) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Verify method calls - assert_equal 5, update_catalog_client_stub.call_rpc_count - end - end - - def test_set_default_branch - # 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. - catalog = "hello world" - branch_id = "hello world" - note = "hello world" - force = true - - set_default_branch_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :set_default_branch, name - assert_kind_of ::Google::Cloud::Retail::V2::SetDefaultBranchRequest, request - assert_equal "hello world", request["catalog"] - assert_equal "hello world", request["branch_id"] - assert_equal "hello world", request["note"] - assert_equal true, request["force"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, set_default_branch_client_stub do - # Create client - client = ::Google::Cloud::Retail::V2::CatalogService::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.set_default_branch({ catalog: catalog, branch_id: branch_id, note: note, force: force }) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use named arguments - client.set_default_branch catalog: catalog, branch_id: branch_id, note: note, force: force do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object - client.set_default_branch ::Google::Cloud::Retail::V2::SetDefaultBranchRequest.new(catalog: catalog, branch_id: branch_id, note: note, force: force) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use hash object with options - client.set_default_branch({ catalog: catalog, branch_id: branch_id, note: note, force: force }, grpc_options) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object with options - client.set_default_branch(::Google::Cloud::Retail::V2::SetDefaultBranchRequest.new(catalog: catalog, branch_id: branch_id, note: note, force: force), grpc_options) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Verify method calls - assert_equal 5, set_default_branch_client_stub.call_rpc_count - end - end - - def test_get_default_branch - # Create GRPC objects. - grpc_response = ::Google::Cloud::Retail::V2::GetDefaultBranchResponse.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. - catalog = "hello world" - - get_default_branch_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :get_default_branch, name - assert_kind_of ::Google::Cloud::Retail::V2::GetDefaultBranchRequest, request - assert_equal "hello world", request["catalog"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, get_default_branch_client_stub do - # Create client - client = ::Google::Cloud::Retail::V2::CatalogService::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.get_default_branch({ catalog: catalog }) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use named arguments - client.get_default_branch catalog: catalog do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object - client.get_default_branch ::Google::Cloud::Retail::V2::GetDefaultBranchRequest.new(catalog: catalog) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use hash object with options - client.get_default_branch({ catalog: catalog }, grpc_options) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object with options - client.get_default_branch(::Google::Cloud::Retail::V2::GetDefaultBranchRequest.new(catalog: catalog), grpc_options) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Verify method calls - assert_equal 5, get_default_branch_client_stub.call_rpc_count - end - end - - def test_get_completion_config - # Create GRPC objects. - grpc_response = ::Google::Cloud::Retail::V2::CompletionConfig.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_completion_config_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :get_completion_config, name - assert_kind_of ::Google::Cloud::Retail::V2::GetCompletionConfigRequest, request - assert_equal "hello world", request["name"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, get_completion_config_client_stub do - # Create client - client = ::Google::Cloud::Retail::V2::CatalogService::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.get_completion_config({ name: name }) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use named arguments - client.get_completion_config name: name do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object - client.get_completion_config ::Google::Cloud::Retail::V2::GetCompletionConfigRequest.new(name: name) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use hash object with options - client.get_completion_config({ name: name }, grpc_options) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object with options - client.get_completion_config(::Google::Cloud::Retail::V2::GetCompletionConfigRequest.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_completion_config_client_stub.call_rpc_count - end - end - - def test_update_completion_config - # Create GRPC objects. - grpc_response = ::Google::Cloud::Retail::V2::CompletionConfig.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. - completion_config = {} - update_mask = {} - - update_completion_config_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :update_completion_config, name - assert_kind_of ::Google::Cloud::Retail::V2::UpdateCompletionConfigRequest, request - assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::Retail::V2::CompletionConfig), request["completion_config"] - assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Protobuf::FieldMask), request["update_mask"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, update_completion_config_client_stub do - # Create client - client = ::Google::Cloud::Retail::V2::CatalogService::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.update_completion_config({ completion_config: completion_config, update_mask: update_mask }) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use named arguments - client.update_completion_config completion_config: completion_config, update_mask: update_mask do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object - client.update_completion_config ::Google::Cloud::Retail::V2::UpdateCompletionConfigRequest.new(completion_config: completion_config, update_mask: update_mask) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use hash object with options - client.update_completion_config({ completion_config: completion_config, update_mask: update_mask }, grpc_options) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object with options - client.update_completion_config(::Google::Cloud::Retail::V2::UpdateCompletionConfigRequest.new(completion_config: completion_config, update_mask: update_mask), grpc_options) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Verify method calls - assert_equal 5, update_completion_config_client_stub.call_rpc_count - end - end - - def test_get_attributes_config - # Create GRPC objects. - grpc_response = ::Google::Cloud::Retail::V2::AttributesConfig.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_attributes_config_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :get_attributes_config, name - assert_kind_of ::Google::Cloud::Retail::V2::GetAttributesConfigRequest, request - assert_equal "hello world", request["name"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, get_attributes_config_client_stub do - # Create client - client = ::Google::Cloud::Retail::V2::CatalogService::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.get_attributes_config({ name: name }) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use named arguments - client.get_attributes_config name: name do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object - client.get_attributes_config ::Google::Cloud::Retail::V2::GetAttributesConfigRequest.new(name: name) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use hash object with options - client.get_attributes_config({ name: name }, grpc_options) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object with options - client.get_attributes_config(::Google::Cloud::Retail::V2::GetAttributesConfigRequest.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_attributes_config_client_stub.call_rpc_count - end - end - - def test_update_attributes_config - # Create GRPC objects. - grpc_response = ::Google::Cloud::Retail::V2::AttributesConfig.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. - attributes_config = {} - update_mask = {} - - update_attributes_config_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :update_attributes_config, name - assert_kind_of ::Google::Cloud::Retail::V2::UpdateAttributesConfigRequest, request - assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::Retail::V2::AttributesConfig), request["attributes_config"] - assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Protobuf::FieldMask), request["update_mask"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, update_attributes_config_client_stub do - # Create client - client = ::Google::Cloud::Retail::V2::CatalogService::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.update_attributes_config({ attributes_config: attributes_config, update_mask: update_mask }) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use named arguments - client.update_attributes_config attributes_config: attributes_config, update_mask: update_mask do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object - client.update_attributes_config ::Google::Cloud::Retail::V2::UpdateAttributesConfigRequest.new(attributes_config: attributes_config, update_mask: update_mask) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use hash object with options - client.update_attributes_config({ attributes_config: attributes_config, update_mask: update_mask }, grpc_options) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object with options - client.update_attributes_config(::Google::Cloud::Retail::V2::UpdateAttributesConfigRequest.new(attributes_config: attributes_config, update_mask: update_mask), grpc_options) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Verify method calls - assert_equal 5, update_attributes_config_client_stub.call_rpc_count - end - end - - def test_add_catalog_attribute - # Create GRPC objects. - grpc_response = ::Google::Cloud::Retail::V2::AttributesConfig.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. - attributes_config = "hello world" - catalog_attribute = {} - - add_catalog_attribute_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :add_catalog_attribute, name - assert_kind_of ::Google::Cloud::Retail::V2::AddCatalogAttributeRequest, request - assert_equal "hello world", request["attributes_config"] - assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::Retail::V2::CatalogAttribute), request["catalog_attribute"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, add_catalog_attribute_client_stub do - # Create client - client = ::Google::Cloud::Retail::V2::CatalogService::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.add_catalog_attribute({ attributes_config: attributes_config, catalog_attribute: catalog_attribute }) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use named arguments - client.add_catalog_attribute attributes_config: attributes_config, catalog_attribute: catalog_attribute do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object - client.add_catalog_attribute ::Google::Cloud::Retail::V2::AddCatalogAttributeRequest.new(attributes_config: attributes_config, catalog_attribute: catalog_attribute) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use hash object with options - client.add_catalog_attribute({ attributes_config: attributes_config, catalog_attribute: catalog_attribute }, grpc_options) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object with options - client.add_catalog_attribute(::Google::Cloud::Retail::V2::AddCatalogAttributeRequest.new(attributes_config: attributes_config, catalog_attribute: catalog_attribute), grpc_options) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Verify method calls - assert_equal 5, add_catalog_attribute_client_stub.call_rpc_count - end - end - - def test_remove_catalog_attribute - # Create GRPC objects. - grpc_response = ::Google::Cloud::Retail::V2::AttributesConfig.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. - attributes_config = "hello world" - key = "hello world" - - remove_catalog_attribute_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :remove_catalog_attribute, name - assert_kind_of ::Google::Cloud::Retail::V2::RemoveCatalogAttributeRequest, request - assert_equal "hello world", request["attributes_config"] - assert_equal "hello world", request["key"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, remove_catalog_attribute_client_stub do - # Create client - client = ::Google::Cloud::Retail::V2::CatalogService::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.remove_catalog_attribute({ attributes_config: attributes_config, key: key }) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use named arguments - client.remove_catalog_attribute attributes_config: attributes_config, key: key do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object - client.remove_catalog_attribute ::Google::Cloud::Retail::V2::RemoveCatalogAttributeRequest.new(attributes_config: attributes_config, key: key) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use hash object with options - client.remove_catalog_attribute({ attributes_config: attributes_config, key: key }, grpc_options) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object with options - client.remove_catalog_attribute(::Google::Cloud::Retail::V2::RemoveCatalogAttributeRequest.new(attributes_config: attributes_config, key: key), grpc_options) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Verify method calls - assert_equal 5, remove_catalog_attribute_client_stub.call_rpc_count - end - end - - def test_replace_catalog_attribute - # Create GRPC objects. - grpc_response = ::Google::Cloud::Retail::V2::AttributesConfig.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. - attributes_config = "hello world" - catalog_attribute = {} - update_mask = {} - - replace_catalog_attribute_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :replace_catalog_attribute, name - assert_kind_of ::Google::Cloud::Retail::V2::ReplaceCatalogAttributeRequest, request - assert_equal "hello world", request["attributes_config"] - assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::Retail::V2::CatalogAttribute), request["catalog_attribute"] - assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Protobuf::FieldMask), request["update_mask"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, replace_catalog_attribute_client_stub do - # Create client - client = ::Google::Cloud::Retail::V2::CatalogService::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.replace_catalog_attribute({ attributes_config: attributes_config, catalog_attribute: catalog_attribute, update_mask: update_mask }) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use named arguments - client.replace_catalog_attribute attributes_config: attributes_config, catalog_attribute: catalog_attribute, update_mask: update_mask do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object - client.replace_catalog_attribute ::Google::Cloud::Retail::V2::ReplaceCatalogAttributeRequest.new(attributes_config: attributes_config, catalog_attribute: catalog_attribute, update_mask: update_mask) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use hash object with options - client.replace_catalog_attribute({ attributes_config: attributes_config, catalog_attribute: catalog_attribute, update_mask: update_mask }, grpc_options) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object with options - client.replace_catalog_attribute(::Google::Cloud::Retail::V2::ReplaceCatalogAttributeRequest.new(attributes_config: attributes_config, catalog_attribute: catalog_attribute, update_mask: update_mask), grpc_options) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Verify method calls - assert_equal 5, replace_catalog_attribute_client_stub.call_rpc_count - end - end - - def test_configure - grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - - client = block_config = config = nil - dummy_stub = ClientStub.new nil, nil - Gapic::ServiceStub.stub :new, dummy_stub do - client = ::Google::Cloud::Retail::V2::CatalogService::Client.new do |config| - config.credentials = grpc_channel - end - end - - config = client.configure do |c| - block_config = c - end - - assert_same block_config, config - assert_kind_of ::Google::Cloud::Retail::V2::CatalogService::Client::Configuration, config - end - - def test_credentials - key = OpenSSL::PKey::RSA.new 2048 - cred_json = { - "private_key" => key.to_pem, - "client_email" => "app@developer.gserviceaccount.com", - "type" => "service_account" - } - key_file = StringIO.new cred_json.to_json - creds = Google::Auth::ServiceAccountCredentials.make_creds({ json_key_io: key_file }) - - dummy_stub = ClientStub.new nil, nil - Gapic::ServiceStub.stub :new, dummy_stub do - client = ::Google::Cloud::Retail::V2::CatalogService::Client.new do |config| - config.credentials = creds - end - assert_kind_of ::Google::Cloud::Retail::V2::CatalogService::Client, client - assert_equal creds, client.configure.credentials - end - end -end diff --git a/owl-bot-staging/google-cloud-retail-v2/test/google/cloud/retail/v2/completion_service_operations_test.rb b/owl-bot-staging/google-cloud-retail-v2/test/google/cloud/retail/v2/completion_service_operations_test.rb deleted file mode 100644 index cf6f4f6ee7bf..000000000000 --- a/owl-bot-staging/google-cloud-retail-v2/test/google/cloud/retail/v2/completion_service_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/cloud/retail/v2/completion_service_pb" -require "google/cloud/retail/v2/completion_service_services_pb" -require "google/cloud/retail/v2/completion_service" - -class ::Google::Cloud::Retail::V2::CompletionService::OperationsTest < Minitest::Test - class ClientStub - attr_accessor :call_rpc_count, :requests - - def initialize response, operation, &block - @response = response - @operation = operation - @block = block - @call_rpc_count = 0 - @requests = [] - end - - def call_rpc *args, **kwargs - @call_rpc_count += 1 - - @requests << @block&.call(*args, **kwargs) - - catch :response do - yield @response, @operation if block_given? - @response - end - end - - def endpoint - "endpoint.example.com" - end - - def universe_domain - "example.com" - end - - def stub_logger - nil - end - - def logger - nil - end - end - - def test_list_operations - # Create GRPC objects. - grpc_response = ::Google::Longrunning::ListOperationsResponse.new - grpc_operation = GRPC::ActiveCall::Operation.new nil - grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - grpc_options = {} - - # Create request parameters for a unary method. - name = "hello world" - filter = "hello world" - page_size = 42 - page_token = "hello world" - return_partial_success = true - - list_operations_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :list_operations, name - assert_kind_of ::Google::Longrunning::ListOperationsRequest, request - assert_equal "hello world", request["name"] - assert_equal "hello world", request["filter"] - assert_equal 42, request["page_size"] - assert_equal "hello world", request["page_token"] - assert_equal true, request["return_partial_success"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, list_operations_client_stub do - # Create client - client = ::Google::Cloud::Retail::V2::CompletionService::Operations.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.list_operations({ name: name, filter: filter, page_size: page_size, page_token: page_token, return_partial_success: return_partial_success }) do |response, operation| - assert_kind_of Gapic::PagedEnumerable, response - assert_equal grpc_response, response.response - assert_equal grpc_operation, operation - end - - # Use named arguments - client.list_operations name: name, filter: filter, page_size: page_size, page_token: page_token, return_partial_success: return_partial_success do |response, operation| - assert_kind_of Gapic::PagedEnumerable, response - assert_equal grpc_response, response.response - assert_equal grpc_operation, operation - end - - # Use protobuf object - client.list_operations ::Google::Longrunning::ListOperationsRequest.new(name: name, filter: filter, page_size: page_size, page_token: page_token, return_partial_success: return_partial_success) do |response, operation| - assert_kind_of Gapic::PagedEnumerable, response - assert_equal grpc_response, response.response - assert_equal grpc_operation, operation - end - - # Use hash object with options - client.list_operations({ name: name, filter: filter, page_size: page_size, page_token: page_token, return_partial_success: return_partial_success }, grpc_options) do |response, operation| - assert_kind_of Gapic::PagedEnumerable, response - assert_equal grpc_response, response.response - assert_equal grpc_operation, operation - end - - # Use protobuf object with options - client.list_operations(::Google::Longrunning::ListOperationsRequest.new(name: name, filter: filter, page_size: page_size, page_token: page_token, return_partial_success: return_partial_success), grpc_options) do |response, operation| - assert_kind_of Gapic::PagedEnumerable, response - assert_equal grpc_response, response.response - assert_equal grpc_operation, operation - end - - # Verify method calls - assert_equal 5, list_operations_client_stub.call_rpc_count - end - end - - def test_get_operation - # Create GRPC objects. - grpc_response = ::Google::Longrunning::Operation.new - grpc_operation = GRPC::ActiveCall::Operation.new nil - grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - grpc_options = {} - - # Create request parameters for a unary method. - name = "hello world" - - get_operation_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :get_operation, name - assert_kind_of ::Google::Longrunning::GetOperationRequest, request - assert_equal "hello world", request["name"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, get_operation_client_stub do - # Create client - client = ::Google::Cloud::Retail::V2::CompletionService::Operations.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.get_operation({ name: name }) do |response, operation| - assert_kind_of Gapic::Operation, response - assert_equal grpc_response, response.grpc_op - assert_equal grpc_operation, operation - end - - # Use named arguments - client.get_operation name: name do |response, operation| - assert_kind_of Gapic::Operation, response - assert_equal grpc_response, response.grpc_op - assert_equal grpc_operation, operation - end - - # Use protobuf object - client.get_operation ::Google::Longrunning::GetOperationRequest.new(name: name) do |response, operation| - assert_kind_of Gapic::Operation, response - assert_equal grpc_response, response.grpc_op - assert_equal grpc_operation, operation - end - - # Use hash object with options - client.get_operation({ name: name }, grpc_options) do |response, operation| - assert_kind_of Gapic::Operation, response - assert_equal grpc_response, response.grpc_op - assert_equal grpc_operation, operation - end - - # Use protobuf object with options - client.get_operation(::Google::Longrunning::GetOperationRequest.new(name: name), grpc_options) do |response, operation| - assert_kind_of Gapic::Operation, response - assert_equal grpc_response, response.grpc_op - assert_equal grpc_operation, operation - end - - # Verify method calls - assert_equal 5, get_operation_client_stub.call_rpc_count - end - end - - def test_delete_operation - # Create GRPC objects. - grpc_response = ::Google::Protobuf::Empty.new - grpc_operation = GRPC::ActiveCall::Operation.new nil - grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - grpc_options = {} - - # Create request parameters for a unary method. - name = "hello world" - - delete_operation_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :delete_operation, name - assert_kind_of ::Google::Longrunning::DeleteOperationRequest, request - assert_equal "hello world", request["name"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, delete_operation_client_stub do - # Create client - client = ::Google::Cloud::Retail::V2::CompletionService::Operations.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.delete_operation({ name: name }) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use named arguments - client.delete_operation name: name do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object - client.delete_operation ::Google::Longrunning::DeleteOperationRequest.new(name: name) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use hash object with options - client.delete_operation({ name: name }, grpc_options) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object with options - client.delete_operation(::Google::Longrunning::DeleteOperationRequest.new(name: name), grpc_options) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Verify method calls - assert_equal 5, delete_operation_client_stub.call_rpc_count - end - end - - def test_cancel_operation - # Create GRPC objects. - grpc_response = ::Google::Protobuf::Empty.new - grpc_operation = GRPC::ActiveCall::Operation.new nil - grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - grpc_options = {} - - # Create request parameters for a unary method. - name = "hello world" - - cancel_operation_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :cancel_operation, name - assert_kind_of ::Google::Longrunning::CancelOperationRequest, request - assert_equal "hello world", request["name"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, cancel_operation_client_stub do - # Create client - client = ::Google::Cloud::Retail::V2::CompletionService::Operations.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.cancel_operation({ name: name }) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use named arguments - client.cancel_operation name: name do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object - client.cancel_operation ::Google::Longrunning::CancelOperationRequest.new(name: name) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use hash object with options - client.cancel_operation({ name: name }, grpc_options) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object with options - client.cancel_operation(::Google::Longrunning::CancelOperationRequest.new(name: name), grpc_options) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Verify method calls - assert_equal 5, cancel_operation_client_stub.call_rpc_count - end - end - - def test_wait_operation - # Create GRPC objects. - grpc_response = ::Google::Longrunning::Operation.new - grpc_operation = GRPC::ActiveCall::Operation.new nil - grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - grpc_options = {} - - # Create request parameters for a unary method. - name = "hello world" - timeout = {} - - wait_operation_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :wait_operation, name - assert_kind_of ::Google::Longrunning::WaitOperationRequest, request - assert_equal "hello world", request["name"] - assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Protobuf::Duration), request["timeout"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, wait_operation_client_stub do - # Create client - client = ::Google::Cloud::Retail::V2::CompletionService::Operations.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.wait_operation({ name: name, timeout: timeout }) do |response, operation| - assert_kind_of Gapic::Operation, response - assert_equal grpc_response, response.grpc_op - assert_equal grpc_operation, operation - end - - # Use named arguments - client.wait_operation name: name, timeout: timeout do |response, operation| - assert_kind_of Gapic::Operation, response - assert_equal grpc_response, response.grpc_op - assert_equal grpc_operation, operation - end - - # Use protobuf object - client.wait_operation ::Google::Longrunning::WaitOperationRequest.new(name: name, timeout: timeout) do |response, operation| - assert_kind_of Gapic::Operation, response - assert_equal grpc_response, response.grpc_op - assert_equal grpc_operation, operation - end - - # Use hash object with options - client.wait_operation({ name: name, timeout: timeout }, grpc_options) do |response, operation| - assert_kind_of Gapic::Operation, response - assert_equal grpc_response, response.grpc_op - assert_equal grpc_operation, operation - end - - # Use protobuf object with options - client.wait_operation(::Google::Longrunning::WaitOperationRequest.new(name: name, timeout: timeout), grpc_options) do |response, operation| - assert_kind_of Gapic::Operation, response - assert_equal grpc_response, response.grpc_op - assert_equal grpc_operation, operation - end - - # Verify method calls - assert_equal 5, wait_operation_client_stub.call_rpc_count - end - end - - def test_configure - grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - - client = block_config = config = nil - dummy_stub = ClientStub.new nil, nil - Gapic::ServiceStub.stub :new, dummy_stub do - client = ::Google::Cloud::Retail::V2::CompletionService::Operations.new do |config| - config.credentials = grpc_channel - end - end - - config = client.configure do |c| - block_config = c - end - - assert_same block_config, config - assert_kind_of ::Google::Cloud::Retail::V2::CompletionService::Operations::Configuration, config - end -end diff --git a/owl-bot-staging/google-cloud-retail-v2/test/google/cloud/retail/v2/completion_service_paths_test.rb b/owl-bot-staging/google-cloud-retail-v2/test/google/cloud/retail/v2/completion_service_paths_test.rb deleted file mode 100644 index 1fdf7e2de46a..000000000000 --- a/owl-bot-staging/google-cloud-retail-v2/test/google/cloud/retail/v2/completion_service_paths_test.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 "helper" - -require "gapic/grpc/service_stub" - -require "google/cloud/retail/v2/completion_service" - -class ::Google::Cloud::Retail::V2::CompletionService::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_catalog_path - grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - ::Gapic::ServiceStub.stub :new, DummyStub.new do - client = ::Google::Cloud::Retail::V2::CompletionService::Client.new do |config| - config.credentials = grpc_channel - end - - path = client.catalog_path project: "value0", location: "value1", catalog: "value2" - assert_equal "projects/value0/locations/value1/catalogs/value2", path - end - end -end diff --git a/owl-bot-staging/google-cloud-retail-v2/test/google/cloud/retail/v2/completion_service_rest_test.rb b/owl-bot-staging/google-cloud-retail-v2/test/google/cloud/retail/v2/completion_service_rest_test.rb deleted file mode 100644 index 8e7fbac8d56d..000000000000 --- a/owl-bot-staging/google-cloud-retail-v2/test/google/cloud/retail/v2/completion_service_rest_test.rb +++ /dev/null @@ -1,217 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -require "helper" -require "gapic/rest" -require "google/cloud/retail/v2/completion_service_pb" -require "google/cloud/retail/v2/completion_service/rest" - - -class ::Google::Cloud::Retail::V2::CompletionService::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_complete_query - # Create test objects. - client_result = ::Google::Cloud::Retail::V2::CompleteQueryResponse.new - http_response = OpenStruct.new body: client_result.to_json - - call_options = {} - - # Create request parameters for a unary method. - catalog = "hello world" - query = "hello world" - visitor_id = "hello world" - language_codes = ["hello world"] - device_type = "hello world" - dataset = "hello world" - max_suggestions = 42 - enable_attribute_suggestions = true - entity = "hello world" - - complete_query_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| - assert options.metadata.key? :"x-goog-api-client" - assert options.metadata[:"x-goog-api-client"].include? "rest" - refute options.metadata[:"x-goog-api-client"].include? "grpc" - end - - ::Google::Cloud::Retail::V2::CompletionService::Rest::ServiceStub.stub :transcode_complete_query_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, complete_query_client_stub do - # Create client - client = ::Google::Cloud::Retail::V2::CompletionService::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - client.complete_query({ catalog: catalog, query: query, visitor_id: visitor_id, language_codes: language_codes, device_type: device_type, dataset: dataset, max_suggestions: max_suggestions, enable_attribute_suggestions: enable_attribute_suggestions, entity: entity }) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use named arguments - client.complete_query catalog: catalog, query: query, visitor_id: visitor_id, language_codes: language_codes, device_type: device_type, dataset: dataset, max_suggestions: max_suggestions, enable_attribute_suggestions: enable_attribute_suggestions, entity: entity do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object - client.complete_query ::Google::Cloud::Retail::V2::CompleteQueryRequest.new(catalog: catalog, query: query, visitor_id: visitor_id, language_codes: language_codes, device_type: device_type, dataset: dataset, max_suggestions: max_suggestions, enable_attribute_suggestions: enable_attribute_suggestions, entity: entity) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use hash object with options - client.complete_query({ catalog: catalog, query: query, visitor_id: visitor_id, language_codes: language_codes, device_type: device_type, dataset: dataset, max_suggestions: max_suggestions, enable_attribute_suggestions: enable_attribute_suggestions, entity: entity }, call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object with options - client.complete_query(::Google::Cloud::Retail::V2::CompleteQueryRequest.new(catalog: catalog, query: query, visitor_id: visitor_id, language_codes: language_codes, device_type: device_type, dataset: dataset, max_suggestions: max_suggestions, enable_attribute_suggestions: enable_attribute_suggestions, entity: entity), call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Verify method calls - assert_equal 5, complete_query_client_stub.call_count - end - end - end - - def test_import_completion_data - # 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" - input_config = {} - notification_pubsub_topic = "hello world" - - import_completion_data_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| - assert options.metadata.key? :"x-goog-api-client" - assert options.metadata[:"x-goog-api-client"].include? "rest" - refute options.metadata[:"x-goog-api-client"].include? "grpc" - end - - ::Google::Cloud::Retail::V2::CompletionService::Rest::ServiceStub.stub :transcode_import_completion_data_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, import_completion_data_client_stub do - # Create client - client = ::Google::Cloud::Retail::V2::CompletionService::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - client.import_completion_data({ parent: parent, input_config: input_config, notification_pubsub_topic: notification_pubsub_topic }) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use named arguments - client.import_completion_data parent: parent, input_config: input_config, notification_pubsub_topic: notification_pubsub_topic do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object - client.import_completion_data ::Google::Cloud::Retail::V2::ImportCompletionDataRequest.new(parent: parent, input_config: input_config, notification_pubsub_topic: notification_pubsub_topic) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use hash object with options - client.import_completion_data({ parent: parent, input_config: input_config, notification_pubsub_topic: notification_pubsub_topic }, call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object with options - client.import_completion_data(::Google::Cloud::Retail::V2::ImportCompletionDataRequest.new(parent: parent, input_config: input_config, notification_pubsub_topic: notification_pubsub_topic), call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Verify method calls - assert_equal 5, import_completion_data_client_stub.call_count - end - end - end - - def test_configure - credentials_token = :dummy_value - - client = block_config = config = nil - dummy_stub = ClientStub.new nil - Gapic::Rest::ClientStub.stub :new, dummy_stub do - client = ::Google::Cloud::Retail::V2::CompletionService::Rest::Client.new do |config| - config.credentials = credentials_token - end - end - - config = client.configure do |c| - block_config = c - end - - assert_same block_config, config - assert_kind_of ::Google::Cloud::Retail::V2::CompletionService::Rest::Client::Configuration, config - end -end diff --git a/owl-bot-staging/google-cloud-retail-v2/test/google/cloud/retail/v2/completion_service_test.rb b/owl-bot-staging/google-cloud-retail-v2/test/google/cloud/retail/v2/completion_service_test.rb deleted file mode 100644 index dd4f6de59807..000000000000 --- a/owl-bot-staging/google-cloud-retail-v2/test/google/cloud/retail/v2/completion_service_test.rb +++ /dev/null @@ -1,259 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -require "helper" - -require "gapic/grpc/service_stub" - -require "google/cloud/retail/v2/completion_service_pb" -require "google/cloud/retail/v2/completion_service" - -class ::Google::Cloud::Retail::V2::CompletionService::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_complete_query - # Create GRPC objects. - grpc_response = ::Google::Cloud::Retail::V2::CompleteQueryResponse.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. - catalog = "hello world" - query = "hello world" - visitor_id = "hello world" - language_codes = ["hello world"] - device_type = "hello world" - dataset = "hello world" - max_suggestions = 42 - enable_attribute_suggestions = true - entity = "hello world" - - complete_query_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :complete_query, name - assert_kind_of ::Google::Cloud::Retail::V2::CompleteQueryRequest, request - assert_equal "hello world", request["catalog"] - assert_equal "hello world", request["query"] - assert_equal "hello world", request["visitor_id"] - assert_equal ["hello world"], request["language_codes"] - assert_equal "hello world", request["device_type"] - assert_equal "hello world", request["dataset"] - assert_equal 42, request["max_suggestions"] - assert_equal true, request["enable_attribute_suggestions"] - assert_equal "hello world", request["entity"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, complete_query_client_stub do - # Create client - client = ::Google::Cloud::Retail::V2::CompletionService::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.complete_query({ catalog: catalog, query: query, visitor_id: visitor_id, language_codes: language_codes, device_type: device_type, dataset: dataset, max_suggestions: max_suggestions, enable_attribute_suggestions: enable_attribute_suggestions, entity: entity }) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use named arguments - client.complete_query catalog: catalog, query: query, visitor_id: visitor_id, language_codes: language_codes, device_type: device_type, dataset: dataset, max_suggestions: max_suggestions, enable_attribute_suggestions: enable_attribute_suggestions, entity: entity do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object - client.complete_query ::Google::Cloud::Retail::V2::CompleteQueryRequest.new(catalog: catalog, query: query, visitor_id: visitor_id, language_codes: language_codes, device_type: device_type, dataset: dataset, max_suggestions: max_suggestions, enable_attribute_suggestions: enable_attribute_suggestions, entity: entity) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use hash object with options - client.complete_query({ catalog: catalog, query: query, visitor_id: visitor_id, language_codes: language_codes, device_type: device_type, dataset: dataset, max_suggestions: max_suggestions, enable_attribute_suggestions: enable_attribute_suggestions, entity: entity }, grpc_options) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object with options - client.complete_query(::Google::Cloud::Retail::V2::CompleteQueryRequest.new(catalog: catalog, query: query, visitor_id: visitor_id, language_codes: language_codes, device_type: device_type, dataset: dataset, max_suggestions: max_suggestions, enable_attribute_suggestions: enable_attribute_suggestions, entity: entity), grpc_options) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Verify method calls - assert_equal 5, complete_query_client_stub.call_rpc_count - end - end - - def test_import_completion_data - # 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" - input_config = {} - notification_pubsub_topic = "hello world" - - import_completion_data_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :import_completion_data, name - assert_kind_of ::Google::Cloud::Retail::V2::ImportCompletionDataRequest, request - assert_equal "hello world", request["parent"] - assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::Retail::V2::CompletionDataInputConfig), request["input_config"] - assert_equal "hello world", request["notification_pubsub_topic"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, import_completion_data_client_stub do - # Create client - client = ::Google::Cloud::Retail::V2::CompletionService::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.import_completion_data({ parent: parent, input_config: input_config, notification_pubsub_topic: notification_pubsub_topic }) 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.import_completion_data parent: parent, input_config: input_config, notification_pubsub_topic: notification_pubsub_topic 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.import_completion_data ::Google::Cloud::Retail::V2::ImportCompletionDataRequest.new(parent: parent, input_config: input_config, notification_pubsub_topic: notification_pubsub_topic) 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.import_completion_data({ parent: parent, input_config: input_config, notification_pubsub_topic: notification_pubsub_topic }, 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.import_completion_data(::Google::Cloud::Retail::V2::ImportCompletionDataRequest.new(parent: parent, input_config: input_config, notification_pubsub_topic: notification_pubsub_topic), 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, import_completion_data_client_stub.call_rpc_count - end - end - - def test_configure - grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - - client = block_config = config = nil - dummy_stub = ClientStub.new nil, nil - Gapic::ServiceStub.stub :new, dummy_stub do - client = ::Google::Cloud::Retail::V2::CompletionService::Client.new do |config| - config.credentials = grpc_channel - end - end - - config = client.configure do |c| - block_config = c - end - - assert_same block_config, config - assert_kind_of ::Google::Cloud::Retail::V2::CompletionService::Client::Configuration, config - end - - def test_credentials - key = OpenSSL::PKey::RSA.new 2048 - cred_json = { - "private_key" => key.to_pem, - "client_email" => "app@developer.gserviceaccount.com", - "type" => "service_account" - } - key_file = StringIO.new cred_json.to_json - creds = Google::Auth::ServiceAccountCredentials.make_creds({ json_key_io: key_file }) - - dummy_stub = ClientStub.new nil, nil - Gapic::ServiceStub.stub :new, dummy_stub do - client = ::Google::Cloud::Retail::V2::CompletionService::Client.new do |config| - config.credentials = creds - end - assert_kind_of ::Google::Cloud::Retail::V2::CompletionService::Client, client - assert_equal creds, client.configure.credentials - end - end - - def test_operations_client - grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - - client = nil - dummy_stub = ClientStub.new nil, nil - Gapic::ServiceStub.stub :new, dummy_stub do - client = ::Google::Cloud::Retail::V2::CompletionService::Client.new do |config| - config.credentials = grpc_channel - end - end - - assert_kind_of ::Google::Cloud::Retail::V2::CompletionService::Operations, client.operations_client - end -end diff --git a/owl-bot-staging/google-cloud-retail-v2/test/google/cloud/retail/v2/control_service_paths_test.rb b/owl-bot-staging/google-cloud-retail-v2/test/google/cloud/retail/v2/control_service_paths_test.rb deleted file mode 100644 index 3a2ba3c8bc0f..000000000000 --- a/owl-bot-staging/google-cloud-retail-v2/test/google/cloud/retail/v2/control_service_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/cloud/retail/v2/control_service" - -class ::Google::Cloud::Retail::V2::ControlService::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_catalog_path - grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - ::Gapic::ServiceStub.stub :new, DummyStub.new do - client = ::Google::Cloud::Retail::V2::ControlService::Client.new do |config| - config.credentials = grpc_channel - end - - path = client.catalog_path project: "value0", location: "value1", catalog: "value2" - assert_equal "projects/value0/locations/value1/catalogs/value2", path - end - end - - def test_control_path - grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - ::Gapic::ServiceStub.stub :new, DummyStub.new do - client = ::Google::Cloud::Retail::V2::ControlService::Client.new do |config| - config.credentials = grpc_channel - end - - path = client.control_path project: "value0", location: "value1", catalog: "value2", control: "value3" - assert_equal "projects/value0/locations/value1/catalogs/value2/controls/value3", path - end - end -end diff --git a/owl-bot-staging/google-cloud-retail-v2/test/google/cloud/retail/v2/control_service_rest_test.rb b/owl-bot-staging/google-cloud-retail-v2/test/google/cloud/retail/v2/control_service_rest_test.rb deleted file mode 100644 index 3bc359d864c3..000000000000 --- a/owl-bot-staging/google-cloud-retail-v2/test/google/cloud/retail/v2/control_service_rest_test.rb +++ /dev/null @@ -1,375 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -require "helper" -require "gapic/rest" -require "google/cloud/retail/v2/control_service_pb" -require "google/cloud/retail/v2/control_service/rest" - - -class ::Google::Cloud::Retail::V2::ControlService::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_control - # Create test objects. - client_result = ::Google::Cloud::Retail::V2::Control.new - http_response = OpenStruct.new body: client_result.to_json - - call_options = {} - - # Create request parameters for a unary method. - parent = "hello world" - control = {} - control_id = "hello world" - - create_control_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| - assert options.metadata.key? :"x-goog-api-client" - assert options.metadata[:"x-goog-api-client"].include? "rest" - refute options.metadata[:"x-goog-api-client"].include? "grpc" - end - - ::Google::Cloud::Retail::V2::ControlService::Rest::ServiceStub.stub :transcode_create_control_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, create_control_client_stub do - # Create client - client = ::Google::Cloud::Retail::V2::ControlService::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - client.create_control({ parent: parent, control: control, control_id: control_id }) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use named arguments - client.create_control parent: parent, control: control, control_id: control_id do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object - client.create_control ::Google::Cloud::Retail::V2::CreateControlRequest.new(parent: parent, control: control, control_id: control_id) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use hash object with options - client.create_control({ parent: parent, control: control, control_id: control_id }, call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object with options - client.create_control(::Google::Cloud::Retail::V2::CreateControlRequest.new(parent: parent, control: control, control_id: control_id), call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Verify method calls - assert_equal 5, create_control_client_stub.call_count - end - end - end - - def test_delete_control - # Create test objects. - client_result = ::Google::Protobuf::Empty.new - http_response = OpenStruct.new body: client_result.to_json - - call_options = {} - - # Create request parameters for a unary method. - name = "hello world" - - delete_control_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| - assert options.metadata.key? :"x-goog-api-client" - assert options.metadata[:"x-goog-api-client"].include? "rest" - refute options.metadata[:"x-goog-api-client"].include? "grpc" - end - - ::Google::Cloud::Retail::V2::ControlService::Rest::ServiceStub.stub :transcode_delete_control_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, delete_control_client_stub do - # Create client - client = ::Google::Cloud::Retail::V2::ControlService::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - client.delete_control({ name: name }) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use named arguments - client.delete_control name: name do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object - client.delete_control ::Google::Cloud::Retail::V2::DeleteControlRequest.new(name: name) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use hash object with options - client.delete_control({ name: name }, call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object with options - client.delete_control(::Google::Cloud::Retail::V2::DeleteControlRequest.new(name: name), call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Verify method calls - assert_equal 5, delete_control_client_stub.call_count - end - end - end - - def test_update_control - # Create test objects. - client_result = ::Google::Cloud::Retail::V2::Control.new - http_response = OpenStruct.new body: client_result.to_json - - call_options = {} - - # Create request parameters for a unary method. - control = {} - update_mask = {} - - update_control_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| - assert options.metadata.key? :"x-goog-api-client" - assert options.metadata[:"x-goog-api-client"].include? "rest" - refute options.metadata[:"x-goog-api-client"].include? "grpc" - end - - ::Google::Cloud::Retail::V2::ControlService::Rest::ServiceStub.stub :transcode_update_control_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, update_control_client_stub do - # Create client - client = ::Google::Cloud::Retail::V2::ControlService::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - client.update_control({ control: control, update_mask: update_mask }) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use named arguments - client.update_control control: control, update_mask: update_mask do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object - client.update_control ::Google::Cloud::Retail::V2::UpdateControlRequest.new(control: control, update_mask: update_mask) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use hash object with options - client.update_control({ control: control, update_mask: update_mask }, call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object with options - client.update_control(::Google::Cloud::Retail::V2::UpdateControlRequest.new(control: control, update_mask: update_mask), call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Verify method calls - assert_equal 5, update_control_client_stub.call_count - end - end - end - - def test_get_control - # Create test objects. - client_result = ::Google::Cloud::Retail::V2::Control.new - http_response = OpenStruct.new body: client_result.to_json - - call_options = {} - - # Create request parameters for a unary method. - name = "hello world" - - get_control_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| - assert options.metadata.key? :"x-goog-api-client" - assert options.metadata[:"x-goog-api-client"].include? "rest" - refute options.metadata[:"x-goog-api-client"].include? "grpc" - end - - ::Google::Cloud::Retail::V2::ControlService::Rest::ServiceStub.stub :transcode_get_control_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, get_control_client_stub do - # Create client - client = ::Google::Cloud::Retail::V2::ControlService::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - client.get_control({ name: name }) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use named arguments - client.get_control name: name do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object - client.get_control ::Google::Cloud::Retail::V2::GetControlRequest.new(name: name) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use hash object with options - client.get_control({ name: name }, call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object with options - client.get_control(::Google::Cloud::Retail::V2::GetControlRequest.new(name: name), call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Verify method calls - assert_equal 5, get_control_client_stub.call_count - end - end - end - - def test_list_controls - # Create test objects. - client_result = ::Google::Cloud::Retail::V2::ListControlsResponse.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_controls_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| - assert options.metadata.key? :"x-goog-api-client" - assert options.metadata[:"x-goog-api-client"].include? "rest" - refute options.metadata[:"x-goog-api-client"].include? "grpc" - end - - ::Google::Cloud::Retail::V2::ControlService::Rest::ServiceStub.stub :transcode_list_controls_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, list_controls_client_stub do - # Create client - client = ::Google::Cloud::Retail::V2::ControlService::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - client.list_controls({ 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_controls 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_controls ::Google::Cloud::Retail::V2::ListControlsRequest.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_controls({ 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_controls(::Google::Cloud::Retail::V2::ListControlsRequest.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_controls_client_stub.call_count - end - end - end - - def test_configure - credentials_token = :dummy_value - - client = block_config = config = nil - dummy_stub = ClientStub.new nil - Gapic::Rest::ClientStub.stub :new, dummy_stub do - client = ::Google::Cloud::Retail::V2::ControlService::Rest::Client.new do |config| - config.credentials = credentials_token - end - end - - config = client.configure do |c| - block_config = c - end - - assert_same block_config, config - assert_kind_of ::Google::Cloud::Retail::V2::ControlService::Rest::Client::Configuration, config - end -end diff --git a/owl-bot-staging/google-cloud-retail-v2/test/google/cloud/retail/v2/control_service_test.rb b/owl-bot-staging/google-cloud-retail-v2/test/google/cloud/retail/v2/control_service_test.rb deleted file mode 100644 index 0a9d24f2adf0..000000000000 --- a/owl-bot-staging/google-cloud-retail-v2/test/google/cloud/retail/v2/control_service_test.rb +++ /dev/null @@ -1,411 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -require "helper" - -require "gapic/grpc/service_stub" - -require "google/cloud/retail/v2/control_service_pb" -require "google/cloud/retail/v2/control_service" - -class ::Google::Cloud::Retail::V2::ControlService::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_control - # Create GRPC objects. - grpc_response = ::Google::Cloud::Retail::V2::Control.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" - control = {} - control_id = "hello world" - - create_control_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :create_control, name - assert_kind_of ::Google::Cloud::Retail::V2::CreateControlRequest, request - assert_equal "hello world", request["parent"] - assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::Retail::V2::Control), request["control"] - assert_equal "hello world", request["control_id"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, create_control_client_stub do - # Create client - client = ::Google::Cloud::Retail::V2::ControlService::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.create_control({ parent: parent, control: control, control_id: control_id }) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use named arguments - client.create_control parent: parent, control: control, control_id: control_id do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object - client.create_control ::Google::Cloud::Retail::V2::CreateControlRequest.new(parent: parent, control: control, control_id: control_id) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use hash object with options - client.create_control({ parent: parent, control: control, control_id: control_id }, grpc_options) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object with options - client.create_control(::Google::Cloud::Retail::V2::CreateControlRequest.new(parent: parent, control: control, control_id: control_id), grpc_options) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Verify method calls - assert_equal 5, create_control_client_stub.call_rpc_count - end - end - - def test_delete_control - # 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_control_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :delete_control, name - assert_kind_of ::Google::Cloud::Retail::V2::DeleteControlRequest, request - assert_equal "hello world", request["name"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, delete_control_client_stub do - # Create client - client = ::Google::Cloud::Retail::V2::ControlService::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.delete_control({ name: name }) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use named arguments - client.delete_control name: name do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object - client.delete_control ::Google::Cloud::Retail::V2::DeleteControlRequest.new(name: name) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use hash object with options - client.delete_control({ 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_control(::Google::Cloud::Retail::V2::DeleteControlRequest.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_control_client_stub.call_rpc_count - end - end - - def test_update_control - # Create GRPC objects. - grpc_response = ::Google::Cloud::Retail::V2::Control.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. - control = {} - update_mask = {} - - update_control_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :update_control, name - assert_kind_of ::Google::Cloud::Retail::V2::UpdateControlRequest, request - assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::Retail::V2::Control), request["control"] - assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Protobuf::FieldMask), request["update_mask"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, update_control_client_stub do - # Create client - client = ::Google::Cloud::Retail::V2::ControlService::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.update_control({ control: control, update_mask: update_mask }) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use named arguments - client.update_control control: control, update_mask: update_mask do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object - client.update_control ::Google::Cloud::Retail::V2::UpdateControlRequest.new(control: control, update_mask: update_mask) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use hash object with options - client.update_control({ control: control, update_mask: update_mask }, grpc_options) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object with options - client.update_control(::Google::Cloud::Retail::V2::UpdateControlRequest.new(control: control, update_mask: update_mask), grpc_options) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Verify method calls - assert_equal 5, update_control_client_stub.call_rpc_count - end - end - - def test_get_control - # Create GRPC objects. - grpc_response = ::Google::Cloud::Retail::V2::Control.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_control_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :get_control, name - assert_kind_of ::Google::Cloud::Retail::V2::GetControlRequest, request - assert_equal "hello world", request["name"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, get_control_client_stub do - # Create client - client = ::Google::Cloud::Retail::V2::ControlService::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.get_control({ name: name }) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use named arguments - client.get_control name: name do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object - client.get_control ::Google::Cloud::Retail::V2::GetControlRequest.new(name: name) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use hash object with options - client.get_control({ 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_control(::Google::Cloud::Retail::V2::GetControlRequest.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_control_client_stub.call_rpc_count - end - end - - def test_list_controls - # Create GRPC objects. - grpc_response = ::Google::Cloud::Retail::V2::ListControlsResponse.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_controls_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :list_controls, name - assert_kind_of ::Google::Cloud::Retail::V2::ListControlsRequest, 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_controls_client_stub do - # Create client - client = ::Google::Cloud::Retail::V2::ControlService::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.list_controls({ 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_controls 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_controls ::Google::Cloud::Retail::V2::ListControlsRequest.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_controls({ 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_controls(::Google::Cloud::Retail::V2::ListControlsRequest.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_controls_client_stub.call_rpc_count - end - end - - def test_configure - grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - - client = block_config = config = nil - dummy_stub = ClientStub.new nil, nil - Gapic::ServiceStub.stub :new, dummy_stub do - client = ::Google::Cloud::Retail::V2::ControlService::Client.new do |config| - config.credentials = grpc_channel - end - end - - config = client.configure do |c| - block_config = c - end - - assert_same block_config, config - assert_kind_of ::Google::Cloud::Retail::V2::ControlService::Client::Configuration, config - end - - def test_credentials - key = OpenSSL::PKey::RSA.new 2048 - cred_json = { - "private_key" => key.to_pem, - "client_email" => "app@developer.gserviceaccount.com", - "type" => "service_account" - } - key_file = StringIO.new cred_json.to_json - creds = Google::Auth::ServiceAccountCredentials.make_creds({ json_key_io: key_file }) - - dummy_stub = ClientStub.new nil, nil - Gapic::ServiceStub.stub :new, dummy_stub do - client = ::Google::Cloud::Retail::V2::ControlService::Client.new do |config| - config.credentials = creds - end - assert_kind_of ::Google::Cloud::Retail::V2::ControlService::Client, client - assert_equal creds, client.configure.credentials - end - end -end diff --git a/owl-bot-staging/google-cloud-retail-v2/test/google/cloud/retail/v2/conversational_search_service_paths_test.rb b/owl-bot-staging/google-cloud-retail-v2/test/google/cloud/retail/v2/conversational_search_service_paths_test.rb deleted file mode 100644 index fdef51260f2e..000000000000 --- a/owl-bot-staging/google-cloud-retail-v2/test/google/cloud/retail/v2/conversational_search_service_paths_test.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 "helper" - -require "gapic/grpc/service_stub" - -require "google/cloud/retail/v2/conversational_search_service" - -class ::Google::Cloud::Retail::V2::ConversationalSearchService::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_branch_path - grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - ::Gapic::ServiceStub.stub :new, DummyStub.new do - client = ::Google::Cloud::Retail::V2::ConversationalSearchService::Client.new do |config| - config.credentials = grpc_channel - end - - path = client.branch_path project: "value0", location: "value1", catalog: "value2", branch: "value3" - assert_equal "projects/value0/locations/value1/catalogs/value2/branches/value3", path - end - end -end diff --git a/owl-bot-staging/google-cloud-retail-v2/test/google/cloud/retail/v2/conversational_search_service_rest_test.rb b/owl-bot-staging/google-cloud-retail-v2/test/google/cloud/retail/v2/conversational_search_service_rest_test.rb deleted file mode 100644 index 43fc3af657e0..000000000000 --- a/owl-bot-staging/google-cloud-retail-v2/test/google/cloud/retail/v2/conversational_search_service_rest_test.rb +++ /dev/null @@ -1,163 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -require "helper" -require "gapic/rest" -require "google/cloud/retail/v2/conversational_search_service_pb" -require "google/cloud/retail/v2/conversational_search_service/rest" - - -class ::Google::Cloud::Retail::V2::ConversationalSearchService::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_conversational_search - # Create test objects. - client_result = ::Google::Cloud::Retail::V2::ConversationalSearchResponse.new - http_response = OpenStruct.new body: client_result.to_json - - call_options = {} - - # Create request parameters for a unary method. - placement = "hello world" - branch = "hello world" - query = "hello world" - page_categories = ["hello world"] - conversation_id = "hello world" - search_params = {} - visitor_id = "hello world" - user_info = {} - conversational_filtering_spec = {} - user_labels = {} - safety_settings = [{}] - - conversational_search_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, is_server_streaming:, method_name:| - assert options.metadata.key? :"x-goog-api-client" - assert options.metadata[:"x-goog-api-client"].include? "rest" - refute options.metadata[:"x-goog-api-client"].include? "grpc" - end - - ::Google::Cloud::Retail::V2::ConversationalSearchService::Rest::ServiceStub.stub :transcode_conversational_search_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, conversational_search_client_stub do - # Create client - client = ::Google::Cloud::Retail::V2::ConversationalSearchService::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - client.conversational_search({ placement: placement, branch: branch, query: query, page_categories: page_categories, conversation_id: conversation_id, search_params: search_params, visitor_id: visitor_id, user_info: user_info, conversational_filtering_spec: conversational_filtering_spec, user_labels: user_labels, safety_settings: safety_settings }) do |_result, response| - assert_equal http_response, response.underlying_op - end.first - - # Use named arguments - client.conversational_search placement: placement, branch: branch, query: query, page_categories: page_categories, conversation_id: conversation_id, search_params: search_params, visitor_id: visitor_id, user_info: user_info, conversational_filtering_spec: conversational_filtering_spec, user_labels: user_labels, safety_settings: safety_settings do |_result, response| - assert_equal http_response, response.underlying_op - end.first - - # Use protobuf object - client.conversational_search ::Google::Cloud::Retail::V2::ConversationalSearchRequest.new(placement: placement, branch: branch, query: query, page_categories: page_categories, conversation_id: conversation_id, search_params: search_params, visitor_id: visitor_id, user_info: user_info, conversational_filtering_spec: conversational_filtering_spec, user_labels: user_labels, safety_settings: safety_settings) do |_result, response| - assert_equal http_response, response.underlying_op - end.first - - # Use hash object with options - client.conversational_search({ placement: placement, branch: branch, query: query, page_categories: page_categories, conversation_id: conversation_id, search_params: search_params, visitor_id: visitor_id, user_info: user_info, conversational_filtering_spec: conversational_filtering_spec, user_labels: user_labels, safety_settings: safety_settings }, call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end.first - - # Use protobuf object with options - client.conversational_search(::Google::Cloud::Retail::V2::ConversationalSearchRequest.new(placement: placement, branch: branch, query: query, page_categories: page_categories, conversation_id: conversation_id, search_params: search_params, visitor_id: visitor_id, user_info: user_info, conversational_filtering_spec: conversational_filtering_spec, user_labels: user_labels, safety_settings: safety_settings), call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end.first - - # Verify method calls - assert_equal 5, conversational_search_client_stub.call_count - end - end - end - - def test_configure - credentials_token = :dummy_value - - client = block_config = config = nil - dummy_stub = ClientStub.new nil - Gapic::Rest::ClientStub.stub :new, dummy_stub do - client = ::Google::Cloud::Retail::V2::ConversationalSearchService::Rest::Client.new do |config| - config.credentials = credentials_token - end - end - - config = client.configure do |c| - block_config = c - end - - assert_same block_config, config - assert_kind_of ::Google::Cloud::Retail::V2::ConversationalSearchService::Rest::Client::Configuration, config - end -end diff --git a/owl-bot-staging/google-cloud-retail-v2/test/google/cloud/retail/v2/conversational_search_service_test.rb b/owl-bot-staging/google-cloud-retail-v2/test/google/cloud/retail/v2/conversational_search_service_test.rb deleted file mode 100644 index bceb09b9597a..000000000000 --- a/owl-bot-staging/google-cloud-retail-v2/test/google/cloud/retail/v2/conversational_search_service_test.rb +++ /dev/null @@ -1,197 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -require "helper" - -require "gapic/grpc/service_stub" - -require "google/cloud/retail/v2/conversational_search_service_pb" -require "google/cloud/retail/v2/conversational_search_service" - -class ::Google::Cloud::Retail::V2::ConversationalSearchService::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_conversational_search - # Create GRPC objects. - grpc_response = ::Google::Cloud::Retail::V2::ConversationalSearchResponse.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 server streaming method. - placement = "hello world" - branch = "hello world" - query = "hello world" - page_categories = ["hello world"] - conversation_id = "hello world" - search_params = {} - visitor_id = "hello world" - user_info = {} - conversational_filtering_spec = {} - user_labels = {} - safety_settings = [{}] - - conversational_search_client_stub = ClientStub.new [grpc_response].to_enum, grpc_operation do |name, request, options:| - assert_equal :conversational_search, name - assert_kind_of ::Google::Cloud::Retail::V2::ConversationalSearchRequest, request - assert_equal "hello world", request["placement"] - assert_equal "hello world", request["branch"] - assert_equal "hello world", request["query"] - assert_equal ["hello world"], request["page_categories"] - assert_equal "hello world", request["conversation_id"] - assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::Retail::V2::ConversationalSearchRequest::SearchParams), request["search_params"] - assert_equal "hello world", request["visitor_id"] - assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::Retail::V2::UserInfo), request["user_info"] - assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::Retail::V2::ConversationalSearchRequest::ConversationalFilteringSpec), request["conversational_filtering_spec"] - assert_equal({}, request["user_labels"].to_h) - assert_kind_of ::Google::Cloud::Retail::V2::SafetySetting, request["safety_settings"].first - refute_nil options - end - - Gapic::ServiceStub.stub :new, conversational_search_client_stub do - # Create client - client = ::Google::Cloud::Retail::V2::ConversationalSearchService::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.conversational_search({ placement: placement, branch: branch, query: query, page_categories: page_categories, conversation_id: conversation_id, search_params: search_params, visitor_id: visitor_id, user_info: user_info, conversational_filtering_spec: conversational_filtering_spec, user_labels: user_labels, safety_settings: safety_settings }) do |response, operation| - assert_kind_of Enumerable, response - response.to_a.each do |r| - assert_kind_of ::Google::Cloud::Retail::V2::ConversationalSearchResponse, r - end - assert_equal grpc_operation, operation - end - - # Use named arguments - client.conversational_search placement: placement, branch: branch, query: query, page_categories: page_categories, conversation_id: conversation_id, search_params: search_params, visitor_id: visitor_id, user_info: user_info, conversational_filtering_spec: conversational_filtering_spec, user_labels: user_labels, safety_settings: safety_settings do |response, operation| - assert_kind_of Enumerable, response - response.to_a.each do |r| - assert_kind_of ::Google::Cloud::Retail::V2::ConversationalSearchResponse, r - end - assert_equal grpc_operation, operation - end - - # Use protobuf object - client.conversational_search ::Google::Cloud::Retail::V2::ConversationalSearchRequest.new(placement: placement, branch: branch, query: query, page_categories: page_categories, conversation_id: conversation_id, search_params: search_params, visitor_id: visitor_id, user_info: user_info, conversational_filtering_spec: conversational_filtering_spec, user_labels: user_labels, safety_settings: safety_settings) do |response, operation| - assert_kind_of Enumerable, response - response.to_a.each do |r| - assert_kind_of ::Google::Cloud::Retail::V2::ConversationalSearchResponse, r - end - assert_equal grpc_operation, operation - end - - # Use hash object with options - client.conversational_search({ placement: placement, branch: branch, query: query, page_categories: page_categories, conversation_id: conversation_id, search_params: search_params, visitor_id: visitor_id, user_info: user_info, conversational_filtering_spec: conversational_filtering_spec, user_labels: user_labels, safety_settings: safety_settings }, grpc_options) do |response, operation| - assert_kind_of Enumerable, response - response.to_a.each do |r| - assert_kind_of ::Google::Cloud::Retail::V2::ConversationalSearchResponse, r - end - assert_equal grpc_operation, operation - end - - # Use protobuf object with options - client.conversational_search(::Google::Cloud::Retail::V2::ConversationalSearchRequest.new(placement: placement, branch: branch, query: query, page_categories: page_categories, conversation_id: conversation_id, search_params: search_params, visitor_id: visitor_id, user_info: user_info, conversational_filtering_spec: conversational_filtering_spec, user_labels: user_labels, safety_settings: safety_settings), grpc_options) do |response, operation| - assert_kind_of Enumerable, response - response.to_a.each do |r| - assert_kind_of ::Google::Cloud::Retail::V2::ConversationalSearchResponse, r - end - assert_equal grpc_operation, operation - end - - # Verify method calls - assert_equal 5, conversational_search_client_stub.call_rpc_count - end - end - - def test_configure - grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - - client = block_config = config = nil - dummy_stub = ClientStub.new nil, nil - Gapic::ServiceStub.stub :new, dummy_stub do - client = ::Google::Cloud::Retail::V2::ConversationalSearchService::Client.new do |config| - config.credentials = grpc_channel - end - end - - config = client.configure do |c| - block_config = c - end - - assert_same block_config, config - assert_kind_of ::Google::Cloud::Retail::V2::ConversationalSearchService::Client::Configuration, config - end - - def test_credentials - key = OpenSSL::PKey::RSA.new 2048 - cred_json = { - "private_key" => key.to_pem, - "client_email" => "app@developer.gserviceaccount.com", - "type" => "service_account" - } - key_file = StringIO.new cred_json.to_json - creds = Google::Auth::ServiceAccountCredentials.make_creds({ json_key_io: key_file }) - - dummy_stub = ClientStub.new nil, nil - Gapic::ServiceStub.stub :new, dummy_stub do - client = ::Google::Cloud::Retail::V2::ConversationalSearchService::Client.new do |config| - config.credentials = creds - end - assert_kind_of ::Google::Cloud::Retail::V2::ConversationalSearchService::Client, client - assert_equal creds, client.configure.credentials - end - end -end diff --git a/owl-bot-staging/google-cloud-retail-v2/test/google/cloud/retail/v2/generative_question_service_paths_test.rb b/owl-bot-staging/google-cloud-retail-v2/test/google/cloud/retail/v2/generative_question_service_paths_test.rb deleted file mode 100644 index 453c3660b939..000000000000 --- a/owl-bot-staging/google-cloud-retail-v2/test/google/cloud/retail/v2/generative_question_service_paths_test.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 "helper" - -require "gapic/grpc/service_stub" - -require "google/cloud/retail/v2/generative_question_service" - -class ::Google::Cloud::Retail::V2::GenerativeQuestionService::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_catalog_path - grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - ::Gapic::ServiceStub.stub :new, DummyStub.new do - client = ::Google::Cloud::Retail::V2::GenerativeQuestionService::Client.new do |config| - config.credentials = grpc_channel - end - - path = client.catalog_path project: "value0", location: "value1", catalog: "value2" - assert_equal "projects/value0/locations/value1/catalogs/value2", path - end - end -end diff --git a/owl-bot-staging/google-cloud-retail-v2/test/google/cloud/retail/v2/generative_question_service_rest_test.rb b/owl-bot-staging/google-cloud-retail-v2/test/google/cloud/retail/v2/generative_question_service_rest_test.rb deleted file mode 100644 index 81a282af9702..000000000000 --- a/owl-bot-staging/google-cloud-retail-v2/test/google/cloud/retail/v2/generative_question_service_rest_test.rb +++ /dev/null @@ -1,372 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -require "helper" -require "gapic/rest" -require "google/cloud/retail/v2/generative_question_service_pb" -require "google/cloud/retail/v2/generative_question_service/rest" - - -class ::Google::Cloud::Retail::V2::GenerativeQuestionService::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_update_generative_questions_feature_config - # Create test objects. - client_result = ::Google::Cloud::Retail::V2::GenerativeQuestionsFeatureConfig.new - http_response = OpenStruct.new body: client_result.to_json - - call_options = {} - - # Create request parameters for a unary method. - generative_questions_feature_config = {} - update_mask = {} - - update_generative_questions_feature_config_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| - assert options.metadata.key? :"x-goog-api-client" - assert options.metadata[:"x-goog-api-client"].include? "rest" - refute options.metadata[:"x-goog-api-client"].include? "grpc" - end - - ::Google::Cloud::Retail::V2::GenerativeQuestionService::Rest::ServiceStub.stub :transcode_update_generative_questions_feature_config_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, update_generative_questions_feature_config_client_stub do - # Create client - client = ::Google::Cloud::Retail::V2::GenerativeQuestionService::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - client.update_generative_questions_feature_config({ generative_questions_feature_config: generative_questions_feature_config, update_mask: update_mask }) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use named arguments - client.update_generative_questions_feature_config generative_questions_feature_config: generative_questions_feature_config, update_mask: update_mask do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object - client.update_generative_questions_feature_config ::Google::Cloud::Retail::V2::UpdateGenerativeQuestionsFeatureConfigRequest.new(generative_questions_feature_config: generative_questions_feature_config, update_mask: update_mask) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use hash object with options - client.update_generative_questions_feature_config({ generative_questions_feature_config: generative_questions_feature_config, update_mask: update_mask }, call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object with options - client.update_generative_questions_feature_config(::Google::Cloud::Retail::V2::UpdateGenerativeQuestionsFeatureConfigRequest.new(generative_questions_feature_config: generative_questions_feature_config, update_mask: update_mask), call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Verify method calls - assert_equal 5, update_generative_questions_feature_config_client_stub.call_count - end - end - end - - def test_get_generative_questions_feature_config - # Create test objects. - client_result = ::Google::Cloud::Retail::V2::GenerativeQuestionsFeatureConfig.new - http_response = OpenStruct.new body: client_result.to_json - - call_options = {} - - # Create request parameters for a unary method. - catalog = "hello world" - - get_generative_questions_feature_config_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| - assert options.metadata.key? :"x-goog-api-client" - assert options.metadata[:"x-goog-api-client"].include? "rest" - refute options.metadata[:"x-goog-api-client"].include? "grpc" - end - - ::Google::Cloud::Retail::V2::GenerativeQuestionService::Rest::ServiceStub.stub :transcode_get_generative_questions_feature_config_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, get_generative_questions_feature_config_client_stub do - # Create client - client = ::Google::Cloud::Retail::V2::GenerativeQuestionService::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - client.get_generative_questions_feature_config({ catalog: catalog }) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use named arguments - client.get_generative_questions_feature_config catalog: catalog do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object - client.get_generative_questions_feature_config ::Google::Cloud::Retail::V2::GetGenerativeQuestionsFeatureConfigRequest.new(catalog: catalog) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use hash object with options - client.get_generative_questions_feature_config({ catalog: catalog }, call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object with options - client.get_generative_questions_feature_config(::Google::Cloud::Retail::V2::GetGenerativeQuestionsFeatureConfigRequest.new(catalog: catalog), call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Verify method calls - assert_equal 5, get_generative_questions_feature_config_client_stub.call_count - end - end - end - - def test_list_generative_question_configs - # Create test objects. - client_result = ::Google::Cloud::Retail::V2::ListGenerativeQuestionConfigsResponse.new - http_response = OpenStruct.new body: client_result.to_json - - call_options = {} - - # Create request parameters for a unary method. - parent = "hello world" - - list_generative_question_configs_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| - assert options.metadata.key? :"x-goog-api-client" - assert options.metadata[:"x-goog-api-client"].include? "rest" - refute options.metadata[:"x-goog-api-client"].include? "grpc" - end - - ::Google::Cloud::Retail::V2::GenerativeQuestionService::Rest::ServiceStub.stub :transcode_list_generative_question_configs_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, list_generative_question_configs_client_stub do - # Create client - client = ::Google::Cloud::Retail::V2::GenerativeQuestionService::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - client.list_generative_question_configs({ parent: parent }) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use named arguments - client.list_generative_question_configs parent: parent do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object - client.list_generative_question_configs ::Google::Cloud::Retail::V2::ListGenerativeQuestionConfigsRequest.new(parent: parent) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use hash object with options - client.list_generative_question_configs({ parent: parent }, call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object with options - client.list_generative_question_configs(::Google::Cloud::Retail::V2::ListGenerativeQuestionConfigsRequest.new(parent: parent), call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Verify method calls - assert_equal 5, list_generative_question_configs_client_stub.call_count - end - end - end - - def test_update_generative_question_config - # Create test objects. - client_result = ::Google::Cloud::Retail::V2::GenerativeQuestionConfig.new - http_response = OpenStruct.new body: client_result.to_json - - call_options = {} - - # Create request parameters for a unary method. - generative_question_config = {} - update_mask = {} - - update_generative_question_config_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| - assert options.metadata.key? :"x-goog-api-client" - assert options.metadata[:"x-goog-api-client"].include? "rest" - refute options.metadata[:"x-goog-api-client"].include? "grpc" - end - - ::Google::Cloud::Retail::V2::GenerativeQuestionService::Rest::ServiceStub.stub :transcode_update_generative_question_config_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, update_generative_question_config_client_stub do - # Create client - client = ::Google::Cloud::Retail::V2::GenerativeQuestionService::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - client.update_generative_question_config({ generative_question_config: generative_question_config, update_mask: update_mask }) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use named arguments - client.update_generative_question_config generative_question_config: generative_question_config, update_mask: update_mask do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object - client.update_generative_question_config ::Google::Cloud::Retail::V2::UpdateGenerativeQuestionConfigRequest.new(generative_question_config: generative_question_config, update_mask: update_mask) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use hash object with options - client.update_generative_question_config({ generative_question_config: generative_question_config, update_mask: update_mask }, call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object with options - client.update_generative_question_config(::Google::Cloud::Retail::V2::UpdateGenerativeQuestionConfigRequest.new(generative_question_config: generative_question_config, update_mask: update_mask), call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Verify method calls - assert_equal 5, update_generative_question_config_client_stub.call_count - end - end - end - - def test_batch_update_generative_question_configs - # Create test objects. - client_result = ::Google::Cloud::Retail::V2::BatchUpdateGenerativeQuestionConfigsResponse.new - http_response = OpenStruct.new body: client_result.to_json - - call_options = {} - - # Create request parameters for a unary method. - parent = "hello world" - requests = [{}] - - batch_update_generative_question_configs_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| - assert options.metadata.key? :"x-goog-api-client" - assert options.metadata[:"x-goog-api-client"].include? "rest" - refute options.metadata[:"x-goog-api-client"].include? "grpc" - end - - ::Google::Cloud::Retail::V2::GenerativeQuestionService::Rest::ServiceStub.stub :transcode_batch_update_generative_question_configs_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, batch_update_generative_question_configs_client_stub do - # Create client - client = ::Google::Cloud::Retail::V2::GenerativeQuestionService::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - client.batch_update_generative_question_configs({ parent: parent, requests: requests }) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use named arguments - client.batch_update_generative_question_configs parent: parent, requests: requests do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object - client.batch_update_generative_question_configs ::Google::Cloud::Retail::V2::BatchUpdateGenerativeQuestionConfigsRequest.new(parent: parent, requests: requests) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use hash object with options - client.batch_update_generative_question_configs({ parent: parent, requests: requests }, call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object with options - client.batch_update_generative_question_configs(::Google::Cloud::Retail::V2::BatchUpdateGenerativeQuestionConfigsRequest.new(parent: parent, requests: requests), call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Verify method calls - assert_equal 5, batch_update_generative_question_configs_client_stub.call_count - end - end - end - - def test_configure - credentials_token = :dummy_value - - client = block_config = config = nil - dummy_stub = ClientStub.new nil - Gapic::Rest::ClientStub.stub :new, dummy_stub do - client = ::Google::Cloud::Retail::V2::GenerativeQuestionService::Rest::Client.new do |config| - config.credentials = credentials_token - end - end - - config = client.configure do |c| - block_config = c - end - - assert_same block_config, config - assert_kind_of ::Google::Cloud::Retail::V2::GenerativeQuestionService::Rest::Client::Configuration, config - end -end diff --git a/owl-bot-staging/google-cloud-retail-v2/test/google/cloud/retail/v2/generative_question_service_test.rb b/owl-bot-staging/google-cloud-retail-v2/test/google/cloud/retail/v2/generative_question_service_test.rb deleted file mode 100644 index 472531143e27..000000000000 --- a/owl-bot-staging/google-cloud-retail-v2/test/google/cloud/retail/v2/generative_question_service_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/cloud/retail/v2/generative_question_service_pb" -require "google/cloud/retail/v2/generative_question_service" - -class ::Google::Cloud::Retail::V2::GenerativeQuestionService::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_update_generative_questions_feature_config - # Create GRPC objects. - grpc_response = ::Google::Cloud::Retail::V2::GenerativeQuestionsFeatureConfig.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. - generative_questions_feature_config = {} - update_mask = {} - - update_generative_questions_feature_config_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :update_generative_questions_feature_config, name - assert_kind_of ::Google::Cloud::Retail::V2::UpdateGenerativeQuestionsFeatureConfigRequest, request - assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::Retail::V2::GenerativeQuestionsFeatureConfig), request["generative_questions_feature_config"] - assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Protobuf::FieldMask), request["update_mask"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, update_generative_questions_feature_config_client_stub do - # Create client - client = ::Google::Cloud::Retail::V2::GenerativeQuestionService::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.update_generative_questions_feature_config({ generative_questions_feature_config: generative_questions_feature_config, update_mask: update_mask }) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use named arguments - client.update_generative_questions_feature_config generative_questions_feature_config: generative_questions_feature_config, update_mask: update_mask do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object - client.update_generative_questions_feature_config ::Google::Cloud::Retail::V2::UpdateGenerativeQuestionsFeatureConfigRequest.new(generative_questions_feature_config: generative_questions_feature_config, update_mask: update_mask) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use hash object with options - client.update_generative_questions_feature_config({ generative_questions_feature_config: generative_questions_feature_config, update_mask: update_mask }, grpc_options) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object with options - client.update_generative_questions_feature_config(::Google::Cloud::Retail::V2::UpdateGenerativeQuestionsFeatureConfigRequest.new(generative_questions_feature_config: generative_questions_feature_config, update_mask: update_mask), grpc_options) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Verify method calls - assert_equal 5, update_generative_questions_feature_config_client_stub.call_rpc_count - end - end - - def test_get_generative_questions_feature_config - # Create GRPC objects. - grpc_response = ::Google::Cloud::Retail::V2::GenerativeQuestionsFeatureConfig.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. - catalog = "hello world" - - get_generative_questions_feature_config_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :get_generative_questions_feature_config, name - assert_kind_of ::Google::Cloud::Retail::V2::GetGenerativeQuestionsFeatureConfigRequest, request - assert_equal "hello world", request["catalog"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, get_generative_questions_feature_config_client_stub do - # Create client - client = ::Google::Cloud::Retail::V2::GenerativeQuestionService::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.get_generative_questions_feature_config({ catalog: catalog }) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use named arguments - client.get_generative_questions_feature_config catalog: catalog do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object - client.get_generative_questions_feature_config ::Google::Cloud::Retail::V2::GetGenerativeQuestionsFeatureConfigRequest.new(catalog: catalog) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use hash object with options - client.get_generative_questions_feature_config({ catalog: catalog }, grpc_options) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object with options - client.get_generative_questions_feature_config(::Google::Cloud::Retail::V2::GetGenerativeQuestionsFeatureConfigRequest.new(catalog: catalog), grpc_options) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Verify method calls - assert_equal 5, get_generative_questions_feature_config_client_stub.call_rpc_count - end - end - - def test_list_generative_question_configs - # Create GRPC objects. - grpc_response = ::Google::Cloud::Retail::V2::ListGenerativeQuestionConfigsResponse.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" - - list_generative_question_configs_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :list_generative_question_configs, name - assert_kind_of ::Google::Cloud::Retail::V2::ListGenerativeQuestionConfigsRequest, request - assert_equal "hello world", request["parent"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, list_generative_question_configs_client_stub do - # Create client - client = ::Google::Cloud::Retail::V2::GenerativeQuestionService::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.list_generative_question_configs({ parent: parent }) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use named arguments - client.list_generative_question_configs parent: parent do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object - client.list_generative_question_configs ::Google::Cloud::Retail::V2::ListGenerativeQuestionConfigsRequest.new(parent: parent) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use hash object with options - client.list_generative_question_configs({ parent: parent }, grpc_options) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object with options - client.list_generative_question_configs(::Google::Cloud::Retail::V2::ListGenerativeQuestionConfigsRequest.new(parent: parent), grpc_options) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Verify method calls - assert_equal 5, list_generative_question_configs_client_stub.call_rpc_count - end - end - - def test_update_generative_question_config - # Create GRPC objects. - grpc_response = ::Google::Cloud::Retail::V2::GenerativeQuestionConfig.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. - generative_question_config = {} - update_mask = {} - - update_generative_question_config_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :update_generative_question_config, name - assert_kind_of ::Google::Cloud::Retail::V2::UpdateGenerativeQuestionConfigRequest, request - assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::Retail::V2::GenerativeQuestionConfig), request["generative_question_config"] - assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Protobuf::FieldMask), request["update_mask"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, update_generative_question_config_client_stub do - # Create client - client = ::Google::Cloud::Retail::V2::GenerativeQuestionService::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.update_generative_question_config({ generative_question_config: generative_question_config, update_mask: update_mask }) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use named arguments - client.update_generative_question_config generative_question_config: generative_question_config, update_mask: update_mask do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object - client.update_generative_question_config ::Google::Cloud::Retail::V2::UpdateGenerativeQuestionConfigRequest.new(generative_question_config: generative_question_config, update_mask: update_mask) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use hash object with options - client.update_generative_question_config({ generative_question_config: generative_question_config, update_mask: update_mask }, grpc_options) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object with options - client.update_generative_question_config(::Google::Cloud::Retail::V2::UpdateGenerativeQuestionConfigRequest.new(generative_question_config: generative_question_config, update_mask: update_mask), grpc_options) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Verify method calls - assert_equal 5, update_generative_question_config_client_stub.call_rpc_count - end - end - - def test_batch_update_generative_question_configs - # Create GRPC objects. - grpc_response = ::Google::Cloud::Retail::V2::BatchUpdateGenerativeQuestionConfigsResponse.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" - requests = [{}] - - batch_update_generative_question_configs_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :batch_update_generative_question_configs, name - assert_kind_of ::Google::Cloud::Retail::V2::BatchUpdateGenerativeQuestionConfigsRequest, request - assert_equal "hello world", request["parent"] - assert_kind_of ::Google::Cloud::Retail::V2::UpdateGenerativeQuestionConfigRequest, request["requests"].first - refute_nil options - end - - Gapic::ServiceStub.stub :new, batch_update_generative_question_configs_client_stub do - # Create client - client = ::Google::Cloud::Retail::V2::GenerativeQuestionService::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.batch_update_generative_question_configs({ parent: parent, requests: requests }) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use named arguments - client.batch_update_generative_question_configs parent: parent, requests: requests do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object - client.batch_update_generative_question_configs ::Google::Cloud::Retail::V2::BatchUpdateGenerativeQuestionConfigsRequest.new(parent: parent, requests: requests) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use hash object with options - client.batch_update_generative_question_configs({ parent: parent, requests: requests }, grpc_options) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object with options - client.batch_update_generative_question_configs(::Google::Cloud::Retail::V2::BatchUpdateGenerativeQuestionConfigsRequest.new(parent: parent, requests: requests), grpc_options) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Verify method calls - assert_equal 5, batch_update_generative_question_configs_client_stub.call_rpc_count - end - end - - def test_configure - grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - - client = block_config = config = nil - dummy_stub = ClientStub.new nil, nil - Gapic::ServiceStub.stub :new, dummy_stub do - client = ::Google::Cloud::Retail::V2::GenerativeQuestionService::Client.new do |config| - config.credentials = grpc_channel - end - end - - config = client.configure do |c| - block_config = c - end - - assert_same block_config, config - assert_kind_of ::Google::Cloud::Retail::V2::GenerativeQuestionService::Client::Configuration, config - end - - def test_credentials - key = OpenSSL::PKey::RSA.new 2048 - cred_json = { - "private_key" => key.to_pem, - "client_email" => "app@developer.gserviceaccount.com", - "type" => "service_account" - } - key_file = StringIO.new cred_json.to_json - creds = Google::Auth::ServiceAccountCredentials.make_creds({ json_key_io: key_file }) - - dummy_stub = ClientStub.new nil, nil - Gapic::ServiceStub.stub :new, dummy_stub do - client = ::Google::Cloud::Retail::V2::GenerativeQuestionService::Client.new do |config| - config.credentials = creds - end - assert_kind_of ::Google::Cloud::Retail::V2::GenerativeQuestionService::Client, client - assert_equal creds, client.configure.credentials - end - end -end diff --git a/owl-bot-staging/google-cloud-retail-v2/test/google/cloud/retail/v2/model_service_operations_test.rb b/owl-bot-staging/google-cloud-retail-v2/test/google/cloud/retail/v2/model_service_operations_test.rb deleted file mode 100644 index 2cc0089dba34..000000000000 --- a/owl-bot-staging/google-cloud-retail-v2/test/google/cloud/retail/v2/model_service_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/cloud/retail/v2/model_service_pb" -require "google/cloud/retail/v2/model_service_services_pb" -require "google/cloud/retail/v2/model_service" - -class ::Google::Cloud::Retail::V2::ModelService::OperationsTest < Minitest::Test - class ClientStub - attr_accessor :call_rpc_count, :requests - - def initialize response, operation, &block - @response = response - @operation = operation - @block = block - @call_rpc_count = 0 - @requests = [] - end - - def call_rpc *args, **kwargs - @call_rpc_count += 1 - - @requests << @block&.call(*args, **kwargs) - - catch :response do - yield @response, @operation if block_given? - @response - end - end - - def endpoint - "endpoint.example.com" - end - - def universe_domain - "example.com" - end - - def stub_logger - nil - end - - def logger - nil - end - end - - def test_list_operations - # Create GRPC objects. - grpc_response = ::Google::Longrunning::ListOperationsResponse.new - grpc_operation = GRPC::ActiveCall::Operation.new nil - grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - grpc_options = {} - - # Create request parameters for a unary method. - name = "hello world" - filter = "hello world" - page_size = 42 - page_token = "hello world" - return_partial_success = true - - list_operations_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :list_operations, name - assert_kind_of ::Google::Longrunning::ListOperationsRequest, request - assert_equal "hello world", request["name"] - assert_equal "hello world", request["filter"] - assert_equal 42, request["page_size"] - assert_equal "hello world", request["page_token"] - assert_equal true, request["return_partial_success"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, list_operations_client_stub do - # Create client - client = ::Google::Cloud::Retail::V2::ModelService::Operations.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.list_operations({ name: name, filter: filter, page_size: page_size, page_token: page_token, return_partial_success: return_partial_success }) do |response, operation| - assert_kind_of Gapic::PagedEnumerable, response - assert_equal grpc_response, response.response - assert_equal grpc_operation, operation - end - - # Use named arguments - client.list_operations name: name, filter: filter, page_size: page_size, page_token: page_token, return_partial_success: return_partial_success do |response, operation| - assert_kind_of Gapic::PagedEnumerable, response - assert_equal grpc_response, response.response - assert_equal grpc_operation, operation - end - - # Use protobuf object - client.list_operations ::Google::Longrunning::ListOperationsRequest.new(name: name, filter: filter, page_size: page_size, page_token: page_token, return_partial_success: return_partial_success) do |response, operation| - assert_kind_of Gapic::PagedEnumerable, response - assert_equal grpc_response, response.response - assert_equal grpc_operation, operation - end - - # Use hash object with options - client.list_operations({ name: name, filter: filter, page_size: page_size, page_token: page_token, return_partial_success: return_partial_success }, grpc_options) do |response, operation| - assert_kind_of Gapic::PagedEnumerable, response - assert_equal grpc_response, response.response - assert_equal grpc_operation, operation - end - - # Use protobuf object with options - client.list_operations(::Google::Longrunning::ListOperationsRequest.new(name: name, filter: filter, page_size: page_size, page_token: page_token, return_partial_success: return_partial_success), grpc_options) do |response, operation| - assert_kind_of Gapic::PagedEnumerable, response - assert_equal grpc_response, response.response - assert_equal grpc_operation, operation - end - - # Verify method calls - assert_equal 5, list_operations_client_stub.call_rpc_count - end - end - - def test_get_operation - # Create GRPC objects. - grpc_response = ::Google::Longrunning::Operation.new - grpc_operation = GRPC::ActiveCall::Operation.new nil - grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - grpc_options = {} - - # Create request parameters for a unary method. - name = "hello world" - - get_operation_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :get_operation, name - assert_kind_of ::Google::Longrunning::GetOperationRequest, request - assert_equal "hello world", request["name"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, get_operation_client_stub do - # Create client - client = ::Google::Cloud::Retail::V2::ModelService::Operations.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.get_operation({ name: name }) do |response, operation| - assert_kind_of Gapic::Operation, response - assert_equal grpc_response, response.grpc_op - assert_equal grpc_operation, operation - end - - # Use named arguments - client.get_operation name: name do |response, operation| - assert_kind_of Gapic::Operation, response - assert_equal grpc_response, response.grpc_op - assert_equal grpc_operation, operation - end - - # Use protobuf object - client.get_operation ::Google::Longrunning::GetOperationRequest.new(name: name) do |response, operation| - assert_kind_of Gapic::Operation, response - assert_equal grpc_response, response.grpc_op - assert_equal grpc_operation, operation - end - - # Use hash object with options - client.get_operation({ name: name }, grpc_options) do |response, operation| - assert_kind_of Gapic::Operation, response - assert_equal grpc_response, response.grpc_op - assert_equal grpc_operation, operation - end - - # Use protobuf object with options - client.get_operation(::Google::Longrunning::GetOperationRequest.new(name: name), grpc_options) do |response, operation| - assert_kind_of Gapic::Operation, response - assert_equal grpc_response, response.grpc_op - assert_equal grpc_operation, operation - end - - # Verify method calls - assert_equal 5, get_operation_client_stub.call_rpc_count - end - end - - def test_delete_operation - # Create GRPC objects. - grpc_response = ::Google::Protobuf::Empty.new - grpc_operation = GRPC::ActiveCall::Operation.new nil - grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - grpc_options = {} - - # Create request parameters for a unary method. - name = "hello world" - - delete_operation_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :delete_operation, name - assert_kind_of ::Google::Longrunning::DeleteOperationRequest, request - assert_equal "hello world", request["name"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, delete_operation_client_stub do - # Create client - client = ::Google::Cloud::Retail::V2::ModelService::Operations.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.delete_operation({ name: name }) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use named arguments - client.delete_operation name: name do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object - client.delete_operation ::Google::Longrunning::DeleteOperationRequest.new(name: name) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use hash object with options - client.delete_operation({ name: name }, grpc_options) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object with options - client.delete_operation(::Google::Longrunning::DeleteOperationRequest.new(name: name), grpc_options) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Verify method calls - assert_equal 5, delete_operation_client_stub.call_rpc_count - end - end - - def test_cancel_operation - # Create GRPC objects. - grpc_response = ::Google::Protobuf::Empty.new - grpc_operation = GRPC::ActiveCall::Operation.new nil - grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - grpc_options = {} - - # Create request parameters for a unary method. - name = "hello world" - - cancel_operation_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :cancel_operation, name - assert_kind_of ::Google::Longrunning::CancelOperationRequest, request - assert_equal "hello world", request["name"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, cancel_operation_client_stub do - # Create client - client = ::Google::Cloud::Retail::V2::ModelService::Operations.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.cancel_operation({ name: name }) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use named arguments - client.cancel_operation name: name do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object - client.cancel_operation ::Google::Longrunning::CancelOperationRequest.new(name: name) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use hash object with options - client.cancel_operation({ name: name }, grpc_options) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object with options - client.cancel_operation(::Google::Longrunning::CancelOperationRequest.new(name: name), grpc_options) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Verify method calls - assert_equal 5, cancel_operation_client_stub.call_rpc_count - end - end - - def test_wait_operation - # Create GRPC objects. - grpc_response = ::Google::Longrunning::Operation.new - grpc_operation = GRPC::ActiveCall::Operation.new nil - grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - grpc_options = {} - - # Create request parameters for a unary method. - name = "hello world" - timeout = {} - - wait_operation_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :wait_operation, name - assert_kind_of ::Google::Longrunning::WaitOperationRequest, request - assert_equal "hello world", request["name"] - assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Protobuf::Duration), request["timeout"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, wait_operation_client_stub do - # Create client - client = ::Google::Cloud::Retail::V2::ModelService::Operations.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.wait_operation({ name: name, timeout: timeout }) do |response, operation| - assert_kind_of Gapic::Operation, response - assert_equal grpc_response, response.grpc_op - assert_equal grpc_operation, operation - end - - # Use named arguments - client.wait_operation name: name, timeout: timeout do |response, operation| - assert_kind_of Gapic::Operation, response - assert_equal grpc_response, response.grpc_op - assert_equal grpc_operation, operation - end - - # Use protobuf object - client.wait_operation ::Google::Longrunning::WaitOperationRequest.new(name: name, timeout: timeout) do |response, operation| - assert_kind_of Gapic::Operation, response - assert_equal grpc_response, response.grpc_op - assert_equal grpc_operation, operation - end - - # Use hash object with options - client.wait_operation({ name: name, timeout: timeout }, grpc_options) do |response, operation| - assert_kind_of Gapic::Operation, response - assert_equal grpc_response, response.grpc_op - assert_equal grpc_operation, operation - end - - # Use protobuf object with options - client.wait_operation(::Google::Longrunning::WaitOperationRequest.new(name: name, timeout: timeout), grpc_options) do |response, operation| - assert_kind_of Gapic::Operation, response - assert_equal grpc_response, response.grpc_op - assert_equal grpc_operation, operation - end - - # Verify method calls - assert_equal 5, wait_operation_client_stub.call_rpc_count - end - end - - def test_configure - grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - - client = block_config = config = nil - dummy_stub = ClientStub.new nil, nil - Gapic::ServiceStub.stub :new, dummy_stub do - client = ::Google::Cloud::Retail::V2::ModelService::Operations.new do |config| - config.credentials = grpc_channel - end - end - - config = client.configure do |c| - block_config = c - end - - assert_same block_config, config - assert_kind_of ::Google::Cloud::Retail::V2::ModelService::Operations::Configuration, config - end -end diff --git a/owl-bot-staging/google-cloud-retail-v2/test/google/cloud/retail/v2/model_service_paths_test.rb b/owl-bot-staging/google-cloud-retail-v2/test/google/cloud/retail/v2/model_service_paths_test.rb deleted file mode 100644 index f077beeed1ed..000000000000 --- a/owl-bot-staging/google-cloud-retail-v2/test/google/cloud/retail/v2/model_service_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/cloud/retail/v2/model_service" - -class ::Google::Cloud::Retail::V2::ModelService::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_catalog_path - grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - ::Gapic::ServiceStub.stub :new, DummyStub.new do - client = ::Google::Cloud::Retail::V2::ModelService::Client.new do |config| - config.credentials = grpc_channel - end - - path = client.catalog_path project: "value0", location: "value1", catalog: "value2" - assert_equal "projects/value0/locations/value1/catalogs/value2", path - end - end - - def test_model_path - grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - ::Gapic::ServiceStub.stub :new, DummyStub.new do - client = ::Google::Cloud::Retail::V2::ModelService::Client.new do |config| - config.credentials = grpc_channel - end - - path = client.model_path project: "value0", location: "value1", catalog: "value2", model: "value3" - assert_equal "projects/value0/locations/value1/catalogs/value2/models/value3", path - end - end -end diff --git a/owl-bot-staging/google-cloud-retail-v2/test/google/cloud/retail/v2/model_service_rest_test.rb b/owl-bot-staging/google-cloud-retail-v2/test/google/cloud/retail/v2/model_service_rest_test.rb deleted file mode 100644 index 46478d2e2e7b..000000000000 --- a/owl-bot-staging/google-cloud-retail-v2/test/google/cloud/retail/v2/model_service_rest_test.rb +++ /dev/null @@ -1,536 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -require "helper" -require "gapic/rest" -require "google/cloud/retail/v2/model_service_pb" -require "google/cloud/retail/v2/model_service/rest" - - -class ::Google::Cloud::Retail::V2::ModelService::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_model - # 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" - model = {} - dry_run = true - - create_model_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| - assert options.metadata.key? :"x-goog-api-client" - assert options.metadata[:"x-goog-api-client"].include? "rest" - refute options.metadata[:"x-goog-api-client"].include? "grpc" - end - - ::Google::Cloud::Retail::V2::ModelService::Rest::ServiceStub.stub :transcode_create_model_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, create_model_client_stub do - # Create client - client = ::Google::Cloud::Retail::V2::ModelService::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - client.create_model({ parent: parent, model: model, dry_run: dry_run }) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use named arguments - client.create_model parent: parent, model: model, dry_run: dry_run do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object - client.create_model ::Google::Cloud::Retail::V2::CreateModelRequest.new(parent: parent, model: model, dry_run: dry_run) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use hash object with options - client.create_model({ parent: parent, model: model, dry_run: dry_run }, call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object with options - client.create_model(::Google::Cloud::Retail::V2::CreateModelRequest.new(parent: parent, model: model, dry_run: dry_run), call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Verify method calls - assert_equal 5, create_model_client_stub.call_count - end - end - end - - def test_get_model - # Create test objects. - client_result = ::Google::Cloud::Retail::V2::Model.new - http_response = OpenStruct.new body: client_result.to_json - - call_options = {} - - # Create request parameters for a unary method. - name = "hello world" - - get_model_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| - assert options.metadata.key? :"x-goog-api-client" - assert options.metadata[:"x-goog-api-client"].include? "rest" - refute options.metadata[:"x-goog-api-client"].include? "grpc" - end - - ::Google::Cloud::Retail::V2::ModelService::Rest::ServiceStub.stub :transcode_get_model_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, get_model_client_stub do - # Create client - client = ::Google::Cloud::Retail::V2::ModelService::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - client.get_model({ name: name }) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use named arguments - client.get_model name: name do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object - client.get_model ::Google::Cloud::Retail::V2::GetModelRequest.new(name: name) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use hash object with options - client.get_model({ name: name }, call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object with options - client.get_model(::Google::Cloud::Retail::V2::GetModelRequest.new(name: name), call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Verify method calls - assert_equal 5, get_model_client_stub.call_count - end - end - end - - def test_pause_model - # Create test objects. - client_result = ::Google::Cloud::Retail::V2::Model.new - http_response = OpenStruct.new body: client_result.to_json - - call_options = {} - - # Create request parameters for a unary method. - name = "hello world" - - pause_model_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| - assert options.metadata.key? :"x-goog-api-client" - assert options.metadata[:"x-goog-api-client"].include? "rest" - refute options.metadata[:"x-goog-api-client"].include? "grpc" - end - - ::Google::Cloud::Retail::V2::ModelService::Rest::ServiceStub.stub :transcode_pause_model_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, pause_model_client_stub do - # Create client - client = ::Google::Cloud::Retail::V2::ModelService::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - client.pause_model({ name: name }) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use named arguments - client.pause_model name: name do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object - client.pause_model ::Google::Cloud::Retail::V2::PauseModelRequest.new(name: name) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use hash object with options - client.pause_model({ name: name }, call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object with options - client.pause_model(::Google::Cloud::Retail::V2::PauseModelRequest.new(name: name), call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Verify method calls - assert_equal 5, pause_model_client_stub.call_count - end - end - end - - def test_resume_model - # Create test objects. - client_result = ::Google::Cloud::Retail::V2::Model.new - http_response = OpenStruct.new body: client_result.to_json - - call_options = {} - - # Create request parameters for a unary method. - name = "hello world" - - resume_model_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| - assert options.metadata.key? :"x-goog-api-client" - assert options.metadata[:"x-goog-api-client"].include? "rest" - refute options.metadata[:"x-goog-api-client"].include? "grpc" - end - - ::Google::Cloud::Retail::V2::ModelService::Rest::ServiceStub.stub :transcode_resume_model_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, resume_model_client_stub do - # Create client - client = ::Google::Cloud::Retail::V2::ModelService::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - client.resume_model({ name: name }) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use named arguments - client.resume_model name: name do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object - client.resume_model ::Google::Cloud::Retail::V2::ResumeModelRequest.new(name: name) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use hash object with options - client.resume_model({ name: name }, call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object with options - client.resume_model(::Google::Cloud::Retail::V2::ResumeModelRequest.new(name: name), call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Verify method calls - assert_equal 5, resume_model_client_stub.call_count - end - end - end - - def test_delete_model - # Create test objects. - client_result = ::Google::Protobuf::Empty.new - http_response = OpenStruct.new body: client_result.to_json - - call_options = {} - - # Create request parameters for a unary method. - name = "hello world" - - delete_model_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| - assert options.metadata.key? :"x-goog-api-client" - assert options.metadata[:"x-goog-api-client"].include? "rest" - refute options.metadata[:"x-goog-api-client"].include? "grpc" - end - - ::Google::Cloud::Retail::V2::ModelService::Rest::ServiceStub.stub :transcode_delete_model_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, delete_model_client_stub do - # Create client - client = ::Google::Cloud::Retail::V2::ModelService::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - client.delete_model({ name: name }) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use named arguments - client.delete_model name: name do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object - client.delete_model ::Google::Cloud::Retail::V2::DeleteModelRequest.new(name: name) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use hash object with options - client.delete_model({ name: name }, call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object with options - client.delete_model(::Google::Cloud::Retail::V2::DeleteModelRequest.new(name: name), call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Verify method calls - assert_equal 5, delete_model_client_stub.call_count - end - end - end - - def test_list_models - # Create test objects. - client_result = ::Google::Cloud::Retail::V2::ListModelsResponse.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_models_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| - assert options.metadata.key? :"x-goog-api-client" - assert options.metadata[:"x-goog-api-client"].include? "rest" - refute options.metadata[:"x-goog-api-client"].include? "grpc" - end - - ::Google::Cloud::Retail::V2::ModelService::Rest::ServiceStub.stub :transcode_list_models_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, list_models_client_stub do - # Create client - client = ::Google::Cloud::Retail::V2::ModelService::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - client.list_models({ 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_models 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_models ::Google::Cloud::Retail::V2::ListModelsRequest.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_models({ 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_models(::Google::Cloud::Retail::V2::ListModelsRequest.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_models_client_stub.call_count - end - end - end - - def test_update_model - # Create test objects. - client_result = ::Google::Cloud::Retail::V2::Model.new - http_response = OpenStruct.new body: client_result.to_json - - call_options = {} - - # Create request parameters for a unary method. - model = {} - update_mask = {} - - update_model_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| - assert options.metadata.key? :"x-goog-api-client" - assert options.metadata[:"x-goog-api-client"].include? "rest" - refute options.metadata[:"x-goog-api-client"].include? "grpc" - end - - ::Google::Cloud::Retail::V2::ModelService::Rest::ServiceStub.stub :transcode_update_model_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, update_model_client_stub do - # Create client - client = ::Google::Cloud::Retail::V2::ModelService::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - client.update_model({ model: model, update_mask: update_mask }) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use named arguments - client.update_model model: model, update_mask: update_mask do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object - client.update_model ::Google::Cloud::Retail::V2::UpdateModelRequest.new(model: model, update_mask: update_mask) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use hash object with options - client.update_model({ model: model, update_mask: update_mask }, call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object with options - client.update_model(::Google::Cloud::Retail::V2::UpdateModelRequest.new(model: model, update_mask: update_mask), call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Verify method calls - assert_equal 5, update_model_client_stub.call_count - end - end - end - - def test_tune_model - # 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" - - tune_model_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| - assert options.metadata.key? :"x-goog-api-client" - assert options.metadata[:"x-goog-api-client"].include? "rest" - refute options.metadata[:"x-goog-api-client"].include? "grpc" - end - - ::Google::Cloud::Retail::V2::ModelService::Rest::ServiceStub.stub :transcode_tune_model_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, tune_model_client_stub do - # Create client - client = ::Google::Cloud::Retail::V2::ModelService::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - client.tune_model({ name: name }) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use named arguments - client.tune_model name: name do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object - client.tune_model ::Google::Cloud::Retail::V2::TuneModelRequest.new(name: name) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use hash object with options - client.tune_model({ name: name }, call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object with options - client.tune_model(::Google::Cloud::Retail::V2::TuneModelRequest.new(name: name), call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Verify method calls - assert_equal 5, tune_model_client_stub.call_count - end - end - end - - def test_configure - credentials_token = :dummy_value - - client = block_config = config = nil - dummy_stub = ClientStub.new nil - Gapic::Rest::ClientStub.stub :new, dummy_stub do - client = ::Google::Cloud::Retail::V2::ModelService::Rest::Client.new do |config| - config.credentials = credentials_token - end - end - - config = client.configure do |c| - block_config = c - end - - assert_same block_config, config - assert_kind_of ::Google::Cloud::Retail::V2::ModelService::Rest::Client::Configuration, config - end -end diff --git a/owl-bot-staging/google-cloud-retail-v2/test/google/cloud/retail/v2/model_service_test.rb b/owl-bot-staging/google-cloud-retail-v2/test/google/cloud/retail/v2/model_service_test.rb deleted file mode 100644 index 9e7a175a3c0f..000000000000 --- a/owl-bot-staging/google-cloud-retail-v2/test/google/cloud/retail/v2/model_service_test.rb +++ /dev/null @@ -1,607 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -require "helper" - -require "gapic/grpc/service_stub" - -require "google/cloud/retail/v2/model_service_pb" -require "google/cloud/retail/v2/model_service" - -class ::Google::Cloud::Retail::V2::ModelService::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_model - # 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" - model = {} - dry_run = true - - create_model_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :create_model, name - assert_kind_of ::Google::Cloud::Retail::V2::CreateModelRequest, request - assert_equal "hello world", request["parent"] - assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::Retail::V2::Model), request["model"] - assert_equal true, request["dry_run"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, create_model_client_stub do - # Create client - client = ::Google::Cloud::Retail::V2::ModelService::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.create_model({ parent: parent, model: model, dry_run: dry_run }) 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_model parent: parent, model: model, dry_run: dry_run 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_model ::Google::Cloud::Retail::V2::CreateModelRequest.new(parent: parent, model: model, dry_run: dry_run) 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_model({ parent: parent, model: model, dry_run: dry_run }, 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_model(::Google::Cloud::Retail::V2::CreateModelRequest.new(parent: parent, model: model, dry_run: dry_run), 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_model_client_stub.call_rpc_count - end - end - - def test_get_model - # Create GRPC objects. - grpc_response = ::Google::Cloud::Retail::V2::Model.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_model_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :get_model, name - assert_kind_of ::Google::Cloud::Retail::V2::GetModelRequest, request - assert_equal "hello world", request["name"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, get_model_client_stub do - # Create client - client = ::Google::Cloud::Retail::V2::ModelService::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.get_model({ name: name }) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use named arguments - client.get_model name: name do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object - client.get_model ::Google::Cloud::Retail::V2::GetModelRequest.new(name: name) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use hash object with options - client.get_model({ 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_model(::Google::Cloud::Retail::V2::GetModelRequest.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_model_client_stub.call_rpc_count - end - end - - def test_pause_model - # Create GRPC objects. - grpc_response = ::Google::Cloud::Retail::V2::Model.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" - - pause_model_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :pause_model, name - assert_kind_of ::Google::Cloud::Retail::V2::PauseModelRequest, request - assert_equal "hello world", request["name"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, pause_model_client_stub do - # Create client - client = ::Google::Cloud::Retail::V2::ModelService::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.pause_model({ name: name }) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use named arguments - client.pause_model name: name do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object - client.pause_model ::Google::Cloud::Retail::V2::PauseModelRequest.new(name: name) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use hash object with options - client.pause_model({ name: name }, grpc_options) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object with options - client.pause_model(::Google::Cloud::Retail::V2::PauseModelRequest.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, pause_model_client_stub.call_rpc_count - end - end - - def test_resume_model - # Create GRPC objects. - grpc_response = ::Google::Cloud::Retail::V2::Model.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" - - resume_model_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :resume_model, name - assert_kind_of ::Google::Cloud::Retail::V2::ResumeModelRequest, request - assert_equal "hello world", request["name"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, resume_model_client_stub do - # Create client - client = ::Google::Cloud::Retail::V2::ModelService::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.resume_model({ name: name }) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use named arguments - client.resume_model name: name do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object - client.resume_model ::Google::Cloud::Retail::V2::ResumeModelRequest.new(name: name) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use hash object with options - client.resume_model({ name: name }, grpc_options) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object with options - client.resume_model(::Google::Cloud::Retail::V2::ResumeModelRequest.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, resume_model_client_stub.call_rpc_count - end - end - - def test_delete_model - # 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_model_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :delete_model, name - assert_kind_of ::Google::Cloud::Retail::V2::DeleteModelRequest, request - assert_equal "hello world", request["name"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, delete_model_client_stub do - # Create client - client = ::Google::Cloud::Retail::V2::ModelService::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.delete_model({ name: name }) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use named arguments - client.delete_model name: name do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object - client.delete_model ::Google::Cloud::Retail::V2::DeleteModelRequest.new(name: name) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use hash object with options - client.delete_model({ 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_model(::Google::Cloud::Retail::V2::DeleteModelRequest.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_model_client_stub.call_rpc_count - end - end - - def test_list_models - # Create GRPC objects. - grpc_response = ::Google::Cloud::Retail::V2::ListModelsResponse.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_models_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :list_models, name - assert_kind_of ::Google::Cloud::Retail::V2::ListModelsRequest, 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_models_client_stub do - # Create client - client = ::Google::Cloud::Retail::V2::ModelService::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.list_models({ 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_models 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_models ::Google::Cloud::Retail::V2::ListModelsRequest.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_models({ 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_models(::Google::Cloud::Retail::V2::ListModelsRequest.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_models_client_stub.call_rpc_count - end - end - - def test_update_model - # Create GRPC objects. - grpc_response = ::Google::Cloud::Retail::V2::Model.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. - model = {} - update_mask = {} - - update_model_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :update_model, name - assert_kind_of ::Google::Cloud::Retail::V2::UpdateModelRequest, request - assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::Retail::V2::Model), request["model"] - assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Protobuf::FieldMask), request["update_mask"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, update_model_client_stub do - # Create client - client = ::Google::Cloud::Retail::V2::ModelService::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.update_model({ model: model, update_mask: update_mask }) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use named arguments - client.update_model model: model, update_mask: update_mask do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object - client.update_model ::Google::Cloud::Retail::V2::UpdateModelRequest.new(model: model, update_mask: update_mask) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use hash object with options - client.update_model({ model: model, update_mask: update_mask }, grpc_options) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object with options - client.update_model(::Google::Cloud::Retail::V2::UpdateModelRequest.new(model: model, update_mask: update_mask), grpc_options) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Verify method calls - assert_equal 5, update_model_client_stub.call_rpc_count - end - end - - def test_tune_model - # 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" - - tune_model_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :tune_model, name - assert_kind_of ::Google::Cloud::Retail::V2::TuneModelRequest, request - assert_equal "hello world", request["name"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, tune_model_client_stub do - # Create client - client = ::Google::Cloud::Retail::V2::ModelService::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.tune_model({ 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.tune_model 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.tune_model ::Google::Cloud::Retail::V2::TuneModelRequest.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.tune_model({ 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.tune_model(::Google::Cloud::Retail::V2::TuneModelRequest.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, tune_model_client_stub.call_rpc_count - end - end - - def test_configure - grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - - client = block_config = config = nil - dummy_stub = ClientStub.new nil, nil - Gapic::ServiceStub.stub :new, dummy_stub do - client = ::Google::Cloud::Retail::V2::ModelService::Client.new do |config| - config.credentials = grpc_channel - end - end - - config = client.configure do |c| - block_config = c - end - - assert_same block_config, config - assert_kind_of ::Google::Cloud::Retail::V2::ModelService::Client::Configuration, config - end - - def test_credentials - key = OpenSSL::PKey::RSA.new 2048 - cred_json = { - "private_key" => key.to_pem, - "client_email" => "app@developer.gserviceaccount.com", - "type" => "service_account" - } - key_file = StringIO.new cred_json.to_json - creds = Google::Auth::ServiceAccountCredentials.make_creds({ json_key_io: key_file }) - - dummy_stub = ClientStub.new nil, nil - Gapic::ServiceStub.stub :new, dummy_stub do - client = ::Google::Cloud::Retail::V2::ModelService::Client.new do |config| - config.credentials = creds - end - assert_kind_of ::Google::Cloud::Retail::V2::ModelService::Client, client - assert_equal creds, client.configure.credentials - end - end - - def test_operations_client - grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - - client = nil - dummy_stub = ClientStub.new nil, nil - Gapic::ServiceStub.stub :new, dummy_stub do - client = ::Google::Cloud::Retail::V2::ModelService::Client.new do |config| - config.credentials = grpc_channel - end - end - - assert_kind_of ::Google::Cloud::Retail::V2::ModelService::Operations, client.operations_client - end -end diff --git a/owl-bot-staging/google-cloud-retail-v2/test/google/cloud/retail/v2/prediction_service_paths_test.rb b/owl-bot-staging/google-cloud-retail-v2/test/google/cloud/retail/v2/prediction_service_paths_test.rb deleted file mode 100644 index 531290668702..000000000000 --- a/owl-bot-staging/google-cloud-retail-v2/test/google/cloud/retail/v2/prediction_service_paths_test.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 "helper" - -require "gapic/grpc/service_stub" - -require "google/cloud/retail/v2/prediction_service" - -class ::Google::Cloud::Retail::V2::PredictionService::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_product_path - grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - ::Gapic::ServiceStub.stub :new, DummyStub.new do - client = ::Google::Cloud::Retail::V2::PredictionService::Client.new do |config| - config.credentials = grpc_channel - end - - path = client.product_path project: "value0", location: "value1", catalog: "value2", branch: "value3", product: "value4" - assert_equal "projects/value0/locations/value1/catalogs/value2/branches/value3/products/value4", path - end - end -end diff --git a/owl-bot-staging/google-cloud-retail-v2/test/google/cloud/retail/v2/prediction_service_rest_test.rb b/owl-bot-staging/google-cloud-retail-v2/test/google/cloud/retail/v2/prediction_service_rest_test.rb deleted file mode 100644 index a4467b15702d..000000000000 --- a/owl-bot-staging/google-cloud-retail-v2/test/google/cloud/retail/v2/prediction_service_rest_test.rb +++ /dev/null @@ -1,160 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -require "helper" -require "gapic/rest" -require "google/cloud/retail/v2/prediction_service_pb" -require "google/cloud/retail/v2/prediction_service/rest" - - -class ::Google::Cloud::Retail::V2::PredictionService::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_predict - # Create test objects. - client_result = ::Google::Cloud::Retail::V2::PredictResponse.new - http_response = OpenStruct.new body: client_result.to_json - - call_options = {} - - # Create request parameters for a unary method. - placement = "hello world" - user_event = {} - page_size = 42 - page_token = "hello world" - filter = "hello world" - validate_only = true - params = {} - labels = {} - - predict_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| - assert options.metadata.key? :"x-goog-api-client" - assert options.metadata[:"x-goog-api-client"].include? "rest" - refute options.metadata[:"x-goog-api-client"].include? "grpc" - end - - ::Google::Cloud::Retail::V2::PredictionService::Rest::ServiceStub.stub :transcode_predict_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, predict_client_stub do - # Create client - client = ::Google::Cloud::Retail::V2::PredictionService::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - client.predict({ placement: placement, user_event: user_event, page_size: page_size, page_token: page_token, filter: filter, validate_only: validate_only, params: params, labels: labels }) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use named arguments - client.predict placement: placement, user_event: user_event, page_size: page_size, page_token: page_token, filter: filter, validate_only: validate_only, params: params, labels: labels do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object - client.predict ::Google::Cloud::Retail::V2::PredictRequest.new(placement: placement, user_event: user_event, page_size: page_size, page_token: page_token, filter: filter, validate_only: validate_only, params: params, labels: labels) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use hash object with options - client.predict({ placement: placement, user_event: user_event, page_size: page_size, page_token: page_token, filter: filter, validate_only: validate_only, params: params, labels: labels }, call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object with options - client.predict(::Google::Cloud::Retail::V2::PredictRequest.new(placement: placement, user_event: user_event, page_size: page_size, page_token: page_token, filter: filter, validate_only: validate_only, params: params, labels: labels), call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Verify method calls - assert_equal 5, predict_client_stub.call_count - end - end - end - - def test_configure - credentials_token = :dummy_value - - client = block_config = config = nil - dummy_stub = ClientStub.new nil - Gapic::Rest::ClientStub.stub :new, dummy_stub do - client = ::Google::Cloud::Retail::V2::PredictionService::Rest::Client.new do |config| - config.credentials = credentials_token - end - end - - config = client.configure do |c| - block_config = c - end - - assert_same block_config, config - assert_kind_of ::Google::Cloud::Retail::V2::PredictionService::Rest::Client::Configuration, config - end -end diff --git a/owl-bot-staging/google-cloud-retail-v2/test/google/cloud/retail/v2/prediction_service_test.rb b/owl-bot-staging/google-cloud-retail-v2/test/google/cloud/retail/v2/prediction_service_test.rb deleted file mode 100644 index 7b954f3adb96..000000000000 --- a/owl-bot-staging/google-cloud-retail-v2/test/google/cloud/retail/v2/prediction_service_test.rb +++ /dev/null @@ -1,176 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -require "helper" - -require "gapic/grpc/service_stub" - -require "google/cloud/retail/v2/prediction_service_pb" -require "google/cloud/retail/v2/prediction_service" - -class ::Google::Cloud::Retail::V2::PredictionService::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_predict - # Create GRPC objects. - grpc_response = ::Google::Cloud::Retail::V2::PredictResponse.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. - placement = "hello world" - user_event = {} - page_size = 42 - page_token = "hello world" - filter = "hello world" - validate_only = true - params = {} - labels = {} - - predict_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :predict, name - assert_kind_of ::Google::Cloud::Retail::V2::PredictRequest, request - assert_equal "hello world", request["placement"] - assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::Retail::V2::UserEvent), request["user_event"] - assert_equal 42, request["page_size"] - assert_equal "hello world", request["page_token"] - assert_equal "hello world", request["filter"] - assert_equal true, request["validate_only"] - assert_equal({}, request["params"].to_h) - assert_equal({}, request["labels"].to_h) - refute_nil options - end - - Gapic::ServiceStub.stub :new, predict_client_stub do - # Create client - client = ::Google::Cloud::Retail::V2::PredictionService::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.predict({ placement: placement, user_event: user_event, page_size: page_size, page_token: page_token, filter: filter, validate_only: validate_only, params: params, labels: labels }) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use named arguments - client.predict placement: placement, user_event: user_event, page_size: page_size, page_token: page_token, filter: filter, validate_only: validate_only, params: params, labels: labels do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object - client.predict ::Google::Cloud::Retail::V2::PredictRequest.new(placement: placement, user_event: user_event, page_size: page_size, page_token: page_token, filter: filter, validate_only: validate_only, params: params, labels: labels) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use hash object with options - client.predict({ placement: placement, user_event: user_event, page_size: page_size, page_token: page_token, filter: filter, validate_only: validate_only, params: params, labels: labels }, grpc_options) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object with options - client.predict(::Google::Cloud::Retail::V2::PredictRequest.new(placement: placement, user_event: user_event, page_size: page_size, page_token: page_token, filter: filter, validate_only: validate_only, params: params, labels: labels), grpc_options) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Verify method calls - assert_equal 5, predict_client_stub.call_rpc_count - end - end - - def test_configure - grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - - client = block_config = config = nil - dummy_stub = ClientStub.new nil, nil - Gapic::ServiceStub.stub :new, dummy_stub do - client = ::Google::Cloud::Retail::V2::PredictionService::Client.new do |config| - config.credentials = grpc_channel - end - end - - config = client.configure do |c| - block_config = c - end - - assert_same block_config, config - assert_kind_of ::Google::Cloud::Retail::V2::PredictionService::Client::Configuration, config - end - - def test_credentials - key = OpenSSL::PKey::RSA.new 2048 - cred_json = { - "private_key" => key.to_pem, - "client_email" => "app@developer.gserviceaccount.com", - "type" => "service_account" - } - key_file = StringIO.new cred_json.to_json - creds = Google::Auth::ServiceAccountCredentials.make_creds({ json_key_io: key_file }) - - dummy_stub = ClientStub.new nil, nil - Gapic::ServiceStub.stub :new, dummy_stub do - client = ::Google::Cloud::Retail::V2::PredictionService::Client.new do |config| - config.credentials = creds - end - assert_kind_of ::Google::Cloud::Retail::V2::PredictionService::Client, client - assert_equal creds, client.configure.credentials - end - end -end diff --git a/owl-bot-staging/google-cloud-retail-v2/test/google/cloud/retail/v2/product_service_operations_test.rb b/owl-bot-staging/google-cloud-retail-v2/test/google/cloud/retail/v2/product_service_operations_test.rb deleted file mode 100644 index 967bc636ac7c..000000000000 --- a/owl-bot-staging/google-cloud-retail-v2/test/google/cloud/retail/v2/product_service_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/cloud/retail/v2/product_service_pb" -require "google/cloud/retail/v2/product_service_services_pb" -require "google/cloud/retail/v2/product_service" - -class ::Google::Cloud::Retail::V2::ProductService::OperationsTest < Minitest::Test - class ClientStub - attr_accessor :call_rpc_count, :requests - - def initialize response, operation, &block - @response = response - @operation = operation - @block = block - @call_rpc_count = 0 - @requests = [] - end - - def call_rpc *args, **kwargs - @call_rpc_count += 1 - - @requests << @block&.call(*args, **kwargs) - - catch :response do - yield @response, @operation if block_given? - @response - end - end - - def endpoint - "endpoint.example.com" - end - - def universe_domain - "example.com" - end - - def stub_logger - nil - end - - def logger - nil - end - end - - def test_list_operations - # Create GRPC objects. - grpc_response = ::Google::Longrunning::ListOperationsResponse.new - grpc_operation = GRPC::ActiveCall::Operation.new nil - grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - grpc_options = {} - - # Create request parameters for a unary method. - name = "hello world" - filter = "hello world" - page_size = 42 - page_token = "hello world" - return_partial_success = true - - list_operations_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :list_operations, name - assert_kind_of ::Google::Longrunning::ListOperationsRequest, request - assert_equal "hello world", request["name"] - assert_equal "hello world", request["filter"] - assert_equal 42, request["page_size"] - assert_equal "hello world", request["page_token"] - assert_equal true, request["return_partial_success"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, list_operations_client_stub do - # Create client - client = ::Google::Cloud::Retail::V2::ProductService::Operations.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.list_operations({ name: name, filter: filter, page_size: page_size, page_token: page_token, return_partial_success: return_partial_success }) do |response, operation| - assert_kind_of Gapic::PagedEnumerable, response - assert_equal grpc_response, response.response - assert_equal grpc_operation, operation - end - - # Use named arguments - client.list_operations name: name, filter: filter, page_size: page_size, page_token: page_token, return_partial_success: return_partial_success do |response, operation| - assert_kind_of Gapic::PagedEnumerable, response - assert_equal grpc_response, response.response - assert_equal grpc_operation, operation - end - - # Use protobuf object - client.list_operations ::Google::Longrunning::ListOperationsRequest.new(name: name, filter: filter, page_size: page_size, page_token: page_token, return_partial_success: return_partial_success) do |response, operation| - assert_kind_of Gapic::PagedEnumerable, response - assert_equal grpc_response, response.response - assert_equal grpc_operation, operation - end - - # Use hash object with options - client.list_operations({ name: name, filter: filter, page_size: page_size, page_token: page_token, return_partial_success: return_partial_success }, grpc_options) do |response, operation| - assert_kind_of Gapic::PagedEnumerable, response - assert_equal grpc_response, response.response - assert_equal grpc_operation, operation - end - - # Use protobuf object with options - client.list_operations(::Google::Longrunning::ListOperationsRequest.new(name: name, filter: filter, page_size: page_size, page_token: page_token, return_partial_success: return_partial_success), grpc_options) do |response, operation| - assert_kind_of Gapic::PagedEnumerable, response - assert_equal grpc_response, response.response - assert_equal grpc_operation, operation - end - - # Verify method calls - assert_equal 5, list_operations_client_stub.call_rpc_count - end - end - - def test_get_operation - # Create GRPC objects. - grpc_response = ::Google::Longrunning::Operation.new - grpc_operation = GRPC::ActiveCall::Operation.new nil - grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - grpc_options = {} - - # Create request parameters for a unary method. - name = "hello world" - - get_operation_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :get_operation, name - assert_kind_of ::Google::Longrunning::GetOperationRequest, request - assert_equal "hello world", request["name"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, get_operation_client_stub do - # Create client - client = ::Google::Cloud::Retail::V2::ProductService::Operations.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.get_operation({ name: name }) do |response, operation| - assert_kind_of Gapic::Operation, response - assert_equal grpc_response, response.grpc_op - assert_equal grpc_operation, operation - end - - # Use named arguments - client.get_operation name: name do |response, operation| - assert_kind_of Gapic::Operation, response - assert_equal grpc_response, response.grpc_op - assert_equal grpc_operation, operation - end - - # Use protobuf object - client.get_operation ::Google::Longrunning::GetOperationRequest.new(name: name) do |response, operation| - assert_kind_of Gapic::Operation, response - assert_equal grpc_response, response.grpc_op - assert_equal grpc_operation, operation - end - - # Use hash object with options - client.get_operation({ name: name }, grpc_options) do |response, operation| - assert_kind_of Gapic::Operation, response - assert_equal grpc_response, response.grpc_op - assert_equal grpc_operation, operation - end - - # Use protobuf object with options - client.get_operation(::Google::Longrunning::GetOperationRequest.new(name: name), grpc_options) do |response, operation| - assert_kind_of Gapic::Operation, response - assert_equal grpc_response, response.grpc_op - assert_equal grpc_operation, operation - end - - # Verify method calls - assert_equal 5, get_operation_client_stub.call_rpc_count - end - end - - def test_delete_operation - # Create GRPC objects. - grpc_response = ::Google::Protobuf::Empty.new - grpc_operation = GRPC::ActiveCall::Operation.new nil - grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - grpc_options = {} - - # Create request parameters for a unary method. - name = "hello world" - - delete_operation_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :delete_operation, name - assert_kind_of ::Google::Longrunning::DeleteOperationRequest, request - assert_equal "hello world", request["name"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, delete_operation_client_stub do - # Create client - client = ::Google::Cloud::Retail::V2::ProductService::Operations.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.delete_operation({ name: name }) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use named arguments - client.delete_operation name: name do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object - client.delete_operation ::Google::Longrunning::DeleteOperationRequest.new(name: name) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use hash object with options - client.delete_operation({ name: name }, grpc_options) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object with options - client.delete_operation(::Google::Longrunning::DeleteOperationRequest.new(name: name), grpc_options) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Verify method calls - assert_equal 5, delete_operation_client_stub.call_rpc_count - end - end - - def test_cancel_operation - # Create GRPC objects. - grpc_response = ::Google::Protobuf::Empty.new - grpc_operation = GRPC::ActiveCall::Operation.new nil - grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - grpc_options = {} - - # Create request parameters for a unary method. - name = "hello world" - - cancel_operation_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :cancel_operation, name - assert_kind_of ::Google::Longrunning::CancelOperationRequest, request - assert_equal "hello world", request["name"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, cancel_operation_client_stub do - # Create client - client = ::Google::Cloud::Retail::V2::ProductService::Operations.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.cancel_operation({ name: name }) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use named arguments - client.cancel_operation name: name do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object - client.cancel_operation ::Google::Longrunning::CancelOperationRequest.new(name: name) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use hash object with options - client.cancel_operation({ name: name }, grpc_options) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object with options - client.cancel_operation(::Google::Longrunning::CancelOperationRequest.new(name: name), grpc_options) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Verify method calls - assert_equal 5, cancel_operation_client_stub.call_rpc_count - end - end - - def test_wait_operation - # Create GRPC objects. - grpc_response = ::Google::Longrunning::Operation.new - grpc_operation = GRPC::ActiveCall::Operation.new nil - grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - grpc_options = {} - - # Create request parameters for a unary method. - name = "hello world" - timeout = {} - - wait_operation_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :wait_operation, name - assert_kind_of ::Google::Longrunning::WaitOperationRequest, request - assert_equal "hello world", request["name"] - assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Protobuf::Duration), request["timeout"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, wait_operation_client_stub do - # Create client - client = ::Google::Cloud::Retail::V2::ProductService::Operations.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.wait_operation({ name: name, timeout: timeout }) do |response, operation| - assert_kind_of Gapic::Operation, response - assert_equal grpc_response, response.grpc_op - assert_equal grpc_operation, operation - end - - # Use named arguments - client.wait_operation name: name, timeout: timeout do |response, operation| - assert_kind_of Gapic::Operation, response - assert_equal grpc_response, response.grpc_op - assert_equal grpc_operation, operation - end - - # Use protobuf object - client.wait_operation ::Google::Longrunning::WaitOperationRequest.new(name: name, timeout: timeout) do |response, operation| - assert_kind_of Gapic::Operation, response - assert_equal grpc_response, response.grpc_op - assert_equal grpc_operation, operation - end - - # Use hash object with options - client.wait_operation({ name: name, timeout: timeout }, grpc_options) do |response, operation| - assert_kind_of Gapic::Operation, response - assert_equal grpc_response, response.grpc_op - assert_equal grpc_operation, operation - end - - # Use protobuf object with options - client.wait_operation(::Google::Longrunning::WaitOperationRequest.new(name: name, timeout: timeout), grpc_options) do |response, operation| - assert_kind_of Gapic::Operation, response - assert_equal grpc_response, response.grpc_op - assert_equal grpc_operation, operation - end - - # Verify method calls - assert_equal 5, wait_operation_client_stub.call_rpc_count - end - end - - def test_configure - grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - - client = block_config = config = nil - dummy_stub = ClientStub.new nil, nil - Gapic::ServiceStub.stub :new, dummy_stub do - client = ::Google::Cloud::Retail::V2::ProductService::Operations.new do |config| - config.credentials = grpc_channel - end - end - - config = client.configure do |c| - block_config = c - end - - assert_same block_config, config - assert_kind_of ::Google::Cloud::Retail::V2::ProductService::Operations::Configuration, config - end -end diff --git a/owl-bot-staging/google-cloud-retail-v2/test/google/cloud/retail/v2/product_service_paths_test.rb b/owl-bot-staging/google-cloud-retail-v2/test/google/cloud/retail/v2/product_service_paths_test.rb deleted file mode 100644 index b58df28b3831..000000000000 --- a/owl-bot-staging/google-cloud-retail-v2/test/google/cloud/retail/v2/product_service_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/cloud/retail/v2/product_service" - -class ::Google::Cloud::Retail::V2::ProductService::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_branch_path - grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - ::Gapic::ServiceStub.stub :new, DummyStub.new do - client = ::Google::Cloud::Retail::V2::ProductService::Client.new do |config| - config.credentials = grpc_channel - end - - path = client.branch_path project: "value0", location: "value1", catalog: "value2", branch: "value3" - assert_equal "projects/value0/locations/value1/catalogs/value2/branches/value3", path - end - end - - def test_product_path - grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - ::Gapic::ServiceStub.stub :new, DummyStub.new do - client = ::Google::Cloud::Retail::V2::ProductService::Client.new do |config| - config.credentials = grpc_channel - end - - path = client.product_path project: "value0", location: "value1", catalog: "value2", branch: "value3", product: "value4" - assert_equal "projects/value0/locations/value1/catalogs/value2/branches/value3/products/value4", path - end - end -end diff --git a/owl-bot-staging/google-cloud-retail-v2/test/google/cloud/retail/v2/product_service_rest_test.rb b/owl-bot-staging/google-cloud-retail-v2/test/google/cloud/retail/v2/product_service_rest_test.rb deleted file mode 100644 index 960c2c21047b..000000000000 --- a/owl-bot-staging/google-cloud-retail-v2/test/google/cloud/retail/v2/product_service_rest_test.rb +++ /dev/null @@ -1,781 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -require "helper" -require "gapic/rest" -require "google/cloud/retail/v2/product_service_pb" -require "google/cloud/retail/v2/product_service/rest" - - -class ::Google::Cloud::Retail::V2::ProductService::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_product - # Create test objects. - client_result = ::Google::Cloud::Retail::V2::Product.new - http_response = OpenStruct.new body: client_result.to_json - - call_options = {} - - # Create request parameters for a unary method. - parent = "hello world" - product = {} - product_id = "hello world" - - create_product_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| - assert options.metadata.key? :"x-goog-api-client" - assert options.metadata[:"x-goog-api-client"].include? "rest" - refute options.metadata[:"x-goog-api-client"].include? "grpc" - end - - ::Google::Cloud::Retail::V2::ProductService::Rest::ServiceStub.stub :transcode_create_product_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, create_product_client_stub do - # Create client - client = ::Google::Cloud::Retail::V2::ProductService::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - client.create_product({ parent: parent, product: product, product_id: product_id }) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use named arguments - client.create_product parent: parent, product: product, product_id: product_id do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object - client.create_product ::Google::Cloud::Retail::V2::CreateProductRequest.new(parent: parent, product: product, product_id: product_id) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use hash object with options - client.create_product({ parent: parent, product: product, product_id: product_id }, call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object with options - client.create_product(::Google::Cloud::Retail::V2::CreateProductRequest.new(parent: parent, product: product, product_id: product_id), call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Verify method calls - assert_equal 5, create_product_client_stub.call_count - end - end - end - - def test_get_product - # Create test objects. - client_result = ::Google::Cloud::Retail::V2::Product.new - http_response = OpenStruct.new body: client_result.to_json - - call_options = {} - - # Create request parameters for a unary method. - name = "hello world" - - get_product_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| - assert options.metadata.key? :"x-goog-api-client" - assert options.metadata[:"x-goog-api-client"].include? "rest" - refute options.metadata[:"x-goog-api-client"].include? "grpc" - end - - ::Google::Cloud::Retail::V2::ProductService::Rest::ServiceStub.stub :transcode_get_product_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, get_product_client_stub do - # Create client - client = ::Google::Cloud::Retail::V2::ProductService::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - client.get_product({ name: name }) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use named arguments - client.get_product name: name do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object - client.get_product ::Google::Cloud::Retail::V2::GetProductRequest.new(name: name) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use hash object with options - client.get_product({ name: name }, call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object with options - client.get_product(::Google::Cloud::Retail::V2::GetProductRequest.new(name: name), call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Verify method calls - assert_equal 5, get_product_client_stub.call_count - end - end - end - - def test_list_products - # Create test objects. - client_result = ::Google::Cloud::Retail::V2::ListProductsResponse.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" - read_mask = {} - - list_products_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| - assert options.metadata.key? :"x-goog-api-client" - assert options.metadata[:"x-goog-api-client"].include? "rest" - refute options.metadata[:"x-goog-api-client"].include? "grpc" - end - - ::Google::Cloud::Retail::V2::ProductService::Rest::ServiceStub.stub :transcode_list_products_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, list_products_client_stub do - # Create client - client = ::Google::Cloud::Retail::V2::ProductService::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - client.list_products({ parent: parent, page_size: page_size, page_token: page_token, filter: filter, read_mask: read_mask }) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use named arguments - client.list_products parent: parent, page_size: page_size, page_token: page_token, filter: filter, read_mask: read_mask do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object - client.list_products ::Google::Cloud::Retail::V2::ListProductsRequest.new(parent: parent, page_size: page_size, page_token: page_token, filter: filter, read_mask: read_mask) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use hash object with options - client.list_products({ parent: parent, page_size: page_size, page_token: page_token, filter: filter, read_mask: read_mask }, call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object with options - client.list_products(::Google::Cloud::Retail::V2::ListProductsRequest.new(parent: parent, page_size: page_size, page_token: page_token, filter: filter, read_mask: read_mask), call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Verify method calls - assert_equal 5, list_products_client_stub.call_count - end - end - end - - def test_update_product - # Create test objects. - client_result = ::Google::Cloud::Retail::V2::Product.new - http_response = OpenStruct.new body: client_result.to_json - - call_options = {} - - # Create request parameters for a unary method. - product = {} - update_mask = {} - allow_missing = true - - update_product_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| - assert options.metadata.key? :"x-goog-api-client" - assert options.metadata[:"x-goog-api-client"].include? "rest" - refute options.metadata[:"x-goog-api-client"].include? "grpc" - end - - ::Google::Cloud::Retail::V2::ProductService::Rest::ServiceStub.stub :transcode_update_product_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, update_product_client_stub do - # Create client - client = ::Google::Cloud::Retail::V2::ProductService::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - client.update_product({ product: product, update_mask: update_mask, allow_missing: allow_missing }) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use named arguments - client.update_product product: product, update_mask: update_mask, allow_missing: allow_missing do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object - client.update_product ::Google::Cloud::Retail::V2::UpdateProductRequest.new(product: product, update_mask: update_mask, allow_missing: allow_missing) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use hash object with options - client.update_product({ product: product, update_mask: update_mask, allow_missing: allow_missing }, call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object with options - client.update_product(::Google::Cloud::Retail::V2::UpdateProductRequest.new(product: product, update_mask: update_mask, allow_missing: allow_missing), call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Verify method calls - assert_equal 5, update_product_client_stub.call_count - end - end - end - - def test_delete_product - # Create test objects. - client_result = ::Google::Protobuf::Empty.new - http_response = OpenStruct.new body: client_result.to_json - - call_options = {} - - # Create request parameters for a unary method. - name = "hello world" - - delete_product_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| - assert options.metadata.key? :"x-goog-api-client" - assert options.metadata[:"x-goog-api-client"].include? "rest" - refute options.metadata[:"x-goog-api-client"].include? "grpc" - end - - ::Google::Cloud::Retail::V2::ProductService::Rest::ServiceStub.stub :transcode_delete_product_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, delete_product_client_stub do - # Create client - client = ::Google::Cloud::Retail::V2::ProductService::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - client.delete_product({ name: name }) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use named arguments - client.delete_product name: name do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object - client.delete_product ::Google::Cloud::Retail::V2::DeleteProductRequest.new(name: name) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use hash object with options - client.delete_product({ name: name }, call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object with options - client.delete_product(::Google::Cloud::Retail::V2::DeleteProductRequest.new(name: name), call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Verify method calls - assert_equal 5, delete_product_client_stub.call_count - end - end - end - - def test_purge_products - # 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" - filter = "hello world" - force = true - - purge_products_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| - assert options.metadata.key? :"x-goog-api-client" - assert options.metadata[:"x-goog-api-client"].include? "rest" - refute options.metadata[:"x-goog-api-client"].include? "grpc" - end - - ::Google::Cloud::Retail::V2::ProductService::Rest::ServiceStub.stub :transcode_purge_products_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, purge_products_client_stub do - # Create client - client = ::Google::Cloud::Retail::V2::ProductService::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - client.purge_products({ parent: parent, filter: filter, force: force }) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use named arguments - client.purge_products parent: parent, filter: filter, force: force do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object - client.purge_products ::Google::Cloud::Retail::V2::PurgeProductsRequest.new(parent: parent, filter: filter, force: force) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use hash object with options - client.purge_products({ parent: parent, filter: filter, force: force }, call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object with options - client.purge_products(::Google::Cloud::Retail::V2::PurgeProductsRequest.new(parent: parent, filter: filter, force: force), call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Verify method calls - assert_equal 5, purge_products_client_stub.call_count - end - end - end - - def test_import_products - # 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" - request_id = "hello world" - input_config = {} - errors_config = {} - update_mask = {} - reconciliation_mode = :RECONCILIATION_MODE_UNSPECIFIED - notification_pubsub_topic = "hello world" - - import_products_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| - assert options.metadata.key? :"x-goog-api-client" - assert options.metadata[:"x-goog-api-client"].include? "rest" - refute options.metadata[:"x-goog-api-client"].include? "grpc" - end - - ::Google::Cloud::Retail::V2::ProductService::Rest::ServiceStub.stub :transcode_import_products_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, import_products_client_stub do - # Create client - client = ::Google::Cloud::Retail::V2::ProductService::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - client.import_products({ parent: parent, request_id: request_id, input_config: input_config, errors_config: errors_config, update_mask: update_mask, reconciliation_mode: reconciliation_mode, notification_pubsub_topic: notification_pubsub_topic }) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use named arguments - client.import_products parent: parent, request_id: request_id, input_config: input_config, errors_config: errors_config, update_mask: update_mask, reconciliation_mode: reconciliation_mode, notification_pubsub_topic: notification_pubsub_topic do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object - client.import_products ::Google::Cloud::Retail::V2::ImportProductsRequest.new(parent: parent, request_id: request_id, input_config: input_config, errors_config: errors_config, update_mask: update_mask, reconciliation_mode: reconciliation_mode, notification_pubsub_topic: notification_pubsub_topic) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use hash object with options - client.import_products({ parent: parent, request_id: request_id, input_config: input_config, errors_config: errors_config, update_mask: update_mask, reconciliation_mode: reconciliation_mode, notification_pubsub_topic: notification_pubsub_topic }, call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object with options - client.import_products(::Google::Cloud::Retail::V2::ImportProductsRequest.new(parent: parent, request_id: request_id, input_config: input_config, errors_config: errors_config, update_mask: update_mask, reconciliation_mode: reconciliation_mode, notification_pubsub_topic: notification_pubsub_topic), call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Verify method calls - assert_equal 5, import_products_client_stub.call_count - end - end - end - - def test_set_inventory - # 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. - inventory = {} - set_mask = {} - set_time = {} - allow_missing = true - - set_inventory_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| - assert options.metadata.key? :"x-goog-api-client" - assert options.metadata[:"x-goog-api-client"].include? "rest" - refute options.metadata[:"x-goog-api-client"].include? "grpc" - end - - ::Google::Cloud::Retail::V2::ProductService::Rest::ServiceStub.stub :transcode_set_inventory_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, set_inventory_client_stub do - # Create client - client = ::Google::Cloud::Retail::V2::ProductService::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - client.set_inventory({ inventory: inventory, set_mask: set_mask, set_time: set_time, allow_missing: allow_missing }) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use named arguments - client.set_inventory inventory: inventory, set_mask: set_mask, set_time: set_time, allow_missing: allow_missing do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object - client.set_inventory ::Google::Cloud::Retail::V2::SetInventoryRequest.new(inventory: inventory, set_mask: set_mask, set_time: set_time, allow_missing: allow_missing) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use hash object with options - client.set_inventory({ inventory: inventory, set_mask: set_mask, set_time: set_time, allow_missing: allow_missing }, call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object with options - client.set_inventory(::Google::Cloud::Retail::V2::SetInventoryRequest.new(inventory: inventory, set_mask: set_mask, set_time: set_time, allow_missing: allow_missing), call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Verify method calls - assert_equal 5, set_inventory_client_stub.call_count - end - end - end - - def test_add_fulfillment_places - # 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. - product = "hello world" - type = "hello world" - place_ids = ["hello world"] - add_time = {} - allow_missing = true - - add_fulfillment_places_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| - assert options.metadata.key? :"x-goog-api-client" - assert options.metadata[:"x-goog-api-client"].include? "rest" - refute options.metadata[:"x-goog-api-client"].include? "grpc" - end - - ::Google::Cloud::Retail::V2::ProductService::Rest::ServiceStub.stub :transcode_add_fulfillment_places_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, add_fulfillment_places_client_stub do - # Create client - client = ::Google::Cloud::Retail::V2::ProductService::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - client.add_fulfillment_places({ product: product, type: type, place_ids: place_ids, add_time: add_time, allow_missing: allow_missing }) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use named arguments - client.add_fulfillment_places product: product, type: type, place_ids: place_ids, add_time: add_time, allow_missing: allow_missing do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object - client.add_fulfillment_places ::Google::Cloud::Retail::V2::AddFulfillmentPlacesRequest.new(product: product, type: type, place_ids: place_ids, add_time: add_time, allow_missing: allow_missing) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use hash object with options - client.add_fulfillment_places({ product: product, type: type, place_ids: place_ids, add_time: add_time, allow_missing: allow_missing }, call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object with options - client.add_fulfillment_places(::Google::Cloud::Retail::V2::AddFulfillmentPlacesRequest.new(product: product, type: type, place_ids: place_ids, add_time: add_time, allow_missing: allow_missing), call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Verify method calls - assert_equal 5, add_fulfillment_places_client_stub.call_count - end - end - end - - def test_remove_fulfillment_places - # 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. - product = "hello world" - type = "hello world" - place_ids = ["hello world"] - remove_time = {} - allow_missing = true - - remove_fulfillment_places_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| - assert options.metadata.key? :"x-goog-api-client" - assert options.metadata[:"x-goog-api-client"].include? "rest" - refute options.metadata[:"x-goog-api-client"].include? "grpc" - end - - ::Google::Cloud::Retail::V2::ProductService::Rest::ServiceStub.stub :transcode_remove_fulfillment_places_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, remove_fulfillment_places_client_stub do - # Create client - client = ::Google::Cloud::Retail::V2::ProductService::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - client.remove_fulfillment_places({ product: product, type: type, place_ids: place_ids, remove_time: remove_time, allow_missing: allow_missing }) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use named arguments - client.remove_fulfillment_places product: product, type: type, place_ids: place_ids, remove_time: remove_time, allow_missing: allow_missing do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object - client.remove_fulfillment_places ::Google::Cloud::Retail::V2::RemoveFulfillmentPlacesRequest.new(product: product, type: type, place_ids: place_ids, remove_time: remove_time, allow_missing: allow_missing) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use hash object with options - client.remove_fulfillment_places({ product: product, type: type, place_ids: place_ids, remove_time: remove_time, allow_missing: allow_missing }, call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object with options - client.remove_fulfillment_places(::Google::Cloud::Retail::V2::RemoveFulfillmentPlacesRequest.new(product: product, type: type, place_ids: place_ids, remove_time: remove_time, allow_missing: allow_missing), call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Verify method calls - assert_equal 5, remove_fulfillment_places_client_stub.call_count - end - end - end - - def test_add_local_inventories - # 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. - product = "hello world" - local_inventories = [{}] - add_mask = {} - add_time = {} - allow_missing = true - - add_local_inventories_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| - assert options.metadata.key? :"x-goog-api-client" - assert options.metadata[:"x-goog-api-client"].include? "rest" - refute options.metadata[:"x-goog-api-client"].include? "grpc" - end - - ::Google::Cloud::Retail::V2::ProductService::Rest::ServiceStub.stub :transcode_add_local_inventories_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, add_local_inventories_client_stub do - # Create client - client = ::Google::Cloud::Retail::V2::ProductService::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - client.add_local_inventories({ product: product, local_inventories: local_inventories, add_mask: add_mask, add_time: add_time, allow_missing: allow_missing }) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use named arguments - client.add_local_inventories product: product, local_inventories: local_inventories, add_mask: add_mask, add_time: add_time, allow_missing: allow_missing do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object - client.add_local_inventories ::Google::Cloud::Retail::V2::AddLocalInventoriesRequest.new(product: product, local_inventories: local_inventories, add_mask: add_mask, add_time: add_time, allow_missing: allow_missing) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use hash object with options - client.add_local_inventories({ product: product, local_inventories: local_inventories, add_mask: add_mask, add_time: add_time, allow_missing: allow_missing }, call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object with options - client.add_local_inventories(::Google::Cloud::Retail::V2::AddLocalInventoriesRequest.new(product: product, local_inventories: local_inventories, add_mask: add_mask, add_time: add_time, allow_missing: allow_missing), call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Verify method calls - assert_equal 5, add_local_inventories_client_stub.call_count - end - end - end - - def test_remove_local_inventories - # 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. - product = "hello world" - place_ids = ["hello world"] - remove_time = {} - allow_missing = true - - remove_local_inventories_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| - assert options.metadata.key? :"x-goog-api-client" - assert options.metadata[:"x-goog-api-client"].include? "rest" - refute options.metadata[:"x-goog-api-client"].include? "grpc" - end - - ::Google::Cloud::Retail::V2::ProductService::Rest::ServiceStub.stub :transcode_remove_local_inventories_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, remove_local_inventories_client_stub do - # Create client - client = ::Google::Cloud::Retail::V2::ProductService::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - client.remove_local_inventories({ product: product, place_ids: place_ids, remove_time: remove_time, allow_missing: allow_missing }) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use named arguments - client.remove_local_inventories product: product, place_ids: place_ids, remove_time: remove_time, allow_missing: allow_missing do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object - client.remove_local_inventories ::Google::Cloud::Retail::V2::RemoveLocalInventoriesRequest.new(product: product, place_ids: place_ids, remove_time: remove_time, allow_missing: allow_missing) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use hash object with options - client.remove_local_inventories({ product: product, place_ids: place_ids, remove_time: remove_time, allow_missing: allow_missing }, call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object with options - client.remove_local_inventories(::Google::Cloud::Retail::V2::RemoveLocalInventoriesRequest.new(product: product, place_ids: place_ids, remove_time: remove_time, allow_missing: allow_missing), call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Verify method calls - assert_equal 5, remove_local_inventories_client_stub.call_count - end - end - end - - def test_configure - credentials_token = :dummy_value - - client = block_config = config = nil - dummy_stub = ClientStub.new nil - Gapic::Rest::ClientStub.stub :new, dummy_stub do - client = ::Google::Cloud::Retail::V2::ProductService::Rest::Client.new do |config| - config.credentials = credentials_token - end - end - - config = client.configure do |c| - block_config = c - end - - assert_same block_config, config - assert_kind_of ::Google::Cloud::Retail::V2::ProductService::Rest::Client::Configuration, config - end -end diff --git a/owl-bot-staging/google-cloud-retail-v2/test/google/cloud/retail/v2/product_service_test.rb b/owl-bot-staging/google-cloud-retail-v2/test/google/cloud/retail/v2/product_service_test.rb deleted file mode 100644 index d1e30b41d491..000000000000 --- a/owl-bot-staging/google-cloud-retail-v2/test/google/cloud/retail/v2/product_service_test.rb +++ /dev/null @@ -1,922 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -require "helper" - -require "gapic/grpc/service_stub" - -require "google/cloud/retail/v2/product_service_pb" -require "google/cloud/retail/v2/product_service" - -class ::Google::Cloud::Retail::V2::ProductService::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_product - # Create GRPC objects. - grpc_response = ::Google::Cloud::Retail::V2::Product.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" - product = {} - product_id = "hello world" - - create_product_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :create_product, name - assert_kind_of ::Google::Cloud::Retail::V2::CreateProductRequest, request - assert_equal "hello world", request["parent"] - assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::Retail::V2::Product), request["product"] - assert_equal "hello world", request["product_id"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, create_product_client_stub do - # Create client - client = ::Google::Cloud::Retail::V2::ProductService::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.create_product({ parent: parent, product: product, product_id: product_id }) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use named arguments - client.create_product parent: parent, product: product, product_id: product_id do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object - client.create_product ::Google::Cloud::Retail::V2::CreateProductRequest.new(parent: parent, product: product, product_id: product_id) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use hash object with options - client.create_product({ parent: parent, product: product, product_id: product_id }, grpc_options) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object with options - client.create_product(::Google::Cloud::Retail::V2::CreateProductRequest.new(parent: parent, product: product, product_id: product_id), grpc_options) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Verify method calls - assert_equal 5, create_product_client_stub.call_rpc_count - end - end - - def test_get_product - # Create GRPC objects. - grpc_response = ::Google::Cloud::Retail::V2::Product.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_product_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :get_product, name - assert_kind_of ::Google::Cloud::Retail::V2::GetProductRequest, request - assert_equal "hello world", request["name"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, get_product_client_stub do - # Create client - client = ::Google::Cloud::Retail::V2::ProductService::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.get_product({ name: name }) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use named arguments - client.get_product name: name do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object - client.get_product ::Google::Cloud::Retail::V2::GetProductRequest.new(name: name) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use hash object with options - client.get_product({ 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_product(::Google::Cloud::Retail::V2::GetProductRequest.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_product_client_stub.call_rpc_count - end - end - - def test_list_products - # Create GRPC objects. - grpc_response = ::Google::Cloud::Retail::V2::ListProductsResponse.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" - read_mask = {} - - list_products_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :list_products, name - assert_kind_of ::Google::Cloud::Retail::V2::ListProductsRequest, 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"] - assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Protobuf::FieldMask), request["read_mask"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, list_products_client_stub do - # Create client - client = ::Google::Cloud::Retail::V2::ProductService::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.list_products({ parent: parent, page_size: page_size, page_token: page_token, filter: filter, read_mask: read_mask }) 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_products parent: parent, page_size: page_size, page_token: page_token, filter: filter, read_mask: read_mask 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_products ::Google::Cloud::Retail::V2::ListProductsRequest.new(parent: parent, page_size: page_size, page_token: page_token, filter: filter, read_mask: read_mask) 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_products({ parent: parent, page_size: page_size, page_token: page_token, filter: filter, read_mask: read_mask }, 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_products(::Google::Cloud::Retail::V2::ListProductsRequest.new(parent: parent, page_size: page_size, page_token: page_token, filter: filter, read_mask: read_mask), 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_products_client_stub.call_rpc_count - end - end - - def test_update_product - # Create GRPC objects. - grpc_response = ::Google::Cloud::Retail::V2::Product.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. - product = {} - update_mask = {} - allow_missing = true - - update_product_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :update_product, name - assert_kind_of ::Google::Cloud::Retail::V2::UpdateProductRequest, request - assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::Retail::V2::Product), request["product"] - assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Protobuf::FieldMask), request["update_mask"] - assert_equal true, request["allow_missing"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, update_product_client_stub do - # Create client - client = ::Google::Cloud::Retail::V2::ProductService::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.update_product({ product: product, update_mask: update_mask, allow_missing: allow_missing }) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use named arguments - client.update_product product: product, update_mask: update_mask, allow_missing: allow_missing do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object - client.update_product ::Google::Cloud::Retail::V2::UpdateProductRequest.new(product: product, update_mask: update_mask, allow_missing: allow_missing) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use hash object with options - client.update_product({ product: product, update_mask: update_mask, allow_missing: allow_missing }, grpc_options) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object with options - client.update_product(::Google::Cloud::Retail::V2::UpdateProductRequest.new(product: product, update_mask: update_mask, allow_missing: allow_missing), grpc_options) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Verify method calls - assert_equal 5, update_product_client_stub.call_rpc_count - end - end - - def test_delete_product - # 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_product_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :delete_product, name - assert_kind_of ::Google::Cloud::Retail::V2::DeleteProductRequest, request - assert_equal "hello world", request["name"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, delete_product_client_stub do - # Create client - client = ::Google::Cloud::Retail::V2::ProductService::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.delete_product({ name: name }) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use named arguments - client.delete_product name: name do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object - client.delete_product ::Google::Cloud::Retail::V2::DeleteProductRequest.new(name: name) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use hash object with options - client.delete_product({ 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_product(::Google::Cloud::Retail::V2::DeleteProductRequest.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_product_client_stub.call_rpc_count - end - end - - def test_purge_products - # 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" - filter = "hello world" - force = true - - purge_products_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :purge_products, name - assert_kind_of ::Google::Cloud::Retail::V2::PurgeProductsRequest, request - assert_equal "hello world", request["parent"] - assert_equal "hello world", request["filter"] - assert_equal true, request["force"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, purge_products_client_stub do - # Create client - client = ::Google::Cloud::Retail::V2::ProductService::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.purge_products({ parent: parent, filter: filter, 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.purge_products parent: parent, filter: filter, 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.purge_products ::Google::Cloud::Retail::V2::PurgeProductsRequest.new(parent: parent, filter: filter, 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.purge_products({ parent: parent, filter: filter, 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.purge_products(::Google::Cloud::Retail::V2::PurgeProductsRequest.new(parent: parent, filter: filter, 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, purge_products_client_stub.call_rpc_count - end - end - - def test_import_products - # 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" - request_id = "hello world" - input_config = {} - errors_config = {} - update_mask = {} - reconciliation_mode = :RECONCILIATION_MODE_UNSPECIFIED - notification_pubsub_topic = "hello world" - - import_products_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :import_products, name - assert_kind_of ::Google::Cloud::Retail::V2::ImportProductsRequest, request - assert_equal "hello world", request["parent"] - assert_equal "hello world", request["request_id"] - assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::Retail::V2::ProductInputConfig), request["input_config"] - assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::Retail::V2::ImportErrorsConfig), request["errors_config"] - assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Protobuf::FieldMask), request["update_mask"] - assert_equal :RECONCILIATION_MODE_UNSPECIFIED, request["reconciliation_mode"] - assert_equal "hello world", request["notification_pubsub_topic"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, import_products_client_stub do - # Create client - client = ::Google::Cloud::Retail::V2::ProductService::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.import_products({ parent: parent, request_id: request_id, input_config: input_config, errors_config: errors_config, update_mask: update_mask, reconciliation_mode: reconciliation_mode, notification_pubsub_topic: notification_pubsub_topic }) 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.import_products parent: parent, request_id: request_id, input_config: input_config, errors_config: errors_config, update_mask: update_mask, reconciliation_mode: reconciliation_mode, notification_pubsub_topic: notification_pubsub_topic 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.import_products ::Google::Cloud::Retail::V2::ImportProductsRequest.new(parent: parent, request_id: request_id, input_config: input_config, errors_config: errors_config, update_mask: update_mask, reconciliation_mode: reconciliation_mode, notification_pubsub_topic: notification_pubsub_topic) 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.import_products({ parent: parent, request_id: request_id, input_config: input_config, errors_config: errors_config, update_mask: update_mask, reconciliation_mode: reconciliation_mode, notification_pubsub_topic: notification_pubsub_topic }, 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.import_products(::Google::Cloud::Retail::V2::ImportProductsRequest.new(parent: parent, request_id: request_id, input_config: input_config, errors_config: errors_config, update_mask: update_mask, reconciliation_mode: reconciliation_mode, notification_pubsub_topic: notification_pubsub_topic), 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, import_products_client_stub.call_rpc_count - end - end - - def test_set_inventory - # 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. - inventory = {} - set_mask = {} - set_time = {} - allow_missing = true - - set_inventory_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :set_inventory, name - assert_kind_of ::Google::Cloud::Retail::V2::SetInventoryRequest, request - assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::Retail::V2::Product), request["inventory"] - assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Protobuf::FieldMask), request["set_mask"] - assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Protobuf::Timestamp), request["set_time"] - assert_equal true, request["allow_missing"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, set_inventory_client_stub do - # Create client - client = ::Google::Cloud::Retail::V2::ProductService::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.set_inventory({ inventory: inventory, set_mask: set_mask, set_time: set_time, allow_missing: allow_missing }) 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.set_inventory inventory: inventory, set_mask: set_mask, set_time: set_time, allow_missing: allow_missing 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.set_inventory ::Google::Cloud::Retail::V2::SetInventoryRequest.new(inventory: inventory, set_mask: set_mask, set_time: set_time, allow_missing: allow_missing) 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.set_inventory({ inventory: inventory, set_mask: set_mask, set_time: set_time, allow_missing: allow_missing }, 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.set_inventory(::Google::Cloud::Retail::V2::SetInventoryRequest.new(inventory: inventory, set_mask: set_mask, set_time: set_time, allow_missing: allow_missing), 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, set_inventory_client_stub.call_rpc_count - end - end - - def test_add_fulfillment_places - # 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. - product = "hello world" - type = "hello world" - place_ids = ["hello world"] - add_time = {} - allow_missing = true - - add_fulfillment_places_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :add_fulfillment_places, name - assert_kind_of ::Google::Cloud::Retail::V2::AddFulfillmentPlacesRequest, request - assert_equal "hello world", request["product"] - assert_equal "hello world", request["type"] - assert_equal ["hello world"], request["place_ids"] - assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Protobuf::Timestamp), request["add_time"] - assert_equal true, request["allow_missing"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, add_fulfillment_places_client_stub do - # Create client - client = ::Google::Cloud::Retail::V2::ProductService::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.add_fulfillment_places({ product: product, type: type, place_ids: place_ids, add_time: add_time, allow_missing: allow_missing }) 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.add_fulfillment_places product: product, type: type, place_ids: place_ids, add_time: add_time, allow_missing: allow_missing 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.add_fulfillment_places ::Google::Cloud::Retail::V2::AddFulfillmentPlacesRequest.new(product: product, type: type, place_ids: place_ids, add_time: add_time, allow_missing: allow_missing) 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.add_fulfillment_places({ product: product, type: type, place_ids: place_ids, add_time: add_time, allow_missing: allow_missing }, 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.add_fulfillment_places(::Google::Cloud::Retail::V2::AddFulfillmentPlacesRequest.new(product: product, type: type, place_ids: place_ids, add_time: add_time, allow_missing: allow_missing), 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, add_fulfillment_places_client_stub.call_rpc_count - end - end - - def test_remove_fulfillment_places - # 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. - product = "hello world" - type = "hello world" - place_ids = ["hello world"] - remove_time = {} - allow_missing = true - - remove_fulfillment_places_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :remove_fulfillment_places, name - assert_kind_of ::Google::Cloud::Retail::V2::RemoveFulfillmentPlacesRequest, request - assert_equal "hello world", request["product"] - assert_equal "hello world", request["type"] - assert_equal ["hello world"], request["place_ids"] - assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Protobuf::Timestamp), request["remove_time"] - assert_equal true, request["allow_missing"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, remove_fulfillment_places_client_stub do - # Create client - client = ::Google::Cloud::Retail::V2::ProductService::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.remove_fulfillment_places({ product: product, type: type, place_ids: place_ids, remove_time: remove_time, allow_missing: allow_missing }) 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.remove_fulfillment_places product: product, type: type, place_ids: place_ids, remove_time: remove_time, allow_missing: allow_missing 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.remove_fulfillment_places ::Google::Cloud::Retail::V2::RemoveFulfillmentPlacesRequest.new(product: product, type: type, place_ids: place_ids, remove_time: remove_time, allow_missing: allow_missing) 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.remove_fulfillment_places({ product: product, type: type, place_ids: place_ids, remove_time: remove_time, allow_missing: allow_missing }, 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.remove_fulfillment_places(::Google::Cloud::Retail::V2::RemoveFulfillmentPlacesRequest.new(product: product, type: type, place_ids: place_ids, remove_time: remove_time, allow_missing: allow_missing), 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, remove_fulfillment_places_client_stub.call_rpc_count - end - end - - def test_add_local_inventories - # 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. - product = "hello world" - local_inventories = [{}] - add_mask = {} - add_time = {} - allow_missing = true - - add_local_inventories_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :add_local_inventories, name - assert_kind_of ::Google::Cloud::Retail::V2::AddLocalInventoriesRequest, request - assert_equal "hello world", request["product"] - assert_kind_of ::Google::Cloud::Retail::V2::LocalInventory, request["local_inventories"].first - assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Protobuf::FieldMask), request["add_mask"] - assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Protobuf::Timestamp), request["add_time"] - assert_equal true, request["allow_missing"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, add_local_inventories_client_stub do - # Create client - client = ::Google::Cloud::Retail::V2::ProductService::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.add_local_inventories({ product: product, local_inventories: local_inventories, add_mask: add_mask, add_time: add_time, allow_missing: allow_missing }) 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.add_local_inventories product: product, local_inventories: local_inventories, add_mask: add_mask, add_time: add_time, allow_missing: allow_missing 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.add_local_inventories ::Google::Cloud::Retail::V2::AddLocalInventoriesRequest.new(product: product, local_inventories: local_inventories, add_mask: add_mask, add_time: add_time, allow_missing: allow_missing) 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.add_local_inventories({ product: product, local_inventories: local_inventories, add_mask: add_mask, add_time: add_time, allow_missing: allow_missing }, 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.add_local_inventories(::Google::Cloud::Retail::V2::AddLocalInventoriesRequest.new(product: product, local_inventories: local_inventories, add_mask: add_mask, add_time: add_time, allow_missing: allow_missing), 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, add_local_inventories_client_stub.call_rpc_count - end - end - - def test_remove_local_inventories - # 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. - product = "hello world" - place_ids = ["hello world"] - remove_time = {} - allow_missing = true - - remove_local_inventories_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :remove_local_inventories, name - assert_kind_of ::Google::Cloud::Retail::V2::RemoveLocalInventoriesRequest, request - assert_equal "hello world", request["product"] - assert_equal ["hello world"], request["place_ids"] - assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Protobuf::Timestamp), request["remove_time"] - assert_equal true, request["allow_missing"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, remove_local_inventories_client_stub do - # Create client - client = ::Google::Cloud::Retail::V2::ProductService::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.remove_local_inventories({ product: product, place_ids: place_ids, remove_time: remove_time, allow_missing: allow_missing }) 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.remove_local_inventories product: product, place_ids: place_ids, remove_time: remove_time, allow_missing: allow_missing 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.remove_local_inventories ::Google::Cloud::Retail::V2::RemoveLocalInventoriesRequest.new(product: product, place_ids: place_ids, remove_time: remove_time, allow_missing: allow_missing) 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.remove_local_inventories({ product: product, place_ids: place_ids, remove_time: remove_time, allow_missing: allow_missing }, 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.remove_local_inventories(::Google::Cloud::Retail::V2::RemoveLocalInventoriesRequest.new(product: product, place_ids: place_ids, remove_time: remove_time, allow_missing: allow_missing), 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, remove_local_inventories_client_stub.call_rpc_count - end - end - - def test_configure - grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - - client = block_config = config = nil - dummy_stub = ClientStub.new nil, nil - Gapic::ServiceStub.stub :new, dummy_stub do - client = ::Google::Cloud::Retail::V2::ProductService::Client.new do |config| - config.credentials = grpc_channel - end - end - - config = client.configure do |c| - block_config = c - end - - assert_same block_config, config - assert_kind_of ::Google::Cloud::Retail::V2::ProductService::Client::Configuration, config - end - - def test_credentials - key = OpenSSL::PKey::RSA.new 2048 - cred_json = { - "private_key" => key.to_pem, - "client_email" => "app@developer.gserviceaccount.com", - "type" => "service_account" - } - key_file = StringIO.new cred_json.to_json - creds = Google::Auth::ServiceAccountCredentials.make_creds({ json_key_io: key_file }) - - dummy_stub = ClientStub.new nil, nil - Gapic::ServiceStub.stub :new, dummy_stub do - client = ::Google::Cloud::Retail::V2::ProductService::Client.new do |config| - config.credentials = creds - end - assert_kind_of ::Google::Cloud::Retail::V2::ProductService::Client, client - assert_equal creds, client.configure.credentials - end - end - - def test_operations_client - grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - - client = nil - dummy_stub = ClientStub.new nil, nil - Gapic::ServiceStub.stub :new, dummy_stub do - client = ::Google::Cloud::Retail::V2::ProductService::Client.new do |config| - config.credentials = grpc_channel - end - end - - assert_kind_of ::Google::Cloud::Retail::V2::ProductService::Operations, client.operations_client - end -end diff --git a/owl-bot-staging/google-cloud-retail-v2/test/google/cloud/retail/v2/search_service_paths_test.rb b/owl-bot-staging/google-cloud-retail-v2/test/google/cloud/retail/v2/search_service_paths_test.rb deleted file mode 100644 index 666f380e368d..000000000000 --- a/owl-bot-staging/google-cloud-retail-v2/test/google/cloud/retail/v2/search_service_paths_test.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 "helper" - -require "gapic/grpc/service_stub" - -require "google/cloud/retail/v2/search_service" - -class ::Google::Cloud::Retail::V2::SearchService::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_branch_path - grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - ::Gapic::ServiceStub.stub :new, DummyStub.new do - client = ::Google::Cloud::Retail::V2::SearchService::Client.new do |config| - config.credentials = grpc_channel - end - - path = client.branch_path project: "value0", location: "value1", catalog: "value2", branch: "value3" - assert_equal "projects/value0/locations/value1/catalogs/value2/branches/value3", path - end - end -end diff --git a/owl-bot-staging/google-cloud-retail-v2/test/google/cloud/retail/v2/search_service_rest_test.rb b/owl-bot-staging/google-cloud-retail-v2/test/google/cloud/retail/v2/search_service_rest_test.rb deleted file mode 100644 index 412999d3965e..000000000000 --- a/owl-bot-staging/google-cloud-retail-v2/test/google/cloud/retail/v2/search_service_rest_test.rb +++ /dev/null @@ -1,180 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -require "helper" -require "gapic/rest" -require "google/cloud/retail/v2/search_service_pb" -require "google/cloud/retail/v2/search_service/rest" - - -class ::Google::Cloud::Retail::V2::SearchService::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_search - # Create test objects. - client_result = ::Google::Cloud::Retail::V2::SearchResponse.new - http_response = OpenStruct.new body: client_result.to_json - - call_options = {} - - # Create request parameters for a unary method. - placement = "hello world" - branch = "hello world" - query = "hello world" - visitor_id = "hello world" - user_info = {} - page_size = 42 - page_token = "hello world" - offset = 42 - filter = "hello world" - canonical_filter = "hello world" - order_by = "hello world" - facet_specs = [{}] - dynamic_facet_spec = {} - boost_spec = {} - query_expansion_spec = {} - variant_rollup_keys = ["hello world"] - page_categories = ["hello world"] - search_mode = :SEARCH_MODE_UNSPECIFIED - personalization_spec = {} - labels = {} - spell_correction_spec = {} - entity = "hello world" - conversational_search_spec = {} - tile_navigation_spec = {} - language_code = "hello world" - region_code = "hello world" - place_id = "hello world" - user_attributes = {} - - search_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| - assert options.metadata.key? :"x-goog-api-client" - assert options.metadata[:"x-goog-api-client"].include? "rest" - refute options.metadata[:"x-goog-api-client"].include? "grpc" - end - - ::Google::Cloud::Retail::V2::SearchService::Rest::ServiceStub.stub :transcode_search_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, search_client_stub do - # Create client - client = ::Google::Cloud::Retail::V2::SearchService::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - client.search({ placement: placement, branch: branch, query: query, visitor_id: visitor_id, user_info: user_info, page_size: page_size, page_token: page_token, offset: offset, filter: filter, canonical_filter: canonical_filter, order_by: order_by, facet_specs: facet_specs, dynamic_facet_spec: dynamic_facet_spec, boost_spec: boost_spec, query_expansion_spec: query_expansion_spec, variant_rollup_keys: variant_rollup_keys, page_categories: page_categories, search_mode: search_mode, personalization_spec: personalization_spec, labels: labels, spell_correction_spec: spell_correction_spec, entity: entity, conversational_search_spec: conversational_search_spec, tile_navigation_spec: tile_navigation_spec, language_code: language_code, region_code: region_code, place_id: place_id, user_attributes: user_attributes }) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use named arguments - client.search placement: placement, branch: branch, query: query, visitor_id: visitor_id, user_info: user_info, page_size: page_size, page_token: page_token, offset: offset, filter: filter, canonical_filter: canonical_filter, order_by: order_by, facet_specs: facet_specs, dynamic_facet_spec: dynamic_facet_spec, boost_spec: boost_spec, query_expansion_spec: query_expansion_spec, variant_rollup_keys: variant_rollup_keys, page_categories: page_categories, search_mode: search_mode, personalization_spec: personalization_spec, labels: labels, spell_correction_spec: spell_correction_spec, entity: entity, conversational_search_spec: conversational_search_spec, tile_navigation_spec: tile_navigation_spec, language_code: language_code, region_code: region_code, place_id: place_id, user_attributes: user_attributes do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object - client.search ::Google::Cloud::Retail::V2::SearchRequest.new(placement: placement, branch: branch, query: query, visitor_id: visitor_id, user_info: user_info, page_size: page_size, page_token: page_token, offset: offset, filter: filter, canonical_filter: canonical_filter, order_by: order_by, facet_specs: facet_specs, dynamic_facet_spec: dynamic_facet_spec, boost_spec: boost_spec, query_expansion_spec: query_expansion_spec, variant_rollup_keys: variant_rollup_keys, page_categories: page_categories, search_mode: search_mode, personalization_spec: personalization_spec, labels: labels, spell_correction_spec: spell_correction_spec, entity: entity, conversational_search_spec: conversational_search_spec, tile_navigation_spec: tile_navigation_spec, language_code: language_code, region_code: region_code, place_id: place_id, user_attributes: user_attributes) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use hash object with options - client.search({ placement: placement, branch: branch, query: query, visitor_id: visitor_id, user_info: user_info, page_size: page_size, page_token: page_token, offset: offset, filter: filter, canonical_filter: canonical_filter, order_by: order_by, facet_specs: facet_specs, dynamic_facet_spec: dynamic_facet_spec, boost_spec: boost_spec, query_expansion_spec: query_expansion_spec, variant_rollup_keys: variant_rollup_keys, page_categories: page_categories, search_mode: search_mode, personalization_spec: personalization_spec, labels: labels, spell_correction_spec: spell_correction_spec, entity: entity, conversational_search_spec: conversational_search_spec, tile_navigation_spec: tile_navigation_spec, language_code: language_code, region_code: region_code, place_id: place_id, user_attributes: user_attributes }, call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object with options - client.search(::Google::Cloud::Retail::V2::SearchRequest.new(placement: placement, branch: branch, query: query, visitor_id: visitor_id, user_info: user_info, page_size: page_size, page_token: page_token, offset: offset, filter: filter, canonical_filter: canonical_filter, order_by: order_by, facet_specs: facet_specs, dynamic_facet_spec: dynamic_facet_spec, boost_spec: boost_spec, query_expansion_spec: query_expansion_spec, variant_rollup_keys: variant_rollup_keys, page_categories: page_categories, search_mode: search_mode, personalization_spec: personalization_spec, labels: labels, spell_correction_spec: spell_correction_spec, entity: entity, conversational_search_spec: conversational_search_spec, tile_navigation_spec: tile_navigation_spec, language_code: language_code, region_code: region_code, place_id: place_id, user_attributes: user_attributes), call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Verify method calls - assert_equal 5, search_client_stub.call_count - end - end - end - - def test_configure - credentials_token = :dummy_value - - client = block_config = config = nil - dummy_stub = ClientStub.new nil - Gapic::Rest::ClientStub.stub :new, dummy_stub do - client = ::Google::Cloud::Retail::V2::SearchService::Rest::Client.new do |config| - config.credentials = credentials_token - end - end - - config = client.configure do |c| - block_config = c - end - - assert_same block_config, config - assert_kind_of ::Google::Cloud::Retail::V2::SearchService::Rest::Client::Configuration, config - end -end diff --git a/owl-bot-staging/google-cloud-retail-v2/test/google/cloud/retail/v2/search_service_test.rb b/owl-bot-staging/google-cloud-retail-v2/test/google/cloud/retail/v2/search_service_test.rb deleted file mode 100644 index a005e4e2cc3e..000000000000 --- a/owl-bot-staging/google-cloud-retail-v2/test/google/cloud/retail/v2/search_service_test.rb +++ /dev/null @@ -1,222 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -require "helper" - -require "gapic/grpc/service_stub" - -require "google/cloud/retail/v2/search_service_pb" -require "google/cloud/retail/v2/search_service" - -class ::Google::Cloud::Retail::V2::SearchService::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_search - # Create GRPC objects. - grpc_response = ::Google::Cloud::Retail::V2::SearchResponse.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. - placement = "hello world" - branch = "hello world" - query = "hello world" - visitor_id = "hello world" - user_info = {} - page_size = 42 - page_token = "hello world" - offset = 42 - filter = "hello world" - canonical_filter = "hello world" - order_by = "hello world" - facet_specs = [{}] - dynamic_facet_spec = {} - boost_spec = {} - query_expansion_spec = {} - variant_rollup_keys = ["hello world"] - page_categories = ["hello world"] - search_mode = :SEARCH_MODE_UNSPECIFIED - personalization_spec = {} - labels = {} - spell_correction_spec = {} - entity = "hello world" - conversational_search_spec = {} - tile_navigation_spec = {} - language_code = "hello world" - region_code = "hello world" - place_id = "hello world" - user_attributes = {} - - search_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :search, name - assert_kind_of ::Google::Cloud::Retail::V2::SearchRequest, request - assert_equal "hello world", request["placement"] - assert_equal "hello world", request["branch"] - assert_equal "hello world", request["query"] - assert_equal "hello world", request["visitor_id"] - assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::Retail::V2::UserInfo), request["user_info"] - assert_equal 42, request["page_size"] - assert_equal "hello world", request["page_token"] - assert_equal 42, request["offset"] - assert_equal "hello world", request["filter"] - assert_equal "hello world", request["canonical_filter"] - assert_equal "hello world", request["order_by"] - assert_kind_of ::Google::Cloud::Retail::V2::SearchRequest::FacetSpec, request["facet_specs"].first - assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::Retail::V2::SearchRequest::DynamicFacetSpec), request["dynamic_facet_spec"] - assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::Retail::V2::SearchRequest::BoostSpec), request["boost_spec"] - assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::Retail::V2::SearchRequest::QueryExpansionSpec), request["query_expansion_spec"] - assert_equal ["hello world"], request["variant_rollup_keys"] - assert_equal ["hello world"], request["page_categories"] - assert_equal :SEARCH_MODE_UNSPECIFIED, request["search_mode"] - assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::Retail::V2::SearchRequest::PersonalizationSpec), request["personalization_spec"] - assert_equal({}, request["labels"].to_h) - assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::Retail::V2::SearchRequest::SpellCorrectionSpec), request["spell_correction_spec"] - assert request.has_spell_correction_spec? - assert_equal "hello world", request["entity"] - assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::Retail::V2::SearchRequest::ConversationalSearchSpec), request["conversational_search_spec"] - assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::Retail::V2::SearchRequest::TileNavigationSpec), request["tile_navigation_spec"] - assert_equal "hello world", request["language_code"] - assert_equal "hello world", request["region_code"] - assert_equal "hello world", request["place_id"] - assert_equal({}, request["user_attributes"].to_h) - refute_nil options - end - - Gapic::ServiceStub.stub :new, search_client_stub do - # Create client - client = ::Google::Cloud::Retail::V2::SearchService::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.search({ placement: placement, branch: branch, query: query, visitor_id: visitor_id, user_info: user_info, page_size: page_size, page_token: page_token, offset: offset, filter: filter, canonical_filter: canonical_filter, order_by: order_by, facet_specs: facet_specs, dynamic_facet_spec: dynamic_facet_spec, boost_spec: boost_spec, query_expansion_spec: query_expansion_spec, variant_rollup_keys: variant_rollup_keys, page_categories: page_categories, search_mode: search_mode, personalization_spec: personalization_spec, labels: labels, spell_correction_spec: spell_correction_spec, entity: entity, conversational_search_spec: conversational_search_spec, tile_navigation_spec: tile_navigation_spec, language_code: language_code, region_code: region_code, place_id: place_id, user_attributes: user_attributes }) 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 placement: placement, branch: branch, query: query, visitor_id: visitor_id, user_info: user_info, page_size: page_size, page_token: page_token, offset: offset, filter: filter, canonical_filter: canonical_filter, order_by: order_by, facet_specs: facet_specs, dynamic_facet_spec: dynamic_facet_spec, boost_spec: boost_spec, query_expansion_spec: query_expansion_spec, variant_rollup_keys: variant_rollup_keys, page_categories: page_categories, search_mode: search_mode, personalization_spec: personalization_spec, labels: labels, spell_correction_spec: spell_correction_spec, entity: entity, conversational_search_spec: conversational_search_spec, tile_navigation_spec: tile_navigation_spec, language_code: language_code, region_code: region_code, place_id: place_id, user_attributes: user_attributes 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 ::Google::Cloud::Retail::V2::SearchRequest.new(placement: placement, branch: branch, query: query, visitor_id: visitor_id, user_info: user_info, page_size: page_size, page_token: page_token, offset: offset, filter: filter, canonical_filter: canonical_filter, order_by: order_by, facet_specs: facet_specs, dynamic_facet_spec: dynamic_facet_spec, boost_spec: boost_spec, query_expansion_spec: query_expansion_spec, variant_rollup_keys: variant_rollup_keys, page_categories: page_categories, search_mode: search_mode, personalization_spec: personalization_spec, labels: labels, spell_correction_spec: spell_correction_spec, entity: entity, conversational_search_spec: conversational_search_spec, tile_navigation_spec: tile_navigation_spec, language_code: language_code, region_code: region_code, place_id: place_id, user_attributes: user_attributes) 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({ placement: placement, branch: branch, query: query, visitor_id: visitor_id, user_info: user_info, page_size: page_size, page_token: page_token, offset: offset, filter: filter, canonical_filter: canonical_filter, order_by: order_by, facet_specs: facet_specs, dynamic_facet_spec: dynamic_facet_spec, boost_spec: boost_spec, query_expansion_spec: query_expansion_spec, variant_rollup_keys: variant_rollup_keys, page_categories: page_categories, search_mode: search_mode, personalization_spec: personalization_spec, labels: labels, spell_correction_spec: spell_correction_spec, entity: entity, conversational_search_spec: conversational_search_spec, tile_navigation_spec: tile_navigation_spec, language_code: language_code, region_code: region_code, place_id: place_id, user_attributes: user_attributes }, 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(::Google::Cloud::Retail::V2::SearchRequest.new(placement: placement, branch: branch, query: query, visitor_id: visitor_id, user_info: user_info, page_size: page_size, page_token: page_token, offset: offset, filter: filter, canonical_filter: canonical_filter, order_by: order_by, facet_specs: facet_specs, dynamic_facet_spec: dynamic_facet_spec, boost_spec: boost_spec, query_expansion_spec: query_expansion_spec, variant_rollup_keys: variant_rollup_keys, page_categories: page_categories, search_mode: search_mode, personalization_spec: personalization_spec, labels: labels, spell_correction_spec: spell_correction_spec, entity: entity, conversational_search_spec: conversational_search_spec, tile_navigation_spec: tile_navigation_spec, language_code: language_code, region_code: region_code, place_id: place_id, user_attributes: user_attributes), 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_client_stub.call_rpc_count - end - end - - def test_configure - grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - - client = block_config = config = nil - dummy_stub = ClientStub.new nil, nil - Gapic::ServiceStub.stub :new, dummy_stub do - client = ::Google::Cloud::Retail::V2::SearchService::Client.new do |config| - config.credentials = grpc_channel - end - end - - config = client.configure do |c| - block_config = c - end - - assert_same block_config, config - assert_kind_of ::Google::Cloud::Retail::V2::SearchService::Client::Configuration, config - end - - def test_credentials - key = OpenSSL::PKey::RSA.new 2048 - cred_json = { - "private_key" => key.to_pem, - "client_email" => "app@developer.gserviceaccount.com", - "type" => "service_account" - } - key_file = StringIO.new cred_json.to_json - creds = Google::Auth::ServiceAccountCredentials.make_creds({ json_key_io: key_file }) - - dummy_stub = ClientStub.new nil, nil - Gapic::ServiceStub.stub :new, dummy_stub do - client = ::Google::Cloud::Retail::V2::SearchService::Client.new do |config| - config.credentials = creds - end - assert_kind_of ::Google::Cloud::Retail::V2::SearchService::Client, client - assert_equal creds, client.configure.credentials - end - end -end diff --git a/owl-bot-staging/google-cloud-retail-v2/test/google/cloud/retail/v2/serving_config_service_paths_test.rb b/owl-bot-staging/google-cloud-retail-v2/test/google/cloud/retail/v2/serving_config_service_paths_test.rb deleted file mode 100644 index 68252813b8a3..000000000000 --- a/owl-bot-staging/google-cloud-retail-v2/test/google/cloud/retail/v2/serving_config_service_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/cloud/retail/v2/serving_config_service" - -class ::Google::Cloud::Retail::V2::ServingConfigService::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_catalog_path - grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - ::Gapic::ServiceStub.stub :new, DummyStub.new do - client = ::Google::Cloud::Retail::V2::ServingConfigService::Client.new do |config| - config.credentials = grpc_channel - end - - path = client.catalog_path project: "value0", location: "value1", catalog: "value2" - assert_equal "projects/value0/locations/value1/catalogs/value2", path - end - end - - def test_serving_config_path - grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - ::Gapic::ServiceStub.stub :new, DummyStub.new do - client = ::Google::Cloud::Retail::V2::ServingConfigService::Client.new do |config| - config.credentials = grpc_channel - end - - path = client.serving_config_path project: "value0", location: "value1", catalog: "value2", serving_config: "value3" - assert_equal "projects/value0/locations/value1/catalogs/value2/servingConfigs/value3", path - end - end -end diff --git a/owl-bot-staging/google-cloud-retail-v2/test/google/cloud/retail/v2/serving_config_service_rest_test.rb b/owl-bot-staging/google-cloud-retail-v2/test/google/cloud/retail/v2/serving_config_service_rest_test.rb deleted file mode 100644 index ac8e84b3513b..000000000000 --- a/owl-bot-staging/google-cloud-retail-v2/test/google/cloud/retail/v2/serving_config_service_rest_test.rb +++ /dev/null @@ -1,484 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -require "helper" -require "gapic/rest" -require "google/cloud/retail/v2/serving_config_service_pb" -require "google/cloud/retail/v2/serving_config_service/rest" - - -class ::Google::Cloud::Retail::V2::ServingConfigService::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_serving_config - # Create test objects. - client_result = ::Google::Cloud::Retail::V2::ServingConfig.new - http_response = OpenStruct.new body: client_result.to_json - - call_options = {} - - # Create request parameters for a unary method. - parent = "hello world" - serving_config = {} - serving_config_id = "hello world" - - create_serving_config_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| - assert options.metadata.key? :"x-goog-api-client" - assert options.metadata[:"x-goog-api-client"].include? "rest" - refute options.metadata[:"x-goog-api-client"].include? "grpc" - end - - ::Google::Cloud::Retail::V2::ServingConfigService::Rest::ServiceStub.stub :transcode_create_serving_config_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, create_serving_config_client_stub do - # Create client - client = ::Google::Cloud::Retail::V2::ServingConfigService::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - client.create_serving_config({ parent: parent, serving_config: serving_config, serving_config_id: serving_config_id }) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use named arguments - client.create_serving_config parent: parent, serving_config: serving_config, serving_config_id: serving_config_id do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object - client.create_serving_config ::Google::Cloud::Retail::V2::CreateServingConfigRequest.new(parent: parent, serving_config: serving_config, serving_config_id: serving_config_id) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use hash object with options - client.create_serving_config({ parent: parent, serving_config: serving_config, serving_config_id: serving_config_id }, call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object with options - client.create_serving_config(::Google::Cloud::Retail::V2::CreateServingConfigRequest.new(parent: parent, serving_config: serving_config, serving_config_id: serving_config_id), call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Verify method calls - assert_equal 5, create_serving_config_client_stub.call_count - end - end - end - - def test_delete_serving_config - # Create test objects. - client_result = ::Google::Protobuf::Empty.new - http_response = OpenStruct.new body: client_result.to_json - - call_options = {} - - # Create request parameters for a unary method. - name = "hello world" - - delete_serving_config_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| - assert options.metadata.key? :"x-goog-api-client" - assert options.metadata[:"x-goog-api-client"].include? "rest" - refute options.metadata[:"x-goog-api-client"].include? "grpc" - end - - ::Google::Cloud::Retail::V2::ServingConfigService::Rest::ServiceStub.stub :transcode_delete_serving_config_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, delete_serving_config_client_stub do - # Create client - client = ::Google::Cloud::Retail::V2::ServingConfigService::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - client.delete_serving_config({ name: name }) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use named arguments - client.delete_serving_config name: name do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object - client.delete_serving_config ::Google::Cloud::Retail::V2::DeleteServingConfigRequest.new(name: name) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use hash object with options - client.delete_serving_config({ name: name }, call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object with options - client.delete_serving_config(::Google::Cloud::Retail::V2::DeleteServingConfigRequest.new(name: name), call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Verify method calls - assert_equal 5, delete_serving_config_client_stub.call_count - end - end - end - - def test_update_serving_config - # Create test objects. - client_result = ::Google::Cloud::Retail::V2::ServingConfig.new - http_response = OpenStruct.new body: client_result.to_json - - call_options = {} - - # Create request parameters for a unary method. - serving_config = {} - update_mask = {} - - update_serving_config_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| - assert options.metadata.key? :"x-goog-api-client" - assert options.metadata[:"x-goog-api-client"].include? "rest" - refute options.metadata[:"x-goog-api-client"].include? "grpc" - end - - ::Google::Cloud::Retail::V2::ServingConfigService::Rest::ServiceStub.stub :transcode_update_serving_config_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, update_serving_config_client_stub do - # Create client - client = ::Google::Cloud::Retail::V2::ServingConfigService::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - client.update_serving_config({ serving_config: serving_config, update_mask: update_mask }) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use named arguments - client.update_serving_config serving_config: serving_config, update_mask: update_mask do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object - client.update_serving_config ::Google::Cloud::Retail::V2::UpdateServingConfigRequest.new(serving_config: serving_config, update_mask: update_mask) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use hash object with options - client.update_serving_config({ serving_config: serving_config, update_mask: update_mask }, call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object with options - client.update_serving_config(::Google::Cloud::Retail::V2::UpdateServingConfigRequest.new(serving_config: serving_config, update_mask: update_mask), call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Verify method calls - assert_equal 5, update_serving_config_client_stub.call_count - end - end - end - - def test_get_serving_config - # Create test objects. - client_result = ::Google::Cloud::Retail::V2::ServingConfig.new - http_response = OpenStruct.new body: client_result.to_json - - call_options = {} - - # Create request parameters for a unary method. - name = "hello world" - - get_serving_config_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| - assert options.metadata.key? :"x-goog-api-client" - assert options.metadata[:"x-goog-api-client"].include? "rest" - refute options.metadata[:"x-goog-api-client"].include? "grpc" - end - - ::Google::Cloud::Retail::V2::ServingConfigService::Rest::ServiceStub.stub :transcode_get_serving_config_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, get_serving_config_client_stub do - # Create client - client = ::Google::Cloud::Retail::V2::ServingConfigService::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - client.get_serving_config({ name: name }) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use named arguments - client.get_serving_config name: name do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object - client.get_serving_config ::Google::Cloud::Retail::V2::GetServingConfigRequest.new(name: name) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use hash object with options - client.get_serving_config({ name: name }, call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object with options - client.get_serving_config(::Google::Cloud::Retail::V2::GetServingConfigRequest.new(name: name), call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Verify method calls - assert_equal 5, get_serving_config_client_stub.call_count - end - end - end - - def test_list_serving_configs - # Create test objects. - client_result = ::Google::Cloud::Retail::V2::ListServingConfigsResponse.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_serving_configs_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| - assert options.metadata.key? :"x-goog-api-client" - assert options.metadata[:"x-goog-api-client"].include? "rest" - refute options.metadata[:"x-goog-api-client"].include? "grpc" - end - - ::Google::Cloud::Retail::V2::ServingConfigService::Rest::ServiceStub.stub :transcode_list_serving_configs_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, list_serving_configs_client_stub do - # Create client - client = ::Google::Cloud::Retail::V2::ServingConfigService::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - client.list_serving_configs({ 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_serving_configs 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_serving_configs ::Google::Cloud::Retail::V2::ListServingConfigsRequest.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_serving_configs({ 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_serving_configs(::Google::Cloud::Retail::V2::ListServingConfigsRequest.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_serving_configs_client_stub.call_count - end - end - end - - def test_add_control - # Create test objects. - client_result = ::Google::Cloud::Retail::V2::ServingConfig.new - http_response = OpenStruct.new body: client_result.to_json - - call_options = {} - - # Create request parameters for a unary method. - serving_config = "hello world" - control_id = "hello world" - - add_control_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| - assert options.metadata.key? :"x-goog-api-client" - assert options.metadata[:"x-goog-api-client"].include? "rest" - refute options.metadata[:"x-goog-api-client"].include? "grpc" - end - - ::Google::Cloud::Retail::V2::ServingConfigService::Rest::ServiceStub.stub :transcode_add_control_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, add_control_client_stub do - # Create client - client = ::Google::Cloud::Retail::V2::ServingConfigService::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - client.add_control({ serving_config: serving_config, control_id: control_id }) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use named arguments - client.add_control serving_config: serving_config, control_id: control_id do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object - client.add_control ::Google::Cloud::Retail::V2::AddControlRequest.new(serving_config: serving_config, control_id: control_id) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use hash object with options - client.add_control({ serving_config: serving_config, control_id: control_id }, call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object with options - client.add_control(::Google::Cloud::Retail::V2::AddControlRequest.new(serving_config: serving_config, control_id: control_id), call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Verify method calls - assert_equal 5, add_control_client_stub.call_count - end - end - end - - def test_remove_control - # Create test objects. - client_result = ::Google::Cloud::Retail::V2::ServingConfig.new - http_response = OpenStruct.new body: client_result.to_json - - call_options = {} - - # Create request parameters for a unary method. - serving_config = "hello world" - control_id = "hello world" - - remove_control_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| - assert options.metadata.key? :"x-goog-api-client" - assert options.metadata[:"x-goog-api-client"].include? "rest" - refute options.metadata[:"x-goog-api-client"].include? "grpc" - end - - ::Google::Cloud::Retail::V2::ServingConfigService::Rest::ServiceStub.stub :transcode_remove_control_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, remove_control_client_stub do - # Create client - client = ::Google::Cloud::Retail::V2::ServingConfigService::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - client.remove_control({ serving_config: serving_config, control_id: control_id }) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use named arguments - client.remove_control serving_config: serving_config, control_id: control_id do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object - client.remove_control ::Google::Cloud::Retail::V2::RemoveControlRequest.new(serving_config: serving_config, control_id: control_id) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use hash object with options - client.remove_control({ serving_config: serving_config, control_id: control_id }, call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object with options - client.remove_control(::Google::Cloud::Retail::V2::RemoveControlRequest.new(serving_config: serving_config, control_id: control_id), call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Verify method calls - assert_equal 5, remove_control_client_stub.call_count - end - end - end - - def test_configure - credentials_token = :dummy_value - - client = block_config = config = nil - dummy_stub = ClientStub.new nil - Gapic::Rest::ClientStub.stub :new, dummy_stub do - client = ::Google::Cloud::Retail::V2::ServingConfigService::Rest::Client.new do |config| - config.credentials = credentials_token - end - end - - config = client.configure do |c| - block_config = c - end - - assert_same block_config, config - assert_kind_of ::Google::Cloud::Retail::V2::ServingConfigService::Rest::Client::Configuration, config - end -end diff --git a/owl-bot-staging/google-cloud-retail-v2/test/google/cloud/retail/v2/serving_config_service_test.rb b/owl-bot-staging/google-cloud-retail-v2/test/google/cloud/retail/v2/serving_config_service_test.rb deleted file mode 100644 index 693621620896..000000000000 --- a/owl-bot-staging/google-cloud-retail-v2/test/google/cloud/retail/v2/serving_config_service_test.rb +++ /dev/null @@ -1,529 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -require "helper" - -require "gapic/grpc/service_stub" - -require "google/cloud/retail/v2/serving_config_service_pb" -require "google/cloud/retail/v2/serving_config_service" - -class ::Google::Cloud::Retail::V2::ServingConfigService::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_serving_config - # Create GRPC objects. - grpc_response = ::Google::Cloud::Retail::V2::ServingConfig.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" - serving_config = {} - serving_config_id = "hello world" - - create_serving_config_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :create_serving_config, name - assert_kind_of ::Google::Cloud::Retail::V2::CreateServingConfigRequest, request - assert_equal "hello world", request["parent"] - assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::Retail::V2::ServingConfig), request["serving_config"] - assert_equal "hello world", request["serving_config_id"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, create_serving_config_client_stub do - # Create client - client = ::Google::Cloud::Retail::V2::ServingConfigService::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.create_serving_config({ parent: parent, serving_config: serving_config, serving_config_id: serving_config_id }) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use named arguments - client.create_serving_config parent: parent, serving_config: serving_config, serving_config_id: serving_config_id do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object - client.create_serving_config ::Google::Cloud::Retail::V2::CreateServingConfigRequest.new(parent: parent, serving_config: serving_config, serving_config_id: serving_config_id) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use hash object with options - client.create_serving_config({ parent: parent, serving_config: serving_config, serving_config_id: serving_config_id }, grpc_options) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object with options - client.create_serving_config(::Google::Cloud::Retail::V2::CreateServingConfigRequest.new(parent: parent, serving_config: serving_config, serving_config_id: serving_config_id), grpc_options) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Verify method calls - assert_equal 5, create_serving_config_client_stub.call_rpc_count - end - end - - def test_delete_serving_config - # 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_serving_config_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :delete_serving_config, name - assert_kind_of ::Google::Cloud::Retail::V2::DeleteServingConfigRequest, request - assert_equal "hello world", request["name"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, delete_serving_config_client_stub do - # Create client - client = ::Google::Cloud::Retail::V2::ServingConfigService::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.delete_serving_config({ name: name }) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use named arguments - client.delete_serving_config name: name do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object - client.delete_serving_config ::Google::Cloud::Retail::V2::DeleteServingConfigRequest.new(name: name) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use hash object with options - client.delete_serving_config({ name: name }, grpc_options) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object with options - client.delete_serving_config(::Google::Cloud::Retail::V2::DeleteServingConfigRequest.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_serving_config_client_stub.call_rpc_count - end - end - - def test_update_serving_config - # Create GRPC objects. - grpc_response = ::Google::Cloud::Retail::V2::ServingConfig.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. - serving_config = {} - update_mask = {} - - update_serving_config_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :update_serving_config, name - assert_kind_of ::Google::Cloud::Retail::V2::UpdateServingConfigRequest, request - assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::Retail::V2::ServingConfig), request["serving_config"] - assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Protobuf::FieldMask), request["update_mask"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, update_serving_config_client_stub do - # Create client - client = ::Google::Cloud::Retail::V2::ServingConfigService::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.update_serving_config({ serving_config: serving_config, update_mask: update_mask }) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use named arguments - client.update_serving_config serving_config: serving_config, update_mask: update_mask do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object - client.update_serving_config ::Google::Cloud::Retail::V2::UpdateServingConfigRequest.new(serving_config: serving_config, update_mask: update_mask) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use hash object with options - client.update_serving_config({ serving_config: serving_config, update_mask: update_mask }, grpc_options) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object with options - client.update_serving_config(::Google::Cloud::Retail::V2::UpdateServingConfigRequest.new(serving_config: serving_config, update_mask: update_mask), grpc_options) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Verify method calls - assert_equal 5, update_serving_config_client_stub.call_rpc_count - end - end - - def test_get_serving_config - # Create GRPC objects. - grpc_response = ::Google::Cloud::Retail::V2::ServingConfig.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_serving_config_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :get_serving_config, name - assert_kind_of ::Google::Cloud::Retail::V2::GetServingConfigRequest, request - assert_equal "hello world", request["name"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, get_serving_config_client_stub do - # Create client - client = ::Google::Cloud::Retail::V2::ServingConfigService::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.get_serving_config({ name: name }) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use named arguments - client.get_serving_config name: name do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object - client.get_serving_config ::Google::Cloud::Retail::V2::GetServingConfigRequest.new(name: name) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use hash object with options - client.get_serving_config({ name: name }, grpc_options) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object with options - client.get_serving_config(::Google::Cloud::Retail::V2::GetServingConfigRequest.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_serving_config_client_stub.call_rpc_count - end - end - - def test_list_serving_configs - # Create GRPC objects. - grpc_response = ::Google::Cloud::Retail::V2::ListServingConfigsResponse.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_serving_configs_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :list_serving_configs, name - assert_kind_of ::Google::Cloud::Retail::V2::ListServingConfigsRequest, 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_serving_configs_client_stub do - # Create client - client = ::Google::Cloud::Retail::V2::ServingConfigService::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.list_serving_configs({ 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_serving_configs 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_serving_configs ::Google::Cloud::Retail::V2::ListServingConfigsRequest.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_serving_configs({ 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_serving_configs(::Google::Cloud::Retail::V2::ListServingConfigsRequest.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_serving_configs_client_stub.call_rpc_count - end - end - - def test_add_control - # Create GRPC objects. - grpc_response = ::Google::Cloud::Retail::V2::ServingConfig.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. - serving_config = "hello world" - control_id = "hello world" - - add_control_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :add_control, name - assert_kind_of ::Google::Cloud::Retail::V2::AddControlRequest, request - assert_equal "hello world", request["serving_config"] - assert_equal "hello world", request["control_id"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, add_control_client_stub do - # Create client - client = ::Google::Cloud::Retail::V2::ServingConfigService::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.add_control({ serving_config: serving_config, control_id: control_id }) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use named arguments - client.add_control serving_config: serving_config, control_id: control_id do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object - client.add_control ::Google::Cloud::Retail::V2::AddControlRequest.new(serving_config: serving_config, control_id: control_id) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use hash object with options - client.add_control({ serving_config: serving_config, control_id: control_id }, grpc_options) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object with options - client.add_control(::Google::Cloud::Retail::V2::AddControlRequest.new(serving_config: serving_config, control_id: control_id), grpc_options) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Verify method calls - assert_equal 5, add_control_client_stub.call_rpc_count - end - end - - def test_remove_control - # Create GRPC objects. - grpc_response = ::Google::Cloud::Retail::V2::ServingConfig.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. - serving_config = "hello world" - control_id = "hello world" - - remove_control_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :remove_control, name - assert_kind_of ::Google::Cloud::Retail::V2::RemoveControlRequest, request - assert_equal "hello world", request["serving_config"] - assert_equal "hello world", request["control_id"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, remove_control_client_stub do - # Create client - client = ::Google::Cloud::Retail::V2::ServingConfigService::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.remove_control({ serving_config: serving_config, control_id: control_id }) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use named arguments - client.remove_control serving_config: serving_config, control_id: control_id do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object - client.remove_control ::Google::Cloud::Retail::V2::RemoveControlRequest.new(serving_config: serving_config, control_id: control_id) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use hash object with options - client.remove_control({ serving_config: serving_config, control_id: control_id }, grpc_options) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object with options - client.remove_control(::Google::Cloud::Retail::V2::RemoveControlRequest.new(serving_config: serving_config, control_id: control_id), grpc_options) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Verify method calls - assert_equal 5, remove_control_client_stub.call_rpc_count - end - end - - def test_configure - grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - - client = block_config = config = nil - dummy_stub = ClientStub.new nil, nil - Gapic::ServiceStub.stub :new, dummy_stub do - client = ::Google::Cloud::Retail::V2::ServingConfigService::Client.new do |config| - config.credentials = grpc_channel - end - end - - config = client.configure do |c| - block_config = c - end - - assert_same block_config, config - assert_kind_of ::Google::Cloud::Retail::V2::ServingConfigService::Client::Configuration, config - end - - def test_credentials - key = OpenSSL::PKey::RSA.new 2048 - cred_json = { - "private_key" => key.to_pem, - "client_email" => "app@developer.gserviceaccount.com", - "type" => "service_account" - } - key_file = StringIO.new cred_json.to_json - creds = Google::Auth::ServiceAccountCredentials.make_creds({ json_key_io: key_file }) - - dummy_stub = ClientStub.new nil, nil - Gapic::ServiceStub.stub :new, dummy_stub do - client = ::Google::Cloud::Retail::V2::ServingConfigService::Client.new do |config| - config.credentials = creds - end - assert_kind_of ::Google::Cloud::Retail::V2::ServingConfigService::Client, client - assert_equal creds, client.configure.credentials - end - end -end diff --git a/owl-bot-staging/google-cloud-retail-v2/test/google/cloud/retail/v2/user_event_service_operations_test.rb b/owl-bot-staging/google-cloud-retail-v2/test/google/cloud/retail/v2/user_event_service_operations_test.rb deleted file mode 100644 index df06fda9f578..000000000000 --- a/owl-bot-staging/google-cloud-retail-v2/test/google/cloud/retail/v2/user_event_service_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/cloud/retail/v2/user_event_service_pb" -require "google/cloud/retail/v2/user_event_service_services_pb" -require "google/cloud/retail/v2/user_event_service" - -class ::Google::Cloud::Retail::V2::UserEventService::OperationsTest < Minitest::Test - class ClientStub - attr_accessor :call_rpc_count, :requests - - def initialize response, operation, &block - @response = response - @operation = operation - @block = block - @call_rpc_count = 0 - @requests = [] - end - - def call_rpc *args, **kwargs - @call_rpc_count += 1 - - @requests << @block&.call(*args, **kwargs) - - catch :response do - yield @response, @operation if block_given? - @response - end - end - - def endpoint - "endpoint.example.com" - end - - def universe_domain - "example.com" - end - - def stub_logger - nil - end - - def logger - nil - end - end - - def test_list_operations - # Create GRPC objects. - grpc_response = ::Google::Longrunning::ListOperationsResponse.new - grpc_operation = GRPC::ActiveCall::Operation.new nil - grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - grpc_options = {} - - # Create request parameters for a unary method. - name = "hello world" - filter = "hello world" - page_size = 42 - page_token = "hello world" - return_partial_success = true - - list_operations_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :list_operations, name - assert_kind_of ::Google::Longrunning::ListOperationsRequest, request - assert_equal "hello world", request["name"] - assert_equal "hello world", request["filter"] - assert_equal 42, request["page_size"] - assert_equal "hello world", request["page_token"] - assert_equal true, request["return_partial_success"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, list_operations_client_stub do - # Create client - client = ::Google::Cloud::Retail::V2::UserEventService::Operations.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.list_operations({ name: name, filter: filter, page_size: page_size, page_token: page_token, return_partial_success: return_partial_success }) do |response, operation| - assert_kind_of Gapic::PagedEnumerable, response - assert_equal grpc_response, response.response - assert_equal grpc_operation, operation - end - - # Use named arguments - client.list_operations name: name, filter: filter, page_size: page_size, page_token: page_token, return_partial_success: return_partial_success do |response, operation| - assert_kind_of Gapic::PagedEnumerable, response - assert_equal grpc_response, response.response - assert_equal grpc_operation, operation - end - - # Use protobuf object - client.list_operations ::Google::Longrunning::ListOperationsRequest.new(name: name, filter: filter, page_size: page_size, page_token: page_token, return_partial_success: return_partial_success) do |response, operation| - assert_kind_of Gapic::PagedEnumerable, response - assert_equal grpc_response, response.response - assert_equal grpc_operation, operation - end - - # Use hash object with options - client.list_operations({ name: name, filter: filter, page_size: page_size, page_token: page_token, return_partial_success: return_partial_success }, grpc_options) do |response, operation| - assert_kind_of Gapic::PagedEnumerable, response - assert_equal grpc_response, response.response - assert_equal grpc_operation, operation - end - - # Use protobuf object with options - client.list_operations(::Google::Longrunning::ListOperationsRequest.new(name: name, filter: filter, page_size: page_size, page_token: page_token, return_partial_success: return_partial_success), grpc_options) do |response, operation| - assert_kind_of Gapic::PagedEnumerable, response - assert_equal grpc_response, response.response - assert_equal grpc_operation, operation - end - - # Verify method calls - assert_equal 5, list_operations_client_stub.call_rpc_count - end - end - - def test_get_operation - # Create GRPC objects. - grpc_response = ::Google::Longrunning::Operation.new - grpc_operation = GRPC::ActiveCall::Operation.new nil - grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - grpc_options = {} - - # Create request parameters for a unary method. - name = "hello world" - - get_operation_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :get_operation, name - assert_kind_of ::Google::Longrunning::GetOperationRequest, request - assert_equal "hello world", request["name"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, get_operation_client_stub do - # Create client - client = ::Google::Cloud::Retail::V2::UserEventService::Operations.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.get_operation({ name: name }) do |response, operation| - assert_kind_of Gapic::Operation, response - assert_equal grpc_response, response.grpc_op - assert_equal grpc_operation, operation - end - - # Use named arguments - client.get_operation name: name do |response, operation| - assert_kind_of Gapic::Operation, response - assert_equal grpc_response, response.grpc_op - assert_equal grpc_operation, operation - end - - # Use protobuf object - client.get_operation ::Google::Longrunning::GetOperationRequest.new(name: name) do |response, operation| - assert_kind_of Gapic::Operation, response - assert_equal grpc_response, response.grpc_op - assert_equal grpc_operation, operation - end - - # Use hash object with options - client.get_operation({ name: name }, grpc_options) do |response, operation| - assert_kind_of Gapic::Operation, response - assert_equal grpc_response, response.grpc_op - assert_equal grpc_operation, operation - end - - # Use protobuf object with options - client.get_operation(::Google::Longrunning::GetOperationRequest.new(name: name), grpc_options) do |response, operation| - assert_kind_of Gapic::Operation, response - assert_equal grpc_response, response.grpc_op - assert_equal grpc_operation, operation - end - - # Verify method calls - assert_equal 5, get_operation_client_stub.call_rpc_count - end - end - - def test_delete_operation - # Create GRPC objects. - grpc_response = ::Google::Protobuf::Empty.new - grpc_operation = GRPC::ActiveCall::Operation.new nil - grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - grpc_options = {} - - # Create request parameters for a unary method. - name = "hello world" - - delete_operation_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :delete_operation, name - assert_kind_of ::Google::Longrunning::DeleteOperationRequest, request - assert_equal "hello world", request["name"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, delete_operation_client_stub do - # Create client - client = ::Google::Cloud::Retail::V2::UserEventService::Operations.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.delete_operation({ name: name }) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use named arguments - client.delete_operation name: name do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object - client.delete_operation ::Google::Longrunning::DeleteOperationRequest.new(name: name) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use hash object with options - client.delete_operation({ name: name }, grpc_options) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object with options - client.delete_operation(::Google::Longrunning::DeleteOperationRequest.new(name: name), grpc_options) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Verify method calls - assert_equal 5, delete_operation_client_stub.call_rpc_count - end - end - - def test_cancel_operation - # Create GRPC objects. - grpc_response = ::Google::Protobuf::Empty.new - grpc_operation = GRPC::ActiveCall::Operation.new nil - grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - grpc_options = {} - - # Create request parameters for a unary method. - name = "hello world" - - cancel_operation_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :cancel_operation, name - assert_kind_of ::Google::Longrunning::CancelOperationRequest, request - assert_equal "hello world", request["name"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, cancel_operation_client_stub do - # Create client - client = ::Google::Cloud::Retail::V2::UserEventService::Operations.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.cancel_operation({ name: name }) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use named arguments - client.cancel_operation name: name do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object - client.cancel_operation ::Google::Longrunning::CancelOperationRequest.new(name: name) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use hash object with options - client.cancel_operation({ name: name }, grpc_options) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object with options - client.cancel_operation(::Google::Longrunning::CancelOperationRequest.new(name: name), grpc_options) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Verify method calls - assert_equal 5, cancel_operation_client_stub.call_rpc_count - end - end - - def test_wait_operation - # Create GRPC objects. - grpc_response = ::Google::Longrunning::Operation.new - grpc_operation = GRPC::ActiveCall::Operation.new nil - grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - grpc_options = {} - - # Create request parameters for a unary method. - name = "hello world" - timeout = {} - - wait_operation_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :wait_operation, name - assert_kind_of ::Google::Longrunning::WaitOperationRequest, request - assert_equal "hello world", request["name"] - assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Protobuf::Duration), request["timeout"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, wait_operation_client_stub do - # Create client - client = ::Google::Cloud::Retail::V2::UserEventService::Operations.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.wait_operation({ name: name, timeout: timeout }) do |response, operation| - assert_kind_of Gapic::Operation, response - assert_equal grpc_response, response.grpc_op - assert_equal grpc_operation, operation - end - - # Use named arguments - client.wait_operation name: name, timeout: timeout do |response, operation| - assert_kind_of Gapic::Operation, response - assert_equal grpc_response, response.grpc_op - assert_equal grpc_operation, operation - end - - # Use protobuf object - client.wait_operation ::Google::Longrunning::WaitOperationRequest.new(name: name, timeout: timeout) do |response, operation| - assert_kind_of Gapic::Operation, response - assert_equal grpc_response, response.grpc_op - assert_equal grpc_operation, operation - end - - # Use hash object with options - client.wait_operation({ name: name, timeout: timeout }, grpc_options) do |response, operation| - assert_kind_of Gapic::Operation, response - assert_equal grpc_response, response.grpc_op - assert_equal grpc_operation, operation - end - - # Use protobuf object with options - client.wait_operation(::Google::Longrunning::WaitOperationRequest.new(name: name, timeout: timeout), grpc_options) do |response, operation| - assert_kind_of Gapic::Operation, response - assert_equal grpc_response, response.grpc_op - assert_equal grpc_operation, operation - end - - # Verify method calls - assert_equal 5, wait_operation_client_stub.call_rpc_count - end - end - - def test_configure - grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - - client = block_config = config = nil - dummy_stub = ClientStub.new nil, nil - Gapic::ServiceStub.stub :new, dummy_stub do - client = ::Google::Cloud::Retail::V2::UserEventService::Operations.new do |config| - config.credentials = grpc_channel - end - end - - config = client.configure do |c| - block_config = c - end - - assert_same block_config, config - assert_kind_of ::Google::Cloud::Retail::V2::UserEventService::Operations::Configuration, config - end -end diff --git a/owl-bot-staging/google-cloud-retail-v2/test/google/cloud/retail/v2/user_event_service_paths_test.rb b/owl-bot-staging/google-cloud-retail-v2/test/google/cloud/retail/v2/user_event_service_paths_test.rb deleted file mode 100644 index 359bdf51e611..000000000000 --- a/owl-bot-staging/google-cloud-retail-v2/test/google/cloud/retail/v2/user_event_service_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/cloud/retail/v2/user_event_service" - -class ::Google::Cloud::Retail::V2::UserEventService::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_catalog_path - grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - ::Gapic::ServiceStub.stub :new, DummyStub.new do - client = ::Google::Cloud::Retail::V2::UserEventService::Client.new do |config| - config.credentials = grpc_channel - end - - path = client.catalog_path project: "value0", location: "value1", catalog: "value2" - assert_equal "projects/value0/locations/value1/catalogs/value2", path - end - end - - def test_product_path - grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - ::Gapic::ServiceStub.stub :new, DummyStub.new do - client = ::Google::Cloud::Retail::V2::UserEventService::Client.new do |config| - config.credentials = grpc_channel - end - - path = client.product_path project: "value0", location: "value1", catalog: "value2", branch: "value3", product: "value4" - assert_equal "projects/value0/locations/value1/catalogs/value2/branches/value3/products/value4", path - end - end -end diff --git a/owl-bot-staging/google-cloud-retail-v2/test/google/cloud/retail/v2/user_event_service_rest_test.rb b/owl-bot-staging/google-cloud-retail-v2/test/google/cloud/retail/v2/user_event_service_rest_test.rb deleted file mode 100644 index 77ab953b6c06..000000000000 --- a/owl-bot-staging/google-cloud-retail-v2/test/google/cloud/retail/v2/user_event_service_rest_test.rb +++ /dev/null @@ -1,381 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -require "helper" -require "gapic/rest" -require "google/cloud/retail/v2/user_event_service_pb" -require "google/cloud/retail/v2/user_event_service/rest" - - -class ::Google::Cloud::Retail::V2::UserEventService::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_write_user_event - # Create test objects. - client_result = ::Google::Cloud::Retail::V2::UserEvent.new - http_response = OpenStruct.new body: client_result.to_json - - call_options = {} - - # Create request parameters for a unary method. - parent = "hello world" - user_event = {} - write_async = true - - write_user_event_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| - assert options.metadata.key? :"x-goog-api-client" - assert options.metadata[:"x-goog-api-client"].include? "rest" - refute options.metadata[:"x-goog-api-client"].include? "grpc" - end - - ::Google::Cloud::Retail::V2::UserEventService::Rest::ServiceStub.stub :transcode_write_user_event_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, write_user_event_client_stub do - # Create client - client = ::Google::Cloud::Retail::V2::UserEventService::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - client.write_user_event({ parent: parent, user_event: user_event, write_async: write_async }) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use named arguments - client.write_user_event parent: parent, user_event: user_event, write_async: write_async do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object - client.write_user_event ::Google::Cloud::Retail::V2::WriteUserEventRequest.new(parent: parent, user_event: user_event, write_async: write_async) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use hash object with options - client.write_user_event({ parent: parent, user_event: user_event, write_async: write_async }, call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object with options - client.write_user_event(::Google::Cloud::Retail::V2::WriteUserEventRequest.new(parent: parent, user_event: user_event, write_async: write_async), call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Verify method calls - assert_equal 5, write_user_event_client_stub.call_count - end - end - end - - def test_collect_user_event - # Create test objects. - client_result = ::Google::Api::HttpBody.new - http_response = OpenStruct.new body: client_result.to_json - - call_options = {} - - # Create request parameters for a unary method. - prebuilt_rule = "hello world" - parent = "hello world" - user_event = "hello world" - uri = "hello world" - ets = 42 - raw_json = "hello world" - - collect_user_event_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| - assert options.metadata.key? :"x-goog-api-client" - assert options.metadata[:"x-goog-api-client"].include? "rest" - refute options.metadata[:"x-goog-api-client"].include? "grpc" - end - - ::Google::Cloud::Retail::V2::UserEventService::Rest::ServiceStub.stub :transcode_collect_user_event_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, collect_user_event_client_stub do - # Create client - client = ::Google::Cloud::Retail::V2::UserEventService::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - client.collect_user_event({ prebuilt_rule: prebuilt_rule, parent: parent, user_event: user_event, uri: uri, ets: ets, raw_json: raw_json }) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use named arguments - client.collect_user_event prebuilt_rule: prebuilt_rule, parent: parent, user_event: user_event, uri: uri, ets: ets, raw_json: raw_json do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object - client.collect_user_event ::Google::Cloud::Retail::V2::CollectUserEventRequest.new(prebuilt_rule: prebuilt_rule, parent: parent, user_event: user_event, uri: uri, ets: ets, raw_json: raw_json) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use hash object with options - client.collect_user_event({ prebuilt_rule: prebuilt_rule, parent: parent, user_event: user_event, uri: uri, ets: ets, raw_json: raw_json }, call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object with options - client.collect_user_event(::Google::Cloud::Retail::V2::CollectUserEventRequest.new(prebuilt_rule: prebuilt_rule, parent: parent, user_event: user_event, uri: uri, ets: ets, raw_json: raw_json), call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Verify method calls - assert_equal 5, collect_user_event_client_stub.call_count - end - end - end - - def test_purge_user_events - # 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" - filter = "hello world" - force = true - - purge_user_events_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| - assert options.metadata.key? :"x-goog-api-client" - assert options.metadata[:"x-goog-api-client"].include? "rest" - refute options.metadata[:"x-goog-api-client"].include? "grpc" - end - - ::Google::Cloud::Retail::V2::UserEventService::Rest::ServiceStub.stub :transcode_purge_user_events_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, purge_user_events_client_stub do - # Create client - client = ::Google::Cloud::Retail::V2::UserEventService::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - client.purge_user_events({ parent: parent, filter: filter, force: force }) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use named arguments - client.purge_user_events parent: parent, filter: filter, force: force do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object - client.purge_user_events ::Google::Cloud::Retail::V2::PurgeUserEventsRequest.new(parent: parent, filter: filter, force: force) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use hash object with options - client.purge_user_events({ parent: parent, filter: filter, force: force }, call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object with options - client.purge_user_events(::Google::Cloud::Retail::V2::PurgeUserEventsRequest.new(parent: parent, filter: filter, force: force), call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Verify method calls - assert_equal 5, purge_user_events_client_stub.call_count - end - end - end - - def test_import_user_events - # 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" - input_config = {} - errors_config = {} - - import_user_events_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| - assert options.metadata.key? :"x-goog-api-client" - assert options.metadata[:"x-goog-api-client"].include? "rest" - refute options.metadata[:"x-goog-api-client"].include? "grpc" - end - - ::Google::Cloud::Retail::V2::UserEventService::Rest::ServiceStub.stub :transcode_import_user_events_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, import_user_events_client_stub do - # Create client - client = ::Google::Cloud::Retail::V2::UserEventService::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - client.import_user_events({ parent: parent, input_config: input_config, errors_config: errors_config }) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use named arguments - client.import_user_events parent: parent, input_config: input_config, errors_config: errors_config do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object - client.import_user_events ::Google::Cloud::Retail::V2::ImportUserEventsRequest.new(parent: parent, input_config: input_config, errors_config: errors_config) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use hash object with options - client.import_user_events({ parent: parent, input_config: input_config, errors_config: errors_config }, call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object with options - client.import_user_events(::Google::Cloud::Retail::V2::ImportUserEventsRequest.new(parent: parent, input_config: input_config, errors_config: errors_config), call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Verify method calls - assert_equal 5, import_user_events_client_stub.call_count - end - end - end - - def test_rejoin_user_events - # 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" - user_event_rejoin_scope = :USER_EVENT_REJOIN_SCOPE_UNSPECIFIED - - rejoin_user_events_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| - assert options.metadata.key? :"x-goog-api-client" - assert options.metadata[:"x-goog-api-client"].include? "rest" - refute options.metadata[:"x-goog-api-client"].include? "grpc" - end - - ::Google::Cloud::Retail::V2::UserEventService::Rest::ServiceStub.stub :transcode_rejoin_user_events_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, rejoin_user_events_client_stub do - # Create client - client = ::Google::Cloud::Retail::V2::UserEventService::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - client.rejoin_user_events({ parent: parent, user_event_rejoin_scope: user_event_rejoin_scope }) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use named arguments - client.rejoin_user_events parent: parent, user_event_rejoin_scope: user_event_rejoin_scope do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object - client.rejoin_user_events ::Google::Cloud::Retail::V2::RejoinUserEventsRequest.new(parent: parent, user_event_rejoin_scope: user_event_rejoin_scope) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use hash object with options - client.rejoin_user_events({ parent: parent, user_event_rejoin_scope: user_event_rejoin_scope }, call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object with options - client.rejoin_user_events(::Google::Cloud::Retail::V2::RejoinUserEventsRequest.new(parent: parent, user_event_rejoin_scope: user_event_rejoin_scope), call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Verify method calls - assert_equal 5, rejoin_user_events_client_stub.call_count - end - end - end - - def test_configure - credentials_token = :dummy_value - - client = block_config = config = nil - dummy_stub = ClientStub.new nil - Gapic::Rest::ClientStub.stub :new, dummy_stub do - client = ::Google::Cloud::Retail::V2::UserEventService::Rest::Client.new do |config| - config.credentials = credentials_token - end - end - - config = client.configure do |c| - block_config = c - end - - assert_same block_config, config - assert_kind_of ::Google::Cloud::Retail::V2::UserEventService::Rest::Client::Configuration, config - end -end diff --git a/owl-bot-staging/google-cloud-retail-v2/test/google/cloud/retail/v2/user_event_service_test.rb b/owl-bot-staging/google-cloud-retail-v2/test/google/cloud/retail/v2/user_event_service_test.rb deleted file mode 100644 index 9ae8db888385..000000000000 --- a/owl-bot-staging/google-cloud-retail-v2/test/google/cloud/retail/v2/user_event_service_test.rb +++ /dev/null @@ -1,448 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -require "helper" - -require "gapic/grpc/service_stub" - -require "google/cloud/retail/v2/user_event_service_pb" -require "google/cloud/retail/v2/user_event_service" - -class ::Google::Cloud::Retail::V2::UserEventService::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_write_user_event - # Create GRPC objects. - grpc_response = ::Google::Cloud::Retail::V2::UserEvent.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" - user_event = {} - write_async = true - - write_user_event_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :write_user_event, name - assert_kind_of ::Google::Cloud::Retail::V2::WriteUserEventRequest, request - assert_equal "hello world", request["parent"] - assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::Retail::V2::UserEvent), request["user_event"] - assert_equal true, request["write_async"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, write_user_event_client_stub do - # Create client - client = ::Google::Cloud::Retail::V2::UserEventService::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.write_user_event({ parent: parent, user_event: user_event, write_async: write_async }) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use named arguments - client.write_user_event parent: parent, user_event: user_event, write_async: write_async do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object - client.write_user_event ::Google::Cloud::Retail::V2::WriteUserEventRequest.new(parent: parent, user_event: user_event, write_async: write_async) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use hash object with options - client.write_user_event({ parent: parent, user_event: user_event, write_async: write_async }, grpc_options) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object with options - client.write_user_event(::Google::Cloud::Retail::V2::WriteUserEventRequest.new(parent: parent, user_event: user_event, write_async: write_async), grpc_options) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Verify method calls - assert_equal 5, write_user_event_client_stub.call_rpc_count - end - end - - def test_collect_user_event - # Create GRPC objects. - grpc_response = ::Google::Api::HttpBody.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. - prebuilt_rule = "hello world" - parent = "hello world" - user_event = "hello world" - uri = "hello world" - ets = 42 - raw_json = "hello world" - - collect_user_event_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :collect_user_event, name - assert_kind_of ::Google::Cloud::Retail::V2::CollectUserEventRequest, request - assert_equal "hello world", request["prebuilt_rule"] - assert_equal :prebuilt_rule, request.conversion_rule - assert_equal "hello world", request["parent"] - assert_equal "hello world", request["user_event"] - assert_equal "hello world", request["uri"] - assert_equal 42, request["ets"] - assert_equal "hello world", request["raw_json"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, collect_user_event_client_stub do - # Create client - client = ::Google::Cloud::Retail::V2::UserEventService::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.collect_user_event({ prebuilt_rule: prebuilt_rule, parent: parent, user_event: user_event, uri: uri, ets: ets, raw_json: raw_json }) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use named arguments - client.collect_user_event prebuilt_rule: prebuilt_rule, parent: parent, user_event: user_event, uri: uri, ets: ets, raw_json: raw_json do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object - client.collect_user_event ::Google::Cloud::Retail::V2::CollectUserEventRequest.new(prebuilt_rule: prebuilt_rule, parent: parent, user_event: user_event, uri: uri, ets: ets, raw_json: raw_json) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use hash object with options - client.collect_user_event({ prebuilt_rule: prebuilt_rule, parent: parent, user_event: user_event, uri: uri, ets: ets, raw_json: raw_json }, grpc_options) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object with options - client.collect_user_event(::Google::Cloud::Retail::V2::CollectUserEventRequest.new(prebuilt_rule: prebuilt_rule, parent: parent, user_event: user_event, uri: uri, ets: ets, raw_json: raw_json), grpc_options) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Verify method calls - assert_equal 5, collect_user_event_client_stub.call_rpc_count - end - end - - def test_purge_user_events - # 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" - filter = "hello world" - force = true - - purge_user_events_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :purge_user_events, name - assert_kind_of ::Google::Cloud::Retail::V2::PurgeUserEventsRequest, request - assert_equal "hello world", request["parent"] - assert_equal "hello world", request["filter"] - assert_equal true, request["force"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, purge_user_events_client_stub do - # Create client - client = ::Google::Cloud::Retail::V2::UserEventService::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.purge_user_events({ parent: parent, filter: filter, 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.purge_user_events parent: parent, filter: filter, 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.purge_user_events ::Google::Cloud::Retail::V2::PurgeUserEventsRequest.new(parent: parent, filter: filter, 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.purge_user_events({ parent: parent, filter: filter, 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.purge_user_events(::Google::Cloud::Retail::V2::PurgeUserEventsRequest.new(parent: parent, filter: filter, 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, purge_user_events_client_stub.call_rpc_count - end - end - - def test_import_user_events - # 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" - input_config = {} - errors_config = {} - - import_user_events_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :import_user_events, name - assert_kind_of ::Google::Cloud::Retail::V2::ImportUserEventsRequest, request - assert_equal "hello world", request["parent"] - assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::Retail::V2::UserEventInputConfig), request["input_config"] - assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::Retail::V2::ImportErrorsConfig), request["errors_config"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, import_user_events_client_stub do - # Create client - client = ::Google::Cloud::Retail::V2::UserEventService::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.import_user_events({ parent: parent, input_config: input_config, errors_config: errors_config }) 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.import_user_events parent: parent, input_config: input_config, errors_config: errors_config 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.import_user_events ::Google::Cloud::Retail::V2::ImportUserEventsRequest.new(parent: parent, input_config: input_config, errors_config: errors_config) 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.import_user_events({ parent: parent, input_config: input_config, errors_config: errors_config }, 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.import_user_events(::Google::Cloud::Retail::V2::ImportUserEventsRequest.new(parent: parent, input_config: input_config, errors_config: errors_config), 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, import_user_events_client_stub.call_rpc_count - end - end - - def test_rejoin_user_events - # 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" - user_event_rejoin_scope = :USER_EVENT_REJOIN_SCOPE_UNSPECIFIED - - rejoin_user_events_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :rejoin_user_events, name - assert_kind_of ::Google::Cloud::Retail::V2::RejoinUserEventsRequest, request - assert_equal "hello world", request["parent"] - assert_equal :USER_EVENT_REJOIN_SCOPE_UNSPECIFIED, request["user_event_rejoin_scope"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, rejoin_user_events_client_stub do - # Create client - client = ::Google::Cloud::Retail::V2::UserEventService::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.rejoin_user_events({ parent: parent, user_event_rejoin_scope: user_event_rejoin_scope }) 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.rejoin_user_events parent: parent, user_event_rejoin_scope: user_event_rejoin_scope 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.rejoin_user_events ::Google::Cloud::Retail::V2::RejoinUserEventsRequest.new(parent: parent, user_event_rejoin_scope: user_event_rejoin_scope) 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.rejoin_user_events({ parent: parent, user_event_rejoin_scope: user_event_rejoin_scope }, 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.rejoin_user_events(::Google::Cloud::Retail::V2::RejoinUserEventsRequest.new(parent: parent, user_event_rejoin_scope: user_event_rejoin_scope), 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, rejoin_user_events_client_stub.call_rpc_count - end - end - - def test_configure - grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - - client = block_config = config = nil - dummy_stub = ClientStub.new nil, nil - Gapic::ServiceStub.stub :new, dummy_stub do - client = ::Google::Cloud::Retail::V2::UserEventService::Client.new do |config| - config.credentials = grpc_channel - end - end - - config = client.configure do |c| - block_config = c - end - - assert_same block_config, config - assert_kind_of ::Google::Cloud::Retail::V2::UserEventService::Client::Configuration, config - end - - def test_credentials - key = OpenSSL::PKey::RSA.new 2048 - cred_json = { - "private_key" => key.to_pem, - "client_email" => "app@developer.gserviceaccount.com", - "type" => "service_account" - } - key_file = StringIO.new cred_json.to_json - creds = Google::Auth::ServiceAccountCredentials.make_creds({ json_key_io: key_file }) - - dummy_stub = ClientStub.new nil, nil - Gapic::ServiceStub.stub :new, dummy_stub do - client = ::Google::Cloud::Retail::V2::UserEventService::Client.new do |config| - config.credentials = creds - end - assert_kind_of ::Google::Cloud::Retail::V2::UserEventService::Client, client - assert_equal creds, client.configure.credentials - end - end - - def test_operations_client - grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - - client = nil - dummy_stub = ClientStub.new nil, nil - Gapic::ServiceStub.stub :new, dummy_stub do - client = ::Google::Cloud::Retail::V2::UserEventService::Client.new do |config| - config.credentials = grpc_channel - end - end - - assert_kind_of ::Google::Cloud::Retail::V2::UserEventService::Operations, client.operations_client - end -end diff --git a/owl-bot-staging/google-cloud-retail-v2/test/helper.rb b/owl-bot-staging/google-cloud-retail-v2/test/helper.rb deleted file mode 100644 index 672b337030e7..000000000000 --- a/owl-bot-staging/google-cloud-retail-v2/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" diff --git a/owl-bot-staging/google-cloud-saas_platform-saas_service_mgmt-v1beta1/.gitignore b/owl-bot-staging/google-cloud-saas_platform-saas_service_mgmt-v1beta1/.gitignore deleted file mode 100644 index 0135b6bc6cfc..000000000000 --- a/owl-bot-staging/google-cloud-saas_platform-saas_service_mgmt-v1beta1/.gitignore +++ /dev/null @@ -1,22 +0,0 @@ -# Ignore bundler lockfiles -Gemfile.lock -gems.locked - -# Ignore documentation output -doc/* -.yardoc/* - -# Ignore test output -coverage/* - -# Ignore build artifacts -pkg/* - -# Ignore files commonly present in certain dev environments -.vagrant -.DS_STORE -.idea -*.iml - -# Ignore synth output -__pycache__ diff --git a/owl-bot-staging/google-cloud-saas_platform-saas_service_mgmt-v1beta1/.repo-metadata.json b/owl-bot-staging/google-cloud-saas_platform-saas_service_mgmt-v1beta1/.repo-metadata.json deleted file mode 100644 index 97994f56b769..000000000000 --- a/owl-bot-staging/google-cloud-saas_platform-saas_service_mgmt-v1beta1/.repo-metadata.json +++ /dev/null @@ -1,17 +0,0 @@ -{ - "api_id": "saasservicemgmt.googleapis.com", - "api_shortname": "saasservicemgmt", - "client_documentation": "https://cloud.google.com/ruby/docs/reference/google-cloud-saas_platform-saas_service_mgmt-v1beta1/latest", - "distribution_name": "google-cloud-saas_platform-saas_service_mgmt-v1beta1", - "is_cloud": true, - "language": "ruby", - "name": "saasservicemgmt", - "name_pretty": "SaaS Runtime V1BETA1 API", - "product_documentation": "https://cloud.google.com/saas-runtime/docs/overview", - "release_level": "unreleased", - "repo": "googleapis/google-cloud-ruby", - "requires_billing": true, - "ruby-cloud-description": "SaaS Runtime lets you store, host, manage, and monitor software as a service (SaaS) applications on Google Cloud. Note that google-cloud-saas_platform-saas_service_mgmt-v1beta1 is a version-specific client library. For most uses, we recommend installing the main client library google-cloud-saas_platform-saas_service_mgmt instead. See the readme for more details.", - "ruby-cloud-product-url": "https://cloud.google.com/saas-runtime/docs/overview", - "library_type": "GAPIC_AUTO" -} diff --git a/owl-bot-staging/google-cloud-saas_platform-saas_service_mgmt-v1beta1/.rubocop.yml b/owl-bot-staging/google-cloud-saas_platform-saas_service_mgmt-v1beta1/.rubocop.yml deleted file mode 100644 index 981315800771..000000000000 --- a/owl-bot-staging/google-cloud-saas_platform-saas_service_mgmt-v1beta1/.rubocop.yml +++ /dev/null @@ -1,33 +0,0 @@ -inherit_gem: - google-style: google-style.yml - -AllCops: - Exclude: - - "google-cloud-saas_platform-saas_service_mgmt-v1beta1.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-saas_platform-saas_service_mgmt-v1beta1.rb" diff --git a/owl-bot-staging/google-cloud-saas_platform-saas_service_mgmt-v1beta1/.toys.rb b/owl-bot-staging/google-cloud-saas_platform-saas_service_mgmt-v1beta1/.toys.rb deleted file mode 100644 index 177e22456e8a..000000000000 --- a/owl-bot-staging/google-cloud-saas_platform-saas_service_mgmt-v1beta1/.toys.rb +++ /dev/null @@ -1,28 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -toys_version! ">= 0.15.3" - -if ENV["RUBY_COMMON_TOOLS"] - common_tools_dir = File.expand_path ENV["RUBY_COMMON_TOOLS"] - load File.join(common_tools_dir, "toys", "gapic") -else - load_git remote: "https://github.com/googleapis/ruby-common-tools.git", - path: "toys/gapic", - update: true -end diff --git a/owl-bot-staging/google-cloud-saas_platform-saas_service_mgmt-v1beta1/.yardopts b/owl-bot-staging/google-cloud-saas_platform-saas_service_mgmt-v1beta1/.yardopts deleted file mode 100644 index 66921bbab993..000000000000 --- a/owl-bot-staging/google-cloud-saas_platform-saas_service_mgmt-v1beta1/.yardopts +++ /dev/null @@ -1,12 +0,0 @@ ---no-private ---title="SaaS Runtime V1BETA1 API" ---exclude _pb\.rb$ ---markup markdown ---markup-provider redcarpet - -./lib/**/*.rb -./proto_docs/**/*.rb -- -README.md -LICENSE.md -AUTHENTICATION.md diff --git a/owl-bot-staging/google-cloud-saas_platform-saas_service_mgmt-v1beta1/AUTHENTICATION.md b/owl-bot-staging/google-cloud-saas_platform-saas_service_mgmt-v1beta1/AUTHENTICATION.md deleted file mode 100644 index 60e04154887d..000000000000 --- a/owl-bot-staging/google-cloud-saas_platform-saas_service_mgmt-v1beta1/AUTHENTICATION.md +++ /dev/null @@ -1,122 +0,0 @@ -# Authentication - -The recommended way to authenticate to the google-cloud-saas_platform-saas_service_mgmt-v1beta1 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-saas_platform-saas_service_mgmt-v1beta1 library provides several mechanisms to configure your system. -Generally, using Application Default Credentials to facilitate automatic -credentials discovery is the easist method. But if you need to explicitly specify -credentials, there are several methods available to you. - -Credentials are accepted in the following ways, in the following order or precedence: - -1. Credentials specified in method arguments -2. Credentials specified in configuration -3. Credentials pointed to or included in environment variables -4. Credentials found in local ADC file -5. Credentials returned by the metadata server for the attached service account (GCP) - -### Configuration - -You can configure a path to a JSON credentials file, either for an individual client object or -globally, for all client objects. The JSON file can contain credentials created for -[workload identity federation](https://cloud.google.com/iam/docs/workload-identity-federation), -[workforce identity federation](https://cloud.google.com/iam/docs/workforce-identity-federation), or a -[service account key](https://cloud.google.com/docs/authentication/provide-credentials-adc#local-key). - -Note: Service account keys are a security risk if not managed correctly. You should -[choose a more secure alternative to service account keys](https://cloud.google.com/docs/authentication#auth-decision-tree) -whenever possible. - -To configure a credentials file for an individual client initialization: - -```ruby -require "google/cloud/saas_platform/saas_service_mgmt/v1beta1" - -client = ::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::SaasDeployments::Client.new do |config| - config.credentials = "path/to/credentialfile.json" -end -``` - -To configure a credentials file globally for all clients: - -```ruby -require "google/cloud/saas_platform/saas_service_mgmt/v1beta1" - -::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::SaasDeployments::Client.configure do |config| - config.credentials = "path/to/credentialfile.json" -end - -client = ::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::SaasDeployments::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-saas_platform-saas_service_mgmt-v1beta1 -checks for credentials are: - -* `GOOGLE_CLOUD_CREDENTIALS` - Path to JSON file, or JSON contents -* `GOOGLE_APPLICATION_CREDENTIALS` - Path to JSON file - -```ruby -require "google/cloud/saas_platform/saas_service_mgmt/v1beta1" - -ENV["GOOGLE_APPLICATION_CREDENTIALS"] = "path/to/credentialfile.json" - -client = ::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::SaasDeployments::Client.new -``` - -### Local ADC file - -You can set up a local ADC file with your user credentials for authentication during -development. If credentials are not provided in code or in environment variables, -then the local ADC credentials are discovered. - -Follow the steps in [Quickstart](#quickstart) to set up a local ADC file. - -### Google Cloud Platform environments - -When running on Google Cloud Platform (GCP), including Google Compute Engine -(GCE), Google Kubernetes Engine (GKE), Google App Engine (GAE), Google Cloud -Functions (GCF) and Cloud Run, credentials are retrieved from the attached -service account automatically. Code should be written as if already authenticated. - -For more information, see -[Set up ADC for Google Cloud services](https://cloud.google.com/docs/authentication/provide-credentials-adc#attached-sa). diff --git a/owl-bot-staging/google-cloud-saas_platform-saas_service_mgmt-v1beta1/CHANGELOG.md b/owl-bot-staging/google-cloud-saas_platform-saas_service_mgmt-v1beta1/CHANGELOG.md deleted file mode 100644 index f88957a62ba2..000000000000 --- a/owl-bot-staging/google-cloud-saas_platform-saas_service_mgmt-v1beta1/CHANGELOG.md +++ /dev/null @@ -1,2 +0,0 @@ -# Release History - diff --git a/owl-bot-staging/google-cloud-saas_platform-saas_service_mgmt-v1beta1/Gemfile b/owl-bot-staging/google-cloud-saas_platform-saas_service_mgmt-v1beta1/Gemfile deleted file mode 100644 index 1d08558908d8..000000000000 --- a/owl-bot-staging/google-cloud-saas_platform-saas_service_mgmt-v1beta1/Gemfile +++ /dev/null @@ -1,14 +0,0 @@ -source "https://rubygems.org" - -gemspec - -gem "google-style", "~> 1.32.0" -gem "irb", "~> 1.17" -gem "minitest", "~> 6.0.2" -gem "minitest-focus", "~> 1.4" -gem "minitest-mock", "~> 5.27" -gem "minitest-rg", "~> 5.3" -gem "ostruct", "~> 0.5.5" -gem "rake", ">= 13.0" -gem "redcarpet", "~> 3.6" -gem "yard", "~> 0.9" diff --git a/owl-bot-staging/google-cloud-saas_platform-saas_service_mgmt-v1beta1/LICENSE.md b/owl-bot-staging/google-cloud-saas_platform-saas_service_mgmt-v1beta1/LICENSE.md deleted file mode 100644 index c261857ba6ad..000000000000 --- a/owl-bot-staging/google-cloud-saas_platform-saas_service_mgmt-v1beta1/LICENSE.md +++ /dev/null @@ -1,201 +0,0 @@ - Apache License - Version 2.0, January 2004 - http://www.apache.org/licenses/ - - TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION - - 1. Definitions. - - "License" shall mean the terms and conditions for use, reproduction, - and distribution as defined by Sections 1 through 9 of this document. - - "Licensor" shall mean the copyright owner or entity authorized by - the copyright owner that is granting the License. - - "Legal Entity" shall mean the union of the acting entity and all - other entities that control, are controlled by, or are under common - control with that entity. For the purposes of this definition, - "control" means (i) the power, direct or indirect, to cause the - direction or management of such entity, whether by contract or - otherwise, or (ii) ownership of fifty percent (50%) or more of the - outstanding shares, or (iii) beneficial ownership of such entity. - - "You" (or "Your") shall mean an individual or Legal Entity - exercising permissions granted by this License. - - "Source" form shall mean the preferred form for making modifications, - including but not limited to software source code, documentation - source, and configuration files. - - "Object" form shall mean any form resulting from mechanical - transformation or translation of a Source form, including but - not limited to compiled object code, generated documentation, - and conversions to other media types. - - "Work" shall mean the work of authorship, whether in Source or - Object form, made available under the License, as indicated by a - copyright notice that is included in or attached to the work - (an example is provided in the Appendix below). - - "Derivative Works" shall mean any work, whether in Source or Object - form, that is based on (or derived from) the Work and for which the - editorial revisions, annotations, elaborations, or other modifications - represent, as a whole, an original work of authorship. For the purposes - of this License, Derivative Works shall not include works that remain - separable from, or merely link (or bind by name) to the interfaces of, - the Work and Derivative Works thereof. - - "Contribution" shall mean any work of authorship, including - the original version of the Work and any modifications or additions - to that Work or Derivative Works thereof, that is intentionally - submitted to Licensor for inclusion in the Work by the copyright owner - or by an individual or Legal Entity authorized to submit on behalf of - the copyright owner. For the purposes of this definition, "submitted" - means any form of electronic, verbal, or written communication sent - to the Licensor or its representatives, including but not limited to - communication on electronic mailing lists, source code control systems, - and issue tracking systems that are managed by, or on behalf of, the - Licensor for the purpose of discussing and improving the Work, but - excluding communication that is conspicuously marked or otherwise - designated in writing by the copyright owner as "Not a Contribution." - - "Contributor" shall mean Licensor and any individual or Legal Entity - on behalf of whom a Contribution has been received by Licensor and - subsequently incorporated within the Work. - - 2. Grant of Copyright License. Subject to the terms and conditions of - this License, each Contributor hereby grants to You a perpetual, - worldwide, non-exclusive, no-charge, royalty-free, irrevocable - copyright license to reproduce, prepare Derivative Works of, - publicly display, publicly perform, sublicense, and distribute the - Work and such Derivative Works in Source or Object form. - - 3. Grant of Patent License. Subject to the terms and conditions of - this License, each Contributor hereby grants to You a perpetual, - worldwide, non-exclusive, no-charge, royalty-free, irrevocable - (except as stated in this section) patent license to make, have made, - use, offer to sell, sell, import, and otherwise transfer the Work, - where such license applies only to those patent claims licensable - by such Contributor that are necessarily infringed by their - Contribution(s) alone or by combination of their Contribution(s) - with the Work to which such Contribution(s) was submitted. If You - institute patent litigation against any entity (including a - cross-claim or counterclaim in a lawsuit) alleging that the Work - or a Contribution incorporated within the Work constitutes direct - or contributory patent infringement, then any patent licenses - granted to You under this License for that Work shall terminate - as of the date such litigation is filed. - - 4. Redistribution. You may reproduce and distribute copies of the - Work or Derivative Works thereof in any medium, with or without - modifications, and in Source or Object form, provided that You - meet the following conditions: - - (a) You must give any other recipients of the Work or - Derivative Works a copy of this License; and - - (b) You must cause any modified files to carry prominent notices - stating that You changed the files; and - - (c) You must retain, in the Source form of any Derivative Works - that You distribute, all copyright, patent, trademark, and - attribution notices from the Source form of the Work, - excluding those notices that do not pertain to any part of - the Derivative Works; and - - (d) If the Work includes a "NOTICE" text file as part of its - distribution, then any Derivative Works that You distribute must - include a readable copy of the attribution notices contained - within such NOTICE file, excluding those notices that do not - pertain to any part of the Derivative Works, in at least one - of the following places: within a NOTICE text file distributed - as part of the Derivative Works; within the Source form or - documentation, if provided along with the Derivative Works; or, - within a display generated by the Derivative Works, if and - wherever such third-party notices normally appear. The contents - of the NOTICE file are for informational purposes only and - do not modify the License. You may add Your own attribution - notices within Derivative Works that You distribute, alongside - or as an addendum to the NOTICE text from the Work, provided - that such additional attribution notices cannot be construed - as modifying the License. - - You may add Your own copyright statement to Your modifications and - may provide additional or different license terms and conditions - for use, reproduction, or distribution of Your modifications, or - for any such Derivative Works as a whole, provided Your use, - reproduction, and distribution of the Work otherwise complies with - the conditions stated in this License. - - 5. Submission of Contributions. Unless You explicitly state otherwise, - any Contribution intentionally submitted for inclusion in the Work - by You to the Licensor shall be under the terms and conditions of - this License, without any additional terms or conditions. - Notwithstanding the above, nothing herein shall supersede or modify - the terms of any separate license agreement you may have executed - with Licensor regarding such Contributions. - - 6. Trademarks. This License does not grant permission to use the trade - names, trademarks, service marks, or product names of the Licensor, - except as required for reasonable and customary use in describing the - origin of the Work and reproducing the content of the NOTICE file. - - 7. Disclaimer of Warranty. Unless required by applicable law or - agreed to in writing, Licensor provides the Work (and each - Contributor provides its Contributions) on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or - implied, including, without limitation, any warranties or conditions - of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A - PARTICULAR PURPOSE. You are solely responsible for determining the - appropriateness of using or redistributing the Work and assume any - risks associated with Your exercise of permissions under this License. - - 8. Limitation of Liability. In no event and under no legal theory, - whether in tort (including negligence), contract, or otherwise, - unless required by applicable law (such as deliberate and grossly - negligent acts) or agreed to in writing, shall any Contributor be - liable to You for damages, including any direct, indirect, special, - incidental, or consequential damages of any character arising as a - result of this License or out of the use or inability to use the - Work (including but not limited to damages for loss of goodwill, - work stoppage, computer failure or malfunction, or any and all - other commercial damages or losses), even if such Contributor - has been advised of the possibility of such damages. - - 9. Accepting Warranty or Additional Liability. While redistributing - the Work or Derivative Works thereof, You may choose to offer, - and charge a fee for, acceptance of support, warranty, indemnity, - or other liability obligations and/or rights consistent with this - License. However, in accepting such obligations, You may act only - on Your own behalf and on Your sole responsibility, not on behalf - of any other Contributor, and only if You agree to indemnify, - defend, and hold each Contributor harmless for any liability - incurred by, or claims asserted against, such Contributor by reason - of your accepting any such warranty or additional liability. - - END OF TERMS AND CONDITIONS - - APPENDIX: How to apply the Apache License to your work. - - To apply the Apache License to your work, attach the following - boilerplate notice, with the fields enclosed by brackets "[]" - replaced with your own identifying information. (Don't include - the brackets!) The text should be enclosed in the appropriate - comment syntax for the file format. We also recommend that a - file or class name and description of purpose be included on the - same "printed page" as the copyright notice for easier - identification within third-party archives. - - Copyright [yyyy] [name of copyright owner] - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. diff --git a/owl-bot-staging/google-cloud-saas_platform-saas_service_mgmt-v1beta1/README.md b/owl-bot-staging/google-cloud-saas_platform-saas_service_mgmt-v1beta1/README.md deleted file mode 100644 index 027ccdec4891..000000000000 --- a/owl-bot-staging/google-cloud-saas_platform-saas_service_mgmt-v1beta1/README.md +++ /dev/null @@ -1,154 +0,0 @@ -# Ruby Client for the SaaS Runtime V1BETA1 API - -Model, deploy, and operate your SaaS at scale. - -SaaS Runtime lets you store, host, manage, and monitor software as a service (SaaS) applications on Google Cloud. - -https://github.com/googleapis/google-cloud-ruby - -This gem is a _versioned_ client. It provides basic client classes for a -specific version of the SaaS Runtime V1BETA1 API. Most users should consider using -the main client gem, -[google-cloud-saas_platform-saas_service_mgmt](https://rubygems.org/gems/google-cloud-saas_platform-saas_service_mgmt). -See the section below titled *Which client should I use?* for more information. - -## Installation - -``` -$ gem install google-cloud-saas_platform-saas_service_mgmt-v1beta1 -``` - -## 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/saasservicemgmt.googleapis.com) -1. [Set up authentication.](AUTHENTICATION.md) - -## Quick Start - -```ruby -require "google/cloud/saas_platform/saas_service_mgmt/v1beta1" - -client = ::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::SaasDeployments::Client.new -request = ::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::ListSaasRequest.new # (request fields as keyword arguments...) -response = client.list_saas request -``` - -View the [Client Library Documentation](https://cloud.google.com/ruby/docs/reference/google-cloud-saas_platform-saas_service_mgmt-v1beta1/latest) -for class and method documentation. - -See also the [Product Documentation](https://cloud.google.com/saas-runtime/docs/overview) -for general usage information. - -## Debug Logging - -This library comes with opt-in Debug Logging that can help you troubleshoot -your application's integration with the API. When logging is activated, key -events such as requests and responses, along with data payloads and metadata -such as headers and client configuration, are logged to the standard error -stream. - -**WARNING:** Client Library Debug Logging includes your data payloads in -plaintext, which could include sensitive data such as PII for yourself or your -customers, private keys, or other security data that could be compromising if -leaked. Always practice good data hygiene with your application logs, and follow -the principle of least access. Google also recommends that Client Library Debug -Logging be enabled only temporarily during active debugging, and not used -permanently in production. - -To enable logging, set the environment variable `GOOGLE_SDK_RUBY_LOGGING_GEMS` -to the value `all`. Alternatively, you can set the value to a comma-delimited -list of client library gem names. This will select the default logging behavior, -which writes logs to the standard error stream. On a local workstation, this may -result in logs appearing on the console. When running on a Google Cloud hosting -service such as [Google Cloud Run](https://cloud.google.com/run), this generally -results in logs appearing alongside your application logs in the -[Google Cloud Logging](https://cloud.google.com/logging/) service. - -You can customize logging by modifying the `logger` configuration when -constructing a client object. For example: - -```ruby -require "google/cloud/saas_platform/saas_service_mgmt/v1beta1" -require "logger" - -client = ::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::SaasDeployments::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-saas_platform-saas_service_mgmt`, -and lower-level _versioned_ client libraries with names such as -`google-cloud-saas_platform-saas_service_mgmt-v1beta1`. -_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-saas_platform-saas_service_mgmt`. -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-saas_platform-saas_service_mgmt-v1beta1`. - -### What about the google-apis- clients? - -Client library gems with names that begin with `google-apis-` are based on an -older code generation technology. They talk to a REST/JSON backend (whereas -most modern clients talk to a [gRPC](https://grpc.io/) backend) and they may -not offer the same performance, features, and ease of use provided by more -modern clients. - -The `google-apis-` clients have wide coverage across Google services, so you -might need to use one if there is no modern client available for the service. -However, if a modern client is available, we generally recommend it over the -older `google-apis-` clients. diff --git a/owl-bot-staging/google-cloud-saas_platform-saas_service_mgmt-v1beta1/Rakefile b/owl-bot-staging/google-cloud-saas_platform-saas_service_mgmt-v1beta1/Rakefile deleted file mode 100644 index 78bfe245658f..000000000000 --- a/owl-bot-staging/google-cloud-saas_platform-saas_service_mgmt-v1beta1/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-saas_platform-saas_service_mgmt-v1beta1 acceptance tests." -task :acceptance, :project, :keyfile do |t, args| - project = args[:project] - project ||= - ENV["GOOGLE_CLOUD_TEST_PROJECT"] || - ENV["GCLOUD_TEST_PROJECT"] - keyfile = args[:keyfile] - keyfile ||= - ENV["GOOGLE_CLOUD_TEST_KEYFILE"] || - ENV["GCLOUD_TEST_KEYFILE"] - if keyfile - keyfile = File.read keyfile - else - keyfile ||= - ENV["GOOGLE_CLOUD_TEST_KEYFILE_JSON"] || - ENV["GCLOUD_TEST_KEYFILE_JSON"] - end - if project.nil? || keyfile.nil? - fail "You must provide a project and keyfile. e.g. rake acceptance[test123, /path/to/keyfile.json] or GOOGLE_CLOUD_TEST_PROJECT=test123 GOOGLE_CLOUD_TEST_KEYFILE=/path/to/keyfile.json rake acceptance" - end - require "google/cloud/saas_platform/saas_service_mgmt/v1beta1/saas_deployments/credentials" - ::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::SaasDeployments::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-saas_platform-saas_service_mgmt-v1beta1 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-saas_platform-saas_service_mgmt-v1beta1 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-saas_platform-saas_service_mgmt-v1beta1 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-saas_platform-saas_service_mgmt-v1beta1 gem does not have doctest tests." -end - -desc "Run the CI build" -task :ci do - header "BUILDING google-cloud-saas_platform-saas_service_mgmt-v1beta1" - header "google-cloud-saas_platform-saas_service_mgmt-v1beta1 rubocop", "*" - Rake::Task[:rubocop].invoke - header "google-cloud-saas_platform-saas_service_mgmt-v1beta1 yard", "*" - Rake::Task[:yard].invoke - header "google-cloud-saas_platform-saas_service_mgmt-v1beta1 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-saas_platform-saas_service_mgmt-v1beta1 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-saas_platform-saas_service_mgmt-v1beta1 acceptance", "*" - Rake::Task[:acceptance].invoke - end - task :a do - # This is a handy shortcut to save typing - Rake::Task["ci:acceptance"].invoke - end -end - -task default: :test - -def header str, token = "#" - line_length = str.length + 8 - puts "" - puts token * line_length - puts "#{token * 3} #{str} #{token * 3}" - puts token * line_length - puts "" -end diff --git a/owl-bot-staging/google-cloud-saas_platform-saas_service_mgmt-v1beta1/gapic_metadata.json b/owl-bot-staging/google-cloud-saas_platform-saas_service_mgmt-v1beta1/gapic_metadata.json deleted file mode 100644 index be051f6cea19..000000000000 --- a/owl-bot-staging/google-cloud-saas_platform-saas_service_mgmt-v1beta1/gapic_metadata.json +++ /dev/null @@ -1,227 +0,0 @@ -{ - "schema": "1.0", - "comment": "This file maps proto services/RPCs to the corresponding library clients/methods", - "language": "ruby", - "protoPackage": "google.cloud.saasplatform.saasservicemgmt.v1beta1", - "libraryPackage": "::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1", - "services": { - "SaasDeployments": { - "clients": { - "grpc": { - "libraryClient": "::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::SaasDeployments::Client", - "rpcs": { - "ListSaas": { - "methods": [ - "list_saas" - ] - }, - "GetSaas": { - "methods": [ - "get_saas" - ] - }, - "CreateSaas": { - "methods": [ - "create_saas" - ] - }, - "UpdateSaas": { - "methods": [ - "update_saas" - ] - }, - "DeleteSaas": { - "methods": [ - "delete_saas" - ] - }, - "ListTenants": { - "methods": [ - "list_tenants" - ] - }, - "GetTenant": { - "methods": [ - "get_tenant" - ] - }, - "CreateTenant": { - "methods": [ - "create_tenant" - ] - }, - "UpdateTenant": { - "methods": [ - "update_tenant" - ] - }, - "DeleteTenant": { - "methods": [ - "delete_tenant" - ] - }, - "ListUnitKinds": { - "methods": [ - "list_unit_kinds" - ] - }, - "GetUnitKind": { - "methods": [ - "get_unit_kind" - ] - }, - "CreateUnitKind": { - "methods": [ - "create_unit_kind" - ] - }, - "UpdateUnitKind": { - "methods": [ - "update_unit_kind" - ] - }, - "DeleteUnitKind": { - "methods": [ - "delete_unit_kind" - ] - }, - "ListUnits": { - "methods": [ - "list_units" - ] - }, - "GetUnit": { - "methods": [ - "get_unit" - ] - }, - "CreateUnit": { - "methods": [ - "create_unit" - ] - }, - "UpdateUnit": { - "methods": [ - "update_unit" - ] - }, - "DeleteUnit": { - "methods": [ - "delete_unit" - ] - }, - "ListUnitOperations": { - "methods": [ - "list_unit_operations" - ] - }, - "GetUnitOperation": { - "methods": [ - "get_unit_operation" - ] - }, - "CreateUnitOperation": { - "methods": [ - "create_unit_operation" - ] - }, - "UpdateUnitOperation": { - "methods": [ - "update_unit_operation" - ] - }, - "DeleteUnitOperation": { - "methods": [ - "delete_unit_operation" - ] - }, - "ListReleases": { - "methods": [ - "list_releases" - ] - }, - "GetRelease": { - "methods": [ - "get_release" - ] - }, - "CreateRelease": { - "methods": [ - "create_release" - ] - }, - "UpdateRelease": { - "methods": [ - "update_release" - ] - }, - "DeleteRelease": { - "methods": [ - "delete_release" - ] - } - } - } - } - }, - "SaasRollouts": { - "clients": { - "grpc": { - "libraryClient": "::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::SaasRollouts::Client", - "rpcs": { - "ListRollouts": { - "methods": [ - "list_rollouts" - ] - }, - "GetRollout": { - "methods": [ - "get_rollout" - ] - }, - "CreateRollout": { - "methods": [ - "create_rollout" - ] - }, - "UpdateRollout": { - "methods": [ - "update_rollout" - ] - }, - "DeleteRollout": { - "methods": [ - "delete_rollout" - ] - }, - "ListRolloutKinds": { - "methods": [ - "list_rollout_kinds" - ] - }, - "GetRolloutKind": { - "methods": [ - "get_rollout_kind" - ] - }, - "CreateRolloutKind": { - "methods": [ - "create_rollout_kind" - ] - }, - "UpdateRolloutKind": { - "methods": [ - "update_rollout_kind" - ] - }, - "DeleteRolloutKind": { - "methods": [ - "delete_rollout_kind" - ] - } - } - } - } - } - } -} diff --git a/owl-bot-staging/google-cloud-saas_platform-saas_service_mgmt-v1beta1/google-cloud-saas_platform-saas_service_mgmt-v1beta1.gemspec b/owl-bot-staging/google-cloud-saas_platform-saas_service_mgmt-v1beta1/google-cloud-saas_platform-saas_service_mgmt-v1beta1.gemspec deleted file mode 100644 index 064e627f316c..000000000000 --- a/owl-bot-staging/google-cloud-saas_platform-saas_service_mgmt-v1beta1/google-cloud-saas_platform-saas_service_mgmt-v1beta1.gemspec +++ /dev/null @@ -1,29 +0,0 @@ -# -*- ruby -*- -# encoding: utf-8 - -require File.expand_path("lib/google/cloud/saas_platform/saas_service_mgmt/v1beta1/version", __dir__) - -Gem::Specification.new do |gem| - gem.name = "google-cloud-saas_platform-saas_service_mgmt-v1beta1" - gem.version = Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::VERSION - - gem.authors = ["Google LLC"] - gem.email = "googleapis-packages@google.com" - gem.description = "SaaS Runtime lets you store, host, manage, and monitor software as a service (SaaS) applications on Google Cloud. Note that google-cloud-saas_platform-saas_service_mgmt-v1beta1 is a version-specific client library. For most uses, we recommend installing the main client library google-cloud-saas_platform-saas_service_mgmt instead. See the readme for more details." - gem.summary = "Model, deploy, and operate your SaaS at scale." - 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-cloud-saas_platform-saas_service_mgmt-v1beta1/lib/google-cloud-saas_platform-saas_service_mgmt-v1beta1.rb b/owl-bot-staging/google-cloud-saas_platform-saas_service_mgmt-v1beta1/lib/google-cloud-saas_platform-saas_service_mgmt-v1beta1.rb deleted file mode 100644 index 80bcd766d674..000000000000 --- a/owl-bot-staging/google-cloud-saas_platform-saas_service_mgmt-v1beta1/lib/google-cloud-saas_platform-saas_service_mgmt-v1beta1.rb +++ /dev/null @@ -1,21 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -# This gem does not autoload during Bundler.require. To load this gem, -# issue explicit require statements for the packages desired, e.g.: -# require "google/cloud/saas_platform/saas_service_mgmt/v1beta1" diff --git a/owl-bot-staging/google-cloud-saas_platform-saas_service_mgmt-v1beta1/lib/google/cloud/saas_platform/saas_service_mgmt/v1beta1.rb b/owl-bot-staging/google-cloud-saas_platform-saas_service_mgmt-v1beta1/lib/google/cloud/saas_platform/saas_service_mgmt/v1beta1.rb deleted file mode 100644 index 791947b8231a..000000000000 --- a/owl-bot-staging/google-cloud-saas_platform-saas_service_mgmt-v1beta1/lib/google/cloud/saas_platform/saas_service_mgmt/v1beta1.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! - -require "google/cloud/saas_platform/saas_service_mgmt/v1beta1/saas_deployments" -require "google/cloud/saas_platform/saas_service_mgmt/v1beta1/saas_rollouts" -require "google/cloud/saas_platform/saas_service_mgmt/v1beta1/version" - -module Google - module Cloud - module SaasPlatform - module SaasServiceMgmt - ## - # API client module. - # - # @example Load this package, including all its services, and instantiate a gRPC client - # - # require "google/cloud/saas_platform/saas_service_mgmt/v1beta1" - # client = ::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::SaasDeployments::Client.new - # - # @example Load this package, including all its services, and instantiate a REST client - # - # require "google/cloud/saas_platform/saas_service_mgmt/v1beta1" - # client = ::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::SaasDeployments::Rest::Client.new - # - module V1beta1 - end - end - end - end -end - -helper_path = ::File.join __dir__, "v1beta1", "_helpers.rb" -require "google/cloud/saas_platform/saas_service_mgmt/v1beta1/_helpers" if ::File.file? helper_path diff --git a/owl-bot-staging/google-cloud-saas_platform-saas_service_mgmt-v1beta1/lib/google/cloud/saas_platform/saas_service_mgmt/v1beta1/bindings_override.rb b/owl-bot-staging/google-cloud-saas_platform-saas_service_mgmt-v1beta1/lib/google/cloud/saas_platform/saas_service_mgmt/v1beta1/bindings_override.rb deleted file mode 100644 index 04229d9920ee..000000000000 --- a/owl-bot-staging/google-cloud-saas_platform-saas_service_mgmt-v1beta1/lib/google/cloud/saas_platform/saas_service_mgmt/v1beta1/bindings_override.rb +++ /dev/null @@ -1,77 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -require "gapic/rest" - -module Google - module Cloud - module SaasPlatform - module SaasServiceMgmt - ## - # @example Loading just the REST part of this package, including all its services, and instantiating a REST client - # - # require "google/cloud/saas_platform/saas_service_mgmt/v1beta1/rest" - # client = ::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::SaasDeployments::Rest::Client.new - # - module V1beta1 - ## - # @private - # Initialize the mixin bindings configuration - # - def self.configure - @configure ||= begin - namespace = ["Google", "Cloud", "SaasPlatform", "SaasServiceMgmt"] - parent_config = while namespace.any? - parent_name = namespace.join "::" - parent_const = const_get parent_name - break parent_const.configure if parent_const.respond_to? :configure - namespace.pop - end - - default_config = ::Gapic::Rest::HttpBindingOverrideConfiguration.new parent_config - default_config.bindings_override["google.cloud.location.Locations.GetLocation"] = [ - Gapic::Rest::GrpcTranscoder::HttpBinding.create_with_validation( - uri_method: :get, - uri_template: "/v1beta1/{name}", - matches: [ - ["name", %r{^projects/[^/]+/locations/[^/]+/?$}, false] - ], - body: nil - ) - ] - default_config.bindings_override["google.cloud.location.Locations.ListLocations"] = [ - - Gapic::Rest::GrpcTranscoder::HttpBinding.create_with_validation( - uri_method: :get, - uri_template: "/v1beta1/{name}/locations", - matches: [ - ["name", %r{^projects/[^/]+/?$}, false] - ], - body: nil - ) - ] - default_config - end - yield @configure if block_given? - @configure - end - end - end - end - end -end diff --git a/owl-bot-staging/google-cloud-saas_platform-saas_service_mgmt-v1beta1/lib/google/cloud/saas_platform/saas_service_mgmt/v1beta1/rest.rb b/owl-bot-staging/google-cloud-saas_platform-saas_service_mgmt-v1beta1/lib/google/cloud/saas_platform/saas_service_mgmt/v1beta1/rest.rb deleted file mode 100644 index f8c683743050..000000000000 --- a/owl-bot-staging/google-cloud-saas_platform-saas_service_mgmt-v1beta1/lib/google/cloud/saas_platform/saas_service_mgmt/v1beta1/rest.rb +++ /dev/null @@ -1,41 +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/saas_platform/saas_service_mgmt/v1beta1/saas_deployments/rest" -require "google/cloud/saas_platform/saas_service_mgmt/v1beta1/saas_rollouts/rest" -require "google/cloud/saas_platform/saas_service_mgmt/v1beta1/bindings_override" -require "google/cloud/saas_platform/saas_service_mgmt/v1beta1/version" - -module Google - module Cloud - module SaasPlatform - module SaasServiceMgmt - ## - # To load just the REST part of this package, including all its services, and instantiate a REST client: - # - # @example - # - # require "google/cloud/saas_platform/saas_service_mgmt/v1beta1/rest" - # client = ::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::SaasDeployments::Rest::Client.new - # - module V1beta1 - end - end - end - end -end diff --git a/owl-bot-staging/google-cloud-saas_platform-saas_service_mgmt-v1beta1/lib/google/cloud/saas_platform/saas_service_mgmt/v1beta1/saas_deployments.rb b/owl-bot-staging/google-cloud-saas_platform-saas_service_mgmt-v1beta1/lib/google/cloud/saas_platform/saas_service_mgmt/v1beta1/saas_deployments.rb deleted file mode 100644 index 11bbdfccaec4..000000000000 --- a/owl-bot-staging/google-cloud-saas_platform-saas_service_mgmt-v1beta1/lib/google/cloud/saas_platform/saas_service_mgmt/v1beta1/saas_deployments.rb +++ /dev/null @@ -1,57 +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/saas_platform/saas_service_mgmt/v1beta1/version" - -require "google/cloud/saas_platform/saas_service_mgmt/v1beta1/saas_deployments/credentials" -require "google/cloud/saas_platform/saas_service_mgmt/v1beta1/saas_deployments/paths" -require "google/cloud/saas_platform/saas_service_mgmt/v1beta1/saas_deployments/client" -require "google/cloud/saas_platform/saas_service_mgmt/v1beta1/saas_deployments/rest" - -module Google - module Cloud - module SaasPlatform - module SaasServiceMgmt - module V1beta1 - ## - # Manages the deployment of SaaS services. - # - # @example Load this service and instantiate a gRPC client - # - # require "google/cloud/saas_platform/saas_service_mgmt/v1beta1/saas_deployments" - # client = ::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::SaasDeployments::Client.new - # - # @example Load this service and instantiate a REST client - # - # require "google/cloud/saas_platform/saas_service_mgmt/v1beta1/saas_deployments/rest" - # client = ::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::SaasDeployments::Rest::Client.new - # - module SaasDeployments - end - end - end - end - end -end - -helper_path = ::File.join __dir__, "saas_deployments", "helpers.rb" -require "google/cloud/saas_platform/saas_service_mgmt/v1beta1/saas_deployments/helpers" if ::File.file? helper_path diff --git a/owl-bot-staging/google-cloud-saas_platform-saas_service_mgmt-v1beta1/lib/google/cloud/saas_platform/saas_service_mgmt/v1beta1/saas_deployments/client.rb b/owl-bot-staging/google-cloud-saas_platform-saas_service_mgmt-v1beta1/lib/google/cloud/saas_platform/saas_service_mgmt/v1beta1/saas_deployments/client.rb deleted file mode 100644 index 328a3619f2ee..000000000000 --- a/owl-bot-staging/google-cloud-saas_platform-saas_service_mgmt-v1beta1/lib/google/cloud/saas_platform/saas_service_mgmt/v1beta1/saas_deployments/client.rb +++ /dev/null @@ -1,3802 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -require "google/cloud/errors" -require "google/cloud/saasplatform/saasservicemgmt/v1beta1/deployments_service_pb" -require "google/cloud/location" - -module Google - module Cloud - module SaasPlatform - module SaasServiceMgmt - module V1beta1 - module SaasDeployments - ## - # Client for the SaasDeployments service. - # - # Manages the deployment of SaaS services. - # - class Client - # @private - API_VERSION = "" - - # @private - DEFAULT_ENDPOINT_TEMPLATE = "saasservicemgmt.$UNIVERSE_DOMAIN$" - - include Paths - - # @private - attr_reader :saas_deployments_stub - - ## - # Configure the SaasDeployments Client class. - # - # See {::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::SaasDeployments::Client::Configuration} - # for a description of the configuration fields. - # - # @example - # - # # Modify the configuration for all SaasDeployments clients - # ::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::SaasDeployments::Client.configure do |config| - # config.timeout = 10.0 - # end - # - # @yield [config] Configure the Client client. - # @yieldparam config [Client::Configuration] - # - # @return [Client::Configuration] - # - def self.configure - @configure ||= begin - namespace = ["Google", "Cloud", "SaasPlatform", "SaasServiceMgmt", "V1beta1"] - parent_config = while namespace.any? - parent_name = namespace.join "::" - parent_const = const_get parent_name - break parent_const.configure if parent_const.respond_to? :configure - namespace.pop - end - default_config = Client::Configuration.new parent_config - - default_config.rpcs.list_saas.timeout = 80.0 - default_config.rpcs.list_saas.retry_policy = { - initial_delay: 1.0, max_delay: 10.0, multiplier: 1.3, retry_codes: [14] - } - - default_config.rpcs.get_saas.timeout = 30.0 - default_config.rpcs.get_saas.retry_policy = { - initial_delay: 1.0, max_delay: 10.0, multiplier: 1.3, retry_codes: [14] - } - - default_config.rpcs.create_saas.timeout = 30.0 - - default_config.rpcs.update_saas.timeout = 30.0 - - default_config.rpcs.delete_saas.timeout = 30.0 - default_config.rpcs.delete_saas.retry_policy = { - initial_delay: 1.0, max_delay: 10.0, multiplier: 1.3, retry_codes: [14] - } - - default_config.rpcs.list_tenants.timeout = 80.0 - default_config.rpcs.list_tenants.retry_policy = { - initial_delay: 1.0, max_delay: 10.0, multiplier: 1.3, retry_codes: [14] - } - - default_config.rpcs.get_tenant.timeout = 30.0 - default_config.rpcs.get_tenant.retry_policy = { - initial_delay: 1.0, max_delay: 10.0, multiplier: 1.3, retry_codes: [14] - } - - default_config.rpcs.create_tenant.timeout = 30.0 - - default_config.rpcs.update_tenant.timeout = 30.0 - - default_config.rpcs.delete_tenant.timeout = 30.0 - default_config.rpcs.delete_tenant.retry_policy = { - initial_delay: 1.0, max_delay: 10.0, multiplier: 1.3, retry_codes: [14] - } - - default_config.rpcs.list_unit_kinds.timeout = 80.0 - default_config.rpcs.list_unit_kinds.retry_policy = { - initial_delay: 1.0, max_delay: 10.0, multiplier: 1.3, retry_codes: [14] - } - - default_config.rpcs.get_unit_kind.timeout = 30.0 - default_config.rpcs.get_unit_kind.retry_policy = { - initial_delay: 1.0, max_delay: 10.0, multiplier: 1.3, retry_codes: [14] - } - - default_config.rpcs.create_unit_kind.timeout = 30.0 - - default_config.rpcs.update_unit_kind.timeout = 80.0 - - default_config.rpcs.delete_unit_kind.timeout = 80.0 - default_config.rpcs.delete_unit_kind.retry_policy = { - initial_delay: 1.0, max_delay: 10.0, multiplier: 1.3, retry_codes: [14] - } - - default_config.rpcs.list_units.timeout = 80.0 - default_config.rpcs.list_units.retry_policy = { - initial_delay: 1.0, max_delay: 10.0, multiplier: 1.3, retry_codes: [14] - } - - default_config.rpcs.get_unit.timeout = 30.0 - default_config.rpcs.get_unit.retry_policy = { - initial_delay: 1.0, max_delay: 10.0, multiplier: 1.3, retry_codes: [14] - } - - default_config.rpcs.create_unit.timeout = 30.0 - - default_config.rpcs.update_unit.timeout = 30.0 - - default_config.rpcs.delete_unit.timeout = 30.0 - default_config.rpcs.delete_unit.retry_policy = { - initial_delay: 1.0, max_delay: 10.0, multiplier: 1.3, retry_codes: [14] - } - - default_config.rpcs.list_unit_operations.timeout = 80.0 - default_config.rpcs.list_unit_operations.retry_policy = { - initial_delay: 1.0, max_delay: 10.0, multiplier: 1.3, retry_codes: [14] - } - - default_config.rpcs.get_unit_operation.timeout = 30.0 - default_config.rpcs.get_unit_operation.retry_policy = { - initial_delay: 1.0, max_delay: 10.0, multiplier: 1.3, retry_codes: [14] - } - - default_config.rpcs.create_unit_operation.timeout = 30.0 - - default_config.rpcs.update_unit_operation.timeout = 30.0 - - default_config.rpcs.delete_unit_operation.timeout = 30.0 - default_config.rpcs.delete_unit_operation.retry_policy = { - initial_delay: 1.0, max_delay: 10.0, multiplier: 1.3, retry_codes: [14] - } - - default_config.rpcs.list_releases.timeout = 80.0 - default_config.rpcs.list_releases.retry_policy = { - initial_delay: 1.0, max_delay: 10.0, multiplier: 1.3, retry_codes: [14] - } - - default_config.rpcs.get_release.timeout = 30.0 - default_config.rpcs.get_release.retry_policy = { - initial_delay: 1.0, max_delay: 10.0, multiplier: 1.3, retry_codes: [14] - } - - default_config.rpcs.create_release.timeout = 30.0 - - default_config.rpcs.update_release.timeout = 30.0 - - default_config.rpcs.delete_release.timeout = 30.0 - default_config.rpcs.delete_release.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 SaasDeployments Client instance. - # - # The configuration is set to the derived mode, meaning that values can be changed, - # but structural changes (adding new fields, etc.) are not allowed. Structural changes - # should be made on {Client.configure}. - # - # See {::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::SaasDeployments::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 - @saas_deployments_stub.universe_domain - end - - ## - # Create a new SaasDeployments client object. - # - # @example - # - # # Create a client using the default configuration - # client = ::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::SaasDeployments::Client.new - # - # # Create a client using a custom configuration - # client = ::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::SaasDeployments::Client.new do |config| - # config.timeout = 10.0 - # end - # - # @yield [config] Configure the SaasDeployments client. - # @yieldparam config [Client::Configuration] - # - def initialize - # These require statements are intentionally placed here to initialize - # the gRPC module only when it's required. - # See https://github.com/googleapis/toolkit/issues/446 - require "gapic/grpc" - require "google/cloud/saasplatform/saasservicemgmt/v1beta1/deployments_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 - - @saas_deployments_stub = ::Gapic::ServiceStub.new( - ::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::SaasDeployments::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 - ) - - @saas_deployments_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 = @saas_deployments_stub.endpoint - config.universe_domain = @saas_deployments_stub.universe_domain - config.logger = @saas_deployments_stub.logger if config.respond_to? :logger= - end - end - - ## - # Get the associated client for mix-in of the Locations. - # - # @return [Google::Cloud::Location::Locations::Client] - # - attr_reader :location_client - - ## - # The logger used for request/response debug logging. - # - # @return [Logger] - # - def logger - @saas_deployments_stub.logger - end - - # Service calls - - ## - # Retrieve a collection of saas. - # - # @overload list_saas(request, options = nil) - # Pass arguments to `list_saas` via a request object, either of type - # {::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::ListSaasRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::ListSaasRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_saas(parent: nil, page_size: nil, page_token: nil, filter: nil, order_by: nil) - # Pass arguments to `list_saas` via keyword arguments. Note that at - # least one keyword argument is 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 of the saas. - # @param page_size [::Integer] - # The maximum number of saas to send per page. - # @param page_token [::String] - # The page token: If the next_page_token from a previous response - # is provided, this request will send the subsequent page. - # @param filter [::String] - # Filter the list as specified in https://google.aip.dev/160. - # @param order_by [::String] - # Order results as specified in https://google.aip.dev/132. - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Gapic::PagedEnumerable<::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::Saas>] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Gapic::PagedEnumerable<::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::Saas>] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/cloud/saas_platform/saas_service_mgmt/v1beta1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::SaasDeployments::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::ListSaasRequest.new - # - # # Call the list_saas method. - # result = client.list_saas request - # - # # The returned object is of type Gapic::PagedEnumerable. You can iterate - # # over elements, and API calls will be issued to fetch pages as needed. - # result.each do |item| - # # Each element is of type ::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::Saas. - # p item - # end - # - def list_saas request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::ListSaasRequest - - # Converts hash 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_saas.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::SaasPlatform::SaasServiceMgmt::V1beta1::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_saas.timeout, - metadata: metadata, - retry_policy: @config.rpcs.list_saas.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @saas_deployments_stub.call_rpc :list_saas, request, options: options do |response, operation| - response = ::Gapic::PagedEnumerable.new @saas_deployments_stub, :list_saas, 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 - - ## - # Retrieve a single saas. - # - # @overload get_saas(request, options = nil) - # Pass arguments to `get_saas` via a request object, either of type - # {::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::GetSaasRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::GetSaasRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_saas(name: nil) - # Pass arguments to `get_saas` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param name [::String] - # Required. The resource name of the resource within a service. - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::Saas] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::Saas] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/cloud/saas_platform/saas_service_mgmt/v1beta1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::SaasDeployments::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::GetSaasRequest.new - # - # # Call the get_saas method. - # result = client.get_saas request - # - # # The returned object is of type Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::Saas. - # p result - # - def get_saas request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::GetSaasRequest - - # Converts hash 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_saas.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::SaasPlatform::SaasServiceMgmt::V1beta1::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_saas.timeout, - metadata: metadata, - retry_policy: @config.rpcs.get_saas.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @saas_deployments_stub.call_rpc :get_saas, 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 - - ## - # Create a new saas. - # - # @overload create_saas(request, options = nil) - # Pass arguments to `create_saas` via a request object, either of type - # {::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::CreateSaasRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::CreateSaasRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_saas(parent: nil, saas_id: nil, saas: nil, validate_only: nil, request_id: nil) - # Pass arguments to `create_saas` via keyword arguments. Note that at - # least one keyword argument is 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 of the saas. - # @param saas_id [::String] - # Required. The ID value for the new saas. - # @param saas [::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::Saas, ::Hash] - # Required. The desired state for the saas. - # @param validate_only [::Boolean] - # If "validate_only" is set to true, the service will try to validate - # that this request would succeed, but will not actually make changes. - # @param request_id [::String] - # An optional request ID to identify requests. Specify a unique request ID - # so that if you must retry your request, the server will know to ignore - # the request if it has already been completed. The server will guarantee - # that for at least 60 minutes since the first request. - # - # For example, consider a situation where you make an initial request and the - # request times out. If you make the request again with the same request - # ID, the server can check if original operation with the same request ID - # was received, and if so, will ignore the second request. This prevents - # clients from accidentally creating duplicate commitments. - # - # The request ID must be a valid UUID with the exception that zero UUID is - # not supported (00000000-0000-0000-0000-000000000000). - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::Saas] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::Saas] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/cloud/saas_platform/saas_service_mgmt/v1beta1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::SaasDeployments::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::CreateSaasRequest.new - # - # # Call the create_saas method. - # result = client.create_saas request - # - # # The returned object is of type Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::Saas. - # p result - # - def create_saas request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::CreateSaasRequest - - # Converts hash 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_saas.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::SaasPlatform::SaasServiceMgmt::V1beta1::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_saas.timeout, - metadata: metadata, - retry_policy: @config.rpcs.create_saas.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @saas_deployments_stub.call_rpc :create_saas, 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 - - ## - # Update a single saas. - # - # @overload update_saas(request, options = nil) - # Pass arguments to `update_saas` via a request object, either of type - # {::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::UpdateSaasRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::UpdateSaasRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_saas(saas: nil, validate_only: nil, request_id: nil, update_mask: nil) - # Pass arguments to `update_saas` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param saas [::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::Saas, ::Hash] - # Required. The desired state for the saas. - # @param validate_only [::Boolean] - # If "validate_only" is set to true, the service will try to validate - # that this request would succeed, but will not actually make changes. - # @param request_id [::String] - # An optional request ID to identify requests. Specify a unique request ID - # so that if you must retry your request, the server will know to ignore - # the request if it has already been completed. The server will guarantee - # that for at least 60 minutes since the first request. - # - # For example, consider a situation where you make an initial request and the - # request times out. If you make the request again with the same request - # ID, the server can check if original operation with the same request ID - # was received, and if so, will ignore the second request. This prevents - # clients from accidentally creating duplicate commitments. - # - # The request ID must be a valid UUID with the exception that zero UUID is - # not supported (00000000-0000-0000-0000-000000000000). - # @param update_mask [::Google::Protobuf::FieldMask, ::Hash] - # Field mask is used to specify the fields to be overwritten in the - # Saas resource by the update. - # - # The fields specified in the update_mask are relative to the resource, not - # the full request. A field will be overwritten if it is in the mask. - # - # If the user does not provide a mask then all fields in the - # Saas will be overwritten. - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::Saas] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::Saas] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/cloud/saas_platform/saas_service_mgmt/v1beta1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::SaasDeployments::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::UpdateSaasRequest.new - # - # # Call the update_saas method. - # result = client.update_saas request - # - # # The returned object is of type Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::Saas. - # p result - # - def update_saas request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::UpdateSaasRequest - - # Converts hash 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_saas.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::SaasPlatform::SaasServiceMgmt::V1beta1::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.saas&.name - header_params["saas.name"] = request.saas.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_saas.timeout, - metadata: metadata, - retry_policy: @config.rpcs.update_saas.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @saas_deployments_stub.call_rpc :update_saas, 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 - - ## - # Delete a single saas. - # - # @overload delete_saas(request, options = nil) - # Pass arguments to `delete_saas` via a request object, either of type - # {::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::DeleteSaasRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::DeleteSaasRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_saas(name: nil, etag: nil, validate_only: nil, request_id: nil) - # Pass arguments to `delete_saas` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param name [::String] - # Required. The resource name of the resource within a service. - # @param etag [::String] - # The etag known to the client for the expected state of the saas. This is - # used with state-changing methods to prevent accidental overwrites when - # multiple user agents might be acting in parallel on the same resource. - # - # An etag wildcard provide optimistic concurrency based on the expected - # existence of the saas. The Any wildcard (`*`) requires that the resource - # must already exists, and the Not Any wildcard (`!*`) requires that it must - # not. - # @param validate_only [::Boolean] - # If "validate_only" is set to true, the service will try to validate - # that this request would succeed, but will not actually make changes. - # @param request_id [::String] - # An optional request ID to identify requests. Specify a unique request ID - # so that if you must retry your request, the server will know to ignore - # the request if it has already been completed. The server will guarantee - # that for at least 60 minutes since the first request. - # - # For example, consider a situation where you make an initial request and the - # request times out. If you make the request again with the same request - # ID, the server can check if original operation with the same request ID - # was received, and if so, will ignore the second request. This prevents - # clients from accidentally creating duplicate commitments. - # - # The request ID must be a valid UUID with the exception that zero UUID is - # not supported (00000000-0000-0000-0000-000000000000). - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Google::Protobuf::Empty] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Google::Protobuf::Empty] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/cloud/saas_platform/saas_service_mgmt/v1beta1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::SaasDeployments::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::DeleteSaasRequest.new - # - # # Call the delete_saas method. - # result = client.delete_saas request - # - # # The returned object is of type Google::Protobuf::Empty. - # p result - # - def delete_saas request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::DeleteSaasRequest - - # Converts hash 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_saas.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::SaasPlatform::SaasServiceMgmt::V1beta1::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_saas.timeout, - metadata: metadata, - retry_policy: @config.rpcs.delete_saas.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @saas_deployments_stub.call_rpc :delete_saas, 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 - - ## - # Retrieve a collection of tenants. - # - # @overload list_tenants(request, options = nil) - # Pass arguments to `list_tenants` via a request object, either of type - # {::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::ListTenantsRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::ListTenantsRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_tenants(parent: nil, page_size: nil, page_token: nil, filter: nil, order_by: nil) - # Pass arguments to `list_tenants` via keyword arguments. Note that at - # least one keyword argument is 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 of the tenant. - # @param page_size [::Integer] - # The maximum number of tenants to send per page. - # @param page_token [::String] - # The page token: If the next_page_token from a previous response - # is provided, this request will send the subsequent page. - # @param filter [::String] - # Filter the list as specified in https://google.aip.dev/160. - # @param order_by [::String] - # Order results as specified in https://google.aip.dev/132. - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Gapic::PagedEnumerable<::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::Tenant>] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Gapic::PagedEnumerable<::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::Tenant>] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/cloud/saas_platform/saas_service_mgmt/v1beta1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::SaasDeployments::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::ListTenantsRequest.new - # - # # Call the list_tenants method. - # result = client.list_tenants request - # - # # The returned object is of type Gapic::PagedEnumerable. You can iterate - # # over elements, and API calls will be issued to fetch pages as needed. - # result.each do |item| - # # Each element is of type ::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::Tenant. - # p item - # end - # - def list_tenants request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::ListTenantsRequest - - # Converts hash 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_tenants.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::SaasPlatform::SaasServiceMgmt::V1beta1::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_tenants.timeout, - metadata: metadata, - retry_policy: @config.rpcs.list_tenants.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @saas_deployments_stub.call_rpc :list_tenants, request, options: options do |response, operation| - response = ::Gapic::PagedEnumerable.new @saas_deployments_stub, :list_tenants, 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 - - ## - # Retrieve a single tenant. - # - # @overload get_tenant(request, options = nil) - # Pass arguments to `get_tenant` via a request object, either of type - # {::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::GetTenantRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::GetTenantRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_tenant(name: nil) - # Pass arguments to `get_tenant` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param name [::String] - # Required. The resource name of the resource within a service. - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::Tenant] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::Tenant] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/cloud/saas_platform/saas_service_mgmt/v1beta1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::SaasDeployments::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::GetTenantRequest.new - # - # # Call the get_tenant method. - # result = client.get_tenant request - # - # # The returned object is of type Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::Tenant. - # p result - # - def get_tenant request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::GetTenantRequest - - # Converts hash 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_tenant.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::SaasPlatform::SaasServiceMgmt::V1beta1::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_tenant.timeout, - metadata: metadata, - retry_policy: @config.rpcs.get_tenant.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @saas_deployments_stub.call_rpc :get_tenant, 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 - - ## - # Create a new tenant. - # - # @overload create_tenant(request, options = nil) - # Pass arguments to `create_tenant` via a request object, either of type - # {::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::CreateTenantRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::CreateTenantRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_tenant(parent: nil, tenant_id: nil, tenant: nil, validate_only: nil, request_id: nil) - # Pass arguments to `create_tenant` via keyword arguments. Note that at - # least one keyword argument is 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 of the tenant. - # @param tenant_id [::String] - # Required. The ID value for the new tenant. - # @param tenant [::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::Tenant, ::Hash] - # Required. The desired state for the tenant. - # @param validate_only [::Boolean] - # If "validate_only" is set to true, the service will try to validate - # that this request would succeed, but will not actually make changes. - # @param request_id [::String] - # An optional request ID to identify requests. Specify a unique request ID - # so that if you must retry your request, the server will know to ignore - # the request if it has already been completed. The server will guarantee - # that for at least 60 minutes since the first request. - # - # For example, consider a situation where you make an initial request and the - # request times out. If you make the request again with the same request - # ID, the server can check if original operation with the same request ID - # was received, and if so, will ignore the second request. This prevents - # clients from accidentally creating duplicate commitments. - # - # The request ID must be a valid UUID with the exception that zero UUID is - # not supported (00000000-0000-0000-0000-000000000000). - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::Tenant] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::Tenant] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/cloud/saas_platform/saas_service_mgmt/v1beta1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::SaasDeployments::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::CreateTenantRequest.new - # - # # Call the create_tenant method. - # result = client.create_tenant request - # - # # The returned object is of type Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::Tenant. - # p result - # - def create_tenant request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::CreateTenantRequest - - # Converts hash 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_tenant.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::SaasPlatform::SaasServiceMgmt::V1beta1::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_tenant.timeout, - metadata: metadata, - retry_policy: @config.rpcs.create_tenant.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @saas_deployments_stub.call_rpc :create_tenant, 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 - - ## - # Update a single tenant. - # - # @overload update_tenant(request, options = nil) - # Pass arguments to `update_tenant` via a request object, either of type - # {::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::UpdateTenantRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::UpdateTenantRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_tenant(tenant: nil, validate_only: nil, request_id: nil, update_mask: nil) - # Pass arguments to `update_tenant` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param tenant [::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::Tenant, ::Hash] - # Required. The desired state for the tenant. - # @param validate_only [::Boolean] - # If "validate_only" is set to true, the service will try to validate - # that this request would succeed, but will not actually make changes. - # @param request_id [::String] - # An optional request ID to identify requests. Specify a unique request ID - # so that if you must retry your request, the server will know to ignore - # the request if it has already been completed. The server will guarantee - # that for at least 60 minutes since the first request. - # - # For example, consider a situation where you make an initial request and the - # request times out. If you make the request again with the same request - # ID, the server can check if original operation with the same request ID - # was received, and if so, will ignore the second request. This prevents - # clients from accidentally creating duplicate commitments. - # - # The request ID must be a valid UUID with the exception that zero UUID is - # not supported (00000000-0000-0000-0000-000000000000). - # @param update_mask [::Google::Protobuf::FieldMask, ::Hash] - # Field mask is used to specify the fields to be overwritten in the - # Tenant resource by the update. - # - # The fields specified in the update_mask are relative to the resource, not - # the full request. A field will be overwritten if it is in the mask. - # - # If the user does not provide a mask then all fields in the - # Tenant will be overwritten. - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::Tenant] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::Tenant] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/cloud/saas_platform/saas_service_mgmt/v1beta1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::SaasDeployments::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::UpdateTenantRequest.new - # - # # Call the update_tenant method. - # result = client.update_tenant request - # - # # The returned object is of type Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::Tenant. - # p result - # - def update_tenant request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::UpdateTenantRequest - - # Converts hash 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_tenant.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::SaasPlatform::SaasServiceMgmt::V1beta1::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.tenant&.name - header_params["tenant.name"] = request.tenant.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_tenant.timeout, - metadata: metadata, - retry_policy: @config.rpcs.update_tenant.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @saas_deployments_stub.call_rpc :update_tenant, 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 - - ## - # Delete a single tenant. - # - # @overload delete_tenant(request, options = nil) - # Pass arguments to `delete_tenant` via a request object, either of type - # {::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::DeleteTenantRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::DeleteTenantRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_tenant(name: nil, etag: nil, validate_only: nil, request_id: nil) - # Pass arguments to `delete_tenant` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param name [::String] - # Required. The resource name of the resource within a service. - # @param etag [::String] - # The etag known to the client for the expected state of the tenant. This is - # used with state-changing methods to prevent accidental overwrites when - # multiple user agents might be acting in parallel on the same resource. - # - # An etag wildcard provide optimistic concurrency based on the expected - # existence of the tenant. The Any wildcard (`*`) requires that the resource - # must already exists, and the Not Any wildcard (`!*`) requires that it must - # not. - # @param validate_only [::Boolean] - # If "validate_only" is set to true, the service will try to validate - # that this request would succeed, but will not actually make changes. - # @param request_id [::String] - # An optional request ID to identify requests. Specify a unique request ID - # so that if you must retry your request, the server will know to ignore - # the request if it has already been completed. The server will guarantee - # that for at least 60 minutes since the first request. - # - # For example, consider a situation where you make an initial request and the - # request times out. If you make the request again with the same request - # ID, the server can check if original operation with the same request ID - # was received, and if so, will ignore the second request. This prevents - # clients from accidentally creating duplicate commitments. - # - # The request ID must be a valid UUID with the exception that zero UUID is - # not supported (00000000-0000-0000-0000-000000000000). - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Google::Protobuf::Empty] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Google::Protobuf::Empty] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/cloud/saas_platform/saas_service_mgmt/v1beta1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::SaasDeployments::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::DeleteTenantRequest.new - # - # # Call the delete_tenant method. - # result = client.delete_tenant request - # - # # The returned object is of type Google::Protobuf::Empty. - # p result - # - def delete_tenant request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::DeleteTenantRequest - - # Converts hash 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_tenant.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::SaasPlatform::SaasServiceMgmt::V1beta1::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_tenant.timeout, - metadata: metadata, - retry_policy: @config.rpcs.delete_tenant.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @saas_deployments_stub.call_rpc :delete_tenant, 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 - - ## - # Retrieve a collection of unit kinds. - # - # @overload list_unit_kinds(request, options = nil) - # Pass arguments to `list_unit_kinds` via a request object, either of type - # {::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::ListUnitKindsRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::ListUnitKindsRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_unit_kinds(parent: nil, page_size: nil, page_token: nil, filter: nil, order_by: nil) - # Pass arguments to `list_unit_kinds` via keyword arguments. Note that at - # least one keyword argument is 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 of the unit kind. - # @param page_size [::Integer] - # The maximum number of unit kinds to send per page. - # @param page_token [::String] - # The page token: If the next_page_token from a previous response - # is provided, this request will send the subsequent page. - # @param filter [::String] - # Filter the list as specified in https://google.aip.dev/160. - # @param order_by [::String] - # Order results as specified in https://google.aip.dev/132. - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Gapic::PagedEnumerable<::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::UnitKind>] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Gapic::PagedEnumerable<::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::UnitKind>] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/cloud/saas_platform/saas_service_mgmt/v1beta1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::SaasDeployments::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::ListUnitKindsRequest.new - # - # # Call the list_unit_kinds method. - # result = client.list_unit_kinds request - # - # # The returned object is of type Gapic::PagedEnumerable. You can iterate - # # over elements, and API calls will be issued to fetch pages as needed. - # result.each do |item| - # # Each element is of type ::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::UnitKind. - # p item - # end - # - def list_unit_kinds request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::ListUnitKindsRequest - - # Converts hash 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_unit_kinds.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::SaasPlatform::SaasServiceMgmt::V1beta1::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_unit_kinds.timeout, - metadata: metadata, - retry_policy: @config.rpcs.list_unit_kinds.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @saas_deployments_stub.call_rpc :list_unit_kinds, request, options: options do |response, operation| - response = ::Gapic::PagedEnumerable.new @saas_deployments_stub, :list_unit_kinds, 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 - - ## - # Retrieve a single unit kind. - # - # @overload get_unit_kind(request, options = nil) - # Pass arguments to `get_unit_kind` via a request object, either of type - # {::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::GetUnitKindRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::GetUnitKindRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_unit_kind(name: nil) - # Pass arguments to `get_unit_kind` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param name [::String] - # Required. The resource name of the resource within a service. - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::UnitKind] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::UnitKind] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/cloud/saas_platform/saas_service_mgmt/v1beta1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::SaasDeployments::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::GetUnitKindRequest.new - # - # # Call the get_unit_kind method. - # result = client.get_unit_kind request - # - # # The returned object is of type Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::UnitKind. - # p result - # - def get_unit_kind request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::GetUnitKindRequest - - # Converts hash 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_unit_kind.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::SaasPlatform::SaasServiceMgmt::V1beta1::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_unit_kind.timeout, - metadata: metadata, - retry_policy: @config.rpcs.get_unit_kind.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @saas_deployments_stub.call_rpc :get_unit_kind, 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 - - ## - # Create a new unit kind. - # - # @overload create_unit_kind(request, options = nil) - # Pass arguments to `create_unit_kind` via a request object, either of type - # {::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::CreateUnitKindRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::CreateUnitKindRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_unit_kind(parent: nil, unit_kind_id: nil, unit_kind: nil, validate_only: nil, request_id: nil) - # Pass arguments to `create_unit_kind` via keyword arguments. Note that at - # least one keyword argument is 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 of the unit kind. - # @param unit_kind_id [::String] - # Required. The ID value for the new unit kind. - # @param unit_kind [::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::UnitKind, ::Hash] - # Required. The desired state for the unit kind. - # @param validate_only [::Boolean] - # If "validate_only" is set to true, the service will try to validate - # that this request would succeed, but will not actually make changes. - # @param request_id [::String] - # An optional request ID to identify requests. Specify a unique request ID - # so that if you must retry your request, the server will know to ignore - # the request if it has already been completed. The server will guarantee - # that for at least 60 minutes since the first request. - # - # For example, consider a situation where you make an initial request and the - # request times out. If you make the request again with the same request - # ID, the server can check if original operation with the same request ID - # was received, and if so, will ignore the second request. This prevents - # clients from accidentally creating duplicate commitments. - # - # The request ID must be a valid UUID with the exception that zero UUID is - # not supported (00000000-0000-0000-0000-000000000000). - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::UnitKind] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::UnitKind] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/cloud/saas_platform/saas_service_mgmt/v1beta1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::SaasDeployments::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::CreateUnitKindRequest.new - # - # # Call the create_unit_kind method. - # result = client.create_unit_kind request - # - # # The returned object is of type Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::UnitKind. - # p result - # - def create_unit_kind request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::CreateUnitKindRequest - - # Converts hash 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_unit_kind.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::SaasPlatform::SaasServiceMgmt::V1beta1::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_unit_kind.timeout, - metadata: metadata, - retry_policy: @config.rpcs.create_unit_kind.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @saas_deployments_stub.call_rpc :create_unit_kind, 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 - - ## - # Update a single unit kind. - # - # @overload update_unit_kind(request, options = nil) - # Pass arguments to `update_unit_kind` via a request object, either of type - # {::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::UpdateUnitKindRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::UpdateUnitKindRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_unit_kind(unit_kind: nil, validate_only: nil, request_id: nil, update_mask: nil) - # Pass arguments to `update_unit_kind` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param unit_kind [::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::UnitKind, ::Hash] - # Required. The desired state for the unit kind. - # @param validate_only [::Boolean] - # If "validate_only" is set to true, the service will try to validate - # that this request would succeed, but will not actually make changes. - # @param request_id [::String] - # An optional request ID to identify requests. Specify a unique request ID - # so that if you must retry your request, the server will know to ignore - # the request if it has already been completed. The server will guarantee - # that for at least 60 minutes since the first request. - # - # For example, consider a situation where you make an initial request and the - # request times out. If you make the request again with the same request - # ID, the server can check if original operation with the same request ID - # was received, and if so, will ignore the second request. This prevents - # clients from accidentally creating duplicate commitments. - # - # The request ID must be a valid UUID with the exception that zero UUID is - # not supported (00000000-0000-0000-0000-000000000000). - # @param update_mask [::Google::Protobuf::FieldMask, ::Hash] - # Field mask is used to specify the fields to be overwritten in the - # UnitKind resource by the update. - # - # The fields specified in the update_mask are relative to the resource, not - # the full request. A field will be overwritten if it is in the mask. - # - # If the user does not provide a mask then all fields in the - # UnitKind will be overwritten. - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::UnitKind] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::UnitKind] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/cloud/saas_platform/saas_service_mgmt/v1beta1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::SaasDeployments::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::UpdateUnitKindRequest.new - # - # # Call the update_unit_kind method. - # result = client.update_unit_kind request - # - # # The returned object is of type Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::UnitKind. - # p result - # - def update_unit_kind request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::UpdateUnitKindRequest - - # Converts hash 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_unit_kind.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::SaasPlatform::SaasServiceMgmt::V1beta1::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.unit_kind&.name - header_params["unit_kind.name"] = request.unit_kind.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_unit_kind.timeout, - metadata: metadata, - retry_policy: @config.rpcs.update_unit_kind.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @saas_deployments_stub.call_rpc :update_unit_kind, 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 - - ## - # Delete a single unit kind. - # - # @overload delete_unit_kind(request, options = nil) - # Pass arguments to `delete_unit_kind` via a request object, either of type - # {::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::DeleteUnitKindRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::DeleteUnitKindRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_unit_kind(name: nil, etag: nil, validate_only: nil, request_id: nil) - # Pass arguments to `delete_unit_kind` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param name [::String] - # Required. The resource name of the resource within a service. - # @param etag [::String] - # The etag known to the client for the expected state of the unit kind. This - # is used with state-changing methods to prevent accidental overwrites when - # multiple user agents might be acting in parallel on the same resource. - # - # An etag wildcard provide optimistic concurrency based on the expected - # existence of the unit kind. The Any wildcard (`*`) requires that the - # resource must already exists, and the Not Any wildcard (`!*`) requires that - # it must not. - # @param validate_only [::Boolean] - # If "validate_only" is set to true, the service will try to validate - # that this request would succeed, but will not actually make changes. - # @param request_id [::String] - # An optional request ID to identify requests. Specify a unique request ID - # so that if you must retry your request, the server will know to ignore - # the request if it has already been completed. The server will guarantee - # that for at least 60 minutes since the first request. - # - # For example, consider a situation where you make an initial request and the - # request times out. If you make the request again with the same request - # ID, the server can check if original operation with the same request ID - # was received, and if so, will ignore the second request. This prevents - # clients from accidentally creating duplicate commitments. - # - # The request ID must be a valid UUID with the exception that zero UUID is - # not supported (00000000-0000-0000-0000-000000000000). - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Google::Protobuf::Empty] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Google::Protobuf::Empty] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/cloud/saas_platform/saas_service_mgmt/v1beta1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::SaasDeployments::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::DeleteUnitKindRequest.new - # - # # Call the delete_unit_kind method. - # result = client.delete_unit_kind request - # - # # The returned object is of type Google::Protobuf::Empty. - # p result - # - def delete_unit_kind request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::DeleteUnitKindRequest - - # Converts hash 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_unit_kind.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::SaasPlatform::SaasServiceMgmt::V1beta1::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_unit_kind.timeout, - metadata: metadata, - retry_policy: @config.rpcs.delete_unit_kind.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @saas_deployments_stub.call_rpc :delete_unit_kind, 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 - - ## - # Retrieve a collection of units. - # - # @overload list_units(request, options = nil) - # Pass arguments to `list_units` via a request object, either of type - # {::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::ListUnitsRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::ListUnitsRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_units(parent: nil, page_size: nil, page_token: nil, filter: nil, order_by: nil) - # Pass arguments to `list_units` via keyword arguments. Note that at - # least one keyword argument is 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 of the unit. - # @param page_size [::Integer] - # The maximum number of units to send per page. - # @param page_token [::String] - # The page token: If the next_page_token from a previous response - # is provided, this request will send the subsequent page. - # @param filter [::String] - # Filter the list as specified in https://google.aip.dev/160. - # @param order_by [::String] - # Order results as specified in https://google.aip.dev/132. - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Gapic::PagedEnumerable<::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::Unit>] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Gapic::PagedEnumerable<::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::Unit>] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/cloud/saas_platform/saas_service_mgmt/v1beta1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::SaasDeployments::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::ListUnitsRequest.new - # - # # Call the list_units method. - # result = client.list_units request - # - # # The returned object is of type Gapic::PagedEnumerable. You can iterate - # # over elements, and API calls will be issued to fetch pages as needed. - # result.each do |item| - # # Each element is of type ::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::Unit. - # p item - # end - # - def list_units request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::ListUnitsRequest - - # Converts hash 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_units.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::SaasPlatform::SaasServiceMgmt::V1beta1::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_units.timeout, - metadata: metadata, - retry_policy: @config.rpcs.list_units.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @saas_deployments_stub.call_rpc :list_units, request, options: options do |response, operation| - response = ::Gapic::PagedEnumerable.new @saas_deployments_stub, :list_units, 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 - - ## - # Retrieve a single unit. - # - # @overload get_unit(request, options = nil) - # Pass arguments to `get_unit` via a request object, either of type - # {::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::GetUnitRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::GetUnitRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_unit(name: nil) - # Pass arguments to `get_unit` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param name [::String] - # Required. The resource name of the resource within a service. - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::Unit] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::Unit] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/cloud/saas_platform/saas_service_mgmt/v1beta1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::SaasDeployments::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::GetUnitRequest.new - # - # # Call the get_unit method. - # result = client.get_unit request - # - # # The returned object is of type Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::Unit. - # p result - # - def get_unit request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::GetUnitRequest - - # Converts hash 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_unit.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::SaasPlatform::SaasServiceMgmt::V1beta1::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_unit.timeout, - metadata: metadata, - retry_policy: @config.rpcs.get_unit.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @saas_deployments_stub.call_rpc :get_unit, 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 - - ## - # Create a new unit. - # - # @overload create_unit(request, options = nil) - # Pass arguments to `create_unit` via a request object, either of type - # {::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::CreateUnitRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::CreateUnitRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_unit(parent: nil, unit_id: nil, unit: nil, validate_only: nil, request_id: nil) - # Pass arguments to `create_unit` via keyword arguments. Note that at - # least one keyword argument is 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 of the unit. - # @param unit_id [::String] - # Required. The ID value for the new unit. - # @param unit [::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::Unit, ::Hash] - # Required. The desired state for the unit. - # @param validate_only [::Boolean] - # If "validate_only" is set to true, the service will try to validate - # that this request would succeed, but will not actually make changes. - # @param request_id [::String] - # An optional request ID to identify requests. Specify a unique request ID - # so that if you must retry your request, the server will know to ignore - # the request if it has already been completed. The server will guarantee - # that for at least 60 minutes since the first request. - # - # For example, consider a situation where you make an initial request and the - # request times out. If you make the request again with the same request - # ID, the server can check if original operation with the same request ID - # was received, and if so, will ignore the second request. This prevents - # clients from accidentally creating duplicate commitments. - # - # The request ID must be a valid UUID with the exception that zero UUID is - # not supported (00000000-0000-0000-0000-000000000000). - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::Unit] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::Unit] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/cloud/saas_platform/saas_service_mgmt/v1beta1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::SaasDeployments::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::CreateUnitRequest.new - # - # # Call the create_unit method. - # result = client.create_unit request - # - # # The returned object is of type Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::Unit. - # p result - # - def create_unit request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::CreateUnitRequest - - # Converts hash 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_unit.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::SaasPlatform::SaasServiceMgmt::V1beta1::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_unit.timeout, - metadata: metadata, - retry_policy: @config.rpcs.create_unit.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @saas_deployments_stub.call_rpc :create_unit, 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 - - ## - # Update a single unit. - # - # @overload update_unit(request, options = nil) - # Pass arguments to `update_unit` via a request object, either of type - # {::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::UpdateUnitRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::UpdateUnitRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_unit(unit: nil, validate_only: nil, request_id: nil, update_mask: nil) - # Pass arguments to `update_unit` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param unit [::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::Unit, ::Hash] - # Required. The desired state for the unit. - # @param validate_only [::Boolean] - # If "validate_only" is set to true, the service will try to validate - # that this request would succeed, but will not actually make changes. - # @param request_id [::String] - # An optional request ID to identify requests. Specify a unique request ID - # so that if you must retry your request, the server will know to ignore - # the request if it has already been completed. The server will guarantee - # that for at least 60 minutes since the first request. - # - # For example, consider a situation where you make an initial request and the - # request times out. If you make the request again with the same request - # ID, the server can check if original operation with the same request ID - # was received, and if so, will ignore the second request. This prevents - # clients from accidentally creating duplicate commitments. - # - # The request ID must be a valid UUID with the exception that zero UUID is - # not supported (00000000-0000-0000-0000-000000000000). - # @param update_mask [::Google::Protobuf::FieldMask, ::Hash] - # Field mask is used to specify the fields to be overwritten in the - # Unit resource by the update. - # - # The fields specified in the update_mask are relative to the resource, not - # the full request. A field will be overwritten if it is in the mask. - # - # If the user does not provide a mask then all fields in the - # Unit will be overwritten. - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::Unit] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::Unit] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/cloud/saas_platform/saas_service_mgmt/v1beta1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::SaasDeployments::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::UpdateUnitRequest.new - # - # # Call the update_unit method. - # result = client.update_unit request - # - # # The returned object is of type Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::Unit. - # p result - # - def update_unit request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::UpdateUnitRequest - - # Converts hash 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_unit.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::SaasPlatform::SaasServiceMgmt::V1beta1::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.unit&.name - header_params["unit.name"] = request.unit.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_unit.timeout, - metadata: metadata, - retry_policy: @config.rpcs.update_unit.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @saas_deployments_stub.call_rpc :update_unit, 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 - - ## - # Delete a single unit. - # - # @overload delete_unit(request, options = nil) - # Pass arguments to `delete_unit` via a request object, either of type - # {::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::DeleteUnitRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::DeleteUnitRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_unit(name: nil, etag: nil, validate_only: nil, request_id: nil) - # Pass arguments to `delete_unit` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param name [::String] - # Required. The resource name of the resource within a service. - # @param etag [::String] - # The etag known to the client for the expected state of the unit. This is - # used with state-changing methods to prevent accidental overwrites when - # multiple user agents might be acting in parallel on the same resource. - # - # An etag wildcard provide optimistic concurrency based on the expected - # existence of the unit. The Any wildcard (`*`) requires that the resource - # must already exists, and the Not Any wildcard (`!*`) requires that it must - # not. - # @param validate_only [::Boolean] - # If "validate_only" is set to true, the service will try to validate - # that this request would succeed, but will not actually make changes. - # @param request_id [::String] - # An optional request ID to identify requests. Specify a unique request ID - # so that if you must retry your request, the server will know to ignore - # the request if it has already been completed. The server will guarantee - # that for at least 60 minutes since the first request. - # - # For example, consider a situation where you make an initial request and the - # request times out. If you make the request again with the same request - # ID, the server can check if original operation with the same request ID - # was received, and if so, will ignore the second request. This prevents - # clients from accidentally creating duplicate commitments. - # - # The request ID must be a valid UUID with the exception that zero UUID is - # not supported (00000000-0000-0000-0000-000000000000). - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Google::Protobuf::Empty] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Google::Protobuf::Empty] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/cloud/saas_platform/saas_service_mgmt/v1beta1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::SaasDeployments::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::DeleteUnitRequest.new - # - # # Call the delete_unit method. - # result = client.delete_unit request - # - # # The returned object is of type Google::Protobuf::Empty. - # p result - # - def delete_unit request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::DeleteUnitRequest - - # Converts hash 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_unit.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::SaasPlatform::SaasServiceMgmt::V1beta1::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_unit.timeout, - metadata: metadata, - retry_policy: @config.rpcs.delete_unit.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @saas_deployments_stub.call_rpc :delete_unit, 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 - - ## - # Retrieve a collection of unit operations. - # - # @overload list_unit_operations(request, options = nil) - # Pass arguments to `list_unit_operations` via a request object, either of type - # {::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::ListUnitOperationsRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::ListUnitOperationsRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_unit_operations(parent: nil, page_size: nil, page_token: nil, filter: nil, order_by: nil) - # Pass arguments to `list_unit_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 parent [::String] - # Required. The parent of the unit operation. - # @param page_size [::Integer] - # The maximum number of unit operations to send per page. - # @param page_token [::String] - # The page token: If the next_page_token from a previous response - # is provided, this request will send the subsequent page. - # @param filter [::String] - # Filter the list as specified in https://google.aip.dev/160. - # @param order_by [::String] - # Order results as specified in https://google.aip.dev/132. - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Gapic::PagedEnumerable<::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::UnitOperation>] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Gapic::PagedEnumerable<::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::UnitOperation>] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/cloud/saas_platform/saas_service_mgmt/v1beta1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::SaasDeployments::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::ListUnitOperationsRequest.new - # - # # Call the list_unit_operations method. - # result = client.list_unit_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::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::UnitOperation. - # p item - # end - # - def list_unit_operations request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::ListUnitOperationsRequest - - # Converts hash 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_unit_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::SaasPlatform::SaasServiceMgmt::V1beta1::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_unit_operations.timeout, - metadata: metadata, - retry_policy: @config.rpcs.list_unit_operations.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @saas_deployments_stub.call_rpc :list_unit_operations, request, options: options do |response, operation| - response = ::Gapic::PagedEnumerable.new @saas_deployments_stub, :list_unit_operations, 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 - - ## - # Retrieve a single unit operation. - # - # @overload get_unit_operation(request, options = nil) - # Pass arguments to `get_unit_operation` via a request object, either of type - # {::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::GetUnitOperationRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::GetUnitOperationRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_unit_operation(name: nil) - # Pass arguments to `get_unit_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] - # Required. The resource name of the resource within a service. - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::UnitOperation] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::UnitOperation] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/cloud/saas_platform/saas_service_mgmt/v1beta1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::SaasDeployments::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::GetUnitOperationRequest.new - # - # # Call the get_unit_operation method. - # result = client.get_unit_operation request - # - # # The returned object is of type Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::UnitOperation. - # p result - # - def get_unit_operation request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::GetUnitOperationRequest - - # Converts hash 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_unit_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::SaasPlatform::SaasServiceMgmt::V1beta1::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_unit_operation.timeout, - metadata: metadata, - retry_policy: @config.rpcs.get_unit_operation.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @saas_deployments_stub.call_rpc :get_unit_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 - - ## - # Create a new unit operation. - # - # @overload create_unit_operation(request, options = nil) - # Pass arguments to `create_unit_operation` via a request object, either of type - # {::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::CreateUnitOperationRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::CreateUnitOperationRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_unit_operation(parent: nil, unit_operation_id: nil, unit_operation: nil, validate_only: nil, request_id: nil) - # Pass arguments to `create_unit_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 parent [::String] - # Required. The parent of the unit operation. - # @param unit_operation_id [::String] - # Required. The ID value for the new unit operation. - # @param unit_operation [::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::UnitOperation, ::Hash] - # Required. The desired state for the unit operation. - # @param validate_only [::Boolean] - # If "validate_only" is set to true, the service will try to validate - # that this request would succeed, but will not actually make changes. - # @param request_id [::String] - # An optional request ID to identify requests. Specify a unique request ID - # so that if you must retry your request, the server will know to ignore - # the request if it has already been completed. The server will guarantee - # that for at least 60 minutes since the first request. - # - # For example, consider a situation where you make an initial request and the - # request times out. If you make the request again with the same request - # ID, the server can check if original operation with the same request ID - # was received, and if so, will ignore the second request. This prevents - # clients from accidentally creating duplicate commitments. - # - # The request ID must be a valid UUID with the exception that zero UUID is - # not supported (00000000-0000-0000-0000-000000000000). - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::UnitOperation] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::UnitOperation] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/cloud/saas_platform/saas_service_mgmt/v1beta1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::SaasDeployments::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::CreateUnitOperationRequest.new - # - # # Call the create_unit_operation method. - # result = client.create_unit_operation request - # - # # The returned object is of type Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::UnitOperation. - # p result - # - def create_unit_operation request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::CreateUnitOperationRequest - - # Converts hash 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_unit_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::SaasPlatform::SaasServiceMgmt::V1beta1::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_unit_operation.timeout, - metadata: metadata, - retry_policy: @config.rpcs.create_unit_operation.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @saas_deployments_stub.call_rpc :create_unit_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 - - ## - # Update a single unit operation. - # - # @overload update_unit_operation(request, options = nil) - # Pass arguments to `update_unit_operation` via a request object, either of type - # {::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::UpdateUnitOperationRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::UpdateUnitOperationRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_unit_operation(unit_operation: nil, validate_only: nil, request_id: nil, update_mask: nil) - # Pass arguments to `update_unit_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 unit_operation [::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::UnitOperation, ::Hash] - # Required. The desired state for the unit operation. - # @param validate_only [::Boolean] - # If "validate_only" is set to true, the service will try to validate - # that this request would succeed, but will not actually make changes. - # @param request_id [::String] - # An optional request ID to identify requests. Specify a unique request ID - # so that if you must retry your request, the server will know to ignore - # the request if it has already been completed. The server will guarantee - # that for at least 60 minutes since the first request. - # - # For example, consider a situation where you make an initial request and the - # request times out. If you make the request again with the same request - # ID, the server can check if original operation with the same request ID - # was received, and if so, will ignore the second request. This prevents - # clients from accidentally creating duplicate commitments. - # - # The request ID must be a valid UUID with the exception that zero UUID is - # not supported (00000000-0000-0000-0000-000000000000). - # @param update_mask [::Google::Protobuf::FieldMask, ::Hash] - # Field mask is used to specify the fields to be overwritten in the - # UnitOperation resource by the update. - # - # The fields specified in the update_mask are relative to the resource, not - # the full request. A field will be overwritten if it is in the mask. - # - # If the user does not provide a mask then all fields in the - # UnitOperation will be overwritten. - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::UnitOperation] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::UnitOperation] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/cloud/saas_platform/saas_service_mgmt/v1beta1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::SaasDeployments::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::UpdateUnitOperationRequest.new - # - # # Call the update_unit_operation method. - # result = client.update_unit_operation request - # - # # The returned object is of type Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::UnitOperation. - # p result - # - def update_unit_operation request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::UpdateUnitOperationRequest - - # Converts hash 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_unit_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::SaasPlatform::SaasServiceMgmt::V1beta1::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.unit_operation&.name - header_params["unit_operation.name"] = request.unit_operation.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_unit_operation.timeout, - metadata: metadata, - retry_policy: @config.rpcs.update_unit_operation.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @saas_deployments_stub.call_rpc :update_unit_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 - - ## - # Delete a single unit operation. - # - # @overload delete_unit_operation(request, options = nil) - # Pass arguments to `delete_unit_operation` via a request object, either of type - # {::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::DeleteUnitOperationRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::DeleteUnitOperationRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_unit_operation(name: nil, etag: nil, validate_only: nil, request_id: nil) - # Pass arguments to `delete_unit_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] - # Required. The resource name of the resource within a service. - # @param etag [::String] - # The etag known to the client for the expected state of the unit operation. - # This is used with state-changing methods to prevent accidental overwrites - # when multiple user agents might be acting in parallel on the same resource. - # - # An etag wildcard provide optimistic concurrency based on the expected - # existence of the unit operation. The Any wildcard (`*`) requires that the - # resource must already exists, and the Not Any wildcard (`!*`) requires that - # it must not. - # @param validate_only [::Boolean] - # If "validate_only" is set to true, the service will try to validate - # that this request would succeed, but will not actually make changes. - # @param request_id [::String] - # An optional request ID to identify requests. Specify a unique request ID - # so that if you must retry your request, the server will know to ignore - # the request if it has already been completed. The server will guarantee - # that for at least 60 minutes since the first request. - # - # For example, consider a situation where you make an initial request and the - # request times out. If you make the request again with the same request - # ID, the server can check if original operation with the same request ID - # was received, and if so, will ignore the second request. This prevents - # clients from accidentally creating duplicate commitments. - # - # The request ID must be a valid UUID with the exception that zero UUID is - # not supported (00000000-0000-0000-0000-000000000000). - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Google::Protobuf::Empty] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Google::Protobuf::Empty] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/cloud/saas_platform/saas_service_mgmt/v1beta1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::SaasDeployments::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::DeleteUnitOperationRequest.new - # - # # Call the delete_unit_operation method. - # result = client.delete_unit_operation request - # - # # The returned object is of type Google::Protobuf::Empty. - # p result - # - def delete_unit_operation request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::DeleteUnitOperationRequest - - # Converts hash 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_unit_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::SaasPlatform::SaasServiceMgmt::V1beta1::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_unit_operation.timeout, - metadata: metadata, - retry_policy: @config.rpcs.delete_unit_operation.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @saas_deployments_stub.call_rpc :delete_unit_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 - - ## - # Retrieve a collection of releases. - # - # @overload list_releases(request, options = nil) - # Pass arguments to `list_releases` via a request object, either of type - # {::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::ListReleasesRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::ListReleasesRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_releases(parent: nil, page_size: nil, page_token: nil, filter: nil, order_by: nil) - # Pass arguments to `list_releases` via keyword arguments. Note that at - # least one keyword argument is 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 of the release. - # @param page_size [::Integer] - # The maximum number of releases to send per page. - # @param page_token [::String] - # The page token: If the next_page_token from a previous response - # is provided, this request will send the subsequent page. - # @param filter [::String] - # Filter the list as specified in https://google.aip.dev/160. - # @param order_by [::String] - # Order results as specified in https://google.aip.dev/132. - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Gapic::PagedEnumerable<::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::Release>] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Gapic::PagedEnumerable<::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::Release>] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/cloud/saas_platform/saas_service_mgmt/v1beta1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::SaasDeployments::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::ListReleasesRequest.new - # - # # Call the list_releases method. - # result = client.list_releases request - # - # # The returned object is of type Gapic::PagedEnumerable. You can iterate - # # over elements, and API calls will be issued to fetch pages as needed. - # result.each do |item| - # # Each element is of type ::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::Release. - # p item - # end - # - def list_releases request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::ListReleasesRequest - - # Converts hash 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_releases.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::SaasPlatform::SaasServiceMgmt::V1beta1::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_releases.timeout, - metadata: metadata, - retry_policy: @config.rpcs.list_releases.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @saas_deployments_stub.call_rpc :list_releases, request, options: options do |response, operation| - response = ::Gapic::PagedEnumerable.new @saas_deployments_stub, :list_releases, 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 - - ## - # Retrieve a single release. - # - # @overload get_release(request, options = nil) - # Pass arguments to `get_release` via a request object, either of type - # {::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::GetReleaseRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::GetReleaseRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_release(name: nil) - # Pass arguments to `get_release` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param name [::String] - # Required. The resource name of the resource within a service. - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::Release] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::Release] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/cloud/saas_platform/saas_service_mgmt/v1beta1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::SaasDeployments::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::GetReleaseRequest.new - # - # # Call the get_release method. - # result = client.get_release request - # - # # The returned object is of type Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::Release. - # p result - # - def get_release request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::GetReleaseRequest - - # Converts hash 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_release.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::SaasPlatform::SaasServiceMgmt::V1beta1::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_release.timeout, - metadata: metadata, - retry_policy: @config.rpcs.get_release.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @saas_deployments_stub.call_rpc :get_release, 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 - - ## - # Create a new release. - # - # @overload create_release(request, options = nil) - # Pass arguments to `create_release` via a request object, either of type - # {::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::CreateReleaseRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::CreateReleaseRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_release(parent: nil, release_id: nil, release: nil, validate_only: nil, request_id: nil) - # Pass arguments to `create_release` via keyword arguments. Note that at - # least one keyword argument is 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 of the release. - # @param release_id [::String] - # Required. The ID value for the new release. - # @param release [::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::Release, ::Hash] - # Required. The desired state for the release. - # @param validate_only [::Boolean] - # If "validate_only" is set to true, the service will try to validate - # that this request would succeed, but will not actually make changes. - # @param request_id [::String] - # An optional request ID to identify requests. Specify a unique request ID - # so that if you must retry your request, the server will know to ignore - # the request if it has already been completed. The server will guarantee - # that for at least 60 minutes since the first request. - # - # For example, consider a situation where you make an initial request and the - # request times out. If you make the request again with the same request - # ID, the server can check if original operation with the same request ID - # was received, and if so, will ignore the second request. This prevents - # clients from accidentally creating duplicate commitments. - # - # The request ID must be a valid UUID with the exception that zero UUID is - # not supported (00000000-0000-0000-0000-000000000000). - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::Release] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::Release] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/cloud/saas_platform/saas_service_mgmt/v1beta1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::SaasDeployments::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::CreateReleaseRequest.new - # - # # Call the create_release method. - # result = client.create_release request - # - # # The returned object is of type Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::Release. - # p result - # - def create_release request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::CreateReleaseRequest - - # Converts hash 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_release.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::SaasPlatform::SaasServiceMgmt::V1beta1::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_release.timeout, - metadata: metadata, - retry_policy: @config.rpcs.create_release.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @saas_deployments_stub.call_rpc :create_release, 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 - - ## - # Update a single release. - # - # @overload update_release(request, options = nil) - # Pass arguments to `update_release` via a request object, either of type - # {::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::UpdateReleaseRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::UpdateReleaseRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_release(release: nil, validate_only: nil, request_id: nil, update_mask: nil) - # Pass arguments to `update_release` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param release [::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::Release, ::Hash] - # Required. The desired state for the release. - # @param validate_only [::Boolean] - # If "validate_only" is set to true, the service will try to validate - # that this request would succeed, but will not actually make changes. - # @param request_id [::String] - # An optional request ID to identify requests. Specify a unique request ID - # so that if you must retry your request, the server will know to ignore - # the request if it has already been completed. The server will guarantee - # that for at least 60 minutes since the first request. - # - # For example, consider a situation where you make an initial request and the - # request times out. If you make the request again with the same request - # ID, the server can check if original operation with the same request ID - # was received, and if so, will ignore the second request. This prevents - # clients from accidentally creating duplicate commitments. - # - # The request ID must be a valid UUID with the exception that zero UUID is - # not supported (00000000-0000-0000-0000-000000000000). - # @param update_mask [::Google::Protobuf::FieldMask, ::Hash] - # Field mask is used to specify the fields to be overwritten in the - # Release resource by the update. - # - # The fields specified in the update_mask are relative to the resource, not - # the full request. A field will be overwritten if it is in the mask. - # - # If the user does not provide a mask then all fields in the - # Release will be overwritten. - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::Release] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::Release] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/cloud/saas_platform/saas_service_mgmt/v1beta1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::SaasDeployments::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::UpdateReleaseRequest.new - # - # # Call the update_release method. - # result = client.update_release request - # - # # The returned object is of type Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::Release. - # p result - # - def update_release request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::UpdateReleaseRequest - - # Converts hash 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_release.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::SaasPlatform::SaasServiceMgmt::V1beta1::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.release&.name - header_params["release.name"] = request.release.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_release.timeout, - metadata: metadata, - retry_policy: @config.rpcs.update_release.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @saas_deployments_stub.call_rpc :update_release, 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 - - ## - # Delete a single release. - # - # @overload delete_release(request, options = nil) - # Pass arguments to `delete_release` via a request object, either of type - # {::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::DeleteReleaseRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::DeleteReleaseRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_release(name: nil, etag: nil, validate_only: nil, request_id: nil) - # Pass arguments to `delete_release` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param name [::String] - # Required. The resource name of the resource within a service. - # @param etag [::String] - # The etag known to the client for the expected state of the release. This is - # used with state-changing methods to prevent accidental overwrites when - # multiple user agents might be acting in parallel on the same resource. - # - # An etag wildcard provide optimistic concurrency based on the expected - # existence of the release. The Any wildcard (`*`) requires that the resource - # must already exists, and the Not Any wildcard (`!*`) requires that it must - # not. - # @param validate_only [::Boolean] - # If "validate_only" is set to true, the service will try to validate - # that this request would succeed, but will not actually make changes. - # @param request_id [::String] - # An optional request ID to identify requests. Specify a unique request ID - # so that if you must retry your request, the server will know to ignore - # the request if it has already been completed. The server will guarantee - # that for at least 60 minutes since the first request. - # - # For example, consider a situation where you make an initial request and the - # request times out. If you make the request again with the same request - # ID, the server can check if original operation with the same request ID - # was received, and if so, will ignore the second request. This prevents - # clients from accidentally creating duplicate commitments. - # - # The request ID must be a valid UUID with the exception that zero UUID is - # not supported (00000000-0000-0000-0000-000000000000). - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Google::Protobuf::Empty] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Google::Protobuf::Empty] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/cloud/saas_platform/saas_service_mgmt/v1beta1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::SaasDeployments::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::DeleteReleaseRequest.new - # - # # Call the delete_release method. - # result = client.delete_release request - # - # # The returned object is of type Google::Protobuf::Empty. - # p result - # - def delete_release request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::DeleteReleaseRequest - - # Converts hash 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_release.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::SaasPlatform::SaasServiceMgmt::V1beta1::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_release.timeout, - metadata: metadata, - retry_policy: @config.rpcs.delete_release.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @saas_deployments_stub.call_rpc :delete_release, request, options: options do |response, operation| - yield response, operation if block_given? - end - rescue ::GRPC::BadStatus => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Configuration class for the SaasDeployments API. - # - # This class represents the configuration for SaasDeployments, - # providing control over timeouts, retry behavior, logging, transport - # parameters, and other low-level controls. Certain parameters can also be - # applied individually to specific RPCs. See - # {::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::SaasDeployments::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_saas to 20 seconds, - # # and all remaining timeouts to 10 seconds. - # ::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::SaasDeployments::Client.configure do |config| - # config.timeout = 10.0 - # config.rpcs.list_saas.timeout = 20.0 - # end - # - # # Apply the above configuration only to a new client. - # client = ::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::SaasDeployments::Client.new do |config| - # config.timeout = 10.0 - # config.rpcs.list_saas.timeout = 20.0 - # end - # - # @!attribute [rw] endpoint - # A custom service endpoint, as a hostname or hostname:port. The default is - # nil, indicating to use the default endpoint in the current universe domain. - # @return [::String,nil] - # @!attribute [rw] credentials - # Credentials to send with calls. You may provide any of the following types: - # * (`Google::Auth::Credentials`) A googleauth credentials object - # (see the [googleauth docs](https://rubydoc.info/gems/googleauth/Google/Auth/Credentials)) - # * (`Signet::OAuth2::Client`) A signet oauth2 client object - # (see the [signet docs](https://rubydoc.info/gems/signet/Signet/OAuth2/Client)) - # * (`GRPC::Core::Channel`) a gRPC channel with included credentials - # * (`GRPC::Core::ChannelCredentials`) a gRPC credentails object - # * (`nil`) indicating no credentials - # - # @note Warning: Passing a `String` to a keyfile path or a `Hash` of credentials - # is deprecated. Providing an unvalidated credential configuration to - # Google APIs can compromise the security of your systems and data. - # - # @example - # - # # The recommended way to provide credentials is to use the `make_creds` method - # # on the appropriate credentials class for your environment. - # - # require "googleauth" - # - # credentials = ::Google::Auth::ServiceAccountCredentials.make_creds( - # json_key_io: ::File.open("/path/to/keyfile.json") - # ) - # - # client = ::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::SaasDeployments::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 = "saasservicemgmt.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 SaasDeployments 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_saas` - # @return [::Gapic::Config::Method] - # - attr_reader :list_saas - ## - # RPC-specific configuration for `get_saas` - # @return [::Gapic::Config::Method] - # - attr_reader :get_saas - ## - # RPC-specific configuration for `create_saas` - # @return [::Gapic::Config::Method] - # - attr_reader :create_saas - ## - # RPC-specific configuration for `update_saas` - # @return [::Gapic::Config::Method] - # - attr_reader :update_saas - ## - # RPC-specific configuration for `delete_saas` - # @return [::Gapic::Config::Method] - # - attr_reader :delete_saas - ## - # RPC-specific configuration for `list_tenants` - # @return [::Gapic::Config::Method] - # - attr_reader :list_tenants - ## - # RPC-specific configuration for `get_tenant` - # @return [::Gapic::Config::Method] - # - attr_reader :get_tenant - ## - # RPC-specific configuration for `create_tenant` - # @return [::Gapic::Config::Method] - # - attr_reader :create_tenant - ## - # RPC-specific configuration for `update_tenant` - # @return [::Gapic::Config::Method] - # - attr_reader :update_tenant - ## - # RPC-specific configuration for `delete_tenant` - # @return [::Gapic::Config::Method] - # - attr_reader :delete_tenant - ## - # RPC-specific configuration for `list_unit_kinds` - # @return [::Gapic::Config::Method] - # - attr_reader :list_unit_kinds - ## - # RPC-specific configuration for `get_unit_kind` - # @return [::Gapic::Config::Method] - # - attr_reader :get_unit_kind - ## - # RPC-specific configuration for `create_unit_kind` - # @return [::Gapic::Config::Method] - # - attr_reader :create_unit_kind - ## - # RPC-specific configuration for `update_unit_kind` - # @return [::Gapic::Config::Method] - # - attr_reader :update_unit_kind - ## - # RPC-specific configuration for `delete_unit_kind` - # @return [::Gapic::Config::Method] - # - attr_reader :delete_unit_kind - ## - # RPC-specific configuration for `list_units` - # @return [::Gapic::Config::Method] - # - attr_reader :list_units - ## - # RPC-specific configuration for `get_unit` - # @return [::Gapic::Config::Method] - # - attr_reader :get_unit - ## - # RPC-specific configuration for `create_unit` - # @return [::Gapic::Config::Method] - # - attr_reader :create_unit - ## - # RPC-specific configuration for `update_unit` - # @return [::Gapic::Config::Method] - # - attr_reader :update_unit - ## - # RPC-specific configuration for `delete_unit` - # @return [::Gapic::Config::Method] - # - attr_reader :delete_unit - ## - # RPC-specific configuration for `list_unit_operations` - # @return [::Gapic::Config::Method] - # - attr_reader :list_unit_operations - ## - # RPC-specific configuration for `get_unit_operation` - # @return [::Gapic::Config::Method] - # - attr_reader :get_unit_operation - ## - # RPC-specific configuration for `create_unit_operation` - # @return [::Gapic::Config::Method] - # - attr_reader :create_unit_operation - ## - # RPC-specific configuration for `update_unit_operation` - # @return [::Gapic::Config::Method] - # - attr_reader :update_unit_operation - ## - # RPC-specific configuration for `delete_unit_operation` - # @return [::Gapic::Config::Method] - # - attr_reader :delete_unit_operation - ## - # RPC-specific configuration for `list_releases` - # @return [::Gapic::Config::Method] - # - attr_reader :list_releases - ## - # RPC-specific configuration for `get_release` - # @return [::Gapic::Config::Method] - # - attr_reader :get_release - ## - # RPC-specific configuration for `create_release` - # @return [::Gapic::Config::Method] - # - attr_reader :create_release - ## - # RPC-specific configuration for `update_release` - # @return [::Gapic::Config::Method] - # - attr_reader :update_release - ## - # RPC-specific configuration for `delete_release` - # @return [::Gapic::Config::Method] - # - attr_reader :delete_release - - # @private - def initialize parent_rpcs = nil - list_saas_config = parent_rpcs.list_saas if parent_rpcs.respond_to? :list_saas - @list_saas = ::Gapic::Config::Method.new list_saas_config - get_saas_config = parent_rpcs.get_saas if parent_rpcs.respond_to? :get_saas - @get_saas = ::Gapic::Config::Method.new get_saas_config - create_saas_config = parent_rpcs.create_saas if parent_rpcs.respond_to? :create_saas - @create_saas = ::Gapic::Config::Method.new create_saas_config - update_saas_config = parent_rpcs.update_saas if parent_rpcs.respond_to? :update_saas - @update_saas = ::Gapic::Config::Method.new update_saas_config - delete_saas_config = parent_rpcs.delete_saas if parent_rpcs.respond_to? :delete_saas - @delete_saas = ::Gapic::Config::Method.new delete_saas_config - list_tenants_config = parent_rpcs.list_tenants if parent_rpcs.respond_to? :list_tenants - @list_tenants = ::Gapic::Config::Method.new list_tenants_config - get_tenant_config = parent_rpcs.get_tenant if parent_rpcs.respond_to? :get_tenant - @get_tenant = ::Gapic::Config::Method.new get_tenant_config - create_tenant_config = parent_rpcs.create_tenant if parent_rpcs.respond_to? :create_tenant - @create_tenant = ::Gapic::Config::Method.new create_tenant_config - update_tenant_config = parent_rpcs.update_tenant if parent_rpcs.respond_to? :update_tenant - @update_tenant = ::Gapic::Config::Method.new update_tenant_config - delete_tenant_config = parent_rpcs.delete_tenant if parent_rpcs.respond_to? :delete_tenant - @delete_tenant = ::Gapic::Config::Method.new delete_tenant_config - list_unit_kinds_config = parent_rpcs.list_unit_kinds if parent_rpcs.respond_to? :list_unit_kinds - @list_unit_kinds = ::Gapic::Config::Method.new list_unit_kinds_config - get_unit_kind_config = parent_rpcs.get_unit_kind if parent_rpcs.respond_to? :get_unit_kind - @get_unit_kind = ::Gapic::Config::Method.new get_unit_kind_config - create_unit_kind_config = parent_rpcs.create_unit_kind if parent_rpcs.respond_to? :create_unit_kind - @create_unit_kind = ::Gapic::Config::Method.new create_unit_kind_config - update_unit_kind_config = parent_rpcs.update_unit_kind if parent_rpcs.respond_to? :update_unit_kind - @update_unit_kind = ::Gapic::Config::Method.new update_unit_kind_config - delete_unit_kind_config = parent_rpcs.delete_unit_kind if parent_rpcs.respond_to? :delete_unit_kind - @delete_unit_kind = ::Gapic::Config::Method.new delete_unit_kind_config - list_units_config = parent_rpcs.list_units if parent_rpcs.respond_to? :list_units - @list_units = ::Gapic::Config::Method.new list_units_config - get_unit_config = parent_rpcs.get_unit if parent_rpcs.respond_to? :get_unit - @get_unit = ::Gapic::Config::Method.new get_unit_config - create_unit_config = parent_rpcs.create_unit if parent_rpcs.respond_to? :create_unit - @create_unit = ::Gapic::Config::Method.new create_unit_config - update_unit_config = parent_rpcs.update_unit if parent_rpcs.respond_to? :update_unit - @update_unit = ::Gapic::Config::Method.new update_unit_config - delete_unit_config = parent_rpcs.delete_unit if parent_rpcs.respond_to? :delete_unit - @delete_unit = ::Gapic::Config::Method.new delete_unit_config - list_unit_operations_config = parent_rpcs.list_unit_operations if parent_rpcs.respond_to? :list_unit_operations - @list_unit_operations = ::Gapic::Config::Method.new list_unit_operations_config - get_unit_operation_config = parent_rpcs.get_unit_operation if parent_rpcs.respond_to? :get_unit_operation - @get_unit_operation = ::Gapic::Config::Method.new get_unit_operation_config - create_unit_operation_config = parent_rpcs.create_unit_operation if parent_rpcs.respond_to? :create_unit_operation - @create_unit_operation = ::Gapic::Config::Method.new create_unit_operation_config - update_unit_operation_config = parent_rpcs.update_unit_operation if parent_rpcs.respond_to? :update_unit_operation - @update_unit_operation = ::Gapic::Config::Method.new update_unit_operation_config - delete_unit_operation_config = parent_rpcs.delete_unit_operation if parent_rpcs.respond_to? :delete_unit_operation - @delete_unit_operation = ::Gapic::Config::Method.new delete_unit_operation_config - list_releases_config = parent_rpcs.list_releases if parent_rpcs.respond_to? :list_releases - @list_releases = ::Gapic::Config::Method.new list_releases_config - get_release_config = parent_rpcs.get_release if parent_rpcs.respond_to? :get_release - @get_release = ::Gapic::Config::Method.new get_release_config - create_release_config = parent_rpcs.create_release if parent_rpcs.respond_to? :create_release - @create_release = ::Gapic::Config::Method.new create_release_config - update_release_config = parent_rpcs.update_release if parent_rpcs.respond_to? :update_release - @update_release = ::Gapic::Config::Method.new update_release_config - delete_release_config = parent_rpcs.delete_release if parent_rpcs.respond_to? :delete_release - @delete_release = ::Gapic::Config::Method.new delete_release_config - - yield self if block_given? - end - end - end - end - end - end - end - end - end -end diff --git a/owl-bot-staging/google-cloud-saas_platform-saas_service_mgmt-v1beta1/lib/google/cloud/saas_platform/saas_service_mgmt/v1beta1/saas_deployments/credentials.rb b/owl-bot-staging/google-cloud-saas_platform-saas_service_mgmt-v1beta1/lib/google/cloud/saas_platform/saas_service_mgmt/v1beta1/saas_deployments/credentials.rb deleted file mode 100644 index 2d24511b8897..000000000000 --- a/owl-bot-staging/google-cloud-saas_platform-saas_service_mgmt-v1beta1/lib/google/cloud/saas_platform/saas_service_mgmt/v1beta1/saas_deployments/credentials.rb +++ /dev/null @@ -1,49 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -require "googleauth" - -module Google - module Cloud - module SaasPlatform - module SaasServiceMgmt - module V1beta1 - module SaasDeployments - # Credentials for the SaasDeployments API. - class Credentials < ::Google::Auth::Credentials - self.scope = [ - "https://www.googleapis.com/auth/cloud-platform" - ] - self.env_vars = [ - "GOOGLE_CLOUD_CREDENTIALS", - "GOOGLE_CLOUD_KEYFILE", - "GCLOUD_KEYFILE", - "GOOGLE_CLOUD_CREDENTIALS_JSON", - "GOOGLE_CLOUD_KEYFILE_JSON", - "GCLOUD_KEYFILE_JSON" - ] - self.paths = [ - "~/.config/google_cloud/application_default_credentials.json" - ] - end - end - end - end - end - end -end diff --git a/owl-bot-staging/google-cloud-saas_platform-saas_service_mgmt-v1beta1/lib/google/cloud/saas_platform/saas_service_mgmt/v1beta1/saas_deployments/paths.rb b/owl-bot-staging/google-cloud-saas_platform-saas_service_mgmt-v1beta1/lib/google/cloud/saas_platform/saas_service_mgmt/v1beta1/saas_deployments/paths.rb deleted file mode 100644 index 6d3457f8559d..000000000000 --- a/owl-bot-staging/google-cloud-saas_platform-saas_service_mgmt-v1beta1/lib/google/cloud/saas_platform/saas_service_mgmt/v1beta1/saas_deployments/paths.rb +++ /dev/null @@ -1,185 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - - -module Google - module Cloud - module SaasPlatform - module SaasServiceMgmt - module V1beta1 - module SaasDeployments - # Path helper methods for the SaasDeployments API. - module Paths - ## - # Create a fully-qualified Location resource string. - # - # The resource will be in the following format: - # - # `projects/{project}/locations/{location}` - # - # @param project [String] - # @param location [String] - # - # @return [::String] - def location_path project:, location: - raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" - - "projects/#{project}/locations/#{location}" - end - - ## - # Create a fully-qualified Release resource string. - # - # The resource will be in the following format: - # - # `projects/{project}/locations/{location}/releases/{release}` - # - # @param project [String] - # @param location [String] - # @param release [String] - # - # @return [::String] - def release_path project:, location:, release: - raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" - raise ::ArgumentError, "location cannot contain /" if location.to_s.include? "/" - - "projects/#{project}/locations/#{location}/releases/#{release}" - end - - ## - # Create a fully-qualified Rollout resource string. - # - # The resource will be in the following format: - # - # `projects/{project}/locations/{location}/rollouts/{rollout_id}` - # - # @param project [String] - # @param location [String] - # @param rollout_id [String] - # - # @return [::String] - def rollout_path project:, location:, rollout_id: - raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" - raise ::ArgumentError, "location cannot contain /" if location.to_s.include? "/" - - "projects/#{project}/locations/#{location}/rollouts/#{rollout_id}" - end - - ## - # Create a fully-qualified Saas resource string. - # - # The resource will be in the following format: - # - # `projects/{project}/locations/{location}/saas/{saas}` - # - # @param project [String] - # @param location [String] - # @param saas [String] - # - # @return [::String] - def saas_path project:, location:, saas: - raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" - raise ::ArgumentError, "location cannot contain /" if location.to_s.include? "/" - - "projects/#{project}/locations/#{location}/saas/#{saas}" - end - - ## - # Create a fully-qualified Tenant resource string. - # - # The resource will be in the following format: - # - # `projects/{project}/locations/{location}/tenants/{tenant}` - # - # @param project [String] - # @param location [String] - # @param tenant [String] - # - # @return [::String] - def tenant_path project:, location:, tenant: - raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" - raise ::ArgumentError, "location cannot contain /" if location.to_s.include? "/" - - "projects/#{project}/locations/#{location}/tenants/#{tenant}" - end - - ## - # Create a fully-qualified Unit resource string. - # - # The resource will be in the following format: - # - # `projects/{project}/locations/{location}/units/{unit}` - # - # @param project [String] - # @param location [String] - # @param unit [String] - # - # @return [::String] - def unit_path project:, location:, unit: - raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" - raise ::ArgumentError, "location cannot contain /" if location.to_s.include? "/" - - "projects/#{project}/locations/#{location}/units/#{unit}" - end - - ## - # Create a fully-qualified UnitKind resource string. - # - # The resource will be in the following format: - # - # `projects/{project}/locations/{location}/unitKinds/{unit_kind}` - # - # @param project [String] - # @param location [String] - # @param unit_kind [String] - # - # @return [::String] - def unit_kind_path project:, location:, unit_kind: - raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" - raise ::ArgumentError, "location cannot contain /" if location.to_s.include? "/" - - "projects/#{project}/locations/#{location}/unitKinds/#{unit_kind}" - end - - ## - # Create a fully-qualified UnitOperation resource string. - # - # The resource will be in the following format: - # - # `projects/{project}/locations/{location}/unitOperations/{unit_operation}` - # - # @param project [String] - # @param location [String] - # @param unit_operation [String] - # - # @return [::String] - def unit_operation_path project:, location:, unit_operation: - raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" - raise ::ArgumentError, "location cannot contain /" if location.to_s.include? "/" - - "projects/#{project}/locations/#{location}/unitOperations/#{unit_operation}" - end - - extend self - end - end - end - end - end - end -end diff --git a/owl-bot-staging/google-cloud-saas_platform-saas_service_mgmt-v1beta1/lib/google/cloud/saas_platform/saas_service_mgmt/v1beta1/saas_deployments/rest.rb b/owl-bot-staging/google-cloud-saas_platform-saas_service_mgmt-v1beta1/lib/google/cloud/saas_platform/saas_service_mgmt/v1beta1/saas_deployments/rest.rb deleted file mode 100644 index d312932d45ac..000000000000 --- a/owl-bot-staging/google-cloud-saas_platform-saas_service_mgmt-v1beta1/lib/google/cloud/saas_platform/saas_service_mgmt/v1beta1/saas_deployments/rest.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/rest" -require "gapic/config" -require "gapic/config/method" - -require "google/cloud/saas_platform/saas_service_mgmt/v1beta1/version" -require "google/cloud/saas_platform/saas_service_mgmt/v1beta1/bindings_override" - -require "google/cloud/saas_platform/saas_service_mgmt/v1beta1/saas_deployments/credentials" -require "google/cloud/saas_platform/saas_service_mgmt/v1beta1/saas_deployments/paths" -require "google/cloud/saas_platform/saas_service_mgmt/v1beta1/saas_deployments/rest/client" - -module Google - module Cloud - module SaasPlatform - module SaasServiceMgmt - module V1beta1 - ## - # Manages the deployment of SaaS services. - # - # To load this service and instantiate a REST client: - # - # require "google/cloud/saas_platform/saas_service_mgmt/v1beta1/saas_deployments/rest" - # client = ::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::SaasDeployments::Rest::Client.new - # - module SaasDeployments - # Client for the REST transport - module Rest - end - end - end - end - end - end -end - -helper_path = ::File.join __dir__, "rest", "helpers.rb" -require "google/cloud/saas_platform/saas_service_mgmt/v1beta1/saas_deployments/rest/helpers" if ::File.file? helper_path diff --git a/owl-bot-staging/google-cloud-saas_platform-saas_service_mgmt-v1beta1/lib/google/cloud/saas_platform/saas_service_mgmt/v1beta1/saas_deployments/rest/client.rb b/owl-bot-staging/google-cloud-saas_platform-saas_service_mgmt-v1beta1/lib/google/cloud/saas_platform/saas_service_mgmt/v1beta1/saas_deployments/rest/client.rb deleted file mode 100644 index 242da77bafad..000000000000 --- a/owl-bot-staging/google-cloud-saas_platform-saas_service_mgmt-v1beta1/lib/google/cloud/saas_platform/saas_service_mgmt/v1beta1/saas_deployments/rest/client.rb +++ /dev/null @@ -1,3557 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -require "google/cloud/errors" -require "google/cloud/saasplatform/saasservicemgmt/v1beta1/deployments_service_pb" -require "google/cloud/saas_platform/saas_service_mgmt/v1beta1/saas_deployments/rest/service_stub" -require "google/cloud/location/rest" - -module Google - module Cloud - module SaasPlatform - module SaasServiceMgmt - module V1beta1 - module SaasDeployments - module Rest - ## - # REST client for the SaasDeployments service. - # - # Manages the deployment of SaaS services. - # - class Client - # @private - API_VERSION = "" - - # @private - DEFAULT_ENDPOINT_TEMPLATE = "saasservicemgmt.$UNIVERSE_DOMAIN$" - - include Paths - - # @private - attr_reader :saas_deployments_stub - - ## - # Configure the SaasDeployments Client class. - # - # See {::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::SaasDeployments::Rest::Client::Configuration} - # for a description of the configuration fields. - # - # @example - # - # # Modify the configuration for all SaasDeployments clients - # ::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::SaasDeployments::Rest::Client.configure do |config| - # config.timeout = 10.0 - # end - # - # @yield [config] Configure the Client client. - # @yieldparam config [Client::Configuration] - # - # @return [Client::Configuration] - # - def self.configure - @configure ||= begin - namespace = ["Google", "Cloud", "SaasPlatform", "SaasServiceMgmt", "V1beta1"] - parent_config = while namespace.any? - parent_name = namespace.join "::" - parent_const = const_get parent_name - break parent_const.configure if parent_const.respond_to? :configure - namespace.pop - end - default_config = Client::Configuration.new parent_config - - default_config.rpcs.list_saas.timeout = 80.0 - default_config.rpcs.list_saas.retry_policy = { - initial_delay: 1.0, max_delay: 10.0, multiplier: 1.3, retry_codes: [14] - } - - default_config.rpcs.get_saas.timeout = 30.0 - default_config.rpcs.get_saas.retry_policy = { - initial_delay: 1.0, max_delay: 10.0, multiplier: 1.3, retry_codes: [14] - } - - default_config.rpcs.create_saas.timeout = 30.0 - - default_config.rpcs.update_saas.timeout = 30.0 - - default_config.rpcs.delete_saas.timeout = 30.0 - default_config.rpcs.delete_saas.retry_policy = { - initial_delay: 1.0, max_delay: 10.0, multiplier: 1.3, retry_codes: [14] - } - - default_config.rpcs.list_tenants.timeout = 80.0 - default_config.rpcs.list_tenants.retry_policy = { - initial_delay: 1.0, max_delay: 10.0, multiplier: 1.3, retry_codes: [14] - } - - default_config.rpcs.get_tenant.timeout = 30.0 - default_config.rpcs.get_tenant.retry_policy = { - initial_delay: 1.0, max_delay: 10.0, multiplier: 1.3, retry_codes: [14] - } - - default_config.rpcs.create_tenant.timeout = 30.0 - - default_config.rpcs.update_tenant.timeout = 30.0 - - default_config.rpcs.delete_tenant.timeout = 30.0 - default_config.rpcs.delete_tenant.retry_policy = { - initial_delay: 1.0, max_delay: 10.0, multiplier: 1.3, retry_codes: [14] - } - - default_config.rpcs.list_unit_kinds.timeout = 80.0 - default_config.rpcs.list_unit_kinds.retry_policy = { - initial_delay: 1.0, max_delay: 10.0, multiplier: 1.3, retry_codes: [14] - } - - default_config.rpcs.get_unit_kind.timeout = 30.0 - default_config.rpcs.get_unit_kind.retry_policy = { - initial_delay: 1.0, max_delay: 10.0, multiplier: 1.3, retry_codes: [14] - } - - default_config.rpcs.create_unit_kind.timeout = 30.0 - - default_config.rpcs.update_unit_kind.timeout = 80.0 - - default_config.rpcs.delete_unit_kind.timeout = 80.0 - default_config.rpcs.delete_unit_kind.retry_policy = { - initial_delay: 1.0, max_delay: 10.0, multiplier: 1.3, retry_codes: [14] - } - - default_config.rpcs.list_units.timeout = 80.0 - default_config.rpcs.list_units.retry_policy = { - initial_delay: 1.0, max_delay: 10.0, multiplier: 1.3, retry_codes: [14] - } - - default_config.rpcs.get_unit.timeout = 30.0 - default_config.rpcs.get_unit.retry_policy = { - initial_delay: 1.0, max_delay: 10.0, multiplier: 1.3, retry_codes: [14] - } - - default_config.rpcs.create_unit.timeout = 30.0 - - default_config.rpcs.update_unit.timeout = 30.0 - - default_config.rpcs.delete_unit.timeout = 30.0 - default_config.rpcs.delete_unit.retry_policy = { - initial_delay: 1.0, max_delay: 10.0, multiplier: 1.3, retry_codes: [14] - } - - default_config.rpcs.list_unit_operations.timeout = 80.0 - default_config.rpcs.list_unit_operations.retry_policy = { - initial_delay: 1.0, max_delay: 10.0, multiplier: 1.3, retry_codes: [14] - } - - default_config.rpcs.get_unit_operation.timeout = 30.0 - default_config.rpcs.get_unit_operation.retry_policy = { - initial_delay: 1.0, max_delay: 10.0, multiplier: 1.3, retry_codes: [14] - } - - default_config.rpcs.create_unit_operation.timeout = 30.0 - - default_config.rpcs.update_unit_operation.timeout = 30.0 - - default_config.rpcs.delete_unit_operation.timeout = 30.0 - default_config.rpcs.delete_unit_operation.retry_policy = { - initial_delay: 1.0, max_delay: 10.0, multiplier: 1.3, retry_codes: [14] - } - - default_config.rpcs.list_releases.timeout = 80.0 - default_config.rpcs.list_releases.retry_policy = { - initial_delay: 1.0, max_delay: 10.0, multiplier: 1.3, retry_codes: [14] - } - - default_config.rpcs.get_release.timeout = 30.0 - default_config.rpcs.get_release.retry_policy = { - initial_delay: 1.0, max_delay: 10.0, multiplier: 1.3, retry_codes: [14] - } - - default_config.rpcs.create_release.timeout = 30.0 - - default_config.rpcs.update_release.timeout = 30.0 - - default_config.rpcs.delete_release.timeout = 30.0 - default_config.rpcs.delete_release.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 SaasDeployments Client instance. - # - # The configuration is set to the derived mode, meaning that values can be changed, - # but structural changes (adding new fields, etc.) are not allowed. Structural changes - # should be made on {Client.configure}. - # - # See {::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::SaasDeployments::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 - @saas_deployments_stub.universe_domain - end - - ## - # Create a new SaasDeployments REST client object. - # - # @example - # - # # Create a client using the default configuration - # client = ::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::SaasDeployments::Rest::Client.new - # - # # Create a client using a custom configuration - # client = ::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::SaasDeployments::Rest::Client.new do |config| - # config.timeout = 10.0 - # end - # - # @yield [config] Configure the SaasDeployments 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 - - @saas_deployments_stub = ::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::SaasDeployments::Rest::ServiceStub.new( - endpoint: @config.endpoint, - endpoint_template: DEFAULT_ENDPOINT_TEMPLATE, - universe_domain: @config.universe_domain, - credentials: credentials, - logger: @config.logger - ) - - @saas_deployments_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 = @saas_deployments_stub.endpoint - config.universe_domain = @saas_deployments_stub.universe_domain - config.bindings_override = @config.bindings_override - config.logger = @saas_deployments_stub.logger if config.respond_to? :logger= - end - end - - ## - # Get the associated client for mix-in of the Locations. - # - # @return [Google::Cloud::Location::Locations::Rest::Client] - # - attr_reader :location_client - - ## - # The logger used for request/response debug logging. - # - # @return [Logger] - # - def logger - @saas_deployments_stub.logger - end - - # Service calls - - ## - # Retrieve a collection of saas. - # - # @overload list_saas(request, options = nil) - # Pass arguments to `list_saas` via a request object, either of type - # {::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::ListSaasRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::ListSaasRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_saas(parent: nil, page_size: nil, page_token: nil, filter: nil, order_by: nil) - # Pass arguments to `list_saas` via keyword arguments. Note that at - # least one keyword argument is 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 of the saas. - # @param page_size [::Integer] - # The maximum number of saas to send per page. - # @param page_token [::String] - # The page token: If the next_page_token from a previous response - # is provided, this request will send the subsequent page. - # @param filter [::String] - # Filter the list as specified in https://google.aip.dev/160. - # @param order_by [::String] - # Order results as specified in https://google.aip.dev/132. - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Gapic::Rest::PagedEnumerable<::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::Saas>] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Gapic::Rest::PagedEnumerable<::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::Saas>] - # - # @raise [::Google::Cloud::Error] if the REST call is aborted. - # - # @example Basic example - # require "google/cloud/saas_platform/saas_service_mgmt/v1beta1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::SaasDeployments::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::ListSaasRequest.new - # - # # Call the list_saas method. - # result = client.list_saas request - # - # # The returned object is of type Gapic::PagedEnumerable. You can iterate - # # over elements, and API calls will be issued to fetch pages as needed. - # result.each do |item| - # # Each element is of type ::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::Saas. - # p item - # end - # - def list_saas request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::ListSaasRequest - - # Converts hash 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_saas.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::SaasPlatform::SaasServiceMgmt::V1beta1::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_saas.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.list_saas.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @saas_deployments_stub.list_saas request, options do |result, operation| - result = ::Gapic::Rest::PagedEnumerable.new @saas_deployments_stub, :list_saas, "saas", 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 - - ## - # Retrieve a single saas. - # - # @overload get_saas(request, options = nil) - # Pass arguments to `get_saas` via a request object, either of type - # {::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::GetSaasRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::GetSaasRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_saas(name: nil) - # Pass arguments to `get_saas` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param name [::String] - # Required. The resource name of the resource within a service. - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::Saas] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::Saas] - # - # @raise [::Google::Cloud::Error] if the REST call is aborted. - # - # @example Basic example - # require "google/cloud/saas_platform/saas_service_mgmt/v1beta1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::SaasDeployments::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::GetSaasRequest.new - # - # # Call the get_saas method. - # result = client.get_saas request - # - # # The returned object is of type Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::Saas. - # p result - # - def get_saas request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::GetSaasRequest - - # Converts hash 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_saas.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::SaasPlatform::SaasServiceMgmt::V1beta1::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_saas.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.get_saas.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @saas_deployments_stub.get_saas 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 - - ## - # Create a new saas. - # - # @overload create_saas(request, options = nil) - # Pass arguments to `create_saas` via a request object, either of type - # {::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::CreateSaasRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::CreateSaasRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_saas(parent: nil, saas_id: nil, saas: nil, validate_only: nil, request_id: nil) - # Pass arguments to `create_saas` via keyword arguments. Note that at - # least one keyword argument is 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 of the saas. - # @param saas_id [::String] - # Required. The ID value for the new saas. - # @param saas [::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::Saas, ::Hash] - # Required. The desired state for the saas. - # @param validate_only [::Boolean] - # If "validate_only" is set to true, the service will try to validate - # that this request would succeed, but will not actually make changes. - # @param request_id [::String] - # An optional request ID to identify requests. Specify a unique request ID - # so that if you must retry your request, the server will know to ignore - # the request if it has already been completed. The server will guarantee - # that for at least 60 minutes since the first request. - # - # For example, consider a situation where you make an initial request and the - # request times out. If you make the request again with the same request - # ID, the server can check if original operation with the same request ID - # was received, and if so, will ignore the second request. This prevents - # clients from accidentally creating duplicate commitments. - # - # The request ID must be a valid UUID with the exception that zero UUID is - # not supported (00000000-0000-0000-0000-000000000000). - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::Saas] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::Saas] - # - # @raise [::Google::Cloud::Error] if the REST call is aborted. - # - # @example Basic example - # require "google/cloud/saas_platform/saas_service_mgmt/v1beta1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::SaasDeployments::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::CreateSaasRequest.new - # - # # Call the create_saas method. - # result = client.create_saas request - # - # # The returned object is of type Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::Saas. - # p result - # - def create_saas request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::CreateSaasRequest - - # Converts hash 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_saas.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::SaasPlatform::SaasServiceMgmt::V1beta1::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_saas.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.create_saas.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @saas_deployments_stub.create_saas 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 - - ## - # Update a single saas. - # - # @overload update_saas(request, options = nil) - # Pass arguments to `update_saas` via a request object, either of type - # {::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::UpdateSaasRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::UpdateSaasRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_saas(saas: nil, validate_only: nil, request_id: nil, update_mask: nil) - # Pass arguments to `update_saas` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param saas [::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::Saas, ::Hash] - # Required. The desired state for the saas. - # @param validate_only [::Boolean] - # If "validate_only" is set to true, the service will try to validate - # that this request would succeed, but will not actually make changes. - # @param request_id [::String] - # An optional request ID to identify requests. Specify a unique request ID - # so that if you must retry your request, the server will know to ignore - # the request if it has already been completed. The server will guarantee - # that for at least 60 minutes since the first request. - # - # For example, consider a situation where you make an initial request and the - # request times out. If you make the request again with the same request - # ID, the server can check if original operation with the same request ID - # was received, and if so, will ignore the second request. This prevents - # clients from accidentally creating duplicate commitments. - # - # The request ID must be a valid UUID with the exception that zero UUID is - # not supported (00000000-0000-0000-0000-000000000000). - # @param update_mask [::Google::Protobuf::FieldMask, ::Hash] - # Field mask is used to specify the fields to be overwritten in the - # Saas resource by the update. - # - # The fields specified in the update_mask are relative to the resource, not - # the full request. A field will be overwritten if it is in the mask. - # - # If the user does not provide a mask then all fields in the - # Saas will be overwritten. - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::Saas] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::Saas] - # - # @raise [::Google::Cloud::Error] if the REST call is aborted. - # - # @example Basic example - # require "google/cloud/saas_platform/saas_service_mgmt/v1beta1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::SaasDeployments::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::UpdateSaasRequest.new - # - # # Call the update_saas method. - # result = client.update_saas request - # - # # The returned object is of type Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::Saas. - # p result - # - def update_saas request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::UpdateSaasRequest - - # Converts hash 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_saas.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::SaasPlatform::SaasServiceMgmt::V1beta1::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_saas.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.update_saas.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @saas_deployments_stub.update_saas 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 - - ## - # Delete a single saas. - # - # @overload delete_saas(request, options = nil) - # Pass arguments to `delete_saas` via a request object, either of type - # {::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::DeleteSaasRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::DeleteSaasRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_saas(name: nil, etag: nil, validate_only: nil, request_id: nil) - # Pass arguments to `delete_saas` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param name [::String] - # Required. The resource name of the resource within a service. - # @param etag [::String] - # The etag known to the client for the expected state of the saas. This is - # used with state-changing methods to prevent accidental overwrites when - # multiple user agents might be acting in parallel on the same resource. - # - # An etag wildcard provide optimistic concurrency based on the expected - # existence of the saas. The Any wildcard (`*`) requires that the resource - # must already exists, and the Not Any wildcard (`!*`) requires that it must - # not. - # @param validate_only [::Boolean] - # If "validate_only" is set to true, the service will try to validate - # that this request would succeed, but will not actually make changes. - # @param request_id [::String] - # An optional request ID to identify requests. Specify a unique request ID - # so that if you must retry your request, the server will know to ignore - # the request if it has already been completed. The server will guarantee - # that for at least 60 minutes since the first request. - # - # For example, consider a situation where you make an initial request and the - # request times out. If you make the request again with the same request - # ID, the server can check if original operation with the same request ID - # was received, and if so, will ignore the second request. This prevents - # clients from accidentally creating duplicate commitments. - # - # The request ID must be a valid UUID with the exception that zero UUID is - # not supported (00000000-0000-0000-0000-000000000000). - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Protobuf::Empty] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Protobuf::Empty] - # - # @raise [::Google::Cloud::Error] if the REST call is aborted. - # - # @example Basic example - # require "google/cloud/saas_platform/saas_service_mgmt/v1beta1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::SaasDeployments::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::DeleteSaasRequest.new - # - # # Call the delete_saas method. - # result = client.delete_saas request - # - # # The returned object is of type Google::Protobuf::Empty. - # p result - # - def delete_saas request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::DeleteSaasRequest - - # Converts hash 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_saas.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::SaasPlatform::SaasServiceMgmt::V1beta1::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_saas.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.delete_saas.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @saas_deployments_stub.delete_saas 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 - - ## - # Retrieve a collection of tenants. - # - # @overload list_tenants(request, options = nil) - # Pass arguments to `list_tenants` via a request object, either of type - # {::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::ListTenantsRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::ListTenantsRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_tenants(parent: nil, page_size: nil, page_token: nil, filter: nil, order_by: nil) - # Pass arguments to `list_tenants` via keyword arguments. Note that at - # least one keyword argument is 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 of the tenant. - # @param page_size [::Integer] - # The maximum number of tenants to send per page. - # @param page_token [::String] - # The page token: If the next_page_token from a previous response - # is provided, this request will send the subsequent page. - # @param filter [::String] - # Filter the list as specified in https://google.aip.dev/160. - # @param order_by [::String] - # Order results as specified in https://google.aip.dev/132. - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Gapic::Rest::PagedEnumerable<::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::Tenant>] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Gapic::Rest::PagedEnumerable<::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::Tenant>] - # - # @raise [::Google::Cloud::Error] if the REST call is aborted. - # - # @example Basic example - # require "google/cloud/saas_platform/saas_service_mgmt/v1beta1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::SaasDeployments::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::ListTenantsRequest.new - # - # # Call the list_tenants method. - # result = client.list_tenants request - # - # # The returned object is of type Gapic::PagedEnumerable. You can iterate - # # over elements, and API calls will be issued to fetch pages as needed. - # result.each do |item| - # # Each element is of type ::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::Tenant. - # p item - # end - # - def list_tenants request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::ListTenantsRequest - - # Converts hash 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_tenants.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::SaasPlatform::SaasServiceMgmt::V1beta1::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_tenants.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.list_tenants.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @saas_deployments_stub.list_tenants request, options do |result, operation| - result = ::Gapic::Rest::PagedEnumerable.new @saas_deployments_stub, :list_tenants, "tenants", 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 - - ## - # Retrieve a single tenant. - # - # @overload get_tenant(request, options = nil) - # Pass arguments to `get_tenant` via a request object, either of type - # {::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::GetTenantRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::GetTenantRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_tenant(name: nil) - # Pass arguments to `get_tenant` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param name [::String] - # Required. The resource name of the resource within a service. - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::Tenant] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::Tenant] - # - # @raise [::Google::Cloud::Error] if the REST call is aborted. - # - # @example Basic example - # require "google/cloud/saas_platform/saas_service_mgmt/v1beta1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::SaasDeployments::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::GetTenantRequest.new - # - # # Call the get_tenant method. - # result = client.get_tenant request - # - # # The returned object is of type Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::Tenant. - # p result - # - def get_tenant request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::GetTenantRequest - - # Converts hash 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_tenant.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::SaasPlatform::SaasServiceMgmt::V1beta1::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_tenant.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.get_tenant.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @saas_deployments_stub.get_tenant 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 - - ## - # Create a new tenant. - # - # @overload create_tenant(request, options = nil) - # Pass arguments to `create_tenant` via a request object, either of type - # {::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::CreateTenantRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::CreateTenantRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_tenant(parent: nil, tenant_id: nil, tenant: nil, validate_only: nil, request_id: nil) - # Pass arguments to `create_tenant` via keyword arguments. Note that at - # least one keyword argument is 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 of the tenant. - # @param tenant_id [::String] - # Required. The ID value for the new tenant. - # @param tenant [::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::Tenant, ::Hash] - # Required. The desired state for the tenant. - # @param validate_only [::Boolean] - # If "validate_only" is set to true, the service will try to validate - # that this request would succeed, but will not actually make changes. - # @param request_id [::String] - # An optional request ID to identify requests. Specify a unique request ID - # so that if you must retry your request, the server will know to ignore - # the request if it has already been completed. The server will guarantee - # that for at least 60 minutes since the first request. - # - # For example, consider a situation where you make an initial request and the - # request times out. If you make the request again with the same request - # ID, the server can check if original operation with the same request ID - # was received, and if so, will ignore the second request. This prevents - # clients from accidentally creating duplicate commitments. - # - # The request ID must be a valid UUID with the exception that zero UUID is - # not supported (00000000-0000-0000-0000-000000000000). - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::Tenant] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::Tenant] - # - # @raise [::Google::Cloud::Error] if the REST call is aborted. - # - # @example Basic example - # require "google/cloud/saas_platform/saas_service_mgmt/v1beta1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::SaasDeployments::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::CreateTenantRequest.new - # - # # Call the create_tenant method. - # result = client.create_tenant request - # - # # The returned object is of type Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::Tenant. - # p result - # - def create_tenant request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::CreateTenantRequest - - # Converts hash 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_tenant.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::SaasPlatform::SaasServiceMgmt::V1beta1::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_tenant.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.create_tenant.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @saas_deployments_stub.create_tenant 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 - - ## - # Update a single tenant. - # - # @overload update_tenant(request, options = nil) - # Pass arguments to `update_tenant` via a request object, either of type - # {::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::UpdateTenantRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::UpdateTenantRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_tenant(tenant: nil, validate_only: nil, request_id: nil, update_mask: nil) - # Pass arguments to `update_tenant` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param tenant [::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::Tenant, ::Hash] - # Required. The desired state for the tenant. - # @param validate_only [::Boolean] - # If "validate_only" is set to true, the service will try to validate - # that this request would succeed, but will not actually make changes. - # @param request_id [::String] - # An optional request ID to identify requests. Specify a unique request ID - # so that if you must retry your request, the server will know to ignore - # the request if it has already been completed. The server will guarantee - # that for at least 60 minutes since the first request. - # - # For example, consider a situation where you make an initial request and the - # request times out. If you make the request again with the same request - # ID, the server can check if original operation with the same request ID - # was received, and if so, will ignore the second request. This prevents - # clients from accidentally creating duplicate commitments. - # - # The request ID must be a valid UUID with the exception that zero UUID is - # not supported (00000000-0000-0000-0000-000000000000). - # @param update_mask [::Google::Protobuf::FieldMask, ::Hash] - # Field mask is used to specify the fields to be overwritten in the - # Tenant resource by the update. - # - # The fields specified in the update_mask are relative to the resource, not - # the full request. A field will be overwritten if it is in the mask. - # - # If the user does not provide a mask then all fields in the - # Tenant will be overwritten. - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::Tenant] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::Tenant] - # - # @raise [::Google::Cloud::Error] if the REST call is aborted. - # - # @example Basic example - # require "google/cloud/saas_platform/saas_service_mgmt/v1beta1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::SaasDeployments::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::UpdateTenantRequest.new - # - # # Call the update_tenant method. - # result = client.update_tenant request - # - # # The returned object is of type Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::Tenant. - # p result - # - def update_tenant request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::UpdateTenantRequest - - # Converts hash 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_tenant.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::SaasPlatform::SaasServiceMgmt::V1beta1::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_tenant.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.update_tenant.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @saas_deployments_stub.update_tenant 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 - - ## - # Delete a single tenant. - # - # @overload delete_tenant(request, options = nil) - # Pass arguments to `delete_tenant` via a request object, either of type - # {::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::DeleteTenantRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::DeleteTenantRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_tenant(name: nil, etag: nil, validate_only: nil, request_id: nil) - # Pass arguments to `delete_tenant` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param name [::String] - # Required. The resource name of the resource within a service. - # @param etag [::String] - # The etag known to the client for the expected state of the tenant. This is - # used with state-changing methods to prevent accidental overwrites when - # multiple user agents might be acting in parallel on the same resource. - # - # An etag wildcard provide optimistic concurrency based on the expected - # existence of the tenant. The Any wildcard (`*`) requires that the resource - # must already exists, and the Not Any wildcard (`!*`) requires that it must - # not. - # @param validate_only [::Boolean] - # If "validate_only" is set to true, the service will try to validate - # that this request would succeed, but will not actually make changes. - # @param request_id [::String] - # An optional request ID to identify requests. Specify a unique request ID - # so that if you must retry your request, the server will know to ignore - # the request if it has already been completed. The server will guarantee - # that for at least 60 minutes since the first request. - # - # For example, consider a situation where you make an initial request and the - # request times out. If you make the request again with the same request - # ID, the server can check if original operation with the same request ID - # was received, and if so, will ignore the second request. This prevents - # clients from accidentally creating duplicate commitments. - # - # The request ID must be a valid UUID with the exception that zero UUID is - # not supported (00000000-0000-0000-0000-000000000000). - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Protobuf::Empty] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Protobuf::Empty] - # - # @raise [::Google::Cloud::Error] if the REST call is aborted. - # - # @example Basic example - # require "google/cloud/saas_platform/saas_service_mgmt/v1beta1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::SaasDeployments::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::DeleteTenantRequest.new - # - # # Call the delete_tenant method. - # result = client.delete_tenant request - # - # # The returned object is of type Google::Protobuf::Empty. - # p result - # - def delete_tenant request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::DeleteTenantRequest - - # Converts hash 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_tenant.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::SaasPlatform::SaasServiceMgmt::V1beta1::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_tenant.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.delete_tenant.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @saas_deployments_stub.delete_tenant 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 - - ## - # Retrieve a collection of unit kinds. - # - # @overload list_unit_kinds(request, options = nil) - # Pass arguments to `list_unit_kinds` via a request object, either of type - # {::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::ListUnitKindsRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::ListUnitKindsRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_unit_kinds(parent: nil, page_size: nil, page_token: nil, filter: nil, order_by: nil) - # Pass arguments to `list_unit_kinds` via keyword arguments. Note that at - # least one keyword argument is 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 of the unit kind. - # @param page_size [::Integer] - # The maximum number of unit kinds to send per page. - # @param page_token [::String] - # The page token: If the next_page_token from a previous response - # is provided, this request will send the subsequent page. - # @param filter [::String] - # Filter the list as specified in https://google.aip.dev/160. - # @param order_by [::String] - # Order results as specified in https://google.aip.dev/132. - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Gapic::Rest::PagedEnumerable<::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::UnitKind>] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Gapic::Rest::PagedEnumerable<::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::UnitKind>] - # - # @raise [::Google::Cloud::Error] if the REST call is aborted. - # - # @example Basic example - # require "google/cloud/saas_platform/saas_service_mgmt/v1beta1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::SaasDeployments::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::ListUnitKindsRequest.new - # - # # Call the list_unit_kinds method. - # result = client.list_unit_kinds request - # - # # The returned object is of type Gapic::PagedEnumerable. You can iterate - # # over elements, and API calls will be issued to fetch pages as needed. - # result.each do |item| - # # Each element is of type ::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::UnitKind. - # p item - # end - # - def list_unit_kinds request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::ListUnitKindsRequest - - # Converts hash 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_unit_kinds.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::SaasPlatform::SaasServiceMgmt::V1beta1::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_unit_kinds.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.list_unit_kinds.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @saas_deployments_stub.list_unit_kinds request, options do |result, operation| - result = ::Gapic::Rest::PagedEnumerable.new @saas_deployments_stub, :list_unit_kinds, "unit_kinds", 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 - - ## - # Retrieve a single unit kind. - # - # @overload get_unit_kind(request, options = nil) - # Pass arguments to `get_unit_kind` via a request object, either of type - # {::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::GetUnitKindRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::GetUnitKindRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_unit_kind(name: nil) - # Pass arguments to `get_unit_kind` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param name [::String] - # Required. The resource name of the resource within a service. - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::UnitKind] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::UnitKind] - # - # @raise [::Google::Cloud::Error] if the REST call is aborted. - # - # @example Basic example - # require "google/cloud/saas_platform/saas_service_mgmt/v1beta1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::SaasDeployments::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::GetUnitKindRequest.new - # - # # Call the get_unit_kind method. - # result = client.get_unit_kind request - # - # # The returned object is of type Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::UnitKind. - # p result - # - def get_unit_kind request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::GetUnitKindRequest - - # Converts hash 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_unit_kind.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::SaasPlatform::SaasServiceMgmt::V1beta1::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_unit_kind.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.get_unit_kind.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @saas_deployments_stub.get_unit_kind 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 - - ## - # Create a new unit kind. - # - # @overload create_unit_kind(request, options = nil) - # Pass arguments to `create_unit_kind` via a request object, either of type - # {::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::CreateUnitKindRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::CreateUnitKindRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_unit_kind(parent: nil, unit_kind_id: nil, unit_kind: nil, validate_only: nil, request_id: nil) - # Pass arguments to `create_unit_kind` via keyword arguments. Note that at - # least one keyword argument is 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 of the unit kind. - # @param unit_kind_id [::String] - # Required. The ID value for the new unit kind. - # @param unit_kind [::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::UnitKind, ::Hash] - # Required. The desired state for the unit kind. - # @param validate_only [::Boolean] - # If "validate_only" is set to true, the service will try to validate - # that this request would succeed, but will not actually make changes. - # @param request_id [::String] - # An optional request ID to identify requests. Specify a unique request ID - # so that if you must retry your request, the server will know to ignore - # the request if it has already been completed. The server will guarantee - # that for at least 60 minutes since the first request. - # - # For example, consider a situation where you make an initial request and the - # request times out. If you make the request again with the same request - # ID, the server can check if original operation with the same request ID - # was received, and if so, will ignore the second request. This prevents - # clients from accidentally creating duplicate commitments. - # - # The request ID must be a valid UUID with the exception that zero UUID is - # not supported (00000000-0000-0000-0000-000000000000). - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::UnitKind] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::UnitKind] - # - # @raise [::Google::Cloud::Error] if the REST call is aborted. - # - # @example Basic example - # require "google/cloud/saas_platform/saas_service_mgmt/v1beta1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::SaasDeployments::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::CreateUnitKindRequest.new - # - # # Call the create_unit_kind method. - # result = client.create_unit_kind request - # - # # The returned object is of type Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::UnitKind. - # p result - # - def create_unit_kind request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::CreateUnitKindRequest - - # Converts hash 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_unit_kind.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::SaasPlatform::SaasServiceMgmt::V1beta1::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_unit_kind.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.create_unit_kind.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @saas_deployments_stub.create_unit_kind 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 - - ## - # Update a single unit kind. - # - # @overload update_unit_kind(request, options = nil) - # Pass arguments to `update_unit_kind` via a request object, either of type - # {::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::UpdateUnitKindRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::UpdateUnitKindRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_unit_kind(unit_kind: nil, validate_only: nil, request_id: nil, update_mask: nil) - # Pass arguments to `update_unit_kind` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param unit_kind [::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::UnitKind, ::Hash] - # Required. The desired state for the unit kind. - # @param validate_only [::Boolean] - # If "validate_only" is set to true, the service will try to validate - # that this request would succeed, but will not actually make changes. - # @param request_id [::String] - # An optional request ID to identify requests. Specify a unique request ID - # so that if you must retry your request, the server will know to ignore - # the request if it has already been completed. The server will guarantee - # that for at least 60 minutes since the first request. - # - # For example, consider a situation where you make an initial request and the - # request times out. If you make the request again with the same request - # ID, the server can check if original operation with the same request ID - # was received, and if so, will ignore the second request. This prevents - # clients from accidentally creating duplicate commitments. - # - # The request ID must be a valid UUID with the exception that zero UUID is - # not supported (00000000-0000-0000-0000-000000000000). - # @param update_mask [::Google::Protobuf::FieldMask, ::Hash] - # Field mask is used to specify the fields to be overwritten in the - # UnitKind resource by the update. - # - # The fields specified in the update_mask are relative to the resource, not - # the full request. A field will be overwritten if it is in the mask. - # - # If the user does not provide a mask then all fields in the - # UnitKind will be overwritten. - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::UnitKind] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::UnitKind] - # - # @raise [::Google::Cloud::Error] if the REST call is aborted. - # - # @example Basic example - # require "google/cloud/saas_platform/saas_service_mgmt/v1beta1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::SaasDeployments::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::UpdateUnitKindRequest.new - # - # # Call the update_unit_kind method. - # result = client.update_unit_kind request - # - # # The returned object is of type Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::UnitKind. - # p result - # - def update_unit_kind request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::UpdateUnitKindRequest - - # Converts hash 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_unit_kind.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::SaasPlatform::SaasServiceMgmt::V1beta1::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_unit_kind.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.update_unit_kind.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @saas_deployments_stub.update_unit_kind 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 - - ## - # Delete a single unit kind. - # - # @overload delete_unit_kind(request, options = nil) - # Pass arguments to `delete_unit_kind` via a request object, either of type - # {::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::DeleteUnitKindRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::DeleteUnitKindRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_unit_kind(name: nil, etag: nil, validate_only: nil, request_id: nil) - # Pass arguments to `delete_unit_kind` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param name [::String] - # Required. The resource name of the resource within a service. - # @param etag [::String] - # The etag known to the client for the expected state of the unit kind. This - # is used with state-changing methods to prevent accidental overwrites when - # multiple user agents might be acting in parallel on the same resource. - # - # An etag wildcard provide optimistic concurrency based on the expected - # existence of the unit kind. The Any wildcard (`*`) requires that the - # resource must already exists, and the Not Any wildcard (`!*`) requires that - # it must not. - # @param validate_only [::Boolean] - # If "validate_only" is set to true, the service will try to validate - # that this request would succeed, but will not actually make changes. - # @param request_id [::String] - # An optional request ID to identify requests. Specify a unique request ID - # so that if you must retry your request, the server will know to ignore - # the request if it has already been completed. The server will guarantee - # that for at least 60 minutes since the first request. - # - # For example, consider a situation where you make an initial request and the - # request times out. If you make the request again with the same request - # ID, the server can check if original operation with the same request ID - # was received, and if so, will ignore the second request. This prevents - # clients from accidentally creating duplicate commitments. - # - # The request ID must be a valid UUID with the exception that zero UUID is - # not supported (00000000-0000-0000-0000-000000000000). - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Protobuf::Empty] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Protobuf::Empty] - # - # @raise [::Google::Cloud::Error] if the REST call is aborted. - # - # @example Basic example - # require "google/cloud/saas_platform/saas_service_mgmt/v1beta1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::SaasDeployments::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::DeleteUnitKindRequest.new - # - # # Call the delete_unit_kind method. - # result = client.delete_unit_kind request - # - # # The returned object is of type Google::Protobuf::Empty. - # p result - # - def delete_unit_kind request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::DeleteUnitKindRequest - - # Converts hash 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_unit_kind.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::SaasPlatform::SaasServiceMgmt::V1beta1::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_unit_kind.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.delete_unit_kind.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @saas_deployments_stub.delete_unit_kind 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 - - ## - # Retrieve a collection of units. - # - # @overload list_units(request, options = nil) - # Pass arguments to `list_units` via a request object, either of type - # {::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::ListUnitsRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::ListUnitsRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_units(parent: nil, page_size: nil, page_token: nil, filter: nil, order_by: nil) - # Pass arguments to `list_units` via keyword arguments. Note that at - # least one keyword argument is 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 of the unit. - # @param page_size [::Integer] - # The maximum number of units to send per page. - # @param page_token [::String] - # The page token: If the next_page_token from a previous response - # is provided, this request will send the subsequent page. - # @param filter [::String] - # Filter the list as specified in https://google.aip.dev/160. - # @param order_by [::String] - # Order results as specified in https://google.aip.dev/132. - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Gapic::Rest::PagedEnumerable<::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::Unit>] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Gapic::Rest::PagedEnumerable<::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::Unit>] - # - # @raise [::Google::Cloud::Error] if the REST call is aborted. - # - # @example Basic example - # require "google/cloud/saas_platform/saas_service_mgmt/v1beta1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::SaasDeployments::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::ListUnitsRequest.new - # - # # Call the list_units method. - # result = client.list_units request - # - # # The returned object is of type Gapic::PagedEnumerable. You can iterate - # # over elements, and API calls will be issued to fetch pages as needed. - # result.each do |item| - # # Each element is of type ::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::Unit. - # p item - # end - # - def list_units request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::ListUnitsRequest - - # Converts hash 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_units.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::SaasPlatform::SaasServiceMgmt::V1beta1::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_units.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.list_units.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @saas_deployments_stub.list_units request, options do |result, operation| - result = ::Gapic::Rest::PagedEnumerable.new @saas_deployments_stub, :list_units, "units", 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 - - ## - # Retrieve a single unit. - # - # @overload get_unit(request, options = nil) - # Pass arguments to `get_unit` via a request object, either of type - # {::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::GetUnitRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::GetUnitRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_unit(name: nil) - # Pass arguments to `get_unit` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param name [::String] - # Required. The resource name of the resource within a service. - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::Unit] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::Unit] - # - # @raise [::Google::Cloud::Error] if the REST call is aborted. - # - # @example Basic example - # require "google/cloud/saas_platform/saas_service_mgmt/v1beta1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::SaasDeployments::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::GetUnitRequest.new - # - # # Call the get_unit method. - # result = client.get_unit request - # - # # The returned object is of type Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::Unit. - # p result - # - def get_unit request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::GetUnitRequest - - # Converts hash 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_unit.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::SaasPlatform::SaasServiceMgmt::V1beta1::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_unit.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.get_unit.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @saas_deployments_stub.get_unit 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 - - ## - # Create a new unit. - # - # @overload create_unit(request, options = nil) - # Pass arguments to `create_unit` via a request object, either of type - # {::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::CreateUnitRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::CreateUnitRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_unit(parent: nil, unit_id: nil, unit: nil, validate_only: nil, request_id: nil) - # Pass arguments to `create_unit` via keyword arguments. Note that at - # least one keyword argument is 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 of the unit. - # @param unit_id [::String] - # Required. The ID value for the new unit. - # @param unit [::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::Unit, ::Hash] - # Required. The desired state for the unit. - # @param validate_only [::Boolean] - # If "validate_only" is set to true, the service will try to validate - # that this request would succeed, but will not actually make changes. - # @param request_id [::String] - # An optional request ID to identify requests. Specify a unique request ID - # so that if you must retry your request, the server will know to ignore - # the request if it has already been completed. The server will guarantee - # that for at least 60 minutes since the first request. - # - # For example, consider a situation where you make an initial request and the - # request times out. If you make the request again with the same request - # ID, the server can check if original operation with the same request ID - # was received, and if so, will ignore the second request. This prevents - # clients from accidentally creating duplicate commitments. - # - # The request ID must be a valid UUID with the exception that zero UUID is - # not supported (00000000-0000-0000-0000-000000000000). - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::Unit] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::Unit] - # - # @raise [::Google::Cloud::Error] if the REST call is aborted. - # - # @example Basic example - # require "google/cloud/saas_platform/saas_service_mgmt/v1beta1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::SaasDeployments::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::CreateUnitRequest.new - # - # # Call the create_unit method. - # result = client.create_unit request - # - # # The returned object is of type Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::Unit. - # p result - # - def create_unit request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::CreateUnitRequest - - # Converts hash 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_unit.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::SaasPlatform::SaasServiceMgmt::V1beta1::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_unit.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.create_unit.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @saas_deployments_stub.create_unit 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 - - ## - # Update a single unit. - # - # @overload update_unit(request, options = nil) - # Pass arguments to `update_unit` via a request object, either of type - # {::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::UpdateUnitRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::UpdateUnitRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_unit(unit: nil, validate_only: nil, request_id: nil, update_mask: nil) - # Pass arguments to `update_unit` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param unit [::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::Unit, ::Hash] - # Required. The desired state for the unit. - # @param validate_only [::Boolean] - # If "validate_only" is set to true, the service will try to validate - # that this request would succeed, but will not actually make changes. - # @param request_id [::String] - # An optional request ID to identify requests. Specify a unique request ID - # so that if you must retry your request, the server will know to ignore - # the request if it has already been completed. The server will guarantee - # that for at least 60 minutes since the first request. - # - # For example, consider a situation where you make an initial request and the - # request times out. If you make the request again with the same request - # ID, the server can check if original operation with the same request ID - # was received, and if so, will ignore the second request. This prevents - # clients from accidentally creating duplicate commitments. - # - # The request ID must be a valid UUID with the exception that zero UUID is - # not supported (00000000-0000-0000-0000-000000000000). - # @param update_mask [::Google::Protobuf::FieldMask, ::Hash] - # Field mask is used to specify the fields to be overwritten in the - # Unit resource by the update. - # - # The fields specified in the update_mask are relative to the resource, not - # the full request. A field will be overwritten if it is in the mask. - # - # If the user does not provide a mask then all fields in the - # Unit will be overwritten. - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::Unit] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::Unit] - # - # @raise [::Google::Cloud::Error] if the REST call is aborted. - # - # @example Basic example - # require "google/cloud/saas_platform/saas_service_mgmt/v1beta1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::SaasDeployments::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::UpdateUnitRequest.new - # - # # Call the update_unit method. - # result = client.update_unit request - # - # # The returned object is of type Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::Unit. - # p result - # - def update_unit request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::UpdateUnitRequest - - # Converts hash 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_unit.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::SaasPlatform::SaasServiceMgmt::V1beta1::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_unit.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.update_unit.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @saas_deployments_stub.update_unit 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 - - ## - # Delete a single unit. - # - # @overload delete_unit(request, options = nil) - # Pass arguments to `delete_unit` via a request object, either of type - # {::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::DeleteUnitRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::DeleteUnitRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_unit(name: nil, etag: nil, validate_only: nil, request_id: nil) - # Pass arguments to `delete_unit` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param name [::String] - # Required. The resource name of the resource within a service. - # @param etag [::String] - # The etag known to the client for the expected state of the unit. This is - # used with state-changing methods to prevent accidental overwrites when - # multiple user agents might be acting in parallel on the same resource. - # - # An etag wildcard provide optimistic concurrency based on the expected - # existence of the unit. The Any wildcard (`*`) requires that the resource - # must already exists, and the Not Any wildcard (`!*`) requires that it must - # not. - # @param validate_only [::Boolean] - # If "validate_only" is set to true, the service will try to validate - # that this request would succeed, but will not actually make changes. - # @param request_id [::String] - # An optional request ID to identify requests. Specify a unique request ID - # so that if you must retry your request, the server will know to ignore - # the request if it has already been completed. The server will guarantee - # that for at least 60 minutes since the first request. - # - # For example, consider a situation where you make an initial request and the - # request times out. If you make the request again with the same request - # ID, the server can check if original operation with the same request ID - # was received, and if so, will ignore the second request. This prevents - # clients from accidentally creating duplicate commitments. - # - # The request ID must be a valid UUID with the exception that zero UUID is - # not supported (00000000-0000-0000-0000-000000000000). - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Protobuf::Empty] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Protobuf::Empty] - # - # @raise [::Google::Cloud::Error] if the REST call is aborted. - # - # @example Basic example - # require "google/cloud/saas_platform/saas_service_mgmt/v1beta1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::SaasDeployments::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::DeleteUnitRequest.new - # - # # Call the delete_unit method. - # result = client.delete_unit request - # - # # The returned object is of type Google::Protobuf::Empty. - # p result - # - def delete_unit request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::DeleteUnitRequest - - # Converts hash 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_unit.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::SaasPlatform::SaasServiceMgmt::V1beta1::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_unit.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.delete_unit.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @saas_deployments_stub.delete_unit 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 - - ## - # Retrieve a collection of unit operations. - # - # @overload list_unit_operations(request, options = nil) - # Pass arguments to `list_unit_operations` via a request object, either of type - # {::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::ListUnitOperationsRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::ListUnitOperationsRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_unit_operations(parent: nil, page_size: nil, page_token: nil, filter: nil, order_by: nil) - # Pass arguments to `list_unit_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 parent [::String] - # Required. The parent of the unit operation. - # @param page_size [::Integer] - # The maximum number of unit operations to send per page. - # @param page_token [::String] - # The page token: If the next_page_token from a previous response - # is provided, this request will send the subsequent page. - # @param filter [::String] - # Filter the list as specified in https://google.aip.dev/160. - # @param order_by [::String] - # Order results as specified in https://google.aip.dev/132. - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Gapic::Rest::PagedEnumerable<::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::UnitOperation>] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Gapic::Rest::PagedEnumerable<::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::UnitOperation>] - # - # @raise [::Google::Cloud::Error] if the REST call is aborted. - # - # @example Basic example - # require "google/cloud/saas_platform/saas_service_mgmt/v1beta1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::SaasDeployments::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::ListUnitOperationsRequest.new - # - # # Call the list_unit_operations method. - # result = client.list_unit_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::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::UnitOperation. - # p item - # end - # - def list_unit_operations request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::ListUnitOperationsRequest - - # Converts hash 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_unit_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::SaasPlatform::SaasServiceMgmt::V1beta1::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_unit_operations.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.list_unit_operations.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @saas_deployments_stub.list_unit_operations request, options do |result, operation| - result = ::Gapic::Rest::PagedEnumerable.new @saas_deployments_stub, :list_unit_operations, "unit_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 - - ## - # Retrieve a single unit operation. - # - # @overload get_unit_operation(request, options = nil) - # Pass arguments to `get_unit_operation` via a request object, either of type - # {::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::GetUnitOperationRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::GetUnitOperationRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_unit_operation(name: nil) - # Pass arguments to `get_unit_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] - # Required. The resource name of the resource within a service. - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::UnitOperation] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::UnitOperation] - # - # @raise [::Google::Cloud::Error] if the REST call is aborted. - # - # @example Basic example - # require "google/cloud/saas_platform/saas_service_mgmt/v1beta1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::SaasDeployments::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::GetUnitOperationRequest.new - # - # # Call the get_unit_operation method. - # result = client.get_unit_operation request - # - # # The returned object is of type Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::UnitOperation. - # p result - # - def get_unit_operation request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::GetUnitOperationRequest - - # Converts hash 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_unit_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::SaasPlatform::SaasServiceMgmt::V1beta1::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_unit_operation.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.get_unit_operation.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @saas_deployments_stub.get_unit_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 - - ## - # Create a new unit operation. - # - # @overload create_unit_operation(request, options = nil) - # Pass arguments to `create_unit_operation` via a request object, either of type - # {::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::CreateUnitOperationRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::CreateUnitOperationRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_unit_operation(parent: nil, unit_operation_id: nil, unit_operation: nil, validate_only: nil, request_id: nil) - # Pass arguments to `create_unit_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 parent [::String] - # Required. The parent of the unit operation. - # @param unit_operation_id [::String] - # Required. The ID value for the new unit operation. - # @param unit_operation [::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::UnitOperation, ::Hash] - # Required. The desired state for the unit operation. - # @param validate_only [::Boolean] - # If "validate_only" is set to true, the service will try to validate - # that this request would succeed, but will not actually make changes. - # @param request_id [::String] - # An optional request ID to identify requests. Specify a unique request ID - # so that if you must retry your request, the server will know to ignore - # the request if it has already been completed. The server will guarantee - # that for at least 60 minutes since the first request. - # - # For example, consider a situation where you make an initial request and the - # request times out. If you make the request again with the same request - # ID, the server can check if original operation with the same request ID - # was received, and if so, will ignore the second request. This prevents - # clients from accidentally creating duplicate commitments. - # - # The request ID must be a valid UUID with the exception that zero UUID is - # not supported (00000000-0000-0000-0000-000000000000). - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::UnitOperation] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::UnitOperation] - # - # @raise [::Google::Cloud::Error] if the REST call is aborted. - # - # @example Basic example - # require "google/cloud/saas_platform/saas_service_mgmt/v1beta1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::SaasDeployments::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::CreateUnitOperationRequest.new - # - # # Call the create_unit_operation method. - # result = client.create_unit_operation request - # - # # The returned object is of type Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::UnitOperation. - # p result - # - def create_unit_operation request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::CreateUnitOperationRequest - - # Converts hash 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_unit_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::SaasPlatform::SaasServiceMgmt::V1beta1::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_unit_operation.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.create_unit_operation.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @saas_deployments_stub.create_unit_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 - - ## - # Update a single unit operation. - # - # @overload update_unit_operation(request, options = nil) - # Pass arguments to `update_unit_operation` via a request object, either of type - # {::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::UpdateUnitOperationRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::UpdateUnitOperationRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_unit_operation(unit_operation: nil, validate_only: nil, request_id: nil, update_mask: nil) - # Pass arguments to `update_unit_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 unit_operation [::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::UnitOperation, ::Hash] - # Required. The desired state for the unit operation. - # @param validate_only [::Boolean] - # If "validate_only" is set to true, the service will try to validate - # that this request would succeed, but will not actually make changes. - # @param request_id [::String] - # An optional request ID to identify requests. Specify a unique request ID - # so that if you must retry your request, the server will know to ignore - # the request if it has already been completed. The server will guarantee - # that for at least 60 minutes since the first request. - # - # For example, consider a situation where you make an initial request and the - # request times out. If you make the request again with the same request - # ID, the server can check if original operation with the same request ID - # was received, and if so, will ignore the second request. This prevents - # clients from accidentally creating duplicate commitments. - # - # The request ID must be a valid UUID with the exception that zero UUID is - # not supported (00000000-0000-0000-0000-000000000000). - # @param update_mask [::Google::Protobuf::FieldMask, ::Hash] - # Field mask is used to specify the fields to be overwritten in the - # UnitOperation resource by the update. - # - # The fields specified in the update_mask are relative to the resource, not - # the full request. A field will be overwritten if it is in the mask. - # - # If the user does not provide a mask then all fields in the - # UnitOperation will be overwritten. - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::UnitOperation] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::UnitOperation] - # - # @raise [::Google::Cloud::Error] if the REST call is aborted. - # - # @example Basic example - # require "google/cloud/saas_platform/saas_service_mgmt/v1beta1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::SaasDeployments::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::UpdateUnitOperationRequest.new - # - # # Call the update_unit_operation method. - # result = client.update_unit_operation request - # - # # The returned object is of type Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::UnitOperation. - # p result - # - def update_unit_operation request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::UpdateUnitOperationRequest - - # Converts hash 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_unit_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::SaasPlatform::SaasServiceMgmt::V1beta1::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_unit_operation.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.update_unit_operation.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @saas_deployments_stub.update_unit_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 - - ## - # Delete a single unit operation. - # - # @overload delete_unit_operation(request, options = nil) - # Pass arguments to `delete_unit_operation` via a request object, either of type - # {::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::DeleteUnitOperationRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::DeleteUnitOperationRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_unit_operation(name: nil, etag: nil, validate_only: nil, request_id: nil) - # Pass arguments to `delete_unit_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] - # Required. The resource name of the resource within a service. - # @param etag [::String] - # The etag known to the client for the expected state of the unit operation. - # This is used with state-changing methods to prevent accidental overwrites - # when multiple user agents might be acting in parallel on the same resource. - # - # An etag wildcard provide optimistic concurrency based on the expected - # existence of the unit operation. The Any wildcard (`*`) requires that the - # resource must already exists, and the Not Any wildcard (`!*`) requires that - # it must not. - # @param validate_only [::Boolean] - # If "validate_only" is set to true, the service will try to validate - # that this request would succeed, but will not actually make changes. - # @param request_id [::String] - # An optional request ID to identify requests. Specify a unique request ID - # so that if you must retry your request, the server will know to ignore - # the request if it has already been completed. The server will guarantee - # that for at least 60 minutes since the first request. - # - # For example, consider a situation where you make an initial request and the - # request times out. If you make the request again with the same request - # ID, the server can check if original operation with the same request ID - # was received, and if so, will ignore the second request. This prevents - # clients from accidentally creating duplicate commitments. - # - # The request ID must be a valid UUID with the exception that zero UUID is - # not supported (00000000-0000-0000-0000-000000000000). - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Protobuf::Empty] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Protobuf::Empty] - # - # @raise [::Google::Cloud::Error] if the REST call is aborted. - # - # @example Basic example - # require "google/cloud/saas_platform/saas_service_mgmt/v1beta1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::SaasDeployments::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::DeleteUnitOperationRequest.new - # - # # Call the delete_unit_operation method. - # result = client.delete_unit_operation request - # - # # The returned object is of type Google::Protobuf::Empty. - # p result - # - def delete_unit_operation request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::DeleteUnitOperationRequest - - # Converts hash 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_unit_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::SaasPlatform::SaasServiceMgmt::V1beta1::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_unit_operation.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.delete_unit_operation.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @saas_deployments_stub.delete_unit_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 - - ## - # Retrieve a collection of releases. - # - # @overload list_releases(request, options = nil) - # Pass arguments to `list_releases` via a request object, either of type - # {::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::ListReleasesRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::ListReleasesRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_releases(parent: nil, page_size: nil, page_token: nil, filter: nil, order_by: nil) - # Pass arguments to `list_releases` via keyword arguments. Note that at - # least one keyword argument is 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 of the release. - # @param page_size [::Integer] - # The maximum number of releases to send per page. - # @param page_token [::String] - # The page token: If the next_page_token from a previous response - # is provided, this request will send the subsequent page. - # @param filter [::String] - # Filter the list as specified in https://google.aip.dev/160. - # @param order_by [::String] - # Order results as specified in https://google.aip.dev/132. - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Gapic::Rest::PagedEnumerable<::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::Release>] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Gapic::Rest::PagedEnumerable<::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::Release>] - # - # @raise [::Google::Cloud::Error] if the REST call is aborted. - # - # @example Basic example - # require "google/cloud/saas_platform/saas_service_mgmt/v1beta1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::SaasDeployments::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::ListReleasesRequest.new - # - # # Call the list_releases method. - # result = client.list_releases request - # - # # The returned object is of type Gapic::PagedEnumerable. You can iterate - # # over elements, and API calls will be issued to fetch pages as needed. - # result.each do |item| - # # Each element is of type ::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::Release. - # p item - # end - # - def list_releases request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::ListReleasesRequest - - # Converts hash 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_releases.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::SaasPlatform::SaasServiceMgmt::V1beta1::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_releases.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.list_releases.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @saas_deployments_stub.list_releases request, options do |result, operation| - result = ::Gapic::Rest::PagedEnumerable.new @saas_deployments_stub, :list_releases, "releases", 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 - - ## - # Retrieve a single release. - # - # @overload get_release(request, options = nil) - # Pass arguments to `get_release` via a request object, either of type - # {::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::GetReleaseRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::GetReleaseRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_release(name: nil) - # Pass arguments to `get_release` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param name [::String] - # Required. The resource name of the resource within a service. - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::Release] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::Release] - # - # @raise [::Google::Cloud::Error] if the REST call is aborted. - # - # @example Basic example - # require "google/cloud/saas_platform/saas_service_mgmt/v1beta1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::SaasDeployments::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::GetReleaseRequest.new - # - # # Call the get_release method. - # result = client.get_release request - # - # # The returned object is of type Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::Release. - # p result - # - def get_release request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::GetReleaseRequest - - # Converts hash 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_release.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::SaasPlatform::SaasServiceMgmt::V1beta1::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_release.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.get_release.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @saas_deployments_stub.get_release 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 - - ## - # Create a new release. - # - # @overload create_release(request, options = nil) - # Pass arguments to `create_release` via a request object, either of type - # {::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::CreateReleaseRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::CreateReleaseRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_release(parent: nil, release_id: nil, release: nil, validate_only: nil, request_id: nil) - # Pass arguments to `create_release` via keyword arguments. Note that at - # least one keyword argument is 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 of the release. - # @param release_id [::String] - # Required. The ID value for the new release. - # @param release [::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::Release, ::Hash] - # Required. The desired state for the release. - # @param validate_only [::Boolean] - # If "validate_only" is set to true, the service will try to validate - # that this request would succeed, but will not actually make changes. - # @param request_id [::String] - # An optional request ID to identify requests. Specify a unique request ID - # so that if you must retry your request, the server will know to ignore - # the request if it has already been completed. The server will guarantee - # that for at least 60 minutes since the first request. - # - # For example, consider a situation where you make an initial request and the - # request times out. If you make the request again with the same request - # ID, the server can check if original operation with the same request ID - # was received, and if so, will ignore the second request. This prevents - # clients from accidentally creating duplicate commitments. - # - # The request ID must be a valid UUID with the exception that zero UUID is - # not supported (00000000-0000-0000-0000-000000000000). - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::Release] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::Release] - # - # @raise [::Google::Cloud::Error] if the REST call is aborted. - # - # @example Basic example - # require "google/cloud/saas_platform/saas_service_mgmt/v1beta1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::SaasDeployments::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::CreateReleaseRequest.new - # - # # Call the create_release method. - # result = client.create_release request - # - # # The returned object is of type Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::Release. - # p result - # - def create_release request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::CreateReleaseRequest - - # Converts hash 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_release.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::SaasPlatform::SaasServiceMgmt::V1beta1::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_release.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.create_release.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @saas_deployments_stub.create_release 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 - - ## - # Update a single release. - # - # @overload update_release(request, options = nil) - # Pass arguments to `update_release` via a request object, either of type - # {::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::UpdateReleaseRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::UpdateReleaseRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_release(release: nil, validate_only: nil, request_id: nil, update_mask: nil) - # Pass arguments to `update_release` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param release [::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::Release, ::Hash] - # Required. The desired state for the release. - # @param validate_only [::Boolean] - # If "validate_only" is set to true, the service will try to validate - # that this request would succeed, but will not actually make changes. - # @param request_id [::String] - # An optional request ID to identify requests. Specify a unique request ID - # so that if you must retry your request, the server will know to ignore - # the request if it has already been completed. The server will guarantee - # that for at least 60 minutes since the first request. - # - # For example, consider a situation where you make an initial request and the - # request times out. If you make the request again with the same request - # ID, the server can check if original operation with the same request ID - # was received, and if so, will ignore the second request. This prevents - # clients from accidentally creating duplicate commitments. - # - # The request ID must be a valid UUID with the exception that zero UUID is - # not supported (00000000-0000-0000-0000-000000000000). - # @param update_mask [::Google::Protobuf::FieldMask, ::Hash] - # Field mask is used to specify the fields to be overwritten in the - # Release resource by the update. - # - # The fields specified in the update_mask are relative to the resource, not - # the full request. A field will be overwritten if it is in the mask. - # - # If the user does not provide a mask then all fields in the - # Release will be overwritten. - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::Release] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::Release] - # - # @raise [::Google::Cloud::Error] if the REST call is aborted. - # - # @example Basic example - # require "google/cloud/saas_platform/saas_service_mgmt/v1beta1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::SaasDeployments::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::UpdateReleaseRequest.new - # - # # Call the update_release method. - # result = client.update_release request - # - # # The returned object is of type Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::Release. - # p result - # - def update_release request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::UpdateReleaseRequest - - # Converts hash 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_release.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::SaasPlatform::SaasServiceMgmt::V1beta1::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_release.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.update_release.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @saas_deployments_stub.update_release 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 - - ## - # Delete a single release. - # - # @overload delete_release(request, options = nil) - # Pass arguments to `delete_release` via a request object, either of type - # {::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::DeleteReleaseRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::DeleteReleaseRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_release(name: nil, etag: nil, validate_only: nil, request_id: nil) - # Pass arguments to `delete_release` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param name [::String] - # Required. The resource name of the resource within a service. - # @param etag [::String] - # The etag known to the client for the expected state of the release. This is - # used with state-changing methods to prevent accidental overwrites when - # multiple user agents might be acting in parallel on the same resource. - # - # An etag wildcard provide optimistic concurrency based on the expected - # existence of the release. The Any wildcard (`*`) requires that the resource - # must already exists, and the Not Any wildcard (`!*`) requires that it must - # not. - # @param validate_only [::Boolean] - # If "validate_only" is set to true, the service will try to validate - # that this request would succeed, but will not actually make changes. - # @param request_id [::String] - # An optional request ID to identify requests. Specify a unique request ID - # so that if you must retry your request, the server will know to ignore - # the request if it has already been completed. The server will guarantee - # that for at least 60 minutes since the first request. - # - # For example, consider a situation where you make an initial request and the - # request times out. If you make the request again with the same request - # ID, the server can check if original operation with the same request ID - # was received, and if so, will ignore the second request. This prevents - # clients from accidentally creating duplicate commitments. - # - # The request ID must be a valid UUID with the exception that zero UUID is - # not supported (00000000-0000-0000-0000-000000000000). - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Protobuf::Empty] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Protobuf::Empty] - # - # @raise [::Google::Cloud::Error] if the REST call is aborted. - # - # @example Basic example - # require "google/cloud/saas_platform/saas_service_mgmt/v1beta1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::SaasDeployments::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::DeleteReleaseRequest.new - # - # # Call the delete_release method. - # result = client.delete_release request - # - # # The returned object is of type Google::Protobuf::Empty. - # p result - # - def delete_release request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::DeleteReleaseRequest - - # Converts hash 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_release.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::SaasPlatform::SaasServiceMgmt::V1beta1::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_release.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.delete_release.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @saas_deployments_stub.delete_release 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 SaasDeployments REST API. - # - # This class represents the configuration for SaasDeployments REST, - # providing control over timeouts, retry behavior, logging, transport - # parameters, and other low-level controls. Certain parameters can also be - # applied individually to specific RPCs. See - # {::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::SaasDeployments::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_saas to 20 seconds, - # # and all remaining timeouts to 10 seconds. - # ::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::SaasDeployments::Rest::Client.configure do |config| - # config.timeout = 10.0 - # config.rpcs.list_saas.timeout = 20.0 - # end - # - # # Apply the above configuration only to a new client. - # client = ::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::SaasDeployments::Rest::Client.new do |config| - # config.timeout = 10.0 - # config.rpcs.list_saas.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 = "saasservicemgmt.googleapis.com" - - config_attr :endpoint, nil, ::String, nil - config_attr :credentials, nil do |value| - allowed = [::String, ::Hash, ::Proc, ::Symbol, ::Google::Auth::Credentials, ::Google::Auth::BaseClient, ::Signet::OAuth2::Client, nil] - allowed.any? { |klass| klass === value } - end - config_attr :scope, nil, ::String, ::Array, nil - config_attr :lib_name, nil, ::String, nil - config_attr :lib_version, nil, ::String, nil - config_attr :timeout, nil, ::Numeric, nil - config_attr :metadata, nil, ::Hash, nil - config_attr :retry_policy, nil, ::Hash, ::Proc, nil - config_attr :quota_project, nil, ::String, nil - config_attr :universe_domain, nil, ::String, nil - - # @private - # Overrides for http bindings for the RPCs of this service - # are only used when this service is used as mixin, and only - # by the host service. - # @return [::Hash{::Symbol=>::Array<::Gapic::Rest::GrpcTranscoder::HttpBinding>}] - config_attr :bindings_override, {}, ::Hash, nil - config_attr :logger, :default, ::Logger, nil, :default - - # @private - def initialize parent_config = nil - @parent_config = parent_config unless parent_config.nil? - - yield self if block_given? - end - - ## - # Configurations for individual RPCs - # @return [Rpcs] - # - def rpcs - @rpcs ||= begin - parent_rpcs = nil - parent_rpcs = @parent_config.rpcs if defined?(@parent_config) && @parent_config.respond_to?(:rpcs) - Rpcs.new parent_rpcs - end - end - - ## - # Configuration RPC class for the SaasDeployments 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_saas` - # @return [::Gapic::Config::Method] - # - attr_reader :list_saas - ## - # RPC-specific configuration for `get_saas` - # @return [::Gapic::Config::Method] - # - attr_reader :get_saas - ## - # RPC-specific configuration for `create_saas` - # @return [::Gapic::Config::Method] - # - attr_reader :create_saas - ## - # RPC-specific configuration for `update_saas` - # @return [::Gapic::Config::Method] - # - attr_reader :update_saas - ## - # RPC-specific configuration for `delete_saas` - # @return [::Gapic::Config::Method] - # - attr_reader :delete_saas - ## - # RPC-specific configuration for `list_tenants` - # @return [::Gapic::Config::Method] - # - attr_reader :list_tenants - ## - # RPC-specific configuration for `get_tenant` - # @return [::Gapic::Config::Method] - # - attr_reader :get_tenant - ## - # RPC-specific configuration for `create_tenant` - # @return [::Gapic::Config::Method] - # - attr_reader :create_tenant - ## - # RPC-specific configuration for `update_tenant` - # @return [::Gapic::Config::Method] - # - attr_reader :update_tenant - ## - # RPC-specific configuration for `delete_tenant` - # @return [::Gapic::Config::Method] - # - attr_reader :delete_tenant - ## - # RPC-specific configuration for `list_unit_kinds` - # @return [::Gapic::Config::Method] - # - attr_reader :list_unit_kinds - ## - # RPC-specific configuration for `get_unit_kind` - # @return [::Gapic::Config::Method] - # - attr_reader :get_unit_kind - ## - # RPC-specific configuration for `create_unit_kind` - # @return [::Gapic::Config::Method] - # - attr_reader :create_unit_kind - ## - # RPC-specific configuration for `update_unit_kind` - # @return [::Gapic::Config::Method] - # - attr_reader :update_unit_kind - ## - # RPC-specific configuration for `delete_unit_kind` - # @return [::Gapic::Config::Method] - # - attr_reader :delete_unit_kind - ## - # RPC-specific configuration for `list_units` - # @return [::Gapic::Config::Method] - # - attr_reader :list_units - ## - # RPC-specific configuration for `get_unit` - # @return [::Gapic::Config::Method] - # - attr_reader :get_unit - ## - # RPC-specific configuration for `create_unit` - # @return [::Gapic::Config::Method] - # - attr_reader :create_unit - ## - # RPC-specific configuration for `update_unit` - # @return [::Gapic::Config::Method] - # - attr_reader :update_unit - ## - # RPC-specific configuration for `delete_unit` - # @return [::Gapic::Config::Method] - # - attr_reader :delete_unit - ## - # RPC-specific configuration for `list_unit_operations` - # @return [::Gapic::Config::Method] - # - attr_reader :list_unit_operations - ## - # RPC-specific configuration for `get_unit_operation` - # @return [::Gapic::Config::Method] - # - attr_reader :get_unit_operation - ## - # RPC-specific configuration for `create_unit_operation` - # @return [::Gapic::Config::Method] - # - attr_reader :create_unit_operation - ## - # RPC-specific configuration for `update_unit_operation` - # @return [::Gapic::Config::Method] - # - attr_reader :update_unit_operation - ## - # RPC-specific configuration for `delete_unit_operation` - # @return [::Gapic::Config::Method] - # - attr_reader :delete_unit_operation - ## - # RPC-specific configuration for `list_releases` - # @return [::Gapic::Config::Method] - # - attr_reader :list_releases - ## - # RPC-specific configuration for `get_release` - # @return [::Gapic::Config::Method] - # - attr_reader :get_release - ## - # RPC-specific configuration for `create_release` - # @return [::Gapic::Config::Method] - # - attr_reader :create_release - ## - # RPC-specific configuration for `update_release` - # @return [::Gapic::Config::Method] - # - attr_reader :update_release - ## - # RPC-specific configuration for `delete_release` - # @return [::Gapic::Config::Method] - # - attr_reader :delete_release - - # @private - def initialize parent_rpcs = nil - list_saas_config = parent_rpcs.list_saas if parent_rpcs.respond_to? :list_saas - @list_saas = ::Gapic::Config::Method.new list_saas_config - get_saas_config = parent_rpcs.get_saas if parent_rpcs.respond_to? :get_saas - @get_saas = ::Gapic::Config::Method.new get_saas_config - create_saas_config = parent_rpcs.create_saas if parent_rpcs.respond_to? :create_saas - @create_saas = ::Gapic::Config::Method.new create_saas_config - update_saas_config = parent_rpcs.update_saas if parent_rpcs.respond_to? :update_saas - @update_saas = ::Gapic::Config::Method.new update_saas_config - delete_saas_config = parent_rpcs.delete_saas if parent_rpcs.respond_to? :delete_saas - @delete_saas = ::Gapic::Config::Method.new delete_saas_config - list_tenants_config = parent_rpcs.list_tenants if parent_rpcs.respond_to? :list_tenants - @list_tenants = ::Gapic::Config::Method.new list_tenants_config - get_tenant_config = parent_rpcs.get_tenant if parent_rpcs.respond_to? :get_tenant - @get_tenant = ::Gapic::Config::Method.new get_tenant_config - create_tenant_config = parent_rpcs.create_tenant if parent_rpcs.respond_to? :create_tenant - @create_tenant = ::Gapic::Config::Method.new create_tenant_config - update_tenant_config = parent_rpcs.update_tenant if parent_rpcs.respond_to? :update_tenant - @update_tenant = ::Gapic::Config::Method.new update_tenant_config - delete_tenant_config = parent_rpcs.delete_tenant if parent_rpcs.respond_to? :delete_tenant - @delete_tenant = ::Gapic::Config::Method.new delete_tenant_config - list_unit_kinds_config = parent_rpcs.list_unit_kinds if parent_rpcs.respond_to? :list_unit_kinds - @list_unit_kinds = ::Gapic::Config::Method.new list_unit_kinds_config - get_unit_kind_config = parent_rpcs.get_unit_kind if parent_rpcs.respond_to? :get_unit_kind - @get_unit_kind = ::Gapic::Config::Method.new get_unit_kind_config - create_unit_kind_config = parent_rpcs.create_unit_kind if parent_rpcs.respond_to? :create_unit_kind - @create_unit_kind = ::Gapic::Config::Method.new create_unit_kind_config - update_unit_kind_config = parent_rpcs.update_unit_kind if parent_rpcs.respond_to? :update_unit_kind - @update_unit_kind = ::Gapic::Config::Method.new update_unit_kind_config - delete_unit_kind_config = parent_rpcs.delete_unit_kind if parent_rpcs.respond_to? :delete_unit_kind - @delete_unit_kind = ::Gapic::Config::Method.new delete_unit_kind_config - list_units_config = parent_rpcs.list_units if parent_rpcs.respond_to? :list_units - @list_units = ::Gapic::Config::Method.new list_units_config - get_unit_config = parent_rpcs.get_unit if parent_rpcs.respond_to? :get_unit - @get_unit = ::Gapic::Config::Method.new get_unit_config - create_unit_config = parent_rpcs.create_unit if parent_rpcs.respond_to? :create_unit - @create_unit = ::Gapic::Config::Method.new create_unit_config - update_unit_config = parent_rpcs.update_unit if parent_rpcs.respond_to? :update_unit - @update_unit = ::Gapic::Config::Method.new update_unit_config - delete_unit_config = parent_rpcs.delete_unit if parent_rpcs.respond_to? :delete_unit - @delete_unit = ::Gapic::Config::Method.new delete_unit_config - list_unit_operations_config = parent_rpcs.list_unit_operations if parent_rpcs.respond_to? :list_unit_operations - @list_unit_operations = ::Gapic::Config::Method.new list_unit_operations_config - get_unit_operation_config = parent_rpcs.get_unit_operation if parent_rpcs.respond_to? :get_unit_operation - @get_unit_operation = ::Gapic::Config::Method.new get_unit_operation_config - create_unit_operation_config = parent_rpcs.create_unit_operation if parent_rpcs.respond_to? :create_unit_operation - @create_unit_operation = ::Gapic::Config::Method.new create_unit_operation_config - update_unit_operation_config = parent_rpcs.update_unit_operation if parent_rpcs.respond_to? :update_unit_operation - @update_unit_operation = ::Gapic::Config::Method.new update_unit_operation_config - delete_unit_operation_config = parent_rpcs.delete_unit_operation if parent_rpcs.respond_to? :delete_unit_operation - @delete_unit_operation = ::Gapic::Config::Method.new delete_unit_operation_config - list_releases_config = parent_rpcs.list_releases if parent_rpcs.respond_to? :list_releases - @list_releases = ::Gapic::Config::Method.new list_releases_config - get_release_config = parent_rpcs.get_release if parent_rpcs.respond_to? :get_release - @get_release = ::Gapic::Config::Method.new get_release_config - create_release_config = parent_rpcs.create_release if parent_rpcs.respond_to? :create_release - @create_release = ::Gapic::Config::Method.new create_release_config - update_release_config = parent_rpcs.update_release if parent_rpcs.respond_to? :update_release - @update_release = ::Gapic::Config::Method.new update_release_config - delete_release_config = parent_rpcs.delete_release if parent_rpcs.respond_to? :delete_release - @delete_release = ::Gapic::Config::Method.new delete_release_config - - yield self if block_given? - end - end - end - end - end - end - end - end - end - end -end diff --git a/owl-bot-staging/google-cloud-saas_platform-saas_service_mgmt-v1beta1/lib/google/cloud/saas_platform/saas_service_mgmt/v1beta1/saas_deployments/rest/service_stub.rb b/owl-bot-staging/google-cloud-saas_platform-saas_service_mgmt-v1beta1/lib/google/cloud/saas_platform/saas_service_mgmt/v1beta1/saas_deployments/rest/service_stub.rb deleted file mode 100644 index f5cdfdb251a2..000000000000 --- a/owl-bot-staging/google-cloud-saas_platform-saas_service_mgmt-v1beta1/lib/google/cloud/saas_platform/saas_service_mgmt/v1beta1/saas_deployments/rest/service_stub.rb +++ /dev/null @@ -1,1925 +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/saasplatform/saasservicemgmt/v1beta1/deployments_service_pb" - -module Google - module Cloud - module SaasPlatform - module SaasServiceMgmt - module V1beta1 - module SaasDeployments - module Rest - ## - # REST service stub for the SaasDeployments service. - # Service stub contains baseline method implementations - # including transcoding, making the REST call, and deserialing the response. - # - class ServiceStub - # @private - def initialize endpoint:, endpoint_template:, universe_domain:, credentials:, logger: - # These require statements are intentionally placed here to initialize - # the REST modules only when it's required. - require "gapic/rest" - - @client_stub = ::Gapic::Rest::ClientStub.new endpoint: endpoint, - endpoint_template: endpoint_template, - universe_domain: universe_domain, - credentials: credentials, - numeric_enums: true, - service_name: self.class, - raise_faraday_errors: false, - logger: logger - end - - ## - # The effective universe domain - # - # @return [String] - # - def universe_domain - @client_stub.universe_domain - end - - ## - # The effective endpoint - # - # @return [String] - # - def endpoint - @client_stub.endpoint - end - - ## - # The logger used for request/response debug logging. - # - # @return [Logger] - # - def logger stub: false - stub ? @client_stub.stub_logger : @client_stub.logger - end - - ## - # Baseline implementation for the list_saas REST call - # - # @param request_pb [::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::ListSaasRequest] - # A request object representing the call parameters. Required. - # @param options [::Gapic::CallOptions] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::ListSaasResponse] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::ListSaasResponse] - # A result object deserialized from the server's reply - def list_saas request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_list_saas_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_saas", - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::ListSaasResponse.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_saas REST call - # - # @param request_pb [::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::GetSaasRequest] - # A request object representing the call parameters. Required. - # @param options [::Gapic::CallOptions] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::Saas] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::Saas] - # A result object deserialized from the server's reply - def get_saas request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_get_saas_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_saas", - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::Saas.decode_json response.body, ignore_unknown_fields: true - catch :response do - yield result, operation if block_given? - result - end - end - - ## - # Baseline implementation for the create_saas REST call - # - # @param request_pb [::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::CreateSaasRequest] - # A request object representing the call parameters. Required. - # @param options [::Gapic::CallOptions] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::Saas] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::Saas] - # A result object deserialized from the server's reply - def create_saas request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_create_saas_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_saas", - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::Saas.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_saas REST call - # - # @param request_pb [::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::UpdateSaasRequest] - # A request object representing the call parameters. Required. - # @param options [::Gapic::CallOptions] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::Saas] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::Saas] - # A result object deserialized from the server's reply - def update_saas request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_update_saas_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_saas", - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::Saas.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_saas REST call - # - # @param request_pb [::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::DeleteSaasRequest] - # 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_saas request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_delete_saas_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_saas", - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Protobuf::Empty.decode_json response.body, ignore_unknown_fields: true - catch :response do - yield result, operation if block_given? - result - end - end - - ## - # Baseline implementation for the list_tenants REST call - # - # @param request_pb [::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::ListTenantsRequest] - # A request object representing the call parameters. Required. - # @param options [::Gapic::CallOptions] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::ListTenantsResponse] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::ListTenantsResponse] - # A result object deserialized from the server's reply - def list_tenants request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_list_tenants_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_tenants", - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::ListTenantsResponse.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_tenant REST call - # - # @param request_pb [::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::GetTenantRequest] - # A request object representing the call parameters. Required. - # @param options [::Gapic::CallOptions] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::Tenant] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::Tenant] - # A result object deserialized from the server's reply - def get_tenant request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_get_tenant_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_tenant", - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::Tenant.decode_json response.body, ignore_unknown_fields: true - catch :response do - yield result, operation if block_given? - result - end - end - - ## - # Baseline implementation for the create_tenant REST call - # - # @param request_pb [::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::CreateTenantRequest] - # A request object representing the call parameters. Required. - # @param options [::Gapic::CallOptions] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::Tenant] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::Tenant] - # A result object deserialized from the server's reply - def create_tenant request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_create_tenant_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_tenant", - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::Tenant.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_tenant REST call - # - # @param request_pb [::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::UpdateTenantRequest] - # A request object representing the call parameters. Required. - # @param options [::Gapic::CallOptions] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::Tenant] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::Tenant] - # A result object deserialized from the server's reply - def update_tenant request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_update_tenant_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_tenant", - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::Tenant.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_tenant REST call - # - # @param request_pb [::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::DeleteTenantRequest] - # 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_tenant request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_delete_tenant_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_tenant", - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Protobuf::Empty.decode_json response.body, ignore_unknown_fields: true - catch :response do - yield result, operation if block_given? - result - end - end - - ## - # Baseline implementation for the list_unit_kinds REST call - # - # @param request_pb [::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::ListUnitKindsRequest] - # A request object representing the call parameters. Required. - # @param options [::Gapic::CallOptions] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::ListUnitKindsResponse] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::ListUnitKindsResponse] - # A result object deserialized from the server's reply - def list_unit_kinds request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_list_unit_kinds_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_unit_kinds", - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::ListUnitKindsResponse.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_unit_kind REST call - # - # @param request_pb [::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::GetUnitKindRequest] - # A request object representing the call parameters. Required. - # @param options [::Gapic::CallOptions] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::UnitKind] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::UnitKind] - # A result object deserialized from the server's reply - def get_unit_kind request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_get_unit_kind_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_unit_kind", - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::UnitKind.decode_json response.body, ignore_unknown_fields: true - catch :response do - yield result, operation if block_given? - result - end - end - - ## - # Baseline implementation for the create_unit_kind REST call - # - # @param request_pb [::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::CreateUnitKindRequest] - # A request object representing the call parameters. Required. - # @param options [::Gapic::CallOptions] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::UnitKind] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::UnitKind] - # A result object deserialized from the server's reply - def create_unit_kind request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_create_unit_kind_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_unit_kind", - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::UnitKind.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_unit_kind REST call - # - # @param request_pb [::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::UpdateUnitKindRequest] - # A request object representing the call parameters. Required. - # @param options [::Gapic::CallOptions] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::UnitKind] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::UnitKind] - # A result object deserialized from the server's reply - def update_unit_kind request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_update_unit_kind_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_unit_kind", - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::UnitKind.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_unit_kind REST call - # - # @param request_pb [::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::DeleteUnitKindRequest] - # 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_unit_kind request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_delete_unit_kind_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_unit_kind", - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Protobuf::Empty.decode_json response.body, ignore_unknown_fields: true - catch :response do - yield result, operation if block_given? - result - end - end - - ## - # Baseline implementation for the list_units REST call - # - # @param request_pb [::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::ListUnitsRequest] - # A request object representing the call parameters. Required. - # @param options [::Gapic::CallOptions] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::ListUnitsResponse] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::ListUnitsResponse] - # A result object deserialized from the server's reply - def list_units request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_list_units_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_units", - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::ListUnitsResponse.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_unit REST call - # - # @param request_pb [::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::GetUnitRequest] - # A request object representing the call parameters. Required. - # @param options [::Gapic::CallOptions] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::Unit] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::Unit] - # A result object deserialized from the server's reply - def get_unit request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_get_unit_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_unit", - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::Unit.decode_json response.body, ignore_unknown_fields: true - catch :response do - yield result, operation if block_given? - result - end - end - - ## - # Baseline implementation for the create_unit REST call - # - # @param request_pb [::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::CreateUnitRequest] - # A request object representing the call parameters. Required. - # @param options [::Gapic::CallOptions] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::Unit] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::Unit] - # A result object deserialized from the server's reply - def create_unit request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_create_unit_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_unit", - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::Unit.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_unit REST call - # - # @param request_pb [::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::UpdateUnitRequest] - # A request object representing the call parameters. Required. - # @param options [::Gapic::CallOptions] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::Unit] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::Unit] - # A result object deserialized from the server's reply - def update_unit request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_update_unit_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_unit", - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::Unit.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_unit REST call - # - # @param request_pb [::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::DeleteUnitRequest] - # 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_unit request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_delete_unit_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_unit", - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Protobuf::Empty.decode_json response.body, ignore_unknown_fields: true - catch :response do - yield result, operation if block_given? - result - end - end - - ## - # Baseline implementation for the list_unit_operations REST call - # - # @param request_pb [::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::ListUnitOperationsRequest] - # A request object representing the call parameters. Required. - # @param options [::Gapic::CallOptions] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::ListUnitOperationsResponse] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::ListUnitOperationsResponse] - # A result object deserialized from the server's reply - def list_unit_operations request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_list_unit_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_unit_operations", - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::ListUnitOperationsResponse.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_unit_operation REST call - # - # @param request_pb [::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::GetUnitOperationRequest] - # A request object representing the call parameters. Required. - # @param options [::Gapic::CallOptions] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::UnitOperation] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::UnitOperation] - # A result object deserialized from the server's reply - def get_unit_operation request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_get_unit_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_unit_operation", - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::UnitOperation.decode_json response.body, ignore_unknown_fields: true - catch :response do - yield result, operation if block_given? - result - end - end - - ## - # Baseline implementation for the create_unit_operation REST call - # - # @param request_pb [::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::CreateUnitOperationRequest] - # A request object representing the call parameters. Required. - # @param options [::Gapic::CallOptions] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::UnitOperation] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::UnitOperation] - # A result object deserialized from the server's reply - def create_unit_operation request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_create_unit_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: "create_unit_operation", - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::UnitOperation.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_unit_operation REST call - # - # @param request_pb [::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::UpdateUnitOperationRequest] - # A request object representing the call parameters. Required. - # @param options [::Gapic::CallOptions] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::UnitOperation] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::UnitOperation] - # A result object deserialized from the server's reply - def update_unit_operation request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_update_unit_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: "update_unit_operation", - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::UnitOperation.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_unit_operation REST call - # - # @param request_pb [::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::DeleteUnitOperationRequest] - # 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_unit_operation request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_delete_unit_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_unit_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 list_releases REST call - # - # @param request_pb [::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::ListReleasesRequest] - # A request object representing the call parameters. Required. - # @param options [::Gapic::CallOptions] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::ListReleasesResponse] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::ListReleasesResponse] - # A result object deserialized from the server's reply - def list_releases request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_list_releases_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_releases", - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::ListReleasesResponse.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_release REST call - # - # @param request_pb [::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::GetReleaseRequest] - # A request object representing the call parameters. Required. - # @param options [::Gapic::CallOptions] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::Release] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::Release] - # A result object deserialized from the server's reply - def get_release request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_get_release_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_release", - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::Release.decode_json response.body, ignore_unknown_fields: true - catch :response do - yield result, operation if block_given? - result - end - end - - ## - # Baseline implementation for the create_release REST call - # - # @param request_pb [::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::CreateReleaseRequest] - # A request object representing the call parameters. Required. - # @param options [::Gapic::CallOptions] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::Release] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::Release] - # A result object deserialized from the server's reply - def create_release request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_create_release_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_release", - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::Release.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_release REST call - # - # @param request_pb [::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::UpdateReleaseRequest] - # A request object representing the call parameters. Required. - # @param options [::Gapic::CallOptions] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::Release] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::Release] - # A result object deserialized from the server's reply - def update_release request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_update_release_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_release", - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::Release.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_release REST call - # - # @param request_pb [::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::DeleteReleaseRequest] - # 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_release request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_delete_release_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_release", - 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_saas REST call - # - # @param request_pb [::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::ListSaasRequest] - # 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_saas_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :get, - uri_template: "/v1beta1/{parent}/saas", - matches: [ - ["parent", %r{^projects/[^/]+/locations/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the get_saas REST call - # - # @param request_pb [::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::GetSaasRequest] - # 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_saas_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :get, - uri_template: "/v1beta1/{name}", - matches: [ - ["name", %r{^projects/[^/]+/locations/[^/]+/saas/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the create_saas REST call - # - # @param request_pb [::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::CreateSaasRequest] - # 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_saas_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :post, - uri_template: "/v1beta1/{parent}/saas", - body: "saas", - matches: [ - ["parent", %r{^projects/[^/]+/locations/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the update_saas REST call - # - # @param request_pb [::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::UpdateSaasRequest] - # 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_saas_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :patch, - uri_template: "/v1beta1/{saas.name}", - body: "saas", - matches: [ - ["saas.name", %r{^projects/[^/]+/locations/[^/]+/saas/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the delete_saas REST call - # - # @param request_pb [::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::DeleteSaasRequest] - # 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_saas_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :delete, - uri_template: "/v1beta1/{name}", - matches: [ - ["name", %r{^projects/[^/]+/locations/[^/]+/saas/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the list_tenants REST call - # - # @param request_pb [::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::ListTenantsRequest] - # 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_tenants_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :get, - uri_template: "/v1beta1/{parent}/tenants", - matches: [ - ["parent", %r{^projects/[^/]+/locations/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the get_tenant REST call - # - # @param request_pb [::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::GetTenantRequest] - # 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_tenant_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :get, - uri_template: "/v1beta1/{name}", - matches: [ - ["name", %r{^projects/[^/]+/locations/[^/]+/tenants/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the create_tenant REST call - # - # @param request_pb [::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::CreateTenantRequest] - # 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_tenant_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :post, - uri_template: "/v1beta1/{parent}/tenants", - body: "tenant", - matches: [ - ["parent", %r{^projects/[^/]+/locations/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the update_tenant REST call - # - # @param request_pb [::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::UpdateTenantRequest] - # 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_tenant_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :patch, - uri_template: "/v1beta1/{tenant.name}", - body: "tenant", - matches: [ - ["tenant.name", %r{^projects/[^/]+/locations/[^/]+/tenants/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the delete_tenant REST call - # - # @param request_pb [::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::DeleteTenantRequest] - # 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_tenant_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :delete, - uri_template: "/v1beta1/{name}", - matches: [ - ["name", %r{^projects/[^/]+/locations/[^/]+/tenants/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the list_unit_kinds REST call - # - # @param request_pb [::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::ListUnitKindsRequest] - # 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_unit_kinds_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :get, - uri_template: "/v1beta1/{parent}/unitKinds", - matches: [ - ["parent", %r{^projects/[^/]+/locations/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the get_unit_kind REST call - # - # @param request_pb [::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::GetUnitKindRequest] - # 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_unit_kind_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :get, - uri_template: "/v1beta1/{name}", - matches: [ - ["name", %r{^projects/[^/]+/locations/[^/]+/unitKinds/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the create_unit_kind REST call - # - # @param request_pb [::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::CreateUnitKindRequest] - # 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_unit_kind_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :post, - uri_template: "/v1beta1/{parent}/unitKinds", - body: "unit_kind", - matches: [ - ["parent", %r{^projects/[^/]+/locations/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the update_unit_kind REST call - # - # @param request_pb [::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::UpdateUnitKindRequest] - # 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_unit_kind_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :patch, - uri_template: "/v1beta1/{unit_kind.name}", - body: "unit_kind", - matches: [ - ["unit_kind.name", %r{^projects/[^/]+/locations/[^/]+/unitKinds/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the delete_unit_kind REST call - # - # @param request_pb [::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::DeleteUnitKindRequest] - # 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_unit_kind_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :delete, - uri_template: "/v1beta1/{name}", - matches: [ - ["name", %r{^projects/[^/]+/locations/[^/]+/unitKinds/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the list_units REST call - # - # @param request_pb [::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::ListUnitsRequest] - # 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_units_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :get, - uri_template: "/v1beta1/{parent}/units", - matches: [ - ["parent", %r{^projects/[^/]+/locations/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the get_unit REST call - # - # @param request_pb [::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::GetUnitRequest] - # 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_unit_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :get, - uri_template: "/v1beta1/{name}", - matches: [ - ["name", %r{^projects/[^/]+/locations/[^/]+/units/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the create_unit REST call - # - # @param request_pb [::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::CreateUnitRequest] - # 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_unit_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :post, - uri_template: "/v1beta1/{parent}/units", - body: "unit", - matches: [ - ["parent", %r{^projects/[^/]+/locations/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the update_unit REST call - # - # @param request_pb [::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::UpdateUnitRequest] - # 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_unit_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :patch, - uri_template: "/v1beta1/{unit.name}", - body: "unit", - matches: [ - ["unit.name", %r{^projects/[^/]+/locations/[^/]+/units/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the delete_unit REST call - # - # @param request_pb [::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::DeleteUnitRequest] - # 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_unit_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :delete, - uri_template: "/v1beta1/{name}", - matches: [ - ["name", %r{^projects/[^/]+/locations/[^/]+/units/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the list_unit_operations REST call - # - # @param request_pb [::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::ListUnitOperationsRequest] - # 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_unit_operations_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :get, - uri_template: "/v1beta1/{parent}/unitOperations", - matches: [ - ["parent", %r{^projects/[^/]+/locations/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the get_unit_operation REST call - # - # @param request_pb [::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::GetUnitOperationRequest] - # 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_unit_operation_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :get, - uri_template: "/v1beta1/{name}", - matches: [ - ["name", %r{^projects/[^/]+/locations/[^/]+/unitOperations/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the create_unit_operation REST call - # - # @param request_pb [::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::CreateUnitOperationRequest] - # 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_unit_operation_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :post, - uri_template: "/v1beta1/{parent}/unitOperations", - body: "unit_operation", - matches: [ - ["parent", %r{^projects/[^/]+/locations/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the update_unit_operation REST call - # - # @param request_pb [::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::UpdateUnitOperationRequest] - # 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_unit_operation_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :patch, - uri_template: "/v1beta1/{unit_operation.name}", - body: "unit_operation", - matches: [ - ["unit_operation.name", %r{^projects/[^/]+/locations/[^/]+/unitOperations/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the delete_unit_operation REST call - # - # @param request_pb [::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::DeleteUnitOperationRequest] - # 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_unit_operation_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :delete, - uri_template: "/v1beta1/{name}", - matches: [ - ["name", %r{^projects/[^/]+/locations/[^/]+/unitOperations/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the list_releases REST call - # - # @param request_pb [::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::ListReleasesRequest] - # 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_releases_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :get, - uri_template: "/v1beta1/{parent}/releases", - matches: [ - ["parent", %r{^projects/[^/]+/locations/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the get_release REST call - # - # @param request_pb [::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::GetReleaseRequest] - # 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_release_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :get, - uri_template: "/v1beta1/{name}", - matches: [ - ["name", %r{^projects/[^/]+/locations/[^/]+/releases/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the create_release REST call - # - # @param request_pb [::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::CreateReleaseRequest] - # 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_release_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :post, - uri_template: "/v1beta1/{parent}/releases", - body: "release", - matches: [ - ["parent", %r{^projects/[^/]+/locations/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the update_release REST call - # - # @param request_pb [::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::UpdateReleaseRequest] - # 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_release_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :patch, - uri_template: "/v1beta1/{release.name}", - body: "release", - matches: [ - ["release.name", %r{^projects/[^/]+/locations/[^/]+/releases/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the delete_release REST call - # - # @param request_pb [::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::DeleteReleaseRequest] - # 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_release_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :delete, - uri_template: "/v1beta1/{name}", - matches: [ - ["name", %r{^projects/[^/]+/locations/[^/]+/releases/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - end - end - end - end - end - end - end -end diff --git a/owl-bot-staging/google-cloud-saas_platform-saas_service_mgmt-v1beta1/lib/google/cloud/saas_platform/saas_service_mgmt/v1beta1/saas_rollouts.rb b/owl-bot-staging/google-cloud-saas_platform-saas_service_mgmt-v1beta1/lib/google/cloud/saas_platform/saas_service_mgmt/v1beta1/saas_rollouts.rb deleted file mode 100644 index 5e1c1a19ccc6..000000000000 --- a/owl-bot-staging/google-cloud-saas_platform-saas_service_mgmt-v1beta1/lib/google/cloud/saas_platform/saas_service_mgmt/v1beta1/saas_rollouts.rb +++ /dev/null @@ -1,57 +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/saas_platform/saas_service_mgmt/v1beta1/version" - -require "google/cloud/saas_platform/saas_service_mgmt/v1beta1/saas_rollouts/credentials" -require "google/cloud/saas_platform/saas_service_mgmt/v1beta1/saas_rollouts/paths" -require "google/cloud/saas_platform/saas_service_mgmt/v1beta1/saas_rollouts/client" -require "google/cloud/saas_platform/saas_service_mgmt/v1beta1/saas_rollouts/rest" - -module Google - module Cloud - module SaasPlatform - module SaasServiceMgmt - module V1beta1 - ## - # Manages the rollout of SaaS services. - # - # @example Load this service and instantiate a gRPC client - # - # require "google/cloud/saas_platform/saas_service_mgmt/v1beta1/saas_rollouts" - # client = ::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::SaasRollouts::Client.new - # - # @example Load this service and instantiate a REST client - # - # require "google/cloud/saas_platform/saas_service_mgmt/v1beta1/saas_rollouts/rest" - # client = ::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::SaasRollouts::Rest::Client.new - # - module SaasRollouts - end - end - end - end - end -end - -helper_path = ::File.join __dir__, "saas_rollouts", "helpers.rb" -require "google/cloud/saas_platform/saas_service_mgmt/v1beta1/saas_rollouts/helpers" if ::File.file? helper_path diff --git a/owl-bot-staging/google-cloud-saas_platform-saas_service_mgmt-v1beta1/lib/google/cloud/saas_platform/saas_service_mgmt/v1beta1/saas_rollouts/client.rb b/owl-bot-staging/google-cloud-saas_platform-saas_service_mgmt-v1beta1/lib/google/cloud/saas_platform/saas_service_mgmt/v1beta1/saas_rollouts/client.rb deleted file mode 100644 index 887bff6b5738..000000000000 --- a/owl-bot-staging/google-cloud-saas_platform-saas_service_mgmt-v1beta1/lib/google/cloud/saas_platform/saas_service_mgmt/v1beta1/saas_rollouts/client.rb +++ /dev/null @@ -1,1534 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -require "google/cloud/errors" -require "google/cloud/saasplatform/saasservicemgmt/v1beta1/rollouts_service_pb" -require "google/cloud/location" - -module Google - module Cloud - module SaasPlatform - module SaasServiceMgmt - module V1beta1 - module SaasRollouts - ## - # Client for the SaasRollouts service. - # - # Manages the rollout of SaaS services. - # - class Client - # @private - API_VERSION = "" - - # @private - DEFAULT_ENDPOINT_TEMPLATE = "saasservicemgmt.$UNIVERSE_DOMAIN$" - - include Paths - - # @private - attr_reader :saas_rollouts_stub - - ## - # Configure the SaasRollouts Client class. - # - # See {::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::SaasRollouts::Client::Configuration} - # for a description of the configuration fields. - # - # @example - # - # # Modify the configuration for all SaasRollouts clients - # ::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::SaasRollouts::Client.configure do |config| - # config.timeout = 10.0 - # end - # - # @yield [config] Configure the Client client. - # @yieldparam config [Client::Configuration] - # - # @return [Client::Configuration] - # - def self.configure - @configure ||= begin - namespace = ["Google", "Cloud", "SaasPlatform", "SaasServiceMgmt", "V1beta1"] - parent_config = while namespace.any? - parent_name = namespace.join "::" - parent_const = const_get parent_name - break parent_const.configure if parent_const.respond_to? :configure - namespace.pop - end - default_config = Client::Configuration.new parent_config - - default_config.rpcs.list_rollouts.timeout = 60.0 - default_config.rpcs.list_rollouts.retry_policy = { - initial_delay: 1.0, max_delay: 10.0, multiplier: 1.3, retry_codes: [14] - } - - default_config.rpcs.get_rollout.timeout = 60.0 - default_config.rpcs.get_rollout.retry_policy = { - initial_delay: 1.0, max_delay: 10.0, multiplier: 1.3, retry_codes: [14] - } - - default_config.rpcs.create_rollout.timeout = 60.0 - - default_config.rpcs.update_rollout.timeout = 60.0 - - default_config.rpcs.delete_rollout.timeout = 540.0 - default_config.rpcs.delete_rollout.retry_policy = { - initial_delay: 1.0, max_delay: 10.0, multiplier: 1.3, retry_codes: [14] - } - - default_config.rpcs.list_rollout_kinds.timeout = 60.0 - default_config.rpcs.list_rollout_kinds.retry_policy = { - initial_delay: 1.0, max_delay: 10.0, multiplier: 1.3, retry_codes: [14] - } - - default_config.rpcs.get_rollout_kind.timeout = 60.0 - default_config.rpcs.get_rollout_kind.retry_policy = { - initial_delay: 1.0, max_delay: 10.0, multiplier: 1.3, retry_codes: [14] - } - - default_config.rpcs.create_rollout_kind.timeout = 60.0 - - default_config.rpcs.update_rollout_kind.timeout = 60.0 - - default_config.rpcs.delete_rollout_kind.timeout = 60.0 - default_config.rpcs.delete_rollout_kind.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 SaasRollouts Client instance. - # - # The configuration is set to the derived mode, meaning that values can be changed, - # but structural changes (adding new fields, etc.) are not allowed. Structural changes - # should be made on {Client.configure}. - # - # See {::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::SaasRollouts::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 - @saas_rollouts_stub.universe_domain - end - - ## - # Create a new SaasRollouts client object. - # - # @example - # - # # Create a client using the default configuration - # client = ::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::SaasRollouts::Client.new - # - # # Create a client using a custom configuration - # client = ::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::SaasRollouts::Client.new do |config| - # config.timeout = 10.0 - # end - # - # @yield [config] Configure the SaasRollouts client. - # @yieldparam config [Client::Configuration] - # - def initialize - # These require statements are intentionally placed here to initialize - # the gRPC module only when it's required. - # See https://github.com/googleapis/toolkit/issues/446 - require "gapic/grpc" - require "google/cloud/saasplatform/saasservicemgmt/v1beta1/rollouts_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 - - @saas_rollouts_stub = ::Gapic::ServiceStub.new( - ::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::SaasRollouts::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 - ) - - @saas_rollouts_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 = @saas_rollouts_stub.endpoint - config.universe_domain = @saas_rollouts_stub.universe_domain - config.logger = @saas_rollouts_stub.logger if config.respond_to? :logger= - end - end - - ## - # Get the associated client for mix-in of the Locations. - # - # @return [Google::Cloud::Location::Locations::Client] - # - attr_reader :location_client - - ## - # The logger used for request/response debug logging. - # - # @return [Logger] - # - def logger - @saas_rollouts_stub.logger - end - - # Service calls - - ## - # Retrieve a collection of rollouts. - # - # @overload list_rollouts(request, options = nil) - # Pass arguments to `list_rollouts` via a request object, either of type - # {::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::ListRolloutsRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::ListRolloutsRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_rollouts(parent: nil, page_size: nil, page_token: nil, filter: nil, order_by: nil) - # Pass arguments to `list_rollouts` via keyword arguments. Note that at - # least one keyword argument is 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 of the rollout. - # @param page_size [::Integer] - # The maximum number of rollouts to send per page. - # @param page_token [::String] - # The page token: If the next_page_token from a previous response - # is provided, this request will send the subsequent page. - # @param filter [::String] - # Filter the list as specified in https://google.aip.dev/160. - # @param order_by [::String] - # Order results as specified in https://google.aip.dev/132. - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Gapic::PagedEnumerable<::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::Rollout>] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Gapic::PagedEnumerable<::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::Rollout>] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/cloud/saas_platform/saas_service_mgmt/v1beta1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::SaasRollouts::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::ListRolloutsRequest.new - # - # # Call the list_rollouts method. - # result = client.list_rollouts request - # - # # The returned object is of type Gapic::PagedEnumerable. You can iterate - # # over elements, and API calls will be issued to fetch pages as needed. - # result.each do |item| - # # Each element is of type ::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::Rollout. - # p item - # end - # - def list_rollouts request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::ListRolloutsRequest - - # Converts hash 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_rollouts.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::SaasPlatform::SaasServiceMgmt::V1beta1::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_rollouts.timeout, - metadata: metadata, - retry_policy: @config.rpcs.list_rollouts.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @saas_rollouts_stub.call_rpc :list_rollouts, request, options: options do |response, operation| - response = ::Gapic::PagedEnumerable.new @saas_rollouts_stub, :list_rollouts, 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 - - ## - # Retrieve a single rollout. - # - # @overload get_rollout(request, options = nil) - # Pass arguments to `get_rollout` via a request object, either of type - # {::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::GetRolloutRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::GetRolloutRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_rollout(name: nil) - # Pass arguments to `get_rollout` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param name [::String] - # Required. The resource name of the resource within a service. - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::Rollout] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::Rollout] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/cloud/saas_platform/saas_service_mgmt/v1beta1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::SaasRollouts::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::GetRolloutRequest.new - # - # # Call the get_rollout method. - # result = client.get_rollout request - # - # # The returned object is of type Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::Rollout. - # p result - # - def get_rollout request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::GetRolloutRequest - - # Converts hash 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_rollout.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::SaasPlatform::SaasServiceMgmt::V1beta1::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_rollout.timeout, - metadata: metadata, - retry_policy: @config.rpcs.get_rollout.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @saas_rollouts_stub.call_rpc :get_rollout, 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 - - ## - # Create a new rollout. - # - # @overload create_rollout(request, options = nil) - # Pass arguments to `create_rollout` via a request object, either of type - # {::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::CreateRolloutRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::CreateRolloutRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_rollout(parent: nil, rollout_id: nil, rollout: nil, validate_only: nil, request_id: nil) - # Pass arguments to `create_rollout` via keyword arguments. Note that at - # least one keyword argument is 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 of the rollout. - # @param rollout_id [::String] - # Required. The ID value for the new rollout. - # @param rollout [::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::Rollout, ::Hash] - # Required. The desired state for the rollout. - # @param validate_only [::Boolean] - # If "validate_only" is set to true, the service will try to validate - # that this request would succeed, but will not actually make changes. - # @param request_id [::String] - # An optional request ID to identify requests. Specify a unique request ID - # so that if you must retry your request, the server will know to ignore - # the request if it has already been completed. The server will guarantee - # that for at least 60 minutes since the first request. - # - # For example, consider a situation where you make an initial request and the - # request times out. If you make the request again with the same request - # ID, the server can check if original operation with the same request ID - # was received, and if so, will ignore the second request. This prevents - # clients from accidentally creating duplicate commitments. - # - # The request ID must be a valid UUID with the exception that zero UUID is - # not supported (00000000-0000-0000-0000-000000000000). - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::Rollout] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::Rollout] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/cloud/saas_platform/saas_service_mgmt/v1beta1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::SaasRollouts::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::CreateRolloutRequest.new - # - # # Call the create_rollout method. - # result = client.create_rollout request - # - # # The returned object is of type Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::Rollout. - # p result - # - def create_rollout request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::CreateRolloutRequest - - # Converts hash 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_rollout.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::SaasPlatform::SaasServiceMgmt::V1beta1::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_rollout.timeout, - metadata: metadata, - retry_policy: @config.rpcs.create_rollout.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @saas_rollouts_stub.call_rpc :create_rollout, 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 - - ## - # Update a single rollout. - # - # @overload update_rollout(request, options = nil) - # Pass arguments to `update_rollout` via a request object, either of type - # {::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::UpdateRolloutRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::UpdateRolloutRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_rollout(rollout: nil, validate_only: nil, request_id: nil, update_mask: nil) - # Pass arguments to `update_rollout` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param rollout [::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::Rollout, ::Hash] - # Required. The desired state for the rollout. - # @param validate_only [::Boolean] - # If "validate_only" is set to true, the service will try to validate - # that this request would succeed, but will not actually make changes. - # @param request_id [::String] - # An optional request ID to identify requests. Specify a unique request ID - # so that if you must retry your request, the server will know to ignore - # the request if it has already been completed. The server will guarantee - # that for at least 60 minutes since the first request. - # - # For example, consider a situation where you make an initial request and the - # request times out. If you make the request again with the same request - # ID, the server can check if original operation with the same request ID - # was received, and if so, will ignore the second request. This prevents - # clients from accidentally creating duplicate commitments. - # - # The request ID must be a valid UUID with the exception that zero UUID is - # not supported (00000000-0000-0000-0000-000000000000). - # @param update_mask [::Google::Protobuf::FieldMask, ::Hash] - # Field mask is used to specify the fields to be overwritten in the - # Rollout resource by the update. - # - # The fields specified in the update_mask are relative to the resource, not - # the full request. A field will be overwritten if it is in the mask. - # - # If the user does not provide a mask then all fields in the - # Rollout will be overwritten. - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::Rollout] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::Rollout] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/cloud/saas_platform/saas_service_mgmt/v1beta1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::SaasRollouts::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::UpdateRolloutRequest.new - # - # # Call the update_rollout method. - # result = client.update_rollout request - # - # # The returned object is of type Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::Rollout. - # p result - # - def update_rollout request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::UpdateRolloutRequest - - # Converts hash 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_rollout.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::SaasPlatform::SaasServiceMgmt::V1beta1::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.rollout&.name - header_params["rollout.name"] = request.rollout.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_rollout.timeout, - metadata: metadata, - retry_policy: @config.rpcs.update_rollout.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @saas_rollouts_stub.call_rpc :update_rollout, 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 - - ## - # Delete a single rollout. - # - # @overload delete_rollout(request, options = nil) - # Pass arguments to `delete_rollout` via a request object, either of type - # {::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::DeleteRolloutRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::DeleteRolloutRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_rollout(name: nil, etag: nil, validate_only: nil, request_id: nil) - # Pass arguments to `delete_rollout` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param name [::String] - # Required. The resource name of the resource within a service. - # @param etag [::String] - # The etag known to the client for the expected state of the rollout. This is - # used with state-changing methods to prevent accidental overwrites when - # multiple user agents might be acting in parallel on the same resource. - # - # An etag wildcard provide optimistic concurrency based on the expected - # existence of the rollout. The Any wildcard (`*`) requires that the resource - # must already exists, and the Not Any wildcard (`!*`) requires that it must - # not. - # @param validate_only [::Boolean] - # If "validate_only" is set to true, the service will try to validate - # that this request would succeed, but will not actually make changes. - # @param request_id [::String] - # An optional request ID to identify requests. Specify a unique request ID - # so that if you must retry your request, the server will know to ignore - # the request if it has already been completed. The server will guarantee - # that for at least 60 minutes since the first request. - # - # For example, consider a situation where you make an initial request and the - # request times out. If you make the request again with the same request - # ID, the server can check if original operation with the same request ID - # was received, and if so, will ignore the second request. This prevents - # clients from accidentally creating duplicate commitments. - # - # The request ID must be a valid UUID with the exception that zero UUID is - # not supported (00000000-0000-0000-0000-000000000000). - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Google::Protobuf::Empty] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Google::Protobuf::Empty] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/cloud/saas_platform/saas_service_mgmt/v1beta1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::SaasRollouts::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::DeleteRolloutRequest.new - # - # # Call the delete_rollout method. - # result = client.delete_rollout request - # - # # The returned object is of type Google::Protobuf::Empty. - # p result - # - def delete_rollout request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::DeleteRolloutRequest - - # Converts hash 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_rollout.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::SaasPlatform::SaasServiceMgmt::V1beta1::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_rollout.timeout, - metadata: metadata, - retry_policy: @config.rpcs.delete_rollout.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @saas_rollouts_stub.call_rpc :delete_rollout, 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 - - ## - # Retrieve a collection of rollout kinds. - # - # @overload list_rollout_kinds(request, options = nil) - # Pass arguments to `list_rollout_kinds` via a request object, either of type - # {::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::ListRolloutKindsRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::ListRolloutKindsRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_rollout_kinds(parent: nil, page_size: nil, page_token: nil, filter: nil, order_by: nil) - # Pass arguments to `list_rollout_kinds` via keyword arguments. Note that at - # least one keyword argument is 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 of the rollout kind. - # @param page_size [::Integer] - # The maximum number of rollout kinds to send per page. - # @param page_token [::String] - # The page token: If the next_page_token from a previous response - # is provided, this request will send the subsequent page. - # @param filter [::String] - # Filter the list as specified in https://google.aip.dev/160. - # @param order_by [::String] - # Order results as specified in https://google.aip.dev/132. - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Gapic::PagedEnumerable<::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::RolloutKind>] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Gapic::PagedEnumerable<::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::RolloutKind>] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/cloud/saas_platform/saas_service_mgmt/v1beta1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::SaasRollouts::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::ListRolloutKindsRequest.new - # - # # Call the list_rollout_kinds method. - # result = client.list_rollout_kinds request - # - # # The returned object is of type Gapic::PagedEnumerable. You can iterate - # # over elements, and API calls will be issued to fetch pages as needed. - # result.each do |item| - # # Each element is of type ::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::RolloutKind. - # p item - # end - # - def list_rollout_kinds request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::ListRolloutKindsRequest - - # Converts hash 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_rollout_kinds.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::SaasPlatform::SaasServiceMgmt::V1beta1::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_rollout_kinds.timeout, - metadata: metadata, - retry_policy: @config.rpcs.list_rollout_kinds.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @saas_rollouts_stub.call_rpc :list_rollout_kinds, request, options: options do |response, operation| - response = ::Gapic::PagedEnumerable.new @saas_rollouts_stub, :list_rollout_kinds, 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 - - ## - # Retrieve a single rollout kind. - # - # @overload get_rollout_kind(request, options = nil) - # Pass arguments to `get_rollout_kind` via a request object, either of type - # {::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::GetRolloutKindRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::GetRolloutKindRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_rollout_kind(name: nil) - # Pass arguments to `get_rollout_kind` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param name [::String] - # Required. The resource name of the resource within a service. - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::RolloutKind] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::RolloutKind] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/cloud/saas_platform/saas_service_mgmt/v1beta1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::SaasRollouts::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::GetRolloutKindRequest.new - # - # # Call the get_rollout_kind method. - # result = client.get_rollout_kind request - # - # # The returned object is of type Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::RolloutKind. - # p result - # - def get_rollout_kind request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::GetRolloutKindRequest - - # Converts hash 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_rollout_kind.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::SaasPlatform::SaasServiceMgmt::V1beta1::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_rollout_kind.timeout, - metadata: metadata, - retry_policy: @config.rpcs.get_rollout_kind.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @saas_rollouts_stub.call_rpc :get_rollout_kind, 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 - - ## - # Create a new rollout kind. - # - # @overload create_rollout_kind(request, options = nil) - # Pass arguments to `create_rollout_kind` via a request object, either of type - # {::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::CreateRolloutKindRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::CreateRolloutKindRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_rollout_kind(parent: nil, rollout_kind_id: nil, rollout_kind: nil, validate_only: nil, request_id: nil) - # Pass arguments to `create_rollout_kind` via keyword arguments. Note that at - # least one keyword argument is 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 of the rollout kind. - # @param rollout_kind_id [::String] - # Required. The ID value for the new rollout kind. - # @param rollout_kind [::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::RolloutKind, ::Hash] - # Required. The desired state for the rollout kind. - # @param validate_only [::Boolean] - # If "validate_only" is set to true, the service will try to validate - # that this request would succeed, but will not actually make changes. - # @param request_id [::String] - # An optional request ID to identify requests. Specify a unique request ID - # so that if you must retry your request, the server will know to ignore - # the request if it has already been completed. The server will guarantee - # that for at least 60 minutes since the first request. - # - # For example, consider a situation where you make an initial request and the - # request times out. If you make the request again with the same request - # ID, the server can check if original operation with the same request ID - # was received, and if so, will ignore the second request. This prevents - # clients from accidentally creating duplicate commitments. - # - # The request ID must be a valid UUID with the exception that zero UUID is - # not supported (00000000-0000-0000-0000-000000000000). - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::RolloutKind] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::RolloutKind] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/cloud/saas_platform/saas_service_mgmt/v1beta1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::SaasRollouts::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::CreateRolloutKindRequest.new - # - # # Call the create_rollout_kind method. - # result = client.create_rollout_kind request - # - # # The returned object is of type Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::RolloutKind. - # p result - # - def create_rollout_kind request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::CreateRolloutKindRequest - - # Converts hash 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_rollout_kind.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::SaasPlatform::SaasServiceMgmt::V1beta1::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_rollout_kind.timeout, - metadata: metadata, - retry_policy: @config.rpcs.create_rollout_kind.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @saas_rollouts_stub.call_rpc :create_rollout_kind, 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 - - ## - # Update a single rollout kind. - # - # @overload update_rollout_kind(request, options = nil) - # Pass arguments to `update_rollout_kind` via a request object, either of type - # {::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::UpdateRolloutKindRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::UpdateRolloutKindRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_rollout_kind(rollout_kind: nil, validate_only: nil, request_id: nil, update_mask: nil) - # Pass arguments to `update_rollout_kind` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param rollout_kind [::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::RolloutKind, ::Hash] - # Required. The desired state for the rollout kind. - # @param validate_only [::Boolean] - # If "validate_only" is set to true, the service will try to validate - # that this request would succeed, but will not actually make changes. - # @param request_id [::String] - # An optional request ID to identify requests. Specify a unique request ID - # so that if you must retry your request, the server will know to ignore - # the request if it has already been completed. The server will guarantee - # that for at least 60 minutes since the first request. - # - # For example, consider a situation where you make an initial request and the - # request times out. If you make the request again with the same request - # ID, the server can check if original operation with the same request ID - # was received, and if so, will ignore the second request. This prevents - # clients from accidentally creating duplicate commitments. - # - # The request ID must be a valid UUID with the exception that zero UUID is - # not supported (00000000-0000-0000-0000-000000000000). - # @param update_mask [::Google::Protobuf::FieldMask, ::Hash] - # Field mask is used to specify the fields to be overwritten in the - # RolloutKind resource by the update. - # - # The fields specified in the update_mask are relative to the resource, not - # the full request. A field will be overwritten if it is in the mask. - # - # If the user does not provide a mask then all fields in the - # RolloutKind will be overwritten. - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::RolloutKind] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::RolloutKind] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/cloud/saas_platform/saas_service_mgmt/v1beta1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::SaasRollouts::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::UpdateRolloutKindRequest.new - # - # # Call the update_rollout_kind method. - # result = client.update_rollout_kind request - # - # # The returned object is of type Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::RolloutKind. - # p result - # - def update_rollout_kind request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::UpdateRolloutKindRequest - - # Converts hash 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_rollout_kind.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::SaasPlatform::SaasServiceMgmt::V1beta1::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.rollout_kind&.name - header_params["rollout_kind.name"] = request.rollout_kind.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_rollout_kind.timeout, - metadata: metadata, - retry_policy: @config.rpcs.update_rollout_kind.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @saas_rollouts_stub.call_rpc :update_rollout_kind, 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 - - ## - # Delete a single rollout kind. - # - # @overload delete_rollout_kind(request, options = nil) - # Pass arguments to `delete_rollout_kind` via a request object, either of type - # {::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::DeleteRolloutKindRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::DeleteRolloutKindRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_rollout_kind(name: nil, etag: nil, validate_only: nil, request_id: nil) - # Pass arguments to `delete_rollout_kind` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param name [::String] - # Required. The resource name of the resource within a service. - # @param etag [::String] - # The etag known to the client for the expected state of the rollout kind. - # This is used with state-changing methods to prevent accidental overwrites - # when multiple user agents might be acting in parallel on the same resource. - # - # An etag wildcard provide optimistic concurrency based on the expected - # existence of the rollout kind. The Any wildcard (`*`) requires that the - # resource must already exists, and the Not Any wildcard (`!*`) requires that - # it must not. - # @param validate_only [::Boolean] - # If "validate_only" is set to true, the service will try to validate - # that this request would succeed, but will not actually make changes. - # @param request_id [::String] - # An optional request ID to identify requests. Specify a unique request ID - # so that if you must retry your request, the server will know to ignore - # the request if it has already been completed. The server will guarantee - # that for at least 60 minutes since the first request. - # - # For example, consider a situation where you make an initial request and the - # request times out. If you make the request again with the same request - # ID, the server can check if original operation with the same request ID - # was received, and if so, will ignore the second request. This prevents - # clients from accidentally creating duplicate commitments. - # - # The request ID must be a valid UUID with the exception that zero UUID is - # not supported (00000000-0000-0000-0000-000000000000). - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Google::Protobuf::Empty] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Google::Protobuf::Empty] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/cloud/saas_platform/saas_service_mgmt/v1beta1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::SaasRollouts::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::DeleteRolloutKindRequest.new - # - # # Call the delete_rollout_kind method. - # result = client.delete_rollout_kind request - # - # # The returned object is of type Google::Protobuf::Empty. - # p result - # - def delete_rollout_kind request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::DeleteRolloutKindRequest - - # Converts hash 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_rollout_kind.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::SaasPlatform::SaasServiceMgmt::V1beta1::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_rollout_kind.timeout, - metadata: metadata, - retry_policy: @config.rpcs.delete_rollout_kind.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @saas_rollouts_stub.call_rpc :delete_rollout_kind, request, options: options do |response, operation| - yield response, operation if block_given? - end - rescue ::GRPC::BadStatus => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Configuration class for the SaasRollouts API. - # - # This class represents the configuration for SaasRollouts, - # providing control over timeouts, retry behavior, logging, transport - # parameters, and other low-level controls. Certain parameters can also be - # applied individually to specific RPCs. See - # {::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::SaasRollouts::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_rollouts to 20 seconds, - # # and all remaining timeouts to 10 seconds. - # ::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::SaasRollouts::Client.configure do |config| - # config.timeout = 10.0 - # config.rpcs.list_rollouts.timeout = 20.0 - # end - # - # # Apply the above configuration only to a new client. - # client = ::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::SaasRollouts::Client.new do |config| - # config.timeout = 10.0 - # config.rpcs.list_rollouts.timeout = 20.0 - # end - # - # @!attribute [rw] endpoint - # A custom service endpoint, as a hostname or hostname:port. The default is - # nil, indicating to use the default endpoint in the current universe domain. - # @return [::String,nil] - # @!attribute [rw] credentials - # Credentials to send with calls. You may provide any of the following types: - # * (`Google::Auth::Credentials`) A googleauth credentials object - # (see the [googleauth docs](https://rubydoc.info/gems/googleauth/Google/Auth/Credentials)) - # * (`Signet::OAuth2::Client`) A signet oauth2 client object - # (see the [signet docs](https://rubydoc.info/gems/signet/Signet/OAuth2/Client)) - # * (`GRPC::Core::Channel`) a gRPC channel with included credentials - # * (`GRPC::Core::ChannelCredentials`) a gRPC credentails object - # * (`nil`) indicating no credentials - # - # @note Warning: Passing a `String` to a keyfile path or a `Hash` of credentials - # is deprecated. Providing an unvalidated credential configuration to - # Google APIs can compromise the security of your systems and data. - # - # @example - # - # # The recommended way to provide credentials is to use the `make_creds` method - # # on the appropriate credentials class for your environment. - # - # require "googleauth" - # - # credentials = ::Google::Auth::ServiceAccountCredentials.make_creds( - # json_key_io: ::File.open("/path/to/keyfile.json") - # ) - # - # client = ::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::SaasRollouts::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 = "saasservicemgmt.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 SaasRollouts 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_rollouts` - # @return [::Gapic::Config::Method] - # - attr_reader :list_rollouts - ## - # RPC-specific configuration for `get_rollout` - # @return [::Gapic::Config::Method] - # - attr_reader :get_rollout - ## - # RPC-specific configuration for `create_rollout` - # @return [::Gapic::Config::Method] - # - attr_reader :create_rollout - ## - # RPC-specific configuration for `update_rollout` - # @return [::Gapic::Config::Method] - # - attr_reader :update_rollout - ## - # RPC-specific configuration for `delete_rollout` - # @return [::Gapic::Config::Method] - # - attr_reader :delete_rollout - ## - # RPC-specific configuration for `list_rollout_kinds` - # @return [::Gapic::Config::Method] - # - attr_reader :list_rollout_kinds - ## - # RPC-specific configuration for `get_rollout_kind` - # @return [::Gapic::Config::Method] - # - attr_reader :get_rollout_kind - ## - # RPC-specific configuration for `create_rollout_kind` - # @return [::Gapic::Config::Method] - # - attr_reader :create_rollout_kind - ## - # RPC-specific configuration for `update_rollout_kind` - # @return [::Gapic::Config::Method] - # - attr_reader :update_rollout_kind - ## - # RPC-specific configuration for `delete_rollout_kind` - # @return [::Gapic::Config::Method] - # - attr_reader :delete_rollout_kind - - # @private - def initialize parent_rpcs = nil - list_rollouts_config = parent_rpcs.list_rollouts if parent_rpcs.respond_to? :list_rollouts - @list_rollouts = ::Gapic::Config::Method.new list_rollouts_config - get_rollout_config = parent_rpcs.get_rollout if parent_rpcs.respond_to? :get_rollout - @get_rollout = ::Gapic::Config::Method.new get_rollout_config - create_rollout_config = parent_rpcs.create_rollout if parent_rpcs.respond_to? :create_rollout - @create_rollout = ::Gapic::Config::Method.new create_rollout_config - update_rollout_config = parent_rpcs.update_rollout if parent_rpcs.respond_to? :update_rollout - @update_rollout = ::Gapic::Config::Method.new update_rollout_config - delete_rollout_config = parent_rpcs.delete_rollout if parent_rpcs.respond_to? :delete_rollout - @delete_rollout = ::Gapic::Config::Method.new delete_rollout_config - list_rollout_kinds_config = parent_rpcs.list_rollout_kinds if parent_rpcs.respond_to? :list_rollout_kinds - @list_rollout_kinds = ::Gapic::Config::Method.new list_rollout_kinds_config - get_rollout_kind_config = parent_rpcs.get_rollout_kind if parent_rpcs.respond_to? :get_rollout_kind - @get_rollout_kind = ::Gapic::Config::Method.new get_rollout_kind_config - create_rollout_kind_config = parent_rpcs.create_rollout_kind if parent_rpcs.respond_to? :create_rollout_kind - @create_rollout_kind = ::Gapic::Config::Method.new create_rollout_kind_config - update_rollout_kind_config = parent_rpcs.update_rollout_kind if parent_rpcs.respond_to? :update_rollout_kind - @update_rollout_kind = ::Gapic::Config::Method.new update_rollout_kind_config - delete_rollout_kind_config = parent_rpcs.delete_rollout_kind if parent_rpcs.respond_to? :delete_rollout_kind - @delete_rollout_kind = ::Gapic::Config::Method.new delete_rollout_kind_config - - yield self if block_given? - end - end - end - end - end - end - end - end - end -end diff --git a/owl-bot-staging/google-cloud-saas_platform-saas_service_mgmt-v1beta1/lib/google/cloud/saas_platform/saas_service_mgmt/v1beta1/saas_rollouts/credentials.rb b/owl-bot-staging/google-cloud-saas_platform-saas_service_mgmt-v1beta1/lib/google/cloud/saas_platform/saas_service_mgmt/v1beta1/saas_rollouts/credentials.rb deleted file mode 100644 index 120f664d6639..000000000000 --- a/owl-bot-staging/google-cloud-saas_platform-saas_service_mgmt-v1beta1/lib/google/cloud/saas_platform/saas_service_mgmt/v1beta1/saas_rollouts/credentials.rb +++ /dev/null @@ -1,49 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -require "googleauth" - -module Google - module Cloud - module SaasPlatform - module SaasServiceMgmt - module V1beta1 - module SaasRollouts - # Credentials for the SaasRollouts API. - class Credentials < ::Google::Auth::Credentials - self.scope = [ - "https://www.googleapis.com/auth/cloud-platform" - ] - self.env_vars = [ - "GOOGLE_CLOUD_CREDENTIALS", - "GOOGLE_CLOUD_KEYFILE", - "GCLOUD_KEYFILE", - "GOOGLE_CLOUD_CREDENTIALS_JSON", - "GOOGLE_CLOUD_KEYFILE_JSON", - "GCLOUD_KEYFILE_JSON" - ] - self.paths = [ - "~/.config/google_cloud/application_default_credentials.json" - ] - end - end - end - end - end - end -end diff --git a/owl-bot-staging/google-cloud-saas_platform-saas_service_mgmt-v1beta1/lib/google/cloud/saas_platform/saas_service_mgmt/v1beta1/saas_rollouts/paths.rb b/owl-bot-staging/google-cloud-saas_platform-saas_service_mgmt-v1beta1/lib/google/cloud/saas_platform/saas_service_mgmt/v1beta1/saas_rollouts/paths.rb deleted file mode 100644 index 3e94a7b7305c..000000000000 --- a/owl-bot-staging/google-cloud-saas_platform-saas_service_mgmt-v1beta1/lib/google/cloud/saas_platform/saas_service_mgmt/v1beta1/saas_rollouts/paths.rb +++ /dev/null @@ -1,128 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - - -module Google - module Cloud - module SaasPlatform - module SaasServiceMgmt - module V1beta1 - module SaasRollouts - # Path helper methods for the SaasRollouts API. - module Paths - ## - # Create a fully-qualified Location resource string. - # - # The resource will be in the following format: - # - # `projects/{project}/locations/{location}` - # - # @param project [String] - # @param location [String] - # - # @return [::String] - def location_path project:, location: - raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" - - "projects/#{project}/locations/#{location}" - end - - ## - # Create a fully-qualified Release resource string. - # - # The resource will be in the following format: - # - # `projects/{project}/locations/{location}/releases/{release}` - # - # @param project [String] - # @param location [String] - # @param release [String] - # - # @return [::String] - def release_path project:, location:, release: - raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" - raise ::ArgumentError, "location cannot contain /" if location.to_s.include? "/" - - "projects/#{project}/locations/#{location}/releases/#{release}" - end - - ## - # Create a fully-qualified Rollout resource string. - # - # The resource will be in the following format: - # - # `projects/{project}/locations/{location}/rollouts/{rollout_id}` - # - # @param project [String] - # @param location [String] - # @param rollout_id [String] - # - # @return [::String] - def rollout_path project:, location:, rollout_id: - raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" - raise ::ArgumentError, "location cannot contain /" if location.to_s.include? "/" - - "projects/#{project}/locations/#{location}/rollouts/#{rollout_id}" - end - - ## - # Create a fully-qualified RolloutKind resource string. - # - # The resource will be in the following format: - # - # `projects/{project}/locations/{location}/rolloutKinds/{rollout_kind_id}` - # - # @param project [String] - # @param location [String] - # @param rollout_kind_id [String] - # - # @return [::String] - def rollout_kind_path project:, location:, rollout_kind_id: - raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" - raise ::ArgumentError, "location cannot contain /" if location.to_s.include? "/" - - "projects/#{project}/locations/#{location}/rolloutKinds/#{rollout_kind_id}" - end - - ## - # Create a fully-qualified UnitKind resource string. - # - # The resource will be in the following format: - # - # `projects/{project}/locations/{location}/unitKinds/{unit_kind}` - # - # @param project [String] - # @param location [String] - # @param unit_kind [String] - # - # @return [::String] - def unit_kind_path project:, location:, unit_kind: - raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" - raise ::ArgumentError, "location cannot contain /" if location.to_s.include? "/" - - "projects/#{project}/locations/#{location}/unitKinds/#{unit_kind}" - end - - extend self - end - end - end - end - end - end -end diff --git a/owl-bot-staging/google-cloud-saas_platform-saas_service_mgmt-v1beta1/lib/google/cloud/saas_platform/saas_service_mgmt/v1beta1/saas_rollouts/rest.rb b/owl-bot-staging/google-cloud-saas_platform-saas_service_mgmt-v1beta1/lib/google/cloud/saas_platform/saas_service_mgmt/v1beta1/saas_rollouts/rest.rb deleted file mode 100644 index d93824138b96..000000000000 --- a/owl-bot-staging/google-cloud-saas_platform-saas_service_mgmt-v1beta1/lib/google/cloud/saas_platform/saas_service_mgmt/v1beta1/saas_rollouts/rest.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/rest" -require "gapic/config" -require "gapic/config/method" - -require "google/cloud/saas_platform/saas_service_mgmt/v1beta1/version" -require "google/cloud/saas_platform/saas_service_mgmt/v1beta1/bindings_override" - -require "google/cloud/saas_platform/saas_service_mgmt/v1beta1/saas_rollouts/credentials" -require "google/cloud/saas_platform/saas_service_mgmt/v1beta1/saas_rollouts/paths" -require "google/cloud/saas_platform/saas_service_mgmt/v1beta1/saas_rollouts/rest/client" - -module Google - module Cloud - module SaasPlatform - module SaasServiceMgmt - module V1beta1 - ## - # Manages the rollout of SaaS services. - # - # To load this service and instantiate a REST client: - # - # require "google/cloud/saas_platform/saas_service_mgmt/v1beta1/saas_rollouts/rest" - # client = ::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::SaasRollouts::Rest::Client.new - # - module SaasRollouts - # Client for the REST transport - module Rest - end - end - end - end - end - end -end - -helper_path = ::File.join __dir__, "rest", "helpers.rb" -require "google/cloud/saas_platform/saas_service_mgmt/v1beta1/saas_rollouts/rest/helpers" if ::File.file? helper_path diff --git a/owl-bot-staging/google-cloud-saas_platform-saas_service_mgmt-v1beta1/lib/google/cloud/saas_platform/saas_service_mgmt/v1beta1/saas_rollouts/rest/client.rb b/owl-bot-staging/google-cloud-saas_platform-saas_service_mgmt-v1beta1/lib/google/cloud/saas_platform/saas_service_mgmt/v1beta1/saas_rollouts/rest/client.rb deleted file mode 100644 index 9b51fa8ce98a..000000000000 --- a/owl-bot-staging/google-cloud-saas_platform-saas_service_mgmt-v1beta1/lib/google/cloud/saas_platform/saas_service_mgmt/v1beta1/saas_rollouts/rest/client.rb +++ /dev/null @@ -1,1429 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -require "google/cloud/errors" -require "google/cloud/saasplatform/saasservicemgmt/v1beta1/rollouts_service_pb" -require "google/cloud/saas_platform/saas_service_mgmt/v1beta1/saas_rollouts/rest/service_stub" -require "google/cloud/location/rest" - -module Google - module Cloud - module SaasPlatform - module SaasServiceMgmt - module V1beta1 - module SaasRollouts - module Rest - ## - # REST client for the SaasRollouts service. - # - # Manages the rollout of SaaS services. - # - class Client - # @private - API_VERSION = "" - - # @private - DEFAULT_ENDPOINT_TEMPLATE = "saasservicemgmt.$UNIVERSE_DOMAIN$" - - include Paths - - # @private - attr_reader :saas_rollouts_stub - - ## - # Configure the SaasRollouts Client class. - # - # See {::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::SaasRollouts::Rest::Client::Configuration} - # for a description of the configuration fields. - # - # @example - # - # # Modify the configuration for all SaasRollouts clients - # ::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::SaasRollouts::Rest::Client.configure do |config| - # config.timeout = 10.0 - # end - # - # @yield [config] Configure the Client client. - # @yieldparam config [Client::Configuration] - # - # @return [Client::Configuration] - # - def self.configure - @configure ||= begin - namespace = ["Google", "Cloud", "SaasPlatform", "SaasServiceMgmt", "V1beta1"] - parent_config = while namespace.any? - parent_name = namespace.join "::" - parent_const = const_get parent_name - break parent_const.configure if parent_const.respond_to? :configure - namespace.pop - end - default_config = Client::Configuration.new parent_config - - default_config.rpcs.list_rollouts.timeout = 60.0 - default_config.rpcs.list_rollouts.retry_policy = { - initial_delay: 1.0, max_delay: 10.0, multiplier: 1.3, retry_codes: [14] - } - - default_config.rpcs.get_rollout.timeout = 60.0 - default_config.rpcs.get_rollout.retry_policy = { - initial_delay: 1.0, max_delay: 10.0, multiplier: 1.3, retry_codes: [14] - } - - default_config.rpcs.create_rollout.timeout = 60.0 - - default_config.rpcs.update_rollout.timeout = 60.0 - - default_config.rpcs.delete_rollout.timeout = 540.0 - default_config.rpcs.delete_rollout.retry_policy = { - initial_delay: 1.0, max_delay: 10.0, multiplier: 1.3, retry_codes: [14] - } - - default_config.rpcs.list_rollout_kinds.timeout = 60.0 - default_config.rpcs.list_rollout_kinds.retry_policy = { - initial_delay: 1.0, max_delay: 10.0, multiplier: 1.3, retry_codes: [14] - } - - default_config.rpcs.get_rollout_kind.timeout = 60.0 - default_config.rpcs.get_rollout_kind.retry_policy = { - initial_delay: 1.0, max_delay: 10.0, multiplier: 1.3, retry_codes: [14] - } - - default_config.rpcs.create_rollout_kind.timeout = 60.0 - - default_config.rpcs.update_rollout_kind.timeout = 60.0 - - default_config.rpcs.delete_rollout_kind.timeout = 60.0 - default_config.rpcs.delete_rollout_kind.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 SaasRollouts Client instance. - # - # The configuration is set to the derived mode, meaning that values can be changed, - # but structural changes (adding new fields, etc.) are not allowed. Structural changes - # should be made on {Client.configure}. - # - # See {::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::SaasRollouts::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 - @saas_rollouts_stub.universe_domain - end - - ## - # Create a new SaasRollouts REST client object. - # - # @example - # - # # Create a client using the default configuration - # client = ::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::SaasRollouts::Rest::Client.new - # - # # Create a client using a custom configuration - # client = ::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::SaasRollouts::Rest::Client.new do |config| - # config.timeout = 10.0 - # end - # - # @yield [config] Configure the SaasRollouts 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 - - @saas_rollouts_stub = ::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::SaasRollouts::Rest::ServiceStub.new( - endpoint: @config.endpoint, - endpoint_template: DEFAULT_ENDPOINT_TEMPLATE, - universe_domain: @config.universe_domain, - credentials: credentials, - logger: @config.logger - ) - - @saas_rollouts_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 = @saas_rollouts_stub.endpoint - config.universe_domain = @saas_rollouts_stub.universe_domain - config.bindings_override = @config.bindings_override - config.logger = @saas_rollouts_stub.logger if config.respond_to? :logger= - end - end - - ## - # Get the associated client for mix-in of the Locations. - # - # @return [Google::Cloud::Location::Locations::Rest::Client] - # - attr_reader :location_client - - ## - # The logger used for request/response debug logging. - # - # @return [Logger] - # - def logger - @saas_rollouts_stub.logger - end - - # Service calls - - ## - # Retrieve a collection of rollouts. - # - # @overload list_rollouts(request, options = nil) - # Pass arguments to `list_rollouts` via a request object, either of type - # {::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::ListRolloutsRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::ListRolloutsRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_rollouts(parent: nil, page_size: nil, page_token: nil, filter: nil, order_by: nil) - # Pass arguments to `list_rollouts` via keyword arguments. Note that at - # least one keyword argument is 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 of the rollout. - # @param page_size [::Integer] - # The maximum number of rollouts to send per page. - # @param page_token [::String] - # The page token: If the next_page_token from a previous response - # is provided, this request will send the subsequent page. - # @param filter [::String] - # Filter the list as specified in https://google.aip.dev/160. - # @param order_by [::String] - # Order results as specified in https://google.aip.dev/132. - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Gapic::Rest::PagedEnumerable<::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::Rollout>] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Gapic::Rest::PagedEnumerable<::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::Rollout>] - # - # @raise [::Google::Cloud::Error] if the REST call is aborted. - # - # @example Basic example - # require "google/cloud/saas_platform/saas_service_mgmt/v1beta1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::SaasRollouts::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::ListRolloutsRequest.new - # - # # Call the list_rollouts method. - # result = client.list_rollouts request - # - # # The returned object is of type Gapic::PagedEnumerable. You can iterate - # # over elements, and API calls will be issued to fetch pages as needed. - # result.each do |item| - # # Each element is of type ::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::Rollout. - # p item - # end - # - def list_rollouts request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::ListRolloutsRequest - - # Converts hash 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_rollouts.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::SaasPlatform::SaasServiceMgmt::V1beta1::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_rollouts.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.list_rollouts.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @saas_rollouts_stub.list_rollouts request, options do |result, operation| - result = ::Gapic::Rest::PagedEnumerable.new @saas_rollouts_stub, :list_rollouts, "rollouts", 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 - - ## - # Retrieve a single rollout. - # - # @overload get_rollout(request, options = nil) - # Pass arguments to `get_rollout` via a request object, either of type - # {::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::GetRolloutRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::GetRolloutRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_rollout(name: nil) - # Pass arguments to `get_rollout` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param name [::String] - # Required. The resource name of the resource within a service. - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::Rollout] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::Rollout] - # - # @raise [::Google::Cloud::Error] if the REST call is aborted. - # - # @example Basic example - # require "google/cloud/saas_platform/saas_service_mgmt/v1beta1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::SaasRollouts::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::GetRolloutRequest.new - # - # # Call the get_rollout method. - # result = client.get_rollout request - # - # # The returned object is of type Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::Rollout. - # p result - # - def get_rollout request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::GetRolloutRequest - - # Converts hash 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_rollout.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::SaasPlatform::SaasServiceMgmt::V1beta1::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_rollout.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.get_rollout.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @saas_rollouts_stub.get_rollout 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 - - ## - # Create a new rollout. - # - # @overload create_rollout(request, options = nil) - # Pass arguments to `create_rollout` via a request object, either of type - # {::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::CreateRolloutRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::CreateRolloutRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_rollout(parent: nil, rollout_id: nil, rollout: nil, validate_only: nil, request_id: nil) - # Pass arguments to `create_rollout` via keyword arguments. Note that at - # least one keyword argument is 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 of the rollout. - # @param rollout_id [::String] - # Required. The ID value for the new rollout. - # @param rollout [::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::Rollout, ::Hash] - # Required. The desired state for the rollout. - # @param validate_only [::Boolean] - # If "validate_only" is set to true, the service will try to validate - # that this request would succeed, but will not actually make changes. - # @param request_id [::String] - # An optional request ID to identify requests. Specify a unique request ID - # so that if you must retry your request, the server will know to ignore - # the request if it has already been completed. The server will guarantee - # that for at least 60 minutes since the first request. - # - # For example, consider a situation where you make an initial request and the - # request times out. If you make the request again with the same request - # ID, the server can check if original operation with the same request ID - # was received, and if so, will ignore the second request. This prevents - # clients from accidentally creating duplicate commitments. - # - # The request ID must be a valid UUID with the exception that zero UUID is - # not supported (00000000-0000-0000-0000-000000000000). - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::Rollout] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::Rollout] - # - # @raise [::Google::Cloud::Error] if the REST call is aborted. - # - # @example Basic example - # require "google/cloud/saas_platform/saas_service_mgmt/v1beta1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::SaasRollouts::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::CreateRolloutRequest.new - # - # # Call the create_rollout method. - # result = client.create_rollout request - # - # # The returned object is of type Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::Rollout. - # p result - # - def create_rollout request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::CreateRolloutRequest - - # Converts hash 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_rollout.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::SaasPlatform::SaasServiceMgmt::V1beta1::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_rollout.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.create_rollout.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @saas_rollouts_stub.create_rollout 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 - - ## - # Update a single rollout. - # - # @overload update_rollout(request, options = nil) - # Pass arguments to `update_rollout` via a request object, either of type - # {::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::UpdateRolloutRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::UpdateRolloutRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_rollout(rollout: nil, validate_only: nil, request_id: nil, update_mask: nil) - # Pass arguments to `update_rollout` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param rollout [::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::Rollout, ::Hash] - # Required. The desired state for the rollout. - # @param validate_only [::Boolean] - # If "validate_only" is set to true, the service will try to validate - # that this request would succeed, but will not actually make changes. - # @param request_id [::String] - # An optional request ID to identify requests. Specify a unique request ID - # so that if you must retry your request, the server will know to ignore - # the request if it has already been completed. The server will guarantee - # that for at least 60 minutes since the first request. - # - # For example, consider a situation where you make an initial request and the - # request times out. If you make the request again with the same request - # ID, the server can check if original operation with the same request ID - # was received, and if so, will ignore the second request. This prevents - # clients from accidentally creating duplicate commitments. - # - # The request ID must be a valid UUID with the exception that zero UUID is - # not supported (00000000-0000-0000-0000-000000000000). - # @param update_mask [::Google::Protobuf::FieldMask, ::Hash] - # Field mask is used to specify the fields to be overwritten in the - # Rollout resource by the update. - # - # The fields specified in the update_mask are relative to the resource, not - # the full request. A field will be overwritten if it is in the mask. - # - # If the user does not provide a mask then all fields in the - # Rollout will be overwritten. - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::Rollout] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::Rollout] - # - # @raise [::Google::Cloud::Error] if the REST call is aborted. - # - # @example Basic example - # require "google/cloud/saas_platform/saas_service_mgmt/v1beta1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::SaasRollouts::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::UpdateRolloutRequest.new - # - # # Call the update_rollout method. - # result = client.update_rollout request - # - # # The returned object is of type Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::Rollout. - # p result - # - def update_rollout request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::UpdateRolloutRequest - - # Converts hash 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_rollout.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::SaasPlatform::SaasServiceMgmt::V1beta1::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_rollout.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.update_rollout.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @saas_rollouts_stub.update_rollout 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 - - ## - # Delete a single rollout. - # - # @overload delete_rollout(request, options = nil) - # Pass arguments to `delete_rollout` via a request object, either of type - # {::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::DeleteRolloutRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::DeleteRolloutRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_rollout(name: nil, etag: nil, validate_only: nil, request_id: nil) - # Pass arguments to `delete_rollout` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param name [::String] - # Required. The resource name of the resource within a service. - # @param etag [::String] - # The etag known to the client for the expected state of the rollout. This is - # used with state-changing methods to prevent accidental overwrites when - # multiple user agents might be acting in parallel on the same resource. - # - # An etag wildcard provide optimistic concurrency based on the expected - # existence of the rollout. The Any wildcard (`*`) requires that the resource - # must already exists, and the Not Any wildcard (`!*`) requires that it must - # not. - # @param validate_only [::Boolean] - # If "validate_only" is set to true, the service will try to validate - # that this request would succeed, but will not actually make changes. - # @param request_id [::String] - # An optional request ID to identify requests. Specify a unique request ID - # so that if you must retry your request, the server will know to ignore - # the request if it has already been completed. The server will guarantee - # that for at least 60 minutes since the first request. - # - # For example, consider a situation where you make an initial request and the - # request times out. If you make the request again with the same request - # ID, the server can check if original operation with the same request ID - # was received, and if so, will ignore the second request. This prevents - # clients from accidentally creating duplicate commitments. - # - # The request ID must be a valid UUID with the exception that zero UUID is - # not supported (00000000-0000-0000-0000-000000000000). - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Protobuf::Empty] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Protobuf::Empty] - # - # @raise [::Google::Cloud::Error] if the REST call is aborted. - # - # @example Basic example - # require "google/cloud/saas_platform/saas_service_mgmt/v1beta1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::SaasRollouts::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::DeleteRolloutRequest.new - # - # # Call the delete_rollout method. - # result = client.delete_rollout request - # - # # The returned object is of type Google::Protobuf::Empty. - # p result - # - def delete_rollout request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::DeleteRolloutRequest - - # Converts hash 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_rollout.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::SaasPlatform::SaasServiceMgmt::V1beta1::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_rollout.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.delete_rollout.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @saas_rollouts_stub.delete_rollout 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 - - ## - # Retrieve a collection of rollout kinds. - # - # @overload list_rollout_kinds(request, options = nil) - # Pass arguments to `list_rollout_kinds` via a request object, either of type - # {::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::ListRolloutKindsRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::ListRolloutKindsRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_rollout_kinds(parent: nil, page_size: nil, page_token: nil, filter: nil, order_by: nil) - # Pass arguments to `list_rollout_kinds` via keyword arguments. Note that at - # least one keyword argument is 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 of the rollout kind. - # @param page_size [::Integer] - # The maximum number of rollout kinds to send per page. - # @param page_token [::String] - # The page token: If the next_page_token from a previous response - # is provided, this request will send the subsequent page. - # @param filter [::String] - # Filter the list as specified in https://google.aip.dev/160. - # @param order_by [::String] - # Order results as specified in https://google.aip.dev/132. - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Gapic::Rest::PagedEnumerable<::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::RolloutKind>] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Gapic::Rest::PagedEnumerable<::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::RolloutKind>] - # - # @raise [::Google::Cloud::Error] if the REST call is aborted. - # - # @example Basic example - # require "google/cloud/saas_platform/saas_service_mgmt/v1beta1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::SaasRollouts::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::ListRolloutKindsRequest.new - # - # # Call the list_rollout_kinds method. - # result = client.list_rollout_kinds request - # - # # The returned object is of type Gapic::PagedEnumerable. You can iterate - # # over elements, and API calls will be issued to fetch pages as needed. - # result.each do |item| - # # Each element is of type ::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::RolloutKind. - # p item - # end - # - def list_rollout_kinds request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::ListRolloutKindsRequest - - # Converts hash 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_rollout_kinds.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::SaasPlatform::SaasServiceMgmt::V1beta1::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_rollout_kinds.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.list_rollout_kinds.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @saas_rollouts_stub.list_rollout_kinds request, options do |result, operation| - result = ::Gapic::Rest::PagedEnumerable.new @saas_rollouts_stub, :list_rollout_kinds, "rollout_kinds", 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 - - ## - # Retrieve a single rollout kind. - # - # @overload get_rollout_kind(request, options = nil) - # Pass arguments to `get_rollout_kind` via a request object, either of type - # {::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::GetRolloutKindRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::GetRolloutKindRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_rollout_kind(name: nil) - # Pass arguments to `get_rollout_kind` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param name [::String] - # Required. The resource name of the resource within a service. - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::RolloutKind] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::RolloutKind] - # - # @raise [::Google::Cloud::Error] if the REST call is aborted. - # - # @example Basic example - # require "google/cloud/saas_platform/saas_service_mgmt/v1beta1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::SaasRollouts::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::GetRolloutKindRequest.new - # - # # Call the get_rollout_kind method. - # result = client.get_rollout_kind request - # - # # The returned object is of type Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::RolloutKind. - # p result - # - def get_rollout_kind request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::GetRolloutKindRequest - - # Converts hash 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_rollout_kind.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::SaasPlatform::SaasServiceMgmt::V1beta1::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_rollout_kind.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.get_rollout_kind.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @saas_rollouts_stub.get_rollout_kind 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 - - ## - # Create a new rollout kind. - # - # @overload create_rollout_kind(request, options = nil) - # Pass arguments to `create_rollout_kind` via a request object, either of type - # {::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::CreateRolloutKindRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::CreateRolloutKindRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_rollout_kind(parent: nil, rollout_kind_id: nil, rollout_kind: nil, validate_only: nil, request_id: nil) - # Pass arguments to `create_rollout_kind` via keyword arguments. Note that at - # least one keyword argument is 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 of the rollout kind. - # @param rollout_kind_id [::String] - # Required. The ID value for the new rollout kind. - # @param rollout_kind [::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::RolloutKind, ::Hash] - # Required. The desired state for the rollout kind. - # @param validate_only [::Boolean] - # If "validate_only" is set to true, the service will try to validate - # that this request would succeed, but will not actually make changes. - # @param request_id [::String] - # An optional request ID to identify requests. Specify a unique request ID - # so that if you must retry your request, the server will know to ignore - # the request if it has already been completed. The server will guarantee - # that for at least 60 minutes since the first request. - # - # For example, consider a situation where you make an initial request and the - # request times out. If you make the request again with the same request - # ID, the server can check if original operation with the same request ID - # was received, and if so, will ignore the second request. This prevents - # clients from accidentally creating duplicate commitments. - # - # The request ID must be a valid UUID with the exception that zero UUID is - # not supported (00000000-0000-0000-0000-000000000000). - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::RolloutKind] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::RolloutKind] - # - # @raise [::Google::Cloud::Error] if the REST call is aborted. - # - # @example Basic example - # require "google/cloud/saas_platform/saas_service_mgmt/v1beta1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::SaasRollouts::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::CreateRolloutKindRequest.new - # - # # Call the create_rollout_kind method. - # result = client.create_rollout_kind request - # - # # The returned object is of type Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::RolloutKind. - # p result - # - def create_rollout_kind request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::CreateRolloutKindRequest - - # Converts hash 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_rollout_kind.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::SaasPlatform::SaasServiceMgmt::V1beta1::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_rollout_kind.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.create_rollout_kind.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @saas_rollouts_stub.create_rollout_kind 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 - - ## - # Update a single rollout kind. - # - # @overload update_rollout_kind(request, options = nil) - # Pass arguments to `update_rollout_kind` via a request object, either of type - # {::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::UpdateRolloutKindRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::UpdateRolloutKindRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_rollout_kind(rollout_kind: nil, validate_only: nil, request_id: nil, update_mask: nil) - # Pass arguments to `update_rollout_kind` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param rollout_kind [::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::RolloutKind, ::Hash] - # Required. The desired state for the rollout kind. - # @param validate_only [::Boolean] - # If "validate_only" is set to true, the service will try to validate - # that this request would succeed, but will not actually make changes. - # @param request_id [::String] - # An optional request ID to identify requests. Specify a unique request ID - # so that if you must retry your request, the server will know to ignore - # the request if it has already been completed. The server will guarantee - # that for at least 60 minutes since the first request. - # - # For example, consider a situation where you make an initial request and the - # request times out. If you make the request again with the same request - # ID, the server can check if original operation with the same request ID - # was received, and if so, will ignore the second request. This prevents - # clients from accidentally creating duplicate commitments. - # - # The request ID must be a valid UUID with the exception that zero UUID is - # not supported (00000000-0000-0000-0000-000000000000). - # @param update_mask [::Google::Protobuf::FieldMask, ::Hash] - # Field mask is used to specify the fields to be overwritten in the - # RolloutKind resource by the update. - # - # The fields specified in the update_mask are relative to the resource, not - # the full request. A field will be overwritten if it is in the mask. - # - # If the user does not provide a mask then all fields in the - # RolloutKind will be overwritten. - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::RolloutKind] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::RolloutKind] - # - # @raise [::Google::Cloud::Error] if the REST call is aborted. - # - # @example Basic example - # require "google/cloud/saas_platform/saas_service_mgmt/v1beta1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::SaasRollouts::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::UpdateRolloutKindRequest.new - # - # # Call the update_rollout_kind method. - # result = client.update_rollout_kind request - # - # # The returned object is of type Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::RolloutKind. - # p result - # - def update_rollout_kind request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::UpdateRolloutKindRequest - - # Converts hash 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_rollout_kind.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::SaasPlatform::SaasServiceMgmt::V1beta1::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_rollout_kind.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.update_rollout_kind.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @saas_rollouts_stub.update_rollout_kind 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 - - ## - # Delete a single rollout kind. - # - # @overload delete_rollout_kind(request, options = nil) - # Pass arguments to `delete_rollout_kind` via a request object, either of type - # {::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::DeleteRolloutKindRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::DeleteRolloutKindRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_rollout_kind(name: nil, etag: nil, validate_only: nil, request_id: nil) - # Pass arguments to `delete_rollout_kind` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param name [::String] - # Required. The resource name of the resource within a service. - # @param etag [::String] - # The etag known to the client for the expected state of the rollout kind. - # This is used with state-changing methods to prevent accidental overwrites - # when multiple user agents might be acting in parallel on the same resource. - # - # An etag wildcard provide optimistic concurrency based on the expected - # existence of the rollout kind. The Any wildcard (`*`) requires that the - # resource must already exists, and the Not Any wildcard (`!*`) requires that - # it must not. - # @param validate_only [::Boolean] - # If "validate_only" is set to true, the service will try to validate - # that this request would succeed, but will not actually make changes. - # @param request_id [::String] - # An optional request ID to identify requests. Specify a unique request ID - # so that if you must retry your request, the server will know to ignore - # the request if it has already been completed. The server will guarantee - # that for at least 60 minutes since the first request. - # - # For example, consider a situation where you make an initial request and the - # request times out. If you make the request again with the same request - # ID, the server can check if original operation with the same request ID - # was received, and if so, will ignore the second request. This prevents - # clients from accidentally creating duplicate commitments. - # - # The request ID must be a valid UUID with the exception that zero UUID is - # not supported (00000000-0000-0000-0000-000000000000). - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Protobuf::Empty] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Protobuf::Empty] - # - # @raise [::Google::Cloud::Error] if the REST call is aborted. - # - # @example Basic example - # require "google/cloud/saas_platform/saas_service_mgmt/v1beta1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::SaasRollouts::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::DeleteRolloutKindRequest.new - # - # # Call the delete_rollout_kind method. - # result = client.delete_rollout_kind request - # - # # The returned object is of type Google::Protobuf::Empty. - # p result - # - def delete_rollout_kind request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::DeleteRolloutKindRequest - - # Converts hash 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_rollout_kind.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::SaasPlatform::SaasServiceMgmt::V1beta1::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_rollout_kind.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.delete_rollout_kind.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @saas_rollouts_stub.delete_rollout_kind 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 SaasRollouts REST API. - # - # This class represents the configuration for SaasRollouts REST, - # providing control over timeouts, retry behavior, logging, transport - # parameters, and other low-level controls. Certain parameters can also be - # applied individually to specific RPCs. See - # {::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::SaasRollouts::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_rollouts to 20 seconds, - # # and all remaining timeouts to 10 seconds. - # ::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::SaasRollouts::Rest::Client.configure do |config| - # config.timeout = 10.0 - # config.rpcs.list_rollouts.timeout = 20.0 - # end - # - # # Apply the above configuration only to a new client. - # client = ::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::SaasRollouts::Rest::Client.new do |config| - # config.timeout = 10.0 - # config.rpcs.list_rollouts.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 = "saasservicemgmt.googleapis.com" - - config_attr :endpoint, nil, ::String, nil - config_attr :credentials, nil do |value| - allowed = [::String, ::Hash, ::Proc, ::Symbol, ::Google::Auth::Credentials, ::Google::Auth::BaseClient, ::Signet::OAuth2::Client, nil] - allowed.any? { |klass| klass === value } - end - config_attr :scope, nil, ::String, ::Array, nil - config_attr :lib_name, nil, ::String, nil - config_attr :lib_version, nil, ::String, nil - config_attr :timeout, nil, ::Numeric, nil - config_attr :metadata, nil, ::Hash, nil - config_attr :retry_policy, nil, ::Hash, ::Proc, nil - config_attr :quota_project, nil, ::String, nil - config_attr :universe_domain, nil, ::String, nil - - # @private - # Overrides for http bindings for the RPCs of this service - # are only used when this service is used as mixin, and only - # by the host service. - # @return [::Hash{::Symbol=>::Array<::Gapic::Rest::GrpcTranscoder::HttpBinding>}] - config_attr :bindings_override, {}, ::Hash, nil - config_attr :logger, :default, ::Logger, nil, :default - - # @private - def initialize parent_config = nil - @parent_config = parent_config unless parent_config.nil? - - yield self if block_given? - end - - ## - # Configurations for individual RPCs - # @return [Rpcs] - # - def rpcs - @rpcs ||= begin - parent_rpcs = nil - parent_rpcs = @parent_config.rpcs if defined?(@parent_config) && @parent_config.respond_to?(:rpcs) - Rpcs.new parent_rpcs - end - end - - ## - # Configuration RPC class for the SaasRollouts 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_rollouts` - # @return [::Gapic::Config::Method] - # - attr_reader :list_rollouts - ## - # RPC-specific configuration for `get_rollout` - # @return [::Gapic::Config::Method] - # - attr_reader :get_rollout - ## - # RPC-specific configuration for `create_rollout` - # @return [::Gapic::Config::Method] - # - attr_reader :create_rollout - ## - # RPC-specific configuration for `update_rollout` - # @return [::Gapic::Config::Method] - # - attr_reader :update_rollout - ## - # RPC-specific configuration for `delete_rollout` - # @return [::Gapic::Config::Method] - # - attr_reader :delete_rollout - ## - # RPC-specific configuration for `list_rollout_kinds` - # @return [::Gapic::Config::Method] - # - attr_reader :list_rollout_kinds - ## - # RPC-specific configuration for `get_rollout_kind` - # @return [::Gapic::Config::Method] - # - attr_reader :get_rollout_kind - ## - # RPC-specific configuration for `create_rollout_kind` - # @return [::Gapic::Config::Method] - # - attr_reader :create_rollout_kind - ## - # RPC-specific configuration for `update_rollout_kind` - # @return [::Gapic::Config::Method] - # - attr_reader :update_rollout_kind - ## - # RPC-specific configuration for `delete_rollout_kind` - # @return [::Gapic::Config::Method] - # - attr_reader :delete_rollout_kind - - # @private - def initialize parent_rpcs = nil - list_rollouts_config = parent_rpcs.list_rollouts if parent_rpcs.respond_to? :list_rollouts - @list_rollouts = ::Gapic::Config::Method.new list_rollouts_config - get_rollout_config = parent_rpcs.get_rollout if parent_rpcs.respond_to? :get_rollout - @get_rollout = ::Gapic::Config::Method.new get_rollout_config - create_rollout_config = parent_rpcs.create_rollout if parent_rpcs.respond_to? :create_rollout - @create_rollout = ::Gapic::Config::Method.new create_rollout_config - update_rollout_config = parent_rpcs.update_rollout if parent_rpcs.respond_to? :update_rollout - @update_rollout = ::Gapic::Config::Method.new update_rollout_config - delete_rollout_config = parent_rpcs.delete_rollout if parent_rpcs.respond_to? :delete_rollout - @delete_rollout = ::Gapic::Config::Method.new delete_rollout_config - list_rollout_kinds_config = parent_rpcs.list_rollout_kinds if parent_rpcs.respond_to? :list_rollout_kinds - @list_rollout_kinds = ::Gapic::Config::Method.new list_rollout_kinds_config - get_rollout_kind_config = parent_rpcs.get_rollout_kind if parent_rpcs.respond_to? :get_rollout_kind - @get_rollout_kind = ::Gapic::Config::Method.new get_rollout_kind_config - create_rollout_kind_config = parent_rpcs.create_rollout_kind if parent_rpcs.respond_to? :create_rollout_kind - @create_rollout_kind = ::Gapic::Config::Method.new create_rollout_kind_config - update_rollout_kind_config = parent_rpcs.update_rollout_kind if parent_rpcs.respond_to? :update_rollout_kind - @update_rollout_kind = ::Gapic::Config::Method.new update_rollout_kind_config - delete_rollout_kind_config = parent_rpcs.delete_rollout_kind if parent_rpcs.respond_to? :delete_rollout_kind - @delete_rollout_kind = ::Gapic::Config::Method.new delete_rollout_kind_config - - yield self if block_given? - end - end - end - end - end - end - end - end - end - end -end diff --git a/owl-bot-staging/google-cloud-saas_platform-saas_service_mgmt-v1beta1/lib/google/cloud/saas_platform/saas_service_mgmt/v1beta1/saas_rollouts/rest/service_stub.rb b/owl-bot-staging/google-cloud-saas_platform-saas_service_mgmt-v1beta1/lib/google/cloud/saas_platform/saas_service_mgmt/v1beta1/saas_rollouts/rest/service_stub.rb deleted file mode 100644 index b0d0e3b97106..000000000000 --- a/owl-bot-staging/google-cloud-saas_platform-saas_service_mgmt-v1beta1/lib/google/cloud/saas_platform/saas_service_mgmt/v1beta1/saas_rollouts/rest/service_stub.rb +++ /dev/null @@ -1,697 +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/saasplatform/saasservicemgmt/v1beta1/rollouts_service_pb" - -module Google - module Cloud - module SaasPlatform - module SaasServiceMgmt - module V1beta1 - module SaasRollouts - module Rest - ## - # REST service stub for the SaasRollouts service. - # Service stub contains baseline method implementations - # including transcoding, making the REST call, and deserialing the response. - # - class ServiceStub - # @private - def initialize endpoint:, endpoint_template:, universe_domain:, credentials:, logger: - # These require statements are intentionally placed here to initialize - # the REST modules only when it's required. - require "gapic/rest" - - @client_stub = ::Gapic::Rest::ClientStub.new endpoint: endpoint, - endpoint_template: endpoint_template, - universe_domain: universe_domain, - credentials: credentials, - numeric_enums: true, - service_name: self.class, - raise_faraday_errors: false, - logger: logger - end - - ## - # The effective universe domain - # - # @return [String] - # - def universe_domain - @client_stub.universe_domain - end - - ## - # The effective endpoint - # - # @return [String] - # - def endpoint - @client_stub.endpoint - end - - ## - # The logger used for request/response debug logging. - # - # @return [Logger] - # - def logger stub: false - stub ? @client_stub.stub_logger : @client_stub.logger - end - - ## - # Baseline implementation for the list_rollouts REST call - # - # @param request_pb [::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::ListRolloutsRequest] - # A request object representing the call parameters. Required. - # @param options [::Gapic::CallOptions] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::ListRolloutsResponse] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::ListRolloutsResponse] - # A result object deserialized from the server's reply - def list_rollouts request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_list_rollouts_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_rollouts", - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::ListRolloutsResponse.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_rollout REST call - # - # @param request_pb [::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::GetRolloutRequest] - # A request object representing the call parameters. Required. - # @param options [::Gapic::CallOptions] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::Rollout] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::Rollout] - # A result object deserialized from the server's reply - def get_rollout request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_get_rollout_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_rollout", - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::Rollout.decode_json response.body, ignore_unknown_fields: true - catch :response do - yield result, operation if block_given? - result - end - end - - ## - # Baseline implementation for the create_rollout REST call - # - # @param request_pb [::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::CreateRolloutRequest] - # A request object representing the call parameters. Required. - # @param options [::Gapic::CallOptions] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::Rollout] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::Rollout] - # A result object deserialized from the server's reply - def create_rollout request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_create_rollout_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_rollout", - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::Rollout.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_rollout REST call - # - # @param request_pb [::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::UpdateRolloutRequest] - # A request object representing the call parameters. Required. - # @param options [::Gapic::CallOptions] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::Rollout] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::Rollout] - # A result object deserialized from the server's reply - def update_rollout request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_update_rollout_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_rollout", - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::Rollout.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_rollout REST call - # - # @param request_pb [::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::DeleteRolloutRequest] - # 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_rollout request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_delete_rollout_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_rollout", - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Protobuf::Empty.decode_json response.body, ignore_unknown_fields: true - catch :response do - yield result, operation if block_given? - result - end - end - - ## - # Baseline implementation for the list_rollout_kinds REST call - # - # @param request_pb [::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::ListRolloutKindsRequest] - # A request object representing the call parameters. Required. - # @param options [::Gapic::CallOptions] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::ListRolloutKindsResponse] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::ListRolloutKindsResponse] - # A result object deserialized from the server's reply - def list_rollout_kinds request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_list_rollout_kinds_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_rollout_kinds", - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::ListRolloutKindsResponse.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_rollout_kind REST call - # - # @param request_pb [::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::GetRolloutKindRequest] - # A request object representing the call parameters. Required. - # @param options [::Gapic::CallOptions] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::RolloutKind] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::RolloutKind] - # A result object deserialized from the server's reply - def get_rollout_kind request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_get_rollout_kind_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_rollout_kind", - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::RolloutKind.decode_json response.body, ignore_unknown_fields: true - catch :response do - yield result, operation if block_given? - result - end - end - - ## - # Baseline implementation for the create_rollout_kind REST call - # - # @param request_pb [::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::CreateRolloutKindRequest] - # A request object representing the call parameters. Required. - # @param options [::Gapic::CallOptions] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::RolloutKind] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::RolloutKind] - # A result object deserialized from the server's reply - def create_rollout_kind request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_create_rollout_kind_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_rollout_kind", - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::RolloutKind.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_rollout_kind REST call - # - # @param request_pb [::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::UpdateRolloutKindRequest] - # A request object representing the call parameters. Required. - # @param options [::Gapic::CallOptions] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::RolloutKind] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::RolloutKind] - # A result object deserialized from the server's reply - def update_rollout_kind request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_update_rollout_kind_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_rollout_kind", - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::RolloutKind.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_rollout_kind REST call - # - # @param request_pb [::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::DeleteRolloutKindRequest] - # 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_rollout_kind request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_delete_rollout_kind_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_rollout_kind", - 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_rollouts REST call - # - # @param request_pb [::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::ListRolloutsRequest] - # 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_rollouts_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :get, - uri_template: "/v1beta1/{parent}/rollouts", - matches: [ - ["parent", %r{^projects/[^/]+/locations/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the get_rollout REST call - # - # @param request_pb [::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::GetRolloutRequest] - # 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_rollout_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :get, - uri_template: "/v1beta1/{name}", - matches: [ - ["name", %r{^projects/[^/]+/locations/[^/]+/rollouts/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the create_rollout REST call - # - # @param request_pb [::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::CreateRolloutRequest] - # 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_rollout_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :post, - uri_template: "/v1beta1/{parent}/rollouts", - body: "rollout", - matches: [ - ["parent", %r{^projects/[^/]+/locations/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the update_rollout REST call - # - # @param request_pb [::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::UpdateRolloutRequest] - # 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_rollout_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :patch, - uri_template: "/v1beta1/{rollout.name}", - body: "rollout", - matches: [ - ["rollout.name", %r{^projects/[^/]+/locations/[^/]+/rollouts/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the delete_rollout REST call - # - # @param request_pb [::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::DeleteRolloutRequest] - # 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_rollout_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :delete, - uri_template: "/v1beta1/{name}", - matches: [ - ["name", %r{^projects/[^/]+/locations/[^/]+/rollouts/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the list_rollout_kinds REST call - # - # @param request_pb [::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::ListRolloutKindsRequest] - # 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_rollout_kinds_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :get, - uri_template: "/v1beta1/{parent}/rolloutKinds", - matches: [ - ["parent", %r{^projects/[^/]+/locations/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the get_rollout_kind REST call - # - # @param request_pb [::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::GetRolloutKindRequest] - # 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_rollout_kind_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :get, - uri_template: "/v1beta1/{name}", - matches: [ - ["name", %r{^projects/[^/]+/locations/[^/]+/rolloutKinds/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the create_rollout_kind REST call - # - # @param request_pb [::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::CreateRolloutKindRequest] - # 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_rollout_kind_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :post, - uri_template: "/v1beta1/{parent}/rolloutKinds", - body: "rollout_kind", - matches: [ - ["parent", %r{^projects/[^/]+/locations/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the update_rollout_kind REST call - # - # @param request_pb [::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::UpdateRolloutKindRequest] - # 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_rollout_kind_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :patch, - uri_template: "/v1beta1/{rollout_kind.name}", - body: "rollout_kind", - matches: [ - ["rollout_kind.name", %r{^projects/[^/]+/locations/[^/]+/rolloutKinds/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the delete_rollout_kind REST call - # - # @param request_pb [::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::DeleteRolloutKindRequest] - # 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_rollout_kind_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :delete, - uri_template: "/v1beta1/{name}", - matches: [ - ["name", %r{^projects/[^/]+/locations/[^/]+/rolloutKinds/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - end - end - end - end - end - end - end -end diff --git a/owl-bot-staging/google-cloud-saas_platform-saas_service_mgmt-v1beta1/lib/google/cloud/saas_platform/saas_service_mgmt/v1beta1/version.rb b/owl-bot-staging/google-cloud-saas_platform-saas_service_mgmt-v1beta1/lib/google/cloud/saas_platform/saas_service_mgmt/v1beta1/version.rb deleted file mode 100644 index 14648b82728e..000000000000 --- a/owl-bot-staging/google-cloud-saas_platform-saas_service_mgmt-v1beta1/lib/google/cloud/saas_platform/saas_service_mgmt/v1beta1/version.rb +++ /dev/null @@ -1,30 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - - -module Google - module Cloud - module SaasPlatform - module SaasServiceMgmt - module V1beta1 - VERSION = "0.0.1" - end - end - end - end -end diff --git a/owl-bot-staging/google-cloud-saas_platform-saas_service_mgmt-v1beta1/lib/google/cloud/saasplatform/saasservicemgmt/v1beta1/common_pb.rb b/owl-bot-staging/google-cloud-saas_platform-saas_service_mgmt-v1beta1/lib/google/cloud/saasplatform/saasservicemgmt/v1beta1/common_pb.rb deleted file mode 100644 index 816cbc457c60..000000000000 --- a/owl-bot-staging/google-cloud-saas_platform-saas_service_mgmt-v1beta1/lib/google/cloud/saasplatform/saasservicemgmt/v1beta1/common_pb.rb +++ /dev/null @@ -1,36 +0,0 @@ -# frozen_string_literal: true -# Generated by the protocol buffer compiler. DO NOT EDIT! -# source: google/cloud/saasplatform/saasservicemgmt/v1beta1/common.proto - -require 'google/protobuf' - -require 'google/api/field_behavior_pb' -require 'google/protobuf/timestamp_pb' - - -descriptor_data = "\n>google/cloud/saasplatform/saasservicemgmt/v1beta1/common.proto\x12\x31google.cloud.saasplatform.saasservicemgmt.v1beta1\x1a\x1fgoogle/api/field_behavior.proto\x1a\x1fgoogle/protobuf/timestamp.proto\"O\n\tBlueprint\x12\x17\n\x07package\x18\x01 \x01(\tB\x06\xe0\x41\x01\xe0\x41\x05\x12\x13\n\x06\x65ngine\x18\x02 \x01(\tB\x03\xe0\x41\x03\x12\x14\n\x07version\x18\x03 \x01(\tB\x03\xe0\x41\x03\"\xd5\x01\n\x0cUnitVariable\x12\x18\n\x08variable\x18\x01 \x01(\tB\x06\xe0\x41\x02\xe0\x41\x05\x12Z\n\x04type\x18\x02 \x01(\x0e\x32\x44.google.cloud.saasplatform.saasservicemgmt.v1beta1.UnitVariable.TypeB\x06\xe0\x41\x01\xe0\x41\x05\x12\x12\n\x05value\x18\x03 \x01(\tB\x03\xe0\x41\x01\";\n\x04Type\x12\x14\n\x10TYPE_UNSPECIFIED\x10\x00\x12\n\n\x06STRING\x10\x01\x12\x07\n\x03INT\x10\x02\x12\x08\n\x04\x42OOL\x10\x03\"\xfb\x03\n\rUnitCondition\x12\\\n\x06status\x18\x01 \x01(\x0e\x32G.google.cloud.saasplatform.saasservicemgmt.v1beta1.UnitCondition.StatusB\x03\xe0\x41\x02\x12X\n\x04type\x18\x02 \x01(\x0e\x32\x45.google.cloud.saasplatform.saasservicemgmt.v1beta1.UnitCondition.TypeB\x03\xe0\x41\x02\x12=\n\x14last_transition_time\x18\x03 \x01(\x0b\x32\x1a.google.protobuf.TimestampB\x03\xe0\x41\x02\x12\x14\n\x07message\x18\x04 \x01(\tB\x03\xe0\x41\x02\x12\x13\n\x06reason\x18\x05 \x01(\tB\x03\xe0\x41\x02\"W\n\x06Status\x12\x16\n\x12STATUS_UNSPECIFIED\x10\x00\x12\x12\n\x0eSTATUS_UNKNOWN\x10\x01\x12\x0f\n\x0bSTATUS_TRUE\x10\x02\x12\x10\n\x0cSTATUS_FALSE\x10\x03\"o\n\x04Type\x12\x14\n\x10TYPE_UNSPECIFIED\x10\x00\x12\x0e\n\nTYPE_READY\x10\x01\x12\x11\n\rTYPE_UPDATING\x10\x02\x12\x14\n\x10TYPE_PROVISIONED\x10\x03\x12\x18\n\x14TYPE_OPERATION_ERROR\x10\x04\"\xcc\x04\n\x16UnitOperationCondition\x12\x65\n\x06status\x18\x01 \x01(\x0e\x32P.google.cloud.saasplatform.saasservicemgmt.v1beta1.UnitOperationCondition.StatusB\x03\xe0\x41\x02\x12\x61\n\x04type\x18\x02 \x01(\x0e\x32N.google.cloud.saasplatform.saasservicemgmt.v1beta1.UnitOperationCondition.TypeB\x03\xe0\x41\x02\x12=\n\x14last_transition_time\x18\x03 \x01(\x0b\x32\x1a.google.protobuf.TimestampB\x03\xe0\x41\x02\x12\x14\n\x07message\x18\x04 \x01(\tB\x03\xe0\x41\x02\x12\x13\n\x06reason\x18\x05 \x01(\tB\x03\xe0\x41\x02\"W\n\x06Status\x12\x16\n\x12STATUS_UNSPECIFIED\x10\x00\x12\x12\n\x0eSTATUS_UNKNOWN\x10\x01\x12\x0f\n\x0bSTATUS_TRUE\x10\x02\x12\x10\n\x0cSTATUS_FALSE\x10\x03\"\xa4\x01\n\x04Type\x12\x14\n\x10TYPE_UNSPECIFIED\x10\x00\x12\x12\n\x0eTYPE_SCHEDULED\x10\x02\x12\x10\n\x0cTYPE_RUNNING\x10\x03\x12\x12\n\x0eTYPE_SUCCEEDED\x10\x04\x12\x12\n\x0eTYPE_CANCELLED\x10\x05\x12\x14\n\x10TYPE_APP_CREATED\x10\x06\x12\"\n\x1eTYPE_APP_COMPONENTS_REGISTERED\x10\x07\"3\n\tAggregate\x12\x12\n\x05group\x18\x01 \x01(\tB\x03\xe0\x41\x02\x12\x12\n\x05\x63ount\x18\x02 \x01(\x05\x42\x03\xe0\x41\x02*\x96\x01\n\x1aUnitOperationErrorCategory\x12-\n)UNIT_OPERATION_ERROR_CATEGORY_UNSPECIFIED\x10\x00\x12\x12\n\x0eNOT_APPLICABLE\x10\x01\x12\t\n\x05\x46\x41TAL\x10\x02\x12\r\n\tRETRIABLE\x10\x03\x12\r\n\tIGNORABLE\x10\x04\x12\x0c\n\x08STANDARD\x10\x05\x42\xc7\x02\n5com.google.cloud.saasplatform.saasservicemgmt.v1beta1B\x0b\x43ommonProtoP\x01Z_cloud.google.com/go/saasplatform/saasservicemgmt/apiv1beta1/saasservicemgmtpb;saasservicemgmtpb\xaa\x02\x31Google.Cloud.SaasPlatform.SaasServiceMgmt.V1Beta1\xca\x02\x31Google\\Cloud\\SaasPlatform\\SaasServiceMgmt\\V1beta1\xea\x02\x35Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1b\x06proto3" - -pool = ::Google::Protobuf::DescriptorPool.generated_pool -pool.add_serialized_file(descriptor_data) - -module Google - module Cloud - module SaasPlatform - module SaasServiceMgmt - module V1beta1 - Blueprint = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.saasplatform.saasservicemgmt.v1beta1.Blueprint").msgclass - UnitVariable = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.saasplatform.saasservicemgmt.v1beta1.UnitVariable").msgclass - UnitVariable::Type = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.saasplatform.saasservicemgmt.v1beta1.UnitVariable.Type").enummodule - UnitCondition = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.saasplatform.saasservicemgmt.v1beta1.UnitCondition").msgclass - UnitCondition::Status = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.saasplatform.saasservicemgmt.v1beta1.UnitCondition.Status").enummodule - UnitCondition::Type = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.saasplatform.saasservicemgmt.v1beta1.UnitCondition.Type").enummodule - UnitOperationCondition = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.saasplatform.saasservicemgmt.v1beta1.UnitOperationCondition").msgclass - UnitOperationCondition::Status = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.saasplatform.saasservicemgmt.v1beta1.UnitOperationCondition.Status").enummodule - UnitOperationCondition::Type = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.saasplatform.saasservicemgmt.v1beta1.UnitOperationCondition.Type").enummodule - Aggregate = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.saasplatform.saasservicemgmt.v1beta1.Aggregate").msgclass - UnitOperationErrorCategory = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.saasplatform.saasservicemgmt.v1beta1.UnitOperationErrorCategory").enummodule - end - end - end - end -end diff --git a/owl-bot-staging/google-cloud-saas_platform-saas_service_mgmt-v1beta1/lib/google/cloud/saasplatform/saasservicemgmt/v1beta1/deployments_resources_pb.rb b/owl-bot-staging/google-cloud-saas_platform-saas_service_mgmt-v1beta1/lib/google/cloud/saasplatform/saasservicemgmt/v1beta1/deployments_resources_pb.rb deleted file mode 100644 index 7f4669657418..000000000000 --- a/owl-bot-staging/google-cloud-saas_platform-saas_service_mgmt-v1beta1/lib/google/cloud/saasplatform/saasservicemgmt/v1beta1/deployments_resources_pb.rb +++ /dev/null @@ -1,50 +0,0 @@ -# frozen_string_literal: true -# Generated by the protocol buffer compiler. DO NOT EDIT! -# source: google/cloud/saasplatform/saasservicemgmt/v1beta1/deployments_resources.proto - -require 'google/protobuf' - -require 'google/api/field_behavior_pb' -require 'google/api/field_info_pb' -require 'google/api/resource_pb' -require 'google/cloud/saasplatform/saasservicemgmt/v1beta1/common_pb' -require 'google/protobuf/timestamp_pb' - - -descriptor_data = "\nMgoogle/cloud/saasplatform/saasservicemgmt/v1beta1/deployments_resources.proto\x12\x31google.cloud.saasplatform.saasservicemgmt.v1beta1\x1a\x1fgoogle/api/field_behavior.proto\x1a\x1bgoogle/api/field_info.proto\x1a\x19google/api/resource.proto\x1a>google/cloud/saasplatform/saasservicemgmt/v1beta1/common.proto\x1a\x1fgoogle/protobuf/timestamp.proto\"\x1d\n\x08Location\x12\x11\n\x04name\x18\x01 \x01(\tB\x03\xe0\x41\x01\"\x99\x05\n\x04Saas\x12\x11\n\x04name\x18\x01 \x01(\tB\x03\xe0\x41\x08\x12S\n\tlocations\x18\x04 \x03(\x0b\x32;.google.cloud.saasplatform.saasservicemgmt.v1beta1.LocationB\x03\xe0\x41\x01\x12Y\n\x06labels\x18\xa1Q \x03(\x0b\x32\x43.google.cloud.saasplatform.saasservicemgmt.v1beta1.Saas.LabelsEntryB\x03\xe0\x41\x01\x12\x63\n\x0b\x61nnotations\x18\xa2Q \x03(\x0b\x32H.google.cloud.saasplatform.saasservicemgmt.v1beta1.Saas.AnnotationsEntryB\x03\xe0\x41\x01\x12\x19\n\x03uid\x18\xd9O \x01(\tB\x0b\xe0\x41\x03\xe2\x8c\xcf\xd7\x08\x02\x08\x01\x12\x12\n\x04\x65tag\x18\xdaO \x01(\tB\x03\xe0\x41\x03\x12\x35\n\x0b\x63reate_time\x18\xbfP \x01(\x0b\x32\x1a.google.protobuf.TimestampB\x03\xe0\x41\x03\x12\x35\n\x0bupdate_time\x18\xc0P \x01(\x0b\x32\x1a.google.protobuf.TimestampB\x03\xe0\x41\x03\x1a-\n\x0bLabelsEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12\r\n\x05value\x18\x02 \x01(\t:\x02\x38\x01\x1a\x32\n\x10\x41nnotationsEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12\r\n\x05value\x18\x02 \x01(\t:\x02\x38\x01:i\xea\x41\x66\n#saasservicemgmt.googleapis.com/Saas\x12\x33projects/{project}/locations/{location}/saas/{saas}*\x04saas2\x04saas\"\xb7\x05\n\x06Tenant\x12\x11\n\x04name\x18\x01 \x01(\tB\x03\xe0\x41\x08\x12!\n\x11\x63onsumer_resource\x18\x02 \x01(\tB\x06\xe0\x41\x01\xe0\x41\x05\x12<\n\x04saas\x18\x03 \x01(\tB.\xe0\x41\x02\xe0\x41\x05\xfa\x41%\n#saasservicemgmt.googleapis.com/Saas\x12[\n\x06labels\x18\xa1Q \x03(\x0b\x32\x45.google.cloud.saasplatform.saasservicemgmt.v1beta1.Tenant.LabelsEntryB\x03\xe0\x41\x01\x12\x65\n\x0b\x61nnotations\x18\xa2Q \x03(\x0b\x32J.google.cloud.saasplatform.saasservicemgmt.v1beta1.Tenant.AnnotationsEntryB\x03\xe0\x41\x01\x12\x19\n\x03uid\x18\xd9O \x01(\tB\x0b\xe0\x41\x03\xe2\x8c\xcf\xd7\x08\x02\x08\x01\x12\x12\n\x04\x65tag\x18\xdaO \x01(\tB\x03\xe0\x41\x03\x12\x35\n\x0b\x63reate_time\x18\xbfP \x01(\x0b\x32\x1a.google.protobuf.TimestampB\x03\xe0\x41\x03\x12\x35\n\x0bupdate_time\x18\xc0P \x01(\x0b\x32\x1a.google.protobuf.TimestampB\x03\xe0\x41\x03\x1a-\n\x0bLabelsEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12\r\n\x05value\x18\x02 \x01(\t:\x02\x38\x01\x1a\x32\n\x10\x41nnotationsEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12\r\n\x05value\x18\x02 \x01(\t:\x02\x38\x01:u\xea\x41r\n%saasservicemgmt.googleapis.com/Tenant\x12\x38projects/{project}/locations/{location}/tenants/{tenant}*\x07tenants2\x06tenant\"\x9f\x08\n\x08UnitKind\x12\x11\n\x04name\x18\x01 \x01(\tB\x03\xe0\x41\x08\x12G\n\x0f\x64\x65\x66\x61ult_release\x18\x02 \x01(\tB.\xe0\x41\x01\xfa\x41(\n&saasservicemgmt.googleapis.com/Release\x12[\n\x0c\x64\x65pendencies\x18\x04 \x03(\x0b\x32=.google.cloud.saasplatform.saasservicemgmt.v1beta1.DependencyB\x06\xe0\x41\x01\xe0\x41\x05\x12h\n\x17input_variable_mappings\x18\x05 \x03(\x0b\x32\x42.google.cloud.saasplatform.saasservicemgmt.v1beta1.VariableMappingB\x03\xe0\x41\x01\x12i\n\x18output_variable_mappings\x18\x06 \x03(\x0b\x32\x42.google.cloud.saasplatform.saasservicemgmt.v1beta1.VariableMappingB\x03\xe0\x41\x01\x12<\n\x04saas\x18\x08 \x01(\tB.\xe0\x41\x02\xe0\x41\x05\xfa\x41%\n#saasservicemgmt.googleapis.com/Saas\x12]\n\x06labels\x18\xa1Q \x03(\x0b\x32G.google.cloud.saasplatform.saasservicemgmt.v1beta1.UnitKind.LabelsEntryB\x03\xe0\x41\x01\x12g\n\x0b\x61nnotations\x18\xa2Q \x03(\x0b\x32L.google.cloud.saasplatform.saasservicemgmt.v1beta1.UnitKind.AnnotationsEntryB\x03\xe0\x41\x01\x12\x19\n\x03uid\x18\xd9O \x01(\tB\x0b\xe0\x41\x03\xe2\x8c\xcf\xd7\x08\x02\x08\x01\x12\x12\n\x04\x65tag\x18\xdaO \x01(\tB\x03\xe0\x41\x03\x12\x35\n\x0b\x63reate_time\x18\xbfP \x01(\x0b\x32\x1a.google.protobuf.TimestampB\x03\xe0\x41\x03\x12\x35\n\x0bupdate_time\x18\xc0P \x01(\x0b\x32\x1a.google.protobuf.TimestampB\x03\xe0\x41\x03\x1a-\n\x0bLabelsEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12\r\n\x05value\x18\x02 \x01(\t:\x02\x38\x01\x1a\x32\n\x10\x41nnotationsEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12\r\n\x05value\x18\x02 \x01(\t:\x02\x38\x01:\x7f\xea\x41|\n\'saasservicemgmt.googleapis.com/UnitKind\x12.google.cloud.saasplatform.saasservicemgmt.v1beta1.DeprovisionB\x03\xe0\x41\x01H\x00\x12\x11\n\x04name\x18\x01 \x01(\tB\x03\xe0\x41\x08\x12<\n\x04unit\x18\x02 \x01(\tB.\xe0\x41\x02\xe0\x41\x05\xfa\x41%\n#saasservicemgmt.googleapis.com/Unit\x12S\n\x15parent_unit_operation\x18\x03 \x01(\tB4\xe0\x41\x01\xfa\x41.\n,saasservicemgmt.googleapis.com/UnitOperation\x12?\n\x07rollout\x18\x04 \x01(\tB.\xe0\x41\x01\xfa\x41(\n&saasservicemgmt.googleapis.com/Rollout\x12\x13\n\x06\x63\x61ncel\x18\x05 \x01(\x08\x42\x03\xe0\x41\x01\x12j\n\x05state\x18\x06 \x01(\x0e\x32S.google.cloud.saasplatform.saasservicemgmt.v1beta1.UnitOperation.UnitOperationStateB\x06\xe0\x41\x01\xe0\x41\x03\x12\x65\n\nconditions\x18\x07 \x03(\x0b\x32I.google.cloud.saasplatform.saasservicemgmt.v1beta1.UnitOperationConditionB\x06\xe0\x41\x01\xe0\x41\x03\x12R\n\x08schedule\x18\x0c \x01(\x0b\x32;.google.cloud.saasplatform.saasservicemgmt.v1beta1.ScheduleB\x03\xe0\x41\x01\x12\x1c\n\x0c\x65ngine_state\x18\x0e \x01(\tB\x06\xe0\x41\x01\xe0\x41\x03\x12m\n\x0e\x65rror_category\x18\x0f \x01(\x0e\x32M.google.cloud.saasplatform.saasservicemgmt.v1beta1.UnitOperationErrorCategoryB\x06\xe0\x41\x01\xe0\x41\x03\x12\x62\n\x06labels\x18\xa1Q \x03(\x0b\x32L.google.cloud.saasplatform.saasservicemgmt.v1beta1.UnitOperation.LabelsEntryB\x03\xe0\x41\x01\x12l\n\x0b\x61nnotations\x18\xa2Q \x03(\x0b\x32Q.google.cloud.saasplatform.saasservicemgmt.v1beta1.UnitOperation.AnnotationsEntryB\x03\xe0\x41\x01\x12\x19\n\x03uid\x18\xd9O \x01(\tB\x0b\xe0\x41\x03\xe2\x8c\xcf\xd7\x08\x02\x08\x01\x12\x12\n\x04\x65tag\x18\xdaO \x01(\tB\x03\xe0\x41\x03\x12\x35\n\x0b\x63reate_time\x18\xbfP \x01(\x0b\x32\x1a.google.protobuf.TimestampB\x03\xe0\x41\x03\x12\x35\n\x0bupdate_time\x18\xc0P \x01(\x0b\x32\x1a.google.protobuf.TimestampB\x03\xe0\x41\x03\x1a-\n\x0bLabelsEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12\r\n\x05value\x18\x02 \x01(\t:\x02\x38\x01\x1a\x32\n\x10\x41nnotationsEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12\r\n\x05value\x18\x02 \x01(\t:\x02\x38\x01\"\x87\x02\n\x12UnitOperationState\x12 \n\x1cUNIT_OPERATION_STATE_UNKNOWN\x10\x00\x12 \n\x1cUNIT_OPERATION_STATE_PENDING\x10\x01\x12\"\n\x1eUNIT_OPERATION_STATE_SCHEDULED\x10\x02\x12 \n\x1cUNIT_OPERATION_STATE_RUNNING\x10\x04\x12\"\n\x1eUNIT_OPERATION_STATE_SUCCEEDED\x10\x05\x12\x1f\n\x1bUNIT_OPERATION_STATE_FAILED\x10\x06\x12\"\n\x1eUNIT_OPERATION_STATE_CANCELLED\x10\x07:\x99\x01\xea\x41\x95\x01\n,saasservicemgmt.googleapis.com/UnitOperation\x12\x46projects/{project}/locations/{location}/unitOperations/{unitOperation}*\x0eunitOperations2\runitOperationB\x15\n\x13unit_operation_type\"\xab\x01\n\tProvision\x12?\n\x07release\x18\x01 \x01(\tB.\xe0\x41\x01\xfa\x41(\n&saasservicemgmt.googleapis.com/Release\x12]\n\x0finput_variables\x18\x03 \x03(\x0b\x32?.google.cloud.saasplatform.saasservicemgmt.v1beta1.UnitVariableB\x03\xe0\x41\x01\"\r\n\x0b\x44\x65provision\"\xa9\x01\n\x07Upgrade\x12?\n\x07release\x18\x01 \x01(\tB.\xe0\x41\x01\xfa\x41(\n&saasservicemgmt.googleapis.com/Release\x12]\n\x0finput_variables\x18\x02 \x03(\x0b\x32?.google.cloud.saasplatform.saasservicemgmt.v1beta1.UnitVariableB\x03\xe0\x41\x01\"?\n\x08Schedule\x12\x33\n\nstart_time\x18\x01 \x01(\x0b\x32\x1a.google.protobuf.TimestampB\x03\xe0\x41\x01\"\x84\n\n\x07Release\x12\x11\n\x04name\x18\x01 \x01(\tB\x03\xe0\x41\x08\x12\x45\n\tunit_kind\x18\x02 \x01(\tB2\xe0\x41\x02\xe0\x41\x05\xfa\x41)\n\'saasservicemgmt.googleapis.com/UnitKind\x12T\n\tblueprint\x18\x03 \x01(\x0b\x32<.google.cloud.saasplatform.saasservicemgmt.v1beta1.BlueprintB\x03\xe0\x41\x01\x12q\n\x14release_requirements\x18\x04 \x01(\x0b\x32N.google.cloud.saasplatform.saasservicemgmt.v1beta1.Release.ReleaseRequirementsB\x03\xe0\x41\x01\x12`\n\x0finput_variables\x18\x05 \x03(\x0b\x32?.google.cloud.saasplatform.saasservicemgmt.v1beta1.UnitVariableB\x06\xe0\x41\x01\xe0\x41\x03\x12\x61\n\x10output_variables\x18\x06 \x03(\x0b\x32?.google.cloud.saasplatform.saasservicemgmt.v1beta1.UnitVariableB\x06\xe0\x41\x01\xe0\x41\x03\x12\x65\n\x17input_variable_defaults\x18\x07 \x03(\x0b\x32?.google.cloud.saasplatform.saasservicemgmt.v1beta1.UnitVariableB\x03\xe0\x41\x01\x12\\\n\x06labels\x18\xa1Q \x03(\x0b\x32\x46.google.cloud.saasplatform.saasservicemgmt.v1beta1.Release.LabelsEntryB\x03\xe0\x41\x01\x12\x66\n\x0b\x61nnotations\x18\xa2Q \x03(\x0b\x32K.google.cloud.saasplatform.saasservicemgmt.v1beta1.Release.AnnotationsEntryB\x03\xe0\x41\x01\x12\x19\n\x03uid\x18\xd9O \x01(\tB\x0b\xe0\x41\x03\xe2\x8c\xcf\xd7\x08\x02\x08\x01\x12\x12\n\x04\x65tag\x18\xdaO \x01(\tB\x03\xe0\x41\x03\x12\x35\n\x0b\x63reate_time\x18\xbfP \x01(\x0b\x32\x1a.google.protobuf.TimestampB\x03\xe0\x41\x03\x12\x35\n\x0bupdate_time\x18\xc0P \x01(\x0b\x32\x1a.google.protobuf.TimestampB\x03\xe0\x41\x03\x1ah\n\x13ReleaseRequirements\x12Q\n\x19upgradeable_from_releases\x18\x01 \x03(\tB.\xe0\x41\x01\xfa\x41(\n&saasservicemgmt.googleapis.com/Release\x1a-\n\x0bLabelsEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12\r\n\x05value\x18\x02 \x01(\t:\x02\x38\x01\x1a\x32\n\x10\x41nnotationsEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12\r\n\x05value\x18\x02 \x01(\t:\x02\x38\x01:z\xea\x41w\n&saasservicemgmt.googleapis.com/Release\x12:projects/{project}/locations/{location}/releases/{release}*\x08releases2\x07release\"\xde\x01\n\x0fVariableMapping\x12S\n\x04\x66rom\x18\x02 \x01(\x0b\x32>.google.cloud.saasplatform.saasservicemgmt.v1beta1.FromMappingB\x03\xe0\x41\x01H\x00\x12O\n\x02to\x18\x03 \x01(\x0b\x32<.google.cloud.saasplatform.saasservicemgmt.v1beta1.ToMappingB\x03\xe0\x41\x01H\x00\x12\x15\n\x08variable\x18\x01 \x01(\tB\x03\xe0\x41\x02\x42\x0e\n\x0cmapping_type\"D\n\x0b\x46romMapping\x12\x17\n\ndependency\x18\x01 \x01(\tB\x03\xe0\x41\x02\x12\x1c\n\x0foutput_variable\x18\x02 \x01(\tB\x03\xe0\x41\x02\"a\n\tToMapping\x12\x17\n\ndependency\x18\x01 \x01(\tB\x03\xe0\x41\x02\x12\x1b\n\x0einput_variable\x18\x02 \x01(\tB\x03\xe0\x41\x02\x12\x1e\n\x11ignore_for_lookup\x18\x03 \x01(\x08\x42\x03\xe0\x41\x01\"g\n\nDependency\x12\x45\n\tunit_kind\x18\x01 \x01(\tB2\xe0\x41\x02\xe0\x41\x05\xfa\x41)\n\'saasservicemgmt.googleapis.com/UnitKind\x12\x12\n\x05\x61lias\x18\x02 \x01(\tB\x03\xe0\x41\x02\x42\xd9\x02\n5com.google.cloud.saasplatform.saasservicemgmt.v1beta1B\x1dSaasDeploymentsResourcesProtoP\x01Z_cloud.google.com/go/saasplatform/saasservicemgmt/apiv1beta1/saasservicemgmtpb;saasservicemgmtpb\xaa\x02\x31Google.Cloud.SaasPlatform.SaasServiceMgmt.V1Beta1\xca\x02\x31Google\\Cloud\\SaasPlatform\\SaasServiceMgmt\\V1beta1\xea\x02\x35Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1b\x06proto3" - -pool = ::Google::Protobuf::DescriptorPool.generated_pool -pool.add_serialized_file(descriptor_data) - -module Google - module Cloud - module SaasPlatform - module SaasServiceMgmt - module V1beta1 - Location = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.saasplatform.saasservicemgmt.v1beta1.Location").msgclass - Saas = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.saasplatform.saasservicemgmt.v1beta1.Saas").msgclass - Tenant = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.saasplatform.saasservicemgmt.v1beta1.Tenant").msgclass - UnitKind = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.saasplatform.saasservicemgmt.v1beta1.UnitKind").msgclass - Unit = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.saasplatform.saasservicemgmt.v1beta1.Unit").msgclass - Unit::MaintenanceSettings = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.saasplatform.saasservicemgmt.v1beta1.Unit.MaintenanceSettings").msgclass - Unit::UnitState = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.saasplatform.saasservicemgmt.v1beta1.Unit.UnitState").enummodule - Unit::ManagementMode = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.saasplatform.saasservicemgmt.v1beta1.Unit.ManagementMode").enummodule - Unit::SystemManagedState = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.saasplatform.saasservicemgmt.v1beta1.Unit.SystemManagedState").enummodule - UnitDependency = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.saasplatform.saasservicemgmt.v1beta1.UnitDependency").msgclass - UnitOperation = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.saasplatform.saasservicemgmt.v1beta1.UnitOperation").msgclass - UnitOperation::UnitOperationState = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.saasplatform.saasservicemgmt.v1beta1.UnitOperation.UnitOperationState").enummodule - Provision = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.saasplatform.saasservicemgmt.v1beta1.Provision").msgclass - Deprovision = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.saasplatform.saasservicemgmt.v1beta1.Deprovision").msgclass - Upgrade = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.saasplatform.saasservicemgmt.v1beta1.Upgrade").msgclass - Schedule = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.saasplatform.saasservicemgmt.v1beta1.Schedule").msgclass - Release = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.saasplatform.saasservicemgmt.v1beta1.Release").msgclass - Release::ReleaseRequirements = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.saasplatform.saasservicemgmt.v1beta1.Release.ReleaseRequirements").msgclass - VariableMapping = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.saasplatform.saasservicemgmt.v1beta1.VariableMapping").msgclass - FromMapping = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.saasplatform.saasservicemgmt.v1beta1.FromMapping").msgclass - ToMapping = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.saasplatform.saasservicemgmt.v1beta1.ToMapping").msgclass - Dependency = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.saasplatform.saasservicemgmt.v1beta1.Dependency").msgclass - end - end - end - end -end diff --git a/owl-bot-staging/google-cloud-saas_platform-saas_service_mgmt-v1beta1/lib/google/cloud/saasplatform/saasservicemgmt/v1beta1/deployments_service_pb.rb b/owl-bot-staging/google-cloud-saas_platform-saas_service_mgmt-v1beta1/lib/google/cloud/saasplatform/saasservicemgmt/v1beta1/deployments_service_pb.rb deleted file mode 100644 index 4c6e843c3907..000000000000 --- a/owl-bot-staging/google-cloud-saas_platform-saas_service_mgmt-v1beta1/lib/google/cloud/saasplatform/saasservicemgmt/v1beta1/deployments_service_pb.rb +++ /dev/null @@ -1,66 +0,0 @@ -# frozen_string_literal: true -# Generated by the protocol buffer compiler. DO NOT EDIT! -# source: google/cloud/saasplatform/saasservicemgmt/v1beta1/deployments_service.proto - -require 'google/protobuf' - -require 'google/api/annotations_pb' -require 'google/api/client_pb' -require 'google/api/field_behavior_pb' -require 'google/api/resource_pb' -require 'google/cloud/saasplatform/saasservicemgmt/v1beta1/deployments_resources_pb' -require 'google/protobuf/empty_pb' -require 'google/protobuf/field_mask_pb' - - -descriptor_data = "\nKgoogle/cloud/saasplatform/saasservicemgmt/v1beta1/deployments_service.proto\x12\x31google.cloud.saasplatform.saasservicemgmt.v1beta1\x1a\x1cgoogle/api/annotations.proto\x1a\x17google/api/client.proto\x1a\x1fgoogle/api/field_behavior.proto\x1a\x19google/api/resource.proto\x1aMgoogle/cloud/saasplatform/saasservicemgmt/v1beta1/deployments_resources.proto\x1a\x1bgoogle/protobuf/empty.proto\x1a google/protobuf/field_mask.proto\"\x9c\x01\n\x0fListSaasRequest\x12<\n\x06parent\x18\x96N \x01(\tB+\xe0\x41\x02\xfa\x41%\x12#saasservicemgmt.googleapis.com/Saas\x12\x12\n\tpage_size\x18\x89R \x01(\x05\x12\x13\n\npage_token\x18\x8aR \x01(\t\x12\x0f\n\x06\x66ilter\x18\x8bR \x01(\t\x12\x11\n\x08order_by\x18\x8cR \x01(\t\"\x8a\x01\n\x10ListSaasResponse\x12\x46\n\x04saas\x18\x8dR \x03(\x0b\x32\x37.google.cloud.saasplatform.saasservicemgmt.v1beta1.Saas\x12\x18\n\x0fnext_page_token\x18\x8eR \x01(\t\x12\x14\n\x0bunreachable\x18\x8fR \x03(\t\"L\n\x0eGetSaasRequest\x12:\n\x04name\x18\x91N \x01(\tB+\xe0\x41\x02\xfa\x41%\n#saasservicemgmt.googleapis.com/Saas\"\xe2\x01\n\x11\x43reateSaasRequest\x12<\n\x06parent\x18\x96N \x01(\tB+\xe0\x41\x02\xfa\x41%\x12#saasservicemgmt.googleapis.com/Saas\x12\x15\n\x07saas_id\x18\x87R \x01(\tB\x03\xe0\x41\x02\x12K\n\x04saas\x18\x88R \x01(\x0b\x32\x37.google.cloud.saasplatform.saasservicemgmt.v1beta1.SaasB\x03\xe0\x41\x02\x12\x16\n\rvalidate_only\x18\x85R \x01(\x08\x12\x13\n\nrequest_id\x18\x86R \x01(\t\"\xbf\x01\n\x11UpdateSaasRequest\x12K\n\x04saas\x18\x88R \x01(\x0b\x32\x37.google.cloud.saasplatform.saasservicemgmt.v1beta1.SaasB\x03\xe0\x41\x02\x12\x16\n\rvalidate_only\x18\x85R \x01(\x08\x12\x13\n\nrequest_id\x18\x86R \x01(\t\x12\x30\n\x0bupdate_mask\x18\x90R \x01(\x0b\x32\x1a.google.protobuf.FieldMask\"\x8b\x01\n\x11\x44\x65leteSaasRequest\x12:\n\x04name\x18\x91N \x01(\tB+\xe0\x41\x02\xfa\x41%\n#saasservicemgmt.googleapis.com/Saas\x12\r\n\x04\x65tag\x18\xdaO \x01(\t\x12\x16\n\rvalidate_only\x18\x85R \x01(\x08\x12\x13\n\nrequest_id\x18\x86R \x01(\t\"\xa1\x01\n\x12ListTenantsRequest\x12>\n\x06parent\x18\x96N \x01(\tB-\xe0\x41\x02\xfa\x41\'\x12%saasservicemgmt.googleapis.com/Tenant\x12\x12\n\tpage_size\x18\x89R \x01(\x05\x12\x13\n\npage_token\x18\x8aR \x01(\t\x12\x0f\n\x06\x66ilter\x18\x8bR \x01(\t\x12\x11\n\x08order_by\x18\x8cR \x01(\t\"\x92\x01\n\x13ListTenantsResponse\x12K\n\x07tenants\x18\x8dR \x03(\x0b\x32\x39.google.cloud.saasplatform.saasservicemgmt.v1beta1.Tenant\x12\x18\n\x0fnext_page_token\x18\x8eR \x01(\t\x12\x14\n\x0bunreachable\x18\x8fR \x03(\t\"P\n\x10GetTenantRequest\x12<\n\x04name\x18\x91N \x01(\tB-\xe0\x41\x02\xfa\x41\'\n%saasservicemgmt.googleapis.com/Tenant\"\xec\x01\n\x13\x43reateTenantRequest\x12>\n\x06parent\x18\x96N \x01(\tB-\xe0\x41\x02\xfa\x41\'\x12%saasservicemgmt.googleapis.com/Tenant\x12\x17\n\ttenant_id\x18\x87R \x01(\tB\x03\xe0\x41\x02\x12O\n\x06tenant\x18\x88R \x01(\x0b\x32\x39.google.cloud.saasplatform.saasservicemgmt.v1beta1.TenantB\x03\xe0\x41\x02\x12\x16\n\rvalidate_only\x18\x85R \x01(\x08\x12\x13\n\nrequest_id\x18\x86R \x01(\t\"\xc5\x01\n\x13UpdateTenantRequest\x12O\n\x06tenant\x18\x88R \x01(\x0b\x32\x39.google.cloud.saasplatform.saasservicemgmt.v1beta1.TenantB\x03\xe0\x41\x02\x12\x16\n\rvalidate_only\x18\x85R \x01(\x08\x12\x13\n\nrequest_id\x18\x86R \x01(\t\x12\x30\n\x0bupdate_mask\x18\x90R \x01(\x0b\x32\x1a.google.protobuf.FieldMask\"\x8f\x01\n\x13\x44\x65leteTenantRequest\x12<\n\x04name\x18\x91N \x01(\tB-\xe0\x41\x02\xfa\x41\'\n%saasservicemgmt.googleapis.com/Tenant\x12\r\n\x04\x65tag\x18\xdaO \x01(\t\x12\x16\n\rvalidate_only\x18\x85R \x01(\x08\x12\x13\n\nrequest_id\x18\x86R \x01(\t\"\xa5\x01\n\x14ListUnitKindsRequest\x12@\n\x06parent\x18\x96N \x01(\tB/\xe0\x41\x02\xfa\x41)\x12\'saasservicemgmt.googleapis.com/UnitKind\x12\x12\n\tpage_size\x18\x89R \x01(\x05\x12\x13\n\npage_token\x18\x8aR \x01(\t\x12\x0f\n\x06\x66ilter\x18\x8bR \x01(\t\x12\x11\n\x08order_by\x18\x8cR \x01(\t\"\x99\x01\n\x15ListUnitKindsResponse\x12P\n\nunit_kinds\x18\x8dR \x03(\x0b\x32;.google.cloud.saasplatform.saasservicemgmt.v1beta1.UnitKind\x12\x18\n\x0fnext_page_token\x18\x8eR \x01(\t\x12\x14\n\x0bunreachable\x18\x8fR \x03(\t\"T\n\x12GetUnitKindRequest\x12>\n\x04name\x18\x91N \x01(\tB/\xe0\x41\x02\xfa\x41)\n\'saasservicemgmt.googleapis.com/UnitKind\"\xf8\x01\n\x15\x43reateUnitKindRequest\x12@\n\x06parent\x18\x96N \x01(\tB/\xe0\x41\x02\xfa\x41)\x12\'saasservicemgmt.googleapis.com/UnitKind\x12\x1a\n\x0cunit_kind_id\x18\x87R \x01(\tB\x03\xe0\x41\x02\x12T\n\tunit_kind\x18\x88R \x01(\x0b\x32;.google.cloud.saasplatform.saasservicemgmt.v1beta1.UnitKindB\x03\xe0\x41\x02\x12\x16\n\rvalidate_only\x18\x85R \x01(\x08\x12\x13\n\nrequest_id\x18\x86R \x01(\t\"\xcc\x01\n\x15UpdateUnitKindRequest\x12T\n\tunit_kind\x18\x88R \x01(\x0b\x32;.google.cloud.saasplatform.saasservicemgmt.v1beta1.UnitKindB\x03\xe0\x41\x02\x12\x16\n\rvalidate_only\x18\x85R \x01(\x08\x12\x13\n\nrequest_id\x18\x86R \x01(\t\x12\x30\n\x0bupdate_mask\x18\x90R \x01(\x0b\x32\x1a.google.protobuf.FieldMask\"\x93\x01\n\x15\x44\x65leteUnitKindRequest\x12>\n\x04name\x18\x91N \x01(\tB/\xe0\x41\x02\xfa\x41)\n\'saasservicemgmt.googleapis.com/UnitKind\x12\r\n\x04\x65tag\x18\xdaO \x01(\t\x12\x16\n\rvalidate_only\x18\x85R \x01(\x08\x12\x13\n\nrequest_id\x18\x86R \x01(\t\"\x9d\x01\n\x10ListUnitsRequest\x12<\n\x06parent\x18\x96N \x01(\tB+\xe0\x41\x02\xfa\x41%\x12#saasservicemgmt.googleapis.com/Unit\x12\x12\n\tpage_size\x18\x89R \x01(\x05\x12\x13\n\npage_token\x18\x8aR \x01(\t\x12\x0f\n\x06\x66ilter\x18\x8bR \x01(\t\x12\x11\n\x08order_by\x18\x8cR \x01(\t\"\x8c\x01\n\x11ListUnitsResponse\x12G\n\x05units\x18\x8dR \x03(\x0b\x32\x37.google.cloud.saasplatform.saasservicemgmt.v1beta1.Unit\x12\x18\n\x0fnext_page_token\x18\x8eR \x01(\t\x12\x14\n\x0bunreachable\x18\x8fR \x03(\t\"L\n\x0eGetUnitRequest\x12:\n\x04name\x18\x91N \x01(\tB+\xe0\x41\x02\xfa\x41%\n#saasservicemgmt.googleapis.com/Unit\"\xe2\x01\n\x11\x43reateUnitRequest\x12<\n\x06parent\x18\x96N \x01(\tB+\xe0\x41\x02\xfa\x41%\x12#saasservicemgmt.googleapis.com/Unit\x12\x15\n\x07unit_id\x18\x87R \x01(\tB\x03\xe0\x41\x02\x12K\n\x04unit\x18\x88R \x01(\x0b\x32\x37.google.cloud.saasplatform.saasservicemgmt.v1beta1.UnitB\x03\xe0\x41\x02\x12\x16\n\rvalidate_only\x18\x85R \x01(\x08\x12\x13\n\nrequest_id\x18\x86R \x01(\t\"\xbf\x01\n\x11UpdateUnitRequest\x12K\n\x04unit\x18\x88R \x01(\x0b\x32\x37.google.cloud.saasplatform.saasservicemgmt.v1beta1.UnitB\x03\xe0\x41\x02\x12\x16\n\rvalidate_only\x18\x85R \x01(\x08\x12\x13\n\nrequest_id\x18\x86R \x01(\t\x12\x30\n\x0bupdate_mask\x18\x90R \x01(\x0b\x32\x1a.google.protobuf.FieldMask\"\x8b\x01\n\x11\x44\x65leteUnitRequest\x12:\n\x04name\x18\x91N \x01(\tB+\xe0\x41\x02\xfa\x41%\n#saasservicemgmt.googleapis.com/Unit\x12\r\n\x04\x65tag\x18\xdaO \x01(\t\x12\x16\n\rvalidate_only\x18\x85R \x01(\x08\x12\x13\n\nrequest_id\x18\x86R \x01(\t\"\xaf\x01\n\x19ListUnitOperationsRequest\x12\x45\n\x06parent\x18\x96N \x01(\tB4\xe0\x41\x02\xfa\x41.\x12,saasservicemgmt.googleapis.com/UnitOperation\x12\x12\n\tpage_size\x18\x89R \x01(\x05\x12\x13\n\npage_token\x18\x8aR \x01(\t\x12\x0f\n\x06\x66ilter\x18\x8bR \x01(\t\x12\x11\n\x08order_by\x18\x8cR \x01(\t\"\xa8\x01\n\x1aListUnitOperationsResponse\x12Z\n\x0funit_operations\x18\x8dR \x03(\x0b\x32@.google.cloud.saasplatform.saasservicemgmt.v1beta1.UnitOperation\x12\x18\n\x0fnext_page_token\x18\x8eR \x01(\t\x12\x14\n\x0bunreachable\x18\x8fR \x03(\t\"^\n\x17GetUnitOperationRequest\x12\x43\n\x04name\x18\x91N \x01(\tB4\xe0\x41\x02\xfa\x41.\n,saasservicemgmt.googleapis.com/UnitOperation\"\x91\x02\n\x1a\x43reateUnitOperationRequest\x12\x45\n\x06parent\x18\x96N \x01(\tB4\xe0\x41\x02\xfa\x41.\x12,saasservicemgmt.googleapis.com/UnitOperation\x12\x1f\n\x11unit_operation_id\x18\x87R \x01(\tB\x03\xe0\x41\x02\x12^\n\x0eunit_operation\x18\x88R \x01(\x0b\x32@.google.cloud.saasplatform.saasservicemgmt.v1beta1.UnitOperationB\x03\xe0\x41\x02\x12\x16\n\rvalidate_only\x18\x85R \x01(\x08\x12\x13\n\nrequest_id\x18\x86R \x01(\t\"\xdb\x01\n\x1aUpdateUnitOperationRequest\x12^\n\x0eunit_operation\x18\x88R \x01(\x0b\x32@.google.cloud.saasplatform.saasservicemgmt.v1beta1.UnitOperationB\x03\xe0\x41\x02\x12\x16\n\rvalidate_only\x18\x85R \x01(\x08\x12\x13\n\nrequest_id\x18\x86R \x01(\t\x12\x30\n\x0bupdate_mask\x18\x90R \x01(\x0b\x32\x1a.google.protobuf.FieldMask\"\x9d\x01\n\x1a\x44\x65leteUnitOperationRequest\x12\x43\n\x04name\x18\x91N \x01(\tB4\xe0\x41\x02\xfa\x41.\n,saasservicemgmt.googleapis.com/UnitOperation\x12\r\n\x04\x65tag\x18\xdaO \x01(\t\x12\x16\n\rvalidate_only\x18\x85R \x01(\x08\x12\x13\n\nrequest_id\x18\x86R \x01(\t\"\xa3\x01\n\x13ListReleasesRequest\x12?\n\x06parent\x18\x96N \x01(\tB.\xe0\x41\x02\xfa\x41(\x12&saasservicemgmt.googleapis.com/Release\x12\x12\n\tpage_size\x18\x89R \x01(\x05\x12\x13\n\npage_token\x18\x8aR \x01(\t\x12\x0f\n\x06\x66ilter\x18\x8bR \x01(\t\x12\x11\n\x08order_by\x18\x8cR \x01(\t\"\x95\x01\n\x14ListReleasesResponse\x12M\n\x08releases\x18\x8dR \x03(\x0b\x32:.google.cloud.saasplatform.saasservicemgmt.v1beta1.Release\x12\x18\n\x0fnext_page_token\x18\x8eR \x01(\t\x12\x14\n\x0bunreachable\x18\x8fR \x03(\t\"R\n\x11GetReleaseRequest\x12=\n\x04name\x18\x91N \x01(\tB.\xe0\x41\x02\xfa\x41(\n&saasservicemgmt.googleapis.com/Release\"\xf1\x01\n\x14\x43reateReleaseRequest\x12?\n\x06parent\x18\x96N \x01(\tB.\xe0\x41\x02\xfa\x41(\x12&saasservicemgmt.googleapis.com/Release\x12\x18\n\nrelease_id\x18\x87R \x01(\tB\x03\xe0\x41\x02\x12Q\n\x07release\x18\x88R \x01(\x0b\x32:.google.cloud.saasplatform.saasservicemgmt.v1beta1.ReleaseB\x03\xe0\x41\x02\x12\x16\n\rvalidate_only\x18\x85R \x01(\x08\x12\x13\n\nrequest_id\x18\x86R \x01(\t\"\xc8\x01\n\x14UpdateReleaseRequest\x12Q\n\x07release\x18\x88R \x01(\x0b\x32:.google.cloud.saasplatform.saasservicemgmt.v1beta1.ReleaseB\x03\xe0\x41\x02\x12\x16\n\rvalidate_only\x18\x85R \x01(\x08\x12\x13\n\nrequest_id\x18\x86R \x01(\t\x12\x30\n\x0bupdate_mask\x18\x90R \x01(\x0b\x32\x1a.google.protobuf.FieldMask\"\x91\x01\n\x14\x44\x65leteReleaseRequest\x12=\n\x04name\x18\x91N \x01(\tB.\xe0\x41\x02\xfa\x41(\n&saasservicemgmt.googleapis.com/Release\x12\r\n\x04\x65tag\x18\xdaO \x01(\t\x12\x16\n\rvalidate_only\x18\x85R \x01(\x08\x12\x13\n\nrequest_id\x18\x86R \x01(\t2\x9d\x35\n\x0fSaasDeployments\x12\xd3\x01\n\x08ListSaas\x12\x42.google.cloud.saasplatform.saasservicemgmt.v1beta1.ListSaasRequest\x1a\x43.google.cloud.saasplatform.saasservicemgmt.v1beta1.ListSaasResponse\">\xda\x41\x06parent\x82\xd3\xe4\x93\x02/\x12-/v1beta1/{parent=projects/*/locations/*}/saas\x12\xc3\x01\n\x07GetSaas\x12\x41.google.cloud.saasplatform.saasservicemgmt.v1beta1.GetSaasRequest\x1a\x37.google.cloud.saasplatform.saasservicemgmt.v1beta1.Saas\"<\xda\x41\x04name\x82\xd3\xe4\x93\x02/\x12-/v1beta1/{name=projects/*/locations/*/saas/*}\x12\xde\x01\n\nCreateSaas\x12\x44.google.cloud.saasplatform.saasservicemgmt.v1beta1.CreateSaasRequest\x1a\x37.google.cloud.saasplatform.saasservicemgmt.v1beta1.Saas\"Q\xda\x41\x13parent,saas,saas_id\x82\xd3\xe4\x93\x02\x35\"-/v1beta1/{parent=projects/*/locations/*}/saas:\x04saas\x12\xe0\x01\n\nUpdateSaas\x12\x44.google.cloud.saasplatform.saasservicemgmt.v1beta1.UpdateSaasRequest\x1a\x37.google.cloud.saasplatform.saasservicemgmt.v1beta1.Saas\"S\xda\x41\x10saas,update_mask\x82\xd3\xe4\x93\x02:22/v1beta1/{saas.name=projects/*/locations/*/saas/*}:\x04saas\x12\xa8\x01\n\nDeleteSaas\x12\x44.google.cloud.saasplatform.saasservicemgmt.v1beta1.DeleteSaasRequest\x1a\x16.google.protobuf.Empty\"<\xda\x41\x04name\x82\xd3\xe4\x93\x02/*-/v1beta1/{name=projects/*/locations/*/saas/*}\x12\xdf\x01\n\x0bListTenants\x12\x45.google.cloud.saasplatform.saasservicemgmt.v1beta1.ListTenantsRequest\x1a\x46.google.cloud.saasplatform.saasservicemgmt.v1beta1.ListTenantsResponse\"A\xda\x41\x06parent\x82\xd3\xe4\x93\x02\x32\x12\x30/v1beta1/{parent=projects/*/locations/*}/tenants\x12\xcc\x01\n\tGetTenant\x12\x43.google.cloud.saasplatform.saasservicemgmt.v1beta1.GetTenantRequest\x1a\x39.google.cloud.saasplatform.saasservicemgmt.v1beta1.Tenant\"?\xda\x41\x04name\x82\xd3\xe4\x93\x02\x32\x12\x30/v1beta1/{name=projects/*/locations/*/tenants/*}\x12\xed\x01\n\x0c\x43reateTenant\x12\x46.google.cloud.saasplatform.saasservicemgmt.v1beta1.CreateTenantRequest\x1a\x39.google.cloud.saasplatform.saasservicemgmt.v1beta1.Tenant\"Z\xda\x41\x17parent,tenant,tenant_id\x82\xd3\xe4\x93\x02:\"0/v1beta1/{parent=projects/*/locations/*}/tenants:\x06tenant\x12\xef\x01\n\x0cUpdateTenant\x12\x46.google.cloud.saasplatform.saasservicemgmt.v1beta1.UpdateTenantRequest\x1a\x39.google.cloud.saasplatform.saasservicemgmt.v1beta1.Tenant\"\\\xda\x41\x12tenant,update_mask\x82\xd3\xe4\x93\x02\x41\x32\x37/v1beta1/{tenant.name=projects/*/locations/*/tenants/*}:\x06tenant\x12\xaf\x01\n\x0c\x44\x65leteTenant\x12\x46.google.cloud.saasplatform.saasservicemgmt.v1beta1.DeleteTenantRequest\x1a\x16.google.protobuf.Empty\"?\xda\x41\x04name\x82\xd3\xe4\x93\x02\x32*0/v1beta1/{name=projects/*/locations/*/tenants/*}\x12\xe7\x01\n\rListUnitKinds\x12G.google.cloud.saasplatform.saasservicemgmt.v1beta1.ListUnitKindsRequest\x1aH.google.cloud.saasplatform.saasservicemgmt.v1beta1.ListUnitKindsResponse\"C\xda\x41\x06parent\x82\xd3\xe4\x93\x02\x34\x12\x32/v1beta1/{parent=projects/*/locations/*}/unitKinds\x12\xd4\x01\n\x0bGetUnitKind\x12\x45.google.cloud.saasplatform.saasservicemgmt.v1beta1.GetUnitKindRequest\x1a;.google.cloud.saasplatform.saasservicemgmt.v1beta1.UnitKind\"A\xda\x41\x04name\x82\xd3\xe4\x93\x02\x34\x12\x32/v1beta1/{name=projects/*/locations/*/unitKinds/*}\x12\xfe\x01\n\x0e\x43reateUnitKind\x12H.google.cloud.saasplatform.saasservicemgmt.v1beta1.CreateUnitKindRequest\x1a;.google.cloud.saasplatform.saasservicemgmt.v1beta1.UnitKind\"e\xda\x41\x1dparent,unit_kind,unit_kind_id\x82\xd3\xe4\x93\x02?\"2/v1beta1/{parent=projects/*/locations/*}/unitKinds:\tunit_kind\x12\x80\x02\n\x0eUpdateUnitKind\x12H.google.cloud.saasplatform.saasservicemgmt.v1beta1.UpdateUnitKindRequest\x1a;.google.cloud.saasplatform.saasservicemgmt.v1beta1.UnitKind\"g\xda\x41\x15unit_kind,update_mask\x82\xd3\xe4\x93\x02I2.google.cloud.saasplatform.saasservicemgmt.v1beta1.ErrorBudgetB\x03\xe0\x41\x01H\x00\x88\x01\x01\x12`\n\x06labels\x18\xa1Q \x03(\x0b\x32J.google.cloud.saasplatform.saasservicemgmt.v1beta1.RolloutKind.LabelsEntryB\x03\xe0\x41\x01\x12j\n\x0b\x61nnotations\x18\xa2Q \x03(\x0b\x32O.google.cloud.saasplatform.saasservicemgmt.v1beta1.RolloutKind.AnnotationsEntryB\x03\xe0\x41\x01\x12\x19\n\x03uid\x18\xd9O \x01(\tB\x0b\xe0\x41\x03\xe2\x8c\xcf\xd7\x08\x02\x08\x01\x12\x12\n\x04\x65tag\x18\xdaO \x01(\tB\x03\xe0\x41\x03\x12\x35\n\x0b\x63reate_time\x18\xbfP \x01(\x0b\x32\x1a.google.protobuf.TimestampB\x03\xe0\x41\x03\x12\x35\n\x0bupdate_time\x18\xc0P \x01(\x0b\x32\x1a.google.protobuf.TimestampB\x03\xe0\x41\x03\x1a-\n\x0bLabelsEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12\r\n\x05value\x18\x02 \x01(\t:\x02\x38\x01\x1a\x32\n\x10\x41nnotationsEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12\r\n\x05value\x18\x02 \x01(\t:\x02\x38\x01\"\x90\x01\n\x16UpdateUnitKindStrategy\x12)\n%UPDATE_UNIT_KIND_STRATEGY_UNSPECIFIED\x10\x00\x12&\n\"UPDATE_UNIT_KIND_STRATEGY_ON_START\x10\x01\x12#\n\x1fUPDATE_UNIT_KIND_STRATEGY_NEVER\x10\x02:\x93\x01\xea\x41\x8f\x01\n*saasservicemgmt.googleapis.com/RolloutKind\x12\x46projects/{project}/locations/{location}/rolloutKinds/{rollout_kind_id}*\x0crolloutKinds2\x0brolloutKindB\x0f\n\r_error_budget\"J\n\x0b\x45rrorBudget\x12\x1a\n\rallowed_count\x18\x01 \x01(\x05\x42\x03\xe0\x41\x01\x12\x1f\n\x12\x61llowed_percentage\x18\x02 \x01(\x05\x42\x03\xe0\x41\x01\"n\n\x0cRolloutStats\x12^\n\x13operations_by_state\x18\x02 \x03(\x0b\x32<.google.cloud.saasplatform.saasservicemgmt.v1beta1.AggregateB\x03\xe0\x41\x03\"\xad\x02\n\x0eRolloutControl\x12s\n\nrun_params\x18\x02 \x01(\x0b\x32X.google.cloud.saasplatform.saasservicemgmt.v1beta1.RolloutControl.RunRolloutActionParamsB\x03\xe0\x41\x01H\x00\x12U\n\x06\x61\x63tion\x18\x01 \x01(\x0e\x32@.google.cloud.saasplatform.saasservicemgmt.v1beta1.RolloutActionB\x03\xe0\x41\x02\x1a>\n\x16RunRolloutActionParams\x12$\n\x17retry_failed_operations\x18\x01 \x01(\x08\x42\x03\xe0\x41\x02\x42\x0f\n\raction_params*|\n\rRolloutAction\x12\x1e\n\x1aROLLOUT_ACTION_UNSPECIFIED\x10\x00\x12\x16\n\x12ROLLOUT_ACTION_RUN\x10\x01\x12\x18\n\x14ROLLOUT_ACTION_PAUSE\x10\x02\x12\x19\n\x15ROLLOUT_ACTION_CANCEL\x10\x03\x42\xd6\x02\n5com.google.cloud.saasplatform.saasservicemgmt.v1beta1B\x1aSaasRolloutsResourcesProtoP\x01Z_cloud.google.com/go/saasplatform/saasservicemgmt/apiv1beta1/saasservicemgmtpb;saasservicemgmtpb\xaa\x02\x31Google.Cloud.SaasPlatform.SaasServiceMgmt.V1Beta1\xca\x02\x31Google\\Cloud\\SaasPlatform\\SaasServiceMgmt\\V1beta1\xea\x02\x35Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1b\x06proto3" - -pool = ::Google::Protobuf::DescriptorPool.generated_pool -pool.add_serialized_file(descriptor_data) - -module Google - module Cloud - module SaasPlatform - module SaasServiceMgmt - module V1beta1 - Rollout = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.saasplatform.saasservicemgmt.v1beta1.Rollout").msgclass - Rollout::RolloutState = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.saasplatform.saasservicemgmt.v1beta1.Rollout.RolloutState").enummodule - RolloutKind = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.saasplatform.saasservicemgmt.v1beta1.RolloutKind").msgclass - RolloutKind::UpdateUnitKindStrategy = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.saasplatform.saasservicemgmt.v1beta1.RolloutKind.UpdateUnitKindStrategy").enummodule - ErrorBudget = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.saasplatform.saasservicemgmt.v1beta1.ErrorBudget").msgclass - RolloutStats = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.saasplatform.saasservicemgmt.v1beta1.RolloutStats").msgclass - RolloutControl = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.saasplatform.saasservicemgmt.v1beta1.RolloutControl").msgclass - RolloutControl::RunRolloutActionParams = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.saasplatform.saasservicemgmt.v1beta1.RolloutControl.RunRolloutActionParams").msgclass - RolloutAction = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.saasplatform.saasservicemgmt.v1beta1.RolloutAction").enummodule - end - end - end - end -end diff --git a/owl-bot-staging/google-cloud-saas_platform-saas_service_mgmt-v1beta1/lib/google/cloud/saasplatform/saasservicemgmt/v1beta1/rollouts_service_pb.rb b/owl-bot-staging/google-cloud-saas_platform-saas_service_mgmt-v1beta1/lib/google/cloud/saasplatform/saasservicemgmt/v1beta1/rollouts_service_pb.rb deleted file mode 100644 index d26dbd9cf432..000000000000 --- a/owl-bot-staging/google-cloud-saas_platform-saas_service_mgmt-v1beta1/lib/google/cloud/saasplatform/saasservicemgmt/v1beta1/rollouts_service_pb.rb +++ /dev/null @@ -1,42 +0,0 @@ -# frozen_string_literal: true -# Generated by the protocol buffer compiler. DO NOT EDIT! -# source: google/cloud/saasplatform/saasservicemgmt/v1beta1/rollouts_service.proto - -require 'google/protobuf' - -require 'google/api/annotations_pb' -require 'google/api/client_pb' -require 'google/api/field_behavior_pb' -require 'google/api/resource_pb' -require 'google/cloud/saasplatform/saasservicemgmt/v1beta1/rollouts_resources_pb' -require 'google/protobuf/empty_pb' -require 'google/protobuf/field_mask_pb' - - -descriptor_data = "\nHgoogle/cloud/saasplatform/saasservicemgmt/v1beta1/rollouts_service.proto\x12\x31google.cloud.saasplatform.saasservicemgmt.v1beta1\x1a\x1cgoogle/api/annotations.proto\x1a\x17google/api/client.proto\x1a\x1fgoogle/api/field_behavior.proto\x1a\x19google/api/resource.proto\x1aJgoogle/cloud/saasplatform/saasservicemgmt/v1beta1/rollouts_resources.proto\x1a\x1bgoogle/protobuf/empty.proto\x1a google/protobuf/field_mask.proto\"\xa3\x01\n\x13ListRolloutsRequest\x12?\n\x06parent\x18\x96N \x01(\tB.\xe0\x41\x02\xfa\x41(\x12&saasservicemgmt.googleapis.com/Rollout\x12\x12\n\tpage_size\x18\x89R \x01(\x05\x12\x13\n\npage_token\x18\x8aR \x01(\t\x12\x0f\n\x06\x66ilter\x18\x8bR \x01(\t\x12\x11\n\x08order_by\x18\x8cR \x01(\t\"\x95\x01\n\x14ListRolloutsResponse\x12M\n\x08rollouts\x18\x8dR \x03(\x0b\x32:.google.cloud.saasplatform.saasservicemgmt.v1beta1.Rollout\x12\x18\n\x0fnext_page_token\x18\x8eR \x01(\t\x12\x14\n\x0bunreachable\x18\x8fR \x03(\t\"R\n\x11GetRolloutRequest\x12=\n\x04name\x18\x91N \x01(\tB.\xe0\x41\x02\xfa\x41(\n&saasservicemgmt.googleapis.com/Rollout\"\xf1\x01\n\x14\x43reateRolloutRequest\x12?\n\x06parent\x18\x96N \x01(\tB.\xe0\x41\x02\xfa\x41(\x12&saasservicemgmt.googleapis.com/Rollout\x12\x18\n\nrollout_id\x18\x87R \x01(\tB\x03\xe0\x41\x02\x12Q\n\x07rollout\x18\x88R \x01(\x0b\x32:.google.cloud.saasplatform.saasservicemgmt.v1beta1.RolloutB\x03\xe0\x41\x02\x12\x16\n\rvalidate_only\x18\x85R \x01(\x08\x12\x13\n\nrequest_id\x18\x86R \x01(\t\"\xc8\x01\n\x14UpdateRolloutRequest\x12Q\n\x07rollout\x18\x88R \x01(\x0b\x32:.google.cloud.saasplatform.saasservicemgmt.v1beta1.RolloutB\x03\xe0\x41\x02\x12\x16\n\rvalidate_only\x18\x85R \x01(\x08\x12\x13\n\nrequest_id\x18\x86R \x01(\t\x12\x30\n\x0bupdate_mask\x18\x90R \x01(\x0b\x32\x1a.google.protobuf.FieldMask\"\x91\x01\n\x14\x44\x65leteRolloutRequest\x12=\n\x04name\x18\x91N \x01(\tB.\xe0\x41\x02\xfa\x41(\n&saasservicemgmt.googleapis.com/Rollout\x12\r\n\x04\x65tag\x18\xdaO \x01(\t\x12\x16\n\rvalidate_only\x18\x85R \x01(\x08\x12\x13\n\nrequest_id\x18\x86R \x01(\t\"\xab\x01\n\x17ListRolloutKindsRequest\x12\x43\n\x06parent\x18\x96N \x01(\tB2\xe0\x41\x02\xfa\x41,\x12*saasservicemgmt.googleapis.com/RolloutKind\x12\x12\n\tpage_size\x18\x89R \x01(\x05\x12\x13\n\npage_token\x18\x8aR \x01(\t\x12\x0f\n\x06\x66ilter\x18\x8bR \x01(\t\x12\x11\n\x08order_by\x18\x8cR \x01(\t\"\xa2\x01\n\x18ListRolloutKindsResponse\x12V\n\rrollout_kinds\x18\x8dR \x03(\x0b\x32>.google.cloud.saasplatform.saasservicemgmt.v1beta1.RolloutKind\x12\x18\n\x0fnext_page_token\x18\x8eR \x01(\t\x12\x14\n\x0bunreachable\x18\x8fR \x03(\t\"Z\n\x15GetRolloutKindRequest\x12\x41\n\x04name\x18\x91N \x01(\tB2\xe0\x41\x02\xfa\x41,\n*saasservicemgmt.googleapis.com/RolloutKind\"\x87\x02\n\x18\x43reateRolloutKindRequest\x12\x43\n\x06parent\x18\x96N \x01(\tB2\xe0\x41\x02\xfa\x41,\x12*saasservicemgmt.googleapis.com/RolloutKind\x12\x1d\n\x0frollout_kind_id\x18\x87R \x01(\tB\x03\xe0\x41\x02\x12Z\n\x0crollout_kind\x18\x88R \x01(\x0b\x32>.google.cloud.saasplatform.saasservicemgmt.v1beta1.RolloutKindB\x03\xe0\x41\x02\x12\x16\n\rvalidate_only\x18\x85R \x01(\x08\x12\x13\n\nrequest_id\x18\x86R \x01(\t\"\xd5\x01\n\x18UpdateRolloutKindRequest\x12Z\n\x0crollout_kind\x18\x88R \x01(\x0b\x32>.google.cloud.saasplatform.saasservicemgmt.v1beta1.RolloutKindB\x03\xe0\x41\x02\x12\x16\n\rvalidate_only\x18\x85R \x01(\x08\x12\x13\n\nrequest_id\x18\x86R \x01(\t\x12\x30\n\x0bupdate_mask\x18\x90R \x01(\x0b\x32\x1a.google.protobuf.FieldMask\"\x99\x01\n\x18\x44\x65leteRolloutKindRequest\x12\x41\n\x04name\x18\x91N \x01(\tB2\xe0\x41\x02\xfa\x41,\n*saasservicemgmt.googleapis.com/RolloutKind\x12\r\n\x04\x65tag\x18\xdaO \x01(\t\x12\x16\n\rvalidate_only\x18\x85R \x01(\x08\x12\x13\n\nrequest_id\x18\x86R \x01(\t2\x88\x13\n\x0cSaasRollouts\x12\xe3\x01\n\x0cListRollouts\x12\x46.google.cloud.saasplatform.saasservicemgmt.v1beta1.ListRolloutsRequest\x1aG.google.cloud.saasplatform.saasservicemgmt.v1beta1.ListRolloutsResponse\"B\xda\x41\x06parent\x82\xd3\xe4\x93\x02\x33\x12\x31/v1beta1/{parent=projects/*/locations/*}/rollouts\x12\xd0\x01\n\nGetRollout\x12\x44.google.cloud.saasplatform.saasservicemgmt.v1beta1.GetRolloutRequest\x1a:.google.cloud.saasplatform.saasservicemgmt.v1beta1.Rollout\"@\xda\x41\x04name\x82\xd3\xe4\x93\x02\x33\x12\x31/v1beta1/{name=projects/*/locations/*/rollouts/*}\x12\xf4\x01\n\rCreateRollout\x12G.google.cloud.saasplatform.saasservicemgmt.v1beta1.CreateRolloutRequest\x1a:.google.cloud.saasplatform.saasservicemgmt.v1beta1.Rollout\"^\xda\x41\x19parent,rollout,rollout_id\x82\xd3\xe4\x93\x02<\"1/v1beta1/{parent=projects/*/locations/*}/rollouts:\x07rollout\x12\xf6\x01\n\rUpdateRollout\x12G.google.cloud.saasplatform.saasservicemgmt.v1beta1.UpdateRolloutRequest\x1a:.google.cloud.saasplatform.saasservicemgmt.v1beta1.Rollout\"`\xda\x41\x13rollout,update_mask\x82\xd3\xe4\x93\x02\x44\x32\x39/v1beta1/{rollout.name=projects/*/locations/*/rollouts/*}:\x07rollout\x12\xb2\x01\n\rDeleteRollout\x12G.google.cloud.saasplatform.saasservicemgmt.v1beta1.DeleteRolloutRequest\x1a\x16.google.protobuf.Empty\"@\xda\x41\x04name\x82\xd3\xe4\x93\x02\x33*1/v1beta1/{name=projects/*/locations/*/rollouts/*}\x12\xf3\x01\n\x10ListRolloutKinds\x12J.google.cloud.saasplatform.saasservicemgmt.v1beta1.ListRolloutKindsRequest\x1aK.google.cloud.saasplatform.saasservicemgmt.v1beta1.ListRolloutKindsResponse\"F\xda\x41\x06parent\x82\xd3\xe4\x93\x02\x37\x12\x35/v1beta1/{parent=projects/*/locations/*}/rolloutKinds\x12\xe0\x01\n\x0eGetRolloutKind\x12H.google.cloud.saasplatform.saasservicemgmt.v1beta1.GetRolloutKindRequest\x1a>.google.cloud.saasplatform.saasservicemgmt.v1beta1.RolloutKind\"D\xda\x41\x04name\x82\xd3\xe4\x93\x02\x37\x12\x35/v1beta1/{name=projects/*/locations/*/rolloutKinds/*}\x12\x93\x02\n\x11\x43reateRolloutKind\x12K.google.cloud.saasplatform.saasservicemgmt.v1beta1.CreateRolloutKindRequest\x1a>.google.cloud.saasplatform.saasservicemgmt.v1beta1.RolloutKind\"q\xda\x41#parent,rollout_kind,rollout_kind_id\x82\xd3\xe4\x93\x02\x45\"5/v1beta1/{parent=projects/*/locations/*}/rolloutKinds:\x0crollout_kind\x12\x95\x02\n\x11UpdateRolloutKind\x12K.google.cloud.saasplatform.saasservicemgmt.v1beta1.UpdateRolloutKindRequest\x1a>.google.cloud.saasplatform.saasservicemgmt.v1beta1.RolloutKind\"s\xda\x41\x18rollout_kind,update_mask\x82\xd3\xe4\x93\x02R2B/v1beta1/{rollout_kind.name=projects/*/locations/*/rolloutKinds/*}:\x0crollout_kind\x12\xbe\x01\n\x11\x44\x65leteRolloutKind\x12K.google.cloud.saasplatform.saasservicemgmt.v1beta1.DeleteRolloutKindRequest\x1a\x16.google.protobuf.Empty\"D\xda\x41\x04name\x82\xd3\xe4\x93\x02\x37*5/v1beta1/{name=projects/*/locations/*/rolloutKinds/*}\x1aR\xca\x41\x1esaasservicemgmt.googleapis.com\xd2\x41.https://www.googleapis.com/auth/cloud-platformB\xd4\x02\n5com.google.cloud.saasplatform.saasservicemgmt.v1beta1B\x18SaasRolloutsServiceProtoP\x01Z_cloud.google.com/go/saasplatform/saasservicemgmt/apiv1beta1/saasservicemgmtpb;saasservicemgmtpb\xaa\x02\x31Google.Cloud.SaasPlatform.SaasServiceMgmt.V1Beta1\xca\x02\x31Google\\Cloud\\SaasPlatform\\SaasServiceMgmt\\V1beta1\xea\x02\x35Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1b\x06proto3" - -pool = ::Google::Protobuf::DescriptorPool.generated_pool -pool.add_serialized_file(descriptor_data) - -module Google - module Cloud - module SaasPlatform - module SaasServiceMgmt - module V1beta1 - ListRolloutsRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.saasplatform.saasservicemgmt.v1beta1.ListRolloutsRequest").msgclass - ListRolloutsResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.saasplatform.saasservicemgmt.v1beta1.ListRolloutsResponse").msgclass - GetRolloutRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.saasplatform.saasservicemgmt.v1beta1.GetRolloutRequest").msgclass - CreateRolloutRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.saasplatform.saasservicemgmt.v1beta1.CreateRolloutRequest").msgclass - UpdateRolloutRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.saasplatform.saasservicemgmt.v1beta1.UpdateRolloutRequest").msgclass - DeleteRolloutRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.saasplatform.saasservicemgmt.v1beta1.DeleteRolloutRequest").msgclass - ListRolloutKindsRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.saasplatform.saasservicemgmt.v1beta1.ListRolloutKindsRequest").msgclass - ListRolloutKindsResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.saasplatform.saasservicemgmt.v1beta1.ListRolloutKindsResponse").msgclass - GetRolloutKindRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.saasplatform.saasservicemgmt.v1beta1.GetRolloutKindRequest").msgclass - CreateRolloutKindRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.saasplatform.saasservicemgmt.v1beta1.CreateRolloutKindRequest").msgclass - UpdateRolloutKindRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.saasplatform.saasservicemgmt.v1beta1.UpdateRolloutKindRequest").msgclass - DeleteRolloutKindRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.saasplatform.saasservicemgmt.v1beta1.DeleteRolloutKindRequest").msgclass - end - end - end - end -end diff --git a/owl-bot-staging/google-cloud-saas_platform-saas_service_mgmt-v1beta1/lib/google/cloud/saasplatform/saasservicemgmt/v1beta1/rollouts_service_services_pb.rb b/owl-bot-staging/google-cloud-saas_platform-saas_service_mgmt-v1beta1/lib/google/cloud/saasplatform/saasservicemgmt/v1beta1/rollouts_service_services_pb.rb deleted file mode 100644 index 48e36153293b..000000000000 --- a/owl-bot-staging/google-cloud-saas_platform-saas_service_mgmt-v1beta1/lib/google/cloud/saasplatform/saasservicemgmt/v1beta1/rollouts_service_services_pb.rb +++ /dev/null @@ -1,65 +0,0 @@ -# Generated by the protocol buffer compiler. DO NOT EDIT! -# Source: google/cloud/saasplatform/saasservicemgmt/v1beta1/rollouts_service.proto for package 'Google.Cloud.SaasPlatform.SaasServiceMgmt.V1beta1' -# Original file comments: -# 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 -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. -# - -require 'grpc' -require 'google/cloud/saasplatform/saasservicemgmt/v1beta1/rollouts_service_pb' - -module Google - module Cloud - module SaasPlatform - module SaasServiceMgmt - module V1beta1 - module SaasRollouts - # Manages the rollout of SaaS services. - class Service - - include ::GRPC::GenericService - - self.marshal_class_method = :encode - self.unmarshal_class_method = :decode - self.service_name = 'google.cloud.saasplatform.saasservicemgmt.v1beta1.SaasRollouts' - - # Retrieve a collection of rollouts. - rpc :ListRollouts, ::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::ListRolloutsRequest, ::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::ListRolloutsResponse - # Retrieve a single rollout. - rpc :GetRollout, ::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::GetRolloutRequest, ::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::Rollout - # Create a new rollout. - rpc :CreateRollout, ::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::CreateRolloutRequest, ::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::Rollout - # Update a single rollout. - rpc :UpdateRollout, ::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::UpdateRolloutRequest, ::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::Rollout - # Delete a single rollout. - rpc :DeleteRollout, ::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::DeleteRolloutRequest, ::Google::Protobuf::Empty - # Retrieve a collection of rollout kinds. - rpc :ListRolloutKinds, ::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::ListRolloutKindsRequest, ::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::ListRolloutKindsResponse - # Retrieve a single rollout kind. - rpc :GetRolloutKind, ::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::GetRolloutKindRequest, ::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::RolloutKind - # Create a new rollout kind. - rpc :CreateRolloutKind, ::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::CreateRolloutKindRequest, ::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::RolloutKind - # Update a single rollout kind. - rpc :UpdateRolloutKind, ::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::UpdateRolloutKindRequest, ::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::RolloutKind - # Delete a single rollout kind. - rpc :DeleteRolloutKind, ::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::DeleteRolloutKindRequest, ::Google::Protobuf::Empty - end - - Stub = Service.rpc_stub_class - end - end - end - end - end -end diff --git a/owl-bot-staging/google-cloud-saas_platform-saas_service_mgmt-v1beta1/proto_docs/README.md b/owl-bot-staging/google-cloud-saas_platform-saas_service_mgmt-v1beta1/proto_docs/README.md deleted file mode 100644 index 10d10d09fe56..000000000000 --- a/owl-bot-staging/google-cloud-saas_platform-saas_service_mgmt-v1beta1/proto_docs/README.md +++ /dev/null @@ -1,4 +0,0 @@ -# SaaS Runtime V1BETA1 Protocol Buffer Documentation - -These files are for the YARD documentation of the generated protobuf files. -They are not intended to be required or loaded at runtime. diff --git a/owl-bot-staging/google-cloud-saas_platform-saas_service_mgmt-v1beta1/proto_docs/google/api/client.rb b/owl-bot-staging/google-cloud-saas_platform-saas_service_mgmt-v1beta1/proto_docs/google/api/client.rb deleted file mode 100644 index 5089551e9ea4..000000000000 --- a/owl-bot-staging/google-cloud-saas_platform-saas_service_mgmt-v1beta1/proto_docs/google/api/client.rb +++ /dev/null @@ -1,589 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - - -module Google - module Api - # Required information for every language. - # @!attribute [rw] reference_docs_uri - # @deprecated This field is deprecated and may be removed in the next major version update. - # @return [::String] - # Link to automatically generated reference documentation. Example: - # https://cloud.google.com/nodejs/docs/reference/asset/latest - # @!attribute [rw] destinations - # @return [::Array<::Google::Api::ClientLibraryDestination>] - # The destination where API teams want this client library to be published. - # @!attribute [rw] selective_gapic_generation - # @return [::Google::Api::SelectiveGapicGeneration] - # Configuration for which RPCs should be generated in the GAPIC client. - class CommonLanguageSettings - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Details about how and where to publish client libraries. - # @!attribute [rw] version - # @return [::String] - # Version of the API to apply these settings to. This is the full protobuf - # package for the API, ending in the version element. - # Examples: "google.cloud.speech.v1" and "google.spanner.admin.database.v1". - # @!attribute [rw] launch_stage - # @return [::Google::Api::LaunchStage] - # Launch stage of this version of the API. - # @!attribute [rw] rest_numeric_enums - # @return [::Boolean] - # When using transport=rest, the client request will encode enums as - # numbers rather than strings. - # @!attribute [rw] java_settings - # @return [::Google::Api::JavaSettings] - # Settings for legacy Java features, supported in the Service YAML. - # @!attribute [rw] cpp_settings - # @return [::Google::Api::CppSettings] - # Settings for C++ client libraries. - # @!attribute [rw] php_settings - # @return [::Google::Api::PhpSettings] - # Settings for PHP client libraries. - # @!attribute [rw] python_settings - # @return [::Google::Api::PythonSettings] - # Settings for Python client libraries. - # @!attribute [rw] node_settings - # @return [::Google::Api::NodeSettings] - # Settings for Node client libraries. - # @!attribute [rw] dotnet_settings - # @return [::Google::Api::DotnetSettings] - # Settings for .NET client libraries. - # @!attribute [rw] ruby_settings - # @return [::Google::Api::RubySettings] - # Settings for Ruby client libraries. - # @!attribute [rw] go_settings - # @return [::Google::Api::GoSettings] - # Settings for Go client libraries. - class ClientLibrarySettings - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # This message configures the settings for publishing [Google Cloud Client - # libraries](https://cloud.google.com/apis/docs/cloud-client-libraries) - # generated from the service config. - # @!attribute [rw] method_settings - # @return [::Array<::Google::Api::MethodSettings>] - # A list of API method settings, e.g. the behavior for methods that use the - # long-running operation pattern. - # @!attribute [rw] new_issue_uri - # @return [::String] - # Link to a *public* URI where users can report issues. Example: - # https://issuetracker.google.com/issues/new?component=190865&template=1161103 - # @!attribute [rw] documentation_uri - # @return [::String] - # Link to product home page. Example: - # https://cloud.google.com/asset-inventory/docs/overview - # @!attribute [rw] api_short_name - # @return [::String] - # Used as a tracking tag when collecting data about the APIs developer - # relations artifacts like docs, packages delivered to package managers, - # etc. Example: "speech". - # @!attribute [rw] github_label - # @return [::String] - # GitHub label to apply to issues and pull requests opened for this API. - # @!attribute [rw] codeowner_github_teams - # @return [::Array<::String>] - # GitHub teams to be added to CODEOWNERS in the directory in GitHub - # containing source code for the client libraries for this API. - # @!attribute [rw] doc_tag_prefix - # @return [::String] - # A prefix used in sample code when demarking regions to be included in - # documentation. - # @!attribute [rw] organization - # @return [::Google::Api::ClientLibraryOrganization] - # For whom the client library is being published. - # @!attribute [rw] library_settings - # @return [::Array<::Google::Api::ClientLibrarySettings>] - # Client library settings. If the same version string appears multiple - # times in this list, then the last one wins. Settings from earlier - # settings with the same version string are discarded. - # @!attribute [rw] proto_reference_documentation_uri - # @return [::String] - # Optional link to proto reference documentation. Example: - # https://cloud.google.com/pubsub/lite/docs/reference/rpc - # @!attribute [rw] rest_reference_documentation_uri - # @return [::String] - # Optional link to REST reference documentation. Example: - # https://cloud.google.com/pubsub/lite/docs/reference/rest - class Publishing - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Settings for Java client libraries. - # @!attribute [rw] library_package - # @return [::String] - # The package name to use in Java. Clobbers the java_package option - # set in the protobuf. This should be used **only** by APIs - # who have already set the language_settings.java.package_name" field - # in gapic.yaml. API teams should use the protobuf java_package option - # where possible. - # - # Example of a YAML configuration:: - # - # publishing: - # 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. - # @!attribute [rw] methods - # @return [::Array<::String>] - # An allowlist of the fully qualified names of RPCs that should be included - # on public client surfaces. - # @!attribute [rw] generate_omitted_as_internal - # @return [::Boolean] - # Setting this to true indicates to the client generators that methods - # that would be excluded from the generation should instead be generated - # in a way that indicates these methods should not be consumed by - # end users. How this is expressed is up to individual language - # implementations to decide. Some examples may be: added annotations, - # obfuscated identifiers, or other language idiomatic patterns. - class SelectiveGapicGeneration - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # `BatchingConfigProto` defines the batching configuration for an API method. - # @!attribute [rw] thresholds - # @return [::Google::Api::BatchingSettingsProto] - # The thresholds which trigger a batched request to be sent. - # @!attribute [rw] batch_descriptor - # @return [::Google::Api::BatchingDescriptorProto] - # The request and response fields used in batching. - class BatchingConfigProto - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # `BatchingSettingsProto` specifies a set of batching thresholds, each of - # which acts as a trigger to send a batch of messages as a request. At least - # one threshold must be positive nonzero. - # @!attribute [rw] element_count_threshold - # @return [::Integer] - # The number of elements of a field collected into a batch which, if - # exceeded, causes the batch to be sent. - # @!attribute [rw] request_byte_threshold - # @return [::Integer] - # The aggregated size of the batched field which, if exceeded, causes the - # batch to be sent. This size is computed by aggregating the sizes of the - # request field to be batched, not of the entire request message. - # @!attribute [rw] delay_threshold - # @return [::Google::Protobuf::Duration] - # The duration after which a batch should be sent, starting from the addition - # of the first message to that batch. - # @!attribute [rw] element_count_limit - # @return [::Integer] - # The maximum number of elements collected in a batch that could be accepted - # by server. - # @!attribute [rw] request_byte_limit - # @return [::Integer] - # The maximum size of the request that could be accepted by server. - # @!attribute [rw] flow_control_element_limit - # @return [::Integer] - # The maximum number of elements allowed by flow control. - # @!attribute [rw] flow_control_byte_limit - # @return [::Integer] - # The maximum size of data allowed by flow control. - # @!attribute [rw] flow_control_limit_exceeded_behavior - # @return [::Google::Api::FlowControlLimitExceededBehaviorProto] - # The behavior to take when the flow control limit is exceeded. - class BatchingSettingsProto - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # `BatchingDescriptorProto` specifies the fields of the request message to be - # used for batching, and, optionally, the fields of the response message to be - # used for demultiplexing. - # @!attribute [rw] batched_field - # @return [::String] - # The repeated field in the request message to be aggregated by batching. - # @!attribute [rw] discriminator_fields - # @return [::Array<::String>] - # A list of the fields in the request message. Two requests will be batched - # together only if the values of every field specified in - # `request_discriminator_fields` is equal between the two requests. - # @!attribute [rw] subresponse_field - # @return [::String] - # Optional. When present, indicates the field in the response message to be - # used to demultiplex the response into multiple response messages, in - # correspondence with the multiple request messages originally batched - # together. - class BatchingDescriptorProto - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # The organization for which the client libraries are being published. - # Affects the url where generated docs are published, etc. - module ClientLibraryOrganization - # Not useful. - CLIENT_LIBRARY_ORGANIZATION_UNSPECIFIED = 0 - - # Google Cloud Platform Org. - CLOUD = 1 - - # Ads (Advertising) Org. - ADS = 2 - - # Photos Org. - PHOTOS = 3 - - # Street View Org. - STREET_VIEW = 4 - - # Shopping Org. - SHOPPING = 5 - - # Geo Org. - GEO = 6 - - # Generative AI - https://developers.generativeai.google - GENERATIVE_AI = 7 - end - - # To where should client libraries be published? - module ClientLibraryDestination - # Client libraries will neither be generated nor published to package - # managers. - CLIENT_LIBRARY_DESTINATION_UNSPECIFIED = 0 - - # Generate the client library in a repo under github.com/googleapis, - # but don't publish it to package managers. - GITHUB = 10 - - # Publish the library to package managers like nuget.org and npmjs.com. - PACKAGE_MANAGER = 20 - end - - # The behavior to take when the flow control limit is exceeded. - module FlowControlLimitExceededBehaviorProto - # Default behavior, system-defined. - UNSET_BEHAVIOR = 0 - - # Stop operation, raise error. - THROW_EXCEPTION = 1 - - # Pause operation until limit clears. - BLOCK = 2 - - # Continue operation, disregard limit. - IGNORE = 3 - end - end -end diff --git a/owl-bot-staging/google-cloud-saas_platform-saas_service_mgmt-v1beta1/proto_docs/google/api/field_behavior.rb b/owl-bot-staging/google-cloud-saas_platform-saas_service_mgmt-v1beta1/proto_docs/google/api/field_behavior.rb deleted file mode 100644 index 582be187d115..000000000000 --- a/owl-bot-staging/google-cloud-saas_platform-saas_service_mgmt-v1beta1/proto_docs/google/api/field_behavior.rb +++ /dev/null @@ -1,85 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - - -module Google - module Api - # An indicator of the behavior of a given field (for example, that a field - # is required in requests, or given as output but ignored as input). - # This **does not** change the behavior in protocol buffers itself; it only - # denotes the behavior and may affect how API tooling handles the field. - # - # Note: This enum **may** receive new values in the future. - module FieldBehavior - # Conventional default for enums. Do not use this. - FIELD_BEHAVIOR_UNSPECIFIED = 0 - - # Specifically denotes a field as optional. - # While all fields in protocol buffers are optional, this may be specified - # for emphasis if appropriate. - OPTIONAL = 1 - - # Denotes a field as required. - # This indicates that the field **must** be provided as part of the request, - # and failure to do so will cause an error (usually `INVALID_ARGUMENT`). - REQUIRED = 2 - - # Denotes a field as output only. - # This indicates that the field is provided in responses, but including the - # field in a request does nothing (the server *must* ignore it and - # *must not* throw an error as a result of the field's presence). - OUTPUT_ONLY = 3 - - # Denotes a field as input only. - # This indicates that the field is provided in requests, and the - # corresponding field is not included in output. - INPUT_ONLY = 4 - - # Denotes a field as immutable. - # This indicates that the field may be set once in a request to create a - # resource, but may not be changed thereafter. - IMMUTABLE = 5 - - # Denotes that a (repeated) field is an unordered list. - # This indicates that the service may provide the elements of the list - # in any arbitrary order, rather than the order the user originally - # provided. Additionally, the list's order may or may not be stable. - UNORDERED_LIST = 6 - - # Denotes that this field returns a non-empty default value if not set. - # This indicates that if the user provides the empty value in a request, - # a non-empty value will be returned. The user will not be aware of what - # non-empty value to expect. - NON_EMPTY_DEFAULT = 7 - - # Denotes that the field in a resource (a message annotated with - # google.api.resource) is used in the resource name to uniquely identify the - # resource. For AIP-compliant APIs, this should only be applied to the - # `name` field on the resource. - # - # This behavior should not be applied to references to other resources within - # the message. - # - # The identifier field of resources often have different field behavior - # depending on the request it is embedded in (e.g. for Create methods name - # is optional and unused, while for Update methods it is required). Instead - # of method-specific annotations, only `IDENTIFIER` is required. - IDENTIFIER = 8 - end - end -end diff --git a/owl-bot-staging/google-cloud-saas_platform-saas_service_mgmt-v1beta1/proto_docs/google/api/field_info.rb b/owl-bot-staging/google-cloud-saas_platform-saas_service_mgmt-v1beta1/proto_docs/google/api/field_info.rb deleted file mode 100644 index 0f5acf0a5538..000000000000 --- a/owl-bot-staging/google-cloud-saas_platform-saas_service_mgmt-v1beta1/proto_docs/google/api/field_info.rb +++ /dev/null @@ -1,88 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - - -module Google - module Api - # Rich semantic information of an API field beyond basic typing. - # @!attribute [rw] format - # @return [::Google::Api::FieldInfo::Format] - # The standard format of a field value. This does not explicitly configure - # any API consumer, just documents the API's format for the field it is - # applied to. - # @!attribute [rw] referenced_types - # @return [::Array<::Google::Api::TypeReference>] - # The type(s) that the annotated, generic field may represent. - # - # Currently, this must only be used on fields of type `google.protobuf.Any`. - # Supporting other generic types may be considered in the future. - class FieldInfo - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - - # The standard format of a field value. The supported formats are all backed - # by either an RFC defined by the IETF or a Google-defined AIP. - module Format - # Default, unspecified value. - FORMAT_UNSPECIFIED = 0 - - # Universally Unique Identifier, version 4, value as defined by - # https://datatracker.ietf.org/doc/html/rfc4122. The value may be - # normalized to entirely lowercase letters. For example, the value - # `F47AC10B-58CC-0372-8567-0E02B2C3D479` would be normalized to - # `f47ac10b-58cc-0372-8567-0e02b2c3d479`. - UUID4 = 1 - - # Internet Protocol v4 value as defined by [RFC - # 791](https://datatracker.ietf.org/doc/html/rfc791). The value may be - # condensed, with leading zeros in each octet stripped. For example, - # `001.022.233.040` would be condensed to `1.22.233.40`. - IPV4 = 2 - - # Internet Protocol v6 value as defined by [RFC - # 2460](https://datatracker.ietf.org/doc/html/rfc2460). The value may be - # normalized to entirely lowercase letters with zeros compressed, following - # [RFC 5952](https://datatracker.ietf.org/doc/html/rfc5952). For example, - # the value `2001:0DB8:0::0` would be normalized to `2001:db8::`. - IPV6 = 3 - - # An IP address in either v4 or v6 format as described by the individual - # values defined herein. See the comments on the IPV4 and IPV6 types for - # allowed normalizations of each. - IPV4_OR_IPV6 = 4 - end - end - - # A reference to a message type, for use in {::Google::Api::FieldInfo FieldInfo}. - # @!attribute [rw] type_name - # @return [::String] - # The name of the type that the annotated, generic field may represent. - # If the type is in the same protobuf package, the value can be the simple - # message name e.g., `"MyMessage"`. Otherwise, the value must be the - # fully-qualified message name e.g., `"google.library.v1.Book"`. - # - # If the type(s) are unknown to the service (e.g. the field accepts generic - # user input), use the wildcard `"*"` to denote this behavior. - # - # See [AIP-202](https://google.aip.dev/202#type-references) for more details. - class TypeReference - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - end -end diff --git a/owl-bot-staging/google-cloud-saas_platform-saas_service_mgmt-v1beta1/proto_docs/google/api/launch_stage.rb b/owl-bot-staging/google-cloud-saas_platform-saas_service_mgmt-v1beta1/proto_docs/google/api/launch_stage.rb deleted file mode 100644 index 9392a413fb1b..000000000000 --- a/owl-bot-staging/google-cloud-saas_platform-saas_service_mgmt-v1beta1/proto_docs/google/api/launch_stage.rb +++ /dev/null @@ -1,71 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - - -module Google - module Api - # The launch stage as defined by [Google Cloud Platform - # Launch Stages](https://cloud.google.com/terms/launch-stages). - module LaunchStage - # Do not use this default value. - LAUNCH_STAGE_UNSPECIFIED = 0 - - # The feature is not yet implemented. Users can not use it. - UNIMPLEMENTED = 6 - - # Prelaunch features are hidden from users and are only visible internally. - PRELAUNCH = 7 - - # Early Access features are limited to a closed group of testers. To use - # these features, you must sign up in advance and sign a Trusted Tester - # agreement (which includes confidentiality provisions). These features may - # be unstable, changed in backward-incompatible ways, and are not - # guaranteed to be released. - EARLY_ACCESS = 1 - - # Alpha is a limited availability test for releases before they are cleared - # for widespread use. By Alpha, all significant design issues are resolved - # and we are in the process of verifying functionality. Alpha customers - # need to apply for access, agree to applicable terms, and have their - # projects allowlisted. Alpha releases don't have to be feature complete, - # no SLAs are provided, and there are no technical support obligations, but - # they will be far enough along that customers can actually use them in - # test environments or for limited-use tests -- just like they would in - # normal production cases. - ALPHA = 2 - - # Beta is the point at which we are ready to open a release for any - # customer to use. There are no SLA or technical support obligations in a - # Beta release. Products will be complete from a feature perspective, but - # may have some open outstanding issues. Beta releases are suitable for - # limited production use cases. - BETA = 3 - - # GA features are open to all developers and are considered stable and - # fully qualified for production use. - GA = 4 - - # Deprecated features are scheduled to be shut down and removed. For more - # information, see the "Deprecation Policy" section of our [Terms of - # Service](https://cloud.google.com/terms/) - # and the [Google Cloud Platform Subject to the Deprecation - # Policy](https://cloud.google.com/terms/deprecation) documentation. - DEPRECATED = 5 - end - end -end diff --git a/owl-bot-staging/google-cloud-saas_platform-saas_service_mgmt-v1beta1/proto_docs/google/api/resource.rb b/owl-bot-staging/google-cloud-saas_platform-saas_service_mgmt-v1beta1/proto_docs/google/api/resource.rb deleted file mode 100644 index 25dec4847ac1..000000000000 --- a/owl-bot-staging/google-cloud-saas_platform-saas_service_mgmt-v1beta1/proto_docs/google/api/resource.rb +++ /dev/null @@ -1,227 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - - -module Google - module Api - # A simple descriptor of a resource type. - # - # ResourceDescriptor annotates a resource message (either by means of a - # protobuf annotation or use in the service config), and associates the - # resource's schema, the resource type, and the pattern of the resource name. - # - # Example: - # - # message Topic { - # // Indicates this message defines a resource schema. - # // Declares the resource type in the format of {service}/{kind}. - # // For Kubernetes resources, the format is {api group}/{kind}. - # option (google.api.resource) = { - # type: "pubsub.googleapis.com/Topic" - # pattern: "projects/{project}/topics/{topic}" - # }; - # } - # - # The ResourceDescriptor Yaml config will look like: - # - # resources: - # - type: "pubsub.googleapis.com/Topic" - # pattern: "projects/{project}/topics/{topic}" - # - # Sometimes, resources have multiple patterns, typically because they can - # live under multiple parents. - # - # Example: - # - # message LogEntry { - # option (google.api.resource) = { - # type: "logging.googleapis.com/LogEntry" - # pattern: "projects/{project}/logs/{log}" - # pattern: "folders/{folder}/logs/{log}" - # pattern: "organizations/{organization}/logs/{log}" - # pattern: "billingAccounts/{billing_account}/logs/{log}" - # }; - # } - # - # The ResourceDescriptor Yaml config will look like: - # - # resources: - # - type: 'logging.googleapis.com/LogEntry' - # pattern: "projects/{project}/logs/{log}" - # pattern: "folders/{folder}/logs/{log}" - # pattern: "organizations/{organization}/logs/{log}" - # pattern: "billingAccounts/{billing_account}/logs/{log}" - # @!attribute [rw] type - # @return [::String] - # The resource type. It must be in the format of - # \\{service_name}/\\{resource_type_kind}. The `resource_type_kind` must be - # singular and must not include version numbers. - # - # Example: `storage.googleapis.com/Bucket` - # - # The value of the resource_type_kind must follow the regular expression - # /[A-Za-z][a-zA-Z0-9]+/. It should start with an upper case character and - # should use PascalCase (UpperCamelCase). The maximum number of - # characters allowed for the `resource_type_kind` is 100. - # @!attribute [rw] pattern - # @return [::Array<::String>] - # Optional. The relative resource name pattern associated with this resource - # type. The DNS prefix of the full resource name shouldn't be specified here. - # - # The path pattern must follow the syntax, which aligns with HTTP binding - # syntax: - # - # Template = Segment { "/" Segment } ; - # Segment = LITERAL | Variable ; - # Variable = "{" LITERAL "}" ; - # - # Examples: - # - # - "projects/\\{project}/topics/\\{topic}" - # - "projects/\\{project}/knowledgeBases/\\{knowledge_base}" - # - # The components in braces correspond to the IDs for each resource in the - # hierarchy. It is expected that, if multiple patterns are provided, - # the same component name (e.g. "project") refers to IDs of the same - # type of resource. - # @!attribute [rw] name_field - # @return [::String] - # Optional. The field on the resource that designates the resource name - # field. If omitted, this is assumed to be "name". - # @!attribute [rw] history - # @return [::Google::Api::ResourceDescriptor::History] - # Optional. The historical or future-looking state of the resource pattern. - # - # Example: - # - # // The InspectTemplate message originally only supported resource - # // names with organization, and project was added later. - # message InspectTemplate { - # option (google.api.resource) = { - # type: "dlp.googleapis.com/InspectTemplate" - # pattern: - # "organizations/{organization}/inspectTemplates/{inspect_template}" - # pattern: "projects/{project}/inspectTemplates/{inspect_template}" - # history: ORIGINALLY_SINGLE_PATTERN - # }; - # } - # @!attribute [rw] plural - # @return [::String] - # The plural name used in the resource name and permission names, such as - # 'projects' for the resource name of 'projects/\\{project}' and the permission - # name of 'cloudresourcemanager.googleapis.com/projects.get'. One exception - # to this is for Nested Collections that have stuttering names, as defined - # in [AIP-122](https://google.aip.dev/122#nested-collections), where the - # collection ID in the resource name pattern does not necessarily directly - # match the `plural` value. - # - # It is the same concept of the `plural` field in k8s CRD spec - # https://kubernetes.io/docs/tasks/access-kubernetes-api/custom-resources/custom-resource-definitions/ - # - # Note: The plural form is required even for singleton resources. See - # https://aip.dev/156 - # @!attribute [rw] singular - # @return [::String] - # The same concept of the `singular` field in k8s CRD spec - # https://kubernetes.io/docs/tasks/access-kubernetes-api/custom-resources/custom-resource-definitions/ - # Such as "project" for the `resourcemanager.googleapis.com/Project` type. - # @!attribute [rw] style - # @return [::Array<::Google::Api::ResourceDescriptor::Style>] - # Style flag(s) for this resource. - # These indicate that a resource is expected to conform to a given - # style. See the specific style flags for additional information. - class ResourceDescriptor - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - - # A description of the historical or future-looking state of the - # resource pattern. - module History - # The "unset" value. - HISTORY_UNSPECIFIED = 0 - - # The resource originally had one pattern and launched as such, and - # additional patterns were added later. - ORIGINALLY_SINGLE_PATTERN = 1 - - # The resource has one pattern, but the API owner expects to add more - # later. (This is the inverse of ORIGINALLY_SINGLE_PATTERN, and prevents - # that from being necessary once there are multiple patterns.) - FUTURE_MULTI_PATTERN = 2 - end - - # A flag representing a specific style that a resource claims to conform to. - module Style - # The unspecified value. Do not use. - STYLE_UNSPECIFIED = 0 - - # This resource is intended to be "declarative-friendly". - # - # Declarative-friendly resources must be more strictly consistent, and - # setting this to true communicates to tools that this resource should - # adhere to declarative-friendly expectations. - # - # Note: This is used by the API linter (linter.aip.dev) to enable - # additional checks. - DECLARATIVE_FRIENDLY = 1 - end - end - - # Defines a proto annotation that describes a string field that refers to - # an API resource. - # @!attribute [rw] type - # @return [::String] - # The resource type that the annotated field references. - # - # Example: - # - # message Subscription { - # string topic = 2 [(google.api.resource_reference) = { - # type: "pubsub.googleapis.com/Topic" - # }]; - # } - # - # Occasionally, a field may reference an arbitrary resource. In this case, - # APIs use the special value * in their resource reference. - # - # Example: - # - # message GetIamPolicyRequest { - # string resource = 2 [(google.api.resource_reference) = { - # type: "*" - # }]; - # } - # @!attribute [rw] child_type - # @return [::String] - # The resource type of a child collection that the annotated field - # references. This is useful for annotating the `parent` field that - # doesn't have a fixed resource type. - # - # Example: - # - # message ListLogEntriesRequest { - # string parent = 1 [(google.api.resource_reference) = { - # child_type: "logging.googleapis.com/LogEntry" - # }; - # } - class ResourceReference - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - end -end diff --git a/owl-bot-staging/google-cloud-saas_platform-saas_service_mgmt-v1beta1/proto_docs/google/cloud/saasplatform/saasservicemgmt/v1beta1/common.rb b/owl-bot-staging/google-cloud-saas_platform-saas_service_mgmt-v1beta1/proto_docs/google/cloud/saasplatform/saasservicemgmt/v1beta1/common.rb deleted file mode 100644 index 6a0da327d9a7..000000000000 --- a/owl-bot-staging/google-cloud-saas_platform-saas_service_mgmt-v1beta1/proto_docs/google/cloud/saasplatform/saasservicemgmt/v1beta1/common.rb +++ /dev/null @@ -1,237 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - - -module Google - module Cloud - module SaasPlatform - module SaasServiceMgmt - module V1beta1 - # Blueprints are OCI Images that contain all of the artifacts needed to - # provision a unit. Metadata such as, type of the engine used to actuate the - # blueprint (e.g. terraform, helm etc) and version will come from the image - # manifest. If the hostname is omitted, it will be assumed to be the regional - # path to Artifact Registry (eg. us-east1-docker.pkg.dev). - # @!attribute [rw] package - # @return [::String] - # Optional. Immutable. URI to a blueprint used by the Unit (required unless - # unitKind or release is set). - # @!attribute [r] engine - # @return [::String] - # Output only. Type of the engine used to actuate the blueprint. e.g. - # terraform, helm etc. - # @!attribute [r] version - # @return [::String] - # Output only. Version metadata if present on the blueprint. - class Blueprint - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # UnitVariable describes a parameter for a Unit. - # @!attribute [rw] variable - # @return [::String] - # Required. Immutable. Name of the variable from actuation configs. - # @!attribute [rw] type - # @return [::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::UnitVariable::Type] - # Optional. Immutable. Name of a supported variable type. Supported types are - # string, int, bool. - # @!attribute [rw] value - # @return [::String] - # Optional. String encoded value for the variable. - class UnitVariable - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - - # Enumeration of variable types. - module Type - # Variable type is unspecified. - TYPE_UNSPECIFIED = 0 - - # Variable type is string. - STRING = 1 - - # Variable type is int. - INT = 2 - - # Variable type is bool. - BOOL = 3 - end - end - - # UnitCondition describes the status of an Unit. UnitCondition is individual - # components that contribute to an overall state. - # @!attribute [rw] status - # @return [::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::UnitCondition::Status] - # Required. Status of the condition. - # @!attribute [rw] type - # @return [::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::UnitCondition::Type] - # Required. Type of the condition. - # @!attribute [rw] last_transition_time - # @return [::Google::Protobuf::Timestamp] - # Required. Last time the condition transited from one status to another. - # @!attribute [rw] message - # @return [::String] - # Required. Human readable message indicating details about the last - # transition. - # @!attribute [rw] reason - # @return [::String] - # Required. Brief reason for the condition's last transition. - class UnitCondition - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - - # Enumeration of condition statuses. - module Status - # Condition status is unspecified. - STATUS_UNSPECIFIED = 0 - - # Condition is unknown. - STATUS_UNKNOWN = 1 - - # Condition is true. - STATUS_TRUE = 2 - - # Condition is false. - STATUS_FALSE = 3 - end - - # Enumeration of condition types. - module Type - # Condition type is unspecified. - TYPE_UNSPECIFIED = 0 - - # Condition type is ready. - TYPE_READY = 1 - - # Condition type is updating. - TYPE_UPDATING = 2 - - # Condition type is provisioned. - TYPE_PROVISIONED = 3 - - # Condition type is operationError. - # True when the last unit operation fails with a non-ignorable error. - TYPE_OPERATION_ERROR = 4 - end - end - - # UnitOperationCondition describes the status of an Unit Operation. - # UnitOperationCondition is individual components that contribute to an overall - # state. - # @!attribute [rw] status - # @return [::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::UnitOperationCondition::Status] - # Required. Status of the condition. - # @!attribute [rw] type - # @return [::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::UnitOperationCondition::Type] - # Required. Type of the condition. - # @!attribute [rw] last_transition_time - # @return [::Google::Protobuf::Timestamp] - # Required. Last time the condition transited from one status to another. - # @!attribute [rw] message - # @return [::String] - # Required. Human readable message indicating details about the last - # transition. - # @!attribute [rw] reason - # @return [::String] - # Required. Brief reason for the condition's last transition. - class UnitOperationCondition - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - - # Enumeration of condition statuses. - module Status - # Condition status is unspecified. - STATUS_UNSPECIFIED = 0 - - # Condition is unknown. - STATUS_UNKNOWN = 1 - - # Condition is true. - STATUS_TRUE = 2 - - # Condition is false. - STATUS_FALSE = 3 - end - - # Enumeration of condition types. - module Type - # Condition type is unspecified. - TYPE_UNSPECIFIED = 0 - - # Condition type is scheduled. - TYPE_SCHEDULED = 2 - - # Condition type is running. - TYPE_RUNNING = 3 - - # Condition type is succeeded. - TYPE_SUCCEEDED = 4 - - # Condition type is cancelled. - TYPE_CANCELLED = 5 - - # Indicates if AppHub app has been created. - TYPE_APP_CREATED = 6 - - # Indicates if services and workloads have been registered with AppHub. - TYPE_APP_COMPONENTS_REGISTERED = 7 - end - end - - # Represents the aggregation of a set of population of like records by a - # certain group. For example, a collection of unit counts can be aggregated and - # grouped by their state. - # @!attribute [rw] group - # @return [::String] - # Required. Group by which to aggregate. - # @!attribute [rw] count - # @return [::Integer] - # Required. Number of records in the group. - class Aggregate - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # UnitOperationErrorCategory describes the error category of the unit - # operation. - module UnitOperationErrorCategory - # Unit operation error category is unspecified - UNIT_OPERATION_ERROR_CATEGORY_UNSPECIFIED = 0 - - # Unit operation error category is not applicable, or it is not an error - NOT_APPLICABLE = 1 - - # Unit operation error category is fatal - FATAL = 2 - - # Unit operation error category is retriable - RETRIABLE = 3 - - # Unit operation error category is ignorable - IGNORABLE = 4 - - # Unit operation error category is standard, counts towards Rollout error - # budget - STANDARD = 5 - end - end - end - end - end -end diff --git a/owl-bot-staging/google-cloud-saas_platform-saas_service_mgmt-v1beta1/proto_docs/google/cloud/saasplatform/saasservicemgmt/v1beta1/deployments_resources.rb b/owl-bot-staging/google-cloud-saas_platform-saas_service_mgmt-v1beta1/proto_docs/google/cloud/saasplatform/saasservicemgmt/v1beta1/deployments_resources.rb deleted file mode 100644 index 77d6b2a09c64..000000000000 --- a/owl-bot-staging/google-cloud-saas_platform-saas_service_mgmt-v1beta1/proto_docs/google/cloud/saasplatform/saasservicemgmt/v1beta1/deployments_resources.rb +++ /dev/null @@ -1,837 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - - -module Google - module Cloud - module SaasPlatform - module SaasServiceMgmt - module V1beta1 - # Location information that the service is available in. - # @!attribute [rw] name - # @return [::String] - # Optional. Name of location. - class Location - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Saas is a representation of a SaaS service managed by the Producer. - # @!attribute [rw] name - # @return [::String] - # Identifier. The resource name (full URI of the resource) following the - # standard naming scheme: - # - # "projects/\\{project}/locations/\\{location}/saas/\\{saas}" - # @!attribute [rw] locations - # @return [::Array<::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::Location>] - # Optional. List of locations that the service is available in. Rollout - # refers to the list to generate a rollout plan. - # @!attribute [rw] labels - # @return [::Google::Protobuf::Map{::String => ::String}] - # Optional. The labels on the resource, which can be used for categorization. - # similar to Kubernetes resource labels. - # @!attribute [rw] annotations - # @return [::Google::Protobuf::Map{::String => ::String}] - # Optional. Annotations is an unstructured key-value map stored with a - # resource that may be set by external tools to store and retrieve arbitrary - # metadata. They are not queryable and should be preserved when modifying - # objects. - # - # More info: https://kubernetes.io/docs/user-guide/annotations - # @!attribute [r] uid - # @return [::String] - # Output only. The unique identifier of the resource. UID is unique in the - # time and space for this resource within the scope of the service. It is - # typically generated by the server on successful creation of a resource - # and must not be changed. UID is used to uniquely identify resources - # with resource name reuses. This should be a UUID4. - # @!attribute [r] etag - # @return [::String] - # Output only. An opaque value that uniquely identifies a version or - # generation of a resource. It can be used to confirm that the client - # and server agree on the ordering of a resource being written. - # @!attribute [r] create_time - # @return [::Google::Protobuf::Timestamp] - # Output only. The timestamp when the resource was created. - # @!attribute [r] update_time - # @return [::Google::Protobuf::Timestamp] - # Output only. The timestamp when the resource was last updated. Any - # change to the resource made by users must refresh this value. - # Changes to a resource made by the service should refresh this value. - class Saas - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - - # @!attribute [rw] key - # @return [::String] - # @!attribute [rw] value - # @return [::String] - class LabelsEntry - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # @!attribute [rw] key - # @return [::String] - # @!attribute [rw] value - # @return [::String] - class AnnotationsEntry - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - end - - # Tenant represents the service producer side of an instance of the - # service created based on a request from a consumer. In a typical scenario a - # Tenant has a one-to-one mapping with a resource given out to a service - # consumer. - # - # Example: - # - # tenant: - # name: "projects/svc1/locations/loc/tenants/inst-068afff8" - # consumer_resource: "projects/gshoe/locations/loc/shoes/black-shoe" - # @!attribute [rw] name - # @return [::String] - # Identifier. The resource name (full URI of the resource) following the - # standard naming scheme: - # - # "projects/\\{project}/locations/\\{location}/tenants/\\{tenant}" - # @!attribute [rw] consumer_resource - # @return [::String] - # Optional. Immutable. A reference to the consumer resource this SaaS Tenant - # is representing. - # - # The relationship with a consumer resource can be used by SaaS Runtime for - # retrieving consumer-defined settings and policies such as maintenance - # policies (using Unified Maintenance Policy API). - # @!attribute [rw] saas - # @return [::String] - # Required. Immutable. A reference to the Saas that defines the product - # (managed service) that the producer wants to manage with SaaS Runtime. Part - # of the SaaS Runtime common data model. - # @!attribute [rw] labels - # @return [::Google::Protobuf::Map{::String => ::String}] - # Optional. The labels on the resource, which can be used for categorization. - # similar to Kubernetes resource labels. - # @!attribute [rw] annotations - # @return [::Google::Protobuf::Map{::String => ::String}] - # Optional. Annotations is an unstructured key-value map stored with a - # resource that may be set by external tools to store and retrieve arbitrary - # metadata. They are not queryable and should be preserved when modifying - # objects. - # - # More info: https://kubernetes.io/docs/user-guide/annotations - # @!attribute [r] uid - # @return [::String] - # Output only. The unique identifier of the resource. UID is unique in the - # time and space for this resource within the scope of the service. It is - # typically generated by the server on successful creation of a resource - # and must not be changed. UID is used to uniquely identify resources - # with resource name reuses. This should be a UUID4. - # @!attribute [r] etag - # @return [::String] - # Output only. An opaque value that uniquely identifies a version or - # generation of a resource. It can be used to confirm that the client - # and server agree on the ordering of a resource being written. - # @!attribute [r] create_time - # @return [::Google::Protobuf::Timestamp] - # Output only. The timestamp when the resource was created. - # @!attribute [r] update_time - # @return [::Google::Protobuf::Timestamp] - # Output only. The timestamp when the resource was last updated. Any - # change to the resource made by users must refresh this value. - # Changes to a resource made by the service should refresh this value. - class Tenant - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - - # @!attribute [rw] key - # @return [::String] - # @!attribute [rw] value - # @return [::String] - class LabelsEntry - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # @!attribute [rw] key - # @return [::String] - # @!attribute [rw] value - # @return [::String] - class AnnotationsEntry - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - end - - # Definition of a Unit. Units belonging to the same UnitKind are managed - # together; for example they follow the same release model (blueprints, - # versions etc.) and are typically rolled out together. - # @!attribute [rw] name - # @return [::String] - # Identifier. The resource name (full URI of the resource) following the - # standard naming scheme: - # - # "projects/\\{project}/locations/\\{location}/unitKinds/\\{unitKind}" - # @!attribute [rw] default_release - # @return [::String] - # Optional. A reference to the Release object to use as default for creating - # new units of this UnitKind (optional). - # - # If not specified, a new unit must explicitly reference which release to use - # for its creation. - # @!attribute [rw] dependencies - # @return [::Array<::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::Dependency>] - # Optional. Immutable. List of other unit kinds that this release will depend - # on. Dependencies will be automatically provisioned if not found. - # Maximum 10. - # @!attribute [rw] input_variable_mappings - # @return [::Array<::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::VariableMapping>] - # Optional. List of inputVariables for this release that will either be - # retrieved from a dependency’s outputVariables, or will be passed on to a - # dependency’s inputVariables. Maximum 100. - # @!attribute [rw] output_variable_mappings - # @return [::Array<::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::VariableMapping>] - # Optional. List of outputVariables for this unit kind will be passed to this - # unit's outputVariables. Maximum 100. - # @!attribute [rw] saas - # @return [::String] - # Required. Immutable. A reference to the Saas that defines the product - # (managed service) that the producer wants to manage with SaaS Runtime. Part - # of the SaaS Runtime common data model. Immutable once set. - # @!attribute [rw] labels - # @return [::Google::Protobuf::Map{::String => ::String}] - # Optional. The labels on the resource, which can be used for categorization. - # similar to Kubernetes resource labels. - # @!attribute [rw] annotations - # @return [::Google::Protobuf::Map{::String => ::String}] - # Optional. Annotations is an unstructured key-value map stored with a - # resource that may be set by external tools to store and retrieve arbitrary - # metadata. They are not queryable and should be preserved when modifying - # objects. - # - # More info: https://kubernetes.io/docs/user-guide/annotations - # @!attribute [r] uid - # @return [::String] - # Output only. The unique identifier of the resource. UID is unique in the - # time and space for this resource within the scope of the service. It is - # typically generated by the server on successful creation of a resource - # and must not be changed. UID is used to uniquely identify resources - # with resource name reuses. This should be a UUID4. - # @!attribute [r] etag - # @return [::String] - # Output only. An opaque value that uniquely identifies a version or - # generation of a resource. It can be used to confirm that the client - # and server agree on the ordering of a resource being written. - # @!attribute [r] create_time - # @return [::Google::Protobuf::Timestamp] - # Output only. The timestamp when the resource was created. - # @!attribute [r] update_time - # @return [::Google::Protobuf::Timestamp] - # Output only. The timestamp when the resource was last updated. Any - # change to the resource made by users must refresh this value. - # Changes to a resource made by the service should refresh this value. - class UnitKind - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - - # @!attribute [rw] key - # @return [::String] - # @!attribute [rw] value - # @return [::String] - class LabelsEntry - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # @!attribute [rw] key - # @return [::String] - # @!attribute [rw] value - # @return [::String] - class AnnotationsEntry - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - end - - # A unit of deployment that has its lifecycle via a CRUD API using an actuation - # engine under the hood (e.g. based on Terraform, Helm or a custom - # implementation provided by a service producer). A building block of a SaaS - # Tenant. - # @!attribute [rw] name - # @return [::String] - # Identifier. The resource name (full URI of the resource) following the - # standard naming scheme: - # - # "projects/\\{project}/locations/\\{location}/units/\\{unit}" - # @!attribute [rw] unit_kind - # @return [::String] - # Optional. Reference to the UnitKind this Unit belongs to. Immutable once - # set. - # @!attribute [r] release - # @return [::String] - # Optional. Output only. The current Release object for this Unit. - # @!attribute [rw] tenant - # @return [::String] - # Optional. Reference to the Saas Tenant resource this unit belongs to. This - # for example informs the maintenance policies to use for scheduling future - # updates on a unit. (optional and immutable once created) - # @!attribute [r] ongoing_operations - # @return [::Array<::String>] - # Optional. Output only. List of concurrent UnitOperations that are operating - # on this Unit. - # @!attribute [r] pending_operations - # @return [::Array<::String>] - # Optional. Output only. List of pending (wait to be executed) UnitOperations - # for this unit. - # @!attribute [r] scheduled_operations - # @return [::Array<::String>] - # Optional. Output only. List of scheduled UnitOperations for this unit. - # @!attribute [r] dependents - # @return [::Array<::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::UnitDependency>] - # Optional. Output only. List of Units that depend on this unit. Unit can - # only be deprovisioned if this list is empty. Maximum 1000. - # @!attribute [r] dependencies - # @return [::Array<::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::UnitDependency>] - # Optional. Output only. Set of dependencies for this unit. Maximum 10. - # @!attribute [r] input_variables - # @return [::Array<::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::UnitVariable>] - # Optional. Output only. Indicates the current input variables deployed by - # the unit - # @!attribute [r] output_variables - # @return [::Array<::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::UnitVariable>] - # Optional. Output only. Set of key/value pairs corresponding to output - # variables from execution of actuation templates. The variables are declared - # in actuation configs (e.g in helm chart or terraform) and the values are - # fetched and returned by the actuation engine upon completion of execution. - # @!attribute [rw] maintenance - # @return [::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::Unit::MaintenanceSettings] - # Optional. Captures requested directives for performing future maintenance - # on the unit. This includes a request for the unit to skip maintenance for a - # period of time and remain pinned to its current release as well as controls - # for postponing maintenance scheduled in future. - # @!attribute [r] state - # @return [::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::Unit::UnitState] - # Optional. Output only. Current lifecycle state of the resource (e.g. if - # it's being created or ready to use). - # @!attribute [r] conditions - # @return [::Array<::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::UnitCondition>] - # Optional. Output only. A set of conditions which indicate the various - # conditions this resource can have. - # @!attribute [rw] management_mode - # @return [::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::Unit::ManagementMode] - # Optional. Immutable. Indicates whether the Unit life cycle is controlled - # by the user or by the system. - # Immutable once created. - # @!attribute [r] system_managed_state - # @return [::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::Unit::SystemManagedState] - # Optional. Output only. Indicates the system managed state of the unit. - # @!attribute [r] system_cleanup_at - # @return [::Google::Protobuf::Timestamp] - # Optional. Output only. If set, indicates the time when the system will - # start removing the unit. - # @!attribute [rw] labels - # @return [::Google::Protobuf::Map{::String => ::String}] - # Optional. The labels on the resource, which can be used for categorization. - # similar to Kubernetes resource labels. - # @!attribute [rw] annotations - # @return [::Google::Protobuf::Map{::String => ::String}] - # Optional. Annotations is an unstructured key-value map stored with a - # resource that may be set by external tools to store and retrieve arbitrary - # metadata. They are not queryable and should be preserved when modifying - # objects. - # - # More info: https://kubernetes.io/docs/user-guide/annotations - # @!attribute [r] uid - # @return [::String] - # Output only. The unique identifier of the resource. UID is unique in the - # time and space for this resource within the scope of the service. It is - # typically generated by the server on successful creation of a resource - # and must not be changed. UID is used to uniquely identify resources - # with resource name reuses. This should be a UUID4. - # @!attribute [r] etag - # @return [::String] - # Output only. An opaque value that uniquely identifies a version or - # generation of a resource. It can be used to confirm that the client - # and server agree on the ordering of a resource being written. - # @!attribute [r] create_time - # @return [::Google::Protobuf::Timestamp] - # Output only. The timestamp when the resource was created. - # @!attribute [r] update_time - # @return [::Google::Protobuf::Timestamp] - # Output only. The timestamp when the resource was last updated. Any - # change to the resource made by users must refresh this value. - # Changes to a resource made by the service should refresh this value. - class Unit - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - - # Captures requested directives for performing future maintenance on the - # unit. This includes a request for the unit to skip maintenance for a period - # of time and remain pinned to its current release as well as controls for - # postponing maintenance scheduled in future. - # @!attribute [rw] pinned_until_time - # @return [::Google::Protobuf::Timestamp] - # Optional. If present, it fixes the release on the unit until the given - # time; i.e. changes to the release field will be rejected. Rollouts should - # and will also respect this by not requesting an upgrade in the first - # place. - class MaintenanceSettings - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # @!attribute [rw] key - # @return [::String] - # @!attribute [rw] value - # @return [::String] - class LabelsEntry - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # @!attribute [rw] key - # @return [::String] - # @!attribute [rw] value - # @return [::String] - class AnnotationsEntry - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # UnitState annotates what is the current state of the unit itself. - module UnitState - # Unspecified state. - UNIT_STATE_UNSPECIFIED = 0 - - # Unit is not provisioned. - UNIT_STATE_NOT_PROVISIONED = 1 - - # Unit is being provisioned. - UNIT_STATE_PROVISIONING = 2 - - # Unit is being updated. This is typically when a unit is being upgraded to - # a new release or some of the input variables on the Unit is being - # changed. Certain kinds of updates may cause the Unit to become unusable - # while the update is in progress. - UNIT_STATE_UPDATING = 3 - - # Unit is being deleted. - UNIT_STATE_DEPROVISIONING = 4 - - # Unit has been provisioned and is ready for use - UNIT_STATE_READY = 5 - - # Unit has error, when it is not ready and some error operation - UNIT_STATE_ERROR = 6 - end - - # ManagementMode describes who is responsible for the management of the unit. - module ManagementMode - MANAGEMENT_MODE_UNSPECIFIED = 0 - - # Unit's lifecycle is managed by the user. - MANAGEMENT_MODE_USER = 1 - - # The system will decide when to deprovision and delete the unit. - # User still can deprovision or delete the unit manually. - MANAGEMENT_MODE_SYSTEM = 2 - end - - module SystemManagedState - SYSTEM_MANAGED_STATE_UNSPECIFIED = 0 - - # Unit has dependents attached. - SYSTEM_MANAGED_STATE_ACTIVE = 1 - - # Unit has no dependencies attached, but attachment is allowed. - SYSTEM_MANAGED_STATE_INACTIVE = 2 - - # Unit has no dependencies attached, and attachment is not allowed. - SYSTEM_MANAGED_STATE_DECOMMISSIONED = 3 - end - end - - # Set of dependencies for this unit. Maximum 10. - # @!attribute [r] alias - # @return [::String] - # Output only. Alias for the name of the dependency. - # @!attribute [r] unit - # @return [::String] - # Output only. A reference to the Unit object. - class UnitDependency - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # UnitOperation encapsulates the intent of changing/interacting with the - # service component represented by the specific Unit. Multiple UnitOperations - # can be created (requested) and scheduled in the future, however only one will - # be allowed to execute at a time (that can change in the future for - # non-mutating operations). - # - # UnitOperations allow different actors interacting with the same - # unit to focus only on the change they have requested. - # - # This is a base object that contains the common fields in all unit operations. - # Next: 19 - # @!attribute [rw] provision - # @return [::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::Provision] - # Note: The following fields are mutually exclusive: `provision`, `upgrade`, `deprovision`. If a field in that set is populated, all other fields in the set will automatically be cleared. - # @!attribute [rw] upgrade - # @return [::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::Upgrade] - # Note: The following fields are mutually exclusive: `upgrade`, `provision`, `deprovision`. If a field in that set is populated, all other fields in the set will automatically be cleared. - # @!attribute [rw] deprovision - # @return [::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::Deprovision] - # Note: The following fields are mutually exclusive: `deprovision`, `provision`, `upgrade`. If a field in that set is populated, all other fields in the set will automatically be cleared. - # @!attribute [rw] name - # @return [::String] - # Identifier. The resource name (full URI of the resource) following the - # standard naming scheme: - # - # "projects/\\{project}/locations/\\{location}/unitOperations/\\{unitOperation}" - # @!attribute [rw] unit - # @return [::String] - # Required. Immutable. The Unit a given UnitOperation will act upon. - # @!attribute [rw] parent_unit_operation - # @return [::String] - # Optional. Reference to parent resource: UnitOperation. If an operation - # needs to create other operations as part of its workflow, each of the child - # operations should have this field set to the parent. This can be used for - # tracing. (Optional) - # @!attribute [rw] rollout - # @return [::String] - # Optional. Specifies which rollout created this Unit Operation. This cannot - # be modified and is used for filtering purposes only. If a dependent unit - # and unit operation are created as part of another unit operation, they will - # use the same rolloutId. - # @!attribute [rw] cancel - # @return [::Boolean] - # Optional. When true, attempt to cancel the operation. Cancellation may fail - # if the operation is already executing. (Optional) - # @!attribute [r] state - # @return [::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::UnitOperation::UnitOperationState] - # Optional. Output only. UnitOperationState describes the current state of - # the unit operation. - # @!attribute [r] conditions - # @return [::Array<::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::UnitOperationCondition>] - # Optional. Output only. A set of conditions which indicate the various - # conditions this resource can have. - # @!attribute [rw] schedule - # @return [::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::Schedule] - # Optional. When to schedule this operation. - # @!attribute [r] engine_state - # @return [::String] - # Optional. Output only. The engine state for on-going - # deployment engine operation(s). - # This field is opaque for external usage. - # @!attribute [r] error_category - # @return [::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::UnitOperationErrorCategory] - # Optional. Output only. UnitOperationErrorCategory describe the error - # category. - # @!attribute [rw] labels - # @return [::Google::Protobuf::Map{::String => ::String}] - # Optional. The labels on the resource, which can be used for categorization. - # similar to Kubernetes resource labels. - # @!attribute [rw] annotations - # @return [::Google::Protobuf::Map{::String => ::String}] - # Optional. Annotations is an unstructured key-value map stored with a - # resource that may be set by external tools to store and retrieve arbitrary - # metadata. They are not queryable and should be preserved when modifying - # objects. - # - # More info: https://kubernetes.io/docs/user-guide/annotations - # @!attribute [r] uid - # @return [::String] - # Output only. The unique identifier of the resource. UID is unique in the - # time and space for this resource within the scope of the service. It is - # typically generated by the server on successful creation of a resource - # and must not be changed. UID is used to uniquely identify resources - # with resource name reuses. This should be a UUID4. - # @!attribute [r] etag - # @return [::String] - # Output only. An opaque value that uniquely identifies a version or - # generation of a resource. It can be used to confirm that the client - # and server agree on the ordering of a resource being written. - # @!attribute [r] create_time - # @return [::Google::Protobuf::Timestamp] - # Output only. The timestamp when the resource was created. - # @!attribute [r] update_time - # @return [::Google::Protobuf::Timestamp] - # Output only. The timestamp when the resource was last updated. Any - # change to the resource made by users must refresh this value. - # Changes to a resource made by the service should refresh this value. - class UnitOperation - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - - # @!attribute [rw] key - # @return [::String] - # @!attribute [rw] value - # @return [::String] - class LabelsEntry - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # @!attribute [rw] key - # @return [::String] - # @!attribute [rw] value - # @return [::String] - class AnnotationsEntry - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # UnitOperationState describes the current state of the unit operation. - module UnitOperationState - UNIT_OPERATION_STATE_UNKNOWN = 0 - - # Unit operation is accepted but not ready to run. - UNIT_OPERATION_STATE_PENDING = 1 - - # Unit operation is accepted and scheduled. - UNIT_OPERATION_STATE_SCHEDULED = 2 - - # Unit operation is running. - UNIT_OPERATION_STATE_RUNNING = 4 - - # Unit operation has completed successfully. - UNIT_OPERATION_STATE_SUCCEEDED = 5 - - # Unit operation has failed. - UNIT_OPERATION_STATE_FAILED = 6 - - # Unit operation was cancelled. - UNIT_OPERATION_STATE_CANCELLED = 7 - end - end - - # Provision is the unit operation that provision the underlying resources - # represented by a Unit. Can only execute if the Unit is not currently - # provisioned. - # @!attribute [rw] release - # @return [::String] - # Optional. Reference to the Release object to use for the Unit. (optional). - # @!attribute [rw] input_variables - # @return [::Array<::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::UnitVariable>] - # Optional. Set of input variables. Maximum 100. (optional) - class Provision - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Deprovision is the unit operation that deprovision the underlying - # resources represented by a Unit. Can only execute if the Unit is currently - # provisioned. - class Deprovision - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Upgrade is the unit operation that upgrades a provisioned unit, which may - # also include the underlying resources represented by a Unit. Can only execute - # if the Unit is currently provisioned. - # @!attribute [rw] release - # @return [::String] - # Optional. Reference to the Release object to use for the Unit. (optional). - # @!attribute [rw] input_variables - # @return [::Array<::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::UnitVariable>] - # Optional. Set of input variables. Maximum 100. (optional) - class Upgrade - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # A time specification to schedule the maintenance. - # @!attribute [rw] start_time - # @return [::Google::Protobuf::Timestamp] - # Optional. Start of operation. If not set, will be set to the start of the - # next window. (optional) - class Schedule - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # A new version to be propagated and deployed to units. This includes pointers - # to packaged blueprints for actuation (e.g Helm or Terraform configuration - # packages) via artifact registry. - # @!attribute [rw] name - # @return [::String] - # Identifier. The resource name (full URI of the resource) following the - # standard naming scheme: - # - # "projects/\\{project}/locations/\\{location}/releases/\\{release}" - # @!attribute [rw] unit_kind - # @return [::String] - # Required. Immutable. Reference to the UnitKind this Release corresponds to - # (required and immutable once created). - # @!attribute [rw] blueprint - # @return [::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::Blueprint] - # Optional. Blueprints are OCI Images that contain all of the artifacts - # needed to provision a unit. - # @!attribute [rw] release_requirements - # @return [::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::Release::ReleaseRequirements] - # Optional. Set of requirements to be fulfilled on the Unit when using this - # Release. - # @!attribute [r] input_variables - # @return [::Array<::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::UnitVariable>] - # Optional. Output only. List of input variables declared on the blueprint - # and can be present with their values on the unit spec - # @!attribute [r] output_variables - # @return [::Array<::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::UnitVariable>] - # Optional. Output only. List of output variables declared on the blueprint - # and can be present with their values on the unit status - # @!attribute [rw] input_variable_defaults - # @return [::Array<::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::UnitVariable>] - # Optional. Mapping of input variables to default values. Maximum 100 - # @!attribute [rw] labels - # @return [::Google::Protobuf::Map{::String => ::String}] - # Optional. The labels on the resource, which can be used for categorization. - # similar to Kubernetes resource labels. - # @!attribute [rw] annotations - # @return [::Google::Protobuf::Map{::String => ::String}] - # Optional. Annotations is an unstructured key-value map stored with a - # resource that may be set by external tools to store and retrieve arbitrary - # metadata. They are not queryable and should be preserved when modifying - # objects. - # - # More info: https://kubernetes.io/docs/user-guide/annotations - # @!attribute [r] uid - # @return [::String] - # Output only. The unique identifier of the resource. UID is unique in the - # time and space for this resource within the scope of the service. It is - # typically generated by the server on successful creation of a resource - # and must not be changed. UID is used to uniquely identify resources - # with resource name reuses. This should be a UUID4. - # @!attribute [r] etag - # @return [::String] - # Output only. An opaque value that uniquely identifies a version or - # generation of a resource. It can be used to confirm that the client - # and server agree on the ordering of a resource being written. - # @!attribute [r] create_time - # @return [::Google::Protobuf::Timestamp] - # Output only. The timestamp when the resource was created. - # @!attribute [r] update_time - # @return [::Google::Protobuf::Timestamp] - # Output only. The timestamp when the resource was last updated. Any - # change to the resource made by users must refresh this value. - # Changes to a resource made by the service should refresh this value. - class Release - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - - # Set of requirements to be fulfilled on the Unit when using this Release. - # @!attribute [rw] upgradeable_from_releases - # @return [::Array<::String>] - # Optional. A list of releases from which a unit can be upgraded to this - # one (optional). If left empty no constraints will be applied. When - # provided, unit upgrade requests to this release will check and enforce - # this constraint. - class ReleaseRequirements - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # @!attribute [rw] key - # @return [::String] - # @!attribute [rw] value - # @return [::String] - class LabelsEntry - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # @!attribute [rw] key - # @return [::String] - # @!attribute [rw] value - # @return [::String] - class AnnotationsEntry - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - end - - # Mapping of input variables to their respective output variable for - # depedenencies - # @!attribute [rw] from - # @return [::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::FromMapping] - # Optional. Output variables which will get their values from dependencies - # - # Note: The following fields are mutually exclusive: `from`, `to`. If a field in that set is populated, all other fields in the set will automatically be cleared. - # @!attribute [rw] to - # @return [::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::ToMapping] - # Optional. Input variables whose values will be passed on to dependencies. - # - # Note: The following fields are mutually exclusive: `to`, `from`. If a field in that set is populated, all other fields in the set will automatically be cleared. - # @!attribute [rw] variable - # @return [::String] - # Required. name of the variable - class VariableMapping - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Output variables whose values will be passed on to dependencies - # @!attribute [rw] dependency - # @return [::String] - # Required. Alias of the dependency that the outputVariable will pass its - # value to - # @!attribute [rw] output_variable - # @return [::String] - # Required. Name of the outputVariable on the dependency - class FromMapping - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Input variables whose values will be passed on to dependencies - # @!attribute [rw] dependency - # @return [::String] - # Required. Alias of the dependency that the inputVariable will pass its - # value to - # @!attribute [rw] input_variable - # @return [::String] - # Required. Name of the inputVariable on the dependency - # @!attribute [rw] ignore_for_lookup - # @return [::Boolean] - # Optional. Tells SaaS Runtime if this mapping should be used during lookup - # or not - class ToMapping - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Dependency represent a single dependency with another unit kind by alias. - # @!attribute [rw] unit_kind - # @return [::String] - # Required. Immutable. The unit kind of the dependency. - # @!attribute [rw] alias - # @return [::String] - # Required. An alias for the dependency. Used for input variable mapping. - class Dependency - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - end - end - end - end -end diff --git a/owl-bot-staging/google-cloud-saas_platform-saas_service_mgmt-v1beta1/proto_docs/google/cloud/saasplatform/saasservicemgmt/v1beta1/deployments_service.rb b/owl-bot-staging/google-cloud-saas_platform-saas_service_mgmt-v1beta1/proto_docs/google/cloud/saasplatform/saasservicemgmt/v1beta1/deployments_service.rb deleted file mode 100644 index 25428282bb54..000000000000 --- a/owl-bot-staging/google-cloud-saas_platform-saas_service_mgmt-v1beta1/proto_docs/google/cloud/saasplatform/saasservicemgmt/v1beta1/deployments_service.rb +++ /dev/null @@ -1,976 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - - -module Google - module Cloud - module SaasPlatform - module SaasServiceMgmt - module V1beta1 - # The request structure for the ListSaas method. - # @!attribute [rw] parent - # @return [::String] - # Required. The parent of the saas. - # @!attribute [rw] page_size - # @return [::Integer] - # The maximum number of saas to send per page. - # @!attribute [rw] page_token - # @return [::String] - # The page token: If the next_page_token from a previous response - # is provided, this request will send the subsequent page. - # @!attribute [rw] filter - # @return [::String] - # Filter the list as specified in https://google.aip.dev/160. - # @!attribute [rw] order_by - # @return [::String] - # Order results as specified in https://google.aip.dev/132. - class ListSaasRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # The response structure for the ListSaas method. - # @!attribute [rw] saas - # @return [::Array<::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::Saas>] - # The resulting saas. - # @!attribute [rw] next_page_token - # @return [::String] - # If present, the next page token can be provided to a subsequent - # ListSaas call to list the next page. - # If empty, there are no more pages. - # @!attribute [rw] unreachable - # @return [::Array<::String>] - # Locations that could not be reached. - class ListSaasResponse - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # The request structure for the GetSaas method. - # @!attribute [rw] name - # @return [::String] - # Required. The resource name of the resource within a service. - class GetSaasRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # The request structure for the CreateSaas method. - # @!attribute [rw] parent - # @return [::String] - # Required. The parent of the saas. - # @!attribute [rw] saas_id - # @return [::String] - # Required. The ID value for the new saas. - # @!attribute [rw] saas - # @return [::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::Saas] - # Required. The desired state for the saas. - # @!attribute [rw] validate_only - # @return [::Boolean] - # If "validate_only" is set to true, the service will try to validate - # that this request would succeed, but will not actually make changes. - # @!attribute [rw] request_id - # @return [::String] - # An optional request ID to identify requests. Specify a unique request ID - # so that if you must retry your request, the server will know to ignore - # the request if it has already been completed. The server will guarantee - # that for at least 60 minutes since the first request. - # - # For example, consider a situation where you make an initial request and the - # request times out. If you make the request again with the same request - # ID, the server can check if original operation with the same request ID - # was received, and if so, will ignore the second request. This prevents - # clients from accidentally creating duplicate commitments. - # - # The request ID must be a valid UUID with the exception that zero UUID is - # not supported (00000000-0000-0000-0000-000000000000). - class CreateSaasRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # The request structure for the UpdateSaas method. - # @!attribute [rw] saas - # @return [::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::Saas] - # Required. The desired state for the saas. - # @!attribute [rw] validate_only - # @return [::Boolean] - # If "validate_only" is set to true, the service will try to validate - # that this request would succeed, but will not actually make changes. - # @!attribute [rw] request_id - # @return [::String] - # An optional request ID to identify requests. Specify a unique request ID - # so that if you must retry your request, the server will know to ignore - # the request if it has already been completed. The server will guarantee - # that for at least 60 minutes since the first request. - # - # For example, consider a situation where you make an initial request and the - # request times out. If you make the request again with the same request - # ID, the server can check if original operation with the same request ID - # was received, and if so, will ignore the second request. This prevents - # clients from accidentally creating duplicate commitments. - # - # The request ID must be a valid UUID with the exception that zero UUID is - # not supported (00000000-0000-0000-0000-000000000000). - # @!attribute [rw] update_mask - # @return [::Google::Protobuf::FieldMask] - # Field mask is used to specify the fields to be overwritten in the - # Saas resource by the update. - # - # The fields specified in the update_mask are relative to the resource, not - # the full request. A field will be overwritten if it is in the mask. - # - # If the user does not provide a mask then all fields in the - # Saas will be overwritten. - class UpdateSaasRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # The request structure for the DeleteSaas method. - # @!attribute [rw] name - # @return [::String] - # Required. The resource name of the resource within a service. - # @!attribute [rw] etag - # @return [::String] - # The etag known to the client for the expected state of the saas. This is - # used with state-changing methods to prevent accidental overwrites when - # multiple user agents might be acting in parallel on the same resource. - # - # An etag wildcard provide optimistic concurrency based on the expected - # existence of the saas. The Any wildcard (`*`) requires that the resource - # must already exists, and the Not Any wildcard (`!*`) requires that it must - # not. - # @!attribute [rw] validate_only - # @return [::Boolean] - # If "validate_only" is set to true, the service will try to validate - # that this request would succeed, but will not actually make changes. - # @!attribute [rw] request_id - # @return [::String] - # An optional request ID to identify requests. Specify a unique request ID - # so that if you must retry your request, the server will know to ignore - # the request if it has already been completed. The server will guarantee - # that for at least 60 minutes since the first request. - # - # For example, consider a situation where you make an initial request and the - # request times out. If you make the request again with the same request - # ID, the server can check if original operation with the same request ID - # was received, and if so, will ignore the second request. This prevents - # clients from accidentally creating duplicate commitments. - # - # The request ID must be a valid UUID with the exception that zero UUID is - # not supported (00000000-0000-0000-0000-000000000000). - class DeleteSaasRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # The request structure for the ListTenants method. - # @!attribute [rw] parent - # @return [::String] - # Required. The parent of the tenant. - # @!attribute [rw] page_size - # @return [::Integer] - # The maximum number of tenants to send per page. - # @!attribute [rw] page_token - # @return [::String] - # The page token: If the next_page_token from a previous response - # is provided, this request will send the subsequent page. - # @!attribute [rw] filter - # @return [::String] - # Filter the list as specified in https://google.aip.dev/160. - # @!attribute [rw] order_by - # @return [::String] - # Order results as specified in https://google.aip.dev/132. - class ListTenantsRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # The response structure for the ListTenants method. - # @!attribute [rw] tenants - # @return [::Array<::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::Tenant>] - # The resulting tenants. - # @!attribute [rw] next_page_token - # @return [::String] - # If present, the next page token can be provided to a subsequent - # ListTenants call to list the next page. - # If empty, there are no more pages. - # @!attribute [rw] unreachable - # @return [::Array<::String>] - # Locations that could not be reached. - class ListTenantsResponse - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # The request structure for the GetTenant method. - # @!attribute [rw] name - # @return [::String] - # Required. The resource name of the resource within a service. - class GetTenantRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # The request structure for the CreateTenant method. - # @!attribute [rw] parent - # @return [::String] - # Required. The parent of the tenant. - # @!attribute [rw] tenant_id - # @return [::String] - # Required. The ID value for the new tenant. - # @!attribute [rw] tenant - # @return [::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::Tenant] - # Required. The desired state for the tenant. - # @!attribute [rw] validate_only - # @return [::Boolean] - # If "validate_only" is set to true, the service will try to validate - # that this request would succeed, but will not actually make changes. - # @!attribute [rw] request_id - # @return [::String] - # An optional request ID to identify requests. Specify a unique request ID - # so that if you must retry your request, the server will know to ignore - # the request if it has already been completed. The server will guarantee - # that for at least 60 minutes since the first request. - # - # For example, consider a situation where you make an initial request and the - # request times out. If you make the request again with the same request - # ID, the server can check if original operation with the same request ID - # was received, and if so, will ignore the second request. This prevents - # clients from accidentally creating duplicate commitments. - # - # The request ID must be a valid UUID with the exception that zero UUID is - # not supported (00000000-0000-0000-0000-000000000000). - class CreateTenantRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # The request structure for the UpdateTenant method. - # @!attribute [rw] tenant - # @return [::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::Tenant] - # Required. The desired state for the tenant. - # @!attribute [rw] validate_only - # @return [::Boolean] - # If "validate_only" is set to true, the service will try to validate - # that this request would succeed, but will not actually make changes. - # @!attribute [rw] request_id - # @return [::String] - # An optional request ID to identify requests. Specify a unique request ID - # so that if you must retry your request, the server will know to ignore - # the request if it has already been completed. The server will guarantee - # that for at least 60 minutes since the first request. - # - # For example, consider a situation where you make an initial request and the - # request times out. If you make the request again with the same request - # ID, the server can check if original operation with the same request ID - # was received, and if so, will ignore the second request. This prevents - # clients from accidentally creating duplicate commitments. - # - # The request ID must be a valid UUID with the exception that zero UUID is - # not supported (00000000-0000-0000-0000-000000000000). - # @!attribute [rw] update_mask - # @return [::Google::Protobuf::FieldMask] - # Field mask is used to specify the fields to be overwritten in the - # Tenant resource by the update. - # - # The fields specified in the update_mask are relative to the resource, not - # the full request. A field will be overwritten if it is in the mask. - # - # If the user does not provide a mask then all fields in the - # Tenant will be overwritten. - class UpdateTenantRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # The request structure for the DeleteTenant method. - # @!attribute [rw] name - # @return [::String] - # Required. The resource name of the resource within a service. - # @!attribute [rw] etag - # @return [::String] - # The etag known to the client for the expected state of the tenant. This is - # used with state-changing methods to prevent accidental overwrites when - # multiple user agents might be acting in parallel on the same resource. - # - # An etag wildcard provide optimistic concurrency based on the expected - # existence of the tenant. The Any wildcard (`*`) requires that the resource - # must already exists, and the Not Any wildcard (`!*`) requires that it must - # not. - # @!attribute [rw] validate_only - # @return [::Boolean] - # If "validate_only" is set to true, the service will try to validate - # that this request would succeed, but will not actually make changes. - # @!attribute [rw] request_id - # @return [::String] - # An optional request ID to identify requests. Specify a unique request ID - # so that if you must retry your request, the server will know to ignore - # the request if it has already been completed. The server will guarantee - # that for at least 60 minutes since the first request. - # - # For example, consider a situation where you make an initial request and the - # request times out. If you make the request again with the same request - # ID, the server can check if original operation with the same request ID - # was received, and if so, will ignore the second request. This prevents - # clients from accidentally creating duplicate commitments. - # - # The request ID must be a valid UUID with the exception that zero UUID is - # not supported (00000000-0000-0000-0000-000000000000). - class DeleteTenantRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # The request structure for the ListUnitKinds method. - # @!attribute [rw] parent - # @return [::String] - # Required. The parent of the unit kind. - # @!attribute [rw] page_size - # @return [::Integer] - # The maximum number of unit kinds to send per page. - # @!attribute [rw] page_token - # @return [::String] - # The page token: If the next_page_token from a previous response - # is provided, this request will send the subsequent page. - # @!attribute [rw] filter - # @return [::String] - # Filter the list as specified in https://google.aip.dev/160. - # @!attribute [rw] order_by - # @return [::String] - # Order results as specified in https://google.aip.dev/132. - class ListUnitKindsRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # The response structure for the ListUnitKinds method. - # @!attribute [rw] unit_kinds - # @return [::Array<::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::UnitKind>] - # The resulting unit kinds. - # @!attribute [rw] next_page_token - # @return [::String] - # If present, the next page token can be provided to a subsequent - # ListUnitKinds call to list the next page. - # If empty, there are no more pages. - # @!attribute [rw] unreachable - # @return [::Array<::String>] - # Locations that could not be reached. - class ListUnitKindsResponse - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # The request structure for the GetUnitKind method. - # @!attribute [rw] name - # @return [::String] - # Required. The resource name of the resource within a service. - class GetUnitKindRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # The request structure for the CreateUnitKind method. - # @!attribute [rw] parent - # @return [::String] - # Required. The parent of the unit kind. - # @!attribute [rw] unit_kind_id - # @return [::String] - # Required. The ID value for the new unit kind. - # @!attribute [rw] unit_kind - # @return [::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::UnitKind] - # Required. The desired state for the unit kind. - # @!attribute [rw] validate_only - # @return [::Boolean] - # If "validate_only" is set to true, the service will try to validate - # that this request would succeed, but will not actually make changes. - # @!attribute [rw] request_id - # @return [::String] - # An optional request ID to identify requests. Specify a unique request ID - # so that if you must retry your request, the server will know to ignore - # the request if it has already been completed. The server will guarantee - # that for at least 60 minutes since the first request. - # - # For example, consider a situation where you make an initial request and the - # request times out. If you make the request again with the same request - # ID, the server can check if original operation with the same request ID - # was received, and if so, will ignore the second request. This prevents - # clients from accidentally creating duplicate commitments. - # - # The request ID must be a valid UUID with the exception that zero UUID is - # not supported (00000000-0000-0000-0000-000000000000). - class CreateUnitKindRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # The request structure for the UpdateUnitKind method. - # @!attribute [rw] unit_kind - # @return [::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::UnitKind] - # Required. The desired state for the unit kind. - # @!attribute [rw] validate_only - # @return [::Boolean] - # If "validate_only" is set to true, the service will try to validate - # that this request would succeed, but will not actually make changes. - # @!attribute [rw] request_id - # @return [::String] - # An optional request ID to identify requests. Specify a unique request ID - # so that if you must retry your request, the server will know to ignore - # the request if it has already been completed. The server will guarantee - # that for at least 60 minutes since the first request. - # - # For example, consider a situation where you make an initial request and the - # request times out. If you make the request again with the same request - # ID, the server can check if original operation with the same request ID - # was received, and if so, will ignore the second request. This prevents - # clients from accidentally creating duplicate commitments. - # - # The request ID must be a valid UUID with the exception that zero UUID is - # not supported (00000000-0000-0000-0000-000000000000). - # @!attribute [rw] update_mask - # @return [::Google::Protobuf::FieldMask] - # Field mask is used to specify the fields to be overwritten in the - # UnitKind resource by the update. - # - # The fields specified in the update_mask are relative to the resource, not - # the full request. A field will be overwritten if it is in the mask. - # - # If the user does not provide a mask then all fields in the - # UnitKind will be overwritten. - class UpdateUnitKindRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # The request structure for the DeleteUnitKind method. - # @!attribute [rw] name - # @return [::String] - # Required. The resource name of the resource within a service. - # @!attribute [rw] etag - # @return [::String] - # The etag known to the client for the expected state of the unit kind. This - # is used with state-changing methods to prevent accidental overwrites when - # multiple user agents might be acting in parallel on the same resource. - # - # An etag wildcard provide optimistic concurrency based on the expected - # existence of the unit kind. The Any wildcard (`*`) requires that the - # resource must already exists, and the Not Any wildcard (`!*`) requires that - # it must not. - # @!attribute [rw] validate_only - # @return [::Boolean] - # If "validate_only" is set to true, the service will try to validate - # that this request would succeed, but will not actually make changes. - # @!attribute [rw] request_id - # @return [::String] - # An optional request ID to identify requests. Specify a unique request ID - # so that if you must retry your request, the server will know to ignore - # the request if it has already been completed. The server will guarantee - # that for at least 60 minutes since the first request. - # - # For example, consider a situation where you make an initial request and the - # request times out. If you make the request again with the same request - # ID, the server can check if original operation with the same request ID - # was received, and if so, will ignore the second request. This prevents - # clients from accidentally creating duplicate commitments. - # - # The request ID must be a valid UUID with the exception that zero UUID is - # not supported (00000000-0000-0000-0000-000000000000). - class DeleteUnitKindRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # The request structure for the ListUnits method. - # @!attribute [rw] parent - # @return [::String] - # Required. The parent of the unit. - # @!attribute [rw] page_size - # @return [::Integer] - # The maximum number of units to send per page. - # @!attribute [rw] page_token - # @return [::String] - # The page token: If the next_page_token from a previous response - # is provided, this request will send the subsequent page. - # @!attribute [rw] filter - # @return [::String] - # Filter the list as specified in https://google.aip.dev/160. - # @!attribute [rw] order_by - # @return [::String] - # Order results as specified in https://google.aip.dev/132. - class ListUnitsRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # The response structure for the ListUnits method. - # @!attribute [rw] units - # @return [::Array<::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::Unit>] - # The resulting units. - # @!attribute [rw] next_page_token - # @return [::String] - # If present, the next page token can be provided to a subsequent - # ListUnits call to list the next page. - # If empty, there are no more pages. - # @!attribute [rw] unreachable - # @return [::Array<::String>] - # Locations that could not be reached. - class ListUnitsResponse - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # The request structure for the GetUnit method. - # @!attribute [rw] name - # @return [::String] - # Required. The resource name of the resource within a service. - class GetUnitRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # The request structure for the CreateUnit method. - # @!attribute [rw] parent - # @return [::String] - # Required. The parent of the unit. - # @!attribute [rw] unit_id - # @return [::String] - # Required. The ID value for the new unit. - # @!attribute [rw] unit - # @return [::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::Unit] - # Required. The desired state for the unit. - # @!attribute [rw] validate_only - # @return [::Boolean] - # If "validate_only" is set to true, the service will try to validate - # that this request would succeed, but will not actually make changes. - # @!attribute [rw] request_id - # @return [::String] - # An optional request ID to identify requests. Specify a unique request ID - # so that if you must retry your request, the server will know to ignore - # the request if it has already been completed. The server will guarantee - # that for at least 60 minutes since the first request. - # - # For example, consider a situation where you make an initial request and the - # request times out. If you make the request again with the same request - # ID, the server can check if original operation with the same request ID - # was received, and if so, will ignore the second request. This prevents - # clients from accidentally creating duplicate commitments. - # - # The request ID must be a valid UUID with the exception that zero UUID is - # not supported (00000000-0000-0000-0000-000000000000). - class CreateUnitRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # The request structure for the UpdateUnit method. - # @!attribute [rw] unit - # @return [::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::Unit] - # Required. The desired state for the unit. - # @!attribute [rw] validate_only - # @return [::Boolean] - # If "validate_only" is set to true, the service will try to validate - # that this request would succeed, but will not actually make changes. - # @!attribute [rw] request_id - # @return [::String] - # An optional request ID to identify requests. Specify a unique request ID - # so that if you must retry your request, the server will know to ignore - # the request if it has already been completed. The server will guarantee - # that for at least 60 minutes since the first request. - # - # For example, consider a situation where you make an initial request and the - # request times out. If you make the request again with the same request - # ID, the server can check if original operation with the same request ID - # was received, and if so, will ignore the second request. This prevents - # clients from accidentally creating duplicate commitments. - # - # The request ID must be a valid UUID with the exception that zero UUID is - # not supported (00000000-0000-0000-0000-000000000000). - # @!attribute [rw] update_mask - # @return [::Google::Protobuf::FieldMask] - # Field mask is used to specify the fields to be overwritten in the - # Unit resource by the update. - # - # The fields specified in the update_mask are relative to the resource, not - # the full request. A field will be overwritten if it is in the mask. - # - # If the user does not provide a mask then all fields in the - # Unit will be overwritten. - class UpdateUnitRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # The request structure for the DeleteUnit method. - # @!attribute [rw] name - # @return [::String] - # Required. The resource name of the resource within a service. - # @!attribute [rw] etag - # @return [::String] - # The etag known to the client for the expected state of the unit. This is - # used with state-changing methods to prevent accidental overwrites when - # multiple user agents might be acting in parallel on the same resource. - # - # An etag wildcard provide optimistic concurrency based on the expected - # existence of the unit. The Any wildcard (`*`) requires that the resource - # must already exists, and the Not Any wildcard (`!*`) requires that it must - # not. - # @!attribute [rw] validate_only - # @return [::Boolean] - # If "validate_only" is set to true, the service will try to validate - # that this request would succeed, but will not actually make changes. - # @!attribute [rw] request_id - # @return [::String] - # An optional request ID to identify requests. Specify a unique request ID - # so that if you must retry your request, the server will know to ignore - # the request if it has already been completed. The server will guarantee - # that for at least 60 minutes since the first request. - # - # For example, consider a situation where you make an initial request and the - # request times out. If you make the request again with the same request - # ID, the server can check if original operation with the same request ID - # was received, and if so, will ignore the second request. This prevents - # clients from accidentally creating duplicate commitments. - # - # The request ID must be a valid UUID with the exception that zero UUID is - # not supported (00000000-0000-0000-0000-000000000000). - class DeleteUnitRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # The request structure for the ListUnitOperations method. - # @!attribute [rw] parent - # @return [::String] - # Required. The parent of the unit operation. - # @!attribute [rw] page_size - # @return [::Integer] - # The maximum number of unit operations to send per page. - # @!attribute [rw] page_token - # @return [::String] - # The page token: If the next_page_token from a previous response - # is provided, this request will send the subsequent page. - # @!attribute [rw] filter - # @return [::String] - # Filter the list as specified in https://google.aip.dev/160. - # @!attribute [rw] order_by - # @return [::String] - # Order results as specified in https://google.aip.dev/132. - class ListUnitOperationsRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # The response structure for the ListUnitOperations method. - # @!attribute [rw] unit_operations - # @return [::Array<::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::UnitOperation>] - # The resulting unit operations. - # @!attribute [rw] next_page_token - # @return [::String] - # If present, the next page token can be provided to a subsequent - # ListUnitOperations call to list the next page. - # If empty, there are no more pages. - # @!attribute [rw] unreachable - # @return [::Array<::String>] - # Locations that could not be reached. - class ListUnitOperationsResponse - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # The request structure for the GetUnitOperation method. - # @!attribute [rw] name - # @return [::String] - # Required. The resource name of the resource within a service. - class GetUnitOperationRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # The request structure for the CreateUnitOperation method. - # @!attribute [rw] parent - # @return [::String] - # Required. The parent of the unit operation. - # @!attribute [rw] unit_operation_id - # @return [::String] - # Required. The ID value for the new unit operation. - # @!attribute [rw] unit_operation - # @return [::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::UnitOperation] - # Required. The desired state for the unit operation. - # @!attribute [rw] validate_only - # @return [::Boolean] - # If "validate_only" is set to true, the service will try to validate - # that this request would succeed, but will not actually make changes. - # @!attribute [rw] request_id - # @return [::String] - # An optional request ID to identify requests. Specify a unique request ID - # so that if you must retry your request, the server will know to ignore - # the request if it has already been completed. The server will guarantee - # that for at least 60 minutes since the first request. - # - # For example, consider a situation where you make an initial request and the - # request times out. If you make the request again with the same request - # ID, the server can check if original operation with the same request ID - # was received, and if so, will ignore the second request. This prevents - # clients from accidentally creating duplicate commitments. - # - # The request ID must be a valid UUID with the exception that zero UUID is - # not supported (00000000-0000-0000-0000-000000000000). - class CreateUnitOperationRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # The request structure for the UpdateUnitOperation method. - # @!attribute [rw] unit_operation - # @return [::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::UnitOperation] - # Required. The desired state for the unit operation. - # @!attribute [rw] validate_only - # @return [::Boolean] - # If "validate_only" is set to true, the service will try to validate - # that this request would succeed, but will not actually make changes. - # @!attribute [rw] request_id - # @return [::String] - # An optional request ID to identify requests. Specify a unique request ID - # so that if you must retry your request, the server will know to ignore - # the request if it has already been completed. The server will guarantee - # that for at least 60 minutes since the first request. - # - # For example, consider a situation where you make an initial request and the - # request times out. If you make the request again with the same request - # ID, the server can check if original operation with the same request ID - # was received, and if so, will ignore the second request. This prevents - # clients from accidentally creating duplicate commitments. - # - # The request ID must be a valid UUID with the exception that zero UUID is - # not supported (00000000-0000-0000-0000-000000000000). - # @!attribute [rw] update_mask - # @return [::Google::Protobuf::FieldMask] - # Field mask is used to specify the fields to be overwritten in the - # UnitOperation resource by the update. - # - # The fields specified in the update_mask are relative to the resource, not - # the full request. A field will be overwritten if it is in the mask. - # - # If the user does not provide a mask then all fields in the - # UnitOperation will be overwritten. - class UpdateUnitOperationRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # The request structure for the DeleteUnitOperation method. - # @!attribute [rw] name - # @return [::String] - # Required. The resource name of the resource within a service. - # @!attribute [rw] etag - # @return [::String] - # The etag known to the client for the expected state of the unit operation. - # This is used with state-changing methods to prevent accidental overwrites - # when multiple user agents might be acting in parallel on the same resource. - # - # An etag wildcard provide optimistic concurrency based on the expected - # existence of the unit operation. The Any wildcard (`*`) requires that the - # resource must already exists, and the Not Any wildcard (`!*`) requires that - # it must not. - # @!attribute [rw] validate_only - # @return [::Boolean] - # If "validate_only" is set to true, the service will try to validate - # that this request would succeed, but will not actually make changes. - # @!attribute [rw] request_id - # @return [::String] - # An optional request ID to identify requests. Specify a unique request ID - # so that if you must retry your request, the server will know to ignore - # the request if it has already been completed. The server will guarantee - # that for at least 60 minutes since the first request. - # - # For example, consider a situation where you make an initial request and the - # request times out. If you make the request again with the same request - # ID, the server can check if original operation with the same request ID - # was received, and if so, will ignore the second request. This prevents - # clients from accidentally creating duplicate commitments. - # - # The request ID must be a valid UUID with the exception that zero UUID is - # not supported (00000000-0000-0000-0000-000000000000). - class DeleteUnitOperationRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # The request structure for the ListReleases method. - # @!attribute [rw] parent - # @return [::String] - # Required. The parent of the release. - # @!attribute [rw] page_size - # @return [::Integer] - # The maximum number of releases to send per page. - # @!attribute [rw] page_token - # @return [::String] - # The page token: If the next_page_token from a previous response - # is provided, this request will send the subsequent page. - # @!attribute [rw] filter - # @return [::String] - # Filter the list as specified in https://google.aip.dev/160. - # @!attribute [rw] order_by - # @return [::String] - # Order results as specified in https://google.aip.dev/132. - class ListReleasesRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # The response structure for the ListReleases method. - # @!attribute [rw] releases - # @return [::Array<::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::Release>] - # The resulting releases. - # @!attribute [rw] next_page_token - # @return [::String] - # If present, the next page token can be provided to a subsequent - # ListReleases call to list the next page. - # If empty, there are no more pages. - # @!attribute [rw] unreachable - # @return [::Array<::String>] - # Locations that could not be reached. - class ListReleasesResponse - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # The request structure for the GetRelease method. - # @!attribute [rw] name - # @return [::String] - # Required. The resource name of the resource within a service. - class GetReleaseRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # The request structure for the CreateRelease method. - # @!attribute [rw] parent - # @return [::String] - # Required. The parent of the release. - # @!attribute [rw] release_id - # @return [::String] - # Required. The ID value for the new release. - # @!attribute [rw] release - # @return [::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::Release] - # Required. The desired state for the release. - # @!attribute [rw] validate_only - # @return [::Boolean] - # If "validate_only" is set to true, the service will try to validate - # that this request would succeed, but will not actually make changes. - # @!attribute [rw] request_id - # @return [::String] - # An optional request ID to identify requests. Specify a unique request ID - # so that if you must retry your request, the server will know to ignore - # the request if it has already been completed. The server will guarantee - # that for at least 60 minutes since the first request. - # - # For example, consider a situation where you make an initial request and the - # request times out. If you make the request again with the same request - # ID, the server can check if original operation with the same request ID - # was received, and if so, will ignore the second request. This prevents - # clients from accidentally creating duplicate commitments. - # - # The request ID must be a valid UUID with the exception that zero UUID is - # not supported (00000000-0000-0000-0000-000000000000). - class CreateReleaseRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # The request structure for the UpdateRelease method. - # @!attribute [rw] release - # @return [::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::Release] - # Required. The desired state for the release. - # @!attribute [rw] validate_only - # @return [::Boolean] - # If "validate_only" is set to true, the service will try to validate - # that this request would succeed, but will not actually make changes. - # @!attribute [rw] request_id - # @return [::String] - # An optional request ID to identify requests. Specify a unique request ID - # so that if you must retry your request, the server will know to ignore - # the request if it has already been completed. The server will guarantee - # that for at least 60 minutes since the first request. - # - # For example, consider a situation where you make an initial request and the - # request times out. If you make the request again with the same request - # ID, the server can check if original operation with the same request ID - # was received, and if so, will ignore the second request. This prevents - # clients from accidentally creating duplicate commitments. - # - # The request ID must be a valid UUID with the exception that zero UUID is - # not supported (00000000-0000-0000-0000-000000000000). - # @!attribute [rw] update_mask - # @return [::Google::Protobuf::FieldMask] - # Field mask is used to specify the fields to be overwritten in the - # Release resource by the update. - # - # The fields specified in the update_mask are relative to the resource, not - # the full request. A field will be overwritten if it is in the mask. - # - # If the user does not provide a mask then all fields in the - # Release will be overwritten. - class UpdateReleaseRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # The request structure for the DeleteRelease method. - # @!attribute [rw] name - # @return [::String] - # Required. The resource name of the resource within a service. - # @!attribute [rw] etag - # @return [::String] - # The etag known to the client for the expected state of the release. This is - # used with state-changing methods to prevent accidental overwrites when - # multiple user agents might be acting in parallel on the same resource. - # - # An etag wildcard provide optimistic concurrency based on the expected - # existence of the release. The Any wildcard (`*`) requires that the resource - # must already exists, and the Not Any wildcard (`!*`) requires that it must - # not. - # @!attribute [rw] validate_only - # @return [::Boolean] - # If "validate_only" is set to true, the service will try to validate - # that this request would succeed, but will not actually make changes. - # @!attribute [rw] request_id - # @return [::String] - # An optional request ID to identify requests. Specify a unique request ID - # so that if you must retry your request, the server will know to ignore - # the request if it has already been completed. The server will guarantee - # that for at least 60 minutes since the first request. - # - # For example, consider a situation where you make an initial request and the - # request times out. If you make the request again with the same request - # ID, the server can check if original operation with the same request ID - # was received, and if so, will ignore the second request. This prevents - # clients from accidentally creating duplicate commitments. - # - # The request ID must be a valid UUID with the exception that zero UUID is - # not supported (00000000-0000-0000-0000-000000000000). - class DeleteReleaseRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - end - end - end - end -end diff --git a/owl-bot-staging/google-cloud-saas_platform-saas_service_mgmt-v1beta1/proto_docs/google/cloud/saasplatform/saasservicemgmt/v1beta1/rollouts_resources.rb b/owl-bot-staging/google-cloud-saas_platform-saas_service_mgmt-v1beta1/proto_docs/google/cloud/saasplatform/saasservicemgmt/v1beta1/rollouts_resources.rb deleted file mode 100644 index 8bf8722fd171..000000000000 --- a/owl-bot-staging/google-cloud-saas_platform-saas_service_mgmt-v1beta1/proto_docs/google/cloud/saasplatform/saasservicemgmt/v1beta1/rollouts_resources.rb +++ /dev/null @@ -1,389 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - - -module Google - module Cloud - module SaasPlatform - module SaasServiceMgmt - module V1beta1 - # Represents a single rollout execution and its results - # @!attribute [rw] name - # @return [::String] - # Identifier. The resource name (full URI of the resource) following the - # standard naming scheme: - # - # "projects/\\{project}/locations/\\{location}/rollout/\\{rollout_id}" - # @!attribute [rw] release - # @return [::String] - # Optional. Immutable. Name of the Release that gets rolled out to target - # Units. Required if no other type of release is specified. - # @!attribute [r] start_time - # @return [::Google::Protobuf::Timestamp] - # Optional. Output only. The time when the rollout started executing. Will be - # empty if the rollout hasn't started yet. - # @!attribute [r] end_time - # @return [::Google::Protobuf::Timestamp] - # Optional. Output only. The time when the rollout finished execution - # (regardless of success, failure, or cancellation). Will be empty if the - # rollout hasn't finished yet. Once set, the rollout is in terminal state and - # all the results are final. - # @!attribute [r] state - # @return [::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::Rollout::RolloutState] - # Output only. Current state of the rollout. - # @!attribute [r] state_message - # @return [::String] - # Output only. Human readable message indicating details about the last state - # transition. - # @!attribute [r] state_transition_time - # @return [::Google::Protobuf::Timestamp] - # Optional. Output only. The time when the rollout transitioned into its - # current state. - # @!attribute [r] root_rollout - # @return [::String] - # Optional. Output only. The root rollout that this rollout is stemming from. - # The resource name (full URI of the resource) following the standard naming - # scheme: - # - # "projects/\\{project}/locations/\\{location}/rollouts/\\{rollout_id}" - # @!attribute [r] parent_rollout - # @return [::String] - # Optional. Output only. The direct parent rollout that this rollout is - # stemming from. The resource name (full URI of the resource) following the - # standard naming scheme: - # - # "projects/\\{project}/locations/\\{location}/rollouts/\\{rollout_id}" - # @!attribute [rw] rollout_orchestration_strategy - # @return [::String] - # Optional. The strategy used for executing this Rollout. - # This strategy will override whatever strategy is specified in the - # RolloutType. If not specified on creation, the - # strategy from RolloutType will be used. - # - # There are two supported values strategies which are used to control - # - "Google.Cloud.Simple.AllAtOnce" - # - "Google.Cloud.Simple.OneLocationAtATime" - # - # A rollout with one of these simple strategies will rollout across - # all locations defined in the targeted UnitKind's Saas Locations. - # @!attribute [rw] unit_filter - # @return [::String] - # Optional. CEL(https://github.com/google/cel-spec) formatted filter string - # against Unit. The filter will be applied to determine the eligible unit - # population. This filter can only reduce, but not expand the scope of the - # rollout. If not provided, the unit_filter from the RolloutType will be - # used. - # @!attribute [rw] rollout_kind - # @return [::String] - # Optional. Immutable. Name of the RolloutKind this rollout is stemming from - # and adhering to. - # @!attribute [r] stats - # @return [::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::RolloutStats] - # Optional. Output only. Details about the progress of the rollout. - # @!attribute [rw] control - # @return [::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::RolloutControl] - # Optional. Requested change to the execution of this rollout. - # Default RolloutControl.action is ROLLOUT_ACTION_RUN meaning - # the rollout will be executed to completion while progressing through - # all natural Rollout States (such as RUNNING -> SUCCEEDED or RUNNING -> - # FAILED). Requests can only be made when the Rollout is in a non-terminal - # state. - # @!attribute [rw] labels - # @return [::Google::Protobuf::Map{::String => ::String}] - # Optional. The labels on the resource, which can be used for categorization. - # similar to Kubernetes resource labels. - # @!attribute [rw] annotations - # @return [::Google::Protobuf::Map{::String => ::String}] - # Optional. Annotations is an unstructured key-value map stored with a - # resource that may be set by external tools to store and retrieve arbitrary - # metadata. They are not queryable and should be preserved when modifying - # objects. - # - # More info: https://kubernetes.io/docs/user-guide/annotations - # @!attribute [r] uid - # @return [::String] - # Output only. The unique identifier of the resource. UID is unique in the - # time and space for this resource within the scope of the service. It is - # typically generated by the server on successful creation of a resource - # and must not be changed. UID is used to uniquely identify resources - # with resource name reuses. This should be a UUID4. - # @!attribute [r] etag - # @return [::String] - # Output only. An opaque value that uniquely identifies a version or - # generation of a resource. It can be used to confirm that the client - # and server agree on the ordering of a resource being written. - # @!attribute [r] create_time - # @return [::Google::Protobuf::Timestamp] - # Output only. The timestamp when the resource was created. - # @!attribute [r] update_time - # @return [::Google::Protobuf::Timestamp] - # Output only. The timestamp when the resource was last updated. Any - # change to the resource made by users must refresh this value. - # Changes to a resource made by the service should refresh this value. - class Rollout - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - - # @!attribute [rw] key - # @return [::String] - # @!attribute [rw] value - # @return [::String] - class LabelsEntry - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # @!attribute [rw] key - # @return [::String] - # @!attribute [rw] value - # @return [::String] - class AnnotationsEntry - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # The current state of the rollout. - module RolloutState - # Unspecified state. - ROLLOUT_STATE_UNSPECIFIED = 0 - - # Rollout is in progress. - ROLLOUT_STATE_RUNNING = 1 - - # Rollout has been paused. - ROLLOUT_STATE_PAUSED = 2 - - # Rollout completed successfully. - ROLLOUT_STATE_SUCCEEDED = 3 - - # Rollout has failed. - ROLLOUT_STATE_FAILED = 4 - - # Rollout has been canceled. - ROLLOUT_STATE_CANCELLED = 5 - - # Rollout is waiting for some condition to be met before starting. - ROLLOUT_STATE_WAITING = 6 - - # Rollout is being canceled. - ROLLOUT_STATE_CANCELLING = 7 - - # Rollout is being resumed. - ROLLOUT_STATE_RESUMING = 8 - - # Rollout is being paused. - ROLLOUT_STATE_PAUSING = 9 - end - end - - # An object that describes various settings of Rollout execution. Includes - # built-in policies across GCP and GDC, and customizable policies. - # @!attribute [rw] name - # @return [::String] - # Identifier. The resource name (full URI of the resource) following the - # standard naming scheme: - # - # "projects/\\{project}/locations/\\{location}/rolloutKinds/\\{rollout_kind_id}" - # @!attribute [rw] unit_kind - # @return [::String] - # Required. Immutable. UnitKind that this rollout kind corresponds to. - # Rollouts stemming from this rollout kind will target the units of this unit - # kind. In other words, this defines the population of target units to be - # upgraded by rollouts. - # @!attribute [rw] rollout_orchestration_strategy - # @return [::String] - # Optional. The strategy used for executing a Rollout. This is a required - # field. - # - # There are two supported values strategies which are used to control - # - "Google.Cloud.Simple.AllAtOnce" - # - "Google.Cloud.Simple.OneLocationAtATime" - # - # A rollout with one of these simple strategies will rollout across - # all locations defined in the associated UnitKind's Saas Locations. - # @!attribute [rw] unit_filter - # @return [::String] - # Optional. CEL(https://github.com/google/cel-spec) formatted filter string - # against Unit. The filter will be applied to determine the eligible unit - # population. This filter can only reduce, but not expand the scope of the - # rollout. - # @!attribute [rw] update_unit_kind_strategy - # @return [::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::RolloutKind::UpdateUnitKindStrategy] - # Optional. The config for updating the unit kind. By default, the unit kind - # will be updated on the rollout start. - # @!attribute [rw] error_budget - # @return [::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::ErrorBudget] - # Optional. The configuration for error budget. If the number of failed units - # exceeds max(allowed_count, allowed_ratio * total_units), the rollout will - # be paused. If not set, all units will be attempted to be updated regardless - # of the number of failures encountered. - # @!attribute [rw] labels - # @return [::Google::Protobuf::Map{::String => ::String}] - # Optional. The labels on the resource, which can be used for categorization. - # similar to Kubernetes resource labels. - # @!attribute [rw] annotations - # @return [::Google::Protobuf::Map{::String => ::String}] - # Optional. Annotations is an unstructured key-value map stored with a - # resource that may be set by external tools to store and retrieve arbitrary - # metadata. They are not queryable and should be preserved when modifying - # objects. - # - # More info: https://kubernetes.io/docs/user-guide/annotations - # @!attribute [r] uid - # @return [::String] - # Output only. The unique identifier of the resource. UID is unique in the - # time and space for this resource within the scope of the service. It is - # typically generated by the server on successful creation of a resource - # and must not be changed. UID is used to uniquely identify resources - # with resource name reuses. This should be a UUID4. - # @!attribute [r] etag - # @return [::String] - # Output only. An opaque value that uniquely identifies a version or - # generation of a resource. It can be used to confirm that the client - # and server agree on the ordering of a resource being written. - # @!attribute [r] create_time - # @return [::Google::Protobuf::Timestamp] - # Output only. The timestamp when the resource was created. - # @!attribute [r] update_time - # @return [::Google::Protobuf::Timestamp] - # Output only. The timestamp when the resource was last updated. Any - # change to the resource made by users must refresh this value. - # Changes to a resource made by the service should refresh this value. - class RolloutKind - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - - # @!attribute [rw] key - # @return [::String] - # @!attribute [rw] value - # @return [::String] - class LabelsEntry - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # @!attribute [rw] key - # @return [::String] - # @!attribute [rw] value - # @return [::String] - class AnnotationsEntry - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - module UpdateUnitKindStrategy - # Strategy unspecified. - UPDATE_UNIT_KIND_STRATEGY_UNSPECIFIED = 0 - - # Update the unit kind strategy on the rollout start. - UPDATE_UNIT_KIND_STRATEGY_ON_START = 1 - - # Never update the unit kind. - UPDATE_UNIT_KIND_STRATEGY_NEVER = 2 - end - end - - # The configuration for error budget. If the number of failed units exceeds - # max(allowed_count, allowed_ratio * total_units), the rollout will be paused. - # @!attribute [rw] allowed_count - # @return [::Integer] - # Optional. The maximum number of failed units allowed in a location without - # pausing the rollout. - # @!attribute [rw] allowed_percentage - # @return [::Integer] - # Optional. The maximum percentage of units allowed to fail (0, 100] within a - # location without pausing the rollout. - class ErrorBudget - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # RolloutStats contains information about the progress of a rollout. - # @!attribute [r] operations_by_state - # @return [::Array<::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::Aggregate>] - # Output only. A breakdown of the progress of operations triggered by the - # rollout. Provides a count of Operations by their state. This can be used to - # determine the number of units which have been updated, or are scheduled to - # be updated. - # - # There will be at most one entry per group. - # Possible values for operation groups are: - # - "SCHEDULED" - # - "PENDING" - # - "RUNNING" - # - "SUCCEEDED" - # - "FAILED" - # - "CANCELLED" - class RolloutStats - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # RolloutControl provides a way to request a change to the execution of a - # Rollout by pausing or canceling it. - # @!attribute [rw] run_params - # @return [::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::RolloutControl::RunRolloutActionParams] - # Optional. Parameters for the RUN action. It is an error to specify this - # if the RolloutAction is not set to RUN. By default, the rollout will - # retry failed operations when resumed. - # @!attribute [rw] action - # @return [::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::RolloutAction] - # Required. Action to be performed on the Rollout. - # The default behavior is to run the rollout until it naturally reaches a - # terminal state. - class RolloutControl - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - - # Parameters for the RUN action controlling the behavior of the rollout - # when it is resumed from a PAUSED state. - # @!attribute [rw] retry_failed_operations - # @return [::Boolean] - # Required. If true, the rollout will retry failed operations when resumed. - # This is applicable only the current state of the Rollout is PAUSED and - # the requested action is RUN. - class RunRolloutActionParams - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - end - - # RolloutAction indicates the action to be performed on the Rollout. - module RolloutAction - # Unspecified action, will be treated as RUN by default. - ROLLOUT_ACTION_UNSPECIFIED = 0 - - # Run the Rollout until it naturally reaches a terminal state. - # A rollout requested to run will progress through all natural Rollout - # States (such as RUNNING -> SUCCEEDED or RUNNING -> FAILED). - # If retriable errors are encountered during the rollout, the rollout - # will paused by default and can be resumed by re-requesting this RUN - # action. - ROLLOUT_ACTION_RUN = 1 - - # Pause the Rollout until it is resumed (i.e. RUN is requested). - ROLLOUT_ACTION_PAUSE = 2 - - # Cancel the Rollout permanently. - ROLLOUT_ACTION_CANCEL = 3 - end - end - end - end - end -end diff --git a/owl-bot-staging/google-cloud-saas_platform-saas_service_mgmt-v1beta1/proto_docs/google/cloud/saasplatform/saasservicemgmt/v1beta1/rollouts_service.rb b/owl-bot-staging/google-cloud-saas_platform-saas_service_mgmt-v1beta1/proto_docs/google/cloud/saasplatform/saasservicemgmt/v1beta1/rollouts_service.rb deleted file mode 100644 index 62274e2bab73..000000000000 --- a/owl-bot-staging/google-cloud-saas_platform-saas_service_mgmt-v1beta1/proto_docs/google/cloud/saasplatform/saasservicemgmt/v1beta1/rollouts_service.rb +++ /dev/null @@ -1,344 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - - -module Google - module Cloud - module SaasPlatform - module SaasServiceMgmt - module V1beta1 - # The request structure for the ListRollouts method. - # @!attribute [rw] parent - # @return [::String] - # Required. The parent of the rollout. - # @!attribute [rw] page_size - # @return [::Integer] - # The maximum number of rollouts to send per page. - # @!attribute [rw] page_token - # @return [::String] - # The page token: If the next_page_token from a previous response - # is provided, this request will send the subsequent page. - # @!attribute [rw] filter - # @return [::String] - # Filter the list as specified in https://google.aip.dev/160. - # @!attribute [rw] order_by - # @return [::String] - # Order results as specified in https://google.aip.dev/132. - class ListRolloutsRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # The response structure for the ListRollouts method. - # @!attribute [rw] rollouts - # @return [::Array<::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::Rollout>] - # The resulting rollouts. - # @!attribute [rw] next_page_token - # @return [::String] - # If present, the next page token can be provided to a subsequent - # ListRollouts call to list the next page. - # If empty, there are no more pages. - # @!attribute [rw] unreachable - # @return [::Array<::String>] - # Locations that could not be reached. - class ListRolloutsResponse - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # The request structure for the GetRollout method. - # @!attribute [rw] name - # @return [::String] - # Required. The resource name of the resource within a service. - class GetRolloutRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # The request structure for the CreateRollout method. - # @!attribute [rw] parent - # @return [::String] - # Required. The parent of the rollout. - # @!attribute [rw] rollout_id - # @return [::String] - # Required. The ID value for the new rollout. - # @!attribute [rw] rollout - # @return [::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::Rollout] - # Required. The desired state for the rollout. - # @!attribute [rw] validate_only - # @return [::Boolean] - # If "validate_only" is set to true, the service will try to validate - # that this request would succeed, but will not actually make changes. - # @!attribute [rw] request_id - # @return [::String] - # An optional request ID to identify requests. Specify a unique request ID - # so that if you must retry your request, the server will know to ignore - # the request if it has already been completed. The server will guarantee - # that for at least 60 minutes since the first request. - # - # For example, consider a situation where you make an initial request and the - # request times out. If you make the request again with the same request - # ID, the server can check if original operation with the same request ID - # was received, and if so, will ignore the second request. This prevents - # clients from accidentally creating duplicate commitments. - # - # The request ID must be a valid UUID with the exception that zero UUID is - # not supported (00000000-0000-0000-0000-000000000000). - class CreateRolloutRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # The request structure for the UpdateRollout method. - # @!attribute [rw] rollout - # @return [::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::Rollout] - # Required. The desired state for the rollout. - # @!attribute [rw] validate_only - # @return [::Boolean] - # If "validate_only" is set to true, the service will try to validate - # that this request would succeed, but will not actually make changes. - # @!attribute [rw] request_id - # @return [::String] - # An optional request ID to identify requests. Specify a unique request ID - # so that if you must retry your request, the server will know to ignore - # the request if it has already been completed. The server will guarantee - # that for at least 60 minutes since the first request. - # - # For example, consider a situation where you make an initial request and the - # request times out. If you make the request again with the same request - # ID, the server can check if original operation with the same request ID - # was received, and if so, will ignore the second request. This prevents - # clients from accidentally creating duplicate commitments. - # - # The request ID must be a valid UUID with the exception that zero UUID is - # not supported (00000000-0000-0000-0000-000000000000). - # @!attribute [rw] update_mask - # @return [::Google::Protobuf::FieldMask] - # Field mask is used to specify the fields to be overwritten in the - # Rollout resource by the update. - # - # The fields specified in the update_mask are relative to the resource, not - # the full request. A field will be overwritten if it is in the mask. - # - # If the user does not provide a mask then all fields in the - # Rollout will be overwritten. - class UpdateRolloutRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # The request structure for the DeleteRollout method. - # @!attribute [rw] name - # @return [::String] - # Required. The resource name of the resource within a service. - # @!attribute [rw] etag - # @return [::String] - # The etag known to the client for the expected state of the rollout. This is - # used with state-changing methods to prevent accidental overwrites when - # multiple user agents might be acting in parallel on the same resource. - # - # An etag wildcard provide optimistic concurrency based on the expected - # existence of the rollout. The Any wildcard (`*`) requires that the resource - # must already exists, and the Not Any wildcard (`!*`) requires that it must - # not. - # @!attribute [rw] validate_only - # @return [::Boolean] - # If "validate_only" is set to true, the service will try to validate - # that this request would succeed, but will not actually make changes. - # @!attribute [rw] request_id - # @return [::String] - # An optional request ID to identify requests. Specify a unique request ID - # so that if you must retry your request, the server will know to ignore - # the request if it has already been completed. The server will guarantee - # that for at least 60 minutes since the first request. - # - # For example, consider a situation where you make an initial request and the - # request times out. If you make the request again with the same request - # ID, the server can check if original operation with the same request ID - # was received, and if so, will ignore the second request. This prevents - # clients from accidentally creating duplicate commitments. - # - # The request ID must be a valid UUID with the exception that zero UUID is - # not supported (00000000-0000-0000-0000-000000000000). - class DeleteRolloutRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # The request structure for the ListRolloutKinds method. - # @!attribute [rw] parent - # @return [::String] - # Required. The parent of the rollout kind. - # @!attribute [rw] page_size - # @return [::Integer] - # The maximum number of rollout kinds to send per page. - # @!attribute [rw] page_token - # @return [::String] - # The page token: If the next_page_token from a previous response - # is provided, this request will send the subsequent page. - # @!attribute [rw] filter - # @return [::String] - # Filter the list as specified in https://google.aip.dev/160. - # @!attribute [rw] order_by - # @return [::String] - # Order results as specified in https://google.aip.dev/132. - class ListRolloutKindsRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # The response structure for the ListRolloutKinds method. - # @!attribute [rw] rollout_kinds - # @return [::Array<::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::RolloutKind>] - # The resulting rollout kinds. - # @!attribute [rw] next_page_token - # @return [::String] - # If present, the next page token can be provided to a subsequent - # ListRolloutKinds call to list the next page. - # If empty, there are no more pages. - # @!attribute [rw] unreachable - # @return [::Array<::String>] - # Locations that could not be reached. - class ListRolloutKindsResponse - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # The request structure for the GetRolloutKind method. - # @!attribute [rw] name - # @return [::String] - # Required. The resource name of the resource within a service. - class GetRolloutKindRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # The request structure for the CreateRolloutKind method. - # @!attribute [rw] parent - # @return [::String] - # Required. The parent of the rollout kind. - # @!attribute [rw] rollout_kind_id - # @return [::String] - # Required. The ID value for the new rollout kind. - # @!attribute [rw] rollout_kind - # @return [::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::RolloutKind] - # Required. The desired state for the rollout kind. - # @!attribute [rw] validate_only - # @return [::Boolean] - # If "validate_only" is set to true, the service will try to validate - # that this request would succeed, but will not actually make changes. - # @!attribute [rw] request_id - # @return [::String] - # An optional request ID to identify requests. Specify a unique request ID - # so that if you must retry your request, the server will know to ignore - # the request if it has already been completed. The server will guarantee - # that for at least 60 minutes since the first request. - # - # For example, consider a situation where you make an initial request and the - # request times out. If you make the request again with the same request - # ID, the server can check if original operation with the same request ID - # was received, and if so, will ignore the second request. This prevents - # clients from accidentally creating duplicate commitments. - # - # The request ID must be a valid UUID with the exception that zero UUID is - # not supported (00000000-0000-0000-0000-000000000000). - class CreateRolloutKindRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # The request structure for the UpdateRolloutKind method. - # @!attribute [rw] rollout_kind - # @return [::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::RolloutKind] - # Required. The desired state for the rollout kind. - # @!attribute [rw] validate_only - # @return [::Boolean] - # If "validate_only" is set to true, the service will try to validate - # that this request would succeed, but will not actually make changes. - # @!attribute [rw] request_id - # @return [::String] - # An optional request ID to identify requests. Specify a unique request ID - # so that if you must retry your request, the server will know to ignore - # the request if it has already been completed. The server will guarantee - # that for at least 60 minutes since the first request. - # - # For example, consider a situation where you make an initial request and the - # request times out. If you make the request again with the same request - # ID, the server can check if original operation with the same request ID - # was received, and if so, will ignore the second request. This prevents - # clients from accidentally creating duplicate commitments. - # - # The request ID must be a valid UUID with the exception that zero UUID is - # not supported (00000000-0000-0000-0000-000000000000). - # @!attribute [rw] update_mask - # @return [::Google::Protobuf::FieldMask] - # Field mask is used to specify the fields to be overwritten in the - # RolloutKind resource by the update. - # - # The fields specified in the update_mask are relative to the resource, not - # the full request. A field will be overwritten if it is in the mask. - # - # If the user does not provide a mask then all fields in the - # RolloutKind will be overwritten. - class UpdateRolloutKindRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # The request structure for the DeleteRolloutKind method. - # @!attribute [rw] name - # @return [::String] - # Required. The resource name of the resource within a service. - # @!attribute [rw] etag - # @return [::String] - # The etag known to the client for the expected state of the rollout kind. - # This is used with state-changing methods to prevent accidental overwrites - # when multiple user agents might be acting in parallel on the same resource. - # - # An etag wildcard provide optimistic concurrency based on the expected - # existence of the rollout kind. The Any wildcard (`*`) requires that the - # resource must already exists, and the Not Any wildcard (`!*`) requires that - # it must not. - # @!attribute [rw] validate_only - # @return [::Boolean] - # If "validate_only" is set to true, the service will try to validate - # that this request would succeed, but will not actually make changes. - # @!attribute [rw] request_id - # @return [::String] - # An optional request ID to identify requests. Specify a unique request ID - # so that if you must retry your request, the server will know to ignore - # the request if it has already been completed. The server will guarantee - # that for at least 60 minutes since the first request. - # - # For example, consider a situation where you make an initial request and the - # request times out. If you make the request again with the same request - # ID, the server can check if original operation with the same request ID - # was received, and if so, will ignore the second request. This prevents - # clients from accidentally creating duplicate commitments. - # - # The request ID must be a valid UUID with the exception that zero UUID is - # not supported (00000000-0000-0000-0000-000000000000). - class DeleteRolloutKindRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - end - end - end - end -end diff --git a/owl-bot-staging/google-cloud-saas_platform-saas_service_mgmt-v1beta1/proto_docs/google/protobuf/any.rb b/owl-bot-staging/google-cloud-saas_platform-saas_service_mgmt-v1beta1/proto_docs/google/protobuf/any.rb deleted file mode 100644 index 58691995f02e..000000000000 --- a/owl-bot-staging/google-cloud-saas_platform-saas_service_mgmt-v1beta1/proto_docs/google/protobuf/any.rb +++ /dev/null @@ -1,145 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - - -module Google - module Protobuf - # `Any` contains an arbitrary serialized protocol buffer message along with a - # URL that describes the type of the serialized message. - # - # Protobuf library provides support to pack/unpack Any values in the form - # of utility functions or additional generated methods of the Any type. - # - # Example 1: Pack and unpack a message in C++. - # - # Foo foo = ...; - # Any any; - # any.PackFrom(foo); - # ... - # if (any.UnpackTo(&foo)) { - # ... - # } - # - # Example 2: Pack and unpack a message in Java. - # - # Foo foo = ...; - # Any any = Any.pack(foo); - # ... - # if (any.is(Foo.class)) { - # foo = any.unpack(Foo.class); - # } - # // or ... - # if (any.isSameTypeAs(Foo.getDefaultInstance())) { - # foo = any.unpack(Foo.getDefaultInstance()); - # } - # - # Example 3: Pack and unpack a message in Python. - # - # foo = Foo(...) - # any = Any() - # any.Pack(foo) - # ... - # if any.Is(Foo.DESCRIPTOR): - # any.Unpack(foo) - # ... - # - # Example 4: Pack and unpack a message in Go - # - # foo := &pb.Foo{...} - # any, err := anypb.New(foo) - # if err != nil { - # ... - # } - # ... - # foo := &pb.Foo{} - # if err := any.UnmarshalTo(foo); err != nil { - # ... - # } - # - # The pack methods provided by protobuf library will by default use - # 'type.googleapis.com/full.type.name' as the type URL and the unpack - # methods only use the fully qualified type name after the last '/' - # in the type URL, for example "foo.bar.com/x/y.z" will yield type - # name "y.z". - # - # JSON - # ==== - # The JSON representation of an `Any` value uses the regular - # representation of the deserialized, embedded message, with an - # additional field `@type` which contains the type URL. Example: - # - # package google.profile; - # message Person { - # string first_name = 1; - # string last_name = 2; - # } - # - # { - # "@type": "type.googleapis.com/google.profile.Person", - # "firstName": , - # "lastName": - # } - # - # If the embedded message type is well-known and has a custom JSON - # representation, that representation will be embedded adding a field - # `value` which holds the custom JSON in addition to the `@type` - # field. Example (for message [google.protobuf.Duration][]): - # - # { - # "@type": "type.googleapis.com/google.protobuf.Duration", - # "value": "1.212s" - # } - # @!attribute [rw] type_url - # @return [::String] - # A URL/resource name that uniquely identifies the type of the serialized - # protocol buffer message. This string must contain at least - # one "/" character. The last segment of the URL's path must represent - # the fully qualified name of the type (as in - # `path/google.protobuf.Duration`). The name should be in a canonical form - # (e.g., leading "." is not accepted). - # - # In practice, teams usually precompile into the binary all types that they - # expect it to use in the context of Any. However, for URLs which use the - # scheme `http`, `https`, or no scheme, one can optionally set up a type - # server that maps type URLs to message definitions as follows: - # - # * If no scheme is provided, `https` is assumed. - # * An HTTP GET on the URL must yield a [google.protobuf.Type][] - # value in binary format, or produce an error. - # * Applications are allowed to cache lookup results based on the - # URL, or have them precompiled into a binary to avoid any - # lookup. Therefore, binary compatibility needs to be preserved - # on changes to types. (Use versioned type names to manage - # breaking changes.) - # - # Note: this functionality is not currently available in the official - # protobuf release, and it is not used for type URLs beginning with - # type.googleapis.com. As of May 2023, there are no widely used type server - # implementations and no plans to implement one. - # - # Schemes other than `http`, `https` (or the empty scheme) might be - # used with implementation specific semantics. - # @!attribute [rw] value - # @return [::String] - # Must be a valid serialized protocol buffer of the above specified type. - class Any - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - end -end diff --git a/owl-bot-staging/google-cloud-saas_platform-saas_service_mgmt-v1beta1/proto_docs/google/protobuf/duration.rb b/owl-bot-staging/google-cloud-saas_platform-saas_service_mgmt-v1beta1/proto_docs/google/protobuf/duration.rb deleted file mode 100644 index ea59f1f91daf..000000000000 --- a/owl-bot-staging/google-cloud-saas_platform-saas_service_mgmt-v1beta1/proto_docs/google/protobuf/duration.rb +++ /dev/null @@ -1,98 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - - -module Google - module Protobuf - # A Duration represents a signed, fixed-length span of time represented - # as a count of seconds and fractions of seconds at nanosecond - # resolution. It is independent of any calendar and concepts like "day" - # or "month". It is related to Timestamp in that the difference between - # two Timestamp values is a Duration and it can be added or subtracted - # from a Timestamp. Range is approximately +-10,000 years. - # - # # Examples - # - # Example 1: Compute Duration from two Timestamps in pseudo code. - # - # Timestamp start = ...; - # Timestamp end = ...; - # Duration duration = ...; - # - # duration.seconds = end.seconds - start.seconds; - # duration.nanos = end.nanos - start.nanos; - # - # if (duration.seconds < 0 && duration.nanos > 0) { - # duration.seconds += 1; - # duration.nanos -= 1000000000; - # } else if (duration.seconds > 0 && duration.nanos < 0) { - # duration.seconds -= 1; - # duration.nanos += 1000000000; - # } - # - # Example 2: Compute Timestamp from Timestamp + Duration in pseudo code. - # - # Timestamp start = ...; - # Duration duration = ...; - # Timestamp end = ...; - # - # end.seconds = start.seconds + duration.seconds; - # end.nanos = start.nanos + duration.nanos; - # - # if (end.nanos < 0) { - # end.seconds -= 1; - # end.nanos += 1000000000; - # } else if (end.nanos >= 1000000000) { - # end.seconds += 1; - # end.nanos -= 1000000000; - # } - # - # Example 3: Compute Duration from datetime.timedelta in Python. - # - # td = datetime.timedelta(days=3, minutes=10) - # duration = Duration() - # duration.FromTimedelta(td) - # - # # JSON Mapping - # - # In JSON format, the Duration type is encoded as a string rather than an - # object, where the string ends in the suffix "s" (indicating seconds) and - # is preceded by the number of seconds, with nanoseconds expressed as - # fractional seconds. For example, 3 seconds with 0 nanoseconds should be - # encoded in JSON format as "3s", while 3 seconds and 1 nanosecond should - # be expressed in JSON format as "3.000000001s", and 3 seconds and 1 - # microsecond should be expressed in JSON format as "3.000001s". - # @!attribute [rw] seconds - # @return [::Integer] - # Signed seconds of the span of time. Must be from -315,576,000,000 - # to +315,576,000,000 inclusive. Note: these bounds are computed from: - # 60 sec/min * 60 min/hr * 24 hr/day * 365.25 days/year * 10000 years - # @!attribute [rw] nanos - # @return [::Integer] - # Signed fractions of a second at nanosecond resolution of the span - # of time. Durations less than one second are represented with a 0 - # `seconds` field and a positive or negative `nanos` field. For durations - # of one second or more, a non-zero value for the `nanos` field must be - # of the same sign as the `seconds` field. Must be from -999,999,999 - # to +999,999,999 inclusive. - class Duration - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - end -end diff --git a/owl-bot-staging/google-cloud-saas_platform-saas_service_mgmt-v1beta1/proto_docs/google/protobuf/empty.rb b/owl-bot-staging/google-cloud-saas_platform-saas_service_mgmt-v1beta1/proto_docs/google/protobuf/empty.rb deleted file mode 100644 index 83e4481834a6..000000000000 --- a/owl-bot-staging/google-cloud-saas_platform-saas_service_mgmt-v1beta1/proto_docs/google/protobuf/empty.rb +++ /dev/null @@ -1,34 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - - -module Google - module Protobuf - # A generic empty message that you can re-use to avoid defining duplicated - # empty messages in your APIs. A typical example is to use it as the request - # or the response type of an API method. For instance: - # - # service Foo { - # rpc Bar(google.protobuf.Empty) returns (google.protobuf.Empty); - # } - class Empty - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - end -end diff --git a/owl-bot-staging/google-cloud-saas_platform-saas_service_mgmt-v1beta1/proto_docs/google/protobuf/field_mask.rb b/owl-bot-staging/google-cloud-saas_platform-saas_service_mgmt-v1beta1/proto_docs/google/protobuf/field_mask.rb deleted file mode 100644 index 7f3ffc78601a..000000000000 --- a/owl-bot-staging/google-cloud-saas_platform-saas_service_mgmt-v1beta1/proto_docs/google/protobuf/field_mask.rb +++ /dev/null @@ -1,229 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - - -module Google - module Protobuf - # `FieldMask` represents a set of symbolic field paths, for example: - # - # paths: "f.a" - # paths: "f.b.d" - # - # Here `f` represents a field in some root message, `a` and `b` - # fields in the message found in `f`, and `d` a field found in the - # message in `f.b`. - # - # Field masks are used to specify a subset of fields that should be - # returned by a get operation or modified by an update operation. - # Field masks also have a custom JSON encoding (see below). - # - # # Field Masks in Projections - # - # When used in the context of a projection, a response message or - # sub-message is filtered by the API to only contain those fields as - # specified in the mask. For example, if the mask in the previous - # example is applied to a response message as follows: - # - # f { - # a : 22 - # b { - # d : 1 - # x : 2 - # } - # y : 13 - # } - # z: 8 - # - # The result will not contain specific values for fields x,y and z - # (their value will be set to the default, and omitted in proto text - # output): - # - # - # f { - # a : 22 - # b { - # d : 1 - # } - # } - # - # A repeated field is not allowed except at the last position of a - # paths string. - # - # If a FieldMask object is not present in a get operation, the - # operation applies to all fields (as if a FieldMask of all fields - # had been specified). - # - # Note that a field mask does not necessarily apply to the - # top-level response message. In case of a REST get operation, the - # field mask applies directly to the response, but in case of a REST - # list operation, the mask instead applies to each individual message - # in the returned resource list. In case of a REST custom method, - # other definitions may be used. Where the mask applies will be - # clearly documented together with its declaration in the API. In - # any case, the effect on the returned resource/resources is required - # behavior for APIs. - # - # # Field Masks in Update Operations - # - # A field mask in update operations specifies which fields of the - # targeted resource are going to be updated. The API is required - # to only change the values of the fields as specified in the mask - # and leave the others untouched. If a resource is passed in to - # describe the updated values, the API ignores the values of all - # fields not covered by the mask. - # - # If a repeated field is specified for an update operation, new values will - # be appended to the existing repeated field in the target resource. Note that - # a repeated field is only allowed in the last position of a `paths` string. - # - # If a sub-message is specified in the last position of the field mask for an - # update operation, then new value will be merged into the existing sub-message - # in the target resource. - # - # For example, given the target message: - # - # f { - # b { - # d: 1 - # x: 2 - # } - # c: [1] - # } - # - # And an update message: - # - # f { - # b { - # d: 10 - # } - # c: [2] - # } - # - # then if the field mask is: - # - # paths: ["f.b", "f.c"] - # - # then the result will be: - # - # f { - # b { - # d: 10 - # x: 2 - # } - # c: [1, 2] - # } - # - # An implementation may provide options to override this default behavior for - # repeated and message fields. - # - # In order to reset a field's value to the default, the field must - # be in the mask and set to the default value in the provided resource. - # Hence, in order to reset all fields of a resource, provide a default - # instance of the resource and set all fields in the mask, or do - # not provide a mask as described below. - # - # If a field mask is not present on update, the operation applies to - # all fields (as if a field mask of all fields has been specified). - # Note that in the presence of schema evolution, this may mean that - # fields the client does not know and has therefore not filled into - # the request will be reset to their default. If this is unwanted - # behavior, a specific service may require a client to always specify - # a field mask, producing an error if not. - # - # As with get operations, the location of the resource which - # describes the updated values in the request message depends on the - # operation kind. In any case, the effect of the field mask is - # required to be honored by the API. - # - # ## Considerations for HTTP REST - # - # The HTTP kind of an update operation which uses a field mask must - # be set to PATCH instead of PUT in order to satisfy HTTP semantics - # (PUT must only be used for full updates). - # - # # JSON Encoding of Field Masks - # - # In JSON, a field mask is encoded as a single string where paths are - # separated by a comma. Fields name in each path are converted - # to/from lower-camel naming conventions. - # - # As an example, consider the following message declarations: - # - # message Profile { - # User user = 1; - # Photo photo = 2; - # } - # message User { - # string display_name = 1; - # string address = 2; - # } - # - # In proto a field mask for `Profile` may look as such: - # - # mask { - # paths: "user.display_name" - # paths: "photo" - # } - # - # In JSON, the same mask is represented as below: - # - # { - # mask: "user.displayName,photo" - # } - # - # # Field Masks and Oneof Fields - # - # Field masks treat fields in oneofs just as regular fields. Consider the - # following message: - # - # message SampleMessage { - # oneof test_oneof { - # string name = 4; - # SubMessage sub_message = 9; - # } - # } - # - # The field mask can be: - # - # mask { - # paths: "name" - # } - # - # Or: - # - # mask { - # paths: "sub_message" - # } - # - # Note that oneof type names ("test_oneof" in this case) cannot be used in - # paths. - # - # ## Field Mask Verification - # - # The implementation of any API method which has a FieldMask type field in the - # request should verify the included field paths, and return an - # `INVALID_ARGUMENT` error if any path is unmappable. - # @!attribute [rw] paths - # @return [::Array<::String>] - # The set of field mask paths. - class FieldMask - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - end -end diff --git a/owl-bot-staging/google-cloud-saas_platform-saas_service_mgmt-v1beta1/proto_docs/google/protobuf/timestamp.rb b/owl-bot-staging/google-cloud-saas_platform-saas_service_mgmt-v1beta1/proto_docs/google/protobuf/timestamp.rb deleted file mode 100644 index 74352be9c58c..000000000000 --- a/owl-bot-staging/google-cloud-saas_platform-saas_service_mgmt-v1beta1/proto_docs/google/protobuf/timestamp.rb +++ /dev/null @@ -1,127 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - - -module Google - module Protobuf - # A Timestamp represents a point in time independent of any time zone or local - # calendar, encoded as a count of seconds and fractions of seconds at - # nanosecond resolution. The count is relative to an epoch at UTC midnight on - # January 1, 1970, in the proleptic Gregorian calendar which extends the - # Gregorian calendar backwards to year one. - # - # All minutes are 60 seconds long. Leap seconds are "smeared" so that no leap - # second table is needed for interpretation, using a [24-hour linear - # smear](https://developers.google.com/time/smear). - # - # The range is from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59.999999999Z. By - # restricting to that range, we ensure that we can convert to and from [RFC - # 3339](https://www.ietf.org/rfc/rfc3339.txt) date strings. - # - # # Examples - # - # Example 1: Compute Timestamp from POSIX `time()`. - # - # Timestamp timestamp; - # timestamp.set_seconds(time(NULL)); - # timestamp.set_nanos(0); - # - # Example 2: Compute Timestamp from POSIX `gettimeofday()`. - # - # struct timeval tv; - # gettimeofday(&tv, NULL); - # - # Timestamp timestamp; - # timestamp.set_seconds(tv.tv_sec); - # timestamp.set_nanos(tv.tv_usec * 1000); - # - # Example 3: Compute Timestamp from Win32 `GetSystemTimeAsFileTime()`. - # - # FILETIME ft; - # GetSystemTimeAsFileTime(&ft); - # UINT64 ticks = (((UINT64)ft.dwHighDateTime) << 32) | ft.dwLowDateTime; - # - # // A Windows tick is 100 nanoseconds. Windows epoch 1601-01-01T00:00:00Z - # // is 11644473600 seconds before Unix epoch 1970-01-01T00:00:00Z. - # Timestamp timestamp; - # timestamp.set_seconds((INT64) ((ticks / 10000000) - 11644473600LL)); - # timestamp.set_nanos((INT32) ((ticks % 10000000) * 100)); - # - # Example 4: Compute Timestamp from Java `System.currentTimeMillis()`. - # - # long millis = System.currentTimeMillis(); - # - # Timestamp timestamp = Timestamp.newBuilder().setSeconds(millis / 1000) - # .setNanos((int) ((millis % 1000) * 1000000)).build(); - # - # Example 5: Compute Timestamp from Java `Instant.now()`. - # - # Instant now = Instant.now(); - # - # Timestamp timestamp = - # Timestamp.newBuilder().setSeconds(now.getEpochSecond()) - # .setNanos(now.getNano()).build(); - # - # Example 6: Compute Timestamp from current time in Python. - # - # timestamp = Timestamp() - # timestamp.GetCurrentTime() - # - # # JSON Mapping - # - # In JSON format, the Timestamp type is encoded as a string in the - # [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format. That is, the - # format is "\\{year}-\\{month}-\\{day}T\\{hour}:\\{min}:\\{sec}[.\\{frac_sec}]Z" - # where \\{year} is always expressed using four digits while \\{month}, \\{day}, - # \\{hour}, \\{min}, and \\{sec} are zero-padded to two digits each. The fractional - # seconds, which can go up to 9 digits (i.e. up to 1 nanosecond resolution), - # are optional. The "Z" suffix indicates the timezone ("UTC"); the timezone - # is required. A proto3 JSON serializer should always use UTC (as indicated by - # "Z") when printing the Timestamp type and a proto3 JSON parser should be - # able to accept both UTC and other timezones (as indicated by an offset). - # - # For example, "2017-01-15T01:30:15.01Z" encodes 15.01 seconds past - # 01:30 UTC on January 15, 2017. - # - # In JavaScript, one can convert a Date object to this format using the - # standard - # [toISOString()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toISOString) - # method. In Python, a standard `datetime.datetime` object can be converted - # to this format using - # [`strftime`](https://docs.python.org/2/library/time.html#time.strftime) with - # the time format spec '%Y-%m-%dT%H:%M:%S.%fZ'. Likewise, in Java, one can use - # the Joda Time's [`ISODateTimeFormat.dateTime()`]( - # http://joda-time.sourceforge.net/apidocs/org/joda/time/format/ISODateTimeFormat.html#dateTime() - # ) to obtain a formatter capable of generating timestamps in this format. - # @!attribute [rw] seconds - # @return [::Integer] - # Represents seconds of UTC time since Unix epoch - # 1970-01-01T00:00:00Z. Must be from 0001-01-01T00:00:00Z to - # 9999-12-31T23:59:59Z inclusive. - # @!attribute [rw] nanos - # @return [::Integer] - # Non-negative fractions of a second at nanosecond resolution. Negative - # second values with fractions must still have non-negative nanos values - # that count forward in time. Must be from 0 to 999,999,999 - # inclusive. - class Timestamp - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - end -end diff --git a/owl-bot-staging/google-cloud-saas_platform-saas_service_mgmt-v1beta1/snippets/Gemfile b/owl-bot-staging/google-cloud-saas_platform-saas_service_mgmt-v1beta1/snippets/Gemfile deleted file mode 100644 index 90ed07065127..000000000000 --- a/owl-bot-staging/google-cloud-saas_platform-saas_service_mgmt-v1beta1/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-saas_platform-saas_service_mgmt-v1beta1", path: "../" -else - gem "google-cloud-saas_platform-saas_service_mgmt-v1beta1" -end - -group :test do - gem "google-style", "~> 1.26.1" - gem "minitest", "~> 5.16" - gem "minitest-focus", "~> 1.1" - gem "minitest-hooks", "~> 1.5" -end diff --git a/owl-bot-staging/google-cloud-saas_platform-saas_service_mgmt-v1beta1/snippets/saas_deployments/create_release.rb b/owl-bot-staging/google-cloud-saas_platform-saas_service_mgmt-v1beta1/snippets/saas_deployments/create_release.rb deleted file mode 100644 index 671b415bccaf..000000000000 --- a/owl-bot-staging/google-cloud-saas_platform-saas_service_mgmt-v1beta1/snippets/saas_deployments/create_release.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 saasservicemgmt_v1beta1_generated_SaasDeployments_CreateRelease_sync] -require "google/cloud/saas_platform/saas_service_mgmt/v1beta1" - -## -# Snippet for the create_release call in the SaasDeployments service -# -# This snippet has been automatically generated and should be regarded as a code -# template only. It will require modifications to work: -# - It may require correct/in-range values for request initialization. -# - It may require specifying regional endpoints when creating the service -# client as shown in https://cloud.google.com/ruby/docs/reference. -# -# This is an auto-generated example demonstrating basic usage of -# Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::SaasDeployments::Client#create_release. -# -def create_release - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::SaasDeployments::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::CreateReleaseRequest.new - - # Call the create_release method. - result = client.create_release request - - # The returned object is of type Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::Release. - p result -end -# [END saasservicemgmt_v1beta1_generated_SaasDeployments_CreateRelease_sync] diff --git a/owl-bot-staging/google-cloud-saas_platform-saas_service_mgmt-v1beta1/snippets/saas_deployments/create_saas.rb b/owl-bot-staging/google-cloud-saas_platform-saas_service_mgmt-v1beta1/snippets/saas_deployments/create_saas.rb deleted file mode 100644 index 02fe4e5f79a9..000000000000 --- a/owl-bot-staging/google-cloud-saas_platform-saas_service_mgmt-v1beta1/snippets/saas_deployments/create_saas.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 saasservicemgmt_v1beta1_generated_SaasDeployments_CreateSaas_sync] -require "google/cloud/saas_platform/saas_service_mgmt/v1beta1" - -## -# Snippet for the create_saas call in the SaasDeployments service -# -# This snippet has been automatically generated and should be regarded as a code -# template only. It will require modifications to work: -# - It may require correct/in-range values for request initialization. -# - It may require specifying regional endpoints when creating the service -# client as shown in https://cloud.google.com/ruby/docs/reference. -# -# This is an auto-generated example demonstrating basic usage of -# Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::SaasDeployments::Client#create_saas. -# -def create_saas - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::SaasDeployments::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::CreateSaasRequest.new - - # Call the create_saas method. - result = client.create_saas request - - # The returned object is of type Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::Saas. - p result -end -# [END saasservicemgmt_v1beta1_generated_SaasDeployments_CreateSaas_sync] diff --git a/owl-bot-staging/google-cloud-saas_platform-saas_service_mgmt-v1beta1/snippets/saas_deployments/create_tenant.rb b/owl-bot-staging/google-cloud-saas_platform-saas_service_mgmt-v1beta1/snippets/saas_deployments/create_tenant.rb deleted file mode 100644 index 29430bc889e1..000000000000 --- a/owl-bot-staging/google-cloud-saas_platform-saas_service_mgmt-v1beta1/snippets/saas_deployments/create_tenant.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 saasservicemgmt_v1beta1_generated_SaasDeployments_CreateTenant_sync] -require "google/cloud/saas_platform/saas_service_mgmt/v1beta1" - -## -# Snippet for the create_tenant call in the SaasDeployments service -# -# This snippet has been automatically generated and should be regarded as a code -# template only. It will require modifications to work: -# - It may require correct/in-range values for request initialization. -# - It may require specifying regional endpoints when creating the service -# client as shown in https://cloud.google.com/ruby/docs/reference. -# -# This is an auto-generated example demonstrating basic usage of -# Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::SaasDeployments::Client#create_tenant. -# -def create_tenant - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::SaasDeployments::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::CreateTenantRequest.new - - # Call the create_tenant method. - result = client.create_tenant request - - # The returned object is of type Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::Tenant. - p result -end -# [END saasservicemgmt_v1beta1_generated_SaasDeployments_CreateTenant_sync] diff --git a/owl-bot-staging/google-cloud-saas_platform-saas_service_mgmt-v1beta1/snippets/saas_deployments/create_unit.rb b/owl-bot-staging/google-cloud-saas_platform-saas_service_mgmt-v1beta1/snippets/saas_deployments/create_unit.rb deleted file mode 100644 index 8405bbd51ea4..000000000000 --- a/owl-bot-staging/google-cloud-saas_platform-saas_service_mgmt-v1beta1/snippets/saas_deployments/create_unit.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 saasservicemgmt_v1beta1_generated_SaasDeployments_CreateUnit_sync] -require "google/cloud/saas_platform/saas_service_mgmt/v1beta1" - -## -# Snippet for the create_unit call in the SaasDeployments service -# -# This snippet has been automatically generated and should be regarded as a code -# template only. It will require modifications to work: -# - It may require correct/in-range values for request initialization. -# - It may require specifying regional endpoints when creating the service -# client as shown in https://cloud.google.com/ruby/docs/reference. -# -# This is an auto-generated example demonstrating basic usage of -# Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::SaasDeployments::Client#create_unit. -# -def create_unit - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::SaasDeployments::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::CreateUnitRequest.new - - # Call the create_unit method. - result = client.create_unit request - - # The returned object is of type Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::Unit. - p result -end -# [END saasservicemgmt_v1beta1_generated_SaasDeployments_CreateUnit_sync] diff --git a/owl-bot-staging/google-cloud-saas_platform-saas_service_mgmt-v1beta1/snippets/saas_deployments/create_unit_kind.rb b/owl-bot-staging/google-cloud-saas_platform-saas_service_mgmt-v1beta1/snippets/saas_deployments/create_unit_kind.rb deleted file mode 100644 index 7ac9b6a85477..000000000000 --- a/owl-bot-staging/google-cloud-saas_platform-saas_service_mgmt-v1beta1/snippets/saas_deployments/create_unit_kind.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 saasservicemgmt_v1beta1_generated_SaasDeployments_CreateUnitKind_sync] -require "google/cloud/saas_platform/saas_service_mgmt/v1beta1" - -## -# Snippet for the create_unit_kind call in the SaasDeployments service -# -# This snippet has been automatically generated and should be regarded as a code -# template only. It will require modifications to work: -# - It may require correct/in-range values for request initialization. -# - It may require specifying regional endpoints when creating the service -# client as shown in https://cloud.google.com/ruby/docs/reference. -# -# This is an auto-generated example demonstrating basic usage of -# Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::SaasDeployments::Client#create_unit_kind. -# -def create_unit_kind - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::SaasDeployments::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::CreateUnitKindRequest.new - - # Call the create_unit_kind method. - result = client.create_unit_kind request - - # The returned object is of type Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::UnitKind. - p result -end -# [END saasservicemgmt_v1beta1_generated_SaasDeployments_CreateUnitKind_sync] diff --git a/owl-bot-staging/google-cloud-saas_platform-saas_service_mgmt-v1beta1/snippets/saas_deployments/create_unit_operation.rb b/owl-bot-staging/google-cloud-saas_platform-saas_service_mgmt-v1beta1/snippets/saas_deployments/create_unit_operation.rb deleted file mode 100644 index 1a57192d0804..000000000000 --- a/owl-bot-staging/google-cloud-saas_platform-saas_service_mgmt-v1beta1/snippets/saas_deployments/create_unit_operation.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 saasservicemgmt_v1beta1_generated_SaasDeployments_CreateUnitOperation_sync] -require "google/cloud/saas_platform/saas_service_mgmt/v1beta1" - -## -# Snippet for the create_unit_operation call in the SaasDeployments service -# -# This snippet has been automatically generated and should be regarded as a code -# template only. It will require modifications to work: -# - It may require correct/in-range values for request initialization. -# - It may require specifying regional endpoints when creating the service -# client as shown in https://cloud.google.com/ruby/docs/reference. -# -# This is an auto-generated example demonstrating basic usage of -# Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::SaasDeployments::Client#create_unit_operation. -# -def create_unit_operation - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::SaasDeployments::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::CreateUnitOperationRequest.new - - # Call the create_unit_operation method. - result = client.create_unit_operation request - - # The returned object is of type Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::UnitOperation. - p result -end -# [END saasservicemgmt_v1beta1_generated_SaasDeployments_CreateUnitOperation_sync] diff --git a/owl-bot-staging/google-cloud-saas_platform-saas_service_mgmt-v1beta1/snippets/saas_deployments/delete_release.rb b/owl-bot-staging/google-cloud-saas_platform-saas_service_mgmt-v1beta1/snippets/saas_deployments/delete_release.rb deleted file mode 100644 index 4b085d53871c..000000000000 --- a/owl-bot-staging/google-cloud-saas_platform-saas_service_mgmt-v1beta1/snippets/saas_deployments/delete_release.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 saasservicemgmt_v1beta1_generated_SaasDeployments_DeleteRelease_sync] -require "google/cloud/saas_platform/saas_service_mgmt/v1beta1" - -## -# Snippet for the delete_release call in the SaasDeployments service -# -# This snippet has been automatically generated and should be regarded as a code -# template only. It will require modifications to work: -# - It may require correct/in-range values for request initialization. -# - It may require specifying regional endpoints when creating the service -# client as shown in https://cloud.google.com/ruby/docs/reference. -# -# This is an auto-generated example demonstrating basic usage of -# Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::SaasDeployments::Client#delete_release. -# -def delete_release - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::SaasDeployments::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::DeleteReleaseRequest.new - - # Call the delete_release method. - result = client.delete_release request - - # The returned object is of type Google::Protobuf::Empty. - p result -end -# [END saasservicemgmt_v1beta1_generated_SaasDeployments_DeleteRelease_sync] diff --git a/owl-bot-staging/google-cloud-saas_platform-saas_service_mgmt-v1beta1/snippets/saas_deployments/delete_saas.rb b/owl-bot-staging/google-cloud-saas_platform-saas_service_mgmt-v1beta1/snippets/saas_deployments/delete_saas.rb deleted file mode 100644 index 287b20fdd8de..000000000000 --- a/owl-bot-staging/google-cloud-saas_platform-saas_service_mgmt-v1beta1/snippets/saas_deployments/delete_saas.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 saasservicemgmt_v1beta1_generated_SaasDeployments_DeleteSaas_sync] -require "google/cloud/saas_platform/saas_service_mgmt/v1beta1" - -## -# Snippet for the delete_saas call in the SaasDeployments service -# -# This snippet has been automatically generated and should be regarded as a code -# template only. It will require modifications to work: -# - It may require correct/in-range values for request initialization. -# - It may require specifying regional endpoints when creating the service -# client as shown in https://cloud.google.com/ruby/docs/reference. -# -# This is an auto-generated example demonstrating basic usage of -# Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::SaasDeployments::Client#delete_saas. -# -def delete_saas - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::SaasDeployments::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::DeleteSaasRequest.new - - # Call the delete_saas method. - result = client.delete_saas request - - # The returned object is of type Google::Protobuf::Empty. - p result -end -# [END saasservicemgmt_v1beta1_generated_SaasDeployments_DeleteSaas_sync] diff --git a/owl-bot-staging/google-cloud-saas_platform-saas_service_mgmt-v1beta1/snippets/saas_deployments/delete_tenant.rb b/owl-bot-staging/google-cloud-saas_platform-saas_service_mgmt-v1beta1/snippets/saas_deployments/delete_tenant.rb deleted file mode 100644 index ff3f88c333bb..000000000000 --- a/owl-bot-staging/google-cloud-saas_platform-saas_service_mgmt-v1beta1/snippets/saas_deployments/delete_tenant.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 saasservicemgmt_v1beta1_generated_SaasDeployments_DeleteTenant_sync] -require "google/cloud/saas_platform/saas_service_mgmt/v1beta1" - -## -# Snippet for the delete_tenant call in the SaasDeployments service -# -# This snippet has been automatically generated and should be regarded as a code -# template only. It will require modifications to work: -# - It may require correct/in-range values for request initialization. -# - It may require specifying regional endpoints when creating the service -# client as shown in https://cloud.google.com/ruby/docs/reference. -# -# This is an auto-generated example demonstrating basic usage of -# Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::SaasDeployments::Client#delete_tenant. -# -def delete_tenant - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::SaasDeployments::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::DeleteTenantRequest.new - - # Call the delete_tenant method. - result = client.delete_tenant request - - # The returned object is of type Google::Protobuf::Empty. - p result -end -# [END saasservicemgmt_v1beta1_generated_SaasDeployments_DeleteTenant_sync] diff --git a/owl-bot-staging/google-cloud-saas_platform-saas_service_mgmt-v1beta1/snippets/saas_deployments/delete_unit.rb b/owl-bot-staging/google-cloud-saas_platform-saas_service_mgmt-v1beta1/snippets/saas_deployments/delete_unit.rb deleted file mode 100644 index f6f2d7f2d174..000000000000 --- a/owl-bot-staging/google-cloud-saas_platform-saas_service_mgmt-v1beta1/snippets/saas_deployments/delete_unit.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 saasservicemgmt_v1beta1_generated_SaasDeployments_DeleteUnit_sync] -require "google/cloud/saas_platform/saas_service_mgmt/v1beta1" - -## -# Snippet for the delete_unit call in the SaasDeployments service -# -# This snippet has been automatically generated and should be regarded as a code -# template only. It will require modifications to work: -# - It may require correct/in-range values for request initialization. -# - It may require specifying regional endpoints when creating the service -# client as shown in https://cloud.google.com/ruby/docs/reference. -# -# This is an auto-generated example demonstrating basic usage of -# Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::SaasDeployments::Client#delete_unit. -# -def delete_unit - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::SaasDeployments::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::DeleteUnitRequest.new - - # Call the delete_unit method. - result = client.delete_unit request - - # The returned object is of type Google::Protobuf::Empty. - p result -end -# [END saasservicemgmt_v1beta1_generated_SaasDeployments_DeleteUnit_sync] diff --git a/owl-bot-staging/google-cloud-saas_platform-saas_service_mgmt-v1beta1/snippets/saas_deployments/delete_unit_kind.rb b/owl-bot-staging/google-cloud-saas_platform-saas_service_mgmt-v1beta1/snippets/saas_deployments/delete_unit_kind.rb deleted file mode 100644 index 464fd58d299d..000000000000 --- a/owl-bot-staging/google-cloud-saas_platform-saas_service_mgmt-v1beta1/snippets/saas_deployments/delete_unit_kind.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 saasservicemgmt_v1beta1_generated_SaasDeployments_DeleteUnitKind_sync] -require "google/cloud/saas_platform/saas_service_mgmt/v1beta1" - -## -# Snippet for the delete_unit_kind call in the SaasDeployments service -# -# This snippet has been automatically generated and should be regarded as a code -# template only. It will require modifications to work: -# - It may require correct/in-range values for request initialization. -# - It may require specifying regional endpoints when creating the service -# client as shown in https://cloud.google.com/ruby/docs/reference. -# -# This is an auto-generated example demonstrating basic usage of -# Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::SaasDeployments::Client#delete_unit_kind. -# -def delete_unit_kind - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::SaasDeployments::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::DeleteUnitKindRequest.new - - # Call the delete_unit_kind method. - result = client.delete_unit_kind request - - # The returned object is of type Google::Protobuf::Empty. - p result -end -# [END saasservicemgmt_v1beta1_generated_SaasDeployments_DeleteUnitKind_sync] diff --git a/owl-bot-staging/google-cloud-saas_platform-saas_service_mgmt-v1beta1/snippets/saas_deployments/delete_unit_operation.rb b/owl-bot-staging/google-cloud-saas_platform-saas_service_mgmt-v1beta1/snippets/saas_deployments/delete_unit_operation.rb deleted file mode 100644 index 3cebe280b187..000000000000 --- a/owl-bot-staging/google-cloud-saas_platform-saas_service_mgmt-v1beta1/snippets/saas_deployments/delete_unit_operation.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 saasservicemgmt_v1beta1_generated_SaasDeployments_DeleteUnitOperation_sync] -require "google/cloud/saas_platform/saas_service_mgmt/v1beta1" - -## -# Snippet for the delete_unit_operation call in the SaasDeployments service -# -# This snippet has been automatically generated and should be regarded as a code -# template only. It will require modifications to work: -# - It may require correct/in-range values for request initialization. -# - It may require specifying regional endpoints when creating the service -# client as shown in https://cloud.google.com/ruby/docs/reference. -# -# This is an auto-generated example demonstrating basic usage of -# Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::SaasDeployments::Client#delete_unit_operation. -# -def delete_unit_operation - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::SaasDeployments::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::DeleteUnitOperationRequest.new - - # Call the delete_unit_operation method. - result = client.delete_unit_operation request - - # The returned object is of type Google::Protobuf::Empty. - p result -end -# [END saasservicemgmt_v1beta1_generated_SaasDeployments_DeleteUnitOperation_sync] diff --git a/owl-bot-staging/google-cloud-saas_platform-saas_service_mgmt-v1beta1/snippets/saas_deployments/get_release.rb b/owl-bot-staging/google-cloud-saas_platform-saas_service_mgmt-v1beta1/snippets/saas_deployments/get_release.rb deleted file mode 100644 index d5bc5e385302..000000000000 --- a/owl-bot-staging/google-cloud-saas_platform-saas_service_mgmt-v1beta1/snippets/saas_deployments/get_release.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 saasservicemgmt_v1beta1_generated_SaasDeployments_GetRelease_sync] -require "google/cloud/saas_platform/saas_service_mgmt/v1beta1" - -## -# Snippet for the get_release call in the SaasDeployments service -# -# This snippet has been automatically generated and should be regarded as a code -# template only. It will require modifications to work: -# - It may require correct/in-range values for request initialization. -# - It may require specifying regional endpoints when creating the service -# client as shown in https://cloud.google.com/ruby/docs/reference. -# -# This is an auto-generated example demonstrating basic usage of -# Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::SaasDeployments::Client#get_release. -# -def get_release - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::SaasDeployments::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::GetReleaseRequest.new - - # Call the get_release method. - result = client.get_release request - - # The returned object is of type Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::Release. - p result -end -# [END saasservicemgmt_v1beta1_generated_SaasDeployments_GetRelease_sync] diff --git a/owl-bot-staging/google-cloud-saas_platform-saas_service_mgmt-v1beta1/snippets/saas_deployments/get_saas.rb b/owl-bot-staging/google-cloud-saas_platform-saas_service_mgmt-v1beta1/snippets/saas_deployments/get_saas.rb deleted file mode 100644 index 2f6921848e62..000000000000 --- a/owl-bot-staging/google-cloud-saas_platform-saas_service_mgmt-v1beta1/snippets/saas_deployments/get_saas.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 saasservicemgmt_v1beta1_generated_SaasDeployments_GetSaas_sync] -require "google/cloud/saas_platform/saas_service_mgmt/v1beta1" - -## -# Snippet for the get_saas call in the SaasDeployments service -# -# This snippet has been automatically generated and should be regarded as a code -# template only. It will require modifications to work: -# - It may require correct/in-range values for request initialization. -# - It may require specifying regional endpoints when creating the service -# client as shown in https://cloud.google.com/ruby/docs/reference. -# -# This is an auto-generated example demonstrating basic usage of -# Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::SaasDeployments::Client#get_saas. -# -def get_saas - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::SaasDeployments::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::GetSaasRequest.new - - # Call the get_saas method. - result = client.get_saas request - - # The returned object is of type Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::Saas. - p result -end -# [END saasservicemgmt_v1beta1_generated_SaasDeployments_GetSaas_sync] diff --git a/owl-bot-staging/google-cloud-saas_platform-saas_service_mgmt-v1beta1/snippets/saas_deployments/get_tenant.rb b/owl-bot-staging/google-cloud-saas_platform-saas_service_mgmt-v1beta1/snippets/saas_deployments/get_tenant.rb deleted file mode 100644 index e60c8042ce13..000000000000 --- a/owl-bot-staging/google-cloud-saas_platform-saas_service_mgmt-v1beta1/snippets/saas_deployments/get_tenant.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 saasservicemgmt_v1beta1_generated_SaasDeployments_GetTenant_sync] -require "google/cloud/saas_platform/saas_service_mgmt/v1beta1" - -## -# Snippet for the get_tenant call in the SaasDeployments service -# -# This snippet has been automatically generated and should be regarded as a code -# template only. It will require modifications to work: -# - It may require correct/in-range values for request initialization. -# - It may require specifying regional endpoints when creating the service -# client as shown in https://cloud.google.com/ruby/docs/reference. -# -# This is an auto-generated example demonstrating basic usage of -# Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::SaasDeployments::Client#get_tenant. -# -def get_tenant - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::SaasDeployments::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::GetTenantRequest.new - - # Call the get_tenant method. - result = client.get_tenant request - - # The returned object is of type Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::Tenant. - p result -end -# [END saasservicemgmt_v1beta1_generated_SaasDeployments_GetTenant_sync] diff --git a/owl-bot-staging/google-cloud-saas_platform-saas_service_mgmt-v1beta1/snippets/saas_deployments/get_unit.rb b/owl-bot-staging/google-cloud-saas_platform-saas_service_mgmt-v1beta1/snippets/saas_deployments/get_unit.rb deleted file mode 100644 index b539f8b644dc..000000000000 --- a/owl-bot-staging/google-cloud-saas_platform-saas_service_mgmt-v1beta1/snippets/saas_deployments/get_unit.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 saasservicemgmt_v1beta1_generated_SaasDeployments_GetUnit_sync] -require "google/cloud/saas_platform/saas_service_mgmt/v1beta1" - -## -# Snippet for the get_unit call in the SaasDeployments service -# -# This snippet has been automatically generated and should be regarded as a code -# template only. It will require modifications to work: -# - It may require correct/in-range values for request initialization. -# - It may require specifying regional endpoints when creating the service -# client as shown in https://cloud.google.com/ruby/docs/reference. -# -# This is an auto-generated example demonstrating basic usage of -# Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::SaasDeployments::Client#get_unit. -# -def get_unit - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::SaasDeployments::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::GetUnitRequest.new - - # Call the get_unit method. - result = client.get_unit request - - # The returned object is of type Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::Unit. - p result -end -# [END saasservicemgmt_v1beta1_generated_SaasDeployments_GetUnit_sync] diff --git a/owl-bot-staging/google-cloud-saas_platform-saas_service_mgmt-v1beta1/snippets/saas_deployments/get_unit_kind.rb b/owl-bot-staging/google-cloud-saas_platform-saas_service_mgmt-v1beta1/snippets/saas_deployments/get_unit_kind.rb deleted file mode 100644 index 82f5ce85888b..000000000000 --- a/owl-bot-staging/google-cloud-saas_platform-saas_service_mgmt-v1beta1/snippets/saas_deployments/get_unit_kind.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 saasservicemgmt_v1beta1_generated_SaasDeployments_GetUnitKind_sync] -require "google/cloud/saas_platform/saas_service_mgmt/v1beta1" - -## -# Snippet for the get_unit_kind call in the SaasDeployments service -# -# This snippet has been automatically generated and should be regarded as a code -# template only. It will require modifications to work: -# - It may require correct/in-range values for request initialization. -# - It may require specifying regional endpoints when creating the service -# client as shown in https://cloud.google.com/ruby/docs/reference. -# -# This is an auto-generated example demonstrating basic usage of -# Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::SaasDeployments::Client#get_unit_kind. -# -def get_unit_kind - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::SaasDeployments::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::GetUnitKindRequest.new - - # Call the get_unit_kind method. - result = client.get_unit_kind request - - # The returned object is of type Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::UnitKind. - p result -end -# [END saasservicemgmt_v1beta1_generated_SaasDeployments_GetUnitKind_sync] diff --git a/owl-bot-staging/google-cloud-saas_platform-saas_service_mgmt-v1beta1/snippets/saas_deployments/get_unit_operation.rb b/owl-bot-staging/google-cloud-saas_platform-saas_service_mgmt-v1beta1/snippets/saas_deployments/get_unit_operation.rb deleted file mode 100644 index 6cfaedfe0ca0..000000000000 --- a/owl-bot-staging/google-cloud-saas_platform-saas_service_mgmt-v1beta1/snippets/saas_deployments/get_unit_operation.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 saasservicemgmt_v1beta1_generated_SaasDeployments_GetUnitOperation_sync] -require "google/cloud/saas_platform/saas_service_mgmt/v1beta1" - -## -# Snippet for the get_unit_operation call in the SaasDeployments service -# -# This snippet has been automatically generated and should be regarded as a code -# template only. It will require modifications to work: -# - It may require correct/in-range values for request initialization. -# - It may require specifying regional endpoints when creating the service -# client as shown in https://cloud.google.com/ruby/docs/reference. -# -# This is an auto-generated example demonstrating basic usage of -# Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::SaasDeployments::Client#get_unit_operation. -# -def get_unit_operation - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::SaasDeployments::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::GetUnitOperationRequest.new - - # Call the get_unit_operation method. - result = client.get_unit_operation request - - # The returned object is of type Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::UnitOperation. - p result -end -# [END saasservicemgmt_v1beta1_generated_SaasDeployments_GetUnitOperation_sync] diff --git a/owl-bot-staging/google-cloud-saas_platform-saas_service_mgmt-v1beta1/snippets/saas_deployments/list_releases.rb b/owl-bot-staging/google-cloud-saas_platform-saas_service_mgmt-v1beta1/snippets/saas_deployments/list_releases.rb deleted file mode 100644 index 7e0d486189c4..000000000000 --- a/owl-bot-staging/google-cloud-saas_platform-saas_service_mgmt-v1beta1/snippets/saas_deployments/list_releases.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 saasservicemgmt_v1beta1_generated_SaasDeployments_ListReleases_sync] -require "google/cloud/saas_platform/saas_service_mgmt/v1beta1" - -## -# Snippet for the list_releases call in the SaasDeployments service -# -# This snippet has been automatically generated and should be regarded as a code -# template only. It will require modifications to work: -# - It may require correct/in-range values for request initialization. -# - It may require specifying regional endpoints when creating the service -# client as shown in https://cloud.google.com/ruby/docs/reference. -# -# This is an auto-generated example demonstrating basic usage of -# Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::SaasDeployments::Client#list_releases. -# -def list_releases - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::SaasDeployments::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::ListReleasesRequest.new - - # Call the list_releases method. - result = client.list_releases request - - # The returned object is of type Gapic::PagedEnumerable. You can iterate - # over elements, and API calls will be issued to fetch pages as needed. - result.each do |item| - # Each element is of type ::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::Release. - p item - end -end -# [END saasservicemgmt_v1beta1_generated_SaasDeployments_ListReleases_sync] diff --git a/owl-bot-staging/google-cloud-saas_platform-saas_service_mgmt-v1beta1/snippets/saas_deployments/list_saas.rb b/owl-bot-staging/google-cloud-saas_platform-saas_service_mgmt-v1beta1/snippets/saas_deployments/list_saas.rb deleted file mode 100644 index e329ba8bf277..000000000000 --- a/owl-bot-staging/google-cloud-saas_platform-saas_service_mgmt-v1beta1/snippets/saas_deployments/list_saas.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 saasservicemgmt_v1beta1_generated_SaasDeployments_ListSaas_sync] -require "google/cloud/saas_platform/saas_service_mgmt/v1beta1" - -## -# Snippet for the list_saas call in the SaasDeployments service -# -# This snippet has been automatically generated and should be regarded as a code -# template only. It will require modifications to work: -# - It may require correct/in-range values for request initialization. -# - It may require specifying regional endpoints when creating the service -# client as shown in https://cloud.google.com/ruby/docs/reference. -# -# This is an auto-generated example demonstrating basic usage of -# Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::SaasDeployments::Client#list_saas. -# -def list_saas - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::SaasDeployments::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::ListSaasRequest.new - - # Call the list_saas method. - result = client.list_saas request - - # The returned object is of type Gapic::PagedEnumerable. You can iterate - # over elements, and API calls will be issued to fetch pages as needed. - result.each do |item| - # Each element is of type ::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::Saas. - p item - end -end -# [END saasservicemgmt_v1beta1_generated_SaasDeployments_ListSaas_sync] diff --git a/owl-bot-staging/google-cloud-saas_platform-saas_service_mgmt-v1beta1/snippets/saas_deployments/list_tenants.rb b/owl-bot-staging/google-cloud-saas_platform-saas_service_mgmt-v1beta1/snippets/saas_deployments/list_tenants.rb deleted file mode 100644 index 63aa78449af2..000000000000 --- a/owl-bot-staging/google-cloud-saas_platform-saas_service_mgmt-v1beta1/snippets/saas_deployments/list_tenants.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 saasservicemgmt_v1beta1_generated_SaasDeployments_ListTenants_sync] -require "google/cloud/saas_platform/saas_service_mgmt/v1beta1" - -## -# Snippet for the list_tenants call in the SaasDeployments service -# -# This snippet has been automatically generated and should be regarded as a code -# template only. It will require modifications to work: -# - It may require correct/in-range values for request initialization. -# - It may require specifying regional endpoints when creating the service -# client as shown in https://cloud.google.com/ruby/docs/reference. -# -# This is an auto-generated example demonstrating basic usage of -# Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::SaasDeployments::Client#list_tenants. -# -def list_tenants - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::SaasDeployments::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::ListTenantsRequest.new - - # Call the list_tenants method. - result = client.list_tenants request - - # The returned object is of type Gapic::PagedEnumerable. You can iterate - # over elements, and API calls will be issued to fetch pages as needed. - result.each do |item| - # Each element is of type ::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::Tenant. - p item - end -end -# [END saasservicemgmt_v1beta1_generated_SaasDeployments_ListTenants_sync] diff --git a/owl-bot-staging/google-cloud-saas_platform-saas_service_mgmt-v1beta1/snippets/saas_deployments/list_unit_kinds.rb b/owl-bot-staging/google-cloud-saas_platform-saas_service_mgmt-v1beta1/snippets/saas_deployments/list_unit_kinds.rb deleted file mode 100644 index 853423937a44..000000000000 --- a/owl-bot-staging/google-cloud-saas_platform-saas_service_mgmt-v1beta1/snippets/saas_deployments/list_unit_kinds.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 saasservicemgmt_v1beta1_generated_SaasDeployments_ListUnitKinds_sync] -require "google/cloud/saas_platform/saas_service_mgmt/v1beta1" - -## -# Snippet for the list_unit_kinds call in the SaasDeployments service -# -# This snippet has been automatically generated and should be regarded as a code -# template only. It will require modifications to work: -# - It may require correct/in-range values for request initialization. -# - It may require specifying regional endpoints when creating the service -# client as shown in https://cloud.google.com/ruby/docs/reference. -# -# This is an auto-generated example demonstrating basic usage of -# Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::SaasDeployments::Client#list_unit_kinds. -# -def list_unit_kinds - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::SaasDeployments::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::ListUnitKindsRequest.new - - # Call the list_unit_kinds method. - result = client.list_unit_kinds request - - # The returned object is of type Gapic::PagedEnumerable. You can iterate - # over elements, and API calls will be issued to fetch pages as needed. - result.each do |item| - # Each element is of type ::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::UnitKind. - p item - end -end -# [END saasservicemgmt_v1beta1_generated_SaasDeployments_ListUnitKinds_sync] diff --git a/owl-bot-staging/google-cloud-saas_platform-saas_service_mgmt-v1beta1/snippets/saas_deployments/list_unit_operations.rb b/owl-bot-staging/google-cloud-saas_platform-saas_service_mgmt-v1beta1/snippets/saas_deployments/list_unit_operations.rb deleted file mode 100644 index c1338c41f63b..000000000000 --- a/owl-bot-staging/google-cloud-saas_platform-saas_service_mgmt-v1beta1/snippets/saas_deployments/list_unit_operations.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 saasservicemgmt_v1beta1_generated_SaasDeployments_ListUnitOperations_sync] -require "google/cloud/saas_platform/saas_service_mgmt/v1beta1" - -## -# Snippet for the list_unit_operations call in the SaasDeployments service -# -# This snippet has been automatically generated and should be regarded as a code -# template only. It will require modifications to work: -# - It may require correct/in-range values for request initialization. -# - It may require specifying regional endpoints when creating the service -# client as shown in https://cloud.google.com/ruby/docs/reference. -# -# This is an auto-generated example demonstrating basic usage of -# Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::SaasDeployments::Client#list_unit_operations. -# -def list_unit_operations - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::SaasDeployments::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::ListUnitOperationsRequest.new - - # Call the list_unit_operations method. - result = client.list_unit_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::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::UnitOperation. - p item - end -end -# [END saasservicemgmt_v1beta1_generated_SaasDeployments_ListUnitOperations_sync] diff --git a/owl-bot-staging/google-cloud-saas_platform-saas_service_mgmt-v1beta1/snippets/saas_deployments/list_units.rb b/owl-bot-staging/google-cloud-saas_platform-saas_service_mgmt-v1beta1/snippets/saas_deployments/list_units.rb deleted file mode 100644 index 91dec6bd49e1..000000000000 --- a/owl-bot-staging/google-cloud-saas_platform-saas_service_mgmt-v1beta1/snippets/saas_deployments/list_units.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 saasservicemgmt_v1beta1_generated_SaasDeployments_ListUnits_sync] -require "google/cloud/saas_platform/saas_service_mgmt/v1beta1" - -## -# Snippet for the list_units call in the SaasDeployments service -# -# This snippet has been automatically generated and should be regarded as a code -# template only. It will require modifications to work: -# - It may require correct/in-range values for request initialization. -# - It may require specifying regional endpoints when creating the service -# client as shown in https://cloud.google.com/ruby/docs/reference. -# -# This is an auto-generated example demonstrating basic usage of -# Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::SaasDeployments::Client#list_units. -# -def list_units - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::SaasDeployments::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::ListUnitsRequest.new - - # Call the list_units method. - result = client.list_units request - - # The returned object is of type Gapic::PagedEnumerable. You can iterate - # over elements, and API calls will be issued to fetch pages as needed. - result.each do |item| - # Each element is of type ::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::Unit. - p item - end -end -# [END saasservicemgmt_v1beta1_generated_SaasDeployments_ListUnits_sync] diff --git a/owl-bot-staging/google-cloud-saas_platform-saas_service_mgmt-v1beta1/snippets/saas_deployments/update_release.rb b/owl-bot-staging/google-cloud-saas_platform-saas_service_mgmt-v1beta1/snippets/saas_deployments/update_release.rb deleted file mode 100644 index 9de4514884f5..000000000000 --- a/owl-bot-staging/google-cloud-saas_platform-saas_service_mgmt-v1beta1/snippets/saas_deployments/update_release.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 saasservicemgmt_v1beta1_generated_SaasDeployments_UpdateRelease_sync] -require "google/cloud/saas_platform/saas_service_mgmt/v1beta1" - -## -# Snippet for the update_release call in the SaasDeployments service -# -# This snippet has been automatically generated and should be regarded as a code -# template only. It will require modifications to work: -# - It may require correct/in-range values for request initialization. -# - It may require specifying regional endpoints when creating the service -# client as shown in https://cloud.google.com/ruby/docs/reference. -# -# This is an auto-generated example demonstrating basic usage of -# Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::SaasDeployments::Client#update_release. -# -def update_release - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::SaasDeployments::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::UpdateReleaseRequest.new - - # Call the update_release method. - result = client.update_release request - - # The returned object is of type Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::Release. - p result -end -# [END saasservicemgmt_v1beta1_generated_SaasDeployments_UpdateRelease_sync] diff --git a/owl-bot-staging/google-cloud-saas_platform-saas_service_mgmt-v1beta1/snippets/saas_deployments/update_saas.rb b/owl-bot-staging/google-cloud-saas_platform-saas_service_mgmt-v1beta1/snippets/saas_deployments/update_saas.rb deleted file mode 100644 index 5701d900ad11..000000000000 --- a/owl-bot-staging/google-cloud-saas_platform-saas_service_mgmt-v1beta1/snippets/saas_deployments/update_saas.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 saasservicemgmt_v1beta1_generated_SaasDeployments_UpdateSaas_sync] -require "google/cloud/saas_platform/saas_service_mgmt/v1beta1" - -## -# Snippet for the update_saas call in the SaasDeployments service -# -# This snippet has been automatically generated and should be regarded as a code -# template only. It will require modifications to work: -# - It may require correct/in-range values for request initialization. -# - It may require specifying regional endpoints when creating the service -# client as shown in https://cloud.google.com/ruby/docs/reference. -# -# This is an auto-generated example demonstrating basic usage of -# Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::SaasDeployments::Client#update_saas. -# -def update_saas - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::SaasDeployments::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::UpdateSaasRequest.new - - # Call the update_saas method. - result = client.update_saas request - - # The returned object is of type Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::Saas. - p result -end -# [END saasservicemgmt_v1beta1_generated_SaasDeployments_UpdateSaas_sync] diff --git a/owl-bot-staging/google-cloud-saas_platform-saas_service_mgmt-v1beta1/snippets/saas_deployments/update_tenant.rb b/owl-bot-staging/google-cloud-saas_platform-saas_service_mgmt-v1beta1/snippets/saas_deployments/update_tenant.rb deleted file mode 100644 index 5a9daf469f69..000000000000 --- a/owl-bot-staging/google-cloud-saas_platform-saas_service_mgmt-v1beta1/snippets/saas_deployments/update_tenant.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 saasservicemgmt_v1beta1_generated_SaasDeployments_UpdateTenant_sync] -require "google/cloud/saas_platform/saas_service_mgmt/v1beta1" - -## -# Snippet for the update_tenant call in the SaasDeployments service -# -# This snippet has been automatically generated and should be regarded as a code -# template only. It will require modifications to work: -# - It may require correct/in-range values for request initialization. -# - It may require specifying regional endpoints when creating the service -# client as shown in https://cloud.google.com/ruby/docs/reference. -# -# This is an auto-generated example demonstrating basic usage of -# Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::SaasDeployments::Client#update_tenant. -# -def update_tenant - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::SaasDeployments::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::UpdateTenantRequest.new - - # Call the update_tenant method. - result = client.update_tenant request - - # The returned object is of type Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::Tenant. - p result -end -# [END saasservicemgmt_v1beta1_generated_SaasDeployments_UpdateTenant_sync] diff --git a/owl-bot-staging/google-cloud-saas_platform-saas_service_mgmt-v1beta1/snippets/saas_deployments/update_unit.rb b/owl-bot-staging/google-cloud-saas_platform-saas_service_mgmt-v1beta1/snippets/saas_deployments/update_unit.rb deleted file mode 100644 index f0ea79580356..000000000000 --- a/owl-bot-staging/google-cloud-saas_platform-saas_service_mgmt-v1beta1/snippets/saas_deployments/update_unit.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 saasservicemgmt_v1beta1_generated_SaasDeployments_UpdateUnit_sync] -require "google/cloud/saas_platform/saas_service_mgmt/v1beta1" - -## -# Snippet for the update_unit call in the SaasDeployments service -# -# This snippet has been automatically generated and should be regarded as a code -# template only. It will require modifications to work: -# - It may require correct/in-range values for request initialization. -# - It may require specifying regional endpoints when creating the service -# client as shown in https://cloud.google.com/ruby/docs/reference. -# -# This is an auto-generated example demonstrating basic usage of -# Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::SaasDeployments::Client#update_unit. -# -def update_unit - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::SaasDeployments::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::UpdateUnitRequest.new - - # Call the update_unit method. - result = client.update_unit request - - # The returned object is of type Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::Unit. - p result -end -# [END saasservicemgmt_v1beta1_generated_SaasDeployments_UpdateUnit_sync] diff --git a/owl-bot-staging/google-cloud-saas_platform-saas_service_mgmt-v1beta1/snippets/saas_deployments/update_unit_kind.rb b/owl-bot-staging/google-cloud-saas_platform-saas_service_mgmt-v1beta1/snippets/saas_deployments/update_unit_kind.rb deleted file mode 100644 index c5f670d063c8..000000000000 --- a/owl-bot-staging/google-cloud-saas_platform-saas_service_mgmt-v1beta1/snippets/saas_deployments/update_unit_kind.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 saasservicemgmt_v1beta1_generated_SaasDeployments_UpdateUnitKind_sync] -require "google/cloud/saas_platform/saas_service_mgmt/v1beta1" - -## -# Snippet for the update_unit_kind call in the SaasDeployments service -# -# This snippet has been automatically generated and should be regarded as a code -# template only. It will require modifications to work: -# - It may require correct/in-range values for request initialization. -# - It may require specifying regional endpoints when creating the service -# client as shown in https://cloud.google.com/ruby/docs/reference. -# -# This is an auto-generated example demonstrating basic usage of -# Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::SaasDeployments::Client#update_unit_kind. -# -def update_unit_kind - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::SaasDeployments::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::UpdateUnitKindRequest.new - - # Call the update_unit_kind method. - result = client.update_unit_kind request - - # The returned object is of type Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::UnitKind. - p result -end -# [END saasservicemgmt_v1beta1_generated_SaasDeployments_UpdateUnitKind_sync] diff --git a/owl-bot-staging/google-cloud-saas_platform-saas_service_mgmt-v1beta1/snippets/saas_deployments/update_unit_operation.rb b/owl-bot-staging/google-cloud-saas_platform-saas_service_mgmt-v1beta1/snippets/saas_deployments/update_unit_operation.rb deleted file mode 100644 index 45e4839655fe..000000000000 --- a/owl-bot-staging/google-cloud-saas_platform-saas_service_mgmt-v1beta1/snippets/saas_deployments/update_unit_operation.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 saasservicemgmt_v1beta1_generated_SaasDeployments_UpdateUnitOperation_sync] -require "google/cloud/saas_platform/saas_service_mgmt/v1beta1" - -## -# Snippet for the update_unit_operation call in the SaasDeployments service -# -# This snippet has been automatically generated and should be regarded as a code -# template only. It will require modifications to work: -# - It may require correct/in-range values for request initialization. -# - It may require specifying regional endpoints when creating the service -# client as shown in https://cloud.google.com/ruby/docs/reference. -# -# This is an auto-generated example demonstrating basic usage of -# Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::SaasDeployments::Client#update_unit_operation. -# -def update_unit_operation - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::SaasDeployments::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::UpdateUnitOperationRequest.new - - # Call the update_unit_operation method. - result = client.update_unit_operation request - - # The returned object is of type Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::UnitOperation. - p result -end -# [END saasservicemgmt_v1beta1_generated_SaasDeployments_UpdateUnitOperation_sync] diff --git a/owl-bot-staging/google-cloud-saas_platform-saas_service_mgmt-v1beta1/snippets/saas_rollouts/create_rollout.rb b/owl-bot-staging/google-cloud-saas_platform-saas_service_mgmt-v1beta1/snippets/saas_rollouts/create_rollout.rb deleted file mode 100644 index ca268c23b8e5..000000000000 --- a/owl-bot-staging/google-cloud-saas_platform-saas_service_mgmt-v1beta1/snippets/saas_rollouts/create_rollout.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 saasservicemgmt_v1beta1_generated_SaasRollouts_CreateRollout_sync] -require "google/cloud/saas_platform/saas_service_mgmt/v1beta1" - -## -# Snippet for the create_rollout call in the SaasRollouts service -# -# This snippet has been automatically generated and should be regarded as a code -# template only. It will require modifications to work: -# - It may require correct/in-range values for request initialization. -# - It may require specifying regional endpoints when creating the service -# client as shown in https://cloud.google.com/ruby/docs/reference. -# -# This is an auto-generated example demonstrating basic usage of -# Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::SaasRollouts::Client#create_rollout. -# -def create_rollout - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::SaasRollouts::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::CreateRolloutRequest.new - - # Call the create_rollout method. - result = client.create_rollout request - - # The returned object is of type Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::Rollout. - p result -end -# [END saasservicemgmt_v1beta1_generated_SaasRollouts_CreateRollout_sync] diff --git a/owl-bot-staging/google-cloud-saas_platform-saas_service_mgmt-v1beta1/snippets/saas_rollouts/create_rollout_kind.rb b/owl-bot-staging/google-cloud-saas_platform-saas_service_mgmt-v1beta1/snippets/saas_rollouts/create_rollout_kind.rb deleted file mode 100644 index b2eff129e8aa..000000000000 --- a/owl-bot-staging/google-cloud-saas_platform-saas_service_mgmt-v1beta1/snippets/saas_rollouts/create_rollout_kind.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 saasservicemgmt_v1beta1_generated_SaasRollouts_CreateRolloutKind_sync] -require "google/cloud/saas_platform/saas_service_mgmt/v1beta1" - -## -# Snippet for the create_rollout_kind call in the SaasRollouts service -# -# This snippet has been automatically generated and should be regarded as a code -# template only. It will require modifications to work: -# - It may require correct/in-range values for request initialization. -# - It may require specifying regional endpoints when creating the service -# client as shown in https://cloud.google.com/ruby/docs/reference. -# -# This is an auto-generated example demonstrating basic usage of -# Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::SaasRollouts::Client#create_rollout_kind. -# -def create_rollout_kind - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::SaasRollouts::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::CreateRolloutKindRequest.new - - # Call the create_rollout_kind method. - result = client.create_rollout_kind request - - # The returned object is of type Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::RolloutKind. - p result -end -# [END saasservicemgmt_v1beta1_generated_SaasRollouts_CreateRolloutKind_sync] diff --git a/owl-bot-staging/google-cloud-saas_platform-saas_service_mgmt-v1beta1/snippets/saas_rollouts/delete_rollout.rb b/owl-bot-staging/google-cloud-saas_platform-saas_service_mgmt-v1beta1/snippets/saas_rollouts/delete_rollout.rb deleted file mode 100644 index 3635f31da3c8..000000000000 --- a/owl-bot-staging/google-cloud-saas_platform-saas_service_mgmt-v1beta1/snippets/saas_rollouts/delete_rollout.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 saasservicemgmt_v1beta1_generated_SaasRollouts_DeleteRollout_sync] -require "google/cloud/saas_platform/saas_service_mgmt/v1beta1" - -## -# Snippet for the delete_rollout call in the SaasRollouts service -# -# This snippet has been automatically generated and should be regarded as a code -# template only. It will require modifications to work: -# - It may require correct/in-range values for request initialization. -# - It may require specifying regional endpoints when creating the service -# client as shown in https://cloud.google.com/ruby/docs/reference. -# -# This is an auto-generated example demonstrating basic usage of -# Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::SaasRollouts::Client#delete_rollout. -# -def delete_rollout - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::SaasRollouts::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::DeleteRolloutRequest.new - - # Call the delete_rollout method. - result = client.delete_rollout request - - # The returned object is of type Google::Protobuf::Empty. - p result -end -# [END saasservicemgmt_v1beta1_generated_SaasRollouts_DeleteRollout_sync] diff --git a/owl-bot-staging/google-cloud-saas_platform-saas_service_mgmt-v1beta1/snippets/saas_rollouts/delete_rollout_kind.rb b/owl-bot-staging/google-cloud-saas_platform-saas_service_mgmt-v1beta1/snippets/saas_rollouts/delete_rollout_kind.rb deleted file mode 100644 index 85b390cdb835..000000000000 --- a/owl-bot-staging/google-cloud-saas_platform-saas_service_mgmt-v1beta1/snippets/saas_rollouts/delete_rollout_kind.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 saasservicemgmt_v1beta1_generated_SaasRollouts_DeleteRolloutKind_sync] -require "google/cloud/saas_platform/saas_service_mgmt/v1beta1" - -## -# Snippet for the delete_rollout_kind call in the SaasRollouts service -# -# This snippet has been automatically generated and should be regarded as a code -# template only. It will require modifications to work: -# - It may require correct/in-range values for request initialization. -# - It may require specifying regional endpoints when creating the service -# client as shown in https://cloud.google.com/ruby/docs/reference. -# -# This is an auto-generated example demonstrating basic usage of -# Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::SaasRollouts::Client#delete_rollout_kind. -# -def delete_rollout_kind - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::SaasRollouts::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::DeleteRolloutKindRequest.new - - # Call the delete_rollout_kind method. - result = client.delete_rollout_kind request - - # The returned object is of type Google::Protobuf::Empty. - p result -end -# [END saasservicemgmt_v1beta1_generated_SaasRollouts_DeleteRolloutKind_sync] diff --git a/owl-bot-staging/google-cloud-saas_platform-saas_service_mgmt-v1beta1/snippets/saas_rollouts/get_rollout.rb b/owl-bot-staging/google-cloud-saas_platform-saas_service_mgmt-v1beta1/snippets/saas_rollouts/get_rollout.rb deleted file mode 100644 index a753725a1396..000000000000 --- a/owl-bot-staging/google-cloud-saas_platform-saas_service_mgmt-v1beta1/snippets/saas_rollouts/get_rollout.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 saasservicemgmt_v1beta1_generated_SaasRollouts_GetRollout_sync] -require "google/cloud/saas_platform/saas_service_mgmt/v1beta1" - -## -# Snippet for the get_rollout call in the SaasRollouts service -# -# This snippet has been automatically generated and should be regarded as a code -# template only. It will require modifications to work: -# - It may require correct/in-range values for request initialization. -# - It may require specifying regional endpoints when creating the service -# client as shown in https://cloud.google.com/ruby/docs/reference. -# -# This is an auto-generated example demonstrating basic usage of -# Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::SaasRollouts::Client#get_rollout. -# -def get_rollout - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::SaasRollouts::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::GetRolloutRequest.new - - # Call the get_rollout method. - result = client.get_rollout request - - # The returned object is of type Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::Rollout. - p result -end -# [END saasservicemgmt_v1beta1_generated_SaasRollouts_GetRollout_sync] diff --git a/owl-bot-staging/google-cloud-saas_platform-saas_service_mgmt-v1beta1/snippets/saas_rollouts/get_rollout_kind.rb b/owl-bot-staging/google-cloud-saas_platform-saas_service_mgmt-v1beta1/snippets/saas_rollouts/get_rollout_kind.rb deleted file mode 100644 index 4bfbd24ee493..000000000000 --- a/owl-bot-staging/google-cloud-saas_platform-saas_service_mgmt-v1beta1/snippets/saas_rollouts/get_rollout_kind.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 saasservicemgmt_v1beta1_generated_SaasRollouts_GetRolloutKind_sync] -require "google/cloud/saas_platform/saas_service_mgmt/v1beta1" - -## -# Snippet for the get_rollout_kind call in the SaasRollouts service -# -# This snippet has been automatically generated and should be regarded as a code -# template only. It will require modifications to work: -# - It may require correct/in-range values for request initialization. -# - It may require specifying regional endpoints when creating the service -# client as shown in https://cloud.google.com/ruby/docs/reference. -# -# This is an auto-generated example demonstrating basic usage of -# Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::SaasRollouts::Client#get_rollout_kind. -# -def get_rollout_kind - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::SaasRollouts::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::GetRolloutKindRequest.new - - # Call the get_rollout_kind method. - result = client.get_rollout_kind request - - # The returned object is of type Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::RolloutKind. - p result -end -# [END saasservicemgmt_v1beta1_generated_SaasRollouts_GetRolloutKind_sync] diff --git a/owl-bot-staging/google-cloud-saas_platform-saas_service_mgmt-v1beta1/snippets/saas_rollouts/list_rollout_kinds.rb b/owl-bot-staging/google-cloud-saas_platform-saas_service_mgmt-v1beta1/snippets/saas_rollouts/list_rollout_kinds.rb deleted file mode 100644 index ae58381bb397..000000000000 --- a/owl-bot-staging/google-cloud-saas_platform-saas_service_mgmt-v1beta1/snippets/saas_rollouts/list_rollout_kinds.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 saasservicemgmt_v1beta1_generated_SaasRollouts_ListRolloutKinds_sync] -require "google/cloud/saas_platform/saas_service_mgmt/v1beta1" - -## -# Snippet for the list_rollout_kinds call in the SaasRollouts service -# -# This snippet has been automatically generated and should be regarded as a code -# template only. It will require modifications to work: -# - It may require correct/in-range values for request initialization. -# - It may require specifying regional endpoints when creating the service -# client as shown in https://cloud.google.com/ruby/docs/reference. -# -# This is an auto-generated example demonstrating basic usage of -# Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::SaasRollouts::Client#list_rollout_kinds. -# -def list_rollout_kinds - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::SaasRollouts::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::ListRolloutKindsRequest.new - - # Call the list_rollout_kinds method. - result = client.list_rollout_kinds request - - # The returned object is of type Gapic::PagedEnumerable. You can iterate - # over elements, and API calls will be issued to fetch pages as needed. - result.each do |item| - # Each element is of type ::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::RolloutKind. - p item - end -end -# [END saasservicemgmt_v1beta1_generated_SaasRollouts_ListRolloutKinds_sync] diff --git a/owl-bot-staging/google-cloud-saas_platform-saas_service_mgmt-v1beta1/snippets/saas_rollouts/list_rollouts.rb b/owl-bot-staging/google-cloud-saas_platform-saas_service_mgmt-v1beta1/snippets/saas_rollouts/list_rollouts.rb deleted file mode 100644 index 4a9d1ea856ee..000000000000 --- a/owl-bot-staging/google-cloud-saas_platform-saas_service_mgmt-v1beta1/snippets/saas_rollouts/list_rollouts.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 saasservicemgmt_v1beta1_generated_SaasRollouts_ListRollouts_sync] -require "google/cloud/saas_platform/saas_service_mgmt/v1beta1" - -## -# Snippet for the list_rollouts call in the SaasRollouts service -# -# This snippet has been automatically generated and should be regarded as a code -# template only. It will require modifications to work: -# - It may require correct/in-range values for request initialization. -# - It may require specifying regional endpoints when creating the service -# client as shown in https://cloud.google.com/ruby/docs/reference. -# -# This is an auto-generated example demonstrating basic usage of -# Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::SaasRollouts::Client#list_rollouts. -# -def list_rollouts - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::SaasRollouts::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::ListRolloutsRequest.new - - # Call the list_rollouts method. - result = client.list_rollouts request - - # The returned object is of type Gapic::PagedEnumerable. You can iterate - # over elements, and API calls will be issued to fetch pages as needed. - result.each do |item| - # Each element is of type ::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::Rollout. - p item - end -end -# [END saasservicemgmt_v1beta1_generated_SaasRollouts_ListRollouts_sync] diff --git a/owl-bot-staging/google-cloud-saas_platform-saas_service_mgmt-v1beta1/snippets/saas_rollouts/update_rollout.rb b/owl-bot-staging/google-cloud-saas_platform-saas_service_mgmt-v1beta1/snippets/saas_rollouts/update_rollout.rb deleted file mode 100644 index fdc3c34c42ae..000000000000 --- a/owl-bot-staging/google-cloud-saas_platform-saas_service_mgmt-v1beta1/snippets/saas_rollouts/update_rollout.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 saasservicemgmt_v1beta1_generated_SaasRollouts_UpdateRollout_sync] -require "google/cloud/saas_platform/saas_service_mgmt/v1beta1" - -## -# Snippet for the update_rollout call in the SaasRollouts service -# -# This snippet has been automatically generated and should be regarded as a code -# template only. It will require modifications to work: -# - It may require correct/in-range values for request initialization. -# - It may require specifying regional endpoints when creating the service -# client as shown in https://cloud.google.com/ruby/docs/reference. -# -# This is an auto-generated example demonstrating basic usage of -# Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::SaasRollouts::Client#update_rollout. -# -def update_rollout - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::SaasRollouts::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::UpdateRolloutRequest.new - - # Call the update_rollout method. - result = client.update_rollout request - - # The returned object is of type Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::Rollout. - p result -end -# [END saasservicemgmt_v1beta1_generated_SaasRollouts_UpdateRollout_sync] diff --git a/owl-bot-staging/google-cloud-saas_platform-saas_service_mgmt-v1beta1/snippets/saas_rollouts/update_rollout_kind.rb b/owl-bot-staging/google-cloud-saas_platform-saas_service_mgmt-v1beta1/snippets/saas_rollouts/update_rollout_kind.rb deleted file mode 100644 index 1343b74ff25c..000000000000 --- a/owl-bot-staging/google-cloud-saas_platform-saas_service_mgmt-v1beta1/snippets/saas_rollouts/update_rollout_kind.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 saasservicemgmt_v1beta1_generated_SaasRollouts_UpdateRolloutKind_sync] -require "google/cloud/saas_platform/saas_service_mgmt/v1beta1" - -## -# Snippet for the update_rollout_kind call in the SaasRollouts service -# -# This snippet has been automatically generated and should be regarded as a code -# template only. It will require modifications to work: -# - It may require correct/in-range values for request initialization. -# - It may require specifying regional endpoints when creating the service -# client as shown in https://cloud.google.com/ruby/docs/reference. -# -# This is an auto-generated example demonstrating basic usage of -# Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::SaasRollouts::Client#update_rollout_kind. -# -def update_rollout_kind - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::SaasRollouts::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::UpdateRolloutKindRequest.new - - # Call the update_rollout_kind method. - result = client.update_rollout_kind request - - # The returned object is of type Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::RolloutKind. - p result -end -# [END saasservicemgmt_v1beta1_generated_SaasRollouts_UpdateRolloutKind_sync] diff --git a/owl-bot-staging/google-cloud-saas_platform-saas_service_mgmt-v1beta1/snippets/snippet_metadata_google.cloud.saasplatform.saasservicemgmt.v1beta1.json b/owl-bot-staging/google-cloud-saas_platform-saas_service_mgmt-v1beta1/snippets/snippet_metadata_google.cloud.saasplatform.saasservicemgmt.v1beta1.json deleted file mode 100644 index 212cb6c72d68..000000000000 --- a/owl-bot-staging/google-cloud-saas_platform-saas_service_mgmt-v1beta1/snippets/snippet_metadata_google.cloud.saasplatform.saasservicemgmt.v1beta1.json +++ /dev/null @@ -1,1615 +0,0 @@ -{ - "client_library": { - "name": "google-cloud-saas_platform-saas_service_mgmt-v1beta1", - "version": "", - "language": "RUBY", - "apis": [ - { - "id": "google.cloud.saasplatform.saasservicemgmt.v1beta1", - "version": "v1beta1" - } - ] - }, - "snippets": [ - { - "region_tag": "saasservicemgmt_v1beta1_generated_SaasDeployments_ListSaas_sync", - "title": "Snippet for the list_saas call in the SaasDeployments service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::SaasDeployments::Client#list_saas.", - "file": "saas_deployments/list_saas.rb", - "language": "RUBY", - "client_method": { - "short_name": "list_saas", - "full_name": "::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::SaasDeployments::Client#list_saas", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::ListSaasRequest", - "name": "request" - } - ], - "result_type": "::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::ListSaasResponse", - "client": { - "short_name": "SaasDeployments::Client", - "full_name": "::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::SaasDeployments::Client" - }, - "method": { - "short_name": "ListSaas", - "full_name": "google.cloud.saasplatform.saasservicemgmt.v1beta1.SaasDeployments.ListSaas", - "service": { - "short_name": "SaasDeployments", - "full_name": "google.cloud.saasplatform.saasservicemgmt.v1beta1.SaasDeployments" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 50, - "type": "FULL" - } - ] - }, - { - "region_tag": "saasservicemgmt_v1beta1_generated_SaasDeployments_GetSaas_sync", - "title": "Snippet for the get_saas call in the SaasDeployments service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::SaasDeployments::Client#get_saas.", - "file": "saas_deployments/get_saas.rb", - "language": "RUBY", - "client_method": { - "short_name": "get_saas", - "full_name": "::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::SaasDeployments::Client#get_saas", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::GetSaasRequest", - "name": "request" - } - ], - "result_type": "::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::Saas", - "client": { - "short_name": "SaasDeployments::Client", - "full_name": "::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::SaasDeployments::Client" - }, - "method": { - "short_name": "GetSaas", - "full_name": "google.cloud.saasplatform.saasservicemgmt.v1beta1.SaasDeployments.GetSaas", - "service": { - "short_name": "SaasDeployments", - "full_name": "google.cloud.saasplatform.saasservicemgmt.v1beta1.SaasDeployments" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 46, - "type": "FULL" - } - ] - }, - { - "region_tag": "saasservicemgmt_v1beta1_generated_SaasDeployments_CreateSaas_sync", - "title": "Snippet for the create_saas call in the SaasDeployments service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::SaasDeployments::Client#create_saas.", - "file": "saas_deployments/create_saas.rb", - "language": "RUBY", - "client_method": { - "short_name": "create_saas", - "full_name": "::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::SaasDeployments::Client#create_saas", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::CreateSaasRequest", - "name": "request" - } - ], - "result_type": "::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::Saas", - "client": { - "short_name": "SaasDeployments::Client", - "full_name": "::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::SaasDeployments::Client" - }, - "method": { - "short_name": "CreateSaas", - "full_name": "google.cloud.saasplatform.saasservicemgmt.v1beta1.SaasDeployments.CreateSaas", - "service": { - "short_name": "SaasDeployments", - "full_name": "google.cloud.saasplatform.saasservicemgmt.v1beta1.SaasDeployments" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 46, - "type": "FULL" - } - ] - }, - { - "region_tag": "saasservicemgmt_v1beta1_generated_SaasDeployments_UpdateSaas_sync", - "title": "Snippet for the update_saas call in the SaasDeployments service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::SaasDeployments::Client#update_saas.", - "file": "saas_deployments/update_saas.rb", - "language": "RUBY", - "client_method": { - "short_name": "update_saas", - "full_name": "::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::SaasDeployments::Client#update_saas", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::UpdateSaasRequest", - "name": "request" - } - ], - "result_type": "::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::Saas", - "client": { - "short_name": "SaasDeployments::Client", - "full_name": "::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::SaasDeployments::Client" - }, - "method": { - "short_name": "UpdateSaas", - "full_name": "google.cloud.saasplatform.saasservicemgmt.v1beta1.SaasDeployments.UpdateSaas", - "service": { - "short_name": "SaasDeployments", - "full_name": "google.cloud.saasplatform.saasservicemgmt.v1beta1.SaasDeployments" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 46, - "type": "FULL" - } - ] - }, - { - "region_tag": "saasservicemgmt_v1beta1_generated_SaasDeployments_DeleteSaas_sync", - "title": "Snippet for the delete_saas call in the SaasDeployments service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::SaasDeployments::Client#delete_saas.", - "file": "saas_deployments/delete_saas.rb", - "language": "RUBY", - "client_method": { - "short_name": "delete_saas", - "full_name": "::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::SaasDeployments::Client#delete_saas", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::DeleteSaasRequest", - "name": "request" - } - ], - "result_type": "::Google::Protobuf::Empty", - "client": { - "short_name": "SaasDeployments::Client", - "full_name": "::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::SaasDeployments::Client" - }, - "method": { - "short_name": "DeleteSaas", - "full_name": "google.cloud.saasplatform.saasservicemgmt.v1beta1.SaasDeployments.DeleteSaas", - "service": { - "short_name": "SaasDeployments", - "full_name": "google.cloud.saasplatform.saasservicemgmt.v1beta1.SaasDeployments" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 46, - "type": "FULL" - } - ] - }, - { - "region_tag": "saasservicemgmt_v1beta1_generated_SaasDeployments_ListTenants_sync", - "title": "Snippet for the list_tenants call in the SaasDeployments service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::SaasDeployments::Client#list_tenants.", - "file": "saas_deployments/list_tenants.rb", - "language": "RUBY", - "client_method": { - "short_name": "list_tenants", - "full_name": "::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::SaasDeployments::Client#list_tenants", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::ListTenantsRequest", - "name": "request" - } - ], - "result_type": "::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::ListTenantsResponse", - "client": { - "short_name": "SaasDeployments::Client", - "full_name": "::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::SaasDeployments::Client" - }, - "method": { - "short_name": "ListTenants", - "full_name": "google.cloud.saasplatform.saasservicemgmt.v1beta1.SaasDeployments.ListTenants", - "service": { - "short_name": "SaasDeployments", - "full_name": "google.cloud.saasplatform.saasservicemgmt.v1beta1.SaasDeployments" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 50, - "type": "FULL" - } - ] - }, - { - "region_tag": "saasservicemgmt_v1beta1_generated_SaasDeployments_GetTenant_sync", - "title": "Snippet for the get_tenant call in the SaasDeployments service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::SaasDeployments::Client#get_tenant.", - "file": "saas_deployments/get_tenant.rb", - "language": "RUBY", - "client_method": { - "short_name": "get_tenant", - "full_name": "::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::SaasDeployments::Client#get_tenant", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::GetTenantRequest", - "name": "request" - } - ], - "result_type": "::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::Tenant", - "client": { - "short_name": "SaasDeployments::Client", - "full_name": "::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::SaasDeployments::Client" - }, - "method": { - "short_name": "GetTenant", - "full_name": "google.cloud.saasplatform.saasservicemgmt.v1beta1.SaasDeployments.GetTenant", - "service": { - "short_name": "SaasDeployments", - "full_name": "google.cloud.saasplatform.saasservicemgmt.v1beta1.SaasDeployments" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 46, - "type": "FULL" - } - ] - }, - { - "region_tag": "saasservicemgmt_v1beta1_generated_SaasDeployments_CreateTenant_sync", - "title": "Snippet for the create_tenant call in the SaasDeployments service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::SaasDeployments::Client#create_tenant.", - "file": "saas_deployments/create_tenant.rb", - "language": "RUBY", - "client_method": { - "short_name": "create_tenant", - "full_name": "::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::SaasDeployments::Client#create_tenant", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::CreateTenantRequest", - "name": "request" - } - ], - "result_type": "::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::Tenant", - "client": { - "short_name": "SaasDeployments::Client", - "full_name": "::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::SaasDeployments::Client" - }, - "method": { - "short_name": "CreateTenant", - "full_name": "google.cloud.saasplatform.saasservicemgmt.v1beta1.SaasDeployments.CreateTenant", - "service": { - "short_name": "SaasDeployments", - "full_name": "google.cloud.saasplatform.saasservicemgmt.v1beta1.SaasDeployments" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 46, - "type": "FULL" - } - ] - }, - { - "region_tag": "saasservicemgmt_v1beta1_generated_SaasDeployments_UpdateTenant_sync", - "title": "Snippet for the update_tenant call in the SaasDeployments service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::SaasDeployments::Client#update_tenant.", - "file": "saas_deployments/update_tenant.rb", - "language": "RUBY", - "client_method": { - "short_name": "update_tenant", - "full_name": "::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::SaasDeployments::Client#update_tenant", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::UpdateTenantRequest", - "name": "request" - } - ], - "result_type": "::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::Tenant", - "client": { - "short_name": "SaasDeployments::Client", - "full_name": "::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::SaasDeployments::Client" - }, - "method": { - "short_name": "UpdateTenant", - "full_name": "google.cloud.saasplatform.saasservicemgmt.v1beta1.SaasDeployments.UpdateTenant", - "service": { - "short_name": "SaasDeployments", - "full_name": "google.cloud.saasplatform.saasservicemgmt.v1beta1.SaasDeployments" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 46, - "type": "FULL" - } - ] - }, - { - "region_tag": "saasservicemgmt_v1beta1_generated_SaasDeployments_DeleteTenant_sync", - "title": "Snippet for the delete_tenant call in the SaasDeployments service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::SaasDeployments::Client#delete_tenant.", - "file": "saas_deployments/delete_tenant.rb", - "language": "RUBY", - "client_method": { - "short_name": "delete_tenant", - "full_name": "::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::SaasDeployments::Client#delete_tenant", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::DeleteTenantRequest", - "name": "request" - } - ], - "result_type": "::Google::Protobuf::Empty", - "client": { - "short_name": "SaasDeployments::Client", - "full_name": "::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::SaasDeployments::Client" - }, - "method": { - "short_name": "DeleteTenant", - "full_name": "google.cloud.saasplatform.saasservicemgmt.v1beta1.SaasDeployments.DeleteTenant", - "service": { - "short_name": "SaasDeployments", - "full_name": "google.cloud.saasplatform.saasservicemgmt.v1beta1.SaasDeployments" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 46, - "type": "FULL" - } - ] - }, - { - "region_tag": "saasservicemgmt_v1beta1_generated_SaasDeployments_ListUnitKinds_sync", - "title": "Snippet for the list_unit_kinds call in the SaasDeployments service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::SaasDeployments::Client#list_unit_kinds.", - "file": "saas_deployments/list_unit_kinds.rb", - "language": "RUBY", - "client_method": { - "short_name": "list_unit_kinds", - "full_name": "::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::SaasDeployments::Client#list_unit_kinds", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::ListUnitKindsRequest", - "name": "request" - } - ], - "result_type": "::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::ListUnitKindsResponse", - "client": { - "short_name": "SaasDeployments::Client", - "full_name": "::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::SaasDeployments::Client" - }, - "method": { - "short_name": "ListUnitKinds", - "full_name": "google.cloud.saasplatform.saasservicemgmt.v1beta1.SaasDeployments.ListUnitKinds", - "service": { - "short_name": "SaasDeployments", - "full_name": "google.cloud.saasplatform.saasservicemgmt.v1beta1.SaasDeployments" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 50, - "type": "FULL" - } - ] - }, - { - "region_tag": "saasservicemgmt_v1beta1_generated_SaasDeployments_GetUnitKind_sync", - "title": "Snippet for the get_unit_kind call in the SaasDeployments service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::SaasDeployments::Client#get_unit_kind.", - "file": "saas_deployments/get_unit_kind.rb", - "language": "RUBY", - "client_method": { - "short_name": "get_unit_kind", - "full_name": "::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::SaasDeployments::Client#get_unit_kind", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::GetUnitKindRequest", - "name": "request" - } - ], - "result_type": "::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::UnitKind", - "client": { - "short_name": "SaasDeployments::Client", - "full_name": "::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::SaasDeployments::Client" - }, - "method": { - "short_name": "GetUnitKind", - "full_name": "google.cloud.saasplatform.saasservicemgmt.v1beta1.SaasDeployments.GetUnitKind", - "service": { - "short_name": "SaasDeployments", - "full_name": "google.cloud.saasplatform.saasservicemgmt.v1beta1.SaasDeployments" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 46, - "type": "FULL" - } - ] - }, - { - "region_tag": "saasservicemgmt_v1beta1_generated_SaasDeployments_CreateUnitKind_sync", - "title": "Snippet for the create_unit_kind call in the SaasDeployments service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::SaasDeployments::Client#create_unit_kind.", - "file": "saas_deployments/create_unit_kind.rb", - "language": "RUBY", - "client_method": { - "short_name": "create_unit_kind", - "full_name": "::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::SaasDeployments::Client#create_unit_kind", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::CreateUnitKindRequest", - "name": "request" - } - ], - "result_type": "::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::UnitKind", - "client": { - "short_name": "SaasDeployments::Client", - "full_name": "::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::SaasDeployments::Client" - }, - "method": { - "short_name": "CreateUnitKind", - "full_name": "google.cloud.saasplatform.saasservicemgmt.v1beta1.SaasDeployments.CreateUnitKind", - "service": { - "short_name": "SaasDeployments", - "full_name": "google.cloud.saasplatform.saasservicemgmt.v1beta1.SaasDeployments" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 46, - "type": "FULL" - } - ] - }, - { - "region_tag": "saasservicemgmt_v1beta1_generated_SaasDeployments_UpdateUnitKind_sync", - "title": "Snippet for the update_unit_kind call in the SaasDeployments service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::SaasDeployments::Client#update_unit_kind.", - "file": "saas_deployments/update_unit_kind.rb", - "language": "RUBY", - "client_method": { - "short_name": "update_unit_kind", - "full_name": "::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::SaasDeployments::Client#update_unit_kind", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::UpdateUnitKindRequest", - "name": "request" - } - ], - "result_type": "::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::UnitKind", - "client": { - "short_name": "SaasDeployments::Client", - "full_name": "::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::SaasDeployments::Client" - }, - "method": { - "short_name": "UpdateUnitKind", - "full_name": "google.cloud.saasplatform.saasservicemgmt.v1beta1.SaasDeployments.UpdateUnitKind", - "service": { - "short_name": "SaasDeployments", - "full_name": "google.cloud.saasplatform.saasservicemgmt.v1beta1.SaasDeployments" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 46, - "type": "FULL" - } - ] - }, - { - "region_tag": "saasservicemgmt_v1beta1_generated_SaasDeployments_DeleteUnitKind_sync", - "title": "Snippet for the delete_unit_kind call in the SaasDeployments service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::SaasDeployments::Client#delete_unit_kind.", - "file": "saas_deployments/delete_unit_kind.rb", - "language": "RUBY", - "client_method": { - "short_name": "delete_unit_kind", - "full_name": "::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::SaasDeployments::Client#delete_unit_kind", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::DeleteUnitKindRequest", - "name": "request" - } - ], - "result_type": "::Google::Protobuf::Empty", - "client": { - "short_name": "SaasDeployments::Client", - "full_name": "::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::SaasDeployments::Client" - }, - "method": { - "short_name": "DeleteUnitKind", - "full_name": "google.cloud.saasplatform.saasservicemgmt.v1beta1.SaasDeployments.DeleteUnitKind", - "service": { - "short_name": "SaasDeployments", - "full_name": "google.cloud.saasplatform.saasservicemgmt.v1beta1.SaasDeployments" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 46, - "type": "FULL" - } - ] - }, - { - "region_tag": "saasservicemgmt_v1beta1_generated_SaasDeployments_ListUnits_sync", - "title": "Snippet for the list_units call in the SaasDeployments service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::SaasDeployments::Client#list_units.", - "file": "saas_deployments/list_units.rb", - "language": "RUBY", - "client_method": { - "short_name": "list_units", - "full_name": "::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::SaasDeployments::Client#list_units", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::ListUnitsRequest", - "name": "request" - } - ], - "result_type": "::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::ListUnitsResponse", - "client": { - "short_name": "SaasDeployments::Client", - "full_name": "::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::SaasDeployments::Client" - }, - "method": { - "short_name": "ListUnits", - "full_name": "google.cloud.saasplatform.saasservicemgmt.v1beta1.SaasDeployments.ListUnits", - "service": { - "short_name": "SaasDeployments", - "full_name": "google.cloud.saasplatform.saasservicemgmt.v1beta1.SaasDeployments" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 50, - "type": "FULL" - } - ] - }, - { - "region_tag": "saasservicemgmt_v1beta1_generated_SaasDeployments_GetUnit_sync", - "title": "Snippet for the get_unit call in the SaasDeployments service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::SaasDeployments::Client#get_unit.", - "file": "saas_deployments/get_unit.rb", - "language": "RUBY", - "client_method": { - "short_name": "get_unit", - "full_name": "::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::SaasDeployments::Client#get_unit", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::GetUnitRequest", - "name": "request" - } - ], - "result_type": "::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::Unit", - "client": { - "short_name": "SaasDeployments::Client", - "full_name": "::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::SaasDeployments::Client" - }, - "method": { - "short_name": "GetUnit", - "full_name": "google.cloud.saasplatform.saasservicemgmt.v1beta1.SaasDeployments.GetUnit", - "service": { - "short_name": "SaasDeployments", - "full_name": "google.cloud.saasplatform.saasservicemgmt.v1beta1.SaasDeployments" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 46, - "type": "FULL" - } - ] - }, - { - "region_tag": "saasservicemgmt_v1beta1_generated_SaasDeployments_CreateUnit_sync", - "title": "Snippet for the create_unit call in the SaasDeployments service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::SaasDeployments::Client#create_unit.", - "file": "saas_deployments/create_unit.rb", - "language": "RUBY", - "client_method": { - "short_name": "create_unit", - "full_name": "::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::SaasDeployments::Client#create_unit", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::CreateUnitRequest", - "name": "request" - } - ], - "result_type": "::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::Unit", - "client": { - "short_name": "SaasDeployments::Client", - "full_name": "::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::SaasDeployments::Client" - }, - "method": { - "short_name": "CreateUnit", - "full_name": "google.cloud.saasplatform.saasservicemgmt.v1beta1.SaasDeployments.CreateUnit", - "service": { - "short_name": "SaasDeployments", - "full_name": "google.cloud.saasplatform.saasservicemgmt.v1beta1.SaasDeployments" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 46, - "type": "FULL" - } - ] - }, - { - "region_tag": "saasservicemgmt_v1beta1_generated_SaasDeployments_UpdateUnit_sync", - "title": "Snippet for the update_unit call in the SaasDeployments service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::SaasDeployments::Client#update_unit.", - "file": "saas_deployments/update_unit.rb", - "language": "RUBY", - "client_method": { - "short_name": "update_unit", - "full_name": "::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::SaasDeployments::Client#update_unit", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::UpdateUnitRequest", - "name": "request" - } - ], - "result_type": "::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::Unit", - "client": { - "short_name": "SaasDeployments::Client", - "full_name": "::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::SaasDeployments::Client" - }, - "method": { - "short_name": "UpdateUnit", - "full_name": "google.cloud.saasplatform.saasservicemgmt.v1beta1.SaasDeployments.UpdateUnit", - "service": { - "short_name": "SaasDeployments", - "full_name": "google.cloud.saasplatform.saasservicemgmt.v1beta1.SaasDeployments" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 46, - "type": "FULL" - } - ] - }, - { - "region_tag": "saasservicemgmt_v1beta1_generated_SaasDeployments_DeleteUnit_sync", - "title": "Snippet for the delete_unit call in the SaasDeployments service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::SaasDeployments::Client#delete_unit.", - "file": "saas_deployments/delete_unit.rb", - "language": "RUBY", - "client_method": { - "short_name": "delete_unit", - "full_name": "::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::SaasDeployments::Client#delete_unit", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::DeleteUnitRequest", - "name": "request" - } - ], - "result_type": "::Google::Protobuf::Empty", - "client": { - "short_name": "SaasDeployments::Client", - "full_name": "::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::SaasDeployments::Client" - }, - "method": { - "short_name": "DeleteUnit", - "full_name": "google.cloud.saasplatform.saasservicemgmt.v1beta1.SaasDeployments.DeleteUnit", - "service": { - "short_name": "SaasDeployments", - "full_name": "google.cloud.saasplatform.saasservicemgmt.v1beta1.SaasDeployments" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 46, - "type": "FULL" - } - ] - }, - { - "region_tag": "saasservicemgmt_v1beta1_generated_SaasDeployments_ListUnitOperations_sync", - "title": "Snippet for the list_unit_operations call in the SaasDeployments service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::SaasDeployments::Client#list_unit_operations.", - "file": "saas_deployments/list_unit_operations.rb", - "language": "RUBY", - "client_method": { - "short_name": "list_unit_operations", - "full_name": "::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::SaasDeployments::Client#list_unit_operations", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::ListUnitOperationsRequest", - "name": "request" - } - ], - "result_type": "::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::ListUnitOperationsResponse", - "client": { - "short_name": "SaasDeployments::Client", - "full_name": "::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::SaasDeployments::Client" - }, - "method": { - "short_name": "ListUnitOperations", - "full_name": "google.cloud.saasplatform.saasservicemgmt.v1beta1.SaasDeployments.ListUnitOperations", - "service": { - "short_name": "SaasDeployments", - "full_name": "google.cloud.saasplatform.saasservicemgmt.v1beta1.SaasDeployments" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 50, - "type": "FULL" - } - ] - }, - { - "region_tag": "saasservicemgmt_v1beta1_generated_SaasDeployments_GetUnitOperation_sync", - "title": "Snippet for the get_unit_operation call in the SaasDeployments service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::SaasDeployments::Client#get_unit_operation.", - "file": "saas_deployments/get_unit_operation.rb", - "language": "RUBY", - "client_method": { - "short_name": "get_unit_operation", - "full_name": "::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::SaasDeployments::Client#get_unit_operation", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::GetUnitOperationRequest", - "name": "request" - } - ], - "result_type": "::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::UnitOperation", - "client": { - "short_name": "SaasDeployments::Client", - "full_name": "::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::SaasDeployments::Client" - }, - "method": { - "short_name": "GetUnitOperation", - "full_name": "google.cloud.saasplatform.saasservicemgmt.v1beta1.SaasDeployments.GetUnitOperation", - "service": { - "short_name": "SaasDeployments", - "full_name": "google.cloud.saasplatform.saasservicemgmt.v1beta1.SaasDeployments" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 46, - "type": "FULL" - } - ] - }, - { - "region_tag": "saasservicemgmt_v1beta1_generated_SaasDeployments_CreateUnitOperation_sync", - "title": "Snippet for the create_unit_operation call in the SaasDeployments service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::SaasDeployments::Client#create_unit_operation.", - "file": "saas_deployments/create_unit_operation.rb", - "language": "RUBY", - "client_method": { - "short_name": "create_unit_operation", - "full_name": "::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::SaasDeployments::Client#create_unit_operation", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::CreateUnitOperationRequest", - "name": "request" - } - ], - "result_type": "::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::UnitOperation", - "client": { - "short_name": "SaasDeployments::Client", - "full_name": "::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::SaasDeployments::Client" - }, - "method": { - "short_name": "CreateUnitOperation", - "full_name": "google.cloud.saasplatform.saasservicemgmt.v1beta1.SaasDeployments.CreateUnitOperation", - "service": { - "short_name": "SaasDeployments", - "full_name": "google.cloud.saasplatform.saasservicemgmt.v1beta1.SaasDeployments" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 46, - "type": "FULL" - } - ] - }, - { - "region_tag": "saasservicemgmt_v1beta1_generated_SaasDeployments_UpdateUnitOperation_sync", - "title": "Snippet for the update_unit_operation call in the SaasDeployments service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::SaasDeployments::Client#update_unit_operation.", - "file": "saas_deployments/update_unit_operation.rb", - "language": "RUBY", - "client_method": { - "short_name": "update_unit_operation", - "full_name": "::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::SaasDeployments::Client#update_unit_operation", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::UpdateUnitOperationRequest", - "name": "request" - } - ], - "result_type": "::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::UnitOperation", - "client": { - "short_name": "SaasDeployments::Client", - "full_name": "::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::SaasDeployments::Client" - }, - "method": { - "short_name": "UpdateUnitOperation", - "full_name": "google.cloud.saasplatform.saasservicemgmt.v1beta1.SaasDeployments.UpdateUnitOperation", - "service": { - "short_name": "SaasDeployments", - "full_name": "google.cloud.saasplatform.saasservicemgmt.v1beta1.SaasDeployments" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 46, - "type": "FULL" - } - ] - }, - { - "region_tag": "saasservicemgmt_v1beta1_generated_SaasDeployments_DeleteUnitOperation_sync", - "title": "Snippet for the delete_unit_operation call in the SaasDeployments service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::SaasDeployments::Client#delete_unit_operation.", - "file": "saas_deployments/delete_unit_operation.rb", - "language": "RUBY", - "client_method": { - "short_name": "delete_unit_operation", - "full_name": "::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::SaasDeployments::Client#delete_unit_operation", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::DeleteUnitOperationRequest", - "name": "request" - } - ], - "result_type": "::Google::Protobuf::Empty", - "client": { - "short_name": "SaasDeployments::Client", - "full_name": "::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::SaasDeployments::Client" - }, - "method": { - "short_name": "DeleteUnitOperation", - "full_name": "google.cloud.saasplatform.saasservicemgmt.v1beta1.SaasDeployments.DeleteUnitOperation", - "service": { - "short_name": "SaasDeployments", - "full_name": "google.cloud.saasplatform.saasservicemgmt.v1beta1.SaasDeployments" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 46, - "type": "FULL" - } - ] - }, - { - "region_tag": "saasservicemgmt_v1beta1_generated_SaasDeployments_ListReleases_sync", - "title": "Snippet for the list_releases call in the SaasDeployments service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::SaasDeployments::Client#list_releases.", - "file": "saas_deployments/list_releases.rb", - "language": "RUBY", - "client_method": { - "short_name": "list_releases", - "full_name": "::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::SaasDeployments::Client#list_releases", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::ListReleasesRequest", - "name": "request" - } - ], - "result_type": "::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::ListReleasesResponse", - "client": { - "short_name": "SaasDeployments::Client", - "full_name": "::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::SaasDeployments::Client" - }, - "method": { - "short_name": "ListReleases", - "full_name": "google.cloud.saasplatform.saasservicemgmt.v1beta1.SaasDeployments.ListReleases", - "service": { - "short_name": "SaasDeployments", - "full_name": "google.cloud.saasplatform.saasservicemgmt.v1beta1.SaasDeployments" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 50, - "type": "FULL" - } - ] - }, - { - "region_tag": "saasservicemgmt_v1beta1_generated_SaasDeployments_GetRelease_sync", - "title": "Snippet for the get_release call in the SaasDeployments service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::SaasDeployments::Client#get_release.", - "file": "saas_deployments/get_release.rb", - "language": "RUBY", - "client_method": { - "short_name": "get_release", - "full_name": "::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::SaasDeployments::Client#get_release", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::GetReleaseRequest", - "name": "request" - } - ], - "result_type": "::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::Release", - "client": { - "short_name": "SaasDeployments::Client", - "full_name": "::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::SaasDeployments::Client" - }, - "method": { - "short_name": "GetRelease", - "full_name": "google.cloud.saasplatform.saasservicemgmt.v1beta1.SaasDeployments.GetRelease", - "service": { - "short_name": "SaasDeployments", - "full_name": "google.cloud.saasplatform.saasservicemgmt.v1beta1.SaasDeployments" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 46, - "type": "FULL" - } - ] - }, - { - "region_tag": "saasservicemgmt_v1beta1_generated_SaasDeployments_CreateRelease_sync", - "title": "Snippet for the create_release call in the SaasDeployments service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::SaasDeployments::Client#create_release.", - "file": "saas_deployments/create_release.rb", - "language": "RUBY", - "client_method": { - "short_name": "create_release", - "full_name": "::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::SaasDeployments::Client#create_release", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::CreateReleaseRequest", - "name": "request" - } - ], - "result_type": "::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::Release", - "client": { - "short_name": "SaasDeployments::Client", - "full_name": "::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::SaasDeployments::Client" - }, - "method": { - "short_name": "CreateRelease", - "full_name": "google.cloud.saasplatform.saasservicemgmt.v1beta1.SaasDeployments.CreateRelease", - "service": { - "short_name": "SaasDeployments", - "full_name": "google.cloud.saasplatform.saasservicemgmt.v1beta1.SaasDeployments" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 46, - "type": "FULL" - } - ] - }, - { - "region_tag": "saasservicemgmt_v1beta1_generated_SaasDeployments_UpdateRelease_sync", - "title": "Snippet for the update_release call in the SaasDeployments service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::SaasDeployments::Client#update_release.", - "file": "saas_deployments/update_release.rb", - "language": "RUBY", - "client_method": { - "short_name": "update_release", - "full_name": "::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::SaasDeployments::Client#update_release", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::UpdateReleaseRequest", - "name": "request" - } - ], - "result_type": "::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::Release", - "client": { - "short_name": "SaasDeployments::Client", - "full_name": "::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::SaasDeployments::Client" - }, - "method": { - "short_name": "UpdateRelease", - "full_name": "google.cloud.saasplatform.saasservicemgmt.v1beta1.SaasDeployments.UpdateRelease", - "service": { - "short_name": "SaasDeployments", - "full_name": "google.cloud.saasplatform.saasservicemgmt.v1beta1.SaasDeployments" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 46, - "type": "FULL" - } - ] - }, - { - "region_tag": "saasservicemgmt_v1beta1_generated_SaasDeployments_DeleteRelease_sync", - "title": "Snippet for the delete_release call in the SaasDeployments service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::SaasDeployments::Client#delete_release.", - "file": "saas_deployments/delete_release.rb", - "language": "RUBY", - "client_method": { - "short_name": "delete_release", - "full_name": "::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::SaasDeployments::Client#delete_release", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::DeleteReleaseRequest", - "name": "request" - } - ], - "result_type": "::Google::Protobuf::Empty", - "client": { - "short_name": "SaasDeployments::Client", - "full_name": "::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::SaasDeployments::Client" - }, - "method": { - "short_name": "DeleteRelease", - "full_name": "google.cloud.saasplatform.saasservicemgmt.v1beta1.SaasDeployments.DeleteRelease", - "service": { - "short_name": "SaasDeployments", - "full_name": "google.cloud.saasplatform.saasservicemgmt.v1beta1.SaasDeployments" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 46, - "type": "FULL" - } - ] - }, - { - "region_tag": "saasservicemgmt_v1beta1_generated_SaasRollouts_ListRollouts_sync", - "title": "Snippet for the list_rollouts call in the SaasRollouts service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::SaasRollouts::Client#list_rollouts.", - "file": "saas_rollouts/list_rollouts.rb", - "language": "RUBY", - "client_method": { - "short_name": "list_rollouts", - "full_name": "::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::SaasRollouts::Client#list_rollouts", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::ListRolloutsRequest", - "name": "request" - } - ], - "result_type": "::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::ListRolloutsResponse", - "client": { - "short_name": "SaasRollouts::Client", - "full_name": "::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::SaasRollouts::Client" - }, - "method": { - "short_name": "ListRollouts", - "full_name": "google.cloud.saasplatform.saasservicemgmt.v1beta1.SaasRollouts.ListRollouts", - "service": { - "short_name": "SaasRollouts", - "full_name": "google.cloud.saasplatform.saasservicemgmt.v1beta1.SaasRollouts" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 50, - "type": "FULL" - } - ] - }, - { - "region_tag": "saasservicemgmt_v1beta1_generated_SaasRollouts_GetRollout_sync", - "title": "Snippet for the get_rollout call in the SaasRollouts service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::SaasRollouts::Client#get_rollout.", - "file": "saas_rollouts/get_rollout.rb", - "language": "RUBY", - "client_method": { - "short_name": "get_rollout", - "full_name": "::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::SaasRollouts::Client#get_rollout", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::GetRolloutRequest", - "name": "request" - } - ], - "result_type": "::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::Rollout", - "client": { - "short_name": "SaasRollouts::Client", - "full_name": "::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::SaasRollouts::Client" - }, - "method": { - "short_name": "GetRollout", - "full_name": "google.cloud.saasplatform.saasservicemgmt.v1beta1.SaasRollouts.GetRollout", - "service": { - "short_name": "SaasRollouts", - "full_name": "google.cloud.saasplatform.saasservicemgmt.v1beta1.SaasRollouts" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 46, - "type": "FULL" - } - ] - }, - { - "region_tag": "saasservicemgmt_v1beta1_generated_SaasRollouts_CreateRollout_sync", - "title": "Snippet for the create_rollout call in the SaasRollouts service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::SaasRollouts::Client#create_rollout.", - "file": "saas_rollouts/create_rollout.rb", - "language": "RUBY", - "client_method": { - "short_name": "create_rollout", - "full_name": "::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::SaasRollouts::Client#create_rollout", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::CreateRolloutRequest", - "name": "request" - } - ], - "result_type": "::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::Rollout", - "client": { - "short_name": "SaasRollouts::Client", - "full_name": "::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::SaasRollouts::Client" - }, - "method": { - "short_name": "CreateRollout", - "full_name": "google.cloud.saasplatform.saasservicemgmt.v1beta1.SaasRollouts.CreateRollout", - "service": { - "short_name": "SaasRollouts", - "full_name": "google.cloud.saasplatform.saasservicemgmt.v1beta1.SaasRollouts" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 46, - "type": "FULL" - } - ] - }, - { - "region_tag": "saasservicemgmt_v1beta1_generated_SaasRollouts_UpdateRollout_sync", - "title": "Snippet for the update_rollout call in the SaasRollouts service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::SaasRollouts::Client#update_rollout.", - "file": "saas_rollouts/update_rollout.rb", - "language": "RUBY", - "client_method": { - "short_name": "update_rollout", - "full_name": "::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::SaasRollouts::Client#update_rollout", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::UpdateRolloutRequest", - "name": "request" - } - ], - "result_type": "::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::Rollout", - "client": { - "short_name": "SaasRollouts::Client", - "full_name": "::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::SaasRollouts::Client" - }, - "method": { - "short_name": "UpdateRollout", - "full_name": "google.cloud.saasplatform.saasservicemgmt.v1beta1.SaasRollouts.UpdateRollout", - "service": { - "short_name": "SaasRollouts", - "full_name": "google.cloud.saasplatform.saasservicemgmt.v1beta1.SaasRollouts" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 46, - "type": "FULL" - } - ] - }, - { - "region_tag": "saasservicemgmt_v1beta1_generated_SaasRollouts_DeleteRollout_sync", - "title": "Snippet for the delete_rollout call in the SaasRollouts service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::SaasRollouts::Client#delete_rollout.", - "file": "saas_rollouts/delete_rollout.rb", - "language": "RUBY", - "client_method": { - "short_name": "delete_rollout", - "full_name": "::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::SaasRollouts::Client#delete_rollout", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::DeleteRolloutRequest", - "name": "request" - } - ], - "result_type": "::Google::Protobuf::Empty", - "client": { - "short_name": "SaasRollouts::Client", - "full_name": "::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::SaasRollouts::Client" - }, - "method": { - "short_name": "DeleteRollout", - "full_name": "google.cloud.saasplatform.saasservicemgmt.v1beta1.SaasRollouts.DeleteRollout", - "service": { - "short_name": "SaasRollouts", - "full_name": "google.cloud.saasplatform.saasservicemgmt.v1beta1.SaasRollouts" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 46, - "type": "FULL" - } - ] - }, - { - "region_tag": "saasservicemgmt_v1beta1_generated_SaasRollouts_ListRolloutKinds_sync", - "title": "Snippet for the list_rollout_kinds call in the SaasRollouts service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::SaasRollouts::Client#list_rollout_kinds.", - "file": "saas_rollouts/list_rollout_kinds.rb", - "language": "RUBY", - "client_method": { - "short_name": "list_rollout_kinds", - "full_name": "::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::SaasRollouts::Client#list_rollout_kinds", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::ListRolloutKindsRequest", - "name": "request" - } - ], - "result_type": "::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::ListRolloutKindsResponse", - "client": { - "short_name": "SaasRollouts::Client", - "full_name": "::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::SaasRollouts::Client" - }, - "method": { - "short_name": "ListRolloutKinds", - "full_name": "google.cloud.saasplatform.saasservicemgmt.v1beta1.SaasRollouts.ListRolloutKinds", - "service": { - "short_name": "SaasRollouts", - "full_name": "google.cloud.saasplatform.saasservicemgmt.v1beta1.SaasRollouts" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 50, - "type": "FULL" - } - ] - }, - { - "region_tag": "saasservicemgmt_v1beta1_generated_SaasRollouts_GetRolloutKind_sync", - "title": "Snippet for the get_rollout_kind call in the SaasRollouts service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::SaasRollouts::Client#get_rollout_kind.", - "file": "saas_rollouts/get_rollout_kind.rb", - "language": "RUBY", - "client_method": { - "short_name": "get_rollout_kind", - "full_name": "::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::SaasRollouts::Client#get_rollout_kind", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::GetRolloutKindRequest", - "name": "request" - } - ], - "result_type": "::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::RolloutKind", - "client": { - "short_name": "SaasRollouts::Client", - "full_name": "::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::SaasRollouts::Client" - }, - "method": { - "short_name": "GetRolloutKind", - "full_name": "google.cloud.saasplatform.saasservicemgmt.v1beta1.SaasRollouts.GetRolloutKind", - "service": { - "short_name": "SaasRollouts", - "full_name": "google.cloud.saasplatform.saasservicemgmt.v1beta1.SaasRollouts" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 46, - "type": "FULL" - } - ] - }, - { - "region_tag": "saasservicemgmt_v1beta1_generated_SaasRollouts_CreateRolloutKind_sync", - "title": "Snippet for the create_rollout_kind call in the SaasRollouts service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::SaasRollouts::Client#create_rollout_kind.", - "file": "saas_rollouts/create_rollout_kind.rb", - "language": "RUBY", - "client_method": { - "short_name": "create_rollout_kind", - "full_name": "::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::SaasRollouts::Client#create_rollout_kind", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::CreateRolloutKindRequest", - "name": "request" - } - ], - "result_type": "::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::RolloutKind", - "client": { - "short_name": "SaasRollouts::Client", - "full_name": "::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::SaasRollouts::Client" - }, - "method": { - "short_name": "CreateRolloutKind", - "full_name": "google.cloud.saasplatform.saasservicemgmt.v1beta1.SaasRollouts.CreateRolloutKind", - "service": { - "short_name": "SaasRollouts", - "full_name": "google.cloud.saasplatform.saasservicemgmt.v1beta1.SaasRollouts" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 46, - "type": "FULL" - } - ] - }, - { - "region_tag": "saasservicemgmt_v1beta1_generated_SaasRollouts_UpdateRolloutKind_sync", - "title": "Snippet for the update_rollout_kind call in the SaasRollouts service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::SaasRollouts::Client#update_rollout_kind.", - "file": "saas_rollouts/update_rollout_kind.rb", - "language": "RUBY", - "client_method": { - "short_name": "update_rollout_kind", - "full_name": "::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::SaasRollouts::Client#update_rollout_kind", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::UpdateRolloutKindRequest", - "name": "request" - } - ], - "result_type": "::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::RolloutKind", - "client": { - "short_name": "SaasRollouts::Client", - "full_name": "::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::SaasRollouts::Client" - }, - "method": { - "short_name": "UpdateRolloutKind", - "full_name": "google.cloud.saasplatform.saasservicemgmt.v1beta1.SaasRollouts.UpdateRolloutKind", - "service": { - "short_name": "SaasRollouts", - "full_name": "google.cloud.saasplatform.saasservicemgmt.v1beta1.SaasRollouts" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 46, - "type": "FULL" - } - ] - }, - { - "region_tag": "saasservicemgmt_v1beta1_generated_SaasRollouts_DeleteRolloutKind_sync", - "title": "Snippet for the delete_rollout_kind call in the SaasRollouts service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::SaasRollouts::Client#delete_rollout_kind.", - "file": "saas_rollouts/delete_rollout_kind.rb", - "language": "RUBY", - "client_method": { - "short_name": "delete_rollout_kind", - "full_name": "::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::SaasRollouts::Client#delete_rollout_kind", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::DeleteRolloutKindRequest", - "name": "request" - } - ], - "result_type": "::Google::Protobuf::Empty", - "client": { - "short_name": "SaasRollouts::Client", - "full_name": "::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::SaasRollouts::Client" - }, - "method": { - "short_name": "DeleteRolloutKind", - "full_name": "google.cloud.saasplatform.saasservicemgmt.v1beta1.SaasRollouts.DeleteRolloutKind", - "service": { - "short_name": "SaasRollouts", - "full_name": "google.cloud.saasplatform.saasservicemgmt.v1beta1.SaasRollouts" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 46, - "type": "FULL" - } - ] - } - ] -} \ No newline at end of file diff --git a/owl-bot-staging/google-cloud-saas_platform-saas_service_mgmt-v1beta1/test/google/cloud/saas_platform/saas_service_mgmt/v1beta1/saas_deployments_paths_test.rb b/owl-bot-staging/google-cloud-saas_platform-saas_service_mgmt-v1beta1/test/google/cloud/saas_platform/saas_service_mgmt/v1beta1/saas_deployments_paths_test.rb deleted file mode 100644 index 005ecd987b9d..000000000000 --- a/owl-bot-staging/google-cloud-saas_platform-saas_service_mgmt-v1beta1/test/google/cloud/saas_platform/saas_service_mgmt/v1beta1/saas_deployments_paths_test.rb +++ /dev/null @@ -1,139 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -require "helper" - -require "gapic/grpc/service_stub" - -require "google/cloud/saas_platform/saas_service_mgmt/v1beta1/saas_deployments" - -class ::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::SaasDeployments::ClientPathsTest < Minitest::Test - class DummyStub - def endpoint - "endpoint.example.com" - end - - def universe_domain - "example.com" - end - - def stub_logger - nil - end - - def logger - nil - end - end - - def test_location_path - grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - ::Gapic::ServiceStub.stub :new, DummyStub.new do - client = ::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::SaasDeployments::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_release_path - grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - ::Gapic::ServiceStub.stub :new, DummyStub.new do - client = ::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::SaasDeployments::Client.new do |config| - config.credentials = grpc_channel - end - - path = client.release_path project: "value0", location: "value1", release: "value2" - assert_equal "projects/value0/locations/value1/releases/value2", path - end - end - - def test_rollout_path - grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - ::Gapic::ServiceStub.stub :new, DummyStub.new do - client = ::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::SaasDeployments::Client.new do |config| - config.credentials = grpc_channel - end - - path = client.rollout_path project: "value0", location: "value1", rollout_id: "value2" - assert_equal "projects/value0/locations/value1/rollouts/value2", path - end - end - - def test_saas_path - grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - ::Gapic::ServiceStub.stub :new, DummyStub.new do - client = ::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::SaasDeployments::Client.new do |config| - config.credentials = grpc_channel - end - - path = client.saas_path project: "value0", location: "value1", saas: "value2" - assert_equal "projects/value0/locations/value1/saas/value2", path - end - end - - def test_tenant_path - grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - ::Gapic::ServiceStub.stub :new, DummyStub.new do - client = ::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::SaasDeployments::Client.new do |config| - config.credentials = grpc_channel - end - - path = client.tenant_path project: "value0", location: "value1", tenant: "value2" - assert_equal "projects/value0/locations/value1/tenants/value2", path - end - end - - def test_unit_path - grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - ::Gapic::ServiceStub.stub :new, DummyStub.new do - client = ::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::SaasDeployments::Client.new do |config| - config.credentials = grpc_channel - end - - path = client.unit_path project: "value0", location: "value1", unit: "value2" - assert_equal "projects/value0/locations/value1/units/value2", path - end - end - - def test_unit_kind_path - grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - ::Gapic::ServiceStub.stub :new, DummyStub.new do - client = ::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::SaasDeployments::Client.new do |config| - config.credentials = grpc_channel - end - - path = client.unit_kind_path project: "value0", location: "value1", unit_kind: "value2" - assert_equal "projects/value0/locations/value1/unitKinds/value2", path - end - end - - def test_unit_operation_path - grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - ::Gapic::ServiceStub.stub :new, DummyStub.new do - client = ::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::SaasDeployments::Client.new do |config| - config.credentials = grpc_channel - end - - path = client.unit_operation_path project: "value0", location: "value1", unit_operation: "value2" - assert_equal "projects/value0/locations/value1/unitOperations/value2", path - end - end -end diff --git a/owl-bot-staging/google-cloud-saas_platform-saas_service_mgmt-v1beta1/test/google/cloud/saas_platform/saas_service_mgmt/v1beta1/saas_deployments_rest_test.rb b/owl-bot-staging/google-cloud-saas_platform-saas_service_mgmt-v1beta1/test/google/cloud/saas_platform/saas_service_mgmt/v1beta1/saas_deployments_rest_test.rb deleted file mode 100644 index f3cf27a8a1e7..000000000000 --- a/owl-bot-staging/google-cloud-saas_platform-saas_service_mgmt-v1beta1/test/google/cloud/saas_platform/saas_service_mgmt/v1beta1/saas_deployments_rest_test.rb +++ /dev/null @@ -1,1803 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -require "helper" -require "gapic/rest" -require "google/cloud/saasplatform/saasservicemgmt/v1beta1/deployments_service_pb" -require "google/cloud/saas_platform/saas_service_mgmt/v1beta1/saas_deployments/rest" - - -class ::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::SaasDeployments::Rest::ClientTest < Minitest::Test - class ClientStub - attr_accessor :call_count, :requests - - def initialize response, &block - @response = response - @block = block - @call_count = 0 - @requests = [] - end - - def make_get_request uri:, params: {}, options: {}, method_name: nil - make_http_request :get, uri: uri, body: nil, params: params, options: options, method_name: method_name - end - - def make_delete_request uri:, params: {}, options: {}, method_name: nil - make_http_request :delete, uri: uri, body: nil, params: params, options: options, method_name: method_name - end - - def make_post_request uri:, body: nil, params: {}, options: {}, method_name: nil - make_http_request :post, uri: uri, body: body, params: params, options: options, method_name: method_name - end - - def make_patch_request uri:, body:, params: {}, options: {}, method_name: nil - make_http_request :patch, uri: uri, body: body, params: params, options: options, method_name: method_name - end - - def make_put_request uri:, body:, params: {}, options: {}, method_name: nil - make_http_request :put, uri: uri, body: body, params: params, options: options, method_name: method_name - end - - def make_http_request *args, **kwargs - @call_count += 1 - - @requests << @block&.call(*args, **kwargs) - - @response - end - - def endpoint - "endpoint.example.com" - end - - def universe_domain - "example.com" - end - - def stub_logger - nil - end - - def logger - nil - end - end - - def test_list_saas - # Create test objects. - client_result = ::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::ListSaasResponse.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" - order_by = "hello world" - - list_saas_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| - assert options.metadata.key? :"x-goog-api-client" - assert options.metadata[:"x-goog-api-client"].include? "rest" - refute options.metadata[:"x-goog-api-client"].include? "grpc" - end - - ::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::SaasDeployments::Rest::ServiceStub.stub :transcode_list_saas_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, list_saas_client_stub do - # Create client - client = ::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::SaasDeployments::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - client.list_saas({ parent: parent, page_size: page_size, page_token: page_token, filter: filter, order_by: order_by }) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use named arguments - client.list_saas parent: parent, page_size: page_size, page_token: page_token, filter: filter, order_by: order_by do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object - client.list_saas ::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::ListSaasRequest.new(parent: parent, page_size: page_size, page_token: page_token, filter: filter, order_by: order_by) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use hash object with options - client.list_saas({ parent: parent, page_size: page_size, page_token: page_token, filter: filter, order_by: order_by }, call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object with options - client.list_saas(::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::ListSaasRequest.new(parent: parent, page_size: page_size, page_token: page_token, filter: filter, order_by: order_by), call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Verify method calls - assert_equal 5, list_saas_client_stub.call_count - end - end - end - - def test_get_saas - # Create test objects. - client_result = ::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::Saas.new - http_response = OpenStruct.new body: client_result.to_json - - call_options = {} - - # Create request parameters for a unary method. - name = "hello world" - - get_saas_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| - assert options.metadata.key? :"x-goog-api-client" - assert options.metadata[:"x-goog-api-client"].include? "rest" - refute options.metadata[:"x-goog-api-client"].include? "grpc" - end - - ::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::SaasDeployments::Rest::ServiceStub.stub :transcode_get_saas_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, get_saas_client_stub do - # Create client - client = ::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::SaasDeployments::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - client.get_saas({ name: name }) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use named arguments - client.get_saas name: name do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object - client.get_saas ::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::GetSaasRequest.new(name: name) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use hash object with options - client.get_saas({ name: name }, call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object with options - client.get_saas(::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::GetSaasRequest.new(name: name), call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Verify method calls - assert_equal 5, get_saas_client_stub.call_count - end - end - end - - def test_create_saas - # Create test objects. - client_result = ::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::Saas.new - http_response = OpenStruct.new body: client_result.to_json - - call_options = {} - - # Create request parameters for a unary method. - parent = "hello world" - saas_id = "hello world" - saas = {} - validate_only = true - request_id = "hello world" - - create_saas_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| - assert options.metadata.key? :"x-goog-api-client" - assert options.metadata[:"x-goog-api-client"].include? "rest" - refute options.metadata[:"x-goog-api-client"].include? "grpc" - end - - ::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::SaasDeployments::Rest::ServiceStub.stub :transcode_create_saas_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, create_saas_client_stub do - # Create client - client = ::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::SaasDeployments::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - client.create_saas({ parent: parent, saas_id: saas_id, saas: saas, validate_only: validate_only, request_id: request_id }) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use named arguments - client.create_saas parent: parent, saas_id: saas_id, saas: saas, validate_only: validate_only, request_id: request_id do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object - client.create_saas ::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::CreateSaasRequest.new(parent: parent, saas_id: saas_id, saas: saas, validate_only: validate_only, request_id: request_id) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use hash object with options - client.create_saas({ parent: parent, saas_id: saas_id, saas: saas, validate_only: validate_only, request_id: request_id }, call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object with options - client.create_saas(::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::CreateSaasRequest.new(parent: parent, saas_id: saas_id, saas: saas, validate_only: validate_only, request_id: request_id), call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Verify method calls - assert_equal 5, create_saas_client_stub.call_count - end - end - end - - def test_update_saas - # Create test objects. - client_result = ::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::Saas.new - http_response = OpenStruct.new body: client_result.to_json - - call_options = {} - - # Create request parameters for a unary method. - saas = {} - validate_only = true - request_id = "hello world" - update_mask = {} - - update_saas_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| - assert options.metadata.key? :"x-goog-api-client" - assert options.metadata[:"x-goog-api-client"].include? "rest" - refute options.metadata[:"x-goog-api-client"].include? "grpc" - end - - ::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::SaasDeployments::Rest::ServiceStub.stub :transcode_update_saas_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, update_saas_client_stub do - # Create client - client = ::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::SaasDeployments::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - client.update_saas({ saas: saas, validate_only: validate_only, request_id: request_id, update_mask: update_mask }) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use named arguments - client.update_saas saas: saas, validate_only: validate_only, request_id: request_id, update_mask: update_mask do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object - client.update_saas ::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::UpdateSaasRequest.new(saas: saas, validate_only: validate_only, request_id: request_id, update_mask: update_mask) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use hash object with options - client.update_saas({ saas: saas, validate_only: validate_only, request_id: request_id, update_mask: update_mask }, call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object with options - client.update_saas(::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::UpdateSaasRequest.new(saas: saas, validate_only: validate_only, request_id: request_id, update_mask: update_mask), call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Verify method calls - assert_equal 5, update_saas_client_stub.call_count - end - end - end - - def test_delete_saas - # Create test objects. - client_result = ::Google::Protobuf::Empty.new - http_response = OpenStruct.new body: client_result.to_json - - call_options = {} - - # Create request parameters for a unary method. - name = "hello world" - etag = "hello world" - validate_only = true - request_id = "hello world" - - delete_saas_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| - assert options.metadata.key? :"x-goog-api-client" - assert options.metadata[:"x-goog-api-client"].include? "rest" - refute options.metadata[:"x-goog-api-client"].include? "grpc" - end - - ::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::SaasDeployments::Rest::ServiceStub.stub :transcode_delete_saas_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, delete_saas_client_stub do - # Create client - client = ::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::SaasDeployments::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - client.delete_saas({ name: name, etag: etag, validate_only: validate_only, request_id: request_id }) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use named arguments - client.delete_saas name: name, etag: etag, validate_only: validate_only, request_id: request_id do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object - client.delete_saas ::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::DeleteSaasRequest.new(name: name, etag: etag, validate_only: validate_only, request_id: request_id) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use hash object with options - client.delete_saas({ name: name, etag: etag, validate_only: validate_only, request_id: request_id }, call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object with options - client.delete_saas(::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::DeleteSaasRequest.new(name: name, etag: etag, validate_only: validate_only, request_id: request_id), call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Verify method calls - assert_equal 5, delete_saas_client_stub.call_count - end - end - end - - def test_list_tenants - # Create test objects. - client_result = ::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::ListTenantsResponse.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" - order_by = "hello world" - - list_tenants_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| - assert options.metadata.key? :"x-goog-api-client" - assert options.metadata[:"x-goog-api-client"].include? "rest" - refute options.metadata[:"x-goog-api-client"].include? "grpc" - end - - ::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::SaasDeployments::Rest::ServiceStub.stub :transcode_list_tenants_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, list_tenants_client_stub do - # Create client - client = ::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::SaasDeployments::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - client.list_tenants({ parent: parent, page_size: page_size, page_token: page_token, filter: filter, order_by: order_by }) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use named arguments - client.list_tenants parent: parent, page_size: page_size, page_token: page_token, filter: filter, order_by: order_by do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object - client.list_tenants ::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::ListTenantsRequest.new(parent: parent, page_size: page_size, page_token: page_token, filter: filter, order_by: order_by) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use hash object with options - client.list_tenants({ parent: parent, page_size: page_size, page_token: page_token, filter: filter, order_by: order_by }, call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object with options - client.list_tenants(::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::ListTenantsRequest.new(parent: parent, page_size: page_size, page_token: page_token, filter: filter, order_by: order_by), call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Verify method calls - assert_equal 5, list_tenants_client_stub.call_count - end - end - end - - def test_get_tenant - # Create test objects. - client_result = ::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::Tenant.new - http_response = OpenStruct.new body: client_result.to_json - - call_options = {} - - # Create request parameters for a unary method. - name = "hello world" - - get_tenant_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| - assert options.metadata.key? :"x-goog-api-client" - assert options.metadata[:"x-goog-api-client"].include? "rest" - refute options.metadata[:"x-goog-api-client"].include? "grpc" - end - - ::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::SaasDeployments::Rest::ServiceStub.stub :transcode_get_tenant_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, get_tenant_client_stub do - # Create client - client = ::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::SaasDeployments::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - client.get_tenant({ name: name }) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use named arguments - client.get_tenant name: name do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object - client.get_tenant ::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::GetTenantRequest.new(name: name) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use hash object with options - client.get_tenant({ name: name }, call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object with options - client.get_tenant(::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::GetTenantRequest.new(name: name), call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Verify method calls - assert_equal 5, get_tenant_client_stub.call_count - end - end - end - - def test_create_tenant - # Create test objects. - client_result = ::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::Tenant.new - http_response = OpenStruct.new body: client_result.to_json - - call_options = {} - - # Create request parameters for a unary method. - parent = "hello world" - tenant_id = "hello world" - tenant = {} - validate_only = true - request_id = "hello world" - - create_tenant_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| - assert options.metadata.key? :"x-goog-api-client" - assert options.metadata[:"x-goog-api-client"].include? "rest" - refute options.metadata[:"x-goog-api-client"].include? "grpc" - end - - ::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::SaasDeployments::Rest::ServiceStub.stub :transcode_create_tenant_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, create_tenant_client_stub do - # Create client - client = ::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::SaasDeployments::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - client.create_tenant({ parent: parent, tenant_id: tenant_id, tenant: tenant, validate_only: validate_only, request_id: request_id }) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use named arguments - client.create_tenant parent: parent, tenant_id: tenant_id, tenant: tenant, validate_only: validate_only, request_id: request_id do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object - client.create_tenant ::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::CreateTenantRequest.new(parent: parent, tenant_id: tenant_id, tenant: tenant, validate_only: validate_only, request_id: request_id) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use hash object with options - client.create_tenant({ parent: parent, tenant_id: tenant_id, tenant: tenant, validate_only: validate_only, request_id: request_id }, call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object with options - client.create_tenant(::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::CreateTenantRequest.new(parent: parent, tenant_id: tenant_id, tenant: tenant, validate_only: validate_only, request_id: request_id), call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Verify method calls - assert_equal 5, create_tenant_client_stub.call_count - end - end - end - - def test_update_tenant - # Create test objects. - client_result = ::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::Tenant.new - http_response = OpenStruct.new body: client_result.to_json - - call_options = {} - - # Create request parameters for a unary method. - tenant = {} - validate_only = true - request_id = "hello world" - update_mask = {} - - update_tenant_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| - assert options.metadata.key? :"x-goog-api-client" - assert options.metadata[:"x-goog-api-client"].include? "rest" - refute options.metadata[:"x-goog-api-client"].include? "grpc" - end - - ::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::SaasDeployments::Rest::ServiceStub.stub :transcode_update_tenant_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, update_tenant_client_stub do - # Create client - client = ::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::SaasDeployments::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - client.update_tenant({ tenant: tenant, validate_only: validate_only, request_id: request_id, update_mask: update_mask }) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use named arguments - client.update_tenant tenant: tenant, validate_only: validate_only, request_id: request_id, update_mask: update_mask do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object - client.update_tenant ::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::UpdateTenantRequest.new(tenant: tenant, validate_only: validate_only, request_id: request_id, update_mask: update_mask) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use hash object with options - client.update_tenant({ tenant: tenant, validate_only: validate_only, request_id: request_id, update_mask: update_mask }, call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object with options - client.update_tenant(::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::UpdateTenantRequest.new(tenant: tenant, validate_only: validate_only, request_id: request_id, update_mask: update_mask), call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Verify method calls - assert_equal 5, update_tenant_client_stub.call_count - end - end - end - - def test_delete_tenant - # Create test objects. - client_result = ::Google::Protobuf::Empty.new - http_response = OpenStruct.new body: client_result.to_json - - call_options = {} - - # Create request parameters for a unary method. - name = "hello world" - etag = "hello world" - validate_only = true - request_id = "hello world" - - delete_tenant_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| - assert options.metadata.key? :"x-goog-api-client" - assert options.metadata[:"x-goog-api-client"].include? "rest" - refute options.metadata[:"x-goog-api-client"].include? "grpc" - end - - ::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::SaasDeployments::Rest::ServiceStub.stub :transcode_delete_tenant_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, delete_tenant_client_stub do - # Create client - client = ::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::SaasDeployments::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - client.delete_tenant({ name: name, etag: etag, validate_only: validate_only, request_id: request_id }) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use named arguments - client.delete_tenant name: name, etag: etag, validate_only: validate_only, request_id: request_id do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object - client.delete_tenant ::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::DeleteTenantRequest.new(name: name, etag: etag, validate_only: validate_only, request_id: request_id) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use hash object with options - client.delete_tenant({ name: name, etag: etag, validate_only: validate_only, request_id: request_id }, call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object with options - client.delete_tenant(::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::DeleteTenantRequest.new(name: name, etag: etag, validate_only: validate_only, request_id: request_id), call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Verify method calls - assert_equal 5, delete_tenant_client_stub.call_count - end - end - end - - def test_list_unit_kinds - # Create test objects. - client_result = ::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::ListUnitKindsResponse.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" - order_by = "hello world" - - list_unit_kinds_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| - assert options.metadata.key? :"x-goog-api-client" - assert options.metadata[:"x-goog-api-client"].include? "rest" - refute options.metadata[:"x-goog-api-client"].include? "grpc" - end - - ::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::SaasDeployments::Rest::ServiceStub.stub :transcode_list_unit_kinds_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, list_unit_kinds_client_stub do - # Create client - client = ::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::SaasDeployments::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - client.list_unit_kinds({ parent: parent, page_size: page_size, page_token: page_token, filter: filter, order_by: order_by }) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use named arguments - client.list_unit_kinds parent: parent, page_size: page_size, page_token: page_token, filter: filter, order_by: order_by do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object - client.list_unit_kinds ::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::ListUnitKindsRequest.new(parent: parent, page_size: page_size, page_token: page_token, filter: filter, order_by: order_by) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use hash object with options - client.list_unit_kinds({ parent: parent, page_size: page_size, page_token: page_token, filter: filter, order_by: order_by }, call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object with options - client.list_unit_kinds(::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::ListUnitKindsRequest.new(parent: parent, page_size: page_size, page_token: page_token, filter: filter, order_by: order_by), call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Verify method calls - assert_equal 5, list_unit_kinds_client_stub.call_count - end - end - end - - def test_get_unit_kind - # Create test objects. - client_result = ::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::UnitKind.new - http_response = OpenStruct.new body: client_result.to_json - - call_options = {} - - # Create request parameters for a unary method. - name = "hello world" - - get_unit_kind_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| - assert options.metadata.key? :"x-goog-api-client" - assert options.metadata[:"x-goog-api-client"].include? "rest" - refute options.metadata[:"x-goog-api-client"].include? "grpc" - end - - ::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::SaasDeployments::Rest::ServiceStub.stub :transcode_get_unit_kind_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, get_unit_kind_client_stub do - # Create client - client = ::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::SaasDeployments::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - client.get_unit_kind({ name: name }) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use named arguments - client.get_unit_kind name: name do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object - client.get_unit_kind ::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::GetUnitKindRequest.new(name: name) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use hash object with options - client.get_unit_kind({ name: name }, call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object with options - client.get_unit_kind(::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::GetUnitKindRequest.new(name: name), call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Verify method calls - assert_equal 5, get_unit_kind_client_stub.call_count - end - end - end - - def test_create_unit_kind - # Create test objects. - client_result = ::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::UnitKind.new - http_response = OpenStruct.new body: client_result.to_json - - call_options = {} - - # Create request parameters for a unary method. - parent = "hello world" - unit_kind_id = "hello world" - unit_kind = {} - validate_only = true - request_id = "hello world" - - create_unit_kind_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| - assert options.metadata.key? :"x-goog-api-client" - assert options.metadata[:"x-goog-api-client"].include? "rest" - refute options.metadata[:"x-goog-api-client"].include? "grpc" - end - - ::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::SaasDeployments::Rest::ServiceStub.stub :transcode_create_unit_kind_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, create_unit_kind_client_stub do - # Create client - client = ::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::SaasDeployments::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - client.create_unit_kind({ parent: parent, unit_kind_id: unit_kind_id, unit_kind: unit_kind, validate_only: validate_only, request_id: request_id }) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use named arguments - client.create_unit_kind parent: parent, unit_kind_id: unit_kind_id, unit_kind: unit_kind, validate_only: validate_only, request_id: request_id do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object - client.create_unit_kind ::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::CreateUnitKindRequest.new(parent: parent, unit_kind_id: unit_kind_id, unit_kind: unit_kind, validate_only: validate_only, request_id: request_id) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use hash object with options - client.create_unit_kind({ parent: parent, unit_kind_id: unit_kind_id, unit_kind: unit_kind, validate_only: validate_only, request_id: request_id }, call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object with options - client.create_unit_kind(::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::CreateUnitKindRequest.new(parent: parent, unit_kind_id: unit_kind_id, unit_kind: unit_kind, validate_only: validate_only, request_id: request_id), call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Verify method calls - assert_equal 5, create_unit_kind_client_stub.call_count - end - end - end - - def test_update_unit_kind - # Create test objects. - client_result = ::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::UnitKind.new - http_response = OpenStruct.new body: client_result.to_json - - call_options = {} - - # Create request parameters for a unary method. - unit_kind = {} - validate_only = true - request_id = "hello world" - update_mask = {} - - update_unit_kind_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| - assert options.metadata.key? :"x-goog-api-client" - assert options.metadata[:"x-goog-api-client"].include? "rest" - refute options.metadata[:"x-goog-api-client"].include? "grpc" - end - - ::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::SaasDeployments::Rest::ServiceStub.stub :transcode_update_unit_kind_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, update_unit_kind_client_stub do - # Create client - client = ::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::SaasDeployments::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - client.update_unit_kind({ unit_kind: unit_kind, validate_only: validate_only, request_id: request_id, update_mask: update_mask }) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use named arguments - client.update_unit_kind unit_kind: unit_kind, validate_only: validate_only, request_id: request_id, update_mask: update_mask do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object - client.update_unit_kind ::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::UpdateUnitKindRequest.new(unit_kind: unit_kind, validate_only: validate_only, request_id: request_id, update_mask: update_mask) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use hash object with options - client.update_unit_kind({ unit_kind: unit_kind, validate_only: validate_only, request_id: request_id, update_mask: update_mask }, call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object with options - client.update_unit_kind(::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::UpdateUnitKindRequest.new(unit_kind: unit_kind, validate_only: validate_only, request_id: request_id, update_mask: update_mask), call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Verify method calls - assert_equal 5, update_unit_kind_client_stub.call_count - end - end - end - - def test_delete_unit_kind - # Create test objects. - client_result = ::Google::Protobuf::Empty.new - http_response = OpenStruct.new body: client_result.to_json - - call_options = {} - - # Create request parameters for a unary method. - name = "hello world" - etag = "hello world" - validate_only = true - request_id = "hello world" - - delete_unit_kind_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| - assert options.metadata.key? :"x-goog-api-client" - assert options.metadata[:"x-goog-api-client"].include? "rest" - refute options.metadata[:"x-goog-api-client"].include? "grpc" - end - - ::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::SaasDeployments::Rest::ServiceStub.stub :transcode_delete_unit_kind_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, delete_unit_kind_client_stub do - # Create client - client = ::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::SaasDeployments::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - client.delete_unit_kind({ name: name, etag: etag, validate_only: validate_only, request_id: request_id }) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use named arguments - client.delete_unit_kind name: name, etag: etag, validate_only: validate_only, request_id: request_id do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object - client.delete_unit_kind ::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::DeleteUnitKindRequest.new(name: name, etag: etag, validate_only: validate_only, request_id: request_id) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use hash object with options - client.delete_unit_kind({ name: name, etag: etag, validate_only: validate_only, request_id: request_id }, call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object with options - client.delete_unit_kind(::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::DeleteUnitKindRequest.new(name: name, etag: etag, validate_only: validate_only, request_id: request_id), call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Verify method calls - assert_equal 5, delete_unit_kind_client_stub.call_count - end - end - end - - def test_list_units - # Create test objects. - client_result = ::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::ListUnitsResponse.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" - order_by = "hello world" - - list_units_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| - assert options.metadata.key? :"x-goog-api-client" - assert options.metadata[:"x-goog-api-client"].include? "rest" - refute options.metadata[:"x-goog-api-client"].include? "grpc" - end - - ::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::SaasDeployments::Rest::ServiceStub.stub :transcode_list_units_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, list_units_client_stub do - # Create client - client = ::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::SaasDeployments::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - client.list_units({ parent: parent, page_size: page_size, page_token: page_token, filter: filter, order_by: order_by }) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use named arguments - client.list_units parent: parent, page_size: page_size, page_token: page_token, filter: filter, order_by: order_by do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object - client.list_units ::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::ListUnitsRequest.new(parent: parent, page_size: page_size, page_token: page_token, filter: filter, order_by: order_by) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use hash object with options - client.list_units({ parent: parent, page_size: page_size, page_token: page_token, filter: filter, order_by: order_by }, call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object with options - client.list_units(::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::ListUnitsRequest.new(parent: parent, page_size: page_size, page_token: page_token, filter: filter, order_by: order_by), call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Verify method calls - assert_equal 5, list_units_client_stub.call_count - end - end - end - - def test_get_unit - # Create test objects. - client_result = ::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::Unit.new - http_response = OpenStruct.new body: client_result.to_json - - call_options = {} - - # Create request parameters for a unary method. - name = "hello world" - - get_unit_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| - assert options.metadata.key? :"x-goog-api-client" - assert options.metadata[:"x-goog-api-client"].include? "rest" - refute options.metadata[:"x-goog-api-client"].include? "grpc" - end - - ::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::SaasDeployments::Rest::ServiceStub.stub :transcode_get_unit_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, get_unit_client_stub do - # Create client - client = ::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::SaasDeployments::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - client.get_unit({ name: name }) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use named arguments - client.get_unit name: name do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object - client.get_unit ::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::GetUnitRequest.new(name: name) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use hash object with options - client.get_unit({ name: name }, call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object with options - client.get_unit(::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::GetUnitRequest.new(name: name), call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Verify method calls - assert_equal 5, get_unit_client_stub.call_count - end - end - end - - def test_create_unit - # Create test objects. - client_result = ::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::Unit.new - http_response = OpenStruct.new body: client_result.to_json - - call_options = {} - - # Create request parameters for a unary method. - parent = "hello world" - unit_id = "hello world" - unit = {} - validate_only = true - request_id = "hello world" - - create_unit_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| - assert options.metadata.key? :"x-goog-api-client" - assert options.metadata[:"x-goog-api-client"].include? "rest" - refute options.metadata[:"x-goog-api-client"].include? "grpc" - end - - ::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::SaasDeployments::Rest::ServiceStub.stub :transcode_create_unit_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, create_unit_client_stub do - # Create client - client = ::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::SaasDeployments::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - client.create_unit({ parent: parent, unit_id: unit_id, unit: unit, validate_only: validate_only, request_id: request_id }) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use named arguments - client.create_unit parent: parent, unit_id: unit_id, unit: unit, validate_only: validate_only, request_id: request_id do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object - client.create_unit ::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::CreateUnitRequest.new(parent: parent, unit_id: unit_id, unit: unit, validate_only: validate_only, request_id: request_id) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use hash object with options - client.create_unit({ parent: parent, unit_id: unit_id, unit: unit, validate_only: validate_only, request_id: request_id }, call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object with options - client.create_unit(::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::CreateUnitRequest.new(parent: parent, unit_id: unit_id, unit: unit, validate_only: validate_only, request_id: request_id), call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Verify method calls - assert_equal 5, create_unit_client_stub.call_count - end - end - end - - def test_update_unit - # Create test objects. - client_result = ::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::Unit.new - http_response = OpenStruct.new body: client_result.to_json - - call_options = {} - - # Create request parameters for a unary method. - unit = {} - validate_only = true - request_id = "hello world" - update_mask = {} - - update_unit_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| - assert options.metadata.key? :"x-goog-api-client" - assert options.metadata[:"x-goog-api-client"].include? "rest" - refute options.metadata[:"x-goog-api-client"].include? "grpc" - end - - ::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::SaasDeployments::Rest::ServiceStub.stub :transcode_update_unit_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, update_unit_client_stub do - # Create client - client = ::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::SaasDeployments::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - client.update_unit({ unit: unit, validate_only: validate_only, request_id: request_id, update_mask: update_mask }) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use named arguments - client.update_unit unit: unit, validate_only: validate_only, request_id: request_id, update_mask: update_mask do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object - client.update_unit ::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::UpdateUnitRequest.new(unit: unit, validate_only: validate_only, request_id: request_id, update_mask: update_mask) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use hash object with options - client.update_unit({ unit: unit, validate_only: validate_only, request_id: request_id, update_mask: update_mask }, call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object with options - client.update_unit(::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::UpdateUnitRequest.new(unit: unit, validate_only: validate_only, request_id: request_id, update_mask: update_mask), call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Verify method calls - assert_equal 5, update_unit_client_stub.call_count - end - end - end - - def test_delete_unit - # Create test objects. - client_result = ::Google::Protobuf::Empty.new - http_response = OpenStruct.new body: client_result.to_json - - call_options = {} - - # Create request parameters for a unary method. - name = "hello world" - etag = "hello world" - validate_only = true - request_id = "hello world" - - delete_unit_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| - assert options.metadata.key? :"x-goog-api-client" - assert options.metadata[:"x-goog-api-client"].include? "rest" - refute options.metadata[:"x-goog-api-client"].include? "grpc" - end - - ::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::SaasDeployments::Rest::ServiceStub.stub :transcode_delete_unit_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, delete_unit_client_stub do - # Create client - client = ::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::SaasDeployments::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - client.delete_unit({ name: name, etag: etag, validate_only: validate_only, request_id: request_id }) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use named arguments - client.delete_unit name: name, etag: etag, validate_only: validate_only, request_id: request_id do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object - client.delete_unit ::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::DeleteUnitRequest.new(name: name, etag: etag, validate_only: validate_only, request_id: request_id) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use hash object with options - client.delete_unit({ name: name, etag: etag, validate_only: validate_only, request_id: request_id }, call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object with options - client.delete_unit(::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::DeleteUnitRequest.new(name: name, etag: etag, validate_only: validate_only, request_id: request_id), call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Verify method calls - assert_equal 5, delete_unit_client_stub.call_count - end - end - end - - def test_list_unit_operations - # Create test objects. - client_result = ::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::ListUnitOperationsResponse.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" - order_by = "hello world" - - list_unit_operations_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| - assert options.metadata.key? :"x-goog-api-client" - assert options.metadata[:"x-goog-api-client"].include? "rest" - refute options.metadata[:"x-goog-api-client"].include? "grpc" - end - - ::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::SaasDeployments::Rest::ServiceStub.stub :transcode_list_unit_operations_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, list_unit_operations_client_stub do - # Create client - client = ::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::SaasDeployments::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - client.list_unit_operations({ parent: parent, page_size: page_size, page_token: page_token, filter: filter, order_by: order_by }) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use named arguments - client.list_unit_operations parent: parent, page_size: page_size, page_token: page_token, filter: filter, order_by: order_by do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object - client.list_unit_operations ::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::ListUnitOperationsRequest.new(parent: parent, page_size: page_size, page_token: page_token, filter: filter, order_by: order_by) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use hash object with options - client.list_unit_operations({ parent: parent, page_size: page_size, page_token: page_token, filter: filter, order_by: order_by }, call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object with options - client.list_unit_operations(::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::ListUnitOperationsRequest.new(parent: parent, page_size: page_size, page_token: page_token, filter: filter, order_by: order_by), call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Verify method calls - assert_equal 5, list_unit_operations_client_stub.call_count - end - end - end - - def test_get_unit_operation - # Create test objects. - client_result = ::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::UnitOperation.new - http_response = OpenStruct.new body: client_result.to_json - - call_options = {} - - # Create request parameters for a unary method. - name = "hello world" - - get_unit_operation_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| - assert options.metadata.key? :"x-goog-api-client" - assert options.metadata[:"x-goog-api-client"].include? "rest" - refute options.metadata[:"x-goog-api-client"].include? "grpc" - end - - ::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::SaasDeployments::Rest::ServiceStub.stub :transcode_get_unit_operation_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, get_unit_operation_client_stub do - # Create client - client = ::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::SaasDeployments::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - client.get_unit_operation({ name: name }) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use named arguments - client.get_unit_operation name: name do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object - client.get_unit_operation ::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::GetUnitOperationRequest.new(name: name) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use hash object with options - client.get_unit_operation({ name: name }, call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object with options - client.get_unit_operation(::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::GetUnitOperationRequest.new(name: name), call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Verify method calls - assert_equal 5, get_unit_operation_client_stub.call_count - end - end - end - - def test_create_unit_operation - # Create test objects. - client_result = ::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::UnitOperation.new - http_response = OpenStruct.new body: client_result.to_json - - call_options = {} - - # Create request parameters for a unary method. - parent = "hello world" - unit_operation_id = "hello world" - unit_operation = {} - validate_only = true - request_id = "hello world" - - create_unit_operation_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| - assert options.metadata.key? :"x-goog-api-client" - assert options.metadata[:"x-goog-api-client"].include? "rest" - refute options.metadata[:"x-goog-api-client"].include? "grpc" - end - - ::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::SaasDeployments::Rest::ServiceStub.stub :transcode_create_unit_operation_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, create_unit_operation_client_stub do - # Create client - client = ::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::SaasDeployments::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - client.create_unit_operation({ parent: parent, unit_operation_id: unit_operation_id, unit_operation: unit_operation, validate_only: validate_only, request_id: request_id }) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use named arguments - client.create_unit_operation parent: parent, unit_operation_id: unit_operation_id, unit_operation: unit_operation, validate_only: validate_only, request_id: request_id do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object - client.create_unit_operation ::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::CreateUnitOperationRequest.new(parent: parent, unit_operation_id: unit_operation_id, unit_operation: unit_operation, validate_only: validate_only, request_id: request_id) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use hash object with options - client.create_unit_operation({ parent: parent, unit_operation_id: unit_operation_id, unit_operation: unit_operation, validate_only: validate_only, request_id: request_id }, call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object with options - client.create_unit_operation(::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::CreateUnitOperationRequest.new(parent: parent, unit_operation_id: unit_operation_id, unit_operation: unit_operation, validate_only: validate_only, request_id: request_id), call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Verify method calls - assert_equal 5, create_unit_operation_client_stub.call_count - end - end - end - - def test_update_unit_operation - # Create test objects. - client_result = ::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::UnitOperation.new - http_response = OpenStruct.new body: client_result.to_json - - call_options = {} - - # Create request parameters for a unary method. - unit_operation = {} - validate_only = true - request_id = "hello world" - update_mask = {} - - update_unit_operation_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| - assert options.metadata.key? :"x-goog-api-client" - assert options.metadata[:"x-goog-api-client"].include? "rest" - refute options.metadata[:"x-goog-api-client"].include? "grpc" - end - - ::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::SaasDeployments::Rest::ServiceStub.stub :transcode_update_unit_operation_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, update_unit_operation_client_stub do - # Create client - client = ::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::SaasDeployments::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - client.update_unit_operation({ unit_operation: unit_operation, validate_only: validate_only, request_id: request_id, update_mask: update_mask }) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use named arguments - client.update_unit_operation unit_operation: unit_operation, validate_only: validate_only, request_id: request_id, update_mask: update_mask do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object - client.update_unit_operation ::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::UpdateUnitOperationRequest.new(unit_operation: unit_operation, validate_only: validate_only, request_id: request_id, update_mask: update_mask) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use hash object with options - client.update_unit_operation({ unit_operation: unit_operation, validate_only: validate_only, request_id: request_id, update_mask: update_mask }, call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object with options - client.update_unit_operation(::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::UpdateUnitOperationRequest.new(unit_operation: unit_operation, validate_only: validate_only, request_id: request_id, update_mask: update_mask), call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Verify method calls - assert_equal 5, update_unit_operation_client_stub.call_count - end - end - end - - def test_delete_unit_operation - # Create test objects. - client_result = ::Google::Protobuf::Empty.new - http_response = OpenStruct.new body: client_result.to_json - - call_options = {} - - # Create request parameters for a unary method. - name = "hello world" - etag = "hello world" - validate_only = true - request_id = "hello world" - - delete_unit_operation_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| - assert options.metadata.key? :"x-goog-api-client" - assert options.metadata[:"x-goog-api-client"].include? "rest" - refute options.metadata[:"x-goog-api-client"].include? "grpc" - end - - ::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::SaasDeployments::Rest::ServiceStub.stub :transcode_delete_unit_operation_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, delete_unit_operation_client_stub do - # Create client - client = ::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::SaasDeployments::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - client.delete_unit_operation({ name: name, etag: etag, validate_only: validate_only, request_id: request_id }) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use named arguments - client.delete_unit_operation name: name, etag: etag, validate_only: validate_only, request_id: request_id do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object - client.delete_unit_operation ::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::DeleteUnitOperationRequest.new(name: name, etag: etag, validate_only: validate_only, request_id: request_id) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use hash object with options - client.delete_unit_operation({ name: name, etag: etag, validate_only: validate_only, request_id: request_id }, call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object with options - client.delete_unit_operation(::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::DeleteUnitOperationRequest.new(name: name, etag: etag, validate_only: validate_only, request_id: request_id), call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Verify method calls - assert_equal 5, delete_unit_operation_client_stub.call_count - end - end - end - - def test_list_releases - # Create test objects. - client_result = ::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::ListReleasesResponse.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" - order_by = "hello world" - - list_releases_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| - assert options.metadata.key? :"x-goog-api-client" - assert options.metadata[:"x-goog-api-client"].include? "rest" - refute options.metadata[:"x-goog-api-client"].include? "grpc" - end - - ::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::SaasDeployments::Rest::ServiceStub.stub :transcode_list_releases_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, list_releases_client_stub do - # Create client - client = ::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::SaasDeployments::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - client.list_releases({ parent: parent, page_size: page_size, page_token: page_token, filter: filter, order_by: order_by }) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use named arguments - client.list_releases parent: parent, page_size: page_size, page_token: page_token, filter: filter, order_by: order_by do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object - client.list_releases ::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::ListReleasesRequest.new(parent: parent, page_size: page_size, page_token: page_token, filter: filter, order_by: order_by) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use hash object with options - client.list_releases({ parent: parent, page_size: page_size, page_token: page_token, filter: filter, order_by: order_by }, call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object with options - client.list_releases(::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::ListReleasesRequest.new(parent: parent, page_size: page_size, page_token: page_token, filter: filter, order_by: order_by), call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Verify method calls - assert_equal 5, list_releases_client_stub.call_count - end - end - end - - def test_get_release - # Create test objects. - client_result = ::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::Release.new - http_response = OpenStruct.new body: client_result.to_json - - call_options = {} - - # Create request parameters for a unary method. - name = "hello world" - - get_release_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| - assert options.metadata.key? :"x-goog-api-client" - assert options.metadata[:"x-goog-api-client"].include? "rest" - refute options.metadata[:"x-goog-api-client"].include? "grpc" - end - - ::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::SaasDeployments::Rest::ServiceStub.stub :transcode_get_release_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, get_release_client_stub do - # Create client - client = ::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::SaasDeployments::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - client.get_release({ name: name }) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use named arguments - client.get_release name: name do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object - client.get_release ::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::GetReleaseRequest.new(name: name) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use hash object with options - client.get_release({ name: name }, call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object with options - client.get_release(::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::GetReleaseRequest.new(name: name), call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Verify method calls - assert_equal 5, get_release_client_stub.call_count - end - end - end - - def test_create_release - # Create test objects. - client_result = ::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::Release.new - http_response = OpenStruct.new body: client_result.to_json - - call_options = {} - - # Create request parameters for a unary method. - parent = "hello world" - release_id = "hello world" - release = {} - validate_only = true - request_id = "hello world" - - create_release_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| - assert options.metadata.key? :"x-goog-api-client" - assert options.metadata[:"x-goog-api-client"].include? "rest" - refute options.metadata[:"x-goog-api-client"].include? "grpc" - end - - ::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::SaasDeployments::Rest::ServiceStub.stub :transcode_create_release_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, create_release_client_stub do - # Create client - client = ::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::SaasDeployments::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - client.create_release({ parent: parent, release_id: release_id, release: release, validate_only: validate_only, request_id: request_id }) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use named arguments - client.create_release parent: parent, release_id: release_id, release: release, validate_only: validate_only, request_id: request_id do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object - client.create_release ::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::CreateReleaseRequest.new(parent: parent, release_id: release_id, release: release, validate_only: validate_only, request_id: request_id) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use hash object with options - client.create_release({ parent: parent, release_id: release_id, release: release, validate_only: validate_only, request_id: request_id }, call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object with options - client.create_release(::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::CreateReleaseRequest.new(parent: parent, release_id: release_id, release: release, validate_only: validate_only, request_id: request_id), call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Verify method calls - assert_equal 5, create_release_client_stub.call_count - end - end - end - - def test_update_release - # Create test objects. - client_result = ::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::Release.new - http_response = OpenStruct.new body: client_result.to_json - - call_options = {} - - # Create request parameters for a unary method. - release = {} - validate_only = true - request_id = "hello world" - update_mask = {} - - update_release_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| - assert options.metadata.key? :"x-goog-api-client" - assert options.metadata[:"x-goog-api-client"].include? "rest" - refute options.metadata[:"x-goog-api-client"].include? "grpc" - end - - ::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::SaasDeployments::Rest::ServiceStub.stub :transcode_update_release_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, update_release_client_stub do - # Create client - client = ::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::SaasDeployments::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - client.update_release({ release: release, validate_only: validate_only, request_id: request_id, update_mask: update_mask }) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use named arguments - client.update_release release: release, validate_only: validate_only, request_id: request_id, update_mask: update_mask do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object - client.update_release ::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::UpdateReleaseRequest.new(release: release, validate_only: validate_only, request_id: request_id, update_mask: update_mask) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use hash object with options - client.update_release({ release: release, validate_only: validate_only, request_id: request_id, update_mask: update_mask }, call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object with options - client.update_release(::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::UpdateReleaseRequest.new(release: release, validate_only: validate_only, request_id: request_id, update_mask: update_mask), call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Verify method calls - assert_equal 5, update_release_client_stub.call_count - end - end - end - - def test_delete_release - # Create test objects. - client_result = ::Google::Protobuf::Empty.new - http_response = OpenStruct.new body: client_result.to_json - - call_options = {} - - # Create request parameters for a unary method. - name = "hello world" - etag = "hello world" - validate_only = true - request_id = "hello world" - - delete_release_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| - assert options.metadata.key? :"x-goog-api-client" - assert options.metadata[:"x-goog-api-client"].include? "rest" - refute options.metadata[:"x-goog-api-client"].include? "grpc" - end - - ::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::SaasDeployments::Rest::ServiceStub.stub :transcode_delete_release_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, delete_release_client_stub do - # Create client - client = ::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::SaasDeployments::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - client.delete_release({ name: name, etag: etag, validate_only: validate_only, request_id: request_id }) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use named arguments - client.delete_release name: name, etag: etag, validate_only: validate_only, request_id: request_id do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object - client.delete_release ::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::DeleteReleaseRequest.new(name: name, etag: etag, validate_only: validate_only, request_id: request_id) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use hash object with options - client.delete_release({ name: name, etag: etag, validate_only: validate_only, request_id: request_id }, call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object with options - client.delete_release(::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::DeleteReleaseRequest.new(name: name, etag: etag, validate_only: validate_only, request_id: request_id), call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Verify method calls - assert_equal 5, delete_release_client_stub.call_count - end - end - end - - def test_configure - credentials_token = :dummy_value - - client = block_config = config = nil - dummy_stub = ClientStub.new nil - Gapic::Rest::ClientStub.stub :new, dummy_stub do - client = ::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::SaasDeployments::Rest::Client.new do |config| - config.credentials = credentials_token - end - end - - config = client.configure do |c| - block_config = c - end - - assert_same block_config, config - assert_kind_of ::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::SaasDeployments::Rest::Client::Configuration, config - end -end diff --git a/owl-bot-staging/google-cloud-saas_platform-saas_service_mgmt-v1beta1/test/google/cloud/saas_platform/saas_service_mgmt/v1beta1/saas_deployments_test.rb b/owl-bot-staging/google-cloud-saas_platform-saas_service_mgmt-v1beta1/test/google/cloud/saas_platform/saas_service_mgmt/v1beta1/saas_deployments_test.rb deleted file mode 100644 index 17a118efd092..000000000000 --- a/owl-bot-staging/google-cloud-saas_platform-saas_service_mgmt-v1beta1/test/google/cloud/saas_platform/saas_service_mgmt/v1beta1/saas_deployments_test.rb +++ /dev/null @@ -1,2042 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -require "helper" - -require "gapic/grpc/service_stub" - -require "google/cloud/saasplatform/saasservicemgmt/v1beta1/deployments_service_pb" -require "google/cloud/saas_platform/saas_service_mgmt/v1beta1/saas_deployments" - -class ::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::SaasDeployments::ClientTest < Minitest::Test - class ClientStub - attr_accessor :call_rpc_count, :requests - - def initialize response, operation, &block - @response = response - @operation = operation - @block = block - @call_rpc_count = 0 - @requests = [] - end - - def call_rpc *args, **kwargs - @call_rpc_count += 1 - - @requests << @block&.call(*args, **kwargs) - - catch :response do - yield @response, @operation if block_given? - @response - end - end - - def endpoint - "endpoint.example.com" - end - - def universe_domain - "example.com" - end - - def stub_logger - nil - end - - def logger - nil - end - end - - def test_list_saas - # Create GRPC objects. - grpc_response = ::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::ListSaasResponse.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" - order_by = "hello world" - - list_saas_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :list_saas, name - assert_kind_of ::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::ListSaasRequest, 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"] - assert_equal "hello world", request["order_by"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, list_saas_client_stub do - # Create client - client = ::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::SaasDeployments::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.list_saas({ parent: parent, page_size: page_size, page_token: page_token, filter: filter, order_by: order_by }) 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_saas parent: parent, page_size: page_size, page_token: page_token, filter: filter, order_by: order_by 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_saas ::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::ListSaasRequest.new(parent: parent, page_size: page_size, page_token: page_token, filter: filter, order_by: order_by) 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_saas({ parent: parent, page_size: page_size, page_token: page_token, filter: filter, order_by: order_by }, 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_saas(::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::ListSaasRequest.new(parent: parent, page_size: page_size, page_token: page_token, filter: filter, order_by: order_by), 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_saas_client_stub.call_rpc_count - end - end - - def test_get_saas - # Create GRPC objects. - grpc_response = ::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::Saas.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_saas_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :get_saas, name - assert_kind_of ::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::GetSaasRequest, request - assert_equal "hello world", request["name"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, get_saas_client_stub do - # Create client - client = ::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::SaasDeployments::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.get_saas({ name: name }) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use named arguments - client.get_saas name: name do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object - client.get_saas ::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::GetSaasRequest.new(name: name) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use hash object with options - client.get_saas({ 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_saas(::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::GetSaasRequest.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_saas_client_stub.call_rpc_count - end - end - - def test_create_saas - # Create GRPC objects. - grpc_response = ::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::Saas.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" - saas_id = "hello world" - saas = {} - validate_only = true - request_id = "hello world" - - create_saas_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :create_saas, name - assert_kind_of ::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::CreateSaasRequest, request - assert_equal "hello world", request["parent"] - assert_equal "hello world", request["saas_id"] - assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::Saas), request["saas"] - assert_equal true, request["validate_only"] - assert_equal "hello world", request["request_id"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, create_saas_client_stub do - # Create client - client = ::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::SaasDeployments::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.create_saas({ parent: parent, saas_id: saas_id, saas: saas, validate_only: validate_only, request_id: request_id }) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use named arguments - client.create_saas parent: parent, saas_id: saas_id, saas: saas, validate_only: validate_only, request_id: request_id do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object - client.create_saas ::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::CreateSaasRequest.new(parent: parent, saas_id: saas_id, saas: saas, validate_only: validate_only, request_id: request_id) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use hash object with options - client.create_saas({ parent: parent, saas_id: saas_id, saas: saas, validate_only: validate_only, request_id: request_id }, grpc_options) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object with options - client.create_saas(::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::CreateSaasRequest.new(parent: parent, saas_id: saas_id, saas: saas, validate_only: validate_only, request_id: request_id), grpc_options) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Verify method calls - assert_equal 5, create_saas_client_stub.call_rpc_count - end - end - - def test_update_saas - # Create GRPC objects. - grpc_response = ::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::Saas.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. - saas = {} - validate_only = true - request_id = "hello world" - update_mask = {} - - update_saas_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :update_saas, name - assert_kind_of ::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::UpdateSaasRequest, request - assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::Saas), request["saas"] - assert_equal true, request["validate_only"] - assert_equal "hello world", request["request_id"] - assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Protobuf::FieldMask), request["update_mask"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, update_saas_client_stub do - # Create client - client = ::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::SaasDeployments::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.update_saas({ saas: saas, validate_only: validate_only, request_id: request_id, update_mask: update_mask }) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use named arguments - client.update_saas saas: saas, validate_only: validate_only, request_id: request_id, update_mask: update_mask do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object - client.update_saas ::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::UpdateSaasRequest.new(saas: saas, validate_only: validate_only, request_id: request_id, update_mask: update_mask) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use hash object with options - client.update_saas({ saas: saas, validate_only: validate_only, request_id: request_id, update_mask: update_mask }, grpc_options) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object with options - client.update_saas(::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::UpdateSaasRequest.new(saas: saas, validate_only: validate_only, request_id: request_id, update_mask: update_mask), grpc_options) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Verify method calls - assert_equal 5, update_saas_client_stub.call_rpc_count - end - end - - def test_delete_saas - # Create GRPC objects. - grpc_response = ::Google::Protobuf::Empty.new - grpc_operation = GRPC::ActiveCall::Operation.new nil - grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - grpc_options = {} - - # Create request parameters for a unary method. - name = "hello world" - etag = "hello world" - validate_only = true - request_id = "hello world" - - delete_saas_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :delete_saas, name - assert_kind_of ::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::DeleteSaasRequest, request - assert_equal "hello world", request["name"] - assert_equal "hello world", request["etag"] - assert_equal true, request["validate_only"] - assert_equal "hello world", request["request_id"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, delete_saas_client_stub do - # Create client - client = ::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::SaasDeployments::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.delete_saas({ name: name, etag: etag, validate_only: validate_only, request_id: request_id }) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use named arguments - client.delete_saas name: name, etag: etag, validate_only: validate_only, request_id: request_id do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object - client.delete_saas ::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::DeleteSaasRequest.new(name: name, etag: etag, validate_only: validate_only, request_id: request_id) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use hash object with options - client.delete_saas({ name: name, etag: etag, validate_only: validate_only, request_id: request_id }, grpc_options) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object with options - client.delete_saas(::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::DeleteSaasRequest.new(name: name, etag: etag, validate_only: validate_only, request_id: request_id), grpc_options) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Verify method calls - assert_equal 5, delete_saas_client_stub.call_rpc_count - end - end - - def test_list_tenants - # Create GRPC objects. - grpc_response = ::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::ListTenantsResponse.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" - order_by = "hello world" - - list_tenants_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :list_tenants, name - assert_kind_of ::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::ListTenantsRequest, 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"] - assert_equal "hello world", request["order_by"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, list_tenants_client_stub do - # Create client - client = ::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::SaasDeployments::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.list_tenants({ parent: parent, page_size: page_size, page_token: page_token, filter: filter, order_by: order_by }) 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_tenants parent: parent, page_size: page_size, page_token: page_token, filter: filter, order_by: order_by 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_tenants ::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::ListTenantsRequest.new(parent: parent, page_size: page_size, page_token: page_token, filter: filter, order_by: order_by) 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_tenants({ parent: parent, page_size: page_size, page_token: page_token, filter: filter, order_by: order_by }, 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_tenants(::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::ListTenantsRequest.new(parent: parent, page_size: page_size, page_token: page_token, filter: filter, order_by: order_by), 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_tenants_client_stub.call_rpc_count - end - end - - def test_get_tenant - # Create GRPC objects. - grpc_response = ::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::Tenant.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_tenant_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :get_tenant, name - assert_kind_of ::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::GetTenantRequest, request - assert_equal "hello world", request["name"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, get_tenant_client_stub do - # Create client - client = ::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::SaasDeployments::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.get_tenant({ name: name }) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use named arguments - client.get_tenant name: name do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object - client.get_tenant ::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::GetTenantRequest.new(name: name) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use hash object with options - client.get_tenant({ 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_tenant(::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::GetTenantRequest.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_tenant_client_stub.call_rpc_count - end - end - - def test_create_tenant - # Create GRPC objects. - grpc_response = ::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::Tenant.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" - tenant_id = "hello world" - tenant = {} - validate_only = true - request_id = "hello world" - - create_tenant_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :create_tenant, name - assert_kind_of ::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::CreateTenantRequest, request - assert_equal "hello world", request["parent"] - assert_equal "hello world", request["tenant_id"] - assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::Tenant), request["tenant"] - assert_equal true, request["validate_only"] - assert_equal "hello world", request["request_id"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, create_tenant_client_stub do - # Create client - client = ::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::SaasDeployments::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.create_tenant({ parent: parent, tenant_id: tenant_id, tenant: tenant, validate_only: validate_only, request_id: request_id }) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use named arguments - client.create_tenant parent: parent, tenant_id: tenant_id, tenant: tenant, validate_only: validate_only, request_id: request_id do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object - client.create_tenant ::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::CreateTenantRequest.new(parent: parent, tenant_id: tenant_id, tenant: tenant, validate_only: validate_only, request_id: request_id) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use hash object with options - client.create_tenant({ parent: parent, tenant_id: tenant_id, tenant: tenant, validate_only: validate_only, request_id: request_id }, grpc_options) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object with options - client.create_tenant(::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::CreateTenantRequest.new(parent: parent, tenant_id: tenant_id, tenant: tenant, validate_only: validate_only, request_id: request_id), grpc_options) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Verify method calls - assert_equal 5, create_tenant_client_stub.call_rpc_count - end - end - - def test_update_tenant - # Create GRPC objects. - grpc_response = ::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::Tenant.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. - tenant = {} - validate_only = true - request_id = "hello world" - update_mask = {} - - update_tenant_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :update_tenant, name - assert_kind_of ::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::UpdateTenantRequest, request - assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::Tenant), request["tenant"] - assert_equal true, request["validate_only"] - assert_equal "hello world", request["request_id"] - assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Protobuf::FieldMask), request["update_mask"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, update_tenant_client_stub do - # Create client - client = ::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::SaasDeployments::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.update_tenant({ tenant: tenant, validate_only: validate_only, request_id: request_id, update_mask: update_mask }) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use named arguments - client.update_tenant tenant: tenant, validate_only: validate_only, request_id: request_id, update_mask: update_mask do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object - client.update_tenant ::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::UpdateTenantRequest.new(tenant: tenant, validate_only: validate_only, request_id: request_id, update_mask: update_mask) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use hash object with options - client.update_tenant({ tenant: tenant, validate_only: validate_only, request_id: request_id, update_mask: update_mask }, grpc_options) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object with options - client.update_tenant(::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::UpdateTenantRequest.new(tenant: tenant, validate_only: validate_only, request_id: request_id, update_mask: update_mask), grpc_options) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Verify method calls - assert_equal 5, update_tenant_client_stub.call_rpc_count - end - end - - def test_delete_tenant - # Create GRPC objects. - grpc_response = ::Google::Protobuf::Empty.new - grpc_operation = GRPC::ActiveCall::Operation.new nil - grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - grpc_options = {} - - # Create request parameters for a unary method. - name = "hello world" - etag = "hello world" - validate_only = true - request_id = "hello world" - - delete_tenant_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :delete_tenant, name - assert_kind_of ::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::DeleteTenantRequest, request - assert_equal "hello world", request["name"] - assert_equal "hello world", request["etag"] - assert_equal true, request["validate_only"] - assert_equal "hello world", request["request_id"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, delete_tenant_client_stub do - # Create client - client = ::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::SaasDeployments::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.delete_tenant({ name: name, etag: etag, validate_only: validate_only, request_id: request_id }) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use named arguments - client.delete_tenant name: name, etag: etag, validate_only: validate_only, request_id: request_id do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object - client.delete_tenant ::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::DeleteTenantRequest.new(name: name, etag: etag, validate_only: validate_only, request_id: request_id) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use hash object with options - client.delete_tenant({ name: name, etag: etag, validate_only: validate_only, request_id: request_id }, grpc_options) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object with options - client.delete_tenant(::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::DeleteTenantRequest.new(name: name, etag: etag, validate_only: validate_only, request_id: request_id), grpc_options) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Verify method calls - assert_equal 5, delete_tenant_client_stub.call_rpc_count - end - end - - def test_list_unit_kinds - # Create GRPC objects. - grpc_response = ::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::ListUnitKindsResponse.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" - order_by = "hello world" - - list_unit_kinds_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :list_unit_kinds, name - assert_kind_of ::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::ListUnitKindsRequest, 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"] - assert_equal "hello world", request["order_by"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, list_unit_kinds_client_stub do - # Create client - client = ::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::SaasDeployments::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.list_unit_kinds({ parent: parent, page_size: page_size, page_token: page_token, filter: filter, order_by: order_by }) 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_unit_kinds parent: parent, page_size: page_size, page_token: page_token, filter: filter, order_by: order_by 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_unit_kinds ::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::ListUnitKindsRequest.new(parent: parent, page_size: page_size, page_token: page_token, filter: filter, order_by: order_by) 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_unit_kinds({ parent: parent, page_size: page_size, page_token: page_token, filter: filter, order_by: order_by }, 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_unit_kinds(::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::ListUnitKindsRequest.new(parent: parent, page_size: page_size, page_token: page_token, filter: filter, order_by: order_by), 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_unit_kinds_client_stub.call_rpc_count - end - end - - def test_get_unit_kind - # Create GRPC objects. - grpc_response = ::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::UnitKind.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_unit_kind_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :get_unit_kind, name - assert_kind_of ::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::GetUnitKindRequest, request - assert_equal "hello world", request["name"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, get_unit_kind_client_stub do - # Create client - client = ::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::SaasDeployments::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.get_unit_kind({ name: name }) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use named arguments - client.get_unit_kind name: name do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object - client.get_unit_kind ::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::GetUnitKindRequest.new(name: name) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use hash object with options - client.get_unit_kind({ 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_unit_kind(::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::GetUnitKindRequest.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_unit_kind_client_stub.call_rpc_count - end - end - - def test_create_unit_kind - # Create GRPC objects. - grpc_response = ::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::UnitKind.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" - unit_kind_id = "hello world" - unit_kind = {} - validate_only = true - request_id = "hello world" - - create_unit_kind_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :create_unit_kind, name - assert_kind_of ::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::CreateUnitKindRequest, request - assert_equal "hello world", request["parent"] - assert_equal "hello world", request["unit_kind_id"] - assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::UnitKind), request["unit_kind"] - assert_equal true, request["validate_only"] - assert_equal "hello world", request["request_id"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, create_unit_kind_client_stub do - # Create client - client = ::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::SaasDeployments::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.create_unit_kind({ parent: parent, unit_kind_id: unit_kind_id, unit_kind: unit_kind, validate_only: validate_only, request_id: request_id }) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use named arguments - client.create_unit_kind parent: parent, unit_kind_id: unit_kind_id, unit_kind: unit_kind, validate_only: validate_only, request_id: request_id do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object - client.create_unit_kind ::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::CreateUnitKindRequest.new(parent: parent, unit_kind_id: unit_kind_id, unit_kind: unit_kind, validate_only: validate_only, request_id: request_id) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use hash object with options - client.create_unit_kind({ parent: parent, unit_kind_id: unit_kind_id, unit_kind: unit_kind, validate_only: validate_only, request_id: request_id }, grpc_options) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object with options - client.create_unit_kind(::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::CreateUnitKindRequest.new(parent: parent, unit_kind_id: unit_kind_id, unit_kind: unit_kind, validate_only: validate_only, request_id: request_id), grpc_options) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Verify method calls - assert_equal 5, create_unit_kind_client_stub.call_rpc_count - end - end - - def test_update_unit_kind - # Create GRPC objects. - grpc_response = ::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::UnitKind.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. - unit_kind = {} - validate_only = true - request_id = "hello world" - update_mask = {} - - update_unit_kind_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :update_unit_kind, name - assert_kind_of ::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::UpdateUnitKindRequest, request - assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::UnitKind), request["unit_kind"] - assert_equal true, request["validate_only"] - assert_equal "hello world", request["request_id"] - assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Protobuf::FieldMask), request["update_mask"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, update_unit_kind_client_stub do - # Create client - client = ::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::SaasDeployments::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.update_unit_kind({ unit_kind: unit_kind, validate_only: validate_only, request_id: request_id, update_mask: update_mask }) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use named arguments - client.update_unit_kind unit_kind: unit_kind, validate_only: validate_only, request_id: request_id, update_mask: update_mask do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object - client.update_unit_kind ::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::UpdateUnitKindRequest.new(unit_kind: unit_kind, validate_only: validate_only, request_id: request_id, update_mask: update_mask) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use hash object with options - client.update_unit_kind({ unit_kind: unit_kind, validate_only: validate_only, request_id: request_id, update_mask: update_mask }, grpc_options) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object with options - client.update_unit_kind(::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::UpdateUnitKindRequest.new(unit_kind: unit_kind, validate_only: validate_only, request_id: request_id, update_mask: update_mask), grpc_options) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Verify method calls - assert_equal 5, update_unit_kind_client_stub.call_rpc_count - end - end - - def test_delete_unit_kind - # Create GRPC objects. - grpc_response = ::Google::Protobuf::Empty.new - grpc_operation = GRPC::ActiveCall::Operation.new nil - grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - grpc_options = {} - - # Create request parameters for a unary method. - name = "hello world" - etag = "hello world" - validate_only = true - request_id = "hello world" - - delete_unit_kind_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :delete_unit_kind, name - assert_kind_of ::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::DeleteUnitKindRequest, request - assert_equal "hello world", request["name"] - assert_equal "hello world", request["etag"] - assert_equal true, request["validate_only"] - assert_equal "hello world", request["request_id"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, delete_unit_kind_client_stub do - # Create client - client = ::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::SaasDeployments::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.delete_unit_kind({ name: name, etag: etag, validate_only: validate_only, request_id: request_id }) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use named arguments - client.delete_unit_kind name: name, etag: etag, validate_only: validate_only, request_id: request_id do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object - client.delete_unit_kind ::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::DeleteUnitKindRequest.new(name: name, etag: etag, validate_only: validate_only, request_id: request_id) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use hash object with options - client.delete_unit_kind({ name: name, etag: etag, validate_only: validate_only, request_id: request_id }, grpc_options) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object with options - client.delete_unit_kind(::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::DeleteUnitKindRequest.new(name: name, etag: etag, validate_only: validate_only, request_id: request_id), grpc_options) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Verify method calls - assert_equal 5, delete_unit_kind_client_stub.call_rpc_count - end - end - - def test_list_units - # Create GRPC objects. - grpc_response = ::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::ListUnitsResponse.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" - order_by = "hello world" - - list_units_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :list_units, name - assert_kind_of ::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::ListUnitsRequest, 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"] - assert_equal "hello world", request["order_by"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, list_units_client_stub do - # Create client - client = ::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::SaasDeployments::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.list_units({ parent: parent, page_size: page_size, page_token: page_token, filter: filter, order_by: order_by }) 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_units parent: parent, page_size: page_size, page_token: page_token, filter: filter, order_by: order_by 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_units ::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::ListUnitsRequest.new(parent: parent, page_size: page_size, page_token: page_token, filter: filter, order_by: order_by) 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_units({ parent: parent, page_size: page_size, page_token: page_token, filter: filter, order_by: order_by }, 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_units(::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::ListUnitsRequest.new(parent: parent, page_size: page_size, page_token: page_token, filter: filter, order_by: order_by), 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_units_client_stub.call_rpc_count - end - end - - def test_get_unit - # Create GRPC objects. - grpc_response = ::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::Unit.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_unit_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :get_unit, name - assert_kind_of ::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::GetUnitRequest, request - assert_equal "hello world", request["name"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, get_unit_client_stub do - # Create client - client = ::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::SaasDeployments::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.get_unit({ name: name }) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use named arguments - client.get_unit name: name do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object - client.get_unit ::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::GetUnitRequest.new(name: name) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use hash object with options - client.get_unit({ 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_unit(::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::GetUnitRequest.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_unit_client_stub.call_rpc_count - end - end - - def test_create_unit - # Create GRPC objects. - grpc_response = ::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::Unit.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" - unit_id = "hello world" - unit = {} - validate_only = true - request_id = "hello world" - - create_unit_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :create_unit, name - assert_kind_of ::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::CreateUnitRequest, request - assert_equal "hello world", request["parent"] - assert_equal "hello world", request["unit_id"] - assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::Unit), request["unit"] - assert_equal true, request["validate_only"] - assert_equal "hello world", request["request_id"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, create_unit_client_stub do - # Create client - client = ::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::SaasDeployments::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.create_unit({ parent: parent, unit_id: unit_id, unit: unit, validate_only: validate_only, request_id: request_id }) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use named arguments - client.create_unit parent: parent, unit_id: unit_id, unit: unit, validate_only: validate_only, request_id: request_id do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object - client.create_unit ::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::CreateUnitRequest.new(parent: parent, unit_id: unit_id, unit: unit, validate_only: validate_only, request_id: request_id) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use hash object with options - client.create_unit({ parent: parent, unit_id: unit_id, unit: unit, validate_only: validate_only, request_id: request_id }, grpc_options) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object with options - client.create_unit(::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::CreateUnitRequest.new(parent: parent, unit_id: unit_id, unit: unit, validate_only: validate_only, request_id: request_id), grpc_options) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Verify method calls - assert_equal 5, create_unit_client_stub.call_rpc_count - end - end - - def test_update_unit - # Create GRPC objects. - grpc_response = ::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::Unit.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. - unit = {} - validate_only = true - request_id = "hello world" - update_mask = {} - - update_unit_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :update_unit, name - assert_kind_of ::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::UpdateUnitRequest, request - assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::Unit), request["unit"] - assert_equal true, request["validate_only"] - assert_equal "hello world", request["request_id"] - assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Protobuf::FieldMask), request["update_mask"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, update_unit_client_stub do - # Create client - client = ::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::SaasDeployments::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.update_unit({ unit: unit, validate_only: validate_only, request_id: request_id, update_mask: update_mask }) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use named arguments - client.update_unit unit: unit, validate_only: validate_only, request_id: request_id, update_mask: update_mask do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object - client.update_unit ::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::UpdateUnitRequest.new(unit: unit, validate_only: validate_only, request_id: request_id, update_mask: update_mask) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use hash object with options - client.update_unit({ unit: unit, validate_only: validate_only, request_id: request_id, update_mask: update_mask }, grpc_options) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object with options - client.update_unit(::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::UpdateUnitRequest.new(unit: unit, validate_only: validate_only, request_id: request_id, update_mask: update_mask), grpc_options) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Verify method calls - assert_equal 5, update_unit_client_stub.call_rpc_count - end - end - - def test_delete_unit - # Create GRPC objects. - grpc_response = ::Google::Protobuf::Empty.new - grpc_operation = GRPC::ActiveCall::Operation.new nil - grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - grpc_options = {} - - # Create request parameters for a unary method. - name = "hello world" - etag = "hello world" - validate_only = true - request_id = "hello world" - - delete_unit_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :delete_unit, name - assert_kind_of ::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::DeleteUnitRequest, request - assert_equal "hello world", request["name"] - assert_equal "hello world", request["etag"] - assert_equal true, request["validate_only"] - assert_equal "hello world", request["request_id"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, delete_unit_client_stub do - # Create client - client = ::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::SaasDeployments::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.delete_unit({ name: name, etag: etag, validate_only: validate_only, request_id: request_id }) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use named arguments - client.delete_unit name: name, etag: etag, validate_only: validate_only, request_id: request_id do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object - client.delete_unit ::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::DeleteUnitRequest.new(name: name, etag: etag, validate_only: validate_only, request_id: request_id) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use hash object with options - client.delete_unit({ name: name, etag: etag, validate_only: validate_only, request_id: request_id }, grpc_options) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object with options - client.delete_unit(::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::DeleteUnitRequest.new(name: name, etag: etag, validate_only: validate_only, request_id: request_id), grpc_options) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Verify method calls - assert_equal 5, delete_unit_client_stub.call_rpc_count - end - end - - def test_list_unit_operations - # Create GRPC objects. - grpc_response = ::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::ListUnitOperationsResponse.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" - order_by = "hello world" - - list_unit_operations_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :list_unit_operations, name - assert_kind_of ::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::ListUnitOperationsRequest, 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"] - assert_equal "hello world", request["order_by"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, list_unit_operations_client_stub do - # Create client - client = ::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::SaasDeployments::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.list_unit_operations({ parent: parent, page_size: page_size, page_token: page_token, filter: filter, order_by: order_by }) 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_unit_operations parent: parent, page_size: page_size, page_token: page_token, filter: filter, order_by: order_by 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_unit_operations ::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::ListUnitOperationsRequest.new(parent: parent, page_size: page_size, page_token: page_token, filter: filter, order_by: order_by) 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_unit_operations({ parent: parent, page_size: page_size, page_token: page_token, filter: filter, order_by: order_by }, 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_unit_operations(::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::ListUnitOperationsRequest.new(parent: parent, page_size: page_size, page_token: page_token, filter: filter, order_by: order_by), 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_unit_operations_client_stub.call_rpc_count - end - end - - def test_get_unit_operation - # Create GRPC objects. - grpc_response = ::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::UnitOperation.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_unit_operation_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :get_unit_operation, name - assert_kind_of ::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::GetUnitOperationRequest, request - assert_equal "hello world", request["name"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, get_unit_operation_client_stub do - # Create client - client = ::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::SaasDeployments::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.get_unit_operation({ name: name }) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use named arguments - client.get_unit_operation name: name do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object - client.get_unit_operation ::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::GetUnitOperationRequest.new(name: name) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use hash object with options - client.get_unit_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.get_unit_operation(::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::GetUnitOperationRequest.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_unit_operation_client_stub.call_rpc_count - end - end - - def test_create_unit_operation - # Create GRPC objects. - grpc_response = ::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::UnitOperation.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" - unit_operation_id = "hello world" - unit_operation = {} - validate_only = true - request_id = "hello world" - - create_unit_operation_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :create_unit_operation, name - assert_kind_of ::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::CreateUnitOperationRequest, request - assert_equal "hello world", request["parent"] - assert_equal "hello world", request["unit_operation_id"] - assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::UnitOperation), request["unit_operation"] - assert_equal true, request["validate_only"] - assert_equal "hello world", request["request_id"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, create_unit_operation_client_stub do - # Create client - client = ::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::SaasDeployments::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.create_unit_operation({ parent: parent, unit_operation_id: unit_operation_id, unit_operation: unit_operation, validate_only: validate_only, request_id: request_id }) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use named arguments - client.create_unit_operation parent: parent, unit_operation_id: unit_operation_id, unit_operation: unit_operation, validate_only: validate_only, request_id: request_id do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object - client.create_unit_operation ::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::CreateUnitOperationRequest.new(parent: parent, unit_operation_id: unit_operation_id, unit_operation: unit_operation, validate_only: validate_only, request_id: request_id) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use hash object with options - client.create_unit_operation({ parent: parent, unit_operation_id: unit_operation_id, unit_operation: unit_operation, validate_only: validate_only, request_id: request_id }, grpc_options) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object with options - client.create_unit_operation(::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::CreateUnitOperationRequest.new(parent: parent, unit_operation_id: unit_operation_id, unit_operation: unit_operation, validate_only: validate_only, request_id: request_id), grpc_options) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Verify method calls - assert_equal 5, create_unit_operation_client_stub.call_rpc_count - end - end - - def test_update_unit_operation - # Create GRPC objects. - grpc_response = ::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::UnitOperation.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. - unit_operation = {} - validate_only = true - request_id = "hello world" - update_mask = {} - - update_unit_operation_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :update_unit_operation, name - assert_kind_of ::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::UpdateUnitOperationRequest, request - assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::UnitOperation), request["unit_operation"] - assert_equal true, request["validate_only"] - assert_equal "hello world", request["request_id"] - assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Protobuf::FieldMask), request["update_mask"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, update_unit_operation_client_stub do - # Create client - client = ::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::SaasDeployments::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.update_unit_operation({ unit_operation: unit_operation, validate_only: validate_only, request_id: request_id, update_mask: update_mask }) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use named arguments - client.update_unit_operation unit_operation: unit_operation, validate_only: validate_only, request_id: request_id, update_mask: update_mask do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object - client.update_unit_operation ::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::UpdateUnitOperationRequest.new(unit_operation: unit_operation, validate_only: validate_only, request_id: request_id, update_mask: update_mask) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use hash object with options - client.update_unit_operation({ unit_operation: unit_operation, validate_only: validate_only, request_id: request_id, update_mask: update_mask }, grpc_options) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object with options - client.update_unit_operation(::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::UpdateUnitOperationRequest.new(unit_operation: unit_operation, validate_only: validate_only, request_id: request_id, update_mask: update_mask), grpc_options) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Verify method calls - assert_equal 5, update_unit_operation_client_stub.call_rpc_count - end - end - - def test_delete_unit_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" - etag = "hello world" - validate_only = true - request_id = "hello world" - - delete_unit_operation_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :delete_unit_operation, name - assert_kind_of ::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::DeleteUnitOperationRequest, request - assert_equal "hello world", request["name"] - assert_equal "hello world", request["etag"] - assert_equal true, request["validate_only"] - assert_equal "hello world", request["request_id"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, delete_unit_operation_client_stub do - # Create client - client = ::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::SaasDeployments::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.delete_unit_operation({ name: name, etag: etag, validate_only: validate_only, request_id: request_id }) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use named arguments - client.delete_unit_operation name: name, etag: etag, validate_only: validate_only, request_id: request_id do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object - client.delete_unit_operation ::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::DeleteUnitOperationRequest.new(name: name, etag: etag, validate_only: validate_only, request_id: request_id) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use hash object with options - client.delete_unit_operation({ name: name, etag: etag, validate_only: validate_only, request_id: request_id }, grpc_options) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object with options - client.delete_unit_operation(::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::DeleteUnitOperationRequest.new(name: name, etag: etag, validate_only: validate_only, request_id: request_id), grpc_options) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Verify method calls - assert_equal 5, delete_unit_operation_client_stub.call_rpc_count - end - end - - def test_list_releases - # Create GRPC objects. - grpc_response = ::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::ListReleasesResponse.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" - order_by = "hello world" - - list_releases_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :list_releases, name - assert_kind_of ::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::ListReleasesRequest, 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"] - assert_equal "hello world", request["order_by"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, list_releases_client_stub do - # Create client - client = ::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::SaasDeployments::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.list_releases({ parent: parent, page_size: page_size, page_token: page_token, filter: filter, order_by: order_by }) 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_releases parent: parent, page_size: page_size, page_token: page_token, filter: filter, order_by: order_by 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_releases ::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::ListReleasesRequest.new(parent: parent, page_size: page_size, page_token: page_token, filter: filter, order_by: order_by) 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_releases({ parent: parent, page_size: page_size, page_token: page_token, filter: filter, order_by: order_by }, 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_releases(::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::ListReleasesRequest.new(parent: parent, page_size: page_size, page_token: page_token, filter: filter, order_by: order_by), 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_releases_client_stub.call_rpc_count - end - end - - def test_get_release - # Create GRPC objects. - grpc_response = ::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::Release.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_release_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :get_release, name - assert_kind_of ::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::GetReleaseRequest, request - assert_equal "hello world", request["name"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, get_release_client_stub do - # Create client - client = ::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::SaasDeployments::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.get_release({ name: name }) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use named arguments - client.get_release name: name do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object - client.get_release ::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::GetReleaseRequest.new(name: name) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use hash object with options - client.get_release({ 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_release(::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::GetReleaseRequest.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_release_client_stub.call_rpc_count - end - end - - def test_create_release - # Create GRPC objects. - grpc_response = ::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::Release.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" - release_id = "hello world" - release = {} - validate_only = true - request_id = "hello world" - - create_release_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :create_release, name - assert_kind_of ::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::CreateReleaseRequest, request - assert_equal "hello world", request["parent"] - assert_equal "hello world", request["release_id"] - assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::Release), request["release"] - assert_equal true, request["validate_only"] - assert_equal "hello world", request["request_id"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, create_release_client_stub do - # Create client - client = ::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::SaasDeployments::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.create_release({ parent: parent, release_id: release_id, release: release, validate_only: validate_only, request_id: request_id }) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use named arguments - client.create_release parent: parent, release_id: release_id, release: release, validate_only: validate_only, request_id: request_id do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object - client.create_release ::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::CreateReleaseRequest.new(parent: parent, release_id: release_id, release: release, validate_only: validate_only, request_id: request_id) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use hash object with options - client.create_release({ parent: parent, release_id: release_id, release: release, validate_only: validate_only, request_id: request_id }, grpc_options) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object with options - client.create_release(::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::CreateReleaseRequest.new(parent: parent, release_id: release_id, release: release, validate_only: validate_only, request_id: request_id), grpc_options) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Verify method calls - assert_equal 5, create_release_client_stub.call_rpc_count - end - end - - def test_update_release - # Create GRPC objects. - grpc_response = ::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::Release.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. - release = {} - validate_only = true - request_id = "hello world" - update_mask = {} - - update_release_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :update_release, name - assert_kind_of ::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::UpdateReleaseRequest, request - assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::Release), request["release"] - assert_equal true, request["validate_only"] - assert_equal "hello world", request["request_id"] - assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Protobuf::FieldMask), request["update_mask"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, update_release_client_stub do - # Create client - client = ::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::SaasDeployments::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.update_release({ release: release, validate_only: validate_only, request_id: request_id, update_mask: update_mask }) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use named arguments - client.update_release release: release, validate_only: validate_only, request_id: request_id, update_mask: update_mask do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object - client.update_release ::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::UpdateReleaseRequest.new(release: release, validate_only: validate_only, request_id: request_id, update_mask: update_mask) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use hash object with options - client.update_release({ release: release, validate_only: validate_only, request_id: request_id, update_mask: update_mask }, grpc_options) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object with options - client.update_release(::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::UpdateReleaseRequest.new(release: release, validate_only: validate_only, request_id: request_id, update_mask: update_mask), grpc_options) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Verify method calls - assert_equal 5, update_release_client_stub.call_rpc_count - end - end - - def test_delete_release - # Create GRPC objects. - grpc_response = ::Google::Protobuf::Empty.new - grpc_operation = GRPC::ActiveCall::Operation.new nil - grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - grpc_options = {} - - # Create request parameters for a unary method. - name = "hello world" - etag = "hello world" - validate_only = true - request_id = "hello world" - - delete_release_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :delete_release, name - assert_kind_of ::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::DeleteReleaseRequest, request - assert_equal "hello world", request["name"] - assert_equal "hello world", request["etag"] - assert_equal true, request["validate_only"] - assert_equal "hello world", request["request_id"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, delete_release_client_stub do - # Create client - client = ::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::SaasDeployments::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.delete_release({ name: name, etag: etag, validate_only: validate_only, request_id: request_id }) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use named arguments - client.delete_release name: name, etag: etag, validate_only: validate_only, request_id: request_id do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object - client.delete_release ::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::DeleteReleaseRequest.new(name: name, etag: etag, validate_only: validate_only, request_id: request_id) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use hash object with options - client.delete_release({ name: name, etag: etag, validate_only: validate_only, request_id: request_id }, grpc_options) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object with options - client.delete_release(::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::DeleteReleaseRequest.new(name: name, etag: etag, validate_only: validate_only, request_id: request_id), grpc_options) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Verify method calls - assert_equal 5, delete_release_client_stub.call_rpc_count - end - end - - def test_configure - grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - - client = block_config = config = nil - dummy_stub = ClientStub.new nil, nil - Gapic::ServiceStub.stub :new, dummy_stub do - client = ::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::SaasDeployments::Client.new do |config| - config.credentials = grpc_channel - end - end - - config = client.configure do |c| - block_config = c - end - - assert_same block_config, config - assert_kind_of ::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::SaasDeployments::Client::Configuration, config - end - - def test_credentials - key = OpenSSL::PKey::RSA.new 2048 - cred_json = { - "private_key" => key.to_pem, - "client_email" => "app@developer.gserviceaccount.com", - "type" => "service_account" - } - key_file = StringIO.new cred_json.to_json - creds = Google::Auth::ServiceAccountCredentials.make_creds({ json_key_io: key_file }) - - dummy_stub = ClientStub.new nil, nil - Gapic::ServiceStub.stub :new, dummy_stub do - client = ::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::SaasDeployments::Client.new do |config| - config.credentials = creds - end - assert_kind_of ::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::SaasDeployments::Client, client - assert_equal creds, client.configure.credentials - end - end -end diff --git a/owl-bot-staging/google-cloud-saas_platform-saas_service_mgmt-v1beta1/test/google/cloud/saas_platform/saas_service_mgmt/v1beta1/saas_rollouts_paths_test.rb b/owl-bot-staging/google-cloud-saas_platform-saas_service_mgmt-v1beta1/test/google/cloud/saas_platform/saas_service_mgmt/v1beta1/saas_rollouts_paths_test.rb deleted file mode 100644 index 74ed06aa7ce4..000000000000 --- a/owl-bot-staging/google-cloud-saas_platform-saas_service_mgmt-v1beta1/test/google/cloud/saas_platform/saas_service_mgmt/v1beta1/saas_rollouts_paths_test.rb +++ /dev/null @@ -1,103 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -require "helper" - -require "gapic/grpc/service_stub" - -require "google/cloud/saas_platform/saas_service_mgmt/v1beta1/saas_rollouts" - -class ::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::SaasRollouts::ClientPathsTest < Minitest::Test - class DummyStub - def endpoint - "endpoint.example.com" - end - - def universe_domain - "example.com" - end - - def stub_logger - nil - end - - def logger - nil - end - end - - def test_location_path - grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - ::Gapic::ServiceStub.stub :new, DummyStub.new do - client = ::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::SaasRollouts::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_release_path - grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - ::Gapic::ServiceStub.stub :new, DummyStub.new do - client = ::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::SaasRollouts::Client.new do |config| - config.credentials = grpc_channel - end - - path = client.release_path project: "value0", location: "value1", release: "value2" - assert_equal "projects/value0/locations/value1/releases/value2", path - end - end - - def test_rollout_path - grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - ::Gapic::ServiceStub.stub :new, DummyStub.new do - client = ::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::SaasRollouts::Client.new do |config| - config.credentials = grpc_channel - end - - path = client.rollout_path project: "value0", location: "value1", rollout_id: "value2" - assert_equal "projects/value0/locations/value1/rollouts/value2", path - end - end - - def test_rollout_kind_path - grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - ::Gapic::ServiceStub.stub :new, DummyStub.new do - client = ::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::SaasRollouts::Client.new do |config| - config.credentials = grpc_channel - end - - path = client.rollout_kind_path project: "value0", location: "value1", rollout_kind_id: "value2" - assert_equal "projects/value0/locations/value1/rolloutKinds/value2", path - end - end - - def test_unit_kind_path - grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - ::Gapic::ServiceStub.stub :new, DummyStub.new do - client = ::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::SaasRollouts::Client.new do |config| - config.credentials = grpc_channel - end - - path = client.unit_kind_path project: "value0", location: "value1", unit_kind: "value2" - assert_equal "projects/value0/locations/value1/unitKinds/value2", path - end - end -end diff --git a/owl-bot-staging/google-cloud-saas_platform-saas_service_mgmt-v1beta1/test/google/cloud/saas_platform/saas_service_mgmt/v1beta1/saas_rollouts_rest_test.rb b/owl-bot-staging/google-cloud-saas_platform-saas_service_mgmt-v1beta1/test/google/cloud/saas_platform/saas_service_mgmt/v1beta1/saas_rollouts_rest_test.rb deleted file mode 100644 index 74e871ac379c..000000000000 --- a/owl-bot-staging/google-cloud-saas_platform-saas_service_mgmt-v1beta1/test/google/cloud/saas_platform/saas_service_mgmt/v1beta1/saas_rollouts_rest_test.rb +++ /dev/null @@ -1,667 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -require "helper" -require "gapic/rest" -require "google/cloud/saasplatform/saasservicemgmt/v1beta1/rollouts_service_pb" -require "google/cloud/saas_platform/saas_service_mgmt/v1beta1/saas_rollouts/rest" - - -class ::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::SaasRollouts::Rest::ClientTest < Minitest::Test - class ClientStub - attr_accessor :call_count, :requests - - def initialize response, &block - @response = response - @block = block - @call_count = 0 - @requests = [] - end - - def make_get_request uri:, params: {}, options: {}, method_name: nil - make_http_request :get, uri: uri, body: nil, params: params, options: options, method_name: method_name - end - - def make_delete_request uri:, params: {}, options: {}, method_name: nil - make_http_request :delete, uri: uri, body: nil, params: params, options: options, method_name: method_name - end - - def make_post_request uri:, body: nil, params: {}, options: {}, method_name: nil - make_http_request :post, uri: uri, body: body, params: params, options: options, method_name: method_name - end - - def make_patch_request uri:, body:, params: {}, options: {}, method_name: nil - make_http_request :patch, uri: uri, body: body, params: params, options: options, method_name: method_name - end - - def make_put_request uri:, body:, params: {}, options: {}, method_name: nil - make_http_request :put, uri: uri, body: body, params: params, options: options, method_name: method_name - end - - def make_http_request *args, **kwargs - @call_count += 1 - - @requests << @block&.call(*args, **kwargs) - - @response - end - - def endpoint - "endpoint.example.com" - end - - def universe_domain - "example.com" - end - - def stub_logger - nil - end - - def logger - nil - end - end - - def test_list_rollouts - # Create test objects. - client_result = ::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::ListRolloutsResponse.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" - order_by = "hello world" - - list_rollouts_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| - assert options.metadata.key? :"x-goog-api-client" - assert options.metadata[:"x-goog-api-client"].include? "rest" - refute options.metadata[:"x-goog-api-client"].include? "grpc" - end - - ::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::SaasRollouts::Rest::ServiceStub.stub :transcode_list_rollouts_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, list_rollouts_client_stub do - # Create client - client = ::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::SaasRollouts::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - client.list_rollouts({ parent: parent, page_size: page_size, page_token: page_token, filter: filter, order_by: order_by }) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use named arguments - client.list_rollouts parent: parent, page_size: page_size, page_token: page_token, filter: filter, order_by: order_by do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object - client.list_rollouts ::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::ListRolloutsRequest.new(parent: parent, page_size: page_size, page_token: page_token, filter: filter, order_by: order_by) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use hash object with options - client.list_rollouts({ parent: parent, page_size: page_size, page_token: page_token, filter: filter, order_by: order_by }, call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object with options - client.list_rollouts(::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::ListRolloutsRequest.new(parent: parent, page_size: page_size, page_token: page_token, filter: filter, order_by: order_by), call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Verify method calls - assert_equal 5, list_rollouts_client_stub.call_count - end - end - end - - def test_get_rollout - # Create test objects. - client_result = ::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::Rollout.new - http_response = OpenStruct.new body: client_result.to_json - - call_options = {} - - # Create request parameters for a unary method. - name = "hello world" - - get_rollout_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| - assert options.metadata.key? :"x-goog-api-client" - assert options.metadata[:"x-goog-api-client"].include? "rest" - refute options.metadata[:"x-goog-api-client"].include? "grpc" - end - - ::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::SaasRollouts::Rest::ServiceStub.stub :transcode_get_rollout_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, get_rollout_client_stub do - # Create client - client = ::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::SaasRollouts::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - client.get_rollout({ name: name }) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use named arguments - client.get_rollout name: name do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object - client.get_rollout ::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::GetRolloutRequest.new(name: name) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use hash object with options - client.get_rollout({ name: name }, call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object with options - client.get_rollout(::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::GetRolloutRequest.new(name: name), call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Verify method calls - assert_equal 5, get_rollout_client_stub.call_count - end - end - end - - def test_create_rollout - # Create test objects. - client_result = ::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::Rollout.new - http_response = OpenStruct.new body: client_result.to_json - - call_options = {} - - # Create request parameters for a unary method. - parent = "hello world" - rollout_id = "hello world" - rollout = {} - validate_only = true - request_id = "hello world" - - create_rollout_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| - assert options.metadata.key? :"x-goog-api-client" - assert options.metadata[:"x-goog-api-client"].include? "rest" - refute options.metadata[:"x-goog-api-client"].include? "grpc" - end - - ::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::SaasRollouts::Rest::ServiceStub.stub :transcode_create_rollout_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, create_rollout_client_stub do - # Create client - client = ::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::SaasRollouts::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - client.create_rollout({ parent: parent, rollout_id: rollout_id, rollout: rollout, validate_only: validate_only, request_id: request_id }) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use named arguments - client.create_rollout parent: parent, rollout_id: rollout_id, rollout: rollout, validate_only: validate_only, request_id: request_id do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object - client.create_rollout ::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::CreateRolloutRequest.new(parent: parent, rollout_id: rollout_id, rollout: rollout, validate_only: validate_only, request_id: request_id) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use hash object with options - client.create_rollout({ parent: parent, rollout_id: rollout_id, rollout: rollout, validate_only: validate_only, request_id: request_id }, call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object with options - client.create_rollout(::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::CreateRolloutRequest.new(parent: parent, rollout_id: rollout_id, rollout: rollout, validate_only: validate_only, request_id: request_id), call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Verify method calls - assert_equal 5, create_rollout_client_stub.call_count - end - end - end - - def test_update_rollout - # Create test objects. - client_result = ::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::Rollout.new - http_response = OpenStruct.new body: client_result.to_json - - call_options = {} - - # Create request parameters for a unary method. - rollout = {} - validate_only = true - request_id = "hello world" - update_mask = {} - - update_rollout_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| - assert options.metadata.key? :"x-goog-api-client" - assert options.metadata[:"x-goog-api-client"].include? "rest" - refute options.metadata[:"x-goog-api-client"].include? "grpc" - end - - ::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::SaasRollouts::Rest::ServiceStub.stub :transcode_update_rollout_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, update_rollout_client_stub do - # Create client - client = ::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::SaasRollouts::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - client.update_rollout({ rollout: rollout, validate_only: validate_only, request_id: request_id, update_mask: update_mask }) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use named arguments - client.update_rollout rollout: rollout, validate_only: validate_only, request_id: request_id, update_mask: update_mask do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object - client.update_rollout ::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::UpdateRolloutRequest.new(rollout: rollout, validate_only: validate_only, request_id: request_id, update_mask: update_mask) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use hash object with options - client.update_rollout({ rollout: rollout, validate_only: validate_only, request_id: request_id, update_mask: update_mask }, call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object with options - client.update_rollout(::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::UpdateRolloutRequest.new(rollout: rollout, validate_only: validate_only, request_id: request_id, update_mask: update_mask), call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Verify method calls - assert_equal 5, update_rollout_client_stub.call_count - end - end - end - - def test_delete_rollout - # Create test objects. - client_result = ::Google::Protobuf::Empty.new - http_response = OpenStruct.new body: client_result.to_json - - call_options = {} - - # Create request parameters for a unary method. - name = "hello world" - etag = "hello world" - validate_only = true - request_id = "hello world" - - delete_rollout_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| - assert options.metadata.key? :"x-goog-api-client" - assert options.metadata[:"x-goog-api-client"].include? "rest" - refute options.metadata[:"x-goog-api-client"].include? "grpc" - end - - ::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::SaasRollouts::Rest::ServiceStub.stub :transcode_delete_rollout_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, delete_rollout_client_stub do - # Create client - client = ::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::SaasRollouts::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - client.delete_rollout({ name: name, etag: etag, validate_only: validate_only, request_id: request_id }) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use named arguments - client.delete_rollout name: name, etag: etag, validate_only: validate_only, request_id: request_id do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object - client.delete_rollout ::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::DeleteRolloutRequest.new(name: name, etag: etag, validate_only: validate_only, request_id: request_id) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use hash object with options - client.delete_rollout({ name: name, etag: etag, validate_only: validate_only, request_id: request_id }, call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object with options - client.delete_rollout(::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::DeleteRolloutRequest.new(name: name, etag: etag, validate_only: validate_only, request_id: request_id), call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Verify method calls - assert_equal 5, delete_rollout_client_stub.call_count - end - end - end - - def test_list_rollout_kinds - # Create test objects. - client_result = ::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::ListRolloutKindsResponse.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" - order_by = "hello world" - - list_rollout_kinds_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| - assert options.metadata.key? :"x-goog-api-client" - assert options.metadata[:"x-goog-api-client"].include? "rest" - refute options.metadata[:"x-goog-api-client"].include? "grpc" - end - - ::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::SaasRollouts::Rest::ServiceStub.stub :transcode_list_rollout_kinds_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, list_rollout_kinds_client_stub do - # Create client - client = ::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::SaasRollouts::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - client.list_rollout_kinds({ parent: parent, page_size: page_size, page_token: page_token, filter: filter, order_by: order_by }) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use named arguments - client.list_rollout_kinds parent: parent, page_size: page_size, page_token: page_token, filter: filter, order_by: order_by do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object - client.list_rollout_kinds ::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::ListRolloutKindsRequest.new(parent: parent, page_size: page_size, page_token: page_token, filter: filter, order_by: order_by) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use hash object with options - client.list_rollout_kinds({ parent: parent, page_size: page_size, page_token: page_token, filter: filter, order_by: order_by }, call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object with options - client.list_rollout_kinds(::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::ListRolloutKindsRequest.new(parent: parent, page_size: page_size, page_token: page_token, filter: filter, order_by: order_by), call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Verify method calls - assert_equal 5, list_rollout_kinds_client_stub.call_count - end - end - end - - def test_get_rollout_kind - # Create test objects. - client_result = ::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::RolloutKind.new - http_response = OpenStruct.new body: client_result.to_json - - call_options = {} - - # Create request parameters for a unary method. - name = "hello world" - - get_rollout_kind_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| - assert options.metadata.key? :"x-goog-api-client" - assert options.metadata[:"x-goog-api-client"].include? "rest" - refute options.metadata[:"x-goog-api-client"].include? "grpc" - end - - ::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::SaasRollouts::Rest::ServiceStub.stub :transcode_get_rollout_kind_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, get_rollout_kind_client_stub do - # Create client - client = ::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::SaasRollouts::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - client.get_rollout_kind({ name: name }) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use named arguments - client.get_rollout_kind name: name do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object - client.get_rollout_kind ::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::GetRolloutKindRequest.new(name: name) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use hash object with options - client.get_rollout_kind({ name: name }, call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object with options - client.get_rollout_kind(::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::GetRolloutKindRequest.new(name: name), call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Verify method calls - assert_equal 5, get_rollout_kind_client_stub.call_count - end - end - end - - def test_create_rollout_kind - # Create test objects. - client_result = ::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::RolloutKind.new - http_response = OpenStruct.new body: client_result.to_json - - call_options = {} - - # Create request parameters for a unary method. - parent = "hello world" - rollout_kind_id = "hello world" - rollout_kind = {} - validate_only = true - request_id = "hello world" - - create_rollout_kind_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| - assert options.metadata.key? :"x-goog-api-client" - assert options.metadata[:"x-goog-api-client"].include? "rest" - refute options.metadata[:"x-goog-api-client"].include? "grpc" - end - - ::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::SaasRollouts::Rest::ServiceStub.stub :transcode_create_rollout_kind_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, create_rollout_kind_client_stub do - # Create client - client = ::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::SaasRollouts::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - client.create_rollout_kind({ parent: parent, rollout_kind_id: rollout_kind_id, rollout_kind: rollout_kind, validate_only: validate_only, request_id: request_id }) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use named arguments - client.create_rollout_kind parent: parent, rollout_kind_id: rollout_kind_id, rollout_kind: rollout_kind, validate_only: validate_only, request_id: request_id do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object - client.create_rollout_kind ::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::CreateRolloutKindRequest.new(parent: parent, rollout_kind_id: rollout_kind_id, rollout_kind: rollout_kind, validate_only: validate_only, request_id: request_id) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use hash object with options - client.create_rollout_kind({ parent: parent, rollout_kind_id: rollout_kind_id, rollout_kind: rollout_kind, validate_only: validate_only, request_id: request_id }, call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object with options - client.create_rollout_kind(::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::CreateRolloutKindRequest.new(parent: parent, rollout_kind_id: rollout_kind_id, rollout_kind: rollout_kind, validate_only: validate_only, request_id: request_id), call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Verify method calls - assert_equal 5, create_rollout_kind_client_stub.call_count - end - end - end - - def test_update_rollout_kind - # Create test objects. - client_result = ::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::RolloutKind.new - http_response = OpenStruct.new body: client_result.to_json - - call_options = {} - - # Create request parameters for a unary method. - rollout_kind = {} - validate_only = true - request_id = "hello world" - update_mask = {} - - update_rollout_kind_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| - assert options.metadata.key? :"x-goog-api-client" - assert options.metadata[:"x-goog-api-client"].include? "rest" - refute options.metadata[:"x-goog-api-client"].include? "grpc" - end - - ::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::SaasRollouts::Rest::ServiceStub.stub :transcode_update_rollout_kind_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, update_rollout_kind_client_stub do - # Create client - client = ::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::SaasRollouts::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - client.update_rollout_kind({ rollout_kind: rollout_kind, validate_only: validate_only, request_id: request_id, update_mask: update_mask }) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use named arguments - client.update_rollout_kind rollout_kind: rollout_kind, validate_only: validate_only, request_id: request_id, update_mask: update_mask do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object - client.update_rollout_kind ::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::UpdateRolloutKindRequest.new(rollout_kind: rollout_kind, validate_only: validate_only, request_id: request_id, update_mask: update_mask) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use hash object with options - client.update_rollout_kind({ rollout_kind: rollout_kind, validate_only: validate_only, request_id: request_id, update_mask: update_mask }, call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object with options - client.update_rollout_kind(::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::UpdateRolloutKindRequest.new(rollout_kind: rollout_kind, validate_only: validate_only, request_id: request_id, update_mask: update_mask), call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Verify method calls - assert_equal 5, update_rollout_kind_client_stub.call_count - end - end - end - - def test_delete_rollout_kind - # Create test objects. - client_result = ::Google::Protobuf::Empty.new - http_response = OpenStruct.new body: client_result.to_json - - call_options = {} - - # Create request parameters for a unary method. - name = "hello world" - etag = "hello world" - validate_only = true - request_id = "hello world" - - delete_rollout_kind_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| - assert options.metadata.key? :"x-goog-api-client" - assert options.metadata[:"x-goog-api-client"].include? "rest" - refute options.metadata[:"x-goog-api-client"].include? "grpc" - end - - ::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::SaasRollouts::Rest::ServiceStub.stub :transcode_delete_rollout_kind_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, delete_rollout_kind_client_stub do - # Create client - client = ::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::SaasRollouts::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - client.delete_rollout_kind({ name: name, etag: etag, validate_only: validate_only, request_id: request_id }) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use named arguments - client.delete_rollout_kind name: name, etag: etag, validate_only: validate_only, request_id: request_id do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object - client.delete_rollout_kind ::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::DeleteRolloutKindRequest.new(name: name, etag: etag, validate_only: validate_only, request_id: request_id) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use hash object with options - client.delete_rollout_kind({ name: name, etag: etag, validate_only: validate_only, request_id: request_id }, call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object with options - client.delete_rollout_kind(::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::DeleteRolloutKindRequest.new(name: name, etag: etag, validate_only: validate_only, request_id: request_id), call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Verify method calls - assert_equal 5, delete_rollout_kind_client_stub.call_count - end - end - end - - def test_configure - credentials_token = :dummy_value - - client = block_config = config = nil - dummy_stub = ClientStub.new nil - Gapic::Rest::ClientStub.stub :new, dummy_stub do - client = ::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::SaasRollouts::Rest::Client.new do |config| - config.credentials = credentials_token - end - end - - config = client.configure do |c| - block_config = c - end - - assert_same block_config, config - assert_kind_of ::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::SaasRollouts::Rest::Client::Configuration, config - end -end diff --git a/owl-bot-staging/google-cloud-saas_platform-saas_service_mgmt-v1beta1/test/google/cloud/saas_platform/saas_service_mgmt/v1beta1/saas_rollouts_test.rb b/owl-bot-staging/google-cloud-saas_platform-saas_service_mgmt-v1beta1/test/google/cloud/saas_platform/saas_service_mgmt/v1beta1/saas_rollouts_test.rb deleted file mode 100644 index eae3d040a59d..000000000000 --- a/owl-bot-staging/google-cloud-saas_platform-saas_service_mgmt-v1beta1/test/google/cloud/saas_platform/saas_service_mgmt/v1beta1/saas_rollouts_test.rb +++ /dev/null @@ -1,750 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -require "helper" - -require "gapic/grpc/service_stub" - -require "google/cloud/saasplatform/saasservicemgmt/v1beta1/rollouts_service_pb" -require "google/cloud/saas_platform/saas_service_mgmt/v1beta1/saas_rollouts" - -class ::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::SaasRollouts::ClientTest < Minitest::Test - class ClientStub - attr_accessor :call_rpc_count, :requests - - def initialize response, operation, &block - @response = response - @operation = operation - @block = block - @call_rpc_count = 0 - @requests = [] - end - - def call_rpc *args, **kwargs - @call_rpc_count += 1 - - @requests << @block&.call(*args, **kwargs) - - catch :response do - yield @response, @operation if block_given? - @response - end - end - - def endpoint - "endpoint.example.com" - end - - def universe_domain - "example.com" - end - - def stub_logger - nil - end - - def logger - nil - end - end - - def test_list_rollouts - # Create GRPC objects. - grpc_response = ::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::ListRolloutsResponse.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" - order_by = "hello world" - - list_rollouts_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :list_rollouts, name - assert_kind_of ::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::ListRolloutsRequest, 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"] - assert_equal "hello world", request["order_by"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, list_rollouts_client_stub do - # Create client - client = ::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::SaasRollouts::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.list_rollouts({ parent: parent, page_size: page_size, page_token: page_token, filter: filter, order_by: order_by }) 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_rollouts parent: parent, page_size: page_size, page_token: page_token, filter: filter, order_by: order_by 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_rollouts ::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::ListRolloutsRequest.new(parent: parent, page_size: page_size, page_token: page_token, filter: filter, order_by: order_by) 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_rollouts({ parent: parent, page_size: page_size, page_token: page_token, filter: filter, order_by: order_by }, 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_rollouts(::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::ListRolloutsRequest.new(parent: parent, page_size: page_size, page_token: page_token, filter: filter, order_by: order_by), 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_rollouts_client_stub.call_rpc_count - end - end - - def test_get_rollout - # Create GRPC objects. - grpc_response = ::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::Rollout.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_rollout_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :get_rollout, name - assert_kind_of ::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::GetRolloutRequest, request - assert_equal "hello world", request["name"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, get_rollout_client_stub do - # Create client - client = ::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::SaasRollouts::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.get_rollout({ name: name }) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use named arguments - client.get_rollout name: name do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object - client.get_rollout ::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::GetRolloutRequest.new(name: name) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use hash object with options - client.get_rollout({ 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_rollout(::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::GetRolloutRequest.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_rollout_client_stub.call_rpc_count - end - end - - def test_create_rollout - # Create GRPC objects. - grpc_response = ::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::Rollout.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" - rollout_id = "hello world" - rollout = {} - validate_only = true - request_id = "hello world" - - create_rollout_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :create_rollout, name - assert_kind_of ::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::CreateRolloutRequest, request - assert_equal "hello world", request["parent"] - assert_equal "hello world", request["rollout_id"] - assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::Rollout), request["rollout"] - assert_equal true, request["validate_only"] - assert_equal "hello world", request["request_id"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, create_rollout_client_stub do - # Create client - client = ::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::SaasRollouts::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.create_rollout({ parent: parent, rollout_id: rollout_id, rollout: rollout, validate_only: validate_only, request_id: request_id }) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use named arguments - client.create_rollout parent: parent, rollout_id: rollout_id, rollout: rollout, validate_only: validate_only, request_id: request_id do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object - client.create_rollout ::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::CreateRolloutRequest.new(parent: parent, rollout_id: rollout_id, rollout: rollout, validate_only: validate_only, request_id: request_id) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use hash object with options - client.create_rollout({ parent: parent, rollout_id: rollout_id, rollout: rollout, validate_only: validate_only, request_id: request_id }, grpc_options) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object with options - client.create_rollout(::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::CreateRolloutRequest.new(parent: parent, rollout_id: rollout_id, rollout: rollout, validate_only: validate_only, request_id: request_id), grpc_options) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Verify method calls - assert_equal 5, create_rollout_client_stub.call_rpc_count - end - end - - def test_update_rollout - # Create GRPC objects. - grpc_response = ::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::Rollout.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. - rollout = {} - validate_only = true - request_id = "hello world" - update_mask = {} - - update_rollout_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :update_rollout, name - assert_kind_of ::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::UpdateRolloutRequest, request - assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::Rollout), request["rollout"] - assert_equal true, request["validate_only"] - assert_equal "hello world", request["request_id"] - assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Protobuf::FieldMask), request["update_mask"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, update_rollout_client_stub do - # Create client - client = ::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::SaasRollouts::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.update_rollout({ rollout: rollout, validate_only: validate_only, request_id: request_id, update_mask: update_mask }) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use named arguments - client.update_rollout rollout: rollout, validate_only: validate_only, request_id: request_id, update_mask: update_mask do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object - client.update_rollout ::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::UpdateRolloutRequest.new(rollout: rollout, validate_only: validate_only, request_id: request_id, update_mask: update_mask) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use hash object with options - client.update_rollout({ rollout: rollout, validate_only: validate_only, request_id: request_id, update_mask: update_mask }, grpc_options) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object with options - client.update_rollout(::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::UpdateRolloutRequest.new(rollout: rollout, validate_only: validate_only, request_id: request_id, update_mask: update_mask), grpc_options) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Verify method calls - assert_equal 5, update_rollout_client_stub.call_rpc_count - end - end - - def test_delete_rollout - # Create GRPC objects. - grpc_response = ::Google::Protobuf::Empty.new - grpc_operation = GRPC::ActiveCall::Operation.new nil - grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - grpc_options = {} - - # Create request parameters for a unary method. - name = "hello world" - etag = "hello world" - validate_only = true - request_id = "hello world" - - delete_rollout_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :delete_rollout, name - assert_kind_of ::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::DeleteRolloutRequest, request - assert_equal "hello world", request["name"] - assert_equal "hello world", request["etag"] - assert_equal true, request["validate_only"] - assert_equal "hello world", request["request_id"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, delete_rollout_client_stub do - # Create client - client = ::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::SaasRollouts::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.delete_rollout({ name: name, etag: etag, validate_only: validate_only, request_id: request_id }) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use named arguments - client.delete_rollout name: name, etag: etag, validate_only: validate_only, request_id: request_id do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object - client.delete_rollout ::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::DeleteRolloutRequest.new(name: name, etag: etag, validate_only: validate_only, request_id: request_id) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use hash object with options - client.delete_rollout({ name: name, etag: etag, validate_only: validate_only, request_id: request_id }, grpc_options) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object with options - client.delete_rollout(::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::DeleteRolloutRequest.new(name: name, etag: etag, validate_only: validate_only, request_id: request_id), grpc_options) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Verify method calls - assert_equal 5, delete_rollout_client_stub.call_rpc_count - end - end - - def test_list_rollout_kinds - # Create GRPC objects. - grpc_response = ::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::ListRolloutKindsResponse.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" - order_by = "hello world" - - list_rollout_kinds_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :list_rollout_kinds, name - assert_kind_of ::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::ListRolloutKindsRequest, 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"] - assert_equal "hello world", request["order_by"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, list_rollout_kinds_client_stub do - # Create client - client = ::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::SaasRollouts::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.list_rollout_kinds({ parent: parent, page_size: page_size, page_token: page_token, filter: filter, order_by: order_by }) 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_rollout_kinds parent: parent, page_size: page_size, page_token: page_token, filter: filter, order_by: order_by 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_rollout_kinds ::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::ListRolloutKindsRequest.new(parent: parent, page_size: page_size, page_token: page_token, filter: filter, order_by: order_by) 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_rollout_kinds({ parent: parent, page_size: page_size, page_token: page_token, filter: filter, order_by: order_by }, 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_rollout_kinds(::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::ListRolloutKindsRequest.new(parent: parent, page_size: page_size, page_token: page_token, filter: filter, order_by: order_by), 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_rollout_kinds_client_stub.call_rpc_count - end - end - - def test_get_rollout_kind - # Create GRPC objects. - grpc_response = ::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::RolloutKind.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_rollout_kind_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :get_rollout_kind, name - assert_kind_of ::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::GetRolloutKindRequest, request - assert_equal "hello world", request["name"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, get_rollout_kind_client_stub do - # Create client - client = ::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::SaasRollouts::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.get_rollout_kind({ name: name }) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use named arguments - client.get_rollout_kind name: name do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object - client.get_rollout_kind ::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::GetRolloutKindRequest.new(name: name) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use hash object with options - client.get_rollout_kind({ 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_rollout_kind(::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::GetRolloutKindRequest.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_rollout_kind_client_stub.call_rpc_count - end - end - - def test_create_rollout_kind - # Create GRPC objects. - grpc_response = ::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::RolloutKind.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" - rollout_kind_id = "hello world" - rollout_kind = {} - validate_only = true - request_id = "hello world" - - create_rollout_kind_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :create_rollout_kind, name - assert_kind_of ::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::CreateRolloutKindRequest, request - assert_equal "hello world", request["parent"] - assert_equal "hello world", request["rollout_kind_id"] - assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::RolloutKind), request["rollout_kind"] - assert_equal true, request["validate_only"] - assert_equal "hello world", request["request_id"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, create_rollout_kind_client_stub do - # Create client - client = ::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::SaasRollouts::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.create_rollout_kind({ parent: parent, rollout_kind_id: rollout_kind_id, rollout_kind: rollout_kind, validate_only: validate_only, request_id: request_id }) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use named arguments - client.create_rollout_kind parent: parent, rollout_kind_id: rollout_kind_id, rollout_kind: rollout_kind, validate_only: validate_only, request_id: request_id do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object - client.create_rollout_kind ::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::CreateRolloutKindRequest.new(parent: parent, rollout_kind_id: rollout_kind_id, rollout_kind: rollout_kind, validate_only: validate_only, request_id: request_id) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use hash object with options - client.create_rollout_kind({ parent: parent, rollout_kind_id: rollout_kind_id, rollout_kind: rollout_kind, validate_only: validate_only, request_id: request_id }, grpc_options) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object with options - client.create_rollout_kind(::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::CreateRolloutKindRequest.new(parent: parent, rollout_kind_id: rollout_kind_id, rollout_kind: rollout_kind, validate_only: validate_only, request_id: request_id), grpc_options) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Verify method calls - assert_equal 5, create_rollout_kind_client_stub.call_rpc_count - end - end - - def test_update_rollout_kind - # Create GRPC objects. - grpc_response = ::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::RolloutKind.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. - rollout_kind = {} - validate_only = true - request_id = "hello world" - update_mask = {} - - update_rollout_kind_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :update_rollout_kind, name - assert_kind_of ::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::UpdateRolloutKindRequest, request - assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::RolloutKind), request["rollout_kind"] - assert_equal true, request["validate_only"] - assert_equal "hello world", request["request_id"] - assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Protobuf::FieldMask), request["update_mask"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, update_rollout_kind_client_stub do - # Create client - client = ::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::SaasRollouts::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.update_rollout_kind({ rollout_kind: rollout_kind, validate_only: validate_only, request_id: request_id, update_mask: update_mask }) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use named arguments - client.update_rollout_kind rollout_kind: rollout_kind, validate_only: validate_only, request_id: request_id, update_mask: update_mask do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object - client.update_rollout_kind ::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::UpdateRolloutKindRequest.new(rollout_kind: rollout_kind, validate_only: validate_only, request_id: request_id, update_mask: update_mask) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use hash object with options - client.update_rollout_kind({ rollout_kind: rollout_kind, validate_only: validate_only, request_id: request_id, update_mask: update_mask }, grpc_options) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object with options - client.update_rollout_kind(::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::UpdateRolloutKindRequest.new(rollout_kind: rollout_kind, validate_only: validate_only, request_id: request_id, update_mask: update_mask), grpc_options) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Verify method calls - assert_equal 5, update_rollout_kind_client_stub.call_rpc_count - end - end - - def test_delete_rollout_kind - # Create GRPC objects. - grpc_response = ::Google::Protobuf::Empty.new - grpc_operation = GRPC::ActiveCall::Operation.new nil - grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - grpc_options = {} - - # Create request parameters for a unary method. - name = "hello world" - etag = "hello world" - validate_only = true - request_id = "hello world" - - delete_rollout_kind_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :delete_rollout_kind, name - assert_kind_of ::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::DeleteRolloutKindRequest, request - assert_equal "hello world", request["name"] - assert_equal "hello world", request["etag"] - assert_equal true, request["validate_only"] - assert_equal "hello world", request["request_id"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, delete_rollout_kind_client_stub do - # Create client - client = ::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::SaasRollouts::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.delete_rollout_kind({ name: name, etag: etag, validate_only: validate_only, request_id: request_id }) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use named arguments - client.delete_rollout_kind name: name, etag: etag, validate_only: validate_only, request_id: request_id do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object - client.delete_rollout_kind ::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::DeleteRolloutKindRequest.new(name: name, etag: etag, validate_only: validate_only, request_id: request_id) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use hash object with options - client.delete_rollout_kind({ name: name, etag: etag, validate_only: validate_only, request_id: request_id }, grpc_options) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object with options - client.delete_rollout_kind(::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::DeleteRolloutKindRequest.new(name: name, etag: etag, validate_only: validate_only, request_id: request_id), grpc_options) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Verify method calls - assert_equal 5, delete_rollout_kind_client_stub.call_rpc_count - end - end - - def test_configure - grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - - client = block_config = config = nil - dummy_stub = ClientStub.new nil, nil - Gapic::ServiceStub.stub :new, dummy_stub do - client = ::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::SaasRollouts::Client.new do |config| - config.credentials = grpc_channel - end - end - - config = client.configure do |c| - block_config = c - end - - assert_same block_config, config - assert_kind_of ::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::SaasRollouts::Client::Configuration, config - end - - def test_credentials - key = OpenSSL::PKey::RSA.new 2048 - cred_json = { - "private_key" => key.to_pem, - "client_email" => "app@developer.gserviceaccount.com", - "type" => "service_account" - } - key_file = StringIO.new cred_json.to_json - creds = Google::Auth::ServiceAccountCredentials.make_creds({ json_key_io: key_file }) - - dummy_stub = ClientStub.new nil, nil - Gapic::ServiceStub.stub :new, dummy_stub do - client = ::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::SaasRollouts::Client.new do |config| - config.credentials = creds - end - assert_kind_of ::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::SaasRollouts::Client, client - assert_equal creds, client.configure.credentials - end - end -end diff --git a/owl-bot-staging/google-cloud-saas_platform-saas_service_mgmt-v1beta1/test/helper.rb b/owl-bot-staging/google-cloud-saas_platform-saas_service_mgmt-v1beta1/test/helper.rb deleted file mode 100644 index 672b337030e7..000000000000 --- a/owl-bot-staging/google-cloud-saas_platform-saas_service_mgmt-v1beta1/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" diff --git a/owl-bot-staging/google-cloud-scheduler-v1/.gitignore b/owl-bot-staging/google-cloud-scheduler-v1/.gitignore deleted file mode 100644 index 0135b6bc6cfc..000000000000 --- a/owl-bot-staging/google-cloud-scheduler-v1/.gitignore +++ /dev/null @@ -1,22 +0,0 @@ -# Ignore bundler lockfiles -Gemfile.lock -gems.locked - -# Ignore documentation output -doc/* -.yardoc/* - -# Ignore test output -coverage/* - -# Ignore build artifacts -pkg/* - -# Ignore files commonly present in certain dev environments -.vagrant -.DS_STORE -.idea -*.iml - -# Ignore synth output -__pycache__ diff --git a/owl-bot-staging/google-cloud-scheduler-v1/.repo-metadata.json b/owl-bot-staging/google-cloud-scheduler-v1/.repo-metadata.json deleted file mode 100644 index fd620042e2d3..000000000000 --- a/owl-bot-staging/google-cloud-scheduler-v1/.repo-metadata.json +++ /dev/null @@ -1,18 +0,0 @@ -{ - "api_id": "cloudscheduler.googleapis.com", - "api_shortname": "cloudscheduler", - "client_documentation": "https://cloud.google.com/ruby/docs/reference/google-cloud-scheduler-v1/latest", - "distribution_name": "google-cloud-scheduler-v1", - "is_cloud": true, - "language": "ruby", - "name": "cloudscheduler", - "name_pretty": "Cloud Scheduler V1 API", - "product_documentation": "https://cloud.google.com/scheduler", - "release_level": "unreleased", - "repo": "googleapis/google-cloud-ruby", - "requires_billing": true, - "ruby-cloud-description": "Cloud Scheduler is a fully managed enterprise-grade cron job scheduler. It allows you to schedule virtually any job, including batch, big data jobs, cloud infrastructure operations, and more. You can automate everything, including retries in case of failure to reduce manual toil and intervention. Cloud Scheduler even acts as a single pane of glass, allowing you to manage all your automation tasks from one place. Note that google-cloud-scheduler-v1 is a version-specific client library. For most uses, we recommend installing the main client library google-cloud-scheduler instead. See the readme for more details.", - "ruby-cloud-env-prefix": "SCHEDULER", - "ruby-cloud-product-url": "https://cloud.google.com/scheduler", - "library_type": "GAPIC_AUTO" -} diff --git a/owl-bot-staging/google-cloud-scheduler-v1/.rubocop.yml b/owl-bot-staging/google-cloud-scheduler-v1/.rubocop.yml deleted file mode 100644 index 1aa300a65945..000000000000 --- a/owl-bot-staging/google-cloud-scheduler-v1/.rubocop.yml +++ /dev/null @@ -1,33 +0,0 @@ -inherit_gem: - google-style: google-style.yml - -AllCops: - Exclude: - - "google-cloud-scheduler-v1.gemspec" - - "lib/**/*_pb.rb" - - "proto_docs/**/*" - - "test/**/*" - - "acceptance/**/*" - - "samples/acceptance/**/*" - - "Rakefile" - -Layout/LineLength: - Enabled: false -Metrics/AbcSize: - Enabled: false -Metrics/ClassLength: - Enabled: false -Metrics/CyclomaticComplexity: - Enabled: false -Metrics/MethodLength: - Enabled: false -Metrics/ModuleLength: - Enabled: false -Metrics/PerceivedComplexity: - Enabled: false -Naming/AccessorMethodName: - Exclude: - - "snippets/**/*.rb" -Naming/FileName: - Exclude: - - "lib/google-cloud-scheduler-v1.rb" diff --git a/owl-bot-staging/google-cloud-scheduler-v1/.toys.rb b/owl-bot-staging/google-cloud-scheduler-v1/.toys.rb deleted file mode 100644 index 177e22456e8a..000000000000 --- a/owl-bot-staging/google-cloud-scheduler-v1/.toys.rb +++ /dev/null @@ -1,28 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -toys_version! ">= 0.15.3" - -if ENV["RUBY_COMMON_TOOLS"] - common_tools_dir = File.expand_path ENV["RUBY_COMMON_TOOLS"] - load File.join(common_tools_dir, "toys", "gapic") -else - load_git remote: "https://github.com/googleapis/ruby-common-tools.git", - path: "toys/gapic", - update: true -end diff --git a/owl-bot-staging/google-cloud-scheduler-v1/.yardopts b/owl-bot-staging/google-cloud-scheduler-v1/.yardopts deleted file mode 100644 index dacf43e29c36..000000000000 --- a/owl-bot-staging/google-cloud-scheduler-v1/.yardopts +++ /dev/null @@ -1,12 +0,0 @@ ---no-private ---title="Cloud Scheduler V1 API" ---exclude _pb\.rb$ ---markup markdown ---markup-provider redcarpet - -./lib/**/*.rb -./proto_docs/**/*.rb -- -README.md -LICENSE.md -AUTHENTICATION.md diff --git a/owl-bot-staging/google-cloud-scheduler-v1/AUTHENTICATION.md b/owl-bot-staging/google-cloud-scheduler-v1/AUTHENTICATION.md deleted file mode 100644 index b1f5a6bb6432..000000000000 --- a/owl-bot-staging/google-cloud-scheduler-v1/AUTHENTICATION.md +++ /dev/null @@ -1,122 +0,0 @@ -# Authentication - -The recommended way to authenticate to the google-cloud-scheduler-v1 library is to use -[Application Default Credentials (ADC)](https://cloud.google.com/docs/authentication/application-default-credentials). -To review all of your authentication options, see [Credentials lookup](#credential-lookup). - -## Quickstart - -The following example shows how to set up authentication for a local development -environment with your user credentials. - -**NOTE:** This method is _not_ recommended for running in production. User credentials -should be used only during development. - -1. [Download and install the Google Cloud CLI](https://cloud.google.com/sdk). -2. Set up a local ADC file with your user credentials: - -```sh -gcloud auth application-default login -``` - -3. Write code as if already authenticated. - -For more information about setting up authentication for a local development environment, see -[Set up Application Default Credentials](https://cloud.google.com/docs/authentication/provide-credentials-adc#local-dev). - -## Credential Lookup - -The google-cloud-scheduler-v1 library provides several mechanisms to configure your system. -Generally, using Application Default Credentials to facilitate automatic -credentials discovery is the easist method. But if you need to explicitly specify -credentials, there are several methods available to you. - -Credentials are accepted in the following ways, in the following order or precedence: - -1. Credentials specified in method arguments -2. Credentials specified in configuration -3. Credentials pointed to or included in environment variables -4. Credentials found in local ADC file -5. Credentials returned by the metadata server for the attached service account (GCP) - -### Configuration - -You can configure a path to a JSON credentials file, either for an individual client object or -globally, for all client objects. The JSON file can contain credentials created for -[workload identity federation](https://cloud.google.com/iam/docs/workload-identity-federation), -[workforce identity federation](https://cloud.google.com/iam/docs/workforce-identity-federation), or a -[service account key](https://cloud.google.com/docs/authentication/provide-credentials-adc#local-key). - -Note: Service account keys are a security risk if not managed correctly. You should -[choose a more secure alternative to service account keys](https://cloud.google.com/docs/authentication#auth-decision-tree) -whenever possible. - -To configure a credentials file for an individual client initialization: - -```ruby -require "google/cloud/scheduler/v1" - -client = ::Google::Cloud::Scheduler::V1::CloudScheduler::Client.new do |config| - config.credentials = "path/to/credentialfile.json" -end -``` - -To configure a credentials file globally for all clients: - -```ruby -require "google/cloud/scheduler/v1" - -::Google::Cloud::Scheduler::V1::CloudScheduler::Client.configure do |config| - config.credentials = "path/to/credentialfile.json" -end - -client = ::Google::Cloud::Scheduler::V1::CloudScheduler::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-scheduler-v1 -checks for credentials are: - -* `GOOGLE_CLOUD_CREDENTIALS` - Path to JSON file, or JSON contents -* `GOOGLE_APPLICATION_CREDENTIALS` - Path to JSON file - -```ruby -require "google/cloud/scheduler/v1" - -ENV["GOOGLE_APPLICATION_CREDENTIALS"] = "path/to/credentialfile.json" - -client = ::Google::Cloud::Scheduler::V1::CloudScheduler::Client.new -``` - -### Local ADC file - -You can set up a local ADC file with your user credentials for authentication during -development. If credentials are not provided in code or in environment variables, -then the local ADC credentials are discovered. - -Follow the steps in [Quickstart](#quickstart) to set up a local ADC file. - -### Google Cloud Platform environments - -When running on Google Cloud Platform (GCP), including Google Compute Engine -(GCE), Google Kubernetes Engine (GKE), Google App Engine (GAE), Google Cloud -Functions (GCF) and Cloud Run, credentials are retrieved from the attached -service account automatically. Code should be written as if already authenticated. - -For more information, see -[Set up ADC for Google Cloud services](https://cloud.google.com/docs/authentication/provide-credentials-adc#attached-sa). diff --git a/owl-bot-staging/google-cloud-scheduler-v1/CHANGELOG.md b/owl-bot-staging/google-cloud-scheduler-v1/CHANGELOG.md deleted file mode 100644 index f88957a62ba2..000000000000 --- a/owl-bot-staging/google-cloud-scheduler-v1/CHANGELOG.md +++ /dev/null @@ -1,2 +0,0 @@ -# Release History - diff --git a/owl-bot-staging/google-cloud-scheduler-v1/Gemfile b/owl-bot-staging/google-cloud-scheduler-v1/Gemfile deleted file mode 100644 index 1d08558908d8..000000000000 --- a/owl-bot-staging/google-cloud-scheduler-v1/Gemfile +++ /dev/null @@ -1,14 +0,0 @@ -source "https://rubygems.org" - -gemspec - -gem "google-style", "~> 1.32.0" -gem "irb", "~> 1.17" -gem "minitest", "~> 6.0.2" -gem "minitest-focus", "~> 1.4" -gem "minitest-mock", "~> 5.27" -gem "minitest-rg", "~> 5.3" -gem "ostruct", "~> 0.5.5" -gem "rake", ">= 13.0" -gem "redcarpet", "~> 3.6" -gem "yard", "~> 0.9" diff --git a/owl-bot-staging/google-cloud-scheduler-v1/LICENSE.md b/owl-bot-staging/google-cloud-scheduler-v1/LICENSE.md deleted file mode 100644 index c261857ba6ad..000000000000 --- a/owl-bot-staging/google-cloud-scheduler-v1/LICENSE.md +++ /dev/null @@ -1,201 +0,0 @@ - Apache License - Version 2.0, January 2004 - http://www.apache.org/licenses/ - - TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION - - 1. Definitions. - - "License" shall mean the terms and conditions for use, reproduction, - and distribution as defined by Sections 1 through 9 of this document. - - "Licensor" shall mean the copyright owner or entity authorized by - the copyright owner that is granting the License. - - "Legal Entity" shall mean the union of the acting entity and all - other entities that control, are controlled by, or are under common - control with that entity. For the purposes of this definition, - "control" means (i) the power, direct or indirect, to cause the - direction or management of such entity, whether by contract or - otherwise, or (ii) ownership of fifty percent (50%) or more of the - outstanding shares, or (iii) beneficial ownership of such entity. - - "You" (or "Your") shall mean an individual or Legal Entity - exercising permissions granted by this License. - - "Source" form shall mean the preferred form for making modifications, - including but not limited to software source code, documentation - source, and configuration files. - - "Object" form shall mean any form resulting from mechanical - transformation or translation of a Source form, including but - not limited to compiled object code, generated documentation, - and conversions to other media types. - - "Work" shall mean the work of authorship, whether in Source or - Object form, made available under the License, as indicated by a - copyright notice that is included in or attached to the work - (an example is provided in the Appendix below). - - "Derivative Works" shall mean any work, whether in Source or Object - form, that is based on (or derived from) the Work and for which the - editorial revisions, annotations, elaborations, or other modifications - represent, as a whole, an original work of authorship. For the purposes - of this License, Derivative Works shall not include works that remain - separable from, or merely link (or bind by name) to the interfaces of, - the Work and Derivative Works thereof. - - "Contribution" shall mean any work of authorship, including - the original version of the Work and any modifications or additions - to that Work or Derivative Works thereof, that is intentionally - submitted to Licensor for inclusion in the Work by the copyright owner - or by an individual or Legal Entity authorized to submit on behalf of - the copyright owner. For the purposes of this definition, "submitted" - means any form of electronic, verbal, or written communication sent - to the Licensor or its representatives, including but not limited to - communication on electronic mailing lists, source code control systems, - and issue tracking systems that are managed by, or on behalf of, the - Licensor for the purpose of discussing and improving the Work, but - excluding communication that is conspicuously marked or otherwise - designated in writing by the copyright owner as "Not a Contribution." - - "Contributor" shall mean Licensor and any individual or Legal Entity - on behalf of whom a Contribution has been received by Licensor and - subsequently incorporated within the Work. - - 2. Grant of Copyright License. Subject to the terms and conditions of - this License, each Contributor hereby grants to You a perpetual, - worldwide, non-exclusive, no-charge, royalty-free, irrevocable - copyright license to reproduce, prepare Derivative Works of, - publicly display, publicly perform, sublicense, and distribute the - Work and such Derivative Works in Source or Object form. - - 3. Grant of Patent License. Subject to the terms and conditions of - this License, each Contributor hereby grants to You a perpetual, - worldwide, non-exclusive, no-charge, royalty-free, irrevocable - (except as stated in this section) patent license to make, have made, - use, offer to sell, sell, import, and otherwise transfer the Work, - where such license applies only to those patent claims licensable - by such Contributor that are necessarily infringed by their - Contribution(s) alone or by combination of their Contribution(s) - with the Work to which such Contribution(s) was submitted. If You - institute patent litigation against any entity (including a - cross-claim or counterclaim in a lawsuit) alleging that the Work - or a Contribution incorporated within the Work constitutes direct - or contributory patent infringement, then any patent licenses - granted to You under this License for that Work shall terminate - as of the date such litigation is filed. - - 4. Redistribution. You may reproduce and distribute copies of the - Work or Derivative Works thereof in any medium, with or without - modifications, and in Source or Object form, provided that You - meet the following conditions: - - (a) You must give any other recipients of the Work or - Derivative Works a copy of this License; and - - (b) You must cause any modified files to carry prominent notices - stating that You changed the files; and - - (c) You must retain, in the Source form of any Derivative Works - that You distribute, all copyright, patent, trademark, and - attribution notices from the Source form of the Work, - excluding those notices that do not pertain to any part of - the Derivative Works; and - - (d) If the Work includes a "NOTICE" text file as part of its - distribution, then any Derivative Works that You distribute must - include a readable copy of the attribution notices contained - within such NOTICE file, excluding those notices that do not - pertain to any part of the Derivative Works, in at least one - of the following places: within a NOTICE text file distributed - as part of the Derivative Works; within the Source form or - documentation, if provided along with the Derivative Works; or, - within a display generated by the Derivative Works, if and - wherever such third-party notices normally appear. The contents - of the NOTICE file are for informational purposes only and - do not modify the License. You may add Your own attribution - notices within Derivative Works that You distribute, alongside - or as an addendum to the NOTICE text from the Work, provided - that such additional attribution notices cannot be construed - as modifying the License. - - You may add Your own copyright statement to Your modifications and - may provide additional or different license terms and conditions - for use, reproduction, or distribution of Your modifications, or - for any such Derivative Works as a whole, provided Your use, - reproduction, and distribution of the Work otherwise complies with - the conditions stated in this License. - - 5. Submission of Contributions. Unless You explicitly state otherwise, - any Contribution intentionally submitted for inclusion in the Work - by You to the Licensor shall be under the terms and conditions of - this License, without any additional terms or conditions. - Notwithstanding the above, nothing herein shall supersede or modify - the terms of any separate license agreement you may have executed - with Licensor regarding such Contributions. - - 6. Trademarks. This License does not grant permission to use the trade - names, trademarks, service marks, or product names of the Licensor, - except as required for reasonable and customary use in describing the - origin of the Work and reproducing the content of the NOTICE file. - - 7. Disclaimer of Warranty. Unless required by applicable law or - agreed to in writing, Licensor provides the Work (and each - Contributor provides its Contributions) on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or - implied, including, without limitation, any warranties or conditions - of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A - PARTICULAR PURPOSE. You are solely responsible for determining the - appropriateness of using or redistributing the Work and assume any - risks associated with Your exercise of permissions under this License. - - 8. Limitation of Liability. In no event and under no legal theory, - whether in tort (including negligence), contract, or otherwise, - unless required by applicable law (such as deliberate and grossly - negligent acts) or agreed to in writing, shall any Contributor be - liable to You for damages, including any direct, indirect, special, - incidental, or consequential damages of any character arising as a - result of this License or out of the use or inability to use the - Work (including but not limited to damages for loss of goodwill, - work stoppage, computer failure or malfunction, or any and all - other commercial damages or losses), even if such Contributor - has been advised of the possibility of such damages. - - 9. Accepting Warranty or Additional Liability. While redistributing - the Work or Derivative Works thereof, You may choose to offer, - and charge a fee for, acceptance of support, warranty, indemnity, - or other liability obligations and/or rights consistent with this - License. However, in accepting such obligations, You may act only - on Your own behalf and on Your sole responsibility, not on behalf - of any other Contributor, and only if You agree to indemnify, - defend, and hold each Contributor harmless for any liability - incurred by, or claims asserted against, such Contributor by reason - of your accepting any such warranty or additional liability. - - END OF TERMS AND CONDITIONS - - APPENDIX: How to apply the Apache License to your work. - - To apply the Apache License to your work, attach the following - boilerplate notice, with the fields enclosed by brackets "[]" - replaced with your own identifying information. (Don't include - the brackets!) The text should be enclosed in the appropriate - comment syntax for the file format. We also recommend that a - file or class name and description of purpose be included on the - same "printed page" as the copyright notice for easier - identification within third-party archives. - - Copyright [yyyy] [name of copyright owner] - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. diff --git a/owl-bot-staging/google-cloud-scheduler-v1/README.md b/owl-bot-staging/google-cloud-scheduler-v1/README.md deleted file mode 100644 index d6f063bc8627..000000000000 --- a/owl-bot-staging/google-cloud-scheduler-v1/README.md +++ /dev/null @@ -1,154 +0,0 @@ -# Ruby Client for the Cloud Scheduler V1 API - -Creates and manages jobs run on a regular recurring schedule. - -Cloud Scheduler is a fully managed enterprise-grade cron job scheduler. It allows you to schedule virtually any job, including batch, big data jobs, cloud infrastructure operations, and more. You can automate everything, including retries in case of failure to reduce manual toil and intervention. Cloud Scheduler even acts as a single pane of glass, allowing you to manage all your automation tasks from one place. - -https://github.com/googleapis/google-cloud-ruby - -This gem is a _versioned_ client. It provides basic client classes for a -specific version of the Cloud Scheduler V1 API. Most users should consider using -the main client gem, -[google-cloud-scheduler](https://rubygems.org/gems/google-cloud-scheduler). -See the section below titled *Which client should I use?* for more information. - -## Installation - -``` -$ gem install google-cloud-scheduler-v1 -``` - -## Before You Begin - -In order to use this library, you first need to go through the following steps: - -1. [Select or create a Cloud Platform project.](https://console.cloud.google.com/project) -1. [Enable billing for your project.](https://cloud.google.com/billing/docs/how-to/modify-project#enable_billing_for_a_project) -1. [Enable the API.](https://console.cloud.google.com/apis/library/cloudscheduler.googleapis.com) -1. [Set up authentication.](AUTHENTICATION.md) - -## Quick Start - -```ruby -require "google/cloud/scheduler/v1" - -client = ::Google::Cloud::Scheduler::V1::CloudScheduler::Client.new -request = ::Google::Cloud::Scheduler::V1::ListJobsRequest.new # (request fields as keyword arguments...) -response = client.list_jobs request -``` - -View the [Client Library Documentation](https://cloud.google.com/ruby/docs/reference/google-cloud-scheduler-v1/latest) -for class and method documentation. - -See also the [Product Documentation](https://cloud.google.com/scheduler) -for general usage information. - -## Debug Logging - -This library comes with opt-in Debug Logging that can help you troubleshoot -your application's integration with the API. When logging is activated, key -events such as requests and responses, along with data payloads and metadata -such as headers and client configuration, are logged to the standard error -stream. - -**WARNING:** Client Library Debug Logging includes your data payloads in -plaintext, which could include sensitive data such as PII for yourself or your -customers, private keys, or other security data that could be compromising if -leaked. Always practice good data hygiene with your application logs, and follow -the principle of least access. Google also recommends that Client Library Debug -Logging be enabled only temporarily during active debugging, and not used -permanently in production. - -To enable logging, set the environment variable `GOOGLE_SDK_RUBY_LOGGING_GEMS` -to the value `all`. Alternatively, you can set the value to a comma-delimited -list of client library gem names. This will select the default logging behavior, -which writes logs to the standard error stream. On a local workstation, this may -result in logs appearing on the console. When running on a Google Cloud hosting -service such as [Google Cloud Run](https://cloud.google.com/run), this generally -results in logs appearing alongside your application logs in the -[Google Cloud Logging](https://cloud.google.com/logging/) service. - -You can customize logging by modifying the `logger` configuration when -constructing a client object. For example: - -```ruby -require "google/cloud/scheduler/v1" -require "logger" - -client = ::Google::Cloud::Scheduler::V1::CloudScheduler::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-scheduler`, -and lower-level _versioned_ client libraries with names such as -`google-cloud-scheduler-v1`. -_In most cases, you should install the main client._ - -### What's the difference between the main client and a versioned client? - -A _versioned client_ provides a basic set of data types and client classes for -a _single version_ of a specific service. (That is, for a service with multiple -versions, there might be a separate versioned client for each service version.) -Most versioned clients are written and maintained by a code generator. - -The _main client_ is designed to provide you with the _recommended_ client -interfaces for the service. There will be only one main client for any given -service, even a service with multiple versions. The main client includes -factory methods for constructing the client objects we recommend for most -users. In some cases, those will be classes provided by an underlying versioned -client; in other cases, they will be handwritten higher-level client objects -with additional capabilities, convenience methods, or best practices built in. -Generally, the main client will default to a recommended service version, -although in some cases you can override this if you need to talk to a specific -service version. - -### Why would I want to use the main client? - -We recommend that most users install the main client gem for a service. You can -identify this gem as the one _without_ a version in its name, e.g. -`google-cloud-scheduler`. -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-scheduler-v1`. - -### What about the google-apis- clients? - -Client library gems with names that begin with `google-apis-` are based on an -older code generation technology. They talk to a REST/JSON backend (whereas -most modern clients talk to a [gRPC](https://grpc.io/) backend) and they may -not offer the same performance, features, and ease of use provided by more -modern clients. - -The `google-apis-` clients have wide coverage across Google services, so you -might need to use one if there is no modern client available for the service. -However, if a modern client is available, we generally recommend it over the -older `google-apis-` clients. diff --git a/owl-bot-staging/google-cloud-scheduler-v1/Rakefile b/owl-bot-staging/google-cloud-scheduler-v1/Rakefile deleted file mode 100644 index 8144c51373a5..000000000000 --- a/owl-bot-staging/google-cloud-scheduler-v1/Rakefile +++ /dev/null @@ -1,169 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -require "bundler/setup" -require "bundler/gem_tasks" - -require "rubocop/rake_task" -RuboCop::RakeTask.new - -require "rake/testtask" -desc "Run tests." -Rake::TestTask.new do |t| - t.libs << "test" - t.test_files = FileList["test/**/*_test.rb"] - t.warning = false -end - -desc "Runs the smoke tests." -Rake::TestTask.new :smoke_test do |t| - t.test_files = FileList["acceptance/**/*smoke_test.rb"] - t.warning = false -end - -# Acceptance tests -desc "Run the google-cloud-scheduler-v1 acceptance tests." -task :acceptance, :project, :keyfile do |t, args| - project = args[:project] - project ||= - ENV["SCHEDULER_TEST_PROJECT"] || - ENV["GCLOUD_TEST_PROJECT"] - keyfile = args[:keyfile] - keyfile ||= - ENV["SCHEDULER_TEST_KEYFILE"] || - ENV["GCLOUD_TEST_KEYFILE"] - if keyfile - keyfile = File.read keyfile - else - keyfile ||= - ENV["SCHEDULER_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 SCHEDULER_TEST_PROJECT=test123 SCHEDULER_TEST_KEYFILE=/path/to/keyfile.json rake acceptance" - end - require "google/cloud/scheduler/v1/cloud_scheduler/credentials" - ::Google::Cloud::Scheduler::V1::CloudScheduler::Credentials.env_vars.each do |path| - ENV[path] = nil - end - ENV["SCHEDULER_PROJECT"] = project - ENV["SCHEDULER_TEST_PROJECT"] = project - ENV["SCHEDULER_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-scheduler-v1 gem has no acceptance tests." - end - end - - desc "Run acceptance cleanup." - task :cleanup do - end -end - -task :samples do - Rake::Task["samples:latest"].invoke -end - -namespace :samples do - task :latest do - if File.directory? "samples" - Dir.chdir "samples" do - Bundler.with_clean_env do - ENV["GOOGLE_CLOUD_SAMPLES_TEST"] = "not_master" - sh "bundle update" - sh "bundle exec rake test" - end - end - else - puts "The google-cloud-scheduler-v1 gem has no samples to test." - end - end - - task :master do - if File.directory? "samples" - Dir.chdir "samples" do - Bundler.with_clean_env do - ENV["GOOGLE_CLOUD_SAMPLES_TEST"] = "master" - sh "bundle update" - sh "bundle exec rake test" - end - end - else - puts "The google-cloud-scheduler-v1 gem has no samples to test." - end - end -end - -require "yard" -require "yard/rake/yardoc_task" -YARD::Rake::YardocTask.new do |y| - y.options << "--fail-on-warning" -end - -desc "Run yard-doctest example tests." -task :doctest do - puts "The google-cloud-scheduler-v1 gem does not have doctest tests." -end - -desc "Run the CI build" -task :ci do - header "BUILDING google-cloud-scheduler-v1" - header "google-cloud-scheduler-v1 rubocop", "*" - Rake::Task[:rubocop].invoke - header "google-cloud-scheduler-v1 yard", "*" - Rake::Task[:yard].invoke - header "google-cloud-scheduler-v1 test", "*" - Rake::Task[:test].invoke -end - -namespace :ci do - desc "Run the CI build, with smoke tests." - task :smoke_test do - Rake::Task[:ci].invoke - header "google-cloud-scheduler-v1 smoke_test", "*" - Rake::Task[:smoke_test].invoke - end - desc "Run the CI build, with acceptance tests." - task :acceptance do - Rake::Task[:ci].invoke - header "google-cloud-scheduler-v1 acceptance", "*" - Rake::Task[:acceptance].invoke - end - task :a do - # This is a handy shortcut to save typing - Rake::Task["ci:acceptance"].invoke - end -end - -task default: :test - -def header str, token = "#" - line_length = str.length + 8 - puts "" - puts token * line_length - puts "#{token * 3} #{str} #{token * 3}" - puts token * line_length - puts "" -end diff --git a/owl-bot-staging/google-cloud-scheduler-v1/gapic_metadata.json b/owl-bot-staging/google-cloud-scheduler-v1/gapic_metadata.json deleted file mode 100644 index df9b4bb49562..000000000000 --- a/owl-bot-staging/google-cloud-scheduler-v1/gapic_metadata.json +++ /dev/null @@ -1,58 +0,0 @@ -{ - "schema": "1.0", - "comment": "This file maps proto services/RPCs to the corresponding library clients/methods", - "language": "ruby", - "protoPackage": "google.cloud.scheduler.v1", - "libraryPackage": "::Google::Cloud::Scheduler::V1", - "services": { - "CloudScheduler": { - "clients": { - "grpc": { - "libraryClient": "::Google::Cloud::Scheduler::V1::CloudScheduler::Client", - "rpcs": { - "ListJobs": { - "methods": [ - "list_jobs" - ] - }, - "GetJob": { - "methods": [ - "get_job" - ] - }, - "CreateJob": { - "methods": [ - "create_job" - ] - }, - "UpdateJob": { - "methods": [ - "update_job" - ] - }, - "DeleteJob": { - "methods": [ - "delete_job" - ] - }, - "PauseJob": { - "methods": [ - "pause_job" - ] - }, - "ResumeJob": { - "methods": [ - "resume_job" - ] - }, - "RunJob": { - "methods": [ - "run_job" - ] - } - } - } - } - } - } -} diff --git a/owl-bot-staging/google-cloud-scheduler-v1/google-cloud-scheduler-v1.gemspec b/owl-bot-staging/google-cloud-scheduler-v1/google-cloud-scheduler-v1.gemspec deleted file mode 100644 index 32cf7c515b50..000000000000 --- a/owl-bot-staging/google-cloud-scheduler-v1/google-cloud-scheduler-v1.gemspec +++ /dev/null @@ -1,29 +0,0 @@ -# -*- ruby -*- -# encoding: utf-8 - -require File.expand_path("lib/google/cloud/scheduler/v1/version", __dir__) - -Gem::Specification.new do |gem| - gem.name = "google-cloud-scheduler-v1" - gem.version = Google::Cloud::Scheduler::V1::VERSION - - gem.authors = ["Google LLC"] - gem.email = "googleapis-packages@google.com" - gem.description = "Cloud Scheduler is a fully managed enterprise-grade cron job scheduler. It allows you to schedule virtually any job, including batch, big data jobs, cloud infrastructure operations, and more. You can automate everything, including retries in case of failure to reduce manual toil and intervention. Cloud Scheduler even acts as a single pane of glass, allowing you to manage all your automation tasks from one place. Note that google-cloud-scheduler-v1 is a version-specific client library. For most uses, we recommend installing the main client library google-cloud-scheduler instead. See the readme for more details." - gem.summary = "Creates and manages jobs run on a regular recurring schedule." - 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-cloud-scheduler-v1/lib/google-cloud-scheduler-v1.rb b/owl-bot-staging/google-cloud-scheduler-v1/lib/google-cloud-scheduler-v1.rb deleted file mode 100644 index 0b7eee484b27..000000000000 --- a/owl-bot-staging/google-cloud-scheduler-v1/lib/google-cloud-scheduler-v1.rb +++ /dev/null @@ -1,21 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -# This gem does not autoload during Bundler.require. To load this gem, -# issue explicit require statements for the packages desired, e.g.: -# require "google/cloud/scheduler/v1" diff --git a/owl-bot-staging/google-cloud-scheduler-v1/lib/google/cloud/scheduler/v1.rb b/owl-bot-staging/google-cloud-scheduler-v1/lib/google/cloud/scheduler/v1.rb deleted file mode 100644 index 5f416675c340..000000000000 --- a/owl-bot-staging/google-cloud-scheduler-v1/lib/google/cloud/scheduler/v1.rb +++ /dev/null @@ -1,45 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -require "google/cloud/scheduler/v1/cloud_scheduler" -require "google/cloud/scheduler/v1/version" - -module Google - module Cloud - module Scheduler - ## - # API client module. - # - # @example Load this package, including all its services, and instantiate a gRPC client - # - # require "google/cloud/scheduler/v1" - # client = ::Google::Cloud::Scheduler::V1::CloudScheduler::Client.new - # - # @example Load this package, including all its services, and instantiate a REST client - # - # require "google/cloud/scheduler/v1" - # client = ::Google::Cloud::Scheduler::V1::CloudScheduler::Rest::Client.new - # - module V1 - end - end - end -end - -helper_path = ::File.join __dir__, "v1", "_helpers.rb" -require "google/cloud/scheduler/v1/_helpers" if ::File.file? helper_path diff --git a/owl-bot-staging/google-cloud-scheduler-v1/lib/google/cloud/scheduler/v1/bindings_override.rb b/owl-bot-staging/google-cloud-scheduler-v1/lib/google/cloud/scheduler/v1/bindings_override.rb deleted file mode 100644 index 1da2ab067f2d..000000000000 --- a/owl-bot-staging/google-cloud-scheduler-v1/lib/google/cloud/scheduler/v1/bindings_override.rb +++ /dev/null @@ -1,75 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -require "gapic/rest" - -module Google - module Cloud - module Scheduler - ## - # @example Loading just the REST part of this package, including all its services, and instantiating a REST client - # - # require "google/cloud/scheduler/v1/rest" - # client = ::Google::Cloud::Scheduler::V1::CloudScheduler::Rest::Client.new - # - module V1 - ## - # @private - # Initialize the mixin bindings configuration - # - def self.configure - @configure ||= begin - namespace = ["Google", "Cloud", "Scheduler"] - parent_config = while namespace.any? - parent_name = namespace.join "::" - parent_const = const_get parent_name - break parent_const.configure if parent_const.respond_to? :configure - namespace.pop - end - - default_config = ::Gapic::Rest::HttpBindingOverrideConfiguration.new parent_config - default_config.bindings_override["google.cloud.location.Locations.GetLocation"] = [ - Gapic::Rest::GrpcTranscoder::HttpBinding.create_with_validation( - uri_method: :get, - uri_template: "/v1/{name}", - matches: [ - ["name", %r{^projects/[^/]+/locations/[^/]+/?$}, false] - ], - body: nil - ) - ] - default_config.bindings_override["google.cloud.location.Locations.ListLocations"] = [ - - Gapic::Rest::GrpcTranscoder::HttpBinding.create_with_validation( - uri_method: :get, - uri_template: "/v1/{name}/locations", - matches: [ - ["name", %r{^projects/[^/]+/?$}, false] - ], - body: nil - ) - ] - default_config - end - yield @configure if block_given? - @configure - end - end - end - end -end diff --git a/owl-bot-staging/google-cloud-scheduler-v1/lib/google/cloud/scheduler/v1/cloud_scheduler.rb b/owl-bot-staging/google-cloud-scheduler-v1/lib/google/cloud/scheduler/v1/cloud_scheduler.rb deleted file mode 100644 index 2c0701522319..000000000000 --- a/owl-bot-staging/google-cloud-scheduler-v1/lib/google/cloud/scheduler/v1/cloud_scheduler.rb +++ /dev/null @@ -1,56 +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/scheduler/v1/version" - -require "google/cloud/scheduler/v1/cloud_scheduler/credentials" -require "google/cloud/scheduler/v1/cloud_scheduler/paths" -require "google/cloud/scheduler/v1/cloud_scheduler/client" -require "google/cloud/scheduler/v1/cloud_scheduler/rest" - -module Google - module Cloud - module Scheduler - module V1 - ## - # The Cloud Scheduler API allows external entities to reliably - # schedule asynchronous jobs. - # - # @example Load this service and instantiate a gRPC client - # - # require "google/cloud/scheduler/v1/cloud_scheduler" - # client = ::Google::Cloud::Scheduler::V1::CloudScheduler::Client.new - # - # @example Load this service and instantiate a REST client - # - # require "google/cloud/scheduler/v1/cloud_scheduler/rest" - # client = ::Google::Cloud::Scheduler::V1::CloudScheduler::Rest::Client.new - # - module CloudScheduler - end - end - end - end -end - -helper_path = ::File.join __dir__, "cloud_scheduler", "helpers.rb" -require "google/cloud/scheduler/v1/cloud_scheduler/helpers" if ::File.file? helper_path diff --git a/owl-bot-staging/google-cloud-scheduler-v1/lib/google/cloud/scheduler/v1/cloud_scheduler/client.rb b/owl-bot-staging/google-cloud-scheduler-v1/lib/google/cloud/scheduler/v1/cloud_scheduler/client.rb deleted file mode 100644 index b4a3e2d51493..000000000000 --- a/owl-bot-staging/google-cloud-scheduler-v1/lib/google/cloud/scheduler/v1/cloud_scheduler/client.rb +++ /dev/null @@ -1,1229 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -require "google/cloud/errors" -require "google/cloud/scheduler/v1/cloudscheduler_pb" -require "google/cloud/location" - -module Google - module Cloud - module Scheduler - module V1 - module CloudScheduler - ## - # Client for the CloudScheduler service. - # - # The Cloud Scheduler API allows external entities to reliably - # schedule asynchronous jobs. - # - class Client - # @private - API_VERSION = "" - - # @private - DEFAULT_ENDPOINT_TEMPLATE = "cloudscheduler.$UNIVERSE_DOMAIN$" - - include Paths - - # @private - attr_reader :cloud_scheduler_stub - - ## - # Configure the CloudScheduler Client class. - # - # See {::Google::Cloud::Scheduler::V1::CloudScheduler::Client::Configuration} - # for a description of the configuration fields. - # - # @example - # - # # Modify the configuration for all CloudScheduler clients - # ::Google::Cloud::Scheduler::V1::CloudScheduler::Client.configure do |config| - # config.timeout = 10.0 - # end - # - # @yield [config] Configure the Client client. - # @yieldparam config [Client::Configuration] - # - # @return [Client::Configuration] - # - def self.configure - @configure ||= begin - namespace = ["Google", "Cloud", "Scheduler", "V1"] - parent_config = while namespace.any? - parent_name = namespace.join "::" - parent_const = const_get parent_name - break parent_const.configure if parent_const.respond_to? :configure - namespace.pop - end - default_config = Client::Configuration.new parent_config - - default_config.rpcs.list_jobs.timeout = 600.0 - default_config.rpcs.list_jobs.retry_policy = { - initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [4, 14] - } - - default_config.rpcs.get_job.timeout = 600.0 - default_config.rpcs.get_job.retry_policy = { - initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [4, 14] - } - - default_config.rpcs.create_job.timeout = 600.0 - - default_config.rpcs.update_job.timeout = 600.0 - - default_config.rpcs.delete_job.timeout = 600.0 - default_config.rpcs.delete_job.retry_policy = { - initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [4, 14] - } - - default_config.rpcs.pause_job.timeout = 600.0 - - default_config.rpcs.resume_job.timeout = 600.0 - - default_config.rpcs.run_job.timeout = 600.0 - - default_config - end - yield @configure if block_given? - @configure - end - - ## - # Configure the CloudScheduler Client instance. - # - # The configuration is set to the derived mode, meaning that values can be changed, - # but structural changes (adding new fields, etc.) are not allowed. Structural changes - # should be made on {Client.configure}. - # - # See {::Google::Cloud::Scheduler::V1::CloudScheduler::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 - @cloud_scheduler_stub.universe_domain - end - - ## - # Create a new CloudScheduler client object. - # - # @example - # - # # Create a client using the default configuration - # client = ::Google::Cloud::Scheduler::V1::CloudScheduler::Client.new - # - # # Create a client using a custom configuration - # client = ::Google::Cloud::Scheduler::V1::CloudScheduler::Client.new do |config| - # config.timeout = 10.0 - # end - # - # @yield [config] Configure the CloudScheduler client. - # @yieldparam config [Client::Configuration] - # - def initialize - # These require statements are intentionally placed here to initialize - # the gRPC module only when it's required. - # See https://github.com/googleapis/toolkit/issues/446 - require "gapic/grpc" - require "google/cloud/scheduler/v1/cloudscheduler_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 - - @cloud_scheduler_stub = ::Gapic::ServiceStub.new( - ::Google::Cloud::Scheduler::V1::CloudScheduler::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 - ) - - @cloud_scheduler_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 = @cloud_scheduler_stub.endpoint - config.universe_domain = @cloud_scheduler_stub.universe_domain - config.logger = @cloud_scheduler_stub.logger if config.respond_to? :logger= - end - end - - ## - # Get the associated client for mix-in of the Locations. - # - # @return [Google::Cloud::Location::Locations::Client] - # - attr_reader :location_client - - ## - # The logger used for request/response debug logging. - # - # @return [Logger] - # - def logger - @cloud_scheduler_stub.logger - end - - # Service calls - - ## - # Lists jobs. - # - # @overload list_jobs(request, options = nil) - # Pass arguments to `list_jobs` via a request object, either of type - # {::Google::Cloud::Scheduler::V1::ListJobsRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Scheduler::V1::ListJobsRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. - # - # @overload list_jobs(parent: nil, page_size: nil, page_token: nil) - # Pass arguments to `list_jobs` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param parent [::String] - # Required. The location name. For example: - # `projects/PROJECT_ID/locations/LOCATION_ID`. - # @param page_size [::Integer] - # Requested page size. - # - # The maximum page size is 500. If unspecified, the page size will - # be the maximum. Fewer jobs than requested might be returned, - # even if more jobs exist; use next_page_token to determine if more - # jobs exist. - # @param page_token [::String] - # A token identifying a page of results the server will return. To - # request the first page results, page_token must be empty. To - # request the next page of results, page_token must be the value of - # {::Google::Cloud::Scheduler::V1::ListJobsResponse#next_page_token next_page_token} - # returned from the previous call to - # {::Google::Cloud::Scheduler::V1::CloudScheduler::Client#list_jobs ListJobs}. - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Gapic::PagedEnumerable<::Google::Cloud::Scheduler::V1::Job>] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Gapic::PagedEnumerable<::Google::Cloud::Scheduler::V1::Job>] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/cloud/scheduler/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Scheduler::V1::CloudScheduler::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Scheduler::V1::ListJobsRequest.new - # - # # Call the list_jobs method. - # result = client.list_jobs request - # - # # The returned object is of type Gapic::PagedEnumerable. You can iterate - # # over elements, and API calls will be issued to fetch pages as needed. - # result.each do |item| - # # Each element is of type ::Google::Cloud::Scheduler::V1::Job. - # p item - # end - # - def list_jobs request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Scheduler::V1::ListJobsRequest - - # Converts hash and nil to an options object - options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h - - # Customize the options with defaults - metadata = @config.rpcs.list_jobs.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::Scheduler::V1::VERSION - metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - header_params = {} - if request.parent - header_params["parent"] = request.parent - end - - request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") - metadata[:"x-goog-request-params"] ||= request_params_header - - options.apply_defaults timeout: @config.rpcs.list_jobs.timeout, - metadata: metadata, - retry_policy: @config.rpcs.list_jobs.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @cloud_scheduler_stub.call_rpc :list_jobs, request, options: options do |response, operation| - response = ::Gapic::PagedEnumerable.new @cloud_scheduler_stub, :list_jobs, request, response, operation, options - yield response, operation if block_given? - throw :response, response - end - rescue ::GRPC::BadStatus => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Gets a job. - # - # @overload get_job(request, options = nil) - # Pass arguments to `get_job` via a request object, either of type - # {::Google::Cloud::Scheduler::V1::GetJobRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Scheduler::V1::GetJobRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. - # - # @overload get_job(name: nil) - # Pass arguments to `get_job` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param name [::String] - # Required. The job name. For example: - # `projects/PROJECT_ID/locations/LOCATION_ID/jobs/JOB_ID`. - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Google::Cloud::Scheduler::V1::Job] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Google::Cloud::Scheduler::V1::Job] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/cloud/scheduler/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Scheduler::V1::CloudScheduler::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Scheduler::V1::GetJobRequest.new - # - # # Call the get_job method. - # result = client.get_job request - # - # # The returned object is of type Google::Cloud::Scheduler::V1::Job. - # p result - # - def get_job request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Scheduler::V1::GetJobRequest - - # Converts hash and nil to an options object - options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h - - # Customize the options with defaults - metadata = @config.rpcs.get_job.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::Scheduler::V1::VERSION - metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - header_params = {} - if request.name - header_params["name"] = request.name - end - - request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") - metadata[:"x-goog-request-params"] ||= request_params_header - - options.apply_defaults timeout: @config.rpcs.get_job.timeout, - metadata: metadata, - retry_policy: @config.rpcs.get_job.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @cloud_scheduler_stub.call_rpc :get_job, request, options: options do |response, operation| - yield response, operation if block_given? - end - rescue ::GRPC::BadStatus => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Creates a job. - # - # @overload create_job(request, options = nil) - # Pass arguments to `create_job` via a request object, either of type - # {::Google::Cloud::Scheduler::V1::CreateJobRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Scheduler::V1::CreateJobRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. - # - # @overload create_job(parent: nil, job: nil) - # Pass arguments to `create_job` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param parent [::String] - # Required. The location name. For example: - # `projects/PROJECT_ID/locations/LOCATION_ID`. - # @param job [::Google::Cloud::Scheduler::V1::Job, ::Hash] - # Required. The job to add. The user can optionally specify a name for the - # job in {::Google::Cloud::Scheduler::V1::Job#name name}. - # {::Google::Cloud::Scheduler::V1::Job#name name} cannot be the same as an - # existing job. If a name is not specified then the system will - # generate a random unique name that will be returned - # ({::Google::Cloud::Scheduler::V1::Job#name name}) in the response. - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Google::Cloud::Scheduler::V1::Job] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Google::Cloud::Scheduler::V1::Job] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/cloud/scheduler/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Scheduler::V1::CloudScheduler::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Scheduler::V1::CreateJobRequest.new - # - # # Call the create_job method. - # result = client.create_job request - # - # # The returned object is of type Google::Cloud::Scheduler::V1::Job. - # p result - # - def create_job request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Scheduler::V1::CreateJobRequest - - # Converts hash and nil to an options object - options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h - - # Customize the options with defaults - metadata = @config.rpcs.create_job.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::Scheduler::V1::VERSION - metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - header_params = {} - if request.parent - header_params["parent"] = request.parent - end - - request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") - metadata[:"x-goog-request-params"] ||= request_params_header - - options.apply_defaults timeout: @config.rpcs.create_job.timeout, - metadata: metadata, - retry_policy: @config.rpcs.create_job.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @cloud_scheduler_stub.call_rpc :create_job, 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 job. - # - # If successful, the updated {::Google::Cloud::Scheduler::V1::Job Job} is - # returned. If the job does not exist, `NOT_FOUND` is returned. - # - # If UpdateJob does not successfully return, it is possible for the - # job to be in an - # {::Google::Cloud::Scheduler::V1::Job::State::UPDATE_FAILED Job.State.UPDATE_FAILED} - # state. A job in this state may not be executed. If this happens, retry the - # UpdateJob request until a successful response is received. - # - # @overload update_job(request, options = nil) - # Pass arguments to `update_job` via a request object, either of type - # {::Google::Cloud::Scheduler::V1::UpdateJobRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Scheduler::V1::UpdateJobRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_job(job: nil, update_mask: nil) - # Pass arguments to `update_job` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param job [::Google::Cloud::Scheduler::V1::Job, ::Hash] - # Required. The new job properties. - # {::Google::Cloud::Scheduler::V1::Job#name name} must be specified. - # - # Output only fields cannot be modified using UpdateJob. - # Any value specified for an output only field will be ignored. - # @param update_mask [::Google::Protobuf::FieldMask, ::Hash] - # A mask used to specify which fields of the job are being updated. - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Google::Cloud::Scheduler::V1::Job] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Google::Cloud::Scheduler::V1::Job] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/cloud/scheduler/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Scheduler::V1::CloudScheduler::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Scheduler::V1::UpdateJobRequest.new - # - # # Call the update_job method. - # result = client.update_job request - # - # # The returned object is of type Google::Cloud::Scheduler::V1::Job. - # p result - # - def update_job request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Scheduler::V1::UpdateJobRequest - - # Converts hash 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_job.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::Scheduler::V1::VERSION - metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - header_params = {} - if request.job&.name - header_params["job.name"] = request.job.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_job.timeout, - metadata: metadata, - retry_policy: @config.rpcs.update_job.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @cloud_scheduler_stub.call_rpc :update_job, request, options: options do |response, operation| - yield response, operation if block_given? - end - rescue ::GRPC::BadStatus => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Deletes a job. - # - # @overload delete_job(request, options = nil) - # Pass arguments to `delete_job` via a request object, either of type - # {::Google::Cloud::Scheduler::V1::DeleteJobRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Scheduler::V1::DeleteJobRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. - # - # @overload delete_job(name: nil) - # Pass arguments to `delete_job` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param name [::String] - # Required. The job name. For example: - # `projects/PROJECT_ID/locations/LOCATION_ID/jobs/JOB_ID`. - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Google::Protobuf::Empty] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Google::Protobuf::Empty] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/cloud/scheduler/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Scheduler::V1::CloudScheduler::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Scheduler::V1::DeleteJobRequest.new - # - # # Call the delete_job method. - # result = client.delete_job request - # - # # The returned object is of type Google::Protobuf::Empty. - # p result - # - def delete_job request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Scheduler::V1::DeleteJobRequest - - # Converts hash and nil to an options object - options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h - - # Customize the options with defaults - metadata = @config.rpcs.delete_job.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::Scheduler::V1::VERSION - metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - header_params = {} - if request.name - header_params["name"] = request.name - end - - request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") - metadata[:"x-goog-request-params"] ||= request_params_header - - options.apply_defaults timeout: @config.rpcs.delete_job.timeout, - metadata: metadata, - retry_policy: @config.rpcs.delete_job.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @cloud_scheduler_stub.call_rpc :delete_job, request, options: options do |response, operation| - yield response, operation if block_given? - end - rescue ::GRPC::BadStatus => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Pauses a job. - # - # If a job is paused then the system will stop executing the job - # until it is re-enabled via - # {::Google::Cloud::Scheduler::V1::CloudScheduler::Client#resume_job ResumeJob}. The state - # of the job is stored in {::Google::Cloud::Scheduler::V1::Job#state state}; if - # paused it will be set to - # {::Google::Cloud::Scheduler::V1::Job::State::PAUSED Job.State.PAUSED}. A job must - # be in {::Google::Cloud::Scheduler::V1::Job::State::ENABLED Job.State.ENABLED} to - # be paused. - # - # @overload pause_job(request, options = nil) - # Pass arguments to `pause_job` via a request object, either of type - # {::Google::Cloud::Scheduler::V1::PauseJobRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Scheduler::V1::PauseJobRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. - # - # @overload pause_job(name: nil) - # Pass arguments to `pause_job` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param name [::String] - # Required. The job name. For example: - # `projects/PROJECT_ID/locations/LOCATION_ID/jobs/JOB_ID`. - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Google::Cloud::Scheduler::V1::Job] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Google::Cloud::Scheduler::V1::Job] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/cloud/scheduler/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Scheduler::V1::CloudScheduler::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Scheduler::V1::PauseJobRequest.new - # - # # Call the pause_job method. - # result = client.pause_job request - # - # # The returned object is of type Google::Cloud::Scheduler::V1::Job. - # p result - # - def pause_job request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Scheduler::V1::PauseJobRequest - - # Converts hash and nil to an options object - options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h - - # Customize the options with defaults - metadata = @config.rpcs.pause_job.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::Scheduler::V1::VERSION - metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - header_params = {} - if request.name - header_params["name"] = request.name - end - - request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") - metadata[:"x-goog-request-params"] ||= request_params_header - - options.apply_defaults timeout: @config.rpcs.pause_job.timeout, - metadata: metadata, - retry_policy: @config.rpcs.pause_job.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @cloud_scheduler_stub.call_rpc :pause_job, 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 - - ## - # Resume a job. - # - # This method reenables a job after it has been - # {::Google::Cloud::Scheduler::V1::Job::State::PAUSED Job.State.PAUSED}. The state - # of a job is stored in {::Google::Cloud::Scheduler::V1::Job#state Job.state}; - # after calling this method it will be set to - # {::Google::Cloud::Scheduler::V1::Job::State::ENABLED Job.State.ENABLED}. A job - # must be in {::Google::Cloud::Scheduler::V1::Job::State::PAUSED Job.State.PAUSED} - # to be resumed. - # - # @overload resume_job(request, options = nil) - # Pass arguments to `resume_job` via a request object, either of type - # {::Google::Cloud::Scheduler::V1::ResumeJobRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Scheduler::V1::ResumeJobRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. - # - # @overload resume_job(name: nil) - # Pass arguments to `resume_job` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param name [::String] - # Required. The job name. For example: - # `projects/PROJECT_ID/locations/LOCATION_ID/jobs/JOB_ID`. - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Google::Cloud::Scheduler::V1::Job] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Google::Cloud::Scheduler::V1::Job] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/cloud/scheduler/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Scheduler::V1::CloudScheduler::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Scheduler::V1::ResumeJobRequest.new - # - # # Call the resume_job method. - # result = client.resume_job request - # - # # The returned object is of type Google::Cloud::Scheduler::V1::Job. - # p result - # - def resume_job request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Scheduler::V1::ResumeJobRequest - - # Converts hash and nil to an options object - options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h - - # Customize the options with defaults - metadata = @config.rpcs.resume_job.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::Scheduler::V1::VERSION - metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - header_params = {} - if request.name - header_params["name"] = request.name - end - - request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") - metadata[:"x-goog-request-params"] ||= request_params_header - - options.apply_defaults timeout: @config.rpcs.resume_job.timeout, - metadata: metadata, - retry_policy: @config.rpcs.resume_job.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @cloud_scheduler_stub.call_rpc :resume_job, 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 - - ## - # Forces a job to run now. - # - # When this method is called, Cloud Scheduler will dispatch the job, even - # if the job is already running. - # - # @overload run_job(request, options = nil) - # Pass arguments to `run_job` via a request object, either of type - # {::Google::Cloud::Scheduler::V1::RunJobRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Scheduler::V1::RunJobRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. - # - # @overload run_job(name: nil) - # Pass arguments to `run_job` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param name [::String] - # Required. The job name. For example: - # `projects/PROJECT_ID/locations/LOCATION_ID/jobs/JOB_ID`. - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Google::Cloud::Scheduler::V1::Job] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Google::Cloud::Scheduler::V1::Job] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/cloud/scheduler/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Scheduler::V1::CloudScheduler::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Scheduler::V1::RunJobRequest.new - # - # # Call the run_job method. - # result = client.run_job request - # - # # The returned object is of type Google::Cloud::Scheduler::V1::Job. - # p result - # - def run_job request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Scheduler::V1::RunJobRequest - - # Converts hash 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.run_job.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::Scheduler::V1::VERSION - metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - header_params = {} - if request.name - header_params["name"] = request.name - end - - request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") - metadata[:"x-goog-request-params"] ||= request_params_header - - options.apply_defaults timeout: @config.rpcs.run_job.timeout, - metadata: metadata, - retry_policy: @config.rpcs.run_job.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @cloud_scheduler_stub.call_rpc :run_job, request, options: options do |response, operation| - yield response, operation if block_given? - end - rescue ::GRPC::BadStatus => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Configuration class for the CloudScheduler API. - # - # This class represents the configuration for CloudScheduler, - # providing control over timeouts, retry behavior, logging, transport - # parameters, and other low-level controls. Certain parameters can also be - # applied individually to specific RPCs. See - # {::Google::Cloud::Scheduler::V1::CloudScheduler::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_jobs to 20 seconds, - # # and all remaining timeouts to 10 seconds. - # ::Google::Cloud::Scheduler::V1::CloudScheduler::Client.configure do |config| - # config.timeout = 10.0 - # config.rpcs.list_jobs.timeout = 20.0 - # end - # - # # Apply the above configuration only to a new client. - # client = ::Google::Cloud::Scheduler::V1::CloudScheduler::Client.new do |config| - # config.timeout = 10.0 - # config.rpcs.list_jobs.timeout = 20.0 - # end - # - # @!attribute [rw] endpoint - # A custom service endpoint, as a hostname or hostname:port. The default is - # nil, indicating to use the default endpoint in the current universe domain. - # @return [::String,nil] - # @!attribute [rw] credentials - # Credentials to send with calls. You may provide any of the following types: - # * (`Google::Auth::Credentials`) A googleauth credentials object - # (see the [googleauth docs](https://rubydoc.info/gems/googleauth/Google/Auth/Credentials)) - # * (`Signet::OAuth2::Client`) A signet oauth2 client object - # (see the [signet docs](https://rubydoc.info/gems/signet/Signet/OAuth2/Client)) - # * (`GRPC::Core::Channel`) a gRPC channel with included credentials - # * (`GRPC::Core::ChannelCredentials`) a gRPC credentails object - # * (`nil`) indicating no credentials - # - # @note Warning: Passing a `String` to a keyfile path or a `Hash` of credentials - # is deprecated. Providing an unvalidated credential configuration to - # Google APIs can compromise the security of your systems and data. - # - # @example - # - # # The recommended way to provide credentials is to use the `make_creds` method - # # on the appropriate credentials class for your environment. - # - # require "googleauth" - # - # credentials = ::Google::Auth::ServiceAccountCredentials.make_creds( - # json_key_io: ::File.open("/path/to/keyfile.json") - # ) - # - # client = ::Google::Cloud::Scheduler::V1::CloudScheduler::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 = "cloudscheduler.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 CloudScheduler 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_jobs` - # @return [::Gapic::Config::Method] - # - attr_reader :list_jobs - ## - # RPC-specific configuration for `get_job` - # @return [::Gapic::Config::Method] - # - attr_reader :get_job - ## - # RPC-specific configuration for `create_job` - # @return [::Gapic::Config::Method] - # - attr_reader :create_job - ## - # RPC-specific configuration for `update_job` - # @return [::Gapic::Config::Method] - # - attr_reader :update_job - ## - # RPC-specific configuration for `delete_job` - # @return [::Gapic::Config::Method] - # - attr_reader :delete_job - ## - # RPC-specific configuration for `pause_job` - # @return [::Gapic::Config::Method] - # - attr_reader :pause_job - ## - # RPC-specific configuration for `resume_job` - # @return [::Gapic::Config::Method] - # - attr_reader :resume_job - ## - # RPC-specific configuration for `run_job` - # @return [::Gapic::Config::Method] - # - attr_reader :run_job - - # @private - def initialize parent_rpcs = nil - list_jobs_config = parent_rpcs.list_jobs if parent_rpcs.respond_to? :list_jobs - @list_jobs = ::Gapic::Config::Method.new list_jobs_config - get_job_config = parent_rpcs.get_job if parent_rpcs.respond_to? :get_job - @get_job = ::Gapic::Config::Method.new get_job_config - create_job_config = parent_rpcs.create_job if parent_rpcs.respond_to? :create_job - @create_job = ::Gapic::Config::Method.new create_job_config - update_job_config = parent_rpcs.update_job if parent_rpcs.respond_to? :update_job - @update_job = ::Gapic::Config::Method.new update_job_config - delete_job_config = parent_rpcs.delete_job if parent_rpcs.respond_to? :delete_job - @delete_job = ::Gapic::Config::Method.new delete_job_config - pause_job_config = parent_rpcs.pause_job if parent_rpcs.respond_to? :pause_job - @pause_job = ::Gapic::Config::Method.new pause_job_config - resume_job_config = parent_rpcs.resume_job if parent_rpcs.respond_to? :resume_job - @resume_job = ::Gapic::Config::Method.new resume_job_config - run_job_config = parent_rpcs.run_job if parent_rpcs.respond_to? :run_job - @run_job = ::Gapic::Config::Method.new run_job_config - - yield self if block_given? - end - end - end - end - end - end - end - end -end diff --git a/owl-bot-staging/google-cloud-scheduler-v1/lib/google/cloud/scheduler/v1/cloud_scheduler/credentials.rb b/owl-bot-staging/google-cloud-scheduler-v1/lib/google/cloud/scheduler/v1/cloud_scheduler/credentials.rb deleted file mode 100644 index efe3a6fb9d69..000000000000 --- a/owl-bot-staging/google-cloud-scheduler-v1/lib/google/cloud/scheduler/v1/cloud_scheduler/credentials.rb +++ /dev/null @@ -1,51 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -require "googleauth" - -module Google - module Cloud - module Scheduler - module V1 - module CloudScheduler - # Credentials for the CloudScheduler API. - class Credentials < ::Google::Auth::Credentials - self.scope = [ - "https://www.googleapis.com/auth/cloud-platform" - ] - self.env_vars = [ - "SCHEDULER_CREDENTIALS", - "SCHEDULER_KEYFILE", - "GOOGLE_CLOUD_CREDENTIALS", - "GOOGLE_CLOUD_KEYFILE", - "GCLOUD_KEYFILE", - "SCHEDULER_CREDENTIALS_JSON", - "SCHEDULER_KEYFILE_JSON", - "GOOGLE_CLOUD_CREDENTIALS_JSON", - "GOOGLE_CLOUD_KEYFILE_JSON", - "GCLOUD_KEYFILE_JSON" - ] - self.paths = [ - "~/.config/google_cloud/application_default_credentials.json" - ] - end - end - end - end - end -end diff --git a/owl-bot-staging/google-cloud-scheduler-v1/lib/google/cloud/scheduler/v1/cloud_scheduler/paths.rb b/owl-bot-staging/google-cloud-scheduler-v1/lib/google/cloud/scheduler/v1/cloud_scheduler/paths.rb deleted file mode 100644 index 885130d56682..000000000000 --- a/owl-bot-staging/google-cloud-scheduler-v1/lib/google/cloud/scheduler/v1/cloud_scheduler/paths.rb +++ /dev/null @@ -1,86 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - - -module Google - module Cloud - module Scheduler - module V1 - module CloudScheduler - # Path helper methods for the CloudScheduler API. - module Paths - ## - # Create a fully-qualified Job resource string. - # - # The resource will be in the following format: - # - # `projects/{project}/locations/{location}/jobs/{job}` - # - # @param project [String] - # @param location [String] - # @param job [String] - # - # @return [::String] - def job_path project:, location:, job: - raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" - raise ::ArgumentError, "location cannot contain /" if location.to_s.include? "/" - - "projects/#{project}/locations/#{location}/jobs/#{job}" - end - - ## - # Create a fully-qualified Location resource string. - # - # The resource will be in the following format: - # - # `projects/{project}/locations/{location}` - # - # @param project [String] - # @param location [String] - # - # @return [::String] - def location_path project:, location: - raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" - - "projects/#{project}/locations/#{location}" - end - - ## - # Create a fully-qualified Topic resource string. - # - # The resource will be in the following format: - # - # `projects/{project}/topics/{topic}` - # - # @param project [String] - # @param topic [String] - # - # @return [::String] - def topic_path project:, topic: - raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" - - "projects/#{project}/topics/#{topic}" - end - - extend self - end - end - end - end - end -end diff --git a/owl-bot-staging/google-cloud-scheduler-v1/lib/google/cloud/scheduler/v1/cloud_scheduler/rest.rb b/owl-bot-staging/google-cloud-scheduler-v1/lib/google/cloud/scheduler/v1/cloud_scheduler/rest.rb deleted file mode 100644 index ad8e3aece516..000000000000 --- a/owl-bot-staging/google-cloud-scheduler-v1/lib/google/cloud/scheduler/v1/cloud_scheduler/rest.rb +++ /dev/null @@ -1,54 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -require "gapic/rest" -require "gapic/config" -require "gapic/config/method" - -require "google/cloud/scheduler/v1/version" -require "google/cloud/scheduler/v1/bindings_override" - -require "google/cloud/scheduler/v1/cloud_scheduler/credentials" -require "google/cloud/scheduler/v1/cloud_scheduler/paths" -require "google/cloud/scheduler/v1/cloud_scheduler/rest/client" - -module Google - module Cloud - module Scheduler - module V1 - ## - # The Cloud Scheduler API allows external entities to reliably - # schedule asynchronous jobs. - # - # To load this service and instantiate a REST client: - # - # require "google/cloud/scheduler/v1/cloud_scheduler/rest" - # client = ::Google::Cloud::Scheduler::V1::CloudScheduler::Rest::Client.new - # - module CloudScheduler - # Client for the REST transport - module Rest - end - end - end - end - end -end - -helper_path = ::File.join __dir__, "rest", "helpers.rb" -require "google/cloud/scheduler/v1/cloud_scheduler/rest/helpers" if ::File.file? helper_path diff --git a/owl-bot-staging/google-cloud-scheduler-v1/lib/google/cloud/scheduler/v1/cloud_scheduler/rest/client.rb b/owl-bot-staging/google-cloud-scheduler-v1/lib/google/cloud/scheduler/v1/cloud_scheduler/rest/client.rb deleted file mode 100644 index 1ab6822532e5..000000000000 --- a/owl-bot-staging/google-cloud-scheduler-v1/lib/google/cloud/scheduler/v1/cloud_scheduler/rest/client.rb +++ /dev/null @@ -1,1138 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -require "google/cloud/errors" -require "google/cloud/scheduler/v1/cloudscheduler_pb" -require "google/cloud/scheduler/v1/cloud_scheduler/rest/service_stub" -require "google/cloud/location/rest" - -module Google - module Cloud - module Scheduler - module V1 - module CloudScheduler - module Rest - ## - # REST client for the CloudScheduler service. - # - # The Cloud Scheduler API allows external entities to reliably - # schedule asynchronous jobs. - # - class Client - # @private - API_VERSION = "" - - # @private - DEFAULT_ENDPOINT_TEMPLATE = "cloudscheduler.$UNIVERSE_DOMAIN$" - - include Paths - - # @private - attr_reader :cloud_scheduler_stub - - ## - # Configure the CloudScheduler Client class. - # - # See {::Google::Cloud::Scheduler::V1::CloudScheduler::Rest::Client::Configuration} - # for a description of the configuration fields. - # - # @example - # - # # Modify the configuration for all CloudScheduler clients - # ::Google::Cloud::Scheduler::V1::CloudScheduler::Rest::Client.configure do |config| - # config.timeout = 10.0 - # end - # - # @yield [config] Configure the Client client. - # @yieldparam config [Client::Configuration] - # - # @return [Client::Configuration] - # - def self.configure - @configure ||= begin - namespace = ["Google", "Cloud", "Scheduler", "V1"] - parent_config = while namespace.any? - parent_name = namespace.join "::" - parent_const = const_get parent_name - break parent_const.configure if parent_const.respond_to? :configure - namespace.pop - end - default_config = Client::Configuration.new parent_config - - default_config.rpcs.list_jobs.timeout = 600.0 - default_config.rpcs.list_jobs.retry_policy = { - initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [4, 14] - } - - default_config.rpcs.get_job.timeout = 600.0 - default_config.rpcs.get_job.retry_policy = { - initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [4, 14] - } - - default_config.rpcs.create_job.timeout = 600.0 - - default_config.rpcs.update_job.timeout = 600.0 - - default_config.rpcs.delete_job.timeout = 600.0 - default_config.rpcs.delete_job.retry_policy = { - initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [4, 14] - } - - default_config.rpcs.pause_job.timeout = 600.0 - - default_config.rpcs.resume_job.timeout = 600.0 - - default_config.rpcs.run_job.timeout = 600.0 - - default_config - end - yield @configure if block_given? - @configure - end - - ## - # Configure the CloudScheduler Client instance. - # - # The configuration is set to the derived mode, meaning that values can be changed, - # but structural changes (adding new fields, etc.) are not allowed. Structural changes - # should be made on {Client.configure}. - # - # See {::Google::Cloud::Scheduler::V1::CloudScheduler::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 - @cloud_scheduler_stub.universe_domain - end - - ## - # Create a new CloudScheduler REST client object. - # - # @example - # - # # Create a client using the default configuration - # client = ::Google::Cloud::Scheduler::V1::CloudScheduler::Rest::Client.new - # - # # Create a client using a custom configuration - # client = ::Google::Cloud::Scheduler::V1::CloudScheduler::Rest::Client.new do |config| - # config.timeout = 10.0 - # end - # - # @yield [config] Configure the CloudScheduler 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 - - @cloud_scheduler_stub = ::Google::Cloud::Scheduler::V1::CloudScheduler::Rest::ServiceStub.new( - endpoint: @config.endpoint, - endpoint_template: DEFAULT_ENDPOINT_TEMPLATE, - universe_domain: @config.universe_domain, - credentials: credentials, - logger: @config.logger - ) - - @cloud_scheduler_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 = @cloud_scheduler_stub.endpoint - config.universe_domain = @cloud_scheduler_stub.universe_domain - config.bindings_override = @config.bindings_override - config.logger = @cloud_scheduler_stub.logger if config.respond_to? :logger= - end - end - - ## - # Get the associated client for mix-in of the Locations. - # - # @return [Google::Cloud::Location::Locations::Rest::Client] - # - attr_reader :location_client - - ## - # The logger used for request/response debug logging. - # - # @return [Logger] - # - def logger - @cloud_scheduler_stub.logger - end - - # Service calls - - ## - # Lists jobs. - # - # @overload list_jobs(request, options = nil) - # Pass arguments to `list_jobs` via a request object, either of type - # {::Google::Cloud::Scheduler::V1::ListJobsRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Scheduler::V1::ListJobsRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @overload list_jobs(parent: nil, page_size: nil, page_token: nil) - # Pass arguments to `list_jobs` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param parent [::String] - # Required. The location name. For example: - # `projects/PROJECT_ID/locations/LOCATION_ID`. - # @param page_size [::Integer] - # Requested page size. - # - # The maximum page size is 500. If unspecified, the page size will - # be the maximum. Fewer jobs than requested might be returned, - # even if more jobs exist; use next_page_token to determine if more - # jobs exist. - # @param page_token [::String] - # A token identifying a page of results the server will return. To - # request the first page results, page_token must be empty. To - # request the next page of results, page_token must be the value of - # {::Google::Cloud::Scheduler::V1::ListJobsResponse#next_page_token next_page_token} - # returned from the previous call to - # {::Google::Cloud::Scheduler::V1::CloudScheduler::Rest::Client#list_jobs ListJobs}. - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Gapic::Rest::PagedEnumerable<::Google::Cloud::Scheduler::V1::Job>] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Gapic::Rest::PagedEnumerable<::Google::Cloud::Scheduler::V1::Job>] - # - # @raise [::Google::Cloud::Error] if the REST call is aborted. - # - # @example Basic example - # require "google/cloud/scheduler/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Scheduler::V1::CloudScheduler::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Scheduler::V1::ListJobsRequest.new - # - # # Call the list_jobs method. - # result = client.list_jobs request - # - # # The returned object is of type Gapic::PagedEnumerable. You can iterate - # # over elements, and API calls will be issued to fetch pages as needed. - # result.each do |item| - # # Each element is of type ::Google::Cloud::Scheduler::V1::Job. - # p item - # end - # - def list_jobs request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Scheduler::V1::ListJobsRequest - - # Converts hash and nil to an options object - options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h - - # Customize the options with defaults - call_metadata = @config.rpcs.list_jobs.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::Scheduler::V1::VERSION, - transports_version_send: [:rest] - - call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - options.apply_defaults timeout: @config.rpcs.list_jobs.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.list_jobs.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @cloud_scheduler_stub.list_jobs request, options do |result, operation| - result = ::Gapic::Rest::PagedEnumerable.new @cloud_scheduler_stub, :list_jobs, "jobs", 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 a job. - # - # @overload get_job(request, options = nil) - # Pass arguments to `get_job` via a request object, either of type - # {::Google::Cloud::Scheduler::V1::GetJobRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Scheduler::V1::GetJobRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @overload get_job(name: nil) - # Pass arguments to `get_job` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param name [::String] - # Required. The job name. For example: - # `projects/PROJECT_ID/locations/LOCATION_ID/jobs/JOB_ID`. - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Cloud::Scheduler::V1::Job] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::Scheduler::V1::Job] - # - # @raise [::Google::Cloud::Error] if the REST call is aborted. - # - # @example Basic example - # require "google/cloud/scheduler/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Scheduler::V1::CloudScheduler::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Scheduler::V1::GetJobRequest.new - # - # # Call the get_job method. - # result = client.get_job request - # - # # The returned object is of type Google::Cloud::Scheduler::V1::Job. - # p result - # - def get_job request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Scheduler::V1::GetJobRequest - - # Converts hash and nil to an options object - options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h - - # Customize the options with defaults - call_metadata = @config.rpcs.get_job.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::Scheduler::V1::VERSION, - transports_version_send: [:rest] - - call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - options.apply_defaults timeout: @config.rpcs.get_job.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.get_job.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @cloud_scheduler_stub.get_job request, options do |result, operation| - yield result, operation if block_given? - end - rescue ::Gapic::Rest::Error => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Creates a job. - # - # @overload create_job(request, options = nil) - # Pass arguments to `create_job` via a request object, either of type - # {::Google::Cloud::Scheduler::V1::CreateJobRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Scheduler::V1::CreateJobRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @overload create_job(parent: nil, job: nil) - # Pass arguments to `create_job` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param parent [::String] - # Required. The location name. For example: - # `projects/PROJECT_ID/locations/LOCATION_ID`. - # @param job [::Google::Cloud::Scheduler::V1::Job, ::Hash] - # Required. The job to add. The user can optionally specify a name for the - # job in {::Google::Cloud::Scheduler::V1::Job#name name}. - # {::Google::Cloud::Scheduler::V1::Job#name name} cannot be the same as an - # existing job. If a name is not specified then the system will - # generate a random unique name that will be returned - # ({::Google::Cloud::Scheduler::V1::Job#name name}) in the response. - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Cloud::Scheduler::V1::Job] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::Scheduler::V1::Job] - # - # @raise [::Google::Cloud::Error] if the REST call is aborted. - # - # @example Basic example - # require "google/cloud/scheduler/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Scheduler::V1::CloudScheduler::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Scheduler::V1::CreateJobRequest.new - # - # # Call the create_job method. - # result = client.create_job request - # - # # The returned object is of type Google::Cloud::Scheduler::V1::Job. - # p result - # - def create_job request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Scheduler::V1::CreateJobRequest - - # Converts hash and nil to an options object - options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h - - # Customize the options with defaults - call_metadata = @config.rpcs.create_job.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::Scheduler::V1::VERSION, - transports_version_send: [:rest] - - call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - options.apply_defaults timeout: @config.rpcs.create_job.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.create_job.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @cloud_scheduler_stub.create_job 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 job. - # - # If successful, the updated {::Google::Cloud::Scheduler::V1::Job Job} is - # returned. If the job does not exist, `NOT_FOUND` is returned. - # - # If UpdateJob does not successfully return, it is possible for the - # job to be in an - # {::Google::Cloud::Scheduler::V1::Job::State::UPDATE_FAILED Job.State.UPDATE_FAILED} - # state. A job in this state may not be executed. If this happens, retry the - # UpdateJob request until a successful response is received. - # - # @overload update_job(request, options = nil) - # Pass arguments to `update_job` via a request object, either of type - # {::Google::Cloud::Scheduler::V1::UpdateJobRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Scheduler::V1::UpdateJobRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_job(job: nil, update_mask: nil) - # Pass arguments to `update_job` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param job [::Google::Cloud::Scheduler::V1::Job, ::Hash] - # Required. The new job properties. - # {::Google::Cloud::Scheduler::V1::Job#name name} must be specified. - # - # Output only fields cannot be modified using UpdateJob. - # Any value specified for an output only field will be ignored. - # @param update_mask [::Google::Protobuf::FieldMask, ::Hash] - # A mask used to specify which fields of the job are being updated. - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Cloud::Scheduler::V1::Job] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::Scheduler::V1::Job] - # - # @raise [::Google::Cloud::Error] if the REST call is aborted. - # - # @example Basic example - # require "google/cloud/scheduler/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Scheduler::V1::CloudScheduler::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Scheduler::V1::UpdateJobRequest.new - # - # # Call the update_job method. - # result = client.update_job request - # - # # The returned object is of type Google::Cloud::Scheduler::V1::Job. - # p result - # - def update_job request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Scheduler::V1::UpdateJobRequest - - # Converts hash 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_job.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::Scheduler::V1::VERSION, - transports_version_send: [:rest] - - call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - options.apply_defaults timeout: @config.rpcs.update_job.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.update_job.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @cloud_scheduler_stub.update_job request, options do |result, operation| - yield result, operation if block_given? - end - rescue ::Gapic::Rest::Error => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Deletes a job. - # - # @overload delete_job(request, options = nil) - # Pass arguments to `delete_job` via a request object, either of type - # {::Google::Cloud::Scheduler::V1::DeleteJobRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Scheduler::V1::DeleteJobRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @overload delete_job(name: nil) - # Pass arguments to `delete_job` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param name [::String] - # Required. The job name. For example: - # `projects/PROJECT_ID/locations/LOCATION_ID/jobs/JOB_ID`. - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Protobuf::Empty] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Protobuf::Empty] - # - # @raise [::Google::Cloud::Error] if the REST call is aborted. - # - # @example Basic example - # require "google/cloud/scheduler/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Scheduler::V1::CloudScheduler::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Scheduler::V1::DeleteJobRequest.new - # - # # Call the delete_job method. - # result = client.delete_job request - # - # # The returned object is of type Google::Protobuf::Empty. - # p result - # - def delete_job request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Scheduler::V1::DeleteJobRequest - - # Converts hash and nil to an options object - options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h - - # Customize the options with defaults - call_metadata = @config.rpcs.delete_job.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::Scheduler::V1::VERSION, - transports_version_send: [:rest] - - call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - options.apply_defaults timeout: @config.rpcs.delete_job.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.delete_job.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @cloud_scheduler_stub.delete_job 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 - - ## - # Pauses a job. - # - # If a job is paused then the system will stop executing the job - # until it is re-enabled via - # {::Google::Cloud::Scheduler::V1::CloudScheduler::Rest::Client#resume_job ResumeJob}. The state - # of the job is stored in {::Google::Cloud::Scheduler::V1::Job#state state}; if - # paused it will be set to - # {::Google::Cloud::Scheduler::V1::Job::State::PAUSED Job.State.PAUSED}. A job must - # be in {::Google::Cloud::Scheduler::V1::Job::State::ENABLED Job.State.ENABLED} to - # be paused. - # - # @overload pause_job(request, options = nil) - # Pass arguments to `pause_job` via a request object, either of type - # {::Google::Cloud::Scheduler::V1::PauseJobRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Scheduler::V1::PauseJobRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @overload pause_job(name: nil) - # Pass arguments to `pause_job` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param name [::String] - # Required. The job name. For example: - # `projects/PROJECT_ID/locations/LOCATION_ID/jobs/JOB_ID`. - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Cloud::Scheduler::V1::Job] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::Scheduler::V1::Job] - # - # @raise [::Google::Cloud::Error] if the REST call is aborted. - # - # @example Basic example - # require "google/cloud/scheduler/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Scheduler::V1::CloudScheduler::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Scheduler::V1::PauseJobRequest.new - # - # # Call the pause_job method. - # result = client.pause_job request - # - # # The returned object is of type Google::Cloud::Scheduler::V1::Job. - # p result - # - def pause_job request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Scheduler::V1::PauseJobRequest - - # Converts hash 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.pause_job.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::Scheduler::V1::VERSION, - transports_version_send: [:rest] - - call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - options.apply_defaults timeout: @config.rpcs.pause_job.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.pause_job.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @cloud_scheduler_stub.pause_job 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 - - ## - # Resume a job. - # - # This method reenables a job after it has been - # {::Google::Cloud::Scheduler::V1::Job::State::PAUSED Job.State.PAUSED}. The state - # of a job is stored in {::Google::Cloud::Scheduler::V1::Job#state Job.state}; - # after calling this method it will be set to - # {::Google::Cloud::Scheduler::V1::Job::State::ENABLED Job.State.ENABLED}. A job - # must be in {::Google::Cloud::Scheduler::V1::Job::State::PAUSED Job.State.PAUSED} - # to be resumed. - # - # @overload resume_job(request, options = nil) - # Pass arguments to `resume_job` via a request object, either of type - # {::Google::Cloud::Scheduler::V1::ResumeJobRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Scheduler::V1::ResumeJobRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @overload resume_job(name: nil) - # Pass arguments to `resume_job` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param name [::String] - # Required. The job name. For example: - # `projects/PROJECT_ID/locations/LOCATION_ID/jobs/JOB_ID`. - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Cloud::Scheduler::V1::Job] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::Scheduler::V1::Job] - # - # @raise [::Google::Cloud::Error] if the REST call is aborted. - # - # @example Basic example - # require "google/cloud/scheduler/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Scheduler::V1::CloudScheduler::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Scheduler::V1::ResumeJobRequest.new - # - # # Call the resume_job method. - # result = client.resume_job request - # - # # The returned object is of type Google::Cloud::Scheduler::V1::Job. - # p result - # - def resume_job request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Scheduler::V1::ResumeJobRequest - - # Converts hash 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.resume_job.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::Scheduler::V1::VERSION, - transports_version_send: [:rest] - - call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - options.apply_defaults timeout: @config.rpcs.resume_job.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.resume_job.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @cloud_scheduler_stub.resume_job 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 - - ## - # Forces a job to run now. - # - # When this method is called, Cloud Scheduler will dispatch the job, even - # if the job is already running. - # - # @overload run_job(request, options = nil) - # Pass arguments to `run_job` via a request object, either of type - # {::Google::Cloud::Scheduler::V1::RunJobRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Scheduler::V1::RunJobRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @overload run_job(name: nil) - # Pass arguments to `run_job` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param name [::String] - # Required. The job name. For example: - # `projects/PROJECT_ID/locations/LOCATION_ID/jobs/JOB_ID`. - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Cloud::Scheduler::V1::Job] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::Scheduler::V1::Job] - # - # @raise [::Google::Cloud::Error] if the REST call is aborted. - # - # @example Basic example - # require "google/cloud/scheduler/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Scheduler::V1::CloudScheduler::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Scheduler::V1::RunJobRequest.new - # - # # Call the run_job method. - # result = client.run_job request - # - # # The returned object is of type Google::Cloud::Scheduler::V1::Job. - # p result - # - def run_job request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Scheduler::V1::RunJobRequest - - # Converts hash 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.run_job.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::Scheduler::V1::VERSION, - transports_version_send: [:rest] - - call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - options.apply_defaults timeout: @config.rpcs.run_job.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.run_job.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @cloud_scheduler_stub.run_job 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 CloudScheduler REST API. - # - # This class represents the configuration for CloudScheduler REST, - # providing control over timeouts, retry behavior, logging, transport - # parameters, and other low-level controls. Certain parameters can also be - # applied individually to specific RPCs. See - # {::Google::Cloud::Scheduler::V1::CloudScheduler::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_jobs to 20 seconds, - # # and all remaining timeouts to 10 seconds. - # ::Google::Cloud::Scheduler::V1::CloudScheduler::Rest::Client.configure do |config| - # config.timeout = 10.0 - # config.rpcs.list_jobs.timeout = 20.0 - # end - # - # # Apply the above configuration only to a new client. - # client = ::Google::Cloud::Scheduler::V1::CloudScheduler::Rest::Client.new do |config| - # config.timeout = 10.0 - # config.rpcs.list_jobs.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 = "cloudscheduler.googleapis.com" - - config_attr :endpoint, nil, ::String, nil - config_attr :credentials, nil do |value| - allowed = [::String, ::Hash, ::Proc, ::Symbol, ::Google::Auth::Credentials, ::Google::Auth::BaseClient, ::Signet::OAuth2::Client, nil] - allowed.any? { |klass| klass === value } - end - config_attr :scope, nil, ::String, ::Array, nil - config_attr :lib_name, nil, ::String, nil - config_attr :lib_version, nil, ::String, nil - config_attr :timeout, nil, ::Numeric, nil - config_attr :metadata, nil, ::Hash, nil - config_attr :retry_policy, nil, ::Hash, ::Proc, nil - config_attr :quota_project, nil, ::String, nil - config_attr :universe_domain, nil, ::String, nil - - # @private - # Overrides for http bindings for the RPCs of this service - # are only used when this service is used as mixin, and only - # by the host service. - # @return [::Hash{::Symbol=>::Array<::Gapic::Rest::GrpcTranscoder::HttpBinding>}] - config_attr :bindings_override, {}, ::Hash, nil - config_attr :logger, :default, ::Logger, nil, :default - - # @private - def initialize parent_config = nil - @parent_config = parent_config unless parent_config.nil? - - yield self if block_given? - end - - ## - # Configurations for individual RPCs - # @return [Rpcs] - # - def rpcs - @rpcs ||= begin - parent_rpcs = nil - parent_rpcs = @parent_config.rpcs if defined?(@parent_config) && @parent_config.respond_to?(:rpcs) - Rpcs.new parent_rpcs - end - end - - ## - # Configuration RPC class for the CloudScheduler 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_jobs` - # @return [::Gapic::Config::Method] - # - attr_reader :list_jobs - ## - # RPC-specific configuration for `get_job` - # @return [::Gapic::Config::Method] - # - attr_reader :get_job - ## - # RPC-specific configuration for `create_job` - # @return [::Gapic::Config::Method] - # - attr_reader :create_job - ## - # RPC-specific configuration for `update_job` - # @return [::Gapic::Config::Method] - # - attr_reader :update_job - ## - # RPC-specific configuration for `delete_job` - # @return [::Gapic::Config::Method] - # - attr_reader :delete_job - ## - # RPC-specific configuration for `pause_job` - # @return [::Gapic::Config::Method] - # - attr_reader :pause_job - ## - # RPC-specific configuration for `resume_job` - # @return [::Gapic::Config::Method] - # - attr_reader :resume_job - ## - # RPC-specific configuration for `run_job` - # @return [::Gapic::Config::Method] - # - attr_reader :run_job - - # @private - def initialize parent_rpcs = nil - list_jobs_config = parent_rpcs.list_jobs if parent_rpcs.respond_to? :list_jobs - @list_jobs = ::Gapic::Config::Method.new list_jobs_config - get_job_config = parent_rpcs.get_job if parent_rpcs.respond_to? :get_job - @get_job = ::Gapic::Config::Method.new get_job_config - create_job_config = parent_rpcs.create_job if parent_rpcs.respond_to? :create_job - @create_job = ::Gapic::Config::Method.new create_job_config - update_job_config = parent_rpcs.update_job if parent_rpcs.respond_to? :update_job - @update_job = ::Gapic::Config::Method.new update_job_config - delete_job_config = parent_rpcs.delete_job if parent_rpcs.respond_to? :delete_job - @delete_job = ::Gapic::Config::Method.new delete_job_config - pause_job_config = parent_rpcs.pause_job if parent_rpcs.respond_to? :pause_job - @pause_job = ::Gapic::Config::Method.new pause_job_config - resume_job_config = parent_rpcs.resume_job if parent_rpcs.respond_to? :resume_job - @resume_job = ::Gapic::Config::Method.new resume_job_config - run_job_config = parent_rpcs.run_job if parent_rpcs.respond_to? :run_job - @run_job = ::Gapic::Config::Method.new run_job_config - - yield self if block_given? - end - end - end - end - end - end - end - end - end -end diff --git a/owl-bot-staging/google-cloud-scheduler-v1/lib/google/cloud/scheduler/v1/cloud_scheduler/rest/service_stub.rb b/owl-bot-staging/google-cloud-scheduler-v1/lib/google/cloud/scheduler/v1/cloud_scheduler/rest/service_stub.rb deleted file mode 100644 index 0c51f76d75d1..000000000000 --- a/owl-bot-staging/google-cloud-scheduler-v1/lib/google/cloud/scheduler/v1/cloud_scheduler/rest/service_stub.rb +++ /dev/null @@ -1,574 +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/scheduler/v1/cloudscheduler_pb" - -module Google - module Cloud - module Scheduler - module V1 - module CloudScheduler - module Rest - ## - # REST service stub for the CloudScheduler service. - # Service stub contains baseline method implementations - # including transcoding, making the REST call, and deserialing the response. - # - class ServiceStub - # @private - def initialize endpoint:, endpoint_template:, universe_domain:, credentials:, logger: - # These require statements are intentionally placed here to initialize - # the REST modules only when it's required. - require "gapic/rest" - - @client_stub = ::Gapic::Rest::ClientStub.new endpoint: endpoint, - endpoint_template: endpoint_template, - universe_domain: universe_domain, - credentials: credentials, - numeric_enums: true, - service_name: self.class, - raise_faraday_errors: false, - logger: logger - end - - ## - # The effective universe domain - # - # @return [String] - # - def universe_domain - @client_stub.universe_domain - end - - ## - # The effective endpoint - # - # @return [String] - # - def endpoint - @client_stub.endpoint - end - - ## - # The logger used for request/response debug logging. - # - # @return [Logger] - # - def logger stub: false - stub ? @client_stub.stub_logger : @client_stub.logger - end - - ## - # Baseline implementation for the list_jobs REST call - # - # @param request_pb [::Google::Cloud::Scheduler::V1::ListJobsRequest] - # A request object representing the call parameters. Required. - # @param options [::Gapic::CallOptions] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Cloud::Scheduler::V1::ListJobsResponse] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::Scheduler::V1::ListJobsResponse] - # A result object deserialized from the server's reply - def list_jobs request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_list_jobs_request request_pb - query_string_params = if query_string_params.any? - query_string_params.to_h { |p| p.split "=", 2 } - else - {} - end - - response = @client_stub.make_http_request( - verb, - uri: uri, - body: body || "", - params: query_string_params, - method_name: "list_jobs", - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Cloud::Scheduler::V1::ListJobsResponse.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_job REST call - # - # @param request_pb [::Google::Cloud::Scheduler::V1::GetJobRequest] - # A request object representing the call parameters. Required. - # @param options [::Gapic::CallOptions] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Cloud::Scheduler::V1::Job] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::Scheduler::V1::Job] - # A result object deserialized from the server's reply - def get_job request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_get_job_request request_pb - query_string_params = if query_string_params.any? - query_string_params.to_h { |p| p.split "=", 2 } - else - {} - end - - response = @client_stub.make_http_request( - verb, - uri: uri, - body: body || "", - params: query_string_params, - method_name: "get_job", - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Cloud::Scheduler::V1::Job.decode_json response.body, ignore_unknown_fields: true - catch :response do - yield result, operation if block_given? - result - end - end - - ## - # Baseline implementation for the create_job REST call - # - # @param request_pb [::Google::Cloud::Scheduler::V1::CreateJobRequest] - # A request object representing the call parameters. Required. - # @param options [::Gapic::CallOptions] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Cloud::Scheduler::V1::Job] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::Scheduler::V1::Job] - # A result object deserialized from the server's reply - def create_job request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_create_job_request request_pb - query_string_params = if query_string_params.any? - query_string_params.to_h { |p| p.split "=", 2 } - else - {} - end - - response = @client_stub.make_http_request( - verb, - uri: uri, - body: body || "", - params: query_string_params, - method_name: "create_job", - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Cloud::Scheduler::V1::Job.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_job REST call - # - # @param request_pb [::Google::Cloud::Scheduler::V1::UpdateJobRequest] - # A request object representing the call parameters. Required. - # @param options [::Gapic::CallOptions] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Cloud::Scheduler::V1::Job] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::Scheduler::V1::Job] - # A result object deserialized from the server's reply - def update_job request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_update_job_request request_pb - query_string_params = if query_string_params.any? - query_string_params.to_h { |p| p.split "=", 2 } - else - {} - end - - response = @client_stub.make_http_request( - verb, - uri: uri, - body: body || "", - params: query_string_params, - method_name: "update_job", - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Cloud::Scheduler::V1::Job.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_job REST call - # - # @param request_pb [::Google::Cloud::Scheduler::V1::DeleteJobRequest] - # A request object representing the call parameters. Required. - # @param options [::Gapic::CallOptions] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Protobuf::Empty] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Protobuf::Empty] - # A result object deserialized from the server's reply - def delete_job request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_delete_job_request request_pb - query_string_params = if query_string_params.any? - query_string_params.to_h { |p| p.split "=", 2 } - else - {} - end - - response = @client_stub.make_http_request( - verb, - uri: uri, - body: body || "", - params: query_string_params, - method_name: "delete_job", - 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 pause_job REST call - # - # @param request_pb [::Google::Cloud::Scheduler::V1::PauseJobRequest] - # A request object representing the call parameters. Required. - # @param options [::Gapic::CallOptions] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Cloud::Scheduler::V1::Job] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::Scheduler::V1::Job] - # A result object deserialized from the server's reply - def pause_job request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_pause_job_request request_pb - query_string_params = if query_string_params.any? - query_string_params.to_h { |p| p.split "=", 2 } - else - {} - end - - response = @client_stub.make_http_request( - verb, - uri: uri, - body: body || "", - params: query_string_params, - method_name: "pause_job", - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Cloud::Scheduler::V1::Job.decode_json response.body, ignore_unknown_fields: true - catch :response do - yield result, operation if block_given? - result - end - end - - ## - # Baseline implementation for the resume_job REST call - # - # @param request_pb [::Google::Cloud::Scheduler::V1::ResumeJobRequest] - # A request object representing the call parameters. Required. - # @param options [::Gapic::CallOptions] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Cloud::Scheduler::V1::Job] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::Scheduler::V1::Job] - # A result object deserialized from the server's reply - def resume_job request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_resume_job_request request_pb - query_string_params = if query_string_params.any? - query_string_params.to_h { |p| p.split "=", 2 } - else - {} - end - - response = @client_stub.make_http_request( - verb, - uri: uri, - body: body || "", - params: query_string_params, - method_name: "resume_job", - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Cloud::Scheduler::V1::Job.decode_json response.body, ignore_unknown_fields: true - catch :response do - yield result, operation if block_given? - result - end - end - - ## - # Baseline implementation for the run_job REST call - # - # @param request_pb [::Google::Cloud::Scheduler::V1::RunJobRequest] - # A request object representing the call parameters. Required. - # @param options [::Gapic::CallOptions] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Cloud::Scheduler::V1::Job] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::Scheduler::V1::Job] - # A result object deserialized from the server's reply - def run_job request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_run_job_request request_pb - query_string_params = if query_string_params.any? - query_string_params.to_h { |p| p.split "=", 2 } - else - {} - end - - response = @client_stub.make_http_request( - verb, - uri: uri, - body: body || "", - params: query_string_params, - method_name: "run_job", - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Cloud::Scheduler::V1::Job.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_jobs REST call - # - # @param request_pb [::Google::Cloud::Scheduler::V1::ListJobsRequest] - # A request object representing the call parameters. Required. - # @return [Array(String, [String, nil], Hash{String => String})] - # Uri, Body, Query string parameters - def self.transcode_list_jobs_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :get, - uri_template: "/v1/{parent}/jobs", - matches: [ - ["parent", %r{^projects/[^/]+/locations/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the get_job REST call - # - # @param request_pb [::Google::Cloud::Scheduler::V1::GetJobRequest] - # A request object representing the call parameters. Required. - # @return [Array(String, [String, nil], Hash{String => String})] - # Uri, Body, Query string parameters - def self.transcode_get_job_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :get, - uri_template: "/v1/{name}", - matches: [ - ["name", %r{^projects/[^/]+/locations/[^/]+/jobs/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the create_job REST call - # - # @param request_pb [::Google::Cloud::Scheduler::V1::CreateJobRequest] - # A request object representing the call parameters. Required. - # @return [Array(String, [String, nil], Hash{String => String})] - # Uri, Body, Query string parameters - def self.transcode_create_job_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :post, - uri_template: "/v1/{parent}/jobs", - body: "job", - matches: [ - ["parent", %r{^projects/[^/]+/locations/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the update_job REST call - # - # @param request_pb [::Google::Cloud::Scheduler::V1::UpdateJobRequest] - # 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_job_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :patch, - uri_template: "/v1/{job.name}", - body: "job", - matches: [ - ["job.name", %r{^projects/[^/]+/locations/[^/]+/jobs/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the delete_job REST call - # - # @param request_pb [::Google::Cloud::Scheduler::V1::DeleteJobRequest] - # A request object representing the call parameters. Required. - # @return [Array(String, [String, nil], Hash{String => String})] - # Uri, Body, Query string parameters - def self.transcode_delete_job_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :delete, - uri_template: "/v1/{name}", - matches: [ - ["name", %r{^projects/[^/]+/locations/[^/]+/jobs/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the pause_job REST call - # - # @param request_pb [::Google::Cloud::Scheduler::V1::PauseJobRequest] - # A request object representing the call parameters. Required. - # @return [Array(String, [String, nil], Hash{String => String})] - # Uri, Body, Query string parameters - def self.transcode_pause_job_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :post, - uri_template: "/v1/{name}:pause", - body: "*", - matches: [ - ["name", %r{^projects/[^/]+/locations/[^/]+/jobs/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the resume_job REST call - # - # @param request_pb [::Google::Cloud::Scheduler::V1::ResumeJobRequest] - # A request object representing the call parameters. Required. - # @return [Array(String, [String, nil], Hash{String => String})] - # Uri, Body, Query string parameters - def self.transcode_resume_job_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :post, - uri_template: "/v1/{name}:resume", - body: "*", - matches: [ - ["name", %r{^projects/[^/]+/locations/[^/]+/jobs/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the run_job REST call - # - # @param request_pb [::Google::Cloud::Scheduler::V1::RunJobRequest] - # A request object representing the call parameters. Required. - # @return [Array(String, [String, nil], Hash{String => String})] - # Uri, Body, Query string parameters - def self.transcode_run_job_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :post, - uri_template: "/v1/{name}:run", - body: "*", - matches: [ - ["name", %r{^projects/[^/]+/locations/[^/]+/jobs/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - end - end - end - end - end - end -end diff --git a/owl-bot-staging/google-cloud-scheduler-v1/lib/google/cloud/scheduler/v1/cloudscheduler_pb.rb b/owl-bot-staging/google-cloud-scheduler-v1/lib/google/cloud/scheduler/v1/cloudscheduler_pb.rb deleted file mode 100644 index 4dd0fb324086..000000000000 --- a/owl-bot-staging/google-cloud-scheduler-v1/lib/google/cloud/scheduler/v1/cloudscheduler_pb.rb +++ /dev/null @@ -1,37 +0,0 @@ -# frozen_string_literal: true -# Generated by the protocol buffer compiler. DO NOT EDIT! -# source: google/cloud/scheduler/v1/cloudscheduler.proto - -require 'google/protobuf' - -require 'google/api/annotations_pb' -require 'google/api/client_pb' -require 'google/api/field_behavior_pb' -require 'google/api/resource_pb' -require 'google/cloud/scheduler/v1/job_pb' -require 'google/protobuf/empty_pb' -require 'google/protobuf/field_mask_pb' - - -descriptor_data = "\n.google/cloud/scheduler/v1/cloudscheduler.proto\x12\x19google.cloud.scheduler.v1\x1a\x1cgoogle/api/annotations.proto\x1a\x17google/api/client.proto\x1a\x1fgoogle/api/field_behavior.proto\x1a\x19google/api/resource.proto\x1a#google/cloud/scheduler/v1/job.proto\x1a\x1bgoogle/protobuf/empty.proto\x1a google/protobuf/field_mask.proto\"s\n\x0fListJobsRequest\x12\x39\n\x06parent\x18\x01 \x01(\tB)\xe0\x41\x02\xfa\x41#\x12!cloudscheduler.googleapis.com/Job\x12\x11\n\tpage_size\x18\x05 \x01(\x05\x12\x12\n\npage_token\x18\x06 \x01(\t\"Y\n\x10ListJobsResponse\x12,\n\x04jobs\x18\x01 \x03(\x0b\x32\x1e.google.cloud.scheduler.v1.Job\x12\x17\n\x0fnext_page_token\x18\x02 \x01(\t\"H\n\rGetJobRequest\x12\x37\n\x04name\x18\x01 \x01(\tB)\xe0\x41\x02\xfa\x41#\n!cloudscheduler.googleapis.com/Job\"\x7f\n\x10\x43reateJobRequest\x12\x39\n\x06parent\x18\x01 \x01(\tB)\xe0\x41\x02\xfa\x41#\x12!cloudscheduler.googleapis.com/Job\x12\x30\n\x03job\x18\x02 \x01(\x0b\x32\x1e.google.cloud.scheduler.v1.JobB\x03\xe0\x41\x02\"u\n\x10UpdateJobRequest\x12\x30\n\x03job\x18\x01 \x01(\x0b\x32\x1e.google.cloud.scheduler.v1.JobB\x03\xe0\x41\x02\x12/\n\x0bupdate_mask\x18\x02 \x01(\x0b\x32\x1a.google.protobuf.FieldMask\"K\n\x10\x44\x65leteJobRequest\x12\x37\n\x04name\x18\x01 \x01(\tB)\xe0\x41\x02\xfa\x41#\n!cloudscheduler.googleapis.com/Job\"J\n\x0fPauseJobRequest\x12\x37\n\x04name\x18\x01 \x01(\tB)\xe0\x41\x02\xfa\x41#\n!cloudscheduler.googleapis.com/Job\"K\n\x10ResumeJobRequest\x12\x37\n\x04name\x18\x01 \x01(\tB)\xe0\x41\x02\xfa\x41#\n!cloudscheduler.googleapis.com/Job\"H\n\rRunJobRequest\x12\x37\n\x04name\x18\x01 \x01(\tB)\xe0\x41\x02\xfa\x41#\n!cloudscheduler.googleapis.com/Job2\xb3\n\n\x0e\x43loudScheduler\x12\x9e\x01\n\x08ListJobs\x12*.google.cloud.scheduler.v1.ListJobsRequest\x1a+.google.cloud.scheduler.v1.ListJobsResponse\"9\xda\x41\x06parent\x82\xd3\xe4\x93\x02*\x12(/v1/{parent=projects/*/locations/*}/jobs\x12\x8b\x01\n\x06GetJob\x12(.google.cloud.scheduler.v1.GetJobRequest\x1a\x1e.google.cloud.scheduler.v1.Job\"7\xda\x41\x04name\x82\xd3\xe4\x93\x02*\x12(/v1/{name=projects/*/locations/*/jobs/*}\x12\x9c\x01\n\tCreateJob\x12+.google.cloud.scheduler.v1.CreateJobRequest\x1a\x1e.google.cloud.scheduler.v1.Job\"B\xda\x41\nparent,job\x82\xd3\xe4\x93\x02/\"(/v1/{parent=projects/*/locations/*}/jobs:\x03job\x12\xa5\x01\n\tUpdateJob\x12+.google.cloud.scheduler.v1.UpdateJobRequest\x1a\x1e.google.cloud.scheduler.v1.Job\"K\xda\x41\x0fjob,update_mask\x82\xd3\xe4\x93\x02\x33\x32,/v1/{job.name=projects/*/locations/*/jobs/*}:\x03job\x12\x89\x01\n\tDeleteJob\x12+.google.cloud.scheduler.v1.DeleteJobRequest\x1a\x16.google.protobuf.Empty\"7\xda\x41\x04name\x82\xd3\xe4\x93\x02**(/v1/{name=projects/*/locations/*/jobs/*}\x12\x98\x01\n\x08PauseJob\x12*.google.cloud.scheduler.v1.PauseJobRequest\x1a\x1e.google.cloud.scheduler.v1.Job\"@\xda\x41\x04name\x82\xd3\xe4\x93\x02\x33\"./v1/{name=projects/*/locations/*/jobs/*}:pause:\x01*\x12\x9b\x01\n\tResumeJob\x12+.google.cloud.scheduler.v1.ResumeJobRequest\x1a\x1e.google.cloud.scheduler.v1.Job\"A\xda\x41\x04name\x82\xd3\xe4\x93\x02\x34\"//v1/{name=projects/*/locations/*/jobs/*}:resume:\x01*\x12\x92\x01\n\x06RunJob\x12(.google.cloud.scheduler.v1.RunJobRequest\x1a\x1e.google.cloud.scheduler.v1.Job\">\xda\x41\x04name\x82\xd3\xe4\x93\x02\x31\",/v1/{name=projects/*/locations/*/jobs/*}:run:\x01*\x1aQ\xca\x41\x1d\x63loudscheduler.googleapis.com\xd2\x41.https://www.googleapis.com/auth/cloud-platformBz\n\x1d\x63om.google.cloud.scheduler.v1B\x0eSchedulerProtoP\x01Z;cloud.google.com/go/scheduler/apiv1/schedulerpb;schedulerpb\xa2\x02\tSCHEDULERb\x06proto3" - -pool = ::Google::Protobuf::DescriptorPool.generated_pool -pool.add_serialized_file(descriptor_data) - -module Google - module Cloud - module Scheduler - module V1 - ListJobsRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.scheduler.v1.ListJobsRequest").msgclass - ListJobsResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.scheduler.v1.ListJobsResponse").msgclass - GetJobRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.scheduler.v1.GetJobRequest").msgclass - CreateJobRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.scheduler.v1.CreateJobRequest").msgclass - UpdateJobRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.scheduler.v1.UpdateJobRequest").msgclass - DeleteJobRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.scheduler.v1.DeleteJobRequest").msgclass - PauseJobRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.scheduler.v1.PauseJobRequest").msgclass - ResumeJobRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.scheduler.v1.ResumeJobRequest").msgclass - RunJobRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.scheduler.v1.RunJobRequest").msgclass - end - end - end -end diff --git a/owl-bot-staging/google-cloud-scheduler-v1/lib/google/cloud/scheduler/v1/cloudscheduler_services_pb.rb b/owl-bot-staging/google-cloud-scheduler-v1/lib/google/cloud/scheduler/v1/cloudscheduler_services_pb.rb deleted file mode 100644 index 74ea2172ef3b..000000000000 --- a/owl-bot-staging/google-cloud-scheduler-v1/lib/google/cloud/scheduler/v1/cloudscheduler_services_pb.rb +++ /dev/null @@ -1,89 +0,0 @@ -# Generated by the protocol buffer compiler. DO NOT EDIT! -# Source: google/cloud/scheduler/v1/cloudscheduler.proto for package 'google.cloud.scheduler.v1' -# Original file comments: -# 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 -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. -# - -require 'grpc' -require 'google/cloud/scheduler/v1/cloudscheduler_pb' - -module Google - module Cloud - module Scheduler - module V1 - module CloudScheduler - # The Cloud Scheduler API allows external entities to reliably - # schedule asynchronous jobs. - class Service - - include ::GRPC::GenericService - - self.marshal_class_method = :encode - self.unmarshal_class_method = :decode - self.service_name = 'google.cloud.scheduler.v1.CloudScheduler' - - # Lists jobs. - rpc :ListJobs, ::Google::Cloud::Scheduler::V1::ListJobsRequest, ::Google::Cloud::Scheduler::V1::ListJobsResponse - # Gets a job. - rpc :GetJob, ::Google::Cloud::Scheduler::V1::GetJobRequest, ::Google::Cloud::Scheduler::V1::Job - # Creates a job. - rpc :CreateJob, ::Google::Cloud::Scheduler::V1::CreateJobRequest, ::Google::Cloud::Scheduler::V1::Job - # Updates a job. - # - # If successful, the updated [Job][google.cloud.scheduler.v1.Job] is - # returned. If the job does not exist, `NOT_FOUND` is returned. - # - # If UpdateJob does not successfully return, it is possible for the - # job to be in an - # [Job.State.UPDATE_FAILED][google.cloud.scheduler.v1.Job.State.UPDATE_FAILED] - # state. A job in this state may not be executed. If this happens, retry the - # UpdateJob request until a successful response is received. - rpc :UpdateJob, ::Google::Cloud::Scheduler::V1::UpdateJobRequest, ::Google::Cloud::Scheduler::V1::Job - # Deletes a job. - rpc :DeleteJob, ::Google::Cloud::Scheduler::V1::DeleteJobRequest, ::Google::Protobuf::Empty - # Pauses a job. - # - # If a job is paused then the system will stop executing the job - # until it is re-enabled via - # [ResumeJob][google.cloud.scheduler.v1.CloudScheduler.ResumeJob]. The state - # of the job is stored in [state][google.cloud.scheduler.v1.Job.state]; if - # paused it will be set to - # [Job.State.PAUSED][google.cloud.scheduler.v1.Job.State.PAUSED]. A job must - # be in [Job.State.ENABLED][google.cloud.scheduler.v1.Job.State.ENABLED] to - # be paused. - rpc :PauseJob, ::Google::Cloud::Scheduler::V1::PauseJobRequest, ::Google::Cloud::Scheduler::V1::Job - # Resume a job. - # - # This method reenables a job after it has been - # [Job.State.PAUSED][google.cloud.scheduler.v1.Job.State.PAUSED]. The state - # of a job is stored in [Job.state][google.cloud.scheduler.v1.Job.state]; - # after calling this method it will be set to - # [Job.State.ENABLED][google.cloud.scheduler.v1.Job.State.ENABLED]. A job - # must be in [Job.State.PAUSED][google.cloud.scheduler.v1.Job.State.PAUSED] - # to be resumed. - rpc :ResumeJob, ::Google::Cloud::Scheduler::V1::ResumeJobRequest, ::Google::Cloud::Scheduler::V1::Job - # Forces a job to run now. - # - # When this method is called, Cloud Scheduler will dispatch the job, even - # if the job is already running. - rpc :RunJob, ::Google::Cloud::Scheduler::V1::RunJobRequest, ::Google::Cloud::Scheduler::V1::Job - end - - Stub = Service.rpc_stub_class - end - end - end - end -end diff --git a/owl-bot-staging/google-cloud-scheduler-v1/lib/google/cloud/scheduler/v1/job_pb.rb b/owl-bot-staging/google-cloud-scheduler-v1/lib/google/cloud/scheduler/v1/job_pb.rb deleted file mode 100644 index a47e690ec889..000000000000 --- a/owl-bot-staging/google-cloud-scheduler-v1/lib/google/cloud/scheduler/v1/job_pb.rb +++ /dev/null @@ -1,30 +0,0 @@ -# frozen_string_literal: true -# Generated by the protocol buffer compiler. DO NOT EDIT! -# source: google/cloud/scheduler/v1/job.proto - -require 'google/protobuf' - -require 'google/api/field_behavior_pb' -require 'google/api/resource_pb' -require 'google/cloud/scheduler/v1/target_pb' -require 'google/protobuf/duration_pb' -require 'google/protobuf/timestamp_pb' -require 'google/rpc/status_pb' - - -descriptor_data = "\n#google/cloud/scheduler/v1/job.proto\x12\x19google.cloud.scheduler.v1\x1a\x1fgoogle/api/field_behavior.proto\x1a\x19google/api/resource.proto\x1a&google/cloud/scheduler/v1/target.proto\x1a\x1egoogle/protobuf/duration.proto\x1a\x1fgoogle/protobuf/timestamp.proto\x1a\x17google/rpc/status.proto\"\xef\x06\n\x03Job\x12\x0c\n\x04name\x18\x01 \x01(\t\x12\x13\n\x0b\x64\x65scription\x18\x02 \x01(\t\x12@\n\rpubsub_target\x18\x04 \x01(\x0b\x32\'.google.cloud.scheduler.v1.PubsubTargetH\x00\x12P\n\x16\x61pp_engine_http_target\x18\x05 \x01(\x0b\x32..google.cloud.scheduler.v1.AppEngineHttpTargetH\x00\x12<\n\x0bhttp_target\x18\x06 \x01(\x0b\x32%.google.cloud.scheduler.v1.HttpTargetH\x00\x12\x10\n\x08schedule\x18\x14 \x01(\t\x12\x11\n\ttime_zone\x18\x15 \x01(\t\x12\x39\n\x10user_update_time\x18\t \x01(\x0b\x32\x1a.google.protobuf.TimestampB\x03\xe0\x41\x03\x12\x38\n\x05state\x18\n \x01(\x0e\x32$.google.cloud.scheduler.v1.Job.StateB\x03\xe0\x41\x03\x12\'\n\x06status\x18\x0b \x01(\x0b\x32\x12.google.rpc.StatusB\x03\xe0\x41\x03\x12\x36\n\rschedule_time\x18\x11 \x01(\x0b\x32\x1a.google.protobuf.TimestampB\x03\xe0\x41\x03\x12:\n\x11last_attempt_time\x18\x12 \x01(\x0b\x32\x1a.google.protobuf.TimestampB\x03\xe0\x41\x03\x12<\n\x0cretry_config\x18\x13 \x01(\x0b\x32&.google.cloud.scheduler.v1.RetryConfig\x12\x33\n\x10\x61ttempt_deadline\x18\x16 \x01(\x0b\x32\x19.google.protobuf.Duration\"X\n\x05State\x12\x15\n\x11STATE_UNSPECIFIED\x10\x00\x12\x0b\n\x07\x45NABLED\x10\x01\x12\n\n\x06PAUSED\x10\x02\x12\x0c\n\x08\x44ISABLED\x10\x03\x12\x11\n\rUPDATE_FAILED\x10\x04:e\xea\x41\x62\n!cloudscheduler.googleapis.com/Job\x12\x32projects/{project}/locations/{location}/jobs/{job}*\x04jobs2\x03jobB\x08\n\x06target\"\xe2\x01\n\x0bRetryConfig\x12\x13\n\x0bretry_count\x18\x01 \x01(\x05\x12\x35\n\x12max_retry_duration\x18\x02 \x01(\x0b\x32\x19.google.protobuf.Duration\x12\x37\n\x14min_backoff_duration\x18\x03 \x01(\x0b\x32\x19.google.protobuf.Duration\x12\x37\n\x14max_backoff_duration\x18\x04 \x01(\x0b\x32\x19.google.protobuf.Duration\x12\x15\n\rmax_doublings\x18\x05 \x01(\x05\x42h\n\x1d\x63om.google.cloud.scheduler.v1B\x08JobProtoP\x01Z;cloud.google.com/go/scheduler/apiv1/schedulerpb;schedulerpbb\x06proto3" - -pool = ::Google::Protobuf::DescriptorPool.generated_pool -pool.add_serialized_file(descriptor_data) - -module Google - module Cloud - module Scheduler - module V1 - Job = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.scheduler.v1.Job").msgclass - Job::State = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.scheduler.v1.Job.State").enummodule - RetryConfig = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.scheduler.v1.RetryConfig").msgclass - end - end - end -end diff --git a/owl-bot-staging/google-cloud-scheduler-v1/lib/google/cloud/scheduler/v1/rest.rb b/owl-bot-staging/google-cloud-scheduler-v1/lib/google/cloud/scheduler/v1/rest.rb deleted file mode 100644 index c05f1f65b59c..000000000000 --- a/owl-bot-staging/google-cloud-scheduler-v1/lib/google/cloud/scheduler/v1/rest.rb +++ /dev/null @@ -1,38 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -require "google/cloud/scheduler/v1/cloud_scheduler/rest" -require "google/cloud/scheduler/v1/bindings_override" -require "google/cloud/scheduler/v1/version" - -module Google - module Cloud - module Scheduler - ## - # To load just the REST part of this package, including all its services, and instantiate a REST client: - # - # @example - # - # require "google/cloud/scheduler/v1/rest" - # client = ::Google::Cloud::Scheduler::V1::CloudScheduler::Rest::Client.new - # - module V1 - end - end - end -end diff --git a/owl-bot-staging/google-cloud-scheduler-v1/lib/google/cloud/scheduler/v1/target_pb.rb b/owl-bot-staging/google-cloud-scheduler-v1/lib/google/cloud/scheduler/v1/target_pb.rb deleted file mode 100644 index 35186ffc0517..000000000000 --- a/owl-bot-staging/google-cloud-scheduler-v1/lib/google/cloud/scheduler/v1/target_pb.rb +++ /dev/null @@ -1,29 +0,0 @@ -# frozen_string_literal: true -# Generated by the protocol buffer compiler. DO NOT EDIT! -# source: google/cloud/scheduler/v1/target.proto - -require 'google/protobuf' - -require 'google/api/resource_pb' - - -descriptor_data = "\n&google/cloud/scheduler/v1/target.proto\x12\x19google.cloud.scheduler.v1\x1a\x19google/api/resource.proto\"\xea\x02\n\nHttpTarget\x12\x0b\n\x03uri\x18\x01 \x01(\t\x12:\n\x0bhttp_method\x18\x02 \x01(\x0e\x32%.google.cloud.scheduler.v1.HttpMethod\x12\x43\n\x07headers\x18\x03 \x03(\x0b\x32\x32.google.cloud.scheduler.v1.HttpTarget.HeadersEntry\x12\x0c\n\x04\x62ody\x18\x04 \x01(\x0c\x12<\n\x0boauth_token\x18\x05 \x01(\x0b\x32%.google.cloud.scheduler.v1.OAuthTokenH\x00\x12:\n\noidc_token\x18\x06 \x01(\x0b\x32$.google.cloud.scheduler.v1.OidcTokenH\x00\x1a.\n\x0cHeadersEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12\r\n\x05value\x18\x02 \x01(\t:\x02\x38\x01\x42\x16\n\x14\x61uthorization_header\"\xbc\x02\n\x13\x41ppEngineHttpTarget\x12:\n\x0bhttp_method\x18\x01 \x01(\x0e\x32%.google.cloud.scheduler.v1.HttpMethod\x12G\n\x12\x61pp_engine_routing\x18\x02 \x01(\x0b\x32+.google.cloud.scheduler.v1.AppEngineRouting\x12\x14\n\x0crelative_uri\x18\x03 \x01(\t\x12L\n\x07headers\x18\x04 \x03(\x0b\x32;.google.cloud.scheduler.v1.AppEngineHttpTarget.HeadersEntry\x12\x0c\n\x04\x62ody\x18\x05 \x01(\x0c\x1a.\n\x0cHeadersEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12\r\n\x05value\x18\x02 \x01(\t:\x02\x38\x01\"\xd2\x01\n\x0cPubsubTarget\x12\x34\n\ntopic_name\x18\x01 \x01(\tB \xfa\x41\x1d\n\x1bpubsub.googleapis.com/Topic\x12\x0c\n\x04\x64\x61ta\x18\x03 \x01(\x0c\x12K\n\nattributes\x18\x04 \x03(\x0b\x32\x37.google.cloud.scheduler.v1.PubsubTarget.AttributesEntry\x1a\x31\n\x0f\x41ttributesEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12\r\n\x05value\x18\x02 \x01(\t:\x02\x38\x01\"T\n\x10\x41ppEngineRouting\x12\x0f\n\x07service\x18\x01 \x01(\t\x12\x0f\n\x07version\x18\x02 \x01(\t\x12\x10\n\x08instance\x18\x03 \x01(\t\x12\x0c\n\x04host\x18\x04 \x01(\t\":\n\nOAuthToken\x12\x1d\n\x15service_account_email\x18\x01 \x01(\t\x12\r\n\x05scope\x18\x02 \x01(\t\"<\n\tOidcToken\x12\x1d\n\x15service_account_email\x18\x01 \x01(\t\x12\x10\n\x08\x61udience\x18\x02 \x01(\t*s\n\nHttpMethod\x12\x1b\n\x17HTTP_METHOD_UNSPECIFIED\x10\x00\x12\x08\n\x04POST\x10\x01\x12\x07\n\x03GET\x10\x02\x12\x08\n\x04HEAD\x10\x03\x12\x07\n\x03PUT\x10\x04\x12\n\n\x06\x44\x45LETE\x10\x05\x12\t\n\x05PATCH\x10\x06\x12\x0b\n\x07OPTIONS\x10\x07\x42\xae\x01\n\x1d\x63om.google.cloud.scheduler.v1B\x0bTargetProtoP\x01Z;cloud.google.com/go/scheduler/apiv1/schedulerpb;schedulerpb\xea\x41@\n\x1bpubsub.googleapis.com/Topic\x12!projects/{project}/topics/{topic}b\x06proto3" - -pool = ::Google::Protobuf::DescriptorPool.generated_pool -pool.add_serialized_file(descriptor_data) - -module Google - module Cloud - module Scheduler - module V1 - HttpTarget = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.scheduler.v1.HttpTarget").msgclass - AppEngineHttpTarget = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.scheduler.v1.AppEngineHttpTarget").msgclass - PubsubTarget = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.scheduler.v1.PubsubTarget").msgclass - AppEngineRouting = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.scheduler.v1.AppEngineRouting").msgclass - OAuthToken = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.scheduler.v1.OAuthToken").msgclass - OidcToken = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.scheduler.v1.OidcToken").msgclass - HttpMethod = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.scheduler.v1.HttpMethod").enummodule - end - end - end -end diff --git a/owl-bot-staging/google-cloud-scheduler-v1/lib/google/cloud/scheduler/v1/version.rb b/owl-bot-staging/google-cloud-scheduler-v1/lib/google/cloud/scheduler/v1/version.rb deleted file mode 100644 index 207c07f5c915..000000000000 --- a/owl-bot-staging/google-cloud-scheduler-v1/lib/google/cloud/scheduler/v1/version.rb +++ /dev/null @@ -1,28 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - - -module Google - module Cloud - module Scheduler - module V1 - VERSION = "0.0.1" - end - end - end -end diff --git a/owl-bot-staging/google-cloud-scheduler-v1/proto_docs/README.md b/owl-bot-staging/google-cloud-scheduler-v1/proto_docs/README.md deleted file mode 100644 index 3bc7344421da..000000000000 --- a/owl-bot-staging/google-cloud-scheduler-v1/proto_docs/README.md +++ /dev/null @@ -1,4 +0,0 @@ -# Cloud Scheduler V1 Protocol Buffer Documentation - -These files are for the YARD documentation of the generated protobuf files. -They are not intended to be required or loaded at runtime. diff --git a/owl-bot-staging/google-cloud-scheduler-v1/proto_docs/google/api/client.rb b/owl-bot-staging/google-cloud-scheduler-v1/proto_docs/google/api/client.rb deleted file mode 100644 index 5089551e9ea4..000000000000 --- a/owl-bot-staging/google-cloud-scheduler-v1/proto_docs/google/api/client.rb +++ /dev/null @@ -1,589 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - - -module Google - module Api - # Required information for every language. - # @!attribute [rw] reference_docs_uri - # @deprecated This field is deprecated and may be removed in the next major version update. - # @return [::String] - # Link to automatically generated reference documentation. Example: - # https://cloud.google.com/nodejs/docs/reference/asset/latest - # @!attribute [rw] destinations - # @return [::Array<::Google::Api::ClientLibraryDestination>] - # The destination where API teams want this client library to be published. - # @!attribute [rw] selective_gapic_generation - # @return [::Google::Api::SelectiveGapicGeneration] - # Configuration for which RPCs should be generated in the GAPIC client. - class CommonLanguageSettings - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Details about how and where to publish client libraries. - # @!attribute [rw] version - # @return [::String] - # Version of the API to apply these settings to. This is the full protobuf - # package for the API, ending in the version element. - # Examples: "google.cloud.speech.v1" and "google.spanner.admin.database.v1". - # @!attribute [rw] launch_stage - # @return [::Google::Api::LaunchStage] - # Launch stage of this version of the API. - # @!attribute [rw] rest_numeric_enums - # @return [::Boolean] - # When using transport=rest, the client request will encode enums as - # numbers rather than strings. - # @!attribute [rw] java_settings - # @return [::Google::Api::JavaSettings] - # Settings for legacy Java features, supported in the Service YAML. - # @!attribute [rw] cpp_settings - # @return [::Google::Api::CppSettings] - # Settings for C++ client libraries. - # @!attribute [rw] php_settings - # @return [::Google::Api::PhpSettings] - # Settings for PHP client libraries. - # @!attribute [rw] python_settings - # @return [::Google::Api::PythonSettings] - # Settings for Python client libraries. - # @!attribute [rw] node_settings - # @return [::Google::Api::NodeSettings] - # Settings for Node client libraries. - # @!attribute [rw] dotnet_settings - # @return [::Google::Api::DotnetSettings] - # Settings for .NET client libraries. - # @!attribute [rw] ruby_settings - # @return [::Google::Api::RubySettings] - # Settings for Ruby client libraries. - # @!attribute [rw] go_settings - # @return [::Google::Api::GoSettings] - # Settings for Go client libraries. - class ClientLibrarySettings - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # This message configures the settings for publishing [Google Cloud Client - # libraries](https://cloud.google.com/apis/docs/cloud-client-libraries) - # generated from the service config. - # @!attribute [rw] method_settings - # @return [::Array<::Google::Api::MethodSettings>] - # A list of API method settings, e.g. the behavior for methods that use the - # long-running operation pattern. - # @!attribute [rw] new_issue_uri - # @return [::String] - # Link to a *public* URI where users can report issues. Example: - # https://issuetracker.google.com/issues/new?component=190865&template=1161103 - # @!attribute [rw] documentation_uri - # @return [::String] - # Link to product home page. Example: - # https://cloud.google.com/asset-inventory/docs/overview - # @!attribute [rw] api_short_name - # @return [::String] - # Used as a tracking tag when collecting data about the APIs developer - # relations artifacts like docs, packages delivered to package managers, - # etc. Example: "speech". - # @!attribute [rw] github_label - # @return [::String] - # GitHub label to apply to issues and pull requests opened for this API. - # @!attribute [rw] codeowner_github_teams - # @return [::Array<::String>] - # GitHub teams to be added to CODEOWNERS in the directory in GitHub - # containing source code for the client libraries for this API. - # @!attribute [rw] doc_tag_prefix - # @return [::String] - # A prefix used in sample code when demarking regions to be included in - # documentation. - # @!attribute [rw] organization - # @return [::Google::Api::ClientLibraryOrganization] - # For whom the client library is being published. - # @!attribute [rw] library_settings - # @return [::Array<::Google::Api::ClientLibrarySettings>] - # Client library settings. If the same version string appears multiple - # times in this list, then the last one wins. Settings from earlier - # settings with the same version string are discarded. - # @!attribute [rw] proto_reference_documentation_uri - # @return [::String] - # Optional link to proto reference documentation. Example: - # https://cloud.google.com/pubsub/lite/docs/reference/rpc - # @!attribute [rw] rest_reference_documentation_uri - # @return [::String] - # Optional link to REST reference documentation. Example: - # https://cloud.google.com/pubsub/lite/docs/reference/rest - class Publishing - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Settings for Java client libraries. - # @!attribute [rw] library_package - # @return [::String] - # The package name to use in Java. Clobbers the java_package option - # set in the protobuf. This should be used **only** by APIs - # who have already set the language_settings.java.package_name" field - # in gapic.yaml. API teams should use the protobuf java_package option - # where possible. - # - # Example of a YAML configuration:: - # - # publishing: - # 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. - # @!attribute [rw] methods - # @return [::Array<::String>] - # An allowlist of the fully qualified names of RPCs that should be included - # on public client surfaces. - # @!attribute [rw] generate_omitted_as_internal - # @return [::Boolean] - # Setting this to true indicates to the client generators that methods - # that would be excluded from the generation should instead be generated - # in a way that indicates these methods should not be consumed by - # end users. How this is expressed is up to individual language - # implementations to decide. Some examples may be: added annotations, - # obfuscated identifiers, or other language idiomatic patterns. - class SelectiveGapicGeneration - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # `BatchingConfigProto` defines the batching configuration for an API method. - # @!attribute [rw] thresholds - # @return [::Google::Api::BatchingSettingsProto] - # The thresholds which trigger a batched request to be sent. - # @!attribute [rw] batch_descriptor - # @return [::Google::Api::BatchingDescriptorProto] - # The request and response fields used in batching. - class BatchingConfigProto - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # `BatchingSettingsProto` specifies a set of batching thresholds, each of - # which acts as a trigger to send a batch of messages as a request. At least - # one threshold must be positive nonzero. - # @!attribute [rw] element_count_threshold - # @return [::Integer] - # The number of elements of a field collected into a batch which, if - # exceeded, causes the batch to be sent. - # @!attribute [rw] request_byte_threshold - # @return [::Integer] - # The aggregated size of the batched field which, if exceeded, causes the - # batch to be sent. This size is computed by aggregating the sizes of the - # request field to be batched, not of the entire request message. - # @!attribute [rw] delay_threshold - # @return [::Google::Protobuf::Duration] - # The duration after which a batch should be sent, starting from the addition - # of the first message to that batch. - # @!attribute [rw] element_count_limit - # @return [::Integer] - # The maximum number of elements collected in a batch that could be accepted - # by server. - # @!attribute [rw] request_byte_limit - # @return [::Integer] - # The maximum size of the request that could be accepted by server. - # @!attribute [rw] flow_control_element_limit - # @return [::Integer] - # The maximum number of elements allowed by flow control. - # @!attribute [rw] flow_control_byte_limit - # @return [::Integer] - # The maximum size of data allowed by flow control. - # @!attribute [rw] flow_control_limit_exceeded_behavior - # @return [::Google::Api::FlowControlLimitExceededBehaviorProto] - # The behavior to take when the flow control limit is exceeded. - class BatchingSettingsProto - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # `BatchingDescriptorProto` specifies the fields of the request message to be - # used for batching, and, optionally, the fields of the response message to be - # used for demultiplexing. - # @!attribute [rw] batched_field - # @return [::String] - # The repeated field in the request message to be aggregated by batching. - # @!attribute [rw] discriminator_fields - # @return [::Array<::String>] - # A list of the fields in the request message. Two requests will be batched - # together only if the values of every field specified in - # `request_discriminator_fields` is equal between the two requests. - # @!attribute [rw] subresponse_field - # @return [::String] - # Optional. When present, indicates the field in the response message to be - # used to demultiplex the response into multiple response messages, in - # correspondence with the multiple request messages originally batched - # together. - class BatchingDescriptorProto - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # The organization for which the client libraries are being published. - # Affects the url where generated docs are published, etc. - module ClientLibraryOrganization - # Not useful. - CLIENT_LIBRARY_ORGANIZATION_UNSPECIFIED = 0 - - # Google Cloud Platform Org. - CLOUD = 1 - - # Ads (Advertising) Org. - ADS = 2 - - # Photos Org. - PHOTOS = 3 - - # Street View Org. - STREET_VIEW = 4 - - # Shopping Org. - SHOPPING = 5 - - # Geo Org. - GEO = 6 - - # Generative AI - https://developers.generativeai.google - GENERATIVE_AI = 7 - end - - # To where should client libraries be published? - module ClientLibraryDestination - # Client libraries will neither be generated nor published to package - # managers. - CLIENT_LIBRARY_DESTINATION_UNSPECIFIED = 0 - - # Generate the client library in a repo under github.com/googleapis, - # but don't publish it to package managers. - GITHUB = 10 - - # Publish the library to package managers like nuget.org and npmjs.com. - PACKAGE_MANAGER = 20 - end - - # The behavior to take when the flow control limit is exceeded. - module FlowControlLimitExceededBehaviorProto - # Default behavior, system-defined. - UNSET_BEHAVIOR = 0 - - # Stop operation, raise error. - THROW_EXCEPTION = 1 - - # Pause operation until limit clears. - BLOCK = 2 - - # Continue operation, disregard limit. - IGNORE = 3 - end - end -end diff --git a/owl-bot-staging/google-cloud-scheduler-v1/proto_docs/google/api/field_behavior.rb b/owl-bot-staging/google-cloud-scheduler-v1/proto_docs/google/api/field_behavior.rb deleted file mode 100644 index 582be187d115..000000000000 --- a/owl-bot-staging/google-cloud-scheduler-v1/proto_docs/google/api/field_behavior.rb +++ /dev/null @@ -1,85 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - - -module Google - module Api - # An indicator of the behavior of a given field (for example, that a field - # is required in requests, or given as output but ignored as input). - # This **does not** change the behavior in protocol buffers itself; it only - # denotes the behavior and may affect how API tooling handles the field. - # - # Note: This enum **may** receive new values in the future. - module FieldBehavior - # Conventional default for enums. Do not use this. - FIELD_BEHAVIOR_UNSPECIFIED = 0 - - # Specifically denotes a field as optional. - # While all fields in protocol buffers are optional, this may be specified - # for emphasis if appropriate. - OPTIONAL = 1 - - # Denotes a field as required. - # This indicates that the field **must** be provided as part of the request, - # and failure to do so will cause an error (usually `INVALID_ARGUMENT`). - REQUIRED = 2 - - # Denotes a field as output only. - # This indicates that the field is provided in responses, but including the - # field in a request does nothing (the server *must* ignore it and - # *must not* throw an error as a result of the field's presence). - OUTPUT_ONLY = 3 - - # Denotes a field as input only. - # This indicates that the field is provided in requests, and the - # corresponding field is not included in output. - INPUT_ONLY = 4 - - # Denotes a field as immutable. - # This indicates that the field may be set once in a request to create a - # resource, but may not be changed thereafter. - IMMUTABLE = 5 - - # Denotes that a (repeated) field is an unordered list. - # This indicates that the service may provide the elements of the list - # in any arbitrary order, rather than the order the user originally - # provided. Additionally, the list's order may or may not be stable. - UNORDERED_LIST = 6 - - # Denotes that this field returns a non-empty default value if not set. - # This indicates that if the user provides the empty value in a request, - # a non-empty value will be returned. The user will not be aware of what - # non-empty value to expect. - NON_EMPTY_DEFAULT = 7 - - # Denotes that the field in a resource (a message annotated with - # google.api.resource) is used in the resource name to uniquely identify the - # resource. For AIP-compliant APIs, this should only be applied to the - # `name` field on the resource. - # - # This behavior should not be applied to references to other resources within - # the message. - # - # The identifier field of resources often have different field behavior - # depending on the request it is embedded in (e.g. for Create methods name - # is optional and unused, while for Update methods it is required). Instead - # of method-specific annotations, only `IDENTIFIER` is required. - IDENTIFIER = 8 - end - end -end diff --git a/owl-bot-staging/google-cloud-scheduler-v1/proto_docs/google/api/launch_stage.rb b/owl-bot-staging/google-cloud-scheduler-v1/proto_docs/google/api/launch_stage.rb deleted file mode 100644 index 9392a413fb1b..000000000000 --- a/owl-bot-staging/google-cloud-scheduler-v1/proto_docs/google/api/launch_stage.rb +++ /dev/null @@ -1,71 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - - -module Google - module Api - # The launch stage as defined by [Google Cloud Platform - # Launch Stages](https://cloud.google.com/terms/launch-stages). - module LaunchStage - # Do not use this default value. - LAUNCH_STAGE_UNSPECIFIED = 0 - - # The feature is not yet implemented. Users can not use it. - UNIMPLEMENTED = 6 - - # Prelaunch features are hidden from users and are only visible internally. - PRELAUNCH = 7 - - # Early Access features are limited to a closed group of testers. To use - # these features, you must sign up in advance and sign a Trusted Tester - # agreement (which includes confidentiality provisions). These features may - # be unstable, changed in backward-incompatible ways, and are not - # guaranteed to be released. - EARLY_ACCESS = 1 - - # Alpha is a limited availability test for releases before they are cleared - # for widespread use. By Alpha, all significant design issues are resolved - # and we are in the process of verifying functionality. Alpha customers - # need to apply for access, agree to applicable terms, and have their - # projects allowlisted. Alpha releases don't have to be feature complete, - # no SLAs are provided, and there are no technical support obligations, but - # they will be far enough along that customers can actually use them in - # test environments or for limited-use tests -- just like they would in - # normal production cases. - ALPHA = 2 - - # Beta is the point at which we are ready to open a release for any - # customer to use. There are no SLA or technical support obligations in a - # Beta release. Products will be complete from a feature perspective, but - # may have some open outstanding issues. Beta releases are suitable for - # limited production use cases. - BETA = 3 - - # GA features are open to all developers and are considered stable and - # fully qualified for production use. - GA = 4 - - # Deprecated features are scheduled to be shut down and removed. For more - # information, see the "Deprecation Policy" section of our [Terms of - # Service](https://cloud.google.com/terms/) - # and the [Google Cloud Platform Subject to the Deprecation - # Policy](https://cloud.google.com/terms/deprecation) documentation. - DEPRECATED = 5 - end - end -end diff --git a/owl-bot-staging/google-cloud-scheduler-v1/proto_docs/google/api/resource.rb b/owl-bot-staging/google-cloud-scheduler-v1/proto_docs/google/api/resource.rb deleted file mode 100644 index 25dec4847ac1..000000000000 --- a/owl-bot-staging/google-cloud-scheduler-v1/proto_docs/google/api/resource.rb +++ /dev/null @@ -1,227 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - - -module Google - module Api - # A simple descriptor of a resource type. - # - # ResourceDescriptor annotates a resource message (either by means of a - # protobuf annotation or use in the service config), and associates the - # resource's schema, the resource type, and the pattern of the resource name. - # - # Example: - # - # message Topic { - # // Indicates this message defines a resource schema. - # // Declares the resource type in the format of {service}/{kind}. - # // For Kubernetes resources, the format is {api group}/{kind}. - # option (google.api.resource) = { - # type: "pubsub.googleapis.com/Topic" - # pattern: "projects/{project}/topics/{topic}" - # }; - # } - # - # The ResourceDescriptor Yaml config will look like: - # - # resources: - # - type: "pubsub.googleapis.com/Topic" - # pattern: "projects/{project}/topics/{topic}" - # - # Sometimes, resources have multiple patterns, typically because they can - # live under multiple parents. - # - # Example: - # - # message LogEntry { - # option (google.api.resource) = { - # type: "logging.googleapis.com/LogEntry" - # pattern: "projects/{project}/logs/{log}" - # pattern: "folders/{folder}/logs/{log}" - # pattern: "organizations/{organization}/logs/{log}" - # pattern: "billingAccounts/{billing_account}/logs/{log}" - # }; - # } - # - # The ResourceDescriptor Yaml config will look like: - # - # resources: - # - type: 'logging.googleapis.com/LogEntry' - # pattern: "projects/{project}/logs/{log}" - # pattern: "folders/{folder}/logs/{log}" - # pattern: "organizations/{organization}/logs/{log}" - # pattern: "billingAccounts/{billing_account}/logs/{log}" - # @!attribute [rw] type - # @return [::String] - # The resource type. It must be in the format of - # \\{service_name}/\\{resource_type_kind}. The `resource_type_kind` must be - # singular and must not include version numbers. - # - # Example: `storage.googleapis.com/Bucket` - # - # The value of the resource_type_kind must follow the regular expression - # /[A-Za-z][a-zA-Z0-9]+/. It should start with an upper case character and - # should use PascalCase (UpperCamelCase). The maximum number of - # characters allowed for the `resource_type_kind` is 100. - # @!attribute [rw] pattern - # @return [::Array<::String>] - # Optional. The relative resource name pattern associated with this resource - # type. The DNS prefix of the full resource name shouldn't be specified here. - # - # The path pattern must follow the syntax, which aligns with HTTP binding - # syntax: - # - # Template = Segment { "/" Segment } ; - # Segment = LITERAL | Variable ; - # Variable = "{" LITERAL "}" ; - # - # Examples: - # - # - "projects/\\{project}/topics/\\{topic}" - # - "projects/\\{project}/knowledgeBases/\\{knowledge_base}" - # - # The components in braces correspond to the IDs for each resource in the - # hierarchy. It is expected that, if multiple patterns are provided, - # the same component name (e.g. "project") refers to IDs of the same - # type of resource. - # @!attribute [rw] name_field - # @return [::String] - # Optional. The field on the resource that designates the resource name - # field. If omitted, this is assumed to be "name". - # @!attribute [rw] history - # @return [::Google::Api::ResourceDescriptor::History] - # Optional. The historical or future-looking state of the resource pattern. - # - # Example: - # - # // The InspectTemplate message originally only supported resource - # // names with organization, and project was added later. - # message InspectTemplate { - # option (google.api.resource) = { - # type: "dlp.googleapis.com/InspectTemplate" - # pattern: - # "organizations/{organization}/inspectTemplates/{inspect_template}" - # pattern: "projects/{project}/inspectTemplates/{inspect_template}" - # history: ORIGINALLY_SINGLE_PATTERN - # }; - # } - # @!attribute [rw] plural - # @return [::String] - # The plural name used in the resource name and permission names, such as - # 'projects' for the resource name of 'projects/\\{project}' and the permission - # name of 'cloudresourcemanager.googleapis.com/projects.get'. One exception - # to this is for Nested Collections that have stuttering names, as defined - # in [AIP-122](https://google.aip.dev/122#nested-collections), where the - # collection ID in the resource name pattern does not necessarily directly - # match the `plural` value. - # - # It is the same concept of the `plural` field in k8s CRD spec - # https://kubernetes.io/docs/tasks/access-kubernetes-api/custom-resources/custom-resource-definitions/ - # - # Note: The plural form is required even for singleton resources. See - # https://aip.dev/156 - # @!attribute [rw] singular - # @return [::String] - # The same concept of the `singular` field in k8s CRD spec - # https://kubernetes.io/docs/tasks/access-kubernetes-api/custom-resources/custom-resource-definitions/ - # Such as "project" for the `resourcemanager.googleapis.com/Project` type. - # @!attribute [rw] style - # @return [::Array<::Google::Api::ResourceDescriptor::Style>] - # Style flag(s) for this resource. - # These indicate that a resource is expected to conform to a given - # style. See the specific style flags for additional information. - class ResourceDescriptor - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - - # A description of the historical or future-looking state of the - # resource pattern. - module History - # The "unset" value. - HISTORY_UNSPECIFIED = 0 - - # The resource originally had one pattern and launched as such, and - # additional patterns were added later. - ORIGINALLY_SINGLE_PATTERN = 1 - - # The resource has one pattern, but the API owner expects to add more - # later. (This is the inverse of ORIGINALLY_SINGLE_PATTERN, and prevents - # that from being necessary once there are multiple patterns.) - FUTURE_MULTI_PATTERN = 2 - end - - # A flag representing a specific style that a resource claims to conform to. - module Style - # The unspecified value. Do not use. - STYLE_UNSPECIFIED = 0 - - # This resource is intended to be "declarative-friendly". - # - # Declarative-friendly resources must be more strictly consistent, and - # setting this to true communicates to tools that this resource should - # adhere to declarative-friendly expectations. - # - # Note: This is used by the API linter (linter.aip.dev) to enable - # additional checks. - DECLARATIVE_FRIENDLY = 1 - end - end - - # Defines a proto annotation that describes a string field that refers to - # an API resource. - # @!attribute [rw] type - # @return [::String] - # The resource type that the annotated field references. - # - # Example: - # - # message Subscription { - # string topic = 2 [(google.api.resource_reference) = { - # type: "pubsub.googleapis.com/Topic" - # }]; - # } - # - # Occasionally, a field may reference an arbitrary resource. In this case, - # APIs use the special value * in their resource reference. - # - # Example: - # - # message GetIamPolicyRequest { - # string resource = 2 [(google.api.resource_reference) = { - # type: "*" - # }]; - # } - # @!attribute [rw] child_type - # @return [::String] - # The resource type of a child collection that the annotated field - # references. This is useful for annotating the `parent` field that - # doesn't have a fixed resource type. - # - # Example: - # - # message ListLogEntriesRequest { - # string parent = 1 [(google.api.resource_reference) = { - # child_type: "logging.googleapis.com/LogEntry" - # }; - # } - class ResourceReference - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - end -end diff --git a/owl-bot-staging/google-cloud-scheduler-v1/proto_docs/google/cloud/scheduler/v1/cloudscheduler.rb b/owl-bot-staging/google-cloud-scheduler-v1/proto_docs/google/cloud/scheduler/v1/cloudscheduler.rb deleted file mode 100644 index 7ec919d8b28e..000000000000 --- a/owl-bot-staging/google-cloud-scheduler-v1/proto_docs/google/cloud/scheduler/v1/cloudscheduler.rb +++ /dev/null @@ -1,164 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - - -module Google - module Cloud - module Scheduler - module V1 - # Request message for listing jobs using - # {::Google::Cloud::Scheduler::V1::CloudScheduler::Client#list_jobs ListJobs}. - # @!attribute [rw] parent - # @return [::String] - # Required. The location name. For example: - # `projects/PROJECT_ID/locations/LOCATION_ID`. - # @!attribute [rw] page_size - # @return [::Integer] - # Requested page size. - # - # The maximum page size is 500. If unspecified, the page size will - # be the maximum. Fewer jobs than requested might be returned, - # even if more jobs exist; use next_page_token to determine if more - # jobs exist. - # @!attribute [rw] page_token - # @return [::String] - # A token identifying a page of results the server will return. To - # request the first page results, page_token must be empty. To - # request the next page of results, page_token must be the value of - # {::Google::Cloud::Scheduler::V1::ListJobsResponse#next_page_token next_page_token} - # returned from the previous call to - # {::Google::Cloud::Scheduler::V1::CloudScheduler::Client#list_jobs ListJobs}. - class ListJobsRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Response message for listing jobs using - # {::Google::Cloud::Scheduler::V1::CloudScheduler::Client#list_jobs ListJobs}. - # @!attribute [rw] jobs - # @return [::Array<::Google::Cloud::Scheduler::V1::Job>] - # The list of jobs. - # @!attribute [rw] next_page_token - # @return [::String] - # A token to retrieve next page of results. Pass this value in the - # {::Google::Cloud::Scheduler::V1::ListJobsRequest#page_token page_token} field in - # the subsequent call to - # {::Google::Cloud::Scheduler::V1::CloudScheduler::Client#list_jobs ListJobs} to retrieve - # the next page of results. If this is empty it indicates that there are no - # more results through which to paginate. - # - # The page token is valid for only 2 hours. - class ListJobsResponse - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Request message for - # {::Google::Cloud::Scheduler::V1::CloudScheduler::Client#get_job GetJob}. - # @!attribute [rw] name - # @return [::String] - # Required. The job name. For example: - # `projects/PROJECT_ID/locations/LOCATION_ID/jobs/JOB_ID`. - class GetJobRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Request message for - # {::Google::Cloud::Scheduler::V1::CloudScheduler::Client#create_job CreateJob}. - # @!attribute [rw] parent - # @return [::String] - # Required. The location name. For example: - # `projects/PROJECT_ID/locations/LOCATION_ID`. - # @!attribute [rw] job - # @return [::Google::Cloud::Scheduler::V1::Job] - # Required. The job to add. The user can optionally specify a name for the - # job in {::Google::Cloud::Scheduler::V1::Job#name name}. - # {::Google::Cloud::Scheduler::V1::Job#name name} cannot be the same as an - # existing job. If a name is not specified then the system will - # generate a random unique name that will be returned - # ({::Google::Cloud::Scheduler::V1::Job#name name}) in the response. - class CreateJobRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Request message for - # {::Google::Cloud::Scheduler::V1::CloudScheduler::Client#update_job UpdateJob}. - # @!attribute [rw] job - # @return [::Google::Cloud::Scheduler::V1::Job] - # Required. The new job properties. - # {::Google::Cloud::Scheduler::V1::Job#name name} must be specified. - # - # Output only fields cannot be modified using UpdateJob. - # Any value specified for an output only field will be ignored. - # @!attribute [rw] update_mask - # @return [::Google::Protobuf::FieldMask] - # A mask used to specify which fields of the job are being updated. - class UpdateJobRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Request message for deleting a job using - # {::Google::Cloud::Scheduler::V1::CloudScheduler::Client#delete_job DeleteJob}. - # @!attribute [rw] name - # @return [::String] - # Required. The job name. For example: - # `projects/PROJECT_ID/locations/LOCATION_ID/jobs/JOB_ID`. - class DeleteJobRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Request message for - # {::Google::Cloud::Scheduler::V1::CloudScheduler::Client#pause_job PauseJob}. - # @!attribute [rw] name - # @return [::String] - # Required. The job name. For example: - # `projects/PROJECT_ID/locations/LOCATION_ID/jobs/JOB_ID`. - class PauseJobRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Request message for - # {::Google::Cloud::Scheduler::V1::CloudScheduler::Client#resume_job ResumeJob}. - # @!attribute [rw] name - # @return [::String] - # Required. The job name. For example: - # `projects/PROJECT_ID/locations/LOCATION_ID/jobs/JOB_ID`. - class ResumeJobRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Request message for forcing a job to run now using - # {::Google::Cloud::Scheduler::V1::CloudScheduler::Client#run_job RunJob}. - # @!attribute [rw] name - # @return [::String] - # Required. The job name. For example: - # `projects/PROJECT_ID/locations/LOCATION_ID/jobs/JOB_ID`. - class RunJobRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - end - end - end -end diff --git a/owl-bot-staging/google-cloud-scheduler-v1/proto_docs/google/cloud/scheduler/v1/job.rb b/owl-bot-staging/google-cloud-scheduler-v1/proto_docs/google/cloud/scheduler/v1/job.rb deleted file mode 100644 index b37a1e462593..000000000000 --- a/owl-bot-staging/google-cloud-scheduler-v1/proto_docs/google/cloud/scheduler/v1/job.rb +++ /dev/null @@ -1,264 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - - -module Google - module Cloud - module Scheduler - module V1 - # Configuration for a job. - # The maximum allowed size for a job is 1MB. - # @!attribute [rw] name - # @return [::String] - # Optionally caller-specified in - # {::Google::Cloud::Scheduler::V1::CloudScheduler::Client#create_job CreateJob}, after - # which it becomes output only. - # - # The job name. For example: - # `projects/PROJECT_ID/locations/LOCATION_ID/jobs/JOB_ID`. - # - # * `PROJECT_ID` can contain letters ([A-Za-z]), numbers ([0-9]), - # hyphens (-), colons (:), or periods (.). - # For more information, see - # [Identifying - # projects](https://cloud.google.com/resource-manager/docs/creating-managing-projects#identifying_projects) - # * `LOCATION_ID` is the canonical ID for the job's location. - # The list of available locations can be obtained by calling - # [ListLocations][google.cloud.location.Locations.ListLocations]. - # For more information, see https://cloud.google.com/about/locations/. - # * `JOB_ID` can contain only letters ([A-Za-z]), numbers ([0-9]), - # hyphens (-), or underscores (_). The maximum length is 500 characters. - # @!attribute [rw] description - # @return [::String] - # Optionally caller-specified in - # {::Google::Cloud::Scheduler::V1::CloudScheduler::Client#create_job CreateJob} or - # {::Google::Cloud::Scheduler::V1::CloudScheduler::Client#update_job UpdateJob}. - # - # A human-readable description for the job. This string must not contain - # more than 500 characters. - # @!attribute [rw] pubsub_target - # @return [::Google::Cloud::Scheduler::V1::PubsubTarget] - # Pub/Sub target. - # - # Note: The following fields are mutually exclusive: `pubsub_target`, `app_engine_http_target`, `http_target`. If a field in that set is populated, all other fields in the set will automatically be cleared. - # @!attribute [rw] app_engine_http_target - # @return [::Google::Cloud::Scheduler::V1::AppEngineHttpTarget] - # App Engine HTTP target. - # - # Note: The following fields are mutually exclusive: `app_engine_http_target`, `pubsub_target`, `http_target`. If a field in that set is populated, all other fields in the set will automatically be cleared. - # @!attribute [rw] http_target - # @return [::Google::Cloud::Scheduler::V1::HttpTarget] - # HTTP target. - # - # Note: The following fields are mutually exclusive: `http_target`, `pubsub_target`, `app_engine_http_target`. If a field in that set is populated, all other fields in the set will automatically be cleared. - # @!attribute [rw] schedule - # @return [::String] - # Required, except when used with - # {::Google::Cloud::Scheduler::V1::CloudScheduler::Client#update_job UpdateJob}. - # - # Describes the schedule on which the job will be executed. - # - # The schedule can be either of the following types: - # - # * [Crontab](https://en.wikipedia.org/wiki/Cron#Overview) - # * English-like - # [schedule](https://cloud.google.com/scheduler/docs/configuring/cron-job-schedules) - # - # As a general rule, execution `n + 1` of a job will not begin - # until execution `n` has finished. Cloud Scheduler will never - # allow two simultaneously outstanding executions. For example, - # this implies that if the `n+1`th execution is scheduled to run at - # 16:00 but the `n`th execution takes until 16:15, the `n+1`th - # execution will not start until `16:15`. - # A scheduled start time will be delayed if the previous - # execution has not ended when its scheduled time occurs. - # - # If {::Google::Cloud::Scheduler::V1::RetryConfig#retry_count retry_count} > 0 and - # a job attempt fails, the job will be tried a total of - # {::Google::Cloud::Scheduler::V1::RetryConfig#retry_count retry_count} times, - # with exponential backoff, until the next scheduled start time. If - # retry_count is 0, a job attempt will not be retried if it fails. Instead - # the Cloud Scheduler system will wait for the next scheduled execution time. - # Setting retry_count to 0 does not prevent failed jobs from running - # according to schedule after the failure. - # @!attribute [rw] time_zone - # @return [::String] - # Specifies the time zone to be used in interpreting - # {::Google::Cloud::Scheduler::V1::Job#schedule schedule}. The value of this field - # must be a time zone name from the [tz - # database](http://en.wikipedia.org/wiki/Tz_database). - # - # Note that some time zones include a provision for - # daylight savings time. The rules for daylight saving time are - # determined by the chosen tz. For UTC use the string "utc". If a - # time zone is not specified, the default will be in UTC (also known - # as GMT). - # @!attribute [r] user_update_time - # @return [::Google::Protobuf::Timestamp] - # Output only. The creation time of the job. - # @!attribute [r] state - # @return [::Google::Cloud::Scheduler::V1::Job::State] - # Output only. State of the job. - # @!attribute [r] status - # @return [::Google::Rpc::Status] - # Output only. The response from the target for the last attempted execution. - # @!attribute [r] schedule_time - # @return [::Google::Protobuf::Timestamp] - # Output only. The next time the job is scheduled. Note that this may be a - # retry of a previously failed attempt or the next execution time - # according to the schedule. - # @!attribute [r] last_attempt_time - # @return [::Google::Protobuf::Timestamp] - # Output only. The time the last job attempt started. - # @!attribute [rw] retry_config - # @return [::Google::Cloud::Scheduler::V1::RetryConfig] - # Settings that determine the retry behavior. - # @!attribute [rw] attempt_deadline - # @return [::Google::Protobuf::Duration] - # The deadline for job attempts. If the request handler does not respond by - # this deadline then the request is cancelled and the attempt is marked as a - # `DEADLINE_EXCEEDED` failure. The failed attempt can be viewed in - # execution logs. Cloud Scheduler will retry the job according - # to the {::Google::Cloud::Scheduler::V1::RetryConfig RetryConfig}. - # - # The default and the allowed values depend on the type of target: - # - # * For {::Google::Cloud::Scheduler::V1::Job#http_target HTTP targets}, the - # default is 3 minutes. The deadline must be in the interval [15 seconds, 30 - # minutes]. - # - # * For [App Engine HTTP - # targets][google.cloud.scheduler.v1.Job.app_engine_http_target], 0 indicates - # that the request has the default deadline. The default deadline depends on - # the scaling type of the service: 10 minutes for standard apps with - # automatic scaling, 24 hours for standard apps with manual and basic - # scaling, and 60 minutes for flex apps. If the request deadline is set, it - # must be in the interval [15 seconds, 24 hours 15 seconds]. - # - # * For [Pub/Sub targets][google.cloud.scheduler.v1.Job.pubsub_target], this - # field is ignored. - class Job - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - - # State of the job. - module State - # Unspecified state. - STATE_UNSPECIFIED = 0 - - # The job is executing normally. - ENABLED = 1 - - # The job is paused by the user. It will not execute. A user can - # intentionally pause the job using - # {::Google::Cloud::Scheduler::V1::PauseJobRequest PauseJobRequest}. - PAUSED = 2 - - # The job is disabled by the system due to error. The user - # cannot directly set a job to be disabled. - DISABLED = 3 - - # The job state resulting from a failed - # {::Google::Cloud::Scheduler::V1::CloudScheduler::Client#update_job CloudScheduler.UpdateJob} - # operation. To recover a job from this state, retry - # {::Google::Cloud::Scheduler::V1::CloudScheduler::Client#update_job CloudScheduler.UpdateJob} - # until a successful response is received. - UPDATE_FAILED = 4 - end - end - - # Settings that determine the retry behavior. - # - # By default, if a job does not complete successfully (meaning that - # an acknowledgement is not received from the handler, then it will be retried - # with exponential backoff according to the settings in - # {::Google::Cloud::Scheduler::V1::RetryConfig RetryConfig}. - # @!attribute [rw] retry_count - # @return [::Integer] - # The number of attempts that the system will make to run a job using the - # exponential backoff procedure described by - # {::Google::Cloud::Scheduler::V1::RetryConfig#max_doublings max_doublings}. - # - # The default value of retry_count is zero. - # - # If retry_count is 0, a job attempt will not be retried if - # it fails. Instead the Cloud Scheduler system will wait for the - # next scheduled execution time. Setting retry_count to 0 does not prevent - # failed jobs from running according to schedule after the failure. - # - # If retry_count is set to a non-zero number then Cloud Scheduler - # will retry failed attempts, using exponential backoff, - # retry_count times, or until the next scheduled execution time, - # whichever comes first. - # - # Values greater than 5 and negative values are not allowed. - # @!attribute [rw] max_retry_duration - # @return [::Google::Protobuf::Duration] - # The time limit for retrying a failed job, measured from time when an - # execution was first attempted. If specified with - # {::Google::Cloud::Scheduler::V1::RetryConfig#retry_count retry_count}, the job - # will be retried until both limits are reached. - # - # The default value for max_retry_duration is zero, which means retry - # duration is unlimited. - # @!attribute [rw] min_backoff_duration - # @return [::Google::Protobuf::Duration] - # The minimum amount of time to wait before retrying a job after - # it fails. - # - # The default value of this field is 5 seconds. - # @!attribute [rw] max_backoff_duration - # @return [::Google::Protobuf::Duration] - # The maximum amount of time to wait before retrying a job after - # it fails. - # - # The default value of this field is 1 hour. - # @!attribute [rw] max_doublings - # @return [::Integer] - # The time between retries will double `max_doublings` times. - # - # A job's retry interval starts at - # {::Google::Cloud::Scheduler::V1::RetryConfig#min_backoff_duration min_backoff_duration}, - # then doubles `max_doublings` times, then increases linearly, and finally - # retries at intervals of - # {::Google::Cloud::Scheduler::V1::RetryConfig#max_backoff_duration max_backoff_duration} - # up to {::Google::Cloud::Scheduler::V1::RetryConfig#retry_count retry_count} - # times. - # - # For example, if - # {::Google::Cloud::Scheduler::V1::RetryConfig#min_backoff_duration min_backoff_duration} - # is 10s, - # {::Google::Cloud::Scheduler::V1::RetryConfig#max_backoff_duration max_backoff_duration} - # is 300s, and `max_doublings` is 3, then the job will first be retried in - # 10s. The retry interval will double three times, and then increase linearly - # by 2^3 * 10s. Finally, the job will retry at intervals of - # {::Google::Cloud::Scheduler::V1::RetryConfig#max_backoff_duration max_backoff_duration} - # until the job has been attempted - # {::Google::Cloud::Scheduler::V1::RetryConfig#retry_count retry_count} times. - # Thus, the requests will retry at 10s, 20s, 40s, 80s, 160s, 240s, 300s, - # 300s, .... - # - # The default value of this field is 5. - class RetryConfig - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - end - end - end -end diff --git a/owl-bot-staging/google-cloud-scheduler-v1/proto_docs/google/cloud/scheduler/v1/target.rb b/owl-bot-staging/google-cloud-scheduler-v1/proto_docs/google/cloud/scheduler/v1/target.rb deleted file mode 100644 index e272bf407ead..000000000000 --- a/owl-bot-staging/google-cloud-scheduler-v1/proto_docs/google/cloud/scheduler/v1/target.rb +++ /dev/null @@ -1,420 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - - -module Google - module Cloud - module Scheduler - module V1 - # Http target. The job will be pushed to the job handler by means of - # an HTTP request via an - # {::Google::Cloud::Scheduler::V1::HttpTarget#http_method http_method} such as HTTP - # POST, HTTP GET, etc. The job is acknowledged by means of an HTTP - # response code in the range [200 - 299]. A failure to receive a response - # constitutes a failed execution. For a redirected request, the response - # returned by the redirected request is considered. - # @!attribute [rw] uri - # @return [::String] - # Required. The full URI path that the request will be sent to. This string - # must begin with either "http://" or "https://". Some examples of - # valid values for {::Google::Cloud::Scheduler::V1::HttpTarget#uri uri} are: - # `http://acme.com` and `https://acme.com/sales:8080`. Cloud Scheduler will - # encode some characters for safety and compatibility. The maximum allowed - # URL length is 2083 characters after encoding. - # @!attribute [rw] http_method - # @return [::Google::Cloud::Scheduler::V1::HttpMethod] - # Which HTTP method to use for the request. - # @!attribute [rw] headers - # @return [::Google::Protobuf::Map{::String => ::String}] - # HTTP request headers. - # - # This map contains the header field names and values. - # - # The user can specify HTTP request headers to send with the job's - # HTTP request. Repeated headers are not supported, but a header value can - # contain commas. - # - # The following headers represent a subset of the headers - # that accompany the job's HTTP request. Some HTTP request - # headers are ignored or replaced. A partial list of headers that - # are ignored or replaced is below: - # - # * Host: This will be computed by Cloud Scheduler and derived from - # {::Google::Cloud::Scheduler::V1::HttpTarget#uri uri}. - # * `Content-Length`: This will be computed by Cloud Scheduler. - # * `User-Agent`: This will be set to `"Google-Cloud-Scheduler"`. - # * `X-Google-*`: Google internal use only. - # * `X-AppEngine-*`: Google internal use only. - # * `X-CloudScheduler`: This header will be set to true. - # * `X-CloudScheduler-JobName`: This header will contain the job name. - # * `X-CloudScheduler-ScheduleTime`: For Cloud Scheduler jobs specified in - # the unix-cron format, this header will contain the job schedule as an - # offset of UTC parsed according to RFC3339. - # - # If the job has a {::Google::Cloud::Scheduler::V1::HttpTarget#body body} and the - # following headers are not set by the user, Cloud Scheduler sets default - # values: - # - # * `Content-Type`: This will be set to `"application/octet-stream"`. You - # can override this default by explicitly setting `Content-Type` to a - # particular media type when creating the job. For example, you can set - # `Content-Type` to `"application/json"`. - # - # The total size of headers must be less than 80KB. - # @!attribute [rw] body - # @return [::String] - # HTTP request body. A request body is allowed only if the HTTP - # method is POST, PUT, or PATCH. It is an error to set body on a job with an - # incompatible {::Google::Cloud::Scheduler::V1::HttpMethod HttpMethod}. - # @!attribute [rw] oauth_token - # @return [::Google::Cloud::Scheduler::V1::OAuthToken] - # If specified, an - # [OAuth token](https://developers.google.com/identity/protocols/OAuth2) - # will be generated and attached as an `Authorization` header in the HTTP - # request. - # - # This type of authorization should generally only be used when calling - # Google APIs hosted on *.googleapis.com. - # - # Note: The following fields are mutually exclusive: `oauth_token`, `oidc_token`. If a field in that set is populated, all other fields in the set will automatically be cleared. - # @!attribute [rw] oidc_token - # @return [::Google::Cloud::Scheduler::V1::OidcToken] - # If specified, an - # [OIDC](https://developers.google.com/identity/protocols/OpenIDConnect) - # token will be generated and attached as an `Authorization` header in the - # HTTP request. - # - # This type of authorization can be used for many scenarios, including - # calling Cloud Run, or endpoints where you intend to validate the token - # yourself. - # - # Note: The following fields are mutually exclusive: `oidc_token`, `oauth_token`. If a field in that set is populated, all other fields in the set will automatically be cleared. - class HttpTarget - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - - # @!attribute [rw] key - # @return [::String] - # @!attribute [rw] value - # @return [::String] - class HeadersEntry - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - end - - # App Engine target. The job will be pushed to a job handler by means - # of an HTTP request via an - # {::Google::Cloud::Scheduler::V1::AppEngineHttpTarget#http_method http_method} such - # as HTTP POST, HTTP GET, etc. The job is acknowledged by means of an - # HTTP response code in the range [200 - 299]. Error 503 is - # considered an App Engine system error instead of an application - # error. Requests returning error 503 will be retried regardless of - # retry configuration and not counted against retry counts. Any other - # response code, or a failure to receive a response before the - # deadline, constitutes a failed attempt. - # @!attribute [rw] http_method - # @return [::Google::Cloud::Scheduler::V1::HttpMethod] - # The HTTP method to use for the request. PATCH and OPTIONS are not - # permitted. - # @!attribute [rw] app_engine_routing - # @return [::Google::Cloud::Scheduler::V1::AppEngineRouting] - # App Engine Routing setting for the job. - # @!attribute [rw] relative_uri - # @return [::String] - # The relative URI. - # - # The relative URL must begin with "/" and must be a valid HTTP relative URL. - # It can contain a path, query string arguments, and `#` fragments. - # If the relative URL is empty, then the root path "/" will be used. - # No spaces are allowed, and the maximum length allowed is 2083 characters. - # @!attribute [rw] headers - # @return [::Google::Protobuf::Map{::String => ::String}] - # HTTP request headers. - # - # This map contains the header field names and values. Headers can be set - # when the job is created. - # - # Cloud Scheduler sets some headers to default values: - # - # * `User-Agent`: By default, this header is - # `"AppEngine-Google; (+http://code.google.com/appengine)"`. - # This header can be modified, but Cloud Scheduler will append - # `"AppEngine-Google; (+http://code.google.com/appengine)"` to the - # modified `User-Agent`. - # * `X-CloudScheduler`: This header will be set to true. - # * `X-CloudScheduler-JobName`: This header will contain the job name. - # * `X-CloudScheduler-ScheduleTime`: For Cloud Scheduler jobs specified in - # the unix-cron format, this header will contain the job schedule as an - # offset of UTC parsed according to RFC3339. - # - # If the job has a {::Google::Cloud::Scheduler::V1::AppEngineHttpTarget#body body} - # and the following headers are not set by the user, Cloud Scheduler sets - # default values: - # - # * `Content-Type`: This will be set to `"application/octet-stream"`. You - # can override this default by explicitly setting `Content-Type` to a - # particular media type when creating the job. For example, you can set - # `Content-Type` to `"application/json"`. - # - # The headers below are output only. They cannot be set or overridden: - # - # * `Content-Length`: This is computed by Cloud Scheduler. - # * `X-Google-*`: For Google internal use only. - # * `X-AppEngine-*`: For Google internal use only. - # - # In addition, some App Engine headers, which contain - # job-specific information, are also be sent to the job handler. - # @!attribute [rw] body - # @return [::String] - # Body. - # - # HTTP request body. A request body is allowed only if the HTTP method is - # POST or PUT. It will result in invalid argument error to set a body on a - # job with an incompatible - # {::Google::Cloud::Scheduler::V1::HttpMethod HttpMethod}. - class AppEngineHttpTarget - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - - # @!attribute [rw] key - # @return [::String] - # @!attribute [rw] value - # @return [::String] - class HeadersEntry - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - end - - # Pub/Sub target. The job will be delivered by publishing a message to - # the given Pub/Sub topic. - # @!attribute [rw] topic_name - # @return [::String] - # Required. The name of the Cloud Pub/Sub topic to which messages will - # be published when a job is delivered. The topic name must be in the - # same format as required by Pub/Sub's - # [PublishRequest.name](https://cloud.google.com/pubsub/docs/reference/rpc/google.pubsub.v1#publishrequest), - # for example `projects/PROJECT_ID/topics/TOPIC_ID`. - # - # The topic must be in the same project as the Cloud Scheduler job. - # @!attribute [rw] data - # @return [::String] - # The message payload for PubsubMessage. - # - # Pubsub message must contain either non-empty data, or at least one - # attribute. - # @!attribute [rw] attributes - # @return [::Google::Protobuf::Map{::String => ::String}] - # Attributes for PubsubMessage. - # - # Pubsub message must contain either non-empty data, or at least one - # attribute. - class PubsubTarget - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - - # @!attribute [rw] key - # @return [::String] - # @!attribute [rw] value - # @return [::String] - class AttributesEntry - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - end - - # App Engine Routing. - # - # For more information about services, versions, and instances see - # [An Overview of App - # Engine](https://cloud.google.com/appengine/docs/python/an-overview-of-app-engine), - # [Microservices Architecture on Google App - # Engine](https://cloud.google.com/appengine/docs/python/microservices-on-app-engine), - # [App Engine Standard request - # routing](https://cloud.google.com/appengine/docs/standard/python/how-requests-are-routed), - # and [App Engine Flex request - # routing](https://cloud.google.com/appengine/docs/flexible/python/how-requests-are-routed). - # @!attribute [rw] service - # @return [::String] - # App service. - # - # By default, the job is sent to the service which is the default - # service when the job is attempted. - # @!attribute [rw] version - # @return [::String] - # App version. - # - # By default, the job is sent to the version which is the default - # version when the job is attempted. - # @!attribute [rw] instance - # @return [::String] - # App instance. - # - # By default, the job is sent to an instance which is available when - # the job is attempted. - # - # Requests can only be sent to a specific instance if - # [manual scaling is used in App Engine - # Standard](https://cloud.google.com/appengine/docs/python/an-overview-of-app-engine?#scaling_types_and_instance_classes). - # App Engine Flex does not support instances. For more information, see - # [App Engine Standard request - # routing](https://cloud.google.com/appengine/docs/standard/python/how-requests-are-routed) - # and [App Engine Flex request - # routing](https://cloud.google.com/appengine/docs/flexible/python/how-requests-are-routed). - # @!attribute [rw] host - # @return [::String] - # Output only. The host that the job is sent to. - # - # For more information about how App Engine requests are routed, see - # [here](https://cloud.google.com/appengine/docs/standard/python/how-requests-are-routed). - # - # The host is constructed as: - # - # - # * `host = [application_domain_name]`
- # `| [service] + '.' + [application_domain_name]`
- # `| [version] + '.' + [application_domain_name]`
- # `| [version_dot_service]+ '.' + [application_domain_name]`
- # `| [instance] + '.' + [application_domain_name]`
- # `| [instance_dot_service] + '.' + [application_domain_name]`
- # `| [instance_dot_version] + '.' + [application_domain_name]`
- # `| [instance_dot_version_dot_service] + '.' + [application_domain_name]` - # - # * `application_domain_name` = The domain name of the app, for - # example .appspot.com, which is associated with the - # job's project ID. - # - # * `service =` {::Google::Cloud::Scheduler::V1::AppEngineRouting#service service} - # - # * `version =` {::Google::Cloud::Scheduler::V1::AppEngineRouting#version version} - # - # * `version_dot_service =` - # {::Google::Cloud::Scheduler::V1::AppEngineRouting#version version} `+ '.' +` - # {::Google::Cloud::Scheduler::V1::AppEngineRouting#service service} - # - # * `instance =` - # {::Google::Cloud::Scheduler::V1::AppEngineRouting#instance instance} - # - # * `instance_dot_service =` - # {::Google::Cloud::Scheduler::V1::AppEngineRouting#instance instance} `+ '.' +` - # {::Google::Cloud::Scheduler::V1::AppEngineRouting#service service} - # - # * `instance_dot_version =` - # {::Google::Cloud::Scheduler::V1::AppEngineRouting#instance instance} `+ '.' +` - # {::Google::Cloud::Scheduler::V1::AppEngineRouting#version version} - # - # * `instance_dot_version_dot_service =` - # {::Google::Cloud::Scheduler::V1::AppEngineRouting#instance instance} `+ '.' +` - # {::Google::Cloud::Scheduler::V1::AppEngineRouting#version version} `+ '.' +` - # {::Google::Cloud::Scheduler::V1::AppEngineRouting#service service} - # - # - # If {::Google::Cloud::Scheduler::V1::AppEngineRouting#service service} is empty, - # then the job will be sent to the service which is the default service when - # the job is attempted. - # - # If {::Google::Cloud::Scheduler::V1::AppEngineRouting#version version} is empty, - # then the job will be sent to the version which is the default version when - # the job is attempted. - # - # If {::Google::Cloud::Scheduler::V1::AppEngineRouting#instance instance} is - # empty, then the job will be sent to an instance which is available when the - # job is attempted. - # - # If {::Google::Cloud::Scheduler::V1::AppEngineRouting#service service}, - # {::Google::Cloud::Scheduler::V1::AppEngineRouting#version version}, or - # {::Google::Cloud::Scheduler::V1::AppEngineRouting#instance instance} is invalid, - # then the job will be sent to the default version of the default service - # when the job is attempted. - class AppEngineRouting - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Contains information needed for generating an - # [OAuth token](https://developers.google.com/identity/protocols/OAuth2). - # This type of authorization should generally only be used when calling Google - # APIs hosted on *.googleapis.com. - # @!attribute [rw] service_account_email - # @return [::String] - # [Service account email](https://cloud.google.com/iam/docs/service-accounts) - # to be used for generating OAuth token. - # The service account must be within the same project as the job. The caller - # must have iam.serviceAccounts.actAs permission for the service account. - # @!attribute [rw] scope - # @return [::String] - # OAuth scope to be used for generating OAuth access token. - # If not specified, "https://www.googleapis.com/auth/cloud-platform" - # will be used. - class OAuthToken - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Contains information needed for generating an - # [OpenID Connect - # token](https://developers.google.com/identity/protocols/OpenIDConnect). - # This type of authorization can be used for many scenarios, including - # calling Cloud Run, or endpoints where you intend to validate the token - # yourself. - # @!attribute [rw] service_account_email - # @return [::String] - # [Service account email](https://cloud.google.com/iam/docs/service-accounts) - # to be used for generating OIDC token. - # The service account must be within the same project as the job. The caller - # must have iam.serviceAccounts.actAs permission for the service account. - # @!attribute [rw] audience - # @return [::String] - # Audience to be used when generating OIDC token. If not specified, the URI - # specified in target will be used. - class OidcToken - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # The HTTP method used to execute the job. - module HttpMethod - # HTTP method unspecified. Defaults to POST. - HTTP_METHOD_UNSPECIFIED = 0 - - # HTTP POST - POST = 1 - - # HTTP GET - GET = 2 - - # HTTP HEAD - HEAD = 3 - - # HTTP PUT - PUT = 4 - - # HTTP DELETE - DELETE = 5 - - # HTTP PATCH - PATCH = 6 - - # HTTP OPTIONS - OPTIONS = 7 - end - end - end - end -end diff --git a/owl-bot-staging/google-cloud-scheduler-v1/proto_docs/google/protobuf/any.rb b/owl-bot-staging/google-cloud-scheduler-v1/proto_docs/google/protobuf/any.rb deleted file mode 100644 index 58691995f02e..000000000000 --- a/owl-bot-staging/google-cloud-scheduler-v1/proto_docs/google/protobuf/any.rb +++ /dev/null @@ -1,145 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - - -module Google - module Protobuf - # `Any` contains an arbitrary serialized protocol buffer message along with a - # URL that describes the type of the serialized message. - # - # Protobuf library provides support to pack/unpack Any values in the form - # of utility functions or additional generated methods of the Any type. - # - # Example 1: Pack and unpack a message in C++. - # - # Foo foo = ...; - # Any any; - # any.PackFrom(foo); - # ... - # if (any.UnpackTo(&foo)) { - # ... - # } - # - # Example 2: Pack and unpack a message in Java. - # - # Foo foo = ...; - # Any any = Any.pack(foo); - # ... - # if (any.is(Foo.class)) { - # foo = any.unpack(Foo.class); - # } - # // or ... - # if (any.isSameTypeAs(Foo.getDefaultInstance())) { - # foo = any.unpack(Foo.getDefaultInstance()); - # } - # - # Example 3: Pack and unpack a message in Python. - # - # foo = Foo(...) - # any = Any() - # any.Pack(foo) - # ... - # if any.Is(Foo.DESCRIPTOR): - # any.Unpack(foo) - # ... - # - # Example 4: Pack and unpack a message in Go - # - # foo := &pb.Foo{...} - # any, err := anypb.New(foo) - # if err != nil { - # ... - # } - # ... - # foo := &pb.Foo{} - # if err := any.UnmarshalTo(foo); err != nil { - # ... - # } - # - # The pack methods provided by protobuf library will by default use - # 'type.googleapis.com/full.type.name' as the type URL and the unpack - # methods only use the fully qualified type name after the last '/' - # in the type URL, for example "foo.bar.com/x/y.z" will yield type - # name "y.z". - # - # JSON - # ==== - # The JSON representation of an `Any` value uses the regular - # representation of the deserialized, embedded message, with an - # additional field `@type` which contains the type URL. Example: - # - # package google.profile; - # message Person { - # string first_name = 1; - # string last_name = 2; - # } - # - # { - # "@type": "type.googleapis.com/google.profile.Person", - # "firstName": , - # "lastName": - # } - # - # If the embedded message type is well-known and has a custom JSON - # representation, that representation will be embedded adding a field - # `value` which holds the custom JSON in addition to the `@type` - # field. Example (for message [google.protobuf.Duration][]): - # - # { - # "@type": "type.googleapis.com/google.protobuf.Duration", - # "value": "1.212s" - # } - # @!attribute [rw] type_url - # @return [::String] - # A URL/resource name that uniquely identifies the type of the serialized - # protocol buffer message. This string must contain at least - # one "/" character. The last segment of the URL's path must represent - # the fully qualified name of the type (as in - # `path/google.protobuf.Duration`). The name should be in a canonical form - # (e.g., leading "." is not accepted). - # - # In practice, teams usually precompile into the binary all types that they - # expect it to use in the context of Any. However, for URLs which use the - # scheme `http`, `https`, or no scheme, one can optionally set up a type - # server that maps type URLs to message definitions as follows: - # - # * If no scheme is provided, `https` is assumed. - # * An HTTP GET on the URL must yield a [google.protobuf.Type][] - # value in binary format, or produce an error. - # * Applications are allowed to cache lookup results based on the - # URL, or have them precompiled into a binary to avoid any - # lookup. Therefore, binary compatibility needs to be preserved - # on changes to types. (Use versioned type names to manage - # breaking changes.) - # - # Note: this functionality is not currently available in the official - # protobuf release, and it is not used for type URLs beginning with - # type.googleapis.com. As of May 2023, there are no widely used type server - # implementations and no plans to implement one. - # - # Schemes other than `http`, `https` (or the empty scheme) might be - # used with implementation specific semantics. - # @!attribute [rw] value - # @return [::String] - # Must be a valid serialized protocol buffer of the above specified type. - class Any - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - end -end diff --git a/owl-bot-staging/google-cloud-scheduler-v1/proto_docs/google/protobuf/duration.rb b/owl-bot-staging/google-cloud-scheduler-v1/proto_docs/google/protobuf/duration.rb deleted file mode 100644 index ea59f1f91daf..000000000000 --- a/owl-bot-staging/google-cloud-scheduler-v1/proto_docs/google/protobuf/duration.rb +++ /dev/null @@ -1,98 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - - -module Google - module Protobuf - # A Duration represents a signed, fixed-length span of time represented - # as a count of seconds and fractions of seconds at nanosecond - # resolution. It is independent of any calendar and concepts like "day" - # or "month". It is related to Timestamp in that the difference between - # two Timestamp values is a Duration and it can be added or subtracted - # from a Timestamp. Range is approximately +-10,000 years. - # - # # Examples - # - # Example 1: Compute Duration from two Timestamps in pseudo code. - # - # Timestamp start = ...; - # Timestamp end = ...; - # Duration duration = ...; - # - # duration.seconds = end.seconds - start.seconds; - # duration.nanos = end.nanos - start.nanos; - # - # if (duration.seconds < 0 && duration.nanos > 0) { - # duration.seconds += 1; - # duration.nanos -= 1000000000; - # } else if (duration.seconds > 0 && duration.nanos < 0) { - # duration.seconds -= 1; - # duration.nanos += 1000000000; - # } - # - # Example 2: Compute Timestamp from Timestamp + Duration in pseudo code. - # - # Timestamp start = ...; - # Duration duration = ...; - # Timestamp end = ...; - # - # end.seconds = start.seconds + duration.seconds; - # end.nanos = start.nanos + duration.nanos; - # - # if (end.nanos < 0) { - # end.seconds -= 1; - # end.nanos += 1000000000; - # } else if (end.nanos >= 1000000000) { - # end.seconds += 1; - # end.nanos -= 1000000000; - # } - # - # Example 3: Compute Duration from datetime.timedelta in Python. - # - # td = datetime.timedelta(days=3, minutes=10) - # duration = Duration() - # duration.FromTimedelta(td) - # - # # JSON Mapping - # - # In JSON format, the Duration type is encoded as a string rather than an - # object, where the string ends in the suffix "s" (indicating seconds) and - # is preceded by the number of seconds, with nanoseconds expressed as - # fractional seconds. For example, 3 seconds with 0 nanoseconds should be - # encoded in JSON format as "3s", while 3 seconds and 1 nanosecond should - # be expressed in JSON format as "3.000000001s", and 3 seconds and 1 - # microsecond should be expressed in JSON format as "3.000001s". - # @!attribute [rw] seconds - # @return [::Integer] - # Signed seconds of the span of time. Must be from -315,576,000,000 - # to +315,576,000,000 inclusive. Note: these bounds are computed from: - # 60 sec/min * 60 min/hr * 24 hr/day * 365.25 days/year * 10000 years - # @!attribute [rw] nanos - # @return [::Integer] - # Signed fractions of a second at nanosecond resolution of the span - # of time. Durations less than one second are represented with a 0 - # `seconds` field and a positive or negative `nanos` field. For durations - # of one second or more, a non-zero value for the `nanos` field must be - # of the same sign as the `seconds` field. Must be from -999,999,999 - # to +999,999,999 inclusive. - class Duration - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - end -end diff --git a/owl-bot-staging/google-cloud-scheduler-v1/proto_docs/google/protobuf/empty.rb b/owl-bot-staging/google-cloud-scheduler-v1/proto_docs/google/protobuf/empty.rb deleted file mode 100644 index 83e4481834a6..000000000000 --- a/owl-bot-staging/google-cloud-scheduler-v1/proto_docs/google/protobuf/empty.rb +++ /dev/null @@ -1,34 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - - -module Google - module Protobuf - # A generic empty message that you can re-use to avoid defining duplicated - # empty messages in your APIs. A typical example is to use it as the request - # or the response type of an API method. For instance: - # - # service Foo { - # rpc Bar(google.protobuf.Empty) returns (google.protobuf.Empty); - # } - class Empty - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - end -end diff --git a/owl-bot-staging/google-cloud-scheduler-v1/proto_docs/google/protobuf/field_mask.rb b/owl-bot-staging/google-cloud-scheduler-v1/proto_docs/google/protobuf/field_mask.rb deleted file mode 100644 index 7f3ffc78601a..000000000000 --- a/owl-bot-staging/google-cloud-scheduler-v1/proto_docs/google/protobuf/field_mask.rb +++ /dev/null @@ -1,229 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - - -module Google - module Protobuf - # `FieldMask` represents a set of symbolic field paths, for example: - # - # paths: "f.a" - # paths: "f.b.d" - # - # Here `f` represents a field in some root message, `a` and `b` - # fields in the message found in `f`, and `d` a field found in the - # message in `f.b`. - # - # Field masks are used to specify a subset of fields that should be - # returned by a get operation or modified by an update operation. - # Field masks also have a custom JSON encoding (see below). - # - # # Field Masks in Projections - # - # When used in the context of a projection, a response message or - # sub-message is filtered by the API to only contain those fields as - # specified in the mask. For example, if the mask in the previous - # example is applied to a response message as follows: - # - # f { - # a : 22 - # b { - # d : 1 - # x : 2 - # } - # y : 13 - # } - # z: 8 - # - # The result will not contain specific values for fields x,y and z - # (their value will be set to the default, and omitted in proto text - # output): - # - # - # f { - # a : 22 - # b { - # d : 1 - # } - # } - # - # A repeated field is not allowed except at the last position of a - # paths string. - # - # If a FieldMask object is not present in a get operation, the - # operation applies to all fields (as if a FieldMask of all fields - # had been specified). - # - # Note that a field mask does not necessarily apply to the - # top-level response message. In case of a REST get operation, the - # field mask applies directly to the response, but in case of a REST - # list operation, the mask instead applies to each individual message - # in the returned resource list. In case of a REST custom method, - # other definitions may be used. Where the mask applies will be - # clearly documented together with its declaration in the API. In - # any case, the effect on the returned resource/resources is required - # behavior for APIs. - # - # # Field Masks in Update Operations - # - # A field mask in update operations specifies which fields of the - # targeted resource are going to be updated. The API is required - # to only change the values of the fields as specified in the mask - # and leave the others untouched. If a resource is passed in to - # describe the updated values, the API ignores the values of all - # fields not covered by the mask. - # - # If a repeated field is specified for an update operation, new values will - # be appended to the existing repeated field in the target resource. Note that - # a repeated field is only allowed in the last position of a `paths` string. - # - # If a sub-message is specified in the last position of the field mask for an - # update operation, then new value will be merged into the existing sub-message - # in the target resource. - # - # For example, given the target message: - # - # f { - # b { - # d: 1 - # x: 2 - # } - # c: [1] - # } - # - # And an update message: - # - # f { - # b { - # d: 10 - # } - # c: [2] - # } - # - # then if the field mask is: - # - # paths: ["f.b", "f.c"] - # - # then the result will be: - # - # f { - # b { - # d: 10 - # x: 2 - # } - # c: [1, 2] - # } - # - # An implementation may provide options to override this default behavior for - # repeated and message fields. - # - # In order to reset a field's value to the default, the field must - # be in the mask and set to the default value in the provided resource. - # Hence, in order to reset all fields of a resource, provide a default - # instance of the resource and set all fields in the mask, or do - # not provide a mask as described below. - # - # If a field mask is not present on update, the operation applies to - # all fields (as if a field mask of all fields has been specified). - # Note that in the presence of schema evolution, this may mean that - # fields the client does not know and has therefore not filled into - # the request will be reset to their default. If this is unwanted - # behavior, a specific service may require a client to always specify - # a field mask, producing an error if not. - # - # As with get operations, the location of the resource which - # describes the updated values in the request message depends on the - # operation kind. In any case, the effect of the field mask is - # required to be honored by the API. - # - # ## Considerations for HTTP REST - # - # The HTTP kind of an update operation which uses a field mask must - # be set to PATCH instead of PUT in order to satisfy HTTP semantics - # (PUT must only be used for full updates). - # - # # JSON Encoding of Field Masks - # - # In JSON, a field mask is encoded as a single string where paths are - # separated by a comma. Fields name in each path are converted - # to/from lower-camel naming conventions. - # - # As an example, consider the following message declarations: - # - # message Profile { - # User user = 1; - # Photo photo = 2; - # } - # message User { - # string display_name = 1; - # string address = 2; - # } - # - # In proto a field mask for `Profile` may look as such: - # - # mask { - # paths: "user.display_name" - # paths: "photo" - # } - # - # In JSON, the same mask is represented as below: - # - # { - # mask: "user.displayName,photo" - # } - # - # # Field Masks and Oneof Fields - # - # Field masks treat fields in oneofs just as regular fields. Consider the - # following message: - # - # message SampleMessage { - # oneof test_oneof { - # string name = 4; - # SubMessage sub_message = 9; - # } - # } - # - # The field mask can be: - # - # mask { - # paths: "name" - # } - # - # Or: - # - # mask { - # paths: "sub_message" - # } - # - # Note that oneof type names ("test_oneof" in this case) cannot be used in - # paths. - # - # ## Field Mask Verification - # - # The implementation of any API method which has a FieldMask type field in the - # request should verify the included field paths, and return an - # `INVALID_ARGUMENT` error if any path is unmappable. - # @!attribute [rw] paths - # @return [::Array<::String>] - # The set of field mask paths. - class FieldMask - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - end -end diff --git a/owl-bot-staging/google-cloud-scheduler-v1/proto_docs/google/protobuf/timestamp.rb b/owl-bot-staging/google-cloud-scheduler-v1/proto_docs/google/protobuf/timestamp.rb deleted file mode 100644 index 74352be9c58c..000000000000 --- a/owl-bot-staging/google-cloud-scheduler-v1/proto_docs/google/protobuf/timestamp.rb +++ /dev/null @@ -1,127 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - - -module Google - module Protobuf - # A Timestamp represents a point in time independent of any time zone or local - # calendar, encoded as a count of seconds and fractions of seconds at - # nanosecond resolution. The count is relative to an epoch at UTC midnight on - # January 1, 1970, in the proleptic Gregorian calendar which extends the - # Gregorian calendar backwards to year one. - # - # All minutes are 60 seconds long. Leap seconds are "smeared" so that no leap - # second table is needed for interpretation, using a [24-hour linear - # smear](https://developers.google.com/time/smear). - # - # The range is from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59.999999999Z. By - # restricting to that range, we ensure that we can convert to and from [RFC - # 3339](https://www.ietf.org/rfc/rfc3339.txt) date strings. - # - # # Examples - # - # Example 1: Compute Timestamp from POSIX `time()`. - # - # Timestamp timestamp; - # timestamp.set_seconds(time(NULL)); - # timestamp.set_nanos(0); - # - # Example 2: Compute Timestamp from POSIX `gettimeofday()`. - # - # struct timeval tv; - # gettimeofday(&tv, NULL); - # - # Timestamp timestamp; - # timestamp.set_seconds(tv.tv_sec); - # timestamp.set_nanos(tv.tv_usec * 1000); - # - # Example 3: Compute Timestamp from Win32 `GetSystemTimeAsFileTime()`. - # - # FILETIME ft; - # GetSystemTimeAsFileTime(&ft); - # UINT64 ticks = (((UINT64)ft.dwHighDateTime) << 32) | ft.dwLowDateTime; - # - # // A Windows tick is 100 nanoseconds. Windows epoch 1601-01-01T00:00:00Z - # // is 11644473600 seconds before Unix epoch 1970-01-01T00:00:00Z. - # Timestamp timestamp; - # timestamp.set_seconds((INT64) ((ticks / 10000000) - 11644473600LL)); - # timestamp.set_nanos((INT32) ((ticks % 10000000) * 100)); - # - # Example 4: Compute Timestamp from Java `System.currentTimeMillis()`. - # - # long millis = System.currentTimeMillis(); - # - # Timestamp timestamp = Timestamp.newBuilder().setSeconds(millis / 1000) - # .setNanos((int) ((millis % 1000) * 1000000)).build(); - # - # Example 5: Compute Timestamp from Java `Instant.now()`. - # - # Instant now = Instant.now(); - # - # Timestamp timestamp = - # Timestamp.newBuilder().setSeconds(now.getEpochSecond()) - # .setNanos(now.getNano()).build(); - # - # Example 6: Compute Timestamp from current time in Python. - # - # timestamp = Timestamp() - # timestamp.GetCurrentTime() - # - # # JSON Mapping - # - # In JSON format, the Timestamp type is encoded as a string in the - # [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format. That is, the - # format is "\\{year}-\\{month}-\\{day}T\\{hour}:\\{min}:\\{sec}[.\\{frac_sec}]Z" - # where \\{year} is always expressed using four digits while \\{month}, \\{day}, - # \\{hour}, \\{min}, and \\{sec} are zero-padded to two digits each. The fractional - # seconds, which can go up to 9 digits (i.e. up to 1 nanosecond resolution), - # are optional. The "Z" suffix indicates the timezone ("UTC"); the timezone - # is required. A proto3 JSON serializer should always use UTC (as indicated by - # "Z") when printing the Timestamp type and a proto3 JSON parser should be - # able to accept both UTC and other timezones (as indicated by an offset). - # - # For example, "2017-01-15T01:30:15.01Z" encodes 15.01 seconds past - # 01:30 UTC on January 15, 2017. - # - # In JavaScript, one can convert a Date object to this format using the - # standard - # [toISOString()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toISOString) - # method. In Python, a standard `datetime.datetime` object can be converted - # to this format using - # [`strftime`](https://docs.python.org/2/library/time.html#time.strftime) with - # the time format spec '%Y-%m-%dT%H:%M:%S.%fZ'. Likewise, in Java, one can use - # the Joda Time's [`ISODateTimeFormat.dateTime()`]( - # http://joda-time.sourceforge.net/apidocs/org/joda/time/format/ISODateTimeFormat.html#dateTime() - # ) to obtain a formatter capable of generating timestamps in this format. - # @!attribute [rw] seconds - # @return [::Integer] - # Represents seconds of UTC time since Unix epoch - # 1970-01-01T00:00:00Z. Must be from 0001-01-01T00:00:00Z to - # 9999-12-31T23:59:59Z inclusive. - # @!attribute [rw] nanos - # @return [::Integer] - # Non-negative fractions of a second at nanosecond resolution. Negative - # second values with fractions must still have non-negative nanos values - # that count forward in time. Must be from 0 to 999,999,999 - # inclusive. - class Timestamp - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - end -end diff --git a/owl-bot-staging/google-cloud-scheduler-v1/proto_docs/google/rpc/status.rb b/owl-bot-staging/google-cloud-scheduler-v1/proto_docs/google/rpc/status.rb deleted file mode 100644 index c1a1c07eb2db..000000000000 --- a/owl-bot-staging/google-cloud-scheduler-v1/proto_docs/google/rpc/status.rb +++ /dev/null @@ -1,48 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - - -module Google - module Rpc - # The `Status` type defines a logical error model that is suitable for - # different programming environments, including REST APIs and RPC APIs. It is - # used by [gRPC](https://github.com/grpc). Each `Status` message contains - # three pieces of data: error code, error message, and error details. - # - # You can find out more about this error model and how to work with it in the - # [API Design Guide](https://cloud.google.com/apis/design/errors). - # @!attribute [rw] code - # @return [::Integer] - # The status code, which should be an enum value of - # [google.rpc.Code][google.rpc.Code]. - # @!attribute [rw] message - # @return [::String] - # A developer-facing error message, which should be in English. Any - # user-facing error message should be localized and sent in the - # {::Google::Rpc::Status#details google.rpc.Status.details} field, or localized - # by the client. - # @!attribute [rw] details - # @return [::Array<::Google::Protobuf::Any>] - # A list of messages that carry the error details. There is a common set of - # message types for APIs to use. - class Status - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - end -end diff --git a/owl-bot-staging/google-cloud-scheduler-v1/snippets/Gemfile b/owl-bot-staging/google-cloud-scheduler-v1/snippets/Gemfile deleted file mode 100644 index c02c47d852c8..000000000000 --- a/owl-bot-staging/google-cloud-scheduler-v1/snippets/Gemfile +++ /dev/null @@ -1,32 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -source "https://rubygems.org" - -if ENV["GOOGLE_CLOUD_SAMPLES_TEST"] == "master" - gem "google-cloud-scheduler-v1", path: "../" -else - gem "google-cloud-scheduler-v1" -end - -group :test do - gem "google-style", "~> 1.26.1" - gem "minitest", "~> 5.16" - gem "minitest-focus", "~> 1.1" - gem "minitest-hooks", "~> 1.5" -end diff --git a/owl-bot-staging/google-cloud-scheduler-v1/snippets/cloud_scheduler/create_job.rb b/owl-bot-staging/google-cloud-scheduler-v1/snippets/cloud_scheduler/create_job.rb deleted file mode 100644 index b397a8482a23..000000000000 --- a/owl-bot-staging/google-cloud-scheduler-v1/snippets/cloud_scheduler/create_job.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 cloudscheduler_v1_generated_CloudScheduler_CreateJob_sync] -require "google/cloud/scheduler/v1" - -## -# Snippet for the create_job call in the CloudScheduler service -# -# This snippet has been automatically generated and should be regarded as a code -# template only. It will require modifications to work: -# - It may require correct/in-range values for request initialization. -# - It may require specifying regional endpoints when creating the service -# client as shown in https://cloud.google.com/ruby/docs/reference. -# -# This is an auto-generated example demonstrating basic usage of -# Google::Cloud::Scheduler::V1::CloudScheduler::Client#create_job. -# -def create_job - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::Scheduler::V1::CloudScheduler::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::Scheduler::V1::CreateJobRequest.new - - # Call the create_job method. - result = client.create_job request - - # The returned object is of type Google::Cloud::Scheduler::V1::Job. - p result -end -# [END cloudscheduler_v1_generated_CloudScheduler_CreateJob_sync] diff --git a/owl-bot-staging/google-cloud-scheduler-v1/snippets/cloud_scheduler/delete_job.rb b/owl-bot-staging/google-cloud-scheduler-v1/snippets/cloud_scheduler/delete_job.rb deleted file mode 100644 index 97549a79d316..000000000000 --- a/owl-bot-staging/google-cloud-scheduler-v1/snippets/cloud_scheduler/delete_job.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 cloudscheduler_v1_generated_CloudScheduler_DeleteJob_sync] -require "google/cloud/scheduler/v1" - -## -# Snippet for the delete_job call in the CloudScheduler service -# -# This snippet has been automatically generated and should be regarded as a code -# template only. It will require modifications to work: -# - It may require correct/in-range values for request initialization. -# - It may require specifying regional endpoints when creating the service -# client as shown in https://cloud.google.com/ruby/docs/reference. -# -# This is an auto-generated example demonstrating basic usage of -# Google::Cloud::Scheduler::V1::CloudScheduler::Client#delete_job. -# -def delete_job - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::Scheduler::V1::CloudScheduler::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::Scheduler::V1::DeleteJobRequest.new - - # Call the delete_job method. - result = client.delete_job request - - # The returned object is of type Google::Protobuf::Empty. - p result -end -# [END cloudscheduler_v1_generated_CloudScheduler_DeleteJob_sync] diff --git a/owl-bot-staging/google-cloud-scheduler-v1/snippets/cloud_scheduler/get_job.rb b/owl-bot-staging/google-cloud-scheduler-v1/snippets/cloud_scheduler/get_job.rb deleted file mode 100644 index b6bc399e6655..000000000000 --- a/owl-bot-staging/google-cloud-scheduler-v1/snippets/cloud_scheduler/get_job.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 cloudscheduler_v1_generated_CloudScheduler_GetJob_sync] -require "google/cloud/scheduler/v1" - -## -# Snippet for the get_job call in the CloudScheduler service -# -# This snippet has been automatically generated and should be regarded as a code -# template only. It will require modifications to work: -# - It may require correct/in-range values for request initialization. -# - It may require specifying regional endpoints when creating the service -# client as shown in https://cloud.google.com/ruby/docs/reference. -# -# This is an auto-generated example demonstrating basic usage of -# Google::Cloud::Scheduler::V1::CloudScheduler::Client#get_job. -# -def get_job - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::Scheduler::V1::CloudScheduler::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::Scheduler::V1::GetJobRequest.new - - # Call the get_job method. - result = client.get_job request - - # The returned object is of type Google::Cloud::Scheduler::V1::Job. - p result -end -# [END cloudscheduler_v1_generated_CloudScheduler_GetJob_sync] diff --git a/owl-bot-staging/google-cloud-scheduler-v1/snippets/cloud_scheduler/list_jobs.rb b/owl-bot-staging/google-cloud-scheduler-v1/snippets/cloud_scheduler/list_jobs.rb deleted file mode 100644 index 9b659a6cfdf5..000000000000 --- a/owl-bot-staging/google-cloud-scheduler-v1/snippets/cloud_scheduler/list_jobs.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 cloudscheduler_v1_generated_CloudScheduler_ListJobs_sync] -require "google/cloud/scheduler/v1" - -## -# Snippet for the list_jobs call in the CloudScheduler service -# -# This snippet has been automatically generated and should be regarded as a code -# template only. It will require modifications to work: -# - It may require correct/in-range values for request initialization. -# - It may require specifying regional endpoints when creating the service -# client as shown in https://cloud.google.com/ruby/docs/reference. -# -# This is an auto-generated example demonstrating basic usage of -# Google::Cloud::Scheduler::V1::CloudScheduler::Client#list_jobs. -# -def list_jobs - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::Scheduler::V1::CloudScheduler::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::Scheduler::V1::ListJobsRequest.new - - # Call the list_jobs method. - result = client.list_jobs request - - # The returned object is of type Gapic::PagedEnumerable. You can iterate - # over elements, and API calls will be issued to fetch pages as needed. - result.each do |item| - # Each element is of type ::Google::Cloud::Scheduler::V1::Job. - p item - end -end -# [END cloudscheduler_v1_generated_CloudScheduler_ListJobs_sync] diff --git a/owl-bot-staging/google-cloud-scheduler-v1/snippets/cloud_scheduler/pause_job.rb b/owl-bot-staging/google-cloud-scheduler-v1/snippets/cloud_scheduler/pause_job.rb deleted file mode 100644 index fcf829fcca02..000000000000 --- a/owl-bot-staging/google-cloud-scheduler-v1/snippets/cloud_scheduler/pause_job.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 cloudscheduler_v1_generated_CloudScheduler_PauseJob_sync] -require "google/cloud/scheduler/v1" - -## -# Snippet for the pause_job call in the CloudScheduler service -# -# This snippet has been automatically generated and should be regarded as a code -# template only. It will require modifications to work: -# - It may require correct/in-range values for request initialization. -# - It may require specifying regional endpoints when creating the service -# client as shown in https://cloud.google.com/ruby/docs/reference. -# -# This is an auto-generated example demonstrating basic usage of -# Google::Cloud::Scheduler::V1::CloudScheduler::Client#pause_job. -# -def pause_job - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::Scheduler::V1::CloudScheduler::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::Scheduler::V1::PauseJobRequest.new - - # Call the pause_job method. - result = client.pause_job request - - # The returned object is of type Google::Cloud::Scheduler::V1::Job. - p result -end -# [END cloudscheduler_v1_generated_CloudScheduler_PauseJob_sync] diff --git a/owl-bot-staging/google-cloud-scheduler-v1/snippets/cloud_scheduler/resume_job.rb b/owl-bot-staging/google-cloud-scheduler-v1/snippets/cloud_scheduler/resume_job.rb deleted file mode 100644 index 436bdc7d5ed9..000000000000 --- a/owl-bot-staging/google-cloud-scheduler-v1/snippets/cloud_scheduler/resume_job.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 cloudscheduler_v1_generated_CloudScheduler_ResumeJob_sync] -require "google/cloud/scheduler/v1" - -## -# Snippet for the resume_job call in the CloudScheduler service -# -# This snippet has been automatically generated and should be regarded as a code -# template only. It will require modifications to work: -# - It may require correct/in-range values for request initialization. -# - It may require specifying regional endpoints when creating the service -# client as shown in https://cloud.google.com/ruby/docs/reference. -# -# This is an auto-generated example demonstrating basic usage of -# Google::Cloud::Scheduler::V1::CloudScheduler::Client#resume_job. -# -def resume_job - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::Scheduler::V1::CloudScheduler::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::Scheduler::V1::ResumeJobRequest.new - - # Call the resume_job method. - result = client.resume_job request - - # The returned object is of type Google::Cloud::Scheduler::V1::Job. - p result -end -# [END cloudscheduler_v1_generated_CloudScheduler_ResumeJob_sync] diff --git a/owl-bot-staging/google-cloud-scheduler-v1/snippets/cloud_scheduler/run_job.rb b/owl-bot-staging/google-cloud-scheduler-v1/snippets/cloud_scheduler/run_job.rb deleted file mode 100644 index 5b9f45f48110..000000000000 --- a/owl-bot-staging/google-cloud-scheduler-v1/snippets/cloud_scheduler/run_job.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 cloudscheduler_v1_generated_CloudScheduler_RunJob_sync] -require "google/cloud/scheduler/v1" - -## -# Snippet for the run_job call in the CloudScheduler service -# -# This snippet has been automatically generated and should be regarded as a code -# template only. It will require modifications to work: -# - It may require correct/in-range values for request initialization. -# - It may require specifying regional endpoints when creating the service -# client as shown in https://cloud.google.com/ruby/docs/reference. -# -# This is an auto-generated example demonstrating basic usage of -# Google::Cloud::Scheduler::V1::CloudScheduler::Client#run_job. -# -def run_job - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::Scheduler::V1::CloudScheduler::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::Scheduler::V1::RunJobRequest.new - - # Call the run_job method. - result = client.run_job request - - # The returned object is of type Google::Cloud::Scheduler::V1::Job. - p result -end -# [END cloudscheduler_v1_generated_CloudScheduler_RunJob_sync] diff --git a/owl-bot-staging/google-cloud-scheduler-v1/snippets/cloud_scheduler/update_job.rb b/owl-bot-staging/google-cloud-scheduler-v1/snippets/cloud_scheduler/update_job.rb deleted file mode 100644 index d69082323ccf..000000000000 --- a/owl-bot-staging/google-cloud-scheduler-v1/snippets/cloud_scheduler/update_job.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 cloudscheduler_v1_generated_CloudScheduler_UpdateJob_sync] -require "google/cloud/scheduler/v1" - -## -# Snippet for the update_job call in the CloudScheduler service -# -# This snippet has been automatically generated and should be regarded as a code -# template only. It will require modifications to work: -# - It may require correct/in-range values for request initialization. -# - It may require specifying regional endpoints when creating the service -# client as shown in https://cloud.google.com/ruby/docs/reference. -# -# This is an auto-generated example demonstrating basic usage of -# Google::Cloud::Scheduler::V1::CloudScheduler::Client#update_job. -# -def update_job - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::Scheduler::V1::CloudScheduler::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::Scheduler::V1::UpdateJobRequest.new - - # Call the update_job method. - result = client.update_job request - - # The returned object is of type Google::Cloud::Scheduler::V1::Job. - p result -end -# [END cloudscheduler_v1_generated_CloudScheduler_UpdateJob_sync] diff --git a/owl-bot-staging/google-cloud-scheduler-v1/snippets/snippet_metadata_google.cloud.scheduler.v1.json b/owl-bot-staging/google-cloud-scheduler-v1/snippets/snippet_metadata_google.cloud.scheduler.v1.json deleted file mode 100644 index c9cff986a1da..000000000000 --- a/owl-bot-staging/google-cloud-scheduler-v1/snippets/snippet_metadata_google.cloud.scheduler.v1.json +++ /dev/null @@ -1,335 +0,0 @@ -{ - "client_library": { - "name": "google-cloud-scheduler-v1", - "version": "", - "language": "RUBY", - "apis": [ - { - "id": "google.cloud.scheduler.v1", - "version": "v1" - } - ] - }, - "snippets": [ - { - "region_tag": "cloudscheduler_v1_generated_CloudScheduler_ListJobs_sync", - "title": "Snippet for the list_jobs call in the CloudScheduler service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Scheduler::V1::CloudScheduler::Client#list_jobs.", - "file": "cloud_scheduler/list_jobs.rb", - "language": "RUBY", - "client_method": { - "short_name": "list_jobs", - "full_name": "::Google::Cloud::Scheduler::V1::CloudScheduler::Client#list_jobs", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::Scheduler::V1::ListJobsRequest", - "name": "request" - } - ], - "result_type": "::Google::Cloud::Scheduler::V1::ListJobsResponse", - "client": { - "short_name": "CloudScheduler::Client", - "full_name": "::Google::Cloud::Scheduler::V1::CloudScheduler::Client" - }, - "method": { - "short_name": "ListJobs", - "full_name": "google.cloud.scheduler.v1.CloudScheduler.ListJobs", - "service": { - "short_name": "CloudScheduler", - "full_name": "google.cloud.scheduler.v1.CloudScheduler" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 50, - "type": "FULL" - } - ] - }, - { - "region_tag": "cloudscheduler_v1_generated_CloudScheduler_GetJob_sync", - "title": "Snippet for the get_job call in the CloudScheduler service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Scheduler::V1::CloudScheduler::Client#get_job.", - "file": "cloud_scheduler/get_job.rb", - "language": "RUBY", - "client_method": { - "short_name": "get_job", - "full_name": "::Google::Cloud::Scheduler::V1::CloudScheduler::Client#get_job", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::Scheduler::V1::GetJobRequest", - "name": "request" - } - ], - "result_type": "::Google::Cloud::Scheduler::V1::Job", - "client": { - "short_name": "CloudScheduler::Client", - "full_name": "::Google::Cloud::Scheduler::V1::CloudScheduler::Client" - }, - "method": { - "short_name": "GetJob", - "full_name": "google.cloud.scheduler.v1.CloudScheduler.GetJob", - "service": { - "short_name": "CloudScheduler", - "full_name": "google.cloud.scheduler.v1.CloudScheduler" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 46, - "type": "FULL" - } - ] - }, - { - "region_tag": "cloudscheduler_v1_generated_CloudScheduler_CreateJob_sync", - "title": "Snippet for the create_job call in the CloudScheduler service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Scheduler::V1::CloudScheduler::Client#create_job.", - "file": "cloud_scheduler/create_job.rb", - "language": "RUBY", - "client_method": { - "short_name": "create_job", - "full_name": "::Google::Cloud::Scheduler::V1::CloudScheduler::Client#create_job", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::Scheduler::V1::CreateJobRequest", - "name": "request" - } - ], - "result_type": "::Google::Cloud::Scheduler::V1::Job", - "client": { - "short_name": "CloudScheduler::Client", - "full_name": "::Google::Cloud::Scheduler::V1::CloudScheduler::Client" - }, - "method": { - "short_name": "CreateJob", - "full_name": "google.cloud.scheduler.v1.CloudScheduler.CreateJob", - "service": { - "short_name": "CloudScheduler", - "full_name": "google.cloud.scheduler.v1.CloudScheduler" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 46, - "type": "FULL" - } - ] - }, - { - "region_tag": "cloudscheduler_v1_generated_CloudScheduler_UpdateJob_sync", - "title": "Snippet for the update_job call in the CloudScheduler service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Scheduler::V1::CloudScheduler::Client#update_job.", - "file": "cloud_scheduler/update_job.rb", - "language": "RUBY", - "client_method": { - "short_name": "update_job", - "full_name": "::Google::Cloud::Scheduler::V1::CloudScheduler::Client#update_job", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::Scheduler::V1::UpdateJobRequest", - "name": "request" - } - ], - "result_type": "::Google::Cloud::Scheduler::V1::Job", - "client": { - "short_name": "CloudScheduler::Client", - "full_name": "::Google::Cloud::Scheduler::V1::CloudScheduler::Client" - }, - "method": { - "short_name": "UpdateJob", - "full_name": "google.cloud.scheduler.v1.CloudScheduler.UpdateJob", - "service": { - "short_name": "CloudScheduler", - "full_name": "google.cloud.scheduler.v1.CloudScheduler" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 46, - "type": "FULL" - } - ] - }, - { - "region_tag": "cloudscheduler_v1_generated_CloudScheduler_DeleteJob_sync", - "title": "Snippet for the delete_job call in the CloudScheduler service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Scheduler::V1::CloudScheduler::Client#delete_job.", - "file": "cloud_scheduler/delete_job.rb", - "language": "RUBY", - "client_method": { - "short_name": "delete_job", - "full_name": "::Google::Cloud::Scheduler::V1::CloudScheduler::Client#delete_job", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::Scheduler::V1::DeleteJobRequest", - "name": "request" - } - ], - "result_type": "::Google::Protobuf::Empty", - "client": { - "short_name": "CloudScheduler::Client", - "full_name": "::Google::Cloud::Scheduler::V1::CloudScheduler::Client" - }, - "method": { - "short_name": "DeleteJob", - "full_name": "google.cloud.scheduler.v1.CloudScheduler.DeleteJob", - "service": { - "short_name": "CloudScheduler", - "full_name": "google.cloud.scheduler.v1.CloudScheduler" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 46, - "type": "FULL" - } - ] - }, - { - "region_tag": "cloudscheduler_v1_generated_CloudScheduler_PauseJob_sync", - "title": "Snippet for the pause_job call in the CloudScheduler service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Scheduler::V1::CloudScheduler::Client#pause_job.", - "file": "cloud_scheduler/pause_job.rb", - "language": "RUBY", - "client_method": { - "short_name": "pause_job", - "full_name": "::Google::Cloud::Scheduler::V1::CloudScheduler::Client#pause_job", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::Scheduler::V1::PauseJobRequest", - "name": "request" - } - ], - "result_type": "::Google::Cloud::Scheduler::V1::Job", - "client": { - "short_name": "CloudScheduler::Client", - "full_name": "::Google::Cloud::Scheduler::V1::CloudScheduler::Client" - }, - "method": { - "short_name": "PauseJob", - "full_name": "google.cloud.scheduler.v1.CloudScheduler.PauseJob", - "service": { - "short_name": "CloudScheduler", - "full_name": "google.cloud.scheduler.v1.CloudScheduler" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 46, - "type": "FULL" - } - ] - }, - { - "region_tag": "cloudscheduler_v1_generated_CloudScheduler_ResumeJob_sync", - "title": "Snippet for the resume_job call in the CloudScheduler service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Scheduler::V1::CloudScheduler::Client#resume_job.", - "file": "cloud_scheduler/resume_job.rb", - "language": "RUBY", - "client_method": { - "short_name": "resume_job", - "full_name": "::Google::Cloud::Scheduler::V1::CloudScheduler::Client#resume_job", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::Scheduler::V1::ResumeJobRequest", - "name": "request" - } - ], - "result_type": "::Google::Cloud::Scheduler::V1::Job", - "client": { - "short_name": "CloudScheduler::Client", - "full_name": "::Google::Cloud::Scheduler::V1::CloudScheduler::Client" - }, - "method": { - "short_name": "ResumeJob", - "full_name": "google.cloud.scheduler.v1.CloudScheduler.ResumeJob", - "service": { - "short_name": "CloudScheduler", - "full_name": "google.cloud.scheduler.v1.CloudScheduler" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 46, - "type": "FULL" - } - ] - }, - { - "region_tag": "cloudscheduler_v1_generated_CloudScheduler_RunJob_sync", - "title": "Snippet for the run_job call in the CloudScheduler service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Scheduler::V1::CloudScheduler::Client#run_job.", - "file": "cloud_scheduler/run_job.rb", - "language": "RUBY", - "client_method": { - "short_name": "run_job", - "full_name": "::Google::Cloud::Scheduler::V1::CloudScheduler::Client#run_job", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::Scheduler::V1::RunJobRequest", - "name": "request" - } - ], - "result_type": "::Google::Cloud::Scheduler::V1::Job", - "client": { - "short_name": "CloudScheduler::Client", - "full_name": "::Google::Cloud::Scheduler::V1::CloudScheduler::Client" - }, - "method": { - "short_name": "RunJob", - "full_name": "google.cloud.scheduler.v1.CloudScheduler.RunJob", - "service": { - "short_name": "CloudScheduler", - "full_name": "google.cloud.scheduler.v1.CloudScheduler" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 46, - "type": "FULL" - } - ] - } - ] -} \ No newline at end of file diff --git a/owl-bot-staging/google-cloud-scheduler-v1/test/google/cloud/scheduler/v1/cloud_scheduler_paths_test.rb b/owl-bot-staging/google-cloud-scheduler-v1/test/google/cloud/scheduler/v1/cloud_scheduler_paths_test.rb deleted file mode 100644 index f3cd6eff3195..000000000000 --- a/owl-bot-staging/google-cloud-scheduler-v1/test/google/cloud/scheduler/v1/cloud_scheduler_paths_test.rb +++ /dev/null @@ -1,79 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -require "helper" - -require "gapic/grpc/service_stub" - -require "google/cloud/scheduler/v1/cloud_scheduler" - -class ::Google::Cloud::Scheduler::V1::CloudScheduler::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_job_path - grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - ::Gapic::ServiceStub.stub :new, DummyStub.new do - client = ::Google::Cloud::Scheduler::V1::CloudScheduler::Client.new do |config| - config.credentials = grpc_channel - end - - path = client.job_path project: "value0", location: "value1", job: "value2" - assert_equal "projects/value0/locations/value1/jobs/value2", path - end - end - - def test_location_path - grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - ::Gapic::ServiceStub.stub :new, DummyStub.new do - client = ::Google::Cloud::Scheduler::V1::CloudScheduler::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_topic_path - grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - ::Gapic::ServiceStub.stub :new, DummyStub.new do - client = ::Google::Cloud::Scheduler::V1::CloudScheduler::Client.new do |config| - config.credentials = grpc_channel - end - - path = client.topic_path project: "value0", topic: "value1" - assert_equal "projects/value0/topics/value1", path - end - end -end diff --git a/owl-bot-staging/google-cloud-scheduler-v1/test/google/cloud/scheduler/v1/cloud_scheduler_rest_test.rb b/owl-bot-staging/google-cloud-scheduler-v1/test/google/cloud/scheduler/v1/cloud_scheduler_rest_test.rb deleted file mode 100644 index fb7b628563c0..000000000000 --- a/owl-bot-staging/google-cloud-scheduler-v1/test/google/cloud/scheduler/v1/cloud_scheduler_rest_test.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 "helper" -require "gapic/rest" -require "google/cloud/scheduler/v1/cloudscheduler_pb" -require "google/cloud/scheduler/v1/cloud_scheduler/rest" - - -class ::Google::Cloud::Scheduler::V1::CloudScheduler::Rest::ClientTest < Minitest::Test - class ClientStub - attr_accessor :call_count, :requests - - def initialize response, &block - @response = response - @block = block - @call_count = 0 - @requests = [] - end - - def make_get_request uri:, params: {}, options: {}, method_name: nil - make_http_request :get, uri: uri, body: nil, params: params, options: options, method_name: method_name - end - - def make_delete_request uri:, params: {}, options: {}, method_name: nil - make_http_request :delete, uri: uri, body: nil, params: params, options: options, method_name: method_name - end - - def make_post_request uri:, body: nil, params: {}, options: {}, method_name: nil - make_http_request :post, uri: uri, body: body, params: params, options: options, method_name: method_name - end - - def make_patch_request uri:, body:, params: {}, options: {}, method_name: nil - make_http_request :patch, uri: uri, body: body, params: params, options: options, method_name: method_name - end - - def make_put_request uri:, body:, params: {}, options: {}, method_name: nil - make_http_request :put, uri: uri, body: body, params: params, options: options, method_name: method_name - end - - def make_http_request *args, **kwargs - @call_count += 1 - - @requests << @block&.call(*args, **kwargs) - - @response - end - - def endpoint - "endpoint.example.com" - end - - def universe_domain - "example.com" - end - - def stub_logger - nil - end - - def logger - nil - end - end - - def test_list_jobs - # Create test objects. - client_result = ::Google::Cloud::Scheduler::V1::ListJobsResponse.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_jobs_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| - assert options.metadata.key? :"x-goog-api-client" - assert options.metadata[:"x-goog-api-client"].include? "rest" - refute options.metadata[:"x-goog-api-client"].include? "grpc" - end - - ::Google::Cloud::Scheduler::V1::CloudScheduler::Rest::ServiceStub.stub :transcode_list_jobs_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, list_jobs_client_stub do - # Create client - client = ::Google::Cloud::Scheduler::V1::CloudScheduler::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - client.list_jobs({ 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_jobs 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_jobs ::Google::Cloud::Scheduler::V1::ListJobsRequest.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_jobs({ 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_jobs(::Google::Cloud::Scheduler::V1::ListJobsRequest.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_jobs_client_stub.call_count - end - end - end - - def test_get_job - # Create test objects. - client_result = ::Google::Cloud::Scheduler::V1::Job.new - http_response = OpenStruct.new body: client_result.to_json - - call_options = {} - - # Create request parameters for a unary method. - name = "hello world" - - get_job_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| - assert options.metadata.key? :"x-goog-api-client" - assert options.metadata[:"x-goog-api-client"].include? "rest" - refute options.metadata[:"x-goog-api-client"].include? "grpc" - end - - ::Google::Cloud::Scheduler::V1::CloudScheduler::Rest::ServiceStub.stub :transcode_get_job_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, get_job_client_stub do - # Create client - client = ::Google::Cloud::Scheduler::V1::CloudScheduler::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - client.get_job({ name: name }) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use named arguments - client.get_job name: name do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object - client.get_job ::Google::Cloud::Scheduler::V1::GetJobRequest.new(name: name) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use hash object with options - client.get_job({ name: name }, call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object with options - client.get_job(::Google::Cloud::Scheduler::V1::GetJobRequest.new(name: name), call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Verify method calls - assert_equal 5, get_job_client_stub.call_count - end - end - end - - def test_create_job - # Create test objects. - client_result = ::Google::Cloud::Scheduler::V1::Job.new - http_response = OpenStruct.new body: client_result.to_json - - call_options = {} - - # Create request parameters for a unary method. - parent = "hello world" - job = {} - - create_job_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| - assert options.metadata.key? :"x-goog-api-client" - assert options.metadata[:"x-goog-api-client"].include? "rest" - refute options.metadata[:"x-goog-api-client"].include? "grpc" - end - - ::Google::Cloud::Scheduler::V1::CloudScheduler::Rest::ServiceStub.stub :transcode_create_job_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, create_job_client_stub do - # Create client - client = ::Google::Cloud::Scheduler::V1::CloudScheduler::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - client.create_job({ parent: parent, job: job }) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use named arguments - client.create_job parent: parent, job: job do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object - client.create_job ::Google::Cloud::Scheduler::V1::CreateJobRequest.new(parent: parent, job: job) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use hash object with options - client.create_job({ parent: parent, job: job }, call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object with options - client.create_job(::Google::Cloud::Scheduler::V1::CreateJobRequest.new(parent: parent, job: job), call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Verify method calls - assert_equal 5, create_job_client_stub.call_count - end - end - end - - def test_update_job - # Create test objects. - client_result = ::Google::Cloud::Scheduler::V1::Job.new - http_response = OpenStruct.new body: client_result.to_json - - call_options = {} - - # Create request parameters for a unary method. - job = {} - update_mask = {} - - update_job_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| - assert options.metadata.key? :"x-goog-api-client" - assert options.metadata[:"x-goog-api-client"].include? "rest" - refute options.metadata[:"x-goog-api-client"].include? "grpc" - end - - ::Google::Cloud::Scheduler::V1::CloudScheduler::Rest::ServiceStub.stub :transcode_update_job_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, update_job_client_stub do - # Create client - client = ::Google::Cloud::Scheduler::V1::CloudScheduler::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - client.update_job({ job: job, update_mask: update_mask }) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use named arguments - client.update_job job: job, update_mask: update_mask do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object - client.update_job ::Google::Cloud::Scheduler::V1::UpdateJobRequest.new(job: job, update_mask: update_mask) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use hash object with options - client.update_job({ job: job, update_mask: update_mask }, call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object with options - client.update_job(::Google::Cloud::Scheduler::V1::UpdateJobRequest.new(job: job, update_mask: update_mask), call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Verify method calls - assert_equal 5, update_job_client_stub.call_count - end - end - end - - def test_delete_job - # Create test objects. - client_result = ::Google::Protobuf::Empty.new - http_response = OpenStruct.new body: client_result.to_json - - call_options = {} - - # Create request parameters for a unary method. - name = "hello world" - - delete_job_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| - assert options.metadata.key? :"x-goog-api-client" - assert options.metadata[:"x-goog-api-client"].include? "rest" - refute options.metadata[:"x-goog-api-client"].include? "grpc" - end - - ::Google::Cloud::Scheduler::V1::CloudScheduler::Rest::ServiceStub.stub :transcode_delete_job_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, delete_job_client_stub do - # Create client - client = ::Google::Cloud::Scheduler::V1::CloudScheduler::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - client.delete_job({ name: name }) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use named arguments - client.delete_job name: name do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object - client.delete_job ::Google::Cloud::Scheduler::V1::DeleteJobRequest.new(name: name) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use hash object with options - client.delete_job({ name: name }, call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object with options - client.delete_job(::Google::Cloud::Scheduler::V1::DeleteJobRequest.new(name: name), call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Verify method calls - assert_equal 5, delete_job_client_stub.call_count - end - end - end - - def test_pause_job - # Create test objects. - client_result = ::Google::Cloud::Scheduler::V1::Job.new - http_response = OpenStruct.new body: client_result.to_json - - call_options = {} - - # Create request parameters for a unary method. - name = "hello world" - - pause_job_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| - assert options.metadata.key? :"x-goog-api-client" - assert options.metadata[:"x-goog-api-client"].include? "rest" - refute options.metadata[:"x-goog-api-client"].include? "grpc" - end - - ::Google::Cloud::Scheduler::V1::CloudScheduler::Rest::ServiceStub.stub :transcode_pause_job_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, pause_job_client_stub do - # Create client - client = ::Google::Cloud::Scheduler::V1::CloudScheduler::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - client.pause_job({ name: name }) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use named arguments - client.pause_job name: name do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object - client.pause_job ::Google::Cloud::Scheduler::V1::PauseJobRequest.new(name: name) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use hash object with options - client.pause_job({ name: name }, call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object with options - client.pause_job(::Google::Cloud::Scheduler::V1::PauseJobRequest.new(name: name), call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Verify method calls - assert_equal 5, pause_job_client_stub.call_count - end - end - end - - def test_resume_job - # Create test objects. - client_result = ::Google::Cloud::Scheduler::V1::Job.new - http_response = OpenStruct.new body: client_result.to_json - - call_options = {} - - # Create request parameters for a unary method. - name = "hello world" - - resume_job_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| - assert options.metadata.key? :"x-goog-api-client" - assert options.metadata[:"x-goog-api-client"].include? "rest" - refute options.metadata[:"x-goog-api-client"].include? "grpc" - end - - ::Google::Cloud::Scheduler::V1::CloudScheduler::Rest::ServiceStub.stub :transcode_resume_job_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, resume_job_client_stub do - # Create client - client = ::Google::Cloud::Scheduler::V1::CloudScheduler::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - client.resume_job({ name: name }) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use named arguments - client.resume_job name: name do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object - client.resume_job ::Google::Cloud::Scheduler::V1::ResumeJobRequest.new(name: name) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use hash object with options - client.resume_job({ name: name }, call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object with options - client.resume_job(::Google::Cloud::Scheduler::V1::ResumeJobRequest.new(name: name), call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Verify method calls - assert_equal 5, resume_job_client_stub.call_count - end - end - end - - def test_run_job - # Create test objects. - client_result = ::Google::Cloud::Scheduler::V1::Job.new - http_response = OpenStruct.new body: client_result.to_json - - call_options = {} - - # Create request parameters for a unary method. - name = "hello world" - - run_job_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| - assert options.metadata.key? :"x-goog-api-client" - assert options.metadata[:"x-goog-api-client"].include? "rest" - refute options.metadata[:"x-goog-api-client"].include? "grpc" - end - - ::Google::Cloud::Scheduler::V1::CloudScheduler::Rest::ServiceStub.stub :transcode_run_job_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, run_job_client_stub do - # Create client - client = ::Google::Cloud::Scheduler::V1::CloudScheduler::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - client.run_job({ name: name }) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use named arguments - client.run_job name: name do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object - client.run_job ::Google::Cloud::Scheduler::V1::RunJobRequest.new(name: name) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use hash object with options - client.run_job({ name: name }, call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object with options - client.run_job(::Google::Cloud::Scheduler::V1::RunJobRequest.new(name: name), call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Verify method calls - assert_equal 5, run_job_client_stub.call_count - end - end - end - - def test_configure - credentials_token = :dummy_value - - client = block_config = config = nil - dummy_stub = ClientStub.new nil - Gapic::Rest::ClientStub.stub :new, dummy_stub do - client = ::Google::Cloud::Scheduler::V1::CloudScheduler::Rest::Client.new do |config| - config.credentials = credentials_token - end - end - - config = client.configure do |c| - block_config = c - end - - assert_same block_config, config - assert_kind_of ::Google::Cloud::Scheduler::V1::CloudScheduler::Rest::Client::Configuration, config - end -end diff --git a/owl-bot-staging/google-cloud-scheduler-v1/test/google/cloud/scheduler/v1/cloud_scheduler_test.rb b/owl-bot-staging/google-cloud-scheduler-v1/test/google/cloud/scheduler/v1/cloud_scheduler_test.rb deleted file mode 100644 index 7348b8f733d8..000000000000 --- a/owl-bot-staging/google-cloud-scheduler-v1/test/google/cloud/scheduler/v1/cloud_scheduler_test.rb +++ /dev/null @@ -1,581 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -require "helper" - -require "gapic/grpc/service_stub" - -require "google/cloud/scheduler/v1/cloudscheduler_pb" -require "google/cloud/scheduler/v1/cloud_scheduler" - -class ::Google::Cloud::Scheduler::V1::CloudScheduler::ClientTest < Minitest::Test - class ClientStub - attr_accessor :call_rpc_count, :requests - - def initialize response, operation, &block - @response = response - @operation = operation - @block = block - @call_rpc_count = 0 - @requests = [] - end - - def call_rpc *args, **kwargs - @call_rpc_count += 1 - - @requests << @block&.call(*args, **kwargs) - - catch :response do - yield @response, @operation if block_given? - @response - end - end - - def endpoint - "endpoint.example.com" - end - - def universe_domain - "example.com" - end - - def stub_logger - nil - end - - def logger - nil - end - end - - def test_list_jobs - # Create GRPC objects. - grpc_response = ::Google::Cloud::Scheduler::V1::ListJobsResponse.new - grpc_operation = GRPC::ActiveCall::Operation.new nil - grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - grpc_options = {} - - # Create request parameters for a unary method. - parent = "hello world" - page_size = 42 - page_token = "hello world" - - list_jobs_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :list_jobs, name - assert_kind_of ::Google::Cloud::Scheduler::V1::ListJobsRequest, 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_jobs_client_stub do - # Create client - client = ::Google::Cloud::Scheduler::V1::CloudScheduler::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.list_jobs({ 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_jobs 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_jobs ::Google::Cloud::Scheduler::V1::ListJobsRequest.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_jobs({ 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_jobs(::Google::Cloud::Scheduler::V1::ListJobsRequest.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_jobs_client_stub.call_rpc_count - end - end - - def test_get_job - # Create GRPC objects. - grpc_response = ::Google::Cloud::Scheduler::V1::Job.new - grpc_operation = GRPC::ActiveCall::Operation.new nil - grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - grpc_options = {} - - # Create request parameters for a unary method. - name = "hello world" - - get_job_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :get_job, name - assert_kind_of ::Google::Cloud::Scheduler::V1::GetJobRequest, request - assert_equal "hello world", request["name"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, get_job_client_stub do - # Create client - client = ::Google::Cloud::Scheduler::V1::CloudScheduler::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.get_job({ name: name }) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use named arguments - client.get_job name: name do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object - client.get_job ::Google::Cloud::Scheduler::V1::GetJobRequest.new(name: name) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use hash object with options - client.get_job({ name: name }, grpc_options) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object with options - client.get_job(::Google::Cloud::Scheduler::V1::GetJobRequest.new(name: name), grpc_options) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Verify method calls - assert_equal 5, get_job_client_stub.call_rpc_count - end - end - - def test_create_job - # Create GRPC objects. - grpc_response = ::Google::Cloud::Scheduler::V1::Job.new - grpc_operation = GRPC::ActiveCall::Operation.new nil - grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - grpc_options = {} - - # Create request parameters for a unary method. - parent = "hello world" - job = {} - - create_job_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :create_job, name - assert_kind_of ::Google::Cloud::Scheduler::V1::CreateJobRequest, request - assert_equal "hello world", request["parent"] - assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::Scheduler::V1::Job), request["job"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, create_job_client_stub do - # Create client - client = ::Google::Cloud::Scheduler::V1::CloudScheduler::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.create_job({ parent: parent, job: job }) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use named arguments - client.create_job parent: parent, job: job do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object - client.create_job ::Google::Cloud::Scheduler::V1::CreateJobRequest.new(parent: parent, job: job) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use hash object with options - client.create_job({ parent: parent, job: job }, grpc_options) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object with options - client.create_job(::Google::Cloud::Scheduler::V1::CreateJobRequest.new(parent: parent, job: job), grpc_options) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Verify method calls - assert_equal 5, create_job_client_stub.call_rpc_count - end - end - - def test_update_job - # Create GRPC objects. - grpc_response = ::Google::Cloud::Scheduler::V1::Job.new - grpc_operation = GRPC::ActiveCall::Operation.new nil - grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - grpc_options = {} - - # Create request parameters for a unary method. - job = {} - update_mask = {} - - update_job_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :update_job, name - assert_kind_of ::Google::Cloud::Scheduler::V1::UpdateJobRequest, request - assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::Scheduler::V1::Job), request["job"] - assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Protobuf::FieldMask), request["update_mask"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, update_job_client_stub do - # Create client - client = ::Google::Cloud::Scheduler::V1::CloudScheduler::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.update_job({ job: job, update_mask: update_mask }) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use named arguments - client.update_job job: job, update_mask: update_mask do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object - client.update_job ::Google::Cloud::Scheduler::V1::UpdateJobRequest.new(job: job, update_mask: update_mask) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use hash object with options - client.update_job({ job: job, update_mask: update_mask }, grpc_options) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object with options - client.update_job(::Google::Cloud::Scheduler::V1::UpdateJobRequest.new(job: job, update_mask: update_mask), grpc_options) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Verify method calls - assert_equal 5, update_job_client_stub.call_rpc_count - end - end - - def test_delete_job - # 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_job_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :delete_job, name - assert_kind_of ::Google::Cloud::Scheduler::V1::DeleteJobRequest, request - assert_equal "hello world", request["name"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, delete_job_client_stub do - # Create client - client = ::Google::Cloud::Scheduler::V1::CloudScheduler::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.delete_job({ name: name }) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use named arguments - client.delete_job name: name do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object - client.delete_job ::Google::Cloud::Scheduler::V1::DeleteJobRequest.new(name: name) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use hash object with options - client.delete_job({ name: name }, grpc_options) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object with options - client.delete_job(::Google::Cloud::Scheduler::V1::DeleteJobRequest.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_job_client_stub.call_rpc_count - end - end - - def test_pause_job - # Create GRPC objects. - grpc_response = ::Google::Cloud::Scheduler::V1::Job.new - grpc_operation = GRPC::ActiveCall::Operation.new nil - grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - grpc_options = {} - - # Create request parameters for a unary method. - name = "hello world" - - pause_job_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :pause_job, name - assert_kind_of ::Google::Cloud::Scheduler::V1::PauseJobRequest, request - assert_equal "hello world", request["name"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, pause_job_client_stub do - # Create client - client = ::Google::Cloud::Scheduler::V1::CloudScheduler::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.pause_job({ name: name }) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use named arguments - client.pause_job name: name do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object - client.pause_job ::Google::Cloud::Scheduler::V1::PauseJobRequest.new(name: name) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use hash object with options - client.pause_job({ name: name }, grpc_options) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object with options - client.pause_job(::Google::Cloud::Scheduler::V1::PauseJobRequest.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, pause_job_client_stub.call_rpc_count - end - end - - def test_resume_job - # Create GRPC objects. - grpc_response = ::Google::Cloud::Scheduler::V1::Job.new - grpc_operation = GRPC::ActiveCall::Operation.new nil - grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - grpc_options = {} - - # Create request parameters for a unary method. - name = "hello world" - - resume_job_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :resume_job, name - assert_kind_of ::Google::Cloud::Scheduler::V1::ResumeJobRequest, request - assert_equal "hello world", request["name"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, resume_job_client_stub do - # Create client - client = ::Google::Cloud::Scheduler::V1::CloudScheduler::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.resume_job({ name: name }) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use named arguments - client.resume_job name: name do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object - client.resume_job ::Google::Cloud::Scheduler::V1::ResumeJobRequest.new(name: name) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use hash object with options - client.resume_job({ name: name }, grpc_options) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object with options - client.resume_job(::Google::Cloud::Scheduler::V1::ResumeJobRequest.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, resume_job_client_stub.call_rpc_count - end - end - - def test_run_job - # Create GRPC objects. - grpc_response = ::Google::Cloud::Scheduler::V1::Job.new - grpc_operation = GRPC::ActiveCall::Operation.new nil - grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - grpc_options = {} - - # Create request parameters for a unary method. - name = "hello world" - - run_job_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :run_job, name - assert_kind_of ::Google::Cloud::Scheduler::V1::RunJobRequest, request - assert_equal "hello world", request["name"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, run_job_client_stub do - # Create client - client = ::Google::Cloud::Scheduler::V1::CloudScheduler::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.run_job({ name: name }) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use named arguments - client.run_job name: name do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object - client.run_job ::Google::Cloud::Scheduler::V1::RunJobRequest.new(name: name) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use hash object with options - client.run_job({ name: name }, grpc_options) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object with options - client.run_job(::Google::Cloud::Scheduler::V1::RunJobRequest.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, run_job_client_stub.call_rpc_count - end - end - - def test_configure - grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - - client = block_config = config = nil - dummy_stub = ClientStub.new nil, nil - Gapic::ServiceStub.stub :new, dummy_stub do - client = ::Google::Cloud::Scheduler::V1::CloudScheduler::Client.new do |config| - config.credentials = grpc_channel - end - end - - config = client.configure do |c| - block_config = c - end - - assert_same block_config, config - assert_kind_of ::Google::Cloud::Scheduler::V1::CloudScheduler::Client::Configuration, config - end - - def test_credentials - key = OpenSSL::PKey::RSA.new 2048 - cred_json = { - "private_key" => key.to_pem, - "client_email" => "app@developer.gserviceaccount.com", - "type" => "service_account" - } - key_file = StringIO.new cred_json.to_json - creds = Google::Auth::ServiceAccountCredentials.make_creds({ json_key_io: key_file }) - - dummy_stub = ClientStub.new nil, nil - Gapic::ServiceStub.stub :new, dummy_stub do - client = ::Google::Cloud::Scheduler::V1::CloudScheduler::Client.new do |config| - config.credentials = creds - end - assert_kind_of ::Google::Cloud::Scheduler::V1::CloudScheduler::Client, client - assert_equal creds, client.configure.credentials - end - end -end diff --git a/owl-bot-staging/google-cloud-scheduler-v1/test/helper.rb b/owl-bot-staging/google-cloud-scheduler-v1/test/helper.rb deleted file mode 100644 index 672b337030e7..000000000000 --- a/owl-bot-staging/google-cloud-scheduler-v1/test/helper.rb +++ /dev/null @@ -1,26 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -require "minitest/autorun" -require "minitest/focus" -require "minitest/mock" -require "minitest/rg" - -require "grpc" - -require "ostruct" diff --git a/owl-bot-staging/google-cloud-scheduler-v1beta1/.gitignore b/owl-bot-staging/google-cloud-scheduler-v1beta1/.gitignore deleted file mode 100644 index 0135b6bc6cfc..000000000000 --- a/owl-bot-staging/google-cloud-scheduler-v1beta1/.gitignore +++ /dev/null @@ -1,22 +0,0 @@ -# Ignore bundler lockfiles -Gemfile.lock -gems.locked - -# Ignore documentation output -doc/* -.yardoc/* - -# Ignore test output -coverage/* - -# Ignore build artifacts -pkg/* - -# Ignore files commonly present in certain dev environments -.vagrant -.DS_STORE -.idea -*.iml - -# Ignore synth output -__pycache__ diff --git a/owl-bot-staging/google-cloud-scheduler-v1beta1/.repo-metadata.json b/owl-bot-staging/google-cloud-scheduler-v1beta1/.repo-metadata.json deleted file mode 100644 index f3f5f9efcb7f..000000000000 --- a/owl-bot-staging/google-cloud-scheduler-v1beta1/.repo-metadata.json +++ /dev/null @@ -1,18 +0,0 @@ -{ - "api_id": "cloudscheduler.googleapis.com", - "api_shortname": "cloudscheduler", - "client_documentation": "https://cloud.google.com/ruby/docs/reference/google-cloud-scheduler-v1beta1/latest", - "distribution_name": "google-cloud-scheduler-v1beta1", - "is_cloud": true, - "language": "ruby", - "name": "cloudscheduler", - "name_pretty": "Cloud Scheduler V1beta1 API", - "product_documentation": "https://cloud.google.com/scheduler", - "release_level": "unreleased", - "repo": "googleapis/google-cloud-ruby", - "requires_billing": true, - "ruby-cloud-description": "Cloud Scheduler is a fully managed enterprise-grade cron job scheduler. It allows you to schedule virtually any job, including batch, big data jobs, cloud infrastructure operations, and more. You can automate everything, including retries in case of failure to reduce manual toil and intervention. Cloud Scheduler even acts as a single pane of glass, allowing you to manage all your automation tasks from one place. Note that google-cloud-scheduler-v1beta1 is a version-specific client library. For most uses, we recommend installing the main client library google-cloud-scheduler instead. See the readme for more details.", - "ruby-cloud-env-prefix": "SCHEDULER", - "ruby-cloud-product-url": "https://cloud.google.com/scheduler", - "library_type": "GAPIC_AUTO" -} diff --git a/owl-bot-staging/google-cloud-scheduler-v1beta1/.rubocop.yml b/owl-bot-staging/google-cloud-scheduler-v1beta1/.rubocop.yml deleted file mode 100644 index ea48b9fe0f26..000000000000 --- a/owl-bot-staging/google-cloud-scheduler-v1beta1/.rubocop.yml +++ /dev/null @@ -1,33 +0,0 @@ -inherit_gem: - google-style: google-style.yml - -AllCops: - Exclude: - - "google-cloud-scheduler-v1beta1.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-scheduler-v1beta1.rb" diff --git a/owl-bot-staging/google-cloud-scheduler-v1beta1/.toys.rb b/owl-bot-staging/google-cloud-scheduler-v1beta1/.toys.rb deleted file mode 100644 index 177e22456e8a..000000000000 --- a/owl-bot-staging/google-cloud-scheduler-v1beta1/.toys.rb +++ /dev/null @@ -1,28 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -toys_version! ">= 0.15.3" - -if ENV["RUBY_COMMON_TOOLS"] - common_tools_dir = File.expand_path ENV["RUBY_COMMON_TOOLS"] - load File.join(common_tools_dir, "toys", "gapic") -else - load_git remote: "https://github.com/googleapis/ruby-common-tools.git", - path: "toys/gapic", - update: true -end diff --git a/owl-bot-staging/google-cloud-scheduler-v1beta1/.yardopts b/owl-bot-staging/google-cloud-scheduler-v1beta1/.yardopts deleted file mode 100644 index 68204fd650cb..000000000000 --- a/owl-bot-staging/google-cloud-scheduler-v1beta1/.yardopts +++ /dev/null @@ -1,12 +0,0 @@ ---no-private ---title="Cloud Scheduler V1beta1 API" ---exclude _pb\.rb$ ---markup markdown ---markup-provider redcarpet - -./lib/**/*.rb -./proto_docs/**/*.rb -- -README.md -LICENSE.md -AUTHENTICATION.md diff --git a/owl-bot-staging/google-cloud-scheduler-v1beta1/AUTHENTICATION.md b/owl-bot-staging/google-cloud-scheduler-v1beta1/AUTHENTICATION.md deleted file mode 100644 index 79ce23be1f05..000000000000 --- a/owl-bot-staging/google-cloud-scheduler-v1beta1/AUTHENTICATION.md +++ /dev/null @@ -1,122 +0,0 @@ -# Authentication - -The recommended way to authenticate to the google-cloud-scheduler-v1beta1 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-scheduler-v1beta1 library provides several mechanisms to configure your system. -Generally, using Application Default Credentials to facilitate automatic -credentials discovery is the easist method. But if you need to explicitly specify -credentials, there are several methods available to you. - -Credentials are accepted in the following ways, in the following order or precedence: - -1. Credentials specified in method arguments -2. Credentials specified in configuration -3. Credentials pointed to or included in environment variables -4. Credentials found in local ADC file -5. Credentials returned by the metadata server for the attached service account (GCP) - -### Configuration - -You can configure a path to a JSON credentials file, either for an individual client object or -globally, for all client objects. The JSON file can contain credentials created for -[workload identity federation](https://cloud.google.com/iam/docs/workload-identity-federation), -[workforce identity federation](https://cloud.google.com/iam/docs/workforce-identity-federation), or a -[service account key](https://cloud.google.com/docs/authentication/provide-credentials-adc#local-key). - -Note: Service account keys are a security risk if not managed correctly. You should -[choose a more secure alternative to service account keys](https://cloud.google.com/docs/authentication#auth-decision-tree) -whenever possible. - -To configure a credentials file for an individual client initialization: - -```ruby -require "google/cloud/scheduler/v1beta1" - -client = ::Google::Cloud::Scheduler::V1beta1::CloudScheduler::Client.new do |config| - config.credentials = "path/to/credentialfile.json" -end -``` - -To configure a credentials file globally for all clients: - -```ruby -require "google/cloud/scheduler/v1beta1" - -::Google::Cloud::Scheduler::V1beta1::CloudScheduler::Client.configure do |config| - config.credentials = "path/to/credentialfile.json" -end - -client = ::Google::Cloud::Scheduler::V1beta1::CloudScheduler::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-scheduler-v1beta1 -checks for credentials are: - -* `GOOGLE_CLOUD_CREDENTIALS` - Path to JSON file, or JSON contents -* `GOOGLE_APPLICATION_CREDENTIALS` - Path to JSON file - -```ruby -require "google/cloud/scheduler/v1beta1" - -ENV["GOOGLE_APPLICATION_CREDENTIALS"] = "path/to/credentialfile.json" - -client = ::Google::Cloud::Scheduler::V1beta1::CloudScheduler::Client.new -``` - -### Local ADC file - -You can set up a local ADC file with your user credentials for authentication during -development. If credentials are not provided in code or in environment variables, -then the local ADC credentials are discovered. - -Follow the steps in [Quickstart](#quickstart) to set up a local ADC file. - -### Google Cloud Platform environments - -When running on Google Cloud Platform (GCP), including Google Compute Engine -(GCE), Google Kubernetes Engine (GKE), Google App Engine (GAE), Google Cloud -Functions (GCF) and Cloud Run, credentials are retrieved from the attached -service account automatically. Code should be written as if already authenticated. - -For more information, see -[Set up ADC for Google Cloud services](https://cloud.google.com/docs/authentication/provide-credentials-adc#attached-sa). diff --git a/owl-bot-staging/google-cloud-scheduler-v1beta1/CHANGELOG.md b/owl-bot-staging/google-cloud-scheduler-v1beta1/CHANGELOG.md deleted file mode 100644 index f88957a62ba2..000000000000 --- a/owl-bot-staging/google-cloud-scheduler-v1beta1/CHANGELOG.md +++ /dev/null @@ -1,2 +0,0 @@ -# Release History - diff --git a/owl-bot-staging/google-cloud-scheduler-v1beta1/Gemfile b/owl-bot-staging/google-cloud-scheduler-v1beta1/Gemfile deleted file mode 100644 index 1d08558908d8..000000000000 --- a/owl-bot-staging/google-cloud-scheduler-v1beta1/Gemfile +++ /dev/null @@ -1,14 +0,0 @@ -source "https://rubygems.org" - -gemspec - -gem "google-style", "~> 1.32.0" -gem "irb", "~> 1.17" -gem "minitest", "~> 6.0.2" -gem "minitest-focus", "~> 1.4" -gem "minitest-mock", "~> 5.27" -gem "minitest-rg", "~> 5.3" -gem "ostruct", "~> 0.5.5" -gem "rake", ">= 13.0" -gem "redcarpet", "~> 3.6" -gem "yard", "~> 0.9" diff --git a/owl-bot-staging/google-cloud-scheduler-v1beta1/LICENSE.md b/owl-bot-staging/google-cloud-scheduler-v1beta1/LICENSE.md deleted file mode 100644 index c261857ba6ad..000000000000 --- a/owl-bot-staging/google-cloud-scheduler-v1beta1/LICENSE.md +++ /dev/null @@ -1,201 +0,0 @@ - Apache License - Version 2.0, January 2004 - http://www.apache.org/licenses/ - - TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION - - 1. Definitions. - - "License" shall mean the terms and conditions for use, reproduction, - and distribution as defined by Sections 1 through 9 of this document. - - "Licensor" shall mean the copyright owner or entity authorized by - the copyright owner that is granting the License. - - "Legal Entity" shall mean the union of the acting entity and all - other entities that control, are controlled by, or are under common - control with that entity. For the purposes of this definition, - "control" means (i) the power, direct or indirect, to cause the - direction or management of such entity, whether by contract or - otherwise, or (ii) ownership of fifty percent (50%) or more of the - outstanding shares, or (iii) beneficial ownership of such entity. - - "You" (or "Your") shall mean an individual or Legal Entity - exercising permissions granted by this License. - - "Source" form shall mean the preferred form for making modifications, - including but not limited to software source code, documentation - source, and configuration files. - - "Object" form shall mean any form resulting from mechanical - transformation or translation of a Source form, including but - not limited to compiled object code, generated documentation, - and conversions to other media types. - - "Work" shall mean the work of authorship, whether in Source or - Object form, made available under the License, as indicated by a - copyright notice that is included in or attached to the work - (an example is provided in the Appendix below). - - "Derivative Works" shall mean any work, whether in Source or Object - form, that is based on (or derived from) the Work and for which the - editorial revisions, annotations, elaborations, or other modifications - represent, as a whole, an original work of authorship. For the purposes - of this License, Derivative Works shall not include works that remain - separable from, or merely link (or bind by name) to the interfaces of, - the Work and Derivative Works thereof. - - "Contribution" shall mean any work of authorship, including - the original version of the Work and any modifications or additions - to that Work or Derivative Works thereof, that is intentionally - submitted to Licensor for inclusion in the Work by the copyright owner - or by an individual or Legal Entity authorized to submit on behalf of - the copyright owner. For the purposes of this definition, "submitted" - means any form of electronic, verbal, or written communication sent - to the Licensor or its representatives, including but not limited to - communication on electronic mailing lists, source code control systems, - and issue tracking systems that are managed by, or on behalf of, the - Licensor for the purpose of discussing and improving the Work, but - excluding communication that is conspicuously marked or otherwise - designated in writing by the copyright owner as "Not a Contribution." - - "Contributor" shall mean Licensor and any individual or Legal Entity - on behalf of whom a Contribution has been received by Licensor and - subsequently incorporated within the Work. - - 2. Grant of Copyright License. Subject to the terms and conditions of - this License, each Contributor hereby grants to You a perpetual, - worldwide, non-exclusive, no-charge, royalty-free, irrevocable - copyright license to reproduce, prepare Derivative Works of, - publicly display, publicly perform, sublicense, and distribute the - Work and such Derivative Works in Source or Object form. - - 3. Grant of Patent License. Subject to the terms and conditions of - this License, each Contributor hereby grants to You a perpetual, - worldwide, non-exclusive, no-charge, royalty-free, irrevocable - (except as stated in this section) patent license to make, have made, - use, offer to sell, sell, import, and otherwise transfer the Work, - where such license applies only to those patent claims licensable - by such Contributor that are necessarily infringed by their - Contribution(s) alone or by combination of their Contribution(s) - with the Work to which such Contribution(s) was submitted. If You - institute patent litigation against any entity (including a - cross-claim or counterclaim in a lawsuit) alleging that the Work - or a Contribution incorporated within the Work constitutes direct - or contributory patent infringement, then any patent licenses - granted to You under this License for that Work shall terminate - as of the date such litigation is filed. - - 4. Redistribution. You may reproduce and distribute copies of the - Work or Derivative Works thereof in any medium, with or without - modifications, and in Source or Object form, provided that You - meet the following conditions: - - (a) You must give any other recipients of the Work or - Derivative Works a copy of this License; and - - (b) You must cause any modified files to carry prominent notices - stating that You changed the files; and - - (c) You must retain, in the Source form of any Derivative Works - that You distribute, all copyright, patent, trademark, and - attribution notices from the Source form of the Work, - excluding those notices that do not pertain to any part of - the Derivative Works; and - - (d) If the Work includes a "NOTICE" text file as part of its - distribution, then any Derivative Works that You distribute must - include a readable copy of the attribution notices contained - within such NOTICE file, excluding those notices that do not - pertain to any part of the Derivative Works, in at least one - of the following places: within a NOTICE text file distributed - as part of the Derivative Works; within the Source form or - documentation, if provided along with the Derivative Works; or, - within a display generated by the Derivative Works, if and - wherever such third-party notices normally appear. The contents - of the NOTICE file are for informational purposes only and - do not modify the License. You may add Your own attribution - notices within Derivative Works that You distribute, alongside - or as an addendum to the NOTICE text from the Work, provided - that such additional attribution notices cannot be construed - as modifying the License. - - You may add Your own copyright statement to Your modifications and - may provide additional or different license terms and conditions - for use, reproduction, or distribution of Your modifications, or - for any such Derivative Works as a whole, provided Your use, - reproduction, and distribution of the Work otherwise complies with - the conditions stated in this License. - - 5. Submission of Contributions. Unless You explicitly state otherwise, - any Contribution intentionally submitted for inclusion in the Work - by You to the Licensor shall be under the terms and conditions of - this License, without any additional terms or conditions. - Notwithstanding the above, nothing herein shall supersede or modify - the terms of any separate license agreement you may have executed - with Licensor regarding such Contributions. - - 6. Trademarks. This License does not grant permission to use the trade - names, trademarks, service marks, or product names of the Licensor, - except as required for reasonable and customary use in describing the - origin of the Work and reproducing the content of the NOTICE file. - - 7. Disclaimer of Warranty. Unless required by applicable law or - agreed to in writing, Licensor provides the Work (and each - Contributor provides its Contributions) on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or - implied, including, without limitation, any warranties or conditions - of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A - PARTICULAR PURPOSE. You are solely responsible for determining the - appropriateness of using or redistributing the Work and assume any - risks associated with Your exercise of permissions under this License. - - 8. Limitation of Liability. In no event and under no legal theory, - whether in tort (including negligence), contract, or otherwise, - unless required by applicable law (such as deliberate and grossly - negligent acts) or agreed to in writing, shall any Contributor be - liable to You for damages, including any direct, indirect, special, - incidental, or consequential damages of any character arising as a - result of this License or out of the use or inability to use the - Work (including but not limited to damages for loss of goodwill, - work stoppage, computer failure or malfunction, or any and all - other commercial damages or losses), even if such Contributor - has been advised of the possibility of such damages. - - 9. Accepting Warranty or Additional Liability. While redistributing - the Work or Derivative Works thereof, You may choose to offer, - and charge a fee for, acceptance of support, warranty, indemnity, - or other liability obligations and/or rights consistent with this - License. However, in accepting such obligations, You may act only - on Your own behalf and on Your sole responsibility, not on behalf - of any other Contributor, and only if You agree to indemnify, - defend, and hold each Contributor harmless for any liability - incurred by, or claims asserted against, such Contributor by reason - of your accepting any such warranty or additional liability. - - END OF TERMS AND CONDITIONS - - APPENDIX: How to apply the Apache License to your work. - - To apply the Apache License to your work, attach the following - boilerplate notice, with the fields enclosed by brackets "[]" - replaced with your own identifying information. (Don't include - the brackets!) The text should be enclosed in the appropriate - comment syntax for the file format. We also recommend that a - file or class name and description of purpose be included on the - same "printed page" as the copyright notice for easier - identification within third-party archives. - - Copyright [yyyy] [name of copyright owner] - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. diff --git a/owl-bot-staging/google-cloud-scheduler-v1beta1/README.md b/owl-bot-staging/google-cloud-scheduler-v1beta1/README.md deleted file mode 100644 index 547e97f8de13..000000000000 --- a/owl-bot-staging/google-cloud-scheduler-v1beta1/README.md +++ /dev/null @@ -1,154 +0,0 @@ -# Ruby Client for the Cloud Scheduler V1beta1 API - -Creates and manages jobs run on a regular recurring schedule. - -Cloud Scheduler is a fully managed enterprise-grade cron job scheduler. It allows you to schedule virtually any job, including batch, big data jobs, cloud infrastructure operations, and more. You can automate everything, including retries in case of failure to reduce manual toil and intervention. Cloud Scheduler even acts as a single pane of glass, allowing you to manage all your automation tasks from one place. - -https://github.com/googleapis/google-cloud-ruby - -This gem is a _versioned_ client. It provides basic client classes for a -specific version of the Cloud Scheduler V1beta1 API. Most users should consider using -the main client gem, -[google-cloud-scheduler](https://rubygems.org/gems/google-cloud-scheduler). -See the section below titled *Which client should I use?* for more information. - -## Installation - -``` -$ gem install google-cloud-scheduler-v1beta1 -``` - -## 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/cloudscheduler.googleapis.com) -1. [Set up authentication.](AUTHENTICATION.md) - -## Quick Start - -```ruby -require "google/cloud/scheduler/v1beta1" - -client = ::Google::Cloud::Scheduler::V1beta1::CloudScheduler::Client.new -request = ::Google::Cloud::Scheduler::V1beta1::ListJobsRequest.new # (request fields as keyword arguments...) -response = client.list_jobs request -``` - -View the [Client Library Documentation](https://cloud.google.com/ruby/docs/reference/google-cloud-scheduler-v1beta1/latest) -for class and method documentation. - -See also the [Product Documentation](https://cloud.google.com/scheduler) -for general usage information. - -## Debug Logging - -This library comes with opt-in Debug Logging that can help you troubleshoot -your application's integration with the API. When logging is activated, key -events such as requests and responses, along with data payloads and metadata -such as headers and client configuration, are logged to the standard error -stream. - -**WARNING:** Client Library Debug Logging includes your data payloads in -plaintext, which could include sensitive data such as PII for yourself or your -customers, private keys, or other security data that could be compromising if -leaked. Always practice good data hygiene with your application logs, and follow -the principle of least access. Google also recommends that Client Library Debug -Logging be enabled only temporarily during active debugging, and not used -permanently in production. - -To enable logging, set the environment variable `GOOGLE_SDK_RUBY_LOGGING_GEMS` -to the value `all`. Alternatively, you can set the value to a comma-delimited -list of client library gem names. This will select the default logging behavior, -which writes logs to the standard error stream. On a local workstation, this may -result in logs appearing on the console. When running on a Google Cloud hosting -service such as [Google Cloud Run](https://cloud.google.com/run), this generally -results in logs appearing alongside your application logs in the -[Google Cloud Logging](https://cloud.google.com/logging/) service. - -You can customize logging by modifying the `logger` configuration when -constructing a client object. For example: - -```ruby -require "google/cloud/scheduler/v1beta1" -require "logger" - -client = ::Google::Cloud::Scheduler::V1beta1::CloudScheduler::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-scheduler`, -and lower-level _versioned_ client libraries with names such as -`google-cloud-scheduler-v1beta1`. -_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-scheduler`. -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-scheduler-v1beta1`. - -### What about the google-apis- clients? - -Client library gems with names that begin with `google-apis-` are based on an -older code generation technology. They talk to a REST/JSON backend (whereas -most modern clients talk to a [gRPC](https://grpc.io/) backend) and they may -not offer the same performance, features, and ease of use provided by more -modern clients. - -The `google-apis-` clients have wide coverage across Google services, so you -might need to use one if there is no modern client available for the service. -However, if a modern client is available, we generally recommend it over the -older `google-apis-` clients. diff --git a/owl-bot-staging/google-cloud-scheduler-v1beta1/Rakefile b/owl-bot-staging/google-cloud-scheduler-v1beta1/Rakefile deleted file mode 100644 index 1b73f3167c83..000000000000 --- a/owl-bot-staging/google-cloud-scheduler-v1beta1/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-scheduler-v1beta1 acceptance tests." -task :acceptance, :project, :keyfile do |t, args| - project = args[:project] - project ||= - ENV["SCHEDULER_TEST_PROJECT"] || - ENV["GCLOUD_TEST_PROJECT"] - keyfile = args[:keyfile] - keyfile ||= - ENV["SCHEDULER_TEST_KEYFILE"] || - ENV["GCLOUD_TEST_KEYFILE"] - if keyfile - keyfile = File.read keyfile - else - keyfile ||= - ENV["SCHEDULER_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 SCHEDULER_TEST_PROJECT=test123 SCHEDULER_TEST_KEYFILE=/path/to/keyfile.json rake acceptance" - end - require "google/cloud/scheduler/v1beta1/cloud_scheduler/credentials" - ::Google::Cloud::Scheduler::V1beta1::CloudScheduler::Credentials.env_vars.each do |path| - ENV[path] = nil - end - ENV["SCHEDULER_PROJECT"] = project - ENV["SCHEDULER_TEST_PROJECT"] = project - ENV["SCHEDULER_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-scheduler-v1beta1 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-scheduler-v1beta1 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-scheduler-v1beta1 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-scheduler-v1beta1 gem does not have doctest tests." -end - -desc "Run the CI build" -task :ci do - header "BUILDING google-cloud-scheduler-v1beta1" - header "google-cloud-scheduler-v1beta1 rubocop", "*" - Rake::Task[:rubocop].invoke - header "google-cloud-scheduler-v1beta1 yard", "*" - Rake::Task[:yard].invoke - header "google-cloud-scheduler-v1beta1 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-scheduler-v1beta1 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-scheduler-v1beta1 acceptance", "*" - Rake::Task[:acceptance].invoke - end - task :a do - # This is a handy shortcut to save typing - Rake::Task["ci:acceptance"].invoke - end -end - -task default: :test - -def header str, token = "#" - line_length = str.length + 8 - puts "" - puts token * line_length - puts "#{token * 3} #{str} #{token * 3}" - puts token * line_length - puts "" -end diff --git a/owl-bot-staging/google-cloud-scheduler-v1beta1/gapic_metadata.json b/owl-bot-staging/google-cloud-scheduler-v1beta1/gapic_metadata.json deleted file mode 100644 index 38068627a009..000000000000 --- a/owl-bot-staging/google-cloud-scheduler-v1beta1/gapic_metadata.json +++ /dev/null @@ -1,58 +0,0 @@ -{ - "schema": "1.0", - "comment": "This file maps proto services/RPCs to the corresponding library clients/methods", - "language": "ruby", - "protoPackage": "google.cloud.scheduler.v1beta1", - "libraryPackage": "::Google::Cloud::Scheduler::V1beta1", - "services": { - "CloudScheduler": { - "clients": { - "grpc": { - "libraryClient": "::Google::Cloud::Scheduler::V1beta1::CloudScheduler::Client", - "rpcs": { - "ListJobs": { - "methods": [ - "list_jobs" - ] - }, - "GetJob": { - "methods": [ - "get_job" - ] - }, - "CreateJob": { - "methods": [ - "create_job" - ] - }, - "UpdateJob": { - "methods": [ - "update_job" - ] - }, - "DeleteJob": { - "methods": [ - "delete_job" - ] - }, - "PauseJob": { - "methods": [ - "pause_job" - ] - }, - "ResumeJob": { - "methods": [ - "resume_job" - ] - }, - "RunJob": { - "methods": [ - "run_job" - ] - } - } - } - } - } - } -} diff --git a/owl-bot-staging/google-cloud-scheduler-v1beta1/google-cloud-scheduler-v1beta1.gemspec b/owl-bot-staging/google-cloud-scheduler-v1beta1/google-cloud-scheduler-v1beta1.gemspec deleted file mode 100644 index dfc2480a97e6..000000000000 --- a/owl-bot-staging/google-cloud-scheduler-v1beta1/google-cloud-scheduler-v1beta1.gemspec +++ /dev/null @@ -1,29 +0,0 @@ -# -*- ruby -*- -# encoding: utf-8 - -require File.expand_path("lib/google/cloud/scheduler/v1beta1/version", __dir__) - -Gem::Specification.new do |gem| - gem.name = "google-cloud-scheduler-v1beta1" - gem.version = Google::Cloud::Scheduler::V1beta1::VERSION - - gem.authors = ["Google LLC"] - gem.email = "googleapis-packages@google.com" - gem.description = "Cloud Scheduler is a fully managed enterprise-grade cron job scheduler. It allows you to schedule virtually any job, including batch, big data jobs, cloud infrastructure operations, and more. You can automate everything, including retries in case of failure to reduce manual toil and intervention. Cloud Scheduler even acts as a single pane of glass, allowing you to manage all your automation tasks from one place. Note that google-cloud-scheduler-v1beta1 is a version-specific client library. For most uses, we recommend installing the main client library google-cloud-scheduler instead. See the readme for more details." - gem.summary = "Creates and manages jobs run on a regular recurring schedule." - 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-cloud-scheduler-v1beta1/lib/google-cloud-scheduler-v1beta1.rb b/owl-bot-staging/google-cloud-scheduler-v1beta1/lib/google-cloud-scheduler-v1beta1.rb deleted file mode 100644 index 2fc8d8df7f1b..000000000000 --- a/owl-bot-staging/google-cloud-scheduler-v1beta1/lib/google-cloud-scheduler-v1beta1.rb +++ /dev/null @@ -1,21 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -# This gem does not autoload during Bundler.require. To load this gem, -# issue explicit require statements for the packages desired, e.g.: -# require "google/cloud/scheduler/v1beta1" diff --git a/owl-bot-staging/google-cloud-scheduler-v1beta1/lib/google/cloud/scheduler/v1beta1.rb b/owl-bot-staging/google-cloud-scheduler-v1beta1/lib/google/cloud/scheduler/v1beta1.rb deleted file mode 100644 index 9d6957410905..000000000000 --- a/owl-bot-staging/google-cloud-scheduler-v1beta1/lib/google/cloud/scheduler/v1beta1.rb +++ /dev/null @@ -1,45 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -require "google/cloud/scheduler/v1beta1/cloud_scheduler" -require "google/cloud/scheduler/v1beta1/version" - -module Google - module Cloud - module Scheduler - ## - # API client module. - # - # @example Load this package, including all its services, and instantiate a gRPC client - # - # require "google/cloud/scheduler/v1beta1" - # client = ::Google::Cloud::Scheduler::V1beta1::CloudScheduler::Client.new - # - # @example Load this package, including all its services, and instantiate a REST client - # - # require "google/cloud/scheduler/v1beta1" - # client = ::Google::Cloud::Scheduler::V1beta1::CloudScheduler::Rest::Client.new - # - module V1beta1 - end - end - end -end - -helper_path = ::File.join __dir__, "v1beta1", "_helpers.rb" -require "google/cloud/scheduler/v1beta1/_helpers" if ::File.file? helper_path diff --git a/owl-bot-staging/google-cloud-scheduler-v1beta1/lib/google/cloud/scheduler/v1beta1/bindings_override.rb b/owl-bot-staging/google-cloud-scheduler-v1beta1/lib/google/cloud/scheduler/v1beta1/bindings_override.rb deleted file mode 100644 index d6e1755d072e..000000000000 --- a/owl-bot-staging/google-cloud-scheduler-v1beta1/lib/google/cloud/scheduler/v1beta1/bindings_override.rb +++ /dev/null @@ -1,75 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -require "gapic/rest" - -module Google - module Cloud - module Scheduler - ## - # @example Loading just the REST part of this package, including all its services, and instantiating a REST client - # - # require "google/cloud/scheduler/v1beta1/rest" - # client = ::Google::Cloud::Scheduler::V1beta1::CloudScheduler::Rest::Client.new - # - module V1beta1 - ## - # @private - # Initialize the mixin bindings configuration - # - def self.configure - @configure ||= begin - namespace = ["Google", "Cloud", "Scheduler"] - parent_config = while namespace.any? - parent_name = namespace.join "::" - parent_const = const_get parent_name - break parent_const.configure if parent_const.respond_to? :configure - namespace.pop - end - - default_config = ::Gapic::Rest::HttpBindingOverrideConfiguration.new parent_config - default_config.bindings_override["google.cloud.location.Locations.GetLocation"] = [ - Gapic::Rest::GrpcTranscoder::HttpBinding.create_with_validation( - uri_method: :get, - uri_template: "/v1beta1/{name}", - matches: [ - ["name", %r{^projects/[^/]+/locations/[^/]+/?$}, false] - ], - body: nil - ) - ] - default_config.bindings_override["google.cloud.location.Locations.ListLocations"] = [ - - Gapic::Rest::GrpcTranscoder::HttpBinding.create_with_validation( - uri_method: :get, - uri_template: "/v1beta1/{name}/locations", - matches: [ - ["name", %r{^projects/[^/]+/?$}, false] - ], - body: nil - ) - ] - default_config - end - yield @configure if block_given? - @configure - end - end - end - end -end diff --git a/owl-bot-staging/google-cloud-scheduler-v1beta1/lib/google/cloud/scheduler/v1beta1/cloud_scheduler.rb b/owl-bot-staging/google-cloud-scheduler-v1beta1/lib/google/cloud/scheduler/v1beta1/cloud_scheduler.rb deleted file mode 100644 index 8d2939bc3884..000000000000 --- a/owl-bot-staging/google-cloud-scheduler-v1beta1/lib/google/cloud/scheduler/v1beta1/cloud_scheduler.rb +++ /dev/null @@ -1,56 +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/scheduler/v1beta1/version" - -require "google/cloud/scheduler/v1beta1/cloud_scheduler/credentials" -require "google/cloud/scheduler/v1beta1/cloud_scheduler/paths" -require "google/cloud/scheduler/v1beta1/cloud_scheduler/client" -require "google/cloud/scheduler/v1beta1/cloud_scheduler/rest" - -module Google - module Cloud - module Scheduler - module V1beta1 - ## - # The Cloud Scheduler API allows external entities to reliably - # schedule asynchronous jobs. - # - # @example Load this service and instantiate a gRPC client - # - # require "google/cloud/scheduler/v1beta1/cloud_scheduler" - # client = ::Google::Cloud::Scheduler::V1beta1::CloudScheduler::Client.new - # - # @example Load this service and instantiate a REST client - # - # require "google/cloud/scheduler/v1beta1/cloud_scheduler/rest" - # client = ::Google::Cloud::Scheduler::V1beta1::CloudScheduler::Rest::Client.new - # - module CloudScheduler - end - end - end - end -end - -helper_path = ::File.join __dir__, "cloud_scheduler", "helpers.rb" -require "google/cloud/scheduler/v1beta1/cloud_scheduler/helpers" if ::File.file? helper_path diff --git a/owl-bot-staging/google-cloud-scheduler-v1beta1/lib/google/cloud/scheduler/v1beta1/cloud_scheduler/client.rb b/owl-bot-staging/google-cloud-scheduler-v1beta1/lib/google/cloud/scheduler/v1beta1/cloud_scheduler/client.rb deleted file mode 100644 index 6640f3feecc1..000000000000 --- a/owl-bot-staging/google-cloud-scheduler-v1beta1/lib/google/cloud/scheduler/v1beta1/cloud_scheduler/client.rb +++ /dev/null @@ -1,1263 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -require "google/cloud/errors" -require "google/cloud/scheduler/v1beta1/cloudscheduler_pb" -require "google/cloud/location" - -module Google - module Cloud - module Scheduler - module V1beta1 - module CloudScheduler - ## - # Client for the CloudScheduler service. - # - # The Cloud Scheduler API allows external entities to reliably - # schedule asynchronous jobs. - # - class Client - # @private - API_VERSION = "" - - # @private - DEFAULT_ENDPOINT_TEMPLATE = "cloudscheduler.$UNIVERSE_DOMAIN$" - - include Paths - - # @private - attr_reader :cloud_scheduler_stub - - ## - # Configure the CloudScheduler Client class. - # - # See {::Google::Cloud::Scheduler::V1beta1::CloudScheduler::Client::Configuration} - # for a description of the configuration fields. - # - # @example - # - # # Modify the configuration for all CloudScheduler clients - # ::Google::Cloud::Scheduler::V1beta1::CloudScheduler::Client.configure do |config| - # config.timeout = 10.0 - # end - # - # @yield [config] Configure the Client client. - # @yieldparam config [Client::Configuration] - # - # @return [Client::Configuration] - # - def self.configure - @configure ||= begin - namespace = ["Google", "Cloud", "Scheduler", "V1beta1"] - parent_config = while namespace.any? - parent_name = namespace.join "::" - parent_const = const_get parent_name - break parent_const.configure if parent_const.respond_to? :configure - namespace.pop - end - default_config = Client::Configuration.new parent_config - - default_config.rpcs.list_jobs.timeout = 600.0 - default_config.rpcs.list_jobs.retry_policy = { - initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [4, 14] - } - - default_config.rpcs.get_job.timeout = 600.0 - default_config.rpcs.get_job.retry_policy = { - initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [4, 14] - } - - default_config.rpcs.create_job.timeout = 600.0 - - default_config.rpcs.update_job.timeout = 600.0 - - default_config.rpcs.delete_job.timeout = 600.0 - default_config.rpcs.delete_job.retry_policy = { - initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [4, 14] - } - - default_config.rpcs.pause_job.timeout = 600.0 - default_config.rpcs.pause_job.retry_policy = { - initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [4, 14] - } - - default_config.rpcs.resume_job.timeout = 600.0 - default_config.rpcs.resume_job.retry_policy = { - initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [4, 14] - } - - default_config.rpcs.run_job.timeout = 600.0 - - default_config - end - yield @configure if block_given? - @configure - end - - ## - # Configure the CloudScheduler Client instance. - # - # The configuration is set to the derived mode, meaning that values can be changed, - # but structural changes (adding new fields, etc.) are not allowed. Structural changes - # should be made on {Client.configure}. - # - # See {::Google::Cloud::Scheduler::V1beta1::CloudScheduler::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 - @cloud_scheduler_stub.universe_domain - end - - ## - # Create a new CloudScheduler client object. - # - # @example - # - # # Create a client using the default configuration - # client = ::Google::Cloud::Scheduler::V1beta1::CloudScheduler::Client.new - # - # # Create a client using a custom configuration - # client = ::Google::Cloud::Scheduler::V1beta1::CloudScheduler::Client.new do |config| - # config.timeout = 10.0 - # end - # - # @yield [config] Configure the CloudScheduler client. - # @yieldparam config [Client::Configuration] - # - def initialize - # These require statements are intentionally placed here to initialize - # the gRPC module only when it's required. - # See https://github.com/googleapis/toolkit/issues/446 - require "gapic/grpc" - require "google/cloud/scheduler/v1beta1/cloudscheduler_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 - - @cloud_scheduler_stub = ::Gapic::ServiceStub.new( - ::Google::Cloud::Scheduler::V1beta1::CloudScheduler::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 - ) - - @cloud_scheduler_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 = @cloud_scheduler_stub.endpoint - config.universe_domain = @cloud_scheduler_stub.universe_domain - config.logger = @cloud_scheduler_stub.logger if config.respond_to? :logger= - end - end - - ## - # Get the associated client for mix-in of the Locations. - # - # @return [Google::Cloud::Location::Locations::Client] - # - attr_reader :location_client - - ## - # The logger used for request/response debug logging. - # - # @return [Logger] - # - def logger - @cloud_scheduler_stub.logger - end - - # Service calls - - ## - # Lists jobs. - # - # @overload list_jobs(request, options = nil) - # Pass arguments to `list_jobs` via a request object, either of type - # {::Google::Cloud::Scheduler::V1beta1::ListJobsRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Scheduler::V1beta1::ListJobsRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. - # - # @overload list_jobs(parent: nil, filter: nil, page_size: nil, page_token: nil, legacy_app_engine_cron: nil) - # Pass arguments to `list_jobs` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param parent [::String] - # Required. The location name. For example: - # `projects/PROJECT_ID/locations/LOCATION_ID`. - # @param filter [::String] - # `filter` can be used to specify a subset of jobs. - # - # If `filter` equals `target_config="HttpConfig"`, then the http - # target jobs are retrieved. If `filter` equals - # `target_config="PubSubConfig"`, then the Pub/Sub target jobs are - # retrieved. If `filter` equals `labels.foo=value1 - # labels.foo=value2` then only jobs which are labeled with - # foo=value1 AND foo=value2 will be returned. - # @param page_size [::Integer] - # Requested page size. - # - # The maximum page size is 500. If unspecified, the page size will - # be the maximum. Fewer jobs than requested might be returned, - # even if more jobs exist; use next_page_token to determine if more - # jobs exist. - # @param page_token [::String] - # A token identifying a page of results the server will return. To - # request the first page results, page_token must be empty. To - # request the next page of results, page_token must be the value of - # {::Google::Cloud::Scheduler::V1beta1::ListJobsResponse#next_page_token next_page_token} - # returned from the previous call to - # {::Google::Cloud::Scheduler::V1beta1::CloudScheduler::Client#list_jobs ListJobs}. It is - # an error to switch the value of - # {::Google::Cloud::Scheduler::V1beta1::ListJobsRequest#filter filter} or - # [order_by][google.cloud.scheduler.v1beta1.ListJobsRequest.order_by] while - # iterating through pages. - # @param legacy_app_engine_cron [::Boolean] - # This field is used to manage the legacy App Engine Cron jobs using the - # Cloud Scheduler API. If the field is set to true, the jobs in the __cron - # queue will be listed instead. - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Gapic::PagedEnumerable<::Google::Cloud::Scheduler::V1beta1::Job>] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Gapic::PagedEnumerable<::Google::Cloud::Scheduler::V1beta1::Job>] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/cloud/scheduler/v1beta1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Scheduler::V1beta1::CloudScheduler::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Scheduler::V1beta1::ListJobsRequest.new - # - # # Call the list_jobs method. - # result = client.list_jobs request - # - # # The returned object is of type Gapic::PagedEnumerable. You can iterate - # # over elements, and API calls will be issued to fetch pages as needed. - # result.each do |item| - # # Each element is of type ::Google::Cloud::Scheduler::V1beta1::Job. - # p item - # end - # - def list_jobs request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Scheduler::V1beta1::ListJobsRequest - - # Converts hash and nil to an options object - options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h - - # Customize the options with defaults - metadata = @config.rpcs.list_jobs.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::Scheduler::V1beta1::VERSION - metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - header_params = {} - if request.parent - header_params["parent"] = request.parent - end - - request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") - metadata[:"x-goog-request-params"] ||= request_params_header - - options.apply_defaults timeout: @config.rpcs.list_jobs.timeout, - metadata: metadata, - retry_policy: @config.rpcs.list_jobs.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @cloud_scheduler_stub.call_rpc :list_jobs, request, options: options do |response, operation| - response = ::Gapic::PagedEnumerable.new @cloud_scheduler_stub, :list_jobs, request, response, operation, options - yield response, operation if block_given? - throw :response, response - end - rescue ::GRPC::BadStatus => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Gets a job. - # - # @overload get_job(request, options = nil) - # Pass arguments to `get_job` via a request object, either of type - # {::Google::Cloud::Scheduler::V1beta1::GetJobRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Scheduler::V1beta1::GetJobRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. - # - # @overload get_job(name: nil) - # Pass arguments to `get_job` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param name [::String] - # Required. The job name. For example: - # `projects/PROJECT_ID/locations/LOCATION_ID/jobs/JOB_ID`. - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Google::Cloud::Scheduler::V1beta1::Job] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Google::Cloud::Scheduler::V1beta1::Job] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/cloud/scheduler/v1beta1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Scheduler::V1beta1::CloudScheduler::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Scheduler::V1beta1::GetJobRequest.new - # - # # Call the get_job method. - # result = client.get_job request - # - # # The returned object is of type Google::Cloud::Scheduler::V1beta1::Job. - # p result - # - def get_job request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Scheduler::V1beta1::GetJobRequest - - # Converts hash and nil to an options object - options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h - - # Customize the options with defaults - metadata = @config.rpcs.get_job.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::Scheduler::V1beta1::VERSION - metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - header_params = {} - if request.name - header_params["name"] = request.name - end - - request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") - metadata[:"x-goog-request-params"] ||= request_params_header - - options.apply_defaults timeout: @config.rpcs.get_job.timeout, - metadata: metadata, - retry_policy: @config.rpcs.get_job.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @cloud_scheduler_stub.call_rpc :get_job, request, options: options do |response, operation| - yield response, operation if block_given? - end - rescue ::GRPC::BadStatus => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Creates a job. - # - # @overload create_job(request, options = nil) - # Pass arguments to `create_job` via a request object, either of type - # {::Google::Cloud::Scheduler::V1beta1::CreateJobRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Scheduler::V1beta1::CreateJobRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. - # - # @overload create_job(parent: nil, job: nil) - # Pass arguments to `create_job` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param parent [::String] - # Required. The location name. For example: - # `projects/PROJECT_ID/locations/LOCATION_ID`. - # @param job [::Google::Cloud::Scheduler::V1beta1::Job, ::Hash] - # Required. The job to add. The user can optionally specify a name for the - # job in {::Google::Cloud::Scheduler::V1beta1::Job#name name}. - # {::Google::Cloud::Scheduler::V1beta1::Job#name name} cannot be the same as an - # existing job. If a name is not specified then the system will - # generate a random unique name that will be returned - # ({::Google::Cloud::Scheduler::V1beta1::Job#name name}) in the response. - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Google::Cloud::Scheduler::V1beta1::Job] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Google::Cloud::Scheduler::V1beta1::Job] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/cloud/scheduler/v1beta1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Scheduler::V1beta1::CloudScheduler::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Scheduler::V1beta1::CreateJobRequest.new - # - # # Call the create_job method. - # result = client.create_job request - # - # # The returned object is of type Google::Cloud::Scheduler::V1beta1::Job. - # p result - # - def create_job request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Scheduler::V1beta1::CreateJobRequest - - # Converts hash and nil to an options object - options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h - - # Customize the options with defaults - metadata = @config.rpcs.create_job.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::Scheduler::V1beta1::VERSION - metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - header_params = {} - if request.parent - header_params["parent"] = request.parent - end - - request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") - metadata[:"x-goog-request-params"] ||= request_params_header - - options.apply_defaults timeout: @config.rpcs.create_job.timeout, - metadata: metadata, - retry_policy: @config.rpcs.create_job.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @cloud_scheduler_stub.call_rpc :create_job, 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 job. - # - # If successful, the updated {::Google::Cloud::Scheduler::V1beta1::Job Job} is - # returned. If the job does not exist, `NOT_FOUND` is returned. - # - # If UpdateJob does not successfully return, it is possible for the - # job to be in an - # {::Google::Cloud::Scheduler::V1beta1::Job::State::UPDATE_FAILED Job.State.UPDATE_FAILED} - # state. A job in this state may not be executed. If this happens, retry the - # UpdateJob request until a successful response is received. - # - # @overload update_job(request, options = nil) - # Pass arguments to `update_job` via a request object, either of type - # {::Google::Cloud::Scheduler::V1beta1::UpdateJobRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Scheduler::V1beta1::UpdateJobRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_job(job: nil, update_mask: nil) - # Pass arguments to `update_job` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param job [::Google::Cloud::Scheduler::V1beta1::Job, ::Hash] - # Required. The new job properties. - # {::Google::Cloud::Scheduler::V1beta1::Job#name name} must be specified. - # - # Output only fields cannot be modified using UpdateJob. - # Any value specified for an output only field will be ignored. - # @param update_mask [::Google::Protobuf::FieldMask, ::Hash] - # A mask used to specify which fields of the job are being updated. - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Google::Cloud::Scheduler::V1beta1::Job] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Google::Cloud::Scheduler::V1beta1::Job] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/cloud/scheduler/v1beta1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Scheduler::V1beta1::CloudScheduler::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Scheduler::V1beta1::UpdateJobRequest.new - # - # # Call the update_job method. - # result = client.update_job request - # - # # The returned object is of type Google::Cloud::Scheduler::V1beta1::Job. - # p result - # - def update_job request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Scheduler::V1beta1::UpdateJobRequest - - # Converts hash 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_job.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::Scheduler::V1beta1::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.job&.name - header_params["job.name"] = request.job.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_job.timeout, - metadata: metadata, - retry_policy: @config.rpcs.update_job.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @cloud_scheduler_stub.call_rpc :update_job, request, options: options do |response, operation| - yield response, operation if block_given? - end - rescue ::GRPC::BadStatus => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Deletes a job. - # - # @overload delete_job(request, options = nil) - # Pass arguments to `delete_job` via a request object, either of type - # {::Google::Cloud::Scheduler::V1beta1::DeleteJobRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Scheduler::V1beta1::DeleteJobRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. - # - # @overload delete_job(name: nil, legacy_app_engine_cron: nil) - # Pass arguments to `delete_job` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param name [::String] - # Required. The job name. For example: - # `projects/PROJECT_ID/locations/LOCATION_ID/jobs/JOB_ID`. - # @param legacy_app_engine_cron [::Boolean] - # This field is used to manage the legacy App Engine Cron jobs using the - # Cloud Scheduler API. If the field is set to true, the job in the __cron - # queue with the corresponding name will be deleted instead. - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Google::Protobuf::Empty] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Google::Protobuf::Empty] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/cloud/scheduler/v1beta1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Scheduler::V1beta1::CloudScheduler::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Scheduler::V1beta1::DeleteJobRequest.new - # - # # Call the delete_job method. - # result = client.delete_job request - # - # # The returned object is of type Google::Protobuf::Empty. - # p result - # - def delete_job request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Scheduler::V1beta1::DeleteJobRequest - - # Converts hash and nil to an options object - options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h - - # Customize the options with defaults - metadata = @config.rpcs.delete_job.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::Scheduler::V1beta1::VERSION - metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - header_params = {} - if request.name - header_params["name"] = request.name - end - - request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") - metadata[:"x-goog-request-params"] ||= request_params_header - - options.apply_defaults timeout: @config.rpcs.delete_job.timeout, - metadata: metadata, - retry_policy: @config.rpcs.delete_job.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @cloud_scheduler_stub.call_rpc :delete_job, request, options: options do |response, operation| - yield response, operation if block_given? - end - rescue ::GRPC::BadStatus => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Pauses a job. - # - # If a job is paused then the system will stop executing the job - # until it is re-enabled via - # {::Google::Cloud::Scheduler::V1beta1::CloudScheduler::Client#resume_job ResumeJob}. The - # state of the job is stored in - # {::Google::Cloud::Scheduler::V1beta1::Job#state state}; if paused it will be set - # to {::Google::Cloud::Scheduler::V1beta1::Job::State::PAUSED Job.State.PAUSED}. A - # job must be in - # {::Google::Cloud::Scheduler::V1beta1::Job::State::ENABLED Job.State.ENABLED} to be - # paused. - # - # @overload pause_job(request, options = nil) - # Pass arguments to `pause_job` via a request object, either of type - # {::Google::Cloud::Scheduler::V1beta1::PauseJobRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Scheduler::V1beta1::PauseJobRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. - # - # @overload pause_job(name: nil) - # Pass arguments to `pause_job` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param name [::String] - # Required. The job name. For example: - # `projects/PROJECT_ID/locations/LOCATION_ID/jobs/JOB_ID`. - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Google::Cloud::Scheduler::V1beta1::Job] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Google::Cloud::Scheduler::V1beta1::Job] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/cloud/scheduler/v1beta1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Scheduler::V1beta1::CloudScheduler::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Scheduler::V1beta1::PauseJobRequest.new - # - # # Call the pause_job method. - # result = client.pause_job request - # - # # The returned object is of type Google::Cloud::Scheduler::V1beta1::Job. - # p result - # - def pause_job request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Scheduler::V1beta1::PauseJobRequest - - # Converts hash and nil to an options object - options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h - - # Customize the options with defaults - metadata = @config.rpcs.pause_job.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::Scheduler::V1beta1::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.pause_job.timeout, - metadata: metadata, - retry_policy: @config.rpcs.pause_job.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @cloud_scheduler_stub.call_rpc :pause_job, 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 - - ## - # Resume a job. - # - # This method reenables a job after it has been - # {::Google::Cloud::Scheduler::V1beta1::Job::State::PAUSED Job.State.PAUSED}. The - # state of a job is stored in - # {::Google::Cloud::Scheduler::V1beta1::Job#state Job.state}; after calling this - # method it will be set to - # {::Google::Cloud::Scheduler::V1beta1::Job::State::ENABLED Job.State.ENABLED}. A - # job must be in - # {::Google::Cloud::Scheduler::V1beta1::Job::State::PAUSED Job.State.PAUSED} to be - # resumed. - # - # @overload resume_job(request, options = nil) - # Pass arguments to `resume_job` via a request object, either of type - # {::Google::Cloud::Scheduler::V1beta1::ResumeJobRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Scheduler::V1beta1::ResumeJobRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. - # - # @overload resume_job(name: nil) - # Pass arguments to `resume_job` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param name [::String] - # Required. The job name. For example: - # `projects/PROJECT_ID/locations/LOCATION_ID/jobs/JOB_ID`. - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Google::Cloud::Scheduler::V1beta1::Job] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Google::Cloud::Scheduler::V1beta1::Job] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/cloud/scheduler/v1beta1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Scheduler::V1beta1::CloudScheduler::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Scheduler::V1beta1::ResumeJobRequest.new - # - # # Call the resume_job method. - # result = client.resume_job request - # - # # The returned object is of type Google::Cloud::Scheduler::V1beta1::Job. - # p result - # - def resume_job request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Scheduler::V1beta1::ResumeJobRequest - - # Converts hash and nil to an options object - options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h - - # Customize the options with defaults - metadata = @config.rpcs.resume_job.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::Scheduler::V1beta1::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.resume_job.timeout, - metadata: metadata, - retry_policy: @config.rpcs.resume_job.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @cloud_scheduler_stub.call_rpc :resume_job, 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 - - ## - # Forces a job to run now. - # - # When this method is called, Cloud Scheduler will dispatch the job, even - # if the job is already running. - # - # @overload run_job(request, options = nil) - # Pass arguments to `run_job` via a request object, either of type - # {::Google::Cloud::Scheduler::V1beta1::RunJobRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Scheduler::V1beta1::RunJobRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. - # - # @overload run_job(name: nil, legacy_app_engine_cron: nil) - # Pass arguments to `run_job` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param name [::String] - # Required. The job name. For example: - # `projects/PROJECT_ID/locations/LOCATION_ID/jobs/JOB_ID`. - # @param legacy_app_engine_cron [::Boolean] - # This field is used to manage the legacy App Engine Cron jobs using the - # Cloud Scheduler API. If the field is set to true, the job in the __cron - # queue with the corresponding name will be forced to run instead. - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Google::Cloud::Scheduler::V1beta1::Job] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Google::Cloud::Scheduler::V1beta1::Job] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/cloud/scheduler/v1beta1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Scheduler::V1beta1::CloudScheduler::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Scheduler::V1beta1::RunJobRequest.new - # - # # Call the run_job method. - # result = client.run_job request - # - # # The returned object is of type Google::Cloud::Scheduler::V1beta1::Job. - # p result - # - def run_job request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Scheduler::V1beta1::RunJobRequest - - # Converts hash 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.run_job.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::Scheduler::V1beta1::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.run_job.timeout, - metadata: metadata, - retry_policy: @config.rpcs.run_job.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @cloud_scheduler_stub.call_rpc :run_job, request, options: options do |response, operation| - yield response, operation if block_given? - end - rescue ::GRPC::BadStatus => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Configuration class for the CloudScheduler API. - # - # This class represents the configuration for CloudScheduler, - # providing control over timeouts, retry behavior, logging, transport - # parameters, and other low-level controls. Certain parameters can also be - # applied individually to specific RPCs. See - # {::Google::Cloud::Scheduler::V1beta1::CloudScheduler::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_jobs to 20 seconds, - # # and all remaining timeouts to 10 seconds. - # ::Google::Cloud::Scheduler::V1beta1::CloudScheduler::Client.configure do |config| - # config.timeout = 10.0 - # config.rpcs.list_jobs.timeout = 20.0 - # end - # - # # Apply the above configuration only to a new client. - # client = ::Google::Cloud::Scheduler::V1beta1::CloudScheduler::Client.new do |config| - # config.timeout = 10.0 - # config.rpcs.list_jobs.timeout = 20.0 - # end - # - # @!attribute [rw] endpoint - # A custom service endpoint, as a hostname or hostname:port. The default is - # nil, indicating to use the default endpoint in the current universe domain. - # @return [::String,nil] - # @!attribute [rw] credentials - # Credentials to send with calls. You may provide any of the following types: - # * (`Google::Auth::Credentials`) A googleauth credentials object - # (see the [googleauth docs](https://rubydoc.info/gems/googleauth/Google/Auth/Credentials)) - # * (`Signet::OAuth2::Client`) A signet oauth2 client object - # (see the [signet docs](https://rubydoc.info/gems/signet/Signet/OAuth2/Client)) - # * (`GRPC::Core::Channel`) a gRPC channel with included credentials - # * (`GRPC::Core::ChannelCredentials`) a gRPC credentails object - # * (`nil`) indicating no credentials - # - # @note Warning: Passing a `String` to a keyfile path or a `Hash` of credentials - # is deprecated. Providing an unvalidated credential configuration to - # Google APIs can compromise the security of your systems and data. - # - # @example - # - # # The recommended way to provide credentials is to use the `make_creds` method - # # on the appropriate credentials class for your environment. - # - # require "googleauth" - # - # credentials = ::Google::Auth::ServiceAccountCredentials.make_creds( - # json_key_io: ::File.open("/path/to/keyfile.json") - # ) - # - # client = ::Google::Cloud::Scheduler::V1beta1::CloudScheduler::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 = "cloudscheduler.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 CloudScheduler 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_jobs` - # @return [::Gapic::Config::Method] - # - attr_reader :list_jobs - ## - # RPC-specific configuration for `get_job` - # @return [::Gapic::Config::Method] - # - attr_reader :get_job - ## - # RPC-specific configuration for `create_job` - # @return [::Gapic::Config::Method] - # - attr_reader :create_job - ## - # RPC-specific configuration for `update_job` - # @return [::Gapic::Config::Method] - # - attr_reader :update_job - ## - # RPC-specific configuration for `delete_job` - # @return [::Gapic::Config::Method] - # - attr_reader :delete_job - ## - # RPC-specific configuration for `pause_job` - # @return [::Gapic::Config::Method] - # - attr_reader :pause_job - ## - # RPC-specific configuration for `resume_job` - # @return [::Gapic::Config::Method] - # - attr_reader :resume_job - ## - # RPC-specific configuration for `run_job` - # @return [::Gapic::Config::Method] - # - attr_reader :run_job - - # @private - def initialize parent_rpcs = nil - list_jobs_config = parent_rpcs.list_jobs if parent_rpcs.respond_to? :list_jobs - @list_jobs = ::Gapic::Config::Method.new list_jobs_config - get_job_config = parent_rpcs.get_job if parent_rpcs.respond_to? :get_job - @get_job = ::Gapic::Config::Method.new get_job_config - create_job_config = parent_rpcs.create_job if parent_rpcs.respond_to? :create_job - @create_job = ::Gapic::Config::Method.new create_job_config - update_job_config = parent_rpcs.update_job if parent_rpcs.respond_to? :update_job - @update_job = ::Gapic::Config::Method.new update_job_config - delete_job_config = parent_rpcs.delete_job if parent_rpcs.respond_to? :delete_job - @delete_job = ::Gapic::Config::Method.new delete_job_config - pause_job_config = parent_rpcs.pause_job if parent_rpcs.respond_to? :pause_job - @pause_job = ::Gapic::Config::Method.new pause_job_config - resume_job_config = parent_rpcs.resume_job if parent_rpcs.respond_to? :resume_job - @resume_job = ::Gapic::Config::Method.new resume_job_config - run_job_config = parent_rpcs.run_job if parent_rpcs.respond_to? :run_job - @run_job = ::Gapic::Config::Method.new run_job_config - - yield self if block_given? - end - end - end - end - end - end - end - end -end diff --git a/owl-bot-staging/google-cloud-scheduler-v1beta1/lib/google/cloud/scheduler/v1beta1/cloud_scheduler/credentials.rb b/owl-bot-staging/google-cloud-scheduler-v1beta1/lib/google/cloud/scheduler/v1beta1/cloud_scheduler/credentials.rb deleted file mode 100644 index 1e748ee1d335..000000000000 --- a/owl-bot-staging/google-cloud-scheduler-v1beta1/lib/google/cloud/scheduler/v1beta1/cloud_scheduler/credentials.rb +++ /dev/null @@ -1,51 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -require "googleauth" - -module Google - module Cloud - module Scheduler - module V1beta1 - module CloudScheduler - # Credentials for the CloudScheduler API. - class Credentials < ::Google::Auth::Credentials - self.scope = [ - "https://www.googleapis.com/auth/cloud-platform" - ] - self.env_vars = [ - "SCHEDULER_CREDENTIALS", - "SCHEDULER_KEYFILE", - "GOOGLE_CLOUD_CREDENTIALS", - "GOOGLE_CLOUD_KEYFILE", - "GCLOUD_KEYFILE", - "SCHEDULER_CREDENTIALS_JSON", - "SCHEDULER_KEYFILE_JSON", - "GOOGLE_CLOUD_CREDENTIALS_JSON", - "GOOGLE_CLOUD_KEYFILE_JSON", - "GCLOUD_KEYFILE_JSON" - ] - self.paths = [ - "~/.config/google_cloud/application_default_credentials.json" - ] - end - end - end - end - end -end diff --git a/owl-bot-staging/google-cloud-scheduler-v1beta1/lib/google/cloud/scheduler/v1beta1/cloud_scheduler/paths.rb b/owl-bot-staging/google-cloud-scheduler-v1beta1/lib/google/cloud/scheduler/v1beta1/cloud_scheduler/paths.rb deleted file mode 100644 index 4aa2f604894d..000000000000 --- a/owl-bot-staging/google-cloud-scheduler-v1beta1/lib/google/cloud/scheduler/v1beta1/cloud_scheduler/paths.rb +++ /dev/null @@ -1,86 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - - -module Google - module Cloud - module Scheduler - module V1beta1 - module CloudScheduler - # Path helper methods for the CloudScheduler API. - module Paths - ## - # Create a fully-qualified Job resource string. - # - # The resource will be in the following format: - # - # `projects/{project}/locations/{location}/jobs/{job}` - # - # @param project [String] - # @param location [String] - # @param job [String] - # - # @return [::String] - def job_path project:, location:, job: - raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" - raise ::ArgumentError, "location cannot contain /" if location.to_s.include? "/" - - "projects/#{project}/locations/#{location}/jobs/#{job}" - end - - ## - # Create a fully-qualified Location resource string. - # - # The resource will be in the following format: - # - # `projects/{project}/locations/{location}` - # - # @param project [String] - # @param location [String] - # - # @return [::String] - def location_path project:, location: - raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" - - "projects/#{project}/locations/#{location}" - end - - ## - # Create a fully-qualified Topic resource string. - # - # The resource will be in the following format: - # - # `projects/{project}/topics/{topic}` - # - # @param project [String] - # @param topic [String] - # - # @return [::String] - def topic_path project:, topic: - raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" - - "projects/#{project}/topics/#{topic}" - end - - extend self - end - end - end - end - end -end diff --git a/owl-bot-staging/google-cloud-scheduler-v1beta1/lib/google/cloud/scheduler/v1beta1/cloud_scheduler/rest.rb b/owl-bot-staging/google-cloud-scheduler-v1beta1/lib/google/cloud/scheduler/v1beta1/cloud_scheduler/rest.rb deleted file mode 100644 index 5b196c24f2f5..000000000000 --- a/owl-bot-staging/google-cloud-scheduler-v1beta1/lib/google/cloud/scheduler/v1beta1/cloud_scheduler/rest.rb +++ /dev/null @@ -1,54 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -require "gapic/rest" -require "gapic/config" -require "gapic/config/method" - -require "google/cloud/scheduler/v1beta1/version" -require "google/cloud/scheduler/v1beta1/bindings_override" - -require "google/cloud/scheduler/v1beta1/cloud_scheduler/credentials" -require "google/cloud/scheduler/v1beta1/cloud_scheduler/paths" -require "google/cloud/scheduler/v1beta1/cloud_scheduler/rest/client" - -module Google - module Cloud - module Scheduler - module V1beta1 - ## - # The Cloud Scheduler API allows external entities to reliably - # schedule asynchronous jobs. - # - # To load this service and instantiate a REST client: - # - # require "google/cloud/scheduler/v1beta1/cloud_scheduler/rest" - # client = ::Google::Cloud::Scheduler::V1beta1::CloudScheduler::Rest::Client.new - # - module CloudScheduler - # Client for the REST transport - module Rest - end - end - end - end - end -end - -helper_path = ::File.join __dir__, "rest", "helpers.rb" -require "google/cloud/scheduler/v1beta1/cloud_scheduler/rest/helpers" if ::File.file? helper_path diff --git a/owl-bot-staging/google-cloud-scheduler-v1beta1/lib/google/cloud/scheduler/v1beta1/cloud_scheduler/rest/client.rb b/owl-bot-staging/google-cloud-scheduler-v1beta1/lib/google/cloud/scheduler/v1beta1/cloud_scheduler/rest/client.rb deleted file mode 100644 index 9475b683bd26..000000000000 --- a/owl-bot-staging/google-cloud-scheduler-v1beta1/lib/google/cloud/scheduler/v1beta1/cloud_scheduler/rest/client.rb +++ /dev/null @@ -1,1172 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -require "google/cloud/errors" -require "google/cloud/scheduler/v1beta1/cloudscheduler_pb" -require "google/cloud/scheduler/v1beta1/cloud_scheduler/rest/service_stub" -require "google/cloud/location/rest" - -module Google - module Cloud - module Scheduler - module V1beta1 - module CloudScheduler - module Rest - ## - # REST client for the CloudScheduler service. - # - # The Cloud Scheduler API allows external entities to reliably - # schedule asynchronous jobs. - # - class Client - # @private - API_VERSION = "" - - # @private - DEFAULT_ENDPOINT_TEMPLATE = "cloudscheduler.$UNIVERSE_DOMAIN$" - - include Paths - - # @private - attr_reader :cloud_scheduler_stub - - ## - # Configure the CloudScheduler Client class. - # - # See {::Google::Cloud::Scheduler::V1beta1::CloudScheduler::Rest::Client::Configuration} - # for a description of the configuration fields. - # - # @example - # - # # Modify the configuration for all CloudScheduler clients - # ::Google::Cloud::Scheduler::V1beta1::CloudScheduler::Rest::Client.configure do |config| - # config.timeout = 10.0 - # end - # - # @yield [config] Configure the Client client. - # @yieldparam config [Client::Configuration] - # - # @return [Client::Configuration] - # - def self.configure - @configure ||= begin - namespace = ["Google", "Cloud", "Scheduler", "V1beta1"] - parent_config = while namespace.any? - parent_name = namespace.join "::" - parent_const = const_get parent_name - break parent_const.configure if parent_const.respond_to? :configure - namespace.pop - end - default_config = Client::Configuration.new parent_config - - default_config.rpcs.list_jobs.timeout = 600.0 - default_config.rpcs.list_jobs.retry_policy = { - initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [4, 14] - } - - default_config.rpcs.get_job.timeout = 600.0 - default_config.rpcs.get_job.retry_policy = { - initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [4, 14] - } - - default_config.rpcs.create_job.timeout = 600.0 - - default_config.rpcs.update_job.timeout = 600.0 - - default_config.rpcs.delete_job.timeout = 600.0 - default_config.rpcs.delete_job.retry_policy = { - initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [4, 14] - } - - default_config.rpcs.pause_job.timeout = 600.0 - default_config.rpcs.pause_job.retry_policy = { - initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [4, 14] - } - - default_config.rpcs.resume_job.timeout = 600.0 - default_config.rpcs.resume_job.retry_policy = { - initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [4, 14] - } - - default_config.rpcs.run_job.timeout = 600.0 - - default_config - end - yield @configure if block_given? - @configure - end - - ## - # Configure the CloudScheduler Client instance. - # - # The configuration is set to the derived mode, meaning that values can be changed, - # but structural changes (adding new fields, etc.) are not allowed. Structural changes - # should be made on {Client.configure}. - # - # See {::Google::Cloud::Scheduler::V1beta1::CloudScheduler::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 - @cloud_scheduler_stub.universe_domain - end - - ## - # Create a new CloudScheduler REST client object. - # - # @example - # - # # Create a client using the default configuration - # client = ::Google::Cloud::Scheduler::V1beta1::CloudScheduler::Rest::Client.new - # - # # Create a client using a custom configuration - # client = ::Google::Cloud::Scheduler::V1beta1::CloudScheduler::Rest::Client.new do |config| - # config.timeout = 10.0 - # end - # - # @yield [config] Configure the CloudScheduler 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 - - @cloud_scheduler_stub = ::Google::Cloud::Scheduler::V1beta1::CloudScheduler::Rest::ServiceStub.new( - endpoint: @config.endpoint, - endpoint_template: DEFAULT_ENDPOINT_TEMPLATE, - universe_domain: @config.universe_domain, - credentials: credentials, - logger: @config.logger - ) - - @cloud_scheduler_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 = @cloud_scheduler_stub.endpoint - config.universe_domain = @cloud_scheduler_stub.universe_domain - config.bindings_override = @config.bindings_override - config.logger = @cloud_scheduler_stub.logger if config.respond_to? :logger= - end - end - - ## - # Get the associated client for mix-in of the Locations. - # - # @return [Google::Cloud::Location::Locations::Rest::Client] - # - attr_reader :location_client - - ## - # The logger used for request/response debug logging. - # - # @return [Logger] - # - def logger - @cloud_scheduler_stub.logger - end - - # Service calls - - ## - # Lists jobs. - # - # @overload list_jobs(request, options = nil) - # Pass arguments to `list_jobs` via a request object, either of type - # {::Google::Cloud::Scheduler::V1beta1::ListJobsRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Scheduler::V1beta1::ListJobsRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @overload list_jobs(parent: nil, filter: nil, page_size: nil, page_token: nil, legacy_app_engine_cron: nil) - # Pass arguments to `list_jobs` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param parent [::String] - # Required. The location name. For example: - # `projects/PROJECT_ID/locations/LOCATION_ID`. - # @param filter [::String] - # `filter` can be used to specify a subset of jobs. - # - # If `filter` equals `target_config="HttpConfig"`, then the http - # target jobs are retrieved. If `filter` equals - # `target_config="PubSubConfig"`, then the Pub/Sub target jobs are - # retrieved. If `filter` equals `labels.foo=value1 - # labels.foo=value2` then only jobs which are labeled with - # foo=value1 AND foo=value2 will be returned. - # @param page_size [::Integer] - # Requested page size. - # - # The maximum page size is 500. If unspecified, the page size will - # be the maximum. Fewer jobs than requested might be returned, - # even if more jobs exist; use next_page_token to determine if more - # jobs exist. - # @param page_token [::String] - # A token identifying a page of results the server will return. To - # request the first page results, page_token must be empty. To - # request the next page of results, page_token must be the value of - # {::Google::Cloud::Scheduler::V1beta1::ListJobsResponse#next_page_token next_page_token} - # returned from the previous call to - # {::Google::Cloud::Scheduler::V1beta1::CloudScheduler::Rest::Client#list_jobs ListJobs}. It is - # an error to switch the value of - # {::Google::Cloud::Scheduler::V1beta1::ListJobsRequest#filter filter} or - # [order_by][google.cloud.scheduler.v1beta1.ListJobsRequest.order_by] while - # iterating through pages. - # @param legacy_app_engine_cron [::Boolean] - # This field is used to manage the legacy App Engine Cron jobs using the - # Cloud Scheduler API. If the field is set to true, the jobs in the __cron - # queue will be listed instead. - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Gapic::Rest::PagedEnumerable<::Google::Cloud::Scheduler::V1beta1::Job>] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Gapic::Rest::PagedEnumerable<::Google::Cloud::Scheduler::V1beta1::Job>] - # - # @raise [::Google::Cloud::Error] if the REST call is aborted. - # - # @example Basic example - # require "google/cloud/scheduler/v1beta1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Scheduler::V1beta1::CloudScheduler::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Scheduler::V1beta1::ListJobsRequest.new - # - # # Call the list_jobs method. - # result = client.list_jobs request - # - # # The returned object is of type Gapic::PagedEnumerable. You can iterate - # # over elements, and API calls will be issued to fetch pages as needed. - # result.each do |item| - # # Each element is of type ::Google::Cloud::Scheduler::V1beta1::Job. - # p item - # end - # - def list_jobs request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Scheduler::V1beta1::ListJobsRequest - - # Converts hash and nil to an options object - options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h - - # Customize the options with defaults - call_metadata = @config.rpcs.list_jobs.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::Scheduler::V1beta1::VERSION, - transports_version_send: [:rest] - - call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - options.apply_defaults timeout: @config.rpcs.list_jobs.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.list_jobs.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @cloud_scheduler_stub.list_jobs request, options do |result, operation| - result = ::Gapic::Rest::PagedEnumerable.new @cloud_scheduler_stub, :list_jobs, "jobs", 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 a job. - # - # @overload get_job(request, options = nil) - # Pass arguments to `get_job` via a request object, either of type - # {::Google::Cloud::Scheduler::V1beta1::GetJobRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Scheduler::V1beta1::GetJobRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @overload get_job(name: nil) - # Pass arguments to `get_job` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param name [::String] - # Required. The job name. For example: - # `projects/PROJECT_ID/locations/LOCATION_ID/jobs/JOB_ID`. - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Cloud::Scheduler::V1beta1::Job] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::Scheduler::V1beta1::Job] - # - # @raise [::Google::Cloud::Error] if the REST call is aborted. - # - # @example Basic example - # require "google/cloud/scheduler/v1beta1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Scheduler::V1beta1::CloudScheduler::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Scheduler::V1beta1::GetJobRequest.new - # - # # Call the get_job method. - # result = client.get_job request - # - # # The returned object is of type Google::Cloud::Scheduler::V1beta1::Job. - # p result - # - def get_job request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Scheduler::V1beta1::GetJobRequest - - # Converts hash and nil to an options object - options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h - - # Customize the options with defaults - call_metadata = @config.rpcs.get_job.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::Scheduler::V1beta1::VERSION, - transports_version_send: [:rest] - - call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - options.apply_defaults timeout: @config.rpcs.get_job.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.get_job.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @cloud_scheduler_stub.get_job request, options do |result, operation| - yield result, operation if block_given? - end - rescue ::Gapic::Rest::Error => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Creates a job. - # - # @overload create_job(request, options = nil) - # Pass arguments to `create_job` via a request object, either of type - # {::Google::Cloud::Scheduler::V1beta1::CreateJobRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Scheduler::V1beta1::CreateJobRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @overload create_job(parent: nil, job: nil) - # Pass arguments to `create_job` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param parent [::String] - # Required. The location name. For example: - # `projects/PROJECT_ID/locations/LOCATION_ID`. - # @param job [::Google::Cloud::Scheduler::V1beta1::Job, ::Hash] - # Required. The job to add. The user can optionally specify a name for the - # job in {::Google::Cloud::Scheduler::V1beta1::Job#name name}. - # {::Google::Cloud::Scheduler::V1beta1::Job#name name} cannot be the same as an - # existing job. If a name is not specified then the system will - # generate a random unique name that will be returned - # ({::Google::Cloud::Scheduler::V1beta1::Job#name name}) in the response. - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Cloud::Scheduler::V1beta1::Job] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::Scheduler::V1beta1::Job] - # - # @raise [::Google::Cloud::Error] if the REST call is aborted. - # - # @example Basic example - # require "google/cloud/scheduler/v1beta1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Scheduler::V1beta1::CloudScheduler::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Scheduler::V1beta1::CreateJobRequest.new - # - # # Call the create_job method. - # result = client.create_job request - # - # # The returned object is of type Google::Cloud::Scheduler::V1beta1::Job. - # p result - # - def create_job request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Scheduler::V1beta1::CreateJobRequest - - # Converts hash and nil to an options object - options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h - - # Customize the options with defaults - call_metadata = @config.rpcs.create_job.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::Scheduler::V1beta1::VERSION, - transports_version_send: [:rest] - - call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - options.apply_defaults timeout: @config.rpcs.create_job.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.create_job.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @cloud_scheduler_stub.create_job 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 job. - # - # If successful, the updated {::Google::Cloud::Scheduler::V1beta1::Job Job} is - # returned. If the job does not exist, `NOT_FOUND` is returned. - # - # If UpdateJob does not successfully return, it is possible for the - # job to be in an - # {::Google::Cloud::Scheduler::V1beta1::Job::State::UPDATE_FAILED Job.State.UPDATE_FAILED} - # state. A job in this state may not be executed. If this happens, retry the - # UpdateJob request until a successful response is received. - # - # @overload update_job(request, options = nil) - # Pass arguments to `update_job` via a request object, either of type - # {::Google::Cloud::Scheduler::V1beta1::UpdateJobRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Scheduler::V1beta1::UpdateJobRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_job(job: nil, update_mask: nil) - # Pass arguments to `update_job` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param job [::Google::Cloud::Scheduler::V1beta1::Job, ::Hash] - # Required. The new job properties. - # {::Google::Cloud::Scheduler::V1beta1::Job#name name} must be specified. - # - # Output only fields cannot be modified using UpdateJob. - # Any value specified for an output only field will be ignored. - # @param update_mask [::Google::Protobuf::FieldMask, ::Hash] - # A mask used to specify which fields of the job are being updated. - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Cloud::Scheduler::V1beta1::Job] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::Scheduler::V1beta1::Job] - # - # @raise [::Google::Cloud::Error] if the REST call is aborted. - # - # @example Basic example - # require "google/cloud/scheduler/v1beta1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Scheduler::V1beta1::CloudScheduler::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Scheduler::V1beta1::UpdateJobRequest.new - # - # # Call the update_job method. - # result = client.update_job request - # - # # The returned object is of type Google::Cloud::Scheduler::V1beta1::Job. - # p result - # - def update_job request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Scheduler::V1beta1::UpdateJobRequest - - # Converts hash 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_job.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::Scheduler::V1beta1::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_job.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.update_job.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @cloud_scheduler_stub.update_job request, options do |result, operation| - yield result, operation if block_given? - end - rescue ::Gapic::Rest::Error => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Deletes a job. - # - # @overload delete_job(request, options = nil) - # Pass arguments to `delete_job` via a request object, either of type - # {::Google::Cloud::Scheduler::V1beta1::DeleteJobRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Scheduler::V1beta1::DeleteJobRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @overload delete_job(name: nil, legacy_app_engine_cron: nil) - # Pass arguments to `delete_job` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param name [::String] - # Required. The job name. For example: - # `projects/PROJECT_ID/locations/LOCATION_ID/jobs/JOB_ID`. - # @param legacy_app_engine_cron [::Boolean] - # This field is used to manage the legacy App Engine Cron jobs using the - # Cloud Scheduler API. If the field is set to true, the job in the __cron - # queue with the corresponding name will be deleted instead. - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Protobuf::Empty] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Protobuf::Empty] - # - # @raise [::Google::Cloud::Error] if the REST call is aborted. - # - # @example Basic example - # require "google/cloud/scheduler/v1beta1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Scheduler::V1beta1::CloudScheduler::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Scheduler::V1beta1::DeleteJobRequest.new - # - # # Call the delete_job method. - # result = client.delete_job request - # - # # The returned object is of type Google::Protobuf::Empty. - # p result - # - def delete_job request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Scheduler::V1beta1::DeleteJobRequest - - # Converts hash and nil to an options object - options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h - - # Customize the options with defaults - call_metadata = @config.rpcs.delete_job.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::Scheduler::V1beta1::VERSION, - transports_version_send: [:rest] - - call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - options.apply_defaults timeout: @config.rpcs.delete_job.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.delete_job.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @cloud_scheduler_stub.delete_job 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 - - ## - # Pauses a job. - # - # If a job is paused then the system will stop executing the job - # until it is re-enabled via - # {::Google::Cloud::Scheduler::V1beta1::CloudScheduler::Rest::Client#resume_job ResumeJob}. The - # state of the job is stored in - # {::Google::Cloud::Scheduler::V1beta1::Job#state state}; if paused it will be set - # to {::Google::Cloud::Scheduler::V1beta1::Job::State::PAUSED Job.State.PAUSED}. A - # job must be in - # {::Google::Cloud::Scheduler::V1beta1::Job::State::ENABLED Job.State.ENABLED} to be - # paused. - # - # @overload pause_job(request, options = nil) - # Pass arguments to `pause_job` via a request object, either of type - # {::Google::Cloud::Scheduler::V1beta1::PauseJobRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Scheduler::V1beta1::PauseJobRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @overload pause_job(name: nil) - # Pass arguments to `pause_job` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param name [::String] - # Required. The job name. For example: - # `projects/PROJECT_ID/locations/LOCATION_ID/jobs/JOB_ID`. - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Cloud::Scheduler::V1beta1::Job] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::Scheduler::V1beta1::Job] - # - # @raise [::Google::Cloud::Error] if the REST call is aborted. - # - # @example Basic example - # require "google/cloud/scheduler/v1beta1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Scheduler::V1beta1::CloudScheduler::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Scheduler::V1beta1::PauseJobRequest.new - # - # # Call the pause_job method. - # result = client.pause_job request - # - # # The returned object is of type Google::Cloud::Scheduler::V1beta1::Job. - # p result - # - def pause_job request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Scheduler::V1beta1::PauseJobRequest - - # Converts hash 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.pause_job.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::Scheduler::V1beta1::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.pause_job.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.pause_job.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @cloud_scheduler_stub.pause_job 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 - - ## - # Resume a job. - # - # This method reenables a job after it has been - # {::Google::Cloud::Scheduler::V1beta1::Job::State::PAUSED Job.State.PAUSED}. The - # state of a job is stored in - # {::Google::Cloud::Scheduler::V1beta1::Job#state Job.state}; after calling this - # method it will be set to - # {::Google::Cloud::Scheduler::V1beta1::Job::State::ENABLED Job.State.ENABLED}. A - # job must be in - # {::Google::Cloud::Scheduler::V1beta1::Job::State::PAUSED Job.State.PAUSED} to be - # resumed. - # - # @overload resume_job(request, options = nil) - # Pass arguments to `resume_job` via a request object, either of type - # {::Google::Cloud::Scheduler::V1beta1::ResumeJobRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Scheduler::V1beta1::ResumeJobRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @overload resume_job(name: nil) - # Pass arguments to `resume_job` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param name [::String] - # Required. The job name. For example: - # `projects/PROJECT_ID/locations/LOCATION_ID/jobs/JOB_ID`. - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Cloud::Scheduler::V1beta1::Job] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::Scheduler::V1beta1::Job] - # - # @raise [::Google::Cloud::Error] if the REST call is aborted. - # - # @example Basic example - # require "google/cloud/scheduler/v1beta1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Scheduler::V1beta1::CloudScheduler::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Scheduler::V1beta1::ResumeJobRequest.new - # - # # Call the resume_job method. - # result = client.resume_job request - # - # # The returned object is of type Google::Cloud::Scheduler::V1beta1::Job. - # p result - # - def resume_job request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Scheduler::V1beta1::ResumeJobRequest - - # Converts hash 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.resume_job.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::Scheduler::V1beta1::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.resume_job.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.resume_job.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @cloud_scheduler_stub.resume_job 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 - - ## - # Forces a job to run now. - # - # When this method is called, Cloud Scheduler will dispatch the job, even - # if the job is already running. - # - # @overload run_job(request, options = nil) - # Pass arguments to `run_job` via a request object, either of type - # {::Google::Cloud::Scheduler::V1beta1::RunJobRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Scheduler::V1beta1::RunJobRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @overload run_job(name: nil, legacy_app_engine_cron: nil) - # Pass arguments to `run_job` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param name [::String] - # Required. The job name. For example: - # `projects/PROJECT_ID/locations/LOCATION_ID/jobs/JOB_ID`. - # @param legacy_app_engine_cron [::Boolean] - # This field is used to manage the legacy App Engine Cron jobs using the - # Cloud Scheduler API. If the field is set to true, the job in the __cron - # queue with the corresponding name will be forced to run instead. - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Cloud::Scheduler::V1beta1::Job] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::Scheduler::V1beta1::Job] - # - # @raise [::Google::Cloud::Error] if the REST call is aborted. - # - # @example Basic example - # require "google/cloud/scheduler/v1beta1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Scheduler::V1beta1::CloudScheduler::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Scheduler::V1beta1::RunJobRequest.new - # - # # Call the run_job method. - # result = client.run_job request - # - # # The returned object is of type Google::Cloud::Scheduler::V1beta1::Job. - # p result - # - def run_job request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Scheduler::V1beta1::RunJobRequest - - # Converts hash 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.run_job.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::Scheduler::V1beta1::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.run_job.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.run_job.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @cloud_scheduler_stub.run_job 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 CloudScheduler REST API. - # - # This class represents the configuration for CloudScheduler REST, - # providing control over timeouts, retry behavior, logging, transport - # parameters, and other low-level controls. Certain parameters can also be - # applied individually to specific RPCs. See - # {::Google::Cloud::Scheduler::V1beta1::CloudScheduler::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_jobs to 20 seconds, - # # and all remaining timeouts to 10 seconds. - # ::Google::Cloud::Scheduler::V1beta1::CloudScheduler::Rest::Client.configure do |config| - # config.timeout = 10.0 - # config.rpcs.list_jobs.timeout = 20.0 - # end - # - # # Apply the above configuration only to a new client. - # client = ::Google::Cloud::Scheduler::V1beta1::CloudScheduler::Rest::Client.new do |config| - # config.timeout = 10.0 - # config.rpcs.list_jobs.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 = "cloudscheduler.googleapis.com" - - config_attr :endpoint, nil, ::String, nil - config_attr :credentials, nil do |value| - allowed = [::String, ::Hash, ::Proc, ::Symbol, ::Google::Auth::Credentials, ::Google::Auth::BaseClient, ::Signet::OAuth2::Client, nil] - allowed.any? { |klass| klass === value } - end - config_attr :scope, nil, ::String, ::Array, nil - config_attr :lib_name, nil, ::String, nil - config_attr :lib_version, nil, ::String, nil - config_attr :timeout, nil, ::Numeric, nil - config_attr :metadata, nil, ::Hash, nil - config_attr :retry_policy, nil, ::Hash, ::Proc, nil - config_attr :quota_project, nil, ::String, nil - config_attr :universe_domain, nil, ::String, nil - - # @private - # Overrides for http bindings for the RPCs of this service - # are only used when this service is used as mixin, and only - # by the host service. - # @return [::Hash{::Symbol=>::Array<::Gapic::Rest::GrpcTranscoder::HttpBinding>}] - config_attr :bindings_override, {}, ::Hash, nil - config_attr :logger, :default, ::Logger, nil, :default - - # @private - def initialize parent_config = nil - @parent_config = parent_config unless parent_config.nil? - - yield self if block_given? - end - - ## - # Configurations for individual RPCs - # @return [Rpcs] - # - def rpcs - @rpcs ||= begin - parent_rpcs = nil - parent_rpcs = @parent_config.rpcs if defined?(@parent_config) && @parent_config.respond_to?(:rpcs) - Rpcs.new parent_rpcs - end - end - - ## - # Configuration RPC class for the CloudScheduler 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_jobs` - # @return [::Gapic::Config::Method] - # - attr_reader :list_jobs - ## - # RPC-specific configuration for `get_job` - # @return [::Gapic::Config::Method] - # - attr_reader :get_job - ## - # RPC-specific configuration for `create_job` - # @return [::Gapic::Config::Method] - # - attr_reader :create_job - ## - # RPC-specific configuration for `update_job` - # @return [::Gapic::Config::Method] - # - attr_reader :update_job - ## - # RPC-specific configuration for `delete_job` - # @return [::Gapic::Config::Method] - # - attr_reader :delete_job - ## - # RPC-specific configuration for `pause_job` - # @return [::Gapic::Config::Method] - # - attr_reader :pause_job - ## - # RPC-specific configuration for `resume_job` - # @return [::Gapic::Config::Method] - # - attr_reader :resume_job - ## - # RPC-specific configuration for `run_job` - # @return [::Gapic::Config::Method] - # - attr_reader :run_job - - # @private - def initialize parent_rpcs = nil - list_jobs_config = parent_rpcs.list_jobs if parent_rpcs.respond_to? :list_jobs - @list_jobs = ::Gapic::Config::Method.new list_jobs_config - get_job_config = parent_rpcs.get_job if parent_rpcs.respond_to? :get_job - @get_job = ::Gapic::Config::Method.new get_job_config - create_job_config = parent_rpcs.create_job if parent_rpcs.respond_to? :create_job - @create_job = ::Gapic::Config::Method.new create_job_config - update_job_config = parent_rpcs.update_job if parent_rpcs.respond_to? :update_job - @update_job = ::Gapic::Config::Method.new update_job_config - delete_job_config = parent_rpcs.delete_job if parent_rpcs.respond_to? :delete_job - @delete_job = ::Gapic::Config::Method.new delete_job_config - pause_job_config = parent_rpcs.pause_job if parent_rpcs.respond_to? :pause_job - @pause_job = ::Gapic::Config::Method.new pause_job_config - resume_job_config = parent_rpcs.resume_job if parent_rpcs.respond_to? :resume_job - @resume_job = ::Gapic::Config::Method.new resume_job_config - run_job_config = parent_rpcs.run_job if parent_rpcs.respond_to? :run_job - @run_job = ::Gapic::Config::Method.new run_job_config - - yield self if block_given? - end - end - end - end - end - end - end - end - end -end diff --git a/owl-bot-staging/google-cloud-scheduler-v1beta1/lib/google/cloud/scheduler/v1beta1/cloud_scheduler/rest/service_stub.rb b/owl-bot-staging/google-cloud-scheduler-v1beta1/lib/google/cloud/scheduler/v1beta1/cloud_scheduler/rest/service_stub.rb deleted file mode 100644 index 0601d73d2008..000000000000 --- a/owl-bot-staging/google-cloud-scheduler-v1beta1/lib/google/cloud/scheduler/v1beta1/cloud_scheduler/rest/service_stub.rb +++ /dev/null @@ -1,574 +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/scheduler/v1beta1/cloudscheduler_pb" - -module Google - module Cloud - module Scheduler - module V1beta1 - module CloudScheduler - module Rest - ## - # REST service stub for the CloudScheduler service. - # Service stub contains baseline method implementations - # including transcoding, making the REST call, and deserialing the response. - # - class ServiceStub - # @private - def initialize endpoint:, endpoint_template:, universe_domain:, credentials:, logger: - # These require statements are intentionally placed here to initialize - # the REST modules only when it's required. - require "gapic/rest" - - @client_stub = ::Gapic::Rest::ClientStub.new endpoint: endpoint, - endpoint_template: endpoint_template, - universe_domain: universe_domain, - credentials: credentials, - numeric_enums: true, - service_name: self.class, - raise_faraday_errors: false, - logger: logger - end - - ## - # The effective universe domain - # - # @return [String] - # - def universe_domain - @client_stub.universe_domain - end - - ## - # The effective endpoint - # - # @return [String] - # - def endpoint - @client_stub.endpoint - end - - ## - # The logger used for request/response debug logging. - # - # @return [Logger] - # - def logger stub: false - stub ? @client_stub.stub_logger : @client_stub.logger - end - - ## - # Baseline implementation for the list_jobs REST call - # - # @param request_pb [::Google::Cloud::Scheduler::V1beta1::ListJobsRequest] - # A request object representing the call parameters. Required. - # @param options [::Gapic::CallOptions] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Cloud::Scheduler::V1beta1::ListJobsResponse] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::Scheduler::V1beta1::ListJobsResponse] - # A result object deserialized from the server's reply - def list_jobs request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_list_jobs_request request_pb - query_string_params = if query_string_params.any? - query_string_params.to_h { |p| p.split "=", 2 } - else - {} - end - - response = @client_stub.make_http_request( - verb, - uri: uri, - body: body || "", - params: query_string_params, - method_name: "list_jobs", - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Cloud::Scheduler::V1beta1::ListJobsResponse.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_job REST call - # - # @param request_pb [::Google::Cloud::Scheduler::V1beta1::GetJobRequest] - # A request object representing the call parameters. Required. - # @param options [::Gapic::CallOptions] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Cloud::Scheduler::V1beta1::Job] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::Scheduler::V1beta1::Job] - # A result object deserialized from the server's reply - def get_job request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_get_job_request request_pb - query_string_params = if query_string_params.any? - query_string_params.to_h { |p| p.split "=", 2 } - else - {} - end - - response = @client_stub.make_http_request( - verb, - uri: uri, - body: body || "", - params: query_string_params, - method_name: "get_job", - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Cloud::Scheduler::V1beta1::Job.decode_json response.body, ignore_unknown_fields: true - catch :response do - yield result, operation if block_given? - result - end - end - - ## - # Baseline implementation for the create_job REST call - # - # @param request_pb [::Google::Cloud::Scheduler::V1beta1::CreateJobRequest] - # A request object representing the call parameters. Required. - # @param options [::Gapic::CallOptions] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Cloud::Scheduler::V1beta1::Job] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::Scheduler::V1beta1::Job] - # A result object deserialized from the server's reply - def create_job request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_create_job_request request_pb - query_string_params = if query_string_params.any? - query_string_params.to_h { |p| p.split "=", 2 } - else - {} - end - - response = @client_stub.make_http_request( - verb, - uri: uri, - body: body || "", - params: query_string_params, - method_name: "create_job", - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Cloud::Scheduler::V1beta1::Job.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_job REST call - # - # @param request_pb [::Google::Cloud::Scheduler::V1beta1::UpdateJobRequest] - # A request object representing the call parameters. Required. - # @param options [::Gapic::CallOptions] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Cloud::Scheduler::V1beta1::Job] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::Scheduler::V1beta1::Job] - # A result object deserialized from the server's reply - def update_job request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_update_job_request request_pb - query_string_params = if query_string_params.any? - query_string_params.to_h { |p| p.split "=", 2 } - else - {} - end - - response = @client_stub.make_http_request( - verb, - uri: uri, - body: body || "", - params: query_string_params, - method_name: "update_job", - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Cloud::Scheduler::V1beta1::Job.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_job REST call - # - # @param request_pb [::Google::Cloud::Scheduler::V1beta1::DeleteJobRequest] - # A request object representing the call parameters. Required. - # @param options [::Gapic::CallOptions] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Protobuf::Empty] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Protobuf::Empty] - # A result object deserialized from the server's reply - def delete_job request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_delete_job_request request_pb - query_string_params = if query_string_params.any? - query_string_params.to_h { |p| p.split "=", 2 } - else - {} - end - - response = @client_stub.make_http_request( - verb, - uri: uri, - body: body || "", - params: query_string_params, - method_name: "delete_job", - 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 pause_job REST call - # - # @param request_pb [::Google::Cloud::Scheduler::V1beta1::PauseJobRequest] - # A request object representing the call parameters. Required. - # @param options [::Gapic::CallOptions] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Cloud::Scheduler::V1beta1::Job] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::Scheduler::V1beta1::Job] - # A result object deserialized from the server's reply - def pause_job request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_pause_job_request request_pb - query_string_params = if query_string_params.any? - query_string_params.to_h { |p| p.split "=", 2 } - else - {} - end - - response = @client_stub.make_http_request( - verb, - uri: uri, - body: body || "", - params: query_string_params, - method_name: "pause_job", - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Cloud::Scheduler::V1beta1::Job.decode_json response.body, ignore_unknown_fields: true - catch :response do - yield result, operation if block_given? - result - end - end - - ## - # Baseline implementation for the resume_job REST call - # - # @param request_pb [::Google::Cloud::Scheduler::V1beta1::ResumeJobRequest] - # A request object representing the call parameters. Required. - # @param options [::Gapic::CallOptions] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Cloud::Scheduler::V1beta1::Job] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::Scheduler::V1beta1::Job] - # A result object deserialized from the server's reply - def resume_job request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_resume_job_request request_pb - query_string_params = if query_string_params.any? - query_string_params.to_h { |p| p.split "=", 2 } - else - {} - end - - response = @client_stub.make_http_request( - verb, - uri: uri, - body: body || "", - params: query_string_params, - method_name: "resume_job", - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Cloud::Scheduler::V1beta1::Job.decode_json response.body, ignore_unknown_fields: true - catch :response do - yield result, operation if block_given? - result - end - end - - ## - # Baseline implementation for the run_job REST call - # - # @param request_pb [::Google::Cloud::Scheduler::V1beta1::RunJobRequest] - # A request object representing the call parameters. Required. - # @param options [::Gapic::CallOptions] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Cloud::Scheduler::V1beta1::Job] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::Scheduler::V1beta1::Job] - # A result object deserialized from the server's reply - def run_job request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_run_job_request request_pb - query_string_params = if query_string_params.any? - query_string_params.to_h { |p| p.split "=", 2 } - else - {} - end - - response = @client_stub.make_http_request( - verb, - uri: uri, - body: body || "", - params: query_string_params, - method_name: "run_job", - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Cloud::Scheduler::V1beta1::Job.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_jobs REST call - # - # @param request_pb [::Google::Cloud::Scheduler::V1beta1::ListJobsRequest] - # A request object representing the call parameters. Required. - # @return [Array(String, [String, nil], Hash{String => String})] - # Uri, Body, Query string parameters - def self.transcode_list_jobs_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :get, - uri_template: "/v1beta1/{parent}/jobs", - matches: [ - ["parent", %r{^projects/[^/]+/locations/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the get_job REST call - # - # @param request_pb [::Google::Cloud::Scheduler::V1beta1::GetJobRequest] - # A request object representing the call parameters. Required. - # @return [Array(String, [String, nil], Hash{String => String})] - # Uri, Body, Query string parameters - def self.transcode_get_job_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :get, - uri_template: "/v1beta1/{name}", - matches: [ - ["name", %r{^projects/[^/]+/locations/[^/]+/jobs/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the create_job REST call - # - # @param request_pb [::Google::Cloud::Scheduler::V1beta1::CreateJobRequest] - # A request object representing the call parameters. Required. - # @return [Array(String, [String, nil], Hash{String => String})] - # Uri, Body, Query string parameters - def self.transcode_create_job_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :post, - uri_template: "/v1beta1/{parent}/jobs", - body: "job", - matches: [ - ["parent", %r{^projects/[^/]+/locations/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the update_job REST call - # - # @param request_pb [::Google::Cloud::Scheduler::V1beta1::UpdateJobRequest] - # 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_job_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :patch, - uri_template: "/v1beta1/{job.name}", - body: "job", - matches: [ - ["job.name", %r{^projects/[^/]+/locations/[^/]+/jobs/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the delete_job REST call - # - # @param request_pb [::Google::Cloud::Scheduler::V1beta1::DeleteJobRequest] - # A request object representing the call parameters. Required. - # @return [Array(String, [String, nil], Hash{String => String})] - # Uri, Body, Query string parameters - def self.transcode_delete_job_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :delete, - uri_template: "/v1beta1/{name}", - matches: [ - ["name", %r{^projects/[^/]+/locations/[^/]+/jobs/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the pause_job REST call - # - # @param request_pb [::Google::Cloud::Scheduler::V1beta1::PauseJobRequest] - # A request object representing the call parameters. Required. - # @return [Array(String, [String, nil], Hash{String => String})] - # Uri, Body, Query string parameters - def self.transcode_pause_job_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :post, - uri_template: "/v1beta1/{name}:pause", - body: "*", - matches: [ - ["name", %r{^projects/[^/]+/locations/[^/]+/jobs/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the resume_job REST call - # - # @param request_pb [::Google::Cloud::Scheduler::V1beta1::ResumeJobRequest] - # A request object representing the call parameters. Required. - # @return [Array(String, [String, nil], Hash{String => String})] - # Uri, Body, Query string parameters - def self.transcode_resume_job_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :post, - uri_template: "/v1beta1/{name}:resume", - body: "*", - matches: [ - ["name", %r{^projects/[^/]+/locations/[^/]+/jobs/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the run_job REST call - # - # @param request_pb [::Google::Cloud::Scheduler::V1beta1::RunJobRequest] - # A request object representing the call parameters. Required. - # @return [Array(String, [String, nil], Hash{String => String})] - # Uri, Body, Query string parameters - def self.transcode_run_job_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :post, - uri_template: "/v1beta1/{name}:run", - body: "*", - matches: [ - ["name", %r{^projects/[^/]+/locations/[^/]+/jobs/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - end - end - end - end - end - end -end diff --git a/owl-bot-staging/google-cloud-scheduler-v1beta1/lib/google/cloud/scheduler/v1beta1/cloudscheduler_pb.rb b/owl-bot-staging/google-cloud-scheduler-v1beta1/lib/google/cloud/scheduler/v1beta1/cloudscheduler_pb.rb deleted file mode 100644 index 53d54323d798..000000000000 --- a/owl-bot-staging/google-cloud-scheduler-v1beta1/lib/google/cloud/scheduler/v1beta1/cloudscheduler_pb.rb +++ /dev/null @@ -1,37 +0,0 @@ -# frozen_string_literal: true -# Generated by the protocol buffer compiler. DO NOT EDIT! -# source: google/cloud/scheduler/v1beta1/cloudscheduler.proto - -require 'google/protobuf' - -require 'google/api/annotations_pb' -require 'google/api/client_pb' -require 'google/api/field_behavior_pb' -require 'google/api/resource_pb' -require 'google/cloud/scheduler/v1beta1/job_pb' -require 'google/protobuf/empty_pb' -require 'google/protobuf/field_mask_pb' - - -descriptor_data = "\n3google/cloud/scheduler/v1beta1/cloudscheduler.proto\x12\x1egoogle.cloud.scheduler.v1beta1\x1a\x1cgoogle/api/annotations.proto\x1a\x17google/api/client.proto\x1a\x1fgoogle/api/field_behavior.proto\x1a\x19google/api/resource.proto\x1a(google/cloud/scheduler/v1beta1/job.proto\x1a\x1bgoogle/protobuf/empty.proto\x1a google/protobuf/field_mask.proto\"\xa3\x01\n\x0fListJobsRequest\x12\x39\n\x06parent\x18\x01 \x01(\tB)\xe0\x41\x02\xfa\x41#\x12!cloudscheduler.googleapis.com/Job\x12\x0e\n\x06\x66ilter\x18\x04 \x01(\t\x12\x11\n\tpage_size\x18\x05 \x01(\x05\x12\x12\n\npage_token\x18\x06 \x01(\t\x12\x1e\n\x16legacy_app_engine_cron\x18\x07 \x01(\x08\"^\n\x10ListJobsResponse\x12\x31\n\x04jobs\x18\x01 \x03(\x0b\x32#.google.cloud.scheduler.v1beta1.Job\x12\x17\n\x0fnext_page_token\x18\x02 \x01(\t\"H\n\rGetJobRequest\x12\x37\n\x04name\x18\x01 \x01(\tB)\xe0\x41\x02\xfa\x41#\n!cloudscheduler.googleapis.com/Job\"\x84\x01\n\x10\x43reateJobRequest\x12\x39\n\x06parent\x18\x01 \x01(\tB)\xe0\x41\x02\xfa\x41#\x12!cloudscheduler.googleapis.com/Job\x12\x35\n\x03job\x18\x02 \x01(\x0b\x32#.google.cloud.scheduler.v1beta1.JobB\x03\xe0\x41\x02\"z\n\x10UpdateJobRequest\x12\x35\n\x03job\x18\x01 \x01(\x0b\x32#.google.cloud.scheduler.v1beta1.JobB\x03\xe0\x41\x02\x12/\n\x0bupdate_mask\x18\x02 \x01(\x0b\x32\x1a.google.protobuf.FieldMask\"k\n\x10\x44\x65leteJobRequest\x12\x37\n\x04name\x18\x01 \x01(\tB)\xe0\x41\x02\xfa\x41#\n!cloudscheduler.googleapis.com/Job\x12\x1e\n\x16legacy_app_engine_cron\x18\x02 \x01(\x08\"J\n\x0fPauseJobRequest\x12\x37\n\x04name\x18\x01 \x01(\tB)\xe0\x41\x02\xfa\x41#\n!cloudscheduler.googleapis.com/Job\"K\n\x10ResumeJobRequest\x12\x37\n\x04name\x18\x01 \x01(\tB)\xe0\x41\x02\xfa\x41#\n!cloudscheduler.googleapis.com/Job\"h\n\rRunJobRequest\x12\x37\n\x04name\x18\x01 \x01(\tB)\xe0\x41\x02\xfa\x41#\n!cloudscheduler.googleapis.com/Job\x12\x1e\n\x16legacy_app_engine_cron\x18\x02 \x01(\x08\x32\xa6\x0b\n\x0e\x43loudScheduler\x12\xad\x01\n\x08ListJobs\x12/.google.cloud.scheduler.v1beta1.ListJobsRequest\x1a\x30.google.cloud.scheduler.v1beta1.ListJobsResponse\">\xda\x41\x06parent\x82\xd3\xe4\x93\x02/\x12-/v1beta1/{parent=projects/*/locations/*}/jobs\x12\x9a\x01\n\x06GetJob\x12-.google.cloud.scheduler.v1beta1.GetJobRequest\x1a#.google.cloud.scheduler.v1beta1.Job\"<\xda\x41\x04name\x82\xd3\xe4\x93\x02/\x12-/v1beta1/{name=projects/*/locations/*/jobs/*}\x12\xab\x01\n\tCreateJob\x12\x30.google.cloud.scheduler.v1beta1.CreateJobRequest\x1a#.google.cloud.scheduler.v1beta1.Job\"G\xda\x41\nparent,job\x82\xd3\xe4\x93\x02\x34\"-/v1beta1/{parent=projects/*/locations/*}/jobs:\x03job\x12\xb4\x01\n\tUpdateJob\x12\x30.google.cloud.scheduler.v1beta1.UpdateJobRequest\x1a#.google.cloud.scheduler.v1beta1.Job\"P\xda\x41\x0fjob,update_mask\x82\xd3\xe4\x93\x02\x38\x32\x31/v1beta1/{job.name=projects/*/locations/*/jobs/*}:\x03job\x12\x93\x01\n\tDeleteJob\x12\x30.google.cloud.scheduler.v1beta1.DeleteJobRequest\x1a\x16.google.protobuf.Empty\"<\xda\x41\x04name\x82\xd3\xe4\x93\x02/*-/v1beta1/{name=projects/*/locations/*/jobs/*}\x12\xa7\x01\n\x08PauseJob\x12/.google.cloud.scheduler.v1beta1.PauseJobRequest\x1a#.google.cloud.scheduler.v1beta1.Job\"E\xda\x41\x04name\x82\xd3\xe4\x93\x02\x38\"3/v1beta1/{name=projects/*/locations/*/jobs/*}:pause:\x01*\x12\xaa\x01\n\tResumeJob\x12\x30.google.cloud.scheduler.v1beta1.ResumeJobRequest\x1a#.google.cloud.scheduler.v1beta1.Job\"F\xda\x41\x04name\x82\xd3\xe4\x93\x02\x39\"4/v1beta1/{name=projects/*/locations/*/jobs/*}:resume:\x01*\x12\xa1\x01\n\x06RunJob\x12-.google.cloud.scheduler.v1beta1.RunJobRequest\x1a#.google.cloud.scheduler.v1beta1.Job\"C\xda\x41\x04name\x82\xd3\xe4\x93\x02\x36\"1/v1beta1/{name=projects/*/locations/*/jobs/*}:run:\x01*\x1aQ\xca\x41\x1d\x63loudscheduler.googleapis.com\xd2\x41.https://www.googleapis.com/auth/cloud-platformB\x84\x01\n\"com.google.cloud.scheduler.v1beta1B\x0eSchedulerProtoP\x01Z@cloud.google.com/go/scheduler/apiv1beta1/schedulerpb;schedulerpb\xa2\x02\tSCHEDULERb\x06proto3" - -pool = ::Google::Protobuf::DescriptorPool.generated_pool -pool.add_serialized_file(descriptor_data) - -module Google - module Cloud - module Scheduler - module V1beta1 - ListJobsRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.scheduler.v1beta1.ListJobsRequest").msgclass - ListJobsResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.scheduler.v1beta1.ListJobsResponse").msgclass - GetJobRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.scheduler.v1beta1.GetJobRequest").msgclass - CreateJobRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.scheduler.v1beta1.CreateJobRequest").msgclass - UpdateJobRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.scheduler.v1beta1.UpdateJobRequest").msgclass - DeleteJobRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.scheduler.v1beta1.DeleteJobRequest").msgclass - PauseJobRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.scheduler.v1beta1.PauseJobRequest").msgclass - ResumeJobRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.scheduler.v1beta1.ResumeJobRequest").msgclass - RunJobRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.scheduler.v1beta1.RunJobRequest").msgclass - end - end - end -end diff --git a/owl-bot-staging/google-cloud-scheduler-v1beta1/lib/google/cloud/scheduler/v1beta1/cloudscheduler_services_pb.rb b/owl-bot-staging/google-cloud-scheduler-v1beta1/lib/google/cloud/scheduler/v1beta1/cloudscheduler_services_pb.rb deleted file mode 100644 index 776df3d89d4f..000000000000 --- a/owl-bot-staging/google-cloud-scheduler-v1beta1/lib/google/cloud/scheduler/v1beta1/cloudscheduler_services_pb.rb +++ /dev/null @@ -1,92 +0,0 @@ -# Generated by the protocol buffer compiler. DO NOT EDIT! -# Source: google/cloud/scheduler/v1beta1/cloudscheduler.proto for package 'google.cloud.scheduler.v1beta1' -# Original file comments: -# 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 -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. -# - -require 'grpc' -require 'google/cloud/scheduler/v1beta1/cloudscheduler_pb' - -module Google - module Cloud - module Scheduler - module V1beta1 - module CloudScheduler - # The Cloud Scheduler API allows external entities to reliably - # schedule asynchronous jobs. - class Service - - include ::GRPC::GenericService - - self.marshal_class_method = :encode - self.unmarshal_class_method = :decode - self.service_name = 'google.cloud.scheduler.v1beta1.CloudScheduler' - - # Lists jobs. - rpc :ListJobs, ::Google::Cloud::Scheduler::V1beta1::ListJobsRequest, ::Google::Cloud::Scheduler::V1beta1::ListJobsResponse - # Gets a job. - rpc :GetJob, ::Google::Cloud::Scheduler::V1beta1::GetJobRequest, ::Google::Cloud::Scheduler::V1beta1::Job - # Creates a job. - rpc :CreateJob, ::Google::Cloud::Scheduler::V1beta1::CreateJobRequest, ::Google::Cloud::Scheduler::V1beta1::Job - # Updates a job. - # - # If successful, the updated [Job][google.cloud.scheduler.v1beta1.Job] is - # returned. If the job does not exist, `NOT_FOUND` is returned. - # - # If UpdateJob does not successfully return, it is possible for the - # job to be in an - # [Job.State.UPDATE_FAILED][google.cloud.scheduler.v1beta1.Job.State.UPDATE_FAILED] - # state. A job in this state may not be executed. If this happens, retry the - # UpdateJob request until a successful response is received. - rpc :UpdateJob, ::Google::Cloud::Scheduler::V1beta1::UpdateJobRequest, ::Google::Cloud::Scheduler::V1beta1::Job - # Deletes a job. - rpc :DeleteJob, ::Google::Cloud::Scheduler::V1beta1::DeleteJobRequest, ::Google::Protobuf::Empty - # Pauses a job. - # - # If a job is paused then the system will stop executing the job - # until it is re-enabled via - # [ResumeJob][google.cloud.scheduler.v1beta1.CloudScheduler.ResumeJob]. The - # state of the job is stored in - # [state][google.cloud.scheduler.v1beta1.Job.state]; if paused it will be set - # to [Job.State.PAUSED][google.cloud.scheduler.v1beta1.Job.State.PAUSED]. A - # job must be in - # [Job.State.ENABLED][google.cloud.scheduler.v1beta1.Job.State.ENABLED] to be - # paused. - rpc :PauseJob, ::Google::Cloud::Scheduler::V1beta1::PauseJobRequest, ::Google::Cloud::Scheduler::V1beta1::Job - # Resume a job. - # - # This method reenables a job after it has been - # [Job.State.PAUSED][google.cloud.scheduler.v1beta1.Job.State.PAUSED]. The - # state of a job is stored in - # [Job.state][google.cloud.scheduler.v1beta1.Job.state]; after calling this - # method it will be set to - # [Job.State.ENABLED][google.cloud.scheduler.v1beta1.Job.State.ENABLED]. A - # job must be in - # [Job.State.PAUSED][google.cloud.scheduler.v1beta1.Job.State.PAUSED] to be - # resumed. - rpc :ResumeJob, ::Google::Cloud::Scheduler::V1beta1::ResumeJobRequest, ::Google::Cloud::Scheduler::V1beta1::Job - # Forces a job to run now. - # - # When this method is called, Cloud Scheduler will dispatch the job, even - # if the job is already running. - rpc :RunJob, ::Google::Cloud::Scheduler::V1beta1::RunJobRequest, ::Google::Cloud::Scheduler::V1beta1::Job - end - - Stub = Service.rpc_stub_class - end - end - end - end -end diff --git a/owl-bot-staging/google-cloud-scheduler-v1beta1/lib/google/cloud/scheduler/v1beta1/job_pb.rb b/owl-bot-staging/google-cloud-scheduler-v1beta1/lib/google/cloud/scheduler/v1beta1/job_pb.rb deleted file mode 100644 index 0eafd2e79d09..000000000000 --- a/owl-bot-staging/google-cloud-scheduler-v1beta1/lib/google/cloud/scheduler/v1beta1/job_pb.rb +++ /dev/null @@ -1,30 +0,0 @@ -# frozen_string_literal: true -# Generated by the protocol buffer compiler. DO NOT EDIT! -# source: google/cloud/scheduler/v1beta1/job.proto - -require 'google/protobuf' - -require 'google/api/field_behavior_pb' -require 'google/api/resource_pb' -require 'google/cloud/scheduler/v1beta1/target_pb' -require 'google/protobuf/duration_pb' -require 'google/protobuf/timestamp_pb' -require 'google/rpc/status_pb' - - -descriptor_data = "\n(google/cloud/scheduler/v1beta1/job.proto\x12\x1egoogle.cloud.scheduler.v1beta1\x1a\x1fgoogle/api/field_behavior.proto\x1a\x19google/api/resource.proto\x1a+google/cloud/scheduler/v1beta1/target.proto\x1a\x1egoogle/protobuf/duration.proto\x1a\x1fgoogle/protobuf/timestamp.proto\x1a\x17google/rpc/status.proto\"\x89\x07\n\x03Job\x12\x0c\n\x04name\x18\x01 \x01(\t\x12\x13\n\x0b\x64\x65scription\x18\x02 \x01(\t\x12\x45\n\rpubsub_target\x18\x04 \x01(\x0b\x32,.google.cloud.scheduler.v1beta1.PubsubTargetH\x00\x12U\n\x16\x61pp_engine_http_target\x18\x05 \x01(\x0b\x32\x33.google.cloud.scheduler.v1beta1.AppEngineHttpTargetH\x00\x12\x41\n\x0bhttp_target\x18\x06 \x01(\x0b\x32*.google.cloud.scheduler.v1beta1.HttpTargetH\x00\x12\x10\n\x08schedule\x18\x14 \x01(\t\x12\x11\n\ttime_zone\x18\x15 \x01(\t\x12\x34\n\x10user_update_time\x18\t \x01(\x0b\x32\x1a.google.protobuf.Timestamp\x12\x38\n\x05state\x18\n \x01(\x0e\x32).google.cloud.scheduler.v1beta1.Job.State\x12\"\n\x06status\x18\x0b \x01(\x0b\x32\x12.google.rpc.Status\x12\x31\n\rschedule_time\x18\x11 \x01(\x0b\x32\x1a.google.protobuf.Timestamp\x12\x35\n\x11last_attempt_time\x18\x12 \x01(\x0b\x32\x1a.google.protobuf.Timestamp\x12\x41\n\x0cretry_config\x18\x13 \x01(\x0b\x32+.google.cloud.scheduler.v1beta1.RetryConfig\x12\x33\n\x10\x61ttempt_deadline\x18\x16 \x01(\x0b\x32\x19.google.protobuf.Duration\x12#\n\x16legacy_app_engine_cron\x18\x17 \x01(\x08\x42\x03\xe0\x41\x05\"X\n\x05State\x12\x15\n\x11STATE_UNSPECIFIED\x10\x00\x12\x0b\n\x07\x45NABLED\x10\x01\x12\n\n\x06PAUSED\x10\x02\x12\x0c\n\x08\x44ISABLED\x10\x03\x12\x11\n\rUPDATE_FAILED\x10\x04:Z\xea\x41W\n!cloudscheduler.googleapis.com/Job\x12\x32projects/{project}/locations/{location}/jobs/{job}B\x08\n\x06target\"\xe2\x01\n\x0bRetryConfig\x12\x13\n\x0bretry_count\x18\x01 \x01(\x05\x12\x35\n\x12max_retry_duration\x18\x02 \x01(\x0b\x32\x19.google.protobuf.Duration\x12\x37\n\x14min_backoff_duration\x18\x03 \x01(\x0b\x32\x19.google.protobuf.Duration\x12\x37\n\x14max_backoff_duration\x18\x04 \x01(\x0b\x32\x19.google.protobuf.Duration\x12\x15\n\rmax_doublings\x18\x05 \x01(\x05\x42r\n\"com.google.cloud.scheduler.v1beta1B\x08JobProtoP\x01Z@cloud.google.com/go/scheduler/apiv1beta1/schedulerpb;schedulerpbb\x06proto3" - -pool = ::Google::Protobuf::DescriptorPool.generated_pool -pool.add_serialized_file(descriptor_data) - -module Google - module Cloud - module Scheduler - module V1beta1 - Job = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.scheduler.v1beta1.Job").msgclass - Job::State = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.scheduler.v1beta1.Job.State").enummodule - RetryConfig = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.scheduler.v1beta1.RetryConfig").msgclass - end - end - end -end diff --git a/owl-bot-staging/google-cloud-scheduler-v1beta1/lib/google/cloud/scheduler/v1beta1/rest.rb b/owl-bot-staging/google-cloud-scheduler-v1beta1/lib/google/cloud/scheduler/v1beta1/rest.rb deleted file mode 100644 index 70df3be7ef52..000000000000 --- a/owl-bot-staging/google-cloud-scheduler-v1beta1/lib/google/cloud/scheduler/v1beta1/rest.rb +++ /dev/null @@ -1,38 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -require "google/cloud/scheduler/v1beta1/cloud_scheduler/rest" -require "google/cloud/scheduler/v1beta1/bindings_override" -require "google/cloud/scheduler/v1beta1/version" - -module Google - module Cloud - module Scheduler - ## - # To load just the REST part of this package, including all its services, and instantiate a REST client: - # - # @example - # - # require "google/cloud/scheduler/v1beta1/rest" - # client = ::Google::Cloud::Scheduler::V1beta1::CloudScheduler::Rest::Client.new - # - module V1beta1 - end - end - end -end diff --git a/owl-bot-staging/google-cloud-scheduler-v1beta1/lib/google/cloud/scheduler/v1beta1/target_pb.rb b/owl-bot-staging/google-cloud-scheduler-v1beta1/lib/google/cloud/scheduler/v1beta1/target_pb.rb deleted file mode 100644 index 35e628e0c5e1..000000000000 --- a/owl-bot-staging/google-cloud-scheduler-v1beta1/lib/google/cloud/scheduler/v1beta1/target_pb.rb +++ /dev/null @@ -1,29 +0,0 @@ -# frozen_string_literal: true -# Generated by the protocol buffer compiler. DO NOT EDIT! -# source: google/cloud/scheduler/v1beta1/target.proto - -require 'google/protobuf' - -require 'google/api/resource_pb' - - -descriptor_data = "\n+google/cloud/scheduler/v1beta1/target.proto\x12\x1egoogle.cloud.scheduler.v1beta1\x1a\x19google/api/resource.proto\"\xfe\x02\n\nHttpTarget\x12\x0b\n\x03uri\x18\x01 \x01(\t\x12?\n\x0bhttp_method\x18\x02 \x01(\x0e\x32*.google.cloud.scheduler.v1beta1.HttpMethod\x12H\n\x07headers\x18\x03 \x03(\x0b\x32\x37.google.cloud.scheduler.v1beta1.HttpTarget.HeadersEntry\x12\x0c\n\x04\x62ody\x18\x04 \x01(\x0c\x12\x41\n\x0boauth_token\x18\x05 \x01(\x0b\x32*.google.cloud.scheduler.v1beta1.OAuthTokenH\x00\x12?\n\noidc_token\x18\x06 \x01(\x0b\x32).google.cloud.scheduler.v1beta1.OidcTokenH\x00\x1a.\n\x0cHeadersEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12\r\n\x05value\x18\x02 \x01(\t:\x02\x38\x01\x42\x16\n\x14\x61uthorization_header\"\xcb\x02\n\x13\x41ppEngineHttpTarget\x12?\n\x0bhttp_method\x18\x01 \x01(\x0e\x32*.google.cloud.scheduler.v1beta1.HttpMethod\x12L\n\x12\x61pp_engine_routing\x18\x02 \x01(\x0b\x32\x30.google.cloud.scheduler.v1beta1.AppEngineRouting\x12\x14\n\x0crelative_uri\x18\x03 \x01(\t\x12Q\n\x07headers\x18\x04 \x03(\x0b\x32@.google.cloud.scheduler.v1beta1.AppEngineHttpTarget.HeadersEntry\x12\x0c\n\x04\x62ody\x18\x05 \x01(\x0c\x1a.\n\x0cHeadersEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12\r\n\x05value\x18\x02 \x01(\t:\x02\x38\x01\"\xd7\x01\n\x0cPubsubTarget\x12\x34\n\ntopic_name\x18\x01 \x01(\tB \xfa\x41\x1d\n\x1bpubsub.googleapis.com/Topic\x12\x0c\n\x04\x64\x61ta\x18\x03 \x01(\x0c\x12P\n\nattributes\x18\x04 \x03(\x0b\x32<.google.cloud.scheduler.v1beta1.PubsubTarget.AttributesEntry\x1a\x31\n\x0f\x41ttributesEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12\r\n\x05value\x18\x02 \x01(\t:\x02\x38\x01\"T\n\x10\x41ppEngineRouting\x12\x0f\n\x07service\x18\x01 \x01(\t\x12\x0f\n\x07version\x18\x02 \x01(\t\x12\x10\n\x08instance\x18\x03 \x01(\t\x12\x0c\n\x04host\x18\x04 \x01(\t\":\n\nOAuthToken\x12\x1d\n\x15service_account_email\x18\x01 \x01(\t\x12\r\n\x05scope\x18\x02 \x01(\t\"<\n\tOidcToken\x12\x1d\n\x15service_account_email\x18\x01 \x01(\t\x12\x10\n\x08\x61udience\x18\x02 \x01(\t*s\n\nHttpMethod\x12\x1b\n\x17HTTP_METHOD_UNSPECIFIED\x10\x00\x12\x08\n\x04POST\x10\x01\x12\x07\n\x03GET\x10\x02\x12\x08\n\x04HEAD\x10\x03\x12\x07\n\x03PUT\x10\x04\x12\n\n\x06\x44\x45LETE\x10\x05\x12\t\n\x05PATCH\x10\x06\x12\x0b\n\x07OPTIONS\x10\x07\x42\xb8\x01\n\"com.google.cloud.scheduler.v1beta1B\x0bTargetProtoP\x01Z@cloud.google.com/go/scheduler/apiv1beta1/schedulerpb;schedulerpb\xea\x41@\n\x1bpubsub.googleapis.com/Topic\x12!projects/{project}/topics/{topic}b\x06proto3" - -pool = ::Google::Protobuf::DescriptorPool.generated_pool -pool.add_serialized_file(descriptor_data) - -module Google - module Cloud - module Scheduler - module V1beta1 - HttpTarget = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.scheduler.v1beta1.HttpTarget").msgclass - AppEngineHttpTarget = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.scheduler.v1beta1.AppEngineHttpTarget").msgclass - PubsubTarget = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.scheduler.v1beta1.PubsubTarget").msgclass - AppEngineRouting = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.scheduler.v1beta1.AppEngineRouting").msgclass - OAuthToken = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.scheduler.v1beta1.OAuthToken").msgclass - OidcToken = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.scheduler.v1beta1.OidcToken").msgclass - HttpMethod = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.scheduler.v1beta1.HttpMethod").enummodule - end - end - end -end diff --git a/owl-bot-staging/google-cloud-scheduler-v1beta1/lib/google/cloud/scheduler/v1beta1/version.rb b/owl-bot-staging/google-cloud-scheduler-v1beta1/lib/google/cloud/scheduler/v1beta1/version.rb deleted file mode 100644 index 77a010d3732f..000000000000 --- a/owl-bot-staging/google-cloud-scheduler-v1beta1/lib/google/cloud/scheduler/v1beta1/version.rb +++ /dev/null @@ -1,28 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - - -module Google - module Cloud - module Scheduler - module V1beta1 - VERSION = "0.0.1" - end - end - end -end diff --git a/owl-bot-staging/google-cloud-scheduler-v1beta1/proto_docs/README.md b/owl-bot-staging/google-cloud-scheduler-v1beta1/proto_docs/README.md deleted file mode 100644 index f0fc6932b5fd..000000000000 --- a/owl-bot-staging/google-cloud-scheduler-v1beta1/proto_docs/README.md +++ /dev/null @@ -1,4 +0,0 @@ -# Cloud Scheduler V1beta1 Protocol Buffer Documentation - -These files are for the YARD documentation of the generated protobuf files. -They are not intended to be required or loaded at runtime. diff --git a/owl-bot-staging/google-cloud-scheduler-v1beta1/proto_docs/google/api/client.rb b/owl-bot-staging/google-cloud-scheduler-v1beta1/proto_docs/google/api/client.rb deleted file mode 100644 index 5089551e9ea4..000000000000 --- a/owl-bot-staging/google-cloud-scheduler-v1beta1/proto_docs/google/api/client.rb +++ /dev/null @@ -1,589 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - - -module Google - module Api - # Required information for every language. - # @!attribute [rw] reference_docs_uri - # @deprecated This field is deprecated and may be removed in the next major version update. - # @return [::String] - # Link to automatically generated reference documentation. Example: - # https://cloud.google.com/nodejs/docs/reference/asset/latest - # @!attribute [rw] destinations - # @return [::Array<::Google::Api::ClientLibraryDestination>] - # The destination where API teams want this client library to be published. - # @!attribute [rw] selective_gapic_generation - # @return [::Google::Api::SelectiveGapicGeneration] - # Configuration for which RPCs should be generated in the GAPIC client. - class CommonLanguageSettings - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Details about how and where to publish client libraries. - # @!attribute [rw] version - # @return [::String] - # Version of the API to apply these settings to. This is the full protobuf - # package for the API, ending in the version element. - # Examples: "google.cloud.speech.v1" and "google.spanner.admin.database.v1". - # @!attribute [rw] launch_stage - # @return [::Google::Api::LaunchStage] - # Launch stage of this version of the API. - # @!attribute [rw] rest_numeric_enums - # @return [::Boolean] - # When using transport=rest, the client request will encode enums as - # numbers rather than strings. - # @!attribute [rw] java_settings - # @return [::Google::Api::JavaSettings] - # Settings for legacy Java features, supported in the Service YAML. - # @!attribute [rw] cpp_settings - # @return [::Google::Api::CppSettings] - # Settings for C++ client libraries. - # @!attribute [rw] php_settings - # @return [::Google::Api::PhpSettings] - # Settings for PHP client libraries. - # @!attribute [rw] python_settings - # @return [::Google::Api::PythonSettings] - # Settings for Python client libraries. - # @!attribute [rw] node_settings - # @return [::Google::Api::NodeSettings] - # Settings for Node client libraries. - # @!attribute [rw] dotnet_settings - # @return [::Google::Api::DotnetSettings] - # Settings for .NET client libraries. - # @!attribute [rw] ruby_settings - # @return [::Google::Api::RubySettings] - # Settings for Ruby client libraries. - # @!attribute [rw] go_settings - # @return [::Google::Api::GoSettings] - # Settings for Go client libraries. - class ClientLibrarySettings - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # This message configures the settings for publishing [Google Cloud Client - # libraries](https://cloud.google.com/apis/docs/cloud-client-libraries) - # generated from the service config. - # @!attribute [rw] method_settings - # @return [::Array<::Google::Api::MethodSettings>] - # A list of API method settings, e.g. the behavior for methods that use the - # long-running operation pattern. - # @!attribute [rw] new_issue_uri - # @return [::String] - # Link to a *public* URI where users can report issues. Example: - # https://issuetracker.google.com/issues/new?component=190865&template=1161103 - # @!attribute [rw] documentation_uri - # @return [::String] - # Link to product home page. Example: - # https://cloud.google.com/asset-inventory/docs/overview - # @!attribute [rw] api_short_name - # @return [::String] - # Used as a tracking tag when collecting data about the APIs developer - # relations artifacts like docs, packages delivered to package managers, - # etc. Example: "speech". - # @!attribute [rw] github_label - # @return [::String] - # GitHub label to apply to issues and pull requests opened for this API. - # @!attribute [rw] codeowner_github_teams - # @return [::Array<::String>] - # GitHub teams to be added to CODEOWNERS in the directory in GitHub - # containing source code for the client libraries for this API. - # @!attribute [rw] doc_tag_prefix - # @return [::String] - # A prefix used in sample code when demarking regions to be included in - # documentation. - # @!attribute [rw] organization - # @return [::Google::Api::ClientLibraryOrganization] - # For whom the client library is being published. - # @!attribute [rw] library_settings - # @return [::Array<::Google::Api::ClientLibrarySettings>] - # Client library settings. If the same version string appears multiple - # times in this list, then the last one wins. Settings from earlier - # settings with the same version string are discarded. - # @!attribute [rw] proto_reference_documentation_uri - # @return [::String] - # Optional link to proto reference documentation. Example: - # https://cloud.google.com/pubsub/lite/docs/reference/rpc - # @!attribute [rw] rest_reference_documentation_uri - # @return [::String] - # Optional link to REST reference documentation. Example: - # https://cloud.google.com/pubsub/lite/docs/reference/rest - class Publishing - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Settings for Java client libraries. - # @!attribute [rw] library_package - # @return [::String] - # The package name to use in Java. Clobbers the java_package option - # set in the protobuf. This should be used **only** by APIs - # who have already set the language_settings.java.package_name" field - # in gapic.yaml. API teams should use the protobuf java_package option - # where possible. - # - # Example of a YAML configuration:: - # - # publishing: - # 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. - # @!attribute [rw] methods - # @return [::Array<::String>] - # An allowlist of the fully qualified names of RPCs that should be included - # on public client surfaces. - # @!attribute [rw] generate_omitted_as_internal - # @return [::Boolean] - # Setting this to true indicates to the client generators that methods - # that would be excluded from the generation should instead be generated - # in a way that indicates these methods should not be consumed by - # end users. How this is expressed is up to individual language - # implementations to decide. Some examples may be: added annotations, - # obfuscated identifiers, or other language idiomatic patterns. - class SelectiveGapicGeneration - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # `BatchingConfigProto` defines the batching configuration for an API method. - # @!attribute [rw] thresholds - # @return [::Google::Api::BatchingSettingsProto] - # The thresholds which trigger a batched request to be sent. - # @!attribute [rw] batch_descriptor - # @return [::Google::Api::BatchingDescriptorProto] - # The request and response fields used in batching. - class BatchingConfigProto - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # `BatchingSettingsProto` specifies a set of batching thresholds, each of - # which acts as a trigger to send a batch of messages as a request. At least - # one threshold must be positive nonzero. - # @!attribute [rw] element_count_threshold - # @return [::Integer] - # The number of elements of a field collected into a batch which, if - # exceeded, causes the batch to be sent. - # @!attribute [rw] request_byte_threshold - # @return [::Integer] - # The aggregated size of the batched field which, if exceeded, causes the - # batch to be sent. This size is computed by aggregating the sizes of the - # request field to be batched, not of the entire request message. - # @!attribute [rw] delay_threshold - # @return [::Google::Protobuf::Duration] - # The duration after which a batch should be sent, starting from the addition - # of the first message to that batch. - # @!attribute [rw] element_count_limit - # @return [::Integer] - # The maximum number of elements collected in a batch that could be accepted - # by server. - # @!attribute [rw] request_byte_limit - # @return [::Integer] - # The maximum size of the request that could be accepted by server. - # @!attribute [rw] flow_control_element_limit - # @return [::Integer] - # The maximum number of elements allowed by flow control. - # @!attribute [rw] flow_control_byte_limit - # @return [::Integer] - # The maximum size of data allowed by flow control. - # @!attribute [rw] flow_control_limit_exceeded_behavior - # @return [::Google::Api::FlowControlLimitExceededBehaviorProto] - # The behavior to take when the flow control limit is exceeded. - class BatchingSettingsProto - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # `BatchingDescriptorProto` specifies the fields of the request message to be - # used for batching, and, optionally, the fields of the response message to be - # used for demultiplexing. - # @!attribute [rw] batched_field - # @return [::String] - # The repeated field in the request message to be aggregated by batching. - # @!attribute [rw] discriminator_fields - # @return [::Array<::String>] - # A list of the fields in the request message. Two requests will be batched - # together only if the values of every field specified in - # `request_discriminator_fields` is equal between the two requests. - # @!attribute [rw] subresponse_field - # @return [::String] - # Optional. When present, indicates the field in the response message to be - # used to demultiplex the response into multiple response messages, in - # correspondence with the multiple request messages originally batched - # together. - class BatchingDescriptorProto - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # The organization for which the client libraries are being published. - # Affects the url where generated docs are published, etc. - module ClientLibraryOrganization - # Not useful. - CLIENT_LIBRARY_ORGANIZATION_UNSPECIFIED = 0 - - # Google Cloud Platform Org. - CLOUD = 1 - - # Ads (Advertising) Org. - ADS = 2 - - # Photos Org. - PHOTOS = 3 - - # Street View Org. - STREET_VIEW = 4 - - # Shopping Org. - SHOPPING = 5 - - # Geo Org. - GEO = 6 - - # Generative AI - https://developers.generativeai.google - GENERATIVE_AI = 7 - end - - # To where should client libraries be published? - module ClientLibraryDestination - # Client libraries will neither be generated nor published to package - # managers. - CLIENT_LIBRARY_DESTINATION_UNSPECIFIED = 0 - - # Generate the client library in a repo under github.com/googleapis, - # but don't publish it to package managers. - GITHUB = 10 - - # Publish the library to package managers like nuget.org and npmjs.com. - PACKAGE_MANAGER = 20 - end - - # The behavior to take when the flow control limit is exceeded. - module FlowControlLimitExceededBehaviorProto - # Default behavior, system-defined. - UNSET_BEHAVIOR = 0 - - # Stop operation, raise error. - THROW_EXCEPTION = 1 - - # Pause operation until limit clears. - BLOCK = 2 - - # Continue operation, disregard limit. - IGNORE = 3 - end - end -end diff --git a/owl-bot-staging/google-cloud-scheduler-v1beta1/proto_docs/google/api/field_behavior.rb b/owl-bot-staging/google-cloud-scheduler-v1beta1/proto_docs/google/api/field_behavior.rb deleted file mode 100644 index 582be187d115..000000000000 --- a/owl-bot-staging/google-cloud-scheduler-v1beta1/proto_docs/google/api/field_behavior.rb +++ /dev/null @@ -1,85 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - - -module Google - module Api - # An indicator of the behavior of a given field (for example, that a field - # is required in requests, or given as output but ignored as input). - # This **does not** change the behavior in protocol buffers itself; it only - # denotes the behavior and may affect how API tooling handles the field. - # - # Note: This enum **may** receive new values in the future. - module FieldBehavior - # Conventional default for enums. Do not use this. - FIELD_BEHAVIOR_UNSPECIFIED = 0 - - # Specifically denotes a field as optional. - # While all fields in protocol buffers are optional, this may be specified - # for emphasis if appropriate. - OPTIONAL = 1 - - # Denotes a field as required. - # This indicates that the field **must** be provided as part of the request, - # and failure to do so will cause an error (usually `INVALID_ARGUMENT`). - REQUIRED = 2 - - # Denotes a field as output only. - # This indicates that the field is provided in responses, but including the - # field in a request does nothing (the server *must* ignore it and - # *must not* throw an error as a result of the field's presence). - OUTPUT_ONLY = 3 - - # Denotes a field as input only. - # This indicates that the field is provided in requests, and the - # corresponding field is not included in output. - INPUT_ONLY = 4 - - # Denotes a field as immutable. - # This indicates that the field may be set once in a request to create a - # resource, but may not be changed thereafter. - IMMUTABLE = 5 - - # Denotes that a (repeated) field is an unordered list. - # This indicates that the service may provide the elements of the list - # in any arbitrary order, rather than the order the user originally - # provided. Additionally, the list's order may or may not be stable. - UNORDERED_LIST = 6 - - # Denotes that this field returns a non-empty default value if not set. - # This indicates that if the user provides the empty value in a request, - # a non-empty value will be returned. The user will not be aware of what - # non-empty value to expect. - NON_EMPTY_DEFAULT = 7 - - # Denotes that the field in a resource (a message annotated with - # google.api.resource) is used in the resource name to uniquely identify the - # resource. For AIP-compliant APIs, this should only be applied to the - # `name` field on the resource. - # - # This behavior should not be applied to references to other resources within - # the message. - # - # The identifier field of resources often have different field behavior - # depending on the request it is embedded in (e.g. for Create methods name - # is optional and unused, while for Update methods it is required). Instead - # of method-specific annotations, only `IDENTIFIER` is required. - IDENTIFIER = 8 - end - end -end diff --git a/owl-bot-staging/google-cloud-scheduler-v1beta1/proto_docs/google/api/launch_stage.rb b/owl-bot-staging/google-cloud-scheduler-v1beta1/proto_docs/google/api/launch_stage.rb deleted file mode 100644 index 9392a413fb1b..000000000000 --- a/owl-bot-staging/google-cloud-scheduler-v1beta1/proto_docs/google/api/launch_stage.rb +++ /dev/null @@ -1,71 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - - -module Google - module Api - # The launch stage as defined by [Google Cloud Platform - # Launch Stages](https://cloud.google.com/terms/launch-stages). - module LaunchStage - # Do not use this default value. - LAUNCH_STAGE_UNSPECIFIED = 0 - - # The feature is not yet implemented. Users can not use it. - UNIMPLEMENTED = 6 - - # Prelaunch features are hidden from users and are only visible internally. - PRELAUNCH = 7 - - # Early Access features are limited to a closed group of testers. To use - # these features, you must sign up in advance and sign a Trusted Tester - # agreement (which includes confidentiality provisions). These features may - # be unstable, changed in backward-incompatible ways, and are not - # guaranteed to be released. - EARLY_ACCESS = 1 - - # Alpha is a limited availability test for releases before they are cleared - # for widespread use. By Alpha, all significant design issues are resolved - # and we are in the process of verifying functionality. Alpha customers - # need to apply for access, agree to applicable terms, and have their - # projects allowlisted. Alpha releases don't have to be feature complete, - # no SLAs are provided, and there are no technical support obligations, but - # they will be far enough along that customers can actually use them in - # test environments or for limited-use tests -- just like they would in - # normal production cases. - ALPHA = 2 - - # Beta is the point at which we are ready to open a release for any - # customer to use. There are no SLA or technical support obligations in a - # Beta release. Products will be complete from a feature perspective, but - # may have some open outstanding issues. Beta releases are suitable for - # limited production use cases. - BETA = 3 - - # GA features are open to all developers and are considered stable and - # fully qualified for production use. - GA = 4 - - # Deprecated features are scheduled to be shut down and removed. For more - # information, see the "Deprecation Policy" section of our [Terms of - # Service](https://cloud.google.com/terms/) - # and the [Google Cloud Platform Subject to the Deprecation - # Policy](https://cloud.google.com/terms/deprecation) documentation. - DEPRECATED = 5 - end - end -end diff --git a/owl-bot-staging/google-cloud-scheduler-v1beta1/proto_docs/google/api/resource.rb b/owl-bot-staging/google-cloud-scheduler-v1beta1/proto_docs/google/api/resource.rb deleted file mode 100644 index 25dec4847ac1..000000000000 --- a/owl-bot-staging/google-cloud-scheduler-v1beta1/proto_docs/google/api/resource.rb +++ /dev/null @@ -1,227 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - - -module Google - module Api - # A simple descriptor of a resource type. - # - # ResourceDescriptor annotates a resource message (either by means of a - # protobuf annotation or use in the service config), and associates the - # resource's schema, the resource type, and the pattern of the resource name. - # - # Example: - # - # message Topic { - # // Indicates this message defines a resource schema. - # // Declares the resource type in the format of {service}/{kind}. - # // For Kubernetes resources, the format is {api group}/{kind}. - # option (google.api.resource) = { - # type: "pubsub.googleapis.com/Topic" - # pattern: "projects/{project}/topics/{topic}" - # }; - # } - # - # The ResourceDescriptor Yaml config will look like: - # - # resources: - # - type: "pubsub.googleapis.com/Topic" - # pattern: "projects/{project}/topics/{topic}" - # - # Sometimes, resources have multiple patterns, typically because they can - # live under multiple parents. - # - # Example: - # - # message LogEntry { - # option (google.api.resource) = { - # type: "logging.googleapis.com/LogEntry" - # pattern: "projects/{project}/logs/{log}" - # pattern: "folders/{folder}/logs/{log}" - # pattern: "organizations/{organization}/logs/{log}" - # pattern: "billingAccounts/{billing_account}/logs/{log}" - # }; - # } - # - # The ResourceDescriptor Yaml config will look like: - # - # resources: - # - type: 'logging.googleapis.com/LogEntry' - # pattern: "projects/{project}/logs/{log}" - # pattern: "folders/{folder}/logs/{log}" - # pattern: "organizations/{organization}/logs/{log}" - # pattern: "billingAccounts/{billing_account}/logs/{log}" - # @!attribute [rw] type - # @return [::String] - # The resource type. It must be in the format of - # \\{service_name}/\\{resource_type_kind}. The `resource_type_kind` must be - # singular and must not include version numbers. - # - # Example: `storage.googleapis.com/Bucket` - # - # The value of the resource_type_kind must follow the regular expression - # /[A-Za-z][a-zA-Z0-9]+/. It should start with an upper case character and - # should use PascalCase (UpperCamelCase). The maximum number of - # characters allowed for the `resource_type_kind` is 100. - # @!attribute [rw] pattern - # @return [::Array<::String>] - # Optional. The relative resource name pattern associated with this resource - # type. The DNS prefix of the full resource name shouldn't be specified here. - # - # The path pattern must follow the syntax, which aligns with HTTP binding - # syntax: - # - # Template = Segment { "/" Segment } ; - # Segment = LITERAL | Variable ; - # Variable = "{" LITERAL "}" ; - # - # Examples: - # - # - "projects/\\{project}/topics/\\{topic}" - # - "projects/\\{project}/knowledgeBases/\\{knowledge_base}" - # - # The components in braces correspond to the IDs for each resource in the - # hierarchy. It is expected that, if multiple patterns are provided, - # the same component name (e.g. "project") refers to IDs of the same - # type of resource. - # @!attribute [rw] name_field - # @return [::String] - # Optional. The field on the resource that designates the resource name - # field. If omitted, this is assumed to be "name". - # @!attribute [rw] history - # @return [::Google::Api::ResourceDescriptor::History] - # Optional. The historical or future-looking state of the resource pattern. - # - # Example: - # - # // The InspectTemplate message originally only supported resource - # // names with organization, and project was added later. - # message InspectTemplate { - # option (google.api.resource) = { - # type: "dlp.googleapis.com/InspectTemplate" - # pattern: - # "organizations/{organization}/inspectTemplates/{inspect_template}" - # pattern: "projects/{project}/inspectTemplates/{inspect_template}" - # history: ORIGINALLY_SINGLE_PATTERN - # }; - # } - # @!attribute [rw] plural - # @return [::String] - # The plural name used in the resource name and permission names, such as - # 'projects' for the resource name of 'projects/\\{project}' and the permission - # name of 'cloudresourcemanager.googleapis.com/projects.get'. One exception - # to this is for Nested Collections that have stuttering names, as defined - # in [AIP-122](https://google.aip.dev/122#nested-collections), where the - # collection ID in the resource name pattern does not necessarily directly - # match the `plural` value. - # - # It is the same concept of the `plural` field in k8s CRD spec - # https://kubernetes.io/docs/tasks/access-kubernetes-api/custom-resources/custom-resource-definitions/ - # - # Note: The plural form is required even for singleton resources. See - # https://aip.dev/156 - # @!attribute [rw] singular - # @return [::String] - # The same concept of the `singular` field in k8s CRD spec - # https://kubernetes.io/docs/tasks/access-kubernetes-api/custom-resources/custom-resource-definitions/ - # Such as "project" for the `resourcemanager.googleapis.com/Project` type. - # @!attribute [rw] style - # @return [::Array<::Google::Api::ResourceDescriptor::Style>] - # Style flag(s) for this resource. - # These indicate that a resource is expected to conform to a given - # style. See the specific style flags for additional information. - class ResourceDescriptor - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - - # A description of the historical or future-looking state of the - # resource pattern. - module History - # The "unset" value. - HISTORY_UNSPECIFIED = 0 - - # The resource originally had one pattern and launched as such, and - # additional patterns were added later. - ORIGINALLY_SINGLE_PATTERN = 1 - - # The resource has one pattern, but the API owner expects to add more - # later. (This is the inverse of ORIGINALLY_SINGLE_PATTERN, and prevents - # that from being necessary once there are multiple patterns.) - FUTURE_MULTI_PATTERN = 2 - end - - # A flag representing a specific style that a resource claims to conform to. - module Style - # The unspecified value. Do not use. - STYLE_UNSPECIFIED = 0 - - # This resource is intended to be "declarative-friendly". - # - # Declarative-friendly resources must be more strictly consistent, and - # setting this to true communicates to tools that this resource should - # adhere to declarative-friendly expectations. - # - # Note: This is used by the API linter (linter.aip.dev) to enable - # additional checks. - DECLARATIVE_FRIENDLY = 1 - end - end - - # Defines a proto annotation that describes a string field that refers to - # an API resource. - # @!attribute [rw] type - # @return [::String] - # The resource type that the annotated field references. - # - # Example: - # - # message Subscription { - # string topic = 2 [(google.api.resource_reference) = { - # type: "pubsub.googleapis.com/Topic" - # }]; - # } - # - # Occasionally, a field may reference an arbitrary resource. In this case, - # APIs use the special value * in their resource reference. - # - # Example: - # - # message GetIamPolicyRequest { - # string resource = 2 [(google.api.resource_reference) = { - # type: "*" - # }]; - # } - # @!attribute [rw] child_type - # @return [::String] - # The resource type of a child collection that the annotated field - # references. This is useful for annotating the `parent` field that - # doesn't have a fixed resource type. - # - # Example: - # - # message ListLogEntriesRequest { - # string parent = 1 [(google.api.resource_reference) = { - # child_type: "logging.googleapis.com/LogEntry" - # }; - # } - class ResourceReference - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - end -end diff --git a/owl-bot-staging/google-cloud-scheduler-v1beta1/proto_docs/google/cloud/scheduler/v1beta1/cloudscheduler.rb b/owl-bot-staging/google-cloud-scheduler-v1beta1/proto_docs/google/cloud/scheduler/v1beta1/cloudscheduler.rb deleted file mode 100644 index 7265aa876409..000000000000 --- a/owl-bot-staging/google-cloud-scheduler-v1beta1/proto_docs/google/cloud/scheduler/v1beta1/cloudscheduler.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 Cloud - module Scheduler - module V1beta1 - # Request message for listing jobs using - # {::Google::Cloud::Scheduler::V1beta1::CloudScheduler::Client#list_jobs ListJobs}. - # @!attribute [rw] parent - # @return [::String] - # Required. The location name. For example: - # `projects/PROJECT_ID/locations/LOCATION_ID`. - # @!attribute [rw] filter - # @return [::String] - # `filter` can be used to specify a subset of jobs. - # - # If `filter` equals `target_config="HttpConfig"`, then the http - # target jobs are retrieved. If `filter` equals - # `target_config="PubSubConfig"`, then the Pub/Sub target jobs are - # retrieved. If `filter` equals `labels.foo=value1 - # labels.foo=value2` then only jobs which are labeled with - # foo=value1 AND foo=value2 will be returned. - # @!attribute [rw] page_size - # @return [::Integer] - # Requested page size. - # - # The maximum page size is 500. If unspecified, the page size will - # be the maximum. Fewer jobs than requested might be returned, - # even if more jobs exist; use next_page_token to determine if more - # jobs exist. - # @!attribute [rw] page_token - # @return [::String] - # A token identifying a page of results the server will return. To - # request the first page results, page_token must be empty. To - # request the next page of results, page_token must be the value of - # {::Google::Cloud::Scheduler::V1beta1::ListJobsResponse#next_page_token next_page_token} - # returned from the previous call to - # {::Google::Cloud::Scheduler::V1beta1::CloudScheduler::Client#list_jobs ListJobs}. It is - # an error to switch the value of - # {::Google::Cloud::Scheduler::V1beta1::ListJobsRequest#filter filter} or - # [order_by][google.cloud.scheduler.v1beta1.ListJobsRequest.order_by] while - # iterating through pages. - # @!attribute [rw] legacy_app_engine_cron - # @return [::Boolean] - # This field is used to manage the legacy App Engine Cron jobs using the - # Cloud Scheduler API. If the field is set to true, the jobs in the __cron - # queue will be listed instead. - class ListJobsRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Response message for listing jobs using - # {::Google::Cloud::Scheduler::V1beta1::CloudScheduler::Client#list_jobs ListJobs}. - # @!attribute [rw] jobs - # @return [::Array<::Google::Cloud::Scheduler::V1beta1::Job>] - # The list of jobs. - # @!attribute [rw] next_page_token - # @return [::String] - # A token to retrieve next page of results. Pass this value in the - # {::Google::Cloud::Scheduler::V1beta1::ListJobsRequest#page_token page_token} - # field in the subsequent call to - # {::Google::Cloud::Scheduler::V1beta1::CloudScheduler::Client#list_jobs ListJobs} to - # retrieve the next page of results. If this is empty it indicates that there - # are no more results through which to paginate. - # - # The page token is valid for only 2 hours. - class ListJobsResponse - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Request message for - # {::Google::Cloud::Scheduler::V1beta1::CloudScheduler::Client#get_job GetJob}. - # @!attribute [rw] name - # @return [::String] - # Required. The job name. For example: - # `projects/PROJECT_ID/locations/LOCATION_ID/jobs/JOB_ID`. - class GetJobRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Request message for - # {::Google::Cloud::Scheduler::V1beta1::CloudScheduler::Client#create_job CreateJob}. - # @!attribute [rw] parent - # @return [::String] - # Required. The location name. For example: - # `projects/PROJECT_ID/locations/LOCATION_ID`. - # @!attribute [rw] job - # @return [::Google::Cloud::Scheduler::V1beta1::Job] - # Required. The job to add. The user can optionally specify a name for the - # job in {::Google::Cloud::Scheduler::V1beta1::Job#name name}. - # {::Google::Cloud::Scheduler::V1beta1::Job#name name} cannot be the same as an - # existing job. If a name is not specified then the system will - # generate a random unique name that will be returned - # ({::Google::Cloud::Scheduler::V1beta1::Job#name name}) in the response. - class CreateJobRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Request message for - # {::Google::Cloud::Scheduler::V1beta1::CloudScheduler::Client#update_job UpdateJob}. - # @!attribute [rw] job - # @return [::Google::Cloud::Scheduler::V1beta1::Job] - # Required. The new job properties. - # {::Google::Cloud::Scheduler::V1beta1::Job#name name} must be specified. - # - # Output only fields cannot be modified using UpdateJob. - # Any value specified for an output only field will be ignored. - # @!attribute [rw] update_mask - # @return [::Google::Protobuf::FieldMask] - # A mask used to specify which fields of the job are being updated. - class UpdateJobRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Request message for deleting a job using - # {::Google::Cloud::Scheduler::V1beta1::CloudScheduler::Client#delete_job DeleteJob}. - # @!attribute [rw] name - # @return [::String] - # Required. The job name. For example: - # `projects/PROJECT_ID/locations/LOCATION_ID/jobs/JOB_ID`. - # @!attribute [rw] legacy_app_engine_cron - # @return [::Boolean] - # This field is used to manage the legacy App Engine Cron jobs using the - # Cloud Scheduler API. If the field is set to true, the job in the __cron - # queue with the corresponding name will be deleted instead. - class DeleteJobRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Request message for - # {::Google::Cloud::Scheduler::V1beta1::CloudScheduler::Client#pause_job PauseJob}. - # @!attribute [rw] name - # @return [::String] - # Required. The job name. For example: - # `projects/PROJECT_ID/locations/LOCATION_ID/jobs/JOB_ID`. - class PauseJobRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Request message for - # {::Google::Cloud::Scheduler::V1beta1::CloudScheduler::Client#resume_job ResumeJob}. - # @!attribute [rw] name - # @return [::String] - # Required. The job name. For example: - # `projects/PROJECT_ID/locations/LOCATION_ID/jobs/JOB_ID`. - class ResumeJobRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Request message for forcing a job to run now using - # {::Google::Cloud::Scheduler::V1beta1::CloudScheduler::Client#run_job RunJob}. - # @!attribute [rw] name - # @return [::String] - # Required. The job name. For example: - # `projects/PROJECT_ID/locations/LOCATION_ID/jobs/JOB_ID`. - # @!attribute [rw] legacy_app_engine_cron - # @return [::Boolean] - # This field is used to manage the legacy App Engine Cron jobs using the - # Cloud Scheduler API. If the field is set to true, the job in the __cron - # queue with the corresponding name will be forced to run instead. - class RunJobRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - end - end - end -end diff --git a/owl-bot-staging/google-cloud-scheduler-v1beta1/proto_docs/google/cloud/scheduler/v1beta1/job.rb b/owl-bot-staging/google-cloud-scheduler-v1beta1/proto_docs/google/cloud/scheduler/v1beta1/job.rb deleted file mode 100644 index 50f3e82e2d83..000000000000 --- a/owl-bot-staging/google-cloud-scheduler-v1beta1/proto_docs/google/cloud/scheduler/v1beta1/job.rb +++ /dev/null @@ -1,267 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - - -module Google - module Cloud - module Scheduler - module V1beta1 - # Configuration for a job. - # The maximum allowed size for a job is 1MB. - # @!attribute [rw] name - # @return [::String] - # Optionally caller-specified in - # {::Google::Cloud::Scheduler::V1beta1::CloudScheduler::Client#create_job CreateJob}, after - # which it becomes output only. - # - # The job name. For example: - # `projects/PROJECT_ID/locations/LOCATION_ID/jobs/JOB_ID`. - # - # * `PROJECT_ID` can contain letters ([A-Za-z]), numbers ([0-9]), - # hyphens (-), colons (:), or periods (.). - # For more information, see - # [Identifying - # projects](https://cloud.google.com/resource-manager/docs/creating-managing-projects#identifying_projects) - # * `LOCATION_ID` is the canonical ID for the job's location. - # The list of available locations can be obtained by calling - # [ListLocations][google.cloud.location.Locations.ListLocations]. - # For more information, see https://cloud.google.com/about/locations/. - # * `JOB_ID` can contain only letters ([A-Za-z]), numbers ([0-9]), - # hyphens (-), or underscores (_). The maximum length is 500 characters. - # @!attribute [rw] description - # @return [::String] - # Optionally caller-specified in - # {::Google::Cloud::Scheduler::V1beta1::CloudScheduler::Client#create_job CreateJob} or - # {::Google::Cloud::Scheduler::V1beta1::CloudScheduler::Client#update_job UpdateJob}. - # - # A human-readable description for the job. This string must not contain - # more than 500 characters. - # @!attribute [rw] pubsub_target - # @return [::Google::Cloud::Scheduler::V1beta1::PubsubTarget] - # Pub/Sub target. - # - # Note: The following fields are mutually exclusive: `pubsub_target`, `app_engine_http_target`, `http_target`. If a field in that set is populated, all other fields in the set will automatically be cleared. - # @!attribute [rw] app_engine_http_target - # @return [::Google::Cloud::Scheduler::V1beta1::AppEngineHttpTarget] - # App Engine HTTP target. - # - # Note: The following fields are mutually exclusive: `app_engine_http_target`, `pubsub_target`, `http_target`. If a field in that set is populated, all other fields in the set will automatically be cleared. - # @!attribute [rw] http_target - # @return [::Google::Cloud::Scheduler::V1beta1::HttpTarget] - # HTTP target. - # - # Note: The following fields are mutually exclusive: `http_target`, `pubsub_target`, `app_engine_http_target`. If a field in that set is populated, all other fields in the set will automatically be cleared. - # @!attribute [rw] schedule - # @return [::String] - # Required, except when used with - # {::Google::Cloud::Scheduler::V1beta1::CloudScheduler::Client#update_job UpdateJob}. - # - # Describes the schedule on which the job will be executed. - # - # The schedule can be either of the following types: - # - # * [Crontab](https://en.wikipedia.org/wiki/Cron#Overview) - # * English-like - # [schedule](https://cloud.google.com/scheduler/docs/configuring/cron-job-schedules) - # - # As a general rule, execution `n + 1` of a job will not begin - # until execution `n` has finished. Cloud Scheduler will never - # allow two simultaneously outstanding executions. For example, - # this implies that if the `n+1`th execution is scheduled to run at - # 16:00 but the `n`th execution takes until 16:15, the `n+1`th - # execution will not start until `16:15`. - # A scheduled start time will be delayed if the previous - # execution has not ended when its scheduled time occurs. - # - # If {::Google::Cloud::Scheduler::V1beta1::RetryConfig#retry_count retry_count} > - # 0 and a job attempt fails, the job will be tried a total of - # {::Google::Cloud::Scheduler::V1beta1::RetryConfig#retry_count retry_count} - # times, with exponential backoff, until the next scheduled start - # time. - # @!attribute [rw] time_zone - # @return [::String] - # Specifies the time zone to be used in interpreting - # {::Google::Cloud::Scheduler::V1beta1::Job#schedule schedule}. The value of this - # field must be a time zone name from the [tz - # database](http://en.wikipedia.org/wiki/Tz_database). - # - # Note that some time zones include a provision for - # daylight savings time. The rules for daylight saving time are - # determined by the chosen tz. For UTC use the string "utc". If a - # time zone is not specified, the default will be in UTC (also known - # as GMT). - # @!attribute [rw] user_update_time - # @return [::Google::Protobuf::Timestamp] - # Output only. The creation time of the job. - # @!attribute [rw] state - # @return [::Google::Cloud::Scheduler::V1beta1::Job::State] - # Output only. State of the job. - # @!attribute [rw] status - # @return [::Google::Rpc::Status] - # Output only. The response from the target for the last attempted execution. - # @!attribute [rw] schedule_time - # @return [::Google::Protobuf::Timestamp] - # Output only. The next time the job is scheduled. Note that this may be a - # retry of a previously failed attempt or the next execution time - # according to the schedule. - # @!attribute [rw] last_attempt_time - # @return [::Google::Protobuf::Timestamp] - # Output only. The time the last job attempt started. - # @!attribute [rw] retry_config - # @return [::Google::Cloud::Scheduler::V1beta1::RetryConfig] - # Settings that determine the retry behavior. - # @!attribute [rw] attempt_deadline - # @return [::Google::Protobuf::Duration] - # The deadline for job attempts. If the request handler does not respond by - # this deadline then the request is cancelled and the attempt is marked as a - # `DEADLINE_EXCEEDED` failure. The failed attempt can be viewed in - # execution logs. Cloud Scheduler will retry the job according - # to the {::Google::Cloud::Scheduler::V1beta1::RetryConfig RetryConfig}. - # - # The default and the allowed values depend on the type of target: - # - # * For {::Google::Cloud::Scheduler::V1beta1::Job#http_target HTTP targets}, the - # default is 3 minutes. The deadline must be in the interval [15 seconds, 30 - # minutes]. - # - # * For [App Engine HTTP - # targets][google.cloud.scheduler.v1beta1.Job.app_engine_http_target], 0 - # indicates that the request has the default deadline. The default deadline - # depends on the scaling type of the service: 10 minutes for standard apps - # with automatic scaling, 24 hours for standard apps with manual and basic - # scaling, and 60 minutes for flex apps. If the request deadline is set, it - # must be in the interval [15 seconds, 24 hours 15 seconds]. - # - # * For [Pub/Sub targets][google.cloud.scheduler.v1beta1.Job.pubsub_target], - # this field is ignored. - # @!attribute [rw] legacy_app_engine_cron - # @return [::Boolean] - # Immutable. This field is used to manage the legacy App Engine Cron jobs - # using the Cloud Scheduler API. If the field is set to true, the job will be - # considered a legacy job. Note that App Engine Cron jobs have fewer - # features than Cloud Scheduler jobs, e.g., are only limited to App Engine - # targets. - class Job - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - - # State of the job. - module State - # Unspecified state. - STATE_UNSPECIFIED = 0 - - # The job is executing normally. - ENABLED = 1 - - # The job is paused by the user. It will not execute. A user can - # intentionally pause the job using - # {::Google::Cloud::Scheduler::V1beta1::PauseJobRequest PauseJobRequest}. - PAUSED = 2 - - # The job is disabled by the system due to error. The user - # cannot directly set a job to be disabled. - DISABLED = 3 - - # The job state resulting from a failed - # {::Google::Cloud::Scheduler::V1beta1::CloudScheduler::Client#update_job CloudScheduler.UpdateJob} - # operation. To recover a job from this state, retry - # {::Google::Cloud::Scheduler::V1beta1::CloudScheduler::Client#update_job CloudScheduler.UpdateJob} - # until a successful response is received. - UPDATE_FAILED = 4 - end - end - - # Settings that determine the retry behavior. - # - # By default, if a job does not complete successfully (meaning that - # an acknowledgement is not received from the handler, then it will be retried - # with exponential backoff according to the settings in - # {::Google::Cloud::Scheduler::V1beta1::RetryConfig RetryConfig}. - # @!attribute [rw] retry_count - # @return [::Integer] - # The number of attempts that the system will make to run a job using the - # exponential backoff procedure described by - # {::Google::Cloud::Scheduler::V1beta1::RetryConfig#max_doublings max_doublings}. - # - # The default value of retry_count is zero. - # - # If retry_count is zero, a job attempt will *not* be retried if - # it fails. Instead the Cloud Scheduler system will wait for the - # next scheduled execution time. - # - # If retry_count is set to a non-zero number then Cloud Scheduler - # will retry failed attempts, using exponential backoff, - # retry_count times, or until the next scheduled execution time, - # whichever comes first. - # - # Values greater than 5 and negative values are not allowed. - # @!attribute [rw] max_retry_duration - # @return [::Google::Protobuf::Duration] - # The time limit for retrying a failed job, measured from time when an - # execution was first attempted. If specified with - # {::Google::Cloud::Scheduler::V1beta1::RetryConfig#retry_count retry_count}, the - # job will be retried until both limits are reached. - # - # The default value for max_retry_duration is zero, which means retry - # duration is unlimited. - # @!attribute [rw] min_backoff_duration - # @return [::Google::Protobuf::Duration] - # The minimum amount of time to wait before retrying a job after - # it fails. - # - # The default value of this field is 5 seconds. - # @!attribute [rw] max_backoff_duration - # @return [::Google::Protobuf::Duration] - # The maximum amount of time to wait before retrying a job after - # it fails. - # - # The default value of this field is 1 hour. - # @!attribute [rw] max_doublings - # @return [::Integer] - # The time between retries will double `max_doublings` times. - # - # A job's retry interval starts at - # {::Google::Cloud::Scheduler::V1beta1::RetryConfig#min_backoff_duration min_backoff_duration}, - # then doubles `max_doublings` times, then increases linearly, and finally - # retries at intervals of - # {::Google::Cloud::Scheduler::V1beta1::RetryConfig#max_backoff_duration max_backoff_duration} - # up to {::Google::Cloud::Scheduler::V1beta1::RetryConfig#retry_count retry_count} - # times. - # - # For example, if - # {::Google::Cloud::Scheduler::V1beta1::RetryConfig#min_backoff_duration min_backoff_duration} - # is 10s, - # {::Google::Cloud::Scheduler::V1beta1::RetryConfig#max_backoff_duration max_backoff_duration} - # is 300s, and `max_doublings` is 3, then the a job will first be retried in - # 10s. The retry interval will double three times, and then increase linearly - # by 2^3 * 10s. Finally, the job will retry at intervals of - # {::Google::Cloud::Scheduler::V1beta1::RetryConfig#max_backoff_duration max_backoff_duration} - # until the job has been attempted - # {::Google::Cloud::Scheduler::V1beta1::RetryConfig#retry_count retry_count} - # times. Thus, the requests will retry at 10s, 20s, 40s, 80s, 160s, 240s, - # 300s, 300s, .... - # - # The default value of this field is 5. - class RetryConfig - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - end - end - end -end diff --git a/owl-bot-staging/google-cloud-scheduler-v1beta1/proto_docs/google/cloud/scheduler/v1beta1/target.rb b/owl-bot-staging/google-cloud-scheduler-v1beta1/proto_docs/google/cloud/scheduler/v1beta1/target.rb deleted file mode 100644 index 6e78134b664f..000000000000 --- a/owl-bot-staging/google-cloud-scheduler-v1beta1/proto_docs/google/cloud/scheduler/v1beta1/target.rb +++ /dev/null @@ -1,409 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - - -module Google - module Cloud - module Scheduler - module V1beta1 - # Http target. The job will be pushed to the job handler by means of - # an HTTP request via an - # {::Google::Cloud::Scheduler::V1beta1::HttpTarget#http_method http_method} such as - # HTTP POST, HTTP GET, etc. The job is acknowledged by means of an HTTP - # response code in the range [200 - 299]. A failure to receive a response - # constitutes a failed execution. For a redirected request, the response - # returned by the redirected request is considered. - # @!attribute [rw] uri - # @return [::String] - # Required. The full URI path that the request will be sent to. This string - # must begin with either "http://" or "https://". Some examples of - # valid values for {::Google::Cloud::Scheduler::V1beta1::HttpTarget#uri uri} are: - # `http://acme.com` and `https://acme.com/sales:8080`. Cloud Scheduler will - # encode some characters for safety and compatibility. The maximum allowed - # URL length is 2083 characters after encoding. - # @!attribute [rw] http_method - # @return [::Google::Cloud::Scheduler::V1beta1::HttpMethod] - # Which HTTP method to use for the request. - # @!attribute [rw] headers - # @return [::Google::Protobuf::Map{::String => ::String}] - # The user can specify HTTP request headers to send with the job's - # HTTP request. This map contains the header field names and - # values. Repeated headers are not supported, but a header value can - # contain commas. These headers represent a subset of the headers - # that will accompany the job's HTTP request. Some HTTP request - # headers will be ignored or replaced. A partial list of headers that - # will be ignored or replaced is below: - # - Host: This will be computed by Cloud Scheduler and derived from - # {::Google::Cloud::Scheduler::V1beta1::HttpTarget#uri uri}. - # * `Content-Length`: This will be computed by Cloud Scheduler. - # * `User-Agent`: This will be set to `"Google-Cloud-Scheduler"`. - # * `X-Google-*`: Google internal use only. - # * `X-AppEngine-*`: Google internal use only. - # * `X-CloudScheduler`: This header will be set to true. - # * `X-CloudScheduler-JobName`: This header will contain the job name. - # * `X-CloudScheduler-ScheduleTime`: For Cloud Scheduler jobs specified in - # the unix-cron format, this header will contain the job schedule as an - # offset of UTC parsed according to RFC3339. - # - # The total size of headers must be less than 80KB. - # @!attribute [rw] body - # @return [::String] - # HTTP request body. A request body is allowed only if the HTTP - # method is POST, PUT, or PATCH. It is an error to set body on a job with an - # incompatible {::Google::Cloud::Scheduler::V1beta1::HttpMethod HttpMethod}. - # @!attribute [rw] oauth_token - # @return [::Google::Cloud::Scheduler::V1beta1::OAuthToken] - # If specified, an - # [OAuth token](https://developers.google.com/identity/protocols/OAuth2) - # will be generated and attached as an `Authorization` header in the HTTP - # request. - # - # This type of authorization should generally only be used when calling - # Google APIs hosted on *.googleapis.com. - # - # Note: The following fields are mutually exclusive: `oauth_token`, `oidc_token`. If a field in that set is populated, all other fields in the set will automatically be cleared. - # @!attribute [rw] oidc_token - # @return [::Google::Cloud::Scheduler::V1beta1::OidcToken] - # If specified, an - # [OIDC](https://developers.google.com/identity/protocols/OpenIDConnect) - # token will be generated and attached as an `Authorization` header in the - # HTTP request. - # - # This type of authorization can be used for many scenarios, including - # calling Cloud Run, or endpoints where you intend to validate the token - # yourself. - # - # Note: The following fields are mutually exclusive: `oidc_token`, `oauth_token`. If a field in that set is populated, all other fields in the set will automatically be cleared. - class HttpTarget - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - - # @!attribute [rw] key - # @return [::String] - # @!attribute [rw] value - # @return [::String] - class HeadersEntry - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - end - - # App Engine target. The job will be pushed to a job handler by means - # of an HTTP request via an - # {::Google::Cloud::Scheduler::V1beta1::AppEngineHttpTarget#http_method http_method} - # such as HTTP POST, HTTP GET, etc. The job is acknowledged by means of an HTTP - # response code in the range [200 - 299]. Error 503 is considered an App Engine - # system error instead of an application error. Requests returning error 503 - # will be retried regardless of retry configuration and not counted against - # retry counts. Any other response code, or a failure to receive a response - # before the deadline, constitutes a failed attempt. - # @!attribute [rw] http_method - # @return [::Google::Cloud::Scheduler::V1beta1::HttpMethod] - # The HTTP method to use for the request. PATCH and OPTIONS are not - # permitted. - # @!attribute [rw] app_engine_routing - # @return [::Google::Cloud::Scheduler::V1beta1::AppEngineRouting] - # App Engine Routing setting for the job. - # @!attribute [rw] relative_uri - # @return [::String] - # The relative URI. - # - # The relative URL must begin with "/" and must be a valid HTTP relative URL. - # It can contain a path, query string arguments, and `#` fragments. - # If the relative URL is empty, then the root path "/" will be used. - # No spaces are allowed, and the maximum length allowed is 2083 characters. - # @!attribute [rw] headers - # @return [::Google::Protobuf::Map{::String => ::String}] - # HTTP request headers. - # - # This map contains the header field names and values. Headers can be set - # when the job is created. - # - # Cloud Scheduler sets some headers to default values: - # - # * `User-Agent`: By default, this header is - # `"AppEngine-Google; (+http://code.google.com/appengine)"`. - # This header can be modified, but Cloud Scheduler will append - # `"AppEngine-Google; (+http://code.google.com/appengine)"` to the - # modified `User-Agent`. - # * `X-CloudScheduler`: This header will be set to true. - # * `X-CloudScheduler-JobName`: This header will contain the job name. - # * `X-CloudScheduler-ScheduleTime`: For Cloud Scheduler jobs specified in - # the unix-cron format, this header will contain the job schedule as an - # offset of UTC parsed according to RFC3339. - # - # If the job has an - # {::Google::Cloud::Scheduler::V1beta1::AppEngineHttpTarget#body body}, Cloud - # Scheduler sets the following headers: - # - # * `Content-Type`: By default, the `Content-Type` header is set to - # `"application/octet-stream"`. The default can be overridden by explictly - # setting `Content-Type` to a particular media type when the job is - # created. - # For example, `Content-Type` can be set to `"application/json"`. - # * `Content-Length`: This is computed by Cloud Scheduler. This value is - # output only. It cannot be changed. - # - # The headers below are output only. They cannot be set or overridden: - # - # * `X-Google-*`: For Google internal use only. - # * `X-AppEngine-*`: For Google internal use only. - # - # In addition, some App Engine headers, which contain - # job-specific information, are also be sent to the job handler. - # @!attribute [rw] body - # @return [::String] - # Body. - # - # HTTP request body. A request body is allowed only if the HTTP method is - # POST or PUT. It will result in invalid argument error to set a body on a - # job with an incompatible - # {::Google::Cloud::Scheduler::V1beta1::HttpMethod HttpMethod}. - class AppEngineHttpTarget - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - - # @!attribute [rw] key - # @return [::String] - # @!attribute [rw] value - # @return [::String] - class HeadersEntry - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - end - - # Pub/Sub target. The job will be delivered by publishing a message to - # the given Pub/Sub topic. - # @!attribute [rw] topic_name - # @return [::String] - # Required. The name of the Cloud Pub/Sub topic to which messages will - # be published when a job is delivered. The topic name must be in the - # same format as required by Pub/Sub's - # [PublishRequest.name](https://cloud.google.com/pubsub/docs/reference/rpc/google.pubsub.v1#publishrequest), - # for example `projects/PROJECT_ID/topics/TOPIC_ID`. - # - # The topic must be in the same project as the Cloud Scheduler job. - # @!attribute [rw] data - # @return [::String] - # The message payload for PubsubMessage. - # - # Pubsub message must contain either non-empty data, or at least one - # attribute. - # @!attribute [rw] attributes - # @return [::Google::Protobuf::Map{::String => ::String}] - # Attributes for PubsubMessage. - # - # Pubsub message must contain either non-empty data, or at least one - # attribute. - class PubsubTarget - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - - # @!attribute [rw] key - # @return [::String] - # @!attribute [rw] value - # @return [::String] - class AttributesEntry - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - end - - # App Engine Routing. - # - # For more information about services, versions, and instances see - # [An Overview of App - # Engine](https://cloud.google.com/appengine/docs/python/an-overview-of-app-engine), - # [Microservices Architecture on Google App - # Engine](https://cloud.google.com/appengine/docs/python/microservices-on-app-engine), - # [App Engine Standard request - # routing](https://cloud.google.com/appengine/docs/standard/python/how-requests-are-routed), - # and [App Engine Flex request - # routing](https://cloud.google.com/appengine/docs/flexible/python/how-requests-are-routed). - # @!attribute [rw] service - # @return [::String] - # App service. - # - # By default, the job is sent to the service which is the default - # service when the job is attempted. - # @!attribute [rw] version - # @return [::String] - # App version. - # - # By default, the job is sent to the version which is the default - # version when the job is attempted. - # @!attribute [rw] instance - # @return [::String] - # App instance. - # - # By default, the job is sent to an instance which is available when - # the job is attempted. - # - # Requests can only be sent to a specific instance if - # [manual scaling is used in App Engine - # Standard](https://cloud.google.com/appengine/docs/python/an-overview-of-app-engine?#scaling_types_and_instance_classes). - # App Engine Flex does not support instances. For more information, see - # [App Engine Standard request - # routing](https://cloud.google.com/appengine/docs/standard/python/how-requests-are-routed) - # and [App Engine Flex request - # routing](https://cloud.google.com/appengine/docs/flexible/python/how-requests-are-routed). - # @!attribute [rw] host - # @return [::String] - # Output only. The host that the job is sent to. - # - # For more information about how App Engine requests are routed, see - # [here](https://cloud.google.com/appengine/docs/standard/python/how-requests-are-routed). - # - # The host is constructed as: - # - # - # * `host = [application_domain_name]`
- # `| [service] + '.' + [application_domain_name]`
- # `| [version] + '.' + [application_domain_name]`
- # `| [version_dot_service]+ '.' + [application_domain_name]`
- # `| [instance] + '.' + [application_domain_name]`
- # `| [instance_dot_service] + '.' + [application_domain_name]`
- # `| [instance_dot_version] + '.' + [application_domain_name]`
- # `| [instance_dot_version_dot_service] + '.' + [application_domain_name]` - # - # * `application_domain_name` = The domain name of the app, for - # example .appspot.com, which is associated with the - # job's project ID. - # - # * `service =` - # {::Google::Cloud::Scheduler::V1beta1::AppEngineRouting#service service} - # - # * `version =` - # {::Google::Cloud::Scheduler::V1beta1::AppEngineRouting#version version} - # - # * `version_dot_service =` - # {::Google::Cloud::Scheduler::V1beta1::AppEngineRouting#version version} `+ '.' - # +` [service][google.cloud.scheduler.v1beta1.AppEngineRouting.service] - # - # * `instance =` - # {::Google::Cloud::Scheduler::V1beta1::AppEngineRouting#instance instance} - # - # * `instance_dot_service =` - # {::Google::Cloud::Scheduler::V1beta1::AppEngineRouting#instance instance} `+ - # '.' +` [service][google.cloud.scheduler.v1beta1.AppEngineRouting.service] - # - # * `instance_dot_version =` - # {::Google::Cloud::Scheduler::V1beta1::AppEngineRouting#instance instance} `+ - # '.' +` [version][google.cloud.scheduler.v1beta1.AppEngineRouting.version] - # - # * `instance_dot_version_dot_service =` - # {::Google::Cloud::Scheduler::V1beta1::AppEngineRouting#instance instance} `+ - # '.' +` [version][google.cloud.scheduler.v1beta1.AppEngineRouting.version] - # `+ '.' +` - # {::Google::Cloud::Scheduler::V1beta1::AppEngineRouting#service service} - # - # - # If {::Google::Cloud::Scheduler::V1beta1::AppEngineRouting#service service} is - # empty, then the job will be sent to the service which is the default - # service when the job is attempted. - # - # If {::Google::Cloud::Scheduler::V1beta1::AppEngineRouting#version version} is - # empty, then the job will be sent to the version which is the default - # version when the job is attempted. - # - # If {::Google::Cloud::Scheduler::V1beta1::AppEngineRouting#instance instance} is - # empty, then the job will be sent to an instance which is available when the - # job is attempted. - # - # If {::Google::Cloud::Scheduler::V1beta1::AppEngineRouting#service service}, - # {::Google::Cloud::Scheduler::V1beta1::AppEngineRouting#version version}, or - # {::Google::Cloud::Scheduler::V1beta1::AppEngineRouting#instance instance} is - # invalid, then the job will be sent to the default version of the default - # service when the job is attempted. - class AppEngineRouting - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Contains information needed for generating an - # [OAuth token](https://developers.google.com/identity/protocols/OAuth2). - # This type of authorization should generally only be used when calling Google - # APIs hosted on *.googleapis.com. - # @!attribute [rw] service_account_email - # @return [::String] - # [Service account email](https://cloud.google.com/iam/docs/service-accounts) - # to be used for generating OAuth token. - # The service account must be within the same project as the job. The caller - # must have iam.serviceAccounts.actAs permission for the service account. - # @!attribute [rw] scope - # @return [::String] - # OAuth scope to be used for generating OAuth access token. - # If not specified, "https://www.googleapis.com/auth/cloud-platform" - # will be used. - class OAuthToken - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Contains information needed for generating an - # [OpenID Connect - # token](https://developers.google.com/identity/protocols/OpenIDConnect). - # This type of authorization can be used for many scenarios, including - # calling Cloud Run, or endpoints where you intend to validate the token - # yourself. - # @!attribute [rw] service_account_email - # @return [::String] - # [Service account email](https://cloud.google.com/iam/docs/service-accounts) - # to be used for generating OIDC token. - # The service account must be within the same project as the job. The caller - # must have iam.serviceAccounts.actAs permission for the service account. - # @!attribute [rw] audience - # @return [::String] - # Audience to be used when generating OIDC token. If not specified, the URI - # specified in target will be used. - class OidcToken - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # The HTTP method used to execute the job. - module HttpMethod - # HTTP method unspecified. Defaults to POST. - HTTP_METHOD_UNSPECIFIED = 0 - - # HTTP POST - POST = 1 - - # HTTP GET - GET = 2 - - # HTTP HEAD - HEAD = 3 - - # HTTP PUT - PUT = 4 - - # HTTP DELETE - DELETE = 5 - - # HTTP PATCH - PATCH = 6 - - # HTTP OPTIONS - OPTIONS = 7 - end - end - end - end -end diff --git a/owl-bot-staging/google-cloud-scheduler-v1beta1/proto_docs/google/protobuf/any.rb b/owl-bot-staging/google-cloud-scheduler-v1beta1/proto_docs/google/protobuf/any.rb deleted file mode 100644 index 58691995f02e..000000000000 --- a/owl-bot-staging/google-cloud-scheduler-v1beta1/proto_docs/google/protobuf/any.rb +++ /dev/null @@ -1,145 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - - -module Google - module Protobuf - # `Any` contains an arbitrary serialized protocol buffer message along with a - # URL that describes the type of the serialized message. - # - # Protobuf library provides support to pack/unpack Any values in the form - # of utility functions or additional generated methods of the Any type. - # - # Example 1: Pack and unpack a message in C++. - # - # Foo foo = ...; - # Any any; - # any.PackFrom(foo); - # ... - # if (any.UnpackTo(&foo)) { - # ... - # } - # - # Example 2: Pack and unpack a message in Java. - # - # Foo foo = ...; - # Any any = Any.pack(foo); - # ... - # if (any.is(Foo.class)) { - # foo = any.unpack(Foo.class); - # } - # // or ... - # if (any.isSameTypeAs(Foo.getDefaultInstance())) { - # foo = any.unpack(Foo.getDefaultInstance()); - # } - # - # Example 3: Pack and unpack a message in Python. - # - # foo = Foo(...) - # any = Any() - # any.Pack(foo) - # ... - # if any.Is(Foo.DESCRIPTOR): - # any.Unpack(foo) - # ... - # - # Example 4: Pack and unpack a message in Go - # - # foo := &pb.Foo{...} - # any, err := anypb.New(foo) - # if err != nil { - # ... - # } - # ... - # foo := &pb.Foo{} - # if err := any.UnmarshalTo(foo); err != nil { - # ... - # } - # - # The pack methods provided by protobuf library will by default use - # 'type.googleapis.com/full.type.name' as the type URL and the unpack - # methods only use the fully qualified type name after the last '/' - # in the type URL, for example "foo.bar.com/x/y.z" will yield type - # name "y.z". - # - # JSON - # ==== - # The JSON representation of an `Any` value uses the regular - # representation of the deserialized, embedded message, with an - # additional field `@type` which contains the type URL. Example: - # - # package google.profile; - # message Person { - # string first_name = 1; - # string last_name = 2; - # } - # - # { - # "@type": "type.googleapis.com/google.profile.Person", - # "firstName": , - # "lastName": - # } - # - # If the embedded message type is well-known and has a custom JSON - # representation, that representation will be embedded adding a field - # `value` which holds the custom JSON in addition to the `@type` - # field. Example (for message [google.protobuf.Duration][]): - # - # { - # "@type": "type.googleapis.com/google.protobuf.Duration", - # "value": "1.212s" - # } - # @!attribute [rw] type_url - # @return [::String] - # A URL/resource name that uniquely identifies the type of the serialized - # protocol buffer message. This string must contain at least - # one "/" character. The last segment of the URL's path must represent - # the fully qualified name of the type (as in - # `path/google.protobuf.Duration`). The name should be in a canonical form - # (e.g., leading "." is not accepted). - # - # In practice, teams usually precompile into the binary all types that they - # expect it to use in the context of Any. However, for URLs which use the - # scheme `http`, `https`, or no scheme, one can optionally set up a type - # server that maps type URLs to message definitions as follows: - # - # * If no scheme is provided, `https` is assumed. - # * An HTTP GET on the URL must yield a [google.protobuf.Type][] - # value in binary format, or produce an error. - # * Applications are allowed to cache lookup results based on the - # URL, or have them precompiled into a binary to avoid any - # lookup. Therefore, binary compatibility needs to be preserved - # on changes to types. (Use versioned type names to manage - # breaking changes.) - # - # Note: this functionality is not currently available in the official - # protobuf release, and it is not used for type URLs beginning with - # type.googleapis.com. As of May 2023, there are no widely used type server - # implementations and no plans to implement one. - # - # Schemes other than `http`, `https` (or the empty scheme) might be - # used with implementation specific semantics. - # @!attribute [rw] value - # @return [::String] - # Must be a valid serialized protocol buffer of the above specified type. - class Any - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - end -end diff --git a/owl-bot-staging/google-cloud-scheduler-v1beta1/proto_docs/google/protobuf/duration.rb b/owl-bot-staging/google-cloud-scheduler-v1beta1/proto_docs/google/protobuf/duration.rb deleted file mode 100644 index ea59f1f91daf..000000000000 --- a/owl-bot-staging/google-cloud-scheduler-v1beta1/proto_docs/google/protobuf/duration.rb +++ /dev/null @@ -1,98 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - - -module Google - module Protobuf - # A Duration represents a signed, fixed-length span of time represented - # as a count of seconds and fractions of seconds at nanosecond - # resolution. It is independent of any calendar and concepts like "day" - # or "month". It is related to Timestamp in that the difference between - # two Timestamp values is a Duration and it can be added or subtracted - # from a Timestamp. Range is approximately +-10,000 years. - # - # # Examples - # - # Example 1: Compute Duration from two Timestamps in pseudo code. - # - # Timestamp start = ...; - # Timestamp end = ...; - # Duration duration = ...; - # - # duration.seconds = end.seconds - start.seconds; - # duration.nanos = end.nanos - start.nanos; - # - # if (duration.seconds < 0 && duration.nanos > 0) { - # duration.seconds += 1; - # duration.nanos -= 1000000000; - # } else if (duration.seconds > 0 && duration.nanos < 0) { - # duration.seconds -= 1; - # duration.nanos += 1000000000; - # } - # - # Example 2: Compute Timestamp from Timestamp + Duration in pseudo code. - # - # Timestamp start = ...; - # Duration duration = ...; - # Timestamp end = ...; - # - # end.seconds = start.seconds + duration.seconds; - # end.nanos = start.nanos + duration.nanos; - # - # if (end.nanos < 0) { - # end.seconds -= 1; - # end.nanos += 1000000000; - # } else if (end.nanos >= 1000000000) { - # end.seconds += 1; - # end.nanos -= 1000000000; - # } - # - # Example 3: Compute Duration from datetime.timedelta in Python. - # - # td = datetime.timedelta(days=3, minutes=10) - # duration = Duration() - # duration.FromTimedelta(td) - # - # # JSON Mapping - # - # In JSON format, the Duration type is encoded as a string rather than an - # object, where the string ends in the suffix "s" (indicating seconds) and - # is preceded by the number of seconds, with nanoseconds expressed as - # fractional seconds. For example, 3 seconds with 0 nanoseconds should be - # encoded in JSON format as "3s", while 3 seconds and 1 nanosecond should - # be expressed in JSON format as "3.000000001s", and 3 seconds and 1 - # microsecond should be expressed in JSON format as "3.000001s". - # @!attribute [rw] seconds - # @return [::Integer] - # Signed seconds of the span of time. Must be from -315,576,000,000 - # to +315,576,000,000 inclusive. Note: these bounds are computed from: - # 60 sec/min * 60 min/hr * 24 hr/day * 365.25 days/year * 10000 years - # @!attribute [rw] nanos - # @return [::Integer] - # Signed fractions of a second at nanosecond resolution of the span - # of time. Durations less than one second are represented with a 0 - # `seconds` field and a positive or negative `nanos` field. For durations - # of one second or more, a non-zero value for the `nanos` field must be - # of the same sign as the `seconds` field. Must be from -999,999,999 - # to +999,999,999 inclusive. - class Duration - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - end -end diff --git a/owl-bot-staging/google-cloud-scheduler-v1beta1/proto_docs/google/protobuf/empty.rb b/owl-bot-staging/google-cloud-scheduler-v1beta1/proto_docs/google/protobuf/empty.rb deleted file mode 100644 index 83e4481834a6..000000000000 --- a/owl-bot-staging/google-cloud-scheduler-v1beta1/proto_docs/google/protobuf/empty.rb +++ /dev/null @@ -1,34 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - - -module Google - module Protobuf - # A generic empty message that you can re-use to avoid defining duplicated - # empty messages in your APIs. A typical example is to use it as the request - # or the response type of an API method. For instance: - # - # service Foo { - # rpc Bar(google.protobuf.Empty) returns (google.protobuf.Empty); - # } - class Empty - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - end -end diff --git a/owl-bot-staging/google-cloud-scheduler-v1beta1/proto_docs/google/protobuf/field_mask.rb b/owl-bot-staging/google-cloud-scheduler-v1beta1/proto_docs/google/protobuf/field_mask.rb deleted file mode 100644 index 7f3ffc78601a..000000000000 --- a/owl-bot-staging/google-cloud-scheduler-v1beta1/proto_docs/google/protobuf/field_mask.rb +++ /dev/null @@ -1,229 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - - -module Google - module Protobuf - # `FieldMask` represents a set of symbolic field paths, for example: - # - # paths: "f.a" - # paths: "f.b.d" - # - # Here `f` represents a field in some root message, `a` and `b` - # fields in the message found in `f`, and `d` a field found in the - # message in `f.b`. - # - # Field masks are used to specify a subset of fields that should be - # returned by a get operation or modified by an update operation. - # Field masks also have a custom JSON encoding (see below). - # - # # Field Masks in Projections - # - # When used in the context of a projection, a response message or - # sub-message is filtered by the API to only contain those fields as - # specified in the mask. For example, if the mask in the previous - # example is applied to a response message as follows: - # - # f { - # a : 22 - # b { - # d : 1 - # x : 2 - # } - # y : 13 - # } - # z: 8 - # - # The result will not contain specific values for fields x,y and z - # (their value will be set to the default, and omitted in proto text - # output): - # - # - # f { - # a : 22 - # b { - # d : 1 - # } - # } - # - # A repeated field is not allowed except at the last position of a - # paths string. - # - # If a FieldMask object is not present in a get operation, the - # operation applies to all fields (as if a FieldMask of all fields - # had been specified). - # - # Note that a field mask does not necessarily apply to the - # top-level response message. In case of a REST get operation, the - # field mask applies directly to the response, but in case of a REST - # list operation, the mask instead applies to each individual message - # in the returned resource list. In case of a REST custom method, - # other definitions may be used. Where the mask applies will be - # clearly documented together with its declaration in the API. In - # any case, the effect on the returned resource/resources is required - # behavior for APIs. - # - # # Field Masks in Update Operations - # - # A field mask in update operations specifies which fields of the - # targeted resource are going to be updated. The API is required - # to only change the values of the fields as specified in the mask - # and leave the others untouched. If a resource is passed in to - # describe the updated values, the API ignores the values of all - # fields not covered by the mask. - # - # If a repeated field is specified for an update operation, new values will - # be appended to the existing repeated field in the target resource. Note that - # a repeated field is only allowed in the last position of a `paths` string. - # - # If a sub-message is specified in the last position of the field mask for an - # update operation, then new value will be merged into the existing sub-message - # in the target resource. - # - # For example, given the target message: - # - # f { - # b { - # d: 1 - # x: 2 - # } - # c: [1] - # } - # - # And an update message: - # - # f { - # b { - # d: 10 - # } - # c: [2] - # } - # - # then if the field mask is: - # - # paths: ["f.b", "f.c"] - # - # then the result will be: - # - # f { - # b { - # d: 10 - # x: 2 - # } - # c: [1, 2] - # } - # - # An implementation may provide options to override this default behavior for - # repeated and message fields. - # - # In order to reset a field's value to the default, the field must - # be in the mask and set to the default value in the provided resource. - # Hence, in order to reset all fields of a resource, provide a default - # instance of the resource and set all fields in the mask, or do - # not provide a mask as described below. - # - # If a field mask is not present on update, the operation applies to - # all fields (as if a field mask of all fields has been specified). - # Note that in the presence of schema evolution, this may mean that - # fields the client does not know and has therefore not filled into - # the request will be reset to their default. If this is unwanted - # behavior, a specific service may require a client to always specify - # a field mask, producing an error if not. - # - # As with get operations, the location of the resource which - # describes the updated values in the request message depends on the - # operation kind. In any case, the effect of the field mask is - # required to be honored by the API. - # - # ## Considerations for HTTP REST - # - # The HTTP kind of an update operation which uses a field mask must - # be set to PATCH instead of PUT in order to satisfy HTTP semantics - # (PUT must only be used for full updates). - # - # # JSON Encoding of Field Masks - # - # In JSON, a field mask is encoded as a single string where paths are - # separated by a comma. Fields name in each path are converted - # to/from lower-camel naming conventions. - # - # As an example, consider the following message declarations: - # - # message Profile { - # User user = 1; - # Photo photo = 2; - # } - # message User { - # string display_name = 1; - # string address = 2; - # } - # - # In proto a field mask for `Profile` may look as such: - # - # mask { - # paths: "user.display_name" - # paths: "photo" - # } - # - # In JSON, the same mask is represented as below: - # - # { - # mask: "user.displayName,photo" - # } - # - # # Field Masks and Oneof Fields - # - # Field masks treat fields in oneofs just as regular fields. Consider the - # following message: - # - # message SampleMessage { - # oneof test_oneof { - # string name = 4; - # SubMessage sub_message = 9; - # } - # } - # - # The field mask can be: - # - # mask { - # paths: "name" - # } - # - # Or: - # - # mask { - # paths: "sub_message" - # } - # - # Note that oneof type names ("test_oneof" in this case) cannot be used in - # paths. - # - # ## Field Mask Verification - # - # The implementation of any API method which has a FieldMask type field in the - # request should verify the included field paths, and return an - # `INVALID_ARGUMENT` error if any path is unmappable. - # @!attribute [rw] paths - # @return [::Array<::String>] - # The set of field mask paths. - class FieldMask - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - end -end diff --git a/owl-bot-staging/google-cloud-scheduler-v1beta1/proto_docs/google/protobuf/timestamp.rb b/owl-bot-staging/google-cloud-scheduler-v1beta1/proto_docs/google/protobuf/timestamp.rb deleted file mode 100644 index 74352be9c58c..000000000000 --- a/owl-bot-staging/google-cloud-scheduler-v1beta1/proto_docs/google/protobuf/timestamp.rb +++ /dev/null @@ -1,127 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - - -module Google - module Protobuf - # A Timestamp represents a point in time independent of any time zone or local - # calendar, encoded as a count of seconds and fractions of seconds at - # nanosecond resolution. The count is relative to an epoch at UTC midnight on - # January 1, 1970, in the proleptic Gregorian calendar which extends the - # Gregorian calendar backwards to year one. - # - # All minutes are 60 seconds long. Leap seconds are "smeared" so that no leap - # second table is needed for interpretation, using a [24-hour linear - # smear](https://developers.google.com/time/smear). - # - # The range is from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59.999999999Z. By - # restricting to that range, we ensure that we can convert to and from [RFC - # 3339](https://www.ietf.org/rfc/rfc3339.txt) date strings. - # - # # Examples - # - # Example 1: Compute Timestamp from POSIX `time()`. - # - # Timestamp timestamp; - # timestamp.set_seconds(time(NULL)); - # timestamp.set_nanos(0); - # - # Example 2: Compute Timestamp from POSIX `gettimeofday()`. - # - # struct timeval tv; - # gettimeofday(&tv, NULL); - # - # Timestamp timestamp; - # timestamp.set_seconds(tv.tv_sec); - # timestamp.set_nanos(tv.tv_usec * 1000); - # - # Example 3: Compute Timestamp from Win32 `GetSystemTimeAsFileTime()`. - # - # FILETIME ft; - # GetSystemTimeAsFileTime(&ft); - # UINT64 ticks = (((UINT64)ft.dwHighDateTime) << 32) | ft.dwLowDateTime; - # - # // A Windows tick is 100 nanoseconds. Windows epoch 1601-01-01T00:00:00Z - # // is 11644473600 seconds before Unix epoch 1970-01-01T00:00:00Z. - # Timestamp timestamp; - # timestamp.set_seconds((INT64) ((ticks / 10000000) - 11644473600LL)); - # timestamp.set_nanos((INT32) ((ticks % 10000000) * 100)); - # - # Example 4: Compute Timestamp from Java `System.currentTimeMillis()`. - # - # long millis = System.currentTimeMillis(); - # - # Timestamp timestamp = Timestamp.newBuilder().setSeconds(millis / 1000) - # .setNanos((int) ((millis % 1000) * 1000000)).build(); - # - # Example 5: Compute Timestamp from Java `Instant.now()`. - # - # Instant now = Instant.now(); - # - # Timestamp timestamp = - # Timestamp.newBuilder().setSeconds(now.getEpochSecond()) - # .setNanos(now.getNano()).build(); - # - # Example 6: Compute Timestamp from current time in Python. - # - # timestamp = Timestamp() - # timestamp.GetCurrentTime() - # - # # JSON Mapping - # - # In JSON format, the Timestamp type is encoded as a string in the - # [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format. That is, the - # format is "\\{year}-\\{month}-\\{day}T\\{hour}:\\{min}:\\{sec}[.\\{frac_sec}]Z" - # where \\{year} is always expressed using four digits while \\{month}, \\{day}, - # \\{hour}, \\{min}, and \\{sec} are zero-padded to two digits each. The fractional - # seconds, which can go up to 9 digits (i.e. up to 1 nanosecond resolution), - # are optional. The "Z" suffix indicates the timezone ("UTC"); the timezone - # is required. A proto3 JSON serializer should always use UTC (as indicated by - # "Z") when printing the Timestamp type and a proto3 JSON parser should be - # able to accept both UTC and other timezones (as indicated by an offset). - # - # For example, "2017-01-15T01:30:15.01Z" encodes 15.01 seconds past - # 01:30 UTC on January 15, 2017. - # - # In JavaScript, one can convert a Date object to this format using the - # standard - # [toISOString()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toISOString) - # method. In Python, a standard `datetime.datetime` object can be converted - # to this format using - # [`strftime`](https://docs.python.org/2/library/time.html#time.strftime) with - # the time format spec '%Y-%m-%dT%H:%M:%S.%fZ'. Likewise, in Java, one can use - # the Joda Time's [`ISODateTimeFormat.dateTime()`]( - # http://joda-time.sourceforge.net/apidocs/org/joda/time/format/ISODateTimeFormat.html#dateTime() - # ) to obtain a formatter capable of generating timestamps in this format. - # @!attribute [rw] seconds - # @return [::Integer] - # Represents seconds of UTC time since Unix epoch - # 1970-01-01T00:00:00Z. Must be from 0001-01-01T00:00:00Z to - # 9999-12-31T23:59:59Z inclusive. - # @!attribute [rw] nanos - # @return [::Integer] - # Non-negative fractions of a second at nanosecond resolution. Negative - # second values with fractions must still have non-negative nanos values - # that count forward in time. Must be from 0 to 999,999,999 - # inclusive. - class Timestamp - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - end -end diff --git a/owl-bot-staging/google-cloud-scheduler-v1beta1/proto_docs/google/rpc/status.rb b/owl-bot-staging/google-cloud-scheduler-v1beta1/proto_docs/google/rpc/status.rb deleted file mode 100644 index c1a1c07eb2db..000000000000 --- a/owl-bot-staging/google-cloud-scheduler-v1beta1/proto_docs/google/rpc/status.rb +++ /dev/null @@ -1,48 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - - -module Google - module Rpc - # The `Status` type defines a logical error model that is suitable for - # different programming environments, including REST APIs and RPC APIs. It is - # used by [gRPC](https://github.com/grpc). Each `Status` message contains - # three pieces of data: error code, error message, and error details. - # - # You can find out more about this error model and how to work with it in the - # [API Design Guide](https://cloud.google.com/apis/design/errors). - # @!attribute [rw] code - # @return [::Integer] - # The status code, which should be an enum value of - # [google.rpc.Code][google.rpc.Code]. - # @!attribute [rw] message - # @return [::String] - # A developer-facing error message, which should be in English. Any - # user-facing error message should be localized and sent in the - # {::Google::Rpc::Status#details google.rpc.Status.details} field, or localized - # by the client. - # @!attribute [rw] details - # @return [::Array<::Google::Protobuf::Any>] - # A list of messages that carry the error details. There is a common set of - # message types for APIs to use. - class Status - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - end -end diff --git a/owl-bot-staging/google-cloud-scheduler-v1beta1/snippets/Gemfile b/owl-bot-staging/google-cloud-scheduler-v1beta1/snippets/Gemfile deleted file mode 100644 index 6d51a2c203b3..000000000000 --- a/owl-bot-staging/google-cloud-scheduler-v1beta1/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-scheduler-v1beta1", path: "../" -else - gem "google-cloud-scheduler-v1beta1" -end - -group :test do - gem "google-style", "~> 1.26.1" - gem "minitest", "~> 5.16" - gem "minitest-focus", "~> 1.1" - gem "minitest-hooks", "~> 1.5" -end diff --git a/owl-bot-staging/google-cloud-scheduler-v1beta1/snippets/cloud_scheduler/create_job.rb b/owl-bot-staging/google-cloud-scheduler-v1beta1/snippets/cloud_scheduler/create_job.rb deleted file mode 100644 index f5debf431a13..000000000000 --- a/owl-bot-staging/google-cloud-scheduler-v1beta1/snippets/cloud_scheduler/create_job.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 cloudscheduler_v1beta1_generated_CloudScheduler_CreateJob_sync] -require "google/cloud/scheduler/v1beta1" - -## -# Snippet for the create_job call in the CloudScheduler service -# -# This snippet has been automatically generated and should be regarded as a code -# template only. It will require modifications to work: -# - It may require correct/in-range values for request initialization. -# - It may require specifying regional endpoints when creating the service -# client as shown in https://cloud.google.com/ruby/docs/reference. -# -# This is an auto-generated example demonstrating basic usage of -# Google::Cloud::Scheduler::V1beta1::CloudScheduler::Client#create_job. -# -def create_job - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::Scheduler::V1beta1::CloudScheduler::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::Scheduler::V1beta1::CreateJobRequest.new - - # Call the create_job method. - result = client.create_job request - - # The returned object is of type Google::Cloud::Scheduler::V1beta1::Job. - p result -end -# [END cloudscheduler_v1beta1_generated_CloudScheduler_CreateJob_sync] diff --git a/owl-bot-staging/google-cloud-scheduler-v1beta1/snippets/cloud_scheduler/delete_job.rb b/owl-bot-staging/google-cloud-scheduler-v1beta1/snippets/cloud_scheduler/delete_job.rb deleted file mode 100644 index 413607c65dda..000000000000 --- a/owl-bot-staging/google-cloud-scheduler-v1beta1/snippets/cloud_scheduler/delete_job.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 cloudscheduler_v1beta1_generated_CloudScheduler_DeleteJob_sync] -require "google/cloud/scheduler/v1beta1" - -## -# Snippet for the delete_job call in the CloudScheduler service -# -# This snippet has been automatically generated and should be regarded as a code -# template only. It will require modifications to work: -# - It may require correct/in-range values for request initialization. -# - It may require specifying regional endpoints when creating the service -# client as shown in https://cloud.google.com/ruby/docs/reference. -# -# This is an auto-generated example demonstrating basic usage of -# Google::Cloud::Scheduler::V1beta1::CloudScheduler::Client#delete_job. -# -def delete_job - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::Scheduler::V1beta1::CloudScheduler::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::Scheduler::V1beta1::DeleteJobRequest.new - - # Call the delete_job method. - result = client.delete_job request - - # The returned object is of type Google::Protobuf::Empty. - p result -end -# [END cloudscheduler_v1beta1_generated_CloudScheduler_DeleteJob_sync] diff --git a/owl-bot-staging/google-cloud-scheduler-v1beta1/snippets/cloud_scheduler/get_job.rb b/owl-bot-staging/google-cloud-scheduler-v1beta1/snippets/cloud_scheduler/get_job.rb deleted file mode 100644 index a04df05772aa..000000000000 --- a/owl-bot-staging/google-cloud-scheduler-v1beta1/snippets/cloud_scheduler/get_job.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 cloudscheduler_v1beta1_generated_CloudScheduler_GetJob_sync] -require "google/cloud/scheduler/v1beta1" - -## -# Snippet for the get_job call in the CloudScheduler service -# -# This snippet has been automatically generated and should be regarded as a code -# template only. It will require modifications to work: -# - It may require correct/in-range values for request initialization. -# - It may require specifying regional endpoints when creating the service -# client as shown in https://cloud.google.com/ruby/docs/reference. -# -# This is an auto-generated example demonstrating basic usage of -# Google::Cloud::Scheduler::V1beta1::CloudScheduler::Client#get_job. -# -def get_job - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::Scheduler::V1beta1::CloudScheduler::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::Scheduler::V1beta1::GetJobRequest.new - - # Call the get_job method. - result = client.get_job request - - # The returned object is of type Google::Cloud::Scheduler::V1beta1::Job. - p result -end -# [END cloudscheduler_v1beta1_generated_CloudScheduler_GetJob_sync] diff --git a/owl-bot-staging/google-cloud-scheduler-v1beta1/snippets/cloud_scheduler/list_jobs.rb b/owl-bot-staging/google-cloud-scheduler-v1beta1/snippets/cloud_scheduler/list_jobs.rb deleted file mode 100644 index 267d1483822a..000000000000 --- a/owl-bot-staging/google-cloud-scheduler-v1beta1/snippets/cloud_scheduler/list_jobs.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 cloudscheduler_v1beta1_generated_CloudScheduler_ListJobs_sync] -require "google/cloud/scheduler/v1beta1" - -## -# Snippet for the list_jobs call in the CloudScheduler service -# -# This snippet has been automatically generated and should be regarded as a code -# template only. It will require modifications to work: -# - It may require correct/in-range values for request initialization. -# - It may require specifying regional endpoints when creating the service -# client as shown in https://cloud.google.com/ruby/docs/reference. -# -# This is an auto-generated example demonstrating basic usage of -# Google::Cloud::Scheduler::V1beta1::CloudScheduler::Client#list_jobs. -# -def list_jobs - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::Scheduler::V1beta1::CloudScheduler::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::Scheduler::V1beta1::ListJobsRequest.new - - # Call the list_jobs method. - result = client.list_jobs request - - # The returned object is of type Gapic::PagedEnumerable. You can iterate - # over elements, and API calls will be issued to fetch pages as needed. - result.each do |item| - # Each element is of type ::Google::Cloud::Scheduler::V1beta1::Job. - p item - end -end -# [END cloudscheduler_v1beta1_generated_CloudScheduler_ListJobs_sync] diff --git a/owl-bot-staging/google-cloud-scheduler-v1beta1/snippets/cloud_scheduler/pause_job.rb b/owl-bot-staging/google-cloud-scheduler-v1beta1/snippets/cloud_scheduler/pause_job.rb deleted file mode 100644 index 08bd32590153..000000000000 --- a/owl-bot-staging/google-cloud-scheduler-v1beta1/snippets/cloud_scheduler/pause_job.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 cloudscheduler_v1beta1_generated_CloudScheduler_PauseJob_sync] -require "google/cloud/scheduler/v1beta1" - -## -# Snippet for the pause_job call in the CloudScheduler service -# -# This snippet has been automatically generated and should be regarded as a code -# template only. It will require modifications to work: -# - It may require correct/in-range values for request initialization. -# - It may require specifying regional endpoints when creating the service -# client as shown in https://cloud.google.com/ruby/docs/reference. -# -# This is an auto-generated example demonstrating basic usage of -# Google::Cloud::Scheduler::V1beta1::CloudScheduler::Client#pause_job. -# -def pause_job - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::Scheduler::V1beta1::CloudScheduler::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::Scheduler::V1beta1::PauseJobRequest.new - - # Call the pause_job method. - result = client.pause_job request - - # The returned object is of type Google::Cloud::Scheduler::V1beta1::Job. - p result -end -# [END cloudscheduler_v1beta1_generated_CloudScheduler_PauseJob_sync] diff --git a/owl-bot-staging/google-cloud-scheduler-v1beta1/snippets/cloud_scheduler/resume_job.rb b/owl-bot-staging/google-cloud-scheduler-v1beta1/snippets/cloud_scheduler/resume_job.rb deleted file mode 100644 index 6c9575abc4e9..000000000000 --- a/owl-bot-staging/google-cloud-scheduler-v1beta1/snippets/cloud_scheduler/resume_job.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 cloudscheduler_v1beta1_generated_CloudScheduler_ResumeJob_sync] -require "google/cloud/scheduler/v1beta1" - -## -# Snippet for the resume_job call in the CloudScheduler service -# -# This snippet has been automatically generated and should be regarded as a code -# template only. It will require modifications to work: -# - It may require correct/in-range values for request initialization. -# - It may require specifying regional endpoints when creating the service -# client as shown in https://cloud.google.com/ruby/docs/reference. -# -# This is an auto-generated example demonstrating basic usage of -# Google::Cloud::Scheduler::V1beta1::CloudScheduler::Client#resume_job. -# -def resume_job - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::Scheduler::V1beta1::CloudScheduler::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::Scheduler::V1beta1::ResumeJobRequest.new - - # Call the resume_job method. - result = client.resume_job request - - # The returned object is of type Google::Cloud::Scheduler::V1beta1::Job. - p result -end -# [END cloudscheduler_v1beta1_generated_CloudScheduler_ResumeJob_sync] diff --git a/owl-bot-staging/google-cloud-scheduler-v1beta1/snippets/cloud_scheduler/run_job.rb b/owl-bot-staging/google-cloud-scheduler-v1beta1/snippets/cloud_scheduler/run_job.rb deleted file mode 100644 index 2e3b6b05363a..000000000000 --- a/owl-bot-staging/google-cloud-scheduler-v1beta1/snippets/cloud_scheduler/run_job.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 cloudscheduler_v1beta1_generated_CloudScheduler_RunJob_sync] -require "google/cloud/scheduler/v1beta1" - -## -# Snippet for the run_job call in the CloudScheduler service -# -# This snippet has been automatically generated and should be regarded as a code -# template only. It will require modifications to work: -# - It may require correct/in-range values for request initialization. -# - It may require specifying regional endpoints when creating the service -# client as shown in https://cloud.google.com/ruby/docs/reference. -# -# This is an auto-generated example demonstrating basic usage of -# Google::Cloud::Scheduler::V1beta1::CloudScheduler::Client#run_job. -# -def run_job - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::Scheduler::V1beta1::CloudScheduler::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::Scheduler::V1beta1::RunJobRequest.new - - # Call the run_job method. - result = client.run_job request - - # The returned object is of type Google::Cloud::Scheduler::V1beta1::Job. - p result -end -# [END cloudscheduler_v1beta1_generated_CloudScheduler_RunJob_sync] diff --git a/owl-bot-staging/google-cloud-scheduler-v1beta1/snippets/cloud_scheduler/update_job.rb b/owl-bot-staging/google-cloud-scheduler-v1beta1/snippets/cloud_scheduler/update_job.rb deleted file mode 100644 index ae2ca10a6e2f..000000000000 --- a/owl-bot-staging/google-cloud-scheduler-v1beta1/snippets/cloud_scheduler/update_job.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 cloudscheduler_v1beta1_generated_CloudScheduler_UpdateJob_sync] -require "google/cloud/scheduler/v1beta1" - -## -# Snippet for the update_job call in the CloudScheduler service -# -# This snippet has been automatically generated and should be regarded as a code -# template only. It will require modifications to work: -# - It may require correct/in-range values for request initialization. -# - It may require specifying regional endpoints when creating the service -# client as shown in https://cloud.google.com/ruby/docs/reference. -# -# This is an auto-generated example demonstrating basic usage of -# Google::Cloud::Scheduler::V1beta1::CloudScheduler::Client#update_job. -# -def update_job - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::Scheduler::V1beta1::CloudScheduler::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::Scheduler::V1beta1::UpdateJobRequest.new - - # Call the update_job method. - result = client.update_job request - - # The returned object is of type Google::Cloud::Scheduler::V1beta1::Job. - p result -end -# [END cloudscheduler_v1beta1_generated_CloudScheduler_UpdateJob_sync] diff --git a/owl-bot-staging/google-cloud-scheduler-v1beta1/snippets/snippet_metadata_google.cloud.scheduler.v1beta1.json b/owl-bot-staging/google-cloud-scheduler-v1beta1/snippets/snippet_metadata_google.cloud.scheduler.v1beta1.json deleted file mode 100644 index 9b98a4f44978..000000000000 --- a/owl-bot-staging/google-cloud-scheduler-v1beta1/snippets/snippet_metadata_google.cloud.scheduler.v1beta1.json +++ /dev/null @@ -1,335 +0,0 @@ -{ - "client_library": { - "name": "google-cloud-scheduler-v1beta1", - "version": "", - "language": "RUBY", - "apis": [ - { - "id": "google.cloud.scheduler.v1beta1", - "version": "v1beta1" - } - ] - }, - "snippets": [ - { - "region_tag": "cloudscheduler_v1beta1_generated_CloudScheduler_ListJobs_sync", - "title": "Snippet for the list_jobs call in the CloudScheduler service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Scheduler::V1beta1::CloudScheduler::Client#list_jobs.", - "file": "cloud_scheduler/list_jobs.rb", - "language": "RUBY", - "client_method": { - "short_name": "list_jobs", - "full_name": "::Google::Cloud::Scheduler::V1beta1::CloudScheduler::Client#list_jobs", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::Scheduler::V1beta1::ListJobsRequest", - "name": "request" - } - ], - "result_type": "::Google::Cloud::Scheduler::V1beta1::ListJobsResponse", - "client": { - "short_name": "CloudScheduler::Client", - "full_name": "::Google::Cloud::Scheduler::V1beta1::CloudScheduler::Client" - }, - "method": { - "short_name": "ListJobs", - "full_name": "google.cloud.scheduler.v1beta1.CloudScheduler.ListJobs", - "service": { - "short_name": "CloudScheduler", - "full_name": "google.cloud.scheduler.v1beta1.CloudScheduler" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 50, - "type": "FULL" - } - ] - }, - { - "region_tag": "cloudscheduler_v1beta1_generated_CloudScheduler_GetJob_sync", - "title": "Snippet for the get_job call in the CloudScheduler service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Scheduler::V1beta1::CloudScheduler::Client#get_job.", - "file": "cloud_scheduler/get_job.rb", - "language": "RUBY", - "client_method": { - "short_name": "get_job", - "full_name": "::Google::Cloud::Scheduler::V1beta1::CloudScheduler::Client#get_job", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::Scheduler::V1beta1::GetJobRequest", - "name": "request" - } - ], - "result_type": "::Google::Cloud::Scheduler::V1beta1::Job", - "client": { - "short_name": "CloudScheduler::Client", - "full_name": "::Google::Cloud::Scheduler::V1beta1::CloudScheduler::Client" - }, - "method": { - "short_name": "GetJob", - "full_name": "google.cloud.scheduler.v1beta1.CloudScheduler.GetJob", - "service": { - "short_name": "CloudScheduler", - "full_name": "google.cloud.scheduler.v1beta1.CloudScheduler" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 46, - "type": "FULL" - } - ] - }, - { - "region_tag": "cloudscheduler_v1beta1_generated_CloudScheduler_CreateJob_sync", - "title": "Snippet for the create_job call in the CloudScheduler service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Scheduler::V1beta1::CloudScheduler::Client#create_job.", - "file": "cloud_scheduler/create_job.rb", - "language": "RUBY", - "client_method": { - "short_name": "create_job", - "full_name": "::Google::Cloud::Scheduler::V1beta1::CloudScheduler::Client#create_job", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::Scheduler::V1beta1::CreateJobRequest", - "name": "request" - } - ], - "result_type": "::Google::Cloud::Scheduler::V1beta1::Job", - "client": { - "short_name": "CloudScheduler::Client", - "full_name": "::Google::Cloud::Scheduler::V1beta1::CloudScheduler::Client" - }, - "method": { - "short_name": "CreateJob", - "full_name": "google.cloud.scheduler.v1beta1.CloudScheduler.CreateJob", - "service": { - "short_name": "CloudScheduler", - "full_name": "google.cloud.scheduler.v1beta1.CloudScheduler" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 46, - "type": "FULL" - } - ] - }, - { - "region_tag": "cloudscheduler_v1beta1_generated_CloudScheduler_UpdateJob_sync", - "title": "Snippet for the update_job call in the CloudScheduler service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Scheduler::V1beta1::CloudScheduler::Client#update_job.", - "file": "cloud_scheduler/update_job.rb", - "language": "RUBY", - "client_method": { - "short_name": "update_job", - "full_name": "::Google::Cloud::Scheduler::V1beta1::CloudScheduler::Client#update_job", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::Scheduler::V1beta1::UpdateJobRequest", - "name": "request" - } - ], - "result_type": "::Google::Cloud::Scheduler::V1beta1::Job", - "client": { - "short_name": "CloudScheduler::Client", - "full_name": "::Google::Cloud::Scheduler::V1beta1::CloudScheduler::Client" - }, - "method": { - "short_name": "UpdateJob", - "full_name": "google.cloud.scheduler.v1beta1.CloudScheduler.UpdateJob", - "service": { - "short_name": "CloudScheduler", - "full_name": "google.cloud.scheduler.v1beta1.CloudScheduler" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 46, - "type": "FULL" - } - ] - }, - { - "region_tag": "cloudscheduler_v1beta1_generated_CloudScheduler_DeleteJob_sync", - "title": "Snippet for the delete_job call in the CloudScheduler service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Scheduler::V1beta1::CloudScheduler::Client#delete_job.", - "file": "cloud_scheduler/delete_job.rb", - "language": "RUBY", - "client_method": { - "short_name": "delete_job", - "full_name": "::Google::Cloud::Scheduler::V1beta1::CloudScheduler::Client#delete_job", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::Scheduler::V1beta1::DeleteJobRequest", - "name": "request" - } - ], - "result_type": "::Google::Protobuf::Empty", - "client": { - "short_name": "CloudScheduler::Client", - "full_name": "::Google::Cloud::Scheduler::V1beta1::CloudScheduler::Client" - }, - "method": { - "short_name": "DeleteJob", - "full_name": "google.cloud.scheduler.v1beta1.CloudScheduler.DeleteJob", - "service": { - "short_name": "CloudScheduler", - "full_name": "google.cloud.scheduler.v1beta1.CloudScheduler" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 46, - "type": "FULL" - } - ] - }, - { - "region_tag": "cloudscheduler_v1beta1_generated_CloudScheduler_PauseJob_sync", - "title": "Snippet for the pause_job call in the CloudScheduler service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Scheduler::V1beta1::CloudScheduler::Client#pause_job.", - "file": "cloud_scheduler/pause_job.rb", - "language": "RUBY", - "client_method": { - "short_name": "pause_job", - "full_name": "::Google::Cloud::Scheduler::V1beta1::CloudScheduler::Client#pause_job", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::Scheduler::V1beta1::PauseJobRequest", - "name": "request" - } - ], - "result_type": "::Google::Cloud::Scheduler::V1beta1::Job", - "client": { - "short_name": "CloudScheduler::Client", - "full_name": "::Google::Cloud::Scheduler::V1beta1::CloudScheduler::Client" - }, - "method": { - "short_name": "PauseJob", - "full_name": "google.cloud.scheduler.v1beta1.CloudScheduler.PauseJob", - "service": { - "short_name": "CloudScheduler", - "full_name": "google.cloud.scheduler.v1beta1.CloudScheduler" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 46, - "type": "FULL" - } - ] - }, - { - "region_tag": "cloudscheduler_v1beta1_generated_CloudScheduler_ResumeJob_sync", - "title": "Snippet for the resume_job call in the CloudScheduler service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Scheduler::V1beta1::CloudScheduler::Client#resume_job.", - "file": "cloud_scheduler/resume_job.rb", - "language": "RUBY", - "client_method": { - "short_name": "resume_job", - "full_name": "::Google::Cloud::Scheduler::V1beta1::CloudScheduler::Client#resume_job", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::Scheduler::V1beta1::ResumeJobRequest", - "name": "request" - } - ], - "result_type": "::Google::Cloud::Scheduler::V1beta1::Job", - "client": { - "short_name": "CloudScheduler::Client", - "full_name": "::Google::Cloud::Scheduler::V1beta1::CloudScheduler::Client" - }, - "method": { - "short_name": "ResumeJob", - "full_name": "google.cloud.scheduler.v1beta1.CloudScheduler.ResumeJob", - "service": { - "short_name": "CloudScheduler", - "full_name": "google.cloud.scheduler.v1beta1.CloudScheduler" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 46, - "type": "FULL" - } - ] - }, - { - "region_tag": "cloudscheduler_v1beta1_generated_CloudScheduler_RunJob_sync", - "title": "Snippet for the run_job call in the CloudScheduler service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Scheduler::V1beta1::CloudScheduler::Client#run_job.", - "file": "cloud_scheduler/run_job.rb", - "language": "RUBY", - "client_method": { - "short_name": "run_job", - "full_name": "::Google::Cloud::Scheduler::V1beta1::CloudScheduler::Client#run_job", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::Scheduler::V1beta1::RunJobRequest", - "name": "request" - } - ], - "result_type": "::Google::Cloud::Scheduler::V1beta1::Job", - "client": { - "short_name": "CloudScheduler::Client", - "full_name": "::Google::Cloud::Scheduler::V1beta1::CloudScheduler::Client" - }, - "method": { - "short_name": "RunJob", - "full_name": "google.cloud.scheduler.v1beta1.CloudScheduler.RunJob", - "service": { - "short_name": "CloudScheduler", - "full_name": "google.cloud.scheduler.v1beta1.CloudScheduler" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 46, - "type": "FULL" - } - ] - } - ] -} \ No newline at end of file diff --git a/owl-bot-staging/google-cloud-scheduler-v1beta1/test/google/cloud/scheduler/v1beta1/cloud_scheduler_paths_test.rb b/owl-bot-staging/google-cloud-scheduler-v1beta1/test/google/cloud/scheduler/v1beta1/cloud_scheduler_paths_test.rb deleted file mode 100644 index 753de68473c5..000000000000 --- a/owl-bot-staging/google-cloud-scheduler-v1beta1/test/google/cloud/scheduler/v1beta1/cloud_scheduler_paths_test.rb +++ /dev/null @@ -1,79 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -require "helper" - -require "gapic/grpc/service_stub" - -require "google/cloud/scheduler/v1beta1/cloud_scheduler" - -class ::Google::Cloud::Scheduler::V1beta1::CloudScheduler::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_job_path - grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - ::Gapic::ServiceStub.stub :new, DummyStub.new do - client = ::Google::Cloud::Scheduler::V1beta1::CloudScheduler::Client.new do |config| - config.credentials = grpc_channel - end - - path = client.job_path project: "value0", location: "value1", job: "value2" - assert_equal "projects/value0/locations/value1/jobs/value2", path - end - end - - def test_location_path - grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - ::Gapic::ServiceStub.stub :new, DummyStub.new do - client = ::Google::Cloud::Scheduler::V1beta1::CloudScheduler::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_topic_path - grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - ::Gapic::ServiceStub.stub :new, DummyStub.new do - client = ::Google::Cloud::Scheduler::V1beta1::CloudScheduler::Client.new do |config| - config.credentials = grpc_channel - end - - path = client.topic_path project: "value0", topic: "value1" - assert_equal "projects/value0/topics/value1", path - end - end -end diff --git a/owl-bot-staging/google-cloud-scheduler-v1beta1/test/google/cloud/scheduler/v1beta1/cloud_scheduler_rest_test.rb b/owl-bot-staging/google-cloud-scheduler-v1beta1/test/google/cloud/scheduler/v1beta1/cloud_scheduler_rest_test.rb deleted file mode 100644 index f050bab21648..000000000000 --- a/owl-bot-staging/google-cloud-scheduler-v1beta1/test/google/cloud/scheduler/v1beta1/cloud_scheduler_rest_test.rb +++ /dev/null @@ -1,539 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -require "helper" -require "gapic/rest" -require "google/cloud/scheduler/v1beta1/cloudscheduler_pb" -require "google/cloud/scheduler/v1beta1/cloud_scheduler/rest" - - -class ::Google::Cloud::Scheduler::V1beta1::CloudScheduler::Rest::ClientTest < Minitest::Test - class ClientStub - attr_accessor :call_count, :requests - - def initialize response, &block - @response = response - @block = block - @call_count = 0 - @requests = [] - end - - def make_get_request uri:, params: {}, options: {}, method_name: nil - make_http_request :get, uri: uri, body: nil, params: params, options: options, method_name: method_name - end - - def make_delete_request uri:, params: {}, options: {}, method_name: nil - make_http_request :delete, uri: uri, body: nil, params: params, options: options, method_name: method_name - end - - def make_post_request uri:, body: nil, params: {}, options: {}, method_name: nil - make_http_request :post, uri: uri, body: body, params: params, options: options, method_name: method_name - end - - def make_patch_request uri:, body:, params: {}, options: {}, method_name: nil - make_http_request :patch, uri: uri, body: body, params: params, options: options, method_name: method_name - end - - def make_put_request uri:, body:, params: {}, options: {}, method_name: nil - make_http_request :put, uri: uri, body: body, params: params, options: options, method_name: method_name - end - - def make_http_request *args, **kwargs - @call_count += 1 - - @requests << @block&.call(*args, **kwargs) - - @response - end - - def endpoint - "endpoint.example.com" - end - - def universe_domain - "example.com" - end - - def stub_logger - nil - end - - def logger - nil - end - end - - def test_list_jobs - # Create test objects. - client_result = ::Google::Cloud::Scheduler::V1beta1::ListJobsResponse.new - http_response = OpenStruct.new body: client_result.to_json - - call_options = {} - - # Create request parameters for a unary method. - parent = "hello world" - filter = "hello world" - page_size = 42 - page_token = "hello world" - legacy_app_engine_cron = true - - list_jobs_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| - assert options.metadata.key? :"x-goog-api-client" - assert options.metadata[:"x-goog-api-client"].include? "rest" - refute options.metadata[:"x-goog-api-client"].include? "grpc" - end - - ::Google::Cloud::Scheduler::V1beta1::CloudScheduler::Rest::ServiceStub.stub :transcode_list_jobs_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, list_jobs_client_stub do - # Create client - client = ::Google::Cloud::Scheduler::V1beta1::CloudScheduler::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - client.list_jobs({ parent: parent, filter: filter, page_size: page_size, page_token: page_token, legacy_app_engine_cron: legacy_app_engine_cron }) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use named arguments - client.list_jobs parent: parent, filter: filter, page_size: page_size, page_token: page_token, legacy_app_engine_cron: legacy_app_engine_cron do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object - client.list_jobs ::Google::Cloud::Scheduler::V1beta1::ListJobsRequest.new(parent: parent, filter: filter, page_size: page_size, page_token: page_token, legacy_app_engine_cron: legacy_app_engine_cron) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use hash object with options - client.list_jobs({ parent: parent, filter: filter, page_size: page_size, page_token: page_token, legacy_app_engine_cron: legacy_app_engine_cron }, call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object with options - client.list_jobs(::Google::Cloud::Scheduler::V1beta1::ListJobsRequest.new(parent: parent, filter: filter, page_size: page_size, page_token: page_token, legacy_app_engine_cron: legacy_app_engine_cron), call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Verify method calls - assert_equal 5, list_jobs_client_stub.call_count - end - end - end - - def test_get_job - # Create test objects. - client_result = ::Google::Cloud::Scheduler::V1beta1::Job.new - http_response = OpenStruct.new body: client_result.to_json - - call_options = {} - - # Create request parameters for a unary method. - name = "hello world" - - get_job_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| - assert options.metadata.key? :"x-goog-api-client" - assert options.metadata[:"x-goog-api-client"].include? "rest" - refute options.metadata[:"x-goog-api-client"].include? "grpc" - end - - ::Google::Cloud::Scheduler::V1beta1::CloudScheduler::Rest::ServiceStub.stub :transcode_get_job_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, get_job_client_stub do - # Create client - client = ::Google::Cloud::Scheduler::V1beta1::CloudScheduler::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - client.get_job({ name: name }) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use named arguments - client.get_job name: name do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object - client.get_job ::Google::Cloud::Scheduler::V1beta1::GetJobRequest.new(name: name) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use hash object with options - client.get_job({ name: name }, call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object with options - client.get_job(::Google::Cloud::Scheduler::V1beta1::GetJobRequest.new(name: name), call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Verify method calls - assert_equal 5, get_job_client_stub.call_count - end - end - end - - def test_create_job - # Create test objects. - client_result = ::Google::Cloud::Scheduler::V1beta1::Job.new - http_response = OpenStruct.new body: client_result.to_json - - call_options = {} - - # Create request parameters for a unary method. - parent = "hello world" - job = {} - - create_job_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| - assert options.metadata.key? :"x-goog-api-client" - assert options.metadata[:"x-goog-api-client"].include? "rest" - refute options.metadata[:"x-goog-api-client"].include? "grpc" - end - - ::Google::Cloud::Scheduler::V1beta1::CloudScheduler::Rest::ServiceStub.stub :transcode_create_job_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, create_job_client_stub do - # Create client - client = ::Google::Cloud::Scheduler::V1beta1::CloudScheduler::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - client.create_job({ parent: parent, job: job }) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use named arguments - client.create_job parent: parent, job: job do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object - client.create_job ::Google::Cloud::Scheduler::V1beta1::CreateJobRequest.new(parent: parent, job: job) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use hash object with options - client.create_job({ parent: parent, job: job }, call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object with options - client.create_job(::Google::Cloud::Scheduler::V1beta1::CreateJobRequest.new(parent: parent, job: job), call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Verify method calls - assert_equal 5, create_job_client_stub.call_count - end - end - end - - def test_update_job - # Create test objects. - client_result = ::Google::Cloud::Scheduler::V1beta1::Job.new - http_response = OpenStruct.new body: client_result.to_json - - call_options = {} - - # Create request parameters for a unary method. - job = {} - update_mask = {} - - update_job_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| - assert options.metadata.key? :"x-goog-api-client" - assert options.metadata[:"x-goog-api-client"].include? "rest" - refute options.metadata[:"x-goog-api-client"].include? "grpc" - end - - ::Google::Cloud::Scheduler::V1beta1::CloudScheduler::Rest::ServiceStub.stub :transcode_update_job_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, update_job_client_stub do - # Create client - client = ::Google::Cloud::Scheduler::V1beta1::CloudScheduler::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - client.update_job({ job: job, update_mask: update_mask }) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use named arguments - client.update_job job: job, update_mask: update_mask do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object - client.update_job ::Google::Cloud::Scheduler::V1beta1::UpdateJobRequest.new(job: job, update_mask: update_mask) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use hash object with options - client.update_job({ job: job, update_mask: update_mask }, call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object with options - client.update_job(::Google::Cloud::Scheduler::V1beta1::UpdateJobRequest.new(job: job, update_mask: update_mask), call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Verify method calls - assert_equal 5, update_job_client_stub.call_count - end - end - end - - def test_delete_job - # Create test objects. - client_result = ::Google::Protobuf::Empty.new - http_response = OpenStruct.new body: client_result.to_json - - call_options = {} - - # Create request parameters for a unary method. - name = "hello world" - legacy_app_engine_cron = true - - delete_job_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| - assert options.metadata.key? :"x-goog-api-client" - assert options.metadata[:"x-goog-api-client"].include? "rest" - refute options.metadata[:"x-goog-api-client"].include? "grpc" - end - - ::Google::Cloud::Scheduler::V1beta1::CloudScheduler::Rest::ServiceStub.stub :transcode_delete_job_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, delete_job_client_stub do - # Create client - client = ::Google::Cloud::Scheduler::V1beta1::CloudScheduler::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - client.delete_job({ name: name, legacy_app_engine_cron: legacy_app_engine_cron }) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use named arguments - client.delete_job name: name, legacy_app_engine_cron: legacy_app_engine_cron do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object - client.delete_job ::Google::Cloud::Scheduler::V1beta1::DeleteJobRequest.new(name: name, legacy_app_engine_cron: legacy_app_engine_cron) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use hash object with options - client.delete_job({ name: name, legacy_app_engine_cron: legacy_app_engine_cron }, call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object with options - client.delete_job(::Google::Cloud::Scheduler::V1beta1::DeleteJobRequest.new(name: name, legacy_app_engine_cron: legacy_app_engine_cron), call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Verify method calls - assert_equal 5, delete_job_client_stub.call_count - end - end - end - - def test_pause_job - # Create test objects. - client_result = ::Google::Cloud::Scheduler::V1beta1::Job.new - http_response = OpenStruct.new body: client_result.to_json - - call_options = {} - - # Create request parameters for a unary method. - name = "hello world" - - pause_job_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| - assert options.metadata.key? :"x-goog-api-client" - assert options.metadata[:"x-goog-api-client"].include? "rest" - refute options.metadata[:"x-goog-api-client"].include? "grpc" - end - - ::Google::Cloud::Scheduler::V1beta1::CloudScheduler::Rest::ServiceStub.stub :transcode_pause_job_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, pause_job_client_stub do - # Create client - client = ::Google::Cloud::Scheduler::V1beta1::CloudScheduler::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - client.pause_job({ name: name }) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use named arguments - client.pause_job name: name do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object - client.pause_job ::Google::Cloud::Scheduler::V1beta1::PauseJobRequest.new(name: name) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use hash object with options - client.pause_job({ name: name }, call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object with options - client.pause_job(::Google::Cloud::Scheduler::V1beta1::PauseJobRequest.new(name: name), call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Verify method calls - assert_equal 5, pause_job_client_stub.call_count - end - end - end - - def test_resume_job - # Create test objects. - client_result = ::Google::Cloud::Scheduler::V1beta1::Job.new - http_response = OpenStruct.new body: client_result.to_json - - call_options = {} - - # Create request parameters for a unary method. - name = "hello world" - - resume_job_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| - assert options.metadata.key? :"x-goog-api-client" - assert options.metadata[:"x-goog-api-client"].include? "rest" - refute options.metadata[:"x-goog-api-client"].include? "grpc" - end - - ::Google::Cloud::Scheduler::V1beta1::CloudScheduler::Rest::ServiceStub.stub :transcode_resume_job_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, resume_job_client_stub do - # Create client - client = ::Google::Cloud::Scheduler::V1beta1::CloudScheduler::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - client.resume_job({ name: name }) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use named arguments - client.resume_job name: name do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object - client.resume_job ::Google::Cloud::Scheduler::V1beta1::ResumeJobRequest.new(name: name) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use hash object with options - client.resume_job({ name: name }, call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object with options - client.resume_job(::Google::Cloud::Scheduler::V1beta1::ResumeJobRequest.new(name: name), call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Verify method calls - assert_equal 5, resume_job_client_stub.call_count - end - end - end - - def test_run_job - # Create test objects. - client_result = ::Google::Cloud::Scheduler::V1beta1::Job.new - http_response = OpenStruct.new body: client_result.to_json - - call_options = {} - - # Create request parameters for a unary method. - name = "hello world" - legacy_app_engine_cron = true - - run_job_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| - assert options.metadata.key? :"x-goog-api-client" - assert options.metadata[:"x-goog-api-client"].include? "rest" - refute options.metadata[:"x-goog-api-client"].include? "grpc" - end - - ::Google::Cloud::Scheduler::V1beta1::CloudScheduler::Rest::ServiceStub.stub :transcode_run_job_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, run_job_client_stub do - # Create client - client = ::Google::Cloud::Scheduler::V1beta1::CloudScheduler::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - client.run_job({ name: name, legacy_app_engine_cron: legacy_app_engine_cron }) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use named arguments - client.run_job name: name, legacy_app_engine_cron: legacy_app_engine_cron do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object - client.run_job ::Google::Cloud::Scheduler::V1beta1::RunJobRequest.new(name: name, legacy_app_engine_cron: legacy_app_engine_cron) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use hash object with options - client.run_job({ name: name, legacy_app_engine_cron: legacy_app_engine_cron }, call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object with options - client.run_job(::Google::Cloud::Scheduler::V1beta1::RunJobRequest.new(name: name, legacy_app_engine_cron: legacy_app_engine_cron), call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Verify method calls - assert_equal 5, run_job_client_stub.call_count - end - end - end - - def test_configure - credentials_token = :dummy_value - - client = block_config = config = nil - dummy_stub = ClientStub.new nil - Gapic::Rest::ClientStub.stub :new, dummy_stub do - client = ::Google::Cloud::Scheduler::V1beta1::CloudScheduler::Rest::Client.new do |config| - config.credentials = credentials_token - end - end - - config = client.configure do |c| - block_config = c - end - - assert_same block_config, config - assert_kind_of ::Google::Cloud::Scheduler::V1beta1::CloudScheduler::Rest::Client::Configuration, config - end -end diff --git a/owl-bot-staging/google-cloud-scheduler-v1beta1/test/google/cloud/scheduler/v1beta1/cloud_scheduler_test.rb b/owl-bot-staging/google-cloud-scheduler-v1beta1/test/google/cloud/scheduler/v1beta1/cloud_scheduler_test.rb deleted file mode 100644 index 847aeedfb1c4..000000000000 --- a/owl-bot-staging/google-cloud-scheduler-v1beta1/test/google/cloud/scheduler/v1beta1/cloud_scheduler_test.rb +++ /dev/null @@ -1,589 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -require "helper" - -require "gapic/grpc/service_stub" - -require "google/cloud/scheduler/v1beta1/cloudscheduler_pb" -require "google/cloud/scheduler/v1beta1/cloud_scheduler" - -class ::Google::Cloud::Scheduler::V1beta1::CloudScheduler::ClientTest < Minitest::Test - class ClientStub - attr_accessor :call_rpc_count, :requests - - def initialize response, operation, &block - @response = response - @operation = operation - @block = block - @call_rpc_count = 0 - @requests = [] - end - - def call_rpc *args, **kwargs - @call_rpc_count += 1 - - @requests << @block&.call(*args, **kwargs) - - catch :response do - yield @response, @operation if block_given? - @response - end - end - - def endpoint - "endpoint.example.com" - end - - def universe_domain - "example.com" - end - - def stub_logger - nil - end - - def logger - nil - end - end - - def test_list_jobs - # Create GRPC objects. - grpc_response = ::Google::Cloud::Scheduler::V1beta1::ListJobsResponse.new - grpc_operation = GRPC::ActiveCall::Operation.new nil - grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - grpc_options = {} - - # Create request parameters for a unary method. - parent = "hello world" - filter = "hello world" - page_size = 42 - page_token = "hello world" - legacy_app_engine_cron = true - - list_jobs_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :list_jobs, name - assert_kind_of ::Google::Cloud::Scheduler::V1beta1::ListJobsRequest, request - assert_equal "hello world", request["parent"] - assert_equal "hello world", request["filter"] - assert_equal 42, request["page_size"] - assert_equal "hello world", request["page_token"] - assert_equal true, request["legacy_app_engine_cron"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, list_jobs_client_stub do - # Create client - client = ::Google::Cloud::Scheduler::V1beta1::CloudScheduler::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.list_jobs({ parent: parent, filter: filter, page_size: page_size, page_token: page_token, legacy_app_engine_cron: legacy_app_engine_cron }) do |response, operation| - assert_kind_of Gapic::PagedEnumerable, response - assert_equal grpc_response, response.response - assert_equal grpc_operation, operation - end - - # Use named arguments - client.list_jobs parent: parent, filter: filter, page_size: page_size, page_token: page_token, legacy_app_engine_cron: legacy_app_engine_cron do |response, operation| - assert_kind_of Gapic::PagedEnumerable, response - assert_equal grpc_response, response.response - assert_equal grpc_operation, operation - end - - # Use protobuf object - client.list_jobs ::Google::Cloud::Scheduler::V1beta1::ListJobsRequest.new(parent: parent, filter: filter, page_size: page_size, page_token: page_token, legacy_app_engine_cron: legacy_app_engine_cron) do |response, operation| - assert_kind_of Gapic::PagedEnumerable, response - assert_equal grpc_response, response.response - assert_equal grpc_operation, operation - end - - # Use hash object with options - client.list_jobs({ parent: parent, filter: filter, page_size: page_size, page_token: page_token, legacy_app_engine_cron: legacy_app_engine_cron }, grpc_options) do |response, operation| - assert_kind_of Gapic::PagedEnumerable, response - assert_equal grpc_response, response.response - assert_equal grpc_operation, operation - end - - # Use protobuf object with options - client.list_jobs(::Google::Cloud::Scheduler::V1beta1::ListJobsRequest.new(parent: parent, filter: filter, page_size: page_size, page_token: page_token, legacy_app_engine_cron: legacy_app_engine_cron), grpc_options) do |response, operation| - assert_kind_of Gapic::PagedEnumerable, response - assert_equal grpc_response, response.response - assert_equal grpc_operation, operation - end - - # Verify method calls - assert_equal 5, list_jobs_client_stub.call_rpc_count - end - end - - def test_get_job - # Create GRPC objects. - grpc_response = ::Google::Cloud::Scheduler::V1beta1::Job.new - grpc_operation = GRPC::ActiveCall::Operation.new nil - grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - grpc_options = {} - - # Create request parameters for a unary method. - name = "hello world" - - get_job_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :get_job, name - assert_kind_of ::Google::Cloud::Scheduler::V1beta1::GetJobRequest, request - assert_equal "hello world", request["name"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, get_job_client_stub do - # Create client - client = ::Google::Cloud::Scheduler::V1beta1::CloudScheduler::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.get_job({ name: name }) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use named arguments - client.get_job name: name do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object - client.get_job ::Google::Cloud::Scheduler::V1beta1::GetJobRequest.new(name: name) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use hash object with options - client.get_job({ name: name }, grpc_options) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object with options - client.get_job(::Google::Cloud::Scheduler::V1beta1::GetJobRequest.new(name: name), grpc_options) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Verify method calls - assert_equal 5, get_job_client_stub.call_rpc_count - end - end - - def test_create_job - # Create GRPC objects. - grpc_response = ::Google::Cloud::Scheduler::V1beta1::Job.new - grpc_operation = GRPC::ActiveCall::Operation.new nil - grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - grpc_options = {} - - # Create request parameters for a unary method. - parent = "hello world" - job = {} - - create_job_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :create_job, name - assert_kind_of ::Google::Cloud::Scheduler::V1beta1::CreateJobRequest, request - assert_equal "hello world", request["parent"] - assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::Scheduler::V1beta1::Job), request["job"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, create_job_client_stub do - # Create client - client = ::Google::Cloud::Scheduler::V1beta1::CloudScheduler::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.create_job({ parent: parent, job: job }) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use named arguments - client.create_job parent: parent, job: job do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object - client.create_job ::Google::Cloud::Scheduler::V1beta1::CreateJobRequest.new(parent: parent, job: job) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use hash object with options - client.create_job({ parent: parent, job: job }, grpc_options) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object with options - client.create_job(::Google::Cloud::Scheduler::V1beta1::CreateJobRequest.new(parent: parent, job: job), grpc_options) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Verify method calls - assert_equal 5, create_job_client_stub.call_rpc_count - end - end - - def test_update_job - # Create GRPC objects. - grpc_response = ::Google::Cloud::Scheduler::V1beta1::Job.new - grpc_operation = GRPC::ActiveCall::Operation.new nil - grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - grpc_options = {} - - # Create request parameters for a unary method. - job = {} - update_mask = {} - - update_job_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :update_job, name - assert_kind_of ::Google::Cloud::Scheduler::V1beta1::UpdateJobRequest, request - assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::Scheduler::V1beta1::Job), request["job"] - assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Protobuf::FieldMask), request["update_mask"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, update_job_client_stub do - # Create client - client = ::Google::Cloud::Scheduler::V1beta1::CloudScheduler::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.update_job({ job: job, update_mask: update_mask }) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use named arguments - client.update_job job: job, update_mask: update_mask do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object - client.update_job ::Google::Cloud::Scheduler::V1beta1::UpdateJobRequest.new(job: job, update_mask: update_mask) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use hash object with options - client.update_job({ job: job, update_mask: update_mask }, grpc_options) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object with options - client.update_job(::Google::Cloud::Scheduler::V1beta1::UpdateJobRequest.new(job: job, update_mask: update_mask), grpc_options) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Verify method calls - assert_equal 5, update_job_client_stub.call_rpc_count - end - end - - def test_delete_job - # 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" - legacy_app_engine_cron = true - - delete_job_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :delete_job, name - assert_kind_of ::Google::Cloud::Scheduler::V1beta1::DeleteJobRequest, request - assert_equal "hello world", request["name"] - assert_equal true, request["legacy_app_engine_cron"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, delete_job_client_stub do - # Create client - client = ::Google::Cloud::Scheduler::V1beta1::CloudScheduler::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.delete_job({ name: name, legacy_app_engine_cron: legacy_app_engine_cron }) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use named arguments - client.delete_job name: name, legacy_app_engine_cron: legacy_app_engine_cron do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object - client.delete_job ::Google::Cloud::Scheduler::V1beta1::DeleteJobRequest.new(name: name, legacy_app_engine_cron: legacy_app_engine_cron) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use hash object with options - client.delete_job({ name: name, legacy_app_engine_cron: legacy_app_engine_cron }, grpc_options) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object with options - client.delete_job(::Google::Cloud::Scheduler::V1beta1::DeleteJobRequest.new(name: name, legacy_app_engine_cron: legacy_app_engine_cron), grpc_options) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Verify method calls - assert_equal 5, delete_job_client_stub.call_rpc_count - end - end - - def test_pause_job - # Create GRPC objects. - grpc_response = ::Google::Cloud::Scheduler::V1beta1::Job.new - grpc_operation = GRPC::ActiveCall::Operation.new nil - grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - grpc_options = {} - - # Create request parameters for a unary method. - name = "hello world" - - pause_job_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :pause_job, name - assert_kind_of ::Google::Cloud::Scheduler::V1beta1::PauseJobRequest, request - assert_equal "hello world", request["name"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, pause_job_client_stub do - # Create client - client = ::Google::Cloud::Scheduler::V1beta1::CloudScheduler::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.pause_job({ name: name }) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use named arguments - client.pause_job name: name do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object - client.pause_job ::Google::Cloud::Scheduler::V1beta1::PauseJobRequest.new(name: name) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use hash object with options - client.pause_job({ name: name }, grpc_options) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object with options - client.pause_job(::Google::Cloud::Scheduler::V1beta1::PauseJobRequest.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, pause_job_client_stub.call_rpc_count - end - end - - def test_resume_job - # Create GRPC objects. - grpc_response = ::Google::Cloud::Scheduler::V1beta1::Job.new - grpc_operation = GRPC::ActiveCall::Operation.new nil - grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - grpc_options = {} - - # Create request parameters for a unary method. - name = "hello world" - - resume_job_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :resume_job, name - assert_kind_of ::Google::Cloud::Scheduler::V1beta1::ResumeJobRequest, request - assert_equal "hello world", request["name"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, resume_job_client_stub do - # Create client - client = ::Google::Cloud::Scheduler::V1beta1::CloudScheduler::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.resume_job({ name: name }) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use named arguments - client.resume_job name: name do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object - client.resume_job ::Google::Cloud::Scheduler::V1beta1::ResumeJobRequest.new(name: name) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use hash object with options - client.resume_job({ name: name }, grpc_options) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object with options - client.resume_job(::Google::Cloud::Scheduler::V1beta1::ResumeJobRequest.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, resume_job_client_stub.call_rpc_count - end - end - - def test_run_job - # Create GRPC objects. - grpc_response = ::Google::Cloud::Scheduler::V1beta1::Job.new - grpc_operation = GRPC::ActiveCall::Operation.new nil - grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - grpc_options = {} - - # Create request parameters for a unary method. - name = "hello world" - legacy_app_engine_cron = true - - run_job_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :run_job, name - assert_kind_of ::Google::Cloud::Scheduler::V1beta1::RunJobRequest, request - assert_equal "hello world", request["name"] - assert_equal true, request["legacy_app_engine_cron"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, run_job_client_stub do - # Create client - client = ::Google::Cloud::Scheduler::V1beta1::CloudScheduler::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.run_job({ name: name, legacy_app_engine_cron: legacy_app_engine_cron }) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use named arguments - client.run_job name: name, legacy_app_engine_cron: legacy_app_engine_cron do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object - client.run_job ::Google::Cloud::Scheduler::V1beta1::RunJobRequest.new(name: name, legacy_app_engine_cron: legacy_app_engine_cron) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use hash object with options - client.run_job({ name: name, legacy_app_engine_cron: legacy_app_engine_cron }, grpc_options) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object with options - client.run_job(::Google::Cloud::Scheduler::V1beta1::RunJobRequest.new(name: name, legacy_app_engine_cron: legacy_app_engine_cron), grpc_options) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Verify method calls - assert_equal 5, run_job_client_stub.call_rpc_count - end - end - - def test_configure - grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - - client = block_config = config = nil - dummy_stub = ClientStub.new nil, nil - Gapic::ServiceStub.stub :new, dummy_stub do - client = ::Google::Cloud::Scheduler::V1beta1::CloudScheduler::Client.new do |config| - config.credentials = grpc_channel - end - end - - config = client.configure do |c| - block_config = c - end - - assert_same block_config, config - assert_kind_of ::Google::Cloud::Scheduler::V1beta1::CloudScheduler::Client::Configuration, config - end - - def test_credentials - key = OpenSSL::PKey::RSA.new 2048 - cred_json = { - "private_key" => key.to_pem, - "client_email" => "app@developer.gserviceaccount.com", - "type" => "service_account" - } - key_file = StringIO.new cred_json.to_json - creds = Google::Auth::ServiceAccountCredentials.make_creds({ json_key_io: key_file }) - - dummy_stub = ClientStub.new nil, nil - Gapic::ServiceStub.stub :new, dummy_stub do - client = ::Google::Cloud::Scheduler::V1beta1::CloudScheduler::Client.new do |config| - config.credentials = creds - end - assert_kind_of ::Google::Cloud::Scheduler::V1beta1::CloudScheduler::Client, client - assert_equal creds, client.configure.credentials - end - end -end diff --git a/owl-bot-staging/google-cloud-scheduler-v1beta1/test/helper.rb b/owl-bot-staging/google-cloud-scheduler-v1beta1/test/helper.rb deleted file mode 100644 index 672b337030e7..000000000000 --- a/owl-bot-staging/google-cloud-scheduler-v1beta1/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" diff --git a/owl-bot-staging/google-cloud-secret_manager-v1/.gitignore b/owl-bot-staging/google-cloud-secret_manager-v1/.gitignore deleted file mode 100644 index 0135b6bc6cfc..000000000000 --- a/owl-bot-staging/google-cloud-secret_manager-v1/.gitignore +++ /dev/null @@ -1,22 +0,0 @@ -# Ignore bundler lockfiles -Gemfile.lock -gems.locked - -# Ignore documentation output -doc/* -.yardoc/* - -# Ignore test output -coverage/* - -# Ignore build artifacts -pkg/* - -# Ignore files commonly present in certain dev environments -.vagrant -.DS_STORE -.idea -*.iml - -# Ignore synth output -__pycache__ diff --git a/owl-bot-staging/google-cloud-secret_manager-v1/.repo-metadata.json b/owl-bot-staging/google-cloud-secret_manager-v1/.repo-metadata.json deleted file mode 100644 index 828476632af4..000000000000 --- a/owl-bot-staging/google-cloud-secret_manager-v1/.repo-metadata.json +++ /dev/null @@ -1,18 +0,0 @@ -{ - "api_id": "secretmanager.googleapis.com", - "api_shortname": "secretmanager", - "client_documentation": "https://cloud.google.com/ruby/docs/reference/google-cloud-secret_manager-v1/latest", - "distribution_name": "google-cloud-secret_manager-v1", - "is_cloud": true, - "language": "ruby", - "name": "secretmanager", - "name_pretty": "Secret Manager V1 API", - "product_documentation": "https://cloud.google.com/secret-manager", - "release_level": "unreleased", - "repo": "googleapis/google-cloud-ruby", - "requires_billing": true, - "ruby-cloud-description": "Secret Manager is a secure and convenient storage system for API keys, passwords, certificates, and other sensitive data. Secret Manager provides a central place and single source of truth to manage, access, and audit secrets across Google Cloud. Note that google-cloud-secret_manager-v1 is a version-specific client library. For most uses, we recommend installing the main client library google-cloud-secret_manager instead. See the readme for more details.", - "ruby-cloud-env-prefix": "SECRET_MANAGER", - "ruby-cloud-product-url": "https://cloud.google.com/secret-manager", - "library_type": "GAPIC_AUTO" -} diff --git a/owl-bot-staging/google-cloud-secret_manager-v1/.rubocop.yml b/owl-bot-staging/google-cloud-secret_manager-v1/.rubocop.yml deleted file mode 100644 index 2600ed75e42a..000000000000 --- a/owl-bot-staging/google-cloud-secret_manager-v1/.rubocop.yml +++ /dev/null @@ -1,33 +0,0 @@ -inherit_gem: - google-style: google-style.yml - -AllCops: - Exclude: - - "google-cloud-secret_manager-v1.gemspec" - - "lib/**/*_pb.rb" - - "proto_docs/**/*" - - "test/**/*" - - "acceptance/**/*" - - "samples/acceptance/**/*" - - "Rakefile" - -Layout/LineLength: - Enabled: false -Metrics/AbcSize: - Enabled: false -Metrics/ClassLength: - Enabled: false -Metrics/CyclomaticComplexity: - Enabled: false -Metrics/MethodLength: - Enabled: false -Metrics/ModuleLength: - Enabled: false -Metrics/PerceivedComplexity: - Enabled: false -Naming/AccessorMethodName: - Exclude: - - "snippets/**/*.rb" -Naming/FileName: - Exclude: - - "lib/google-cloud-secret_manager-v1.rb" diff --git a/owl-bot-staging/google-cloud-secret_manager-v1/.toys.rb b/owl-bot-staging/google-cloud-secret_manager-v1/.toys.rb deleted file mode 100644 index 177e22456e8a..000000000000 --- a/owl-bot-staging/google-cloud-secret_manager-v1/.toys.rb +++ /dev/null @@ -1,28 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -toys_version! ">= 0.15.3" - -if ENV["RUBY_COMMON_TOOLS"] - common_tools_dir = File.expand_path ENV["RUBY_COMMON_TOOLS"] - load File.join(common_tools_dir, "toys", "gapic") -else - load_git remote: "https://github.com/googleapis/ruby-common-tools.git", - path: "toys/gapic", - update: true -end diff --git a/owl-bot-staging/google-cloud-secret_manager-v1/.yardopts b/owl-bot-staging/google-cloud-secret_manager-v1/.yardopts deleted file mode 100644 index 6a5817faa0dc..000000000000 --- a/owl-bot-staging/google-cloud-secret_manager-v1/.yardopts +++ /dev/null @@ -1,12 +0,0 @@ ---no-private ---title="Secret Manager V1 API" ---exclude _pb\.rb$ ---markup markdown ---markup-provider redcarpet - -./lib/**/*.rb -./proto_docs/**/*.rb -- -README.md -LICENSE.md -AUTHENTICATION.md diff --git a/owl-bot-staging/google-cloud-secret_manager-v1/AUTHENTICATION.md b/owl-bot-staging/google-cloud-secret_manager-v1/AUTHENTICATION.md deleted file mode 100644 index 6ba9773b1dc0..000000000000 --- a/owl-bot-staging/google-cloud-secret_manager-v1/AUTHENTICATION.md +++ /dev/null @@ -1,122 +0,0 @@ -# Authentication - -The recommended way to authenticate to the google-cloud-secret_manager-v1 library is to use -[Application Default Credentials (ADC)](https://cloud.google.com/docs/authentication/application-default-credentials). -To review all of your authentication options, see [Credentials lookup](#credential-lookup). - -## Quickstart - -The following example shows how to set up authentication for a local development -environment with your user credentials. - -**NOTE:** This method is _not_ recommended for running in production. User credentials -should be used only during development. - -1. [Download and install the Google Cloud CLI](https://cloud.google.com/sdk). -2. Set up a local ADC file with your user credentials: - -```sh -gcloud auth application-default login -``` - -3. Write code as if already authenticated. - -For more information about setting up authentication for a local development environment, see -[Set up Application Default Credentials](https://cloud.google.com/docs/authentication/provide-credentials-adc#local-dev). - -## Credential Lookup - -The google-cloud-secret_manager-v1 library provides several mechanisms to configure your system. -Generally, using Application Default Credentials to facilitate automatic -credentials discovery is the easist method. But if you need to explicitly specify -credentials, there are several methods available to you. - -Credentials are accepted in the following ways, in the following order or precedence: - -1. Credentials specified in method arguments -2. Credentials specified in configuration -3. Credentials pointed to or included in environment variables -4. Credentials found in local ADC file -5. Credentials returned by the metadata server for the attached service account (GCP) - -### Configuration - -You can configure a path to a JSON credentials file, either for an individual client object or -globally, for all client objects. The JSON file can contain credentials created for -[workload identity federation](https://cloud.google.com/iam/docs/workload-identity-federation), -[workforce identity federation](https://cloud.google.com/iam/docs/workforce-identity-federation), or a -[service account key](https://cloud.google.com/docs/authentication/provide-credentials-adc#local-key). - -Note: Service account keys are a security risk if not managed correctly. You should -[choose a more secure alternative to service account keys](https://cloud.google.com/docs/authentication#auth-decision-tree) -whenever possible. - -To configure a credentials file for an individual client initialization: - -```ruby -require "google/cloud/secret_manager/v1" - -client = ::Google::Cloud::SecretManager::V1::SecretManagerService::Client.new do |config| - config.credentials = "path/to/credentialfile.json" -end -``` - -To configure a credentials file globally for all clients: - -```ruby -require "google/cloud/secret_manager/v1" - -::Google::Cloud::SecretManager::V1::SecretManagerService::Client.configure do |config| - config.credentials = "path/to/credentialfile.json" -end - -client = ::Google::Cloud::SecretManager::V1::SecretManagerService::Client.new -``` - -### Environment Variables - -You can also use an environment variable to provide a JSON credentials file. -The environment variable can contain a path to the credentials file or, for -environments such as Docker containers where writing files is not encouraged, -you can include the credentials file itself. - -The JSON file can contain credentials created for -[workload identity federation](https://cloud.google.com/iam/docs/workload-identity-federation), -[workforce identity federation](https://cloud.google.com/iam/docs/workforce-identity-federation), or a -[service account key](https://cloud.google.com/docs/authentication/provide-credentials-adc#local-key). - -Note: Service account keys are a security risk if not managed correctly. You should -[choose a more secure alternative to service account keys](https://cloud.google.com/docs/authentication#auth-decision-tree) -whenever possible. - -The environment variables that google-cloud-secret_manager-v1 -checks for credentials are: - -* `GOOGLE_CLOUD_CREDENTIALS` - Path to JSON file, or JSON contents -* `GOOGLE_APPLICATION_CREDENTIALS` - Path to JSON file - -```ruby -require "google/cloud/secret_manager/v1" - -ENV["GOOGLE_APPLICATION_CREDENTIALS"] = "path/to/credentialfile.json" - -client = ::Google::Cloud::SecretManager::V1::SecretManagerService::Client.new -``` - -### Local ADC file - -You can set up a local ADC file with your user credentials for authentication during -development. If credentials are not provided in code or in environment variables, -then the local ADC credentials are discovered. - -Follow the steps in [Quickstart](#quickstart) to set up a local ADC file. - -### Google Cloud Platform environments - -When running on Google Cloud Platform (GCP), including Google Compute Engine -(GCE), Google Kubernetes Engine (GKE), Google App Engine (GAE), Google Cloud -Functions (GCF) and Cloud Run, credentials are retrieved from the attached -service account automatically. Code should be written as if already authenticated. - -For more information, see -[Set up ADC for Google Cloud services](https://cloud.google.com/docs/authentication/provide-credentials-adc#attached-sa). diff --git a/owl-bot-staging/google-cloud-secret_manager-v1/CHANGELOG.md b/owl-bot-staging/google-cloud-secret_manager-v1/CHANGELOG.md deleted file mode 100644 index f88957a62ba2..000000000000 --- a/owl-bot-staging/google-cloud-secret_manager-v1/CHANGELOG.md +++ /dev/null @@ -1,2 +0,0 @@ -# Release History - diff --git a/owl-bot-staging/google-cloud-secret_manager-v1/Gemfile b/owl-bot-staging/google-cloud-secret_manager-v1/Gemfile deleted file mode 100644 index 1d08558908d8..000000000000 --- a/owl-bot-staging/google-cloud-secret_manager-v1/Gemfile +++ /dev/null @@ -1,14 +0,0 @@ -source "https://rubygems.org" - -gemspec - -gem "google-style", "~> 1.32.0" -gem "irb", "~> 1.17" -gem "minitest", "~> 6.0.2" -gem "minitest-focus", "~> 1.4" -gem "minitest-mock", "~> 5.27" -gem "minitest-rg", "~> 5.3" -gem "ostruct", "~> 0.5.5" -gem "rake", ">= 13.0" -gem "redcarpet", "~> 3.6" -gem "yard", "~> 0.9" diff --git a/owl-bot-staging/google-cloud-secret_manager-v1/LICENSE.md b/owl-bot-staging/google-cloud-secret_manager-v1/LICENSE.md deleted file mode 100644 index c261857ba6ad..000000000000 --- a/owl-bot-staging/google-cloud-secret_manager-v1/LICENSE.md +++ /dev/null @@ -1,201 +0,0 @@ - Apache License - Version 2.0, January 2004 - http://www.apache.org/licenses/ - - TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION - - 1. Definitions. - - "License" shall mean the terms and conditions for use, reproduction, - and distribution as defined by Sections 1 through 9 of this document. - - "Licensor" shall mean the copyright owner or entity authorized by - the copyright owner that is granting the License. - - "Legal Entity" shall mean the union of the acting entity and all - other entities that control, are controlled by, or are under common - control with that entity. For the purposes of this definition, - "control" means (i) the power, direct or indirect, to cause the - direction or management of such entity, whether by contract or - otherwise, or (ii) ownership of fifty percent (50%) or more of the - outstanding shares, or (iii) beneficial ownership of such entity. - - "You" (or "Your") shall mean an individual or Legal Entity - exercising permissions granted by this License. - - "Source" form shall mean the preferred form for making modifications, - including but not limited to software source code, documentation - source, and configuration files. - - "Object" form shall mean any form resulting from mechanical - transformation or translation of a Source form, including but - not limited to compiled object code, generated documentation, - and conversions to other media types. - - "Work" shall mean the work of authorship, whether in Source or - Object form, made available under the License, as indicated by a - copyright notice that is included in or attached to the work - (an example is provided in the Appendix below). - - "Derivative Works" shall mean any work, whether in Source or Object - form, that is based on (or derived from) the Work and for which the - editorial revisions, annotations, elaborations, or other modifications - represent, as a whole, an original work of authorship. For the purposes - of this License, Derivative Works shall not include works that remain - separable from, or merely link (or bind by name) to the interfaces of, - the Work and Derivative Works thereof. - - "Contribution" shall mean any work of authorship, including - the original version of the Work and any modifications or additions - to that Work or Derivative Works thereof, that is intentionally - submitted to Licensor for inclusion in the Work by the copyright owner - or by an individual or Legal Entity authorized to submit on behalf of - the copyright owner. For the purposes of this definition, "submitted" - means any form of electronic, verbal, or written communication sent - to the Licensor or its representatives, including but not limited to - communication on electronic mailing lists, source code control systems, - and issue tracking systems that are managed by, or on behalf of, the - Licensor for the purpose of discussing and improving the Work, but - excluding communication that is conspicuously marked or otherwise - designated in writing by the copyright owner as "Not a Contribution." - - "Contributor" shall mean Licensor and any individual or Legal Entity - on behalf of whom a Contribution has been received by Licensor and - subsequently incorporated within the Work. - - 2. Grant of Copyright License. Subject to the terms and conditions of - this License, each Contributor hereby grants to You a perpetual, - worldwide, non-exclusive, no-charge, royalty-free, irrevocable - copyright license to reproduce, prepare Derivative Works of, - publicly display, publicly perform, sublicense, and distribute the - Work and such Derivative Works in Source or Object form. - - 3. Grant of Patent License. Subject to the terms and conditions of - this License, each Contributor hereby grants to You a perpetual, - worldwide, non-exclusive, no-charge, royalty-free, irrevocable - (except as stated in this section) patent license to make, have made, - use, offer to sell, sell, import, and otherwise transfer the Work, - where such license applies only to those patent claims licensable - by such Contributor that are necessarily infringed by their - Contribution(s) alone or by combination of their Contribution(s) - with the Work to which such Contribution(s) was submitted. If You - institute patent litigation against any entity (including a - cross-claim or counterclaim in a lawsuit) alleging that the Work - or a Contribution incorporated within the Work constitutes direct - or contributory patent infringement, then any patent licenses - granted to You under this License for that Work shall terminate - as of the date such litigation is filed. - - 4. Redistribution. You may reproduce and distribute copies of the - Work or Derivative Works thereof in any medium, with or without - modifications, and in Source or Object form, provided that You - meet the following conditions: - - (a) You must give any other recipients of the Work or - Derivative Works a copy of this License; and - - (b) You must cause any modified files to carry prominent notices - stating that You changed the files; and - - (c) You must retain, in the Source form of any Derivative Works - that You distribute, all copyright, patent, trademark, and - attribution notices from the Source form of the Work, - excluding those notices that do not pertain to any part of - the Derivative Works; and - - (d) If the Work includes a "NOTICE" text file as part of its - distribution, then any Derivative Works that You distribute must - include a readable copy of the attribution notices contained - within such NOTICE file, excluding those notices that do not - pertain to any part of the Derivative Works, in at least one - of the following places: within a NOTICE text file distributed - as part of the Derivative Works; within the Source form or - documentation, if provided along with the Derivative Works; or, - within a display generated by the Derivative Works, if and - wherever such third-party notices normally appear. The contents - of the NOTICE file are for informational purposes only and - do not modify the License. You may add Your own attribution - notices within Derivative Works that You distribute, alongside - or as an addendum to the NOTICE text from the Work, provided - that such additional attribution notices cannot be construed - as modifying the License. - - You may add Your own copyright statement to Your modifications and - may provide additional or different license terms and conditions - for use, reproduction, or distribution of Your modifications, or - for any such Derivative Works as a whole, provided Your use, - reproduction, and distribution of the Work otherwise complies with - the conditions stated in this License. - - 5. Submission of Contributions. Unless You explicitly state otherwise, - any Contribution intentionally submitted for inclusion in the Work - by You to the Licensor shall be under the terms and conditions of - this License, without any additional terms or conditions. - Notwithstanding the above, nothing herein shall supersede or modify - the terms of any separate license agreement you may have executed - with Licensor regarding such Contributions. - - 6. Trademarks. This License does not grant permission to use the trade - names, trademarks, service marks, or product names of the Licensor, - except as required for reasonable and customary use in describing the - origin of the Work and reproducing the content of the NOTICE file. - - 7. Disclaimer of Warranty. Unless required by applicable law or - agreed to in writing, Licensor provides the Work (and each - Contributor provides its Contributions) on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or - implied, including, without limitation, any warranties or conditions - of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A - PARTICULAR PURPOSE. You are solely responsible for determining the - appropriateness of using or redistributing the Work and assume any - risks associated with Your exercise of permissions under this License. - - 8. Limitation of Liability. In no event and under no legal theory, - whether in tort (including negligence), contract, or otherwise, - unless required by applicable law (such as deliberate and grossly - negligent acts) or agreed to in writing, shall any Contributor be - liable to You for damages, including any direct, indirect, special, - incidental, or consequential damages of any character arising as a - result of this License or out of the use or inability to use the - Work (including but not limited to damages for loss of goodwill, - work stoppage, computer failure or malfunction, or any and all - other commercial damages or losses), even if such Contributor - has been advised of the possibility of such damages. - - 9. Accepting Warranty or Additional Liability. While redistributing - the Work or Derivative Works thereof, You may choose to offer, - and charge a fee for, acceptance of support, warranty, indemnity, - or other liability obligations and/or rights consistent with this - License. However, in accepting such obligations, You may act only - on Your own behalf and on Your sole responsibility, not on behalf - of any other Contributor, and only if You agree to indemnify, - defend, and hold each Contributor harmless for any liability - incurred by, or claims asserted against, such Contributor by reason - of your accepting any such warranty or additional liability. - - END OF TERMS AND CONDITIONS - - APPENDIX: How to apply the Apache License to your work. - - To apply the Apache License to your work, attach the following - boilerplate notice, with the fields enclosed by brackets "[]" - replaced with your own identifying information. (Don't include - the brackets!) The text should be enclosed in the appropriate - comment syntax for the file format. We also recommend that a - file or class name and description of purpose be included on the - same "printed page" as the copyright notice for easier - identification within third-party archives. - - Copyright [yyyy] [name of copyright owner] - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. diff --git a/owl-bot-staging/google-cloud-secret_manager-v1/README.md b/owl-bot-staging/google-cloud-secret_manager-v1/README.md deleted file mode 100644 index 729cba534926..000000000000 --- a/owl-bot-staging/google-cloud-secret_manager-v1/README.md +++ /dev/null @@ -1,154 +0,0 @@ -# Ruby Client for the Secret Manager V1 API - -Stores sensitive data such as API keys, passwords, and certificates. Provides convenience while improving security. - -Secret Manager is a secure and convenient storage system for API keys, passwords, certificates, and other sensitive data. Secret Manager provides a central place and single source of truth to manage, access, and audit secrets across Google Cloud. - -https://github.com/googleapis/google-cloud-ruby - -This gem is a _versioned_ client. It provides basic client classes for a -specific version of the Secret Manager V1 API. Most users should consider using -the main client gem, -[google-cloud-secret_manager](https://rubygems.org/gems/google-cloud-secret_manager). -See the section below titled *Which client should I use?* for more information. - -## Installation - -``` -$ gem install google-cloud-secret_manager-v1 -``` - -## Before You Begin - -In order to use this library, you first need to go through the following steps: - -1. [Select or create a Cloud Platform project.](https://console.cloud.google.com/project) -1. [Enable billing for your project.](https://cloud.google.com/billing/docs/how-to/modify-project#enable_billing_for_a_project) -1. [Enable the API.](https://console.cloud.google.com/apis/library/secretmanager.googleapis.com) -1. [Set up authentication.](AUTHENTICATION.md) - -## Quick Start - -```ruby -require "google/cloud/secret_manager/v1" - -client = ::Google::Cloud::SecretManager::V1::SecretManagerService::Client.new -request = ::Google::Cloud::SecretManager::V1::ListSecretsRequest.new # (request fields as keyword arguments...) -response = client.list_secrets request -``` - -View the [Client Library Documentation](https://cloud.google.com/ruby/docs/reference/google-cloud-secret_manager-v1/latest) -for class and method documentation. - -See also the [Product Documentation](https://cloud.google.com/secret-manager) -for general usage information. - -## Debug Logging - -This library comes with opt-in Debug Logging that can help you troubleshoot -your application's integration with the API. When logging is activated, key -events such as requests and responses, along with data payloads and metadata -such as headers and client configuration, are logged to the standard error -stream. - -**WARNING:** Client Library Debug Logging includes your data payloads in -plaintext, which could include sensitive data such as PII for yourself or your -customers, private keys, or other security data that could be compromising if -leaked. Always practice good data hygiene with your application logs, and follow -the principle of least access. Google also recommends that Client Library Debug -Logging be enabled only temporarily during active debugging, and not used -permanently in production. - -To enable logging, set the environment variable `GOOGLE_SDK_RUBY_LOGGING_GEMS` -to the value `all`. Alternatively, you can set the value to a comma-delimited -list of client library gem names. This will select the default logging behavior, -which writes logs to the standard error stream. On a local workstation, this may -result in logs appearing on the console. When running on a Google Cloud hosting -service such as [Google Cloud Run](https://cloud.google.com/run), this generally -results in logs appearing alongside your application logs in the -[Google Cloud Logging](https://cloud.google.com/logging/) service. - -You can customize logging by modifying the `logger` configuration when -constructing a client object. For example: - -```ruby -require "google/cloud/secret_manager/v1" -require "logger" - -client = ::Google::Cloud::SecretManager::V1::SecretManagerService::Client.new do |config| - config.logger = Logger.new "my-app.log" -end -``` - -## Google Cloud Samples - -To browse ready to use code samples check [Google Cloud Samples](https://cloud.google.com/docs/samples). - -## Supported Ruby Versions - -This library is supported on Ruby 3.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-secret_manager`, -and lower-level _versioned_ client libraries with names such as -`google-cloud-secret_manager-v1`. -_In most cases, you should install the main client._ - -### What's the difference between the main client and a versioned client? - -A _versioned client_ provides a basic set of data types and client classes for -a _single version_ of a specific service. (That is, for a service with multiple -versions, there might be a separate versioned client for each service version.) -Most versioned clients are written and maintained by a code generator. - -The _main client_ is designed to provide you with the _recommended_ client -interfaces for the service. There will be only one main client for any given -service, even a service with multiple versions. The main client includes -factory methods for constructing the client objects we recommend for most -users. In some cases, those will be classes provided by an underlying versioned -client; in other cases, they will be handwritten higher-level client objects -with additional capabilities, convenience methods, or best practices built in. -Generally, the main client will default to a recommended service version, -although in some cases you can override this if you need to talk to a specific -service version. - -### Why would I want to use the main client? - -We recommend that most users install the main client gem for a service. You can -identify this gem as the one _without_ a version in its name, e.g. -`google-cloud-secret_manager`. -The main client is recommended because it will embody the best practices for -accessing the service, and may also provide more convenient interfaces or -tighter integration into frameworks and third-party libraries. In addition, the -documentation and samples published by Google will generally demonstrate use of -the main client. - -### Why would I want to use a versioned client? - -You can use a versioned client if you are content with a possibly lower-level -class interface, you explicitly want to avoid features provided by the main -client, or you want to access a specific service version not be covered by the -main client. You can identify versioned client gems because the service version -is part of the name, e.g. `google-cloud-secret_manager-v1`. - -### What about the google-apis- clients? - -Client library gems with names that begin with `google-apis-` are based on an -older code generation technology. They talk to a REST/JSON backend (whereas -most modern clients talk to a [gRPC](https://grpc.io/) backend) and they may -not offer the same performance, features, and ease of use provided by more -modern clients. - -The `google-apis-` clients have wide coverage across Google services, so you -might need to use one if there is no modern client available for the service. -However, if a modern client is available, we generally recommend it over the -older `google-apis-` clients. diff --git a/owl-bot-staging/google-cloud-secret_manager-v1/Rakefile b/owl-bot-staging/google-cloud-secret_manager-v1/Rakefile deleted file mode 100644 index 47dd5c67678f..000000000000 --- a/owl-bot-staging/google-cloud-secret_manager-v1/Rakefile +++ /dev/null @@ -1,169 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -require "bundler/setup" -require "bundler/gem_tasks" - -require "rubocop/rake_task" -RuboCop::RakeTask.new - -require "rake/testtask" -desc "Run tests." -Rake::TestTask.new do |t| - t.libs << "test" - t.test_files = FileList["test/**/*_test.rb"] - t.warning = false -end - -desc "Runs the smoke tests." -Rake::TestTask.new :smoke_test do |t| - t.test_files = FileList["acceptance/**/*smoke_test.rb"] - t.warning = false -end - -# Acceptance tests -desc "Run the google-cloud-secret_manager-v1 acceptance tests." -task :acceptance, :project, :keyfile do |t, args| - project = args[:project] - project ||= - ENV["SECRET_MANAGER_TEST_PROJECT"] || - ENV["GCLOUD_TEST_PROJECT"] - keyfile = args[:keyfile] - keyfile ||= - ENV["SECRET_MANAGER_TEST_KEYFILE"] || - ENV["GCLOUD_TEST_KEYFILE"] - if keyfile - keyfile = File.read keyfile - else - keyfile ||= - ENV["SECRET_MANAGER_TEST_KEYFILE_JSON"] || - ENV["GCLOUD_TEST_KEYFILE_JSON"] - end - if project.nil? || keyfile.nil? - fail "You must provide a project and keyfile. e.g. rake acceptance[test123, /path/to/keyfile.json] or SECRET_MANAGER_TEST_PROJECT=test123 SECRET_MANAGER_TEST_KEYFILE=/path/to/keyfile.json rake acceptance" - end - require "google/cloud/secret_manager/v1/secret_manager_service/credentials" - ::Google::Cloud::SecretManager::V1::SecretManagerService::Credentials.env_vars.each do |path| - ENV[path] = nil - end - ENV["SECRET_MANAGER_PROJECT"] = project - ENV["SECRET_MANAGER_TEST_PROJECT"] = project - ENV["SECRET_MANAGER_KEYFILE_JSON"] = keyfile - - Rake::Task["acceptance:run"].invoke -end - -namespace :acceptance do - task :run do - if File.directory? "acceptance" - Rake::Task[:smoke_test].invoke - else - puts "The google-cloud-secret_manager-v1 gem has no acceptance tests." - end - end - - desc "Run acceptance cleanup." - task :cleanup do - end -end - -task :samples do - Rake::Task["samples:latest"].invoke -end - -namespace :samples do - task :latest do - if File.directory? "samples" - Dir.chdir "samples" do - Bundler.with_clean_env do - ENV["GOOGLE_CLOUD_SAMPLES_TEST"] = "not_master" - sh "bundle update" - sh "bundle exec rake test" - end - end - else - puts "The google-cloud-secret_manager-v1 gem has no samples to test." - end - end - - task :master do - if File.directory? "samples" - Dir.chdir "samples" do - Bundler.with_clean_env do - ENV["GOOGLE_CLOUD_SAMPLES_TEST"] = "master" - sh "bundle update" - sh "bundle exec rake test" - end - end - else - puts "The google-cloud-secret_manager-v1 gem has no samples to test." - end - end -end - -require "yard" -require "yard/rake/yardoc_task" -YARD::Rake::YardocTask.new do |y| - y.options << "--fail-on-warning" -end - -desc "Run yard-doctest example tests." -task :doctest do - puts "The google-cloud-secret_manager-v1 gem does not have doctest tests." -end - -desc "Run the CI build" -task :ci do - header "BUILDING google-cloud-secret_manager-v1" - header "google-cloud-secret_manager-v1 rubocop", "*" - Rake::Task[:rubocop].invoke - header "google-cloud-secret_manager-v1 yard", "*" - Rake::Task[:yard].invoke - header "google-cloud-secret_manager-v1 test", "*" - Rake::Task[:test].invoke -end - -namespace :ci do - desc "Run the CI build, with smoke tests." - task :smoke_test do - Rake::Task[:ci].invoke - header "google-cloud-secret_manager-v1 smoke_test", "*" - Rake::Task[:smoke_test].invoke - end - desc "Run the CI build, with acceptance tests." - task :acceptance do - Rake::Task[:ci].invoke - header "google-cloud-secret_manager-v1 acceptance", "*" - Rake::Task[:acceptance].invoke - end - task :a do - # This is a handy shortcut to save typing - Rake::Task["ci:acceptance"].invoke - end -end - -task default: :test - -def header str, token = "#" - line_length = str.length + 8 - puts "" - puts token * line_length - puts "#{token * 3} #{str} #{token * 3}" - puts token * line_length - puts "" -end diff --git a/owl-bot-staging/google-cloud-secret_manager-v1/gapic_metadata.json b/owl-bot-staging/google-cloud-secret_manager-v1/gapic_metadata.json deleted file mode 100644 index 195f6c899ecf..000000000000 --- a/owl-bot-staging/google-cloud-secret_manager-v1/gapic_metadata.json +++ /dev/null @@ -1,93 +0,0 @@ -{ - "schema": "1.0", - "comment": "This file maps proto services/RPCs to the corresponding library clients/methods", - "language": "ruby", - "protoPackage": "google.cloud.secretmanager.v1", - "libraryPackage": "::Google::Cloud::SecretManager::V1", - "services": { - "SecretManagerService": { - "clients": { - "grpc": { - "libraryClient": "::Google::Cloud::SecretManager::V1::SecretManagerService::Client", - "rpcs": { - "ListSecrets": { - "methods": [ - "list_secrets" - ] - }, - "CreateSecret": { - "methods": [ - "create_secret" - ] - }, - "AddSecretVersion": { - "methods": [ - "add_secret_version" - ] - }, - "GetSecret": { - "methods": [ - "get_secret" - ] - }, - "UpdateSecret": { - "methods": [ - "update_secret" - ] - }, - "DeleteSecret": { - "methods": [ - "delete_secret" - ] - }, - "ListSecretVersions": { - "methods": [ - "list_secret_versions" - ] - }, - "GetSecretVersion": { - "methods": [ - "get_secret_version" - ] - }, - "AccessSecretVersion": { - "methods": [ - "access_secret_version" - ] - }, - "DisableSecretVersion": { - "methods": [ - "disable_secret_version" - ] - }, - "EnableSecretVersion": { - "methods": [ - "enable_secret_version" - ] - }, - "DestroySecretVersion": { - "methods": [ - "destroy_secret_version" - ] - }, - "SetIamPolicy": { - "methods": [ - "set_iam_policy" - ] - }, - "GetIamPolicy": { - "methods": [ - "get_iam_policy" - ] - }, - "TestIamPermissions": { - "methods": [ - "test_iam_permissions" - ] - } - } - } - } - } - } -} diff --git a/owl-bot-staging/google-cloud-secret_manager-v1/google-cloud-secret_manager-v1.gemspec b/owl-bot-staging/google-cloud-secret_manager-v1/google-cloud-secret_manager-v1.gemspec deleted file mode 100644 index 329c53d1a9d3..000000000000 --- a/owl-bot-staging/google-cloud-secret_manager-v1/google-cloud-secret_manager-v1.gemspec +++ /dev/null @@ -1,30 +0,0 @@ -# -*- ruby -*- -# encoding: utf-8 - -require File.expand_path("lib/google/cloud/secret_manager/v1/version", __dir__) - -Gem::Specification.new do |gem| - gem.name = "google-cloud-secret_manager-v1" - gem.version = Google::Cloud::SecretManager::V1::VERSION - - gem.authors = ["Google LLC"] - gem.email = "googleapis-packages@google.com" - gem.description = "Secret Manager is a secure and convenient storage system for API keys, passwords, certificates, and other sensitive data. Secret Manager provides a central place and single source of truth to manage, access, and audit secrets across Google Cloud. Note that google-cloud-secret_manager-v1 is a version-specific client library. For most uses, we recommend installing the main client library google-cloud-secret_manager instead. See the readme for more details." - gem.summary = "Stores sensitive data such as API keys, passwords, and certificates. Provides convenience while improving security." - gem.homepage = "https://github.com/googleapis/google-cloud-ruby" - gem.license = "Apache-2.0" - - gem.platform = Gem::Platform::RUBY - - gem.files = `git ls-files -- lib/*`.split("\n") + - `git ls-files -- proto_docs/*`.split("\n") + - ["README.md", "LICENSE.md", "AUTHENTICATION.md", ".yardopts"] - gem.require_paths = ["lib"] - - gem.required_ruby_version = ">= 3.2" - - gem.add_dependency "gapic-common", "~> 1.2" - gem.add_dependency "google-cloud-errors", "~> 1.0" - gem.add_dependency "google-cloud-location", "~> 1.0" - gem.add_dependency "grpc-google-iam-v1", "~> 1.11" -end diff --git a/owl-bot-staging/google-cloud-secret_manager-v1/lib/google-cloud-secret_manager-v1.rb b/owl-bot-staging/google-cloud-secret_manager-v1/lib/google-cloud-secret_manager-v1.rb deleted file mode 100644 index 7a966609a639..000000000000 --- a/owl-bot-staging/google-cloud-secret_manager-v1/lib/google-cloud-secret_manager-v1.rb +++ /dev/null @@ -1,21 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -# This gem does not autoload during Bundler.require. To load this gem, -# issue explicit require statements for the packages desired, e.g.: -# require "google/cloud/secret_manager/v1" diff --git a/owl-bot-staging/google-cloud-secret_manager-v1/lib/google/cloud/secret_manager/v1.rb b/owl-bot-staging/google-cloud-secret_manager-v1/lib/google/cloud/secret_manager/v1.rb deleted file mode 100644 index 7ea91d418dcd..000000000000 --- a/owl-bot-staging/google-cloud-secret_manager-v1/lib/google/cloud/secret_manager/v1.rb +++ /dev/null @@ -1,45 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -require "google/cloud/secret_manager/v1/secret_manager_service" -require "google/cloud/secret_manager/v1/version" - -module Google - module Cloud - module SecretManager - ## - # API client module. - # - # @example Load this package, including all its services, and instantiate a gRPC client - # - # require "google/cloud/secret_manager/v1" - # client = ::Google::Cloud::SecretManager::V1::SecretManagerService::Client.new - # - # @example Load this package, including all its services, and instantiate a REST client - # - # require "google/cloud/secret_manager/v1" - # client = ::Google::Cloud::SecretManager::V1::SecretManagerService::Rest::Client.new - # - module V1 - end - end - end -end - -helper_path = ::File.join __dir__, "v1", "_helpers.rb" -require "google/cloud/secret_manager/v1/_helpers" if ::File.file? helper_path diff --git a/owl-bot-staging/google-cloud-secret_manager-v1/lib/google/cloud/secret_manager/v1/bindings_override.rb b/owl-bot-staging/google-cloud-secret_manager-v1/lib/google/cloud/secret_manager/v1/bindings_override.rb deleted file mode 100644 index fc80b7225c1e..000000000000 --- a/owl-bot-staging/google-cloud-secret_manager-v1/lib/google/cloud/secret_manager/v1/bindings_override.rb +++ /dev/null @@ -1,75 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -require "gapic/rest" - -module Google - module Cloud - module SecretManager - ## - # @example Loading just the REST part of this package, including all its services, and instantiating a REST client - # - # require "google/cloud/secret_manager/v1/rest" - # client = ::Google::Cloud::SecretManager::V1::SecretManagerService::Rest::Client.new - # - module V1 - ## - # @private - # Initialize the mixin bindings configuration - # - def self.configure - @configure ||= begin - namespace = ["Google", "Cloud", "SecretManager"] - parent_config = while namespace.any? - parent_name = namespace.join "::" - parent_const = const_get parent_name - break parent_const.configure if parent_const.respond_to? :configure - namespace.pop - end - - default_config = ::Gapic::Rest::HttpBindingOverrideConfiguration.new parent_config - default_config.bindings_override["google.cloud.location.Locations.GetLocation"] = [ - Gapic::Rest::GrpcTranscoder::HttpBinding.create_with_validation( - uri_method: :get, - uri_template: "/v1/{name}", - matches: [ - ["name", %r{^projects/[^/]+/locations/[^/]+/?$}, false] - ], - body: nil - ) - ] - default_config.bindings_override["google.cloud.location.Locations.ListLocations"] = [ - - Gapic::Rest::GrpcTranscoder::HttpBinding.create_with_validation( - uri_method: :get, - uri_template: "/v1/{name}/locations", - matches: [ - ["name", %r{^projects/[^/]+/?$}, false] - ], - body: nil - ) - ] - default_config - end - yield @configure if block_given? - @configure - end - end - end - end -end diff --git a/owl-bot-staging/google-cloud-secret_manager-v1/lib/google/cloud/secret_manager/v1/rest.rb b/owl-bot-staging/google-cloud-secret_manager-v1/lib/google/cloud/secret_manager/v1/rest.rb deleted file mode 100644 index 4131c19cc0dc..000000000000 --- a/owl-bot-staging/google-cloud-secret_manager-v1/lib/google/cloud/secret_manager/v1/rest.rb +++ /dev/null @@ -1,38 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -require "google/cloud/secret_manager/v1/secret_manager_service/rest" -require "google/cloud/secret_manager/v1/bindings_override" -require "google/cloud/secret_manager/v1/version" - -module Google - module Cloud - module SecretManager - ## - # To load just the REST part of this package, including all its services, and instantiate a REST client: - # - # @example - # - # require "google/cloud/secret_manager/v1/rest" - # client = ::Google::Cloud::SecretManager::V1::SecretManagerService::Rest::Client.new - # - module V1 - end - end - end -end diff --git a/owl-bot-staging/google-cloud-secret_manager-v1/lib/google/cloud/secret_manager/v1/secret_manager_service.rb b/owl-bot-staging/google-cloud-secret_manager-v1/lib/google/cloud/secret_manager/v1/secret_manager_service.rb deleted file mode 100644 index 951657359f0c..000000000000 --- a/owl-bot-staging/google-cloud-secret_manager-v1/lib/google/cloud/secret_manager/v1/secret_manager_service.rb +++ /dev/null @@ -1,61 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -require "gapic/common" -require "gapic/config" -require "gapic/config/method" - -require "google/cloud/secret_manager/v1/version" - -require "google/cloud/secret_manager/v1/secret_manager_service/credentials" -require "google/cloud/secret_manager/v1/secret_manager_service/paths" -require "google/cloud/secret_manager/v1/secret_manager_service/client" -require "google/cloud/secret_manager/v1/secret_manager_service/rest" - -module Google - module Cloud - module SecretManager - module V1 - ## - # Secret Manager Service - # - # Manages secrets and operations using those secrets. Implements a REST - # model with the following objects: - # - # * {::Google::Cloud::SecretManager::V1::Secret Secret} - # * {::Google::Cloud::SecretManager::V1::SecretVersion SecretVersion} - # - # @example Load this service and instantiate a gRPC client - # - # require "google/cloud/secret_manager/v1/secret_manager_service" - # client = ::Google::Cloud::SecretManager::V1::SecretManagerService::Client.new - # - # @example Load this service and instantiate a REST client - # - # require "google/cloud/secret_manager/v1/secret_manager_service/rest" - # client = ::Google::Cloud::SecretManager::V1::SecretManagerService::Rest::Client.new - # - module SecretManagerService - end - end - end - end -end - -helper_path = ::File.join __dir__, "secret_manager_service", "helpers.rb" -require "google/cloud/secret_manager/v1/secret_manager_service/helpers" if ::File.file? helper_path diff --git a/owl-bot-staging/google-cloud-secret_manager-v1/lib/google/cloud/secret_manager/v1/secret_manager_service/client.rb b/owl-bot-staging/google-cloud-secret_manager-v1/lib/google/cloud/secret_manager/v1/secret_manager_service/client.rb deleted file mode 100644 index ad5dd9f15a9e..000000000000 --- a/owl-bot-staging/google-cloud-secret_manager-v1/lib/google/cloud/secret_manager/v1/secret_manager_service/client.rb +++ /dev/null @@ -1,1989 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -require "google/cloud/errors" -require "google/cloud/secretmanager/v1/service_pb" -require "google/cloud/location" - -module Google - module Cloud - module SecretManager - module V1 - module SecretManagerService - ## - # Client for the SecretManagerService service. - # - # Secret Manager Service - # - # Manages secrets and operations using those secrets. Implements a REST - # model with the following objects: - # - # * {::Google::Cloud::SecretManager::V1::Secret Secret} - # * {::Google::Cloud::SecretManager::V1::SecretVersion SecretVersion} - # - class Client - # @private - API_VERSION = "" - - # @private - DEFAULT_ENDPOINT_TEMPLATE = "secretmanager.$UNIVERSE_DOMAIN$" - - include Paths - - # @private - attr_reader :secret_manager_service_stub - - ## - # Configure the SecretManagerService Client class. - # - # See {::Google::Cloud::SecretManager::V1::SecretManagerService::Client::Configuration} - # for a description of the configuration fields. - # - # @example - # - # # Modify the configuration for all SecretManagerService clients - # ::Google::Cloud::SecretManager::V1::SecretManagerService::Client.configure do |config| - # config.timeout = 10.0 - # end - # - # @yield [config] Configure the Client client. - # @yieldparam config [Client::Configuration] - # - # @return [Client::Configuration] - # - def self.configure - @configure ||= begin - namespace = ["Google", "Cloud", "SecretManager", "V1"] - parent_config = while namespace.any? - parent_name = namespace.join "::" - parent_const = const_get parent_name - break parent_const.configure if parent_const.respond_to? :configure - namespace.pop - end - default_config = Client::Configuration.new parent_config - - default_config.rpcs.list_secrets.timeout = 60.0 - - default_config.rpcs.create_secret.timeout = 60.0 - - default_config.rpcs.add_secret_version.timeout = 60.0 - - default_config.rpcs.get_secret.timeout = 60.0 - - default_config.rpcs.update_secret.timeout = 60.0 - - default_config.rpcs.delete_secret.timeout = 60.0 - - default_config.rpcs.list_secret_versions.timeout = 60.0 - - default_config.rpcs.get_secret_version.timeout = 60.0 - - default_config.rpcs.access_secret_version.timeout = 60.0 - default_config.rpcs.access_secret_version.retry_policy = { - initial_delay: 2.0, max_delay: 60.0, multiplier: 2.0, retry_codes: [14, 8] - } - - default_config.rpcs.disable_secret_version.timeout = 60.0 - - default_config.rpcs.enable_secret_version.timeout = 60.0 - - default_config.rpcs.destroy_secret_version.timeout = 60.0 - - default_config.rpcs.set_iam_policy.timeout = 60.0 - - default_config.rpcs.get_iam_policy.timeout = 60.0 - - default_config.rpcs.test_iam_permissions.timeout = 60.0 - - default_config - end - yield @configure if block_given? - @configure - end - - ## - # Configure the SecretManagerService Client instance. - # - # The configuration is set to the derived mode, meaning that values can be changed, - # but structural changes (adding new fields, etc.) are not allowed. Structural changes - # should be made on {Client.configure}. - # - # See {::Google::Cloud::SecretManager::V1::SecretManagerService::Client::Configuration} - # for a description of the configuration fields. - # - # @yield [config] Configure the Client client. - # @yieldparam config [Client::Configuration] - # - # @return [Client::Configuration] - # - def configure - yield @config if block_given? - @config - end - - ## - # The effective universe domain - # - # @return [String] - # - def universe_domain - @secret_manager_service_stub.universe_domain - end - - ## - # Create a new SecretManagerService client object. - # - # @example - # - # # Create a client using the default configuration - # client = ::Google::Cloud::SecretManager::V1::SecretManagerService::Client.new - # - # # Create a client using a custom configuration - # client = ::Google::Cloud::SecretManager::V1::SecretManagerService::Client.new do |config| - # config.timeout = 10.0 - # end - # - # @yield [config] Configure the SecretManagerService client. - # @yieldparam config [Client::Configuration] - # - def initialize - # These require statements are intentionally placed here to initialize - # the gRPC module only when it's required. - # See https://github.com/googleapis/toolkit/issues/446 - require "gapic/grpc" - require "google/cloud/secretmanager/v1/service_services_pb" - - # Create the configuration object - @config = Configuration.new Client.configure - - # Yield the configuration if needed - yield @config if block_given? - - # Create credentials - credentials = @config.credentials - # Use self-signed JWT if the endpoint is unchanged from default, - # but only if the default endpoint does not have a region prefix. - enable_self_signed_jwt = @config.endpoint.nil? || - (@config.endpoint == Configuration::DEFAULT_ENDPOINT && - !@config.endpoint.split(".").first.include?("-")) - credentials ||= Credentials.default scope: @config.scope, - enable_self_signed_jwt: enable_self_signed_jwt - if credentials.is_a?(::String) || credentials.is_a?(::Hash) - credentials = Credentials.new credentials, scope: @config.scope - end - @quota_project_id = @config.quota_project - @quota_project_id ||= credentials.quota_project_id if credentials.respond_to? :quota_project_id - - @secret_manager_service_stub = ::Gapic::ServiceStub.new( - ::Google::Cloud::SecretManager::V1::SecretManagerService::Stub, - credentials: credentials, - endpoint: @config.endpoint, - endpoint_template: DEFAULT_ENDPOINT_TEMPLATE, - universe_domain: @config.universe_domain, - channel_args: @config.channel_args, - interceptors: @config.interceptors, - channel_pool_config: @config.channel_pool, - logger: @config.logger - ) - - @secret_manager_service_stub.stub_logger&.info do |entry| - entry.set_system_name - entry.set_service - entry.message = "Created client for #{entry.service}" - entry.set_credentials_fields credentials - entry.set "customEndpoint", @config.endpoint if @config.endpoint - entry.set "defaultTimeout", @config.timeout if @config.timeout - entry.set "quotaProject", @quota_project_id if @quota_project_id - end - - @location_client = Google::Cloud::Location::Locations::Client.new do |config| - config.credentials = credentials - config.quota_project = @quota_project_id - config.endpoint = @secret_manager_service_stub.endpoint - config.universe_domain = @secret_manager_service_stub.universe_domain - config.logger = @secret_manager_service_stub.logger if config.respond_to? :logger= - end - end - - ## - # Get the associated client for mix-in of the Locations. - # - # @return [Google::Cloud::Location::Locations::Client] - # - attr_reader :location_client - - ## - # The logger used for request/response debug logging. - # - # @return [Logger] - # - def logger - @secret_manager_service_stub.logger - end - - # Service calls - - ## - # Lists {::Google::Cloud::SecretManager::V1::Secret Secrets}. - # - # @overload list_secrets(request, options = nil) - # Pass arguments to `list_secrets` via a request object, either of type - # {::Google::Cloud::SecretManager::V1::ListSecretsRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::SecretManager::V1::ListSecretsRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. - # - # @overload list_secrets(parent: nil, page_size: nil, page_token: nil, filter: nil) - # Pass arguments to `list_secrets` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param parent [::String] - # Required. The resource name of the project associated with the - # {::Google::Cloud::SecretManager::V1::Secret Secrets}, in the format `projects/*` - # or `projects/*/locations/*` - # @param page_size [::Integer] - # Optional. The maximum number of results to be returned in a single page. If - # set to 0, the server decides the number of results to return. If the - # number is greater than 25000, it is capped at 25000. - # @param page_token [::String] - # Optional. Pagination token, returned earlier via - # {::Google::Cloud::SecretManager::V1::ListSecretsResponse#next_page_token ListSecretsResponse.next_page_token}. - # @param filter [::String] - # Optional. Filter string, adhering to the rules in - # [List-operation - # filtering](https://cloud.google.com/secret-manager/docs/filtering). List - # only secrets matching the filter. If filter is empty, all secrets are - # listed. - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Gapic::PagedEnumerable<::Google::Cloud::SecretManager::V1::Secret>] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Gapic::PagedEnumerable<::Google::Cloud::SecretManager::V1::Secret>] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/cloud/secret_manager/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::SecretManager::V1::SecretManagerService::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::SecretManager::V1::ListSecretsRequest.new - # - # # Call the list_secrets method. - # result = client.list_secrets request - # - # # The returned object is of type Gapic::PagedEnumerable. You can iterate - # # over elements, and API calls will be issued to fetch pages as needed. - # result.each do |item| - # # Each element is of type ::Google::Cloud::SecretManager::V1::Secret. - # p item - # end - # - def list_secrets request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::SecretManager::V1::ListSecretsRequest - - # Converts hash and nil to an options object - options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h - - # Customize the options with defaults - metadata = @config.rpcs.list_secrets.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::SecretManager::V1::VERSION - metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - header_params = {} - if request.parent - header_params["parent"] = request.parent - end - - request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") - metadata[:"x-goog-request-params"] ||= request_params_header - - options.apply_defaults timeout: @config.rpcs.list_secrets.timeout, - metadata: metadata, - retry_policy: @config.rpcs.list_secrets.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @secret_manager_service_stub.call_rpc :list_secrets, request, options: options do |response, operation| - response = ::Gapic::PagedEnumerable.new @secret_manager_service_stub, :list_secrets, request, response, operation, options - yield response, operation if block_given? - throw :response, response - end - rescue ::GRPC::BadStatus => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Creates a new {::Google::Cloud::SecretManager::V1::Secret Secret} containing no - # {::Google::Cloud::SecretManager::V1::SecretVersion SecretVersions}. - # - # @overload create_secret(request, options = nil) - # Pass arguments to `create_secret` via a request object, either of type - # {::Google::Cloud::SecretManager::V1::CreateSecretRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::SecretManager::V1::CreateSecretRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. - # - # @overload create_secret(parent: nil, secret_id: nil, secret: nil) - # Pass arguments to `create_secret` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param parent [::String] - # Required. The resource name of the project to associate with the - # {::Google::Cloud::SecretManager::V1::Secret Secret}, in the format `projects/*` - # or `projects/*/locations/*`. - # @param secret_id [::String] - # Required. This must be unique within the project. - # - # A secret ID is a string with a maximum length of 255 characters and can - # contain uppercase and lowercase letters, numerals, and the hyphen (`-`) and - # underscore (`_`) characters. - # @param secret [::Google::Cloud::SecretManager::V1::Secret, ::Hash] - # Required. A {::Google::Cloud::SecretManager::V1::Secret Secret} with initial - # field values. - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Google::Cloud::SecretManager::V1::Secret] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Google::Cloud::SecretManager::V1::Secret] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/cloud/secret_manager/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::SecretManager::V1::SecretManagerService::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::SecretManager::V1::CreateSecretRequest.new - # - # # Call the create_secret method. - # result = client.create_secret request - # - # # The returned object is of type Google::Cloud::SecretManager::V1::Secret. - # p result - # - def create_secret request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::SecretManager::V1::CreateSecretRequest - - # Converts hash and nil to an options object - options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h - - # Customize the options with defaults - metadata = @config.rpcs.create_secret.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::SecretManager::V1::VERSION - metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - header_params = {} - if request.parent - header_params["parent"] = request.parent - end - - request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") - metadata[:"x-goog-request-params"] ||= request_params_header - - options.apply_defaults timeout: @config.rpcs.create_secret.timeout, - metadata: metadata, - retry_policy: @config.rpcs.create_secret.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @secret_manager_service_stub.call_rpc :create_secret, request, options: options do |response, operation| - yield response, operation if block_given? - end - rescue ::GRPC::BadStatus => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Creates a new {::Google::Cloud::SecretManager::V1::SecretVersion SecretVersion} - # containing secret data and attaches it to an existing - # {::Google::Cloud::SecretManager::V1::Secret Secret}. - # - # @overload add_secret_version(request, options = nil) - # Pass arguments to `add_secret_version` via a request object, either of type - # {::Google::Cloud::SecretManager::V1::AddSecretVersionRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::SecretManager::V1::AddSecretVersionRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. - # - # @overload add_secret_version(parent: nil, payload: nil) - # Pass arguments to `add_secret_version` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param parent [::String] - # Required. The resource name of the - # {::Google::Cloud::SecretManager::V1::Secret Secret} to associate with the - # {::Google::Cloud::SecretManager::V1::SecretVersion SecretVersion} in the format - # `projects/*/secrets/*` or `projects/*/locations/*/secrets/*`. - # @param payload [::Google::Cloud::SecretManager::V1::SecretPayload, ::Hash] - # Required. The secret payload of the - # {::Google::Cloud::SecretManager::V1::SecretVersion SecretVersion}. - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Google::Cloud::SecretManager::V1::SecretVersion] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Google::Cloud::SecretManager::V1::SecretVersion] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/cloud/secret_manager/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::SecretManager::V1::SecretManagerService::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::SecretManager::V1::AddSecretVersionRequest.new - # - # # Call the add_secret_version method. - # result = client.add_secret_version request - # - # # The returned object is of type Google::Cloud::SecretManager::V1::SecretVersion. - # p result - # - def add_secret_version request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::SecretManager::V1::AddSecretVersionRequest - - # Converts hash and nil to an options object - options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h - - # Customize the options with defaults - metadata = @config.rpcs.add_secret_version.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::SecretManager::V1::VERSION - metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - header_params = {} - if request.parent - header_params["parent"] = request.parent - end - - request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") - metadata[:"x-goog-request-params"] ||= request_params_header - - options.apply_defaults timeout: @config.rpcs.add_secret_version.timeout, - metadata: metadata, - retry_policy: @config.rpcs.add_secret_version.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @secret_manager_service_stub.call_rpc :add_secret_version, request, options: options do |response, operation| - yield response, operation if block_given? - end - rescue ::GRPC::BadStatus => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Gets metadata for a given {::Google::Cloud::SecretManager::V1::Secret Secret}. - # - # @overload get_secret(request, options = nil) - # Pass arguments to `get_secret` via a request object, either of type - # {::Google::Cloud::SecretManager::V1::GetSecretRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::SecretManager::V1::GetSecretRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. - # - # @overload get_secret(name: nil) - # Pass arguments to `get_secret` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param name [::String] - # Required. The resource name of the - # {::Google::Cloud::SecretManager::V1::Secret Secret}, in the format - # `projects/*/secrets/*` or `projects/*/locations/*/secrets/*`. - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Google::Cloud::SecretManager::V1::Secret] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Google::Cloud::SecretManager::V1::Secret] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/cloud/secret_manager/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::SecretManager::V1::SecretManagerService::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::SecretManager::V1::GetSecretRequest.new - # - # # Call the get_secret method. - # result = client.get_secret request - # - # # The returned object is of type Google::Cloud::SecretManager::V1::Secret. - # p result - # - def get_secret request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::SecretManager::V1::GetSecretRequest - - # Converts hash and nil to an options object - options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h - - # Customize the options with defaults - metadata = @config.rpcs.get_secret.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::SecretManager::V1::VERSION - metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - header_params = {} - if request.name - header_params["name"] = request.name - end - - request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") - metadata[:"x-goog-request-params"] ||= request_params_header - - options.apply_defaults timeout: @config.rpcs.get_secret.timeout, - metadata: metadata, - retry_policy: @config.rpcs.get_secret.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @secret_manager_service_stub.call_rpc :get_secret, request, options: options do |response, operation| - yield response, operation if block_given? - end - rescue ::GRPC::BadStatus => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Updates metadata of an existing - # {::Google::Cloud::SecretManager::V1::Secret Secret}. - # - # @overload update_secret(request, options = nil) - # Pass arguments to `update_secret` via a request object, either of type - # {::Google::Cloud::SecretManager::V1::UpdateSecretRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::SecretManager::V1::UpdateSecretRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. - # - # @overload update_secret(secret: nil, update_mask: nil) - # Pass arguments to `update_secret` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param secret [::Google::Cloud::SecretManager::V1::Secret, ::Hash] - # Required. {::Google::Cloud::SecretManager::V1::Secret Secret} with updated field - # values. - # @param update_mask [::Google::Protobuf::FieldMask, ::Hash] - # Required. Specifies the fields to be updated. - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Google::Cloud::SecretManager::V1::Secret] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Google::Cloud::SecretManager::V1::Secret] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/cloud/secret_manager/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::SecretManager::V1::SecretManagerService::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::SecretManager::V1::UpdateSecretRequest.new - # - # # Call the update_secret method. - # result = client.update_secret request - # - # # The returned object is of type Google::Cloud::SecretManager::V1::Secret. - # p result - # - def update_secret request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::SecretManager::V1::UpdateSecretRequest - - # Converts hash and nil to an options object - options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h - - # Customize the options with defaults - metadata = @config.rpcs.update_secret.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::SecretManager::V1::VERSION - metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - header_params = {} - if request.secret&.name - header_params["secret.name"] = request.secret.name - end - - request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") - metadata[:"x-goog-request-params"] ||= request_params_header - - options.apply_defaults timeout: @config.rpcs.update_secret.timeout, - metadata: metadata, - retry_policy: @config.rpcs.update_secret.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @secret_manager_service_stub.call_rpc :update_secret, request, options: options do |response, operation| - yield response, operation if block_given? - end - rescue ::GRPC::BadStatus => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Deletes a {::Google::Cloud::SecretManager::V1::Secret Secret}. - # - # @overload delete_secret(request, options = nil) - # Pass arguments to `delete_secret` via a request object, either of type - # {::Google::Cloud::SecretManager::V1::DeleteSecretRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::SecretManager::V1::DeleteSecretRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. - # - # @overload delete_secret(name: nil, etag: nil) - # Pass arguments to `delete_secret` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param name [::String] - # Required. The resource name of the - # {::Google::Cloud::SecretManager::V1::Secret Secret} to delete in the format - # `projects/*/secrets/*`. - # @param etag [::String] - # Optional. Etag of the {::Google::Cloud::SecretManager::V1::Secret Secret}. The - # request succeeds if it matches the etag of the currently stored secret - # object. If the etag is omitted, the request succeeds. - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Google::Protobuf::Empty] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Google::Protobuf::Empty] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/cloud/secret_manager/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::SecretManager::V1::SecretManagerService::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::SecretManager::V1::DeleteSecretRequest.new - # - # # Call the delete_secret method. - # result = client.delete_secret request - # - # # The returned object is of type Google::Protobuf::Empty. - # p result - # - def delete_secret request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::SecretManager::V1::DeleteSecretRequest - - # Converts hash and nil to an options object - options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h - - # Customize the options with defaults - metadata = @config.rpcs.delete_secret.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::SecretManager::V1::VERSION - metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - header_params = {} - if request.name - header_params["name"] = request.name - end - - request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") - metadata[:"x-goog-request-params"] ||= request_params_header - - options.apply_defaults timeout: @config.rpcs.delete_secret.timeout, - metadata: metadata, - retry_policy: @config.rpcs.delete_secret.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @secret_manager_service_stub.call_rpc :delete_secret, request, options: options do |response, operation| - yield response, operation if block_given? - end - rescue ::GRPC::BadStatus => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Lists {::Google::Cloud::SecretManager::V1::SecretVersion SecretVersions}. This - # call does not return secret data. - # - # @overload list_secret_versions(request, options = nil) - # Pass arguments to `list_secret_versions` via a request object, either of type - # {::Google::Cloud::SecretManager::V1::ListSecretVersionsRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::SecretManager::V1::ListSecretVersionsRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. - # - # @overload list_secret_versions(parent: nil, page_size: nil, page_token: nil, filter: nil) - # Pass arguments to `list_secret_versions` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param parent [::String] - # Required. The resource name of the - # {::Google::Cloud::SecretManager::V1::Secret Secret} associated with the - # {::Google::Cloud::SecretManager::V1::SecretVersion SecretVersions} to list, in - # the format `projects/*/secrets/*` or `projects/*/locations/*/secrets/*`. - # @param page_size [::Integer] - # Optional. The maximum number of results to be returned in a single page. If - # set to 0, the server decides the number of results to return. If the - # number is greater than 25000, it is capped at 25000. - # @param page_token [::String] - # Optional. Pagination token, returned earlier via - # ListSecretVersionsResponse.next_page_token][]. - # @param filter [::String] - # Optional. Filter string, adhering to the rules in - # [List-operation - # filtering](https://cloud.google.com/secret-manager/docs/filtering). List - # only secret versions matching the filter. If filter is empty, all secret - # versions are listed. - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Gapic::PagedEnumerable<::Google::Cloud::SecretManager::V1::SecretVersion>] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Gapic::PagedEnumerable<::Google::Cloud::SecretManager::V1::SecretVersion>] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/cloud/secret_manager/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::SecretManager::V1::SecretManagerService::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::SecretManager::V1::ListSecretVersionsRequest.new - # - # # Call the list_secret_versions method. - # result = client.list_secret_versions request - # - # # The returned object is of type Gapic::PagedEnumerable. You can iterate - # # over elements, and API calls will be issued to fetch pages as needed. - # result.each do |item| - # # Each element is of type ::Google::Cloud::SecretManager::V1::SecretVersion. - # p item - # end - # - def list_secret_versions request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::SecretManager::V1::ListSecretVersionsRequest - - # Converts hash and nil to an options object - options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h - - # Customize the options with defaults - metadata = @config.rpcs.list_secret_versions.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::SecretManager::V1::VERSION - metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - header_params = {} - if request.parent - header_params["parent"] = request.parent - end - - request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") - metadata[:"x-goog-request-params"] ||= request_params_header - - options.apply_defaults timeout: @config.rpcs.list_secret_versions.timeout, - metadata: metadata, - retry_policy: @config.rpcs.list_secret_versions.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @secret_manager_service_stub.call_rpc :list_secret_versions, request, options: options do |response, operation| - response = ::Gapic::PagedEnumerable.new @secret_manager_service_stub, :list_secret_versions, request, response, operation, options - yield response, operation if block_given? - throw :response, response - end - rescue ::GRPC::BadStatus => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Gets metadata for a - # {::Google::Cloud::SecretManager::V1::SecretVersion SecretVersion}. - # - # `projects/*/secrets/*/versions/latest` is an alias to the most recently - # created {::Google::Cloud::SecretManager::V1::SecretVersion SecretVersion}. - # - # @overload get_secret_version(request, options = nil) - # Pass arguments to `get_secret_version` via a request object, either of type - # {::Google::Cloud::SecretManager::V1::GetSecretVersionRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::SecretManager::V1::GetSecretVersionRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. - # - # @overload get_secret_version(name: nil) - # Pass arguments to `get_secret_version` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param name [::String] - # Required. The resource name of the - # {::Google::Cloud::SecretManager::V1::SecretVersion SecretVersion} in the format - # `projects/*/secrets/*/versions/*` or - # `projects/*/locations/*/secrets/*/versions/*`. - # - # `projects/*/secrets/*/versions/latest` or - # `projects/*/locations/*/secrets/*/versions/latest` is an alias to the most - # recently created - # {::Google::Cloud::SecretManager::V1::SecretVersion SecretVersion}. - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Google::Cloud::SecretManager::V1::SecretVersion] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Google::Cloud::SecretManager::V1::SecretVersion] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/cloud/secret_manager/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::SecretManager::V1::SecretManagerService::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::SecretManager::V1::GetSecretVersionRequest.new - # - # # Call the get_secret_version method. - # result = client.get_secret_version request - # - # # The returned object is of type Google::Cloud::SecretManager::V1::SecretVersion. - # p result - # - def get_secret_version request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::SecretManager::V1::GetSecretVersionRequest - - # Converts hash and nil to an options object - options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h - - # Customize the options with defaults - metadata = @config.rpcs.get_secret_version.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::SecretManager::V1::VERSION - metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - header_params = {} - if request.name - header_params["name"] = request.name - end - - request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") - metadata[:"x-goog-request-params"] ||= request_params_header - - options.apply_defaults timeout: @config.rpcs.get_secret_version.timeout, - metadata: metadata, - retry_policy: @config.rpcs.get_secret_version.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @secret_manager_service_stub.call_rpc :get_secret_version, request, options: options do |response, operation| - yield response, operation if block_given? - end - rescue ::GRPC::BadStatus => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Accesses a {::Google::Cloud::SecretManager::V1::SecretVersion SecretVersion}. - # This call returns the secret data. - # - # `projects/*/secrets/*/versions/latest` is an alias to the most recently - # created {::Google::Cloud::SecretManager::V1::SecretVersion SecretVersion}. - # - # @overload access_secret_version(request, options = nil) - # Pass arguments to `access_secret_version` via a request object, either of type - # {::Google::Cloud::SecretManager::V1::AccessSecretVersionRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::SecretManager::V1::AccessSecretVersionRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. - # - # @overload access_secret_version(name: nil) - # Pass arguments to `access_secret_version` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param name [::String] - # Required. The resource name of the - # {::Google::Cloud::SecretManager::V1::SecretVersion SecretVersion} in the format - # `projects/*/secrets/*/versions/*` or - # `projects/*/locations/*/secrets/*/versions/*`. - # - # `projects/*/secrets/*/versions/latest` or - # `projects/*/locations/*/secrets/*/versions/latest` is an alias to the most - # recently created - # {::Google::Cloud::SecretManager::V1::SecretVersion SecretVersion}. - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Google::Cloud::SecretManager::V1::AccessSecretVersionResponse] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Google::Cloud::SecretManager::V1::AccessSecretVersionResponse] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/cloud/secret_manager/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::SecretManager::V1::SecretManagerService::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::SecretManager::V1::AccessSecretVersionRequest.new - # - # # Call the access_secret_version method. - # result = client.access_secret_version request - # - # # The returned object is of type Google::Cloud::SecretManager::V1::AccessSecretVersionResponse. - # p result - # - def access_secret_version request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::SecretManager::V1::AccessSecretVersionRequest - - # Converts hash and nil to an options object - options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h - - # Customize the options with defaults - metadata = @config.rpcs.access_secret_version.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::SecretManager::V1::VERSION - metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - header_params = {} - if request.name - header_params["name"] = request.name - end - - request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") - metadata[:"x-goog-request-params"] ||= request_params_header - - options.apply_defaults timeout: @config.rpcs.access_secret_version.timeout, - metadata: metadata, - retry_policy: @config.rpcs.access_secret_version.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @secret_manager_service_stub.call_rpc :access_secret_version, request, options: options do |response, operation| - yield response, operation if block_given? - end - rescue ::GRPC::BadStatus => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Disables a {::Google::Cloud::SecretManager::V1::SecretVersion SecretVersion}. - # - # Sets the {::Google::Cloud::SecretManager::V1::SecretVersion#state state} of the - # {::Google::Cloud::SecretManager::V1::SecretVersion SecretVersion} to - # {::Google::Cloud::SecretManager::V1::SecretVersion::State::DISABLED DISABLED}. - # - # @overload disable_secret_version(request, options = nil) - # Pass arguments to `disable_secret_version` via a request object, either of type - # {::Google::Cloud::SecretManager::V1::DisableSecretVersionRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::SecretManager::V1::DisableSecretVersionRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. - # - # @overload disable_secret_version(name: nil, etag: nil) - # Pass arguments to `disable_secret_version` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param name [::String] - # Required. The resource name of the - # {::Google::Cloud::SecretManager::V1::SecretVersion SecretVersion} to disable in - # the format `projects/*/secrets/*/versions/*` or - # `projects/*/locations/*/secrets/*/versions/*`. - # @param etag [::String] - # Optional. Etag of the - # {::Google::Cloud::SecretManager::V1::SecretVersion SecretVersion}. The request - # succeeds if it matches the etag of the currently stored secret version - # object. If the etag is omitted, the request succeeds. - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Google::Cloud::SecretManager::V1::SecretVersion] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Google::Cloud::SecretManager::V1::SecretVersion] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/cloud/secret_manager/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::SecretManager::V1::SecretManagerService::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::SecretManager::V1::DisableSecretVersionRequest.new - # - # # Call the disable_secret_version method. - # result = client.disable_secret_version request - # - # # The returned object is of type Google::Cloud::SecretManager::V1::SecretVersion. - # p result - # - def disable_secret_version request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::SecretManager::V1::DisableSecretVersionRequest - - # Converts hash and nil to an options object - options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h - - # Customize the options with defaults - metadata = @config.rpcs.disable_secret_version.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::SecretManager::V1::VERSION - metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - header_params = {} - if request.name - header_params["name"] = request.name - end - - request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") - metadata[:"x-goog-request-params"] ||= request_params_header - - options.apply_defaults timeout: @config.rpcs.disable_secret_version.timeout, - metadata: metadata, - retry_policy: @config.rpcs.disable_secret_version.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @secret_manager_service_stub.call_rpc :disable_secret_version, request, options: options do |response, operation| - yield response, operation if block_given? - end - rescue ::GRPC::BadStatus => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Enables a {::Google::Cloud::SecretManager::V1::SecretVersion SecretVersion}. - # - # Sets the {::Google::Cloud::SecretManager::V1::SecretVersion#state state} of the - # {::Google::Cloud::SecretManager::V1::SecretVersion SecretVersion} to - # {::Google::Cloud::SecretManager::V1::SecretVersion::State::ENABLED ENABLED}. - # - # @overload enable_secret_version(request, options = nil) - # Pass arguments to `enable_secret_version` via a request object, either of type - # {::Google::Cloud::SecretManager::V1::EnableSecretVersionRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::SecretManager::V1::EnableSecretVersionRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. - # - # @overload enable_secret_version(name: nil, etag: nil) - # Pass arguments to `enable_secret_version` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param name [::String] - # Required. The resource name of the - # {::Google::Cloud::SecretManager::V1::SecretVersion SecretVersion} to enable in - # the format `projects/*/secrets/*/versions/*` or - # `projects/*/locations/*/secrets/*/versions/*`. - # @param etag [::String] - # Optional. Etag of the - # {::Google::Cloud::SecretManager::V1::SecretVersion SecretVersion}. The request - # succeeds if it matches the etag of the currently stored secret version - # object. If the etag is omitted, the request succeeds. - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Google::Cloud::SecretManager::V1::SecretVersion] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Google::Cloud::SecretManager::V1::SecretVersion] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/cloud/secret_manager/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::SecretManager::V1::SecretManagerService::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::SecretManager::V1::EnableSecretVersionRequest.new - # - # # Call the enable_secret_version method. - # result = client.enable_secret_version request - # - # # The returned object is of type Google::Cloud::SecretManager::V1::SecretVersion. - # p result - # - def enable_secret_version request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::SecretManager::V1::EnableSecretVersionRequest - - # Converts hash and nil to an options object - options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h - - # Customize the options with defaults - metadata = @config.rpcs.enable_secret_version.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::SecretManager::V1::VERSION - metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - header_params = {} - if request.name - header_params["name"] = request.name - end - - request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") - metadata[:"x-goog-request-params"] ||= request_params_header - - options.apply_defaults timeout: @config.rpcs.enable_secret_version.timeout, - metadata: metadata, - retry_policy: @config.rpcs.enable_secret_version.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @secret_manager_service_stub.call_rpc :enable_secret_version, request, options: options do |response, operation| - yield response, operation if block_given? - end - rescue ::GRPC::BadStatus => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Destroys a {::Google::Cloud::SecretManager::V1::SecretVersion SecretVersion}. - # - # Sets the {::Google::Cloud::SecretManager::V1::SecretVersion#state state} of the - # {::Google::Cloud::SecretManager::V1::SecretVersion SecretVersion} to - # {::Google::Cloud::SecretManager::V1::SecretVersion::State::DESTROYED DESTROYED} - # and irrevocably destroys the secret data. - # - # @overload destroy_secret_version(request, options = nil) - # Pass arguments to `destroy_secret_version` via a request object, either of type - # {::Google::Cloud::SecretManager::V1::DestroySecretVersionRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::SecretManager::V1::DestroySecretVersionRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. - # - # @overload destroy_secret_version(name: nil, etag: nil) - # Pass arguments to `destroy_secret_version` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param name [::String] - # Required. The resource name of the - # {::Google::Cloud::SecretManager::V1::SecretVersion SecretVersion} to destroy in - # the format `projects/*/secrets/*/versions/*` or - # `projects/*/locations/*/secrets/*/versions/*`. - # @param etag [::String] - # Optional. Etag of the - # {::Google::Cloud::SecretManager::V1::SecretVersion SecretVersion}. The request - # succeeds if it matches the etag of the currently stored secret version - # object. If the etag is omitted, the request succeeds. - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Google::Cloud::SecretManager::V1::SecretVersion] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Google::Cloud::SecretManager::V1::SecretVersion] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/cloud/secret_manager/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::SecretManager::V1::SecretManagerService::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::SecretManager::V1::DestroySecretVersionRequest.new - # - # # Call the destroy_secret_version method. - # result = client.destroy_secret_version request - # - # # The returned object is of type Google::Cloud::SecretManager::V1::SecretVersion. - # p result - # - def destroy_secret_version request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::SecretManager::V1::DestroySecretVersionRequest - - # Converts hash and nil to an options object - options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h - - # Customize the options with defaults - metadata = @config.rpcs.destroy_secret_version.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::SecretManager::V1::VERSION - metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - header_params = {} - if request.name - header_params["name"] = request.name - end - - request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") - metadata[:"x-goog-request-params"] ||= request_params_header - - options.apply_defaults timeout: @config.rpcs.destroy_secret_version.timeout, - metadata: metadata, - retry_policy: @config.rpcs.destroy_secret_version.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @secret_manager_service_stub.call_rpc :destroy_secret_version, request, options: options do |response, operation| - yield response, operation if block_given? - end - rescue ::GRPC::BadStatus => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Sets the access control policy on the specified secret. Replaces any - # existing policy. - # - # Permissions on - # {::Google::Cloud::SecretManager::V1::SecretVersion SecretVersions} are enforced - # according to the policy set on the associated - # {::Google::Cloud::SecretManager::V1::Secret Secret}. - # - # @overload set_iam_policy(request, options = nil) - # Pass arguments to `set_iam_policy` via a request object, either of type - # {::Google::Iam::V1::SetIamPolicyRequest} or an equivalent Hash. - # - # @param request [::Google::Iam::V1::SetIamPolicyRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. - # - # @overload set_iam_policy(resource: nil, policy: nil, update_mask: nil) - # Pass arguments to `set_iam_policy` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param resource [::String] - # REQUIRED: The resource for which the policy is being specified. - # See the operation documentation for the appropriate value for this field. - # @param policy [::Google::Iam::V1::Policy, ::Hash] - # REQUIRED: The complete policy to be applied to the `resource`. The size of - # the policy is limited to a few 10s of KB. An empty policy is a - # valid policy but certain Cloud Platform services (such as Projects) - # might reject them. - # @param update_mask [::Google::Protobuf::FieldMask, ::Hash] - # OPTIONAL: A FieldMask specifying which fields of the policy to modify. Only - # the fields in the mask will be modified. If no mask is provided, the - # following default mask is used: - # - # `paths: "bindings, etag"` - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Google::Iam::V1::Policy] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Google::Iam::V1::Policy] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/cloud/secret_manager/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::SecretManager::V1::SecretManagerService::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Iam::V1::SetIamPolicyRequest.new - # - # # Call the set_iam_policy method. - # result = client.set_iam_policy request - # - # # The returned object is of type Google::Iam::V1::Policy. - # p result - # - def set_iam_policy request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Iam::V1::SetIamPolicyRequest - - # Converts hash and nil to an options object - options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h - - # Customize the options with defaults - metadata = @config.rpcs.set_iam_policy.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::SecretManager::V1::VERSION - metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - header_params = {} - if request.resource - header_params["resource"] = request.resource - end - - request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") - metadata[:"x-goog-request-params"] ||= request_params_header - - options.apply_defaults timeout: @config.rpcs.set_iam_policy.timeout, - metadata: metadata, - retry_policy: @config.rpcs.set_iam_policy.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @secret_manager_service_stub.call_rpc :set_iam_policy, request, options: options do |response, operation| - yield response, operation if block_given? - end - rescue ::GRPC::BadStatus => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Gets the access control policy for a secret. - # Returns empty policy if the secret exists and does not have a policy set. - # - # @overload get_iam_policy(request, options = nil) - # Pass arguments to `get_iam_policy` via a request object, either of type - # {::Google::Iam::V1::GetIamPolicyRequest} or an equivalent Hash. - # - # @param request [::Google::Iam::V1::GetIamPolicyRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. - # - # @overload get_iam_policy(resource: nil, options: nil) - # Pass arguments to `get_iam_policy` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param resource [::String] - # REQUIRED: The resource for which the policy is being requested. - # See the operation documentation for the appropriate value for this field. - # @param options [::Google::Iam::V1::GetPolicyOptions, ::Hash] - # OPTIONAL: A `GetPolicyOptions` object for specifying options to - # `GetIamPolicy`. - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Google::Iam::V1::Policy] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Google::Iam::V1::Policy] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/cloud/secret_manager/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::SecretManager::V1::SecretManagerService::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Iam::V1::GetIamPolicyRequest.new - # - # # Call the get_iam_policy method. - # result = client.get_iam_policy request - # - # # The returned object is of type Google::Iam::V1::Policy. - # p result - # - def get_iam_policy request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Iam::V1::GetIamPolicyRequest - - # Converts hash and nil to an options object - options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h - - # Customize the options with defaults - metadata = @config.rpcs.get_iam_policy.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::SecretManager::V1::VERSION - metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - header_params = {} - if request.resource - header_params["resource"] = request.resource - end - - request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") - metadata[:"x-goog-request-params"] ||= request_params_header - - options.apply_defaults timeout: @config.rpcs.get_iam_policy.timeout, - metadata: metadata, - retry_policy: @config.rpcs.get_iam_policy.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @secret_manager_service_stub.call_rpc :get_iam_policy, request, options: options do |response, operation| - yield response, operation if block_given? - end - rescue ::GRPC::BadStatus => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Returns permissions that a caller has for the specified secret. - # If the secret does not exist, this call returns an empty set of - # permissions, not a NOT_FOUND error. - # - # Note: This operation is designed to be used for building permission-aware - # UIs and command-line tools, not for authorization checking. This operation - # may "fail open" without warning. - # - # @overload test_iam_permissions(request, options = nil) - # Pass arguments to `test_iam_permissions` via a request object, either of type - # {::Google::Iam::V1::TestIamPermissionsRequest} or an equivalent Hash. - # - # @param request [::Google::Iam::V1::TestIamPermissionsRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. - # - # @overload test_iam_permissions(resource: nil, permissions: nil) - # Pass arguments to `test_iam_permissions` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param resource [::String] - # REQUIRED: The resource for which the policy detail is being requested. - # See the operation documentation for the appropriate value for this field. - # @param permissions [::Array<::String>] - # The set of permissions to check for the `resource`. Permissions with - # wildcards (such as '*' or 'storage.*') are not allowed. For more - # information see - # [IAM Overview](https://cloud.google.com/iam/docs/overview#permissions). - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Google::Iam::V1::TestIamPermissionsResponse] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Google::Iam::V1::TestIamPermissionsResponse] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/cloud/secret_manager/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::SecretManager::V1::SecretManagerService::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Iam::V1::TestIamPermissionsRequest.new - # - # # Call the test_iam_permissions method. - # result = client.test_iam_permissions request - # - # # The returned object is of type Google::Iam::V1::TestIamPermissionsResponse. - # p result - # - def test_iam_permissions request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Iam::V1::TestIamPermissionsRequest - - # Converts hash and nil to an options object - options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h - - # Customize the options with defaults - metadata = @config.rpcs.test_iam_permissions.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::SecretManager::V1::VERSION - metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - header_params = {} - if request.resource - header_params["resource"] = request.resource - end - - request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") - metadata[:"x-goog-request-params"] ||= request_params_header - - options.apply_defaults timeout: @config.rpcs.test_iam_permissions.timeout, - metadata: metadata, - retry_policy: @config.rpcs.test_iam_permissions.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @secret_manager_service_stub.call_rpc :test_iam_permissions, request, options: options do |response, operation| - yield response, operation if block_given? - end - rescue ::GRPC::BadStatus => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Configuration class for the SecretManagerService API. - # - # This class represents the configuration for SecretManagerService, - # providing control over timeouts, retry behavior, logging, transport - # parameters, and other low-level controls. Certain parameters can also be - # applied individually to specific RPCs. See - # {::Google::Cloud::SecretManager::V1::SecretManagerService::Client::Configuration::Rpcs} - # for a list of RPCs that can be configured independently. - # - # Configuration can be applied globally to all clients, or to a single client - # on construction. - # - # @example - # - # # Modify the global config, setting the timeout for - # # list_secrets to 20 seconds, - # # and all remaining timeouts to 10 seconds. - # ::Google::Cloud::SecretManager::V1::SecretManagerService::Client.configure do |config| - # config.timeout = 10.0 - # config.rpcs.list_secrets.timeout = 20.0 - # end - # - # # Apply the above configuration only to a new client. - # client = ::Google::Cloud::SecretManager::V1::SecretManagerService::Client.new do |config| - # config.timeout = 10.0 - # config.rpcs.list_secrets.timeout = 20.0 - # end - # - # @!attribute [rw] endpoint - # A custom service endpoint, as a hostname or hostname:port. The default is - # nil, indicating to use the default endpoint in the current universe domain. - # @return [::String,nil] - # @!attribute [rw] credentials - # Credentials to send with calls. You may provide any of the following types: - # * (`Google::Auth::Credentials`) A googleauth credentials object - # (see the [googleauth docs](https://rubydoc.info/gems/googleauth/Google/Auth/Credentials)) - # * (`Signet::OAuth2::Client`) A signet oauth2 client object - # (see the [signet docs](https://rubydoc.info/gems/signet/Signet/OAuth2/Client)) - # * (`GRPC::Core::Channel`) a gRPC channel with included credentials - # * (`GRPC::Core::ChannelCredentials`) a gRPC credentails object - # * (`nil`) indicating no credentials - # - # @note Warning: Passing a `String` to a keyfile path or a `Hash` of credentials - # is deprecated. Providing an unvalidated credential configuration to - # Google APIs can compromise the security of your systems and data. - # - # @example - # - # # The recommended way to provide credentials is to use the `make_creds` method - # # on the appropriate credentials class for your environment. - # - # require "googleauth" - # - # credentials = ::Google::Auth::ServiceAccountCredentials.make_creds( - # json_key_io: ::File.open("/path/to/keyfile.json") - # ) - # - # client = ::Google::Cloud::SecretManager::V1::SecretManagerService::Client.new do |config| - # config.credentials = credentials - # end - # - # @note Warning: If you accept a credential configuration (JSON file or Hash) from an - # external source for authentication to Google Cloud, you must validate it before - # providing it to a Google API client library. Providing an unvalidated credential - # configuration to Google APIs can compromise the security of your systems and data. - # For more information, refer to [Validate credential configurations from external - # sources](https://cloud.google.com/docs/authentication/external/externally-sourced-credentials). - # @return [::Object] - # @!attribute [rw] scope - # The OAuth scopes - # @return [::Array<::String>] - # @!attribute [rw] lib_name - # The library name as recorded in instrumentation and logging - # @return [::String] - # @!attribute [rw] lib_version - # The library version as recorded in instrumentation and logging - # @return [::String] - # @!attribute [rw] channel_args - # Extra parameters passed to the gRPC channel. Note: this is ignored if a - # `GRPC::Core::Channel` object is provided as the credential. - # @return [::Hash] - # @!attribute [rw] interceptors - # An array of interceptors that are run before calls are executed. - # @return [::Array<::GRPC::ClientInterceptor>] - # @!attribute [rw] timeout - # The call timeout in seconds. - # @return [::Numeric] - # @!attribute [rw] metadata - # Additional gRPC headers to be sent with the call. - # @return [::Hash{::Symbol=>::String}] - # @!attribute [rw] retry_policy - # The retry policy. The value is a hash with the following keys: - # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds. - # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds. - # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier. - # * `:retry_codes` (*type:* `Array`) - The error codes that should - # trigger a retry. - # @return [::Hash] - # @!attribute [rw] quota_project - # A separate project against which to charge quota. - # @return [::String] - # @!attribute [rw] universe_domain - # The universe domain within which to make requests. This determines the - # default endpoint URL. The default value of nil uses the environment - # universe (usually the default "googleapis.com" universe). - # @return [::String,nil] - # @!attribute [rw] logger - # A custom logger to use for request/response debug logging, or the value - # `:default` (the default) to construct a default logger, or `nil` to - # explicitly disable logging. - # @return [::Logger,:default,nil] - # - class Configuration - extend ::Gapic::Config - - # @private - # The endpoint specific to the default "googleapis.com" universe. Deprecated. - DEFAULT_ENDPOINT = "secretmanager.googleapis.com" - - config_attr :endpoint, nil, ::String, nil - config_attr :credentials, nil do |value| - allowed = [::String, ::Hash, ::Proc, ::Symbol, ::Google::Auth::Credentials, ::Google::Auth::BaseClient, ::Signet::OAuth2::Client, nil] - allowed += [::GRPC::Core::Channel, ::GRPC::Core::ChannelCredentials] if defined? ::GRPC::Core::Channel - allowed.any? { |klass| klass === value } - end - config_attr :scope, nil, ::String, ::Array, nil - config_attr :lib_name, nil, ::String, nil - config_attr :lib_version, nil, ::String, nil - config_attr(:channel_args, { "grpc.service_config_disable_resolution" => 1 }, ::Hash, nil) - config_attr :interceptors, nil, ::Array, nil - config_attr :timeout, nil, ::Numeric, nil - config_attr :metadata, nil, ::Hash, nil - config_attr :retry_policy, nil, ::Hash, ::Proc, nil - config_attr :quota_project, nil, ::String, nil - config_attr :universe_domain, nil, ::String, nil - config_attr :logger, :default, ::Logger, nil, :default - - # @private - def initialize parent_config = nil - @parent_config = parent_config unless parent_config.nil? - - yield self if block_given? - end - - ## - # Configurations for individual RPCs - # @return [Rpcs] - # - def rpcs - @rpcs ||= begin - parent_rpcs = nil - parent_rpcs = @parent_config.rpcs if defined?(@parent_config) && @parent_config.respond_to?(:rpcs) - Rpcs.new parent_rpcs - end - end - - ## - # Configuration for the channel pool - # @return [::Gapic::ServiceStub::ChannelPool::Configuration] - # - def channel_pool - @channel_pool ||= ::Gapic::ServiceStub::ChannelPool::Configuration.new - end - - ## - # Configuration RPC class for the SecretManagerService API. - # - # Includes fields providing the configuration for each RPC in this service. - # Each configuration object is of type `Gapic::Config::Method` and includes - # the following configuration fields: - # - # * `timeout` (*type:* `Numeric`) - The call timeout in seconds - # * `metadata` (*type:* `Hash{Symbol=>String}`) - Additional gRPC headers - # * `retry_policy (*type:* `Hash`) - The retry policy. The policy fields - # include the following keys: - # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds. - # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds. - # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier. - # * `:retry_codes` (*type:* `Array`) - The error codes that should - # trigger a retry. - # - class Rpcs - ## - # RPC-specific configuration for `list_secrets` - # @return [::Gapic::Config::Method] - # - attr_reader :list_secrets - ## - # RPC-specific configuration for `create_secret` - # @return [::Gapic::Config::Method] - # - attr_reader :create_secret - ## - # RPC-specific configuration for `add_secret_version` - # @return [::Gapic::Config::Method] - # - attr_reader :add_secret_version - ## - # RPC-specific configuration for `get_secret` - # @return [::Gapic::Config::Method] - # - attr_reader :get_secret - ## - # RPC-specific configuration for `update_secret` - # @return [::Gapic::Config::Method] - # - attr_reader :update_secret - ## - # RPC-specific configuration for `delete_secret` - # @return [::Gapic::Config::Method] - # - attr_reader :delete_secret - ## - # RPC-specific configuration for `list_secret_versions` - # @return [::Gapic::Config::Method] - # - attr_reader :list_secret_versions - ## - # RPC-specific configuration for `get_secret_version` - # @return [::Gapic::Config::Method] - # - attr_reader :get_secret_version - ## - # RPC-specific configuration for `access_secret_version` - # @return [::Gapic::Config::Method] - # - attr_reader :access_secret_version - ## - # RPC-specific configuration for `disable_secret_version` - # @return [::Gapic::Config::Method] - # - attr_reader :disable_secret_version - ## - # RPC-specific configuration for `enable_secret_version` - # @return [::Gapic::Config::Method] - # - attr_reader :enable_secret_version - ## - # RPC-specific configuration for `destroy_secret_version` - # @return [::Gapic::Config::Method] - # - attr_reader :destroy_secret_version - ## - # RPC-specific configuration for `set_iam_policy` - # @return [::Gapic::Config::Method] - # - attr_reader :set_iam_policy - ## - # RPC-specific configuration for `get_iam_policy` - # @return [::Gapic::Config::Method] - # - attr_reader :get_iam_policy - ## - # RPC-specific configuration for `test_iam_permissions` - # @return [::Gapic::Config::Method] - # - attr_reader :test_iam_permissions - - # @private - def initialize parent_rpcs = nil - list_secrets_config = parent_rpcs.list_secrets if parent_rpcs.respond_to? :list_secrets - @list_secrets = ::Gapic::Config::Method.new list_secrets_config - create_secret_config = parent_rpcs.create_secret if parent_rpcs.respond_to? :create_secret - @create_secret = ::Gapic::Config::Method.new create_secret_config - add_secret_version_config = parent_rpcs.add_secret_version if parent_rpcs.respond_to? :add_secret_version - @add_secret_version = ::Gapic::Config::Method.new add_secret_version_config - get_secret_config = parent_rpcs.get_secret if parent_rpcs.respond_to? :get_secret - @get_secret = ::Gapic::Config::Method.new get_secret_config - update_secret_config = parent_rpcs.update_secret if parent_rpcs.respond_to? :update_secret - @update_secret = ::Gapic::Config::Method.new update_secret_config - delete_secret_config = parent_rpcs.delete_secret if parent_rpcs.respond_to? :delete_secret - @delete_secret = ::Gapic::Config::Method.new delete_secret_config - list_secret_versions_config = parent_rpcs.list_secret_versions if parent_rpcs.respond_to? :list_secret_versions - @list_secret_versions = ::Gapic::Config::Method.new list_secret_versions_config - get_secret_version_config = parent_rpcs.get_secret_version if parent_rpcs.respond_to? :get_secret_version - @get_secret_version = ::Gapic::Config::Method.new get_secret_version_config - access_secret_version_config = parent_rpcs.access_secret_version if parent_rpcs.respond_to? :access_secret_version - @access_secret_version = ::Gapic::Config::Method.new access_secret_version_config - disable_secret_version_config = parent_rpcs.disable_secret_version if parent_rpcs.respond_to? :disable_secret_version - @disable_secret_version = ::Gapic::Config::Method.new disable_secret_version_config - enable_secret_version_config = parent_rpcs.enable_secret_version if parent_rpcs.respond_to? :enable_secret_version - @enable_secret_version = ::Gapic::Config::Method.new enable_secret_version_config - destroy_secret_version_config = parent_rpcs.destroy_secret_version if parent_rpcs.respond_to? :destroy_secret_version - @destroy_secret_version = ::Gapic::Config::Method.new destroy_secret_version_config - set_iam_policy_config = parent_rpcs.set_iam_policy if parent_rpcs.respond_to? :set_iam_policy - @set_iam_policy = ::Gapic::Config::Method.new set_iam_policy_config - get_iam_policy_config = parent_rpcs.get_iam_policy if parent_rpcs.respond_to? :get_iam_policy - @get_iam_policy = ::Gapic::Config::Method.new get_iam_policy_config - test_iam_permissions_config = parent_rpcs.test_iam_permissions if parent_rpcs.respond_to? :test_iam_permissions - @test_iam_permissions = ::Gapic::Config::Method.new test_iam_permissions_config - - yield self if block_given? - end - end - end - end - end - end - end - end -end diff --git a/owl-bot-staging/google-cloud-secret_manager-v1/lib/google/cloud/secret_manager/v1/secret_manager_service/credentials.rb b/owl-bot-staging/google-cloud-secret_manager-v1/lib/google/cloud/secret_manager/v1/secret_manager_service/credentials.rb deleted file mode 100644 index b47fca61abf1..000000000000 --- a/owl-bot-staging/google-cloud-secret_manager-v1/lib/google/cloud/secret_manager/v1/secret_manager_service/credentials.rb +++ /dev/null @@ -1,51 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -require "googleauth" - -module Google - module Cloud - module SecretManager - module V1 - module SecretManagerService - # Credentials for the SecretManagerService API. - class Credentials < ::Google::Auth::Credentials - self.scope = [ - "https://www.googleapis.com/auth/cloud-platform" - ] - self.env_vars = [ - "SECRET_MANAGER_CREDENTIALS", - "SECRET_MANAGER_KEYFILE", - "GOOGLE_CLOUD_CREDENTIALS", - "GOOGLE_CLOUD_KEYFILE", - "GCLOUD_KEYFILE", - "SECRET_MANAGER_CREDENTIALS_JSON", - "SECRET_MANAGER_KEYFILE_JSON", - "GOOGLE_CLOUD_CREDENTIALS_JSON", - "GOOGLE_CLOUD_KEYFILE_JSON", - "GCLOUD_KEYFILE_JSON" - ] - self.paths = [ - "~/.config/google_cloud/application_default_credentials.json" - ] - end - end - end - end - end -end diff --git a/owl-bot-staging/google-cloud-secret_manager-v1/lib/google/cloud/secret_manager/v1/secret_manager_service/paths.rb b/owl-bot-staging/google-cloud-secret_manager-v1/lib/google/cloud/secret_manager/v1/secret_manager_service/paths.rb deleted file mode 100644 index 426a2a6ef38b..000000000000 --- a/owl-bot-staging/google-cloud-secret_manager-v1/lib/google/cloud/secret_manager/v1/secret_manager_service/paths.rb +++ /dev/null @@ -1,167 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - - -module Google - module Cloud - module SecretManager - module V1 - module SecretManagerService - # Path helper methods for the SecretManagerService API. - module Paths - ## - # Create a fully-qualified Location resource string. - # - # The resource will be in the following format: - # - # `projects/{project}/locations/{location}` - # - # @param project [String] - # @param location [String] - # - # @return [::String] - def location_path project:, location: - raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" - - "projects/#{project}/locations/#{location}" - end - - ## - # Create a fully-qualified Project resource string. - # - # The resource will be in the following format: - # - # `projects/{project}` - # - # @param project [String] - # - # @return [::String] - def project_path project: - "projects/#{project}" - end - - ## - # Create a fully-qualified Secret resource string. - # - # @overload secret_path(project:, secret:) - # The resource will be in the following format: - # - # `projects/{project}/secrets/{secret}` - # - # @param project [String] - # @param secret [String] - # - # @overload secret_path(project:, location:, secret:) - # The resource will be in the following format: - # - # `projects/{project}/locations/{location}/secrets/{secret}` - # - # @param project [String] - # @param location [String] - # @param secret [String] - # - # @return [::String] - def secret_path **args - resources = { - "project:secret" => (proc do |project:, secret:| - raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" - - "projects/#{project}/secrets/#{secret}" - end), - "location:project:secret" => (proc do |project:, location:, secret:| - raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" - raise ::ArgumentError, "location cannot contain /" if location.to_s.include? "/" - - "projects/#{project}/locations/#{location}/secrets/#{secret}" - end) - } - - resource = resources[args.keys.sort.join(":")] - raise ::ArgumentError, "no resource found for values #{args.keys}" if resource.nil? - resource.call(**args) - end - - ## - # Create a fully-qualified SecretVersion resource string. - # - # @overload secret_version_path(project:, secret:, secret_version:) - # The resource will be in the following format: - # - # `projects/{project}/secrets/{secret}/versions/{secret_version}` - # - # @param project [String] - # @param secret [String] - # @param secret_version [String] - # - # @overload secret_version_path(project:, location:, secret:, secret_version:) - # The resource will be in the following format: - # - # `projects/{project}/locations/{location}/secrets/{secret}/versions/{secret_version}` - # - # @param project [String] - # @param location [String] - # @param secret [String] - # @param secret_version [String] - # - # @return [::String] - def secret_version_path **args - resources = { - "project:secret:secret_version" => (proc do |project:, secret:, secret_version:| - raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" - raise ::ArgumentError, "secret cannot contain /" if secret.to_s.include? "/" - - "projects/#{project}/secrets/#{secret}/versions/#{secret_version}" - end), - "location:project:secret:secret_version" => (proc do |project:, location:, secret:, secret_version:| - raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" - raise ::ArgumentError, "location cannot contain /" if location.to_s.include? "/" - raise ::ArgumentError, "secret cannot contain /" if secret.to_s.include? "/" - - "projects/#{project}/locations/#{location}/secrets/#{secret}/versions/#{secret_version}" - end) - } - - resource = resources[args.keys.sort.join(":")] - raise ::ArgumentError, "no resource found for values #{args.keys}" if resource.nil? - resource.call(**args) - end - - ## - # Create a fully-qualified Topic resource string. - # - # The resource will be in the following format: - # - # `projects/{project}/topics/{topic}` - # - # @param project [String] - # @param topic [String] - # - # @return [::String] - def topic_path project:, topic: - raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" - - "projects/#{project}/topics/#{topic}" - end - - extend self - end - end - end - end - end -end diff --git a/owl-bot-staging/google-cloud-secret_manager-v1/lib/google/cloud/secret_manager/v1/secret_manager_service/rest.rb b/owl-bot-staging/google-cloud-secret_manager-v1/lib/google/cloud/secret_manager/v1/secret_manager_service/rest.rb deleted file mode 100644 index 75d9fc9de126..000000000000 --- a/owl-bot-staging/google-cloud-secret_manager-v1/lib/google/cloud/secret_manager/v1/secret_manager_service/rest.rb +++ /dev/null @@ -1,59 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -require "gapic/rest" -require "gapic/config" -require "gapic/config/method" - -require "google/cloud/secret_manager/v1/version" -require "google/cloud/secret_manager/v1/bindings_override" - -require "google/cloud/secret_manager/v1/secret_manager_service/credentials" -require "google/cloud/secret_manager/v1/secret_manager_service/paths" -require "google/cloud/secret_manager/v1/secret_manager_service/rest/client" - -module Google - module Cloud - module SecretManager - module V1 - ## - # Secret Manager Service - # - # Manages secrets and operations using those secrets. Implements a REST - # model with the following objects: - # - # * {::Google::Cloud::SecretManager::V1::Secret Secret} - # * {::Google::Cloud::SecretManager::V1::SecretVersion SecretVersion} - # - # To load this service and instantiate a REST client: - # - # require "google/cloud/secret_manager/v1/secret_manager_service/rest" - # client = ::Google::Cloud::SecretManager::V1::SecretManagerService::Rest::Client.new - # - module SecretManagerService - # Client for the REST transport - module Rest - end - end - end - end - end -end - -helper_path = ::File.join __dir__, "rest", "helpers.rb" -require "google/cloud/secret_manager/v1/secret_manager_service/rest/helpers" if ::File.file? helper_path diff --git a/owl-bot-staging/google-cloud-secret_manager-v1/lib/google/cloud/secret_manager/v1/secret_manager_service/rest/client.rb b/owl-bot-staging/google-cloud-secret_manager-v1/lib/google/cloud/secret_manager/v1/secret_manager_service/rest/client.rb deleted file mode 100644 index 403207f878b0..000000000000 --- a/owl-bot-staging/google-cloud-secret_manager-v1/lib/google/cloud/secret_manager/v1/secret_manager_service/rest/client.rb +++ /dev/null @@ -1,1849 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -require "google/cloud/errors" -require "google/cloud/secretmanager/v1/service_pb" -require "google/cloud/secret_manager/v1/secret_manager_service/rest/service_stub" -require "google/cloud/location/rest" - -module Google - module Cloud - module SecretManager - module V1 - module SecretManagerService - module Rest - ## - # REST client for the SecretManagerService service. - # - # Secret Manager Service - # - # Manages secrets and operations using those secrets. Implements a REST - # model with the following objects: - # - # * {::Google::Cloud::SecretManager::V1::Secret Secret} - # * {::Google::Cloud::SecretManager::V1::SecretVersion SecretVersion} - # - class Client - # @private - API_VERSION = "" - - # @private - DEFAULT_ENDPOINT_TEMPLATE = "secretmanager.$UNIVERSE_DOMAIN$" - - include Paths - - # @private - attr_reader :secret_manager_service_stub - - ## - # Configure the SecretManagerService Client class. - # - # See {::Google::Cloud::SecretManager::V1::SecretManagerService::Rest::Client::Configuration} - # for a description of the configuration fields. - # - # @example - # - # # Modify the configuration for all SecretManagerService clients - # ::Google::Cloud::SecretManager::V1::SecretManagerService::Rest::Client.configure do |config| - # config.timeout = 10.0 - # end - # - # @yield [config] Configure the Client client. - # @yieldparam config [Client::Configuration] - # - # @return [Client::Configuration] - # - def self.configure - @configure ||= begin - namespace = ["Google", "Cloud", "SecretManager", "V1"] - parent_config = while namespace.any? - parent_name = namespace.join "::" - parent_const = const_get parent_name - break parent_const.configure if parent_const.respond_to? :configure - namespace.pop - end - default_config = Client::Configuration.new parent_config - - default_config.rpcs.list_secrets.timeout = 60.0 - - default_config.rpcs.create_secret.timeout = 60.0 - - default_config.rpcs.add_secret_version.timeout = 60.0 - - default_config.rpcs.get_secret.timeout = 60.0 - - default_config.rpcs.update_secret.timeout = 60.0 - - default_config.rpcs.delete_secret.timeout = 60.0 - - default_config.rpcs.list_secret_versions.timeout = 60.0 - - default_config.rpcs.get_secret_version.timeout = 60.0 - - default_config.rpcs.access_secret_version.timeout = 60.0 - default_config.rpcs.access_secret_version.retry_policy = { - initial_delay: 2.0, max_delay: 60.0, multiplier: 2.0, retry_codes: [14, 8] - } - - default_config.rpcs.disable_secret_version.timeout = 60.0 - - default_config.rpcs.enable_secret_version.timeout = 60.0 - - default_config.rpcs.destroy_secret_version.timeout = 60.0 - - default_config.rpcs.set_iam_policy.timeout = 60.0 - - default_config.rpcs.get_iam_policy.timeout = 60.0 - - default_config.rpcs.test_iam_permissions.timeout = 60.0 - - default_config - end - yield @configure if block_given? - @configure - end - - ## - # Configure the SecretManagerService Client instance. - # - # The configuration is set to the derived mode, meaning that values can be changed, - # but structural changes (adding new fields, etc.) are not allowed. Structural changes - # should be made on {Client.configure}. - # - # See {::Google::Cloud::SecretManager::V1::SecretManagerService::Rest::Client::Configuration} - # for a description of the configuration fields. - # - # @yield [config] Configure the Client client. - # @yieldparam config [Client::Configuration] - # - # @return [Client::Configuration] - # - def configure - yield @config if block_given? - @config - end - - ## - # The effective universe domain - # - # @return [String] - # - def universe_domain - @secret_manager_service_stub.universe_domain - end - - ## - # Create a new SecretManagerService REST client object. - # - # @example - # - # # Create a client using the default configuration - # client = ::Google::Cloud::SecretManager::V1::SecretManagerService::Rest::Client.new - # - # # Create a client using a custom configuration - # client = ::Google::Cloud::SecretManager::V1::SecretManagerService::Rest::Client.new do |config| - # config.timeout = 10.0 - # end - # - # @yield [config] Configure the SecretManagerService client. - # @yieldparam config [Client::Configuration] - # - def initialize - # Create the configuration object - @config = Configuration.new Client.configure - - # Yield the configuration if needed - yield @config if block_given? - - # Create credentials - credentials = @config.credentials - # Use self-signed JWT if the endpoint is unchanged from default, - # but only if the default endpoint does not have a region prefix. - enable_self_signed_jwt = @config.endpoint.nil? || - (@config.endpoint == Configuration::DEFAULT_ENDPOINT && - !@config.endpoint.split(".").first.include?("-")) - credentials ||= Credentials.default scope: @config.scope, - enable_self_signed_jwt: enable_self_signed_jwt - if credentials.is_a?(::String) || credentials.is_a?(::Hash) - credentials = Credentials.new credentials, scope: @config.scope - end - - @quota_project_id = @config.quota_project - @quota_project_id ||= credentials.quota_project_id if credentials.respond_to? :quota_project_id - - @secret_manager_service_stub = ::Google::Cloud::SecretManager::V1::SecretManagerService::Rest::ServiceStub.new( - endpoint: @config.endpoint, - endpoint_template: DEFAULT_ENDPOINT_TEMPLATE, - universe_domain: @config.universe_domain, - credentials: credentials, - logger: @config.logger - ) - - @secret_manager_service_stub.logger(stub: true)&.info do |entry| - entry.set_system_name - entry.set_service - entry.message = "Created client for #{entry.service}" - entry.set_credentials_fields credentials - entry.set "customEndpoint", @config.endpoint if @config.endpoint - entry.set "defaultTimeout", @config.timeout if @config.timeout - entry.set "quotaProject", @quota_project_id if @quota_project_id - end - - @location_client = Google::Cloud::Location::Locations::Rest::Client.new do |config| - config.credentials = credentials - config.quota_project = @quota_project_id - config.endpoint = @secret_manager_service_stub.endpoint - config.universe_domain = @secret_manager_service_stub.universe_domain - config.bindings_override = @config.bindings_override - config.logger = @secret_manager_service_stub.logger if config.respond_to? :logger= - end - end - - ## - # Get the associated client for mix-in of the Locations. - # - # @return [Google::Cloud::Location::Locations::Rest::Client] - # - attr_reader :location_client - - ## - # The logger used for request/response debug logging. - # - # @return [Logger] - # - def logger - @secret_manager_service_stub.logger - end - - # Service calls - - ## - # Lists {::Google::Cloud::SecretManager::V1::Secret Secrets}. - # - # @overload list_secrets(request, options = nil) - # Pass arguments to `list_secrets` via a request object, either of type - # {::Google::Cloud::SecretManager::V1::ListSecretsRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::SecretManager::V1::ListSecretsRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @overload list_secrets(parent: nil, page_size: nil, page_token: nil, filter: nil) - # Pass arguments to `list_secrets` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param parent [::String] - # Required. The resource name of the project associated with the - # {::Google::Cloud::SecretManager::V1::Secret Secrets}, in the format `projects/*` - # or `projects/*/locations/*` - # @param page_size [::Integer] - # Optional. The maximum number of results to be returned in a single page. If - # set to 0, the server decides the number of results to return. If the - # number is greater than 25000, it is capped at 25000. - # @param page_token [::String] - # Optional. Pagination token, returned earlier via - # {::Google::Cloud::SecretManager::V1::ListSecretsResponse#next_page_token ListSecretsResponse.next_page_token}. - # @param filter [::String] - # Optional. Filter string, adhering to the rules in - # [List-operation - # filtering](https://cloud.google.com/secret-manager/docs/filtering). List - # only secrets matching the filter. If filter is empty, all secrets are - # listed. - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Gapic::Rest::PagedEnumerable<::Google::Cloud::SecretManager::V1::Secret>] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Gapic::Rest::PagedEnumerable<::Google::Cloud::SecretManager::V1::Secret>] - # - # @raise [::Google::Cloud::Error] if the REST call is aborted. - # - # @example Basic example - # require "google/cloud/secret_manager/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::SecretManager::V1::SecretManagerService::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::SecretManager::V1::ListSecretsRequest.new - # - # # Call the list_secrets method. - # result = client.list_secrets request - # - # # The returned object is of type Gapic::PagedEnumerable. You can iterate - # # over elements, and API calls will be issued to fetch pages as needed. - # result.each do |item| - # # Each element is of type ::Google::Cloud::SecretManager::V1::Secret. - # p item - # end - # - def list_secrets request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::SecretManager::V1::ListSecretsRequest - - # Converts hash and nil to an options object - options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h - - # Customize the options with defaults - call_metadata = @config.rpcs.list_secrets.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::SecretManager::V1::VERSION, - transports_version_send: [:rest] - - call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - options.apply_defaults timeout: @config.rpcs.list_secrets.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.list_secrets.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @secret_manager_service_stub.list_secrets request, options do |result, operation| - result = ::Gapic::Rest::PagedEnumerable.new @secret_manager_service_stub, :list_secrets, "secrets", request, result, options - yield result, operation if block_given? - throw :response, result - end - rescue ::Gapic::Rest::Error => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Creates a new {::Google::Cloud::SecretManager::V1::Secret Secret} containing no - # {::Google::Cloud::SecretManager::V1::SecretVersion SecretVersions}. - # - # @overload create_secret(request, options = nil) - # Pass arguments to `create_secret` via a request object, either of type - # {::Google::Cloud::SecretManager::V1::CreateSecretRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::SecretManager::V1::CreateSecretRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @overload create_secret(parent: nil, secret_id: nil, secret: nil) - # Pass arguments to `create_secret` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param parent [::String] - # Required. The resource name of the project to associate with the - # {::Google::Cloud::SecretManager::V1::Secret Secret}, in the format `projects/*` - # or `projects/*/locations/*`. - # @param secret_id [::String] - # Required. This must be unique within the project. - # - # A secret ID is a string with a maximum length of 255 characters and can - # contain uppercase and lowercase letters, numerals, and the hyphen (`-`) and - # underscore (`_`) characters. - # @param secret [::Google::Cloud::SecretManager::V1::Secret, ::Hash] - # Required. A {::Google::Cloud::SecretManager::V1::Secret Secret} with initial - # field values. - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Cloud::SecretManager::V1::Secret] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::SecretManager::V1::Secret] - # - # @raise [::Google::Cloud::Error] if the REST call is aborted. - # - # @example Basic example - # require "google/cloud/secret_manager/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::SecretManager::V1::SecretManagerService::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::SecretManager::V1::CreateSecretRequest.new - # - # # Call the create_secret method. - # result = client.create_secret request - # - # # The returned object is of type Google::Cloud::SecretManager::V1::Secret. - # p result - # - def create_secret request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::SecretManager::V1::CreateSecretRequest - - # Converts hash and nil to an options object - options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h - - # Customize the options with defaults - call_metadata = @config.rpcs.create_secret.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::SecretManager::V1::VERSION, - transports_version_send: [:rest] - - call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - options.apply_defaults timeout: @config.rpcs.create_secret.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.create_secret.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @secret_manager_service_stub.create_secret request, options do |result, operation| - yield result, operation if block_given? - end - rescue ::Gapic::Rest::Error => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Creates a new {::Google::Cloud::SecretManager::V1::SecretVersion SecretVersion} - # containing secret data and attaches it to an existing - # {::Google::Cloud::SecretManager::V1::Secret Secret}. - # - # @overload add_secret_version(request, options = nil) - # Pass arguments to `add_secret_version` via a request object, either of type - # {::Google::Cloud::SecretManager::V1::AddSecretVersionRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::SecretManager::V1::AddSecretVersionRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @overload add_secret_version(parent: nil, payload: nil) - # Pass arguments to `add_secret_version` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param parent [::String] - # Required. The resource name of the - # {::Google::Cloud::SecretManager::V1::Secret Secret} to associate with the - # {::Google::Cloud::SecretManager::V1::SecretVersion SecretVersion} in the format - # `projects/*/secrets/*` or `projects/*/locations/*/secrets/*`. - # @param payload [::Google::Cloud::SecretManager::V1::SecretPayload, ::Hash] - # Required. The secret payload of the - # {::Google::Cloud::SecretManager::V1::SecretVersion SecretVersion}. - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Cloud::SecretManager::V1::SecretVersion] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::SecretManager::V1::SecretVersion] - # - # @raise [::Google::Cloud::Error] if the REST call is aborted. - # - # @example Basic example - # require "google/cloud/secret_manager/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::SecretManager::V1::SecretManagerService::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::SecretManager::V1::AddSecretVersionRequest.new - # - # # Call the add_secret_version method. - # result = client.add_secret_version request - # - # # The returned object is of type Google::Cloud::SecretManager::V1::SecretVersion. - # p result - # - def add_secret_version request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::SecretManager::V1::AddSecretVersionRequest - - # Converts hash and nil to an options object - options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h - - # Customize the options with defaults - call_metadata = @config.rpcs.add_secret_version.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::SecretManager::V1::VERSION, - transports_version_send: [:rest] - - call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - options.apply_defaults timeout: @config.rpcs.add_secret_version.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.add_secret_version.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @secret_manager_service_stub.add_secret_version request, options do |result, operation| - yield result, operation if block_given? - end - rescue ::Gapic::Rest::Error => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Gets metadata for a given {::Google::Cloud::SecretManager::V1::Secret Secret}. - # - # @overload get_secret(request, options = nil) - # Pass arguments to `get_secret` via a request object, either of type - # {::Google::Cloud::SecretManager::V1::GetSecretRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::SecretManager::V1::GetSecretRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @overload get_secret(name: nil) - # Pass arguments to `get_secret` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param name [::String] - # Required. The resource name of the - # {::Google::Cloud::SecretManager::V1::Secret Secret}, in the format - # `projects/*/secrets/*` or `projects/*/locations/*/secrets/*`. - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Cloud::SecretManager::V1::Secret] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::SecretManager::V1::Secret] - # - # @raise [::Google::Cloud::Error] if the REST call is aborted. - # - # @example Basic example - # require "google/cloud/secret_manager/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::SecretManager::V1::SecretManagerService::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::SecretManager::V1::GetSecretRequest.new - # - # # Call the get_secret method. - # result = client.get_secret request - # - # # The returned object is of type Google::Cloud::SecretManager::V1::Secret. - # p result - # - def get_secret request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::SecretManager::V1::GetSecretRequest - - # Converts hash and nil to an options object - options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h - - # Customize the options with defaults - call_metadata = @config.rpcs.get_secret.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::SecretManager::V1::VERSION, - transports_version_send: [:rest] - - call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - options.apply_defaults timeout: @config.rpcs.get_secret.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.get_secret.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @secret_manager_service_stub.get_secret request, options do |result, operation| - yield result, operation if block_given? - end - rescue ::Gapic::Rest::Error => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Updates metadata of an existing - # {::Google::Cloud::SecretManager::V1::Secret Secret}. - # - # @overload update_secret(request, options = nil) - # Pass arguments to `update_secret` via a request object, either of type - # {::Google::Cloud::SecretManager::V1::UpdateSecretRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::SecretManager::V1::UpdateSecretRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @overload update_secret(secret: nil, update_mask: nil) - # Pass arguments to `update_secret` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param secret [::Google::Cloud::SecretManager::V1::Secret, ::Hash] - # Required. {::Google::Cloud::SecretManager::V1::Secret Secret} with updated field - # values. - # @param update_mask [::Google::Protobuf::FieldMask, ::Hash] - # Required. Specifies the fields to be updated. - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Cloud::SecretManager::V1::Secret] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::SecretManager::V1::Secret] - # - # @raise [::Google::Cloud::Error] if the REST call is aborted. - # - # @example Basic example - # require "google/cloud/secret_manager/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::SecretManager::V1::SecretManagerService::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::SecretManager::V1::UpdateSecretRequest.new - # - # # Call the update_secret method. - # result = client.update_secret request - # - # # The returned object is of type Google::Cloud::SecretManager::V1::Secret. - # p result - # - def update_secret request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::SecretManager::V1::UpdateSecretRequest - - # Converts hash and nil to an options object - options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h - - # Customize the options with defaults - call_metadata = @config.rpcs.update_secret.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::SecretManager::V1::VERSION, - transports_version_send: [:rest] - - call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - options.apply_defaults timeout: @config.rpcs.update_secret.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.update_secret.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @secret_manager_service_stub.update_secret request, options do |result, operation| - yield result, operation if block_given? - end - rescue ::Gapic::Rest::Error => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Deletes a {::Google::Cloud::SecretManager::V1::Secret Secret}. - # - # @overload delete_secret(request, options = nil) - # Pass arguments to `delete_secret` via a request object, either of type - # {::Google::Cloud::SecretManager::V1::DeleteSecretRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::SecretManager::V1::DeleteSecretRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @overload delete_secret(name: nil, etag: nil) - # Pass arguments to `delete_secret` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param name [::String] - # Required. The resource name of the - # {::Google::Cloud::SecretManager::V1::Secret Secret} to delete in the format - # `projects/*/secrets/*`. - # @param etag [::String] - # Optional. Etag of the {::Google::Cloud::SecretManager::V1::Secret Secret}. The - # request succeeds if it matches the etag of the currently stored secret - # object. If the etag is omitted, the request succeeds. - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Protobuf::Empty] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Protobuf::Empty] - # - # @raise [::Google::Cloud::Error] if the REST call is aborted. - # - # @example Basic example - # require "google/cloud/secret_manager/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::SecretManager::V1::SecretManagerService::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::SecretManager::V1::DeleteSecretRequest.new - # - # # Call the delete_secret method. - # result = client.delete_secret request - # - # # The returned object is of type Google::Protobuf::Empty. - # p result - # - def delete_secret request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::SecretManager::V1::DeleteSecretRequest - - # Converts hash and nil to an options object - options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h - - # Customize the options with defaults - call_metadata = @config.rpcs.delete_secret.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::SecretManager::V1::VERSION, - transports_version_send: [:rest] - - call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - options.apply_defaults timeout: @config.rpcs.delete_secret.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.delete_secret.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @secret_manager_service_stub.delete_secret request, options do |result, operation| - yield result, operation if block_given? - end - rescue ::Gapic::Rest::Error => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Lists {::Google::Cloud::SecretManager::V1::SecretVersion SecretVersions}. This - # call does not return secret data. - # - # @overload list_secret_versions(request, options = nil) - # Pass arguments to `list_secret_versions` via a request object, either of type - # {::Google::Cloud::SecretManager::V1::ListSecretVersionsRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::SecretManager::V1::ListSecretVersionsRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @overload list_secret_versions(parent: nil, page_size: nil, page_token: nil, filter: nil) - # Pass arguments to `list_secret_versions` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param parent [::String] - # Required. The resource name of the - # {::Google::Cloud::SecretManager::V1::Secret Secret} associated with the - # {::Google::Cloud::SecretManager::V1::SecretVersion SecretVersions} to list, in - # the format `projects/*/secrets/*` or `projects/*/locations/*/secrets/*`. - # @param page_size [::Integer] - # Optional. The maximum number of results to be returned in a single page. If - # set to 0, the server decides the number of results to return. If the - # number is greater than 25000, it is capped at 25000. - # @param page_token [::String] - # Optional. Pagination token, returned earlier via - # ListSecretVersionsResponse.next_page_token][]. - # @param filter [::String] - # Optional. Filter string, adhering to the rules in - # [List-operation - # filtering](https://cloud.google.com/secret-manager/docs/filtering). List - # only secret versions matching the filter. If filter is empty, all secret - # versions are listed. - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Gapic::Rest::PagedEnumerable<::Google::Cloud::SecretManager::V1::SecretVersion>] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Gapic::Rest::PagedEnumerable<::Google::Cloud::SecretManager::V1::SecretVersion>] - # - # @raise [::Google::Cloud::Error] if the REST call is aborted. - # - # @example Basic example - # require "google/cloud/secret_manager/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::SecretManager::V1::SecretManagerService::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::SecretManager::V1::ListSecretVersionsRequest.new - # - # # Call the list_secret_versions method. - # result = client.list_secret_versions request - # - # # The returned object is of type Gapic::PagedEnumerable. You can iterate - # # over elements, and API calls will be issued to fetch pages as needed. - # result.each do |item| - # # Each element is of type ::Google::Cloud::SecretManager::V1::SecretVersion. - # p item - # end - # - def list_secret_versions request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::SecretManager::V1::ListSecretVersionsRequest - - # Converts hash and nil to an options object - options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h - - # Customize the options with defaults - call_metadata = @config.rpcs.list_secret_versions.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::SecretManager::V1::VERSION, - transports_version_send: [:rest] - - call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - options.apply_defaults timeout: @config.rpcs.list_secret_versions.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.list_secret_versions.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @secret_manager_service_stub.list_secret_versions request, options do |result, operation| - result = ::Gapic::Rest::PagedEnumerable.new @secret_manager_service_stub, :list_secret_versions, "versions", request, result, options - yield result, operation if block_given? - throw :response, result - end - rescue ::Gapic::Rest::Error => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Gets metadata for a - # {::Google::Cloud::SecretManager::V1::SecretVersion SecretVersion}. - # - # `projects/*/secrets/*/versions/latest` is an alias to the most recently - # created {::Google::Cloud::SecretManager::V1::SecretVersion SecretVersion}. - # - # @overload get_secret_version(request, options = nil) - # Pass arguments to `get_secret_version` via a request object, either of type - # {::Google::Cloud::SecretManager::V1::GetSecretVersionRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::SecretManager::V1::GetSecretVersionRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @overload get_secret_version(name: nil) - # Pass arguments to `get_secret_version` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param name [::String] - # Required. The resource name of the - # {::Google::Cloud::SecretManager::V1::SecretVersion SecretVersion} in the format - # `projects/*/secrets/*/versions/*` or - # `projects/*/locations/*/secrets/*/versions/*`. - # - # `projects/*/secrets/*/versions/latest` or - # `projects/*/locations/*/secrets/*/versions/latest` is an alias to the most - # recently created - # {::Google::Cloud::SecretManager::V1::SecretVersion SecretVersion}. - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Cloud::SecretManager::V1::SecretVersion] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::SecretManager::V1::SecretVersion] - # - # @raise [::Google::Cloud::Error] if the REST call is aborted. - # - # @example Basic example - # require "google/cloud/secret_manager/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::SecretManager::V1::SecretManagerService::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::SecretManager::V1::GetSecretVersionRequest.new - # - # # Call the get_secret_version method. - # result = client.get_secret_version request - # - # # The returned object is of type Google::Cloud::SecretManager::V1::SecretVersion. - # p result - # - def get_secret_version request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::SecretManager::V1::GetSecretVersionRequest - - # Converts hash and nil to an options object - options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h - - # Customize the options with defaults - call_metadata = @config.rpcs.get_secret_version.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::SecretManager::V1::VERSION, - transports_version_send: [:rest] - - call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - options.apply_defaults timeout: @config.rpcs.get_secret_version.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.get_secret_version.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @secret_manager_service_stub.get_secret_version request, options do |result, operation| - yield result, operation if block_given? - end - rescue ::Gapic::Rest::Error => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Accesses a {::Google::Cloud::SecretManager::V1::SecretVersion SecretVersion}. - # This call returns the secret data. - # - # `projects/*/secrets/*/versions/latest` is an alias to the most recently - # created {::Google::Cloud::SecretManager::V1::SecretVersion SecretVersion}. - # - # @overload access_secret_version(request, options = nil) - # Pass arguments to `access_secret_version` via a request object, either of type - # {::Google::Cloud::SecretManager::V1::AccessSecretVersionRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::SecretManager::V1::AccessSecretVersionRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @overload access_secret_version(name: nil) - # Pass arguments to `access_secret_version` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param name [::String] - # Required. The resource name of the - # {::Google::Cloud::SecretManager::V1::SecretVersion SecretVersion} in the format - # `projects/*/secrets/*/versions/*` or - # `projects/*/locations/*/secrets/*/versions/*`. - # - # `projects/*/secrets/*/versions/latest` or - # `projects/*/locations/*/secrets/*/versions/latest` is an alias to the most - # recently created - # {::Google::Cloud::SecretManager::V1::SecretVersion SecretVersion}. - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Cloud::SecretManager::V1::AccessSecretVersionResponse] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::SecretManager::V1::AccessSecretVersionResponse] - # - # @raise [::Google::Cloud::Error] if the REST call is aborted. - # - # @example Basic example - # require "google/cloud/secret_manager/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::SecretManager::V1::SecretManagerService::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::SecretManager::V1::AccessSecretVersionRequest.new - # - # # Call the access_secret_version method. - # result = client.access_secret_version request - # - # # The returned object is of type Google::Cloud::SecretManager::V1::AccessSecretVersionResponse. - # p result - # - def access_secret_version request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::SecretManager::V1::AccessSecretVersionRequest - - # Converts hash and nil to an options object - options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h - - # Customize the options with defaults - call_metadata = @config.rpcs.access_secret_version.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::SecretManager::V1::VERSION, - transports_version_send: [:rest] - - call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - options.apply_defaults timeout: @config.rpcs.access_secret_version.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.access_secret_version.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @secret_manager_service_stub.access_secret_version request, options do |result, operation| - yield result, operation if block_given? - end - rescue ::Gapic::Rest::Error => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Disables a {::Google::Cloud::SecretManager::V1::SecretVersion SecretVersion}. - # - # Sets the {::Google::Cloud::SecretManager::V1::SecretVersion#state state} of the - # {::Google::Cloud::SecretManager::V1::SecretVersion SecretVersion} to - # {::Google::Cloud::SecretManager::V1::SecretVersion::State::DISABLED DISABLED}. - # - # @overload disable_secret_version(request, options = nil) - # Pass arguments to `disable_secret_version` via a request object, either of type - # {::Google::Cloud::SecretManager::V1::DisableSecretVersionRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::SecretManager::V1::DisableSecretVersionRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @overload disable_secret_version(name: nil, etag: nil) - # Pass arguments to `disable_secret_version` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param name [::String] - # Required. The resource name of the - # {::Google::Cloud::SecretManager::V1::SecretVersion SecretVersion} to disable in - # the format `projects/*/secrets/*/versions/*` or - # `projects/*/locations/*/secrets/*/versions/*`. - # @param etag [::String] - # Optional. Etag of the - # {::Google::Cloud::SecretManager::V1::SecretVersion SecretVersion}. The request - # succeeds if it matches the etag of the currently stored secret version - # object. If the etag is omitted, the request succeeds. - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Cloud::SecretManager::V1::SecretVersion] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::SecretManager::V1::SecretVersion] - # - # @raise [::Google::Cloud::Error] if the REST call is aborted. - # - # @example Basic example - # require "google/cloud/secret_manager/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::SecretManager::V1::SecretManagerService::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::SecretManager::V1::DisableSecretVersionRequest.new - # - # # Call the disable_secret_version method. - # result = client.disable_secret_version request - # - # # The returned object is of type Google::Cloud::SecretManager::V1::SecretVersion. - # p result - # - def disable_secret_version request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::SecretManager::V1::DisableSecretVersionRequest - - # Converts hash and nil to an options object - options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h - - # Customize the options with defaults - call_metadata = @config.rpcs.disable_secret_version.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::SecretManager::V1::VERSION, - transports_version_send: [:rest] - - call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - options.apply_defaults timeout: @config.rpcs.disable_secret_version.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.disable_secret_version.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @secret_manager_service_stub.disable_secret_version request, options do |result, operation| - yield result, operation if block_given? - end - rescue ::Gapic::Rest::Error => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Enables a {::Google::Cloud::SecretManager::V1::SecretVersion SecretVersion}. - # - # Sets the {::Google::Cloud::SecretManager::V1::SecretVersion#state state} of the - # {::Google::Cloud::SecretManager::V1::SecretVersion SecretVersion} to - # {::Google::Cloud::SecretManager::V1::SecretVersion::State::ENABLED ENABLED}. - # - # @overload enable_secret_version(request, options = nil) - # Pass arguments to `enable_secret_version` via a request object, either of type - # {::Google::Cloud::SecretManager::V1::EnableSecretVersionRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::SecretManager::V1::EnableSecretVersionRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @overload enable_secret_version(name: nil, etag: nil) - # Pass arguments to `enable_secret_version` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param name [::String] - # Required. The resource name of the - # {::Google::Cloud::SecretManager::V1::SecretVersion SecretVersion} to enable in - # the format `projects/*/secrets/*/versions/*` or - # `projects/*/locations/*/secrets/*/versions/*`. - # @param etag [::String] - # Optional. Etag of the - # {::Google::Cloud::SecretManager::V1::SecretVersion SecretVersion}. The request - # succeeds if it matches the etag of the currently stored secret version - # object. If the etag is omitted, the request succeeds. - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Cloud::SecretManager::V1::SecretVersion] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::SecretManager::V1::SecretVersion] - # - # @raise [::Google::Cloud::Error] if the REST call is aborted. - # - # @example Basic example - # require "google/cloud/secret_manager/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::SecretManager::V1::SecretManagerService::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::SecretManager::V1::EnableSecretVersionRequest.new - # - # # Call the enable_secret_version method. - # result = client.enable_secret_version request - # - # # The returned object is of type Google::Cloud::SecretManager::V1::SecretVersion. - # p result - # - def enable_secret_version request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::SecretManager::V1::EnableSecretVersionRequest - - # Converts hash and nil to an options object - options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h - - # Customize the options with defaults - call_metadata = @config.rpcs.enable_secret_version.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::SecretManager::V1::VERSION, - transports_version_send: [:rest] - - call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - options.apply_defaults timeout: @config.rpcs.enable_secret_version.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.enable_secret_version.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @secret_manager_service_stub.enable_secret_version request, options do |result, operation| - yield result, operation if block_given? - end - rescue ::Gapic::Rest::Error => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Destroys a {::Google::Cloud::SecretManager::V1::SecretVersion SecretVersion}. - # - # Sets the {::Google::Cloud::SecretManager::V1::SecretVersion#state state} of the - # {::Google::Cloud::SecretManager::V1::SecretVersion SecretVersion} to - # {::Google::Cloud::SecretManager::V1::SecretVersion::State::DESTROYED DESTROYED} - # and irrevocably destroys the secret data. - # - # @overload destroy_secret_version(request, options = nil) - # Pass arguments to `destroy_secret_version` via a request object, either of type - # {::Google::Cloud::SecretManager::V1::DestroySecretVersionRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::SecretManager::V1::DestroySecretVersionRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @overload destroy_secret_version(name: nil, etag: nil) - # Pass arguments to `destroy_secret_version` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param name [::String] - # Required. The resource name of the - # {::Google::Cloud::SecretManager::V1::SecretVersion SecretVersion} to destroy in - # the format `projects/*/secrets/*/versions/*` or - # `projects/*/locations/*/secrets/*/versions/*`. - # @param etag [::String] - # Optional. Etag of the - # {::Google::Cloud::SecretManager::V1::SecretVersion SecretVersion}. The request - # succeeds if it matches the etag of the currently stored secret version - # object. If the etag is omitted, the request succeeds. - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Cloud::SecretManager::V1::SecretVersion] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::SecretManager::V1::SecretVersion] - # - # @raise [::Google::Cloud::Error] if the REST call is aborted. - # - # @example Basic example - # require "google/cloud/secret_manager/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::SecretManager::V1::SecretManagerService::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::SecretManager::V1::DestroySecretVersionRequest.new - # - # # Call the destroy_secret_version method. - # result = client.destroy_secret_version request - # - # # The returned object is of type Google::Cloud::SecretManager::V1::SecretVersion. - # p result - # - def destroy_secret_version request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::SecretManager::V1::DestroySecretVersionRequest - - # Converts hash and nil to an options object - options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h - - # Customize the options with defaults - call_metadata = @config.rpcs.destroy_secret_version.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::SecretManager::V1::VERSION, - transports_version_send: [:rest] - - call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - options.apply_defaults timeout: @config.rpcs.destroy_secret_version.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.destroy_secret_version.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @secret_manager_service_stub.destroy_secret_version request, options do |result, operation| - yield result, operation if block_given? - end - rescue ::Gapic::Rest::Error => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Sets the access control policy on the specified secret. Replaces any - # existing policy. - # - # Permissions on - # {::Google::Cloud::SecretManager::V1::SecretVersion SecretVersions} are enforced - # according to the policy set on the associated - # {::Google::Cloud::SecretManager::V1::Secret Secret}. - # - # @overload set_iam_policy(request, options = nil) - # Pass arguments to `set_iam_policy` via a request object, either of type - # {::Google::Iam::V1::SetIamPolicyRequest} or an equivalent Hash. - # - # @param request [::Google::Iam::V1::SetIamPolicyRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @overload set_iam_policy(resource: nil, policy: nil, update_mask: nil) - # Pass arguments to `set_iam_policy` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param resource [::String] - # REQUIRED: The resource for which the policy is being specified. - # See the operation documentation for the appropriate value for this field. - # @param policy [::Google::Iam::V1::Policy, ::Hash] - # REQUIRED: The complete policy to be applied to the `resource`. The size of - # the policy is limited to a few 10s of KB. An empty policy is a - # valid policy but certain Cloud Platform services (such as Projects) - # might reject them. - # @param update_mask [::Google::Protobuf::FieldMask, ::Hash] - # OPTIONAL: A FieldMask specifying which fields of the policy to modify. Only - # the fields in the mask will be modified. If no mask is provided, the - # following default mask is used: - # - # `paths: "bindings, etag"` - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Iam::V1::Policy] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Iam::V1::Policy] - # - # @raise [::Google::Cloud::Error] if the REST call is aborted. - # - # @example Basic example - # require "google/cloud/secret_manager/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::SecretManager::V1::SecretManagerService::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Iam::V1::SetIamPolicyRequest.new - # - # # Call the set_iam_policy method. - # result = client.set_iam_policy request - # - # # The returned object is of type Google::Iam::V1::Policy. - # p result - # - def set_iam_policy request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Iam::V1::SetIamPolicyRequest - - # Converts hash and nil to an options object - options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h - - # Customize the options with defaults - call_metadata = @config.rpcs.set_iam_policy.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::SecretManager::V1::VERSION, - transports_version_send: [:rest] - - call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - options.apply_defaults timeout: @config.rpcs.set_iam_policy.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.set_iam_policy.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @secret_manager_service_stub.set_iam_policy request, options do |result, operation| - yield result, operation if block_given? - end - rescue ::Gapic::Rest::Error => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Gets the access control policy for a secret. - # Returns empty policy if the secret exists and does not have a policy set. - # - # @overload get_iam_policy(request, options = nil) - # Pass arguments to `get_iam_policy` via a request object, either of type - # {::Google::Iam::V1::GetIamPolicyRequest} or an equivalent Hash. - # - # @param request [::Google::Iam::V1::GetIamPolicyRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @overload get_iam_policy(resource: nil, options: nil) - # Pass arguments to `get_iam_policy` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param resource [::String] - # REQUIRED: The resource for which the policy is being requested. - # See the operation documentation for the appropriate value for this field. - # @param options [::Google::Iam::V1::GetPolicyOptions, ::Hash] - # OPTIONAL: A `GetPolicyOptions` object for specifying options to - # `GetIamPolicy`. - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Iam::V1::Policy] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Iam::V1::Policy] - # - # @raise [::Google::Cloud::Error] if the REST call is aborted. - # - # @example Basic example - # require "google/cloud/secret_manager/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::SecretManager::V1::SecretManagerService::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Iam::V1::GetIamPolicyRequest.new - # - # # Call the get_iam_policy method. - # result = client.get_iam_policy request - # - # # The returned object is of type Google::Iam::V1::Policy. - # p result - # - def get_iam_policy request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Iam::V1::GetIamPolicyRequest - - # Converts hash and nil to an options object - options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h - - # Customize the options with defaults - call_metadata = @config.rpcs.get_iam_policy.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::SecretManager::V1::VERSION, - transports_version_send: [:rest] - - call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - options.apply_defaults timeout: @config.rpcs.get_iam_policy.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.get_iam_policy.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @secret_manager_service_stub.get_iam_policy request, options do |result, operation| - yield result, operation if block_given? - end - rescue ::Gapic::Rest::Error => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Returns permissions that a caller has for the specified secret. - # If the secret does not exist, this call returns an empty set of - # permissions, not a NOT_FOUND error. - # - # Note: This operation is designed to be used for building permission-aware - # UIs and command-line tools, not for authorization checking. This operation - # may "fail open" without warning. - # - # @overload test_iam_permissions(request, options = nil) - # Pass arguments to `test_iam_permissions` via a request object, either of type - # {::Google::Iam::V1::TestIamPermissionsRequest} or an equivalent Hash. - # - # @param request [::Google::Iam::V1::TestIamPermissionsRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @overload test_iam_permissions(resource: nil, permissions: nil) - # Pass arguments to `test_iam_permissions` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param resource [::String] - # REQUIRED: The resource for which the policy detail is being requested. - # See the operation documentation for the appropriate value for this field. - # @param permissions [::Array<::String>] - # The set of permissions to check for the `resource`. Permissions with - # wildcards (such as '*' or 'storage.*') are not allowed. For more - # information see - # [IAM Overview](https://cloud.google.com/iam/docs/overview#permissions). - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Iam::V1::TestIamPermissionsResponse] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Iam::V1::TestIamPermissionsResponse] - # - # @raise [::Google::Cloud::Error] if the REST call is aborted. - # - # @example Basic example - # require "google/cloud/secret_manager/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::SecretManager::V1::SecretManagerService::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Iam::V1::TestIamPermissionsRequest.new - # - # # Call the test_iam_permissions method. - # result = client.test_iam_permissions request - # - # # The returned object is of type Google::Iam::V1::TestIamPermissionsResponse. - # p result - # - def test_iam_permissions request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Iam::V1::TestIamPermissionsRequest - - # Converts hash and nil to an options object - options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h - - # Customize the options with defaults - call_metadata = @config.rpcs.test_iam_permissions.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::SecretManager::V1::VERSION, - transports_version_send: [:rest] - - call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - options.apply_defaults timeout: @config.rpcs.test_iam_permissions.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.test_iam_permissions.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @secret_manager_service_stub.test_iam_permissions request, options do |result, operation| - yield result, operation if block_given? - end - rescue ::Gapic::Rest::Error => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Configuration class for the SecretManagerService REST API. - # - # This class represents the configuration for SecretManagerService REST, - # providing control over timeouts, retry behavior, logging, transport - # parameters, and other low-level controls. Certain parameters can also be - # applied individually to specific RPCs. See - # {::Google::Cloud::SecretManager::V1::SecretManagerService::Rest::Client::Configuration::Rpcs} - # for a list of RPCs that can be configured independently. - # - # Configuration can be applied globally to all clients, or to a single client - # on construction. - # - # @example - # - # # Modify the global config, setting the timeout for - # # list_secrets to 20 seconds, - # # and all remaining timeouts to 10 seconds. - # ::Google::Cloud::SecretManager::V1::SecretManagerService::Rest::Client.configure do |config| - # config.timeout = 10.0 - # config.rpcs.list_secrets.timeout = 20.0 - # end - # - # # Apply the above configuration only to a new client. - # client = ::Google::Cloud::SecretManager::V1::SecretManagerService::Rest::Client.new do |config| - # config.timeout = 10.0 - # config.rpcs.list_secrets.timeout = 20.0 - # end - # - # @!attribute [rw] endpoint - # A custom service endpoint, as a hostname or hostname:port. The default is - # nil, indicating to use the default endpoint in the current universe domain. - # @return [::String,nil] - # @!attribute [rw] credentials - # Credentials to send with calls. You may provide any of the following types: - # * (`String`) The path to a service account key file in JSON format - # * (`Hash`) A service account key as a Hash - # * (`Google::Auth::Credentials`) A googleauth credentials object - # (see the [googleauth docs](https://rubydoc.info/gems/googleauth/Google/Auth/Credentials)) - # * (`Signet::OAuth2::Client`) A signet oauth2 client object - # (see the [signet docs](https://rubydoc.info/gems/signet/Signet/OAuth2/Client)) - # * (`nil`) indicating no credentials - # - # Warning: If you accept a credential configuration (JSON file or Hash) from an - # external source for authentication to Google Cloud, you must validate it before - # providing it to a Google API client library. Providing an unvalidated credential - # configuration to Google APIs can compromise the security of your systems and data. - # For more information, refer to [Validate credential configurations from external - # sources](https://cloud.google.com/docs/authentication/external/externally-sourced-credentials). - # @return [::Object] - # @!attribute [rw] scope - # The OAuth scopes - # @return [::Array<::String>] - # @!attribute [rw] lib_name - # The library name as recorded in instrumentation and logging - # @return [::String] - # @!attribute [rw] lib_version - # The library version as recorded in instrumentation and logging - # @return [::String] - # @!attribute [rw] timeout - # The call timeout in seconds. - # @return [::Numeric] - # @!attribute [rw] metadata - # Additional headers to be sent with the call. - # @return [::Hash{::Symbol=>::String}] - # @!attribute [rw] retry_policy - # The retry policy. The value is a hash with the following keys: - # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds. - # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds. - # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier. - # * `:retry_codes` (*type:* `Array`) - The error codes that should - # trigger a retry. - # @return [::Hash] - # @!attribute [rw] quota_project - # A separate project against which to charge quota. - # @return [::String] - # @!attribute [rw] universe_domain - # The universe domain within which to make requests. This determines the - # default endpoint URL. The default value of nil uses the environment - # universe (usually the default "googleapis.com" universe). - # @return [::String,nil] - # @!attribute [rw] logger - # A custom logger to use for request/response debug logging, or the value - # `:default` (the default) to construct a default logger, or `nil` to - # explicitly disable logging. - # @return [::Logger,:default,nil] - # - class Configuration - extend ::Gapic::Config - - # @private - # The endpoint specific to the default "googleapis.com" universe. Deprecated. - DEFAULT_ENDPOINT = "secretmanager.googleapis.com" - - config_attr :endpoint, nil, ::String, nil - config_attr :credentials, nil do |value| - allowed = [::String, ::Hash, ::Proc, ::Symbol, ::Google::Auth::Credentials, ::Google::Auth::BaseClient, ::Signet::OAuth2::Client, nil] - allowed.any? { |klass| klass === value } - end - config_attr :scope, nil, ::String, ::Array, nil - config_attr :lib_name, nil, ::String, nil - config_attr :lib_version, nil, ::String, nil - config_attr :timeout, nil, ::Numeric, nil - config_attr :metadata, nil, ::Hash, nil - config_attr :retry_policy, nil, ::Hash, ::Proc, nil - config_attr :quota_project, nil, ::String, nil - config_attr :universe_domain, nil, ::String, nil - - # @private - # Overrides for http bindings for the RPCs of this service - # are only used when this service is used as mixin, and only - # by the host service. - # @return [::Hash{::Symbol=>::Array<::Gapic::Rest::GrpcTranscoder::HttpBinding>}] - config_attr :bindings_override, {}, ::Hash, nil - config_attr :logger, :default, ::Logger, nil, :default - - # @private - def initialize parent_config = nil - @parent_config = parent_config unless parent_config.nil? - - yield self if block_given? - end - - ## - # Configurations for individual RPCs - # @return [Rpcs] - # - def rpcs - @rpcs ||= begin - parent_rpcs = nil - parent_rpcs = @parent_config.rpcs if defined?(@parent_config) && @parent_config.respond_to?(:rpcs) - Rpcs.new parent_rpcs - end - end - - ## - # Configuration RPC class for the SecretManagerService API. - # - # Includes fields providing the configuration for each RPC in this service. - # Each configuration object is of type `Gapic::Config::Method` and includes - # the following configuration fields: - # - # * `timeout` (*type:* `Numeric`) - The call timeout in seconds - # * `metadata` (*type:* `Hash{Symbol=>String}`) - Additional headers - # * `retry_policy (*type:* `Hash`) - The retry policy. The policy fields - # include the following keys: - # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds. - # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds. - # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier. - # * `:retry_codes` (*type:* `Array`) - The error codes that should - # trigger a retry. - # - class Rpcs - ## - # RPC-specific configuration for `list_secrets` - # @return [::Gapic::Config::Method] - # - attr_reader :list_secrets - ## - # RPC-specific configuration for `create_secret` - # @return [::Gapic::Config::Method] - # - attr_reader :create_secret - ## - # RPC-specific configuration for `add_secret_version` - # @return [::Gapic::Config::Method] - # - attr_reader :add_secret_version - ## - # RPC-specific configuration for `get_secret` - # @return [::Gapic::Config::Method] - # - attr_reader :get_secret - ## - # RPC-specific configuration for `update_secret` - # @return [::Gapic::Config::Method] - # - attr_reader :update_secret - ## - # RPC-specific configuration for `delete_secret` - # @return [::Gapic::Config::Method] - # - attr_reader :delete_secret - ## - # RPC-specific configuration for `list_secret_versions` - # @return [::Gapic::Config::Method] - # - attr_reader :list_secret_versions - ## - # RPC-specific configuration for `get_secret_version` - # @return [::Gapic::Config::Method] - # - attr_reader :get_secret_version - ## - # RPC-specific configuration for `access_secret_version` - # @return [::Gapic::Config::Method] - # - attr_reader :access_secret_version - ## - # RPC-specific configuration for `disable_secret_version` - # @return [::Gapic::Config::Method] - # - attr_reader :disable_secret_version - ## - # RPC-specific configuration for `enable_secret_version` - # @return [::Gapic::Config::Method] - # - attr_reader :enable_secret_version - ## - # RPC-specific configuration for `destroy_secret_version` - # @return [::Gapic::Config::Method] - # - attr_reader :destroy_secret_version - ## - # RPC-specific configuration for `set_iam_policy` - # @return [::Gapic::Config::Method] - # - attr_reader :set_iam_policy - ## - # RPC-specific configuration for `get_iam_policy` - # @return [::Gapic::Config::Method] - # - attr_reader :get_iam_policy - ## - # RPC-specific configuration for `test_iam_permissions` - # @return [::Gapic::Config::Method] - # - attr_reader :test_iam_permissions - - # @private - def initialize parent_rpcs = nil - list_secrets_config = parent_rpcs.list_secrets if parent_rpcs.respond_to? :list_secrets - @list_secrets = ::Gapic::Config::Method.new list_secrets_config - create_secret_config = parent_rpcs.create_secret if parent_rpcs.respond_to? :create_secret - @create_secret = ::Gapic::Config::Method.new create_secret_config - add_secret_version_config = parent_rpcs.add_secret_version if parent_rpcs.respond_to? :add_secret_version - @add_secret_version = ::Gapic::Config::Method.new add_secret_version_config - get_secret_config = parent_rpcs.get_secret if parent_rpcs.respond_to? :get_secret - @get_secret = ::Gapic::Config::Method.new get_secret_config - update_secret_config = parent_rpcs.update_secret if parent_rpcs.respond_to? :update_secret - @update_secret = ::Gapic::Config::Method.new update_secret_config - delete_secret_config = parent_rpcs.delete_secret if parent_rpcs.respond_to? :delete_secret - @delete_secret = ::Gapic::Config::Method.new delete_secret_config - list_secret_versions_config = parent_rpcs.list_secret_versions if parent_rpcs.respond_to? :list_secret_versions - @list_secret_versions = ::Gapic::Config::Method.new list_secret_versions_config - get_secret_version_config = parent_rpcs.get_secret_version if parent_rpcs.respond_to? :get_secret_version - @get_secret_version = ::Gapic::Config::Method.new get_secret_version_config - access_secret_version_config = parent_rpcs.access_secret_version if parent_rpcs.respond_to? :access_secret_version - @access_secret_version = ::Gapic::Config::Method.new access_secret_version_config - disable_secret_version_config = parent_rpcs.disable_secret_version if parent_rpcs.respond_to? :disable_secret_version - @disable_secret_version = ::Gapic::Config::Method.new disable_secret_version_config - enable_secret_version_config = parent_rpcs.enable_secret_version if parent_rpcs.respond_to? :enable_secret_version - @enable_secret_version = ::Gapic::Config::Method.new enable_secret_version_config - destroy_secret_version_config = parent_rpcs.destroy_secret_version if parent_rpcs.respond_to? :destroy_secret_version - @destroy_secret_version = ::Gapic::Config::Method.new destroy_secret_version_config - set_iam_policy_config = parent_rpcs.set_iam_policy if parent_rpcs.respond_to? :set_iam_policy - @set_iam_policy = ::Gapic::Config::Method.new set_iam_policy_config - get_iam_policy_config = parent_rpcs.get_iam_policy if parent_rpcs.respond_to? :get_iam_policy - @get_iam_policy = ::Gapic::Config::Method.new get_iam_policy_config - test_iam_permissions_config = parent_rpcs.test_iam_permissions if parent_rpcs.respond_to? :test_iam_permissions - @test_iam_permissions = ::Gapic::Config::Method.new test_iam_permissions_config - - yield self if block_given? - end - end - end - end - end - end - end - end - end -end diff --git a/owl-bot-staging/google-cloud-secret_manager-v1/lib/google/cloud/secret_manager/v1/secret_manager_service/rest/service_stub.rb b/owl-bot-staging/google-cloud-secret_manager-v1/lib/google/cloud/secret_manager/v1/secret_manager_service/rest/service_stub.rb deleted file mode 100644 index 8568784eec95..000000000000 --- a/owl-bot-staging/google-cloud-secret_manager-v1/lib/google/cloud/secret_manager/v1/secret_manager_service/rest/service_stub.rb +++ /dev/null @@ -1,1117 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -require "google/cloud/secretmanager/v1/service_pb" - -module Google - module Cloud - module SecretManager - module V1 - module SecretManagerService - module Rest - ## - # REST service stub for the SecretManagerService service. - # Service stub contains baseline method implementations - # including transcoding, making the REST call, and deserialing the response. - # - class ServiceStub - # @private - def initialize endpoint:, endpoint_template:, universe_domain:, credentials:, logger: - # These require statements are intentionally placed here to initialize - # the REST modules only when it's required. - require "gapic/rest" - - @client_stub = ::Gapic::Rest::ClientStub.new endpoint: endpoint, - endpoint_template: endpoint_template, - universe_domain: universe_domain, - credentials: credentials, - numeric_enums: true, - service_name: self.class, - raise_faraday_errors: false, - logger: logger - end - - ## - # The effective universe domain - # - # @return [String] - # - def universe_domain - @client_stub.universe_domain - end - - ## - # The effective endpoint - # - # @return [String] - # - def endpoint - @client_stub.endpoint - end - - ## - # The logger used for request/response debug logging. - # - # @return [Logger] - # - def logger stub: false - stub ? @client_stub.stub_logger : @client_stub.logger - end - - ## - # Baseline implementation for the list_secrets REST call - # - # @param request_pb [::Google::Cloud::SecretManager::V1::ListSecretsRequest] - # A request object representing the call parameters. Required. - # @param options [::Gapic::CallOptions] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Cloud::SecretManager::V1::ListSecretsResponse] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::SecretManager::V1::ListSecretsResponse] - # A result object deserialized from the server's reply - def list_secrets request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_list_secrets_request request_pb - query_string_params = if query_string_params.any? - query_string_params.to_h { |p| p.split "=", 2 } - else - {} - end - - response = @client_stub.make_http_request( - verb, - uri: uri, - body: body || "", - params: query_string_params, - method_name: "list_secrets", - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Cloud::SecretManager::V1::ListSecretsResponse.decode_json response.body, ignore_unknown_fields: true - catch :response do - yield result, operation if block_given? - result - end - end - - ## - # Baseline implementation for the create_secret REST call - # - # @param request_pb [::Google::Cloud::SecretManager::V1::CreateSecretRequest] - # A request object representing the call parameters. Required. - # @param options [::Gapic::CallOptions] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Cloud::SecretManager::V1::Secret] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::SecretManager::V1::Secret] - # A result object deserialized from the server's reply - def create_secret request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_create_secret_request request_pb - query_string_params = if query_string_params.any? - query_string_params.to_h { |p| p.split "=", 2 } - else - {} - end - - response = @client_stub.make_http_request( - verb, - uri: uri, - body: body || "", - params: query_string_params, - method_name: "create_secret", - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Cloud::SecretManager::V1::Secret.decode_json response.body, ignore_unknown_fields: true - catch :response do - yield result, operation if block_given? - result - end - end - - ## - # Baseline implementation for the add_secret_version REST call - # - # @param request_pb [::Google::Cloud::SecretManager::V1::AddSecretVersionRequest] - # A request object representing the call parameters. Required. - # @param options [::Gapic::CallOptions] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Cloud::SecretManager::V1::SecretVersion] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::SecretManager::V1::SecretVersion] - # A result object deserialized from the server's reply - def add_secret_version request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_add_secret_version_request request_pb - query_string_params = if query_string_params.any? - query_string_params.to_h { |p| p.split "=", 2 } - else - {} - end - - response = @client_stub.make_http_request( - verb, - uri: uri, - body: body || "", - params: query_string_params, - method_name: "add_secret_version", - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Cloud::SecretManager::V1::SecretVersion.decode_json response.body, ignore_unknown_fields: true - catch :response do - yield result, operation if block_given? - result - end - end - - ## - # Baseline implementation for the get_secret REST call - # - # @param request_pb [::Google::Cloud::SecretManager::V1::GetSecretRequest] - # A request object representing the call parameters. Required. - # @param options [::Gapic::CallOptions] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Cloud::SecretManager::V1::Secret] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::SecretManager::V1::Secret] - # A result object deserialized from the server's reply - def get_secret request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_get_secret_request request_pb - query_string_params = if query_string_params.any? - query_string_params.to_h { |p| p.split "=", 2 } - else - {} - end - - response = @client_stub.make_http_request( - verb, - uri: uri, - body: body || "", - params: query_string_params, - method_name: "get_secret", - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Cloud::SecretManager::V1::Secret.decode_json response.body, ignore_unknown_fields: true - catch :response do - yield result, operation if block_given? - result - end - end - - ## - # Baseline implementation for the update_secret REST call - # - # @param request_pb [::Google::Cloud::SecretManager::V1::UpdateSecretRequest] - # A request object representing the call parameters. Required. - # @param options [::Gapic::CallOptions] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Cloud::SecretManager::V1::Secret] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::SecretManager::V1::Secret] - # A result object deserialized from the server's reply - def update_secret request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_update_secret_request request_pb - query_string_params = if query_string_params.any? - query_string_params.to_h { |p| p.split "=", 2 } - else - {} - end - - response = @client_stub.make_http_request( - verb, - uri: uri, - body: body || "", - params: query_string_params, - method_name: "update_secret", - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Cloud::SecretManager::V1::Secret.decode_json response.body, ignore_unknown_fields: true - catch :response do - yield result, operation if block_given? - result - end - end - - ## - # Baseline implementation for the delete_secret REST call - # - # @param request_pb [::Google::Cloud::SecretManager::V1::DeleteSecretRequest] - # A request object representing the call parameters. Required. - # @param options [::Gapic::CallOptions] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Protobuf::Empty] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Protobuf::Empty] - # A result object deserialized from the server's reply - def delete_secret request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_delete_secret_request request_pb - query_string_params = if query_string_params.any? - query_string_params.to_h { |p| p.split "=", 2 } - else - {} - end - - response = @client_stub.make_http_request( - verb, - uri: uri, - body: body || "", - params: query_string_params, - method_name: "delete_secret", - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Protobuf::Empty.decode_json response.body, ignore_unknown_fields: true - catch :response do - yield result, operation if block_given? - result - end - end - - ## - # Baseline implementation for the list_secret_versions REST call - # - # @param request_pb [::Google::Cloud::SecretManager::V1::ListSecretVersionsRequest] - # A request object representing the call parameters. Required. - # @param options [::Gapic::CallOptions] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Cloud::SecretManager::V1::ListSecretVersionsResponse] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::SecretManager::V1::ListSecretVersionsResponse] - # A result object deserialized from the server's reply - def list_secret_versions request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_list_secret_versions_request request_pb - query_string_params = if query_string_params.any? - query_string_params.to_h { |p| p.split "=", 2 } - else - {} - end - - response = @client_stub.make_http_request( - verb, - uri: uri, - body: body || "", - params: query_string_params, - method_name: "list_secret_versions", - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Cloud::SecretManager::V1::ListSecretVersionsResponse.decode_json response.body, ignore_unknown_fields: true - catch :response do - yield result, operation if block_given? - result - end - end - - ## - # Baseline implementation for the get_secret_version REST call - # - # @param request_pb [::Google::Cloud::SecretManager::V1::GetSecretVersionRequest] - # A request object representing the call parameters. Required. - # @param options [::Gapic::CallOptions] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Cloud::SecretManager::V1::SecretVersion] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::SecretManager::V1::SecretVersion] - # A result object deserialized from the server's reply - def get_secret_version request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_get_secret_version_request request_pb - query_string_params = if query_string_params.any? - query_string_params.to_h { |p| p.split "=", 2 } - else - {} - end - - response = @client_stub.make_http_request( - verb, - uri: uri, - body: body || "", - params: query_string_params, - method_name: "get_secret_version", - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Cloud::SecretManager::V1::SecretVersion.decode_json response.body, ignore_unknown_fields: true - catch :response do - yield result, operation if block_given? - result - end - end - - ## - # Baseline implementation for the access_secret_version REST call - # - # @param request_pb [::Google::Cloud::SecretManager::V1::AccessSecretVersionRequest] - # A request object representing the call parameters. Required. - # @param options [::Gapic::CallOptions] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Cloud::SecretManager::V1::AccessSecretVersionResponse] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::SecretManager::V1::AccessSecretVersionResponse] - # A result object deserialized from the server's reply - def access_secret_version request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_access_secret_version_request request_pb - query_string_params = if query_string_params.any? - query_string_params.to_h { |p| p.split "=", 2 } - else - {} - end - - response = @client_stub.make_http_request( - verb, - uri: uri, - body: body || "", - params: query_string_params, - method_name: "access_secret_version", - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Cloud::SecretManager::V1::AccessSecretVersionResponse.decode_json response.body, ignore_unknown_fields: true - catch :response do - yield result, operation if block_given? - result - end - end - - ## - # Baseline implementation for the disable_secret_version REST call - # - # @param request_pb [::Google::Cloud::SecretManager::V1::DisableSecretVersionRequest] - # A request object representing the call parameters. Required. - # @param options [::Gapic::CallOptions] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Cloud::SecretManager::V1::SecretVersion] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::SecretManager::V1::SecretVersion] - # A result object deserialized from the server's reply - def disable_secret_version request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_disable_secret_version_request request_pb - query_string_params = if query_string_params.any? - query_string_params.to_h { |p| p.split "=", 2 } - else - {} - end - - response = @client_stub.make_http_request( - verb, - uri: uri, - body: body || "", - params: query_string_params, - method_name: "disable_secret_version", - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Cloud::SecretManager::V1::SecretVersion.decode_json response.body, ignore_unknown_fields: true - catch :response do - yield result, operation if block_given? - result - end - end - - ## - # Baseline implementation for the enable_secret_version REST call - # - # @param request_pb [::Google::Cloud::SecretManager::V1::EnableSecretVersionRequest] - # A request object representing the call parameters. Required. - # @param options [::Gapic::CallOptions] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Cloud::SecretManager::V1::SecretVersion] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::SecretManager::V1::SecretVersion] - # A result object deserialized from the server's reply - def enable_secret_version request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_enable_secret_version_request request_pb - query_string_params = if query_string_params.any? - query_string_params.to_h { |p| p.split "=", 2 } - else - {} - end - - response = @client_stub.make_http_request( - verb, - uri: uri, - body: body || "", - params: query_string_params, - method_name: "enable_secret_version", - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Cloud::SecretManager::V1::SecretVersion.decode_json response.body, ignore_unknown_fields: true - catch :response do - yield result, operation if block_given? - result - end - end - - ## - # Baseline implementation for the destroy_secret_version REST call - # - # @param request_pb [::Google::Cloud::SecretManager::V1::DestroySecretVersionRequest] - # A request object representing the call parameters. Required. - # @param options [::Gapic::CallOptions] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Cloud::SecretManager::V1::SecretVersion] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::SecretManager::V1::SecretVersion] - # A result object deserialized from the server's reply - def destroy_secret_version request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_destroy_secret_version_request request_pb - query_string_params = if query_string_params.any? - query_string_params.to_h { |p| p.split "=", 2 } - else - {} - end - - response = @client_stub.make_http_request( - verb, - uri: uri, - body: body || "", - params: query_string_params, - method_name: "destroy_secret_version", - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Cloud::SecretManager::V1::SecretVersion.decode_json response.body, ignore_unknown_fields: true - catch :response do - yield result, operation if block_given? - result - end - end - - ## - # Baseline implementation for the set_iam_policy REST call - # - # @param request_pb [::Google::Iam::V1::SetIamPolicyRequest] - # A request object representing the call parameters. Required. - # @param options [::Gapic::CallOptions] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Iam::V1::Policy] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Iam::V1::Policy] - # A result object deserialized from the server's reply - def set_iam_policy request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_set_iam_policy_request request_pb - query_string_params = if query_string_params.any? - query_string_params.to_h { |p| p.split "=", 2 } - else - {} - end - - response = @client_stub.make_http_request( - verb, - uri: uri, - body: body || "", - params: query_string_params, - method_name: "set_iam_policy", - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Iam::V1::Policy.decode_json response.body, ignore_unknown_fields: true - catch :response do - yield result, operation if block_given? - result - end - end - - ## - # Baseline implementation for the get_iam_policy REST call - # - # @param request_pb [::Google::Iam::V1::GetIamPolicyRequest] - # A request object representing the call parameters. Required. - # @param options [::Gapic::CallOptions] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Iam::V1::Policy] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Iam::V1::Policy] - # A result object deserialized from the server's reply - def get_iam_policy request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_get_iam_policy_request request_pb - query_string_params = if query_string_params.any? - query_string_params.to_h { |p| p.split "=", 2 } - else - {} - end - - response = @client_stub.make_http_request( - verb, - uri: uri, - body: body || "", - params: query_string_params, - method_name: "get_iam_policy", - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Iam::V1::Policy.decode_json response.body, ignore_unknown_fields: true - catch :response do - yield result, operation if block_given? - result - end - end - - ## - # Baseline implementation for the test_iam_permissions REST call - # - # @param request_pb [::Google::Iam::V1::TestIamPermissionsRequest] - # A request object representing the call parameters. Required. - # @param options [::Gapic::CallOptions] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Iam::V1::TestIamPermissionsResponse] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Iam::V1::TestIamPermissionsResponse] - # A result object deserialized from the server's reply - def test_iam_permissions request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_test_iam_permissions_request request_pb - query_string_params = if query_string_params.any? - query_string_params.to_h { |p| p.split "=", 2 } - else - {} - end - - response = @client_stub.make_http_request( - verb, - uri: uri, - body: body || "", - params: query_string_params, - method_name: "test_iam_permissions", - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Iam::V1::TestIamPermissionsResponse.decode_json response.body, ignore_unknown_fields: true - catch :response do - yield result, operation if block_given? - result - end - end - - ## - # @private - # - # GRPC transcoding helper method for the list_secrets REST call - # - # @param request_pb [::Google::Cloud::SecretManager::V1::ListSecretsRequest] - # A request object representing the call parameters. Required. - # @return [Array(String, [String, nil], Hash{String => String})] - # Uri, Body, Query string parameters - def self.transcode_list_secrets_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :get, - uri_template: "/v1/{parent}/secrets", - matches: [ - ["parent", %r{^projects/[^/]+/?$}, false] - ] - ) - .with_bindings( - uri_method: :get, - uri_template: "/v1/{parent}/secrets", - matches: [ - ["parent", %r{^projects/[^/]+/locations/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the create_secret REST call - # - # @param request_pb [::Google::Cloud::SecretManager::V1::CreateSecretRequest] - # A request object representing the call parameters. Required. - # @return [Array(String, [String, nil], Hash{String => String})] - # Uri, Body, Query string parameters - def self.transcode_create_secret_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :post, - uri_template: "/v1/{parent}/secrets", - body: "secret", - matches: [ - ["parent", %r{^projects/[^/]+/?$}, false] - ] - ) - .with_bindings( - uri_method: :post, - uri_template: "/v1/{parent}/secrets", - body: "secret", - matches: [ - ["parent", %r{^projects/[^/]+/locations/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the add_secret_version REST call - # - # @param request_pb [::Google::Cloud::SecretManager::V1::AddSecretVersionRequest] - # A request object representing the call parameters. Required. - # @return [Array(String, [String, nil], Hash{String => String})] - # Uri, Body, Query string parameters - def self.transcode_add_secret_version_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :post, - uri_template: "/v1/{parent}:addVersion", - body: "*", - matches: [ - ["parent", %r{^projects/[^/]+/secrets/[^/]+/?$}, false] - ] - ) - .with_bindings( - uri_method: :post, - uri_template: "/v1/{parent}:addVersion", - body: "*", - matches: [ - ["parent", %r{^projects/[^/]+/locations/[^/]+/secrets/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the get_secret REST call - # - # @param request_pb [::Google::Cloud::SecretManager::V1::GetSecretRequest] - # A request object representing the call parameters. Required. - # @return [Array(String, [String, nil], Hash{String => String})] - # Uri, Body, Query string parameters - def self.transcode_get_secret_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :get, - uri_template: "/v1/{name}", - matches: [ - ["name", %r{^projects/[^/]+/secrets/[^/]+/?$}, false] - ] - ) - .with_bindings( - uri_method: :get, - uri_template: "/v1/{name}", - matches: [ - ["name", %r{^projects/[^/]+/locations/[^/]+/secrets/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the update_secret REST call - # - # @param request_pb [::Google::Cloud::SecretManager::V1::UpdateSecretRequest] - # A request object representing the call parameters. Required. - # @return [Array(String, [String, nil], Hash{String => String})] - # Uri, Body, Query string parameters - def self.transcode_update_secret_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :patch, - uri_template: "/v1/{secret.name}", - body: "secret", - matches: [ - ["secret.name", %r{^projects/[^/]+/secrets/[^/]+/?$}, false] - ] - ) - .with_bindings( - uri_method: :patch, - uri_template: "/v1/{secret.name}", - body: "secret", - matches: [ - ["secret.name", %r{^projects/[^/]+/locations/[^/]+/secrets/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the delete_secret REST call - # - # @param request_pb [::Google::Cloud::SecretManager::V1::DeleteSecretRequest] - # A request object representing the call parameters. Required. - # @return [Array(String, [String, nil], Hash{String => String})] - # Uri, Body, Query string parameters - def self.transcode_delete_secret_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :delete, - uri_template: "/v1/{name}", - matches: [ - ["name", %r{^projects/[^/]+/secrets/[^/]+/?$}, false] - ] - ) - .with_bindings( - uri_method: :delete, - uri_template: "/v1/{name}", - matches: [ - ["name", %r{^projects/[^/]+/locations/[^/]+/secrets/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the list_secret_versions REST call - # - # @param request_pb [::Google::Cloud::SecretManager::V1::ListSecretVersionsRequest] - # A request object representing the call parameters. Required. - # @return [Array(String, [String, nil], Hash{String => String})] - # Uri, Body, Query string parameters - def self.transcode_list_secret_versions_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :get, - uri_template: "/v1/{parent}/versions", - matches: [ - ["parent", %r{^projects/[^/]+/secrets/[^/]+/?$}, false] - ] - ) - .with_bindings( - uri_method: :get, - uri_template: "/v1/{parent}/versions", - matches: [ - ["parent", %r{^projects/[^/]+/locations/[^/]+/secrets/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the get_secret_version REST call - # - # @param request_pb [::Google::Cloud::SecretManager::V1::GetSecretVersionRequest] - # A request object representing the call parameters. Required. - # @return [Array(String, [String, nil], Hash{String => String})] - # Uri, Body, Query string parameters - def self.transcode_get_secret_version_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :get, - uri_template: "/v1/{name}", - matches: [ - ["name", %r{^projects/[^/]+/secrets/[^/]+/versions/[^/]+/?$}, false] - ] - ) - .with_bindings( - uri_method: :get, - uri_template: "/v1/{name}", - matches: [ - ["name", %r{^projects/[^/]+/locations/[^/]+/secrets/[^/]+/versions/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the access_secret_version REST call - # - # @param request_pb [::Google::Cloud::SecretManager::V1::AccessSecretVersionRequest] - # A request object representing the call parameters. Required. - # @return [Array(String, [String, nil], Hash{String => String})] - # Uri, Body, Query string parameters - def self.transcode_access_secret_version_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :get, - uri_template: "/v1/{name}:access", - matches: [ - ["name", %r{^projects/[^/]+/secrets/[^/]+/versions/[^/]+/?$}, false] - ] - ) - .with_bindings( - uri_method: :get, - uri_template: "/v1/{name}:access", - matches: [ - ["name", %r{^projects/[^/]+/locations/[^/]+/secrets/[^/]+/versions/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the disable_secret_version REST call - # - # @param request_pb [::Google::Cloud::SecretManager::V1::DisableSecretVersionRequest] - # A request object representing the call parameters. Required. - # @return [Array(String, [String, nil], Hash{String => String})] - # Uri, Body, Query string parameters - def self.transcode_disable_secret_version_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :post, - uri_template: "/v1/{name}:disable", - body: "*", - matches: [ - ["name", %r{^projects/[^/]+/secrets/[^/]+/versions/[^/]+/?$}, false] - ] - ) - .with_bindings( - uri_method: :post, - uri_template: "/v1/{name}:disable", - body: "*", - matches: [ - ["name", %r{^projects/[^/]+/locations/[^/]+/secrets/[^/]+/versions/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the enable_secret_version REST call - # - # @param request_pb [::Google::Cloud::SecretManager::V1::EnableSecretVersionRequest] - # A request object representing the call parameters. Required. - # @return [Array(String, [String, nil], Hash{String => String})] - # Uri, Body, Query string parameters - def self.transcode_enable_secret_version_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :post, - uri_template: "/v1/{name}:enable", - body: "*", - matches: [ - ["name", %r{^projects/[^/]+/secrets/[^/]+/versions/[^/]+/?$}, false] - ] - ) - .with_bindings( - uri_method: :post, - uri_template: "/v1/{name}:enable", - body: "*", - matches: [ - ["name", %r{^projects/[^/]+/locations/[^/]+/secrets/[^/]+/versions/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the destroy_secret_version REST call - # - # @param request_pb [::Google::Cloud::SecretManager::V1::DestroySecretVersionRequest] - # A request object representing the call parameters. Required. - # @return [Array(String, [String, nil], Hash{String => String})] - # Uri, Body, Query string parameters - def self.transcode_destroy_secret_version_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :post, - uri_template: "/v1/{name}:destroy", - body: "*", - matches: [ - ["name", %r{^projects/[^/]+/secrets/[^/]+/versions/[^/]+/?$}, false] - ] - ) - .with_bindings( - uri_method: :post, - uri_template: "/v1/{name}:destroy", - body: "*", - matches: [ - ["name", %r{^projects/[^/]+/locations/[^/]+/secrets/[^/]+/versions/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the set_iam_policy REST call - # - # @param request_pb [::Google::Iam::V1::SetIamPolicyRequest] - # A request object representing the call parameters. Required. - # @return [Array(String, [String, nil], Hash{String => String})] - # Uri, Body, Query string parameters - def self.transcode_set_iam_policy_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :post, - uri_template: "/v1/{resource}:setIamPolicy", - body: "*", - matches: [ - ["resource", %r{^projects/[^/]+/secrets/[^/]+/?$}, false] - ] - ) - .with_bindings( - uri_method: :post, - uri_template: "/v1/{resource}:setIamPolicy", - body: "*", - matches: [ - ["resource", %r{^projects/[^/]+/locations/[^/]+/secrets/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the get_iam_policy REST call - # - # @param request_pb [::Google::Iam::V1::GetIamPolicyRequest] - # A request object representing the call parameters. Required. - # @return [Array(String, [String, nil], Hash{String => String})] - # Uri, Body, Query string parameters - def self.transcode_get_iam_policy_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :get, - uri_template: "/v1/{resource}:getIamPolicy", - matches: [ - ["resource", %r{^projects/[^/]+/secrets/[^/]+/?$}, false] - ] - ) - .with_bindings( - uri_method: :get, - uri_template: "/v1/{resource}:getIamPolicy", - matches: [ - ["resource", %r{^projects/[^/]+/locations/[^/]+/secrets/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the test_iam_permissions REST call - # - # @param request_pb [::Google::Iam::V1::TestIamPermissionsRequest] - # A request object representing the call parameters. Required. - # @return [Array(String, [String, nil], Hash{String => String})] - # Uri, Body, Query string parameters - def self.transcode_test_iam_permissions_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :post, - uri_template: "/v1/{resource}:testIamPermissions", - body: "*", - matches: [ - ["resource", %r{^projects/[^/]+/secrets/[^/]+/?$}, false] - ] - ) - .with_bindings( - uri_method: :post, - uri_template: "/v1/{resource}:testIamPermissions", - body: "*", - matches: [ - ["resource", %r{^projects/[^/]+/locations/[^/]+/secrets/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - end - end - end - end - end - end -end diff --git a/owl-bot-staging/google-cloud-secret_manager-v1/lib/google/cloud/secret_manager/v1/version.rb b/owl-bot-staging/google-cloud-secret_manager-v1/lib/google/cloud/secret_manager/v1/version.rb deleted file mode 100644 index 3ac096ce123c..000000000000 --- a/owl-bot-staging/google-cloud-secret_manager-v1/lib/google/cloud/secret_manager/v1/version.rb +++ /dev/null @@ -1,28 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - - -module Google - module Cloud - module SecretManager - module V1 - VERSION = "0.0.1" - end - end - end -end diff --git a/owl-bot-staging/google-cloud-secret_manager-v1/lib/google/cloud/secretmanager/v1/resources_pb.rb b/owl-bot-staging/google-cloud-secret_manager-v1/lib/google/cloud/secretmanager/v1/resources_pb.rb deleted file mode 100644 index 6864a9474c87..000000000000 --- a/owl-bot-staging/google-cloud-secret_manager-v1/lib/google/cloud/secretmanager/v1/resources_pb.rb +++ /dev/null @@ -1,41 +0,0 @@ -# frozen_string_literal: true -# Generated by the protocol buffer compiler. DO NOT EDIT! -# source: google/cloud/secretmanager/v1/resources.proto - -require 'google/protobuf' - -require 'google/api/field_behavior_pb' -require 'google/api/resource_pb' -require 'google/protobuf/duration_pb' -require 'google/protobuf/timestamp_pb' - - -descriptor_data = "\n-google/cloud/secretmanager/v1/resources.proto\x12\x1dgoogle.cloud.secretmanager.v1\x1a\x1fgoogle/api/field_behavior.proto\x1a\x19google/api/resource.proto\x1a\x1egoogle/protobuf/duration.proto\x1a\x1fgoogle/protobuf/timestamp.proto\"\xd9\t\n\x06Secret\x12\x11\n\x04name\x18\x01 \x01(\tB\x03\xe0\x41\x03\x12G\n\x0breplication\x18\x02 \x01(\x0b\x32*.google.cloud.secretmanager.v1.ReplicationB\x06\xe0\x41\x05\xe0\x41\x01\x12\x34\n\x0b\x63reate_time\x18\x03 \x01(\x0b\x32\x1a.google.protobuf.TimestampB\x03\xe0\x41\x03\x12\x41\n\x06labels\x18\x04 \x03(\x0b\x32\x31.google.cloud.secretmanager.v1.Secret.LabelsEntry\x12\x39\n\x06topics\x18\x05 \x03(\x0b\x32$.google.cloud.secretmanager.v1.TopicB\x03\xe0\x41\x01\x12\x36\n\x0b\x65xpire_time\x18\x06 \x01(\x0b\x32\x1a.google.protobuf.TimestampB\x03\xe0\x41\x01H\x00\x12-\n\x03ttl\x18\x07 \x01(\x0b\x32\x19.google.protobuf.DurationB\x03\xe0\x41\x04H\x00\x12\x11\n\x04\x65tag\x18\x08 \x01(\tB\x03\xe0\x41\x01\x12>\n\x08rotation\x18\t \x01(\x0b\x32\'.google.cloud.secretmanager.v1.RotationB\x03\xe0\x41\x01\x12W\n\x0fversion_aliases\x18\x0b \x03(\x0b\x32\x39.google.cloud.secretmanager.v1.Secret.VersionAliasesEntryB\x03\xe0\x41\x01\x12P\n\x0b\x61nnotations\x18\r \x03(\x0b\x32\x36.google.cloud.secretmanager.v1.Secret.AnnotationsEntryB\x03\xe0\x41\x01\x12;\n\x13version_destroy_ttl\x18\x0e \x01(\x0b\x32\x19.google.protobuf.DurationB\x03\xe0\x41\x01\x12\x62\n\x1b\x63ustomer_managed_encryption\x18\x0f \x01(\x0b\x32\x38.google.cloud.secretmanager.v1.CustomerManagedEncryptionB\x03\xe0\x41\x01\x12H\n\x04tags\x18\x10 \x03(\x0b\x32/.google.cloud.secretmanager.v1.Secret.TagsEntryB\t\xe0\x41\x04\xe0\x41\x05\xe0\x41\x01\x1a-\n\x0bLabelsEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12\r\n\x05value\x18\x02 \x01(\t:\x02\x38\x01\x1a\x35\n\x13VersionAliasesEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12\r\n\x05value\x18\x02 \x01(\x03:\x02\x38\x01\x1a\x32\n\x10\x41nnotationsEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12\r\n\x05value\x18\x02 \x01(\t:\x02\x38\x01\x1a+\n\tTagsEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12\r\n\x05value\x18\x02 \x01(\t:\x02\x38\x01:\x99\x01\xea\x41\x95\x01\n#secretmanager.googleapis.com/Secret\x12#projects/{project}/secrets/{secret}\x12\x38projects/{project}/locations/{location}/secrets/{secret}*\x07secrets2\x06secretB\x0c\n\nexpiration\"\xc2\x06\n\rSecretVersion\x12\x11\n\x04name\x18\x01 \x01(\tB\x03\xe0\x41\x03\x12\x34\n\x0b\x63reate_time\x18\x02 \x01(\x0b\x32\x1a.google.protobuf.TimestampB\x03\xe0\x41\x03\x12\x35\n\x0c\x64\x65stroy_time\x18\x03 \x01(\x0b\x32\x1a.google.protobuf.TimestampB\x03\xe0\x41\x03\x12\x46\n\x05state\x18\x04 \x01(\x0e\x32\x32.google.cloud.secretmanager.v1.SecretVersion.StateB\x03\xe0\x41\x03\x12L\n\x12replication_status\x18\x05 \x01(\x0b\x32\x30.google.cloud.secretmanager.v1.ReplicationStatus\x12\x11\n\x04\x65tag\x18\x06 \x01(\tB\x03\xe0\x41\x03\x12.\n!client_specified_payload_checksum\x18\x07 \x01(\x08\x42\x03\xe0\x41\x03\x12?\n\x16scheduled_destroy_time\x18\x08 \x01(\x0b\x32\x1a.google.protobuf.TimestampB\x03\xe0\x41\x03\x12h\n\x1b\x63ustomer_managed_encryption\x18\t \x01(\x0b\x32>.google.cloud.secretmanager.v1.CustomerManagedEncryptionStatusB\x03\xe0\x41\x03\"H\n\x05State\x12\x15\n\x11STATE_UNSPECIFIED\x10\x00\x12\x0b\n\x07\x45NABLED\x10\x01\x12\x0c\n\x08\x44ISABLED\x10\x02\x12\r\n\tDESTROYED\x10\x03:\xe2\x01\xea\x41\xde\x01\n*secretmanager.googleapis.com/SecretVersion\x12=projects/{project}/secrets/{secret}/versions/{secret_version}\x12Rprojects/{project}/locations/{location}/secrets/{secret}/versions/{secret_version}*\x0esecretVersions2\rsecretVersion\"\x90\x04\n\x0bReplication\x12I\n\tautomatic\x18\x01 \x01(\x0b\x32\x34.google.cloud.secretmanager.v1.Replication.AutomaticH\x00\x12N\n\x0cuser_managed\x18\x02 \x01(\x0b\x32\x36.google.cloud.secretmanager.v1.Replication.UserManagedH\x00\x1ao\n\tAutomatic\x12\x62\n\x1b\x63ustomer_managed_encryption\x18\x01 \x01(\x0b\x32\x38.google.cloud.secretmanager.v1.CustomerManagedEncryptionB\x03\xe0\x41\x01\x1a\xe5\x01\n\x0bUserManaged\x12U\n\x08replicas\x18\x01 \x03(\x0b\x32>.google.cloud.secretmanager.v1.Replication.UserManaged.ReplicaB\x03\xe0\x41\x02\x1a\x7f\n\x07Replica\x12\x10\n\x08location\x18\x01 \x01(\t\x12\x62\n\x1b\x63ustomer_managed_encryption\x18\x02 \x01(\x0b\x32\x38.google.cloud.secretmanager.v1.CustomerManagedEncryptionB\x03\xe0\x41\x01\x42\r\n\x0breplication\"6\n\x19\x43ustomerManagedEncryption\x12\x19\n\x0ckms_key_name\x18\x01 \x01(\tB\x03\xe0\x41\x02\"\xeb\x04\n\x11ReplicationStatus\x12U\n\tautomatic\x18\x01 \x01(\x0b\x32@.google.cloud.secretmanager.v1.ReplicationStatus.AutomaticStatusH\x00\x12Z\n\x0cuser_managed\x18\x02 \x01(\x0b\x32\x42.google.cloud.secretmanager.v1.ReplicationStatus.UserManagedStatusH\x00\x1a{\n\x0f\x41utomaticStatus\x12h\n\x1b\x63ustomer_managed_encryption\x18\x01 \x01(\x0b\x32>.google.cloud.secretmanager.v1.CustomerManagedEncryptionStatusB\x03\xe0\x41\x03\x1a\x8f\x02\n\x11UserManagedStatus\x12g\n\x08replicas\x18\x01 \x03(\x0b\x32P.google.cloud.secretmanager.v1.ReplicationStatus.UserManagedStatus.ReplicaStatusB\x03\xe0\x41\x03\x1a\x90\x01\n\rReplicaStatus\x12\x15\n\x08location\x18\x01 \x01(\tB\x03\xe0\x41\x03\x12h\n\x1b\x63ustomer_managed_encryption\x18\x02 \x01(\x0b\x32>.google.cloud.secretmanager.v1.CustomerManagedEncryptionStatusB\x03\xe0\x41\x03\x42\x14\n\x12replication_status\"D\n\x1f\x43ustomerManagedEncryptionStatus\x12!\n\x14kms_key_version_name\x18\x01 \x01(\tB\x03\xe0\x41\x02\"_\n\x05Topic\x12\x11\n\x04name\x18\x01 \x01(\tB\x03\xe0\x41\x08:C\xea\x41@\n\x1bpubsub.googleapis.com/Topic\x12!projects/{project}/topics/{topic}\"\x80\x01\n\x08Rotation\x12;\n\x12next_rotation_time\x18\x01 \x01(\x0b\x32\x1a.google.protobuf.TimestampB\x03\xe0\x41\x01\x12\x37\n\x0frotation_period\x18\x02 \x01(\x0b\x32\x19.google.protobuf.DurationB\x03\xe0\x41\x04\"L\n\rSecretPayload\x12\x0c\n\x04\x64\x61ta\x18\x01 \x01(\x0c\x12\x1d\n\x0b\x64\x61ta_crc32c\x18\x02 \x01(\x03\x42\x03\xe0\x41\x01H\x00\x88\x01\x01\x42\x0e\n\x0c_data_crc32cB\xe7\x01\n!com.google.cloud.secretmanager.v1B\x0eResourcesProtoP\x01ZGcloud.google.com/go/secretmanager/apiv1/secretmanagerpb;secretmanagerpb\xa2\x02\x03GSM\xaa\x02\x1dGoogle.Cloud.SecretManager.V1\xca\x02\x1dGoogle\\Cloud\\SecretManager\\V1\xea\x02 Google::Cloud::SecretManager::V1b\x06proto3" - -pool = ::Google::Protobuf::DescriptorPool.generated_pool -pool.add_serialized_file(descriptor_data) - -module Google - module Cloud - module SecretManager - module V1 - Secret = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.secretmanager.v1.Secret").msgclass - SecretVersion = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.secretmanager.v1.SecretVersion").msgclass - SecretVersion::State = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.secretmanager.v1.SecretVersion.State").enummodule - Replication = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.secretmanager.v1.Replication").msgclass - Replication::Automatic = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.secretmanager.v1.Replication.Automatic").msgclass - Replication::UserManaged = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.secretmanager.v1.Replication.UserManaged").msgclass - Replication::UserManaged::Replica = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.secretmanager.v1.Replication.UserManaged.Replica").msgclass - CustomerManagedEncryption = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.secretmanager.v1.CustomerManagedEncryption").msgclass - ReplicationStatus = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.secretmanager.v1.ReplicationStatus").msgclass - ReplicationStatus::AutomaticStatus = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.secretmanager.v1.ReplicationStatus.AutomaticStatus").msgclass - ReplicationStatus::UserManagedStatus = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.secretmanager.v1.ReplicationStatus.UserManagedStatus").msgclass - ReplicationStatus::UserManagedStatus::ReplicaStatus = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.secretmanager.v1.ReplicationStatus.UserManagedStatus.ReplicaStatus").msgclass - CustomerManagedEncryptionStatus = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.secretmanager.v1.CustomerManagedEncryptionStatus").msgclass - Topic = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.secretmanager.v1.Topic").msgclass - Rotation = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.secretmanager.v1.Rotation").msgclass - SecretPayload = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.secretmanager.v1.SecretPayload").msgclass - end - end - end -end diff --git a/owl-bot-staging/google-cloud-secret_manager-v1/lib/google/cloud/secretmanager/v1/service_pb.rb b/owl-bot-staging/google-cloud-secret_manager-v1/lib/google/cloud/secretmanager/v1/service_pb.rb deleted file mode 100644 index 347d6e922756..000000000000 --- a/owl-bot-staging/google-cloud-secret_manager-v1/lib/google/cloud/secretmanager/v1/service_pb.rb +++ /dev/null @@ -1,45 +0,0 @@ -# frozen_string_literal: true -# Generated by the protocol buffer compiler. DO NOT EDIT! -# source: google/cloud/secretmanager/v1/service.proto - -require 'google/protobuf' - -require 'google/api/annotations_pb' -require 'google/api/client_pb' -require 'google/api/field_behavior_pb' -require 'google/api/resource_pb' -require 'google/cloud/secretmanager/v1/resources_pb' -require 'google/iam/v1/iam_policy_pb' -require 'google/iam/v1/policy_pb' -require 'google/protobuf/empty_pb' -require 'google/protobuf/field_mask_pb' - - -descriptor_data = "\n+google/cloud/secretmanager/v1/service.proto\x12\x1dgoogle.cloud.secretmanager.v1\x1a\x1cgoogle/api/annotations.proto\x1a\x17google/api/client.proto\x1a\x1fgoogle/api/field_behavior.proto\x1a\x19google/api/resource.proto\x1a-google/cloud/secretmanager/v1/resources.proto\x1a\x1egoogle/iam/v1/iam_policy.proto\x1a\x1agoogle/iam/v1/policy.proto\x1a\x1bgoogle/protobuf/empty.proto\x1a google/protobuf/field_mask.proto\"\x97\x01\n\x12ListSecretsRequest\x12;\n\x06parent\x18\x01 \x01(\tB+\xe0\x41\x02\xfa\x41%\x12#secretmanager.googleapis.com/Secret\x12\x16\n\tpage_size\x18\x02 \x01(\x05\x42\x03\xe0\x41\x01\x12\x17\n\npage_token\x18\x03 \x01(\tB\x03\xe0\x41\x01\x12\x13\n\x06\x66ilter\x18\x04 \x01(\tB\x03\xe0\x41\x01\"z\n\x13ListSecretsResponse\x12\x36\n\x07secrets\x18\x01 \x03(\x0b\x32%.google.cloud.secretmanager.v1.Secret\x12\x17\n\x0fnext_page_token\x18\x02 \x01(\t\x12\x12\n\ntotal_size\x18\x03 \x01(\x05\"\xa6\x01\n\x13\x43reateSecretRequest\x12;\n\x06parent\x18\x01 \x01(\tB+\xe0\x41\x02\xfa\x41%\x12#secretmanager.googleapis.com/Secret\x12\x16\n\tsecret_id\x18\x02 \x01(\tB\x03\xe0\x41\x02\x12:\n\x06secret\x18\x03 \x01(\x0b\x32%.google.cloud.secretmanager.v1.SecretB\x03\xe0\x41\x02\"\x9a\x01\n\x17\x41\x64\x64SecretVersionRequest\x12;\n\x06parent\x18\x01 \x01(\tB+\xe0\x41\x02\xfa\x41%\n#secretmanager.googleapis.com/Secret\x12\x42\n\x07payload\x18\x02 \x01(\x0b\x32,.google.cloud.secretmanager.v1.SecretPayloadB\x03\xe0\x41\x02\"M\n\x10GetSecretRequest\x12\x39\n\x04name\x18\x01 \x01(\tB+\xe0\x41\x02\xfa\x41%\n#secretmanager.googleapis.com/Secret\"\x9e\x01\n\x19ListSecretVersionsRequest\x12;\n\x06parent\x18\x01 \x01(\tB+\xe0\x41\x02\xfa\x41%\n#secretmanager.googleapis.com/Secret\x12\x16\n\tpage_size\x18\x02 \x01(\x05\x42\x03\xe0\x41\x01\x12\x17\n\npage_token\x18\x03 \x01(\tB\x03\xe0\x41\x01\x12\x13\n\x06\x66ilter\x18\x04 \x01(\tB\x03\xe0\x41\x01\"\x89\x01\n\x1aListSecretVersionsResponse\x12>\n\x08versions\x18\x01 \x03(\x0b\x32,.google.cloud.secretmanager.v1.SecretVersion\x12\x17\n\x0fnext_page_token\x18\x02 \x01(\t\x12\x12\n\ntotal_size\x18\x03 \x01(\x05\"[\n\x17GetSecretVersionRequest\x12@\n\x04name\x18\x01 \x01(\tB2\xe0\x41\x02\xfa\x41,\n*secretmanager.googleapis.com/SecretVersion\"\x87\x01\n\x13UpdateSecretRequest\x12:\n\x06secret\x18\x01 \x01(\x0b\x32%.google.cloud.secretmanager.v1.SecretB\x03\xe0\x41\x02\x12\x34\n\x0bupdate_mask\x18\x02 \x01(\x0b\x32\x1a.google.protobuf.FieldMaskB\x03\xe0\x41\x02\"^\n\x1a\x41\x63\x63\x65ssSecretVersionRequest\x12@\n\x04name\x18\x01 \x01(\tB2\xe0\x41\x02\xfa\x41,\n*secretmanager.googleapis.com/SecretVersion\"\x9b\x01\n\x1b\x41\x63\x63\x65ssSecretVersionResponse\x12=\n\x04name\x18\x01 \x01(\tB/\xfa\x41,\n*secretmanager.googleapis.com/SecretVersion\x12=\n\x07payload\x18\x02 \x01(\x0b\x32,.google.cloud.secretmanager.v1.SecretPayload\"c\n\x13\x44\x65leteSecretRequest\x12\x39\n\x04name\x18\x01 \x01(\tB+\xe0\x41\x02\xfa\x41%\n#secretmanager.googleapis.com/Secret\x12\x11\n\x04\x65tag\x18\x02 \x01(\tB\x03\xe0\x41\x01\"r\n\x1b\x44isableSecretVersionRequest\x12@\n\x04name\x18\x01 \x01(\tB2\xe0\x41\x02\xfa\x41,\n*secretmanager.googleapis.com/SecretVersion\x12\x11\n\x04\x65tag\x18\x02 \x01(\tB\x03\xe0\x41\x01\"q\n\x1a\x45nableSecretVersionRequest\x12@\n\x04name\x18\x01 \x01(\tB2\xe0\x41\x02\xfa\x41,\n*secretmanager.googleapis.com/SecretVersion\x12\x11\n\x04\x65tag\x18\x02 \x01(\tB\x03\xe0\x41\x01\"r\n\x1b\x44\x65stroySecretVersionRequest\x12@\n\x04name\x18\x01 \x01(\tB2\xe0\x41\x02\xfa\x41,\n*secretmanager.googleapis.com/SecretVersion\x12\x11\n\x04\x65tag\x18\x02 \x01(\tB\x03\xe0\x41\x01\x32\xe8\x1c\n\x14SecretManagerService\x12\xd5\x01\n\x0bListSecrets\x12\x31.google.cloud.secretmanager.v1.ListSecretsRequest\x1a\x32.google.cloud.secretmanager.v1.ListSecretsResponse\"_\xda\x41\x06parent\x82\xd3\xe4\x93\x02P\x12\x1f/v1/{parent=projects/*}/secretsZ-\x12+/v1/{parent=projects/*/locations/*}/secrets\x12\xec\x01\n\x0c\x43reateSecret\x12\x32.google.cloud.secretmanager.v1.CreateSecretRequest\x1a%.google.cloud.secretmanager.v1.Secret\"\x80\x01\xda\x41\x17parent,secret_id,secret\x82\xd3\xe4\x93\x02`\"\x1f/v1/{parent=projects/*}/secrets:\x06secretZ5\"+/v1/{parent=projects/*/locations/*}/secrets:\x06secret\x12\x82\x02\n\x10\x41\x64\x64SecretVersion\x12\x36.google.cloud.secretmanager.v1.AddSecretVersionRequest\x1a,.google.cloud.secretmanager.v1.SecretVersion\"\x87\x01\xda\x41\x0eparent,payload\x82\xd3\xe4\x93\x02p\",/v1/{parent=projects/*/secrets/*}:addVersion:\x01*Z=\"8/v1/{parent=projects/*/locations/*/secrets/*}:addVersion:\x01*\x12\xc2\x01\n\tGetSecret\x12/.google.cloud.secretmanager.v1.GetSecretRequest\x1a%.google.cloud.secretmanager.v1.Secret\"]\xda\x41\x04name\x82\xd3\xe4\x93\x02P\x12\x1f/v1/{name=projects/*/secrets/*}Z-\x12+/v1/{name=projects/*/locations/*/secrets/*}\x12\xf5\x01\n\x0cUpdateSecret\x12\x32.google.cloud.secretmanager.v1.UpdateSecretRequest\x1a%.google.cloud.secretmanager.v1.Secret\"\x89\x01\xda\x41\x12secret,update_mask\x82\xd3\xe4\x93\x02n2&/v1/{secret.name=projects/*/secrets/*}:\x06secretZ<22/v1/{secret.name=projects/*/locations/*/secrets/*}:\x06secret\x12\xb9\x01\n\x0c\x44\x65leteSecret\x12\x32.google.cloud.secretmanager.v1.DeleteSecretRequest\x1a\x16.google.protobuf.Empty\"]\xda\x41\x04name\x82\xd3\xe4\x93\x02P*\x1f/v1/{name=projects/*/secrets/*}Z-*+/v1/{name=projects/*/locations/*/secrets/*}\x12\x80\x02\n\x12ListSecretVersions\x12\x38.google.cloud.secretmanager.v1.ListSecretVersionsRequest\x1a\x39.google.cloud.secretmanager.v1.ListSecretVersionsResponse\"u\xda\x41\x06parent\x82\xd3\xe4\x93\x02\x66\x12*/v1/{parent=projects/*/secrets/*}/versionsZ8\x12\x36/v1/{parent=projects/*/locations/*/secrets/*}/versions\x12\xed\x01\n\x10GetSecretVersion\x12\x36.google.cloud.secretmanager.v1.GetSecretVersionRequest\x1a,.google.cloud.secretmanager.v1.SecretVersion\"s\xda\x41\x04name\x82\xd3\xe4\x93\x02\x66\x12*/v1/{name=projects/*/secrets/*/versions/*}Z8\x12\x36/v1/{name=projects/*/locations/*/secrets/*/versions/*}\x12\x90\x02\n\x13\x41\x63\x63\x65ssSecretVersion\x12\x39.google.cloud.secretmanager.v1.AccessSecretVersionRequest\x1a:.google.cloud.secretmanager.v1.AccessSecretVersionResponse\"\x81\x01\xda\x41\x04name\x82\xd3\xe4\x93\x02t\x12\x31/v1/{name=projects/*/secrets/*/versions/*}:accessZ?\x12=/v1/{name=projects/*/locations/*/secrets/*/versions/*}:access\x12\x8c\x02\n\x14\x44isableSecretVersion\x12:.google.cloud.secretmanager.v1.DisableSecretVersionRequest\x1a,.google.cloud.secretmanager.v1.SecretVersion\"\x89\x01\xda\x41\x04name\x82\xd3\xe4\x93\x02|\"2/v1/{name=projects/*/secrets/*/versions/*}:disable:\x01*ZC\">/v1/{name=projects/*/locations/*/secrets/*/versions/*}:disable:\x01*\x12\x88\x02\n\x13\x45nableSecretVersion\x12\x39.google.cloud.secretmanager.v1.EnableSecretVersionRequest\x1a,.google.cloud.secretmanager.v1.SecretVersion\"\x87\x01\xda\x41\x04name\x82\xd3\xe4\x93\x02z\"1/v1/{name=projects/*/secrets/*/versions/*}:enable:\x01*ZB\"=/v1/{name=projects/*/locations/*/secrets/*/versions/*}:enable:\x01*\x12\x8c\x02\n\x14\x44\x65stroySecretVersion\x12:.google.cloud.secretmanager.v1.DestroySecretVersionRequest\x1a,.google.cloud.secretmanager.v1.SecretVersion\"\x89\x01\xda\x41\x04name\x82\xd3\xe4\x93\x02|\"2/v1/{name=projects/*/secrets/*/versions/*}:destroy:\x01*ZC\">/v1/{name=projects/*/locations/*/secrets/*/versions/*}:destroy:\x01*\x12\xc9\x01\n\x0cSetIamPolicy\x12\".google.iam.v1.SetIamPolicyRequest\x1a\x15.google.iam.v1.Policy\"~\x82\xd3\xe4\x93\x02x\"0/v1/{resource=projects/*/secrets/*}:setIamPolicy:\x01*ZA\"\x12] - # The destination where API teams want this client library to be published. - # @!attribute [rw] selective_gapic_generation - # @return [::Google::Api::SelectiveGapicGeneration] - # Configuration for which RPCs should be generated in the GAPIC client. - class CommonLanguageSettings - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Details about how and where to publish client libraries. - # @!attribute [rw] version - # @return [::String] - # Version of the API to apply these settings to. This is the full protobuf - # package for the API, ending in the version element. - # Examples: "google.cloud.speech.v1" and "google.spanner.admin.database.v1". - # @!attribute [rw] launch_stage - # @return [::Google::Api::LaunchStage] - # Launch stage of this version of the API. - # @!attribute [rw] rest_numeric_enums - # @return [::Boolean] - # When using transport=rest, the client request will encode enums as - # numbers rather than strings. - # @!attribute [rw] java_settings - # @return [::Google::Api::JavaSettings] - # Settings for legacy Java features, supported in the Service YAML. - # @!attribute [rw] cpp_settings - # @return [::Google::Api::CppSettings] - # Settings for C++ client libraries. - # @!attribute [rw] php_settings - # @return [::Google::Api::PhpSettings] - # Settings for PHP client libraries. - # @!attribute [rw] python_settings - # @return [::Google::Api::PythonSettings] - # Settings for Python client libraries. - # @!attribute [rw] node_settings - # @return [::Google::Api::NodeSettings] - # Settings for Node client libraries. - # @!attribute [rw] dotnet_settings - # @return [::Google::Api::DotnetSettings] - # Settings for .NET client libraries. - # @!attribute [rw] ruby_settings - # @return [::Google::Api::RubySettings] - # Settings for Ruby client libraries. - # @!attribute [rw] go_settings - # @return [::Google::Api::GoSettings] - # Settings for Go client libraries. - class ClientLibrarySettings - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # This message configures the settings for publishing [Google Cloud Client - # libraries](https://cloud.google.com/apis/docs/cloud-client-libraries) - # generated from the service config. - # @!attribute [rw] method_settings - # @return [::Array<::Google::Api::MethodSettings>] - # A list of API method settings, e.g. the behavior for methods that use the - # long-running operation pattern. - # @!attribute [rw] new_issue_uri - # @return [::String] - # Link to a *public* URI where users can report issues. Example: - # https://issuetracker.google.com/issues/new?component=190865&template=1161103 - # @!attribute [rw] documentation_uri - # @return [::String] - # Link to product home page. Example: - # https://cloud.google.com/asset-inventory/docs/overview - # @!attribute [rw] api_short_name - # @return [::String] - # Used as a tracking tag when collecting data about the APIs developer - # relations artifacts like docs, packages delivered to package managers, - # etc. Example: "speech". - # @!attribute [rw] github_label - # @return [::String] - # GitHub label to apply to issues and pull requests opened for this API. - # @!attribute [rw] codeowner_github_teams - # @return [::Array<::String>] - # GitHub teams to be added to CODEOWNERS in the directory in GitHub - # containing source code for the client libraries for this API. - # @!attribute [rw] doc_tag_prefix - # @return [::String] - # A prefix used in sample code when demarking regions to be included in - # documentation. - # @!attribute [rw] organization - # @return [::Google::Api::ClientLibraryOrganization] - # For whom the client library is being published. - # @!attribute [rw] library_settings - # @return [::Array<::Google::Api::ClientLibrarySettings>] - # Client library settings. If the same version string appears multiple - # times in this list, then the last one wins. Settings from earlier - # settings with the same version string are discarded. - # @!attribute [rw] proto_reference_documentation_uri - # @return [::String] - # Optional link to proto reference documentation. Example: - # https://cloud.google.com/pubsub/lite/docs/reference/rpc - # @!attribute [rw] rest_reference_documentation_uri - # @return [::String] - # Optional link to REST reference documentation. Example: - # https://cloud.google.com/pubsub/lite/docs/reference/rest - class Publishing - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Settings for Java client libraries. - # @!attribute [rw] library_package - # @return [::String] - # The package name to use in Java. Clobbers the java_package option - # set in the protobuf. This should be used **only** by APIs - # who have already set the language_settings.java.package_name" field - # in gapic.yaml. API teams should use the protobuf java_package option - # where possible. - # - # Example of a YAML configuration:: - # - # publishing: - # 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. - # @!attribute [rw] methods - # @return [::Array<::String>] - # An allowlist of the fully qualified names of RPCs that should be included - # on public client surfaces. - # @!attribute [rw] generate_omitted_as_internal - # @return [::Boolean] - # Setting this to true indicates to the client generators that methods - # that would be excluded from the generation should instead be generated - # in a way that indicates these methods should not be consumed by - # end users. How this is expressed is up to individual language - # implementations to decide. Some examples may be: added annotations, - # obfuscated identifiers, or other language idiomatic patterns. - class SelectiveGapicGeneration - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # `BatchingConfigProto` defines the batching configuration for an API method. - # @!attribute [rw] thresholds - # @return [::Google::Api::BatchingSettingsProto] - # The thresholds which trigger a batched request to be sent. - # @!attribute [rw] batch_descriptor - # @return [::Google::Api::BatchingDescriptorProto] - # The request and response fields used in batching. - class BatchingConfigProto - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # `BatchingSettingsProto` specifies a set of batching thresholds, each of - # which acts as a trigger to send a batch of messages as a request. At least - # one threshold must be positive nonzero. - # @!attribute [rw] element_count_threshold - # @return [::Integer] - # The number of elements of a field collected into a batch which, if - # exceeded, causes the batch to be sent. - # @!attribute [rw] request_byte_threshold - # @return [::Integer] - # The aggregated size of the batched field which, if exceeded, causes the - # batch to be sent. This size is computed by aggregating the sizes of the - # request field to be batched, not of the entire request message. - # @!attribute [rw] delay_threshold - # @return [::Google::Protobuf::Duration] - # The duration after which a batch should be sent, starting from the addition - # of the first message to that batch. - # @!attribute [rw] element_count_limit - # @return [::Integer] - # The maximum number of elements collected in a batch that could be accepted - # by server. - # @!attribute [rw] request_byte_limit - # @return [::Integer] - # The maximum size of the request that could be accepted by server. - # @!attribute [rw] flow_control_element_limit - # @return [::Integer] - # The maximum number of elements allowed by flow control. - # @!attribute [rw] flow_control_byte_limit - # @return [::Integer] - # The maximum size of data allowed by flow control. - # @!attribute [rw] flow_control_limit_exceeded_behavior - # @return [::Google::Api::FlowControlLimitExceededBehaviorProto] - # The behavior to take when the flow control limit is exceeded. - class BatchingSettingsProto - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # `BatchingDescriptorProto` specifies the fields of the request message to be - # used for batching, and, optionally, the fields of the response message to be - # used for demultiplexing. - # @!attribute [rw] batched_field - # @return [::String] - # The repeated field in the request message to be aggregated by batching. - # @!attribute [rw] discriminator_fields - # @return [::Array<::String>] - # A list of the fields in the request message. Two requests will be batched - # together only if the values of every field specified in - # `request_discriminator_fields` is equal between the two requests. - # @!attribute [rw] subresponse_field - # @return [::String] - # Optional. When present, indicates the field in the response message to be - # used to demultiplex the response into multiple response messages, in - # correspondence with the multiple request messages originally batched - # together. - class BatchingDescriptorProto - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # The organization for which the client libraries are being published. - # Affects the url where generated docs are published, etc. - module ClientLibraryOrganization - # Not useful. - CLIENT_LIBRARY_ORGANIZATION_UNSPECIFIED = 0 - - # Google Cloud Platform Org. - CLOUD = 1 - - # Ads (Advertising) Org. - ADS = 2 - - # Photos Org. - PHOTOS = 3 - - # Street View Org. - STREET_VIEW = 4 - - # Shopping Org. - SHOPPING = 5 - - # Geo Org. - GEO = 6 - - # Generative AI - https://developers.generativeai.google - GENERATIVE_AI = 7 - end - - # To where should client libraries be published? - module ClientLibraryDestination - # Client libraries will neither be generated nor published to package - # managers. - CLIENT_LIBRARY_DESTINATION_UNSPECIFIED = 0 - - # Generate the client library in a repo under github.com/googleapis, - # but don't publish it to package managers. - GITHUB = 10 - - # Publish the library to package managers like nuget.org and npmjs.com. - PACKAGE_MANAGER = 20 - end - - # The behavior to take when the flow control limit is exceeded. - module FlowControlLimitExceededBehaviorProto - # Default behavior, system-defined. - UNSET_BEHAVIOR = 0 - - # Stop operation, raise error. - THROW_EXCEPTION = 1 - - # Pause operation until limit clears. - BLOCK = 2 - - # Continue operation, disregard limit. - IGNORE = 3 - end - end -end diff --git a/owl-bot-staging/google-cloud-secret_manager-v1/proto_docs/google/api/field_behavior.rb b/owl-bot-staging/google-cloud-secret_manager-v1/proto_docs/google/api/field_behavior.rb deleted file mode 100644 index 582be187d115..000000000000 --- a/owl-bot-staging/google-cloud-secret_manager-v1/proto_docs/google/api/field_behavior.rb +++ /dev/null @@ -1,85 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - - -module Google - module Api - # An indicator of the behavior of a given field (for example, that a field - # is required in requests, or given as output but ignored as input). - # This **does not** change the behavior in protocol buffers itself; it only - # denotes the behavior and may affect how API tooling handles the field. - # - # Note: This enum **may** receive new values in the future. - module FieldBehavior - # Conventional default for enums. Do not use this. - FIELD_BEHAVIOR_UNSPECIFIED = 0 - - # Specifically denotes a field as optional. - # While all fields in protocol buffers are optional, this may be specified - # for emphasis if appropriate. - OPTIONAL = 1 - - # Denotes a field as required. - # This indicates that the field **must** be provided as part of the request, - # and failure to do so will cause an error (usually `INVALID_ARGUMENT`). - REQUIRED = 2 - - # Denotes a field as output only. - # This indicates that the field is provided in responses, but including the - # field in a request does nothing (the server *must* ignore it and - # *must not* throw an error as a result of the field's presence). - OUTPUT_ONLY = 3 - - # Denotes a field as input only. - # This indicates that the field is provided in requests, and the - # corresponding field is not included in output. - INPUT_ONLY = 4 - - # Denotes a field as immutable. - # This indicates that the field may be set once in a request to create a - # resource, but may not be changed thereafter. - IMMUTABLE = 5 - - # Denotes that a (repeated) field is an unordered list. - # This indicates that the service may provide the elements of the list - # in any arbitrary order, rather than the order the user originally - # provided. Additionally, the list's order may or may not be stable. - UNORDERED_LIST = 6 - - # Denotes that this field returns a non-empty default value if not set. - # This indicates that if the user provides the empty value in a request, - # a non-empty value will be returned. The user will not be aware of what - # non-empty value to expect. - NON_EMPTY_DEFAULT = 7 - - # Denotes that the field in a resource (a message annotated with - # google.api.resource) is used in the resource name to uniquely identify the - # resource. For AIP-compliant APIs, this should only be applied to the - # `name` field on the resource. - # - # This behavior should not be applied to references to other resources within - # the message. - # - # The identifier field of resources often have different field behavior - # depending on the request it is embedded in (e.g. for Create methods name - # is optional and unused, while for Update methods it is required). Instead - # of method-specific annotations, only `IDENTIFIER` is required. - IDENTIFIER = 8 - end - end -end diff --git a/owl-bot-staging/google-cloud-secret_manager-v1/proto_docs/google/api/launch_stage.rb b/owl-bot-staging/google-cloud-secret_manager-v1/proto_docs/google/api/launch_stage.rb deleted file mode 100644 index 9392a413fb1b..000000000000 --- a/owl-bot-staging/google-cloud-secret_manager-v1/proto_docs/google/api/launch_stage.rb +++ /dev/null @@ -1,71 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - - -module Google - module Api - # The launch stage as defined by [Google Cloud Platform - # Launch Stages](https://cloud.google.com/terms/launch-stages). - module LaunchStage - # Do not use this default value. - LAUNCH_STAGE_UNSPECIFIED = 0 - - # The feature is not yet implemented. Users can not use it. - UNIMPLEMENTED = 6 - - # Prelaunch features are hidden from users and are only visible internally. - PRELAUNCH = 7 - - # Early Access features are limited to a closed group of testers. To use - # these features, you must sign up in advance and sign a Trusted Tester - # agreement (which includes confidentiality provisions). These features may - # be unstable, changed in backward-incompatible ways, and are not - # guaranteed to be released. - EARLY_ACCESS = 1 - - # Alpha is a limited availability test for releases before they are cleared - # for widespread use. By Alpha, all significant design issues are resolved - # and we are in the process of verifying functionality. Alpha customers - # need to apply for access, agree to applicable terms, and have their - # projects allowlisted. Alpha releases don't have to be feature complete, - # no SLAs are provided, and there are no technical support obligations, but - # they will be far enough along that customers can actually use them in - # test environments or for limited-use tests -- just like they would in - # normal production cases. - ALPHA = 2 - - # Beta is the point at which we are ready to open a release for any - # customer to use. There are no SLA or technical support obligations in a - # Beta release. Products will be complete from a feature perspective, but - # may have some open outstanding issues. Beta releases are suitable for - # limited production use cases. - BETA = 3 - - # GA features are open to all developers and are considered stable and - # fully qualified for production use. - GA = 4 - - # Deprecated features are scheduled to be shut down and removed. For more - # information, see the "Deprecation Policy" section of our [Terms of - # Service](https://cloud.google.com/terms/) - # and the [Google Cloud Platform Subject to the Deprecation - # Policy](https://cloud.google.com/terms/deprecation) documentation. - DEPRECATED = 5 - end - end -end diff --git a/owl-bot-staging/google-cloud-secret_manager-v1/proto_docs/google/api/resource.rb b/owl-bot-staging/google-cloud-secret_manager-v1/proto_docs/google/api/resource.rb deleted file mode 100644 index 25dec4847ac1..000000000000 --- a/owl-bot-staging/google-cloud-secret_manager-v1/proto_docs/google/api/resource.rb +++ /dev/null @@ -1,227 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - - -module Google - module Api - # A simple descriptor of a resource type. - # - # ResourceDescriptor annotates a resource message (either by means of a - # protobuf annotation or use in the service config), and associates the - # resource's schema, the resource type, and the pattern of the resource name. - # - # Example: - # - # message Topic { - # // Indicates this message defines a resource schema. - # // Declares the resource type in the format of {service}/{kind}. - # // For Kubernetes resources, the format is {api group}/{kind}. - # option (google.api.resource) = { - # type: "pubsub.googleapis.com/Topic" - # pattern: "projects/{project}/topics/{topic}" - # }; - # } - # - # The ResourceDescriptor Yaml config will look like: - # - # resources: - # - type: "pubsub.googleapis.com/Topic" - # pattern: "projects/{project}/topics/{topic}" - # - # Sometimes, resources have multiple patterns, typically because they can - # live under multiple parents. - # - # Example: - # - # message LogEntry { - # option (google.api.resource) = { - # type: "logging.googleapis.com/LogEntry" - # pattern: "projects/{project}/logs/{log}" - # pattern: "folders/{folder}/logs/{log}" - # pattern: "organizations/{organization}/logs/{log}" - # pattern: "billingAccounts/{billing_account}/logs/{log}" - # }; - # } - # - # The ResourceDescriptor Yaml config will look like: - # - # resources: - # - type: 'logging.googleapis.com/LogEntry' - # pattern: "projects/{project}/logs/{log}" - # pattern: "folders/{folder}/logs/{log}" - # pattern: "organizations/{organization}/logs/{log}" - # pattern: "billingAccounts/{billing_account}/logs/{log}" - # @!attribute [rw] type - # @return [::String] - # The resource type. It must be in the format of - # \\{service_name}/\\{resource_type_kind}. The `resource_type_kind` must be - # singular and must not include version numbers. - # - # Example: `storage.googleapis.com/Bucket` - # - # The value of the resource_type_kind must follow the regular expression - # /[A-Za-z][a-zA-Z0-9]+/. It should start with an upper case character and - # should use PascalCase (UpperCamelCase). The maximum number of - # characters allowed for the `resource_type_kind` is 100. - # @!attribute [rw] pattern - # @return [::Array<::String>] - # Optional. The relative resource name pattern associated with this resource - # type. The DNS prefix of the full resource name shouldn't be specified here. - # - # The path pattern must follow the syntax, which aligns with HTTP binding - # syntax: - # - # Template = Segment { "/" Segment } ; - # Segment = LITERAL | Variable ; - # Variable = "{" LITERAL "}" ; - # - # Examples: - # - # - "projects/\\{project}/topics/\\{topic}" - # - "projects/\\{project}/knowledgeBases/\\{knowledge_base}" - # - # The components in braces correspond to the IDs for each resource in the - # hierarchy. It is expected that, if multiple patterns are provided, - # the same component name (e.g. "project") refers to IDs of the same - # type of resource. - # @!attribute [rw] name_field - # @return [::String] - # Optional. The field on the resource that designates the resource name - # field. If omitted, this is assumed to be "name". - # @!attribute [rw] history - # @return [::Google::Api::ResourceDescriptor::History] - # Optional. The historical or future-looking state of the resource pattern. - # - # Example: - # - # // The InspectTemplate message originally only supported resource - # // names with organization, and project was added later. - # message InspectTemplate { - # option (google.api.resource) = { - # type: "dlp.googleapis.com/InspectTemplate" - # pattern: - # "organizations/{organization}/inspectTemplates/{inspect_template}" - # pattern: "projects/{project}/inspectTemplates/{inspect_template}" - # history: ORIGINALLY_SINGLE_PATTERN - # }; - # } - # @!attribute [rw] plural - # @return [::String] - # The plural name used in the resource name and permission names, such as - # 'projects' for the resource name of 'projects/\\{project}' and the permission - # name of 'cloudresourcemanager.googleapis.com/projects.get'. One exception - # to this is for Nested Collections that have stuttering names, as defined - # in [AIP-122](https://google.aip.dev/122#nested-collections), where the - # collection ID in the resource name pattern does not necessarily directly - # match the `plural` value. - # - # It is the same concept of the `plural` field in k8s CRD spec - # https://kubernetes.io/docs/tasks/access-kubernetes-api/custom-resources/custom-resource-definitions/ - # - # Note: The plural form is required even for singleton resources. See - # https://aip.dev/156 - # @!attribute [rw] singular - # @return [::String] - # The same concept of the `singular` field in k8s CRD spec - # https://kubernetes.io/docs/tasks/access-kubernetes-api/custom-resources/custom-resource-definitions/ - # Such as "project" for the `resourcemanager.googleapis.com/Project` type. - # @!attribute [rw] style - # @return [::Array<::Google::Api::ResourceDescriptor::Style>] - # Style flag(s) for this resource. - # These indicate that a resource is expected to conform to a given - # style. See the specific style flags for additional information. - class ResourceDescriptor - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - - # A description of the historical or future-looking state of the - # resource pattern. - module History - # The "unset" value. - HISTORY_UNSPECIFIED = 0 - - # The resource originally had one pattern and launched as such, and - # additional patterns were added later. - ORIGINALLY_SINGLE_PATTERN = 1 - - # The resource has one pattern, but the API owner expects to add more - # later. (This is the inverse of ORIGINALLY_SINGLE_PATTERN, and prevents - # that from being necessary once there are multiple patterns.) - FUTURE_MULTI_PATTERN = 2 - end - - # A flag representing a specific style that a resource claims to conform to. - module Style - # The unspecified value. Do not use. - STYLE_UNSPECIFIED = 0 - - # This resource is intended to be "declarative-friendly". - # - # Declarative-friendly resources must be more strictly consistent, and - # setting this to true communicates to tools that this resource should - # adhere to declarative-friendly expectations. - # - # Note: This is used by the API linter (linter.aip.dev) to enable - # additional checks. - DECLARATIVE_FRIENDLY = 1 - end - end - - # Defines a proto annotation that describes a string field that refers to - # an API resource. - # @!attribute [rw] type - # @return [::String] - # The resource type that the annotated field references. - # - # Example: - # - # message Subscription { - # string topic = 2 [(google.api.resource_reference) = { - # type: "pubsub.googleapis.com/Topic" - # }]; - # } - # - # Occasionally, a field may reference an arbitrary resource. In this case, - # APIs use the special value * in their resource reference. - # - # Example: - # - # message GetIamPolicyRequest { - # string resource = 2 [(google.api.resource_reference) = { - # type: "*" - # }]; - # } - # @!attribute [rw] child_type - # @return [::String] - # The resource type of a child collection that the annotated field - # references. This is useful for annotating the `parent` field that - # doesn't have a fixed resource type. - # - # Example: - # - # message ListLogEntriesRequest { - # string parent = 1 [(google.api.resource_reference) = { - # child_type: "logging.googleapis.com/LogEntry" - # }; - # } - class ResourceReference - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - end -end diff --git a/owl-bot-staging/google-cloud-secret_manager-v1/proto_docs/google/cloud/secretmanager/v1/resources.rb b/owl-bot-staging/google-cloud-secret_manager-v1/proto_docs/google/cloud/secretmanager/v1/resources.rb deleted file mode 100644 index b7f873a9588d..000000000000 --- a/owl-bot-staging/google-cloud-secret_manager-v1/proto_docs/google/cloud/secretmanager/v1/resources.rb +++ /dev/null @@ -1,526 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - - -module Google - module Cloud - module SecretManager - module V1 - # A {::Google::Cloud::SecretManager::V1::Secret Secret} is a logical secret whose - # value and versions can be accessed. - # - # A {::Google::Cloud::SecretManager::V1::Secret Secret} is made up of zero or more - # {::Google::Cloud::SecretManager::V1::SecretVersion SecretVersions} that represent - # the secret data. - # @!attribute [r] name - # @return [::String] - # Output only. The resource name of the - # {::Google::Cloud::SecretManager::V1::Secret Secret} in the format - # `projects/*/secrets/*`. - # @!attribute [rw] replication - # @return [::Google::Cloud::SecretManager::V1::Replication] - # Optional. Immutable. The replication policy of the secret data attached to - # the {::Google::Cloud::SecretManager::V1::Secret Secret}. - # - # The replication policy cannot be changed after the Secret has been created. - # @!attribute [r] create_time - # @return [::Google::Protobuf::Timestamp] - # Output only. The time at which the - # {::Google::Cloud::SecretManager::V1::Secret Secret} was created. - # @!attribute [rw] labels - # @return [::Google::Protobuf::Map{::String => ::String}] - # The labels assigned to this Secret. - # - # Label keys must be between 1 and 63 characters long, have a UTF-8 encoding - # of maximum 128 bytes, and must conform to the following PCRE regular - # expression: `[\p{Ll}\p{Lo}][\p{Ll}\p{Lo}\p{N}_-]{0,62}` - # - # Label values must be between 0 and 63 characters long, have a UTF-8 - # encoding of maximum 128 bytes, and must conform to the following PCRE - # regular expression: `[\p{Ll}\p{Lo}\p{N}_-]{0,63}` - # - # No more than 64 labels can be assigned to a given resource. - # @!attribute [rw] topics - # @return [::Array<::Google::Cloud::SecretManager::V1::Topic>] - # Optional. A list of up to 10 Pub/Sub topics to which messages are published - # when control plane operations are called on the secret or its versions. - # @!attribute [rw] expire_time - # @return [::Google::Protobuf::Timestamp] - # Optional. Timestamp in UTC when the - # {::Google::Cloud::SecretManager::V1::Secret Secret} is scheduled to expire. - # This is always provided on output, regardless of what was sent on input. - # - # Note: The following fields are mutually exclusive: `expire_time`, `ttl`. If a field in that set is populated, all other fields in the set will automatically be cleared. - # @!attribute [rw] ttl - # @return [::Google::Protobuf::Duration] - # Input only. The TTL for the - # {::Google::Cloud::SecretManager::V1::Secret Secret}. - # - # Note: The following fields are mutually exclusive: `ttl`, `expire_time`. If a field in that set is populated, all other fields in the set will automatically be cleared. - # @!attribute [rw] etag - # @return [::String] - # Optional. Etag of the currently stored - # {::Google::Cloud::SecretManager::V1::Secret Secret}. - # @!attribute [rw] rotation - # @return [::Google::Cloud::SecretManager::V1::Rotation] - # Optional. Rotation policy attached to the - # {::Google::Cloud::SecretManager::V1::Secret Secret}. May be excluded if there is - # no rotation policy. - # @!attribute [rw] version_aliases - # @return [::Google::Protobuf::Map{::String => ::Integer}] - # Optional. Mapping from version alias to version name. - # - # A version alias is a string with a maximum length of 63 characters and can - # contain uppercase and lowercase letters, numerals, and the hyphen (`-`) - # and underscore ('_') characters. An alias string must start with a - # letter and cannot be the string 'latest' or 'NEW'. - # No more than 50 aliases can be assigned to a given secret. - # - # Version-Alias pairs will be viewable via GetSecret and modifiable via - # UpdateSecret. Access by alias is only be supported on - # GetSecretVersion and AccessSecretVersion. - # @!attribute [rw] annotations - # @return [::Google::Protobuf::Map{::String => ::String}] - # Optional. Custom metadata about the secret. - # - # Annotations are distinct from various forms of labels. - # Annotations exist to allow client tools to store their own state - # information without requiring a database. - # - # Annotation keys must be between 1 and 63 characters long, have a UTF-8 - # encoding of maximum 128 bytes, begin and end with an alphanumeric character - # ([a-z0-9A-Z]), and may have dashes (-), underscores (_), dots (.), and - # alphanumerics in between these symbols. - # - # The total size of annotation keys and values must be less than 16KiB. - # @!attribute [rw] version_destroy_ttl - # @return [::Google::Protobuf::Duration] - # Optional. Secret Version TTL after destruction request - # - # This is a part of the Delayed secret version destroy feature. - # For secret with TTL>0, version destruction doesn't happen immediately - # on calling destroy instead the version goes to a disabled state and - # destruction happens after the TTL expires. - # @!attribute [rw] customer_managed_encryption - # @return [::Google::Cloud::SecretManager::V1::CustomerManagedEncryption] - # Optional. The customer-managed encryption configuration of the regionalized - # secrets. If no configuration is provided, Google-managed default encryption - # is used. - # - # Updates to the {::Google::Cloud::SecretManager::V1::Secret Secret} encryption - # configuration only apply to - # {::Google::Cloud::SecretManager::V1::SecretVersion SecretVersions} added - # afterwards. They do not apply retroactively to existing - # {::Google::Cloud::SecretManager::V1::SecretVersion SecretVersions}. - # @!attribute [rw] tags - # @return [::Google::Protobuf::Map{::String => ::String}] - # Optional. Input only. Immutable. Mapping of Tag keys/values directly bound - # to this resource. For example: - # "123/environment": "production", - # "123/costCenter": "marketing" - # - # Tags are used to organize and group resources. - # - # Tags can be used to control policy evaluation for the resource. - class Secret - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - - # @!attribute [rw] key - # @return [::String] - # @!attribute [rw] value - # @return [::String] - class LabelsEntry - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # @!attribute [rw] key - # @return [::String] - # @!attribute [rw] value - # @return [::Integer] - class VersionAliasesEntry - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # @!attribute [rw] key - # @return [::String] - # @!attribute [rw] value - # @return [::String] - class AnnotationsEntry - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # @!attribute [rw] key - # @return [::String] - # @!attribute [rw] value - # @return [::String] - class TagsEntry - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - end - - # A secret version resource in the Secret Manager API. - # @!attribute [r] name - # @return [::String] - # Output only. The resource name of the - # {::Google::Cloud::SecretManager::V1::SecretVersion SecretVersion} in the format - # `projects/*/secrets/*/versions/*`. - # - # {::Google::Cloud::SecretManager::V1::SecretVersion SecretVersion} IDs in a - # {::Google::Cloud::SecretManager::V1::Secret Secret} start at 1 and are - # incremented for each subsequent version of the secret. - # @!attribute [r] create_time - # @return [::Google::Protobuf::Timestamp] - # Output only. The time at which the - # {::Google::Cloud::SecretManager::V1::SecretVersion SecretVersion} was created. - # @!attribute [r] destroy_time - # @return [::Google::Protobuf::Timestamp] - # Output only. The time this - # {::Google::Cloud::SecretManager::V1::SecretVersion SecretVersion} was destroyed. - # Only present if {::Google::Cloud::SecretManager::V1::SecretVersion#state state} - # is - # {::Google::Cloud::SecretManager::V1::SecretVersion::State::DESTROYED DESTROYED}. - # @!attribute [r] state - # @return [::Google::Cloud::SecretManager::V1::SecretVersion::State] - # Output only. The current state of the - # {::Google::Cloud::SecretManager::V1::SecretVersion SecretVersion}. - # @!attribute [rw] replication_status - # @return [::Google::Cloud::SecretManager::V1::ReplicationStatus] - # The replication status of the - # {::Google::Cloud::SecretManager::V1::SecretVersion SecretVersion}. - # @!attribute [r] etag - # @return [::String] - # Output only. Etag of the currently stored - # {::Google::Cloud::SecretManager::V1::SecretVersion SecretVersion}. - # @!attribute [r] client_specified_payload_checksum - # @return [::Boolean] - # Output only. True if payload checksum specified in - # {::Google::Cloud::SecretManager::V1::SecretPayload SecretPayload} object has - # been received by - # {::Google::Cloud::SecretManager::V1::SecretManagerService::Client SecretManagerService} - # on - # {::Google::Cloud::SecretManager::V1::SecretManagerService::Client#add_secret_version SecretManagerService.AddSecretVersion}. - # @!attribute [r] scheduled_destroy_time - # @return [::Google::Protobuf::Timestamp] - # Optional. Output only. Scheduled destroy time for secret version. - # This is a part of the Delayed secret version destroy feature. For a - # Secret with a valid version destroy TTL, when a secert version is - # destroyed, version is moved to disabled state and it is scheduled for - # destruction Version is destroyed only after the scheduled_destroy_time. - # @!attribute [r] customer_managed_encryption - # @return [::Google::Cloud::SecretManager::V1::CustomerManagedEncryptionStatus] - # Output only. The customer-managed encryption status of the - # {::Google::Cloud::SecretManager::V1::SecretVersion SecretVersion}. Only - # populated if customer-managed encryption is used and - # {::Google::Cloud::SecretManager::V1::Secret Secret} is a regionalized secret. - class SecretVersion - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - - # The state of a - # {::Google::Cloud::SecretManager::V1::SecretVersion SecretVersion}, indicating if - # it can be accessed. - module State - # Not specified. This value is unused and invalid. - STATE_UNSPECIFIED = 0 - - # The {::Google::Cloud::SecretManager::V1::SecretVersion SecretVersion} may be - # accessed. - ENABLED = 1 - - # The {::Google::Cloud::SecretManager::V1::SecretVersion SecretVersion} may not - # be accessed, but the secret data is still available and can be placed - # back into the - # {::Google::Cloud::SecretManager::V1::SecretVersion::State::ENABLED ENABLED} - # state. - DISABLED = 2 - - # The {::Google::Cloud::SecretManager::V1::SecretVersion SecretVersion} is - # destroyed and the secret data is no longer stored. A version may not - # leave this state once entered. - DESTROYED = 3 - end - end - - # A policy that defines the replication and encryption configuration of data. - # @!attribute [rw] automatic - # @return [::Google::Cloud::SecretManager::V1::Replication::Automatic] - # The {::Google::Cloud::SecretManager::V1::Secret Secret} will automatically be - # replicated without any restrictions. - # - # Note: The following fields are mutually exclusive: `automatic`, `user_managed`. If a field in that set is populated, all other fields in the set will automatically be cleared. - # @!attribute [rw] user_managed - # @return [::Google::Cloud::SecretManager::V1::Replication::UserManaged] - # The {::Google::Cloud::SecretManager::V1::Secret Secret} will only be - # replicated into the locations specified. - # - # Note: The following fields are mutually exclusive: `user_managed`, `automatic`. If a field in that set is populated, all other fields in the set will automatically be cleared. - class Replication - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - - # A replication policy that replicates the - # {::Google::Cloud::SecretManager::V1::Secret Secret} payload without any - # restrictions. - # @!attribute [rw] customer_managed_encryption - # @return [::Google::Cloud::SecretManager::V1::CustomerManagedEncryption] - # Optional. The customer-managed encryption configuration of the - # {::Google::Cloud::SecretManager::V1::Secret Secret}. If no configuration is - # provided, Google-managed default encryption is used. - # - # Updates to the {::Google::Cloud::SecretManager::V1::Secret Secret} encryption - # configuration only apply to - # {::Google::Cloud::SecretManager::V1::SecretVersion SecretVersions} added - # afterwards. They do not apply retroactively to existing - # {::Google::Cloud::SecretManager::V1::SecretVersion SecretVersions}. - class Automatic - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # A replication policy that replicates the - # {::Google::Cloud::SecretManager::V1::Secret Secret} payload into the locations - # specified in - # {::Google::Cloud::SecretManager::V1::Replication::UserManaged#replicas Replication.UserManaged.replicas} - # @!attribute [rw] replicas - # @return [::Array<::Google::Cloud::SecretManager::V1::Replication::UserManaged::Replica>] - # Required. The list of Replicas for this - # {::Google::Cloud::SecretManager::V1::Secret Secret}. - # - # Cannot be empty. - class UserManaged - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - - # Represents a Replica for this - # {::Google::Cloud::SecretManager::V1::Secret Secret}. - # @!attribute [rw] location - # @return [::String] - # The canonical IDs of the location to replicate data. - # For example: `"us-east1"`. - # @!attribute [rw] customer_managed_encryption - # @return [::Google::Cloud::SecretManager::V1::CustomerManagedEncryption] - # Optional. The customer-managed encryption configuration of the - # [User-Managed Replica][Replication.UserManaged.Replica]. If no - # configuration is provided, Google-managed default encryption is used. - # - # Updates to the {::Google::Cloud::SecretManager::V1::Secret Secret} - # encryption configuration only apply to - # {::Google::Cloud::SecretManager::V1::SecretVersion SecretVersions} added - # afterwards. They do not apply retroactively to existing - # {::Google::Cloud::SecretManager::V1::SecretVersion SecretVersions}. - class Replica - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - end - end - - # Configuration for encrypting secret payloads using customer-managed - # encryption keys (CMEK). - # @!attribute [rw] kms_key_name - # @return [::String] - # Required. The resource name of the Cloud KMS CryptoKey used to encrypt - # secret payloads. - # - # For secrets using the - # {::Google::Cloud::SecretManager::V1::Replication::UserManaged UserManaged} - # replication policy type, Cloud KMS CryptoKeys must reside in the same - # location as the [replica location][Secret.UserManaged.Replica.location]. - # - # For secrets using the - # {::Google::Cloud::SecretManager::V1::Replication::Automatic Automatic} - # replication policy type, Cloud KMS CryptoKeys must reside in `global`. - # - # The expected format is `projects/*/locations/*/keyRings/*/cryptoKeys/*`. - class CustomerManagedEncryption - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # The replication status of a - # {::Google::Cloud::SecretManager::V1::SecretVersion SecretVersion}. - # @!attribute [rw] automatic - # @return [::Google::Cloud::SecretManager::V1::ReplicationStatus::AutomaticStatus] - # Describes the replication status of a - # {::Google::Cloud::SecretManager::V1::SecretVersion SecretVersion} with - # automatic replication. - # - # Only populated if the parent - # {::Google::Cloud::SecretManager::V1::Secret Secret} has an automatic - # replication policy. - # - # Note: The following fields are mutually exclusive: `automatic`, `user_managed`. If a field in that set is populated, all other fields in the set will automatically be cleared. - # @!attribute [rw] user_managed - # @return [::Google::Cloud::SecretManager::V1::ReplicationStatus::UserManagedStatus] - # Describes the replication status of a - # {::Google::Cloud::SecretManager::V1::SecretVersion SecretVersion} with - # user-managed replication. - # - # Only populated if the parent - # {::Google::Cloud::SecretManager::V1::Secret Secret} has a user-managed - # replication policy. - # - # Note: The following fields are mutually exclusive: `user_managed`, `automatic`. If a field in that set is populated, all other fields in the set will automatically be cleared. - class ReplicationStatus - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - - # The replication status of a - # {::Google::Cloud::SecretManager::V1::SecretVersion SecretVersion} using - # automatic replication. - # - # Only populated if the parent {::Google::Cloud::SecretManager::V1::Secret Secret} - # has an automatic replication policy. - # @!attribute [r] customer_managed_encryption - # @return [::Google::Cloud::SecretManager::V1::CustomerManagedEncryptionStatus] - # Output only. The customer-managed encryption status of the - # {::Google::Cloud::SecretManager::V1::SecretVersion SecretVersion}. Only - # populated if customer-managed encryption is used. - class AutomaticStatus - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # The replication status of a - # {::Google::Cloud::SecretManager::V1::SecretVersion SecretVersion} using - # user-managed replication. - # - # Only populated if the parent {::Google::Cloud::SecretManager::V1::Secret Secret} - # has a user-managed replication policy. - # @!attribute [r] replicas - # @return [::Array<::Google::Cloud::SecretManager::V1::ReplicationStatus::UserManagedStatus::ReplicaStatus>] - # Output only. The list of replica statuses for the - # {::Google::Cloud::SecretManager::V1::SecretVersion SecretVersion}. - class UserManagedStatus - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - - # Describes the status of a user-managed replica for the - # {::Google::Cloud::SecretManager::V1::SecretVersion SecretVersion}. - # @!attribute [r] location - # @return [::String] - # Output only. The canonical ID of the replica location. - # For example: `"us-east1"`. - # @!attribute [r] customer_managed_encryption - # @return [::Google::Cloud::SecretManager::V1::CustomerManagedEncryptionStatus] - # Output only. The customer-managed encryption status of the - # {::Google::Cloud::SecretManager::V1::SecretVersion SecretVersion}. Only - # populated if customer-managed encryption is used. - class ReplicaStatus - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - end - end - - # Describes the status of customer-managed encryption. - # @!attribute [rw] kms_key_version_name - # @return [::String] - # Required. The resource name of the Cloud KMS CryptoKeyVersion used to - # encrypt the secret payload, in the following format: - # `projects/*/locations/*/keyRings/*/cryptoKeys/*/versions/*`. - class CustomerManagedEncryptionStatus - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # A Pub/Sub topic which Secret Manager will publish to when control plane - # events occur on this secret. - # @!attribute [rw] name - # @return [::String] - # Identifier. The resource name of the Pub/Sub topic that will be published - # to, in the following format: `projects/*/topics/*`. For publication to - # succeed, the Secret Manager service agent must have the - # `pubsub.topic.publish` permission on the topic. The Pub/Sub Publisher role - # (`roles/pubsub.publisher`) includes this permission. - class Topic - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # The rotation time and period for a - # {::Google::Cloud::SecretManager::V1::Secret Secret}. At next_rotation_time, Secret - # Manager will send a Pub/Sub notification to the topics configured on the - # Secret. {::Google::Cloud::SecretManager::V1::Secret#topics Secret.topics} must be - # set to configure rotation. - # @!attribute [rw] next_rotation_time - # @return [::Google::Protobuf::Timestamp] - # Optional. Timestamp in UTC at which the - # {::Google::Cloud::SecretManager::V1::Secret Secret} is scheduled to rotate. - # Cannot be set to less than 300s (5 min) in the future and at most - # 3153600000s (100 years). - # - # {::Google::Cloud::SecretManager::V1::Rotation#next_rotation_time next_rotation_time} - # MUST be set if - # {::Google::Cloud::SecretManager::V1::Rotation#rotation_period rotation_period} - # is set. - # @!attribute [rw] rotation_period - # @return [::Google::Protobuf::Duration] - # Input only. The Duration between rotation notifications. Must be in seconds - # and at least 3600s (1h) and at most 3153600000s (100 years). - # - # If - # {::Google::Cloud::SecretManager::V1::Rotation#rotation_period rotation_period} - # is set, - # {::Google::Cloud::SecretManager::V1::Rotation#next_rotation_time next_rotation_time} - # must be set. - # {::Google::Cloud::SecretManager::V1::Rotation#next_rotation_time next_rotation_time} - # will be advanced by this period when the service automatically sends - # rotation notifications. - class Rotation - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # A secret payload resource in the Secret Manager API. This contains the - # sensitive secret payload that is associated with a - # {::Google::Cloud::SecretManager::V1::SecretVersion SecretVersion}. - # @!attribute [rw] data - # @return [::String] - # The secret data. Must be no larger than 64KiB. - # @!attribute [rw] data_crc32c - # @return [::Integer] - # Optional. If specified, - # {::Google::Cloud::SecretManager::V1::SecretManagerService::Client SecretManagerService} - # will verify the integrity of the received - # {::Google::Cloud::SecretManager::V1::SecretPayload#data data} on - # {::Google::Cloud::SecretManager::V1::SecretManagerService::Client#add_secret_version SecretManagerService.AddSecretVersion} - # calls using the crc32c checksum and store it to include in future - # {::Google::Cloud::SecretManager::V1::SecretManagerService::Client#access_secret_version SecretManagerService.AccessSecretVersion} - # responses. If a checksum is not provided in the - # {::Google::Cloud::SecretManager::V1::SecretManagerService::Client#add_secret_version SecretManagerService.AddSecretVersion} - # request, the - # {::Google::Cloud::SecretManager::V1::SecretManagerService::Client SecretManagerService} - # will generate and store one for you. - # - # The CRC32C value is encoded as a Int64 for compatibility, and can be - # safely downconverted to uint32 in languages that support this type. - # https://cloud.google.com/apis/design/design_patterns#integer_types - class SecretPayload - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - end - end - end -end diff --git a/owl-bot-staging/google-cloud-secret_manager-v1/proto_docs/google/cloud/secretmanager/v1/service.rb b/owl-bot-staging/google-cloud-secret_manager-v1/proto_docs/google/cloud/secretmanager/v1/service.rb deleted file mode 100644 index 2ccf18690cd5..000000000000 --- a/owl-bot-staging/google-cloud-secret_manager-v1/proto_docs/google/cloud/secretmanager/v1/service.rb +++ /dev/null @@ -1,320 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - - -module Google - module Cloud - module SecretManager - module V1 - # Request message for - # {::Google::Cloud::SecretManager::V1::SecretManagerService::Client#list_secrets SecretManagerService.ListSecrets}. - # @!attribute [rw] parent - # @return [::String] - # Required. The resource name of the project associated with the - # {::Google::Cloud::SecretManager::V1::Secret Secrets}, in the format `projects/*` - # or `projects/*/locations/*` - # @!attribute [rw] page_size - # @return [::Integer] - # Optional. The maximum number of results to be returned in a single page. If - # set to 0, the server decides the number of results to return. If the - # number is greater than 25000, it is capped at 25000. - # @!attribute [rw] page_token - # @return [::String] - # Optional. Pagination token, returned earlier via - # {::Google::Cloud::SecretManager::V1::ListSecretsResponse#next_page_token ListSecretsResponse.next_page_token}. - # @!attribute [rw] filter - # @return [::String] - # Optional. Filter string, adhering to the rules in - # [List-operation - # filtering](https://cloud.google.com/secret-manager/docs/filtering). List - # only secrets matching the filter. If filter is empty, all secrets are - # listed. - class ListSecretsRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Response message for - # {::Google::Cloud::SecretManager::V1::SecretManagerService::Client#list_secrets SecretManagerService.ListSecrets}. - # @!attribute [rw] secrets - # @return [::Array<::Google::Cloud::SecretManager::V1::Secret>] - # The list of {::Google::Cloud::SecretManager::V1::Secret Secrets} sorted in - # reverse by create_time (newest first). - # @!attribute [rw] next_page_token - # @return [::String] - # A token to retrieve the next page of results. Pass this value in - # {::Google::Cloud::SecretManager::V1::ListSecretsRequest#page_token ListSecretsRequest.page_token} - # to retrieve the next page. - # @!attribute [rw] total_size - # @return [::Integer] - # The total number of {::Google::Cloud::SecretManager::V1::Secret Secrets} but 0 - # when the - # {::Google::Cloud::SecretManager::V1::ListSecretsRequest#filter ListSecretsRequest.filter} - # field is set. - class ListSecretsResponse - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Request message for - # {::Google::Cloud::SecretManager::V1::SecretManagerService::Client#create_secret SecretManagerService.CreateSecret}. - # @!attribute [rw] parent - # @return [::String] - # Required. The resource name of the project to associate with the - # {::Google::Cloud::SecretManager::V1::Secret Secret}, in the format `projects/*` - # or `projects/*/locations/*`. - # @!attribute [rw] secret_id - # @return [::String] - # Required. This must be unique within the project. - # - # A secret ID is a string with a maximum length of 255 characters and can - # contain uppercase and lowercase letters, numerals, and the hyphen (`-`) and - # underscore (`_`) characters. - # @!attribute [rw] secret - # @return [::Google::Cloud::SecretManager::V1::Secret] - # Required. A {::Google::Cloud::SecretManager::V1::Secret Secret} with initial - # field values. - class CreateSecretRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Request message for - # {::Google::Cloud::SecretManager::V1::SecretManagerService::Client#add_secret_version SecretManagerService.AddSecretVersion}. - # @!attribute [rw] parent - # @return [::String] - # Required. The resource name of the - # {::Google::Cloud::SecretManager::V1::Secret Secret} to associate with the - # {::Google::Cloud::SecretManager::V1::SecretVersion SecretVersion} in the format - # `projects/*/secrets/*` or `projects/*/locations/*/secrets/*`. - # @!attribute [rw] payload - # @return [::Google::Cloud::SecretManager::V1::SecretPayload] - # Required. The secret payload of the - # {::Google::Cloud::SecretManager::V1::SecretVersion SecretVersion}. - class AddSecretVersionRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Request message for - # {::Google::Cloud::SecretManager::V1::SecretManagerService::Client#get_secret SecretManagerService.GetSecret}. - # @!attribute [rw] name - # @return [::String] - # Required. The resource name of the - # {::Google::Cloud::SecretManager::V1::Secret Secret}, in the format - # `projects/*/secrets/*` or `projects/*/locations/*/secrets/*`. - class GetSecretRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Request message for - # {::Google::Cloud::SecretManager::V1::SecretManagerService::Client#list_secret_versions SecretManagerService.ListSecretVersions}. - # @!attribute [rw] parent - # @return [::String] - # Required. The resource name of the - # {::Google::Cloud::SecretManager::V1::Secret Secret} associated with the - # {::Google::Cloud::SecretManager::V1::SecretVersion SecretVersions} to list, in - # the format `projects/*/secrets/*` or `projects/*/locations/*/secrets/*`. - # @!attribute [rw] page_size - # @return [::Integer] - # Optional. The maximum number of results to be returned in a single page. If - # set to 0, the server decides the number of results to return. If the - # number is greater than 25000, it is capped at 25000. - # @!attribute [rw] page_token - # @return [::String] - # Optional. Pagination token, returned earlier via - # ListSecretVersionsResponse.next_page_token][]. - # @!attribute [rw] filter - # @return [::String] - # Optional. Filter string, adhering to the rules in - # [List-operation - # filtering](https://cloud.google.com/secret-manager/docs/filtering). List - # only secret versions matching the filter. If filter is empty, all secret - # versions are listed. - class ListSecretVersionsRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Response message for - # {::Google::Cloud::SecretManager::V1::SecretManagerService::Client#list_secret_versions SecretManagerService.ListSecretVersions}. - # @!attribute [rw] versions - # @return [::Array<::Google::Cloud::SecretManager::V1::SecretVersion>] - # The list of {::Google::Cloud::SecretManager::V1::SecretVersion SecretVersions} - # sorted in reverse by create_time (newest first). - # @!attribute [rw] next_page_token - # @return [::String] - # A token to retrieve the next page of results. Pass this value in - # {::Google::Cloud::SecretManager::V1::ListSecretVersionsRequest#page_token ListSecretVersionsRequest.page_token} - # to retrieve the next page. - # @!attribute [rw] total_size - # @return [::Integer] - # The total number of - # {::Google::Cloud::SecretManager::V1::SecretVersion SecretVersions} but 0 when - # the - # {::Google::Cloud::SecretManager::V1::ListSecretsRequest#filter ListSecretsRequest.filter} - # field is set. - class ListSecretVersionsResponse - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Request message for - # {::Google::Cloud::SecretManager::V1::SecretManagerService::Client#get_secret_version SecretManagerService.GetSecretVersion}. - # @!attribute [rw] name - # @return [::String] - # Required. The resource name of the - # {::Google::Cloud::SecretManager::V1::SecretVersion SecretVersion} in the format - # `projects/*/secrets/*/versions/*` or - # `projects/*/locations/*/secrets/*/versions/*`. - # - # `projects/*/secrets/*/versions/latest` or - # `projects/*/locations/*/secrets/*/versions/latest` is an alias to the most - # recently created - # {::Google::Cloud::SecretManager::V1::SecretVersion SecretVersion}. - class GetSecretVersionRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Request message for - # {::Google::Cloud::SecretManager::V1::SecretManagerService::Client#update_secret SecretManagerService.UpdateSecret}. - # @!attribute [rw] secret - # @return [::Google::Cloud::SecretManager::V1::Secret] - # Required. {::Google::Cloud::SecretManager::V1::Secret Secret} with updated field - # values. - # @!attribute [rw] update_mask - # @return [::Google::Protobuf::FieldMask] - # Required. Specifies the fields to be updated. - class UpdateSecretRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Request message for - # {::Google::Cloud::SecretManager::V1::SecretManagerService::Client#access_secret_version SecretManagerService.AccessSecretVersion}. - # @!attribute [rw] name - # @return [::String] - # Required. The resource name of the - # {::Google::Cloud::SecretManager::V1::SecretVersion SecretVersion} in the format - # `projects/*/secrets/*/versions/*` or - # `projects/*/locations/*/secrets/*/versions/*`. - # - # `projects/*/secrets/*/versions/latest` or - # `projects/*/locations/*/secrets/*/versions/latest` is an alias to the most - # recently created - # {::Google::Cloud::SecretManager::V1::SecretVersion SecretVersion}. - class AccessSecretVersionRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Response message for - # {::Google::Cloud::SecretManager::V1::SecretManagerService::Client#access_secret_version SecretManagerService.AccessSecretVersion}. - # @!attribute [rw] name - # @return [::String] - # The resource name of the - # {::Google::Cloud::SecretManager::V1::SecretVersion SecretVersion} in the format - # `projects/*/secrets/*/versions/*` or - # `projects/*/locations/*/secrets/*/versions/*`. - # @!attribute [rw] payload - # @return [::Google::Cloud::SecretManager::V1::SecretPayload] - # Secret payload - class AccessSecretVersionResponse - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Request message for - # {::Google::Cloud::SecretManager::V1::SecretManagerService::Client#delete_secret SecretManagerService.DeleteSecret}. - # @!attribute [rw] name - # @return [::String] - # Required. The resource name of the - # {::Google::Cloud::SecretManager::V1::Secret Secret} to delete in the format - # `projects/*/secrets/*`. - # @!attribute [rw] etag - # @return [::String] - # Optional. Etag of the {::Google::Cloud::SecretManager::V1::Secret Secret}. The - # request succeeds if it matches the etag of the currently stored secret - # object. If the etag is omitted, the request succeeds. - class DeleteSecretRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Request message for - # {::Google::Cloud::SecretManager::V1::SecretManagerService::Client#disable_secret_version SecretManagerService.DisableSecretVersion}. - # @!attribute [rw] name - # @return [::String] - # Required. The resource name of the - # {::Google::Cloud::SecretManager::V1::SecretVersion SecretVersion} to disable in - # the format `projects/*/secrets/*/versions/*` or - # `projects/*/locations/*/secrets/*/versions/*`. - # @!attribute [rw] etag - # @return [::String] - # Optional. Etag of the - # {::Google::Cloud::SecretManager::V1::SecretVersion SecretVersion}. The request - # succeeds if it matches the etag of the currently stored secret version - # object. If the etag is omitted, the request succeeds. - class DisableSecretVersionRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Request message for - # {::Google::Cloud::SecretManager::V1::SecretManagerService::Client#enable_secret_version SecretManagerService.EnableSecretVersion}. - # @!attribute [rw] name - # @return [::String] - # Required. The resource name of the - # {::Google::Cloud::SecretManager::V1::SecretVersion SecretVersion} to enable in - # the format `projects/*/secrets/*/versions/*` or - # `projects/*/locations/*/secrets/*/versions/*`. - # @!attribute [rw] etag - # @return [::String] - # Optional. Etag of the - # {::Google::Cloud::SecretManager::V1::SecretVersion SecretVersion}. The request - # succeeds if it matches the etag of the currently stored secret version - # object. If the etag is omitted, the request succeeds. - class EnableSecretVersionRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Request message for - # {::Google::Cloud::SecretManager::V1::SecretManagerService::Client#destroy_secret_version SecretManagerService.DestroySecretVersion}. - # @!attribute [rw] name - # @return [::String] - # Required. The resource name of the - # {::Google::Cloud::SecretManager::V1::SecretVersion SecretVersion} to destroy in - # the format `projects/*/secrets/*/versions/*` or - # `projects/*/locations/*/secrets/*/versions/*`. - # @!attribute [rw] etag - # @return [::String] - # Optional. Etag of the - # {::Google::Cloud::SecretManager::V1::SecretVersion SecretVersion}. The request - # succeeds if it matches the etag of the currently stored secret version - # object. If the etag is omitted, the request succeeds. - class DestroySecretVersionRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - end - end - end -end diff --git a/owl-bot-staging/google-cloud-secret_manager-v1/proto_docs/google/iam/v1/iam_policy.rb b/owl-bot-staging/google-cloud-secret_manager-v1/proto_docs/google/iam/v1/iam_policy.rb deleted file mode 100644 index 5445c77f8258..000000000000 --- a/owl-bot-staging/google-cloud-secret_manager-v1/proto_docs/google/iam/v1/iam_policy.rb +++ /dev/null @@ -1,87 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - - -module Google - module Iam - module V1 - # Request message for `SetIamPolicy` method. - # @!attribute [rw] resource - # @return [::String] - # REQUIRED: The resource for which the policy is being specified. - # See the operation documentation for the appropriate value for this field. - # @!attribute [rw] policy - # @return [::Google::Iam::V1::Policy] - # REQUIRED: The complete policy to be applied to the `resource`. The size of - # the policy is limited to a few 10s of KB. An empty policy is a - # valid policy but certain Cloud Platform services (such as Projects) - # might reject them. - # @!attribute [rw] update_mask - # @return [::Google::Protobuf::FieldMask] - # OPTIONAL: A FieldMask specifying which fields of the policy to modify. Only - # the fields in the mask will be modified. If no mask is provided, the - # following default mask is used: - # - # `paths: "bindings, etag"` - class SetIamPolicyRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Request message for `GetIamPolicy` method. - # @!attribute [rw] resource - # @return [::String] - # REQUIRED: The resource for which the policy is being requested. - # See the operation documentation for the appropriate value for this field. - # @!attribute [rw] options - # @return [::Google::Iam::V1::GetPolicyOptions] - # OPTIONAL: A `GetPolicyOptions` object for specifying options to - # `GetIamPolicy`. - class GetIamPolicyRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Request message for `TestIamPermissions` method. - # @!attribute [rw] resource - # @return [::String] - # REQUIRED: The resource for which the policy detail is being requested. - # See the operation documentation for the appropriate value for this field. - # @!attribute [rw] permissions - # @return [::Array<::String>] - # The set of permissions to check for the `resource`. Permissions with - # wildcards (such as '*' or 'storage.*') are not allowed. For more - # information see - # [IAM Overview](https://cloud.google.com/iam/docs/overview#permissions). - class TestIamPermissionsRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Response message for `TestIamPermissions` method. - # @!attribute [rw] permissions - # @return [::Array<::String>] - # A subset of `TestPermissionsRequest.permissions` that the caller is - # allowed. - class TestIamPermissionsResponse - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - end - end -end diff --git a/owl-bot-staging/google-cloud-secret_manager-v1/proto_docs/google/iam/v1/options.rb b/owl-bot-staging/google-cloud-secret_manager-v1/proto_docs/google/iam/v1/options.rb deleted file mode 100644 index 60713d995b86..000000000000 --- a/owl-bot-staging/google-cloud-secret_manager-v1/proto_docs/google/iam/v1/options.rb +++ /dev/null @@ -1,50 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - - -module Google - module Iam - module V1 - # Encapsulates settings provided to GetIamPolicy. - # @!attribute [rw] requested_policy_version - # @return [::Integer] - # Optional. The maximum policy version that will be used to format the - # policy. - # - # Valid values are 0, 1, and 3. Requests specifying an invalid value will be - # rejected. - # - # Requests for policies with any conditional role bindings must specify - # version 3. Policies with no conditional role bindings may specify any valid - # value or leave the field unset. - # - # The policy in the response might use the policy version that you specified, - # or it might use a lower policy version. For example, if you specify version - # 3, but the policy has no conditional role bindings, the response uses - # version 1. - # - # To learn which resources support conditions in their IAM policies, see the - # [IAM - # documentation](https://cloud.google.com/iam/help/conditions/resource-policies). - class GetPolicyOptions - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - end - end -end diff --git a/owl-bot-staging/google-cloud-secret_manager-v1/proto_docs/google/iam/v1/policy.rb b/owl-bot-staging/google-cloud-secret_manager-v1/proto_docs/google/iam/v1/policy.rb deleted file mode 100644 index 999575b797df..000000000000 --- a/owl-bot-staging/google-cloud-secret_manager-v1/proto_docs/google/iam/v1/policy.rb +++ /dev/null @@ -1,426 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - - -module Google - module Iam - module V1 - # An Identity and Access Management (IAM) policy, which specifies access - # controls for Google Cloud resources. - # - # - # A `Policy` is a collection of `bindings`. A `binding` binds one or more - # `members`, or principals, to a single `role`. Principals can be user - # accounts, service accounts, Google groups, and domains (such as G Suite). A - # `role` is a named list of permissions; each `role` can be an IAM predefined - # role or a user-created custom role. - # - # For some types of Google Cloud resources, a `binding` can also specify a - # `condition`, which is a logical expression that allows access to a resource - # only if the expression evaluates to `true`. A condition can add constraints - # based on attributes of the request, the resource, or both. To learn which - # resources support conditions in their IAM policies, see the - # [IAM - # documentation](https://cloud.google.com/iam/help/conditions/resource-policies). - # - # **JSON example:** - # - # ``` - # { - # "bindings": [ - # { - # "role": "roles/resourcemanager.organizationAdmin", - # "members": [ - # "user:mike@example.com", - # "group:admins@example.com", - # "domain:google.com", - # "serviceAccount:my-project-id@appspot.gserviceaccount.com" - # ] - # }, - # { - # "role": "roles/resourcemanager.organizationViewer", - # "members": [ - # "user:eve@example.com" - # ], - # "condition": { - # "title": "expirable access", - # "description": "Does not grant access after Sep 2020", - # "expression": "request.time < - # timestamp('2020-10-01T00:00:00.000Z')", - # } - # } - # ], - # "etag": "BwWWja0YfJA=", - # "version": 3 - # } - # ``` - # - # **YAML example:** - # - # ``` - # bindings: - # - members: - # - user:mike@example.com - # - group:admins@example.com - # - domain:google.com - # - serviceAccount:my-project-id@appspot.gserviceaccount.com - # role: roles/resourcemanager.organizationAdmin - # - members: - # - user:eve@example.com - # role: roles/resourcemanager.organizationViewer - # condition: - # title: expirable access - # description: Does not grant access after Sep 2020 - # expression: request.time < timestamp('2020-10-01T00:00:00.000Z') - # etag: BwWWja0YfJA= - # version: 3 - # ``` - # - # For a description of IAM and its features, see the - # [IAM documentation](https://cloud.google.com/iam/docs/). - # @!attribute [rw] version - # @return [::Integer] - # Specifies the format of the policy. - # - # Valid values are `0`, `1`, and `3`. Requests that specify an invalid value - # are rejected. - # - # Any operation that affects conditional role bindings must specify version - # `3`. This requirement applies to the following operations: - # - # * Getting a policy that includes a conditional role binding - # * Adding a conditional role binding to a policy - # * Changing a conditional role binding in a policy - # * Removing any role binding, with or without a condition, from a policy - # that includes conditions - # - # **Important:** If you use IAM Conditions, you must include the `etag` field - # whenever you call `setIamPolicy`. If you omit this field, then IAM allows - # you to overwrite a version `3` policy with a version `1` policy, and all of - # the conditions in the version `3` policy are lost. - # - # If a policy does not include any conditions, operations on that policy may - # specify any valid version or leave the field unset. - # - # To learn which resources support conditions in their IAM policies, see the - # [IAM - # documentation](https://cloud.google.com/iam/help/conditions/resource-policies). - # @!attribute [rw] bindings - # @return [::Array<::Google::Iam::V1::Binding>] - # Associates a list of `members`, or principals, with a `role`. Optionally, - # may specify a `condition` that determines how and when the `bindings` are - # applied. Each of the `bindings` must contain at least one principal. - # - # The `bindings` in a `Policy` can refer to up to 1,500 principals; up to 250 - # of these principals can be Google groups. Each occurrence of a principal - # counts towards these limits. For example, if the `bindings` grant 50 - # different roles to `user:alice@example.com`, and not to any other - # principal, then you can add another 1,450 principals to the `bindings` in - # the `Policy`. - # @!attribute [rw] audit_configs - # @return [::Array<::Google::Iam::V1::AuditConfig>] - # Specifies cloud audit logging configuration for this policy. - # @!attribute [rw] etag - # @return [::String] - # `etag` is used for optimistic concurrency control as a way to help - # prevent simultaneous updates of a policy from overwriting each other. - # It is strongly suggested that systems make use of the `etag` in the - # read-modify-write cycle to perform policy updates in order to avoid race - # conditions: An `etag` is returned in the response to `getIamPolicy`, and - # systems are expected to put that etag in the request to `setIamPolicy` to - # ensure that their change will be applied to the same version of the policy. - # - # **Important:** If you use IAM Conditions, you must include the `etag` field - # whenever you call `setIamPolicy`. If you omit this field, then IAM allows - # you to overwrite a version `3` policy with a version `1` policy, and all of - # the conditions in the version `3` policy are lost. - class Policy - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Associates `members`, or principals, with a `role`. - # @!attribute [rw] role - # @return [::String] - # Role that is assigned to the list of `members`, or principals. - # For example, `roles/viewer`, `roles/editor`, or `roles/owner`. - # @!attribute [rw] members - # @return [::Array<::String>] - # Specifies the principals requesting access for a Google Cloud resource. - # `members` can have the following values: - # - # * `allUsers`: A special identifier that represents anyone who is - # on the internet; with or without a Google account. - # - # * `allAuthenticatedUsers`: A special identifier that represents anyone - # who is authenticated with a Google account or a service account. - # - # * `user:{emailid}`: An email address that represents a specific Google - # account. For example, `alice@example.com` . - # - # - # * `serviceAccount:{emailid}`: An email address that represents a service - # account. For example, `my-other-app@appspot.gserviceaccount.com`. - # - # * `group:{emailid}`: An email address that represents a Google group. - # For example, `admins@example.com`. - # - # * `deleted:user:{emailid}?uid={uniqueid}`: An email address (plus unique - # identifier) representing a user that has been recently deleted. For - # example, `alice@example.com?uid=123456789012345678901`. If the user is - # recovered, this value reverts to `user:{emailid}` and the recovered user - # retains the role in the binding. - # - # * `deleted:serviceAccount:{emailid}?uid={uniqueid}`: An email address (plus - # unique identifier) representing a service account that has been recently - # deleted. For example, - # `my-other-app@appspot.gserviceaccount.com?uid=123456789012345678901`. - # If the service account is undeleted, this value reverts to - # `serviceAccount:{emailid}` and the undeleted service account retains the - # role in the binding. - # - # * `deleted:group:{emailid}?uid={uniqueid}`: An email address (plus unique - # identifier) representing a Google group that has been recently - # deleted. For example, `admins@example.com?uid=123456789012345678901`. If - # the group is recovered, this value reverts to `group:{emailid}` and the - # recovered group retains the role in the binding. - # - # - # * `domain:{domain}`: The G Suite domain (primary) that represents all the - # users of that domain. For example, `google.com` or `example.com`. - # @!attribute [rw] condition - # @return [::Google::Type::Expr] - # The condition that is associated with this binding. - # - # If the condition evaluates to `true`, then this binding applies to the - # current request. - # - # If the condition evaluates to `false`, then this binding does not apply to - # the current request. However, a different role binding might grant the same - # role to one or more of the principals in this binding. - # - # To learn which resources support conditions in their IAM policies, see the - # [IAM - # documentation](https://cloud.google.com/iam/help/conditions/resource-policies). - class Binding - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Specifies the audit configuration for a service. - # The configuration determines which permission types are logged, and what - # identities, if any, are exempted from logging. - # An AuditConfig must have one or more AuditLogConfigs. - # - # If there are AuditConfigs for both `allServices` and a specific service, - # the union of the two AuditConfigs is used for that service: the log_types - # specified in each AuditConfig are enabled, and the exempted_members in each - # AuditLogConfig are exempted. - # - # Example Policy with multiple AuditConfigs: - # - # { - # "audit_configs": [ - # { - # "service": "allServices", - # "audit_log_configs": [ - # { - # "log_type": "DATA_READ", - # "exempted_members": [ - # "user:jose@example.com" - # ] - # }, - # { - # "log_type": "DATA_WRITE" - # }, - # { - # "log_type": "ADMIN_READ" - # } - # ] - # }, - # { - # "service": "sampleservice.googleapis.com", - # "audit_log_configs": [ - # { - # "log_type": "DATA_READ" - # }, - # { - # "log_type": "DATA_WRITE", - # "exempted_members": [ - # "user:aliya@example.com" - # ] - # } - # ] - # } - # ] - # } - # - # For sampleservice, this policy enables DATA_READ, DATA_WRITE and ADMIN_READ - # logging. It also exempts `jose@example.com` from DATA_READ logging, and - # `aliya@example.com` from DATA_WRITE logging. - # @!attribute [rw] service - # @return [::String] - # Specifies a service that will be enabled for audit logging. - # For example, `storage.googleapis.com`, `cloudsql.googleapis.com`. - # `allServices` is a special value that covers all services. - # @!attribute [rw] audit_log_configs - # @return [::Array<::Google::Iam::V1::AuditLogConfig>] - # The configuration for logging of each type of permission. - class AuditConfig - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Provides the configuration for logging a type of permissions. - # Example: - # - # { - # "audit_log_configs": [ - # { - # "log_type": "DATA_READ", - # "exempted_members": [ - # "user:jose@example.com" - # ] - # }, - # { - # "log_type": "DATA_WRITE" - # } - # ] - # } - # - # This enables 'DATA_READ' and 'DATA_WRITE' logging, while exempting - # jose@example.com from DATA_READ logging. - # @!attribute [rw] log_type - # @return [::Google::Iam::V1::AuditLogConfig::LogType] - # The log type that this config enables. - # @!attribute [rw] exempted_members - # @return [::Array<::String>] - # Specifies the identities that do not cause logging for this type of - # permission. - # Follows the same format of - # [Binding.members][google.iam.v1.Binding.members]. - class AuditLogConfig - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - - # The list of valid permission types for which logging can be configured. - # Admin writes are always logged, and are not configurable. - module LogType - # Default case. Should never be this. - LOG_TYPE_UNSPECIFIED = 0 - - # Admin reads. Example: CloudIAM getIamPolicy - ADMIN_READ = 1 - - # Data writes. Example: CloudSQL Users create - DATA_WRITE = 2 - - # Data reads. Example: CloudSQL Users list - DATA_READ = 3 - end - end - - # The difference delta between two policies. - # @!attribute [rw] binding_deltas - # @return [::Array<::Google::Iam::V1::BindingDelta>] - # The delta for Bindings between two policies. - # @!attribute [rw] audit_config_deltas - # @return [::Array<::Google::Iam::V1::AuditConfigDelta>] - # The delta for AuditConfigs between two policies. - class PolicyDelta - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # One delta entry for Binding. Each individual change (only one member in each - # entry) to a binding will be a separate entry. - # @!attribute [rw] action - # @return [::Google::Iam::V1::BindingDelta::Action] - # The action that was performed on a Binding. - # Required - # @!attribute [rw] role - # @return [::String] - # Role that is assigned to `members`. - # For example, `roles/viewer`, `roles/editor`, or `roles/owner`. - # Required - # @!attribute [rw] member - # @return [::String] - # A single identity requesting access for a Google Cloud resource. - # Follows the same format of Binding.members. - # Required - # @!attribute [rw] condition - # @return [::Google::Type::Expr] - # The condition that is associated with this binding. - class BindingDelta - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - - # The type of action performed on a Binding in a policy. - module Action - # Unspecified. - ACTION_UNSPECIFIED = 0 - - # Addition of a Binding. - ADD = 1 - - # Removal of a Binding. - REMOVE = 2 - end - end - - # One delta entry for AuditConfig. Each individual change (only one - # exempted_member in each entry) to a AuditConfig will be a separate entry. - # @!attribute [rw] action - # @return [::Google::Iam::V1::AuditConfigDelta::Action] - # The action that was performed on an audit configuration in a policy. - # Required - # @!attribute [rw] service - # @return [::String] - # Specifies a service that was configured for Cloud Audit Logging. - # For example, `storage.googleapis.com`, `cloudsql.googleapis.com`. - # `allServices` is a special value that covers all services. - # Required - # @!attribute [rw] exempted_member - # @return [::String] - # A single identity that is exempted from "data access" audit - # logging for the `service` specified above. - # Follows the same format of Binding.members. - # @!attribute [rw] log_type - # @return [::String] - # Specifies the log_type that was be enabled. ADMIN_ACTIVITY is always - # enabled, and cannot be configured. - # Required - class AuditConfigDelta - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - - # The type of action performed on an audit configuration in a policy. - module Action - # Unspecified. - ACTION_UNSPECIFIED = 0 - - # Addition of an audit configuration. - ADD = 1 - - # Removal of an audit configuration. - REMOVE = 2 - end - end - end - end -end diff --git a/owl-bot-staging/google-cloud-secret_manager-v1/proto_docs/google/protobuf/duration.rb b/owl-bot-staging/google-cloud-secret_manager-v1/proto_docs/google/protobuf/duration.rb deleted file mode 100644 index ea59f1f91daf..000000000000 --- a/owl-bot-staging/google-cloud-secret_manager-v1/proto_docs/google/protobuf/duration.rb +++ /dev/null @@ -1,98 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - - -module Google - module Protobuf - # A Duration represents a signed, fixed-length span of time represented - # as a count of seconds and fractions of seconds at nanosecond - # resolution. It is independent of any calendar and concepts like "day" - # or "month". It is related to Timestamp in that the difference between - # two Timestamp values is a Duration and it can be added or subtracted - # from a Timestamp. Range is approximately +-10,000 years. - # - # # Examples - # - # Example 1: Compute Duration from two Timestamps in pseudo code. - # - # Timestamp start = ...; - # Timestamp end = ...; - # Duration duration = ...; - # - # duration.seconds = end.seconds - start.seconds; - # duration.nanos = end.nanos - start.nanos; - # - # if (duration.seconds < 0 && duration.nanos > 0) { - # duration.seconds += 1; - # duration.nanos -= 1000000000; - # } else if (duration.seconds > 0 && duration.nanos < 0) { - # duration.seconds -= 1; - # duration.nanos += 1000000000; - # } - # - # Example 2: Compute Timestamp from Timestamp + Duration in pseudo code. - # - # Timestamp start = ...; - # Duration duration = ...; - # Timestamp end = ...; - # - # end.seconds = start.seconds + duration.seconds; - # end.nanos = start.nanos + duration.nanos; - # - # if (end.nanos < 0) { - # end.seconds -= 1; - # end.nanos += 1000000000; - # } else if (end.nanos >= 1000000000) { - # end.seconds += 1; - # end.nanos -= 1000000000; - # } - # - # Example 3: Compute Duration from datetime.timedelta in Python. - # - # td = datetime.timedelta(days=3, minutes=10) - # duration = Duration() - # duration.FromTimedelta(td) - # - # # JSON Mapping - # - # In JSON format, the Duration type is encoded as a string rather than an - # object, where the string ends in the suffix "s" (indicating seconds) and - # is preceded by the number of seconds, with nanoseconds expressed as - # fractional seconds. For example, 3 seconds with 0 nanoseconds should be - # encoded in JSON format as "3s", while 3 seconds and 1 nanosecond should - # be expressed in JSON format as "3.000000001s", and 3 seconds and 1 - # microsecond should be expressed in JSON format as "3.000001s". - # @!attribute [rw] seconds - # @return [::Integer] - # Signed seconds of the span of time. Must be from -315,576,000,000 - # to +315,576,000,000 inclusive. Note: these bounds are computed from: - # 60 sec/min * 60 min/hr * 24 hr/day * 365.25 days/year * 10000 years - # @!attribute [rw] nanos - # @return [::Integer] - # Signed fractions of a second at nanosecond resolution of the span - # of time. Durations less than one second are represented with a 0 - # `seconds` field and a positive or negative `nanos` field. For durations - # of one second or more, a non-zero value for the `nanos` field must be - # of the same sign as the `seconds` field. Must be from -999,999,999 - # to +999,999,999 inclusive. - class Duration - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - end -end diff --git a/owl-bot-staging/google-cloud-secret_manager-v1/proto_docs/google/protobuf/empty.rb b/owl-bot-staging/google-cloud-secret_manager-v1/proto_docs/google/protobuf/empty.rb deleted file mode 100644 index 83e4481834a6..000000000000 --- a/owl-bot-staging/google-cloud-secret_manager-v1/proto_docs/google/protobuf/empty.rb +++ /dev/null @@ -1,34 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - - -module Google - module Protobuf - # A generic empty message that you can re-use to avoid defining duplicated - # empty messages in your APIs. A typical example is to use it as the request - # or the response type of an API method. For instance: - # - # service Foo { - # rpc Bar(google.protobuf.Empty) returns (google.protobuf.Empty); - # } - class Empty - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - end -end diff --git a/owl-bot-staging/google-cloud-secret_manager-v1/proto_docs/google/protobuf/field_mask.rb b/owl-bot-staging/google-cloud-secret_manager-v1/proto_docs/google/protobuf/field_mask.rb deleted file mode 100644 index 7f3ffc78601a..000000000000 --- a/owl-bot-staging/google-cloud-secret_manager-v1/proto_docs/google/protobuf/field_mask.rb +++ /dev/null @@ -1,229 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - - -module Google - module Protobuf - # `FieldMask` represents a set of symbolic field paths, for example: - # - # paths: "f.a" - # paths: "f.b.d" - # - # Here `f` represents a field in some root message, `a` and `b` - # fields in the message found in `f`, and `d` a field found in the - # message in `f.b`. - # - # Field masks are used to specify a subset of fields that should be - # returned by a get operation or modified by an update operation. - # Field masks also have a custom JSON encoding (see below). - # - # # Field Masks in Projections - # - # When used in the context of a projection, a response message or - # sub-message is filtered by the API to only contain those fields as - # specified in the mask. For example, if the mask in the previous - # example is applied to a response message as follows: - # - # f { - # a : 22 - # b { - # d : 1 - # x : 2 - # } - # y : 13 - # } - # z: 8 - # - # The result will not contain specific values for fields x,y and z - # (their value will be set to the default, and omitted in proto text - # output): - # - # - # f { - # a : 22 - # b { - # d : 1 - # } - # } - # - # A repeated field is not allowed except at the last position of a - # paths string. - # - # If a FieldMask object is not present in a get operation, the - # operation applies to all fields (as if a FieldMask of all fields - # had been specified). - # - # Note that a field mask does not necessarily apply to the - # top-level response message. In case of a REST get operation, the - # field mask applies directly to the response, but in case of a REST - # list operation, the mask instead applies to each individual message - # in the returned resource list. In case of a REST custom method, - # other definitions may be used. Where the mask applies will be - # clearly documented together with its declaration in the API. In - # any case, the effect on the returned resource/resources is required - # behavior for APIs. - # - # # Field Masks in Update Operations - # - # A field mask in update operations specifies which fields of the - # targeted resource are going to be updated. The API is required - # to only change the values of the fields as specified in the mask - # and leave the others untouched. If a resource is passed in to - # describe the updated values, the API ignores the values of all - # fields not covered by the mask. - # - # If a repeated field is specified for an update operation, new values will - # be appended to the existing repeated field in the target resource. Note that - # a repeated field is only allowed in the last position of a `paths` string. - # - # If a sub-message is specified in the last position of the field mask for an - # update operation, then new value will be merged into the existing sub-message - # in the target resource. - # - # For example, given the target message: - # - # f { - # b { - # d: 1 - # x: 2 - # } - # c: [1] - # } - # - # And an update message: - # - # f { - # b { - # d: 10 - # } - # c: [2] - # } - # - # then if the field mask is: - # - # paths: ["f.b", "f.c"] - # - # then the result will be: - # - # f { - # b { - # d: 10 - # x: 2 - # } - # c: [1, 2] - # } - # - # An implementation may provide options to override this default behavior for - # repeated and message fields. - # - # In order to reset a field's value to the default, the field must - # be in the mask and set to the default value in the provided resource. - # Hence, in order to reset all fields of a resource, provide a default - # instance of the resource and set all fields in the mask, or do - # not provide a mask as described below. - # - # If a field mask is not present on update, the operation applies to - # all fields (as if a field mask of all fields has been specified). - # Note that in the presence of schema evolution, this may mean that - # fields the client does not know and has therefore not filled into - # the request will be reset to their default. If this is unwanted - # behavior, a specific service may require a client to always specify - # a field mask, producing an error if not. - # - # As with get operations, the location of the resource which - # describes the updated values in the request message depends on the - # operation kind. In any case, the effect of the field mask is - # required to be honored by the API. - # - # ## Considerations for HTTP REST - # - # The HTTP kind of an update operation which uses a field mask must - # be set to PATCH instead of PUT in order to satisfy HTTP semantics - # (PUT must only be used for full updates). - # - # # JSON Encoding of Field Masks - # - # In JSON, a field mask is encoded as a single string where paths are - # separated by a comma. Fields name in each path are converted - # to/from lower-camel naming conventions. - # - # As an example, consider the following message declarations: - # - # message Profile { - # User user = 1; - # Photo photo = 2; - # } - # message User { - # string display_name = 1; - # string address = 2; - # } - # - # In proto a field mask for `Profile` may look as such: - # - # mask { - # paths: "user.display_name" - # paths: "photo" - # } - # - # In JSON, the same mask is represented as below: - # - # { - # mask: "user.displayName,photo" - # } - # - # # Field Masks and Oneof Fields - # - # Field masks treat fields in oneofs just as regular fields. Consider the - # following message: - # - # message SampleMessage { - # oneof test_oneof { - # string name = 4; - # SubMessage sub_message = 9; - # } - # } - # - # The field mask can be: - # - # mask { - # paths: "name" - # } - # - # Or: - # - # mask { - # paths: "sub_message" - # } - # - # Note that oneof type names ("test_oneof" in this case) cannot be used in - # paths. - # - # ## Field Mask Verification - # - # The implementation of any API method which has a FieldMask type field in the - # request should verify the included field paths, and return an - # `INVALID_ARGUMENT` error if any path is unmappable. - # @!attribute [rw] paths - # @return [::Array<::String>] - # The set of field mask paths. - class FieldMask - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - end -end diff --git a/owl-bot-staging/google-cloud-secret_manager-v1/proto_docs/google/protobuf/timestamp.rb b/owl-bot-staging/google-cloud-secret_manager-v1/proto_docs/google/protobuf/timestamp.rb deleted file mode 100644 index 74352be9c58c..000000000000 --- a/owl-bot-staging/google-cloud-secret_manager-v1/proto_docs/google/protobuf/timestamp.rb +++ /dev/null @@ -1,127 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - - -module Google - module Protobuf - # A Timestamp represents a point in time independent of any time zone or local - # calendar, encoded as a count of seconds and fractions of seconds at - # nanosecond resolution. The count is relative to an epoch at UTC midnight on - # January 1, 1970, in the proleptic Gregorian calendar which extends the - # Gregorian calendar backwards to year one. - # - # All minutes are 60 seconds long. Leap seconds are "smeared" so that no leap - # second table is needed for interpretation, using a [24-hour linear - # smear](https://developers.google.com/time/smear). - # - # The range is from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59.999999999Z. By - # restricting to that range, we ensure that we can convert to and from [RFC - # 3339](https://www.ietf.org/rfc/rfc3339.txt) date strings. - # - # # Examples - # - # Example 1: Compute Timestamp from POSIX `time()`. - # - # Timestamp timestamp; - # timestamp.set_seconds(time(NULL)); - # timestamp.set_nanos(0); - # - # Example 2: Compute Timestamp from POSIX `gettimeofday()`. - # - # struct timeval tv; - # gettimeofday(&tv, NULL); - # - # Timestamp timestamp; - # timestamp.set_seconds(tv.tv_sec); - # timestamp.set_nanos(tv.tv_usec * 1000); - # - # Example 3: Compute Timestamp from Win32 `GetSystemTimeAsFileTime()`. - # - # FILETIME ft; - # GetSystemTimeAsFileTime(&ft); - # UINT64 ticks = (((UINT64)ft.dwHighDateTime) << 32) | ft.dwLowDateTime; - # - # // A Windows tick is 100 nanoseconds. Windows epoch 1601-01-01T00:00:00Z - # // is 11644473600 seconds before Unix epoch 1970-01-01T00:00:00Z. - # Timestamp timestamp; - # timestamp.set_seconds((INT64) ((ticks / 10000000) - 11644473600LL)); - # timestamp.set_nanos((INT32) ((ticks % 10000000) * 100)); - # - # Example 4: Compute Timestamp from Java `System.currentTimeMillis()`. - # - # long millis = System.currentTimeMillis(); - # - # Timestamp timestamp = Timestamp.newBuilder().setSeconds(millis / 1000) - # .setNanos((int) ((millis % 1000) * 1000000)).build(); - # - # Example 5: Compute Timestamp from Java `Instant.now()`. - # - # Instant now = Instant.now(); - # - # Timestamp timestamp = - # Timestamp.newBuilder().setSeconds(now.getEpochSecond()) - # .setNanos(now.getNano()).build(); - # - # Example 6: Compute Timestamp from current time in Python. - # - # timestamp = Timestamp() - # timestamp.GetCurrentTime() - # - # # JSON Mapping - # - # In JSON format, the Timestamp type is encoded as a string in the - # [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format. That is, the - # format is "\\{year}-\\{month}-\\{day}T\\{hour}:\\{min}:\\{sec}[.\\{frac_sec}]Z" - # where \\{year} is always expressed using four digits while \\{month}, \\{day}, - # \\{hour}, \\{min}, and \\{sec} are zero-padded to two digits each. The fractional - # seconds, which can go up to 9 digits (i.e. up to 1 nanosecond resolution), - # are optional. The "Z" suffix indicates the timezone ("UTC"); the timezone - # is required. A proto3 JSON serializer should always use UTC (as indicated by - # "Z") when printing the Timestamp type and a proto3 JSON parser should be - # able to accept both UTC and other timezones (as indicated by an offset). - # - # For example, "2017-01-15T01:30:15.01Z" encodes 15.01 seconds past - # 01:30 UTC on January 15, 2017. - # - # In JavaScript, one can convert a Date object to this format using the - # standard - # [toISOString()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toISOString) - # method. In Python, a standard `datetime.datetime` object can be converted - # to this format using - # [`strftime`](https://docs.python.org/2/library/time.html#time.strftime) with - # the time format spec '%Y-%m-%dT%H:%M:%S.%fZ'. Likewise, in Java, one can use - # the Joda Time's [`ISODateTimeFormat.dateTime()`]( - # http://joda-time.sourceforge.net/apidocs/org/joda/time/format/ISODateTimeFormat.html#dateTime() - # ) to obtain a formatter capable of generating timestamps in this format. - # @!attribute [rw] seconds - # @return [::Integer] - # Represents seconds of UTC time since Unix epoch - # 1970-01-01T00:00:00Z. Must be from 0001-01-01T00:00:00Z to - # 9999-12-31T23:59:59Z inclusive. - # @!attribute [rw] nanos - # @return [::Integer] - # Non-negative fractions of a second at nanosecond resolution. Negative - # second values with fractions must still have non-negative nanos values - # that count forward in time. Must be from 0 to 999,999,999 - # inclusive. - class Timestamp - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - end -end diff --git a/owl-bot-staging/google-cloud-secret_manager-v1/proto_docs/google/type/expr.rb b/owl-bot-staging/google-cloud-secret_manager-v1/proto_docs/google/type/expr.rb deleted file mode 100644 index 53e7733b6592..000000000000 --- a/owl-bot-staging/google-cloud-secret_manager-v1/proto_docs/google/type/expr.rb +++ /dev/null @@ -1,75 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - - -module Google - module Type - # Represents a textual expression in the Common Expression Language (CEL) - # syntax. CEL is a C-like expression language. The syntax and semantics of CEL - # are documented at https://github.com/google/cel-spec. - # - # Example (Comparison): - # - # title: "Summary size limit" - # description: "Determines if a summary is less than 100 chars" - # expression: "document.summary.size() < 100" - # - # Example (Equality): - # - # title: "Requestor is owner" - # description: "Determines if requestor is the document owner" - # expression: "document.owner == request.auth.claims.email" - # - # Example (Logic): - # - # title: "Public documents" - # description: "Determine whether the document should be publicly visible" - # expression: "document.type != 'private' && document.type != 'internal'" - # - # Example (Data Manipulation): - # - # title: "Notification string" - # description: "Create a notification string with a timestamp." - # expression: "'New message received at ' + string(document.create_time)" - # - # The exact variables and functions that may be referenced within an expression - # are determined by the service that evaluates it. See the service - # documentation for additional information. - # @!attribute [rw] expression - # @return [::String] - # Textual representation of an expression in Common Expression Language - # syntax. - # @!attribute [rw] title - # @return [::String] - # Optional. Title for the expression, i.e. a short string describing - # its purpose. This can be used e.g. in UIs which allow to enter the - # expression. - # @!attribute [rw] description - # @return [::String] - # Optional. Description of the expression. This is a longer text which - # describes the expression, e.g. when hovered over it in a UI. - # @!attribute [rw] location - # @return [::String] - # Optional. String indicating the location of the expression for error - # reporting, e.g. a file name and a position in the file. - class Expr - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - end -end diff --git a/owl-bot-staging/google-cloud-secret_manager-v1/snippets/Gemfile b/owl-bot-staging/google-cloud-secret_manager-v1/snippets/Gemfile deleted file mode 100644 index 714e81d5760e..000000000000 --- a/owl-bot-staging/google-cloud-secret_manager-v1/snippets/Gemfile +++ /dev/null @@ -1,32 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -source "https://rubygems.org" - -if ENV["GOOGLE_CLOUD_SAMPLES_TEST"] == "master" - gem "google-cloud-secret_manager-v1", path: "../" -else - gem "google-cloud-secret_manager-v1" -end - -group :test do - gem "google-style", "~> 1.26.1" - gem "minitest", "~> 5.16" - gem "minitest-focus", "~> 1.1" - gem "minitest-hooks", "~> 1.5" -end diff --git a/owl-bot-staging/google-cloud-secret_manager-v1/snippets/secret_manager_service/access_secret_version.rb b/owl-bot-staging/google-cloud-secret_manager-v1/snippets/secret_manager_service/access_secret_version.rb deleted file mode 100644 index dae0739c31ec..000000000000 --- a/owl-bot-staging/google-cloud-secret_manager-v1/snippets/secret_manager_service/access_secret_version.rb +++ /dev/null @@ -1,47 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -# [START secretmanager_v1_generated_SecretManagerService_AccessSecretVersion_sync] -require "google/cloud/secret_manager/v1" - -## -# Snippet for the access_secret_version call in the SecretManagerService service -# -# This snippet has been automatically generated and should be regarded as a code -# template only. It will require modifications to work: -# - It may require correct/in-range values for request initialization. -# - It may require specifying regional endpoints when creating the service -# client as shown in https://cloud.google.com/ruby/docs/reference. -# -# This is an auto-generated example demonstrating basic usage of -# Google::Cloud::SecretManager::V1::SecretManagerService::Client#access_secret_version. -# -def access_secret_version - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::SecretManager::V1::SecretManagerService::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::SecretManager::V1::AccessSecretVersionRequest.new - - # Call the access_secret_version method. - result = client.access_secret_version request - - # The returned object is of type Google::Cloud::SecretManager::V1::AccessSecretVersionResponse. - p result -end -# [END secretmanager_v1_generated_SecretManagerService_AccessSecretVersion_sync] diff --git a/owl-bot-staging/google-cloud-secret_manager-v1/snippets/secret_manager_service/add_secret_version.rb b/owl-bot-staging/google-cloud-secret_manager-v1/snippets/secret_manager_service/add_secret_version.rb deleted file mode 100644 index 7167e1195230..000000000000 --- a/owl-bot-staging/google-cloud-secret_manager-v1/snippets/secret_manager_service/add_secret_version.rb +++ /dev/null @@ -1,47 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -# [START secretmanager_v1_generated_SecretManagerService_AddSecretVersion_sync] -require "google/cloud/secret_manager/v1" - -## -# Snippet for the add_secret_version call in the SecretManagerService service -# -# This snippet has been automatically generated and should be regarded as a code -# template only. It will require modifications to work: -# - It may require correct/in-range values for request initialization. -# - It may require specifying regional endpoints when creating the service -# client as shown in https://cloud.google.com/ruby/docs/reference. -# -# This is an auto-generated example demonstrating basic usage of -# Google::Cloud::SecretManager::V1::SecretManagerService::Client#add_secret_version. -# -def add_secret_version - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::SecretManager::V1::SecretManagerService::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::SecretManager::V1::AddSecretVersionRequest.new - - # Call the add_secret_version method. - result = client.add_secret_version request - - # The returned object is of type Google::Cloud::SecretManager::V1::SecretVersion. - p result -end -# [END secretmanager_v1_generated_SecretManagerService_AddSecretVersion_sync] diff --git a/owl-bot-staging/google-cloud-secret_manager-v1/snippets/secret_manager_service/create_secret.rb b/owl-bot-staging/google-cloud-secret_manager-v1/snippets/secret_manager_service/create_secret.rb deleted file mode 100644 index 18e84e0e0cf6..000000000000 --- a/owl-bot-staging/google-cloud-secret_manager-v1/snippets/secret_manager_service/create_secret.rb +++ /dev/null @@ -1,47 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -# [START secretmanager_v1_generated_SecretManagerService_CreateSecret_sync] -require "google/cloud/secret_manager/v1" - -## -# Snippet for the create_secret call in the SecretManagerService service -# -# This snippet has been automatically generated and should be regarded as a code -# template only. It will require modifications to work: -# - It may require correct/in-range values for request initialization. -# - It may require specifying regional endpoints when creating the service -# client as shown in https://cloud.google.com/ruby/docs/reference. -# -# This is an auto-generated example demonstrating basic usage of -# Google::Cloud::SecretManager::V1::SecretManagerService::Client#create_secret. -# -def create_secret - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::SecretManager::V1::SecretManagerService::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::SecretManager::V1::CreateSecretRequest.new - - # Call the create_secret method. - result = client.create_secret request - - # The returned object is of type Google::Cloud::SecretManager::V1::Secret. - p result -end -# [END secretmanager_v1_generated_SecretManagerService_CreateSecret_sync] diff --git a/owl-bot-staging/google-cloud-secret_manager-v1/snippets/secret_manager_service/delete_secret.rb b/owl-bot-staging/google-cloud-secret_manager-v1/snippets/secret_manager_service/delete_secret.rb deleted file mode 100644 index d2cda7727281..000000000000 --- a/owl-bot-staging/google-cloud-secret_manager-v1/snippets/secret_manager_service/delete_secret.rb +++ /dev/null @@ -1,47 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -# [START secretmanager_v1_generated_SecretManagerService_DeleteSecret_sync] -require "google/cloud/secret_manager/v1" - -## -# Snippet for the delete_secret call in the SecretManagerService service -# -# This snippet has been automatically generated and should be regarded as a code -# template only. It will require modifications to work: -# - It may require correct/in-range values for request initialization. -# - It may require specifying regional endpoints when creating the service -# client as shown in https://cloud.google.com/ruby/docs/reference. -# -# This is an auto-generated example demonstrating basic usage of -# Google::Cloud::SecretManager::V1::SecretManagerService::Client#delete_secret. -# -def delete_secret - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::SecretManager::V1::SecretManagerService::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::SecretManager::V1::DeleteSecretRequest.new - - # Call the delete_secret method. - result = client.delete_secret request - - # The returned object is of type Google::Protobuf::Empty. - p result -end -# [END secretmanager_v1_generated_SecretManagerService_DeleteSecret_sync] diff --git a/owl-bot-staging/google-cloud-secret_manager-v1/snippets/secret_manager_service/destroy_secret_version.rb b/owl-bot-staging/google-cloud-secret_manager-v1/snippets/secret_manager_service/destroy_secret_version.rb deleted file mode 100644 index f2a4956d1bfa..000000000000 --- a/owl-bot-staging/google-cloud-secret_manager-v1/snippets/secret_manager_service/destroy_secret_version.rb +++ /dev/null @@ -1,47 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -# [START secretmanager_v1_generated_SecretManagerService_DestroySecretVersion_sync] -require "google/cloud/secret_manager/v1" - -## -# Snippet for the destroy_secret_version call in the SecretManagerService service -# -# This snippet has been automatically generated and should be regarded as a code -# template only. It will require modifications to work: -# - It may require correct/in-range values for request initialization. -# - It may require specifying regional endpoints when creating the service -# client as shown in https://cloud.google.com/ruby/docs/reference. -# -# This is an auto-generated example demonstrating basic usage of -# Google::Cloud::SecretManager::V1::SecretManagerService::Client#destroy_secret_version. -# -def destroy_secret_version - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::SecretManager::V1::SecretManagerService::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::SecretManager::V1::DestroySecretVersionRequest.new - - # Call the destroy_secret_version method. - result = client.destroy_secret_version request - - # The returned object is of type Google::Cloud::SecretManager::V1::SecretVersion. - p result -end -# [END secretmanager_v1_generated_SecretManagerService_DestroySecretVersion_sync] diff --git a/owl-bot-staging/google-cloud-secret_manager-v1/snippets/secret_manager_service/disable_secret_version.rb b/owl-bot-staging/google-cloud-secret_manager-v1/snippets/secret_manager_service/disable_secret_version.rb deleted file mode 100644 index 2acddd330453..000000000000 --- a/owl-bot-staging/google-cloud-secret_manager-v1/snippets/secret_manager_service/disable_secret_version.rb +++ /dev/null @@ -1,47 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -# [START secretmanager_v1_generated_SecretManagerService_DisableSecretVersion_sync] -require "google/cloud/secret_manager/v1" - -## -# Snippet for the disable_secret_version call in the SecretManagerService service -# -# This snippet has been automatically generated and should be regarded as a code -# template only. It will require modifications to work: -# - It may require correct/in-range values for request initialization. -# - It may require specifying regional endpoints when creating the service -# client as shown in https://cloud.google.com/ruby/docs/reference. -# -# This is an auto-generated example demonstrating basic usage of -# Google::Cloud::SecretManager::V1::SecretManagerService::Client#disable_secret_version. -# -def disable_secret_version - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::SecretManager::V1::SecretManagerService::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::SecretManager::V1::DisableSecretVersionRequest.new - - # Call the disable_secret_version method. - result = client.disable_secret_version request - - # The returned object is of type Google::Cloud::SecretManager::V1::SecretVersion. - p result -end -# [END secretmanager_v1_generated_SecretManagerService_DisableSecretVersion_sync] diff --git a/owl-bot-staging/google-cloud-secret_manager-v1/snippets/secret_manager_service/enable_secret_version.rb b/owl-bot-staging/google-cloud-secret_manager-v1/snippets/secret_manager_service/enable_secret_version.rb deleted file mode 100644 index 124945e6f241..000000000000 --- a/owl-bot-staging/google-cloud-secret_manager-v1/snippets/secret_manager_service/enable_secret_version.rb +++ /dev/null @@ -1,47 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -# [START secretmanager_v1_generated_SecretManagerService_EnableSecretVersion_sync] -require "google/cloud/secret_manager/v1" - -## -# Snippet for the enable_secret_version call in the SecretManagerService service -# -# This snippet has been automatically generated and should be regarded as a code -# template only. It will require modifications to work: -# - It may require correct/in-range values for request initialization. -# - It may require specifying regional endpoints when creating the service -# client as shown in https://cloud.google.com/ruby/docs/reference. -# -# This is an auto-generated example demonstrating basic usage of -# Google::Cloud::SecretManager::V1::SecretManagerService::Client#enable_secret_version. -# -def enable_secret_version - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::SecretManager::V1::SecretManagerService::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::SecretManager::V1::EnableSecretVersionRequest.new - - # Call the enable_secret_version method. - result = client.enable_secret_version request - - # The returned object is of type Google::Cloud::SecretManager::V1::SecretVersion. - p result -end -# [END secretmanager_v1_generated_SecretManagerService_EnableSecretVersion_sync] diff --git a/owl-bot-staging/google-cloud-secret_manager-v1/snippets/secret_manager_service/get_iam_policy.rb b/owl-bot-staging/google-cloud-secret_manager-v1/snippets/secret_manager_service/get_iam_policy.rb deleted file mode 100644 index 939129c0ed81..000000000000 --- a/owl-bot-staging/google-cloud-secret_manager-v1/snippets/secret_manager_service/get_iam_policy.rb +++ /dev/null @@ -1,47 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -# [START secretmanager_v1_generated_SecretManagerService_GetIamPolicy_sync] -require "google/cloud/secret_manager/v1" - -## -# Snippet for the get_iam_policy call in the SecretManagerService service -# -# This snippet has been automatically generated and should be regarded as a code -# template only. It will require modifications to work: -# - It may require correct/in-range values for request initialization. -# - It may require specifying regional endpoints when creating the service -# client as shown in https://cloud.google.com/ruby/docs/reference. -# -# This is an auto-generated example demonstrating basic usage of -# Google::Cloud::SecretManager::V1::SecretManagerService::Client#get_iam_policy. -# -def get_iam_policy - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::SecretManager::V1::SecretManagerService::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Iam::V1::GetIamPolicyRequest.new - - # Call the get_iam_policy method. - result = client.get_iam_policy request - - # The returned object is of type Google::Iam::V1::Policy. - p result -end -# [END secretmanager_v1_generated_SecretManagerService_GetIamPolicy_sync] diff --git a/owl-bot-staging/google-cloud-secret_manager-v1/snippets/secret_manager_service/get_secret.rb b/owl-bot-staging/google-cloud-secret_manager-v1/snippets/secret_manager_service/get_secret.rb deleted file mode 100644 index d63674176991..000000000000 --- a/owl-bot-staging/google-cloud-secret_manager-v1/snippets/secret_manager_service/get_secret.rb +++ /dev/null @@ -1,47 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -# [START secretmanager_v1_generated_SecretManagerService_GetSecret_sync] -require "google/cloud/secret_manager/v1" - -## -# Snippet for the get_secret call in the SecretManagerService service -# -# This snippet has been automatically generated and should be regarded as a code -# template only. It will require modifications to work: -# - It may require correct/in-range values for request initialization. -# - It may require specifying regional endpoints when creating the service -# client as shown in https://cloud.google.com/ruby/docs/reference. -# -# This is an auto-generated example demonstrating basic usage of -# Google::Cloud::SecretManager::V1::SecretManagerService::Client#get_secret. -# -def get_secret - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::SecretManager::V1::SecretManagerService::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::SecretManager::V1::GetSecretRequest.new - - # Call the get_secret method. - result = client.get_secret request - - # The returned object is of type Google::Cloud::SecretManager::V1::Secret. - p result -end -# [END secretmanager_v1_generated_SecretManagerService_GetSecret_sync] diff --git a/owl-bot-staging/google-cloud-secret_manager-v1/snippets/secret_manager_service/get_secret_version.rb b/owl-bot-staging/google-cloud-secret_manager-v1/snippets/secret_manager_service/get_secret_version.rb deleted file mode 100644 index d784f543ecf2..000000000000 --- a/owl-bot-staging/google-cloud-secret_manager-v1/snippets/secret_manager_service/get_secret_version.rb +++ /dev/null @@ -1,47 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -# [START secretmanager_v1_generated_SecretManagerService_GetSecretVersion_sync] -require "google/cloud/secret_manager/v1" - -## -# Snippet for the get_secret_version call in the SecretManagerService service -# -# This snippet has been automatically generated and should be regarded as a code -# template only. It will require modifications to work: -# - It may require correct/in-range values for request initialization. -# - It may require specifying regional endpoints when creating the service -# client as shown in https://cloud.google.com/ruby/docs/reference. -# -# This is an auto-generated example demonstrating basic usage of -# Google::Cloud::SecretManager::V1::SecretManagerService::Client#get_secret_version. -# -def get_secret_version - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::SecretManager::V1::SecretManagerService::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::SecretManager::V1::GetSecretVersionRequest.new - - # Call the get_secret_version method. - result = client.get_secret_version request - - # The returned object is of type Google::Cloud::SecretManager::V1::SecretVersion. - p result -end -# [END secretmanager_v1_generated_SecretManagerService_GetSecretVersion_sync] diff --git a/owl-bot-staging/google-cloud-secret_manager-v1/snippets/secret_manager_service/list_secret_versions.rb b/owl-bot-staging/google-cloud-secret_manager-v1/snippets/secret_manager_service/list_secret_versions.rb deleted file mode 100644 index 1e197877f1eb..000000000000 --- a/owl-bot-staging/google-cloud-secret_manager-v1/snippets/secret_manager_service/list_secret_versions.rb +++ /dev/null @@ -1,51 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -# [START secretmanager_v1_generated_SecretManagerService_ListSecretVersions_sync] -require "google/cloud/secret_manager/v1" - -## -# Snippet for the list_secret_versions call in the SecretManagerService service -# -# This snippet has been automatically generated and should be regarded as a code -# template only. It will require modifications to work: -# - It may require correct/in-range values for request initialization. -# - It may require specifying regional endpoints when creating the service -# client as shown in https://cloud.google.com/ruby/docs/reference. -# -# This is an auto-generated example demonstrating basic usage of -# Google::Cloud::SecretManager::V1::SecretManagerService::Client#list_secret_versions. -# -def list_secret_versions - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::SecretManager::V1::SecretManagerService::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::SecretManager::V1::ListSecretVersionsRequest.new - - # Call the list_secret_versions method. - result = client.list_secret_versions request - - # The returned object is of type Gapic::PagedEnumerable. You can iterate - # over elements, and API calls will be issued to fetch pages as needed. - result.each do |item| - # Each element is of type ::Google::Cloud::SecretManager::V1::SecretVersion. - p item - end -end -# [END secretmanager_v1_generated_SecretManagerService_ListSecretVersions_sync] diff --git a/owl-bot-staging/google-cloud-secret_manager-v1/snippets/secret_manager_service/list_secrets.rb b/owl-bot-staging/google-cloud-secret_manager-v1/snippets/secret_manager_service/list_secrets.rb deleted file mode 100644 index 42e277c580e9..000000000000 --- a/owl-bot-staging/google-cloud-secret_manager-v1/snippets/secret_manager_service/list_secrets.rb +++ /dev/null @@ -1,51 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -# [START secretmanager_v1_generated_SecretManagerService_ListSecrets_sync] -require "google/cloud/secret_manager/v1" - -## -# Snippet for the list_secrets call in the SecretManagerService service -# -# This snippet has been automatically generated and should be regarded as a code -# template only. It will require modifications to work: -# - It may require correct/in-range values for request initialization. -# - It may require specifying regional endpoints when creating the service -# client as shown in https://cloud.google.com/ruby/docs/reference. -# -# This is an auto-generated example demonstrating basic usage of -# Google::Cloud::SecretManager::V1::SecretManagerService::Client#list_secrets. -# -def list_secrets - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::SecretManager::V1::SecretManagerService::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::SecretManager::V1::ListSecretsRequest.new - - # Call the list_secrets method. - result = client.list_secrets request - - # The returned object is of type Gapic::PagedEnumerable. You can iterate - # over elements, and API calls will be issued to fetch pages as needed. - result.each do |item| - # Each element is of type ::Google::Cloud::SecretManager::V1::Secret. - p item - end -end -# [END secretmanager_v1_generated_SecretManagerService_ListSecrets_sync] diff --git a/owl-bot-staging/google-cloud-secret_manager-v1/snippets/secret_manager_service/set_iam_policy.rb b/owl-bot-staging/google-cloud-secret_manager-v1/snippets/secret_manager_service/set_iam_policy.rb deleted file mode 100644 index 54b76b5acc8c..000000000000 --- a/owl-bot-staging/google-cloud-secret_manager-v1/snippets/secret_manager_service/set_iam_policy.rb +++ /dev/null @@ -1,47 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -# [START secretmanager_v1_generated_SecretManagerService_SetIamPolicy_sync] -require "google/cloud/secret_manager/v1" - -## -# Snippet for the set_iam_policy call in the SecretManagerService service -# -# This snippet has been automatically generated and should be regarded as a code -# template only. It will require modifications to work: -# - It may require correct/in-range values for request initialization. -# - It may require specifying regional endpoints when creating the service -# client as shown in https://cloud.google.com/ruby/docs/reference. -# -# This is an auto-generated example demonstrating basic usage of -# Google::Cloud::SecretManager::V1::SecretManagerService::Client#set_iam_policy. -# -def set_iam_policy - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::SecretManager::V1::SecretManagerService::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Iam::V1::SetIamPolicyRequest.new - - # Call the set_iam_policy method. - result = client.set_iam_policy request - - # The returned object is of type Google::Iam::V1::Policy. - p result -end -# [END secretmanager_v1_generated_SecretManagerService_SetIamPolicy_sync] diff --git a/owl-bot-staging/google-cloud-secret_manager-v1/snippets/secret_manager_service/test_iam_permissions.rb b/owl-bot-staging/google-cloud-secret_manager-v1/snippets/secret_manager_service/test_iam_permissions.rb deleted file mode 100644 index 5b817c93d9c0..000000000000 --- a/owl-bot-staging/google-cloud-secret_manager-v1/snippets/secret_manager_service/test_iam_permissions.rb +++ /dev/null @@ -1,47 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -# [START secretmanager_v1_generated_SecretManagerService_TestIamPermissions_sync] -require "google/cloud/secret_manager/v1" - -## -# Snippet for the test_iam_permissions call in the SecretManagerService service -# -# This snippet has been automatically generated and should be regarded as a code -# template only. It will require modifications to work: -# - It may require correct/in-range values for request initialization. -# - It may require specifying regional endpoints when creating the service -# client as shown in https://cloud.google.com/ruby/docs/reference. -# -# This is an auto-generated example demonstrating basic usage of -# Google::Cloud::SecretManager::V1::SecretManagerService::Client#test_iam_permissions. -# -def test_iam_permissions - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::SecretManager::V1::SecretManagerService::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Iam::V1::TestIamPermissionsRequest.new - - # Call the test_iam_permissions method. - result = client.test_iam_permissions request - - # The returned object is of type Google::Iam::V1::TestIamPermissionsResponse. - p result -end -# [END secretmanager_v1_generated_SecretManagerService_TestIamPermissions_sync] diff --git a/owl-bot-staging/google-cloud-secret_manager-v1/snippets/secret_manager_service/update_secret.rb b/owl-bot-staging/google-cloud-secret_manager-v1/snippets/secret_manager_service/update_secret.rb deleted file mode 100644 index c9d6041cca95..000000000000 --- a/owl-bot-staging/google-cloud-secret_manager-v1/snippets/secret_manager_service/update_secret.rb +++ /dev/null @@ -1,47 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -# [START secretmanager_v1_generated_SecretManagerService_UpdateSecret_sync] -require "google/cloud/secret_manager/v1" - -## -# Snippet for the update_secret call in the SecretManagerService service -# -# This snippet has been automatically generated and should be regarded as a code -# template only. It will require modifications to work: -# - It may require correct/in-range values for request initialization. -# - It may require specifying regional endpoints when creating the service -# client as shown in https://cloud.google.com/ruby/docs/reference. -# -# This is an auto-generated example demonstrating basic usage of -# Google::Cloud::SecretManager::V1::SecretManagerService::Client#update_secret. -# -def update_secret - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::SecretManager::V1::SecretManagerService::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::SecretManager::V1::UpdateSecretRequest.new - - # Call the update_secret method. - result = client.update_secret request - - # The returned object is of type Google::Cloud::SecretManager::V1::Secret. - p result -end -# [END secretmanager_v1_generated_SecretManagerService_UpdateSecret_sync] diff --git a/owl-bot-staging/google-cloud-secret_manager-v1/snippets/snippet_metadata_google.cloud.secretmanager.v1.json b/owl-bot-staging/google-cloud-secret_manager-v1/snippets/snippet_metadata_google.cloud.secretmanager.v1.json deleted file mode 100644 index d8acd8e2d4af..000000000000 --- a/owl-bot-staging/google-cloud-secret_manager-v1/snippets/snippet_metadata_google.cloud.secretmanager.v1.json +++ /dev/null @@ -1,615 +0,0 @@ -{ - "client_library": { - "name": "google-cloud-secret_manager-v1", - "version": "", - "language": "RUBY", - "apis": [ - { - "id": "google.cloud.secretmanager.v1", - "version": "v1" - } - ] - }, - "snippets": [ - { - "region_tag": "secretmanager_v1_generated_SecretManagerService_ListSecrets_sync", - "title": "Snippet for the list_secrets call in the SecretManagerService service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::SecretManager::V1::SecretManagerService::Client#list_secrets.", - "file": "secret_manager_service/list_secrets.rb", - "language": "RUBY", - "client_method": { - "short_name": "list_secrets", - "full_name": "::Google::Cloud::SecretManager::V1::SecretManagerService::Client#list_secrets", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::SecretManager::V1::ListSecretsRequest", - "name": "request" - } - ], - "result_type": "::Google::Cloud::SecretManager::V1::ListSecretsResponse", - "client": { - "short_name": "SecretManagerService::Client", - "full_name": "::Google::Cloud::SecretManager::V1::SecretManagerService::Client" - }, - "method": { - "short_name": "ListSecrets", - "full_name": "google.cloud.secretmanager.v1.SecretManagerService.ListSecrets", - "service": { - "short_name": "SecretManagerService", - "full_name": "google.cloud.secretmanager.v1.SecretManagerService" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 50, - "type": "FULL" - } - ] - }, - { - "region_tag": "secretmanager_v1_generated_SecretManagerService_CreateSecret_sync", - "title": "Snippet for the create_secret call in the SecretManagerService service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::SecretManager::V1::SecretManagerService::Client#create_secret.", - "file": "secret_manager_service/create_secret.rb", - "language": "RUBY", - "client_method": { - "short_name": "create_secret", - "full_name": "::Google::Cloud::SecretManager::V1::SecretManagerService::Client#create_secret", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::SecretManager::V1::CreateSecretRequest", - "name": "request" - } - ], - "result_type": "::Google::Cloud::SecretManager::V1::Secret", - "client": { - "short_name": "SecretManagerService::Client", - "full_name": "::Google::Cloud::SecretManager::V1::SecretManagerService::Client" - }, - "method": { - "short_name": "CreateSecret", - "full_name": "google.cloud.secretmanager.v1.SecretManagerService.CreateSecret", - "service": { - "short_name": "SecretManagerService", - "full_name": "google.cloud.secretmanager.v1.SecretManagerService" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 46, - "type": "FULL" - } - ] - }, - { - "region_tag": "secretmanager_v1_generated_SecretManagerService_AddSecretVersion_sync", - "title": "Snippet for the add_secret_version call in the SecretManagerService service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::SecretManager::V1::SecretManagerService::Client#add_secret_version.", - "file": "secret_manager_service/add_secret_version.rb", - "language": "RUBY", - "client_method": { - "short_name": "add_secret_version", - "full_name": "::Google::Cloud::SecretManager::V1::SecretManagerService::Client#add_secret_version", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::SecretManager::V1::AddSecretVersionRequest", - "name": "request" - } - ], - "result_type": "::Google::Cloud::SecretManager::V1::SecretVersion", - "client": { - "short_name": "SecretManagerService::Client", - "full_name": "::Google::Cloud::SecretManager::V1::SecretManagerService::Client" - }, - "method": { - "short_name": "AddSecretVersion", - "full_name": "google.cloud.secretmanager.v1.SecretManagerService.AddSecretVersion", - "service": { - "short_name": "SecretManagerService", - "full_name": "google.cloud.secretmanager.v1.SecretManagerService" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 46, - "type": "FULL" - } - ] - }, - { - "region_tag": "secretmanager_v1_generated_SecretManagerService_GetSecret_sync", - "title": "Snippet for the get_secret call in the SecretManagerService service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::SecretManager::V1::SecretManagerService::Client#get_secret.", - "file": "secret_manager_service/get_secret.rb", - "language": "RUBY", - "client_method": { - "short_name": "get_secret", - "full_name": "::Google::Cloud::SecretManager::V1::SecretManagerService::Client#get_secret", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::SecretManager::V1::GetSecretRequest", - "name": "request" - } - ], - "result_type": "::Google::Cloud::SecretManager::V1::Secret", - "client": { - "short_name": "SecretManagerService::Client", - "full_name": "::Google::Cloud::SecretManager::V1::SecretManagerService::Client" - }, - "method": { - "short_name": "GetSecret", - "full_name": "google.cloud.secretmanager.v1.SecretManagerService.GetSecret", - "service": { - "short_name": "SecretManagerService", - "full_name": "google.cloud.secretmanager.v1.SecretManagerService" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 46, - "type": "FULL" - } - ] - }, - { - "region_tag": "secretmanager_v1_generated_SecretManagerService_UpdateSecret_sync", - "title": "Snippet for the update_secret call in the SecretManagerService service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::SecretManager::V1::SecretManagerService::Client#update_secret.", - "file": "secret_manager_service/update_secret.rb", - "language": "RUBY", - "client_method": { - "short_name": "update_secret", - "full_name": "::Google::Cloud::SecretManager::V1::SecretManagerService::Client#update_secret", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::SecretManager::V1::UpdateSecretRequest", - "name": "request" - } - ], - "result_type": "::Google::Cloud::SecretManager::V1::Secret", - "client": { - "short_name": "SecretManagerService::Client", - "full_name": "::Google::Cloud::SecretManager::V1::SecretManagerService::Client" - }, - "method": { - "short_name": "UpdateSecret", - "full_name": "google.cloud.secretmanager.v1.SecretManagerService.UpdateSecret", - "service": { - "short_name": "SecretManagerService", - "full_name": "google.cloud.secretmanager.v1.SecretManagerService" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 46, - "type": "FULL" - } - ] - }, - { - "region_tag": "secretmanager_v1_generated_SecretManagerService_DeleteSecret_sync", - "title": "Snippet for the delete_secret call in the SecretManagerService service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::SecretManager::V1::SecretManagerService::Client#delete_secret.", - "file": "secret_manager_service/delete_secret.rb", - "language": "RUBY", - "client_method": { - "short_name": "delete_secret", - "full_name": "::Google::Cloud::SecretManager::V1::SecretManagerService::Client#delete_secret", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::SecretManager::V1::DeleteSecretRequest", - "name": "request" - } - ], - "result_type": "::Google::Protobuf::Empty", - "client": { - "short_name": "SecretManagerService::Client", - "full_name": "::Google::Cloud::SecretManager::V1::SecretManagerService::Client" - }, - "method": { - "short_name": "DeleteSecret", - "full_name": "google.cloud.secretmanager.v1.SecretManagerService.DeleteSecret", - "service": { - "short_name": "SecretManagerService", - "full_name": "google.cloud.secretmanager.v1.SecretManagerService" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 46, - "type": "FULL" - } - ] - }, - { - "region_tag": "secretmanager_v1_generated_SecretManagerService_ListSecretVersions_sync", - "title": "Snippet for the list_secret_versions call in the SecretManagerService service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::SecretManager::V1::SecretManagerService::Client#list_secret_versions.", - "file": "secret_manager_service/list_secret_versions.rb", - "language": "RUBY", - "client_method": { - "short_name": "list_secret_versions", - "full_name": "::Google::Cloud::SecretManager::V1::SecretManagerService::Client#list_secret_versions", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::SecretManager::V1::ListSecretVersionsRequest", - "name": "request" - } - ], - "result_type": "::Google::Cloud::SecretManager::V1::ListSecretVersionsResponse", - "client": { - "short_name": "SecretManagerService::Client", - "full_name": "::Google::Cloud::SecretManager::V1::SecretManagerService::Client" - }, - "method": { - "short_name": "ListSecretVersions", - "full_name": "google.cloud.secretmanager.v1.SecretManagerService.ListSecretVersions", - "service": { - "short_name": "SecretManagerService", - "full_name": "google.cloud.secretmanager.v1.SecretManagerService" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 50, - "type": "FULL" - } - ] - }, - { - "region_tag": "secretmanager_v1_generated_SecretManagerService_GetSecretVersion_sync", - "title": "Snippet for the get_secret_version call in the SecretManagerService service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::SecretManager::V1::SecretManagerService::Client#get_secret_version.", - "file": "secret_manager_service/get_secret_version.rb", - "language": "RUBY", - "client_method": { - "short_name": "get_secret_version", - "full_name": "::Google::Cloud::SecretManager::V1::SecretManagerService::Client#get_secret_version", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::SecretManager::V1::GetSecretVersionRequest", - "name": "request" - } - ], - "result_type": "::Google::Cloud::SecretManager::V1::SecretVersion", - "client": { - "short_name": "SecretManagerService::Client", - "full_name": "::Google::Cloud::SecretManager::V1::SecretManagerService::Client" - }, - "method": { - "short_name": "GetSecretVersion", - "full_name": "google.cloud.secretmanager.v1.SecretManagerService.GetSecretVersion", - "service": { - "short_name": "SecretManagerService", - "full_name": "google.cloud.secretmanager.v1.SecretManagerService" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 46, - "type": "FULL" - } - ] - }, - { - "region_tag": "secretmanager_v1_generated_SecretManagerService_AccessSecretVersion_sync", - "title": "Snippet for the access_secret_version call in the SecretManagerService service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::SecretManager::V1::SecretManagerService::Client#access_secret_version.", - "file": "secret_manager_service/access_secret_version.rb", - "language": "RUBY", - "client_method": { - "short_name": "access_secret_version", - "full_name": "::Google::Cloud::SecretManager::V1::SecretManagerService::Client#access_secret_version", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::SecretManager::V1::AccessSecretVersionRequest", - "name": "request" - } - ], - "result_type": "::Google::Cloud::SecretManager::V1::AccessSecretVersionResponse", - "client": { - "short_name": "SecretManagerService::Client", - "full_name": "::Google::Cloud::SecretManager::V1::SecretManagerService::Client" - }, - "method": { - "short_name": "AccessSecretVersion", - "full_name": "google.cloud.secretmanager.v1.SecretManagerService.AccessSecretVersion", - "service": { - "short_name": "SecretManagerService", - "full_name": "google.cloud.secretmanager.v1.SecretManagerService" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 46, - "type": "FULL" - } - ] - }, - { - "region_tag": "secretmanager_v1_generated_SecretManagerService_DisableSecretVersion_sync", - "title": "Snippet for the disable_secret_version call in the SecretManagerService service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::SecretManager::V1::SecretManagerService::Client#disable_secret_version.", - "file": "secret_manager_service/disable_secret_version.rb", - "language": "RUBY", - "client_method": { - "short_name": "disable_secret_version", - "full_name": "::Google::Cloud::SecretManager::V1::SecretManagerService::Client#disable_secret_version", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::SecretManager::V1::DisableSecretVersionRequest", - "name": "request" - } - ], - "result_type": "::Google::Cloud::SecretManager::V1::SecretVersion", - "client": { - "short_name": "SecretManagerService::Client", - "full_name": "::Google::Cloud::SecretManager::V1::SecretManagerService::Client" - }, - "method": { - "short_name": "DisableSecretVersion", - "full_name": "google.cloud.secretmanager.v1.SecretManagerService.DisableSecretVersion", - "service": { - "short_name": "SecretManagerService", - "full_name": "google.cloud.secretmanager.v1.SecretManagerService" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 46, - "type": "FULL" - } - ] - }, - { - "region_tag": "secretmanager_v1_generated_SecretManagerService_EnableSecretVersion_sync", - "title": "Snippet for the enable_secret_version call in the SecretManagerService service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::SecretManager::V1::SecretManagerService::Client#enable_secret_version.", - "file": "secret_manager_service/enable_secret_version.rb", - "language": "RUBY", - "client_method": { - "short_name": "enable_secret_version", - "full_name": "::Google::Cloud::SecretManager::V1::SecretManagerService::Client#enable_secret_version", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::SecretManager::V1::EnableSecretVersionRequest", - "name": "request" - } - ], - "result_type": "::Google::Cloud::SecretManager::V1::SecretVersion", - "client": { - "short_name": "SecretManagerService::Client", - "full_name": "::Google::Cloud::SecretManager::V1::SecretManagerService::Client" - }, - "method": { - "short_name": "EnableSecretVersion", - "full_name": "google.cloud.secretmanager.v1.SecretManagerService.EnableSecretVersion", - "service": { - "short_name": "SecretManagerService", - "full_name": "google.cloud.secretmanager.v1.SecretManagerService" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 46, - "type": "FULL" - } - ] - }, - { - "region_tag": "secretmanager_v1_generated_SecretManagerService_DestroySecretVersion_sync", - "title": "Snippet for the destroy_secret_version call in the SecretManagerService service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::SecretManager::V1::SecretManagerService::Client#destroy_secret_version.", - "file": "secret_manager_service/destroy_secret_version.rb", - "language": "RUBY", - "client_method": { - "short_name": "destroy_secret_version", - "full_name": "::Google::Cloud::SecretManager::V1::SecretManagerService::Client#destroy_secret_version", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::SecretManager::V1::DestroySecretVersionRequest", - "name": "request" - } - ], - "result_type": "::Google::Cloud::SecretManager::V1::SecretVersion", - "client": { - "short_name": "SecretManagerService::Client", - "full_name": "::Google::Cloud::SecretManager::V1::SecretManagerService::Client" - }, - "method": { - "short_name": "DestroySecretVersion", - "full_name": "google.cloud.secretmanager.v1.SecretManagerService.DestroySecretVersion", - "service": { - "short_name": "SecretManagerService", - "full_name": "google.cloud.secretmanager.v1.SecretManagerService" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 46, - "type": "FULL" - } - ] - }, - { - "region_tag": "secretmanager_v1_generated_SecretManagerService_SetIamPolicy_sync", - "title": "Snippet for the set_iam_policy call in the SecretManagerService service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::SecretManager::V1::SecretManagerService::Client#set_iam_policy.", - "file": "secret_manager_service/set_iam_policy.rb", - "language": "RUBY", - "client_method": { - "short_name": "set_iam_policy", - "full_name": "::Google::Cloud::SecretManager::V1::SecretManagerService::Client#set_iam_policy", - "async": false, - "parameters": [ - { - "type": "::Google::Iam::V1::SetIamPolicyRequest", - "name": "request" - } - ], - "result_type": "::Google::Iam::V1::Policy", - "client": { - "short_name": "SecretManagerService::Client", - "full_name": "::Google::Cloud::SecretManager::V1::SecretManagerService::Client" - }, - "method": { - "short_name": "SetIamPolicy", - "full_name": "google.cloud.secretmanager.v1.SecretManagerService.SetIamPolicy", - "service": { - "short_name": "SecretManagerService", - "full_name": "google.cloud.secretmanager.v1.SecretManagerService" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 46, - "type": "FULL" - } - ] - }, - { - "region_tag": "secretmanager_v1_generated_SecretManagerService_GetIamPolicy_sync", - "title": "Snippet for the get_iam_policy call in the SecretManagerService service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::SecretManager::V1::SecretManagerService::Client#get_iam_policy.", - "file": "secret_manager_service/get_iam_policy.rb", - "language": "RUBY", - "client_method": { - "short_name": "get_iam_policy", - "full_name": "::Google::Cloud::SecretManager::V1::SecretManagerService::Client#get_iam_policy", - "async": false, - "parameters": [ - { - "type": "::Google::Iam::V1::GetIamPolicyRequest", - "name": "request" - } - ], - "result_type": "::Google::Iam::V1::Policy", - "client": { - "short_name": "SecretManagerService::Client", - "full_name": "::Google::Cloud::SecretManager::V1::SecretManagerService::Client" - }, - "method": { - "short_name": "GetIamPolicy", - "full_name": "google.cloud.secretmanager.v1.SecretManagerService.GetIamPolicy", - "service": { - "short_name": "SecretManagerService", - "full_name": "google.cloud.secretmanager.v1.SecretManagerService" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 46, - "type": "FULL" - } - ] - }, - { - "region_tag": "secretmanager_v1_generated_SecretManagerService_TestIamPermissions_sync", - "title": "Snippet for the test_iam_permissions call in the SecretManagerService service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::SecretManager::V1::SecretManagerService::Client#test_iam_permissions.", - "file": "secret_manager_service/test_iam_permissions.rb", - "language": "RUBY", - "client_method": { - "short_name": "test_iam_permissions", - "full_name": "::Google::Cloud::SecretManager::V1::SecretManagerService::Client#test_iam_permissions", - "async": false, - "parameters": [ - { - "type": "::Google::Iam::V1::TestIamPermissionsRequest", - "name": "request" - } - ], - "result_type": "::Google::Iam::V1::TestIamPermissionsResponse", - "client": { - "short_name": "SecretManagerService::Client", - "full_name": "::Google::Cloud::SecretManager::V1::SecretManagerService::Client" - }, - "method": { - "short_name": "TestIamPermissions", - "full_name": "google.cloud.secretmanager.v1.SecretManagerService.TestIamPermissions", - "service": { - "short_name": "SecretManagerService", - "full_name": "google.cloud.secretmanager.v1.SecretManagerService" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 46, - "type": "FULL" - } - ] - } - ] -} \ No newline at end of file diff --git a/owl-bot-staging/google-cloud-secret_manager-v1/test/google/cloud/secret_manager/v1/secret_manager_service_paths_test.rb b/owl-bot-staging/google-cloud-secret_manager-v1/test/google/cloud/secret_manager/v1/secret_manager_service_paths_test.rb deleted file mode 100644 index 7ec6d9553efe..000000000000 --- a/owl-bot-staging/google-cloud-secret_manager-v1/test/google/cloud/secret_manager/v1/secret_manager_service_paths_test.rb +++ /dev/null @@ -1,109 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -require "helper" - -require "gapic/grpc/service_stub" - -require "google/cloud/secret_manager/v1/secret_manager_service" - -class ::Google::Cloud::SecretManager::V1::SecretManagerService::ClientPathsTest < Minitest::Test - class DummyStub - def endpoint - "endpoint.example.com" - end - - def universe_domain - "example.com" - end - - def stub_logger - nil - end - - def logger - nil - end - end - - def test_location_path - grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - ::Gapic::ServiceStub.stub :new, DummyStub.new do - client = ::Google::Cloud::SecretManager::V1::SecretManagerService::Client.new do |config| - config.credentials = grpc_channel - end - - path = client.location_path project: "value0", location: "value1" - assert_equal "projects/value0/locations/value1", path - end - end - - def test_project_path - grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - ::Gapic::ServiceStub.stub :new, DummyStub.new do - client = ::Google::Cloud::SecretManager::V1::SecretManagerService::Client.new do |config| - config.credentials = grpc_channel - end - - path = client.project_path project: "value0" - assert_equal "projects/value0", path - end - end - - def test_secret_path - grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - ::Gapic::ServiceStub.stub :new, DummyStub.new do - client = ::Google::Cloud::SecretManager::V1::SecretManagerService::Client.new do |config| - config.credentials = grpc_channel - end - - path = client.secret_path project: "value0", secret: "value1" - assert_equal "projects/value0/secrets/value1", path - - path = client.secret_path project: "value0", location: "value1", secret: "value2" - assert_equal "projects/value0/locations/value1/secrets/value2", path - end - end - - def test_secret_version_path - grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - ::Gapic::ServiceStub.stub :new, DummyStub.new do - client = ::Google::Cloud::SecretManager::V1::SecretManagerService::Client.new do |config| - config.credentials = grpc_channel - end - - path = client.secret_version_path project: "value0", secret: "value1", secret_version: "value2" - assert_equal "projects/value0/secrets/value1/versions/value2", path - - path = client.secret_version_path project: "value0", location: "value1", secret: "value2", secret_version: "value3" - assert_equal "projects/value0/locations/value1/secrets/value2/versions/value3", path - end - end - - def test_topic_path - grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - ::Gapic::ServiceStub.stub :new, DummyStub.new do - client = ::Google::Cloud::SecretManager::V1::SecretManagerService::Client.new do |config| - config.credentials = grpc_channel - end - - path = client.topic_path project: "value0", topic: "value1" - assert_equal "projects/value0/topics/value1", path - end - end -end diff --git a/owl-bot-staging/google-cloud-secret_manager-v1/test/google/cloud/secret_manager/v1/secret_manager_service_rest_test.rb b/owl-bot-staging/google-cloud-secret_manager-v1/test/google/cloud/secret_manager/v1/secret_manager_service_rest_test.rb deleted file mode 100644 index 3098cdf2bfb2..000000000000 --- a/owl-bot-staging/google-cloud-secret_manager-v1/test/google/cloud/secret_manager/v1/secret_manager_service_rest_test.rb +++ /dev/null @@ -1,927 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -require "helper" -require "gapic/rest" -require "google/cloud/secretmanager/v1/service_pb" -require "google/cloud/secret_manager/v1/secret_manager_service/rest" - - -class ::Google::Cloud::SecretManager::V1::SecretManagerService::Rest::ClientTest < Minitest::Test - class ClientStub - attr_accessor :call_count, :requests - - def initialize response, &block - @response = response - @block = block - @call_count = 0 - @requests = [] - end - - def make_get_request uri:, params: {}, options: {}, method_name: nil - make_http_request :get, uri: uri, body: nil, params: params, options: options, method_name: method_name - end - - def make_delete_request uri:, params: {}, options: {}, method_name: nil - make_http_request :delete, uri: uri, body: nil, params: params, options: options, method_name: method_name - end - - def make_post_request uri:, body: nil, params: {}, options: {}, method_name: nil - make_http_request :post, uri: uri, body: body, params: params, options: options, method_name: method_name - end - - def make_patch_request uri:, body:, params: {}, options: {}, method_name: nil - make_http_request :patch, uri: uri, body: body, params: params, options: options, method_name: method_name - end - - def make_put_request uri:, body:, params: {}, options: {}, method_name: nil - make_http_request :put, uri: uri, body: body, params: params, options: options, method_name: method_name - end - - def make_http_request *args, **kwargs - @call_count += 1 - - @requests << @block&.call(*args, **kwargs) - - @response - end - - def endpoint - "endpoint.example.com" - end - - def universe_domain - "example.com" - end - - def stub_logger - nil - end - - def logger - nil - end - end - - def test_list_secrets - # Create test objects. - client_result = ::Google::Cloud::SecretManager::V1::ListSecretsResponse.new - http_response = OpenStruct.new body: client_result.to_json - - call_options = {} - - # Create request parameters for a unary method. - parent = "hello world" - page_size = 42 - page_token = "hello world" - filter = "hello world" - - list_secrets_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| - assert options.metadata.key? :"x-goog-api-client" - assert options.metadata[:"x-goog-api-client"].include? "rest" - refute options.metadata[:"x-goog-api-client"].include? "grpc" - end - - ::Google::Cloud::SecretManager::V1::SecretManagerService::Rest::ServiceStub.stub :transcode_list_secrets_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, list_secrets_client_stub do - # Create client - client = ::Google::Cloud::SecretManager::V1::SecretManagerService::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - client.list_secrets({ parent: parent, page_size: page_size, page_token: page_token, filter: filter }) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use named arguments - client.list_secrets parent: parent, page_size: page_size, page_token: page_token, filter: filter do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object - client.list_secrets ::Google::Cloud::SecretManager::V1::ListSecretsRequest.new(parent: parent, page_size: page_size, page_token: page_token, filter: filter) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use hash object with options - client.list_secrets({ parent: parent, page_size: page_size, page_token: page_token, filter: filter }, call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object with options - client.list_secrets(::Google::Cloud::SecretManager::V1::ListSecretsRequest.new(parent: parent, page_size: page_size, page_token: page_token, filter: filter), call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Verify method calls - assert_equal 5, list_secrets_client_stub.call_count - end - end - end - - def test_create_secret - # Create test objects. - client_result = ::Google::Cloud::SecretManager::V1::Secret.new - http_response = OpenStruct.new body: client_result.to_json - - call_options = {} - - # Create request parameters for a unary method. - parent = "hello world" - secret_id = "hello world" - secret = {} - - create_secret_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| - assert options.metadata.key? :"x-goog-api-client" - assert options.metadata[:"x-goog-api-client"].include? "rest" - refute options.metadata[:"x-goog-api-client"].include? "grpc" - end - - ::Google::Cloud::SecretManager::V1::SecretManagerService::Rest::ServiceStub.stub :transcode_create_secret_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, create_secret_client_stub do - # Create client - client = ::Google::Cloud::SecretManager::V1::SecretManagerService::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - client.create_secret({ parent: parent, secret_id: secret_id, secret: secret }) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use named arguments - client.create_secret parent: parent, secret_id: secret_id, secret: secret do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object - client.create_secret ::Google::Cloud::SecretManager::V1::CreateSecretRequest.new(parent: parent, secret_id: secret_id, secret: secret) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use hash object with options - client.create_secret({ parent: parent, secret_id: secret_id, secret: secret }, call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object with options - client.create_secret(::Google::Cloud::SecretManager::V1::CreateSecretRequest.new(parent: parent, secret_id: secret_id, secret: secret), call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Verify method calls - assert_equal 5, create_secret_client_stub.call_count - end - end - end - - def test_add_secret_version - # Create test objects. - client_result = ::Google::Cloud::SecretManager::V1::SecretVersion.new - http_response = OpenStruct.new body: client_result.to_json - - call_options = {} - - # Create request parameters for a unary method. - parent = "hello world" - payload = {} - - add_secret_version_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| - assert options.metadata.key? :"x-goog-api-client" - assert options.metadata[:"x-goog-api-client"].include? "rest" - refute options.metadata[:"x-goog-api-client"].include? "grpc" - end - - ::Google::Cloud::SecretManager::V1::SecretManagerService::Rest::ServiceStub.stub :transcode_add_secret_version_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, add_secret_version_client_stub do - # Create client - client = ::Google::Cloud::SecretManager::V1::SecretManagerService::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - client.add_secret_version({ parent: parent, payload: payload }) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use named arguments - client.add_secret_version parent: parent, payload: payload do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object - client.add_secret_version ::Google::Cloud::SecretManager::V1::AddSecretVersionRequest.new(parent: parent, payload: payload) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use hash object with options - client.add_secret_version({ parent: parent, payload: payload }, call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object with options - client.add_secret_version(::Google::Cloud::SecretManager::V1::AddSecretVersionRequest.new(parent: parent, payload: payload), call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Verify method calls - assert_equal 5, add_secret_version_client_stub.call_count - end - end - end - - def test_get_secret - # Create test objects. - client_result = ::Google::Cloud::SecretManager::V1::Secret.new - http_response = OpenStruct.new body: client_result.to_json - - call_options = {} - - # Create request parameters for a unary method. - name = "hello world" - - get_secret_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| - assert options.metadata.key? :"x-goog-api-client" - assert options.metadata[:"x-goog-api-client"].include? "rest" - refute options.metadata[:"x-goog-api-client"].include? "grpc" - end - - ::Google::Cloud::SecretManager::V1::SecretManagerService::Rest::ServiceStub.stub :transcode_get_secret_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, get_secret_client_stub do - # Create client - client = ::Google::Cloud::SecretManager::V1::SecretManagerService::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - client.get_secret({ name: name }) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use named arguments - client.get_secret name: name do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object - client.get_secret ::Google::Cloud::SecretManager::V1::GetSecretRequest.new(name: name) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use hash object with options - client.get_secret({ name: name }, call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object with options - client.get_secret(::Google::Cloud::SecretManager::V1::GetSecretRequest.new(name: name), call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Verify method calls - assert_equal 5, get_secret_client_stub.call_count - end - end - end - - def test_update_secret - # Create test objects. - client_result = ::Google::Cloud::SecretManager::V1::Secret.new - http_response = OpenStruct.new body: client_result.to_json - - call_options = {} - - # Create request parameters for a unary method. - secret = {} - update_mask = {} - - update_secret_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| - assert options.metadata.key? :"x-goog-api-client" - assert options.metadata[:"x-goog-api-client"].include? "rest" - refute options.metadata[:"x-goog-api-client"].include? "grpc" - end - - ::Google::Cloud::SecretManager::V1::SecretManagerService::Rest::ServiceStub.stub :transcode_update_secret_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, update_secret_client_stub do - # Create client - client = ::Google::Cloud::SecretManager::V1::SecretManagerService::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - client.update_secret({ secret: secret, update_mask: update_mask }) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use named arguments - client.update_secret secret: secret, update_mask: update_mask do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object - client.update_secret ::Google::Cloud::SecretManager::V1::UpdateSecretRequest.new(secret: secret, update_mask: update_mask) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use hash object with options - client.update_secret({ secret: secret, update_mask: update_mask }, call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object with options - client.update_secret(::Google::Cloud::SecretManager::V1::UpdateSecretRequest.new(secret: secret, update_mask: update_mask), call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Verify method calls - assert_equal 5, update_secret_client_stub.call_count - end - end - end - - def test_delete_secret - # Create test objects. - client_result = ::Google::Protobuf::Empty.new - http_response = OpenStruct.new body: client_result.to_json - - call_options = {} - - # Create request parameters for a unary method. - name = "hello world" - etag = "hello world" - - delete_secret_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| - assert options.metadata.key? :"x-goog-api-client" - assert options.metadata[:"x-goog-api-client"].include? "rest" - refute options.metadata[:"x-goog-api-client"].include? "grpc" - end - - ::Google::Cloud::SecretManager::V1::SecretManagerService::Rest::ServiceStub.stub :transcode_delete_secret_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, delete_secret_client_stub do - # Create client - client = ::Google::Cloud::SecretManager::V1::SecretManagerService::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - client.delete_secret({ name: name, etag: etag }) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use named arguments - client.delete_secret name: name, etag: etag do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object - client.delete_secret ::Google::Cloud::SecretManager::V1::DeleteSecretRequest.new(name: name, etag: etag) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use hash object with options - client.delete_secret({ name: name, etag: etag }, call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object with options - client.delete_secret(::Google::Cloud::SecretManager::V1::DeleteSecretRequest.new(name: name, etag: etag), call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Verify method calls - assert_equal 5, delete_secret_client_stub.call_count - end - end - end - - def test_list_secret_versions - # Create test objects. - client_result = ::Google::Cloud::SecretManager::V1::ListSecretVersionsResponse.new - http_response = OpenStruct.new body: client_result.to_json - - call_options = {} - - # Create request parameters for a unary method. - parent = "hello world" - page_size = 42 - page_token = "hello world" - filter = "hello world" - - list_secret_versions_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| - assert options.metadata.key? :"x-goog-api-client" - assert options.metadata[:"x-goog-api-client"].include? "rest" - refute options.metadata[:"x-goog-api-client"].include? "grpc" - end - - ::Google::Cloud::SecretManager::V1::SecretManagerService::Rest::ServiceStub.stub :transcode_list_secret_versions_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, list_secret_versions_client_stub do - # Create client - client = ::Google::Cloud::SecretManager::V1::SecretManagerService::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - client.list_secret_versions({ parent: parent, page_size: page_size, page_token: page_token, filter: filter }) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use named arguments - client.list_secret_versions parent: parent, page_size: page_size, page_token: page_token, filter: filter do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object - client.list_secret_versions ::Google::Cloud::SecretManager::V1::ListSecretVersionsRequest.new(parent: parent, page_size: page_size, page_token: page_token, filter: filter) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use hash object with options - client.list_secret_versions({ parent: parent, page_size: page_size, page_token: page_token, filter: filter }, call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object with options - client.list_secret_versions(::Google::Cloud::SecretManager::V1::ListSecretVersionsRequest.new(parent: parent, page_size: page_size, page_token: page_token, filter: filter), call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Verify method calls - assert_equal 5, list_secret_versions_client_stub.call_count - end - end - end - - def test_get_secret_version - # Create test objects. - client_result = ::Google::Cloud::SecretManager::V1::SecretVersion.new - http_response = OpenStruct.new body: client_result.to_json - - call_options = {} - - # Create request parameters for a unary method. - name = "hello world" - - get_secret_version_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| - assert options.metadata.key? :"x-goog-api-client" - assert options.metadata[:"x-goog-api-client"].include? "rest" - refute options.metadata[:"x-goog-api-client"].include? "grpc" - end - - ::Google::Cloud::SecretManager::V1::SecretManagerService::Rest::ServiceStub.stub :transcode_get_secret_version_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, get_secret_version_client_stub do - # Create client - client = ::Google::Cloud::SecretManager::V1::SecretManagerService::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - client.get_secret_version({ name: name }) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use named arguments - client.get_secret_version name: name do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object - client.get_secret_version ::Google::Cloud::SecretManager::V1::GetSecretVersionRequest.new(name: name) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use hash object with options - client.get_secret_version({ name: name }, call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object with options - client.get_secret_version(::Google::Cloud::SecretManager::V1::GetSecretVersionRequest.new(name: name), call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Verify method calls - assert_equal 5, get_secret_version_client_stub.call_count - end - end - end - - def test_access_secret_version - # Create test objects. - client_result = ::Google::Cloud::SecretManager::V1::AccessSecretVersionResponse.new - http_response = OpenStruct.new body: client_result.to_json - - call_options = {} - - # Create request parameters for a unary method. - name = "hello world" - - access_secret_version_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| - assert options.metadata.key? :"x-goog-api-client" - assert options.metadata[:"x-goog-api-client"].include? "rest" - refute options.metadata[:"x-goog-api-client"].include? "grpc" - end - - ::Google::Cloud::SecretManager::V1::SecretManagerService::Rest::ServiceStub.stub :transcode_access_secret_version_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, access_secret_version_client_stub do - # Create client - client = ::Google::Cloud::SecretManager::V1::SecretManagerService::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - client.access_secret_version({ name: name }) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use named arguments - client.access_secret_version name: name do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object - client.access_secret_version ::Google::Cloud::SecretManager::V1::AccessSecretVersionRequest.new(name: name) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use hash object with options - client.access_secret_version({ name: name }, call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object with options - client.access_secret_version(::Google::Cloud::SecretManager::V1::AccessSecretVersionRequest.new(name: name), call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Verify method calls - assert_equal 5, access_secret_version_client_stub.call_count - end - end - end - - def test_disable_secret_version - # Create test objects. - client_result = ::Google::Cloud::SecretManager::V1::SecretVersion.new - http_response = OpenStruct.new body: client_result.to_json - - call_options = {} - - # Create request parameters for a unary method. - name = "hello world" - etag = "hello world" - - disable_secret_version_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| - assert options.metadata.key? :"x-goog-api-client" - assert options.metadata[:"x-goog-api-client"].include? "rest" - refute options.metadata[:"x-goog-api-client"].include? "grpc" - end - - ::Google::Cloud::SecretManager::V1::SecretManagerService::Rest::ServiceStub.stub :transcode_disable_secret_version_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, disable_secret_version_client_stub do - # Create client - client = ::Google::Cloud::SecretManager::V1::SecretManagerService::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - client.disable_secret_version({ name: name, etag: etag }) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use named arguments - client.disable_secret_version name: name, etag: etag do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object - client.disable_secret_version ::Google::Cloud::SecretManager::V1::DisableSecretVersionRequest.new(name: name, etag: etag) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use hash object with options - client.disable_secret_version({ name: name, etag: etag }, call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object with options - client.disable_secret_version(::Google::Cloud::SecretManager::V1::DisableSecretVersionRequest.new(name: name, etag: etag), call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Verify method calls - assert_equal 5, disable_secret_version_client_stub.call_count - end - end - end - - def test_enable_secret_version - # Create test objects. - client_result = ::Google::Cloud::SecretManager::V1::SecretVersion.new - http_response = OpenStruct.new body: client_result.to_json - - call_options = {} - - # Create request parameters for a unary method. - name = "hello world" - etag = "hello world" - - enable_secret_version_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| - assert options.metadata.key? :"x-goog-api-client" - assert options.metadata[:"x-goog-api-client"].include? "rest" - refute options.metadata[:"x-goog-api-client"].include? "grpc" - end - - ::Google::Cloud::SecretManager::V1::SecretManagerService::Rest::ServiceStub.stub :transcode_enable_secret_version_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, enable_secret_version_client_stub do - # Create client - client = ::Google::Cloud::SecretManager::V1::SecretManagerService::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - client.enable_secret_version({ name: name, etag: etag }) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use named arguments - client.enable_secret_version name: name, etag: etag do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object - client.enable_secret_version ::Google::Cloud::SecretManager::V1::EnableSecretVersionRequest.new(name: name, etag: etag) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use hash object with options - client.enable_secret_version({ name: name, etag: etag }, call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object with options - client.enable_secret_version(::Google::Cloud::SecretManager::V1::EnableSecretVersionRequest.new(name: name, etag: etag), call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Verify method calls - assert_equal 5, enable_secret_version_client_stub.call_count - end - end - end - - def test_destroy_secret_version - # Create test objects. - client_result = ::Google::Cloud::SecretManager::V1::SecretVersion.new - http_response = OpenStruct.new body: client_result.to_json - - call_options = {} - - # Create request parameters for a unary method. - name = "hello world" - etag = "hello world" - - destroy_secret_version_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| - assert options.metadata.key? :"x-goog-api-client" - assert options.metadata[:"x-goog-api-client"].include? "rest" - refute options.metadata[:"x-goog-api-client"].include? "grpc" - end - - ::Google::Cloud::SecretManager::V1::SecretManagerService::Rest::ServiceStub.stub :transcode_destroy_secret_version_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, destroy_secret_version_client_stub do - # Create client - client = ::Google::Cloud::SecretManager::V1::SecretManagerService::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - client.destroy_secret_version({ name: name, etag: etag }) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use named arguments - client.destroy_secret_version name: name, etag: etag do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object - client.destroy_secret_version ::Google::Cloud::SecretManager::V1::DestroySecretVersionRequest.new(name: name, etag: etag) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use hash object with options - client.destroy_secret_version({ name: name, etag: etag }, call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object with options - client.destroy_secret_version(::Google::Cloud::SecretManager::V1::DestroySecretVersionRequest.new(name: name, etag: etag), call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Verify method calls - assert_equal 5, destroy_secret_version_client_stub.call_count - end - end - end - - def test_set_iam_policy - # Create test objects. - client_result = ::Google::Iam::V1::Policy.new - http_response = OpenStruct.new body: client_result.to_json - - call_options = {} - - # Create request parameters for a unary method. - resource = "hello world" - policy = {} - update_mask = {} - - set_iam_policy_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| - assert options.metadata.key? :"x-goog-api-client" - assert options.metadata[:"x-goog-api-client"].include? "rest" - refute options.metadata[:"x-goog-api-client"].include? "grpc" - end - - ::Google::Cloud::SecretManager::V1::SecretManagerService::Rest::ServiceStub.stub :transcode_set_iam_policy_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, set_iam_policy_client_stub do - # Create client - client = ::Google::Cloud::SecretManager::V1::SecretManagerService::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - client.set_iam_policy({ resource: resource, policy: policy, update_mask: update_mask }) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use named arguments - client.set_iam_policy resource: resource, policy: policy, update_mask: update_mask do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object - client.set_iam_policy ::Google::Iam::V1::SetIamPolicyRequest.new(resource: resource, policy: policy, update_mask: update_mask) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use hash object with options - client.set_iam_policy({ resource: resource, policy: policy, update_mask: update_mask }, call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object with options - client.set_iam_policy(::Google::Iam::V1::SetIamPolicyRequest.new(resource: resource, policy: policy, update_mask: update_mask), call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Verify method calls - assert_equal 5, set_iam_policy_client_stub.call_count - end - end - end - - def test_get_iam_policy - # Create test objects. - client_result = ::Google::Iam::V1::Policy.new - http_response = OpenStruct.new body: client_result.to_json - - call_options = {} - - # Create request parameters for a unary method. - resource = "hello world" - options = {} - - get_iam_policy_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| - assert options.metadata.key? :"x-goog-api-client" - assert options.metadata[:"x-goog-api-client"].include? "rest" - refute options.metadata[:"x-goog-api-client"].include? "grpc" - end - - ::Google::Cloud::SecretManager::V1::SecretManagerService::Rest::ServiceStub.stub :transcode_get_iam_policy_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, get_iam_policy_client_stub do - # Create client - client = ::Google::Cloud::SecretManager::V1::SecretManagerService::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - client.get_iam_policy({ resource: resource, options: options }) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use named arguments - client.get_iam_policy resource: resource, options: options do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object - client.get_iam_policy ::Google::Iam::V1::GetIamPolicyRequest.new(resource: resource, options: options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use hash object with options - client.get_iam_policy({ resource: resource, options: options }, call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object with options - client.get_iam_policy(::Google::Iam::V1::GetIamPolicyRequest.new(resource: resource, options: options), call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Verify method calls - assert_equal 5, get_iam_policy_client_stub.call_count - end - end - end - - def test_test_iam_permissions - # Create test objects. - client_result = ::Google::Iam::V1::TestIamPermissionsResponse.new - http_response = OpenStruct.new body: client_result.to_json - - call_options = {} - - # Create request parameters for a unary method. - resource = "hello world" - permissions = ["hello world"] - - test_iam_permissions_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| - assert options.metadata.key? :"x-goog-api-client" - assert options.metadata[:"x-goog-api-client"].include? "rest" - refute options.metadata[:"x-goog-api-client"].include? "grpc" - end - - ::Google::Cloud::SecretManager::V1::SecretManagerService::Rest::ServiceStub.stub :transcode_test_iam_permissions_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, test_iam_permissions_client_stub do - # Create client - client = ::Google::Cloud::SecretManager::V1::SecretManagerService::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - client.test_iam_permissions({ resource: resource, permissions: permissions }) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use named arguments - client.test_iam_permissions resource: resource, permissions: permissions do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object - client.test_iam_permissions ::Google::Iam::V1::TestIamPermissionsRequest.new(resource: resource, permissions: permissions) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use hash object with options - client.test_iam_permissions({ resource: resource, permissions: permissions }, call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object with options - client.test_iam_permissions(::Google::Iam::V1::TestIamPermissionsRequest.new(resource: resource, permissions: permissions), call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Verify method calls - assert_equal 5, test_iam_permissions_client_stub.call_count - end - end - end - - def test_configure - credentials_token = :dummy_value - - client = block_config = config = nil - dummy_stub = ClientStub.new nil - Gapic::Rest::ClientStub.stub :new, dummy_stub do - client = ::Google::Cloud::SecretManager::V1::SecretManagerService::Rest::Client.new do |config| - config.credentials = credentials_token - end - end - - config = client.configure do |c| - block_config = c - end - - assert_same block_config, config - assert_kind_of ::Google::Cloud::SecretManager::V1::SecretManagerService::Rest::Client::Configuration, config - end -end diff --git a/owl-bot-staging/google-cloud-secret_manager-v1/test/google/cloud/secret_manager/v1/secret_manager_service_test.rb b/owl-bot-staging/google-cloud-secret_manager-v1/test/google/cloud/secret_manager/v1/secret_manager_service_test.rb deleted file mode 100644 index abcfa4a56894..000000000000 --- a/owl-bot-staging/google-cloud-secret_manager-v1/test/google/cloud/secret_manager/v1/secret_manager_service_test.rb +++ /dev/null @@ -1,1020 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -require "helper" - -require "gapic/grpc/service_stub" - -require "google/cloud/secretmanager/v1/service_pb" -require "google/cloud/secret_manager/v1/secret_manager_service" - -class ::Google::Cloud::SecretManager::V1::SecretManagerService::ClientTest < Minitest::Test - class ClientStub - attr_accessor :call_rpc_count, :requests - - def initialize response, operation, &block - @response = response - @operation = operation - @block = block - @call_rpc_count = 0 - @requests = [] - end - - def call_rpc *args, **kwargs - @call_rpc_count += 1 - - @requests << @block&.call(*args, **kwargs) - - catch :response do - yield @response, @operation if block_given? - @response - end - end - - def endpoint - "endpoint.example.com" - end - - def universe_domain - "example.com" - end - - def stub_logger - nil - end - - def logger - nil - end - end - - def test_list_secrets - # Create GRPC objects. - grpc_response = ::Google::Cloud::SecretManager::V1::ListSecretsResponse.new - grpc_operation = GRPC::ActiveCall::Operation.new nil - grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - grpc_options = {} - - # Create request parameters for a unary method. - parent = "hello world" - page_size = 42 - page_token = "hello world" - filter = "hello world" - - list_secrets_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :list_secrets, name - assert_kind_of ::Google::Cloud::SecretManager::V1::ListSecretsRequest, request - assert_equal "hello world", request["parent"] - assert_equal 42, request["page_size"] - assert_equal "hello world", request["page_token"] - assert_equal "hello world", request["filter"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, list_secrets_client_stub do - # Create client - client = ::Google::Cloud::SecretManager::V1::SecretManagerService::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.list_secrets({ parent: parent, page_size: page_size, page_token: page_token, filter: filter }) do |response, operation| - assert_kind_of Gapic::PagedEnumerable, response - assert_equal grpc_response, response.response - assert_equal grpc_operation, operation - end - - # Use named arguments - client.list_secrets parent: parent, page_size: page_size, page_token: page_token, filter: filter do |response, operation| - assert_kind_of Gapic::PagedEnumerable, response - assert_equal grpc_response, response.response - assert_equal grpc_operation, operation - end - - # Use protobuf object - client.list_secrets ::Google::Cloud::SecretManager::V1::ListSecretsRequest.new(parent: parent, page_size: page_size, page_token: page_token, filter: filter) do |response, operation| - assert_kind_of Gapic::PagedEnumerable, response - assert_equal grpc_response, response.response - assert_equal grpc_operation, operation - end - - # Use hash object with options - client.list_secrets({ parent: parent, page_size: page_size, page_token: page_token, filter: filter }, grpc_options) do |response, operation| - assert_kind_of Gapic::PagedEnumerable, response - assert_equal grpc_response, response.response - assert_equal grpc_operation, operation - end - - # Use protobuf object with options - client.list_secrets(::Google::Cloud::SecretManager::V1::ListSecretsRequest.new(parent: parent, page_size: page_size, page_token: page_token, filter: filter), grpc_options) do |response, operation| - assert_kind_of Gapic::PagedEnumerable, response - assert_equal grpc_response, response.response - assert_equal grpc_operation, operation - end - - # Verify method calls - assert_equal 5, list_secrets_client_stub.call_rpc_count - end - end - - def test_create_secret - # Create GRPC objects. - grpc_response = ::Google::Cloud::SecretManager::V1::Secret.new - grpc_operation = GRPC::ActiveCall::Operation.new nil - grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - grpc_options = {} - - # Create request parameters for a unary method. - parent = "hello world" - secret_id = "hello world" - secret = {} - - create_secret_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :create_secret, name - assert_kind_of ::Google::Cloud::SecretManager::V1::CreateSecretRequest, request - assert_equal "hello world", request["parent"] - assert_equal "hello world", request["secret_id"] - assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::SecretManager::V1::Secret), request["secret"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, create_secret_client_stub do - # Create client - client = ::Google::Cloud::SecretManager::V1::SecretManagerService::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.create_secret({ parent: parent, secret_id: secret_id, secret: secret }) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use named arguments - client.create_secret parent: parent, secret_id: secret_id, secret: secret do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object - client.create_secret ::Google::Cloud::SecretManager::V1::CreateSecretRequest.new(parent: parent, secret_id: secret_id, secret: secret) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use hash object with options - client.create_secret({ parent: parent, secret_id: secret_id, secret: secret }, grpc_options) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object with options - client.create_secret(::Google::Cloud::SecretManager::V1::CreateSecretRequest.new(parent: parent, secret_id: secret_id, secret: secret), grpc_options) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Verify method calls - assert_equal 5, create_secret_client_stub.call_rpc_count - end - end - - def test_add_secret_version - # Create GRPC objects. - grpc_response = ::Google::Cloud::SecretManager::V1::SecretVersion.new - grpc_operation = GRPC::ActiveCall::Operation.new nil - grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - grpc_options = {} - - # Create request parameters for a unary method. - parent = "hello world" - payload = {} - - add_secret_version_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :add_secret_version, name - assert_kind_of ::Google::Cloud::SecretManager::V1::AddSecretVersionRequest, request - assert_equal "hello world", request["parent"] - assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::SecretManager::V1::SecretPayload), request["payload"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, add_secret_version_client_stub do - # Create client - client = ::Google::Cloud::SecretManager::V1::SecretManagerService::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.add_secret_version({ parent: parent, payload: payload }) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use named arguments - client.add_secret_version parent: parent, payload: payload do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object - client.add_secret_version ::Google::Cloud::SecretManager::V1::AddSecretVersionRequest.new(parent: parent, payload: payload) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use hash object with options - client.add_secret_version({ parent: parent, payload: payload }, grpc_options) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object with options - client.add_secret_version(::Google::Cloud::SecretManager::V1::AddSecretVersionRequest.new(parent: parent, payload: payload), grpc_options) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Verify method calls - assert_equal 5, add_secret_version_client_stub.call_rpc_count - end - end - - def test_get_secret - # Create GRPC objects. - grpc_response = ::Google::Cloud::SecretManager::V1::Secret.new - grpc_operation = GRPC::ActiveCall::Operation.new nil - grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - grpc_options = {} - - # Create request parameters for a unary method. - name = "hello world" - - get_secret_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :get_secret, name - assert_kind_of ::Google::Cloud::SecretManager::V1::GetSecretRequest, request - assert_equal "hello world", request["name"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, get_secret_client_stub do - # Create client - client = ::Google::Cloud::SecretManager::V1::SecretManagerService::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.get_secret({ name: name }) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use named arguments - client.get_secret name: name do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object - client.get_secret ::Google::Cloud::SecretManager::V1::GetSecretRequest.new(name: name) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use hash object with options - client.get_secret({ name: name }, grpc_options) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object with options - client.get_secret(::Google::Cloud::SecretManager::V1::GetSecretRequest.new(name: name), grpc_options) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Verify method calls - assert_equal 5, get_secret_client_stub.call_rpc_count - end - end - - def test_update_secret - # Create GRPC objects. - grpc_response = ::Google::Cloud::SecretManager::V1::Secret.new - grpc_operation = GRPC::ActiveCall::Operation.new nil - grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - grpc_options = {} - - # Create request parameters for a unary method. - secret = {} - update_mask = {} - - update_secret_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :update_secret, name - assert_kind_of ::Google::Cloud::SecretManager::V1::UpdateSecretRequest, request - assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::SecretManager::V1::Secret), request["secret"] - assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Protobuf::FieldMask), request["update_mask"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, update_secret_client_stub do - # Create client - client = ::Google::Cloud::SecretManager::V1::SecretManagerService::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.update_secret({ secret: secret, update_mask: update_mask }) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use named arguments - client.update_secret secret: secret, update_mask: update_mask do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object - client.update_secret ::Google::Cloud::SecretManager::V1::UpdateSecretRequest.new(secret: secret, update_mask: update_mask) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use hash object with options - client.update_secret({ secret: secret, update_mask: update_mask }, grpc_options) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object with options - client.update_secret(::Google::Cloud::SecretManager::V1::UpdateSecretRequest.new(secret: secret, update_mask: update_mask), grpc_options) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Verify method calls - assert_equal 5, update_secret_client_stub.call_rpc_count - end - end - - def test_delete_secret - # Create GRPC objects. - grpc_response = ::Google::Protobuf::Empty.new - grpc_operation = GRPC::ActiveCall::Operation.new nil - grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - grpc_options = {} - - # Create request parameters for a unary method. - name = "hello world" - etag = "hello world" - - delete_secret_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :delete_secret, name - assert_kind_of ::Google::Cloud::SecretManager::V1::DeleteSecretRequest, request - assert_equal "hello world", request["name"] - assert_equal "hello world", request["etag"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, delete_secret_client_stub do - # Create client - client = ::Google::Cloud::SecretManager::V1::SecretManagerService::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.delete_secret({ name: name, etag: etag }) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use named arguments - client.delete_secret name: name, etag: etag do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object - client.delete_secret ::Google::Cloud::SecretManager::V1::DeleteSecretRequest.new(name: name, etag: etag) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use hash object with options - client.delete_secret({ name: name, etag: etag }, grpc_options) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object with options - client.delete_secret(::Google::Cloud::SecretManager::V1::DeleteSecretRequest.new(name: name, etag: etag), grpc_options) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Verify method calls - assert_equal 5, delete_secret_client_stub.call_rpc_count - end - end - - def test_list_secret_versions - # Create GRPC objects. - grpc_response = ::Google::Cloud::SecretManager::V1::ListSecretVersionsResponse.new - grpc_operation = GRPC::ActiveCall::Operation.new nil - grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - grpc_options = {} - - # Create request parameters for a unary method. - parent = "hello world" - page_size = 42 - page_token = "hello world" - filter = "hello world" - - list_secret_versions_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :list_secret_versions, name - assert_kind_of ::Google::Cloud::SecretManager::V1::ListSecretVersionsRequest, request - assert_equal "hello world", request["parent"] - assert_equal 42, request["page_size"] - assert_equal "hello world", request["page_token"] - assert_equal "hello world", request["filter"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, list_secret_versions_client_stub do - # Create client - client = ::Google::Cloud::SecretManager::V1::SecretManagerService::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.list_secret_versions({ parent: parent, page_size: page_size, page_token: page_token, filter: filter }) do |response, operation| - assert_kind_of Gapic::PagedEnumerable, response - assert_equal grpc_response, response.response - assert_equal grpc_operation, operation - end - - # Use named arguments - client.list_secret_versions parent: parent, page_size: page_size, page_token: page_token, filter: filter do |response, operation| - assert_kind_of Gapic::PagedEnumerable, response - assert_equal grpc_response, response.response - assert_equal grpc_operation, operation - end - - # Use protobuf object - client.list_secret_versions ::Google::Cloud::SecretManager::V1::ListSecretVersionsRequest.new(parent: parent, page_size: page_size, page_token: page_token, filter: filter) do |response, operation| - assert_kind_of Gapic::PagedEnumerable, response - assert_equal grpc_response, response.response - assert_equal grpc_operation, operation - end - - # Use hash object with options - client.list_secret_versions({ parent: parent, page_size: page_size, page_token: page_token, filter: filter }, grpc_options) do |response, operation| - assert_kind_of Gapic::PagedEnumerable, response - assert_equal grpc_response, response.response - assert_equal grpc_operation, operation - end - - # Use protobuf object with options - client.list_secret_versions(::Google::Cloud::SecretManager::V1::ListSecretVersionsRequest.new(parent: parent, page_size: page_size, page_token: page_token, filter: filter), grpc_options) do |response, operation| - assert_kind_of Gapic::PagedEnumerable, response - assert_equal grpc_response, response.response - assert_equal grpc_operation, operation - end - - # Verify method calls - assert_equal 5, list_secret_versions_client_stub.call_rpc_count - end - end - - def test_get_secret_version - # Create GRPC objects. - grpc_response = ::Google::Cloud::SecretManager::V1::SecretVersion.new - grpc_operation = GRPC::ActiveCall::Operation.new nil - grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - grpc_options = {} - - # Create request parameters for a unary method. - name = "hello world" - - get_secret_version_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :get_secret_version, name - assert_kind_of ::Google::Cloud::SecretManager::V1::GetSecretVersionRequest, request - assert_equal "hello world", request["name"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, get_secret_version_client_stub do - # Create client - client = ::Google::Cloud::SecretManager::V1::SecretManagerService::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.get_secret_version({ name: name }) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use named arguments - client.get_secret_version name: name do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object - client.get_secret_version ::Google::Cloud::SecretManager::V1::GetSecretVersionRequest.new(name: name) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use hash object with options - client.get_secret_version({ name: name }, grpc_options) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object with options - client.get_secret_version(::Google::Cloud::SecretManager::V1::GetSecretVersionRequest.new(name: name), grpc_options) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Verify method calls - assert_equal 5, get_secret_version_client_stub.call_rpc_count - end - end - - def test_access_secret_version - # Create GRPC objects. - grpc_response = ::Google::Cloud::SecretManager::V1::AccessSecretVersionResponse.new - grpc_operation = GRPC::ActiveCall::Operation.new nil - grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - grpc_options = {} - - # Create request parameters for a unary method. - name = "hello world" - - access_secret_version_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :access_secret_version, name - assert_kind_of ::Google::Cloud::SecretManager::V1::AccessSecretVersionRequest, request - assert_equal "hello world", request["name"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, access_secret_version_client_stub do - # Create client - client = ::Google::Cloud::SecretManager::V1::SecretManagerService::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.access_secret_version({ name: name }) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use named arguments - client.access_secret_version name: name do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object - client.access_secret_version ::Google::Cloud::SecretManager::V1::AccessSecretVersionRequest.new(name: name) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use hash object with options - client.access_secret_version({ name: name }, grpc_options) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object with options - client.access_secret_version(::Google::Cloud::SecretManager::V1::AccessSecretVersionRequest.new(name: name), grpc_options) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Verify method calls - assert_equal 5, access_secret_version_client_stub.call_rpc_count - end - end - - def test_disable_secret_version - # Create GRPC objects. - grpc_response = ::Google::Cloud::SecretManager::V1::SecretVersion.new - grpc_operation = GRPC::ActiveCall::Operation.new nil - grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - grpc_options = {} - - # Create request parameters for a unary method. - name = "hello world" - etag = "hello world" - - disable_secret_version_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :disable_secret_version, name - assert_kind_of ::Google::Cloud::SecretManager::V1::DisableSecretVersionRequest, request - assert_equal "hello world", request["name"] - assert_equal "hello world", request["etag"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, disable_secret_version_client_stub do - # Create client - client = ::Google::Cloud::SecretManager::V1::SecretManagerService::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.disable_secret_version({ name: name, etag: etag }) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use named arguments - client.disable_secret_version name: name, etag: etag do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object - client.disable_secret_version ::Google::Cloud::SecretManager::V1::DisableSecretVersionRequest.new(name: name, etag: etag) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use hash object with options - client.disable_secret_version({ name: name, etag: etag }, grpc_options) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object with options - client.disable_secret_version(::Google::Cloud::SecretManager::V1::DisableSecretVersionRequest.new(name: name, etag: etag), grpc_options) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Verify method calls - assert_equal 5, disable_secret_version_client_stub.call_rpc_count - end - end - - def test_enable_secret_version - # Create GRPC objects. - grpc_response = ::Google::Cloud::SecretManager::V1::SecretVersion.new - grpc_operation = GRPC::ActiveCall::Operation.new nil - grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - grpc_options = {} - - # Create request parameters for a unary method. - name = "hello world" - etag = "hello world" - - enable_secret_version_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :enable_secret_version, name - assert_kind_of ::Google::Cloud::SecretManager::V1::EnableSecretVersionRequest, request - assert_equal "hello world", request["name"] - assert_equal "hello world", request["etag"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, enable_secret_version_client_stub do - # Create client - client = ::Google::Cloud::SecretManager::V1::SecretManagerService::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.enable_secret_version({ name: name, etag: etag }) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use named arguments - client.enable_secret_version name: name, etag: etag do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object - client.enable_secret_version ::Google::Cloud::SecretManager::V1::EnableSecretVersionRequest.new(name: name, etag: etag) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use hash object with options - client.enable_secret_version({ name: name, etag: etag }, grpc_options) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object with options - client.enable_secret_version(::Google::Cloud::SecretManager::V1::EnableSecretVersionRequest.new(name: name, etag: etag), grpc_options) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Verify method calls - assert_equal 5, enable_secret_version_client_stub.call_rpc_count - end - end - - def test_destroy_secret_version - # Create GRPC objects. - grpc_response = ::Google::Cloud::SecretManager::V1::SecretVersion.new - grpc_operation = GRPC::ActiveCall::Operation.new nil - grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - grpc_options = {} - - # Create request parameters for a unary method. - name = "hello world" - etag = "hello world" - - destroy_secret_version_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :destroy_secret_version, name - assert_kind_of ::Google::Cloud::SecretManager::V1::DestroySecretVersionRequest, request - assert_equal "hello world", request["name"] - assert_equal "hello world", request["etag"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, destroy_secret_version_client_stub do - # Create client - client = ::Google::Cloud::SecretManager::V1::SecretManagerService::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.destroy_secret_version({ name: name, etag: etag }) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use named arguments - client.destroy_secret_version name: name, etag: etag do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object - client.destroy_secret_version ::Google::Cloud::SecretManager::V1::DestroySecretVersionRequest.new(name: name, etag: etag) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use hash object with options - client.destroy_secret_version({ name: name, etag: etag }, grpc_options) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object with options - client.destroy_secret_version(::Google::Cloud::SecretManager::V1::DestroySecretVersionRequest.new(name: name, etag: etag), grpc_options) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Verify method calls - assert_equal 5, destroy_secret_version_client_stub.call_rpc_count - end - end - - def test_set_iam_policy - # Create GRPC objects. - grpc_response = ::Google::Iam::V1::Policy.new - grpc_operation = GRPC::ActiveCall::Operation.new nil - grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - grpc_options = {} - - # Create request parameters for a unary method. - resource = "hello world" - policy = {} - update_mask = {} - - set_iam_policy_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :set_iam_policy, name - assert_kind_of ::Google::Iam::V1::SetIamPolicyRequest, request - assert_equal "hello world", request["resource"] - assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Iam::V1::Policy), request["policy"] - assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Protobuf::FieldMask), request["update_mask"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, set_iam_policy_client_stub do - # Create client - client = ::Google::Cloud::SecretManager::V1::SecretManagerService::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.set_iam_policy({ resource: resource, policy: policy, update_mask: update_mask }) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use named arguments - client.set_iam_policy resource: resource, policy: policy, update_mask: update_mask do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object - client.set_iam_policy ::Google::Iam::V1::SetIamPolicyRequest.new(resource: resource, policy: policy, update_mask: update_mask) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use hash object with options - client.set_iam_policy({ resource: resource, policy: policy, update_mask: update_mask }, grpc_options) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object with options - client.set_iam_policy(::Google::Iam::V1::SetIamPolicyRequest.new(resource: resource, policy: policy, update_mask: update_mask), grpc_options) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Verify method calls - assert_equal 5, set_iam_policy_client_stub.call_rpc_count - end - end - - def test_get_iam_policy - # Create GRPC objects. - grpc_response = ::Google::Iam::V1::Policy.new - grpc_operation = GRPC::ActiveCall::Operation.new nil - grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - grpc_options = {} - - # Create request parameters for a unary method. - resource = "hello world" - options = {} - - get_iam_policy_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :get_iam_policy, name - assert_kind_of ::Google::Iam::V1::GetIamPolicyRequest, request - assert_equal "hello world", request["resource"] - assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Iam::V1::GetPolicyOptions), request["options"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, get_iam_policy_client_stub do - # Create client - client = ::Google::Cloud::SecretManager::V1::SecretManagerService::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.get_iam_policy({ resource: resource, options: options }) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use named arguments - client.get_iam_policy resource: resource, options: options do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object - client.get_iam_policy ::Google::Iam::V1::GetIamPolicyRequest.new(resource: resource, options: options) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use hash object with options - client.get_iam_policy({ resource: resource, options: options }, grpc_options) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object with options - client.get_iam_policy(::Google::Iam::V1::GetIamPolicyRequest.new(resource: resource, options: options), grpc_options) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Verify method calls - assert_equal 5, get_iam_policy_client_stub.call_rpc_count - end - end - - def test_test_iam_permissions - # Create GRPC objects. - grpc_response = ::Google::Iam::V1::TestIamPermissionsResponse.new - grpc_operation = GRPC::ActiveCall::Operation.new nil - grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - grpc_options = {} - - # Create request parameters for a unary method. - resource = "hello world" - permissions = ["hello world"] - - test_iam_permissions_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :test_iam_permissions, name - assert_kind_of ::Google::Iam::V1::TestIamPermissionsRequest, request - assert_equal "hello world", request["resource"] - assert_equal ["hello world"], request["permissions"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, test_iam_permissions_client_stub do - # Create client - client = ::Google::Cloud::SecretManager::V1::SecretManagerService::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.test_iam_permissions({ resource: resource, permissions: permissions }) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use named arguments - client.test_iam_permissions resource: resource, permissions: permissions do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object - client.test_iam_permissions ::Google::Iam::V1::TestIamPermissionsRequest.new(resource: resource, permissions: permissions) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use hash object with options - client.test_iam_permissions({ resource: resource, permissions: permissions }, grpc_options) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object with options - client.test_iam_permissions(::Google::Iam::V1::TestIamPermissionsRequest.new(resource: resource, permissions: permissions), grpc_options) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Verify method calls - assert_equal 5, test_iam_permissions_client_stub.call_rpc_count - end - end - - def test_configure - grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - - client = block_config = config = nil - dummy_stub = ClientStub.new nil, nil - Gapic::ServiceStub.stub :new, dummy_stub do - client = ::Google::Cloud::SecretManager::V1::SecretManagerService::Client.new do |config| - config.credentials = grpc_channel - end - end - - config = client.configure do |c| - block_config = c - end - - assert_same block_config, config - assert_kind_of ::Google::Cloud::SecretManager::V1::SecretManagerService::Client::Configuration, config - end - - def test_credentials - key = OpenSSL::PKey::RSA.new 2048 - cred_json = { - "private_key" => key.to_pem, - "client_email" => "app@developer.gserviceaccount.com", - "type" => "service_account" - } - key_file = StringIO.new cred_json.to_json - creds = Google::Auth::ServiceAccountCredentials.make_creds({ json_key_io: key_file }) - - dummy_stub = ClientStub.new nil, nil - Gapic::ServiceStub.stub :new, dummy_stub do - client = ::Google::Cloud::SecretManager::V1::SecretManagerService::Client.new do |config| - config.credentials = creds - end - assert_kind_of ::Google::Cloud::SecretManager::V1::SecretManagerService::Client, client - assert_equal creds, client.configure.credentials - end - end -end diff --git a/owl-bot-staging/google-cloud-secret_manager-v1/test/helper.rb b/owl-bot-staging/google-cloud-secret_manager-v1/test/helper.rb deleted file mode 100644 index 672b337030e7..000000000000 --- a/owl-bot-staging/google-cloud-secret_manager-v1/test/helper.rb +++ /dev/null @@ -1,26 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -require "minitest/autorun" -require "minitest/focus" -require "minitest/mock" -require "minitest/rg" - -require "grpc" - -require "ostruct" diff --git a/owl-bot-staging/google-cloud-secret_manager-v1beta1/.gitignore b/owl-bot-staging/google-cloud-secret_manager-v1beta1/.gitignore deleted file mode 100644 index 0135b6bc6cfc..000000000000 --- a/owl-bot-staging/google-cloud-secret_manager-v1beta1/.gitignore +++ /dev/null @@ -1,22 +0,0 @@ -# Ignore bundler lockfiles -Gemfile.lock -gems.locked - -# Ignore documentation output -doc/* -.yardoc/* - -# Ignore test output -coverage/* - -# Ignore build artifacts -pkg/* - -# Ignore files commonly present in certain dev environments -.vagrant -.DS_STORE -.idea -*.iml - -# Ignore synth output -__pycache__ diff --git a/owl-bot-staging/google-cloud-secret_manager-v1beta1/.repo-metadata.json b/owl-bot-staging/google-cloud-secret_manager-v1beta1/.repo-metadata.json deleted file mode 100644 index bae754636e19..000000000000 --- a/owl-bot-staging/google-cloud-secret_manager-v1beta1/.repo-metadata.json +++ /dev/null @@ -1,18 +0,0 @@ -{ - "api_id": "secretmanager.googleapis.com", - "api_shortname": "secretmanager", - "client_documentation": "https://cloud.google.com/ruby/docs/reference/google-cloud-secret_manager-v1beta1/latest", - "distribution_name": "google-cloud-secret_manager-v1beta1", - "is_cloud": true, - "language": "ruby", - "name": "secretmanager", - "name_pretty": "Secret Manager V1beta1 API", - "product_documentation": "https://cloud.google.com/secret-manager", - "release_level": "unreleased", - "repo": "googleapis/google-cloud-ruby", - "requires_billing": true, - "ruby-cloud-description": "Secret Manager is a secure and convenient storage system for API keys, passwords, certificates, and other sensitive data. Secret Manager provides a central place and single source of truth to manage, access, and audit secrets across Google Cloud. Note that google-cloud-secret_manager-v1beta1 is a version-specific client library. For most uses, we recommend installing the main client library google-cloud-secret_manager instead. See the readme for more details.", - "ruby-cloud-env-prefix": "SECRET_MANAGER", - "ruby-cloud-product-url": "https://cloud.google.com/secret-manager", - "library_type": "GAPIC_AUTO" -} diff --git a/owl-bot-staging/google-cloud-secret_manager-v1beta1/.rubocop.yml b/owl-bot-staging/google-cloud-secret_manager-v1beta1/.rubocop.yml deleted file mode 100644 index 7f3f3a64f5cf..000000000000 --- a/owl-bot-staging/google-cloud-secret_manager-v1beta1/.rubocop.yml +++ /dev/null @@ -1,33 +0,0 @@ -inherit_gem: - google-style: google-style.yml - -AllCops: - Exclude: - - "google-cloud-secret_manager-v1beta1.gemspec" - - "lib/**/*_pb.rb" - - "proto_docs/**/*" - - "test/**/*" - - "acceptance/**/*" - - "samples/acceptance/**/*" - - "Rakefile" - -Layout/LineLength: - Enabled: false -Metrics/AbcSize: - Enabled: false -Metrics/ClassLength: - Enabled: false -Metrics/CyclomaticComplexity: - Enabled: false -Metrics/MethodLength: - Enabled: false -Metrics/ModuleLength: - Enabled: false -Metrics/PerceivedComplexity: - Enabled: false -Naming/AccessorMethodName: - Exclude: - - "snippets/**/*.rb" -Naming/FileName: - Exclude: - - "lib/google-cloud-secret_manager-v1beta1.rb" diff --git a/owl-bot-staging/google-cloud-secret_manager-v1beta1/.toys.rb b/owl-bot-staging/google-cloud-secret_manager-v1beta1/.toys.rb deleted file mode 100644 index 177e22456e8a..000000000000 --- a/owl-bot-staging/google-cloud-secret_manager-v1beta1/.toys.rb +++ /dev/null @@ -1,28 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -toys_version! ">= 0.15.3" - -if ENV["RUBY_COMMON_TOOLS"] - common_tools_dir = File.expand_path ENV["RUBY_COMMON_TOOLS"] - load File.join(common_tools_dir, "toys", "gapic") -else - load_git remote: "https://github.com/googleapis/ruby-common-tools.git", - path: "toys/gapic", - update: true -end diff --git a/owl-bot-staging/google-cloud-secret_manager-v1beta1/.yardopts b/owl-bot-staging/google-cloud-secret_manager-v1beta1/.yardopts deleted file mode 100644 index 78441fd84b43..000000000000 --- a/owl-bot-staging/google-cloud-secret_manager-v1beta1/.yardopts +++ /dev/null @@ -1,12 +0,0 @@ ---no-private ---title="Secret Manager V1beta1 API" ---exclude _pb\.rb$ ---markup markdown ---markup-provider redcarpet - -./lib/**/*.rb -./proto_docs/**/*.rb -- -README.md -LICENSE.md -AUTHENTICATION.md diff --git a/owl-bot-staging/google-cloud-secret_manager-v1beta1/AUTHENTICATION.md b/owl-bot-staging/google-cloud-secret_manager-v1beta1/AUTHENTICATION.md deleted file mode 100644 index 755a69b7bf72..000000000000 --- a/owl-bot-staging/google-cloud-secret_manager-v1beta1/AUTHENTICATION.md +++ /dev/null @@ -1,122 +0,0 @@ -# Authentication - -The recommended way to authenticate to the google-cloud-secret_manager-v1beta1 library is to use -[Application Default Credentials (ADC)](https://cloud.google.com/docs/authentication/application-default-credentials). -To review all of your authentication options, see [Credentials lookup](#credential-lookup). - -## Quickstart - -The following example shows how to set up authentication for a local development -environment with your user credentials. - -**NOTE:** This method is _not_ recommended for running in production. User credentials -should be used only during development. - -1. [Download and install the Google Cloud CLI](https://cloud.google.com/sdk). -2. Set up a local ADC file with your user credentials: - -```sh -gcloud auth application-default login -``` - -3. Write code as if already authenticated. - -For more information about setting up authentication for a local development environment, see -[Set up Application Default Credentials](https://cloud.google.com/docs/authentication/provide-credentials-adc#local-dev). - -## Credential Lookup - -The google-cloud-secret_manager-v1beta1 library provides several mechanisms to configure your system. -Generally, using Application Default Credentials to facilitate automatic -credentials discovery is the easist method. But if you need to explicitly specify -credentials, there are several methods available to you. - -Credentials are accepted in the following ways, in the following order or precedence: - -1. Credentials specified in method arguments -2. Credentials specified in configuration -3. Credentials pointed to or included in environment variables -4. Credentials found in local ADC file -5. Credentials returned by the metadata server for the attached service account (GCP) - -### Configuration - -You can configure a path to a JSON credentials file, either for an individual client object or -globally, for all client objects. The JSON file can contain credentials created for -[workload identity federation](https://cloud.google.com/iam/docs/workload-identity-federation), -[workforce identity federation](https://cloud.google.com/iam/docs/workforce-identity-federation), or a -[service account key](https://cloud.google.com/docs/authentication/provide-credentials-adc#local-key). - -Note: Service account keys are a security risk if not managed correctly. You should -[choose a more secure alternative to service account keys](https://cloud.google.com/docs/authentication#auth-decision-tree) -whenever possible. - -To configure a credentials file for an individual client initialization: - -```ruby -require "google/cloud/secret_manager/v1beta1" - -client = ::Google::Cloud::SecretManager::V1beta1::SecretManagerService::Client.new do |config| - config.credentials = "path/to/credentialfile.json" -end -``` - -To configure a credentials file globally for all clients: - -```ruby -require "google/cloud/secret_manager/v1beta1" - -::Google::Cloud::SecretManager::V1beta1::SecretManagerService::Client.configure do |config| - config.credentials = "path/to/credentialfile.json" -end - -client = ::Google::Cloud::SecretManager::V1beta1::SecretManagerService::Client.new -``` - -### Environment Variables - -You can also use an environment variable to provide a JSON credentials file. -The environment variable can contain a path to the credentials file or, for -environments such as Docker containers where writing files is not encouraged, -you can include the credentials file itself. - -The JSON file can contain credentials created for -[workload identity federation](https://cloud.google.com/iam/docs/workload-identity-federation), -[workforce identity federation](https://cloud.google.com/iam/docs/workforce-identity-federation), or a -[service account key](https://cloud.google.com/docs/authentication/provide-credentials-adc#local-key). - -Note: Service account keys are a security risk if not managed correctly. You should -[choose a more secure alternative to service account keys](https://cloud.google.com/docs/authentication#auth-decision-tree) -whenever possible. - -The environment variables that google-cloud-secret_manager-v1beta1 -checks for credentials are: - -* `GOOGLE_CLOUD_CREDENTIALS` - Path to JSON file, or JSON contents -* `GOOGLE_APPLICATION_CREDENTIALS` - Path to JSON file - -```ruby -require "google/cloud/secret_manager/v1beta1" - -ENV["GOOGLE_APPLICATION_CREDENTIALS"] = "path/to/credentialfile.json" - -client = ::Google::Cloud::SecretManager::V1beta1::SecretManagerService::Client.new -``` - -### Local ADC file - -You can set up a local ADC file with your user credentials for authentication during -development. If credentials are not provided in code or in environment variables, -then the local ADC credentials are discovered. - -Follow the steps in [Quickstart](#quickstart) to set up a local ADC file. - -### Google Cloud Platform environments - -When running on Google Cloud Platform (GCP), including Google Compute Engine -(GCE), Google Kubernetes Engine (GKE), Google App Engine (GAE), Google Cloud -Functions (GCF) and Cloud Run, credentials are retrieved from the attached -service account automatically. Code should be written as if already authenticated. - -For more information, see -[Set up ADC for Google Cloud services](https://cloud.google.com/docs/authentication/provide-credentials-adc#attached-sa). diff --git a/owl-bot-staging/google-cloud-secret_manager-v1beta1/CHANGELOG.md b/owl-bot-staging/google-cloud-secret_manager-v1beta1/CHANGELOG.md deleted file mode 100644 index f88957a62ba2..000000000000 --- a/owl-bot-staging/google-cloud-secret_manager-v1beta1/CHANGELOG.md +++ /dev/null @@ -1,2 +0,0 @@ -# Release History - diff --git a/owl-bot-staging/google-cloud-secret_manager-v1beta1/Gemfile b/owl-bot-staging/google-cloud-secret_manager-v1beta1/Gemfile deleted file mode 100644 index 1d08558908d8..000000000000 --- a/owl-bot-staging/google-cloud-secret_manager-v1beta1/Gemfile +++ /dev/null @@ -1,14 +0,0 @@ -source "https://rubygems.org" - -gemspec - -gem "google-style", "~> 1.32.0" -gem "irb", "~> 1.17" -gem "minitest", "~> 6.0.2" -gem "minitest-focus", "~> 1.4" -gem "minitest-mock", "~> 5.27" -gem "minitest-rg", "~> 5.3" -gem "ostruct", "~> 0.5.5" -gem "rake", ">= 13.0" -gem "redcarpet", "~> 3.6" -gem "yard", "~> 0.9" diff --git a/owl-bot-staging/google-cloud-secret_manager-v1beta1/LICENSE.md b/owl-bot-staging/google-cloud-secret_manager-v1beta1/LICENSE.md deleted file mode 100644 index c261857ba6ad..000000000000 --- a/owl-bot-staging/google-cloud-secret_manager-v1beta1/LICENSE.md +++ /dev/null @@ -1,201 +0,0 @@ - Apache License - Version 2.0, January 2004 - http://www.apache.org/licenses/ - - TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION - - 1. Definitions. - - "License" shall mean the terms and conditions for use, reproduction, - and distribution as defined by Sections 1 through 9 of this document. - - "Licensor" shall mean the copyright owner or entity authorized by - the copyright owner that is granting the License. - - "Legal Entity" shall mean the union of the acting entity and all - other entities that control, are controlled by, or are under common - control with that entity. For the purposes of this definition, - "control" means (i) the power, direct or indirect, to cause the - direction or management of such entity, whether by contract or - otherwise, or (ii) ownership of fifty percent (50%) or more of the - outstanding shares, or (iii) beneficial ownership of such entity. - - "You" (or "Your") shall mean an individual or Legal Entity - exercising permissions granted by this License. - - "Source" form shall mean the preferred form for making modifications, - including but not limited to software source code, documentation - source, and configuration files. - - "Object" form shall mean any form resulting from mechanical - transformation or translation of a Source form, including but - not limited to compiled object code, generated documentation, - and conversions to other media types. - - "Work" shall mean the work of authorship, whether in Source or - Object form, made available under the License, as indicated by a - copyright notice that is included in or attached to the work - (an example is provided in the Appendix below). - - "Derivative Works" shall mean any work, whether in Source or Object - form, that is based on (or derived from) the Work and for which the - editorial revisions, annotations, elaborations, or other modifications - represent, as a whole, an original work of authorship. For the purposes - of this License, Derivative Works shall not include works that remain - separable from, or merely link (or bind by name) to the interfaces of, - the Work and Derivative Works thereof. - - "Contribution" shall mean any work of authorship, including - the original version of the Work and any modifications or additions - to that Work or Derivative Works thereof, that is intentionally - submitted to Licensor for inclusion in the Work by the copyright owner - or by an individual or Legal Entity authorized to submit on behalf of - the copyright owner. For the purposes of this definition, "submitted" - means any form of electronic, verbal, or written communication sent - to the Licensor or its representatives, including but not limited to - communication on electronic mailing lists, source code control systems, - and issue tracking systems that are managed by, or on behalf of, the - Licensor for the purpose of discussing and improving the Work, but - excluding communication that is conspicuously marked or otherwise - designated in writing by the copyright owner as "Not a Contribution." - - "Contributor" shall mean Licensor and any individual or Legal Entity - on behalf of whom a Contribution has been received by Licensor and - subsequently incorporated within the Work. - - 2. Grant of Copyright License. Subject to the terms and conditions of - this License, each Contributor hereby grants to You a perpetual, - worldwide, non-exclusive, no-charge, royalty-free, irrevocable - copyright license to reproduce, prepare Derivative Works of, - publicly display, publicly perform, sublicense, and distribute the - Work and such Derivative Works in Source or Object form. - - 3. Grant of Patent License. Subject to the terms and conditions of - this License, each Contributor hereby grants to You a perpetual, - worldwide, non-exclusive, no-charge, royalty-free, irrevocable - (except as stated in this section) patent license to make, have made, - use, offer to sell, sell, import, and otherwise transfer the Work, - where such license applies only to those patent claims licensable - by such Contributor that are necessarily infringed by their - Contribution(s) alone or by combination of their Contribution(s) - with the Work to which such Contribution(s) was submitted. If You - institute patent litigation against any entity (including a - cross-claim or counterclaim in a lawsuit) alleging that the Work - or a Contribution incorporated within the Work constitutes direct - or contributory patent infringement, then any patent licenses - granted to You under this License for that Work shall terminate - as of the date such litigation is filed. - - 4. Redistribution. You may reproduce and distribute copies of the - Work or Derivative Works thereof in any medium, with or without - modifications, and in Source or Object form, provided that You - meet the following conditions: - - (a) You must give any other recipients of the Work or - Derivative Works a copy of this License; and - - (b) You must cause any modified files to carry prominent notices - stating that You changed the files; and - - (c) You must retain, in the Source form of any Derivative Works - that You distribute, all copyright, patent, trademark, and - attribution notices from the Source form of the Work, - excluding those notices that do not pertain to any part of - the Derivative Works; and - - (d) If the Work includes a "NOTICE" text file as part of its - distribution, then any Derivative Works that You distribute must - include a readable copy of the attribution notices contained - within such NOTICE file, excluding those notices that do not - pertain to any part of the Derivative Works, in at least one - of the following places: within a NOTICE text file distributed - as part of the Derivative Works; within the Source form or - documentation, if provided along with the Derivative Works; or, - within a display generated by the Derivative Works, if and - wherever such third-party notices normally appear. The contents - of the NOTICE file are for informational purposes only and - do not modify the License. You may add Your own attribution - notices within Derivative Works that You distribute, alongside - or as an addendum to the NOTICE text from the Work, provided - that such additional attribution notices cannot be construed - as modifying the License. - - You may add Your own copyright statement to Your modifications and - may provide additional or different license terms and conditions - for use, reproduction, or distribution of Your modifications, or - for any such Derivative Works as a whole, provided Your use, - reproduction, and distribution of the Work otherwise complies with - the conditions stated in this License. - - 5. Submission of Contributions. Unless You explicitly state otherwise, - any Contribution intentionally submitted for inclusion in the Work - by You to the Licensor shall be under the terms and conditions of - this License, without any additional terms or conditions. - Notwithstanding the above, nothing herein shall supersede or modify - the terms of any separate license agreement you may have executed - with Licensor regarding such Contributions. - - 6. Trademarks. This License does not grant permission to use the trade - names, trademarks, service marks, or product names of the Licensor, - except as required for reasonable and customary use in describing the - origin of the Work and reproducing the content of the NOTICE file. - - 7. Disclaimer of Warranty. Unless required by applicable law or - agreed to in writing, Licensor provides the Work (and each - Contributor provides its Contributions) on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or - implied, including, without limitation, any warranties or conditions - of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A - PARTICULAR PURPOSE. You are solely responsible for determining the - appropriateness of using or redistributing the Work and assume any - risks associated with Your exercise of permissions under this License. - - 8. Limitation of Liability. In no event and under no legal theory, - whether in tort (including negligence), contract, or otherwise, - unless required by applicable law (such as deliberate and grossly - negligent acts) or agreed to in writing, shall any Contributor be - liable to You for damages, including any direct, indirect, special, - incidental, or consequential damages of any character arising as a - result of this License or out of the use or inability to use the - Work (including but not limited to damages for loss of goodwill, - work stoppage, computer failure or malfunction, or any and all - other commercial damages or losses), even if such Contributor - has been advised of the possibility of such damages. - - 9. Accepting Warranty or Additional Liability. While redistributing - the Work or Derivative Works thereof, You may choose to offer, - and charge a fee for, acceptance of support, warranty, indemnity, - or other liability obligations and/or rights consistent with this - License. However, in accepting such obligations, You may act only - on Your own behalf and on Your sole responsibility, not on behalf - of any other Contributor, and only if You agree to indemnify, - defend, and hold each Contributor harmless for any liability - incurred by, or claims asserted against, such Contributor by reason - of your accepting any such warranty or additional liability. - - END OF TERMS AND CONDITIONS - - APPENDIX: How to apply the Apache License to your work. - - To apply the Apache License to your work, attach the following - boilerplate notice, with the fields enclosed by brackets "[]" - replaced with your own identifying information. (Don't include - the brackets!) The text should be enclosed in the appropriate - comment syntax for the file format. We also recommend that a - file or class name and description of purpose be included on the - same "printed page" as the copyright notice for easier - identification within third-party archives. - - Copyright [yyyy] [name of copyright owner] - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. diff --git a/owl-bot-staging/google-cloud-secret_manager-v1beta1/README.md b/owl-bot-staging/google-cloud-secret_manager-v1beta1/README.md deleted file mode 100644 index c14793642535..000000000000 --- a/owl-bot-staging/google-cloud-secret_manager-v1beta1/README.md +++ /dev/null @@ -1,154 +0,0 @@ -# Ruby Client for the Secret Manager V1beta1 API - -Stores sensitive data such as API keys, passwords, and certificates. Provides convenience while improving security. - -Secret Manager is a secure and convenient storage system for API keys, passwords, certificates, and other sensitive data. Secret Manager provides a central place and single source of truth to manage, access, and audit secrets across Google Cloud. - -https://github.com/googleapis/google-cloud-ruby - -This gem is a _versioned_ client. It provides basic client classes for a -specific version of the Secret Manager V1beta1 API. Most users should consider using -the main client gem, -[google-cloud-secret_manager](https://rubygems.org/gems/google-cloud-secret_manager). -See the section below titled *Which client should I use?* for more information. - -## Installation - -``` -$ gem install google-cloud-secret_manager-v1beta1 -``` - -## Before You Begin - -In order to use this library, you first need to go through the following steps: - -1. [Select or create a Cloud Platform project.](https://console.cloud.google.com/project) -1. [Enable billing for your project.](https://cloud.google.com/billing/docs/how-to/modify-project#enable_billing_for_a_project) -1. [Enable the API.](https://console.cloud.google.com/apis/library/secretmanager.googleapis.com) -1. [Set up authentication.](AUTHENTICATION.md) - -## Quick Start - -```ruby -require "google/cloud/secret_manager/v1beta1" - -client = ::Google::Cloud::SecretManager::V1beta1::SecretManagerService::Client.new -request = ::Google::Cloud::SecretManager::V1beta1::ListSecretsRequest.new # (request fields as keyword arguments...) -response = client.list_secrets request -``` - -View the [Client Library Documentation](https://cloud.google.com/ruby/docs/reference/google-cloud-secret_manager-v1beta1/latest) -for class and method documentation. - -See also the [Product Documentation](https://cloud.google.com/secret-manager) -for general usage information. - -## Debug Logging - -This library comes with opt-in Debug Logging that can help you troubleshoot -your application's integration with the API. When logging is activated, key -events such as requests and responses, along with data payloads and metadata -such as headers and client configuration, are logged to the standard error -stream. - -**WARNING:** Client Library Debug Logging includes your data payloads in -plaintext, which could include sensitive data such as PII for yourself or your -customers, private keys, or other security data that could be compromising if -leaked. Always practice good data hygiene with your application logs, and follow -the principle of least access. Google also recommends that Client Library Debug -Logging be enabled only temporarily during active debugging, and not used -permanently in production. - -To enable logging, set the environment variable `GOOGLE_SDK_RUBY_LOGGING_GEMS` -to the value `all`. Alternatively, you can set the value to a comma-delimited -list of client library gem names. This will select the default logging behavior, -which writes logs to the standard error stream. On a local workstation, this may -result in logs appearing on the console. When running on a Google Cloud hosting -service such as [Google Cloud Run](https://cloud.google.com/run), this generally -results in logs appearing alongside your application logs in the -[Google Cloud Logging](https://cloud.google.com/logging/) service. - -You can customize logging by modifying the `logger` configuration when -constructing a client object. For example: - -```ruby -require "google/cloud/secret_manager/v1beta1" -require "logger" - -client = ::Google::Cloud::SecretManager::V1beta1::SecretManagerService::Client.new do |config| - config.logger = Logger.new "my-app.log" -end -``` - -## Google Cloud Samples - -To browse ready to use code samples check [Google Cloud Samples](https://cloud.google.com/docs/samples). - -## Supported Ruby Versions - -This library is supported on Ruby 3.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-secret_manager`, -and lower-level _versioned_ client libraries with names such as -`google-cloud-secret_manager-v1beta1`. -_In most cases, you should install the main client._ - -### What's the difference between the main client and a versioned client? - -A _versioned client_ provides a basic set of data types and client classes for -a _single version_ of a specific service. (That is, for a service with multiple -versions, there might be a separate versioned client for each service version.) -Most versioned clients are written and maintained by a code generator. - -The _main client_ is designed to provide you with the _recommended_ client -interfaces for the service. There will be only one main client for any given -service, even a service with multiple versions. The main client includes -factory methods for constructing the client objects we recommend for most -users. In some cases, those will be classes provided by an underlying versioned -client; in other cases, they will be handwritten higher-level client objects -with additional capabilities, convenience methods, or best practices built in. -Generally, the main client will default to a recommended service version, -although in some cases you can override this if you need to talk to a specific -service version. - -### Why would I want to use the main client? - -We recommend that most users install the main client gem for a service. You can -identify this gem as the one _without_ a version in its name, e.g. -`google-cloud-secret_manager`. -The main client is recommended because it will embody the best practices for -accessing the service, and may also provide more convenient interfaces or -tighter integration into frameworks and third-party libraries. In addition, the -documentation and samples published by Google will generally demonstrate use of -the main client. - -### Why would I want to use a versioned client? - -You can use a versioned client if you are content with a possibly lower-level -class interface, you explicitly want to avoid features provided by the main -client, or you want to access a specific service version not be covered by the -main client. You can identify versioned client gems because the service version -is part of the name, e.g. `google-cloud-secret_manager-v1beta1`. - -### What about the google-apis- clients? - -Client library gems with names that begin with `google-apis-` are based on an -older code generation technology. They talk to a REST/JSON backend (whereas -most modern clients talk to a [gRPC](https://grpc.io/) backend) and they may -not offer the same performance, features, and ease of use provided by more -modern clients. - -The `google-apis-` clients have wide coverage across Google services, so you -might need to use one if there is no modern client available for the service. -However, if a modern client is available, we generally recommend it over the -older `google-apis-` clients. diff --git a/owl-bot-staging/google-cloud-secret_manager-v1beta1/Rakefile b/owl-bot-staging/google-cloud-secret_manager-v1beta1/Rakefile deleted file mode 100644 index 48d5c1256eec..000000000000 --- a/owl-bot-staging/google-cloud-secret_manager-v1beta1/Rakefile +++ /dev/null @@ -1,169 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -require "bundler/setup" -require "bundler/gem_tasks" - -require "rubocop/rake_task" -RuboCop::RakeTask.new - -require "rake/testtask" -desc "Run tests." -Rake::TestTask.new do |t| - t.libs << "test" - t.test_files = FileList["test/**/*_test.rb"] - t.warning = false -end - -desc "Runs the smoke tests." -Rake::TestTask.new :smoke_test do |t| - t.test_files = FileList["acceptance/**/*smoke_test.rb"] - t.warning = false -end - -# Acceptance tests -desc "Run the google-cloud-secret_manager-v1beta1 acceptance tests." -task :acceptance, :project, :keyfile do |t, args| - project = args[:project] - project ||= - ENV["SECRET_MANAGER_TEST_PROJECT"] || - ENV["GCLOUD_TEST_PROJECT"] - keyfile = args[:keyfile] - keyfile ||= - ENV["SECRET_MANAGER_TEST_KEYFILE"] || - ENV["GCLOUD_TEST_KEYFILE"] - if keyfile - keyfile = File.read keyfile - else - keyfile ||= - ENV["SECRET_MANAGER_TEST_KEYFILE_JSON"] || - ENV["GCLOUD_TEST_KEYFILE_JSON"] - end - if project.nil? || keyfile.nil? - fail "You must provide a project and keyfile. e.g. rake acceptance[test123, /path/to/keyfile.json] or SECRET_MANAGER_TEST_PROJECT=test123 SECRET_MANAGER_TEST_KEYFILE=/path/to/keyfile.json rake acceptance" - end - require "google/cloud/secret_manager/v1beta1/secret_manager_service/credentials" - ::Google::Cloud::SecretManager::V1beta1::SecretManagerService::Credentials.env_vars.each do |path| - ENV[path] = nil - end - ENV["SECRET_MANAGER_PROJECT"] = project - ENV["SECRET_MANAGER_TEST_PROJECT"] = project - ENV["SECRET_MANAGER_KEYFILE_JSON"] = keyfile - - Rake::Task["acceptance:run"].invoke -end - -namespace :acceptance do - task :run do - if File.directory? "acceptance" - Rake::Task[:smoke_test].invoke - else - puts "The google-cloud-secret_manager-v1beta1 gem has no acceptance tests." - end - end - - desc "Run acceptance cleanup." - task :cleanup do - end -end - -task :samples do - Rake::Task["samples:latest"].invoke -end - -namespace :samples do - task :latest do - if File.directory? "samples" - Dir.chdir "samples" do - Bundler.with_clean_env do - ENV["GOOGLE_CLOUD_SAMPLES_TEST"] = "not_master" - sh "bundle update" - sh "bundle exec rake test" - end - end - else - puts "The google-cloud-secret_manager-v1beta1 gem has no samples to test." - end - end - - task :master do - if File.directory? "samples" - Dir.chdir "samples" do - Bundler.with_clean_env do - ENV["GOOGLE_CLOUD_SAMPLES_TEST"] = "master" - sh "bundle update" - sh "bundle exec rake test" - end - end - else - puts "The google-cloud-secret_manager-v1beta1 gem has no samples to test." - end - end -end - -require "yard" -require "yard/rake/yardoc_task" -YARD::Rake::YardocTask.new do |y| - y.options << "--fail-on-warning" -end - -desc "Run yard-doctest example tests." -task :doctest do - puts "The google-cloud-secret_manager-v1beta1 gem does not have doctest tests." -end - -desc "Run the CI build" -task :ci do - header "BUILDING google-cloud-secret_manager-v1beta1" - header "google-cloud-secret_manager-v1beta1 rubocop", "*" - Rake::Task[:rubocop].invoke - header "google-cloud-secret_manager-v1beta1 yard", "*" - Rake::Task[:yard].invoke - header "google-cloud-secret_manager-v1beta1 test", "*" - Rake::Task[:test].invoke -end - -namespace :ci do - desc "Run the CI build, with smoke tests." - task :smoke_test do - Rake::Task[:ci].invoke - header "google-cloud-secret_manager-v1beta1 smoke_test", "*" - Rake::Task[:smoke_test].invoke - end - desc "Run the CI build, with acceptance tests." - task :acceptance do - Rake::Task[:ci].invoke - header "google-cloud-secret_manager-v1beta1 acceptance", "*" - Rake::Task[:acceptance].invoke - end - task :a do - # This is a handy shortcut to save typing - Rake::Task["ci:acceptance"].invoke - end -end - -task default: :test - -def header str, token = "#" - line_length = str.length + 8 - puts "" - puts token * line_length - puts "#{token * 3} #{str} #{token * 3}" - puts token * line_length - puts "" -end diff --git a/owl-bot-staging/google-cloud-secret_manager-v1beta1/gapic_metadata.json b/owl-bot-staging/google-cloud-secret_manager-v1beta1/gapic_metadata.json deleted file mode 100644 index baf3eab359db..000000000000 --- a/owl-bot-staging/google-cloud-secret_manager-v1beta1/gapic_metadata.json +++ /dev/null @@ -1,93 +0,0 @@ -{ - "schema": "1.0", - "comment": "This file maps proto services/RPCs to the corresponding library clients/methods", - "language": "ruby", - "protoPackage": "google.cloud.secrets.v1beta1", - "libraryPackage": "::Google::Cloud::SecretManager::V1beta1", - "services": { - "SecretManagerService": { - "clients": { - "grpc": { - "libraryClient": "::Google::Cloud::SecretManager::V1beta1::SecretManagerService::Client", - "rpcs": { - "ListSecrets": { - "methods": [ - "list_secrets" - ] - }, - "CreateSecret": { - "methods": [ - "create_secret" - ] - }, - "AddSecretVersion": { - "methods": [ - "add_secret_version" - ] - }, - "GetSecret": { - "methods": [ - "get_secret" - ] - }, - "UpdateSecret": { - "methods": [ - "update_secret" - ] - }, - "DeleteSecret": { - "methods": [ - "delete_secret" - ] - }, - "ListSecretVersions": { - "methods": [ - "list_secret_versions" - ] - }, - "GetSecretVersion": { - "methods": [ - "get_secret_version" - ] - }, - "AccessSecretVersion": { - "methods": [ - "access_secret_version" - ] - }, - "DisableSecretVersion": { - "methods": [ - "disable_secret_version" - ] - }, - "EnableSecretVersion": { - "methods": [ - "enable_secret_version" - ] - }, - "DestroySecretVersion": { - "methods": [ - "destroy_secret_version" - ] - }, - "SetIamPolicy": { - "methods": [ - "set_iam_policy" - ] - }, - "GetIamPolicy": { - "methods": [ - "get_iam_policy" - ] - }, - "TestIamPermissions": { - "methods": [ - "test_iam_permissions" - ] - } - } - } - } - } - } -} diff --git a/owl-bot-staging/google-cloud-secret_manager-v1beta1/google-cloud-secret_manager-v1beta1.gemspec b/owl-bot-staging/google-cloud-secret_manager-v1beta1/google-cloud-secret_manager-v1beta1.gemspec deleted file mode 100644 index eac065289beb..000000000000 --- a/owl-bot-staging/google-cloud-secret_manager-v1beta1/google-cloud-secret_manager-v1beta1.gemspec +++ /dev/null @@ -1,30 +0,0 @@ -# -*- ruby -*- -# encoding: utf-8 - -require File.expand_path("lib/google/cloud/secret_manager/v1beta1/version", __dir__) - -Gem::Specification.new do |gem| - gem.name = "google-cloud-secret_manager-v1beta1" - gem.version = Google::Cloud::SecretManager::V1beta1::VERSION - - gem.authors = ["Google LLC"] - gem.email = "googleapis-packages@google.com" - gem.description = "Secret Manager is a secure and convenient storage system for API keys, passwords, certificates, and other sensitive data. Secret Manager provides a central place and single source of truth to manage, access, and audit secrets across Google Cloud. Note that google-cloud-secret_manager-v1beta1 is a version-specific client library. For most uses, we recommend installing the main client library google-cloud-secret_manager instead. See the readme for more details." - gem.summary = "Stores sensitive data such as API keys, passwords, and certificates. Provides convenience while improving security." - gem.homepage = "https://github.com/googleapis/google-cloud-ruby" - gem.license = "Apache-2.0" - - gem.platform = Gem::Platform::RUBY - - gem.files = `git ls-files -- lib/*`.split("\n") + - `git ls-files -- proto_docs/*`.split("\n") + - ["README.md", "LICENSE.md", "AUTHENTICATION.md", ".yardopts"] - gem.require_paths = ["lib"] - - gem.required_ruby_version = ">= 3.2" - - gem.add_dependency "gapic-common", "~> 1.2" - gem.add_dependency "google-cloud-errors", "~> 1.0" - gem.add_dependency "google-cloud-location", "~> 1.0" - gem.add_dependency "grpc-google-iam-v1", "~> 1.11" -end diff --git a/owl-bot-staging/google-cloud-secret_manager-v1beta1/lib/google-cloud-secret_manager-v1beta1.rb b/owl-bot-staging/google-cloud-secret_manager-v1beta1/lib/google-cloud-secret_manager-v1beta1.rb deleted file mode 100644 index 5e930f08a7d9..000000000000 --- a/owl-bot-staging/google-cloud-secret_manager-v1beta1/lib/google-cloud-secret_manager-v1beta1.rb +++ /dev/null @@ -1,21 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -# This gem does not autoload during Bundler.require. To load this gem, -# issue explicit require statements for the packages desired, e.g.: -# require "google/cloud/secret_manager/v1beta1" diff --git a/owl-bot-staging/google-cloud-secret_manager-v1beta1/lib/google/cloud/secret_manager/v1beta1.rb b/owl-bot-staging/google-cloud-secret_manager-v1beta1/lib/google/cloud/secret_manager/v1beta1.rb deleted file mode 100644 index c73914ce8c82..000000000000 --- a/owl-bot-staging/google-cloud-secret_manager-v1beta1/lib/google/cloud/secret_manager/v1beta1.rb +++ /dev/null @@ -1,45 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -require "google/cloud/secret_manager/v1beta1/secret_manager_service" -require "google/cloud/secret_manager/v1beta1/version" - -module Google - module Cloud - module SecretManager - ## - # API client module. - # - # @example Load this package, including all its services, and instantiate a gRPC client - # - # require "google/cloud/secret_manager/v1beta1" - # client = ::Google::Cloud::SecretManager::V1beta1::SecretManagerService::Client.new - # - # @example Load this package, including all its services, and instantiate a REST client - # - # require "google/cloud/secret_manager/v1beta1" - # client = ::Google::Cloud::SecretManager::V1beta1::SecretManagerService::Rest::Client.new - # - module V1beta1 - end - end - end -end - -helper_path = ::File.join __dir__, "v1beta1", "_helpers.rb" -require "google/cloud/secret_manager/v1beta1/_helpers" if ::File.file? helper_path diff --git a/owl-bot-staging/google-cloud-secret_manager-v1beta1/lib/google/cloud/secret_manager/v1beta1/bindings_override.rb b/owl-bot-staging/google-cloud-secret_manager-v1beta1/lib/google/cloud/secret_manager/v1beta1/bindings_override.rb deleted file mode 100644 index 0fadf3d51c06..000000000000 --- a/owl-bot-staging/google-cloud-secret_manager-v1beta1/lib/google/cloud/secret_manager/v1beta1/bindings_override.rb +++ /dev/null @@ -1,75 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -require "gapic/rest" - -module Google - module Cloud - module SecretManager - ## - # @example Loading just the REST part of this package, including all its services, and instantiating a REST client - # - # require "google/cloud/secret_manager/v1beta1/rest" - # client = ::Google::Cloud::SecretManager::V1beta1::SecretManagerService::Rest::Client.new - # - module V1beta1 - ## - # @private - # Initialize the mixin bindings configuration - # - def self.configure - @configure ||= begin - namespace = ["Google", "Cloud", "SecretManager"] - parent_config = while namespace.any? - parent_name = namespace.join "::" - parent_const = const_get parent_name - break parent_const.configure if parent_const.respond_to? :configure - namespace.pop - end - - default_config = ::Gapic::Rest::HttpBindingOverrideConfiguration.new parent_config - default_config.bindings_override["google.cloud.location.Locations.GetLocation"] = [ - Gapic::Rest::GrpcTranscoder::HttpBinding.create_with_validation( - uri_method: :get, - uri_template: "/v1beta1/{name}", - matches: [ - ["name", %r{^projects/[^/]+/locations/[^/]+/?$}, false] - ], - body: nil - ) - ] - default_config.bindings_override["google.cloud.location.Locations.ListLocations"] = [ - - Gapic::Rest::GrpcTranscoder::HttpBinding.create_with_validation( - uri_method: :get, - uri_template: "/v1beta1/{name}/locations", - matches: [ - ["name", %r{^projects/[^/]+/?$}, false] - ], - body: nil - ) - ] - default_config - end - yield @configure if block_given? - @configure - end - end - end - end -end diff --git a/owl-bot-staging/google-cloud-secret_manager-v1beta1/lib/google/cloud/secret_manager/v1beta1/rest.rb b/owl-bot-staging/google-cloud-secret_manager-v1beta1/lib/google/cloud/secret_manager/v1beta1/rest.rb deleted file mode 100644 index c97fa6acb0d9..000000000000 --- a/owl-bot-staging/google-cloud-secret_manager-v1beta1/lib/google/cloud/secret_manager/v1beta1/rest.rb +++ /dev/null @@ -1,38 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -require "google/cloud/secret_manager/v1beta1/secret_manager_service/rest" -require "google/cloud/secret_manager/v1beta1/bindings_override" -require "google/cloud/secret_manager/v1beta1/version" - -module Google - module Cloud - module SecretManager - ## - # To load just the REST part of this package, including all its services, and instantiate a REST client: - # - # @example - # - # require "google/cloud/secret_manager/v1beta1/rest" - # client = ::Google::Cloud::SecretManager::V1beta1::SecretManagerService::Rest::Client.new - # - module V1beta1 - end - end - end -end diff --git a/owl-bot-staging/google-cloud-secret_manager-v1beta1/lib/google/cloud/secret_manager/v1beta1/secret_manager_service.rb b/owl-bot-staging/google-cloud-secret_manager-v1beta1/lib/google/cloud/secret_manager/v1beta1/secret_manager_service.rb deleted file mode 100644 index 7973da8d921f..000000000000 --- a/owl-bot-staging/google-cloud-secret_manager-v1beta1/lib/google/cloud/secret_manager/v1beta1/secret_manager_service.rb +++ /dev/null @@ -1,61 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -require "gapic/common" -require "gapic/config" -require "gapic/config/method" - -require "google/cloud/secret_manager/v1beta1/version" - -require "google/cloud/secret_manager/v1beta1/secret_manager_service/credentials" -require "google/cloud/secret_manager/v1beta1/secret_manager_service/paths" -require "google/cloud/secret_manager/v1beta1/secret_manager_service/client" -require "google/cloud/secret_manager/v1beta1/secret_manager_service/rest" - -module Google - module Cloud - module SecretManager - module V1beta1 - ## - # Secret Manager Service - # - # Manages secrets and operations using those secrets. Implements a REST - # model with the following objects: - # - # * {::Google::Cloud::SecretManager::V1beta1::Secret Secret} - # * {::Google::Cloud::SecretManager::V1beta1::SecretVersion SecretVersion} - # - # @example Load this service and instantiate a gRPC client - # - # require "google/cloud/secret_manager/v1beta1/secret_manager_service" - # client = ::Google::Cloud::SecretManager::V1beta1::SecretManagerService::Client.new - # - # @example Load this service and instantiate a REST client - # - # require "google/cloud/secret_manager/v1beta1/secret_manager_service/rest" - # client = ::Google::Cloud::SecretManager::V1beta1::SecretManagerService::Rest::Client.new - # - module SecretManagerService - end - end - end - end -end - -helper_path = ::File.join __dir__, "secret_manager_service", "helpers.rb" -require "google/cloud/secret_manager/v1beta1/secret_manager_service/helpers" if ::File.file? helper_path diff --git a/owl-bot-staging/google-cloud-secret_manager-v1beta1/lib/google/cloud/secret_manager/v1beta1/secret_manager_service/client.rb b/owl-bot-staging/google-cloud-secret_manager-v1beta1/lib/google/cloud/secret_manager/v1beta1/secret_manager_service/client.rb deleted file mode 100644 index d8401f45108d..000000000000 --- a/owl-bot-staging/google-cloud-secret_manager-v1beta1/lib/google/cloud/secret_manager/v1beta1/secret_manager_service/client.rb +++ /dev/null @@ -1,1942 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -require "google/cloud/errors" -require "google/cloud/secrets/v1beta1/service_pb" -require "google/cloud/location" - -module Google - module Cloud - module SecretManager - module V1beta1 - module SecretManagerService - ## - # Client for the SecretManagerService service. - # - # Secret Manager Service - # - # Manages secrets and operations using those secrets. Implements a REST - # model with the following objects: - # - # * {::Google::Cloud::SecretManager::V1beta1::Secret Secret} - # * {::Google::Cloud::SecretManager::V1beta1::SecretVersion SecretVersion} - # - class Client - # @private - API_VERSION = "" - - # @private - DEFAULT_ENDPOINT_TEMPLATE = "secretmanager.$UNIVERSE_DOMAIN$" - - include Paths - - # @private - attr_reader :secret_manager_service_stub - - ## - # Configure the SecretManagerService Client class. - # - # See {::Google::Cloud::SecretManager::V1beta1::SecretManagerService::Client::Configuration} - # for a description of the configuration fields. - # - # @example - # - # # Modify the configuration for all SecretManagerService clients - # ::Google::Cloud::SecretManager::V1beta1::SecretManagerService::Client.configure do |config| - # config.timeout = 10.0 - # end - # - # @yield [config] Configure the Client client. - # @yieldparam config [Client::Configuration] - # - # @return [Client::Configuration] - # - def self.configure - @configure ||= begin - namespace = ["Google", "Cloud", "SecretManager", "V1beta1"] - parent_config = while namespace.any? - parent_name = namespace.join "::" - parent_const = const_get parent_name - break parent_const.configure if parent_const.respond_to? :configure - namespace.pop - end - default_config = Client::Configuration.new parent_config - - default_config.rpcs.list_secrets.timeout = 60.0 - - default_config.rpcs.create_secret.timeout = 60.0 - - default_config.rpcs.add_secret_version.timeout = 60.0 - - default_config.rpcs.get_secret.timeout = 60.0 - - default_config.rpcs.update_secret.timeout = 60.0 - - default_config.rpcs.delete_secret.timeout = 60.0 - - default_config.rpcs.list_secret_versions.timeout = 60.0 - - default_config.rpcs.get_secret_version.timeout = 60.0 - - default_config.rpcs.access_secret_version.timeout = 60.0 - default_config.rpcs.access_secret_version.retry_policy = { - initial_delay: 1.0, max_delay: 60.0, multiplier: 1.3, retry_codes: [14, 2] - } - - default_config.rpcs.disable_secret_version.timeout = 60.0 - - default_config.rpcs.enable_secret_version.timeout = 60.0 - - default_config.rpcs.destroy_secret_version.timeout = 60.0 - - default_config.rpcs.set_iam_policy.timeout = 60.0 - - default_config.rpcs.get_iam_policy.timeout = 60.0 - - default_config.rpcs.test_iam_permissions.timeout = 60.0 - - default_config - end - yield @configure if block_given? - @configure - end - - ## - # Configure the SecretManagerService Client instance. - # - # The configuration is set to the derived mode, meaning that values can be changed, - # but structural changes (adding new fields, etc.) are not allowed. Structural changes - # should be made on {Client.configure}. - # - # See {::Google::Cloud::SecretManager::V1beta1::SecretManagerService::Client::Configuration} - # for a description of the configuration fields. - # - # @yield [config] Configure the Client client. - # @yieldparam config [Client::Configuration] - # - # @return [Client::Configuration] - # - def configure - yield @config if block_given? - @config - end - - ## - # The effective universe domain - # - # @return [String] - # - def universe_domain - @secret_manager_service_stub.universe_domain - end - - ## - # Create a new SecretManagerService client object. - # - # @example - # - # # Create a client using the default configuration - # client = ::Google::Cloud::SecretManager::V1beta1::SecretManagerService::Client.new - # - # # Create a client using a custom configuration - # client = ::Google::Cloud::SecretManager::V1beta1::SecretManagerService::Client.new do |config| - # config.timeout = 10.0 - # end - # - # @yield [config] Configure the SecretManagerService client. - # @yieldparam config [Client::Configuration] - # - def initialize - # These require statements are intentionally placed here to initialize - # the gRPC module only when it's required. - # See https://github.com/googleapis/toolkit/issues/446 - require "gapic/grpc" - require "google/cloud/secrets/v1beta1/service_services_pb" - - # Create the configuration object - @config = Configuration.new Client.configure - - # Yield the configuration if needed - yield @config if block_given? - - # Create credentials - credentials = @config.credentials - # Use self-signed JWT if the endpoint is unchanged from default, - # but only if the default endpoint does not have a region prefix. - enable_self_signed_jwt = @config.endpoint.nil? || - (@config.endpoint == Configuration::DEFAULT_ENDPOINT && - !@config.endpoint.split(".").first.include?("-")) - credentials ||= Credentials.default scope: @config.scope, - enable_self_signed_jwt: enable_self_signed_jwt - if credentials.is_a?(::String) || credentials.is_a?(::Hash) - credentials = Credentials.new credentials, scope: @config.scope - end - @quota_project_id = @config.quota_project - @quota_project_id ||= credentials.quota_project_id if credentials.respond_to? :quota_project_id - - @secret_manager_service_stub = ::Gapic::ServiceStub.new( - ::Google::Cloud::SecretManager::V1beta1::SecretManagerService::Stub, - credentials: credentials, - endpoint: @config.endpoint, - endpoint_template: DEFAULT_ENDPOINT_TEMPLATE, - universe_domain: @config.universe_domain, - channel_args: @config.channel_args, - interceptors: @config.interceptors, - channel_pool_config: @config.channel_pool, - logger: @config.logger - ) - - @secret_manager_service_stub.stub_logger&.info do |entry| - entry.set_system_name - entry.set_service - entry.message = "Created client for #{entry.service}" - entry.set_credentials_fields credentials - entry.set "customEndpoint", @config.endpoint if @config.endpoint - entry.set "defaultTimeout", @config.timeout if @config.timeout - entry.set "quotaProject", @quota_project_id if @quota_project_id - end - - @location_client = Google::Cloud::Location::Locations::Client.new do |config| - config.credentials = credentials - config.quota_project = @quota_project_id - config.endpoint = @secret_manager_service_stub.endpoint - config.universe_domain = @secret_manager_service_stub.universe_domain - config.logger = @secret_manager_service_stub.logger if config.respond_to? :logger= - end - end - - ## - # Get the associated client for mix-in of the Locations. - # - # @return [Google::Cloud::Location::Locations::Client] - # - attr_reader :location_client - - ## - # The logger used for request/response debug logging. - # - # @return [Logger] - # - def logger - @secret_manager_service_stub.logger - end - - # Service calls - - ## - # Lists {::Google::Cloud::SecretManager::V1beta1::Secret Secrets}. - # - # @overload list_secrets(request, options = nil) - # Pass arguments to `list_secrets` via a request object, either of type - # {::Google::Cloud::SecretManager::V1beta1::ListSecretsRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::SecretManager::V1beta1::ListSecretsRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. - # - # @overload list_secrets(parent: nil, page_size: nil, page_token: nil) - # Pass arguments to `list_secrets` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param parent [::String] - # Required. The resource name of the project associated with the - # {::Google::Cloud::SecretManager::V1beta1::Secret Secrets}, in the format `projects/*`. - # @param page_size [::Integer] - # Optional. The maximum number of results to be returned in a single page. If - # set to 0, the server decides the number of results to return. If the - # number is greater than 25000, it is capped at 25000. - # @param page_token [::String] - # Optional. Pagination token, returned earlier via - # {::Google::Cloud::SecretManager::V1beta1::ListSecretsResponse#next_page_token ListSecretsResponse.next_page_token}. - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Gapic::PagedEnumerable<::Google::Cloud::SecretManager::V1beta1::Secret>] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Gapic::PagedEnumerable<::Google::Cloud::SecretManager::V1beta1::Secret>] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/cloud/secret_manager/v1beta1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::SecretManager::V1beta1::SecretManagerService::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::SecretManager::V1beta1::ListSecretsRequest.new - # - # # Call the list_secrets method. - # result = client.list_secrets request - # - # # The returned object is of type Gapic::PagedEnumerable. You can iterate - # # over elements, and API calls will be issued to fetch pages as needed. - # result.each do |item| - # # Each element is of type ::Google::Cloud::SecretManager::V1beta1::Secret. - # p item - # end - # - def list_secrets request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::SecretManager::V1beta1::ListSecretsRequest - - # Converts hash and nil to an options object - options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h - - # Customize the options with defaults - metadata = @config.rpcs.list_secrets.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::SecretManager::V1beta1::VERSION - metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - header_params = {} - if request.parent - header_params["parent"] = request.parent - end - - request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") - metadata[:"x-goog-request-params"] ||= request_params_header - - options.apply_defaults timeout: @config.rpcs.list_secrets.timeout, - metadata: metadata, - retry_policy: @config.rpcs.list_secrets.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @secret_manager_service_stub.call_rpc :list_secrets, request, options: options do |response, operation| - response = ::Gapic::PagedEnumerable.new @secret_manager_service_stub, :list_secrets, request, response, operation, options - yield response, operation if block_given? - throw :response, response - end - rescue ::GRPC::BadStatus => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Creates a new {::Google::Cloud::SecretManager::V1beta1::Secret Secret} containing no - # {::Google::Cloud::SecretManager::V1beta1::SecretVersion SecretVersions}. - # - # @overload create_secret(request, options = nil) - # Pass arguments to `create_secret` via a request object, either of type - # {::Google::Cloud::SecretManager::V1beta1::CreateSecretRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::SecretManager::V1beta1::CreateSecretRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. - # - # @overload create_secret(parent: nil, secret_id: nil, secret: nil) - # Pass arguments to `create_secret` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param parent [::String] - # Required. The resource name of the project to associate with the - # {::Google::Cloud::SecretManager::V1beta1::Secret Secret}, in the format `projects/*`. - # @param secret_id [::String] - # Required. This must be unique within the project. - # - # A secret ID is a string with a maximum length of 255 characters and can - # contain uppercase and lowercase letters, numerals, and the hyphen (`-`) and - # underscore (`_`) characters. - # @param secret [::Google::Cloud::SecretManager::V1beta1::Secret, ::Hash] - # Required. A {::Google::Cloud::SecretManager::V1beta1::Secret Secret} with initial - # field values. - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Google::Cloud::SecretManager::V1beta1::Secret] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Google::Cloud::SecretManager::V1beta1::Secret] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/cloud/secret_manager/v1beta1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::SecretManager::V1beta1::SecretManagerService::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::SecretManager::V1beta1::CreateSecretRequest.new - # - # # Call the create_secret method. - # result = client.create_secret request - # - # # The returned object is of type Google::Cloud::SecretManager::V1beta1::Secret. - # p result - # - def create_secret request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::SecretManager::V1beta1::CreateSecretRequest - - # Converts hash and nil to an options object - options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h - - # Customize the options with defaults - metadata = @config.rpcs.create_secret.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::SecretManager::V1beta1::VERSION - metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - header_params = {} - if request.parent - header_params["parent"] = request.parent - end - - request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") - metadata[:"x-goog-request-params"] ||= request_params_header - - options.apply_defaults timeout: @config.rpcs.create_secret.timeout, - metadata: metadata, - retry_policy: @config.rpcs.create_secret.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @secret_manager_service_stub.call_rpc :create_secret, request, options: options do |response, operation| - yield response, operation if block_given? - end - rescue ::GRPC::BadStatus => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Creates a new {::Google::Cloud::SecretManager::V1beta1::SecretVersion SecretVersion} - # containing secret data and attaches it to an existing - # {::Google::Cloud::SecretManager::V1beta1::Secret Secret}. - # - # @overload add_secret_version(request, options = nil) - # Pass arguments to `add_secret_version` via a request object, either of type - # {::Google::Cloud::SecretManager::V1beta1::AddSecretVersionRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::SecretManager::V1beta1::AddSecretVersionRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. - # - # @overload add_secret_version(parent: nil, payload: nil) - # Pass arguments to `add_secret_version` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param parent [::String] - # Required. The resource name of the - # {::Google::Cloud::SecretManager::V1beta1::Secret Secret} to associate with the - # {::Google::Cloud::SecretManager::V1beta1::SecretVersion SecretVersion} in the format - # `projects/*/secrets/*`. - # @param payload [::Google::Cloud::SecretManager::V1beta1::SecretPayload, ::Hash] - # Required. The secret payload of the - # {::Google::Cloud::SecretManager::V1beta1::SecretVersion SecretVersion}. - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Google::Cloud::SecretManager::V1beta1::SecretVersion] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Google::Cloud::SecretManager::V1beta1::SecretVersion] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/cloud/secret_manager/v1beta1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::SecretManager::V1beta1::SecretManagerService::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::SecretManager::V1beta1::AddSecretVersionRequest.new - # - # # Call the add_secret_version method. - # result = client.add_secret_version request - # - # # The returned object is of type Google::Cloud::SecretManager::V1beta1::SecretVersion. - # p result - # - def add_secret_version request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::SecretManager::V1beta1::AddSecretVersionRequest - - # Converts hash and nil to an options object - options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h - - # Customize the options with defaults - metadata = @config.rpcs.add_secret_version.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::SecretManager::V1beta1::VERSION - metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - header_params = {} - if request.parent - header_params["parent"] = request.parent - end - - request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") - metadata[:"x-goog-request-params"] ||= request_params_header - - options.apply_defaults timeout: @config.rpcs.add_secret_version.timeout, - metadata: metadata, - retry_policy: @config.rpcs.add_secret_version.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @secret_manager_service_stub.call_rpc :add_secret_version, request, options: options do |response, operation| - yield response, operation if block_given? - end - rescue ::GRPC::BadStatus => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Gets metadata for a given {::Google::Cloud::SecretManager::V1beta1::Secret Secret}. - # - # @overload get_secret(request, options = nil) - # Pass arguments to `get_secret` via a request object, either of type - # {::Google::Cloud::SecretManager::V1beta1::GetSecretRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::SecretManager::V1beta1::GetSecretRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. - # - # @overload get_secret(name: nil) - # Pass arguments to `get_secret` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param name [::String] - # Required. The resource name of the - # {::Google::Cloud::SecretManager::V1beta1::Secret Secret}, in the format - # `projects/*/secrets/*`. - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Google::Cloud::SecretManager::V1beta1::Secret] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Google::Cloud::SecretManager::V1beta1::Secret] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/cloud/secret_manager/v1beta1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::SecretManager::V1beta1::SecretManagerService::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::SecretManager::V1beta1::GetSecretRequest.new - # - # # Call the get_secret method. - # result = client.get_secret request - # - # # The returned object is of type Google::Cloud::SecretManager::V1beta1::Secret. - # p result - # - def get_secret request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::SecretManager::V1beta1::GetSecretRequest - - # Converts hash and nil to an options object - options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h - - # Customize the options with defaults - metadata = @config.rpcs.get_secret.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::SecretManager::V1beta1::VERSION - metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - header_params = {} - if request.name - header_params["name"] = request.name - end - - request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") - metadata[:"x-goog-request-params"] ||= request_params_header - - options.apply_defaults timeout: @config.rpcs.get_secret.timeout, - metadata: metadata, - retry_policy: @config.rpcs.get_secret.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @secret_manager_service_stub.call_rpc :get_secret, request, options: options do |response, operation| - yield response, operation if block_given? - end - rescue ::GRPC::BadStatus => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Updates metadata of an existing - # {::Google::Cloud::SecretManager::V1beta1::Secret Secret}. - # - # @overload update_secret(request, options = nil) - # Pass arguments to `update_secret` via a request object, either of type - # {::Google::Cloud::SecretManager::V1beta1::UpdateSecretRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::SecretManager::V1beta1::UpdateSecretRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. - # - # @overload update_secret(secret: nil, update_mask: nil) - # Pass arguments to `update_secret` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param secret [::Google::Cloud::SecretManager::V1beta1::Secret, ::Hash] - # Required. {::Google::Cloud::SecretManager::V1beta1::Secret Secret} with updated field - # values. - # @param update_mask [::Google::Protobuf::FieldMask, ::Hash] - # Required. Specifies the fields to be updated. - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Google::Cloud::SecretManager::V1beta1::Secret] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Google::Cloud::SecretManager::V1beta1::Secret] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/cloud/secret_manager/v1beta1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::SecretManager::V1beta1::SecretManagerService::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::SecretManager::V1beta1::UpdateSecretRequest.new - # - # # Call the update_secret method. - # result = client.update_secret request - # - # # The returned object is of type Google::Cloud::SecretManager::V1beta1::Secret. - # p result - # - def update_secret request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::SecretManager::V1beta1::UpdateSecretRequest - - # Converts hash and nil to an options object - options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h - - # Customize the options with defaults - metadata = @config.rpcs.update_secret.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::SecretManager::V1beta1::VERSION - metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - header_params = {} - if request.secret&.name - header_params["secret.name"] = request.secret.name - end - - request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") - metadata[:"x-goog-request-params"] ||= request_params_header - - options.apply_defaults timeout: @config.rpcs.update_secret.timeout, - metadata: metadata, - retry_policy: @config.rpcs.update_secret.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @secret_manager_service_stub.call_rpc :update_secret, request, options: options do |response, operation| - yield response, operation if block_given? - end - rescue ::GRPC::BadStatus => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Deletes a {::Google::Cloud::SecretManager::V1beta1::Secret Secret}. - # - # @overload delete_secret(request, options = nil) - # Pass arguments to `delete_secret` via a request object, either of type - # {::Google::Cloud::SecretManager::V1beta1::DeleteSecretRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::SecretManager::V1beta1::DeleteSecretRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. - # - # @overload delete_secret(name: nil) - # Pass arguments to `delete_secret` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param name [::String] - # Required. The resource name of the - # {::Google::Cloud::SecretManager::V1beta1::Secret Secret} to delete in the format - # `projects/*/secrets/*`. - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Google::Protobuf::Empty] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Google::Protobuf::Empty] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/cloud/secret_manager/v1beta1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::SecretManager::V1beta1::SecretManagerService::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::SecretManager::V1beta1::DeleteSecretRequest.new - # - # # Call the delete_secret method. - # result = client.delete_secret request - # - # # The returned object is of type Google::Protobuf::Empty. - # p result - # - def delete_secret request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::SecretManager::V1beta1::DeleteSecretRequest - - # Converts hash and nil to an options object - options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h - - # Customize the options with defaults - metadata = @config.rpcs.delete_secret.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::SecretManager::V1beta1::VERSION - metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - header_params = {} - if request.name - header_params["name"] = request.name - end - - request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") - metadata[:"x-goog-request-params"] ||= request_params_header - - options.apply_defaults timeout: @config.rpcs.delete_secret.timeout, - metadata: metadata, - retry_policy: @config.rpcs.delete_secret.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @secret_manager_service_stub.call_rpc :delete_secret, request, options: options do |response, operation| - yield response, operation if block_given? - end - rescue ::GRPC::BadStatus => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Lists {::Google::Cloud::SecretManager::V1beta1::SecretVersion SecretVersions}. This - # call does not return secret data. - # - # @overload list_secret_versions(request, options = nil) - # Pass arguments to `list_secret_versions` via a request object, either of type - # {::Google::Cloud::SecretManager::V1beta1::ListSecretVersionsRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::SecretManager::V1beta1::ListSecretVersionsRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. - # - # @overload list_secret_versions(parent: nil, page_size: nil, page_token: nil) - # Pass arguments to `list_secret_versions` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param parent [::String] - # Required. The resource name of the - # {::Google::Cloud::SecretManager::V1beta1::Secret Secret} associated with the - # {::Google::Cloud::SecretManager::V1beta1::SecretVersion SecretVersions} to list, in - # the format `projects/*/secrets/*`. - # @param page_size [::Integer] - # Optional. The maximum number of results to be returned in a single page. If - # set to 0, the server decides the number of results to return. If the - # number is greater than 25000, it is capped at 25000. - # @param page_token [::String] - # Optional. Pagination token, returned earlier via - # ListSecretVersionsResponse.next_page_token][]. - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Gapic::PagedEnumerable<::Google::Cloud::SecretManager::V1beta1::SecretVersion>] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Gapic::PagedEnumerable<::Google::Cloud::SecretManager::V1beta1::SecretVersion>] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/cloud/secret_manager/v1beta1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::SecretManager::V1beta1::SecretManagerService::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::SecretManager::V1beta1::ListSecretVersionsRequest.new - # - # # Call the list_secret_versions method. - # result = client.list_secret_versions request - # - # # The returned object is of type Gapic::PagedEnumerable. You can iterate - # # over elements, and API calls will be issued to fetch pages as needed. - # result.each do |item| - # # Each element is of type ::Google::Cloud::SecretManager::V1beta1::SecretVersion. - # p item - # end - # - def list_secret_versions request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::SecretManager::V1beta1::ListSecretVersionsRequest - - # Converts hash and nil to an options object - options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h - - # Customize the options with defaults - metadata = @config.rpcs.list_secret_versions.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::SecretManager::V1beta1::VERSION - metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - header_params = {} - if request.parent - header_params["parent"] = request.parent - end - - request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") - metadata[:"x-goog-request-params"] ||= request_params_header - - options.apply_defaults timeout: @config.rpcs.list_secret_versions.timeout, - metadata: metadata, - retry_policy: @config.rpcs.list_secret_versions.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @secret_manager_service_stub.call_rpc :list_secret_versions, request, options: options do |response, operation| - response = ::Gapic::PagedEnumerable.new @secret_manager_service_stub, :list_secret_versions, request, response, operation, options - yield response, operation if block_given? - throw :response, response - end - rescue ::GRPC::BadStatus => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Gets metadata for a - # {::Google::Cloud::SecretManager::V1beta1::SecretVersion SecretVersion}. - # - # `projects/*/secrets/*/versions/latest` is an alias to the `latest` - # {::Google::Cloud::SecretManager::V1beta1::SecretVersion SecretVersion}. - # - # @overload get_secret_version(request, options = nil) - # Pass arguments to `get_secret_version` via a request object, either of type - # {::Google::Cloud::SecretManager::V1beta1::GetSecretVersionRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::SecretManager::V1beta1::GetSecretVersionRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. - # - # @overload get_secret_version(name: nil) - # Pass arguments to `get_secret_version` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param name [::String] - # Required. The resource name of the - # {::Google::Cloud::SecretManager::V1beta1::SecretVersion SecretVersion} in the format - # `projects/*/secrets/*/versions/*`. - # `projects/*/secrets/*/versions/latest` is an alias to the `latest` - # {::Google::Cloud::SecretManager::V1beta1::SecretVersion SecretVersion}. - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Google::Cloud::SecretManager::V1beta1::SecretVersion] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Google::Cloud::SecretManager::V1beta1::SecretVersion] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/cloud/secret_manager/v1beta1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::SecretManager::V1beta1::SecretManagerService::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::SecretManager::V1beta1::GetSecretVersionRequest.new - # - # # Call the get_secret_version method. - # result = client.get_secret_version request - # - # # The returned object is of type Google::Cloud::SecretManager::V1beta1::SecretVersion. - # p result - # - def get_secret_version request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::SecretManager::V1beta1::GetSecretVersionRequest - - # Converts hash and nil to an options object - options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h - - # Customize the options with defaults - metadata = @config.rpcs.get_secret_version.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::SecretManager::V1beta1::VERSION - metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - header_params = {} - if request.name - header_params["name"] = request.name - end - - request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") - metadata[:"x-goog-request-params"] ||= request_params_header - - options.apply_defaults timeout: @config.rpcs.get_secret_version.timeout, - metadata: metadata, - retry_policy: @config.rpcs.get_secret_version.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @secret_manager_service_stub.call_rpc :get_secret_version, request, options: options do |response, operation| - yield response, operation if block_given? - end - rescue ::GRPC::BadStatus => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Accesses a {::Google::Cloud::SecretManager::V1beta1::SecretVersion SecretVersion}. - # This call returns the secret data. - # - # `projects/*/secrets/*/versions/latest` is an alias to the `latest` - # {::Google::Cloud::SecretManager::V1beta1::SecretVersion SecretVersion}. - # - # @overload access_secret_version(request, options = nil) - # Pass arguments to `access_secret_version` via a request object, either of type - # {::Google::Cloud::SecretManager::V1beta1::AccessSecretVersionRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::SecretManager::V1beta1::AccessSecretVersionRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. - # - # @overload access_secret_version(name: nil) - # Pass arguments to `access_secret_version` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param name [::String] - # Required. The resource name of the - # {::Google::Cloud::SecretManager::V1beta1::SecretVersion SecretVersion} in the format - # `projects/*/secrets/*/versions/*`. - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Google::Cloud::SecretManager::V1beta1::AccessSecretVersionResponse] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Google::Cloud::SecretManager::V1beta1::AccessSecretVersionResponse] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/cloud/secret_manager/v1beta1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::SecretManager::V1beta1::SecretManagerService::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::SecretManager::V1beta1::AccessSecretVersionRequest.new - # - # # Call the access_secret_version method. - # result = client.access_secret_version request - # - # # The returned object is of type Google::Cloud::SecretManager::V1beta1::AccessSecretVersionResponse. - # p result - # - def access_secret_version request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::SecretManager::V1beta1::AccessSecretVersionRequest - - # Converts hash and nil to an options object - options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h - - # Customize the options with defaults - metadata = @config.rpcs.access_secret_version.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::SecretManager::V1beta1::VERSION - metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - header_params = {} - if request.name - header_params["name"] = request.name - end - - request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") - metadata[:"x-goog-request-params"] ||= request_params_header - - options.apply_defaults timeout: @config.rpcs.access_secret_version.timeout, - metadata: metadata, - retry_policy: @config.rpcs.access_secret_version.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @secret_manager_service_stub.call_rpc :access_secret_version, request, options: options do |response, operation| - yield response, operation if block_given? - end - rescue ::GRPC::BadStatus => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Disables a {::Google::Cloud::SecretManager::V1beta1::SecretVersion SecretVersion}. - # - # Sets the {::Google::Cloud::SecretManager::V1beta1::SecretVersion#state state} of the - # {::Google::Cloud::SecretManager::V1beta1::SecretVersion SecretVersion} to - # {::Google::Cloud::SecretManager::V1beta1::SecretVersion::State::DISABLED DISABLED}. - # - # @overload disable_secret_version(request, options = nil) - # Pass arguments to `disable_secret_version` via a request object, either of type - # {::Google::Cloud::SecretManager::V1beta1::DisableSecretVersionRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::SecretManager::V1beta1::DisableSecretVersionRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. - # - # @overload disable_secret_version(name: nil) - # Pass arguments to `disable_secret_version` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param name [::String] - # Required. The resource name of the - # {::Google::Cloud::SecretManager::V1beta1::SecretVersion SecretVersion} to disable in - # the format `projects/*/secrets/*/versions/*`. - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Google::Cloud::SecretManager::V1beta1::SecretVersion] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Google::Cloud::SecretManager::V1beta1::SecretVersion] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/cloud/secret_manager/v1beta1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::SecretManager::V1beta1::SecretManagerService::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::SecretManager::V1beta1::DisableSecretVersionRequest.new - # - # # Call the disable_secret_version method. - # result = client.disable_secret_version request - # - # # The returned object is of type Google::Cloud::SecretManager::V1beta1::SecretVersion. - # p result - # - def disable_secret_version request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::SecretManager::V1beta1::DisableSecretVersionRequest - - # Converts hash and nil to an options object - options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h - - # Customize the options with defaults - metadata = @config.rpcs.disable_secret_version.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::SecretManager::V1beta1::VERSION - metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - header_params = {} - if request.name - header_params["name"] = request.name - end - - request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") - metadata[:"x-goog-request-params"] ||= request_params_header - - options.apply_defaults timeout: @config.rpcs.disable_secret_version.timeout, - metadata: metadata, - retry_policy: @config.rpcs.disable_secret_version.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @secret_manager_service_stub.call_rpc :disable_secret_version, request, options: options do |response, operation| - yield response, operation if block_given? - end - rescue ::GRPC::BadStatus => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Enables a {::Google::Cloud::SecretManager::V1beta1::SecretVersion SecretVersion}. - # - # Sets the {::Google::Cloud::SecretManager::V1beta1::SecretVersion#state state} of the - # {::Google::Cloud::SecretManager::V1beta1::SecretVersion SecretVersion} to - # {::Google::Cloud::SecretManager::V1beta1::SecretVersion::State::ENABLED ENABLED}. - # - # @overload enable_secret_version(request, options = nil) - # Pass arguments to `enable_secret_version` via a request object, either of type - # {::Google::Cloud::SecretManager::V1beta1::EnableSecretVersionRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::SecretManager::V1beta1::EnableSecretVersionRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. - # - # @overload enable_secret_version(name: nil) - # Pass arguments to `enable_secret_version` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param name [::String] - # Required. The resource name of the - # {::Google::Cloud::SecretManager::V1beta1::SecretVersion SecretVersion} to enable in - # the format `projects/*/secrets/*/versions/*`. - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Google::Cloud::SecretManager::V1beta1::SecretVersion] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Google::Cloud::SecretManager::V1beta1::SecretVersion] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/cloud/secret_manager/v1beta1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::SecretManager::V1beta1::SecretManagerService::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::SecretManager::V1beta1::EnableSecretVersionRequest.new - # - # # Call the enable_secret_version method. - # result = client.enable_secret_version request - # - # # The returned object is of type Google::Cloud::SecretManager::V1beta1::SecretVersion. - # p result - # - def enable_secret_version request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::SecretManager::V1beta1::EnableSecretVersionRequest - - # Converts hash and nil to an options object - options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h - - # Customize the options with defaults - metadata = @config.rpcs.enable_secret_version.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::SecretManager::V1beta1::VERSION - metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - header_params = {} - if request.name - header_params["name"] = request.name - end - - request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") - metadata[:"x-goog-request-params"] ||= request_params_header - - options.apply_defaults timeout: @config.rpcs.enable_secret_version.timeout, - metadata: metadata, - retry_policy: @config.rpcs.enable_secret_version.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @secret_manager_service_stub.call_rpc :enable_secret_version, request, options: options do |response, operation| - yield response, operation if block_given? - end - rescue ::GRPC::BadStatus => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Destroys a {::Google::Cloud::SecretManager::V1beta1::SecretVersion SecretVersion}. - # - # Sets the {::Google::Cloud::SecretManager::V1beta1::SecretVersion#state state} of the - # {::Google::Cloud::SecretManager::V1beta1::SecretVersion SecretVersion} to - # {::Google::Cloud::SecretManager::V1beta1::SecretVersion::State::DESTROYED DESTROYED} and - # irrevocably destroys the secret data. - # - # @overload destroy_secret_version(request, options = nil) - # Pass arguments to `destroy_secret_version` via a request object, either of type - # {::Google::Cloud::SecretManager::V1beta1::DestroySecretVersionRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::SecretManager::V1beta1::DestroySecretVersionRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. - # - # @overload destroy_secret_version(name: nil) - # Pass arguments to `destroy_secret_version` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param name [::String] - # Required. The resource name of the - # {::Google::Cloud::SecretManager::V1beta1::SecretVersion SecretVersion} to destroy in - # the format `projects/*/secrets/*/versions/*`. - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Google::Cloud::SecretManager::V1beta1::SecretVersion] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Google::Cloud::SecretManager::V1beta1::SecretVersion] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/cloud/secret_manager/v1beta1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::SecretManager::V1beta1::SecretManagerService::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::SecretManager::V1beta1::DestroySecretVersionRequest.new - # - # # Call the destroy_secret_version method. - # result = client.destroy_secret_version request - # - # # The returned object is of type Google::Cloud::SecretManager::V1beta1::SecretVersion. - # p result - # - def destroy_secret_version request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::SecretManager::V1beta1::DestroySecretVersionRequest - - # Converts hash and nil to an options object - options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h - - # Customize the options with defaults - metadata = @config.rpcs.destroy_secret_version.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::SecretManager::V1beta1::VERSION - metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - header_params = {} - if request.name - header_params["name"] = request.name - end - - request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") - metadata[:"x-goog-request-params"] ||= request_params_header - - options.apply_defaults timeout: @config.rpcs.destroy_secret_version.timeout, - metadata: metadata, - retry_policy: @config.rpcs.destroy_secret_version.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @secret_manager_service_stub.call_rpc :destroy_secret_version, request, options: options do |response, operation| - yield response, operation if block_given? - end - rescue ::GRPC::BadStatus => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Sets the access control policy on the specified secret. Replaces any - # existing policy. - # - # Permissions on {::Google::Cloud::SecretManager::V1beta1::SecretVersion SecretVersions} - # are enforced according to the policy set on the associated - # {::Google::Cloud::SecretManager::V1beta1::Secret Secret}. - # - # @overload set_iam_policy(request, options = nil) - # Pass arguments to `set_iam_policy` via a request object, either of type - # {::Google::Iam::V1::SetIamPolicyRequest} or an equivalent Hash. - # - # @param request [::Google::Iam::V1::SetIamPolicyRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. - # - # @overload set_iam_policy(resource: nil, policy: nil, update_mask: nil) - # Pass arguments to `set_iam_policy` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param resource [::String] - # REQUIRED: The resource for which the policy is being specified. - # See the operation documentation for the appropriate value for this field. - # @param policy [::Google::Iam::V1::Policy, ::Hash] - # REQUIRED: The complete policy to be applied to the `resource`. The size of - # the policy is limited to a few 10s of KB. An empty policy is a - # valid policy but certain Cloud Platform services (such as Projects) - # might reject them. - # @param update_mask [::Google::Protobuf::FieldMask, ::Hash] - # OPTIONAL: A FieldMask specifying which fields of the policy to modify. Only - # the fields in the mask will be modified. If no mask is provided, the - # following default mask is used: - # - # `paths: "bindings, etag"` - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Google::Iam::V1::Policy] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Google::Iam::V1::Policy] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/cloud/secret_manager/v1beta1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::SecretManager::V1beta1::SecretManagerService::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Iam::V1::SetIamPolicyRequest.new - # - # # Call the set_iam_policy method. - # result = client.set_iam_policy request - # - # # The returned object is of type Google::Iam::V1::Policy. - # p result - # - def set_iam_policy request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Iam::V1::SetIamPolicyRequest - - # Converts hash and nil to an options object - options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h - - # Customize the options with defaults - metadata = @config.rpcs.set_iam_policy.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::SecretManager::V1beta1::VERSION - metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - header_params = {} - if request.resource - header_params["resource"] = request.resource - end - - request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") - metadata[:"x-goog-request-params"] ||= request_params_header - - options.apply_defaults timeout: @config.rpcs.set_iam_policy.timeout, - metadata: metadata, - retry_policy: @config.rpcs.set_iam_policy.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @secret_manager_service_stub.call_rpc :set_iam_policy, request, options: options do |response, operation| - yield response, operation if block_given? - end - rescue ::GRPC::BadStatus => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Gets the access control policy for a secret. - # Returns empty policy if the secret exists and does not have a policy set. - # - # @overload get_iam_policy(request, options = nil) - # Pass arguments to `get_iam_policy` via a request object, either of type - # {::Google::Iam::V1::GetIamPolicyRequest} or an equivalent Hash. - # - # @param request [::Google::Iam::V1::GetIamPolicyRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. - # - # @overload get_iam_policy(resource: nil, options: nil) - # Pass arguments to `get_iam_policy` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param resource [::String] - # REQUIRED: The resource for which the policy is being requested. - # See the operation documentation for the appropriate value for this field. - # @param options [::Google::Iam::V1::GetPolicyOptions, ::Hash] - # OPTIONAL: A `GetPolicyOptions` object for specifying options to - # `GetIamPolicy`. - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Google::Iam::V1::Policy] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Google::Iam::V1::Policy] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/cloud/secret_manager/v1beta1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::SecretManager::V1beta1::SecretManagerService::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Iam::V1::GetIamPolicyRequest.new - # - # # Call the get_iam_policy method. - # result = client.get_iam_policy request - # - # # The returned object is of type Google::Iam::V1::Policy. - # p result - # - def get_iam_policy request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Iam::V1::GetIamPolicyRequest - - # Converts hash and nil to an options object - options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h - - # Customize the options with defaults - metadata = @config.rpcs.get_iam_policy.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::SecretManager::V1beta1::VERSION - metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - header_params = {} - if request.resource - header_params["resource"] = request.resource - end - - request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") - metadata[:"x-goog-request-params"] ||= request_params_header - - options.apply_defaults timeout: @config.rpcs.get_iam_policy.timeout, - metadata: metadata, - retry_policy: @config.rpcs.get_iam_policy.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @secret_manager_service_stub.call_rpc :get_iam_policy, request, options: options do |response, operation| - yield response, operation if block_given? - end - rescue ::GRPC::BadStatus => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Returns permissions that a caller has for the specified secret. - # If the secret does not exist, this call returns an empty set of - # permissions, not a NOT_FOUND error. - # - # Note: This operation is designed to be used for building permission-aware - # UIs and command-line tools, not for authorization checking. This operation - # may "fail open" without warning. - # - # @overload test_iam_permissions(request, options = nil) - # Pass arguments to `test_iam_permissions` via a request object, either of type - # {::Google::Iam::V1::TestIamPermissionsRequest} or an equivalent Hash. - # - # @param request [::Google::Iam::V1::TestIamPermissionsRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. - # - # @overload test_iam_permissions(resource: nil, permissions: nil) - # Pass arguments to `test_iam_permissions` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param resource [::String] - # REQUIRED: The resource for which the policy detail is being requested. - # See the operation documentation for the appropriate value for this field. - # @param permissions [::Array<::String>] - # The set of permissions to check for the `resource`. Permissions with - # wildcards (such as '*' or 'storage.*') are not allowed. For more - # information see - # [IAM Overview](https://cloud.google.com/iam/docs/overview#permissions). - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Google::Iam::V1::TestIamPermissionsResponse] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Google::Iam::V1::TestIamPermissionsResponse] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/cloud/secret_manager/v1beta1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::SecretManager::V1beta1::SecretManagerService::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Iam::V1::TestIamPermissionsRequest.new - # - # # Call the test_iam_permissions method. - # result = client.test_iam_permissions request - # - # # The returned object is of type Google::Iam::V1::TestIamPermissionsResponse. - # p result - # - def test_iam_permissions request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Iam::V1::TestIamPermissionsRequest - - # Converts hash and nil to an options object - options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h - - # Customize the options with defaults - metadata = @config.rpcs.test_iam_permissions.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::SecretManager::V1beta1::VERSION - metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - header_params = {} - if request.resource - header_params["resource"] = request.resource - end - - request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") - metadata[:"x-goog-request-params"] ||= request_params_header - - options.apply_defaults timeout: @config.rpcs.test_iam_permissions.timeout, - metadata: metadata, - retry_policy: @config.rpcs.test_iam_permissions.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @secret_manager_service_stub.call_rpc :test_iam_permissions, request, options: options do |response, operation| - yield response, operation if block_given? - end - rescue ::GRPC::BadStatus => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Configuration class for the SecretManagerService API. - # - # This class represents the configuration for SecretManagerService, - # providing control over timeouts, retry behavior, logging, transport - # parameters, and other low-level controls. Certain parameters can also be - # applied individually to specific RPCs. See - # {::Google::Cloud::SecretManager::V1beta1::SecretManagerService::Client::Configuration::Rpcs} - # for a list of RPCs that can be configured independently. - # - # Configuration can be applied globally to all clients, or to a single client - # on construction. - # - # @example - # - # # Modify the global config, setting the timeout for - # # list_secrets to 20 seconds, - # # and all remaining timeouts to 10 seconds. - # ::Google::Cloud::SecretManager::V1beta1::SecretManagerService::Client.configure do |config| - # config.timeout = 10.0 - # config.rpcs.list_secrets.timeout = 20.0 - # end - # - # # Apply the above configuration only to a new client. - # client = ::Google::Cloud::SecretManager::V1beta1::SecretManagerService::Client.new do |config| - # config.timeout = 10.0 - # config.rpcs.list_secrets.timeout = 20.0 - # end - # - # @!attribute [rw] endpoint - # A custom service endpoint, as a hostname or hostname:port. The default is - # nil, indicating to use the default endpoint in the current universe domain. - # @return [::String,nil] - # @!attribute [rw] credentials - # Credentials to send with calls. You may provide any of the following types: - # * (`Google::Auth::Credentials`) A googleauth credentials object - # (see the [googleauth docs](https://rubydoc.info/gems/googleauth/Google/Auth/Credentials)) - # * (`Signet::OAuth2::Client`) A signet oauth2 client object - # (see the [signet docs](https://rubydoc.info/gems/signet/Signet/OAuth2/Client)) - # * (`GRPC::Core::Channel`) a gRPC channel with included credentials - # * (`GRPC::Core::ChannelCredentials`) a gRPC credentails object - # * (`nil`) indicating no credentials - # - # @note Warning: Passing a `String` to a keyfile path or a `Hash` of credentials - # is deprecated. Providing an unvalidated credential configuration to - # Google APIs can compromise the security of your systems and data. - # - # @example - # - # # The recommended way to provide credentials is to use the `make_creds` method - # # on the appropriate credentials class for your environment. - # - # require "googleauth" - # - # credentials = ::Google::Auth::ServiceAccountCredentials.make_creds( - # json_key_io: ::File.open("/path/to/keyfile.json") - # ) - # - # client = ::Google::Cloud::SecretManager::V1beta1::SecretManagerService::Client.new do |config| - # config.credentials = credentials - # end - # - # @note Warning: If you accept a credential configuration (JSON file or Hash) from an - # external source for authentication to Google Cloud, you must validate it before - # providing it to a Google API client library. Providing an unvalidated credential - # configuration to Google APIs can compromise the security of your systems and data. - # For more information, refer to [Validate credential configurations from external - # sources](https://cloud.google.com/docs/authentication/external/externally-sourced-credentials). - # @return [::Object] - # @!attribute [rw] scope - # The OAuth scopes - # @return [::Array<::String>] - # @!attribute [rw] lib_name - # The library name as recorded in instrumentation and logging - # @return [::String] - # @!attribute [rw] lib_version - # The library version as recorded in instrumentation and logging - # @return [::String] - # @!attribute [rw] channel_args - # Extra parameters passed to the gRPC channel. Note: this is ignored if a - # `GRPC::Core::Channel` object is provided as the credential. - # @return [::Hash] - # @!attribute [rw] interceptors - # An array of interceptors that are run before calls are executed. - # @return [::Array<::GRPC::ClientInterceptor>] - # @!attribute [rw] timeout - # The call timeout in seconds. - # @return [::Numeric] - # @!attribute [rw] metadata - # Additional gRPC headers to be sent with the call. - # @return [::Hash{::Symbol=>::String}] - # @!attribute [rw] retry_policy - # The retry policy. The value is a hash with the following keys: - # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds. - # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds. - # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier. - # * `:retry_codes` (*type:* `Array`) - The error codes that should - # trigger a retry. - # @return [::Hash] - # @!attribute [rw] quota_project - # A separate project against which to charge quota. - # @return [::String] - # @!attribute [rw] universe_domain - # The universe domain within which to make requests. This determines the - # default endpoint URL. The default value of nil uses the environment - # universe (usually the default "googleapis.com" universe). - # @return [::String,nil] - # @!attribute [rw] logger - # A custom logger to use for request/response debug logging, or the value - # `:default` (the default) to construct a default logger, or `nil` to - # explicitly disable logging. - # @return [::Logger,:default,nil] - # - class Configuration - extend ::Gapic::Config - - # @private - # The endpoint specific to the default "googleapis.com" universe. Deprecated. - DEFAULT_ENDPOINT = "secretmanager.googleapis.com" - - config_attr :endpoint, nil, ::String, nil - config_attr :credentials, nil do |value| - allowed = [::String, ::Hash, ::Proc, ::Symbol, ::Google::Auth::Credentials, ::Google::Auth::BaseClient, ::Signet::OAuth2::Client, nil] - allowed += [::GRPC::Core::Channel, ::GRPC::Core::ChannelCredentials] if defined? ::GRPC::Core::Channel - allowed.any? { |klass| klass === value } - end - config_attr :scope, nil, ::String, ::Array, nil - config_attr :lib_name, nil, ::String, nil - config_attr :lib_version, nil, ::String, nil - config_attr(:channel_args, { "grpc.service_config_disable_resolution" => 1 }, ::Hash, nil) - config_attr :interceptors, nil, ::Array, nil - config_attr :timeout, nil, ::Numeric, nil - config_attr :metadata, nil, ::Hash, nil - config_attr :retry_policy, nil, ::Hash, ::Proc, nil - config_attr :quota_project, nil, ::String, nil - config_attr :universe_domain, nil, ::String, nil - config_attr :logger, :default, ::Logger, nil, :default - - # @private - def initialize parent_config = nil - @parent_config = parent_config unless parent_config.nil? - - yield self if block_given? - end - - ## - # Configurations for individual RPCs - # @return [Rpcs] - # - def rpcs - @rpcs ||= begin - parent_rpcs = nil - parent_rpcs = @parent_config.rpcs if defined?(@parent_config) && @parent_config.respond_to?(:rpcs) - Rpcs.new parent_rpcs - end - end - - ## - # Configuration for the channel pool - # @return [::Gapic::ServiceStub::ChannelPool::Configuration] - # - def channel_pool - @channel_pool ||= ::Gapic::ServiceStub::ChannelPool::Configuration.new - end - - ## - # Configuration RPC class for the SecretManagerService API. - # - # Includes fields providing the configuration for each RPC in this service. - # Each configuration object is of type `Gapic::Config::Method` and includes - # the following configuration fields: - # - # * `timeout` (*type:* `Numeric`) - The call timeout in seconds - # * `metadata` (*type:* `Hash{Symbol=>String}`) - Additional gRPC headers - # * `retry_policy (*type:* `Hash`) - The retry policy. The policy fields - # include the following keys: - # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds. - # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds. - # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier. - # * `:retry_codes` (*type:* `Array`) - The error codes that should - # trigger a retry. - # - class Rpcs - ## - # RPC-specific configuration for `list_secrets` - # @return [::Gapic::Config::Method] - # - attr_reader :list_secrets - ## - # RPC-specific configuration for `create_secret` - # @return [::Gapic::Config::Method] - # - attr_reader :create_secret - ## - # RPC-specific configuration for `add_secret_version` - # @return [::Gapic::Config::Method] - # - attr_reader :add_secret_version - ## - # RPC-specific configuration for `get_secret` - # @return [::Gapic::Config::Method] - # - attr_reader :get_secret - ## - # RPC-specific configuration for `update_secret` - # @return [::Gapic::Config::Method] - # - attr_reader :update_secret - ## - # RPC-specific configuration for `delete_secret` - # @return [::Gapic::Config::Method] - # - attr_reader :delete_secret - ## - # RPC-specific configuration for `list_secret_versions` - # @return [::Gapic::Config::Method] - # - attr_reader :list_secret_versions - ## - # RPC-specific configuration for `get_secret_version` - # @return [::Gapic::Config::Method] - # - attr_reader :get_secret_version - ## - # RPC-specific configuration for `access_secret_version` - # @return [::Gapic::Config::Method] - # - attr_reader :access_secret_version - ## - # RPC-specific configuration for `disable_secret_version` - # @return [::Gapic::Config::Method] - # - attr_reader :disable_secret_version - ## - # RPC-specific configuration for `enable_secret_version` - # @return [::Gapic::Config::Method] - # - attr_reader :enable_secret_version - ## - # RPC-specific configuration for `destroy_secret_version` - # @return [::Gapic::Config::Method] - # - attr_reader :destroy_secret_version - ## - # RPC-specific configuration for `set_iam_policy` - # @return [::Gapic::Config::Method] - # - attr_reader :set_iam_policy - ## - # RPC-specific configuration for `get_iam_policy` - # @return [::Gapic::Config::Method] - # - attr_reader :get_iam_policy - ## - # RPC-specific configuration for `test_iam_permissions` - # @return [::Gapic::Config::Method] - # - attr_reader :test_iam_permissions - - # @private - def initialize parent_rpcs = nil - list_secrets_config = parent_rpcs.list_secrets if parent_rpcs.respond_to? :list_secrets - @list_secrets = ::Gapic::Config::Method.new list_secrets_config - create_secret_config = parent_rpcs.create_secret if parent_rpcs.respond_to? :create_secret - @create_secret = ::Gapic::Config::Method.new create_secret_config - add_secret_version_config = parent_rpcs.add_secret_version if parent_rpcs.respond_to? :add_secret_version - @add_secret_version = ::Gapic::Config::Method.new add_secret_version_config - get_secret_config = parent_rpcs.get_secret if parent_rpcs.respond_to? :get_secret - @get_secret = ::Gapic::Config::Method.new get_secret_config - update_secret_config = parent_rpcs.update_secret if parent_rpcs.respond_to? :update_secret - @update_secret = ::Gapic::Config::Method.new update_secret_config - delete_secret_config = parent_rpcs.delete_secret if parent_rpcs.respond_to? :delete_secret - @delete_secret = ::Gapic::Config::Method.new delete_secret_config - list_secret_versions_config = parent_rpcs.list_secret_versions if parent_rpcs.respond_to? :list_secret_versions - @list_secret_versions = ::Gapic::Config::Method.new list_secret_versions_config - get_secret_version_config = parent_rpcs.get_secret_version if parent_rpcs.respond_to? :get_secret_version - @get_secret_version = ::Gapic::Config::Method.new get_secret_version_config - access_secret_version_config = parent_rpcs.access_secret_version if parent_rpcs.respond_to? :access_secret_version - @access_secret_version = ::Gapic::Config::Method.new access_secret_version_config - disable_secret_version_config = parent_rpcs.disable_secret_version if parent_rpcs.respond_to? :disable_secret_version - @disable_secret_version = ::Gapic::Config::Method.new disable_secret_version_config - enable_secret_version_config = parent_rpcs.enable_secret_version if parent_rpcs.respond_to? :enable_secret_version - @enable_secret_version = ::Gapic::Config::Method.new enable_secret_version_config - destroy_secret_version_config = parent_rpcs.destroy_secret_version if parent_rpcs.respond_to? :destroy_secret_version - @destroy_secret_version = ::Gapic::Config::Method.new destroy_secret_version_config - set_iam_policy_config = parent_rpcs.set_iam_policy if parent_rpcs.respond_to? :set_iam_policy - @set_iam_policy = ::Gapic::Config::Method.new set_iam_policy_config - get_iam_policy_config = parent_rpcs.get_iam_policy if parent_rpcs.respond_to? :get_iam_policy - @get_iam_policy = ::Gapic::Config::Method.new get_iam_policy_config - test_iam_permissions_config = parent_rpcs.test_iam_permissions if parent_rpcs.respond_to? :test_iam_permissions - @test_iam_permissions = ::Gapic::Config::Method.new test_iam_permissions_config - - yield self if block_given? - end - end - end - end - end - end - end - end -end diff --git a/owl-bot-staging/google-cloud-secret_manager-v1beta1/lib/google/cloud/secret_manager/v1beta1/secret_manager_service/credentials.rb b/owl-bot-staging/google-cloud-secret_manager-v1beta1/lib/google/cloud/secret_manager/v1beta1/secret_manager_service/credentials.rb deleted file mode 100644 index 3fe96f0aee79..000000000000 --- a/owl-bot-staging/google-cloud-secret_manager-v1beta1/lib/google/cloud/secret_manager/v1beta1/secret_manager_service/credentials.rb +++ /dev/null @@ -1,51 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -require "googleauth" - -module Google - module Cloud - module SecretManager - module V1beta1 - module SecretManagerService - # Credentials for the SecretManagerService API. - class Credentials < ::Google::Auth::Credentials - self.scope = [ - "https://www.googleapis.com/auth/cloud-platform" - ] - self.env_vars = [ - "SECRET_MANAGER_CREDENTIALS", - "SECRET_MANAGER_KEYFILE", - "GOOGLE_CLOUD_CREDENTIALS", - "GOOGLE_CLOUD_KEYFILE", - "GCLOUD_KEYFILE", - "SECRET_MANAGER_CREDENTIALS_JSON", - "SECRET_MANAGER_KEYFILE_JSON", - "GOOGLE_CLOUD_CREDENTIALS_JSON", - "GOOGLE_CLOUD_KEYFILE_JSON", - "GCLOUD_KEYFILE_JSON" - ] - self.paths = [ - "~/.config/google_cloud/application_default_credentials.json" - ] - end - end - end - end - end -end diff --git a/owl-bot-staging/google-cloud-secret_manager-v1beta1/lib/google/cloud/secret_manager/v1beta1/secret_manager_service/paths.rb b/owl-bot-staging/google-cloud-secret_manager-v1beta1/lib/google/cloud/secret_manager/v1beta1/secret_manager_service/paths.rb deleted file mode 100644 index 504b57a7a147..000000000000 --- a/owl-bot-staging/google-cloud-secret_manager-v1beta1/lib/google/cloud/secret_manager/v1beta1/secret_manager_service/paths.rb +++ /dev/null @@ -1,83 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - - -module Google - module Cloud - module SecretManager - module V1beta1 - module SecretManagerService - # Path helper methods for the SecretManagerService API. - module Paths - ## - # Create a fully-qualified Project resource string. - # - # The resource will be in the following format: - # - # `projects/{project}` - # - # @param project [String] - # - # @return [::String] - def project_path project: - "projects/#{project}" - end - - ## - # Create a fully-qualified Secret resource string. - # - # The resource will be in the following format: - # - # `projects/{project}/secrets/{secret}` - # - # @param project [String] - # @param secret [String] - # - # @return [::String] - def secret_path project:, secret: - raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" - - "projects/#{project}/secrets/#{secret}" - end - - ## - # Create a fully-qualified SecretVersion resource string. - # - # The resource will be in the following format: - # - # `projects/{project}/secrets/{secret}/versions/{secret_version}` - # - # @param project [String] - # @param secret [String] - # @param secret_version [String] - # - # @return [::String] - def secret_version_path project:, secret:, secret_version: - raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" - raise ::ArgumentError, "secret cannot contain /" if secret.to_s.include? "/" - - "projects/#{project}/secrets/#{secret}/versions/#{secret_version}" - end - - extend self - end - end - end - end - end -end diff --git a/owl-bot-staging/google-cloud-secret_manager-v1beta1/lib/google/cloud/secret_manager/v1beta1/secret_manager_service/rest.rb b/owl-bot-staging/google-cloud-secret_manager-v1beta1/lib/google/cloud/secret_manager/v1beta1/secret_manager_service/rest.rb deleted file mode 100644 index 06dc1cced025..000000000000 --- a/owl-bot-staging/google-cloud-secret_manager-v1beta1/lib/google/cloud/secret_manager/v1beta1/secret_manager_service/rest.rb +++ /dev/null @@ -1,59 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -require "gapic/rest" -require "gapic/config" -require "gapic/config/method" - -require "google/cloud/secret_manager/v1beta1/version" -require "google/cloud/secret_manager/v1beta1/bindings_override" - -require "google/cloud/secret_manager/v1beta1/secret_manager_service/credentials" -require "google/cloud/secret_manager/v1beta1/secret_manager_service/paths" -require "google/cloud/secret_manager/v1beta1/secret_manager_service/rest/client" - -module Google - module Cloud - module SecretManager - module V1beta1 - ## - # Secret Manager Service - # - # Manages secrets and operations using those secrets. Implements a REST - # model with the following objects: - # - # * {::Google::Cloud::SecretManager::V1beta1::Secret Secret} - # * {::Google::Cloud::SecretManager::V1beta1::SecretVersion SecretVersion} - # - # To load this service and instantiate a REST client: - # - # require "google/cloud/secret_manager/v1beta1/secret_manager_service/rest" - # client = ::Google::Cloud::SecretManager::V1beta1::SecretManagerService::Rest::Client.new - # - module SecretManagerService - # Client for the REST transport - module Rest - end - end - end - end - end -end - -helper_path = ::File.join __dir__, "rest", "helpers.rb" -require "google/cloud/secret_manager/v1beta1/secret_manager_service/rest/helpers" if ::File.file? helper_path diff --git a/owl-bot-staging/google-cloud-secret_manager-v1beta1/lib/google/cloud/secret_manager/v1beta1/secret_manager_service/rest/client.rb b/owl-bot-staging/google-cloud-secret_manager-v1beta1/lib/google/cloud/secret_manager/v1beta1/secret_manager_service/rest/client.rb deleted file mode 100644 index ca13388815e1..000000000000 --- a/owl-bot-staging/google-cloud-secret_manager-v1beta1/lib/google/cloud/secret_manager/v1beta1/secret_manager_service/rest/client.rb +++ /dev/null @@ -1,1802 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -require "google/cloud/errors" -require "google/cloud/secrets/v1beta1/service_pb" -require "google/cloud/secret_manager/v1beta1/secret_manager_service/rest/service_stub" -require "google/cloud/location/rest" - -module Google - module Cloud - module SecretManager - module V1beta1 - module SecretManagerService - module Rest - ## - # REST client for the SecretManagerService service. - # - # Secret Manager Service - # - # Manages secrets and operations using those secrets. Implements a REST - # model with the following objects: - # - # * {::Google::Cloud::SecretManager::V1beta1::Secret Secret} - # * {::Google::Cloud::SecretManager::V1beta1::SecretVersion SecretVersion} - # - class Client - # @private - API_VERSION = "" - - # @private - DEFAULT_ENDPOINT_TEMPLATE = "secretmanager.$UNIVERSE_DOMAIN$" - - include Paths - - # @private - attr_reader :secret_manager_service_stub - - ## - # Configure the SecretManagerService Client class. - # - # See {::Google::Cloud::SecretManager::V1beta1::SecretManagerService::Rest::Client::Configuration} - # for a description of the configuration fields. - # - # @example - # - # # Modify the configuration for all SecretManagerService clients - # ::Google::Cloud::SecretManager::V1beta1::SecretManagerService::Rest::Client.configure do |config| - # config.timeout = 10.0 - # end - # - # @yield [config] Configure the Client client. - # @yieldparam config [Client::Configuration] - # - # @return [Client::Configuration] - # - def self.configure - @configure ||= begin - namespace = ["Google", "Cloud", "SecretManager", "V1beta1"] - parent_config = while namespace.any? - parent_name = namespace.join "::" - parent_const = const_get parent_name - break parent_const.configure if parent_const.respond_to? :configure - namespace.pop - end - default_config = Client::Configuration.new parent_config - - default_config.rpcs.list_secrets.timeout = 60.0 - - default_config.rpcs.create_secret.timeout = 60.0 - - default_config.rpcs.add_secret_version.timeout = 60.0 - - default_config.rpcs.get_secret.timeout = 60.0 - - default_config.rpcs.update_secret.timeout = 60.0 - - default_config.rpcs.delete_secret.timeout = 60.0 - - default_config.rpcs.list_secret_versions.timeout = 60.0 - - default_config.rpcs.get_secret_version.timeout = 60.0 - - default_config.rpcs.access_secret_version.timeout = 60.0 - default_config.rpcs.access_secret_version.retry_policy = { - initial_delay: 1.0, max_delay: 60.0, multiplier: 1.3, retry_codes: [14, 2] - } - - default_config.rpcs.disable_secret_version.timeout = 60.0 - - default_config.rpcs.enable_secret_version.timeout = 60.0 - - default_config.rpcs.destroy_secret_version.timeout = 60.0 - - default_config.rpcs.set_iam_policy.timeout = 60.0 - - default_config.rpcs.get_iam_policy.timeout = 60.0 - - default_config.rpcs.test_iam_permissions.timeout = 60.0 - - default_config - end - yield @configure if block_given? - @configure - end - - ## - # Configure the SecretManagerService Client instance. - # - # The configuration is set to the derived mode, meaning that values can be changed, - # but structural changes (adding new fields, etc.) are not allowed. Structural changes - # should be made on {Client.configure}. - # - # See {::Google::Cloud::SecretManager::V1beta1::SecretManagerService::Rest::Client::Configuration} - # for a description of the configuration fields. - # - # @yield [config] Configure the Client client. - # @yieldparam config [Client::Configuration] - # - # @return [Client::Configuration] - # - def configure - yield @config if block_given? - @config - end - - ## - # The effective universe domain - # - # @return [String] - # - def universe_domain - @secret_manager_service_stub.universe_domain - end - - ## - # Create a new SecretManagerService REST client object. - # - # @example - # - # # Create a client using the default configuration - # client = ::Google::Cloud::SecretManager::V1beta1::SecretManagerService::Rest::Client.new - # - # # Create a client using a custom configuration - # client = ::Google::Cloud::SecretManager::V1beta1::SecretManagerService::Rest::Client.new do |config| - # config.timeout = 10.0 - # end - # - # @yield [config] Configure the SecretManagerService client. - # @yieldparam config [Client::Configuration] - # - def initialize - # Create the configuration object - @config = Configuration.new Client.configure - - # Yield the configuration if needed - yield @config if block_given? - - # Create credentials - credentials = @config.credentials - # Use self-signed JWT if the endpoint is unchanged from default, - # but only if the default endpoint does not have a region prefix. - enable_self_signed_jwt = @config.endpoint.nil? || - (@config.endpoint == Configuration::DEFAULT_ENDPOINT && - !@config.endpoint.split(".").first.include?("-")) - credentials ||= Credentials.default scope: @config.scope, - enable_self_signed_jwt: enable_self_signed_jwt - if credentials.is_a?(::String) || credentials.is_a?(::Hash) - credentials = Credentials.new credentials, scope: @config.scope - end - - @quota_project_id = @config.quota_project - @quota_project_id ||= credentials.quota_project_id if credentials.respond_to? :quota_project_id - - @secret_manager_service_stub = ::Google::Cloud::SecretManager::V1beta1::SecretManagerService::Rest::ServiceStub.new( - endpoint: @config.endpoint, - endpoint_template: DEFAULT_ENDPOINT_TEMPLATE, - universe_domain: @config.universe_domain, - credentials: credentials, - logger: @config.logger - ) - - @secret_manager_service_stub.logger(stub: true)&.info do |entry| - entry.set_system_name - entry.set_service - entry.message = "Created client for #{entry.service}" - entry.set_credentials_fields credentials - entry.set "customEndpoint", @config.endpoint if @config.endpoint - entry.set "defaultTimeout", @config.timeout if @config.timeout - entry.set "quotaProject", @quota_project_id if @quota_project_id - end - - @location_client = Google::Cloud::Location::Locations::Rest::Client.new do |config| - config.credentials = credentials - config.quota_project = @quota_project_id - config.endpoint = @secret_manager_service_stub.endpoint - config.universe_domain = @secret_manager_service_stub.universe_domain - config.bindings_override = @config.bindings_override - config.logger = @secret_manager_service_stub.logger if config.respond_to? :logger= - end - end - - ## - # Get the associated client for mix-in of the Locations. - # - # @return [Google::Cloud::Location::Locations::Rest::Client] - # - attr_reader :location_client - - ## - # The logger used for request/response debug logging. - # - # @return [Logger] - # - def logger - @secret_manager_service_stub.logger - end - - # Service calls - - ## - # Lists {::Google::Cloud::SecretManager::V1beta1::Secret Secrets}. - # - # @overload list_secrets(request, options = nil) - # Pass arguments to `list_secrets` via a request object, either of type - # {::Google::Cloud::SecretManager::V1beta1::ListSecretsRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::SecretManager::V1beta1::ListSecretsRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @overload list_secrets(parent: nil, page_size: nil, page_token: nil) - # Pass arguments to `list_secrets` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param parent [::String] - # Required. The resource name of the project associated with the - # {::Google::Cloud::SecretManager::V1beta1::Secret Secrets}, in the format `projects/*`. - # @param page_size [::Integer] - # Optional. The maximum number of results to be returned in a single page. If - # set to 0, the server decides the number of results to return. If the - # number is greater than 25000, it is capped at 25000. - # @param page_token [::String] - # Optional. Pagination token, returned earlier via - # {::Google::Cloud::SecretManager::V1beta1::ListSecretsResponse#next_page_token ListSecretsResponse.next_page_token}. - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Gapic::Rest::PagedEnumerable<::Google::Cloud::SecretManager::V1beta1::Secret>] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Gapic::Rest::PagedEnumerable<::Google::Cloud::SecretManager::V1beta1::Secret>] - # - # @raise [::Google::Cloud::Error] if the REST call is aborted. - # - # @example Basic example - # require "google/cloud/secret_manager/v1beta1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::SecretManager::V1beta1::SecretManagerService::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::SecretManager::V1beta1::ListSecretsRequest.new - # - # # Call the list_secrets method. - # result = client.list_secrets request - # - # # The returned object is of type Gapic::PagedEnumerable. You can iterate - # # over elements, and API calls will be issued to fetch pages as needed. - # result.each do |item| - # # Each element is of type ::Google::Cloud::SecretManager::V1beta1::Secret. - # p item - # end - # - def list_secrets request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::SecretManager::V1beta1::ListSecretsRequest - - # Converts hash and nil to an options object - options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h - - # Customize the options with defaults - call_metadata = @config.rpcs.list_secrets.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::SecretManager::V1beta1::VERSION, - transports_version_send: [:rest] - - call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - options.apply_defaults timeout: @config.rpcs.list_secrets.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.list_secrets.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @secret_manager_service_stub.list_secrets request, options do |result, operation| - result = ::Gapic::Rest::PagedEnumerable.new @secret_manager_service_stub, :list_secrets, "secrets", request, result, options - yield result, operation if block_given? - throw :response, result - end - rescue ::Gapic::Rest::Error => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Creates a new {::Google::Cloud::SecretManager::V1beta1::Secret Secret} containing no - # {::Google::Cloud::SecretManager::V1beta1::SecretVersion SecretVersions}. - # - # @overload create_secret(request, options = nil) - # Pass arguments to `create_secret` via a request object, either of type - # {::Google::Cloud::SecretManager::V1beta1::CreateSecretRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::SecretManager::V1beta1::CreateSecretRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @overload create_secret(parent: nil, secret_id: nil, secret: nil) - # Pass arguments to `create_secret` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param parent [::String] - # Required. The resource name of the project to associate with the - # {::Google::Cloud::SecretManager::V1beta1::Secret Secret}, in the format `projects/*`. - # @param secret_id [::String] - # Required. This must be unique within the project. - # - # A secret ID is a string with a maximum length of 255 characters and can - # contain uppercase and lowercase letters, numerals, and the hyphen (`-`) and - # underscore (`_`) characters. - # @param secret [::Google::Cloud::SecretManager::V1beta1::Secret, ::Hash] - # Required. A {::Google::Cloud::SecretManager::V1beta1::Secret Secret} with initial - # field values. - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Cloud::SecretManager::V1beta1::Secret] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::SecretManager::V1beta1::Secret] - # - # @raise [::Google::Cloud::Error] if the REST call is aborted. - # - # @example Basic example - # require "google/cloud/secret_manager/v1beta1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::SecretManager::V1beta1::SecretManagerService::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::SecretManager::V1beta1::CreateSecretRequest.new - # - # # Call the create_secret method. - # result = client.create_secret request - # - # # The returned object is of type Google::Cloud::SecretManager::V1beta1::Secret. - # p result - # - def create_secret request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::SecretManager::V1beta1::CreateSecretRequest - - # Converts hash and nil to an options object - options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h - - # Customize the options with defaults - call_metadata = @config.rpcs.create_secret.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::SecretManager::V1beta1::VERSION, - transports_version_send: [:rest] - - call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - options.apply_defaults timeout: @config.rpcs.create_secret.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.create_secret.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @secret_manager_service_stub.create_secret request, options do |result, operation| - yield result, operation if block_given? - end - rescue ::Gapic::Rest::Error => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Creates a new {::Google::Cloud::SecretManager::V1beta1::SecretVersion SecretVersion} - # containing secret data and attaches it to an existing - # {::Google::Cloud::SecretManager::V1beta1::Secret Secret}. - # - # @overload add_secret_version(request, options = nil) - # Pass arguments to `add_secret_version` via a request object, either of type - # {::Google::Cloud::SecretManager::V1beta1::AddSecretVersionRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::SecretManager::V1beta1::AddSecretVersionRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @overload add_secret_version(parent: nil, payload: nil) - # Pass arguments to `add_secret_version` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param parent [::String] - # Required. The resource name of the - # {::Google::Cloud::SecretManager::V1beta1::Secret Secret} to associate with the - # {::Google::Cloud::SecretManager::V1beta1::SecretVersion SecretVersion} in the format - # `projects/*/secrets/*`. - # @param payload [::Google::Cloud::SecretManager::V1beta1::SecretPayload, ::Hash] - # Required. The secret payload of the - # {::Google::Cloud::SecretManager::V1beta1::SecretVersion SecretVersion}. - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Cloud::SecretManager::V1beta1::SecretVersion] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::SecretManager::V1beta1::SecretVersion] - # - # @raise [::Google::Cloud::Error] if the REST call is aborted. - # - # @example Basic example - # require "google/cloud/secret_manager/v1beta1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::SecretManager::V1beta1::SecretManagerService::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::SecretManager::V1beta1::AddSecretVersionRequest.new - # - # # Call the add_secret_version method. - # result = client.add_secret_version request - # - # # The returned object is of type Google::Cloud::SecretManager::V1beta1::SecretVersion. - # p result - # - def add_secret_version request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::SecretManager::V1beta1::AddSecretVersionRequest - - # Converts hash and nil to an options object - options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h - - # Customize the options with defaults - call_metadata = @config.rpcs.add_secret_version.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::SecretManager::V1beta1::VERSION, - transports_version_send: [:rest] - - call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - options.apply_defaults timeout: @config.rpcs.add_secret_version.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.add_secret_version.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @secret_manager_service_stub.add_secret_version request, options do |result, operation| - yield result, operation if block_given? - end - rescue ::Gapic::Rest::Error => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Gets metadata for a given {::Google::Cloud::SecretManager::V1beta1::Secret Secret}. - # - # @overload get_secret(request, options = nil) - # Pass arguments to `get_secret` via a request object, either of type - # {::Google::Cloud::SecretManager::V1beta1::GetSecretRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::SecretManager::V1beta1::GetSecretRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @overload get_secret(name: nil) - # Pass arguments to `get_secret` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param name [::String] - # Required. The resource name of the - # {::Google::Cloud::SecretManager::V1beta1::Secret Secret}, in the format - # `projects/*/secrets/*`. - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Cloud::SecretManager::V1beta1::Secret] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::SecretManager::V1beta1::Secret] - # - # @raise [::Google::Cloud::Error] if the REST call is aborted. - # - # @example Basic example - # require "google/cloud/secret_manager/v1beta1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::SecretManager::V1beta1::SecretManagerService::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::SecretManager::V1beta1::GetSecretRequest.new - # - # # Call the get_secret method. - # result = client.get_secret request - # - # # The returned object is of type Google::Cloud::SecretManager::V1beta1::Secret. - # p result - # - def get_secret request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::SecretManager::V1beta1::GetSecretRequest - - # Converts hash and nil to an options object - options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h - - # Customize the options with defaults - call_metadata = @config.rpcs.get_secret.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::SecretManager::V1beta1::VERSION, - transports_version_send: [:rest] - - call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - options.apply_defaults timeout: @config.rpcs.get_secret.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.get_secret.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @secret_manager_service_stub.get_secret request, options do |result, operation| - yield result, operation if block_given? - end - rescue ::Gapic::Rest::Error => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Updates metadata of an existing - # {::Google::Cloud::SecretManager::V1beta1::Secret Secret}. - # - # @overload update_secret(request, options = nil) - # Pass arguments to `update_secret` via a request object, either of type - # {::Google::Cloud::SecretManager::V1beta1::UpdateSecretRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::SecretManager::V1beta1::UpdateSecretRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @overload update_secret(secret: nil, update_mask: nil) - # Pass arguments to `update_secret` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param secret [::Google::Cloud::SecretManager::V1beta1::Secret, ::Hash] - # Required. {::Google::Cloud::SecretManager::V1beta1::Secret Secret} with updated field - # values. - # @param update_mask [::Google::Protobuf::FieldMask, ::Hash] - # Required. Specifies the fields to be updated. - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Cloud::SecretManager::V1beta1::Secret] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::SecretManager::V1beta1::Secret] - # - # @raise [::Google::Cloud::Error] if the REST call is aborted. - # - # @example Basic example - # require "google/cloud/secret_manager/v1beta1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::SecretManager::V1beta1::SecretManagerService::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::SecretManager::V1beta1::UpdateSecretRequest.new - # - # # Call the update_secret method. - # result = client.update_secret request - # - # # The returned object is of type Google::Cloud::SecretManager::V1beta1::Secret. - # p result - # - def update_secret request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::SecretManager::V1beta1::UpdateSecretRequest - - # Converts hash and nil to an options object - options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h - - # Customize the options with defaults - call_metadata = @config.rpcs.update_secret.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::SecretManager::V1beta1::VERSION, - transports_version_send: [:rest] - - call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - options.apply_defaults timeout: @config.rpcs.update_secret.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.update_secret.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @secret_manager_service_stub.update_secret request, options do |result, operation| - yield result, operation if block_given? - end - rescue ::Gapic::Rest::Error => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Deletes a {::Google::Cloud::SecretManager::V1beta1::Secret Secret}. - # - # @overload delete_secret(request, options = nil) - # Pass arguments to `delete_secret` via a request object, either of type - # {::Google::Cloud::SecretManager::V1beta1::DeleteSecretRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::SecretManager::V1beta1::DeleteSecretRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @overload delete_secret(name: nil) - # Pass arguments to `delete_secret` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param name [::String] - # Required. The resource name of the - # {::Google::Cloud::SecretManager::V1beta1::Secret Secret} to delete in the format - # `projects/*/secrets/*`. - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Protobuf::Empty] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Protobuf::Empty] - # - # @raise [::Google::Cloud::Error] if the REST call is aborted. - # - # @example Basic example - # require "google/cloud/secret_manager/v1beta1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::SecretManager::V1beta1::SecretManagerService::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::SecretManager::V1beta1::DeleteSecretRequest.new - # - # # Call the delete_secret method. - # result = client.delete_secret request - # - # # The returned object is of type Google::Protobuf::Empty. - # p result - # - def delete_secret request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::SecretManager::V1beta1::DeleteSecretRequest - - # Converts hash and nil to an options object - options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h - - # Customize the options with defaults - call_metadata = @config.rpcs.delete_secret.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::SecretManager::V1beta1::VERSION, - transports_version_send: [:rest] - - call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - options.apply_defaults timeout: @config.rpcs.delete_secret.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.delete_secret.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @secret_manager_service_stub.delete_secret request, options do |result, operation| - yield result, operation if block_given? - end - rescue ::Gapic::Rest::Error => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Lists {::Google::Cloud::SecretManager::V1beta1::SecretVersion SecretVersions}. This - # call does not return secret data. - # - # @overload list_secret_versions(request, options = nil) - # Pass arguments to `list_secret_versions` via a request object, either of type - # {::Google::Cloud::SecretManager::V1beta1::ListSecretVersionsRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::SecretManager::V1beta1::ListSecretVersionsRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @overload list_secret_versions(parent: nil, page_size: nil, page_token: nil) - # Pass arguments to `list_secret_versions` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param parent [::String] - # Required. The resource name of the - # {::Google::Cloud::SecretManager::V1beta1::Secret Secret} associated with the - # {::Google::Cloud::SecretManager::V1beta1::SecretVersion SecretVersions} to list, in - # the format `projects/*/secrets/*`. - # @param page_size [::Integer] - # Optional. The maximum number of results to be returned in a single page. If - # set to 0, the server decides the number of results to return. If the - # number is greater than 25000, it is capped at 25000. - # @param page_token [::String] - # Optional. Pagination token, returned earlier via - # ListSecretVersionsResponse.next_page_token][]. - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Gapic::Rest::PagedEnumerable<::Google::Cloud::SecretManager::V1beta1::SecretVersion>] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Gapic::Rest::PagedEnumerable<::Google::Cloud::SecretManager::V1beta1::SecretVersion>] - # - # @raise [::Google::Cloud::Error] if the REST call is aborted. - # - # @example Basic example - # require "google/cloud/secret_manager/v1beta1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::SecretManager::V1beta1::SecretManagerService::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::SecretManager::V1beta1::ListSecretVersionsRequest.new - # - # # Call the list_secret_versions method. - # result = client.list_secret_versions request - # - # # The returned object is of type Gapic::PagedEnumerable. You can iterate - # # over elements, and API calls will be issued to fetch pages as needed. - # result.each do |item| - # # Each element is of type ::Google::Cloud::SecretManager::V1beta1::SecretVersion. - # p item - # end - # - def list_secret_versions request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::SecretManager::V1beta1::ListSecretVersionsRequest - - # Converts hash and nil to an options object - options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h - - # Customize the options with defaults - call_metadata = @config.rpcs.list_secret_versions.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::SecretManager::V1beta1::VERSION, - transports_version_send: [:rest] - - call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - options.apply_defaults timeout: @config.rpcs.list_secret_versions.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.list_secret_versions.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @secret_manager_service_stub.list_secret_versions request, options do |result, operation| - result = ::Gapic::Rest::PagedEnumerable.new @secret_manager_service_stub, :list_secret_versions, "versions", request, result, options - yield result, operation if block_given? - throw :response, result - end - rescue ::Gapic::Rest::Error => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Gets metadata for a - # {::Google::Cloud::SecretManager::V1beta1::SecretVersion SecretVersion}. - # - # `projects/*/secrets/*/versions/latest` is an alias to the `latest` - # {::Google::Cloud::SecretManager::V1beta1::SecretVersion SecretVersion}. - # - # @overload get_secret_version(request, options = nil) - # Pass arguments to `get_secret_version` via a request object, either of type - # {::Google::Cloud::SecretManager::V1beta1::GetSecretVersionRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::SecretManager::V1beta1::GetSecretVersionRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @overload get_secret_version(name: nil) - # Pass arguments to `get_secret_version` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param name [::String] - # Required. The resource name of the - # {::Google::Cloud::SecretManager::V1beta1::SecretVersion SecretVersion} in the format - # `projects/*/secrets/*/versions/*`. - # `projects/*/secrets/*/versions/latest` is an alias to the `latest` - # {::Google::Cloud::SecretManager::V1beta1::SecretVersion SecretVersion}. - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Cloud::SecretManager::V1beta1::SecretVersion] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::SecretManager::V1beta1::SecretVersion] - # - # @raise [::Google::Cloud::Error] if the REST call is aborted. - # - # @example Basic example - # require "google/cloud/secret_manager/v1beta1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::SecretManager::V1beta1::SecretManagerService::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::SecretManager::V1beta1::GetSecretVersionRequest.new - # - # # Call the get_secret_version method. - # result = client.get_secret_version request - # - # # The returned object is of type Google::Cloud::SecretManager::V1beta1::SecretVersion. - # p result - # - def get_secret_version request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::SecretManager::V1beta1::GetSecretVersionRequest - - # Converts hash and nil to an options object - options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h - - # Customize the options with defaults - call_metadata = @config.rpcs.get_secret_version.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::SecretManager::V1beta1::VERSION, - transports_version_send: [:rest] - - call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - options.apply_defaults timeout: @config.rpcs.get_secret_version.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.get_secret_version.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @secret_manager_service_stub.get_secret_version request, options do |result, operation| - yield result, operation if block_given? - end - rescue ::Gapic::Rest::Error => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Accesses a {::Google::Cloud::SecretManager::V1beta1::SecretVersion SecretVersion}. - # This call returns the secret data. - # - # `projects/*/secrets/*/versions/latest` is an alias to the `latest` - # {::Google::Cloud::SecretManager::V1beta1::SecretVersion SecretVersion}. - # - # @overload access_secret_version(request, options = nil) - # Pass arguments to `access_secret_version` via a request object, either of type - # {::Google::Cloud::SecretManager::V1beta1::AccessSecretVersionRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::SecretManager::V1beta1::AccessSecretVersionRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @overload access_secret_version(name: nil) - # Pass arguments to `access_secret_version` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param name [::String] - # Required. The resource name of the - # {::Google::Cloud::SecretManager::V1beta1::SecretVersion SecretVersion} in the format - # `projects/*/secrets/*/versions/*`. - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Cloud::SecretManager::V1beta1::AccessSecretVersionResponse] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::SecretManager::V1beta1::AccessSecretVersionResponse] - # - # @raise [::Google::Cloud::Error] if the REST call is aborted. - # - # @example Basic example - # require "google/cloud/secret_manager/v1beta1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::SecretManager::V1beta1::SecretManagerService::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::SecretManager::V1beta1::AccessSecretVersionRequest.new - # - # # Call the access_secret_version method. - # result = client.access_secret_version request - # - # # The returned object is of type Google::Cloud::SecretManager::V1beta1::AccessSecretVersionResponse. - # p result - # - def access_secret_version request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::SecretManager::V1beta1::AccessSecretVersionRequest - - # Converts hash and nil to an options object - options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h - - # Customize the options with defaults - call_metadata = @config.rpcs.access_secret_version.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::SecretManager::V1beta1::VERSION, - transports_version_send: [:rest] - - call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - options.apply_defaults timeout: @config.rpcs.access_secret_version.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.access_secret_version.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @secret_manager_service_stub.access_secret_version request, options do |result, operation| - yield result, operation if block_given? - end - rescue ::Gapic::Rest::Error => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Disables a {::Google::Cloud::SecretManager::V1beta1::SecretVersion SecretVersion}. - # - # Sets the {::Google::Cloud::SecretManager::V1beta1::SecretVersion#state state} of the - # {::Google::Cloud::SecretManager::V1beta1::SecretVersion SecretVersion} to - # {::Google::Cloud::SecretManager::V1beta1::SecretVersion::State::DISABLED DISABLED}. - # - # @overload disable_secret_version(request, options = nil) - # Pass arguments to `disable_secret_version` via a request object, either of type - # {::Google::Cloud::SecretManager::V1beta1::DisableSecretVersionRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::SecretManager::V1beta1::DisableSecretVersionRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @overload disable_secret_version(name: nil) - # Pass arguments to `disable_secret_version` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param name [::String] - # Required. The resource name of the - # {::Google::Cloud::SecretManager::V1beta1::SecretVersion SecretVersion} to disable in - # the format `projects/*/secrets/*/versions/*`. - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Cloud::SecretManager::V1beta1::SecretVersion] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::SecretManager::V1beta1::SecretVersion] - # - # @raise [::Google::Cloud::Error] if the REST call is aborted. - # - # @example Basic example - # require "google/cloud/secret_manager/v1beta1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::SecretManager::V1beta1::SecretManagerService::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::SecretManager::V1beta1::DisableSecretVersionRequest.new - # - # # Call the disable_secret_version method. - # result = client.disable_secret_version request - # - # # The returned object is of type Google::Cloud::SecretManager::V1beta1::SecretVersion. - # p result - # - def disable_secret_version request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::SecretManager::V1beta1::DisableSecretVersionRequest - - # Converts hash and nil to an options object - options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h - - # Customize the options with defaults - call_metadata = @config.rpcs.disable_secret_version.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::SecretManager::V1beta1::VERSION, - transports_version_send: [:rest] - - call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - options.apply_defaults timeout: @config.rpcs.disable_secret_version.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.disable_secret_version.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @secret_manager_service_stub.disable_secret_version request, options do |result, operation| - yield result, operation if block_given? - end - rescue ::Gapic::Rest::Error => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Enables a {::Google::Cloud::SecretManager::V1beta1::SecretVersion SecretVersion}. - # - # Sets the {::Google::Cloud::SecretManager::V1beta1::SecretVersion#state state} of the - # {::Google::Cloud::SecretManager::V1beta1::SecretVersion SecretVersion} to - # {::Google::Cloud::SecretManager::V1beta1::SecretVersion::State::ENABLED ENABLED}. - # - # @overload enable_secret_version(request, options = nil) - # Pass arguments to `enable_secret_version` via a request object, either of type - # {::Google::Cloud::SecretManager::V1beta1::EnableSecretVersionRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::SecretManager::V1beta1::EnableSecretVersionRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @overload enable_secret_version(name: nil) - # Pass arguments to `enable_secret_version` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param name [::String] - # Required. The resource name of the - # {::Google::Cloud::SecretManager::V1beta1::SecretVersion SecretVersion} to enable in - # the format `projects/*/secrets/*/versions/*`. - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Cloud::SecretManager::V1beta1::SecretVersion] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::SecretManager::V1beta1::SecretVersion] - # - # @raise [::Google::Cloud::Error] if the REST call is aborted. - # - # @example Basic example - # require "google/cloud/secret_manager/v1beta1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::SecretManager::V1beta1::SecretManagerService::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::SecretManager::V1beta1::EnableSecretVersionRequest.new - # - # # Call the enable_secret_version method. - # result = client.enable_secret_version request - # - # # The returned object is of type Google::Cloud::SecretManager::V1beta1::SecretVersion. - # p result - # - def enable_secret_version request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::SecretManager::V1beta1::EnableSecretVersionRequest - - # Converts hash and nil to an options object - options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h - - # Customize the options with defaults - call_metadata = @config.rpcs.enable_secret_version.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::SecretManager::V1beta1::VERSION, - transports_version_send: [:rest] - - call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - options.apply_defaults timeout: @config.rpcs.enable_secret_version.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.enable_secret_version.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @secret_manager_service_stub.enable_secret_version request, options do |result, operation| - yield result, operation if block_given? - end - rescue ::Gapic::Rest::Error => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Destroys a {::Google::Cloud::SecretManager::V1beta1::SecretVersion SecretVersion}. - # - # Sets the {::Google::Cloud::SecretManager::V1beta1::SecretVersion#state state} of the - # {::Google::Cloud::SecretManager::V1beta1::SecretVersion SecretVersion} to - # {::Google::Cloud::SecretManager::V1beta1::SecretVersion::State::DESTROYED DESTROYED} and - # irrevocably destroys the secret data. - # - # @overload destroy_secret_version(request, options = nil) - # Pass arguments to `destroy_secret_version` via a request object, either of type - # {::Google::Cloud::SecretManager::V1beta1::DestroySecretVersionRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::SecretManager::V1beta1::DestroySecretVersionRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @overload destroy_secret_version(name: nil) - # Pass arguments to `destroy_secret_version` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param name [::String] - # Required. The resource name of the - # {::Google::Cloud::SecretManager::V1beta1::SecretVersion SecretVersion} to destroy in - # the format `projects/*/secrets/*/versions/*`. - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Cloud::SecretManager::V1beta1::SecretVersion] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::SecretManager::V1beta1::SecretVersion] - # - # @raise [::Google::Cloud::Error] if the REST call is aborted. - # - # @example Basic example - # require "google/cloud/secret_manager/v1beta1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::SecretManager::V1beta1::SecretManagerService::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::SecretManager::V1beta1::DestroySecretVersionRequest.new - # - # # Call the destroy_secret_version method. - # result = client.destroy_secret_version request - # - # # The returned object is of type Google::Cloud::SecretManager::V1beta1::SecretVersion. - # p result - # - def destroy_secret_version request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::SecretManager::V1beta1::DestroySecretVersionRequest - - # Converts hash and nil to an options object - options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h - - # Customize the options with defaults - call_metadata = @config.rpcs.destroy_secret_version.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::SecretManager::V1beta1::VERSION, - transports_version_send: [:rest] - - call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - options.apply_defaults timeout: @config.rpcs.destroy_secret_version.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.destroy_secret_version.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @secret_manager_service_stub.destroy_secret_version request, options do |result, operation| - yield result, operation if block_given? - end - rescue ::Gapic::Rest::Error => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Sets the access control policy on the specified secret. Replaces any - # existing policy. - # - # Permissions on {::Google::Cloud::SecretManager::V1beta1::SecretVersion SecretVersions} - # are enforced according to the policy set on the associated - # {::Google::Cloud::SecretManager::V1beta1::Secret Secret}. - # - # @overload set_iam_policy(request, options = nil) - # Pass arguments to `set_iam_policy` via a request object, either of type - # {::Google::Iam::V1::SetIamPolicyRequest} or an equivalent Hash. - # - # @param request [::Google::Iam::V1::SetIamPolicyRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @overload set_iam_policy(resource: nil, policy: nil, update_mask: nil) - # Pass arguments to `set_iam_policy` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param resource [::String] - # REQUIRED: The resource for which the policy is being specified. - # See the operation documentation for the appropriate value for this field. - # @param policy [::Google::Iam::V1::Policy, ::Hash] - # REQUIRED: The complete policy to be applied to the `resource`. The size of - # the policy is limited to a few 10s of KB. An empty policy is a - # valid policy but certain Cloud Platform services (such as Projects) - # might reject them. - # @param update_mask [::Google::Protobuf::FieldMask, ::Hash] - # OPTIONAL: A FieldMask specifying which fields of the policy to modify. Only - # the fields in the mask will be modified. If no mask is provided, the - # following default mask is used: - # - # `paths: "bindings, etag"` - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Iam::V1::Policy] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Iam::V1::Policy] - # - # @raise [::Google::Cloud::Error] if the REST call is aborted. - # - # @example Basic example - # require "google/cloud/secret_manager/v1beta1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::SecretManager::V1beta1::SecretManagerService::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Iam::V1::SetIamPolicyRequest.new - # - # # Call the set_iam_policy method. - # result = client.set_iam_policy request - # - # # The returned object is of type Google::Iam::V1::Policy. - # p result - # - def set_iam_policy request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Iam::V1::SetIamPolicyRequest - - # Converts hash and nil to an options object - options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h - - # Customize the options with defaults - call_metadata = @config.rpcs.set_iam_policy.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::SecretManager::V1beta1::VERSION, - transports_version_send: [:rest] - - call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - options.apply_defaults timeout: @config.rpcs.set_iam_policy.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.set_iam_policy.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @secret_manager_service_stub.set_iam_policy request, options do |result, operation| - yield result, operation if block_given? - end - rescue ::Gapic::Rest::Error => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Gets the access control policy for a secret. - # Returns empty policy if the secret exists and does not have a policy set. - # - # @overload get_iam_policy(request, options = nil) - # Pass arguments to `get_iam_policy` via a request object, either of type - # {::Google::Iam::V1::GetIamPolicyRequest} or an equivalent Hash. - # - # @param request [::Google::Iam::V1::GetIamPolicyRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @overload get_iam_policy(resource: nil, options: nil) - # Pass arguments to `get_iam_policy` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param resource [::String] - # REQUIRED: The resource for which the policy is being requested. - # See the operation documentation for the appropriate value for this field. - # @param options [::Google::Iam::V1::GetPolicyOptions, ::Hash] - # OPTIONAL: A `GetPolicyOptions` object for specifying options to - # `GetIamPolicy`. - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Iam::V1::Policy] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Iam::V1::Policy] - # - # @raise [::Google::Cloud::Error] if the REST call is aborted. - # - # @example Basic example - # require "google/cloud/secret_manager/v1beta1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::SecretManager::V1beta1::SecretManagerService::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Iam::V1::GetIamPolicyRequest.new - # - # # Call the get_iam_policy method. - # result = client.get_iam_policy request - # - # # The returned object is of type Google::Iam::V1::Policy. - # p result - # - def get_iam_policy request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Iam::V1::GetIamPolicyRequest - - # Converts hash and nil to an options object - options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h - - # Customize the options with defaults - call_metadata = @config.rpcs.get_iam_policy.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::SecretManager::V1beta1::VERSION, - transports_version_send: [:rest] - - call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - options.apply_defaults timeout: @config.rpcs.get_iam_policy.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.get_iam_policy.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @secret_manager_service_stub.get_iam_policy request, options do |result, operation| - yield result, operation if block_given? - end - rescue ::Gapic::Rest::Error => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Returns permissions that a caller has for the specified secret. - # If the secret does not exist, this call returns an empty set of - # permissions, not a NOT_FOUND error. - # - # Note: This operation is designed to be used for building permission-aware - # UIs and command-line tools, not for authorization checking. This operation - # may "fail open" without warning. - # - # @overload test_iam_permissions(request, options = nil) - # Pass arguments to `test_iam_permissions` via a request object, either of type - # {::Google::Iam::V1::TestIamPermissionsRequest} or an equivalent Hash. - # - # @param request [::Google::Iam::V1::TestIamPermissionsRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @overload test_iam_permissions(resource: nil, permissions: nil) - # Pass arguments to `test_iam_permissions` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param resource [::String] - # REQUIRED: The resource for which the policy detail is being requested. - # See the operation documentation for the appropriate value for this field. - # @param permissions [::Array<::String>] - # The set of permissions to check for the `resource`. Permissions with - # wildcards (such as '*' or 'storage.*') are not allowed. For more - # information see - # [IAM Overview](https://cloud.google.com/iam/docs/overview#permissions). - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Iam::V1::TestIamPermissionsResponse] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Iam::V1::TestIamPermissionsResponse] - # - # @raise [::Google::Cloud::Error] if the REST call is aborted. - # - # @example Basic example - # require "google/cloud/secret_manager/v1beta1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::SecretManager::V1beta1::SecretManagerService::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Iam::V1::TestIamPermissionsRequest.new - # - # # Call the test_iam_permissions method. - # result = client.test_iam_permissions request - # - # # The returned object is of type Google::Iam::V1::TestIamPermissionsResponse. - # p result - # - def test_iam_permissions request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Iam::V1::TestIamPermissionsRequest - - # Converts hash and nil to an options object - options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h - - # Customize the options with defaults - call_metadata = @config.rpcs.test_iam_permissions.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::SecretManager::V1beta1::VERSION, - transports_version_send: [:rest] - - call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - options.apply_defaults timeout: @config.rpcs.test_iam_permissions.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.test_iam_permissions.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @secret_manager_service_stub.test_iam_permissions request, options do |result, operation| - yield result, operation if block_given? - end - rescue ::Gapic::Rest::Error => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Configuration class for the SecretManagerService REST API. - # - # This class represents the configuration for SecretManagerService REST, - # providing control over timeouts, retry behavior, logging, transport - # parameters, and other low-level controls. Certain parameters can also be - # applied individually to specific RPCs. See - # {::Google::Cloud::SecretManager::V1beta1::SecretManagerService::Rest::Client::Configuration::Rpcs} - # for a list of RPCs that can be configured independently. - # - # Configuration can be applied globally to all clients, or to a single client - # on construction. - # - # @example - # - # # Modify the global config, setting the timeout for - # # list_secrets to 20 seconds, - # # and all remaining timeouts to 10 seconds. - # ::Google::Cloud::SecretManager::V1beta1::SecretManagerService::Rest::Client.configure do |config| - # config.timeout = 10.0 - # config.rpcs.list_secrets.timeout = 20.0 - # end - # - # # Apply the above configuration only to a new client. - # client = ::Google::Cloud::SecretManager::V1beta1::SecretManagerService::Rest::Client.new do |config| - # config.timeout = 10.0 - # config.rpcs.list_secrets.timeout = 20.0 - # end - # - # @!attribute [rw] endpoint - # A custom service endpoint, as a hostname or hostname:port. The default is - # nil, indicating to use the default endpoint in the current universe domain. - # @return [::String,nil] - # @!attribute [rw] credentials - # Credentials to send with calls. You may provide any of the following types: - # * (`String`) The path to a service account key file in JSON format - # * (`Hash`) A service account key as a Hash - # * (`Google::Auth::Credentials`) A googleauth credentials object - # (see the [googleauth docs](https://rubydoc.info/gems/googleauth/Google/Auth/Credentials)) - # * (`Signet::OAuth2::Client`) A signet oauth2 client object - # (see the [signet docs](https://rubydoc.info/gems/signet/Signet/OAuth2/Client)) - # * (`nil`) indicating no credentials - # - # Warning: If you accept a credential configuration (JSON file or Hash) from an - # external source for authentication to Google Cloud, you must validate it before - # providing it to a Google API client library. Providing an unvalidated credential - # configuration to Google APIs can compromise the security of your systems and data. - # For more information, refer to [Validate credential configurations from external - # sources](https://cloud.google.com/docs/authentication/external/externally-sourced-credentials). - # @return [::Object] - # @!attribute [rw] scope - # The OAuth scopes - # @return [::Array<::String>] - # @!attribute [rw] lib_name - # The library name as recorded in instrumentation and logging - # @return [::String] - # @!attribute [rw] lib_version - # The library version as recorded in instrumentation and logging - # @return [::String] - # @!attribute [rw] timeout - # The call timeout in seconds. - # @return [::Numeric] - # @!attribute [rw] metadata - # Additional headers to be sent with the call. - # @return [::Hash{::Symbol=>::String}] - # @!attribute [rw] retry_policy - # The retry policy. The value is a hash with the following keys: - # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds. - # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds. - # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier. - # * `:retry_codes` (*type:* `Array`) - The error codes that should - # trigger a retry. - # @return [::Hash] - # @!attribute [rw] quota_project - # A separate project against which to charge quota. - # @return [::String] - # @!attribute [rw] universe_domain - # The universe domain within which to make requests. This determines the - # default endpoint URL. The default value of nil uses the environment - # universe (usually the default "googleapis.com" universe). - # @return [::String,nil] - # @!attribute [rw] logger - # A custom logger to use for request/response debug logging, or the value - # `:default` (the default) to construct a default logger, or `nil` to - # explicitly disable logging. - # @return [::Logger,:default,nil] - # - class Configuration - extend ::Gapic::Config - - # @private - # The endpoint specific to the default "googleapis.com" universe. Deprecated. - DEFAULT_ENDPOINT = "secretmanager.googleapis.com" - - config_attr :endpoint, nil, ::String, nil - config_attr :credentials, nil do |value| - allowed = [::String, ::Hash, ::Proc, ::Symbol, ::Google::Auth::Credentials, ::Google::Auth::BaseClient, ::Signet::OAuth2::Client, nil] - allowed.any? { |klass| klass === value } - end - config_attr :scope, nil, ::String, ::Array, nil - config_attr :lib_name, nil, ::String, nil - config_attr :lib_version, nil, ::String, nil - config_attr :timeout, nil, ::Numeric, nil - config_attr :metadata, nil, ::Hash, nil - config_attr :retry_policy, nil, ::Hash, ::Proc, nil - config_attr :quota_project, nil, ::String, nil - config_attr :universe_domain, nil, ::String, nil - - # @private - # Overrides for http bindings for the RPCs of this service - # are only used when this service is used as mixin, and only - # by the host service. - # @return [::Hash{::Symbol=>::Array<::Gapic::Rest::GrpcTranscoder::HttpBinding>}] - config_attr :bindings_override, {}, ::Hash, nil - config_attr :logger, :default, ::Logger, nil, :default - - # @private - def initialize parent_config = nil - @parent_config = parent_config unless parent_config.nil? - - yield self if block_given? - end - - ## - # Configurations for individual RPCs - # @return [Rpcs] - # - def rpcs - @rpcs ||= begin - parent_rpcs = nil - parent_rpcs = @parent_config.rpcs if defined?(@parent_config) && @parent_config.respond_to?(:rpcs) - Rpcs.new parent_rpcs - end - end - - ## - # Configuration RPC class for the SecretManagerService API. - # - # Includes fields providing the configuration for each RPC in this service. - # Each configuration object is of type `Gapic::Config::Method` and includes - # the following configuration fields: - # - # * `timeout` (*type:* `Numeric`) - The call timeout in seconds - # * `metadata` (*type:* `Hash{Symbol=>String}`) - Additional headers - # * `retry_policy (*type:* `Hash`) - The retry policy. The policy fields - # include the following keys: - # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds. - # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds. - # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier. - # * `:retry_codes` (*type:* `Array`) - The error codes that should - # trigger a retry. - # - class Rpcs - ## - # RPC-specific configuration for `list_secrets` - # @return [::Gapic::Config::Method] - # - attr_reader :list_secrets - ## - # RPC-specific configuration for `create_secret` - # @return [::Gapic::Config::Method] - # - attr_reader :create_secret - ## - # RPC-specific configuration for `add_secret_version` - # @return [::Gapic::Config::Method] - # - attr_reader :add_secret_version - ## - # RPC-specific configuration for `get_secret` - # @return [::Gapic::Config::Method] - # - attr_reader :get_secret - ## - # RPC-specific configuration for `update_secret` - # @return [::Gapic::Config::Method] - # - attr_reader :update_secret - ## - # RPC-specific configuration for `delete_secret` - # @return [::Gapic::Config::Method] - # - attr_reader :delete_secret - ## - # RPC-specific configuration for `list_secret_versions` - # @return [::Gapic::Config::Method] - # - attr_reader :list_secret_versions - ## - # RPC-specific configuration for `get_secret_version` - # @return [::Gapic::Config::Method] - # - attr_reader :get_secret_version - ## - # RPC-specific configuration for `access_secret_version` - # @return [::Gapic::Config::Method] - # - attr_reader :access_secret_version - ## - # RPC-specific configuration for `disable_secret_version` - # @return [::Gapic::Config::Method] - # - attr_reader :disable_secret_version - ## - # RPC-specific configuration for `enable_secret_version` - # @return [::Gapic::Config::Method] - # - attr_reader :enable_secret_version - ## - # RPC-specific configuration for `destroy_secret_version` - # @return [::Gapic::Config::Method] - # - attr_reader :destroy_secret_version - ## - # RPC-specific configuration for `set_iam_policy` - # @return [::Gapic::Config::Method] - # - attr_reader :set_iam_policy - ## - # RPC-specific configuration for `get_iam_policy` - # @return [::Gapic::Config::Method] - # - attr_reader :get_iam_policy - ## - # RPC-specific configuration for `test_iam_permissions` - # @return [::Gapic::Config::Method] - # - attr_reader :test_iam_permissions - - # @private - def initialize parent_rpcs = nil - list_secrets_config = parent_rpcs.list_secrets if parent_rpcs.respond_to? :list_secrets - @list_secrets = ::Gapic::Config::Method.new list_secrets_config - create_secret_config = parent_rpcs.create_secret if parent_rpcs.respond_to? :create_secret - @create_secret = ::Gapic::Config::Method.new create_secret_config - add_secret_version_config = parent_rpcs.add_secret_version if parent_rpcs.respond_to? :add_secret_version - @add_secret_version = ::Gapic::Config::Method.new add_secret_version_config - get_secret_config = parent_rpcs.get_secret if parent_rpcs.respond_to? :get_secret - @get_secret = ::Gapic::Config::Method.new get_secret_config - update_secret_config = parent_rpcs.update_secret if parent_rpcs.respond_to? :update_secret - @update_secret = ::Gapic::Config::Method.new update_secret_config - delete_secret_config = parent_rpcs.delete_secret if parent_rpcs.respond_to? :delete_secret - @delete_secret = ::Gapic::Config::Method.new delete_secret_config - list_secret_versions_config = parent_rpcs.list_secret_versions if parent_rpcs.respond_to? :list_secret_versions - @list_secret_versions = ::Gapic::Config::Method.new list_secret_versions_config - get_secret_version_config = parent_rpcs.get_secret_version if parent_rpcs.respond_to? :get_secret_version - @get_secret_version = ::Gapic::Config::Method.new get_secret_version_config - access_secret_version_config = parent_rpcs.access_secret_version if parent_rpcs.respond_to? :access_secret_version - @access_secret_version = ::Gapic::Config::Method.new access_secret_version_config - disable_secret_version_config = parent_rpcs.disable_secret_version if parent_rpcs.respond_to? :disable_secret_version - @disable_secret_version = ::Gapic::Config::Method.new disable_secret_version_config - enable_secret_version_config = parent_rpcs.enable_secret_version if parent_rpcs.respond_to? :enable_secret_version - @enable_secret_version = ::Gapic::Config::Method.new enable_secret_version_config - destroy_secret_version_config = parent_rpcs.destroy_secret_version if parent_rpcs.respond_to? :destroy_secret_version - @destroy_secret_version = ::Gapic::Config::Method.new destroy_secret_version_config - set_iam_policy_config = parent_rpcs.set_iam_policy if parent_rpcs.respond_to? :set_iam_policy - @set_iam_policy = ::Gapic::Config::Method.new set_iam_policy_config - get_iam_policy_config = parent_rpcs.get_iam_policy if parent_rpcs.respond_to? :get_iam_policy - @get_iam_policy = ::Gapic::Config::Method.new get_iam_policy_config - test_iam_permissions_config = parent_rpcs.test_iam_permissions if parent_rpcs.respond_to? :test_iam_permissions - @test_iam_permissions = ::Gapic::Config::Method.new test_iam_permissions_config - - yield self if block_given? - end - end - end - end - end - end - end - end - end -end diff --git a/owl-bot-staging/google-cloud-secret_manager-v1beta1/lib/google/cloud/secret_manager/v1beta1/secret_manager_service/rest/service_stub.rb b/owl-bot-staging/google-cloud-secret_manager-v1beta1/lib/google/cloud/secret_manager/v1beta1/secret_manager_service/rest/service_stub.rb deleted file mode 100644 index 968f6c2a4fd6..000000000000 --- a/owl-bot-staging/google-cloud-secret_manager-v1beta1/lib/google/cloud/secret_manager/v1beta1/secret_manager_service/rest/service_stub.rb +++ /dev/null @@ -1,1004 +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/secrets/v1beta1/service_pb" - -module Google - module Cloud - module SecretManager - module V1beta1 - module SecretManagerService - module Rest - ## - # REST service stub for the SecretManagerService service. - # Service stub contains baseline method implementations - # including transcoding, making the REST call, and deserialing the response. - # - class ServiceStub - # @private - def initialize endpoint:, endpoint_template:, universe_domain:, credentials:, logger: - # These require statements are intentionally placed here to initialize - # the REST modules only when it's required. - require "gapic/rest" - - @client_stub = ::Gapic::Rest::ClientStub.new endpoint: endpoint, - endpoint_template: endpoint_template, - universe_domain: universe_domain, - credentials: credentials, - numeric_enums: true, - service_name: self.class, - raise_faraday_errors: false, - logger: logger - end - - ## - # The effective universe domain - # - # @return [String] - # - def universe_domain - @client_stub.universe_domain - end - - ## - # The effective endpoint - # - # @return [String] - # - def endpoint - @client_stub.endpoint - end - - ## - # The logger used for request/response debug logging. - # - # @return [Logger] - # - def logger stub: false - stub ? @client_stub.stub_logger : @client_stub.logger - end - - ## - # Baseline implementation for the list_secrets REST call - # - # @param request_pb [::Google::Cloud::SecretManager::V1beta1::ListSecretsRequest] - # A request object representing the call parameters. Required. - # @param options [::Gapic::CallOptions] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Cloud::SecretManager::V1beta1::ListSecretsResponse] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::SecretManager::V1beta1::ListSecretsResponse] - # A result object deserialized from the server's reply - def list_secrets request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_list_secrets_request request_pb - query_string_params = if query_string_params.any? - query_string_params.to_h { |p| p.split "=", 2 } - else - {} - end - - response = @client_stub.make_http_request( - verb, - uri: uri, - body: body || "", - params: query_string_params, - method_name: "list_secrets", - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Cloud::SecretManager::V1beta1::ListSecretsResponse.decode_json response.body, ignore_unknown_fields: true - catch :response do - yield result, operation if block_given? - result - end - end - - ## - # Baseline implementation for the create_secret REST call - # - # @param request_pb [::Google::Cloud::SecretManager::V1beta1::CreateSecretRequest] - # A request object representing the call parameters. Required. - # @param options [::Gapic::CallOptions] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Cloud::SecretManager::V1beta1::Secret] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::SecretManager::V1beta1::Secret] - # A result object deserialized from the server's reply - def create_secret request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_create_secret_request request_pb - query_string_params = if query_string_params.any? - query_string_params.to_h { |p| p.split "=", 2 } - else - {} - end - - response = @client_stub.make_http_request( - verb, - uri: uri, - body: body || "", - params: query_string_params, - method_name: "create_secret", - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Cloud::SecretManager::V1beta1::Secret.decode_json response.body, ignore_unknown_fields: true - catch :response do - yield result, operation if block_given? - result - end - end - - ## - # Baseline implementation for the add_secret_version REST call - # - # @param request_pb [::Google::Cloud::SecretManager::V1beta1::AddSecretVersionRequest] - # A request object representing the call parameters. Required. - # @param options [::Gapic::CallOptions] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Cloud::SecretManager::V1beta1::SecretVersion] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::SecretManager::V1beta1::SecretVersion] - # A result object deserialized from the server's reply - def add_secret_version request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_add_secret_version_request request_pb - query_string_params = if query_string_params.any? - query_string_params.to_h { |p| p.split "=", 2 } - else - {} - end - - response = @client_stub.make_http_request( - verb, - uri: uri, - body: body || "", - params: query_string_params, - method_name: "add_secret_version", - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Cloud::SecretManager::V1beta1::SecretVersion.decode_json response.body, ignore_unknown_fields: true - catch :response do - yield result, operation if block_given? - result - end - end - - ## - # Baseline implementation for the get_secret REST call - # - # @param request_pb [::Google::Cloud::SecretManager::V1beta1::GetSecretRequest] - # A request object representing the call parameters. Required. - # @param options [::Gapic::CallOptions] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Cloud::SecretManager::V1beta1::Secret] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::SecretManager::V1beta1::Secret] - # A result object deserialized from the server's reply - def get_secret request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_get_secret_request request_pb - query_string_params = if query_string_params.any? - query_string_params.to_h { |p| p.split "=", 2 } - else - {} - end - - response = @client_stub.make_http_request( - verb, - uri: uri, - body: body || "", - params: query_string_params, - method_name: "get_secret", - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Cloud::SecretManager::V1beta1::Secret.decode_json response.body, ignore_unknown_fields: true - catch :response do - yield result, operation if block_given? - result - end - end - - ## - # Baseline implementation for the update_secret REST call - # - # @param request_pb [::Google::Cloud::SecretManager::V1beta1::UpdateSecretRequest] - # A request object representing the call parameters. Required. - # @param options [::Gapic::CallOptions] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Cloud::SecretManager::V1beta1::Secret] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::SecretManager::V1beta1::Secret] - # A result object deserialized from the server's reply - def update_secret request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_update_secret_request request_pb - query_string_params = if query_string_params.any? - query_string_params.to_h { |p| p.split "=", 2 } - else - {} - end - - response = @client_stub.make_http_request( - verb, - uri: uri, - body: body || "", - params: query_string_params, - method_name: "update_secret", - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Cloud::SecretManager::V1beta1::Secret.decode_json response.body, ignore_unknown_fields: true - catch :response do - yield result, operation if block_given? - result - end - end - - ## - # Baseline implementation for the delete_secret REST call - # - # @param request_pb [::Google::Cloud::SecretManager::V1beta1::DeleteSecretRequest] - # A request object representing the call parameters. Required. - # @param options [::Gapic::CallOptions] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Protobuf::Empty] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Protobuf::Empty] - # A result object deserialized from the server's reply - def delete_secret request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_delete_secret_request request_pb - query_string_params = if query_string_params.any? - query_string_params.to_h { |p| p.split "=", 2 } - else - {} - end - - response = @client_stub.make_http_request( - verb, - uri: uri, - body: body || "", - params: query_string_params, - method_name: "delete_secret", - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Protobuf::Empty.decode_json response.body, ignore_unknown_fields: true - catch :response do - yield result, operation if block_given? - result - end - end - - ## - # Baseline implementation for the list_secret_versions REST call - # - # @param request_pb [::Google::Cloud::SecretManager::V1beta1::ListSecretVersionsRequest] - # A request object representing the call parameters. Required. - # @param options [::Gapic::CallOptions] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Cloud::SecretManager::V1beta1::ListSecretVersionsResponse] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::SecretManager::V1beta1::ListSecretVersionsResponse] - # A result object deserialized from the server's reply - def list_secret_versions request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_list_secret_versions_request request_pb - query_string_params = if query_string_params.any? - query_string_params.to_h { |p| p.split "=", 2 } - else - {} - end - - response = @client_stub.make_http_request( - verb, - uri: uri, - body: body || "", - params: query_string_params, - method_name: "list_secret_versions", - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Cloud::SecretManager::V1beta1::ListSecretVersionsResponse.decode_json response.body, ignore_unknown_fields: true - catch :response do - yield result, operation if block_given? - result - end - end - - ## - # Baseline implementation for the get_secret_version REST call - # - # @param request_pb [::Google::Cloud::SecretManager::V1beta1::GetSecretVersionRequest] - # A request object representing the call parameters. Required. - # @param options [::Gapic::CallOptions] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Cloud::SecretManager::V1beta1::SecretVersion] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::SecretManager::V1beta1::SecretVersion] - # A result object deserialized from the server's reply - def get_secret_version request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_get_secret_version_request request_pb - query_string_params = if query_string_params.any? - query_string_params.to_h { |p| p.split "=", 2 } - else - {} - end - - response = @client_stub.make_http_request( - verb, - uri: uri, - body: body || "", - params: query_string_params, - method_name: "get_secret_version", - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Cloud::SecretManager::V1beta1::SecretVersion.decode_json response.body, ignore_unknown_fields: true - catch :response do - yield result, operation if block_given? - result - end - end - - ## - # Baseline implementation for the access_secret_version REST call - # - # @param request_pb [::Google::Cloud::SecretManager::V1beta1::AccessSecretVersionRequest] - # A request object representing the call parameters. Required. - # @param options [::Gapic::CallOptions] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Cloud::SecretManager::V1beta1::AccessSecretVersionResponse] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::SecretManager::V1beta1::AccessSecretVersionResponse] - # A result object deserialized from the server's reply - def access_secret_version request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_access_secret_version_request request_pb - query_string_params = if query_string_params.any? - query_string_params.to_h { |p| p.split "=", 2 } - else - {} - end - - response = @client_stub.make_http_request( - verb, - uri: uri, - body: body || "", - params: query_string_params, - method_name: "access_secret_version", - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Cloud::SecretManager::V1beta1::AccessSecretVersionResponse.decode_json response.body, ignore_unknown_fields: true - catch :response do - yield result, operation if block_given? - result - end - end - - ## - # Baseline implementation for the disable_secret_version REST call - # - # @param request_pb [::Google::Cloud::SecretManager::V1beta1::DisableSecretVersionRequest] - # A request object representing the call parameters. Required. - # @param options [::Gapic::CallOptions] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Cloud::SecretManager::V1beta1::SecretVersion] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::SecretManager::V1beta1::SecretVersion] - # A result object deserialized from the server's reply - def disable_secret_version request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_disable_secret_version_request request_pb - query_string_params = if query_string_params.any? - query_string_params.to_h { |p| p.split "=", 2 } - else - {} - end - - response = @client_stub.make_http_request( - verb, - uri: uri, - body: body || "", - params: query_string_params, - method_name: "disable_secret_version", - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Cloud::SecretManager::V1beta1::SecretVersion.decode_json response.body, ignore_unknown_fields: true - catch :response do - yield result, operation if block_given? - result - end - end - - ## - # Baseline implementation for the enable_secret_version REST call - # - # @param request_pb [::Google::Cloud::SecretManager::V1beta1::EnableSecretVersionRequest] - # A request object representing the call parameters. Required. - # @param options [::Gapic::CallOptions] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Cloud::SecretManager::V1beta1::SecretVersion] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::SecretManager::V1beta1::SecretVersion] - # A result object deserialized from the server's reply - def enable_secret_version request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_enable_secret_version_request request_pb - query_string_params = if query_string_params.any? - query_string_params.to_h { |p| p.split "=", 2 } - else - {} - end - - response = @client_stub.make_http_request( - verb, - uri: uri, - body: body || "", - params: query_string_params, - method_name: "enable_secret_version", - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Cloud::SecretManager::V1beta1::SecretVersion.decode_json response.body, ignore_unknown_fields: true - catch :response do - yield result, operation if block_given? - result - end - end - - ## - # Baseline implementation for the destroy_secret_version REST call - # - # @param request_pb [::Google::Cloud::SecretManager::V1beta1::DestroySecretVersionRequest] - # A request object representing the call parameters. Required. - # @param options [::Gapic::CallOptions] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Cloud::SecretManager::V1beta1::SecretVersion] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::SecretManager::V1beta1::SecretVersion] - # A result object deserialized from the server's reply - def destroy_secret_version request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_destroy_secret_version_request request_pb - query_string_params = if query_string_params.any? - query_string_params.to_h { |p| p.split "=", 2 } - else - {} - end - - response = @client_stub.make_http_request( - verb, - uri: uri, - body: body || "", - params: query_string_params, - method_name: "destroy_secret_version", - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Cloud::SecretManager::V1beta1::SecretVersion.decode_json response.body, ignore_unknown_fields: true - catch :response do - yield result, operation if block_given? - result - end - end - - ## - # Baseline implementation for the set_iam_policy REST call - # - # @param request_pb [::Google::Iam::V1::SetIamPolicyRequest] - # A request object representing the call parameters. Required. - # @param options [::Gapic::CallOptions] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Iam::V1::Policy] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Iam::V1::Policy] - # A result object deserialized from the server's reply - def set_iam_policy request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_set_iam_policy_request request_pb - query_string_params = if query_string_params.any? - query_string_params.to_h { |p| p.split "=", 2 } - else - {} - end - - response = @client_stub.make_http_request( - verb, - uri: uri, - body: body || "", - params: query_string_params, - method_name: "set_iam_policy", - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Iam::V1::Policy.decode_json response.body, ignore_unknown_fields: true - catch :response do - yield result, operation if block_given? - result - end - end - - ## - # Baseline implementation for the get_iam_policy REST call - # - # @param request_pb [::Google::Iam::V1::GetIamPolicyRequest] - # A request object representing the call parameters. Required. - # @param options [::Gapic::CallOptions] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Iam::V1::Policy] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Iam::V1::Policy] - # A result object deserialized from the server's reply - def get_iam_policy request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_get_iam_policy_request request_pb - query_string_params = if query_string_params.any? - query_string_params.to_h { |p| p.split "=", 2 } - else - {} - end - - response = @client_stub.make_http_request( - verb, - uri: uri, - body: body || "", - params: query_string_params, - method_name: "get_iam_policy", - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Iam::V1::Policy.decode_json response.body, ignore_unknown_fields: true - catch :response do - yield result, operation if block_given? - result - end - end - - ## - # Baseline implementation for the test_iam_permissions REST call - # - # @param request_pb [::Google::Iam::V1::TestIamPermissionsRequest] - # A request object representing the call parameters. Required. - # @param options [::Gapic::CallOptions] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Iam::V1::TestIamPermissionsResponse] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Iam::V1::TestIamPermissionsResponse] - # A result object deserialized from the server's reply - def test_iam_permissions request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_test_iam_permissions_request request_pb - query_string_params = if query_string_params.any? - query_string_params.to_h { |p| p.split "=", 2 } - else - {} - end - - response = @client_stub.make_http_request( - verb, - uri: uri, - body: body || "", - params: query_string_params, - method_name: "test_iam_permissions", - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Iam::V1::TestIamPermissionsResponse.decode_json response.body, ignore_unknown_fields: true - catch :response do - yield result, operation if block_given? - result - end - end - - ## - # @private - # - # GRPC transcoding helper method for the list_secrets REST call - # - # @param request_pb [::Google::Cloud::SecretManager::V1beta1::ListSecretsRequest] - # A request object representing the call parameters. Required. - # @return [Array(String, [String, nil], Hash{String => String})] - # Uri, Body, Query string parameters - def self.transcode_list_secrets_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :get, - uri_template: "/v1beta1/{parent}/secrets", - matches: [ - ["parent", %r{^projects/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the create_secret REST call - # - # @param request_pb [::Google::Cloud::SecretManager::V1beta1::CreateSecretRequest] - # A request object representing the call parameters. Required. - # @return [Array(String, [String, nil], Hash{String => String})] - # Uri, Body, Query string parameters - def self.transcode_create_secret_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :post, - uri_template: "/v1beta1/{parent}/secrets", - body: "secret", - matches: [ - ["parent", %r{^projects/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the add_secret_version REST call - # - # @param request_pb [::Google::Cloud::SecretManager::V1beta1::AddSecretVersionRequest] - # A request object representing the call parameters. Required. - # @return [Array(String, [String, nil], Hash{String => String})] - # Uri, Body, Query string parameters - def self.transcode_add_secret_version_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :post, - uri_template: "/v1beta1/{parent}:addVersion", - body: "*", - matches: [ - ["parent", %r{^projects/[^/]+/secrets/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the get_secret REST call - # - # @param request_pb [::Google::Cloud::SecretManager::V1beta1::GetSecretRequest] - # A request object representing the call parameters. Required. - # @return [Array(String, [String, nil], Hash{String => String})] - # Uri, Body, Query string parameters - def self.transcode_get_secret_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :get, - uri_template: "/v1beta1/{name}", - matches: [ - ["name", %r{^projects/[^/]+/secrets/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the update_secret REST call - # - # @param request_pb [::Google::Cloud::SecretManager::V1beta1::UpdateSecretRequest] - # A request object representing the call parameters. Required. - # @return [Array(String, [String, nil], Hash{String => String})] - # Uri, Body, Query string parameters - def self.transcode_update_secret_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :patch, - uri_template: "/v1beta1/{secret.name}", - body: "secret", - matches: [ - ["secret.name", %r{^projects/[^/]+/secrets/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the delete_secret REST call - # - # @param request_pb [::Google::Cloud::SecretManager::V1beta1::DeleteSecretRequest] - # A request object representing the call parameters. Required. - # @return [Array(String, [String, nil], Hash{String => String})] - # Uri, Body, Query string parameters - def self.transcode_delete_secret_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :delete, - uri_template: "/v1beta1/{name}", - matches: [ - ["name", %r{^projects/[^/]+/secrets/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the list_secret_versions REST call - # - # @param request_pb [::Google::Cloud::SecretManager::V1beta1::ListSecretVersionsRequest] - # A request object representing the call parameters. Required. - # @return [Array(String, [String, nil], Hash{String => String})] - # Uri, Body, Query string parameters - def self.transcode_list_secret_versions_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :get, - uri_template: "/v1beta1/{parent}/versions", - matches: [ - ["parent", %r{^projects/[^/]+/secrets/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the get_secret_version REST call - # - # @param request_pb [::Google::Cloud::SecretManager::V1beta1::GetSecretVersionRequest] - # A request object representing the call parameters. Required. - # @return [Array(String, [String, nil], Hash{String => String})] - # Uri, Body, Query string parameters - def self.transcode_get_secret_version_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :get, - uri_template: "/v1beta1/{name}", - matches: [ - ["name", %r{^projects/[^/]+/secrets/[^/]+/versions/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the access_secret_version REST call - # - # @param request_pb [::Google::Cloud::SecretManager::V1beta1::AccessSecretVersionRequest] - # A request object representing the call parameters. Required. - # @return [Array(String, [String, nil], Hash{String => String})] - # Uri, Body, Query string parameters - def self.transcode_access_secret_version_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :get, - uri_template: "/v1beta1/{name}:access", - matches: [ - ["name", %r{^projects/[^/]+/secrets/[^/]+/versions/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the disable_secret_version REST call - # - # @param request_pb [::Google::Cloud::SecretManager::V1beta1::DisableSecretVersionRequest] - # A request object representing the call parameters. Required. - # @return [Array(String, [String, nil], Hash{String => String})] - # Uri, Body, Query string parameters - def self.transcode_disable_secret_version_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :post, - uri_template: "/v1beta1/{name}:disable", - body: "*", - matches: [ - ["name", %r{^projects/[^/]+/secrets/[^/]+/versions/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the enable_secret_version REST call - # - # @param request_pb [::Google::Cloud::SecretManager::V1beta1::EnableSecretVersionRequest] - # A request object representing the call parameters. Required. - # @return [Array(String, [String, nil], Hash{String => String})] - # Uri, Body, Query string parameters - def self.transcode_enable_secret_version_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :post, - uri_template: "/v1beta1/{name}:enable", - body: "*", - matches: [ - ["name", %r{^projects/[^/]+/secrets/[^/]+/versions/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the destroy_secret_version REST call - # - # @param request_pb [::Google::Cloud::SecretManager::V1beta1::DestroySecretVersionRequest] - # A request object representing the call parameters. Required. - # @return [Array(String, [String, nil], Hash{String => String})] - # Uri, Body, Query string parameters - def self.transcode_destroy_secret_version_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :post, - uri_template: "/v1beta1/{name}:destroy", - body: "*", - matches: [ - ["name", %r{^projects/[^/]+/secrets/[^/]+/versions/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the set_iam_policy REST call - # - # @param request_pb [::Google::Iam::V1::SetIamPolicyRequest] - # A request object representing the call parameters. Required. - # @return [Array(String, [String, nil], Hash{String => String})] - # Uri, Body, Query string parameters - def self.transcode_set_iam_policy_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :post, - uri_template: "/v1beta1/{resource}:setIamPolicy", - body: "*", - matches: [ - ["resource", %r{^projects/[^/]+/secrets/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the get_iam_policy REST call - # - # @param request_pb [::Google::Iam::V1::GetIamPolicyRequest] - # A request object representing the call parameters. Required. - # @return [Array(String, [String, nil], Hash{String => String})] - # Uri, Body, Query string parameters - def self.transcode_get_iam_policy_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :get, - uri_template: "/v1beta1/{resource}:getIamPolicy", - matches: [ - ["resource", %r{^projects/[^/]+/secrets/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the test_iam_permissions REST call - # - # @param request_pb [::Google::Iam::V1::TestIamPermissionsRequest] - # A request object representing the call parameters. Required. - # @return [Array(String, [String, nil], Hash{String => String})] - # Uri, Body, Query string parameters - def self.transcode_test_iam_permissions_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :post, - uri_template: "/v1beta1/{resource}:testIamPermissions", - body: "*", - matches: [ - ["resource", %r{^projects/[^/]+/secrets/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - end - end - end - end - end - end -end diff --git a/owl-bot-staging/google-cloud-secret_manager-v1beta1/lib/google/cloud/secret_manager/v1beta1/version.rb b/owl-bot-staging/google-cloud-secret_manager-v1beta1/lib/google/cloud/secret_manager/v1beta1/version.rb deleted file mode 100644 index 9b5192150b89..000000000000 --- a/owl-bot-staging/google-cloud-secret_manager-v1beta1/lib/google/cloud/secret_manager/v1beta1/version.rb +++ /dev/null @@ -1,28 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - - -module Google - module Cloud - module SecretManager - module V1beta1 - VERSION = "0.0.1" - end - end - end -end diff --git a/owl-bot-staging/google-cloud-secret_manager-v1beta1/lib/google/cloud/secrets/v1beta1/resources_pb.rb b/owl-bot-staging/google-cloud-secret_manager-v1beta1/lib/google/cloud/secrets/v1beta1/resources_pb.rb deleted file mode 100644 index 0bc06c21b282..000000000000 --- a/owl-bot-staging/google-cloud-secret_manager-v1beta1/lib/google/cloud/secrets/v1beta1/resources_pb.rb +++ /dev/null @@ -1,32 +0,0 @@ -# frozen_string_literal: true -# Generated by the protocol buffer compiler. DO NOT EDIT! -# source: google/cloud/secrets/v1beta1/resources.proto - -require 'google/protobuf' - -require 'google/api/field_behavior_pb' -require 'google/api/resource_pb' -require 'google/protobuf/timestamp_pb' - - -descriptor_data = "\n,google/cloud/secrets/v1beta1/resources.proto\x12\x1cgoogle.cloud.secrets.v1beta1\x1a\x1fgoogle/api/field_behavior.proto\x1a\x19google/api/resource.proto\x1a\x1fgoogle/protobuf/timestamp.proto\"\xd9\x02\n\x06Secret\x12\x11\n\x04name\x18\x01 \x01(\tB\x03\xe0\x41\x03\x12\x46\n\x0breplication\x18\x02 \x01(\x0b\x32).google.cloud.secrets.v1beta1.ReplicationB\x06\xe0\x41\x05\xe0\x41\x02\x12\x34\n\x0b\x63reate_time\x18\x03 \x01(\x0b\x32\x1a.google.protobuf.TimestampB\x03\xe0\x41\x03\x12@\n\x06labels\x18\x04 \x03(\x0b\x32\x30.google.cloud.secrets.v1beta1.Secret.LabelsEntry\x1a-\n\x0bLabelsEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12\r\n\x05value\x18\x02 \x01(\t:\x02\x38\x01:M\xea\x41J\n#secretmanager.googleapis.com/Secret\x12#projects/{project}/secrets/{secret}\"\x90\x03\n\rSecretVersion\x12\x11\n\x04name\x18\x01 \x01(\tB\x03\xe0\x41\x03\x12\x34\n\x0b\x63reate_time\x18\x02 \x01(\x0b\x32\x1a.google.protobuf.TimestampB\x03\xe0\x41\x03\x12\x35\n\x0c\x64\x65stroy_time\x18\x03 \x01(\x0b\x32\x1a.google.protobuf.TimestampB\x03\xe0\x41\x03\x12\x45\n\x05state\x18\x04 \x01(\x0e\x32\x31.google.cloud.secrets.v1beta1.SecretVersion.StateB\x03\xe0\x41\x03\"H\n\x05State\x12\x15\n\x11STATE_UNSPECIFIED\x10\x00\x12\x0b\n\x07\x45NABLED\x10\x01\x12\x0c\n\x08\x44ISABLED\x10\x02\x12\r\n\tDESTROYED\x10\x03:n\xea\x41k\n*secretmanager.googleapis.com/SecretVersion\x12=projects/{project}/secrets/{secret}/versions/{secret_version}\"\xc5\x02\n\x0bReplication\x12H\n\tautomatic\x18\x01 \x01(\x0b\x32\x33.google.cloud.secrets.v1beta1.Replication.AutomaticH\x00\x12M\n\x0cuser_managed\x18\x02 \x01(\x0b\x32\x35.google.cloud.secrets.v1beta1.Replication.UserManagedH\x00\x1a\x0b\n\tAutomatic\x1a\x80\x01\n\x0bUserManaged\x12T\n\x08replicas\x18\x01 \x03(\x0b\x32=.google.cloud.secrets.v1beta1.Replication.UserManaged.ReplicaB\x03\xe0\x41\x02\x1a\x1b\n\x07Replica\x12\x10\n\x08location\x18\x01 \x01(\tB\r\n\x0breplication\"\x1d\n\rSecretPayload\x12\x0c\n\x04\x64\x61ta\x18\x01 \x01(\x0c\x42\xee\x01\n&com.google.cloud.secretmanager.v1beta1B\x0eResourcesProtoP\x01Z:cloud.google.com/go/secrets/apiv1beta1/secretspb;secretspb\xa2\x02\x03GSM\xaa\x02\"Google.Cloud.SecretManager.V1Beta1\xca\x02\"Google\\Cloud\\SecretManager\\V1beta1\xea\x02%Google::Cloud::SecretManager::V1beta1b\x06proto3" - -pool = ::Google::Protobuf::DescriptorPool.generated_pool -pool.add_serialized_file(descriptor_data) - -module Google - module Cloud - module SecretManager - module V1beta1 - Secret = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.secrets.v1beta1.Secret").msgclass - SecretVersion = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.secrets.v1beta1.SecretVersion").msgclass - SecretVersion::State = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.secrets.v1beta1.SecretVersion.State").enummodule - Replication = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.secrets.v1beta1.Replication").msgclass - Replication::Automatic = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.secrets.v1beta1.Replication.Automatic").msgclass - Replication::UserManaged = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.secrets.v1beta1.Replication.UserManaged").msgclass - Replication::UserManaged::Replica = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.secrets.v1beta1.Replication.UserManaged.Replica").msgclass - SecretPayload = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.secrets.v1beta1.SecretPayload").msgclass - end - end - end -end diff --git a/owl-bot-staging/google-cloud-secret_manager-v1beta1/lib/google/cloud/secrets/v1beta1/service_pb.rb b/owl-bot-staging/google-cloud-secret_manager-v1beta1/lib/google/cloud/secrets/v1beta1/service_pb.rb deleted file mode 100644 index af5986516c2c..000000000000 --- a/owl-bot-staging/google-cloud-secret_manager-v1beta1/lib/google/cloud/secrets/v1beta1/service_pb.rb +++ /dev/null @@ -1,45 +0,0 @@ -# frozen_string_literal: true -# Generated by the protocol buffer compiler. DO NOT EDIT! -# source: google/cloud/secrets/v1beta1/service.proto - -require 'google/protobuf' - -require 'google/api/annotations_pb' -require 'google/api/client_pb' -require 'google/api/field_behavior_pb' -require 'google/api/resource_pb' -require 'google/cloud/secrets/v1beta1/resources_pb' -require 'google/iam/v1/iam_policy_pb' -require 'google/iam/v1/policy_pb' -require 'google/protobuf/empty_pb' -require 'google/protobuf/field_mask_pb' - - -descriptor_data = "\n*google/cloud/secrets/v1beta1/service.proto\x12\x1cgoogle.cloud.secrets.v1beta1\x1a\x1cgoogle/api/annotations.proto\x1a\x17google/api/client.proto\x1a\x1fgoogle/api/field_behavior.proto\x1a\x19google/api/resource.proto\x1a,google/cloud/secrets/v1beta1/resources.proto\x1a\x1egoogle/iam/v1/iam_policy.proto\x1a\x1agoogle/iam/v1/policy.proto\x1a\x1bgoogle/protobuf/empty.proto\x1a google/protobuf/field_mask.proto\"\x8a\x01\n\x12ListSecretsRequest\x12\x43\n\x06parent\x18\x01 \x01(\tB3\xe0\x41\x02\xfa\x41-\n+cloudresourcemanager.googleapis.com/Project\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\"y\n\x13ListSecretsResponse\x12\x35\n\x07secrets\x18\x01 \x03(\x0b\x32$.google.cloud.secrets.v1beta1.Secret\x12\x17\n\x0fnext_page_token\x18\x02 \x01(\t\x12\x12\n\ntotal_size\x18\x03 \x01(\x05\"\xad\x01\n\x13\x43reateSecretRequest\x12\x43\n\x06parent\x18\x01 \x01(\tB3\xe0\x41\x02\xfa\x41-\n+cloudresourcemanager.googleapis.com/Project\x12\x16\n\tsecret_id\x18\x02 \x01(\tB\x03\xe0\x41\x02\x12\x39\n\x06secret\x18\x03 \x01(\x0b\x32$.google.cloud.secrets.v1beta1.SecretB\x03\xe0\x41\x02\"\x99\x01\n\x17\x41\x64\x64SecretVersionRequest\x12;\n\x06parent\x18\x01 \x01(\tB+\xe0\x41\x02\xfa\x41%\n#secretmanager.googleapis.com/Secret\x12\x41\n\x07payload\x18\x02 \x01(\x0b\x32+.google.cloud.secrets.v1beta1.SecretPayloadB\x03\xe0\x41\x02\"M\n\x10GetSecretRequest\x12\x39\n\x04name\x18\x01 \x01(\tB+\xe0\x41\x02\xfa\x41%\n#secretmanager.googleapis.com/Secret\"\x89\x01\n\x19ListSecretVersionsRequest\x12;\n\x06parent\x18\x01 \x01(\tB+\xe0\x41\x02\xfa\x41%\n#secretmanager.googleapis.com/Secret\x12\x16\n\tpage_size\x18\x02 \x01(\x05\x42\x03\xe0\x41\x01\x12\x17\n\npage_token\x18\x03 \x01(\tB\x03\xe0\x41\x01\"\x88\x01\n\x1aListSecretVersionsResponse\x12=\n\x08versions\x18\x01 \x03(\x0b\x32+.google.cloud.secrets.v1beta1.SecretVersion\x12\x17\n\x0fnext_page_token\x18\x02 \x01(\t\x12\x12\n\ntotal_size\x18\x03 \x01(\x05\"[\n\x17GetSecretVersionRequest\x12@\n\x04name\x18\x01 \x01(\tB2\xe0\x41\x02\xfa\x41,\n*secretmanager.googleapis.com/SecretVersion\"\x86\x01\n\x13UpdateSecretRequest\x12\x39\n\x06secret\x18\x01 \x01(\x0b\x32$.google.cloud.secrets.v1beta1.SecretB\x03\xe0\x41\x02\x12\x34\n\x0bupdate_mask\x18\x02 \x01(\x0b\x32\x1a.google.protobuf.FieldMaskB\x03\xe0\x41\x02\"^\n\x1a\x41\x63\x63\x65ssSecretVersionRequest\x12@\n\x04name\x18\x01 \x01(\tB2\xe0\x41\x02\xfa\x41,\n*secretmanager.googleapis.com/SecretVersion\"\x9a\x01\n\x1b\x41\x63\x63\x65ssSecretVersionResponse\x12=\n\x04name\x18\x01 \x01(\tB/\xfa\x41,\n*secretmanager.googleapis.com/SecretVersion\x12<\n\x07payload\x18\x02 \x01(\x0b\x32+.google.cloud.secrets.v1beta1.SecretPayload\"P\n\x13\x44\x65leteSecretRequest\x12\x39\n\x04name\x18\x01 \x01(\tB+\xe0\x41\x02\xfa\x41%\n#secretmanager.googleapis.com/Secret\"_\n\x1b\x44isableSecretVersionRequest\x12@\n\x04name\x18\x01 \x01(\tB2\xe0\x41\x02\xfa\x41,\n*secretmanager.googleapis.com/SecretVersion\"^\n\x1a\x45nableSecretVersionRequest\x12@\n\x04name\x18\x01 \x01(\tB2\xe0\x41\x02\xfa\x41,\n*secretmanager.googleapis.com/SecretVersion\"_\n\x1b\x44\x65stroySecretVersionRequest\x12@\n\x04name\x18\x01 \x01(\tB2\xe0\x41\x02\xfa\x41,\n*secretmanager.googleapis.com/SecretVersion2\x83\x16\n\x14SecretManagerService\x12\xa9\x01\n\x0bListSecrets\x12\x30.google.cloud.secrets.v1beta1.ListSecretsRequest\x1a\x31.google.cloud.secrets.v1beta1.ListSecretsResponse\"5\xda\x41\x06parent\x82\xd3\xe4\x93\x02&\x12$/v1beta1/{parent=projects/*}/secrets\x12\xb7\x01\n\x0c\x43reateSecret\x12\x31.google.cloud.secrets.v1beta1.CreateSecretRequest\x1a$.google.cloud.secrets.v1beta1.Secret\"N\xda\x41\x17parent,secret_id,secret\x82\xd3\xe4\x93\x02.\"$/v1beta1/{parent=projects/*}/secrets:\x06secret\x12\xc5\x01\n\x10\x41\x64\x64SecretVersion\x12\x35.google.cloud.secrets.v1beta1.AddSecretVersionRequest\x1a+.google.cloud.secrets.v1beta1.SecretVersion\"M\xda\x41\x0eparent,payload\x82\xd3\xe4\x93\x02\x36\"1/v1beta1/{parent=projects/*/secrets/*}:addVersion:\x01*\x12\x96\x01\n\tGetSecret\x12..google.cloud.secrets.v1beta1.GetSecretRequest\x1a$.google.cloud.secrets.v1beta1.Secret\"3\xda\x41\x04name\x82\xd3\xe4\x93\x02&\x12$/v1beta1/{name=projects/*/secrets/*}\x12\xb9\x01\n\x0cUpdateSecret\x12\x31.google.cloud.secrets.v1beta1.UpdateSecretRequest\x1a$.google.cloud.secrets.v1beta1.Secret\"P\xda\x41\x12secret,update_mask\x82\xd3\xe4\x93\x02\x35\x32+/v1beta1/{secret.name=projects/*/secrets/*}:\x06secret\x12\x8e\x01\n\x0c\x44\x65leteSecret\x12\x31.google.cloud.secrets.v1beta1.DeleteSecretRequest\x1a\x16.google.protobuf.Empty\"3\xda\x41\x04name\x82\xd3\xe4\x93\x02&*$/v1beta1/{name=projects/*/secrets/*}\x12\xc9\x01\n\x12ListSecretVersions\x12\x37.google.cloud.secrets.v1beta1.ListSecretVersionsRequest\x1a\x38.google.cloud.secrets.v1beta1.ListSecretVersionsResponse\"@\xda\x41\x06parent\x82\xd3\xe4\x93\x02\x31\x12//v1beta1/{parent=projects/*/secrets/*}/versions\x12\xb6\x01\n\x10GetSecretVersion\x12\x35.google.cloud.secrets.v1beta1.GetSecretVersionRequest\x1a+.google.cloud.secrets.v1beta1.SecretVersion\">\xda\x41\x04name\x82\xd3\xe4\x93\x02\x31\x12//v1beta1/{name=projects/*/secrets/*/versions/*}\x12\xd1\x01\n\x13\x41\x63\x63\x65ssSecretVersion\x12\x38.google.cloud.secrets.v1beta1.AccessSecretVersionRequest\x1a\x39.google.cloud.secrets.v1beta1.AccessSecretVersionResponse\"E\xda\x41\x04name\x82\xd3\xe4\x93\x02\x38\x12\x36/v1beta1/{name=projects/*/secrets/*/versions/*}:access\x12\xc9\x01\n\x14\x44isableSecretVersion\x12\x39.google.cloud.secrets.v1beta1.DisableSecretVersionRequest\x1a+.google.cloud.secrets.v1beta1.SecretVersion\"I\xda\x41\x04name\x82\xd3\xe4\x93\x02<\"7/v1beta1/{name=projects/*/secrets/*/versions/*}:disable:\x01*\x12\xc6\x01\n\x13\x45nableSecretVersion\x12\x38.google.cloud.secrets.v1beta1.EnableSecretVersionRequest\x1a+.google.cloud.secrets.v1beta1.SecretVersion\"H\xda\x41\x04name\x82\xd3\xe4\x93\x02;\"6/v1beta1/{name=projects/*/secrets/*/versions/*}:enable:\x01*\x12\xc9\x01\n\x14\x44\x65stroySecretVersion\x12\x39.google.cloud.secrets.v1beta1.DestroySecretVersionRequest\x1a+.google.cloud.secrets.v1beta1.SecretVersion\"I\xda\x41\x04name\x82\xd3\xe4\x93\x02<\"7/v1beta1/{name=projects/*/secrets/*/versions/*}:destroy:\x01*\x12\x8b\x01\n\x0cSetIamPolicy\x12\".google.iam.v1.SetIamPolicyRequest\x1a\x15.google.iam.v1.Policy\"@\x82\xd3\xe4\x93\x02:\"5/v1beta1/{resource=projects/*/secrets/*}:setIamPolicy:\x01*\x12\x88\x01\n\x0cGetIamPolicy\x12\".google.iam.v1.GetIamPolicyRequest\x1a\x15.google.iam.v1.Policy\"=\x82\xd3\xe4\x93\x02\x37\x12\x35/v1beta1/{resource=projects/*/secrets/*}:getIamPolicy\x12\xb1\x01\n\x12TestIamPermissions\x12(.google.iam.v1.TestIamPermissionsRequest\x1a).google.iam.v1.TestIamPermissionsResponse\"F\x82\xd3\xe4\x93\x02@\";/v1beta1/{resource=projects/*/secrets/*}:testIamPermissions:\x01*\x1aP\xca\x41\x1csecretmanager.googleapis.com\xd2\x41.https://www.googleapis.com/auth/cloud-platformB\xec\x01\n&com.google.cloud.secretmanager.v1beta1B\x0cServiceProtoP\x01Z:cloud.google.com/go/secrets/apiv1beta1/secretspb;secretspb\xa2\x02\x03GSM\xaa\x02\"Google.Cloud.SecretManager.V1Beta1\xca\x02\"Google\\Cloud\\SecretManager\\V1beta1\xea\x02%Google::Cloud::SecretManager::V1beta1b\x06proto3" - -pool = ::Google::Protobuf::DescriptorPool.generated_pool -pool.add_serialized_file(descriptor_data) - -module Google - module Cloud - module SecretManager - module V1beta1 - ListSecretsRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.secrets.v1beta1.ListSecretsRequest").msgclass - ListSecretsResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.secrets.v1beta1.ListSecretsResponse").msgclass - CreateSecretRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.secrets.v1beta1.CreateSecretRequest").msgclass - AddSecretVersionRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.secrets.v1beta1.AddSecretVersionRequest").msgclass - GetSecretRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.secrets.v1beta1.GetSecretRequest").msgclass - ListSecretVersionsRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.secrets.v1beta1.ListSecretVersionsRequest").msgclass - ListSecretVersionsResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.secrets.v1beta1.ListSecretVersionsResponse").msgclass - GetSecretVersionRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.secrets.v1beta1.GetSecretVersionRequest").msgclass - UpdateSecretRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.secrets.v1beta1.UpdateSecretRequest").msgclass - AccessSecretVersionRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.secrets.v1beta1.AccessSecretVersionRequest").msgclass - AccessSecretVersionResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.secrets.v1beta1.AccessSecretVersionResponse").msgclass - DeleteSecretRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.secrets.v1beta1.DeleteSecretRequest").msgclass - DisableSecretVersionRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.secrets.v1beta1.DisableSecretVersionRequest").msgclass - EnableSecretVersionRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.secrets.v1beta1.EnableSecretVersionRequest").msgclass - DestroySecretVersionRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.secrets.v1beta1.DestroySecretVersionRequest").msgclass - end - end - end -end diff --git a/owl-bot-staging/google-cloud-secret_manager-v1beta1/lib/google/cloud/secrets/v1beta1/service_services_pb.rb b/owl-bot-staging/google-cloud-secret_manager-v1beta1/lib/google/cloud/secrets/v1beta1/service_services_pb.rb deleted file mode 100644 index 3ffb62db71bb..000000000000 --- a/owl-bot-staging/google-cloud-secret_manager-v1beta1/lib/google/cloud/secrets/v1beta1/service_services_pb.rb +++ /dev/null @@ -1,117 +0,0 @@ -# Generated by the protocol buffer compiler. DO NOT EDIT! -# Source: google/cloud/secrets/v1beta1/service.proto for package 'Google.Cloud.SecretManager.V1beta1' -# Original file comments: -# 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 -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. -# - -require 'grpc' -require 'google/cloud/secrets/v1beta1/service_pb' - -module Google - module Cloud - module SecretManager - module V1beta1 - module SecretManagerService - # Secret Manager Service - # - # Manages secrets and operations using those secrets. Implements a REST - # model with the following objects: - # - # * [Secret][google.cloud.secrets.v1beta1.Secret] - # * [SecretVersion][google.cloud.secrets.v1beta1.SecretVersion] - class Service - - include ::GRPC::GenericService - - self.marshal_class_method = :encode - self.unmarshal_class_method = :decode - self.service_name = 'google.cloud.secrets.v1beta1.SecretManagerService' - - # Lists [Secrets][google.cloud.secrets.v1beta1.Secret]. - rpc :ListSecrets, ::Google::Cloud::SecretManager::V1beta1::ListSecretsRequest, ::Google::Cloud::SecretManager::V1beta1::ListSecretsResponse - # Creates a new [Secret][google.cloud.secrets.v1beta1.Secret] containing no - # [SecretVersions][google.cloud.secrets.v1beta1.SecretVersion]. - rpc :CreateSecret, ::Google::Cloud::SecretManager::V1beta1::CreateSecretRequest, ::Google::Cloud::SecretManager::V1beta1::Secret - # Creates a new [SecretVersion][google.cloud.secrets.v1beta1.SecretVersion] - # containing secret data and attaches it to an existing - # [Secret][google.cloud.secrets.v1beta1.Secret]. - rpc :AddSecretVersion, ::Google::Cloud::SecretManager::V1beta1::AddSecretVersionRequest, ::Google::Cloud::SecretManager::V1beta1::SecretVersion - # Gets metadata for a given [Secret][google.cloud.secrets.v1beta1.Secret]. - rpc :GetSecret, ::Google::Cloud::SecretManager::V1beta1::GetSecretRequest, ::Google::Cloud::SecretManager::V1beta1::Secret - # Updates metadata of an existing - # [Secret][google.cloud.secrets.v1beta1.Secret]. - rpc :UpdateSecret, ::Google::Cloud::SecretManager::V1beta1::UpdateSecretRequest, ::Google::Cloud::SecretManager::V1beta1::Secret - # Deletes a [Secret][google.cloud.secrets.v1beta1.Secret]. - rpc :DeleteSecret, ::Google::Cloud::SecretManager::V1beta1::DeleteSecretRequest, ::Google::Protobuf::Empty - # Lists [SecretVersions][google.cloud.secrets.v1beta1.SecretVersion]. This - # call does not return secret data. - rpc :ListSecretVersions, ::Google::Cloud::SecretManager::V1beta1::ListSecretVersionsRequest, ::Google::Cloud::SecretManager::V1beta1::ListSecretVersionsResponse - # Gets metadata for a - # [SecretVersion][google.cloud.secrets.v1beta1.SecretVersion]. - # - # `projects/*/secrets/*/versions/latest` is an alias to the `latest` - # [SecretVersion][google.cloud.secrets.v1beta1.SecretVersion]. - rpc :GetSecretVersion, ::Google::Cloud::SecretManager::V1beta1::GetSecretVersionRequest, ::Google::Cloud::SecretManager::V1beta1::SecretVersion - # Accesses a [SecretVersion][google.cloud.secrets.v1beta1.SecretVersion]. - # This call returns the secret data. - # - # `projects/*/secrets/*/versions/latest` is an alias to the `latest` - # [SecretVersion][google.cloud.secrets.v1beta1.SecretVersion]. - rpc :AccessSecretVersion, ::Google::Cloud::SecretManager::V1beta1::AccessSecretVersionRequest, ::Google::Cloud::SecretManager::V1beta1::AccessSecretVersionResponse - # Disables a [SecretVersion][google.cloud.secrets.v1beta1.SecretVersion]. - # - # Sets the [state][google.cloud.secrets.v1beta1.SecretVersion.state] of the - # [SecretVersion][google.cloud.secrets.v1beta1.SecretVersion] to - # [DISABLED][google.cloud.secrets.v1beta1.SecretVersion.State.DISABLED]. - rpc :DisableSecretVersion, ::Google::Cloud::SecretManager::V1beta1::DisableSecretVersionRequest, ::Google::Cloud::SecretManager::V1beta1::SecretVersion - # Enables a [SecretVersion][google.cloud.secrets.v1beta1.SecretVersion]. - # - # Sets the [state][google.cloud.secrets.v1beta1.SecretVersion.state] of the - # [SecretVersion][google.cloud.secrets.v1beta1.SecretVersion] to - # [ENABLED][google.cloud.secrets.v1beta1.SecretVersion.State.ENABLED]. - rpc :EnableSecretVersion, ::Google::Cloud::SecretManager::V1beta1::EnableSecretVersionRequest, ::Google::Cloud::SecretManager::V1beta1::SecretVersion - # Destroys a [SecretVersion][google.cloud.secrets.v1beta1.SecretVersion]. - # - # Sets the [state][google.cloud.secrets.v1beta1.SecretVersion.state] of the - # [SecretVersion][google.cloud.secrets.v1beta1.SecretVersion] to - # [DESTROYED][google.cloud.secrets.v1beta1.SecretVersion.State.DESTROYED] and - # irrevocably destroys the secret data. - rpc :DestroySecretVersion, ::Google::Cloud::SecretManager::V1beta1::DestroySecretVersionRequest, ::Google::Cloud::SecretManager::V1beta1::SecretVersion - # Sets the access control policy on the specified secret. Replaces any - # existing policy. - # - # Permissions on [SecretVersions][google.cloud.secrets.v1beta1.SecretVersion] - # are enforced according to the policy set on the associated - # [Secret][google.cloud.secrets.v1beta1.Secret]. - rpc :SetIamPolicy, ::Google::Iam::V1::SetIamPolicyRequest, ::Google::Iam::V1::Policy - # Gets the access control policy for a secret. - # Returns empty policy if the secret exists and does not have a policy set. - rpc :GetIamPolicy, ::Google::Iam::V1::GetIamPolicyRequest, ::Google::Iam::V1::Policy - # Returns permissions that a caller has for the specified secret. - # If the secret does not exist, this call returns an empty set of - # permissions, not a NOT_FOUND error. - # - # Note: This operation is designed to be used for building permission-aware - # UIs and command-line tools, not for authorization checking. This operation - # may "fail open" without warning. - rpc :TestIamPermissions, ::Google::Iam::V1::TestIamPermissionsRequest, ::Google::Iam::V1::TestIamPermissionsResponse - end - - Stub = Service.rpc_stub_class - end - end - end - end -end diff --git a/owl-bot-staging/google-cloud-secret_manager-v1beta1/proto_docs/README.md b/owl-bot-staging/google-cloud-secret_manager-v1beta1/proto_docs/README.md deleted file mode 100644 index 0040e72113a2..000000000000 --- a/owl-bot-staging/google-cloud-secret_manager-v1beta1/proto_docs/README.md +++ /dev/null @@ -1,4 +0,0 @@ -# Secret Manager V1beta1 Protocol Buffer Documentation - -These files are for the YARD documentation of the generated protobuf files. -They are not intended to be required or loaded at runtime. diff --git a/owl-bot-staging/google-cloud-secret_manager-v1beta1/proto_docs/google/api/client.rb b/owl-bot-staging/google-cloud-secret_manager-v1beta1/proto_docs/google/api/client.rb deleted file mode 100644 index 5089551e9ea4..000000000000 --- a/owl-bot-staging/google-cloud-secret_manager-v1beta1/proto_docs/google/api/client.rb +++ /dev/null @@ -1,589 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - - -module Google - module Api - # Required information for every language. - # @!attribute [rw] reference_docs_uri - # @deprecated This field is deprecated and may be removed in the next major version update. - # @return [::String] - # Link to automatically generated reference documentation. Example: - # https://cloud.google.com/nodejs/docs/reference/asset/latest - # @!attribute [rw] destinations - # @return [::Array<::Google::Api::ClientLibraryDestination>] - # The destination where API teams want this client library to be published. - # @!attribute [rw] selective_gapic_generation - # @return [::Google::Api::SelectiveGapicGeneration] - # Configuration for which RPCs should be generated in the GAPIC client. - class CommonLanguageSettings - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Details about how and where to publish client libraries. - # @!attribute [rw] version - # @return [::String] - # Version of the API to apply these settings to. This is the full protobuf - # package for the API, ending in the version element. - # Examples: "google.cloud.speech.v1" and "google.spanner.admin.database.v1". - # @!attribute [rw] launch_stage - # @return [::Google::Api::LaunchStage] - # Launch stage of this version of the API. - # @!attribute [rw] rest_numeric_enums - # @return [::Boolean] - # When using transport=rest, the client request will encode enums as - # numbers rather than strings. - # @!attribute [rw] java_settings - # @return [::Google::Api::JavaSettings] - # Settings for legacy Java features, supported in the Service YAML. - # @!attribute [rw] cpp_settings - # @return [::Google::Api::CppSettings] - # Settings for C++ client libraries. - # @!attribute [rw] php_settings - # @return [::Google::Api::PhpSettings] - # Settings for PHP client libraries. - # @!attribute [rw] python_settings - # @return [::Google::Api::PythonSettings] - # Settings for Python client libraries. - # @!attribute [rw] node_settings - # @return [::Google::Api::NodeSettings] - # Settings for Node client libraries. - # @!attribute [rw] dotnet_settings - # @return [::Google::Api::DotnetSettings] - # Settings for .NET client libraries. - # @!attribute [rw] ruby_settings - # @return [::Google::Api::RubySettings] - # Settings for Ruby client libraries. - # @!attribute [rw] go_settings - # @return [::Google::Api::GoSettings] - # Settings for Go client libraries. - class ClientLibrarySettings - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # This message configures the settings for publishing [Google Cloud Client - # libraries](https://cloud.google.com/apis/docs/cloud-client-libraries) - # generated from the service config. - # @!attribute [rw] method_settings - # @return [::Array<::Google::Api::MethodSettings>] - # A list of API method settings, e.g. the behavior for methods that use the - # long-running operation pattern. - # @!attribute [rw] new_issue_uri - # @return [::String] - # Link to a *public* URI where users can report issues. Example: - # https://issuetracker.google.com/issues/new?component=190865&template=1161103 - # @!attribute [rw] documentation_uri - # @return [::String] - # Link to product home page. Example: - # https://cloud.google.com/asset-inventory/docs/overview - # @!attribute [rw] api_short_name - # @return [::String] - # Used as a tracking tag when collecting data about the APIs developer - # relations artifacts like docs, packages delivered to package managers, - # etc. Example: "speech". - # @!attribute [rw] github_label - # @return [::String] - # GitHub label to apply to issues and pull requests opened for this API. - # @!attribute [rw] codeowner_github_teams - # @return [::Array<::String>] - # GitHub teams to be added to CODEOWNERS in the directory in GitHub - # containing source code for the client libraries for this API. - # @!attribute [rw] doc_tag_prefix - # @return [::String] - # A prefix used in sample code when demarking regions to be included in - # documentation. - # @!attribute [rw] organization - # @return [::Google::Api::ClientLibraryOrganization] - # For whom the client library is being published. - # @!attribute [rw] library_settings - # @return [::Array<::Google::Api::ClientLibrarySettings>] - # Client library settings. If the same version string appears multiple - # times in this list, then the last one wins. Settings from earlier - # settings with the same version string are discarded. - # @!attribute [rw] proto_reference_documentation_uri - # @return [::String] - # Optional link to proto reference documentation. Example: - # https://cloud.google.com/pubsub/lite/docs/reference/rpc - # @!attribute [rw] rest_reference_documentation_uri - # @return [::String] - # Optional link to REST reference documentation. Example: - # https://cloud.google.com/pubsub/lite/docs/reference/rest - class Publishing - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Settings for Java client libraries. - # @!attribute [rw] library_package - # @return [::String] - # The package name to use in Java. Clobbers the java_package option - # set in the protobuf. This should be used **only** by APIs - # who have already set the language_settings.java.package_name" field - # in gapic.yaml. API teams should use the protobuf java_package option - # where possible. - # - # Example of a YAML configuration:: - # - # publishing: - # 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. - # @!attribute [rw] methods - # @return [::Array<::String>] - # An allowlist of the fully qualified names of RPCs that should be included - # on public client surfaces. - # @!attribute [rw] generate_omitted_as_internal - # @return [::Boolean] - # Setting this to true indicates to the client generators that methods - # that would be excluded from the generation should instead be generated - # in a way that indicates these methods should not be consumed by - # end users. How this is expressed is up to individual language - # implementations to decide. Some examples may be: added annotations, - # obfuscated identifiers, or other language idiomatic patterns. - class SelectiveGapicGeneration - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # `BatchingConfigProto` defines the batching configuration for an API method. - # @!attribute [rw] thresholds - # @return [::Google::Api::BatchingSettingsProto] - # The thresholds which trigger a batched request to be sent. - # @!attribute [rw] batch_descriptor - # @return [::Google::Api::BatchingDescriptorProto] - # The request and response fields used in batching. - class BatchingConfigProto - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # `BatchingSettingsProto` specifies a set of batching thresholds, each of - # which acts as a trigger to send a batch of messages as a request. At least - # one threshold must be positive nonzero. - # @!attribute [rw] element_count_threshold - # @return [::Integer] - # The number of elements of a field collected into a batch which, if - # exceeded, causes the batch to be sent. - # @!attribute [rw] request_byte_threshold - # @return [::Integer] - # The aggregated size of the batched field which, if exceeded, causes the - # batch to be sent. This size is computed by aggregating the sizes of the - # request field to be batched, not of the entire request message. - # @!attribute [rw] delay_threshold - # @return [::Google::Protobuf::Duration] - # The duration after which a batch should be sent, starting from the addition - # of the first message to that batch. - # @!attribute [rw] element_count_limit - # @return [::Integer] - # The maximum number of elements collected in a batch that could be accepted - # by server. - # @!attribute [rw] request_byte_limit - # @return [::Integer] - # The maximum size of the request that could be accepted by server. - # @!attribute [rw] flow_control_element_limit - # @return [::Integer] - # The maximum number of elements allowed by flow control. - # @!attribute [rw] flow_control_byte_limit - # @return [::Integer] - # The maximum size of data allowed by flow control. - # @!attribute [rw] flow_control_limit_exceeded_behavior - # @return [::Google::Api::FlowControlLimitExceededBehaviorProto] - # The behavior to take when the flow control limit is exceeded. - class BatchingSettingsProto - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # `BatchingDescriptorProto` specifies the fields of the request message to be - # used for batching, and, optionally, the fields of the response message to be - # used for demultiplexing. - # @!attribute [rw] batched_field - # @return [::String] - # The repeated field in the request message to be aggregated by batching. - # @!attribute [rw] discriminator_fields - # @return [::Array<::String>] - # A list of the fields in the request message. Two requests will be batched - # together only if the values of every field specified in - # `request_discriminator_fields` is equal between the two requests. - # @!attribute [rw] subresponse_field - # @return [::String] - # Optional. When present, indicates the field in the response message to be - # used to demultiplex the response into multiple response messages, in - # correspondence with the multiple request messages originally batched - # together. - class BatchingDescriptorProto - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # The organization for which the client libraries are being published. - # Affects the url where generated docs are published, etc. - module ClientLibraryOrganization - # Not useful. - CLIENT_LIBRARY_ORGANIZATION_UNSPECIFIED = 0 - - # Google Cloud Platform Org. - CLOUD = 1 - - # Ads (Advertising) Org. - ADS = 2 - - # Photos Org. - PHOTOS = 3 - - # Street View Org. - STREET_VIEW = 4 - - # Shopping Org. - SHOPPING = 5 - - # Geo Org. - GEO = 6 - - # Generative AI - https://developers.generativeai.google - GENERATIVE_AI = 7 - end - - # To where should client libraries be published? - module ClientLibraryDestination - # Client libraries will neither be generated nor published to package - # managers. - CLIENT_LIBRARY_DESTINATION_UNSPECIFIED = 0 - - # Generate the client library in a repo under github.com/googleapis, - # but don't publish it to package managers. - GITHUB = 10 - - # Publish the library to package managers like nuget.org and npmjs.com. - PACKAGE_MANAGER = 20 - end - - # The behavior to take when the flow control limit is exceeded. - module FlowControlLimitExceededBehaviorProto - # Default behavior, system-defined. - UNSET_BEHAVIOR = 0 - - # Stop operation, raise error. - THROW_EXCEPTION = 1 - - # Pause operation until limit clears. - BLOCK = 2 - - # Continue operation, disregard limit. - IGNORE = 3 - end - end -end diff --git a/owl-bot-staging/google-cloud-secret_manager-v1beta1/proto_docs/google/api/field_behavior.rb b/owl-bot-staging/google-cloud-secret_manager-v1beta1/proto_docs/google/api/field_behavior.rb deleted file mode 100644 index 582be187d115..000000000000 --- a/owl-bot-staging/google-cloud-secret_manager-v1beta1/proto_docs/google/api/field_behavior.rb +++ /dev/null @@ -1,85 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - - -module Google - module Api - # An indicator of the behavior of a given field (for example, that a field - # is required in requests, or given as output but ignored as input). - # This **does not** change the behavior in protocol buffers itself; it only - # denotes the behavior and may affect how API tooling handles the field. - # - # Note: This enum **may** receive new values in the future. - module FieldBehavior - # Conventional default for enums. Do not use this. - FIELD_BEHAVIOR_UNSPECIFIED = 0 - - # Specifically denotes a field as optional. - # While all fields in protocol buffers are optional, this may be specified - # for emphasis if appropriate. - OPTIONAL = 1 - - # Denotes a field as required. - # This indicates that the field **must** be provided as part of the request, - # and failure to do so will cause an error (usually `INVALID_ARGUMENT`). - REQUIRED = 2 - - # Denotes a field as output only. - # This indicates that the field is provided in responses, but including the - # field in a request does nothing (the server *must* ignore it and - # *must not* throw an error as a result of the field's presence). - OUTPUT_ONLY = 3 - - # Denotes a field as input only. - # This indicates that the field is provided in requests, and the - # corresponding field is not included in output. - INPUT_ONLY = 4 - - # Denotes a field as immutable. - # This indicates that the field may be set once in a request to create a - # resource, but may not be changed thereafter. - IMMUTABLE = 5 - - # Denotes that a (repeated) field is an unordered list. - # This indicates that the service may provide the elements of the list - # in any arbitrary order, rather than the order the user originally - # provided. Additionally, the list's order may or may not be stable. - UNORDERED_LIST = 6 - - # Denotes that this field returns a non-empty default value if not set. - # This indicates that if the user provides the empty value in a request, - # a non-empty value will be returned. The user will not be aware of what - # non-empty value to expect. - NON_EMPTY_DEFAULT = 7 - - # Denotes that the field in a resource (a message annotated with - # google.api.resource) is used in the resource name to uniquely identify the - # resource. For AIP-compliant APIs, this should only be applied to the - # `name` field on the resource. - # - # This behavior should not be applied to references to other resources within - # the message. - # - # The identifier field of resources often have different field behavior - # depending on the request it is embedded in (e.g. for Create methods name - # is optional and unused, while for Update methods it is required). Instead - # of method-specific annotations, only `IDENTIFIER` is required. - IDENTIFIER = 8 - end - end -end diff --git a/owl-bot-staging/google-cloud-secret_manager-v1beta1/proto_docs/google/api/launch_stage.rb b/owl-bot-staging/google-cloud-secret_manager-v1beta1/proto_docs/google/api/launch_stage.rb deleted file mode 100644 index 9392a413fb1b..000000000000 --- a/owl-bot-staging/google-cloud-secret_manager-v1beta1/proto_docs/google/api/launch_stage.rb +++ /dev/null @@ -1,71 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - - -module Google - module Api - # The launch stage as defined by [Google Cloud Platform - # Launch Stages](https://cloud.google.com/terms/launch-stages). - module LaunchStage - # Do not use this default value. - LAUNCH_STAGE_UNSPECIFIED = 0 - - # The feature is not yet implemented. Users can not use it. - UNIMPLEMENTED = 6 - - # Prelaunch features are hidden from users and are only visible internally. - PRELAUNCH = 7 - - # Early Access features are limited to a closed group of testers. To use - # these features, you must sign up in advance and sign a Trusted Tester - # agreement (which includes confidentiality provisions). These features may - # be unstable, changed in backward-incompatible ways, and are not - # guaranteed to be released. - EARLY_ACCESS = 1 - - # Alpha is a limited availability test for releases before they are cleared - # for widespread use. By Alpha, all significant design issues are resolved - # and we are in the process of verifying functionality. Alpha customers - # need to apply for access, agree to applicable terms, and have their - # projects allowlisted. Alpha releases don't have to be feature complete, - # no SLAs are provided, and there are no technical support obligations, but - # they will be far enough along that customers can actually use them in - # test environments or for limited-use tests -- just like they would in - # normal production cases. - ALPHA = 2 - - # Beta is the point at which we are ready to open a release for any - # customer to use. There are no SLA or technical support obligations in a - # Beta release. Products will be complete from a feature perspective, but - # may have some open outstanding issues. Beta releases are suitable for - # limited production use cases. - BETA = 3 - - # GA features are open to all developers and are considered stable and - # fully qualified for production use. - GA = 4 - - # Deprecated features are scheduled to be shut down and removed. For more - # information, see the "Deprecation Policy" section of our [Terms of - # Service](https://cloud.google.com/terms/) - # and the [Google Cloud Platform Subject to the Deprecation - # Policy](https://cloud.google.com/terms/deprecation) documentation. - DEPRECATED = 5 - end - end -end diff --git a/owl-bot-staging/google-cloud-secret_manager-v1beta1/proto_docs/google/api/resource.rb b/owl-bot-staging/google-cloud-secret_manager-v1beta1/proto_docs/google/api/resource.rb deleted file mode 100644 index 25dec4847ac1..000000000000 --- a/owl-bot-staging/google-cloud-secret_manager-v1beta1/proto_docs/google/api/resource.rb +++ /dev/null @@ -1,227 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - - -module Google - module Api - # A simple descriptor of a resource type. - # - # ResourceDescriptor annotates a resource message (either by means of a - # protobuf annotation or use in the service config), and associates the - # resource's schema, the resource type, and the pattern of the resource name. - # - # Example: - # - # message Topic { - # // Indicates this message defines a resource schema. - # // Declares the resource type in the format of {service}/{kind}. - # // For Kubernetes resources, the format is {api group}/{kind}. - # option (google.api.resource) = { - # type: "pubsub.googleapis.com/Topic" - # pattern: "projects/{project}/topics/{topic}" - # }; - # } - # - # The ResourceDescriptor Yaml config will look like: - # - # resources: - # - type: "pubsub.googleapis.com/Topic" - # pattern: "projects/{project}/topics/{topic}" - # - # Sometimes, resources have multiple patterns, typically because they can - # live under multiple parents. - # - # Example: - # - # message LogEntry { - # option (google.api.resource) = { - # type: "logging.googleapis.com/LogEntry" - # pattern: "projects/{project}/logs/{log}" - # pattern: "folders/{folder}/logs/{log}" - # pattern: "organizations/{organization}/logs/{log}" - # pattern: "billingAccounts/{billing_account}/logs/{log}" - # }; - # } - # - # The ResourceDescriptor Yaml config will look like: - # - # resources: - # - type: 'logging.googleapis.com/LogEntry' - # pattern: "projects/{project}/logs/{log}" - # pattern: "folders/{folder}/logs/{log}" - # pattern: "organizations/{organization}/logs/{log}" - # pattern: "billingAccounts/{billing_account}/logs/{log}" - # @!attribute [rw] type - # @return [::String] - # The resource type. It must be in the format of - # \\{service_name}/\\{resource_type_kind}. The `resource_type_kind` must be - # singular and must not include version numbers. - # - # Example: `storage.googleapis.com/Bucket` - # - # The value of the resource_type_kind must follow the regular expression - # /[A-Za-z][a-zA-Z0-9]+/. It should start with an upper case character and - # should use PascalCase (UpperCamelCase). The maximum number of - # characters allowed for the `resource_type_kind` is 100. - # @!attribute [rw] pattern - # @return [::Array<::String>] - # Optional. The relative resource name pattern associated with this resource - # type. The DNS prefix of the full resource name shouldn't be specified here. - # - # The path pattern must follow the syntax, which aligns with HTTP binding - # syntax: - # - # Template = Segment { "/" Segment } ; - # Segment = LITERAL | Variable ; - # Variable = "{" LITERAL "}" ; - # - # Examples: - # - # - "projects/\\{project}/topics/\\{topic}" - # - "projects/\\{project}/knowledgeBases/\\{knowledge_base}" - # - # The components in braces correspond to the IDs for each resource in the - # hierarchy. It is expected that, if multiple patterns are provided, - # the same component name (e.g. "project") refers to IDs of the same - # type of resource. - # @!attribute [rw] name_field - # @return [::String] - # Optional. The field on the resource that designates the resource name - # field. If omitted, this is assumed to be "name". - # @!attribute [rw] history - # @return [::Google::Api::ResourceDescriptor::History] - # Optional. The historical or future-looking state of the resource pattern. - # - # Example: - # - # // The InspectTemplate message originally only supported resource - # // names with organization, and project was added later. - # message InspectTemplate { - # option (google.api.resource) = { - # type: "dlp.googleapis.com/InspectTemplate" - # pattern: - # "organizations/{organization}/inspectTemplates/{inspect_template}" - # pattern: "projects/{project}/inspectTemplates/{inspect_template}" - # history: ORIGINALLY_SINGLE_PATTERN - # }; - # } - # @!attribute [rw] plural - # @return [::String] - # The plural name used in the resource name and permission names, such as - # 'projects' for the resource name of 'projects/\\{project}' and the permission - # name of 'cloudresourcemanager.googleapis.com/projects.get'. One exception - # to this is for Nested Collections that have stuttering names, as defined - # in [AIP-122](https://google.aip.dev/122#nested-collections), where the - # collection ID in the resource name pattern does not necessarily directly - # match the `plural` value. - # - # It is the same concept of the `plural` field in k8s CRD spec - # https://kubernetes.io/docs/tasks/access-kubernetes-api/custom-resources/custom-resource-definitions/ - # - # Note: The plural form is required even for singleton resources. See - # https://aip.dev/156 - # @!attribute [rw] singular - # @return [::String] - # The same concept of the `singular` field in k8s CRD spec - # https://kubernetes.io/docs/tasks/access-kubernetes-api/custom-resources/custom-resource-definitions/ - # Such as "project" for the `resourcemanager.googleapis.com/Project` type. - # @!attribute [rw] style - # @return [::Array<::Google::Api::ResourceDescriptor::Style>] - # Style flag(s) for this resource. - # These indicate that a resource is expected to conform to a given - # style. See the specific style flags for additional information. - class ResourceDescriptor - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - - # A description of the historical or future-looking state of the - # resource pattern. - module History - # The "unset" value. - HISTORY_UNSPECIFIED = 0 - - # The resource originally had one pattern and launched as such, and - # additional patterns were added later. - ORIGINALLY_SINGLE_PATTERN = 1 - - # The resource has one pattern, but the API owner expects to add more - # later. (This is the inverse of ORIGINALLY_SINGLE_PATTERN, and prevents - # that from being necessary once there are multiple patterns.) - FUTURE_MULTI_PATTERN = 2 - end - - # A flag representing a specific style that a resource claims to conform to. - module Style - # The unspecified value. Do not use. - STYLE_UNSPECIFIED = 0 - - # This resource is intended to be "declarative-friendly". - # - # Declarative-friendly resources must be more strictly consistent, and - # setting this to true communicates to tools that this resource should - # adhere to declarative-friendly expectations. - # - # Note: This is used by the API linter (linter.aip.dev) to enable - # additional checks. - DECLARATIVE_FRIENDLY = 1 - end - end - - # Defines a proto annotation that describes a string field that refers to - # an API resource. - # @!attribute [rw] type - # @return [::String] - # The resource type that the annotated field references. - # - # Example: - # - # message Subscription { - # string topic = 2 [(google.api.resource_reference) = { - # type: "pubsub.googleapis.com/Topic" - # }]; - # } - # - # Occasionally, a field may reference an arbitrary resource. In this case, - # APIs use the special value * in their resource reference. - # - # Example: - # - # message GetIamPolicyRequest { - # string resource = 2 [(google.api.resource_reference) = { - # type: "*" - # }]; - # } - # @!attribute [rw] child_type - # @return [::String] - # The resource type of a child collection that the annotated field - # references. This is useful for annotating the `parent` field that - # doesn't have a fixed resource type. - # - # Example: - # - # message ListLogEntriesRequest { - # string parent = 1 [(google.api.resource_reference) = { - # child_type: "logging.googleapis.com/LogEntry" - # }; - # } - class ResourceReference - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - end -end diff --git a/owl-bot-staging/google-cloud-secret_manager-v1beta1/proto_docs/google/cloud/secrets/v1beta1/resources.rb b/owl-bot-staging/google-cloud-secret_manager-v1beta1/proto_docs/google/cloud/secrets/v1beta1/resources.rb deleted file mode 100644 index ad2f4fa25e44..000000000000 --- a/owl-bot-staging/google-cloud-secret_manager-v1beta1/proto_docs/google/cloud/secrets/v1beta1/resources.rb +++ /dev/null @@ -1,189 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - - -module Google - module Cloud - module SecretManager - module V1beta1 - # A {::Google::Cloud::SecretManager::V1beta1::Secret Secret} is a logical secret whose - # value and versions can be accessed. - # - # A {::Google::Cloud::SecretManager::V1beta1::Secret Secret} is made up of zero or more - # {::Google::Cloud::SecretManager::V1beta1::SecretVersion SecretVersions} that represent - # the secret data. - # @!attribute [r] name - # @return [::String] - # Output only. The resource name of the - # {::Google::Cloud::SecretManager::V1beta1::Secret Secret} in the format - # `projects/*/secrets/*`. - # @!attribute [rw] replication - # @return [::Google::Cloud::SecretManager::V1beta1::Replication] - # Required. Immutable. The replication policy of the secret data attached to - # the {::Google::Cloud::SecretManager::V1beta1::Secret Secret}. - # - # The replication policy cannot be changed after the Secret has been created. - # @!attribute [r] create_time - # @return [::Google::Protobuf::Timestamp] - # Output only. The time at which the - # {::Google::Cloud::SecretManager::V1beta1::Secret Secret} was created. - # @!attribute [rw] labels - # @return [::Google::Protobuf::Map{::String => ::String}] - # The labels assigned to this Secret. - # - # Label keys must be between 1 and 63 characters long, have a UTF-8 encoding - # of maximum 128 bytes, and must conform to the following PCRE regular - # expression: `[\p{Ll}\p{Lo}][\p{Ll}\p{Lo}\p{N}_-]{0,62}` - # - # Label values must be between 0 and 63 characters long, have a UTF-8 - # encoding of maximum 128 bytes, and must conform to the following PCRE - # regular expression: `[\p{Ll}\p{Lo}\p{N}_-]{0,63}` - # - # No more than 64 labels can be assigned to a given resource. - class Secret - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - - # @!attribute [rw] key - # @return [::String] - # @!attribute [rw] value - # @return [::String] - class LabelsEntry - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - end - - # A secret version resource in the Secret Manager API. - # @!attribute [r] name - # @return [::String] - # Output only. The resource name of the - # {::Google::Cloud::SecretManager::V1beta1::SecretVersion SecretVersion} in the format - # `projects/*/secrets/*/versions/*`. - # - # {::Google::Cloud::SecretManager::V1beta1::SecretVersion SecretVersion} IDs in a - # {::Google::Cloud::SecretManager::V1beta1::Secret Secret} start at 1 and are - # incremented for each subsequent version of the secret. - # @!attribute [r] create_time - # @return [::Google::Protobuf::Timestamp] - # Output only. The time at which the - # {::Google::Cloud::SecretManager::V1beta1::SecretVersion SecretVersion} was created. - # @!attribute [r] destroy_time - # @return [::Google::Protobuf::Timestamp] - # Output only. The time this - # {::Google::Cloud::SecretManager::V1beta1::SecretVersion SecretVersion} was destroyed. - # Only present if {::Google::Cloud::SecretManager::V1beta1::SecretVersion#state state} - # is {::Google::Cloud::SecretManager::V1beta1::SecretVersion::State::DESTROYED DESTROYED}. - # @!attribute [r] state - # @return [::Google::Cloud::SecretManager::V1beta1::SecretVersion::State] - # Output only. The current state of the - # {::Google::Cloud::SecretManager::V1beta1::SecretVersion SecretVersion}. - class SecretVersion - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - - # The state of a {::Google::Cloud::SecretManager::V1beta1::SecretVersion SecretVersion}, - # indicating if it can be accessed. - module State - # Not specified. This value is unused and invalid. - STATE_UNSPECIFIED = 0 - - # The {::Google::Cloud::SecretManager::V1beta1::SecretVersion SecretVersion} may be - # accessed. - ENABLED = 1 - - # The {::Google::Cloud::SecretManager::V1beta1::SecretVersion SecretVersion} may not - # be accessed, but the secret data is still available and can be placed - # back into the - # {::Google::Cloud::SecretManager::V1beta1::SecretVersion::State::ENABLED ENABLED} - # state. - DISABLED = 2 - - # The {::Google::Cloud::SecretManager::V1beta1::SecretVersion SecretVersion} is - # destroyed and the secret data is no longer stored. A version may not - # leave this state once entered. - DESTROYED = 3 - end - end - - # A policy that defines the replication configuration of data. - # @!attribute [rw] automatic - # @return [::Google::Cloud::SecretManager::V1beta1::Replication::Automatic] - # The {::Google::Cloud::SecretManager::V1beta1::Secret Secret} will automatically be - # replicated without any restrictions. - # - # Note: The following fields are mutually exclusive: `automatic`, `user_managed`. If a field in that set is populated, all other fields in the set will automatically be cleared. - # @!attribute [rw] user_managed - # @return [::Google::Cloud::SecretManager::V1beta1::Replication::UserManaged] - # The {::Google::Cloud::SecretManager::V1beta1::Secret Secret} will only be replicated - # into the locations specified. - # - # Note: The following fields are mutually exclusive: `user_managed`, `automatic`. If a field in that set is populated, all other fields in the set will automatically be cleared. - class Replication - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - - # A replication policy that replicates the - # {::Google::Cloud::SecretManager::V1beta1::Secret Secret} payload without any - # restrictions. - class Automatic - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # A replication policy that replicates the - # {::Google::Cloud::SecretManager::V1beta1::Secret Secret} payload into the locations - # specified in - # {::Google::Cloud::SecretManager::V1beta1::Replication::UserManaged#replicas Replication.UserManaged.replicas} - # @!attribute [rw] replicas - # @return [::Array<::Google::Cloud::SecretManager::V1beta1::Replication::UserManaged::Replica>] - # Required. The list of Replicas for this - # {::Google::Cloud::SecretManager::V1beta1::Secret Secret}. - # - # Cannot be empty. - class UserManaged - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - - # Represents a Replica for this - # {::Google::Cloud::SecretManager::V1beta1::Secret Secret}. - # @!attribute [rw] location - # @return [::String] - # The canonical IDs of the location to replicate data. - # For example: `"us-east1"`. - class Replica - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - end - end - - # A secret payload resource in the Secret Manager API. This contains the - # sensitive secret data that is associated with a - # {::Google::Cloud::SecretManager::V1beta1::SecretVersion SecretVersion}. - # @!attribute [rw] data - # @return [::String] - # The secret data. Must be no larger than 64KiB. - class SecretPayload - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - end - end - end -end diff --git a/owl-bot-staging/google-cloud-secret_manager-v1beta1/proto_docs/google/cloud/secrets/v1beta1/service.rb b/owl-bot-staging/google-cloud-secret_manager-v1beta1/proto_docs/google/cloud/secrets/v1beta1/service.rb deleted file mode 100644 index dc304a41b777..000000000000 --- a/owl-bot-staging/google-cloud-secret_manager-v1beta1/proto_docs/google/cloud/secrets/v1beta1/service.rb +++ /dev/null @@ -1,261 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - - -module Google - module Cloud - module SecretManager - module V1beta1 - # Request message for - # {::Google::Cloud::SecretManager::V1beta1::SecretManagerService::Client#list_secrets SecretManagerService.ListSecrets}. - # @!attribute [rw] parent - # @return [::String] - # Required. The resource name of the project associated with the - # {::Google::Cloud::SecretManager::V1beta1::Secret Secrets}, in the format `projects/*`. - # @!attribute [rw] page_size - # @return [::Integer] - # Optional. The maximum number of results to be returned in a single page. If - # set to 0, the server decides the number of results to return. If the - # number is greater than 25000, it is capped at 25000. - # @!attribute [rw] page_token - # @return [::String] - # Optional. Pagination token, returned earlier via - # {::Google::Cloud::SecretManager::V1beta1::ListSecretsResponse#next_page_token ListSecretsResponse.next_page_token}. - class ListSecretsRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Response message for - # {::Google::Cloud::SecretManager::V1beta1::SecretManagerService::Client#list_secrets SecretManagerService.ListSecrets}. - # @!attribute [rw] secrets - # @return [::Array<::Google::Cloud::SecretManager::V1beta1::Secret>] - # The list of {::Google::Cloud::SecretManager::V1beta1::Secret Secrets} sorted in - # reverse by create_time (newest first). - # @!attribute [rw] next_page_token - # @return [::String] - # A token to retrieve the next page of results. Pass this value in - # {::Google::Cloud::SecretManager::V1beta1::ListSecretsRequest#page_token ListSecretsRequest.page_token} - # to retrieve the next page. - # @!attribute [rw] total_size - # @return [::Integer] - # The total number of {::Google::Cloud::SecretManager::V1beta1::Secret Secrets}. - class ListSecretsResponse - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Request message for - # {::Google::Cloud::SecretManager::V1beta1::SecretManagerService::Client#create_secret SecretManagerService.CreateSecret}. - # @!attribute [rw] parent - # @return [::String] - # Required. The resource name of the project to associate with the - # {::Google::Cloud::SecretManager::V1beta1::Secret Secret}, in the format `projects/*`. - # @!attribute [rw] secret_id - # @return [::String] - # Required. This must be unique within the project. - # - # A secret ID is a string with a maximum length of 255 characters and can - # contain uppercase and lowercase letters, numerals, and the hyphen (`-`) and - # underscore (`_`) characters. - # @!attribute [rw] secret - # @return [::Google::Cloud::SecretManager::V1beta1::Secret] - # Required. A {::Google::Cloud::SecretManager::V1beta1::Secret Secret} with initial - # field values. - class CreateSecretRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Request message for - # {::Google::Cloud::SecretManager::V1beta1::SecretManagerService::Client#add_secret_version SecretManagerService.AddSecretVersion}. - # @!attribute [rw] parent - # @return [::String] - # Required. The resource name of the - # {::Google::Cloud::SecretManager::V1beta1::Secret Secret} to associate with the - # {::Google::Cloud::SecretManager::V1beta1::SecretVersion SecretVersion} in the format - # `projects/*/secrets/*`. - # @!attribute [rw] payload - # @return [::Google::Cloud::SecretManager::V1beta1::SecretPayload] - # Required. The secret payload of the - # {::Google::Cloud::SecretManager::V1beta1::SecretVersion SecretVersion}. - class AddSecretVersionRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Request message for - # {::Google::Cloud::SecretManager::V1beta1::SecretManagerService::Client#get_secret SecretManagerService.GetSecret}. - # @!attribute [rw] name - # @return [::String] - # Required. The resource name of the - # {::Google::Cloud::SecretManager::V1beta1::Secret Secret}, in the format - # `projects/*/secrets/*`. - class GetSecretRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Request message for - # {::Google::Cloud::SecretManager::V1beta1::SecretManagerService::Client#list_secret_versions SecretManagerService.ListSecretVersions}. - # @!attribute [rw] parent - # @return [::String] - # Required. The resource name of the - # {::Google::Cloud::SecretManager::V1beta1::Secret Secret} associated with the - # {::Google::Cloud::SecretManager::V1beta1::SecretVersion SecretVersions} to list, in - # the format `projects/*/secrets/*`. - # @!attribute [rw] page_size - # @return [::Integer] - # Optional. The maximum number of results to be returned in a single page. If - # set to 0, the server decides the number of results to return. If the - # number is greater than 25000, it is capped at 25000. - # @!attribute [rw] page_token - # @return [::String] - # Optional. Pagination token, returned earlier via - # ListSecretVersionsResponse.next_page_token][]. - class ListSecretVersionsRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Response message for - # {::Google::Cloud::SecretManager::V1beta1::SecretManagerService::Client#list_secret_versions SecretManagerService.ListSecretVersions}. - # @!attribute [rw] versions - # @return [::Array<::Google::Cloud::SecretManager::V1beta1::SecretVersion>] - # The list of {::Google::Cloud::SecretManager::V1beta1::SecretVersion SecretVersions} - # sorted in reverse by create_time (newest first). - # @!attribute [rw] next_page_token - # @return [::String] - # A token to retrieve the next page of results. Pass this value in - # {::Google::Cloud::SecretManager::V1beta1::ListSecretVersionsRequest#page_token ListSecretVersionsRequest.page_token} - # to retrieve the next page. - # @!attribute [rw] total_size - # @return [::Integer] - # The total number of - # {::Google::Cloud::SecretManager::V1beta1::SecretVersion SecretVersions}. - class ListSecretVersionsResponse - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Request message for - # {::Google::Cloud::SecretManager::V1beta1::SecretManagerService::Client#get_secret_version SecretManagerService.GetSecretVersion}. - # @!attribute [rw] name - # @return [::String] - # Required. The resource name of the - # {::Google::Cloud::SecretManager::V1beta1::SecretVersion SecretVersion} in the format - # `projects/*/secrets/*/versions/*`. - # `projects/*/secrets/*/versions/latest` is an alias to the `latest` - # {::Google::Cloud::SecretManager::V1beta1::SecretVersion SecretVersion}. - class GetSecretVersionRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Request message for - # {::Google::Cloud::SecretManager::V1beta1::SecretManagerService::Client#update_secret SecretManagerService.UpdateSecret}. - # @!attribute [rw] secret - # @return [::Google::Cloud::SecretManager::V1beta1::Secret] - # Required. {::Google::Cloud::SecretManager::V1beta1::Secret Secret} with updated field - # values. - # @!attribute [rw] update_mask - # @return [::Google::Protobuf::FieldMask] - # Required. Specifies the fields to be updated. - class UpdateSecretRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Request message for - # {::Google::Cloud::SecretManager::V1beta1::SecretManagerService::Client#access_secret_version SecretManagerService.AccessSecretVersion}. - # @!attribute [rw] name - # @return [::String] - # Required. The resource name of the - # {::Google::Cloud::SecretManager::V1beta1::SecretVersion SecretVersion} in the format - # `projects/*/secrets/*/versions/*`. - class AccessSecretVersionRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Response message for - # {::Google::Cloud::SecretManager::V1beta1::SecretManagerService::Client#access_secret_version SecretManagerService.AccessSecretVersion}. - # @!attribute [rw] name - # @return [::String] - # The resource name of the - # {::Google::Cloud::SecretManager::V1beta1::SecretVersion SecretVersion} in the format - # `projects/*/secrets/*/versions/*`. - # @!attribute [rw] payload - # @return [::Google::Cloud::SecretManager::V1beta1::SecretPayload] - # Secret payload - class AccessSecretVersionResponse - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Request message for - # {::Google::Cloud::SecretManager::V1beta1::SecretManagerService::Client#delete_secret SecretManagerService.DeleteSecret}. - # @!attribute [rw] name - # @return [::String] - # Required. The resource name of the - # {::Google::Cloud::SecretManager::V1beta1::Secret Secret} to delete in the format - # `projects/*/secrets/*`. - class DeleteSecretRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Request message for - # {::Google::Cloud::SecretManager::V1beta1::SecretManagerService::Client#disable_secret_version SecretManagerService.DisableSecretVersion}. - # @!attribute [rw] name - # @return [::String] - # Required. The resource name of the - # {::Google::Cloud::SecretManager::V1beta1::SecretVersion SecretVersion} to disable in - # the format `projects/*/secrets/*/versions/*`. - class DisableSecretVersionRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Request message for - # {::Google::Cloud::SecretManager::V1beta1::SecretManagerService::Client#enable_secret_version SecretManagerService.EnableSecretVersion}. - # @!attribute [rw] name - # @return [::String] - # Required. The resource name of the - # {::Google::Cloud::SecretManager::V1beta1::SecretVersion SecretVersion} to enable in - # the format `projects/*/secrets/*/versions/*`. - class EnableSecretVersionRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Request message for - # {::Google::Cloud::SecretManager::V1beta1::SecretManagerService::Client#destroy_secret_version SecretManagerService.DestroySecretVersion}. - # @!attribute [rw] name - # @return [::String] - # Required. The resource name of the - # {::Google::Cloud::SecretManager::V1beta1::SecretVersion SecretVersion} to destroy in - # the format `projects/*/secrets/*/versions/*`. - class DestroySecretVersionRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - end - end - end -end diff --git a/owl-bot-staging/google-cloud-secret_manager-v1beta1/proto_docs/google/iam/v1/iam_policy.rb b/owl-bot-staging/google-cloud-secret_manager-v1beta1/proto_docs/google/iam/v1/iam_policy.rb deleted file mode 100644 index 5445c77f8258..000000000000 --- a/owl-bot-staging/google-cloud-secret_manager-v1beta1/proto_docs/google/iam/v1/iam_policy.rb +++ /dev/null @@ -1,87 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - - -module Google - module Iam - module V1 - # Request message for `SetIamPolicy` method. - # @!attribute [rw] resource - # @return [::String] - # REQUIRED: The resource for which the policy is being specified. - # See the operation documentation for the appropriate value for this field. - # @!attribute [rw] policy - # @return [::Google::Iam::V1::Policy] - # REQUIRED: The complete policy to be applied to the `resource`. The size of - # the policy is limited to a few 10s of KB. An empty policy is a - # valid policy but certain Cloud Platform services (such as Projects) - # might reject them. - # @!attribute [rw] update_mask - # @return [::Google::Protobuf::FieldMask] - # OPTIONAL: A FieldMask specifying which fields of the policy to modify. Only - # the fields in the mask will be modified. If no mask is provided, the - # following default mask is used: - # - # `paths: "bindings, etag"` - class SetIamPolicyRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Request message for `GetIamPolicy` method. - # @!attribute [rw] resource - # @return [::String] - # REQUIRED: The resource for which the policy is being requested. - # See the operation documentation for the appropriate value for this field. - # @!attribute [rw] options - # @return [::Google::Iam::V1::GetPolicyOptions] - # OPTIONAL: A `GetPolicyOptions` object for specifying options to - # `GetIamPolicy`. - class GetIamPolicyRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Request message for `TestIamPermissions` method. - # @!attribute [rw] resource - # @return [::String] - # REQUIRED: The resource for which the policy detail is being requested. - # See the operation documentation for the appropriate value for this field. - # @!attribute [rw] permissions - # @return [::Array<::String>] - # The set of permissions to check for the `resource`. Permissions with - # wildcards (such as '*' or 'storage.*') are not allowed. For more - # information see - # [IAM Overview](https://cloud.google.com/iam/docs/overview#permissions). - class TestIamPermissionsRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Response message for `TestIamPermissions` method. - # @!attribute [rw] permissions - # @return [::Array<::String>] - # A subset of `TestPermissionsRequest.permissions` that the caller is - # allowed. - class TestIamPermissionsResponse - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - end - end -end diff --git a/owl-bot-staging/google-cloud-secret_manager-v1beta1/proto_docs/google/iam/v1/options.rb b/owl-bot-staging/google-cloud-secret_manager-v1beta1/proto_docs/google/iam/v1/options.rb deleted file mode 100644 index 60713d995b86..000000000000 --- a/owl-bot-staging/google-cloud-secret_manager-v1beta1/proto_docs/google/iam/v1/options.rb +++ /dev/null @@ -1,50 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - - -module Google - module Iam - module V1 - # Encapsulates settings provided to GetIamPolicy. - # @!attribute [rw] requested_policy_version - # @return [::Integer] - # Optional. The maximum policy version that will be used to format the - # policy. - # - # Valid values are 0, 1, and 3. Requests specifying an invalid value will be - # rejected. - # - # Requests for policies with any conditional role bindings must specify - # version 3. Policies with no conditional role bindings may specify any valid - # value or leave the field unset. - # - # The policy in the response might use the policy version that you specified, - # or it might use a lower policy version. For example, if you specify version - # 3, but the policy has no conditional role bindings, the response uses - # version 1. - # - # To learn which resources support conditions in their IAM policies, see the - # [IAM - # documentation](https://cloud.google.com/iam/help/conditions/resource-policies). - class GetPolicyOptions - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - end - end -end diff --git a/owl-bot-staging/google-cloud-secret_manager-v1beta1/proto_docs/google/iam/v1/policy.rb b/owl-bot-staging/google-cloud-secret_manager-v1beta1/proto_docs/google/iam/v1/policy.rb deleted file mode 100644 index 999575b797df..000000000000 --- a/owl-bot-staging/google-cloud-secret_manager-v1beta1/proto_docs/google/iam/v1/policy.rb +++ /dev/null @@ -1,426 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - - -module Google - module Iam - module V1 - # An Identity and Access Management (IAM) policy, which specifies access - # controls for Google Cloud resources. - # - # - # A `Policy` is a collection of `bindings`. A `binding` binds one or more - # `members`, or principals, to a single `role`. Principals can be user - # accounts, service accounts, Google groups, and domains (such as G Suite). A - # `role` is a named list of permissions; each `role` can be an IAM predefined - # role or a user-created custom role. - # - # For some types of Google Cloud resources, a `binding` can also specify a - # `condition`, which is a logical expression that allows access to a resource - # only if the expression evaluates to `true`. A condition can add constraints - # based on attributes of the request, the resource, or both. To learn which - # resources support conditions in their IAM policies, see the - # [IAM - # documentation](https://cloud.google.com/iam/help/conditions/resource-policies). - # - # **JSON example:** - # - # ``` - # { - # "bindings": [ - # { - # "role": "roles/resourcemanager.organizationAdmin", - # "members": [ - # "user:mike@example.com", - # "group:admins@example.com", - # "domain:google.com", - # "serviceAccount:my-project-id@appspot.gserviceaccount.com" - # ] - # }, - # { - # "role": "roles/resourcemanager.organizationViewer", - # "members": [ - # "user:eve@example.com" - # ], - # "condition": { - # "title": "expirable access", - # "description": "Does not grant access after Sep 2020", - # "expression": "request.time < - # timestamp('2020-10-01T00:00:00.000Z')", - # } - # } - # ], - # "etag": "BwWWja0YfJA=", - # "version": 3 - # } - # ``` - # - # **YAML example:** - # - # ``` - # bindings: - # - members: - # - user:mike@example.com - # - group:admins@example.com - # - domain:google.com - # - serviceAccount:my-project-id@appspot.gserviceaccount.com - # role: roles/resourcemanager.organizationAdmin - # - members: - # - user:eve@example.com - # role: roles/resourcemanager.organizationViewer - # condition: - # title: expirable access - # description: Does not grant access after Sep 2020 - # expression: request.time < timestamp('2020-10-01T00:00:00.000Z') - # etag: BwWWja0YfJA= - # version: 3 - # ``` - # - # For a description of IAM and its features, see the - # [IAM documentation](https://cloud.google.com/iam/docs/). - # @!attribute [rw] version - # @return [::Integer] - # Specifies the format of the policy. - # - # Valid values are `0`, `1`, and `3`. Requests that specify an invalid value - # are rejected. - # - # Any operation that affects conditional role bindings must specify version - # `3`. This requirement applies to the following operations: - # - # * Getting a policy that includes a conditional role binding - # * Adding a conditional role binding to a policy - # * Changing a conditional role binding in a policy - # * Removing any role binding, with or without a condition, from a policy - # that includes conditions - # - # **Important:** If you use IAM Conditions, you must include the `etag` field - # whenever you call `setIamPolicy`. If you omit this field, then IAM allows - # you to overwrite a version `3` policy with a version `1` policy, and all of - # the conditions in the version `3` policy are lost. - # - # If a policy does not include any conditions, operations on that policy may - # specify any valid version or leave the field unset. - # - # To learn which resources support conditions in their IAM policies, see the - # [IAM - # documentation](https://cloud.google.com/iam/help/conditions/resource-policies). - # @!attribute [rw] bindings - # @return [::Array<::Google::Iam::V1::Binding>] - # Associates a list of `members`, or principals, with a `role`. Optionally, - # may specify a `condition` that determines how and when the `bindings` are - # applied. Each of the `bindings` must contain at least one principal. - # - # The `bindings` in a `Policy` can refer to up to 1,500 principals; up to 250 - # of these principals can be Google groups. Each occurrence of a principal - # counts towards these limits. For example, if the `bindings` grant 50 - # different roles to `user:alice@example.com`, and not to any other - # principal, then you can add another 1,450 principals to the `bindings` in - # the `Policy`. - # @!attribute [rw] audit_configs - # @return [::Array<::Google::Iam::V1::AuditConfig>] - # Specifies cloud audit logging configuration for this policy. - # @!attribute [rw] etag - # @return [::String] - # `etag` is used for optimistic concurrency control as a way to help - # prevent simultaneous updates of a policy from overwriting each other. - # It is strongly suggested that systems make use of the `etag` in the - # read-modify-write cycle to perform policy updates in order to avoid race - # conditions: An `etag` is returned in the response to `getIamPolicy`, and - # systems are expected to put that etag in the request to `setIamPolicy` to - # ensure that their change will be applied to the same version of the policy. - # - # **Important:** If you use IAM Conditions, you must include the `etag` field - # whenever you call `setIamPolicy`. If you omit this field, then IAM allows - # you to overwrite a version `3` policy with a version `1` policy, and all of - # the conditions in the version `3` policy are lost. - class Policy - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Associates `members`, or principals, with a `role`. - # @!attribute [rw] role - # @return [::String] - # Role that is assigned to the list of `members`, or principals. - # For example, `roles/viewer`, `roles/editor`, or `roles/owner`. - # @!attribute [rw] members - # @return [::Array<::String>] - # Specifies the principals requesting access for a Google Cloud resource. - # `members` can have the following values: - # - # * `allUsers`: A special identifier that represents anyone who is - # on the internet; with or without a Google account. - # - # * `allAuthenticatedUsers`: A special identifier that represents anyone - # who is authenticated with a Google account or a service account. - # - # * `user:{emailid}`: An email address that represents a specific Google - # account. For example, `alice@example.com` . - # - # - # * `serviceAccount:{emailid}`: An email address that represents a service - # account. For example, `my-other-app@appspot.gserviceaccount.com`. - # - # * `group:{emailid}`: An email address that represents a Google group. - # For example, `admins@example.com`. - # - # * `deleted:user:{emailid}?uid={uniqueid}`: An email address (plus unique - # identifier) representing a user that has been recently deleted. For - # example, `alice@example.com?uid=123456789012345678901`. If the user is - # recovered, this value reverts to `user:{emailid}` and the recovered user - # retains the role in the binding. - # - # * `deleted:serviceAccount:{emailid}?uid={uniqueid}`: An email address (plus - # unique identifier) representing a service account that has been recently - # deleted. For example, - # `my-other-app@appspot.gserviceaccount.com?uid=123456789012345678901`. - # If the service account is undeleted, this value reverts to - # `serviceAccount:{emailid}` and the undeleted service account retains the - # role in the binding. - # - # * `deleted:group:{emailid}?uid={uniqueid}`: An email address (plus unique - # identifier) representing a Google group that has been recently - # deleted. For example, `admins@example.com?uid=123456789012345678901`. If - # the group is recovered, this value reverts to `group:{emailid}` and the - # recovered group retains the role in the binding. - # - # - # * `domain:{domain}`: The G Suite domain (primary) that represents all the - # users of that domain. For example, `google.com` or `example.com`. - # @!attribute [rw] condition - # @return [::Google::Type::Expr] - # The condition that is associated with this binding. - # - # If the condition evaluates to `true`, then this binding applies to the - # current request. - # - # If the condition evaluates to `false`, then this binding does not apply to - # the current request. However, a different role binding might grant the same - # role to one or more of the principals in this binding. - # - # To learn which resources support conditions in their IAM policies, see the - # [IAM - # documentation](https://cloud.google.com/iam/help/conditions/resource-policies). - class Binding - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Specifies the audit configuration for a service. - # The configuration determines which permission types are logged, and what - # identities, if any, are exempted from logging. - # An AuditConfig must have one or more AuditLogConfigs. - # - # If there are AuditConfigs for both `allServices` and a specific service, - # the union of the two AuditConfigs is used for that service: the log_types - # specified in each AuditConfig are enabled, and the exempted_members in each - # AuditLogConfig are exempted. - # - # Example Policy with multiple AuditConfigs: - # - # { - # "audit_configs": [ - # { - # "service": "allServices", - # "audit_log_configs": [ - # { - # "log_type": "DATA_READ", - # "exempted_members": [ - # "user:jose@example.com" - # ] - # }, - # { - # "log_type": "DATA_WRITE" - # }, - # { - # "log_type": "ADMIN_READ" - # } - # ] - # }, - # { - # "service": "sampleservice.googleapis.com", - # "audit_log_configs": [ - # { - # "log_type": "DATA_READ" - # }, - # { - # "log_type": "DATA_WRITE", - # "exempted_members": [ - # "user:aliya@example.com" - # ] - # } - # ] - # } - # ] - # } - # - # For sampleservice, this policy enables DATA_READ, DATA_WRITE and ADMIN_READ - # logging. It also exempts `jose@example.com` from DATA_READ logging, and - # `aliya@example.com` from DATA_WRITE logging. - # @!attribute [rw] service - # @return [::String] - # Specifies a service that will be enabled for audit logging. - # For example, `storage.googleapis.com`, `cloudsql.googleapis.com`. - # `allServices` is a special value that covers all services. - # @!attribute [rw] audit_log_configs - # @return [::Array<::Google::Iam::V1::AuditLogConfig>] - # The configuration for logging of each type of permission. - class AuditConfig - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Provides the configuration for logging a type of permissions. - # Example: - # - # { - # "audit_log_configs": [ - # { - # "log_type": "DATA_READ", - # "exempted_members": [ - # "user:jose@example.com" - # ] - # }, - # { - # "log_type": "DATA_WRITE" - # } - # ] - # } - # - # This enables 'DATA_READ' and 'DATA_WRITE' logging, while exempting - # jose@example.com from DATA_READ logging. - # @!attribute [rw] log_type - # @return [::Google::Iam::V1::AuditLogConfig::LogType] - # The log type that this config enables. - # @!attribute [rw] exempted_members - # @return [::Array<::String>] - # Specifies the identities that do not cause logging for this type of - # permission. - # Follows the same format of - # [Binding.members][google.iam.v1.Binding.members]. - class AuditLogConfig - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - - # The list of valid permission types for which logging can be configured. - # Admin writes are always logged, and are not configurable. - module LogType - # Default case. Should never be this. - LOG_TYPE_UNSPECIFIED = 0 - - # Admin reads. Example: CloudIAM getIamPolicy - ADMIN_READ = 1 - - # Data writes. Example: CloudSQL Users create - DATA_WRITE = 2 - - # Data reads. Example: CloudSQL Users list - DATA_READ = 3 - end - end - - # The difference delta between two policies. - # @!attribute [rw] binding_deltas - # @return [::Array<::Google::Iam::V1::BindingDelta>] - # The delta for Bindings between two policies. - # @!attribute [rw] audit_config_deltas - # @return [::Array<::Google::Iam::V1::AuditConfigDelta>] - # The delta for AuditConfigs between two policies. - class PolicyDelta - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # One delta entry for Binding. Each individual change (only one member in each - # entry) to a binding will be a separate entry. - # @!attribute [rw] action - # @return [::Google::Iam::V1::BindingDelta::Action] - # The action that was performed on a Binding. - # Required - # @!attribute [rw] role - # @return [::String] - # Role that is assigned to `members`. - # For example, `roles/viewer`, `roles/editor`, or `roles/owner`. - # Required - # @!attribute [rw] member - # @return [::String] - # A single identity requesting access for a Google Cloud resource. - # Follows the same format of Binding.members. - # Required - # @!attribute [rw] condition - # @return [::Google::Type::Expr] - # The condition that is associated with this binding. - class BindingDelta - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - - # The type of action performed on a Binding in a policy. - module Action - # Unspecified. - ACTION_UNSPECIFIED = 0 - - # Addition of a Binding. - ADD = 1 - - # Removal of a Binding. - REMOVE = 2 - end - end - - # One delta entry for AuditConfig. Each individual change (only one - # exempted_member in each entry) to a AuditConfig will be a separate entry. - # @!attribute [rw] action - # @return [::Google::Iam::V1::AuditConfigDelta::Action] - # The action that was performed on an audit configuration in a policy. - # Required - # @!attribute [rw] service - # @return [::String] - # Specifies a service that was configured for Cloud Audit Logging. - # For example, `storage.googleapis.com`, `cloudsql.googleapis.com`. - # `allServices` is a special value that covers all services. - # Required - # @!attribute [rw] exempted_member - # @return [::String] - # A single identity that is exempted from "data access" audit - # logging for the `service` specified above. - # Follows the same format of Binding.members. - # @!attribute [rw] log_type - # @return [::String] - # Specifies the log_type that was be enabled. ADMIN_ACTIVITY is always - # enabled, and cannot be configured. - # Required - class AuditConfigDelta - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - - # The type of action performed on an audit configuration in a policy. - module Action - # Unspecified. - ACTION_UNSPECIFIED = 0 - - # Addition of an audit configuration. - ADD = 1 - - # Removal of an audit configuration. - REMOVE = 2 - end - end - end - end -end diff --git a/owl-bot-staging/google-cloud-secret_manager-v1beta1/proto_docs/google/protobuf/any.rb b/owl-bot-staging/google-cloud-secret_manager-v1beta1/proto_docs/google/protobuf/any.rb deleted file mode 100644 index 58691995f02e..000000000000 --- a/owl-bot-staging/google-cloud-secret_manager-v1beta1/proto_docs/google/protobuf/any.rb +++ /dev/null @@ -1,145 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - - -module Google - module Protobuf - # `Any` contains an arbitrary serialized protocol buffer message along with a - # URL that describes the type of the serialized message. - # - # Protobuf library provides support to pack/unpack Any values in the form - # of utility functions or additional generated methods of the Any type. - # - # Example 1: Pack and unpack a message in C++. - # - # Foo foo = ...; - # Any any; - # any.PackFrom(foo); - # ... - # if (any.UnpackTo(&foo)) { - # ... - # } - # - # Example 2: Pack and unpack a message in Java. - # - # Foo foo = ...; - # Any any = Any.pack(foo); - # ... - # if (any.is(Foo.class)) { - # foo = any.unpack(Foo.class); - # } - # // or ... - # if (any.isSameTypeAs(Foo.getDefaultInstance())) { - # foo = any.unpack(Foo.getDefaultInstance()); - # } - # - # Example 3: Pack and unpack a message in Python. - # - # foo = Foo(...) - # any = Any() - # any.Pack(foo) - # ... - # if any.Is(Foo.DESCRIPTOR): - # any.Unpack(foo) - # ... - # - # Example 4: Pack and unpack a message in Go - # - # foo := &pb.Foo{...} - # any, err := anypb.New(foo) - # if err != nil { - # ... - # } - # ... - # foo := &pb.Foo{} - # if err := any.UnmarshalTo(foo); err != nil { - # ... - # } - # - # The pack methods provided by protobuf library will by default use - # 'type.googleapis.com/full.type.name' as the type URL and the unpack - # methods only use the fully qualified type name after the last '/' - # in the type URL, for example "foo.bar.com/x/y.z" will yield type - # name "y.z". - # - # JSON - # ==== - # The JSON representation of an `Any` value uses the regular - # representation of the deserialized, embedded message, with an - # additional field `@type` which contains the type URL. Example: - # - # package google.profile; - # message Person { - # string first_name = 1; - # string last_name = 2; - # } - # - # { - # "@type": "type.googleapis.com/google.profile.Person", - # "firstName": , - # "lastName": - # } - # - # If the embedded message type is well-known and has a custom JSON - # representation, that representation will be embedded adding a field - # `value` which holds the custom JSON in addition to the `@type` - # field. Example (for message [google.protobuf.Duration][]): - # - # { - # "@type": "type.googleapis.com/google.protobuf.Duration", - # "value": "1.212s" - # } - # @!attribute [rw] type_url - # @return [::String] - # A URL/resource name that uniquely identifies the type of the serialized - # protocol buffer message. This string must contain at least - # one "/" character. The last segment of the URL's path must represent - # the fully qualified name of the type (as in - # `path/google.protobuf.Duration`). The name should be in a canonical form - # (e.g., leading "." is not accepted). - # - # In practice, teams usually precompile into the binary all types that they - # expect it to use in the context of Any. However, for URLs which use the - # scheme `http`, `https`, or no scheme, one can optionally set up a type - # server that maps type URLs to message definitions as follows: - # - # * If no scheme is provided, `https` is assumed. - # * An HTTP GET on the URL must yield a [google.protobuf.Type][] - # value in binary format, or produce an error. - # * Applications are allowed to cache lookup results based on the - # URL, or have them precompiled into a binary to avoid any - # lookup. Therefore, binary compatibility needs to be preserved - # on changes to types. (Use versioned type names to manage - # breaking changes.) - # - # Note: this functionality is not currently available in the official - # protobuf release, and it is not used for type URLs beginning with - # type.googleapis.com. As of May 2023, there are no widely used type server - # implementations and no plans to implement one. - # - # Schemes other than `http`, `https` (or the empty scheme) might be - # used with implementation specific semantics. - # @!attribute [rw] value - # @return [::String] - # Must be a valid serialized protocol buffer of the above specified type. - class Any - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - end -end diff --git a/owl-bot-staging/google-cloud-secret_manager-v1beta1/proto_docs/google/protobuf/duration.rb b/owl-bot-staging/google-cloud-secret_manager-v1beta1/proto_docs/google/protobuf/duration.rb deleted file mode 100644 index ea59f1f91daf..000000000000 --- a/owl-bot-staging/google-cloud-secret_manager-v1beta1/proto_docs/google/protobuf/duration.rb +++ /dev/null @@ -1,98 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - - -module Google - module Protobuf - # A Duration represents a signed, fixed-length span of time represented - # as a count of seconds and fractions of seconds at nanosecond - # resolution. It is independent of any calendar and concepts like "day" - # or "month". It is related to Timestamp in that the difference between - # two Timestamp values is a Duration and it can be added or subtracted - # from a Timestamp. Range is approximately +-10,000 years. - # - # # Examples - # - # Example 1: Compute Duration from two Timestamps in pseudo code. - # - # Timestamp start = ...; - # Timestamp end = ...; - # Duration duration = ...; - # - # duration.seconds = end.seconds - start.seconds; - # duration.nanos = end.nanos - start.nanos; - # - # if (duration.seconds < 0 && duration.nanos > 0) { - # duration.seconds += 1; - # duration.nanos -= 1000000000; - # } else if (duration.seconds > 0 && duration.nanos < 0) { - # duration.seconds -= 1; - # duration.nanos += 1000000000; - # } - # - # Example 2: Compute Timestamp from Timestamp + Duration in pseudo code. - # - # Timestamp start = ...; - # Duration duration = ...; - # Timestamp end = ...; - # - # end.seconds = start.seconds + duration.seconds; - # end.nanos = start.nanos + duration.nanos; - # - # if (end.nanos < 0) { - # end.seconds -= 1; - # end.nanos += 1000000000; - # } else if (end.nanos >= 1000000000) { - # end.seconds += 1; - # end.nanos -= 1000000000; - # } - # - # Example 3: Compute Duration from datetime.timedelta in Python. - # - # td = datetime.timedelta(days=3, minutes=10) - # duration = Duration() - # duration.FromTimedelta(td) - # - # # JSON Mapping - # - # In JSON format, the Duration type is encoded as a string rather than an - # object, where the string ends in the suffix "s" (indicating seconds) and - # is preceded by the number of seconds, with nanoseconds expressed as - # fractional seconds. For example, 3 seconds with 0 nanoseconds should be - # encoded in JSON format as "3s", while 3 seconds and 1 nanosecond should - # be expressed in JSON format as "3.000000001s", and 3 seconds and 1 - # microsecond should be expressed in JSON format as "3.000001s". - # @!attribute [rw] seconds - # @return [::Integer] - # Signed seconds of the span of time. Must be from -315,576,000,000 - # to +315,576,000,000 inclusive. Note: these bounds are computed from: - # 60 sec/min * 60 min/hr * 24 hr/day * 365.25 days/year * 10000 years - # @!attribute [rw] nanos - # @return [::Integer] - # Signed fractions of a second at nanosecond resolution of the span - # of time. Durations less than one second are represented with a 0 - # `seconds` field and a positive or negative `nanos` field. For durations - # of one second or more, a non-zero value for the `nanos` field must be - # of the same sign as the `seconds` field. Must be from -999,999,999 - # to +999,999,999 inclusive. - class Duration - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - end -end diff --git a/owl-bot-staging/google-cloud-secret_manager-v1beta1/proto_docs/google/protobuf/empty.rb b/owl-bot-staging/google-cloud-secret_manager-v1beta1/proto_docs/google/protobuf/empty.rb deleted file mode 100644 index 83e4481834a6..000000000000 --- a/owl-bot-staging/google-cloud-secret_manager-v1beta1/proto_docs/google/protobuf/empty.rb +++ /dev/null @@ -1,34 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - - -module Google - module Protobuf - # A generic empty message that you can re-use to avoid defining duplicated - # empty messages in your APIs. A typical example is to use it as the request - # or the response type of an API method. For instance: - # - # service Foo { - # rpc Bar(google.protobuf.Empty) returns (google.protobuf.Empty); - # } - class Empty - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - end -end diff --git a/owl-bot-staging/google-cloud-secret_manager-v1beta1/proto_docs/google/protobuf/field_mask.rb b/owl-bot-staging/google-cloud-secret_manager-v1beta1/proto_docs/google/protobuf/field_mask.rb deleted file mode 100644 index 7f3ffc78601a..000000000000 --- a/owl-bot-staging/google-cloud-secret_manager-v1beta1/proto_docs/google/protobuf/field_mask.rb +++ /dev/null @@ -1,229 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - - -module Google - module Protobuf - # `FieldMask` represents a set of symbolic field paths, for example: - # - # paths: "f.a" - # paths: "f.b.d" - # - # Here `f` represents a field in some root message, `a` and `b` - # fields in the message found in `f`, and `d` a field found in the - # message in `f.b`. - # - # Field masks are used to specify a subset of fields that should be - # returned by a get operation or modified by an update operation. - # Field masks also have a custom JSON encoding (see below). - # - # # Field Masks in Projections - # - # When used in the context of a projection, a response message or - # sub-message is filtered by the API to only contain those fields as - # specified in the mask. For example, if the mask in the previous - # example is applied to a response message as follows: - # - # f { - # a : 22 - # b { - # d : 1 - # x : 2 - # } - # y : 13 - # } - # z: 8 - # - # The result will not contain specific values for fields x,y and z - # (their value will be set to the default, and omitted in proto text - # output): - # - # - # f { - # a : 22 - # b { - # d : 1 - # } - # } - # - # A repeated field is not allowed except at the last position of a - # paths string. - # - # If a FieldMask object is not present in a get operation, the - # operation applies to all fields (as if a FieldMask of all fields - # had been specified). - # - # Note that a field mask does not necessarily apply to the - # top-level response message. In case of a REST get operation, the - # field mask applies directly to the response, but in case of a REST - # list operation, the mask instead applies to each individual message - # in the returned resource list. In case of a REST custom method, - # other definitions may be used. Where the mask applies will be - # clearly documented together with its declaration in the API. In - # any case, the effect on the returned resource/resources is required - # behavior for APIs. - # - # # Field Masks in Update Operations - # - # A field mask in update operations specifies which fields of the - # targeted resource are going to be updated. The API is required - # to only change the values of the fields as specified in the mask - # and leave the others untouched. If a resource is passed in to - # describe the updated values, the API ignores the values of all - # fields not covered by the mask. - # - # If a repeated field is specified for an update operation, new values will - # be appended to the existing repeated field in the target resource. Note that - # a repeated field is only allowed in the last position of a `paths` string. - # - # If a sub-message is specified in the last position of the field mask for an - # update operation, then new value will be merged into the existing sub-message - # in the target resource. - # - # For example, given the target message: - # - # f { - # b { - # d: 1 - # x: 2 - # } - # c: [1] - # } - # - # And an update message: - # - # f { - # b { - # d: 10 - # } - # c: [2] - # } - # - # then if the field mask is: - # - # paths: ["f.b", "f.c"] - # - # then the result will be: - # - # f { - # b { - # d: 10 - # x: 2 - # } - # c: [1, 2] - # } - # - # An implementation may provide options to override this default behavior for - # repeated and message fields. - # - # In order to reset a field's value to the default, the field must - # be in the mask and set to the default value in the provided resource. - # Hence, in order to reset all fields of a resource, provide a default - # instance of the resource and set all fields in the mask, or do - # not provide a mask as described below. - # - # If a field mask is not present on update, the operation applies to - # all fields (as if a field mask of all fields has been specified). - # Note that in the presence of schema evolution, this may mean that - # fields the client does not know and has therefore not filled into - # the request will be reset to their default. If this is unwanted - # behavior, a specific service may require a client to always specify - # a field mask, producing an error if not. - # - # As with get operations, the location of the resource which - # describes the updated values in the request message depends on the - # operation kind. In any case, the effect of the field mask is - # required to be honored by the API. - # - # ## Considerations for HTTP REST - # - # The HTTP kind of an update operation which uses a field mask must - # be set to PATCH instead of PUT in order to satisfy HTTP semantics - # (PUT must only be used for full updates). - # - # # JSON Encoding of Field Masks - # - # In JSON, a field mask is encoded as a single string where paths are - # separated by a comma. Fields name in each path are converted - # to/from lower-camel naming conventions. - # - # As an example, consider the following message declarations: - # - # message Profile { - # User user = 1; - # Photo photo = 2; - # } - # message User { - # string display_name = 1; - # string address = 2; - # } - # - # In proto a field mask for `Profile` may look as such: - # - # mask { - # paths: "user.display_name" - # paths: "photo" - # } - # - # In JSON, the same mask is represented as below: - # - # { - # mask: "user.displayName,photo" - # } - # - # # Field Masks and Oneof Fields - # - # Field masks treat fields in oneofs just as regular fields. Consider the - # following message: - # - # message SampleMessage { - # oneof test_oneof { - # string name = 4; - # SubMessage sub_message = 9; - # } - # } - # - # The field mask can be: - # - # mask { - # paths: "name" - # } - # - # Or: - # - # mask { - # paths: "sub_message" - # } - # - # Note that oneof type names ("test_oneof" in this case) cannot be used in - # paths. - # - # ## Field Mask Verification - # - # The implementation of any API method which has a FieldMask type field in the - # request should verify the included field paths, and return an - # `INVALID_ARGUMENT` error if any path is unmappable. - # @!attribute [rw] paths - # @return [::Array<::String>] - # The set of field mask paths. - class FieldMask - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - end -end diff --git a/owl-bot-staging/google-cloud-secret_manager-v1beta1/proto_docs/google/protobuf/timestamp.rb b/owl-bot-staging/google-cloud-secret_manager-v1beta1/proto_docs/google/protobuf/timestamp.rb deleted file mode 100644 index 74352be9c58c..000000000000 --- a/owl-bot-staging/google-cloud-secret_manager-v1beta1/proto_docs/google/protobuf/timestamp.rb +++ /dev/null @@ -1,127 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - - -module Google - module Protobuf - # A Timestamp represents a point in time independent of any time zone or local - # calendar, encoded as a count of seconds and fractions of seconds at - # nanosecond resolution. The count is relative to an epoch at UTC midnight on - # January 1, 1970, in the proleptic Gregorian calendar which extends the - # Gregorian calendar backwards to year one. - # - # All minutes are 60 seconds long. Leap seconds are "smeared" so that no leap - # second table is needed for interpretation, using a [24-hour linear - # smear](https://developers.google.com/time/smear). - # - # The range is from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59.999999999Z. By - # restricting to that range, we ensure that we can convert to and from [RFC - # 3339](https://www.ietf.org/rfc/rfc3339.txt) date strings. - # - # # Examples - # - # Example 1: Compute Timestamp from POSIX `time()`. - # - # Timestamp timestamp; - # timestamp.set_seconds(time(NULL)); - # timestamp.set_nanos(0); - # - # Example 2: Compute Timestamp from POSIX `gettimeofday()`. - # - # struct timeval tv; - # gettimeofday(&tv, NULL); - # - # Timestamp timestamp; - # timestamp.set_seconds(tv.tv_sec); - # timestamp.set_nanos(tv.tv_usec * 1000); - # - # Example 3: Compute Timestamp from Win32 `GetSystemTimeAsFileTime()`. - # - # FILETIME ft; - # GetSystemTimeAsFileTime(&ft); - # UINT64 ticks = (((UINT64)ft.dwHighDateTime) << 32) | ft.dwLowDateTime; - # - # // A Windows tick is 100 nanoseconds. Windows epoch 1601-01-01T00:00:00Z - # // is 11644473600 seconds before Unix epoch 1970-01-01T00:00:00Z. - # Timestamp timestamp; - # timestamp.set_seconds((INT64) ((ticks / 10000000) - 11644473600LL)); - # timestamp.set_nanos((INT32) ((ticks % 10000000) * 100)); - # - # Example 4: Compute Timestamp from Java `System.currentTimeMillis()`. - # - # long millis = System.currentTimeMillis(); - # - # Timestamp timestamp = Timestamp.newBuilder().setSeconds(millis / 1000) - # .setNanos((int) ((millis % 1000) * 1000000)).build(); - # - # Example 5: Compute Timestamp from Java `Instant.now()`. - # - # Instant now = Instant.now(); - # - # Timestamp timestamp = - # Timestamp.newBuilder().setSeconds(now.getEpochSecond()) - # .setNanos(now.getNano()).build(); - # - # Example 6: Compute Timestamp from current time in Python. - # - # timestamp = Timestamp() - # timestamp.GetCurrentTime() - # - # # JSON Mapping - # - # In JSON format, the Timestamp type is encoded as a string in the - # [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format. That is, the - # format is "\\{year}-\\{month}-\\{day}T\\{hour}:\\{min}:\\{sec}[.\\{frac_sec}]Z" - # where \\{year} is always expressed using four digits while \\{month}, \\{day}, - # \\{hour}, \\{min}, and \\{sec} are zero-padded to two digits each. The fractional - # seconds, which can go up to 9 digits (i.e. up to 1 nanosecond resolution), - # are optional. The "Z" suffix indicates the timezone ("UTC"); the timezone - # is required. A proto3 JSON serializer should always use UTC (as indicated by - # "Z") when printing the Timestamp type and a proto3 JSON parser should be - # able to accept both UTC and other timezones (as indicated by an offset). - # - # For example, "2017-01-15T01:30:15.01Z" encodes 15.01 seconds past - # 01:30 UTC on January 15, 2017. - # - # In JavaScript, one can convert a Date object to this format using the - # standard - # [toISOString()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toISOString) - # method. In Python, a standard `datetime.datetime` object can be converted - # to this format using - # [`strftime`](https://docs.python.org/2/library/time.html#time.strftime) with - # the time format spec '%Y-%m-%dT%H:%M:%S.%fZ'. Likewise, in Java, one can use - # the Joda Time's [`ISODateTimeFormat.dateTime()`]( - # http://joda-time.sourceforge.net/apidocs/org/joda/time/format/ISODateTimeFormat.html#dateTime() - # ) to obtain a formatter capable of generating timestamps in this format. - # @!attribute [rw] seconds - # @return [::Integer] - # Represents seconds of UTC time since Unix epoch - # 1970-01-01T00:00:00Z. Must be from 0001-01-01T00:00:00Z to - # 9999-12-31T23:59:59Z inclusive. - # @!attribute [rw] nanos - # @return [::Integer] - # Non-negative fractions of a second at nanosecond resolution. Negative - # second values with fractions must still have non-negative nanos values - # that count forward in time. Must be from 0 to 999,999,999 - # inclusive. - class Timestamp - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - end -end diff --git a/owl-bot-staging/google-cloud-secret_manager-v1beta1/proto_docs/google/type/expr.rb b/owl-bot-staging/google-cloud-secret_manager-v1beta1/proto_docs/google/type/expr.rb deleted file mode 100644 index 53e7733b6592..000000000000 --- a/owl-bot-staging/google-cloud-secret_manager-v1beta1/proto_docs/google/type/expr.rb +++ /dev/null @@ -1,75 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - - -module Google - module Type - # Represents a textual expression in the Common Expression Language (CEL) - # syntax. CEL is a C-like expression language. The syntax and semantics of CEL - # are documented at https://github.com/google/cel-spec. - # - # Example (Comparison): - # - # title: "Summary size limit" - # description: "Determines if a summary is less than 100 chars" - # expression: "document.summary.size() < 100" - # - # Example (Equality): - # - # title: "Requestor is owner" - # description: "Determines if requestor is the document owner" - # expression: "document.owner == request.auth.claims.email" - # - # Example (Logic): - # - # title: "Public documents" - # description: "Determine whether the document should be publicly visible" - # expression: "document.type != 'private' && document.type != 'internal'" - # - # Example (Data Manipulation): - # - # title: "Notification string" - # description: "Create a notification string with a timestamp." - # expression: "'New message received at ' + string(document.create_time)" - # - # The exact variables and functions that may be referenced within an expression - # are determined by the service that evaluates it. See the service - # documentation for additional information. - # @!attribute [rw] expression - # @return [::String] - # Textual representation of an expression in Common Expression Language - # syntax. - # @!attribute [rw] title - # @return [::String] - # Optional. Title for the expression, i.e. a short string describing - # its purpose. This can be used e.g. in UIs which allow to enter the - # expression. - # @!attribute [rw] description - # @return [::String] - # Optional. Description of the expression. This is a longer text which - # describes the expression, e.g. when hovered over it in a UI. - # @!attribute [rw] location - # @return [::String] - # Optional. String indicating the location of the expression for error - # reporting, e.g. a file name and a position in the file. - class Expr - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - end -end diff --git a/owl-bot-staging/google-cloud-secret_manager-v1beta1/snippets/Gemfile b/owl-bot-staging/google-cloud-secret_manager-v1beta1/snippets/Gemfile deleted file mode 100644 index 7d0b3f462848..000000000000 --- a/owl-bot-staging/google-cloud-secret_manager-v1beta1/snippets/Gemfile +++ /dev/null @@ -1,32 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -source "https://rubygems.org" - -if ENV["GOOGLE_CLOUD_SAMPLES_TEST"] == "master" - gem "google-cloud-secret_manager-v1beta1", path: "../" -else - gem "google-cloud-secret_manager-v1beta1" -end - -group :test do - gem "google-style", "~> 1.26.1" - gem "minitest", "~> 5.16" - gem "minitest-focus", "~> 1.1" - gem "minitest-hooks", "~> 1.5" -end diff --git a/owl-bot-staging/google-cloud-secret_manager-v1beta1/snippets/secret_manager_service/access_secret_version.rb b/owl-bot-staging/google-cloud-secret_manager-v1beta1/snippets/secret_manager_service/access_secret_version.rb deleted file mode 100644 index ac6df7b6e662..000000000000 --- a/owl-bot-staging/google-cloud-secret_manager-v1beta1/snippets/secret_manager_service/access_secret_version.rb +++ /dev/null @@ -1,47 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -# [START secretmanager_v1beta1_generated_SecretManagerService_AccessSecretVersion_sync] -require "google/cloud/secret_manager/v1beta1" - -## -# Snippet for the access_secret_version call in the SecretManagerService service -# -# This snippet has been automatically generated and should be regarded as a code -# template only. It will require modifications to work: -# - It may require correct/in-range values for request initialization. -# - It may require specifying regional endpoints when creating the service -# client as shown in https://cloud.google.com/ruby/docs/reference. -# -# This is an auto-generated example demonstrating basic usage of -# Google::Cloud::SecretManager::V1beta1::SecretManagerService::Client#access_secret_version. -# -def access_secret_version - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::SecretManager::V1beta1::SecretManagerService::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::SecretManager::V1beta1::AccessSecretVersionRequest.new - - # Call the access_secret_version method. - result = client.access_secret_version request - - # The returned object is of type Google::Cloud::SecretManager::V1beta1::AccessSecretVersionResponse. - p result -end -# [END secretmanager_v1beta1_generated_SecretManagerService_AccessSecretVersion_sync] diff --git a/owl-bot-staging/google-cloud-secret_manager-v1beta1/snippets/secret_manager_service/add_secret_version.rb b/owl-bot-staging/google-cloud-secret_manager-v1beta1/snippets/secret_manager_service/add_secret_version.rb deleted file mode 100644 index 2a913b556c14..000000000000 --- a/owl-bot-staging/google-cloud-secret_manager-v1beta1/snippets/secret_manager_service/add_secret_version.rb +++ /dev/null @@ -1,47 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -# [START secretmanager_v1beta1_generated_SecretManagerService_AddSecretVersion_sync] -require "google/cloud/secret_manager/v1beta1" - -## -# Snippet for the add_secret_version call in the SecretManagerService service -# -# This snippet has been automatically generated and should be regarded as a code -# template only. It will require modifications to work: -# - It may require correct/in-range values for request initialization. -# - It may require specifying regional endpoints when creating the service -# client as shown in https://cloud.google.com/ruby/docs/reference. -# -# This is an auto-generated example demonstrating basic usage of -# Google::Cloud::SecretManager::V1beta1::SecretManagerService::Client#add_secret_version. -# -def add_secret_version - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::SecretManager::V1beta1::SecretManagerService::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::SecretManager::V1beta1::AddSecretVersionRequest.new - - # Call the add_secret_version method. - result = client.add_secret_version request - - # The returned object is of type Google::Cloud::SecretManager::V1beta1::SecretVersion. - p result -end -# [END secretmanager_v1beta1_generated_SecretManagerService_AddSecretVersion_sync] diff --git a/owl-bot-staging/google-cloud-secret_manager-v1beta1/snippets/secret_manager_service/create_secret.rb b/owl-bot-staging/google-cloud-secret_manager-v1beta1/snippets/secret_manager_service/create_secret.rb deleted file mode 100644 index b0fd1bcbba4a..000000000000 --- a/owl-bot-staging/google-cloud-secret_manager-v1beta1/snippets/secret_manager_service/create_secret.rb +++ /dev/null @@ -1,47 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -# [START secretmanager_v1beta1_generated_SecretManagerService_CreateSecret_sync] -require "google/cloud/secret_manager/v1beta1" - -## -# Snippet for the create_secret call in the SecretManagerService service -# -# This snippet has been automatically generated and should be regarded as a code -# template only. It will require modifications to work: -# - It may require correct/in-range values for request initialization. -# - It may require specifying regional endpoints when creating the service -# client as shown in https://cloud.google.com/ruby/docs/reference. -# -# This is an auto-generated example demonstrating basic usage of -# Google::Cloud::SecretManager::V1beta1::SecretManagerService::Client#create_secret. -# -def create_secret - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::SecretManager::V1beta1::SecretManagerService::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::SecretManager::V1beta1::CreateSecretRequest.new - - # Call the create_secret method. - result = client.create_secret request - - # The returned object is of type Google::Cloud::SecretManager::V1beta1::Secret. - p result -end -# [END secretmanager_v1beta1_generated_SecretManagerService_CreateSecret_sync] diff --git a/owl-bot-staging/google-cloud-secret_manager-v1beta1/snippets/secret_manager_service/delete_secret.rb b/owl-bot-staging/google-cloud-secret_manager-v1beta1/snippets/secret_manager_service/delete_secret.rb deleted file mode 100644 index 7148292e6d60..000000000000 --- a/owl-bot-staging/google-cloud-secret_manager-v1beta1/snippets/secret_manager_service/delete_secret.rb +++ /dev/null @@ -1,47 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -# [START secretmanager_v1beta1_generated_SecretManagerService_DeleteSecret_sync] -require "google/cloud/secret_manager/v1beta1" - -## -# Snippet for the delete_secret call in the SecretManagerService service -# -# This snippet has been automatically generated and should be regarded as a code -# template only. It will require modifications to work: -# - It may require correct/in-range values for request initialization. -# - It may require specifying regional endpoints when creating the service -# client as shown in https://cloud.google.com/ruby/docs/reference. -# -# This is an auto-generated example demonstrating basic usage of -# Google::Cloud::SecretManager::V1beta1::SecretManagerService::Client#delete_secret. -# -def delete_secret - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::SecretManager::V1beta1::SecretManagerService::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::SecretManager::V1beta1::DeleteSecretRequest.new - - # Call the delete_secret method. - result = client.delete_secret request - - # The returned object is of type Google::Protobuf::Empty. - p result -end -# [END secretmanager_v1beta1_generated_SecretManagerService_DeleteSecret_sync] diff --git a/owl-bot-staging/google-cloud-secret_manager-v1beta1/snippets/secret_manager_service/destroy_secret_version.rb b/owl-bot-staging/google-cloud-secret_manager-v1beta1/snippets/secret_manager_service/destroy_secret_version.rb deleted file mode 100644 index a2ce12dcbae7..000000000000 --- a/owl-bot-staging/google-cloud-secret_manager-v1beta1/snippets/secret_manager_service/destroy_secret_version.rb +++ /dev/null @@ -1,47 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -# [START secretmanager_v1beta1_generated_SecretManagerService_DestroySecretVersion_sync] -require "google/cloud/secret_manager/v1beta1" - -## -# Snippet for the destroy_secret_version call in the SecretManagerService service -# -# This snippet has been automatically generated and should be regarded as a code -# template only. It will require modifications to work: -# - It may require correct/in-range values for request initialization. -# - It may require specifying regional endpoints when creating the service -# client as shown in https://cloud.google.com/ruby/docs/reference. -# -# This is an auto-generated example demonstrating basic usage of -# Google::Cloud::SecretManager::V1beta1::SecretManagerService::Client#destroy_secret_version. -# -def destroy_secret_version - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::SecretManager::V1beta1::SecretManagerService::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::SecretManager::V1beta1::DestroySecretVersionRequest.new - - # Call the destroy_secret_version method. - result = client.destroy_secret_version request - - # The returned object is of type Google::Cloud::SecretManager::V1beta1::SecretVersion. - p result -end -# [END secretmanager_v1beta1_generated_SecretManagerService_DestroySecretVersion_sync] diff --git a/owl-bot-staging/google-cloud-secret_manager-v1beta1/snippets/secret_manager_service/disable_secret_version.rb b/owl-bot-staging/google-cloud-secret_manager-v1beta1/snippets/secret_manager_service/disable_secret_version.rb deleted file mode 100644 index c578b0471ea7..000000000000 --- a/owl-bot-staging/google-cloud-secret_manager-v1beta1/snippets/secret_manager_service/disable_secret_version.rb +++ /dev/null @@ -1,47 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -# [START secretmanager_v1beta1_generated_SecretManagerService_DisableSecretVersion_sync] -require "google/cloud/secret_manager/v1beta1" - -## -# Snippet for the disable_secret_version call in the SecretManagerService service -# -# This snippet has been automatically generated and should be regarded as a code -# template only. It will require modifications to work: -# - It may require correct/in-range values for request initialization. -# - It may require specifying regional endpoints when creating the service -# client as shown in https://cloud.google.com/ruby/docs/reference. -# -# This is an auto-generated example demonstrating basic usage of -# Google::Cloud::SecretManager::V1beta1::SecretManagerService::Client#disable_secret_version. -# -def disable_secret_version - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::SecretManager::V1beta1::SecretManagerService::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::SecretManager::V1beta1::DisableSecretVersionRequest.new - - # Call the disable_secret_version method. - result = client.disable_secret_version request - - # The returned object is of type Google::Cloud::SecretManager::V1beta1::SecretVersion. - p result -end -# [END secretmanager_v1beta1_generated_SecretManagerService_DisableSecretVersion_sync] diff --git a/owl-bot-staging/google-cloud-secret_manager-v1beta1/snippets/secret_manager_service/enable_secret_version.rb b/owl-bot-staging/google-cloud-secret_manager-v1beta1/snippets/secret_manager_service/enable_secret_version.rb deleted file mode 100644 index 728070e800a2..000000000000 --- a/owl-bot-staging/google-cloud-secret_manager-v1beta1/snippets/secret_manager_service/enable_secret_version.rb +++ /dev/null @@ -1,47 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -# [START secretmanager_v1beta1_generated_SecretManagerService_EnableSecretVersion_sync] -require "google/cloud/secret_manager/v1beta1" - -## -# Snippet for the enable_secret_version call in the SecretManagerService service -# -# This snippet has been automatically generated and should be regarded as a code -# template only. It will require modifications to work: -# - It may require correct/in-range values for request initialization. -# - It may require specifying regional endpoints when creating the service -# client as shown in https://cloud.google.com/ruby/docs/reference. -# -# This is an auto-generated example demonstrating basic usage of -# Google::Cloud::SecretManager::V1beta1::SecretManagerService::Client#enable_secret_version. -# -def enable_secret_version - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::SecretManager::V1beta1::SecretManagerService::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::SecretManager::V1beta1::EnableSecretVersionRequest.new - - # Call the enable_secret_version method. - result = client.enable_secret_version request - - # The returned object is of type Google::Cloud::SecretManager::V1beta1::SecretVersion. - p result -end -# [END secretmanager_v1beta1_generated_SecretManagerService_EnableSecretVersion_sync] diff --git a/owl-bot-staging/google-cloud-secret_manager-v1beta1/snippets/secret_manager_service/get_iam_policy.rb b/owl-bot-staging/google-cloud-secret_manager-v1beta1/snippets/secret_manager_service/get_iam_policy.rb deleted file mode 100644 index 2fcae7265e71..000000000000 --- a/owl-bot-staging/google-cloud-secret_manager-v1beta1/snippets/secret_manager_service/get_iam_policy.rb +++ /dev/null @@ -1,47 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -# [START secretmanager_v1beta1_generated_SecretManagerService_GetIamPolicy_sync] -require "google/cloud/secret_manager/v1beta1" - -## -# Snippet for the get_iam_policy call in the SecretManagerService service -# -# This snippet has been automatically generated and should be regarded as a code -# template only. It will require modifications to work: -# - It may require correct/in-range values for request initialization. -# - It may require specifying regional endpoints when creating the service -# client as shown in https://cloud.google.com/ruby/docs/reference. -# -# This is an auto-generated example demonstrating basic usage of -# Google::Cloud::SecretManager::V1beta1::SecretManagerService::Client#get_iam_policy. -# -def get_iam_policy - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::SecretManager::V1beta1::SecretManagerService::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Iam::V1::GetIamPolicyRequest.new - - # Call the get_iam_policy method. - result = client.get_iam_policy request - - # The returned object is of type Google::Iam::V1::Policy. - p result -end -# [END secretmanager_v1beta1_generated_SecretManagerService_GetIamPolicy_sync] diff --git a/owl-bot-staging/google-cloud-secret_manager-v1beta1/snippets/secret_manager_service/get_secret.rb b/owl-bot-staging/google-cloud-secret_manager-v1beta1/snippets/secret_manager_service/get_secret.rb deleted file mode 100644 index 75619ce72ae8..000000000000 --- a/owl-bot-staging/google-cloud-secret_manager-v1beta1/snippets/secret_manager_service/get_secret.rb +++ /dev/null @@ -1,47 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -# [START secretmanager_v1beta1_generated_SecretManagerService_GetSecret_sync] -require "google/cloud/secret_manager/v1beta1" - -## -# Snippet for the get_secret call in the SecretManagerService service -# -# This snippet has been automatically generated and should be regarded as a code -# template only. It will require modifications to work: -# - It may require correct/in-range values for request initialization. -# - It may require specifying regional endpoints when creating the service -# client as shown in https://cloud.google.com/ruby/docs/reference. -# -# This is an auto-generated example demonstrating basic usage of -# Google::Cloud::SecretManager::V1beta1::SecretManagerService::Client#get_secret. -# -def get_secret - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::SecretManager::V1beta1::SecretManagerService::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::SecretManager::V1beta1::GetSecretRequest.new - - # Call the get_secret method. - result = client.get_secret request - - # The returned object is of type Google::Cloud::SecretManager::V1beta1::Secret. - p result -end -# [END secretmanager_v1beta1_generated_SecretManagerService_GetSecret_sync] diff --git a/owl-bot-staging/google-cloud-secret_manager-v1beta1/snippets/secret_manager_service/get_secret_version.rb b/owl-bot-staging/google-cloud-secret_manager-v1beta1/snippets/secret_manager_service/get_secret_version.rb deleted file mode 100644 index 5c6734cf2a67..000000000000 --- a/owl-bot-staging/google-cloud-secret_manager-v1beta1/snippets/secret_manager_service/get_secret_version.rb +++ /dev/null @@ -1,47 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -# [START secretmanager_v1beta1_generated_SecretManagerService_GetSecretVersion_sync] -require "google/cloud/secret_manager/v1beta1" - -## -# Snippet for the get_secret_version call in the SecretManagerService service -# -# This snippet has been automatically generated and should be regarded as a code -# template only. It will require modifications to work: -# - It may require correct/in-range values for request initialization. -# - It may require specifying regional endpoints when creating the service -# client as shown in https://cloud.google.com/ruby/docs/reference. -# -# This is an auto-generated example demonstrating basic usage of -# Google::Cloud::SecretManager::V1beta1::SecretManagerService::Client#get_secret_version. -# -def get_secret_version - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::SecretManager::V1beta1::SecretManagerService::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::SecretManager::V1beta1::GetSecretVersionRequest.new - - # Call the get_secret_version method. - result = client.get_secret_version request - - # The returned object is of type Google::Cloud::SecretManager::V1beta1::SecretVersion. - p result -end -# [END secretmanager_v1beta1_generated_SecretManagerService_GetSecretVersion_sync] diff --git a/owl-bot-staging/google-cloud-secret_manager-v1beta1/snippets/secret_manager_service/list_secret_versions.rb b/owl-bot-staging/google-cloud-secret_manager-v1beta1/snippets/secret_manager_service/list_secret_versions.rb deleted file mode 100644 index 3beb998ea346..000000000000 --- a/owl-bot-staging/google-cloud-secret_manager-v1beta1/snippets/secret_manager_service/list_secret_versions.rb +++ /dev/null @@ -1,51 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -# [START secretmanager_v1beta1_generated_SecretManagerService_ListSecretVersions_sync] -require "google/cloud/secret_manager/v1beta1" - -## -# Snippet for the list_secret_versions call in the SecretManagerService service -# -# This snippet has been automatically generated and should be regarded as a code -# template only. It will require modifications to work: -# - It may require correct/in-range values for request initialization. -# - It may require specifying regional endpoints when creating the service -# client as shown in https://cloud.google.com/ruby/docs/reference. -# -# This is an auto-generated example demonstrating basic usage of -# Google::Cloud::SecretManager::V1beta1::SecretManagerService::Client#list_secret_versions. -# -def list_secret_versions - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::SecretManager::V1beta1::SecretManagerService::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::SecretManager::V1beta1::ListSecretVersionsRequest.new - - # Call the list_secret_versions method. - result = client.list_secret_versions request - - # The returned object is of type Gapic::PagedEnumerable. You can iterate - # over elements, and API calls will be issued to fetch pages as needed. - result.each do |item| - # Each element is of type ::Google::Cloud::SecretManager::V1beta1::SecretVersion. - p item - end -end -# [END secretmanager_v1beta1_generated_SecretManagerService_ListSecretVersions_sync] diff --git a/owl-bot-staging/google-cloud-secret_manager-v1beta1/snippets/secret_manager_service/list_secrets.rb b/owl-bot-staging/google-cloud-secret_manager-v1beta1/snippets/secret_manager_service/list_secrets.rb deleted file mode 100644 index d29981383e36..000000000000 --- a/owl-bot-staging/google-cloud-secret_manager-v1beta1/snippets/secret_manager_service/list_secrets.rb +++ /dev/null @@ -1,51 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -# [START secretmanager_v1beta1_generated_SecretManagerService_ListSecrets_sync] -require "google/cloud/secret_manager/v1beta1" - -## -# Snippet for the list_secrets call in the SecretManagerService service -# -# This snippet has been automatically generated and should be regarded as a code -# template only. It will require modifications to work: -# - It may require correct/in-range values for request initialization. -# - It may require specifying regional endpoints when creating the service -# client as shown in https://cloud.google.com/ruby/docs/reference. -# -# This is an auto-generated example demonstrating basic usage of -# Google::Cloud::SecretManager::V1beta1::SecretManagerService::Client#list_secrets. -# -def list_secrets - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::SecretManager::V1beta1::SecretManagerService::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::SecretManager::V1beta1::ListSecretsRequest.new - - # Call the list_secrets method. - result = client.list_secrets request - - # The returned object is of type Gapic::PagedEnumerable. You can iterate - # over elements, and API calls will be issued to fetch pages as needed. - result.each do |item| - # Each element is of type ::Google::Cloud::SecretManager::V1beta1::Secret. - p item - end -end -# [END secretmanager_v1beta1_generated_SecretManagerService_ListSecrets_sync] diff --git a/owl-bot-staging/google-cloud-secret_manager-v1beta1/snippets/secret_manager_service/set_iam_policy.rb b/owl-bot-staging/google-cloud-secret_manager-v1beta1/snippets/secret_manager_service/set_iam_policy.rb deleted file mode 100644 index 0d96d5ef3a67..000000000000 --- a/owl-bot-staging/google-cloud-secret_manager-v1beta1/snippets/secret_manager_service/set_iam_policy.rb +++ /dev/null @@ -1,47 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -# [START secretmanager_v1beta1_generated_SecretManagerService_SetIamPolicy_sync] -require "google/cloud/secret_manager/v1beta1" - -## -# Snippet for the set_iam_policy call in the SecretManagerService service -# -# This snippet has been automatically generated and should be regarded as a code -# template only. It will require modifications to work: -# - It may require correct/in-range values for request initialization. -# - It may require specifying regional endpoints when creating the service -# client as shown in https://cloud.google.com/ruby/docs/reference. -# -# This is an auto-generated example demonstrating basic usage of -# Google::Cloud::SecretManager::V1beta1::SecretManagerService::Client#set_iam_policy. -# -def set_iam_policy - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::SecretManager::V1beta1::SecretManagerService::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Iam::V1::SetIamPolicyRequest.new - - # Call the set_iam_policy method. - result = client.set_iam_policy request - - # The returned object is of type Google::Iam::V1::Policy. - p result -end -# [END secretmanager_v1beta1_generated_SecretManagerService_SetIamPolicy_sync] diff --git a/owl-bot-staging/google-cloud-secret_manager-v1beta1/snippets/secret_manager_service/test_iam_permissions.rb b/owl-bot-staging/google-cloud-secret_manager-v1beta1/snippets/secret_manager_service/test_iam_permissions.rb deleted file mode 100644 index 855968413f63..000000000000 --- a/owl-bot-staging/google-cloud-secret_manager-v1beta1/snippets/secret_manager_service/test_iam_permissions.rb +++ /dev/null @@ -1,47 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -# [START secretmanager_v1beta1_generated_SecretManagerService_TestIamPermissions_sync] -require "google/cloud/secret_manager/v1beta1" - -## -# Snippet for the test_iam_permissions call in the SecretManagerService service -# -# This snippet has been automatically generated and should be regarded as a code -# template only. It will require modifications to work: -# - It may require correct/in-range values for request initialization. -# - It may require specifying regional endpoints when creating the service -# client as shown in https://cloud.google.com/ruby/docs/reference. -# -# This is an auto-generated example demonstrating basic usage of -# Google::Cloud::SecretManager::V1beta1::SecretManagerService::Client#test_iam_permissions. -# -def test_iam_permissions - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::SecretManager::V1beta1::SecretManagerService::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Iam::V1::TestIamPermissionsRequest.new - - # Call the test_iam_permissions method. - result = client.test_iam_permissions request - - # The returned object is of type Google::Iam::V1::TestIamPermissionsResponse. - p result -end -# [END secretmanager_v1beta1_generated_SecretManagerService_TestIamPermissions_sync] diff --git a/owl-bot-staging/google-cloud-secret_manager-v1beta1/snippets/secret_manager_service/update_secret.rb b/owl-bot-staging/google-cloud-secret_manager-v1beta1/snippets/secret_manager_service/update_secret.rb deleted file mode 100644 index 7979fa334732..000000000000 --- a/owl-bot-staging/google-cloud-secret_manager-v1beta1/snippets/secret_manager_service/update_secret.rb +++ /dev/null @@ -1,47 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -# [START secretmanager_v1beta1_generated_SecretManagerService_UpdateSecret_sync] -require "google/cloud/secret_manager/v1beta1" - -## -# Snippet for the update_secret call in the SecretManagerService service -# -# This snippet has been automatically generated and should be regarded as a code -# template only. It will require modifications to work: -# - It may require correct/in-range values for request initialization. -# - It may require specifying regional endpoints when creating the service -# client as shown in https://cloud.google.com/ruby/docs/reference. -# -# This is an auto-generated example demonstrating basic usage of -# Google::Cloud::SecretManager::V1beta1::SecretManagerService::Client#update_secret. -# -def update_secret - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::SecretManager::V1beta1::SecretManagerService::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::SecretManager::V1beta1::UpdateSecretRequest.new - - # Call the update_secret method. - result = client.update_secret request - - # The returned object is of type Google::Cloud::SecretManager::V1beta1::Secret. - p result -end -# [END secretmanager_v1beta1_generated_SecretManagerService_UpdateSecret_sync] diff --git a/owl-bot-staging/google-cloud-secret_manager-v1beta1/snippets/snippet_metadata_google.cloud.secrets.v1beta1.json b/owl-bot-staging/google-cloud-secret_manager-v1beta1/snippets/snippet_metadata_google.cloud.secrets.v1beta1.json deleted file mode 100644 index e3e0f532e34a..000000000000 --- a/owl-bot-staging/google-cloud-secret_manager-v1beta1/snippets/snippet_metadata_google.cloud.secrets.v1beta1.json +++ /dev/null @@ -1,615 +0,0 @@ -{ - "client_library": { - "name": "google-cloud-secret_manager-v1beta1", - "version": "", - "language": "RUBY", - "apis": [ - { - "id": "google.cloud.secrets.v1beta1", - "version": "v1beta1" - } - ] - }, - "snippets": [ - { - "region_tag": "secretmanager_v1beta1_generated_SecretManagerService_ListSecrets_sync", - "title": "Snippet for the list_secrets call in the SecretManagerService service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::SecretManager::V1beta1::SecretManagerService::Client#list_secrets.", - "file": "secret_manager_service/list_secrets.rb", - "language": "RUBY", - "client_method": { - "short_name": "list_secrets", - "full_name": "::Google::Cloud::SecretManager::V1beta1::SecretManagerService::Client#list_secrets", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::SecretManager::V1beta1::ListSecretsRequest", - "name": "request" - } - ], - "result_type": "::Google::Cloud::SecretManager::V1beta1::ListSecretsResponse", - "client": { - "short_name": "SecretManagerService::Client", - "full_name": "::Google::Cloud::SecretManager::V1beta1::SecretManagerService::Client" - }, - "method": { - "short_name": "ListSecrets", - "full_name": "google.cloud.secrets.v1beta1.SecretManagerService.ListSecrets", - "service": { - "short_name": "SecretManagerService", - "full_name": "google.cloud.secrets.v1beta1.SecretManagerService" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 50, - "type": "FULL" - } - ] - }, - { - "region_tag": "secretmanager_v1beta1_generated_SecretManagerService_CreateSecret_sync", - "title": "Snippet for the create_secret call in the SecretManagerService service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::SecretManager::V1beta1::SecretManagerService::Client#create_secret.", - "file": "secret_manager_service/create_secret.rb", - "language": "RUBY", - "client_method": { - "short_name": "create_secret", - "full_name": "::Google::Cloud::SecretManager::V1beta1::SecretManagerService::Client#create_secret", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::SecretManager::V1beta1::CreateSecretRequest", - "name": "request" - } - ], - "result_type": "::Google::Cloud::SecretManager::V1beta1::Secret", - "client": { - "short_name": "SecretManagerService::Client", - "full_name": "::Google::Cloud::SecretManager::V1beta1::SecretManagerService::Client" - }, - "method": { - "short_name": "CreateSecret", - "full_name": "google.cloud.secrets.v1beta1.SecretManagerService.CreateSecret", - "service": { - "short_name": "SecretManagerService", - "full_name": "google.cloud.secrets.v1beta1.SecretManagerService" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 46, - "type": "FULL" - } - ] - }, - { - "region_tag": "secretmanager_v1beta1_generated_SecretManagerService_AddSecretVersion_sync", - "title": "Snippet for the add_secret_version call in the SecretManagerService service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::SecretManager::V1beta1::SecretManagerService::Client#add_secret_version.", - "file": "secret_manager_service/add_secret_version.rb", - "language": "RUBY", - "client_method": { - "short_name": "add_secret_version", - "full_name": "::Google::Cloud::SecretManager::V1beta1::SecretManagerService::Client#add_secret_version", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::SecretManager::V1beta1::AddSecretVersionRequest", - "name": "request" - } - ], - "result_type": "::Google::Cloud::SecretManager::V1beta1::SecretVersion", - "client": { - "short_name": "SecretManagerService::Client", - "full_name": "::Google::Cloud::SecretManager::V1beta1::SecretManagerService::Client" - }, - "method": { - "short_name": "AddSecretVersion", - "full_name": "google.cloud.secrets.v1beta1.SecretManagerService.AddSecretVersion", - "service": { - "short_name": "SecretManagerService", - "full_name": "google.cloud.secrets.v1beta1.SecretManagerService" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 46, - "type": "FULL" - } - ] - }, - { - "region_tag": "secretmanager_v1beta1_generated_SecretManagerService_GetSecret_sync", - "title": "Snippet for the get_secret call in the SecretManagerService service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::SecretManager::V1beta1::SecretManagerService::Client#get_secret.", - "file": "secret_manager_service/get_secret.rb", - "language": "RUBY", - "client_method": { - "short_name": "get_secret", - "full_name": "::Google::Cloud::SecretManager::V1beta1::SecretManagerService::Client#get_secret", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::SecretManager::V1beta1::GetSecretRequest", - "name": "request" - } - ], - "result_type": "::Google::Cloud::SecretManager::V1beta1::Secret", - "client": { - "short_name": "SecretManagerService::Client", - "full_name": "::Google::Cloud::SecretManager::V1beta1::SecretManagerService::Client" - }, - "method": { - "short_name": "GetSecret", - "full_name": "google.cloud.secrets.v1beta1.SecretManagerService.GetSecret", - "service": { - "short_name": "SecretManagerService", - "full_name": "google.cloud.secrets.v1beta1.SecretManagerService" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 46, - "type": "FULL" - } - ] - }, - { - "region_tag": "secretmanager_v1beta1_generated_SecretManagerService_UpdateSecret_sync", - "title": "Snippet for the update_secret call in the SecretManagerService service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::SecretManager::V1beta1::SecretManagerService::Client#update_secret.", - "file": "secret_manager_service/update_secret.rb", - "language": "RUBY", - "client_method": { - "short_name": "update_secret", - "full_name": "::Google::Cloud::SecretManager::V1beta1::SecretManagerService::Client#update_secret", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::SecretManager::V1beta1::UpdateSecretRequest", - "name": "request" - } - ], - "result_type": "::Google::Cloud::SecretManager::V1beta1::Secret", - "client": { - "short_name": "SecretManagerService::Client", - "full_name": "::Google::Cloud::SecretManager::V1beta1::SecretManagerService::Client" - }, - "method": { - "short_name": "UpdateSecret", - "full_name": "google.cloud.secrets.v1beta1.SecretManagerService.UpdateSecret", - "service": { - "short_name": "SecretManagerService", - "full_name": "google.cloud.secrets.v1beta1.SecretManagerService" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 46, - "type": "FULL" - } - ] - }, - { - "region_tag": "secretmanager_v1beta1_generated_SecretManagerService_DeleteSecret_sync", - "title": "Snippet for the delete_secret call in the SecretManagerService service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::SecretManager::V1beta1::SecretManagerService::Client#delete_secret.", - "file": "secret_manager_service/delete_secret.rb", - "language": "RUBY", - "client_method": { - "short_name": "delete_secret", - "full_name": "::Google::Cloud::SecretManager::V1beta1::SecretManagerService::Client#delete_secret", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::SecretManager::V1beta1::DeleteSecretRequest", - "name": "request" - } - ], - "result_type": "::Google::Protobuf::Empty", - "client": { - "short_name": "SecretManagerService::Client", - "full_name": "::Google::Cloud::SecretManager::V1beta1::SecretManagerService::Client" - }, - "method": { - "short_name": "DeleteSecret", - "full_name": "google.cloud.secrets.v1beta1.SecretManagerService.DeleteSecret", - "service": { - "short_name": "SecretManagerService", - "full_name": "google.cloud.secrets.v1beta1.SecretManagerService" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 46, - "type": "FULL" - } - ] - }, - { - "region_tag": "secretmanager_v1beta1_generated_SecretManagerService_ListSecretVersions_sync", - "title": "Snippet for the list_secret_versions call in the SecretManagerService service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::SecretManager::V1beta1::SecretManagerService::Client#list_secret_versions.", - "file": "secret_manager_service/list_secret_versions.rb", - "language": "RUBY", - "client_method": { - "short_name": "list_secret_versions", - "full_name": "::Google::Cloud::SecretManager::V1beta1::SecretManagerService::Client#list_secret_versions", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::SecretManager::V1beta1::ListSecretVersionsRequest", - "name": "request" - } - ], - "result_type": "::Google::Cloud::SecretManager::V1beta1::ListSecretVersionsResponse", - "client": { - "short_name": "SecretManagerService::Client", - "full_name": "::Google::Cloud::SecretManager::V1beta1::SecretManagerService::Client" - }, - "method": { - "short_name": "ListSecretVersions", - "full_name": "google.cloud.secrets.v1beta1.SecretManagerService.ListSecretVersions", - "service": { - "short_name": "SecretManagerService", - "full_name": "google.cloud.secrets.v1beta1.SecretManagerService" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 50, - "type": "FULL" - } - ] - }, - { - "region_tag": "secretmanager_v1beta1_generated_SecretManagerService_GetSecretVersion_sync", - "title": "Snippet for the get_secret_version call in the SecretManagerService service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::SecretManager::V1beta1::SecretManagerService::Client#get_secret_version.", - "file": "secret_manager_service/get_secret_version.rb", - "language": "RUBY", - "client_method": { - "short_name": "get_secret_version", - "full_name": "::Google::Cloud::SecretManager::V1beta1::SecretManagerService::Client#get_secret_version", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::SecretManager::V1beta1::GetSecretVersionRequest", - "name": "request" - } - ], - "result_type": "::Google::Cloud::SecretManager::V1beta1::SecretVersion", - "client": { - "short_name": "SecretManagerService::Client", - "full_name": "::Google::Cloud::SecretManager::V1beta1::SecretManagerService::Client" - }, - "method": { - "short_name": "GetSecretVersion", - "full_name": "google.cloud.secrets.v1beta1.SecretManagerService.GetSecretVersion", - "service": { - "short_name": "SecretManagerService", - "full_name": "google.cloud.secrets.v1beta1.SecretManagerService" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 46, - "type": "FULL" - } - ] - }, - { - "region_tag": "secretmanager_v1beta1_generated_SecretManagerService_AccessSecretVersion_sync", - "title": "Snippet for the access_secret_version call in the SecretManagerService service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::SecretManager::V1beta1::SecretManagerService::Client#access_secret_version.", - "file": "secret_manager_service/access_secret_version.rb", - "language": "RUBY", - "client_method": { - "short_name": "access_secret_version", - "full_name": "::Google::Cloud::SecretManager::V1beta1::SecretManagerService::Client#access_secret_version", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::SecretManager::V1beta1::AccessSecretVersionRequest", - "name": "request" - } - ], - "result_type": "::Google::Cloud::SecretManager::V1beta1::AccessSecretVersionResponse", - "client": { - "short_name": "SecretManagerService::Client", - "full_name": "::Google::Cloud::SecretManager::V1beta1::SecretManagerService::Client" - }, - "method": { - "short_name": "AccessSecretVersion", - "full_name": "google.cloud.secrets.v1beta1.SecretManagerService.AccessSecretVersion", - "service": { - "short_name": "SecretManagerService", - "full_name": "google.cloud.secrets.v1beta1.SecretManagerService" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 46, - "type": "FULL" - } - ] - }, - { - "region_tag": "secretmanager_v1beta1_generated_SecretManagerService_DisableSecretVersion_sync", - "title": "Snippet for the disable_secret_version call in the SecretManagerService service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::SecretManager::V1beta1::SecretManagerService::Client#disable_secret_version.", - "file": "secret_manager_service/disable_secret_version.rb", - "language": "RUBY", - "client_method": { - "short_name": "disable_secret_version", - "full_name": "::Google::Cloud::SecretManager::V1beta1::SecretManagerService::Client#disable_secret_version", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::SecretManager::V1beta1::DisableSecretVersionRequest", - "name": "request" - } - ], - "result_type": "::Google::Cloud::SecretManager::V1beta1::SecretVersion", - "client": { - "short_name": "SecretManagerService::Client", - "full_name": "::Google::Cloud::SecretManager::V1beta1::SecretManagerService::Client" - }, - "method": { - "short_name": "DisableSecretVersion", - "full_name": "google.cloud.secrets.v1beta1.SecretManagerService.DisableSecretVersion", - "service": { - "short_name": "SecretManagerService", - "full_name": "google.cloud.secrets.v1beta1.SecretManagerService" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 46, - "type": "FULL" - } - ] - }, - { - "region_tag": "secretmanager_v1beta1_generated_SecretManagerService_EnableSecretVersion_sync", - "title": "Snippet for the enable_secret_version call in the SecretManagerService service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::SecretManager::V1beta1::SecretManagerService::Client#enable_secret_version.", - "file": "secret_manager_service/enable_secret_version.rb", - "language": "RUBY", - "client_method": { - "short_name": "enable_secret_version", - "full_name": "::Google::Cloud::SecretManager::V1beta1::SecretManagerService::Client#enable_secret_version", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::SecretManager::V1beta1::EnableSecretVersionRequest", - "name": "request" - } - ], - "result_type": "::Google::Cloud::SecretManager::V1beta1::SecretVersion", - "client": { - "short_name": "SecretManagerService::Client", - "full_name": "::Google::Cloud::SecretManager::V1beta1::SecretManagerService::Client" - }, - "method": { - "short_name": "EnableSecretVersion", - "full_name": "google.cloud.secrets.v1beta1.SecretManagerService.EnableSecretVersion", - "service": { - "short_name": "SecretManagerService", - "full_name": "google.cloud.secrets.v1beta1.SecretManagerService" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 46, - "type": "FULL" - } - ] - }, - { - "region_tag": "secretmanager_v1beta1_generated_SecretManagerService_DestroySecretVersion_sync", - "title": "Snippet for the destroy_secret_version call in the SecretManagerService service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::SecretManager::V1beta1::SecretManagerService::Client#destroy_secret_version.", - "file": "secret_manager_service/destroy_secret_version.rb", - "language": "RUBY", - "client_method": { - "short_name": "destroy_secret_version", - "full_name": "::Google::Cloud::SecretManager::V1beta1::SecretManagerService::Client#destroy_secret_version", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::SecretManager::V1beta1::DestroySecretVersionRequest", - "name": "request" - } - ], - "result_type": "::Google::Cloud::SecretManager::V1beta1::SecretVersion", - "client": { - "short_name": "SecretManagerService::Client", - "full_name": "::Google::Cloud::SecretManager::V1beta1::SecretManagerService::Client" - }, - "method": { - "short_name": "DestroySecretVersion", - "full_name": "google.cloud.secrets.v1beta1.SecretManagerService.DestroySecretVersion", - "service": { - "short_name": "SecretManagerService", - "full_name": "google.cloud.secrets.v1beta1.SecretManagerService" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 46, - "type": "FULL" - } - ] - }, - { - "region_tag": "secretmanager_v1beta1_generated_SecretManagerService_SetIamPolicy_sync", - "title": "Snippet for the set_iam_policy call in the SecretManagerService service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::SecretManager::V1beta1::SecretManagerService::Client#set_iam_policy.", - "file": "secret_manager_service/set_iam_policy.rb", - "language": "RUBY", - "client_method": { - "short_name": "set_iam_policy", - "full_name": "::Google::Cloud::SecretManager::V1beta1::SecretManagerService::Client#set_iam_policy", - "async": false, - "parameters": [ - { - "type": "::Google::Iam::V1::SetIamPolicyRequest", - "name": "request" - } - ], - "result_type": "::Google::Iam::V1::Policy", - "client": { - "short_name": "SecretManagerService::Client", - "full_name": "::Google::Cloud::SecretManager::V1beta1::SecretManagerService::Client" - }, - "method": { - "short_name": "SetIamPolicy", - "full_name": "google.cloud.secrets.v1beta1.SecretManagerService.SetIamPolicy", - "service": { - "short_name": "SecretManagerService", - "full_name": "google.cloud.secrets.v1beta1.SecretManagerService" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 46, - "type": "FULL" - } - ] - }, - { - "region_tag": "secretmanager_v1beta1_generated_SecretManagerService_GetIamPolicy_sync", - "title": "Snippet for the get_iam_policy call in the SecretManagerService service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::SecretManager::V1beta1::SecretManagerService::Client#get_iam_policy.", - "file": "secret_manager_service/get_iam_policy.rb", - "language": "RUBY", - "client_method": { - "short_name": "get_iam_policy", - "full_name": "::Google::Cloud::SecretManager::V1beta1::SecretManagerService::Client#get_iam_policy", - "async": false, - "parameters": [ - { - "type": "::Google::Iam::V1::GetIamPolicyRequest", - "name": "request" - } - ], - "result_type": "::Google::Iam::V1::Policy", - "client": { - "short_name": "SecretManagerService::Client", - "full_name": "::Google::Cloud::SecretManager::V1beta1::SecretManagerService::Client" - }, - "method": { - "short_name": "GetIamPolicy", - "full_name": "google.cloud.secrets.v1beta1.SecretManagerService.GetIamPolicy", - "service": { - "short_name": "SecretManagerService", - "full_name": "google.cloud.secrets.v1beta1.SecretManagerService" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 46, - "type": "FULL" - } - ] - }, - { - "region_tag": "secretmanager_v1beta1_generated_SecretManagerService_TestIamPermissions_sync", - "title": "Snippet for the test_iam_permissions call in the SecretManagerService service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::SecretManager::V1beta1::SecretManagerService::Client#test_iam_permissions.", - "file": "secret_manager_service/test_iam_permissions.rb", - "language": "RUBY", - "client_method": { - "short_name": "test_iam_permissions", - "full_name": "::Google::Cloud::SecretManager::V1beta1::SecretManagerService::Client#test_iam_permissions", - "async": false, - "parameters": [ - { - "type": "::Google::Iam::V1::TestIamPermissionsRequest", - "name": "request" - } - ], - "result_type": "::Google::Iam::V1::TestIamPermissionsResponse", - "client": { - "short_name": "SecretManagerService::Client", - "full_name": "::Google::Cloud::SecretManager::V1beta1::SecretManagerService::Client" - }, - "method": { - "short_name": "TestIamPermissions", - "full_name": "google.cloud.secrets.v1beta1.SecretManagerService.TestIamPermissions", - "service": { - "short_name": "SecretManagerService", - "full_name": "google.cloud.secrets.v1beta1.SecretManagerService" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 46, - "type": "FULL" - } - ] - } - ] -} \ No newline at end of file diff --git a/owl-bot-staging/google-cloud-secret_manager-v1beta1/test/google/cloud/secret_manager/v1beta1/secret_manager_service_paths_test.rb b/owl-bot-staging/google-cloud-secret_manager-v1beta1/test/google/cloud/secret_manager/v1beta1/secret_manager_service_paths_test.rb deleted file mode 100644 index 8b03d0133770..000000000000 --- a/owl-bot-staging/google-cloud-secret_manager-v1beta1/test/google/cloud/secret_manager/v1beta1/secret_manager_service_paths_test.rb +++ /dev/null @@ -1,79 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -require "helper" - -require "gapic/grpc/service_stub" - -require "google/cloud/secret_manager/v1beta1/secret_manager_service" - -class ::Google::Cloud::SecretManager::V1beta1::SecretManagerService::ClientPathsTest < Minitest::Test - class DummyStub - def endpoint - "endpoint.example.com" - end - - def universe_domain - "example.com" - end - - def stub_logger - nil - end - - def logger - nil - end - end - - def test_project_path - grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - ::Gapic::ServiceStub.stub :new, DummyStub.new do - client = ::Google::Cloud::SecretManager::V1beta1::SecretManagerService::Client.new do |config| - config.credentials = grpc_channel - end - - path = client.project_path project: "value0" - assert_equal "projects/value0", path - end - end - - def test_secret_path - grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - ::Gapic::ServiceStub.stub :new, DummyStub.new do - client = ::Google::Cloud::SecretManager::V1beta1::SecretManagerService::Client.new do |config| - config.credentials = grpc_channel - end - - path = client.secret_path project: "value0", secret: "value1" - assert_equal "projects/value0/secrets/value1", path - end - end - - def test_secret_version_path - grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - ::Gapic::ServiceStub.stub :new, DummyStub.new do - client = ::Google::Cloud::SecretManager::V1beta1::SecretManagerService::Client.new do |config| - config.credentials = grpc_channel - end - - path = client.secret_version_path project: "value0", secret: "value1", secret_version: "value2" - assert_equal "projects/value0/secrets/value1/versions/value2", path - end - end -end diff --git a/owl-bot-staging/google-cloud-secret_manager-v1beta1/test/google/cloud/secret_manager/v1beta1/secret_manager_service_rest_test.rb b/owl-bot-staging/google-cloud-secret_manager-v1beta1/test/google/cloud/secret_manager/v1beta1/secret_manager_service_rest_test.rb deleted file mode 100644 index ec39c96e4e46..000000000000 --- a/owl-bot-staging/google-cloud-secret_manager-v1beta1/test/google/cloud/secret_manager/v1beta1/secret_manager_service_rest_test.rb +++ /dev/null @@ -1,921 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -require "helper" -require "gapic/rest" -require "google/cloud/secrets/v1beta1/service_pb" -require "google/cloud/secret_manager/v1beta1/secret_manager_service/rest" - - -class ::Google::Cloud::SecretManager::V1beta1::SecretManagerService::Rest::ClientTest < Minitest::Test - class ClientStub - attr_accessor :call_count, :requests - - def initialize response, &block - @response = response - @block = block - @call_count = 0 - @requests = [] - end - - def make_get_request uri:, params: {}, options: {}, method_name: nil - make_http_request :get, uri: uri, body: nil, params: params, options: options, method_name: method_name - end - - def make_delete_request uri:, params: {}, options: {}, method_name: nil - make_http_request :delete, uri: uri, body: nil, params: params, options: options, method_name: method_name - end - - def make_post_request uri:, body: nil, params: {}, options: {}, method_name: nil - make_http_request :post, uri: uri, body: body, params: params, options: options, method_name: method_name - end - - def make_patch_request uri:, body:, params: {}, options: {}, method_name: nil - make_http_request :patch, uri: uri, body: body, params: params, options: options, method_name: method_name - end - - def make_put_request uri:, body:, params: {}, options: {}, method_name: nil - make_http_request :put, uri: uri, body: body, params: params, options: options, method_name: method_name - end - - def make_http_request *args, **kwargs - @call_count += 1 - - @requests << @block&.call(*args, **kwargs) - - @response - end - - def endpoint - "endpoint.example.com" - end - - def universe_domain - "example.com" - end - - def stub_logger - nil - end - - def logger - nil - end - end - - def test_list_secrets - # Create test objects. - client_result = ::Google::Cloud::SecretManager::V1beta1::ListSecretsResponse.new - http_response = OpenStruct.new body: client_result.to_json - - call_options = {} - - # Create request parameters for a unary method. - parent = "hello world" - page_size = 42 - page_token = "hello world" - - list_secrets_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| - assert options.metadata.key? :"x-goog-api-client" - assert options.metadata[:"x-goog-api-client"].include? "rest" - refute options.metadata[:"x-goog-api-client"].include? "grpc" - end - - ::Google::Cloud::SecretManager::V1beta1::SecretManagerService::Rest::ServiceStub.stub :transcode_list_secrets_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, list_secrets_client_stub do - # Create client - client = ::Google::Cloud::SecretManager::V1beta1::SecretManagerService::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - client.list_secrets({ 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_secrets 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_secrets ::Google::Cloud::SecretManager::V1beta1::ListSecretsRequest.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_secrets({ 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_secrets(::Google::Cloud::SecretManager::V1beta1::ListSecretsRequest.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_secrets_client_stub.call_count - end - end - end - - def test_create_secret - # Create test objects. - client_result = ::Google::Cloud::SecretManager::V1beta1::Secret.new - http_response = OpenStruct.new body: client_result.to_json - - call_options = {} - - # Create request parameters for a unary method. - parent = "hello world" - secret_id = "hello world" - secret = {} - - create_secret_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| - assert options.metadata.key? :"x-goog-api-client" - assert options.metadata[:"x-goog-api-client"].include? "rest" - refute options.metadata[:"x-goog-api-client"].include? "grpc" - end - - ::Google::Cloud::SecretManager::V1beta1::SecretManagerService::Rest::ServiceStub.stub :transcode_create_secret_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, create_secret_client_stub do - # Create client - client = ::Google::Cloud::SecretManager::V1beta1::SecretManagerService::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - client.create_secret({ parent: parent, secret_id: secret_id, secret: secret }) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use named arguments - client.create_secret parent: parent, secret_id: secret_id, secret: secret do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object - client.create_secret ::Google::Cloud::SecretManager::V1beta1::CreateSecretRequest.new(parent: parent, secret_id: secret_id, secret: secret) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use hash object with options - client.create_secret({ parent: parent, secret_id: secret_id, secret: secret }, call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object with options - client.create_secret(::Google::Cloud::SecretManager::V1beta1::CreateSecretRequest.new(parent: parent, secret_id: secret_id, secret: secret), call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Verify method calls - assert_equal 5, create_secret_client_stub.call_count - end - end - end - - def test_add_secret_version - # Create test objects. - client_result = ::Google::Cloud::SecretManager::V1beta1::SecretVersion.new - http_response = OpenStruct.new body: client_result.to_json - - call_options = {} - - # Create request parameters for a unary method. - parent = "hello world" - payload = {} - - add_secret_version_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| - assert options.metadata.key? :"x-goog-api-client" - assert options.metadata[:"x-goog-api-client"].include? "rest" - refute options.metadata[:"x-goog-api-client"].include? "grpc" - end - - ::Google::Cloud::SecretManager::V1beta1::SecretManagerService::Rest::ServiceStub.stub :transcode_add_secret_version_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, add_secret_version_client_stub do - # Create client - client = ::Google::Cloud::SecretManager::V1beta1::SecretManagerService::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - client.add_secret_version({ parent: parent, payload: payload }) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use named arguments - client.add_secret_version parent: parent, payload: payload do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object - client.add_secret_version ::Google::Cloud::SecretManager::V1beta1::AddSecretVersionRequest.new(parent: parent, payload: payload) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use hash object with options - client.add_secret_version({ parent: parent, payload: payload }, call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object with options - client.add_secret_version(::Google::Cloud::SecretManager::V1beta1::AddSecretVersionRequest.new(parent: parent, payload: payload), call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Verify method calls - assert_equal 5, add_secret_version_client_stub.call_count - end - end - end - - def test_get_secret - # Create test objects. - client_result = ::Google::Cloud::SecretManager::V1beta1::Secret.new - http_response = OpenStruct.new body: client_result.to_json - - call_options = {} - - # Create request parameters for a unary method. - name = "hello world" - - get_secret_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| - assert options.metadata.key? :"x-goog-api-client" - assert options.metadata[:"x-goog-api-client"].include? "rest" - refute options.metadata[:"x-goog-api-client"].include? "grpc" - end - - ::Google::Cloud::SecretManager::V1beta1::SecretManagerService::Rest::ServiceStub.stub :transcode_get_secret_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, get_secret_client_stub do - # Create client - client = ::Google::Cloud::SecretManager::V1beta1::SecretManagerService::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - client.get_secret({ name: name }) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use named arguments - client.get_secret name: name do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object - client.get_secret ::Google::Cloud::SecretManager::V1beta1::GetSecretRequest.new(name: name) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use hash object with options - client.get_secret({ name: name }, call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object with options - client.get_secret(::Google::Cloud::SecretManager::V1beta1::GetSecretRequest.new(name: name), call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Verify method calls - assert_equal 5, get_secret_client_stub.call_count - end - end - end - - def test_update_secret - # Create test objects. - client_result = ::Google::Cloud::SecretManager::V1beta1::Secret.new - http_response = OpenStruct.new body: client_result.to_json - - call_options = {} - - # Create request parameters for a unary method. - secret = {} - update_mask = {} - - update_secret_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| - assert options.metadata.key? :"x-goog-api-client" - assert options.metadata[:"x-goog-api-client"].include? "rest" - refute options.metadata[:"x-goog-api-client"].include? "grpc" - end - - ::Google::Cloud::SecretManager::V1beta1::SecretManagerService::Rest::ServiceStub.stub :transcode_update_secret_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, update_secret_client_stub do - # Create client - client = ::Google::Cloud::SecretManager::V1beta1::SecretManagerService::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - client.update_secret({ secret: secret, update_mask: update_mask }) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use named arguments - client.update_secret secret: secret, update_mask: update_mask do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object - client.update_secret ::Google::Cloud::SecretManager::V1beta1::UpdateSecretRequest.new(secret: secret, update_mask: update_mask) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use hash object with options - client.update_secret({ secret: secret, update_mask: update_mask }, call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object with options - client.update_secret(::Google::Cloud::SecretManager::V1beta1::UpdateSecretRequest.new(secret: secret, update_mask: update_mask), call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Verify method calls - assert_equal 5, update_secret_client_stub.call_count - end - end - end - - def test_delete_secret - # Create test objects. - client_result = ::Google::Protobuf::Empty.new - http_response = OpenStruct.new body: client_result.to_json - - call_options = {} - - # Create request parameters for a unary method. - name = "hello world" - - delete_secret_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| - assert options.metadata.key? :"x-goog-api-client" - assert options.metadata[:"x-goog-api-client"].include? "rest" - refute options.metadata[:"x-goog-api-client"].include? "grpc" - end - - ::Google::Cloud::SecretManager::V1beta1::SecretManagerService::Rest::ServiceStub.stub :transcode_delete_secret_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, delete_secret_client_stub do - # Create client - client = ::Google::Cloud::SecretManager::V1beta1::SecretManagerService::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - client.delete_secret({ name: name }) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use named arguments - client.delete_secret name: name do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object - client.delete_secret ::Google::Cloud::SecretManager::V1beta1::DeleteSecretRequest.new(name: name) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use hash object with options - client.delete_secret({ name: name }, call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object with options - client.delete_secret(::Google::Cloud::SecretManager::V1beta1::DeleteSecretRequest.new(name: name), call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Verify method calls - assert_equal 5, delete_secret_client_stub.call_count - end - end - end - - def test_list_secret_versions - # Create test objects. - client_result = ::Google::Cloud::SecretManager::V1beta1::ListSecretVersionsResponse.new - http_response = OpenStruct.new body: client_result.to_json - - call_options = {} - - # Create request parameters for a unary method. - parent = "hello world" - page_size = 42 - page_token = "hello world" - - list_secret_versions_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| - assert options.metadata.key? :"x-goog-api-client" - assert options.metadata[:"x-goog-api-client"].include? "rest" - refute options.metadata[:"x-goog-api-client"].include? "grpc" - end - - ::Google::Cloud::SecretManager::V1beta1::SecretManagerService::Rest::ServiceStub.stub :transcode_list_secret_versions_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, list_secret_versions_client_stub do - # Create client - client = ::Google::Cloud::SecretManager::V1beta1::SecretManagerService::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - client.list_secret_versions({ 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_secret_versions 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_secret_versions ::Google::Cloud::SecretManager::V1beta1::ListSecretVersionsRequest.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_secret_versions({ 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_secret_versions(::Google::Cloud::SecretManager::V1beta1::ListSecretVersionsRequest.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_secret_versions_client_stub.call_count - end - end - end - - def test_get_secret_version - # Create test objects. - client_result = ::Google::Cloud::SecretManager::V1beta1::SecretVersion.new - http_response = OpenStruct.new body: client_result.to_json - - call_options = {} - - # Create request parameters for a unary method. - name = "hello world" - - get_secret_version_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| - assert options.metadata.key? :"x-goog-api-client" - assert options.metadata[:"x-goog-api-client"].include? "rest" - refute options.metadata[:"x-goog-api-client"].include? "grpc" - end - - ::Google::Cloud::SecretManager::V1beta1::SecretManagerService::Rest::ServiceStub.stub :transcode_get_secret_version_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, get_secret_version_client_stub do - # Create client - client = ::Google::Cloud::SecretManager::V1beta1::SecretManagerService::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - client.get_secret_version({ name: name }) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use named arguments - client.get_secret_version name: name do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object - client.get_secret_version ::Google::Cloud::SecretManager::V1beta1::GetSecretVersionRequest.new(name: name) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use hash object with options - client.get_secret_version({ name: name }, call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object with options - client.get_secret_version(::Google::Cloud::SecretManager::V1beta1::GetSecretVersionRequest.new(name: name), call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Verify method calls - assert_equal 5, get_secret_version_client_stub.call_count - end - end - end - - def test_access_secret_version - # Create test objects. - client_result = ::Google::Cloud::SecretManager::V1beta1::AccessSecretVersionResponse.new - http_response = OpenStruct.new body: client_result.to_json - - call_options = {} - - # Create request parameters for a unary method. - name = "hello world" - - access_secret_version_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| - assert options.metadata.key? :"x-goog-api-client" - assert options.metadata[:"x-goog-api-client"].include? "rest" - refute options.metadata[:"x-goog-api-client"].include? "grpc" - end - - ::Google::Cloud::SecretManager::V1beta1::SecretManagerService::Rest::ServiceStub.stub :transcode_access_secret_version_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, access_secret_version_client_stub do - # Create client - client = ::Google::Cloud::SecretManager::V1beta1::SecretManagerService::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - client.access_secret_version({ name: name }) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use named arguments - client.access_secret_version name: name do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object - client.access_secret_version ::Google::Cloud::SecretManager::V1beta1::AccessSecretVersionRequest.new(name: name) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use hash object with options - client.access_secret_version({ name: name }, call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object with options - client.access_secret_version(::Google::Cloud::SecretManager::V1beta1::AccessSecretVersionRequest.new(name: name), call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Verify method calls - assert_equal 5, access_secret_version_client_stub.call_count - end - end - end - - def test_disable_secret_version - # Create test objects. - client_result = ::Google::Cloud::SecretManager::V1beta1::SecretVersion.new - http_response = OpenStruct.new body: client_result.to_json - - call_options = {} - - # Create request parameters for a unary method. - name = "hello world" - - disable_secret_version_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| - assert options.metadata.key? :"x-goog-api-client" - assert options.metadata[:"x-goog-api-client"].include? "rest" - refute options.metadata[:"x-goog-api-client"].include? "grpc" - end - - ::Google::Cloud::SecretManager::V1beta1::SecretManagerService::Rest::ServiceStub.stub :transcode_disable_secret_version_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, disable_secret_version_client_stub do - # Create client - client = ::Google::Cloud::SecretManager::V1beta1::SecretManagerService::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - client.disable_secret_version({ name: name }) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use named arguments - client.disable_secret_version name: name do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object - client.disable_secret_version ::Google::Cloud::SecretManager::V1beta1::DisableSecretVersionRequest.new(name: name) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use hash object with options - client.disable_secret_version({ name: name }, call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object with options - client.disable_secret_version(::Google::Cloud::SecretManager::V1beta1::DisableSecretVersionRequest.new(name: name), call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Verify method calls - assert_equal 5, disable_secret_version_client_stub.call_count - end - end - end - - def test_enable_secret_version - # Create test objects. - client_result = ::Google::Cloud::SecretManager::V1beta1::SecretVersion.new - http_response = OpenStruct.new body: client_result.to_json - - call_options = {} - - # Create request parameters for a unary method. - name = "hello world" - - enable_secret_version_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| - assert options.metadata.key? :"x-goog-api-client" - assert options.metadata[:"x-goog-api-client"].include? "rest" - refute options.metadata[:"x-goog-api-client"].include? "grpc" - end - - ::Google::Cloud::SecretManager::V1beta1::SecretManagerService::Rest::ServiceStub.stub :transcode_enable_secret_version_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, enable_secret_version_client_stub do - # Create client - client = ::Google::Cloud::SecretManager::V1beta1::SecretManagerService::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - client.enable_secret_version({ name: name }) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use named arguments - client.enable_secret_version name: name do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object - client.enable_secret_version ::Google::Cloud::SecretManager::V1beta1::EnableSecretVersionRequest.new(name: name) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use hash object with options - client.enable_secret_version({ name: name }, call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object with options - client.enable_secret_version(::Google::Cloud::SecretManager::V1beta1::EnableSecretVersionRequest.new(name: name), call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Verify method calls - assert_equal 5, enable_secret_version_client_stub.call_count - end - end - end - - def test_destroy_secret_version - # Create test objects. - client_result = ::Google::Cloud::SecretManager::V1beta1::SecretVersion.new - http_response = OpenStruct.new body: client_result.to_json - - call_options = {} - - # Create request parameters for a unary method. - name = "hello world" - - destroy_secret_version_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| - assert options.metadata.key? :"x-goog-api-client" - assert options.metadata[:"x-goog-api-client"].include? "rest" - refute options.metadata[:"x-goog-api-client"].include? "grpc" - end - - ::Google::Cloud::SecretManager::V1beta1::SecretManagerService::Rest::ServiceStub.stub :transcode_destroy_secret_version_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, destroy_secret_version_client_stub do - # Create client - client = ::Google::Cloud::SecretManager::V1beta1::SecretManagerService::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - client.destroy_secret_version({ name: name }) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use named arguments - client.destroy_secret_version name: name do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object - client.destroy_secret_version ::Google::Cloud::SecretManager::V1beta1::DestroySecretVersionRequest.new(name: name) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use hash object with options - client.destroy_secret_version({ name: name }, call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object with options - client.destroy_secret_version(::Google::Cloud::SecretManager::V1beta1::DestroySecretVersionRequest.new(name: name), call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Verify method calls - assert_equal 5, destroy_secret_version_client_stub.call_count - end - end - end - - def test_set_iam_policy - # Create test objects. - client_result = ::Google::Iam::V1::Policy.new - http_response = OpenStruct.new body: client_result.to_json - - call_options = {} - - # Create request parameters for a unary method. - resource = "hello world" - policy = {} - update_mask = {} - - set_iam_policy_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| - assert options.metadata.key? :"x-goog-api-client" - assert options.metadata[:"x-goog-api-client"].include? "rest" - refute options.metadata[:"x-goog-api-client"].include? "grpc" - end - - ::Google::Cloud::SecretManager::V1beta1::SecretManagerService::Rest::ServiceStub.stub :transcode_set_iam_policy_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, set_iam_policy_client_stub do - # Create client - client = ::Google::Cloud::SecretManager::V1beta1::SecretManagerService::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - client.set_iam_policy({ resource: resource, policy: policy, update_mask: update_mask }) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use named arguments - client.set_iam_policy resource: resource, policy: policy, update_mask: update_mask do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object - client.set_iam_policy ::Google::Iam::V1::SetIamPolicyRequest.new(resource: resource, policy: policy, update_mask: update_mask) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use hash object with options - client.set_iam_policy({ resource: resource, policy: policy, update_mask: update_mask }, call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object with options - client.set_iam_policy(::Google::Iam::V1::SetIamPolicyRequest.new(resource: resource, policy: policy, update_mask: update_mask), call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Verify method calls - assert_equal 5, set_iam_policy_client_stub.call_count - end - end - end - - def test_get_iam_policy - # Create test objects. - client_result = ::Google::Iam::V1::Policy.new - http_response = OpenStruct.new body: client_result.to_json - - call_options = {} - - # Create request parameters for a unary method. - resource = "hello world" - options = {} - - get_iam_policy_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| - assert options.metadata.key? :"x-goog-api-client" - assert options.metadata[:"x-goog-api-client"].include? "rest" - refute options.metadata[:"x-goog-api-client"].include? "grpc" - end - - ::Google::Cloud::SecretManager::V1beta1::SecretManagerService::Rest::ServiceStub.stub :transcode_get_iam_policy_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, get_iam_policy_client_stub do - # Create client - client = ::Google::Cloud::SecretManager::V1beta1::SecretManagerService::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - client.get_iam_policy({ resource: resource, options: options }) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use named arguments - client.get_iam_policy resource: resource, options: options do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object - client.get_iam_policy ::Google::Iam::V1::GetIamPolicyRequest.new(resource: resource, options: options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use hash object with options - client.get_iam_policy({ resource: resource, options: options }, call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object with options - client.get_iam_policy(::Google::Iam::V1::GetIamPolicyRequest.new(resource: resource, options: options), call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Verify method calls - assert_equal 5, get_iam_policy_client_stub.call_count - end - end - end - - def test_test_iam_permissions - # Create test objects. - client_result = ::Google::Iam::V1::TestIamPermissionsResponse.new - http_response = OpenStruct.new body: client_result.to_json - - call_options = {} - - # Create request parameters for a unary method. - resource = "hello world" - permissions = ["hello world"] - - test_iam_permissions_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| - assert options.metadata.key? :"x-goog-api-client" - assert options.metadata[:"x-goog-api-client"].include? "rest" - refute options.metadata[:"x-goog-api-client"].include? "grpc" - end - - ::Google::Cloud::SecretManager::V1beta1::SecretManagerService::Rest::ServiceStub.stub :transcode_test_iam_permissions_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, test_iam_permissions_client_stub do - # Create client - client = ::Google::Cloud::SecretManager::V1beta1::SecretManagerService::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - client.test_iam_permissions({ resource: resource, permissions: permissions }) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use named arguments - client.test_iam_permissions resource: resource, permissions: permissions do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object - client.test_iam_permissions ::Google::Iam::V1::TestIamPermissionsRequest.new(resource: resource, permissions: permissions) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use hash object with options - client.test_iam_permissions({ resource: resource, permissions: permissions }, call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object with options - client.test_iam_permissions(::Google::Iam::V1::TestIamPermissionsRequest.new(resource: resource, permissions: permissions), call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Verify method calls - assert_equal 5, test_iam_permissions_client_stub.call_count - end - end - end - - def test_configure - credentials_token = :dummy_value - - client = block_config = config = nil - dummy_stub = ClientStub.new nil - Gapic::Rest::ClientStub.stub :new, dummy_stub do - client = ::Google::Cloud::SecretManager::V1beta1::SecretManagerService::Rest::Client.new do |config| - config.credentials = credentials_token - end - end - - config = client.configure do |c| - block_config = c - end - - assert_same block_config, config - assert_kind_of ::Google::Cloud::SecretManager::V1beta1::SecretManagerService::Rest::Client::Configuration, config - end -end diff --git a/owl-bot-staging/google-cloud-secret_manager-v1beta1/test/google/cloud/secret_manager/v1beta1/secret_manager_service_test.rb b/owl-bot-staging/google-cloud-secret_manager-v1beta1/test/google/cloud/secret_manager/v1beta1/secret_manager_service_test.rb deleted file mode 100644 index 79c7c3611d7b..000000000000 --- a/owl-bot-staging/google-cloud-secret_manager-v1beta1/test/google/cloud/secret_manager/v1beta1/secret_manager_service_test.rb +++ /dev/null @@ -1,1008 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -require "helper" - -require "gapic/grpc/service_stub" - -require "google/cloud/secrets/v1beta1/service_pb" -require "google/cloud/secret_manager/v1beta1/secret_manager_service" - -class ::Google::Cloud::SecretManager::V1beta1::SecretManagerService::ClientTest < Minitest::Test - class ClientStub - attr_accessor :call_rpc_count, :requests - - def initialize response, operation, &block - @response = response - @operation = operation - @block = block - @call_rpc_count = 0 - @requests = [] - end - - def call_rpc *args, **kwargs - @call_rpc_count += 1 - - @requests << @block&.call(*args, **kwargs) - - catch :response do - yield @response, @operation if block_given? - @response - end - end - - def endpoint - "endpoint.example.com" - end - - def universe_domain - "example.com" - end - - def stub_logger - nil - end - - def logger - nil - end - end - - def test_list_secrets - # Create GRPC objects. - grpc_response = ::Google::Cloud::SecretManager::V1beta1::ListSecretsResponse.new - grpc_operation = GRPC::ActiveCall::Operation.new nil - grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - grpc_options = {} - - # Create request parameters for a unary method. - parent = "hello world" - page_size = 42 - page_token = "hello world" - - list_secrets_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :list_secrets, name - assert_kind_of ::Google::Cloud::SecretManager::V1beta1::ListSecretsRequest, 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_secrets_client_stub do - # Create client - client = ::Google::Cloud::SecretManager::V1beta1::SecretManagerService::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.list_secrets({ 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_secrets 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_secrets ::Google::Cloud::SecretManager::V1beta1::ListSecretsRequest.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_secrets({ 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_secrets(::Google::Cloud::SecretManager::V1beta1::ListSecretsRequest.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_secrets_client_stub.call_rpc_count - end - end - - def test_create_secret - # Create GRPC objects. - grpc_response = ::Google::Cloud::SecretManager::V1beta1::Secret.new - grpc_operation = GRPC::ActiveCall::Operation.new nil - grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - grpc_options = {} - - # Create request parameters for a unary method. - parent = "hello world" - secret_id = "hello world" - secret = {} - - create_secret_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :create_secret, name - assert_kind_of ::Google::Cloud::SecretManager::V1beta1::CreateSecretRequest, request - assert_equal "hello world", request["parent"] - assert_equal "hello world", request["secret_id"] - assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::SecretManager::V1beta1::Secret), request["secret"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, create_secret_client_stub do - # Create client - client = ::Google::Cloud::SecretManager::V1beta1::SecretManagerService::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.create_secret({ parent: parent, secret_id: secret_id, secret: secret }) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use named arguments - client.create_secret parent: parent, secret_id: secret_id, secret: secret do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object - client.create_secret ::Google::Cloud::SecretManager::V1beta1::CreateSecretRequest.new(parent: parent, secret_id: secret_id, secret: secret) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use hash object with options - client.create_secret({ parent: parent, secret_id: secret_id, secret: secret }, grpc_options) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object with options - client.create_secret(::Google::Cloud::SecretManager::V1beta1::CreateSecretRequest.new(parent: parent, secret_id: secret_id, secret: secret), grpc_options) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Verify method calls - assert_equal 5, create_secret_client_stub.call_rpc_count - end - end - - def test_add_secret_version - # Create GRPC objects. - grpc_response = ::Google::Cloud::SecretManager::V1beta1::SecretVersion.new - grpc_operation = GRPC::ActiveCall::Operation.new nil - grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - grpc_options = {} - - # Create request parameters for a unary method. - parent = "hello world" - payload = {} - - add_secret_version_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :add_secret_version, name - assert_kind_of ::Google::Cloud::SecretManager::V1beta1::AddSecretVersionRequest, request - assert_equal "hello world", request["parent"] - assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::SecretManager::V1beta1::SecretPayload), request["payload"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, add_secret_version_client_stub do - # Create client - client = ::Google::Cloud::SecretManager::V1beta1::SecretManagerService::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.add_secret_version({ parent: parent, payload: payload }) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use named arguments - client.add_secret_version parent: parent, payload: payload do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object - client.add_secret_version ::Google::Cloud::SecretManager::V1beta1::AddSecretVersionRequest.new(parent: parent, payload: payload) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use hash object with options - client.add_secret_version({ parent: parent, payload: payload }, grpc_options) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object with options - client.add_secret_version(::Google::Cloud::SecretManager::V1beta1::AddSecretVersionRequest.new(parent: parent, payload: payload), grpc_options) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Verify method calls - assert_equal 5, add_secret_version_client_stub.call_rpc_count - end - end - - def test_get_secret - # Create GRPC objects. - grpc_response = ::Google::Cloud::SecretManager::V1beta1::Secret.new - grpc_operation = GRPC::ActiveCall::Operation.new nil - grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - grpc_options = {} - - # Create request parameters for a unary method. - name = "hello world" - - get_secret_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :get_secret, name - assert_kind_of ::Google::Cloud::SecretManager::V1beta1::GetSecretRequest, request - assert_equal "hello world", request["name"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, get_secret_client_stub do - # Create client - client = ::Google::Cloud::SecretManager::V1beta1::SecretManagerService::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.get_secret({ name: name }) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use named arguments - client.get_secret name: name do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object - client.get_secret ::Google::Cloud::SecretManager::V1beta1::GetSecretRequest.new(name: name) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use hash object with options - client.get_secret({ name: name }, grpc_options) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object with options - client.get_secret(::Google::Cloud::SecretManager::V1beta1::GetSecretRequest.new(name: name), grpc_options) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Verify method calls - assert_equal 5, get_secret_client_stub.call_rpc_count - end - end - - def test_update_secret - # Create GRPC objects. - grpc_response = ::Google::Cloud::SecretManager::V1beta1::Secret.new - grpc_operation = GRPC::ActiveCall::Operation.new nil - grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - grpc_options = {} - - # Create request parameters for a unary method. - secret = {} - update_mask = {} - - update_secret_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :update_secret, name - assert_kind_of ::Google::Cloud::SecretManager::V1beta1::UpdateSecretRequest, request - assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::SecretManager::V1beta1::Secret), request["secret"] - assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Protobuf::FieldMask), request["update_mask"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, update_secret_client_stub do - # Create client - client = ::Google::Cloud::SecretManager::V1beta1::SecretManagerService::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.update_secret({ secret: secret, update_mask: update_mask }) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use named arguments - client.update_secret secret: secret, update_mask: update_mask do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object - client.update_secret ::Google::Cloud::SecretManager::V1beta1::UpdateSecretRequest.new(secret: secret, update_mask: update_mask) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use hash object with options - client.update_secret({ secret: secret, update_mask: update_mask }, grpc_options) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object with options - client.update_secret(::Google::Cloud::SecretManager::V1beta1::UpdateSecretRequest.new(secret: secret, update_mask: update_mask), grpc_options) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Verify method calls - assert_equal 5, update_secret_client_stub.call_rpc_count - end - end - - def test_delete_secret - # Create GRPC objects. - grpc_response = ::Google::Protobuf::Empty.new - grpc_operation = GRPC::ActiveCall::Operation.new nil - grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - grpc_options = {} - - # Create request parameters for a unary method. - name = "hello world" - - delete_secret_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :delete_secret, name - assert_kind_of ::Google::Cloud::SecretManager::V1beta1::DeleteSecretRequest, request - assert_equal "hello world", request["name"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, delete_secret_client_stub do - # Create client - client = ::Google::Cloud::SecretManager::V1beta1::SecretManagerService::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.delete_secret({ name: name }) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use named arguments - client.delete_secret name: name do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object - client.delete_secret ::Google::Cloud::SecretManager::V1beta1::DeleteSecretRequest.new(name: name) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use hash object with options - client.delete_secret({ 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_secret(::Google::Cloud::SecretManager::V1beta1::DeleteSecretRequest.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_secret_client_stub.call_rpc_count - end - end - - def test_list_secret_versions - # Create GRPC objects. - grpc_response = ::Google::Cloud::SecretManager::V1beta1::ListSecretVersionsResponse.new - grpc_operation = GRPC::ActiveCall::Operation.new nil - grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - grpc_options = {} - - # Create request parameters for a unary method. - parent = "hello world" - page_size = 42 - page_token = "hello world" - - list_secret_versions_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :list_secret_versions, name - assert_kind_of ::Google::Cloud::SecretManager::V1beta1::ListSecretVersionsRequest, 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_secret_versions_client_stub do - # Create client - client = ::Google::Cloud::SecretManager::V1beta1::SecretManagerService::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.list_secret_versions({ 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_secret_versions 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_secret_versions ::Google::Cloud::SecretManager::V1beta1::ListSecretVersionsRequest.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_secret_versions({ 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_secret_versions(::Google::Cloud::SecretManager::V1beta1::ListSecretVersionsRequest.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_secret_versions_client_stub.call_rpc_count - end - end - - def test_get_secret_version - # Create GRPC objects. - grpc_response = ::Google::Cloud::SecretManager::V1beta1::SecretVersion.new - grpc_operation = GRPC::ActiveCall::Operation.new nil - grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - grpc_options = {} - - # Create request parameters for a unary method. - name = "hello world" - - get_secret_version_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :get_secret_version, name - assert_kind_of ::Google::Cloud::SecretManager::V1beta1::GetSecretVersionRequest, request - assert_equal "hello world", request["name"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, get_secret_version_client_stub do - # Create client - client = ::Google::Cloud::SecretManager::V1beta1::SecretManagerService::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.get_secret_version({ name: name }) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use named arguments - client.get_secret_version name: name do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object - client.get_secret_version ::Google::Cloud::SecretManager::V1beta1::GetSecretVersionRequest.new(name: name) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use hash object with options - client.get_secret_version({ name: name }, grpc_options) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object with options - client.get_secret_version(::Google::Cloud::SecretManager::V1beta1::GetSecretVersionRequest.new(name: name), grpc_options) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Verify method calls - assert_equal 5, get_secret_version_client_stub.call_rpc_count - end - end - - def test_access_secret_version - # Create GRPC objects. - grpc_response = ::Google::Cloud::SecretManager::V1beta1::AccessSecretVersionResponse.new - grpc_operation = GRPC::ActiveCall::Operation.new nil - grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - grpc_options = {} - - # Create request parameters for a unary method. - name = "hello world" - - access_secret_version_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :access_secret_version, name - assert_kind_of ::Google::Cloud::SecretManager::V1beta1::AccessSecretVersionRequest, request - assert_equal "hello world", request["name"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, access_secret_version_client_stub do - # Create client - client = ::Google::Cloud::SecretManager::V1beta1::SecretManagerService::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.access_secret_version({ name: name }) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use named arguments - client.access_secret_version name: name do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object - client.access_secret_version ::Google::Cloud::SecretManager::V1beta1::AccessSecretVersionRequest.new(name: name) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use hash object with options - client.access_secret_version({ name: name }, grpc_options) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object with options - client.access_secret_version(::Google::Cloud::SecretManager::V1beta1::AccessSecretVersionRequest.new(name: name), grpc_options) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Verify method calls - assert_equal 5, access_secret_version_client_stub.call_rpc_count - end - end - - def test_disable_secret_version - # Create GRPC objects. - grpc_response = ::Google::Cloud::SecretManager::V1beta1::SecretVersion.new - grpc_operation = GRPC::ActiveCall::Operation.new nil - grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - grpc_options = {} - - # Create request parameters for a unary method. - name = "hello world" - - disable_secret_version_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :disable_secret_version, name - assert_kind_of ::Google::Cloud::SecretManager::V1beta1::DisableSecretVersionRequest, request - assert_equal "hello world", request["name"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, disable_secret_version_client_stub do - # Create client - client = ::Google::Cloud::SecretManager::V1beta1::SecretManagerService::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.disable_secret_version({ name: name }) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use named arguments - client.disable_secret_version name: name do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object - client.disable_secret_version ::Google::Cloud::SecretManager::V1beta1::DisableSecretVersionRequest.new(name: name) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use hash object with options - client.disable_secret_version({ name: name }, grpc_options) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object with options - client.disable_secret_version(::Google::Cloud::SecretManager::V1beta1::DisableSecretVersionRequest.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, disable_secret_version_client_stub.call_rpc_count - end - end - - def test_enable_secret_version - # Create GRPC objects. - grpc_response = ::Google::Cloud::SecretManager::V1beta1::SecretVersion.new - grpc_operation = GRPC::ActiveCall::Operation.new nil - grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - grpc_options = {} - - # Create request parameters for a unary method. - name = "hello world" - - enable_secret_version_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :enable_secret_version, name - assert_kind_of ::Google::Cloud::SecretManager::V1beta1::EnableSecretVersionRequest, request - assert_equal "hello world", request["name"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, enable_secret_version_client_stub do - # Create client - client = ::Google::Cloud::SecretManager::V1beta1::SecretManagerService::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.enable_secret_version({ name: name }) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use named arguments - client.enable_secret_version name: name do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object - client.enable_secret_version ::Google::Cloud::SecretManager::V1beta1::EnableSecretVersionRequest.new(name: name) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use hash object with options - client.enable_secret_version({ name: name }, grpc_options) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object with options - client.enable_secret_version(::Google::Cloud::SecretManager::V1beta1::EnableSecretVersionRequest.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, enable_secret_version_client_stub.call_rpc_count - end - end - - def test_destroy_secret_version - # Create GRPC objects. - grpc_response = ::Google::Cloud::SecretManager::V1beta1::SecretVersion.new - grpc_operation = GRPC::ActiveCall::Operation.new nil - grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - grpc_options = {} - - # Create request parameters for a unary method. - name = "hello world" - - destroy_secret_version_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :destroy_secret_version, name - assert_kind_of ::Google::Cloud::SecretManager::V1beta1::DestroySecretVersionRequest, request - assert_equal "hello world", request["name"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, destroy_secret_version_client_stub do - # Create client - client = ::Google::Cloud::SecretManager::V1beta1::SecretManagerService::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.destroy_secret_version({ name: name }) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use named arguments - client.destroy_secret_version name: name do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object - client.destroy_secret_version ::Google::Cloud::SecretManager::V1beta1::DestroySecretVersionRequest.new(name: name) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use hash object with options - client.destroy_secret_version({ name: name }, grpc_options) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object with options - client.destroy_secret_version(::Google::Cloud::SecretManager::V1beta1::DestroySecretVersionRequest.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, destroy_secret_version_client_stub.call_rpc_count - end - end - - def test_set_iam_policy - # Create GRPC objects. - grpc_response = ::Google::Iam::V1::Policy.new - grpc_operation = GRPC::ActiveCall::Operation.new nil - grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - grpc_options = {} - - # Create request parameters for a unary method. - resource = "hello world" - policy = {} - update_mask = {} - - set_iam_policy_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :set_iam_policy, name - assert_kind_of ::Google::Iam::V1::SetIamPolicyRequest, request - assert_equal "hello world", request["resource"] - assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Iam::V1::Policy), request["policy"] - assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Protobuf::FieldMask), request["update_mask"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, set_iam_policy_client_stub do - # Create client - client = ::Google::Cloud::SecretManager::V1beta1::SecretManagerService::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.set_iam_policy({ resource: resource, policy: policy, update_mask: update_mask }) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use named arguments - client.set_iam_policy resource: resource, policy: policy, update_mask: update_mask do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object - client.set_iam_policy ::Google::Iam::V1::SetIamPolicyRequest.new(resource: resource, policy: policy, update_mask: update_mask) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use hash object with options - client.set_iam_policy({ resource: resource, policy: policy, update_mask: update_mask }, grpc_options) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object with options - client.set_iam_policy(::Google::Iam::V1::SetIamPolicyRequest.new(resource: resource, policy: policy, update_mask: update_mask), grpc_options) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Verify method calls - assert_equal 5, set_iam_policy_client_stub.call_rpc_count - end - end - - def test_get_iam_policy - # Create GRPC objects. - grpc_response = ::Google::Iam::V1::Policy.new - grpc_operation = GRPC::ActiveCall::Operation.new nil - grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - grpc_options = {} - - # Create request parameters for a unary method. - resource = "hello world" - options = {} - - get_iam_policy_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :get_iam_policy, name - assert_kind_of ::Google::Iam::V1::GetIamPolicyRequest, request - assert_equal "hello world", request["resource"] - assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Iam::V1::GetPolicyOptions), request["options"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, get_iam_policy_client_stub do - # Create client - client = ::Google::Cloud::SecretManager::V1beta1::SecretManagerService::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.get_iam_policy({ resource: resource, options: options }) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use named arguments - client.get_iam_policy resource: resource, options: options do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object - client.get_iam_policy ::Google::Iam::V1::GetIamPolicyRequest.new(resource: resource, options: options) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use hash object with options - client.get_iam_policy({ resource: resource, options: options }, grpc_options) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object with options - client.get_iam_policy(::Google::Iam::V1::GetIamPolicyRequest.new(resource: resource, options: options), grpc_options) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Verify method calls - assert_equal 5, get_iam_policy_client_stub.call_rpc_count - end - end - - def test_test_iam_permissions - # Create GRPC objects. - grpc_response = ::Google::Iam::V1::TestIamPermissionsResponse.new - grpc_operation = GRPC::ActiveCall::Operation.new nil - grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - grpc_options = {} - - # Create request parameters for a unary method. - resource = "hello world" - permissions = ["hello world"] - - test_iam_permissions_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :test_iam_permissions, name - assert_kind_of ::Google::Iam::V1::TestIamPermissionsRequest, request - assert_equal "hello world", request["resource"] - assert_equal ["hello world"], request["permissions"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, test_iam_permissions_client_stub do - # Create client - client = ::Google::Cloud::SecretManager::V1beta1::SecretManagerService::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.test_iam_permissions({ resource: resource, permissions: permissions }) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use named arguments - client.test_iam_permissions resource: resource, permissions: permissions do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object - client.test_iam_permissions ::Google::Iam::V1::TestIamPermissionsRequest.new(resource: resource, permissions: permissions) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use hash object with options - client.test_iam_permissions({ resource: resource, permissions: permissions }, grpc_options) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object with options - client.test_iam_permissions(::Google::Iam::V1::TestIamPermissionsRequest.new(resource: resource, permissions: permissions), grpc_options) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Verify method calls - assert_equal 5, test_iam_permissions_client_stub.call_rpc_count - end - end - - def test_configure - grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - - client = block_config = config = nil - dummy_stub = ClientStub.new nil, nil - Gapic::ServiceStub.stub :new, dummy_stub do - client = ::Google::Cloud::SecretManager::V1beta1::SecretManagerService::Client.new do |config| - config.credentials = grpc_channel - end - end - - config = client.configure do |c| - block_config = c - end - - assert_same block_config, config - assert_kind_of ::Google::Cloud::SecretManager::V1beta1::SecretManagerService::Client::Configuration, config - end - - def test_credentials - key = OpenSSL::PKey::RSA.new 2048 - cred_json = { - "private_key" => key.to_pem, - "client_email" => "app@developer.gserviceaccount.com", - "type" => "service_account" - } - key_file = StringIO.new cred_json.to_json - creds = Google::Auth::ServiceAccountCredentials.make_creds({ json_key_io: key_file }) - - dummy_stub = ClientStub.new nil, nil - Gapic::ServiceStub.stub :new, dummy_stub do - client = ::Google::Cloud::SecretManager::V1beta1::SecretManagerService::Client.new do |config| - config.credentials = creds - end - assert_kind_of ::Google::Cloud::SecretManager::V1beta1::SecretManagerService::Client, client - assert_equal creds, client.configure.credentials - end - end -end diff --git a/owl-bot-staging/google-cloud-secret_manager-v1beta1/test/helper.rb b/owl-bot-staging/google-cloud-secret_manager-v1beta1/test/helper.rb deleted file mode 100644 index 672b337030e7..000000000000 --- a/owl-bot-staging/google-cloud-secret_manager-v1beta1/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" diff --git a/owl-bot-staging/google-cloud-secret_manager-v1beta2/.gitignore b/owl-bot-staging/google-cloud-secret_manager-v1beta2/.gitignore deleted file mode 100644 index 0135b6bc6cfc..000000000000 --- a/owl-bot-staging/google-cloud-secret_manager-v1beta2/.gitignore +++ /dev/null @@ -1,22 +0,0 @@ -# Ignore bundler lockfiles -Gemfile.lock -gems.locked - -# Ignore documentation output -doc/* -.yardoc/* - -# Ignore test output -coverage/* - -# Ignore build artifacts -pkg/* - -# Ignore files commonly present in certain dev environments -.vagrant -.DS_STORE -.idea -*.iml - -# Ignore synth output -__pycache__ diff --git a/owl-bot-staging/google-cloud-secret_manager-v1beta2/.repo-metadata.json b/owl-bot-staging/google-cloud-secret_manager-v1beta2/.repo-metadata.json deleted file mode 100644 index 14c52f056019..000000000000 --- a/owl-bot-staging/google-cloud-secret_manager-v1beta2/.repo-metadata.json +++ /dev/null @@ -1,18 +0,0 @@ -{ - "api_id": "secretmanager.googleapis.com", - "api_shortname": "secretmanager", - "client_documentation": "https://cloud.google.com/ruby/docs/reference/google-cloud-secret_manager-v1beta2/latest", - "distribution_name": "google-cloud-secret_manager-v1beta2", - "is_cloud": true, - "language": "ruby", - "name": "secretmanager", - "name_pretty": "Secret Manager V1BETA2 API", - "product_documentation": "https://cloud.google.com/secret-manager", - "release_level": "unreleased", - "repo": "googleapis/google-cloud-ruby", - "requires_billing": true, - "ruby-cloud-description": "Secret Manager Overview. Note that google-cloud-secret_manager-v1beta2 is a version-specific client library. For most uses, we recommend installing the main client library google-cloud-secret_manager instead. See the readme for more details.", - "ruby-cloud-env-prefix": "SECRET_MANAGER", - "ruby-cloud-product-url": "https://cloud.google.com/secret-manager", - "library_type": "GAPIC_AUTO" -} diff --git a/owl-bot-staging/google-cloud-secret_manager-v1beta2/.rubocop.yml b/owl-bot-staging/google-cloud-secret_manager-v1beta2/.rubocop.yml deleted file mode 100644 index 734c385c1bd1..000000000000 --- a/owl-bot-staging/google-cloud-secret_manager-v1beta2/.rubocop.yml +++ /dev/null @@ -1,33 +0,0 @@ -inherit_gem: - google-style: google-style.yml - -AllCops: - Exclude: - - "google-cloud-secret_manager-v1beta2.gemspec" - - "lib/**/*_pb.rb" - - "proto_docs/**/*" - - "test/**/*" - - "acceptance/**/*" - - "samples/acceptance/**/*" - - "Rakefile" - -Layout/LineLength: - Enabled: false -Metrics/AbcSize: - Enabled: false -Metrics/ClassLength: - Enabled: false -Metrics/CyclomaticComplexity: - Enabled: false -Metrics/MethodLength: - Enabled: false -Metrics/ModuleLength: - Enabled: false -Metrics/PerceivedComplexity: - Enabled: false -Naming/AccessorMethodName: - Exclude: - - "snippets/**/*.rb" -Naming/FileName: - Exclude: - - "lib/google-cloud-secret_manager-v1beta2.rb" diff --git a/owl-bot-staging/google-cloud-secret_manager-v1beta2/.toys.rb b/owl-bot-staging/google-cloud-secret_manager-v1beta2/.toys.rb deleted file mode 100644 index 177e22456e8a..000000000000 --- a/owl-bot-staging/google-cloud-secret_manager-v1beta2/.toys.rb +++ /dev/null @@ -1,28 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -toys_version! ">= 0.15.3" - -if ENV["RUBY_COMMON_TOOLS"] - common_tools_dir = File.expand_path ENV["RUBY_COMMON_TOOLS"] - load File.join(common_tools_dir, "toys", "gapic") -else - load_git remote: "https://github.com/googleapis/ruby-common-tools.git", - path: "toys/gapic", - update: true -end diff --git a/owl-bot-staging/google-cloud-secret_manager-v1beta2/.yardopts b/owl-bot-staging/google-cloud-secret_manager-v1beta2/.yardopts deleted file mode 100644 index ac280e88bebc..000000000000 --- a/owl-bot-staging/google-cloud-secret_manager-v1beta2/.yardopts +++ /dev/null @@ -1,12 +0,0 @@ ---no-private ---title="Secret Manager V1BETA2 API" ---exclude _pb\.rb$ ---markup markdown ---markup-provider redcarpet - -./lib/**/*.rb -./proto_docs/**/*.rb -- -README.md -LICENSE.md -AUTHENTICATION.md diff --git a/owl-bot-staging/google-cloud-secret_manager-v1beta2/AUTHENTICATION.md b/owl-bot-staging/google-cloud-secret_manager-v1beta2/AUTHENTICATION.md deleted file mode 100644 index 15838bd69def..000000000000 --- a/owl-bot-staging/google-cloud-secret_manager-v1beta2/AUTHENTICATION.md +++ /dev/null @@ -1,122 +0,0 @@ -# Authentication - -The recommended way to authenticate to the google-cloud-secret_manager-v1beta2 library is to use -[Application Default Credentials (ADC)](https://cloud.google.com/docs/authentication/application-default-credentials). -To review all of your authentication options, see [Credentials lookup](#credential-lookup). - -## Quickstart - -The following example shows how to set up authentication for a local development -environment with your user credentials. - -**NOTE:** This method is _not_ recommended for running in production. User credentials -should be used only during development. - -1. [Download and install the Google Cloud CLI](https://cloud.google.com/sdk). -2. Set up a local ADC file with your user credentials: - -```sh -gcloud auth application-default login -``` - -3. Write code as if already authenticated. - -For more information about setting up authentication for a local development environment, see -[Set up Application Default Credentials](https://cloud.google.com/docs/authentication/provide-credentials-adc#local-dev). - -## Credential Lookup - -The google-cloud-secret_manager-v1beta2 library provides several mechanisms to configure your system. -Generally, using Application Default Credentials to facilitate automatic -credentials discovery is the easist method. But if you need to explicitly specify -credentials, there are several methods available to you. - -Credentials are accepted in the following ways, in the following order or precedence: - -1. Credentials specified in method arguments -2. Credentials specified in configuration -3. Credentials pointed to or included in environment variables -4. Credentials found in local ADC file -5. Credentials returned by the metadata server for the attached service account (GCP) - -### Configuration - -You can configure a path to a JSON credentials file, either for an individual client object or -globally, for all client objects. The JSON file can contain credentials created for -[workload identity federation](https://cloud.google.com/iam/docs/workload-identity-federation), -[workforce identity federation](https://cloud.google.com/iam/docs/workforce-identity-federation), or a -[service account key](https://cloud.google.com/docs/authentication/provide-credentials-adc#local-key). - -Note: Service account keys are a security risk if not managed correctly. You should -[choose a more secure alternative to service account keys](https://cloud.google.com/docs/authentication#auth-decision-tree) -whenever possible. - -To configure a credentials file for an individual client initialization: - -```ruby -require "google/cloud/secret_manager/v1beta2" - -client = ::Google::Cloud::SecretManager::V1beta2::SecretManagerService::Client.new do |config| - config.credentials = "path/to/credentialfile.json" -end -``` - -To configure a credentials file globally for all clients: - -```ruby -require "google/cloud/secret_manager/v1beta2" - -::Google::Cloud::SecretManager::V1beta2::SecretManagerService::Client.configure do |config| - config.credentials = "path/to/credentialfile.json" -end - -client = ::Google::Cloud::SecretManager::V1beta2::SecretManagerService::Client.new -``` - -### Environment Variables - -You can also use an environment variable to provide a JSON credentials file. -The environment variable can contain a path to the credentials file or, for -environments such as Docker containers where writing files is not encouraged, -you can include the credentials file itself. - -The JSON file can contain credentials created for -[workload identity federation](https://cloud.google.com/iam/docs/workload-identity-federation), -[workforce identity federation](https://cloud.google.com/iam/docs/workforce-identity-federation), or a -[service account key](https://cloud.google.com/docs/authentication/provide-credentials-adc#local-key). - -Note: Service account keys are a security risk if not managed correctly. You should -[choose a more secure alternative to service account keys](https://cloud.google.com/docs/authentication#auth-decision-tree) -whenever possible. - -The environment variables that google-cloud-secret_manager-v1beta2 -checks for credentials are: - -* `GOOGLE_CLOUD_CREDENTIALS` - Path to JSON file, or JSON contents -* `GOOGLE_APPLICATION_CREDENTIALS` - Path to JSON file - -```ruby -require "google/cloud/secret_manager/v1beta2" - -ENV["GOOGLE_APPLICATION_CREDENTIALS"] = "path/to/credentialfile.json" - -client = ::Google::Cloud::SecretManager::V1beta2::SecretManagerService::Client.new -``` - -### Local ADC file - -You can set up a local ADC file with your user credentials for authentication during -development. If credentials are not provided in code or in environment variables, -then the local ADC credentials are discovered. - -Follow the steps in [Quickstart](#quickstart) to set up a local ADC file. - -### Google Cloud Platform environments - -When running on Google Cloud Platform (GCP), including Google Compute Engine -(GCE), Google Kubernetes Engine (GKE), Google App Engine (GAE), Google Cloud -Functions (GCF) and Cloud Run, credentials are retrieved from the attached -service account automatically. Code should be written as if already authenticated. - -For more information, see -[Set up ADC for Google Cloud services](https://cloud.google.com/docs/authentication/provide-credentials-adc#attached-sa). diff --git a/owl-bot-staging/google-cloud-secret_manager-v1beta2/CHANGELOG.md b/owl-bot-staging/google-cloud-secret_manager-v1beta2/CHANGELOG.md deleted file mode 100644 index f88957a62ba2..000000000000 --- a/owl-bot-staging/google-cloud-secret_manager-v1beta2/CHANGELOG.md +++ /dev/null @@ -1,2 +0,0 @@ -# Release History - diff --git a/owl-bot-staging/google-cloud-secret_manager-v1beta2/Gemfile b/owl-bot-staging/google-cloud-secret_manager-v1beta2/Gemfile deleted file mode 100644 index 1d08558908d8..000000000000 --- a/owl-bot-staging/google-cloud-secret_manager-v1beta2/Gemfile +++ /dev/null @@ -1,14 +0,0 @@ -source "https://rubygems.org" - -gemspec - -gem "google-style", "~> 1.32.0" -gem "irb", "~> 1.17" -gem "minitest", "~> 6.0.2" -gem "minitest-focus", "~> 1.4" -gem "minitest-mock", "~> 5.27" -gem "minitest-rg", "~> 5.3" -gem "ostruct", "~> 0.5.5" -gem "rake", ">= 13.0" -gem "redcarpet", "~> 3.6" -gem "yard", "~> 0.9" diff --git a/owl-bot-staging/google-cloud-secret_manager-v1beta2/LICENSE.md b/owl-bot-staging/google-cloud-secret_manager-v1beta2/LICENSE.md deleted file mode 100644 index c261857ba6ad..000000000000 --- a/owl-bot-staging/google-cloud-secret_manager-v1beta2/LICENSE.md +++ /dev/null @@ -1,201 +0,0 @@ - Apache License - Version 2.0, January 2004 - http://www.apache.org/licenses/ - - TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION - - 1. Definitions. - - "License" shall mean the terms and conditions for use, reproduction, - and distribution as defined by Sections 1 through 9 of this document. - - "Licensor" shall mean the copyright owner or entity authorized by - the copyright owner that is granting the License. - - "Legal Entity" shall mean the union of the acting entity and all - other entities that control, are controlled by, or are under common - control with that entity. For the purposes of this definition, - "control" means (i) the power, direct or indirect, to cause the - direction or management of such entity, whether by contract or - otherwise, or (ii) ownership of fifty percent (50%) or more of the - outstanding shares, or (iii) beneficial ownership of such entity. - - "You" (or "Your") shall mean an individual or Legal Entity - exercising permissions granted by this License. - - "Source" form shall mean the preferred form for making modifications, - including but not limited to software source code, documentation - source, and configuration files. - - "Object" form shall mean any form resulting from mechanical - transformation or translation of a Source form, including but - not limited to compiled object code, generated documentation, - and conversions to other media types. - - "Work" shall mean the work of authorship, whether in Source or - Object form, made available under the License, as indicated by a - copyright notice that is included in or attached to the work - (an example is provided in the Appendix below). - - "Derivative Works" shall mean any work, whether in Source or Object - form, that is based on (or derived from) the Work and for which the - editorial revisions, annotations, elaborations, or other modifications - represent, as a whole, an original work of authorship. For the purposes - of this License, Derivative Works shall not include works that remain - separable from, or merely link (or bind by name) to the interfaces of, - the Work and Derivative Works thereof. - - "Contribution" shall mean any work of authorship, including - the original version of the Work and any modifications or additions - to that Work or Derivative Works thereof, that is intentionally - submitted to Licensor for inclusion in the Work by the copyright owner - or by an individual or Legal Entity authorized to submit on behalf of - the copyright owner. For the purposes of this definition, "submitted" - means any form of electronic, verbal, or written communication sent - to the Licensor or its representatives, including but not limited to - communication on electronic mailing lists, source code control systems, - and issue tracking systems that are managed by, or on behalf of, the - Licensor for the purpose of discussing and improving the Work, but - excluding communication that is conspicuously marked or otherwise - designated in writing by the copyright owner as "Not a Contribution." - - "Contributor" shall mean Licensor and any individual or Legal Entity - on behalf of whom a Contribution has been received by Licensor and - subsequently incorporated within the Work. - - 2. Grant of Copyright License. Subject to the terms and conditions of - this License, each Contributor hereby grants to You a perpetual, - worldwide, non-exclusive, no-charge, royalty-free, irrevocable - copyright license to reproduce, prepare Derivative Works of, - publicly display, publicly perform, sublicense, and distribute the - Work and such Derivative Works in Source or Object form. - - 3. Grant of Patent License. Subject to the terms and conditions of - this License, each Contributor hereby grants to You a perpetual, - worldwide, non-exclusive, no-charge, royalty-free, irrevocable - (except as stated in this section) patent license to make, have made, - use, offer to sell, sell, import, and otherwise transfer the Work, - where such license applies only to those patent claims licensable - by such Contributor that are necessarily infringed by their - Contribution(s) alone or by combination of their Contribution(s) - with the Work to which such Contribution(s) was submitted. If You - institute patent litigation against any entity (including a - cross-claim or counterclaim in a lawsuit) alleging that the Work - or a Contribution incorporated within the Work constitutes direct - or contributory patent infringement, then any patent licenses - granted to You under this License for that Work shall terminate - as of the date such litigation is filed. - - 4. Redistribution. You may reproduce and distribute copies of the - Work or Derivative Works thereof in any medium, with or without - modifications, and in Source or Object form, provided that You - meet the following conditions: - - (a) You must give any other recipients of the Work or - Derivative Works a copy of this License; and - - (b) You must cause any modified files to carry prominent notices - stating that You changed the files; and - - (c) You must retain, in the Source form of any Derivative Works - that You distribute, all copyright, patent, trademark, and - attribution notices from the Source form of the Work, - excluding those notices that do not pertain to any part of - the Derivative Works; and - - (d) If the Work includes a "NOTICE" text file as part of its - distribution, then any Derivative Works that You distribute must - include a readable copy of the attribution notices contained - within such NOTICE file, excluding those notices that do not - pertain to any part of the Derivative Works, in at least one - of the following places: within a NOTICE text file distributed - as part of the Derivative Works; within the Source form or - documentation, if provided along with the Derivative Works; or, - within a display generated by the Derivative Works, if and - wherever such third-party notices normally appear. The contents - of the NOTICE file are for informational purposes only and - do not modify the License. You may add Your own attribution - notices within Derivative Works that You distribute, alongside - or as an addendum to the NOTICE text from the Work, provided - that such additional attribution notices cannot be construed - as modifying the License. - - You may add Your own copyright statement to Your modifications and - may provide additional or different license terms and conditions - for use, reproduction, or distribution of Your modifications, or - for any such Derivative Works as a whole, provided Your use, - reproduction, and distribution of the Work otherwise complies with - the conditions stated in this License. - - 5. Submission of Contributions. Unless You explicitly state otherwise, - any Contribution intentionally submitted for inclusion in the Work - by You to the Licensor shall be under the terms and conditions of - this License, without any additional terms or conditions. - Notwithstanding the above, nothing herein shall supersede or modify - the terms of any separate license agreement you may have executed - with Licensor regarding such Contributions. - - 6. Trademarks. This License does not grant permission to use the trade - names, trademarks, service marks, or product names of the Licensor, - except as required for reasonable and customary use in describing the - origin of the Work and reproducing the content of the NOTICE file. - - 7. Disclaimer of Warranty. Unless required by applicable law or - agreed to in writing, Licensor provides the Work (and each - Contributor provides its Contributions) on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or - implied, including, without limitation, any warranties or conditions - of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A - PARTICULAR PURPOSE. You are solely responsible for determining the - appropriateness of using or redistributing the Work and assume any - risks associated with Your exercise of permissions under this License. - - 8. Limitation of Liability. In no event and under no legal theory, - whether in tort (including negligence), contract, or otherwise, - unless required by applicable law (such as deliberate and grossly - negligent acts) or agreed to in writing, shall any Contributor be - liable to You for damages, including any direct, indirect, special, - incidental, or consequential damages of any character arising as a - result of this License or out of the use or inability to use the - Work (including but not limited to damages for loss of goodwill, - work stoppage, computer failure or malfunction, or any and all - other commercial damages or losses), even if such Contributor - has been advised of the possibility of such damages. - - 9. Accepting Warranty or Additional Liability. While redistributing - the Work or Derivative Works thereof, You may choose to offer, - and charge a fee for, acceptance of support, warranty, indemnity, - or other liability obligations and/or rights consistent with this - License. However, in accepting such obligations, You may act only - on Your own behalf and on Your sole responsibility, not on behalf - of any other Contributor, and only if You agree to indemnify, - defend, and hold each Contributor harmless for any liability - incurred by, or claims asserted against, such Contributor by reason - of your accepting any such warranty or additional liability. - - END OF TERMS AND CONDITIONS - - APPENDIX: How to apply the Apache License to your work. - - To apply the Apache License to your work, attach the following - boilerplate notice, with the fields enclosed by brackets "[]" - replaced with your own identifying information. (Don't include - the brackets!) The text should be enclosed in the appropriate - comment syntax for the file format. We also recommend that a - file or class name and description of purpose be included on the - same "printed page" as the copyright notice for easier - identification within third-party archives. - - Copyright [yyyy] [name of copyright owner] - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. diff --git a/owl-bot-staging/google-cloud-secret_manager-v1beta2/README.md b/owl-bot-staging/google-cloud-secret_manager-v1beta2/README.md deleted file mode 100644 index cd878fb849e0..000000000000 --- a/owl-bot-staging/google-cloud-secret_manager-v1beta2/README.md +++ /dev/null @@ -1,154 +0,0 @@ -# Ruby Client for the Secret Manager V1BETA2 API - -Stores sensitive data such as API keys, passwords, and certificates. Provides convenience while improving security. - -Secret Manager Overview. - -https://github.com/googleapis/google-cloud-ruby - -This gem is a _versioned_ client. It provides basic client classes for a -specific version of the Secret Manager V1BETA2 API. Most users should consider using -the main client gem, -[google-cloud-secret_manager](https://rubygems.org/gems/google-cloud-secret_manager). -See the section below titled *Which client should I use?* for more information. - -## Installation - -``` -$ gem install google-cloud-secret_manager-v1beta2 -``` - -## Before You Begin - -In order to use this library, you first need to go through the following steps: - -1. [Select or create a Cloud Platform project.](https://console.cloud.google.com/project) -1. [Enable billing for your project.](https://cloud.google.com/billing/docs/how-to/modify-project#enable_billing_for_a_project) -1. [Enable the API.](https://console.cloud.google.com/apis/library/secretmanager.googleapis.com) -1. [Set up authentication.](AUTHENTICATION.md) - -## Quick Start - -```ruby -require "google/cloud/secret_manager/v1beta2" - -client = ::Google::Cloud::SecretManager::V1beta2::SecretManagerService::Client.new -request = ::Google::Cloud::SecretManager::V1beta2::ListSecretsRequest.new # (request fields as keyword arguments...) -response = client.list_secrets request -``` - -View the [Client Library Documentation](https://cloud.google.com/ruby/docs/reference/google-cloud-secret_manager-v1beta2/latest) -for class and method documentation. - -See also the [Product Documentation](https://cloud.google.com/secret-manager) -for general usage information. - -## Debug Logging - -This library comes with opt-in Debug Logging that can help you troubleshoot -your application's integration with the API. When logging is activated, key -events such as requests and responses, along with data payloads and metadata -such as headers and client configuration, are logged to the standard error -stream. - -**WARNING:** Client Library Debug Logging includes your data payloads in -plaintext, which could include sensitive data such as PII for yourself or your -customers, private keys, or other security data that could be compromising if -leaked. Always practice good data hygiene with your application logs, and follow -the principle of least access. Google also recommends that Client Library Debug -Logging be enabled only temporarily during active debugging, and not used -permanently in production. - -To enable logging, set the environment variable `GOOGLE_SDK_RUBY_LOGGING_GEMS` -to the value `all`. Alternatively, you can set the value to a comma-delimited -list of client library gem names. This will select the default logging behavior, -which writes logs to the standard error stream. On a local workstation, this may -result in logs appearing on the console. When running on a Google Cloud hosting -service such as [Google Cloud Run](https://cloud.google.com/run), this generally -results in logs appearing alongside your application logs in the -[Google Cloud Logging](https://cloud.google.com/logging/) service. - -You can customize logging by modifying the `logger` configuration when -constructing a client object. For example: - -```ruby -require "google/cloud/secret_manager/v1beta2" -require "logger" - -client = ::Google::Cloud::SecretManager::V1beta2::SecretManagerService::Client.new do |config| - config.logger = Logger.new "my-app.log" -end -``` - -## Google Cloud Samples - -To browse ready to use code samples check [Google Cloud Samples](https://cloud.google.com/docs/samples). - -## Supported Ruby Versions - -This library is supported on Ruby 3.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-secret_manager`, -and lower-level _versioned_ client libraries with names such as -`google-cloud-secret_manager-v1beta2`. -_In most cases, you should install the main client._ - -### What's the difference between the main client and a versioned client? - -A _versioned client_ provides a basic set of data types and client classes for -a _single version_ of a specific service. (That is, for a service with multiple -versions, there might be a separate versioned client for each service version.) -Most versioned clients are written and maintained by a code generator. - -The _main client_ is designed to provide you with the _recommended_ client -interfaces for the service. There will be only one main client for any given -service, even a service with multiple versions. The main client includes -factory methods for constructing the client objects we recommend for most -users. In some cases, those will be classes provided by an underlying versioned -client; in other cases, they will be handwritten higher-level client objects -with additional capabilities, convenience methods, or best practices built in. -Generally, the main client will default to a recommended service version, -although in some cases you can override this if you need to talk to a specific -service version. - -### Why would I want to use the main client? - -We recommend that most users install the main client gem for a service. You can -identify this gem as the one _without_ a version in its name, e.g. -`google-cloud-secret_manager`. -The main client is recommended because it will embody the best practices for -accessing the service, and may also provide more convenient interfaces or -tighter integration into frameworks and third-party libraries. In addition, the -documentation and samples published by Google will generally demonstrate use of -the main client. - -### Why would I want to use a versioned client? - -You can use a versioned client if you are content with a possibly lower-level -class interface, you explicitly want to avoid features provided by the main -client, or you want to access a specific service version not be covered by the -main client. You can identify versioned client gems because the service version -is part of the name, e.g. `google-cloud-secret_manager-v1beta2`. - -### What about the google-apis- clients? - -Client library gems with names that begin with `google-apis-` are based on an -older code generation technology. They talk to a REST/JSON backend (whereas -most modern clients talk to a [gRPC](https://grpc.io/) backend) and they may -not offer the same performance, features, and ease of use provided by more -modern clients. - -The `google-apis-` clients have wide coverage across Google services, so you -might need to use one if there is no modern client available for the service. -However, if a modern client is available, we generally recommend it over the -older `google-apis-` clients. diff --git a/owl-bot-staging/google-cloud-secret_manager-v1beta2/Rakefile b/owl-bot-staging/google-cloud-secret_manager-v1beta2/Rakefile deleted file mode 100644 index b1cfc54cac77..000000000000 --- a/owl-bot-staging/google-cloud-secret_manager-v1beta2/Rakefile +++ /dev/null @@ -1,169 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -require "bundler/setup" -require "bundler/gem_tasks" - -require "rubocop/rake_task" -RuboCop::RakeTask.new - -require "rake/testtask" -desc "Run tests." -Rake::TestTask.new do |t| - t.libs << "test" - t.test_files = FileList["test/**/*_test.rb"] - t.warning = false -end - -desc "Runs the smoke tests." -Rake::TestTask.new :smoke_test do |t| - t.test_files = FileList["acceptance/**/*smoke_test.rb"] - t.warning = false -end - -# Acceptance tests -desc "Run the google-cloud-secret_manager-v1beta2 acceptance tests." -task :acceptance, :project, :keyfile do |t, args| - project = args[:project] - project ||= - ENV["SECRET_MANAGER_TEST_PROJECT"] || - ENV["GCLOUD_TEST_PROJECT"] - keyfile = args[:keyfile] - keyfile ||= - ENV["SECRET_MANAGER_TEST_KEYFILE"] || - ENV["GCLOUD_TEST_KEYFILE"] - if keyfile - keyfile = File.read keyfile - else - keyfile ||= - ENV["SECRET_MANAGER_TEST_KEYFILE_JSON"] || - ENV["GCLOUD_TEST_KEYFILE_JSON"] - end - if project.nil? || keyfile.nil? - fail "You must provide a project and keyfile. e.g. rake acceptance[test123, /path/to/keyfile.json] or SECRET_MANAGER_TEST_PROJECT=test123 SECRET_MANAGER_TEST_KEYFILE=/path/to/keyfile.json rake acceptance" - end - require "google/cloud/secret_manager/v1beta2/secret_manager_service/credentials" - ::Google::Cloud::SecretManager::V1beta2::SecretManagerService::Credentials.env_vars.each do |path| - ENV[path] = nil - end - ENV["SECRET_MANAGER_PROJECT"] = project - ENV["SECRET_MANAGER_TEST_PROJECT"] = project - ENV["SECRET_MANAGER_KEYFILE_JSON"] = keyfile - - Rake::Task["acceptance:run"].invoke -end - -namespace :acceptance do - task :run do - if File.directory? "acceptance" - Rake::Task[:smoke_test].invoke - else - puts "The google-cloud-secret_manager-v1beta2 gem has no acceptance tests." - end - end - - desc "Run acceptance cleanup." - task :cleanup do - end -end - -task :samples do - Rake::Task["samples:latest"].invoke -end - -namespace :samples do - task :latest do - if File.directory? "samples" - Dir.chdir "samples" do - Bundler.with_clean_env do - ENV["GOOGLE_CLOUD_SAMPLES_TEST"] = "not_master" - sh "bundle update" - sh "bundle exec rake test" - end - end - else - puts "The google-cloud-secret_manager-v1beta2 gem has no samples to test." - end - end - - task :master do - if File.directory? "samples" - Dir.chdir "samples" do - Bundler.with_clean_env do - ENV["GOOGLE_CLOUD_SAMPLES_TEST"] = "master" - sh "bundle update" - sh "bundle exec rake test" - end - end - else - puts "The google-cloud-secret_manager-v1beta2 gem has no samples to test." - end - end -end - -require "yard" -require "yard/rake/yardoc_task" -YARD::Rake::YardocTask.new do |y| - y.options << "--fail-on-warning" -end - -desc "Run yard-doctest example tests." -task :doctest do - puts "The google-cloud-secret_manager-v1beta2 gem does not have doctest tests." -end - -desc "Run the CI build" -task :ci do - header "BUILDING google-cloud-secret_manager-v1beta2" - header "google-cloud-secret_manager-v1beta2 rubocop", "*" - Rake::Task[:rubocop].invoke - header "google-cloud-secret_manager-v1beta2 yard", "*" - Rake::Task[:yard].invoke - header "google-cloud-secret_manager-v1beta2 test", "*" - Rake::Task[:test].invoke -end - -namespace :ci do - desc "Run the CI build, with smoke tests." - task :smoke_test do - Rake::Task[:ci].invoke - header "google-cloud-secret_manager-v1beta2 smoke_test", "*" - Rake::Task[:smoke_test].invoke - end - desc "Run the CI build, with acceptance tests." - task :acceptance do - Rake::Task[:ci].invoke - header "google-cloud-secret_manager-v1beta2 acceptance", "*" - Rake::Task[:acceptance].invoke - end - task :a do - # This is a handy shortcut to save typing - Rake::Task["ci:acceptance"].invoke - end -end - -task default: :test - -def header str, token = "#" - line_length = str.length + 8 - puts "" - puts token * line_length - puts "#{token * 3} #{str} #{token * 3}" - puts token * line_length - puts "" -end diff --git a/owl-bot-staging/google-cloud-secret_manager-v1beta2/gapic_metadata.json b/owl-bot-staging/google-cloud-secret_manager-v1beta2/gapic_metadata.json deleted file mode 100644 index fd910a3daa8c..000000000000 --- a/owl-bot-staging/google-cloud-secret_manager-v1beta2/gapic_metadata.json +++ /dev/null @@ -1,93 +0,0 @@ -{ - "schema": "1.0", - "comment": "This file maps proto services/RPCs to the corresponding library clients/methods", - "language": "ruby", - "protoPackage": "google.cloud.secretmanager.v1beta2", - "libraryPackage": "::Google::Cloud::SecretManager::V1beta2", - "services": { - "SecretManagerService": { - "clients": { - "grpc": { - "libraryClient": "::Google::Cloud::SecretManager::V1beta2::SecretManagerService::Client", - "rpcs": { - "ListSecrets": { - "methods": [ - "list_secrets" - ] - }, - "CreateSecret": { - "methods": [ - "create_secret" - ] - }, - "AddSecretVersion": { - "methods": [ - "add_secret_version" - ] - }, - "GetSecret": { - "methods": [ - "get_secret" - ] - }, - "UpdateSecret": { - "methods": [ - "update_secret" - ] - }, - "DeleteSecret": { - "methods": [ - "delete_secret" - ] - }, - "ListSecretVersions": { - "methods": [ - "list_secret_versions" - ] - }, - "GetSecretVersion": { - "methods": [ - "get_secret_version" - ] - }, - "AccessSecretVersion": { - "methods": [ - "access_secret_version" - ] - }, - "DisableSecretVersion": { - "methods": [ - "disable_secret_version" - ] - }, - "EnableSecretVersion": { - "methods": [ - "enable_secret_version" - ] - }, - "DestroySecretVersion": { - "methods": [ - "destroy_secret_version" - ] - }, - "SetIamPolicy": { - "methods": [ - "set_iam_policy" - ] - }, - "GetIamPolicy": { - "methods": [ - "get_iam_policy" - ] - }, - "TestIamPermissions": { - "methods": [ - "test_iam_permissions" - ] - } - } - } - } - } - } -} diff --git a/owl-bot-staging/google-cloud-secret_manager-v1beta2/google-cloud-secret_manager-v1beta2.gemspec b/owl-bot-staging/google-cloud-secret_manager-v1beta2/google-cloud-secret_manager-v1beta2.gemspec deleted file mode 100644 index f091f7cde6d0..000000000000 --- a/owl-bot-staging/google-cloud-secret_manager-v1beta2/google-cloud-secret_manager-v1beta2.gemspec +++ /dev/null @@ -1,30 +0,0 @@ -# -*- ruby -*- -# encoding: utf-8 - -require File.expand_path("lib/google/cloud/secret_manager/v1beta2/version", __dir__) - -Gem::Specification.new do |gem| - gem.name = "google-cloud-secret_manager-v1beta2" - gem.version = Google::Cloud::SecretManager::V1beta2::VERSION - - gem.authors = ["Google LLC"] - gem.email = "googleapis-packages@google.com" - gem.description = "Secret Manager Overview. Note that google-cloud-secret_manager-v1beta2 is a version-specific client library. For most uses, we recommend installing the main client library google-cloud-secret_manager instead. See the readme for more details." - gem.summary = "Stores sensitive data such as API keys, passwords, and certificates. Provides convenience while improving security." - gem.homepage = "https://github.com/googleapis/google-cloud-ruby" - gem.license = "Apache-2.0" - - gem.platform = Gem::Platform::RUBY - - gem.files = `git ls-files -- lib/*`.split("\n") + - `git ls-files -- proto_docs/*`.split("\n") + - ["README.md", "LICENSE.md", "AUTHENTICATION.md", ".yardopts"] - gem.require_paths = ["lib"] - - gem.required_ruby_version = ">= 3.2" - - gem.add_dependency "gapic-common", "~> 1.2" - gem.add_dependency "google-cloud-errors", "~> 1.0" - gem.add_dependency "google-cloud-location", "~> 1.0" - gem.add_dependency "grpc-google-iam-v1", "~> 1.11" -end diff --git a/owl-bot-staging/google-cloud-secret_manager-v1beta2/lib/google-cloud-secret_manager-v1beta2.rb b/owl-bot-staging/google-cloud-secret_manager-v1beta2/lib/google-cloud-secret_manager-v1beta2.rb deleted file mode 100644 index 4fa698942ce3..000000000000 --- a/owl-bot-staging/google-cloud-secret_manager-v1beta2/lib/google-cloud-secret_manager-v1beta2.rb +++ /dev/null @@ -1,21 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -# This gem does not autoload during Bundler.require. To load this gem, -# issue explicit require statements for the packages desired, e.g.: -# require "google/cloud/secret_manager/v1beta2" diff --git a/owl-bot-staging/google-cloud-secret_manager-v1beta2/lib/google/cloud/secret_manager/v1beta2.rb b/owl-bot-staging/google-cloud-secret_manager-v1beta2/lib/google/cloud/secret_manager/v1beta2.rb deleted file mode 100644 index 094bfb8e6d20..000000000000 --- a/owl-bot-staging/google-cloud-secret_manager-v1beta2/lib/google/cloud/secret_manager/v1beta2.rb +++ /dev/null @@ -1,45 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -require "google/cloud/secret_manager/v1beta2/secret_manager_service" -require "google/cloud/secret_manager/v1beta2/version" - -module Google - module Cloud - module SecretManager - ## - # API client module. - # - # @example Load this package, including all its services, and instantiate a gRPC client - # - # require "google/cloud/secret_manager/v1beta2" - # client = ::Google::Cloud::SecretManager::V1beta2::SecretManagerService::Client.new - # - # @example Load this package, including all its services, and instantiate a REST client - # - # require "google/cloud/secret_manager/v1beta2" - # client = ::Google::Cloud::SecretManager::V1beta2::SecretManagerService::Rest::Client.new - # - module V1beta2 - end - end - end -end - -helper_path = ::File.join __dir__, "v1beta2", "_helpers.rb" -require "google/cloud/secret_manager/v1beta2/_helpers" if ::File.file? helper_path diff --git a/owl-bot-staging/google-cloud-secret_manager-v1beta2/lib/google/cloud/secret_manager/v1beta2/bindings_override.rb b/owl-bot-staging/google-cloud-secret_manager-v1beta2/lib/google/cloud/secret_manager/v1beta2/bindings_override.rb deleted file mode 100644 index 2cb21f372d4d..000000000000 --- a/owl-bot-staging/google-cloud-secret_manager-v1beta2/lib/google/cloud/secret_manager/v1beta2/bindings_override.rb +++ /dev/null @@ -1,75 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -require "gapic/rest" - -module Google - module Cloud - module SecretManager - ## - # @example Loading just the REST part of this package, including all its services, and instantiating a REST client - # - # require "google/cloud/secret_manager/v1beta2/rest" - # client = ::Google::Cloud::SecretManager::V1beta2::SecretManagerService::Rest::Client.new - # - module V1beta2 - ## - # @private - # Initialize the mixin bindings configuration - # - def self.configure - @configure ||= begin - namespace = ["Google", "Cloud", "SecretManager"] - parent_config = while namespace.any? - parent_name = namespace.join "::" - parent_const = const_get parent_name - break parent_const.configure if parent_const.respond_to? :configure - namespace.pop - end - - default_config = ::Gapic::Rest::HttpBindingOverrideConfiguration.new parent_config - default_config.bindings_override["google.cloud.location.Locations.GetLocation"] = [ - Gapic::Rest::GrpcTranscoder::HttpBinding.create_with_validation( - uri_method: :get, - uri_template: "/v1beta2/{name}", - matches: [ - ["name", %r{^projects/[^/]+/locations/[^/]+/?$}, false] - ], - body: nil - ) - ] - default_config.bindings_override["google.cloud.location.Locations.ListLocations"] = [ - - Gapic::Rest::GrpcTranscoder::HttpBinding.create_with_validation( - uri_method: :get, - uri_template: "/v1beta2/{name}/locations", - matches: [ - ["name", %r{^projects/[^/]+/?$}, false] - ], - body: nil - ) - ] - default_config - end - yield @configure if block_given? - @configure - end - end - end - end -end diff --git a/owl-bot-staging/google-cloud-secret_manager-v1beta2/lib/google/cloud/secret_manager/v1beta2/rest.rb b/owl-bot-staging/google-cloud-secret_manager-v1beta2/lib/google/cloud/secret_manager/v1beta2/rest.rb deleted file mode 100644 index 4581b5c14be0..000000000000 --- a/owl-bot-staging/google-cloud-secret_manager-v1beta2/lib/google/cloud/secret_manager/v1beta2/rest.rb +++ /dev/null @@ -1,38 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -require "google/cloud/secret_manager/v1beta2/secret_manager_service/rest" -require "google/cloud/secret_manager/v1beta2/bindings_override" -require "google/cloud/secret_manager/v1beta2/version" - -module Google - module Cloud - module SecretManager - ## - # To load just the REST part of this package, including all its services, and instantiate a REST client: - # - # @example - # - # require "google/cloud/secret_manager/v1beta2/rest" - # client = ::Google::Cloud::SecretManager::V1beta2::SecretManagerService::Rest::Client.new - # - module V1beta2 - end - end - end -end diff --git a/owl-bot-staging/google-cloud-secret_manager-v1beta2/lib/google/cloud/secret_manager/v1beta2/secret_manager_service.rb b/owl-bot-staging/google-cloud-secret_manager-v1beta2/lib/google/cloud/secret_manager/v1beta2/secret_manager_service.rb deleted file mode 100644 index 5200a70afe3b..000000000000 --- a/owl-bot-staging/google-cloud-secret_manager-v1beta2/lib/google/cloud/secret_manager/v1beta2/secret_manager_service.rb +++ /dev/null @@ -1,61 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -require "gapic/common" -require "gapic/config" -require "gapic/config/method" - -require "google/cloud/secret_manager/v1beta2/version" - -require "google/cloud/secret_manager/v1beta2/secret_manager_service/credentials" -require "google/cloud/secret_manager/v1beta2/secret_manager_service/paths" -require "google/cloud/secret_manager/v1beta2/secret_manager_service/client" -require "google/cloud/secret_manager/v1beta2/secret_manager_service/rest" - -module Google - module Cloud - module SecretManager - module V1beta2 - ## - # Secret Manager Service - # - # Manages secrets and operations using those secrets. Implements a REST - # model with the following objects: - # - # * {::Google::Cloud::SecretManager::V1beta2::Secret Secret} - # * {::Google::Cloud::SecretManager::V1beta2::SecretVersion SecretVersion} - # - # @example Load this service and instantiate a gRPC client - # - # require "google/cloud/secret_manager/v1beta2/secret_manager_service" - # client = ::Google::Cloud::SecretManager::V1beta2::SecretManagerService::Client.new - # - # @example Load this service and instantiate a REST client - # - # require "google/cloud/secret_manager/v1beta2/secret_manager_service/rest" - # client = ::Google::Cloud::SecretManager::V1beta2::SecretManagerService::Rest::Client.new - # - module SecretManagerService - end - end - end - end -end - -helper_path = ::File.join __dir__, "secret_manager_service", "helpers.rb" -require "google/cloud/secret_manager/v1beta2/secret_manager_service/helpers" if ::File.file? helper_path diff --git a/owl-bot-staging/google-cloud-secret_manager-v1beta2/lib/google/cloud/secret_manager/v1beta2/secret_manager_service/client.rb b/owl-bot-staging/google-cloud-secret_manager-v1beta2/lib/google/cloud/secret_manager/v1beta2/secret_manager_service/client.rb deleted file mode 100644 index 88688702fcb1..000000000000 --- a/owl-bot-staging/google-cloud-secret_manager-v1beta2/lib/google/cloud/secret_manager/v1beta2/secret_manager_service/client.rb +++ /dev/null @@ -1,1996 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -require "google/cloud/errors" -require "google/cloud/secretmanager/v1beta2/service_pb" -require "google/cloud/location" - -module Google - module Cloud - module SecretManager - module V1beta2 - module SecretManagerService - ## - # Client for the SecretManagerService service. - # - # Secret Manager Service - # - # Manages secrets and operations using those secrets. Implements a REST - # model with the following objects: - # - # * {::Google::Cloud::SecretManager::V1beta2::Secret Secret} - # * {::Google::Cloud::SecretManager::V1beta2::SecretVersion SecretVersion} - # - class Client - # @private - API_VERSION = "" - - # @private - DEFAULT_ENDPOINT_TEMPLATE = "secretmanager.$UNIVERSE_DOMAIN$" - - include Paths - - # @private - attr_reader :secret_manager_service_stub - - ## - # Configure the SecretManagerService Client class. - # - # See {::Google::Cloud::SecretManager::V1beta2::SecretManagerService::Client::Configuration} - # for a description of the configuration fields. - # - # @example - # - # # Modify the configuration for all SecretManagerService clients - # ::Google::Cloud::SecretManager::V1beta2::SecretManagerService::Client.configure do |config| - # config.timeout = 10.0 - # end - # - # @yield [config] Configure the Client client. - # @yieldparam config [Client::Configuration] - # - # @return [Client::Configuration] - # - def self.configure - @configure ||= begin - namespace = ["Google", "Cloud", "SecretManager", "V1beta2"] - parent_config = while namespace.any? - parent_name = namespace.join "::" - parent_const = const_get parent_name - break parent_const.configure if parent_const.respond_to? :configure - namespace.pop - end - default_config = Client::Configuration.new parent_config - - default_config.rpcs.list_secrets.timeout = 60.0 - - default_config.rpcs.create_secret.timeout = 60.0 - - default_config.rpcs.add_secret_version.timeout = 60.0 - - default_config.rpcs.get_secret.timeout = 60.0 - - default_config.rpcs.update_secret.timeout = 60.0 - - default_config.rpcs.delete_secret.timeout = 60.0 - - default_config.rpcs.list_secret_versions.timeout = 60.0 - - default_config.rpcs.get_secret_version.timeout = 60.0 - - default_config.rpcs.access_secret_version.timeout = 60.0 - default_config.rpcs.access_secret_version.retry_policy = { - initial_delay: 2.0, max_delay: 60.0, multiplier: 2.0, retry_codes: [14, 8] - } - - default_config.rpcs.disable_secret_version.timeout = 60.0 - - default_config.rpcs.enable_secret_version.timeout = 60.0 - - default_config.rpcs.destroy_secret_version.timeout = 60.0 - - default_config.rpcs.set_iam_policy.timeout = 60.0 - - default_config.rpcs.get_iam_policy.timeout = 60.0 - - default_config.rpcs.test_iam_permissions.timeout = 60.0 - - default_config - end - yield @configure if block_given? - @configure - end - - ## - # Configure the SecretManagerService Client instance. - # - # The configuration is set to the derived mode, meaning that values can be changed, - # but structural changes (adding new fields, etc.) are not allowed. Structural changes - # should be made on {Client.configure}. - # - # See {::Google::Cloud::SecretManager::V1beta2::SecretManagerService::Client::Configuration} - # for a description of the configuration fields. - # - # @yield [config] Configure the Client client. - # @yieldparam config [Client::Configuration] - # - # @return [Client::Configuration] - # - def configure - yield @config if block_given? - @config - end - - ## - # The effective universe domain - # - # @return [String] - # - def universe_domain - @secret_manager_service_stub.universe_domain - end - - ## - # Create a new SecretManagerService client object. - # - # @example - # - # # Create a client using the default configuration - # client = ::Google::Cloud::SecretManager::V1beta2::SecretManagerService::Client.new - # - # # Create a client using a custom configuration - # client = ::Google::Cloud::SecretManager::V1beta2::SecretManagerService::Client.new do |config| - # config.timeout = 10.0 - # end - # - # @yield [config] Configure the SecretManagerService client. - # @yieldparam config [Client::Configuration] - # - def initialize - # These require statements are intentionally placed here to initialize - # the gRPC module only when it's required. - # See https://github.com/googleapis/toolkit/issues/446 - require "gapic/grpc" - require "google/cloud/secretmanager/v1beta2/service_services_pb" - - # Create the configuration object - @config = Configuration.new Client.configure - - # Yield the configuration if needed - yield @config if block_given? - - # Create credentials - credentials = @config.credentials - # Use self-signed JWT if the endpoint is unchanged from default, - # but only if the default endpoint does not have a region prefix. - enable_self_signed_jwt = @config.endpoint.nil? || - (@config.endpoint == Configuration::DEFAULT_ENDPOINT && - !@config.endpoint.split(".").first.include?("-")) - credentials ||= Credentials.default scope: @config.scope, - enable_self_signed_jwt: enable_self_signed_jwt - if credentials.is_a?(::String) || credentials.is_a?(::Hash) - credentials = Credentials.new credentials, scope: @config.scope - end - @quota_project_id = @config.quota_project - @quota_project_id ||= credentials.quota_project_id if credentials.respond_to? :quota_project_id - - @secret_manager_service_stub = ::Gapic::ServiceStub.new( - ::Google::Cloud::SecretManager::V1beta2::SecretManagerService::Stub, - credentials: credentials, - endpoint: @config.endpoint, - endpoint_template: DEFAULT_ENDPOINT_TEMPLATE, - universe_domain: @config.universe_domain, - channel_args: @config.channel_args, - interceptors: @config.interceptors, - channel_pool_config: @config.channel_pool, - logger: @config.logger - ) - - @secret_manager_service_stub.stub_logger&.info do |entry| - entry.set_system_name - entry.set_service - entry.message = "Created client for #{entry.service}" - entry.set_credentials_fields credentials - entry.set "customEndpoint", @config.endpoint if @config.endpoint - entry.set "defaultTimeout", @config.timeout if @config.timeout - entry.set "quotaProject", @quota_project_id if @quota_project_id - end - - @location_client = Google::Cloud::Location::Locations::Client.new do |config| - config.credentials = credentials - config.quota_project = @quota_project_id - config.endpoint = @secret_manager_service_stub.endpoint - config.universe_domain = @secret_manager_service_stub.universe_domain - config.logger = @secret_manager_service_stub.logger if config.respond_to? :logger= - end - end - - ## - # Get the associated client for mix-in of the Locations. - # - # @return [Google::Cloud::Location::Locations::Client] - # - attr_reader :location_client - - ## - # The logger used for request/response debug logging. - # - # @return [Logger] - # - def logger - @secret_manager_service_stub.logger - end - - # Service calls - - ## - # Lists {::Google::Cloud::SecretManager::V1beta2::Secret Secrets}. - # - # @overload list_secrets(request, options = nil) - # Pass arguments to `list_secrets` via a request object, either of type - # {::Google::Cloud::SecretManager::V1beta2::ListSecretsRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::SecretManager::V1beta2::ListSecretsRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. - # - # @overload list_secrets(parent: nil, page_size: nil, page_token: nil, filter: nil) - # Pass arguments to `list_secrets` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param parent [::String] - # Required. The resource name of the project associated with the - # {::Google::Cloud::SecretManager::V1beta2::Secret Secrets}, in the format - # `projects/*` or `projects/*/locations/*` - # @param page_size [::Integer] - # Optional. The maximum number of results to be returned in a single page. If - # set to 0, the server decides the number of results to return. If the - # number is greater than 25000, it is capped at 25000. - # @param page_token [::String] - # Optional. Pagination token, returned earlier via - # {::Google::Cloud::SecretManager::V1beta2::ListSecretsResponse#next_page_token ListSecretsResponse.next_page_token}. - # @param filter [::String] - # Optional. Filter string, adhering to the rules in - # [List-operation - # filtering](https://cloud.google.com/secret-manager/docs/filtering). List - # only secrets matching the filter. If filter is empty, all secrets are - # listed. - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Gapic::PagedEnumerable<::Google::Cloud::SecretManager::V1beta2::Secret>] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Gapic::PagedEnumerable<::Google::Cloud::SecretManager::V1beta2::Secret>] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/cloud/secret_manager/v1beta2" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::SecretManager::V1beta2::SecretManagerService::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::SecretManager::V1beta2::ListSecretsRequest.new - # - # # Call the list_secrets method. - # result = client.list_secrets request - # - # # The returned object is of type Gapic::PagedEnumerable. You can iterate - # # over elements, and API calls will be issued to fetch pages as needed. - # result.each do |item| - # # Each element is of type ::Google::Cloud::SecretManager::V1beta2::Secret. - # p item - # end - # - def list_secrets request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::SecretManager::V1beta2::ListSecretsRequest - - # Converts hash and nil to an options object - options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h - - # Customize the options with defaults - metadata = @config.rpcs.list_secrets.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::SecretManager::V1beta2::VERSION - metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - header_params = {} - if request.parent - header_params["parent"] = request.parent - end - - request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") - metadata[:"x-goog-request-params"] ||= request_params_header - - options.apply_defaults timeout: @config.rpcs.list_secrets.timeout, - metadata: metadata, - retry_policy: @config.rpcs.list_secrets.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @secret_manager_service_stub.call_rpc :list_secrets, request, options: options do |response, operation| - response = ::Gapic::PagedEnumerable.new @secret_manager_service_stub, :list_secrets, request, response, operation, options - yield response, operation if block_given? - throw :response, response - end - rescue ::GRPC::BadStatus => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Creates a new {::Google::Cloud::SecretManager::V1beta2::Secret Secret} - # containing no - # {::Google::Cloud::SecretManager::V1beta2::SecretVersion SecretVersions}. - # - # @overload create_secret(request, options = nil) - # Pass arguments to `create_secret` via a request object, either of type - # {::Google::Cloud::SecretManager::V1beta2::CreateSecretRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::SecretManager::V1beta2::CreateSecretRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. - # - # @overload create_secret(parent: nil, secret_id: nil, secret: nil) - # Pass arguments to `create_secret` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param parent [::String] - # Required. The resource name of the project to associate with the - # {::Google::Cloud::SecretManager::V1beta2::Secret Secret}, in the format - # `projects/*` or `projects/*/locations/*`. - # @param secret_id [::String] - # Required. This must be unique within the project. - # - # A secret ID is a string with a maximum length of 255 characters and can - # contain uppercase and lowercase letters, numerals, and the hyphen (`-`) and - # underscore (`_`) characters. - # @param secret [::Google::Cloud::SecretManager::V1beta2::Secret, ::Hash] - # Required. A {::Google::Cloud::SecretManager::V1beta2::Secret Secret} with - # initial field values. - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Google::Cloud::SecretManager::V1beta2::Secret] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Google::Cloud::SecretManager::V1beta2::Secret] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/cloud/secret_manager/v1beta2" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::SecretManager::V1beta2::SecretManagerService::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::SecretManager::V1beta2::CreateSecretRequest.new - # - # # Call the create_secret method. - # result = client.create_secret request - # - # # The returned object is of type Google::Cloud::SecretManager::V1beta2::Secret. - # p result - # - def create_secret request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::SecretManager::V1beta2::CreateSecretRequest - - # Converts hash and nil to an options object - options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h - - # Customize the options with defaults - metadata = @config.rpcs.create_secret.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::SecretManager::V1beta2::VERSION - metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - header_params = {} - if request.parent - header_params["parent"] = request.parent - end - - request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") - metadata[:"x-goog-request-params"] ||= request_params_header - - options.apply_defaults timeout: @config.rpcs.create_secret.timeout, - metadata: metadata, - retry_policy: @config.rpcs.create_secret.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @secret_manager_service_stub.call_rpc :create_secret, request, options: options do |response, operation| - yield response, operation if block_given? - end - rescue ::GRPC::BadStatus => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Creates a new - # {::Google::Cloud::SecretManager::V1beta2::SecretVersion SecretVersion} - # containing secret data and attaches it to an existing - # {::Google::Cloud::SecretManager::V1beta2::Secret Secret}. - # - # @overload add_secret_version(request, options = nil) - # Pass arguments to `add_secret_version` via a request object, either of type - # {::Google::Cloud::SecretManager::V1beta2::AddSecretVersionRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::SecretManager::V1beta2::AddSecretVersionRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. - # - # @overload add_secret_version(parent: nil, payload: nil) - # Pass arguments to `add_secret_version` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param parent [::String] - # Required. The resource name of the - # {::Google::Cloud::SecretManager::V1beta2::Secret Secret} to associate with the - # {::Google::Cloud::SecretManager::V1beta2::SecretVersion SecretVersion} in the - # format `projects/*/secrets/*` or `projects/*/locations/*/secrets/*`. - # @param payload [::Google::Cloud::SecretManager::V1beta2::SecretPayload, ::Hash] - # Required. The secret payload of the - # {::Google::Cloud::SecretManager::V1beta2::SecretVersion SecretVersion}. - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Google::Cloud::SecretManager::V1beta2::SecretVersion] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Google::Cloud::SecretManager::V1beta2::SecretVersion] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/cloud/secret_manager/v1beta2" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::SecretManager::V1beta2::SecretManagerService::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::SecretManager::V1beta2::AddSecretVersionRequest.new - # - # # Call the add_secret_version method. - # result = client.add_secret_version request - # - # # The returned object is of type Google::Cloud::SecretManager::V1beta2::SecretVersion. - # p result - # - def add_secret_version request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::SecretManager::V1beta2::AddSecretVersionRequest - - # Converts hash and nil to an options object - options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h - - # Customize the options with defaults - metadata = @config.rpcs.add_secret_version.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::SecretManager::V1beta2::VERSION - metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - header_params = {} - if request.parent - header_params["parent"] = request.parent - end - - request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") - metadata[:"x-goog-request-params"] ||= request_params_header - - options.apply_defaults timeout: @config.rpcs.add_secret_version.timeout, - metadata: metadata, - retry_policy: @config.rpcs.add_secret_version.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @secret_manager_service_stub.call_rpc :add_secret_version, request, options: options do |response, operation| - yield response, operation if block_given? - end - rescue ::GRPC::BadStatus => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Gets metadata for a given - # {::Google::Cloud::SecretManager::V1beta2::Secret Secret}. - # - # @overload get_secret(request, options = nil) - # Pass arguments to `get_secret` via a request object, either of type - # {::Google::Cloud::SecretManager::V1beta2::GetSecretRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::SecretManager::V1beta2::GetSecretRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. - # - # @overload get_secret(name: nil) - # Pass arguments to `get_secret` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param name [::String] - # Required. The resource name of the - # {::Google::Cloud::SecretManager::V1beta2::Secret Secret}, in the format - # `projects/*/secrets/*` or `projects/*/locations/*/secrets/*`. - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Google::Cloud::SecretManager::V1beta2::Secret] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Google::Cloud::SecretManager::V1beta2::Secret] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/cloud/secret_manager/v1beta2" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::SecretManager::V1beta2::SecretManagerService::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::SecretManager::V1beta2::GetSecretRequest.new - # - # # Call the get_secret method. - # result = client.get_secret request - # - # # The returned object is of type Google::Cloud::SecretManager::V1beta2::Secret. - # p result - # - def get_secret request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::SecretManager::V1beta2::GetSecretRequest - - # Converts hash and nil to an options object - options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h - - # Customize the options with defaults - metadata = @config.rpcs.get_secret.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::SecretManager::V1beta2::VERSION - metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - header_params = {} - if request.name - header_params["name"] = request.name - end - - request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") - metadata[:"x-goog-request-params"] ||= request_params_header - - options.apply_defaults timeout: @config.rpcs.get_secret.timeout, - metadata: metadata, - retry_policy: @config.rpcs.get_secret.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @secret_manager_service_stub.call_rpc :get_secret, request, options: options do |response, operation| - yield response, operation if block_given? - end - rescue ::GRPC::BadStatus => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Updates metadata of an existing - # {::Google::Cloud::SecretManager::V1beta2::Secret Secret}. - # - # @overload update_secret(request, options = nil) - # Pass arguments to `update_secret` via a request object, either of type - # {::Google::Cloud::SecretManager::V1beta2::UpdateSecretRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::SecretManager::V1beta2::UpdateSecretRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. - # - # @overload update_secret(secret: nil, update_mask: nil) - # Pass arguments to `update_secret` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param secret [::Google::Cloud::SecretManager::V1beta2::Secret, ::Hash] - # Required. {::Google::Cloud::SecretManager::V1beta2::Secret Secret} with updated - # field values. - # @param update_mask [::Google::Protobuf::FieldMask, ::Hash] - # Required. Specifies the fields to be updated. - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Google::Cloud::SecretManager::V1beta2::Secret] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Google::Cloud::SecretManager::V1beta2::Secret] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/cloud/secret_manager/v1beta2" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::SecretManager::V1beta2::SecretManagerService::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::SecretManager::V1beta2::UpdateSecretRequest.new - # - # # Call the update_secret method. - # result = client.update_secret request - # - # # The returned object is of type Google::Cloud::SecretManager::V1beta2::Secret. - # p result - # - def update_secret request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::SecretManager::V1beta2::UpdateSecretRequest - - # Converts hash and nil to an options object - options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h - - # Customize the options with defaults - metadata = @config.rpcs.update_secret.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::SecretManager::V1beta2::VERSION - metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - header_params = {} - if request.secret&.name - header_params["secret.name"] = request.secret.name - end - - request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") - metadata[:"x-goog-request-params"] ||= request_params_header - - options.apply_defaults timeout: @config.rpcs.update_secret.timeout, - metadata: metadata, - retry_policy: @config.rpcs.update_secret.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @secret_manager_service_stub.call_rpc :update_secret, request, options: options do |response, operation| - yield response, operation if block_given? - end - rescue ::GRPC::BadStatus => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Deletes a {::Google::Cloud::SecretManager::V1beta2::Secret Secret}. - # - # @overload delete_secret(request, options = nil) - # Pass arguments to `delete_secret` via a request object, either of type - # {::Google::Cloud::SecretManager::V1beta2::DeleteSecretRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::SecretManager::V1beta2::DeleteSecretRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. - # - # @overload delete_secret(name: nil, etag: nil) - # Pass arguments to `delete_secret` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param name [::String] - # Required. The resource name of the - # {::Google::Cloud::SecretManager::V1beta2::Secret Secret} to delete in the format - # `projects/*/secrets/*`. - # @param etag [::String] - # Optional. Etag of the {::Google::Cloud::SecretManager::V1beta2::Secret Secret}. - # The request succeeds if it matches the etag of the currently stored secret - # object. If the etag is omitted, the request succeeds. - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Google::Protobuf::Empty] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Google::Protobuf::Empty] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/cloud/secret_manager/v1beta2" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::SecretManager::V1beta2::SecretManagerService::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::SecretManager::V1beta2::DeleteSecretRequest.new - # - # # Call the delete_secret method. - # result = client.delete_secret request - # - # # The returned object is of type Google::Protobuf::Empty. - # p result - # - def delete_secret request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::SecretManager::V1beta2::DeleteSecretRequest - - # Converts hash and nil to an options object - options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h - - # Customize the options with defaults - metadata = @config.rpcs.delete_secret.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::SecretManager::V1beta2::VERSION - metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - header_params = {} - if request.name - header_params["name"] = request.name - end - - request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") - metadata[:"x-goog-request-params"] ||= request_params_header - - options.apply_defaults timeout: @config.rpcs.delete_secret.timeout, - metadata: metadata, - retry_policy: @config.rpcs.delete_secret.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @secret_manager_service_stub.call_rpc :delete_secret, request, options: options do |response, operation| - yield response, operation if block_given? - end - rescue ::GRPC::BadStatus => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Lists {::Google::Cloud::SecretManager::V1beta2::SecretVersion SecretVersions}. - # This call does not return secret data. - # - # @overload list_secret_versions(request, options = nil) - # Pass arguments to `list_secret_versions` via a request object, either of type - # {::Google::Cloud::SecretManager::V1beta2::ListSecretVersionsRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::SecretManager::V1beta2::ListSecretVersionsRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. - # - # @overload list_secret_versions(parent: nil, page_size: nil, page_token: nil, filter: nil) - # Pass arguments to `list_secret_versions` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param parent [::String] - # Required. The resource name of the - # {::Google::Cloud::SecretManager::V1beta2::Secret Secret} associated with the - # {::Google::Cloud::SecretManager::V1beta2::SecretVersion SecretVersions} to list, - # in the format `projects/*/secrets/*` or `projects/*/locations/*/secrets/*`. - # @param page_size [::Integer] - # Optional. The maximum number of results to be returned in a single page. If - # set to 0, the server decides the number of results to return. If the - # number is greater than 25000, it is capped at 25000. - # @param page_token [::String] - # Optional. Pagination token, returned earlier via - # ListSecretVersionsResponse.next_page_token][]. - # @param filter [::String] - # Optional. Filter string, adhering to the rules in - # [List-operation - # filtering](https://cloud.google.com/secret-manager/docs/filtering). List - # only secret versions matching the filter. If filter is empty, all secret - # versions are listed. - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Gapic::PagedEnumerable<::Google::Cloud::SecretManager::V1beta2::SecretVersion>] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Gapic::PagedEnumerable<::Google::Cloud::SecretManager::V1beta2::SecretVersion>] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/cloud/secret_manager/v1beta2" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::SecretManager::V1beta2::SecretManagerService::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::SecretManager::V1beta2::ListSecretVersionsRequest.new - # - # # Call the list_secret_versions method. - # result = client.list_secret_versions request - # - # # The returned object is of type Gapic::PagedEnumerable. You can iterate - # # over elements, and API calls will be issued to fetch pages as needed. - # result.each do |item| - # # Each element is of type ::Google::Cloud::SecretManager::V1beta2::SecretVersion. - # p item - # end - # - def list_secret_versions request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::SecretManager::V1beta2::ListSecretVersionsRequest - - # Converts hash and nil to an options object - options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h - - # Customize the options with defaults - metadata = @config.rpcs.list_secret_versions.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::SecretManager::V1beta2::VERSION - metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - header_params = {} - if request.parent - header_params["parent"] = request.parent - end - - request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") - metadata[:"x-goog-request-params"] ||= request_params_header - - options.apply_defaults timeout: @config.rpcs.list_secret_versions.timeout, - metadata: metadata, - retry_policy: @config.rpcs.list_secret_versions.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @secret_manager_service_stub.call_rpc :list_secret_versions, request, options: options do |response, operation| - response = ::Gapic::PagedEnumerable.new @secret_manager_service_stub, :list_secret_versions, request, response, operation, options - yield response, operation if block_given? - throw :response, response - end - rescue ::GRPC::BadStatus => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Gets metadata for a - # {::Google::Cloud::SecretManager::V1beta2::SecretVersion SecretVersion}. - # - # `projects/*/secrets/*/versions/latest` is an alias to the most recently - # created {::Google::Cloud::SecretManager::V1beta2::SecretVersion SecretVersion}. - # - # @overload get_secret_version(request, options = nil) - # Pass arguments to `get_secret_version` via a request object, either of type - # {::Google::Cloud::SecretManager::V1beta2::GetSecretVersionRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::SecretManager::V1beta2::GetSecretVersionRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. - # - # @overload get_secret_version(name: nil) - # Pass arguments to `get_secret_version` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param name [::String] - # Required. The resource name of the - # {::Google::Cloud::SecretManager::V1beta2::SecretVersion SecretVersion} in the - # format `projects/*/secrets/*/versions/*` or - # `projects/*/locations/*/secrets/*/versions/*`. - # - # `projects/*/secrets/*/versions/latest` or - # `projects/*/locations/*/secrets/*/versions/latest` is an alias to the most - # recently created - # {::Google::Cloud::SecretManager::V1beta2::SecretVersion SecretVersion}. - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Google::Cloud::SecretManager::V1beta2::SecretVersion] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Google::Cloud::SecretManager::V1beta2::SecretVersion] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/cloud/secret_manager/v1beta2" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::SecretManager::V1beta2::SecretManagerService::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::SecretManager::V1beta2::GetSecretVersionRequest.new - # - # # Call the get_secret_version method. - # result = client.get_secret_version request - # - # # The returned object is of type Google::Cloud::SecretManager::V1beta2::SecretVersion. - # p result - # - def get_secret_version request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::SecretManager::V1beta2::GetSecretVersionRequest - - # Converts hash and nil to an options object - options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h - - # Customize the options with defaults - metadata = @config.rpcs.get_secret_version.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::SecretManager::V1beta2::VERSION - metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - header_params = {} - if request.name - header_params["name"] = request.name - end - - request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") - metadata[:"x-goog-request-params"] ||= request_params_header - - options.apply_defaults timeout: @config.rpcs.get_secret_version.timeout, - metadata: metadata, - retry_policy: @config.rpcs.get_secret_version.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @secret_manager_service_stub.call_rpc :get_secret_version, request, options: options do |response, operation| - yield response, operation if block_given? - end - rescue ::GRPC::BadStatus => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Accesses a - # {::Google::Cloud::SecretManager::V1beta2::SecretVersion SecretVersion}. This - # call returns the secret data. - # - # `projects/*/secrets/*/versions/latest` is an alias to the most recently - # created {::Google::Cloud::SecretManager::V1beta2::SecretVersion SecretVersion}. - # - # @overload access_secret_version(request, options = nil) - # Pass arguments to `access_secret_version` via a request object, either of type - # {::Google::Cloud::SecretManager::V1beta2::AccessSecretVersionRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::SecretManager::V1beta2::AccessSecretVersionRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. - # - # @overload access_secret_version(name: nil) - # Pass arguments to `access_secret_version` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param name [::String] - # Required. The resource name of the - # {::Google::Cloud::SecretManager::V1beta2::SecretVersion SecretVersion} in the - # format `projects/*/secrets/*/versions/*` or - # `projects/*/locations/*/secrets/*/versions/*`. - # - # `projects/*/secrets/*/versions/latest` or - # `projects/*/locations/*/secrets/*/versions/latest` is an alias to the most - # recently created - # {::Google::Cloud::SecretManager::V1beta2::SecretVersion SecretVersion}. - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Google::Cloud::SecretManager::V1beta2::AccessSecretVersionResponse] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Google::Cloud::SecretManager::V1beta2::AccessSecretVersionResponse] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/cloud/secret_manager/v1beta2" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::SecretManager::V1beta2::SecretManagerService::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::SecretManager::V1beta2::AccessSecretVersionRequest.new - # - # # Call the access_secret_version method. - # result = client.access_secret_version request - # - # # The returned object is of type Google::Cloud::SecretManager::V1beta2::AccessSecretVersionResponse. - # p result - # - def access_secret_version request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::SecretManager::V1beta2::AccessSecretVersionRequest - - # Converts hash and nil to an options object - options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h - - # Customize the options with defaults - metadata = @config.rpcs.access_secret_version.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::SecretManager::V1beta2::VERSION - metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - header_params = {} - if request.name - header_params["name"] = request.name - end - - request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") - metadata[:"x-goog-request-params"] ||= request_params_header - - options.apply_defaults timeout: @config.rpcs.access_secret_version.timeout, - metadata: metadata, - retry_policy: @config.rpcs.access_secret_version.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @secret_manager_service_stub.call_rpc :access_secret_version, request, options: options do |response, operation| - yield response, operation if block_given? - end - rescue ::GRPC::BadStatus => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Disables a - # {::Google::Cloud::SecretManager::V1beta2::SecretVersion SecretVersion}. - # - # Sets the {::Google::Cloud::SecretManager::V1beta2::SecretVersion#state state} of - # the {::Google::Cloud::SecretManager::V1beta2::SecretVersion SecretVersion} to - # {::Google::Cloud::SecretManager::V1beta2::SecretVersion::State::DISABLED DISABLED}. - # - # @overload disable_secret_version(request, options = nil) - # Pass arguments to `disable_secret_version` via a request object, either of type - # {::Google::Cloud::SecretManager::V1beta2::DisableSecretVersionRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::SecretManager::V1beta2::DisableSecretVersionRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. - # - # @overload disable_secret_version(name: nil, etag: nil) - # Pass arguments to `disable_secret_version` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param name [::String] - # Required. The resource name of the - # {::Google::Cloud::SecretManager::V1beta2::SecretVersion SecretVersion} to - # disable in the format `projects/*/secrets/*/versions/*` or - # `projects/*/locations/*/secrets/*/versions/*`. - # @param etag [::String] - # Optional. Etag of the - # {::Google::Cloud::SecretManager::V1beta2::SecretVersion SecretVersion}. The - # request succeeds if it matches the etag of the currently stored secret - # version object. If the etag is omitted, the request succeeds. - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Google::Cloud::SecretManager::V1beta2::SecretVersion] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Google::Cloud::SecretManager::V1beta2::SecretVersion] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/cloud/secret_manager/v1beta2" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::SecretManager::V1beta2::SecretManagerService::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::SecretManager::V1beta2::DisableSecretVersionRequest.new - # - # # Call the disable_secret_version method. - # result = client.disable_secret_version request - # - # # The returned object is of type Google::Cloud::SecretManager::V1beta2::SecretVersion. - # p result - # - def disable_secret_version request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::SecretManager::V1beta2::DisableSecretVersionRequest - - # Converts hash and nil to an options object - options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h - - # Customize the options with defaults - metadata = @config.rpcs.disable_secret_version.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::SecretManager::V1beta2::VERSION - metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - header_params = {} - if request.name - header_params["name"] = request.name - end - - request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") - metadata[:"x-goog-request-params"] ||= request_params_header - - options.apply_defaults timeout: @config.rpcs.disable_secret_version.timeout, - metadata: metadata, - retry_policy: @config.rpcs.disable_secret_version.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @secret_manager_service_stub.call_rpc :disable_secret_version, request, options: options do |response, operation| - yield response, operation if block_given? - end - rescue ::GRPC::BadStatus => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Enables a - # {::Google::Cloud::SecretManager::V1beta2::SecretVersion SecretVersion}. - # - # Sets the {::Google::Cloud::SecretManager::V1beta2::SecretVersion#state state} of - # the {::Google::Cloud::SecretManager::V1beta2::SecretVersion SecretVersion} to - # {::Google::Cloud::SecretManager::V1beta2::SecretVersion::State::ENABLED ENABLED}. - # - # @overload enable_secret_version(request, options = nil) - # Pass arguments to `enable_secret_version` via a request object, either of type - # {::Google::Cloud::SecretManager::V1beta2::EnableSecretVersionRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::SecretManager::V1beta2::EnableSecretVersionRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. - # - # @overload enable_secret_version(name: nil, etag: nil) - # Pass arguments to `enable_secret_version` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param name [::String] - # Required. The resource name of the - # {::Google::Cloud::SecretManager::V1beta2::SecretVersion SecretVersion} to enable - # in the format `projects/*/secrets/*/versions/*` or - # `projects/*/locations/*/secrets/*/versions/*`. - # @param etag [::String] - # Optional. Etag of the - # {::Google::Cloud::SecretManager::V1beta2::SecretVersion SecretVersion}. The - # request succeeds if it matches the etag of the currently stored secret - # version object. If the etag is omitted, the request succeeds. - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Google::Cloud::SecretManager::V1beta2::SecretVersion] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Google::Cloud::SecretManager::V1beta2::SecretVersion] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/cloud/secret_manager/v1beta2" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::SecretManager::V1beta2::SecretManagerService::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::SecretManager::V1beta2::EnableSecretVersionRequest.new - # - # # Call the enable_secret_version method. - # result = client.enable_secret_version request - # - # # The returned object is of type Google::Cloud::SecretManager::V1beta2::SecretVersion. - # p result - # - def enable_secret_version request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::SecretManager::V1beta2::EnableSecretVersionRequest - - # Converts hash and nil to an options object - options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h - - # Customize the options with defaults - metadata = @config.rpcs.enable_secret_version.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::SecretManager::V1beta2::VERSION - metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - header_params = {} - if request.name - header_params["name"] = request.name - end - - request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") - metadata[:"x-goog-request-params"] ||= request_params_header - - options.apply_defaults timeout: @config.rpcs.enable_secret_version.timeout, - metadata: metadata, - retry_policy: @config.rpcs.enable_secret_version.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @secret_manager_service_stub.call_rpc :enable_secret_version, request, options: options do |response, operation| - yield response, operation if block_given? - end - rescue ::GRPC::BadStatus => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Destroys a - # {::Google::Cloud::SecretManager::V1beta2::SecretVersion SecretVersion}. - # - # Sets the {::Google::Cloud::SecretManager::V1beta2::SecretVersion#state state} of - # the {::Google::Cloud::SecretManager::V1beta2::SecretVersion SecretVersion} to - # {::Google::Cloud::SecretManager::V1beta2::SecretVersion::State::DESTROYED DESTROYED} - # and irrevocably destroys the secret data. - # - # @overload destroy_secret_version(request, options = nil) - # Pass arguments to `destroy_secret_version` via a request object, either of type - # {::Google::Cloud::SecretManager::V1beta2::DestroySecretVersionRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::SecretManager::V1beta2::DestroySecretVersionRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. - # - # @overload destroy_secret_version(name: nil, etag: nil) - # Pass arguments to `destroy_secret_version` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param name [::String] - # Required. The resource name of the - # {::Google::Cloud::SecretManager::V1beta2::SecretVersion SecretVersion} to - # destroy in the format `projects/*/secrets/*/versions/*` or - # `projects/*/locations/*/secrets/*/versions/*`. - # @param etag [::String] - # Optional. Etag of the - # {::Google::Cloud::SecretManager::V1beta2::SecretVersion SecretVersion}. The - # request succeeds if it matches the etag of the currently stored secret - # version object. If the etag is omitted, the request succeeds. - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Google::Cloud::SecretManager::V1beta2::SecretVersion] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Google::Cloud::SecretManager::V1beta2::SecretVersion] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/cloud/secret_manager/v1beta2" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::SecretManager::V1beta2::SecretManagerService::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::SecretManager::V1beta2::DestroySecretVersionRequest.new - # - # # Call the destroy_secret_version method. - # result = client.destroy_secret_version request - # - # # The returned object is of type Google::Cloud::SecretManager::V1beta2::SecretVersion. - # p result - # - def destroy_secret_version request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::SecretManager::V1beta2::DestroySecretVersionRequest - - # Converts hash and nil to an options object - options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h - - # Customize the options with defaults - metadata = @config.rpcs.destroy_secret_version.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::SecretManager::V1beta2::VERSION - metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - header_params = {} - if request.name - header_params["name"] = request.name - end - - request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") - metadata[:"x-goog-request-params"] ||= request_params_header - - options.apply_defaults timeout: @config.rpcs.destroy_secret_version.timeout, - metadata: metadata, - retry_policy: @config.rpcs.destroy_secret_version.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @secret_manager_service_stub.call_rpc :destroy_secret_version, request, options: options do |response, operation| - yield response, operation if block_given? - end - rescue ::GRPC::BadStatus => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Sets the access control policy on the specified secret. Replaces any - # existing policy. - # - # Permissions on - # {::Google::Cloud::SecretManager::V1beta2::SecretVersion SecretVersions} are - # enforced according to the policy set on the associated - # {::Google::Cloud::SecretManager::V1beta2::Secret Secret}. - # - # @overload set_iam_policy(request, options = nil) - # Pass arguments to `set_iam_policy` via a request object, either of type - # {::Google::Iam::V1::SetIamPolicyRequest} or an equivalent Hash. - # - # @param request [::Google::Iam::V1::SetIamPolicyRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. - # - # @overload set_iam_policy(resource: nil, policy: nil, update_mask: nil) - # Pass arguments to `set_iam_policy` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param resource [::String] - # REQUIRED: The resource for which the policy is being specified. - # See the operation documentation for the appropriate value for this field. - # @param policy [::Google::Iam::V1::Policy, ::Hash] - # REQUIRED: The complete policy to be applied to the `resource`. The size of - # the policy is limited to a few 10s of KB. An empty policy is a - # valid policy but certain Cloud Platform services (such as Projects) - # might reject them. - # @param update_mask [::Google::Protobuf::FieldMask, ::Hash] - # OPTIONAL: A FieldMask specifying which fields of the policy to modify. Only - # the fields in the mask will be modified. If no mask is provided, the - # following default mask is used: - # - # `paths: "bindings, etag"` - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Google::Iam::V1::Policy] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Google::Iam::V1::Policy] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/cloud/secret_manager/v1beta2" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::SecretManager::V1beta2::SecretManagerService::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Iam::V1::SetIamPolicyRequest.new - # - # # Call the set_iam_policy method. - # result = client.set_iam_policy request - # - # # The returned object is of type Google::Iam::V1::Policy. - # p result - # - def set_iam_policy request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Iam::V1::SetIamPolicyRequest - - # Converts hash and nil to an options object - options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h - - # Customize the options with defaults - metadata = @config.rpcs.set_iam_policy.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::SecretManager::V1beta2::VERSION - metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - header_params = {} - if request.resource - header_params["resource"] = request.resource - end - - request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") - metadata[:"x-goog-request-params"] ||= request_params_header - - options.apply_defaults timeout: @config.rpcs.set_iam_policy.timeout, - metadata: metadata, - retry_policy: @config.rpcs.set_iam_policy.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @secret_manager_service_stub.call_rpc :set_iam_policy, request, options: options do |response, operation| - yield response, operation if block_given? - end - rescue ::GRPC::BadStatus => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Gets the access control policy for a secret. - # Returns empty policy if the secret exists and does not have a policy set. - # - # @overload get_iam_policy(request, options = nil) - # Pass arguments to `get_iam_policy` via a request object, either of type - # {::Google::Iam::V1::GetIamPolicyRequest} or an equivalent Hash. - # - # @param request [::Google::Iam::V1::GetIamPolicyRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. - # - # @overload get_iam_policy(resource: nil, options: nil) - # Pass arguments to `get_iam_policy` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param resource [::String] - # REQUIRED: The resource for which the policy is being requested. - # See the operation documentation for the appropriate value for this field. - # @param options [::Google::Iam::V1::GetPolicyOptions, ::Hash] - # OPTIONAL: A `GetPolicyOptions` object for specifying options to - # `GetIamPolicy`. - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Google::Iam::V1::Policy] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Google::Iam::V1::Policy] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/cloud/secret_manager/v1beta2" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::SecretManager::V1beta2::SecretManagerService::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Iam::V1::GetIamPolicyRequest.new - # - # # Call the get_iam_policy method. - # result = client.get_iam_policy request - # - # # The returned object is of type Google::Iam::V1::Policy. - # p result - # - def get_iam_policy request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Iam::V1::GetIamPolicyRequest - - # Converts hash and nil to an options object - options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h - - # Customize the options with defaults - metadata = @config.rpcs.get_iam_policy.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::SecretManager::V1beta2::VERSION - metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - header_params = {} - if request.resource - header_params["resource"] = request.resource - end - - request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") - metadata[:"x-goog-request-params"] ||= request_params_header - - options.apply_defaults timeout: @config.rpcs.get_iam_policy.timeout, - metadata: metadata, - retry_policy: @config.rpcs.get_iam_policy.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @secret_manager_service_stub.call_rpc :get_iam_policy, request, options: options do |response, operation| - yield response, operation if block_given? - end - rescue ::GRPC::BadStatus => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Returns permissions that a caller has for the specified secret. - # If the secret does not exist, this call returns an empty set of - # permissions, not a NOT_FOUND error. - # - # Note: This operation is designed to be used for building permission-aware - # UIs and command-line tools, not for authorization checking. This operation - # may "fail open" without warning. - # - # @overload test_iam_permissions(request, options = nil) - # Pass arguments to `test_iam_permissions` via a request object, either of type - # {::Google::Iam::V1::TestIamPermissionsRequest} or an equivalent Hash. - # - # @param request [::Google::Iam::V1::TestIamPermissionsRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. - # - # @overload test_iam_permissions(resource: nil, permissions: nil) - # Pass arguments to `test_iam_permissions` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param resource [::String] - # REQUIRED: The resource for which the policy detail is being requested. - # See the operation documentation for the appropriate value for this field. - # @param permissions [::Array<::String>] - # The set of permissions to check for the `resource`. Permissions with - # wildcards (such as '*' or 'storage.*') are not allowed. For more - # information see - # [IAM Overview](https://cloud.google.com/iam/docs/overview#permissions). - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Google::Iam::V1::TestIamPermissionsResponse] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Google::Iam::V1::TestIamPermissionsResponse] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/cloud/secret_manager/v1beta2" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::SecretManager::V1beta2::SecretManagerService::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Iam::V1::TestIamPermissionsRequest.new - # - # # Call the test_iam_permissions method. - # result = client.test_iam_permissions request - # - # # The returned object is of type Google::Iam::V1::TestIamPermissionsResponse. - # p result - # - def test_iam_permissions request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Iam::V1::TestIamPermissionsRequest - - # Converts hash and nil to an options object - options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h - - # Customize the options with defaults - metadata = @config.rpcs.test_iam_permissions.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::SecretManager::V1beta2::VERSION - metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - header_params = {} - if request.resource - header_params["resource"] = request.resource - end - - request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") - metadata[:"x-goog-request-params"] ||= request_params_header - - options.apply_defaults timeout: @config.rpcs.test_iam_permissions.timeout, - metadata: metadata, - retry_policy: @config.rpcs.test_iam_permissions.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @secret_manager_service_stub.call_rpc :test_iam_permissions, request, options: options do |response, operation| - yield response, operation if block_given? - end - rescue ::GRPC::BadStatus => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Configuration class for the SecretManagerService API. - # - # This class represents the configuration for SecretManagerService, - # providing control over timeouts, retry behavior, logging, transport - # parameters, and other low-level controls. Certain parameters can also be - # applied individually to specific RPCs. See - # {::Google::Cloud::SecretManager::V1beta2::SecretManagerService::Client::Configuration::Rpcs} - # for a list of RPCs that can be configured independently. - # - # Configuration can be applied globally to all clients, or to a single client - # on construction. - # - # @example - # - # # Modify the global config, setting the timeout for - # # list_secrets to 20 seconds, - # # and all remaining timeouts to 10 seconds. - # ::Google::Cloud::SecretManager::V1beta2::SecretManagerService::Client.configure do |config| - # config.timeout = 10.0 - # config.rpcs.list_secrets.timeout = 20.0 - # end - # - # # Apply the above configuration only to a new client. - # client = ::Google::Cloud::SecretManager::V1beta2::SecretManagerService::Client.new do |config| - # config.timeout = 10.0 - # config.rpcs.list_secrets.timeout = 20.0 - # end - # - # @!attribute [rw] endpoint - # A custom service endpoint, as a hostname or hostname:port. The default is - # nil, indicating to use the default endpoint in the current universe domain. - # @return [::String,nil] - # @!attribute [rw] credentials - # Credentials to send with calls. You may provide any of the following types: - # * (`Google::Auth::Credentials`) A googleauth credentials object - # (see the [googleauth docs](https://rubydoc.info/gems/googleauth/Google/Auth/Credentials)) - # * (`Signet::OAuth2::Client`) A signet oauth2 client object - # (see the [signet docs](https://rubydoc.info/gems/signet/Signet/OAuth2/Client)) - # * (`GRPC::Core::Channel`) a gRPC channel with included credentials - # * (`GRPC::Core::ChannelCredentials`) a gRPC credentails object - # * (`nil`) indicating no credentials - # - # @note Warning: Passing a `String` to a keyfile path or a `Hash` of credentials - # is deprecated. Providing an unvalidated credential configuration to - # Google APIs can compromise the security of your systems and data. - # - # @example - # - # # The recommended way to provide credentials is to use the `make_creds` method - # # on the appropriate credentials class for your environment. - # - # require "googleauth" - # - # credentials = ::Google::Auth::ServiceAccountCredentials.make_creds( - # json_key_io: ::File.open("/path/to/keyfile.json") - # ) - # - # client = ::Google::Cloud::SecretManager::V1beta2::SecretManagerService::Client.new do |config| - # config.credentials = credentials - # end - # - # @note Warning: If you accept a credential configuration (JSON file or Hash) from an - # external source for authentication to Google Cloud, you must validate it before - # providing it to a Google API client library. Providing an unvalidated credential - # configuration to Google APIs can compromise the security of your systems and data. - # For more information, refer to [Validate credential configurations from external - # sources](https://cloud.google.com/docs/authentication/external/externally-sourced-credentials). - # @return [::Object] - # @!attribute [rw] scope - # The OAuth scopes - # @return [::Array<::String>] - # @!attribute [rw] lib_name - # The library name as recorded in instrumentation and logging - # @return [::String] - # @!attribute [rw] lib_version - # The library version as recorded in instrumentation and logging - # @return [::String] - # @!attribute [rw] channel_args - # Extra parameters passed to the gRPC channel. Note: this is ignored if a - # `GRPC::Core::Channel` object is provided as the credential. - # @return [::Hash] - # @!attribute [rw] interceptors - # An array of interceptors that are run before calls are executed. - # @return [::Array<::GRPC::ClientInterceptor>] - # @!attribute [rw] timeout - # The call timeout in seconds. - # @return [::Numeric] - # @!attribute [rw] metadata - # Additional gRPC headers to be sent with the call. - # @return [::Hash{::Symbol=>::String}] - # @!attribute [rw] retry_policy - # The retry policy. The value is a hash with the following keys: - # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds. - # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds. - # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier. - # * `:retry_codes` (*type:* `Array`) - The error codes that should - # trigger a retry. - # @return [::Hash] - # @!attribute [rw] quota_project - # A separate project against which to charge quota. - # @return [::String] - # @!attribute [rw] universe_domain - # The universe domain within which to make requests. This determines the - # default endpoint URL. The default value of nil uses the environment - # universe (usually the default "googleapis.com" universe). - # @return [::String,nil] - # @!attribute [rw] logger - # A custom logger to use for request/response debug logging, or the value - # `:default` (the default) to construct a default logger, or `nil` to - # explicitly disable logging. - # @return [::Logger,:default,nil] - # - class Configuration - extend ::Gapic::Config - - # @private - # The endpoint specific to the default "googleapis.com" universe. Deprecated. - DEFAULT_ENDPOINT = "secretmanager.googleapis.com" - - config_attr :endpoint, nil, ::String, nil - config_attr :credentials, nil do |value| - allowed = [::String, ::Hash, ::Proc, ::Symbol, ::Google::Auth::Credentials, ::Google::Auth::BaseClient, ::Signet::OAuth2::Client, nil] - allowed += [::GRPC::Core::Channel, ::GRPC::Core::ChannelCredentials] if defined? ::GRPC::Core::Channel - allowed.any? { |klass| klass === value } - end - config_attr :scope, nil, ::String, ::Array, nil - config_attr :lib_name, nil, ::String, nil - config_attr :lib_version, nil, ::String, nil - config_attr(:channel_args, { "grpc.service_config_disable_resolution" => 1 }, ::Hash, nil) - config_attr :interceptors, nil, ::Array, nil - config_attr :timeout, nil, ::Numeric, nil - config_attr :metadata, nil, ::Hash, nil - config_attr :retry_policy, nil, ::Hash, ::Proc, nil - config_attr :quota_project, nil, ::String, nil - config_attr :universe_domain, nil, ::String, nil - config_attr :logger, :default, ::Logger, nil, :default - - # @private - def initialize parent_config = nil - @parent_config = parent_config unless parent_config.nil? - - yield self if block_given? - end - - ## - # Configurations for individual RPCs - # @return [Rpcs] - # - def rpcs - @rpcs ||= begin - parent_rpcs = nil - parent_rpcs = @parent_config.rpcs if defined?(@parent_config) && @parent_config.respond_to?(:rpcs) - Rpcs.new parent_rpcs - end - end - - ## - # Configuration for the channel pool - # @return [::Gapic::ServiceStub::ChannelPool::Configuration] - # - def channel_pool - @channel_pool ||= ::Gapic::ServiceStub::ChannelPool::Configuration.new - end - - ## - # Configuration RPC class for the SecretManagerService API. - # - # Includes fields providing the configuration for each RPC in this service. - # Each configuration object is of type `Gapic::Config::Method` and includes - # the following configuration fields: - # - # * `timeout` (*type:* `Numeric`) - The call timeout in seconds - # * `metadata` (*type:* `Hash{Symbol=>String}`) - Additional gRPC headers - # * `retry_policy (*type:* `Hash`) - The retry policy. The policy fields - # include the following keys: - # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds. - # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds. - # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier. - # * `:retry_codes` (*type:* `Array`) - The error codes that should - # trigger a retry. - # - class Rpcs - ## - # RPC-specific configuration for `list_secrets` - # @return [::Gapic::Config::Method] - # - attr_reader :list_secrets - ## - # RPC-specific configuration for `create_secret` - # @return [::Gapic::Config::Method] - # - attr_reader :create_secret - ## - # RPC-specific configuration for `add_secret_version` - # @return [::Gapic::Config::Method] - # - attr_reader :add_secret_version - ## - # RPC-specific configuration for `get_secret` - # @return [::Gapic::Config::Method] - # - attr_reader :get_secret - ## - # RPC-specific configuration for `update_secret` - # @return [::Gapic::Config::Method] - # - attr_reader :update_secret - ## - # RPC-specific configuration for `delete_secret` - # @return [::Gapic::Config::Method] - # - attr_reader :delete_secret - ## - # RPC-specific configuration for `list_secret_versions` - # @return [::Gapic::Config::Method] - # - attr_reader :list_secret_versions - ## - # RPC-specific configuration for `get_secret_version` - # @return [::Gapic::Config::Method] - # - attr_reader :get_secret_version - ## - # RPC-specific configuration for `access_secret_version` - # @return [::Gapic::Config::Method] - # - attr_reader :access_secret_version - ## - # RPC-specific configuration for `disable_secret_version` - # @return [::Gapic::Config::Method] - # - attr_reader :disable_secret_version - ## - # RPC-specific configuration for `enable_secret_version` - # @return [::Gapic::Config::Method] - # - attr_reader :enable_secret_version - ## - # RPC-specific configuration for `destroy_secret_version` - # @return [::Gapic::Config::Method] - # - attr_reader :destroy_secret_version - ## - # RPC-specific configuration for `set_iam_policy` - # @return [::Gapic::Config::Method] - # - attr_reader :set_iam_policy - ## - # RPC-specific configuration for `get_iam_policy` - # @return [::Gapic::Config::Method] - # - attr_reader :get_iam_policy - ## - # RPC-specific configuration for `test_iam_permissions` - # @return [::Gapic::Config::Method] - # - attr_reader :test_iam_permissions - - # @private - def initialize parent_rpcs = nil - list_secrets_config = parent_rpcs.list_secrets if parent_rpcs.respond_to? :list_secrets - @list_secrets = ::Gapic::Config::Method.new list_secrets_config - create_secret_config = parent_rpcs.create_secret if parent_rpcs.respond_to? :create_secret - @create_secret = ::Gapic::Config::Method.new create_secret_config - add_secret_version_config = parent_rpcs.add_secret_version if parent_rpcs.respond_to? :add_secret_version - @add_secret_version = ::Gapic::Config::Method.new add_secret_version_config - get_secret_config = parent_rpcs.get_secret if parent_rpcs.respond_to? :get_secret - @get_secret = ::Gapic::Config::Method.new get_secret_config - update_secret_config = parent_rpcs.update_secret if parent_rpcs.respond_to? :update_secret - @update_secret = ::Gapic::Config::Method.new update_secret_config - delete_secret_config = parent_rpcs.delete_secret if parent_rpcs.respond_to? :delete_secret - @delete_secret = ::Gapic::Config::Method.new delete_secret_config - list_secret_versions_config = parent_rpcs.list_secret_versions if parent_rpcs.respond_to? :list_secret_versions - @list_secret_versions = ::Gapic::Config::Method.new list_secret_versions_config - get_secret_version_config = parent_rpcs.get_secret_version if parent_rpcs.respond_to? :get_secret_version - @get_secret_version = ::Gapic::Config::Method.new get_secret_version_config - access_secret_version_config = parent_rpcs.access_secret_version if parent_rpcs.respond_to? :access_secret_version - @access_secret_version = ::Gapic::Config::Method.new access_secret_version_config - disable_secret_version_config = parent_rpcs.disable_secret_version if parent_rpcs.respond_to? :disable_secret_version - @disable_secret_version = ::Gapic::Config::Method.new disable_secret_version_config - enable_secret_version_config = parent_rpcs.enable_secret_version if parent_rpcs.respond_to? :enable_secret_version - @enable_secret_version = ::Gapic::Config::Method.new enable_secret_version_config - destroy_secret_version_config = parent_rpcs.destroy_secret_version if parent_rpcs.respond_to? :destroy_secret_version - @destroy_secret_version = ::Gapic::Config::Method.new destroy_secret_version_config - set_iam_policy_config = parent_rpcs.set_iam_policy if parent_rpcs.respond_to? :set_iam_policy - @set_iam_policy = ::Gapic::Config::Method.new set_iam_policy_config - get_iam_policy_config = parent_rpcs.get_iam_policy if parent_rpcs.respond_to? :get_iam_policy - @get_iam_policy = ::Gapic::Config::Method.new get_iam_policy_config - test_iam_permissions_config = parent_rpcs.test_iam_permissions if parent_rpcs.respond_to? :test_iam_permissions - @test_iam_permissions = ::Gapic::Config::Method.new test_iam_permissions_config - - yield self if block_given? - end - end - end - end - end - end - end - end -end diff --git a/owl-bot-staging/google-cloud-secret_manager-v1beta2/lib/google/cloud/secret_manager/v1beta2/secret_manager_service/credentials.rb b/owl-bot-staging/google-cloud-secret_manager-v1beta2/lib/google/cloud/secret_manager/v1beta2/secret_manager_service/credentials.rb deleted file mode 100644 index 42d6ada8e23f..000000000000 --- a/owl-bot-staging/google-cloud-secret_manager-v1beta2/lib/google/cloud/secret_manager/v1beta2/secret_manager_service/credentials.rb +++ /dev/null @@ -1,51 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -require "googleauth" - -module Google - module Cloud - module SecretManager - module V1beta2 - module SecretManagerService - # Credentials for the SecretManagerService API. - class Credentials < ::Google::Auth::Credentials - self.scope = [ - "https://www.googleapis.com/auth/cloud-platform" - ] - self.env_vars = [ - "SECRET_MANAGER_CREDENTIALS", - "SECRET_MANAGER_KEYFILE", - "GOOGLE_CLOUD_CREDENTIALS", - "GOOGLE_CLOUD_KEYFILE", - "GCLOUD_KEYFILE", - "SECRET_MANAGER_CREDENTIALS_JSON", - "SECRET_MANAGER_KEYFILE_JSON", - "GOOGLE_CLOUD_CREDENTIALS_JSON", - "GOOGLE_CLOUD_KEYFILE_JSON", - "GCLOUD_KEYFILE_JSON" - ] - self.paths = [ - "~/.config/google_cloud/application_default_credentials.json" - ] - end - end - end - end - end -end diff --git a/owl-bot-staging/google-cloud-secret_manager-v1beta2/lib/google/cloud/secret_manager/v1beta2/secret_manager_service/paths.rb b/owl-bot-staging/google-cloud-secret_manager-v1beta2/lib/google/cloud/secret_manager/v1beta2/secret_manager_service/paths.rb deleted file mode 100644 index a3810d469c8f..000000000000 --- a/owl-bot-staging/google-cloud-secret_manager-v1beta2/lib/google/cloud/secret_manager/v1beta2/secret_manager_service/paths.rb +++ /dev/null @@ -1,167 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - - -module Google - module Cloud - module SecretManager - module V1beta2 - module SecretManagerService - # Path helper methods for the SecretManagerService API. - module Paths - ## - # Create a fully-qualified Location resource string. - # - # The resource will be in the following format: - # - # `projects/{project}/locations/{location}` - # - # @param project [String] - # @param location [String] - # - # @return [::String] - def location_path project:, location: - raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" - - "projects/#{project}/locations/#{location}" - end - - ## - # Create a fully-qualified Project resource string. - # - # The resource will be in the following format: - # - # `projects/{project}` - # - # @param project [String] - # - # @return [::String] - def project_path project: - "projects/#{project}" - end - - ## - # Create a fully-qualified Secret resource string. - # - # @overload secret_path(project:, secret:) - # The resource will be in the following format: - # - # `projects/{project}/secrets/{secret}` - # - # @param project [String] - # @param secret [String] - # - # @overload secret_path(project:, location:, secret:) - # The resource will be in the following format: - # - # `projects/{project}/locations/{location}/secrets/{secret}` - # - # @param project [String] - # @param location [String] - # @param secret [String] - # - # @return [::String] - def secret_path **args - resources = { - "project:secret" => (proc do |project:, secret:| - raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" - - "projects/#{project}/secrets/#{secret}" - end), - "location:project:secret" => (proc do |project:, location:, secret:| - raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" - raise ::ArgumentError, "location cannot contain /" if location.to_s.include? "/" - - "projects/#{project}/locations/#{location}/secrets/#{secret}" - end) - } - - resource = resources[args.keys.sort.join(":")] - raise ::ArgumentError, "no resource found for values #{args.keys}" if resource.nil? - resource.call(**args) - end - - ## - # Create a fully-qualified SecretVersion resource string. - # - # @overload secret_version_path(project:, secret:, secret_version:) - # The resource will be in the following format: - # - # `projects/{project}/secrets/{secret}/versions/{secret_version}` - # - # @param project [String] - # @param secret [String] - # @param secret_version [String] - # - # @overload secret_version_path(project:, location:, secret:, secret_version:) - # The resource will be in the following format: - # - # `projects/{project}/locations/{location}/secrets/{secret}/versions/{secret_version}` - # - # @param project [String] - # @param location [String] - # @param secret [String] - # @param secret_version [String] - # - # @return [::String] - def secret_version_path **args - resources = { - "project:secret:secret_version" => (proc do |project:, secret:, secret_version:| - raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" - raise ::ArgumentError, "secret cannot contain /" if secret.to_s.include? "/" - - "projects/#{project}/secrets/#{secret}/versions/#{secret_version}" - end), - "location:project:secret:secret_version" => (proc do |project:, location:, secret:, secret_version:| - raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" - raise ::ArgumentError, "location cannot contain /" if location.to_s.include? "/" - raise ::ArgumentError, "secret cannot contain /" if secret.to_s.include? "/" - - "projects/#{project}/locations/#{location}/secrets/#{secret}/versions/#{secret_version}" - end) - } - - resource = resources[args.keys.sort.join(":")] - raise ::ArgumentError, "no resource found for values #{args.keys}" if resource.nil? - resource.call(**args) - end - - ## - # Create a fully-qualified Topic resource string. - # - # The resource will be in the following format: - # - # `projects/{project}/topics/{topic}` - # - # @param project [String] - # @param topic [String] - # - # @return [::String] - def topic_path project:, topic: - raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" - - "projects/#{project}/topics/#{topic}" - end - - extend self - end - end - end - end - end -end diff --git a/owl-bot-staging/google-cloud-secret_manager-v1beta2/lib/google/cloud/secret_manager/v1beta2/secret_manager_service/rest.rb b/owl-bot-staging/google-cloud-secret_manager-v1beta2/lib/google/cloud/secret_manager/v1beta2/secret_manager_service/rest.rb deleted file mode 100644 index 0f60f9b3fd09..000000000000 --- a/owl-bot-staging/google-cloud-secret_manager-v1beta2/lib/google/cloud/secret_manager/v1beta2/secret_manager_service/rest.rb +++ /dev/null @@ -1,59 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -require "gapic/rest" -require "gapic/config" -require "gapic/config/method" - -require "google/cloud/secret_manager/v1beta2/version" -require "google/cloud/secret_manager/v1beta2/bindings_override" - -require "google/cloud/secret_manager/v1beta2/secret_manager_service/credentials" -require "google/cloud/secret_manager/v1beta2/secret_manager_service/paths" -require "google/cloud/secret_manager/v1beta2/secret_manager_service/rest/client" - -module Google - module Cloud - module SecretManager - module V1beta2 - ## - # Secret Manager Service - # - # Manages secrets and operations using those secrets. Implements a REST - # model with the following objects: - # - # * {::Google::Cloud::SecretManager::V1beta2::Secret Secret} - # * {::Google::Cloud::SecretManager::V1beta2::SecretVersion SecretVersion} - # - # To load this service and instantiate a REST client: - # - # require "google/cloud/secret_manager/v1beta2/secret_manager_service/rest" - # client = ::Google::Cloud::SecretManager::V1beta2::SecretManagerService::Rest::Client.new - # - module SecretManagerService - # Client for the REST transport - module Rest - end - end - end - end - end -end - -helper_path = ::File.join __dir__, "rest", "helpers.rb" -require "google/cloud/secret_manager/v1beta2/secret_manager_service/rest/helpers" if ::File.file? helper_path diff --git a/owl-bot-staging/google-cloud-secret_manager-v1beta2/lib/google/cloud/secret_manager/v1beta2/secret_manager_service/rest/client.rb b/owl-bot-staging/google-cloud-secret_manager-v1beta2/lib/google/cloud/secret_manager/v1beta2/secret_manager_service/rest/client.rb deleted file mode 100644 index 037aac866ca6..000000000000 --- a/owl-bot-staging/google-cloud-secret_manager-v1beta2/lib/google/cloud/secret_manager/v1beta2/secret_manager_service/rest/client.rb +++ /dev/null @@ -1,1856 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -require "google/cloud/errors" -require "google/cloud/secretmanager/v1beta2/service_pb" -require "google/cloud/secret_manager/v1beta2/secret_manager_service/rest/service_stub" -require "google/cloud/location/rest" - -module Google - module Cloud - module SecretManager - module V1beta2 - module SecretManagerService - module Rest - ## - # REST client for the SecretManagerService service. - # - # Secret Manager Service - # - # Manages secrets and operations using those secrets. Implements a REST - # model with the following objects: - # - # * {::Google::Cloud::SecretManager::V1beta2::Secret Secret} - # * {::Google::Cloud::SecretManager::V1beta2::SecretVersion SecretVersion} - # - class Client - # @private - API_VERSION = "" - - # @private - DEFAULT_ENDPOINT_TEMPLATE = "secretmanager.$UNIVERSE_DOMAIN$" - - include Paths - - # @private - attr_reader :secret_manager_service_stub - - ## - # Configure the SecretManagerService Client class. - # - # See {::Google::Cloud::SecretManager::V1beta2::SecretManagerService::Rest::Client::Configuration} - # for a description of the configuration fields. - # - # @example - # - # # Modify the configuration for all SecretManagerService clients - # ::Google::Cloud::SecretManager::V1beta2::SecretManagerService::Rest::Client.configure do |config| - # config.timeout = 10.0 - # end - # - # @yield [config] Configure the Client client. - # @yieldparam config [Client::Configuration] - # - # @return [Client::Configuration] - # - def self.configure - @configure ||= begin - namespace = ["Google", "Cloud", "SecretManager", "V1beta2"] - parent_config = while namespace.any? - parent_name = namespace.join "::" - parent_const = const_get parent_name - break parent_const.configure if parent_const.respond_to? :configure - namespace.pop - end - default_config = Client::Configuration.new parent_config - - default_config.rpcs.list_secrets.timeout = 60.0 - - default_config.rpcs.create_secret.timeout = 60.0 - - default_config.rpcs.add_secret_version.timeout = 60.0 - - default_config.rpcs.get_secret.timeout = 60.0 - - default_config.rpcs.update_secret.timeout = 60.0 - - default_config.rpcs.delete_secret.timeout = 60.0 - - default_config.rpcs.list_secret_versions.timeout = 60.0 - - default_config.rpcs.get_secret_version.timeout = 60.0 - - default_config.rpcs.access_secret_version.timeout = 60.0 - default_config.rpcs.access_secret_version.retry_policy = { - initial_delay: 2.0, max_delay: 60.0, multiplier: 2.0, retry_codes: [14, 8] - } - - default_config.rpcs.disable_secret_version.timeout = 60.0 - - default_config.rpcs.enable_secret_version.timeout = 60.0 - - default_config.rpcs.destroy_secret_version.timeout = 60.0 - - default_config.rpcs.set_iam_policy.timeout = 60.0 - - default_config.rpcs.get_iam_policy.timeout = 60.0 - - default_config.rpcs.test_iam_permissions.timeout = 60.0 - - default_config - end - yield @configure if block_given? - @configure - end - - ## - # Configure the SecretManagerService Client instance. - # - # The configuration is set to the derived mode, meaning that values can be changed, - # but structural changes (adding new fields, etc.) are not allowed. Structural changes - # should be made on {Client.configure}. - # - # See {::Google::Cloud::SecretManager::V1beta2::SecretManagerService::Rest::Client::Configuration} - # for a description of the configuration fields. - # - # @yield [config] Configure the Client client. - # @yieldparam config [Client::Configuration] - # - # @return [Client::Configuration] - # - def configure - yield @config if block_given? - @config - end - - ## - # The effective universe domain - # - # @return [String] - # - def universe_domain - @secret_manager_service_stub.universe_domain - end - - ## - # Create a new SecretManagerService REST client object. - # - # @example - # - # # Create a client using the default configuration - # client = ::Google::Cloud::SecretManager::V1beta2::SecretManagerService::Rest::Client.new - # - # # Create a client using a custom configuration - # client = ::Google::Cloud::SecretManager::V1beta2::SecretManagerService::Rest::Client.new do |config| - # config.timeout = 10.0 - # end - # - # @yield [config] Configure the SecretManagerService client. - # @yieldparam config [Client::Configuration] - # - def initialize - # Create the configuration object - @config = Configuration.new Client.configure - - # Yield the configuration if needed - yield @config if block_given? - - # Create credentials - credentials = @config.credentials - # Use self-signed JWT if the endpoint is unchanged from default, - # but only if the default endpoint does not have a region prefix. - enable_self_signed_jwt = @config.endpoint.nil? || - (@config.endpoint == Configuration::DEFAULT_ENDPOINT && - !@config.endpoint.split(".").first.include?("-")) - credentials ||= Credentials.default scope: @config.scope, - enable_self_signed_jwt: enable_self_signed_jwt - if credentials.is_a?(::String) || credentials.is_a?(::Hash) - credentials = Credentials.new credentials, scope: @config.scope - end - - @quota_project_id = @config.quota_project - @quota_project_id ||= credentials.quota_project_id if credentials.respond_to? :quota_project_id - - @secret_manager_service_stub = ::Google::Cloud::SecretManager::V1beta2::SecretManagerService::Rest::ServiceStub.new( - endpoint: @config.endpoint, - endpoint_template: DEFAULT_ENDPOINT_TEMPLATE, - universe_domain: @config.universe_domain, - credentials: credentials, - logger: @config.logger - ) - - @secret_manager_service_stub.logger(stub: true)&.info do |entry| - entry.set_system_name - entry.set_service - entry.message = "Created client for #{entry.service}" - entry.set_credentials_fields credentials - entry.set "customEndpoint", @config.endpoint if @config.endpoint - entry.set "defaultTimeout", @config.timeout if @config.timeout - entry.set "quotaProject", @quota_project_id if @quota_project_id - end - - @location_client = Google::Cloud::Location::Locations::Rest::Client.new do |config| - config.credentials = credentials - config.quota_project = @quota_project_id - config.endpoint = @secret_manager_service_stub.endpoint - config.universe_domain = @secret_manager_service_stub.universe_domain - config.bindings_override = @config.bindings_override - config.logger = @secret_manager_service_stub.logger if config.respond_to? :logger= - end - end - - ## - # Get the associated client for mix-in of the Locations. - # - # @return [Google::Cloud::Location::Locations::Rest::Client] - # - attr_reader :location_client - - ## - # The logger used for request/response debug logging. - # - # @return [Logger] - # - def logger - @secret_manager_service_stub.logger - end - - # Service calls - - ## - # Lists {::Google::Cloud::SecretManager::V1beta2::Secret Secrets}. - # - # @overload list_secrets(request, options = nil) - # Pass arguments to `list_secrets` via a request object, either of type - # {::Google::Cloud::SecretManager::V1beta2::ListSecretsRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::SecretManager::V1beta2::ListSecretsRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @overload list_secrets(parent: nil, page_size: nil, page_token: nil, filter: nil) - # Pass arguments to `list_secrets` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param parent [::String] - # Required. The resource name of the project associated with the - # {::Google::Cloud::SecretManager::V1beta2::Secret Secrets}, in the format - # `projects/*` or `projects/*/locations/*` - # @param page_size [::Integer] - # Optional. The maximum number of results to be returned in a single page. If - # set to 0, the server decides the number of results to return. If the - # number is greater than 25000, it is capped at 25000. - # @param page_token [::String] - # Optional. Pagination token, returned earlier via - # {::Google::Cloud::SecretManager::V1beta2::ListSecretsResponse#next_page_token ListSecretsResponse.next_page_token}. - # @param filter [::String] - # Optional. Filter string, adhering to the rules in - # [List-operation - # filtering](https://cloud.google.com/secret-manager/docs/filtering). List - # only secrets matching the filter. If filter is empty, all secrets are - # listed. - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Gapic::Rest::PagedEnumerable<::Google::Cloud::SecretManager::V1beta2::Secret>] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Gapic::Rest::PagedEnumerable<::Google::Cloud::SecretManager::V1beta2::Secret>] - # - # @raise [::Google::Cloud::Error] if the REST call is aborted. - # - # @example Basic example - # require "google/cloud/secret_manager/v1beta2" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::SecretManager::V1beta2::SecretManagerService::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::SecretManager::V1beta2::ListSecretsRequest.new - # - # # Call the list_secrets method. - # result = client.list_secrets request - # - # # The returned object is of type Gapic::PagedEnumerable. You can iterate - # # over elements, and API calls will be issued to fetch pages as needed. - # result.each do |item| - # # Each element is of type ::Google::Cloud::SecretManager::V1beta2::Secret. - # p item - # end - # - def list_secrets request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::SecretManager::V1beta2::ListSecretsRequest - - # Converts hash and nil to an options object - options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h - - # Customize the options with defaults - call_metadata = @config.rpcs.list_secrets.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::SecretManager::V1beta2::VERSION, - transports_version_send: [:rest] - - call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - options.apply_defaults timeout: @config.rpcs.list_secrets.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.list_secrets.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @secret_manager_service_stub.list_secrets request, options do |result, operation| - result = ::Gapic::Rest::PagedEnumerable.new @secret_manager_service_stub, :list_secrets, "secrets", request, result, options - yield result, operation if block_given? - throw :response, result - end - rescue ::Gapic::Rest::Error => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Creates a new {::Google::Cloud::SecretManager::V1beta2::Secret Secret} - # containing no - # {::Google::Cloud::SecretManager::V1beta2::SecretVersion SecretVersions}. - # - # @overload create_secret(request, options = nil) - # Pass arguments to `create_secret` via a request object, either of type - # {::Google::Cloud::SecretManager::V1beta2::CreateSecretRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::SecretManager::V1beta2::CreateSecretRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @overload create_secret(parent: nil, secret_id: nil, secret: nil) - # Pass arguments to `create_secret` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param parent [::String] - # Required. The resource name of the project to associate with the - # {::Google::Cloud::SecretManager::V1beta2::Secret Secret}, in the format - # `projects/*` or `projects/*/locations/*`. - # @param secret_id [::String] - # Required. This must be unique within the project. - # - # A secret ID is a string with a maximum length of 255 characters and can - # contain uppercase and lowercase letters, numerals, and the hyphen (`-`) and - # underscore (`_`) characters. - # @param secret [::Google::Cloud::SecretManager::V1beta2::Secret, ::Hash] - # Required. A {::Google::Cloud::SecretManager::V1beta2::Secret Secret} with - # initial field values. - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Cloud::SecretManager::V1beta2::Secret] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::SecretManager::V1beta2::Secret] - # - # @raise [::Google::Cloud::Error] if the REST call is aborted. - # - # @example Basic example - # require "google/cloud/secret_manager/v1beta2" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::SecretManager::V1beta2::SecretManagerService::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::SecretManager::V1beta2::CreateSecretRequest.new - # - # # Call the create_secret method. - # result = client.create_secret request - # - # # The returned object is of type Google::Cloud::SecretManager::V1beta2::Secret. - # p result - # - def create_secret request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::SecretManager::V1beta2::CreateSecretRequest - - # Converts hash and nil to an options object - options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h - - # Customize the options with defaults - call_metadata = @config.rpcs.create_secret.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::SecretManager::V1beta2::VERSION, - transports_version_send: [:rest] - - call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - options.apply_defaults timeout: @config.rpcs.create_secret.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.create_secret.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @secret_manager_service_stub.create_secret request, options do |result, operation| - yield result, operation if block_given? - end - rescue ::Gapic::Rest::Error => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Creates a new - # {::Google::Cloud::SecretManager::V1beta2::SecretVersion SecretVersion} - # containing secret data and attaches it to an existing - # {::Google::Cloud::SecretManager::V1beta2::Secret Secret}. - # - # @overload add_secret_version(request, options = nil) - # Pass arguments to `add_secret_version` via a request object, either of type - # {::Google::Cloud::SecretManager::V1beta2::AddSecretVersionRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::SecretManager::V1beta2::AddSecretVersionRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @overload add_secret_version(parent: nil, payload: nil) - # Pass arguments to `add_secret_version` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param parent [::String] - # Required. The resource name of the - # {::Google::Cloud::SecretManager::V1beta2::Secret Secret} to associate with the - # {::Google::Cloud::SecretManager::V1beta2::SecretVersion SecretVersion} in the - # format `projects/*/secrets/*` or `projects/*/locations/*/secrets/*`. - # @param payload [::Google::Cloud::SecretManager::V1beta2::SecretPayload, ::Hash] - # Required. The secret payload of the - # {::Google::Cloud::SecretManager::V1beta2::SecretVersion SecretVersion}. - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Cloud::SecretManager::V1beta2::SecretVersion] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::SecretManager::V1beta2::SecretVersion] - # - # @raise [::Google::Cloud::Error] if the REST call is aborted. - # - # @example Basic example - # require "google/cloud/secret_manager/v1beta2" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::SecretManager::V1beta2::SecretManagerService::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::SecretManager::V1beta2::AddSecretVersionRequest.new - # - # # Call the add_secret_version method. - # result = client.add_secret_version request - # - # # The returned object is of type Google::Cloud::SecretManager::V1beta2::SecretVersion. - # p result - # - def add_secret_version request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::SecretManager::V1beta2::AddSecretVersionRequest - - # Converts hash and nil to an options object - options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h - - # Customize the options with defaults - call_metadata = @config.rpcs.add_secret_version.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::SecretManager::V1beta2::VERSION, - transports_version_send: [:rest] - - call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - options.apply_defaults timeout: @config.rpcs.add_secret_version.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.add_secret_version.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @secret_manager_service_stub.add_secret_version request, options do |result, operation| - yield result, operation if block_given? - end - rescue ::Gapic::Rest::Error => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Gets metadata for a given - # {::Google::Cloud::SecretManager::V1beta2::Secret Secret}. - # - # @overload get_secret(request, options = nil) - # Pass arguments to `get_secret` via a request object, either of type - # {::Google::Cloud::SecretManager::V1beta2::GetSecretRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::SecretManager::V1beta2::GetSecretRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @overload get_secret(name: nil) - # Pass arguments to `get_secret` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param name [::String] - # Required. The resource name of the - # {::Google::Cloud::SecretManager::V1beta2::Secret Secret}, in the format - # `projects/*/secrets/*` or `projects/*/locations/*/secrets/*`. - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Cloud::SecretManager::V1beta2::Secret] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::SecretManager::V1beta2::Secret] - # - # @raise [::Google::Cloud::Error] if the REST call is aborted. - # - # @example Basic example - # require "google/cloud/secret_manager/v1beta2" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::SecretManager::V1beta2::SecretManagerService::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::SecretManager::V1beta2::GetSecretRequest.new - # - # # Call the get_secret method. - # result = client.get_secret request - # - # # The returned object is of type Google::Cloud::SecretManager::V1beta2::Secret. - # p result - # - def get_secret request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::SecretManager::V1beta2::GetSecretRequest - - # Converts hash and nil to an options object - options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h - - # Customize the options with defaults - call_metadata = @config.rpcs.get_secret.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::SecretManager::V1beta2::VERSION, - transports_version_send: [:rest] - - call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - options.apply_defaults timeout: @config.rpcs.get_secret.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.get_secret.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @secret_manager_service_stub.get_secret request, options do |result, operation| - yield result, operation if block_given? - end - rescue ::Gapic::Rest::Error => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Updates metadata of an existing - # {::Google::Cloud::SecretManager::V1beta2::Secret Secret}. - # - # @overload update_secret(request, options = nil) - # Pass arguments to `update_secret` via a request object, either of type - # {::Google::Cloud::SecretManager::V1beta2::UpdateSecretRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::SecretManager::V1beta2::UpdateSecretRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @overload update_secret(secret: nil, update_mask: nil) - # Pass arguments to `update_secret` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param secret [::Google::Cloud::SecretManager::V1beta2::Secret, ::Hash] - # Required. {::Google::Cloud::SecretManager::V1beta2::Secret Secret} with updated - # field values. - # @param update_mask [::Google::Protobuf::FieldMask, ::Hash] - # Required. Specifies the fields to be updated. - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Cloud::SecretManager::V1beta2::Secret] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::SecretManager::V1beta2::Secret] - # - # @raise [::Google::Cloud::Error] if the REST call is aborted. - # - # @example Basic example - # require "google/cloud/secret_manager/v1beta2" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::SecretManager::V1beta2::SecretManagerService::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::SecretManager::V1beta2::UpdateSecretRequest.new - # - # # Call the update_secret method. - # result = client.update_secret request - # - # # The returned object is of type Google::Cloud::SecretManager::V1beta2::Secret. - # p result - # - def update_secret request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::SecretManager::V1beta2::UpdateSecretRequest - - # Converts hash and nil to an options object - options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h - - # Customize the options with defaults - call_metadata = @config.rpcs.update_secret.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::SecretManager::V1beta2::VERSION, - transports_version_send: [:rest] - - call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - options.apply_defaults timeout: @config.rpcs.update_secret.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.update_secret.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @secret_manager_service_stub.update_secret request, options do |result, operation| - yield result, operation if block_given? - end - rescue ::Gapic::Rest::Error => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Deletes a {::Google::Cloud::SecretManager::V1beta2::Secret Secret}. - # - # @overload delete_secret(request, options = nil) - # Pass arguments to `delete_secret` via a request object, either of type - # {::Google::Cloud::SecretManager::V1beta2::DeleteSecretRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::SecretManager::V1beta2::DeleteSecretRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @overload delete_secret(name: nil, etag: nil) - # Pass arguments to `delete_secret` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param name [::String] - # Required. The resource name of the - # {::Google::Cloud::SecretManager::V1beta2::Secret Secret} to delete in the format - # `projects/*/secrets/*`. - # @param etag [::String] - # Optional. Etag of the {::Google::Cloud::SecretManager::V1beta2::Secret Secret}. - # The request succeeds if it matches the etag of the currently stored secret - # object. If the etag is omitted, the request succeeds. - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Protobuf::Empty] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Protobuf::Empty] - # - # @raise [::Google::Cloud::Error] if the REST call is aborted. - # - # @example Basic example - # require "google/cloud/secret_manager/v1beta2" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::SecretManager::V1beta2::SecretManagerService::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::SecretManager::V1beta2::DeleteSecretRequest.new - # - # # Call the delete_secret method. - # result = client.delete_secret request - # - # # The returned object is of type Google::Protobuf::Empty. - # p result - # - def delete_secret request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::SecretManager::V1beta2::DeleteSecretRequest - - # Converts hash and nil to an options object - options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h - - # Customize the options with defaults - call_metadata = @config.rpcs.delete_secret.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::SecretManager::V1beta2::VERSION, - transports_version_send: [:rest] - - call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - options.apply_defaults timeout: @config.rpcs.delete_secret.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.delete_secret.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @secret_manager_service_stub.delete_secret request, options do |result, operation| - yield result, operation if block_given? - end - rescue ::Gapic::Rest::Error => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Lists {::Google::Cloud::SecretManager::V1beta2::SecretVersion SecretVersions}. - # This call does not return secret data. - # - # @overload list_secret_versions(request, options = nil) - # Pass arguments to `list_secret_versions` via a request object, either of type - # {::Google::Cloud::SecretManager::V1beta2::ListSecretVersionsRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::SecretManager::V1beta2::ListSecretVersionsRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @overload list_secret_versions(parent: nil, page_size: nil, page_token: nil, filter: nil) - # Pass arguments to `list_secret_versions` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param parent [::String] - # Required. The resource name of the - # {::Google::Cloud::SecretManager::V1beta2::Secret Secret} associated with the - # {::Google::Cloud::SecretManager::V1beta2::SecretVersion SecretVersions} to list, - # in the format `projects/*/secrets/*` or `projects/*/locations/*/secrets/*`. - # @param page_size [::Integer] - # Optional. The maximum number of results to be returned in a single page. If - # set to 0, the server decides the number of results to return. If the - # number is greater than 25000, it is capped at 25000. - # @param page_token [::String] - # Optional. Pagination token, returned earlier via - # ListSecretVersionsResponse.next_page_token][]. - # @param filter [::String] - # Optional. Filter string, adhering to the rules in - # [List-operation - # filtering](https://cloud.google.com/secret-manager/docs/filtering). List - # only secret versions matching the filter. If filter is empty, all secret - # versions are listed. - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Gapic::Rest::PagedEnumerable<::Google::Cloud::SecretManager::V1beta2::SecretVersion>] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Gapic::Rest::PagedEnumerable<::Google::Cloud::SecretManager::V1beta2::SecretVersion>] - # - # @raise [::Google::Cloud::Error] if the REST call is aborted. - # - # @example Basic example - # require "google/cloud/secret_manager/v1beta2" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::SecretManager::V1beta2::SecretManagerService::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::SecretManager::V1beta2::ListSecretVersionsRequest.new - # - # # Call the list_secret_versions method. - # result = client.list_secret_versions request - # - # # The returned object is of type Gapic::PagedEnumerable. You can iterate - # # over elements, and API calls will be issued to fetch pages as needed. - # result.each do |item| - # # Each element is of type ::Google::Cloud::SecretManager::V1beta2::SecretVersion. - # p item - # end - # - def list_secret_versions request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::SecretManager::V1beta2::ListSecretVersionsRequest - - # Converts hash and nil to an options object - options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h - - # Customize the options with defaults - call_metadata = @config.rpcs.list_secret_versions.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::SecretManager::V1beta2::VERSION, - transports_version_send: [:rest] - - call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - options.apply_defaults timeout: @config.rpcs.list_secret_versions.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.list_secret_versions.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @secret_manager_service_stub.list_secret_versions request, options do |result, operation| - result = ::Gapic::Rest::PagedEnumerable.new @secret_manager_service_stub, :list_secret_versions, "versions", request, result, options - yield result, operation if block_given? - throw :response, result - end - rescue ::Gapic::Rest::Error => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Gets metadata for a - # {::Google::Cloud::SecretManager::V1beta2::SecretVersion SecretVersion}. - # - # `projects/*/secrets/*/versions/latest` is an alias to the most recently - # created {::Google::Cloud::SecretManager::V1beta2::SecretVersion SecretVersion}. - # - # @overload get_secret_version(request, options = nil) - # Pass arguments to `get_secret_version` via a request object, either of type - # {::Google::Cloud::SecretManager::V1beta2::GetSecretVersionRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::SecretManager::V1beta2::GetSecretVersionRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @overload get_secret_version(name: nil) - # Pass arguments to `get_secret_version` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param name [::String] - # Required. The resource name of the - # {::Google::Cloud::SecretManager::V1beta2::SecretVersion SecretVersion} in the - # format `projects/*/secrets/*/versions/*` or - # `projects/*/locations/*/secrets/*/versions/*`. - # - # `projects/*/secrets/*/versions/latest` or - # `projects/*/locations/*/secrets/*/versions/latest` is an alias to the most - # recently created - # {::Google::Cloud::SecretManager::V1beta2::SecretVersion SecretVersion}. - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Cloud::SecretManager::V1beta2::SecretVersion] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::SecretManager::V1beta2::SecretVersion] - # - # @raise [::Google::Cloud::Error] if the REST call is aborted. - # - # @example Basic example - # require "google/cloud/secret_manager/v1beta2" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::SecretManager::V1beta2::SecretManagerService::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::SecretManager::V1beta2::GetSecretVersionRequest.new - # - # # Call the get_secret_version method. - # result = client.get_secret_version request - # - # # The returned object is of type Google::Cloud::SecretManager::V1beta2::SecretVersion. - # p result - # - def get_secret_version request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::SecretManager::V1beta2::GetSecretVersionRequest - - # Converts hash and nil to an options object - options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h - - # Customize the options with defaults - call_metadata = @config.rpcs.get_secret_version.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::SecretManager::V1beta2::VERSION, - transports_version_send: [:rest] - - call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - options.apply_defaults timeout: @config.rpcs.get_secret_version.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.get_secret_version.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @secret_manager_service_stub.get_secret_version request, options do |result, operation| - yield result, operation if block_given? - end - rescue ::Gapic::Rest::Error => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Accesses a - # {::Google::Cloud::SecretManager::V1beta2::SecretVersion SecretVersion}. This - # call returns the secret data. - # - # `projects/*/secrets/*/versions/latest` is an alias to the most recently - # created {::Google::Cloud::SecretManager::V1beta2::SecretVersion SecretVersion}. - # - # @overload access_secret_version(request, options = nil) - # Pass arguments to `access_secret_version` via a request object, either of type - # {::Google::Cloud::SecretManager::V1beta2::AccessSecretVersionRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::SecretManager::V1beta2::AccessSecretVersionRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @overload access_secret_version(name: nil) - # Pass arguments to `access_secret_version` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param name [::String] - # Required. The resource name of the - # {::Google::Cloud::SecretManager::V1beta2::SecretVersion SecretVersion} in the - # format `projects/*/secrets/*/versions/*` or - # `projects/*/locations/*/secrets/*/versions/*`. - # - # `projects/*/secrets/*/versions/latest` or - # `projects/*/locations/*/secrets/*/versions/latest` is an alias to the most - # recently created - # {::Google::Cloud::SecretManager::V1beta2::SecretVersion SecretVersion}. - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Cloud::SecretManager::V1beta2::AccessSecretVersionResponse] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::SecretManager::V1beta2::AccessSecretVersionResponse] - # - # @raise [::Google::Cloud::Error] if the REST call is aborted. - # - # @example Basic example - # require "google/cloud/secret_manager/v1beta2" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::SecretManager::V1beta2::SecretManagerService::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::SecretManager::V1beta2::AccessSecretVersionRequest.new - # - # # Call the access_secret_version method. - # result = client.access_secret_version request - # - # # The returned object is of type Google::Cloud::SecretManager::V1beta2::AccessSecretVersionResponse. - # p result - # - def access_secret_version request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::SecretManager::V1beta2::AccessSecretVersionRequest - - # Converts hash and nil to an options object - options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h - - # Customize the options with defaults - call_metadata = @config.rpcs.access_secret_version.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::SecretManager::V1beta2::VERSION, - transports_version_send: [:rest] - - call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - options.apply_defaults timeout: @config.rpcs.access_secret_version.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.access_secret_version.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @secret_manager_service_stub.access_secret_version request, options do |result, operation| - yield result, operation if block_given? - end - rescue ::Gapic::Rest::Error => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Disables a - # {::Google::Cloud::SecretManager::V1beta2::SecretVersion SecretVersion}. - # - # Sets the {::Google::Cloud::SecretManager::V1beta2::SecretVersion#state state} of - # the {::Google::Cloud::SecretManager::V1beta2::SecretVersion SecretVersion} to - # {::Google::Cloud::SecretManager::V1beta2::SecretVersion::State::DISABLED DISABLED}. - # - # @overload disable_secret_version(request, options = nil) - # Pass arguments to `disable_secret_version` via a request object, either of type - # {::Google::Cloud::SecretManager::V1beta2::DisableSecretVersionRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::SecretManager::V1beta2::DisableSecretVersionRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @overload disable_secret_version(name: nil, etag: nil) - # Pass arguments to `disable_secret_version` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param name [::String] - # Required. The resource name of the - # {::Google::Cloud::SecretManager::V1beta2::SecretVersion SecretVersion} to - # disable in the format `projects/*/secrets/*/versions/*` or - # `projects/*/locations/*/secrets/*/versions/*`. - # @param etag [::String] - # Optional. Etag of the - # {::Google::Cloud::SecretManager::V1beta2::SecretVersion SecretVersion}. The - # request succeeds if it matches the etag of the currently stored secret - # version object. If the etag is omitted, the request succeeds. - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Cloud::SecretManager::V1beta2::SecretVersion] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::SecretManager::V1beta2::SecretVersion] - # - # @raise [::Google::Cloud::Error] if the REST call is aborted. - # - # @example Basic example - # require "google/cloud/secret_manager/v1beta2" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::SecretManager::V1beta2::SecretManagerService::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::SecretManager::V1beta2::DisableSecretVersionRequest.new - # - # # Call the disable_secret_version method. - # result = client.disable_secret_version request - # - # # The returned object is of type Google::Cloud::SecretManager::V1beta2::SecretVersion. - # p result - # - def disable_secret_version request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::SecretManager::V1beta2::DisableSecretVersionRequest - - # Converts hash and nil to an options object - options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h - - # Customize the options with defaults - call_metadata = @config.rpcs.disable_secret_version.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::SecretManager::V1beta2::VERSION, - transports_version_send: [:rest] - - call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - options.apply_defaults timeout: @config.rpcs.disable_secret_version.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.disable_secret_version.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @secret_manager_service_stub.disable_secret_version request, options do |result, operation| - yield result, operation if block_given? - end - rescue ::Gapic::Rest::Error => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Enables a - # {::Google::Cloud::SecretManager::V1beta2::SecretVersion SecretVersion}. - # - # Sets the {::Google::Cloud::SecretManager::V1beta2::SecretVersion#state state} of - # the {::Google::Cloud::SecretManager::V1beta2::SecretVersion SecretVersion} to - # {::Google::Cloud::SecretManager::V1beta2::SecretVersion::State::ENABLED ENABLED}. - # - # @overload enable_secret_version(request, options = nil) - # Pass arguments to `enable_secret_version` via a request object, either of type - # {::Google::Cloud::SecretManager::V1beta2::EnableSecretVersionRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::SecretManager::V1beta2::EnableSecretVersionRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @overload enable_secret_version(name: nil, etag: nil) - # Pass arguments to `enable_secret_version` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param name [::String] - # Required. The resource name of the - # {::Google::Cloud::SecretManager::V1beta2::SecretVersion SecretVersion} to enable - # in the format `projects/*/secrets/*/versions/*` or - # `projects/*/locations/*/secrets/*/versions/*`. - # @param etag [::String] - # Optional. Etag of the - # {::Google::Cloud::SecretManager::V1beta2::SecretVersion SecretVersion}. The - # request succeeds if it matches the etag of the currently stored secret - # version object. If the etag is omitted, the request succeeds. - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Cloud::SecretManager::V1beta2::SecretVersion] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::SecretManager::V1beta2::SecretVersion] - # - # @raise [::Google::Cloud::Error] if the REST call is aborted. - # - # @example Basic example - # require "google/cloud/secret_manager/v1beta2" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::SecretManager::V1beta2::SecretManagerService::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::SecretManager::V1beta2::EnableSecretVersionRequest.new - # - # # Call the enable_secret_version method. - # result = client.enable_secret_version request - # - # # The returned object is of type Google::Cloud::SecretManager::V1beta2::SecretVersion. - # p result - # - def enable_secret_version request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::SecretManager::V1beta2::EnableSecretVersionRequest - - # Converts hash and nil to an options object - options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h - - # Customize the options with defaults - call_metadata = @config.rpcs.enable_secret_version.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::SecretManager::V1beta2::VERSION, - transports_version_send: [:rest] - - call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - options.apply_defaults timeout: @config.rpcs.enable_secret_version.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.enable_secret_version.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @secret_manager_service_stub.enable_secret_version request, options do |result, operation| - yield result, operation if block_given? - end - rescue ::Gapic::Rest::Error => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Destroys a - # {::Google::Cloud::SecretManager::V1beta2::SecretVersion SecretVersion}. - # - # Sets the {::Google::Cloud::SecretManager::V1beta2::SecretVersion#state state} of - # the {::Google::Cloud::SecretManager::V1beta2::SecretVersion SecretVersion} to - # {::Google::Cloud::SecretManager::V1beta2::SecretVersion::State::DESTROYED DESTROYED} - # and irrevocably destroys the secret data. - # - # @overload destroy_secret_version(request, options = nil) - # Pass arguments to `destroy_secret_version` via a request object, either of type - # {::Google::Cloud::SecretManager::V1beta2::DestroySecretVersionRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::SecretManager::V1beta2::DestroySecretVersionRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @overload destroy_secret_version(name: nil, etag: nil) - # Pass arguments to `destroy_secret_version` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param name [::String] - # Required. The resource name of the - # {::Google::Cloud::SecretManager::V1beta2::SecretVersion SecretVersion} to - # destroy in the format `projects/*/secrets/*/versions/*` or - # `projects/*/locations/*/secrets/*/versions/*`. - # @param etag [::String] - # Optional. Etag of the - # {::Google::Cloud::SecretManager::V1beta2::SecretVersion SecretVersion}. The - # request succeeds if it matches the etag of the currently stored secret - # version object. If the etag is omitted, the request succeeds. - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Cloud::SecretManager::V1beta2::SecretVersion] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::SecretManager::V1beta2::SecretVersion] - # - # @raise [::Google::Cloud::Error] if the REST call is aborted. - # - # @example Basic example - # require "google/cloud/secret_manager/v1beta2" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::SecretManager::V1beta2::SecretManagerService::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::SecretManager::V1beta2::DestroySecretVersionRequest.new - # - # # Call the destroy_secret_version method. - # result = client.destroy_secret_version request - # - # # The returned object is of type Google::Cloud::SecretManager::V1beta2::SecretVersion. - # p result - # - def destroy_secret_version request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::SecretManager::V1beta2::DestroySecretVersionRequest - - # Converts hash and nil to an options object - options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h - - # Customize the options with defaults - call_metadata = @config.rpcs.destroy_secret_version.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::SecretManager::V1beta2::VERSION, - transports_version_send: [:rest] - - call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - options.apply_defaults timeout: @config.rpcs.destroy_secret_version.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.destroy_secret_version.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @secret_manager_service_stub.destroy_secret_version request, options do |result, operation| - yield result, operation if block_given? - end - rescue ::Gapic::Rest::Error => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Sets the access control policy on the specified secret. Replaces any - # existing policy. - # - # Permissions on - # {::Google::Cloud::SecretManager::V1beta2::SecretVersion SecretVersions} are - # enforced according to the policy set on the associated - # {::Google::Cloud::SecretManager::V1beta2::Secret Secret}. - # - # @overload set_iam_policy(request, options = nil) - # Pass arguments to `set_iam_policy` via a request object, either of type - # {::Google::Iam::V1::SetIamPolicyRequest} or an equivalent Hash. - # - # @param request [::Google::Iam::V1::SetIamPolicyRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @overload set_iam_policy(resource: nil, policy: nil, update_mask: nil) - # Pass arguments to `set_iam_policy` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param resource [::String] - # REQUIRED: The resource for which the policy is being specified. - # See the operation documentation for the appropriate value for this field. - # @param policy [::Google::Iam::V1::Policy, ::Hash] - # REQUIRED: The complete policy to be applied to the `resource`. The size of - # the policy is limited to a few 10s of KB. An empty policy is a - # valid policy but certain Cloud Platform services (such as Projects) - # might reject them. - # @param update_mask [::Google::Protobuf::FieldMask, ::Hash] - # OPTIONAL: A FieldMask specifying which fields of the policy to modify. Only - # the fields in the mask will be modified. If no mask is provided, the - # following default mask is used: - # - # `paths: "bindings, etag"` - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Iam::V1::Policy] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Iam::V1::Policy] - # - # @raise [::Google::Cloud::Error] if the REST call is aborted. - # - # @example Basic example - # require "google/cloud/secret_manager/v1beta2" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::SecretManager::V1beta2::SecretManagerService::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Iam::V1::SetIamPolicyRequest.new - # - # # Call the set_iam_policy method. - # result = client.set_iam_policy request - # - # # The returned object is of type Google::Iam::V1::Policy. - # p result - # - def set_iam_policy request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Iam::V1::SetIamPolicyRequest - - # Converts hash and nil to an options object - options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h - - # Customize the options with defaults - call_metadata = @config.rpcs.set_iam_policy.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::SecretManager::V1beta2::VERSION, - transports_version_send: [:rest] - - call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - options.apply_defaults timeout: @config.rpcs.set_iam_policy.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.set_iam_policy.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @secret_manager_service_stub.set_iam_policy request, options do |result, operation| - yield result, operation if block_given? - end - rescue ::Gapic::Rest::Error => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Gets the access control policy for a secret. - # Returns empty policy if the secret exists and does not have a policy set. - # - # @overload get_iam_policy(request, options = nil) - # Pass arguments to `get_iam_policy` via a request object, either of type - # {::Google::Iam::V1::GetIamPolicyRequest} or an equivalent Hash. - # - # @param request [::Google::Iam::V1::GetIamPolicyRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @overload get_iam_policy(resource: nil, options: nil) - # Pass arguments to `get_iam_policy` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param resource [::String] - # REQUIRED: The resource for which the policy is being requested. - # See the operation documentation for the appropriate value for this field. - # @param options [::Google::Iam::V1::GetPolicyOptions, ::Hash] - # OPTIONAL: A `GetPolicyOptions` object for specifying options to - # `GetIamPolicy`. - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Iam::V1::Policy] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Iam::V1::Policy] - # - # @raise [::Google::Cloud::Error] if the REST call is aborted. - # - # @example Basic example - # require "google/cloud/secret_manager/v1beta2" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::SecretManager::V1beta2::SecretManagerService::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Iam::V1::GetIamPolicyRequest.new - # - # # Call the get_iam_policy method. - # result = client.get_iam_policy request - # - # # The returned object is of type Google::Iam::V1::Policy. - # p result - # - def get_iam_policy request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Iam::V1::GetIamPolicyRequest - - # Converts hash and nil to an options object - options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h - - # Customize the options with defaults - call_metadata = @config.rpcs.get_iam_policy.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::SecretManager::V1beta2::VERSION, - transports_version_send: [:rest] - - call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - options.apply_defaults timeout: @config.rpcs.get_iam_policy.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.get_iam_policy.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @secret_manager_service_stub.get_iam_policy request, options do |result, operation| - yield result, operation if block_given? - end - rescue ::Gapic::Rest::Error => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Returns permissions that a caller has for the specified secret. - # If the secret does not exist, this call returns an empty set of - # permissions, not a NOT_FOUND error. - # - # Note: This operation is designed to be used for building permission-aware - # UIs and command-line tools, not for authorization checking. This operation - # may "fail open" without warning. - # - # @overload test_iam_permissions(request, options = nil) - # Pass arguments to `test_iam_permissions` via a request object, either of type - # {::Google::Iam::V1::TestIamPermissionsRequest} or an equivalent Hash. - # - # @param request [::Google::Iam::V1::TestIamPermissionsRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @overload test_iam_permissions(resource: nil, permissions: nil) - # Pass arguments to `test_iam_permissions` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param resource [::String] - # REQUIRED: The resource for which the policy detail is being requested. - # See the operation documentation for the appropriate value for this field. - # @param permissions [::Array<::String>] - # The set of permissions to check for the `resource`. Permissions with - # wildcards (such as '*' or 'storage.*') are not allowed. For more - # information see - # [IAM Overview](https://cloud.google.com/iam/docs/overview#permissions). - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Iam::V1::TestIamPermissionsResponse] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Iam::V1::TestIamPermissionsResponse] - # - # @raise [::Google::Cloud::Error] if the REST call is aborted. - # - # @example Basic example - # require "google/cloud/secret_manager/v1beta2" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::SecretManager::V1beta2::SecretManagerService::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Iam::V1::TestIamPermissionsRequest.new - # - # # Call the test_iam_permissions method. - # result = client.test_iam_permissions request - # - # # The returned object is of type Google::Iam::V1::TestIamPermissionsResponse. - # p result - # - def test_iam_permissions request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Iam::V1::TestIamPermissionsRequest - - # Converts hash and nil to an options object - options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h - - # Customize the options with defaults - call_metadata = @config.rpcs.test_iam_permissions.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::SecretManager::V1beta2::VERSION, - transports_version_send: [:rest] - - call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - options.apply_defaults timeout: @config.rpcs.test_iam_permissions.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.test_iam_permissions.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @secret_manager_service_stub.test_iam_permissions request, options do |result, operation| - yield result, operation if block_given? - end - rescue ::Gapic::Rest::Error => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Configuration class for the SecretManagerService REST API. - # - # This class represents the configuration for SecretManagerService REST, - # providing control over timeouts, retry behavior, logging, transport - # parameters, and other low-level controls. Certain parameters can also be - # applied individually to specific RPCs. See - # {::Google::Cloud::SecretManager::V1beta2::SecretManagerService::Rest::Client::Configuration::Rpcs} - # for a list of RPCs that can be configured independently. - # - # Configuration can be applied globally to all clients, or to a single client - # on construction. - # - # @example - # - # # Modify the global config, setting the timeout for - # # list_secrets to 20 seconds, - # # and all remaining timeouts to 10 seconds. - # ::Google::Cloud::SecretManager::V1beta2::SecretManagerService::Rest::Client.configure do |config| - # config.timeout = 10.0 - # config.rpcs.list_secrets.timeout = 20.0 - # end - # - # # Apply the above configuration only to a new client. - # client = ::Google::Cloud::SecretManager::V1beta2::SecretManagerService::Rest::Client.new do |config| - # config.timeout = 10.0 - # config.rpcs.list_secrets.timeout = 20.0 - # end - # - # @!attribute [rw] endpoint - # A custom service endpoint, as a hostname or hostname:port. The default is - # nil, indicating to use the default endpoint in the current universe domain. - # @return [::String,nil] - # @!attribute [rw] credentials - # Credentials to send with calls. You may provide any of the following types: - # * (`String`) The path to a service account key file in JSON format - # * (`Hash`) A service account key as a Hash - # * (`Google::Auth::Credentials`) A googleauth credentials object - # (see the [googleauth docs](https://rubydoc.info/gems/googleauth/Google/Auth/Credentials)) - # * (`Signet::OAuth2::Client`) A signet oauth2 client object - # (see the [signet docs](https://rubydoc.info/gems/signet/Signet/OAuth2/Client)) - # * (`nil`) indicating no credentials - # - # Warning: If you accept a credential configuration (JSON file or Hash) from an - # external source for authentication to Google Cloud, you must validate it before - # providing it to a Google API client library. Providing an unvalidated credential - # configuration to Google APIs can compromise the security of your systems and data. - # For more information, refer to [Validate credential configurations from external - # sources](https://cloud.google.com/docs/authentication/external/externally-sourced-credentials). - # @return [::Object] - # @!attribute [rw] scope - # The OAuth scopes - # @return [::Array<::String>] - # @!attribute [rw] lib_name - # The library name as recorded in instrumentation and logging - # @return [::String] - # @!attribute [rw] lib_version - # The library version as recorded in instrumentation and logging - # @return [::String] - # @!attribute [rw] timeout - # The call timeout in seconds. - # @return [::Numeric] - # @!attribute [rw] metadata - # Additional headers to be sent with the call. - # @return [::Hash{::Symbol=>::String}] - # @!attribute [rw] retry_policy - # The retry policy. The value is a hash with the following keys: - # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds. - # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds. - # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier. - # * `:retry_codes` (*type:* `Array`) - The error codes that should - # trigger a retry. - # @return [::Hash] - # @!attribute [rw] quota_project - # A separate project against which to charge quota. - # @return [::String] - # @!attribute [rw] universe_domain - # The universe domain within which to make requests. This determines the - # default endpoint URL. The default value of nil uses the environment - # universe (usually the default "googleapis.com" universe). - # @return [::String,nil] - # @!attribute [rw] logger - # A custom logger to use for request/response debug logging, or the value - # `:default` (the default) to construct a default logger, or `nil` to - # explicitly disable logging. - # @return [::Logger,:default,nil] - # - class Configuration - extend ::Gapic::Config - - # @private - # The endpoint specific to the default "googleapis.com" universe. Deprecated. - DEFAULT_ENDPOINT = "secretmanager.googleapis.com" - - config_attr :endpoint, nil, ::String, nil - config_attr :credentials, nil do |value| - allowed = [::String, ::Hash, ::Proc, ::Symbol, ::Google::Auth::Credentials, ::Google::Auth::BaseClient, ::Signet::OAuth2::Client, nil] - allowed.any? { |klass| klass === value } - end - config_attr :scope, nil, ::String, ::Array, nil - config_attr :lib_name, nil, ::String, nil - config_attr :lib_version, nil, ::String, nil - config_attr :timeout, nil, ::Numeric, nil - config_attr :metadata, nil, ::Hash, nil - config_attr :retry_policy, nil, ::Hash, ::Proc, nil - config_attr :quota_project, nil, ::String, nil - config_attr :universe_domain, nil, ::String, nil - - # @private - # Overrides for http bindings for the RPCs of this service - # are only used when this service is used as mixin, and only - # by the host service. - # @return [::Hash{::Symbol=>::Array<::Gapic::Rest::GrpcTranscoder::HttpBinding>}] - config_attr :bindings_override, {}, ::Hash, nil - config_attr :logger, :default, ::Logger, nil, :default - - # @private - def initialize parent_config = nil - @parent_config = parent_config unless parent_config.nil? - - yield self if block_given? - end - - ## - # Configurations for individual RPCs - # @return [Rpcs] - # - def rpcs - @rpcs ||= begin - parent_rpcs = nil - parent_rpcs = @parent_config.rpcs if defined?(@parent_config) && @parent_config.respond_to?(:rpcs) - Rpcs.new parent_rpcs - end - end - - ## - # Configuration RPC class for the SecretManagerService API. - # - # Includes fields providing the configuration for each RPC in this service. - # Each configuration object is of type `Gapic::Config::Method` and includes - # the following configuration fields: - # - # * `timeout` (*type:* `Numeric`) - The call timeout in seconds - # * `metadata` (*type:* `Hash{Symbol=>String}`) - Additional headers - # * `retry_policy (*type:* `Hash`) - The retry policy. The policy fields - # include the following keys: - # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds. - # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds. - # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier. - # * `:retry_codes` (*type:* `Array`) - The error codes that should - # trigger a retry. - # - class Rpcs - ## - # RPC-specific configuration for `list_secrets` - # @return [::Gapic::Config::Method] - # - attr_reader :list_secrets - ## - # RPC-specific configuration for `create_secret` - # @return [::Gapic::Config::Method] - # - attr_reader :create_secret - ## - # RPC-specific configuration for `add_secret_version` - # @return [::Gapic::Config::Method] - # - attr_reader :add_secret_version - ## - # RPC-specific configuration for `get_secret` - # @return [::Gapic::Config::Method] - # - attr_reader :get_secret - ## - # RPC-specific configuration for `update_secret` - # @return [::Gapic::Config::Method] - # - attr_reader :update_secret - ## - # RPC-specific configuration for `delete_secret` - # @return [::Gapic::Config::Method] - # - attr_reader :delete_secret - ## - # RPC-specific configuration for `list_secret_versions` - # @return [::Gapic::Config::Method] - # - attr_reader :list_secret_versions - ## - # RPC-specific configuration for `get_secret_version` - # @return [::Gapic::Config::Method] - # - attr_reader :get_secret_version - ## - # RPC-specific configuration for `access_secret_version` - # @return [::Gapic::Config::Method] - # - attr_reader :access_secret_version - ## - # RPC-specific configuration for `disable_secret_version` - # @return [::Gapic::Config::Method] - # - attr_reader :disable_secret_version - ## - # RPC-specific configuration for `enable_secret_version` - # @return [::Gapic::Config::Method] - # - attr_reader :enable_secret_version - ## - # RPC-specific configuration for `destroy_secret_version` - # @return [::Gapic::Config::Method] - # - attr_reader :destroy_secret_version - ## - # RPC-specific configuration for `set_iam_policy` - # @return [::Gapic::Config::Method] - # - attr_reader :set_iam_policy - ## - # RPC-specific configuration for `get_iam_policy` - # @return [::Gapic::Config::Method] - # - attr_reader :get_iam_policy - ## - # RPC-specific configuration for `test_iam_permissions` - # @return [::Gapic::Config::Method] - # - attr_reader :test_iam_permissions - - # @private - def initialize parent_rpcs = nil - list_secrets_config = parent_rpcs.list_secrets if parent_rpcs.respond_to? :list_secrets - @list_secrets = ::Gapic::Config::Method.new list_secrets_config - create_secret_config = parent_rpcs.create_secret if parent_rpcs.respond_to? :create_secret - @create_secret = ::Gapic::Config::Method.new create_secret_config - add_secret_version_config = parent_rpcs.add_secret_version if parent_rpcs.respond_to? :add_secret_version - @add_secret_version = ::Gapic::Config::Method.new add_secret_version_config - get_secret_config = parent_rpcs.get_secret if parent_rpcs.respond_to? :get_secret - @get_secret = ::Gapic::Config::Method.new get_secret_config - update_secret_config = parent_rpcs.update_secret if parent_rpcs.respond_to? :update_secret - @update_secret = ::Gapic::Config::Method.new update_secret_config - delete_secret_config = parent_rpcs.delete_secret if parent_rpcs.respond_to? :delete_secret - @delete_secret = ::Gapic::Config::Method.new delete_secret_config - list_secret_versions_config = parent_rpcs.list_secret_versions if parent_rpcs.respond_to? :list_secret_versions - @list_secret_versions = ::Gapic::Config::Method.new list_secret_versions_config - get_secret_version_config = parent_rpcs.get_secret_version if parent_rpcs.respond_to? :get_secret_version - @get_secret_version = ::Gapic::Config::Method.new get_secret_version_config - access_secret_version_config = parent_rpcs.access_secret_version if parent_rpcs.respond_to? :access_secret_version - @access_secret_version = ::Gapic::Config::Method.new access_secret_version_config - disable_secret_version_config = parent_rpcs.disable_secret_version if parent_rpcs.respond_to? :disable_secret_version - @disable_secret_version = ::Gapic::Config::Method.new disable_secret_version_config - enable_secret_version_config = parent_rpcs.enable_secret_version if parent_rpcs.respond_to? :enable_secret_version - @enable_secret_version = ::Gapic::Config::Method.new enable_secret_version_config - destroy_secret_version_config = parent_rpcs.destroy_secret_version if parent_rpcs.respond_to? :destroy_secret_version - @destroy_secret_version = ::Gapic::Config::Method.new destroy_secret_version_config - set_iam_policy_config = parent_rpcs.set_iam_policy if parent_rpcs.respond_to? :set_iam_policy - @set_iam_policy = ::Gapic::Config::Method.new set_iam_policy_config - get_iam_policy_config = parent_rpcs.get_iam_policy if parent_rpcs.respond_to? :get_iam_policy - @get_iam_policy = ::Gapic::Config::Method.new get_iam_policy_config - test_iam_permissions_config = parent_rpcs.test_iam_permissions if parent_rpcs.respond_to? :test_iam_permissions - @test_iam_permissions = ::Gapic::Config::Method.new test_iam_permissions_config - - yield self if block_given? - end - end - end - end - end - end - end - end - end -end diff --git a/owl-bot-staging/google-cloud-secret_manager-v1beta2/lib/google/cloud/secret_manager/v1beta2/secret_manager_service/rest/service_stub.rb b/owl-bot-staging/google-cloud-secret_manager-v1beta2/lib/google/cloud/secret_manager/v1beta2/secret_manager_service/rest/service_stub.rb deleted file mode 100644 index 6975b7911fd6..000000000000 --- a/owl-bot-staging/google-cloud-secret_manager-v1beta2/lib/google/cloud/secret_manager/v1beta2/secret_manager_service/rest/service_stub.rb +++ /dev/null @@ -1,1117 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -require "google/cloud/secretmanager/v1beta2/service_pb" - -module Google - module Cloud - module SecretManager - module V1beta2 - module SecretManagerService - module Rest - ## - # REST service stub for the SecretManagerService service. - # Service stub contains baseline method implementations - # including transcoding, making the REST call, and deserialing the response. - # - class ServiceStub - # @private - def initialize endpoint:, endpoint_template:, universe_domain:, credentials:, logger: - # These require statements are intentionally placed here to initialize - # the REST modules only when it's required. - require "gapic/rest" - - @client_stub = ::Gapic::Rest::ClientStub.new endpoint: endpoint, - endpoint_template: endpoint_template, - universe_domain: universe_domain, - credentials: credentials, - numeric_enums: true, - service_name: self.class, - raise_faraday_errors: false, - logger: logger - end - - ## - # The effective universe domain - # - # @return [String] - # - def universe_domain - @client_stub.universe_domain - end - - ## - # The effective endpoint - # - # @return [String] - # - def endpoint - @client_stub.endpoint - end - - ## - # The logger used for request/response debug logging. - # - # @return [Logger] - # - def logger stub: false - stub ? @client_stub.stub_logger : @client_stub.logger - end - - ## - # Baseline implementation for the list_secrets REST call - # - # @param request_pb [::Google::Cloud::SecretManager::V1beta2::ListSecretsRequest] - # A request object representing the call parameters. Required. - # @param options [::Gapic::CallOptions] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Cloud::SecretManager::V1beta2::ListSecretsResponse] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::SecretManager::V1beta2::ListSecretsResponse] - # A result object deserialized from the server's reply - def list_secrets request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_list_secrets_request request_pb - query_string_params = if query_string_params.any? - query_string_params.to_h { |p| p.split "=", 2 } - else - {} - end - - response = @client_stub.make_http_request( - verb, - uri: uri, - body: body || "", - params: query_string_params, - method_name: "list_secrets", - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Cloud::SecretManager::V1beta2::ListSecretsResponse.decode_json response.body, ignore_unknown_fields: true - catch :response do - yield result, operation if block_given? - result - end - end - - ## - # Baseline implementation for the create_secret REST call - # - # @param request_pb [::Google::Cloud::SecretManager::V1beta2::CreateSecretRequest] - # A request object representing the call parameters. Required. - # @param options [::Gapic::CallOptions] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Cloud::SecretManager::V1beta2::Secret] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::SecretManager::V1beta2::Secret] - # A result object deserialized from the server's reply - def create_secret request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_create_secret_request request_pb - query_string_params = if query_string_params.any? - query_string_params.to_h { |p| p.split "=", 2 } - else - {} - end - - response = @client_stub.make_http_request( - verb, - uri: uri, - body: body || "", - params: query_string_params, - method_name: "create_secret", - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Cloud::SecretManager::V1beta2::Secret.decode_json response.body, ignore_unknown_fields: true - catch :response do - yield result, operation if block_given? - result - end - end - - ## - # Baseline implementation for the add_secret_version REST call - # - # @param request_pb [::Google::Cloud::SecretManager::V1beta2::AddSecretVersionRequest] - # A request object representing the call parameters. Required. - # @param options [::Gapic::CallOptions] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Cloud::SecretManager::V1beta2::SecretVersion] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::SecretManager::V1beta2::SecretVersion] - # A result object deserialized from the server's reply - def add_secret_version request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_add_secret_version_request request_pb - query_string_params = if query_string_params.any? - query_string_params.to_h { |p| p.split "=", 2 } - else - {} - end - - response = @client_stub.make_http_request( - verb, - uri: uri, - body: body || "", - params: query_string_params, - method_name: "add_secret_version", - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Cloud::SecretManager::V1beta2::SecretVersion.decode_json response.body, ignore_unknown_fields: true - catch :response do - yield result, operation if block_given? - result - end - end - - ## - # Baseline implementation for the get_secret REST call - # - # @param request_pb [::Google::Cloud::SecretManager::V1beta2::GetSecretRequest] - # A request object representing the call parameters. Required. - # @param options [::Gapic::CallOptions] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Cloud::SecretManager::V1beta2::Secret] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::SecretManager::V1beta2::Secret] - # A result object deserialized from the server's reply - def get_secret request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_get_secret_request request_pb - query_string_params = if query_string_params.any? - query_string_params.to_h { |p| p.split "=", 2 } - else - {} - end - - response = @client_stub.make_http_request( - verb, - uri: uri, - body: body || "", - params: query_string_params, - method_name: "get_secret", - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Cloud::SecretManager::V1beta2::Secret.decode_json response.body, ignore_unknown_fields: true - catch :response do - yield result, operation if block_given? - result - end - end - - ## - # Baseline implementation for the update_secret REST call - # - # @param request_pb [::Google::Cloud::SecretManager::V1beta2::UpdateSecretRequest] - # A request object representing the call parameters. Required. - # @param options [::Gapic::CallOptions] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Cloud::SecretManager::V1beta2::Secret] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::SecretManager::V1beta2::Secret] - # A result object deserialized from the server's reply - def update_secret request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_update_secret_request request_pb - query_string_params = if query_string_params.any? - query_string_params.to_h { |p| p.split "=", 2 } - else - {} - end - - response = @client_stub.make_http_request( - verb, - uri: uri, - body: body || "", - params: query_string_params, - method_name: "update_secret", - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Cloud::SecretManager::V1beta2::Secret.decode_json response.body, ignore_unknown_fields: true - catch :response do - yield result, operation if block_given? - result - end - end - - ## - # Baseline implementation for the delete_secret REST call - # - # @param request_pb [::Google::Cloud::SecretManager::V1beta2::DeleteSecretRequest] - # A request object representing the call parameters. Required. - # @param options [::Gapic::CallOptions] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Protobuf::Empty] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Protobuf::Empty] - # A result object deserialized from the server's reply - def delete_secret request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_delete_secret_request request_pb - query_string_params = if query_string_params.any? - query_string_params.to_h { |p| p.split "=", 2 } - else - {} - end - - response = @client_stub.make_http_request( - verb, - uri: uri, - body: body || "", - params: query_string_params, - method_name: "delete_secret", - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Protobuf::Empty.decode_json response.body, ignore_unknown_fields: true - catch :response do - yield result, operation if block_given? - result - end - end - - ## - # Baseline implementation for the list_secret_versions REST call - # - # @param request_pb [::Google::Cloud::SecretManager::V1beta2::ListSecretVersionsRequest] - # A request object representing the call parameters. Required. - # @param options [::Gapic::CallOptions] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Cloud::SecretManager::V1beta2::ListSecretVersionsResponse] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::SecretManager::V1beta2::ListSecretVersionsResponse] - # A result object deserialized from the server's reply - def list_secret_versions request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_list_secret_versions_request request_pb - query_string_params = if query_string_params.any? - query_string_params.to_h { |p| p.split "=", 2 } - else - {} - end - - response = @client_stub.make_http_request( - verb, - uri: uri, - body: body || "", - params: query_string_params, - method_name: "list_secret_versions", - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Cloud::SecretManager::V1beta2::ListSecretVersionsResponse.decode_json response.body, ignore_unknown_fields: true - catch :response do - yield result, operation if block_given? - result - end - end - - ## - # Baseline implementation for the get_secret_version REST call - # - # @param request_pb [::Google::Cloud::SecretManager::V1beta2::GetSecretVersionRequest] - # A request object representing the call parameters. Required. - # @param options [::Gapic::CallOptions] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Cloud::SecretManager::V1beta2::SecretVersion] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::SecretManager::V1beta2::SecretVersion] - # A result object deserialized from the server's reply - def get_secret_version request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_get_secret_version_request request_pb - query_string_params = if query_string_params.any? - query_string_params.to_h { |p| p.split "=", 2 } - else - {} - end - - response = @client_stub.make_http_request( - verb, - uri: uri, - body: body || "", - params: query_string_params, - method_name: "get_secret_version", - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Cloud::SecretManager::V1beta2::SecretVersion.decode_json response.body, ignore_unknown_fields: true - catch :response do - yield result, operation if block_given? - result - end - end - - ## - # Baseline implementation for the access_secret_version REST call - # - # @param request_pb [::Google::Cloud::SecretManager::V1beta2::AccessSecretVersionRequest] - # A request object representing the call parameters. Required. - # @param options [::Gapic::CallOptions] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Cloud::SecretManager::V1beta2::AccessSecretVersionResponse] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::SecretManager::V1beta2::AccessSecretVersionResponse] - # A result object deserialized from the server's reply - def access_secret_version request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_access_secret_version_request request_pb - query_string_params = if query_string_params.any? - query_string_params.to_h { |p| p.split "=", 2 } - else - {} - end - - response = @client_stub.make_http_request( - verb, - uri: uri, - body: body || "", - params: query_string_params, - method_name: "access_secret_version", - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Cloud::SecretManager::V1beta2::AccessSecretVersionResponse.decode_json response.body, ignore_unknown_fields: true - catch :response do - yield result, operation if block_given? - result - end - end - - ## - # Baseline implementation for the disable_secret_version REST call - # - # @param request_pb [::Google::Cloud::SecretManager::V1beta2::DisableSecretVersionRequest] - # A request object representing the call parameters. Required. - # @param options [::Gapic::CallOptions] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Cloud::SecretManager::V1beta2::SecretVersion] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::SecretManager::V1beta2::SecretVersion] - # A result object deserialized from the server's reply - def disable_secret_version request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_disable_secret_version_request request_pb - query_string_params = if query_string_params.any? - query_string_params.to_h { |p| p.split "=", 2 } - else - {} - end - - response = @client_stub.make_http_request( - verb, - uri: uri, - body: body || "", - params: query_string_params, - method_name: "disable_secret_version", - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Cloud::SecretManager::V1beta2::SecretVersion.decode_json response.body, ignore_unknown_fields: true - catch :response do - yield result, operation if block_given? - result - end - end - - ## - # Baseline implementation for the enable_secret_version REST call - # - # @param request_pb [::Google::Cloud::SecretManager::V1beta2::EnableSecretVersionRequest] - # A request object representing the call parameters. Required. - # @param options [::Gapic::CallOptions] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Cloud::SecretManager::V1beta2::SecretVersion] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::SecretManager::V1beta2::SecretVersion] - # A result object deserialized from the server's reply - def enable_secret_version request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_enable_secret_version_request request_pb - query_string_params = if query_string_params.any? - query_string_params.to_h { |p| p.split "=", 2 } - else - {} - end - - response = @client_stub.make_http_request( - verb, - uri: uri, - body: body || "", - params: query_string_params, - method_name: "enable_secret_version", - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Cloud::SecretManager::V1beta2::SecretVersion.decode_json response.body, ignore_unknown_fields: true - catch :response do - yield result, operation if block_given? - result - end - end - - ## - # Baseline implementation for the destroy_secret_version REST call - # - # @param request_pb [::Google::Cloud::SecretManager::V1beta2::DestroySecretVersionRequest] - # A request object representing the call parameters. Required. - # @param options [::Gapic::CallOptions] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Cloud::SecretManager::V1beta2::SecretVersion] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::SecretManager::V1beta2::SecretVersion] - # A result object deserialized from the server's reply - def destroy_secret_version request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_destroy_secret_version_request request_pb - query_string_params = if query_string_params.any? - query_string_params.to_h { |p| p.split "=", 2 } - else - {} - end - - response = @client_stub.make_http_request( - verb, - uri: uri, - body: body || "", - params: query_string_params, - method_name: "destroy_secret_version", - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Cloud::SecretManager::V1beta2::SecretVersion.decode_json response.body, ignore_unknown_fields: true - catch :response do - yield result, operation if block_given? - result - end - end - - ## - # Baseline implementation for the set_iam_policy REST call - # - # @param request_pb [::Google::Iam::V1::SetIamPolicyRequest] - # A request object representing the call parameters. Required. - # @param options [::Gapic::CallOptions] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Iam::V1::Policy] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Iam::V1::Policy] - # A result object deserialized from the server's reply - def set_iam_policy request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_set_iam_policy_request request_pb - query_string_params = if query_string_params.any? - query_string_params.to_h { |p| p.split "=", 2 } - else - {} - end - - response = @client_stub.make_http_request( - verb, - uri: uri, - body: body || "", - params: query_string_params, - method_name: "set_iam_policy", - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Iam::V1::Policy.decode_json response.body, ignore_unknown_fields: true - catch :response do - yield result, operation if block_given? - result - end - end - - ## - # Baseline implementation for the get_iam_policy REST call - # - # @param request_pb [::Google::Iam::V1::GetIamPolicyRequest] - # A request object representing the call parameters. Required. - # @param options [::Gapic::CallOptions] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Iam::V1::Policy] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Iam::V1::Policy] - # A result object deserialized from the server's reply - def get_iam_policy request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_get_iam_policy_request request_pb - query_string_params = if query_string_params.any? - query_string_params.to_h { |p| p.split "=", 2 } - else - {} - end - - response = @client_stub.make_http_request( - verb, - uri: uri, - body: body || "", - params: query_string_params, - method_name: "get_iam_policy", - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Iam::V1::Policy.decode_json response.body, ignore_unknown_fields: true - catch :response do - yield result, operation if block_given? - result - end - end - - ## - # Baseline implementation for the test_iam_permissions REST call - # - # @param request_pb [::Google::Iam::V1::TestIamPermissionsRequest] - # A request object representing the call parameters. Required. - # @param options [::Gapic::CallOptions] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Iam::V1::TestIamPermissionsResponse] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Iam::V1::TestIamPermissionsResponse] - # A result object deserialized from the server's reply - def test_iam_permissions request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_test_iam_permissions_request request_pb - query_string_params = if query_string_params.any? - query_string_params.to_h { |p| p.split "=", 2 } - else - {} - end - - response = @client_stub.make_http_request( - verb, - uri: uri, - body: body || "", - params: query_string_params, - method_name: "test_iam_permissions", - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Iam::V1::TestIamPermissionsResponse.decode_json response.body, ignore_unknown_fields: true - catch :response do - yield result, operation if block_given? - result - end - end - - ## - # @private - # - # GRPC transcoding helper method for the list_secrets REST call - # - # @param request_pb [::Google::Cloud::SecretManager::V1beta2::ListSecretsRequest] - # A request object representing the call parameters. Required. - # @return [Array(String, [String, nil], Hash{String => String})] - # Uri, Body, Query string parameters - def self.transcode_list_secrets_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :get, - uri_template: "/v1beta2/{parent}/secrets", - matches: [ - ["parent", %r{^projects/[^/]+/?$}, false] - ] - ) - .with_bindings( - uri_method: :get, - uri_template: "/v1beta2/{parent}/secrets", - matches: [ - ["parent", %r{^projects/[^/]+/locations/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the create_secret REST call - # - # @param request_pb [::Google::Cloud::SecretManager::V1beta2::CreateSecretRequest] - # A request object representing the call parameters. Required. - # @return [Array(String, [String, nil], Hash{String => String})] - # Uri, Body, Query string parameters - def self.transcode_create_secret_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :post, - uri_template: "/v1beta2/{parent}/secrets", - body: "secret", - matches: [ - ["parent", %r{^projects/[^/]+/?$}, false] - ] - ) - .with_bindings( - uri_method: :post, - uri_template: "/v1beta2/{parent}/secrets", - body: "secret", - matches: [ - ["parent", %r{^projects/[^/]+/locations/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the add_secret_version REST call - # - # @param request_pb [::Google::Cloud::SecretManager::V1beta2::AddSecretVersionRequest] - # A request object representing the call parameters. Required. - # @return [Array(String, [String, nil], Hash{String => String})] - # Uri, Body, Query string parameters - def self.transcode_add_secret_version_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :post, - uri_template: "/v1beta2/{parent}:addVersion", - body: "*", - matches: [ - ["parent", %r{^projects/[^/]+/secrets/[^/]+/?$}, false] - ] - ) - .with_bindings( - uri_method: :post, - uri_template: "/v1beta2/{parent}:addVersion", - body: "*", - matches: [ - ["parent", %r{^projects/[^/]+/locations/[^/]+/secrets/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the get_secret REST call - # - # @param request_pb [::Google::Cloud::SecretManager::V1beta2::GetSecretRequest] - # A request object representing the call parameters. Required. - # @return [Array(String, [String, nil], Hash{String => String})] - # Uri, Body, Query string parameters - def self.transcode_get_secret_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :get, - uri_template: "/v1beta2/{name}", - matches: [ - ["name", %r{^projects/[^/]+/secrets/[^/]+/?$}, false] - ] - ) - .with_bindings( - uri_method: :get, - uri_template: "/v1beta2/{name}", - matches: [ - ["name", %r{^projects/[^/]+/locations/[^/]+/secrets/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the update_secret REST call - # - # @param request_pb [::Google::Cloud::SecretManager::V1beta2::UpdateSecretRequest] - # A request object representing the call parameters. Required. - # @return [Array(String, [String, nil], Hash{String => String})] - # Uri, Body, Query string parameters - def self.transcode_update_secret_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :patch, - uri_template: "/v1beta2/{secret.name}", - body: "secret", - matches: [ - ["secret.name", %r{^projects/[^/]+/secrets/[^/]+/?$}, false] - ] - ) - .with_bindings( - uri_method: :patch, - uri_template: "/v1beta2/{secret.name}", - body: "secret", - matches: [ - ["secret.name", %r{^projects/[^/]+/locations/[^/]+/secrets/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the delete_secret REST call - # - # @param request_pb [::Google::Cloud::SecretManager::V1beta2::DeleteSecretRequest] - # A request object representing the call parameters. Required. - # @return [Array(String, [String, nil], Hash{String => String})] - # Uri, Body, Query string parameters - def self.transcode_delete_secret_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :delete, - uri_template: "/v1beta2/{name}", - matches: [ - ["name", %r{^projects/[^/]+/secrets/[^/]+/?$}, false] - ] - ) - .with_bindings( - uri_method: :delete, - uri_template: "/v1beta2/{name}", - matches: [ - ["name", %r{^projects/[^/]+/locations/[^/]+/secrets/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the list_secret_versions REST call - # - # @param request_pb [::Google::Cloud::SecretManager::V1beta2::ListSecretVersionsRequest] - # A request object representing the call parameters. Required. - # @return [Array(String, [String, nil], Hash{String => String})] - # Uri, Body, Query string parameters - def self.transcode_list_secret_versions_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :get, - uri_template: "/v1beta2/{parent}/versions", - matches: [ - ["parent", %r{^projects/[^/]+/secrets/[^/]+/?$}, false] - ] - ) - .with_bindings( - uri_method: :get, - uri_template: "/v1beta2/{parent}/versions", - matches: [ - ["parent", %r{^projects/[^/]+/locations/[^/]+/secrets/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the get_secret_version REST call - # - # @param request_pb [::Google::Cloud::SecretManager::V1beta2::GetSecretVersionRequest] - # A request object representing the call parameters. Required. - # @return [Array(String, [String, nil], Hash{String => String})] - # Uri, Body, Query string parameters - def self.transcode_get_secret_version_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :get, - uri_template: "/v1beta2/{name}", - matches: [ - ["name", %r{^projects/[^/]+/secrets/[^/]+/versions/[^/]+/?$}, false] - ] - ) - .with_bindings( - uri_method: :get, - uri_template: "/v1beta2/{name}", - matches: [ - ["name", %r{^projects/[^/]+/locations/[^/]+/secrets/[^/]+/versions/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the access_secret_version REST call - # - # @param request_pb [::Google::Cloud::SecretManager::V1beta2::AccessSecretVersionRequest] - # A request object representing the call parameters. Required. - # @return [Array(String, [String, nil], Hash{String => String})] - # Uri, Body, Query string parameters - def self.transcode_access_secret_version_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :get, - uri_template: "/v1beta2/{name}:access", - matches: [ - ["name", %r{^projects/[^/]+/secrets/[^/]+/versions/[^/]+/?$}, false] - ] - ) - .with_bindings( - uri_method: :get, - uri_template: "/v1beta2/{name}:access", - matches: [ - ["name", %r{^projects/[^/]+/locations/[^/]+/secrets/[^/]+/versions/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the disable_secret_version REST call - # - # @param request_pb [::Google::Cloud::SecretManager::V1beta2::DisableSecretVersionRequest] - # A request object representing the call parameters. Required. - # @return [Array(String, [String, nil], Hash{String => String})] - # Uri, Body, Query string parameters - def self.transcode_disable_secret_version_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :post, - uri_template: "/v1beta2/{name}:disable", - body: "*", - matches: [ - ["name", %r{^projects/[^/]+/secrets/[^/]+/versions/[^/]+/?$}, false] - ] - ) - .with_bindings( - uri_method: :post, - uri_template: "/v1beta2/{name}:disable", - body: "*", - matches: [ - ["name", %r{^projects/[^/]+/locations/[^/]+/secrets/[^/]+/versions/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the enable_secret_version REST call - # - # @param request_pb [::Google::Cloud::SecretManager::V1beta2::EnableSecretVersionRequest] - # A request object representing the call parameters. Required. - # @return [Array(String, [String, nil], Hash{String => String})] - # Uri, Body, Query string parameters - def self.transcode_enable_secret_version_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :post, - uri_template: "/v1beta2/{name}:enable", - body: "*", - matches: [ - ["name", %r{^projects/[^/]+/secrets/[^/]+/versions/[^/]+/?$}, false] - ] - ) - .with_bindings( - uri_method: :post, - uri_template: "/v1beta2/{name}:enable", - body: "*", - matches: [ - ["name", %r{^projects/[^/]+/locations/[^/]+/secrets/[^/]+/versions/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the destroy_secret_version REST call - # - # @param request_pb [::Google::Cloud::SecretManager::V1beta2::DestroySecretVersionRequest] - # A request object representing the call parameters. Required. - # @return [Array(String, [String, nil], Hash{String => String})] - # Uri, Body, Query string parameters - def self.transcode_destroy_secret_version_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :post, - uri_template: "/v1beta2/{name}:destroy", - body: "*", - matches: [ - ["name", %r{^projects/[^/]+/secrets/[^/]+/versions/[^/]+/?$}, false] - ] - ) - .with_bindings( - uri_method: :post, - uri_template: "/v1beta2/{name}:destroy", - body: "*", - matches: [ - ["name", %r{^projects/[^/]+/locations/[^/]+/secrets/[^/]+/versions/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the set_iam_policy REST call - # - # @param request_pb [::Google::Iam::V1::SetIamPolicyRequest] - # A request object representing the call parameters. Required. - # @return [Array(String, [String, nil], Hash{String => String})] - # Uri, Body, Query string parameters - def self.transcode_set_iam_policy_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :post, - uri_template: "/v1beta2/{resource}:setIamPolicy", - body: "*", - matches: [ - ["resource", %r{^projects/[^/]+/secrets/[^/]+/?$}, false] - ] - ) - .with_bindings( - uri_method: :post, - uri_template: "/v1beta2/{resource}:setIamPolicy", - body: "*", - matches: [ - ["resource", %r{^projects/[^/]+/locations/[^/]+/secrets/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the get_iam_policy REST call - # - # @param request_pb [::Google::Iam::V1::GetIamPolicyRequest] - # A request object representing the call parameters. Required. - # @return [Array(String, [String, nil], Hash{String => String})] - # Uri, Body, Query string parameters - def self.transcode_get_iam_policy_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :get, - uri_template: "/v1beta2/{resource}:getIamPolicy", - matches: [ - ["resource", %r{^projects/[^/]+/secrets/[^/]+/?$}, false] - ] - ) - .with_bindings( - uri_method: :get, - uri_template: "/v1beta2/{resource}:getIamPolicy", - matches: [ - ["resource", %r{^projects/[^/]+/locations/[^/]+/secrets/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the test_iam_permissions REST call - # - # @param request_pb [::Google::Iam::V1::TestIamPermissionsRequest] - # A request object representing the call parameters. Required. - # @return [Array(String, [String, nil], Hash{String => String})] - # Uri, Body, Query string parameters - def self.transcode_test_iam_permissions_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :post, - uri_template: "/v1beta2/{resource}:testIamPermissions", - body: "*", - matches: [ - ["resource", %r{^projects/[^/]+/secrets/[^/]+/?$}, false] - ] - ) - .with_bindings( - uri_method: :post, - uri_template: "/v1beta2/{resource}:testIamPermissions", - body: "*", - matches: [ - ["resource", %r{^projects/[^/]+/locations/[^/]+/secrets/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - end - end - end - end - end - end -end diff --git a/owl-bot-staging/google-cloud-secret_manager-v1beta2/lib/google/cloud/secret_manager/v1beta2/version.rb b/owl-bot-staging/google-cloud-secret_manager-v1beta2/lib/google/cloud/secret_manager/v1beta2/version.rb deleted file mode 100644 index 256dc4e50205..000000000000 --- a/owl-bot-staging/google-cloud-secret_manager-v1beta2/lib/google/cloud/secret_manager/v1beta2/version.rb +++ /dev/null @@ -1,28 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - - -module Google - module Cloud - module SecretManager - module V1beta2 - VERSION = "0.0.1" - end - end - end -end diff --git a/owl-bot-staging/google-cloud-secret_manager-v1beta2/lib/google/cloud/secretmanager/v1beta2/resources_pb.rb b/owl-bot-staging/google-cloud-secret_manager-v1beta2/lib/google/cloud/secretmanager/v1beta2/resources_pb.rb deleted file mode 100644 index 3c6f0ebe8af9..000000000000 --- a/owl-bot-staging/google-cloud-secret_manager-v1beta2/lib/google/cloud/secretmanager/v1beta2/resources_pb.rb +++ /dev/null @@ -1,41 +0,0 @@ -# frozen_string_literal: true -# Generated by the protocol buffer compiler. DO NOT EDIT! -# source: google/cloud/secretmanager/v1beta2/resources.proto - -require 'google/protobuf' - -require 'google/api/field_behavior_pb' -require 'google/api/resource_pb' -require 'google/protobuf/duration_pb' -require 'google/protobuf/timestamp_pb' - - -descriptor_data = "\n2google/cloud/secretmanager/v1beta2/resources.proto\x12\"google.cloud.secretmanager.v1beta2\x1a\x1fgoogle/api/field_behavior.proto\x1a\x19google/api/resource.proto\x1a\x1egoogle/protobuf/duration.proto\x1a\x1fgoogle/protobuf/timestamp.proto\"\x85\t\n\x06Secret\x12\x11\n\x04name\x18\x01 \x01(\tB\x03\xe0\x41\x03\x12L\n\x0breplication\x18\x02 \x01(\x0b\x32/.google.cloud.secretmanager.v1beta2.ReplicationB\x06\xe0\x41\x05\xe0\x41\x01\x12\x34\n\x0b\x63reate_time\x18\x03 \x01(\x0b\x32\x1a.google.protobuf.TimestampB\x03\xe0\x41\x03\x12\x46\n\x06labels\x18\x04 \x03(\x0b\x32\x36.google.cloud.secretmanager.v1beta2.Secret.LabelsEntry\x12>\n\x06topics\x18\x05 \x03(\x0b\x32).google.cloud.secretmanager.v1beta2.TopicB\x03\xe0\x41\x01\x12\x36\n\x0b\x65xpire_time\x18\x06 \x01(\x0b\x32\x1a.google.protobuf.TimestampB\x03\xe0\x41\x01H\x00\x12-\n\x03ttl\x18\x07 \x01(\x0b\x32\x19.google.protobuf.DurationB\x03\xe0\x41\x04H\x00\x12\x11\n\x04\x65tag\x18\x08 \x01(\tB\x03\xe0\x41\x01\x12\x43\n\x08rotation\x18\t \x01(\x0b\x32,.google.cloud.secretmanager.v1beta2.RotationB\x03\xe0\x41\x01\x12\\\n\x0fversion_aliases\x18\x0b \x03(\x0b\x32>.google.cloud.secretmanager.v1beta2.Secret.VersionAliasesEntryB\x03\xe0\x41\x01\x12U\n\x0b\x61nnotations\x18\r \x03(\x0b\x32;.google.cloud.secretmanager.v1beta2.Secret.AnnotationsEntryB\x03\xe0\x41\x01\x12;\n\x13version_destroy_ttl\x18\x0e \x01(\x0b\x32\x19.google.protobuf.DurationB\x03\xe0\x41\x01\x12g\n\x1b\x63ustomer_managed_encryption\x18\x0f \x01(\x0b\x32=.google.cloud.secretmanager.v1beta2.CustomerManagedEncryptionB\x03\xe0\x41\x01\x1a-\n\x0bLabelsEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12\r\n\x05value\x18\x02 \x01(\t:\x02\x38\x01\x1a\x35\n\x13VersionAliasesEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12\r\n\x05value\x18\x02 \x01(\x03:\x02\x38\x01\x1a\x32\n\x10\x41nnotationsEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12\r\n\x05value\x18\x02 \x01(\t:\x02\x38\x01:\x99\x01\xea\x41\x95\x01\n#secretmanager.googleapis.com/Secret\x12#projects/{project}/secrets/{secret}\x12\x38projects/{project}/locations/{location}/secrets/{secret}*\x07secrets2\x06secretB\x0c\n\nexpiration\"\xd1\x06\n\rSecretVersion\x12\x11\n\x04name\x18\x01 \x01(\tB\x03\xe0\x41\x03\x12\x34\n\x0b\x63reate_time\x18\x02 \x01(\x0b\x32\x1a.google.protobuf.TimestampB\x03\xe0\x41\x03\x12\x35\n\x0c\x64\x65stroy_time\x18\x03 \x01(\x0b\x32\x1a.google.protobuf.TimestampB\x03\xe0\x41\x03\x12K\n\x05state\x18\x04 \x01(\x0e\x32\x37.google.cloud.secretmanager.v1beta2.SecretVersion.StateB\x03\xe0\x41\x03\x12Q\n\x12replication_status\x18\x05 \x01(\x0b\x32\x35.google.cloud.secretmanager.v1beta2.ReplicationStatus\x12\x11\n\x04\x65tag\x18\x06 \x01(\tB\x03\xe0\x41\x03\x12.\n!client_specified_payload_checksum\x18\x07 \x01(\x08\x42\x03\xe0\x41\x03\x12?\n\x16scheduled_destroy_time\x18\x08 \x01(\x0b\x32\x1a.google.protobuf.TimestampB\x03\xe0\x41\x03\x12m\n\x1b\x63ustomer_managed_encryption\x18\t \x01(\x0b\x32\x43.google.cloud.secretmanager.v1beta2.CustomerManagedEncryptionStatusB\x03\xe0\x41\x03\"H\n\x05State\x12\x15\n\x11STATE_UNSPECIFIED\x10\x00\x12\x0b\n\x07\x45NABLED\x10\x01\x12\x0c\n\x08\x44ISABLED\x10\x02\x12\r\n\tDESTROYED\x10\x03:\xe2\x01\xea\x41\xde\x01\n*secretmanager.googleapis.com/SecretVersion\x12=projects/{project}/secrets/{secret}/versions/{secret_version}\x12Rprojects/{project}/locations/{location}/secrets/{secret}/versions/{secret_version}*\x0esecretVersions2\rsecretVersion\"\xaa\x04\n\x0bReplication\x12N\n\tautomatic\x18\x01 \x01(\x0b\x32\x39.google.cloud.secretmanager.v1beta2.Replication.AutomaticH\x00\x12S\n\x0cuser_managed\x18\x02 \x01(\x0b\x32;.google.cloud.secretmanager.v1beta2.Replication.UserManagedH\x00\x1at\n\tAutomatic\x12g\n\x1b\x63ustomer_managed_encryption\x18\x01 \x01(\x0b\x32=.google.cloud.secretmanager.v1beta2.CustomerManagedEncryptionB\x03\xe0\x41\x01\x1a\xf0\x01\n\x0bUserManaged\x12Z\n\x08replicas\x18\x01 \x03(\x0b\x32\x43.google.cloud.secretmanager.v1beta2.Replication.UserManaged.ReplicaB\x03\xe0\x41\x02\x1a\x84\x01\n\x07Replica\x12\x10\n\x08location\x18\x01 \x01(\t\x12g\n\x1b\x63ustomer_managed_encryption\x18\x02 \x01(\x0b\x32=.google.cloud.secretmanager.v1beta2.CustomerManagedEncryptionB\x03\xe0\x41\x01\x42\r\n\x0breplication\"6\n\x19\x43ustomerManagedEncryption\x12\x19\n\x0ckms_key_name\x18\x01 \x01(\tB\x03\xe0\x41\x02\"\x85\x05\n\x11ReplicationStatus\x12Z\n\tautomatic\x18\x01 \x01(\x0b\x32\x45.google.cloud.secretmanager.v1beta2.ReplicationStatus.AutomaticStatusH\x00\x12_\n\x0cuser_managed\x18\x02 \x01(\x0b\x32G.google.cloud.secretmanager.v1beta2.ReplicationStatus.UserManagedStatusH\x00\x1a\x80\x01\n\x0f\x41utomaticStatus\x12m\n\x1b\x63ustomer_managed_encryption\x18\x01 \x01(\x0b\x32\x43.google.cloud.secretmanager.v1beta2.CustomerManagedEncryptionStatusB\x03\xe0\x41\x03\x1a\x99\x02\n\x11UserManagedStatus\x12l\n\x08replicas\x18\x01 \x03(\x0b\x32U.google.cloud.secretmanager.v1beta2.ReplicationStatus.UserManagedStatus.ReplicaStatusB\x03\xe0\x41\x03\x1a\x95\x01\n\rReplicaStatus\x12\x15\n\x08location\x18\x01 \x01(\tB\x03\xe0\x41\x03\x12m\n\x1b\x63ustomer_managed_encryption\x18\x02 \x01(\x0b\x32\x43.google.cloud.secretmanager.v1beta2.CustomerManagedEncryptionStatusB\x03\xe0\x41\x03\x42\x14\n\x12replication_status\"D\n\x1f\x43ustomerManagedEncryptionStatus\x12!\n\x14kms_key_version_name\x18\x01 \x01(\tB\x03\xe0\x41\x02\"_\n\x05Topic\x12\x11\n\x04name\x18\x01 \x01(\tB\x03\xe0\x41\x02:C\xea\x41@\n\x1bpubsub.googleapis.com/Topic\x12!projects/{project}/topics/{topic}\"\x80\x01\n\x08Rotation\x12;\n\x12next_rotation_time\x18\x01 \x01(\x0b\x32\x1a.google.protobuf.TimestampB\x03\xe0\x41\x01\x12\x37\n\x0frotation_period\x18\x02 \x01(\x0b\x32\x19.google.protobuf.DurationB\x03\xe0\x41\x04\"L\n\rSecretPayload\x12\x0c\n\x04\x64\x61ta\x18\x01 \x01(\x0c\x12\x1d\n\x0b\x64\x61ta_crc32c\x18\x02 \x01(\x03\x42\x03\xe0\x41\x01H\x00\x88\x01\x01\x42\x0e\n\x0c_data_crc32cB\x80\x02\n&com.google.cloud.secretmanager.v1beta2B\x0eResourcesProtoP\x01ZLcloud.google.com/go/secretmanager/apiv1beta2/secretmanagerpb;secretmanagerpb\xa2\x02\x03GSM\xaa\x02\"Google.Cloud.SecretManager.V1Beta2\xca\x02\"Google\\Cloud\\SecretManager\\V1beta2\xea\x02%Google::Cloud::SecretManager::V1beta2b\x06proto3" - -pool = ::Google::Protobuf::DescriptorPool.generated_pool -pool.add_serialized_file(descriptor_data) - -module Google - module Cloud - module SecretManager - module V1beta2 - Secret = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.secretmanager.v1beta2.Secret").msgclass - SecretVersion = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.secretmanager.v1beta2.SecretVersion").msgclass - SecretVersion::State = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.secretmanager.v1beta2.SecretVersion.State").enummodule - Replication = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.secretmanager.v1beta2.Replication").msgclass - Replication::Automatic = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.secretmanager.v1beta2.Replication.Automatic").msgclass - Replication::UserManaged = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.secretmanager.v1beta2.Replication.UserManaged").msgclass - Replication::UserManaged::Replica = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.secretmanager.v1beta2.Replication.UserManaged.Replica").msgclass - CustomerManagedEncryption = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.secretmanager.v1beta2.CustomerManagedEncryption").msgclass - ReplicationStatus = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.secretmanager.v1beta2.ReplicationStatus").msgclass - ReplicationStatus::AutomaticStatus = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.secretmanager.v1beta2.ReplicationStatus.AutomaticStatus").msgclass - ReplicationStatus::UserManagedStatus = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.secretmanager.v1beta2.ReplicationStatus.UserManagedStatus").msgclass - ReplicationStatus::UserManagedStatus::ReplicaStatus = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.secretmanager.v1beta2.ReplicationStatus.UserManagedStatus.ReplicaStatus").msgclass - CustomerManagedEncryptionStatus = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.secretmanager.v1beta2.CustomerManagedEncryptionStatus").msgclass - Topic = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.secretmanager.v1beta2.Topic").msgclass - Rotation = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.secretmanager.v1beta2.Rotation").msgclass - SecretPayload = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.secretmanager.v1beta2.SecretPayload").msgclass - end - end - end -end diff --git a/owl-bot-staging/google-cloud-secret_manager-v1beta2/lib/google/cloud/secretmanager/v1beta2/service_pb.rb b/owl-bot-staging/google-cloud-secret_manager-v1beta2/lib/google/cloud/secretmanager/v1beta2/service_pb.rb deleted file mode 100644 index 36eb635dcf02..000000000000 --- a/owl-bot-staging/google-cloud-secret_manager-v1beta2/lib/google/cloud/secretmanager/v1beta2/service_pb.rb +++ /dev/null @@ -1,45 +0,0 @@ -# frozen_string_literal: true -# Generated by the protocol buffer compiler. DO NOT EDIT! -# source: google/cloud/secretmanager/v1beta2/service.proto - -require 'google/protobuf' - -require 'google/api/annotations_pb' -require 'google/api/client_pb' -require 'google/api/field_behavior_pb' -require 'google/api/resource_pb' -require 'google/cloud/secretmanager/v1beta2/resources_pb' -require 'google/iam/v1/iam_policy_pb' -require 'google/iam/v1/policy_pb' -require 'google/protobuf/empty_pb' -require 'google/protobuf/field_mask_pb' - - -descriptor_data = "\n0google/cloud/secretmanager/v1beta2/service.proto\x12\"google.cloud.secretmanager.v1beta2\x1a\x1cgoogle/api/annotations.proto\x1a\x17google/api/client.proto\x1a\x1fgoogle/api/field_behavior.proto\x1a\x19google/api/resource.proto\x1a\x32google/cloud/secretmanager/v1beta2/resources.proto\x1a\x1egoogle/iam/v1/iam_policy.proto\x1a\x1agoogle/iam/v1/policy.proto\x1a\x1bgoogle/protobuf/empty.proto\x1a google/protobuf/field_mask.proto\"\x97\x01\n\x12ListSecretsRequest\x12;\n\x06parent\x18\x01 \x01(\tB+\xe0\x41\x02\xfa\x41%\x12#secretmanager.googleapis.com/Secret\x12\x16\n\tpage_size\x18\x02 \x01(\x05\x42\x03\xe0\x41\x01\x12\x17\n\npage_token\x18\x03 \x01(\tB\x03\xe0\x41\x01\x12\x13\n\x06\x66ilter\x18\x04 \x01(\tB\x03\xe0\x41\x01\"\x7f\n\x13ListSecretsResponse\x12;\n\x07secrets\x18\x01 \x03(\x0b\x32*.google.cloud.secretmanager.v1beta2.Secret\x12\x17\n\x0fnext_page_token\x18\x02 \x01(\t\x12\x12\n\ntotal_size\x18\x03 \x01(\x05\"\xab\x01\n\x13\x43reateSecretRequest\x12;\n\x06parent\x18\x01 \x01(\tB+\xe0\x41\x02\xfa\x41%\x12#secretmanager.googleapis.com/Secret\x12\x16\n\tsecret_id\x18\x02 \x01(\tB\x03\xe0\x41\x02\x12?\n\x06secret\x18\x03 \x01(\x0b\x32*.google.cloud.secretmanager.v1beta2.SecretB\x03\xe0\x41\x02\"\x9f\x01\n\x17\x41\x64\x64SecretVersionRequest\x12;\n\x06parent\x18\x01 \x01(\tB+\xe0\x41\x02\xfa\x41%\n#secretmanager.googleapis.com/Secret\x12G\n\x07payload\x18\x02 \x01(\x0b\x32\x31.google.cloud.secretmanager.v1beta2.SecretPayloadB\x03\xe0\x41\x02\"M\n\x10GetSecretRequest\x12\x39\n\x04name\x18\x01 \x01(\tB+\xe0\x41\x02\xfa\x41%\n#secretmanager.googleapis.com/Secret\"\x9e\x01\n\x19ListSecretVersionsRequest\x12;\n\x06parent\x18\x01 \x01(\tB+\xe0\x41\x02\xfa\x41%\n#secretmanager.googleapis.com/Secret\x12\x16\n\tpage_size\x18\x02 \x01(\x05\x42\x03\xe0\x41\x01\x12\x17\n\npage_token\x18\x03 \x01(\tB\x03\xe0\x41\x01\x12\x13\n\x06\x66ilter\x18\x04 \x01(\tB\x03\xe0\x41\x01\"\x8e\x01\n\x1aListSecretVersionsResponse\x12\x43\n\x08versions\x18\x01 \x03(\x0b\x32\x31.google.cloud.secretmanager.v1beta2.SecretVersion\x12\x17\n\x0fnext_page_token\x18\x02 \x01(\t\x12\x12\n\ntotal_size\x18\x03 \x01(\x05\"[\n\x17GetSecretVersionRequest\x12@\n\x04name\x18\x01 \x01(\tB2\xe0\x41\x02\xfa\x41,\n*secretmanager.googleapis.com/SecretVersion\"\x8c\x01\n\x13UpdateSecretRequest\x12?\n\x06secret\x18\x01 \x01(\x0b\x32*.google.cloud.secretmanager.v1beta2.SecretB\x03\xe0\x41\x02\x12\x34\n\x0bupdate_mask\x18\x02 \x01(\x0b\x32\x1a.google.protobuf.FieldMaskB\x03\xe0\x41\x02\"^\n\x1a\x41\x63\x63\x65ssSecretVersionRequest\x12@\n\x04name\x18\x01 \x01(\tB2\xe0\x41\x02\xfa\x41,\n*secretmanager.googleapis.com/SecretVersion\"\xa0\x01\n\x1b\x41\x63\x63\x65ssSecretVersionResponse\x12=\n\x04name\x18\x01 \x01(\tB/\xfa\x41,\n*secretmanager.googleapis.com/SecretVersion\x12\x42\n\x07payload\x18\x02 \x01(\x0b\x32\x31.google.cloud.secretmanager.v1beta2.SecretPayload\"c\n\x13\x44\x65leteSecretRequest\x12\x39\n\x04name\x18\x01 \x01(\tB+\xe0\x41\x02\xfa\x41%\n#secretmanager.googleapis.com/Secret\x12\x11\n\x04\x65tag\x18\x02 \x01(\tB\x03\xe0\x41\x01\"r\n\x1b\x44isableSecretVersionRequest\x12@\n\x04name\x18\x01 \x01(\tB2\xe0\x41\x02\xfa\x41,\n*secretmanager.googleapis.com/SecretVersion\x12\x11\n\x04\x65tag\x18\x02 \x01(\tB\x03\xe0\x41\x01\"q\n\x1a\x45nableSecretVersionRequest\x12@\n\x04name\x18\x01 \x01(\tB2\xe0\x41\x02\xfa\x41,\n*secretmanager.googleapis.com/SecretVersion\x12\x11\n\x04\x65tag\x18\x02 \x01(\tB\x03\xe0\x41\x01\"r\n\x1b\x44\x65stroySecretVersionRequest\x12@\n\x04name\x18\x01 \x01(\tB2\xe0\x41\x02\xfa\x41,\n*secretmanager.googleapis.com/SecretVersion\x12\x11\n\x04\x65tag\x18\x02 \x01(\tB\x03\xe0\x41\x01\x32\xf7\x1e\n\x14SecretManagerService\x12\xe9\x01\n\x0bListSecrets\x12\x36.google.cloud.secretmanager.v1beta2.ListSecretsRequest\x1a\x37.google.cloud.secretmanager.v1beta2.ListSecretsResponse\"i\xda\x41\x06parent\x82\xd3\xe4\x93\x02Z\x12$/v1beta2/{parent=projects/*}/secretsZ2\x12\x30/v1beta2/{parent=projects/*/locations/*}/secrets\x12\x80\x02\n\x0c\x43reateSecret\x12\x37.google.cloud.secretmanager.v1beta2.CreateSecretRequest\x1a*.google.cloud.secretmanager.v1beta2.Secret\"\x8a\x01\xda\x41\x17parent,secret_id,secret\x82\xd3\xe4\x93\x02j\"$/v1beta2/{parent=projects/*}/secrets:\x06secretZ:\"0/v1beta2/{parent=projects/*/locations/*}/secrets:\x06secret\x12\x96\x02\n\x10\x41\x64\x64SecretVersion\x12;.google.cloud.secretmanager.v1beta2.AddSecretVersionRequest\x1a\x31.google.cloud.secretmanager.v1beta2.SecretVersion\"\x91\x01\xda\x41\x0eparent,payload\x82\xd3\xe4\x93\x02z\"1/v1beta2/{parent=projects/*/secrets/*}:addVersion:\x01*ZB\"=/v1beta2/{parent=projects/*/locations/*/secrets/*}:addVersion:\x01*\x12\xd6\x01\n\tGetSecret\x12\x34.google.cloud.secretmanager.v1beta2.GetSecretRequest\x1a*.google.cloud.secretmanager.v1beta2.Secret\"g\xda\x41\x04name\x82\xd3\xe4\x93\x02Z\x12$/v1beta2/{name=projects/*/secrets/*}Z2\x12\x30/v1beta2/{name=projects/*/locations/*/secrets/*}\x12\x89\x02\n\x0cUpdateSecret\x12\x37.google.cloud.secretmanager.v1beta2.UpdateSecretRequest\x1a*.google.cloud.secretmanager.v1beta2.Secret\"\x93\x01\xda\x41\x12secret,update_mask\x82\xd3\xe4\x93\x02x2+/v1beta2/{secret.name=projects/*/secrets/*}:\x06secretZA27/v1beta2/{secret.name=projects/*/locations/*/secrets/*}:\x06secret\x12\xc8\x01\n\x0c\x44\x65leteSecret\x12\x37.google.cloud.secretmanager.v1beta2.DeleteSecretRequest\x1a\x16.google.protobuf.Empty\"g\xda\x41\x04name\x82\xd3\xe4\x93\x02Z*$/v1beta2/{name=projects/*/secrets/*}Z2*0/v1beta2/{name=projects/*/locations/*/secrets/*}\x12\x94\x02\n\x12ListSecretVersions\x12=.google.cloud.secretmanager.v1beta2.ListSecretVersionsRequest\x1a>.google.cloud.secretmanager.v1beta2.ListSecretVersionsResponse\"\x7f\xda\x41\x06parent\x82\xd3\xe4\x93\x02p\x12//v1beta2/{parent=projects/*/secrets/*}/versionsZ=\x12;/v1beta2/{parent=projects/*/locations/*/secrets/*}/versions\x12\x81\x02\n\x10GetSecretVersion\x12;.google.cloud.secretmanager.v1beta2.GetSecretVersionRequest\x1a\x31.google.cloud.secretmanager.v1beta2.SecretVersion\"}\xda\x41\x04name\x82\xd3\xe4\x93\x02p\x12//v1beta2/{name=projects/*/secrets/*/versions/*}Z=\x12;/v1beta2/{name=projects/*/locations/*/secrets/*/versions/*}\x12\xa4\x02\n\x13\x41\x63\x63\x65ssSecretVersion\x12>.google.cloud.secretmanager.v1beta2.AccessSecretVersionRequest\x1a?.google.cloud.secretmanager.v1beta2.AccessSecretVersionResponse\"\x8b\x01\xda\x41\x04name\x82\xd3\xe4\x93\x02~\x12\x36/v1beta2/{name=projects/*/secrets/*/versions/*}:accessZD\x12\x42/v1beta2/{name=projects/*/locations/*/secrets/*/versions/*}:access\x12\xa1\x02\n\x14\x44isableSecretVersion\x12?.google.cloud.secretmanager.v1beta2.DisableSecretVersionRequest\x1a\x31.google.cloud.secretmanager.v1beta2.SecretVersion\"\x94\x01\xda\x41\x04name\x82\xd3\xe4\x93\x02\x86\x01\"7/v1beta2/{name=projects/*/secrets/*/versions/*}:disable:\x01*ZH\"C/v1beta2/{name=projects/*/locations/*/secrets/*/versions/*}:disable:\x01*\x12\x9d\x02\n\x13\x45nableSecretVersion\x12>.google.cloud.secretmanager.v1beta2.EnableSecretVersionRequest\x1a\x31.google.cloud.secretmanager.v1beta2.SecretVersion\"\x92\x01\xda\x41\x04name\x82\xd3\xe4\x93\x02\x84\x01\"6/v1beta2/{name=projects/*/secrets/*/versions/*}:enable:\x01*ZG\"B/v1beta2/{name=projects/*/locations/*/secrets/*/versions/*}:enable:\x01*\x12\xa1\x02\n\x14\x44\x65stroySecretVersion\x12?.google.cloud.secretmanager.v1beta2.DestroySecretVersionRequest\x1a\x31.google.cloud.secretmanager.v1beta2.SecretVersion\"\x94\x01\xda\x41\x04name\x82\xd3\xe4\x93\x02\x86\x01\"7/v1beta2/{name=projects/*/secrets/*/versions/*}:destroy:\x01*ZH\"C/v1beta2/{name=projects/*/locations/*/secrets/*/versions/*}:destroy:\x01*\x12\xd5\x01\n\x0cSetIamPolicy\x12\".google.iam.v1.SetIamPolicyRequest\x1a\x15.google.iam.v1.Policy\"\x89\x01\x82\xd3\xe4\x93\x02\x82\x01\"5/v1beta2/{resource=projects/*/secrets/*}:setIamPolicy:\x01*ZF\"A/v1beta2/{resource=projects/*/locations/*/secrets/*}:setIamPolicy:\x01*\x12\xce\x01\n\x0cGetIamPolicy\x12\".google.iam.v1.GetIamPolicyRequest\x1a\x15.google.iam.v1.Policy\"\x82\x01\x82\xd3\xe4\x93\x02|\x12\x35/v1beta2/{resource=projects/*/secrets/*}:getIamPolicyZC\x12\x41/v1beta2/{resource=projects/*/locations/*/secrets/*}:getIamPolicy\x12\x81\x02\n\x12TestIamPermissions\x12(.google.iam.v1.TestIamPermissionsRequest\x1a).google.iam.v1.TestIamPermissionsResponse\"\x95\x01\x82\xd3\xe4\x93\x02\x8e\x01\";/v1beta2/{resource=projects/*/secrets/*}:testIamPermissions:\x01*ZL\"G/v1beta2/{resource=projects/*/locations/*/secrets/*}:testIamPermissions:\x01*\x1aP\xca\x41\x1csecretmanager.googleapis.com\xd2\x41.https://www.googleapis.com/auth/cloud-platformB\xfe\x01\n&com.google.cloud.secretmanager.v1beta2B\x0cServiceProtoP\x01ZLcloud.google.com/go/secretmanager/apiv1beta2/secretmanagerpb;secretmanagerpb\xa2\x02\x03GSM\xaa\x02\"Google.Cloud.SecretManager.V1Beta2\xca\x02\"Google\\Cloud\\SecretManager\\V1beta2\xea\x02%Google::Cloud::SecretManager::V1beta2b\x06proto3" - -pool = ::Google::Protobuf::DescriptorPool.generated_pool -pool.add_serialized_file(descriptor_data) - -module Google - module Cloud - module SecretManager - module V1beta2 - ListSecretsRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.secretmanager.v1beta2.ListSecretsRequest").msgclass - ListSecretsResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.secretmanager.v1beta2.ListSecretsResponse").msgclass - CreateSecretRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.secretmanager.v1beta2.CreateSecretRequest").msgclass - AddSecretVersionRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.secretmanager.v1beta2.AddSecretVersionRequest").msgclass - GetSecretRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.secretmanager.v1beta2.GetSecretRequest").msgclass - ListSecretVersionsRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.secretmanager.v1beta2.ListSecretVersionsRequest").msgclass - ListSecretVersionsResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.secretmanager.v1beta2.ListSecretVersionsResponse").msgclass - GetSecretVersionRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.secretmanager.v1beta2.GetSecretVersionRequest").msgclass - UpdateSecretRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.secretmanager.v1beta2.UpdateSecretRequest").msgclass - AccessSecretVersionRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.secretmanager.v1beta2.AccessSecretVersionRequest").msgclass - AccessSecretVersionResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.secretmanager.v1beta2.AccessSecretVersionResponse").msgclass - DeleteSecretRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.secretmanager.v1beta2.DeleteSecretRequest").msgclass - DisableSecretVersionRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.secretmanager.v1beta2.DisableSecretVersionRequest").msgclass - EnableSecretVersionRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.secretmanager.v1beta2.EnableSecretVersionRequest").msgclass - DestroySecretVersionRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.secretmanager.v1beta2.DestroySecretVersionRequest").msgclass - end - end - end -end diff --git a/owl-bot-staging/google-cloud-secret_manager-v1beta2/lib/google/cloud/secretmanager/v1beta2/service_services_pb.rb b/owl-bot-staging/google-cloud-secret_manager-v1beta2/lib/google/cloud/secretmanager/v1beta2/service_services_pb.rb deleted file mode 100644 index 86d8147e919d..000000000000 --- a/owl-bot-staging/google-cloud-secret_manager-v1beta2/lib/google/cloud/secretmanager/v1beta2/service_services_pb.rb +++ /dev/null @@ -1,125 +0,0 @@ -# Generated by the protocol buffer compiler. DO NOT EDIT! -# Source: google/cloud/secretmanager/v1beta2/service.proto for package 'Google.Cloud.SecretManager.V1beta2' -# Original file comments: -# 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 -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. -# - -require 'grpc' -require 'google/cloud/secretmanager/v1beta2/service_pb' - -module Google - module Cloud - module SecretManager - module V1beta2 - module SecretManagerService - # Secret Manager Service - # - # Manages secrets and operations using those secrets. Implements a REST - # model with the following objects: - # - # * [Secret][google.cloud.secretmanager.v1beta2.Secret] - # * [SecretVersion][google.cloud.secretmanager.v1beta2.SecretVersion] - class Service - - include ::GRPC::GenericService - - self.marshal_class_method = :encode - self.unmarshal_class_method = :decode - self.service_name = 'google.cloud.secretmanager.v1beta2.SecretManagerService' - - # Lists [Secrets][google.cloud.secretmanager.v1beta2.Secret]. - rpc :ListSecrets, ::Google::Cloud::SecretManager::V1beta2::ListSecretsRequest, ::Google::Cloud::SecretManager::V1beta2::ListSecretsResponse - # Creates a new [Secret][google.cloud.secretmanager.v1beta2.Secret] - # containing no - # [SecretVersions][google.cloud.secretmanager.v1beta2.SecretVersion]. - rpc :CreateSecret, ::Google::Cloud::SecretManager::V1beta2::CreateSecretRequest, ::Google::Cloud::SecretManager::V1beta2::Secret - # Creates a new - # [SecretVersion][google.cloud.secretmanager.v1beta2.SecretVersion] - # containing secret data and attaches it to an existing - # [Secret][google.cloud.secretmanager.v1beta2.Secret]. - rpc :AddSecretVersion, ::Google::Cloud::SecretManager::V1beta2::AddSecretVersionRequest, ::Google::Cloud::SecretManager::V1beta2::SecretVersion - # Gets metadata for a given - # [Secret][google.cloud.secretmanager.v1beta2.Secret]. - rpc :GetSecret, ::Google::Cloud::SecretManager::V1beta2::GetSecretRequest, ::Google::Cloud::SecretManager::V1beta2::Secret - # Updates metadata of an existing - # [Secret][google.cloud.secretmanager.v1beta2.Secret]. - rpc :UpdateSecret, ::Google::Cloud::SecretManager::V1beta2::UpdateSecretRequest, ::Google::Cloud::SecretManager::V1beta2::Secret - # Deletes a [Secret][google.cloud.secretmanager.v1beta2.Secret]. - rpc :DeleteSecret, ::Google::Cloud::SecretManager::V1beta2::DeleteSecretRequest, ::Google::Protobuf::Empty - # Lists [SecretVersions][google.cloud.secretmanager.v1beta2.SecretVersion]. - # This call does not return secret data. - rpc :ListSecretVersions, ::Google::Cloud::SecretManager::V1beta2::ListSecretVersionsRequest, ::Google::Cloud::SecretManager::V1beta2::ListSecretVersionsResponse - # Gets metadata for a - # [SecretVersion][google.cloud.secretmanager.v1beta2.SecretVersion]. - # - # `projects/*/secrets/*/versions/latest` is an alias to the most recently - # created [SecretVersion][google.cloud.secretmanager.v1beta2.SecretVersion]. - rpc :GetSecretVersion, ::Google::Cloud::SecretManager::V1beta2::GetSecretVersionRequest, ::Google::Cloud::SecretManager::V1beta2::SecretVersion - # Accesses a - # [SecretVersion][google.cloud.secretmanager.v1beta2.SecretVersion]. This - # call returns the secret data. - # - # `projects/*/secrets/*/versions/latest` is an alias to the most recently - # created [SecretVersion][google.cloud.secretmanager.v1beta2.SecretVersion]. - rpc :AccessSecretVersion, ::Google::Cloud::SecretManager::V1beta2::AccessSecretVersionRequest, ::Google::Cloud::SecretManager::V1beta2::AccessSecretVersionResponse - # Disables a - # [SecretVersion][google.cloud.secretmanager.v1beta2.SecretVersion]. - # - # Sets the [state][google.cloud.secretmanager.v1beta2.SecretVersion.state] of - # the [SecretVersion][google.cloud.secretmanager.v1beta2.SecretVersion] to - # [DISABLED][google.cloud.secretmanager.v1beta2.SecretVersion.State.DISABLED]. - rpc :DisableSecretVersion, ::Google::Cloud::SecretManager::V1beta2::DisableSecretVersionRequest, ::Google::Cloud::SecretManager::V1beta2::SecretVersion - # Enables a - # [SecretVersion][google.cloud.secretmanager.v1beta2.SecretVersion]. - # - # Sets the [state][google.cloud.secretmanager.v1beta2.SecretVersion.state] of - # the [SecretVersion][google.cloud.secretmanager.v1beta2.SecretVersion] to - # [ENABLED][google.cloud.secretmanager.v1beta2.SecretVersion.State.ENABLED]. - rpc :EnableSecretVersion, ::Google::Cloud::SecretManager::V1beta2::EnableSecretVersionRequest, ::Google::Cloud::SecretManager::V1beta2::SecretVersion - # Destroys a - # [SecretVersion][google.cloud.secretmanager.v1beta2.SecretVersion]. - # - # Sets the [state][google.cloud.secretmanager.v1beta2.SecretVersion.state] of - # the [SecretVersion][google.cloud.secretmanager.v1beta2.SecretVersion] to - # [DESTROYED][google.cloud.secretmanager.v1beta2.SecretVersion.State.DESTROYED] - # and irrevocably destroys the secret data. - rpc :DestroySecretVersion, ::Google::Cloud::SecretManager::V1beta2::DestroySecretVersionRequest, ::Google::Cloud::SecretManager::V1beta2::SecretVersion - # Sets the access control policy on the specified secret. Replaces any - # existing policy. - # - # Permissions on - # [SecretVersions][google.cloud.secretmanager.v1beta2.SecretVersion] are - # enforced according to the policy set on the associated - # [Secret][google.cloud.secretmanager.v1beta2.Secret]. - rpc :SetIamPolicy, ::Google::Iam::V1::SetIamPolicyRequest, ::Google::Iam::V1::Policy - # Gets the access control policy for a secret. - # Returns empty policy if the secret exists and does not have a policy set. - rpc :GetIamPolicy, ::Google::Iam::V1::GetIamPolicyRequest, ::Google::Iam::V1::Policy - # Returns permissions that a caller has for the specified secret. - # If the secret does not exist, this call returns an empty set of - # permissions, not a NOT_FOUND error. - # - # Note: This operation is designed to be used for building permission-aware - # UIs and command-line tools, not for authorization checking. This operation - # may "fail open" without warning. - rpc :TestIamPermissions, ::Google::Iam::V1::TestIamPermissionsRequest, ::Google::Iam::V1::TestIamPermissionsResponse - end - - Stub = Service.rpc_stub_class - end - end - end - end -end diff --git a/owl-bot-staging/google-cloud-secret_manager-v1beta2/proto_docs/README.md b/owl-bot-staging/google-cloud-secret_manager-v1beta2/proto_docs/README.md deleted file mode 100644 index 397e964dde26..000000000000 --- a/owl-bot-staging/google-cloud-secret_manager-v1beta2/proto_docs/README.md +++ /dev/null @@ -1,4 +0,0 @@ -# Secret Manager V1BETA2 Protocol Buffer Documentation - -These files are for the YARD documentation of the generated protobuf files. -They are not intended to be required or loaded at runtime. diff --git a/owl-bot-staging/google-cloud-secret_manager-v1beta2/proto_docs/google/api/client.rb b/owl-bot-staging/google-cloud-secret_manager-v1beta2/proto_docs/google/api/client.rb deleted file mode 100644 index 5089551e9ea4..000000000000 --- a/owl-bot-staging/google-cloud-secret_manager-v1beta2/proto_docs/google/api/client.rb +++ /dev/null @@ -1,589 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - - -module Google - module Api - # Required information for every language. - # @!attribute [rw] reference_docs_uri - # @deprecated This field is deprecated and may be removed in the next major version update. - # @return [::String] - # Link to automatically generated reference documentation. Example: - # https://cloud.google.com/nodejs/docs/reference/asset/latest - # @!attribute [rw] destinations - # @return [::Array<::Google::Api::ClientLibraryDestination>] - # The destination where API teams want this client library to be published. - # @!attribute [rw] selective_gapic_generation - # @return [::Google::Api::SelectiveGapicGeneration] - # Configuration for which RPCs should be generated in the GAPIC client. - class CommonLanguageSettings - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Details about how and where to publish client libraries. - # @!attribute [rw] version - # @return [::String] - # Version of the API to apply these settings to. This is the full protobuf - # package for the API, ending in the version element. - # Examples: "google.cloud.speech.v1" and "google.spanner.admin.database.v1". - # @!attribute [rw] launch_stage - # @return [::Google::Api::LaunchStage] - # Launch stage of this version of the API. - # @!attribute [rw] rest_numeric_enums - # @return [::Boolean] - # When using transport=rest, the client request will encode enums as - # numbers rather than strings. - # @!attribute [rw] java_settings - # @return [::Google::Api::JavaSettings] - # Settings for legacy Java features, supported in the Service YAML. - # @!attribute [rw] cpp_settings - # @return [::Google::Api::CppSettings] - # Settings for C++ client libraries. - # @!attribute [rw] php_settings - # @return [::Google::Api::PhpSettings] - # Settings for PHP client libraries. - # @!attribute [rw] python_settings - # @return [::Google::Api::PythonSettings] - # Settings for Python client libraries. - # @!attribute [rw] node_settings - # @return [::Google::Api::NodeSettings] - # Settings for Node client libraries. - # @!attribute [rw] dotnet_settings - # @return [::Google::Api::DotnetSettings] - # Settings for .NET client libraries. - # @!attribute [rw] ruby_settings - # @return [::Google::Api::RubySettings] - # Settings for Ruby client libraries. - # @!attribute [rw] go_settings - # @return [::Google::Api::GoSettings] - # Settings for Go client libraries. - class ClientLibrarySettings - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # This message configures the settings for publishing [Google Cloud Client - # libraries](https://cloud.google.com/apis/docs/cloud-client-libraries) - # generated from the service config. - # @!attribute [rw] method_settings - # @return [::Array<::Google::Api::MethodSettings>] - # A list of API method settings, e.g. the behavior for methods that use the - # long-running operation pattern. - # @!attribute [rw] new_issue_uri - # @return [::String] - # Link to a *public* URI where users can report issues. Example: - # https://issuetracker.google.com/issues/new?component=190865&template=1161103 - # @!attribute [rw] documentation_uri - # @return [::String] - # Link to product home page. Example: - # https://cloud.google.com/asset-inventory/docs/overview - # @!attribute [rw] api_short_name - # @return [::String] - # Used as a tracking tag when collecting data about the APIs developer - # relations artifacts like docs, packages delivered to package managers, - # etc. Example: "speech". - # @!attribute [rw] github_label - # @return [::String] - # GitHub label to apply to issues and pull requests opened for this API. - # @!attribute [rw] codeowner_github_teams - # @return [::Array<::String>] - # GitHub teams to be added to CODEOWNERS in the directory in GitHub - # containing source code for the client libraries for this API. - # @!attribute [rw] doc_tag_prefix - # @return [::String] - # A prefix used in sample code when demarking regions to be included in - # documentation. - # @!attribute [rw] organization - # @return [::Google::Api::ClientLibraryOrganization] - # For whom the client library is being published. - # @!attribute [rw] library_settings - # @return [::Array<::Google::Api::ClientLibrarySettings>] - # Client library settings. If the same version string appears multiple - # times in this list, then the last one wins. Settings from earlier - # settings with the same version string are discarded. - # @!attribute [rw] proto_reference_documentation_uri - # @return [::String] - # Optional link to proto reference documentation. Example: - # https://cloud.google.com/pubsub/lite/docs/reference/rpc - # @!attribute [rw] rest_reference_documentation_uri - # @return [::String] - # Optional link to REST reference documentation. Example: - # https://cloud.google.com/pubsub/lite/docs/reference/rest - class Publishing - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Settings for Java client libraries. - # @!attribute [rw] library_package - # @return [::String] - # The package name to use in Java. Clobbers the java_package option - # set in the protobuf. This should be used **only** by APIs - # who have already set the language_settings.java.package_name" field - # in gapic.yaml. API teams should use the protobuf java_package option - # where possible. - # - # Example of a YAML configuration:: - # - # publishing: - # 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. - # @!attribute [rw] methods - # @return [::Array<::String>] - # An allowlist of the fully qualified names of RPCs that should be included - # on public client surfaces. - # @!attribute [rw] generate_omitted_as_internal - # @return [::Boolean] - # Setting this to true indicates to the client generators that methods - # that would be excluded from the generation should instead be generated - # in a way that indicates these methods should not be consumed by - # end users. How this is expressed is up to individual language - # implementations to decide. Some examples may be: added annotations, - # obfuscated identifiers, or other language idiomatic patterns. - class SelectiveGapicGeneration - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # `BatchingConfigProto` defines the batching configuration for an API method. - # @!attribute [rw] thresholds - # @return [::Google::Api::BatchingSettingsProto] - # The thresholds which trigger a batched request to be sent. - # @!attribute [rw] batch_descriptor - # @return [::Google::Api::BatchingDescriptorProto] - # The request and response fields used in batching. - class BatchingConfigProto - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # `BatchingSettingsProto` specifies a set of batching thresholds, each of - # which acts as a trigger to send a batch of messages as a request. At least - # one threshold must be positive nonzero. - # @!attribute [rw] element_count_threshold - # @return [::Integer] - # The number of elements of a field collected into a batch which, if - # exceeded, causes the batch to be sent. - # @!attribute [rw] request_byte_threshold - # @return [::Integer] - # The aggregated size of the batched field which, if exceeded, causes the - # batch to be sent. This size is computed by aggregating the sizes of the - # request field to be batched, not of the entire request message. - # @!attribute [rw] delay_threshold - # @return [::Google::Protobuf::Duration] - # The duration after which a batch should be sent, starting from the addition - # of the first message to that batch. - # @!attribute [rw] element_count_limit - # @return [::Integer] - # The maximum number of elements collected in a batch that could be accepted - # by server. - # @!attribute [rw] request_byte_limit - # @return [::Integer] - # The maximum size of the request that could be accepted by server. - # @!attribute [rw] flow_control_element_limit - # @return [::Integer] - # The maximum number of elements allowed by flow control. - # @!attribute [rw] flow_control_byte_limit - # @return [::Integer] - # The maximum size of data allowed by flow control. - # @!attribute [rw] flow_control_limit_exceeded_behavior - # @return [::Google::Api::FlowControlLimitExceededBehaviorProto] - # The behavior to take when the flow control limit is exceeded. - class BatchingSettingsProto - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # `BatchingDescriptorProto` specifies the fields of the request message to be - # used for batching, and, optionally, the fields of the response message to be - # used for demultiplexing. - # @!attribute [rw] batched_field - # @return [::String] - # The repeated field in the request message to be aggregated by batching. - # @!attribute [rw] discriminator_fields - # @return [::Array<::String>] - # A list of the fields in the request message. Two requests will be batched - # together only if the values of every field specified in - # `request_discriminator_fields` is equal between the two requests. - # @!attribute [rw] subresponse_field - # @return [::String] - # Optional. When present, indicates the field in the response message to be - # used to demultiplex the response into multiple response messages, in - # correspondence with the multiple request messages originally batched - # together. - class BatchingDescriptorProto - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # The organization for which the client libraries are being published. - # Affects the url where generated docs are published, etc. - module ClientLibraryOrganization - # Not useful. - CLIENT_LIBRARY_ORGANIZATION_UNSPECIFIED = 0 - - # Google Cloud Platform Org. - CLOUD = 1 - - # Ads (Advertising) Org. - ADS = 2 - - # Photos Org. - PHOTOS = 3 - - # Street View Org. - STREET_VIEW = 4 - - # Shopping Org. - SHOPPING = 5 - - # Geo Org. - GEO = 6 - - # Generative AI - https://developers.generativeai.google - GENERATIVE_AI = 7 - end - - # To where should client libraries be published? - module ClientLibraryDestination - # Client libraries will neither be generated nor published to package - # managers. - CLIENT_LIBRARY_DESTINATION_UNSPECIFIED = 0 - - # Generate the client library in a repo under github.com/googleapis, - # but don't publish it to package managers. - GITHUB = 10 - - # Publish the library to package managers like nuget.org and npmjs.com. - PACKAGE_MANAGER = 20 - end - - # The behavior to take when the flow control limit is exceeded. - module FlowControlLimitExceededBehaviorProto - # Default behavior, system-defined. - UNSET_BEHAVIOR = 0 - - # Stop operation, raise error. - THROW_EXCEPTION = 1 - - # Pause operation until limit clears. - BLOCK = 2 - - # Continue operation, disregard limit. - IGNORE = 3 - end - end -end diff --git a/owl-bot-staging/google-cloud-secret_manager-v1beta2/proto_docs/google/api/field_behavior.rb b/owl-bot-staging/google-cloud-secret_manager-v1beta2/proto_docs/google/api/field_behavior.rb deleted file mode 100644 index 582be187d115..000000000000 --- a/owl-bot-staging/google-cloud-secret_manager-v1beta2/proto_docs/google/api/field_behavior.rb +++ /dev/null @@ -1,85 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - - -module Google - module Api - # An indicator of the behavior of a given field (for example, that a field - # is required in requests, or given as output but ignored as input). - # This **does not** change the behavior in protocol buffers itself; it only - # denotes the behavior and may affect how API tooling handles the field. - # - # Note: This enum **may** receive new values in the future. - module FieldBehavior - # Conventional default for enums. Do not use this. - FIELD_BEHAVIOR_UNSPECIFIED = 0 - - # Specifically denotes a field as optional. - # While all fields in protocol buffers are optional, this may be specified - # for emphasis if appropriate. - OPTIONAL = 1 - - # Denotes a field as required. - # This indicates that the field **must** be provided as part of the request, - # and failure to do so will cause an error (usually `INVALID_ARGUMENT`). - REQUIRED = 2 - - # Denotes a field as output only. - # This indicates that the field is provided in responses, but including the - # field in a request does nothing (the server *must* ignore it and - # *must not* throw an error as a result of the field's presence). - OUTPUT_ONLY = 3 - - # Denotes a field as input only. - # This indicates that the field is provided in requests, and the - # corresponding field is not included in output. - INPUT_ONLY = 4 - - # Denotes a field as immutable. - # This indicates that the field may be set once in a request to create a - # resource, but may not be changed thereafter. - IMMUTABLE = 5 - - # Denotes that a (repeated) field is an unordered list. - # This indicates that the service may provide the elements of the list - # in any arbitrary order, rather than the order the user originally - # provided. Additionally, the list's order may or may not be stable. - UNORDERED_LIST = 6 - - # Denotes that this field returns a non-empty default value if not set. - # This indicates that if the user provides the empty value in a request, - # a non-empty value will be returned. The user will not be aware of what - # non-empty value to expect. - NON_EMPTY_DEFAULT = 7 - - # Denotes that the field in a resource (a message annotated with - # google.api.resource) is used in the resource name to uniquely identify the - # resource. For AIP-compliant APIs, this should only be applied to the - # `name` field on the resource. - # - # This behavior should not be applied to references to other resources within - # the message. - # - # The identifier field of resources often have different field behavior - # depending on the request it is embedded in (e.g. for Create methods name - # is optional and unused, while for Update methods it is required). Instead - # of method-specific annotations, only `IDENTIFIER` is required. - IDENTIFIER = 8 - end - end -end diff --git a/owl-bot-staging/google-cloud-secret_manager-v1beta2/proto_docs/google/api/launch_stage.rb b/owl-bot-staging/google-cloud-secret_manager-v1beta2/proto_docs/google/api/launch_stage.rb deleted file mode 100644 index 9392a413fb1b..000000000000 --- a/owl-bot-staging/google-cloud-secret_manager-v1beta2/proto_docs/google/api/launch_stage.rb +++ /dev/null @@ -1,71 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - - -module Google - module Api - # The launch stage as defined by [Google Cloud Platform - # Launch Stages](https://cloud.google.com/terms/launch-stages). - module LaunchStage - # Do not use this default value. - LAUNCH_STAGE_UNSPECIFIED = 0 - - # The feature is not yet implemented. Users can not use it. - UNIMPLEMENTED = 6 - - # Prelaunch features are hidden from users and are only visible internally. - PRELAUNCH = 7 - - # Early Access features are limited to a closed group of testers. To use - # these features, you must sign up in advance and sign a Trusted Tester - # agreement (which includes confidentiality provisions). These features may - # be unstable, changed in backward-incompatible ways, and are not - # guaranteed to be released. - EARLY_ACCESS = 1 - - # Alpha is a limited availability test for releases before they are cleared - # for widespread use. By Alpha, all significant design issues are resolved - # and we are in the process of verifying functionality. Alpha customers - # need to apply for access, agree to applicable terms, and have their - # projects allowlisted. Alpha releases don't have to be feature complete, - # no SLAs are provided, and there are no technical support obligations, but - # they will be far enough along that customers can actually use them in - # test environments or for limited-use tests -- just like they would in - # normal production cases. - ALPHA = 2 - - # Beta is the point at which we are ready to open a release for any - # customer to use. There are no SLA or technical support obligations in a - # Beta release. Products will be complete from a feature perspective, but - # may have some open outstanding issues. Beta releases are suitable for - # limited production use cases. - BETA = 3 - - # GA features are open to all developers and are considered stable and - # fully qualified for production use. - GA = 4 - - # Deprecated features are scheduled to be shut down and removed. For more - # information, see the "Deprecation Policy" section of our [Terms of - # Service](https://cloud.google.com/terms/) - # and the [Google Cloud Platform Subject to the Deprecation - # Policy](https://cloud.google.com/terms/deprecation) documentation. - DEPRECATED = 5 - end - end -end diff --git a/owl-bot-staging/google-cloud-secret_manager-v1beta2/proto_docs/google/api/resource.rb b/owl-bot-staging/google-cloud-secret_manager-v1beta2/proto_docs/google/api/resource.rb deleted file mode 100644 index 25dec4847ac1..000000000000 --- a/owl-bot-staging/google-cloud-secret_manager-v1beta2/proto_docs/google/api/resource.rb +++ /dev/null @@ -1,227 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - - -module Google - module Api - # A simple descriptor of a resource type. - # - # ResourceDescriptor annotates a resource message (either by means of a - # protobuf annotation or use in the service config), and associates the - # resource's schema, the resource type, and the pattern of the resource name. - # - # Example: - # - # message Topic { - # // Indicates this message defines a resource schema. - # // Declares the resource type in the format of {service}/{kind}. - # // For Kubernetes resources, the format is {api group}/{kind}. - # option (google.api.resource) = { - # type: "pubsub.googleapis.com/Topic" - # pattern: "projects/{project}/topics/{topic}" - # }; - # } - # - # The ResourceDescriptor Yaml config will look like: - # - # resources: - # - type: "pubsub.googleapis.com/Topic" - # pattern: "projects/{project}/topics/{topic}" - # - # Sometimes, resources have multiple patterns, typically because they can - # live under multiple parents. - # - # Example: - # - # message LogEntry { - # option (google.api.resource) = { - # type: "logging.googleapis.com/LogEntry" - # pattern: "projects/{project}/logs/{log}" - # pattern: "folders/{folder}/logs/{log}" - # pattern: "organizations/{organization}/logs/{log}" - # pattern: "billingAccounts/{billing_account}/logs/{log}" - # }; - # } - # - # The ResourceDescriptor Yaml config will look like: - # - # resources: - # - type: 'logging.googleapis.com/LogEntry' - # pattern: "projects/{project}/logs/{log}" - # pattern: "folders/{folder}/logs/{log}" - # pattern: "organizations/{organization}/logs/{log}" - # pattern: "billingAccounts/{billing_account}/logs/{log}" - # @!attribute [rw] type - # @return [::String] - # The resource type. It must be in the format of - # \\{service_name}/\\{resource_type_kind}. The `resource_type_kind` must be - # singular and must not include version numbers. - # - # Example: `storage.googleapis.com/Bucket` - # - # The value of the resource_type_kind must follow the regular expression - # /[A-Za-z][a-zA-Z0-9]+/. It should start with an upper case character and - # should use PascalCase (UpperCamelCase). The maximum number of - # characters allowed for the `resource_type_kind` is 100. - # @!attribute [rw] pattern - # @return [::Array<::String>] - # Optional. The relative resource name pattern associated with this resource - # type. The DNS prefix of the full resource name shouldn't be specified here. - # - # The path pattern must follow the syntax, which aligns with HTTP binding - # syntax: - # - # Template = Segment { "/" Segment } ; - # Segment = LITERAL | Variable ; - # Variable = "{" LITERAL "}" ; - # - # Examples: - # - # - "projects/\\{project}/topics/\\{topic}" - # - "projects/\\{project}/knowledgeBases/\\{knowledge_base}" - # - # The components in braces correspond to the IDs for each resource in the - # hierarchy. It is expected that, if multiple patterns are provided, - # the same component name (e.g. "project") refers to IDs of the same - # type of resource. - # @!attribute [rw] name_field - # @return [::String] - # Optional. The field on the resource that designates the resource name - # field. If omitted, this is assumed to be "name". - # @!attribute [rw] history - # @return [::Google::Api::ResourceDescriptor::History] - # Optional. The historical or future-looking state of the resource pattern. - # - # Example: - # - # // The InspectTemplate message originally only supported resource - # // names with organization, and project was added later. - # message InspectTemplate { - # option (google.api.resource) = { - # type: "dlp.googleapis.com/InspectTemplate" - # pattern: - # "organizations/{organization}/inspectTemplates/{inspect_template}" - # pattern: "projects/{project}/inspectTemplates/{inspect_template}" - # history: ORIGINALLY_SINGLE_PATTERN - # }; - # } - # @!attribute [rw] plural - # @return [::String] - # The plural name used in the resource name and permission names, such as - # 'projects' for the resource name of 'projects/\\{project}' and the permission - # name of 'cloudresourcemanager.googleapis.com/projects.get'. One exception - # to this is for Nested Collections that have stuttering names, as defined - # in [AIP-122](https://google.aip.dev/122#nested-collections), where the - # collection ID in the resource name pattern does not necessarily directly - # match the `plural` value. - # - # It is the same concept of the `plural` field in k8s CRD spec - # https://kubernetes.io/docs/tasks/access-kubernetes-api/custom-resources/custom-resource-definitions/ - # - # Note: The plural form is required even for singleton resources. See - # https://aip.dev/156 - # @!attribute [rw] singular - # @return [::String] - # The same concept of the `singular` field in k8s CRD spec - # https://kubernetes.io/docs/tasks/access-kubernetes-api/custom-resources/custom-resource-definitions/ - # Such as "project" for the `resourcemanager.googleapis.com/Project` type. - # @!attribute [rw] style - # @return [::Array<::Google::Api::ResourceDescriptor::Style>] - # Style flag(s) for this resource. - # These indicate that a resource is expected to conform to a given - # style. See the specific style flags for additional information. - class ResourceDescriptor - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - - # A description of the historical or future-looking state of the - # resource pattern. - module History - # The "unset" value. - HISTORY_UNSPECIFIED = 0 - - # The resource originally had one pattern and launched as such, and - # additional patterns were added later. - ORIGINALLY_SINGLE_PATTERN = 1 - - # The resource has one pattern, but the API owner expects to add more - # later. (This is the inverse of ORIGINALLY_SINGLE_PATTERN, and prevents - # that from being necessary once there are multiple patterns.) - FUTURE_MULTI_PATTERN = 2 - end - - # A flag representing a specific style that a resource claims to conform to. - module Style - # The unspecified value. Do not use. - STYLE_UNSPECIFIED = 0 - - # This resource is intended to be "declarative-friendly". - # - # Declarative-friendly resources must be more strictly consistent, and - # setting this to true communicates to tools that this resource should - # adhere to declarative-friendly expectations. - # - # Note: This is used by the API linter (linter.aip.dev) to enable - # additional checks. - DECLARATIVE_FRIENDLY = 1 - end - end - - # Defines a proto annotation that describes a string field that refers to - # an API resource. - # @!attribute [rw] type - # @return [::String] - # The resource type that the annotated field references. - # - # Example: - # - # message Subscription { - # string topic = 2 [(google.api.resource_reference) = { - # type: "pubsub.googleapis.com/Topic" - # }]; - # } - # - # Occasionally, a field may reference an arbitrary resource. In this case, - # APIs use the special value * in their resource reference. - # - # Example: - # - # message GetIamPolicyRequest { - # string resource = 2 [(google.api.resource_reference) = { - # type: "*" - # }]; - # } - # @!attribute [rw] child_type - # @return [::String] - # The resource type of a child collection that the annotated field - # references. This is useful for annotating the `parent` field that - # doesn't have a fixed resource type. - # - # Example: - # - # message ListLogEntriesRequest { - # string parent = 1 [(google.api.resource_reference) = { - # child_type: "logging.googleapis.com/LogEntry" - # }; - # } - class ResourceReference - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - end -end diff --git a/owl-bot-staging/google-cloud-secret_manager-v1beta2/proto_docs/google/cloud/secretmanager/v1beta2/resources.rb b/owl-bot-staging/google-cloud-secret_manager-v1beta2/proto_docs/google/cloud/secretmanager/v1beta2/resources.rb deleted file mode 100644 index 67caed18595b..000000000000 --- a/owl-bot-staging/google-cloud-secret_manager-v1beta2/proto_docs/google/cloud/secretmanager/v1beta2/resources.rb +++ /dev/null @@ -1,512 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - - -module Google - module Cloud - module SecretManager - module V1beta2 - # A {::Google::Cloud::SecretManager::V1beta2::Secret Secret} is a logical secret - # whose value and versions can be accessed. - # - # A {::Google::Cloud::SecretManager::V1beta2::Secret Secret} is made up of zero or - # more {::Google::Cloud::SecretManager::V1beta2::SecretVersion SecretVersions} that - # represent the secret data. - # @!attribute [r] name - # @return [::String] - # Output only. The resource name of the - # {::Google::Cloud::SecretManager::V1beta2::Secret Secret} in the format - # `projects/*/secrets/*`. - # @!attribute [rw] replication - # @return [::Google::Cloud::SecretManager::V1beta2::Replication] - # Optional. Immutable. The replication policy of the secret data attached to - # the {::Google::Cloud::SecretManager::V1beta2::Secret Secret}. - # - # The replication policy cannot be changed after the Secret has been created. - # @!attribute [r] create_time - # @return [::Google::Protobuf::Timestamp] - # Output only. The time at which the - # {::Google::Cloud::SecretManager::V1beta2::Secret Secret} was created. - # @!attribute [rw] labels - # @return [::Google::Protobuf::Map{::String => ::String}] - # The labels assigned to this Secret. - # - # Label keys must be between 1 and 63 characters long, have a UTF-8 encoding - # of maximum 128 bytes, and must conform to the following PCRE regular - # expression: `[\p{Ll}\p{Lo}][\p{Ll}\p{Lo}\p{N}_-]{0,62}` - # - # Label values must be between 0 and 63 characters long, have a UTF-8 - # encoding of maximum 128 bytes, and must conform to the following PCRE - # regular expression: `[\p{Ll}\p{Lo}\p{N}_-]{0,63}` - # - # No more than 64 labels can be assigned to a given resource. - # @!attribute [rw] topics - # @return [::Array<::Google::Cloud::SecretManager::V1beta2::Topic>] - # Optional. A list of up to 10 Pub/Sub topics to which messages are published - # when control plane operations are called on the secret or its versions. - # @!attribute [rw] expire_time - # @return [::Google::Protobuf::Timestamp] - # Optional. Timestamp in UTC when the - # {::Google::Cloud::SecretManager::V1beta2::Secret Secret} is scheduled to - # expire. This is always provided on output, regardless of what was sent on - # input. - # - # Note: The following fields are mutually exclusive: `expire_time`, `ttl`. If a field in that set is populated, all other fields in the set will automatically be cleared. - # @!attribute [rw] ttl - # @return [::Google::Protobuf::Duration] - # Input only. The TTL for the - # {::Google::Cloud::SecretManager::V1beta2::Secret Secret}. - # - # Note: The following fields are mutually exclusive: `ttl`, `expire_time`. If a field in that set is populated, all other fields in the set will automatically be cleared. - # @!attribute [rw] etag - # @return [::String] - # Optional. Etag of the currently stored - # {::Google::Cloud::SecretManager::V1beta2::Secret Secret}. - # @!attribute [rw] rotation - # @return [::Google::Cloud::SecretManager::V1beta2::Rotation] - # Optional. Rotation policy attached to the - # {::Google::Cloud::SecretManager::V1beta2::Secret Secret}. May be excluded if - # there is no rotation policy. - # @!attribute [rw] version_aliases - # @return [::Google::Protobuf::Map{::String => ::Integer}] - # Optional. Mapping from version alias to version name. - # - # A version alias is a string with a maximum length of 63 characters and can - # contain uppercase and lowercase letters, numerals, and the hyphen (`-`) - # and underscore ('_') characters. An alias string must start with a - # letter and cannot be the string 'latest' or 'NEW'. - # No more than 50 aliases can be assigned to a given secret. - # - # Version-Alias pairs will be viewable via GetSecret and modifiable via - # UpdateSecret. Access by alias is only supported for - # GetSecretVersion and AccessSecretVersion. - # @!attribute [rw] annotations - # @return [::Google::Protobuf::Map{::String => ::String}] - # Optional. Custom metadata about the secret. - # - # Annotations are distinct from various forms of labels. - # Annotations exist to allow client tools to store their own state - # information without requiring a database. - # - # Annotation keys must be between 1 and 63 characters long, have a UTF-8 - # encoding of maximum 128 bytes, begin and end with an alphanumeric character - # ([a-z0-9A-Z]), and may have dashes (-), underscores (_), dots (.), and - # alphanumerics in between these symbols. - # - # The total size of annotation keys and values must be less than 16KiB. - # @!attribute [rw] version_destroy_ttl - # @return [::Google::Protobuf::Duration] - # Optional. Secret Version TTL after destruction request - # - # This is a part of the Delayed secret version destroy feature. - # For secret with TTL>0, version destruction doesn't happen immediately - # on calling destroy instead the version goes to a disabled state and - # destruction happens after the TTL expires. - # @!attribute [rw] customer_managed_encryption - # @return [::Google::Cloud::SecretManager::V1beta2::CustomerManagedEncryption] - # Optional. The customer-managed encryption configuration of the Regionalised - # Secrets. If no configuration is provided, Google-managed default encryption - # is used. - # - # Updates to the {::Google::Cloud::SecretManager::V1beta2::Secret Secret} - # encryption configuration only apply to - # {::Google::Cloud::SecretManager::V1beta2::SecretVersion SecretVersions} added - # afterwards. They do not apply retroactively to existing - # {::Google::Cloud::SecretManager::V1beta2::SecretVersion SecretVersions}. - class Secret - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - - # @!attribute [rw] key - # @return [::String] - # @!attribute [rw] value - # @return [::String] - class LabelsEntry - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # @!attribute [rw] key - # @return [::String] - # @!attribute [rw] value - # @return [::Integer] - class VersionAliasesEntry - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # @!attribute [rw] key - # @return [::String] - # @!attribute [rw] value - # @return [::String] - class AnnotationsEntry - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - end - - # A secret version resource in the Secret Manager API. - # @!attribute [r] name - # @return [::String] - # Output only. The resource name of the - # {::Google::Cloud::SecretManager::V1beta2::SecretVersion SecretVersion} in the - # format `projects/*/secrets/*/versions/*`. - # - # {::Google::Cloud::SecretManager::V1beta2::SecretVersion SecretVersion} IDs in a - # {::Google::Cloud::SecretManager::V1beta2::Secret Secret} start at 1 and are - # incremented for each subsequent version of the secret. - # @!attribute [r] create_time - # @return [::Google::Protobuf::Timestamp] - # Output only. The time at which the - # {::Google::Cloud::SecretManager::V1beta2::SecretVersion SecretVersion} was - # created. - # @!attribute [r] destroy_time - # @return [::Google::Protobuf::Timestamp] - # Output only. The time this - # {::Google::Cloud::SecretManager::V1beta2::SecretVersion SecretVersion} was - # destroyed. Only present if - # {::Google::Cloud::SecretManager::V1beta2::SecretVersion#state state} is - # {::Google::Cloud::SecretManager::V1beta2::SecretVersion::State::DESTROYED DESTROYED}. - # @!attribute [r] state - # @return [::Google::Cloud::SecretManager::V1beta2::SecretVersion::State] - # Output only. The current state of the - # {::Google::Cloud::SecretManager::V1beta2::SecretVersion SecretVersion}. - # @!attribute [rw] replication_status - # @return [::Google::Cloud::SecretManager::V1beta2::ReplicationStatus] - # The replication status of the - # {::Google::Cloud::SecretManager::V1beta2::SecretVersion SecretVersion}. - # @!attribute [r] etag - # @return [::String] - # Output only. Etag of the currently stored - # {::Google::Cloud::SecretManager::V1beta2::SecretVersion SecretVersion}. - # @!attribute [r] client_specified_payload_checksum - # @return [::Boolean] - # Output only. True if payload checksum specified in - # {::Google::Cloud::SecretManager::V1beta2::SecretPayload SecretPayload} object - # has been received by - # {::Google::Cloud::SecretManager::V1beta2::SecretManagerService::Client SecretManagerService} - # on - # {::Google::Cloud::SecretManager::V1beta2::SecretManagerService::Client#add_secret_version SecretManagerService.AddSecretVersion}. - # @!attribute [r] scheduled_destroy_time - # @return [::Google::Protobuf::Timestamp] - # Optional. Output only. Scheduled destroy time for secret version. - # This is a part of the Delayed secret version destroy feature. For a - # Secret with a valid version destroy TTL, when a secert version is - # destroyed, version is moved to disabled state and it is scheduled for - # destruction Version is destroyed only after the scheduled_destroy_time. - # @!attribute [r] customer_managed_encryption - # @return [::Google::Cloud::SecretManager::V1beta2::CustomerManagedEncryptionStatus] - # Output only. The customer-managed encryption status of the - # {::Google::Cloud::SecretManager::V1beta2::SecretVersion SecretVersion}. Only - # populated if customer-managed encryption is used and - # {::Google::Cloud::SecretManager::V1beta2::Secret Secret} is a Regionalised - # Secret. - class SecretVersion - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - - # The state of a - # {::Google::Cloud::SecretManager::V1beta2::SecretVersion SecretVersion}, - # indicating if it can be accessed. - module State - # Not specified. This value is unused and invalid. - STATE_UNSPECIFIED = 0 - - # The {::Google::Cloud::SecretManager::V1beta2::SecretVersion SecretVersion} may - # be accessed. - ENABLED = 1 - - # The {::Google::Cloud::SecretManager::V1beta2::SecretVersion SecretVersion} may - # not be accessed, but the secret data is still available and can be placed - # back into the - # {::Google::Cloud::SecretManager::V1beta2::SecretVersion::State::ENABLED ENABLED} - # state. - DISABLED = 2 - - # The {::Google::Cloud::SecretManager::V1beta2::SecretVersion SecretVersion} is - # destroyed and the secret data is no longer stored. A version may not - # leave this state once entered. - DESTROYED = 3 - end - end - - # A policy that defines the replication and encryption configuration of data. - # @!attribute [rw] automatic - # @return [::Google::Cloud::SecretManager::V1beta2::Replication::Automatic] - # The {::Google::Cloud::SecretManager::V1beta2::Secret Secret} will - # automatically be replicated without any restrictions. - # - # Note: The following fields are mutually exclusive: `automatic`, `user_managed`. If a field in that set is populated, all other fields in the set will automatically be cleared. - # @!attribute [rw] user_managed - # @return [::Google::Cloud::SecretManager::V1beta2::Replication::UserManaged] - # The {::Google::Cloud::SecretManager::V1beta2::Secret Secret} will only be - # replicated into the locations specified. - # - # Note: The following fields are mutually exclusive: `user_managed`, `automatic`. If a field in that set is populated, all other fields in the set will automatically be cleared. - class Replication - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - - # A replication policy that replicates the - # {::Google::Cloud::SecretManager::V1beta2::Secret Secret} payload without any - # restrictions. - # @!attribute [rw] customer_managed_encryption - # @return [::Google::Cloud::SecretManager::V1beta2::CustomerManagedEncryption] - # Optional. The customer-managed encryption configuration of the - # {::Google::Cloud::SecretManager::V1beta2::Secret Secret}. If no configuration - # is provided, Google-managed default encryption is used. - # - # Updates to the {::Google::Cloud::SecretManager::V1beta2::Secret Secret} - # encryption configuration only apply to - # {::Google::Cloud::SecretManager::V1beta2::SecretVersion SecretVersions} added - # afterwards. They do not apply retroactively to existing - # {::Google::Cloud::SecretManager::V1beta2::SecretVersion SecretVersions}. - class Automatic - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # A replication policy that replicates the - # {::Google::Cloud::SecretManager::V1beta2::Secret Secret} payload into the - # locations specified in - # {::Google::Cloud::SecretManager::V1beta2::Replication::UserManaged#replicas Replication.UserManaged.replicas} - # @!attribute [rw] replicas - # @return [::Array<::Google::Cloud::SecretManager::V1beta2::Replication::UserManaged::Replica>] - # Required. The list of Replicas for this - # {::Google::Cloud::SecretManager::V1beta2::Secret Secret}. - # - # Cannot be empty. - class UserManaged - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - - # Represents a Replica for this - # {::Google::Cloud::SecretManager::V1beta2::Secret Secret}. - # @!attribute [rw] location - # @return [::String] - # The canonical IDs of the location to replicate data. - # For example: `"us-east1"`. - # @!attribute [rw] customer_managed_encryption - # @return [::Google::Cloud::SecretManager::V1beta2::CustomerManagedEncryption] - # Optional. The customer-managed encryption configuration of the - # [User-Managed Replica][Replication.UserManaged.Replica]. If no - # configuration is provided, Google-managed default encryption is used. - # - # Updates to the {::Google::Cloud::SecretManager::V1beta2::Secret Secret} - # encryption configuration only apply to - # {::Google::Cloud::SecretManager::V1beta2::SecretVersion SecretVersions} - # added afterwards. They do not apply retroactively to existing - # {::Google::Cloud::SecretManager::V1beta2::SecretVersion SecretVersions}. - class Replica - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - end - end - - # Configuration for encrypting secret payloads using customer-managed - # encryption keys (CMEK). - # @!attribute [rw] kms_key_name - # @return [::String] - # Required. The resource name of the Cloud KMS CryptoKey used to encrypt - # secret payloads. - # - # For secrets using the - # {::Google::Cloud::SecretManager::V1beta2::Replication::UserManaged UserManaged} - # replication policy type, Cloud KMS CryptoKeys must reside in the same - # location as the [replica location][Secret.UserManaged.Replica.location]. - # - # For secrets using the - # {::Google::Cloud::SecretManager::V1beta2::Replication::Automatic Automatic} - # replication policy type, Cloud KMS CryptoKeys must reside in `global`. - # - # The expected format is `projects/*/locations/*/keyRings/*/cryptoKeys/*`. - class CustomerManagedEncryption - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # The replication status of a - # {::Google::Cloud::SecretManager::V1beta2::SecretVersion SecretVersion}. - # @!attribute [rw] automatic - # @return [::Google::Cloud::SecretManager::V1beta2::ReplicationStatus::AutomaticStatus] - # Describes the replication status of a - # {::Google::Cloud::SecretManager::V1beta2::SecretVersion SecretVersion} with - # automatic replication. - # - # Only populated if the parent - # {::Google::Cloud::SecretManager::V1beta2::Secret Secret} has an automatic - # replication policy. - # - # Note: The following fields are mutually exclusive: `automatic`, `user_managed`. If a field in that set is populated, all other fields in the set will automatically be cleared. - # @!attribute [rw] user_managed - # @return [::Google::Cloud::SecretManager::V1beta2::ReplicationStatus::UserManagedStatus] - # Describes the replication status of a - # {::Google::Cloud::SecretManager::V1beta2::SecretVersion SecretVersion} with - # user-managed replication. - # - # Only populated if the parent - # {::Google::Cloud::SecretManager::V1beta2::Secret Secret} has a user-managed - # replication policy. - # - # Note: The following fields are mutually exclusive: `user_managed`, `automatic`. If a field in that set is populated, all other fields in the set will automatically be cleared. - class ReplicationStatus - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - - # The replication status of a - # {::Google::Cloud::SecretManager::V1beta2::SecretVersion SecretVersion} using - # automatic replication. - # - # Only populated if the parent - # {::Google::Cloud::SecretManager::V1beta2::Secret Secret} has an automatic - # replication policy. - # @!attribute [r] customer_managed_encryption - # @return [::Google::Cloud::SecretManager::V1beta2::CustomerManagedEncryptionStatus] - # Output only. The customer-managed encryption status of the - # {::Google::Cloud::SecretManager::V1beta2::SecretVersion SecretVersion}. Only - # populated if customer-managed encryption is used. - class AutomaticStatus - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # The replication status of a - # {::Google::Cloud::SecretManager::V1beta2::SecretVersion SecretVersion} using - # user-managed replication. - # - # Only populated if the parent - # {::Google::Cloud::SecretManager::V1beta2::Secret Secret} has a user-managed - # replication policy. - # @!attribute [r] replicas - # @return [::Array<::Google::Cloud::SecretManager::V1beta2::ReplicationStatus::UserManagedStatus::ReplicaStatus>] - # Output only. The list of replica statuses for the - # {::Google::Cloud::SecretManager::V1beta2::SecretVersion SecretVersion}. - class UserManagedStatus - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - - # Describes the status of a user-managed replica for the - # {::Google::Cloud::SecretManager::V1beta2::SecretVersion SecretVersion}. - # @!attribute [r] location - # @return [::String] - # Output only. The canonical ID of the replica location. - # For example: `"us-east1"`. - # @!attribute [r] customer_managed_encryption - # @return [::Google::Cloud::SecretManager::V1beta2::CustomerManagedEncryptionStatus] - # Output only. The customer-managed encryption status of the - # {::Google::Cloud::SecretManager::V1beta2::SecretVersion SecretVersion}. Only - # populated if customer-managed encryption is used. - class ReplicaStatus - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - end - end - - # Describes the status of customer-managed encryption. - # @!attribute [rw] kms_key_version_name - # @return [::String] - # Required. The resource name of the Cloud KMS CryptoKeyVersion used to - # encrypt the secret payload, in the following format: - # `projects/*/locations/*/keyRings/*/cryptoKeys/*/versions/*`. - class CustomerManagedEncryptionStatus - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # A Pub/Sub topic which Secret Manager will publish to when control plane - # events occur on this secret. - # @!attribute [rw] name - # @return [::String] - # Required. The resource name of the Pub/Sub topic that will be published to, - # in the following format: `projects/*/topics/*`. For publication to succeed, - # the Secret Manager service agent must have the `pubsub.topic.publish` - # permission on the topic. The Pub/Sub Publisher role - # (`roles/pubsub.publisher`) includes this permission. - class Topic - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # The rotation time and period for a - # {::Google::Cloud::SecretManager::V1beta2::Secret Secret}. At next_rotation_time, - # Secret Manager will send a Pub/Sub notification to the topics configured on - # the Secret. {::Google::Cloud::SecretManager::V1beta2::Secret#topics Secret.topics} - # must be set to configure rotation. - # @!attribute [rw] next_rotation_time - # @return [::Google::Protobuf::Timestamp] - # Optional. Timestamp in UTC at which the - # {::Google::Cloud::SecretManager::V1beta2::Secret Secret} is scheduled to rotate. - # Cannot be set to less than 300s (5 min) in the future and at most - # 3153600000s (100 years). - # - # {::Google::Cloud::SecretManager::V1beta2::Rotation#next_rotation_time next_rotation_time} - # MUST be set if - # {::Google::Cloud::SecretManager::V1beta2::Rotation#rotation_period rotation_period} - # is set. - # @!attribute [rw] rotation_period - # @return [::Google::Protobuf::Duration] - # Input only. The Duration between rotation notifications. Must be in seconds - # and at least 3600s (1h) and at most 3153600000s (100 years). - # - # If - # {::Google::Cloud::SecretManager::V1beta2::Rotation#rotation_period rotation_period} - # is set, - # {::Google::Cloud::SecretManager::V1beta2::Rotation#next_rotation_time next_rotation_time} - # must be set. - # {::Google::Cloud::SecretManager::V1beta2::Rotation#next_rotation_time next_rotation_time} - # will be advanced by this period when the service automatically sends - # rotation notifications. - class Rotation - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # A secret payload resource in the Secret Manager API. This contains the - # sensitive secret payload that is associated with a - # {::Google::Cloud::SecretManager::V1beta2::SecretVersion SecretVersion}. - # @!attribute [rw] data - # @return [::String] - # The secret data. Must be no larger than 64KiB. - # @!attribute [rw] data_crc32c - # @return [::Integer] - # Optional. If specified, - # {::Google::Cloud::SecretManager::V1beta2::SecretManagerService::Client SecretManagerService} - # will verify the integrity of the received - # {::Google::Cloud::SecretManager::V1beta2::SecretPayload#data data} on - # {::Google::Cloud::SecretManager::V1beta2::SecretManagerService::Client#add_secret_version SecretManagerService.AddSecretVersion} - # calls using the crc32c checksum and store it to include in future - # {::Google::Cloud::SecretManager::V1beta2::SecretManagerService::Client#access_secret_version SecretManagerService.AccessSecretVersion} - # responses. If a checksum is not provided in the - # {::Google::Cloud::SecretManager::V1beta2::SecretManagerService::Client#add_secret_version SecretManagerService.AddSecretVersion} - # request, the - # {::Google::Cloud::SecretManager::V1beta2::SecretManagerService::Client SecretManagerService} - # will generate and store one for you. - # - # The CRC32C value is encoded as a Int64 for compatibility, and can be - # safely downconverted to uint32 in languages that support this type. - # https://cloud.google.com/apis/design/design_patterns#integer_types - class SecretPayload - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - end - end - end -end diff --git a/owl-bot-staging/google-cloud-secret_manager-v1beta2/proto_docs/google/cloud/secretmanager/v1beta2/service.rb b/owl-bot-staging/google-cloud-secret_manager-v1beta2/proto_docs/google/cloud/secretmanager/v1beta2/service.rb deleted file mode 100644 index 9df94e60b5d9..000000000000 --- a/owl-bot-staging/google-cloud-secret_manager-v1beta2/proto_docs/google/cloud/secretmanager/v1beta2/service.rb +++ /dev/null @@ -1,321 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - - -module Google - module Cloud - module SecretManager - module V1beta2 - # Request message for - # {::Google::Cloud::SecretManager::V1beta2::SecretManagerService::Client#list_secrets SecretManagerService.ListSecrets}. - # @!attribute [rw] parent - # @return [::String] - # Required. The resource name of the project associated with the - # {::Google::Cloud::SecretManager::V1beta2::Secret Secrets}, in the format - # `projects/*` or `projects/*/locations/*` - # @!attribute [rw] page_size - # @return [::Integer] - # Optional. The maximum number of results to be returned in a single page. If - # set to 0, the server decides the number of results to return. If the - # number is greater than 25000, it is capped at 25000. - # @!attribute [rw] page_token - # @return [::String] - # Optional. Pagination token, returned earlier via - # {::Google::Cloud::SecretManager::V1beta2::ListSecretsResponse#next_page_token ListSecretsResponse.next_page_token}. - # @!attribute [rw] filter - # @return [::String] - # Optional. Filter string, adhering to the rules in - # [List-operation - # filtering](https://cloud.google.com/secret-manager/docs/filtering). List - # only secrets matching the filter. If filter is empty, all secrets are - # listed. - class ListSecretsRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Response message for - # {::Google::Cloud::SecretManager::V1beta2::SecretManagerService::Client#list_secrets SecretManagerService.ListSecrets}. - # @!attribute [rw] secrets - # @return [::Array<::Google::Cloud::SecretManager::V1beta2::Secret>] - # The list of {::Google::Cloud::SecretManager::V1beta2::Secret Secrets} sorted in - # reverse by create_time (newest first). - # @!attribute [rw] next_page_token - # @return [::String] - # A token to retrieve the next page of results. Pass this value in - # {::Google::Cloud::SecretManager::V1beta2::ListSecretsRequest#page_token ListSecretsRequest.page_token} - # to retrieve the next page. - # @!attribute [rw] total_size - # @return [::Integer] - # The total number of {::Google::Cloud::SecretManager::V1beta2::Secret Secrets} - # but 0 when the - # {::Google::Cloud::SecretManager::V1beta2::ListSecretsRequest#filter ListSecretsRequest.filter} - # field is set. - class ListSecretsResponse - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Request message for - # {::Google::Cloud::SecretManager::V1beta2::SecretManagerService::Client#create_secret SecretManagerService.CreateSecret}. - # @!attribute [rw] parent - # @return [::String] - # Required. The resource name of the project to associate with the - # {::Google::Cloud::SecretManager::V1beta2::Secret Secret}, in the format - # `projects/*` or `projects/*/locations/*`. - # @!attribute [rw] secret_id - # @return [::String] - # Required. This must be unique within the project. - # - # A secret ID is a string with a maximum length of 255 characters and can - # contain uppercase and lowercase letters, numerals, and the hyphen (`-`) and - # underscore (`_`) characters. - # @!attribute [rw] secret - # @return [::Google::Cloud::SecretManager::V1beta2::Secret] - # Required. A {::Google::Cloud::SecretManager::V1beta2::Secret Secret} with - # initial field values. - class CreateSecretRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Request message for - # {::Google::Cloud::SecretManager::V1beta2::SecretManagerService::Client#add_secret_version SecretManagerService.AddSecretVersion}. - # @!attribute [rw] parent - # @return [::String] - # Required. The resource name of the - # {::Google::Cloud::SecretManager::V1beta2::Secret Secret} to associate with the - # {::Google::Cloud::SecretManager::V1beta2::SecretVersion SecretVersion} in the - # format `projects/*/secrets/*` or `projects/*/locations/*/secrets/*`. - # @!attribute [rw] payload - # @return [::Google::Cloud::SecretManager::V1beta2::SecretPayload] - # Required. The secret payload of the - # {::Google::Cloud::SecretManager::V1beta2::SecretVersion SecretVersion}. - class AddSecretVersionRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Request message for - # {::Google::Cloud::SecretManager::V1beta2::SecretManagerService::Client#get_secret SecretManagerService.GetSecret}. - # @!attribute [rw] name - # @return [::String] - # Required. The resource name of the - # {::Google::Cloud::SecretManager::V1beta2::Secret Secret}, in the format - # `projects/*/secrets/*` or `projects/*/locations/*/secrets/*`. - class GetSecretRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Request message for - # {::Google::Cloud::SecretManager::V1beta2::SecretManagerService::Client#list_secret_versions SecretManagerService.ListSecretVersions}. - # @!attribute [rw] parent - # @return [::String] - # Required. The resource name of the - # {::Google::Cloud::SecretManager::V1beta2::Secret Secret} associated with the - # {::Google::Cloud::SecretManager::V1beta2::SecretVersion SecretVersions} to list, - # in the format `projects/*/secrets/*` or `projects/*/locations/*/secrets/*`. - # @!attribute [rw] page_size - # @return [::Integer] - # Optional. The maximum number of results to be returned in a single page. If - # set to 0, the server decides the number of results to return. If the - # number is greater than 25000, it is capped at 25000. - # @!attribute [rw] page_token - # @return [::String] - # Optional. Pagination token, returned earlier via - # ListSecretVersionsResponse.next_page_token][]. - # @!attribute [rw] filter - # @return [::String] - # Optional. Filter string, adhering to the rules in - # [List-operation - # filtering](https://cloud.google.com/secret-manager/docs/filtering). List - # only secret versions matching the filter. If filter is empty, all secret - # versions are listed. - class ListSecretVersionsRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Response message for - # {::Google::Cloud::SecretManager::V1beta2::SecretManagerService::Client#list_secret_versions SecretManagerService.ListSecretVersions}. - # @!attribute [rw] versions - # @return [::Array<::Google::Cloud::SecretManager::V1beta2::SecretVersion>] - # The list of - # {::Google::Cloud::SecretManager::V1beta2::SecretVersion SecretVersions} sorted - # in reverse by create_time (newest first). - # @!attribute [rw] next_page_token - # @return [::String] - # A token to retrieve the next page of results. Pass this value in - # {::Google::Cloud::SecretManager::V1beta2::ListSecretVersionsRequest#page_token ListSecretVersionsRequest.page_token} - # to retrieve the next page. - # @!attribute [rw] total_size - # @return [::Integer] - # The total number of - # {::Google::Cloud::SecretManager::V1beta2::SecretVersion SecretVersions} but 0 - # when the - # {::Google::Cloud::SecretManager::V1beta2::ListSecretsRequest#filter ListSecretsRequest.filter} - # field is set. - class ListSecretVersionsResponse - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Request message for - # {::Google::Cloud::SecretManager::V1beta2::SecretManagerService::Client#get_secret_version SecretManagerService.GetSecretVersion}. - # @!attribute [rw] name - # @return [::String] - # Required. The resource name of the - # {::Google::Cloud::SecretManager::V1beta2::SecretVersion SecretVersion} in the - # format `projects/*/secrets/*/versions/*` or - # `projects/*/locations/*/secrets/*/versions/*`. - # - # `projects/*/secrets/*/versions/latest` or - # `projects/*/locations/*/secrets/*/versions/latest` is an alias to the most - # recently created - # {::Google::Cloud::SecretManager::V1beta2::SecretVersion SecretVersion}. - class GetSecretVersionRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Request message for - # {::Google::Cloud::SecretManager::V1beta2::SecretManagerService::Client#update_secret SecretManagerService.UpdateSecret}. - # @!attribute [rw] secret - # @return [::Google::Cloud::SecretManager::V1beta2::Secret] - # Required. {::Google::Cloud::SecretManager::V1beta2::Secret Secret} with updated - # field values. - # @!attribute [rw] update_mask - # @return [::Google::Protobuf::FieldMask] - # Required. Specifies the fields to be updated. - class UpdateSecretRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Request message for - # {::Google::Cloud::SecretManager::V1beta2::SecretManagerService::Client#access_secret_version SecretManagerService.AccessSecretVersion}. - # @!attribute [rw] name - # @return [::String] - # Required. The resource name of the - # {::Google::Cloud::SecretManager::V1beta2::SecretVersion SecretVersion} in the - # format `projects/*/secrets/*/versions/*` or - # `projects/*/locations/*/secrets/*/versions/*`. - # - # `projects/*/secrets/*/versions/latest` or - # `projects/*/locations/*/secrets/*/versions/latest` is an alias to the most - # recently created - # {::Google::Cloud::SecretManager::V1beta2::SecretVersion SecretVersion}. - class AccessSecretVersionRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Response message for - # {::Google::Cloud::SecretManager::V1beta2::SecretManagerService::Client#access_secret_version SecretManagerService.AccessSecretVersion}. - # @!attribute [rw] name - # @return [::String] - # The resource name of the - # {::Google::Cloud::SecretManager::V1beta2::SecretVersion SecretVersion} in the - # format `projects/*/secrets/*/versions/*` or - # `projects/*/locations/*/secrets/*/versions/*`. - # @!attribute [rw] payload - # @return [::Google::Cloud::SecretManager::V1beta2::SecretPayload] - # Secret payload - class AccessSecretVersionResponse - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Request message for - # {::Google::Cloud::SecretManager::V1beta2::SecretManagerService::Client#delete_secret SecretManagerService.DeleteSecret}. - # @!attribute [rw] name - # @return [::String] - # Required. The resource name of the - # {::Google::Cloud::SecretManager::V1beta2::Secret Secret} to delete in the format - # `projects/*/secrets/*`. - # @!attribute [rw] etag - # @return [::String] - # Optional. Etag of the {::Google::Cloud::SecretManager::V1beta2::Secret Secret}. - # The request succeeds if it matches the etag of the currently stored secret - # object. If the etag is omitted, the request succeeds. - class DeleteSecretRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Request message for - # {::Google::Cloud::SecretManager::V1beta2::SecretManagerService::Client#disable_secret_version SecretManagerService.DisableSecretVersion}. - # @!attribute [rw] name - # @return [::String] - # Required. The resource name of the - # {::Google::Cloud::SecretManager::V1beta2::SecretVersion SecretVersion} to - # disable in the format `projects/*/secrets/*/versions/*` or - # `projects/*/locations/*/secrets/*/versions/*`. - # @!attribute [rw] etag - # @return [::String] - # Optional. Etag of the - # {::Google::Cloud::SecretManager::V1beta2::SecretVersion SecretVersion}. The - # request succeeds if it matches the etag of the currently stored secret - # version object. If the etag is omitted, the request succeeds. - class DisableSecretVersionRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Request message for - # {::Google::Cloud::SecretManager::V1beta2::SecretManagerService::Client#enable_secret_version SecretManagerService.EnableSecretVersion}. - # @!attribute [rw] name - # @return [::String] - # Required. The resource name of the - # {::Google::Cloud::SecretManager::V1beta2::SecretVersion SecretVersion} to enable - # in the format `projects/*/secrets/*/versions/*` or - # `projects/*/locations/*/secrets/*/versions/*`. - # @!attribute [rw] etag - # @return [::String] - # Optional. Etag of the - # {::Google::Cloud::SecretManager::V1beta2::SecretVersion SecretVersion}. The - # request succeeds if it matches the etag of the currently stored secret - # version object. If the etag is omitted, the request succeeds. - class EnableSecretVersionRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Request message for - # {::Google::Cloud::SecretManager::V1beta2::SecretManagerService::Client#destroy_secret_version SecretManagerService.DestroySecretVersion}. - # @!attribute [rw] name - # @return [::String] - # Required. The resource name of the - # {::Google::Cloud::SecretManager::V1beta2::SecretVersion SecretVersion} to - # destroy in the format `projects/*/secrets/*/versions/*` or - # `projects/*/locations/*/secrets/*/versions/*`. - # @!attribute [rw] etag - # @return [::String] - # Optional. Etag of the - # {::Google::Cloud::SecretManager::V1beta2::SecretVersion SecretVersion}. The - # request succeeds if it matches the etag of the currently stored secret - # version object. If the etag is omitted, the request succeeds. - class DestroySecretVersionRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - end - end - end -end diff --git a/owl-bot-staging/google-cloud-secret_manager-v1beta2/proto_docs/google/iam/v1/iam_policy.rb b/owl-bot-staging/google-cloud-secret_manager-v1beta2/proto_docs/google/iam/v1/iam_policy.rb deleted file mode 100644 index 5445c77f8258..000000000000 --- a/owl-bot-staging/google-cloud-secret_manager-v1beta2/proto_docs/google/iam/v1/iam_policy.rb +++ /dev/null @@ -1,87 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - - -module Google - module Iam - module V1 - # Request message for `SetIamPolicy` method. - # @!attribute [rw] resource - # @return [::String] - # REQUIRED: The resource for which the policy is being specified. - # See the operation documentation for the appropriate value for this field. - # @!attribute [rw] policy - # @return [::Google::Iam::V1::Policy] - # REQUIRED: The complete policy to be applied to the `resource`. The size of - # the policy is limited to a few 10s of KB. An empty policy is a - # valid policy but certain Cloud Platform services (such as Projects) - # might reject them. - # @!attribute [rw] update_mask - # @return [::Google::Protobuf::FieldMask] - # OPTIONAL: A FieldMask specifying which fields of the policy to modify. Only - # the fields in the mask will be modified. If no mask is provided, the - # following default mask is used: - # - # `paths: "bindings, etag"` - class SetIamPolicyRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Request message for `GetIamPolicy` method. - # @!attribute [rw] resource - # @return [::String] - # REQUIRED: The resource for which the policy is being requested. - # See the operation documentation for the appropriate value for this field. - # @!attribute [rw] options - # @return [::Google::Iam::V1::GetPolicyOptions] - # OPTIONAL: A `GetPolicyOptions` object for specifying options to - # `GetIamPolicy`. - class GetIamPolicyRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Request message for `TestIamPermissions` method. - # @!attribute [rw] resource - # @return [::String] - # REQUIRED: The resource for which the policy detail is being requested. - # See the operation documentation for the appropriate value for this field. - # @!attribute [rw] permissions - # @return [::Array<::String>] - # The set of permissions to check for the `resource`. Permissions with - # wildcards (such as '*' or 'storage.*') are not allowed. For more - # information see - # [IAM Overview](https://cloud.google.com/iam/docs/overview#permissions). - class TestIamPermissionsRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Response message for `TestIamPermissions` method. - # @!attribute [rw] permissions - # @return [::Array<::String>] - # A subset of `TestPermissionsRequest.permissions` that the caller is - # allowed. - class TestIamPermissionsResponse - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - end - end -end diff --git a/owl-bot-staging/google-cloud-secret_manager-v1beta2/proto_docs/google/iam/v1/options.rb b/owl-bot-staging/google-cloud-secret_manager-v1beta2/proto_docs/google/iam/v1/options.rb deleted file mode 100644 index 60713d995b86..000000000000 --- a/owl-bot-staging/google-cloud-secret_manager-v1beta2/proto_docs/google/iam/v1/options.rb +++ /dev/null @@ -1,50 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - - -module Google - module Iam - module V1 - # Encapsulates settings provided to GetIamPolicy. - # @!attribute [rw] requested_policy_version - # @return [::Integer] - # Optional. The maximum policy version that will be used to format the - # policy. - # - # Valid values are 0, 1, and 3. Requests specifying an invalid value will be - # rejected. - # - # Requests for policies with any conditional role bindings must specify - # version 3. Policies with no conditional role bindings may specify any valid - # value or leave the field unset. - # - # The policy in the response might use the policy version that you specified, - # or it might use a lower policy version. For example, if you specify version - # 3, but the policy has no conditional role bindings, the response uses - # version 1. - # - # To learn which resources support conditions in their IAM policies, see the - # [IAM - # documentation](https://cloud.google.com/iam/help/conditions/resource-policies). - class GetPolicyOptions - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - end - end -end diff --git a/owl-bot-staging/google-cloud-secret_manager-v1beta2/proto_docs/google/iam/v1/policy.rb b/owl-bot-staging/google-cloud-secret_manager-v1beta2/proto_docs/google/iam/v1/policy.rb deleted file mode 100644 index 999575b797df..000000000000 --- a/owl-bot-staging/google-cloud-secret_manager-v1beta2/proto_docs/google/iam/v1/policy.rb +++ /dev/null @@ -1,426 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - - -module Google - module Iam - module V1 - # An Identity and Access Management (IAM) policy, which specifies access - # controls for Google Cloud resources. - # - # - # A `Policy` is a collection of `bindings`. A `binding` binds one or more - # `members`, or principals, to a single `role`. Principals can be user - # accounts, service accounts, Google groups, and domains (such as G Suite). A - # `role` is a named list of permissions; each `role` can be an IAM predefined - # role or a user-created custom role. - # - # For some types of Google Cloud resources, a `binding` can also specify a - # `condition`, which is a logical expression that allows access to a resource - # only if the expression evaluates to `true`. A condition can add constraints - # based on attributes of the request, the resource, or both. To learn which - # resources support conditions in their IAM policies, see the - # [IAM - # documentation](https://cloud.google.com/iam/help/conditions/resource-policies). - # - # **JSON example:** - # - # ``` - # { - # "bindings": [ - # { - # "role": "roles/resourcemanager.organizationAdmin", - # "members": [ - # "user:mike@example.com", - # "group:admins@example.com", - # "domain:google.com", - # "serviceAccount:my-project-id@appspot.gserviceaccount.com" - # ] - # }, - # { - # "role": "roles/resourcemanager.organizationViewer", - # "members": [ - # "user:eve@example.com" - # ], - # "condition": { - # "title": "expirable access", - # "description": "Does not grant access after Sep 2020", - # "expression": "request.time < - # timestamp('2020-10-01T00:00:00.000Z')", - # } - # } - # ], - # "etag": "BwWWja0YfJA=", - # "version": 3 - # } - # ``` - # - # **YAML example:** - # - # ``` - # bindings: - # - members: - # - user:mike@example.com - # - group:admins@example.com - # - domain:google.com - # - serviceAccount:my-project-id@appspot.gserviceaccount.com - # role: roles/resourcemanager.organizationAdmin - # - members: - # - user:eve@example.com - # role: roles/resourcemanager.organizationViewer - # condition: - # title: expirable access - # description: Does not grant access after Sep 2020 - # expression: request.time < timestamp('2020-10-01T00:00:00.000Z') - # etag: BwWWja0YfJA= - # version: 3 - # ``` - # - # For a description of IAM and its features, see the - # [IAM documentation](https://cloud.google.com/iam/docs/). - # @!attribute [rw] version - # @return [::Integer] - # Specifies the format of the policy. - # - # Valid values are `0`, `1`, and `3`. Requests that specify an invalid value - # are rejected. - # - # Any operation that affects conditional role bindings must specify version - # `3`. This requirement applies to the following operations: - # - # * Getting a policy that includes a conditional role binding - # * Adding a conditional role binding to a policy - # * Changing a conditional role binding in a policy - # * Removing any role binding, with or without a condition, from a policy - # that includes conditions - # - # **Important:** If you use IAM Conditions, you must include the `etag` field - # whenever you call `setIamPolicy`. If you omit this field, then IAM allows - # you to overwrite a version `3` policy with a version `1` policy, and all of - # the conditions in the version `3` policy are lost. - # - # If a policy does not include any conditions, operations on that policy may - # specify any valid version or leave the field unset. - # - # To learn which resources support conditions in their IAM policies, see the - # [IAM - # documentation](https://cloud.google.com/iam/help/conditions/resource-policies). - # @!attribute [rw] bindings - # @return [::Array<::Google::Iam::V1::Binding>] - # Associates a list of `members`, or principals, with a `role`. Optionally, - # may specify a `condition` that determines how and when the `bindings` are - # applied. Each of the `bindings` must contain at least one principal. - # - # The `bindings` in a `Policy` can refer to up to 1,500 principals; up to 250 - # of these principals can be Google groups. Each occurrence of a principal - # counts towards these limits. For example, if the `bindings` grant 50 - # different roles to `user:alice@example.com`, and not to any other - # principal, then you can add another 1,450 principals to the `bindings` in - # the `Policy`. - # @!attribute [rw] audit_configs - # @return [::Array<::Google::Iam::V1::AuditConfig>] - # Specifies cloud audit logging configuration for this policy. - # @!attribute [rw] etag - # @return [::String] - # `etag` is used for optimistic concurrency control as a way to help - # prevent simultaneous updates of a policy from overwriting each other. - # It is strongly suggested that systems make use of the `etag` in the - # read-modify-write cycle to perform policy updates in order to avoid race - # conditions: An `etag` is returned in the response to `getIamPolicy`, and - # systems are expected to put that etag in the request to `setIamPolicy` to - # ensure that their change will be applied to the same version of the policy. - # - # **Important:** If you use IAM Conditions, you must include the `etag` field - # whenever you call `setIamPolicy`. If you omit this field, then IAM allows - # you to overwrite a version `3` policy with a version `1` policy, and all of - # the conditions in the version `3` policy are lost. - class Policy - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Associates `members`, or principals, with a `role`. - # @!attribute [rw] role - # @return [::String] - # Role that is assigned to the list of `members`, or principals. - # For example, `roles/viewer`, `roles/editor`, or `roles/owner`. - # @!attribute [rw] members - # @return [::Array<::String>] - # Specifies the principals requesting access for a Google Cloud resource. - # `members` can have the following values: - # - # * `allUsers`: A special identifier that represents anyone who is - # on the internet; with or without a Google account. - # - # * `allAuthenticatedUsers`: A special identifier that represents anyone - # who is authenticated with a Google account or a service account. - # - # * `user:{emailid}`: An email address that represents a specific Google - # account. For example, `alice@example.com` . - # - # - # * `serviceAccount:{emailid}`: An email address that represents a service - # account. For example, `my-other-app@appspot.gserviceaccount.com`. - # - # * `group:{emailid}`: An email address that represents a Google group. - # For example, `admins@example.com`. - # - # * `deleted:user:{emailid}?uid={uniqueid}`: An email address (plus unique - # identifier) representing a user that has been recently deleted. For - # example, `alice@example.com?uid=123456789012345678901`. If the user is - # recovered, this value reverts to `user:{emailid}` and the recovered user - # retains the role in the binding. - # - # * `deleted:serviceAccount:{emailid}?uid={uniqueid}`: An email address (plus - # unique identifier) representing a service account that has been recently - # deleted. For example, - # `my-other-app@appspot.gserviceaccount.com?uid=123456789012345678901`. - # If the service account is undeleted, this value reverts to - # `serviceAccount:{emailid}` and the undeleted service account retains the - # role in the binding. - # - # * `deleted:group:{emailid}?uid={uniqueid}`: An email address (plus unique - # identifier) representing a Google group that has been recently - # deleted. For example, `admins@example.com?uid=123456789012345678901`. If - # the group is recovered, this value reverts to `group:{emailid}` and the - # recovered group retains the role in the binding. - # - # - # * `domain:{domain}`: The G Suite domain (primary) that represents all the - # users of that domain. For example, `google.com` or `example.com`. - # @!attribute [rw] condition - # @return [::Google::Type::Expr] - # The condition that is associated with this binding. - # - # If the condition evaluates to `true`, then this binding applies to the - # current request. - # - # If the condition evaluates to `false`, then this binding does not apply to - # the current request. However, a different role binding might grant the same - # role to one or more of the principals in this binding. - # - # To learn which resources support conditions in their IAM policies, see the - # [IAM - # documentation](https://cloud.google.com/iam/help/conditions/resource-policies). - class Binding - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Specifies the audit configuration for a service. - # The configuration determines which permission types are logged, and what - # identities, if any, are exempted from logging. - # An AuditConfig must have one or more AuditLogConfigs. - # - # If there are AuditConfigs for both `allServices` and a specific service, - # the union of the two AuditConfigs is used for that service: the log_types - # specified in each AuditConfig are enabled, and the exempted_members in each - # AuditLogConfig are exempted. - # - # Example Policy with multiple AuditConfigs: - # - # { - # "audit_configs": [ - # { - # "service": "allServices", - # "audit_log_configs": [ - # { - # "log_type": "DATA_READ", - # "exempted_members": [ - # "user:jose@example.com" - # ] - # }, - # { - # "log_type": "DATA_WRITE" - # }, - # { - # "log_type": "ADMIN_READ" - # } - # ] - # }, - # { - # "service": "sampleservice.googleapis.com", - # "audit_log_configs": [ - # { - # "log_type": "DATA_READ" - # }, - # { - # "log_type": "DATA_WRITE", - # "exempted_members": [ - # "user:aliya@example.com" - # ] - # } - # ] - # } - # ] - # } - # - # For sampleservice, this policy enables DATA_READ, DATA_WRITE and ADMIN_READ - # logging. It also exempts `jose@example.com` from DATA_READ logging, and - # `aliya@example.com` from DATA_WRITE logging. - # @!attribute [rw] service - # @return [::String] - # Specifies a service that will be enabled for audit logging. - # For example, `storage.googleapis.com`, `cloudsql.googleapis.com`. - # `allServices` is a special value that covers all services. - # @!attribute [rw] audit_log_configs - # @return [::Array<::Google::Iam::V1::AuditLogConfig>] - # The configuration for logging of each type of permission. - class AuditConfig - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Provides the configuration for logging a type of permissions. - # Example: - # - # { - # "audit_log_configs": [ - # { - # "log_type": "DATA_READ", - # "exempted_members": [ - # "user:jose@example.com" - # ] - # }, - # { - # "log_type": "DATA_WRITE" - # } - # ] - # } - # - # This enables 'DATA_READ' and 'DATA_WRITE' logging, while exempting - # jose@example.com from DATA_READ logging. - # @!attribute [rw] log_type - # @return [::Google::Iam::V1::AuditLogConfig::LogType] - # The log type that this config enables. - # @!attribute [rw] exempted_members - # @return [::Array<::String>] - # Specifies the identities that do not cause logging for this type of - # permission. - # Follows the same format of - # [Binding.members][google.iam.v1.Binding.members]. - class AuditLogConfig - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - - # The list of valid permission types for which logging can be configured. - # Admin writes are always logged, and are not configurable. - module LogType - # Default case. Should never be this. - LOG_TYPE_UNSPECIFIED = 0 - - # Admin reads. Example: CloudIAM getIamPolicy - ADMIN_READ = 1 - - # Data writes. Example: CloudSQL Users create - DATA_WRITE = 2 - - # Data reads. Example: CloudSQL Users list - DATA_READ = 3 - end - end - - # The difference delta between two policies. - # @!attribute [rw] binding_deltas - # @return [::Array<::Google::Iam::V1::BindingDelta>] - # The delta for Bindings between two policies. - # @!attribute [rw] audit_config_deltas - # @return [::Array<::Google::Iam::V1::AuditConfigDelta>] - # The delta for AuditConfigs between two policies. - class PolicyDelta - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # One delta entry for Binding. Each individual change (only one member in each - # entry) to a binding will be a separate entry. - # @!attribute [rw] action - # @return [::Google::Iam::V1::BindingDelta::Action] - # The action that was performed on a Binding. - # Required - # @!attribute [rw] role - # @return [::String] - # Role that is assigned to `members`. - # For example, `roles/viewer`, `roles/editor`, or `roles/owner`. - # Required - # @!attribute [rw] member - # @return [::String] - # A single identity requesting access for a Google Cloud resource. - # Follows the same format of Binding.members. - # Required - # @!attribute [rw] condition - # @return [::Google::Type::Expr] - # The condition that is associated with this binding. - class BindingDelta - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - - # The type of action performed on a Binding in a policy. - module Action - # Unspecified. - ACTION_UNSPECIFIED = 0 - - # Addition of a Binding. - ADD = 1 - - # Removal of a Binding. - REMOVE = 2 - end - end - - # One delta entry for AuditConfig. Each individual change (only one - # exempted_member in each entry) to a AuditConfig will be a separate entry. - # @!attribute [rw] action - # @return [::Google::Iam::V1::AuditConfigDelta::Action] - # The action that was performed on an audit configuration in a policy. - # Required - # @!attribute [rw] service - # @return [::String] - # Specifies a service that was configured for Cloud Audit Logging. - # For example, `storage.googleapis.com`, `cloudsql.googleapis.com`. - # `allServices` is a special value that covers all services. - # Required - # @!attribute [rw] exempted_member - # @return [::String] - # A single identity that is exempted from "data access" audit - # logging for the `service` specified above. - # Follows the same format of Binding.members. - # @!attribute [rw] log_type - # @return [::String] - # Specifies the log_type that was be enabled. ADMIN_ACTIVITY is always - # enabled, and cannot be configured. - # Required - class AuditConfigDelta - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - - # The type of action performed on an audit configuration in a policy. - module Action - # Unspecified. - ACTION_UNSPECIFIED = 0 - - # Addition of an audit configuration. - ADD = 1 - - # Removal of an audit configuration. - REMOVE = 2 - end - end - end - end -end diff --git a/owl-bot-staging/google-cloud-secret_manager-v1beta2/proto_docs/google/protobuf/any.rb b/owl-bot-staging/google-cloud-secret_manager-v1beta2/proto_docs/google/protobuf/any.rb deleted file mode 100644 index 58691995f02e..000000000000 --- a/owl-bot-staging/google-cloud-secret_manager-v1beta2/proto_docs/google/protobuf/any.rb +++ /dev/null @@ -1,145 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - - -module Google - module Protobuf - # `Any` contains an arbitrary serialized protocol buffer message along with a - # URL that describes the type of the serialized message. - # - # Protobuf library provides support to pack/unpack Any values in the form - # of utility functions or additional generated methods of the Any type. - # - # Example 1: Pack and unpack a message in C++. - # - # Foo foo = ...; - # Any any; - # any.PackFrom(foo); - # ... - # if (any.UnpackTo(&foo)) { - # ... - # } - # - # Example 2: Pack and unpack a message in Java. - # - # Foo foo = ...; - # Any any = Any.pack(foo); - # ... - # if (any.is(Foo.class)) { - # foo = any.unpack(Foo.class); - # } - # // or ... - # if (any.isSameTypeAs(Foo.getDefaultInstance())) { - # foo = any.unpack(Foo.getDefaultInstance()); - # } - # - # Example 3: Pack and unpack a message in Python. - # - # foo = Foo(...) - # any = Any() - # any.Pack(foo) - # ... - # if any.Is(Foo.DESCRIPTOR): - # any.Unpack(foo) - # ... - # - # Example 4: Pack and unpack a message in Go - # - # foo := &pb.Foo{...} - # any, err := anypb.New(foo) - # if err != nil { - # ... - # } - # ... - # foo := &pb.Foo{} - # if err := any.UnmarshalTo(foo); err != nil { - # ... - # } - # - # The pack methods provided by protobuf library will by default use - # 'type.googleapis.com/full.type.name' as the type URL and the unpack - # methods only use the fully qualified type name after the last '/' - # in the type URL, for example "foo.bar.com/x/y.z" will yield type - # name "y.z". - # - # JSON - # ==== - # The JSON representation of an `Any` value uses the regular - # representation of the deserialized, embedded message, with an - # additional field `@type` which contains the type URL. Example: - # - # package google.profile; - # message Person { - # string first_name = 1; - # string last_name = 2; - # } - # - # { - # "@type": "type.googleapis.com/google.profile.Person", - # "firstName": , - # "lastName": - # } - # - # If the embedded message type is well-known and has a custom JSON - # representation, that representation will be embedded adding a field - # `value` which holds the custom JSON in addition to the `@type` - # field. Example (for message [google.protobuf.Duration][]): - # - # { - # "@type": "type.googleapis.com/google.protobuf.Duration", - # "value": "1.212s" - # } - # @!attribute [rw] type_url - # @return [::String] - # A URL/resource name that uniquely identifies the type of the serialized - # protocol buffer message. This string must contain at least - # one "/" character. The last segment of the URL's path must represent - # the fully qualified name of the type (as in - # `path/google.protobuf.Duration`). The name should be in a canonical form - # (e.g., leading "." is not accepted). - # - # In practice, teams usually precompile into the binary all types that they - # expect it to use in the context of Any. However, for URLs which use the - # scheme `http`, `https`, or no scheme, one can optionally set up a type - # server that maps type URLs to message definitions as follows: - # - # * If no scheme is provided, `https` is assumed. - # * An HTTP GET on the URL must yield a [google.protobuf.Type][] - # value in binary format, or produce an error. - # * Applications are allowed to cache lookup results based on the - # URL, or have them precompiled into a binary to avoid any - # lookup. Therefore, binary compatibility needs to be preserved - # on changes to types. (Use versioned type names to manage - # breaking changes.) - # - # Note: this functionality is not currently available in the official - # protobuf release, and it is not used for type URLs beginning with - # type.googleapis.com. As of May 2023, there are no widely used type server - # implementations and no plans to implement one. - # - # Schemes other than `http`, `https` (or the empty scheme) might be - # used with implementation specific semantics. - # @!attribute [rw] value - # @return [::String] - # Must be a valid serialized protocol buffer of the above specified type. - class Any - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - end -end diff --git a/owl-bot-staging/google-cloud-secret_manager-v1beta2/proto_docs/google/protobuf/duration.rb b/owl-bot-staging/google-cloud-secret_manager-v1beta2/proto_docs/google/protobuf/duration.rb deleted file mode 100644 index ea59f1f91daf..000000000000 --- a/owl-bot-staging/google-cloud-secret_manager-v1beta2/proto_docs/google/protobuf/duration.rb +++ /dev/null @@ -1,98 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - - -module Google - module Protobuf - # A Duration represents a signed, fixed-length span of time represented - # as a count of seconds and fractions of seconds at nanosecond - # resolution. It is independent of any calendar and concepts like "day" - # or "month". It is related to Timestamp in that the difference between - # two Timestamp values is a Duration and it can be added or subtracted - # from a Timestamp. Range is approximately +-10,000 years. - # - # # Examples - # - # Example 1: Compute Duration from two Timestamps in pseudo code. - # - # Timestamp start = ...; - # Timestamp end = ...; - # Duration duration = ...; - # - # duration.seconds = end.seconds - start.seconds; - # duration.nanos = end.nanos - start.nanos; - # - # if (duration.seconds < 0 && duration.nanos > 0) { - # duration.seconds += 1; - # duration.nanos -= 1000000000; - # } else if (duration.seconds > 0 && duration.nanos < 0) { - # duration.seconds -= 1; - # duration.nanos += 1000000000; - # } - # - # Example 2: Compute Timestamp from Timestamp + Duration in pseudo code. - # - # Timestamp start = ...; - # Duration duration = ...; - # Timestamp end = ...; - # - # end.seconds = start.seconds + duration.seconds; - # end.nanos = start.nanos + duration.nanos; - # - # if (end.nanos < 0) { - # end.seconds -= 1; - # end.nanos += 1000000000; - # } else if (end.nanos >= 1000000000) { - # end.seconds += 1; - # end.nanos -= 1000000000; - # } - # - # Example 3: Compute Duration from datetime.timedelta in Python. - # - # td = datetime.timedelta(days=3, minutes=10) - # duration = Duration() - # duration.FromTimedelta(td) - # - # # JSON Mapping - # - # In JSON format, the Duration type is encoded as a string rather than an - # object, where the string ends in the suffix "s" (indicating seconds) and - # is preceded by the number of seconds, with nanoseconds expressed as - # fractional seconds. For example, 3 seconds with 0 nanoseconds should be - # encoded in JSON format as "3s", while 3 seconds and 1 nanosecond should - # be expressed in JSON format as "3.000000001s", and 3 seconds and 1 - # microsecond should be expressed in JSON format as "3.000001s". - # @!attribute [rw] seconds - # @return [::Integer] - # Signed seconds of the span of time. Must be from -315,576,000,000 - # to +315,576,000,000 inclusive. Note: these bounds are computed from: - # 60 sec/min * 60 min/hr * 24 hr/day * 365.25 days/year * 10000 years - # @!attribute [rw] nanos - # @return [::Integer] - # Signed fractions of a second at nanosecond resolution of the span - # of time. Durations less than one second are represented with a 0 - # `seconds` field and a positive or negative `nanos` field. For durations - # of one second or more, a non-zero value for the `nanos` field must be - # of the same sign as the `seconds` field. Must be from -999,999,999 - # to +999,999,999 inclusive. - class Duration - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - end -end diff --git a/owl-bot-staging/google-cloud-secret_manager-v1beta2/proto_docs/google/protobuf/empty.rb b/owl-bot-staging/google-cloud-secret_manager-v1beta2/proto_docs/google/protobuf/empty.rb deleted file mode 100644 index 83e4481834a6..000000000000 --- a/owl-bot-staging/google-cloud-secret_manager-v1beta2/proto_docs/google/protobuf/empty.rb +++ /dev/null @@ -1,34 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - - -module Google - module Protobuf - # A generic empty message that you can re-use to avoid defining duplicated - # empty messages in your APIs. A typical example is to use it as the request - # or the response type of an API method. For instance: - # - # service Foo { - # rpc Bar(google.protobuf.Empty) returns (google.protobuf.Empty); - # } - class Empty - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - end -end diff --git a/owl-bot-staging/google-cloud-secret_manager-v1beta2/proto_docs/google/protobuf/field_mask.rb b/owl-bot-staging/google-cloud-secret_manager-v1beta2/proto_docs/google/protobuf/field_mask.rb deleted file mode 100644 index 7f3ffc78601a..000000000000 --- a/owl-bot-staging/google-cloud-secret_manager-v1beta2/proto_docs/google/protobuf/field_mask.rb +++ /dev/null @@ -1,229 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - - -module Google - module Protobuf - # `FieldMask` represents a set of symbolic field paths, for example: - # - # paths: "f.a" - # paths: "f.b.d" - # - # Here `f` represents a field in some root message, `a` and `b` - # fields in the message found in `f`, and `d` a field found in the - # message in `f.b`. - # - # Field masks are used to specify a subset of fields that should be - # returned by a get operation or modified by an update operation. - # Field masks also have a custom JSON encoding (see below). - # - # # Field Masks in Projections - # - # When used in the context of a projection, a response message or - # sub-message is filtered by the API to only contain those fields as - # specified in the mask. For example, if the mask in the previous - # example is applied to a response message as follows: - # - # f { - # a : 22 - # b { - # d : 1 - # x : 2 - # } - # y : 13 - # } - # z: 8 - # - # The result will not contain specific values for fields x,y and z - # (their value will be set to the default, and omitted in proto text - # output): - # - # - # f { - # a : 22 - # b { - # d : 1 - # } - # } - # - # A repeated field is not allowed except at the last position of a - # paths string. - # - # If a FieldMask object is not present in a get operation, the - # operation applies to all fields (as if a FieldMask of all fields - # had been specified). - # - # Note that a field mask does not necessarily apply to the - # top-level response message. In case of a REST get operation, the - # field mask applies directly to the response, but in case of a REST - # list operation, the mask instead applies to each individual message - # in the returned resource list. In case of a REST custom method, - # other definitions may be used. Where the mask applies will be - # clearly documented together with its declaration in the API. In - # any case, the effect on the returned resource/resources is required - # behavior for APIs. - # - # # Field Masks in Update Operations - # - # A field mask in update operations specifies which fields of the - # targeted resource are going to be updated. The API is required - # to only change the values of the fields as specified in the mask - # and leave the others untouched. If a resource is passed in to - # describe the updated values, the API ignores the values of all - # fields not covered by the mask. - # - # If a repeated field is specified for an update operation, new values will - # be appended to the existing repeated field in the target resource. Note that - # a repeated field is only allowed in the last position of a `paths` string. - # - # If a sub-message is specified in the last position of the field mask for an - # update operation, then new value will be merged into the existing sub-message - # in the target resource. - # - # For example, given the target message: - # - # f { - # b { - # d: 1 - # x: 2 - # } - # c: [1] - # } - # - # And an update message: - # - # f { - # b { - # d: 10 - # } - # c: [2] - # } - # - # then if the field mask is: - # - # paths: ["f.b", "f.c"] - # - # then the result will be: - # - # f { - # b { - # d: 10 - # x: 2 - # } - # c: [1, 2] - # } - # - # An implementation may provide options to override this default behavior for - # repeated and message fields. - # - # In order to reset a field's value to the default, the field must - # be in the mask and set to the default value in the provided resource. - # Hence, in order to reset all fields of a resource, provide a default - # instance of the resource and set all fields in the mask, or do - # not provide a mask as described below. - # - # If a field mask is not present on update, the operation applies to - # all fields (as if a field mask of all fields has been specified). - # Note that in the presence of schema evolution, this may mean that - # fields the client does not know and has therefore not filled into - # the request will be reset to their default. If this is unwanted - # behavior, a specific service may require a client to always specify - # a field mask, producing an error if not. - # - # As with get operations, the location of the resource which - # describes the updated values in the request message depends on the - # operation kind. In any case, the effect of the field mask is - # required to be honored by the API. - # - # ## Considerations for HTTP REST - # - # The HTTP kind of an update operation which uses a field mask must - # be set to PATCH instead of PUT in order to satisfy HTTP semantics - # (PUT must only be used for full updates). - # - # # JSON Encoding of Field Masks - # - # In JSON, a field mask is encoded as a single string where paths are - # separated by a comma. Fields name in each path are converted - # to/from lower-camel naming conventions. - # - # As an example, consider the following message declarations: - # - # message Profile { - # User user = 1; - # Photo photo = 2; - # } - # message User { - # string display_name = 1; - # string address = 2; - # } - # - # In proto a field mask for `Profile` may look as such: - # - # mask { - # paths: "user.display_name" - # paths: "photo" - # } - # - # In JSON, the same mask is represented as below: - # - # { - # mask: "user.displayName,photo" - # } - # - # # Field Masks and Oneof Fields - # - # Field masks treat fields in oneofs just as regular fields. Consider the - # following message: - # - # message SampleMessage { - # oneof test_oneof { - # string name = 4; - # SubMessage sub_message = 9; - # } - # } - # - # The field mask can be: - # - # mask { - # paths: "name" - # } - # - # Or: - # - # mask { - # paths: "sub_message" - # } - # - # Note that oneof type names ("test_oneof" in this case) cannot be used in - # paths. - # - # ## Field Mask Verification - # - # The implementation of any API method which has a FieldMask type field in the - # request should verify the included field paths, and return an - # `INVALID_ARGUMENT` error if any path is unmappable. - # @!attribute [rw] paths - # @return [::Array<::String>] - # The set of field mask paths. - class FieldMask - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - end -end diff --git a/owl-bot-staging/google-cloud-secret_manager-v1beta2/proto_docs/google/protobuf/timestamp.rb b/owl-bot-staging/google-cloud-secret_manager-v1beta2/proto_docs/google/protobuf/timestamp.rb deleted file mode 100644 index 74352be9c58c..000000000000 --- a/owl-bot-staging/google-cloud-secret_manager-v1beta2/proto_docs/google/protobuf/timestamp.rb +++ /dev/null @@ -1,127 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - - -module Google - module Protobuf - # A Timestamp represents a point in time independent of any time zone or local - # calendar, encoded as a count of seconds and fractions of seconds at - # nanosecond resolution. The count is relative to an epoch at UTC midnight on - # January 1, 1970, in the proleptic Gregorian calendar which extends the - # Gregorian calendar backwards to year one. - # - # All minutes are 60 seconds long. Leap seconds are "smeared" so that no leap - # second table is needed for interpretation, using a [24-hour linear - # smear](https://developers.google.com/time/smear). - # - # The range is from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59.999999999Z. By - # restricting to that range, we ensure that we can convert to and from [RFC - # 3339](https://www.ietf.org/rfc/rfc3339.txt) date strings. - # - # # Examples - # - # Example 1: Compute Timestamp from POSIX `time()`. - # - # Timestamp timestamp; - # timestamp.set_seconds(time(NULL)); - # timestamp.set_nanos(0); - # - # Example 2: Compute Timestamp from POSIX `gettimeofday()`. - # - # struct timeval tv; - # gettimeofday(&tv, NULL); - # - # Timestamp timestamp; - # timestamp.set_seconds(tv.tv_sec); - # timestamp.set_nanos(tv.tv_usec * 1000); - # - # Example 3: Compute Timestamp from Win32 `GetSystemTimeAsFileTime()`. - # - # FILETIME ft; - # GetSystemTimeAsFileTime(&ft); - # UINT64 ticks = (((UINT64)ft.dwHighDateTime) << 32) | ft.dwLowDateTime; - # - # // A Windows tick is 100 nanoseconds. Windows epoch 1601-01-01T00:00:00Z - # // is 11644473600 seconds before Unix epoch 1970-01-01T00:00:00Z. - # Timestamp timestamp; - # timestamp.set_seconds((INT64) ((ticks / 10000000) - 11644473600LL)); - # timestamp.set_nanos((INT32) ((ticks % 10000000) * 100)); - # - # Example 4: Compute Timestamp from Java `System.currentTimeMillis()`. - # - # long millis = System.currentTimeMillis(); - # - # Timestamp timestamp = Timestamp.newBuilder().setSeconds(millis / 1000) - # .setNanos((int) ((millis % 1000) * 1000000)).build(); - # - # Example 5: Compute Timestamp from Java `Instant.now()`. - # - # Instant now = Instant.now(); - # - # Timestamp timestamp = - # Timestamp.newBuilder().setSeconds(now.getEpochSecond()) - # .setNanos(now.getNano()).build(); - # - # Example 6: Compute Timestamp from current time in Python. - # - # timestamp = Timestamp() - # timestamp.GetCurrentTime() - # - # # JSON Mapping - # - # In JSON format, the Timestamp type is encoded as a string in the - # [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format. That is, the - # format is "\\{year}-\\{month}-\\{day}T\\{hour}:\\{min}:\\{sec}[.\\{frac_sec}]Z" - # where \\{year} is always expressed using four digits while \\{month}, \\{day}, - # \\{hour}, \\{min}, and \\{sec} are zero-padded to two digits each. The fractional - # seconds, which can go up to 9 digits (i.e. up to 1 nanosecond resolution), - # are optional. The "Z" suffix indicates the timezone ("UTC"); the timezone - # is required. A proto3 JSON serializer should always use UTC (as indicated by - # "Z") when printing the Timestamp type and a proto3 JSON parser should be - # able to accept both UTC and other timezones (as indicated by an offset). - # - # For example, "2017-01-15T01:30:15.01Z" encodes 15.01 seconds past - # 01:30 UTC on January 15, 2017. - # - # In JavaScript, one can convert a Date object to this format using the - # standard - # [toISOString()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toISOString) - # method. In Python, a standard `datetime.datetime` object can be converted - # to this format using - # [`strftime`](https://docs.python.org/2/library/time.html#time.strftime) with - # the time format spec '%Y-%m-%dT%H:%M:%S.%fZ'. Likewise, in Java, one can use - # the Joda Time's [`ISODateTimeFormat.dateTime()`]( - # http://joda-time.sourceforge.net/apidocs/org/joda/time/format/ISODateTimeFormat.html#dateTime() - # ) to obtain a formatter capable of generating timestamps in this format. - # @!attribute [rw] seconds - # @return [::Integer] - # Represents seconds of UTC time since Unix epoch - # 1970-01-01T00:00:00Z. Must be from 0001-01-01T00:00:00Z to - # 9999-12-31T23:59:59Z inclusive. - # @!attribute [rw] nanos - # @return [::Integer] - # Non-negative fractions of a second at nanosecond resolution. Negative - # second values with fractions must still have non-negative nanos values - # that count forward in time. Must be from 0 to 999,999,999 - # inclusive. - class Timestamp - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - end -end diff --git a/owl-bot-staging/google-cloud-secret_manager-v1beta2/proto_docs/google/type/expr.rb b/owl-bot-staging/google-cloud-secret_manager-v1beta2/proto_docs/google/type/expr.rb deleted file mode 100644 index 53e7733b6592..000000000000 --- a/owl-bot-staging/google-cloud-secret_manager-v1beta2/proto_docs/google/type/expr.rb +++ /dev/null @@ -1,75 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - - -module Google - module Type - # Represents a textual expression in the Common Expression Language (CEL) - # syntax. CEL is a C-like expression language. The syntax and semantics of CEL - # are documented at https://github.com/google/cel-spec. - # - # Example (Comparison): - # - # title: "Summary size limit" - # description: "Determines if a summary is less than 100 chars" - # expression: "document.summary.size() < 100" - # - # Example (Equality): - # - # title: "Requestor is owner" - # description: "Determines if requestor is the document owner" - # expression: "document.owner == request.auth.claims.email" - # - # Example (Logic): - # - # title: "Public documents" - # description: "Determine whether the document should be publicly visible" - # expression: "document.type != 'private' && document.type != 'internal'" - # - # Example (Data Manipulation): - # - # title: "Notification string" - # description: "Create a notification string with a timestamp." - # expression: "'New message received at ' + string(document.create_time)" - # - # The exact variables and functions that may be referenced within an expression - # are determined by the service that evaluates it. See the service - # documentation for additional information. - # @!attribute [rw] expression - # @return [::String] - # Textual representation of an expression in Common Expression Language - # syntax. - # @!attribute [rw] title - # @return [::String] - # Optional. Title for the expression, i.e. a short string describing - # its purpose. This can be used e.g. in UIs which allow to enter the - # expression. - # @!attribute [rw] description - # @return [::String] - # Optional. Description of the expression. This is a longer text which - # describes the expression, e.g. when hovered over it in a UI. - # @!attribute [rw] location - # @return [::String] - # Optional. String indicating the location of the expression for error - # reporting, e.g. a file name and a position in the file. - class Expr - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - end -end diff --git a/owl-bot-staging/google-cloud-secret_manager-v1beta2/snippets/Gemfile b/owl-bot-staging/google-cloud-secret_manager-v1beta2/snippets/Gemfile deleted file mode 100644 index dbb02f1e7509..000000000000 --- a/owl-bot-staging/google-cloud-secret_manager-v1beta2/snippets/Gemfile +++ /dev/null @@ -1,32 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -source "https://rubygems.org" - -if ENV["GOOGLE_CLOUD_SAMPLES_TEST"] == "master" - gem "google-cloud-secret_manager-v1beta2", path: "../" -else - gem "google-cloud-secret_manager-v1beta2" -end - -group :test do - gem "google-style", "~> 1.26.1" - gem "minitest", "~> 5.16" - gem "minitest-focus", "~> 1.1" - gem "minitest-hooks", "~> 1.5" -end diff --git a/owl-bot-staging/google-cloud-secret_manager-v1beta2/snippets/secret_manager_service/access_secret_version.rb b/owl-bot-staging/google-cloud-secret_manager-v1beta2/snippets/secret_manager_service/access_secret_version.rb deleted file mode 100644 index d0d080ffd38d..000000000000 --- a/owl-bot-staging/google-cloud-secret_manager-v1beta2/snippets/secret_manager_service/access_secret_version.rb +++ /dev/null @@ -1,47 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -# [START secretmanager_v1beta2_generated_SecretManagerService_AccessSecretVersion_sync] -require "google/cloud/secret_manager/v1beta2" - -## -# Snippet for the access_secret_version call in the SecretManagerService service -# -# This snippet has been automatically generated and should be regarded as a code -# template only. It will require modifications to work: -# - It may require correct/in-range values for request initialization. -# - It may require specifying regional endpoints when creating the service -# client as shown in https://cloud.google.com/ruby/docs/reference. -# -# This is an auto-generated example demonstrating basic usage of -# Google::Cloud::SecretManager::V1beta2::SecretManagerService::Client#access_secret_version. -# -def access_secret_version - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::SecretManager::V1beta2::SecretManagerService::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::SecretManager::V1beta2::AccessSecretVersionRequest.new - - # Call the access_secret_version method. - result = client.access_secret_version request - - # The returned object is of type Google::Cloud::SecretManager::V1beta2::AccessSecretVersionResponse. - p result -end -# [END secretmanager_v1beta2_generated_SecretManagerService_AccessSecretVersion_sync] diff --git a/owl-bot-staging/google-cloud-secret_manager-v1beta2/snippets/secret_manager_service/add_secret_version.rb b/owl-bot-staging/google-cloud-secret_manager-v1beta2/snippets/secret_manager_service/add_secret_version.rb deleted file mode 100644 index e80ead1cc007..000000000000 --- a/owl-bot-staging/google-cloud-secret_manager-v1beta2/snippets/secret_manager_service/add_secret_version.rb +++ /dev/null @@ -1,47 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -# [START secretmanager_v1beta2_generated_SecretManagerService_AddSecretVersion_sync] -require "google/cloud/secret_manager/v1beta2" - -## -# Snippet for the add_secret_version call in the SecretManagerService service -# -# This snippet has been automatically generated and should be regarded as a code -# template only. It will require modifications to work: -# - It may require correct/in-range values for request initialization. -# - It may require specifying regional endpoints when creating the service -# client as shown in https://cloud.google.com/ruby/docs/reference. -# -# This is an auto-generated example demonstrating basic usage of -# Google::Cloud::SecretManager::V1beta2::SecretManagerService::Client#add_secret_version. -# -def add_secret_version - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::SecretManager::V1beta2::SecretManagerService::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::SecretManager::V1beta2::AddSecretVersionRequest.new - - # Call the add_secret_version method. - result = client.add_secret_version request - - # The returned object is of type Google::Cloud::SecretManager::V1beta2::SecretVersion. - p result -end -# [END secretmanager_v1beta2_generated_SecretManagerService_AddSecretVersion_sync] diff --git a/owl-bot-staging/google-cloud-secret_manager-v1beta2/snippets/secret_manager_service/create_secret.rb b/owl-bot-staging/google-cloud-secret_manager-v1beta2/snippets/secret_manager_service/create_secret.rb deleted file mode 100644 index e3bad58b58f1..000000000000 --- a/owl-bot-staging/google-cloud-secret_manager-v1beta2/snippets/secret_manager_service/create_secret.rb +++ /dev/null @@ -1,47 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -# [START secretmanager_v1beta2_generated_SecretManagerService_CreateSecret_sync] -require "google/cloud/secret_manager/v1beta2" - -## -# Snippet for the create_secret call in the SecretManagerService service -# -# This snippet has been automatically generated and should be regarded as a code -# template only. It will require modifications to work: -# - It may require correct/in-range values for request initialization. -# - It may require specifying regional endpoints when creating the service -# client as shown in https://cloud.google.com/ruby/docs/reference. -# -# This is an auto-generated example demonstrating basic usage of -# Google::Cloud::SecretManager::V1beta2::SecretManagerService::Client#create_secret. -# -def create_secret - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::SecretManager::V1beta2::SecretManagerService::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::SecretManager::V1beta2::CreateSecretRequest.new - - # Call the create_secret method. - result = client.create_secret request - - # The returned object is of type Google::Cloud::SecretManager::V1beta2::Secret. - p result -end -# [END secretmanager_v1beta2_generated_SecretManagerService_CreateSecret_sync] diff --git a/owl-bot-staging/google-cloud-secret_manager-v1beta2/snippets/secret_manager_service/delete_secret.rb b/owl-bot-staging/google-cloud-secret_manager-v1beta2/snippets/secret_manager_service/delete_secret.rb deleted file mode 100644 index 13e175a049e9..000000000000 --- a/owl-bot-staging/google-cloud-secret_manager-v1beta2/snippets/secret_manager_service/delete_secret.rb +++ /dev/null @@ -1,47 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -# [START secretmanager_v1beta2_generated_SecretManagerService_DeleteSecret_sync] -require "google/cloud/secret_manager/v1beta2" - -## -# Snippet for the delete_secret call in the SecretManagerService service -# -# This snippet has been automatically generated and should be regarded as a code -# template only. It will require modifications to work: -# - It may require correct/in-range values for request initialization. -# - It may require specifying regional endpoints when creating the service -# client as shown in https://cloud.google.com/ruby/docs/reference. -# -# This is an auto-generated example demonstrating basic usage of -# Google::Cloud::SecretManager::V1beta2::SecretManagerService::Client#delete_secret. -# -def delete_secret - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::SecretManager::V1beta2::SecretManagerService::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::SecretManager::V1beta2::DeleteSecretRequest.new - - # Call the delete_secret method. - result = client.delete_secret request - - # The returned object is of type Google::Protobuf::Empty. - p result -end -# [END secretmanager_v1beta2_generated_SecretManagerService_DeleteSecret_sync] diff --git a/owl-bot-staging/google-cloud-secret_manager-v1beta2/snippets/secret_manager_service/destroy_secret_version.rb b/owl-bot-staging/google-cloud-secret_manager-v1beta2/snippets/secret_manager_service/destroy_secret_version.rb deleted file mode 100644 index d806c328f332..000000000000 --- a/owl-bot-staging/google-cloud-secret_manager-v1beta2/snippets/secret_manager_service/destroy_secret_version.rb +++ /dev/null @@ -1,47 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -# [START secretmanager_v1beta2_generated_SecretManagerService_DestroySecretVersion_sync] -require "google/cloud/secret_manager/v1beta2" - -## -# Snippet for the destroy_secret_version call in the SecretManagerService service -# -# This snippet has been automatically generated and should be regarded as a code -# template only. It will require modifications to work: -# - It may require correct/in-range values for request initialization. -# - It may require specifying regional endpoints when creating the service -# client as shown in https://cloud.google.com/ruby/docs/reference. -# -# This is an auto-generated example demonstrating basic usage of -# Google::Cloud::SecretManager::V1beta2::SecretManagerService::Client#destroy_secret_version. -# -def destroy_secret_version - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::SecretManager::V1beta2::SecretManagerService::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::SecretManager::V1beta2::DestroySecretVersionRequest.new - - # Call the destroy_secret_version method. - result = client.destroy_secret_version request - - # The returned object is of type Google::Cloud::SecretManager::V1beta2::SecretVersion. - p result -end -# [END secretmanager_v1beta2_generated_SecretManagerService_DestroySecretVersion_sync] diff --git a/owl-bot-staging/google-cloud-secret_manager-v1beta2/snippets/secret_manager_service/disable_secret_version.rb b/owl-bot-staging/google-cloud-secret_manager-v1beta2/snippets/secret_manager_service/disable_secret_version.rb deleted file mode 100644 index b5c83f8366d2..000000000000 --- a/owl-bot-staging/google-cloud-secret_manager-v1beta2/snippets/secret_manager_service/disable_secret_version.rb +++ /dev/null @@ -1,47 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -# [START secretmanager_v1beta2_generated_SecretManagerService_DisableSecretVersion_sync] -require "google/cloud/secret_manager/v1beta2" - -## -# Snippet for the disable_secret_version call in the SecretManagerService service -# -# This snippet has been automatically generated and should be regarded as a code -# template only. It will require modifications to work: -# - It may require correct/in-range values for request initialization. -# - It may require specifying regional endpoints when creating the service -# client as shown in https://cloud.google.com/ruby/docs/reference. -# -# This is an auto-generated example demonstrating basic usage of -# Google::Cloud::SecretManager::V1beta2::SecretManagerService::Client#disable_secret_version. -# -def disable_secret_version - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::SecretManager::V1beta2::SecretManagerService::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::SecretManager::V1beta2::DisableSecretVersionRequest.new - - # Call the disable_secret_version method. - result = client.disable_secret_version request - - # The returned object is of type Google::Cloud::SecretManager::V1beta2::SecretVersion. - p result -end -# [END secretmanager_v1beta2_generated_SecretManagerService_DisableSecretVersion_sync] diff --git a/owl-bot-staging/google-cloud-secret_manager-v1beta2/snippets/secret_manager_service/enable_secret_version.rb b/owl-bot-staging/google-cloud-secret_manager-v1beta2/snippets/secret_manager_service/enable_secret_version.rb deleted file mode 100644 index 25e18d630f29..000000000000 --- a/owl-bot-staging/google-cloud-secret_manager-v1beta2/snippets/secret_manager_service/enable_secret_version.rb +++ /dev/null @@ -1,47 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -# [START secretmanager_v1beta2_generated_SecretManagerService_EnableSecretVersion_sync] -require "google/cloud/secret_manager/v1beta2" - -## -# Snippet for the enable_secret_version call in the SecretManagerService service -# -# This snippet has been automatically generated and should be regarded as a code -# template only. It will require modifications to work: -# - It may require correct/in-range values for request initialization. -# - It may require specifying regional endpoints when creating the service -# client as shown in https://cloud.google.com/ruby/docs/reference. -# -# This is an auto-generated example demonstrating basic usage of -# Google::Cloud::SecretManager::V1beta2::SecretManagerService::Client#enable_secret_version. -# -def enable_secret_version - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::SecretManager::V1beta2::SecretManagerService::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::SecretManager::V1beta2::EnableSecretVersionRequest.new - - # Call the enable_secret_version method. - result = client.enable_secret_version request - - # The returned object is of type Google::Cloud::SecretManager::V1beta2::SecretVersion. - p result -end -# [END secretmanager_v1beta2_generated_SecretManagerService_EnableSecretVersion_sync] diff --git a/owl-bot-staging/google-cloud-secret_manager-v1beta2/snippets/secret_manager_service/get_iam_policy.rb b/owl-bot-staging/google-cloud-secret_manager-v1beta2/snippets/secret_manager_service/get_iam_policy.rb deleted file mode 100644 index 27c9a36d2f37..000000000000 --- a/owl-bot-staging/google-cloud-secret_manager-v1beta2/snippets/secret_manager_service/get_iam_policy.rb +++ /dev/null @@ -1,47 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -# [START secretmanager_v1beta2_generated_SecretManagerService_GetIamPolicy_sync] -require "google/cloud/secret_manager/v1beta2" - -## -# Snippet for the get_iam_policy call in the SecretManagerService service -# -# This snippet has been automatically generated and should be regarded as a code -# template only. It will require modifications to work: -# - It may require correct/in-range values for request initialization. -# - It may require specifying regional endpoints when creating the service -# client as shown in https://cloud.google.com/ruby/docs/reference. -# -# This is an auto-generated example demonstrating basic usage of -# Google::Cloud::SecretManager::V1beta2::SecretManagerService::Client#get_iam_policy. -# -def get_iam_policy - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::SecretManager::V1beta2::SecretManagerService::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Iam::V1::GetIamPolicyRequest.new - - # Call the get_iam_policy method. - result = client.get_iam_policy request - - # The returned object is of type Google::Iam::V1::Policy. - p result -end -# [END secretmanager_v1beta2_generated_SecretManagerService_GetIamPolicy_sync] diff --git a/owl-bot-staging/google-cloud-secret_manager-v1beta2/snippets/secret_manager_service/get_secret.rb b/owl-bot-staging/google-cloud-secret_manager-v1beta2/snippets/secret_manager_service/get_secret.rb deleted file mode 100644 index 85d7b4256e33..000000000000 --- a/owl-bot-staging/google-cloud-secret_manager-v1beta2/snippets/secret_manager_service/get_secret.rb +++ /dev/null @@ -1,47 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -# [START secretmanager_v1beta2_generated_SecretManagerService_GetSecret_sync] -require "google/cloud/secret_manager/v1beta2" - -## -# Snippet for the get_secret call in the SecretManagerService service -# -# This snippet has been automatically generated and should be regarded as a code -# template only. It will require modifications to work: -# - It may require correct/in-range values for request initialization. -# - It may require specifying regional endpoints when creating the service -# client as shown in https://cloud.google.com/ruby/docs/reference. -# -# This is an auto-generated example demonstrating basic usage of -# Google::Cloud::SecretManager::V1beta2::SecretManagerService::Client#get_secret. -# -def get_secret - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::SecretManager::V1beta2::SecretManagerService::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::SecretManager::V1beta2::GetSecretRequest.new - - # Call the get_secret method. - result = client.get_secret request - - # The returned object is of type Google::Cloud::SecretManager::V1beta2::Secret. - p result -end -# [END secretmanager_v1beta2_generated_SecretManagerService_GetSecret_sync] diff --git a/owl-bot-staging/google-cloud-secret_manager-v1beta2/snippets/secret_manager_service/get_secret_version.rb b/owl-bot-staging/google-cloud-secret_manager-v1beta2/snippets/secret_manager_service/get_secret_version.rb deleted file mode 100644 index 20072c84fd22..000000000000 --- a/owl-bot-staging/google-cloud-secret_manager-v1beta2/snippets/secret_manager_service/get_secret_version.rb +++ /dev/null @@ -1,47 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -# [START secretmanager_v1beta2_generated_SecretManagerService_GetSecretVersion_sync] -require "google/cloud/secret_manager/v1beta2" - -## -# Snippet for the get_secret_version call in the SecretManagerService service -# -# This snippet has been automatically generated and should be regarded as a code -# template only. It will require modifications to work: -# - It may require correct/in-range values for request initialization. -# - It may require specifying regional endpoints when creating the service -# client as shown in https://cloud.google.com/ruby/docs/reference. -# -# This is an auto-generated example demonstrating basic usage of -# Google::Cloud::SecretManager::V1beta2::SecretManagerService::Client#get_secret_version. -# -def get_secret_version - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::SecretManager::V1beta2::SecretManagerService::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::SecretManager::V1beta2::GetSecretVersionRequest.new - - # Call the get_secret_version method. - result = client.get_secret_version request - - # The returned object is of type Google::Cloud::SecretManager::V1beta2::SecretVersion. - p result -end -# [END secretmanager_v1beta2_generated_SecretManagerService_GetSecretVersion_sync] diff --git a/owl-bot-staging/google-cloud-secret_manager-v1beta2/snippets/secret_manager_service/list_secret_versions.rb b/owl-bot-staging/google-cloud-secret_manager-v1beta2/snippets/secret_manager_service/list_secret_versions.rb deleted file mode 100644 index 7742f1a55a7d..000000000000 --- a/owl-bot-staging/google-cloud-secret_manager-v1beta2/snippets/secret_manager_service/list_secret_versions.rb +++ /dev/null @@ -1,51 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -# [START secretmanager_v1beta2_generated_SecretManagerService_ListSecretVersions_sync] -require "google/cloud/secret_manager/v1beta2" - -## -# Snippet for the list_secret_versions call in the SecretManagerService service -# -# This snippet has been automatically generated and should be regarded as a code -# template only. It will require modifications to work: -# - It may require correct/in-range values for request initialization. -# - It may require specifying regional endpoints when creating the service -# client as shown in https://cloud.google.com/ruby/docs/reference. -# -# This is an auto-generated example demonstrating basic usage of -# Google::Cloud::SecretManager::V1beta2::SecretManagerService::Client#list_secret_versions. -# -def list_secret_versions - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::SecretManager::V1beta2::SecretManagerService::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::SecretManager::V1beta2::ListSecretVersionsRequest.new - - # Call the list_secret_versions method. - result = client.list_secret_versions request - - # The returned object is of type Gapic::PagedEnumerable. You can iterate - # over elements, and API calls will be issued to fetch pages as needed. - result.each do |item| - # Each element is of type ::Google::Cloud::SecretManager::V1beta2::SecretVersion. - p item - end -end -# [END secretmanager_v1beta2_generated_SecretManagerService_ListSecretVersions_sync] diff --git a/owl-bot-staging/google-cloud-secret_manager-v1beta2/snippets/secret_manager_service/list_secrets.rb b/owl-bot-staging/google-cloud-secret_manager-v1beta2/snippets/secret_manager_service/list_secrets.rb deleted file mode 100644 index fd2e425d30c3..000000000000 --- a/owl-bot-staging/google-cloud-secret_manager-v1beta2/snippets/secret_manager_service/list_secrets.rb +++ /dev/null @@ -1,51 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -# [START secretmanager_v1beta2_generated_SecretManagerService_ListSecrets_sync] -require "google/cloud/secret_manager/v1beta2" - -## -# Snippet for the list_secrets call in the SecretManagerService service -# -# This snippet has been automatically generated and should be regarded as a code -# template only. It will require modifications to work: -# - It may require correct/in-range values for request initialization. -# - It may require specifying regional endpoints when creating the service -# client as shown in https://cloud.google.com/ruby/docs/reference. -# -# This is an auto-generated example demonstrating basic usage of -# Google::Cloud::SecretManager::V1beta2::SecretManagerService::Client#list_secrets. -# -def list_secrets - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::SecretManager::V1beta2::SecretManagerService::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::SecretManager::V1beta2::ListSecretsRequest.new - - # Call the list_secrets method. - result = client.list_secrets request - - # The returned object is of type Gapic::PagedEnumerable. You can iterate - # over elements, and API calls will be issued to fetch pages as needed. - result.each do |item| - # Each element is of type ::Google::Cloud::SecretManager::V1beta2::Secret. - p item - end -end -# [END secretmanager_v1beta2_generated_SecretManagerService_ListSecrets_sync] diff --git a/owl-bot-staging/google-cloud-secret_manager-v1beta2/snippets/secret_manager_service/set_iam_policy.rb b/owl-bot-staging/google-cloud-secret_manager-v1beta2/snippets/secret_manager_service/set_iam_policy.rb deleted file mode 100644 index 30030038e28f..000000000000 --- a/owl-bot-staging/google-cloud-secret_manager-v1beta2/snippets/secret_manager_service/set_iam_policy.rb +++ /dev/null @@ -1,47 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -# [START secretmanager_v1beta2_generated_SecretManagerService_SetIamPolicy_sync] -require "google/cloud/secret_manager/v1beta2" - -## -# Snippet for the set_iam_policy call in the SecretManagerService service -# -# This snippet has been automatically generated and should be regarded as a code -# template only. It will require modifications to work: -# - It may require correct/in-range values for request initialization. -# - It may require specifying regional endpoints when creating the service -# client as shown in https://cloud.google.com/ruby/docs/reference. -# -# This is an auto-generated example demonstrating basic usage of -# Google::Cloud::SecretManager::V1beta2::SecretManagerService::Client#set_iam_policy. -# -def set_iam_policy - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::SecretManager::V1beta2::SecretManagerService::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Iam::V1::SetIamPolicyRequest.new - - # Call the set_iam_policy method. - result = client.set_iam_policy request - - # The returned object is of type Google::Iam::V1::Policy. - p result -end -# [END secretmanager_v1beta2_generated_SecretManagerService_SetIamPolicy_sync] diff --git a/owl-bot-staging/google-cloud-secret_manager-v1beta2/snippets/secret_manager_service/test_iam_permissions.rb b/owl-bot-staging/google-cloud-secret_manager-v1beta2/snippets/secret_manager_service/test_iam_permissions.rb deleted file mode 100644 index 52ad7f6d8e08..000000000000 --- a/owl-bot-staging/google-cloud-secret_manager-v1beta2/snippets/secret_manager_service/test_iam_permissions.rb +++ /dev/null @@ -1,47 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -# [START secretmanager_v1beta2_generated_SecretManagerService_TestIamPermissions_sync] -require "google/cloud/secret_manager/v1beta2" - -## -# Snippet for the test_iam_permissions call in the SecretManagerService service -# -# This snippet has been automatically generated and should be regarded as a code -# template only. It will require modifications to work: -# - It may require correct/in-range values for request initialization. -# - It may require specifying regional endpoints when creating the service -# client as shown in https://cloud.google.com/ruby/docs/reference. -# -# This is an auto-generated example demonstrating basic usage of -# Google::Cloud::SecretManager::V1beta2::SecretManagerService::Client#test_iam_permissions. -# -def test_iam_permissions - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::SecretManager::V1beta2::SecretManagerService::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Iam::V1::TestIamPermissionsRequest.new - - # Call the test_iam_permissions method. - result = client.test_iam_permissions request - - # The returned object is of type Google::Iam::V1::TestIamPermissionsResponse. - p result -end -# [END secretmanager_v1beta2_generated_SecretManagerService_TestIamPermissions_sync] diff --git a/owl-bot-staging/google-cloud-secret_manager-v1beta2/snippets/secret_manager_service/update_secret.rb b/owl-bot-staging/google-cloud-secret_manager-v1beta2/snippets/secret_manager_service/update_secret.rb deleted file mode 100644 index 74eec379aa18..000000000000 --- a/owl-bot-staging/google-cloud-secret_manager-v1beta2/snippets/secret_manager_service/update_secret.rb +++ /dev/null @@ -1,47 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -# [START secretmanager_v1beta2_generated_SecretManagerService_UpdateSecret_sync] -require "google/cloud/secret_manager/v1beta2" - -## -# Snippet for the update_secret call in the SecretManagerService service -# -# This snippet has been automatically generated and should be regarded as a code -# template only. It will require modifications to work: -# - It may require correct/in-range values for request initialization. -# - It may require specifying regional endpoints when creating the service -# client as shown in https://cloud.google.com/ruby/docs/reference. -# -# This is an auto-generated example demonstrating basic usage of -# Google::Cloud::SecretManager::V1beta2::SecretManagerService::Client#update_secret. -# -def update_secret - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::SecretManager::V1beta2::SecretManagerService::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::SecretManager::V1beta2::UpdateSecretRequest.new - - # Call the update_secret method. - result = client.update_secret request - - # The returned object is of type Google::Cloud::SecretManager::V1beta2::Secret. - p result -end -# [END secretmanager_v1beta2_generated_SecretManagerService_UpdateSecret_sync] diff --git a/owl-bot-staging/google-cloud-secret_manager-v1beta2/snippets/snippet_metadata_google.cloud.secretmanager.v1beta2.json b/owl-bot-staging/google-cloud-secret_manager-v1beta2/snippets/snippet_metadata_google.cloud.secretmanager.v1beta2.json deleted file mode 100644 index 8628979bdc17..000000000000 --- a/owl-bot-staging/google-cloud-secret_manager-v1beta2/snippets/snippet_metadata_google.cloud.secretmanager.v1beta2.json +++ /dev/null @@ -1,615 +0,0 @@ -{ - "client_library": { - "name": "google-cloud-secret_manager-v1beta2", - "version": "", - "language": "RUBY", - "apis": [ - { - "id": "google.cloud.secretmanager.v1beta2", - "version": "v1beta2" - } - ] - }, - "snippets": [ - { - "region_tag": "secretmanager_v1beta2_generated_SecretManagerService_ListSecrets_sync", - "title": "Snippet for the list_secrets call in the SecretManagerService service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::SecretManager::V1beta2::SecretManagerService::Client#list_secrets.", - "file": "secret_manager_service/list_secrets.rb", - "language": "RUBY", - "client_method": { - "short_name": "list_secrets", - "full_name": "::Google::Cloud::SecretManager::V1beta2::SecretManagerService::Client#list_secrets", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::SecretManager::V1beta2::ListSecretsRequest", - "name": "request" - } - ], - "result_type": "::Google::Cloud::SecretManager::V1beta2::ListSecretsResponse", - "client": { - "short_name": "SecretManagerService::Client", - "full_name": "::Google::Cloud::SecretManager::V1beta2::SecretManagerService::Client" - }, - "method": { - "short_name": "ListSecrets", - "full_name": "google.cloud.secretmanager.v1beta2.SecretManagerService.ListSecrets", - "service": { - "short_name": "SecretManagerService", - "full_name": "google.cloud.secretmanager.v1beta2.SecretManagerService" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 50, - "type": "FULL" - } - ] - }, - { - "region_tag": "secretmanager_v1beta2_generated_SecretManagerService_CreateSecret_sync", - "title": "Snippet for the create_secret call in the SecretManagerService service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::SecretManager::V1beta2::SecretManagerService::Client#create_secret.", - "file": "secret_manager_service/create_secret.rb", - "language": "RUBY", - "client_method": { - "short_name": "create_secret", - "full_name": "::Google::Cloud::SecretManager::V1beta2::SecretManagerService::Client#create_secret", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::SecretManager::V1beta2::CreateSecretRequest", - "name": "request" - } - ], - "result_type": "::Google::Cloud::SecretManager::V1beta2::Secret", - "client": { - "short_name": "SecretManagerService::Client", - "full_name": "::Google::Cloud::SecretManager::V1beta2::SecretManagerService::Client" - }, - "method": { - "short_name": "CreateSecret", - "full_name": "google.cloud.secretmanager.v1beta2.SecretManagerService.CreateSecret", - "service": { - "short_name": "SecretManagerService", - "full_name": "google.cloud.secretmanager.v1beta2.SecretManagerService" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 46, - "type": "FULL" - } - ] - }, - { - "region_tag": "secretmanager_v1beta2_generated_SecretManagerService_AddSecretVersion_sync", - "title": "Snippet for the add_secret_version call in the SecretManagerService service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::SecretManager::V1beta2::SecretManagerService::Client#add_secret_version.", - "file": "secret_manager_service/add_secret_version.rb", - "language": "RUBY", - "client_method": { - "short_name": "add_secret_version", - "full_name": "::Google::Cloud::SecretManager::V1beta2::SecretManagerService::Client#add_secret_version", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::SecretManager::V1beta2::AddSecretVersionRequest", - "name": "request" - } - ], - "result_type": "::Google::Cloud::SecretManager::V1beta2::SecretVersion", - "client": { - "short_name": "SecretManagerService::Client", - "full_name": "::Google::Cloud::SecretManager::V1beta2::SecretManagerService::Client" - }, - "method": { - "short_name": "AddSecretVersion", - "full_name": "google.cloud.secretmanager.v1beta2.SecretManagerService.AddSecretVersion", - "service": { - "short_name": "SecretManagerService", - "full_name": "google.cloud.secretmanager.v1beta2.SecretManagerService" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 46, - "type": "FULL" - } - ] - }, - { - "region_tag": "secretmanager_v1beta2_generated_SecretManagerService_GetSecret_sync", - "title": "Snippet for the get_secret call in the SecretManagerService service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::SecretManager::V1beta2::SecretManagerService::Client#get_secret.", - "file": "secret_manager_service/get_secret.rb", - "language": "RUBY", - "client_method": { - "short_name": "get_secret", - "full_name": "::Google::Cloud::SecretManager::V1beta2::SecretManagerService::Client#get_secret", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::SecretManager::V1beta2::GetSecretRequest", - "name": "request" - } - ], - "result_type": "::Google::Cloud::SecretManager::V1beta2::Secret", - "client": { - "short_name": "SecretManagerService::Client", - "full_name": "::Google::Cloud::SecretManager::V1beta2::SecretManagerService::Client" - }, - "method": { - "short_name": "GetSecret", - "full_name": "google.cloud.secretmanager.v1beta2.SecretManagerService.GetSecret", - "service": { - "short_name": "SecretManagerService", - "full_name": "google.cloud.secretmanager.v1beta2.SecretManagerService" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 46, - "type": "FULL" - } - ] - }, - { - "region_tag": "secretmanager_v1beta2_generated_SecretManagerService_UpdateSecret_sync", - "title": "Snippet for the update_secret call in the SecretManagerService service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::SecretManager::V1beta2::SecretManagerService::Client#update_secret.", - "file": "secret_manager_service/update_secret.rb", - "language": "RUBY", - "client_method": { - "short_name": "update_secret", - "full_name": "::Google::Cloud::SecretManager::V1beta2::SecretManagerService::Client#update_secret", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::SecretManager::V1beta2::UpdateSecretRequest", - "name": "request" - } - ], - "result_type": "::Google::Cloud::SecretManager::V1beta2::Secret", - "client": { - "short_name": "SecretManagerService::Client", - "full_name": "::Google::Cloud::SecretManager::V1beta2::SecretManagerService::Client" - }, - "method": { - "short_name": "UpdateSecret", - "full_name": "google.cloud.secretmanager.v1beta2.SecretManagerService.UpdateSecret", - "service": { - "short_name": "SecretManagerService", - "full_name": "google.cloud.secretmanager.v1beta2.SecretManagerService" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 46, - "type": "FULL" - } - ] - }, - { - "region_tag": "secretmanager_v1beta2_generated_SecretManagerService_DeleteSecret_sync", - "title": "Snippet for the delete_secret call in the SecretManagerService service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::SecretManager::V1beta2::SecretManagerService::Client#delete_secret.", - "file": "secret_manager_service/delete_secret.rb", - "language": "RUBY", - "client_method": { - "short_name": "delete_secret", - "full_name": "::Google::Cloud::SecretManager::V1beta2::SecretManagerService::Client#delete_secret", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::SecretManager::V1beta2::DeleteSecretRequest", - "name": "request" - } - ], - "result_type": "::Google::Protobuf::Empty", - "client": { - "short_name": "SecretManagerService::Client", - "full_name": "::Google::Cloud::SecretManager::V1beta2::SecretManagerService::Client" - }, - "method": { - "short_name": "DeleteSecret", - "full_name": "google.cloud.secretmanager.v1beta2.SecretManagerService.DeleteSecret", - "service": { - "short_name": "SecretManagerService", - "full_name": "google.cloud.secretmanager.v1beta2.SecretManagerService" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 46, - "type": "FULL" - } - ] - }, - { - "region_tag": "secretmanager_v1beta2_generated_SecretManagerService_ListSecretVersions_sync", - "title": "Snippet for the list_secret_versions call in the SecretManagerService service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::SecretManager::V1beta2::SecretManagerService::Client#list_secret_versions.", - "file": "secret_manager_service/list_secret_versions.rb", - "language": "RUBY", - "client_method": { - "short_name": "list_secret_versions", - "full_name": "::Google::Cloud::SecretManager::V1beta2::SecretManagerService::Client#list_secret_versions", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::SecretManager::V1beta2::ListSecretVersionsRequest", - "name": "request" - } - ], - "result_type": "::Google::Cloud::SecretManager::V1beta2::ListSecretVersionsResponse", - "client": { - "short_name": "SecretManagerService::Client", - "full_name": "::Google::Cloud::SecretManager::V1beta2::SecretManagerService::Client" - }, - "method": { - "short_name": "ListSecretVersions", - "full_name": "google.cloud.secretmanager.v1beta2.SecretManagerService.ListSecretVersions", - "service": { - "short_name": "SecretManagerService", - "full_name": "google.cloud.secretmanager.v1beta2.SecretManagerService" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 50, - "type": "FULL" - } - ] - }, - { - "region_tag": "secretmanager_v1beta2_generated_SecretManagerService_GetSecretVersion_sync", - "title": "Snippet for the get_secret_version call in the SecretManagerService service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::SecretManager::V1beta2::SecretManagerService::Client#get_secret_version.", - "file": "secret_manager_service/get_secret_version.rb", - "language": "RUBY", - "client_method": { - "short_name": "get_secret_version", - "full_name": "::Google::Cloud::SecretManager::V1beta2::SecretManagerService::Client#get_secret_version", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::SecretManager::V1beta2::GetSecretVersionRequest", - "name": "request" - } - ], - "result_type": "::Google::Cloud::SecretManager::V1beta2::SecretVersion", - "client": { - "short_name": "SecretManagerService::Client", - "full_name": "::Google::Cloud::SecretManager::V1beta2::SecretManagerService::Client" - }, - "method": { - "short_name": "GetSecretVersion", - "full_name": "google.cloud.secretmanager.v1beta2.SecretManagerService.GetSecretVersion", - "service": { - "short_name": "SecretManagerService", - "full_name": "google.cloud.secretmanager.v1beta2.SecretManagerService" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 46, - "type": "FULL" - } - ] - }, - { - "region_tag": "secretmanager_v1beta2_generated_SecretManagerService_AccessSecretVersion_sync", - "title": "Snippet for the access_secret_version call in the SecretManagerService service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::SecretManager::V1beta2::SecretManagerService::Client#access_secret_version.", - "file": "secret_manager_service/access_secret_version.rb", - "language": "RUBY", - "client_method": { - "short_name": "access_secret_version", - "full_name": "::Google::Cloud::SecretManager::V1beta2::SecretManagerService::Client#access_secret_version", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::SecretManager::V1beta2::AccessSecretVersionRequest", - "name": "request" - } - ], - "result_type": "::Google::Cloud::SecretManager::V1beta2::AccessSecretVersionResponse", - "client": { - "short_name": "SecretManagerService::Client", - "full_name": "::Google::Cloud::SecretManager::V1beta2::SecretManagerService::Client" - }, - "method": { - "short_name": "AccessSecretVersion", - "full_name": "google.cloud.secretmanager.v1beta2.SecretManagerService.AccessSecretVersion", - "service": { - "short_name": "SecretManagerService", - "full_name": "google.cloud.secretmanager.v1beta2.SecretManagerService" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 46, - "type": "FULL" - } - ] - }, - { - "region_tag": "secretmanager_v1beta2_generated_SecretManagerService_DisableSecretVersion_sync", - "title": "Snippet for the disable_secret_version call in the SecretManagerService service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::SecretManager::V1beta2::SecretManagerService::Client#disable_secret_version.", - "file": "secret_manager_service/disable_secret_version.rb", - "language": "RUBY", - "client_method": { - "short_name": "disable_secret_version", - "full_name": "::Google::Cloud::SecretManager::V1beta2::SecretManagerService::Client#disable_secret_version", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::SecretManager::V1beta2::DisableSecretVersionRequest", - "name": "request" - } - ], - "result_type": "::Google::Cloud::SecretManager::V1beta2::SecretVersion", - "client": { - "short_name": "SecretManagerService::Client", - "full_name": "::Google::Cloud::SecretManager::V1beta2::SecretManagerService::Client" - }, - "method": { - "short_name": "DisableSecretVersion", - "full_name": "google.cloud.secretmanager.v1beta2.SecretManagerService.DisableSecretVersion", - "service": { - "short_name": "SecretManagerService", - "full_name": "google.cloud.secretmanager.v1beta2.SecretManagerService" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 46, - "type": "FULL" - } - ] - }, - { - "region_tag": "secretmanager_v1beta2_generated_SecretManagerService_EnableSecretVersion_sync", - "title": "Snippet for the enable_secret_version call in the SecretManagerService service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::SecretManager::V1beta2::SecretManagerService::Client#enable_secret_version.", - "file": "secret_manager_service/enable_secret_version.rb", - "language": "RUBY", - "client_method": { - "short_name": "enable_secret_version", - "full_name": "::Google::Cloud::SecretManager::V1beta2::SecretManagerService::Client#enable_secret_version", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::SecretManager::V1beta2::EnableSecretVersionRequest", - "name": "request" - } - ], - "result_type": "::Google::Cloud::SecretManager::V1beta2::SecretVersion", - "client": { - "short_name": "SecretManagerService::Client", - "full_name": "::Google::Cloud::SecretManager::V1beta2::SecretManagerService::Client" - }, - "method": { - "short_name": "EnableSecretVersion", - "full_name": "google.cloud.secretmanager.v1beta2.SecretManagerService.EnableSecretVersion", - "service": { - "short_name": "SecretManagerService", - "full_name": "google.cloud.secretmanager.v1beta2.SecretManagerService" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 46, - "type": "FULL" - } - ] - }, - { - "region_tag": "secretmanager_v1beta2_generated_SecretManagerService_DestroySecretVersion_sync", - "title": "Snippet for the destroy_secret_version call in the SecretManagerService service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::SecretManager::V1beta2::SecretManagerService::Client#destroy_secret_version.", - "file": "secret_manager_service/destroy_secret_version.rb", - "language": "RUBY", - "client_method": { - "short_name": "destroy_secret_version", - "full_name": "::Google::Cloud::SecretManager::V1beta2::SecretManagerService::Client#destroy_secret_version", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::SecretManager::V1beta2::DestroySecretVersionRequest", - "name": "request" - } - ], - "result_type": "::Google::Cloud::SecretManager::V1beta2::SecretVersion", - "client": { - "short_name": "SecretManagerService::Client", - "full_name": "::Google::Cloud::SecretManager::V1beta2::SecretManagerService::Client" - }, - "method": { - "short_name": "DestroySecretVersion", - "full_name": "google.cloud.secretmanager.v1beta2.SecretManagerService.DestroySecretVersion", - "service": { - "short_name": "SecretManagerService", - "full_name": "google.cloud.secretmanager.v1beta2.SecretManagerService" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 46, - "type": "FULL" - } - ] - }, - { - "region_tag": "secretmanager_v1beta2_generated_SecretManagerService_SetIamPolicy_sync", - "title": "Snippet for the set_iam_policy call in the SecretManagerService service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::SecretManager::V1beta2::SecretManagerService::Client#set_iam_policy.", - "file": "secret_manager_service/set_iam_policy.rb", - "language": "RUBY", - "client_method": { - "short_name": "set_iam_policy", - "full_name": "::Google::Cloud::SecretManager::V1beta2::SecretManagerService::Client#set_iam_policy", - "async": false, - "parameters": [ - { - "type": "::Google::Iam::V1::SetIamPolicyRequest", - "name": "request" - } - ], - "result_type": "::Google::Iam::V1::Policy", - "client": { - "short_name": "SecretManagerService::Client", - "full_name": "::Google::Cloud::SecretManager::V1beta2::SecretManagerService::Client" - }, - "method": { - "short_name": "SetIamPolicy", - "full_name": "google.cloud.secretmanager.v1beta2.SecretManagerService.SetIamPolicy", - "service": { - "short_name": "SecretManagerService", - "full_name": "google.cloud.secretmanager.v1beta2.SecretManagerService" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 46, - "type": "FULL" - } - ] - }, - { - "region_tag": "secretmanager_v1beta2_generated_SecretManagerService_GetIamPolicy_sync", - "title": "Snippet for the get_iam_policy call in the SecretManagerService service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::SecretManager::V1beta2::SecretManagerService::Client#get_iam_policy.", - "file": "secret_manager_service/get_iam_policy.rb", - "language": "RUBY", - "client_method": { - "short_name": "get_iam_policy", - "full_name": "::Google::Cloud::SecretManager::V1beta2::SecretManagerService::Client#get_iam_policy", - "async": false, - "parameters": [ - { - "type": "::Google::Iam::V1::GetIamPolicyRequest", - "name": "request" - } - ], - "result_type": "::Google::Iam::V1::Policy", - "client": { - "short_name": "SecretManagerService::Client", - "full_name": "::Google::Cloud::SecretManager::V1beta2::SecretManagerService::Client" - }, - "method": { - "short_name": "GetIamPolicy", - "full_name": "google.cloud.secretmanager.v1beta2.SecretManagerService.GetIamPolicy", - "service": { - "short_name": "SecretManagerService", - "full_name": "google.cloud.secretmanager.v1beta2.SecretManagerService" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 46, - "type": "FULL" - } - ] - }, - { - "region_tag": "secretmanager_v1beta2_generated_SecretManagerService_TestIamPermissions_sync", - "title": "Snippet for the test_iam_permissions call in the SecretManagerService service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::SecretManager::V1beta2::SecretManagerService::Client#test_iam_permissions.", - "file": "secret_manager_service/test_iam_permissions.rb", - "language": "RUBY", - "client_method": { - "short_name": "test_iam_permissions", - "full_name": "::Google::Cloud::SecretManager::V1beta2::SecretManagerService::Client#test_iam_permissions", - "async": false, - "parameters": [ - { - "type": "::Google::Iam::V1::TestIamPermissionsRequest", - "name": "request" - } - ], - "result_type": "::Google::Iam::V1::TestIamPermissionsResponse", - "client": { - "short_name": "SecretManagerService::Client", - "full_name": "::Google::Cloud::SecretManager::V1beta2::SecretManagerService::Client" - }, - "method": { - "short_name": "TestIamPermissions", - "full_name": "google.cloud.secretmanager.v1beta2.SecretManagerService.TestIamPermissions", - "service": { - "short_name": "SecretManagerService", - "full_name": "google.cloud.secretmanager.v1beta2.SecretManagerService" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 46, - "type": "FULL" - } - ] - } - ] -} \ No newline at end of file diff --git a/owl-bot-staging/google-cloud-secret_manager-v1beta2/test/google/cloud/secret_manager/v1beta2/secret_manager_service_paths_test.rb b/owl-bot-staging/google-cloud-secret_manager-v1beta2/test/google/cloud/secret_manager/v1beta2/secret_manager_service_paths_test.rb deleted file mode 100644 index f28501a34bc5..000000000000 --- a/owl-bot-staging/google-cloud-secret_manager-v1beta2/test/google/cloud/secret_manager/v1beta2/secret_manager_service_paths_test.rb +++ /dev/null @@ -1,109 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -require "helper" - -require "gapic/grpc/service_stub" - -require "google/cloud/secret_manager/v1beta2/secret_manager_service" - -class ::Google::Cloud::SecretManager::V1beta2::SecretManagerService::ClientPathsTest < Minitest::Test - class DummyStub - def endpoint - "endpoint.example.com" - end - - def universe_domain - "example.com" - end - - def stub_logger - nil - end - - def logger - nil - end - end - - def test_location_path - grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - ::Gapic::ServiceStub.stub :new, DummyStub.new do - client = ::Google::Cloud::SecretManager::V1beta2::SecretManagerService::Client.new do |config| - config.credentials = grpc_channel - end - - path = client.location_path project: "value0", location: "value1" - assert_equal "projects/value0/locations/value1", path - end - end - - def test_project_path - grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - ::Gapic::ServiceStub.stub :new, DummyStub.new do - client = ::Google::Cloud::SecretManager::V1beta2::SecretManagerService::Client.new do |config| - config.credentials = grpc_channel - end - - path = client.project_path project: "value0" - assert_equal "projects/value0", path - end - end - - def test_secret_path - grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - ::Gapic::ServiceStub.stub :new, DummyStub.new do - client = ::Google::Cloud::SecretManager::V1beta2::SecretManagerService::Client.new do |config| - config.credentials = grpc_channel - end - - path = client.secret_path project: "value0", secret: "value1" - assert_equal "projects/value0/secrets/value1", path - - path = client.secret_path project: "value0", location: "value1", secret: "value2" - assert_equal "projects/value0/locations/value1/secrets/value2", path - end - end - - def test_secret_version_path - grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - ::Gapic::ServiceStub.stub :new, DummyStub.new do - client = ::Google::Cloud::SecretManager::V1beta2::SecretManagerService::Client.new do |config| - config.credentials = grpc_channel - end - - path = client.secret_version_path project: "value0", secret: "value1", secret_version: "value2" - assert_equal "projects/value0/secrets/value1/versions/value2", path - - path = client.secret_version_path project: "value0", location: "value1", secret: "value2", secret_version: "value3" - assert_equal "projects/value0/locations/value1/secrets/value2/versions/value3", path - end - end - - def test_topic_path - grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - ::Gapic::ServiceStub.stub :new, DummyStub.new do - client = ::Google::Cloud::SecretManager::V1beta2::SecretManagerService::Client.new do |config| - config.credentials = grpc_channel - end - - path = client.topic_path project: "value0", topic: "value1" - assert_equal "projects/value0/topics/value1", path - end - end -end diff --git a/owl-bot-staging/google-cloud-secret_manager-v1beta2/test/google/cloud/secret_manager/v1beta2/secret_manager_service_rest_test.rb b/owl-bot-staging/google-cloud-secret_manager-v1beta2/test/google/cloud/secret_manager/v1beta2/secret_manager_service_rest_test.rb deleted file mode 100644 index 610fe8a951da..000000000000 --- a/owl-bot-staging/google-cloud-secret_manager-v1beta2/test/google/cloud/secret_manager/v1beta2/secret_manager_service_rest_test.rb +++ /dev/null @@ -1,927 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -require "helper" -require "gapic/rest" -require "google/cloud/secretmanager/v1beta2/service_pb" -require "google/cloud/secret_manager/v1beta2/secret_manager_service/rest" - - -class ::Google::Cloud::SecretManager::V1beta2::SecretManagerService::Rest::ClientTest < Minitest::Test - class ClientStub - attr_accessor :call_count, :requests - - def initialize response, &block - @response = response - @block = block - @call_count = 0 - @requests = [] - end - - def make_get_request uri:, params: {}, options: {}, method_name: nil - make_http_request :get, uri: uri, body: nil, params: params, options: options, method_name: method_name - end - - def make_delete_request uri:, params: {}, options: {}, method_name: nil - make_http_request :delete, uri: uri, body: nil, params: params, options: options, method_name: method_name - end - - def make_post_request uri:, body: nil, params: {}, options: {}, method_name: nil - make_http_request :post, uri: uri, body: body, params: params, options: options, method_name: method_name - end - - def make_patch_request uri:, body:, params: {}, options: {}, method_name: nil - make_http_request :patch, uri: uri, body: body, params: params, options: options, method_name: method_name - end - - def make_put_request uri:, body:, params: {}, options: {}, method_name: nil - make_http_request :put, uri: uri, body: body, params: params, options: options, method_name: method_name - end - - def make_http_request *args, **kwargs - @call_count += 1 - - @requests << @block&.call(*args, **kwargs) - - @response - end - - def endpoint - "endpoint.example.com" - end - - def universe_domain - "example.com" - end - - def stub_logger - nil - end - - def logger - nil - end - end - - def test_list_secrets - # Create test objects. - client_result = ::Google::Cloud::SecretManager::V1beta2::ListSecretsResponse.new - http_response = OpenStruct.new body: client_result.to_json - - call_options = {} - - # Create request parameters for a unary method. - parent = "hello world" - page_size = 42 - page_token = "hello world" - filter = "hello world" - - list_secrets_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| - assert options.metadata.key? :"x-goog-api-client" - assert options.metadata[:"x-goog-api-client"].include? "rest" - refute options.metadata[:"x-goog-api-client"].include? "grpc" - end - - ::Google::Cloud::SecretManager::V1beta2::SecretManagerService::Rest::ServiceStub.stub :transcode_list_secrets_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, list_secrets_client_stub do - # Create client - client = ::Google::Cloud::SecretManager::V1beta2::SecretManagerService::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - client.list_secrets({ parent: parent, page_size: page_size, page_token: page_token, filter: filter }) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use named arguments - client.list_secrets parent: parent, page_size: page_size, page_token: page_token, filter: filter do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object - client.list_secrets ::Google::Cloud::SecretManager::V1beta2::ListSecretsRequest.new(parent: parent, page_size: page_size, page_token: page_token, filter: filter) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use hash object with options - client.list_secrets({ parent: parent, page_size: page_size, page_token: page_token, filter: filter }, call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object with options - client.list_secrets(::Google::Cloud::SecretManager::V1beta2::ListSecretsRequest.new(parent: parent, page_size: page_size, page_token: page_token, filter: filter), call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Verify method calls - assert_equal 5, list_secrets_client_stub.call_count - end - end - end - - def test_create_secret - # Create test objects. - client_result = ::Google::Cloud::SecretManager::V1beta2::Secret.new - http_response = OpenStruct.new body: client_result.to_json - - call_options = {} - - # Create request parameters for a unary method. - parent = "hello world" - secret_id = "hello world" - secret = {} - - create_secret_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| - assert options.metadata.key? :"x-goog-api-client" - assert options.metadata[:"x-goog-api-client"].include? "rest" - refute options.metadata[:"x-goog-api-client"].include? "grpc" - end - - ::Google::Cloud::SecretManager::V1beta2::SecretManagerService::Rest::ServiceStub.stub :transcode_create_secret_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, create_secret_client_stub do - # Create client - client = ::Google::Cloud::SecretManager::V1beta2::SecretManagerService::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - client.create_secret({ parent: parent, secret_id: secret_id, secret: secret }) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use named arguments - client.create_secret parent: parent, secret_id: secret_id, secret: secret do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object - client.create_secret ::Google::Cloud::SecretManager::V1beta2::CreateSecretRequest.new(parent: parent, secret_id: secret_id, secret: secret) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use hash object with options - client.create_secret({ parent: parent, secret_id: secret_id, secret: secret }, call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object with options - client.create_secret(::Google::Cloud::SecretManager::V1beta2::CreateSecretRequest.new(parent: parent, secret_id: secret_id, secret: secret), call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Verify method calls - assert_equal 5, create_secret_client_stub.call_count - end - end - end - - def test_add_secret_version - # Create test objects. - client_result = ::Google::Cloud::SecretManager::V1beta2::SecretVersion.new - http_response = OpenStruct.new body: client_result.to_json - - call_options = {} - - # Create request parameters for a unary method. - parent = "hello world" - payload = {} - - add_secret_version_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| - assert options.metadata.key? :"x-goog-api-client" - assert options.metadata[:"x-goog-api-client"].include? "rest" - refute options.metadata[:"x-goog-api-client"].include? "grpc" - end - - ::Google::Cloud::SecretManager::V1beta2::SecretManagerService::Rest::ServiceStub.stub :transcode_add_secret_version_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, add_secret_version_client_stub do - # Create client - client = ::Google::Cloud::SecretManager::V1beta2::SecretManagerService::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - client.add_secret_version({ parent: parent, payload: payload }) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use named arguments - client.add_secret_version parent: parent, payload: payload do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object - client.add_secret_version ::Google::Cloud::SecretManager::V1beta2::AddSecretVersionRequest.new(parent: parent, payload: payload) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use hash object with options - client.add_secret_version({ parent: parent, payload: payload }, call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object with options - client.add_secret_version(::Google::Cloud::SecretManager::V1beta2::AddSecretVersionRequest.new(parent: parent, payload: payload), call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Verify method calls - assert_equal 5, add_secret_version_client_stub.call_count - end - end - end - - def test_get_secret - # Create test objects. - client_result = ::Google::Cloud::SecretManager::V1beta2::Secret.new - http_response = OpenStruct.new body: client_result.to_json - - call_options = {} - - # Create request parameters for a unary method. - name = "hello world" - - get_secret_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| - assert options.metadata.key? :"x-goog-api-client" - assert options.metadata[:"x-goog-api-client"].include? "rest" - refute options.metadata[:"x-goog-api-client"].include? "grpc" - end - - ::Google::Cloud::SecretManager::V1beta2::SecretManagerService::Rest::ServiceStub.stub :transcode_get_secret_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, get_secret_client_stub do - # Create client - client = ::Google::Cloud::SecretManager::V1beta2::SecretManagerService::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - client.get_secret({ name: name }) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use named arguments - client.get_secret name: name do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object - client.get_secret ::Google::Cloud::SecretManager::V1beta2::GetSecretRequest.new(name: name) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use hash object with options - client.get_secret({ name: name }, call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object with options - client.get_secret(::Google::Cloud::SecretManager::V1beta2::GetSecretRequest.new(name: name), call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Verify method calls - assert_equal 5, get_secret_client_stub.call_count - end - end - end - - def test_update_secret - # Create test objects. - client_result = ::Google::Cloud::SecretManager::V1beta2::Secret.new - http_response = OpenStruct.new body: client_result.to_json - - call_options = {} - - # Create request parameters for a unary method. - secret = {} - update_mask = {} - - update_secret_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| - assert options.metadata.key? :"x-goog-api-client" - assert options.metadata[:"x-goog-api-client"].include? "rest" - refute options.metadata[:"x-goog-api-client"].include? "grpc" - end - - ::Google::Cloud::SecretManager::V1beta2::SecretManagerService::Rest::ServiceStub.stub :transcode_update_secret_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, update_secret_client_stub do - # Create client - client = ::Google::Cloud::SecretManager::V1beta2::SecretManagerService::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - client.update_secret({ secret: secret, update_mask: update_mask }) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use named arguments - client.update_secret secret: secret, update_mask: update_mask do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object - client.update_secret ::Google::Cloud::SecretManager::V1beta2::UpdateSecretRequest.new(secret: secret, update_mask: update_mask) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use hash object with options - client.update_secret({ secret: secret, update_mask: update_mask }, call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object with options - client.update_secret(::Google::Cloud::SecretManager::V1beta2::UpdateSecretRequest.new(secret: secret, update_mask: update_mask), call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Verify method calls - assert_equal 5, update_secret_client_stub.call_count - end - end - end - - def test_delete_secret - # Create test objects. - client_result = ::Google::Protobuf::Empty.new - http_response = OpenStruct.new body: client_result.to_json - - call_options = {} - - # Create request parameters for a unary method. - name = "hello world" - etag = "hello world" - - delete_secret_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| - assert options.metadata.key? :"x-goog-api-client" - assert options.metadata[:"x-goog-api-client"].include? "rest" - refute options.metadata[:"x-goog-api-client"].include? "grpc" - end - - ::Google::Cloud::SecretManager::V1beta2::SecretManagerService::Rest::ServiceStub.stub :transcode_delete_secret_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, delete_secret_client_stub do - # Create client - client = ::Google::Cloud::SecretManager::V1beta2::SecretManagerService::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - client.delete_secret({ name: name, etag: etag }) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use named arguments - client.delete_secret name: name, etag: etag do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object - client.delete_secret ::Google::Cloud::SecretManager::V1beta2::DeleteSecretRequest.new(name: name, etag: etag) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use hash object with options - client.delete_secret({ name: name, etag: etag }, call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object with options - client.delete_secret(::Google::Cloud::SecretManager::V1beta2::DeleteSecretRequest.new(name: name, etag: etag), call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Verify method calls - assert_equal 5, delete_secret_client_stub.call_count - end - end - end - - def test_list_secret_versions - # Create test objects. - client_result = ::Google::Cloud::SecretManager::V1beta2::ListSecretVersionsResponse.new - http_response = OpenStruct.new body: client_result.to_json - - call_options = {} - - # Create request parameters for a unary method. - parent = "hello world" - page_size = 42 - page_token = "hello world" - filter = "hello world" - - list_secret_versions_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| - assert options.metadata.key? :"x-goog-api-client" - assert options.metadata[:"x-goog-api-client"].include? "rest" - refute options.metadata[:"x-goog-api-client"].include? "grpc" - end - - ::Google::Cloud::SecretManager::V1beta2::SecretManagerService::Rest::ServiceStub.stub :transcode_list_secret_versions_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, list_secret_versions_client_stub do - # Create client - client = ::Google::Cloud::SecretManager::V1beta2::SecretManagerService::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - client.list_secret_versions({ parent: parent, page_size: page_size, page_token: page_token, filter: filter }) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use named arguments - client.list_secret_versions parent: parent, page_size: page_size, page_token: page_token, filter: filter do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object - client.list_secret_versions ::Google::Cloud::SecretManager::V1beta2::ListSecretVersionsRequest.new(parent: parent, page_size: page_size, page_token: page_token, filter: filter) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use hash object with options - client.list_secret_versions({ parent: parent, page_size: page_size, page_token: page_token, filter: filter }, call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object with options - client.list_secret_versions(::Google::Cloud::SecretManager::V1beta2::ListSecretVersionsRequest.new(parent: parent, page_size: page_size, page_token: page_token, filter: filter), call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Verify method calls - assert_equal 5, list_secret_versions_client_stub.call_count - end - end - end - - def test_get_secret_version - # Create test objects. - client_result = ::Google::Cloud::SecretManager::V1beta2::SecretVersion.new - http_response = OpenStruct.new body: client_result.to_json - - call_options = {} - - # Create request parameters for a unary method. - name = "hello world" - - get_secret_version_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| - assert options.metadata.key? :"x-goog-api-client" - assert options.metadata[:"x-goog-api-client"].include? "rest" - refute options.metadata[:"x-goog-api-client"].include? "grpc" - end - - ::Google::Cloud::SecretManager::V1beta2::SecretManagerService::Rest::ServiceStub.stub :transcode_get_secret_version_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, get_secret_version_client_stub do - # Create client - client = ::Google::Cloud::SecretManager::V1beta2::SecretManagerService::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - client.get_secret_version({ name: name }) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use named arguments - client.get_secret_version name: name do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object - client.get_secret_version ::Google::Cloud::SecretManager::V1beta2::GetSecretVersionRequest.new(name: name) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use hash object with options - client.get_secret_version({ name: name }, call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object with options - client.get_secret_version(::Google::Cloud::SecretManager::V1beta2::GetSecretVersionRequest.new(name: name), call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Verify method calls - assert_equal 5, get_secret_version_client_stub.call_count - end - end - end - - def test_access_secret_version - # Create test objects. - client_result = ::Google::Cloud::SecretManager::V1beta2::AccessSecretVersionResponse.new - http_response = OpenStruct.new body: client_result.to_json - - call_options = {} - - # Create request parameters for a unary method. - name = "hello world" - - access_secret_version_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| - assert options.metadata.key? :"x-goog-api-client" - assert options.metadata[:"x-goog-api-client"].include? "rest" - refute options.metadata[:"x-goog-api-client"].include? "grpc" - end - - ::Google::Cloud::SecretManager::V1beta2::SecretManagerService::Rest::ServiceStub.stub :transcode_access_secret_version_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, access_secret_version_client_stub do - # Create client - client = ::Google::Cloud::SecretManager::V1beta2::SecretManagerService::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - client.access_secret_version({ name: name }) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use named arguments - client.access_secret_version name: name do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object - client.access_secret_version ::Google::Cloud::SecretManager::V1beta2::AccessSecretVersionRequest.new(name: name) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use hash object with options - client.access_secret_version({ name: name }, call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object with options - client.access_secret_version(::Google::Cloud::SecretManager::V1beta2::AccessSecretVersionRequest.new(name: name), call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Verify method calls - assert_equal 5, access_secret_version_client_stub.call_count - end - end - end - - def test_disable_secret_version - # Create test objects. - client_result = ::Google::Cloud::SecretManager::V1beta2::SecretVersion.new - http_response = OpenStruct.new body: client_result.to_json - - call_options = {} - - # Create request parameters for a unary method. - name = "hello world" - etag = "hello world" - - disable_secret_version_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| - assert options.metadata.key? :"x-goog-api-client" - assert options.metadata[:"x-goog-api-client"].include? "rest" - refute options.metadata[:"x-goog-api-client"].include? "grpc" - end - - ::Google::Cloud::SecretManager::V1beta2::SecretManagerService::Rest::ServiceStub.stub :transcode_disable_secret_version_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, disable_secret_version_client_stub do - # Create client - client = ::Google::Cloud::SecretManager::V1beta2::SecretManagerService::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - client.disable_secret_version({ name: name, etag: etag }) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use named arguments - client.disable_secret_version name: name, etag: etag do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object - client.disable_secret_version ::Google::Cloud::SecretManager::V1beta2::DisableSecretVersionRequest.new(name: name, etag: etag) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use hash object with options - client.disable_secret_version({ name: name, etag: etag }, call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object with options - client.disable_secret_version(::Google::Cloud::SecretManager::V1beta2::DisableSecretVersionRequest.new(name: name, etag: etag), call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Verify method calls - assert_equal 5, disable_secret_version_client_stub.call_count - end - end - end - - def test_enable_secret_version - # Create test objects. - client_result = ::Google::Cloud::SecretManager::V1beta2::SecretVersion.new - http_response = OpenStruct.new body: client_result.to_json - - call_options = {} - - # Create request parameters for a unary method. - name = "hello world" - etag = "hello world" - - enable_secret_version_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| - assert options.metadata.key? :"x-goog-api-client" - assert options.metadata[:"x-goog-api-client"].include? "rest" - refute options.metadata[:"x-goog-api-client"].include? "grpc" - end - - ::Google::Cloud::SecretManager::V1beta2::SecretManagerService::Rest::ServiceStub.stub :transcode_enable_secret_version_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, enable_secret_version_client_stub do - # Create client - client = ::Google::Cloud::SecretManager::V1beta2::SecretManagerService::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - client.enable_secret_version({ name: name, etag: etag }) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use named arguments - client.enable_secret_version name: name, etag: etag do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object - client.enable_secret_version ::Google::Cloud::SecretManager::V1beta2::EnableSecretVersionRequest.new(name: name, etag: etag) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use hash object with options - client.enable_secret_version({ name: name, etag: etag }, call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object with options - client.enable_secret_version(::Google::Cloud::SecretManager::V1beta2::EnableSecretVersionRequest.new(name: name, etag: etag), call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Verify method calls - assert_equal 5, enable_secret_version_client_stub.call_count - end - end - end - - def test_destroy_secret_version - # Create test objects. - client_result = ::Google::Cloud::SecretManager::V1beta2::SecretVersion.new - http_response = OpenStruct.new body: client_result.to_json - - call_options = {} - - # Create request parameters for a unary method. - name = "hello world" - etag = "hello world" - - destroy_secret_version_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| - assert options.metadata.key? :"x-goog-api-client" - assert options.metadata[:"x-goog-api-client"].include? "rest" - refute options.metadata[:"x-goog-api-client"].include? "grpc" - end - - ::Google::Cloud::SecretManager::V1beta2::SecretManagerService::Rest::ServiceStub.stub :transcode_destroy_secret_version_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, destroy_secret_version_client_stub do - # Create client - client = ::Google::Cloud::SecretManager::V1beta2::SecretManagerService::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - client.destroy_secret_version({ name: name, etag: etag }) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use named arguments - client.destroy_secret_version name: name, etag: etag do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object - client.destroy_secret_version ::Google::Cloud::SecretManager::V1beta2::DestroySecretVersionRequest.new(name: name, etag: etag) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use hash object with options - client.destroy_secret_version({ name: name, etag: etag }, call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object with options - client.destroy_secret_version(::Google::Cloud::SecretManager::V1beta2::DestroySecretVersionRequest.new(name: name, etag: etag), call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Verify method calls - assert_equal 5, destroy_secret_version_client_stub.call_count - end - end - end - - def test_set_iam_policy - # Create test objects. - client_result = ::Google::Iam::V1::Policy.new - http_response = OpenStruct.new body: client_result.to_json - - call_options = {} - - # Create request parameters for a unary method. - resource = "hello world" - policy = {} - update_mask = {} - - set_iam_policy_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| - assert options.metadata.key? :"x-goog-api-client" - assert options.metadata[:"x-goog-api-client"].include? "rest" - refute options.metadata[:"x-goog-api-client"].include? "grpc" - end - - ::Google::Cloud::SecretManager::V1beta2::SecretManagerService::Rest::ServiceStub.stub :transcode_set_iam_policy_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, set_iam_policy_client_stub do - # Create client - client = ::Google::Cloud::SecretManager::V1beta2::SecretManagerService::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - client.set_iam_policy({ resource: resource, policy: policy, update_mask: update_mask }) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use named arguments - client.set_iam_policy resource: resource, policy: policy, update_mask: update_mask do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object - client.set_iam_policy ::Google::Iam::V1::SetIamPolicyRequest.new(resource: resource, policy: policy, update_mask: update_mask) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use hash object with options - client.set_iam_policy({ resource: resource, policy: policy, update_mask: update_mask }, call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object with options - client.set_iam_policy(::Google::Iam::V1::SetIamPolicyRequest.new(resource: resource, policy: policy, update_mask: update_mask), call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Verify method calls - assert_equal 5, set_iam_policy_client_stub.call_count - end - end - end - - def test_get_iam_policy - # Create test objects. - client_result = ::Google::Iam::V1::Policy.new - http_response = OpenStruct.new body: client_result.to_json - - call_options = {} - - # Create request parameters for a unary method. - resource = "hello world" - options = {} - - get_iam_policy_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| - assert options.metadata.key? :"x-goog-api-client" - assert options.metadata[:"x-goog-api-client"].include? "rest" - refute options.metadata[:"x-goog-api-client"].include? "grpc" - end - - ::Google::Cloud::SecretManager::V1beta2::SecretManagerService::Rest::ServiceStub.stub :transcode_get_iam_policy_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, get_iam_policy_client_stub do - # Create client - client = ::Google::Cloud::SecretManager::V1beta2::SecretManagerService::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - client.get_iam_policy({ resource: resource, options: options }) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use named arguments - client.get_iam_policy resource: resource, options: options do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object - client.get_iam_policy ::Google::Iam::V1::GetIamPolicyRequest.new(resource: resource, options: options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use hash object with options - client.get_iam_policy({ resource: resource, options: options }, call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object with options - client.get_iam_policy(::Google::Iam::V1::GetIamPolicyRequest.new(resource: resource, options: options), call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Verify method calls - assert_equal 5, get_iam_policy_client_stub.call_count - end - end - end - - def test_test_iam_permissions - # Create test objects. - client_result = ::Google::Iam::V1::TestIamPermissionsResponse.new - http_response = OpenStruct.new body: client_result.to_json - - call_options = {} - - # Create request parameters for a unary method. - resource = "hello world" - permissions = ["hello world"] - - test_iam_permissions_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| - assert options.metadata.key? :"x-goog-api-client" - assert options.metadata[:"x-goog-api-client"].include? "rest" - refute options.metadata[:"x-goog-api-client"].include? "grpc" - end - - ::Google::Cloud::SecretManager::V1beta2::SecretManagerService::Rest::ServiceStub.stub :transcode_test_iam_permissions_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, test_iam_permissions_client_stub do - # Create client - client = ::Google::Cloud::SecretManager::V1beta2::SecretManagerService::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - client.test_iam_permissions({ resource: resource, permissions: permissions }) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use named arguments - client.test_iam_permissions resource: resource, permissions: permissions do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object - client.test_iam_permissions ::Google::Iam::V1::TestIamPermissionsRequest.new(resource: resource, permissions: permissions) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use hash object with options - client.test_iam_permissions({ resource: resource, permissions: permissions }, call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object with options - client.test_iam_permissions(::Google::Iam::V1::TestIamPermissionsRequest.new(resource: resource, permissions: permissions), call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Verify method calls - assert_equal 5, test_iam_permissions_client_stub.call_count - end - end - end - - def test_configure - credentials_token = :dummy_value - - client = block_config = config = nil - dummy_stub = ClientStub.new nil - Gapic::Rest::ClientStub.stub :new, dummy_stub do - client = ::Google::Cloud::SecretManager::V1beta2::SecretManagerService::Rest::Client.new do |config| - config.credentials = credentials_token - end - end - - config = client.configure do |c| - block_config = c - end - - assert_same block_config, config - assert_kind_of ::Google::Cloud::SecretManager::V1beta2::SecretManagerService::Rest::Client::Configuration, config - end -end diff --git a/owl-bot-staging/google-cloud-secret_manager-v1beta2/test/google/cloud/secret_manager/v1beta2/secret_manager_service_test.rb b/owl-bot-staging/google-cloud-secret_manager-v1beta2/test/google/cloud/secret_manager/v1beta2/secret_manager_service_test.rb deleted file mode 100644 index e091b2dc2fc8..000000000000 --- a/owl-bot-staging/google-cloud-secret_manager-v1beta2/test/google/cloud/secret_manager/v1beta2/secret_manager_service_test.rb +++ /dev/null @@ -1,1020 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -require "helper" - -require "gapic/grpc/service_stub" - -require "google/cloud/secretmanager/v1beta2/service_pb" -require "google/cloud/secret_manager/v1beta2/secret_manager_service" - -class ::Google::Cloud::SecretManager::V1beta2::SecretManagerService::ClientTest < Minitest::Test - class ClientStub - attr_accessor :call_rpc_count, :requests - - def initialize response, operation, &block - @response = response - @operation = operation - @block = block - @call_rpc_count = 0 - @requests = [] - end - - def call_rpc *args, **kwargs - @call_rpc_count += 1 - - @requests << @block&.call(*args, **kwargs) - - catch :response do - yield @response, @operation if block_given? - @response - end - end - - def endpoint - "endpoint.example.com" - end - - def universe_domain - "example.com" - end - - def stub_logger - nil - end - - def logger - nil - end - end - - def test_list_secrets - # Create GRPC objects. - grpc_response = ::Google::Cloud::SecretManager::V1beta2::ListSecretsResponse.new - grpc_operation = GRPC::ActiveCall::Operation.new nil - grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - grpc_options = {} - - # Create request parameters for a unary method. - parent = "hello world" - page_size = 42 - page_token = "hello world" - filter = "hello world" - - list_secrets_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :list_secrets, name - assert_kind_of ::Google::Cloud::SecretManager::V1beta2::ListSecretsRequest, request - assert_equal "hello world", request["parent"] - assert_equal 42, request["page_size"] - assert_equal "hello world", request["page_token"] - assert_equal "hello world", request["filter"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, list_secrets_client_stub do - # Create client - client = ::Google::Cloud::SecretManager::V1beta2::SecretManagerService::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.list_secrets({ parent: parent, page_size: page_size, page_token: page_token, filter: filter }) do |response, operation| - assert_kind_of Gapic::PagedEnumerable, response - assert_equal grpc_response, response.response - assert_equal grpc_operation, operation - end - - # Use named arguments - client.list_secrets parent: parent, page_size: page_size, page_token: page_token, filter: filter do |response, operation| - assert_kind_of Gapic::PagedEnumerable, response - assert_equal grpc_response, response.response - assert_equal grpc_operation, operation - end - - # Use protobuf object - client.list_secrets ::Google::Cloud::SecretManager::V1beta2::ListSecretsRequest.new(parent: parent, page_size: page_size, page_token: page_token, filter: filter) do |response, operation| - assert_kind_of Gapic::PagedEnumerable, response - assert_equal grpc_response, response.response - assert_equal grpc_operation, operation - end - - # Use hash object with options - client.list_secrets({ parent: parent, page_size: page_size, page_token: page_token, filter: filter }, grpc_options) do |response, operation| - assert_kind_of Gapic::PagedEnumerable, response - assert_equal grpc_response, response.response - assert_equal grpc_operation, operation - end - - # Use protobuf object with options - client.list_secrets(::Google::Cloud::SecretManager::V1beta2::ListSecretsRequest.new(parent: parent, page_size: page_size, page_token: page_token, filter: filter), grpc_options) do |response, operation| - assert_kind_of Gapic::PagedEnumerable, response - assert_equal grpc_response, response.response - assert_equal grpc_operation, operation - end - - # Verify method calls - assert_equal 5, list_secrets_client_stub.call_rpc_count - end - end - - def test_create_secret - # Create GRPC objects. - grpc_response = ::Google::Cloud::SecretManager::V1beta2::Secret.new - grpc_operation = GRPC::ActiveCall::Operation.new nil - grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - grpc_options = {} - - # Create request parameters for a unary method. - parent = "hello world" - secret_id = "hello world" - secret = {} - - create_secret_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :create_secret, name - assert_kind_of ::Google::Cloud::SecretManager::V1beta2::CreateSecretRequest, request - assert_equal "hello world", request["parent"] - assert_equal "hello world", request["secret_id"] - assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::SecretManager::V1beta2::Secret), request["secret"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, create_secret_client_stub do - # Create client - client = ::Google::Cloud::SecretManager::V1beta2::SecretManagerService::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.create_secret({ parent: parent, secret_id: secret_id, secret: secret }) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use named arguments - client.create_secret parent: parent, secret_id: secret_id, secret: secret do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object - client.create_secret ::Google::Cloud::SecretManager::V1beta2::CreateSecretRequest.new(parent: parent, secret_id: secret_id, secret: secret) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use hash object with options - client.create_secret({ parent: parent, secret_id: secret_id, secret: secret }, grpc_options) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object with options - client.create_secret(::Google::Cloud::SecretManager::V1beta2::CreateSecretRequest.new(parent: parent, secret_id: secret_id, secret: secret), grpc_options) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Verify method calls - assert_equal 5, create_secret_client_stub.call_rpc_count - end - end - - def test_add_secret_version - # Create GRPC objects. - grpc_response = ::Google::Cloud::SecretManager::V1beta2::SecretVersion.new - grpc_operation = GRPC::ActiveCall::Operation.new nil - grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - grpc_options = {} - - # Create request parameters for a unary method. - parent = "hello world" - payload = {} - - add_secret_version_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :add_secret_version, name - assert_kind_of ::Google::Cloud::SecretManager::V1beta2::AddSecretVersionRequest, request - assert_equal "hello world", request["parent"] - assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::SecretManager::V1beta2::SecretPayload), request["payload"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, add_secret_version_client_stub do - # Create client - client = ::Google::Cloud::SecretManager::V1beta2::SecretManagerService::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.add_secret_version({ parent: parent, payload: payload }) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use named arguments - client.add_secret_version parent: parent, payload: payload do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object - client.add_secret_version ::Google::Cloud::SecretManager::V1beta2::AddSecretVersionRequest.new(parent: parent, payload: payload) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use hash object with options - client.add_secret_version({ parent: parent, payload: payload }, grpc_options) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object with options - client.add_secret_version(::Google::Cloud::SecretManager::V1beta2::AddSecretVersionRequest.new(parent: parent, payload: payload), grpc_options) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Verify method calls - assert_equal 5, add_secret_version_client_stub.call_rpc_count - end - end - - def test_get_secret - # Create GRPC objects. - grpc_response = ::Google::Cloud::SecretManager::V1beta2::Secret.new - grpc_operation = GRPC::ActiveCall::Operation.new nil - grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - grpc_options = {} - - # Create request parameters for a unary method. - name = "hello world" - - get_secret_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :get_secret, name - assert_kind_of ::Google::Cloud::SecretManager::V1beta2::GetSecretRequest, request - assert_equal "hello world", request["name"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, get_secret_client_stub do - # Create client - client = ::Google::Cloud::SecretManager::V1beta2::SecretManagerService::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.get_secret({ name: name }) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use named arguments - client.get_secret name: name do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object - client.get_secret ::Google::Cloud::SecretManager::V1beta2::GetSecretRequest.new(name: name) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use hash object with options - client.get_secret({ name: name }, grpc_options) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object with options - client.get_secret(::Google::Cloud::SecretManager::V1beta2::GetSecretRequest.new(name: name), grpc_options) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Verify method calls - assert_equal 5, get_secret_client_stub.call_rpc_count - end - end - - def test_update_secret - # Create GRPC objects. - grpc_response = ::Google::Cloud::SecretManager::V1beta2::Secret.new - grpc_operation = GRPC::ActiveCall::Operation.new nil - grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - grpc_options = {} - - # Create request parameters for a unary method. - secret = {} - update_mask = {} - - update_secret_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :update_secret, name - assert_kind_of ::Google::Cloud::SecretManager::V1beta2::UpdateSecretRequest, request - assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::SecretManager::V1beta2::Secret), request["secret"] - assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Protobuf::FieldMask), request["update_mask"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, update_secret_client_stub do - # Create client - client = ::Google::Cloud::SecretManager::V1beta2::SecretManagerService::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.update_secret({ secret: secret, update_mask: update_mask }) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use named arguments - client.update_secret secret: secret, update_mask: update_mask do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object - client.update_secret ::Google::Cloud::SecretManager::V1beta2::UpdateSecretRequest.new(secret: secret, update_mask: update_mask) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use hash object with options - client.update_secret({ secret: secret, update_mask: update_mask }, grpc_options) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object with options - client.update_secret(::Google::Cloud::SecretManager::V1beta2::UpdateSecretRequest.new(secret: secret, update_mask: update_mask), grpc_options) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Verify method calls - assert_equal 5, update_secret_client_stub.call_rpc_count - end - end - - def test_delete_secret - # Create GRPC objects. - grpc_response = ::Google::Protobuf::Empty.new - grpc_operation = GRPC::ActiveCall::Operation.new nil - grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - grpc_options = {} - - # Create request parameters for a unary method. - name = "hello world" - etag = "hello world" - - delete_secret_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :delete_secret, name - assert_kind_of ::Google::Cloud::SecretManager::V1beta2::DeleteSecretRequest, request - assert_equal "hello world", request["name"] - assert_equal "hello world", request["etag"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, delete_secret_client_stub do - # Create client - client = ::Google::Cloud::SecretManager::V1beta2::SecretManagerService::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.delete_secret({ name: name, etag: etag }) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use named arguments - client.delete_secret name: name, etag: etag do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object - client.delete_secret ::Google::Cloud::SecretManager::V1beta2::DeleteSecretRequest.new(name: name, etag: etag) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use hash object with options - client.delete_secret({ name: name, etag: etag }, grpc_options) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object with options - client.delete_secret(::Google::Cloud::SecretManager::V1beta2::DeleteSecretRequest.new(name: name, etag: etag), grpc_options) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Verify method calls - assert_equal 5, delete_secret_client_stub.call_rpc_count - end - end - - def test_list_secret_versions - # Create GRPC objects. - grpc_response = ::Google::Cloud::SecretManager::V1beta2::ListSecretVersionsResponse.new - grpc_operation = GRPC::ActiveCall::Operation.new nil - grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - grpc_options = {} - - # Create request parameters for a unary method. - parent = "hello world" - page_size = 42 - page_token = "hello world" - filter = "hello world" - - list_secret_versions_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :list_secret_versions, name - assert_kind_of ::Google::Cloud::SecretManager::V1beta2::ListSecretVersionsRequest, request - assert_equal "hello world", request["parent"] - assert_equal 42, request["page_size"] - assert_equal "hello world", request["page_token"] - assert_equal "hello world", request["filter"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, list_secret_versions_client_stub do - # Create client - client = ::Google::Cloud::SecretManager::V1beta2::SecretManagerService::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.list_secret_versions({ parent: parent, page_size: page_size, page_token: page_token, filter: filter }) do |response, operation| - assert_kind_of Gapic::PagedEnumerable, response - assert_equal grpc_response, response.response - assert_equal grpc_operation, operation - end - - # Use named arguments - client.list_secret_versions parent: parent, page_size: page_size, page_token: page_token, filter: filter do |response, operation| - assert_kind_of Gapic::PagedEnumerable, response - assert_equal grpc_response, response.response - assert_equal grpc_operation, operation - end - - # Use protobuf object - client.list_secret_versions ::Google::Cloud::SecretManager::V1beta2::ListSecretVersionsRequest.new(parent: parent, page_size: page_size, page_token: page_token, filter: filter) do |response, operation| - assert_kind_of Gapic::PagedEnumerable, response - assert_equal grpc_response, response.response - assert_equal grpc_operation, operation - end - - # Use hash object with options - client.list_secret_versions({ parent: parent, page_size: page_size, page_token: page_token, filter: filter }, grpc_options) do |response, operation| - assert_kind_of Gapic::PagedEnumerable, response - assert_equal grpc_response, response.response - assert_equal grpc_operation, operation - end - - # Use protobuf object with options - client.list_secret_versions(::Google::Cloud::SecretManager::V1beta2::ListSecretVersionsRequest.new(parent: parent, page_size: page_size, page_token: page_token, filter: filter), grpc_options) do |response, operation| - assert_kind_of Gapic::PagedEnumerable, response - assert_equal grpc_response, response.response - assert_equal grpc_operation, operation - end - - # Verify method calls - assert_equal 5, list_secret_versions_client_stub.call_rpc_count - end - end - - def test_get_secret_version - # Create GRPC objects. - grpc_response = ::Google::Cloud::SecretManager::V1beta2::SecretVersion.new - grpc_operation = GRPC::ActiveCall::Operation.new nil - grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - grpc_options = {} - - # Create request parameters for a unary method. - name = "hello world" - - get_secret_version_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :get_secret_version, name - assert_kind_of ::Google::Cloud::SecretManager::V1beta2::GetSecretVersionRequest, request - assert_equal "hello world", request["name"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, get_secret_version_client_stub do - # Create client - client = ::Google::Cloud::SecretManager::V1beta2::SecretManagerService::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.get_secret_version({ name: name }) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use named arguments - client.get_secret_version name: name do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object - client.get_secret_version ::Google::Cloud::SecretManager::V1beta2::GetSecretVersionRequest.new(name: name) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use hash object with options - client.get_secret_version({ name: name }, grpc_options) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object with options - client.get_secret_version(::Google::Cloud::SecretManager::V1beta2::GetSecretVersionRequest.new(name: name), grpc_options) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Verify method calls - assert_equal 5, get_secret_version_client_stub.call_rpc_count - end - end - - def test_access_secret_version - # Create GRPC objects. - grpc_response = ::Google::Cloud::SecretManager::V1beta2::AccessSecretVersionResponse.new - grpc_operation = GRPC::ActiveCall::Operation.new nil - grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - grpc_options = {} - - # Create request parameters for a unary method. - name = "hello world" - - access_secret_version_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :access_secret_version, name - assert_kind_of ::Google::Cloud::SecretManager::V1beta2::AccessSecretVersionRequest, request - assert_equal "hello world", request["name"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, access_secret_version_client_stub do - # Create client - client = ::Google::Cloud::SecretManager::V1beta2::SecretManagerService::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.access_secret_version({ name: name }) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use named arguments - client.access_secret_version name: name do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object - client.access_secret_version ::Google::Cloud::SecretManager::V1beta2::AccessSecretVersionRequest.new(name: name) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use hash object with options - client.access_secret_version({ name: name }, grpc_options) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object with options - client.access_secret_version(::Google::Cloud::SecretManager::V1beta2::AccessSecretVersionRequest.new(name: name), grpc_options) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Verify method calls - assert_equal 5, access_secret_version_client_stub.call_rpc_count - end - end - - def test_disable_secret_version - # Create GRPC objects. - grpc_response = ::Google::Cloud::SecretManager::V1beta2::SecretVersion.new - grpc_operation = GRPC::ActiveCall::Operation.new nil - grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - grpc_options = {} - - # Create request parameters for a unary method. - name = "hello world" - etag = "hello world" - - disable_secret_version_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :disable_secret_version, name - assert_kind_of ::Google::Cloud::SecretManager::V1beta2::DisableSecretVersionRequest, request - assert_equal "hello world", request["name"] - assert_equal "hello world", request["etag"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, disable_secret_version_client_stub do - # Create client - client = ::Google::Cloud::SecretManager::V1beta2::SecretManagerService::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.disable_secret_version({ name: name, etag: etag }) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use named arguments - client.disable_secret_version name: name, etag: etag do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object - client.disable_secret_version ::Google::Cloud::SecretManager::V1beta2::DisableSecretVersionRequest.new(name: name, etag: etag) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use hash object with options - client.disable_secret_version({ name: name, etag: etag }, grpc_options) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object with options - client.disable_secret_version(::Google::Cloud::SecretManager::V1beta2::DisableSecretVersionRequest.new(name: name, etag: etag), grpc_options) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Verify method calls - assert_equal 5, disable_secret_version_client_stub.call_rpc_count - end - end - - def test_enable_secret_version - # Create GRPC objects. - grpc_response = ::Google::Cloud::SecretManager::V1beta2::SecretVersion.new - grpc_operation = GRPC::ActiveCall::Operation.new nil - grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - grpc_options = {} - - # Create request parameters for a unary method. - name = "hello world" - etag = "hello world" - - enable_secret_version_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :enable_secret_version, name - assert_kind_of ::Google::Cloud::SecretManager::V1beta2::EnableSecretVersionRequest, request - assert_equal "hello world", request["name"] - assert_equal "hello world", request["etag"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, enable_secret_version_client_stub do - # Create client - client = ::Google::Cloud::SecretManager::V1beta2::SecretManagerService::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.enable_secret_version({ name: name, etag: etag }) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use named arguments - client.enable_secret_version name: name, etag: etag do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object - client.enable_secret_version ::Google::Cloud::SecretManager::V1beta2::EnableSecretVersionRequest.new(name: name, etag: etag) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use hash object with options - client.enable_secret_version({ name: name, etag: etag }, grpc_options) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object with options - client.enable_secret_version(::Google::Cloud::SecretManager::V1beta2::EnableSecretVersionRequest.new(name: name, etag: etag), grpc_options) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Verify method calls - assert_equal 5, enable_secret_version_client_stub.call_rpc_count - end - end - - def test_destroy_secret_version - # Create GRPC objects. - grpc_response = ::Google::Cloud::SecretManager::V1beta2::SecretVersion.new - grpc_operation = GRPC::ActiveCall::Operation.new nil - grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - grpc_options = {} - - # Create request parameters for a unary method. - name = "hello world" - etag = "hello world" - - destroy_secret_version_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :destroy_secret_version, name - assert_kind_of ::Google::Cloud::SecretManager::V1beta2::DestroySecretVersionRequest, request - assert_equal "hello world", request["name"] - assert_equal "hello world", request["etag"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, destroy_secret_version_client_stub do - # Create client - client = ::Google::Cloud::SecretManager::V1beta2::SecretManagerService::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.destroy_secret_version({ name: name, etag: etag }) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use named arguments - client.destroy_secret_version name: name, etag: etag do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object - client.destroy_secret_version ::Google::Cloud::SecretManager::V1beta2::DestroySecretVersionRequest.new(name: name, etag: etag) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use hash object with options - client.destroy_secret_version({ name: name, etag: etag }, grpc_options) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object with options - client.destroy_secret_version(::Google::Cloud::SecretManager::V1beta2::DestroySecretVersionRequest.new(name: name, etag: etag), grpc_options) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Verify method calls - assert_equal 5, destroy_secret_version_client_stub.call_rpc_count - end - end - - def test_set_iam_policy - # Create GRPC objects. - grpc_response = ::Google::Iam::V1::Policy.new - grpc_operation = GRPC::ActiveCall::Operation.new nil - grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - grpc_options = {} - - # Create request parameters for a unary method. - resource = "hello world" - policy = {} - update_mask = {} - - set_iam_policy_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :set_iam_policy, name - assert_kind_of ::Google::Iam::V1::SetIamPolicyRequest, request - assert_equal "hello world", request["resource"] - assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Iam::V1::Policy), request["policy"] - assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Protobuf::FieldMask), request["update_mask"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, set_iam_policy_client_stub do - # Create client - client = ::Google::Cloud::SecretManager::V1beta2::SecretManagerService::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.set_iam_policy({ resource: resource, policy: policy, update_mask: update_mask }) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use named arguments - client.set_iam_policy resource: resource, policy: policy, update_mask: update_mask do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object - client.set_iam_policy ::Google::Iam::V1::SetIamPolicyRequest.new(resource: resource, policy: policy, update_mask: update_mask) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use hash object with options - client.set_iam_policy({ resource: resource, policy: policy, update_mask: update_mask }, grpc_options) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object with options - client.set_iam_policy(::Google::Iam::V1::SetIamPolicyRequest.new(resource: resource, policy: policy, update_mask: update_mask), grpc_options) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Verify method calls - assert_equal 5, set_iam_policy_client_stub.call_rpc_count - end - end - - def test_get_iam_policy - # Create GRPC objects. - grpc_response = ::Google::Iam::V1::Policy.new - grpc_operation = GRPC::ActiveCall::Operation.new nil - grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - grpc_options = {} - - # Create request parameters for a unary method. - resource = "hello world" - options = {} - - get_iam_policy_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :get_iam_policy, name - assert_kind_of ::Google::Iam::V1::GetIamPolicyRequest, request - assert_equal "hello world", request["resource"] - assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Iam::V1::GetPolicyOptions), request["options"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, get_iam_policy_client_stub do - # Create client - client = ::Google::Cloud::SecretManager::V1beta2::SecretManagerService::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.get_iam_policy({ resource: resource, options: options }) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use named arguments - client.get_iam_policy resource: resource, options: options do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object - client.get_iam_policy ::Google::Iam::V1::GetIamPolicyRequest.new(resource: resource, options: options) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use hash object with options - client.get_iam_policy({ resource: resource, options: options }, grpc_options) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object with options - client.get_iam_policy(::Google::Iam::V1::GetIamPolicyRequest.new(resource: resource, options: options), grpc_options) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Verify method calls - assert_equal 5, get_iam_policy_client_stub.call_rpc_count - end - end - - def test_test_iam_permissions - # Create GRPC objects. - grpc_response = ::Google::Iam::V1::TestIamPermissionsResponse.new - grpc_operation = GRPC::ActiveCall::Operation.new nil - grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - grpc_options = {} - - # Create request parameters for a unary method. - resource = "hello world" - permissions = ["hello world"] - - test_iam_permissions_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :test_iam_permissions, name - assert_kind_of ::Google::Iam::V1::TestIamPermissionsRequest, request - assert_equal "hello world", request["resource"] - assert_equal ["hello world"], request["permissions"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, test_iam_permissions_client_stub do - # Create client - client = ::Google::Cloud::SecretManager::V1beta2::SecretManagerService::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.test_iam_permissions({ resource: resource, permissions: permissions }) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use named arguments - client.test_iam_permissions resource: resource, permissions: permissions do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object - client.test_iam_permissions ::Google::Iam::V1::TestIamPermissionsRequest.new(resource: resource, permissions: permissions) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use hash object with options - client.test_iam_permissions({ resource: resource, permissions: permissions }, grpc_options) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object with options - client.test_iam_permissions(::Google::Iam::V1::TestIamPermissionsRequest.new(resource: resource, permissions: permissions), grpc_options) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Verify method calls - assert_equal 5, test_iam_permissions_client_stub.call_rpc_count - end - end - - def test_configure - grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - - client = block_config = config = nil - dummy_stub = ClientStub.new nil, nil - Gapic::ServiceStub.stub :new, dummy_stub do - client = ::Google::Cloud::SecretManager::V1beta2::SecretManagerService::Client.new do |config| - config.credentials = grpc_channel - end - end - - config = client.configure do |c| - block_config = c - end - - assert_same block_config, config - assert_kind_of ::Google::Cloud::SecretManager::V1beta2::SecretManagerService::Client::Configuration, config - end - - def test_credentials - key = OpenSSL::PKey::RSA.new 2048 - cred_json = { - "private_key" => key.to_pem, - "client_email" => "app@developer.gserviceaccount.com", - "type" => "service_account" - } - key_file = StringIO.new cred_json.to_json - creds = Google::Auth::ServiceAccountCredentials.make_creds({ json_key_io: key_file }) - - dummy_stub = ClientStub.new nil, nil - Gapic::ServiceStub.stub :new, dummy_stub do - client = ::Google::Cloud::SecretManager::V1beta2::SecretManagerService::Client.new do |config| - config.credentials = creds - end - assert_kind_of ::Google::Cloud::SecretManager::V1beta2::SecretManagerService::Client, client - assert_equal creds, client.configure.credentials - end - end -end diff --git a/owl-bot-staging/google-cloud-secret_manager-v1beta2/test/helper.rb b/owl-bot-staging/google-cloud-secret_manager-v1beta2/test/helper.rb deleted file mode 100644 index 672b337030e7..000000000000 --- a/owl-bot-staging/google-cloud-secret_manager-v1beta2/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" diff --git a/owl-bot-staging/google-cloud-secure_source_manager-v1/.gitignore b/owl-bot-staging/google-cloud-secure_source_manager-v1/.gitignore deleted file mode 100644 index 0135b6bc6cfc..000000000000 --- a/owl-bot-staging/google-cloud-secure_source_manager-v1/.gitignore +++ /dev/null @@ -1,22 +0,0 @@ -# Ignore bundler lockfiles -Gemfile.lock -gems.locked - -# Ignore documentation output -doc/* -.yardoc/* - -# Ignore test output -coverage/* - -# Ignore build artifacts -pkg/* - -# Ignore files commonly present in certain dev environments -.vagrant -.DS_STORE -.idea -*.iml - -# Ignore synth output -__pycache__ diff --git a/owl-bot-staging/google-cloud-secure_source_manager-v1/.repo-metadata.json b/owl-bot-staging/google-cloud-secure_source_manager-v1/.repo-metadata.json deleted file mode 100644 index 8301929ac8fd..000000000000 --- a/owl-bot-staging/google-cloud-secure_source_manager-v1/.repo-metadata.json +++ /dev/null @@ -1,17 +0,0 @@ -{ - "api_id": "securesourcemanager.googleapis.com", - "api_shortname": "securesourcemanager", - "client_documentation": "https://cloud.google.com/ruby/docs/reference/google-cloud-secure_source_manager-v1/latest", - "distribution_name": "google-cloud-secure_source_manager-v1", - "is_cloud": true, - "language": "ruby", - "name": "securesourcemanager", - "name_pretty": "Secure Source Manager V1 API", - "product_documentation": "https://cloud.google.com/secure-source-manager/docs/overview", - "release_level": "unreleased", - "repo": "googleapis/google-cloud-ruby", - "requires_billing": true, - "ruby-cloud-description": "Regionally deployed, single-tenant managed source code repository hosted on Google Cloud. Note that google-cloud-secure_source_manager-v1 is a version-specific client library. For most uses, we recommend installing the main client library google-cloud-secure_source_manager instead. See the readme for more details.", - "ruby-cloud-product-url": "https://cloud.google.com/secure-source-manager/docs/overview", - "library_type": "GAPIC_AUTO" -} diff --git a/owl-bot-staging/google-cloud-secure_source_manager-v1/.rubocop.yml b/owl-bot-staging/google-cloud-secure_source_manager-v1/.rubocop.yml deleted file mode 100644 index 93adabe4f472..000000000000 --- a/owl-bot-staging/google-cloud-secure_source_manager-v1/.rubocop.yml +++ /dev/null @@ -1,33 +0,0 @@ -inherit_gem: - google-style: google-style.yml - -AllCops: - Exclude: - - "google-cloud-secure_source_manager-v1.gemspec" - - "lib/**/*_pb.rb" - - "proto_docs/**/*" - - "test/**/*" - - "acceptance/**/*" - - "samples/acceptance/**/*" - - "Rakefile" - -Layout/LineLength: - Enabled: false -Metrics/AbcSize: - Enabled: false -Metrics/ClassLength: - Enabled: false -Metrics/CyclomaticComplexity: - Enabled: false -Metrics/MethodLength: - Enabled: false -Metrics/ModuleLength: - Enabled: false -Metrics/PerceivedComplexity: - Enabled: false -Naming/AccessorMethodName: - Exclude: - - "snippets/**/*.rb" -Naming/FileName: - Exclude: - - "lib/google-cloud-secure_source_manager-v1.rb" diff --git a/owl-bot-staging/google-cloud-secure_source_manager-v1/.toys.rb b/owl-bot-staging/google-cloud-secure_source_manager-v1/.toys.rb deleted file mode 100644 index 177e22456e8a..000000000000 --- a/owl-bot-staging/google-cloud-secure_source_manager-v1/.toys.rb +++ /dev/null @@ -1,28 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -toys_version! ">= 0.15.3" - -if ENV["RUBY_COMMON_TOOLS"] - common_tools_dir = File.expand_path ENV["RUBY_COMMON_TOOLS"] - load File.join(common_tools_dir, "toys", "gapic") -else - load_git remote: "https://github.com/googleapis/ruby-common-tools.git", - path: "toys/gapic", - update: true -end diff --git a/owl-bot-staging/google-cloud-secure_source_manager-v1/.yardopts b/owl-bot-staging/google-cloud-secure_source_manager-v1/.yardopts deleted file mode 100644 index 6adcda101376..000000000000 --- a/owl-bot-staging/google-cloud-secure_source_manager-v1/.yardopts +++ /dev/null @@ -1,12 +0,0 @@ ---no-private ---title="Secure Source Manager V1 API" ---exclude _pb\.rb$ ---markup markdown ---markup-provider redcarpet - -./lib/**/*.rb -./proto_docs/**/*.rb -- -README.md -LICENSE.md -AUTHENTICATION.md diff --git a/owl-bot-staging/google-cloud-secure_source_manager-v1/AUTHENTICATION.md b/owl-bot-staging/google-cloud-secure_source_manager-v1/AUTHENTICATION.md deleted file mode 100644 index 32e59d3cbbea..000000000000 --- a/owl-bot-staging/google-cloud-secure_source_manager-v1/AUTHENTICATION.md +++ /dev/null @@ -1,122 +0,0 @@ -# Authentication - -The recommended way to authenticate to the google-cloud-secure_source_manager-v1 library is to use -[Application Default Credentials (ADC)](https://cloud.google.com/docs/authentication/application-default-credentials). -To review all of your authentication options, see [Credentials lookup](#credential-lookup). - -## Quickstart - -The following example shows how to set up authentication for a local development -environment with your user credentials. - -**NOTE:** This method is _not_ recommended for running in production. User credentials -should be used only during development. - -1. [Download and install the Google Cloud CLI](https://cloud.google.com/sdk). -2. Set up a local ADC file with your user credentials: - -```sh -gcloud auth application-default login -``` - -3. Write code as if already authenticated. - -For more information about setting up authentication for a local development environment, see -[Set up Application Default Credentials](https://cloud.google.com/docs/authentication/provide-credentials-adc#local-dev). - -## Credential Lookup - -The google-cloud-secure_source_manager-v1 library provides several mechanisms to configure your system. -Generally, using Application Default Credentials to facilitate automatic -credentials discovery is the easist method. But if you need to explicitly specify -credentials, there are several methods available to you. - -Credentials are accepted in the following ways, in the following order or precedence: - -1. Credentials specified in method arguments -2. Credentials specified in configuration -3. Credentials pointed to or included in environment variables -4. Credentials found in local ADC file -5. Credentials returned by the metadata server for the attached service account (GCP) - -### Configuration - -You can configure a path to a JSON credentials file, either for an individual client object or -globally, for all client objects. The JSON file can contain credentials created for -[workload identity federation](https://cloud.google.com/iam/docs/workload-identity-federation), -[workforce identity federation](https://cloud.google.com/iam/docs/workforce-identity-federation), or a -[service account key](https://cloud.google.com/docs/authentication/provide-credentials-adc#local-key). - -Note: Service account keys are a security risk if not managed correctly. You should -[choose a more secure alternative to service account keys](https://cloud.google.com/docs/authentication#auth-decision-tree) -whenever possible. - -To configure a credentials file for an individual client initialization: - -```ruby -require "google/cloud/secure_source_manager/v1" - -client = ::Google::Cloud::SecureSourceManager::V1::SecureSourceManager::Client.new do |config| - config.credentials = "path/to/credentialfile.json" -end -``` - -To configure a credentials file globally for all clients: - -```ruby -require "google/cloud/secure_source_manager/v1" - -::Google::Cloud::SecureSourceManager::V1::SecureSourceManager::Client.configure do |config| - config.credentials = "path/to/credentialfile.json" -end - -client = ::Google::Cloud::SecureSourceManager::V1::SecureSourceManager::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-secure_source_manager-v1 -checks for credentials are: - -* `GOOGLE_CLOUD_CREDENTIALS` - Path to JSON file, or JSON contents -* `GOOGLE_APPLICATION_CREDENTIALS` - Path to JSON file - -```ruby -require "google/cloud/secure_source_manager/v1" - -ENV["GOOGLE_APPLICATION_CREDENTIALS"] = "path/to/credentialfile.json" - -client = ::Google::Cloud::SecureSourceManager::V1::SecureSourceManager::Client.new -``` - -### Local ADC file - -You can set up a local ADC file with your user credentials for authentication during -development. If credentials are not provided in code or in environment variables, -then the local ADC credentials are discovered. - -Follow the steps in [Quickstart](#quickstart) to set up a local ADC file. - -### Google Cloud Platform environments - -When running on Google Cloud Platform (GCP), including Google Compute Engine -(GCE), Google Kubernetes Engine (GKE), Google App Engine (GAE), Google Cloud -Functions (GCF) and Cloud Run, credentials are retrieved from the attached -service account automatically. Code should be written as if already authenticated. - -For more information, see -[Set up ADC for Google Cloud services](https://cloud.google.com/docs/authentication/provide-credentials-adc#attached-sa). diff --git a/owl-bot-staging/google-cloud-secure_source_manager-v1/CHANGELOG.md b/owl-bot-staging/google-cloud-secure_source_manager-v1/CHANGELOG.md deleted file mode 100644 index f88957a62ba2..000000000000 --- a/owl-bot-staging/google-cloud-secure_source_manager-v1/CHANGELOG.md +++ /dev/null @@ -1,2 +0,0 @@ -# Release History - diff --git a/owl-bot-staging/google-cloud-secure_source_manager-v1/Gemfile b/owl-bot-staging/google-cloud-secure_source_manager-v1/Gemfile deleted file mode 100644 index 1d08558908d8..000000000000 --- a/owl-bot-staging/google-cloud-secure_source_manager-v1/Gemfile +++ /dev/null @@ -1,14 +0,0 @@ -source "https://rubygems.org" - -gemspec - -gem "google-style", "~> 1.32.0" -gem "irb", "~> 1.17" -gem "minitest", "~> 6.0.2" -gem "minitest-focus", "~> 1.4" -gem "minitest-mock", "~> 5.27" -gem "minitest-rg", "~> 5.3" -gem "ostruct", "~> 0.5.5" -gem "rake", ">= 13.0" -gem "redcarpet", "~> 3.6" -gem "yard", "~> 0.9" diff --git a/owl-bot-staging/google-cloud-secure_source_manager-v1/LICENSE.md b/owl-bot-staging/google-cloud-secure_source_manager-v1/LICENSE.md deleted file mode 100644 index c261857ba6ad..000000000000 --- a/owl-bot-staging/google-cloud-secure_source_manager-v1/LICENSE.md +++ /dev/null @@ -1,201 +0,0 @@ - Apache License - Version 2.0, January 2004 - http://www.apache.org/licenses/ - - TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION - - 1. Definitions. - - "License" shall mean the terms and conditions for use, reproduction, - and distribution as defined by Sections 1 through 9 of this document. - - "Licensor" shall mean the copyright owner or entity authorized by - the copyright owner that is granting the License. - - "Legal Entity" shall mean the union of the acting entity and all - other entities that control, are controlled by, or are under common - control with that entity. For the purposes of this definition, - "control" means (i) the power, direct or indirect, to cause the - direction or management of such entity, whether by contract or - otherwise, or (ii) ownership of fifty percent (50%) or more of the - outstanding shares, or (iii) beneficial ownership of such entity. - - "You" (or "Your") shall mean an individual or Legal Entity - exercising permissions granted by this License. - - "Source" form shall mean the preferred form for making modifications, - including but not limited to software source code, documentation - source, and configuration files. - - "Object" form shall mean any form resulting from mechanical - transformation or translation of a Source form, including but - not limited to compiled object code, generated documentation, - and conversions to other media types. - - "Work" shall mean the work of authorship, whether in Source or - Object form, made available under the License, as indicated by a - copyright notice that is included in or attached to the work - (an example is provided in the Appendix below). - - "Derivative Works" shall mean any work, whether in Source or Object - form, that is based on (or derived from) the Work and for which the - editorial revisions, annotations, elaborations, or other modifications - represent, as a whole, an original work of authorship. For the purposes - of this License, Derivative Works shall not include works that remain - separable from, or merely link (or bind by name) to the interfaces of, - the Work and Derivative Works thereof. - - "Contribution" shall mean any work of authorship, including - the original version of the Work and any modifications or additions - to that Work or Derivative Works thereof, that is intentionally - submitted to Licensor for inclusion in the Work by the copyright owner - or by an individual or Legal Entity authorized to submit on behalf of - the copyright owner. For the purposes of this definition, "submitted" - means any form of electronic, verbal, or written communication sent - to the Licensor or its representatives, including but not limited to - communication on electronic mailing lists, source code control systems, - and issue tracking systems that are managed by, or on behalf of, the - Licensor for the purpose of discussing and improving the Work, but - excluding communication that is conspicuously marked or otherwise - designated in writing by the copyright owner as "Not a Contribution." - - "Contributor" shall mean Licensor and any individual or Legal Entity - on behalf of whom a Contribution has been received by Licensor and - subsequently incorporated within the Work. - - 2. Grant of Copyright License. Subject to the terms and conditions of - this License, each Contributor hereby grants to You a perpetual, - worldwide, non-exclusive, no-charge, royalty-free, irrevocable - copyright license to reproduce, prepare Derivative Works of, - publicly display, publicly perform, sublicense, and distribute the - Work and such Derivative Works in Source or Object form. - - 3. Grant of Patent License. Subject to the terms and conditions of - this License, each Contributor hereby grants to You a perpetual, - worldwide, non-exclusive, no-charge, royalty-free, irrevocable - (except as stated in this section) patent license to make, have made, - use, offer to sell, sell, import, and otherwise transfer the Work, - where such license applies only to those patent claims licensable - by such Contributor that are necessarily infringed by their - Contribution(s) alone or by combination of their Contribution(s) - with the Work to which such Contribution(s) was submitted. If You - institute patent litigation against any entity (including a - cross-claim or counterclaim in a lawsuit) alleging that the Work - or a Contribution incorporated within the Work constitutes direct - or contributory patent infringement, then any patent licenses - granted to You under this License for that Work shall terminate - as of the date such litigation is filed. - - 4. Redistribution. You may reproduce and distribute copies of the - Work or Derivative Works thereof in any medium, with or without - modifications, and in Source or Object form, provided that You - meet the following conditions: - - (a) You must give any other recipients of the Work or - Derivative Works a copy of this License; and - - (b) You must cause any modified files to carry prominent notices - stating that You changed the files; and - - (c) You must retain, in the Source form of any Derivative Works - that You distribute, all copyright, patent, trademark, and - attribution notices from the Source form of the Work, - excluding those notices that do not pertain to any part of - the Derivative Works; and - - (d) If the Work includes a "NOTICE" text file as part of its - distribution, then any Derivative Works that You distribute must - include a readable copy of the attribution notices contained - within such NOTICE file, excluding those notices that do not - pertain to any part of the Derivative Works, in at least one - of the following places: within a NOTICE text file distributed - as part of the Derivative Works; within the Source form or - documentation, if provided along with the Derivative Works; or, - within a display generated by the Derivative Works, if and - wherever such third-party notices normally appear. The contents - of the NOTICE file are for informational purposes only and - do not modify the License. You may add Your own attribution - notices within Derivative Works that You distribute, alongside - or as an addendum to the NOTICE text from the Work, provided - that such additional attribution notices cannot be construed - as modifying the License. - - You may add Your own copyright statement to Your modifications and - may provide additional or different license terms and conditions - for use, reproduction, or distribution of Your modifications, or - for any such Derivative Works as a whole, provided Your use, - reproduction, and distribution of the Work otherwise complies with - the conditions stated in this License. - - 5. Submission of Contributions. Unless You explicitly state otherwise, - any Contribution intentionally submitted for inclusion in the Work - by You to the Licensor shall be under the terms and conditions of - this License, without any additional terms or conditions. - Notwithstanding the above, nothing herein shall supersede or modify - the terms of any separate license agreement you may have executed - with Licensor regarding such Contributions. - - 6. Trademarks. This License does not grant permission to use the trade - names, trademarks, service marks, or product names of the Licensor, - except as required for reasonable and customary use in describing the - origin of the Work and reproducing the content of the NOTICE file. - - 7. Disclaimer of Warranty. Unless required by applicable law or - agreed to in writing, Licensor provides the Work (and each - Contributor provides its Contributions) on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or - implied, including, without limitation, any warranties or conditions - of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A - PARTICULAR PURPOSE. You are solely responsible for determining the - appropriateness of using or redistributing the Work and assume any - risks associated with Your exercise of permissions under this License. - - 8. Limitation of Liability. In no event and under no legal theory, - whether in tort (including negligence), contract, or otherwise, - unless required by applicable law (such as deliberate and grossly - negligent acts) or agreed to in writing, shall any Contributor be - liable to You for damages, including any direct, indirect, special, - incidental, or consequential damages of any character arising as a - result of this License or out of the use or inability to use the - Work (including but not limited to damages for loss of goodwill, - work stoppage, computer failure or malfunction, or any and all - other commercial damages or losses), even if such Contributor - has been advised of the possibility of such damages. - - 9. Accepting Warranty or Additional Liability. While redistributing - the Work or Derivative Works thereof, You may choose to offer, - and charge a fee for, acceptance of support, warranty, indemnity, - or other liability obligations and/or rights consistent with this - License. However, in accepting such obligations, You may act only - on Your own behalf and on Your sole responsibility, not on behalf - of any other Contributor, and only if You agree to indemnify, - defend, and hold each Contributor harmless for any liability - incurred by, or claims asserted against, such Contributor by reason - of your accepting any such warranty or additional liability. - - END OF TERMS AND CONDITIONS - - APPENDIX: How to apply the Apache License to your work. - - To apply the Apache License to your work, attach the following - boilerplate notice, with the fields enclosed by brackets "[]" - replaced with your own identifying information. (Don't include - the brackets!) The text should be enclosed in the appropriate - comment syntax for the file format. We also recommend that a - file or class name and description of purpose be included on the - same "printed page" as the copyright notice for easier - identification within third-party archives. - - Copyright [yyyy] [name of copyright owner] - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. diff --git a/owl-bot-staging/google-cloud-secure_source_manager-v1/README.md b/owl-bot-staging/google-cloud-secure_source_manager-v1/README.md deleted file mode 100644 index f1c2f10d7f10..000000000000 --- a/owl-bot-staging/google-cloud-secure_source_manager-v1/README.md +++ /dev/null @@ -1,154 +0,0 @@ -# Ruby Client for the Secure Source Manager V1 API - -Regionally deployed, single-tenant managed source code repository hosted on Google Cloud. - -Regionally deployed, single-tenant managed source code repository hosted on Google Cloud. - -https://github.com/googleapis/google-cloud-ruby - -This gem is a _versioned_ client. It provides basic client classes for a -specific version of the Secure Source Manager V1 API. Most users should consider using -the main client gem, -[google-cloud-secure_source_manager](https://rubygems.org/gems/google-cloud-secure_source_manager). -See the section below titled *Which client should I use?* for more information. - -## Installation - -``` -$ gem install google-cloud-secure_source_manager-v1 -``` - -## Before You Begin - -In order to use this library, you first need to go through the following steps: - -1. [Select or create a Cloud Platform project.](https://console.cloud.google.com/project) -1. [Enable billing for your project.](https://cloud.google.com/billing/docs/how-to/modify-project#enable_billing_for_a_project) -1. [Enable the API.](https://console.cloud.google.com/apis/library/securesourcemanager.googleapis.com) -1. [Set up authentication.](AUTHENTICATION.md) - -## Quick Start - -```ruby -require "google/cloud/secure_source_manager/v1" - -client = ::Google::Cloud::SecureSourceManager::V1::SecureSourceManager::Client.new -request = ::Google::Cloud::SecureSourceManager::V1::ListInstancesRequest.new # (request fields as keyword arguments...) -response = client.list_instances request -``` - -View the [Client Library Documentation](https://cloud.google.com/ruby/docs/reference/google-cloud-secure_source_manager-v1/latest) -for class and method documentation. - -See also the [Product Documentation](https://cloud.google.com/secure-source-manager/docs/overview) -for general usage information. - -## Debug Logging - -This library comes with opt-in Debug Logging that can help you troubleshoot -your application's integration with the API. When logging is activated, key -events such as requests and responses, along with data payloads and metadata -such as headers and client configuration, are logged to the standard error -stream. - -**WARNING:** Client Library Debug Logging includes your data payloads in -plaintext, which could include sensitive data such as PII for yourself or your -customers, private keys, or other security data that could be compromising if -leaked. Always practice good data hygiene with your application logs, and follow -the principle of least access. Google also recommends that Client Library Debug -Logging be enabled only temporarily during active debugging, and not used -permanently in production. - -To enable logging, set the environment variable `GOOGLE_SDK_RUBY_LOGGING_GEMS` -to the value `all`. Alternatively, you can set the value to a comma-delimited -list of client library gem names. This will select the default logging behavior, -which writes logs to the standard error stream. On a local workstation, this may -result in logs appearing on the console. When running on a Google Cloud hosting -service such as [Google Cloud Run](https://cloud.google.com/run), this generally -results in logs appearing alongside your application logs in the -[Google Cloud Logging](https://cloud.google.com/logging/) service. - -You can customize logging by modifying the `logger` configuration when -constructing a client object. For example: - -```ruby -require "google/cloud/secure_source_manager/v1" -require "logger" - -client = ::Google::Cloud::SecureSourceManager::V1::SecureSourceManager::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-secure_source_manager`, -and lower-level _versioned_ client libraries with names such as -`google-cloud-secure_source_manager-v1`. -_In most cases, you should install the main client._ - -### What's the difference between the main client and a versioned client? - -A _versioned client_ provides a basic set of data types and client classes for -a _single version_ of a specific service. (That is, for a service with multiple -versions, there might be a separate versioned client for each service version.) -Most versioned clients are written and maintained by a code generator. - -The _main client_ is designed to provide you with the _recommended_ client -interfaces for the service. There will be only one main client for any given -service, even a service with multiple versions. The main client includes -factory methods for constructing the client objects we recommend for most -users. In some cases, those will be classes provided by an underlying versioned -client; in other cases, they will be handwritten higher-level client objects -with additional capabilities, convenience methods, or best practices built in. -Generally, the main client will default to a recommended service version, -although in some cases you can override this if you need to talk to a specific -service version. - -### Why would I want to use the main client? - -We recommend that most users install the main client gem for a service. You can -identify this gem as the one _without_ a version in its name, e.g. -`google-cloud-secure_source_manager`. -The main client is recommended because it will embody the best practices for -accessing the service, and may also provide more convenient interfaces or -tighter integration into frameworks and third-party libraries. In addition, the -documentation and samples published by Google will generally demonstrate use of -the main client. - -### Why would I want to use a versioned client? - -You can use a versioned client if you are content with a possibly lower-level -class interface, you explicitly want to avoid features provided by the main -client, or you want to access a specific service version not be covered by the -main client. You can identify versioned client gems because the service version -is part of the name, e.g. `google-cloud-secure_source_manager-v1`. - -### What about the google-apis- clients? - -Client library gems with names that begin with `google-apis-` are based on an -older code generation technology. They talk to a REST/JSON backend (whereas -most modern clients talk to a [gRPC](https://grpc.io/) backend) and they may -not offer the same performance, features, and ease of use provided by more -modern clients. - -The `google-apis-` clients have wide coverage across Google services, so you -might need to use one if there is no modern client available for the service. -However, if a modern client is available, we generally recommend it over the -older `google-apis-` clients. diff --git a/owl-bot-staging/google-cloud-secure_source_manager-v1/Rakefile b/owl-bot-staging/google-cloud-secure_source_manager-v1/Rakefile deleted file mode 100644 index 9fd2e0c76cc0..000000000000 --- a/owl-bot-staging/google-cloud-secure_source_manager-v1/Rakefile +++ /dev/null @@ -1,169 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -require "bundler/setup" -require "bundler/gem_tasks" - -require "rubocop/rake_task" -RuboCop::RakeTask.new - -require "rake/testtask" -desc "Run tests." -Rake::TestTask.new do |t| - t.libs << "test" - t.test_files = FileList["test/**/*_test.rb"] - t.warning = false -end - -desc "Runs the smoke tests." -Rake::TestTask.new :smoke_test do |t| - t.test_files = FileList["acceptance/**/*smoke_test.rb"] - t.warning = false -end - -# Acceptance tests -desc "Run the google-cloud-secure_source_manager-v1 acceptance tests." -task :acceptance, :project, :keyfile do |t, args| - project = args[:project] - project ||= - ENV["GOOGLE_CLOUD_TEST_PROJECT"] || - ENV["GCLOUD_TEST_PROJECT"] - keyfile = args[:keyfile] - keyfile ||= - ENV["GOOGLE_CLOUD_TEST_KEYFILE"] || - ENV["GCLOUD_TEST_KEYFILE"] - if keyfile - keyfile = File.read keyfile - else - keyfile ||= - ENV["GOOGLE_CLOUD_TEST_KEYFILE_JSON"] || - ENV["GCLOUD_TEST_KEYFILE_JSON"] - end - if project.nil? || keyfile.nil? - fail "You must provide a project and keyfile. e.g. rake acceptance[test123, /path/to/keyfile.json] or GOOGLE_CLOUD_TEST_PROJECT=test123 GOOGLE_CLOUD_TEST_KEYFILE=/path/to/keyfile.json rake acceptance" - end - require "google/cloud/secure_source_manager/v1/secure_source_manager/credentials" - ::Google::Cloud::SecureSourceManager::V1::SecureSourceManager::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-secure_source_manager-v1 gem has no acceptance tests." - end - end - - desc "Run acceptance cleanup." - task :cleanup do - end -end - -task :samples do - Rake::Task["samples:latest"].invoke -end - -namespace :samples do - task :latest do - if File.directory? "samples" - Dir.chdir "samples" do - Bundler.with_clean_env do - ENV["GOOGLE_CLOUD_SAMPLES_TEST"] = "not_master" - sh "bundle update" - sh "bundle exec rake test" - end - end - else - puts "The google-cloud-secure_source_manager-v1 gem has no samples to test." - end - end - - task :master do - if File.directory? "samples" - Dir.chdir "samples" do - Bundler.with_clean_env do - ENV["GOOGLE_CLOUD_SAMPLES_TEST"] = "master" - sh "bundle update" - sh "bundle exec rake test" - end - end - else - puts "The google-cloud-secure_source_manager-v1 gem has no samples to test." - end - end -end - -require "yard" -require "yard/rake/yardoc_task" -YARD::Rake::YardocTask.new do |y| - y.options << "--fail-on-warning" -end - -desc "Run yard-doctest example tests." -task :doctest do - puts "The google-cloud-secure_source_manager-v1 gem does not have doctest tests." -end - -desc "Run the CI build" -task :ci do - header "BUILDING google-cloud-secure_source_manager-v1" - header "google-cloud-secure_source_manager-v1 rubocop", "*" - Rake::Task[:rubocop].invoke - header "google-cloud-secure_source_manager-v1 yard", "*" - Rake::Task[:yard].invoke - header "google-cloud-secure_source_manager-v1 test", "*" - Rake::Task[:test].invoke -end - -namespace :ci do - desc "Run the CI build, with smoke tests." - task :smoke_test do - Rake::Task[:ci].invoke - header "google-cloud-secure_source_manager-v1 smoke_test", "*" - Rake::Task[:smoke_test].invoke - end - desc "Run the CI build, with acceptance tests." - task :acceptance do - Rake::Task[:ci].invoke - header "google-cloud-secure_source_manager-v1 acceptance", "*" - Rake::Task[:acceptance].invoke - end - task :a do - # This is a handy shortcut to save typing - Rake::Task["ci:acceptance"].invoke - end -end - -task default: :test - -def header str, token = "#" - line_length = str.length + 8 - puts "" - puts token * line_length - puts "#{token * 3} #{str} #{token * 3}" - puts token * line_length - puts "" -end diff --git a/owl-bot-staging/google-cloud-secure_source_manager-v1/gapic_metadata.json b/owl-bot-staging/google-cloud-secure_source_manager-v1/gapic_metadata.json deleted file mode 100644 index cb4bf595a281..000000000000 --- a/owl-bot-staging/google-cloud-secure_source_manager-v1/gapic_metadata.json +++ /dev/null @@ -1,278 +0,0 @@ -{ - "schema": "1.0", - "comment": "This file maps proto services/RPCs to the corresponding library clients/methods", - "language": "ruby", - "protoPackage": "google.cloud.securesourcemanager.v1", - "libraryPackage": "::Google::Cloud::SecureSourceManager::V1", - "services": { - "SecureSourceManager": { - "clients": { - "grpc": { - "libraryClient": "::Google::Cloud::SecureSourceManager::V1::SecureSourceManager::Client", - "rpcs": { - "ListInstances": { - "methods": [ - "list_instances" - ] - }, - "GetInstance": { - "methods": [ - "get_instance" - ] - }, - "CreateInstance": { - "methods": [ - "create_instance" - ] - }, - "DeleteInstance": { - "methods": [ - "delete_instance" - ] - }, - "ListRepositories": { - "methods": [ - "list_repositories" - ] - }, - "GetRepository": { - "methods": [ - "get_repository" - ] - }, - "CreateRepository": { - "methods": [ - "create_repository" - ] - }, - "UpdateRepository": { - "methods": [ - "update_repository" - ] - }, - "DeleteRepository": { - "methods": [ - "delete_repository" - ] - }, - "ListHooks": { - "methods": [ - "list_hooks" - ] - }, - "GetHook": { - "methods": [ - "get_hook" - ] - }, - "CreateHook": { - "methods": [ - "create_hook" - ] - }, - "UpdateHook": { - "methods": [ - "update_hook" - ] - }, - "DeleteHook": { - "methods": [ - "delete_hook" - ] - }, - "GetIamPolicyRepo": { - "methods": [ - "get_iam_policy_repo" - ] - }, - "SetIamPolicyRepo": { - "methods": [ - "set_iam_policy_repo" - ] - }, - "TestIamPermissionsRepo": { - "methods": [ - "test_iam_permissions_repo" - ] - }, - "CreateBranchRule": { - "methods": [ - "create_branch_rule" - ] - }, - "ListBranchRules": { - "methods": [ - "list_branch_rules" - ] - }, - "GetBranchRule": { - "methods": [ - "get_branch_rule" - ] - }, - "UpdateBranchRule": { - "methods": [ - "update_branch_rule" - ] - }, - "DeleteBranchRule": { - "methods": [ - "delete_branch_rule" - ] - }, - "CreatePullRequest": { - "methods": [ - "create_pull_request" - ] - }, - "GetPullRequest": { - "methods": [ - "get_pull_request" - ] - }, - "ListPullRequests": { - "methods": [ - "list_pull_requests" - ] - }, - "UpdatePullRequest": { - "methods": [ - "update_pull_request" - ] - }, - "MergePullRequest": { - "methods": [ - "merge_pull_request" - ] - }, - "OpenPullRequest": { - "methods": [ - "open_pull_request" - ] - }, - "ClosePullRequest": { - "methods": [ - "close_pull_request" - ] - }, - "ListPullRequestFileDiffs": { - "methods": [ - "list_pull_request_file_diffs" - ] - }, - "FetchTree": { - "methods": [ - "fetch_tree" - ] - }, - "FetchBlob": { - "methods": [ - "fetch_blob" - ] - }, - "CreateIssue": { - "methods": [ - "create_issue" - ] - }, - "GetIssue": { - "methods": [ - "get_issue" - ] - }, - "ListIssues": { - "methods": [ - "list_issues" - ] - }, - "UpdateIssue": { - "methods": [ - "update_issue" - ] - }, - "DeleteIssue": { - "methods": [ - "delete_issue" - ] - }, - "OpenIssue": { - "methods": [ - "open_issue" - ] - }, - "CloseIssue": { - "methods": [ - "close_issue" - ] - }, - "GetPullRequestComment": { - "methods": [ - "get_pull_request_comment" - ] - }, - "ListPullRequestComments": { - "methods": [ - "list_pull_request_comments" - ] - }, - "CreatePullRequestComment": { - "methods": [ - "create_pull_request_comment" - ] - }, - "UpdatePullRequestComment": { - "methods": [ - "update_pull_request_comment" - ] - }, - "DeletePullRequestComment": { - "methods": [ - "delete_pull_request_comment" - ] - }, - "BatchCreatePullRequestComments": { - "methods": [ - "batch_create_pull_request_comments" - ] - }, - "ResolvePullRequestComments": { - "methods": [ - "resolve_pull_request_comments" - ] - }, - "UnresolvePullRequestComments": { - "methods": [ - "unresolve_pull_request_comments" - ] - }, - "CreateIssueComment": { - "methods": [ - "create_issue_comment" - ] - }, - "GetIssueComment": { - "methods": [ - "get_issue_comment" - ] - }, - "ListIssueComments": { - "methods": [ - "list_issue_comments" - ] - }, - "UpdateIssueComment": { - "methods": [ - "update_issue_comment" - ] - }, - "DeleteIssueComment": { - "methods": [ - "delete_issue_comment" - ] - } - } - } - } - } - } -} diff --git a/owl-bot-staging/google-cloud-secure_source_manager-v1/google-cloud-secure_source_manager-v1.gemspec b/owl-bot-staging/google-cloud-secure_source_manager-v1/google-cloud-secure_source_manager-v1.gemspec deleted file mode 100644 index fc9c70a2668c..000000000000 --- a/owl-bot-staging/google-cloud-secure_source_manager-v1/google-cloud-secure_source_manager-v1.gemspec +++ /dev/null @@ -1,30 +0,0 @@ -# -*- ruby -*- -# encoding: utf-8 - -require File.expand_path("lib/google/cloud/secure_source_manager/v1/version", __dir__) - -Gem::Specification.new do |gem| - gem.name = "google-cloud-secure_source_manager-v1" - gem.version = Google::Cloud::SecureSourceManager::V1::VERSION - - gem.authors = ["Google LLC"] - gem.email = "googleapis-packages@google.com" - gem.description = "Regionally deployed, single-tenant managed source code repository hosted on Google Cloud. Note that google-cloud-secure_source_manager-v1 is a version-specific client library. For most uses, we recommend installing the main client library google-cloud-secure_source_manager instead. See the readme for more details." - gem.summary = "Regionally deployed, single-tenant managed source code repository hosted on Google Cloud." - 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" - gem.add_dependency "google-iam-v1", "~> 1.3" -end diff --git a/owl-bot-staging/google-cloud-secure_source_manager-v1/lib/google-cloud-secure_source_manager-v1.rb b/owl-bot-staging/google-cloud-secure_source_manager-v1/lib/google-cloud-secure_source_manager-v1.rb deleted file mode 100644 index 0de64e27e2a1..000000000000 --- a/owl-bot-staging/google-cloud-secure_source_manager-v1/lib/google-cloud-secure_source_manager-v1.rb +++ /dev/null @@ -1,21 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -# This gem does not autoload during Bundler.require. To load this gem, -# issue explicit require statements for the packages desired, e.g.: -# require "google/cloud/secure_source_manager/v1" diff --git a/owl-bot-staging/google-cloud-secure_source_manager-v1/lib/google/cloud/secure_source_manager/v1.rb b/owl-bot-staging/google-cloud-secure_source_manager-v1/lib/google/cloud/secure_source_manager/v1.rb deleted file mode 100644 index 34a35e7b08eb..000000000000 --- a/owl-bot-staging/google-cloud-secure_source_manager-v1/lib/google/cloud/secure_source_manager/v1.rb +++ /dev/null @@ -1,45 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -require "google/cloud/secure_source_manager/v1/secure_source_manager" -require "google/cloud/secure_source_manager/v1/version" - -module Google - module Cloud - module SecureSourceManager - ## - # API client module. - # - # @example Load this package, including all its services, and instantiate a gRPC client - # - # require "google/cloud/secure_source_manager/v1" - # client = ::Google::Cloud::SecureSourceManager::V1::SecureSourceManager::Client.new - # - # @example Load this package, including all its services, and instantiate a REST client - # - # require "google/cloud/secure_source_manager/v1" - # client = ::Google::Cloud::SecureSourceManager::V1::SecureSourceManager::Rest::Client.new - # - module V1 - end - end - end -end - -helper_path = ::File.join __dir__, "v1", "_helpers.rb" -require "google/cloud/secure_source_manager/v1/_helpers" if ::File.file? helper_path diff --git a/owl-bot-staging/google-cloud-secure_source_manager-v1/lib/google/cloud/secure_source_manager/v1/bindings_override.rb b/owl-bot-staging/google-cloud-secure_source_manager-v1/lib/google/cloud/secure_source_manager/v1/bindings_override.rb deleted file mode 100644 index 31599cbdad14..000000000000 --- a/owl-bot-staging/google-cloud-secure_source_manager-v1/lib/google/cloud/secure_source_manager/v1/bindings_override.rb +++ /dev/null @@ -1,108 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -require "gapic/rest" - -module Google - module Cloud - module SecureSourceManager - ## - # @example Loading just the REST part of this package, including all its services, and instantiating a REST client - # - # require "google/cloud/secure_source_manager/v1/rest" - # client = ::Google::Cloud::SecureSourceManager::V1::SecureSourceManager::Rest::Client.new - # - module V1 - ## - # @private - # Initialize the mixin bindings configuration - # - def self.configure - @configure ||= begin - namespace = ["Google", "Cloud", "SecureSourceManager"] - parent_config = while namespace.any? - parent_name = namespace.join "::" - parent_const = const_get parent_name - break parent_const.configure if parent_const.respond_to? :configure - namespace.pop - end - - default_config = ::Gapic::Rest::HttpBindingOverrideConfiguration.new parent_config - default_config.bindings_override["google.cloud.location.Locations.GetLocation"] = [ - Gapic::Rest::GrpcTranscoder::HttpBinding.create_with_validation( - uri_method: :get, - uri_template: "/v1/{name}", - matches: [ - ["name", %r{^projects/[^/]+/locations/[^/]+/?$}, false] - ], - body: nil - ) - ] - default_config.bindings_override["google.cloud.location.Locations.ListLocations"] = [ - - Gapic::Rest::GrpcTranscoder::HttpBinding.create_with_validation( - uri_method: :get, - uri_template: "/v1/{name}/locations", - matches: [ - ["name", %r{^projects/[^/]+/?$}, false] - ], - body: nil - ) - ] - default_config.bindings_override["google.iam.v1.IAMPolicy.GetIamPolicy"] = [ - - Gapic::Rest::GrpcTranscoder::HttpBinding.create_with_validation( - uri_method: :get, - uri_template: "/v1/{resource}:getIamPolicy", - matches: [ - ["resource", %r{^projects/[^/]+/locations/[^/]+/instances/[^/]+/?$}, false] - ], - body: nil - ) - ] - default_config.bindings_override["google.iam.v1.IAMPolicy.SetIamPolicy"] = [ - - Gapic::Rest::GrpcTranscoder::HttpBinding.create_with_validation( - uri_method: :post, - uri_template: "/v1/{resource}:setIamPolicy", - matches: [ - ["resource", %r{^projects/[^/]+/locations/[^/]+/instances/[^/]+/?$}, false] - ], - body: "*" - ) - ] - default_config.bindings_override["google.iam.v1.IAMPolicy.TestIamPermissions"] = [ - - Gapic::Rest::GrpcTranscoder::HttpBinding.create_with_validation( - uri_method: :post, - uri_template: "/v1/{resource}:testIamPermissions", - matches: [ - ["resource", %r{^projects/[^/]+/locations/[^/]+/instances/[^/]+/?$}, false] - ], - body: "*" - ) - ] - default_config - end - yield @configure if block_given? - @configure - end - end - end - end -end diff --git a/owl-bot-staging/google-cloud-secure_source_manager-v1/lib/google/cloud/secure_source_manager/v1/rest.rb b/owl-bot-staging/google-cloud-secure_source_manager-v1/lib/google/cloud/secure_source_manager/v1/rest.rb deleted file mode 100644 index 8696eba4fdff..000000000000 --- a/owl-bot-staging/google-cloud-secure_source_manager-v1/lib/google/cloud/secure_source_manager/v1/rest.rb +++ /dev/null @@ -1,38 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -require "google/cloud/secure_source_manager/v1/secure_source_manager/rest" -require "google/cloud/secure_source_manager/v1/bindings_override" -require "google/cloud/secure_source_manager/v1/version" - -module Google - module Cloud - module SecureSourceManager - ## - # To load just the REST part of this package, including all its services, and instantiate a REST client: - # - # @example - # - # require "google/cloud/secure_source_manager/v1/rest" - # client = ::Google::Cloud::SecureSourceManager::V1::SecureSourceManager::Rest::Client.new - # - module V1 - end - end - end -end diff --git a/owl-bot-staging/google-cloud-secure_source_manager-v1/lib/google/cloud/secure_source_manager/v1/secure_source_manager.rb b/owl-bot-staging/google-cloud-secure_source_manager-v1/lib/google/cloud/secure_source_manager/v1/secure_source_manager.rb deleted file mode 100644 index b4982af54739..000000000000 --- a/owl-bot-staging/google-cloud-secure_source_manager-v1/lib/google/cloud/secure_source_manager/v1/secure_source_manager.rb +++ /dev/null @@ -1,58 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -require "gapic/common" -require "gapic/config" -require "gapic/config/method" - -require "google/cloud/secure_source_manager/v1/version" - -require "google/cloud/secure_source_manager/v1/secure_source_manager/credentials" -require "google/cloud/secure_source_manager/v1/secure_source_manager/paths" -require "google/cloud/secure_source_manager/v1/secure_source_manager/operations" -require "google/cloud/secure_source_manager/v1/secure_source_manager/client" -require "google/cloud/secure_source_manager/v1/secure_source_manager/rest" - -module Google - module Cloud - module SecureSourceManager - module V1 - ## - # Secure Source Manager API - # - # Access Secure Source Manager instances, resources, and repositories. - # - # @example Load this service and instantiate a gRPC client - # - # require "google/cloud/secure_source_manager/v1/secure_source_manager" - # client = ::Google::Cloud::SecureSourceManager::V1::SecureSourceManager::Client.new - # - # @example Load this service and instantiate a REST client - # - # require "google/cloud/secure_source_manager/v1/secure_source_manager/rest" - # client = ::Google::Cloud::SecureSourceManager::V1::SecureSourceManager::Rest::Client.new - # - module SecureSourceManager - end - end - end - end -end - -helper_path = ::File.join __dir__, "secure_source_manager", "helpers.rb" -require "google/cloud/secure_source_manager/v1/secure_source_manager/helpers" if ::File.file? helper_path diff --git a/owl-bot-staging/google-cloud-secure_source_manager-v1/lib/google/cloud/secure_source_manager/v1/secure_source_manager/client.rb b/owl-bot-staging/google-cloud-secure_source_manager-v1/lib/google/cloud/secure_source_manager/v1/secure_source_manager/client.rb deleted file mode 100644 index d9d6be8b3d2d..000000000000 --- a/owl-bot-staging/google-cloud-secure_source_manager-v1/lib/google/cloud/secure_source_manager/v1/secure_source_manager/client.rb +++ /dev/null @@ -1,5877 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -require "google/cloud/errors" -require "google/cloud/securesourcemanager/v1/secure_source_manager_pb" -require "google/cloud/location" -require "google/iam/v1" - -module Google - module Cloud - module SecureSourceManager - module V1 - module SecureSourceManager - ## - # Client for the SecureSourceManager service. - # - # Secure Source Manager API - # - # Access Secure Source Manager instances, resources, and repositories. - # - class Client - # @private - API_VERSION = "" - - # @private - DEFAULT_ENDPOINT_TEMPLATE = "securesourcemanager.$UNIVERSE_DOMAIN$" - - include Paths - - # @private - attr_reader :secure_source_manager_stub - - ## - # Configure the SecureSourceManager Client class. - # - # See {::Google::Cloud::SecureSourceManager::V1::SecureSourceManager::Client::Configuration} - # for a description of the configuration fields. - # - # @example - # - # # Modify the configuration for all SecureSourceManager clients - # ::Google::Cloud::SecureSourceManager::V1::SecureSourceManager::Client.configure do |config| - # config.timeout = 10.0 - # end - # - # @yield [config] Configure the Client client. - # @yieldparam config [Client::Configuration] - # - # @return [Client::Configuration] - # - def self.configure - @configure ||= begin - namespace = ["Google", "Cloud", "SecureSourceManager", "V1"] - parent_config = while namespace.any? - parent_name = namespace.join "::" - parent_const = const_get parent_name - break parent_const.configure if parent_const.respond_to? :configure - namespace.pop - end - default_config = Client::Configuration.new parent_config - - default_config.rpcs.list_instances.timeout = 60.0 - default_config.rpcs.list_instances.retry_policy = { - initial_delay: 1.0, max_delay: 10.0, multiplier: 1.3, retry_codes: [14] - } - - default_config.rpcs.get_instance.timeout = 60.0 - default_config.rpcs.get_instance.retry_policy = { - initial_delay: 1.0, max_delay: 10.0, multiplier: 1.3, retry_codes: [14] - } - - default_config.rpcs.list_repositories.timeout = 60.0 - default_config.rpcs.list_repositories.retry_policy = { - initial_delay: 1.0, max_delay: 10.0, multiplier: 1.3, retry_codes: [14] - } - - default_config.rpcs.get_repository.timeout = 60.0 - default_config.rpcs.get_repository.retry_policy = { - initial_delay: 1.0, max_delay: 10.0, multiplier: 1.3, retry_codes: [14] - } - - default_config.rpcs.get_iam_policy_repo.timeout = 60.0 - default_config.rpcs.get_iam_policy_repo.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 SecureSourceManager Client instance. - # - # The configuration is set to the derived mode, meaning that values can be changed, - # but structural changes (adding new fields, etc.) are not allowed. Structural changes - # should be made on {Client.configure}. - # - # See {::Google::Cloud::SecureSourceManager::V1::SecureSourceManager::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 - @secure_source_manager_stub.universe_domain - end - - ## - # Create a new SecureSourceManager client object. - # - # @example - # - # # Create a client using the default configuration - # client = ::Google::Cloud::SecureSourceManager::V1::SecureSourceManager::Client.new - # - # # Create a client using a custom configuration - # client = ::Google::Cloud::SecureSourceManager::V1::SecureSourceManager::Client.new do |config| - # config.timeout = 10.0 - # end - # - # @yield [config] Configure the SecureSourceManager client. - # @yieldparam config [Client::Configuration] - # - def initialize - # These require statements are intentionally placed here to initialize - # the gRPC module only when it's required. - # See https://github.com/googleapis/toolkit/issues/446 - require "gapic/grpc" - require "google/cloud/securesourcemanager/v1/secure_source_manager_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 - - @secure_source_manager_stub = ::Gapic::ServiceStub.new( - ::Google::Cloud::SecureSourceManager::V1::SecureSourceManager::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 - ) - - @secure_source_manager_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 = @secure_source_manager_stub.endpoint - config.universe_domain = @secure_source_manager_stub.universe_domain - config.logger = @secure_source_manager_stub.logger if config.respond_to? :logger= - end - - @iam_policy_client = Google::Iam::V1::IAMPolicy::Client.new do |config| - config.credentials = credentials - config.quota_project = @quota_project_id - config.endpoint = @secure_source_manager_stub.endpoint - config.universe_domain = @secure_source_manager_stub.universe_domain - config.logger = @secure_source_manager_stub.logger if config.respond_to? :logger= - end - end - - ## - # Get the associated client for long-running operations. - # - # @return [::Google::Cloud::SecureSourceManager::V1::SecureSourceManager::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 - - ## - # Get the associated client for mix-in of the IAMPolicy. - # - # @return [Google::Iam::V1::IAMPolicy::Client] - # - attr_reader :iam_policy_client - - ## - # The logger used for request/response debug logging. - # - # @return [Logger] - # - def logger - @secure_source_manager_stub.logger - end - - # Service calls - - ## - # Lists Instances in a given project and location. - # - # @overload list_instances(request, options = nil) - # Pass arguments to `list_instances` via a request object, either of type - # {::Google::Cloud::SecureSourceManager::V1::ListInstancesRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::SecureSourceManager::V1::ListInstancesRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_instances(parent: nil, page_size: nil, page_token: nil, filter: nil, order_by: nil) - # Pass arguments to `list_instances` via keyword arguments. Note that at - # least one keyword argument is 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. Parent value for ListInstancesRequest. - # @param page_size [::Integer] - # Requested page size. Server may return fewer items than requested. - # If unspecified, server will pick an appropriate default. - # @param page_token [::String] - # A token identifying a page of results the server should return. - # @param filter [::String] - # Filter for filtering results. - # @param order_by [::String] - # Hint for how to order the results. - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Gapic::PagedEnumerable<::Google::Cloud::SecureSourceManager::V1::Instance>] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Gapic::PagedEnumerable<::Google::Cloud::SecureSourceManager::V1::Instance>] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/cloud/secure_source_manager/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::SecureSourceManager::V1::SecureSourceManager::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::SecureSourceManager::V1::ListInstancesRequest.new - # - # # Call the list_instances method. - # result = client.list_instances request - # - # # The returned object is of type Gapic::PagedEnumerable. You can iterate - # # over elements, and API calls will be issued to fetch pages as needed. - # result.each do |item| - # # Each element is of type ::Google::Cloud::SecureSourceManager::V1::Instance. - # p item - # end - # - def list_instances request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::SecureSourceManager::V1::ListInstancesRequest - - # Converts hash 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_instances.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::SecureSourceManager::V1::VERSION - metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - header_params = {} - if request.parent - header_params["parent"] = request.parent - end - - request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") - metadata[:"x-goog-request-params"] ||= request_params_header - - options.apply_defaults timeout: @config.rpcs.list_instances.timeout, - metadata: metadata, - retry_policy: @config.rpcs.list_instances.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @secure_source_manager_stub.call_rpc :list_instances, request, options: options do |response, operation| - response = ::Gapic::PagedEnumerable.new @secure_source_manager_stub, :list_instances, request, response, operation, options - yield response, operation if block_given? - throw :response, response - end - rescue ::GRPC::BadStatus => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Gets details of a single instance. - # - # @overload get_instance(request, options = nil) - # Pass arguments to `get_instance` via a request object, either of type - # {::Google::Cloud::SecureSourceManager::V1::GetInstanceRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::SecureSourceManager::V1::GetInstanceRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_instance(name: nil) - # Pass arguments to `get_instance` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param name [::String] - # Required. Name of the resource. - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Google::Cloud::SecureSourceManager::V1::Instance] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Google::Cloud::SecureSourceManager::V1::Instance] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/cloud/secure_source_manager/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::SecureSourceManager::V1::SecureSourceManager::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::SecureSourceManager::V1::GetInstanceRequest.new - # - # # Call the get_instance method. - # result = client.get_instance request - # - # # The returned object is of type Google::Cloud::SecureSourceManager::V1::Instance. - # p result - # - def get_instance request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::SecureSourceManager::V1::GetInstanceRequest - - # Converts hash 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_instance.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::SecureSourceManager::V1::VERSION - metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - header_params = {} - if request.name - header_params["name"] = request.name - end - - request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") - metadata[:"x-goog-request-params"] ||= request_params_header - - options.apply_defaults timeout: @config.rpcs.get_instance.timeout, - metadata: metadata, - retry_policy: @config.rpcs.get_instance.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @secure_source_manager_stub.call_rpc :get_instance, request, options: options do |response, operation| - yield response, operation if block_given? - end - rescue ::GRPC::BadStatus => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Creates a new instance in a given project and location. - # - # @overload create_instance(request, options = nil) - # Pass arguments to `create_instance` via a request object, either of type - # {::Google::Cloud::SecureSourceManager::V1::CreateInstanceRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::SecureSourceManager::V1::CreateInstanceRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_instance(parent: nil, instance_id: nil, instance: nil, request_id: nil) - # Pass arguments to `create_instance` via keyword arguments. Note that at - # least one keyword argument is 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. Value for parent. - # @param instance_id [::String] - # Required. ID of the instance to be created. - # @param instance [::Google::Cloud::SecureSourceManager::V1::Instance, ::Hash] - # Required. The resource being created. - # @param request_id [::String] - # Optional. An optional request ID to identify requests. Specify a unique - # request ID so that if you must retry your request, the server will know to - # ignore the request if it has already been completed. The server will - # guarantee that for at least 60 minutes since the first request. - # - # For example, consider a situation where you make an initial request and - # the request times out. If you make the request again with the same request - # ID, the server can check if original operation with the same request ID - # was received, and if so, will ignore the second request. This prevents - # clients from accidentally creating duplicate commitments. - # - # The request ID must be a valid UUID with the exception that zero UUID is - # not supported (00000000-0000-0000-0000-000000000000). - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Gapic::Operation] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Gapic::Operation] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/cloud/secure_source_manager/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::SecureSourceManager::V1::SecureSourceManager::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::SecureSourceManager::V1::CreateInstanceRequest.new - # - # # Call the create_instance method. - # result = client.create_instance 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_instance request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::SecureSourceManager::V1::CreateInstanceRequest - - # Converts hash 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_instance.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::SecureSourceManager::V1::VERSION - metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - header_params = {} - if request.parent - header_params["parent"] = request.parent - end - - request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") - metadata[:"x-goog-request-params"] ||= request_params_header - - options.apply_defaults timeout: @config.rpcs.create_instance.timeout, - metadata: metadata, - retry_policy: @config.rpcs.create_instance.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @secure_source_manager_stub.call_rpc :create_instance, 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 single instance. - # - # @overload delete_instance(request, options = nil) - # Pass arguments to `delete_instance` via a request object, either of type - # {::Google::Cloud::SecureSourceManager::V1::DeleteInstanceRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::SecureSourceManager::V1::DeleteInstanceRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_instance(name: nil, request_id: nil) - # Pass arguments to `delete_instance` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param name [::String] - # Required. Name of the resource. - # @param request_id [::String] - # Optional. An optional request ID to identify requests. Specify a unique - # request ID so that if you must retry your request, the server will know to - # ignore the request if it has already been completed. The server will - # guarantee that for at least 60 minutes after the first request. - # - # For example, consider a situation where you make an initial request and - # the request times out. If you make the request again with the same request - # ID, the server can check if original operation with the same request ID - # was received, and if so, will ignore the second request. This prevents - # clients from accidentally creating duplicate commitments. - # - # The request ID must be a valid UUID with the exception that zero UUID is - # not supported (00000000-0000-0000-0000-000000000000). - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Gapic::Operation] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Gapic::Operation] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/cloud/secure_source_manager/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::SecureSourceManager::V1::SecureSourceManager::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::SecureSourceManager::V1::DeleteInstanceRequest.new - # - # # Call the delete_instance method. - # result = client.delete_instance 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_instance request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::SecureSourceManager::V1::DeleteInstanceRequest - - # Converts hash 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_instance.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::SecureSourceManager::V1::VERSION - metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - header_params = {} - if request.name - header_params["name"] = request.name - end - - request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") - metadata[:"x-goog-request-params"] ||= request_params_header - - options.apply_defaults timeout: @config.rpcs.delete_instance.timeout, - metadata: metadata, - retry_policy: @config.rpcs.delete_instance.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @secure_source_manager_stub.call_rpc :delete_instance, 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 Repositories in a given project and location. - # - # The instance field is required in the query parameter for requests using - # the securesourcemanager.googleapis.com endpoint. - # - # @overload list_repositories(request, options = nil) - # Pass arguments to `list_repositories` via a request object, either of type - # {::Google::Cloud::SecureSourceManager::V1::ListRepositoriesRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::SecureSourceManager::V1::ListRepositoriesRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_repositories(parent: nil, page_size: nil, page_token: nil, filter: nil, instance: nil) - # Pass arguments to `list_repositories` via keyword arguments. Note that at - # least one keyword argument is 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. Parent value for ListRepositoriesRequest. - # @param page_size [::Integer] - # Optional. Requested page size. Server may return fewer items than - # requested. If unspecified, server will pick an appropriate default. - # @param page_token [::String] - # A token identifying a page of results the server should return. - # @param filter [::String] - # Optional. Filter results. - # @param instance [::String] - # Optional. The name of the instance in which the repository is hosted, - # formatted as - # `projects/{project_number}/locations/{location_id}/instances/{instance_id}`. - # When listing repositories via securesourcemanager.googleapis.com, this - # field is required. When listing repositories via *.sourcemanager.dev, this - # field is ignored. - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Gapic::PagedEnumerable<::Google::Cloud::SecureSourceManager::V1::Repository>] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Gapic::PagedEnumerable<::Google::Cloud::SecureSourceManager::V1::Repository>] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/cloud/secure_source_manager/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::SecureSourceManager::V1::SecureSourceManager::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::SecureSourceManager::V1::ListRepositoriesRequest.new - # - # # Call the list_repositories method. - # result = client.list_repositories request - # - # # The returned object is of type Gapic::PagedEnumerable. You can iterate - # # over elements, and API calls will be issued to fetch pages as needed. - # result.each do |item| - # # Each element is of type ::Google::Cloud::SecureSourceManager::V1::Repository. - # p item - # end - # - def list_repositories request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::SecureSourceManager::V1::ListRepositoriesRequest - - # Converts hash 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_repositories.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::SecureSourceManager::V1::VERSION - metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - header_params = {} - if request.parent - header_params["parent"] = request.parent - end - - request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") - metadata[:"x-goog-request-params"] ||= request_params_header - - options.apply_defaults timeout: @config.rpcs.list_repositories.timeout, - metadata: metadata, - retry_policy: @config.rpcs.list_repositories.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @secure_source_manager_stub.call_rpc :list_repositories, request, options: options do |response, operation| - response = ::Gapic::PagedEnumerable.new @secure_source_manager_stub, :list_repositories, request, response, operation, options - yield response, operation if block_given? - throw :response, response - end - rescue ::GRPC::BadStatus => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Gets metadata of a repository. - # - # @overload get_repository(request, options = nil) - # Pass arguments to `get_repository` via a request object, either of type - # {::Google::Cloud::SecureSourceManager::V1::GetRepositoryRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::SecureSourceManager::V1::GetRepositoryRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_repository(name: nil) - # Pass arguments to `get_repository` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param name [::String] - # Required. Name of the repository to retrieve. - # The format is - # `projects/{project_number}/locations/{location_id}/repositories/{repository_id}`. - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Google::Cloud::SecureSourceManager::V1::Repository] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Google::Cloud::SecureSourceManager::V1::Repository] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/cloud/secure_source_manager/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::SecureSourceManager::V1::SecureSourceManager::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::SecureSourceManager::V1::GetRepositoryRequest.new - # - # # Call the get_repository method. - # result = client.get_repository request - # - # # The returned object is of type Google::Cloud::SecureSourceManager::V1::Repository. - # p result - # - def get_repository request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::SecureSourceManager::V1::GetRepositoryRequest - - # Converts hash 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_repository.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::SecureSourceManager::V1::VERSION - metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - header_params = {} - if request.name - header_params["name"] = request.name - end - - request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") - metadata[:"x-goog-request-params"] ||= request_params_header - - options.apply_defaults timeout: @config.rpcs.get_repository.timeout, - metadata: metadata, - retry_policy: @config.rpcs.get_repository.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @secure_source_manager_stub.call_rpc :get_repository, request, options: options do |response, operation| - yield response, operation if block_given? - end - rescue ::GRPC::BadStatus => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Creates a new repository in a given project and location. - # - # The Repository.Instance field is required in the request body for requests - # using the securesourcemanager.googleapis.com endpoint. - # - # @overload create_repository(request, options = nil) - # Pass arguments to `create_repository` via a request object, either of type - # {::Google::Cloud::SecureSourceManager::V1::CreateRepositoryRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::SecureSourceManager::V1::CreateRepositoryRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_repository(parent: nil, repository: nil, repository_id: nil) - # Pass arguments to `create_repository` via keyword arguments. Note that at - # least one keyword argument is 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 project in which to create the repository. Values are of the - # form `projects/{project_number}/locations/{location_id}` - # @param repository [::Google::Cloud::SecureSourceManager::V1::Repository, ::Hash] - # Required. The resource being created. - # @param repository_id [::String] - # Required. The ID to use for the repository, which will become the final - # component of the repository's resource name. This value should be 4-63 - # characters, and valid characters are /[a-z][0-9]-/. - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Gapic::Operation] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Gapic::Operation] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/cloud/secure_source_manager/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::SecureSourceManager::V1::SecureSourceManager::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::SecureSourceManager::V1::CreateRepositoryRequest.new - # - # # Call the create_repository method. - # result = client.create_repository 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_repository request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::SecureSourceManager::V1::CreateRepositoryRequest - - # Converts hash 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_repository.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::SecureSourceManager::V1::VERSION - metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - header_params = {} - if request.parent - header_params["parent"] = request.parent - end - - request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") - metadata[:"x-goog-request-params"] ||= request_params_header - - options.apply_defaults timeout: @config.rpcs.create_repository.timeout, - metadata: metadata, - retry_policy: @config.rpcs.create_repository.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @secure_source_manager_stub.call_rpc :create_repository, request, options: options do |response, operation| - response = ::Gapic::Operation.new response, @operations_client, options: options - yield response, operation if block_given? - throw :response, response - end - rescue ::GRPC::BadStatus => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Updates the metadata of a repository. - # - # @overload update_repository(request, options = nil) - # Pass arguments to `update_repository` via a request object, either of type - # {::Google::Cloud::SecureSourceManager::V1::UpdateRepositoryRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::SecureSourceManager::V1::UpdateRepositoryRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_repository(update_mask: nil, repository: nil, validate_only: nil) - # Pass arguments to `update_repository` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param update_mask [::Google::Protobuf::FieldMask, ::Hash] - # Optional. Field mask is used to specify the fields to be overwritten in the - # repository resource by the update. - # The fields specified in the update_mask are relative to the resource, not - # the full request. A field will be overwritten if it is in the mask. If the - # user does not provide a mask then all fields will be overwritten. - # @param repository [::Google::Cloud::SecureSourceManager::V1::Repository, ::Hash] - # Required. The repository being updated. - # @param validate_only [::Boolean] - # Optional. False by default. If set to true, the request is validated and - # the user is provided with an expected result, but no actual change is made. - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Gapic::Operation] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Gapic::Operation] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/cloud/secure_source_manager/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::SecureSourceManager::V1::SecureSourceManager::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::SecureSourceManager::V1::UpdateRepositoryRequest.new - # - # # Call the update_repository method. - # result = client.update_repository 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_repository request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::SecureSourceManager::V1::UpdateRepositoryRequest - - # Converts hash 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_repository.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::SecureSourceManager::V1::VERSION - metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - header_params = {} - if request.repository&.name - header_params["repository.name"] = request.repository.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_repository.timeout, - metadata: metadata, - retry_policy: @config.rpcs.update_repository.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @secure_source_manager_stub.call_rpc :update_repository, 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 Repository. - # - # @overload delete_repository(request, options = nil) - # Pass arguments to `delete_repository` via a request object, either of type - # {::Google::Cloud::SecureSourceManager::V1::DeleteRepositoryRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::SecureSourceManager::V1::DeleteRepositoryRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_repository(name: nil, allow_missing: nil) - # Pass arguments to `delete_repository` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param name [::String] - # Required. Name of the repository to delete. - # The format is - # `projects/{project_number}/locations/{location_id}/repositories/{repository_id}`. - # @param allow_missing [::Boolean] - # Optional. If set to true, and the repository is not found, the request will - # succeed but no action will be taken on the server. - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Gapic::Operation] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Gapic::Operation] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/cloud/secure_source_manager/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::SecureSourceManager::V1::SecureSourceManager::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::SecureSourceManager::V1::DeleteRepositoryRequest.new - # - # # Call the delete_repository method. - # result = client.delete_repository 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_repository request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::SecureSourceManager::V1::DeleteRepositoryRequest - - # Converts hash 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_repository.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::SecureSourceManager::V1::VERSION - metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - header_params = {} - if request.name - header_params["name"] = request.name - end - - request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") - metadata[:"x-goog-request-params"] ||= request_params_header - - options.apply_defaults timeout: @config.rpcs.delete_repository.timeout, - metadata: metadata, - retry_policy: @config.rpcs.delete_repository.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @secure_source_manager_stub.call_rpc :delete_repository, 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 hooks in a given repository. - # - # @overload list_hooks(request, options = nil) - # Pass arguments to `list_hooks` via a request object, either of type - # {::Google::Cloud::SecureSourceManager::V1::ListHooksRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::SecureSourceManager::V1::ListHooksRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_hooks(parent: nil, page_size: nil, page_token: nil) - # Pass arguments to `list_hooks` via keyword arguments. Note that at - # least one keyword argument is 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. Parent value for ListHooksRequest. - # @param page_size [::Integer] - # Optional. Requested page size. Server may return fewer items than - # requested. If unspecified, server will pick an appropriate default. - # @param page_token [::String] - # Optional. A token identifying a page of results the server should return. - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Gapic::PagedEnumerable<::Google::Cloud::SecureSourceManager::V1::Hook>] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Gapic::PagedEnumerable<::Google::Cloud::SecureSourceManager::V1::Hook>] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/cloud/secure_source_manager/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::SecureSourceManager::V1::SecureSourceManager::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::SecureSourceManager::V1::ListHooksRequest.new - # - # # Call the list_hooks method. - # result = client.list_hooks request - # - # # The returned object is of type Gapic::PagedEnumerable. You can iterate - # # over elements, and API calls will be issued to fetch pages as needed. - # result.each do |item| - # # Each element is of type ::Google::Cloud::SecureSourceManager::V1::Hook. - # p item - # end - # - def list_hooks request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::SecureSourceManager::V1::ListHooksRequest - - # Converts hash 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_hooks.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::SecureSourceManager::V1::VERSION - metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - header_params = {} - if request.parent - header_params["parent"] = request.parent - end - - request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") - metadata[:"x-goog-request-params"] ||= request_params_header - - options.apply_defaults timeout: @config.rpcs.list_hooks.timeout, - metadata: metadata, - retry_policy: @config.rpcs.list_hooks.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @secure_source_manager_stub.call_rpc :list_hooks, request, options: options do |response, operation| - response = ::Gapic::PagedEnumerable.new @secure_source_manager_stub, :list_hooks, request, response, operation, options - yield response, operation if block_given? - throw :response, response - end - rescue ::GRPC::BadStatus => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Gets metadata of a hook. - # - # @overload get_hook(request, options = nil) - # Pass arguments to `get_hook` via a request object, either of type - # {::Google::Cloud::SecureSourceManager::V1::GetHookRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::SecureSourceManager::V1::GetHookRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_hook(name: nil) - # Pass arguments to `get_hook` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param name [::String] - # Required. Name of the hook to retrieve. - # The format is - # `projects/{project_number}/locations/{location_id}/repositories/{repository_id}/hooks/{hook_id}`. - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Google::Cloud::SecureSourceManager::V1::Hook] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Google::Cloud::SecureSourceManager::V1::Hook] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/cloud/secure_source_manager/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::SecureSourceManager::V1::SecureSourceManager::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::SecureSourceManager::V1::GetHookRequest.new - # - # # Call the get_hook method. - # result = client.get_hook request - # - # # The returned object is of type Google::Cloud::SecureSourceManager::V1::Hook. - # p result - # - def get_hook request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::SecureSourceManager::V1::GetHookRequest - - # Converts hash 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_hook.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::SecureSourceManager::V1::VERSION - metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - header_params = {} - if request.name - header_params["name"] = request.name - end - - request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") - metadata[:"x-goog-request-params"] ||= request_params_header - - options.apply_defaults timeout: @config.rpcs.get_hook.timeout, - metadata: metadata, - retry_policy: @config.rpcs.get_hook.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @secure_source_manager_stub.call_rpc :get_hook, request, options: options do |response, operation| - yield response, operation if block_given? - end - rescue ::GRPC::BadStatus => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Creates a new hook in a given repository. - # - # @overload create_hook(request, options = nil) - # Pass arguments to `create_hook` via a request object, either of type - # {::Google::Cloud::SecureSourceManager::V1::CreateHookRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::SecureSourceManager::V1::CreateHookRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_hook(parent: nil, hook: nil, hook_id: nil) - # Pass arguments to `create_hook` via keyword arguments. Note that at - # least one keyword argument is 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 repository in which to create the hook. Values are of the - # form - # `projects/{project_number}/locations/{location_id}/repositories/{repository_id}` - # @param hook [::Google::Cloud::SecureSourceManager::V1::Hook, ::Hash] - # Required. The resource being created. - # @param hook_id [::String] - # Required. The ID to use for the hook, which will become the final component - # of the hook's resource name. This value restricts to lower-case letters, - # numbers, and hyphen, with the first character a letter, the last a letter - # or a number, and a 63 character maximum. - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Gapic::Operation] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Gapic::Operation] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/cloud/secure_source_manager/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::SecureSourceManager::V1::SecureSourceManager::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::SecureSourceManager::V1::CreateHookRequest.new - # - # # Call the create_hook method. - # result = client.create_hook 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_hook request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::SecureSourceManager::V1::CreateHookRequest - - # Converts hash 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_hook.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::SecureSourceManager::V1::VERSION - metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - header_params = {} - if request.parent - header_params["parent"] = request.parent - end - - request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") - metadata[:"x-goog-request-params"] ||= request_params_header - - options.apply_defaults timeout: @config.rpcs.create_hook.timeout, - metadata: metadata, - retry_policy: @config.rpcs.create_hook.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @secure_source_manager_stub.call_rpc :create_hook, request, options: options do |response, operation| - response = ::Gapic::Operation.new response, @operations_client, options: options - yield response, operation if block_given? - throw :response, response - end - rescue ::GRPC::BadStatus => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Updates the metadata of a hook. - # - # @overload update_hook(request, options = nil) - # Pass arguments to `update_hook` via a request object, either of type - # {::Google::Cloud::SecureSourceManager::V1::UpdateHookRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::SecureSourceManager::V1::UpdateHookRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_hook(update_mask: nil, hook: nil) - # Pass arguments to `update_hook` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param update_mask [::Google::Protobuf::FieldMask, ::Hash] - # Required. Field mask is used to specify the fields to be overwritten in the - # hook resource by the update. - # The fields specified in the update_mask are relative to the resource, not - # the full request. A field will be overwritten if it is in the mask. - # The special value "*" means full replacement. - # @param hook [::Google::Cloud::SecureSourceManager::V1::Hook, ::Hash] - # Required. The hook being updated. - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Gapic::Operation] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Gapic::Operation] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/cloud/secure_source_manager/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::SecureSourceManager::V1::SecureSourceManager::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::SecureSourceManager::V1::UpdateHookRequest.new - # - # # Call the update_hook method. - # result = client.update_hook 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_hook request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::SecureSourceManager::V1::UpdateHookRequest - - # Converts hash 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_hook.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::SecureSourceManager::V1::VERSION - metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - header_params = {} - if request.hook&.name - header_params["hook.name"] = request.hook.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_hook.timeout, - metadata: metadata, - retry_policy: @config.rpcs.update_hook.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @secure_source_manager_stub.call_rpc :update_hook, 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 Hook. - # - # @overload delete_hook(request, options = nil) - # Pass arguments to `delete_hook` via a request object, either of type - # {::Google::Cloud::SecureSourceManager::V1::DeleteHookRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::SecureSourceManager::V1::DeleteHookRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_hook(name: nil) - # Pass arguments to `delete_hook` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param name [::String] - # Required. Name of the hook to delete. - # The format is - # `projects/{project_number}/locations/{location_id}/repositories/{repository_id}/hooks/{hook_id}`. - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Gapic::Operation] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Gapic::Operation] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/cloud/secure_source_manager/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::SecureSourceManager::V1::SecureSourceManager::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::SecureSourceManager::V1::DeleteHookRequest.new - # - # # Call the delete_hook method. - # result = client.delete_hook 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_hook request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::SecureSourceManager::V1::DeleteHookRequest - - # Converts hash 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_hook.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::SecureSourceManager::V1::VERSION - metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - header_params = {} - if request.name - header_params["name"] = request.name - end - - request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") - metadata[:"x-goog-request-params"] ||= request_params_header - - options.apply_defaults timeout: @config.rpcs.delete_hook.timeout, - metadata: metadata, - retry_policy: @config.rpcs.delete_hook.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @secure_source_manager_stub.call_rpc :delete_hook, 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 - - ## - # Get IAM policy for a repository. - # - # @overload get_iam_policy_repo(request, options = nil) - # Pass arguments to `get_iam_policy_repo` via a request object, either of type - # {::Google::Iam::V1::GetIamPolicyRequest} or an equivalent Hash. - # - # @param request [::Google::Iam::V1::GetIamPolicyRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. - # - # @overload get_iam_policy_repo(resource: nil, options: nil) - # Pass arguments to `get_iam_policy_repo` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param resource [::String] - # REQUIRED: The resource for which the policy is being requested. - # See the operation documentation for the appropriate value for this field. - # @param options [::Google::Iam::V1::GetPolicyOptions, ::Hash] - # OPTIONAL: A `GetPolicyOptions` object for specifying options to - # `GetIamPolicy`. - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Google::Iam::V1::Policy] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Google::Iam::V1::Policy] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/cloud/secure_source_manager/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::SecureSourceManager::V1::SecureSourceManager::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Iam::V1::GetIamPolicyRequest.new - # - # # Call the get_iam_policy_repo method. - # result = client.get_iam_policy_repo request - # - # # The returned object is of type Google::Iam::V1::Policy. - # p result - # - def get_iam_policy_repo request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Iam::V1::GetIamPolicyRequest - - # Converts hash and nil to an options object - options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h - - # Customize the options with defaults - metadata = @config.rpcs.get_iam_policy_repo.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::SecureSourceManager::V1::VERSION - metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - header_params = {} - if request.resource - header_params["resource"] = request.resource - end - - request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") - metadata[:"x-goog-request-params"] ||= request_params_header - - options.apply_defaults timeout: @config.rpcs.get_iam_policy_repo.timeout, - metadata: metadata, - retry_policy: @config.rpcs.get_iam_policy_repo.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @secure_source_manager_stub.call_rpc :get_iam_policy_repo, 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 - - ## - # Set IAM policy on a repository. - # - # @overload set_iam_policy_repo(request, options = nil) - # Pass arguments to `set_iam_policy_repo` via a request object, either of type - # {::Google::Iam::V1::SetIamPolicyRequest} or an equivalent Hash. - # - # @param request [::Google::Iam::V1::SetIamPolicyRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. - # - # @overload set_iam_policy_repo(resource: nil, policy: nil, update_mask: nil) - # Pass arguments to `set_iam_policy_repo` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param resource [::String] - # REQUIRED: The resource for which the policy is being specified. - # See the operation documentation for the appropriate value for this field. - # @param policy [::Google::Iam::V1::Policy, ::Hash] - # REQUIRED: The complete policy to be applied to the `resource`. The size of - # the policy is limited to a few 10s of KB. An empty policy is a - # valid policy but certain Cloud Platform services (such as Projects) - # might reject them. - # @param update_mask [::Google::Protobuf::FieldMask, ::Hash] - # OPTIONAL: A FieldMask specifying which fields of the policy to modify. Only - # the fields in the mask will be modified. If no mask is provided, the - # following default mask is used: - # - # `paths: "bindings, etag"` - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Google::Iam::V1::Policy] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Google::Iam::V1::Policy] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/cloud/secure_source_manager/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::SecureSourceManager::V1::SecureSourceManager::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Iam::V1::SetIamPolicyRequest.new - # - # # Call the set_iam_policy_repo method. - # result = client.set_iam_policy_repo request - # - # # The returned object is of type Google::Iam::V1::Policy. - # p result - # - def set_iam_policy_repo request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Iam::V1::SetIamPolicyRequest - - # Converts hash and nil to an options object - options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h - - # Customize the options with defaults - metadata = @config.rpcs.set_iam_policy_repo.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::SecureSourceManager::V1::VERSION - metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - header_params = {} - if request.resource - header_params["resource"] = request.resource - end - - request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") - metadata[:"x-goog-request-params"] ||= request_params_header - - options.apply_defaults timeout: @config.rpcs.set_iam_policy_repo.timeout, - metadata: metadata, - retry_policy: @config.rpcs.set_iam_policy_repo.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @secure_source_manager_stub.call_rpc :set_iam_policy_repo, 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 - - ## - # Test IAM permissions on a repository. - # IAM permission checks are not required on this method. - # - # @overload test_iam_permissions_repo(request, options = nil) - # Pass arguments to `test_iam_permissions_repo` via a request object, either of type - # {::Google::Iam::V1::TestIamPermissionsRequest} or an equivalent Hash. - # - # @param request [::Google::Iam::V1::TestIamPermissionsRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. - # - # @overload test_iam_permissions_repo(resource: nil, permissions: nil) - # Pass arguments to `test_iam_permissions_repo` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param resource [::String] - # REQUIRED: The resource for which the policy detail is being requested. - # See the operation documentation for the appropriate value for this field. - # @param permissions [::Array<::String>] - # The set of permissions to check for the `resource`. Permissions with - # wildcards (such as '*' or 'storage.*') are not allowed. For more - # information see - # [IAM Overview](https://cloud.google.com/iam/docs/overview#permissions). - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Google::Iam::V1::TestIamPermissionsResponse] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Google::Iam::V1::TestIamPermissionsResponse] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/cloud/secure_source_manager/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::SecureSourceManager::V1::SecureSourceManager::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Iam::V1::TestIamPermissionsRequest.new - # - # # Call the test_iam_permissions_repo method. - # result = client.test_iam_permissions_repo request - # - # # The returned object is of type Google::Iam::V1::TestIamPermissionsResponse. - # p result - # - def test_iam_permissions_repo request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Iam::V1::TestIamPermissionsRequest - - # Converts hash and nil to an options object - options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h - - # Customize the options with defaults - metadata = @config.rpcs.test_iam_permissions_repo.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::SecureSourceManager::V1::VERSION - metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - header_params = {} - if request.resource - header_params["resource"] = request.resource - end - - request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") - metadata[:"x-goog-request-params"] ||= request_params_header - - options.apply_defaults timeout: @config.rpcs.test_iam_permissions_repo.timeout, - metadata: metadata, - retry_policy: @config.rpcs.test_iam_permissions_repo.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @secure_source_manager_stub.call_rpc :test_iam_permissions_repo, 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 - - ## - # CreateBranchRule creates a branch rule in a given repository. - # - # @overload create_branch_rule(request, options = nil) - # Pass arguments to `create_branch_rule` via a request object, either of type - # {::Google::Cloud::SecureSourceManager::V1::CreateBranchRuleRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::SecureSourceManager::V1::CreateBranchRuleRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_branch_rule(parent: nil, branch_rule: nil, branch_rule_id: nil) - # Pass arguments to `create_branch_rule` via keyword arguments. Note that at - # least one keyword argument is 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] - # @param branch_rule [::Google::Cloud::SecureSourceManager::V1::BranchRule, ::Hash] - # @param branch_rule_id [::String] - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Gapic::Operation] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Gapic::Operation] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/cloud/secure_source_manager/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::SecureSourceManager::V1::SecureSourceManager::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::SecureSourceManager::V1::CreateBranchRuleRequest.new - # - # # Call the create_branch_rule method. - # result = client.create_branch_rule 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_branch_rule request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::SecureSourceManager::V1::CreateBranchRuleRequest - - # Converts hash 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_branch_rule.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::SecureSourceManager::V1::VERSION - metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - header_params = {} - if request.parent - header_params["parent"] = request.parent - end - - request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") - metadata[:"x-goog-request-params"] ||= request_params_header - - options.apply_defaults timeout: @config.rpcs.create_branch_rule.timeout, - metadata: metadata, - retry_policy: @config.rpcs.create_branch_rule.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @secure_source_manager_stub.call_rpc :create_branch_rule, 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 - - ## - # ListBranchRules lists branch rules in a given repository. - # - # @overload list_branch_rules(request, options = nil) - # Pass arguments to `list_branch_rules` via a request object, either of type - # {::Google::Cloud::SecureSourceManager::V1::ListBranchRulesRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::SecureSourceManager::V1::ListBranchRulesRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_branch_rules(parent: nil, page_size: nil, page_token: nil) - # Pass arguments to `list_branch_rules` via keyword arguments. Note that at - # least one keyword argument is 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] - # @param page_size [::Integer] - # @param page_token [::String] - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Gapic::PagedEnumerable<::Google::Cloud::SecureSourceManager::V1::BranchRule>] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Gapic::PagedEnumerable<::Google::Cloud::SecureSourceManager::V1::BranchRule>] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/cloud/secure_source_manager/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::SecureSourceManager::V1::SecureSourceManager::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::SecureSourceManager::V1::ListBranchRulesRequest.new - # - # # Call the list_branch_rules method. - # result = client.list_branch_rules request - # - # # The returned object is of type Gapic::PagedEnumerable. You can iterate - # # over elements, and API calls will be issued to fetch pages as needed. - # result.each do |item| - # # Each element is of type ::Google::Cloud::SecureSourceManager::V1::BranchRule. - # p item - # end - # - def list_branch_rules request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::SecureSourceManager::V1::ListBranchRulesRequest - - # Converts hash 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_branch_rules.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::SecureSourceManager::V1::VERSION - metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - header_params = {} - if request.parent - header_params["parent"] = request.parent - end - - request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") - metadata[:"x-goog-request-params"] ||= request_params_header - - options.apply_defaults timeout: @config.rpcs.list_branch_rules.timeout, - metadata: metadata, - retry_policy: @config.rpcs.list_branch_rules.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @secure_source_manager_stub.call_rpc :list_branch_rules, request, options: options do |response, operation| - response = ::Gapic::PagedEnumerable.new @secure_source_manager_stub, :list_branch_rules, 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 - - ## - # GetBranchRule gets a branch rule. - # - # @overload get_branch_rule(request, options = nil) - # Pass arguments to `get_branch_rule` via a request object, either of type - # {::Google::Cloud::SecureSourceManager::V1::GetBranchRuleRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::SecureSourceManager::V1::GetBranchRuleRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_branch_rule(name: nil) - # Pass arguments to `get_branch_rule` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param name [::String] - # Required. Name of the repository to retrieve. - # The format is - # `projects/{project}/locations/{location}/repositories/{repository}/branchRules/{branch_rule}`. - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Google::Cloud::SecureSourceManager::V1::BranchRule] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Google::Cloud::SecureSourceManager::V1::BranchRule] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/cloud/secure_source_manager/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::SecureSourceManager::V1::SecureSourceManager::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::SecureSourceManager::V1::GetBranchRuleRequest.new - # - # # Call the get_branch_rule method. - # result = client.get_branch_rule request - # - # # The returned object is of type Google::Cloud::SecureSourceManager::V1::BranchRule. - # p result - # - def get_branch_rule request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::SecureSourceManager::V1::GetBranchRuleRequest - - # Converts hash 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_branch_rule.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::SecureSourceManager::V1::VERSION - metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - header_params = {} - if request.name - header_params["name"] = request.name - end - - request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") - metadata[:"x-goog-request-params"] ||= request_params_header - - options.apply_defaults timeout: @config.rpcs.get_branch_rule.timeout, - metadata: metadata, - retry_policy: @config.rpcs.get_branch_rule.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @secure_source_manager_stub.call_rpc :get_branch_rule, 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 - - ## - # UpdateBranchRule updates a branch rule. - # - # @overload update_branch_rule(request, options = nil) - # Pass arguments to `update_branch_rule` via a request object, either of type - # {::Google::Cloud::SecureSourceManager::V1::UpdateBranchRuleRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::SecureSourceManager::V1::UpdateBranchRuleRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_branch_rule(branch_rule: nil, validate_only: nil, update_mask: nil) - # Pass arguments to `update_branch_rule` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param branch_rule [::Google::Cloud::SecureSourceManager::V1::BranchRule, ::Hash] - # @param validate_only [::Boolean] - # Optional. If set, validate the request and preview the review, but do not - # actually post it. (https://google.aip.dev/163, for declarative friendly) - # @param update_mask [::Google::Protobuf::FieldMask, ::Hash] - # Required. Field mask is used to specify the fields to be overwritten in the - # branchRule resource by the update. - # The fields specified in the update_mask are relative to the resource, not - # the full request. A field will be overwritten if it is in the mask. - # The special value "*" means full replacement. - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Gapic::Operation] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Gapic::Operation] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/cloud/secure_source_manager/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::SecureSourceManager::V1::SecureSourceManager::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::SecureSourceManager::V1::UpdateBranchRuleRequest.new - # - # # Call the update_branch_rule method. - # result = client.update_branch_rule 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_branch_rule request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::SecureSourceManager::V1::UpdateBranchRuleRequest - - # Converts hash 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_branch_rule.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::SecureSourceManager::V1::VERSION - metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - header_params = {} - if request.branch_rule&.name - header_params["branch_rule.name"] = request.branch_rule.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_branch_rule.timeout, - metadata: metadata, - retry_policy: @config.rpcs.update_branch_rule.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @secure_source_manager_stub.call_rpc :update_branch_rule, 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 - - ## - # DeleteBranchRule deletes a branch rule. - # - # @overload delete_branch_rule(request, options = nil) - # Pass arguments to `delete_branch_rule` via a request object, either of type - # {::Google::Cloud::SecureSourceManager::V1::DeleteBranchRuleRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::SecureSourceManager::V1::DeleteBranchRuleRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_branch_rule(name: nil, allow_missing: nil) - # Pass arguments to `delete_branch_rule` via keyword arguments. Note that at - # least one keyword argument is 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] - # @param allow_missing [::Boolean] - # Optional. If set to true, and the branch rule is not found, the request - # will succeed but no action will be taken on the server. - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Gapic::Operation] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Gapic::Operation] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/cloud/secure_source_manager/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::SecureSourceManager::V1::SecureSourceManager::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::SecureSourceManager::V1::DeleteBranchRuleRequest.new - # - # # Call the delete_branch_rule method. - # result = client.delete_branch_rule 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_branch_rule request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::SecureSourceManager::V1::DeleteBranchRuleRequest - - # Converts hash 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_branch_rule.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::SecureSourceManager::V1::VERSION - metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - header_params = {} - if request.name - header_params["name"] = request.name - end - - request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") - metadata[:"x-goog-request-params"] ||= request_params_header - - options.apply_defaults timeout: @config.rpcs.delete_branch_rule.timeout, - metadata: metadata, - retry_policy: @config.rpcs.delete_branch_rule.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @secure_source_manager_stub.call_rpc :delete_branch_rule, 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 - - ## - # Creates a pull request. - # - # @overload create_pull_request(request, options = nil) - # Pass arguments to `create_pull_request` via a request object, either of type - # {::Google::Cloud::SecureSourceManager::V1::CreatePullRequestRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::SecureSourceManager::V1::CreatePullRequestRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_pull_request(parent: nil, pull_request: nil) - # Pass arguments to `create_pull_request` via keyword arguments. Note that at - # least one keyword argument is 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 repository that the pull request is created from. Format: - # `projects/{project_number}/locations/{location_id}/repositories/{repository_id}` - # @param pull_request [::Google::Cloud::SecureSourceManager::V1::PullRequest, ::Hash] - # Required. The pull request to create. - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Gapic::Operation] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Gapic::Operation] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/cloud/secure_source_manager/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::SecureSourceManager::V1::SecureSourceManager::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::SecureSourceManager::V1::CreatePullRequestRequest.new - # - # # Call the create_pull_request method. - # result = client.create_pull_request 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_pull_request request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::SecureSourceManager::V1::CreatePullRequestRequest - - # Converts hash 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_pull_request.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::SecureSourceManager::V1::VERSION - metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - header_params = {} - if request.parent - header_params["parent"] = request.parent - end - - request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") - metadata[:"x-goog-request-params"] ||= request_params_header - - options.apply_defaults timeout: @config.rpcs.create_pull_request.timeout, - metadata: metadata, - retry_policy: @config.rpcs.create_pull_request.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @secure_source_manager_stub.call_rpc :create_pull_request, 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 pull request. - # - # @overload get_pull_request(request, options = nil) - # Pass arguments to `get_pull_request` via a request object, either of type - # {::Google::Cloud::SecureSourceManager::V1::GetPullRequestRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::SecureSourceManager::V1::GetPullRequestRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_pull_request(name: nil) - # Pass arguments to `get_pull_request` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param name [::String] - # Required. Name of the pull request to retrieve. - # The format is - # `projects/{project}/locations/{location}/repositories/{repository}/pullRequests/{pull_request}`. - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Google::Cloud::SecureSourceManager::V1::PullRequest] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Google::Cloud::SecureSourceManager::V1::PullRequest] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/cloud/secure_source_manager/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::SecureSourceManager::V1::SecureSourceManager::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::SecureSourceManager::V1::GetPullRequestRequest.new - # - # # Call the get_pull_request method. - # result = client.get_pull_request request - # - # # The returned object is of type Google::Cloud::SecureSourceManager::V1::PullRequest. - # p result - # - def get_pull_request request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::SecureSourceManager::V1::GetPullRequestRequest - - # Converts hash 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_pull_request.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::SecureSourceManager::V1::VERSION - metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - header_params = {} - if request.name - header_params["name"] = request.name - end - - request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") - metadata[:"x-goog-request-params"] ||= request_params_header - - options.apply_defaults timeout: @config.rpcs.get_pull_request.timeout, - metadata: metadata, - retry_policy: @config.rpcs.get_pull_request.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @secure_source_manager_stub.call_rpc :get_pull_request, request, options: options do |response, operation| - yield response, operation if block_given? - end - rescue ::GRPC::BadStatus => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Lists pull requests in a repository. - # - # @overload list_pull_requests(request, options = nil) - # Pass arguments to `list_pull_requests` via a request object, either of type - # {::Google::Cloud::SecureSourceManager::V1::ListPullRequestsRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::SecureSourceManager::V1::ListPullRequestsRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_pull_requests(parent: nil, page_size: nil, page_token: nil) - # Pass arguments to `list_pull_requests` via keyword arguments. Note that at - # least one keyword argument is 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 repository in which to list pull requests. Format: - # `projects/{project_number}/locations/{location_id}/repositories/{repository_id}` - # @param page_size [::Integer] - # Optional. Requested page size. Server may return fewer items than - # requested. If unspecified, server will pick an appropriate default. - # @param page_token [::String] - # Optional. A token identifying a page of results the server should return. - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Gapic::PagedEnumerable<::Google::Cloud::SecureSourceManager::V1::PullRequest>] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Gapic::PagedEnumerable<::Google::Cloud::SecureSourceManager::V1::PullRequest>] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/cloud/secure_source_manager/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::SecureSourceManager::V1::SecureSourceManager::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::SecureSourceManager::V1::ListPullRequestsRequest.new - # - # # Call the list_pull_requests method. - # result = client.list_pull_requests request - # - # # The returned object is of type Gapic::PagedEnumerable. You can iterate - # # over elements, and API calls will be issued to fetch pages as needed. - # result.each do |item| - # # Each element is of type ::Google::Cloud::SecureSourceManager::V1::PullRequest. - # p item - # end - # - def list_pull_requests request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::SecureSourceManager::V1::ListPullRequestsRequest - - # Converts hash 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_pull_requests.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::SecureSourceManager::V1::VERSION - metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - header_params = {} - if request.parent - header_params["parent"] = request.parent - end - - request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") - metadata[:"x-goog-request-params"] ||= request_params_header - - options.apply_defaults timeout: @config.rpcs.list_pull_requests.timeout, - metadata: metadata, - retry_policy: @config.rpcs.list_pull_requests.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @secure_source_manager_stub.call_rpc :list_pull_requests, request, options: options do |response, operation| - response = ::Gapic::PagedEnumerable.new @secure_source_manager_stub, :list_pull_requests, 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 - - ## - # Updates a pull request. - # - # @overload update_pull_request(request, options = nil) - # Pass arguments to `update_pull_request` via a request object, either of type - # {::Google::Cloud::SecureSourceManager::V1::UpdatePullRequestRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::SecureSourceManager::V1::UpdatePullRequestRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_pull_request(pull_request: nil, update_mask: nil) - # Pass arguments to `update_pull_request` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param pull_request [::Google::Cloud::SecureSourceManager::V1::PullRequest, ::Hash] - # Required. The pull request to update. - # @param update_mask [::Google::Protobuf::FieldMask, ::Hash] - # Optional. Field mask is used to specify the fields to be overwritten in the - # pull request resource by the update. - # The fields specified in the update_mask are relative to the resource, not - # the full request. A field will be overwritten if it is in the mask. - # The special value "*" means full replacement. - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Gapic::Operation] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Gapic::Operation] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/cloud/secure_source_manager/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::SecureSourceManager::V1::SecureSourceManager::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::SecureSourceManager::V1::UpdatePullRequestRequest.new - # - # # Call the update_pull_request method. - # result = client.update_pull_request 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_pull_request request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::SecureSourceManager::V1::UpdatePullRequestRequest - - # Converts hash 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_pull_request.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::SecureSourceManager::V1::VERSION - metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - header_params = {} - if request.pull_request&.name - header_params["pull_request.name"] = request.pull_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.update_pull_request.timeout, - metadata: metadata, - retry_policy: @config.rpcs.update_pull_request.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @secure_source_manager_stub.call_rpc :update_pull_request, 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 - - ## - # Merges a pull request. - # - # @overload merge_pull_request(request, options = nil) - # Pass arguments to `merge_pull_request` via a request object, either of type - # {::Google::Cloud::SecureSourceManager::V1::MergePullRequestRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::SecureSourceManager::V1::MergePullRequestRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. - # - # @overload merge_pull_request(name: nil) - # Pass arguments to `merge_pull_request` via keyword arguments. Note that at - # least one keyword argument is 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 pull request to merge. - # Format: - # `projects/{project_number}/locations/{location_id}/repositories/{repository_id}/pullRequests/{pull_request_id}` - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Gapic::Operation] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Gapic::Operation] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/cloud/secure_source_manager/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::SecureSourceManager::V1::SecureSourceManager::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::SecureSourceManager::V1::MergePullRequestRequest.new - # - # # Call the merge_pull_request method. - # result = client.merge_pull_request 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 merge_pull_request request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::SecureSourceManager::V1::MergePullRequestRequest - - # Converts hash 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.merge_pull_request.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::SecureSourceManager::V1::VERSION - metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - header_params = {} - if request.name - header_params["name"] = request.name - end - - request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") - metadata[:"x-goog-request-params"] ||= request_params_header - - options.apply_defaults timeout: @config.rpcs.merge_pull_request.timeout, - metadata: metadata, - retry_policy: @config.rpcs.merge_pull_request.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @secure_source_manager_stub.call_rpc :merge_pull_request, 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 - - ## - # Opens a pull request. - # - # @overload open_pull_request(request, options = nil) - # Pass arguments to `open_pull_request` via a request object, either of type - # {::Google::Cloud::SecureSourceManager::V1::OpenPullRequestRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::SecureSourceManager::V1::OpenPullRequestRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. - # - # @overload open_pull_request(name: nil) - # Pass arguments to `open_pull_request` via keyword arguments. Note that at - # least one keyword argument is 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 pull request to open. - # Format: - # `projects/{project_number}/locations/{location_id}/repositories/{repository_id}/pullRequests/{pull_request_id}` - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Gapic::Operation] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Gapic::Operation] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/cloud/secure_source_manager/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::SecureSourceManager::V1::SecureSourceManager::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::SecureSourceManager::V1::OpenPullRequestRequest.new - # - # # Call the open_pull_request method. - # result = client.open_pull_request 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 open_pull_request request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::SecureSourceManager::V1::OpenPullRequestRequest - - # Converts hash 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.open_pull_request.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::SecureSourceManager::V1::VERSION - metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - header_params = {} - if request.name - header_params["name"] = request.name - end - - request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") - metadata[:"x-goog-request-params"] ||= request_params_header - - options.apply_defaults timeout: @config.rpcs.open_pull_request.timeout, - metadata: metadata, - retry_policy: @config.rpcs.open_pull_request.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @secure_source_manager_stub.call_rpc :open_pull_request, 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 - - ## - # Closes a pull request without merging. - # - # @overload close_pull_request(request, options = nil) - # Pass arguments to `close_pull_request` via a request object, either of type - # {::Google::Cloud::SecureSourceManager::V1::ClosePullRequestRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::SecureSourceManager::V1::ClosePullRequestRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. - # - # @overload close_pull_request(name: nil) - # Pass arguments to `close_pull_request` via keyword arguments. Note that at - # least one keyword argument is 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 pull request to close. - # Format: - # `projects/{project_number}/locations/{location_id}/repositories/{repository_id}/pullRequests/{pull_request_id}` - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Gapic::Operation] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Gapic::Operation] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/cloud/secure_source_manager/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::SecureSourceManager::V1::SecureSourceManager::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::SecureSourceManager::V1::ClosePullRequestRequest.new - # - # # Call the close_pull_request method. - # result = client.close_pull_request 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 close_pull_request request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::SecureSourceManager::V1::ClosePullRequestRequest - - # Converts hash 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.close_pull_request.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::SecureSourceManager::V1::VERSION - metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - header_params = {} - if request.name - header_params["name"] = request.name - end - - request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") - metadata[:"x-goog-request-params"] ||= request_params_header - - options.apply_defaults timeout: @config.rpcs.close_pull_request.timeout, - metadata: metadata, - retry_policy: @config.rpcs.close_pull_request.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @secure_source_manager_stub.call_rpc :close_pull_request, 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 a pull request's file diffs. - # - # @overload list_pull_request_file_diffs(request, options = nil) - # Pass arguments to `list_pull_request_file_diffs` via a request object, either of type - # {::Google::Cloud::SecureSourceManager::V1::ListPullRequestFileDiffsRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::SecureSourceManager::V1::ListPullRequestFileDiffsRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_pull_request_file_diffs(name: nil, page_size: nil, page_token: nil) - # Pass arguments to `list_pull_request_file_diffs` via keyword arguments. Note that at - # least one keyword argument is 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 pull request to list file diffs for. - # Format: - # `projects/{project_number}/locations/{location_id}/repositories/{repository_id}/pullRequests/{pull_request_id}` - # @param page_size [::Integer] - # Optional. Requested page size. Server may return fewer items than - # requested. If unspecified, server will pick an appropriate default. - # @param page_token [::String] - # Optional. A token identifying a page of results the server should return. - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Gapic::PagedEnumerable<::Google::Cloud::SecureSourceManager::V1::FileDiff>] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Gapic::PagedEnumerable<::Google::Cloud::SecureSourceManager::V1::FileDiff>] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/cloud/secure_source_manager/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::SecureSourceManager::V1::SecureSourceManager::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::SecureSourceManager::V1::ListPullRequestFileDiffsRequest.new - # - # # Call the list_pull_request_file_diffs method. - # result = client.list_pull_request_file_diffs request - # - # # The returned object is of type Gapic::PagedEnumerable. You can iterate - # # over elements, and API calls will be issued to fetch pages as needed. - # result.each do |item| - # # Each element is of type ::Google::Cloud::SecureSourceManager::V1::FileDiff. - # p item - # end - # - def list_pull_request_file_diffs request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::SecureSourceManager::V1::ListPullRequestFileDiffsRequest - - # Converts hash 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_pull_request_file_diffs.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::SecureSourceManager::V1::VERSION - metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - header_params = {} - if request.name - header_params["name"] = request.name - end - - request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") - metadata[:"x-goog-request-params"] ||= request_params_header - - options.apply_defaults timeout: @config.rpcs.list_pull_request_file_diffs.timeout, - metadata: metadata, - retry_policy: @config.rpcs.list_pull_request_file_diffs.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @secure_source_manager_stub.call_rpc :list_pull_request_file_diffs, request, options: options do |response, operation| - response = ::Gapic::PagedEnumerable.new @secure_source_manager_stub, :list_pull_request_file_diffs, 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 - - ## - # Fetches a tree from a repository. - # - # @overload fetch_tree(request, options = nil) - # Pass arguments to `fetch_tree` via a request object, either of type - # {::Google::Cloud::SecureSourceManager::V1::FetchTreeRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::SecureSourceManager::V1::FetchTreeRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. - # - # @overload fetch_tree(repository: nil, ref: nil, recursive: nil, page_size: nil, page_token: nil) - # Pass arguments to `fetch_tree` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param repository [::String] - # Required. The format is - # `projects/{project_number}/locations/{location_id}/repositories/{repository_id}`. - # Specifies the repository to fetch the tree from. - # @param ref [::String] - # Optional. `ref` can be a SHA-1 hash, a branch name, or a tag. Specifies - # which tree to fetch. If not specified, the default branch will be used. - # @param recursive [::Boolean] - # Optional. If true, include all subfolders and their files in the response. - # If false, only the immediate children are returned. - # @param page_size [::Integer] - # Optional. Requested page size. Server may return fewer items than - # requested. If unspecified, at most 10,000 items will be returned. - # @param page_token [::String] - # Optional. A token identifying a page of results the server should return. - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Gapic::PagedEnumerable<::Google::Cloud::SecureSourceManager::V1::TreeEntry>] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Gapic::PagedEnumerable<::Google::Cloud::SecureSourceManager::V1::TreeEntry>] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/cloud/secure_source_manager/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::SecureSourceManager::V1::SecureSourceManager::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::SecureSourceManager::V1::FetchTreeRequest.new - # - # # Call the fetch_tree method. - # result = client.fetch_tree request - # - # # The returned object is of type Gapic::PagedEnumerable. You can iterate - # # over elements, and API calls will be issued to fetch pages as needed. - # result.each do |item| - # # Each element is of type ::Google::Cloud::SecureSourceManager::V1::TreeEntry. - # p item - # end - # - def fetch_tree request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::SecureSourceManager::V1::FetchTreeRequest - - # Converts hash 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.fetch_tree.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::SecureSourceManager::V1::VERSION - metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - header_params = {} - if request.repository - header_params["repository"] = request.repository - 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.fetch_tree.timeout, - metadata: metadata, - retry_policy: @config.rpcs.fetch_tree.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @secure_source_manager_stub.call_rpc :fetch_tree, request, options: options do |response, operation| - response = ::Gapic::PagedEnumerable.new @secure_source_manager_stub, :fetch_tree, 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 - - ## - # Fetches a blob from a repository. - # - # @overload fetch_blob(request, options = nil) - # Pass arguments to `fetch_blob` via a request object, either of type - # {::Google::Cloud::SecureSourceManager::V1::FetchBlobRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::SecureSourceManager::V1::FetchBlobRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. - # - # @overload fetch_blob(repository: nil, sha: nil) - # Pass arguments to `fetch_blob` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param repository [::String] - # Required. The format is - # `projects/{project_number}/locations/{location_id}/repositories/{repository_id}`. - # Specifies the repository containing the blob. - # @param sha [::String] - # Required. The SHA-1 hash of the blob to retrieve. - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Google::Cloud::SecureSourceManager::V1::FetchBlobResponse] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Google::Cloud::SecureSourceManager::V1::FetchBlobResponse] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/cloud/secure_source_manager/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::SecureSourceManager::V1::SecureSourceManager::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::SecureSourceManager::V1::FetchBlobRequest.new - # - # # Call the fetch_blob method. - # result = client.fetch_blob request - # - # # The returned object is of type Google::Cloud::SecureSourceManager::V1::FetchBlobResponse. - # p result - # - def fetch_blob request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::SecureSourceManager::V1::FetchBlobRequest - - # Converts hash 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.fetch_blob.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::SecureSourceManager::V1::VERSION - metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - header_params = {} - if request.repository - header_params["repository"] = request.repository - 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.fetch_blob.timeout, - metadata: metadata, - retry_policy: @config.rpcs.fetch_blob.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @secure_source_manager_stub.call_rpc :fetch_blob, request, options: options do |response, operation| - yield response, operation if block_given? - end - rescue ::GRPC::BadStatus => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Creates an issue. - # - # @overload create_issue(request, options = nil) - # Pass arguments to `create_issue` via a request object, either of type - # {::Google::Cloud::SecureSourceManager::V1::CreateIssueRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::SecureSourceManager::V1::CreateIssueRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_issue(parent: nil, issue: nil) - # Pass arguments to `create_issue` via keyword arguments. Note that at - # least one keyword argument is 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 repository in which to create the issue. Format: - # `projects/{project_number}/locations/{location_id}/repositories/{repository_id}` - # @param issue [::Google::Cloud::SecureSourceManager::V1::Issue, ::Hash] - # Required. The issue to create. - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Gapic::Operation] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Gapic::Operation] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/cloud/secure_source_manager/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::SecureSourceManager::V1::SecureSourceManager::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::SecureSourceManager::V1::CreateIssueRequest.new - # - # # Call the create_issue method. - # result = client.create_issue 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_issue request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::SecureSourceManager::V1::CreateIssueRequest - - # Converts hash 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_issue.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::SecureSourceManager::V1::VERSION - metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - header_params = {} - if request.parent - header_params["parent"] = request.parent - end - - request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") - metadata[:"x-goog-request-params"] ||= request_params_header - - options.apply_defaults timeout: @config.rpcs.create_issue.timeout, - metadata: metadata, - retry_policy: @config.rpcs.create_issue.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @secure_source_manager_stub.call_rpc :create_issue, 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 issue. - # - # @overload get_issue(request, options = nil) - # Pass arguments to `get_issue` via a request object, either of type - # {::Google::Cloud::SecureSourceManager::V1::GetIssueRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::SecureSourceManager::V1::GetIssueRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_issue(name: nil) - # Pass arguments to `get_issue` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param name [::String] - # Required. Name of the issue to retrieve. - # The format is - # `projects/{project}/locations/{location}/repositories/{repository}/issues/{issue_id}`. - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Google::Cloud::SecureSourceManager::V1::Issue] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Google::Cloud::SecureSourceManager::V1::Issue] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/cloud/secure_source_manager/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::SecureSourceManager::V1::SecureSourceManager::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::SecureSourceManager::V1::GetIssueRequest.new - # - # # Call the get_issue method. - # result = client.get_issue request - # - # # The returned object is of type Google::Cloud::SecureSourceManager::V1::Issue. - # p result - # - def get_issue request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::SecureSourceManager::V1::GetIssueRequest - - # Converts hash 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_issue.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::SecureSourceManager::V1::VERSION - metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - header_params = {} - if request.name - header_params["name"] = request.name - end - - request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") - metadata[:"x-goog-request-params"] ||= request_params_header - - options.apply_defaults timeout: @config.rpcs.get_issue.timeout, - metadata: metadata, - retry_policy: @config.rpcs.get_issue.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @secure_source_manager_stub.call_rpc :get_issue, request, options: options do |response, operation| - yield response, operation if block_given? - end - rescue ::GRPC::BadStatus => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Lists issues in a repository. - # - # @overload list_issues(request, options = nil) - # Pass arguments to `list_issues` via a request object, either of type - # {::Google::Cloud::SecureSourceManager::V1::ListIssuesRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::SecureSourceManager::V1::ListIssuesRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_issues(parent: nil, page_size: nil, page_token: nil, filter: nil) - # Pass arguments to `list_issues` via keyword arguments. Note that at - # least one keyword argument is 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 repository in which to list issues. Format: - # `projects/{project_number}/locations/{location_id}/repositories/{repository_id}` - # @param page_size [::Integer] - # Optional. Requested page size. Server may return fewer items than - # requested. If unspecified, server will pick an appropriate default. - # @param page_token [::String] - # Optional. A token identifying a page of results the server should return. - # @param filter [::String] - # Optional. Used to filter the resulting issues list. - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Gapic::PagedEnumerable<::Google::Cloud::SecureSourceManager::V1::Issue>] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Gapic::PagedEnumerable<::Google::Cloud::SecureSourceManager::V1::Issue>] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/cloud/secure_source_manager/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::SecureSourceManager::V1::SecureSourceManager::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::SecureSourceManager::V1::ListIssuesRequest.new - # - # # Call the list_issues method. - # result = client.list_issues request - # - # # The returned object is of type Gapic::PagedEnumerable. You can iterate - # # over elements, and API calls will be issued to fetch pages as needed. - # result.each do |item| - # # Each element is of type ::Google::Cloud::SecureSourceManager::V1::Issue. - # p item - # end - # - def list_issues request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::SecureSourceManager::V1::ListIssuesRequest - - # Converts hash 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_issues.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::SecureSourceManager::V1::VERSION - metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - header_params = {} - if request.parent - header_params["parent"] = request.parent - end - - request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") - metadata[:"x-goog-request-params"] ||= request_params_header - - options.apply_defaults timeout: @config.rpcs.list_issues.timeout, - metadata: metadata, - retry_policy: @config.rpcs.list_issues.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @secure_source_manager_stub.call_rpc :list_issues, request, options: options do |response, operation| - response = ::Gapic::PagedEnumerable.new @secure_source_manager_stub, :list_issues, 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 - - ## - # Updates a issue. - # - # @overload update_issue(request, options = nil) - # Pass arguments to `update_issue` via a request object, either of type - # {::Google::Cloud::SecureSourceManager::V1::UpdateIssueRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::SecureSourceManager::V1::UpdateIssueRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_issue(issue: nil, update_mask: nil) - # Pass arguments to `update_issue` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param issue [::Google::Cloud::SecureSourceManager::V1::Issue, ::Hash] - # Required. The issue to update. - # @param update_mask [::Google::Protobuf::FieldMask, ::Hash] - # Optional. Field mask is used to specify the fields to be overwritten in the - # issue resource by the update. - # The fields specified in the update_mask are relative to the resource, not - # the full request. A field will be overwritten if it is in the mask. - # The special value "*" means full replacement. - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Gapic::Operation] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Gapic::Operation] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/cloud/secure_source_manager/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::SecureSourceManager::V1::SecureSourceManager::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::SecureSourceManager::V1::UpdateIssueRequest.new - # - # # Call the update_issue method. - # result = client.update_issue 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_issue request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::SecureSourceManager::V1::UpdateIssueRequest - - # Converts hash 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_issue.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::SecureSourceManager::V1::VERSION - metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - header_params = {} - if request.issue&.name - header_params["issue.name"] = request.issue.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_issue.timeout, - metadata: metadata, - retry_policy: @config.rpcs.update_issue.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @secure_source_manager_stub.call_rpc :update_issue, 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 issue. - # - # @overload delete_issue(request, options = nil) - # Pass arguments to `delete_issue` via a request object, either of type - # {::Google::Cloud::SecureSourceManager::V1::DeleteIssueRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::SecureSourceManager::V1::DeleteIssueRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_issue(name: nil, etag: nil) - # Pass arguments to `delete_issue` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param name [::String] - # Required. Name of the issue to delete. - # The format is - # `projects/{project_number}/locations/{location_id}/repositories/{repository_id}/issues/{issue_id}`. - # @param etag [::String] - # Optional. The current etag of the issue. - # If the etag is provided and does not match the current etag of the issue, - # deletion will be blocked and an ABORTED error will be returned. - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Gapic::Operation] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Gapic::Operation] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/cloud/secure_source_manager/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::SecureSourceManager::V1::SecureSourceManager::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::SecureSourceManager::V1::DeleteIssueRequest.new - # - # # Call the delete_issue method. - # result = client.delete_issue 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_issue request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::SecureSourceManager::V1::DeleteIssueRequest - - # Converts hash 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_issue.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::SecureSourceManager::V1::VERSION - metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - header_params = {} - if request.name - header_params["name"] = request.name - end - - request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") - metadata[:"x-goog-request-params"] ||= request_params_header - - options.apply_defaults timeout: @config.rpcs.delete_issue.timeout, - metadata: metadata, - retry_policy: @config.rpcs.delete_issue.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @secure_source_manager_stub.call_rpc :delete_issue, 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 - - ## - # Opens an issue. - # - # @overload open_issue(request, options = nil) - # Pass arguments to `open_issue` via a request object, either of type - # {::Google::Cloud::SecureSourceManager::V1::OpenIssueRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::SecureSourceManager::V1::OpenIssueRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. - # - # @overload open_issue(name: nil, etag: nil) - # Pass arguments to `open_issue` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param name [::String] - # Required. Name of the issue to open. - # The format is - # `projects/{project_number}/locations/{location_id}/repositories/{repository_id}/issues/{issue_id}`. - # @param etag [::String] - # Optional. The current etag of the issue. - # If the etag is provided and does not match the current etag of the issue, - # opening will be blocked and an ABORTED error will be returned. - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Gapic::Operation] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Gapic::Operation] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/cloud/secure_source_manager/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::SecureSourceManager::V1::SecureSourceManager::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::SecureSourceManager::V1::OpenIssueRequest.new - # - # # Call the open_issue method. - # result = client.open_issue 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 open_issue request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::SecureSourceManager::V1::OpenIssueRequest - - # Converts hash 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.open_issue.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::SecureSourceManager::V1::VERSION - metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - header_params = {} - if request.name - header_params["name"] = request.name - end - - request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") - metadata[:"x-goog-request-params"] ||= request_params_header - - options.apply_defaults timeout: @config.rpcs.open_issue.timeout, - metadata: metadata, - retry_policy: @config.rpcs.open_issue.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @secure_source_manager_stub.call_rpc :open_issue, 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 - - ## - # Closes an issue. - # - # @overload close_issue(request, options = nil) - # Pass arguments to `close_issue` via a request object, either of type - # {::Google::Cloud::SecureSourceManager::V1::CloseIssueRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::SecureSourceManager::V1::CloseIssueRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. - # - # @overload close_issue(name: nil, etag: nil) - # Pass arguments to `close_issue` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param name [::String] - # Required. Name of the issue to close. - # The format is - # `projects/{project_number}/locations/{location_id}/repositories/{repository_id}/issues/{issue_id}`. - # @param etag [::String] - # Optional. The current etag of the issue. - # If the etag is provided and does not match the current etag of the issue, - # closing will be blocked and an ABORTED error will be returned. - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Gapic::Operation] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Gapic::Operation] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/cloud/secure_source_manager/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::SecureSourceManager::V1::SecureSourceManager::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::SecureSourceManager::V1::CloseIssueRequest.new - # - # # Call the close_issue method. - # result = client.close_issue 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 close_issue request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::SecureSourceManager::V1::CloseIssueRequest - - # Converts hash 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.close_issue.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::SecureSourceManager::V1::VERSION - metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - header_params = {} - if request.name - header_params["name"] = request.name - end - - request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") - metadata[:"x-goog-request-params"] ||= request_params_header - - options.apply_defaults timeout: @config.rpcs.close_issue.timeout, - metadata: metadata, - retry_policy: @config.rpcs.close_issue.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @secure_source_manager_stub.call_rpc :close_issue, 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 pull request comment. - # - # @overload get_pull_request_comment(request, options = nil) - # Pass arguments to `get_pull_request_comment` via a request object, either of type - # {::Google::Cloud::SecureSourceManager::V1::GetPullRequestCommentRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::SecureSourceManager::V1::GetPullRequestCommentRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_pull_request_comment(name: nil) - # Pass arguments to `get_pull_request_comment` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param name [::String] - # Required. Name of the pull request comment to retrieve. - # The format is - # `projects/{project_number}/locations/{location_id}/repositories/{repository_id}/pullRequests/{pull_request_id}/pullRequestComments/{comment_id}`. - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Google::Cloud::SecureSourceManager::V1::PullRequestComment] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Google::Cloud::SecureSourceManager::V1::PullRequestComment] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/cloud/secure_source_manager/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::SecureSourceManager::V1::SecureSourceManager::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::SecureSourceManager::V1::GetPullRequestCommentRequest.new - # - # # Call the get_pull_request_comment method. - # result = client.get_pull_request_comment request - # - # # The returned object is of type Google::Cloud::SecureSourceManager::V1::PullRequestComment. - # p result - # - def get_pull_request_comment request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::SecureSourceManager::V1::GetPullRequestCommentRequest - - # Converts hash 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_pull_request_comment.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::SecureSourceManager::V1::VERSION - metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - header_params = {} - if request.name - header_params["name"] = request.name - end - - request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") - metadata[:"x-goog-request-params"] ||= request_params_header - - options.apply_defaults timeout: @config.rpcs.get_pull_request_comment.timeout, - metadata: metadata, - retry_policy: @config.rpcs.get_pull_request_comment.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @secure_source_manager_stub.call_rpc :get_pull_request_comment, request, options: options do |response, operation| - yield response, operation if block_given? - end - rescue ::GRPC::BadStatus => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Lists pull request comments. - # - # @overload list_pull_request_comments(request, options = nil) - # Pass arguments to `list_pull_request_comments` via a request object, either of type - # {::Google::Cloud::SecureSourceManager::V1::ListPullRequestCommentsRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::SecureSourceManager::V1::ListPullRequestCommentsRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_pull_request_comments(parent: nil, page_size: nil, page_token: nil) - # Pass arguments to `list_pull_request_comments` via keyword arguments. Note that at - # least one keyword argument is 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 pull request in which to list pull request comments. Format: - # `projects/{project_number}/locations/{location_id}/repositories/{repository_id}/pullRequests/{pull_request_id}` - # @param page_size [::Integer] - # Optional. Requested page size. If unspecified, at most 100 pull request - # comments will be returned. The maximum value is 100; values above 100 will - # be coerced to 100. - # @param page_token [::String] - # Optional. A token identifying a page of results the server should return. - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Gapic::PagedEnumerable<::Google::Cloud::SecureSourceManager::V1::PullRequestComment>] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Gapic::PagedEnumerable<::Google::Cloud::SecureSourceManager::V1::PullRequestComment>] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/cloud/secure_source_manager/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::SecureSourceManager::V1::SecureSourceManager::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::SecureSourceManager::V1::ListPullRequestCommentsRequest.new - # - # # Call the list_pull_request_comments method. - # result = client.list_pull_request_comments request - # - # # The returned object is of type Gapic::PagedEnumerable. You can iterate - # # over elements, and API calls will be issued to fetch pages as needed. - # result.each do |item| - # # Each element is of type ::Google::Cloud::SecureSourceManager::V1::PullRequestComment. - # p item - # end - # - def list_pull_request_comments request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::SecureSourceManager::V1::ListPullRequestCommentsRequest - - # Converts hash 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_pull_request_comments.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::SecureSourceManager::V1::VERSION - metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - header_params = {} - if request.parent - header_params["parent"] = request.parent - end - - request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") - metadata[:"x-goog-request-params"] ||= request_params_header - - options.apply_defaults timeout: @config.rpcs.list_pull_request_comments.timeout, - metadata: metadata, - retry_policy: @config.rpcs.list_pull_request_comments.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @secure_source_manager_stub.call_rpc :list_pull_request_comments, request, options: options do |response, operation| - response = ::Gapic::PagedEnumerable.new @secure_source_manager_stub, :list_pull_request_comments, request, response, operation, options - yield response, operation if block_given? - throw :response, response - end - rescue ::GRPC::BadStatus => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Creates a pull request comment. This function is used to create a single - # PullRequestComment of type Comment, or a single PullRequestComment of type - # Code that's replying to another PullRequestComment of type Code. Use - # BatchCreatePullRequestComments to create multiple PullRequestComments for - # code reviews. - # - # @overload create_pull_request_comment(request, options = nil) - # Pass arguments to `create_pull_request_comment` via a request object, either of type - # {::Google::Cloud::SecureSourceManager::V1::CreatePullRequestCommentRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::SecureSourceManager::V1::CreatePullRequestCommentRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_pull_request_comment(parent: nil, pull_request_comment: nil) - # Pass arguments to `create_pull_request_comment` via keyword arguments. Note that at - # least one keyword argument is 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 pull request in which to create the pull request comment. - # Format: - # `projects/{project_number}/locations/{location_id}/repositories/{repository_id}/pullRequests/{pull_request_id}` - # @param pull_request_comment [::Google::Cloud::SecureSourceManager::V1::PullRequestComment, ::Hash] - # Required. The pull request comment to create. - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Gapic::Operation] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Gapic::Operation] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/cloud/secure_source_manager/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::SecureSourceManager::V1::SecureSourceManager::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::SecureSourceManager::V1::CreatePullRequestCommentRequest.new - # - # # Call the create_pull_request_comment method. - # result = client.create_pull_request_comment 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_pull_request_comment request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::SecureSourceManager::V1::CreatePullRequestCommentRequest - - # Converts hash 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_pull_request_comment.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::SecureSourceManager::V1::VERSION - metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - header_params = {} - if request.parent - header_params["parent"] = request.parent - end - - request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") - metadata[:"x-goog-request-params"] ||= request_params_header - - options.apply_defaults timeout: @config.rpcs.create_pull_request_comment.timeout, - metadata: metadata, - retry_policy: @config.rpcs.create_pull_request_comment.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @secure_source_manager_stub.call_rpc :create_pull_request_comment, request, options: options do |response, operation| - response = ::Gapic::Operation.new response, @operations_client, options: options - yield response, operation if block_given? - throw :response, response - end - rescue ::GRPC::BadStatus => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Updates a pull request comment. - # - # @overload update_pull_request_comment(request, options = nil) - # Pass arguments to `update_pull_request_comment` via a request object, either of type - # {::Google::Cloud::SecureSourceManager::V1::UpdatePullRequestCommentRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::SecureSourceManager::V1::UpdatePullRequestCommentRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_pull_request_comment(pull_request_comment: nil, update_mask: nil) - # Pass arguments to `update_pull_request_comment` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param pull_request_comment [::Google::Cloud::SecureSourceManager::V1::PullRequestComment, ::Hash] - # Required. The pull request comment to update. - # @param update_mask [::Google::Protobuf::FieldMask, ::Hash] - # Optional. Field mask is used to specify the fields to be overwritten in the - # pull request comment resource by the update. Updatable fields are - # `body`. - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Gapic::Operation] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Gapic::Operation] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/cloud/secure_source_manager/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::SecureSourceManager::V1::SecureSourceManager::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::SecureSourceManager::V1::UpdatePullRequestCommentRequest.new - # - # # Call the update_pull_request_comment method. - # result = client.update_pull_request_comment 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_pull_request_comment request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::SecureSourceManager::V1::UpdatePullRequestCommentRequest - - # Converts hash 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_pull_request_comment.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::SecureSourceManager::V1::VERSION - metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - header_params = {} - if request.pull_request_comment&.name - header_params["pull_request_comment.name"] = request.pull_request_comment.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_pull_request_comment.timeout, - metadata: metadata, - retry_policy: @config.rpcs.update_pull_request_comment.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @secure_source_manager_stub.call_rpc :update_pull_request_comment, 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 pull request comment. - # - # @overload delete_pull_request_comment(request, options = nil) - # Pass arguments to `delete_pull_request_comment` via a request object, either of type - # {::Google::Cloud::SecureSourceManager::V1::DeletePullRequestCommentRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::SecureSourceManager::V1::DeletePullRequestCommentRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_pull_request_comment(name: nil) - # Pass arguments to `delete_pull_request_comment` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param name [::String] - # Required. Name of the pull request comment to delete. - # The format is - # `projects/{project_number}/locations/{location_id}/repositories/{repository_id}/pullRequests/{pull_request_id}/pullRequestComments/{comment_id}`. - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Gapic::Operation] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Gapic::Operation] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/cloud/secure_source_manager/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::SecureSourceManager::V1::SecureSourceManager::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::SecureSourceManager::V1::DeletePullRequestCommentRequest.new - # - # # Call the delete_pull_request_comment method. - # result = client.delete_pull_request_comment 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_pull_request_comment request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::SecureSourceManager::V1::DeletePullRequestCommentRequest - - # Converts hash 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_pull_request_comment.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::SecureSourceManager::V1::VERSION - metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - header_params = {} - if request.name - header_params["name"] = request.name - end - - request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") - metadata[:"x-goog-request-params"] ||= request_params_header - - options.apply_defaults timeout: @config.rpcs.delete_pull_request_comment.timeout, - metadata: metadata, - retry_policy: @config.rpcs.delete_pull_request_comment.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @secure_source_manager_stub.call_rpc :delete_pull_request_comment, 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 - - ## - # Batch creates pull request comments. This function is used to create - # multiple PullRequestComments for code review. There needs to be exactly one - # PullRequestComment of type Review, and at most 100 PullRequestComments of - # type Code per request. The Postition of the code comments must be unique - # within the request. - # - # @overload batch_create_pull_request_comments(request, options = nil) - # Pass arguments to `batch_create_pull_request_comments` via a request object, either of type - # {::Google::Cloud::SecureSourceManager::V1::BatchCreatePullRequestCommentsRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::SecureSourceManager::V1::BatchCreatePullRequestCommentsRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. - # - # @overload batch_create_pull_request_comments(parent: nil, requests: nil) - # Pass arguments to `batch_create_pull_request_comments` via keyword arguments. Note that at - # least one keyword argument is 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 pull request in which to create the pull request comments. - # Format: - # `projects/{project_number}/locations/{location_id}/repositories/{repository_id}/pullRequests/{pull_request_id}` - # @param requests [::Array<::Google::Cloud::SecureSourceManager::V1::CreatePullRequestCommentRequest, ::Hash>] - # Required. The request message specifying the resources to create. There - # should be exactly one CreatePullRequestCommentRequest with CommentDetail - # being REVIEW in the list, and no more than 100 - # CreatePullRequestCommentRequests with CommentDetail being CODE in the list - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Gapic::Operation] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Gapic::Operation] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/cloud/secure_source_manager/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::SecureSourceManager::V1::SecureSourceManager::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::SecureSourceManager::V1::BatchCreatePullRequestCommentsRequest.new - # - # # Call the batch_create_pull_request_comments method. - # result = client.batch_create_pull_request_comments 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 batch_create_pull_request_comments request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::SecureSourceManager::V1::BatchCreatePullRequestCommentsRequest - - # Converts hash 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.batch_create_pull_request_comments.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::SecureSourceManager::V1::VERSION - metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - header_params = {} - if request.parent - header_params["parent"] = request.parent - end - - request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") - metadata[:"x-goog-request-params"] ||= request_params_header - - options.apply_defaults timeout: @config.rpcs.batch_create_pull_request_comments.timeout, - metadata: metadata, - retry_policy: @config.rpcs.batch_create_pull_request_comments.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @secure_source_manager_stub.call_rpc :batch_create_pull_request_comments, 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 - - ## - # Resolves pull request comments. A list of PullRequestComment names must be - # provided. The PullRequestComment names must be in the same conversation - # thread. If auto_fill is set, all comments in the conversation thread will - # be resolved. - # - # @overload resolve_pull_request_comments(request, options = nil) - # Pass arguments to `resolve_pull_request_comments` via a request object, either of type - # {::Google::Cloud::SecureSourceManager::V1::ResolvePullRequestCommentsRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::SecureSourceManager::V1::ResolvePullRequestCommentsRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. - # - # @overload resolve_pull_request_comments(parent: nil, names: nil, auto_fill: nil) - # Pass arguments to `resolve_pull_request_comments` via keyword arguments. Note that at - # least one keyword argument is 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 pull request in which to resolve the pull request comments. - # Format: - # `projects/{project_number}/locations/{location_id}/repositories/{repository_id}/pullRequests/{pull_request_id}` - # @param names [::Array<::String>] - # Required. The names of the pull request comments to resolve. Format: - # `projects/{project_number}/locations/{location_id}/repositories/{repository_id}/pullRequests/{pull_request_id}/pullRequestComments/{comment_id}` - # Only comments from the same threads are allowed in the same request. - # @param auto_fill [::Boolean] - # Optional. If set, at least one comment in a thread is required, rest of the - # comments in the same thread will be automatically updated to resolved. If - # unset, all comments in the same thread need be present. - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Gapic::Operation] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Gapic::Operation] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/cloud/secure_source_manager/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::SecureSourceManager::V1::SecureSourceManager::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::SecureSourceManager::V1::ResolvePullRequestCommentsRequest.new - # - # # Call the resolve_pull_request_comments method. - # result = client.resolve_pull_request_comments 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 resolve_pull_request_comments request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::SecureSourceManager::V1::ResolvePullRequestCommentsRequest - - # Converts hash 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.resolve_pull_request_comments.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::SecureSourceManager::V1::VERSION - metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - header_params = {} - if request.parent - header_params["parent"] = request.parent - end - - request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") - metadata[:"x-goog-request-params"] ||= request_params_header - - options.apply_defaults timeout: @config.rpcs.resolve_pull_request_comments.timeout, - metadata: metadata, - retry_policy: @config.rpcs.resolve_pull_request_comments.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @secure_source_manager_stub.call_rpc :resolve_pull_request_comments, 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 - - ## - # Unresolves pull request comments. A list of PullRequestComment names must - # be provided. The PullRequestComment names must be in the same conversation - # thread. If auto_fill is set, all comments in the conversation thread will - # be unresolved. - # - # @overload unresolve_pull_request_comments(request, options = nil) - # Pass arguments to `unresolve_pull_request_comments` via a request object, either of type - # {::Google::Cloud::SecureSourceManager::V1::UnresolvePullRequestCommentsRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::SecureSourceManager::V1::UnresolvePullRequestCommentsRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. - # - # @overload unresolve_pull_request_comments(parent: nil, names: nil, auto_fill: nil) - # Pass arguments to `unresolve_pull_request_comments` via keyword arguments. Note that at - # least one keyword argument is 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 pull request in which to resolve the pull request comments. - # Format: - # `projects/{project_number}/locations/{location_id}/repositories/{repository_id}/pullRequests/{pull_request_id}` - # @param names [::Array<::String>] - # Required. The names of the pull request comments to unresolve. Format: - # `projects/{project_number}/locations/{location_id}/repositories/{repository_id}/pullRequests/{pull_request_id}/pullRequestComments/{comment_id}` - # Only comments from the same threads are allowed in the same request. - # @param auto_fill [::Boolean] - # Optional. If set, at least one comment in a thread is required, rest of the - # comments in the same thread will be automatically updated to unresolved. If - # unset, all comments in the same thread need be present. - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Gapic::Operation] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Gapic::Operation] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/cloud/secure_source_manager/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::SecureSourceManager::V1::SecureSourceManager::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::SecureSourceManager::V1::UnresolvePullRequestCommentsRequest.new - # - # # Call the unresolve_pull_request_comments method. - # result = client.unresolve_pull_request_comments 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 unresolve_pull_request_comments request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::SecureSourceManager::V1::UnresolvePullRequestCommentsRequest - - # Converts hash 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.unresolve_pull_request_comments.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::SecureSourceManager::V1::VERSION - metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - header_params = {} - if request.parent - header_params["parent"] = request.parent - end - - request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") - metadata[:"x-goog-request-params"] ||= request_params_header - - options.apply_defaults timeout: @config.rpcs.unresolve_pull_request_comments.timeout, - metadata: metadata, - retry_policy: @config.rpcs.unresolve_pull_request_comments.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @secure_source_manager_stub.call_rpc :unresolve_pull_request_comments, 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 - - ## - # Creates an issue comment. - # - # @overload create_issue_comment(request, options = nil) - # Pass arguments to `create_issue_comment` via a request object, either of type - # {::Google::Cloud::SecureSourceManager::V1::CreateIssueCommentRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::SecureSourceManager::V1::CreateIssueCommentRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_issue_comment(parent: nil, issue_comment: nil) - # Pass arguments to `create_issue_comment` via keyword arguments. Note that at - # least one keyword argument is 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 issue in which to create the issue comment. Format: - # `projects/{project_number}/locations/{location_id}/repositories/{repository_id}/issues/{issue_id}` - # @param issue_comment [::Google::Cloud::SecureSourceManager::V1::IssueComment, ::Hash] - # Required. The issue comment to create. - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Gapic::Operation] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Gapic::Operation] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/cloud/secure_source_manager/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::SecureSourceManager::V1::SecureSourceManager::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::SecureSourceManager::V1::CreateIssueCommentRequest.new - # - # # Call the create_issue_comment method. - # result = client.create_issue_comment 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_issue_comment request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::SecureSourceManager::V1::CreateIssueCommentRequest - - # Converts hash 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_issue_comment.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::SecureSourceManager::V1::VERSION - metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - header_params = {} - if request.parent - header_params["parent"] = request.parent - end - - request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") - metadata[:"x-goog-request-params"] ||= request_params_header - - options.apply_defaults timeout: @config.rpcs.create_issue_comment.timeout, - metadata: metadata, - retry_policy: @config.rpcs.create_issue_comment.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @secure_source_manager_stub.call_rpc :create_issue_comment, 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 issue comment. - # - # @overload get_issue_comment(request, options = nil) - # Pass arguments to `get_issue_comment` via a request object, either of type - # {::Google::Cloud::SecureSourceManager::V1::GetIssueCommentRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::SecureSourceManager::V1::GetIssueCommentRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_issue_comment(name: nil) - # Pass arguments to `get_issue_comment` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param name [::String] - # Required. Name of the issue comment to retrieve. - # The format is - # `projects/{project}/locations/{location}/repositories/{repository}/issues/{issue_id}/issueComments/{comment_id}`. - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Google::Cloud::SecureSourceManager::V1::IssueComment] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Google::Cloud::SecureSourceManager::V1::IssueComment] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/cloud/secure_source_manager/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::SecureSourceManager::V1::SecureSourceManager::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::SecureSourceManager::V1::GetIssueCommentRequest.new - # - # # Call the get_issue_comment method. - # result = client.get_issue_comment request - # - # # The returned object is of type Google::Cloud::SecureSourceManager::V1::IssueComment. - # p result - # - def get_issue_comment request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::SecureSourceManager::V1::GetIssueCommentRequest - - # Converts hash 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_issue_comment.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::SecureSourceManager::V1::VERSION - metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - header_params = {} - if request.name - header_params["name"] = request.name - end - - request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") - metadata[:"x-goog-request-params"] ||= request_params_header - - options.apply_defaults timeout: @config.rpcs.get_issue_comment.timeout, - metadata: metadata, - retry_policy: @config.rpcs.get_issue_comment.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @secure_source_manager_stub.call_rpc :get_issue_comment, request, options: options do |response, operation| - yield response, operation if block_given? - end - rescue ::GRPC::BadStatus => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Lists comments in an issue. - # - # @overload list_issue_comments(request, options = nil) - # Pass arguments to `list_issue_comments` via a request object, either of type - # {::Google::Cloud::SecureSourceManager::V1::ListIssueCommentsRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::SecureSourceManager::V1::ListIssueCommentsRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_issue_comments(parent: nil, page_size: nil, page_token: nil) - # Pass arguments to `list_issue_comments` via keyword arguments. Note that at - # least one keyword argument is 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 issue in which to list the comments. Format: - # `projects/{project_number}/locations/{location_id}/repositories/{repository_id}/issues/{issue_id}` - # @param page_size [::Integer] - # Optional. Requested page size. Server may return fewer items than - # requested. If unspecified, server will pick an appropriate default. - # @param page_token [::String] - # Optional. A token identifying a page of results the server should return. - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Gapic::PagedEnumerable<::Google::Cloud::SecureSourceManager::V1::IssueComment>] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Gapic::PagedEnumerable<::Google::Cloud::SecureSourceManager::V1::IssueComment>] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/cloud/secure_source_manager/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::SecureSourceManager::V1::SecureSourceManager::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::SecureSourceManager::V1::ListIssueCommentsRequest.new - # - # # Call the list_issue_comments method. - # result = client.list_issue_comments request - # - # # The returned object is of type Gapic::PagedEnumerable. You can iterate - # # over elements, and API calls will be issued to fetch pages as needed. - # result.each do |item| - # # Each element is of type ::Google::Cloud::SecureSourceManager::V1::IssueComment. - # p item - # end - # - def list_issue_comments request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::SecureSourceManager::V1::ListIssueCommentsRequest - - # Converts hash 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_issue_comments.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::SecureSourceManager::V1::VERSION - metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - header_params = {} - if request.parent - header_params["parent"] = request.parent - end - - request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") - metadata[:"x-goog-request-params"] ||= request_params_header - - options.apply_defaults timeout: @config.rpcs.list_issue_comments.timeout, - metadata: metadata, - retry_policy: @config.rpcs.list_issue_comments.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @secure_source_manager_stub.call_rpc :list_issue_comments, request, options: options do |response, operation| - response = ::Gapic::PagedEnumerable.new @secure_source_manager_stub, :list_issue_comments, 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 - - ## - # Updates an issue comment. - # - # @overload update_issue_comment(request, options = nil) - # Pass arguments to `update_issue_comment` via a request object, either of type - # {::Google::Cloud::SecureSourceManager::V1::UpdateIssueCommentRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::SecureSourceManager::V1::UpdateIssueCommentRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_issue_comment(issue_comment: nil, update_mask: nil) - # Pass arguments to `update_issue_comment` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param issue_comment [::Google::Cloud::SecureSourceManager::V1::IssueComment, ::Hash] - # Required. The issue comment to update. - # @param update_mask [::Google::Protobuf::FieldMask, ::Hash] - # Optional. Field mask is used to specify the fields to be overwritten in the - # issue comment resource by the update. - # The fields specified in the update_mask are relative to the resource, not - # the full request. A field will be overwritten if it is in the mask. - # The special value "*" means full replacement. - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Gapic::Operation] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Gapic::Operation] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/cloud/secure_source_manager/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::SecureSourceManager::V1::SecureSourceManager::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::SecureSourceManager::V1::UpdateIssueCommentRequest.new - # - # # Call the update_issue_comment method. - # result = client.update_issue_comment 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_issue_comment request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::SecureSourceManager::V1::UpdateIssueCommentRequest - - # Converts hash 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_issue_comment.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::SecureSourceManager::V1::VERSION - metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - header_params = {} - if request.issue_comment&.name - header_params["issue_comment.name"] = request.issue_comment.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_issue_comment.timeout, - metadata: metadata, - retry_policy: @config.rpcs.update_issue_comment.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @secure_source_manager_stub.call_rpc :update_issue_comment, 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 issue comment. - # - # @overload delete_issue_comment(request, options = nil) - # Pass arguments to `delete_issue_comment` via a request object, either of type - # {::Google::Cloud::SecureSourceManager::V1::DeleteIssueCommentRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::SecureSourceManager::V1::DeleteIssueCommentRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_issue_comment(name: nil) - # Pass arguments to `delete_issue_comment` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param name [::String] - # Required. Name of the issue comment to delete. - # The format is - # `projects/{project_number}/locations/{location_id}/repositories/{repository_id}/issues/{issue_id}/issueComments/{comment_id}`. - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Gapic::Operation] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Gapic::Operation] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/cloud/secure_source_manager/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::SecureSourceManager::V1::SecureSourceManager::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::SecureSourceManager::V1::DeleteIssueCommentRequest.new - # - # # Call the delete_issue_comment method. - # result = client.delete_issue_comment 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_issue_comment request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::SecureSourceManager::V1::DeleteIssueCommentRequest - - # Converts hash 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_issue_comment.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::SecureSourceManager::V1::VERSION - metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - header_params = {} - if request.name - header_params["name"] = request.name - end - - request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") - metadata[:"x-goog-request-params"] ||= request_params_header - - options.apply_defaults timeout: @config.rpcs.delete_issue_comment.timeout, - metadata: metadata, - retry_policy: @config.rpcs.delete_issue_comment.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @secure_source_manager_stub.call_rpc :delete_issue_comment, 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 SecureSourceManager API. - # - # This class represents the configuration for SecureSourceManager, - # providing control over timeouts, retry behavior, logging, transport - # parameters, and other low-level controls. Certain parameters can also be - # applied individually to specific RPCs. See - # {::Google::Cloud::SecureSourceManager::V1::SecureSourceManager::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_instances to 20 seconds, - # # and all remaining timeouts to 10 seconds. - # ::Google::Cloud::SecureSourceManager::V1::SecureSourceManager::Client.configure do |config| - # config.timeout = 10.0 - # config.rpcs.list_instances.timeout = 20.0 - # end - # - # # Apply the above configuration only to a new client. - # client = ::Google::Cloud::SecureSourceManager::V1::SecureSourceManager::Client.new do |config| - # config.timeout = 10.0 - # config.rpcs.list_instances.timeout = 20.0 - # end - # - # @!attribute [rw] endpoint - # A custom service endpoint, as a hostname or hostname:port. The default is - # nil, indicating to use the default endpoint in the current universe domain. - # @return [::String,nil] - # @!attribute [rw] credentials - # Credentials to send with calls. You may provide any of the following types: - # * (`Google::Auth::Credentials`) A googleauth credentials object - # (see the [googleauth docs](https://rubydoc.info/gems/googleauth/Google/Auth/Credentials)) - # * (`Signet::OAuth2::Client`) A signet oauth2 client object - # (see the [signet docs](https://rubydoc.info/gems/signet/Signet/OAuth2/Client)) - # * (`GRPC::Core::Channel`) a gRPC channel with included credentials - # * (`GRPC::Core::ChannelCredentials`) a gRPC credentails object - # * (`nil`) indicating no credentials - # - # @note Warning: Passing a `String` to a keyfile path or a `Hash` of credentials - # is deprecated. Providing an unvalidated credential configuration to - # Google APIs can compromise the security of your systems and data. - # - # @example - # - # # The recommended way to provide credentials is to use the `make_creds` method - # # on the appropriate credentials class for your environment. - # - # require "googleauth" - # - # credentials = ::Google::Auth::ServiceAccountCredentials.make_creds( - # json_key_io: ::File.open("/path/to/keyfile.json") - # ) - # - # client = ::Google::Cloud::SecureSourceManager::V1::SecureSourceManager::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 = "securesourcemanager.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 SecureSourceManager 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_instances` - # @return [::Gapic::Config::Method] - # - attr_reader :list_instances - ## - # RPC-specific configuration for `get_instance` - # @return [::Gapic::Config::Method] - # - attr_reader :get_instance - ## - # RPC-specific configuration for `create_instance` - # @return [::Gapic::Config::Method] - # - attr_reader :create_instance - ## - # RPC-specific configuration for `delete_instance` - # @return [::Gapic::Config::Method] - # - attr_reader :delete_instance - ## - # RPC-specific configuration for `list_repositories` - # @return [::Gapic::Config::Method] - # - attr_reader :list_repositories - ## - # RPC-specific configuration for `get_repository` - # @return [::Gapic::Config::Method] - # - attr_reader :get_repository - ## - # RPC-specific configuration for `create_repository` - # @return [::Gapic::Config::Method] - # - attr_reader :create_repository - ## - # RPC-specific configuration for `update_repository` - # @return [::Gapic::Config::Method] - # - attr_reader :update_repository - ## - # RPC-specific configuration for `delete_repository` - # @return [::Gapic::Config::Method] - # - attr_reader :delete_repository - ## - # RPC-specific configuration for `list_hooks` - # @return [::Gapic::Config::Method] - # - attr_reader :list_hooks - ## - # RPC-specific configuration for `get_hook` - # @return [::Gapic::Config::Method] - # - attr_reader :get_hook - ## - # RPC-specific configuration for `create_hook` - # @return [::Gapic::Config::Method] - # - attr_reader :create_hook - ## - # RPC-specific configuration for `update_hook` - # @return [::Gapic::Config::Method] - # - attr_reader :update_hook - ## - # RPC-specific configuration for `delete_hook` - # @return [::Gapic::Config::Method] - # - attr_reader :delete_hook - ## - # RPC-specific configuration for `get_iam_policy_repo` - # @return [::Gapic::Config::Method] - # - attr_reader :get_iam_policy_repo - ## - # RPC-specific configuration for `set_iam_policy_repo` - # @return [::Gapic::Config::Method] - # - attr_reader :set_iam_policy_repo - ## - # RPC-specific configuration for `test_iam_permissions_repo` - # @return [::Gapic::Config::Method] - # - attr_reader :test_iam_permissions_repo - ## - # RPC-specific configuration for `create_branch_rule` - # @return [::Gapic::Config::Method] - # - attr_reader :create_branch_rule - ## - # RPC-specific configuration for `list_branch_rules` - # @return [::Gapic::Config::Method] - # - attr_reader :list_branch_rules - ## - # RPC-specific configuration for `get_branch_rule` - # @return [::Gapic::Config::Method] - # - attr_reader :get_branch_rule - ## - # RPC-specific configuration for `update_branch_rule` - # @return [::Gapic::Config::Method] - # - attr_reader :update_branch_rule - ## - # RPC-specific configuration for `delete_branch_rule` - # @return [::Gapic::Config::Method] - # - attr_reader :delete_branch_rule - ## - # RPC-specific configuration for `create_pull_request` - # @return [::Gapic::Config::Method] - # - attr_reader :create_pull_request - ## - # RPC-specific configuration for `get_pull_request` - # @return [::Gapic::Config::Method] - # - attr_reader :get_pull_request - ## - # RPC-specific configuration for `list_pull_requests` - # @return [::Gapic::Config::Method] - # - attr_reader :list_pull_requests - ## - # RPC-specific configuration for `update_pull_request` - # @return [::Gapic::Config::Method] - # - attr_reader :update_pull_request - ## - # RPC-specific configuration for `merge_pull_request` - # @return [::Gapic::Config::Method] - # - attr_reader :merge_pull_request - ## - # RPC-specific configuration for `open_pull_request` - # @return [::Gapic::Config::Method] - # - attr_reader :open_pull_request - ## - # RPC-specific configuration for `close_pull_request` - # @return [::Gapic::Config::Method] - # - attr_reader :close_pull_request - ## - # RPC-specific configuration for `list_pull_request_file_diffs` - # @return [::Gapic::Config::Method] - # - attr_reader :list_pull_request_file_diffs - ## - # RPC-specific configuration for `fetch_tree` - # @return [::Gapic::Config::Method] - # - attr_reader :fetch_tree - ## - # RPC-specific configuration for `fetch_blob` - # @return [::Gapic::Config::Method] - # - attr_reader :fetch_blob - ## - # RPC-specific configuration for `create_issue` - # @return [::Gapic::Config::Method] - # - attr_reader :create_issue - ## - # RPC-specific configuration for `get_issue` - # @return [::Gapic::Config::Method] - # - attr_reader :get_issue - ## - # RPC-specific configuration for `list_issues` - # @return [::Gapic::Config::Method] - # - attr_reader :list_issues - ## - # RPC-specific configuration for `update_issue` - # @return [::Gapic::Config::Method] - # - attr_reader :update_issue - ## - # RPC-specific configuration for `delete_issue` - # @return [::Gapic::Config::Method] - # - attr_reader :delete_issue - ## - # RPC-specific configuration for `open_issue` - # @return [::Gapic::Config::Method] - # - attr_reader :open_issue - ## - # RPC-specific configuration for `close_issue` - # @return [::Gapic::Config::Method] - # - attr_reader :close_issue - ## - # RPC-specific configuration for `get_pull_request_comment` - # @return [::Gapic::Config::Method] - # - attr_reader :get_pull_request_comment - ## - # RPC-specific configuration for `list_pull_request_comments` - # @return [::Gapic::Config::Method] - # - attr_reader :list_pull_request_comments - ## - # RPC-specific configuration for `create_pull_request_comment` - # @return [::Gapic::Config::Method] - # - attr_reader :create_pull_request_comment - ## - # RPC-specific configuration for `update_pull_request_comment` - # @return [::Gapic::Config::Method] - # - attr_reader :update_pull_request_comment - ## - # RPC-specific configuration for `delete_pull_request_comment` - # @return [::Gapic::Config::Method] - # - attr_reader :delete_pull_request_comment - ## - # RPC-specific configuration for `batch_create_pull_request_comments` - # @return [::Gapic::Config::Method] - # - attr_reader :batch_create_pull_request_comments - ## - # RPC-specific configuration for `resolve_pull_request_comments` - # @return [::Gapic::Config::Method] - # - attr_reader :resolve_pull_request_comments - ## - # RPC-specific configuration for `unresolve_pull_request_comments` - # @return [::Gapic::Config::Method] - # - attr_reader :unresolve_pull_request_comments - ## - # RPC-specific configuration for `create_issue_comment` - # @return [::Gapic::Config::Method] - # - attr_reader :create_issue_comment - ## - # RPC-specific configuration for `get_issue_comment` - # @return [::Gapic::Config::Method] - # - attr_reader :get_issue_comment - ## - # RPC-specific configuration for `list_issue_comments` - # @return [::Gapic::Config::Method] - # - attr_reader :list_issue_comments - ## - # RPC-specific configuration for `update_issue_comment` - # @return [::Gapic::Config::Method] - # - attr_reader :update_issue_comment - ## - # RPC-specific configuration for `delete_issue_comment` - # @return [::Gapic::Config::Method] - # - attr_reader :delete_issue_comment - - # @private - def initialize parent_rpcs = nil - list_instances_config = parent_rpcs.list_instances if parent_rpcs.respond_to? :list_instances - @list_instances = ::Gapic::Config::Method.new list_instances_config - get_instance_config = parent_rpcs.get_instance if parent_rpcs.respond_to? :get_instance - @get_instance = ::Gapic::Config::Method.new get_instance_config - create_instance_config = parent_rpcs.create_instance if parent_rpcs.respond_to? :create_instance - @create_instance = ::Gapic::Config::Method.new create_instance_config - delete_instance_config = parent_rpcs.delete_instance if parent_rpcs.respond_to? :delete_instance - @delete_instance = ::Gapic::Config::Method.new delete_instance_config - list_repositories_config = parent_rpcs.list_repositories if parent_rpcs.respond_to? :list_repositories - @list_repositories = ::Gapic::Config::Method.new list_repositories_config - get_repository_config = parent_rpcs.get_repository if parent_rpcs.respond_to? :get_repository - @get_repository = ::Gapic::Config::Method.new get_repository_config - create_repository_config = parent_rpcs.create_repository if parent_rpcs.respond_to? :create_repository - @create_repository = ::Gapic::Config::Method.new create_repository_config - update_repository_config = parent_rpcs.update_repository if parent_rpcs.respond_to? :update_repository - @update_repository = ::Gapic::Config::Method.new update_repository_config - delete_repository_config = parent_rpcs.delete_repository if parent_rpcs.respond_to? :delete_repository - @delete_repository = ::Gapic::Config::Method.new delete_repository_config - list_hooks_config = parent_rpcs.list_hooks if parent_rpcs.respond_to? :list_hooks - @list_hooks = ::Gapic::Config::Method.new list_hooks_config - get_hook_config = parent_rpcs.get_hook if parent_rpcs.respond_to? :get_hook - @get_hook = ::Gapic::Config::Method.new get_hook_config - create_hook_config = parent_rpcs.create_hook if parent_rpcs.respond_to? :create_hook - @create_hook = ::Gapic::Config::Method.new create_hook_config - update_hook_config = parent_rpcs.update_hook if parent_rpcs.respond_to? :update_hook - @update_hook = ::Gapic::Config::Method.new update_hook_config - delete_hook_config = parent_rpcs.delete_hook if parent_rpcs.respond_to? :delete_hook - @delete_hook = ::Gapic::Config::Method.new delete_hook_config - get_iam_policy_repo_config = parent_rpcs.get_iam_policy_repo if parent_rpcs.respond_to? :get_iam_policy_repo - @get_iam_policy_repo = ::Gapic::Config::Method.new get_iam_policy_repo_config - set_iam_policy_repo_config = parent_rpcs.set_iam_policy_repo if parent_rpcs.respond_to? :set_iam_policy_repo - @set_iam_policy_repo = ::Gapic::Config::Method.new set_iam_policy_repo_config - test_iam_permissions_repo_config = parent_rpcs.test_iam_permissions_repo if parent_rpcs.respond_to? :test_iam_permissions_repo - @test_iam_permissions_repo = ::Gapic::Config::Method.new test_iam_permissions_repo_config - create_branch_rule_config = parent_rpcs.create_branch_rule if parent_rpcs.respond_to? :create_branch_rule - @create_branch_rule = ::Gapic::Config::Method.new create_branch_rule_config - list_branch_rules_config = parent_rpcs.list_branch_rules if parent_rpcs.respond_to? :list_branch_rules - @list_branch_rules = ::Gapic::Config::Method.new list_branch_rules_config - get_branch_rule_config = parent_rpcs.get_branch_rule if parent_rpcs.respond_to? :get_branch_rule - @get_branch_rule = ::Gapic::Config::Method.new get_branch_rule_config - update_branch_rule_config = parent_rpcs.update_branch_rule if parent_rpcs.respond_to? :update_branch_rule - @update_branch_rule = ::Gapic::Config::Method.new update_branch_rule_config - delete_branch_rule_config = parent_rpcs.delete_branch_rule if parent_rpcs.respond_to? :delete_branch_rule - @delete_branch_rule = ::Gapic::Config::Method.new delete_branch_rule_config - create_pull_request_config = parent_rpcs.create_pull_request if parent_rpcs.respond_to? :create_pull_request - @create_pull_request = ::Gapic::Config::Method.new create_pull_request_config - get_pull_request_config = parent_rpcs.get_pull_request if parent_rpcs.respond_to? :get_pull_request - @get_pull_request = ::Gapic::Config::Method.new get_pull_request_config - list_pull_requests_config = parent_rpcs.list_pull_requests if parent_rpcs.respond_to? :list_pull_requests - @list_pull_requests = ::Gapic::Config::Method.new list_pull_requests_config - update_pull_request_config = parent_rpcs.update_pull_request if parent_rpcs.respond_to? :update_pull_request - @update_pull_request = ::Gapic::Config::Method.new update_pull_request_config - merge_pull_request_config = parent_rpcs.merge_pull_request if parent_rpcs.respond_to? :merge_pull_request - @merge_pull_request = ::Gapic::Config::Method.new merge_pull_request_config - open_pull_request_config = parent_rpcs.open_pull_request if parent_rpcs.respond_to? :open_pull_request - @open_pull_request = ::Gapic::Config::Method.new open_pull_request_config - close_pull_request_config = parent_rpcs.close_pull_request if parent_rpcs.respond_to? :close_pull_request - @close_pull_request = ::Gapic::Config::Method.new close_pull_request_config - list_pull_request_file_diffs_config = parent_rpcs.list_pull_request_file_diffs if parent_rpcs.respond_to? :list_pull_request_file_diffs - @list_pull_request_file_diffs = ::Gapic::Config::Method.new list_pull_request_file_diffs_config - fetch_tree_config = parent_rpcs.fetch_tree if parent_rpcs.respond_to? :fetch_tree - @fetch_tree = ::Gapic::Config::Method.new fetch_tree_config - fetch_blob_config = parent_rpcs.fetch_blob if parent_rpcs.respond_to? :fetch_blob - @fetch_blob = ::Gapic::Config::Method.new fetch_blob_config - create_issue_config = parent_rpcs.create_issue if parent_rpcs.respond_to? :create_issue - @create_issue = ::Gapic::Config::Method.new create_issue_config - get_issue_config = parent_rpcs.get_issue if parent_rpcs.respond_to? :get_issue - @get_issue = ::Gapic::Config::Method.new get_issue_config - list_issues_config = parent_rpcs.list_issues if parent_rpcs.respond_to? :list_issues - @list_issues = ::Gapic::Config::Method.new list_issues_config - update_issue_config = parent_rpcs.update_issue if parent_rpcs.respond_to? :update_issue - @update_issue = ::Gapic::Config::Method.new update_issue_config - delete_issue_config = parent_rpcs.delete_issue if parent_rpcs.respond_to? :delete_issue - @delete_issue = ::Gapic::Config::Method.new delete_issue_config - open_issue_config = parent_rpcs.open_issue if parent_rpcs.respond_to? :open_issue - @open_issue = ::Gapic::Config::Method.new open_issue_config - close_issue_config = parent_rpcs.close_issue if parent_rpcs.respond_to? :close_issue - @close_issue = ::Gapic::Config::Method.new close_issue_config - get_pull_request_comment_config = parent_rpcs.get_pull_request_comment if parent_rpcs.respond_to? :get_pull_request_comment - @get_pull_request_comment = ::Gapic::Config::Method.new get_pull_request_comment_config - list_pull_request_comments_config = parent_rpcs.list_pull_request_comments if parent_rpcs.respond_to? :list_pull_request_comments - @list_pull_request_comments = ::Gapic::Config::Method.new list_pull_request_comments_config - create_pull_request_comment_config = parent_rpcs.create_pull_request_comment if parent_rpcs.respond_to? :create_pull_request_comment - @create_pull_request_comment = ::Gapic::Config::Method.new create_pull_request_comment_config - update_pull_request_comment_config = parent_rpcs.update_pull_request_comment if parent_rpcs.respond_to? :update_pull_request_comment - @update_pull_request_comment = ::Gapic::Config::Method.new update_pull_request_comment_config - delete_pull_request_comment_config = parent_rpcs.delete_pull_request_comment if parent_rpcs.respond_to? :delete_pull_request_comment - @delete_pull_request_comment = ::Gapic::Config::Method.new delete_pull_request_comment_config - batch_create_pull_request_comments_config = parent_rpcs.batch_create_pull_request_comments if parent_rpcs.respond_to? :batch_create_pull_request_comments - @batch_create_pull_request_comments = ::Gapic::Config::Method.new batch_create_pull_request_comments_config - resolve_pull_request_comments_config = parent_rpcs.resolve_pull_request_comments if parent_rpcs.respond_to? :resolve_pull_request_comments - @resolve_pull_request_comments = ::Gapic::Config::Method.new resolve_pull_request_comments_config - unresolve_pull_request_comments_config = parent_rpcs.unresolve_pull_request_comments if parent_rpcs.respond_to? :unresolve_pull_request_comments - @unresolve_pull_request_comments = ::Gapic::Config::Method.new unresolve_pull_request_comments_config - create_issue_comment_config = parent_rpcs.create_issue_comment if parent_rpcs.respond_to? :create_issue_comment - @create_issue_comment = ::Gapic::Config::Method.new create_issue_comment_config - get_issue_comment_config = parent_rpcs.get_issue_comment if parent_rpcs.respond_to? :get_issue_comment - @get_issue_comment = ::Gapic::Config::Method.new get_issue_comment_config - list_issue_comments_config = parent_rpcs.list_issue_comments if parent_rpcs.respond_to? :list_issue_comments - @list_issue_comments = ::Gapic::Config::Method.new list_issue_comments_config - update_issue_comment_config = parent_rpcs.update_issue_comment if parent_rpcs.respond_to? :update_issue_comment - @update_issue_comment = ::Gapic::Config::Method.new update_issue_comment_config - delete_issue_comment_config = parent_rpcs.delete_issue_comment if parent_rpcs.respond_to? :delete_issue_comment - @delete_issue_comment = ::Gapic::Config::Method.new delete_issue_comment_config - - yield self if block_given? - end - end - end - end - end - end - end - end -end diff --git a/owl-bot-staging/google-cloud-secure_source_manager-v1/lib/google/cloud/secure_source_manager/v1/secure_source_manager/credentials.rb b/owl-bot-staging/google-cloud-secure_source_manager-v1/lib/google/cloud/secure_source_manager/v1/secure_source_manager/credentials.rb deleted file mode 100644 index 514b539ee5fe..000000000000 --- a/owl-bot-staging/google-cloud-secure_source_manager-v1/lib/google/cloud/secure_source_manager/v1/secure_source_manager/credentials.rb +++ /dev/null @@ -1,47 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -require "googleauth" - -module Google - module Cloud - module SecureSourceManager - module V1 - module SecureSourceManager - # Credentials for the SecureSourceManager API. - class Credentials < ::Google::Auth::Credentials - self.scope = [ - "https://www.googleapis.com/auth/cloud-platform" - ] - self.env_vars = [ - "GOOGLE_CLOUD_CREDENTIALS", - "GOOGLE_CLOUD_KEYFILE", - "GCLOUD_KEYFILE", - "GOOGLE_CLOUD_CREDENTIALS_JSON", - "GOOGLE_CLOUD_KEYFILE_JSON", - "GCLOUD_KEYFILE_JSON" - ] - self.paths = [ - "~/.config/google_cloud/application_default_credentials.json" - ] - end - end - end - end - end -end diff --git a/owl-bot-staging/google-cloud-secure_source_manager-v1/lib/google/cloud/secure_source_manager/v1/secure_source_manager/operations.rb b/owl-bot-staging/google-cloud-secure_source_manager-v1/lib/google/cloud/secure_source_manager/v1/secure_source_manager/operations.rb deleted file mode 100644 index 3ed4a0a851c2..000000000000 --- a/owl-bot-staging/google-cloud-secure_source_manager-v1/lib/google/cloud/secure_source_manager/v1/secure_source_manager/operations.rb +++ /dev/null @@ -1,841 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -require "gapic/operation" -require "google/longrunning/operations_pb" - -module Google - module Cloud - module SecureSourceManager - module V1 - module SecureSourceManager - # Service that implements Longrunning Operations API. - class Operations - # @private - API_VERSION = "" - - # @private - DEFAULT_ENDPOINT_TEMPLATE = "securesourcemanager.$UNIVERSE_DOMAIN$" - - # @private - attr_reader :operations_stub - - ## - # Configuration for the SecureSourceManager 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 SecureSourceManager 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::SecureSourceManager::V1::VERSION - metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - header_params = {} - if request.name - header_params["name"] = request.name - end - - request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") - metadata[:"x-goog-request-params"] ||= request_params_header - - options.apply_defaults timeout: @config.rpcs.list_operations.timeout, - metadata: metadata, - retry_policy: @config.rpcs.list_operations.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @operations_stub.call_rpc :list_operations, request, options: options do |response, operation| - wrap_lro_operation = ->(op_response) { ::Gapic::Operation.new op_response, @operations_client } - response = ::Gapic::PagedEnumerable.new @operations_stub, :list_operations, request, response, operation, options, format_resource: wrap_lro_operation - yield response, operation if block_given? - 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::SecureSourceManager::V1::VERSION - metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - header_params = {} - if request.name - header_params["name"] = request.name - end - - request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") - metadata[:"x-goog-request-params"] ||= request_params_header - - options.apply_defaults timeout: @config.rpcs.get_operation.timeout, - metadata: metadata, - retry_policy: @config.rpcs.get_operation.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @operations_stub.call_rpc :get_operation, request, options: options do |response, operation| - response = ::Gapic::Operation.new response, @operations_client, options: options - yield response, operation if block_given? - 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::SecureSourceManager::V1::VERSION - metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - header_params = {} - if request.name - header_params["name"] = request.name - end - - request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") - metadata[:"x-goog-request-params"] ||= request_params_header - - options.apply_defaults timeout: @config.rpcs.delete_operation.timeout, - metadata: metadata, - retry_policy: @config.rpcs.delete_operation.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @operations_stub.call_rpc :delete_operation, request, options: options do |response, operation| - yield response, operation if block_given? - 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::SecureSourceManager::V1::VERSION - metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - header_params = {} - if request.name - header_params["name"] = request.name - end - - request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") - metadata[:"x-goog-request-params"] ||= request_params_header - - options.apply_defaults timeout: @config.rpcs.cancel_operation.timeout, - metadata: metadata, - retry_policy: @config.rpcs.cancel_operation.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @operations_stub.call_rpc :cancel_operation, request, options: options do |response, operation| - yield response, operation if block_given? - 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::SecureSourceManager::V1::VERSION - metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - options.apply_defaults timeout: @config.rpcs.wait_operation.timeout, - metadata: metadata, - retry_policy: @config.rpcs.wait_operation.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @operations_stub.call_rpc :wait_operation, request, options: options do |response, operation| - response = ::Gapic::Operation.new response, @operations_client, options: options - yield response, operation if block_given? - 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 = "securesourcemanager.googleapis.com" - - config_attr :endpoint, nil, ::String, nil - config_attr :credentials, nil do |value| - allowed = [::String, ::Hash, ::Proc, ::Symbol, ::Google::Auth::Credentials, ::Google::Auth::BaseClient, ::Signet::OAuth2::Client, nil] - allowed += [::GRPC::Core::Channel, ::GRPC::Core::ChannelCredentials] if defined? ::GRPC::Core::Channel - allowed.any? { |klass| klass === value } - end - config_attr :scope, nil, ::String, ::Array, nil - config_attr :lib_name, nil, ::String, nil - config_attr :lib_version, nil, ::String, nil - config_attr(:channel_args, { "grpc.service_config_disable_resolution" => 1 }, ::Hash, nil) - config_attr :interceptors, nil, ::Array, nil - config_attr :timeout, nil, ::Numeric, nil - config_attr :metadata, nil, ::Hash, nil - config_attr :retry_policy, nil, ::Hash, ::Proc, nil - config_attr :quota_project, nil, ::String, nil - config_attr :universe_domain, nil, ::String, nil - config_attr :logger, :default, ::Logger, nil, :default - - # @private - def initialize parent_config = nil - @parent_config = parent_config unless parent_config.nil? - - yield self if block_given? - end - - ## - # Configurations for individual RPCs - # @return [Rpcs] - # - def rpcs - @rpcs ||= begin - parent_rpcs = nil - parent_rpcs = @parent_config.rpcs if defined?(@parent_config) && @parent_config.respond_to?(:rpcs) - Rpcs.new parent_rpcs - end - end - - ## - # Configuration for the channel pool - # @return [::Gapic::ServiceStub::ChannelPool::Configuration] - # - def channel_pool - @channel_pool ||= ::Gapic::ServiceStub::ChannelPool::Configuration.new - end - - ## - # Configuration RPC class for the Operations API. - # - # Includes fields providing the configuration for each RPC in this service. - # Each configuration object is of type `Gapic::Config::Method` and includes - # the following configuration fields: - # - # * `timeout` (*type:* `Numeric`) - The call timeout in seconds - # * `metadata` (*type:* `Hash{Symbol=>String}`) - Additional gRPC headers - # * `retry_policy (*type:* `Hash`) - The retry policy. The policy fields - # include the following keys: - # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds. - # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds. - # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier. - # * `:retry_codes` (*type:* `Array`) - The error codes that should - # trigger a retry. - # - class Rpcs - ## - # RPC-specific configuration for `list_operations` - # @return [::Gapic::Config::Method] - # - attr_reader :list_operations - ## - # RPC-specific configuration for `get_operation` - # @return [::Gapic::Config::Method] - # - attr_reader :get_operation - ## - # RPC-specific configuration for `delete_operation` - # @return [::Gapic::Config::Method] - # - attr_reader :delete_operation - ## - # RPC-specific configuration for `cancel_operation` - # @return [::Gapic::Config::Method] - # - attr_reader :cancel_operation - ## - # RPC-specific configuration for `wait_operation` - # @return [::Gapic::Config::Method] - # - attr_reader :wait_operation - - # @private - def initialize parent_rpcs = nil - list_operations_config = parent_rpcs.list_operations if parent_rpcs.respond_to? :list_operations - @list_operations = ::Gapic::Config::Method.new list_operations_config - get_operation_config = parent_rpcs.get_operation if parent_rpcs.respond_to? :get_operation - @get_operation = ::Gapic::Config::Method.new get_operation_config - delete_operation_config = parent_rpcs.delete_operation if parent_rpcs.respond_to? :delete_operation - @delete_operation = ::Gapic::Config::Method.new delete_operation_config - cancel_operation_config = parent_rpcs.cancel_operation if parent_rpcs.respond_to? :cancel_operation - @cancel_operation = ::Gapic::Config::Method.new cancel_operation_config - wait_operation_config = parent_rpcs.wait_operation if parent_rpcs.respond_to? :wait_operation - @wait_operation = ::Gapic::Config::Method.new wait_operation_config - - yield self if block_given? - end - end - end - end - end - end - end - end -end diff --git a/owl-bot-staging/google-cloud-secure_source_manager-v1/lib/google/cloud/secure_source_manager/v1/secure_source_manager/paths.rb b/owl-bot-staging/google-cloud-secure_source_manager-v1/lib/google/cloud/secure_source_manager/v1/secure_source_manager/paths.rb deleted file mode 100644 index a4119462008a..000000000000 --- a/owl-bot-staging/google-cloud-secure_source_manager-v1/lib/google/cloud/secure_source_manager/v1/secure_source_manager/paths.rb +++ /dev/null @@ -1,277 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - - -module Google - module Cloud - module SecureSourceManager - module V1 - module SecureSourceManager - # Path helper methods for the SecureSourceManager API. - module Paths - ## - # Create a fully-qualified BranchRule resource string. - # - # The resource will be in the following format: - # - # `projects/{project}/locations/{location}/repositories/{repository}/branchRules/{branch_rule}` - # - # @param project [String] - # @param location [String] - # @param repository [String] - # @param branch_rule [String] - # - # @return [::String] - def branch_rule_path project:, location:, repository:, branch_rule: - raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" - raise ::ArgumentError, "location cannot contain /" if location.to_s.include? "/" - raise ::ArgumentError, "repository cannot contain /" if repository.to_s.include? "/" - - "projects/#{project}/locations/#{location}/repositories/#{repository}/branchRules/#{branch_rule}" - end - - ## - # Create a fully-qualified CaPool resource string. - # - # The resource will be in the following format: - # - # `projects/{project}/locations/{location}/caPools/{ca_pool}` - # - # @param project [String] - # @param location [String] - # @param ca_pool [String] - # - # @return [::String] - def ca_pool_path project:, location:, ca_pool: - raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" - raise ::ArgumentError, "location cannot contain /" if location.to_s.include? "/" - - "projects/#{project}/locations/#{location}/caPools/#{ca_pool}" - end - - ## - # Create a fully-qualified CryptoKey resource string. - # - # The resource will be in the following format: - # - # `projects/{project}/locations/{location}/keyRings/{key_ring}/cryptoKeys/{crypto_key}` - # - # @param project [String] - # @param location [String] - # @param key_ring [String] - # @param crypto_key [String] - # - # @return [::String] - def crypto_key_path project:, location:, key_ring:, crypto_key: - raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" - raise ::ArgumentError, "location cannot contain /" if location.to_s.include? "/" - raise ::ArgumentError, "key_ring cannot contain /" if key_ring.to_s.include? "/" - - "projects/#{project}/locations/#{location}/keyRings/#{key_ring}/cryptoKeys/#{crypto_key}" - end - - ## - # Create a fully-qualified Hook resource string. - # - # The resource will be in the following format: - # - # `projects/{project}/locations/{location}/repositories/{repository}/hooks/{hook}` - # - # @param project [String] - # @param location [String] - # @param repository [String] - # @param hook [String] - # - # @return [::String] - def hook_path project:, location:, repository:, hook: - raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" - raise ::ArgumentError, "location cannot contain /" if location.to_s.include? "/" - raise ::ArgumentError, "repository cannot contain /" if repository.to_s.include? "/" - - "projects/#{project}/locations/#{location}/repositories/#{repository}/hooks/#{hook}" - end - - ## - # Create a fully-qualified Instance resource string. - # - # The resource will be in the following format: - # - # `projects/{project}/locations/{location}/instances/{instance}` - # - # @param project [String] - # @param location [String] - # @param instance [String] - # - # @return [::String] - def instance_path project:, location:, instance: - raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" - raise ::ArgumentError, "location cannot contain /" if location.to_s.include? "/" - - "projects/#{project}/locations/#{location}/instances/#{instance}" - end - - ## - # Create a fully-qualified Issue resource string. - # - # The resource will be in the following format: - # - # `projects/{project}/locations/{location}/repositories/{repository}/issues/{issue}` - # - # @param project [String] - # @param location [String] - # @param repository [String] - # @param issue [String] - # - # @return [::String] - def issue_path project:, location:, repository:, issue: - raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" - raise ::ArgumentError, "location cannot contain /" if location.to_s.include? "/" - raise ::ArgumentError, "repository cannot contain /" if repository.to_s.include? "/" - - "projects/#{project}/locations/#{location}/repositories/#{repository}/issues/#{issue}" - end - - ## - # Create a fully-qualified IssueComment resource string. - # - # The resource will be in the following format: - # - # `projects/{project}/locations/{location}/repositories/{repository}/issues/{issue}/issueComments/{comment}` - # - # @param project [String] - # @param location [String] - # @param repository [String] - # @param issue [String] - # @param comment [String] - # - # @return [::String] - def issue_comment_path project:, location:, repository:, issue:, comment: - raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" - raise ::ArgumentError, "location cannot contain /" if location.to_s.include? "/" - raise ::ArgumentError, "repository cannot contain /" if repository.to_s.include? "/" - raise ::ArgumentError, "issue cannot contain /" if issue.to_s.include? "/" - - "projects/#{project}/locations/#{location}/repositories/#{repository}/issues/#{issue}/issueComments/#{comment}" - 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 PullRequest resource string. - # - # The resource will be in the following format: - # - # `projects/{project}/locations/{location}/repositories/{repository}/pullRequests/{pull_request}` - # - # @param project [String] - # @param location [String] - # @param repository [String] - # @param pull_request [String] - # - # @return [::String] - def pull_request_path project:, location:, repository:, pull_request: - raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" - raise ::ArgumentError, "location cannot contain /" if location.to_s.include? "/" - raise ::ArgumentError, "repository cannot contain /" if repository.to_s.include? "/" - - "projects/#{project}/locations/#{location}/repositories/#{repository}/pullRequests/#{pull_request}" - end - - ## - # Create a fully-qualified PullRequestComment resource string. - # - # The resource will be in the following format: - # - # `projects/{project}/locations/{location}/repositories/{repository}/pullRequests/{pull_request}/pullRequestComments/{comment}` - # - # @param project [String] - # @param location [String] - # @param repository [String] - # @param pull_request [String] - # @param comment [String] - # - # @return [::String] - def pull_request_comment_path project:, location:, repository:, pull_request:, comment: - raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" - raise ::ArgumentError, "location cannot contain /" if location.to_s.include? "/" - raise ::ArgumentError, "repository cannot contain /" if repository.to_s.include? "/" - raise ::ArgumentError, "pull_request cannot contain /" if pull_request.to_s.include? "/" - - "projects/#{project}/locations/#{location}/repositories/#{repository}/pullRequests/#{pull_request}/pullRequestComments/#{comment}" - end - - ## - # Create a fully-qualified Repository resource string. - # - # The resource will be in the following format: - # - # `projects/{project}/locations/{location}/repositories/{repository}` - # - # @param project [String] - # @param location [String] - # @param repository [String] - # - # @return [::String] - def repository_path project:, location:, repository: - raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" - raise ::ArgumentError, "location cannot contain /" if location.to_s.include? "/" - - "projects/#{project}/locations/#{location}/repositories/#{repository}" - end - - ## - # Create a fully-qualified ServiceAttachment resource string. - # - # The resource will be in the following format: - # - # `projects/{project}/regions/{region}/serviceAttachments/{service_attachment}` - # - # @param project [String] - # @param region [String] - # @param service_attachment [String] - # - # @return [::String] - def service_attachment_path project:, region:, service_attachment: - raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" - raise ::ArgumentError, "region cannot contain /" if region.to_s.include? "/" - - "projects/#{project}/regions/#{region}/serviceAttachments/#{service_attachment}" - end - - extend self - end - end - end - end - end -end diff --git a/owl-bot-staging/google-cloud-secure_source_manager-v1/lib/google/cloud/secure_source_manager/v1/secure_source_manager/rest.rb b/owl-bot-staging/google-cloud-secure_source_manager-v1/lib/google/cloud/secure_source_manager/v1/secure_source_manager/rest.rb deleted file mode 100644 index 1d049bd8ad6d..000000000000 --- a/owl-bot-staging/google-cloud-secure_source_manager-v1/lib/google/cloud/secure_source_manager/v1/secure_source_manager/rest.rb +++ /dev/null @@ -1,56 +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/secure_source_manager/v1/version" -require "google/cloud/secure_source_manager/v1/bindings_override" - -require "google/cloud/secure_source_manager/v1/secure_source_manager/credentials" -require "google/cloud/secure_source_manager/v1/secure_source_manager/paths" -require "google/cloud/secure_source_manager/v1/secure_source_manager/rest/operations" -require "google/cloud/secure_source_manager/v1/secure_source_manager/rest/client" - -module Google - module Cloud - module SecureSourceManager - module V1 - ## - # Secure Source Manager API - # - # Access Secure Source Manager instances, resources, and repositories. - # - # To load this service and instantiate a REST client: - # - # require "google/cloud/secure_source_manager/v1/secure_source_manager/rest" - # client = ::Google::Cloud::SecureSourceManager::V1::SecureSourceManager::Rest::Client.new - # - module SecureSourceManager - # Client for the REST transport - module Rest - end - end - end - end - end -end - -helper_path = ::File.join __dir__, "rest", "helpers.rb" -require "google/cloud/secure_source_manager/v1/secure_source_manager/rest/helpers" if ::File.file? helper_path diff --git a/owl-bot-staging/google-cloud-secure_source_manager-v1/lib/google/cloud/secure_source_manager/v1/secure_source_manager/rest/client.rb b/owl-bot-staging/google-cloud-secure_source_manager-v1/lib/google/cloud/secure_source_manager/v1/secure_source_manager/rest/client.rb deleted file mode 100644 index 739aa1fb974a..000000000000 --- a/owl-bot-staging/google-cloud-secure_source_manager-v1/lib/google/cloud/secure_source_manager/v1/secure_source_manager/rest/client.rb +++ /dev/null @@ -1,5479 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -require "google/cloud/errors" -require "google/cloud/securesourcemanager/v1/secure_source_manager_pb" -require "google/cloud/secure_source_manager/v1/secure_source_manager/rest/service_stub" -require "google/cloud/location/rest" -require "google/iam/v1/rest" - -module Google - module Cloud - module SecureSourceManager - module V1 - module SecureSourceManager - module Rest - ## - # REST client for the SecureSourceManager service. - # - # Secure Source Manager API - # - # Access Secure Source Manager instances, resources, and repositories. - # - class Client - # @private - API_VERSION = "" - - # @private - DEFAULT_ENDPOINT_TEMPLATE = "securesourcemanager.$UNIVERSE_DOMAIN$" - - include Paths - - # @private - attr_reader :secure_source_manager_stub - - ## - # Configure the SecureSourceManager Client class. - # - # See {::Google::Cloud::SecureSourceManager::V1::SecureSourceManager::Rest::Client::Configuration} - # for a description of the configuration fields. - # - # @example - # - # # Modify the configuration for all SecureSourceManager clients - # ::Google::Cloud::SecureSourceManager::V1::SecureSourceManager::Rest::Client.configure do |config| - # config.timeout = 10.0 - # end - # - # @yield [config] Configure the Client client. - # @yieldparam config [Client::Configuration] - # - # @return [Client::Configuration] - # - def self.configure - @configure ||= begin - namespace = ["Google", "Cloud", "SecureSourceManager", "V1"] - parent_config = while namespace.any? - parent_name = namespace.join "::" - parent_const = const_get parent_name - break parent_const.configure if parent_const.respond_to? :configure - namespace.pop - end - default_config = Client::Configuration.new parent_config - - default_config.rpcs.list_instances.timeout = 60.0 - default_config.rpcs.list_instances.retry_policy = { - initial_delay: 1.0, max_delay: 10.0, multiplier: 1.3, retry_codes: [14] - } - - default_config.rpcs.get_instance.timeout = 60.0 - default_config.rpcs.get_instance.retry_policy = { - initial_delay: 1.0, max_delay: 10.0, multiplier: 1.3, retry_codes: [14] - } - - default_config.rpcs.list_repositories.timeout = 60.0 - default_config.rpcs.list_repositories.retry_policy = { - initial_delay: 1.0, max_delay: 10.0, multiplier: 1.3, retry_codes: [14] - } - - default_config.rpcs.get_repository.timeout = 60.0 - default_config.rpcs.get_repository.retry_policy = { - initial_delay: 1.0, max_delay: 10.0, multiplier: 1.3, retry_codes: [14] - } - - default_config.rpcs.get_iam_policy_repo.timeout = 60.0 - default_config.rpcs.get_iam_policy_repo.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 SecureSourceManager Client instance. - # - # The configuration is set to the derived mode, meaning that values can be changed, - # but structural changes (adding new fields, etc.) are not allowed. Structural changes - # should be made on {Client.configure}. - # - # See {::Google::Cloud::SecureSourceManager::V1::SecureSourceManager::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 - @secure_source_manager_stub.universe_domain - end - - ## - # Create a new SecureSourceManager REST client object. - # - # @example - # - # # Create a client using the default configuration - # client = ::Google::Cloud::SecureSourceManager::V1::SecureSourceManager::Rest::Client.new - # - # # Create a client using a custom configuration - # client = ::Google::Cloud::SecureSourceManager::V1::SecureSourceManager::Rest::Client.new do |config| - # config.timeout = 10.0 - # end - # - # @yield [config] Configure the SecureSourceManager client. - # @yieldparam config [Client::Configuration] - # - def initialize - # Create the configuration object - @config = Configuration.new Client.configure - - # Yield the configuration if needed - yield @config if block_given? - - # Create credentials - credentials = @config.credentials - # Use self-signed JWT if the endpoint is unchanged from default, - # but only if the default endpoint does not have a region prefix. - enable_self_signed_jwt = @config.endpoint.nil? || - (@config.endpoint == Configuration::DEFAULT_ENDPOINT && - !@config.endpoint.split(".").first.include?("-")) - credentials ||= Credentials.default scope: @config.scope, - enable_self_signed_jwt: enable_self_signed_jwt - if credentials.is_a?(::String) || credentials.is_a?(::Hash) - credentials = Credentials.new credentials, scope: @config.scope - end - - @quota_project_id = @config.quota_project - @quota_project_id ||= credentials.quota_project_id if credentials.respond_to? :quota_project_id - - @operations_client = ::Google::Cloud::SecureSourceManager::V1::SecureSourceManager::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 - - @secure_source_manager_stub = ::Google::Cloud::SecureSourceManager::V1::SecureSourceManager::Rest::ServiceStub.new( - endpoint: @config.endpoint, - endpoint_template: DEFAULT_ENDPOINT_TEMPLATE, - universe_domain: @config.universe_domain, - credentials: credentials, - logger: @config.logger - ) - - @secure_source_manager_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 = @secure_source_manager_stub.endpoint - config.universe_domain = @secure_source_manager_stub.universe_domain - config.bindings_override = @config.bindings_override - config.logger = @secure_source_manager_stub.logger if config.respond_to? :logger= - end - - @iam_policy_client = Google::Iam::V1::IAMPolicy::Rest::Client.new do |config| - config.credentials = credentials - config.quota_project = @quota_project_id - config.endpoint = @secure_source_manager_stub.endpoint - config.universe_domain = @secure_source_manager_stub.universe_domain - config.bindings_override = @config.bindings_override - config.logger = @secure_source_manager_stub.logger if config.respond_to? :logger= - end - end - - ## - # Get the associated client for long-running operations. - # - # @return [::Google::Cloud::SecureSourceManager::V1::SecureSourceManager::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 - - ## - # Get the associated client for mix-in of the IAMPolicy. - # - # @return [Google::Iam::V1::IAMPolicy::Rest::Client] - # - attr_reader :iam_policy_client - - ## - # The logger used for request/response debug logging. - # - # @return [Logger] - # - def logger - @secure_source_manager_stub.logger - end - - # Service calls - - ## - # Lists Instances in a given project and location. - # - # @overload list_instances(request, options = nil) - # Pass arguments to `list_instances` via a request object, either of type - # {::Google::Cloud::SecureSourceManager::V1::ListInstancesRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::SecureSourceManager::V1::ListInstancesRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_instances(parent: nil, page_size: nil, page_token: nil, filter: nil, order_by: nil) - # Pass arguments to `list_instances` via keyword arguments. Note that at - # least one keyword argument is 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. Parent value for ListInstancesRequest. - # @param page_size [::Integer] - # Requested page size. Server may return fewer items than requested. - # If unspecified, server will pick an appropriate default. - # @param page_token [::String] - # A token identifying a page of results the server should return. - # @param filter [::String] - # Filter for filtering results. - # @param order_by [::String] - # Hint for how to order the results. - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Gapic::Rest::PagedEnumerable<::Google::Cloud::SecureSourceManager::V1::Instance>] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Gapic::Rest::PagedEnumerable<::Google::Cloud::SecureSourceManager::V1::Instance>] - # - # @raise [::Google::Cloud::Error] if the REST call is aborted. - # - # @example Basic example - # require "google/cloud/secure_source_manager/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::SecureSourceManager::V1::SecureSourceManager::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::SecureSourceManager::V1::ListInstancesRequest.new - # - # # Call the list_instances method. - # result = client.list_instances request - # - # # The returned object is of type Gapic::PagedEnumerable. You can iterate - # # over elements, and API calls will be issued to fetch pages as needed. - # result.each do |item| - # # Each element is of type ::Google::Cloud::SecureSourceManager::V1::Instance. - # p item - # end - # - def list_instances request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::SecureSourceManager::V1::ListInstancesRequest - - # Converts hash 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_instances.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::SecureSourceManager::V1::VERSION, - transports_version_send: [:rest] - - call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - options.apply_defaults timeout: @config.rpcs.list_instances.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.list_instances.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @secure_source_manager_stub.list_instances request, options do |result, operation| - result = ::Gapic::Rest::PagedEnumerable.new @secure_source_manager_stub, :list_instances, "instances", 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 details of a single instance. - # - # @overload get_instance(request, options = nil) - # Pass arguments to `get_instance` via a request object, either of type - # {::Google::Cloud::SecureSourceManager::V1::GetInstanceRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::SecureSourceManager::V1::GetInstanceRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_instance(name: nil) - # Pass arguments to `get_instance` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param name [::String] - # Required. Name of the resource. - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Cloud::SecureSourceManager::V1::Instance] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::SecureSourceManager::V1::Instance] - # - # @raise [::Google::Cloud::Error] if the REST call is aborted. - # - # @example Basic example - # require "google/cloud/secure_source_manager/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::SecureSourceManager::V1::SecureSourceManager::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::SecureSourceManager::V1::GetInstanceRequest.new - # - # # Call the get_instance method. - # result = client.get_instance request - # - # # The returned object is of type Google::Cloud::SecureSourceManager::V1::Instance. - # p result - # - def get_instance request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::SecureSourceManager::V1::GetInstanceRequest - - # Converts hash 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_instance.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::SecureSourceManager::V1::VERSION, - transports_version_send: [:rest] - - call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - options.apply_defaults timeout: @config.rpcs.get_instance.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.get_instance.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @secure_source_manager_stub.get_instance request, options do |result, operation| - yield result, operation if block_given? - end - rescue ::Gapic::Rest::Error => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Creates a new instance in a given project and location. - # - # @overload create_instance(request, options = nil) - # Pass arguments to `create_instance` via a request object, either of type - # {::Google::Cloud::SecureSourceManager::V1::CreateInstanceRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::SecureSourceManager::V1::CreateInstanceRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_instance(parent: nil, instance_id: nil, instance: nil, request_id: nil) - # Pass arguments to `create_instance` via keyword arguments. Note that at - # least one keyword argument is 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. Value for parent. - # @param instance_id [::String] - # Required. ID of the instance to be created. - # @param instance [::Google::Cloud::SecureSourceManager::V1::Instance, ::Hash] - # Required. The resource being created. - # @param request_id [::String] - # Optional. An optional request ID to identify requests. Specify a unique - # request ID so that if you must retry your request, the server will know to - # ignore the request if it has already been completed. The server will - # guarantee that for at least 60 minutes since the first request. - # - # For example, consider a situation where you make an initial request and - # the request times out. If you make the request again with the same request - # ID, the server can check if original operation with the same request ID - # was received, and if so, will ignore the second request. This prevents - # clients from accidentally creating duplicate commitments. - # - # The request ID must be a valid UUID with the exception that zero UUID is - # not supported (00000000-0000-0000-0000-000000000000). - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Gapic::Operation] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Gapic::Operation] - # - # @raise [::Google::Cloud::Error] if the REST call is aborted. - # - # @example Basic example - # require "google/cloud/secure_source_manager/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::SecureSourceManager::V1::SecureSourceManager::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::SecureSourceManager::V1::CreateInstanceRequest.new - # - # # Call the create_instance method. - # result = client.create_instance 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_instance request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::SecureSourceManager::V1::CreateInstanceRequest - - # Converts hash 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_instance.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::SecureSourceManager::V1::VERSION, - transports_version_send: [:rest] - - call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - options.apply_defaults timeout: @config.rpcs.create_instance.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.create_instance.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @secure_source_manager_stub.create_instance 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 single instance. - # - # @overload delete_instance(request, options = nil) - # Pass arguments to `delete_instance` via a request object, either of type - # {::Google::Cloud::SecureSourceManager::V1::DeleteInstanceRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::SecureSourceManager::V1::DeleteInstanceRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_instance(name: nil, request_id: nil) - # Pass arguments to `delete_instance` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param name [::String] - # Required. Name of the resource. - # @param request_id [::String] - # Optional. An optional request ID to identify requests. Specify a unique - # request ID so that if you must retry your request, the server will know to - # ignore the request if it has already been completed. The server will - # guarantee that for at least 60 minutes after the first request. - # - # For example, consider a situation where you make an initial request and - # the request times out. If you make the request again with the same request - # ID, the server can check if original operation with the same request ID - # was received, and if so, will ignore the second request. This prevents - # clients from accidentally creating duplicate commitments. - # - # The request ID must be a valid UUID with the exception that zero UUID is - # not supported (00000000-0000-0000-0000-000000000000). - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Gapic::Operation] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Gapic::Operation] - # - # @raise [::Google::Cloud::Error] if the REST call is aborted. - # - # @example Basic example - # require "google/cloud/secure_source_manager/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::SecureSourceManager::V1::SecureSourceManager::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::SecureSourceManager::V1::DeleteInstanceRequest.new - # - # # Call the delete_instance method. - # result = client.delete_instance 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_instance request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::SecureSourceManager::V1::DeleteInstanceRequest - - # Converts hash 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_instance.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::SecureSourceManager::V1::VERSION, - transports_version_send: [:rest] - - call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - options.apply_defaults timeout: @config.rpcs.delete_instance.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.delete_instance.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @secure_source_manager_stub.delete_instance 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 Repositories in a given project and location. - # - # The instance field is required in the query parameter for requests using - # the securesourcemanager.googleapis.com endpoint. - # - # @overload list_repositories(request, options = nil) - # Pass arguments to `list_repositories` via a request object, either of type - # {::Google::Cloud::SecureSourceManager::V1::ListRepositoriesRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::SecureSourceManager::V1::ListRepositoriesRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_repositories(parent: nil, page_size: nil, page_token: nil, filter: nil, instance: nil) - # Pass arguments to `list_repositories` via keyword arguments. Note that at - # least one keyword argument is 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. Parent value for ListRepositoriesRequest. - # @param page_size [::Integer] - # Optional. Requested page size. Server may return fewer items than - # requested. If unspecified, server will pick an appropriate default. - # @param page_token [::String] - # A token identifying a page of results the server should return. - # @param filter [::String] - # Optional. Filter results. - # @param instance [::String] - # Optional. The name of the instance in which the repository is hosted, - # formatted as - # `projects/{project_number}/locations/{location_id}/instances/{instance_id}`. - # When listing repositories via securesourcemanager.googleapis.com, this - # field is required. When listing repositories via *.sourcemanager.dev, this - # field is ignored. - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Gapic::Rest::PagedEnumerable<::Google::Cloud::SecureSourceManager::V1::Repository>] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Gapic::Rest::PagedEnumerable<::Google::Cloud::SecureSourceManager::V1::Repository>] - # - # @raise [::Google::Cloud::Error] if the REST call is aborted. - # - # @example Basic example - # require "google/cloud/secure_source_manager/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::SecureSourceManager::V1::SecureSourceManager::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::SecureSourceManager::V1::ListRepositoriesRequest.new - # - # # Call the list_repositories method. - # result = client.list_repositories request - # - # # The returned object is of type Gapic::PagedEnumerable. You can iterate - # # over elements, and API calls will be issued to fetch pages as needed. - # result.each do |item| - # # Each element is of type ::Google::Cloud::SecureSourceManager::V1::Repository. - # p item - # end - # - def list_repositories request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::SecureSourceManager::V1::ListRepositoriesRequest - - # Converts hash 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_repositories.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::SecureSourceManager::V1::VERSION, - transports_version_send: [:rest] - - call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - options.apply_defaults timeout: @config.rpcs.list_repositories.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.list_repositories.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @secure_source_manager_stub.list_repositories request, options do |result, operation| - result = ::Gapic::Rest::PagedEnumerable.new @secure_source_manager_stub, :list_repositories, "repositories", request, result, options - yield result, operation if block_given? - throw :response, result - end - rescue ::Gapic::Rest::Error => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Gets metadata of a repository. - # - # @overload get_repository(request, options = nil) - # Pass arguments to `get_repository` via a request object, either of type - # {::Google::Cloud::SecureSourceManager::V1::GetRepositoryRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::SecureSourceManager::V1::GetRepositoryRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_repository(name: nil) - # Pass arguments to `get_repository` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param name [::String] - # Required. Name of the repository to retrieve. - # The format is - # `projects/{project_number}/locations/{location_id}/repositories/{repository_id}`. - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Cloud::SecureSourceManager::V1::Repository] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::SecureSourceManager::V1::Repository] - # - # @raise [::Google::Cloud::Error] if the REST call is aborted. - # - # @example Basic example - # require "google/cloud/secure_source_manager/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::SecureSourceManager::V1::SecureSourceManager::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::SecureSourceManager::V1::GetRepositoryRequest.new - # - # # Call the get_repository method. - # result = client.get_repository request - # - # # The returned object is of type Google::Cloud::SecureSourceManager::V1::Repository. - # p result - # - def get_repository request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::SecureSourceManager::V1::GetRepositoryRequest - - # Converts hash 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_repository.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::SecureSourceManager::V1::VERSION, - transports_version_send: [:rest] - - call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - options.apply_defaults timeout: @config.rpcs.get_repository.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.get_repository.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @secure_source_manager_stub.get_repository request, options do |result, operation| - yield result, operation if block_given? - end - rescue ::Gapic::Rest::Error => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Creates a new repository in a given project and location. - # - # The Repository.Instance field is required in the request body for requests - # using the securesourcemanager.googleapis.com endpoint. - # - # @overload create_repository(request, options = nil) - # Pass arguments to `create_repository` via a request object, either of type - # {::Google::Cloud::SecureSourceManager::V1::CreateRepositoryRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::SecureSourceManager::V1::CreateRepositoryRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_repository(parent: nil, repository: nil, repository_id: nil) - # Pass arguments to `create_repository` via keyword arguments. Note that at - # least one keyword argument is 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 project in which to create the repository. Values are of the - # form `projects/{project_number}/locations/{location_id}` - # @param repository [::Google::Cloud::SecureSourceManager::V1::Repository, ::Hash] - # Required. The resource being created. - # @param repository_id [::String] - # Required. The ID to use for the repository, which will become the final - # component of the repository's resource name. This value should be 4-63 - # characters, and valid characters are /[a-z][0-9]-/. - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Gapic::Operation] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Gapic::Operation] - # - # @raise [::Google::Cloud::Error] if the REST call is aborted. - # - # @example Basic example - # require "google/cloud/secure_source_manager/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::SecureSourceManager::V1::SecureSourceManager::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::SecureSourceManager::V1::CreateRepositoryRequest.new - # - # # Call the create_repository method. - # result = client.create_repository 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_repository request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::SecureSourceManager::V1::CreateRepositoryRequest - - # Converts hash 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_repository.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::SecureSourceManager::V1::VERSION, - transports_version_send: [:rest] - - call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - options.apply_defaults timeout: @config.rpcs.create_repository.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.create_repository.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @secure_source_manager_stub.create_repository 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 - - ## - # Updates the metadata of a repository. - # - # @overload update_repository(request, options = nil) - # Pass arguments to `update_repository` via a request object, either of type - # {::Google::Cloud::SecureSourceManager::V1::UpdateRepositoryRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::SecureSourceManager::V1::UpdateRepositoryRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_repository(update_mask: nil, repository: nil, validate_only: nil) - # Pass arguments to `update_repository` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param update_mask [::Google::Protobuf::FieldMask, ::Hash] - # Optional. Field mask is used to specify the fields to be overwritten in the - # repository resource by the update. - # The fields specified in the update_mask are relative to the resource, not - # the full request. A field will be overwritten if it is in the mask. If the - # user does not provide a mask then all fields will be overwritten. - # @param repository [::Google::Cloud::SecureSourceManager::V1::Repository, ::Hash] - # Required. The repository being updated. - # @param validate_only [::Boolean] - # Optional. False by default. If set to true, the request is validated and - # the user is provided with an expected result, but no actual change is made. - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Gapic::Operation] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Gapic::Operation] - # - # @raise [::Google::Cloud::Error] if the REST call is aborted. - # - # @example Basic example - # require "google/cloud/secure_source_manager/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::SecureSourceManager::V1::SecureSourceManager::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::SecureSourceManager::V1::UpdateRepositoryRequest.new - # - # # Call the update_repository method. - # result = client.update_repository 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_repository request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::SecureSourceManager::V1::UpdateRepositoryRequest - - # Converts hash 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_repository.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::SecureSourceManager::V1::VERSION, - transports_version_send: [:rest] - - call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - options.apply_defaults timeout: @config.rpcs.update_repository.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.update_repository.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @secure_source_manager_stub.update_repository 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 Repository. - # - # @overload delete_repository(request, options = nil) - # Pass arguments to `delete_repository` via a request object, either of type - # {::Google::Cloud::SecureSourceManager::V1::DeleteRepositoryRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::SecureSourceManager::V1::DeleteRepositoryRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_repository(name: nil, allow_missing: nil) - # Pass arguments to `delete_repository` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param name [::String] - # Required. Name of the repository to delete. - # The format is - # `projects/{project_number}/locations/{location_id}/repositories/{repository_id}`. - # @param allow_missing [::Boolean] - # Optional. If set to true, and the repository is not found, the request will - # succeed but no action will be taken on the server. - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Gapic::Operation] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Gapic::Operation] - # - # @raise [::Google::Cloud::Error] if the REST call is aborted. - # - # @example Basic example - # require "google/cloud/secure_source_manager/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::SecureSourceManager::V1::SecureSourceManager::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::SecureSourceManager::V1::DeleteRepositoryRequest.new - # - # # Call the delete_repository method. - # result = client.delete_repository 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_repository request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::SecureSourceManager::V1::DeleteRepositoryRequest - - # Converts hash 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_repository.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::SecureSourceManager::V1::VERSION, - transports_version_send: [:rest] - - call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - options.apply_defaults timeout: @config.rpcs.delete_repository.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.delete_repository.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @secure_source_manager_stub.delete_repository 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 hooks in a given repository. - # - # @overload list_hooks(request, options = nil) - # Pass arguments to `list_hooks` via a request object, either of type - # {::Google::Cloud::SecureSourceManager::V1::ListHooksRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::SecureSourceManager::V1::ListHooksRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_hooks(parent: nil, page_size: nil, page_token: nil) - # Pass arguments to `list_hooks` via keyword arguments. Note that at - # least one keyword argument is 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. Parent value for ListHooksRequest. - # @param page_size [::Integer] - # Optional. Requested page size. Server may return fewer items than - # requested. If unspecified, server will pick an appropriate default. - # @param page_token [::String] - # Optional. A token identifying a page of results the server should return. - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Gapic::Rest::PagedEnumerable<::Google::Cloud::SecureSourceManager::V1::Hook>] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Gapic::Rest::PagedEnumerable<::Google::Cloud::SecureSourceManager::V1::Hook>] - # - # @raise [::Google::Cloud::Error] if the REST call is aborted. - # - # @example Basic example - # require "google/cloud/secure_source_manager/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::SecureSourceManager::V1::SecureSourceManager::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::SecureSourceManager::V1::ListHooksRequest.new - # - # # Call the list_hooks method. - # result = client.list_hooks request - # - # # The returned object is of type Gapic::PagedEnumerable. You can iterate - # # over elements, and API calls will be issued to fetch pages as needed. - # result.each do |item| - # # Each element is of type ::Google::Cloud::SecureSourceManager::V1::Hook. - # p item - # end - # - def list_hooks request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::SecureSourceManager::V1::ListHooksRequest - - # Converts hash 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_hooks.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::SecureSourceManager::V1::VERSION, - transports_version_send: [:rest] - - call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - options.apply_defaults timeout: @config.rpcs.list_hooks.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.list_hooks.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @secure_source_manager_stub.list_hooks request, options do |result, operation| - result = ::Gapic::Rest::PagedEnumerable.new @secure_source_manager_stub, :list_hooks, "hooks", request, result, options - yield result, operation if block_given? - throw :response, result - end - rescue ::Gapic::Rest::Error => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Gets metadata of a hook. - # - # @overload get_hook(request, options = nil) - # Pass arguments to `get_hook` via a request object, either of type - # {::Google::Cloud::SecureSourceManager::V1::GetHookRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::SecureSourceManager::V1::GetHookRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_hook(name: nil) - # Pass arguments to `get_hook` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param name [::String] - # Required. Name of the hook to retrieve. - # The format is - # `projects/{project_number}/locations/{location_id}/repositories/{repository_id}/hooks/{hook_id}`. - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Cloud::SecureSourceManager::V1::Hook] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::SecureSourceManager::V1::Hook] - # - # @raise [::Google::Cloud::Error] if the REST call is aborted. - # - # @example Basic example - # require "google/cloud/secure_source_manager/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::SecureSourceManager::V1::SecureSourceManager::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::SecureSourceManager::V1::GetHookRequest.new - # - # # Call the get_hook method. - # result = client.get_hook request - # - # # The returned object is of type Google::Cloud::SecureSourceManager::V1::Hook. - # p result - # - def get_hook request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::SecureSourceManager::V1::GetHookRequest - - # Converts hash 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_hook.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::SecureSourceManager::V1::VERSION, - transports_version_send: [:rest] - - call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - options.apply_defaults timeout: @config.rpcs.get_hook.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.get_hook.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @secure_source_manager_stub.get_hook request, options do |result, operation| - yield result, operation if block_given? - end - rescue ::Gapic::Rest::Error => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Creates a new hook in a given repository. - # - # @overload create_hook(request, options = nil) - # Pass arguments to `create_hook` via a request object, either of type - # {::Google::Cloud::SecureSourceManager::V1::CreateHookRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::SecureSourceManager::V1::CreateHookRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_hook(parent: nil, hook: nil, hook_id: nil) - # Pass arguments to `create_hook` via keyword arguments. Note that at - # least one keyword argument is 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 repository in which to create the hook. Values are of the - # form - # `projects/{project_number}/locations/{location_id}/repositories/{repository_id}` - # @param hook [::Google::Cloud::SecureSourceManager::V1::Hook, ::Hash] - # Required. The resource being created. - # @param hook_id [::String] - # Required. The ID to use for the hook, which will become the final component - # of the hook's resource name. This value restricts to lower-case letters, - # numbers, and hyphen, with the first character a letter, the last a letter - # or a number, and a 63 character maximum. - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Gapic::Operation] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Gapic::Operation] - # - # @raise [::Google::Cloud::Error] if the REST call is aborted. - # - # @example Basic example - # require "google/cloud/secure_source_manager/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::SecureSourceManager::V1::SecureSourceManager::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::SecureSourceManager::V1::CreateHookRequest.new - # - # # Call the create_hook method. - # result = client.create_hook 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_hook request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::SecureSourceManager::V1::CreateHookRequest - - # Converts hash 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_hook.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::SecureSourceManager::V1::VERSION, - transports_version_send: [:rest] - - call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - options.apply_defaults timeout: @config.rpcs.create_hook.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.create_hook.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @secure_source_manager_stub.create_hook 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 - - ## - # Updates the metadata of a hook. - # - # @overload update_hook(request, options = nil) - # Pass arguments to `update_hook` via a request object, either of type - # {::Google::Cloud::SecureSourceManager::V1::UpdateHookRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::SecureSourceManager::V1::UpdateHookRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_hook(update_mask: nil, hook: nil) - # Pass arguments to `update_hook` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param update_mask [::Google::Protobuf::FieldMask, ::Hash] - # Required. Field mask is used to specify the fields to be overwritten in the - # hook resource by the update. - # The fields specified in the update_mask are relative to the resource, not - # the full request. A field will be overwritten if it is in the mask. - # The special value "*" means full replacement. - # @param hook [::Google::Cloud::SecureSourceManager::V1::Hook, ::Hash] - # Required. The hook being updated. - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Gapic::Operation] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Gapic::Operation] - # - # @raise [::Google::Cloud::Error] if the REST call is aborted. - # - # @example Basic example - # require "google/cloud/secure_source_manager/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::SecureSourceManager::V1::SecureSourceManager::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::SecureSourceManager::V1::UpdateHookRequest.new - # - # # Call the update_hook method. - # result = client.update_hook 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_hook request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::SecureSourceManager::V1::UpdateHookRequest - - # Converts hash 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_hook.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::SecureSourceManager::V1::VERSION, - transports_version_send: [:rest] - - call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - options.apply_defaults timeout: @config.rpcs.update_hook.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.update_hook.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @secure_source_manager_stub.update_hook 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 Hook. - # - # @overload delete_hook(request, options = nil) - # Pass arguments to `delete_hook` via a request object, either of type - # {::Google::Cloud::SecureSourceManager::V1::DeleteHookRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::SecureSourceManager::V1::DeleteHookRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_hook(name: nil) - # Pass arguments to `delete_hook` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param name [::String] - # Required. Name of the hook to delete. - # The format is - # `projects/{project_number}/locations/{location_id}/repositories/{repository_id}/hooks/{hook_id}`. - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Gapic::Operation] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Gapic::Operation] - # - # @raise [::Google::Cloud::Error] if the REST call is aborted. - # - # @example Basic example - # require "google/cloud/secure_source_manager/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::SecureSourceManager::V1::SecureSourceManager::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::SecureSourceManager::V1::DeleteHookRequest.new - # - # # Call the delete_hook method. - # result = client.delete_hook 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_hook request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::SecureSourceManager::V1::DeleteHookRequest - - # Converts hash 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_hook.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::SecureSourceManager::V1::VERSION, - transports_version_send: [:rest] - - call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - options.apply_defaults timeout: @config.rpcs.delete_hook.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.delete_hook.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @secure_source_manager_stub.delete_hook 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 - - ## - # Get IAM policy for a repository. - # - # @overload get_iam_policy_repo(request, options = nil) - # Pass arguments to `get_iam_policy_repo` via a request object, either of type - # {::Google::Iam::V1::GetIamPolicyRequest} or an equivalent Hash. - # - # @param request [::Google::Iam::V1::GetIamPolicyRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @overload get_iam_policy_repo(resource: nil, options: nil) - # Pass arguments to `get_iam_policy_repo` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param resource [::String] - # REQUIRED: The resource for which the policy is being requested. - # See the operation documentation for the appropriate value for this field. - # @param options [::Google::Iam::V1::GetPolicyOptions, ::Hash] - # OPTIONAL: A `GetPolicyOptions` object for specifying options to - # `GetIamPolicy`. - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Iam::V1::Policy] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Iam::V1::Policy] - # - # @raise [::Google::Cloud::Error] if the REST call is aborted. - # - # @example Basic example - # require "google/cloud/secure_source_manager/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::SecureSourceManager::V1::SecureSourceManager::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Iam::V1::GetIamPolicyRequest.new - # - # # Call the get_iam_policy_repo method. - # result = client.get_iam_policy_repo request - # - # # The returned object is of type Google::Iam::V1::Policy. - # p result - # - def get_iam_policy_repo request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Iam::V1::GetIamPolicyRequest - - # Converts hash and nil to an options object - options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h - - # Customize the options with defaults - call_metadata = @config.rpcs.get_iam_policy_repo.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::SecureSourceManager::V1::VERSION, - transports_version_send: [:rest] - - call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - options.apply_defaults timeout: @config.rpcs.get_iam_policy_repo.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.get_iam_policy_repo.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @secure_source_manager_stub.get_iam_policy_repo 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 - - ## - # Set IAM policy on a repository. - # - # @overload set_iam_policy_repo(request, options = nil) - # Pass arguments to `set_iam_policy_repo` via a request object, either of type - # {::Google::Iam::V1::SetIamPolicyRequest} or an equivalent Hash. - # - # @param request [::Google::Iam::V1::SetIamPolicyRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @overload set_iam_policy_repo(resource: nil, policy: nil, update_mask: nil) - # Pass arguments to `set_iam_policy_repo` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param resource [::String] - # REQUIRED: The resource for which the policy is being specified. - # See the operation documentation for the appropriate value for this field. - # @param policy [::Google::Iam::V1::Policy, ::Hash] - # REQUIRED: The complete policy to be applied to the `resource`. The size of - # the policy is limited to a few 10s of KB. An empty policy is a - # valid policy but certain Cloud Platform services (such as Projects) - # might reject them. - # @param update_mask [::Google::Protobuf::FieldMask, ::Hash] - # OPTIONAL: A FieldMask specifying which fields of the policy to modify. Only - # the fields in the mask will be modified. If no mask is provided, the - # following default mask is used: - # - # `paths: "bindings, etag"` - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Iam::V1::Policy] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Iam::V1::Policy] - # - # @raise [::Google::Cloud::Error] if the REST call is aborted. - # - # @example Basic example - # require "google/cloud/secure_source_manager/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::SecureSourceManager::V1::SecureSourceManager::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Iam::V1::SetIamPolicyRequest.new - # - # # Call the set_iam_policy_repo method. - # result = client.set_iam_policy_repo request - # - # # The returned object is of type Google::Iam::V1::Policy. - # p result - # - def set_iam_policy_repo request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Iam::V1::SetIamPolicyRequest - - # Converts hash and nil to an options object - options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h - - # Customize the options with defaults - call_metadata = @config.rpcs.set_iam_policy_repo.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::SecureSourceManager::V1::VERSION, - transports_version_send: [:rest] - - call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - options.apply_defaults timeout: @config.rpcs.set_iam_policy_repo.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.set_iam_policy_repo.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @secure_source_manager_stub.set_iam_policy_repo 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 - - ## - # Test IAM permissions on a repository. - # IAM permission checks are not required on this method. - # - # @overload test_iam_permissions_repo(request, options = nil) - # Pass arguments to `test_iam_permissions_repo` via a request object, either of type - # {::Google::Iam::V1::TestIamPermissionsRequest} or an equivalent Hash. - # - # @param request [::Google::Iam::V1::TestIamPermissionsRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @overload test_iam_permissions_repo(resource: nil, permissions: nil) - # Pass arguments to `test_iam_permissions_repo` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param resource [::String] - # REQUIRED: The resource for which the policy detail is being requested. - # See the operation documentation for the appropriate value for this field. - # @param permissions [::Array<::String>] - # The set of permissions to check for the `resource`. Permissions with - # wildcards (such as '*' or 'storage.*') are not allowed. For more - # information see - # [IAM Overview](https://cloud.google.com/iam/docs/overview#permissions). - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Iam::V1::TestIamPermissionsResponse] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Iam::V1::TestIamPermissionsResponse] - # - # @raise [::Google::Cloud::Error] if the REST call is aborted. - # - # @example Basic example - # require "google/cloud/secure_source_manager/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::SecureSourceManager::V1::SecureSourceManager::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Iam::V1::TestIamPermissionsRequest.new - # - # # Call the test_iam_permissions_repo method. - # result = client.test_iam_permissions_repo request - # - # # The returned object is of type Google::Iam::V1::TestIamPermissionsResponse. - # p result - # - def test_iam_permissions_repo request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Iam::V1::TestIamPermissionsRequest - - # Converts hash and nil to an options object - options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h - - # Customize the options with defaults - call_metadata = @config.rpcs.test_iam_permissions_repo.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::SecureSourceManager::V1::VERSION, - transports_version_send: [:rest] - - call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - options.apply_defaults timeout: @config.rpcs.test_iam_permissions_repo.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.test_iam_permissions_repo.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @secure_source_manager_stub.test_iam_permissions_repo 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 - - ## - # CreateBranchRule creates a branch rule in a given repository. - # - # @overload create_branch_rule(request, options = nil) - # Pass arguments to `create_branch_rule` via a request object, either of type - # {::Google::Cloud::SecureSourceManager::V1::CreateBranchRuleRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::SecureSourceManager::V1::CreateBranchRuleRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_branch_rule(parent: nil, branch_rule: nil, branch_rule_id: nil) - # Pass arguments to `create_branch_rule` via keyword arguments. Note that at - # least one keyword argument is 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] - # @param branch_rule [::Google::Cloud::SecureSourceManager::V1::BranchRule, ::Hash] - # @param branch_rule_id [::String] - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Gapic::Operation] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Gapic::Operation] - # - # @raise [::Google::Cloud::Error] if the REST call is aborted. - # - # @example Basic example - # require "google/cloud/secure_source_manager/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::SecureSourceManager::V1::SecureSourceManager::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::SecureSourceManager::V1::CreateBranchRuleRequest.new - # - # # Call the create_branch_rule method. - # result = client.create_branch_rule 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_branch_rule request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::SecureSourceManager::V1::CreateBranchRuleRequest - - # Converts hash 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_branch_rule.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::SecureSourceManager::V1::VERSION, - transports_version_send: [:rest] - - call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - options.apply_defaults timeout: @config.rpcs.create_branch_rule.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.create_branch_rule.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @secure_source_manager_stub.create_branch_rule 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 - - ## - # ListBranchRules lists branch rules in a given repository. - # - # @overload list_branch_rules(request, options = nil) - # Pass arguments to `list_branch_rules` via a request object, either of type - # {::Google::Cloud::SecureSourceManager::V1::ListBranchRulesRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::SecureSourceManager::V1::ListBranchRulesRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_branch_rules(parent: nil, page_size: nil, page_token: nil) - # Pass arguments to `list_branch_rules` via keyword arguments. Note that at - # least one keyword argument is 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] - # @param page_size [::Integer] - # @param page_token [::String] - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Gapic::Rest::PagedEnumerable<::Google::Cloud::SecureSourceManager::V1::BranchRule>] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Gapic::Rest::PagedEnumerable<::Google::Cloud::SecureSourceManager::V1::BranchRule>] - # - # @raise [::Google::Cloud::Error] if the REST call is aborted. - # - # @example Basic example - # require "google/cloud/secure_source_manager/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::SecureSourceManager::V1::SecureSourceManager::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::SecureSourceManager::V1::ListBranchRulesRequest.new - # - # # Call the list_branch_rules method. - # result = client.list_branch_rules request - # - # # The returned object is of type Gapic::PagedEnumerable. You can iterate - # # over elements, and API calls will be issued to fetch pages as needed. - # result.each do |item| - # # Each element is of type ::Google::Cloud::SecureSourceManager::V1::BranchRule. - # p item - # end - # - def list_branch_rules request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::SecureSourceManager::V1::ListBranchRulesRequest - - # Converts hash 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_branch_rules.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::SecureSourceManager::V1::VERSION, - transports_version_send: [:rest] - - call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - options.apply_defaults timeout: @config.rpcs.list_branch_rules.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.list_branch_rules.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @secure_source_manager_stub.list_branch_rules request, options do |result, operation| - result = ::Gapic::Rest::PagedEnumerable.new @secure_source_manager_stub, :list_branch_rules, "branch_rules", 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 - - ## - # GetBranchRule gets a branch rule. - # - # @overload get_branch_rule(request, options = nil) - # Pass arguments to `get_branch_rule` via a request object, either of type - # {::Google::Cloud::SecureSourceManager::V1::GetBranchRuleRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::SecureSourceManager::V1::GetBranchRuleRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_branch_rule(name: nil) - # Pass arguments to `get_branch_rule` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param name [::String] - # Required. Name of the repository to retrieve. - # The format is - # `projects/{project}/locations/{location}/repositories/{repository}/branchRules/{branch_rule}`. - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Cloud::SecureSourceManager::V1::BranchRule] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::SecureSourceManager::V1::BranchRule] - # - # @raise [::Google::Cloud::Error] if the REST call is aborted. - # - # @example Basic example - # require "google/cloud/secure_source_manager/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::SecureSourceManager::V1::SecureSourceManager::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::SecureSourceManager::V1::GetBranchRuleRequest.new - # - # # Call the get_branch_rule method. - # result = client.get_branch_rule request - # - # # The returned object is of type Google::Cloud::SecureSourceManager::V1::BranchRule. - # p result - # - def get_branch_rule request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::SecureSourceManager::V1::GetBranchRuleRequest - - # Converts hash 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_branch_rule.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::SecureSourceManager::V1::VERSION, - transports_version_send: [:rest] - - call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - options.apply_defaults timeout: @config.rpcs.get_branch_rule.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.get_branch_rule.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @secure_source_manager_stub.get_branch_rule 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 - - ## - # UpdateBranchRule updates a branch rule. - # - # @overload update_branch_rule(request, options = nil) - # Pass arguments to `update_branch_rule` via a request object, either of type - # {::Google::Cloud::SecureSourceManager::V1::UpdateBranchRuleRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::SecureSourceManager::V1::UpdateBranchRuleRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_branch_rule(branch_rule: nil, validate_only: nil, update_mask: nil) - # Pass arguments to `update_branch_rule` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param branch_rule [::Google::Cloud::SecureSourceManager::V1::BranchRule, ::Hash] - # @param validate_only [::Boolean] - # Optional. If set, validate the request and preview the review, but do not - # actually post it. (https://google.aip.dev/163, for declarative friendly) - # @param update_mask [::Google::Protobuf::FieldMask, ::Hash] - # Required. Field mask is used to specify the fields to be overwritten in the - # branchRule resource by the update. - # The fields specified in the update_mask are relative to the resource, not - # the full request. A field will be overwritten if it is in the mask. - # The special value "*" means full replacement. - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Gapic::Operation] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Gapic::Operation] - # - # @raise [::Google::Cloud::Error] if the REST call is aborted. - # - # @example Basic example - # require "google/cloud/secure_source_manager/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::SecureSourceManager::V1::SecureSourceManager::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::SecureSourceManager::V1::UpdateBranchRuleRequest.new - # - # # Call the update_branch_rule method. - # result = client.update_branch_rule 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_branch_rule request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::SecureSourceManager::V1::UpdateBranchRuleRequest - - # Converts hash 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_branch_rule.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::SecureSourceManager::V1::VERSION, - transports_version_send: [:rest] - - call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - options.apply_defaults timeout: @config.rpcs.update_branch_rule.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.update_branch_rule.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @secure_source_manager_stub.update_branch_rule 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 - - ## - # DeleteBranchRule deletes a branch rule. - # - # @overload delete_branch_rule(request, options = nil) - # Pass arguments to `delete_branch_rule` via a request object, either of type - # {::Google::Cloud::SecureSourceManager::V1::DeleteBranchRuleRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::SecureSourceManager::V1::DeleteBranchRuleRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_branch_rule(name: nil, allow_missing: nil) - # Pass arguments to `delete_branch_rule` via keyword arguments. Note that at - # least one keyword argument is 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] - # @param allow_missing [::Boolean] - # Optional. If set to true, and the branch rule is not found, the request - # will succeed but no action will be taken on the server. - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Gapic::Operation] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Gapic::Operation] - # - # @raise [::Google::Cloud::Error] if the REST call is aborted. - # - # @example Basic example - # require "google/cloud/secure_source_manager/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::SecureSourceManager::V1::SecureSourceManager::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::SecureSourceManager::V1::DeleteBranchRuleRequest.new - # - # # Call the delete_branch_rule method. - # result = client.delete_branch_rule 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_branch_rule request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::SecureSourceManager::V1::DeleteBranchRuleRequest - - # Converts hash 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_branch_rule.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::SecureSourceManager::V1::VERSION, - transports_version_send: [:rest] - - call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - options.apply_defaults timeout: @config.rpcs.delete_branch_rule.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.delete_branch_rule.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @secure_source_manager_stub.delete_branch_rule 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 - - ## - # Creates a pull request. - # - # @overload create_pull_request(request, options = nil) - # Pass arguments to `create_pull_request` via a request object, either of type - # {::Google::Cloud::SecureSourceManager::V1::CreatePullRequestRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::SecureSourceManager::V1::CreatePullRequestRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_pull_request(parent: nil, pull_request: nil) - # Pass arguments to `create_pull_request` via keyword arguments. Note that at - # least one keyword argument is 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 repository that the pull request is created from. Format: - # `projects/{project_number}/locations/{location_id}/repositories/{repository_id}` - # @param pull_request [::Google::Cloud::SecureSourceManager::V1::PullRequest, ::Hash] - # Required. The pull request to create. - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Gapic::Operation] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Gapic::Operation] - # - # @raise [::Google::Cloud::Error] if the REST call is aborted. - # - # @example Basic example - # require "google/cloud/secure_source_manager/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::SecureSourceManager::V1::SecureSourceManager::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::SecureSourceManager::V1::CreatePullRequestRequest.new - # - # # Call the create_pull_request method. - # result = client.create_pull_request 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_pull_request request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::SecureSourceManager::V1::CreatePullRequestRequest - - # Converts hash 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_pull_request.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::SecureSourceManager::V1::VERSION, - transports_version_send: [:rest] - - call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - options.apply_defaults timeout: @config.rpcs.create_pull_request.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.create_pull_request.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @secure_source_manager_stub.create_pull_request 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 pull request. - # - # @overload get_pull_request(request, options = nil) - # Pass arguments to `get_pull_request` via a request object, either of type - # {::Google::Cloud::SecureSourceManager::V1::GetPullRequestRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::SecureSourceManager::V1::GetPullRequestRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_pull_request(name: nil) - # Pass arguments to `get_pull_request` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param name [::String] - # Required. Name of the pull request to retrieve. - # The format is - # `projects/{project}/locations/{location}/repositories/{repository}/pullRequests/{pull_request}`. - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Cloud::SecureSourceManager::V1::PullRequest] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::SecureSourceManager::V1::PullRequest] - # - # @raise [::Google::Cloud::Error] if the REST call is aborted. - # - # @example Basic example - # require "google/cloud/secure_source_manager/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::SecureSourceManager::V1::SecureSourceManager::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::SecureSourceManager::V1::GetPullRequestRequest.new - # - # # Call the get_pull_request method. - # result = client.get_pull_request request - # - # # The returned object is of type Google::Cloud::SecureSourceManager::V1::PullRequest. - # p result - # - def get_pull_request request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::SecureSourceManager::V1::GetPullRequestRequest - - # Converts hash 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_pull_request.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::SecureSourceManager::V1::VERSION, - transports_version_send: [:rest] - - call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - options.apply_defaults timeout: @config.rpcs.get_pull_request.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.get_pull_request.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @secure_source_manager_stub.get_pull_request request, options do |result, operation| - yield result, operation if block_given? - end - rescue ::Gapic::Rest::Error => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Lists pull requests in a repository. - # - # @overload list_pull_requests(request, options = nil) - # Pass arguments to `list_pull_requests` via a request object, either of type - # {::Google::Cloud::SecureSourceManager::V1::ListPullRequestsRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::SecureSourceManager::V1::ListPullRequestsRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_pull_requests(parent: nil, page_size: nil, page_token: nil) - # Pass arguments to `list_pull_requests` via keyword arguments. Note that at - # least one keyword argument is 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 repository in which to list pull requests. Format: - # `projects/{project_number}/locations/{location_id}/repositories/{repository_id}` - # @param page_size [::Integer] - # Optional. Requested page size. Server may return fewer items than - # requested. If unspecified, server will pick an appropriate default. - # @param page_token [::String] - # Optional. A token identifying a page of results the server should return. - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Gapic::Rest::PagedEnumerable<::Google::Cloud::SecureSourceManager::V1::PullRequest>] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Gapic::Rest::PagedEnumerable<::Google::Cloud::SecureSourceManager::V1::PullRequest>] - # - # @raise [::Google::Cloud::Error] if the REST call is aborted. - # - # @example Basic example - # require "google/cloud/secure_source_manager/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::SecureSourceManager::V1::SecureSourceManager::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::SecureSourceManager::V1::ListPullRequestsRequest.new - # - # # Call the list_pull_requests method. - # result = client.list_pull_requests request - # - # # The returned object is of type Gapic::PagedEnumerable. You can iterate - # # over elements, and API calls will be issued to fetch pages as needed. - # result.each do |item| - # # Each element is of type ::Google::Cloud::SecureSourceManager::V1::PullRequest. - # p item - # end - # - def list_pull_requests request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::SecureSourceManager::V1::ListPullRequestsRequest - - # Converts hash 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_pull_requests.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::SecureSourceManager::V1::VERSION, - transports_version_send: [:rest] - - call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - options.apply_defaults timeout: @config.rpcs.list_pull_requests.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.list_pull_requests.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @secure_source_manager_stub.list_pull_requests request, options do |result, operation| - result = ::Gapic::Rest::PagedEnumerable.new @secure_source_manager_stub, :list_pull_requests, "pull_requests", 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 - - ## - # Updates a pull request. - # - # @overload update_pull_request(request, options = nil) - # Pass arguments to `update_pull_request` via a request object, either of type - # {::Google::Cloud::SecureSourceManager::V1::UpdatePullRequestRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::SecureSourceManager::V1::UpdatePullRequestRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_pull_request(pull_request: nil, update_mask: nil) - # Pass arguments to `update_pull_request` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param pull_request [::Google::Cloud::SecureSourceManager::V1::PullRequest, ::Hash] - # Required. The pull request to update. - # @param update_mask [::Google::Protobuf::FieldMask, ::Hash] - # Optional. Field mask is used to specify the fields to be overwritten in the - # pull request resource by the update. - # The fields specified in the update_mask are relative to the resource, not - # the full request. A field will be overwritten if it is in the mask. - # The special value "*" means full replacement. - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Gapic::Operation] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Gapic::Operation] - # - # @raise [::Google::Cloud::Error] if the REST call is aborted. - # - # @example Basic example - # require "google/cloud/secure_source_manager/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::SecureSourceManager::V1::SecureSourceManager::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::SecureSourceManager::V1::UpdatePullRequestRequest.new - # - # # Call the update_pull_request method. - # result = client.update_pull_request 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_pull_request request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::SecureSourceManager::V1::UpdatePullRequestRequest - - # Converts hash 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_pull_request.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::SecureSourceManager::V1::VERSION, - transports_version_send: [:rest] - - call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - options.apply_defaults timeout: @config.rpcs.update_pull_request.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.update_pull_request.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @secure_source_manager_stub.update_pull_request 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 - - ## - # Merges a pull request. - # - # @overload merge_pull_request(request, options = nil) - # Pass arguments to `merge_pull_request` via a request object, either of type - # {::Google::Cloud::SecureSourceManager::V1::MergePullRequestRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::SecureSourceManager::V1::MergePullRequestRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @overload merge_pull_request(name: nil) - # Pass arguments to `merge_pull_request` via keyword arguments. Note that at - # least one keyword argument is 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 pull request to merge. - # Format: - # `projects/{project_number}/locations/{location_id}/repositories/{repository_id}/pullRequests/{pull_request_id}` - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Gapic::Operation] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Gapic::Operation] - # - # @raise [::Google::Cloud::Error] if the REST call is aborted. - # - # @example Basic example - # require "google/cloud/secure_source_manager/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::SecureSourceManager::V1::SecureSourceManager::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::SecureSourceManager::V1::MergePullRequestRequest.new - # - # # Call the merge_pull_request method. - # result = client.merge_pull_request 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 merge_pull_request request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::SecureSourceManager::V1::MergePullRequestRequest - - # Converts hash 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.merge_pull_request.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::SecureSourceManager::V1::VERSION, - transports_version_send: [:rest] - - call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - options.apply_defaults timeout: @config.rpcs.merge_pull_request.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.merge_pull_request.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @secure_source_manager_stub.merge_pull_request 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 - - ## - # Opens a pull request. - # - # @overload open_pull_request(request, options = nil) - # Pass arguments to `open_pull_request` via a request object, either of type - # {::Google::Cloud::SecureSourceManager::V1::OpenPullRequestRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::SecureSourceManager::V1::OpenPullRequestRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @overload open_pull_request(name: nil) - # Pass arguments to `open_pull_request` via keyword arguments. Note that at - # least one keyword argument is 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 pull request to open. - # Format: - # `projects/{project_number}/locations/{location_id}/repositories/{repository_id}/pullRequests/{pull_request_id}` - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Gapic::Operation] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Gapic::Operation] - # - # @raise [::Google::Cloud::Error] if the REST call is aborted. - # - # @example Basic example - # require "google/cloud/secure_source_manager/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::SecureSourceManager::V1::SecureSourceManager::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::SecureSourceManager::V1::OpenPullRequestRequest.new - # - # # Call the open_pull_request method. - # result = client.open_pull_request 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 open_pull_request request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::SecureSourceManager::V1::OpenPullRequestRequest - - # Converts hash 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.open_pull_request.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::SecureSourceManager::V1::VERSION, - transports_version_send: [:rest] - - call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - options.apply_defaults timeout: @config.rpcs.open_pull_request.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.open_pull_request.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @secure_source_manager_stub.open_pull_request 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 - - ## - # Closes a pull request without merging. - # - # @overload close_pull_request(request, options = nil) - # Pass arguments to `close_pull_request` via a request object, either of type - # {::Google::Cloud::SecureSourceManager::V1::ClosePullRequestRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::SecureSourceManager::V1::ClosePullRequestRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @overload close_pull_request(name: nil) - # Pass arguments to `close_pull_request` via keyword arguments. Note that at - # least one keyword argument is 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 pull request to close. - # Format: - # `projects/{project_number}/locations/{location_id}/repositories/{repository_id}/pullRequests/{pull_request_id}` - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Gapic::Operation] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Gapic::Operation] - # - # @raise [::Google::Cloud::Error] if the REST call is aborted. - # - # @example Basic example - # require "google/cloud/secure_source_manager/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::SecureSourceManager::V1::SecureSourceManager::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::SecureSourceManager::V1::ClosePullRequestRequest.new - # - # # Call the close_pull_request method. - # result = client.close_pull_request 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 close_pull_request request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::SecureSourceManager::V1::ClosePullRequestRequest - - # Converts hash 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.close_pull_request.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::SecureSourceManager::V1::VERSION, - transports_version_send: [:rest] - - call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - options.apply_defaults timeout: @config.rpcs.close_pull_request.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.close_pull_request.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @secure_source_manager_stub.close_pull_request 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 a pull request's file diffs. - # - # @overload list_pull_request_file_diffs(request, options = nil) - # Pass arguments to `list_pull_request_file_diffs` via a request object, either of type - # {::Google::Cloud::SecureSourceManager::V1::ListPullRequestFileDiffsRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::SecureSourceManager::V1::ListPullRequestFileDiffsRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_pull_request_file_diffs(name: nil, page_size: nil, page_token: nil) - # Pass arguments to `list_pull_request_file_diffs` via keyword arguments. Note that at - # least one keyword argument is 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 pull request to list file diffs for. - # Format: - # `projects/{project_number}/locations/{location_id}/repositories/{repository_id}/pullRequests/{pull_request_id}` - # @param page_size [::Integer] - # Optional. Requested page size. Server may return fewer items than - # requested. If unspecified, server will pick an appropriate default. - # @param page_token [::String] - # Optional. A token identifying a page of results the server should return. - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Gapic::Rest::PagedEnumerable<::Google::Cloud::SecureSourceManager::V1::FileDiff>] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Gapic::Rest::PagedEnumerable<::Google::Cloud::SecureSourceManager::V1::FileDiff>] - # - # @raise [::Google::Cloud::Error] if the REST call is aborted. - # - # @example Basic example - # require "google/cloud/secure_source_manager/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::SecureSourceManager::V1::SecureSourceManager::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::SecureSourceManager::V1::ListPullRequestFileDiffsRequest.new - # - # # Call the list_pull_request_file_diffs method. - # result = client.list_pull_request_file_diffs request - # - # # The returned object is of type Gapic::PagedEnumerable. You can iterate - # # over elements, and API calls will be issued to fetch pages as needed. - # result.each do |item| - # # Each element is of type ::Google::Cloud::SecureSourceManager::V1::FileDiff. - # p item - # end - # - def list_pull_request_file_diffs request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::SecureSourceManager::V1::ListPullRequestFileDiffsRequest - - # Converts hash 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_pull_request_file_diffs.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::SecureSourceManager::V1::VERSION, - transports_version_send: [:rest] - - call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - options.apply_defaults timeout: @config.rpcs.list_pull_request_file_diffs.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.list_pull_request_file_diffs.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @secure_source_manager_stub.list_pull_request_file_diffs request, options do |result, operation| - result = ::Gapic::Rest::PagedEnumerable.new @secure_source_manager_stub, :list_pull_request_file_diffs, "file_diffs", 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 - - ## - # Fetches a tree from a repository. - # - # @overload fetch_tree(request, options = nil) - # Pass arguments to `fetch_tree` via a request object, either of type - # {::Google::Cloud::SecureSourceManager::V1::FetchTreeRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::SecureSourceManager::V1::FetchTreeRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @overload fetch_tree(repository: nil, ref: nil, recursive: nil, page_size: nil, page_token: nil) - # Pass arguments to `fetch_tree` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param repository [::String] - # Required. The format is - # `projects/{project_number}/locations/{location_id}/repositories/{repository_id}`. - # Specifies the repository to fetch the tree from. - # @param ref [::String] - # Optional. `ref` can be a SHA-1 hash, a branch name, or a tag. Specifies - # which tree to fetch. If not specified, the default branch will be used. - # @param recursive [::Boolean] - # Optional. If true, include all subfolders and their files in the response. - # If false, only the immediate children are returned. - # @param page_size [::Integer] - # Optional. Requested page size. Server may return fewer items than - # requested. If unspecified, at most 10,000 items will be returned. - # @param page_token [::String] - # Optional. A token identifying a page of results the server should return. - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Gapic::Rest::PagedEnumerable<::Google::Cloud::SecureSourceManager::V1::TreeEntry>] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Gapic::Rest::PagedEnumerable<::Google::Cloud::SecureSourceManager::V1::TreeEntry>] - # - # @raise [::Google::Cloud::Error] if the REST call is aborted. - # - # @example Basic example - # require "google/cloud/secure_source_manager/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::SecureSourceManager::V1::SecureSourceManager::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::SecureSourceManager::V1::FetchTreeRequest.new - # - # # Call the fetch_tree method. - # result = client.fetch_tree request - # - # # The returned object is of type Gapic::PagedEnumerable. You can iterate - # # over elements, and API calls will be issued to fetch pages as needed. - # result.each do |item| - # # Each element is of type ::Google::Cloud::SecureSourceManager::V1::TreeEntry. - # p item - # end - # - def fetch_tree request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::SecureSourceManager::V1::FetchTreeRequest - - # Converts hash 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.fetch_tree.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::SecureSourceManager::V1::VERSION, - transports_version_send: [:rest] - - call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - options.apply_defaults timeout: @config.rpcs.fetch_tree.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.fetch_tree.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @secure_source_manager_stub.fetch_tree request, options do |result, operation| - result = ::Gapic::Rest::PagedEnumerable.new @secure_source_manager_stub, :fetch_tree, "tree_entries", 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 - - ## - # Fetches a blob from a repository. - # - # @overload fetch_blob(request, options = nil) - # Pass arguments to `fetch_blob` via a request object, either of type - # {::Google::Cloud::SecureSourceManager::V1::FetchBlobRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::SecureSourceManager::V1::FetchBlobRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @overload fetch_blob(repository: nil, sha: nil) - # Pass arguments to `fetch_blob` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param repository [::String] - # Required. The format is - # `projects/{project_number}/locations/{location_id}/repositories/{repository_id}`. - # Specifies the repository containing the blob. - # @param sha [::String] - # Required. The SHA-1 hash of the blob to retrieve. - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Cloud::SecureSourceManager::V1::FetchBlobResponse] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::SecureSourceManager::V1::FetchBlobResponse] - # - # @raise [::Google::Cloud::Error] if the REST call is aborted. - # - # @example Basic example - # require "google/cloud/secure_source_manager/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::SecureSourceManager::V1::SecureSourceManager::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::SecureSourceManager::V1::FetchBlobRequest.new - # - # # Call the fetch_blob method. - # result = client.fetch_blob request - # - # # The returned object is of type Google::Cloud::SecureSourceManager::V1::FetchBlobResponse. - # p result - # - def fetch_blob request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::SecureSourceManager::V1::FetchBlobRequest - - # Converts hash 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.fetch_blob.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::SecureSourceManager::V1::VERSION, - transports_version_send: [:rest] - - call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - options.apply_defaults timeout: @config.rpcs.fetch_blob.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.fetch_blob.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @secure_source_manager_stub.fetch_blob request, options do |result, operation| - yield result, operation if block_given? - end - rescue ::Gapic::Rest::Error => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Creates an issue. - # - # @overload create_issue(request, options = nil) - # Pass arguments to `create_issue` via a request object, either of type - # {::Google::Cloud::SecureSourceManager::V1::CreateIssueRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::SecureSourceManager::V1::CreateIssueRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_issue(parent: nil, issue: nil) - # Pass arguments to `create_issue` via keyword arguments. Note that at - # least one keyword argument is 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 repository in which to create the issue. Format: - # `projects/{project_number}/locations/{location_id}/repositories/{repository_id}` - # @param issue [::Google::Cloud::SecureSourceManager::V1::Issue, ::Hash] - # Required. The issue to create. - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Gapic::Operation] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Gapic::Operation] - # - # @raise [::Google::Cloud::Error] if the REST call is aborted. - # - # @example Basic example - # require "google/cloud/secure_source_manager/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::SecureSourceManager::V1::SecureSourceManager::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::SecureSourceManager::V1::CreateIssueRequest.new - # - # # Call the create_issue method. - # result = client.create_issue 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_issue request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::SecureSourceManager::V1::CreateIssueRequest - - # Converts hash 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_issue.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::SecureSourceManager::V1::VERSION, - transports_version_send: [:rest] - - call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - options.apply_defaults timeout: @config.rpcs.create_issue.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.create_issue.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @secure_source_manager_stub.create_issue 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 issue. - # - # @overload get_issue(request, options = nil) - # Pass arguments to `get_issue` via a request object, either of type - # {::Google::Cloud::SecureSourceManager::V1::GetIssueRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::SecureSourceManager::V1::GetIssueRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_issue(name: nil) - # Pass arguments to `get_issue` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param name [::String] - # Required. Name of the issue to retrieve. - # The format is - # `projects/{project}/locations/{location}/repositories/{repository}/issues/{issue_id}`. - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Cloud::SecureSourceManager::V1::Issue] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::SecureSourceManager::V1::Issue] - # - # @raise [::Google::Cloud::Error] if the REST call is aborted. - # - # @example Basic example - # require "google/cloud/secure_source_manager/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::SecureSourceManager::V1::SecureSourceManager::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::SecureSourceManager::V1::GetIssueRequest.new - # - # # Call the get_issue method. - # result = client.get_issue request - # - # # The returned object is of type Google::Cloud::SecureSourceManager::V1::Issue. - # p result - # - def get_issue request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::SecureSourceManager::V1::GetIssueRequest - - # Converts hash 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_issue.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::SecureSourceManager::V1::VERSION, - transports_version_send: [:rest] - - call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - options.apply_defaults timeout: @config.rpcs.get_issue.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.get_issue.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @secure_source_manager_stub.get_issue request, options do |result, operation| - yield result, operation if block_given? - end - rescue ::Gapic::Rest::Error => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Lists issues in a repository. - # - # @overload list_issues(request, options = nil) - # Pass arguments to `list_issues` via a request object, either of type - # {::Google::Cloud::SecureSourceManager::V1::ListIssuesRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::SecureSourceManager::V1::ListIssuesRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_issues(parent: nil, page_size: nil, page_token: nil, filter: nil) - # Pass arguments to `list_issues` via keyword arguments. Note that at - # least one keyword argument is 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 repository in which to list issues. Format: - # `projects/{project_number}/locations/{location_id}/repositories/{repository_id}` - # @param page_size [::Integer] - # Optional. Requested page size. Server may return fewer items than - # requested. If unspecified, server will pick an appropriate default. - # @param page_token [::String] - # Optional. A token identifying a page of results the server should return. - # @param filter [::String] - # Optional. Used to filter the resulting issues list. - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Gapic::Rest::PagedEnumerable<::Google::Cloud::SecureSourceManager::V1::Issue>] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Gapic::Rest::PagedEnumerable<::Google::Cloud::SecureSourceManager::V1::Issue>] - # - # @raise [::Google::Cloud::Error] if the REST call is aborted. - # - # @example Basic example - # require "google/cloud/secure_source_manager/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::SecureSourceManager::V1::SecureSourceManager::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::SecureSourceManager::V1::ListIssuesRequest.new - # - # # Call the list_issues method. - # result = client.list_issues request - # - # # The returned object is of type Gapic::PagedEnumerable. You can iterate - # # over elements, and API calls will be issued to fetch pages as needed. - # result.each do |item| - # # Each element is of type ::Google::Cloud::SecureSourceManager::V1::Issue. - # p item - # end - # - def list_issues request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::SecureSourceManager::V1::ListIssuesRequest - - # Converts hash 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_issues.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::SecureSourceManager::V1::VERSION, - transports_version_send: [:rest] - - call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - options.apply_defaults timeout: @config.rpcs.list_issues.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.list_issues.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @secure_source_manager_stub.list_issues request, options do |result, operation| - result = ::Gapic::Rest::PagedEnumerable.new @secure_source_manager_stub, :list_issues, "issues", 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 - - ## - # Updates a issue. - # - # @overload update_issue(request, options = nil) - # Pass arguments to `update_issue` via a request object, either of type - # {::Google::Cloud::SecureSourceManager::V1::UpdateIssueRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::SecureSourceManager::V1::UpdateIssueRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_issue(issue: nil, update_mask: nil) - # Pass arguments to `update_issue` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param issue [::Google::Cloud::SecureSourceManager::V1::Issue, ::Hash] - # Required. The issue to update. - # @param update_mask [::Google::Protobuf::FieldMask, ::Hash] - # Optional. Field mask is used to specify the fields to be overwritten in the - # issue resource by the update. - # The fields specified in the update_mask are relative to the resource, not - # the full request. A field will be overwritten if it is in the mask. - # The special value "*" means full replacement. - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Gapic::Operation] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Gapic::Operation] - # - # @raise [::Google::Cloud::Error] if the REST call is aborted. - # - # @example Basic example - # require "google/cloud/secure_source_manager/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::SecureSourceManager::V1::SecureSourceManager::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::SecureSourceManager::V1::UpdateIssueRequest.new - # - # # Call the update_issue method. - # result = client.update_issue 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_issue request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::SecureSourceManager::V1::UpdateIssueRequest - - # Converts hash 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_issue.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::SecureSourceManager::V1::VERSION, - transports_version_send: [:rest] - - call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - options.apply_defaults timeout: @config.rpcs.update_issue.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.update_issue.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @secure_source_manager_stub.update_issue 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 issue. - # - # @overload delete_issue(request, options = nil) - # Pass arguments to `delete_issue` via a request object, either of type - # {::Google::Cloud::SecureSourceManager::V1::DeleteIssueRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::SecureSourceManager::V1::DeleteIssueRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_issue(name: nil, etag: nil) - # Pass arguments to `delete_issue` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param name [::String] - # Required. Name of the issue to delete. - # The format is - # `projects/{project_number}/locations/{location_id}/repositories/{repository_id}/issues/{issue_id}`. - # @param etag [::String] - # Optional. The current etag of the issue. - # If the etag is provided and does not match the current etag of the issue, - # deletion will be blocked and an ABORTED error will be returned. - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Gapic::Operation] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Gapic::Operation] - # - # @raise [::Google::Cloud::Error] if the REST call is aborted. - # - # @example Basic example - # require "google/cloud/secure_source_manager/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::SecureSourceManager::V1::SecureSourceManager::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::SecureSourceManager::V1::DeleteIssueRequest.new - # - # # Call the delete_issue method. - # result = client.delete_issue 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_issue request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::SecureSourceManager::V1::DeleteIssueRequest - - # Converts hash 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_issue.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::SecureSourceManager::V1::VERSION, - transports_version_send: [:rest] - - call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - options.apply_defaults timeout: @config.rpcs.delete_issue.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.delete_issue.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @secure_source_manager_stub.delete_issue 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 - - ## - # Opens an issue. - # - # @overload open_issue(request, options = nil) - # Pass arguments to `open_issue` via a request object, either of type - # {::Google::Cloud::SecureSourceManager::V1::OpenIssueRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::SecureSourceManager::V1::OpenIssueRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @overload open_issue(name: nil, etag: nil) - # Pass arguments to `open_issue` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param name [::String] - # Required. Name of the issue to open. - # The format is - # `projects/{project_number}/locations/{location_id}/repositories/{repository_id}/issues/{issue_id}`. - # @param etag [::String] - # Optional. The current etag of the issue. - # If the etag is provided and does not match the current etag of the issue, - # opening will be blocked and an ABORTED error will be returned. - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Gapic::Operation] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Gapic::Operation] - # - # @raise [::Google::Cloud::Error] if the REST call is aborted. - # - # @example Basic example - # require "google/cloud/secure_source_manager/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::SecureSourceManager::V1::SecureSourceManager::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::SecureSourceManager::V1::OpenIssueRequest.new - # - # # Call the open_issue method. - # result = client.open_issue 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 open_issue request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::SecureSourceManager::V1::OpenIssueRequest - - # Converts hash 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.open_issue.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::SecureSourceManager::V1::VERSION, - transports_version_send: [:rest] - - call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - options.apply_defaults timeout: @config.rpcs.open_issue.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.open_issue.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @secure_source_manager_stub.open_issue 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 - - ## - # Closes an issue. - # - # @overload close_issue(request, options = nil) - # Pass arguments to `close_issue` via a request object, either of type - # {::Google::Cloud::SecureSourceManager::V1::CloseIssueRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::SecureSourceManager::V1::CloseIssueRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @overload close_issue(name: nil, etag: nil) - # Pass arguments to `close_issue` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param name [::String] - # Required. Name of the issue to close. - # The format is - # `projects/{project_number}/locations/{location_id}/repositories/{repository_id}/issues/{issue_id}`. - # @param etag [::String] - # Optional. The current etag of the issue. - # If the etag is provided and does not match the current etag of the issue, - # closing will be blocked and an ABORTED error will be returned. - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Gapic::Operation] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Gapic::Operation] - # - # @raise [::Google::Cloud::Error] if the REST call is aborted. - # - # @example Basic example - # require "google/cloud/secure_source_manager/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::SecureSourceManager::V1::SecureSourceManager::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::SecureSourceManager::V1::CloseIssueRequest.new - # - # # Call the close_issue method. - # result = client.close_issue 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 close_issue request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::SecureSourceManager::V1::CloseIssueRequest - - # Converts hash 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.close_issue.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::SecureSourceManager::V1::VERSION, - transports_version_send: [:rest] - - call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - options.apply_defaults timeout: @config.rpcs.close_issue.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.close_issue.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @secure_source_manager_stub.close_issue 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 pull request comment. - # - # @overload get_pull_request_comment(request, options = nil) - # Pass arguments to `get_pull_request_comment` via a request object, either of type - # {::Google::Cloud::SecureSourceManager::V1::GetPullRequestCommentRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::SecureSourceManager::V1::GetPullRequestCommentRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_pull_request_comment(name: nil) - # Pass arguments to `get_pull_request_comment` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param name [::String] - # Required. Name of the pull request comment to retrieve. - # The format is - # `projects/{project_number}/locations/{location_id}/repositories/{repository_id}/pullRequests/{pull_request_id}/pullRequestComments/{comment_id}`. - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Cloud::SecureSourceManager::V1::PullRequestComment] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::SecureSourceManager::V1::PullRequestComment] - # - # @raise [::Google::Cloud::Error] if the REST call is aborted. - # - # @example Basic example - # require "google/cloud/secure_source_manager/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::SecureSourceManager::V1::SecureSourceManager::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::SecureSourceManager::V1::GetPullRequestCommentRequest.new - # - # # Call the get_pull_request_comment method. - # result = client.get_pull_request_comment request - # - # # The returned object is of type Google::Cloud::SecureSourceManager::V1::PullRequestComment. - # p result - # - def get_pull_request_comment request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::SecureSourceManager::V1::GetPullRequestCommentRequest - - # Converts hash 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_pull_request_comment.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::SecureSourceManager::V1::VERSION, - transports_version_send: [:rest] - - call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - options.apply_defaults timeout: @config.rpcs.get_pull_request_comment.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.get_pull_request_comment.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @secure_source_manager_stub.get_pull_request_comment request, options do |result, operation| - yield result, operation if block_given? - end - rescue ::Gapic::Rest::Error => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Lists pull request comments. - # - # @overload list_pull_request_comments(request, options = nil) - # Pass arguments to `list_pull_request_comments` via a request object, either of type - # {::Google::Cloud::SecureSourceManager::V1::ListPullRequestCommentsRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::SecureSourceManager::V1::ListPullRequestCommentsRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_pull_request_comments(parent: nil, page_size: nil, page_token: nil) - # Pass arguments to `list_pull_request_comments` via keyword arguments. Note that at - # least one keyword argument is 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 pull request in which to list pull request comments. Format: - # `projects/{project_number}/locations/{location_id}/repositories/{repository_id}/pullRequests/{pull_request_id}` - # @param page_size [::Integer] - # Optional. Requested page size. If unspecified, at most 100 pull request - # comments will be returned. The maximum value is 100; values above 100 will - # be coerced to 100. - # @param page_token [::String] - # Optional. A token identifying a page of results the server should return. - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Gapic::Rest::PagedEnumerable<::Google::Cloud::SecureSourceManager::V1::PullRequestComment>] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Gapic::Rest::PagedEnumerable<::Google::Cloud::SecureSourceManager::V1::PullRequestComment>] - # - # @raise [::Google::Cloud::Error] if the REST call is aborted. - # - # @example Basic example - # require "google/cloud/secure_source_manager/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::SecureSourceManager::V1::SecureSourceManager::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::SecureSourceManager::V1::ListPullRequestCommentsRequest.new - # - # # Call the list_pull_request_comments method. - # result = client.list_pull_request_comments request - # - # # The returned object is of type Gapic::PagedEnumerable. You can iterate - # # over elements, and API calls will be issued to fetch pages as needed. - # result.each do |item| - # # Each element is of type ::Google::Cloud::SecureSourceManager::V1::PullRequestComment. - # p item - # end - # - def list_pull_request_comments request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::SecureSourceManager::V1::ListPullRequestCommentsRequest - - # Converts hash 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_pull_request_comments.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::SecureSourceManager::V1::VERSION, - transports_version_send: [:rest] - - call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - options.apply_defaults timeout: @config.rpcs.list_pull_request_comments.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.list_pull_request_comments.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @secure_source_manager_stub.list_pull_request_comments request, options do |result, operation| - result = ::Gapic::Rest::PagedEnumerable.new @secure_source_manager_stub, :list_pull_request_comments, "pull_request_comments", request, result, options - yield result, operation if block_given? - throw :response, result - end - rescue ::Gapic::Rest::Error => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Creates a pull request comment. This function is used to create a single - # PullRequestComment of type Comment, or a single PullRequestComment of type - # Code that's replying to another PullRequestComment of type Code. Use - # BatchCreatePullRequestComments to create multiple PullRequestComments for - # code reviews. - # - # @overload create_pull_request_comment(request, options = nil) - # Pass arguments to `create_pull_request_comment` via a request object, either of type - # {::Google::Cloud::SecureSourceManager::V1::CreatePullRequestCommentRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::SecureSourceManager::V1::CreatePullRequestCommentRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_pull_request_comment(parent: nil, pull_request_comment: nil) - # Pass arguments to `create_pull_request_comment` via keyword arguments. Note that at - # least one keyword argument is 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 pull request in which to create the pull request comment. - # Format: - # `projects/{project_number}/locations/{location_id}/repositories/{repository_id}/pullRequests/{pull_request_id}` - # @param pull_request_comment [::Google::Cloud::SecureSourceManager::V1::PullRequestComment, ::Hash] - # Required. The pull request comment to create. - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Gapic::Operation] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Gapic::Operation] - # - # @raise [::Google::Cloud::Error] if the REST call is aborted. - # - # @example Basic example - # require "google/cloud/secure_source_manager/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::SecureSourceManager::V1::SecureSourceManager::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::SecureSourceManager::V1::CreatePullRequestCommentRequest.new - # - # # Call the create_pull_request_comment method. - # result = client.create_pull_request_comment 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_pull_request_comment request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::SecureSourceManager::V1::CreatePullRequestCommentRequest - - # Converts hash 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_pull_request_comment.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::SecureSourceManager::V1::VERSION, - transports_version_send: [:rest] - - call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - options.apply_defaults timeout: @config.rpcs.create_pull_request_comment.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.create_pull_request_comment.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @secure_source_manager_stub.create_pull_request_comment 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 - - ## - # Updates a pull request comment. - # - # @overload update_pull_request_comment(request, options = nil) - # Pass arguments to `update_pull_request_comment` via a request object, either of type - # {::Google::Cloud::SecureSourceManager::V1::UpdatePullRequestCommentRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::SecureSourceManager::V1::UpdatePullRequestCommentRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_pull_request_comment(pull_request_comment: nil, update_mask: nil) - # Pass arguments to `update_pull_request_comment` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param pull_request_comment [::Google::Cloud::SecureSourceManager::V1::PullRequestComment, ::Hash] - # Required. The pull request comment to update. - # @param update_mask [::Google::Protobuf::FieldMask, ::Hash] - # Optional. Field mask is used to specify the fields to be overwritten in the - # pull request comment resource by the update. Updatable fields are - # `body`. - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Gapic::Operation] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Gapic::Operation] - # - # @raise [::Google::Cloud::Error] if the REST call is aborted. - # - # @example Basic example - # require "google/cloud/secure_source_manager/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::SecureSourceManager::V1::SecureSourceManager::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::SecureSourceManager::V1::UpdatePullRequestCommentRequest.new - # - # # Call the update_pull_request_comment method. - # result = client.update_pull_request_comment 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_pull_request_comment request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::SecureSourceManager::V1::UpdatePullRequestCommentRequest - - # Converts hash 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_pull_request_comment.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::SecureSourceManager::V1::VERSION, - transports_version_send: [:rest] - - call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - options.apply_defaults timeout: @config.rpcs.update_pull_request_comment.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.update_pull_request_comment.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @secure_source_manager_stub.update_pull_request_comment 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 pull request comment. - # - # @overload delete_pull_request_comment(request, options = nil) - # Pass arguments to `delete_pull_request_comment` via a request object, either of type - # {::Google::Cloud::SecureSourceManager::V1::DeletePullRequestCommentRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::SecureSourceManager::V1::DeletePullRequestCommentRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_pull_request_comment(name: nil) - # Pass arguments to `delete_pull_request_comment` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param name [::String] - # Required. Name of the pull request comment to delete. - # The format is - # `projects/{project_number}/locations/{location_id}/repositories/{repository_id}/pullRequests/{pull_request_id}/pullRequestComments/{comment_id}`. - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Gapic::Operation] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Gapic::Operation] - # - # @raise [::Google::Cloud::Error] if the REST call is aborted. - # - # @example Basic example - # require "google/cloud/secure_source_manager/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::SecureSourceManager::V1::SecureSourceManager::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::SecureSourceManager::V1::DeletePullRequestCommentRequest.new - # - # # Call the delete_pull_request_comment method. - # result = client.delete_pull_request_comment 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_pull_request_comment request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::SecureSourceManager::V1::DeletePullRequestCommentRequest - - # Converts hash 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_pull_request_comment.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::SecureSourceManager::V1::VERSION, - transports_version_send: [:rest] - - call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - options.apply_defaults timeout: @config.rpcs.delete_pull_request_comment.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.delete_pull_request_comment.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @secure_source_manager_stub.delete_pull_request_comment 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 - - ## - # Batch creates pull request comments. This function is used to create - # multiple PullRequestComments for code review. There needs to be exactly one - # PullRequestComment of type Review, and at most 100 PullRequestComments of - # type Code per request. The Postition of the code comments must be unique - # within the request. - # - # @overload batch_create_pull_request_comments(request, options = nil) - # Pass arguments to `batch_create_pull_request_comments` via a request object, either of type - # {::Google::Cloud::SecureSourceManager::V1::BatchCreatePullRequestCommentsRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::SecureSourceManager::V1::BatchCreatePullRequestCommentsRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @overload batch_create_pull_request_comments(parent: nil, requests: nil) - # Pass arguments to `batch_create_pull_request_comments` via keyword arguments. Note that at - # least one keyword argument is 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 pull request in which to create the pull request comments. - # Format: - # `projects/{project_number}/locations/{location_id}/repositories/{repository_id}/pullRequests/{pull_request_id}` - # @param requests [::Array<::Google::Cloud::SecureSourceManager::V1::CreatePullRequestCommentRequest, ::Hash>] - # Required. The request message specifying the resources to create. There - # should be exactly one CreatePullRequestCommentRequest with CommentDetail - # being REVIEW in the list, and no more than 100 - # CreatePullRequestCommentRequests with CommentDetail being CODE in the list - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Gapic::Operation] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Gapic::Operation] - # - # @raise [::Google::Cloud::Error] if the REST call is aborted. - # - # @example Basic example - # require "google/cloud/secure_source_manager/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::SecureSourceManager::V1::SecureSourceManager::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::SecureSourceManager::V1::BatchCreatePullRequestCommentsRequest.new - # - # # Call the batch_create_pull_request_comments method. - # result = client.batch_create_pull_request_comments 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 batch_create_pull_request_comments request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::SecureSourceManager::V1::BatchCreatePullRequestCommentsRequest - - # Converts hash 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.batch_create_pull_request_comments.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::SecureSourceManager::V1::VERSION, - transports_version_send: [:rest] - - call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - options.apply_defaults timeout: @config.rpcs.batch_create_pull_request_comments.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.batch_create_pull_request_comments.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @secure_source_manager_stub.batch_create_pull_request_comments 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 - - ## - # Resolves pull request comments. A list of PullRequestComment names must be - # provided. The PullRequestComment names must be in the same conversation - # thread. If auto_fill is set, all comments in the conversation thread will - # be resolved. - # - # @overload resolve_pull_request_comments(request, options = nil) - # Pass arguments to `resolve_pull_request_comments` via a request object, either of type - # {::Google::Cloud::SecureSourceManager::V1::ResolvePullRequestCommentsRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::SecureSourceManager::V1::ResolvePullRequestCommentsRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @overload resolve_pull_request_comments(parent: nil, names: nil, auto_fill: nil) - # Pass arguments to `resolve_pull_request_comments` via keyword arguments. Note that at - # least one keyword argument is 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 pull request in which to resolve the pull request comments. - # Format: - # `projects/{project_number}/locations/{location_id}/repositories/{repository_id}/pullRequests/{pull_request_id}` - # @param names [::Array<::String>] - # Required. The names of the pull request comments to resolve. Format: - # `projects/{project_number}/locations/{location_id}/repositories/{repository_id}/pullRequests/{pull_request_id}/pullRequestComments/{comment_id}` - # Only comments from the same threads are allowed in the same request. - # @param auto_fill [::Boolean] - # Optional. If set, at least one comment in a thread is required, rest of the - # comments in the same thread will be automatically updated to resolved. If - # unset, all comments in the same thread need be present. - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Gapic::Operation] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Gapic::Operation] - # - # @raise [::Google::Cloud::Error] if the REST call is aborted. - # - # @example Basic example - # require "google/cloud/secure_source_manager/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::SecureSourceManager::V1::SecureSourceManager::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::SecureSourceManager::V1::ResolvePullRequestCommentsRequest.new - # - # # Call the resolve_pull_request_comments method. - # result = client.resolve_pull_request_comments 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 resolve_pull_request_comments request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::SecureSourceManager::V1::ResolvePullRequestCommentsRequest - - # Converts hash 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.resolve_pull_request_comments.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::SecureSourceManager::V1::VERSION, - transports_version_send: [:rest] - - call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - options.apply_defaults timeout: @config.rpcs.resolve_pull_request_comments.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.resolve_pull_request_comments.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @secure_source_manager_stub.resolve_pull_request_comments 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 - - ## - # Unresolves pull request comments. A list of PullRequestComment names must - # be provided. The PullRequestComment names must be in the same conversation - # thread. If auto_fill is set, all comments in the conversation thread will - # be unresolved. - # - # @overload unresolve_pull_request_comments(request, options = nil) - # Pass arguments to `unresolve_pull_request_comments` via a request object, either of type - # {::Google::Cloud::SecureSourceManager::V1::UnresolvePullRequestCommentsRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::SecureSourceManager::V1::UnresolvePullRequestCommentsRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @overload unresolve_pull_request_comments(parent: nil, names: nil, auto_fill: nil) - # Pass arguments to `unresolve_pull_request_comments` via keyword arguments. Note that at - # least one keyword argument is 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 pull request in which to resolve the pull request comments. - # Format: - # `projects/{project_number}/locations/{location_id}/repositories/{repository_id}/pullRequests/{pull_request_id}` - # @param names [::Array<::String>] - # Required. The names of the pull request comments to unresolve. Format: - # `projects/{project_number}/locations/{location_id}/repositories/{repository_id}/pullRequests/{pull_request_id}/pullRequestComments/{comment_id}` - # Only comments from the same threads are allowed in the same request. - # @param auto_fill [::Boolean] - # Optional. If set, at least one comment in a thread is required, rest of the - # comments in the same thread will be automatically updated to unresolved. If - # unset, all comments in the same thread need be present. - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Gapic::Operation] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Gapic::Operation] - # - # @raise [::Google::Cloud::Error] if the REST call is aborted. - # - # @example Basic example - # require "google/cloud/secure_source_manager/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::SecureSourceManager::V1::SecureSourceManager::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::SecureSourceManager::V1::UnresolvePullRequestCommentsRequest.new - # - # # Call the unresolve_pull_request_comments method. - # result = client.unresolve_pull_request_comments 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 unresolve_pull_request_comments request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::SecureSourceManager::V1::UnresolvePullRequestCommentsRequest - - # Converts hash 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.unresolve_pull_request_comments.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::SecureSourceManager::V1::VERSION, - transports_version_send: [:rest] - - call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - options.apply_defaults timeout: @config.rpcs.unresolve_pull_request_comments.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.unresolve_pull_request_comments.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @secure_source_manager_stub.unresolve_pull_request_comments 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 - - ## - # Creates an issue comment. - # - # @overload create_issue_comment(request, options = nil) - # Pass arguments to `create_issue_comment` via a request object, either of type - # {::Google::Cloud::SecureSourceManager::V1::CreateIssueCommentRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::SecureSourceManager::V1::CreateIssueCommentRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_issue_comment(parent: nil, issue_comment: nil) - # Pass arguments to `create_issue_comment` via keyword arguments. Note that at - # least one keyword argument is 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 issue in which to create the issue comment. Format: - # `projects/{project_number}/locations/{location_id}/repositories/{repository_id}/issues/{issue_id}` - # @param issue_comment [::Google::Cloud::SecureSourceManager::V1::IssueComment, ::Hash] - # Required. The issue comment to create. - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Gapic::Operation] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Gapic::Operation] - # - # @raise [::Google::Cloud::Error] if the REST call is aborted. - # - # @example Basic example - # require "google/cloud/secure_source_manager/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::SecureSourceManager::V1::SecureSourceManager::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::SecureSourceManager::V1::CreateIssueCommentRequest.new - # - # # Call the create_issue_comment method. - # result = client.create_issue_comment 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_issue_comment request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::SecureSourceManager::V1::CreateIssueCommentRequest - - # Converts hash 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_issue_comment.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::SecureSourceManager::V1::VERSION, - transports_version_send: [:rest] - - call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - options.apply_defaults timeout: @config.rpcs.create_issue_comment.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.create_issue_comment.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @secure_source_manager_stub.create_issue_comment 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 issue comment. - # - # @overload get_issue_comment(request, options = nil) - # Pass arguments to `get_issue_comment` via a request object, either of type - # {::Google::Cloud::SecureSourceManager::V1::GetIssueCommentRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::SecureSourceManager::V1::GetIssueCommentRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_issue_comment(name: nil) - # Pass arguments to `get_issue_comment` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param name [::String] - # Required. Name of the issue comment to retrieve. - # The format is - # `projects/{project}/locations/{location}/repositories/{repository}/issues/{issue_id}/issueComments/{comment_id}`. - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Cloud::SecureSourceManager::V1::IssueComment] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::SecureSourceManager::V1::IssueComment] - # - # @raise [::Google::Cloud::Error] if the REST call is aborted. - # - # @example Basic example - # require "google/cloud/secure_source_manager/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::SecureSourceManager::V1::SecureSourceManager::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::SecureSourceManager::V1::GetIssueCommentRequest.new - # - # # Call the get_issue_comment method. - # result = client.get_issue_comment request - # - # # The returned object is of type Google::Cloud::SecureSourceManager::V1::IssueComment. - # p result - # - def get_issue_comment request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::SecureSourceManager::V1::GetIssueCommentRequest - - # Converts hash 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_issue_comment.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::SecureSourceManager::V1::VERSION, - transports_version_send: [:rest] - - call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - options.apply_defaults timeout: @config.rpcs.get_issue_comment.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.get_issue_comment.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @secure_source_manager_stub.get_issue_comment request, options do |result, operation| - yield result, operation if block_given? - end - rescue ::Gapic::Rest::Error => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Lists comments in an issue. - # - # @overload list_issue_comments(request, options = nil) - # Pass arguments to `list_issue_comments` via a request object, either of type - # {::Google::Cloud::SecureSourceManager::V1::ListIssueCommentsRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::SecureSourceManager::V1::ListIssueCommentsRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_issue_comments(parent: nil, page_size: nil, page_token: nil) - # Pass arguments to `list_issue_comments` via keyword arguments. Note that at - # least one keyword argument is 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 issue in which to list the comments. Format: - # `projects/{project_number}/locations/{location_id}/repositories/{repository_id}/issues/{issue_id}` - # @param page_size [::Integer] - # Optional. Requested page size. Server may return fewer items than - # requested. If unspecified, server will pick an appropriate default. - # @param page_token [::String] - # Optional. A token identifying a page of results the server should return. - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Gapic::Rest::PagedEnumerable<::Google::Cloud::SecureSourceManager::V1::IssueComment>] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Gapic::Rest::PagedEnumerable<::Google::Cloud::SecureSourceManager::V1::IssueComment>] - # - # @raise [::Google::Cloud::Error] if the REST call is aborted. - # - # @example Basic example - # require "google/cloud/secure_source_manager/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::SecureSourceManager::V1::SecureSourceManager::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::SecureSourceManager::V1::ListIssueCommentsRequest.new - # - # # Call the list_issue_comments method. - # result = client.list_issue_comments request - # - # # The returned object is of type Gapic::PagedEnumerable. You can iterate - # # over elements, and API calls will be issued to fetch pages as needed. - # result.each do |item| - # # Each element is of type ::Google::Cloud::SecureSourceManager::V1::IssueComment. - # p item - # end - # - def list_issue_comments request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::SecureSourceManager::V1::ListIssueCommentsRequest - - # Converts hash 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_issue_comments.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::SecureSourceManager::V1::VERSION, - transports_version_send: [:rest] - - call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - options.apply_defaults timeout: @config.rpcs.list_issue_comments.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.list_issue_comments.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @secure_source_manager_stub.list_issue_comments request, options do |result, operation| - result = ::Gapic::Rest::PagedEnumerable.new @secure_source_manager_stub, :list_issue_comments, "issue_comments", 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 - - ## - # Updates an issue comment. - # - # @overload update_issue_comment(request, options = nil) - # Pass arguments to `update_issue_comment` via a request object, either of type - # {::Google::Cloud::SecureSourceManager::V1::UpdateIssueCommentRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::SecureSourceManager::V1::UpdateIssueCommentRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_issue_comment(issue_comment: nil, update_mask: nil) - # Pass arguments to `update_issue_comment` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param issue_comment [::Google::Cloud::SecureSourceManager::V1::IssueComment, ::Hash] - # Required. The issue comment to update. - # @param update_mask [::Google::Protobuf::FieldMask, ::Hash] - # Optional. Field mask is used to specify the fields to be overwritten in the - # issue comment resource by the update. - # The fields specified in the update_mask are relative to the resource, not - # the full request. A field will be overwritten if it is in the mask. - # The special value "*" means full replacement. - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Gapic::Operation] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Gapic::Operation] - # - # @raise [::Google::Cloud::Error] if the REST call is aborted. - # - # @example Basic example - # require "google/cloud/secure_source_manager/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::SecureSourceManager::V1::SecureSourceManager::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::SecureSourceManager::V1::UpdateIssueCommentRequest.new - # - # # Call the update_issue_comment method. - # result = client.update_issue_comment 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_issue_comment request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::SecureSourceManager::V1::UpdateIssueCommentRequest - - # Converts hash 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_issue_comment.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::SecureSourceManager::V1::VERSION, - transports_version_send: [:rest] - - call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - options.apply_defaults timeout: @config.rpcs.update_issue_comment.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.update_issue_comment.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @secure_source_manager_stub.update_issue_comment 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 issue comment. - # - # @overload delete_issue_comment(request, options = nil) - # Pass arguments to `delete_issue_comment` via a request object, either of type - # {::Google::Cloud::SecureSourceManager::V1::DeleteIssueCommentRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::SecureSourceManager::V1::DeleteIssueCommentRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_issue_comment(name: nil) - # Pass arguments to `delete_issue_comment` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param name [::String] - # Required. Name of the issue comment to delete. - # The format is - # `projects/{project_number}/locations/{location_id}/repositories/{repository_id}/issues/{issue_id}/issueComments/{comment_id}`. - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Gapic::Operation] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Gapic::Operation] - # - # @raise [::Google::Cloud::Error] if the REST call is aborted. - # - # @example Basic example - # require "google/cloud/secure_source_manager/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::SecureSourceManager::V1::SecureSourceManager::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::SecureSourceManager::V1::DeleteIssueCommentRequest.new - # - # # Call the delete_issue_comment method. - # result = client.delete_issue_comment 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_issue_comment request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::SecureSourceManager::V1::DeleteIssueCommentRequest - - # Converts hash 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_issue_comment.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::SecureSourceManager::V1::VERSION, - transports_version_send: [:rest] - - call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - options.apply_defaults timeout: @config.rpcs.delete_issue_comment.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.delete_issue_comment.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @secure_source_manager_stub.delete_issue_comment 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 - - ## - # Configuration class for the SecureSourceManager REST API. - # - # This class represents the configuration for SecureSourceManager REST, - # providing control over timeouts, retry behavior, logging, transport - # parameters, and other low-level controls. Certain parameters can also be - # applied individually to specific RPCs. See - # {::Google::Cloud::SecureSourceManager::V1::SecureSourceManager::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_instances to 20 seconds, - # # and all remaining timeouts to 10 seconds. - # ::Google::Cloud::SecureSourceManager::V1::SecureSourceManager::Rest::Client.configure do |config| - # config.timeout = 10.0 - # config.rpcs.list_instances.timeout = 20.0 - # end - # - # # Apply the above configuration only to a new client. - # client = ::Google::Cloud::SecureSourceManager::V1::SecureSourceManager::Rest::Client.new do |config| - # config.timeout = 10.0 - # config.rpcs.list_instances.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 = "securesourcemanager.googleapis.com" - - config_attr :endpoint, nil, ::String, nil - config_attr :credentials, nil do |value| - allowed = [::String, ::Hash, ::Proc, ::Symbol, ::Google::Auth::Credentials, ::Google::Auth::BaseClient, ::Signet::OAuth2::Client, nil] - allowed.any? { |klass| klass === value } - end - config_attr :scope, nil, ::String, ::Array, nil - config_attr :lib_name, nil, ::String, nil - config_attr :lib_version, nil, ::String, nil - config_attr :timeout, nil, ::Numeric, nil - config_attr :metadata, nil, ::Hash, nil - config_attr :retry_policy, nil, ::Hash, ::Proc, nil - config_attr :quota_project, nil, ::String, nil - config_attr :universe_domain, nil, ::String, nil - - # @private - # Overrides for http bindings for the RPCs of this service - # are only used when this service is used as mixin, and only - # by the host service. - # @return [::Hash{::Symbol=>::Array<::Gapic::Rest::GrpcTranscoder::HttpBinding>}] - config_attr :bindings_override, {}, ::Hash, nil - config_attr :logger, :default, ::Logger, nil, :default - - # @private - def initialize parent_config = nil - @parent_config = parent_config unless parent_config.nil? - - yield self if block_given? - end - - ## - # Configurations for individual RPCs - # @return [Rpcs] - # - def rpcs - @rpcs ||= begin - parent_rpcs = nil - parent_rpcs = @parent_config.rpcs if defined?(@parent_config) && @parent_config.respond_to?(:rpcs) - Rpcs.new parent_rpcs - end - end - - ## - # Configuration RPC class for the SecureSourceManager 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_instances` - # @return [::Gapic::Config::Method] - # - attr_reader :list_instances - ## - # RPC-specific configuration for `get_instance` - # @return [::Gapic::Config::Method] - # - attr_reader :get_instance - ## - # RPC-specific configuration for `create_instance` - # @return [::Gapic::Config::Method] - # - attr_reader :create_instance - ## - # RPC-specific configuration for `delete_instance` - # @return [::Gapic::Config::Method] - # - attr_reader :delete_instance - ## - # RPC-specific configuration for `list_repositories` - # @return [::Gapic::Config::Method] - # - attr_reader :list_repositories - ## - # RPC-specific configuration for `get_repository` - # @return [::Gapic::Config::Method] - # - attr_reader :get_repository - ## - # RPC-specific configuration for `create_repository` - # @return [::Gapic::Config::Method] - # - attr_reader :create_repository - ## - # RPC-specific configuration for `update_repository` - # @return [::Gapic::Config::Method] - # - attr_reader :update_repository - ## - # RPC-specific configuration for `delete_repository` - # @return [::Gapic::Config::Method] - # - attr_reader :delete_repository - ## - # RPC-specific configuration for `list_hooks` - # @return [::Gapic::Config::Method] - # - attr_reader :list_hooks - ## - # RPC-specific configuration for `get_hook` - # @return [::Gapic::Config::Method] - # - attr_reader :get_hook - ## - # RPC-specific configuration for `create_hook` - # @return [::Gapic::Config::Method] - # - attr_reader :create_hook - ## - # RPC-specific configuration for `update_hook` - # @return [::Gapic::Config::Method] - # - attr_reader :update_hook - ## - # RPC-specific configuration for `delete_hook` - # @return [::Gapic::Config::Method] - # - attr_reader :delete_hook - ## - # RPC-specific configuration for `get_iam_policy_repo` - # @return [::Gapic::Config::Method] - # - attr_reader :get_iam_policy_repo - ## - # RPC-specific configuration for `set_iam_policy_repo` - # @return [::Gapic::Config::Method] - # - attr_reader :set_iam_policy_repo - ## - # RPC-specific configuration for `test_iam_permissions_repo` - # @return [::Gapic::Config::Method] - # - attr_reader :test_iam_permissions_repo - ## - # RPC-specific configuration for `create_branch_rule` - # @return [::Gapic::Config::Method] - # - attr_reader :create_branch_rule - ## - # RPC-specific configuration for `list_branch_rules` - # @return [::Gapic::Config::Method] - # - attr_reader :list_branch_rules - ## - # RPC-specific configuration for `get_branch_rule` - # @return [::Gapic::Config::Method] - # - attr_reader :get_branch_rule - ## - # RPC-specific configuration for `update_branch_rule` - # @return [::Gapic::Config::Method] - # - attr_reader :update_branch_rule - ## - # RPC-specific configuration for `delete_branch_rule` - # @return [::Gapic::Config::Method] - # - attr_reader :delete_branch_rule - ## - # RPC-specific configuration for `create_pull_request` - # @return [::Gapic::Config::Method] - # - attr_reader :create_pull_request - ## - # RPC-specific configuration for `get_pull_request` - # @return [::Gapic::Config::Method] - # - attr_reader :get_pull_request - ## - # RPC-specific configuration for `list_pull_requests` - # @return [::Gapic::Config::Method] - # - attr_reader :list_pull_requests - ## - # RPC-specific configuration for `update_pull_request` - # @return [::Gapic::Config::Method] - # - attr_reader :update_pull_request - ## - # RPC-specific configuration for `merge_pull_request` - # @return [::Gapic::Config::Method] - # - attr_reader :merge_pull_request - ## - # RPC-specific configuration for `open_pull_request` - # @return [::Gapic::Config::Method] - # - attr_reader :open_pull_request - ## - # RPC-specific configuration for `close_pull_request` - # @return [::Gapic::Config::Method] - # - attr_reader :close_pull_request - ## - # RPC-specific configuration for `list_pull_request_file_diffs` - # @return [::Gapic::Config::Method] - # - attr_reader :list_pull_request_file_diffs - ## - # RPC-specific configuration for `fetch_tree` - # @return [::Gapic::Config::Method] - # - attr_reader :fetch_tree - ## - # RPC-specific configuration for `fetch_blob` - # @return [::Gapic::Config::Method] - # - attr_reader :fetch_blob - ## - # RPC-specific configuration for `create_issue` - # @return [::Gapic::Config::Method] - # - attr_reader :create_issue - ## - # RPC-specific configuration for `get_issue` - # @return [::Gapic::Config::Method] - # - attr_reader :get_issue - ## - # RPC-specific configuration for `list_issues` - # @return [::Gapic::Config::Method] - # - attr_reader :list_issues - ## - # RPC-specific configuration for `update_issue` - # @return [::Gapic::Config::Method] - # - attr_reader :update_issue - ## - # RPC-specific configuration for `delete_issue` - # @return [::Gapic::Config::Method] - # - attr_reader :delete_issue - ## - # RPC-specific configuration for `open_issue` - # @return [::Gapic::Config::Method] - # - attr_reader :open_issue - ## - # RPC-specific configuration for `close_issue` - # @return [::Gapic::Config::Method] - # - attr_reader :close_issue - ## - # RPC-specific configuration for `get_pull_request_comment` - # @return [::Gapic::Config::Method] - # - attr_reader :get_pull_request_comment - ## - # RPC-specific configuration for `list_pull_request_comments` - # @return [::Gapic::Config::Method] - # - attr_reader :list_pull_request_comments - ## - # RPC-specific configuration for `create_pull_request_comment` - # @return [::Gapic::Config::Method] - # - attr_reader :create_pull_request_comment - ## - # RPC-specific configuration for `update_pull_request_comment` - # @return [::Gapic::Config::Method] - # - attr_reader :update_pull_request_comment - ## - # RPC-specific configuration for `delete_pull_request_comment` - # @return [::Gapic::Config::Method] - # - attr_reader :delete_pull_request_comment - ## - # RPC-specific configuration for `batch_create_pull_request_comments` - # @return [::Gapic::Config::Method] - # - attr_reader :batch_create_pull_request_comments - ## - # RPC-specific configuration for `resolve_pull_request_comments` - # @return [::Gapic::Config::Method] - # - attr_reader :resolve_pull_request_comments - ## - # RPC-specific configuration for `unresolve_pull_request_comments` - # @return [::Gapic::Config::Method] - # - attr_reader :unresolve_pull_request_comments - ## - # RPC-specific configuration for `create_issue_comment` - # @return [::Gapic::Config::Method] - # - attr_reader :create_issue_comment - ## - # RPC-specific configuration for `get_issue_comment` - # @return [::Gapic::Config::Method] - # - attr_reader :get_issue_comment - ## - # RPC-specific configuration for `list_issue_comments` - # @return [::Gapic::Config::Method] - # - attr_reader :list_issue_comments - ## - # RPC-specific configuration for `update_issue_comment` - # @return [::Gapic::Config::Method] - # - attr_reader :update_issue_comment - ## - # RPC-specific configuration for `delete_issue_comment` - # @return [::Gapic::Config::Method] - # - attr_reader :delete_issue_comment - - # @private - def initialize parent_rpcs = nil - list_instances_config = parent_rpcs.list_instances if parent_rpcs.respond_to? :list_instances - @list_instances = ::Gapic::Config::Method.new list_instances_config - get_instance_config = parent_rpcs.get_instance if parent_rpcs.respond_to? :get_instance - @get_instance = ::Gapic::Config::Method.new get_instance_config - create_instance_config = parent_rpcs.create_instance if parent_rpcs.respond_to? :create_instance - @create_instance = ::Gapic::Config::Method.new create_instance_config - delete_instance_config = parent_rpcs.delete_instance if parent_rpcs.respond_to? :delete_instance - @delete_instance = ::Gapic::Config::Method.new delete_instance_config - list_repositories_config = parent_rpcs.list_repositories if parent_rpcs.respond_to? :list_repositories - @list_repositories = ::Gapic::Config::Method.new list_repositories_config - get_repository_config = parent_rpcs.get_repository if parent_rpcs.respond_to? :get_repository - @get_repository = ::Gapic::Config::Method.new get_repository_config - create_repository_config = parent_rpcs.create_repository if parent_rpcs.respond_to? :create_repository - @create_repository = ::Gapic::Config::Method.new create_repository_config - update_repository_config = parent_rpcs.update_repository if parent_rpcs.respond_to? :update_repository - @update_repository = ::Gapic::Config::Method.new update_repository_config - delete_repository_config = parent_rpcs.delete_repository if parent_rpcs.respond_to? :delete_repository - @delete_repository = ::Gapic::Config::Method.new delete_repository_config - list_hooks_config = parent_rpcs.list_hooks if parent_rpcs.respond_to? :list_hooks - @list_hooks = ::Gapic::Config::Method.new list_hooks_config - get_hook_config = parent_rpcs.get_hook if parent_rpcs.respond_to? :get_hook - @get_hook = ::Gapic::Config::Method.new get_hook_config - create_hook_config = parent_rpcs.create_hook if parent_rpcs.respond_to? :create_hook - @create_hook = ::Gapic::Config::Method.new create_hook_config - update_hook_config = parent_rpcs.update_hook if parent_rpcs.respond_to? :update_hook - @update_hook = ::Gapic::Config::Method.new update_hook_config - delete_hook_config = parent_rpcs.delete_hook if parent_rpcs.respond_to? :delete_hook - @delete_hook = ::Gapic::Config::Method.new delete_hook_config - get_iam_policy_repo_config = parent_rpcs.get_iam_policy_repo if parent_rpcs.respond_to? :get_iam_policy_repo - @get_iam_policy_repo = ::Gapic::Config::Method.new get_iam_policy_repo_config - set_iam_policy_repo_config = parent_rpcs.set_iam_policy_repo if parent_rpcs.respond_to? :set_iam_policy_repo - @set_iam_policy_repo = ::Gapic::Config::Method.new set_iam_policy_repo_config - test_iam_permissions_repo_config = parent_rpcs.test_iam_permissions_repo if parent_rpcs.respond_to? :test_iam_permissions_repo - @test_iam_permissions_repo = ::Gapic::Config::Method.new test_iam_permissions_repo_config - create_branch_rule_config = parent_rpcs.create_branch_rule if parent_rpcs.respond_to? :create_branch_rule - @create_branch_rule = ::Gapic::Config::Method.new create_branch_rule_config - list_branch_rules_config = parent_rpcs.list_branch_rules if parent_rpcs.respond_to? :list_branch_rules - @list_branch_rules = ::Gapic::Config::Method.new list_branch_rules_config - get_branch_rule_config = parent_rpcs.get_branch_rule if parent_rpcs.respond_to? :get_branch_rule - @get_branch_rule = ::Gapic::Config::Method.new get_branch_rule_config - update_branch_rule_config = parent_rpcs.update_branch_rule if parent_rpcs.respond_to? :update_branch_rule - @update_branch_rule = ::Gapic::Config::Method.new update_branch_rule_config - delete_branch_rule_config = parent_rpcs.delete_branch_rule if parent_rpcs.respond_to? :delete_branch_rule - @delete_branch_rule = ::Gapic::Config::Method.new delete_branch_rule_config - create_pull_request_config = parent_rpcs.create_pull_request if parent_rpcs.respond_to? :create_pull_request - @create_pull_request = ::Gapic::Config::Method.new create_pull_request_config - get_pull_request_config = parent_rpcs.get_pull_request if parent_rpcs.respond_to? :get_pull_request - @get_pull_request = ::Gapic::Config::Method.new get_pull_request_config - list_pull_requests_config = parent_rpcs.list_pull_requests if parent_rpcs.respond_to? :list_pull_requests - @list_pull_requests = ::Gapic::Config::Method.new list_pull_requests_config - update_pull_request_config = parent_rpcs.update_pull_request if parent_rpcs.respond_to? :update_pull_request - @update_pull_request = ::Gapic::Config::Method.new update_pull_request_config - merge_pull_request_config = parent_rpcs.merge_pull_request if parent_rpcs.respond_to? :merge_pull_request - @merge_pull_request = ::Gapic::Config::Method.new merge_pull_request_config - open_pull_request_config = parent_rpcs.open_pull_request if parent_rpcs.respond_to? :open_pull_request - @open_pull_request = ::Gapic::Config::Method.new open_pull_request_config - close_pull_request_config = parent_rpcs.close_pull_request if parent_rpcs.respond_to? :close_pull_request - @close_pull_request = ::Gapic::Config::Method.new close_pull_request_config - list_pull_request_file_diffs_config = parent_rpcs.list_pull_request_file_diffs if parent_rpcs.respond_to? :list_pull_request_file_diffs - @list_pull_request_file_diffs = ::Gapic::Config::Method.new list_pull_request_file_diffs_config - fetch_tree_config = parent_rpcs.fetch_tree if parent_rpcs.respond_to? :fetch_tree - @fetch_tree = ::Gapic::Config::Method.new fetch_tree_config - fetch_blob_config = parent_rpcs.fetch_blob if parent_rpcs.respond_to? :fetch_blob - @fetch_blob = ::Gapic::Config::Method.new fetch_blob_config - create_issue_config = parent_rpcs.create_issue if parent_rpcs.respond_to? :create_issue - @create_issue = ::Gapic::Config::Method.new create_issue_config - get_issue_config = parent_rpcs.get_issue if parent_rpcs.respond_to? :get_issue - @get_issue = ::Gapic::Config::Method.new get_issue_config - list_issues_config = parent_rpcs.list_issues if parent_rpcs.respond_to? :list_issues - @list_issues = ::Gapic::Config::Method.new list_issues_config - update_issue_config = parent_rpcs.update_issue if parent_rpcs.respond_to? :update_issue - @update_issue = ::Gapic::Config::Method.new update_issue_config - delete_issue_config = parent_rpcs.delete_issue if parent_rpcs.respond_to? :delete_issue - @delete_issue = ::Gapic::Config::Method.new delete_issue_config - open_issue_config = parent_rpcs.open_issue if parent_rpcs.respond_to? :open_issue - @open_issue = ::Gapic::Config::Method.new open_issue_config - close_issue_config = parent_rpcs.close_issue if parent_rpcs.respond_to? :close_issue - @close_issue = ::Gapic::Config::Method.new close_issue_config - get_pull_request_comment_config = parent_rpcs.get_pull_request_comment if parent_rpcs.respond_to? :get_pull_request_comment - @get_pull_request_comment = ::Gapic::Config::Method.new get_pull_request_comment_config - list_pull_request_comments_config = parent_rpcs.list_pull_request_comments if parent_rpcs.respond_to? :list_pull_request_comments - @list_pull_request_comments = ::Gapic::Config::Method.new list_pull_request_comments_config - create_pull_request_comment_config = parent_rpcs.create_pull_request_comment if parent_rpcs.respond_to? :create_pull_request_comment - @create_pull_request_comment = ::Gapic::Config::Method.new create_pull_request_comment_config - update_pull_request_comment_config = parent_rpcs.update_pull_request_comment if parent_rpcs.respond_to? :update_pull_request_comment - @update_pull_request_comment = ::Gapic::Config::Method.new update_pull_request_comment_config - delete_pull_request_comment_config = parent_rpcs.delete_pull_request_comment if parent_rpcs.respond_to? :delete_pull_request_comment - @delete_pull_request_comment = ::Gapic::Config::Method.new delete_pull_request_comment_config - batch_create_pull_request_comments_config = parent_rpcs.batch_create_pull_request_comments if parent_rpcs.respond_to? :batch_create_pull_request_comments - @batch_create_pull_request_comments = ::Gapic::Config::Method.new batch_create_pull_request_comments_config - resolve_pull_request_comments_config = parent_rpcs.resolve_pull_request_comments if parent_rpcs.respond_to? :resolve_pull_request_comments - @resolve_pull_request_comments = ::Gapic::Config::Method.new resolve_pull_request_comments_config - unresolve_pull_request_comments_config = parent_rpcs.unresolve_pull_request_comments if parent_rpcs.respond_to? :unresolve_pull_request_comments - @unresolve_pull_request_comments = ::Gapic::Config::Method.new unresolve_pull_request_comments_config - create_issue_comment_config = parent_rpcs.create_issue_comment if parent_rpcs.respond_to? :create_issue_comment - @create_issue_comment = ::Gapic::Config::Method.new create_issue_comment_config - get_issue_comment_config = parent_rpcs.get_issue_comment if parent_rpcs.respond_to? :get_issue_comment - @get_issue_comment = ::Gapic::Config::Method.new get_issue_comment_config - list_issue_comments_config = parent_rpcs.list_issue_comments if parent_rpcs.respond_to? :list_issue_comments - @list_issue_comments = ::Gapic::Config::Method.new list_issue_comments_config - update_issue_comment_config = parent_rpcs.update_issue_comment if parent_rpcs.respond_to? :update_issue_comment - @update_issue_comment = ::Gapic::Config::Method.new update_issue_comment_config - delete_issue_comment_config = parent_rpcs.delete_issue_comment if parent_rpcs.respond_to? :delete_issue_comment - @delete_issue_comment = ::Gapic::Config::Method.new delete_issue_comment_config - - yield self if block_given? - end - end - end - end - end - end - end - end - end -end diff --git a/owl-bot-staging/google-cloud-secure_source_manager-v1/lib/google/cloud/secure_source_manager/v1/secure_source_manager/rest/operations.rb b/owl-bot-staging/google-cloud-secure_source_manager-v1/lib/google/cloud/secure_source_manager/v1/secure_source_manager/rest/operations.rb deleted file mode 100644 index df0e22afe0d1..000000000000 --- a/owl-bot-staging/google-cloud-secure_source_manager-v1/lib/google/cloud/secure_source_manager/v1/secure_source_manager/rest/operations.rb +++ /dev/null @@ -1,925 +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 Cloud - module SecureSourceManager - module V1 - module SecureSourceManager - module Rest - # Service that implements Longrunning Operations API. - class Operations - # @private - API_VERSION = "" - - # @private - DEFAULT_ENDPOINT_TEMPLATE = "securesourcemanager.$UNIVERSE_DOMAIN$" - - # @private - attr_reader :operations_stub - - ## - # Configuration for the SecureSourceManager 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 SecureSourceManager 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::SecureSourceManager::V1::VERSION, - transports_version_send: [:rest] - - call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - options.apply_defaults timeout: @config.rpcs.list_operations.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.list_operations.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @operations_stub.list_operations request, options do |result, operation| - result = ::Gapic::Rest::PagedEnumerable.new @operations_stub, :list_operations, "operations", request, result, options - yield result, operation if block_given? - 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::SecureSourceManager::V1::VERSION, - transports_version_send: [:rest] - - call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - options.apply_defaults timeout: @config.rpcs.get_operation.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.get_operation.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @operations_stub.get_operation request, options do |result, operation| - result = ::Gapic::Operation.new result, @operations_client, options: options - yield result, operation if block_given? - 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::SecureSourceManager::V1::VERSION, - transports_version_send: [:rest] - - call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - options.apply_defaults timeout: @config.rpcs.delete_operation.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.delete_operation.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @operations_stub.delete_operation request, options do |result, operation| - yield result, operation if block_given? - 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::SecureSourceManager::V1::VERSION, - transports_version_send: [:rest] - - call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - options.apply_defaults timeout: @config.rpcs.cancel_operation.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.cancel_operation.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @operations_stub.cancel_operation request, options do |result, operation| - yield result, operation if block_given? - 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 = "securesourcemanager.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}/operations", - matches: [ - ["name", %r{^projects/[^/]+/locations/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the get_operation REST call - # - # @param request_pb [::Google::Longrunning::GetOperationRequest] - # A request object representing the call parameters. Required. - # @return [Array(String, [String, nil], Hash{String => String})] - # Uri, Body, Query string parameters - def self.transcode_get_operation_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :get, - uri_template: "/v1/{name}", - matches: [ - ["name", %r{^projects/[^/]+/locations/[^/]+/operations/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the delete_operation REST call - # - # @param request_pb [::Google::Longrunning::DeleteOperationRequest] - # A request object representing the call parameters. Required. - # @return [Array(String, [String, nil], Hash{String => String})] - # Uri, Body, Query string parameters - def self.transcode_delete_operation_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :delete, - uri_template: "/v1/{name}", - matches: [ - ["name", %r{^projects/[^/]+/locations/[^/]+/operations/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the cancel_operation REST call - # - # @param request_pb [::Google::Longrunning::CancelOperationRequest] - # A request object representing the call parameters. Required. - # @return [Array(String, [String, nil], Hash{String => String})] - # Uri, Body, Query string parameters - def self.transcode_cancel_operation_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :post, - uri_template: "/v1/{name}:cancel", - body: "*", - matches: [ - ["name", %r{^projects/[^/]+/locations/[^/]+/operations/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - end - end - end - end - end - end -end diff --git a/owl-bot-staging/google-cloud-secure_source_manager-v1/lib/google/cloud/secure_source_manager/v1/secure_source_manager/rest/service_stub.rb b/owl-bot-staging/google-cloud-secure_source_manager-v1/lib/google/cloud/secure_source_manager/v1/secure_source_manager/rest/service_stub.rb deleted file mode 100644 index f85cddd65669..000000000000 --- a/owl-bot-staging/google-cloud-secure_source_manager-v1/lib/google/cloud/secure_source_manager/v1/secure_source_manager/rest/service_stub.rb +++ /dev/null @@ -1,3278 +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/securesourcemanager/v1/secure_source_manager_pb" - -module Google - module Cloud - module SecureSourceManager - module V1 - module SecureSourceManager - module Rest - ## - # REST service stub for the SecureSourceManager service. - # Service stub contains baseline method implementations - # including transcoding, making the REST call, and deserialing the response. - # - class ServiceStub - # @private - def initialize endpoint:, endpoint_template:, universe_domain:, credentials:, logger: - # These require statements are intentionally placed here to initialize - # the REST modules only when it's required. - require "gapic/rest" - - @client_stub = ::Gapic::Rest::ClientStub.new endpoint: endpoint, - endpoint_template: endpoint_template, - universe_domain: universe_domain, - credentials: credentials, - numeric_enums: true, - service_name: self.class, - raise_faraday_errors: false, - logger: logger - end - - ## - # The effective universe domain - # - # @return [String] - # - def universe_domain - @client_stub.universe_domain - end - - ## - # The effective endpoint - # - # @return [String] - # - def endpoint - @client_stub.endpoint - end - - ## - # The logger used for request/response debug logging. - # - # @return [Logger] - # - def logger stub: false - stub ? @client_stub.stub_logger : @client_stub.logger - end - - ## - # Baseline implementation for the list_instances REST call - # - # @param request_pb [::Google::Cloud::SecureSourceManager::V1::ListInstancesRequest] - # A request object representing the call parameters. Required. - # @param options [::Gapic::CallOptions] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Cloud::SecureSourceManager::V1::ListInstancesResponse] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::SecureSourceManager::V1::ListInstancesResponse] - # A result object deserialized from the server's reply - def list_instances request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_list_instances_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_instances", - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Cloud::SecureSourceManager::V1::ListInstancesResponse.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_instance REST call - # - # @param request_pb [::Google::Cloud::SecureSourceManager::V1::GetInstanceRequest] - # A request object representing the call parameters. Required. - # @param options [::Gapic::CallOptions] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Cloud::SecureSourceManager::V1::Instance] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::SecureSourceManager::V1::Instance] - # A result object deserialized from the server's reply - def get_instance request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_get_instance_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_instance", - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Cloud::SecureSourceManager::V1::Instance.decode_json response.body, ignore_unknown_fields: true - catch :response do - yield result, operation if block_given? - result - end - end - - ## - # Baseline implementation for the create_instance REST call - # - # @param request_pb [::Google::Cloud::SecureSourceManager::V1::CreateInstanceRequest] - # 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_instance request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_create_instance_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_instance", - 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_instance REST call - # - # @param request_pb [::Google::Cloud::SecureSourceManager::V1::DeleteInstanceRequest] - # 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_instance request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_delete_instance_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_instance", - 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_repositories REST call - # - # @param request_pb [::Google::Cloud::SecureSourceManager::V1::ListRepositoriesRequest] - # A request object representing the call parameters. Required. - # @param options [::Gapic::CallOptions] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Cloud::SecureSourceManager::V1::ListRepositoriesResponse] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::SecureSourceManager::V1::ListRepositoriesResponse] - # A result object deserialized from the server's reply - def list_repositories request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_list_repositories_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_repositories", - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Cloud::SecureSourceManager::V1::ListRepositoriesResponse.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_repository REST call - # - # @param request_pb [::Google::Cloud::SecureSourceManager::V1::GetRepositoryRequest] - # A request object representing the call parameters. Required. - # @param options [::Gapic::CallOptions] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Cloud::SecureSourceManager::V1::Repository] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::SecureSourceManager::V1::Repository] - # A result object deserialized from the server's reply - def get_repository request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_get_repository_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_repository", - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Cloud::SecureSourceManager::V1::Repository.decode_json response.body, ignore_unknown_fields: true - catch :response do - yield result, operation if block_given? - result - end - end - - ## - # Baseline implementation for the create_repository REST call - # - # @param request_pb [::Google::Cloud::SecureSourceManager::V1::CreateRepositoryRequest] - # 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_repository request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_create_repository_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_repository", - 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 update_repository REST call - # - # @param request_pb [::Google::Cloud::SecureSourceManager::V1::UpdateRepositoryRequest] - # 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_repository request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_update_repository_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_repository", - 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_repository REST call - # - # @param request_pb [::Google::Cloud::SecureSourceManager::V1::DeleteRepositoryRequest] - # 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_repository request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_delete_repository_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_repository", - 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_hooks REST call - # - # @param request_pb [::Google::Cloud::SecureSourceManager::V1::ListHooksRequest] - # A request object representing the call parameters. Required. - # @param options [::Gapic::CallOptions] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Cloud::SecureSourceManager::V1::ListHooksResponse] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::SecureSourceManager::V1::ListHooksResponse] - # A result object deserialized from the server's reply - def list_hooks request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_list_hooks_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_hooks", - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Cloud::SecureSourceManager::V1::ListHooksResponse.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_hook REST call - # - # @param request_pb [::Google::Cloud::SecureSourceManager::V1::GetHookRequest] - # A request object representing the call parameters. Required. - # @param options [::Gapic::CallOptions] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Cloud::SecureSourceManager::V1::Hook] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::SecureSourceManager::V1::Hook] - # A result object deserialized from the server's reply - def get_hook request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_get_hook_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_hook", - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Cloud::SecureSourceManager::V1::Hook.decode_json response.body, ignore_unknown_fields: true - catch :response do - yield result, operation if block_given? - result - end - end - - ## - # Baseline implementation for the create_hook REST call - # - # @param request_pb [::Google::Cloud::SecureSourceManager::V1::CreateHookRequest] - # 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_hook request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_create_hook_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_hook", - 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 update_hook REST call - # - # @param request_pb [::Google::Cloud::SecureSourceManager::V1::UpdateHookRequest] - # 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_hook request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_update_hook_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_hook", - 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_hook REST call - # - # @param request_pb [::Google::Cloud::SecureSourceManager::V1::DeleteHookRequest] - # 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_hook request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_delete_hook_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_hook", - 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_iam_policy_repo REST call - # - # @param request_pb [::Google::Iam::V1::GetIamPolicyRequest] - # A request object representing the call parameters. Required. - # @param options [::Gapic::CallOptions] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Iam::V1::Policy] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Iam::V1::Policy] - # A result object deserialized from the server's reply - def get_iam_policy_repo request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_get_iam_policy_repo_request request_pb - query_string_params = if query_string_params.any? - query_string_params.to_h { |p| p.split "=", 2 } - else - {} - end - - response = @client_stub.make_http_request( - verb, - uri: uri, - body: body || "", - params: query_string_params, - method_name: "get_iam_policy_repo", - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Iam::V1::Policy.decode_json response.body, ignore_unknown_fields: true - catch :response do - yield result, operation if block_given? - result - end - end - - ## - # Baseline implementation for the set_iam_policy_repo REST call - # - # @param request_pb [::Google::Iam::V1::SetIamPolicyRequest] - # A request object representing the call parameters. Required. - # @param options [::Gapic::CallOptions] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Iam::V1::Policy] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Iam::V1::Policy] - # A result object deserialized from the server's reply - def set_iam_policy_repo request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_set_iam_policy_repo_request request_pb - query_string_params = if query_string_params.any? - query_string_params.to_h { |p| p.split "=", 2 } - else - {} - end - - response = @client_stub.make_http_request( - verb, - uri: uri, - body: body || "", - params: query_string_params, - method_name: "set_iam_policy_repo", - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Iam::V1::Policy.decode_json response.body, ignore_unknown_fields: true - catch :response do - yield result, operation if block_given? - result - end - end - - ## - # Baseline implementation for the test_iam_permissions_repo REST call - # - # @param request_pb [::Google::Iam::V1::TestIamPermissionsRequest] - # A request object representing the call parameters. Required. - # @param options [::Gapic::CallOptions] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Iam::V1::TestIamPermissionsResponse] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Iam::V1::TestIamPermissionsResponse] - # A result object deserialized from the server's reply - def test_iam_permissions_repo request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_test_iam_permissions_repo_request request_pb - query_string_params = if query_string_params.any? - query_string_params.to_h { |p| p.split "=", 2 } - else - {} - end - - response = @client_stub.make_http_request( - verb, - uri: uri, - body: body || "", - params: query_string_params, - method_name: "test_iam_permissions_repo", - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Iam::V1::TestIamPermissionsResponse.decode_json response.body, ignore_unknown_fields: true - catch :response do - yield result, operation if block_given? - result - end - end - - ## - # Baseline implementation for the create_branch_rule REST call - # - # @param request_pb [::Google::Cloud::SecureSourceManager::V1::CreateBranchRuleRequest] - # 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_branch_rule request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_create_branch_rule_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_branch_rule", - 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_branch_rules REST call - # - # @param request_pb [::Google::Cloud::SecureSourceManager::V1::ListBranchRulesRequest] - # A request object representing the call parameters. Required. - # @param options [::Gapic::CallOptions] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Cloud::SecureSourceManager::V1::ListBranchRulesResponse] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::SecureSourceManager::V1::ListBranchRulesResponse] - # A result object deserialized from the server's reply - def list_branch_rules request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_list_branch_rules_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_branch_rules", - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Cloud::SecureSourceManager::V1::ListBranchRulesResponse.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_branch_rule REST call - # - # @param request_pb [::Google::Cloud::SecureSourceManager::V1::GetBranchRuleRequest] - # A request object representing the call parameters. Required. - # @param options [::Gapic::CallOptions] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Cloud::SecureSourceManager::V1::BranchRule] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::SecureSourceManager::V1::BranchRule] - # A result object deserialized from the server's reply - def get_branch_rule request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_get_branch_rule_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_branch_rule", - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Cloud::SecureSourceManager::V1::BranchRule.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_branch_rule REST call - # - # @param request_pb [::Google::Cloud::SecureSourceManager::V1::UpdateBranchRuleRequest] - # 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_branch_rule request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_update_branch_rule_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_branch_rule", - 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_branch_rule REST call - # - # @param request_pb [::Google::Cloud::SecureSourceManager::V1::DeleteBranchRuleRequest] - # 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_branch_rule request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_delete_branch_rule_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_branch_rule", - 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 create_pull_request REST call - # - # @param request_pb [::Google::Cloud::SecureSourceManager::V1::CreatePullRequestRequest] - # 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_pull_request request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_create_pull_request_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_pull_request", - 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_pull_request REST call - # - # @param request_pb [::Google::Cloud::SecureSourceManager::V1::GetPullRequestRequest] - # A request object representing the call parameters. Required. - # @param options [::Gapic::CallOptions] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Cloud::SecureSourceManager::V1::PullRequest] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::SecureSourceManager::V1::PullRequest] - # A result object deserialized from the server's reply - def get_pull_request request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_get_pull_request_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_pull_request", - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Cloud::SecureSourceManager::V1::PullRequest.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_pull_requests REST call - # - # @param request_pb [::Google::Cloud::SecureSourceManager::V1::ListPullRequestsRequest] - # A request object representing the call parameters. Required. - # @param options [::Gapic::CallOptions] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Cloud::SecureSourceManager::V1::ListPullRequestsResponse] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::SecureSourceManager::V1::ListPullRequestsResponse] - # A result object deserialized from the server's reply - def list_pull_requests request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_list_pull_requests_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_pull_requests", - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Cloud::SecureSourceManager::V1::ListPullRequestsResponse.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_pull_request REST call - # - # @param request_pb [::Google::Cloud::SecureSourceManager::V1::UpdatePullRequestRequest] - # 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_pull_request request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_update_pull_request_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_pull_request", - 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 merge_pull_request REST call - # - # @param request_pb [::Google::Cloud::SecureSourceManager::V1::MergePullRequestRequest] - # 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 merge_pull_request request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_merge_pull_request_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: "merge_pull_request", - 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 open_pull_request REST call - # - # @param request_pb [::Google::Cloud::SecureSourceManager::V1::OpenPullRequestRequest] - # 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 open_pull_request request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_open_pull_request_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: "open_pull_request", - 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 close_pull_request REST call - # - # @param request_pb [::Google::Cloud::SecureSourceManager::V1::ClosePullRequestRequest] - # 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 close_pull_request request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_close_pull_request_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: "close_pull_request", - 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_pull_request_file_diffs REST call - # - # @param request_pb [::Google::Cloud::SecureSourceManager::V1::ListPullRequestFileDiffsRequest] - # A request object representing the call parameters. Required. - # @param options [::Gapic::CallOptions] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Cloud::SecureSourceManager::V1::ListPullRequestFileDiffsResponse] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::SecureSourceManager::V1::ListPullRequestFileDiffsResponse] - # A result object deserialized from the server's reply - def list_pull_request_file_diffs request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_list_pull_request_file_diffs_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_pull_request_file_diffs", - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Cloud::SecureSourceManager::V1::ListPullRequestFileDiffsResponse.decode_json response.body, ignore_unknown_fields: true - catch :response do - yield result, operation if block_given? - result - end - end - - ## - # Baseline implementation for the fetch_tree REST call - # - # @param request_pb [::Google::Cloud::SecureSourceManager::V1::FetchTreeRequest] - # A request object representing the call parameters. Required. - # @param options [::Gapic::CallOptions] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Cloud::SecureSourceManager::V1::FetchTreeResponse] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::SecureSourceManager::V1::FetchTreeResponse] - # A result object deserialized from the server's reply - def fetch_tree request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_fetch_tree_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: "fetch_tree", - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Cloud::SecureSourceManager::V1::FetchTreeResponse.decode_json response.body, ignore_unknown_fields: true - catch :response do - yield result, operation if block_given? - result - end - end - - ## - # Baseline implementation for the fetch_blob REST call - # - # @param request_pb [::Google::Cloud::SecureSourceManager::V1::FetchBlobRequest] - # A request object representing the call parameters. Required. - # @param options [::Gapic::CallOptions] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Cloud::SecureSourceManager::V1::FetchBlobResponse] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::SecureSourceManager::V1::FetchBlobResponse] - # A result object deserialized from the server's reply - def fetch_blob request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_fetch_blob_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: "fetch_blob", - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Cloud::SecureSourceManager::V1::FetchBlobResponse.decode_json response.body, ignore_unknown_fields: true - catch :response do - yield result, operation if block_given? - result - end - end - - ## - # Baseline implementation for the create_issue REST call - # - # @param request_pb [::Google::Cloud::SecureSourceManager::V1::CreateIssueRequest] - # 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_issue request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_create_issue_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_issue", - 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_issue REST call - # - # @param request_pb [::Google::Cloud::SecureSourceManager::V1::GetIssueRequest] - # A request object representing the call parameters. Required. - # @param options [::Gapic::CallOptions] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Cloud::SecureSourceManager::V1::Issue] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::SecureSourceManager::V1::Issue] - # A result object deserialized from the server's reply - def get_issue request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_get_issue_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_issue", - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Cloud::SecureSourceManager::V1::Issue.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_issues REST call - # - # @param request_pb [::Google::Cloud::SecureSourceManager::V1::ListIssuesRequest] - # A request object representing the call parameters. Required. - # @param options [::Gapic::CallOptions] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Cloud::SecureSourceManager::V1::ListIssuesResponse] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::SecureSourceManager::V1::ListIssuesResponse] - # A result object deserialized from the server's reply - def list_issues request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_list_issues_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_issues", - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Cloud::SecureSourceManager::V1::ListIssuesResponse.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_issue REST call - # - # @param request_pb [::Google::Cloud::SecureSourceManager::V1::UpdateIssueRequest] - # 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_issue request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_update_issue_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_issue", - 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_issue REST call - # - # @param request_pb [::Google::Cloud::SecureSourceManager::V1::DeleteIssueRequest] - # 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_issue request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_delete_issue_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_issue", - 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 open_issue REST call - # - # @param request_pb [::Google::Cloud::SecureSourceManager::V1::OpenIssueRequest] - # 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 open_issue request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_open_issue_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: "open_issue", - 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 close_issue REST call - # - # @param request_pb [::Google::Cloud::SecureSourceManager::V1::CloseIssueRequest] - # 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 close_issue request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_close_issue_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: "close_issue", - 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_pull_request_comment REST call - # - # @param request_pb [::Google::Cloud::SecureSourceManager::V1::GetPullRequestCommentRequest] - # A request object representing the call parameters. Required. - # @param options [::Gapic::CallOptions] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Cloud::SecureSourceManager::V1::PullRequestComment] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::SecureSourceManager::V1::PullRequestComment] - # A result object deserialized from the server's reply - def get_pull_request_comment request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_get_pull_request_comment_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_pull_request_comment", - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Cloud::SecureSourceManager::V1::PullRequestComment.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_pull_request_comments REST call - # - # @param request_pb [::Google::Cloud::SecureSourceManager::V1::ListPullRequestCommentsRequest] - # A request object representing the call parameters. Required. - # @param options [::Gapic::CallOptions] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Cloud::SecureSourceManager::V1::ListPullRequestCommentsResponse] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::SecureSourceManager::V1::ListPullRequestCommentsResponse] - # A result object deserialized from the server's reply - def list_pull_request_comments request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_list_pull_request_comments_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_pull_request_comments", - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Cloud::SecureSourceManager::V1::ListPullRequestCommentsResponse.decode_json response.body, ignore_unknown_fields: true - catch :response do - yield result, operation if block_given? - result - end - end - - ## - # Baseline implementation for the create_pull_request_comment REST call - # - # @param request_pb [::Google::Cloud::SecureSourceManager::V1::CreatePullRequestCommentRequest] - # 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_pull_request_comment request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_create_pull_request_comment_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_pull_request_comment", - 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 update_pull_request_comment REST call - # - # @param request_pb [::Google::Cloud::SecureSourceManager::V1::UpdatePullRequestCommentRequest] - # 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_pull_request_comment request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_update_pull_request_comment_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_pull_request_comment", - 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_pull_request_comment REST call - # - # @param request_pb [::Google::Cloud::SecureSourceManager::V1::DeletePullRequestCommentRequest] - # 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_pull_request_comment request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_delete_pull_request_comment_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_pull_request_comment", - 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 batch_create_pull_request_comments REST call - # - # @param request_pb [::Google::Cloud::SecureSourceManager::V1::BatchCreatePullRequestCommentsRequest] - # 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 batch_create_pull_request_comments request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_batch_create_pull_request_comments_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: "batch_create_pull_request_comments", - 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 resolve_pull_request_comments REST call - # - # @param request_pb [::Google::Cloud::SecureSourceManager::V1::ResolvePullRequestCommentsRequest] - # 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 resolve_pull_request_comments request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_resolve_pull_request_comments_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: "resolve_pull_request_comments", - 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 unresolve_pull_request_comments REST call - # - # @param request_pb [::Google::Cloud::SecureSourceManager::V1::UnresolvePullRequestCommentsRequest] - # 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 unresolve_pull_request_comments request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_unresolve_pull_request_comments_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: "unresolve_pull_request_comments", - 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 create_issue_comment REST call - # - # @param request_pb [::Google::Cloud::SecureSourceManager::V1::CreateIssueCommentRequest] - # 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_issue_comment request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_create_issue_comment_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_issue_comment", - 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_issue_comment REST call - # - # @param request_pb [::Google::Cloud::SecureSourceManager::V1::GetIssueCommentRequest] - # A request object representing the call parameters. Required. - # @param options [::Gapic::CallOptions] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Cloud::SecureSourceManager::V1::IssueComment] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::SecureSourceManager::V1::IssueComment] - # A result object deserialized from the server's reply - def get_issue_comment request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_get_issue_comment_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_issue_comment", - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Cloud::SecureSourceManager::V1::IssueComment.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_issue_comments REST call - # - # @param request_pb [::Google::Cloud::SecureSourceManager::V1::ListIssueCommentsRequest] - # A request object representing the call parameters. Required. - # @param options [::Gapic::CallOptions] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Cloud::SecureSourceManager::V1::ListIssueCommentsResponse] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::SecureSourceManager::V1::ListIssueCommentsResponse] - # A result object deserialized from the server's reply - def list_issue_comments request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_list_issue_comments_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_issue_comments", - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Cloud::SecureSourceManager::V1::ListIssueCommentsResponse.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_issue_comment REST call - # - # @param request_pb [::Google::Cloud::SecureSourceManager::V1::UpdateIssueCommentRequest] - # 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_issue_comment request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_update_issue_comment_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_issue_comment", - 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_issue_comment REST call - # - # @param request_pb [::Google::Cloud::SecureSourceManager::V1::DeleteIssueCommentRequest] - # 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_issue_comment request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_delete_issue_comment_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_issue_comment", - 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 - - ## - # @private - # - # GRPC transcoding helper method for the list_instances REST call - # - # @param request_pb [::Google::Cloud::SecureSourceManager::V1::ListInstancesRequest] - # 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_instances_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :get, - uri_template: "/v1/{parent}/instances", - matches: [ - ["parent", %r{^projects/[^/]+/locations/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the get_instance REST call - # - # @param request_pb [::Google::Cloud::SecureSourceManager::V1::GetInstanceRequest] - # 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_instance_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :get, - uri_template: "/v1/{name}", - matches: [ - ["name", %r{^projects/[^/]+/locations/[^/]+/instances/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the create_instance REST call - # - # @param request_pb [::Google::Cloud::SecureSourceManager::V1::CreateInstanceRequest] - # 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_instance_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :post, - uri_template: "/v1/{parent}/instances", - body: "instance", - matches: [ - ["parent", %r{^projects/[^/]+/locations/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the delete_instance REST call - # - # @param request_pb [::Google::Cloud::SecureSourceManager::V1::DeleteInstanceRequest] - # 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_instance_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :delete, - uri_template: "/v1/{name}", - matches: [ - ["name", %r{^projects/[^/]+/locations/[^/]+/instances/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the list_repositories REST call - # - # @param request_pb [::Google::Cloud::SecureSourceManager::V1::ListRepositoriesRequest] - # 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_repositories_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :get, - uri_template: "/v1/{parent}/repositories", - matches: [ - ["parent", %r{^projects/[^/]+/locations/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the get_repository REST call - # - # @param request_pb [::Google::Cloud::SecureSourceManager::V1::GetRepositoryRequest] - # 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_repository_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :get, - uri_template: "/v1/{name}", - matches: [ - ["name", %r{^projects/[^/]+/locations/[^/]+/repositories/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the create_repository REST call - # - # @param request_pb [::Google::Cloud::SecureSourceManager::V1::CreateRepositoryRequest] - # 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_repository_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :post, - uri_template: "/v1/{parent}/repositories", - body: "repository", - matches: [ - ["parent", %r{^projects/[^/]+/locations/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the update_repository REST call - # - # @param request_pb [::Google::Cloud::SecureSourceManager::V1::UpdateRepositoryRequest] - # 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_repository_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :patch, - uri_template: "/v1/{repository.name}", - body: "repository", - matches: [ - ["repository.name", %r{^projects/[^/]+/locations/[^/]+/repositories/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the delete_repository REST call - # - # @param request_pb [::Google::Cloud::SecureSourceManager::V1::DeleteRepositoryRequest] - # 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_repository_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :delete, - uri_template: "/v1/{name}", - matches: [ - ["name", %r{^projects/[^/]+/locations/[^/]+/repositories/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the list_hooks REST call - # - # @param request_pb [::Google::Cloud::SecureSourceManager::V1::ListHooksRequest] - # 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_hooks_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :get, - uri_template: "/v1/{parent}/hooks", - matches: [ - ["parent", %r{^projects/[^/]+/locations/[^/]+/repositories/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the get_hook REST call - # - # @param request_pb [::Google::Cloud::SecureSourceManager::V1::GetHookRequest] - # 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_hook_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :get, - uri_template: "/v1/{name}", - matches: [ - ["name", %r{^projects/[^/]+/locations/[^/]+/repositories/[^/]+/hooks/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the create_hook REST call - # - # @param request_pb [::Google::Cloud::SecureSourceManager::V1::CreateHookRequest] - # 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_hook_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :post, - uri_template: "/v1/{parent}/hooks", - body: "hook", - matches: [ - ["parent", %r{^projects/[^/]+/locations/[^/]+/repositories/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the update_hook REST call - # - # @param request_pb [::Google::Cloud::SecureSourceManager::V1::UpdateHookRequest] - # 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_hook_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :patch, - uri_template: "/v1/{hook.name}", - body: "hook", - matches: [ - ["hook.name", %r{^projects/[^/]+/locations/[^/]+/repositories/[^/]+/hooks/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the delete_hook REST call - # - # @param request_pb [::Google::Cloud::SecureSourceManager::V1::DeleteHookRequest] - # 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_hook_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :delete, - uri_template: "/v1/{name}", - matches: [ - ["name", %r{^projects/[^/]+/locations/[^/]+/repositories/[^/]+/hooks/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the get_iam_policy_repo REST call - # - # @param request_pb [::Google::Iam::V1::GetIamPolicyRequest] - # A request object representing the call parameters. Required. - # @return [Array(String, [String, nil], Hash{String => String})] - # Uri, Body, Query string parameters - def self.transcode_get_iam_policy_repo_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :get, - uri_template: "/v1/{resource}:getIamPolicy", - matches: [ - ["resource", %r{^projects/[^/]+/locations/[^/]+/repositories/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the set_iam_policy_repo REST call - # - # @param request_pb [::Google::Iam::V1::SetIamPolicyRequest] - # A request object representing the call parameters. Required. - # @return [Array(String, [String, nil], Hash{String => String})] - # Uri, Body, Query string parameters - def self.transcode_set_iam_policy_repo_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :post, - uri_template: "/v1/{resource}:setIamPolicy", - body: "*", - matches: [ - ["resource", %r{^projects/[^/]+/locations/[^/]+/repositories/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the test_iam_permissions_repo REST call - # - # @param request_pb [::Google::Iam::V1::TestIamPermissionsRequest] - # A request object representing the call parameters. Required. - # @return [Array(String, [String, nil], Hash{String => String})] - # Uri, Body, Query string parameters - def self.transcode_test_iam_permissions_repo_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :post, - uri_template: "/v1/{resource}:testIamPermissions", - body: "*", - matches: [ - ["resource", %r{^projects/[^/]+/locations/[^/]+/repositories/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the create_branch_rule REST call - # - # @param request_pb [::Google::Cloud::SecureSourceManager::V1::CreateBranchRuleRequest] - # 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_branch_rule_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :post, - uri_template: "/v1/{parent}/branchRules", - body: "branch_rule", - matches: [ - ["parent", %r{^projects/[^/]+/locations/[^/]+/repositories/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the list_branch_rules REST call - # - # @param request_pb [::Google::Cloud::SecureSourceManager::V1::ListBranchRulesRequest] - # 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_branch_rules_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :get, - uri_template: "/v1/{parent}/branchRules", - matches: [ - ["parent", %r{^projects/[^/]+/locations/[^/]+/repositories/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the get_branch_rule REST call - # - # @param request_pb [::Google::Cloud::SecureSourceManager::V1::GetBranchRuleRequest] - # 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_branch_rule_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :get, - uri_template: "/v1/{name}", - matches: [ - ["name", %r{^projects/[^/]+/locations/[^/]+/repositories/[^/]+/branchRules/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the update_branch_rule REST call - # - # @param request_pb [::Google::Cloud::SecureSourceManager::V1::UpdateBranchRuleRequest] - # 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_branch_rule_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :patch, - uri_template: "/v1/{branch_rule.name}", - body: "branch_rule", - matches: [ - ["branch_rule.name", %r{^projects/[^/]+/locations/[^/]+/repositories/[^/]+/branchRules/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the delete_branch_rule REST call - # - # @param request_pb [::Google::Cloud::SecureSourceManager::V1::DeleteBranchRuleRequest] - # 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_branch_rule_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :delete, - uri_template: "/v1/{name}", - matches: [ - ["name", %r{^projects/[^/]+/locations/[^/]+/repositories/[^/]+/branchRules/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the create_pull_request REST call - # - # @param request_pb [::Google::Cloud::SecureSourceManager::V1::CreatePullRequestRequest] - # 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_pull_request_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :post, - uri_template: "/v1/{parent}/pullRequests", - body: "pull_request", - matches: [ - ["parent", %r{^projects/[^/]+/locations/[^/]+/repositories/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the get_pull_request REST call - # - # @param request_pb [::Google::Cloud::SecureSourceManager::V1::GetPullRequestRequest] - # 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_pull_request_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :get, - uri_template: "/v1/{name}", - matches: [ - ["name", %r{^projects/[^/]+/locations/[^/]+/repositories/[^/]+/pullRequests/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the list_pull_requests REST call - # - # @param request_pb [::Google::Cloud::SecureSourceManager::V1::ListPullRequestsRequest] - # 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_pull_requests_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :get, - uri_template: "/v1/{parent}/pullRequests", - matches: [ - ["parent", %r{^projects/[^/]+/locations/[^/]+/repositories/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the update_pull_request REST call - # - # @param request_pb [::Google::Cloud::SecureSourceManager::V1::UpdatePullRequestRequest] - # 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_pull_request_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :patch, - uri_template: "/v1/{pull_request.name}", - body: "pull_request", - matches: [ - ["pull_request.name", %r{^projects/[^/]+/locations/[^/]+/repositories/[^/]+/pullRequests/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the merge_pull_request REST call - # - # @param request_pb [::Google::Cloud::SecureSourceManager::V1::MergePullRequestRequest] - # A request object representing the call parameters. Required. - # @return [Array(String, [String, nil], Hash{String => String})] - # Uri, Body, Query string parameters - def self.transcode_merge_pull_request_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :post, - uri_template: "/v1/{name}:merge", - body: "*", - matches: [ - ["name", %r{^projects/[^/]+/locations/[^/]+/repositories/[^/]+/pullRequests/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the open_pull_request REST call - # - # @param request_pb [::Google::Cloud::SecureSourceManager::V1::OpenPullRequestRequest] - # A request object representing the call parameters. Required. - # @return [Array(String, [String, nil], Hash{String => String})] - # Uri, Body, Query string parameters - def self.transcode_open_pull_request_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :post, - uri_template: "/v1/{name}:open", - body: "*", - matches: [ - ["name", %r{^projects/[^/]+/locations/[^/]+/repositories/[^/]+/pullRequests/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the close_pull_request REST call - # - # @param request_pb [::Google::Cloud::SecureSourceManager::V1::ClosePullRequestRequest] - # A request object representing the call parameters. Required. - # @return [Array(String, [String, nil], Hash{String => String})] - # Uri, Body, Query string parameters - def self.transcode_close_pull_request_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :post, - uri_template: "/v1/{name}:close", - body: "*", - matches: [ - ["name", %r{^projects/[^/]+/locations/[^/]+/repositories/[^/]+/pullRequests/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the list_pull_request_file_diffs REST call - # - # @param request_pb [::Google::Cloud::SecureSourceManager::V1::ListPullRequestFileDiffsRequest] - # 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_pull_request_file_diffs_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :get, - uri_template: "/v1/{name}:listFileDiffs", - matches: [ - ["name", %r{^projects/[^/]+/locations/[^/]+/repositories/[^/]+/pullRequests/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the fetch_tree REST call - # - # @param request_pb [::Google::Cloud::SecureSourceManager::V1::FetchTreeRequest] - # A request object representing the call parameters. Required. - # @return [Array(String, [String, nil], Hash{String => String})] - # Uri, Body, Query string parameters - def self.transcode_fetch_tree_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :get, - uri_template: "/v1/{repository}:fetchTree", - matches: [ - ["repository", %r{^projects/[^/]+/locations/[^/]+/repositories/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the fetch_blob REST call - # - # @param request_pb [::Google::Cloud::SecureSourceManager::V1::FetchBlobRequest] - # A request object representing the call parameters. Required. - # @return [Array(String, [String, nil], Hash{String => String})] - # Uri, Body, Query string parameters - def self.transcode_fetch_blob_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :get, - uri_template: "/v1/{repository}:fetchBlob", - matches: [ - ["repository", %r{^projects/[^/]+/locations/[^/]+/repositories/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the create_issue REST call - # - # @param request_pb [::Google::Cloud::SecureSourceManager::V1::CreateIssueRequest] - # 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_issue_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :post, - uri_template: "/v1/{parent}/issues", - body: "issue", - matches: [ - ["parent", %r{^projects/[^/]+/locations/[^/]+/repositories/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the get_issue REST call - # - # @param request_pb [::Google::Cloud::SecureSourceManager::V1::GetIssueRequest] - # 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_issue_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :get, - uri_template: "/v1/{name}", - matches: [ - ["name", %r{^projects/[^/]+/locations/[^/]+/repositories/[^/]+/issues/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the list_issues REST call - # - # @param request_pb [::Google::Cloud::SecureSourceManager::V1::ListIssuesRequest] - # 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_issues_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :get, - uri_template: "/v1/{parent}/issues", - matches: [ - ["parent", %r{^projects/[^/]+/locations/[^/]+/repositories/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the update_issue REST call - # - # @param request_pb [::Google::Cloud::SecureSourceManager::V1::UpdateIssueRequest] - # 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_issue_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :patch, - uri_template: "/v1/{issue.name}", - body: "issue", - matches: [ - ["issue.name", %r{^projects/[^/]+/locations/[^/]+/repositories/[^/]+/issues/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the delete_issue REST call - # - # @param request_pb [::Google::Cloud::SecureSourceManager::V1::DeleteIssueRequest] - # 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_issue_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :delete, - uri_template: "/v1/{name}", - matches: [ - ["name", %r{^projects/[^/]+/locations/[^/]+/repositories/[^/]+/issues/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the open_issue REST call - # - # @param request_pb [::Google::Cloud::SecureSourceManager::V1::OpenIssueRequest] - # A request object representing the call parameters. Required. - # @return [Array(String, [String, nil], Hash{String => String})] - # Uri, Body, Query string parameters - def self.transcode_open_issue_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :post, - uri_template: "/v1/{name}:open", - body: "*", - matches: [ - ["name", %r{^projects/[^/]+/locations/[^/]+/repositories/[^/]+/issues/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the close_issue REST call - # - # @param request_pb [::Google::Cloud::SecureSourceManager::V1::CloseIssueRequest] - # A request object representing the call parameters. Required. - # @return [Array(String, [String, nil], Hash{String => String})] - # Uri, Body, Query string parameters - def self.transcode_close_issue_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :post, - uri_template: "/v1/{name}:close", - body: "*", - matches: [ - ["name", %r{^projects/[^/]+/locations/[^/]+/repositories/[^/]+/issues/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the get_pull_request_comment REST call - # - # @param request_pb [::Google::Cloud::SecureSourceManager::V1::GetPullRequestCommentRequest] - # 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_pull_request_comment_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :get, - uri_template: "/v1/{name}", - matches: [ - ["name", %r{^projects/[^/]+/locations/[^/]+/repositories/[^/]+/pullRequests/[^/]+/pullRequestComments/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the list_pull_request_comments REST call - # - # @param request_pb [::Google::Cloud::SecureSourceManager::V1::ListPullRequestCommentsRequest] - # 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_pull_request_comments_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :get, - uri_template: "/v1/{parent}/pullRequestComments", - matches: [ - ["parent", %r{^projects/[^/]+/locations/[^/]+/repositories/[^/]+/pullRequests/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the create_pull_request_comment REST call - # - # @param request_pb [::Google::Cloud::SecureSourceManager::V1::CreatePullRequestCommentRequest] - # 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_pull_request_comment_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :post, - uri_template: "/v1/{parent}/pullRequestComments", - body: "pull_request_comment", - matches: [ - ["parent", %r{^projects/[^/]+/locations/[^/]+/repositories/[^/]+/pullRequests/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the update_pull_request_comment REST call - # - # @param request_pb [::Google::Cloud::SecureSourceManager::V1::UpdatePullRequestCommentRequest] - # 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_pull_request_comment_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :patch, - uri_template: "/v1/{pull_request_comment.name}", - body: "pull_request_comment", - matches: [ - ["pull_request_comment.name", %r{^projects/[^/]+/locations/[^/]+/repositories/[^/]+/pullRequests/[^/]+/pullRequestComments/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the delete_pull_request_comment REST call - # - # @param request_pb [::Google::Cloud::SecureSourceManager::V1::DeletePullRequestCommentRequest] - # 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_pull_request_comment_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :delete, - uri_template: "/v1/{name}", - matches: [ - ["name", %r{^projects/[^/]+/locations/[^/]+/repositories/[^/]+/pullRequests/[^/]+/pullRequestComments/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the batch_create_pull_request_comments REST call - # - # @param request_pb [::Google::Cloud::SecureSourceManager::V1::BatchCreatePullRequestCommentsRequest] - # A request object representing the call parameters. Required. - # @return [Array(String, [String, nil], Hash{String => String})] - # Uri, Body, Query string parameters - def self.transcode_batch_create_pull_request_comments_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :post, - uri_template: "/v1/{parent}/pullRequestComments:batchCreate", - body: "*", - matches: [ - ["parent", %r{^projects/[^/]+/locations/[^/]+/repositories/[^/]+/pullRequests/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the resolve_pull_request_comments REST call - # - # @param request_pb [::Google::Cloud::SecureSourceManager::V1::ResolvePullRequestCommentsRequest] - # A request object representing the call parameters. Required. - # @return [Array(String, [String, nil], Hash{String => String})] - # Uri, Body, Query string parameters - def self.transcode_resolve_pull_request_comments_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :post, - uri_template: "/v1/{parent}/pullRequestComments:resolve", - body: "*", - matches: [ - ["parent", %r{^projects/[^/]+/locations/[^/]+/repositories/[^/]+/pullRequests/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the unresolve_pull_request_comments REST call - # - # @param request_pb [::Google::Cloud::SecureSourceManager::V1::UnresolvePullRequestCommentsRequest] - # A request object representing the call parameters. Required. - # @return [Array(String, [String, nil], Hash{String => String})] - # Uri, Body, Query string parameters - def self.transcode_unresolve_pull_request_comments_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :post, - uri_template: "/v1/{parent}/pullRequestComments:unresolve", - body: "*", - matches: [ - ["parent", %r{^projects/[^/]+/locations/[^/]+/repositories/[^/]+/pullRequests/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the create_issue_comment REST call - # - # @param request_pb [::Google::Cloud::SecureSourceManager::V1::CreateIssueCommentRequest] - # 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_issue_comment_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :post, - uri_template: "/v1/{parent}/issueComments", - body: "issue_comment", - matches: [ - ["parent", %r{^projects/[^/]+/locations/[^/]+/repositories/[^/]+/issues/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the get_issue_comment REST call - # - # @param request_pb [::Google::Cloud::SecureSourceManager::V1::GetIssueCommentRequest] - # 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_issue_comment_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :get, - uri_template: "/v1/{name}", - matches: [ - ["name", %r{^projects/[^/]+/locations/[^/]+/repositories/[^/]+/issues/[^/]+/issueComments/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the list_issue_comments REST call - # - # @param request_pb [::Google::Cloud::SecureSourceManager::V1::ListIssueCommentsRequest] - # 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_issue_comments_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :get, - uri_template: "/v1/{parent}/issueComments", - matches: [ - ["parent", %r{^projects/[^/]+/locations/[^/]+/repositories/[^/]+/issues/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the update_issue_comment REST call - # - # @param request_pb [::Google::Cloud::SecureSourceManager::V1::UpdateIssueCommentRequest] - # 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_issue_comment_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :patch, - uri_template: "/v1/{issue_comment.name}", - body: "issue_comment", - matches: [ - ["issue_comment.name", %r{^projects/[^/]+/locations/[^/]+/repositories/[^/]+/issues/[^/]+/issueComments/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the delete_issue_comment REST call - # - # @param request_pb [::Google::Cloud::SecureSourceManager::V1::DeleteIssueCommentRequest] - # 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_issue_comment_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :delete, - uri_template: "/v1/{name}", - matches: [ - ["name", %r{^projects/[^/]+/locations/[^/]+/repositories/[^/]+/issues/[^/]+/issueComments/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - end - end - end - end - end - end -end diff --git a/owl-bot-staging/google-cloud-secure_source_manager-v1/lib/google/cloud/secure_source_manager/v1/version.rb b/owl-bot-staging/google-cloud-secure_source_manager-v1/lib/google/cloud/secure_source_manager/v1/version.rb deleted file mode 100644 index aa5823b1716e..000000000000 --- a/owl-bot-staging/google-cloud-secure_source_manager-v1/lib/google/cloud/secure_source_manager/v1/version.rb +++ /dev/null @@ -1,28 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - - -module Google - module Cloud - module SecureSourceManager - module V1 - VERSION = "0.0.1" - end - end - end -end diff --git a/owl-bot-staging/google-cloud-secure_source_manager-v1/lib/google/cloud/securesourcemanager/v1/secure_source_manager_pb.rb b/owl-bot-staging/google-cloud-secure_source_manager-v1/lib/google/cloud/securesourcemanager/v1/secure_source_manager_pb.rb deleted file mode 100644 index af6a8aaab689..000000000000 --- a/owl-bot-staging/google-cloud-secure_source_manager-v1/lib/google/cloud/securesourcemanager/v1/secure_source_manager_pb.rb +++ /dev/null @@ -1,125 +0,0 @@ -# frozen_string_literal: true -# Generated by the protocol buffer compiler. DO NOT EDIT! -# source: google/cloud/securesourcemanager/v1/secure_source_manager.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/v1/iam_policy_pb' -require 'google/iam/v1/policy_pb' -require 'google/longrunning/operations_pb' -require 'google/protobuf/empty_pb' -require 'google/protobuf/field_mask_pb' -require 'google/protobuf/timestamp_pb' - - -descriptor_data = "\n?google/cloud/securesourcemanager/v1/secure_source_manager.proto\x12#google.cloud.securesourcemanager.v1\x1a\x1cgoogle/api/annotations.proto\x1a\x17google/api/client.proto\x1a\x1fgoogle/api/field_behavior.proto\x1a\x19google/api/resource.proto\x1a\x1egoogle/iam/v1/iam_policy.proto\x1a\x1agoogle/iam/v1/policy.proto\x1a#google/longrunning/operations.proto\x1a\x1bgoogle/protobuf/empty.proto\x1a google/protobuf/field_mask.proto\x1a\x1fgoogle/protobuf/timestamp.proto\"\x98\x0c\n\x08Instance\x12\x11\n\x04name\x18\x01 \x01(\tB\x03\xe0\x41\x01\x12\x34\n\x0b\x63reate_time\x18\x02 \x01(\x0b\x32\x1a.google.protobuf.TimestampB\x03\xe0\x41\x03\x12\x34\n\x0bupdate_time\x18\x03 \x01(\x0b\x32\x1a.google.protobuf.TimestampB\x03\xe0\x41\x03\x12N\n\x06labels\x18\x04 \x03(\x0b\x32\x39.google.cloud.securesourcemanager.v1.Instance.LabelsEntryB\x03\xe0\x41\x01\x12X\n\x0eprivate_config\x18\r \x01(\x0b\x32;.google.cloud.securesourcemanager.v1.Instance.PrivateConfigB\x03\xe0\x41\x01\x12G\n\x05state\x18\x05 \x01(\x0e\x32\x33.google.cloud.securesourcemanager.v1.Instance.StateB\x03\xe0\x41\x03\x12P\n\nstate_note\x18\n \x01(\x0e\x32\x37.google.cloud.securesourcemanager.v1.Instance.StateNoteB\x03\xe0\x41\x03\x12:\n\x07kms_key\x18\x0b \x01(\tB)\xe0\x41\x05\xfa\x41#\n!cloudkms.googleapis.com/CryptoKey\x12R\n\x0bhost_config\x18\t \x01(\x0b\x32\x38.google.cloud.securesourcemanager.v1.Instance.HostConfigB\x03\xe0\x41\x03\x12\x82\x01\n$workforce_identity_federation_config\x18\x0e \x01(\x0b\x32O.google.cloud.securesourcemanager.v1.Instance.WorkforceIdentityFederationConfigB\x03\xe0\x41\x01\x1a^\n\nHostConfig\x12\x11\n\x04html\x18\x01 \x01(\tB\x03\xe0\x41\x03\x12\x10\n\x03\x61pi\x18\x02 \x01(\tB\x03\xe0\x41\x03\x12\x15\n\x08git_http\x18\x03 \x01(\tB\x03\xe0\x41\x03\x12\x14\n\x07git_ssh\x18\x04 \x01(\tB\x03\xe0\x41\x03\x1a\xb0\x02\n\rPrivateConfig\x12\x1a\n\nis_private\x18\x01 \x01(\x08\x42\x06\xe0\x41\x05\xe0\x41\x02\x12;\n\x07\x63\x61_pool\x18\x02 \x01(\tB*\xe0\x41\x05\xe0\x41\x01\xfa\x41!\n\x1fprivateca.googleapis.com/CaPool\x12Q\n\x17http_service_attachment\x18\x03 \x01(\tB0\xe0\x41\x03\xfa\x41*\n(compute.googleapis.com/ServiceAttachment\x12P\n\x16ssh_service_attachment\x18\x04 \x01(\tB0\xe0\x41\x03\xfa\x41*\n(compute.googleapis.com/ServiceAttachment\x12!\n\x14psc_allowed_projects\x18\x06 \x03(\tB\x03\xe0\x41\x01\x1a<\n!WorkforceIdentityFederationConfig\x12\x17\n\x07\x65nabled\x18\x01 \x01(\x08\x42\x06\xe0\x41\x05\xe0\x41\x01\x1a-\n\x0bLabelsEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12\r\n\x05value\x18\x02 \x01(\t:\x02\x38\x01\"_\n\x05State\x12\x15\n\x11STATE_UNSPECIFIED\x10\x00\x12\x0c\n\x08\x43REATING\x10\x01\x12\n\n\x06\x41\x43TIVE\x10\x02\x12\x0c\n\x08\x44\x45LETING\x10\x03\x12\n\n\x06PAUSED\x10\x04\x12\x0b\n\x07UNKNOWN\x10\x06\"_\n\tStateNote\x12\x1a\n\x16STATE_NOTE_UNSPECIFIED\x10\x00\x12\x1b\n\x17PAUSED_CMEK_UNAVAILABLE\x10\x01\x12\x19\n\x11INSTANCE_RESUMING\x10\x02\x1a\x02\x08\x01:q\xea\x41n\n+securesourcemanager.googleapis.com/Instance\x12.google.cloud.securesourcemanager.v1.PullRequestComment.ReviewB\x03\xe0\x41\x01H\x00\x12W\n\x07\x63omment\x18\x05 \x01(\x0b\x32?.google.cloud.securesourcemanager.v1.PullRequestComment.CommentB\x03\xe0\x41\x01H\x00\x12Q\n\x04\x63ode\x18\x06 \x01(\x0b\x32<.google.cloud.securesourcemanager.v1.PullRequestComment.CodeB\x03\xe0\x41\x01H\x00\x1a\xff\x01\n\x06Review\x12\x63\n\x0b\x61\x63tion_type\x18\x01 \x01(\x0e\x32I.google.cloud.securesourcemanager.v1.PullRequestComment.Review.ActionTypeB\x03\xe0\x41\x02\x12\x11\n\x04\x62ody\x18\x02 \x01(\tB\x03\xe0\x41\x01\x12!\n\x14\x65\x66\x66\x65\x63tive_commit_sha\x18\x04 \x01(\tB\x03\xe0\x41\x03\"Z\n\nActionType\x12\x1b\n\x17\x41\x43TION_TYPE_UNSPECIFIED\x10\x00\x12\x0b\n\x07\x43OMMENT\x10\x01\x12\x14\n\x10\x43HANGE_REQUESTED\x10\x02\x12\x0c\n\x08\x41PPROVED\x10\x03\x1a\x1c\n\x07\x43omment\x12\x11\n\x04\x62ody\x18\x01 \x01(\tB\x03\xe0\x41\x02\x1a\xe8\x01\n\x04\x43ode\x12\x11\n\x04\x62ody\x18\x01 \x01(\tB\x03\xe0\x41\x02\x12\x15\n\x05reply\x18\x02 \x01(\tB\x06\xe0\x41\x01\xe0\x41\x04\x12W\n\x08position\x18\x03 \x01(\x0b\x32@.google.cloud.securesourcemanager.v1.PullRequestComment.PositionB\x03\xe0\x41\x01\x12#\n\x16\x65\x66\x66\x65\x63tive_root_comment\x18\x04 \x01(\tB\x03\xe0\x41\x03\x12\x15\n\x08resolved\x18\x05 \x01(\x08\x42\x03\xe0\x41\x03\x12!\n\x14\x65\x66\x66\x65\x63tive_commit_sha\x18\x07 \x01(\tB\x03\xe0\x41\x03\x1a\x30\n\x08Position\x12\x11\n\x04path\x18\x01 \x01(\tB\x03\xe0\x41\x02\x12\x11\n\x04line\x18\x02 \x01(\x03\x42\x03\xe0\x41\x02:\xb8\x01\xea\x41\xb4\x01\n5securesourcemanager.googleapis.com/PullRequestComment\x12{projects/{project}/locations/{location}/repositories/{repository}/pullRequests/{pull_request}/pullRequestComments/{comment}B\x10\n\x0e\x63omment_detail\"\xa4\x01\n\x14ListInstancesRequest\x12\x43\n\x06parent\x18\x01 \x01(\tB3\xe0\x41\x02\xfa\x41-\x12+securesourcemanager.googleapis.com/Instance\x12\x11\n\tpage_size\x18\x02 \x01(\x05\x12\x12\n\npage_token\x18\x03 \x01(\t\x12\x0e\n\x06\x66ilter\x18\x04 \x01(\t\x12\x10\n\x08order_by\x18\x05 \x01(\t\"\x87\x01\n\x15ListInstancesResponse\x12@\n\tinstances\x18\x01 \x03(\x0b\x32-.google.cloud.securesourcemanager.v1.Instance\x12\x17\n\x0fnext_page_token\x18\x02 \x01(\t\x12\x13\n\x0bunreachable\x18\x03 \x03(\t\"W\n\x12GetInstanceRequest\x12\x41\n\x04name\x18\x01 \x01(\tB3\xe0\x41\x02\xfa\x41-\n+securesourcemanager.googleapis.com/Instance\"\xd5\x01\n\x15\x43reateInstanceRequest\x12\x43\n\x06parent\x18\x01 \x01(\tB3\xe0\x41\x02\xfa\x41-\x12+securesourcemanager.googleapis.com/Instance\x12\x18\n\x0binstance_id\x18\x02 \x01(\tB\x03\xe0\x41\x02\x12\x44\n\x08instance\x18\x03 \x01(\x0b\x32-.google.cloud.securesourcemanager.v1.InstanceB\x03\xe0\x41\x02\x12\x17\n\nrequest_id\x18\x04 \x01(\tB\x03\xe0\x41\x01\"s\n\x15\x44\x65leteInstanceRequest\x12\x41\n\x04name\x18\x01 \x01(\tB3\xe0\x41\x02\xfa\x41-\n+securesourcemanager.googleapis.com/Instance\x12\x17\n\nrequest_id\x18\x02 \x01(\tB\x03\xe0\x41\x01\"\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\"\xe8\x01\n\x17ListRepositoriesRequest\x12\x45\n\x06parent\x18\x01 \x01(\tB5\xe0\x41\x02\xfa\x41/\x12-securesourcemanager.googleapis.com/Repository\x12\x16\n\tpage_size\x18\x02 \x01(\x05\x42\x03\xe0\x41\x01\x12\x12\n\npage_token\x18\x03 \x01(\t\x12\x13\n\x06\x66ilter\x18\x04 \x01(\tB\x03\xe0\x41\x01\x12\x45\n\x08instance\x18\x05 \x01(\tB3\xe0\x41\x01\xfa\x41-\n+securesourcemanager.googleapis.com/Instance\"z\n\x18ListRepositoriesResponse\x12\x45\n\x0crepositories\x18\x01 \x03(\x0b\x32/.google.cloud.securesourcemanager.v1.Repository\x12\x17\n\x0fnext_page_token\x18\x02 \x01(\t\"[\n\x14GetRepositoryRequest\x12\x43\n\x04name\x18\x01 \x01(\tB5\xe0\x41\x02\xfa\x41/\n-securesourcemanager.googleapis.com/Repository\"\xc6\x01\n\x17\x43reateRepositoryRequest\x12\x45\n\x06parent\x18\x01 \x01(\tB5\xe0\x41\x02\xfa\x41/\x12-securesourcemanager.googleapis.com/Repository\x12H\n\nrepository\x18\x02 \x01(\x0b\x32/.google.cloud.securesourcemanager.v1.RepositoryB\x03\xe0\x41\x02\x12\x1a\n\rrepository_id\x18\x03 \x01(\tB\x03\xe0\x41\x02\"\xb5\x01\n\x17UpdateRepositoryRequest\x12\x34\n\x0bupdate_mask\x18\x01 \x01(\x0b\x32\x1a.google.protobuf.FieldMaskB\x03\xe0\x41\x01\x12H\n\nrepository\x18\x02 \x01(\x0b\x32/.google.cloud.securesourcemanager.v1.RepositoryB\x03\xe0\x41\x02\x12\x1a\n\rvalidate_only\x18\x03 \x01(\x08\x42\x03\xe0\x41\x01\"z\n\x17\x44\x65leteRepositoryRequest\x12\x43\n\x04name\x18\x01 \x01(\tB5\xe0\x41\x02\xfa\x41/\n-securesourcemanager.googleapis.com/Repository\x12\x1a\n\rallow_missing\x18\x02 \x01(\x08\x42\x03\xe0\x41\x01\"\x84\x01\n\x10ListHooksRequest\x12?\n\x06parent\x18\x01 \x01(\tB/\xe0\x41\x02\xfa\x41)\x12\'securesourcemanager.googleapis.com/Hook\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\"f\n\x11ListHooksResponse\x12\x38\n\x05hooks\x18\x01 \x03(\x0b\x32).google.cloud.securesourcemanager.v1.Hook\x12\x17\n\x0fnext_page_token\x18\x02 \x01(\t\"O\n\x0eGetHookRequest\x12=\n\x04name\x18\x01 \x01(\tB/\xe0\x41\x02\xfa\x41)\n\'securesourcemanager.googleapis.com/Hook\"\xae\x01\n\x11\x43reateHookRequest\x12\x45\n\x06parent\x18\x01 \x01(\tB5\xe0\x41\x02\xfa\x41/\n-securesourcemanager.googleapis.com/Repository\x12<\n\x04hook\x18\x02 \x01(\x0b\x32).google.cloud.securesourcemanager.v1.HookB\x03\xe0\x41\x02\x12\x14\n\x07hook_id\x18\x03 \x01(\tB\x03\xe0\x41\x02\"\x87\x01\n\x11UpdateHookRequest\x12\x34\n\x0bupdate_mask\x18\x01 \x01(\x0b\x32\x1a.google.protobuf.FieldMaskB\x03\xe0\x41\x02\x12<\n\x04hook\x18\x02 \x01(\x0b\x32).google.cloud.securesourcemanager.v1.HookB\x03\xe0\x41\x02\"R\n\x11\x44\x65leteHookRequest\x12=\n\x04name\x18\x01 \x01(\tB/\xe0\x41\x02\xfa\x41)\n\'securesourcemanager.googleapis.com/Hook\"[\n\x14GetBranchRuleRequest\x12\x43\n\x04name\x18\x01 \x01(\tB5\xe0\x41\x02\xfa\x41/\n-securesourcemanager.googleapis.com/BranchRule\"\xc8\x01\n\x17\x43reateBranchRuleRequest\x12\x45\n\x06parent\x18\x01 \x01(\tB5\xe0\x41\x02\xfa\x41/\x12-securesourcemanager.googleapis.com/BranchRule\x12I\n\x0b\x62ranch_rule\x18\x02 \x01(\x0b\x32/.google.cloud.securesourcemanager.v1.BranchRuleB\x03\xe0\x41\x02\x12\x1b\n\x0e\x62ranch_rule_id\x18\x03 \x01(\tB\x03\xe0\x41\x02\"\x90\x01\n\x16ListBranchRulesRequest\x12\x45\n\x06parent\x18\x01 \x01(\tB5\xe0\x41\x02\xfa\x41/\x12-securesourcemanager.googleapis.com/BranchRule\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\"z\n\x17\x44\x65leteBranchRuleRequest\x12\x43\n\x04name\x18\x01 \x01(\tB5\xe0\x41\x02\xfa\x41/\n-securesourcemanager.googleapis.com/BranchRule\x12\x1a\n\rallow_missing\x18\x02 \x01(\x08\x42\x03\xe0\x41\x01\"\xb6\x01\n\x17UpdateBranchRuleRequest\x12I\n\x0b\x62ranch_rule\x18\x01 \x01(\x0b\x32/.google.cloud.securesourcemanager.v1.BranchRuleB\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\x02\"y\n\x17ListBranchRulesResponse\x12\x45\n\x0c\x62ranch_rules\x18\x01 \x03(\x0b\x32/.google.cloud.securesourcemanager.v1.BranchRule\x12\x17\n\x0fnext_page_token\x18\x02 \x01(\t\"\xae\x01\n\x18\x43reatePullRequestRequest\x12\x45\n\x06parent\x18\x01 \x01(\tB5\xe0\x41\x02\xfa\x41/\n-securesourcemanager.googleapis.com/Repository\x12K\n\x0cpull_request\x18\x02 \x01(\x0b\x32\x30.google.cloud.securesourcemanager.v1.PullRequestB\x03\xe0\x41\x02\"]\n\x15GetPullRequestRequest\x12\x44\n\x04name\x18\x01 \x01(\tB6\xe0\x41\x02\xfa\x41\x30\n.securesourcemanager.googleapis.com/PullRequest\"\x91\x01\n\x17ListPullRequestsRequest\x12\x45\n\x06parent\x18\x01 \x01(\tB5\xe0\x41\x02\xfa\x41/\n-securesourcemanager.googleapis.com/Repository\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\x18ListPullRequestsResponse\x12G\n\rpull_requests\x18\x01 \x03(\x0b\x32\x30.google.cloud.securesourcemanager.v1.PullRequest\x12\x17\n\x0fnext_page_token\x18\x02 \x01(\t\"\x9d\x01\n\x18UpdatePullRequestRequest\x12K\n\x0cpull_request\x18\x01 \x01(\x0b\x32\x30.google.cloud.securesourcemanager.v1.PullRequestB\x03\xe0\x41\x02\x12\x34\n\x0bupdate_mask\x18\x02 \x01(\x0b\x32\x1a.google.protobuf.FieldMaskB\x03\xe0\x41\x01\"_\n\x17MergePullRequestRequest\x12\x44\n\x04name\x18\x01 \x01(\tB6\xe0\x41\x02\xfa\x41\x30\n.securesourcemanager.googleapis.com/PullRequest\"^\n\x16OpenPullRequestRequest\x12\x44\n\x04name\x18\x01 \x01(\tB6\xe0\x41\x02\xfa\x41\x30\n.securesourcemanager.googleapis.com/PullRequest\"_\n\x17\x43losePullRequestRequest\x12\x44\n\x04name\x18\x01 \x01(\tB6\xe0\x41\x02\xfa\x41\x30\n.securesourcemanager.googleapis.com/PullRequest\"\x98\x01\n\x1fListPullRequestFileDiffsRequest\x12\x44\n\x04name\x18\x01 \x01(\tB6\xe0\x41\x02\xfa\x41\x30\n.securesourcemanager.googleapis.com/PullRequest\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 ListPullRequestFileDiffsResponse\x12\x41\n\nfile_diffs\x18\x01 \x03(\x0b\x32-.google.cloud.securesourcemanager.v1.FileDiff\x12\x17\n\x0fnext_page_token\x18\x02 \x01(\t\"\x9b\x01\n\x12\x43reateIssueRequest\x12\x45\n\x06parent\x18\x01 \x01(\tB5\xe0\x41\x02\xfa\x41/\n-securesourcemanager.googleapis.com/Repository\x12>\n\x05issue\x18\x02 \x01(\x0b\x32*.google.cloud.securesourcemanager.v1.IssueB\x03\xe0\x41\x02\"Q\n\x0fGetIssueRequest\x12>\n\x04name\x18\x01 \x01(\tB0\xe0\x41\x02\xfa\x41*\n(securesourcemanager.googleapis.com/Issue\"\x9b\x01\n\x11ListIssuesRequest\x12@\n\x06parent\x18\x01 \x01(\tB0\xe0\x41\x02\xfa\x41*\x12(securesourcemanager.googleapis.com/Issue\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\"i\n\x12ListIssuesResponse\x12:\n\x06issues\x18\x01 \x03(\x0b\x32*.google.cloud.securesourcemanager.v1.Issue\x12\x17\n\x0fnext_page_token\x18\x02 \x01(\t\"\x8a\x01\n\x12UpdateIssueRequest\x12>\n\x05issue\x18\x01 \x01(\x0b\x32*.google.cloud.securesourcemanager.v1.IssueB\x03\xe0\x41\x02\x12\x34\n\x0bupdate_mask\x18\x02 \x01(\x0b\x32\x1a.google.protobuf.FieldMaskB\x03\xe0\x41\x01\"g\n\x12\x44\x65leteIssueRequest\x12>\n\x04name\x18\x01 \x01(\tB0\xe0\x41\x02\xfa\x41*\n(securesourcemanager.googleapis.com/Issue\x12\x11\n\x04\x65tag\x18\x02 \x01(\tB\x03\xe0\x41\x01\"f\n\x11\x43loseIssueRequest\x12>\n\x04name\x18\x01 \x01(\tB0\xe0\x41\x02\xfa\x41*\n(securesourcemanager.googleapis.com/Issue\x12\x11\n\x04\x65tag\x18\x02 \x01(\tB\x03\xe0\x41\x01\"e\n\x10OpenIssueRequest\x12>\n\x04name\x18\x01 \x01(\tB0\xe0\x41\x02\xfa\x41*\n(securesourcemanager.googleapis.com/Issue\x12\x11\n\x04\x65tag\x18\x02 \x01(\tB\x03\xe0\x41\x01\"\xef\x01\n\tTreeEntry\x12L\n\x04type\x18\x01 \x01(\x0e\x32\x39.google.cloud.securesourcemanager.v1.TreeEntry.ObjectTypeB\x03\xe0\x41\x03\x12\x10\n\x03sha\x18\x02 \x01(\tB\x03\xe0\x41\x03\x12\x11\n\x04path\x18\x03 \x01(\tB\x03\xe0\x41\x03\x12\x11\n\x04mode\x18\x04 \x01(\tB\x03\xe0\x41\x03\x12\x11\n\x04size\x18\x05 \x01(\x03\x42\x03\xe0\x41\x03\"I\n\nObjectType\x12\x1b\n\x17OBJECT_TYPE_UNSPECIFIED\x10\x00\x12\x08\n\x04TREE\x10\x01\x12\x08\n\x04\x42LOB\x10\x02\x12\n\n\x06\x43OMMIT\x10\x03\"\xb8\x01\n\x10\x46\x65tchTreeRequest\x12I\n\nrepository\x18\x01 \x01(\tB5\xe0\x41\x02\xfa\x41/\n-securesourcemanager.googleapis.com/Repository\x12\x10\n\x03ref\x18\x02 \x01(\tB\x03\xe0\x41\x01\x12\x16\n\trecursive\x18\x03 \x01(\x08\x42\x03\xe0\x41\x01\x12\x16\n\tpage_size\x18\x04 \x01(\x05\x42\x03\xe0\x41\x01\x12\x17\n\npage_token\x18\x05 \x01(\tB\x03\xe0\x41\x01\"r\n\x11\x46\x65tchTreeResponse\x12\x44\n\x0ctree_entries\x18\x01 \x03(\x0b\x32..google.cloud.securesourcemanager.v1.TreeEntry\x12\x17\n\x0fnext_page_token\x18\x02 \x01(\t\"o\n\x10\x46\x65tchBlobRequest\x12I\n\nrepository\x18\x01 \x01(\tB5\xe0\x41\x02\xfa\x41/\n-securesourcemanager.googleapis.com/Repository\x12\x10\n\x03sha\x18\x02 \x01(\tB\x03\xe0\x41\x02\"1\n\x11\x46\x65tchBlobResponse\x12\x0b\n\x03sha\x18\x01 \x01(\t\x12\x0f\n\x07\x63ontent\x18\x02 \x01(\t\"\xa0\x01\n\x1eListPullRequestCommentsRequest\x12M\n\x06parent\x18\x01 \x01(\tB=\xe0\x41\x02\xfa\x41\x37\x12\x35securesourcemanager.googleapis.com/PullRequestComment\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\"\x92\x01\n\x1fListPullRequestCommentsResponse\x12V\n\x15pull_request_comments\x18\x01 \x03(\x0b\x32\x37.google.cloud.securesourcemanager.v1.PullRequestComment\x12\x17\n\x0fnext_page_token\x18\x02 \x01(\t\"\xcc\x01\n\x1f\x43reatePullRequestCommentRequest\x12M\n\x06parent\x18\x01 \x01(\tB=\xe0\x41\x02\xfa\x41\x37\x12\x35securesourcemanager.googleapis.com/PullRequestComment\x12Z\n\x14pull_request_comment\x18\x02 \x01(\x0b\x32\x37.google.cloud.securesourcemanager.v1.PullRequestCommentB\x03\xe0\x41\x02\"\xd3\x01\n%BatchCreatePullRequestCommentsRequest\x12M\n\x06parent\x18\x01 \x01(\tB=\xe0\x41\x02\xfa\x41\x37\x12\x35securesourcemanager.googleapis.com/PullRequestComment\x12[\n\x08requests\x18\x02 \x03(\x0b\x32\x44.google.cloud.securesourcemanager.v1.CreatePullRequestCommentRequestB\x03\xe0\x41\x02\"\x80\x01\n&BatchCreatePullRequestCommentsResponse\x12V\n\x15pull_request_comments\x18\x01 \x03(\x0b\x32\x37.google.cloud.securesourcemanager.v1.PullRequestComment\"\xb3\x01\n\x1fUpdatePullRequestCommentRequest\x12Z\n\x14pull_request_comment\x18\x01 \x01(\x0b\x32\x37.google.cloud.securesourcemanager.v1.PullRequestCommentB\x03\xe0\x41\x02\x12\x34\n\x0bupdate_mask\x18\x02 \x01(\x0b\x32\x1a.google.protobuf.FieldMaskB\x03\xe0\x41\x01\"n\n\x1f\x44\x65letePullRequestCommentRequest\x12K\n\x04name\x18\x01 \x01(\tB=\xe0\x41\x02\xfa\x41\x37\n5securesourcemanager.googleapis.com/PullRequestComment\"k\n\x1cGetPullRequestCommentRequest\x12K\n\x04name\x18\x01 \x01(\tB=\xe0\x41\x02\xfa\x41\x37\n5securesourcemanager.googleapis.com/PullRequestComment\"\xd8\x01\n!ResolvePullRequestCommentsRequest\x12M\n\x06parent\x18\x01 \x01(\tB=\xe0\x41\x02\xfa\x41\x37\x12\x35securesourcemanager.googleapis.com/PullRequestComment\x12L\n\x05names\x18\x02 \x03(\tB=\xe0\x41\x02\xfa\x41\x37\n5securesourcemanager.googleapis.com/PullRequestComment\x12\x16\n\tauto_fill\x18\x03 \x01(\x08\x42\x03\xe0\x41\x01\"|\n\"ResolvePullRequestCommentsResponse\x12V\n\x15pull_request_comments\x18\x01 \x03(\x0b\x32\x37.google.cloud.securesourcemanager.v1.PullRequestComment\"\xda\x01\n#UnresolvePullRequestCommentsRequest\x12M\n\x06parent\x18\x01 \x01(\tB=\xe0\x41\x02\xfa\x41\x37\x12\x35securesourcemanager.googleapis.com/PullRequestComment\x12L\n\x05names\x18\x02 \x03(\tB=\xe0\x41\x02\xfa\x41\x37\n5securesourcemanager.googleapis.com/PullRequestComment\x12\x16\n\tauto_fill\x18\x03 \x01(\x08\x42\x03\xe0\x41\x01\"~\n$UnresolvePullRequestCommentsResponse\x12V\n\x15pull_request_comments\x18\x01 \x03(\x0b\x32\x37.google.cloud.securesourcemanager.v1.PullRequestComment\"\xac\x01\n\x19\x43reateIssueCommentRequest\x12@\n\x06parent\x18\x01 \x01(\tB0\xe0\x41\x02\xfa\x41*\n(securesourcemanager.googleapis.com/Issue\x12M\n\rissue_comment\x18\x02 \x01(\x0b\x32\x31.google.cloud.securesourcemanager.v1.IssueCommentB\x03\xe0\x41\x02\"_\n\x16GetIssueCommentRequest\x12\x45\n\x04name\x18\x01 \x01(\tB7\xe0\x41\x02\xfa\x41\x31\n/securesourcemanager.googleapis.com/IssueComment\"\x94\x01\n\x18ListIssueCommentsRequest\x12G\n\x06parent\x18\x01 \x01(\tB7\xe0\x41\x02\xfa\x41\x31\x12/securesourcemanager.googleapis.com/IssueComment\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\"\x7f\n\x19ListIssueCommentsResponse\x12I\n\x0eissue_comments\x18\x01 \x03(\x0b\x32\x31.google.cloud.securesourcemanager.v1.IssueComment\x12\x17\n\x0fnext_page_token\x18\x02 \x01(\t\"\xa0\x01\n\x19UpdateIssueCommentRequest\x12M\n\rissue_comment\x18\x01 \x01(\x0b\x32\x31.google.cloud.securesourcemanager.v1.IssueCommentB\x03\xe0\x41\x02\x12\x34\n\x0bupdate_mask\x18\x02 \x01(\x0b\x32\x1a.google.protobuf.FieldMaskB\x03\xe0\x41\x01\"b\n\x19\x44\x65leteIssueCommentRequest\x12\x45\n\x04name\x18\x01 \x01(\tB7\xe0\x41\x02\xfa\x41\x31\n/securesourcemanager.googleapis.com/IssueComment2\xfe\x64\n\x13SecureSourceManager\x12\xc6\x01\n\rListInstances\x12\x39.google.cloud.securesourcemanager.v1.ListInstancesRequest\x1a:.google.cloud.securesourcemanager.v1.ListInstancesResponse\">\xda\x41\x06parent\x82\xd3\xe4\x93\x02/\x12-/v1/{parent=projects/*/locations/*}/instances\x12\xb3\x01\n\x0bGetInstance\x12\x37.google.cloud.securesourcemanager.v1.GetInstanceRequest\x1a-.google.cloud.securesourcemanager.v1.Instance\"<\xda\x41\x04name\x82\xd3\xe4\x93\x02/\x12-/v1/{name=projects/*/locations/*/instances/*}\x12\xea\x01\n\x0e\x43reateInstance\x12:.google.cloud.securesourcemanager.v1.CreateInstanceRequest\x1a\x1d.google.longrunning.Operation\"}\xca\x41\x1d\n\x08Instance\x12\x11OperationMetadata\xda\x41\x1bparent,instance,instance_id\x82\xd3\xe4\x93\x02\x39\"-/v1/{parent=projects/*/locations/*}/instances:\x08instance\x12\xd6\x01\n\x0e\x44\x65leteInstance\x12:.google.cloud.securesourcemanager.v1.DeleteInstanceRequest\x1a\x1d.google.longrunning.Operation\"i\xca\x41*\n\x15google.protobuf.Empty\x12\x11OperationMetadata\xda\x41\x04name\x82\xd3\xe4\x93\x02/*-/v1/{name=projects/*/locations/*/instances/*}\x12\xd2\x01\n\x10ListRepositories\x12<.google.cloud.securesourcemanager.v1.ListRepositoriesRequest\x1a=.google.cloud.securesourcemanager.v1.ListRepositoriesResponse\"A\xda\x41\x06parent\x82\xd3\xe4\x93\x02\x32\x12\x30/v1/{parent=projects/*/locations/*}/repositories\x12\xbc\x01\n\rGetRepository\x12\x39.google.cloud.securesourcemanager.v1.GetRepositoryRequest\x1a/.google.cloud.securesourcemanager.v1.Repository\"?\xda\x41\x04name\x82\xd3\xe4\x93\x02\x32\x12\x30/v1/{name=projects/*/locations/*/repositories/*}\x12\xfa\x01\n\x10\x43reateRepository\x12<.google.cloud.securesourcemanager.v1.CreateRepositoryRequest\x1a\x1d.google.longrunning.Operation\"\x88\x01\xca\x41\x1f\n\nRepository\x12\x11OperationMetadata\xda\x41\x1fparent,repository,repository_id\x82\xd3\xe4\x93\x02>\"0/v1/{parent=projects/*/locations/*}/repositories:\nrepository\x12\xfc\x01\n\x10UpdateRepository\x12<.google.cloud.securesourcemanager.v1.UpdateRepositoryRequest\x1a\x1d.google.longrunning.Operation\"\x8a\x01\xca\x41\x1f\n\nRepository\x12\x11OperationMetadata\xda\x41\x16repository,update_mask\x82\xd3\xe4\x93\x02I2;/v1/{repository.name=projects/*/locations/*/repositories/*}:\nrepository\x12\xdd\x01\n\x10\x44\x65leteRepository\x12<.google.cloud.securesourcemanager.v1.DeleteRepositoryRequest\x1a\x1d.google.longrunning.Operation\"l\xca\x41*\n\x15google.protobuf.Empty\x12\x11OperationMetadata\xda\x41\x04name\x82\xd3\xe4\x93\x02\x32*0/v1/{name=projects/*/locations/*/repositories/*}\x12\xc5\x01\n\tListHooks\x12\x35.google.cloud.securesourcemanager.v1.ListHooksRequest\x1a\x36.google.cloud.securesourcemanager.v1.ListHooksResponse\"I\xda\x41\x06parent\x82\xd3\xe4\x93\x02:\x12\x38/v1/{parent=projects/*/locations/*/repositories/*}/hooks\x12\xb2\x01\n\x07GetHook\x12\x33.google.cloud.securesourcemanager.v1.GetHookRequest\x1a).google.cloud.securesourcemanager.v1.Hook\"G\xda\x41\x04name\x82\xd3\xe4\x93\x02:\x12\x38/v1/{name=projects/*/locations/*/repositories/*/hooks/*}\x12\xdd\x01\n\nCreateHook\x12\x36.google.cloud.securesourcemanager.v1.CreateHookRequest\x1a\x1d.google.longrunning.Operation\"x\xca\x41\x19\n\x04Hook\x12\x11OperationMetadata\xda\x41\x13parent,hook,hook_id\x82\xd3\xe4\x93\x02@\"8/v1/{parent=projects/*/locations/*/repositories/*}/hooks:\x04hook\x12\xdf\x01\n\nUpdateHook\x12\x36.google.cloud.securesourcemanager.v1.UpdateHookRequest\x1a\x1d.google.longrunning.Operation\"z\xca\x41\x19\n\x04Hook\x12\x11OperationMetadata\xda\x41\x10hook,update_mask\x82\xd3\xe4\x93\x02\x45\x32=/v1/{hook.name=projects/*/locations/*/repositories/*/hooks/*}:\x04hook\x12\xd9\x01\n\nDeleteHook\x12\x36.google.cloud.securesourcemanager.v1.DeleteHookRequest\x1a\x1d.google.longrunning.Operation\"t\xca\x41*\n\x15google.protobuf.Empty\x12\x11OperationMetadata\xda\x41\x04name\x82\xd3\xe4\x93\x02:*8/v1/{name=projects/*/locations/*/repositories/*/hooks/*}\x12\xa3\x01\n\x10GetIamPolicyRepo\x12\".google.iam.v1.GetIamPolicyRequest\x1a\x15.google.iam.v1.Policy\"T\xda\x41\x08resource\x82\xd3\xe4\x93\x02\x43\x12\x41/v1/{resource=projects/*/locations/*/repositories/*}:getIamPolicy\x12\xa6\x01\n\x10SetIamPolicyRepo\x12\".google.iam.v1.SetIamPolicyRequest\x1a\x15.google.iam.v1.Policy\"W\xda\x41\x08resource\x82\xd3\xe4\x93\x02\x46\"A/v1/{resource=projects/*/locations/*/repositories/*}:setIamPolicy:\x01*\x12\xcc\x01\n\x16TestIamPermissionsRepo\x12(.google.iam.v1.TestIamPermissionsRequest\x1a).google.iam.v1.TestIamPermissionsResponse\"]\xda\x41\x08resource\x82\xd3\xe4\x93\x02L\"G/v1/{resource=projects/*/locations/*/repositories/*}:testIamPermissions:\x01*\x12\x8b\x02\n\x10\x43reateBranchRule\x12<.google.cloud.securesourcemanager.v1.CreateBranchRuleRequest\x1a\x1d.google.longrunning.Operation\"\x99\x01\xca\x41\x1f\n\nBranchRule\x12\x11OperationMetadata\xda\x41!parent,branch_rule,branch_rule_id\x82\xd3\xe4\x93\x02M\">/v1/{parent=projects/*/locations/*/repositories/*}/branchRules:\x0b\x62ranch_rule\x12\xdd\x01\n\x0fListBranchRules\x12;.google.cloud.securesourcemanager.v1.ListBranchRulesRequest\x1a<.google.cloud.securesourcemanager.v1.ListBranchRulesResponse\"O\xda\x41\x06parent\x82\xd3\xe4\x93\x02@\x12>/v1/{parent=projects/*/locations/*/repositories/*}/branchRules\x12\xca\x01\n\rGetBranchRule\x12\x39.google.cloud.securesourcemanager.v1.GetBranchRuleRequest\x1a/.google.cloud.securesourcemanager.v1.BranchRule\"M\xda\x41\x04name\x82\xd3\xe4\x93\x02@\x12>/v1/{name=projects/*/locations/*/repositories/*/branchRules/*}\x12\x8d\x02\n\x10UpdateBranchRule\x12<.google.cloud.securesourcemanager.v1.UpdateBranchRuleRequest\x1a\x1d.google.longrunning.Operation\"\x9b\x01\xca\x41\x1f\n\nBranchRule\x12\x11OperationMetadata\xda\x41\x17\x62ranch_rule,update_mask\x82\xd3\xe4\x93\x02Y2J/v1/{branch_rule.name=projects/*/locations/*/repositories/*/branchRules/*}:\x0b\x62ranch_rule\x12\xeb\x01\n\x10\x44\x65leteBranchRule\x12<.google.cloud.securesourcemanager.v1.DeleteBranchRuleRequest\x1a\x1d.google.longrunning.Operation\"z\xca\x41*\n\x15google.protobuf.Empty\x12\x11OperationMetadata\xda\x41\x04name\x82\xd3\xe4\x93\x02@*>/v1/{name=projects/*/locations/*/repositories/*/branchRules/*}\x12\xa6\x02\n\x11\x43reatePullRequest\x12=.google.cloud.securesourcemanager.v1.CreatePullRequestRequest\x1a\x1d.google.longrunning.Operation\"\xb2\x01\xca\x41\x44\n/google.cloud.securesourcemanager.v1.PullRequest\x12\x11OperationMetadata\xda\x41\x13parent,pull_request\x82\xd3\xe4\x93\x02O\"?/v1/{parent=projects/*/locations/*/repositories/*}/pullRequests:\x0cpull_request\x12\xce\x01\n\x0eGetPullRequest\x12:.google.cloud.securesourcemanager.v1.GetPullRequestRequest\x1a\x30.google.cloud.securesourcemanager.v1.PullRequest\"N\xda\x41\x04name\x82\xd3\xe4\x93\x02\x41\x12?/v1/{name=projects/*/locations/*/repositories/*/pullRequests/*}\x12\xe1\x01\n\x10ListPullRequests\x12<.google.cloud.securesourcemanager.v1.ListPullRequestsRequest\x1a=.google.cloud.securesourcemanager.v1.ListPullRequestsResponse\"P\xda\x41\x06parent\x82\xd3\xe4\x93\x02\x41\x12?/v1/{parent=projects/*/locations/*/repositories/*}/pullRequests\x12\xb8\x02\n\x11UpdatePullRequest\x12=.google.cloud.securesourcemanager.v1.UpdatePullRequestRequest\x1a\x1d.google.longrunning.Operation\"\xc4\x01\xca\x41\x44\n/google.cloud.securesourcemanager.v1.PullRequest\x12\x11OperationMetadata\xda\x41\x18pull_request,update_mask\x82\xd3\xe4\x93\x02\\2L/v1/{pull_request.name=projects/*/locations/*/repositories/*/pullRequests/*}:\x0cpull_request\x12\x90\x02\n\x10MergePullRequest\x12<.google.cloud.securesourcemanager.v1.MergePullRequestRequest\x1a\x1d.google.longrunning.Operation\"\x9e\x01\xca\x41\x44\n/google.cloud.securesourcemanager.v1.PullRequest\x12\x11OperationMetadata\xda\x41\x04name\x82\xd3\xe4\x93\x02J\"E/v1/{name=projects/*/locations/*/repositories/*/pullRequests/*}:merge:\x01*\x12\x8d\x02\n\x0fOpenPullRequest\x12;.google.cloud.securesourcemanager.v1.OpenPullRequestRequest\x1a\x1d.google.longrunning.Operation\"\x9d\x01\xca\x41\x44\n/google.cloud.securesourcemanager.v1.PullRequest\x12\x11OperationMetadata\xda\x41\x04name\x82\xd3\xe4\x93\x02I\"D/v1/{name=projects/*/locations/*/repositories/*/pullRequests/*}:open:\x01*\x12\x90\x02\n\x10\x43losePullRequest\x12<.google.cloud.securesourcemanager.v1.ClosePullRequestRequest\x1a\x1d.google.longrunning.Operation\"\x9e\x01\xca\x41\x44\n/google.cloud.securesourcemanager.v1.PullRequest\x12\x11OperationMetadata\xda\x41\x04name\x82\xd3\xe4\x93\x02J\"E/v1/{name=projects/*/locations/*/repositories/*/pullRequests/*}:close:\x01*\x12\x85\x02\n\x18ListPullRequestFileDiffs\x12\x44.google.cloud.securesourcemanager.v1.ListPullRequestFileDiffsRequest\x1a\x45.google.cloud.securesourcemanager.v1.ListPullRequestFileDiffsResponse\"\\\xda\x41\x04name\x82\xd3\xe4\x93\x02O\x12M/v1/{name=projects/*/locations/*/repositories/*/pullRequests/*}:listFileDiffs\x12\xc4\x01\n\tFetchTree\x12\x35.google.cloud.securesourcemanager.v1.FetchTreeRequest\x1a\x36.google.cloud.securesourcemanager.v1.FetchTreeResponse\"H\x82\xd3\xe4\x93\x02\x42\x12@/v1/{repository=projects/*/locations/*/repositories/*}:fetchTree\x12\xc4\x01\n\tFetchBlob\x12\x35.google.cloud.securesourcemanager.v1.FetchBlobRequest\x1a\x36.google.cloud.securesourcemanager.v1.FetchBlobResponse\"H\x82\xd3\xe4\x93\x02\x42\x12@/v1/{repository=projects/*/locations/*/repositories/*}:fetchBlob\x12\x80\x02\n\x0b\x43reateIssue\x12\x37.google.cloud.securesourcemanager.v1.CreateIssueRequest\x1a\x1d.google.longrunning.Operation\"\x98\x01\xca\x41>\n)google.cloud.securesourcemanager.v1.Issue\x12\x11OperationMetadata\xda\x41\x0cparent,issue\x82\xd3\xe4\x93\x02\x42\"9/v1/{parent=projects/*/locations/*/repositories/*}/issues:\x05issue\x12\xb6\x01\n\x08GetIssue\x12\x34.google.cloud.securesourcemanager.v1.GetIssueRequest\x1a*.google.cloud.securesourcemanager.v1.Issue\"H\xda\x41\x04name\x82\xd3\xe4\x93\x02;\x12\x39/v1/{name=projects/*/locations/*/repositories/*/issues/*}\x12\xc9\x01\n\nListIssues\x12\x36.google.cloud.securesourcemanager.v1.ListIssuesRequest\x1a\x37.google.cloud.securesourcemanager.v1.ListIssuesResponse\"J\xda\x41\x06parent\x82\xd3\xe4\x93\x02;\x12\x39/v1/{parent=projects/*/locations/*/repositories/*}/issues\x12\x8b\x02\n\x0bUpdateIssue\x12\x37.google.cloud.securesourcemanager.v1.UpdateIssueRequest\x1a\x1d.google.longrunning.Operation\"\xa3\x01\xca\x41>\n)google.cloud.securesourcemanager.v1.Issue\x12\x11OperationMetadata\xda\x41\x11issue,update_mask\x82\xd3\xe4\x93\x02H2?/v1/{issue.name=projects/*/locations/*/repositories/*/issues/*}:\x05issue\x12\xdc\x01\n\x0b\x44\x65leteIssue\x12\x37.google.cloud.securesourcemanager.v1.DeleteIssueRequest\x1a\x1d.google.longrunning.Operation\"u\xca\x41*\n\x15google.protobuf.Empty\x12\x11OperationMetadata\xda\x41\x04name\x82\xd3\xe4\x93\x02;*9/v1/{name=projects/*/locations/*/repositories/*/issues/*}\x12\xf5\x01\n\tOpenIssue\x12\x35.google.cloud.securesourcemanager.v1.OpenIssueRequest\x1a\x1d.google.longrunning.Operation\"\x91\x01\xca\x41>\n)google.cloud.securesourcemanager.v1.Issue\x12\x11OperationMetadata\xda\x41\x04name\x82\xd3\xe4\x93\x02\x43\">/v1/{name=projects/*/locations/*/repositories/*/issues/*}:open:\x01*\x12\xf8\x01\n\nCloseIssue\x12\x36.google.cloud.securesourcemanager.v1.CloseIssueRequest\x1a\x1d.google.longrunning.Operation\"\x92\x01\xca\x41>\n)google.cloud.securesourcemanager.v1.Issue\x12\x11OperationMetadata\xda\x41\x04name\x82\xd3\xe4\x93\x02\x44\"?/v1/{name=projects/*/locations/*/repositories/*/issues/*}:close:\x01*\x12\xf9\x01\n\x15GetPullRequestComment\x12\x41.google.cloud.securesourcemanager.v1.GetPullRequestCommentRequest\x1a\x37.google.cloud.securesourcemanager.v1.PullRequestComment\"d\xda\x41\x04name\x82\xd3\xe4\x93\x02W\x12U/v1/{name=projects/*/locations/*/repositories/*/pullRequests/*/pullRequestComments/*}\x12\x8c\x02\n\x17ListPullRequestComments\x12\x43.google.cloud.securesourcemanager.v1.ListPullRequestCommentsRequest\x1a\x44.google.cloud.securesourcemanager.v1.ListPullRequestCommentsResponse\"f\xda\x41\x06parent\x82\xd3\xe4\x93\x02W\x12U/v1/{parent=projects/*/locations/*/repositories/*/pullRequests/*}/pullRequestComments\x12\xe1\x02\n\x18\x43reatePullRequestComment\x12\x44.google.cloud.securesourcemanager.v1.CreatePullRequestCommentRequest\x1a\x1d.google.longrunning.Operation\"\xdf\x01\xca\x41K\n6google.cloud.securesourcemanager.v1.PullRequestComment\x12\x11OperationMetadata\xda\x41\x1bparent,pull_request_comment\x82\xd3\xe4\x93\x02m\"U/v1/{parent=projects/*/locations/*/repositories/*/pullRequests/*}/pullRequestComments:\x14pull_request_comment\x12\xfc\x02\n\x18UpdatePullRequestComment\x12\x44.google.cloud.securesourcemanager.v1.UpdatePullRequestCommentRequest\x1a\x1d.google.longrunning.Operation\"\xfa\x01\xca\x41K\n6google.cloud.securesourcemanager.v1.PullRequestComment\x12\x11OperationMetadata\xda\x41 pull_request_comment,update_mask\x82\xd3\xe4\x93\x02\x82\x01\x32j/v1/{pull_request_comment.name=projects/*/locations/*/repositories/*/pullRequests/*/pullRequestComments/*}:\x14pull_request_comment\x12\x93\x02\n\x18\x44\x65letePullRequestComment\x12\x44.google.cloud.securesourcemanager.v1.DeletePullRequestCommentRequest\x1a\x1d.google.longrunning.Operation\"\x91\x01\xca\x41*\n\x15google.protobuf.Empty\x12\x11OperationMetadata\xda\x41\x04name\x82\xd3\xe4\x93\x02W*U/v1/{name=projects/*/locations/*/repositories/*/pullRequests/*/pullRequestComments/*}\x12\xca\x02\n\x1e\x42\x61tchCreatePullRequestComments\x12J.google.cloud.securesourcemanager.v1.BatchCreatePullRequestCommentsRequest\x1a\x1d.google.longrunning.Operation\"\xbc\x01\xca\x41;\n&BatchCreatePullRequestCommentsResponse\x12\x11OperationMetadata\xda\x41\x0fparent,requests\x82\xd3\xe4\x93\x02\x66\"a/v1/{parent=projects/*/locations/*/repositories/*/pullRequests/*}/pullRequestComments:batchCreate:\x01*\x12\xb7\x02\n\x1aResolvePullRequestComments\x12\x46.google.cloud.securesourcemanager.v1.ResolvePullRequestCommentsRequest\x1a\x1d.google.longrunning.Operation\"\xb1\x01\xca\x41\x37\n\"ResolvePullRequestCommentsResponse\x12\x11OperationMetadata\xda\x41\x0cparent,names\x82\xd3\xe4\x93\x02\x62\"]/v1/{parent=projects/*/locations/*/repositories/*/pullRequests/*}/pullRequestComments:resolve:\x01*\x12\xbf\x02\n\x1cUnresolvePullRequestComments\x12H.google.cloud.securesourcemanager.v1.UnresolvePullRequestCommentsRequest\x1a\x1d.google.longrunning.Operation\"\xb5\x01\xca\x41\x39\n$UnresolvePullRequestCommentsResponse\x12\x11OperationMetadata\xda\x41\x0cparent,names\x82\xd3\xe4\x93\x02\x64\"_/v1/{parent=projects/*/locations/*/repositories/*/pullRequests/*}/pullRequestComments:unresolve:\x01*\x12\xb5\x02\n\x12\x43reateIssueComment\x12>.google.cloud.securesourcemanager.v1.CreateIssueCommentRequest\x1a\x1d.google.longrunning.Operation\"\xbf\x01\xca\x41\x45\n0google.cloud.securesourcemanager.v1.IssueComment\x12\x11OperationMetadata\xda\x41\x14parent,issue_comment\x82\xd3\xe4\x93\x02Z\"I/v1/{parent=projects/*/locations/*/repositories/*/issues/*}/issueComments:\rissue_comment\x12\xdb\x01\n\x0fGetIssueComment\x12;.google.cloud.securesourcemanager.v1.GetIssueCommentRequest\x1a\x31.google.cloud.securesourcemanager.v1.IssueComment\"X\xda\x41\x04name\x82\xd3\xe4\x93\x02K\x12I/v1/{name=projects/*/locations/*/repositories/*/issues/*/issueComments/*}\x12\xee\x01\n\x11ListIssueComments\x12=.google.cloud.securesourcemanager.v1.ListIssueCommentsRequest\x1a>.google.cloud.securesourcemanager.v1.ListIssueCommentsResponse\"Z\xda\x41\x06parent\x82\xd3\xe4\x93\x02K\x12I/v1/{parent=projects/*/locations/*/repositories/*/issues/*}/issueComments\x12\xc8\x02\n\x12UpdateIssueComment\x12>.google.cloud.securesourcemanager.v1.UpdateIssueCommentRequest\x1a\x1d.google.longrunning.Operation\"\xd2\x01\xca\x41\x45\n0google.cloud.securesourcemanager.v1.IssueComment\x12\x11OperationMetadata\xda\x41\x19issue_comment,update_mask\x82\xd3\xe4\x93\x02h2W/v1/{issue_comment.name=projects/*/locations/*/repositories/*/issues/*/issueComments/*}:\rissue_comment\x12\xfb\x01\n\x12\x44\x65leteIssueComment\x12>.google.cloud.securesourcemanager.v1.DeleteIssueCommentRequest\x1a\x1d.google.longrunning.Operation\"\x85\x01\xca\x41*\n\x15google.protobuf.Empty\x12\x11OperationMetadata\xda\x41\x04name\x82\xd3\xe4\x93\x02K*I/v1/{name=projects/*/locations/*/repositories/*/issues/*/issueComments/*}\x1aV\xca\x41\"securesourcemanager.googleapis.com\xd2\x41.https://www.googleapis.com/auth/cloud-platformB\xe9\x04\n\'com.google.cloud.securesourcemanager.v1B\x18SecureSourceManagerProtoP\x01ZYcloud.google.com/go/securesourcemanager/apiv1/securesourcemanagerpb;securesourcemanagerpb\xaa\x02#Google.Cloud.SecureSourceManager.V1\xca\x02#Google\\Cloud\\SecureSourceManager\\V1\xea\x02&Google::Cloud::SecureSourceManager::V1\xea\x41x\n!cloudkms.googleapis.com/CryptoKey\x12Sprojects/{project}/locations/{location}/keyRings/{key_ring}/cryptoKeys/{crypto_key}\xea\x41\\\n\x1fprivateca.googleapis.com/CaPool\x12\x39projects/{project}/locations/{location}/caPools/{ca_pool}\xea\x41w\n(compute.googleapis.com/ServiceAttachment\x12Kprojects/{project}/regions/{region}/serviceAttachments/{service_attachment}b\x06proto3" - -pool = ::Google::Protobuf::DescriptorPool.generated_pool -pool.add_serialized_file(descriptor_data) - -module Google - module Cloud - module SecureSourceManager - module V1 - Instance = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.securesourcemanager.v1.Instance").msgclass - Instance::HostConfig = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.securesourcemanager.v1.Instance.HostConfig").msgclass - Instance::PrivateConfig = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.securesourcemanager.v1.Instance.PrivateConfig").msgclass - Instance::WorkforceIdentityFederationConfig = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.securesourcemanager.v1.Instance.WorkforceIdentityFederationConfig").msgclass - Instance::State = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.securesourcemanager.v1.Instance.State").enummodule - Instance::StateNote = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.securesourcemanager.v1.Instance.StateNote").enummodule - Repository = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.securesourcemanager.v1.Repository").msgclass - Repository::URIs = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.securesourcemanager.v1.Repository.URIs").msgclass - Repository::InitialConfig = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.securesourcemanager.v1.Repository.InitialConfig").msgclass - Hook = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.securesourcemanager.v1.Hook").msgclass - Hook::PushOption = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.securesourcemanager.v1.Hook.PushOption").msgclass - Hook::HookEventType = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.securesourcemanager.v1.Hook.HookEventType").enummodule - BranchRule = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.securesourcemanager.v1.BranchRule").msgclass - BranchRule::Check = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.securesourcemanager.v1.BranchRule.Check").msgclass - PullRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.securesourcemanager.v1.PullRequest").msgclass - PullRequest::Branch = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.securesourcemanager.v1.PullRequest.Branch").msgclass - PullRequest::State = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.securesourcemanager.v1.PullRequest.State").enummodule - FileDiff = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.securesourcemanager.v1.FileDiff").msgclass - FileDiff::Action = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.securesourcemanager.v1.FileDiff.Action").enummodule - Issue = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.securesourcemanager.v1.Issue").msgclass - Issue::State = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.securesourcemanager.v1.Issue.State").enummodule - IssueComment = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.securesourcemanager.v1.IssueComment").msgclass - PullRequestComment = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.securesourcemanager.v1.PullRequestComment").msgclass - PullRequestComment::Review = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.securesourcemanager.v1.PullRequestComment.Review").msgclass - PullRequestComment::Review::ActionType = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.securesourcemanager.v1.PullRequestComment.Review.ActionType").enummodule - PullRequestComment::Comment = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.securesourcemanager.v1.PullRequestComment.Comment").msgclass - PullRequestComment::Code = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.securesourcemanager.v1.PullRequestComment.Code").msgclass - PullRequestComment::Position = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.securesourcemanager.v1.PullRequestComment.Position").msgclass - ListInstancesRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.securesourcemanager.v1.ListInstancesRequest").msgclass - ListInstancesResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.securesourcemanager.v1.ListInstancesResponse").msgclass - GetInstanceRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.securesourcemanager.v1.GetInstanceRequest").msgclass - CreateInstanceRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.securesourcemanager.v1.CreateInstanceRequest").msgclass - DeleteInstanceRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.securesourcemanager.v1.DeleteInstanceRequest").msgclass - OperationMetadata = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.securesourcemanager.v1.OperationMetadata").msgclass - ListRepositoriesRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.securesourcemanager.v1.ListRepositoriesRequest").msgclass - ListRepositoriesResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.securesourcemanager.v1.ListRepositoriesResponse").msgclass - GetRepositoryRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.securesourcemanager.v1.GetRepositoryRequest").msgclass - CreateRepositoryRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.securesourcemanager.v1.CreateRepositoryRequest").msgclass - UpdateRepositoryRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.securesourcemanager.v1.UpdateRepositoryRequest").msgclass - DeleteRepositoryRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.securesourcemanager.v1.DeleteRepositoryRequest").msgclass - ListHooksRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.securesourcemanager.v1.ListHooksRequest").msgclass - ListHooksResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.securesourcemanager.v1.ListHooksResponse").msgclass - GetHookRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.securesourcemanager.v1.GetHookRequest").msgclass - CreateHookRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.securesourcemanager.v1.CreateHookRequest").msgclass - UpdateHookRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.securesourcemanager.v1.UpdateHookRequest").msgclass - DeleteHookRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.securesourcemanager.v1.DeleteHookRequest").msgclass - GetBranchRuleRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.securesourcemanager.v1.GetBranchRuleRequest").msgclass - CreateBranchRuleRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.securesourcemanager.v1.CreateBranchRuleRequest").msgclass - ListBranchRulesRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.securesourcemanager.v1.ListBranchRulesRequest").msgclass - DeleteBranchRuleRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.securesourcemanager.v1.DeleteBranchRuleRequest").msgclass - UpdateBranchRuleRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.securesourcemanager.v1.UpdateBranchRuleRequest").msgclass - ListBranchRulesResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.securesourcemanager.v1.ListBranchRulesResponse").msgclass - CreatePullRequestRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.securesourcemanager.v1.CreatePullRequestRequest").msgclass - GetPullRequestRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.securesourcemanager.v1.GetPullRequestRequest").msgclass - ListPullRequestsRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.securesourcemanager.v1.ListPullRequestsRequest").msgclass - ListPullRequestsResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.securesourcemanager.v1.ListPullRequestsResponse").msgclass - UpdatePullRequestRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.securesourcemanager.v1.UpdatePullRequestRequest").msgclass - MergePullRequestRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.securesourcemanager.v1.MergePullRequestRequest").msgclass - OpenPullRequestRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.securesourcemanager.v1.OpenPullRequestRequest").msgclass - ClosePullRequestRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.securesourcemanager.v1.ClosePullRequestRequest").msgclass - ListPullRequestFileDiffsRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.securesourcemanager.v1.ListPullRequestFileDiffsRequest").msgclass - ListPullRequestFileDiffsResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.securesourcemanager.v1.ListPullRequestFileDiffsResponse").msgclass - CreateIssueRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.securesourcemanager.v1.CreateIssueRequest").msgclass - GetIssueRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.securesourcemanager.v1.GetIssueRequest").msgclass - ListIssuesRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.securesourcemanager.v1.ListIssuesRequest").msgclass - ListIssuesResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.securesourcemanager.v1.ListIssuesResponse").msgclass - UpdateIssueRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.securesourcemanager.v1.UpdateIssueRequest").msgclass - DeleteIssueRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.securesourcemanager.v1.DeleteIssueRequest").msgclass - CloseIssueRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.securesourcemanager.v1.CloseIssueRequest").msgclass - OpenIssueRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.securesourcemanager.v1.OpenIssueRequest").msgclass - TreeEntry = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.securesourcemanager.v1.TreeEntry").msgclass - TreeEntry::ObjectType = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.securesourcemanager.v1.TreeEntry.ObjectType").enummodule - FetchTreeRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.securesourcemanager.v1.FetchTreeRequest").msgclass - FetchTreeResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.securesourcemanager.v1.FetchTreeResponse").msgclass - FetchBlobRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.securesourcemanager.v1.FetchBlobRequest").msgclass - FetchBlobResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.securesourcemanager.v1.FetchBlobResponse").msgclass - ListPullRequestCommentsRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.securesourcemanager.v1.ListPullRequestCommentsRequest").msgclass - ListPullRequestCommentsResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.securesourcemanager.v1.ListPullRequestCommentsResponse").msgclass - CreatePullRequestCommentRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.securesourcemanager.v1.CreatePullRequestCommentRequest").msgclass - BatchCreatePullRequestCommentsRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.securesourcemanager.v1.BatchCreatePullRequestCommentsRequest").msgclass - BatchCreatePullRequestCommentsResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.securesourcemanager.v1.BatchCreatePullRequestCommentsResponse").msgclass - UpdatePullRequestCommentRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.securesourcemanager.v1.UpdatePullRequestCommentRequest").msgclass - DeletePullRequestCommentRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.securesourcemanager.v1.DeletePullRequestCommentRequest").msgclass - GetPullRequestCommentRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.securesourcemanager.v1.GetPullRequestCommentRequest").msgclass - ResolvePullRequestCommentsRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.securesourcemanager.v1.ResolvePullRequestCommentsRequest").msgclass - ResolvePullRequestCommentsResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.securesourcemanager.v1.ResolvePullRequestCommentsResponse").msgclass - UnresolvePullRequestCommentsRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.securesourcemanager.v1.UnresolvePullRequestCommentsRequest").msgclass - UnresolvePullRequestCommentsResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.securesourcemanager.v1.UnresolvePullRequestCommentsResponse").msgclass - CreateIssueCommentRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.securesourcemanager.v1.CreateIssueCommentRequest").msgclass - GetIssueCommentRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.securesourcemanager.v1.GetIssueCommentRequest").msgclass - ListIssueCommentsRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.securesourcemanager.v1.ListIssueCommentsRequest").msgclass - ListIssueCommentsResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.securesourcemanager.v1.ListIssueCommentsResponse").msgclass - UpdateIssueCommentRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.securesourcemanager.v1.UpdateIssueCommentRequest").msgclass - DeleteIssueCommentRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.securesourcemanager.v1.DeleteIssueCommentRequest").msgclass - end - end - end -end diff --git a/owl-bot-staging/google-cloud-secure_source_manager-v1/lib/google/cloud/securesourcemanager/v1/secure_source_manager_services_pb.rb b/owl-bot-staging/google-cloud-secure_source_manager-v1/lib/google/cloud/securesourcemanager/v1/secure_source_manager_services_pb.rb deleted file mode 100644 index 53c79d77f2f6..000000000000 --- a/owl-bot-staging/google-cloud-secure_source_manager-v1/lib/google/cloud/securesourcemanager/v1/secure_source_manager_services_pb.rb +++ /dev/null @@ -1,170 +0,0 @@ -# Generated by the protocol buffer compiler. DO NOT EDIT! -# Source: google/cloud/securesourcemanager/v1/secure_source_manager.proto for package 'Google.Cloud.SecureSourceManager.V1' -# Original file comments: -# 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 -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. -# - -require 'grpc' -require 'google/cloud/securesourcemanager/v1/secure_source_manager_pb' - -module Google - module Cloud - module SecureSourceManager - module V1 - module SecureSourceManager - # Secure Source Manager API - # - # Access Secure Source Manager instances, resources, and repositories. - class Service - - include ::GRPC::GenericService - - self.marshal_class_method = :encode - self.unmarshal_class_method = :decode - self.service_name = 'google.cloud.securesourcemanager.v1.SecureSourceManager' - - # Lists Instances in a given project and location. - rpc :ListInstances, ::Google::Cloud::SecureSourceManager::V1::ListInstancesRequest, ::Google::Cloud::SecureSourceManager::V1::ListInstancesResponse - # Gets details of a single instance. - rpc :GetInstance, ::Google::Cloud::SecureSourceManager::V1::GetInstanceRequest, ::Google::Cloud::SecureSourceManager::V1::Instance - # Creates a new instance in a given project and location. - rpc :CreateInstance, ::Google::Cloud::SecureSourceManager::V1::CreateInstanceRequest, ::Google::Longrunning::Operation - # Deletes a single instance. - rpc :DeleteInstance, ::Google::Cloud::SecureSourceManager::V1::DeleteInstanceRequest, ::Google::Longrunning::Operation - # Lists Repositories in a given project and location. - # - # The instance field is required in the query parameter for requests using - # the securesourcemanager.googleapis.com endpoint. - rpc :ListRepositories, ::Google::Cloud::SecureSourceManager::V1::ListRepositoriesRequest, ::Google::Cloud::SecureSourceManager::V1::ListRepositoriesResponse - # Gets metadata of a repository. - rpc :GetRepository, ::Google::Cloud::SecureSourceManager::V1::GetRepositoryRequest, ::Google::Cloud::SecureSourceManager::V1::Repository - # Creates a new repository in a given project and location. - # - # The Repository.Instance field is required in the request body for requests - # using the securesourcemanager.googleapis.com endpoint. - rpc :CreateRepository, ::Google::Cloud::SecureSourceManager::V1::CreateRepositoryRequest, ::Google::Longrunning::Operation - # Updates the metadata of a repository. - rpc :UpdateRepository, ::Google::Cloud::SecureSourceManager::V1::UpdateRepositoryRequest, ::Google::Longrunning::Operation - # Deletes a Repository. - rpc :DeleteRepository, ::Google::Cloud::SecureSourceManager::V1::DeleteRepositoryRequest, ::Google::Longrunning::Operation - # Lists hooks in a given repository. - rpc :ListHooks, ::Google::Cloud::SecureSourceManager::V1::ListHooksRequest, ::Google::Cloud::SecureSourceManager::V1::ListHooksResponse - # Gets metadata of a hook. - rpc :GetHook, ::Google::Cloud::SecureSourceManager::V1::GetHookRequest, ::Google::Cloud::SecureSourceManager::V1::Hook - # Creates a new hook in a given repository. - rpc :CreateHook, ::Google::Cloud::SecureSourceManager::V1::CreateHookRequest, ::Google::Longrunning::Operation - # Updates the metadata of a hook. - rpc :UpdateHook, ::Google::Cloud::SecureSourceManager::V1::UpdateHookRequest, ::Google::Longrunning::Operation - # Deletes a Hook. - rpc :DeleteHook, ::Google::Cloud::SecureSourceManager::V1::DeleteHookRequest, ::Google::Longrunning::Operation - # Get IAM policy for a repository. - rpc :GetIamPolicyRepo, ::Google::Iam::V1::GetIamPolicyRequest, ::Google::Iam::V1::Policy - # Set IAM policy on a repository. - rpc :SetIamPolicyRepo, ::Google::Iam::V1::SetIamPolicyRequest, ::Google::Iam::V1::Policy - # Test IAM permissions on a repository. - # IAM permission checks are not required on this method. - rpc :TestIamPermissionsRepo, ::Google::Iam::V1::TestIamPermissionsRequest, ::Google::Iam::V1::TestIamPermissionsResponse - # CreateBranchRule creates a branch rule in a given repository. - rpc :CreateBranchRule, ::Google::Cloud::SecureSourceManager::V1::CreateBranchRuleRequest, ::Google::Longrunning::Operation - # ListBranchRules lists branch rules in a given repository. - rpc :ListBranchRules, ::Google::Cloud::SecureSourceManager::V1::ListBranchRulesRequest, ::Google::Cloud::SecureSourceManager::V1::ListBranchRulesResponse - # GetBranchRule gets a branch rule. - rpc :GetBranchRule, ::Google::Cloud::SecureSourceManager::V1::GetBranchRuleRequest, ::Google::Cloud::SecureSourceManager::V1::BranchRule - # UpdateBranchRule updates a branch rule. - rpc :UpdateBranchRule, ::Google::Cloud::SecureSourceManager::V1::UpdateBranchRuleRequest, ::Google::Longrunning::Operation - # DeleteBranchRule deletes a branch rule. - rpc :DeleteBranchRule, ::Google::Cloud::SecureSourceManager::V1::DeleteBranchRuleRequest, ::Google::Longrunning::Operation - # Creates a pull request. - rpc :CreatePullRequest, ::Google::Cloud::SecureSourceManager::V1::CreatePullRequestRequest, ::Google::Longrunning::Operation - # Gets a pull request. - rpc :GetPullRequest, ::Google::Cloud::SecureSourceManager::V1::GetPullRequestRequest, ::Google::Cloud::SecureSourceManager::V1::PullRequest - # Lists pull requests in a repository. - rpc :ListPullRequests, ::Google::Cloud::SecureSourceManager::V1::ListPullRequestsRequest, ::Google::Cloud::SecureSourceManager::V1::ListPullRequestsResponse - # Updates a pull request. - rpc :UpdatePullRequest, ::Google::Cloud::SecureSourceManager::V1::UpdatePullRequestRequest, ::Google::Longrunning::Operation - # Merges a pull request. - rpc :MergePullRequest, ::Google::Cloud::SecureSourceManager::V1::MergePullRequestRequest, ::Google::Longrunning::Operation - # Opens a pull request. - rpc :OpenPullRequest, ::Google::Cloud::SecureSourceManager::V1::OpenPullRequestRequest, ::Google::Longrunning::Operation - # Closes a pull request without merging. - rpc :ClosePullRequest, ::Google::Cloud::SecureSourceManager::V1::ClosePullRequestRequest, ::Google::Longrunning::Operation - # Lists a pull request's file diffs. - rpc :ListPullRequestFileDiffs, ::Google::Cloud::SecureSourceManager::V1::ListPullRequestFileDiffsRequest, ::Google::Cloud::SecureSourceManager::V1::ListPullRequestFileDiffsResponse - # Fetches a tree from a repository. - rpc :FetchTree, ::Google::Cloud::SecureSourceManager::V1::FetchTreeRequest, ::Google::Cloud::SecureSourceManager::V1::FetchTreeResponse - # Fetches a blob from a repository. - rpc :FetchBlob, ::Google::Cloud::SecureSourceManager::V1::FetchBlobRequest, ::Google::Cloud::SecureSourceManager::V1::FetchBlobResponse - # Creates an issue. - rpc :CreateIssue, ::Google::Cloud::SecureSourceManager::V1::CreateIssueRequest, ::Google::Longrunning::Operation - # Gets an issue. - rpc :GetIssue, ::Google::Cloud::SecureSourceManager::V1::GetIssueRequest, ::Google::Cloud::SecureSourceManager::V1::Issue - # Lists issues in a repository. - rpc :ListIssues, ::Google::Cloud::SecureSourceManager::V1::ListIssuesRequest, ::Google::Cloud::SecureSourceManager::V1::ListIssuesResponse - # Updates a issue. - rpc :UpdateIssue, ::Google::Cloud::SecureSourceManager::V1::UpdateIssueRequest, ::Google::Longrunning::Operation - # Deletes an issue. - rpc :DeleteIssue, ::Google::Cloud::SecureSourceManager::V1::DeleteIssueRequest, ::Google::Longrunning::Operation - # Opens an issue. - rpc :OpenIssue, ::Google::Cloud::SecureSourceManager::V1::OpenIssueRequest, ::Google::Longrunning::Operation - # Closes an issue. - rpc :CloseIssue, ::Google::Cloud::SecureSourceManager::V1::CloseIssueRequest, ::Google::Longrunning::Operation - # Gets a pull request comment. - rpc :GetPullRequestComment, ::Google::Cloud::SecureSourceManager::V1::GetPullRequestCommentRequest, ::Google::Cloud::SecureSourceManager::V1::PullRequestComment - # Lists pull request comments. - rpc :ListPullRequestComments, ::Google::Cloud::SecureSourceManager::V1::ListPullRequestCommentsRequest, ::Google::Cloud::SecureSourceManager::V1::ListPullRequestCommentsResponse - # Creates a pull request comment. This function is used to create a single - # PullRequestComment of type Comment, or a single PullRequestComment of type - # Code that's replying to another PullRequestComment of type Code. Use - # BatchCreatePullRequestComments to create multiple PullRequestComments for - # code reviews. - rpc :CreatePullRequestComment, ::Google::Cloud::SecureSourceManager::V1::CreatePullRequestCommentRequest, ::Google::Longrunning::Operation - # Updates a pull request comment. - rpc :UpdatePullRequestComment, ::Google::Cloud::SecureSourceManager::V1::UpdatePullRequestCommentRequest, ::Google::Longrunning::Operation - # Deletes a pull request comment. - rpc :DeletePullRequestComment, ::Google::Cloud::SecureSourceManager::V1::DeletePullRequestCommentRequest, ::Google::Longrunning::Operation - # Batch creates pull request comments. This function is used to create - # multiple PullRequestComments for code review. There needs to be exactly one - # PullRequestComment of type Review, and at most 100 PullRequestComments of - # type Code per request. The Postition of the code comments must be unique - # within the request. - rpc :BatchCreatePullRequestComments, ::Google::Cloud::SecureSourceManager::V1::BatchCreatePullRequestCommentsRequest, ::Google::Longrunning::Operation - # Resolves pull request comments. A list of PullRequestComment names must be - # provided. The PullRequestComment names must be in the same conversation - # thread. If auto_fill is set, all comments in the conversation thread will - # be resolved. - rpc :ResolvePullRequestComments, ::Google::Cloud::SecureSourceManager::V1::ResolvePullRequestCommentsRequest, ::Google::Longrunning::Operation - # Unresolves pull request comments. A list of PullRequestComment names must - # be provided. The PullRequestComment names must be in the same conversation - # thread. If auto_fill is set, all comments in the conversation thread will - # be unresolved. - rpc :UnresolvePullRequestComments, ::Google::Cloud::SecureSourceManager::V1::UnresolvePullRequestCommentsRequest, ::Google::Longrunning::Operation - # Creates an issue comment. - rpc :CreateIssueComment, ::Google::Cloud::SecureSourceManager::V1::CreateIssueCommentRequest, ::Google::Longrunning::Operation - # Gets an issue comment. - rpc :GetIssueComment, ::Google::Cloud::SecureSourceManager::V1::GetIssueCommentRequest, ::Google::Cloud::SecureSourceManager::V1::IssueComment - # Lists comments in an issue. - rpc :ListIssueComments, ::Google::Cloud::SecureSourceManager::V1::ListIssueCommentsRequest, ::Google::Cloud::SecureSourceManager::V1::ListIssueCommentsResponse - # Updates an issue comment. - rpc :UpdateIssueComment, ::Google::Cloud::SecureSourceManager::V1::UpdateIssueCommentRequest, ::Google::Longrunning::Operation - # Deletes an issue comment. - rpc :DeleteIssueComment, ::Google::Cloud::SecureSourceManager::V1::DeleteIssueCommentRequest, ::Google::Longrunning::Operation - end - - Stub = Service.rpc_stub_class - end - end - end - end -end diff --git a/owl-bot-staging/google-cloud-secure_source_manager-v1/proto_docs/README.md b/owl-bot-staging/google-cloud-secure_source_manager-v1/proto_docs/README.md deleted file mode 100644 index 993b0230a7dc..000000000000 --- a/owl-bot-staging/google-cloud-secure_source_manager-v1/proto_docs/README.md +++ /dev/null @@ -1,4 +0,0 @@ -# Secure Source Manager V1 Protocol Buffer Documentation - -These files are for the YARD documentation of the generated protobuf files. -They are not intended to be required or loaded at runtime. diff --git a/owl-bot-staging/google-cloud-secure_source_manager-v1/proto_docs/google/api/client.rb b/owl-bot-staging/google-cloud-secure_source_manager-v1/proto_docs/google/api/client.rb deleted file mode 100644 index 5089551e9ea4..000000000000 --- a/owl-bot-staging/google-cloud-secure_source_manager-v1/proto_docs/google/api/client.rb +++ /dev/null @@ -1,589 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - - -module Google - module Api - # Required information for every language. - # @!attribute [rw] reference_docs_uri - # @deprecated This field is deprecated and may be removed in the next major version update. - # @return [::String] - # Link to automatically generated reference documentation. Example: - # https://cloud.google.com/nodejs/docs/reference/asset/latest - # @!attribute [rw] destinations - # @return [::Array<::Google::Api::ClientLibraryDestination>] - # The destination where API teams want this client library to be published. - # @!attribute [rw] selective_gapic_generation - # @return [::Google::Api::SelectiveGapicGeneration] - # Configuration for which RPCs should be generated in the GAPIC client. - class CommonLanguageSettings - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Details about how and where to publish client libraries. - # @!attribute [rw] version - # @return [::String] - # Version of the API to apply these settings to. This is the full protobuf - # package for the API, ending in the version element. - # Examples: "google.cloud.speech.v1" and "google.spanner.admin.database.v1". - # @!attribute [rw] launch_stage - # @return [::Google::Api::LaunchStage] - # Launch stage of this version of the API. - # @!attribute [rw] rest_numeric_enums - # @return [::Boolean] - # When using transport=rest, the client request will encode enums as - # numbers rather than strings. - # @!attribute [rw] java_settings - # @return [::Google::Api::JavaSettings] - # Settings for legacy Java features, supported in the Service YAML. - # @!attribute [rw] cpp_settings - # @return [::Google::Api::CppSettings] - # Settings for C++ client libraries. - # @!attribute [rw] php_settings - # @return [::Google::Api::PhpSettings] - # Settings for PHP client libraries. - # @!attribute [rw] python_settings - # @return [::Google::Api::PythonSettings] - # Settings for Python client libraries. - # @!attribute [rw] node_settings - # @return [::Google::Api::NodeSettings] - # Settings for Node client libraries. - # @!attribute [rw] dotnet_settings - # @return [::Google::Api::DotnetSettings] - # Settings for .NET client libraries. - # @!attribute [rw] ruby_settings - # @return [::Google::Api::RubySettings] - # Settings for Ruby client libraries. - # @!attribute [rw] go_settings - # @return [::Google::Api::GoSettings] - # Settings for Go client libraries. - class ClientLibrarySettings - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # This message configures the settings for publishing [Google Cloud Client - # libraries](https://cloud.google.com/apis/docs/cloud-client-libraries) - # generated from the service config. - # @!attribute [rw] method_settings - # @return [::Array<::Google::Api::MethodSettings>] - # A list of API method settings, e.g. the behavior for methods that use the - # long-running operation pattern. - # @!attribute [rw] new_issue_uri - # @return [::String] - # Link to a *public* URI where users can report issues. Example: - # https://issuetracker.google.com/issues/new?component=190865&template=1161103 - # @!attribute [rw] documentation_uri - # @return [::String] - # Link to product home page. Example: - # https://cloud.google.com/asset-inventory/docs/overview - # @!attribute [rw] api_short_name - # @return [::String] - # Used as a tracking tag when collecting data about the APIs developer - # relations artifacts like docs, packages delivered to package managers, - # etc. Example: "speech". - # @!attribute [rw] github_label - # @return [::String] - # GitHub label to apply to issues and pull requests opened for this API. - # @!attribute [rw] codeowner_github_teams - # @return [::Array<::String>] - # GitHub teams to be added to CODEOWNERS in the directory in GitHub - # containing source code for the client libraries for this API. - # @!attribute [rw] doc_tag_prefix - # @return [::String] - # A prefix used in sample code when demarking regions to be included in - # documentation. - # @!attribute [rw] organization - # @return [::Google::Api::ClientLibraryOrganization] - # For whom the client library is being published. - # @!attribute [rw] library_settings - # @return [::Array<::Google::Api::ClientLibrarySettings>] - # Client library settings. If the same version string appears multiple - # times in this list, then the last one wins. Settings from earlier - # settings with the same version string are discarded. - # @!attribute [rw] proto_reference_documentation_uri - # @return [::String] - # Optional link to proto reference documentation. Example: - # https://cloud.google.com/pubsub/lite/docs/reference/rpc - # @!attribute [rw] rest_reference_documentation_uri - # @return [::String] - # Optional link to REST reference documentation. Example: - # https://cloud.google.com/pubsub/lite/docs/reference/rest - class Publishing - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Settings for Java client libraries. - # @!attribute [rw] library_package - # @return [::String] - # The package name to use in Java. Clobbers the java_package option - # set in the protobuf. This should be used **only** by APIs - # who have already set the language_settings.java.package_name" field - # in gapic.yaml. API teams should use the protobuf java_package option - # where possible. - # - # Example of a YAML configuration:: - # - # publishing: - # 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. - # @!attribute [rw] methods - # @return [::Array<::String>] - # An allowlist of the fully qualified names of RPCs that should be included - # on public client surfaces. - # @!attribute [rw] generate_omitted_as_internal - # @return [::Boolean] - # Setting this to true indicates to the client generators that methods - # that would be excluded from the generation should instead be generated - # in a way that indicates these methods should not be consumed by - # end users. How this is expressed is up to individual language - # implementations to decide. Some examples may be: added annotations, - # obfuscated identifiers, or other language idiomatic patterns. - class SelectiveGapicGeneration - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # `BatchingConfigProto` defines the batching configuration for an API method. - # @!attribute [rw] thresholds - # @return [::Google::Api::BatchingSettingsProto] - # The thresholds which trigger a batched request to be sent. - # @!attribute [rw] batch_descriptor - # @return [::Google::Api::BatchingDescriptorProto] - # The request and response fields used in batching. - class BatchingConfigProto - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # `BatchingSettingsProto` specifies a set of batching thresholds, each of - # which acts as a trigger to send a batch of messages as a request. At least - # one threshold must be positive nonzero. - # @!attribute [rw] element_count_threshold - # @return [::Integer] - # The number of elements of a field collected into a batch which, if - # exceeded, causes the batch to be sent. - # @!attribute [rw] request_byte_threshold - # @return [::Integer] - # The aggregated size of the batched field which, if exceeded, causes the - # batch to be sent. This size is computed by aggregating the sizes of the - # request field to be batched, not of the entire request message. - # @!attribute [rw] delay_threshold - # @return [::Google::Protobuf::Duration] - # The duration after which a batch should be sent, starting from the addition - # of the first message to that batch. - # @!attribute [rw] element_count_limit - # @return [::Integer] - # The maximum number of elements collected in a batch that could be accepted - # by server. - # @!attribute [rw] request_byte_limit - # @return [::Integer] - # The maximum size of the request that could be accepted by server. - # @!attribute [rw] flow_control_element_limit - # @return [::Integer] - # The maximum number of elements allowed by flow control. - # @!attribute [rw] flow_control_byte_limit - # @return [::Integer] - # The maximum size of data allowed by flow control. - # @!attribute [rw] flow_control_limit_exceeded_behavior - # @return [::Google::Api::FlowControlLimitExceededBehaviorProto] - # The behavior to take when the flow control limit is exceeded. - class BatchingSettingsProto - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # `BatchingDescriptorProto` specifies the fields of the request message to be - # used for batching, and, optionally, the fields of the response message to be - # used for demultiplexing. - # @!attribute [rw] batched_field - # @return [::String] - # The repeated field in the request message to be aggregated by batching. - # @!attribute [rw] discriminator_fields - # @return [::Array<::String>] - # A list of the fields in the request message. Two requests will be batched - # together only if the values of every field specified in - # `request_discriminator_fields` is equal between the two requests. - # @!attribute [rw] subresponse_field - # @return [::String] - # Optional. When present, indicates the field in the response message to be - # used to demultiplex the response into multiple response messages, in - # correspondence with the multiple request messages originally batched - # together. - class BatchingDescriptorProto - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # The organization for which the client libraries are being published. - # Affects the url where generated docs are published, etc. - module ClientLibraryOrganization - # Not useful. - CLIENT_LIBRARY_ORGANIZATION_UNSPECIFIED = 0 - - # Google Cloud Platform Org. - CLOUD = 1 - - # Ads (Advertising) Org. - ADS = 2 - - # Photos Org. - PHOTOS = 3 - - # Street View Org. - STREET_VIEW = 4 - - # Shopping Org. - SHOPPING = 5 - - # Geo Org. - GEO = 6 - - # Generative AI - https://developers.generativeai.google - GENERATIVE_AI = 7 - end - - # To where should client libraries be published? - module ClientLibraryDestination - # Client libraries will neither be generated nor published to package - # managers. - CLIENT_LIBRARY_DESTINATION_UNSPECIFIED = 0 - - # Generate the client library in a repo under github.com/googleapis, - # but don't publish it to package managers. - GITHUB = 10 - - # Publish the library to package managers like nuget.org and npmjs.com. - PACKAGE_MANAGER = 20 - end - - # The behavior to take when the flow control limit is exceeded. - module FlowControlLimitExceededBehaviorProto - # Default behavior, system-defined. - UNSET_BEHAVIOR = 0 - - # Stop operation, raise error. - THROW_EXCEPTION = 1 - - # Pause operation until limit clears. - BLOCK = 2 - - # Continue operation, disregard limit. - IGNORE = 3 - end - end -end diff --git a/owl-bot-staging/google-cloud-secure_source_manager-v1/proto_docs/google/api/field_behavior.rb b/owl-bot-staging/google-cloud-secure_source_manager-v1/proto_docs/google/api/field_behavior.rb deleted file mode 100644 index 582be187d115..000000000000 --- a/owl-bot-staging/google-cloud-secure_source_manager-v1/proto_docs/google/api/field_behavior.rb +++ /dev/null @@ -1,85 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - - -module Google - module Api - # An indicator of the behavior of a given field (for example, that a field - # is required in requests, or given as output but ignored as input). - # This **does not** change the behavior in protocol buffers itself; it only - # denotes the behavior and may affect how API tooling handles the field. - # - # Note: This enum **may** receive new values in the future. - module FieldBehavior - # Conventional default for enums. Do not use this. - FIELD_BEHAVIOR_UNSPECIFIED = 0 - - # Specifically denotes a field as optional. - # While all fields in protocol buffers are optional, this may be specified - # for emphasis if appropriate. - OPTIONAL = 1 - - # Denotes a field as required. - # This indicates that the field **must** be provided as part of the request, - # and failure to do so will cause an error (usually `INVALID_ARGUMENT`). - REQUIRED = 2 - - # Denotes a field as output only. - # This indicates that the field is provided in responses, but including the - # field in a request does nothing (the server *must* ignore it and - # *must not* throw an error as a result of the field's presence). - OUTPUT_ONLY = 3 - - # Denotes a field as input only. - # This indicates that the field is provided in requests, and the - # corresponding field is not included in output. - INPUT_ONLY = 4 - - # Denotes a field as immutable. - # This indicates that the field may be set once in a request to create a - # resource, but may not be changed thereafter. - IMMUTABLE = 5 - - # Denotes that a (repeated) field is an unordered list. - # This indicates that the service may provide the elements of the list - # in any arbitrary order, rather than the order the user originally - # provided. Additionally, the list's order may or may not be stable. - UNORDERED_LIST = 6 - - # Denotes that this field returns a non-empty default value if not set. - # This indicates that if the user provides the empty value in a request, - # a non-empty value will be returned. The user will not be aware of what - # non-empty value to expect. - NON_EMPTY_DEFAULT = 7 - - # Denotes that the field in a resource (a message annotated with - # google.api.resource) is used in the resource name to uniquely identify the - # resource. For AIP-compliant APIs, this should only be applied to the - # `name` field on the resource. - # - # This behavior should not be applied to references to other resources within - # the message. - # - # The identifier field of resources often have different field behavior - # depending on the request it is embedded in (e.g. for Create methods name - # is optional and unused, while for Update methods it is required). Instead - # of method-specific annotations, only `IDENTIFIER` is required. - IDENTIFIER = 8 - end - end -end diff --git a/owl-bot-staging/google-cloud-secure_source_manager-v1/proto_docs/google/api/launch_stage.rb b/owl-bot-staging/google-cloud-secure_source_manager-v1/proto_docs/google/api/launch_stage.rb deleted file mode 100644 index 9392a413fb1b..000000000000 --- a/owl-bot-staging/google-cloud-secure_source_manager-v1/proto_docs/google/api/launch_stage.rb +++ /dev/null @@ -1,71 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - - -module Google - module Api - # The launch stage as defined by [Google Cloud Platform - # Launch Stages](https://cloud.google.com/terms/launch-stages). - module LaunchStage - # Do not use this default value. - LAUNCH_STAGE_UNSPECIFIED = 0 - - # The feature is not yet implemented. Users can not use it. - UNIMPLEMENTED = 6 - - # Prelaunch features are hidden from users and are only visible internally. - PRELAUNCH = 7 - - # Early Access features are limited to a closed group of testers. To use - # these features, you must sign up in advance and sign a Trusted Tester - # agreement (which includes confidentiality provisions). These features may - # be unstable, changed in backward-incompatible ways, and are not - # guaranteed to be released. - EARLY_ACCESS = 1 - - # Alpha is a limited availability test for releases before they are cleared - # for widespread use. By Alpha, all significant design issues are resolved - # and we are in the process of verifying functionality. Alpha customers - # need to apply for access, agree to applicable terms, and have their - # projects allowlisted. Alpha releases don't have to be feature complete, - # no SLAs are provided, and there are no technical support obligations, but - # they will be far enough along that customers can actually use them in - # test environments or for limited-use tests -- just like they would in - # normal production cases. - ALPHA = 2 - - # Beta is the point at which we are ready to open a release for any - # customer to use. There are no SLA or technical support obligations in a - # Beta release. Products will be complete from a feature perspective, but - # may have some open outstanding issues. Beta releases are suitable for - # limited production use cases. - BETA = 3 - - # GA features are open to all developers and are considered stable and - # fully qualified for production use. - GA = 4 - - # Deprecated features are scheduled to be shut down and removed. For more - # information, see the "Deprecation Policy" section of our [Terms of - # Service](https://cloud.google.com/terms/) - # and the [Google Cloud Platform Subject to the Deprecation - # Policy](https://cloud.google.com/terms/deprecation) documentation. - DEPRECATED = 5 - end - end -end diff --git a/owl-bot-staging/google-cloud-secure_source_manager-v1/proto_docs/google/api/resource.rb b/owl-bot-staging/google-cloud-secure_source_manager-v1/proto_docs/google/api/resource.rb deleted file mode 100644 index 25dec4847ac1..000000000000 --- a/owl-bot-staging/google-cloud-secure_source_manager-v1/proto_docs/google/api/resource.rb +++ /dev/null @@ -1,227 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - - -module Google - module Api - # A simple descriptor of a resource type. - # - # ResourceDescriptor annotates a resource message (either by means of a - # protobuf annotation or use in the service config), and associates the - # resource's schema, the resource type, and the pattern of the resource name. - # - # Example: - # - # message Topic { - # // Indicates this message defines a resource schema. - # // Declares the resource type in the format of {service}/{kind}. - # // For Kubernetes resources, the format is {api group}/{kind}. - # option (google.api.resource) = { - # type: "pubsub.googleapis.com/Topic" - # pattern: "projects/{project}/topics/{topic}" - # }; - # } - # - # The ResourceDescriptor Yaml config will look like: - # - # resources: - # - type: "pubsub.googleapis.com/Topic" - # pattern: "projects/{project}/topics/{topic}" - # - # Sometimes, resources have multiple patterns, typically because they can - # live under multiple parents. - # - # Example: - # - # message LogEntry { - # option (google.api.resource) = { - # type: "logging.googleapis.com/LogEntry" - # pattern: "projects/{project}/logs/{log}" - # pattern: "folders/{folder}/logs/{log}" - # pattern: "organizations/{organization}/logs/{log}" - # pattern: "billingAccounts/{billing_account}/logs/{log}" - # }; - # } - # - # The ResourceDescriptor Yaml config will look like: - # - # resources: - # - type: 'logging.googleapis.com/LogEntry' - # pattern: "projects/{project}/logs/{log}" - # pattern: "folders/{folder}/logs/{log}" - # pattern: "organizations/{organization}/logs/{log}" - # pattern: "billingAccounts/{billing_account}/logs/{log}" - # @!attribute [rw] type - # @return [::String] - # The resource type. It must be in the format of - # \\{service_name}/\\{resource_type_kind}. The `resource_type_kind` must be - # singular and must not include version numbers. - # - # Example: `storage.googleapis.com/Bucket` - # - # The value of the resource_type_kind must follow the regular expression - # /[A-Za-z][a-zA-Z0-9]+/. It should start with an upper case character and - # should use PascalCase (UpperCamelCase). The maximum number of - # characters allowed for the `resource_type_kind` is 100. - # @!attribute [rw] pattern - # @return [::Array<::String>] - # Optional. The relative resource name pattern associated with this resource - # type. The DNS prefix of the full resource name shouldn't be specified here. - # - # The path pattern must follow the syntax, which aligns with HTTP binding - # syntax: - # - # Template = Segment { "/" Segment } ; - # Segment = LITERAL | Variable ; - # Variable = "{" LITERAL "}" ; - # - # Examples: - # - # - "projects/\\{project}/topics/\\{topic}" - # - "projects/\\{project}/knowledgeBases/\\{knowledge_base}" - # - # The components in braces correspond to the IDs for each resource in the - # hierarchy. It is expected that, if multiple patterns are provided, - # the same component name (e.g. "project") refers to IDs of the same - # type of resource. - # @!attribute [rw] name_field - # @return [::String] - # Optional. The field on the resource that designates the resource name - # field. If omitted, this is assumed to be "name". - # @!attribute [rw] history - # @return [::Google::Api::ResourceDescriptor::History] - # Optional. The historical or future-looking state of the resource pattern. - # - # Example: - # - # // The InspectTemplate message originally only supported resource - # // names with organization, and project was added later. - # message InspectTemplate { - # option (google.api.resource) = { - # type: "dlp.googleapis.com/InspectTemplate" - # pattern: - # "organizations/{organization}/inspectTemplates/{inspect_template}" - # pattern: "projects/{project}/inspectTemplates/{inspect_template}" - # history: ORIGINALLY_SINGLE_PATTERN - # }; - # } - # @!attribute [rw] plural - # @return [::String] - # The plural name used in the resource name and permission names, such as - # 'projects' for the resource name of 'projects/\\{project}' and the permission - # name of 'cloudresourcemanager.googleapis.com/projects.get'. One exception - # to this is for Nested Collections that have stuttering names, as defined - # in [AIP-122](https://google.aip.dev/122#nested-collections), where the - # collection ID in the resource name pattern does not necessarily directly - # match the `plural` value. - # - # It is the same concept of the `plural` field in k8s CRD spec - # https://kubernetes.io/docs/tasks/access-kubernetes-api/custom-resources/custom-resource-definitions/ - # - # Note: The plural form is required even for singleton resources. See - # https://aip.dev/156 - # @!attribute [rw] singular - # @return [::String] - # The same concept of the `singular` field in k8s CRD spec - # https://kubernetes.io/docs/tasks/access-kubernetes-api/custom-resources/custom-resource-definitions/ - # Such as "project" for the `resourcemanager.googleapis.com/Project` type. - # @!attribute [rw] style - # @return [::Array<::Google::Api::ResourceDescriptor::Style>] - # Style flag(s) for this resource. - # These indicate that a resource is expected to conform to a given - # style. See the specific style flags for additional information. - class ResourceDescriptor - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - - # A description of the historical or future-looking state of the - # resource pattern. - module History - # The "unset" value. - HISTORY_UNSPECIFIED = 0 - - # The resource originally had one pattern and launched as such, and - # additional patterns were added later. - ORIGINALLY_SINGLE_PATTERN = 1 - - # The resource has one pattern, but the API owner expects to add more - # later. (This is the inverse of ORIGINALLY_SINGLE_PATTERN, and prevents - # that from being necessary once there are multiple patterns.) - FUTURE_MULTI_PATTERN = 2 - end - - # A flag representing a specific style that a resource claims to conform to. - module Style - # The unspecified value. Do not use. - STYLE_UNSPECIFIED = 0 - - # This resource is intended to be "declarative-friendly". - # - # Declarative-friendly resources must be more strictly consistent, and - # setting this to true communicates to tools that this resource should - # adhere to declarative-friendly expectations. - # - # Note: This is used by the API linter (linter.aip.dev) to enable - # additional checks. - DECLARATIVE_FRIENDLY = 1 - end - end - - # Defines a proto annotation that describes a string field that refers to - # an API resource. - # @!attribute [rw] type - # @return [::String] - # The resource type that the annotated field references. - # - # Example: - # - # message Subscription { - # string topic = 2 [(google.api.resource_reference) = { - # type: "pubsub.googleapis.com/Topic" - # }]; - # } - # - # Occasionally, a field may reference an arbitrary resource. In this case, - # APIs use the special value * in their resource reference. - # - # Example: - # - # message GetIamPolicyRequest { - # string resource = 2 [(google.api.resource_reference) = { - # type: "*" - # }]; - # } - # @!attribute [rw] child_type - # @return [::String] - # The resource type of a child collection that the annotated field - # references. This is useful for annotating the `parent` field that - # doesn't have a fixed resource type. - # - # Example: - # - # message ListLogEntriesRequest { - # string parent = 1 [(google.api.resource_reference) = { - # child_type: "logging.googleapis.com/LogEntry" - # }; - # } - class ResourceReference - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - end -end diff --git a/owl-bot-staging/google-cloud-secure_source_manager-v1/proto_docs/google/cloud/securesourcemanager/v1/secure_source_manager.rb b/owl-bot-staging/google-cloud-secure_source_manager-v1/proto_docs/google/cloud/securesourcemanager/v1/secure_source_manager.rb deleted file mode 100644 index a66817ea6ebc..000000000000 --- a/owl-bot-staging/google-cloud-secure_source_manager-v1/proto_docs/google/cloud/securesourcemanager/v1/secure_source_manager.rb +++ /dev/null @@ -1,1792 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - - -module Google - module Cloud - module SecureSourceManager - module V1 - # A resource that represents a Secure Source Manager instance. - # @!attribute [rw] name - # @return [::String] - # Optional. A unique identifier for an instance. The name should be of the - # format: - # `projects/{project_number}/locations/{location_id}/instances/{instance_id}` - # - # `project_number`: Maps to a unique int64 id assigned to each project. - # - # `location_id`: Refers to the region where the instance will be deployed. - # Since Secure Source Manager is a regional service, it must be one of the - # valid GCP regions. - # - # `instance_id`: User provided name for the instance, must be unique for a - # project_number and location_id combination. - # @!attribute [r] create_time - # @return [::Google::Protobuf::Timestamp] - # Output only. Create timestamp. - # @!attribute [r] update_time - # @return [::Google::Protobuf::Timestamp] - # Output only. Update timestamp. - # @!attribute [rw] labels - # @return [::Google::Protobuf::Map{::String => ::String}] - # Optional. Labels as key value pairs. - # @!attribute [rw] private_config - # @return [::Google::Cloud::SecureSourceManager::V1::Instance::PrivateConfig] - # Optional. Private settings for private instance. - # @!attribute [r] state - # @return [::Google::Cloud::SecureSourceManager::V1::Instance::State] - # Output only. Current state of the instance. - # @!attribute [r] state_note - # @return [::Google::Cloud::SecureSourceManager::V1::Instance::StateNote] - # Output only. An optional field providing information about the current - # instance state. - # @!attribute [rw] kms_key - # @return [::String] - # Optional. Immutable. Customer-managed encryption key name, in the format - # projects/*/locations/*/keyRings/*/cryptoKeys/*. - # @!attribute [r] host_config - # @return [::Google::Cloud::SecureSourceManager::V1::Instance::HostConfig] - # Output only. A list of hostnames for this instance. - # @!attribute [rw] workforce_identity_federation_config - # @return [::Google::Cloud::SecureSourceManager::V1::Instance::WorkforceIdentityFederationConfig] - # Optional. Configuration for Workforce Identity Federation to support - # third party identity provider. If unset, defaults to the Google OIDC IdP. - class Instance - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - - # HostConfig has different instance endpoints. - # @!attribute [r] html - # @return [::String] - # Output only. HTML hostname. - # @!attribute [r] api - # @return [::String] - # Output only. API hostname. - # @!attribute [r] git_http - # @return [::String] - # Output only. Git HTTP hostname. - # @!attribute [r] git_ssh - # @return [::String] - # Output only. Git SSH hostname. - class HostConfig - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # PrivateConfig includes settings for private instance. - # @!attribute [rw] is_private - # @return [::Boolean] - # Required. Immutable. Indicate if it's private instance. - # @!attribute [rw] ca_pool - # @return [::String] - # Optional. Immutable. CA pool resource, resource must in the format of - # `projects/{project}/locations/{location}/caPools/{ca_pool}`. - # @!attribute [r] http_service_attachment - # @return [::String] - # Output only. Service Attachment for HTTP, resource is in the format of - # `projects/{project}/regions/{region}/serviceAttachments/{service_attachment}`. - # @!attribute [r] ssh_service_attachment - # @return [::String] - # Output only. Service Attachment for SSH, resource is in the format of - # `projects/{project}/regions/{region}/serviceAttachments/{service_attachment}`. - # @!attribute [rw] psc_allowed_projects - # @return [::Array<::String>] - # Optional. Additional allowed projects for setting up PSC connections. - # Instance host project is automatically allowed and does not need to be - # included in this list. - class PrivateConfig - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # WorkforceIdentityFederationConfig allows this instance to support users - # from external identity providers. - # @!attribute [rw] enabled - # @return [::Boolean] - # Optional. Immutable. Whether Workforce Identity Federation is enabled. - class WorkforceIdentityFederationConfig - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # @!attribute [rw] key - # @return [::String] - # @!attribute [rw] value - # @return [::String] - class LabelsEntry - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Secure Source Manager instance state. - module State - # Not set. This should only be the case for incoming requests. - STATE_UNSPECIFIED = 0 - - # Instance is being created. - CREATING = 1 - - # Instance is ready. - ACTIVE = 2 - - # Instance is being deleted. - DELETING = 3 - - # Instance is paused. - PAUSED = 4 - - # Instance is unknown, we are not sure if it's functioning. - UNKNOWN = 6 - end - - # Provides information about the current instance state. - module StateNote - # STATE_NOTE_UNSPECIFIED as the first value of State. - STATE_NOTE_UNSPECIFIED = 0 - - # CMEK access is unavailable. - PAUSED_CMEK_UNAVAILABLE = 1 - - # INSTANCE_RESUMING indicates that the instance was previously paused - # and is under the process of being brought back. - INSTANCE_RESUMING = 2 - end - end - - # Metadata of a Secure Source Manager repository. - # @!attribute [rw] name - # @return [::String] - # Optional. A unique identifier for a repository. The name should be of the - # format: - # `projects/{project}/locations/{location_id}/repositories/{repository_id}` - # @!attribute [rw] description - # @return [::String] - # Optional. Description of the repository, which cannot exceed 500 - # characters. - # @!attribute [rw] instance - # @return [::String] - # Optional. The name of the instance in which the repository is hosted, - # formatted as - # `projects/{project_number}/locations/{location_id}/instances/{instance_id}` - # When creating repository via securesourcemanager.googleapis.com, this field - # is used as input. When creating repository via *.sourcemanager.dev, this - # field is output only. - # @!attribute [r] uid - # @return [::String] - # Output only. Unique identifier of the repository. - # @!attribute [r] create_time - # @return [::Google::Protobuf::Timestamp] - # Output only. Create timestamp. - # @!attribute [r] update_time - # @return [::Google::Protobuf::Timestamp] - # Output only. Update timestamp. - # @!attribute [rw] etag - # @return [::String] - # Optional. This checksum is computed by the server based on the value of - # other fields, and may be sent on update and delete requests to ensure the - # client has an up-to-date value before proceeding. - # @!attribute [r] uris - # @return [::Google::Cloud::SecureSourceManager::V1::Repository::URIs] - # Output only. URIs for the repository. - # @!attribute [rw] initial_config - # @return [::Google::Cloud::SecureSourceManager::V1::Repository::InitialConfig] - # Input only. Initial configurations for the repository. - class Repository - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - - # URIs for the repository. - # @!attribute [r] html - # @return [::String] - # Output only. HTML is the URI for user to view the repository in a - # browser. - # @!attribute [r] git_https - # @return [::String] - # Output only. git_https is the git HTTPS URI for git operations. - # @!attribute [r] api - # @return [::String] - # Output only. API is the URI for API access. - class URIs - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Repository initialization configuration. - # @!attribute [rw] default_branch - # @return [::String] - # Default branch name of the repository. - # @!attribute [rw] gitignores - # @return [::Array<::String>] - # List of gitignore template names user can choose from. - # Valid values: actionscript, ada, agda, android, - # anjuta, ansible, appcelerator-titanium, app-engine, archives, - # arch-linux-packages, atmel-studio, autotools, backup, bazaar, bazel, - # bitrix, bricx-cc, c, cake-php, calabash, cf-wheels, chef-cookbook, - # clojure, cloud9, c-make, code-igniter, code-kit, code-sniffer, - # common-lisp, composer, concrete5, coq, cordova, cpp, craft-cms, cuda, - # cvs, d, dart, dart-editor, delphi, diff, dm, dreamweaver, dropbox, - # drupal, drupal-7, eagle, eclipse, eiffel-studio, elisp, elixir, elm, - # emacs, ensime, epi-server, erlang, esp-idf, espresso, exercism, - # expression-engine, ext-js, fancy, finale, flex-builder, force-dot-com, - # fortran, fuel-php, gcov, git-book, gnome-shell-extension, go, godot, gpg, - # gradle, grails, gwt, haskell, hugo, iar-ewarm, idris, igor-pro, images, - # infor-cms, java, jboss, jboss-4, jboss-6, jdeveloper, jekyll, - # jenkins-home, jenv, jet-brains, jigsaw, joomla, julia, jupyter-notebooks, - # kate, kdevelop4, kentico, ki-cad, kohana, kotlin, lab-view, laravel, - # lazarus, leiningen, lemon-stand, libre-office, lilypond, linux, lithium, - # logtalk, lua, lyx, mac-os, magento, magento-1, magento-2, matlab, maven, - # mercurial, mercury, metals, meta-programming-system, meteor, - # microsoft-office, model-sim, momentics, mono-develop, nanoc, net-beans, - # nikola, nim, ninja, node, notepad-pp, nwjs, objective--c, ocaml, octave, - # opa, open-cart, openssl, oracle-forms, otto, packer, patch, perl, perl6, - # phalcon, phoenix, pimcore, play-framework, plone, prestashop, processing, - # psoc-creator, puppet, pure-script, putty, python, qooxdoo, qt, r, racket, - # rails, raku, red, redcar, redis, rhodes-rhomobile, ros, ruby, rust, sam, - # sass, sbt, scala, scheme, scons, scrivener, sdcc, seam-gen, sketch-up, - # slick-edit, smalltalk, snap, splunk, stata, stella, sublime-text, - # sugar-crm, svn, swift, symfony, symphony-cms, synopsys-vcs, tags, - # terraform, tex, text-mate, textpattern, think-php, tortoise-git, - # turbo-gears-2, typo3, umbraco, unity, unreal-engine, vagrant, vim, - # virtual-env, virtuoso, visual-studio, visual-studio-code, vue, vvvv, waf, - # web-methods, windows, word-press, xcode, xilinx, xilinx-ise, xojo, - # yeoman, yii, zend-framework, zephir. - # @!attribute [rw] license - # @return [::String] - # License template name user can choose from. - # Valid values: license-0bsd, license-389-exception, aal, abstyles, - # adobe-2006, adobe-glyph, adsl, afl-1-1, afl-1-2, afl-2-0, afl-2-1, - # afl-3-0, afmparse, agpl-1-0, agpl-1-0-only, agpl-1-0-or-later, - # agpl-3-0-only, agpl-3-0-or-later, aladdin, amdplpa, aml, ampas, antlr-pd, - # antlr-pd-fallback, apache-1-0, apache-1-1, apache-2-0, apafml, apl-1-0, - # apsl-1-0, apsl-1-1, apsl-1-2, apsl-2-0, artistic-1-0, artistic-1-0-cl8, - # artistic-1-0-perl, artistic-2-0, autoconf-exception-2-0, - # autoconf-exception-3-0, bahyph, barr, beerware, bison-exception-2-2, - # bittorrent-1-0, bittorrent-1-1, blessing, blueoak-1-0-0, - # bootloader-exception, borceux, bsd-1-clause, bsd-2-clause, - # bsd-2-clause-freebsd, bsd-2-clause-netbsd, bsd-2-clause-patent, - # bsd-2-clause-views, bsd-3-clause, bsd-3-clause-attribution, - # bsd-3-clause-clear, bsd-3-clause-lbnl, bsd-3-clause-modification, - # bsd-3-clause-no-nuclear-license, bsd-3-clause-no-nuclear-license-2014, - # bsd-3-clause-no-nuclear-warranty, bsd-3-clause-open-mpi, bsd-4-clause, - # bsd-4-clause-shortened, bsd-4-clause-uc, bsd-protection, bsd-source-code, - # bsl-1-0, busl-1-1, cal-1-0, cal-1-0-combined-work-exception, caldera, - # catosl-1-1, cc0-1-0, cc-by-1-0, cc-by-2-0, cc-by-3-0, cc-by-3-0-at, - # cc-by-3-0-us, cc-by-4-0, cc-by-nc-1-0, cc-by-nc-2-0, cc-by-nc-3-0, - # cc-by-nc-4-0, cc-by-nc-nd-1-0, cc-by-nc-nd-2-0, cc-by-nc-nd-3-0, - # cc-by-nc-nd-3-0-igo, cc-by-nc-nd-4-0, cc-by-nc-sa-1-0, cc-by-nc-sa-2-0, - # cc-by-nc-sa-3-0, cc-by-nc-sa-4-0, cc-by-nd-1-0, cc-by-nd-2-0, - # cc-by-nd-3-0, cc-by-nd-4-0, cc-by-sa-1-0, cc-by-sa-2-0, cc-by-sa-2-0-uk, - # cc-by-sa-2-1-jp, cc-by-sa-3-0, cc-by-sa-3-0-at, cc-by-sa-4-0, cc-pddc, - # cddl-1-0, cddl-1-1, cdla-permissive-1-0, cdla-sharing-1-0, cecill-1-0, - # cecill-1-1, cecill-2-0, cecill-2-1, cecill-b, cecill-c, cern-ohl-1-1, - # cern-ohl-1-2, cern-ohl-p-2-0, cern-ohl-s-2-0, cern-ohl-w-2-0, clartistic, - # classpath-exception-2-0, clisp-exception-2-0, cnri-jython, cnri-python, - # cnri-python-gpl-compatible, condor-1-1, copyleft-next-0-3-0, - # copyleft-next-0-3-1, cpal-1-0, cpl-1-0, cpol-1-02, crossword, - # crystal-stacker, cua-opl-1-0, cube, c-uda-1-0, curl, d-fsl-1-0, diffmark, - # digirule-foss-exception, doc, dotseqn, drl-1-0, dsdp, dvipdfm, ecl-1-0, - # ecl-2-0, ecos-exception-2-0, efl-1-0, efl-2-0, egenix, entessa, epics, - # epl-1-0, epl-2-0, erlpl-1-1, etalab-2-0, eu-datagrid, eupl-1-0, eupl-1-1, - # eupl-1-2, eurosym, fair, fawkes-runtime-exception, fltk-exception, - # font-exception-2-0, frameworx-1-0, freebsd-doc, freeimage, - # freertos-exception-2-0, fsfap, fsful, fsfullr, ftl, gcc-exception-2-0, - # gcc-exception-3-1, gd, gfdl-1-1-invariants-only, - # gfdl-1-1-invariants-or-later, gfdl-1-1-no-invariants-only, - # gfdl-1-1-no-invariants-or-later, gfdl-1-1-only, gfdl-1-1-or-later, - # gfdl-1-2-invariants-only, gfdl-1-2-invariants-or-later, - # gfdl-1-2-no-invariants-only, gfdl-1-2-no-invariants-or-later, - # gfdl-1-2-only, gfdl-1-2-or-later, gfdl-1-3-invariants-only, - # gfdl-1-3-invariants-or-later, gfdl-1-3-no-invariants-only, - # gfdl-1-3-no-invariants-or-later, gfdl-1-3-only, gfdl-1-3-or-later, - # giftware, gl2ps, glide, glulxe, glwtpl, gnu-javamail-exception, gnuplot, - # gpl-1-0-only, gpl-1-0-or-later, gpl-2-0-only, gpl-2-0-or-later, - # gpl-3-0-linking-exception, gpl-3-0-linking-source-exception, - # gpl-3-0-only, gpl-3-0-or-later, gpl-cc-1-0, gsoap-1-3b, haskell-report, - # hippocratic-2-1, hpnd, hpnd-sell-variant, htmltidy, - # i2p-gpl-java-exception, ibm-pibs, icu, ijg, image-magick, imatix, imlib2, - # info-zip, intel, intel-acpi, interbase-1-0, ipa, ipl-1-0, isc, - # jasper-2-0, jpnic, json, lal-1-2, lal-1-3, latex2e, leptonica, - # lgpl-2-0-only, lgpl-2-0-or-later, lgpl-2-1-only, lgpl-2-1-or-later, - # lgpl-3-0-linking-exception, lgpl-3-0-only, lgpl-3-0-or-later, lgpllr, - # libpng, libpng-2-0, libselinux-1-0, libtiff, libtool-exception, - # liliq-p-1-1, liliq-r-1-1, liliq-rplus-1-1, linux-openib, - # linux-syscall-note, llvm-exception, lpl-1-0, lpl-1-02, lppl-1-0, - # lppl-1-1, lppl-1-2, lppl-1-3a, lppl-1-3c, lzma-exception, make-index, - # mif-exception, miros, mit, mit-0, mit-advertising, mit-cmu, mit-enna, - # mit-feh, mit-modern-variant, mitnfa, mit-open-group, motosoto, mpich2, - # mpl-1-0, mpl-1-1, mpl-2-0, mpl-2-0-no-copyleft-exception, ms-pl, ms-rl, - # mtll, mulanpsl-1-0, mulanpsl-2-0, multics, mup, naist-2003, nasa-1-3, - # naumen, nbpl-1-0, ncgl-uk-2-0, ncsa, netcdf, net-snmp, newsletr, ngpl, - # nist-pd, nist-pd-fallback, nlod-1-0, nlpl, nokia, nokia-qt-exception-1-1, - # nosl, noweb, npl-1-0, npl-1-1, nposl-3-0, nrl, ntp, ntp-0, - # ocaml-lgpl-linking-exception, occt-exception-1-0, occt-pl, oclc-2-0, - # odbl-1-0, odc-by-1-0, ofl-1-0, ofl-1-0-no-rfn, ofl-1-0-rfn, ofl-1-1, - # ofl-1-1-no-rfn, ofl-1-1-rfn, ogc-1-0, ogdl-taiwan-1-0, ogl-canada-2-0, - # ogl-uk-1-0, ogl-uk-2-0, ogl-uk-3-0, ogtsl, oldap-1-1, oldap-1-2, - # oldap-1-3, oldap-1-4, oldap-2-0, oldap-2-0-1, oldap-2-1, oldap-2-2, - # oldap-2-2-1, oldap-2-2-2, oldap-2-3, oldap-2-4, oldap-2-7, oml, - # openjdk-assembly-exception-1-0, openssl, openvpn-openssl-exception, - # opl-1-0, oset-pl-2-1, osl-1-0, osl-1-1, osl-2-0, osl-2-1, osl-3-0, - # o-uda-1-0, parity-6-0-0, parity-7-0-0, pddl-1-0, php-3-0, php-3-01, - # plexus, polyform-noncommercial-1-0-0, polyform-small-business-1-0-0, - # postgresql, psf-2-0, psfrag, ps-or-pdf-font-exception-20170817, psutils, - # python-2-0, qhull, qpl-1-0, qt-gpl-exception-1-0, qt-lgpl-exception-1-1, - # qwt-exception-1-0, rdisc, rhecos-1-1, rpl-1-1, rpsl-1-0, rsa-md, rscpl, - # ruby, saxpath, sax-pd, scea, sendmail, sendmail-8-23, sgi-b-1-0, - # sgi-b-1-1, sgi-b-2-0, shl-0-51, shl-2-0, shl-2-1, simpl-2-0, sissl, - # sissl-1-2, sleepycat, smlnj, smppl, snia, spencer-86, spencer-94, - # spencer-99, spl-1-0, ssh-openssh, ssh-short, sspl-1-0, sugarcrm-1-1-3, - # swift-exception, swl, tapr-ohl-1-0, tcl, tcp-wrappers, tmate, torque-1-1, - # tosl, tu-berlin-1-0, tu-berlin-2-0, u-boot-exception-2-0, ucl-1-0, - # unicode-dfs-2015, unicode-dfs-2016, unicode-tou, - # universal-foss-exception-1-0, unlicense, upl-1-0, vim, vostrom, vsl-1-0, - # w3c, w3c-19980720, w3c-20150513, watcom-1-0, wsuipa, wtfpl, - # wxwindows-exception-3-1, x11, xerox, xfree86-1-1, xinetd, xnet, xpp, - # xskat, ypl-1-0, ypl-1-1, zed, zend-2-0, zimbra-1-3, zimbra-1-4, zlib, - # zlib-acknowledgement, zpl-1-1, zpl-2-0, zpl-2-1. - # @!attribute [rw] readme - # @return [::String] - # README template name. - # Valid template name(s) are: default. - class InitialConfig - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - end - - # Metadata of a Secure Source Manager Hook. - # @!attribute [rw] name - # @return [::String] - # Identifier. A unique identifier for a Hook. The name should be of the - # format: - # `projects/{project}/locations/{location_id}/repositories/{repository_id}/hooks/{hook_id}` - # @!attribute [rw] target_uri - # @return [::String] - # Required. The target URI to which the payloads will be delivered. - # @!attribute [rw] disabled - # @return [::Boolean] - # Optional. Determines if the hook disabled or not. - # Set to true to stop sending traffic. - # @!attribute [rw] events - # @return [::Array<::Google::Cloud::SecureSourceManager::V1::Hook::HookEventType>] - # Optional. The events that trigger hook on. - # @!attribute [r] create_time - # @return [::Google::Protobuf::Timestamp] - # Output only. Create timestamp. - # @!attribute [r] update_time - # @return [::Google::Protobuf::Timestamp] - # Output only. Update timestamp. - # @!attribute [r] uid - # @return [::String] - # Output only. Unique identifier of the hook. - # @!attribute [rw] push_option - # @return [::Google::Cloud::SecureSourceManager::V1::Hook::PushOption] - # Optional. The trigger option for push events. - # @!attribute [rw] sensitive_query_string - # @return [::String] - # Optional. The sensitive query string to be appended to the target URI. - class Hook - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - - # @!attribute [rw] branch_filter - # @return [::String] - # Optional. Trigger hook for matching branches only. - # Specified as glob pattern. If empty or *, events for all branches are - # reported. Examples: main, \\{main,release*}. - # See https://pkg.go.dev/github.com/gobwas/glob documentation. - class PushOption - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - module HookEventType - # Unspecified. - UNSPECIFIED = 0 - - # Push events are triggered when pushing to the repository. - PUSH = 1 - - # Pull request events are triggered when a pull request is opened, closed, - # reopened, or edited. - PULL_REQUEST = 2 - end - end - - # Metadata of a BranchRule. BranchRule is the protection rule to enforce - # pre-defined rules on designated branches within a repository. - # @!attribute [rw] name - # @return [::String] - # Optional. A unique identifier for a BranchRule. The name should be of the - # format: - # `projects/{project}/locations/{location}/repositories/{repository}/branchRules/{branch_rule}` - # @!attribute [r] uid - # @return [::String] - # Output only. Unique identifier of the repository. - # @!attribute [r] create_time - # @return [::Google::Protobuf::Timestamp] - # Output only. Create timestamp. - # @!attribute [r] update_time - # @return [::Google::Protobuf::Timestamp] - # Output only. Update timestamp. - # @!attribute [rw] annotations - # @return [::Google::Protobuf::Map{::String => ::String}] - # Optional. User annotations. These attributes can only be set and used by - # the user. See https://google.aip.dev/128#annotations for more details such - # as format and size limitations. - # @!attribute [rw] etag - # @return [::String] - # Optional. This checksum is computed by the server based on the value of - # other fields, and may be sent on update and delete requests to ensure the - # client has an up-to-date value before proceeding. - # @!attribute [rw] include_pattern - # @return [::String] - # Optional. The pattern of the branch that can match to this BranchRule. - # Specified as regex. - # .* for all branches. Examples: main, (main|release.*). - # Current MVP phase only support `.*` for wildcard. - # @!attribute [rw] disabled - # @return [::Boolean] - # Optional. Determines if the branch rule is disabled or not. - # @!attribute [rw] require_pull_request - # @return [::Boolean] - # Optional. Determines if the branch rule requires a pull request or not. - # @!attribute [rw] minimum_reviews_count - # @return [::Integer] - # Optional. The minimum number of reviews required for the branch rule to be - # matched. - # @!attribute [rw] minimum_approvals_count - # @return [::Integer] - # Optional. The minimum number of approvals required for the branch rule to - # be matched. - # @!attribute [rw] require_comments_resolved - # @return [::Boolean] - # Optional. Determines if require comments resolved before merging to the - # branch. - # @!attribute [rw] allow_stale_reviews - # @return [::Boolean] - # Optional. Determines if allow stale reviews or approvals before merging to - # the branch. - # @!attribute [rw] require_linear_history - # @return [::Boolean] - # Optional. Determines if require linear history before merging to the - # branch. - # @!attribute [rw] required_status_checks - # @return [::Array<::Google::Cloud::SecureSourceManager::V1::BranchRule::Check>] - # Optional. List of required status checks before merging to the branch. - class BranchRule - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - - # Check is a type for status check. - # @!attribute [rw] context - # @return [::String] - # Required. The context of the check. - class Check - 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 - end - - # Metadata of a PullRequest. PullRequest is the request - # from a user to merge a branch (head) into another branch (base). - # @!attribute [r] name - # @return [::String] - # Output only. A unique identifier for a PullRequest. The number appended at - # the end is generated by the server. Format: - # `projects/{project}/locations/{location}/repositories/{repository}/pullRequests/{pull_request_id}` - # @!attribute [rw] title - # @return [::String] - # Required. The pull request title. - # @!attribute [rw] body - # @return [::String] - # Optional. The pull request body. Provides a detailed description of the - # changes. - # @!attribute [rw] base - # @return [::Google::Cloud::SecureSourceManager::V1::PullRequest::Branch] - # Required. The branch to merge changes in. - # @!attribute [rw] head - # @return [::Google::Cloud::SecureSourceManager::V1::PullRequest::Branch] - # Immutable. The branch containing the changes to be merged. - # @!attribute [r] state - # @return [::Google::Cloud::SecureSourceManager::V1::PullRequest::State] - # Output only. State of the pull request (open, closed or merged). - # @!attribute [r] create_time - # @return [::Google::Protobuf::Timestamp] - # Output only. Creation timestamp. - # @!attribute [r] update_time - # @return [::Google::Protobuf::Timestamp] - # Output only. Last updated timestamp. - # @!attribute [r] close_time - # @return [::Google::Protobuf::Timestamp] - # Output only. Close timestamp (if closed or merged). Cleared when pull - # request is re-opened. - class PullRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - - # Branch represents a branch involved in a pull request. - # @!attribute [rw] ref - # @return [::String] - # Required. Name of the branch. - # @!attribute [r] sha - # @return [::String] - # Output only. The commit at the tip of the branch. - class Branch - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # State of the pull request. - module State - # Unspecified. - STATE_UNSPECIFIED = 0 - - # An open pull request. - OPEN = 1 - - # A closed pull request. - CLOSED = 2 - - # A merged pull request. - MERGED = 3 - end - end - - # Metadata of a FileDiff. FileDiff represents a single file diff in a pull - # request. - # @!attribute [r] name - # @return [::String] - # Output only. The name of the file. - # @!attribute [r] action - # @return [::Google::Cloud::SecureSourceManager::V1::FileDiff::Action] - # Output only. The action taken on the file (eg. added, modified, deleted). - # @!attribute [r] sha - # @return [::String] - # Output only. The commit pointing to the file changes. - # @!attribute [r] patch - # @return [::String] - # Output only. The git patch containing the file changes. - class FileDiff - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - - # Action taken on the file. - module Action - # Unspecified. - ACTION_UNSPECIFIED = 0 - - # The file was added. - ADDED = 1 - - # The file was modified. - MODIFIED = 2 - - # The file was deleted. - DELETED = 3 - end - end - - # Metadata of an Issue. - # @!attribute [rw] name - # @return [::String] - # Identifier. Unique identifier for an issue. The issue id is generated by - # the server. Format: - # `projects/{project}/locations/{location}/repositories/{repository}/issues/{issue_id}` - # @!attribute [rw] title - # @return [::String] - # Required. Issue title. - # @!attribute [rw] body - # @return [::String] - # Optional. Issue body. Provides a detailed description of the issue. - # @!attribute [r] state - # @return [::Google::Cloud::SecureSourceManager::V1::Issue::State] - # Output only. State of the issue. - # @!attribute [r] create_time - # @return [::Google::Protobuf::Timestamp] - # Output only. Creation timestamp. - # @!attribute [r] update_time - # @return [::Google::Protobuf::Timestamp] - # Output only. Last updated timestamp. - # @!attribute [r] close_time - # @return [::Google::Protobuf::Timestamp] - # Output only. Close timestamp (if closed). Cleared when is re-opened. - # @!attribute [rw] etag - # @return [::String] - # Optional. This checksum is computed by the server based on the value of - # other fields, and may be sent on update and delete requests to ensure the - # client has an up-to-date value before proceeding. - class Issue - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - - # Possible states of an issue. - module State - # Unspecified. - STATE_UNSPECIFIED = 0 - - # An open issue. - OPEN = 1 - - # A closed issue. - CLOSED = 2 - end - end - - # IssueComment represents a comment on an issue. - # @!attribute [rw] name - # @return [::String] - # Identifier. Unique identifier for an issue comment. The comment id is - # generated by the server. Format: - # `projects/{project}/locations/{location}/repositories/{repository}/issues/{issue}/issueComments/{comment_id}` - # @!attribute [rw] body - # @return [::String] - # Required. The comment body. - # @!attribute [r] create_time - # @return [::Google::Protobuf::Timestamp] - # Output only. Creation timestamp. - # @!attribute [r] update_time - # @return [::Google::Protobuf::Timestamp] - # Output only. Last updated timestamp. - class IssueComment - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # PullRequestComment represents a comment on a pull request. - # @!attribute [rw] name - # @return [::String] - # Identifier. Unique identifier for the pull request comment. The comment id - # is generated by the server. Format: - # `projects/{project}/locations/{location}/repositories/{repository}/pullRequests/{pull_request}/pullRequestComments/{comment_id}` - # @!attribute [r] create_time - # @return [::Google::Protobuf::Timestamp] - # Output only. Creation timestamp. - # @!attribute [r] update_time - # @return [::Google::Protobuf::Timestamp] - # Output only. Last updated timestamp. - # @!attribute [rw] review - # @return [::Google::Cloud::SecureSourceManager::V1::PullRequestComment::Review] - # Optional. The review summary comment. - # - # Note: The following fields are mutually exclusive: `review`, `comment`, `code`. If a field in that set is populated, all other fields in the set will automatically be cleared. - # @!attribute [rw] comment - # @return [::Google::Cloud::SecureSourceManager::V1::PullRequestComment::Comment] - # Optional. The general pull request comment. - # - # Note: The following fields are mutually exclusive: `comment`, `review`, `code`. If a field in that set is populated, all other fields in the set will automatically be cleared. - # @!attribute [rw] code - # @return [::Google::Cloud::SecureSourceManager::V1::PullRequestComment::Code] - # Optional. The comment on a code line. - # - # Note: The following fields are mutually exclusive: `code`, `review`, `comment`. If a field in that set is populated, all other fields in the set will automatically be cleared. - class PullRequestComment - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - - # The review summary comment. - # @!attribute [rw] action_type - # @return [::Google::Cloud::SecureSourceManager::V1::PullRequestComment::Review::ActionType] - # Required. The review action type. - # @!attribute [rw] body - # @return [::String] - # Optional. The comment body. - # @!attribute [r] effective_commit_sha - # @return [::String] - # Output only. The effective commit sha this review is pointing to. - class Review - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - - # The review action type. - module ActionType - # Unspecified. - ACTION_TYPE_UNSPECIFIED = 0 - - # A general review comment. - COMMENT = 1 - - # Change required from this review. - CHANGE_REQUESTED = 2 - - # Change approved from this review. - APPROVED = 3 - end - end - - # The general pull request comment. - # @!attribute [rw] body - # @return [::String] - # Required. The comment body. - class Comment - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # The comment on a code line. - # @!attribute [rw] body - # @return [::String] - # Required. The comment body. - # @!attribute [rw] reply - # @return [::String] - # Optional. Input only. The PullRequestComment resource name that this - # comment is replying to. - # @!attribute [rw] position - # @return [::Google::Cloud::SecureSourceManager::V1::PullRequestComment::Position] - # Optional. The position of the comment. - # @!attribute [r] effective_root_comment - # @return [::String] - # Output only. The root comment of the conversation, derived from the reply - # field. - # @!attribute [r] resolved - # @return [::Boolean] - # Output only. Boolean indicator if the comment is resolved. - # @!attribute [r] effective_commit_sha - # @return [::String] - # Output only. The effective commit sha this code comment is pointing to. - class Code - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # The position of the code comment. - # @!attribute [rw] path - # @return [::String] - # Required. The path of the file. - # @!attribute [rw] line - # @return [::Integer] - # Required. The line number of the comment. Positive value means it's on - # the new side of the diff, negative value means it's on the old side. - class Position - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - end - - # ListInstancesRequest is the request to list instances. - # @!attribute [rw] parent - # @return [::String] - # Required. Parent value for ListInstancesRequest. - # @!attribute [rw] page_size - # @return [::Integer] - # Requested page size. Server may return fewer items than requested. - # If unspecified, server will pick an appropriate default. - # @!attribute [rw] page_token - # @return [::String] - # A token identifying a page of results the server should return. - # @!attribute [rw] filter - # @return [::String] - # Filter for filtering results. - # @!attribute [rw] order_by - # @return [::String] - # Hint for how to order the results. - class ListInstancesRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # @!attribute [rw] instances - # @return [::Array<::Google::Cloud::SecureSourceManager::V1::Instance>] - # The list of instances. - # @!attribute [rw] next_page_token - # @return [::String] - # A token identifying a page of results the server should return. - # @!attribute [rw] unreachable - # @return [::Array<::String>] - # Locations that could not be reached. - class ListInstancesResponse - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # GetInstanceRequest is the request for getting an instance. - # @!attribute [rw] name - # @return [::String] - # Required. Name of the resource. - class GetInstanceRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # CreateInstanceRequest is the request for creating an instance. - # @!attribute [rw] parent - # @return [::String] - # Required. Value for parent. - # @!attribute [rw] instance_id - # @return [::String] - # Required. ID of the instance to be created. - # @!attribute [rw] instance - # @return [::Google::Cloud::SecureSourceManager::V1::Instance] - # Required. The resource being created. - # @!attribute [rw] request_id - # @return [::String] - # Optional. An optional request ID to identify requests. Specify a unique - # request ID so that if you must retry your request, the server will know to - # ignore the request if it has already been completed. The server will - # guarantee that for at least 60 minutes since the first request. - # - # For example, consider a situation where you make an initial request and - # the request times out. If you make the request again with the same request - # ID, the server can check if original operation with the same request ID - # was received, and if so, will ignore the second request. This prevents - # clients from accidentally creating duplicate commitments. - # - # The request ID must be a valid UUID with the exception that zero UUID is - # not supported (00000000-0000-0000-0000-000000000000). - class CreateInstanceRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # DeleteInstanceRequest is the request for deleting an instance. - # @!attribute [rw] name - # @return [::String] - # Required. Name of the resource. - # @!attribute [rw] request_id - # @return [::String] - # Optional. An optional request ID to identify requests. Specify a unique - # request ID so that if you must retry your request, the server will know to - # ignore the request if it has already been completed. The server will - # guarantee that for at least 60 minutes after the first request. - # - # For example, consider a situation where you make an initial request and - # the request times out. If you make the request again with the same request - # ID, the server can check if original operation with the same request ID - # was received, and if so, will ignore the second request. This prevents - # clients from accidentally creating duplicate commitments. - # - # The request ID must be a valid UUID with the exception that zero UUID is - # not supported (00000000-0000-0000-0000-000000000000). - class DeleteInstanceRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Represents the metadata of the long-running operation. - # @!attribute [r] create_time - # @return [::Google::Protobuf::Timestamp] - # Output only. The time the operation was created. - # @!attribute [r] end_time - # @return [::Google::Protobuf::Timestamp] - # Output only. The time the operation finished running. - # @!attribute [r] target - # @return [::String] - # Output only. Server-defined resource path for the target of the operation. - # @!attribute [r] verb - # @return [::String] - # Output only. Name of the verb executed by the operation. - # @!attribute [r] status_message - # @return [::String] - # Output only. Human-readable status of the operation, if any. - # @!attribute [r] requested_cancellation - # @return [::Boolean] - # Output only. Identifies whether the user has requested cancellation - # of the operation. Operations that have successfully been cancelled - # have {::Google::Longrunning::Operation#error 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 - - # ListRepositoriesRequest is request to list repositories. - # @!attribute [rw] parent - # @return [::String] - # Required. Parent value for ListRepositoriesRequest. - # @!attribute [rw] page_size - # @return [::Integer] - # Optional. Requested page size. Server may return fewer items than - # requested. If unspecified, server will pick an appropriate default. - # @!attribute [rw] page_token - # @return [::String] - # A token identifying a page of results the server should return. - # @!attribute [rw] filter - # @return [::String] - # Optional. Filter results. - # @!attribute [rw] instance - # @return [::String] - # Optional. The name of the instance in which the repository is hosted, - # formatted as - # `projects/{project_number}/locations/{location_id}/instances/{instance_id}`. - # When listing repositories via securesourcemanager.googleapis.com, this - # field is required. When listing repositories via *.sourcemanager.dev, this - # field is ignored. - class ListRepositoriesRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # @!attribute [rw] repositories - # @return [::Array<::Google::Cloud::SecureSourceManager::V1::Repository>] - # The list of repositories. - # @!attribute [rw] next_page_token - # @return [::String] - # A token identifying a page of results the server should return. - class ListRepositoriesResponse - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # GetRepositoryRequest is the request for getting a repository. - # @!attribute [rw] name - # @return [::String] - # Required. Name of the repository to retrieve. - # The format is - # `projects/{project_number}/locations/{location_id}/repositories/{repository_id}`. - class GetRepositoryRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # CreateRepositoryRequest is the request for creating a repository. - # @!attribute [rw] parent - # @return [::String] - # Required. The project in which to create the repository. Values are of the - # form `projects/{project_number}/locations/{location_id}` - # @!attribute [rw] repository - # @return [::Google::Cloud::SecureSourceManager::V1::Repository] - # Required. The resource being created. - # @!attribute [rw] repository_id - # @return [::String] - # Required. The ID to use for the repository, which will become the final - # component of the repository's resource name. This value should be 4-63 - # characters, and valid characters are /[a-z][0-9]-/. - class CreateRepositoryRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # UpdateRepositoryRequest is the request to update a repository. - # @!attribute [rw] update_mask - # @return [::Google::Protobuf::FieldMask] - # Optional. Field mask is used to specify the fields to be overwritten in the - # repository resource by the update. - # The fields specified in the update_mask are relative to the resource, not - # the full request. A field will be overwritten if it is in the mask. If the - # user does not provide a mask then all fields will be overwritten. - # @!attribute [rw] repository - # @return [::Google::Cloud::SecureSourceManager::V1::Repository] - # Required. The repository being updated. - # @!attribute [rw] validate_only - # @return [::Boolean] - # Optional. False by default. If set to true, the request is validated and - # the user is provided with an expected result, but no actual change is made. - class UpdateRepositoryRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # DeleteRepositoryRequest is the request to delete a repository. - # @!attribute [rw] name - # @return [::String] - # Required. Name of the repository to delete. - # The format is - # `projects/{project_number}/locations/{location_id}/repositories/{repository_id}`. - # @!attribute [rw] allow_missing - # @return [::Boolean] - # Optional. If set to true, and the repository is not found, the request will - # succeed but no action will be taken on the server. - class DeleteRepositoryRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # ListHooksRequest is request to list hooks. - # @!attribute [rw] parent - # @return [::String] - # Required. Parent value for ListHooksRequest. - # @!attribute [rw] page_size - # @return [::Integer] - # Optional. Requested page size. Server may return fewer items than - # requested. If unspecified, server will pick an appropriate default. - # @!attribute [rw] page_token - # @return [::String] - # Optional. A token identifying a page of results the server should return. - class ListHooksRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # ListHooksResponse is response to list hooks. - # @!attribute [rw] hooks - # @return [::Array<::Google::Cloud::SecureSourceManager::V1::Hook>] - # The list of hooks. - # @!attribute [rw] next_page_token - # @return [::String] - # A token identifying a page of results the server should return. - class ListHooksResponse - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # GetHookRequest is the request for getting a hook. - # @!attribute [rw] name - # @return [::String] - # Required. Name of the hook to retrieve. - # The format is - # `projects/{project_number}/locations/{location_id}/repositories/{repository_id}/hooks/{hook_id}`. - class GetHookRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # CreateHookRequest is the request for creating a hook. - # @!attribute [rw] parent - # @return [::String] - # Required. The repository in which to create the hook. Values are of the - # form - # `projects/{project_number}/locations/{location_id}/repositories/{repository_id}` - # @!attribute [rw] hook - # @return [::Google::Cloud::SecureSourceManager::V1::Hook] - # Required. The resource being created. - # @!attribute [rw] hook_id - # @return [::String] - # Required. The ID to use for the hook, which will become the final component - # of the hook's resource name. This value restricts to lower-case letters, - # numbers, and hyphen, with the first character a letter, the last a letter - # or a number, and a 63 character maximum. - class CreateHookRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # UpdateHookRequest is the request to update a hook. - # @!attribute [rw] update_mask - # @return [::Google::Protobuf::FieldMask] - # Required. Field mask is used to specify the fields to be overwritten in the - # hook resource by the update. - # The fields specified in the update_mask are relative to the resource, not - # the full request. A field will be overwritten if it is in the mask. - # The special value "*" means full replacement. - # @!attribute [rw] hook - # @return [::Google::Cloud::SecureSourceManager::V1::Hook] - # Required. The hook being updated. - class UpdateHookRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # DeleteHookRequest is the request to delete a hook. - # @!attribute [rw] name - # @return [::String] - # Required. Name of the hook to delete. - # The format is - # `projects/{project_number}/locations/{location_id}/repositories/{repository_id}/hooks/{hook_id}`. - class DeleteHookRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # GetBranchRuleRequest is the request for getting a branch rule. - # @!attribute [rw] name - # @return [::String] - # Required. Name of the repository to retrieve. - # The format is - # `projects/{project}/locations/{location}/repositories/{repository}/branchRules/{branch_rule}`. - class GetBranchRuleRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # CreateBranchRuleRequest is the request to create a branch rule. - # @!attribute [rw] parent - # @return [::String] - # @!attribute [rw] branch_rule - # @return [::Google::Cloud::SecureSourceManager::V1::BranchRule] - # @!attribute [rw] branch_rule_id - # @return [::String] - class CreateBranchRuleRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # ListBranchRulesRequest is the request to list branch rules. - # @!attribute [rw] parent - # @return [::String] - # @!attribute [rw] page_size - # @return [::Integer] - # @!attribute [rw] page_token - # @return [::String] - class ListBranchRulesRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # DeleteBranchRuleRequest is the request to delete a branch rule. - # @!attribute [rw] name - # @return [::String] - # @!attribute [rw] allow_missing - # @return [::Boolean] - # Optional. If set to true, and the branch rule is not found, the request - # will succeed but no action will be taken on the server. - class DeleteBranchRuleRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # UpdateBranchRuleRequest is the request to update a branchRule. - # @!attribute [rw] branch_rule - # @return [::Google::Cloud::SecureSourceManager::V1::BranchRule] - # @!attribute [rw] validate_only - # @return [::Boolean] - # Optional. If set, validate the request and preview the review, but do not - # actually post it. (https://google.aip.dev/163, for declarative friendly) - # @!attribute [rw] update_mask - # @return [::Google::Protobuf::FieldMask] - # Required. Field mask is used to specify the fields to be overwritten in the - # branchRule resource by the update. - # The fields specified in the update_mask are relative to the resource, not - # the full request. A field will be overwritten if it is in the mask. - # The special value "*" means full replacement. - class UpdateBranchRuleRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # ListBranchRulesResponse is the response to listing branchRules. - # @!attribute [rw] branch_rules - # @return [::Array<::Google::Cloud::SecureSourceManager::V1::BranchRule>] - # The list of branch rules. - # @!attribute [rw] next_page_token - # @return [::String] - # A token identifying a page of results the server should return. - class ListBranchRulesResponse - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # CreatePullRequestRequest is the request to create a pull request. - # @!attribute [rw] parent - # @return [::String] - # Required. The repository that the pull request is created from. Format: - # `projects/{project_number}/locations/{location_id}/repositories/{repository_id}` - # @!attribute [rw] pull_request - # @return [::Google::Cloud::SecureSourceManager::V1::PullRequest] - # Required. The pull request to create. - class CreatePullRequestRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # GetPullRequestRequest is the request to get a pull request. - # @!attribute [rw] name - # @return [::String] - # Required. Name of the pull request to retrieve. - # The format is - # `projects/{project}/locations/{location}/repositories/{repository}/pullRequests/{pull_request}`. - class GetPullRequestRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # ListPullRequestsRequest is the request to list pull requests. - # @!attribute [rw] parent - # @return [::String] - # Required. The repository in which to list pull requests. Format: - # `projects/{project_number}/locations/{location_id}/repositories/{repository_id}` - # @!attribute [rw] page_size - # @return [::Integer] - # Optional. Requested page size. Server may return fewer items than - # requested. If unspecified, server will pick an appropriate default. - # @!attribute [rw] page_token - # @return [::String] - # Optional. A token identifying a page of results the server should return. - class ListPullRequestsRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # ListPullRequestsResponse is the response to list pull requests. - # @!attribute [rw] pull_requests - # @return [::Array<::Google::Cloud::SecureSourceManager::V1::PullRequest>] - # The list of pull requests. - # @!attribute [rw] next_page_token - # @return [::String] - # A token identifying a page of results the server should return. - class ListPullRequestsResponse - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # UpdatePullRequestRequest is the request to update a pull request. - # @!attribute [rw] pull_request - # @return [::Google::Cloud::SecureSourceManager::V1::PullRequest] - # Required. The pull request to update. - # @!attribute [rw] update_mask - # @return [::Google::Protobuf::FieldMask] - # Optional. Field mask is used to specify the fields to be overwritten in the - # pull request resource by the update. - # The fields specified in the update_mask are relative to the resource, not - # the full request. A field will be overwritten if it is in the mask. - # The special value "*" means full replacement. - class UpdatePullRequestRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # MergePullRequestRequest is the request to merge a pull request. - # @!attribute [rw] name - # @return [::String] - # Required. The pull request to merge. - # Format: - # `projects/{project_number}/locations/{location_id}/repositories/{repository_id}/pullRequests/{pull_request_id}` - class MergePullRequestRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # OpenPullRequestRequest is the request to open a pull request. - # @!attribute [rw] name - # @return [::String] - # Required. The pull request to open. - # Format: - # `projects/{project_number}/locations/{location_id}/repositories/{repository_id}/pullRequests/{pull_request_id}` - class OpenPullRequestRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # ClosePullRequestRequest is the request to close a pull request. - # @!attribute [rw] name - # @return [::String] - # Required. The pull request to close. - # Format: - # `projects/{project_number}/locations/{location_id}/repositories/{repository_id}/pullRequests/{pull_request_id}` - class ClosePullRequestRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # ListPullRequestFileDiffsRequest is the request to list pull request file - # diffs. - # @!attribute [rw] name - # @return [::String] - # Required. The pull request to list file diffs for. - # Format: - # `projects/{project_number}/locations/{location_id}/repositories/{repository_id}/pullRequests/{pull_request_id}` - # @!attribute [rw] page_size - # @return [::Integer] - # Optional. Requested page size. Server may return fewer items than - # requested. If unspecified, server will pick an appropriate default. - # @!attribute [rw] page_token - # @return [::String] - # Optional. A token identifying a page of results the server should return. - class ListPullRequestFileDiffsRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # ListPullRequestFileDiffsResponse is the response containing file diffs - # returned from ListPullRequestFileDiffs. - # @!attribute [rw] file_diffs - # @return [::Array<::Google::Cloud::SecureSourceManager::V1::FileDiff>] - # The list of pull request file diffs. - # @!attribute [rw] next_page_token - # @return [::String] - # A token identifying a page of results the server should return. - class ListPullRequestFileDiffsResponse - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # The request to create an issue. - # @!attribute [rw] parent - # @return [::String] - # Required. The repository in which to create the issue. Format: - # `projects/{project_number}/locations/{location_id}/repositories/{repository_id}` - # @!attribute [rw] issue - # @return [::Google::Cloud::SecureSourceManager::V1::Issue] - # Required. The issue to create. - class CreateIssueRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # The request to get an issue. - # @!attribute [rw] name - # @return [::String] - # Required. Name of the issue to retrieve. - # The format is - # `projects/{project}/locations/{location}/repositories/{repository}/issues/{issue_id}`. - class GetIssueRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # The request to list issues. - # @!attribute [rw] parent - # @return [::String] - # Required. The repository in which to list issues. Format: - # `projects/{project_number}/locations/{location_id}/repositories/{repository_id}` - # @!attribute [rw] page_size - # @return [::Integer] - # Optional. Requested page size. Server may return fewer items than - # requested. If unspecified, server will pick an appropriate default. - # @!attribute [rw] page_token - # @return [::String] - # Optional. A token identifying a page of results the server should return. - # @!attribute [rw] filter - # @return [::String] - # Optional. Used to filter the resulting issues list. - class ListIssuesRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # The response to list issues. - # @!attribute [rw] issues - # @return [::Array<::Google::Cloud::SecureSourceManager::V1::Issue>] - # The list of issues. - # @!attribute [rw] next_page_token - # @return [::String] - # A token identifying a page of results the server should return. - class ListIssuesResponse - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # The request to update an issue. - # @!attribute [rw] issue - # @return [::Google::Cloud::SecureSourceManager::V1::Issue] - # Required. The issue to update. - # @!attribute [rw] update_mask - # @return [::Google::Protobuf::FieldMask] - # Optional. Field mask is used to specify the fields to be overwritten in the - # issue resource by the update. - # The fields specified in the update_mask are relative to the resource, not - # the full request. A field will be overwritten if it is in the mask. - # The special value "*" means full replacement. - class UpdateIssueRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # The request to delete an issue. - # @!attribute [rw] name - # @return [::String] - # Required. Name of the issue to delete. - # The format is - # `projects/{project_number}/locations/{location_id}/repositories/{repository_id}/issues/{issue_id}`. - # @!attribute [rw] etag - # @return [::String] - # Optional. The current etag of the issue. - # If the etag is provided and does not match the current etag of the issue, - # deletion will be blocked and an ABORTED error will be returned. - class DeleteIssueRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # The request to close an issue. - # @!attribute [rw] name - # @return [::String] - # Required. Name of the issue to close. - # The format is - # `projects/{project_number}/locations/{location_id}/repositories/{repository_id}/issues/{issue_id}`. - # @!attribute [rw] etag - # @return [::String] - # Optional. The current etag of the issue. - # If the etag is provided and does not match the current etag of the issue, - # closing will be blocked and an ABORTED error will be returned. - class CloseIssueRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # The request to open an issue. - # @!attribute [rw] name - # @return [::String] - # Required. Name of the issue to open. - # The format is - # `projects/{project_number}/locations/{location_id}/repositories/{repository_id}/issues/{issue_id}`. - # @!attribute [rw] etag - # @return [::String] - # Optional. The current etag of the issue. - # If the etag is provided and does not match the current etag of the issue, - # opening will be blocked and an ABORTED error will be returned. - class OpenIssueRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Represents an entry within a tree structure (like a Git tree). - # @!attribute [r] type - # @return [::Google::Cloud::SecureSourceManager::V1::TreeEntry::ObjectType] - # Output only. The type of the object (TREE, BLOB, COMMIT). Output-only. - # @!attribute [r] sha - # @return [::String] - # Output only. The SHA-1 hash of the object (unique identifier). Output-only. - # @!attribute [r] path - # @return [::String] - # Output only. The path of the file or directory within the tree (e.g., - # "src/main/java/MyClass.java"). Output-only. - # @!attribute [r] mode - # @return [::String] - # Output only. The file mode as a string (e.g., "100644"). Indicates file - # type. Output-only. - # @!attribute [r] size - # @return [::Integer] - # Output only. The size of the object in bytes (only for blobs). Output-only. - class TreeEntry - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - - # Defines the type of object the TreeEntry represents. - module ObjectType - # Default value, indicating the object type is unspecified. - OBJECT_TYPE_UNSPECIFIED = 0 - - # Represents a directory (folder). - TREE = 1 - - # Represents a file (contains file data). - BLOB = 2 - - # Represents a pointer to another repository (submodule). - COMMIT = 3 - end - end - - # Request message for fetching a tree structure from a repository. - # @!attribute [rw] repository - # @return [::String] - # Required. The format is - # `projects/{project_number}/locations/{location_id}/repositories/{repository_id}`. - # Specifies the repository to fetch the tree from. - # @!attribute [rw] ref - # @return [::String] - # Optional. `ref` can be a SHA-1 hash, a branch name, or a tag. Specifies - # which tree to fetch. If not specified, the default branch will be used. - # @!attribute [rw] recursive - # @return [::Boolean] - # Optional. If true, include all subfolders and their files in the response. - # If false, only the immediate children are returned. - # @!attribute [rw] page_size - # @return [::Integer] - # Optional. Requested page size. Server may return fewer items than - # requested. If unspecified, at most 10,000 items will be returned. - # @!attribute [rw] page_token - # @return [::String] - # Optional. A token identifying a page of results the server should return. - class FetchTreeRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Response message containing a list of TreeEntry objects. - # @!attribute [rw] tree_entries - # @return [::Array<::Google::Cloud::SecureSourceManager::V1::TreeEntry>] - # The list of TreeEntry objects. - # @!attribute [rw] next_page_token - # @return [::String] - # A token identifying a page of results the server should return. - class FetchTreeResponse - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Request message for fetching a blob (file content) from a repository. - # @!attribute [rw] repository - # @return [::String] - # Required. The format is - # `projects/{project_number}/locations/{location_id}/repositories/{repository_id}`. - # Specifies the repository containing the blob. - # @!attribute [rw] sha - # @return [::String] - # Required. The SHA-1 hash of the blob to retrieve. - class FetchBlobRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Response message containing the content of a blob. - # @!attribute [rw] sha - # @return [::String] - # The SHA-1 hash of the blob. - # @!attribute [rw] content - # @return [::String] - # The content of the blob, encoded as base64. - class FetchBlobResponse - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # The request to list pull request comments. - # @!attribute [rw] parent - # @return [::String] - # Required. The pull request in which to list pull request comments. Format: - # `projects/{project_number}/locations/{location_id}/repositories/{repository_id}/pullRequests/{pull_request_id}` - # @!attribute [rw] page_size - # @return [::Integer] - # Optional. Requested page size. If unspecified, at most 100 pull request - # comments will be returned. The maximum value is 100; values above 100 will - # be coerced to 100. - # @!attribute [rw] page_token - # @return [::String] - # Optional. A token identifying a page of results the server should return. - class ListPullRequestCommentsRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # The response to list pull request comments. - # @!attribute [rw] pull_request_comments - # @return [::Array<::Google::Cloud::SecureSourceManager::V1::PullRequestComment>] - # The list of pull request comments. - # @!attribute [rw] next_page_token - # @return [::String] - # A token to set as page_token to retrieve the next page. If this field is - # omitted, there are no subsequent pages. - class ListPullRequestCommentsResponse - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # The request to create a pull request comment. - # @!attribute [rw] parent - # @return [::String] - # Required. The pull request in which to create the pull request comment. - # Format: - # `projects/{project_number}/locations/{location_id}/repositories/{repository_id}/pullRequests/{pull_request_id}` - # @!attribute [rw] pull_request_comment - # @return [::Google::Cloud::SecureSourceManager::V1::PullRequestComment] - # Required. The pull request comment to create. - class CreatePullRequestCommentRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # The request to batch create pull request comments. - # @!attribute [rw] parent - # @return [::String] - # Required. The pull request in which to create the pull request comments. - # Format: - # `projects/{project_number}/locations/{location_id}/repositories/{repository_id}/pullRequests/{pull_request_id}` - # @!attribute [rw] requests - # @return [::Array<::Google::Cloud::SecureSourceManager::V1::CreatePullRequestCommentRequest>] - # Required. The request message specifying the resources to create. There - # should be exactly one CreatePullRequestCommentRequest with CommentDetail - # being REVIEW in the list, and no more than 100 - # CreatePullRequestCommentRequests with CommentDetail being CODE in the list - class BatchCreatePullRequestCommentsRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # The response to batch create pull request comments. - # @!attribute [rw] pull_request_comments - # @return [::Array<::Google::Cloud::SecureSourceManager::V1::PullRequestComment>] - # The list of pull request comments created. - class BatchCreatePullRequestCommentsResponse - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # The request to update a pull request comment. - # @!attribute [rw] pull_request_comment - # @return [::Google::Cloud::SecureSourceManager::V1::PullRequestComment] - # Required. The pull request comment to update. - # @!attribute [rw] update_mask - # @return [::Google::Protobuf::FieldMask] - # Optional. Field mask is used to specify the fields to be overwritten in the - # pull request comment resource by the update. Updatable fields are - # `body`. - class UpdatePullRequestCommentRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # The request to delete a pull request comment. A Review PullRequestComment - # cannot be deleted. - # @!attribute [rw] name - # @return [::String] - # Required. Name of the pull request comment to delete. - # The format is - # `projects/{project_number}/locations/{location_id}/repositories/{repository_id}/pullRequests/{pull_request_id}/pullRequestComments/{comment_id}`. - class DeletePullRequestCommentRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # The request to get a pull request comment. - # @!attribute [rw] name - # @return [::String] - # Required. Name of the pull request comment to retrieve. - # The format is - # `projects/{project_number}/locations/{location_id}/repositories/{repository_id}/pullRequests/{pull_request_id}/pullRequestComments/{comment_id}`. - class GetPullRequestCommentRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # The request to resolve multiple pull request comments. - # @!attribute [rw] parent - # @return [::String] - # Required. The pull request in which to resolve the pull request comments. - # Format: - # `projects/{project_number}/locations/{location_id}/repositories/{repository_id}/pullRequests/{pull_request_id}` - # @!attribute [rw] names - # @return [::Array<::String>] - # Required. The names of the pull request comments to resolve. Format: - # `projects/{project_number}/locations/{location_id}/repositories/{repository_id}/pullRequests/{pull_request_id}/pullRequestComments/{comment_id}` - # Only comments from the same threads are allowed in the same request. - # @!attribute [rw] auto_fill - # @return [::Boolean] - # Optional. If set, at least one comment in a thread is required, rest of the - # comments in the same thread will be automatically updated to resolved. If - # unset, all comments in the same thread need be present. - class ResolvePullRequestCommentsRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # The response to resolve multiple pull request comments. - # @!attribute [rw] pull_request_comments - # @return [::Array<::Google::Cloud::SecureSourceManager::V1::PullRequestComment>] - # The list of pull request comments resolved. - class ResolvePullRequestCommentsResponse - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # The request to unresolve multiple pull request comments. - # @!attribute [rw] parent - # @return [::String] - # Required. The pull request in which to resolve the pull request comments. - # Format: - # `projects/{project_number}/locations/{location_id}/repositories/{repository_id}/pullRequests/{pull_request_id}` - # @!attribute [rw] names - # @return [::Array<::String>] - # Required. The names of the pull request comments to unresolve. Format: - # `projects/{project_number}/locations/{location_id}/repositories/{repository_id}/pullRequests/{pull_request_id}/pullRequestComments/{comment_id}` - # Only comments from the same threads are allowed in the same request. - # @!attribute [rw] auto_fill - # @return [::Boolean] - # Optional. If set, at least one comment in a thread is required, rest of the - # comments in the same thread will be automatically updated to unresolved. If - # unset, all comments in the same thread need be present. - class UnresolvePullRequestCommentsRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # The response to unresolve multiple pull request comments. - # @!attribute [rw] pull_request_comments - # @return [::Array<::Google::Cloud::SecureSourceManager::V1::PullRequestComment>] - # The list of pull request comments unresolved. - class UnresolvePullRequestCommentsResponse - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # The request to create an issue comment. - # @!attribute [rw] parent - # @return [::String] - # Required. The issue in which to create the issue comment. Format: - # `projects/{project_number}/locations/{location_id}/repositories/{repository_id}/issues/{issue_id}` - # @!attribute [rw] issue_comment - # @return [::Google::Cloud::SecureSourceManager::V1::IssueComment] - # Required. The issue comment to create. - class CreateIssueCommentRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # The request to get an issue comment. - # @!attribute [rw] name - # @return [::String] - # Required. Name of the issue comment to retrieve. - # The format is - # `projects/{project}/locations/{location}/repositories/{repository}/issues/{issue_id}/issueComments/{comment_id}`. - class GetIssueCommentRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # The request to list issue comments. - # @!attribute [rw] parent - # @return [::String] - # Required. The issue in which to list the comments. Format: - # `projects/{project_number}/locations/{location_id}/repositories/{repository_id}/issues/{issue_id}` - # @!attribute [rw] page_size - # @return [::Integer] - # Optional. Requested page size. Server may return fewer items than - # requested. If unspecified, server will pick an appropriate default. - # @!attribute [rw] page_token - # @return [::String] - # Optional. A token identifying a page of results the server should return. - class ListIssueCommentsRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # The response to list issue comments. - # @!attribute [rw] issue_comments - # @return [::Array<::Google::Cloud::SecureSourceManager::V1::IssueComment>] - # The list of issue comments. - # @!attribute [rw] next_page_token - # @return [::String] - # A token identifying a page of results the server should return. - class ListIssueCommentsResponse - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # The request to update an issue comment. - # @!attribute [rw] issue_comment - # @return [::Google::Cloud::SecureSourceManager::V1::IssueComment] - # Required. The issue comment to update. - # @!attribute [rw] update_mask - # @return [::Google::Protobuf::FieldMask] - # Optional. Field mask is used to specify the fields to be overwritten in the - # issue comment resource by the update. - # The fields specified in the update_mask are relative to the resource, not - # the full request. A field will be overwritten if it is in the mask. - # The special value "*" means full replacement. - class UpdateIssueCommentRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # The request to delete an issue comment. - # @!attribute [rw] name - # @return [::String] - # Required. Name of the issue comment to delete. - # The format is - # `projects/{project_number}/locations/{location_id}/repositories/{repository_id}/issues/{issue_id}/issueComments/{comment_id}`. - class DeleteIssueCommentRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - end - end - end -end diff --git a/owl-bot-staging/google-cloud-secure_source_manager-v1/proto_docs/google/longrunning/operations.rb b/owl-bot-staging/google-cloud-secure_source_manager-v1/proto_docs/google/longrunning/operations.rb deleted file mode 100644 index 7a757f512165..000000000000 --- a/owl-bot-staging/google-cloud-secure_source_manager-v1/proto_docs/google/longrunning/operations.rb +++ /dev/null @@ -1,191 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - - -module Google - module Longrunning - # This resource represents a long-running operation that is the result of a - # network API call. - # @!attribute [rw] name - # @return [::String] - # The server-assigned name, which is only unique within the same service that - # originally returns it. If you use the default HTTP mapping, the - # `name` should be a resource name ending with `operations/{unique_id}`. - # @!attribute [rw] metadata - # @return [::Google::Protobuf::Any] - # Service-specific metadata associated with the operation. It typically - # contains progress information and common metadata such as create time. - # Some services might not provide such metadata. Any method that returns a - # long-running operation should document the metadata type, if any. - # @!attribute [rw] done - # @return [::Boolean] - # If the value is `false`, it means the operation is still in progress. - # If `true`, the operation is completed, and either `error` or `response` is - # available. - # @!attribute [rw] error - # @return [::Google::Rpc::Status] - # The error result of the operation in case of failure or cancellation. - # - # Note: The following fields are mutually exclusive: `error`, `response`. If a field in that set is populated, all other fields in the set will automatically be cleared. - # @!attribute [rw] response - # @return [::Google::Protobuf::Any] - # The normal, successful response of the operation. If the original - # method returns no data on success, such as `Delete`, the response is - # `google.protobuf.Empty`. If the original method is standard - # `Get`/`Create`/`Update`, the response should be the resource. For other - # methods, the response should have the type `XxxResponse`, where `Xxx` - # is the original method name. For example, if the original method name - # is `TakeSnapshot()`, the inferred response type is - # `TakeSnapshotResponse`. - # - # Note: The following fields are mutually exclusive: `response`, `error`. If a field in that set is populated, all other fields in the set will automatically be cleared. - class Operation - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # The request message for - # Operations.GetOperation. - # @!attribute [rw] name - # @return [::String] - # The name of the operation resource. - class GetOperationRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # The request message for - # Operations.ListOperations. - # @!attribute [rw] name - # @return [::String] - # The name of the operation's parent resource. - # @!attribute [rw] filter - # @return [::String] - # The standard list filter. - # @!attribute [rw] page_size - # @return [::Integer] - # The standard list page size. - # @!attribute [rw] page_token - # @return [::String] - # The standard list page token. - # @!attribute [rw] return_partial_success - # @return [::Boolean] - # When set to `true`, operations that are reachable are returned as normal, - # and those that are unreachable are returned in the - # [ListOperationsResponse.unreachable] field. - # - # This can only be `true` when reading across collections e.g. when `parent` - # is set to `"projects/example/locations/-"`. - # - # This field is not by default supported and will result in an - # `UNIMPLEMENTED` error if set unless explicitly documented otherwise in - # service or product specific documentation. - class ListOperationsRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # The response message for - # Operations.ListOperations. - # @!attribute [rw] operations - # @return [::Array<::Google::Longrunning::Operation>] - # A list of operations that matches the specified filter in the request. - # @!attribute [rw] next_page_token - # @return [::String] - # The standard List next-page token. - # @!attribute [rw] unreachable - # @return [::Array<::String>] - # Unordered list. Unreachable resources. Populated when the request sets - # `ListOperationsRequest.return_partial_success` and reads across - # collections e.g. when attempting to list all resources across all supported - # locations. - class ListOperationsResponse - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # The request message for - # Operations.CancelOperation. - # @!attribute [rw] name - # @return [::String] - # The name of the operation resource to be cancelled. - class CancelOperationRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # The request message for - # Operations.DeleteOperation. - # @!attribute [rw] name - # @return [::String] - # The name of the operation resource to be deleted. - class DeleteOperationRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # The request message for - # Operations.WaitOperation. - # @!attribute [rw] name - # @return [::String] - # The name of the operation resource to wait on. - # @!attribute [rw] timeout - # @return [::Google::Protobuf::Duration] - # The maximum duration to wait before timing out. If left blank, the wait - # will be at most the time permitted by the underlying HTTP/RPC protocol. - # If RPC context deadline is also specified, the shorter one will be used. - class WaitOperationRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # A message representing the message types used by a long-running operation. - # - # Example: - # - # rpc Export(ExportRequest) returns (google.longrunning.Operation) { - # option (google.longrunning.operation_info) = { - # response_type: "ExportResponse" - # metadata_type: "ExportMetadata" - # }; - # } - # @!attribute [rw] response_type - # @return [::String] - # Required. The message name of the primary return type for this - # long-running operation. - # This type will be used to deserialize the LRO's response. - # - # If the response is in a different package from the rpc, a fully-qualified - # message name must be used (e.g. `google.protobuf.Struct`). - # - # Note: Altering this value constitutes a breaking change. - # @!attribute [rw] metadata_type - # @return [::String] - # Required. The message name of the metadata type for this long-running - # operation. - # - # If the response is in a different package from the rpc, a fully-qualified - # message name must be used (e.g. `google.protobuf.Struct`). - # - # Note: Altering this value constitutes a breaking change. - class OperationInfo - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - end -end diff --git a/owl-bot-staging/google-cloud-secure_source_manager-v1/proto_docs/google/protobuf/any.rb b/owl-bot-staging/google-cloud-secure_source_manager-v1/proto_docs/google/protobuf/any.rb deleted file mode 100644 index 58691995f02e..000000000000 --- a/owl-bot-staging/google-cloud-secure_source_manager-v1/proto_docs/google/protobuf/any.rb +++ /dev/null @@ -1,145 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - - -module Google - module Protobuf - # `Any` contains an arbitrary serialized protocol buffer message along with a - # URL that describes the type of the serialized message. - # - # Protobuf library provides support to pack/unpack Any values in the form - # of utility functions or additional generated methods of the Any type. - # - # Example 1: Pack and unpack a message in C++. - # - # Foo foo = ...; - # Any any; - # any.PackFrom(foo); - # ... - # if (any.UnpackTo(&foo)) { - # ... - # } - # - # Example 2: Pack and unpack a message in Java. - # - # Foo foo = ...; - # Any any = Any.pack(foo); - # ... - # if (any.is(Foo.class)) { - # foo = any.unpack(Foo.class); - # } - # // or ... - # if (any.isSameTypeAs(Foo.getDefaultInstance())) { - # foo = any.unpack(Foo.getDefaultInstance()); - # } - # - # Example 3: Pack and unpack a message in Python. - # - # foo = Foo(...) - # any = Any() - # any.Pack(foo) - # ... - # if any.Is(Foo.DESCRIPTOR): - # any.Unpack(foo) - # ... - # - # Example 4: Pack and unpack a message in Go - # - # foo := &pb.Foo{...} - # any, err := anypb.New(foo) - # if err != nil { - # ... - # } - # ... - # foo := &pb.Foo{} - # if err := any.UnmarshalTo(foo); err != nil { - # ... - # } - # - # The pack methods provided by protobuf library will by default use - # 'type.googleapis.com/full.type.name' as the type URL and the unpack - # methods only use the fully qualified type name after the last '/' - # in the type URL, for example "foo.bar.com/x/y.z" will yield type - # name "y.z". - # - # JSON - # ==== - # The JSON representation of an `Any` value uses the regular - # representation of the deserialized, embedded message, with an - # additional field `@type` which contains the type URL. Example: - # - # package google.profile; - # message Person { - # string first_name = 1; - # string last_name = 2; - # } - # - # { - # "@type": "type.googleapis.com/google.profile.Person", - # "firstName": , - # "lastName": - # } - # - # If the embedded message type is well-known and has a custom JSON - # representation, that representation will be embedded adding a field - # `value` which holds the custom JSON in addition to the `@type` - # field. Example (for message [google.protobuf.Duration][]): - # - # { - # "@type": "type.googleapis.com/google.protobuf.Duration", - # "value": "1.212s" - # } - # @!attribute [rw] type_url - # @return [::String] - # A URL/resource name that uniquely identifies the type of the serialized - # protocol buffer message. This string must contain at least - # one "/" character. The last segment of the URL's path must represent - # the fully qualified name of the type (as in - # `path/google.protobuf.Duration`). The name should be in a canonical form - # (e.g., leading "." is not accepted). - # - # In practice, teams usually precompile into the binary all types that they - # expect it to use in the context of Any. However, for URLs which use the - # scheme `http`, `https`, or no scheme, one can optionally set up a type - # server that maps type URLs to message definitions as follows: - # - # * If no scheme is provided, `https` is assumed. - # * An HTTP GET on the URL must yield a [google.protobuf.Type][] - # value in binary format, or produce an error. - # * Applications are allowed to cache lookup results based on the - # URL, or have them precompiled into a binary to avoid any - # lookup. Therefore, binary compatibility needs to be preserved - # on changes to types. (Use versioned type names to manage - # breaking changes.) - # - # Note: this functionality is not currently available in the official - # protobuf release, and it is not used for type URLs beginning with - # type.googleapis.com. As of May 2023, there are no widely used type server - # implementations and no plans to implement one. - # - # Schemes other than `http`, `https` (or the empty scheme) might be - # used with implementation specific semantics. - # @!attribute [rw] value - # @return [::String] - # Must be a valid serialized protocol buffer of the above specified type. - class Any - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - end -end diff --git a/owl-bot-staging/google-cloud-secure_source_manager-v1/proto_docs/google/protobuf/duration.rb b/owl-bot-staging/google-cloud-secure_source_manager-v1/proto_docs/google/protobuf/duration.rb deleted file mode 100644 index ea59f1f91daf..000000000000 --- a/owl-bot-staging/google-cloud-secure_source_manager-v1/proto_docs/google/protobuf/duration.rb +++ /dev/null @@ -1,98 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - - -module Google - module Protobuf - # A Duration represents a signed, fixed-length span of time represented - # as a count of seconds and fractions of seconds at nanosecond - # resolution. It is independent of any calendar and concepts like "day" - # or "month". It is related to Timestamp in that the difference between - # two Timestamp values is a Duration and it can be added or subtracted - # from a Timestamp. Range is approximately +-10,000 years. - # - # # Examples - # - # Example 1: Compute Duration from two Timestamps in pseudo code. - # - # Timestamp start = ...; - # Timestamp end = ...; - # Duration duration = ...; - # - # duration.seconds = end.seconds - start.seconds; - # duration.nanos = end.nanos - start.nanos; - # - # if (duration.seconds < 0 && duration.nanos > 0) { - # duration.seconds += 1; - # duration.nanos -= 1000000000; - # } else if (duration.seconds > 0 && duration.nanos < 0) { - # duration.seconds -= 1; - # duration.nanos += 1000000000; - # } - # - # Example 2: Compute Timestamp from Timestamp + Duration in pseudo code. - # - # Timestamp start = ...; - # Duration duration = ...; - # Timestamp end = ...; - # - # end.seconds = start.seconds + duration.seconds; - # end.nanos = start.nanos + duration.nanos; - # - # if (end.nanos < 0) { - # end.seconds -= 1; - # end.nanos += 1000000000; - # } else if (end.nanos >= 1000000000) { - # end.seconds += 1; - # end.nanos -= 1000000000; - # } - # - # Example 3: Compute Duration from datetime.timedelta in Python. - # - # td = datetime.timedelta(days=3, minutes=10) - # duration = Duration() - # duration.FromTimedelta(td) - # - # # JSON Mapping - # - # In JSON format, the Duration type is encoded as a string rather than an - # object, where the string ends in the suffix "s" (indicating seconds) and - # is preceded by the number of seconds, with nanoseconds expressed as - # fractional seconds. For example, 3 seconds with 0 nanoseconds should be - # encoded in JSON format as "3s", while 3 seconds and 1 nanosecond should - # be expressed in JSON format as "3.000000001s", and 3 seconds and 1 - # microsecond should be expressed in JSON format as "3.000001s". - # @!attribute [rw] seconds - # @return [::Integer] - # Signed seconds of the span of time. Must be from -315,576,000,000 - # to +315,576,000,000 inclusive. Note: these bounds are computed from: - # 60 sec/min * 60 min/hr * 24 hr/day * 365.25 days/year * 10000 years - # @!attribute [rw] nanos - # @return [::Integer] - # Signed fractions of a second at nanosecond resolution of the span - # of time. Durations less than one second are represented with a 0 - # `seconds` field and a positive or negative `nanos` field. For durations - # of one second or more, a non-zero value for the `nanos` field must be - # of the same sign as the `seconds` field. Must be from -999,999,999 - # to +999,999,999 inclusive. - class Duration - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - end -end diff --git a/owl-bot-staging/google-cloud-secure_source_manager-v1/proto_docs/google/protobuf/empty.rb b/owl-bot-staging/google-cloud-secure_source_manager-v1/proto_docs/google/protobuf/empty.rb deleted file mode 100644 index 83e4481834a6..000000000000 --- a/owl-bot-staging/google-cloud-secure_source_manager-v1/proto_docs/google/protobuf/empty.rb +++ /dev/null @@ -1,34 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - - -module Google - module Protobuf - # A generic empty message that you can re-use to avoid defining duplicated - # empty messages in your APIs. A typical example is to use it as the request - # or the response type of an API method. For instance: - # - # service Foo { - # rpc Bar(google.protobuf.Empty) returns (google.protobuf.Empty); - # } - class Empty - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - end -end diff --git a/owl-bot-staging/google-cloud-secure_source_manager-v1/proto_docs/google/protobuf/field_mask.rb b/owl-bot-staging/google-cloud-secure_source_manager-v1/proto_docs/google/protobuf/field_mask.rb deleted file mode 100644 index 7f3ffc78601a..000000000000 --- a/owl-bot-staging/google-cloud-secure_source_manager-v1/proto_docs/google/protobuf/field_mask.rb +++ /dev/null @@ -1,229 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - - -module Google - module Protobuf - # `FieldMask` represents a set of symbolic field paths, for example: - # - # paths: "f.a" - # paths: "f.b.d" - # - # Here `f` represents a field in some root message, `a` and `b` - # fields in the message found in `f`, and `d` a field found in the - # message in `f.b`. - # - # Field masks are used to specify a subset of fields that should be - # returned by a get operation or modified by an update operation. - # Field masks also have a custom JSON encoding (see below). - # - # # Field Masks in Projections - # - # When used in the context of a projection, a response message or - # sub-message is filtered by the API to only contain those fields as - # specified in the mask. For example, if the mask in the previous - # example is applied to a response message as follows: - # - # f { - # a : 22 - # b { - # d : 1 - # x : 2 - # } - # y : 13 - # } - # z: 8 - # - # The result will not contain specific values for fields x,y and z - # (their value will be set to the default, and omitted in proto text - # output): - # - # - # f { - # a : 22 - # b { - # d : 1 - # } - # } - # - # A repeated field is not allowed except at the last position of a - # paths string. - # - # If a FieldMask object is not present in a get operation, the - # operation applies to all fields (as if a FieldMask of all fields - # had been specified). - # - # Note that a field mask does not necessarily apply to the - # top-level response message. In case of a REST get operation, the - # field mask applies directly to the response, but in case of a REST - # list operation, the mask instead applies to each individual message - # in the returned resource list. In case of a REST custom method, - # other definitions may be used. Where the mask applies will be - # clearly documented together with its declaration in the API. In - # any case, the effect on the returned resource/resources is required - # behavior for APIs. - # - # # Field Masks in Update Operations - # - # A field mask in update operations specifies which fields of the - # targeted resource are going to be updated. The API is required - # to only change the values of the fields as specified in the mask - # and leave the others untouched. If a resource is passed in to - # describe the updated values, the API ignores the values of all - # fields not covered by the mask. - # - # If a repeated field is specified for an update operation, new values will - # be appended to the existing repeated field in the target resource. Note that - # a repeated field is only allowed in the last position of a `paths` string. - # - # If a sub-message is specified in the last position of the field mask for an - # update operation, then new value will be merged into the existing sub-message - # in the target resource. - # - # For example, given the target message: - # - # f { - # b { - # d: 1 - # x: 2 - # } - # c: [1] - # } - # - # And an update message: - # - # f { - # b { - # d: 10 - # } - # c: [2] - # } - # - # then if the field mask is: - # - # paths: ["f.b", "f.c"] - # - # then the result will be: - # - # f { - # b { - # d: 10 - # x: 2 - # } - # c: [1, 2] - # } - # - # An implementation may provide options to override this default behavior for - # repeated and message fields. - # - # In order to reset a field's value to the default, the field must - # be in the mask and set to the default value in the provided resource. - # Hence, in order to reset all fields of a resource, provide a default - # instance of the resource and set all fields in the mask, or do - # not provide a mask as described below. - # - # If a field mask is not present on update, the operation applies to - # all fields (as if a field mask of all fields has been specified). - # Note that in the presence of schema evolution, this may mean that - # fields the client does not know and has therefore not filled into - # the request will be reset to their default. If this is unwanted - # behavior, a specific service may require a client to always specify - # a field mask, producing an error if not. - # - # As with get operations, the location of the resource which - # describes the updated values in the request message depends on the - # operation kind. In any case, the effect of the field mask is - # required to be honored by the API. - # - # ## Considerations for HTTP REST - # - # The HTTP kind of an update operation which uses a field mask must - # be set to PATCH instead of PUT in order to satisfy HTTP semantics - # (PUT must only be used for full updates). - # - # # JSON Encoding of Field Masks - # - # In JSON, a field mask is encoded as a single string where paths are - # separated by a comma. Fields name in each path are converted - # to/from lower-camel naming conventions. - # - # As an example, consider the following message declarations: - # - # message Profile { - # User user = 1; - # Photo photo = 2; - # } - # message User { - # string display_name = 1; - # string address = 2; - # } - # - # In proto a field mask for `Profile` may look as such: - # - # mask { - # paths: "user.display_name" - # paths: "photo" - # } - # - # In JSON, the same mask is represented as below: - # - # { - # mask: "user.displayName,photo" - # } - # - # # Field Masks and Oneof Fields - # - # Field masks treat fields in oneofs just as regular fields. Consider the - # following message: - # - # message SampleMessage { - # oneof test_oneof { - # string name = 4; - # SubMessage sub_message = 9; - # } - # } - # - # The field mask can be: - # - # mask { - # paths: "name" - # } - # - # Or: - # - # mask { - # paths: "sub_message" - # } - # - # Note that oneof type names ("test_oneof" in this case) cannot be used in - # paths. - # - # ## Field Mask Verification - # - # The implementation of any API method which has a FieldMask type field in the - # request should verify the included field paths, and return an - # `INVALID_ARGUMENT` error if any path is unmappable. - # @!attribute [rw] paths - # @return [::Array<::String>] - # The set of field mask paths. - class FieldMask - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - end -end diff --git a/owl-bot-staging/google-cloud-secure_source_manager-v1/proto_docs/google/protobuf/timestamp.rb b/owl-bot-staging/google-cloud-secure_source_manager-v1/proto_docs/google/protobuf/timestamp.rb deleted file mode 100644 index 74352be9c58c..000000000000 --- a/owl-bot-staging/google-cloud-secure_source_manager-v1/proto_docs/google/protobuf/timestamp.rb +++ /dev/null @@ -1,127 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - - -module Google - module Protobuf - # A Timestamp represents a point in time independent of any time zone or local - # calendar, encoded as a count of seconds and fractions of seconds at - # nanosecond resolution. The count is relative to an epoch at UTC midnight on - # January 1, 1970, in the proleptic Gregorian calendar which extends the - # Gregorian calendar backwards to year one. - # - # All minutes are 60 seconds long. Leap seconds are "smeared" so that no leap - # second table is needed for interpretation, using a [24-hour linear - # smear](https://developers.google.com/time/smear). - # - # The range is from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59.999999999Z. By - # restricting to that range, we ensure that we can convert to and from [RFC - # 3339](https://www.ietf.org/rfc/rfc3339.txt) date strings. - # - # # Examples - # - # Example 1: Compute Timestamp from POSIX `time()`. - # - # Timestamp timestamp; - # timestamp.set_seconds(time(NULL)); - # timestamp.set_nanos(0); - # - # Example 2: Compute Timestamp from POSIX `gettimeofday()`. - # - # struct timeval tv; - # gettimeofday(&tv, NULL); - # - # Timestamp timestamp; - # timestamp.set_seconds(tv.tv_sec); - # timestamp.set_nanos(tv.tv_usec * 1000); - # - # Example 3: Compute Timestamp from Win32 `GetSystemTimeAsFileTime()`. - # - # FILETIME ft; - # GetSystemTimeAsFileTime(&ft); - # UINT64 ticks = (((UINT64)ft.dwHighDateTime) << 32) | ft.dwLowDateTime; - # - # // A Windows tick is 100 nanoseconds. Windows epoch 1601-01-01T00:00:00Z - # // is 11644473600 seconds before Unix epoch 1970-01-01T00:00:00Z. - # Timestamp timestamp; - # timestamp.set_seconds((INT64) ((ticks / 10000000) - 11644473600LL)); - # timestamp.set_nanos((INT32) ((ticks % 10000000) * 100)); - # - # Example 4: Compute Timestamp from Java `System.currentTimeMillis()`. - # - # long millis = System.currentTimeMillis(); - # - # Timestamp timestamp = Timestamp.newBuilder().setSeconds(millis / 1000) - # .setNanos((int) ((millis % 1000) * 1000000)).build(); - # - # Example 5: Compute Timestamp from Java `Instant.now()`. - # - # Instant now = Instant.now(); - # - # Timestamp timestamp = - # Timestamp.newBuilder().setSeconds(now.getEpochSecond()) - # .setNanos(now.getNano()).build(); - # - # Example 6: Compute Timestamp from current time in Python. - # - # timestamp = Timestamp() - # timestamp.GetCurrentTime() - # - # # JSON Mapping - # - # In JSON format, the Timestamp type is encoded as a string in the - # [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format. That is, the - # format is "\\{year}-\\{month}-\\{day}T\\{hour}:\\{min}:\\{sec}[.\\{frac_sec}]Z" - # where \\{year} is always expressed using four digits while \\{month}, \\{day}, - # \\{hour}, \\{min}, and \\{sec} are zero-padded to two digits each. The fractional - # seconds, which can go up to 9 digits (i.e. up to 1 nanosecond resolution), - # are optional. The "Z" suffix indicates the timezone ("UTC"); the timezone - # is required. A proto3 JSON serializer should always use UTC (as indicated by - # "Z") when printing the Timestamp type and a proto3 JSON parser should be - # able to accept both UTC and other timezones (as indicated by an offset). - # - # For example, "2017-01-15T01:30:15.01Z" encodes 15.01 seconds past - # 01:30 UTC on January 15, 2017. - # - # In JavaScript, one can convert a Date object to this format using the - # standard - # [toISOString()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toISOString) - # method. In Python, a standard `datetime.datetime` object can be converted - # to this format using - # [`strftime`](https://docs.python.org/2/library/time.html#time.strftime) with - # the time format spec '%Y-%m-%dT%H:%M:%S.%fZ'. Likewise, in Java, one can use - # the Joda Time's [`ISODateTimeFormat.dateTime()`]( - # http://joda-time.sourceforge.net/apidocs/org/joda/time/format/ISODateTimeFormat.html#dateTime() - # ) to obtain a formatter capable of generating timestamps in this format. - # @!attribute [rw] seconds - # @return [::Integer] - # Represents seconds of UTC time since Unix epoch - # 1970-01-01T00:00:00Z. Must be from 0001-01-01T00:00:00Z to - # 9999-12-31T23:59:59Z inclusive. - # @!attribute [rw] nanos - # @return [::Integer] - # Non-negative fractions of a second at nanosecond resolution. Negative - # second values with fractions must still have non-negative nanos values - # that count forward in time. Must be from 0 to 999,999,999 - # inclusive. - class Timestamp - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - end -end diff --git a/owl-bot-staging/google-cloud-secure_source_manager-v1/proto_docs/google/rpc/status.rb b/owl-bot-staging/google-cloud-secure_source_manager-v1/proto_docs/google/rpc/status.rb deleted file mode 100644 index c1a1c07eb2db..000000000000 --- a/owl-bot-staging/google-cloud-secure_source_manager-v1/proto_docs/google/rpc/status.rb +++ /dev/null @@ -1,48 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - - -module Google - module Rpc - # The `Status` type defines a logical error model that is suitable for - # different programming environments, including REST APIs and RPC APIs. It is - # used by [gRPC](https://github.com/grpc). Each `Status` message contains - # three pieces of data: error code, error message, and error details. - # - # You can find out more about this error model and how to work with it in the - # [API Design Guide](https://cloud.google.com/apis/design/errors). - # @!attribute [rw] code - # @return [::Integer] - # The status code, which should be an enum value of - # [google.rpc.Code][google.rpc.Code]. - # @!attribute [rw] message - # @return [::String] - # A developer-facing error message, which should be in English. Any - # user-facing error message should be localized and sent in the - # {::Google::Rpc::Status#details google.rpc.Status.details} field, or localized - # by the client. - # @!attribute [rw] details - # @return [::Array<::Google::Protobuf::Any>] - # A list of messages that carry the error details. There is a common set of - # message types for APIs to use. - class Status - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - end -end diff --git a/owl-bot-staging/google-cloud-secure_source_manager-v1/proto_docs/google/type/expr.rb b/owl-bot-staging/google-cloud-secure_source_manager-v1/proto_docs/google/type/expr.rb deleted file mode 100644 index 53e7733b6592..000000000000 --- a/owl-bot-staging/google-cloud-secure_source_manager-v1/proto_docs/google/type/expr.rb +++ /dev/null @@ -1,75 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - - -module Google - module Type - # Represents a textual expression in the Common Expression Language (CEL) - # syntax. CEL is a C-like expression language. The syntax and semantics of CEL - # are documented at https://github.com/google/cel-spec. - # - # Example (Comparison): - # - # title: "Summary size limit" - # description: "Determines if a summary is less than 100 chars" - # expression: "document.summary.size() < 100" - # - # Example (Equality): - # - # title: "Requestor is owner" - # description: "Determines if requestor is the document owner" - # expression: "document.owner == request.auth.claims.email" - # - # Example (Logic): - # - # title: "Public documents" - # description: "Determine whether the document should be publicly visible" - # expression: "document.type != 'private' && document.type != 'internal'" - # - # Example (Data Manipulation): - # - # title: "Notification string" - # description: "Create a notification string with a timestamp." - # expression: "'New message received at ' + string(document.create_time)" - # - # The exact variables and functions that may be referenced within an expression - # are determined by the service that evaluates it. See the service - # documentation for additional information. - # @!attribute [rw] expression - # @return [::String] - # Textual representation of an expression in Common Expression Language - # syntax. - # @!attribute [rw] title - # @return [::String] - # Optional. Title for the expression, i.e. a short string describing - # its purpose. This can be used e.g. in UIs which allow to enter the - # expression. - # @!attribute [rw] description - # @return [::String] - # Optional. Description of the expression. This is a longer text which - # describes the expression, e.g. when hovered over it in a UI. - # @!attribute [rw] location - # @return [::String] - # Optional. String indicating the location of the expression for error - # reporting, e.g. a file name and a position in the file. - class Expr - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - end -end diff --git a/owl-bot-staging/google-cloud-secure_source_manager-v1/snippets/Gemfile b/owl-bot-staging/google-cloud-secure_source_manager-v1/snippets/Gemfile deleted file mode 100644 index c02a8c6ffa97..000000000000 --- a/owl-bot-staging/google-cloud-secure_source_manager-v1/snippets/Gemfile +++ /dev/null @@ -1,32 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -source "https://rubygems.org" - -if ENV["GOOGLE_CLOUD_SAMPLES_TEST"] == "master" - gem "google-cloud-secure_source_manager-v1", path: "../" -else - gem "google-cloud-secure_source_manager-v1" -end - -group :test do - gem "google-style", "~> 1.26.1" - gem "minitest", "~> 5.16" - gem "minitest-focus", "~> 1.1" - gem "minitest-hooks", "~> 1.5" -end diff --git a/owl-bot-staging/google-cloud-secure_source_manager-v1/snippets/secure_source_manager/batch_create_pull_request_comments.rb b/owl-bot-staging/google-cloud-secure_source_manager-v1/snippets/secure_source_manager/batch_create_pull_request_comments.rb deleted file mode 100644 index 6aeca4d125fe..000000000000 --- a/owl-bot-staging/google-cloud-secure_source_manager-v1/snippets/secure_source_manager/batch_create_pull_request_comments.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 securesourcemanager_v1_generated_SecureSourceManager_BatchCreatePullRequestComments_sync] -require "google/cloud/secure_source_manager/v1" - -## -# Snippet for the batch_create_pull_request_comments call in the SecureSourceManager service -# -# This snippet has been automatically generated and should be regarded as a code -# template only. It will require modifications to work: -# - It may require correct/in-range values for request initialization. -# - It may require specifying regional endpoints when creating the service -# client as shown in https://cloud.google.com/ruby/docs/reference. -# -# This is an auto-generated example demonstrating basic usage of -# Google::Cloud::SecureSourceManager::V1::SecureSourceManager::Client#batch_create_pull_request_comments. -# -def batch_create_pull_request_comments - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::SecureSourceManager::V1::SecureSourceManager::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::SecureSourceManager::V1::BatchCreatePullRequestCommentsRequest.new - - # Call the batch_create_pull_request_comments method. - result = client.batch_create_pull_request_comments 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 securesourcemanager_v1_generated_SecureSourceManager_BatchCreatePullRequestComments_sync] diff --git a/owl-bot-staging/google-cloud-secure_source_manager-v1/snippets/secure_source_manager/close_issue.rb b/owl-bot-staging/google-cloud-secure_source_manager-v1/snippets/secure_source_manager/close_issue.rb deleted file mode 100644 index b2ba82ae6d45..000000000000 --- a/owl-bot-staging/google-cloud-secure_source_manager-v1/snippets/secure_source_manager/close_issue.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 securesourcemanager_v1_generated_SecureSourceManager_CloseIssue_sync] -require "google/cloud/secure_source_manager/v1" - -## -# Snippet for the close_issue call in the SecureSourceManager service -# -# This snippet has been automatically generated and should be regarded as a code -# template only. It will require modifications to work: -# - It may require correct/in-range values for request initialization. -# - It may require specifying regional endpoints when creating the service -# client as shown in https://cloud.google.com/ruby/docs/reference. -# -# This is an auto-generated example demonstrating basic usage of -# Google::Cloud::SecureSourceManager::V1::SecureSourceManager::Client#close_issue. -# -def close_issue - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::SecureSourceManager::V1::SecureSourceManager::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::SecureSourceManager::V1::CloseIssueRequest.new - - # Call the close_issue method. - result = client.close_issue 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 securesourcemanager_v1_generated_SecureSourceManager_CloseIssue_sync] diff --git a/owl-bot-staging/google-cloud-secure_source_manager-v1/snippets/secure_source_manager/close_pull_request.rb b/owl-bot-staging/google-cloud-secure_source_manager-v1/snippets/secure_source_manager/close_pull_request.rb deleted file mode 100644 index 38c1ced837e0..000000000000 --- a/owl-bot-staging/google-cloud-secure_source_manager-v1/snippets/secure_source_manager/close_pull_request.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 securesourcemanager_v1_generated_SecureSourceManager_ClosePullRequest_sync] -require "google/cloud/secure_source_manager/v1" - -## -# Snippet for the close_pull_request call in the SecureSourceManager service -# -# This snippet has been automatically generated and should be regarded as a code -# template only. It will require modifications to work: -# - It may require correct/in-range values for request initialization. -# - It may require specifying regional endpoints when creating the service -# client as shown in https://cloud.google.com/ruby/docs/reference. -# -# This is an auto-generated example demonstrating basic usage of -# Google::Cloud::SecureSourceManager::V1::SecureSourceManager::Client#close_pull_request. -# -def close_pull_request - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::SecureSourceManager::V1::SecureSourceManager::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::SecureSourceManager::V1::ClosePullRequestRequest.new - - # Call the close_pull_request method. - result = client.close_pull_request 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 securesourcemanager_v1_generated_SecureSourceManager_ClosePullRequest_sync] diff --git a/owl-bot-staging/google-cloud-secure_source_manager-v1/snippets/secure_source_manager/create_branch_rule.rb b/owl-bot-staging/google-cloud-secure_source_manager-v1/snippets/secure_source_manager/create_branch_rule.rb deleted file mode 100644 index 81740887a0f5..000000000000 --- a/owl-bot-staging/google-cloud-secure_source_manager-v1/snippets/secure_source_manager/create_branch_rule.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 securesourcemanager_v1_generated_SecureSourceManager_CreateBranchRule_sync] -require "google/cloud/secure_source_manager/v1" - -## -# Snippet for the create_branch_rule call in the SecureSourceManager service -# -# This snippet has been automatically generated and should be regarded as a code -# template only. It will require modifications to work: -# - It may require correct/in-range values for request initialization. -# - It may require specifying regional endpoints when creating the service -# client as shown in https://cloud.google.com/ruby/docs/reference. -# -# This is an auto-generated example demonstrating basic usage of -# Google::Cloud::SecureSourceManager::V1::SecureSourceManager::Client#create_branch_rule. -# -def create_branch_rule - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::SecureSourceManager::V1::SecureSourceManager::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::SecureSourceManager::V1::CreateBranchRuleRequest.new - - # Call the create_branch_rule method. - result = client.create_branch_rule 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 securesourcemanager_v1_generated_SecureSourceManager_CreateBranchRule_sync] diff --git a/owl-bot-staging/google-cloud-secure_source_manager-v1/snippets/secure_source_manager/create_hook.rb b/owl-bot-staging/google-cloud-secure_source_manager-v1/snippets/secure_source_manager/create_hook.rb deleted file mode 100644 index 9ebf7f19e4b0..000000000000 --- a/owl-bot-staging/google-cloud-secure_source_manager-v1/snippets/secure_source_manager/create_hook.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 securesourcemanager_v1_generated_SecureSourceManager_CreateHook_sync] -require "google/cloud/secure_source_manager/v1" - -## -# Snippet for the create_hook call in the SecureSourceManager service -# -# This snippet has been automatically generated and should be regarded as a code -# template only. It will require modifications to work: -# - It may require correct/in-range values for request initialization. -# - It may require specifying regional endpoints when creating the service -# client as shown in https://cloud.google.com/ruby/docs/reference. -# -# This is an auto-generated example demonstrating basic usage of -# Google::Cloud::SecureSourceManager::V1::SecureSourceManager::Client#create_hook. -# -def create_hook - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::SecureSourceManager::V1::SecureSourceManager::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::SecureSourceManager::V1::CreateHookRequest.new - - # Call the create_hook method. - result = client.create_hook 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 securesourcemanager_v1_generated_SecureSourceManager_CreateHook_sync] diff --git a/owl-bot-staging/google-cloud-secure_source_manager-v1/snippets/secure_source_manager/create_instance.rb b/owl-bot-staging/google-cloud-secure_source_manager-v1/snippets/secure_source_manager/create_instance.rb deleted file mode 100644 index d7e6ebc48aea..000000000000 --- a/owl-bot-staging/google-cloud-secure_source_manager-v1/snippets/secure_source_manager/create_instance.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 securesourcemanager_v1_generated_SecureSourceManager_CreateInstance_sync] -require "google/cloud/secure_source_manager/v1" - -## -# Snippet for the create_instance call in the SecureSourceManager service -# -# This snippet has been automatically generated and should be regarded as a code -# template only. It will require modifications to work: -# - It may require correct/in-range values for request initialization. -# - It may require specifying regional endpoints when creating the service -# client as shown in https://cloud.google.com/ruby/docs/reference. -# -# This is an auto-generated example demonstrating basic usage of -# Google::Cloud::SecureSourceManager::V1::SecureSourceManager::Client#create_instance. -# -def create_instance - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::SecureSourceManager::V1::SecureSourceManager::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::SecureSourceManager::V1::CreateInstanceRequest.new - - # Call the create_instance method. - result = client.create_instance 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 securesourcemanager_v1_generated_SecureSourceManager_CreateInstance_sync] diff --git a/owl-bot-staging/google-cloud-secure_source_manager-v1/snippets/secure_source_manager/create_issue.rb b/owl-bot-staging/google-cloud-secure_source_manager-v1/snippets/secure_source_manager/create_issue.rb deleted file mode 100644 index c7ecf6b65771..000000000000 --- a/owl-bot-staging/google-cloud-secure_source_manager-v1/snippets/secure_source_manager/create_issue.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 securesourcemanager_v1_generated_SecureSourceManager_CreateIssue_sync] -require "google/cloud/secure_source_manager/v1" - -## -# Snippet for the create_issue call in the SecureSourceManager service -# -# This snippet has been automatically generated and should be regarded as a code -# template only. It will require modifications to work: -# - It may require correct/in-range values for request initialization. -# - It may require specifying regional endpoints when creating the service -# client as shown in https://cloud.google.com/ruby/docs/reference. -# -# This is an auto-generated example demonstrating basic usage of -# Google::Cloud::SecureSourceManager::V1::SecureSourceManager::Client#create_issue. -# -def create_issue - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::SecureSourceManager::V1::SecureSourceManager::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::SecureSourceManager::V1::CreateIssueRequest.new - - # Call the create_issue method. - result = client.create_issue 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 securesourcemanager_v1_generated_SecureSourceManager_CreateIssue_sync] diff --git a/owl-bot-staging/google-cloud-secure_source_manager-v1/snippets/secure_source_manager/create_issue_comment.rb b/owl-bot-staging/google-cloud-secure_source_manager-v1/snippets/secure_source_manager/create_issue_comment.rb deleted file mode 100644 index 9a392c0b40e5..000000000000 --- a/owl-bot-staging/google-cloud-secure_source_manager-v1/snippets/secure_source_manager/create_issue_comment.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 securesourcemanager_v1_generated_SecureSourceManager_CreateIssueComment_sync] -require "google/cloud/secure_source_manager/v1" - -## -# Snippet for the create_issue_comment call in the SecureSourceManager service -# -# This snippet has been automatically generated and should be regarded as a code -# template only. It will require modifications to work: -# - It may require correct/in-range values for request initialization. -# - It may require specifying regional endpoints when creating the service -# client as shown in https://cloud.google.com/ruby/docs/reference. -# -# This is an auto-generated example demonstrating basic usage of -# Google::Cloud::SecureSourceManager::V1::SecureSourceManager::Client#create_issue_comment. -# -def create_issue_comment - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::SecureSourceManager::V1::SecureSourceManager::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::SecureSourceManager::V1::CreateIssueCommentRequest.new - - # Call the create_issue_comment method. - result = client.create_issue_comment 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 securesourcemanager_v1_generated_SecureSourceManager_CreateIssueComment_sync] diff --git a/owl-bot-staging/google-cloud-secure_source_manager-v1/snippets/secure_source_manager/create_pull_request.rb b/owl-bot-staging/google-cloud-secure_source_manager-v1/snippets/secure_source_manager/create_pull_request.rb deleted file mode 100644 index 96f9276bb3ad..000000000000 --- a/owl-bot-staging/google-cloud-secure_source_manager-v1/snippets/secure_source_manager/create_pull_request.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 securesourcemanager_v1_generated_SecureSourceManager_CreatePullRequest_sync] -require "google/cloud/secure_source_manager/v1" - -## -# Snippet for the create_pull_request call in the SecureSourceManager service -# -# This snippet has been automatically generated and should be regarded as a code -# template only. It will require modifications to work: -# - It may require correct/in-range values for request initialization. -# - It may require specifying regional endpoints when creating the service -# client as shown in https://cloud.google.com/ruby/docs/reference. -# -# This is an auto-generated example demonstrating basic usage of -# Google::Cloud::SecureSourceManager::V1::SecureSourceManager::Client#create_pull_request. -# -def create_pull_request - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::SecureSourceManager::V1::SecureSourceManager::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::SecureSourceManager::V1::CreatePullRequestRequest.new - - # Call the create_pull_request method. - result = client.create_pull_request 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 securesourcemanager_v1_generated_SecureSourceManager_CreatePullRequest_sync] diff --git a/owl-bot-staging/google-cloud-secure_source_manager-v1/snippets/secure_source_manager/create_pull_request_comment.rb b/owl-bot-staging/google-cloud-secure_source_manager-v1/snippets/secure_source_manager/create_pull_request_comment.rb deleted file mode 100644 index 42a6943f1657..000000000000 --- a/owl-bot-staging/google-cloud-secure_source_manager-v1/snippets/secure_source_manager/create_pull_request_comment.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 securesourcemanager_v1_generated_SecureSourceManager_CreatePullRequestComment_sync] -require "google/cloud/secure_source_manager/v1" - -## -# Snippet for the create_pull_request_comment call in the SecureSourceManager service -# -# This snippet has been automatically generated and should be regarded as a code -# template only. It will require modifications to work: -# - It may require correct/in-range values for request initialization. -# - It may require specifying regional endpoints when creating the service -# client as shown in https://cloud.google.com/ruby/docs/reference. -# -# This is an auto-generated example demonstrating basic usage of -# Google::Cloud::SecureSourceManager::V1::SecureSourceManager::Client#create_pull_request_comment. -# -def create_pull_request_comment - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::SecureSourceManager::V1::SecureSourceManager::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::SecureSourceManager::V1::CreatePullRequestCommentRequest.new - - # Call the create_pull_request_comment method. - result = client.create_pull_request_comment 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 securesourcemanager_v1_generated_SecureSourceManager_CreatePullRequestComment_sync] diff --git a/owl-bot-staging/google-cloud-secure_source_manager-v1/snippets/secure_source_manager/create_repository.rb b/owl-bot-staging/google-cloud-secure_source_manager-v1/snippets/secure_source_manager/create_repository.rb deleted file mode 100644 index 8a5c6b9f1c9c..000000000000 --- a/owl-bot-staging/google-cloud-secure_source_manager-v1/snippets/secure_source_manager/create_repository.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 securesourcemanager_v1_generated_SecureSourceManager_CreateRepository_sync] -require "google/cloud/secure_source_manager/v1" - -## -# Snippet for the create_repository call in the SecureSourceManager service -# -# This snippet has been automatically generated and should be regarded as a code -# template only. It will require modifications to work: -# - It may require correct/in-range values for request initialization. -# - It may require specifying regional endpoints when creating the service -# client as shown in https://cloud.google.com/ruby/docs/reference. -# -# This is an auto-generated example demonstrating basic usage of -# Google::Cloud::SecureSourceManager::V1::SecureSourceManager::Client#create_repository. -# -def create_repository - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::SecureSourceManager::V1::SecureSourceManager::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::SecureSourceManager::V1::CreateRepositoryRequest.new - - # Call the create_repository method. - result = client.create_repository 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 securesourcemanager_v1_generated_SecureSourceManager_CreateRepository_sync] diff --git a/owl-bot-staging/google-cloud-secure_source_manager-v1/snippets/secure_source_manager/delete_branch_rule.rb b/owl-bot-staging/google-cloud-secure_source_manager-v1/snippets/secure_source_manager/delete_branch_rule.rb deleted file mode 100644 index 7be487c5cd28..000000000000 --- a/owl-bot-staging/google-cloud-secure_source_manager-v1/snippets/secure_source_manager/delete_branch_rule.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 securesourcemanager_v1_generated_SecureSourceManager_DeleteBranchRule_sync] -require "google/cloud/secure_source_manager/v1" - -## -# Snippet for the delete_branch_rule call in the SecureSourceManager service -# -# This snippet has been automatically generated and should be regarded as a code -# template only. It will require modifications to work: -# - It may require correct/in-range values for request initialization. -# - It may require specifying regional endpoints when creating the service -# client as shown in https://cloud.google.com/ruby/docs/reference. -# -# This is an auto-generated example demonstrating basic usage of -# Google::Cloud::SecureSourceManager::V1::SecureSourceManager::Client#delete_branch_rule. -# -def delete_branch_rule - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::SecureSourceManager::V1::SecureSourceManager::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::SecureSourceManager::V1::DeleteBranchRuleRequest.new - - # Call the delete_branch_rule method. - result = client.delete_branch_rule 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 securesourcemanager_v1_generated_SecureSourceManager_DeleteBranchRule_sync] diff --git a/owl-bot-staging/google-cloud-secure_source_manager-v1/snippets/secure_source_manager/delete_hook.rb b/owl-bot-staging/google-cloud-secure_source_manager-v1/snippets/secure_source_manager/delete_hook.rb deleted file mode 100644 index bb832a22960e..000000000000 --- a/owl-bot-staging/google-cloud-secure_source_manager-v1/snippets/secure_source_manager/delete_hook.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 securesourcemanager_v1_generated_SecureSourceManager_DeleteHook_sync] -require "google/cloud/secure_source_manager/v1" - -## -# Snippet for the delete_hook call in the SecureSourceManager service -# -# This snippet has been automatically generated and should be regarded as a code -# template only. It will require modifications to work: -# - It may require correct/in-range values for request initialization. -# - It may require specifying regional endpoints when creating the service -# client as shown in https://cloud.google.com/ruby/docs/reference. -# -# This is an auto-generated example demonstrating basic usage of -# Google::Cloud::SecureSourceManager::V1::SecureSourceManager::Client#delete_hook. -# -def delete_hook - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::SecureSourceManager::V1::SecureSourceManager::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::SecureSourceManager::V1::DeleteHookRequest.new - - # Call the delete_hook method. - result = client.delete_hook 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 securesourcemanager_v1_generated_SecureSourceManager_DeleteHook_sync] diff --git a/owl-bot-staging/google-cloud-secure_source_manager-v1/snippets/secure_source_manager/delete_instance.rb b/owl-bot-staging/google-cloud-secure_source_manager-v1/snippets/secure_source_manager/delete_instance.rb deleted file mode 100644 index 3846d75b48de..000000000000 --- a/owl-bot-staging/google-cloud-secure_source_manager-v1/snippets/secure_source_manager/delete_instance.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 securesourcemanager_v1_generated_SecureSourceManager_DeleteInstance_sync] -require "google/cloud/secure_source_manager/v1" - -## -# Snippet for the delete_instance call in the SecureSourceManager service -# -# This snippet has been automatically generated and should be regarded as a code -# template only. It will require modifications to work: -# - It may require correct/in-range values for request initialization. -# - It may require specifying regional endpoints when creating the service -# client as shown in https://cloud.google.com/ruby/docs/reference. -# -# This is an auto-generated example demonstrating basic usage of -# Google::Cloud::SecureSourceManager::V1::SecureSourceManager::Client#delete_instance. -# -def delete_instance - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::SecureSourceManager::V1::SecureSourceManager::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::SecureSourceManager::V1::DeleteInstanceRequest.new - - # Call the delete_instance method. - result = client.delete_instance 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 securesourcemanager_v1_generated_SecureSourceManager_DeleteInstance_sync] diff --git a/owl-bot-staging/google-cloud-secure_source_manager-v1/snippets/secure_source_manager/delete_issue.rb b/owl-bot-staging/google-cloud-secure_source_manager-v1/snippets/secure_source_manager/delete_issue.rb deleted file mode 100644 index 97ae38f29b45..000000000000 --- a/owl-bot-staging/google-cloud-secure_source_manager-v1/snippets/secure_source_manager/delete_issue.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 securesourcemanager_v1_generated_SecureSourceManager_DeleteIssue_sync] -require "google/cloud/secure_source_manager/v1" - -## -# Snippet for the delete_issue call in the SecureSourceManager service -# -# This snippet has been automatically generated and should be regarded as a code -# template only. It will require modifications to work: -# - It may require correct/in-range values for request initialization. -# - It may require specifying regional endpoints when creating the service -# client as shown in https://cloud.google.com/ruby/docs/reference. -# -# This is an auto-generated example demonstrating basic usage of -# Google::Cloud::SecureSourceManager::V1::SecureSourceManager::Client#delete_issue. -# -def delete_issue - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::SecureSourceManager::V1::SecureSourceManager::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::SecureSourceManager::V1::DeleteIssueRequest.new - - # Call the delete_issue method. - result = client.delete_issue 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 securesourcemanager_v1_generated_SecureSourceManager_DeleteIssue_sync] diff --git a/owl-bot-staging/google-cloud-secure_source_manager-v1/snippets/secure_source_manager/delete_issue_comment.rb b/owl-bot-staging/google-cloud-secure_source_manager-v1/snippets/secure_source_manager/delete_issue_comment.rb deleted file mode 100644 index 7d4cf8df2226..000000000000 --- a/owl-bot-staging/google-cloud-secure_source_manager-v1/snippets/secure_source_manager/delete_issue_comment.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 securesourcemanager_v1_generated_SecureSourceManager_DeleteIssueComment_sync] -require "google/cloud/secure_source_manager/v1" - -## -# Snippet for the delete_issue_comment call in the SecureSourceManager service -# -# This snippet has been automatically generated and should be regarded as a code -# template only. It will require modifications to work: -# - It may require correct/in-range values for request initialization. -# - It may require specifying regional endpoints when creating the service -# client as shown in https://cloud.google.com/ruby/docs/reference. -# -# This is an auto-generated example demonstrating basic usage of -# Google::Cloud::SecureSourceManager::V1::SecureSourceManager::Client#delete_issue_comment. -# -def delete_issue_comment - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::SecureSourceManager::V1::SecureSourceManager::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::SecureSourceManager::V1::DeleteIssueCommentRequest.new - - # Call the delete_issue_comment method. - result = client.delete_issue_comment 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 securesourcemanager_v1_generated_SecureSourceManager_DeleteIssueComment_sync] diff --git a/owl-bot-staging/google-cloud-secure_source_manager-v1/snippets/secure_source_manager/delete_pull_request_comment.rb b/owl-bot-staging/google-cloud-secure_source_manager-v1/snippets/secure_source_manager/delete_pull_request_comment.rb deleted file mode 100644 index 9b109842de87..000000000000 --- a/owl-bot-staging/google-cloud-secure_source_manager-v1/snippets/secure_source_manager/delete_pull_request_comment.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 securesourcemanager_v1_generated_SecureSourceManager_DeletePullRequestComment_sync] -require "google/cloud/secure_source_manager/v1" - -## -# Snippet for the delete_pull_request_comment call in the SecureSourceManager service -# -# This snippet has been automatically generated and should be regarded as a code -# template only. It will require modifications to work: -# - It may require correct/in-range values for request initialization. -# - It may require specifying regional endpoints when creating the service -# client as shown in https://cloud.google.com/ruby/docs/reference. -# -# This is an auto-generated example demonstrating basic usage of -# Google::Cloud::SecureSourceManager::V1::SecureSourceManager::Client#delete_pull_request_comment. -# -def delete_pull_request_comment - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::SecureSourceManager::V1::SecureSourceManager::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::SecureSourceManager::V1::DeletePullRequestCommentRequest.new - - # Call the delete_pull_request_comment method. - result = client.delete_pull_request_comment 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 securesourcemanager_v1_generated_SecureSourceManager_DeletePullRequestComment_sync] diff --git a/owl-bot-staging/google-cloud-secure_source_manager-v1/snippets/secure_source_manager/delete_repository.rb b/owl-bot-staging/google-cloud-secure_source_manager-v1/snippets/secure_source_manager/delete_repository.rb deleted file mode 100644 index 5ac51c078de8..000000000000 --- a/owl-bot-staging/google-cloud-secure_source_manager-v1/snippets/secure_source_manager/delete_repository.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 securesourcemanager_v1_generated_SecureSourceManager_DeleteRepository_sync] -require "google/cloud/secure_source_manager/v1" - -## -# Snippet for the delete_repository call in the SecureSourceManager service -# -# This snippet has been automatically generated and should be regarded as a code -# template only. It will require modifications to work: -# - It may require correct/in-range values for request initialization. -# - It may require specifying regional endpoints when creating the service -# client as shown in https://cloud.google.com/ruby/docs/reference. -# -# This is an auto-generated example demonstrating basic usage of -# Google::Cloud::SecureSourceManager::V1::SecureSourceManager::Client#delete_repository. -# -def delete_repository - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::SecureSourceManager::V1::SecureSourceManager::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::SecureSourceManager::V1::DeleteRepositoryRequest.new - - # Call the delete_repository method. - result = client.delete_repository 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 securesourcemanager_v1_generated_SecureSourceManager_DeleteRepository_sync] diff --git a/owl-bot-staging/google-cloud-secure_source_manager-v1/snippets/secure_source_manager/fetch_blob.rb b/owl-bot-staging/google-cloud-secure_source_manager-v1/snippets/secure_source_manager/fetch_blob.rb deleted file mode 100644 index cf6d2c9e3b39..000000000000 --- a/owl-bot-staging/google-cloud-secure_source_manager-v1/snippets/secure_source_manager/fetch_blob.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 securesourcemanager_v1_generated_SecureSourceManager_FetchBlob_sync] -require "google/cloud/secure_source_manager/v1" - -## -# Snippet for the fetch_blob call in the SecureSourceManager service -# -# This snippet has been automatically generated and should be regarded as a code -# template only. It will require modifications to work: -# - It may require correct/in-range values for request initialization. -# - It may require specifying regional endpoints when creating the service -# client as shown in https://cloud.google.com/ruby/docs/reference. -# -# This is an auto-generated example demonstrating basic usage of -# Google::Cloud::SecureSourceManager::V1::SecureSourceManager::Client#fetch_blob. -# -def fetch_blob - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::SecureSourceManager::V1::SecureSourceManager::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::SecureSourceManager::V1::FetchBlobRequest.new - - # Call the fetch_blob method. - result = client.fetch_blob request - - # The returned object is of type Google::Cloud::SecureSourceManager::V1::FetchBlobResponse. - p result -end -# [END securesourcemanager_v1_generated_SecureSourceManager_FetchBlob_sync] diff --git a/owl-bot-staging/google-cloud-secure_source_manager-v1/snippets/secure_source_manager/fetch_tree.rb b/owl-bot-staging/google-cloud-secure_source_manager-v1/snippets/secure_source_manager/fetch_tree.rb deleted file mode 100644 index f44b00813d69..000000000000 --- a/owl-bot-staging/google-cloud-secure_source_manager-v1/snippets/secure_source_manager/fetch_tree.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 securesourcemanager_v1_generated_SecureSourceManager_FetchTree_sync] -require "google/cloud/secure_source_manager/v1" - -## -# Snippet for the fetch_tree call in the SecureSourceManager service -# -# This snippet has been automatically generated and should be regarded as a code -# template only. It will require modifications to work: -# - It may require correct/in-range values for request initialization. -# - It may require specifying regional endpoints when creating the service -# client as shown in https://cloud.google.com/ruby/docs/reference. -# -# This is an auto-generated example demonstrating basic usage of -# Google::Cloud::SecureSourceManager::V1::SecureSourceManager::Client#fetch_tree. -# -def fetch_tree - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::SecureSourceManager::V1::SecureSourceManager::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::SecureSourceManager::V1::FetchTreeRequest.new - - # Call the fetch_tree method. - result = client.fetch_tree request - - # The returned object is of type Gapic::PagedEnumerable. You can iterate - # over elements, and API calls will be issued to fetch pages as needed. - result.each do |item| - # Each element is of type ::Google::Cloud::SecureSourceManager::V1::TreeEntry. - p item - end -end -# [END securesourcemanager_v1_generated_SecureSourceManager_FetchTree_sync] diff --git a/owl-bot-staging/google-cloud-secure_source_manager-v1/snippets/secure_source_manager/get_branch_rule.rb b/owl-bot-staging/google-cloud-secure_source_manager-v1/snippets/secure_source_manager/get_branch_rule.rb deleted file mode 100644 index f34587a87d48..000000000000 --- a/owl-bot-staging/google-cloud-secure_source_manager-v1/snippets/secure_source_manager/get_branch_rule.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 securesourcemanager_v1_generated_SecureSourceManager_GetBranchRule_sync] -require "google/cloud/secure_source_manager/v1" - -## -# Snippet for the get_branch_rule call in the SecureSourceManager service -# -# This snippet has been automatically generated and should be regarded as a code -# template only. It will require modifications to work: -# - It may require correct/in-range values for request initialization. -# - It may require specifying regional endpoints when creating the service -# client as shown in https://cloud.google.com/ruby/docs/reference. -# -# This is an auto-generated example demonstrating basic usage of -# Google::Cloud::SecureSourceManager::V1::SecureSourceManager::Client#get_branch_rule. -# -def get_branch_rule - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::SecureSourceManager::V1::SecureSourceManager::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::SecureSourceManager::V1::GetBranchRuleRequest.new - - # Call the get_branch_rule method. - result = client.get_branch_rule request - - # The returned object is of type Google::Cloud::SecureSourceManager::V1::BranchRule. - p result -end -# [END securesourcemanager_v1_generated_SecureSourceManager_GetBranchRule_sync] diff --git a/owl-bot-staging/google-cloud-secure_source_manager-v1/snippets/secure_source_manager/get_hook.rb b/owl-bot-staging/google-cloud-secure_source_manager-v1/snippets/secure_source_manager/get_hook.rb deleted file mode 100644 index 7e6782e5a4ad..000000000000 --- a/owl-bot-staging/google-cloud-secure_source_manager-v1/snippets/secure_source_manager/get_hook.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 securesourcemanager_v1_generated_SecureSourceManager_GetHook_sync] -require "google/cloud/secure_source_manager/v1" - -## -# Snippet for the get_hook call in the SecureSourceManager service -# -# This snippet has been automatically generated and should be regarded as a code -# template only. It will require modifications to work: -# - It may require correct/in-range values for request initialization. -# - It may require specifying regional endpoints when creating the service -# client as shown in https://cloud.google.com/ruby/docs/reference. -# -# This is an auto-generated example demonstrating basic usage of -# Google::Cloud::SecureSourceManager::V1::SecureSourceManager::Client#get_hook. -# -def get_hook - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::SecureSourceManager::V1::SecureSourceManager::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::SecureSourceManager::V1::GetHookRequest.new - - # Call the get_hook method. - result = client.get_hook request - - # The returned object is of type Google::Cloud::SecureSourceManager::V1::Hook. - p result -end -# [END securesourcemanager_v1_generated_SecureSourceManager_GetHook_sync] diff --git a/owl-bot-staging/google-cloud-secure_source_manager-v1/snippets/secure_source_manager/get_iam_policy_repo.rb b/owl-bot-staging/google-cloud-secure_source_manager-v1/snippets/secure_source_manager/get_iam_policy_repo.rb deleted file mode 100644 index e9ce8413832f..000000000000 --- a/owl-bot-staging/google-cloud-secure_source_manager-v1/snippets/secure_source_manager/get_iam_policy_repo.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 securesourcemanager_v1_generated_SecureSourceManager_GetIamPolicyRepo_sync] -require "google/cloud/secure_source_manager/v1" - -## -# Snippet for the get_iam_policy_repo call in the SecureSourceManager service -# -# This snippet has been automatically generated and should be regarded as a code -# template only. It will require modifications to work: -# - It may require correct/in-range values for request initialization. -# - It may require specifying regional endpoints when creating the service -# client as shown in https://cloud.google.com/ruby/docs/reference. -# -# This is an auto-generated example demonstrating basic usage of -# Google::Cloud::SecureSourceManager::V1::SecureSourceManager::Client#get_iam_policy_repo. -# -def get_iam_policy_repo - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::SecureSourceManager::V1::SecureSourceManager::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Iam::V1::GetIamPolicyRequest.new - - # Call the get_iam_policy_repo method. - result = client.get_iam_policy_repo request - - # The returned object is of type Google::Iam::V1::Policy. - p result -end -# [END securesourcemanager_v1_generated_SecureSourceManager_GetIamPolicyRepo_sync] diff --git a/owl-bot-staging/google-cloud-secure_source_manager-v1/snippets/secure_source_manager/get_instance.rb b/owl-bot-staging/google-cloud-secure_source_manager-v1/snippets/secure_source_manager/get_instance.rb deleted file mode 100644 index 36213b70cd2b..000000000000 --- a/owl-bot-staging/google-cloud-secure_source_manager-v1/snippets/secure_source_manager/get_instance.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 securesourcemanager_v1_generated_SecureSourceManager_GetInstance_sync] -require "google/cloud/secure_source_manager/v1" - -## -# Snippet for the get_instance call in the SecureSourceManager service -# -# This snippet has been automatically generated and should be regarded as a code -# template only. It will require modifications to work: -# - It may require correct/in-range values for request initialization. -# - It may require specifying regional endpoints when creating the service -# client as shown in https://cloud.google.com/ruby/docs/reference. -# -# This is an auto-generated example demonstrating basic usage of -# Google::Cloud::SecureSourceManager::V1::SecureSourceManager::Client#get_instance. -# -def get_instance - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::SecureSourceManager::V1::SecureSourceManager::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::SecureSourceManager::V1::GetInstanceRequest.new - - # Call the get_instance method. - result = client.get_instance request - - # The returned object is of type Google::Cloud::SecureSourceManager::V1::Instance. - p result -end -# [END securesourcemanager_v1_generated_SecureSourceManager_GetInstance_sync] diff --git a/owl-bot-staging/google-cloud-secure_source_manager-v1/snippets/secure_source_manager/get_issue.rb b/owl-bot-staging/google-cloud-secure_source_manager-v1/snippets/secure_source_manager/get_issue.rb deleted file mode 100644 index a00d369904cc..000000000000 --- a/owl-bot-staging/google-cloud-secure_source_manager-v1/snippets/secure_source_manager/get_issue.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 securesourcemanager_v1_generated_SecureSourceManager_GetIssue_sync] -require "google/cloud/secure_source_manager/v1" - -## -# Snippet for the get_issue call in the SecureSourceManager service -# -# This snippet has been automatically generated and should be regarded as a code -# template only. It will require modifications to work: -# - It may require correct/in-range values for request initialization. -# - It may require specifying regional endpoints when creating the service -# client as shown in https://cloud.google.com/ruby/docs/reference. -# -# This is an auto-generated example demonstrating basic usage of -# Google::Cloud::SecureSourceManager::V1::SecureSourceManager::Client#get_issue. -# -def get_issue - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::SecureSourceManager::V1::SecureSourceManager::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::SecureSourceManager::V1::GetIssueRequest.new - - # Call the get_issue method. - result = client.get_issue request - - # The returned object is of type Google::Cloud::SecureSourceManager::V1::Issue. - p result -end -# [END securesourcemanager_v1_generated_SecureSourceManager_GetIssue_sync] diff --git a/owl-bot-staging/google-cloud-secure_source_manager-v1/snippets/secure_source_manager/get_issue_comment.rb b/owl-bot-staging/google-cloud-secure_source_manager-v1/snippets/secure_source_manager/get_issue_comment.rb deleted file mode 100644 index d72bb362175a..000000000000 --- a/owl-bot-staging/google-cloud-secure_source_manager-v1/snippets/secure_source_manager/get_issue_comment.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 securesourcemanager_v1_generated_SecureSourceManager_GetIssueComment_sync] -require "google/cloud/secure_source_manager/v1" - -## -# Snippet for the get_issue_comment call in the SecureSourceManager service -# -# This snippet has been automatically generated and should be regarded as a code -# template only. It will require modifications to work: -# - It may require correct/in-range values for request initialization. -# - It may require specifying regional endpoints when creating the service -# client as shown in https://cloud.google.com/ruby/docs/reference. -# -# This is an auto-generated example demonstrating basic usage of -# Google::Cloud::SecureSourceManager::V1::SecureSourceManager::Client#get_issue_comment. -# -def get_issue_comment - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::SecureSourceManager::V1::SecureSourceManager::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::SecureSourceManager::V1::GetIssueCommentRequest.new - - # Call the get_issue_comment method. - result = client.get_issue_comment request - - # The returned object is of type Google::Cloud::SecureSourceManager::V1::IssueComment. - p result -end -# [END securesourcemanager_v1_generated_SecureSourceManager_GetIssueComment_sync] diff --git a/owl-bot-staging/google-cloud-secure_source_manager-v1/snippets/secure_source_manager/get_pull_request.rb b/owl-bot-staging/google-cloud-secure_source_manager-v1/snippets/secure_source_manager/get_pull_request.rb deleted file mode 100644 index 99294fe78a70..000000000000 --- a/owl-bot-staging/google-cloud-secure_source_manager-v1/snippets/secure_source_manager/get_pull_request.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 securesourcemanager_v1_generated_SecureSourceManager_GetPullRequest_sync] -require "google/cloud/secure_source_manager/v1" - -## -# Snippet for the get_pull_request call in the SecureSourceManager service -# -# This snippet has been automatically generated and should be regarded as a code -# template only. It will require modifications to work: -# - It may require correct/in-range values for request initialization. -# - It may require specifying regional endpoints when creating the service -# client as shown in https://cloud.google.com/ruby/docs/reference. -# -# This is an auto-generated example demonstrating basic usage of -# Google::Cloud::SecureSourceManager::V1::SecureSourceManager::Client#get_pull_request. -# -def get_pull_request - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::SecureSourceManager::V1::SecureSourceManager::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::SecureSourceManager::V1::GetPullRequestRequest.new - - # Call the get_pull_request method. - result = client.get_pull_request request - - # The returned object is of type Google::Cloud::SecureSourceManager::V1::PullRequest. - p result -end -# [END securesourcemanager_v1_generated_SecureSourceManager_GetPullRequest_sync] diff --git a/owl-bot-staging/google-cloud-secure_source_manager-v1/snippets/secure_source_manager/get_pull_request_comment.rb b/owl-bot-staging/google-cloud-secure_source_manager-v1/snippets/secure_source_manager/get_pull_request_comment.rb deleted file mode 100644 index b353146f2611..000000000000 --- a/owl-bot-staging/google-cloud-secure_source_manager-v1/snippets/secure_source_manager/get_pull_request_comment.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 securesourcemanager_v1_generated_SecureSourceManager_GetPullRequestComment_sync] -require "google/cloud/secure_source_manager/v1" - -## -# Snippet for the get_pull_request_comment call in the SecureSourceManager service -# -# This snippet has been automatically generated and should be regarded as a code -# template only. It will require modifications to work: -# - It may require correct/in-range values for request initialization. -# - It may require specifying regional endpoints when creating the service -# client as shown in https://cloud.google.com/ruby/docs/reference. -# -# This is an auto-generated example demonstrating basic usage of -# Google::Cloud::SecureSourceManager::V1::SecureSourceManager::Client#get_pull_request_comment. -# -def get_pull_request_comment - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::SecureSourceManager::V1::SecureSourceManager::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::SecureSourceManager::V1::GetPullRequestCommentRequest.new - - # Call the get_pull_request_comment method. - result = client.get_pull_request_comment request - - # The returned object is of type Google::Cloud::SecureSourceManager::V1::PullRequestComment. - p result -end -# [END securesourcemanager_v1_generated_SecureSourceManager_GetPullRequestComment_sync] diff --git a/owl-bot-staging/google-cloud-secure_source_manager-v1/snippets/secure_source_manager/get_repository.rb b/owl-bot-staging/google-cloud-secure_source_manager-v1/snippets/secure_source_manager/get_repository.rb deleted file mode 100644 index c061ef825149..000000000000 --- a/owl-bot-staging/google-cloud-secure_source_manager-v1/snippets/secure_source_manager/get_repository.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 securesourcemanager_v1_generated_SecureSourceManager_GetRepository_sync] -require "google/cloud/secure_source_manager/v1" - -## -# Snippet for the get_repository call in the SecureSourceManager service -# -# This snippet has been automatically generated and should be regarded as a code -# template only. It will require modifications to work: -# - It may require correct/in-range values for request initialization. -# - It may require specifying regional endpoints when creating the service -# client as shown in https://cloud.google.com/ruby/docs/reference. -# -# This is an auto-generated example demonstrating basic usage of -# Google::Cloud::SecureSourceManager::V1::SecureSourceManager::Client#get_repository. -# -def get_repository - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::SecureSourceManager::V1::SecureSourceManager::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::SecureSourceManager::V1::GetRepositoryRequest.new - - # Call the get_repository method. - result = client.get_repository request - - # The returned object is of type Google::Cloud::SecureSourceManager::V1::Repository. - p result -end -# [END securesourcemanager_v1_generated_SecureSourceManager_GetRepository_sync] diff --git a/owl-bot-staging/google-cloud-secure_source_manager-v1/snippets/secure_source_manager/list_branch_rules.rb b/owl-bot-staging/google-cloud-secure_source_manager-v1/snippets/secure_source_manager/list_branch_rules.rb deleted file mode 100644 index 00499c4f7fe8..000000000000 --- a/owl-bot-staging/google-cloud-secure_source_manager-v1/snippets/secure_source_manager/list_branch_rules.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 securesourcemanager_v1_generated_SecureSourceManager_ListBranchRules_sync] -require "google/cloud/secure_source_manager/v1" - -## -# Snippet for the list_branch_rules call in the SecureSourceManager service -# -# This snippet has been automatically generated and should be regarded as a code -# template only. It will require modifications to work: -# - It may require correct/in-range values for request initialization. -# - It may require specifying regional endpoints when creating the service -# client as shown in https://cloud.google.com/ruby/docs/reference. -# -# This is an auto-generated example demonstrating basic usage of -# Google::Cloud::SecureSourceManager::V1::SecureSourceManager::Client#list_branch_rules. -# -def list_branch_rules - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::SecureSourceManager::V1::SecureSourceManager::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::SecureSourceManager::V1::ListBranchRulesRequest.new - - # Call the list_branch_rules method. - result = client.list_branch_rules request - - # The returned object is of type Gapic::PagedEnumerable. You can iterate - # over elements, and API calls will be issued to fetch pages as needed. - result.each do |item| - # Each element is of type ::Google::Cloud::SecureSourceManager::V1::BranchRule. - p item - end -end -# [END securesourcemanager_v1_generated_SecureSourceManager_ListBranchRules_sync] diff --git a/owl-bot-staging/google-cloud-secure_source_manager-v1/snippets/secure_source_manager/list_hooks.rb b/owl-bot-staging/google-cloud-secure_source_manager-v1/snippets/secure_source_manager/list_hooks.rb deleted file mode 100644 index bdd7fcb4c869..000000000000 --- a/owl-bot-staging/google-cloud-secure_source_manager-v1/snippets/secure_source_manager/list_hooks.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 securesourcemanager_v1_generated_SecureSourceManager_ListHooks_sync] -require "google/cloud/secure_source_manager/v1" - -## -# Snippet for the list_hooks call in the SecureSourceManager service -# -# This snippet has been automatically generated and should be regarded as a code -# template only. It will require modifications to work: -# - It may require correct/in-range values for request initialization. -# - It may require specifying regional endpoints when creating the service -# client as shown in https://cloud.google.com/ruby/docs/reference. -# -# This is an auto-generated example demonstrating basic usage of -# Google::Cloud::SecureSourceManager::V1::SecureSourceManager::Client#list_hooks. -# -def list_hooks - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::SecureSourceManager::V1::SecureSourceManager::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::SecureSourceManager::V1::ListHooksRequest.new - - # Call the list_hooks method. - result = client.list_hooks request - - # The returned object is of type Gapic::PagedEnumerable. You can iterate - # over elements, and API calls will be issued to fetch pages as needed. - result.each do |item| - # Each element is of type ::Google::Cloud::SecureSourceManager::V1::Hook. - p item - end -end -# [END securesourcemanager_v1_generated_SecureSourceManager_ListHooks_sync] diff --git a/owl-bot-staging/google-cloud-secure_source_manager-v1/snippets/secure_source_manager/list_instances.rb b/owl-bot-staging/google-cloud-secure_source_manager-v1/snippets/secure_source_manager/list_instances.rb deleted file mode 100644 index a0635c75ef14..000000000000 --- a/owl-bot-staging/google-cloud-secure_source_manager-v1/snippets/secure_source_manager/list_instances.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 securesourcemanager_v1_generated_SecureSourceManager_ListInstances_sync] -require "google/cloud/secure_source_manager/v1" - -## -# Snippet for the list_instances call in the SecureSourceManager service -# -# This snippet has been automatically generated and should be regarded as a code -# template only. It will require modifications to work: -# - It may require correct/in-range values for request initialization. -# - It may require specifying regional endpoints when creating the service -# client as shown in https://cloud.google.com/ruby/docs/reference. -# -# This is an auto-generated example demonstrating basic usage of -# Google::Cloud::SecureSourceManager::V1::SecureSourceManager::Client#list_instances. -# -def list_instances - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::SecureSourceManager::V1::SecureSourceManager::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::SecureSourceManager::V1::ListInstancesRequest.new - - # Call the list_instances method. - result = client.list_instances request - - # The returned object is of type Gapic::PagedEnumerable. You can iterate - # over elements, and API calls will be issued to fetch pages as needed. - result.each do |item| - # Each element is of type ::Google::Cloud::SecureSourceManager::V1::Instance. - p item - end -end -# [END securesourcemanager_v1_generated_SecureSourceManager_ListInstances_sync] diff --git a/owl-bot-staging/google-cloud-secure_source_manager-v1/snippets/secure_source_manager/list_issue_comments.rb b/owl-bot-staging/google-cloud-secure_source_manager-v1/snippets/secure_source_manager/list_issue_comments.rb deleted file mode 100644 index c67d4b141f75..000000000000 --- a/owl-bot-staging/google-cloud-secure_source_manager-v1/snippets/secure_source_manager/list_issue_comments.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 securesourcemanager_v1_generated_SecureSourceManager_ListIssueComments_sync] -require "google/cloud/secure_source_manager/v1" - -## -# Snippet for the list_issue_comments call in the SecureSourceManager service -# -# This snippet has been automatically generated and should be regarded as a code -# template only. It will require modifications to work: -# - It may require correct/in-range values for request initialization. -# - It may require specifying regional endpoints when creating the service -# client as shown in https://cloud.google.com/ruby/docs/reference. -# -# This is an auto-generated example demonstrating basic usage of -# Google::Cloud::SecureSourceManager::V1::SecureSourceManager::Client#list_issue_comments. -# -def list_issue_comments - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::SecureSourceManager::V1::SecureSourceManager::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::SecureSourceManager::V1::ListIssueCommentsRequest.new - - # Call the list_issue_comments method. - result = client.list_issue_comments request - - # The returned object is of type Gapic::PagedEnumerable. You can iterate - # over elements, and API calls will be issued to fetch pages as needed. - result.each do |item| - # Each element is of type ::Google::Cloud::SecureSourceManager::V1::IssueComment. - p item - end -end -# [END securesourcemanager_v1_generated_SecureSourceManager_ListIssueComments_sync] diff --git a/owl-bot-staging/google-cloud-secure_source_manager-v1/snippets/secure_source_manager/list_issues.rb b/owl-bot-staging/google-cloud-secure_source_manager-v1/snippets/secure_source_manager/list_issues.rb deleted file mode 100644 index 1d06ffba7fd6..000000000000 --- a/owl-bot-staging/google-cloud-secure_source_manager-v1/snippets/secure_source_manager/list_issues.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 securesourcemanager_v1_generated_SecureSourceManager_ListIssues_sync] -require "google/cloud/secure_source_manager/v1" - -## -# Snippet for the list_issues call in the SecureSourceManager service -# -# This snippet has been automatically generated and should be regarded as a code -# template only. It will require modifications to work: -# - It may require correct/in-range values for request initialization. -# - It may require specifying regional endpoints when creating the service -# client as shown in https://cloud.google.com/ruby/docs/reference. -# -# This is an auto-generated example demonstrating basic usage of -# Google::Cloud::SecureSourceManager::V1::SecureSourceManager::Client#list_issues. -# -def list_issues - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::SecureSourceManager::V1::SecureSourceManager::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::SecureSourceManager::V1::ListIssuesRequest.new - - # Call the list_issues method. - result = client.list_issues request - - # The returned object is of type Gapic::PagedEnumerable. You can iterate - # over elements, and API calls will be issued to fetch pages as needed. - result.each do |item| - # Each element is of type ::Google::Cloud::SecureSourceManager::V1::Issue. - p item - end -end -# [END securesourcemanager_v1_generated_SecureSourceManager_ListIssues_sync] diff --git a/owl-bot-staging/google-cloud-secure_source_manager-v1/snippets/secure_source_manager/list_pull_request_comments.rb b/owl-bot-staging/google-cloud-secure_source_manager-v1/snippets/secure_source_manager/list_pull_request_comments.rb deleted file mode 100644 index e27942c2285c..000000000000 --- a/owl-bot-staging/google-cloud-secure_source_manager-v1/snippets/secure_source_manager/list_pull_request_comments.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 securesourcemanager_v1_generated_SecureSourceManager_ListPullRequestComments_sync] -require "google/cloud/secure_source_manager/v1" - -## -# Snippet for the list_pull_request_comments call in the SecureSourceManager service -# -# This snippet has been automatically generated and should be regarded as a code -# template only. It will require modifications to work: -# - It may require correct/in-range values for request initialization. -# - It may require specifying regional endpoints when creating the service -# client as shown in https://cloud.google.com/ruby/docs/reference. -# -# This is an auto-generated example demonstrating basic usage of -# Google::Cloud::SecureSourceManager::V1::SecureSourceManager::Client#list_pull_request_comments. -# -def list_pull_request_comments - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::SecureSourceManager::V1::SecureSourceManager::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::SecureSourceManager::V1::ListPullRequestCommentsRequest.new - - # Call the list_pull_request_comments method. - result = client.list_pull_request_comments request - - # The returned object is of type Gapic::PagedEnumerable. You can iterate - # over elements, and API calls will be issued to fetch pages as needed. - result.each do |item| - # Each element is of type ::Google::Cloud::SecureSourceManager::V1::PullRequestComment. - p item - end -end -# [END securesourcemanager_v1_generated_SecureSourceManager_ListPullRequestComments_sync] diff --git a/owl-bot-staging/google-cloud-secure_source_manager-v1/snippets/secure_source_manager/list_pull_request_file_diffs.rb b/owl-bot-staging/google-cloud-secure_source_manager-v1/snippets/secure_source_manager/list_pull_request_file_diffs.rb deleted file mode 100644 index ee7f1fb85eee..000000000000 --- a/owl-bot-staging/google-cloud-secure_source_manager-v1/snippets/secure_source_manager/list_pull_request_file_diffs.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 securesourcemanager_v1_generated_SecureSourceManager_ListPullRequestFileDiffs_sync] -require "google/cloud/secure_source_manager/v1" - -## -# Snippet for the list_pull_request_file_diffs call in the SecureSourceManager service -# -# This snippet has been automatically generated and should be regarded as a code -# template only. It will require modifications to work: -# - It may require correct/in-range values for request initialization. -# - It may require specifying regional endpoints when creating the service -# client as shown in https://cloud.google.com/ruby/docs/reference. -# -# This is an auto-generated example demonstrating basic usage of -# Google::Cloud::SecureSourceManager::V1::SecureSourceManager::Client#list_pull_request_file_diffs. -# -def list_pull_request_file_diffs - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::SecureSourceManager::V1::SecureSourceManager::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::SecureSourceManager::V1::ListPullRequestFileDiffsRequest.new - - # Call the list_pull_request_file_diffs method. - result = client.list_pull_request_file_diffs request - - # The returned object is of type Gapic::PagedEnumerable. You can iterate - # over elements, and API calls will be issued to fetch pages as needed. - result.each do |item| - # Each element is of type ::Google::Cloud::SecureSourceManager::V1::FileDiff. - p item - end -end -# [END securesourcemanager_v1_generated_SecureSourceManager_ListPullRequestFileDiffs_sync] diff --git a/owl-bot-staging/google-cloud-secure_source_manager-v1/snippets/secure_source_manager/list_pull_requests.rb b/owl-bot-staging/google-cloud-secure_source_manager-v1/snippets/secure_source_manager/list_pull_requests.rb deleted file mode 100644 index 7d7b6c3956a6..000000000000 --- a/owl-bot-staging/google-cloud-secure_source_manager-v1/snippets/secure_source_manager/list_pull_requests.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 securesourcemanager_v1_generated_SecureSourceManager_ListPullRequests_sync] -require "google/cloud/secure_source_manager/v1" - -## -# Snippet for the list_pull_requests call in the SecureSourceManager service -# -# This snippet has been automatically generated and should be regarded as a code -# template only. It will require modifications to work: -# - It may require correct/in-range values for request initialization. -# - It may require specifying regional endpoints when creating the service -# client as shown in https://cloud.google.com/ruby/docs/reference. -# -# This is an auto-generated example demonstrating basic usage of -# Google::Cloud::SecureSourceManager::V1::SecureSourceManager::Client#list_pull_requests. -# -def list_pull_requests - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::SecureSourceManager::V1::SecureSourceManager::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::SecureSourceManager::V1::ListPullRequestsRequest.new - - # Call the list_pull_requests method. - result = client.list_pull_requests request - - # The returned object is of type Gapic::PagedEnumerable. You can iterate - # over elements, and API calls will be issued to fetch pages as needed. - result.each do |item| - # Each element is of type ::Google::Cloud::SecureSourceManager::V1::PullRequest. - p item - end -end -# [END securesourcemanager_v1_generated_SecureSourceManager_ListPullRequests_sync] diff --git a/owl-bot-staging/google-cloud-secure_source_manager-v1/snippets/secure_source_manager/list_repositories.rb b/owl-bot-staging/google-cloud-secure_source_manager-v1/snippets/secure_source_manager/list_repositories.rb deleted file mode 100644 index bed32be0efe7..000000000000 --- a/owl-bot-staging/google-cloud-secure_source_manager-v1/snippets/secure_source_manager/list_repositories.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 securesourcemanager_v1_generated_SecureSourceManager_ListRepositories_sync] -require "google/cloud/secure_source_manager/v1" - -## -# Snippet for the list_repositories call in the SecureSourceManager service -# -# This snippet has been automatically generated and should be regarded as a code -# template only. It will require modifications to work: -# - It may require correct/in-range values for request initialization. -# - It may require specifying regional endpoints when creating the service -# client as shown in https://cloud.google.com/ruby/docs/reference. -# -# This is an auto-generated example demonstrating basic usage of -# Google::Cloud::SecureSourceManager::V1::SecureSourceManager::Client#list_repositories. -# -def list_repositories - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::SecureSourceManager::V1::SecureSourceManager::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::SecureSourceManager::V1::ListRepositoriesRequest.new - - # Call the list_repositories method. - result = client.list_repositories request - - # The returned object is of type Gapic::PagedEnumerable. You can iterate - # over elements, and API calls will be issued to fetch pages as needed. - result.each do |item| - # Each element is of type ::Google::Cloud::SecureSourceManager::V1::Repository. - p item - end -end -# [END securesourcemanager_v1_generated_SecureSourceManager_ListRepositories_sync] diff --git a/owl-bot-staging/google-cloud-secure_source_manager-v1/snippets/secure_source_manager/merge_pull_request.rb b/owl-bot-staging/google-cloud-secure_source_manager-v1/snippets/secure_source_manager/merge_pull_request.rb deleted file mode 100644 index a561bbc1483f..000000000000 --- a/owl-bot-staging/google-cloud-secure_source_manager-v1/snippets/secure_source_manager/merge_pull_request.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 securesourcemanager_v1_generated_SecureSourceManager_MergePullRequest_sync] -require "google/cloud/secure_source_manager/v1" - -## -# Snippet for the merge_pull_request call in the SecureSourceManager service -# -# This snippet has been automatically generated and should be regarded as a code -# template only. It will require modifications to work: -# - It may require correct/in-range values for request initialization. -# - It may require specifying regional endpoints when creating the service -# client as shown in https://cloud.google.com/ruby/docs/reference. -# -# This is an auto-generated example demonstrating basic usage of -# Google::Cloud::SecureSourceManager::V1::SecureSourceManager::Client#merge_pull_request. -# -def merge_pull_request - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::SecureSourceManager::V1::SecureSourceManager::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::SecureSourceManager::V1::MergePullRequestRequest.new - - # Call the merge_pull_request method. - result = client.merge_pull_request 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 securesourcemanager_v1_generated_SecureSourceManager_MergePullRequest_sync] diff --git a/owl-bot-staging/google-cloud-secure_source_manager-v1/snippets/secure_source_manager/open_issue.rb b/owl-bot-staging/google-cloud-secure_source_manager-v1/snippets/secure_source_manager/open_issue.rb deleted file mode 100644 index aac118b714ec..000000000000 --- a/owl-bot-staging/google-cloud-secure_source_manager-v1/snippets/secure_source_manager/open_issue.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 securesourcemanager_v1_generated_SecureSourceManager_OpenIssue_sync] -require "google/cloud/secure_source_manager/v1" - -## -# Snippet for the open_issue call in the SecureSourceManager service -# -# This snippet has been automatically generated and should be regarded as a code -# template only. It will require modifications to work: -# - It may require correct/in-range values for request initialization. -# - It may require specifying regional endpoints when creating the service -# client as shown in https://cloud.google.com/ruby/docs/reference. -# -# This is an auto-generated example demonstrating basic usage of -# Google::Cloud::SecureSourceManager::V1::SecureSourceManager::Client#open_issue. -# -def open_issue - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::SecureSourceManager::V1::SecureSourceManager::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::SecureSourceManager::V1::OpenIssueRequest.new - - # Call the open_issue method. - result = client.open_issue 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 securesourcemanager_v1_generated_SecureSourceManager_OpenIssue_sync] diff --git a/owl-bot-staging/google-cloud-secure_source_manager-v1/snippets/secure_source_manager/open_pull_request.rb b/owl-bot-staging/google-cloud-secure_source_manager-v1/snippets/secure_source_manager/open_pull_request.rb deleted file mode 100644 index e144b045570d..000000000000 --- a/owl-bot-staging/google-cloud-secure_source_manager-v1/snippets/secure_source_manager/open_pull_request.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 securesourcemanager_v1_generated_SecureSourceManager_OpenPullRequest_sync] -require "google/cloud/secure_source_manager/v1" - -## -# Snippet for the open_pull_request call in the SecureSourceManager service -# -# This snippet has been automatically generated and should be regarded as a code -# template only. It will require modifications to work: -# - It may require correct/in-range values for request initialization. -# - It may require specifying regional endpoints when creating the service -# client as shown in https://cloud.google.com/ruby/docs/reference. -# -# This is an auto-generated example demonstrating basic usage of -# Google::Cloud::SecureSourceManager::V1::SecureSourceManager::Client#open_pull_request. -# -def open_pull_request - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::SecureSourceManager::V1::SecureSourceManager::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::SecureSourceManager::V1::OpenPullRequestRequest.new - - # Call the open_pull_request method. - result = client.open_pull_request 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 securesourcemanager_v1_generated_SecureSourceManager_OpenPullRequest_sync] diff --git a/owl-bot-staging/google-cloud-secure_source_manager-v1/snippets/secure_source_manager/resolve_pull_request_comments.rb b/owl-bot-staging/google-cloud-secure_source_manager-v1/snippets/secure_source_manager/resolve_pull_request_comments.rb deleted file mode 100644 index 7a9e2ed11b6c..000000000000 --- a/owl-bot-staging/google-cloud-secure_source_manager-v1/snippets/secure_source_manager/resolve_pull_request_comments.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 securesourcemanager_v1_generated_SecureSourceManager_ResolvePullRequestComments_sync] -require "google/cloud/secure_source_manager/v1" - -## -# Snippet for the resolve_pull_request_comments call in the SecureSourceManager service -# -# This snippet has been automatically generated and should be regarded as a code -# template only. It will require modifications to work: -# - It may require correct/in-range values for request initialization. -# - It may require specifying regional endpoints when creating the service -# client as shown in https://cloud.google.com/ruby/docs/reference. -# -# This is an auto-generated example demonstrating basic usage of -# Google::Cloud::SecureSourceManager::V1::SecureSourceManager::Client#resolve_pull_request_comments. -# -def resolve_pull_request_comments - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::SecureSourceManager::V1::SecureSourceManager::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::SecureSourceManager::V1::ResolvePullRequestCommentsRequest.new - - # Call the resolve_pull_request_comments method. - result = client.resolve_pull_request_comments 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 securesourcemanager_v1_generated_SecureSourceManager_ResolvePullRequestComments_sync] diff --git a/owl-bot-staging/google-cloud-secure_source_manager-v1/snippets/secure_source_manager/set_iam_policy_repo.rb b/owl-bot-staging/google-cloud-secure_source_manager-v1/snippets/secure_source_manager/set_iam_policy_repo.rb deleted file mode 100644 index 9eaf3ef13717..000000000000 --- a/owl-bot-staging/google-cloud-secure_source_manager-v1/snippets/secure_source_manager/set_iam_policy_repo.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 securesourcemanager_v1_generated_SecureSourceManager_SetIamPolicyRepo_sync] -require "google/cloud/secure_source_manager/v1" - -## -# Snippet for the set_iam_policy_repo call in the SecureSourceManager service -# -# This snippet has been automatically generated and should be regarded as a code -# template only. It will require modifications to work: -# - It may require correct/in-range values for request initialization. -# - It may require specifying regional endpoints when creating the service -# client as shown in https://cloud.google.com/ruby/docs/reference. -# -# This is an auto-generated example demonstrating basic usage of -# Google::Cloud::SecureSourceManager::V1::SecureSourceManager::Client#set_iam_policy_repo. -# -def set_iam_policy_repo - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::SecureSourceManager::V1::SecureSourceManager::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Iam::V1::SetIamPolicyRequest.new - - # Call the set_iam_policy_repo method. - result = client.set_iam_policy_repo request - - # The returned object is of type Google::Iam::V1::Policy. - p result -end -# [END securesourcemanager_v1_generated_SecureSourceManager_SetIamPolicyRepo_sync] diff --git a/owl-bot-staging/google-cloud-secure_source_manager-v1/snippets/secure_source_manager/test_iam_permissions_repo.rb b/owl-bot-staging/google-cloud-secure_source_manager-v1/snippets/secure_source_manager/test_iam_permissions_repo.rb deleted file mode 100644 index 73012017a1b3..000000000000 --- a/owl-bot-staging/google-cloud-secure_source_manager-v1/snippets/secure_source_manager/test_iam_permissions_repo.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 securesourcemanager_v1_generated_SecureSourceManager_TestIamPermissionsRepo_sync] -require "google/cloud/secure_source_manager/v1" - -## -# Snippet for the test_iam_permissions_repo call in the SecureSourceManager service -# -# This snippet has been automatically generated and should be regarded as a code -# template only. It will require modifications to work: -# - It may require correct/in-range values for request initialization. -# - It may require specifying regional endpoints when creating the service -# client as shown in https://cloud.google.com/ruby/docs/reference. -# -# This is an auto-generated example demonstrating basic usage of -# Google::Cloud::SecureSourceManager::V1::SecureSourceManager::Client#test_iam_permissions_repo. -# -def test_iam_permissions_repo - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::SecureSourceManager::V1::SecureSourceManager::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Iam::V1::TestIamPermissionsRequest.new - - # Call the test_iam_permissions_repo method. - result = client.test_iam_permissions_repo request - - # The returned object is of type Google::Iam::V1::TestIamPermissionsResponse. - p result -end -# [END securesourcemanager_v1_generated_SecureSourceManager_TestIamPermissionsRepo_sync] diff --git a/owl-bot-staging/google-cloud-secure_source_manager-v1/snippets/secure_source_manager/unresolve_pull_request_comments.rb b/owl-bot-staging/google-cloud-secure_source_manager-v1/snippets/secure_source_manager/unresolve_pull_request_comments.rb deleted file mode 100644 index d8c323b516f2..000000000000 --- a/owl-bot-staging/google-cloud-secure_source_manager-v1/snippets/secure_source_manager/unresolve_pull_request_comments.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 securesourcemanager_v1_generated_SecureSourceManager_UnresolvePullRequestComments_sync] -require "google/cloud/secure_source_manager/v1" - -## -# Snippet for the unresolve_pull_request_comments call in the SecureSourceManager service -# -# This snippet has been automatically generated and should be regarded as a code -# template only. It will require modifications to work: -# - It may require correct/in-range values for request initialization. -# - It may require specifying regional endpoints when creating the service -# client as shown in https://cloud.google.com/ruby/docs/reference. -# -# This is an auto-generated example demonstrating basic usage of -# Google::Cloud::SecureSourceManager::V1::SecureSourceManager::Client#unresolve_pull_request_comments. -# -def unresolve_pull_request_comments - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::SecureSourceManager::V1::SecureSourceManager::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::SecureSourceManager::V1::UnresolvePullRequestCommentsRequest.new - - # Call the unresolve_pull_request_comments method. - result = client.unresolve_pull_request_comments 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 securesourcemanager_v1_generated_SecureSourceManager_UnresolvePullRequestComments_sync] diff --git a/owl-bot-staging/google-cloud-secure_source_manager-v1/snippets/secure_source_manager/update_branch_rule.rb b/owl-bot-staging/google-cloud-secure_source_manager-v1/snippets/secure_source_manager/update_branch_rule.rb deleted file mode 100644 index bd2c0fd99ca4..000000000000 --- a/owl-bot-staging/google-cloud-secure_source_manager-v1/snippets/secure_source_manager/update_branch_rule.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 securesourcemanager_v1_generated_SecureSourceManager_UpdateBranchRule_sync] -require "google/cloud/secure_source_manager/v1" - -## -# Snippet for the update_branch_rule call in the SecureSourceManager service -# -# This snippet has been automatically generated and should be regarded as a code -# template only. It will require modifications to work: -# - It may require correct/in-range values for request initialization. -# - It may require specifying regional endpoints when creating the service -# client as shown in https://cloud.google.com/ruby/docs/reference. -# -# This is an auto-generated example demonstrating basic usage of -# Google::Cloud::SecureSourceManager::V1::SecureSourceManager::Client#update_branch_rule. -# -def update_branch_rule - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::SecureSourceManager::V1::SecureSourceManager::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::SecureSourceManager::V1::UpdateBranchRuleRequest.new - - # Call the update_branch_rule method. - result = client.update_branch_rule 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 securesourcemanager_v1_generated_SecureSourceManager_UpdateBranchRule_sync] diff --git a/owl-bot-staging/google-cloud-secure_source_manager-v1/snippets/secure_source_manager/update_hook.rb b/owl-bot-staging/google-cloud-secure_source_manager-v1/snippets/secure_source_manager/update_hook.rb deleted file mode 100644 index 724f047f2413..000000000000 --- a/owl-bot-staging/google-cloud-secure_source_manager-v1/snippets/secure_source_manager/update_hook.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 securesourcemanager_v1_generated_SecureSourceManager_UpdateHook_sync] -require "google/cloud/secure_source_manager/v1" - -## -# Snippet for the update_hook call in the SecureSourceManager service -# -# This snippet has been automatically generated and should be regarded as a code -# template only. It will require modifications to work: -# - It may require correct/in-range values for request initialization. -# - It may require specifying regional endpoints when creating the service -# client as shown in https://cloud.google.com/ruby/docs/reference. -# -# This is an auto-generated example demonstrating basic usage of -# Google::Cloud::SecureSourceManager::V1::SecureSourceManager::Client#update_hook. -# -def update_hook - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::SecureSourceManager::V1::SecureSourceManager::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::SecureSourceManager::V1::UpdateHookRequest.new - - # Call the update_hook method. - result = client.update_hook 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 securesourcemanager_v1_generated_SecureSourceManager_UpdateHook_sync] diff --git a/owl-bot-staging/google-cloud-secure_source_manager-v1/snippets/secure_source_manager/update_issue.rb b/owl-bot-staging/google-cloud-secure_source_manager-v1/snippets/secure_source_manager/update_issue.rb deleted file mode 100644 index 4de76feb6560..000000000000 --- a/owl-bot-staging/google-cloud-secure_source_manager-v1/snippets/secure_source_manager/update_issue.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 securesourcemanager_v1_generated_SecureSourceManager_UpdateIssue_sync] -require "google/cloud/secure_source_manager/v1" - -## -# Snippet for the update_issue call in the SecureSourceManager service -# -# This snippet has been automatically generated and should be regarded as a code -# template only. It will require modifications to work: -# - It may require correct/in-range values for request initialization. -# - It may require specifying regional endpoints when creating the service -# client as shown in https://cloud.google.com/ruby/docs/reference. -# -# This is an auto-generated example demonstrating basic usage of -# Google::Cloud::SecureSourceManager::V1::SecureSourceManager::Client#update_issue. -# -def update_issue - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::SecureSourceManager::V1::SecureSourceManager::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::SecureSourceManager::V1::UpdateIssueRequest.new - - # Call the update_issue method. - result = client.update_issue 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 securesourcemanager_v1_generated_SecureSourceManager_UpdateIssue_sync] diff --git a/owl-bot-staging/google-cloud-secure_source_manager-v1/snippets/secure_source_manager/update_issue_comment.rb b/owl-bot-staging/google-cloud-secure_source_manager-v1/snippets/secure_source_manager/update_issue_comment.rb deleted file mode 100644 index f19c0a363e5b..000000000000 --- a/owl-bot-staging/google-cloud-secure_source_manager-v1/snippets/secure_source_manager/update_issue_comment.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 securesourcemanager_v1_generated_SecureSourceManager_UpdateIssueComment_sync] -require "google/cloud/secure_source_manager/v1" - -## -# Snippet for the update_issue_comment call in the SecureSourceManager service -# -# This snippet has been automatically generated and should be regarded as a code -# template only. It will require modifications to work: -# - It may require correct/in-range values for request initialization. -# - It may require specifying regional endpoints when creating the service -# client as shown in https://cloud.google.com/ruby/docs/reference. -# -# This is an auto-generated example demonstrating basic usage of -# Google::Cloud::SecureSourceManager::V1::SecureSourceManager::Client#update_issue_comment. -# -def update_issue_comment - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::SecureSourceManager::V1::SecureSourceManager::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::SecureSourceManager::V1::UpdateIssueCommentRequest.new - - # Call the update_issue_comment method. - result = client.update_issue_comment 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 securesourcemanager_v1_generated_SecureSourceManager_UpdateIssueComment_sync] diff --git a/owl-bot-staging/google-cloud-secure_source_manager-v1/snippets/secure_source_manager/update_pull_request.rb b/owl-bot-staging/google-cloud-secure_source_manager-v1/snippets/secure_source_manager/update_pull_request.rb deleted file mode 100644 index caea95463f77..000000000000 --- a/owl-bot-staging/google-cloud-secure_source_manager-v1/snippets/secure_source_manager/update_pull_request.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 securesourcemanager_v1_generated_SecureSourceManager_UpdatePullRequest_sync] -require "google/cloud/secure_source_manager/v1" - -## -# Snippet for the update_pull_request call in the SecureSourceManager service -# -# This snippet has been automatically generated and should be regarded as a code -# template only. It will require modifications to work: -# - It may require correct/in-range values for request initialization. -# - It may require specifying regional endpoints when creating the service -# client as shown in https://cloud.google.com/ruby/docs/reference. -# -# This is an auto-generated example demonstrating basic usage of -# Google::Cloud::SecureSourceManager::V1::SecureSourceManager::Client#update_pull_request. -# -def update_pull_request - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::SecureSourceManager::V1::SecureSourceManager::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::SecureSourceManager::V1::UpdatePullRequestRequest.new - - # Call the update_pull_request method. - result = client.update_pull_request 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 securesourcemanager_v1_generated_SecureSourceManager_UpdatePullRequest_sync] diff --git a/owl-bot-staging/google-cloud-secure_source_manager-v1/snippets/secure_source_manager/update_pull_request_comment.rb b/owl-bot-staging/google-cloud-secure_source_manager-v1/snippets/secure_source_manager/update_pull_request_comment.rb deleted file mode 100644 index 902089aa57c5..000000000000 --- a/owl-bot-staging/google-cloud-secure_source_manager-v1/snippets/secure_source_manager/update_pull_request_comment.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 securesourcemanager_v1_generated_SecureSourceManager_UpdatePullRequestComment_sync] -require "google/cloud/secure_source_manager/v1" - -## -# Snippet for the update_pull_request_comment call in the SecureSourceManager service -# -# This snippet has been automatically generated and should be regarded as a code -# template only. It will require modifications to work: -# - It may require correct/in-range values for request initialization. -# - It may require specifying regional endpoints when creating the service -# client as shown in https://cloud.google.com/ruby/docs/reference. -# -# This is an auto-generated example demonstrating basic usage of -# Google::Cloud::SecureSourceManager::V1::SecureSourceManager::Client#update_pull_request_comment. -# -def update_pull_request_comment - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::SecureSourceManager::V1::SecureSourceManager::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::SecureSourceManager::V1::UpdatePullRequestCommentRequest.new - - # Call the update_pull_request_comment method. - result = client.update_pull_request_comment 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 securesourcemanager_v1_generated_SecureSourceManager_UpdatePullRequestComment_sync] diff --git a/owl-bot-staging/google-cloud-secure_source_manager-v1/snippets/secure_source_manager/update_repository.rb b/owl-bot-staging/google-cloud-secure_source_manager-v1/snippets/secure_source_manager/update_repository.rb deleted file mode 100644 index fa3df85ca997..000000000000 --- a/owl-bot-staging/google-cloud-secure_source_manager-v1/snippets/secure_source_manager/update_repository.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 securesourcemanager_v1_generated_SecureSourceManager_UpdateRepository_sync] -require "google/cloud/secure_source_manager/v1" - -## -# Snippet for the update_repository call in the SecureSourceManager service -# -# This snippet has been automatically generated and should be regarded as a code -# template only. It will require modifications to work: -# - It may require correct/in-range values for request initialization. -# - It may require specifying regional endpoints when creating the service -# client as shown in https://cloud.google.com/ruby/docs/reference. -# -# This is an auto-generated example demonstrating basic usage of -# Google::Cloud::SecureSourceManager::V1::SecureSourceManager::Client#update_repository. -# -def update_repository - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::SecureSourceManager::V1::SecureSourceManager::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::SecureSourceManager::V1::UpdateRepositoryRequest.new - - # Call the update_repository method. - result = client.update_repository 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 securesourcemanager_v1_generated_SecureSourceManager_UpdateRepository_sync] diff --git a/owl-bot-staging/google-cloud-secure_source_manager-v1/snippets/snippet_metadata_google.cloud.securesourcemanager.v1.json b/owl-bot-staging/google-cloud-secure_source_manager-v1/snippets/snippet_metadata_google.cloud.securesourcemanager.v1.json deleted file mode 100644 index 98391cb30a6e..000000000000 --- a/owl-bot-staging/google-cloud-secure_source_manager-v1/snippets/snippet_metadata_google.cloud.securesourcemanager.v1.json +++ /dev/null @@ -1,2095 +0,0 @@ -{ - "client_library": { - "name": "google-cloud-secure_source_manager-v1", - "version": "", - "language": "RUBY", - "apis": [ - { - "id": "google.cloud.securesourcemanager.v1", - "version": "v1" - } - ] - }, - "snippets": [ - { - "region_tag": "securesourcemanager_v1_generated_SecureSourceManager_ListInstances_sync", - "title": "Snippet for the list_instances call in the SecureSourceManager service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::SecureSourceManager::V1::SecureSourceManager::Client#list_instances.", - "file": "secure_source_manager/list_instances.rb", - "language": "RUBY", - "client_method": { - "short_name": "list_instances", - "full_name": "::Google::Cloud::SecureSourceManager::V1::SecureSourceManager::Client#list_instances", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::SecureSourceManager::V1::ListInstancesRequest", - "name": "request" - } - ], - "result_type": "::Google::Cloud::SecureSourceManager::V1::ListInstancesResponse", - "client": { - "short_name": "SecureSourceManager::Client", - "full_name": "::Google::Cloud::SecureSourceManager::V1::SecureSourceManager::Client" - }, - "method": { - "short_name": "ListInstances", - "full_name": "google.cloud.securesourcemanager.v1.SecureSourceManager.ListInstances", - "service": { - "short_name": "SecureSourceManager", - "full_name": "google.cloud.securesourcemanager.v1.SecureSourceManager" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 50, - "type": "FULL" - } - ] - }, - { - "region_tag": "securesourcemanager_v1_generated_SecureSourceManager_GetInstance_sync", - "title": "Snippet for the get_instance call in the SecureSourceManager service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::SecureSourceManager::V1::SecureSourceManager::Client#get_instance.", - "file": "secure_source_manager/get_instance.rb", - "language": "RUBY", - "client_method": { - "short_name": "get_instance", - "full_name": "::Google::Cloud::SecureSourceManager::V1::SecureSourceManager::Client#get_instance", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::SecureSourceManager::V1::GetInstanceRequest", - "name": "request" - } - ], - "result_type": "::Google::Cloud::SecureSourceManager::V1::Instance", - "client": { - "short_name": "SecureSourceManager::Client", - "full_name": "::Google::Cloud::SecureSourceManager::V1::SecureSourceManager::Client" - }, - "method": { - "short_name": "GetInstance", - "full_name": "google.cloud.securesourcemanager.v1.SecureSourceManager.GetInstance", - "service": { - "short_name": "SecureSourceManager", - "full_name": "google.cloud.securesourcemanager.v1.SecureSourceManager" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 46, - "type": "FULL" - } - ] - }, - { - "region_tag": "securesourcemanager_v1_generated_SecureSourceManager_CreateInstance_sync", - "title": "Snippet for the create_instance call in the SecureSourceManager service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::SecureSourceManager::V1::SecureSourceManager::Client#create_instance.", - "file": "secure_source_manager/create_instance.rb", - "language": "RUBY", - "client_method": { - "short_name": "create_instance", - "full_name": "::Google::Cloud::SecureSourceManager::V1::SecureSourceManager::Client#create_instance", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::SecureSourceManager::V1::CreateInstanceRequest", - "name": "request" - } - ], - "result_type": "::Google::Longrunning::Operation", - "client": { - "short_name": "SecureSourceManager::Client", - "full_name": "::Google::Cloud::SecureSourceManager::V1::SecureSourceManager::Client" - }, - "method": { - "short_name": "CreateInstance", - "full_name": "google.cloud.securesourcemanager.v1.SecureSourceManager.CreateInstance", - "service": { - "short_name": "SecureSourceManager", - "full_name": "google.cloud.securesourcemanager.v1.SecureSourceManager" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 53, - "type": "FULL" - } - ] - }, - { - "region_tag": "securesourcemanager_v1_generated_SecureSourceManager_DeleteInstance_sync", - "title": "Snippet for the delete_instance call in the SecureSourceManager service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::SecureSourceManager::V1::SecureSourceManager::Client#delete_instance.", - "file": "secure_source_manager/delete_instance.rb", - "language": "RUBY", - "client_method": { - "short_name": "delete_instance", - "full_name": "::Google::Cloud::SecureSourceManager::V1::SecureSourceManager::Client#delete_instance", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::SecureSourceManager::V1::DeleteInstanceRequest", - "name": "request" - } - ], - "result_type": "::Google::Longrunning::Operation", - "client": { - "short_name": "SecureSourceManager::Client", - "full_name": "::Google::Cloud::SecureSourceManager::V1::SecureSourceManager::Client" - }, - "method": { - "short_name": "DeleteInstance", - "full_name": "google.cloud.securesourcemanager.v1.SecureSourceManager.DeleteInstance", - "service": { - "short_name": "SecureSourceManager", - "full_name": "google.cloud.securesourcemanager.v1.SecureSourceManager" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 53, - "type": "FULL" - } - ] - }, - { - "region_tag": "securesourcemanager_v1_generated_SecureSourceManager_ListRepositories_sync", - "title": "Snippet for the list_repositories call in the SecureSourceManager service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::SecureSourceManager::V1::SecureSourceManager::Client#list_repositories.", - "file": "secure_source_manager/list_repositories.rb", - "language": "RUBY", - "client_method": { - "short_name": "list_repositories", - "full_name": "::Google::Cloud::SecureSourceManager::V1::SecureSourceManager::Client#list_repositories", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::SecureSourceManager::V1::ListRepositoriesRequest", - "name": "request" - } - ], - "result_type": "::Google::Cloud::SecureSourceManager::V1::ListRepositoriesResponse", - "client": { - "short_name": "SecureSourceManager::Client", - "full_name": "::Google::Cloud::SecureSourceManager::V1::SecureSourceManager::Client" - }, - "method": { - "short_name": "ListRepositories", - "full_name": "google.cloud.securesourcemanager.v1.SecureSourceManager.ListRepositories", - "service": { - "short_name": "SecureSourceManager", - "full_name": "google.cloud.securesourcemanager.v1.SecureSourceManager" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 50, - "type": "FULL" - } - ] - }, - { - "region_tag": "securesourcemanager_v1_generated_SecureSourceManager_GetRepository_sync", - "title": "Snippet for the get_repository call in the SecureSourceManager service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::SecureSourceManager::V1::SecureSourceManager::Client#get_repository.", - "file": "secure_source_manager/get_repository.rb", - "language": "RUBY", - "client_method": { - "short_name": "get_repository", - "full_name": "::Google::Cloud::SecureSourceManager::V1::SecureSourceManager::Client#get_repository", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::SecureSourceManager::V1::GetRepositoryRequest", - "name": "request" - } - ], - "result_type": "::Google::Cloud::SecureSourceManager::V1::Repository", - "client": { - "short_name": "SecureSourceManager::Client", - "full_name": "::Google::Cloud::SecureSourceManager::V1::SecureSourceManager::Client" - }, - "method": { - "short_name": "GetRepository", - "full_name": "google.cloud.securesourcemanager.v1.SecureSourceManager.GetRepository", - "service": { - "short_name": "SecureSourceManager", - "full_name": "google.cloud.securesourcemanager.v1.SecureSourceManager" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 46, - "type": "FULL" - } - ] - }, - { - "region_tag": "securesourcemanager_v1_generated_SecureSourceManager_CreateRepository_sync", - "title": "Snippet for the create_repository call in the SecureSourceManager service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::SecureSourceManager::V1::SecureSourceManager::Client#create_repository.", - "file": "secure_source_manager/create_repository.rb", - "language": "RUBY", - "client_method": { - "short_name": "create_repository", - "full_name": "::Google::Cloud::SecureSourceManager::V1::SecureSourceManager::Client#create_repository", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::SecureSourceManager::V1::CreateRepositoryRequest", - "name": "request" - } - ], - "result_type": "::Google::Longrunning::Operation", - "client": { - "short_name": "SecureSourceManager::Client", - "full_name": "::Google::Cloud::SecureSourceManager::V1::SecureSourceManager::Client" - }, - "method": { - "short_name": "CreateRepository", - "full_name": "google.cloud.securesourcemanager.v1.SecureSourceManager.CreateRepository", - "service": { - "short_name": "SecureSourceManager", - "full_name": "google.cloud.securesourcemanager.v1.SecureSourceManager" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 53, - "type": "FULL" - } - ] - }, - { - "region_tag": "securesourcemanager_v1_generated_SecureSourceManager_UpdateRepository_sync", - "title": "Snippet for the update_repository call in the SecureSourceManager service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::SecureSourceManager::V1::SecureSourceManager::Client#update_repository.", - "file": "secure_source_manager/update_repository.rb", - "language": "RUBY", - "client_method": { - "short_name": "update_repository", - "full_name": "::Google::Cloud::SecureSourceManager::V1::SecureSourceManager::Client#update_repository", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::SecureSourceManager::V1::UpdateRepositoryRequest", - "name": "request" - } - ], - "result_type": "::Google::Longrunning::Operation", - "client": { - "short_name": "SecureSourceManager::Client", - "full_name": "::Google::Cloud::SecureSourceManager::V1::SecureSourceManager::Client" - }, - "method": { - "short_name": "UpdateRepository", - "full_name": "google.cloud.securesourcemanager.v1.SecureSourceManager.UpdateRepository", - "service": { - "short_name": "SecureSourceManager", - "full_name": "google.cloud.securesourcemanager.v1.SecureSourceManager" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 53, - "type": "FULL" - } - ] - }, - { - "region_tag": "securesourcemanager_v1_generated_SecureSourceManager_DeleteRepository_sync", - "title": "Snippet for the delete_repository call in the SecureSourceManager service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::SecureSourceManager::V1::SecureSourceManager::Client#delete_repository.", - "file": "secure_source_manager/delete_repository.rb", - "language": "RUBY", - "client_method": { - "short_name": "delete_repository", - "full_name": "::Google::Cloud::SecureSourceManager::V1::SecureSourceManager::Client#delete_repository", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::SecureSourceManager::V1::DeleteRepositoryRequest", - "name": "request" - } - ], - "result_type": "::Google::Longrunning::Operation", - "client": { - "short_name": "SecureSourceManager::Client", - "full_name": "::Google::Cloud::SecureSourceManager::V1::SecureSourceManager::Client" - }, - "method": { - "short_name": "DeleteRepository", - "full_name": "google.cloud.securesourcemanager.v1.SecureSourceManager.DeleteRepository", - "service": { - "short_name": "SecureSourceManager", - "full_name": "google.cloud.securesourcemanager.v1.SecureSourceManager" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 53, - "type": "FULL" - } - ] - }, - { - "region_tag": "securesourcemanager_v1_generated_SecureSourceManager_ListHooks_sync", - "title": "Snippet for the list_hooks call in the SecureSourceManager service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::SecureSourceManager::V1::SecureSourceManager::Client#list_hooks.", - "file": "secure_source_manager/list_hooks.rb", - "language": "RUBY", - "client_method": { - "short_name": "list_hooks", - "full_name": "::Google::Cloud::SecureSourceManager::V1::SecureSourceManager::Client#list_hooks", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::SecureSourceManager::V1::ListHooksRequest", - "name": "request" - } - ], - "result_type": "::Google::Cloud::SecureSourceManager::V1::ListHooksResponse", - "client": { - "short_name": "SecureSourceManager::Client", - "full_name": "::Google::Cloud::SecureSourceManager::V1::SecureSourceManager::Client" - }, - "method": { - "short_name": "ListHooks", - "full_name": "google.cloud.securesourcemanager.v1.SecureSourceManager.ListHooks", - "service": { - "short_name": "SecureSourceManager", - "full_name": "google.cloud.securesourcemanager.v1.SecureSourceManager" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 50, - "type": "FULL" - } - ] - }, - { - "region_tag": "securesourcemanager_v1_generated_SecureSourceManager_GetHook_sync", - "title": "Snippet for the get_hook call in the SecureSourceManager service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::SecureSourceManager::V1::SecureSourceManager::Client#get_hook.", - "file": "secure_source_manager/get_hook.rb", - "language": "RUBY", - "client_method": { - "short_name": "get_hook", - "full_name": "::Google::Cloud::SecureSourceManager::V1::SecureSourceManager::Client#get_hook", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::SecureSourceManager::V1::GetHookRequest", - "name": "request" - } - ], - "result_type": "::Google::Cloud::SecureSourceManager::V1::Hook", - "client": { - "short_name": "SecureSourceManager::Client", - "full_name": "::Google::Cloud::SecureSourceManager::V1::SecureSourceManager::Client" - }, - "method": { - "short_name": "GetHook", - "full_name": "google.cloud.securesourcemanager.v1.SecureSourceManager.GetHook", - "service": { - "short_name": "SecureSourceManager", - "full_name": "google.cloud.securesourcemanager.v1.SecureSourceManager" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 46, - "type": "FULL" - } - ] - }, - { - "region_tag": "securesourcemanager_v1_generated_SecureSourceManager_CreateHook_sync", - "title": "Snippet for the create_hook call in the SecureSourceManager service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::SecureSourceManager::V1::SecureSourceManager::Client#create_hook.", - "file": "secure_source_manager/create_hook.rb", - "language": "RUBY", - "client_method": { - "short_name": "create_hook", - "full_name": "::Google::Cloud::SecureSourceManager::V1::SecureSourceManager::Client#create_hook", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::SecureSourceManager::V1::CreateHookRequest", - "name": "request" - } - ], - "result_type": "::Google::Longrunning::Operation", - "client": { - "short_name": "SecureSourceManager::Client", - "full_name": "::Google::Cloud::SecureSourceManager::V1::SecureSourceManager::Client" - }, - "method": { - "short_name": "CreateHook", - "full_name": "google.cloud.securesourcemanager.v1.SecureSourceManager.CreateHook", - "service": { - "short_name": "SecureSourceManager", - "full_name": "google.cloud.securesourcemanager.v1.SecureSourceManager" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 53, - "type": "FULL" - } - ] - }, - { - "region_tag": "securesourcemanager_v1_generated_SecureSourceManager_UpdateHook_sync", - "title": "Snippet for the update_hook call in the SecureSourceManager service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::SecureSourceManager::V1::SecureSourceManager::Client#update_hook.", - "file": "secure_source_manager/update_hook.rb", - "language": "RUBY", - "client_method": { - "short_name": "update_hook", - "full_name": "::Google::Cloud::SecureSourceManager::V1::SecureSourceManager::Client#update_hook", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::SecureSourceManager::V1::UpdateHookRequest", - "name": "request" - } - ], - "result_type": "::Google::Longrunning::Operation", - "client": { - "short_name": "SecureSourceManager::Client", - "full_name": "::Google::Cloud::SecureSourceManager::V1::SecureSourceManager::Client" - }, - "method": { - "short_name": "UpdateHook", - "full_name": "google.cloud.securesourcemanager.v1.SecureSourceManager.UpdateHook", - "service": { - "short_name": "SecureSourceManager", - "full_name": "google.cloud.securesourcemanager.v1.SecureSourceManager" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 53, - "type": "FULL" - } - ] - }, - { - "region_tag": "securesourcemanager_v1_generated_SecureSourceManager_DeleteHook_sync", - "title": "Snippet for the delete_hook call in the SecureSourceManager service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::SecureSourceManager::V1::SecureSourceManager::Client#delete_hook.", - "file": "secure_source_manager/delete_hook.rb", - "language": "RUBY", - "client_method": { - "short_name": "delete_hook", - "full_name": "::Google::Cloud::SecureSourceManager::V1::SecureSourceManager::Client#delete_hook", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::SecureSourceManager::V1::DeleteHookRequest", - "name": "request" - } - ], - "result_type": "::Google::Longrunning::Operation", - "client": { - "short_name": "SecureSourceManager::Client", - "full_name": "::Google::Cloud::SecureSourceManager::V1::SecureSourceManager::Client" - }, - "method": { - "short_name": "DeleteHook", - "full_name": "google.cloud.securesourcemanager.v1.SecureSourceManager.DeleteHook", - "service": { - "short_name": "SecureSourceManager", - "full_name": "google.cloud.securesourcemanager.v1.SecureSourceManager" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 53, - "type": "FULL" - } - ] - }, - { - "region_tag": "securesourcemanager_v1_generated_SecureSourceManager_GetIamPolicyRepo_sync", - "title": "Snippet for the get_iam_policy_repo call in the SecureSourceManager service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::SecureSourceManager::V1::SecureSourceManager::Client#get_iam_policy_repo.", - "file": "secure_source_manager/get_iam_policy_repo.rb", - "language": "RUBY", - "client_method": { - "short_name": "get_iam_policy_repo", - "full_name": "::Google::Cloud::SecureSourceManager::V1::SecureSourceManager::Client#get_iam_policy_repo", - "async": false, - "parameters": [ - { - "type": "::Google::Iam::V1::GetIamPolicyRequest", - "name": "request" - } - ], - "result_type": "::Google::Iam::V1::Policy", - "client": { - "short_name": "SecureSourceManager::Client", - "full_name": "::Google::Cloud::SecureSourceManager::V1::SecureSourceManager::Client" - }, - "method": { - "short_name": "GetIamPolicyRepo", - "full_name": "google.cloud.securesourcemanager.v1.SecureSourceManager.GetIamPolicyRepo", - "service": { - "short_name": "SecureSourceManager", - "full_name": "google.cloud.securesourcemanager.v1.SecureSourceManager" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 46, - "type": "FULL" - } - ] - }, - { - "region_tag": "securesourcemanager_v1_generated_SecureSourceManager_SetIamPolicyRepo_sync", - "title": "Snippet for the set_iam_policy_repo call in the SecureSourceManager service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::SecureSourceManager::V1::SecureSourceManager::Client#set_iam_policy_repo.", - "file": "secure_source_manager/set_iam_policy_repo.rb", - "language": "RUBY", - "client_method": { - "short_name": "set_iam_policy_repo", - "full_name": "::Google::Cloud::SecureSourceManager::V1::SecureSourceManager::Client#set_iam_policy_repo", - "async": false, - "parameters": [ - { - "type": "::Google::Iam::V1::SetIamPolicyRequest", - "name": "request" - } - ], - "result_type": "::Google::Iam::V1::Policy", - "client": { - "short_name": "SecureSourceManager::Client", - "full_name": "::Google::Cloud::SecureSourceManager::V1::SecureSourceManager::Client" - }, - "method": { - "short_name": "SetIamPolicyRepo", - "full_name": "google.cloud.securesourcemanager.v1.SecureSourceManager.SetIamPolicyRepo", - "service": { - "short_name": "SecureSourceManager", - "full_name": "google.cloud.securesourcemanager.v1.SecureSourceManager" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 46, - "type": "FULL" - } - ] - }, - { - "region_tag": "securesourcemanager_v1_generated_SecureSourceManager_TestIamPermissionsRepo_sync", - "title": "Snippet for the test_iam_permissions_repo call in the SecureSourceManager service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::SecureSourceManager::V1::SecureSourceManager::Client#test_iam_permissions_repo.", - "file": "secure_source_manager/test_iam_permissions_repo.rb", - "language": "RUBY", - "client_method": { - "short_name": "test_iam_permissions_repo", - "full_name": "::Google::Cloud::SecureSourceManager::V1::SecureSourceManager::Client#test_iam_permissions_repo", - "async": false, - "parameters": [ - { - "type": "::Google::Iam::V1::TestIamPermissionsRequest", - "name": "request" - } - ], - "result_type": "::Google::Iam::V1::TestIamPermissionsResponse", - "client": { - "short_name": "SecureSourceManager::Client", - "full_name": "::Google::Cloud::SecureSourceManager::V1::SecureSourceManager::Client" - }, - "method": { - "short_name": "TestIamPermissionsRepo", - "full_name": "google.cloud.securesourcemanager.v1.SecureSourceManager.TestIamPermissionsRepo", - "service": { - "short_name": "SecureSourceManager", - "full_name": "google.cloud.securesourcemanager.v1.SecureSourceManager" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 46, - "type": "FULL" - } - ] - }, - { - "region_tag": "securesourcemanager_v1_generated_SecureSourceManager_CreateBranchRule_sync", - "title": "Snippet for the create_branch_rule call in the SecureSourceManager service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::SecureSourceManager::V1::SecureSourceManager::Client#create_branch_rule.", - "file": "secure_source_manager/create_branch_rule.rb", - "language": "RUBY", - "client_method": { - "short_name": "create_branch_rule", - "full_name": "::Google::Cloud::SecureSourceManager::V1::SecureSourceManager::Client#create_branch_rule", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::SecureSourceManager::V1::CreateBranchRuleRequest", - "name": "request" - } - ], - "result_type": "::Google::Longrunning::Operation", - "client": { - "short_name": "SecureSourceManager::Client", - "full_name": "::Google::Cloud::SecureSourceManager::V1::SecureSourceManager::Client" - }, - "method": { - "short_name": "CreateBranchRule", - "full_name": "google.cloud.securesourcemanager.v1.SecureSourceManager.CreateBranchRule", - "service": { - "short_name": "SecureSourceManager", - "full_name": "google.cloud.securesourcemanager.v1.SecureSourceManager" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 53, - "type": "FULL" - } - ] - }, - { - "region_tag": "securesourcemanager_v1_generated_SecureSourceManager_ListBranchRules_sync", - "title": "Snippet for the list_branch_rules call in the SecureSourceManager service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::SecureSourceManager::V1::SecureSourceManager::Client#list_branch_rules.", - "file": "secure_source_manager/list_branch_rules.rb", - "language": "RUBY", - "client_method": { - "short_name": "list_branch_rules", - "full_name": "::Google::Cloud::SecureSourceManager::V1::SecureSourceManager::Client#list_branch_rules", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::SecureSourceManager::V1::ListBranchRulesRequest", - "name": "request" - } - ], - "result_type": "::Google::Cloud::SecureSourceManager::V1::ListBranchRulesResponse", - "client": { - "short_name": "SecureSourceManager::Client", - "full_name": "::Google::Cloud::SecureSourceManager::V1::SecureSourceManager::Client" - }, - "method": { - "short_name": "ListBranchRules", - "full_name": "google.cloud.securesourcemanager.v1.SecureSourceManager.ListBranchRules", - "service": { - "short_name": "SecureSourceManager", - "full_name": "google.cloud.securesourcemanager.v1.SecureSourceManager" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 50, - "type": "FULL" - } - ] - }, - { - "region_tag": "securesourcemanager_v1_generated_SecureSourceManager_GetBranchRule_sync", - "title": "Snippet for the get_branch_rule call in the SecureSourceManager service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::SecureSourceManager::V1::SecureSourceManager::Client#get_branch_rule.", - "file": "secure_source_manager/get_branch_rule.rb", - "language": "RUBY", - "client_method": { - "short_name": "get_branch_rule", - "full_name": "::Google::Cloud::SecureSourceManager::V1::SecureSourceManager::Client#get_branch_rule", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::SecureSourceManager::V1::GetBranchRuleRequest", - "name": "request" - } - ], - "result_type": "::Google::Cloud::SecureSourceManager::V1::BranchRule", - "client": { - "short_name": "SecureSourceManager::Client", - "full_name": "::Google::Cloud::SecureSourceManager::V1::SecureSourceManager::Client" - }, - "method": { - "short_name": "GetBranchRule", - "full_name": "google.cloud.securesourcemanager.v1.SecureSourceManager.GetBranchRule", - "service": { - "short_name": "SecureSourceManager", - "full_name": "google.cloud.securesourcemanager.v1.SecureSourceManager" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 46, - "type": "FULL" - } - ] - }, - { - "region_tag": "securesourcemanager_v1_generated_SecureSourceManager_UpdateBranchRule_sync", - "title": "Snippet for the update_branch_rule call in the SecureSourceManager service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::SecureSourceManager::V1::SecureSourceManager::Client#update_branch_rule.", - "file": "secure_source_manager/update_branch_rule.rb", - "language": "RUBY", - "client_method": { - "short_name": "update_branch_rule", - "full_name": "::Google::Cloud::SecureSourceManager::V1::SecureSourceManager::Client#update_branch_rule", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::SecureSourceManager::V1::UpdateBranchRuleRequest", - "name": "request" - } - ], - "result_type": "::Google::Longrunning::Operation", - "client": { - "short_name": "SecureSourceManager::Client", - "full_name": "::Google::Cloud::SecureSourceManager::V1::SecureSourceManager::Client" - }, - "method": { - "short_name": "UpdateBranchRule", - "full_name": "google.cloud.securesourcemanager.v1.SecureSourceManager.UpdateBranchRule", - "service": { - "short_name": "SecureSourceManager", - "full_name": "google.cloud.securesourcemanager.v1.SecureSourceManager" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 53, - "type": "FULL" - } - ] - }, - { - "region_tag": "securesourcemanager_v1_generated_SecureSourceManager_DeleteBranchRule_sync", - "title": "Snippet for the delete_branch_rule call in the SecureSourceManager service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::SecureSourceManager::V1::SecureSourceManager::Client#delete_branch_rule.", - "file": "secure_source_manager/delete_branch_rule.rb", - "language": "RUBY", - "client_method": { - "short_name": "delete_branch_rule", - "full_name": "::Google::Cloud::SecureSourceManager::V1::SecureSourceManager::Client#delete_branch_rule", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::SecureSourceManager::V1::DeleteBranchRuleRequest", - "name": "request" - } - ], - "result_type": "::Google::Longrunning::Operation", - "client": { - "short_name": "SecureSourceManager::Client", - "full_name": "::Google::Cloud::SecureSourceManager::V1::SecureSourceManager::Client" - }, - "method": { - "short_name": "DeleteBranchRule", - "full_name": "google.cloud.securesourcemanager.v1.SecureSourceManager.DeleteBranchRule", - "service": { - "short_name": "SecureSourceManager", - "full_name": "google.cloud.securesourcemanager.v1.SecureSourceManager" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 53, - "type": "FULL" - } - ] - }, - { - "region_tag": "securesourcemanager_v1_generated_SecureSourceManager_CreatePullRequest_sync", - "title": "Snippet for the create_pull_request call in the SecureSourceManager service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::SecureSourceManager::V1::SecureSourceManager::Client#create_pull_request.", - "file": "secure_source_manager/create_pull_request.rb", - "language": "RUBY", - "client_method": { - "short_name": "create_pull_request", - "full_name": "::Google::Cloud::SecureSourceManager::V1::SecureSourceManager::Client#create_pull_request", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::SecureSourceManager::V1::CreatePullRequestRequest", - "name": "request" - } - ], - "result_type": "::Google::Longrunning::Operation", - "client": { - "short_name": "SecureSourceManager::Client", - "full_name": "::Google::Cloud::SecureSourceManager::V1::SecureSourceManager::Client" - }, - "method": { - "short_name": "CreatePullRequest", - "full_name": "google.cloud.securesourcemanager.v1.SecureSourceManager.CreatePullRequest", - "service": { - "short_name": "SecureSourceManager", - "full_name": "google.cloud.securesourcemanager.v1.SecureSourceManager" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 53, - "type": "FULL" - } - ] - }, - { - "region_tag": "securesourcemanager_v1_generated_SecureSourceManager_GetPullRequest_sync", - "title": "Snippet for the get_pull_request call in the SecureSourceManager service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::SecureSourceManager::V1::SecureSourceManager::Client#get_pull_request.", - "file": "secure_source_manager/get_pull_request.rb", - "language": "RUBY", - "client_method": { - "short_name": "get_pull_request", - "full_name": "::Google::Cloud::SecureSourceManager::V1::SecureSourceManager::Client#get_pull_request", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::SecureSourceManager::V1::GetPullRequestRequest", - "name": "request" - } - ], - "result_type": "::Google::Cloud::SecureSourceManager::V1::PullRequest", - "client": { - "short_name": "SecureSourceManager::Client", - "full_name": "::Google::Cloud::SecureSourceManager::V1::SecureSourceManager::Client" - }, - "method": { - "short_name": "GetPullRequest", - "full_name": "google.cloud.securesourcemanager.v1.SecureSourceManager.GetPullRequest", - "service": { - "short_name": "SecureSourceManager", - "full_name": "google.cloud.securesourcemanager.v1.SecureSourceManager" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 46, - "type": "FULL" - } - ] - }, - { - "region_tag": "securesourcemanager_v1_generated_SecureSourceManager_ListPullRequests_sync", - "title": "Snippet for the list_pull_requests call in the SecureSourceManager service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::SecureSourceManager::V1::SecureSourceManager::Client#list_pull_requests.", - "file": "secure_source_manager/list_pull_requests.rb", - "language": "RUBY", - "client_method": { - "short_name": "list_pull_requests", - "full_name": "::Google::Cloud::SecureSourceManager::V1::SecureSourceManager::Client#list_pull_requests", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::SecureSourceManager::V1::ListPullRequestsRequest", - "name": "request" - } - ], - "result_type": "::Google::Cloud::SecureSourceManager::V1::ListPullRequestsResponse", - "client": { - "short_name": "SecureSourceManager::Client", - "full_name": "::Google::Cloud::SecureSourceManager::V1::SecureSourceManager::Client" - }, - "method": { - "short_name": "ListPullRequests", - "full_name": "google.cloud.securesourcemanager.v1.SecureSourceManager.ListPullRequests", - "service": { - "short_name": "SecureSourceManager", - "full_name": "google.cloud.securesourcemanager.v1.SecureSourceManager" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 50, - "type": "FULL" - } - ] - }, - { - "region_tag": "securesourcemanager_v1_generated_SecureSourceManager_UpdatePullRequest_sync", - "title": "Snippet for the update_pull_request call in the SecureSourceManager service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::SecureSourceManager::V1::SecureSourceManager::Client#update_pull_request.", - "file": "secure_source_manager/update_pull_request.rb", - "language": "RUBY", - "client_method": { - "short_name": "update_pull_request", - "full_name": "::Google::Cloud::SecureSourceManager::V1::SecureSourceManager::Client#update_pull_request", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::SecureSourceManager::V1::UpdatePullRequestRequest", - "name": "request" - } - ], - "result_type": "::Google::Longrunning::Operation", - "client": { - "short_name": "SecureSourceManager::Client", - "full_name": "::Google::Cloud::SecureSourceManager::V1::SecureSourceManager::Client" - }, - "method": { - "short_name": "UpdatePullRequest", - "full_name": "google.cloud.securesourcemanager.v1.SecureSourceManager.UpdatePullRequest", - "service": { - "short_name": "SecureSourceManager", - "full_name": "google.cloud.securesourcemanager.v1.SecureSourceManager" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 53, - "type": "FULL" - } - ] - }, - { - "region_tag": "securesourcemanager_v1_generated_SecureSourceManager_MergePullRequest_sync", - "title": "Snippet for the merge_pull_request call in the SecureSourceManager service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::SecureSourceManager::V1::SecureSourceManager::Client#merge_pull_request.", - "file": "secure_source_manager/merge_pull_request.rb", - "language": "RUBY", - "client_method": { - "short_name": "merge_pull_request", - "full_name": "::Google::Cloud::SecureSourceManager::V1::SecureSourceManager::Client#merge_pull_request", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::SecureSourceManager::V1::MergePullRequestRequest", - "name": "request" - } - ], - "result_type": "::Google::Longrunning::Operation", - "client": { - "short_name": "SecureSourceManager::Client", - "full_name": "::Google::Cloud::SecureSourceManager::V1::SecureSourceManager::Client" - }, - "method": { - "short_name": "MergePullRequest", - "full_name": "google.cloud.securesourcemanager.v1.SecureSourceManager.MergePullRequest", - "service": { - "short_name": "SecureSourceManager", - "full_name": "google.cloud.securesourcemanager.v1.SecureSourceManager" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 53, - "type": "FULL" - } - ] - }, - { - "region_tag": "securesourcemanager_v1_generated_SecureSourceManager_OpenPullRequest_sync", - "title": "Snippet for the open_pull_request call in the SecureSourceManager service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::SecureSourceManager::V1::SecureSourceManager::Client#open_pull_request.", - "file": "secure_source_manager/open_pull_request.rb", - "language": "RUBY", - "client_method": { - "short_name": "open_pull_request", - "full_name": "::Google::Cloud::SecureSourceManager::V1::SecureSourceManager::Client#open_pull_request", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::SecureSourceManager::V1::OpenPullRequestRequest", - "name": "request" - } - ], - "result_type": "::Google::Longrunning::Operation", - "client": { - "short_name": "SecureSourceManager::Client", - "full_name": "::Google::Cloud::SecureSourceManager::V1::SecureSourceManager::Client" - }, - "method": { - "short_name": "OpenPullRequest", - "full_name": "google.cloud.securesourcemanager.v1.SecureSourceManager.OpenPullRequest", - "service": { - "short_name": "SecureSourceManager", - "full_name": "google.cloud.securesourcemanager.v1.SecureSourceManager" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 53, - "type": "FULL" - } - ] - }, - { - "region_tag": "securesourcemanager_v1_generated_SecureSourceManager_ClosePullRequest_sync", - "title": "Snippet for the close_pull_request call in the SecureSourceManager service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::SecureSourceManager::V1::SecureSourceManager::Client#close_pull_request.", - "file": "secure_source_manager/close_pull_request.rb", - "language": "RUBY", - "client_method": { - "short_name": "close_pull_request", - "full_name": "::Google::Cloud::SecureSourceManager::V1::SecureSourceManager::Client#close_pull_request", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::SecureSourceManager::V1::ClosePullRequestRequest", - "name": "request" - } - ], - "result_type": "::Google::Longrunning::Operation", - "client": { - "short_name": "SecureSourceManager::Client", - "full_name": "::Google::Cloud::SecureSourceManager::V1::SecureSourceManager::Client" - }, - "method": { - "short_name": "ClosePullRequest", - "full_name": "google.cloud.securesourcemanager.v1.SecureSourceManager.ClosePullRequest", - "service": { - "short_name": "SecureSourceManager", - "full_name": "google.cloud.securesourcemanager.v1.SecureSourceManager" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 53, - "type": "FULL" - } - ] - }, - { - "region_tag": "securesourcemanager_v1_generated_SecureSourceManager_ListPullRequestFileDiffs_sync", - "title": "Snippet for the list_pull_request_file_diffs call in the SecureSourceManager service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::SecureSourceManager::V1::SecureSourceManager::Client#list_pull_request_file_diffs.", - "file": "secure_source_manager/list_pull_request_file_diffs.rb", - "language": "RUBY", - "client_method": { - "short_name": "list_pull_request_file_diffs", - "full_name": "::Google::Cloud::SecureSourceManager::V1::SecureSourceManager::Client#list_pull_request_file_diffs", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::SecureSourceManager::V1::ListPullRequestFileDiffsRequest", - "name": "request" - } - ], - "result_type": "::Google::Cloud::SecureSourceManager::V1::ListPullRequestFileDiffsResponse", - "client": { - "short_name": "SecureSourceManager::Client", - "full_name": "::Google::Cloud::SecureSourceManager::V1::SecureSourceManager::Client" - }, - "method": { - "short_name": "ListPullRequestFileDiffs", - "full_name": "google.cloud.securesourcemanager.v1.SecureSourceManager.ListPullRequestFileDiffs", - "service": { - "short_name": "SecureSourceManager", - "full_name": "google.cloud.securesourcemanager.v1.SecureSourceManager" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 50, - "type": "FULL" - } - ] - }, - { - "region_tag": "securesourcemanager_v1_generated_SecureSourceManager_FetchTree_sync", - "title": "Snippet for the fetch_tree call in the SecureSourceManager service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::SecureSourceManager::V1::SecureSourceManager::Client#fetch_tree.", - "file": "secure_source_manager/fetch_tree.rb", - "language": "RUBY", - "client_method": { - "short_name": "fetch_tree", - "full_name": "::Google::Cloud::SecureSourceManager::V1::SecureSourceManager::Client#fetch_tree", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::SecureSourceManager::V1::FetchTreeRequest", - "name": "request" - } - ], - "result_type": "::Google::Cloud::SecureSourceManager::V1::FetchTreeResponse", - "client": { - "short_name": "SecureSourceManager::Client", - "full_name": "::Google::Cloud::SecureSourceManager::V1::SecureSourceManager::Client" - }, - "method": { - "short_name": "FetchTree", - "full_name": "google.cloud.securesourcemanager.v1.SecureSourceManager.FetchTree", - "service": { - "short_name": "SecureSourceManager", - "full_name": "google.cloud.securesourcemanager.v1.SecureSourceManager" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 50, - "type": "FULL" - } - ] - }, - { - "region_tag": "securesourcemanager_v1_generated_SecureSourceManager_FetchBlob_sync", - "title": "Snippet for the fetch_blob call in the SecureSourceManager service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::SecureSourceManager::V1::SecureSourceManager::Client#fetch_blob.", - "file": "secure_source_manager/fetch_blob.rb", - "language": "RUBY", - "client_method": { - "short_name": "fetch_blob", - "full_name": "::Google::Cloud::SecureSourceManager::V1::SecureSourceManager::Client#fetch_blob", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::SecureSourceManager::V1::FetchBlobRequest", - "name": "request" - } - ], - "result_type": "::Google::Cloud::SecureSourceManager::V1::FetchBlobResponse", - "client": { - "short_name": "SecureSourceManager::Client", - "full_name": "::Google::Cloud::SecureSourceManager::V1::SecureSourceManager::Client" - }, - "method": { - "short_name": "FetchBlob", - "full_name": "google.cloud.securesourcemanager.v1.SecureSourceManager.FetchBlob", - "service": { - "short_name": "SecureSourceManager", - "full_name": "google.cloud.securesourcemanager.v1.SecureSourceManager" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 46, - "type": "FULL" - } - ] - }, - { - "region_tag": "securesourcemanager_v1_generated_SecureSourceManager_CreateIssue_sync", - "title": "Snippet for the create_issue call in the SecureSourceManager service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::SecureSourceManager::V1::SecureSourceManager::Client#create_issue.", - "file": "secure_source_manager/create_issue.rb", - "language": "RUBY", - "client_method": { - "short_name": "create_issue", - "full_name": "::Google::Cloud::SecureSourceManager::V1::SecureSourceManager::Client#create_issue", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::SecureSourceManager::V1::CreateIssueRequest", - "name": "request" - } - ], - "result_type": "::Google::Longrunning::Operation", - "client": { - "short_name": "SecureSourceManager::Client", - "full_name": "::Google::Cloud::SecureSourceManager::V1::SecureSourceManager::Client" - }, - "method": { - "short_name": "CreateIssue", - "full_name": "google.cloud.securesourcemanager.v1.SecureSourceManager.CreateIssue", - "service": { - "short_name": "SecureSourceManager", - "full_name": "google.cloud.securesourcemanager.v1.SecureSourceManager" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 53, - "type": "FULL" - } - ] - }, - { - "region_tag": "securesourcemanager_v1_generated_SecureSourceManager_GetIssue_sync", - "title": "Snippet for the get_issue call in the SecureSourceManager service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::SecureSourceManager::V1::SecureSourceManager::Client#get_issue.", - "file": "secure_source_manager/get_issue.rb", - "language": "RUBY", - "client_method": { - "short_name": "get_issue", - "full_name": "::Google::Cloud::SecureSourceManager::V1::SecureSourceManager::Client#get_issue", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::SecureSourceManager::V1::GetIssueRequest", - "name": "request" - } - ], - "result_type": "::Google::Cloud::SecureSourceManager::V1::Issue", - "client": { - "short_name": "SecureSourceManager::Client", - "full_name": "::Google::Cloud::SecureSourceManager::V1::SecureSourceManager::Client" - }, - "method": { - "short_name": "GetIssue", - "full_name": "google.cloud.securesourcemanager.v1.SecureSourceManager.GetIssue", - "service": { - "short_name": "SecureSourceManager", - "full_name": "google.cloud.securesourcemanager.v1.SecureSourceManager" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 46, - "type": "FULL" - } - ] - }, - { - "region_tag": "securesourcemanager_v1_generated_SecureSourceManager_ListIssues_sync", - "title": "Snippet for the list_issues call in the SecureSourceManager service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::SecureSourceManager::V1::SecureSourceManager::Client#list_issues.", - "file": "secure_source_manager/list_issues.rb", - "language": "RUBY", - "client_method": { - "short_name": "list_issues", - "full_name": "::Google::Cloud::SecureSourceManager::V1::SecureSourceManager::Client#list_issues", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::SecureSourceManager::V1::ListIssuesRequest", - "name": "request" - } - ], - "result_type": "::Google::Cloud::SecureSourceManager::V1::ListIssuesResponse", - "client": { - "short_name": "SecureSourceManager::Client", - "full_name": "::Google::Cloud::SecureSourceManager::V1::SecureSourceManager::Client" - }, - "method": { - "short_name": "ListIssues", - "full_name": "google.cloud.securesourcemanager.v1.SecureSourceManager.ListIssues", - "service": { - "short_name": "SecureSourceManager", - "full_name": "google.cloud.securesourcemanager.v1.SecureSourceManager" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 50, - "type": "FULL" - } - ] - }, - { - "region_tag": "securesourcemanager_v1_generated_SecureSourceManager_UpdateIssue_sync", - "title": "Snippet for the update_issue call in the SecureSourceManager service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::SecureSourceManager::V1::SecureSourceManager::Client#update_issue.", - "file": "secure_source_manager/update_issue.rb", - "language": "RUBY", - "client_method": { - "short_name": "update_issue", - "full_name": "::Google::Cloud::SecureSourceManager::V1::SecureSourceManager::Client#update_issue", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::SecureSourceManager::V1::UpdateIssueRequest", - "name": "request" - } - ], - "result_type": "::Google::Longrunning::Operation", - "client": { - "short_name": "SecureSourceManager::Client", - "full_name": "::Google::Cloud::SecureSourceManager::V1::SecureSourceManager::Client" - }, - "method": { - "short_name": "UpdateIssue", - "full_name": "google.cloud.securesourcemanager.v1.SecureSourceManager.UpdateIssue", - "service": { - "short_name": "SecureSourceManager", - "full_name": "google.cloud.securesourcemanager.v1.SecureSourceManager" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 53, - "type": "FULL" - } - ] - }, - { - "region_tag": "securesourcemanager_v1_generated_SecureSourceManager_DeleteIssue_sync", - "title": "Snippet for the delete_issue call in the SecureSourceManager service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::SecureSourceManager::V1::SecureSourceManager::Client#delete_issue.", - "file": "secure_source_manager/delete_issue.rb", - "language": "RUBY", - "client_method": { - "short_name": "delete_issue", - "full_name": "::Google::Cloud::SecureSourceManager::V1::SecureSourceManager::Client#delete_issue", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::SecureSourceManager::V1::DeleteIssueRequest", - "name": "request" - } - ], - "result_type": "::Google::Longrunning::Operation", - "client": { - "short_name": "SecureSourceManager::Client", - "full_name": "::Google::Cloud::SecureSourceManager::V1::SecureSourceManager::Client" - }, - "method": { - "short_name": "DeleteIssue", - "full_name": "google.cloud.securesourcemanager.v1.SecureSourceManager.DeleteIssue", - "service": { - "short_name": "SecureSourceManager", - "full_name": "google.cloud.securesourcemanager.v1.SecureSourceManager" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 53, - "type": "FULL" - } - ] - }, - { - "region_tag": "securesourcemanager_v1_generated_SecureSourceManager_OpenIssue_sync", - "title": "Snippet for the open_issue call in the SecureSourceManager service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::SecureSourceManager::V1::SecureSourceManager::Client#open_issue.", - "file": "secure_source_manager/open_issue.rb", - "language": "RUBY", - "client_method": { - "short_name": "open_issue", - "full_name": "::Google::Cloud::SecureSourceManager::V1::SecureSourceManager::Client#open_issue", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::SecureSourceManager::V1::OpenIssueRequest", - "name": "request" - } - ], - "result_type": "::Google::Longrunning::Operation", - "client": { - "short_name": "SecureSourceManager::Client", - "full_name": "::Google::Cloud::SecureSourceManager::V1::SecureSourceManager::Client" - }, - "method": { - "short_name": "OpenIssue", - "full_name": "google.cloud.securesourcemanager.v1.SecureSourceManager.OpenIssue", - "service": { - "short_name": "SecureSourceManager", - "full_name": "google.cloud.securesourcemanager.v1.SecureSourceManager" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 53, - "type": "FULL" - } - ] - }, - { - "region_tag": "securesourcemanager_v1_generated_SecureSourceManager_CloseIssue_sync", - "title": "Snippet for the close_issue call in the SecureSourceManager service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::SecureSourceManager::V1::SecureSourceManager::Client#close_issue.", - "file": "secure_source_manager/close_issue.rb", - "language": "RUBY", - "client_method": { - "short_name": "close_issue", - "full_name": "::Google::Cloud::SecureSourceManager::V1::SecureSourceManager::Client#close_issue", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::SecureSourceManager::V1::CloseIssueRequest", - "name": "request" - } - ], - "result_type": "::Google::Longrunning::Operation", - "client": { - "short_name": "SecureSourceManager::Client", - "full_name": "::Google::Cloud::SecureSourceManager::V1::SecureSourceManager::Client" - }, - "method": { - "short_name": "CloseIssue", - "full_name": "google.cloud.securesourcemanager.v1.SecureSourceManager.CloseIssue", - "service": { - "short_name": "SecureSourceManager", - "full_name": "google.cloud.securesourcemanager.v1.SecureSourceManager" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 53, - "type": "FULL" - } - ] - }, - { - "region_tag": "securesourcemanager_v1_generated_SecureSourceManager_GetPullRequestComment_sync", - "title": "Snippet for the get_pull_request_comment call in the SecureSourceManager service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::SecureSourceManager::V1::SecureSourceManager::Client#get_pull_request_comment.", - "file": "secure_source_manager/get_pull_request_comment.rb", - "language": "RUBY", - "client_method": { - "short_name": "get_pull_request_comment", - "full_name": "::Google::Cloud::SecureSourceManager::V1::SecureSourceManager::Client#get_pull_request_comment", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::SecureSourceManager::V1::GetPullRequestCommentRequest", - "name": "request" - } - ], - "result_type": "::Google::Cloud::SecureSourceManager::V1::PullRequestComment", - "client": { - "short_name": "SecureSourceManager::Client", - "full_name": "::Google::Cloud::SecureSourceManager::V1::SecureSourceManager::Client" - }, - "method": { - "short_name": "GetPullRequestComment", - "full_name": "google.cloud.securesourcemanager.v1.SecureSourceManager.GetPullRequestComment", - "service": { - "short_name": "SecureSourceManager", - "full_name": "google.cloud.securesourcemanager.v1.SecureSourceManager" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 46, - "type": "FULL" - } - ] - }, - { - "region_tag": "securesourcemanager_v1_generated_SecureSourceManager_ListPullRequestComments_sync", - "title": "Snippet for the list_pull_request_comments call in the SecureSourceManager service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::SecureSourceManager::V1::SecureSourceManager::Client#list_pull_request_comments.", - "file": "secure_source_manager/list_pull_request_comments.rb", - "language": "RUBY", - "client_method": { - "short_name": "list_pull_request_comments", - "full_name": "::Google::Cloud::SecureSourceManager::V1::SecureSourceManager::Client#list_pull_request_comments", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::SecureSourceManager::V1::ListPullRequestCommentsRequest", - "name": "request" - } - ], - "result_type": "::Google::Cloud::SecureSourceManager::V1::ListPullRequestCommentsResponse", - "client": { - "short_name": "SecureSourceManager::Client", - "full_name": "::Google::Cloud::SecureSourceManager::V1::SecureSourceManager::Client" - }, - "method": { - "short_name": "ListPullRequestComments", - "full_name": "google.cloud.securesourcemanager.v1.SecureSourceManager.ListPullRequestComments", - "service": { - "short_name": "SecureSourceManager", - "full_name": "google.cloud.securesourcemanager.v1.SecureSourceManager" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 50, - "type": "FULL" - } - ] - }, - { - "region_tag": "securesourcemanager_v1_generated_SecureSourceManager_CreatePullRequestComment_sync", - "title": "Snippet for the create_pull_request_comment call in the SecureSourceManager service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::SecureSourceManager::V1::SecureSourceManager::Client#create_pull_request_comment.", - "file": "secure_source_manager/create_pull_request_comment.rb", - "language": "RUBY", - "client_method": { - "short_name": "create_pull_request_comment", - "full_name": "::Google::Cloud::SecureSourceManager::V1::SecureSourceManager::Client#create_pull_request_comment", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::SecureSourceManager::V1::CreatePullRequestCommentRequest", - "name": "request" - } - ], - "result_type": "::Google::Longrunning::Operation", - "client": { - "short_name": "SecureSourceManager::Client", - "full_name": "::Google::Cloud::SecureSourceManager::V1::SecureSourceManager::Client" - }, - "method": { - "short_name": "CreatePullRequestComment", - "full_name": "google.cloud.securesourcemanager.v1.SecureSourceManager.CreatePullRequestComment", - "service": { - "short_name": "SecureSourceManager", - "full_name": "google.cloud.securesourcemanager.v1.SecureSourceManager" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 53, - "type": "FULL" - } - ] - }, - { - "region_tag": "securesourcemanager_v1_generated_SecureSourceManager_UpdatePullRequestComment_sync", - "title": "Snippet for the update_pull_request_comment call in the SecureSourceManager service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::SecureSourceManager::V1::SecureSourceManager::Client#update_pull_request_comment.", - "file": "secure_source_manager/update_pull_request_comment.rb", - "language": "RUBY", - "client_method": { - "short_name": "update_pull_request_comment", - "full_name": "::Google::Cloud::SecureSourceManager::V1::SecureSourceManager::Client#update_pull_request_comment", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::SecureSourceManager::V1::UpdatePullRequestCommentRequest", - "name": "request" - } - ], - "result_type": "::Google::Longrunning::Operation", - "client": { - "short_name": "SecureSourceManager::Client", - "full_name": "::Google::Cloud::SecureSourceManager::V1::SecureSourceManager::Client" - }, - "method": { - "short_name": "UpdatePullRequestComment", - "full_name": "google.cloud.securesourcemanager.v1.SecureSourceManager.UpdatePullRequestComment", - "service": { - "short_name": "SecureSourceManager", - "full_name": "google.cloud.securesourcemanager.v1.SecureSourceManager" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 53, - "type": "FULL" - } - ] - }, - { - "region_tag": "securesourcemanager_v1_generated_SecureSourceManager_DeletePullRequestComment_sync", - "title": "Snippet for the delete_pull_request_comment call in the SecureSourceManager service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::SecureSourceManager::V1::SecureSourceManager::Client#delete_pull_request_comment.", - "file": "secure_source_manager/delete_pull_request_comment.rb", - "language": "RUBY", - "client_method": { - "short_name": "delete_pull_request_comment", - "full_name": "::Google::Cloud::SecureSourceManager::V1::SecureSourceManager::Client#delete_pull_request_comment", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::SecureSourceManager::V1::DeletePullRequestCommentRequest", - "name": "request" - } - ], - "result_type": "::Google::Longrunning::Operation", - "client": { - "short_name": "SecureSourceManager::Client", - "full_name": "::Google::Cloud::SecureSourceManager::V1::SecureSourceManager::Client" - }, - "method": { - "short_name": "DeletePullRequestComment", - "full_name": "google.cloud.securesourcemanager.v1.SecureSourceManager.DeletePullRequestComment", - "service": { - "short_name": "SecureSourceManager", - "full_name": "google.cloud.securesourcemanager.v1.SecureSourceManager" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 53, - "type": "FULL" - } - ] - }, - { - "region_tag": "securesourcemanager_v1_generated_SecureSourceManager_BatchCreatePullRequestComments_sync", - "title": "Snippet for the batch_create_pull_request_comments call in the SecureSourceManager service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::SecureSourceManager::V1::SecureSourceManager::Client#batch_create_pull_request_comments.", - "file": "secure_source_manager/batch_create_pull_request_comments.rb", - "language": "RUBY", - "client_method": { - "short_name": "batch_create_pull_request_comments", - "full_name": "::Google::Cloud::SecureSourceManager::V1::SecureSourceManager::Client#batch_create_pull_request_comments", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::SecureSourceManager::V1::BatchCreatePullRequestCommentsRequest", - "name": "request" - } - ], - "result_type": "::Google::Longrunning::Operation", - "client": { - "short_name": "SecureSourceManager::Client", - "full_name": "::Google::Cloud::SecureSourceManager::V1::SecureSourceManager::Client" - }, - "method": { - "short_name": "BatchCreatePullRequestComments", - "full_name": "google.cloud.securesourcemanager.v1.SecureSourceManager.BatchCreatePullRequestComments", - "service": { - "short_name": "SecureSourceManager", - "full_name": "google.cloud.securesourcemanager.v1.SecureSourceManager" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 53, - "type": "FULL" - } - ] - }, - { - "region_tag": "securesourcemanager_v1_generated_SecureSourceManager_ResolvePullRequestComments_sync", - "title": "Snippet for the resolve_pull_request_comments call in the SecureSourceManager service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::SecureSourceManager::V1::SecureSourceManager::Client#resolve_pull_request_comments.", - "file": "secure_source_manager/resolve_pull_request_comments.rb", - "language": "RUBY", - "client_method": { - "short_name": "resolve_pull_request_comments", - "full_name": "::Google::Cloud::SecureSourceManager::V1::SecureSourceManager::Client#resolve_pull_request_comments", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::SecureSourceManager::V1::ResolvePullRequestCommentsRequest", - "name": "request" - } - ], - "result_type": "::Google::Longrunning::Operation", - "client": { - "short_name": "SecureSourceManager::Client", - "full_name": "::Google::Cloud::SecureSourceManager::V1::SecureSourceManager::Client" - }, - "method": { - "short_name": "ResolvePullRequestComments", - "full_name": "google.cloud.securesourcemanager.v1.SecureSourceManager.ResolvePullRequestComments", - "service": { - "short_name": "SecureSourceManager", - "full_name": "google.cloud.securesourcemanager.v1.SecureSourceManager" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 53, - "type": "FULL" - } - ] - }, - { - "region_tag": "securesourcemanager_v1_generated_SecureSourceManager_UnresolvePullRequestComments_sync", - "title": "Snippet for the unresolve_pull_request_comments call in the SecureSourceManager service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::SecureSourceManager::V1::SecureSourceManager::Client#unresolve_pull_request_comments.", - "file": "secure_source_manager/unresolve_pull_request_comments.rb", - "language": "RUBY", - "client_method": { - "short_name": "unresolve_pull_request_comments", - "full_name": "::Google::Cloud::SecureSourceManager::V1::SecureSourceManager::Client#unresolve_pull_request_comments", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::SecureSourceManager::V1::UnresolvePullRequestCommentsRequest", - "name": "request" - } - ], - "result_type": "::Google::Longrunning::Operation", - "client": { - "short_name": "SecureSourceManager::Client", - "full_name": "::Google::Cloud::SecureSourceManager::V1::SecureSourceManager::Client" - }, - "method": { - "short_name": "UnresolvePullRequestComments", - "full_name": "google.cloud.securesourcemanager.v1.SecureSourceManager.UnresolvePullRequestComments", - "service": { - "short_name": "SecureSourceManager", - "full_name": "google.cloud.securesourcemanager.v1.SecureSourceManager" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 53, - "type": "FULL" - } - ] - }, - { - "region_tag": "securesourcemanager_v1_generated_SecureSourceManager_CreateIssueComment_sync", - "title": "Snippet for the create_issue_comment call in the SecureSourceManager service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::SecureSourceManager::V1::SecureSourceManager::Client#create_issue_comment.", - "file": "secure_source_manager/create_issue_comment.rb", - "language": "RUBY", - "client_method": { - "short_name": "create_issue_comment", - "full_name": "::Google::Cloud::SecureSourceManager::V1::SecureSourceManager::Client#create_issue_comment", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::SecureSourceManager::V1::CreateIssueCommentRequest", - "name": "request" - } - ], - "result_type": "::Google::Longrunning::Operation", - "client": { - "short_name": "SecureSourceManager::Client", - "full_name": "::Google::Cloud::SecureSourceManager::V1::SecureSourceManager::Client" - }, - "method": { - "short_name": "CreateIssueComment", - "full_name": "google.cloud.securesourcemanager.v1.SecureSourceManager.CreateIssueComment", - "service": { - "short_name": "SecureSourceManager", - "full_name": "google.cloud.securesourcemanager.v1.SecureSourceManager" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 53, - "type": "FULL" - } - ] - }, - { - "region_tag": "securesourcemanager_v1_generated_SecureSourceManager_GetIssueComment_sync", - "title": "Snippet for the get_issue_comment call in the SecureSourceManager service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::SecureSourceManager::V1::SecureSourceManager::Client#get_issue_comment.", - "file": "secure_source_manager/get_issue_comment.rb", - "language": "RUBY", - "client_method": { - "short_name": "get_issue_comment", - "full_name": "::Google::Cloud::SecureSourceManager::V1::SecureSourceManager::Client#get_issue_comment", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::SecureSourceManager::V1::GetIssueCommentRequest", - "name": "request" - } - ], - "result_type": "::Google::Cloud::SecureSourceManager::V1::IssueComment", - "client": { - "short_name": "SecureSourceManager::Client", - "full_name": "::Google::Cloud::SecureSourceManager::V1::SecureSourceManager::Client" - }, - "method": { - "short_name": "GetIssueComment", - "full_name": "google.cloud.securesourcemanager.v1.SecureSourceManager.GetIssueComment", - "service": { - "short_name": "SecureSourceManager", - "full_name": "google.cloud.securesourcemanager.v1.SecureSourceManager" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 46, - "type": "FULL" - } - ] - }, - { - "region_tag": "securesourcemanager_v1_generated_SecureSourceManager_ListIssueComments_sync", - "title": "Snippet for the list_issue_comments call in the SecureSourceManager service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::SecureSourceManager::V1::SecureSourceManager::Client#list_issue_comments.", - "file": "secure_source_manager/list_issue_comments.rb", - "language": "RUBY", - "client_method": { - "short_name": "list_issue_comments", - "full_name": "::Google::Cloud::SecureSourceManager::V1::SecureSourceManager::Client#list_issue_comments", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::SecureSourceManager::V1::ListIssueCommentsRequest", - "name": "request" - } - ], - "result_type": "::Google::Cloud::SecureSourceManager::V1::ListIssueCommentsResponse", - "client": { - "short_name": "SecureSourceManager::Client", - "full_name": "::Google::Cloud::SecureSourceManager::V1::SecureSourceManager::Client" - }, - "method": { - "short_name": "ListIssueComments", - "full_name": "google.cloud.securesourcemanager.v1.SecureSourceManager.ListIssueComments", - "service": { - "short_name": "SecureSourceManager", - "full_name": "google.cloud.securesourcemanager.v1.SecureSourceManager" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 50, - "type": "FULL" - } - ] - }, - { - "region_tag": "securesourcemanager_v1_generated_SecureSourceManager_UpdateIssueComment_sync", - "title": "Snippet for the update_issue_comment call in the SecureSourceManager service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::SecureSourceManager::V1::SecureSourceManager::Client#update_issue_comment.", - "file": "secure_source_manager/update_issue_comment.rb", - "language": "RUBY", - "client_method": { - "short_name": "update_issue_comment", - "full_name": "::Google::Cloud::SecureSourceManager::V1::SecureSourceManager::Client#update_issue_comment", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::SecureSourceManager::V1::UpdateIssueCommentRequest", - "name": "request" - } - ], - "result_type": "::Google::Longrunning::Operation", - "client": { - "short_name": "SecureSourceManager::Client", - "full_name": "::Google::Cloud::SecureSourceManager::V1::SecureSourceManager::Client" - }, - "method": { - "short_name": "UpdateIssueComment", - "full_name": "google.cloud.securesourcemanager.v1.SecureSourceManager.UpdateIssueComment", - "service": { - "short_name": "SecureSourceManager", - "full_name": "google.cloud.securesourcemanager.v1.SecureSourceManager" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 53, - "type": "FULL" - } - ] - }, - { - "region_tag": "securesourcemanager_v1_generated_SecureSourceManager_DeleteIssueComment_sync", - "title": "Snippet for the delete_issue_comment call in the SecureSourceManager service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::SecureSourceManager::V1::SecureSourceManager::Client#delete_issue_comment.", - "file": "secure_source_manager/delete_issue_comment.rb", - "language": "RUBY", - "client_method": { - "short_name": "delete_issue_comment", - "full_name": "::Google::Cloud::SecureSourceManager::V1::SecureSourceManager::Client#delete_issue_comment", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::SecureSourceManager::V1::DeleteIssueCommentRequest", - "name": "request" - } - ], - "result_type": "::Google::Longrunning::Operation", - "client": { - "short_name": "SecureSourceManager::Client", - "full_name": "::Google::Cloud::SecureSourceManager::V1::SecureSourceManager::Client" - }, - "method": { - "short_name": "DeleteIssueComment", - "full_name": "google.cloud.securesourcemanager.v1.SecureSourceManager.DeleteIssueComment", - "service": { - "short_name": "SecureSourceManager", - "full_name": "google.cloud.securesourcemanager.v1.SecureSourceManager" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 53, - "type": "FULL" - } - ] - } - ] -} \ No newline at end of file diff --git a/owl-bot-staging/google-cloud-secure_source_manager-v1/test/google/cloud/secure_source_manager/v1/secure_source_manager_operations_test.rb b/owl-bot-staging/google-cloud-secure_source_manager-v1/test/google/cloud/secure_source_manager/v1/secure_source_manager_operations_test.rb deleted file mode 100644 index 1698cd8fc998..000000000000 --- a/owl-bot-staging/google-cloud-secure_source_manager-v1/test/google/cloud/secure_source_manager/v1/secure_source_manager_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/cloud/securesourcemanager/v1/secure_source_manager_pb" -require "google/cloud/securesourcemanager/v1/secure_source_manager_services_pb" -require "google/cloud/secure_source_manager/v1/secure_source_manager" - -class ::Google::Cloud::SecureSourceManager::V1::SecureSourceManager::OperationsTest < Minitest::Test - class ClientStub - attr_accessor :call_rpc_count, :requests - - def initialize response, operation, &block - @response = response - @operation = operation - @block = block - @call_rpc_count = 0 - @requests = [] - end - - def call_rpc *args, **kwargs - @call_rpc_count += 1 - - @requests << @block&.call(*args, **kwargs) - - catch :response do - yield @response, @operation if block_given? - @response - end - end - - def endpoint - "endpoint.example.com" - end - - def universe_domain - "example.com" - end - - def stub_logger - nil - end - - def logger - nil - end - end - - def test_list_operations - # Create GRPC objects. - grpc_response = ::Google::Longrunning::ListOperationsResponse.new - grpc_operation = GRPC::ActiveCall::Operation.new nil - grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - grpc_options = {} - - # Create request parameters for a unary method. - name = "hello world" - filter = "hello world" - page_size = 42 - page_token = "hello world" - return_partial_success = true - - list_operations_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :list_operations, name - assert_kind_of ::Google::Longrunning::ListOperationsRequest, request - assert_equal "hello world", request["name"] - assert_equal "hello world", request["filter"] - assert_equal 42, request["page_size"] - assert_equal "hello world", request["page_token"] - assert_equal true, request["return_partial_success"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, list_operations_client_stub do - # Create client - client = ::Google::Cloud::SecureSourceManager::V1::SecureSourceManager::Operations.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.list_operations({ name: name, filter: filter, page_size: page_size, page_token: page_token, return_partial_success: return_partial_success }) do |response, operation| - assert_kind_of Gapic::PagedEnumerable, response - assert_equal grpc_response, response.response - assert_equal grpc_operation, operation - end - - # Use named arguments - client.list_operations name: name, filter: filter, page_size: page_size, page_token: page_token, return_partial_success: return_partial_success do |response, operation| - assert_kind_of Gapic::PagedEnumerable, response - assert_equal grpc_response, response.response - assert_equal grpc_operation, operation - end - - # Use protobuf object - client.list_operations ::Google::Longrunning::ListOperationsRequest.new(name: name, filter: filter, page_size: page_size, page_token: page_token, return_partial_success: return_partial_success) do |response, operation| - assert_kind_of Gapic::PagedEnumerable, response - assert_equal grpc_response, response.response - assert_equal grpc_operation, operation - end - - # Use hash object with options - client.list_operations({ name: name, filter: filter, page_size: page_size, page_token: page_token, return_partial_success: return_partial_success }, grpc_options) do |response, operation| - assert_kind_of Gapic::PagedEnumerable, response - assert_equal grpc_response, response.response - assert_equal grpc_operation, operation - end - - # Use protobuf object with options - client.list_operations(::Google::Longrunning::ListOperationsRequest.new(name: name, filter: filter, page_size: page_size, page_token: page_token, return_partial_success: return_partial_success), grpc_options) do |response, operation| - assert_kind_of Gapic::PagedEnumerable, response - assert_equal grpc_response, response.response - assert_equal grpc_operation, operation - end - - # Verify method calls - assert_equal 5, list_operations_client_stub.call_rpc_count - end - end - - def test_get_operation - # Create GRPC objects. - grpc_response = ::Google::Longrunning::Operation.new - grpc_operation = GRPC::ActiveCall::Operation.new nil - grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - grpc_options = {} - - # Create request parameters for a unary method. - name = "hello world" - - get_operation_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :get_operation, name - assert_kind_of ::Google::Longrunning::GetOperationRequest, request - assert_equal "hello world", request["name"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, get_operation_client_stub do - # Create client - client = ::Google::Cloud::SecureSourceManager::V1::SecureSourceManager::Operations.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.get_operation({ name: name }) do |response, operation| - assert_kind_of Gapic::Operation, response - assert_equal grpc_response, response.grpc_op - assert_equal grpc_operation, operation - end - - # Use named arguments - client.get_operation name: name do |response, operation| - assert_kind_of Gapic::Operation, response - assert_equal grpc_response, response.grpc_op - assert_equal grpc_operation, operation - end - - # Use protobuf object - client.get_operation ::Google::Longrunning::GetOperationRequest.new(name: name) do |response, operation| - assert_kind_of Gapic::Operation, response - assert_equal grpc_response, response.grpc_op - assert_equal grpc_operation, operation - end - - # Use hash object with options - client.get_operation({ name: name }, grpc_options) do |response, operation| - assert_kind_of Gapic::Operation, response - assert_equal grpc_response, response.grpc_op - assert_equal grpc_operation, operation - end - - # Use protobuf object with options - client.get_operation(::Google::Longrunning::GetOperationRequest.new(name: name), grpc_options) do |response, operation| - assert_kind_of Gapic::Operation, response - assert_equal grpc_response, response.grpc_op - assert_equal grpc_operation, operation - end - - # Verify method calls - assert_equal 5, get_operation_client_stub.call_rpc_count - end - end - - def test_delete_operation - # Create GRPC objects. - grpc_response = ::Google::Protobuf::Empty.new - grpc_operation = GRPC::ActiveCall::Operation.new nil - grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - grpc_options = {} - - # Create request parameters for a unary method. - name = "hello world" - - delete_operation_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :delete_operation, name - assert_kind_of ::Google::Longrunning::DeleteOperationRequest, request - assert_equal "hello world", request["name"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, delete_operation_client_stub do - # Create client - client = ::Google::Cloud::SecureSourceManager::V1::SecureSourceManager::Operations.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.delete_operation({ name: name }) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use named arguments - client.delete_operation name: name do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object - client.delete_operation ::Google::Longrunning::DeleteOperationRequest.new(name: name) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use hash object with options - client.delete_operation({ name: name }, grpc_options) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object with options - client.delete_operation(::Google::Longrunning::DeleteOperationRequest.new(name: name), grpc_options) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Verify method calls - assert_equal 5, delete_operation_client_stub.call_rpc_count - end - end - - def test_cancel_operation - # Create GRPC objects. - grpc_response = ::Google::Protobuf::Empty.new - grpc_operation = GRPC::ActiveCall::Operation.new nil - grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - grpc_options = {} - - # Create request parameters for a unary method. - name = "hello world" - - cancel_operation_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :cancel_operation, name - assert_kind_of ::Google::Longrunning::CancelOperationRequest, request - assert_equal "hello world", request["name"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, cancel_operation_client_stub do - # Create client - client = ::Google::Cloud::SecureSourceManager::V1::SecureSourceManager::Operations.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.cancel_operation({ name: name }) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use named arguments - client.cancel_operation name: name do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object - client.cancel_operation ::Google::Longrunning::CancelOperationRequest.new(name: name) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use hash object with options - client.cancel_operation({ name: name }, grpc_options) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object with options - client.cancel_operation(::Google::Longrunning::CancelOperationRequest.new(name: name), grpc_options) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Verify method calls - assert_equal 5, cancel_operation_client_stub.call_rpc_count - end - end - - def test_wait_operation - # Create GRPC objects. - grpc_response = ::Google::Longrunning::Operation.new - grpc_operation = GRPC::ActiveCall::Operation.new nil - grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - grpc_options = {} - - # Create request parameters for a unary method. - name = "hello world" - timeout = {} - - wait_operation_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :wait_operation, name - assert_kind_of ::Google::Longrunning::WaitOperationRequest, request - assert_equal "hello world", request["name"] - assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Protobuf::Duration), request["timeout"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, wait_operation_client_stub do - # Create client - client = ::Google::Cloud::SecureSourceManager::V1::SecureSourceManager::Operations.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.wait_operation({ name: name, timeout: timeout }) do |response, operation| - assert_kind_of Gapic::Operation, response - assert_equal grpc_response, response.grpc_op - assert_equal grpc_operation, operation - end - - # Use named arguments - client.wait_operation name: name, timeout: timeout do |response, operation| - assert_kind_of Gapic::Operation, response - assert_equal grpc_response, response.grpc_op - assert_equal grpc_operation, operation - end - - # Use protobuf object - client.wait_operation ::Google::Longrunning::WaitOperationRequest.new(name: name, timeout: timeout) do |response, operation| - assert_kind_of Gapic::Operation, response - assert_equal grpc_response, response.grpc_op - assert_equal grpc_operation, operation - end - - # Use hash object with options - client.wait_operation({ name: name, timeout: timeout }, grpc_options) do |response, operation| - assert_kind_of Gapic::Operation, response - assert_equal grpc_response, response.grpc_op - assert_equal grpc_operation, operation - end - - # Use protobuf object with options - client.wait_operation(::Google::Longrunning::WaitOperationRequest.new(name: name, timeout: timeout), grpc_options) do |response, operation| - assert_kind_of Gapic::Operation, response - assert_equal grpc_response, response.grpc_op - assert_equal grpc_operation, operation - end - - # Verify method calls - assert_equal 5, wait_operation_client_stub.call_rpc_count - end - end - - def test_configure - grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - - client = block_config = config = nil - dummy_stub = ClientStub.new nil, nil - Gapic::ServiceStub.stub :new, dummy_stub do - client = ::Google::Cloud::SecureSourceManager::V1::SecureSourceManager::Operations.new do |config| - config.credentials = grpc_channel - end - end - - config = client.configure do |c| - block_config = c - end - - assert_same block_config, config - assert_kind_of ::Google::Cloud::SecureSourceManager::V1::SecureSourceManager::Operations::Configuration, config - end -end diff --git a/owl-bot-staging/google-cloud-secure_source_manager-v1/test/google/cloud/secure_source_manager/v1/secure_source_manager_paths_test.rb b/owl-bot-staging/google-cloud-secure_source_manager-v1/test/google/cloud/secure_source_manager/v1/secure_source_manager_paths_test.rb deleted file mode 100644 index 1a01ca3ccdef..000000000000 --- a/owl-bot-staging/google-cloud-secure_source_manager-v1/test/google/cloud/secure_source_manager/v1/secure_source_manager_paths_test.rb +++ /dev/null @@ -1,187 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -require "helper" - -require "gapic/grpc/service_stub" - -require "google/cloud/secure_source_manager/v1/secure_source_manager" - -class ::Google::Cloud::SecureSourceManager::V1::SecureSourceManager::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_branch_rule_path - grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - ::Gapic::ServiceStub.stub :new, DummyStub.new do - client = ::Google::Cloud::SecureSourceManager::V1::SecureSourceManager::Client.new do |config| - config.credentials = grpc_channel - end - - path = client.branch_rule_path project: "value0", location: "value1", repository: "value2", branch_rule: "value3" - assert_equal "projects/value0/locations/value1/repositories/value2/branchRules/value3", path - end - end - - def test_ca_pool_path - grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - ::Gapic::ServiceStub.stub :new, DummyStub.new do - client = ::Google::Cloud::SecureSourceManager::V1::SecureSourceManager::Client.new do |config| - config.credentials = grpc_channel - end - - path = client.ca_pool_path project: "value0", location: "value1", ca_pool: "value2" - assert_equal "projects/value0/locations/value1/caPools/value2", path - end - end - - def test_crypto_key_path - grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - ::Gapic::ServiceStub.stub :new, DummyStub.new do - client = ::Google::Cloud::SecureSourceManager::V1::SecureSourceManager::Client.new do |config| - config.credentials = grpc_channel - end - - path = client.crypto_key_path project: "value0", location: "value1", key_ring: "value2", crypto_key: "value3" - assert_equal "projects/value0/locations/value1/keyRings/value2/cryptoKeys/value3", path - end - end - - def test_hook_path - grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - ::Gapic::ServiceStub.stub :new, DummyStub.new do - client = ::Google::Cloud::SecureSourceManager::V1::SecureSourceManager::Client.new do |config| - config.credentials = grpc_channel - end - - path = client.hook_path project: "value0", location: "value1", repository: "value2", hook: "value3" - assert_equal "projects/value0/locations/value1/repositories/value2/hooks/value3", path - end - end - - def test_instance_path - grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - ::Gapic::ServiceStub.stub :new, DummyStub.new do - client = ::Google::Cloud::SecureSourceManager::V1::SecureSourceManager::Client.new do |config| - config.credentials = grpc_channel - end - - path = client.instance_path project: "value0", location: "value1", instance: "value2" - assert_equal "projects/value0/locations/value1/instances/value2", path - end - end - - def test_issue_path - grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - ::Gapic::ServiceStub.stub :new, DummyStub.new do - client = ::Google::Cloud::SecureSourceManager::V1::SecureSourceManager::Client.new do |config| - config.credentials = grpc_channel - end - - path = client.issue_path project: "value0", location: "value1", repository: "value2", issue: "value3" - assert_equal "projects/value0/locations/value1/repositories/value2/issues/value3", path - end - end - - def test_issue_comment_path - grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - ::Gapic::ServiceStub.stub :new, DummyStub.new do - client = ::Google::Cloud::SecureSourceManager::V1::SecureSourceManager::Client.new do |config| - config.credentials = grpc_channel - end - - path = client.issue_comment_path project: "value0", location: "value1", repository: "value2", issue: "value3", comment: "value4" - assert_equal "projects/value0/locations/value1/repositories/value2/issues/value3/issueComments/value4", path - end - end - - def test_location_path - grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - ::Gapic::ServiceStub.stub :new, DummyStub.new do - client = ::Google::Cloud::SecureSourceManager::V1::SecureSourceManager::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_pull_request_path - grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - ::Gapic::ServiceStub.stub :new, DummyStub.new do - client = ::Google::Cloud::SecureSourceManager::V1::SecureSourceManager::Client.new do |config| - config.credentials = grpc_channel - end - - path = client.pull_request_path project: "value0", location: "value1", repository: "value2", pull_request: "value3" - assert_equal "projects/value0/locations/value1/repositories/value2/pullRequests/value3", path - end - end - - def test_pull_request_comment_path - grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - ::Gapic::ServiceStub.stub :new, DummyStub.new do - client = ::Google::Cloud::SecureSourceManager::V1::SecureSourceManager::Client.new do |config| - config.credentials = grpc_channel - end - - path = client.pull_request_comment_path project: "value0", location: "value1", repository: "value2", pull_request: "value3", comment: "value4" - assert_equal "projects/value0/locations/value1/repositories/value2/pullRequests/value3/pullRequestComments/value4", path - end - end - - def test_repository_path - grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - ::Gapic::ServiceStub.stub :new, DummyStub.new do - client = ::Google::Cloud::SecureSourceManager::V1::SecureSourceManager::Client.new do |config| - config.credentials = grpc_channel - end - - path = client.repository_path project: "value0", location: "value1", repository: "value2" - assert_equal "projects/value0/locations/value1/repositories/value2", path - end - end - - def test_service_attachment_path - grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - ::Gapic::ServiceStub.stub :new, DummyStub.new do - client = ::Google::Cloud::SecureSourceManager::V1::SecureSourceManager::Client.new do |config| - config.credentials = grpc_channel - end - - path = client.service_attachment_path project: "value0", region: "value1", service_attachment: "value2" - assert_equal "projects/value0/regions/value1/serviceAttachments/value2", path - end - end -end diff --git a/owl-bot-staging/google-cloud-secure_source_manager-v1/test/google/cloud/secure_source_manager/v1/secure_source_manager_rest_test.rb b/owl-bot-staging/google-cloud-secure_source_manager-v1/test/google/cloud/secure_source_manager/v1/secure_source_manager_rest_test.rb deleted file mode 100644 index e8b27d62697e..000000000000 --- a/owl-bot-staging/google-cloud-secure_source_manager-v1/test/google/cloud/secure_source_manager/v1/secure_source_manager_rest_test.rb +++ /dev/null @@ -1,2972 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -require "helper" -require "gapic/rest" -require "google/cloud/securesourcemanager/v1/secure_source_manager_pb" -require "google/cloud/secure_source_manager/v1/secure_source_manager/rest" - - -class ::Google::Cloud::SecureSourceManager::V1::SecureSourceManager::Rest::ClientTest < Minitest::Test - class ClientStub - attr_accessor :call_count, :requests - - def initialize response, &block - @response = response - @block = block - @call_count = 0 - @requests = [] - end - - def make_get_request uri:, params: {}, options: {}, method_name: nil - make_http_request :get, uri: uri, body: nil, params: params, options: options, method_name: method_name - end - - def make_delete_request uri:, params: {}, options: {}, method_name: nil - make_http_request :delete, uri: uri, body: nil, params: params, options: options, method_name: method_name - end - - def make_post_request uri:, body: nil, params: {}, options: {}, method_name: nil - make_http_request :post, uri: uri, body: body, params: params, options: options, method_name: method_name - end - - def make_patch_request uri:, body:, params: {}, options: {}, method_name: nil - make_http_request :patch, uri: uri, body: body, params: params, options: options, method_name: method_name - end - - def make_put_request uri:, body:, params: {}, options: {}, method_name: nil - make_http_request :put, uri: uri, body: body, params: params, options: options, method_name: method_name - end - - def make_http_request *args, **kwargs - @call_count += 1 - - @requests << @block&.call(*args, **kwargs) - - @response - end - - def endpoint - "endpoint.example.com" - end - - def universe_domain - "example.com" - end - - def stub_logger - nil - end - - def logger - nil - end - end - - def test_list_instances - # Create test objects. - client_result = ::Google::Cloud::SecureSourceManager::V1::ListInstancesResponse.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" - order_by = "hello world" - - list_instances_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| - assert options.metadata.key? :"x-goog-api-client" - assert options.metadata[:"x-goog-api-client"].include? "rest" - refute options.metadata[:"x-goog-api-client"].include? "grpc" - end - - ::Google::Cloud::SecureSourceManager::V1::SecureSourceManager::Rest::ServiceStub.stub :transcode_list_instances_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, list_instances_client_stub do - # Create client - client = ::Google::Cloud::SecureSourceManager::V1::SecureSourceManager::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - client.list_instances({ parent: parent, page_size: page_size, page_token: page_token, filter: filter, order_by: order_by }) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use named arguments - client.list_instances parent: parent, page_size: page_size, page_token: page_token, filter: filter, order_by: order_by do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object - client.list_instances ::Google::Cloud::SecureSourceManager::V1::ListInstancesRequest.new(parent: parent, page_size: page_size, page_token: page_token, filter: filter, order_by: order_by) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use hash object with options - client.list_instances({ parent: parent, page_size: page_size, page_token: page_token, filter: filter, order_by: order_by }, call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object with options - client.list_instances(::Google::Cloud::SecureSourceManager::V1::ListInstancesRequest.new(parent: parent, page_size: page_size, page_token: page_token, filter: filter, order_by: order_by), call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Verify method calls - assert_equal 5, list_instances_client_stub.call_count - end - end - end - - def test_get_instance - # Create test objects. - client_result = ::Google::Cloud::SecureSourceManager::V1::Instance.new - http_response = OpenStruct.new body: client_result.to_json - - call_options = {} - - # Create request parameters for a unary method. - name = "hello world" - - get_instance_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| - assert options.metadata.key? :"x-goog-api-client" - assert options.metadata[:"x-goog-api-client"].include? "rest" - refute options.metadata[:"x-goog-api-client"].include? "grpc" - end - - ::Google::Cloud::SecureSourceManager::V1::SecureSourceManager::Rest::ServiceStub.stub :transcode_get_instance_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, get_instance_client_stub do - # Create client - client = ::Google::Cloud::SecureSourceManager::V1::SecureSourceManager::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - client.get_instance({ name: name }) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use named arguments - client.get_instance name: name do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object - client.get_instance ::Google::Cloud::SecureSourceManager::V1::GetInstanceRequest.new(name: name) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use hash object with options - client.get_instance({ name: name }, call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object with options - client.get_instance(::Google::Cloud::SecureSourceManager::V1::GetInstanceRequest.new(name: name), call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Verify method calls - assert_equal 5, get_instance_client_stub.call_count - end - end - end - - def test_create_instance - # 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" - instance_id = "hello world" - instance = {} - request_id = "hello world" - - create_instance_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| - assert options.metadata.key? :"x-goog-api-client" - assert options.metadata[:"x-goog-api-client"].include? "rest" - refute options.metadata[:"x-goog-api-client"].include? "grpc" - end - - ::Google::Cloud::SecureSourceManager::V1::SecureSourceManager::Rest::ServiceStub.stub :transcode_create_instance_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, create_instance_client_stub do - # Create client - client = ::Google::Cloud::SecureSourceManager::V1::SecureSourceManager::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - client.create_instance({ parent: parent, instance_id: instance_id, instance: instance, request_id: request_id }) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use named arguments - client.create_instance parent: parent, instance_id: instance_id, instance: instance, request_id: request_id do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object - client.create_instance ::Google::Cloud::SecureSourceManager::V1::CreateInstanceRequest.new(parent: parent, instance_id: instance_id, instance: instance, request_id: request_id) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use hash object with options - client.create_instance({ parent: parent, instance_id: instance_id, instance: instance, request_id: request_id }, call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object with options - client.create_instance(::Google::Cloud::SecureSourceManager::V1::CreateInstanceRequest.new(parent: parent, instance_id: instance_id, instance: instance, request_id: request_id), call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Verify method calls - assert_equal 5, create_instance_client_stub.call_count - end - end - end - - def test_delete_instance - # 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" - request_id = "hello world" - - delete_instance_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| - assert options.metadata.key? :"x-goog-api-client" - assert options.metadata[:"x-goog-api-client"].include? "rest" - refute options.metadata[:"x-goog-api-client"].include? "grpc" - end - - ::Google::Cloud::SecureSourceManager::V1::SecureSourceManager::Rest::ServiceStub.stub :transcode_delete_instance_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, delete_instance_client_stub do - # Create client - client = ::Google::Cloud::SecureSourceManager::V1::SecureSourceManager::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - client.delete_instance({ name: name, request_id: request_id }) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use named arguments - client.delete_instance name: name, request_id: request_id do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object - client.delete_instance ::Google::Cloud::SecureSourceManager::V1::DeleteInstanceRequest.new(name: name, request_id: request_id) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use hash object with options - client.delete_instance({ name: name, request_id: request_id }, call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object with options - client.delete_instance(::Google::Cloud::SecureSourceManager::V1::DeleteInstanceRequest.new(name: name, request_id: request_id), call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Verify method calls - assert_equal 5, delete_instance_client_stub.call_count - end - end - end - - def test_list_repositories - # Create test objects. - client_result = ::Google::Cloud::SecureSourceManager::V1::ListRepositoriesResponse.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" - instance = "hello world" - - list_repositories_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| - assert options.metadata.key? :"x-goog-api-client" - assert options.metadata[:"x-goog-api-client"].include? "rest" - refute options.metadata[:"x-goog-api-client"].include? "grpc" - end - - ::Google::Cloud::SecureSourceManager::V1::SecureSourceManager::Rest::ServiceStub.stub :transcode_list_repositories_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, list_repositories_client_stub do - # Create client - client = ::Google::Cloud::SecureSourceManager::V1::SecureSourceManager::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - client.list_repositories({ parent: parent, page_size: page_size, page_token: page_token, filter: filter, instance: instance }) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use named arguments - client.list_repositories parent: parent, page_size: page_size, page_token: page_token, filter: filter, instance: instance do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object - client.list_repositories ::Google::Cloud::SecureSourceManager::V1::ListRepositoriesRequest.new(parent: parent, page_size: page_size, page_token: page_token, filter: filter, instance: instance) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use hash object with options - client.list_repositories({ parent: parent, page_size: page_size, page_token: page_token, filter: filter, instance: instance }, call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object with options - client.list_repositories(::Google::Cloud::SecureSourceManager::V1::ListRepositoriesRequest.new(parent: parent, page_size: page_size, page_token: page_token, filter: filter, instance: instance), call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Verify method calls - assert_equal 5, list_repositories_client_stub.call_count - end - end - end - - def test_get_repository - # Create test objects. - client_result = ::Google::Cloud::SecureSourceManager::V1::Repository.new - http_response = OpenStruct.new body: client_result.to_json - - call_options = {} - - # Create request parameters for a unary method. - name = "hello world" - - get_repository_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| - assert options.metadata.key? :"x-goog-api-client" - assert options.metadata[:"x-goog-api-client"].include? "rest" - refute options.metadata[:"x-goog-api-client"].include? "grpc" - end - - ::Google::Cloud::SecureSourceManager::V1::SecureSourceManager::Rest::ServiceStub.stub :transcode_get_repository_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, get_repository_client_stub do - # Create client - client = ::Google::Cloud::SecureSourceManager::V1::SecureSourceManager::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - client.get_repository({ name: name }) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use named arguments - client.get_repository name: name do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object - client.get_repository ::Google::Cloud::SecureSourceManager::V1::GetRepositoryRequest.new(name: name) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use hash object with options - client.get_repository({ name: name }, call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object with options - client.get_repository(::Google::Cloud::SecureSourceManager::V1::GetRepositoryRequest.new(name: name), call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Verify method calls - assert_equal 5, get_repository_client_stub.call_count - end - end - end - - def test_create_repository - # 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" - repository = {} - repository_id = "hello world" - - create_repository_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| - assert options.metadata.key? :"x-goog-api-client" - assert options.metadata[:"x-goog-api-client"].include? "rest" - refute options.metadata[:"x-goog-api-client"].include? "grpc" - end - - ::Google::Cloud::SecureSourceManager::V1::SecureSourceManager::Rest::ServiceStub.stub :transcode_create_repository_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, create_repository_client_stub do - # Create client - client = ::Google::Cloud::SecureSourceManager::V1::SecureSourceManager::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - client.create_repository({ parent: parent, repository: repository, repository_id: repository_id }) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use named arguments - client.create_repository parent: parent, repository: repository, repository_id: repository_id do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object - client.create_repository ::Google::Cloud::SecureSourceManager::V1::CreateRepositoryRequest.new(parent: parent, repository: repository, repository_id: repository_id) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use hash object with options - client.create_repository({ parent: parent, repository: repository, repository_id: repository_id }, call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object with options - client.create_repository(::Google::Cloud::SecureSourceManager::V1::CreateRepositoryRequest.new(parent: parent, repository: repository, repository_id: repository_id), call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Verify method calls - assert_equal 5, create_repository_client_stub.call_count - end - end - end - - def test_update_repository - # 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. - update_mask = {} - repository = {} - validate_only = true - - update_repository_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| - assert options.metadata.key? :"x-goog-api-client" - assert options.metadata[:"x-goog-api-client"].include? "rest" - refute options.metadata[:"x-goog-api-client"].include? "grpc" - end - - ::Google::Cloud::SecureSourceManager::V1::SecureSourceManager::Rest::ServiceStub.stub :transcode_update_repository_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, update_repository_client_stub do - # Create client - client = ::Google::Cloud::SecureSourceManager::V1::SecureSourceManager::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - client.update_repository({ update_mask: update_mask, repository: repository, validate_only: validate_only }) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use named arguments - client.update_repository update_mask: update_mask, repository: repository, validate_only: validate_only do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object - client.update_repository ::Google::Cloud::SecureSourceManager::V1::UpdateRepositoryRequest.new(update_mask: update_mask, repository: repository, validate_only: validate_only) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use hash object with options - client.update_repository({ update_mask: update_mask, repository: repository, validate_only: validate_only }, call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object with options - client.update_repository(::Google::Cloud::SecureSourceManager::V1::UpdateRepositoryRequest.new(update_mask: update_mask, repository: repository, validate_only: validate_only), call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Verify method calls - assert_equal 5, update_repository_client_stub.call_count - end - end - end - - def test_delete_repository - # 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" - allow_missing = true - - delete_repository_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| - assert options.metadata.key? :"x-goog-api-client" - assert options.metadata[:"x-goog-api-client"].include? "rest" - refute options.metadata[:"x-goog-api-client"].include? "grpc" - end - - ::Google::Cloud::SecureSourceManager::V1::SecureSourceManager::Rest::ServiceStub.stub :transcode_delete_repository_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, delete_repository_client_stub do - # Create client - client = ::Google::Cloud::SecureSourceManager::V1::SecureSourceManager::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - client.delete_repository({ name: name, allow_missing: allow_missing }) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use named arguments - client.delete_repository name: name, allow_missing: allow_missing do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object - client.delete_repository ::Google::Cloud::SecureSourceManager::V1::DeleteRepositoryRequest.new(name: name, allow_missing: allow_missing) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use hash object with options - client.delete_repository({ name: name, allow_missing: allow_missing }, call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object with options - client.delete_repository(::Google::Cloud::SecureSourceManager::V1::DeleteRepositoryRequest.new(name: name, allow_missing: allow_missing), call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Verify method calls - assert_equal 5, delete_repository_client_stub.call_count - end - end - end - - def test_list_hooks - # Create test objects. - client_result = ::Google::Cloud::SecureSourceManager::V1::ListHooksResponse.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_hooks_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| - assert options.metadata.key? :"x-goog-api-client" - assert options.metadata[:"x-goog-api-client"].include? "rest" - refute options.metadata[:"x-goog-api-client"].include? "grpc" - end - - ::Google::Cloud::SecureSourceManager::V1::SecureSourceManager::Rest::ServiceStub.stub :transcode_list_hooks_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, list_hooks_client_stub do - # Create client - client = ::Google::Cloud::SecureSourceManager::V1::SecureSourceManager::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - client.list_hooks({ 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_hooks 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_hooks ::Google::Cloud::SecureSourceManager::V1::ListHooksRequest.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_hooks({ 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_hooks(::Google::Cloud::SecureSourceManager::V1::ListHooksRequest.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_hooks_client_stub.call_count - end - end - end - - def test_get_hook - # Create test objects. - client_result = ::Google::Cloud::SecureSourceManager::V1::Hook.new - http_response = OpenStruct.new body: client_result.to_json - - call_options = {} - - # Create request parameters for a unary method. - name = "hello world" - - get_hook_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| - assert options.metadata.key? :"x-goog-api-client" - assert options.metadata[:"x-goog-api-client"].include? "rest" - refute options.metadata[:"x-goog-api-client"].include? "grpc" - end - - ::Google::Cloud::SecureSourceManager::V1::SecureSourceManager::Rest::ServiceStub.stub :transcode_get_hook_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, get_hook_client_stub do - # Create client - client = ::Google::Cloud::SecureSourceManager::V1::SecureSourceManager::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - client.get_hook({ name: name }) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use named arguments - client.get_hook name: name do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object - client.get_hook ::Google::Cloud::SecureSourceManager::V1::GetHookRequest.new(name: name) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use hash object with options - client.get_hook({ name: name }, call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object with options - client.get_hook(::Google::Cloud::SecureSourceManager::V1::GetHookRequest.new(name: name), call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Verify method calls - assert_equal 5, get_hook_client_stub.call_count - end - end - end - - def test_create_hook - # 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" - hook = {} - hook_id = "hello world" - - create_hook_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| - assert options.metadata.key? :"x-goog-api-client" - assert options.metadata[:"x-goog-api-client"].include? "rest" - refute options.metadata[:"x-goog-api-client"].include? "grpc" - end - - ::Google::Cloud::SecureSourceManager::V1::SecureSourceManager::Rest::ServiceStub.stub :transcode_create_hook_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, create_hook_client_stub do - # Create client - client = ::Google::Cloud::SecureSourceManager::V1::SecureSourceManager::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - client.create_hook({ parent: parent, hook: hook, hook_id: hook_id }) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use named arguments - client.create_hook parent: parent, hook: hook, hook_id: hook_id do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object - client.create_hook ::Google::Cloud::SecureSourceManager::V1::CreateHookRequest.new(parent: parent, hook: hook, hook_id: hook_id) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use hash object with options - client.create_hook({ parent: parent, hook: hook, hook_id: hook_id }, call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object with options - client.create_hook(::Google::Cloud::SecureSourceManager::V1::CreateHookRequest.new(parent: parent, hook: hook, hook_id: hook_id), call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Verify method calls - assert_equal 5, create_hook_client_stub.call_count - end - end - end - - def test_update_hook - # 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. - update_mask = {} - hook = {} - - update_hook_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| - assert options.metadata.key? :"x-goog-api-client" - assert options.metadata[:"x-goog-api-client"].include? "rest" - refute options.metadata[:"x-goog-api-client"].include? "grpc" - end - - ::Google::Cloud::SecureSourceManager::V1::SecureSourceManager::Rest::ServiceStub.stub :transcode_update_hook_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, update_hook_client_stub do - # Create client - client = ::Google::Cloud::SecureSourceManager::V1::SecureSourceManager::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - client.update_hook({ update_mask: update_mask, hook: hook }) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use named arguments - client.update_hook update_mask: update_mask, hook: hook do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object - client.update_hook ::Google::Cloud::SecureSourceManager::V1::UpdateHookRequest.new(update_mask: update_mask, hook: hook) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use hash object with options - client.update_hook({ update_mask: update_mask, hook: hook }, call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object with options - client.update_hook(::Google::Cloud::SecureSourceManager::V1::UpdateHookRequest.new(update_mask: update_mask, hook: hook), call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Verify method calls - assert_equal 5, update_hook_client_stub.call_count - end - end - end - - def test_delete_hook - # 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" - - delete_hook_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| - assert options.metadata.key? :"x-goog-api-client" - assert options.metadata[:"x-goog-api-client"].include? "rest" - refute options.metadata[:"x-goog-api-client"].include? "grpc" - end - - ::Google::Cloud::SecureSourceManager::V1::SecureSourceManager::Rest::ServiceStub.stub :transcode_delete_hook_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, delete_hook_client_stub do - # Create client - client = ::Google::Cloud::SecureSourceManager::V1::SecureSourceManager::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - client.delete_hook({ name: name }) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use named arguments - client.delete_hook name: name do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object - client.delete_hook ::Google::Cloud::SecureSourceManager::V1::DeleteHookRequest.new(name: name) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use hash object with options - client.delete_hook({ name: name }, call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object with options - client.delete_hook(::Google::Cloud::SecureSourceManager::V1::DeleteHookRequest.new(name: name), call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Verify method calls - assert_equal 5, delete_hook_client_stub.call_count - end - end - end - - def test_get_iam_policy_repo - # Create test objects. - client_result = ::Google::Iam::V1::Policy.new - http_response = OpenStruct.new body: client_result.to_json - - call_options = {} - - # Create request parameters for a unary method. - resource = "hello world" - options = {} - - get_iam_policy_repo_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| - assert options.metadata.key? :"x-goog-api-client" - assert options.metadata[:"x-goog-api-client"].include? "rest" - refute options.metadata[:"x-goog-api-client"].include? "grpc" - end - - ::Google::Cloud::SecureSourceManager::V1::SecureSourceManager::Rest::ServiceStub.stub :transcode_get_iam_policy_repo_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, get_iam_policy_repo_client_stub do - # Create client - client = ::Google::Cloud::SecureSourceManager::V1::SecureSourceManager::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - client.get_iam_policy_repo({ resource: resource, options: options }) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use named arguments - client.get_iam_policy_repo resource: resource, options: options do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object - client.get_iam_policy_repo ::Google::Iam::V1::GetIamPolicyRequest.new(resource: resource, options: options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use hash object with options - client.get_iam_policy_repo({ resource: resource, options: options }, call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object with options - client.get_iam_policy_repo(::Google::Iam::V1::GetIamPolicyRequest.new(resource: resource, options: options), call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Verify method calls - assert_equal 5, get_iam_policy_repo_client_stub.call_count - end - end - end - - def test_set_iam_policy_repo - # Create test objects. - client_result = ::Google::Iam::V1::Policy.new - http_response = OpenStruct.new body: client_result.to_json - - call_options = {} - - # Create request parameters for a unary method. - resource = "hello world" - policy = {} - update_mask = {} - - set_iam_policy_repo_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| - assert options.metadata.key? :"x-goog-api-client" - assert options.metadata[:"x-goog-api-client"].include? "rest" - refute options.metadata[:"x-goog-api-client"].include? "grpc" - end - - ::Google::Cloud::SecureSourceManager::V1::SecureSourceManager::Rest::ServiceStub.stub :transcode_set_iam_policy_repo_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, set_iam_policy_repo_client_stub do - # Create client - client = ::Google::Cloud::SecureSourceManager::V1::SecureSourceManager::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - client.set_iam_policy_repo({ resource: resource, policy: policy, update_mask: update_mask }) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use named arguments - client.set_iam_policy_repo resource: resource, policy: policy, update_mask: update_mask do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object - client.set_iam_policy_repo ::Google::Iam::V1::SetIamPolicyRequest.new(resource: resource, policy: policy, update_mask: update_mask) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use hash object with options - client.set_iam_policy_repo({ resource: resource, policy: policy, update_mask: update_mask }, call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object with options - client.set_iam_policy_repo(::Google::Iam::V1::SetIamPolicyRequest.new(resource: resource, policy: policy, update_mask: update_mask), call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Verify method calls - assert_equal 5, set_iam_policy_repo_client_stub.call_count - end - end - end - - def test_test_iam_permissions_repo - # Create test objects. - client_result = ::Google::Iam::V1::TestIamPermissionsResponse.new - http_response = OpenStruct.new body: client_result.to_json - - call_options = {} - - # Create request parameters for a unary method. - resource = "hello world" - permissions = ["hello world"] - - test_iam_permissions_repo_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| - assert options.metadata.key? :"x-goog-api-client" - assert options.metadata[:"x-goog-api-client"].include? "rest" - refute options.metadata[:"x-goog-api-client"].include? "grpc" - end - - ::Google::Cloud::SecureSourceManager::V1::SecureSourceManager::Rest::ServiceStub.stub :transcode_test_iam_permissions_repo_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, test_iam_permissions_repo_client_stub do - # Create client - client = ::Google::Cloud::SecureSourceManager::V1::SecureSourceManager::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - client.test_iam_permissions_repo({ resource: resource, permissions: permissions }) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use named arguments - client.test_iam_permissions_repo resource: resource, permissions: permissions do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object - client.test_iam_permissions_repo ::Google::Iam::V1::TestIamPermissionsRequest.new(resource: resource, permissions: permissions) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use hash object with options - client.test_iam_permissions_repo({ resource: resource, permissions: permissions }, call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object with options - client.test_iam_permissions_repo(::Google::Iam::V1::TestIamPermissionsRequest.new(resource: resource, permissions: permissions), call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Verify method calls - assert_equal 5, test_iam_permissions_repo_client_stub.call_count - end - end - end - - def test_create_branch_rule - # 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" - branch_rule = {} - branch_rule_id = "hello world" - - create_branch_rule_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| - assert options.metadata.key? :"x-goog-api-client" - assert options.metadata[:"x-goog-api-client"].include? "rest" - refute options.metadata[:"x-goog-api-client"].include? "grpc" - end - - ::Google::Cloud::SecureSourceManager::V1::SecureSourceManager::Rest::ServiceStub.stub :transcode_create_branch_rule_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, create_branch_rule_client_stub do - # Create client - client = ::Google::Cloud::SecureSourceManager::V1::SecureSourceManager::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - client.create_branch_rule({ parent: parent, branch_rule: branch_rule, branch_rule_id: branch_rule_id }) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use named arguments - client.create_branch_rule parent: parent, branch_rule: branch_rule, branch_rule_id: branch_rule_id do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object - client.create_branch_rule ::Google::Cloud::SecureSourceManager::V1::CreateBranchRuleRequest.new(parent: parent, branch_rule: branch_rule, branch_rule_id: branch_rule_id) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use hash object with options - client.create_branch_rule({ parent: parent, branch_rule: branch_rule, branch_rule_id: branch_rule_id }, call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object with options - client.create_branch_rule(::Google::Cloud::SecureSourceManager::V1::CreateBranchRuleRequest.new(parent: parent, branch_rule: branch_rule, branch_rule_id: branch_rule_id), call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Verify method calls - assert_equal 5, create_branch_rule_client_stub.call_count - end - end - end - - def test_list_branch_rules - # Create test objects. - client_result = ::Google::Cloud::SecureSourceManager::V1::ListBranchRulesResponse.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_branch_rules_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| - assert options.metadata.key? :"x-goog-api-client" - assert options.metadata[:"x-goog-api-client"].include? "rest" - refute options.metadata[:"x-goog-api-client"].include? "grpc" - end - - ::Google::Cloud::SecureSourceManager::V1::SecureSourceManager::Rest::ServiceStub.stub :transcode_list_branch_rules_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, list_branch_rules_client_stub do - # Create client - client = ::Google::Cloud::SecureSourceManager::V1::SecureSourceManager::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - client.list_branch_rules({ 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_branch_rules 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_branch_rules ::Google::Cloud::SecureSourceManager::V1::ListBranchRulesRequest.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_branch_rules({ 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_branch_rules(::Google::Cloud::SecureSourceManager::V1::ListBranchRulesRequest.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_branch_rules_client_stub.call_count - end - end - end - - def test_get_branch_rule - # Create test objects. - client_result = ::Google::Cloud::SecureSourceManager::V1::BranchRule.new - http_response = OpenStruct.new body: client_result.to_json - - call_options = {} - - # Create request parameters for a unary method. - name = "hello world" - - get_branch_rule_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| - assert options.metadata.key? :"x-goog-api-client" - assert options.metadata[:"x-goog-api-client"].include? "rest" - refute options.metadata[:"x-goog-api-client"].include? "grpc" - end - - ::Google::Cloud::SecureSourceManager::V1::SecureSourceManager::Rest::ServiceStub.stub :transcode_get_branch_rule_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, get_branch_rule_client_stub do - # Create client - client = ::Google::Cloud::SecureSourceManager::V1::SecureSourceManager::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - client.get_branch_rule({ name: name }) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use named arguments - client.get_branch_rule name: name do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object - client.get_branch_rule ::Google::Cloud::SecureSourceManager::V1::GetBranchRuleRequest.new(name: name) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use hash object with options - client.get_branch_rule({ name: name }, call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object with options - client.get_branch_rule(::Google::Cloud::SecureSourceManager::V1::GetBranchRuleRequest.new(name: name), call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Verify method calls - assert_equal 5, get_branch_rule_client_stub.call_count - end - end - end - - def test_update_branch_rule - # 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. - branch_rule = {} - validate_only = true - update_mask = {} - - update_branch_rule_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| - assert options.metadata.key? :"x-goog-api-client" - assert options.metadata[:"x-goog-api-client"].include? "rest" - refute options.metadata[:"x-goog-api-client"].include? "grpc" - end - - ::Google::Cloud::SecureSourceManager::V1::SecureSourceManager::Rest::ServiceStub.stub :transcode_update_branch_rule_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, update_branch_rule_client_stub do - # Create client - client = ::Google::Cloud::SecureSourceManager::V1::SecureSourceManager::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - client.update_branch_rule({ branch_rule: branch_rule, validate_only: validate_only, update_mask: update_mask }) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use named arguments - client.update_branch_rule branch_rule: branch_rule, validate_only: validate_only, update_mask: update_mask do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object - client.update_branch_rule ::Google::Cloud::SecureSourceManager::V1::UpdateBranchRuleRequest.new(branch_rule: branch_rule, 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_branch_rule({ branch_rule: branch_rule, 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_branch_rule(::Google::Cloud::SecureSourceManager::V1::UpdateBranchRuleRequest.new(branch_rule: branch_rule, 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_branch_rule_client_stub.call_count - end - end - end - - def test_delete_branch_rule - # 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" - allow_missing = true - - delete_branch_rule_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| - assert options.metadata.key? :"x-goog-api-client" - assert options.metadata[:"x-goog-api-client"].include? "rest" - refute options.metadata[:"x-goog-api-client"].include? "grpc" - end - - ::Google::Cloud::SecureSourceManager::V1::SecureSourceManager::Rest::ServiceStub.stub :transcode_delete_branch_rule_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, delete_branch_rule_client_stub do - # Create client - client = ::Google::Cloud::SecureSourceManager::V1::SecureSourceManager::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - client.delete_branch_rule({ name: name, allow_missing: allow_missing }) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use named arguments - client.delete_branch_rule name: name, allow_missing: allow_missing do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object - client.delete_branch_rule ::Google::Cloud::SecureSourceManager::V1::DeleteBranchRuleRequest.new(name: name, allow_missing: allow_missing) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use hash object with options - client.delete_branch_rule({ name: name, allow_missing: allow_missing }, call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object with options - client.delete_branch_rule(::Google::Cloud::SecureSourceManager::V1::DeleteBranchRuleRequest.new(name: name, allow_missing: allow_missing), call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Verify method calls - assert_equal 5, delete_branch_rule_client_stub.call_count - end - end - end - - def test_create_pull_request - # 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" - pull_request = {} - - create_pull_request_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| - assert options.metadata.key? :"x-goog-api-client" - assert options.metadata[:"x-goog-api-client"].include? "rest" - refute options.metadata[:"x-goog-api-client"].include? "grpc" - end - - ::Google::Cloud::SecureSourceManager::V1::SecureSourceManager::Rest::ServiceStub.stub :transcode_create_pull_request_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, create_pull_request_client_stub do - # Create client - client = ::Google::Cloud::SecureSourceManager::V1::SecureSourceManager::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - client.create_pull_request({ parent: parent, pull_request: pull_request }) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use named arguments - client.create_pull_request parent: parent, pull_request: pull_request do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object - client.create_pull_request ::Google::Cloud::SecureSourceManager::V1::CreatePullRequestRequest.new(parent: parent, pull_request: pull_request) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use hash object with options - client.create_pull_request({ parent: parent, pull_request: pull_request }, call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object with options - client.create_pull_request(::Google::Cloud::SecureSourceManager::V1::CreatePullRequestRequest.new(parent: parent, pull_request: pull_request), call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Verify method calls - assert_equal 5, create_pull_request_client_stub.call_count - end - end - end - - def test_get_pull_request - # Create test objects. - client_result = ::Google::Cloud::SecureSourceManager::V1::PullRequest.new - http_response = OpenStruct.new body: client_result.to_json - - call_options = {} - - # Create request parameters for a unary method. - name = "hello world" - - get_pull_request_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| - assert options.metadata.key? :"x-goog-api-client" - assert options.metadata[:"x-goog-api-client"].include? "rest" - refute options.metadata[:"x-goog-api-client"].include? "grpc" - end - - ::Google::Cloud::SecureSourceManager::V1::SecureSourceManager::Rest::ServiceStub.stub :transcode_get_pull_request_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, get_pull_request_client_stub do - # Create client - client = ::Google::Cloud::SecureSourceManager::V1::SecureSourceManager::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - client.get_pull_request({ name: name }) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use named arguments - client.get_pull_request name: name do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object - client.get_pull_request ::Google::Cloud::SecureSourceManager::V1::GetPullRequestRequest.new(name: name) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use hash object with options - client.get_pull_request({ name: name }, call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object with options - client.get_pull_request(::Google::Cloud::SecureSourceManager::V1::GetPullRequestRequest.new(name: name), call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Verify method calls - assert_equal 5, get_pull_request_client_stub.call_count - end - end - end - - def test_list_pull_requests - # Create test objects. - client_result = ::Google::Cloud::SecureSourceManager::V1::ListPullRequestsResponse.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_pull_requests_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| - assert options.metadata.key? :"x-goog-api-client" - assert options.metadata[:"x-goog-api-client"].include? "rest" - refute options.metadata[:"x-goog-api-client"].include? "grpc" - end - - ::Google::Cloud::SecureSourceManager::V1::SecureSourceManager::Rest::ServiceStub.stub :transcode_list_pull_requests_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, list_pull_requests_client_stub do - # Create client - client = ::Google::Cloud::SecureSourceManager::V1::SecureSourceManager::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - client.list_pull_requests({ 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_pull_requests 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_pull_requests ::Google::Cloud::SecureSourceManager::V1::ListPullRequestsRequest.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_pull_requests({ 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_pull_requests(::Google::Cloud::SecureSourceManager::V1::ListPullRequestsRequest.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_pull_requests_client_stub.call_count - end - end - end - - def test_update_pull_request - # 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. - pull_request = {} - update_mask = {} - - update_pull_request_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| - assert options.metadata.key? :"x-goog-api-client" - assert options.metadata[:"x-goog-api-client"].include? "rest" - refute options.metadata[:"x-goog-api-client"].include? "grpc" - end - - ::Google::Cloud::SecureSourceManager::V1::SecureSourceManager::Rest::ServiceStub.stub :transcode_update_pull_request_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, update_pull_request_client_stub do - # Create client - client = ::Google::Cloud::SecureSourceManager::V1::SecureSourceManager::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - client.update_pull_request({ pull_request: pull_request, update_mask: update_mask }) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use named arguments - client.update_pull_request pull_request: pull_request, update_mask: update_mask do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object - client.update_pull_request ::Google::Cloud::SecureSourceManager::V1::UpdatePullRequestRequest.new(pull_request: pull_request, update_mask: update_mask) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use hash object with options - client.update_pull_request({ pull_request: pull_request, update_mask: update_mask }, call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object with options - client.update_pull_request(::Google::Cloud::SecureSourceManager::V1::UpdatePullRequestRequest.new(pull_request: pull_request, update_mask: update_mask), call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Verify method calls - assert_equal 5, update_pull_request_client_stub.call_count - end - end - end - - def test_merge_pull_request - # 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" - - merge_pull_request_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| - assert options.metadata.key? :"x-goog-api-client" - assert options.metadata[:"x-goog-api-client"].include? "rest" - refute options.metadata[:"x-goog-api-client"].include? "grpc" - end - - ::Google::Cloud::SecureSourceManager::V1::SecureSourceManager::Rest::ServiceStub.stub :transcode_merge_pull_request_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, merge_pull_request_client_stub do - # Create client - client = ::Google::Cloud::SecureSourceManager::V1::SecureSourceManager::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - client.merge_pull_request({ name: name }) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use named arguments - client.merge_pull_request name: name do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object - client.merge_pull_request ::Google::Cloud::SecureSourceManager::V1::MergePullRequestRequest.new(name: name) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use hash object with options - client.merge_pull_request({ name: name }, call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object with options - client.merge_pull_request(::Google::Cloud::SecureSourceManager::V1::MergePullRequestRequest.new(name: name), call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Verify method calls - assert_equal 5, merge_pull_request_client_stub.call_count - end - end - end - - def test_open_pull_request - # 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" - - open_pull_request_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| - assert options.metadata.key? :"x-goog-api-client" - assert options.metadata[:"x-goog-api-client"].include? "rest" - refute options.metadata[:"x-goog-api-client"].include? "grpc" - end - - ::Google::Cloud::SecureSourceManager::V1::SecureSourceManager::Rest::ServiceStub.stub :transcode_open_pull_request_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, open_pull_request_client_stub do - # Create client - client = ::Google::Cloud::SecureSourceManager::V1::SecureSourceManager::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - client.open_pull_request({ name: name }) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use named arguments - client.open_pull_request name: name do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object - client.open_pull_request ::Google::Cloud::SecureSourceManager::V1::OpenPullRequestRequest.new(name: name) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use hash object with options - client.open_pull_request({ name: name }, call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object with options - client.open_pull_request(::Google::Cloud::SecureSourceManager::V1::OpenPullRequestRequest.new(name: name), call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Verify method calls - assert_equal 5, open_pull_request_client_stub.call_count - end - end - end - - def test_close_pull_request - # 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" - - close_pull_request_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| - assert options.metadata.key? :"x-goog-api-client" - assert options.metadata[:"x-goog-api-client"].include? "rest" - refute options.metadata[:"x-goog-api-client"].include? "grpc" - end - - ::Google::Cloud::SecureSourceManager::V1::SecureSourceManager::Rest::ServiceStub.stub :transcode_close_pull_request_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, close_pull_request_client_stub do - # Create client - client = ::Google::Cloud::SecureSourceManager::V1::SecureSourceManager::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - client.close_pull_request({ name: name }) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use named arguments - client.close_pull_request name: name do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object - client.close_pull_request ::Google::Cloud::SecureSourceManager::V1::ClosePullRequestRequest.new(name: name) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use hash object with options - client.close_pull_request({ name: name }, call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object with options - client.close_pull_request(::Google::Cloud::SecureSourceManager::V1::ClosePullRequestRequest.new(name: name), call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Verify method calls - assert_equal 5, close_pull_request_client_stub.call_count - end - end - end - - def test_list_pull_request_file_diffs - # Create test objects. - client_result = ::Google::Cloud::SecureSourceManager::V1::ListPullRequestFileDiffsResponse.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" - - list_pull_request_file_diffs_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| - assert options.metadata.key? :"x-goog-api-client" - assert options.metadata[:"x-goog-api-client"].include? "rest" - refute options.metadata[:"x-goog-api-client"].include? "grpc" - end - - ::Google::Cloud::SecureSourceManager::V1::SecureSourceManager::Rest::ServiceStub.stub :transcode_list_pull_request_file_diffs_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, list_pull_request_file_diffs_client_stub do - # Create client - client = ::Google::Cloud::SecureSourceManager::V1::SecureSourceManager::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - client.list_pull_request_file_diffs({ 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.list_pull_request_file_diffs 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.list_pull_request_file_diffs ::Google::Cloud::SecureSourceManager::V1::ListPullRequestFileDiffsRequest.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.list_pull_request_file_diffs({ 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.list_pull_request_file_diffs(::Google::Cloud::SecureSourceManager::V1::ListPullRequestFileDiffsRequest.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, list_pull_request_file_diffs_client_stub.call_count - end - end - end - - def test_fetch_tree - # Create test objects. - client_result = ::Google::Cloud::SecureSourceManager::V1::FetchTreeResponse.new - http_response = OpenStruct.new body: client_result.to_json - - call_options = {} - - # Create request parameters for a unary method. - repository = "hello world" - ref = "hello world" - recursive = true - page_size = 42 - page_token = "hello world" - - fetch_tree_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| - assert options.metadata.key? :"x-goog-api-client" - assert options.metadata[:"x-goog-api-client"].include? "rest" - refute options.metadata[:"x-goog-api-client"].include? "grpc" - end - - ::Google::Cloud::SecureSourceManager::V1::SecureSourceManager::Rest::ServiceStub.stub :transcode_fetch_tree_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, fetch_tree_client_stub do - # Create client - client = ::Google::Cloud::SecureSourceManager::V1::SecureSourceManager::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - client.fetch_tree({ repository: repository, ref: ref, recursive: recursive, page_size: page_size, page_token: page_token }) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use named arguments - client.fetch_tree repository: repository, ref: ref, recursive: recursive, page_size: page_size, page_token: page_token do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object - client.fetch_tree ::Google::Cloud::SecureSourceManager::V1::FetchTreeRequest.new(repository: repository, ref: ref, recursive: recursive, 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.fetch_tree({ repository: repository, ref: ref, recursive: recursive, 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.fetch_tree(::Google::Cloud::SecureSourceManager::V1::FetchTreeRequest.new(repository: repository, ref: ref, recursive: recursive, 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, fetch_tree_client_stub.call_count - end - end - end - - def test_fetch_blob - # Create test objects. - client_result = ::Google::Cloud::SecureSourceManager::V1::FetchBlobResponse.new - http_response = OpenStruct.new body: client_result.to_json - - call_options = {} - - # Create request parameters for a unary method. - repository = "hello world" - sha = "hello world" - - fetch_blob_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| - assert options.metadata.key? :"x-goog-api-client" - assert options.metadata[:"x-goog-api-client"].include? "rest" - refute options.metadata[:"x-goog-api-client"].include? "grpc" - end - - ::Google::Cloud::SecureSourceManager::V1::SecureSourceManager::Rest::ServiceStub.stub :transcode_fetch_blob_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, fetch_blob_client_stub do - # Create client - client = ::Google::Cloud::SecureSourceManager::V1::SecureSourceManager::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - client.fetch_blob({ repository: repository, sha: sha }) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use named arguments - client.fetch_blob repository: repository, sha: sha do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object - client.fetch_blob ::Google::Cloud::SecureSourceManager::V1::FetchBlobRequest.new(repository: repository, sha: sha) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use hash object with options - client.fetch_blob({ repository: repository, sha: sha }, call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object with options - client.fetch_blob(::Google::Cloud::SecureSourceManager::V1::FetchBlobRequest.new(repository: repository, sha: sha), call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Verify method calls - assert_equal 5, fetch_blob_client_stub.call_count - end - end - end - - def test_create_issue - # 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" - issue = {} - - create_issue_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| - assert options.metadata.key? :"x-goog-api-client" - assert options.metadata[:"x-goog-api-client"].include? "rest" - refute options.metadata[:"x-goog-api-client"].include? "grpc" - end - - ::Google::Cloud::SecureSourceManager::V1::SecureSourceManager::Rest::ServiceStub.stub :transcode_create_issue_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, create_issue_client_stub do - # Create client - client = ::Google::Cloud::SecureSourceManager::V1::SecureSourceManager::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - client.create_issue({ parent: parent, issue: issue }) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use named arguments - client.create_issue parent: parent, issue: issue do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object - client.create_issue ::Google::Cloud::SecureSourceManager::V1::CreateIssueRequest.new(parent: parent, issue: issue) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use hash object with options - client.create_issue({ parent: parent, issue: issue }, call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object with options - client.create_issue(::Google::Cloud::SecureSourceManager::V1::CreateIssueRequest.new(parent: parent, issue: issue), call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Verify method calls - assert_equal 5, create_issue_client_stub.call_count - end - end - end - - def test_get_issue - # Create test objects. - client_result = ::Google::Cloud::SecureSourceManager::V1::Issue.new - http_response = OpenStruct.new body: client_result.to_json - - call_options = {} - - # Create request parameters for a unary method. - name = "hello world" - - get_issue_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| - assert options.metadata.key? :"x-goog-api-client" - assert options.metadata[:"x-goog-api-client"].include? "rest" - refute options.metadata[:"x-goog-api-client"].include? "grpc" - end - - ::Google::Cloud::SecureSourceManager::V1::SecureSourceManager::Rest::ServiceStub.stub :transcode_get_issue_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, get_issue_client_stub do - # Create client - client = ::Google::Cloud::SecureSourceManager::V1::SecureSourceManager::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - client.get_issue({ name: name }) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use named arguments - client.get_issue name: name do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object - client.get_issue ::Google::Cloud::SecureSourceManager::V1::GetIssueRequest.new(name: name) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use hash object with options - client.get_issue({ name: name }, call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object with options - client.get_issue(::Google::Cloud::SecureSourceManager::V1::GetIssueRequest.new(name: name), call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Verify method calls - assert_equal 5, get_issue_client_stub.call_count - end - end - end - - def test_list_issues - # Create test objects. - client_result = ::Google::Cloud::SecureSourceManager::V1::ListIssuesResponse.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_issues_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| - assert options.metadata.key? :"x-goog-api-client" - assert options.metadata[:"x-goog-api-client"].include? "rest" - refute options.metadata[:"x-goog-api-client"].include? "grpc" - end - - ::Google::Cloud::SecureSourceManager::V1::SecureSourceManager::Rest::ServiceStub.stub :transcode_list_issues_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, list_issues_client_stub do - # Create client - client = ::Google::Cloud::SecureSourceManager::V1::SecureSourceManager::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - client.list_issues({ 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_issues 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_issues ::Google::Cloud::SecureSourceManager::V1::ListIssuesRequest.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_issues({ 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_issues(::Google::Cloud::SecureSourceManager::V1::ListIssuesRequest.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_issues_client_stub.call_count - end - end - end - - def test_update_issue - # 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. - issue = {} - update_mask = {} - - update_issue_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| - assert options.metadata.key? :"x-goog-api-client" - assert options.metadata[:"x-goog-api-client"].include? "rest" - refute options.metadata[:"x-goog-api-client"].include? "grpc" - end - - ::Google::Cloud::SecureSourceManager::V1::SecureSourceManager::Rest::ServiceStub.stub :transcode_update_issue_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, update_issue_client_stub do - # Create client - client = ::Google::Cloud::SecureSourceManager::V1::SecureSourceManager::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - client.update_issue({ issue: issue, update_mask: update_mask }) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use named arguments - client.update_issue issue: issue, update_mask: update_mask do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object - client.update_issue ::Google::Cloud::SecureSourceManager::V1::UpdateIssueRequest.new(issue: issue, update_mask: update_mask) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use hash object with options - client.update_issue({ issue: issue, update_mask: update_mask }, call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object with options - client.update_issue(::Google::Cloud::SecureSourceManager::V1::UpdateIssueRequest.new(issue: issue, update_mask: update_mask), call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Verify method calls - assert_equal 5, update_issue_client_stub.call_count - end - end - end - - def test_delete_issue - # 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" - - delete_issue_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| - assert options.metadata.key? :"x-goog-api-client" - assert options.metadata[:"x-goog-api-client"].include? "rest" - refute options.metadata[:"x-goog-api-client"].include? "grpc" - end - - ::Google::Cloud::SecureSourceManager::V1::SecureSourceManager::Rest::ServiceStub.stub :transcode_delete_issue_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, delete_issue_client_stub do - # Create client - client = ::Google::Cloud::SecureSourceManager::V1::SecureSourceManager::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - client.delete_issue({ name: name, etag: etag }) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use named arguments - client.delete_issue name: name, etag: etag do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object - client.delete_issue ::Google::Cloud::SecureSourceManager::V1::DeleteIssueRequest.new(name: name, etag: etag) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use hash object with options - client.delete_issue({ name: name, etag: etag }, call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object with options - client.delete_issue(::Google::Cloud::SecureSourceManager::V1::DeleteIssueRequest.new(name: name, etag: etag), call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Verify method calls - assert_equal 5, delete_issue_client_stub.call_count - end - end - end - - def test_open_issue - # 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" - - open_issue_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| - assert options.metadata.key? :"x-goog-api-client" - assert options.metadata[:"x-goog-api-client"].include? "rest" - refute options.metadata[:"x-goog-api-client"].include? "grpc" - end - - ::Google::Cloud::SecureSourceManager::V1::SecureSourceManager::Rest::ServiceStub.stub :transcode_open_issue_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, open_issue_client_stub do - # Create client - client = ::Google::Cloud::SecureSourceManager::V1::SecureSourceManager::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - client.open_issue({ name: name, etag: etag }) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use named arguments - client.open_issue name: name, etag: etag do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object - client.open_issue ::Google::Cloud::SecureSourceManager::V1::OpenIssueRequest.new(name: name, etag: etag) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use hash object with options - client.open_issue({ name: name, etag: etag }, call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object with options - client.open_issue(::Google::Cloud::SecureSourceManager::V1::OpenIssueRequest.new(name: name, etag: etag), call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Verify method calls - assert_equal 5, open_issue_client_stub.call_count - end - end - end - - def test_close_issue - # 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" - - close_issue_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| - assert options.metadata.key? :"x-goog-api-client" - assert options.metadata[:"x-goog-api-client"].include? "rest" - refute options.metadata[:"x-goog-api-client"].include? "grpc" - end - - ::Google::Cloud::SecureSourceManager::V1::SecureSourceManager::Rest::ServiceStub.stub :transcode_close_issue_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, close_issue_client_stub do - # Create client - client = ::Google::Cloud::SecureSourceManager::V1::SecureSourceManager::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - client.close_issue({ name: name, etag: etag }) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use named arguments - client.close_issue name: name, etag: etag do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object - client.close_issue ::Google::Cloud::SecureSourceManager::V1::CloseIssueRequest.new(name: name, etag: etag) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use hash object with options - client.close_issue({ name: name, etag: etag }, call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object with options - client.close_issue(::Google::Cloud::SecureSourceManager::V1::CloseIssueRequest.new(name: name, etag: etag), call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Verify method calls - assert_equal 5, close_issue_client_stub.call_count - end - end - end - - def test_get_pull_request_comment - # Create test objects. - client_result = ::Google::Cloud::SecureSourceManager::V1::PullRequestComment.new - http_response = OpenStruct.new body: client_result.to_json - - call_options = {} - - # Create request parameters for a unary method. - name = "hello world" - - get_pull_request_comment_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| - assert options.metadata.key? :"x-goog-api-client" - assert options.metadata[:"x-goog-api-client"].include? "rest" - refute options.metadata[:"x-goog-api-client"].include? "grpc" - end - - ::Google::Cloud::SecureSourceManager::V1::SecureSourceManager::Rest::ServiceStub.stub :transcode_get_pull_request_comment_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, get_pull_request_comment_client_stub do - # Create client - client = ::Google::Cloud::SecureSourceManager::V1::SecureSourceManager::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - client.get_pull_request_comment({ name: name }) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use named arguments - client.get_pull_request_comment name: name do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object - client.get_pull_request_comment ::Google::Cloud::SecureSourceManager::V1::GetPullRequestCommentRequest.new(name: name) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use hash object with options - client.get_pull_request_comment({ name: name }, call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object with options - client.get_pull_request_comment(::Google::Cloud::SecureSourceManager::V1::GetPullRequestCommentRequest.new(name: name), call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Verify method calls - assert_equal 5, get_pull_request_comment_client_stub.call_count - end - end - end - - def test_list_pull_request_comments - # Create test objects. - client_result = ::Google::Cloud::SecureSourceManager::V1::ListPullRequestCommentsResponse.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_pull_request_comments_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| - assert options.metadata.key? :"x-goog-api-client" - assert options.metadata[:"x-goog-api-client"].include? "rest" - refute options.metadata[:"x-goog-api-client"].include? "grpc" - end - - ::Google::Cloud::SecureSourceManager::V1::SecureSourceManager::Rest::ServiceStub.stub :transcode_list_pull_request_comments_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, list_pull_request_comments_client_stub do - # Create client - client = ::Google::Cloud::SecureSourceManager::V1::SecureSourceManager::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - client.list_pull_request_comments({ 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_pull_request_comments 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_pull_request_comments ::Google::Cloud::SecureSourceManager::V1::ListPullRequestCommentsRequest.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_pull_request_comments({ 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_pull_request_comments(::Google::Cloud::SecureSourceManager::V1::ListPullRequestCommentsRequest.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_pull_request_comments_client_stub.call_count - end - end - end - - def test_create_pull_request_comment - # 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" - pull_request_comment = {} - - create_pull_request_comment_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| - assert options.metadata.key? :"x-goog-api-client" - assert options.metadata[:"x-goog-api-client"].include? "rest" - refute options.metadata[:"x-goog-api-client"].include? "grpc" - end - - ::Google::Cloud::SecureSourceManager::V1::SecureSourceManager::Rest::ServiceStub.stub :transcode_create_pull_request_comment_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, create_pull_request_comment_client_stub do - # Create client - client = ::Google::Cloud::SecureSourceManager::V1::SecureSourceManager::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - client.create_pull_request_comment({ parent: parent, pull_request_comment: pull_request_comment }) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use named arguments - client.create_pull_request_comment parent: parent, pull_request_comment: pull_request_comment do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object - client.create_pull_request_comment ::Google::Cloud::SecureSourceManager::V1::CreatePullRequestCommentRequest.new(parent: parent, pull_request_comment: pull_request_comment) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use hash object with options - client.create_pull_request_comment({ parent: parent, pull_request_comment: pull_request_comment }, call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object with options - client.create_pull_request_comment(::Google::Cloud::SecureSourceManager::V1::CreatePullRequestCommentRequest.new(parent: parent, pull_request_comment: pull_request_comment), call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Verify method calls - assert_equal 5, create_pull_request_comment_client_stub.call_count - end - end - end - - def test_update_pull_request_comment - # 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. - pull_request_comment = {} - update_mask = {} - - update_pull_request_comment_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| - assert options.metadata.key? :"x-goog-api-client" - assert options.metadata[:"x-goog-api-client"].include? "rest" - refute options.metadata[:"x-goog-api-client"].include? "grpc" - end - - ::Google::Cloud::SecureSourceManager::V1::SecureSourceManager::Rest::ServiceStub.stub :transcode_update_pull_request_comment_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, update_pull_request_comment_client_stub do - # Create client - client = ::Google::Cloud::SecureSourceManager::V1::SecureSourceManager::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - client.update_pull_request_comment({ pull_request_comment: pull_request_comment, update_mask: update_mask }) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use named arguments - client.update_pull_request_comment pull_request_comment: pull_request_comment, update_mask: update_mask do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object - client.update_pull_request_comment ::Google::Cloud::SecureSourceManager::V1::UpdatePullRequestCommentRequest.new(pull_request_comment: pull_request_comment, update_mask: update_mask) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use hash object with options - client.update_pull_request_comment({ pull_request_comment: pull_request_comment, update_mask: update_mask }, call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object with options - client.update_pull_request_comment(::Google::Cloud::SecureSourceManager::V1::UpdatePullRequestCommentRequest.new(pull_request_comment: pull_request_comment, update_mask: update_mask), call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Verify method calls - assert_equal 5, update_pull_request_comment_client_stub.call_count - end - end - end - - def test_delete_pull_request_comment - # 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" - - delete_pull_request_comment_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| - assert options.metadata.key? :"x-goog-api-client" - assert options.metadata[:"x-goog-api-client"].include? "rest" - refute options.metadata[:"x-goog-api-client"].include? "grpc" - end - - ::Google::Cloud::SecureSourceManager::V1::SecureSourceManager::Rest::ServiceStub.stub :transcode_delete_pull_request_comment_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, delete_pull_request_comment_client_stub do - # Create client - client = ::Google::Cloud::SecureSourceManager::V1::SecureSourceManager::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - client.delete_pull_request_comment({ name: name }) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use named arguments - client.delete_pull_request_comment name: name do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object - client.delete_pull_request_comment ::Google::Cloud::SecureSourceManager::V1::DeletePullRequestCommentRequest.new(name: name) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use hash object with options - client.delete_pull_request_comment({ name: name }, call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object with options - client.delete_pull_request_comment(::Google::Cloud::SecureSourceManager::V1::DeletePullRequestCommentRequest.new(name: name), call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Verify method calls - assert_equal 5, delete_pull_request_comment_client_stub.call_count - end - end - end - - def test_batch_create_pull_request_comments - # 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" - requests = [{}] - - batch_create_pull_request_comments_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| - assert options.metadata.key? :"x-goog-api-client" - assert options.metadata[:"x-goog-api-client"].include? "rest" - refute options.metadata[:"x-goog-api-client"].include? "grpc" - end - - ::Google::Cloud::SecureSourceManager::V1::SecureSourceManager::Rest::ServiceStub.stub :transcode_batch_create_pull_request_comments_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, batch_create_pull_request_comments_client_stub do - # Create client - client = ::Google::Cloud::SecureSourceManager::V1::SecureSourceManager::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - client.batch_create_pull_request_comments({ parent: parent, requests: requests }) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use named arguments - client.batch_create_pull_request_comments parent: parent, requests: requests do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object - client.batch_create_pull_request_comments ::Google::Cloud::SecureSourceManager::V1::BatchCreatePullRequestCommentsRequest.new(parent: parent, requests: requests) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use hash object with options - client.batch_create_pull_request_comments({ parent: parent, requests: requests }, call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object with options - client.batch_create_pull_request_comments(::Google::Cloud::SecureSourceManager::V1::BatchCreatePullRequestCommentsRequest.new(parent: parent, requests: requests), call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Verify method calls - assert_equal 5, batch_create_pull_request_comments_client_stub.call_count - end - end - end - - def test_resolve_pull_request_comments - # 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" - names = ["hello world"] - auto_fill = true - - resolve_pull_request_comments_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| - assert options.metadata.key? :"x-goog-api-client" - assert options.metadata[:"x-goog-api-client"].include? "rest" - refute options.metadata[:"x-goog-api-client"].include? "grpc" - end - - ::Google::Cloud::SecureSourceManager::V1::SecureSourceManager::Rest::ServiceStub.stub :transcode_resolve_pull_request_comments_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, resolve_pull_request_comments_client_stub do - # Create client - client = ::Google::Cloud::SecureSourceManager::V1::SecureSourceManager::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - client.resolve_pull_request_comments({ parent: parent, names: names, auto_fill: auto_fill }) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use named arguments - client.resolve_pull_request_comments parent: parent, names: names, auto_fill: auto_fill do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object - client.resolve_pull_request_comments ::Google::Cloud::SecureSourceManager::V1::ResolvePullRequestCommentsRequest.new(parent: parent, names: names, auto_fill: auto_fill) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use hash object with options - client.resolve_pull_request_comments({ parent: parent, names: names, auto_fill: auto_fill }, call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object with options - client.resolve_pull_request_comments(::Google::Cloud::SecureSourceManager::V1::ResolvePullRequestCommentsRequest.new(parent: parent, names: names, auto_fill: auto_fill), call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Verify method calls - assert_equal 5, resolve_pull_request_comments_client_stub.call_count - end - end - end - - def test_unresolve_pull_request_comments - # 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" - names = ["hello world"] - auto_fill = true - - unresolve_pull_request_comments_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| - assert options.metadata.key? :"x-goog-api-client" - assert options.metadata[:"x-goog-api-client"].include? "rest" - refute options.metadata[:"x-goog-api-client"].include? "grpc" - end - - ::Google::Cloud::SecureSourceManager::V1::SecureSourceManager::Rest::ServiceStub.stub :transcode_unresolve_pull_request_comments_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, unresolve_pull_request_comments_client_stub do - # Create client - client = ::Google::Cloud::SecureSourceManager::V1::SecureSourceManager::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - client.unresolve_pull_request_comments({ parent: parent, names: names, auto_fill: auto_fill }) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use named arguments - client.unresolve_pull_request_comments parent: parent, names: names, auto_fill: auto_fill do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object - client.unresolve_pull_request_comments ::Google::Cloud::SecureSourceManager::V1::UnresolvePullRequestCommentsRequest.new(parent: parent, names: names, auto_fill: auto_fill) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use hash object with options - client.unresolve_pull_request_comments({ parent: parent, names: names, auto_fill: auto_fill }, call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object with options - client.unresolve_pull_request_comments(::Google::Cloud::SecureSourceManager::V1::UnresolvePullRequestCommentsRequest.new(parent: parent, names: names, auto_fill: auto_fill), call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Verify method calls - assert_equal 5, unresolve_pull_request_comments_client_stub.call_count - end - end - end - - def test_create_issue_comment - # 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" - issue_comment = {} - - create_issue_comment_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| - assert options.metadata.key? :"x-goog-api-client" - assert options.metadata[:"x-goog-api-client"].include? "rest" - refute options.metadata[:"x-goog-api-client"].include? "grpc" - end - - ::Google::Cloud::SecureSourceManager::V1::SecureSourceManager::Rest::ServiceStub.stub :transcode_create_issue_comment_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, create_issue_comment_client_stub do - # Create client - client = ::Google::Cloud::SecureSourceManager::V1::SecureSourceManager::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - client.create_issue_comment({ parent: parent, issue_comment: issue_comment }) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use named arguments - client.create_issue_comment parent: parent, issue_comment: issue_comment do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object - client.create_issue_comment ::Google::Cloud::SecureSourceManager::V1::CreateIssueCommentRequest.new(parent: parent, issue_comment: issue_comment) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use hash object with options - client.create_issue_comment({ parent: parent, issue_comment: issue_comment }, call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object with options - client.create_issue_comment(::Google::Cloud::SecureSourceManager::V1::CreateIssueCommentRequest.new(parent: parent, issue_comment: issue_comment), call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Verify method calls - assert_equal 5, create_issue_comment_client_stub.call_count - end - end - end - - def test_get_issue_comment - # Create test objects. - client_result = ::Google::Cloud::SecureSourceManager::V1::IssueComment.new - http_response = OpenStruct.new body: client_result.to_json - - call_options = {} - - # Create request parameters for a unary method. - name = "hello world" - - get_issue_comment_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| - assert options.metadata.key? :"x-goog-api-client" - assert options.metadata[:"x-goog-api-client"].include? "rest" - refute options.metadata[:"x-goog-api-client"].include? "grpc" - end - - ::Google::Cloud::SecureSourceManager::V1::SecureSourceManager::Rest::ServiceStub.stub :transcode_get_issue_comment_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, get_issue_comment_client_stub do - # Create client - client = ::Google::Cloud::SecureSourceManager::V1::SecureSourceManager::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - client.get_issue_comment({ name: name }) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use named arguments - client.get_issue_comment name: name do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object - client.get_issue_comment ::Google::Cloud::SecureSourceManager::V1::GetIssueCommentRequest.new(name: name) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use hash object with options - client.get_issue_comment({ name: name }, call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object with options - client.get_issue_comment(::Google::Cloud::SecureSourceManager::V1::GetIssueCommentRequest.new(name: name), call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Verify method calls - assert_equal 5, get_issue_comment_client_stub.call_count - end - end - end - - def test_list_issue_comments - # Create test objects. - client_result = ::Google::Cloud::SecureSourceManager::V1::ListIssueCommentsResponse.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_issue_comments_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| - assert options.metadata.key? :"x-goog-api-client" - assert options.metadata[:"x-goog-api-client"].include? "rest" - refute options.metadata[:"x-goog-api-client"].include? "grpc" - end - - ::Google::Cloud::SecureSourceManager::V1::SecureSourceManager::Rest::ServiceStub.stub :transcode_list_issue_comments_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, list_issue_comments_client_stub do - # Create client - client = ::Google::Cloud::SecureSourceManager::V1::SecureSourceManager::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - client.list_issue_comments({ 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_issue_comments 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_issue_comments ::Google::Cloud::SecureSourceManager::V1::ListIssueCommentsRequest.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_issue_comments({ 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_issue_comments(::Google::Cloud::SecureSourceManager::V1::ListIssueCommentsRequest.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_issue_comments_client_stub.call_count - end - end - end - - def test_update_issue_comment - # 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. - issue_comment = {} - update_mask = {} - - update_issue_comment_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| - assert options.metadata.key? :"x-goog-api-client" - assert options.metadata[:"x-goog-api-client"].include? "rest" - refute options.metadata[:"x-goog-api-client"].include? "grpc" - end - - ::Google::Cloud::SecureSourceManager::V1::SecureSourceManager::Rest::ServiceStub.stub :transcode_update_issue_comment_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, update_issue_comment_client_stub do - # Create client - client = ::Google::Cloud::SecureSourceManager::V1::SecureSourceManager::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - client.update_issue_comment({ issue_comment: issue_comment, update_mask: update_mask }) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use named arguments - client.update_issue_comment issue_comment: issue_comment, update_mask: update_mask do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object - client.update_issue_comment ::Google::Cloud::SecureSourceManager::V1::UpdateIssueCommentRequest.new(issue_comment: issue_comment, update_mask: update_mask) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use hash object with options - client.update_issue_comment({ issue_comment: issue_comment, update_mask: update_mask }, call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object with options - client.update_issue_comment(::Google::Cloud::SecureSourceManager::V1::UpdateIssueCommentRequest.new(issue_comment: issue_comment, update_mask: update_mask), call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Verify method calls - assert_equal 5, update_issue_comment_client_stub.call_count - end - end - end - - def test_delete_issue_comment - # 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" - - delete_issue_comment_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| - assert options.metadata.key? :"x-goog-api-client" - assert options.metadata[:"x-goog-api-client"].include? "rest" - refute options.metadata[:"x-goog-api-client"].include? "grpc" - end - - ::Google::Cloud::SecureSourceManager::V1::SecureSourceManager::Rest::ServiceStub.stub :transcode_delete_issue_comment_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, delete_issue_comment_client_stub do - # Create client - client = ::Google::Cloud::SecureSourceManager::V1::SecureSourceManager::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - client.delete_issue_comment({ name: name }) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use named arguments - client.delete_issue_comment name: name do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object - client.delete_issue_comment ::Google::Cloud::SecureSourceManager::V1::DeleteIssueCommentRequest.new(name: name) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use hash object with options - client.delete_issue_comment({ name: name }, call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object with options - client.delete_issue_comment(::Google::Cloud::SecureSourceManager::V1::DeleteIssueCommentRequest.new(name: name), call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Verify method calls - assert_equal 5, delete_issue_comment_client_stub.call_count - end - end - end - - def test_configure - credentials_token = :dummy_value - - client = block_config = config = nil - dummy_stub = ClientStub.new nil - Gapic::Rest::ClientStub.stub :new, dummy_stub do - client = ::Google::Cloud::SecureSourceManager::V1::SecureSourceManager::Rest::Client.new do |config| - config.credentials = credentials_token - end - end - - config = client.configure do |c| - block_config = c - end - - assert_same block_config, config - assert_kind_of ::Google::Cloud::SecureSourceManager::V1::SecureSourceManager::Rest::Client::Configuration, config - end -end diff --git a/owl-bot-staging/google-cloud-secure_source_manager-v1/test/google/cloud/secure_source_manager/v1/secure_source_manager_test.rb b/owl-bot-staging/google-cloud-secure_source_manager-v1/test/google/cloud/secure_source_manager/v1/secure_source_manager_test.rb deleted file mode 100644 index af65a5393465..000000000000 --- a/owl-bot-staging/google-cloud-secure_source_manager-v1/test/google/cloud/secure_source_manager/v1/secure_source_manager_test.rb +++ /dev/null @@ -1,3464 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -require "helper" - -require "gapic/grpc/service_stub" - -require "google/cloud/securesourcemanager/v1/secure_source_manager_pb" -require "google/cloud/secure_source_manager/v1/secure_source_manager" - -class ::Google::Cloud::SecureSourceManager::V1::SecureSourceManager::ClientTest < Minitest::Test - class ClientStub - attr_accessor :call_rpc_count, :requests - - def initialize response, operation, &block - @response = response - @operation = operation - @block = block - @call_rpc_count = 0 - @requests = [] - end - - def call_rpc *args, **kwargs - @call_rpc_count += 1 - - @requests << @block&.call(*args, **kwargs) - - catch :response do - yield @response, @operation if block_given? - @response - end - end - - def endpoint - "endpoint.example.com" - end - - def universe_domain - "example.com" - end - - def stub_logger - nil - end - - def logger - nil - end - end - - def test_list_instances - # Create GRPC objects. - grpc_response = ::Google::Cloud::SecureSourceManager::V1::ListInstancesResponse.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" - order_by = "hello world" - - list_instances_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :list_instances, name - assert_kind_of ::Google::Cloud::SecureSourceManager::V1::ListInstancesRequest, 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"] - assert_equal "hello world", request["order_by"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, list_instances_client_stub do - # Create client - client = ::Google::Cloud::SecureSourceManager::V1::SecureSourceManager::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.list_instances({ parent: parent, page_size: page_size, page_token: page_token, filter: filter, order_by: order_by }) 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_instances parent: parent, page_size: page_size, page_token: page_token, filter: filter, order_by: order_by 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_instances ::Google::Cloud::SecureSourceManager::V1::ListInstancesRequest.new(parent: parent, page_size: page_size, page_token: page_token, filter: filter, order_by: order_by) 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_instances({ parent: parent, page_size: page_size, page_token: page_token, filter: filter, order_by: order_by }, 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_instances(::Google::Cloud::SecureSourceManager::V1::ListInstancesRequest.new(parent: parent, page_size: page_size, page_token: page_token, filter: filter, order_by: order_by), 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_instances_client_stub.call_rpc_count - end - end - - def test_get_instance - # Create GRPC objects. - grpc_response = ::Google::Cloud::SecureSourceManager::V1::Instance.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_instance_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :get_instance, name - assert_kind_of ::Google::Cloud::SecureSourceManager::V1::GetInstanceRequest, request - assert_equal "hello world", request["name"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, get_instance_client_stub do - # Create client - client = ::Google::Cloud::SecureSourceManager::V1::SecureSourceManager::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.get_instance({ name: name }) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use named arguments - client.get_instance name: name do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object - client.get_instance ::Google::Cloud::SecureSourceManager::V1::GetInstanceRequest.new(name: name) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use hash object with options - client.get_instance({ 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_instance(::Google::Cloud::SecureSourceManager::V1::GetInstanceRequest.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_instance_client_stub.call_rpc_count - end - end - - def test_create_instance - # 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" - instance_id = "hello world" - instance = {} - request_id = "hello world" - - create_instance_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :create_instance, name - assert_kind_of ::Google::Cloud::SecureSourceManager::V1::CreateInstanceRequest, request - assert_equal "hello world", request["parent"] - assert_equal "hello world", request["instance_id"] - assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::SecureSourceManager::V1::Instance), request["instance"] - assert_equal "hello world", request["request_id"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, create_instance_client_stub do - # Create client - client = ::Google::Cloud::SecureSourceManager::V1::SecureSourceManager::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.create_instance({ parent: parent, instance_id: instance_id, instance: instance, request_id: request_id }) do |response, operation| - assert_kind_of Gapic::Operation, response - assert_equal grpc_response, response.grpc_op - assert_equal grpc_operation, operation - end - - # Use named arguments - client.create_instance parent: parent, instance_id: instance_id, instance: instance, request_id: request_id do |response, operation| - assert_kind_of Gapic::Operation, response - assert_equal grpc_response, response.grpc_op - assert_equal grpc_operation, operation - end - - # Use protobuf object - client.create_instance ::Google::Cloud::SecureSourceManager::V1::CreateInstanceRequest.new(parent: parent, instance_id: instance_id, instance: instance, request_id: request_id) do |response, operation| - assert_kind_of Gapic::Operation, response - assert_equal grpc_response, response.grpc_op - assert_equal grpc_operation, operation - end - - # Use hash object with options - client.create_instance({ parent: parent, instance_id: instance_id, instance: instance, request_id: request_id }, grpc_options) do |response, operation| - assert_kind_of Gapic::Operation, response - assert_equal grpc_response, response.grpc_op - assert_equal grpc_operation, operation - end - - # Use protobuf object with options - client.create_instance(::Google::Cloud::SecureSourceManager::V1::CreateInstanceRequest.new(parent: parent, instance_id: instance_id, instance: instance, request_id: request_id), grpc_options) do |response, operation| - assert_kind_of Gapic::Operation, response - assert_equal grpc_response, response.grpc_op - assert_equal grpc_operation, operation - end - - # Verify method calls - assert_equal 5, create_instance_client_stub.call_rpc_count - end - end - - def test_delete_instance - # 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" - request_id = "hello world" - - delete_instance_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :delete_instance, name - assert_kind_of ::Google::Cloud::SecureSourceManager::V1::DeleteInstanceRequest, request - assert_equal "hello world", request["name"] - assert_equal "hello world", request["request_id"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, delete_instance_client_stub do - # Create client - client = ::Google::Cloud::SecureSourceManager::V1::SecureSourceManager::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.delete_instance({ name: name, request_id: request_id }) do |response, operation| - assert_kind_of Gapic::Operation, response - assert_equal grpc_response, response.grpc_op - assert_equal grpc_operation, operation - end - - # Use named arguments - client.delete_instance name: name, request_id: request_id do |response, operation| - assert_kind_of Gapic::Operation, response - assert_equal grpc_response, response.grpc_op - assert_equal grpc_operation, operation - end - - # Use protobuf object - client.delete_instance ::Google::Cloud::SecureSourceManager::V1::DeleteInstanceRequest.new(name: name, request_id: request_id) do |response, operation| - assert_kind_of Gapic::Operation, response - assert_equal grpc_response, response.grpc_op - assert_equal grpc_operation, operation - end - - # Use hash object with options - client.delete_instance({ name: name, request_id: request_id }, grpc_options) do |response, operation| - assert_kind_of Gapic::Operation, response - assert_equal grpc_response, response.grpc_op - assert_equal grpc_operation, operation - end - - # Use protobuf object with options - client.delete_instance(::Google::Cloud::SecureSourceManager::V1::DeleteInstanceRequest.new(name: name, request_id: request_id), grpc_options) do |response, operation| - assert_kind_of Gapic::Operation, response - assert_equal grpc_response, response.grpc_op - assert_equal grpc_operation, operation - end - - # Verify method calls - assert_equal 5, delete_instance_client_stub.call_rpc_count - end - end - - def test_list_repositories - # Create GRPC objects. - grpc_response = ::Google::Cloud::SecureSourceManager::V1::ListRepositoriesResponse.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" - instance = "hello world" - - list_repositories_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :list_repositories, name - assert_kind_of ::Google::Cloud::SecureSourceManager::V1::ListRepositoriesRequest, 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"] - assert_equal "hello world", request["instance"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, list_repositories_client_stub do - # Create client - client = ::Google::Cloud::SecureSourceManager::V1::SecureSourceManager::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.list_repositories({ parent: parent, page_size: page_size, page_token: page_token, filter: filter, instance: instance }) 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_repositories parent: parent, page_size: page_size, page_token: page_token, filter: filter, instance: instance 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_repositories ::Google::Cloud::SecureSourceManager::V1::ListRepositoriesRequest.new(parent: parent, page_size: page_size, page_token: page_token, filter: filter, instance: instance) 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_repositories({ parent: parent, page_size: page_size, page_token: page_token, filter: filter, instance: instance }, 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_repositories(::Google::Cloud::SecureSourceManager::V1::ListRepositoriesRequest.new(parent: parent, page_size: page_size, page_token: page_token, filter: filter, instance: instance), 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_repositories_client_stub.call_rpc_count - end - end - - def test_get_repository - # Create GRPC objects. - grpc_response = ::Google::Cloud::SecureSourceManager::V1::Repository.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_repository_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :get_repository, name - assert_kind_of ::Google::Cloud::SecureSourceManager::V1::GetRepositoryRequest, request - assert_equal "hello world", request["name"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, get_repository_client_stub do - # Create client - client = ::Google::Cloud::SecureSourceManager::V1::SecureSourceManager::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.get_repository({ name: name }) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use named arguments - client.get_repository name: name do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object - client.get_repository ::Google::Cloud::SecureSourceManager::V1::GetRepositoryRequest.new(name: name) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use hash object with options - client.get_repository({ 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_repository(::Google::Cloud::SecureSourceManager::V1::GetRepositoryRequest.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_repository_client_stub.call_rpc_count - end - end - - def test_create_repository - # 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" - repository = {} - repository_id = "hello world" - - create_repository_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :create_repository, name - assert_kind_of ::Google::Cloud::SecureSourceManager::V1::CreateRepositoryRequest, request - assert_equal "hello world", request["parent"] - assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::SecureSourceManager::V1::Repository), request["repository"] - assert_equal "hello world", request["repository_id"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, create_repository_client_stub do - # Create client - client = ::Google::Cloud::SecureSourceManager::V1::SecureSourceManager::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.create_repository({ parent: parent, repository: repository, repository_id: repository_id }) do |response, operation| - assert_kind_of Gapic::Operation, response - assert_equal grpc_response, response.grpc_op - assert_equal grpc_operation, operation - end - - # Use named arguments - client.create_repository parent: parent, repository: repository, repository_id: repository_id do |response, operation| - assert_kind_of Gapic::Operation, response - assert_equal grpc_response, response.grpc_op - assert_equal grpc_operation, operation - end - - # Use protobuf object - client.create_repository ::Google::Cloud::SecureSourceManager::V1::CreateRepositoryRequest.new(parent: parent, repository: repository, repository_id: repository_id) do |response, operation| - assert_kind_of Gapic::Operation, response - assert_equal grpc_response, response.grpc_op - assert_equal grpc_operation, operation - end - - # Use hash object with options - client.create_repository({ parent: parent, repository: repository, repository_id: repository_id }, grpc_options) do |response, operation| - assert_kind_of Gapic::Operation, response - assert_equal grpc_response, response.grpc_op - assert_equal grpc_operation, operation - end - - # Use protobuf object with options - client.create_repository(::Google::Cloud::SecureSourceManager::V1::CreateRepositoryRequest.new(parent: parent, repository: repository, repository_id: repository_id), grpc_options) do |response, operation| - assert_kind_of Gapic::Operation, response - assert_equal grpc_response, response.grpc_op - assert_equal grpc_operation, operation - end - - # Verify method calls - assert_equal 5, create_repository_client_stub.call_rpc_count - end - end - - def test_update_repository - # 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. - update_mask = {} - repository = {} - validate_only = true - - update_repository_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :update_repository, name - assert_kind_of ::Google::Cloud::SecureSourceManager::V1::UpdateRepositoryRequest, request - assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Protobuf::FieldMask), request["update_mask"] - assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::SecureSourceManager::V1::Repository), request["repository"] - assert_equal true, request["validate_only"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, update_repository_client_stub do - # Create client - client = ::Google::Cloud::SecureSourceManager::V1::SecureSourceManager::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.update_repository({ update_mask: update_mask, repository: repository, 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_repository update_mask: update_mask, repository: repository, 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_repository ::Google::Cloud::SecureSourceManager::V1::UpdateRepositoryRequest.new(update_mask: update_mask, repository: repository, 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_repository({ update_mask: update_mask, repository: repository, 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_repository(::Google::Cloud::SecureSourceManager::V1::UpdateRepositoryRequest.new(update_mask: update_mask, repository: repository, 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_repository_client_stub.call_rpc_count - end - end - - def test_delete_repository - # 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" - allow_missing = true - - delete_repository_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :delete_repository, name - assert_kind_of ::Google::Cloud::SecureSourceManager::V1::DeleteRepositoryRequest, request - assert_equal "hello world", request["name"] - assert_equal true, request["allow_missing"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, delete_repository_client_stub do - # Create client - client = ::Google::Cloud::SecureSourceManager::V1::SecureSourceManager::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.delete_repository({ name: name, allow_missing: allow_missing }) 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_repository name: name, allow_missing: allow_missing 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_repository ::Google::Cloud::SecureSourceManager::V1::DeleteRepositoryRequest.new(name: name, allow_missing: allow_missing) 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_repository({ name: name, allow_missing: allow_missing }, 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_repository(::Google::Cloud::SecureSourceManager::V1::DeleteRepositoryRequest.new(name: name, allow_missing: allow_missing), 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_repository_client_stub.call_rpc_count - end - end - - def test_list_hooks - # Create GRPC objects. - grpc_response = ::Google::Cloud::SecureSourceManager::V1::ListHooksResponse.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_hooks_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :list_hooks, name - assert_kind_of ::Google::Cloud::SecureSourceManager::V1::ListHooksRequest, 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_hooks_client_stub do - # Create client - client = ::Google::Cloud::SecureSourceManager::V1::SecureSourceManager::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.list_hooks({ 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_hooks 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_hooks ::Google::Cloud::SecureSourceManager::V1::ListHooksRequest.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_hooks({ 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_hooks(::Google::Cloud::SecureSourceManager::V1::ListHooksRequest.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_hooks_client_stub.call_rpc_count - end - end - - def test_get_hook - # Create GRPC objects. - grpc_response = ::Google::Cloud::SecureSourceManager::V1::Hook.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_hook_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :get_hook, name - assert_kind_of ::Google::Cloud::SecureSourceManager::V1::GetHookRequest, request - assert_equal "hello world", request["name"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, get_hook_client_stub do - # Create client - client = ::Google::Cloud::SecureSourceManager::V1::SecureSourceManager::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.get_hook({ name: name }) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use named arguments - client.get_hook name: name do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object - client.get_hook ::Google::Cloud::SecureSourceManager::V1::GetHookRequest.new(name: name) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use hash object with options - client.get_hook({ 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_hook(::Google::Cloud::SecureSourceManager::V1::GetHookRequest.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_hook_client_stub.call_rpc_count - end - end - - def test_create_hook - # 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" - hook = {} - hook_id = "hello world" - - create_hook_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :create_hook, name - assert_kind_of ::Google::Cloud::SecureSourceManager::V1::CreateHookRequest, request - assert_equal "hello world", request["parent"] - assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::SecureSourceManager::V1::Hook), request["hook"] - assert_equal "hello world", request["hook_id"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, create_hook_client_stub do - # Create client - client = ::Google::Cloud::SecureSourceManager::V1::SecureSourceManager::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.create_hook({ parent: parent, hook: hook, hook_id: hook_id }) do |response, operation| - assert_kind_of Gapic::Operation, response - assert_equal grpc_response, response.grpc_op - assert_equal grpc_operation, operation - end - - # Use named arguments - client.create_hook parent: parent, hook: hook, hook_id: hook_id do |response, operation| - assert_kind_of Gapic::Operation, response - assert_equal grpc_response, response.grpc_op - assert_equal grpc_operation, operation - end - - # Use protobuf object - client.create_hook ::Google::Cloud::SecureSourceManager::V1::CreateHookRequest.new(parent: parent, hook: hook, hook_id: hook_id) do |response, operation| - assert_kind_of Gapic::Operation, response - assert_equal grpc_response, response.grpc_op - assert_equal grpc_operation, operation - end - - # Use hash object with options - client.create_hook({ parent: parent, hook: hook, hook_id: hook_id }, grpc_options) do |response, operation| - assert_kind_of Gapic::Operation, response - assert_equal grpc_response, response.grpc_op - assert_equal grpc_operation, operation - end - - # Use protobuf object with options - client.create_hook(::Google::Cloud::SecureSourceManager::V1::CreateHookRequest.new(parent: parent, hook: hook, hook_id: hook_id), grpc_options) do |response, operation| - assert_kind_of Gapic::Operation, response - assert_equal grpc_response, response.grpc_op - assert_equal grpc_operation, operation - end - - # Verify method calls - assert_equal 5, create_hook_client_stub.call_rpc_count - end - end - - def test_update_hook - # 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. - update_mask = {} - hook = {} - - update_hook_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :update_hook, name - assert_kind_of ::Google::Cloud::SecureSourceManager::V1::UpdateHookRequest, request - assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Protobuf::FieldMask), request["update_mask"] - assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::SecureSourceManager::V1::Hook), request["hook"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, update_hook_client_stub do - # Create client - client = ::Google::Cloud::SecureSourceManager::V1::SecureSourceManager::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.update_hook({ update_mask: update_mask, hook: hook }) 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_hook update_mask: update_mask, hook: hook 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_hook ::Google::Cloud::SecureSourceManager::V1::UpdateHookRequest.new(update_mask: update_mask, hook: hook) 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_hook({ update_mask: update_mask, hook: hook }, 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_hook(::Google::Cloud::SecureSourceManager::V1::UpdateHookRequest.new(update_mask: update_mask, hook: hook), 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_hook_client_stub.call_rpc_count - end - end - - def test_delete_hook - # 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" - - delete_hook_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :delete_hook, name - assert_kind_of ::Google::Cloud::SecureSourceManager::V1::DeleteHookRequest, request - assert_equal "hello world", request["name"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, delete_hook_client_stub do - # Create client - client = ::Google::Cloud::SecureSourceManager::V1::SecureSourceManager::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.delete_hook({ 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.delete_hook 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.delete_hook ::Google::Cloud::SecureSourceManager::V1::DeleteHookRequest.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.delete_hook({ 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.delete_hook(::Google::Cloud::SecureSourceManager::V1::DeleteHookRequest.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, delete_hook_client_stub.call_rpc_count - end - end - - def test_get_iam_policy_repo - # Create GRPC objects. - grpc_response = ::Google::Iam::V1::Policy.new - grpc_operation = GRPC::ActiveCall::Operation.new nil - grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - grpc_options = {} - - # Create request parameters for a unary method. - resource = "hello world" - options = {} - - get_iam_policy_repo_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :get_iam_policy_repo, name - assert_kind_of ::Google::Iam::V1::GetIamPolicyRequest, request - assert_equal "hello world", request["resource"] - assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Iam::V1::GetPolicyOptions), request["options"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, get_iam_policy_repo_client_stub do - # Create client - client = ::Google::Cloud::SecureSourceManager::V1::SecureSourceManager::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.get_iam_policy_repo({ resource: resource, options: options }) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use named arguments - client.get_iam_policy_repo resource: resource, options: options do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object - client.get_iam_policy_repo ::Google::Iam::V1::GetIamPolicyRequest.new(resource: resource, options: options) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use hash object with options - client.get_iam_policy_repo({ resource: resource, options: options }, grpc_options) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object with options - client.get_iam_policy_repo(::Google::Iam::V1::GetIamPolicyRequest.new(resource: resource, options: options), grpc_options) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Verify method calls - assert_equal 5, get_iam_policy_repo_client_stub.call_rpc_count - end - end - - def test_set_iam_policy_repo - # Create GRPC objects. - grpc_response = ::Google::Iam::V1::Policy.new - grpc_operation = GRPC::ActiveCall::Operation.new nil - grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - grpc_options = {} - - # Create request parameters for a unary method. - resource = "hello world" - policy = {} - update_mask = {} - - set_iam_policy_repo_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :set_iam_policy_repo, name - assert_kind_of ::Google::Iam::V1::SetIamPolicyRequest, request - assert_equal "hello world", request["resource"] - assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Iam::V1::Policy), request["policy"] - assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Protobuf::FieldMask), request["update_mask"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, set_iam_policy_repo_client_stub do - # Create client - client = ::Google::Cloud::SecureSourceManager::V1::SecureSourceManager::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.set_iam_policy_repo({ resource: resource, policy: policy, update_mask: update_mask }) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use named arguments - client.set_iam_policy_repo resource: resource, policy: policy, update_mask: update_mask do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object - client.set_iam_policy_repo ::Google::Iam::V1::SetIamPolicyRequest.new(resource: resource, policy: policy, update_mask: update_mask) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use hash object with options - client.set_iam_policy_repo({ resource: resource, policy: policy, update_mask: update_mask }, grpc_options) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object with options - client.set_iam_policy_repo(::Google::Iam::V1::SetIamPolicyRequest.new(resource: resource, policy: policy, update_mask: update_mask), grpc_options) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Verify method calls - assert_equal 5, set_iam_policy_repo_client_stub.call_rpc_count - end - end - - def test_test_iam_permissions_repo - # Create GRPC objects. - grpc_response = ::Google::Iam::V1::TestIamPermissionsResponse.new - grpc_operation = GRPC::ActiveCall::Operation.new nil - grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - grpc_options = {} - - # Create request parameters for a unary method. - resource = "hello world" - permissions = ["hello world"] - - test_iam_permissions_repo_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :test_iam_permissions_repo, name - assert_kind_of ::Google::Iam::V1::TestIamPermissionsRequest, request - assert_equal "hello world", request["resource"] - assert_equal ["hello world"], request["permissions"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, test_iam_permissions_repo_client_stub do - # Create client - client = ::Google::Cloud::SecureSourceManager::V1::SecureSourceManager::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.test_iam_permissions_repo({ resource: resource, permissions: permissions }) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use named arguments - client.test_iam_permissions_repo resource: resource, permissions: permissions do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object - client.test_iam_permissions_repo ::Google::Iam::V1::TestIamPermissionsRequest.new(resource: resource, permissions: permissions) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use hash object with options - client.test_iam_permissions_repo({ resource: resource, permissions: permissions }, grpc_options) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object with options - client.test_iam_permissions_repo(::Google::Iam::V1::TestIamPermissionsRequest.new(resource: resource, permissions: permissions), grpc_options) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Verify method calls - assert_equal 5, test_iam_permissions_repo_client_stub.call_rpc_count - end - end - - def test_create_branch_rule - # 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" - branch_rule = {} - branch_rule_id = "hello world" - - create_branch_rule_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :create_branch_rule, name - assert_kind_of ::Google::Cloud::SecureSourceManager::V1::CreateBranchRuleRequest, request - assert_equal "hello world", request["parent"] - assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::SecureSourceManager::V1::BranchRule), request["branch_rule"] - assert_equal "hello world", request["branch_rule_id"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, create_branch_rule_client_stub do - # Create client - client = ::Google::Cloud::SecureSourceManager::V1::SecureSourceManager::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.create_branch_rule({ parent: parent, branch_rule: branch_rule, branch_rule_id: branch_rule_id }) do |response, operation| - assert_kind_of Gapic::Operation, response - assert_equal grpc_response, response.grpc_op - assert_equal grpc_operation, operation - end - - # Use named arguments - client.create_branch_rule parent: parent, branch_rule: branch_rule, branch_rule_id: branch_rule_id do |response, operation| - assert_kind_of Gapic::Operation, response - assert_equal grpc_response, response.grpc_op - assert_equal grpc_operation, operation - end - - # Use protobuf object - client.create_branch_rule ::Google::Cloud::SecureSourceManager::V1::CreateBranchRuleRequest.new(parent: parent, branch_rule: branch_rule, branch_rule_id: branch_rule_id) do |response, operation| - assert_kind_of Gapic::Operation, response - assert_equal grpc_response, response.grpc_op - assert_equal grpc_operation, operation - end - - # Use hash object with options - client.create_branch_rule({ parent: parent, branch_rule: branch_rule, branch_rule_id: branch_rule_id }, grpc_options) do |response, operation| - assert_kind_of Gapic::Operation, response - assert_equal grpc_response, response.grpc_op - assert_equal grpc_operation, operation - end - - # Use protobuf object with options - client.create_branch_rule(::Google::Cloud::SecureSourceManager::V1::CreateBranchRuleRequest.new(parent: parent, branch_rule: branch_rule, branch_rule_id: branch_rule_id), grpc_options) do |response, operation| - assert_kind_of Gapic::Operation, response - assert_equal grpc_response, response.grpc_op - assert_equal grpc_operation, operation - end - - # Verify method calls - assert_equal 5, create_branch_rule_client_stub.call_rpc_count - end - end - - def test_list_branch_rules - # Create GRPC objects. - grpc_response = ::Google::Cloud::SecureSourceManager::V1::ListBranchRulesResponse.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_branch_rules_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :list_branch_rules, name - assert_kind_of ::Google::Cloud::SecureSourceManager::V1::ListBranchRulesRequest, 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_branch_rules_client_stub do - # Create client - client = ::Google::Cloud::SecureSourceManager::V1::SecureSourceManager::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.list_branch_rules({ 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_branch_rules 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_branch_rules ::Google::Cloud::SecureSourceManager::V1::ListBranchRulesRequest.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_branch_rules({ 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_branch_rules(::Google::Cloud::SecureSourceManager::V1::ListBranchRulesRequest.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_branch_rules_client_stub.call_rpc_count - end - end - - def test_get_branch_rule - # Create GRPC objects. - grpc_response = ::Google::Cloud::SecureSourceManager::V1::BranchRule.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_branch_rule_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :get_branch_rule, name - assert_kind_of ::Google::Cloud::SecureSourceManager::V1::GetBranchRuleRequest, request - assert_equal "hello world", request["name"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, get_branch_rule_client_stub do - # Create client - client = ::Google::Cloud::SecureSourceManager::V1::SecureSourceManager::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.get_branch_rule({ name: name }) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use named arguments - client.get_branch_rule name: name do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object - client.get_branch_rule ::Google::Cloud::SecureSourceManager::V1::GetBranchRuleRequest.new(name: name) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use hash object with options - client.get_branch_rule({ 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_branch_rule(::Google::Cloud::SecureSourceManager::V1::GetBranchRuleRequest.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_branch_rule_client_stub.call_rpc_count - end - end - - def test_update_branch_rule - # 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. - branch_rule = {} - validate_only = true - update_mask = {} - - update_branch_rule_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :update_branch_rule, name - assert_kind_of ::Google::Cloud::SecureSourceManager::V1::UpdateBranchRuleRequest, request - assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::SecureSourceManager::V1::BranchRule), request["branch_rule"] - 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_branch_rule_client_stub do - # Create client - client = ::Google::Cloud::SecureSourceManager::V1::SecureSourceManager::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.update_branch_rule({ branch_rule: branch_rule, 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_branch_rule branch_rule: branch_rule, 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_branch_rule ::Google::Cloud::SecureSourceManager::V1::UpdateBranchRuleRequest.new(branch_rule: branch_rule, 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_branch_rule({ branch_rule: branch_rule, 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_branch_rule(::Google::Cloud::SecureSourceManager::V1::UpdateBranchRuleRequest.new(branch_rule: branch_rule, 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_branch_rule_client_stub.call_rpc_count - end - end - - def test_delete_branch_rule - # 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" - allow_missing = true - - delete_branch_rule_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :delete_branch_rule, name - assert_kind_of ::Google::Cloud::SecureSourceManager::V1::DeleteBranchRuleRequest, request - assert_equal "hello world", request["name"] - assert_equal true, request["allow_missing"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, delete_branch_rule_client_stub do - # Create client - client = ::Google::Cloud::SecureSourceManager::V1::SecureSourceManager::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.delete_branch_rule({ name: name, allow_missing: allow_missing }) 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_branch_rule name: name, allow_missing: allow_missing 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_branch_rule ::Google::Cloud::SecureSourceManager::V1::DeleteBranchRuleRequest.new(name: name, allow_missing: allow_missing) 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_branch_rule({ name: name, allow_missing: allow_missing }, 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_branch_rule(::Google::Cloud::SecureSourceManager::V1::DeleteBranchRuleRequest.new(name: name, allow_missing: allow_missing), 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_branch_rule_client_stub.call_rpc_count - end - end - - def test_create_pull_request - # 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" - pull_request = {} - - create_pull_request_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :create_pull_request, name - assert_kind_of ::Google::Cloud::SecureSourceManager::V1::CreatePullRequestRequest, request - assert_equal "hello world", request["parent"] - assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::SecureSourceManager::V1::PullRequest), request["pull_request"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, create_pull_request_client_stub do - # Create client - client = ::Google::Cloud::SecureSourceManager::V1::SecureSourceManager::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.create_pull_request({ parent: parent, pull_request: pull_request }) 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_pull_request parent: parent, pull_request: pull_request 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_pull_request ::Google::Cloud::SecureSourceManager::V1::CreatePullRequestRequest.new(parent: parent, pull_request: pull_request) 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_pull_request({ parent: parent, pull_request: pull_request }, 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_pull_request(::Google::Cloud::SecureSourceManager::V1::CreatePullRequestRequest.new(parent: parent, pull_request: pull_request), 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_pull_request_client_stub.call_rpc_count - end - end - - def test_get_pull_request - # Create GRPC objects. - grpc_response = ::Google::Cloud::SecureSourceManager::V1::PullRequest.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_pull_request_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :get_pull_request, name - assert_kind_of ::Google::Cloud::SecureSourceManager::V1::GetPullRequestRequest, request - assert_equal "hello world", request["name"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, get_pull_request_client_stub do - # Create client - client = ::Google::Cloud::SecureSourceManager::V1::SecureSourceManager::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.get_pull_request({ name: name }) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use named arguments - client.get_pull_request name: name do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object - client.get_pull_request ::Google::Cloud::SecureSourceManager::V1::GetPullRequestRequest.new(name: name) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use hash object with options - client.get_pull_request({ 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_pull_request(::Google::Cloud::SecureSourceManager::V1::GetPullRequestRequest.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_pull_request_client_stub.call_rpc_count - end - end - - def test_list_pull_requests - # Create GRPC objects. - grpc_response = ::Google::Cloud::SecureSourceManager::V1::ListPullRequestsResponse.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_pull_requests_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :list_pull_requests, name - assert_kind_of ::Google::Cloud::SecureSourceManager::V1::ListPullRequestsRequest, 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_pull_requests_client_stub do - # Create client - client = ::Google::Cloud::SecureSourceManager::V1::SecureSourceManager::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.list_pull_requests({ 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_pull_requests 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_pull_requests ::Google::Cloud::SecureSourceManager::V1::ListPullRequestsRequest.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_pull_requests({ 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_pull_requests(::Google::Cloud::SecureSourceManager::V1::ListPullRequestsRequest.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_pull_requests_client_stub.call_rpc_count - end - end - - def test_update_pull_request - # 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. - pull_request = {} - update_mask = {} - - update_pull_request_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :update_pull_request, name - assert_kind_of ::Google::Cloud::SecureSourceManager::V1::UpdatePullRequestRequest, request - assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::SecureSourceManager::V1::PullRequest), request["pull_request"] - assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Protobuf::FieldMask), request["update_mask"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, update_pull_request_client_stub do - # Create client - client = ::Google::Cloud::SecureSourceManager::V1::SecureSourceManager::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.update_pull_request({ pull_request: pull_request, 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_pull_request pull_request: pull_request, 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_pull_request ::Google::Cloud::SecureSourceManager::V1::UpdatePullRequestRequest.new(pull_request: pull_request, 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_pull_request({ pull_request: pull_request, 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_pull_request(::Google::Cloud::SecureSourceManager::V1::UpdatePullRequestRequest.new(pull_request: pull_request, 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_pull_request_client_stub.call_rpc_count - end - end - - def test_merge_pull_request - # 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" - - merge_pull_request_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :merge_pull_request, name - assert_kind_of ::Google::Cloud::SecureSourceManager::V1::MergePullRequestRequest, request - assert_equal "hello world", request["name"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, merge_pull_request_client_stub do - # Create client - client = ::Google::Cloud::SecureSourceManager::V1::SecureSourceManager::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.merge_pull_request({ 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.merge_pull_request 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.merge_pull_request ::Google::Cloud::SecureSourceManager::V1::MergePullRequestRequest.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.merge_pull_request({ 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.merge_pull_request(::Google::Cloud::SecureSourceManager::V1::MergePullRequestRequest.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, merge_pull_request_client_stub.call_rpc_count - end - end - - def test_open_pull_request - # 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" - - open_pull_request_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :open_pull_request, name - assert_kind_of ::Google::Cloud::SecureSourceManager::V1::OpenPullRequestRequest, request - assert_equal "hello world", request["name"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, open_pull_request_client_stub do - # Create client - client = ::Google::Cloud::SecureSourceManager::V1::SecureSourceManager::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.open_pull_request({ 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.open_pull_request 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.open_pull_request ::Google::Cloud::SecureSourceManager::V1::OpenPullRequestRequest.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.open_pull_request({ 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.open_pull_request(::Google::Cloud::SecureSourceManager::V1::OpenPullRequestRequest.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, open_pull_request_client_stub.call_rpc_count - end - end - - def test_close_pull_request - # 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" - - close_pull_request_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :close_pull_request, name - assert_kind_of ::Google::Cloud::SecureSourceManager::V1::ClosePullRequestRequest, request - assert_equal "hello world", request["name"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, close_pull_request_client_stub do - # Create client - client = ::Google::Cloud::SecureSourceManager::V1::SecureSourceManager::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.close_pull_request({ 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.close_pull_request 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.close_pull_request ::Google::Cloud::SecureSourceManager::V1::ClosePullRequestRequest.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.close_pull_request({ 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.close_pull_request(::Google::Cloud::SecureSourceManager::V1::ClosePullRequestRequest.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, close_pull_request_client_stub.call_rpc_count - end - end - - def test_list_pull_request_file_diffs - # Create GRPC objects. - grpc_response = ::Google::Cloud::SecureSourceManager::V1::ListPullRequestFileDiffsResponse.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" - - list_pull_request_file_diffs_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :list_pull_request_file_diffs, name - assert_kind_of ::Google::Cloud::SecureSourceManager::V1::ListPullRequestFileDiffsRequest, 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, list_pull_request_file_diffs_client_stub do - # Create client - client = ::Google::Cloud::SecureSourceManager::V1::SecureSourceManager::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.list_pull_request_file_diffs({ 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.list_pull_request_file_diffs 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.list_pull_request_file_diffs ::Google::Cloud::SecureSourceManager::V1::ListPullRequestFileDiffsRequest.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.list_pull_request_file_diffs({ 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.list_pull_request_file_diffs(::Google::Cloud::SecureSourceManager::V1::ListPullRequestFileDiffsRequest.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, list_pull_request_file_diffs_client_stub.call_rpc_count - end - end - - def test_fetch_tree - # Create GRPC objects. - grpc_response = ::Google::Cloud::SecureSourceManager::V1::FetchTreeResponse.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. - repository = "hello world" - ref = "hello world" - recursive = true - page_size = 42 - page_token = "hello world" - - fetch_tree_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :fetch_tree, name - assert_kind_of ::Google::Cloud::SecureSourceManager::V1::FetchTreeRequest, request - assert_equal "hello world", request["repository"] - assert_equal "hello world", request["ref"] - assert_equal true, request["recursive"] - assert_equal 42, request["page_size"] - assert_equal "hello world", request["page_token"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, fetch_tree_client_stub do - # Create client - client = ::Google::Cloud::SecureSourceManager::V1::SecureSourceManager::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.fetch_tree({ repository: repository, ref: ref, recursive: recursive, 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.fetch_tree repository: repository, ref: ref, recursive: recursive, 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.fetch_tree ::Google::Cloud::SecureSourceManager::V1::FetchTreeRequest.new(repository: repository, ref: ref, recursive: recursive, 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.fetch_tree({ repository: repository, ref: ref, recursive: recursive, 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.fetch_tree(::Google::Cloud::SecureSourceManager::V1::FetchTreeRequest.new(repository: repository, ref: ref, recursive: recursive, 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, fetch_tree_client_stub.call_rpc_count - end - end - - def test_fetch_blob - # Create GRPC objects. - grpc_response = ::Google::Cloud::SecureSourceManager::V1::FetchBlobResponse.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. - repository = "hello world" - sha = "hello world" - - fetch_blob_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :fetch_blob, name - assert_kind_of ::Google::Cloud::SecureSourceManager::V1::FetchBlobRequest, request - assert_equal "hello world", request["repository"] - assert_equal "hello world", request["sha"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, fetch_blob_client_stub do - # Create client - client = ::Google::Cloud::SecureSourceManager::V1::SecureSourceManager::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.fetch_blob({ repository: repository, sha: sha }) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use named arguments - client.fetch_blob repository: repository, sha: sha do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object - client.fetch_blob ::Google::Cloud::SecureSourceManager::V1::FetchBlobRequest.new(repository: repository, sha: sha) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use hash object with options - client.fetch_blob({ repository: repository, sha: sha }, grpc_options) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object with options - client.fetch_blob(::Google::Cloud::SecureSourceManager::V1::FetchBlobRequest.new(repository: repository, sha: sha), grpc_options) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Verify method calls - assert_equal 5, fetch_blob_client_stub.call_rpc_count - end - end - - def test_create_issue - # 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" - issue = {} - - create_issue_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :create_issue, name - assert_kind_of ::Google::Cloud::SecureSourceManager::V1::CreateIssueRequest, request - assert_equal "hello world", request["parent"] - assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::SecureSourceManager::V1::Issue), request["issue"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, create_issue_client_stub do - # Create client - client = ::Google::Cloud::SecureSourceManager::V1::SecureSourceManager::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.create_issue({ parent: parent, issue: issue }) 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_issue parent: parent, issue: issue 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_issue ::Google::Cloud::SecureSourceManager::V1::CreateIssueRequest.new(parent: parent, issue: issue) 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_issue({ parent: parent, issue: issue }, 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_issue(::Google::Cloud::SecureSourceManager::V1::CreateIssueRequest.new(parent: parent, issue: issue), 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_issue_client_stub.call_rpc_count - end - end - - def test_get_issue - # Create GRPC objects. - grpc_response = ::Google::Cloud::SecureSourceManager::V1::Issue.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_issue_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :get_issue, name - assert_kind_of ::Google::Cloud::SecureSourceManager::V1::GetIssueRequest, request - assert_equal "hello world", request["name"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, get_issue_client_stub do - # Create client - client = ::Google::Cloud::SecureSourceManager::V1::SecureSourceManager::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.get_issue({ name: name }) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use named arguments - client.get_issue name: name do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object - client.get_issue ::Google::Cloud::SecureSourceManager::V1::GetIssueRequest.new(name: name) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use hash object with options - client.get_issue({ 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_issue(::Google::Cloud::SecureSourceManager::V1::GetIssueRequest.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_issue_client_stub.call_rpc_count - end - end - - def test_list_issues - # Create GRPC objects. - grpc_response = ::Google::Cloud::SecureSourceManager::V1::ListIssuesResponse.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_issues_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :list_issues, name - assert_kind_of ::Google::Cloud::SecureSourceManager::V1::ListIssuesRequest, 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_issues_client_stub do - # Create client - client = ::Google::Cloud::SecureSourceManager::V1::SecureSourceManager::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.list_issues({ 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_issues 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_issues ::Google::Cloud::SecureSourceManager::V1::ListIssuesRequest.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_issues({ 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_issues(::Google::Cloud::SecureSourceManager::V1::ListIssuesRequest.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_issues_client_stub.call_rpc_count - end - end - - def test_update_issue - # 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. - issue = {} - update_mask = {} - - update_issue_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :update_issue, name - assert_kind_of ::Google::Cloud::SecureSourceManager::V1::UpdateIssueRequest, request - assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::SecureSourceManager::V1::Issue), request["issue"] - assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Protobuf::FieldMask), request["update_mask"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, update_issue_client_stub do - # Create client - client = ::Google::Cloud::SecureSourceManager::V1::SecureSourceManager::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.update_issue({ issue: issue, 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_issue issue: issue, 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_issue ::Google::Cloud::SecureSourceManager::V1::UpdateIssueRequest.new(issue: issue, 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_issue({ issue: issue, 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_issue(::Google::Cloud::SecureSourceManager::V1::UpdateIssueRequest.new(issue: issue, 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_issue_client_stub.call_rpc_count - end - end - - def test_delete_issue - # 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" - - delete_issue_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :delete_issue, name - assert_kind_of ::Google::Cloud::SecureSourceManager::V1::DeleteIssueRequest, request - assert_equal "hello world", request["name"] - assert_equal "hello world", request["etag"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, delete_issue_client_stub do - # Create client - client = ::Google::Cloud::SecureSourceManager::V1::SecureSourceManager::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.delete_issue({ name: name, etag: etag }) 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_issue name: name, etag: etag 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_issue ::Google::Cloud::SecureSourceManager::V1::DeleteIssueRequest.new(name: name, etag: etag) 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_issue({ name: name, etag: etag }, 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_issue(::Google::Cloud::SecureSourceManager::V1::DeleteIssueRequest.new(name: name, etag: etag), 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_issue_client_stub.call_rpc_count - end - end - - def test_open_issue - # 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" - - open_issue_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :open_issue, name - assert_kind_of ::Google::Cloud::SecureSourceManager::V1::OpenIssueRequest, request - assert_equal "hello world", request["name"] - assert_equal "hello world", request["etag"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, open_issue_client_stub do - # Create client - client = ::Google::Cloud::SecureSourceManager::V1::SecureSourceManager::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.open_issue({ name: name, etag: etag }) 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.open_issue name: name, etag: etag 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.open_issue ::Google::Cloud::SecureSourceManager::V1::OpenIssueRequest.new(name: name, etag: etag) 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.open_issue({ name: name, etag: etag }, 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.open_issue(::Google::Cloud::SecureSourceManager::V1::OpenIssueRequest.new(name: name, etag: etag), 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, open_issue_client_stub.call_rpc_count - end - end - - def test_close_issue - # 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" - - close_issue_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :close_issue, name - assert_kind_of ::Google::Cloud::SecureSourceManager::V1::CloseIssueRequest, request - assert_equal "hello world", request["name"] - assert_equal "hello world", request["etag"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, close_issue_client_stub do - # Create client - client = ::Google::Cloud::SecureSourceManager::V1::SecureSourceManager::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.close_issue({ name: name, etag: etag }) 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.close_issue name: name, etag: etag 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.close_issue ::Google::Cloud::SecureSourceManager::V1::CloseIssueRequest.new(name: name, etag: etag) 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.close_issue({ name: name, etag: etag }, 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.close_issue(::Google::Cloud::SecureSourceManager::V1::CloseIssueRequest.new(name: name, etag: etag), 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, close_issue_client_stub.call_rpc_count - end - end - - def test_get_pull_request_comment - # Create GRPC objects. - grpc_response = ::Google::Cloud::SecureSourceManager::V1::PullRequestComment.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_pull_request_comment_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :get_pull_request_comment, name - assert_kind_of ::Google::Cloud::SecureSourceManager::V1::GetPullRequestCommentRequest, request - assert_equal "hello world", request["name"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, get_pull_request_comment_client_stub do - # Create client - client = ::Google::Cloud::SecureSourceManager::V1::SecureSourceManager::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.get_pull_request_comment({ name: name }) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use named arguments - client.get_pull_request_comment name: name do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object - client.get_pull_request_comment ::Google::Cloud::SecureSourceManager::V1::GetPullRequestCommentRequest.new(name: name) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use hash object with options - client.get_pull_request_comment({ 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_pull_request_comment(::Google::Cloud::SecureSourceManager::V1::GetPullRequestCommentRequest.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_pull_request_comment_client_stub.call_rpc_count - end - end - - def test_list_pull_request_comments - # Create GRPC objects. - grpc_response = ::Google::Cloud::SecureSourceManager::V1::ListPullRequestCommentsResponse.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_pull_request_comments_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :list_pull_request_comments, name - assert_kind_of ::Google::Cloud::SecureSourceManager::V1::ListPullRequestCommentsRequest, 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_pull_request_comments_client_stub do - # Create client - client = ::Google::Cloud::SecureSourceManager::V1::SecureSourceManager::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.list_pull_request_comments({ 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_pull_request_comments 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_pull_request_comments ::Google::Cloud::SecureSourceManager::V1::ListPullRequestCommentsRequest.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_pull_request_comments({ 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_pull_request_comments(::Google::Cloud::SecureSourceManager::V1::ListPullRequestCommentsRequest.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_pull_request_comments_client_stub.call_rpc_count - end - end - - def test_create_pull_request_comment - # 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" - pull_request_comment = {} - - create_pull_request_comment_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :create_pull_request_comment, name - assert_kind_of ::Google::Cloud::SecureSourceManager::V1::CreatePullRequestCommentRequest, request - assert_equal "hello world", request["parent"] - assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::SecureSourceManager::V1::PullRequestComment), request["pull_request_comment"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, create_pull_request_comment_client_stub do - # Create client - client = ::Google::Cloud::SecureSourceManager::V1::SecureSourceManager::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.create_pull_request_comment({ parent: parent, pull_request_comment: pull_request_comment }) 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_pull_request_comment parent: parent, pull_request_comment: pull_request_comment 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_pull_request_comment ::Google::Cloud::SecureSourceManager::V1::CreatePullRequestCommentRequest.new(parent: parent, pull_request_comment: pull_request_comment) 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_pull_request_comment({ parent: parent, pull_request_comment: pull_request_comment }, 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_pull_request_comment(::Google::Cloud::SecureSourceManager::V1::CreatePullRequestCommentRequest.new(parent: parent, pull_request_comment: pull_request_comment), 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_pull_request_comment_client_stub.call_rpc_count - end - end - - def test_update_pull_request_comment - # 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. - pull_request_comment = {} - update_mask = {} - - update_pull_request_comment_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :update_pull_request_comment, name - assert_kind_of ::Google::Cloud::SecureSourceManager::V1::UpdatePullRequestCommentRequest, request - assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::SecureSourceManager::V1::PullRequestComment), request["pull_request_comment"] - assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Protobuf::FieldMask), request["update_mask"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, update_pull_request_comment_client_stub do - # Create client - client = ::Google::Cloud::SecureSourceManager::V1::SecureSourceManager::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.update_pull_request_comment({ pull_request_comment: pull_request_comment, 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_pull_request_comment pull_request_comment: pull_request_comment, 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_pull_request_comment ::Google::Cloud::SecureSourceManager::V1::UpdatePullRequestCommentRequest.new(pull_request_comment: pull_request_comment, 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_pull_request_comment({ pull_request_comment: pull_request_comment, 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_pull_request_comment(::Google::Cloud::SecureSourceManager::V1::UpdatePullRequestCommentRequest.new(pull_request_comment: pull_request_comment, 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_pull_request_comment_client_stub.call_rpc_count - end - end - - def test_delete_pull_request_comment - # 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" - - delete_pull_request_comment_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :delete_pull_request_comment, name - assert_kind_of ::Google::Cloud::SecureSourceManager::V1::DeletePullRequestCommentRequest, request - assert_equal "hello world", request["name"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, delete_pull_request_comment_client_stub do - # Create client - client = ::Google::Cloud::SecureSourceManager::V1::SecureSourceManager::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.delete_pull_request_comment({ 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.delete_pull_request_comment 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.delete_pull_request_comment ::Google::Cloud::SecureSourceManager::V1::DeletePullRequestCommentRequest.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.delete_pull_request_comment({ 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.delete_pull_request_comment(::Google::Cloud::SecureSourceManager::V1::DeletePullRequestCommentRequest.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, delete_pull_request_comment_client_stub.call_rpc_count - end - end - - def test_batch_create_pull_request_comments - # 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" - requests = [{}] - - batch_create_pull_request_comments_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :batch_create_pull_request_comments, name - assert_kind_of ::Google::Cloud::SecureSourceManager::V1::BatchCreatePullRequestCommentsRequest, request - assert_equal "hello world", request["parent"] - assert_kind_of ::Google::Cloud::SecureSourceManager::V1::CreatePullRequestCommentRequest, request["requests"].first - refute_nil options - end - - Gapic::ServiceStub.stub :new, batch_create_pull_request_comments_client_stub do - # Create client - client = ::Google::Cloud::SecureSourceManager::V1::SecureSourceManager::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.batch_create_pull_request_comments({ parent: parent, requests: requests }) 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.batch_create_pull_request_comments parent: parent, requests: requests 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.batch_create_pull_request_comments ::Google::Cloud::SecureSourceManager::V1::BatchCreatePullRequestCommentsRequest.new(parent: parent, requests: requests) 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.batch_create_pull_request_comments({ parent: parent, requests: requests }, 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.batch_create_pull_request_comments(::Google::Cloud::SecureSourceManager::V1::BatchCreatePullRequestCommentsRequest.new(parent: parent, requests: requests), 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, batch_create_pull_request_comments_client_stub.call_rpc_count - end - end - - def test_resolve_pull_request_comments - # 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" - names = ["hello world"] - auto_fill = true - - resolve_pull_request_comments_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :resolve_pull_request_comments, name - assert_kind_of ::Google::Cloud::SecureSourceManager::V1::ResolvePullRequestCommentsRequest, request - assert_equal "hello world", request["parent"] - assert_equal ["hello world"], request["names"] - assert_equal true, request["auto_fill"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, resolve_pull_request_comments_client_stub do - # Create client - client = ::Google::Cloud::SecureSourceManager::V1::SecureSourceManager::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.resolve_pull_request_comments({ parent: parent, names: names, auto_fill: auto_fill }) 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.resolve_pull_request_comments parent: parent, names: names, auto_fill: auto_fill 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.resolve_pull_request_comments ::Google::Cloud::SecureSourceManager::V1::ResolvePullRequestCommentsRequest.new(parent: parent, names: names, auto_fill: auto_fill) 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.resolve_pull_request_comments({ parent: parent, names: names, auto_fill: auto_fill }, 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.resolve_pull_request_comments(::Google::Cloud::SecureSourceManager::V1::ResolvePullRequestCommentsRequest.new(parent: parent, names: names, auto_fill: auto_fill), 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, resolve_pull_request_comments_client_stub.call_rpc_count - end - end - - def test_unresolve_pull_request_comments - # 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" - names = ["hello world"] - auto_fill = true - - unresolve_pull_request_comments_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :unresolve_pull_request_comments, name - assert_kind_of ::Google::Cloud::SecureSourceManager::V1::UnresolvePullRequestCommentsRequest, request - assert_equal "hello world", request["parent"] - assert_equal ["hello world"], request["names"] - assert_equal true, request["auto_fill"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, unresolve_pull_request_comments_client_stub do - # Create client - client = ::Google::Cloud::SecureSourceManager::V1::SecureSourceManager::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.unresolve_pull_request_comments({ parent: parent, names: names, auto_fill: auto_fill }) 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.unresolve_pull_request_comments parent: parent, names: names, auto_fill: auto_fill 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.unresolve_pull_request_comments ::Google::Cloud::SecureSourceManager::V1::UnresolvePullRequestCommentsRequest.new(parent: parent, names: names, auto_fill: auto_fill) 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.unresolve_pull_request_comments({ parent: parent, names: names, auto_fill: auto_fill }, 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.unresolve_pull_request_comments(::Google::Cloud::SecureSourceManager::V1::UnresolvePullRequestCommentsRequest.new(parent: parent, names: names, auto_fill: auto_fill), 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, unresolve_pull_request_comments_client_stub.call_rpc_count - end - end - - def test_create_issue_comment - # 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" - issue_comment = {} - - create_issue_comment_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :create_issue_comment, name - assert_kind_of ::Google::Cloud::SecureSourceManager::V1::CreateIssueCommentRequest, request - assert_equal "hello world", request["parent"] - assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::SecureSourceManager::V1::IssueComment), request["issue_comment"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, create_issue_comment_client_stub do - # Create client - client = ::Google::Cloud::SecureSourceManager::V1::SecureSourceManager::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.create_issue_comment({ parent: parent, issue_comment: issue_comment }) 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_issue_comment parent: parent, issue_comment: issue_comment 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_issue_comment ::Google::Cloud::SecureSourceManager::V1::CreateIssueCommentRequest.new(parent: parent, issue_comment: issue_comment) 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_issue_comment({ parent: parent, issue_comment: issue_comment }, 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_issue_comment(::Google::Cloud::SecureSourceManager::V1::CreateIssueCommentRequest.new(parent: parent, issue_comment: issue_comment), 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_issue_comment_client_stub.call_rpc_count - end - end - - def test_get_issue_comment - # Create GRPC objects. - grpc_response = ::Google::Cloud::SecureSourceManager::V1::IssueComment.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_issue_comment_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :get_issue_comment, name - assert_kind_of ::Google::Cloud::SecureSourceManager::V1::GetIssueCommentRequest, request - assert_equal "hello world", request["name"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, get_issue_comment_client_stub do - # Create client - client = ::Google::Cloud::SecureSourceManager::V1::SecureSourceManager::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.get_issue_comment({ name: name }) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use named arguments - client.get_issue_comment name: name do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object - client.get_issue_comment ::Google::Cloud::SecureSourceManager::V1::GetIssueCommentRequest.new(name: name) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use hash object with options - client.get_issue_comment({ 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_issue_comment(::Google::Cloud::SecureSourceManager::V1::GetIssueCommentRequest.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_issue_comment_client_stub.call_rpc_count - end - end - - def test_list_issue_comments - # Create GRPC objects. - grpc_response = ::Google::Cloud::SecureSourceManager::V1::ListIssueCommentsResponse.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_issue_comments_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :list_issue_comments, name - assert_kind_of ::Google::Cloud::SecureSourceManager::V1::ListIssueCommentsRequest, 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_issue_comments_client_stub do - # Create client - client = ::Google::Cloud::SecureSourceManager::V1::SecureSourceManager::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.list_issue_comments({ 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_issue_comments 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_issue_comments ::Google::Cloud::SecureSourceManager::V1::ListIssueCommentsRequest.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_issue_comments({ 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_issue_comments(::Google::Cloud::SecureSourceManager::V1::ListIssueCommentsRequest.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_issue_comments_client_stub.call_rpc_count - end - end - - def test_update_issue_comment - # 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. - issue_comment = {} - update_mask = {} - - update_issue_comment_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :update_issue_comment, name - assert_kind_of ::Google::Cloud::SecureSourceManager::V1::UpdateIssueCommentRequest, request - assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::SecureSourceManager::V1::IssueComment), request["issue_comment"] - assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Protobuf::FieldMask), request["update_mask"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, update_issue_comment_client_stub do - # Create client - client = ::Google::Cloud::SecureSourceManager::V1::SecureSourceManager::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.update_issue_comment({ issue_comment: issue_comment, 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_issue_comment issue_comment: issue_comment, 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_issue_comment ::Google::Cloud::SecureSourceManager::V1::UpdateIssueCommentRequest.new(issue_comment: issue_comment, 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_issue_comment({ issue_comment: issue_comment, 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_issue_comment(::Google::Cloud::SecureSourceManager::V1::UpdateIssueCommentRequest.new(issue_comment: issue_comment, 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_issue_comment_client_stub.call_rpc_count - end - end - - def test_delete_issue_comment - # 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" - - delete_issue_comment_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :delete_issue_comment, name - assert_kind_of ::Google::Cloud::SecureSourceManager::V1::DeleteIssueCommentRequest, request - assert_equal "hello world", request["name"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, delete_issue_comment_client_stub do - # Create client - client = ::Google::Cloud::SecureSourceManager::V1::SecureSourceManager::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.delete_issue_comment({ 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.delete_issue_comment 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.delete_issue_comment ::Google::Cloud::SecureSourceManager::V1::DeleteIssueCommentRequest.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.delete_issue_comment({ 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.delete_issue_comment(::Google::Cloud::SecureSourceManager::V1::DeleteIssueCommentRequest.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, delete_issue_comment_client_stub.call_rpc_count - end - end - - def test_configure - grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - - client = block_config = config = nil - dummy_stub = ClientStub.new nil, nil - Gapic::ServiceStub.stub :new, dummy_stub do - client = ::Google::Cloud::SecureSourceManager::V1::SecureSourceManager::Client.new do |config| - config.credentials = grpc_channel - end - end - - config = client.configure do |c| - block_config = c - end - - assert_same block_config, config - assert_kind_of ::Google::Cloud::SecureSourceManager::V1::SecureSourceManager::Client::Configuration, config - end - - def test_credentials - key = OpenSSL::PKey::RSA.new 2048 - cred_json = { - "private_key" => key.to_pem, - "client_email" => "app@developer.gserviceaccount.com", - "type" => "service_account" - } - key_file = StringIO.new cred_json.to_json - creds = Google::Auth::ServiceAccountCredentials.make_creds({ json_key_io: key_file }) - - dummy_stub = ClientStub.new nil, nil - Gapic::ServiceStub.stub :new, dummy_stub do - client = ::Google::Cloud::SecureSourceManager::V1::SecureSourceManager::Client.new do |config| - config.credentials = creds - end - assert_kind_of ::Google::Cloud::SecureSourceManager::V1::SecureSourceManager::Client, client - assert_equal creds, client.configure.credentials - end - end - - def test_operations_client - grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - - client = nil - dummy_stub = ClientStub.new nil, nil - Gapic::ServiceStub.stub :new, dummy_stub do - client = ::Google::Cloud::SecureSourceManager::V1::SecureSourceManager::Client.new do |config| - config.credentials = grpc_channel - end - end - - assert_kind_of ::Google::Cloud::SecureSourceManager::V1::SecureSourceManager::Operations, client.operations_client - end -end diff --git a/owl-bot-staging/google-cloud-secure_source_manager-v1/test/helper.rb b/owl-bot-staging/google-cloud-secure_source_manager-v1/test/helper.rb deleted file mode 100644 index 672b337030e7..000000000000 --- a/owl-bot-staging/google-cloud-secure_source_manager-v1/test/helper.rb +++ /dev/null @@ -1,26 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -require "minitest/autorun" -require "minitest/focus" -require "minitest/mock" -require "minitest/rg" - -require "grpc" - -require "ostruct" diff --git a/owl-bot-staging/google-cloud-security-private_ca-v1/.gitignore b/owl-bot-staging/google-cloud-security-private_ca-v1/.gitignore deleted file mode 100644 index 0135b6bc6cfc..000000000000 --- a/owl-bot-staging/google-cloud-security-private_ca-v1/.gitignore +++ /dev/null @@ -1,22 +0,0 @@ -# Ignore bundler lockfiles -Gemfile.lock -gems.locked - -# Ignore documentation output -doc/* -.yardoc/* - -# Ignore test output -coverage/* - -# Ignore build artifacts -pkg/* - -# Ignore files commonly present in certain dev environments -.vagrant -.DS_STORE -.idea -*.iml - -# Ignore synth output -__pycache__ diff --git a/owl-bot-staging/google-cloud-security-private_ca-v1/.repo-metadata.json b/owl-bot-staging/google-cloud-security-private_ca-v1/.repo-metadata.json deleted file mode 100644 index f7ac3d34f8c4..000000000000 --- a/owl-bot-staging/google-cloud-security-private_ca-v1/.repo-metadata.json +++ /dev/null @@ -1,18 +0,0 @@ -{ - "api_id": "privateca.googleapis.com", - "api_shortname": "privateca", - "client_documentation": "https://cloud.google.com/ruby/docs/reference/google-cloud-security-private_ca-v1/latest", - "distribution_name": "google-cloud-security-private_ca-v1", - "is_cloud": true, - "language": "ruby", - "name": "privateca", - "name_pretty": "Certificate Authority Service V1 API", - "product_documentation": "https://cloud.google.com/certificate-authority-service/", - "release_level": "unreleased", - "repo": "googleapis/google-cloud-ruby", - "requires_billing": true, - "ruby-cloud-description": "Certificate Authority Service is a highly available, scalable Google Cloud service that enables you to simplify, automate, and customize the deployment, management, and security of private certificate authorities (CA). Note that google-cloud-security-private_ca-v1 is a version-specific client library. For most uses, we recommend installing the main client library google-cloud-security-private_ca instead. See the readme for more details.", - "ruby-cloud-env-prefix": "PRIVATE_CA", - "ruby-cloud-product-url": "https://cloud.google.com/certificate-authority-service/", - "library_type": "GAPIC_AUTO" -} diff --git a/owl-bot-staging/google-cloud-security-private_ca-v1/.rubocop.yml b/owl-bot-staging/google-cloud-security-private_ca-v1/.rubocop.yml deleted file mode 100644 index f143186a635f..000000000000 --- a/owl-bot-staging/google-cloud-security-private_ca-v1/.rubocop.yml +++ /dev/null @@ -1,33 +0,0 @@ -inherit_gem: - google-style: google-style.yml - -AllCops: - Exclude: - - "google-cloud-security-private_ca-v1.gemspec" - - "lib/**/*_pb.rb" - - "proto_docs/**/*" - - "test/**/*" - - "acceptance/**/*" - - "samples/acceptance/**/*" - - "Rakefile" - -Layout/LineLength: - Enabled: false -Metrics/AbcSize: - Enabled: false -Metrics/ClassLength: - Enabled: false -Metrics/CyclomaticComplexity: - Enabled: false -Metrics/MethodLength: - Enabled: false -Metrics/ModuleLength: - Enabled: false -Metrics/PerceivedComplexity: - Enabled: false -Naming/AccessorMethodName: - Exclude: - - "snippets/**/*.rb" -Naming/FileName: - Exclude: - - "lib/google-cloud-security-private_ca-v1.rb" diff --git a/owl-bot-staging/google-cloud-security-private_ca-v1/.toys.rb b/owl-bot-staging/google-cloud-security-private_ca-v1/.toys.rb deleted file mode 100644 index 177e22456e8a..000000000000 --- a/owl-bot-staging/google-cloud-security-private_ca-v1/.toys.rb +++ /dev/null @@ -1,28 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -toys_version! ">= 0.15.3" - -if ENV["RUBY_COMMON_TOOLS"] - common_tools_dir = File.expand_path ENV["RUBY_COMMON_TOOLS"] - load File.join(common_tools_dir, "toys", "gapic") -else - load_git remote: "https://github.com/googleapis/ruby-common-tools.git", - path: "toys/gapic", - update: true -end diff --git a/owl-bot-staging/google-cloud-security-private_ca-v1/.yardopts b/owl-bot-staging/google-cloud-security-private_ca-v1/.yardopts deleted file mode 100644 index 4cd4bdadd755..000000000000 --- a/owl-bot-staging/google-cloud-security-private_ca-v1/.yardopts +++ /dev/null @@ -1,12 +0,0 @@ ---no-private ---title="Certificate Authority Service V1 API" ---exclude _pb\.rb$ ---markup markdown ---markup-provider redcarpet - -./lib/**/*.rb -./proto_docs/**/*.rb -- -README.md -LICENSE.md -AUTHENTICATION.md diff --git a/owl-bot-staging/google-cloud-security-private_ca-v1/AUTHENTICATION.md b/owl-bot-staging/google-cloud-security-private_ca-v1/AUTHENTICATION.md deleted file mode 100644 index b0dc4d853281..000000000000 --- a/owl-bot-staging/google-cloud-security-private_ca-v1/AUTHENTICATION.md +++ /dev/null @@ -1,122 +0,0 @@ -# Authentication - -The recommended way to authenticate to the google-cloud-security-private_ca-v1 library is to use -[Application Default Credentials (ADC)](https://cloud.google.com/docs/authentication/application-default-credentials). -To review all of your authentication options, see [Credentials lookup](#credential-lookup). - -## Quickstart - -The following example shows how to set up authentication for a local development -environment with your user credentials. - -**NOTE:** This method is _not_ recommended for running in production. User credentials -should be used only during development. - -1. [Download and install the Google Cloud CLI](https://cloud.google.com/sdk). -2. Set up a local ADC file with your user credentials: - -```sh -gcloud auth application-default login -``` - -3. Write code as if already authenticated. - -For more information about setting up authentication for a local development environment, see -[Set up Application Default Credentials](https://cloud.google.com/docs/authentication/provide-credentials-adc#local-dev). - -## Credential Lookup - -The google-cloud-security-private_ca-v1 library provides several mechanisms to configure your system. -Generally, using Application Default Credentials to facilitate automatic -credentials discovery is the easist method. But if you need to explicitly specify -credentials, there are several methods available to you. - -Credentials are accepted in the following ways, in the following order or precedence: - -1. Credentials specified in method arguments -2. Credentials specified in configuration -3. Credentials pointed to or included in environment variables -4. Credentials found in local ADC file -5. Credentials returned by the metadata server for the attached service account (GCP) - -### Configuration - -You can configure a path to a JSON credentials file, either for an individual client object or -globally, for all client objects. The JSON file can contain credentials created for -[workload identity federation](https://cloud.google.com/iam/docs/workload-identity-federation), -[workforce identity federation](https://cloud.google.com/iam/docs/workforce-identity-federation), or a -[service account key](https://cloud.google.com/docs/authentication/provide-credentials-adc#local-key). - -Note: Service account keys are a security risk if not managed correctly. You should -[choose a more secure alternative to service account keys](https://cloud.google.com/docs/authentication#auth-decision-tree) -whenever possible. - -To configure a credentials file for an individual client initialization: - -```ruby -require "google/cloud/security/private_ca/v1" - -client = ::Google::Cloud::Security::PrivateCA::V1::CertificateAuthorityService::Client.new do |config| - config.credentials = "path/to/credentialfile.json" -end -``` - -To configure a credentials file globally for all clients: - -```ruby -require "google/cloud/security/private_ca/v1" - -::Google::Cloud::Security::PrivateCA::V1::CertificateAuthorityService::Client.configure do |config| - config.credentials = "path/to/credentialfile.json" -end - -client = ::Google::Cloud::Security::PrivateCA::V1::CertificateAuthorityService::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-security-private_ca-v1 -checks for credentials are: - -* `GOOGLE_CLOUD_CREDENTIALS` - Path to JSON file, or JSON contents -* `GOOGLE_APPLICATION_CREDENTIALS` - Path to JSON file - -```ruby -require "google/cloud/security/private_ca/v1" - -ENV["GOOGLE_APPLICATION_CREDENTIALS"] = "path/to/credentialfile.json" - -client = ::Google::Cloud::Security::PrivateCA::V1::CertificateAuthorityService::Client.new -``` - -### Local ADC file - -You can set up a local ADC file with your user credentials for authentication during -development. If credentials are not provided in code or in environment variables, -then the local ADC credentials are discovered. - -Follow the steps in [Quickstart](#quickstart) to set up a local ADC file. - -### Google Cloud Platform environments - -When running on Google Cloud Platform (GCP), including Google Compute Engine -(GCE), Google Kubernetes Engine (GKE), Google App Engine (GAE), Google Cloud -Functions (GCF) and Cloud Run, credentials are retrieved from the attached -service account automatically. Code should be written as if already authenticated. - -For more information, see -[Set up ADC for Google Cloud services](https://cloud.google.com/docs/authentication/provide-credentials-adc#attached-sa). diff --git a/owl-bot-staging/google-cloud-security-private_ca-v1/CHANGELOG.md b/owl-bot-staging/google-cloud-security-private_ca-v1/CHANGELOG.md deleted file mode 100644 index f88957a62ba2..000000000000 --- a/owl-bot-staging/google-cloud-security-private_ca-v1/CHANGELOG.md +++ /dev/null @@ -1,2 +0,0 @@ -# Release History - diff --git a/owl-bot-staging/google-cloud-security-private_ca-v1/Gemfile b/owl-bot-staging/google-cloud-security-private_ca-v1/Gemfile deleted file mode 100644 index 1d08558908d8..000000000000 --- a/owl-bot-staging/google-cloud-security-private_ca-v1/Gemfile +++ /dev/null @@ -1,14 +0,0 @@ -source "https://rubygems.org" - -gemspec - -gem "google-style", "~> 1.32.0" -gem "irb", "~> 1.17" -gem "minitest", "~> 6.0.2" -gem "minitest-focus", "~> 1.4" -gem "minitest-mock", "~> 5.27" -gem "minitest-rg", "~> 5.3" -gem "ostruct", "~> 0.5.5" -gem "rake", ">= 13.0" -gem "redcarpet", "~> 3.6" -gem "yard", "~> 0.9" diff --git a/owl-bot-staging/google-cloud-security-private_ca-v1/LICENSE.md b/owl-bot-staging/google-cloud-security-private_ca-v1/LICENSE.md deleted file mode 100644 index c261857ba6ad..000000000000 --- a/owl-bot-staging/google-cloud-security-private_ca-v1/LICENSE.md +++ /dev/null @@ -1,201 +0,0 @@ - Apache License - Version 2.0, January 2004 - http://www.apache.org/licenses/ - - TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION - - 1. Definitions. - - "License" shall mean the terms and conditions for use, reproduction, - and distribution as defined by Sections 1 through 9 of this document. - - "Licensor" shall mean the copyright owner or entity authorized by - the copyright owner that is granting the License. - - "Legal Entity" shall mean the union of the acting entity and all - other entities that control, are controlled by, or are under common - control with that entity. For the purposes of this definition, - "control" means (i) the power, direct or indirect, to cause the - direction or management of such entity, whether by contract or - otherwise, or (ii) ownership of fifty percent (50%) or more of the - outstanding shares, or (iii) beneficial ownership of such entity. - - "You" (or "Your") shall mean an individual or Legal Entity - exercising permissions granted by this License. - - "Source" form shall mean the preferred form for making modifications, - including but not limited to software source code, documentation - source, and configuration files. - - "Object" form shall mean any form resulting from mechanical - transformation or translation of a Source form, including but - not limited to compiled object code, generated documentation, - and conversions to other media types. - - "Work" shall mean the work of authorship, whether in Source or - Object form, made available under the License, as indicated by a - copyright notice that is included in or attached to the work - (an example is provided in the Appendix below). - - "Derivative Works" shall mean any work, whether in Source or Object - form, that is based on (or derived from) the Work and for which the - editorial revisions, annotations, elaborations, or other modifications - represent, as a whole, an original work of authorship. For the purposes - of this License, Derivative Works shall not include works that remain - separable from, or merely link (or bind by name) to the interfaces of, - the Work and Derivative Works thereof. - - "Contribution" shall mean any work of authorship, including - the original version of the Work and any modifications or additions - to that Work or Derivative Works thereof, that is intentionally - submitted to Licensor for inclusion in the Work by the copyright owner - or by an individual or Legal Entity authorized to submit on behalf of - the copyright owner. For the purposes of this definition, "submitted" - means any form of electronic, verbal, or written communication sent - to the Licensor or its representatives, including but not limited to - communication on electronic mailing lists, source code control systems, - and issue tracking systems that are managed by, or on behalf of, the - Licensor for the purpose of discussing and improving the Work, but - excluding communication that is conspicuously marked or otherwise - designated in writing by the copyright owner as "Not a Contribution." - - "Contributor" shall mean Licensor and any individual or Legal Entity - on behalf of whom a Contribution has been received by Licensor and - subsequently incorporated within the Work. - - 2. Grant of Copyright License. Subject to the terms and conditions of - this License, each Contributor hereby grants to You a perpetual, - worldwide, non-exclusive, no-charge, royalty-free, irrevocable - copyright license to reproduce, prepare Derivative Works of, - publicly display, publicly perform, sublicense, and distribute the - Work and such Derivative Works in Source or Object form. - - 3. Grant of Patent License. Subject to the terms and conditions of - this License, each Contributor hereby grants to You a perpetual, - worldwide, non-exclusive, no-charge, royalty-free, irrevocable - (except as stated in this section) patent license to make, have made, - use, offer to sell, sell, import, and otherwise transfer the Work, - where such license applies only to those patent claims licensable - by such Contributor that are necessarily infringed by their - Contribution(s) alone or by combination of their Contribution(s) - with the Work to which such Contribution(s) was submitted. If You - institute patent litigation against any entity (including a - cross-claim or counterclaim in a lawsuit) alleging that the Work - or a Contribution incorporated within the Work constitutes direct - or contributory patent infringement, then any patent licenses - granted to You under this License for that Work shall terminate - as of the date such litigation is filed. - - 4. Redistribution. You may reproduce and distribute copies of the - Work or Derivative Works thereof in any medium, with or without - modifications, and in Source or Object form, provided that You - meet the following conditions: - - (a) You must give any other recipients of the Work or - Derivative Works a copy of this License; and - - (b) You must cause any modified files to carry prominent notices - stating that You changed the files; and - - (c) You must retain, in the Source form of any Derivative Works - that You distribute, all copyright, patent, trademark, and - attribution notices from the Source form of the Work, - excluding those notices that do not pertain to any part of - the Derivative Works; and - - (d) If the Work includes a "NOTICE" text file as part of its - distribution, then any Derivative Works that You distribute must - include a readable copy of the attribution notices contained - within such NOTICE file, excluding those notices that do not - pertain to any part of the Derivative Works, in at least one - of the following places: within a NOTICE text file distributed - as part of the Derivative Works; within the Source form or - documentation, if provided along with the Derivative Works; or, - within a display generated by the Derivative Works, if and - wherever such third-party notices normally appear. The contents - of the NOTICE file are for informational purposes only and - do not modify the License. You may add Your own attribution - notices within Derivative Works that You distribute, alongside - or as an addendum to the NOTICE text from the Work, provided - that such additional attribution notices cannot be construed - as modifying the License. - - You may add Your own copyright statement to Your modifications and - may provide additional or different license terms and conditions - for use, reproduction, or distribution of Your modifications, or - for any such Derivative Works as a whole, provided Your use, - reproduction, and distribution of the Work otherwise complies with - the conditions stated in this License. - - 5. Submission of Contributions. Unless You explicitly state otherwise, - any Contribution intentionally submitted for inclusion in the Work - by You to the Licensor shall be under the terms and conditions of - this License, without any additional terms or conditions. - Notwithstanding the above, nothing herein shall supersede or modify - the terms of any separate license agreement you may have executed - with Licensor regarding such Contributions. - - 6. Trademarks. This License does not grant permission to use the trade - names, trademarks, service marks, or product names of the Licensor, - except as required for reasonable and customary use in describing the - origin of the Work and reproducing the content of the NOTICE file. - - 7. Disclaimer of Warranty. Unless required by applicable law or - agreed to in writing, Licensor provides the Work (and each - Contributor provides its Contributions) on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or - implied, including, without limitation, any warranties or conditions - of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A - PARTICULAR PURPOSE. You are solely responsible for determining the - appropriateness of using or redistributing the Work and assume any - risks associated with Your exercise of permissions under this License. - - 8. Limitation of Liability. In no event and under no legal theory, - whether in tort (including negligence), contract, or otherwise, - unless required by applicable law (such as deliberate and grossly - negligent acts) or agreed to in writing, shall any Contributor be - liable to You for damages, including any direct, indirect, special, - incidental, or consequential damages of any character arising as a - result of this License or out of the use or inability to use the - Work (including but not limited to damages for loss of goodwill, - work stoppage, computer failure or malfunction, or any and all - other commercial damages or losses), even if such Contributor - has been advised of the possibility of such damages. - - 9. Accepting Warranty or Additional Liability. While redistributing - the Work or Derivative Works thereof, You may choose to offer, - and charge a fee for, acceptance of support, warranty, indemnity, - or other liability obligations and/or rights consistent with this - License. However, in accepting such obligations, You may act only - on Your own behalf and on Your sole responsibility, not on behalf - of any other Contributor, and only if You agree to indemnify, - defend, and hold each Contributor harmless for any liability - incurred by, or claims asserted against, such Contributor by reason - of your accepting any such warranty or additional liability. - - END OF TERMS AND CONDITIONS - - APPENDIX: How to apply the Apache License to your work. - - To apply the Apache License to your work, attach the following - boilerplate notice, with the fields enclosed by brackets "[]" - replaced with your own identifying information. (Don't include - the brackets!) The text should be enclosed in the appropriate - comment syntax for the file format. We also recommend that a - file or class name and description of purpose be included on the - same "printed page" as the copyright notice for easier - identification within third-party archives. - - Copyright [yyyy] [name of copyright owner] - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. diff --git a/owl-bot-staging/google-cloud-security-private_ca-v1/README.md b/owl-bot-staging/google-cloud-security-private_ca-v1/README.md deleted file mode 100644 index 778488e6a233..000000000000 --- a/owl-bot-staging/google-cloud-security-private_ca-v1/README.md +++ /dev/null @@ -1,154 +0,0 @@ -# Ruby Client for the Certificate Authority Service V1 API - -The Certificate Authority Service API is a highly-available, scalable service that enables you to simplify and automate the management of private certificate authorities (CAs) while staying in control of your private keys. - -Certificate Authority Service is a highly available, scalable Google Cloud service that enables you to simplify, automate, and customize the deployment, management, and security of private certificate authorities (CA). - -https://github.com/googleapis/google-cloud-ruby - -This gem is a _versioned_ client. It provides basic client classes for a -specific version of the Certificate Authority Service V1 API. Most users should consider using -the main client gem, -[google-cloud-security-private_ca](https://rubygems.org/gems/google-cloud-security-private_ca). -See the section below titled *Which client should I use?* for more information. - -## Installation - -``` -$ gem install google-cloud-security-private_ca-v1 -``` - -## Before You Begin - -In order to use this library, you first need to go through the following steps: - -1. [Select or create a Cloud Platform project.](https://console.cloud.google.com/project) -1. [Enable billing for your project.](https://cloud.google.com/billing/docs/how-to/modify-project#enable_billing_for_a_project) -1. [Enable the API.](https://console.cloud.google.com/apis/library/privateca.googleapis.com) -1. [Set up authentication.](AUTHENTICATION.md) - -## Quick Start - -```ruby -require "google/cloud/security/private_ca/v1" - -client = ::Google::Cloud::Security::PrivateCA::V1::CertificateAuthorityService::Client.new -request = ::Google::Cloud::Security::PrivateCA::V1::CreateCertificateRequest.new # (request fields as keyword arguments...) -response = client.create_certificate request -``` - -View the [Client Library Documentation](https://cloud.google.com/ruby/docs/reference/google-cloud-security-private_ca-v1/latest) -for class and method documentation. - -See also the [Product Documentation](https://cloud.google.com/certificate-authority-service/) -for general usage information. - -## Debug Logging - -This library comes with opt-in Debug Logging that can help you troubleshoot -your application's integration with the API. When logging is activated, key -events such as requests and responses, along with data payloads and metadata -such as headers and client configuration, are logged to the standard error -stream. - -**WARNING:** Client Library Debug Logging includes your data payloads in -plaintext, which could include sensitive data such as PII for yourself or your -customers, private keys, or other security data that could be compromising if -leaked. Always practice good data hygiene with your application logs, and follow -the principle of least access. Google also recommends that Client Library Debug -Logging be enabled only temporarily during active debugging, and not used -permanently in production. - -To enable logging, set the environment variable `GOOGLE_SDK_RUBY_LOGGING_GEMS` -to the value `all`. Alternatively, you can set the value to a comma-delimited -list of client library gem names. This will select the default logging behavior, -which writes logs to the standard error stream. On a local workstation, this may -result in logs appearing on the console. When running on a Google Cloud hosting -service such as [Google Cloud Run](https://cloud.google.com/run), this generally -results in logs appearing alongside your application logs in the -[Google Cloud Logging](https://cloud.google.com/logging/) service. - -You can customize logging by modifying the `logger` configuration when -constructing a client object. For example: - -```ruby -require "google/cloud/security/private_ca/v1" -require "logger" - -client = ::Google::Cloud::Security::PrivateCA::V1::CertificateAuthorityService::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-security-private_ca`, -and lower-level _versioned_ client libraries with names such as -`google-cloud-security-private_ca-v1`. -_In most cases, you should install the main client._ - -### What's the difference between the main client and a versioned client? - -A _versioned client_ provides a basic set of data types and client classes for -a _single version_ of a specific service. (That is, for a service with multiple -versions, there might be a separate versioned client for each service version.) -Most versioned clients are written and maintained by a code generator. - -The _main client_ is designed to provide you with the _recommended_ client -interfaces for the service. There will be only one main client for any given -service, even a service with multiple versions. The main client includes -factory methods for constructing the client objects we recommend for most -users. In some cases, those will be classes provided by an underlying versioned -client; in other cases, they will be handwritten higher-level client objects -with additional capabilities, convenience methods, or best practices built in. -Generally, the main client will default to a recommended service version, -although in some cases you can override this if you need to talk to a specific -service version. - -### Why would I want to use the main client? - -We recommend that most users install the main client gem for a service. You can -identify this gem as the one _without_ a version in its name, e.g. -`google-cloud-security-private_ca`. -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-security-private_ca-v1`. - -### What about the google-apis- clients? - -Client library gems with names that begin with `google-apis-` are based on an -older code generation technology. They talk to a REST/JSON backend (whereas -most modern clients talk to a [gRPC](https://grpc.io/) backend) and they may -not offer the same performance, features, and ease of use provided by more -modern clients. - -The `google-apis-` clients have wide coverage across Google services, so you -might need to use one if there is no modern client available for the service. -However, if a modern client is available, we generally recommend it over the -older `google-apis-` clients. diff --git a/owl-bot-staging/google-cloud-security-private_ca-v1/Rakefile b/owl-bot-staging/google-cloud-security-private_ca-v1/Rakefile deleted file mode 100644 index bb7b3d9c8032..000000000000 --- a/owl-bot-staging/google-cloud-security-private_ca-v1/Rakefile +++ /dev/null @@ -1,169 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -require "bundler/setup" -require "bundler/gem_tasks" - -require "rubocop/rake_task" -RuboCop::RakeTask.new - -require "rake/testtask" -desc "Run tests." -Rake::TestTask.new do |t| - t.libs << "test" - t.test_files = FileList["test/**/*_test.rb"] - t.warning = false -end - -desc "Runs the smoke tests." -Rake::TestTask.new :smoke_test do |t| - t.test_files = FileList["acceptance/**/*smoke_test.rb"] - t.warning = false -end - -# Acceptance tests -desc "Run the google-cloud-security-private_ca-v1 acceptance tests." -task :acceptance, :project, :keyfile do |t, args| - project = args[:project] - project ||= - ENV["PRIVATE_CA_TEST_PROJECT"] || - ENV["GCLOUD_TEST_PROJECT"] - keyfile = args[:keyfile] - keyfile ||= - ENV["PRIVATE_CA_TEST_KEYFILE"] || - ENV["GCLOUD_TEST_KEYFILE"] - if keyfile - keyfile = File.read keyfile - else - keyfile ||= - ENV["PRIVATE_CA_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 PRIVATE_CA_TEST_PROJECT=test123 PRIVATE_CA_TEST_KEYFILE=/path/to/keyfile.json rake acceptance" - end - require "google/cloud/security/private_ca/v1/certificate_authority_service/credentials" - ::Google::Cloud::Security::PrivateCA::V1::CertificateAuthorityService::Credentials.env_vars.each do |path| - ENV[path] = nil - end - ENV["PRIVATE_CA_PROJECT"] = project - ENV["PRIVATE_CA_TEST_PROJECT"] = project - ENV["PRIVATE_CA_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-security-private_ca-v1 gem has no acceptance tests." - end - end - - desc "Run acceptance cleanup." - task :cleanup do - end -end - -task :samples do - Rake::Task["samples:latest"].invoke -end - -namespace :samples do - task :latest do - if File.directory? "samples" - Dir.chdir "samples" do - Bundler.with_clean_env do - ENV["GOOGLE_CLOUD_SAMPLES_TEST"] = "not_master" - sh "bundle update" - sh "bundle exec rake test" - end - end - else - puts "The google-cloud-security-private_ca-v1 gem has no samples to test." - end - end - - task :master do - if File.directory? "samples" - Dir.chdir "samples" do - Bundler.with_clean_env do - ENV["GOOGLE_CLOUD_SAMPLES_TEST"] = "master" - sh "bundle update" - sh "bundle exec rake test" - end - end - else - puts "The google-cloud-security-private_ca-v1 gem has no samples to test." - end - end -end - -require "yard" -require "yard/rake/yardoc_task" -YARD::Rake::YardocTask.new do |y| - y.options << "--fail-on-warning" -end - -desc "Run yard-doctest example tests." -task :doctest do - puts "The google-cloud-security-private_ca-v1 gem does not have doctest tests." -end - -desc "Run the CI build" -task :ci do - header "BUILDING google-cloud-security-private_ca-v1" - header "google-cloud-security-private_ca-v1 rubocop", "*" - Rake::Task[:rubocop].invoke - header "google-cloud-security-private_ca-v1 yard", "*" - Rake::Task[:yard].invoke - header "google-cloud-security-private_ca-v1 test", "*" - Rake::Task[:test].invoke -end - -namespace :ci do - desc "Run the CI build, with smoke tests." - task :smoke_test do - Rake::Task[:ci].invoke - header "google-cloud-security-private_ca-v1 smoke_test", "*" - Rake::Task[:smoke_test].invoke - end - desc "Run the CI build, with acceptance tests." - task :acceptance do - Rake::Task[:ci].invoke - header "google-cloud-security-private_ca-v1 acceptance", "*" - Rake::Task[:acceptance].invoke - end - task :a do - # This is a handy shortcut to save typing - Rake::Task["ci:acceptance"].invoke - end -end - -task default: :test - -def header str, token = "#" - line_length = str.length + 8 - puts "" - puts token * line_length - puts "#{token * 3} #{str} #{token * 3}" - puts token * line_length - puts "" -end diff --git a/owl-bot-staging/google-cloud-security-private_ca-v1/gapic_metadata.json b/owl-bot-staging/google-cloud-security-private_ca-v1/gapic_metadata.json deleted file mode 100644 index a3ae1a7a8d29..000000000000 --- a/owl-bot-staging/google-cloud-security-private_ca-v1/gapic_metadata.json +++ /dev/null @@ -1,163 +0,0 @@ -{ - "schema": "1.0", - "comment": "This file maps proto services/RPCs to the corresponding library clients/methods", - "language": "ruby", - "protoPackage": "google.cloud.security.privateca.v1", - "libraryPackage": "::Google::Cloud::Security::PrivateCA::V1", - "services": { - "CertificateAuthorityService": { - "clients": { - "grpc": { - "libraryClient": "::Google::Cloud::Security::PrivateCA::V1::CertificateAuthorityService::Client", - "rpcs": { - "CreateCertificate": { - "methods": [ - "create_certificate" - ] - }, - "GetCertificate": { - "methods": [ - "get_certificate" - ] - }, - "ListCertificates": { - "methods": [ - "list_certificates" - ] - }, - "RevokeCertificate": { - "methods": [ - "revoke_certificate" - ] - }, - "UpdateCertificate": { - "methods": [ - "update_certificate" - ] - }, - "ActivateCertificateAuthority": { - "methods": [ - "activate_certificate_authority" - ] - }, - "CreateCertificateAuthority": { - "methods": [ - "create_certificate_authority" - ] - }, - "DisableCertificateAuthority": { - "methods": [ - "disable_certificate_authority" - ] - }, - "EnableCertificateAuthority": { - "methods": [ - "enable_certificate_authority" - ] - }, - "FetchCertificateAuthorityCsr": { - "methods": [ - "fetch_certificate_authority_csr" - ] - }, - "GetCertificateAuthority": { - "methods": [ - "get_certificate_authority" - ] - }, - "ListCertificateAuthorities": { - "methods": [ - "list_certificate_authorities" - ] - }, - "UndeleteCertificateAuthority": { - "methods": [ - "undelete_certificate_authority" - ] - }, - "DeleteCertificateAuthority": { - "methods": [ - "delete_certificate_authority" - ] - }, - "UpdateCertificateAuthority": { - "methods": [ - "update_certificate_authority" - ] - }, - "CreateCaPool": { - "methods": [ - "create_ca_pool" - ] - }, - "UpdateCaPool": { - "methods": [ - "update_ca_pool" - ] - }, - "GetCaPool": { - "methods": [ - "get_ca_pool" - ] - }, - "ListCaPools": { - "methods": [ - "list_ca_pools" - ] - }, - "DeleteCaPool": { - "methods": [ - "delete_ca_pool" - ] - }, - "FetchCaCerts": { - "methods": [ - "fetch_ca_certs" - ] - }, - "GetCertificateRevocationList": { - "methods": [ - "get_certificate_revocation_list" - ] - }, - "ListCertificateRevocationLists": { - "methods": [ - "list_certificate_revocation_lists" - ] - }, - "UpdateCertificateRevocationList": { - "methods": [ - "update_certificate_revocation_list" - ] - }, - "CreateCertificateTemplate": { - "methods": [ - "create_certificate_template" - ] - }, - "DeleteCertificateTemplate": { - "methods": [ - "delete_certificate_template" - ] - }, - "GetCertificateTemplate": { - "methods": [ - "get_certificate_template" - ] - }, - "ListCertificateTemplates": { - "methods": [ - "list_certificate_templates" - ] - }, - "UpdateCertificateTemplate": { - "methods": [ - "update_certificate_template" - ] - } - } - } - } - } - } -} diff --git a/owl-bot-staging/google-cloud-security-private_ca-v1/google-cloud-security-private_ca-v1.gemspec b/owl-bot-staging/google-cloud-security-private_ca-v1/google-cloud-security-private_ca-v1.gemspec deleted file mode 100644 index a513bf2bd80e..000000000000 --- a/owl-bot-staging/google-cloud-security-private_ca-v1/google-cloud-security-private_ca-v1.gemspec +++ /dev/null @@ -1,30 +0,0 @@ -# -*- ruby -*- -# encoding: utf-8 - -require File.expand_path("lib/google/cloud/security/private_ca/v1/version", __dir__) - -Gem::Specification.new do |gem| - gem.name = "google-cloud-security-private_ca-v1" - gem.version = Google::Cloud::Security::PrivateCA::V1::VERSION - - gem.authors = ["Google LLC"] - gem.email = "googleapis-packages@google.com" - gem.description = "Certificate Authority Service is a highly available, scalable Google Cloud service that enables you to simplify, automate, and customize the deployment, management, and security of private certificate authorities (CA). Note that google-cloud-security-private_ca-v1 is a version-specific client library. For most uses, we recommend installing the main client library google-cloud-security-private_ca instead. See the readme for more details." - gem.summary = "The Certificate Authority Service API is a highly-available, scalable service that enables you to simplify and automate the management of private certificate authorities (CAs) while staying in control of your private keys." - 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" - gem.add_dependency "google-iam-v1", "~> 1.3" -end diff --git a/owl-bot-staging/google-cloud-security-private_ca-v1/lib/google-cloud-security-private_ca-v1.rb b/owl-bot-staging/google-cloud-security-private_ca-v1/lib/google-cloud-security-private_ca-v1.rb deleted file mode 100644 index ec80d7546971..000000000000 --- a/owl-bot-staging/google-cloud-security-private_ca-v1/lib/google-cloud-security-private_ca-v1.rb +++ /dev/null @@ -1,21 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -# This gem does not autoload during Bundler.require. To load this gem, -# issue explicit require statements for the packages desired, e.g.: -# require "google/cloud/security/private_ca/v1" diff --git a/owl-bot-staging/google-cloud-security-private_ca-v1/lib/google/cloud/security/private_ca/v1.rb b/owl-bot-staging/google-cloud-security-private_ca-v1/lib/google/cloud/security/private_ca/v1.rb deleted file mode 100644 index 2dcf3038bbe3..000000000000 --- a/owl-bot-staging/google-cloud-security-private_ca-v1/lib/google/cloud/security/private_ca/v1.rb +++ /dev/null @@ -1,47 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -require "google/cloud/security/private_ca/v1/certificate_authority_service" -require "google/cloud/security/private_ca/v1/version" - -module Google - module Cloud - module Security - module PrivateCA - ## - # API client module. - # - # @example Load this package, including all its services, and instantiate a gRPC client - # - # require "google/cloud/security/private_ca/v1" - # client = ::Google::Cloud::Security::PrivateCA::V1::CertificateAuthorityService::Client.new - # - # @example Load this package, including all its services, and instantiate a REST client - # - # require "google/cloud/security/private_ca/v1" - # client = ::Google::Cloud::Security::PrivateCA::V1::CertificateAuthorityService::Rest::Client.new - # - module V1 - end - end - end - end -end - -helper_path = ::File.join __dir__, "v1", "_helpers.rb" -require "google/cloud/security/private_ca/v1/_helpers" if ::File.file? helper_path diff --git a/owl-bot-staging/google-cloud-security-private_ca-v1/lib/google/cloud/security/private_ca/v1/bindings_override.rb b/owl-bot-staging/google-cloud-security-private_ca-v1/lib/google/cloud/security/private_ca/v1/bindings_override.rb deleted file mode 100644 index f9fc3eab4e89..000000000000 --- a/owl-bot-staging/google-cloud-security-private_ca-v1/lib/google/cloud/security/private_ca/v1/bindings_override.rb +++ /dev/null @@ -1,158 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -require "gapic/rest" - -module Google - module Cloud - module Security - module PrivateCA - ## - # @example Loading just the REST part of this package, including all its services, and instantiating a REST client - # - # require "google/cloud/security/private_ca/v1/rest" - # client = ::Google::Cloud::Security::PrivateCA::V1::CertificateAuthorityService::Rest::Client.new - # - module V1 - ## - # @private - # Initialize the mixin bindings configuration - # - def self.configure - @configure ||= begin - namespace = ["Google", "Cloud", "Security", "PrivateCA"] - parent_config = while namespace.any? - parent_name = namespace.join "::" - parent_const = const_get parent_name - break parent_const.configure if parent_const.respond_to? :configure - namespace.pop - end - - default_config = ::Gapic::Rest::HttpBindingOverrideConfiguration.new parent_config - default_config.bindings_override["google.cloud.location.Locations.GetLocation"] = [ - Gapic::Rest::GrpcTranscoder::HttpBinding.create_with_validation( - uri_method: :get, - uri_template: "/v1/{name}", - matches: [ - ["name", %r{^projects/[^/]+/locations/[^/]+/?$}, false] - ], - body: nil - ) - ] - default_config.bindings_override["google.cloud.location.Locations.ListLocations"] = [ - - Gapic::Rest::GrpcTranscoder::HttpBinding.create_with_validation( - uri_method: :get, - uri_template: "/v1/{name}/locations", - matches: [ - ["name", %r{^projects/[^/]+/?$}, false] - ], - body: nil - ) - ] - default_config.bindings_override["google.iam.v1.IAMPolicy.GetIamPolicy"] = [ - - Gapic::Rest::GrpcTranscoder::HttpBinding.create_with_validation( - uri_method: :get, - uri_template: "/v1/{resource}:getIamPolicy", - matches: [ - ["resource", %r{^projects/[^/]+/locations/[^/]+/caPools/[^/]+/?$}, false] - ], - body: nil - ), - Gapic::Rest::GrpcTranscoder::HttpBinding.create_with_validation( - uri_method: :get, - uri_template: "/v1/{resource}:getIamPolicy", - matches: [ - ["resource", %r{^projects/[^/]+/locations/[^/]+/certificateTemplates/[^/]+/?$}, false] - ], - body: nil - ), - Gapic::Rest::GrpcTranscoder::HttpBinding.create_with_validation( - uri_method: :get, - uri_template: "/v1/{resource}:getIamPolicy", - matches: [ - ["resource", %r{^projects/[^/]+/locations/[^/]+/caPools/[^/]+/certificateAuthorities/[^/]+/certificateRevocationLists/[^/]+/?$}, false] - ], - body: nil - ) - ] - default_config.bindings_override["google.iam.v1.IAMPolicy.SetIamPolicy"] = [ - - Gapic::Rest::GrpcTranscoder::HttpBinding.create_with_validation( - uri_method: :post, - uri_template: "/v1/{resource}:setIamPolicy", - matches: [ - ["resource", %r{^projects/[^/]+/locations/[^/]+/caPools/[^/]+/?$}, false] - ], - body: "*" - ), - Gapic::Rest::GrpcTranscoder::HttpBinding.create_with_validation( - uri_method: :post, - uri_template: "/v1/{resource}:setIamPolicy", - matches: [ - ["resource", %r{^projects/[^/]+/locations/[^/]+/certificateTemplates/[^/]+/?$}, false] - ], - body: "*" - ), - Gapic::Rest::GrpcTranscoder::HttpBinding.create_with_validation( - uri_method: :post, - uri_template: "/v1/{resource}:setIamPolicy", - matches: [ - ["resource", %r{^projects/[^/]+/locations/[^/]+/caPools/[^/]+/certificateAuthorities/[^/]+/certificateRevocationLists/[^/]+/?$}, false] - ], - body: "*" - ) - ] - default_config.bindings_override["google.iam.v1.IAMPolicy.TestIamPermissions"] = [ - - Gapic::Rest::GrpcTranscoder::HttpBinding.create_with_validation( - uri_method: :post, - uri_template: "/v1/{resource}:testIamPermissions", - matches: [ - ["resource", %r{^projects/[^/]+/locations/[^/]+/caPools/[^/]+/?$}, false] - ], - body: "*" - ), - Gapic::Rest::GrpcTranscoder::HttpBinding.create_with_validation( - uri_method: :post, - uri_template: "/v1/{resource}:testIamPermissions", - matches: [ - ["resource", %r{^projects/[^/]+/locations/[^/]+/certificateTemplates/[^/]+/?$}, false] - ], - body: "*" - ), - Gapic::Rest::GrpcTranscoder::HttpBinding.create_with_validation( - uri_method: :post, - uri_template: "/v1/{resource}:testIamPermissions", - matches: [ - ["resource", %r{^projects/[^/]+/locations/[^/]+/caPools/[^/]+/certificateAuthorities/[^/]+/certificateRevocationLists/[^/]+/?$}, false] - ], - body: "*" - ) - ] - default_config - end - yield @configure if block_given? - @configure - end - end - end - end - end -end diff --git a/owl-bot-staging/google-cloud-security-private_ca-v1/lib/google/cloud/security/private_ca/v1/certificate_authority_service.rb b/owl-bot-staging/google-cloud-security-private_ca-v1/lib/google/cloud/security/private_ca/v1/certificate_authority_service.rb deleted file mode 100644 index 780346978920..000000000000 --- a/owl-bot-staging/google-cloud-security-private_ca-v1/lib/google/cloud/security/private_ca/v1/certificate_authority_service.rb +++ /dev/null @@ -1,60 +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/security/private_ca/v1/version" - -require "google/cloud/security/private_ca/v1/certificate_authority_service/credentials" -require "google/cloud/security/private_ca/v1/certificate_authority_service/paths" -require "google/cloud/security/private_ca/v1/certificate_authority_service/operations" -require "google/cloud/security/private_ca/v1/certificate_authority_service/client" -require "google/cloud/security/private_ca/v1/certificate_authority_service/rest" - -module Google - module Cloud - module Security - module PrivateCA - module V1 - ## - # [Certificate Authority - # Service][google.cloud.security.privateca.v1.CertificateAuthorityService] - # manages private certificate authorities and issued certificates. - # - # @example Load this service and instantiate a gRPC client - # - # require "google/cloud/security/private_ca/v1/certificate_authority_service" - # client = ::Google::Cloud::Security::PrivateCA::V1::CertificateAuthorityService::Client.new - # - # @example Load this service and instantiate a REST client - # - # require "google/cloud/security/private_ca/v1/certificate_authority_service/rest" - # client = ::Google::Cloud::Security::PrivateCA::V1::CertificateAuthorityService::Rest::Client.new - # - module CertificateAuthorityService - end - end - end - end - end -end - -helper_path = ::File.join __dir__, "certificate_authority_service", "helpers.rb" -require "google/cloud/security/private_ca/v1/certificate_authority_service/helpers" if ::File.file? helper_path diff --git a/owl-bot-staging/google-cloud-security-private_ca-v1/lib/google/cloud/security/private_ca/v1/certificate_authority_service/client.rb b/owl-bot-staging/google-cloud-security-private_ca-v1/lib/google/cloud/security/private_ca/v1/certificate_authority_service/client.rb deleted file mode 100644 index bdfabc4f78a3..000000000000 --- a/owl-bot-staging/google-cloud-security-private_ca-v1/lib/google/cloud/security/private_ca/v1/certificate_authority_service/client.rb +++ /dev/null @@ -1,3804 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -require "google/cloud/errors" -require "google/cloud/security/privateca/v1/service_pb" -require "google/cloud/location" -require "google/iam/v1" - -module Google - module Cloud - module Security - module PrivateCA - module V1 - module CertificateAuthorityService - ## - # Client for the CertificateAuthorityService service. - # - # [Certificate Authority - # Service][google.cloud.security.privateca.v1.CertificateAuthorityService] - # manages private certificate authorities and issued certificates. - # - class Client - # @private - API_VERSION = "" - - # @private - DEFAULT_ENDPOINT_TEMPLATE = "privateca.$UNIVERSE_DOMAIN$" - - include Paths - - # @private - attr_reader :certificate_authority_service_stub - - ## - # Configure the CertificateAuthorityService Client class. - # - # See {::Google::Cloud::Security::PrivateCA::V1::CertificateAuthorityService::Client::Configuration} - # for a description of the configuration fields. - # - # @example - # - # # Modify the configuration for all CertificateAuthorityService clients - # ::Google::Cloud::Security::PrivateCA::V1::CertificateAuthorityService::Client.configure do |config| - # config.timeout = 10.0 - # end - # - # @yield [config] Configure the Client client. - # @yieldparam config [Client::Configuration] - # - # @return [Client::Configuration] - # - def self.configure - @configure ||= begin - namespace = ["Google", "Cloud", "Security", "PrivateCA", "V1"] - parent_config = while namespace.any? - parent_name = namespace.join "::" - parent_const = const_get parent_name - break parent_const.configure if parent_const.respond_to? :configure - namespace.pop - end - default_config = Client::Configuration.new parent_config - - default_config.timeout = 60.0 - default_config.retry_policy = { - initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [2, 14, 4] - } - - default_config - end - yield @configure if block_given? - @configure - end - - ## - # Configure the CertificateAuthorityService Client instance. - # - # The configuration is set to the derived mode, meaning that values can be changed, - # but structural changes (adding new fields, etc.) are not allowed. Structural changes - # should be made on {Client.configure}. - # - # See {::Google::Cloud::Security::PrivateCA::V1::CertificateAuthorityService::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 - @certificate_authority_service_stub.universe_domain - end - - ## - # Create a new CertificateAuthorityService client object. - # - # @example - # - # # Create a client using the default configuration - # client = ::Google::Cloud::Security::PrivateCA::V1::CertificateAuthorityService::Client.new - # - # # Create a client using a custom configuration - # client = ::Google::Cloud::Security::PrivateCA::V1::CertificateAuthorityService::Client.new do |config| - # config.timeout = 10.0 - # end - # - # @yield [config] Configure the CertificateAuthorityService client. - # @yieldparam config [Client::Configuration] - # - def initialize - # These require statements are intentionally placed here to initialize - # the gRPC module only when it's required. - # See https://github.com/googleapis/toolkit/issues/446 - require "gapic/grpc" - require "google/cloud/security/privateca/v1/service_services_pb" - - # Create the configuration object - @config = Configuration.new Client.configure - - # Yield the configuration if needed - yield @config if block_given? - - # Create credentials - credentials = @config.credentials - # Use self-signed JWT if the endpoint is unchanged from default, - # but only if the default endpoint does not have a region prefix. - enable_self_signed_jwt = @config.endpoint.nil? || - (@config.endpoint == Configuration::DEFAULT_ENDPOINT && - !@config.endpoint.split(".").first.include?("-")) - credentials ||= Credentials.default scope: @config.scope, - enable_self_signed_jwt: enable_self_signed_jwt - if credentials.is_a?(::String) || credentials.is_a?(::Hash) - credentials = Credentials.new credentials, scope: @config.scope - end - @quota_project_id = @config.quota_project - @quota_project_id ||= credentials.quota_project_id if credentials.respond_to? :quota_project_id - - @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 - - @certificate_authority_service_stub = ::Gapic::ServiceStub.new( - ::Google::Cloud::Security::PrivateCA::V1::CertificateAuthorityService::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 - ) - - @certificate_authority_service_stub.stub_logger&.info do |entry| - entry.set_system_name - entry.set_service - entry.message = "Created client for #{entry.service}" - entry.set_credentials_fields credentials - entry.set "customEndpoint", @config.endpoint if @config.endpoint - entry.set "defaultTimeout", @config.timeout if @config.timeout - entry.set "quotaProject", @quota_project_id if @quota_project_id - end - - @location_client = Google::Cloud::Location::Locations::Client.new do |config| - config.credentials = credentials - config.quota_project = @quota_project_id - config.endpoint = @certificate_authority_service_stub.endpoint - config.universe_domain = @certificate_authority_service_stub.universe_domain - config.logger = @certificate_authority_service_stub.logger if config.respond_to? :logger= - end - - @iam_policy_client = Google::Iam::V1::IAMPolicy::Client.new do |config| - config.credentials = credentials - config.quota_project = @quota_project_id - config.endpoint = @certificate_authority_service_stub.endpoint - config.universe_domain = @certificate_authority_service_stub.universe_domain - config.logger = @certificate_authority_service_stub.logger if config.respond_to? :logger= - end - end - - ## - # Get the associated client for long-running operations. - # - # @return [::Google::Cloud::Security::PrivateCA::V1::CertificateAuthorityService::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 - - ## - # Get the associated client for mix-in of the IAMPolicy. - # - # @return [Google::Iam::V1::IAMPolicy::Client] - # - attr_reader :iam_policy_client - - ## - # The logger used for request/response debug logging. - # - # @return [Logger] - # - def logger - @certificate_authority_service_stub.logger - end - - # Service calls - - ## - # Create a new {::Google::Cloud::Security::PrivateCA::V1::Certificate Certificate} - # in a given Project, Location from a particular - # {::Google::Cloud::Security::PrivateCA::V1::CaPool CaPool}. - # - # @overload create_certificate(request, options = nil) - # Pass arguments to `create_certificate` via a request object, either of type - # {::Google::Cloud::Security::PrivateCA::V1::CreateCertificateRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Security::PrivateCA::V1::CreateCertificateRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_certificate(parent: nil, certificate_id: nil, certificate: nil, request_id: nil, validate_only: nil, issuing_certificate_authority_id: nil) - # Pass arguments to `create_certificate` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param parent [::String] - # Required. The resource name of the - # {::Google::Cloud::Security::PrivateCA::V1::CaPool CaPool} associated with the - # {::Google::Cloud::Security::PrivateCA::V1::Certificate Certificate}, in the - # format `projects/*/locations/*/caPools/*`. - # @param certificate_id [::String] - # Optional. It must be unique within a location and match the regular - # expression `[a-zA-Z0-9_-]{1,63}`. This field is required when using a - # {::Google::Cloud::Security::PrivateCA::V1::CertificateAuthority CertificateAuthority} - # in the Enterprise - # {::Google::Cloud::Security::PrivateCA::V1::CertificateAuthority#tier CertificateAuthority.tier}, - # but is optional and its value is ignored otherwise. - # @param certificate [::Google::Cloud::Security::PrivateCA::V1::Certificate, ::Hash] - # Required. A {::Google::Cloud::Security::PrivateCA::V1::Certificate Certificate} - # with initial field values. - # @param request_id [::String] - # Optional. An ID to identify requests. Specify a unique request ID so that - # if you must retry your request, the server will know to ignore the request - # if it has already been completed. The server will guarantee that for at - # least 60 minutes since the first request. - # - # For example, consider a situation where you make an initial request and the - # request times out. If you make the request again with the same request ID, - # the server can check if original operation with the same request ID was - # received, and if so, will ignore the second request. This prevents clients - # from accidentally creating duplicate commitments. - # - # The request ID must be a valid UUID with the exception that zero UUID is - # not supported (00000000-0000-0000-0000-000000000000). - # @param validate_only [::Boolean] - # Optional. If this is true, no - # {::Google::Cloud::Security::PrivateCA::V1::Certificate Certificate} resource will - # be persisted regardless of the - # {::Google::Cloud::Security::PrivateCA::V1::CaPool CaPool}'s - # {::Google::Cloud::Security::PrivateCA::V1::CaPool#tier tier}, and the returned - # {::Google::Cloud::Security::PrivateCA::V1::Certificate Certificate} will not - # contain the - # {::Google::Cloud::Security::PrivateCA::V1::Certificate#pem_certificate pem_certificate} - # field. - # @param issuing_certificate_authority_id [::String] - # Optional. The resource ID of the - # {::Google::Cloud::Security::PrivateCA::V1::CertificateAuthority CertificateAuthority} - # that should issue the certificate. This optional field will ignore the - # load-balancing scheme of the Pool and directly issue the certificate from - # the CA with the specified ID, contained in the same - # {::Google::Cloud::Security::PrivateCA::V1::CaPool CaPool} referenced by `parent`. - # Per-CA quota rules apply. If left empty, a - # {::Google::Cloud::Security::PrivateCA::V1::CertificateAuthority CertificateAuthority} - # will be chosen from the {::Google::Cloud::Security::PrivateCA::V1::CaPool CaPool} - # by the service. For example, to issue a - # {::Google::Cloud::Security::PrivateCA::V1::Certificate Certificate} from a - # Certificate Authority with resource name - # "projects/my-project/locations/us-central1/caPools/my-pool/certificateAuthorities/my-ca", - # you can set the - # {::Google::Cloud::Security::PrivateCA::V1::CreateCertificateRequest#parent parent} - # to "projects/my-project/locations/us-central1/caPools/my-pool" and the - # {::Google::Cloud::Security::PrivateCA::V1::CreateCertificateRequest#issuing_certificate_authority_id issuing_certificate_authority_id} - # to "my-ca". - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Google::Cloud::Security::PrivateCA::V1::Certificate] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Google::Cloud::Security::PrivateCA::V1::Certificate] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/cloud/security/private_ca/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Security::PrivateCA::V1::CertificateAuthorityService::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Security::PrivateCA::V1::CreateCertificateRequest.new - # - # # Call the create_certificate method. - # result = client.create_certificate request - # - # # The returned object is of type Google::Cloud::Security::PrivateCA::V1::Certificate. - # p result - # - def create_certificate request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Security::PrivateCA::V1::CreateCertificateRequest - - # Converts hash 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_certificate.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::Security::PrivateCA::V1::VERSION - metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - header_params = {} - if request.parent - header_params["parent"] = request.parent - end - - request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") - metadata[:"x-goog-request-params"] ||= request_params_header - - options.apply_defaults timeout: @config.rpcs.create_certificate.timeout, - metadata: metadata, - retry_policy: @config.rpcs.create_certificate.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @certificate_authority_service_stub.call_rpc :create_certificate, request, options: options do |response, operation| - yield response, operation if block_given? - end - rescue ::GRPC::BadStatus => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Returns a {::Google::Cloud::Security::PrivateCA::V1::Certificate Certificate}. - # - # @overload get_certificate(request, options = nil) - # Pass arguments to `get_certificate` via a request object, either of type - # {::Google::Cloud::Security::PrivateCA::V1::GetCertificateRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Security::PrivateCA::V1::GetCertificateRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_certificate(name: nil) - # Pass arguments to `get_certificate` via keyword arguments. Note that at - # least one keyword argument is 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 {::Google::Cloud::Security::PrivateCA::V1::Certificate#name name} - # of the {::Google::Cloud::Security::PrivateCA::V1::Certificate Certificate} to - # get. - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Google::Cloud::Security::PrivateCA::V1::Certificate] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Google::Cloud::Security::PrivateCA::V1::Certificate] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/cloud/security/private_ca/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Security::PrivateCA::V1::CertificateAuthorityService::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Security::PrivateCA::V1::GetCertificateRequest.new - # - # # Call the get_certificate method. - # result = client.get_certificate request - # - # # The returned object is of type Google::Cloud::Security::PrivateCA::V1::Certificate. - # p result - # - def get_certificate request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Security::PrivateCA::V1::GetCertificateRequest - - # Converts hash 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_certificate.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::Security::PrivateCA::V1::VERSION - metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - header_params = {} - if request.name - header_params["name"] = request.name - end - - request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") - metadata[:"x-goog-request-params"] ||= request_params_header - - options.apply_defaults timeout: @config.rpcs.get_certificate.timeout, - metadata: metadata, - retry_policy: @config.rpcs.get_certificate.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @certificate_authority_service_stub.call_rpc :get_certificate, request, options: options do |response, operation| - yield response, operation if block_given? - end - rescue ::GRPC::BadStatus => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Lists {::Google::Cloud::Security::PrivateCA::V1::Certificate Certificates}. - # - # @overload list_certificates(request, options = nil) - # Pass arguments to `list_certificates` via a request object, either of type - # {::Google::Cloud::Security::PrivateCA::V1::ListCertificatesRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Security::PrivateCA::V1::ListCertificatesRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_certificates(parent: nil, page_size: nil, page_token: nil, filter: nil, order_by: nil) - # Pass arguments to `list_certificates` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param parent [::String] - # Required. The resource name of the location associated with the - # {::Google::Cloud::Security::PrivateCA::V1::Certificate Certificates}, in the - # format `projects/*/locations/*/caPools/*`. - # @param page_size [::Integer] - # Optional. Limit on the number of - # {::Google::Cloud::Security::PrivateCA::V1::Certificate Certificates} to include - # in the response. Further - # {::Google::Cloud::Security::PrivateCA::V1::Certificate Certificates} can - # subsequently be obtained by including the - # {::Google::Cloud::Security::PrivateCA::V1::ListCertificatesResponse#next_page_token ListCertificatesResponse.next_page_token} - # in a subsequent request. If unspecified, the server will pick an - # appropriate default. - # @param page_token [::String] - # Optional. Pagination token, returned earlier via - # {::Google::Cloud::Security::PrivateCA::V1::ListCertificatesResponse#next_page_token ListCertificatesResponse.next_page_token}. - # @param filter [::String] - # Optional. Only include resources that match the filter in the response. For - # details on supported filters and syntax, see [Certificates Filtering - # documentation](https://cloud.google.com/certificate-authority-service/docs/sorting-filtering-certificates#filtering_support). - # @param order_by [::String] - # Optional. Specify how the results should be sorted. For details on - # supported fields and syntax, see [Certificates Sorting - # documentation](https://cloud.google.com/certificate-authority-service/docs/sorting-filtering-certificates#sorting_support). - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Gapic::PagedEnumerable<::Google::Cloud::Security::PrivateCA::V1::Certificate>] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Gapic::PagedEnumerable<::Google::Cloud::Security::PrivateCA::V1::Certificate>] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/cloud/security/private_ca/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Security::PrivateCA::V1::CertificateAuthorityService::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Security::PrivateCA::V1::ListCertificatesRequest.new - # - # # Call the list_certificates method. - # result = client.list_certificates request - # - # # The returned object is of type Gapic::PagedEnumerable. You can iterate - # # over elements, and API calls will be issued to fetch pages as needed. - # result.each do |item| - # # Each element is of type ::Google::Cloud::Security::PrivateCA::V1::Certificate. - # p item - # end - # - def list_certificates request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Security::PrivateCA::V1::ListCertificatesRequest - - # Converts hash 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_certificates.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::Security::PrivateCA::V1::VERSION - metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - header_params = {} - if request.parent - header_params["parent"] = request.parent - end - - request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") - metadata[:"x-goog-request-params"] ||= request_params_header - - options.apply_defaults timeout: @config.rpcs.list_certificates.timeout, - metadata: metadata, - retry_policy: @config.rpcs.list_certificates.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @certificate_authority_service_stub.call_rpc :list_certificates, request, options: options do |response, operation| - response = ::Gapic::PagedEnumerable.new @certificate_authority_service_stub, :list_certificates, 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 - - ## - # Revoke a {::Google::Cloud::Security::PrivateCA::V1::Certificate Certificate}. - # - # @overload revoke_certificate(request, options = nil) - # Pass arguments to `revoke_certificate` via a request object, either of type - # {::Google::Cloud::Security::PrivateCA::V1::RevokeCertificateRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Security::PrivateCA::V1::RevokeCertificateRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. - # - # @overload revoke_certificate(name: nil, reason: nil, request_id: nil) - # Pass arguments to `revoke_certificate` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param name [::String] - # Required. The resource name for this - # {::Google::Cloud::Security::PrivateCA::V1::Certificate Certificate} in the format - # `projects/*/locations/*/caPools/*/certificates/*`. - # @param reason [::Google::Cloud::Security::PrivateCA::V1::RevocationReason] - # Required. The - # {::Google::Cloud::Security::PrivateCA::V1::RevocationReason RevocationReason} for - # revoking this certificate. - # @param request_id [::String] - # Optional. An ID to identify requests. Specify a unique request ID so that - # if you must retry your request, the server will know to ignore the request - # if it has already been completed. The server will guarantee that for at - # least 60 minutes since the first request. - # - # For example, consider a situation where you make an initial request and - # the request times out. If you make the request again with the same request - # ID, the server can check if original operation with the same request ID - # was received, and if so, will ignore the second request. This prevents - # clients from accidentally creating duplicate commitments. - # - # The request ID must be a valid UUID with the exception that zero UUID is - # not supported (00000000-0000-0000-0000-000000000000). - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Google::Cloud::Security::PrivateCA::V1::Certificate] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Google::Cloud::Security::PrivateCA::V1::Certificate] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/cloud/security/private_ca/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Security::PrivateCA::V1::CertificateAuthorityService::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Security::PrivateCA::V1::RevokeCertificateRequest.new - # - # # Call the revoke_certificate method. - # result = client.revoke_certificate request - # - # # The returned object is of type Google::Cloud::Security::PrivateCA::V1::Certificate. - # p result - # - def revoke_certificate request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Security::PrivateCA::V1::RevokeCertificateRequest - - # Converts hash 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.revoke_certificate.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::Security::PrivateCA::V1::VERSION - metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - header_params = {} - if request.name - header_params["name"] = request.name - end - - request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") - metadata[:"x-goog-request-params"] ||= request_params_header - - options.apply_defaults timeout: @config.rpcs.revoke_certificate.timeout, - metadata: metadata, - retry_policy: @config.rpcs.revoke_certificate.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @certificate_authority_service_stub.call_rpc :revoke_certificate, 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 - - ## - # Update a {::Google::Cloud::Security::PrivateCA::V1::Certificate Certificate}. - # Currently, the only field you can update is the - # {::Google::Cloud::Security::PrivateCA::V1::Certificate#labels labels} field. - # - # @overload update_certificate(request, options = nil) - # Pass arguments to `update_certificate` via a request object, either of type - # {::Google::Cloud::Security::PrivateCA::V1::UpdateCertificateRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Security::PrivateCA::V1::UpdateCertificateRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_certificate(certificate: nil, update_mask: nil, request_id: nil) - # Pass arguments to `update_certificate` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param certificate [::Google::Cloud::Security::PrivateCA::V1::Certificate, ::Hash] - # Required. {::Google::Cloud::Security::PrivateCA::V1::Certificate Certificate} - # with updated values. - # @param update_mask [::Google::Protobuf::FieldMask, ::Hash] - # Required. A list of fields to be updated in this request. - # @param request_id [::String] - # Optional. An ID to identify requests. Specify a unique request ID so that - # if you must retry your request, the server will know to ignore the request - # if it has already been completed. The server will guarantee that for at - # least 60 minutes since the first request. - # - # For example, consider a situation where you make an initial request and - # the request times out. If you make the request again with the same request - # ID, the server can check if original operation with the same request ID - # was received, and if so, will ignore the second request. This prevents - # clients from accidentally creating duplicate commitments. - # - # The request ID must be a valid UUID with the exception that zero UUID is - # not supported (00000000-0000-0000-0000-000000000000). - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Google::Cloud::Security::PrivateCA::V1::Certificate] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Google::Cloud::Security::PrivateCA::V1::Certificate] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/cloud/security/private_ca/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Security::PrivateCA::V1::CertificateAuthorityService::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Security::PrivateCA::V1::UpdateCertificateRequest.new - # - # # Call the update_certificate method. - # result = client.update_certificate request - # - # # The returned object is of type Google::Cloud::Security::PrivateCA::V1::Certificate. - # p result - # - def update_certificate request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Security::PrivateCA::V1::UpdateCertificateRequest - - # Converts hash 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_certificate.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::Security::PrivateCA::V1::VERSION - metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - header_params = {} - if request.certificate&.name - header_params["certificate.name"] = request.certificate.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_certificate.timeout, - metadata: metadata, - retry_policy: @config.rpcs.update_certificate.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @certificate_authority_service_stub.call_rpc :update_certificate, 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 - - ## - # Activate a - # {::Google::Cloud::Security::PrivateCA::V1::CertificateAuthority CertificateAuthority} - # that is in state - # {::Google::Cloud::Security::PrivateCA::V1::CertificateAuthority::State::AWAITING_USER_ACTIVATION AWAITING_USER_ACTIVATION} - # and is of type - # {::Google::Cloud::Security::PrivateCA::V1::CertificateAuthority::Type::SUBORDINATE SUBORDINATE}. - # After the parent Certificate Authority signs a certificate signing request - # from - # {::Google::Cloud::Security::PrivateCA::V1::CertificateAuthorityService::Client#fetch_certificate_authority_csr FetchCertificateAuthorityCsr}, - # this method can complete the activation process. - # - # @overload activate_certificate_authority(request, options = nil) - # Pass arguments to `activate_certificate_authority` via a request object, either of type - # {::Google::Cloud::Security::PrivateCA::V1::ActivateCertificateAuthorityRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Security::PrivateCA::V1::ActivateCertificateAuthorityRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. - # - # @overload activate_certificate_authority(name: nil, pem_ca_certificate: nil, subordinate_config: nil, request_id: nil) - # Pass arguments to `activate_certificate_authority` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param name [::String] - # Required. The resource name for this - # {::Google::Cloud::Security::PrivateCA::V1::CertificateAuthority CertificateAuthority} - # in the format `projects/*/locations/*/caPools/*/certificateAuthorities/*`. - # @param pem_ca_certificate [::String] - # Required. The signed CA certificate issued from - # {::Google::Cloud::Security::PrivateCA::V1::FetchCertificateAuthorityCsrResponse#pem_csr FetchCertificateAuthorityCsrResponse.pem_csr}. - # @param subordinate_config [::Google::Cloud::Security::PrivateCA::V1::SubordinateConfig, ::Hash] - # Required. Must include information about the issuer of - # 'pem_ca_certificate', and any further issuers until the self-signed CA. - # @param request_id [::String] - # Optional. An ID to identify requests. Specify a unique request ID so that - # if you must retry your request, the server will know to ignore the request - # if it has already been completed. The server will guarantee that for at - # least 60 minutes since the first request. - # - # For example, consider a situation where you make an initial request and - # the request times out. If you make the request again with the same request - # ID, the server can check if original operation with the same request ID - # was received, and if so, will ignore the second request. This prevents - # clients from accidentally creating duplicate commitments. - # - # The request ID must be a valid UUID with the exception that zero UUID is - # not supported (00000000-0000-0000-0000-000000000000). - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Gapic::Operation] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Gapic::Operation] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/cloud/security/private_ca/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Security::PrivateCA::V1::CertificateAuthorityService::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Security::PrivateCA::V1::ActivateCertificateAuthorityRequest.new - # - # # Call the activate_certificate_authority method. - # result = client.activate_certificate_authority 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 activate_certificate_authority request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Security::PrivateCA::V1::ActivateCertificateAuthorityRequest - - # Converts hash 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.activate_certificate_authority.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::Security::PrivateCA::V1::VERSION - metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - header_params = {} - if request.name - header_params["name"] = request.name - end - - request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") - metadata[:"x-goog-request-params"] ||= request_params_header - - options.apply_defaults timeout: @config.rpcs.activate_certificate_authority.timeout, - metadata: metadata, - retry_policy: @config.rpcs.activate_certificate_authority.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @certificate_authority_service_stub.call_rpc :activate_certificate_authority, 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 - - ## - # Create a new - # {::Google::Cloud::Security::PrivateCA::V1::CertificateAuthority CertificateAuthority} - # in a given Project and Location. - # - # @overload create_certificate_authority(request, options = nil) - # Pass arguments to `create_certificate_authority` via a request object, either of type - # {::Google::Cloud::Security::PrivateCA::V1::CreateCertificateAuthorityRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Security::PrivateCA::V1::CreateCertificateAuthorityRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_certificate_authority(parent: nil, certificate_authority_id: nil, certificate_authority: nil, request_id: nil) - # Pass arguments to `create_certificate_authority` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param parent [::String] - # Required. The resource name of the - # {::Google::Cloud::Security::PrivateCA::V1::CaPool CaPool} associated with the - # {::Google::Cloud::Security::PrivateCA::V1::CertificateAuthority CertificateAuthorities}, - # in the format `projects/*/locations/*/caPools/*`. - # @param certificate_authority_id [::String] - # Required. It must be unique within a location and match the regular - # expression `[a-zA-Z0-9_-]{1,63}` - # @param certificate_authority [::Google::Cloud::Security::PrivateCA::V1::CertificateAuthority, ::Hash] - # Required. A - # {::Google::Cloud::Security::PrivateCA::V1::CertificateAuthority CertificateAuthority} - # with initial field values. - # @param request_id [::String] - # Optional. An ID to identify requests. Specify a unique request ID so that - # if you must retry your request, the server will know to ignore the request - # if it has already been completed. The server will guarantee that for at - # least 60 minutes since the first request. - # - # For example, consider a situation where you make an initial request and - # the request times out. If you make the request again with the same request - # ID, the server can check if original operation with the same request ID - # was received, and if so, will ignore the second request. This prevents - # clients from accidentally creating duplicate commitments. - # - # The request ID must be a valid UUID with the exception that zero UUID is - # not supported (00000000-0000-0000-0000-000000000000). - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Gapic::Operation] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Gapic::Operation] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/cloud/security/private_ca/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Security::PrivateCA::V1::CertificateAuthorityService::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Security::PrivateCA::V1::CreateCertificateAuthorityRequest.new - # - # # Call the create_certificate_authority method. - # result = client.create_certificate_authority 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_certificate_authority request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Security::PrivateCA::V1::CreateCertificateAuthorityRequest - - # Converts hash 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_certificate_authority.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::Security::PrivateCA::V1::VERSION - metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - header_params = {} - if request.parent - header_params["parent"] = request.parent - end - - request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") - metadata[:"x-goog-request-params"] ||= request_params_header - - options.apply_defaults timeout: @config.rpcs.create_certificate_authority.timeout, - metadata: metadata, - retry_policy: @config.rpcs.create_certificate_authority.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @certificate_authority_service_stub.call_rpc :create_certificate_authority, 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 - - ## - # Disable a - # {::Google::Cloud::Security::PrivateCA::V1::CertificateAuthority CertificateAuthority}. - # - # @overload disable_certificate_authority(request, options = nil) - # Pass arguments to `disable_certificate_authority` via a request object, either of type - # {::Google::Cloud::Security::PrivateCA::V1::DisableCertificateAuthorityRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Security::PrivateCA::V1::DisableCertificateAuthorityRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. - # - # @overload disable_certificate_authority(name: nil, request_id: nil, ignore_dependent_resources: nil) - # Pass arguments to `disable_certificate_authority` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param name [::String] - # Required. The resource name for this - # {::Google::Cloud::Security::PrivateCA::V1::CertificateAuthority CertificateAuthority} - # in the format `projects/*/locations/*/caPools/*/certificateAuthorities/*`. - # @param request_id [::String] - # Optional. An ID to identify requests. Specify a unique request ID so that - # if you must retry your request, the server will know to ignore the request - # if it has already been completed. The server will guarantee that for at - # least 60 minutes since the first request. - # - # For example, consider a situation where you make an initial request and - # the request times out. If you make the request again with the same request - # ID, the server can check if original operation with the same request ID - # was received, and if so, will ignore the second request. This prevents - # clients from accidentally creating duplicate commitments. - # - # The request ID must be a valid UUID with the exception that zero UUID is - # not supported (00000000-0000-0000-0000-000000000000). - # @param ignore_dependent_resources [::Boolean] - # Optional. This field allows this CA to be disabled even if it's being - # depended on by another resource. However, doing so may result in unintended - # and unrecoverable effects on any dependent resources since the CA will - # no longer be able to issue certificates. - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Gapic::Operation] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Gapic::Operation] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/cloud/security/private_ca/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Security::PrivateCA::V1::CertificateAuthorityService::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Security::PrivateCA::V1::DisableCertificateAuthorityRequest.new - # - # # Call the disable_certificate_authority method. - # result = client.disable_certificate_authority 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 disable_certificate_authority request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Security::PrivateCA::V1::DisableCertificateAuthorityRequest - - # Converts hash and nil to an options object - options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h - - # Customize the options with defaults - metadata = @config.rpcs.disable_certificate_authority.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::Security::PrivateCA::V1::VERSION - metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - header_params = {} - if request.name - header_params["name"] = request.name - end - - request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") - metadata[:"x-goog-request-params"] ||= request_params_header - - options.apply_defaults timeout: @config.rpcs.disable_certificate_authority.timeout, - metadata: metadata, - retry_policy: @config.rpcs.disable_certificate_authority.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @certificate_authority_service_stub.call_rpc :disable_certificate_authority, 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 - - ## - # Enable a - # {::Google::Cloud::Security::PrivateCA::V1::CertificateAuthority CertificateAuthority}. - # - # @overload enable_certificate_authority(request, options = nil) - # Pass arguments to `enable_certificate_authority` via a request object, either of type - # {::Google::Cloud::Security::PrivateCA::V1::EnableCertificateAuthorityRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Security::PrivateCA::V1::EnableCertificateAuthorityRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. - # - # @overload enable_certificate_authority(name: nil, request_id: nil) - # Pass arguments to `enable_certificate_authority` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param name [::String] - # Required. The resource name for this - # {::Google::Cloud::Security::PrivateCA::V1::CertificateAuthority CertificateAuthority} - # in the format `projects/*/locations/*/caPools/*/certificateAuthorities/*`. - # @param request_id [::String] - # Optional. An ID to identify requests. Specify a unique request ID so that - # if you must retry your request, the server will know to ignore the request - # if it has already been completed. The server will guarantee that for at - # least 60 minutes since the first request. - # - # For example, consider a situation where you make an initial request and - # the request times out. If you make the request again with the same request - # ID, the server can check if original operation with the same request ID - # was received, and if so, will ignore the second request. This prevents - # clients from accidentally creating duplicate commitments. - # - # The request ID must be a valid UUID with the exception that zero UUID is - # not supported (00000000-0000-0000-0000-000000000000). - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Gapic::Operation] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Gapic::Operation] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/cloud/security/private_ca/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Security::PrivateCA::V1::CertificateAuthorityService::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Security::PrivateCA::V1::EnableCertificateAuthorityRequest.new - # - # # Call the enable_certificate_authority method. - # result = client.enable_certificate_authority 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 enable_certificate_authority request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Security::PrivateCA::V1::EnableCertificateAuthorityRequest - - # Converts hash and nil to an options object - options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h - - # Customize the options with defaults - metadata = @config.rpcs.enable_certificate_authority.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::Security::PrivateCA::V1::VERSION - metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - header_params = {} - if request.name - header_params["name"] = request.name - end - - request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") - metadata[:"x-goog-request-params"] ||= request_params_header - - options.apply_defaults timeout: @config.rpcs.enable_certificate_authority.timeout, - metadata: metadata, - retry_policy: @config.rpcs.enable_certificate_authority.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @certificate_authority_service_stub.call_rpc :enable_certificate_authority, 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 - - ## - # Fetch a certificate signing request (CSR) from a - # {::Google::Cloud::Security::PrivateCA::V1::CertificateAuthority CertificateAuthority} - # that is in state - # {::Google::Cloud::Security::PrivateCA::V1::CertificateAuthority::State::AWAITING_USER_ACTIVATION AWAITING_USER_ACTIVATION} - # and is of type - # {::Google::Cloud::Security::PrivateCA::V1::CertificateAuthority::Type::SUBORDINATE SUBORDINATE}. - # The CSR must then be signed by the desired parent Certificate Authority, - # which could be another - # {::Google::Cloud::Security::PrivateCA::V1::CertificateAuthority CertificateAuthority} - # resource, or could be an on-prem certificate authority. See also - # {::Google::Cloud::Security::PrivateCA::V1::CertificateAuthorityService::Client#activate_certificate_authority ActivateCertificateAuthority}. - # - # @overload fetch_certificate_authority_csr(request, options = nil) - # Pass arguments to `fetch_certificate_authority_csr` via a request object, either of type - # {::Google::Cloud::Security::PrivateCA::V1::FetchCertificateAuthorityCsrRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Security::PrivateCA::V1::FetchCertificateAuthorityCsrRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. - # - # @overload fetch_certificate_authority_csr(name: nil) - # Pass arguments to `fetch_certificate_authority_csr` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param name [::String] - # Required. The resource name for this - # {::Google::Cloud::Security::PrivateCA::V1::CertificateAuthority CertificateAuthority} - # in the format `projects/*/locations/*/caPools/*/certificateAuthorities/*`. - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Google::Cloud::Security::PrivateCA::V1::FetchCertificateAuthorityCsrResponse] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Google::Cloud::Security::PrivateCA::V1::FetchCertificateAuthorityCsrResponse] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/cloud/security/private_ca/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Security::PrivateCA::V1::CertificateAuthorityService::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Security::PrivateCA::V1::FetchCertificateAuthorityCsrRequest.new - # - # # Call the fetch_certificate_authority_csr method. - # result = client.fetch_certificate_authority_csr request - # - # # The returned object is of type Google::Cloud::Security::PrivateCA::V1::FetchCertificateAuthorityCsrResponse. - # p result - # - def fetch_certificate_authority_csr request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Security::PrivateCA::V1::FetchCertificateAuthorityCsrRequest - - # Converts hash 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.fetch_certificate_authority_csr.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::Security::PrivateCA::V1::VERSION - metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - header_params = {} - if request.name - header_params["name"] = request.name - end - - request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") - metadata[:"x-goog-request-params"] ||= request_params_header - - options.apply_defaults timeout: @config.rpcs.fetch_certificate_authority_csr.timeout, - metadata: metadata, - retry_policy: @config.rpcs.fetch_certificate_authority_csr.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @certificate_authority_service_stub.call_rpc :fetch_certificate_authority_csr, request, options: options do |response, operation| - yield response, operation if block_given? - end - rescue ::GRPC::BadStatus => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Returns a - # {::Google::Cloud::Security::PrivateCA::V1::CertificateAuthority CertificateAuthority}. - # - # @overload get_certificate_authority(request, options = nil) - # Pass arguments to `get_certificate_authority` via a request object, either of type - # {::Google::Cloud::Security::PrivateCA::V1::GetCertificateAuthorityRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Security::PrivateCA::V1::GetCertificateAuthorityRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_certificate_authority(name: nil) - # Pass arguments to `get_certificate_authority` via keyword arguments. Note that at - # least one keyword argument is 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 - # {::Google::Cloud::Security::PrivateCA::V1::CertificateAuthority#name name} of the - # {::Google::Cloud::Security::PrivateCA::V1::CertificateAuthority CertificateAuthority} - # to get. - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Google::Cloud::Security::PrivateCA::V1::CertificateAuthority] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Google::Cloud::Security::PrivateCA::V1::CertificateAuthority] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/cloud/security/private_ca/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Security::PrivateCA::V1::CertificateAuthorityService::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Security::PrivateCA::V1::GetCertificateAuthorityRequest.new - # - # # Call the get_certificate_authority method. - # result = client.get_certificate_authority request - # - # # The returned object is of type Google::Cloud::Security::PrivateCA::V1::CertificateAuthority. - # p result - # - def get_certificate_authority request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Security::PrivateCA::V1::GetCertificateAuthorityRequest - - # Converts hash 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_certificate_authority.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::Security::PrivateCA::V1::VERSION - metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - header_params = {} - if request.name - header_params["name"] = request.name - end - - request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") - metadata[:"x-goog-request-params"] ||= request_params_header - - options.apply_defaults timeout: @config.rpcs.get_certificate_authority.timeout, - metadata: metadata, - retry_policy: @config.rpcs.get_certificate_authority.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @certificate_authority_service_stub.call_rpc :get_certificate_authority, request, options: options do |response, operation| - yield response, operation if block_given? - end - rescue ::GRPC::BadStatus => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Lists - # {::Google::Cloud::Security::PrivateCA::V1::CertificateAuthority CertificateAuthorities}. - # - # @overload list_certificate_authorities(request, options = nil) - # Pass arguments to `list_certificate_authorities` via a request object, either of type - # {::Google::Cloud::Security::PrivateCA::V1::ListCertificateAuthoritiesRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Security::PrivateCA::V1::ListCertificateAuthoritiesRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_certificate_authorities(parent: nil, page_size: nil, page_token: nil, filter: nil, order_by: nil) - # Pass arguments to `list_certificate_authorities` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param parent [::String] - # Required. The resource name of the - # {::Google::Cloud::Security::PrivateCA::V1::CaPool CaPool} associated with the - # {::Google::Cloud::Security::PrivateCA::V1::CertificateAuthority CertificateAuthorities}, - # in the format `projects/*/locations/*/caPools/*`. - # @param page_size [::Integer] - # Optional. Limit on the number of - # {::Google::Cloud::Security::PrivateCA::V1::CertificateAuthority CertificateAuthorities} - # to include in the response. Further - # {::Google::Cloud::Security::PrivateCA::V1::CertificateAuthority CertificateAuthorities} - # can subsequently be obtained by including the - # {::Google::Cloud::Security::PrivateCA::V1::ListCertificateAuthoritiesResponse#next_page_token ListCertificateAuthoritiesResponse.next_page_token} - # in a subsequent request. If unspecified, the server will pick an - # appropriate default. - # @param page_token [::String] - # Optional. Pagination token, returned earlier via - # {::Google::Cloud::Security::PrivateCA::V1::ListCertificateAuthoritiesResponse#next_page_token ListCertificateAuthoritiesResponse.next_page_token}. - # @param filter [::String] - # Optional. Only include resources that match the filter in the response. - # @param order_by [::String] - # Optional. Specify how the results should be sorted. - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Gapic::PagedEnumerable<::Google::Cloud::Security::PrivateCA::V1::CertificateAuthority>] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Gapic::PagedEnumerable<::Google::Cloud::Security::PrivateCA::V1::CertificateAuthority>] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/cloud/security/private_ca/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Security::PrivateCA::V1::CertificateAuthorityService::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Security::PrivateCA::V1::ListCertificateAuthoritiesRequest.new - # - # # Call the list_certificate_authorities method. - # result = client.list_certificate_authorities request - # - # # The returned object is of type Gapic::PagedEnumerable. You can iterate - # # over elements, and API calls will be issued to fetch pages as needed. - # result.each do |item| - # # Each element is of type ::Google::Cloud::Security::PrivateCA::V1::CertificateAuthority. - # p item - # end - # - def list_certificate_authorities request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Security::PrivateCA::V1::ListCertificateAuthoritiesRequest - - # Converts hash 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_certificate_authorities.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::Security::PrivateCA::V1::VERSION - metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - header_params = {} - if request.parent - header_params["parent"] = request.parent - end - - request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") - metadata[:"x-goog-request-params"] ||= request_params_header - - options.apply_defaults timeout: @config.rpcs.list_certificate_authorities.timeout, - metadata: metadata, - retry_policy: @config.rpcs.list_certificate_authorities.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @certificate_authority_service_stub.call_rpc :list_certificate_authorities, request, options: options do |response, operation| - response = ::Gapic::PagedEnumerable.new @certificate_authority_service_stub, :list_certificate_authorities, 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 - - ## - # Undelete a - # {::Google::Cloud::Security::PrivateCA::V1::CertificateAuthority CertificateAuthority} - # that has been deleted. - # - # @overload undelete_certificate_authority(request, options = nil) - # Pass arguments to `undelete_certificate_authority` via a request object, either of type - # {::Google::Cloud::Security::PrivateCA::V1::UndeleteCertificateAuthorityRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Security::PrivateCA::V1::UndeleteCertificateAuthorityRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. - # - # @overload undelete_certificate_authority(name: nil, request_id: nil) - # Pass arguments to `undelete_certificate_authority` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param name [::String] - # Required. The resource name for this - # {::Google::Cloud::Security::PrivateCA::V1::CertificateAuthority CertificateAuthority} - # in the format `projects/*/locations/*/caPools/*/certificateAuthorities/*`. - # @param request_id [::String] - # Optional. An ID to identify requests. Specify a unique request ID so that - # if you must retry your request, the server will know to ignore the request - # if it has already been completed. The server will guarantee that for at - # least 60 minutes since the first request. - # - # For example, consider a situation where you make an initial request and - # the request times out. If you make the request again with the same request - # ID, the server can check if original operation with the same request ID - # was received, and if so, will ignore the second request. This prevents - # clients from accidentally creating duplicate commitments. - # - # The request ID must be a valid UUID with the exception that zero UUID is - # not supported (00000000-0000-0000-0000-000000000000). - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Gapic::Operation] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Gapic::Operation] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/cloud/security/private_ca/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Security::PrivateCA::V1::CertificateAuthorityService::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Security::PrivateCA::V1::UndeleteCertificateAuthorityRequest.new - # - # # Call the undelete_certificate_authority method. - # result = client.undelete_certificate_authority 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 undelete_certificate_authority request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Security::PrivateCA::V1::UndeleteCertificateAuthorityRequest - - # Converts hash 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.undelete_certificate_authority.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::Security::PrivateCA::V1::VERSION - metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - header_params = {} - if request.name - header_params["name"] = request.name - end - - request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") - metadata[:"x-goog-request-params"] ||= request_params_header - - options.apply_defaults timeout: @config.rpcs.undelete_certificate_authority.timeout, - metadata: metadata, - retry_policy: @config.rpcs.undelete_certificate_authority.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @certificate_authority_service_stub.call_rpc :undelete_certificate_authority, 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 - - ## - # Delete a - # {::Google::Cloud::Security::PrivateCA::V1::CertificateAuthority CertificateAuthority}. - # - # @overload delete_certificate_authority(request, options = nil) - # Pass arguments to `delete_certificate_authority` via a request object, either of type - # {::Google::Cloud::Security::PrivateCA::V1::DeleteCertificateAuthorityRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Security::PrivateCA::V1::DeleteCertificateAuthorityRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_certificate_authority(name: nil, request_id: nil, ignore_active_certificates: nil, skip_grace_period: nil, ignore_dependent_resources: nil) - # Pass arguments to `delete_certificate_authority` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param name [::String] - # Required. The resource name for this - # {::Google::Cloud::Security::PrivateCA::V1::CertificateAuthority CertificateAuthority} - # in the format `projects/*/locations/*/caPools/*/certificateAuthorities/*`. - # @param request_id [::String] - # Optional. An ID to identify requests. Specify a unique request ID so that - # if you must retry your request, the server will know to ignore the request - # if it has already been completed. The server will guarantee that for at - # least 60 minutes since the first request. - # - # For example, consider a situation where you make an initial request and - # the request times out. If you make the request again with the same request - # ID, the server can check if original operation with the same request ID - # was received, and if so, will ignore the second request. This prevents - # clients from accidentally creating duplicate commitments. - # - # The request ID must be a valid UUID with the exception that zero UUID is - # not supported (00000000-0000-0000-0000-000000000000). - # @param ignore_active_certificates [::Boolean] - # Optional. This field allows the CA to be deleted even if the CA has - # active certs. Active certs include both unrevoked and unexpired certs. - # @param skip_grace_period [::Boolean] - # Optional. If this flag is set, the Certificate Authority will be deleted as - # soon as possible without a 30-day grace period where undeletion would have - # been allowed. If you proceed, there will be no way to recover this CA. - # @param ignore_dependent_resources [::Boolean] - # Optional. This field allows this CA to be deleted even if it's being - # depended on by another resource. However, doing so may result in unintended - # and unrecoverable effects on any dependent resources since the CA will - # no longer be able to issue certificates. - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Gapic::Operation] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Gapic::Operation] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/cloud/security/private_ca/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Security::PrivateCA::V1::CertificateAuthorityService::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Security::PrivateCA::V1::DeleteCertificateAuthorityRequest.new - # - # # Call the delete_certificate_authority method. - # result = client.delete_certificate_authority 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_certificate_authority request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Security::PrivateCA::V1::DeleteCertificateAuthorityRequest - - # Converts hash 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_certificate_authority.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::Security::PrivateCA::V1::VERSION - metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - header_params = {} - if request.name - header_params["name"] = request.name - end - - request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") - metadata[:"x-goog-request-params"] ||= request_params_header - - options.apply_defaults timeout: @config.rpcs.delete_certificate_authority.timeout, - metadata: metadata, - retry_policy: @config.rpcs.delete_certificate_authority.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @certificate_authority_service_stub.call_rpc :delete_certificate_authority, 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 - - ## - # Update a - # {::Google::Cloud::Security::PrivateCA::V1::CertificateAuthority CertificateAuthority}. - # - # @overload update_certificate_authority(request, options = nil) - # Pass arguments to `update_certificate_authority` via a request object, either of type - # {::Google::Cloud::Security::PrivateCA::V1::UpdateCertificateAuthorityRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Security::PrivateCA::V1::UpdateCertificateAuthorityRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_certificate_authority(certificate_authority: nil, update_mask: nil, request_id: nil) - # Pass arguments to `update_certificate_authority` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param certificate_authority [::Google::Cloud::Security::PrivateCA::V1::CertificateAuthority, ::Hash] - # Required. - # {::Google::Cloud::Security::PrivateCA::V1::CertificateAuthority CertificateAuthority} - # with updated values. - # @param update_mask [::Google::Protobuf::FieldMask, ::Hash] - # Required. A list of fields to be updated in this request. - # @param request_id [::String] - # Optional. An ID to identify requests. Specify a unique request ID so that - # if you must retry your request, the server will know to ignore the request - # if it has already been completed. The server will guarantee that for at - # least 60 minutes since the first request. - # - # For example, consider a situation where you make an initial request and - # the request times out. If you make the request again with the same request - # ID, the server can check if original operation with the same request ID - # was received, and if so, will ignore the second request. This prevents - # clients from accidentally creating duplicate commitments. - # - # The request ID must be a valid UUID with the exception that zero UUID is - # not supported (00000000-0000-0000-0000-000000000000). - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Gapic::Operation] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Gapic::Operation] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/cloud/security/private_ca/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Security::PrivateCA::V1::CertificateAuthorityService::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Security::PrivateCA::V1::UpdateCertificateAuthorityRequest.new - # - # # Call the update_certificate_authority method. - # result = client.update_certificate_authority 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_certificate_authority request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Security::PrivateCA::V1::UpdateCertificateAuthorityRequest - - # Converts hash 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_certificate_authority.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::Security::PrivateCA::V1::VERSION - metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - header_params = {} - if request.certificate_authority&.name - header_params["certificate_authority.name"] = request.certificate_authority.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_certificate_authority.timeout, - metadata: metadata, - retry_policy: @config.rpcs.update_certificate_authority.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @certificate_authority_service_stub.call_rpc :update_certificate_authority, 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 - - ## - # Create a {::Google::Cloud::Security::PrivateCA::V1::CaPool CaPool}. - # - # @overload create_ca_pool(request, options = nil) - # Pass arguments to `create_ca_pool` via a request object, either of type - # {::Google::Cloud::Security::PrivateCA::V1::CreateCaPoolRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Security::PrivateCA::V1::CreateCaPoolRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_ca_pool(parent: nil, ca_pool_id: nil, ca_pool: nil, request_id: nil) - # Pass arguments to `create_ca_pool` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param parent [::String] - # Required. The resource name of the location associated with the - # {::Google::Cloud::Security::PrivateCA::V1::CaPool CaPool}, in the format - # `projects/*/locations/*`. - # @param ca_pool_id [::String] - # Required. It must be unique within a location and match the regular - # expression `[a-zA-Z0-9_-]{1,63}` - # @param ca_pool [::Google::Cloud::Security::PrivateCA::V1::CaPool, ::Hash] - # Required. A {::Google::Cloud::Security::PrivateCA::V1::CaPool CaPool} with - # initial field values. - # @param request_id [::String] - # Optional. An ID to identify requests. Specify a unique request ID so that - # if you must retry your request, the server will know to ignore the request - # if it has already been completed. The server will guarantee that for at - # least 60 minutes since the first request. - # - # For example, consider a situation where you make an initial request and - # the request times out. If you make the request again with the same request - # ID, the server can check if original operation with the same request ID - # was received, and if so, will ignore the second request. This prevents - # clients from accidentally creating duplicate commitments. - # - # The request ID must be a valid UUID with the exception that zero UUID is - # not supported (00000000-0000-0000-0000-000000000000). - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Gapic::Operation] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Gapic::Operation] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/cloud/security/private_ca/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Security::PrivateCA::V1::CertificateAuthorityService::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Security::PrivateCA::V1::CreateCaPoolRequest.new - # - # # Call the create_ca_pool method. - # result = client.create_ca_pool 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_ca_pool request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Security::PrivateCA::V1::CreateCaPoolRequest - - # Converts hash 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_ca_pool.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::Security::PrivateCA::V1::VERSION - metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - header_params = {} - if request.parent - header_params["parent"] = request.parent - end - - request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") - metadata[:"x-goog-request-params"] ||= request_params_header - - options.apply_defaults timeout: @config.rpcs.create_ca_pool.timeout, - metadata: metadata, - retry_policy: @config.rpcs.create_ca_pool.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @certificate_authority_service_stub.call_rpc :create_ca_pool, 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 - - ## - # Update a {::Google::Cloud::Security::PrivateCA::V1::CaPool CaPool}. - # - # @overload update_ca_pool(request, options = nil) - # Pass arguments to `update_ca_pool` via a request object, either of type - # {::Google::Cloud::Security::PrivateCA::V1::UpdateCaPoolRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Security::PrivateCA::V1::UpdateCaPoolRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_ca_pool(ca_pool: nil, update_mask: nil, request_id: nil) - # Pass arguments to `update_ca_pool` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param ca_pool [::Google::Cloud::Security::PrivateCA::V1::CaPool, ::Hash] - # Required. {::Google::Cloud::Security::PrivateCA::V1::CaPool CaPool} with updated - # values. - # @param update_mask [::Google::Protobuf::FieldMask, ::Hash] - # Required. A list of fields to be updated in this request. - # @param request_id [::String] - # Optional. An ID to identify requests. Specify a unique request ID so that - # if you must retry your request, the server will know to ignore the request - # if it has already been completed. The server will guarantee that for at - # least 60 minutes since the first request. - # - # For example, consider a situation where you make an initial request and - # the request times out. If you make the request again with the same request - # ID, the server can check if original operation with the same request ID - # was received, and if so, will ignore the second request. This prevents - # clients from accidentally creating duplicate commitments. - # - # The request ID must be a valid UUID with the exception that zero UUID is - # not supported (00000000-0000-0000-0000-000000000000). - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Gapic::Operation] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Gapic::Operation] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/cloud/security/private_ca/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Security::PrivateCA::V1::CertificateAuthorityService::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Security::PrivateCA::V1::UpdateCaPoolRequest.new - # - # # Call the update_ca_pool method. - # result = client.update_ca_pool 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_ca_pool request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Security::PrivateCA::V1::UpdateCaPoolRequest - - # Converts hash 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_ca_pool.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::Security::PrivateCA::V1::VERSION - metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - header_params = {} - if request.ca_pool&.name - header_params["ca_pool.name"] = request.ca_pool.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_ca_pool.timeout, - metadata: metadata, - retry_policy: @config.rpcs.update_ca_pool.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @certificate_authority_service_stub.call_rpc :update_ca_pool, request, options: options do |response, operation| - response = ::Gapic::Operation.new response, @operations_client, options: options - yield response, operation if block_given? - throw :response, response - end - rescue ::GRPC::BadStatus => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Returns a {::Google::Cloud::Security::PrivateCA::V1::CaPool CaPool}. - # - # @overload get_ca_pool(request, options = nil) - # Pass arguments to `get_ca_pool` via a request object, either of type - # {::Google::Cloud::Security::PrivateCA::V1::GetCaPoolRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Security::PrivateCA::V1::GetCaPoolRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_ca_pool(name: nil) - # Pass arguments to `get_ca_pool` via keyword arguments. Note that at - # least one keyword argument is 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 {::Google::Cloud::Security::PrivateCA::V1::CaPool#name name} of the - # {::Google::Cloud::Security::PrivateCA::V1::CaPool CaPool} to get. - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Google::Cloud::Security::PrivateCA::V1::CaPool] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Google::Cloud::Security::PrivateCA::V1::CaPool] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/cloud/security/private_ca/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Security::PrivateCA::V1::CertificateAuthorityService::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Security::PrivateCA::V1::GetCaPoolRequest.new - # - # # Call the get_ca_pool method. - # result = client.get_ca_pool request - # - # # The returned object is of type Google::Cloud::Security::PrivateCA::V1::CaPool. - # p result - # - def get_ca_pool request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Security::PrivateCA::V1::GetCaPoolRequest - - # Converts hash 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_ca_pool.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::Security::PrivateCA::V1::VERSION - metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - header_params = {} - if request.name - header_params["name"] = request.name - end - - request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") - metadata[:"x-goog-request-params"] ||= request_params_header - - options.apply_defaults timeout: @config.rpcs.get_ca_pool.timeout, - metadata: metadata, - retry_policy: @config.rpcs.get_ca_pool.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @certificate_authority_service_stub.call_rpc :get_ca_pool, request, options: options do |response, operation| - yield response, operation if block_given? - end - rescue ::GRPC::BadStatus => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Lists {::Google::Cloud::Security::PrivateCA::V1::CaPool CaPools}. - # - # @overload list_ca_pools(request, options = nil) - # Pass arguments to `list_ca_pools` via a request object, either of type - # {::Google::Cloud::Security::PrivateCA::V1::ListCaPoolsRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Security::PrivateCA::V1::ListCaPoolsRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_ca_pools(parent: nil, page_size: nil, page_token: nil, filter: nil, order_by: nil) - # Pass arguments to `list_ca_pools` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param parent [::String] - # Required. The resource name of the location associated with the - # {::Google::Cloud::Security::PrivateCA::V1::CaPool CaPools}, in the format - # `projects/*/locations/*`. - # @param page_size [::Integer] - # Optional. Limit on the number of - # {::Google::Cloud::Security::PrivateCA::V1::CaPool CaPools} to include in the - # response. Further {::Google::Cloud::Security::PrivateCA::V1::CaPool CaPools} can - # subsequently be obtained by including the - # {::Google::Cloud::Security::PrivateCA::V1::ListCaPoolsResponse#next_page_token ListCaPoolsResponse.next_page_token} - # in a subsequent request. If unspecified, the server will pick an - # appropriate default. - # @param page_token [::String] - # Optional. Pagination token, returned earlier via - # {::Google::Cloud::Security::PrivateCA::V1::ListCaPoolsResponse#next_page_token ListCaPoolsResponse.next_page_token}. - # @param filter [::String] - # Optional. Only include resources that match the filter in the response. - # @param order_by [::String] - # Optional. Specify how the results should be sorted. - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Gapic::PagedEnumerable<::Google::Cloud::Security::PrivateCA::V1::CaPool>] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Gapic::PagedEnumerable<::Google::Cloud::Security::PrivateCA::V1::CaPool>] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/cloud/security/private_ca/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Security::PrivateCA::V1::CertificateAuthorityService::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Security::PrivateCA::V1::ListCaPoolsRequest.new - # - # # Call the list_ca_pools method. - # result = client.list_ca_pools request - # - # # The returned object is of type Gapic::PagedEnumerable. You can iterate - # # over elements, and API calls will be issued to fetch pages as needed. - # result.each do |item| - # # Each element is of type ::Google::Cloud::Security::PrivateCA::V1::CaPool. - # p item - # end - # - def list_ca_pools request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Security::PrivateCA::V1::ListCaPoolsRequest - - # Converts hash 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_ca_pools.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::Security::PrivateCA::V1::VERSION - metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - header_params = {} - if request.parent - header_params["parent"] = request.parent - end - - request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") - metadata[:"x-goog-request-params"] ||= request_params_header - - options.apply_defaults timeout: @config.rpcs.list_ca_pools.timeout, - metadata: metadata, - retry_policy: @config.rpcs.list_ca_pools.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @certificate_authority_service_stub.call_rpc :list_ca_pools, request, options: options do |response, operation| - response = ::Gapic::PagedEnumerable.new @certificate_authority_service_stub, :list_ca_pools, 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 - - ## - # Delete a {::Google::Cloud::Security::PrivateCA::V1::CaPool CaPool}. - # - # @overload delete_ca_pool(request, options = nil) - # Pass arguments to `delete_ca_pool` via a request object, either of type - # {::Google::Cloud::Security::PrivateCA::V1::DeleteCaPoolRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Security::PrivateCA::V1::DeleteCaPoolRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_ca_pool(name: nil, request_id: nil, ignore_dependent_resources: nil) - # Pass arguments to `delete_ca_pool` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param name [::String] - # Required. The resource name for this - # {::Google::Cloud::Security::PrivateCA::V1::CaPool CaPool} in the format - # `projects/*/locations/*/caPools/*`. - # @param request_id [::String] - # Optional. An ID to identify requests. Specify a unique request ID so that - # if you must retry your request, the server will know to ignore the request - # if it has already been completed. The server will guarantee that for at - # least 60 minutes since the first request. - # - # For example, consider a situation where you make an initial request and - # the request times out. If you make the request again with the same request - # ID, the server can check if original operation with the same request ID - # was received, and if so, will ignore the second request. This prevents - # clients from accidentally creating duplicate commitments. - # - # The request ID must be a valid UUID with the exception that zero UUID is - # not supported (00000000-0000-0000-0000-000000000000). - # @param ignore_dependent_resources [::Boolean] - # Optional. This field allows this pool to be deleted even if it's being - # depended on by another resource. However, doing so may result in unintended - # and unrecoverable effects on any dependent resources since the pool will - # no longer be able to issue certificates. - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Gapic::Operation] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Gapic::Operation] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/cloud/security/private_ca/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Security::PrivateCA::V1::CertificateAuthorityService::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Security::PrivateCA::V1::DeleteCaPoolRequest.new - # - # # Call the delete_ca_pool method. - # result = client.delete_ca_pool 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_ca_pool request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Security::PrivateCA::V1::DeleteCaPoolRequest - - # Converts hash 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_ca_pool.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::Security::PrivateCA::V1::VERSION - metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - header_params = {} - if request.name - header_params["name"] = request.name - end - - request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") - metadata[:"x-goog-request-params"] ||= request_params_header - - options.apply_defaults timeout: @config.rpcs.delete_ca_pool.timeout, - metadata: metadata, - retry_policy: @config.rpcs.delete_ca_pool.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @certificate_authority_service_stub.call_rpc :delete_ca_pool, 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 - - ## - # FetchCaCerts returns the current trust anchor for the - # {::Google::Cloud::Security::PrivateCA::V1::CaPool CaPool}. This will include CA - # certificate chains for all certificate authorities in the ENABLED, - # DISABLED, or STAGED states. - # - # @overload fetch_ca_certs(request, options = nil) - # Pass arguments to `fetch_ca_certs` via a request object, either of type - # {::Google::Cloud::Security::PrivateCA::V1::FetchCaCertsRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Security::PrivateCA::V1::FetchCaCertsRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. - # - # @overload fetch_ca_certs(ca_pool: nil, request_id: nil) - # Pass arguments to `fetch_ca_certs` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param ca_pool [::String] - # Required. The resource name for the - # {::Google::Cloud::Security::PrivateCA::V1::CaPool CaPool} in the format - # `projects/*/locations/*/caPools/*`. - # @param request_id [::String] - # Optional. An ID to identify requests. Specify a unique request ID so that - # if you must retry your request, the server will know to ignore the request - # if it has already been completed. The server will guarantee that for at - # least 60 minutes since the first request. - # - # For example, consider a situation where you make an initial request and - # the request times out. If you make the request again with the same request - # ID, the server can check if original operation with the same request ID - # was received, and if so, will ignore the second request. This prevents - # clients from accidentally creating duplicate commitments. - # - # The request ID must be a valid UUID with the exception that zero UUID is - # not supported (00000000-0000-0000-0000-000000000000). - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Google::Cloud::Security::PrivateCA::V1::FetchCaCertsResponse] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Google::Cloud::Security::PrivateCA::V1::FetchCaCertsResponse] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/cloud/security/private_ca/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Security::PrivateCA::V1::CertificateAuthorityService::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Security::PrivateCA::V1::FetchCaCertsRequest.new - # - # # Call the fetch_ca_certs method. - # result = client.fetch_ca_certs request - # - # # The returned object is of type Google::Cloud::Security::PrivateCA::V1::FetchCaCertsResponse. - # p result - # - def fetch_ca_certs request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Security::PrivateCA::V1::FetchCaCertsRequest - - # Converts hash 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.fetch_ca_certs.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::Security::PrivateCA::V1::VERSION - metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - header_params = {} - if request.ca_pool - header_params["ca_pool"] = request.ca_pool - 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.fetch_ca_certs.timeout, - metadata: metadata, - retry_policy: @config.rpcs.fetch_ca_certs.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @certificate_authority_service_stub.call_rpc :fetch_ca_certs, request, options: options do |response, operation| - yield response, operation if block_given? - end - rescue ::GRPC::BadStatus => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Returns a - # {::Google::Cloud::Security::PrivateCA::V1::CertificateRevocationList CertificateRevocationList}. - # - # @overload get_certificate_revocation_list(request, options = nil) - # Pass arguments to `get_certificate_revocation_list` via a request object, either of type - # {::Google::Cloud::Security::PrivateCA::V1::GetCertificateRevocationListRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Security::PrivateCA::V1::GetCertificateRevocationListRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_certificate_revocation_list(name: nil) - # Pass arguments to `get_certificate_revocation_list` via keyword arguments. Note that at - # least one keyword argument is 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 - # {::Google::Cloud::Security::PrivateCA::V1::CertificateRevocationList#name name} - # of the - # {::Google::Cloud::Security::PrivateCA::V1::CertificateRevocationList CertificateRevocationList} - # to get. - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Google::Cloud::Security::PrivateCA::V1::CertificateRevocationList] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Google::Cloud::Security::PrivateCA::V1::CertificateRevocationList] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/cloud/security/private_ca/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Security::PrivateCA::V1::CertificateAuthorityService::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Security::PrivateCA::V1::GetCertificateRevocationListRequest.new - # - # # Call the get_certificate_revocation_list method. - # result = client.get_certificate_revocation_list request - # - # # The returned object is of type Google::Cloud::Security::PrivateCA::V1::CertificateRevocationList. - # p result - # - def get_certificate_revocation_list request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Security::PrivateCA::V1::GetCertificateRevocationListRequest - - # Converts hash 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_certificate_revocation_list.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::Security::PrivateCA::V1::VERSION - metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - header_params = {} - if request.name - header_params["name"] = request.name - end - - request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") - metadata[:"x-goog-request-params"] ||= request_params_header - - options.apply_defaults timeout: @config.rpcs.get_certificate_revocation_list.timeout, - metadata: metadata, - retry_policy: @config.rpcs.get_certificate_revocation_list.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @certificate_authority_service_stub.call_rpc :get_certificate_revocation_list, request, options: options do |response, operation| - yield response, operation if block_given? - end - rescue ::GRPC::BadStatus => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Lists - # {::Google::Cloud::Security::PrivateCA::V1::CertificateRevocationList CertificateRevocationLists}. - # - # @overload list_certificate_revocation_lists(request, options = nil) - # Pass arguments to `list_certificate_revocation_lists` via a request object, either of type - # {::Google::Cloud::Security::PrivateCA::V1::ListCertificateRevocationListsRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Security::PrivateCA::V1::ListCertificateRevocationListsRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_certificate_revocation_lists(parent: nil, page_size: nil, page_token: nil, filter: nil, order_by: nil) - # Pass arguments to `list_certificate_revocation_lists` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param parent [::String] - # Required. The resource name of the location associated with the - # {::Google::Cloud::Security::PrivateCA::V1::CertificateRevocationList CertificateRevocationLists}, - # in the format `projects/*/locations/*/caPools/*/certificateAuthorities/*`. - # @param page_size [::Integer] - # Optional. Limit on the number of - # {::Google::Cloud::Security::PrivateCA::V1::CertificateRevocationList CertificateRevocationLists} - # to include in the response. Further - # {::Google::Cloud::Security::PrivateCA::V1::CertificateRevocationList CertificateRevocationLists} - # can subsequently be obtained by including the - # {::Google::Cloud::Security::PrivateCA::V1::ListCertificateRevocationListsResponse#next_page_token ListCertificateRevocationListsResponse.next_page_token} - # in a subsequent request. If unspecified, the server will pick an - # appropriate default. - # @param page_token [::String] - # Optional. Pagination token, returned earlier via - # {::Google::Cloud::Security::PrivateCA::V1::ListCertificateRevocationListsResponse#next_page_token ListCertificateRevocationListsResponse.next_page_token}. - # @param filter [::String] - # Optional. Only include resources that match the filter in the response. - # @param order_by [::String] - # Optional. Specify how the results should be sorted. - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Gapic::PagedEnumerable<::Google::Cloud::Security::PrivateCA::V1::CertificateRevocationList>] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Gapic::PagedEnumerable<::Google::Cloud::Security::PrivateCA::V1::CertificateRevocationList>] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/cloud/security/private_ca/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Security::PrivateCA::V1::CertificateAuthorityService::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Security::PrivateCA::V1::ListCertificateRevocationListsRequest.new - # - # # Call the list_certificate_revocation_lists method. - # result = client.list_certificate_revocation_lists request - # - # # The returned object is of type Gapic::PagedEnumerable. You can iterate - # # over elements, and API calls will be issued to fetch pages as needed. - # result.each do |item| - # # Each element is of type ::Google::Cloud::Security::PrivateCA::V1::CertificateRevocationList. - # p item - # end - # - def list_certificate_revocation_lists request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Security::PrivateCA::V1::ListCertificateRevocationListsRequest - - # Converts hash 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_certificate_revocation_lists.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::Security::PrivateCA::V1::VERSION - metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - header_params = {} - if request.parent - header_params["parent"] = request.parent - end - - request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") - metadata[:"x-goog-request-params"] ||= request_params_header - - options.apply_defaults timeout: @config.rpcs.list_certificate_revocation_lists.timeout, - metadata: metadata, - retry_policy: @config.rpcs.list_certificate_revocation_lists.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @certificate_authority_service_stub.call_rpc :list_certificate_revocation_lists, request, options: options do |response, operation| - response = ::Gapic::PagedEnumerable.new @certificate_authority_service_stub, :list_certificate_revocation_lists, 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 - - ## - # Update a - # {::Google::Cloud::Security::PrivateCA::V1::CertificateRevocationList CertificateRevocationList}. - # - # @overload update_certificate_revocation_list(request, options = nil) - # Pass arguments to `update_certificate_revocation_list` via a request object, either of type - # {::Google::Cloud::Security::PrivateCA::V1::UpdateCertificateRevocationListRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Security::PrivateCA::V1::UpdateCertificateRevocationListRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_certificate_revocation_list(certificate_revocation_list: nil, update_mask: nil, request_id: nil) - # Pass arguments to `update_certificate_revocation_list` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param certificate_revocation_list [::Google::Cloud::Security::PrivateCA::V1::CertificateRevocationList, ::Hash] - # Required. - # {::Google::Cloud::Security::PrivateCA::V1::CertificateRevocationList CertificateRevocationList} - # with updated values. - # @param update_mask [::Google::Protobuf::FieldMask, ::Hash] - # Required. A list of fields to be updated in this request. - # @param request_id [::String] - # Optional. An ID to identify requests. Specify a unique request ID so that - # if you must retry your request, the server will know to ignore the request - # if it has already been completed. The server will guarantee that for at - # least 60 minutes since the first request. - # - # For example, consider a situation where you make an initial request and - # the request times out. If you make the request again with the same request - # ID, the server can check if original operation with the same request ID - # was received, and if so, will ignore the second request. This prevents - # clients from accidentally creating duplicate commitments. - # - # The request ID must be a valid UUID with the exception that zero UUID is - # not supported (00000000-0000-0000-0000-000000000000). - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Gapic::Operation] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Gapic::Operation] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/cloud/security/private_ca/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Security::PrivateCA::V1::CertificateAuthorityService::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Security::PrivateCA::V1::UpdateCertificateRevocationListRequest.new - # - # # Call the update_certificate_revocation_list method. - # result = client.update_certificate_revocation_list 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_certificate_revocation_list request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Security::PrivateCA::V1::UpdateCertificateRevocationListRequest - - # Converts hash 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_certificate_revocation_list.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::Security::PrivateCA::V1::VERSION - metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - header_params = {} - if request.certificate_revocation_list&.name - header_params["certificate_revocation_list.name"] = request.certificate_revocation_list.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_certificate_revocation_list.timeout, - metadata: metadata, - retry_policy: @config.rpcs.update_certificate_revocation_list.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @certificate_authority_service_stub.call_rpc :update_certificate_revocation_list, 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 - - ## - # Create a new - # {::Google::Cloud::Security::PrivateCA::V1::CertificateTemplate CertificateTemplate} - # in a given Project and Location. - # - # @overload create_certificate_template(request, options = nil) - # Pass arguments to `create_certificate_template` via a request object, either of type - # {::Google::Cloud::Security::PrivateCA::V1::CreateCertificateTemplateRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Security::PrivateCA::V1::CreateCertificateTemplateRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_certificate_template(parent: nil, certificate_template_id: nil, certificate_template: nil, request_id: nil) - # Pass arguments to `create_certificate_template` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param parent [::String] - # Required. The resource name of the location associated with the - # {::Google::Cloud::Security::PrivateCA::V1::CertificateTemplate CertificateTemplate}, - # in the format `projects/*/locations/*`. - # @param certificate_template_id [::String] - # Required. It must be unique within a location and match the regular - # expression `[a-zA-Z0-9_-]{1,63}` - # @param certificate_template [::Google::Cloud::Security::PrivateCA::V1::CertificateTemplate, ::Hash] - # Required. A - # {::Google::Cloud::Security::PrivateCA::V1::CertificateTemplate CertificateTemplate} - # with initial field values. - # @param request_id [::String] - # Optional. An ID to identify requests. Specify a unique request ID so that - # if you must retry your request, the server will know to ignore the request - # if it has already been completed. The server will guarantee that for at - # least 60 minutes since the first request. - # - # For example, consider a situation where you make an initial request and - # the request times out. If you make the request again with the same request - # ID, the server can check if original operation with the same request ID - # was received, and if so, will ignore the second request. This prevents - # clients from accidentally creating duplicate commitments. - # - # The request ID must be a valid UUID with the exception that zero UUID is - # not supported (00000000-0000-0000-0000-000000000000). - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Gapic::Operation] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Gapic::Operation] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/cloud/security/private_ca/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Security::PrivateCA::V1::CertificateAuthorityService::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Security::PrivateCA::V1::CreateCertificateTemplateRequest.new - # - # # Call the create_certificate_template method. - # result = client.create_certificate_template 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_certificate_template request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Security::PrivateCA::V1::CreateCertificateTemplateRequest - - # Converts hash 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_certificate_template.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::Security::PrivateCA::V1::VERSION - metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - header_params = {} - if request.parent - header_params["parent"] = request.parent - end - - request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") - metadata[:"x-goog-request-params"] ||= request_params_header - - options.apply_defaults timeout: @config.rpcs.create_certificate_template.timeout, - metadata: metadata, - retry_policy: @config.rpcs.create_certificate_template.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @certificate_authority_service_stub.call_rpc :create_certificate_template, 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 - - ## - # DeleteCertificateTemplate deletes a - # {::Google::Cloud::Security::PrivateCA::V1::CertificateTemplate CertificateTemplate}. - # - # @overload delete_certificate_template(request, options = nil) - # Pass arguments to `delete_certificate_template` via a request object, either of type - # {::Google::Cloud::Security::PrivateCA::V1::DeleteCertificateTemplateRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Security::PrivateCA::V1::DeleteCertificateTemplateRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_certificate_template(name: nil, request_id: nil) - # Pass arguments to `delete_certificate_template` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param name [::String] - # Required. The resource name for this - # {::Google::Cloud::Security::PrivateCA::V1::CertificateTemplate CertificateTemplate} - # in the format `projects/*/locations/*/certificateTemplates/*`. - # @param request_id [::String] - # Optional. An ID to identify requests. Specify a unique request ID so that - # if you must retry your request, the server will know to ignore the request - # if it has already been completed. The server will guarantee that for at - # least 60 minutes since the first request. - # - # For example, consider a situation where you make an initial request and - # the request times out. If you make the request again with the same request - # ID, the server can check if original operation with the same request ID - # was received, and if so, will ignore the second request. This prevents - # clients from accidentally creating duplicate commitments. - # - # The request ID must be a valid UUID with the exception that zero UUID is - # not supported (00000000-0000-0000-0000-000000000000). - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Gapic::Operation] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Gapic::Operation] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/cloud/security/private_ca/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Security::PrivateCA::V1::CertificateAuthorityService::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Security::PrivateCA::V1::DeleteCertificateTemplateRequest.new - # - # # Call the delete_certificate_template method. - # result = client.delete_certificate_template 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_certificate_template request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Security::PrivateCA::V1::DeleteCertificateTemplateRequest - - # Converts hash 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_certificate_template.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::Security::PrivateCA::V1::VERSION - metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - header_params = {} - if request.name - header_params["name"] = request.name - end - - request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") - metadata[:"x-goog-request-params"] ||= request_params_header - - options.apply_defaults timeout: @config.rpcs.delete_certificate_template.timeout, - metadata: metadata, - retry_policy: @config.rpcs.delete_certificate_template.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @certificate_authority_service_stub.call_rpc :delete_certificate_template, request, options: options do |response, operation| - response = ::Gapic::Operation.new response, @operations_client, options: options - yield response, operation if block_given? - throw :response, response - end - rescue ::GRPC::BadStatus => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Returns a - # {::Google::Cloud::Security::PrivateCA::V1::CertificateTemplate CertificateTemplate}. - # - # @overload get_certificate_template(request, options = nil) - # Pass arguments to `get_certificate_template` via a request object, either of type - # {::Google::Cloud::Security::PrivateCA::V1::GetCertificateTemplateRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Security::PrivateCA::V1::GetCertificateTemplateRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_certificate_template(name: nil) - # Pass arguments to `get_certificate_template` via keyword arguments. Note that at - # least one keyword argument is 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 - # {::Google::Cloud::Security::PrivateCA::V1::CertificateTemplate#name name} of the - # {::Google::Cloud::Security::PrivateCA::V1::CertificateTemplate CertificateTemplate} - # to get. - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Google::Cloud::Security::PrivateCA::V1::CertificateTemplate] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Google::Cloud::Security::PrivateCA::V1::CertificateTemplate] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/cloud/security/private_ca/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Security::PrivateCA::V1::CertificateAuthorityService::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Security::PrivateCA::V1::GetCertificateTemplateRequest.new - # - # # Call the get_certificate_template method. - # result = client.get_certificate_template request - # - # # The returned object is of type Google::Cloud::Security::PrivateCA::V1::CertificateTemplate. - # p result - # - def get_certificate_template request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Security::PrivateCA::V1::GetCertificateTemplateRequest - - # Converts hash 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_certificate_template.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::Security::PrivateCA::V1::VERSION - metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - header_params = {} - if request.name - header_params["name"] = request.name - end - - request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") - metadata[:"x-goog-request-params"] ||= request_params_header - - options.apply_defaults timeout: @config.rpcs.get_certificate_template.timeout, - metadata: metadata, - retry_policy: @config.rpcs.get_certificate_template.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @certificate_authority_service_stub.call_rpc :get_certificate_template, request, options: options do |response, operation| - yield response, operation if block_given? - end - rescue ::GRPC::BadStatus => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Lists - # {::Google::Cloud::Security::PrivateCA::V1::CertificateTemplate CertificateTemplates}. - # - # @overload list_certificate_templates(request, options = nil) - # Pass arguments to `list_certificate_templates` via a request object, either of type - # {::Google::Cloud::Security::PrivateCA::V1::ListCertificateTemplatesRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Security::PrivateCA::V1::ListCertificateTemplatesRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_certificate_templates(parent: nil, page_size: nil, page_token: nil, filter: nil, order_by: nil) - # Pass arguments to `list_certificate_templates` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param parent [::String] - # Required. The resource name of the location associated with the - # {::Google::Cloud::Security::PrivateCA::V1::CertificateTemplate CertificateTemplates}, - # in the format `projects/*/locations/*`. - # @param page_size [::Integer] - # Optional. Limit on the number of - # {::Google::Cloud::Security::PrivateCA::V1::CertificateTemplate CertificateTemplates} - # to include in the response. Further - # {::Google::Cloud::Security::PrivateCA::V1::CertificateTemplate CertificateTemplates} - # can subsequently be obtained by including the - # {::Google::Cloud::Security::PrivateCA::V1::ListCertificateTemplatesResponse#next_page_token ListCertificateTemplatesResponse.next_page_token} - # in a subsequent request. If unspecified, the server will pick an - # appropriate default. - # @param page_token [::String] - # Optional. Pagination token, returned earlier via - # {::Google::Cloud::Security::PrivateCA::V1::ListCertificateTemplatesResponse#next_page_token ListCertificateTemplatesResponse.next_page_token}. - # @param filter [::String] - # Optional. Only include resources that match the filter in the response. - # @param order_by [::String] - # Optional. Specify how the results should be sorted. - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Gapic::PagedEnumerable<::Google::Cloud::Security::PrivateCA::V1::CertificateTemplate>] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Gapic::PagedEnumerable<::Google::Cloud::Security::PrivateCA::V1::CertificateTemplate>] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/cloud/security/private_ca/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Security::PrivateCA::V1::CertificateAuthorityService::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Security::PrivateCA::V1::ListCertificateTemplatesRequest.new - # - # # Call the list_certificate_templates method. - # result = client.list_certificate_templates request - # - # # The returned object is of type Gapic::PagedEnumerable. You can iterate - # # over elements, and API calls will be issued to fetch pages as needed. - # result.each do |item| - # # Each element is of type ::Google::Cloud::Security::PrivateCA::V1::CertificateTemplate. - # p item - # end - # - def list_certificate_templates request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Security::PrivateCA::V1::ListCertificateTemplatesRequest - - # Converts hash 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_certificate_templates.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::Security::PrivateCA::V1::VERSION - metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - header_params = {} - if request.parent - header_params["parent"] = request.parent - end - - request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") - metadata[:"x-goog-request-params"] ||= request_params_header - - options.apply_defaults timeout: @config.rpcs.list_certificate_templates.timeout, - metadata: metadata, - retry_policy: @config.rpcs.list_certificate_templates.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @certificate_authority_service_stub.call_rpc :list_certificate_templates, request, options: options do |response, operation| - response = ::Gapic::PagedEnumerable.new @certificate_authority_service_stub, :list_certificate_templates, 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 - - ## - # Update a - # {::Google::Cloud::Security::PrivateCA::V1::CertificateTemplate CertificateTemplate}. - # - # @overload update_certificate_template(request, options = nil) - # Pass arguments to `update_certificate_template` via a request object, either of type - # {::Google::Cloud::Security::PrivateCA::V1::UpdateCertificateTemplateRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Security::PrivateCA::V1::UpdateCertificateTemplateRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_certificate_template(certificate_template: nil, update_mask: nil, request_id: nil) - # Pass arguments to `update_certificate_template` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param certificate_template [::Google::Cloud::Security::PrivateCA::V1::CertificateTemplate, ::Hash] - # Required. - # {::Google::Cloud::Security::PrivateCA::V1::CertificateTemplate CertificateTemplate} - # with updated values. - # @param update_mask [::Google::Protobuf::FieldMask, ::Hash] - # Required. A list of fields to be updated in this request. - # @param request_id [::String] - # Optional. An ID to identify requests. Specify a unique request ID so that - # if you must retry your request, the server will know to ignore the request - # if it has already been completed. The server will guarantee that for at - # least 60 minutes since the first request. - # - # For example, consider a situation where you make an initial request and - # the request times out. If you make the request again with the same request - # ID, the server can check if original operation with the same request ID - # was received, and if so, will ignore the second request. This prevents - # clients from accidentally creating duplicate commitments. - # - # The request ID must be a valid UUID with the exception that zero UUID is - # not supported (00000000-0000-0000-0000-000000000000). - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Gapic::Operation] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Gapic::Operation] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/cloud/security/private_ca/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Security::PrivateCA::V1::CertificateAuthorityService::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Security::PrivateCA::V1::UpdateCertificateTemplateRequest.new - # - # # Call the update_certificate_template method. - # result = client.update_certificate_template 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_certificate_template request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Security::PrivateCA::V1::UpdateCertificateTemplateRequest - - # Converts hash 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_certificate_template.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::Security::PrivateCA::V1::VERSION - metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - header_params = {} - if request.certificate_template&.name - header_params["certificate_template.name"] = request.certificate_template.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_certificate_template.timeout, - metadata: metadata, - retry_policy: @config.rpcs.update_certificate_template.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @certificate_authority_service_stub.call_rpc :update_certificate_template, 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 CertificateAuthorityService API. - # - # This class represents the configuration for CertificateAuthorityService, - # providing control over timeouts, retry behavior, logging, transport - # parameters, and other low-level controls. Certain parameters can also be - # applied individually to specific RPCs. See - # {::Google::Cloud::Security::PrivateCA::V1::CertificateAuthorityService::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_certificate to 20 seconds, - # # and all remaining timeouts to 10 seconds. - # ::Google::Cloud::Security::PrivateCA::V1::CertificateAuthorityService::Client.configure do |config| - # config.timeout = 10.0 - # config.rpcs.create_certificate.timeout = 20.0 - # end - # - # # Apply the above configuration only to a new client. - # client = ::Google::Cloud::Security::PrivateCA::V1::CertificateAuthorityService::Client.new do |config| - # config.timeout = 10.0 - # config.rpcs.create_certificate.timeout = 20.0 - # end - # - # @!attribute [rw] endpoint - # A custom service endpoint, as a hostname or hostname:port. The default is - # nil, indicating to use the default endpoint in the current universe domain. - # @return [::String,nil] - # @!attribute [rw] credentials - # Credentials to send with calls. You may provide any of the following types: - # * (`Google::Auth::Credentials`) A googleauth credentials object - # (see the [googleauth docs](https://rubydoc.info/gems/googleauth/Google/Auth/Credentials)) - # * (`Signet::OAuth2::Client`) A signet oauth2 client object - # (see the [signet docs](https://rubydoc.info/gems/signet/Signet/OAuth2/Client)) - # * (`GRPC::Core::Channel`) a gRPC channel with included credentials - # * (`GRPC::Core::ChannelCredentials`) a gRPC credentails object - # * (`nil`) indicating no credentials - # - # @note Warning: Passing a `String` to a keyfile path or a `Hash` of credentials - # is deprecated. Providing an unvalidated credential configuration to - # Google APIs can compromise the security of your systems and data. - # - # @example - # - # # The recommended way to provide credentials is to use the `make_creds` method - # # on the appropriate credentials class for your environment. - # - # require "googleauth" - # - # credentials = ::Google::Auth::ServiceAccountCredentials.make_creds( - # json_key_io: ::File.open("/path/to/keyfile.json") - # ) - # - # client = ::Google::Cloud::Security::PrivateCA::V1::CertificateAuthorityService::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 = "privateca.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 CertificateAuthorityService 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_certificate` - # @return [::Gapic::Config::Method] - # - attr_reader :create_certificate - ## - # RPC-specific configuration for `get_certificate` - # @return [::Gapic::Config::Method] - # - attr_reader :get_certificate - ## - # RPC-specific configuration for `list_certificates` - # @return [::Gapic::Config::Method] - # - attr_reader :list_certificates - ## - # RPC-specific configuration for `revoke_certificate` - # @return [::Gapic::Config::Method] - # - attr_reader :revoke_certificate - ## - # RPC-specific configuration for `update_certificate` - # @return [::Gapic::Config::Method] - # - attr_reader :update_certificate - ## - # RPC-specific configuration for `activate_certificate_authority` - # @return [::Gapic::Config::Method] - # - attr_reader :activate_certificate_authority - ## - # RPC-specific configuration for `create_certificate_authority` - # @return [::Gapic::Config::Method] - # - attr_reader :create_certificate_authority - ## - # RPC-specific configuration for `disable_certificate_authority` - # @return [::Gapic::Config::Method] - # - attr_reader :disable_certificate_authority - ## - # RPC-specific configuration for `enable_certificate_authority` - # @return [::Gapic::Config::Method] - # - attr_reader :enable_certificate_authority - ## - # RPC-specific configuration for `fetch_certificate_authority_csr` - # @return [::Gapic::Config::Method] - # - attr_reader :fetch_certificate_authority_csr - ## - # RPC-specific configuration for `get_certificate_authority` - # @return [::Gapic::Config::Method] - # - attr_reader :get_certificate_authority - ## - # RPC-specific configuration for `list_certificate_authorities` - # @return [::Gapic::Config::Method] - # - attr_reader :list_certificate_authorities - ## - # RPC-specific configuration for `undelete_certificate_authority` - # @return [::Gapic::Config::Method] - # - attr_reader :undelete_certificate_authority - ## - # RPC-specific configuration for `delete_certificate_authority` - # @return [::Gapic::Config::Method] - # - attr_reader :delete_certificate_authority - ## - # RPC-specific configuration for `update_certificate_authority` - # @return [::Gapic::Config::Method] - # - attr_reader :update_certificate_authority - ## - # RPC-specific configuration for `create_ca_pool` - # @return [::Gapic::Config::Method] - # - attr_reader :create_ca_pool - ## - # RPC-specific configuration for `update_ca_pool` - # @return [::Gapic::Config::Method] - # - attr_reader :update_ca_pool - ## - # RPC-specific configuration for `get_ca_pool` - # @return [::Gapic::Config::Method] - # - attr_reader :get_ca_pool - ## - # RPC-specific configuration for `list_ca_pools` - # @return [::Gapic::Config::Method] - # - attr_reader :list_ca_pools - ## - # RPC-specific configuration for `delete_ca_pool` - # @return [::Gapic::Config::Method] - # - attr_reader :delete_ca_pool - ## - # RPC-specific configuration for `fetch_ca_certs` - # @return [::Gapic::Config::Method] - # - attr_reader :fetch_ca_certs - ## - # RPC-specific configuration for `get_certificate_revocation_list` - # @return [::Gapic::Config::Method] - # - attr_reader :get_certificate_revocation_list - ## - # RPC-specific configuration for `list_certificate_revocation_lists` - # @return [::Gapic::Config::Method] - # - attr_reader :list_certificate_revocation_lists - ## - # RPC-specific configuration for `update_certificate_revocation_list` - # @return [::Gapic::Config::Method] - # - attr_reader :update_certificate_revocation_list - ## - # RPC-specific configuration for `create_certificate_template` - # @return [::Gapic::Config::Method] - # - attr_reader :create_certificate_template - ## - # RPC-specific configuration for `delete_certificate_template` - # @return [::Gapic::Config::Method] - # - attr_reader :delete_certificate_template - ## - # RPC-specific configuration for `get_certificate_template` - # @return [::Gapic::Config::Method] - # - attr_reader :get_certificate_template - ## - # RPC-specific configuration for `list_certificate_templates` - # @return [::Gapic::Config::Method] - # - attr_reader :list_certificate_templates - ## - # RPC-specific configuration for `update_certificate_template` - # @return [::Gapic::Config::Method] - # - attr_reader :update_certificate_template - - # @private - def initialize parent_rpcs = nil - create_certificate_config = parent_rpcs.create_certificate if parent_rpcs.respond_to? :create_certificate - @create_certificate = ::Gapic::Config::Method.new create_certificate_config - get_certificate_config = parent_rpcs.get_certificate if parent_rpcs.respond_to? :get_certificate - @get_certificate = ::Gapic::Config::Method.new get_certificate_config - list_certificates_config = parent_rpcs.list_certificates if parent_rpcs.respond_to? :list_certificates - @list_certificates = ::Gapic::Config::Method.new list_certificates_config - revoke_certificate_config = parent_rpcs.revoke_certificate if parent_rpcs.respond_to? :revoke_certificate - @revoke_certificate = ::Gapic::Config::Method.new revoke_certificate_config - update_certificate_config = parent_rpcs.update_certificate if parent_rpcs.respond_to? :update_certificate - @update_certificate = ::Gapic::Config::Method.new update_certificate_config - activate_certificate_authority_config = parent_rpcs.activate_certificate_authority if parent_rpcs.respond_to? :activate_certificate_authority - @activate_certificate_authority = ::Gapic::Config::Method.new activate_certificate_authority_config - create_certificate_authority_config = parent_rpcs.create_certificate_authority if parent_rpcs.respond_to? :create_certificate_authority - @create_certificate_authority = ::Gapic::Config::Method.new create_certificate_authority_config - disable_certificate_authority_config = parent_rpcs.disable_certificate_authority if parent_rpcs.respond_to? :disable_certificate_authority - @disable_certificate_authority = ::Gapic::Config::Method.new disable_certificate_authority_config - enable_certificate_authority_config = parent_rpcs.enable_certificate_authority if parent_rpcs.respond_to? :enable_certificate_authority - @enable_certificate_authority = ::Gapic::Config::Method.new enable_certificate_authority_config - fetch_certificate_authority_csr_config = parent_rpcs.fetch_certificate_authority_csr if parent_rpcs.respond_to? :fetch_certificate_authority_csr - @fetch_certificate_authority_csr = ::Gapic::Config::Method.new fetch_certificate_authority_csr_config - get_certificate_authority_config = parent_rpcs.get_certificate_authority if parent_rpcs.respond_to? :get_certificate_authority - @get_certificate_authority = ::Gapic::Config::Method.new get_certificate_authority_config - list_certificate_authorities_config = parent_rpcs.list_certificate_authorities if parent_rpcs.respond_to? :list_certificate_authorities - @list_certificate_authorities = ::Gapic::Config::Method.new list_certificate_authorities_config - undelete_certificate_authority_config = parent_rpcs.undelete_certificate_authority if parent_rpcs.respond_to? :undelete_certificate_authority - @undelete_certificate_authority = ::Gapic::Config::Method.new undelete_certificate_authority_config - delete_certificate_authority_config = parent_rpcs.delete_certificate_authority if parent_rpcs.respond_to? :delete_certificate_authority - @delete_certificate_authority = ::Gapic::Config::Method.new delete_certificate_authority_config - update_certificate_authority_config = parent_rpcs.update_certificate_authority if parent_rpcs.respond_to? :update_certificate_authority - @update_certificate_authority = ::Gapic::Config::Method.new update_certificate_authority_config - create_ca_pool_config = parent_rpcs.create_ca_pool if parent_rpcs.respond_to? :create_ca_pool - @create_ca_pool = ::Gapic::Config::Method.new create_ca_pool_config - update_ca_pool_config = parent_rpcs.update_ca_pool if parent_rpcs.respond_to? :update_ca_pool - @update_ca_pool = ::Gapic::Config::Method.new update_ca_pool_config - get_ca_pool_config = parent_rpcs.get_ca_pool if parent_rpcs.respond_to? :get_ca_pool - @get_ca_pool = ::Gapic::Config::Method.new get_ca_pool_config - list_ca_pools_config = parent_rpcs.list_ca_pools if parent_rpcs.respond_to? :list_ca_pools - @list_ca_pools = ::Gapic::Config::Method.new list_ca_pools_config - delete_ca_pool_config = parent_rpcs.delete_ca_pool if parent_rpcs.respond_to? :delete_ca_pool - @delete_ca_pool = ::Gapic::Config::Method.new delete_ca_pool_config - fetch_ca_certs_config = parent_rpcs.fetch_ca_certs if parent_rpcs.respond_to? :fetch_ca_certs - @fetch_ca_certs = ::Gapic::Config::Method.new fetch_ca_certs_config - get_certificate_revocation_list_config = parent_rpcs.get_certificate_revocation_list if parent_rpcs.respond_to? :get_certificate_revocation_list - @get_certificate_revocation_list = ::Gapic::Config::Method.new get_certificate_revocation_list_config - list_certificate_revocation_lists_config = parent_rpcs.list_certificate_revocation_lists if parent_rpcs.respond_to? :list_certificate_revocation_lists - @list_certificate_revocation_lists = ::Gapic::Config::Method.new list_certificate_revocation_lists_config - update_certificate_revocation_list_config = parent_rpcs.update_certificate_revocation_list if parent_rpcs.respond_to? :update_certificate_revocation_list - @update_certificate_revocation_list = ::Gapic::Config::Method.new update_certificate_revocation_list_config - create_certificate_template_config = parent_rpcs.create_certificate_template if parent_rpcs.respond_to? :create_certificate_template - @create_certificate_template = ::Gapic::Config::Method.new create_certificate_template_config - delete_certificate_template_config = parent_rpcs.delete_certificate_template if parent_rpcs.respond_to? :delete_certificate_template - @delete_certificate_template = ::Gapic::Config::Method.new delete_certificate_template_config - get_certificate_template_config = parent_rpcs.get_certificate_template if parent_rpcs.respond_to? :get_certificate_template - @get_certificate_template = ::Gapic::Config::Method.new get_certificate_template_config - list_certificate_templates_config = parent_rpcs.list_certificate_templates if parent_rpcs.respond_to? :list_certificate_templates - @list_certificate_templates = ::Gapic::Config::Method.new list_certificate_templates_config - update_certificate_template_config = parent_rpcs.update_certificate_template if parent_rpcs.respond_to? :update_certificate_template - @update_certificate_template = ::Gapic::Config::Method.new update_certificate_template_config - - yield self if block_given? - end - end - end - end - end - end - end - end - end -end diff --git a/owl-bot-staging/google-cloud-security-private_ca-v1/lib/google/cloud/security/private_ca/v1/certificate_authority_service/credentials.rb b/owl-bot-staging/google-cloud-security-private_ca-v1/lib/google/cloud/security/private_ca/v1/certificate_authority_service/credentials.rb deleted file mode 100644 index 47ad11aa913e..000000000000 --- a/owl-bot-staging/google-cloud-security-private_ca-v1/lib/google/cloud/security/private_ca/v1/certificate_authority_service/credentials.rb +++ /dev/null @@ -1,53 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -require "googleauth" - -module Google - module Cloud - module Security - module PrivateCA - module V1 - module CertificateAuthorityService - # Credentials for the CertificateAuthorityService API. - class Credentials < ::Google::Auth::Credentials - self.scope = [ - "https://www.googleapis.com/auth/cloud-platform" - ] - self.env_vars = [ - "PRIVATE_CA_CREDENTIALS", - "PRIVATE_CA_KEYFILE", - "GOOGLE_CLOUD_CREDENTIALS", - "GOOGLE_CLOUD_KEYFILE", - "GCLOUD_KEYFILE", - "PRIVATE_CA_CREDENTIALS_JSON", - "PRIVATE_CA_KEYFILE_JSON", - "GOOGLE_CLOUD_CREDENTIALS_JSON", - "GOOGLE_CLOUD_KEYFILE_JSON", - "GCLOUD_KEYFILE_JSON" - ] - self.paths = [ - "~/.config/google_cloud/application_default_credentials.json" - ] - end - end - end - end - end - end -end diff --git a/owl-bot-staging/google-cloud-security-private_ca-v1/lib/google/cloud/security/private_ca/v1/certificate_authority_service/operations.rb b/owl-bot-staging/google-cloud-security-private_ca-v1/lib/google/cloud/security/private_ca/v1/certificate_authority_service/operations.rb deleted file mode 100644 index c1947a1cadbd..000000000000 --- a/owl-bot-staging/google-cloud-security-private_ca-v1/lib/google/cloud/security/private_ca/v1/certificate_authority_service/operations.rb +++ /dev/null @@ -1,843 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -require "gapic/operation" -require "google/longrunning/operations_pb" - -module Google - module Cloud - module Security - module PrivateCA - module V1 - module CertificateAuthorityService - # Service that implements Longrunning Operations API. - class Operations - # @private - API_VERSION = "" - - # @private - DEFAULT_ENDPOINT_TEMPLATE = "privateca.$UNIVERSE_DOMAIN$" - - # @private - attr_reader :operations_stub - - ## - # Configuration for the CertificateAuthorityService 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 CertificateAuthorityService 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::Security::PrivateCA::V1::VERSION - metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - header_params = {} - if request.name - header_params["name"] = request.name - end - - request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") - metadata[:"x-goog-request-params"] ||= request_params_header - - options.apply_defaults timeout: @config.rpcs.list_operations.timeout, - metadata: metadata, - retry_policy: @config.rpcs.list_operations.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @operations_stub.call_rpc :list_operations, request, options: options do |response, operation| - wrap_lro_operation = ->(op_response) { ::Gapic::Operation.new op_response, @operations_client } - response = ::Gapic::PagedEnumerable.new @operations_stub, :list_operations, request, response, operation, options, format_resource: wrap_lro_operation - yield response, operation if block_given? - 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::Security::PrivateCA::V1::VERSION - metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - header_params = {} - if request.name - header_params["name"] = request.name - end - - request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") - metadata[:"x-goog-request-params"] ||= request_params_header - - options.apply_defaults timeout: @config.rpcs.get_operation.timeout, - metadata: metadata, - retry_policy: @config.rpcs.get_operation.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @operations_stub.call_rpc :get_operation, request, options: options do |response, operation| - response = ::Gapic::Operation.new response, @operations_client, options: options - yield response, operation if block_given? - 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::Security::PrivateCA::V1::VERSION - metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - header_params = {} - if request.name - header_params["name"] = request.name - end - - request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") - metadata[:"x-goog-request-params"] ||= request_params_header - - options.apply_defaults timeout: @config.rpcs.delete_operation.timeout, - metadata: metadata, - retry_policy: @config.rpcs.delete_operation.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @operations_stub.call_rpc :delete_operation, request, options: options do |response, operation| - yield response, operation if block_given? - 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::Security::PrivateCA::V1::VERSION - metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - header_params = {} - if request.name - header_params["name"] = request.name - end - - request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") - metadata[:"x-goog-request-params"] ||= request_params_header - - options.apply_defaults timeout: @config.rpcs.cancel_operation.timeout, - metadata: metadata, - retry_policy: @config.rpcs.cancel_operation.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @operations_stub.call_rpc :cancel_operation, request, options: options do |response, operation| - yield response, operation if block_given? - 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::Security::PrivateCA::V1::VERSION - metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - options.apply_defaults timeout: @config.rpcs.wait_operation.timeout, - metadata: metadata, - retry_policy: @config.rpcs.wait_operation.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @operations_stub.call_rpc :wait_operation, request, options: options do |response, operation| - response = ::Gapic::Operation.new response, @operations_client, options: options - yield response, operation if block_given? - 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 = "privateca.googleapis.com" - - config_attr :endpoint, nil, ::String, nil - config_attr :credentials, nil do |value| - allowed = [::String, ::Hash, ::Proc, ::Symbol, ::Google::Auth::Credentials, ::Google::Auth::BaseClient, ::Signet::OAuth2::Client, nil] - allowed += [::GRPC::Core::Channel, ::GRPC::Core::ChannelCredentials] if defined? ::GRPC::Core::Channel - allowed.any? { |klass| klass === value } - end - config_attr :scope, nil, ::String, ::Array, nil - config_attr :lib_name, nil, ::String, nil - config_attr :lib_version, nil, ::String, nil - config_attr(:channel_args, { "grpc.service_config_disable_resolution" => 1 }, ::Hash, nil) - config_attr :interceptors, nil, ::Array, nil - config_attr :timeout, nil, ::Numeric, nil - config_attr :metadata, nil, ::Hash, nil - config_attr :retry_policy, nil, ::Hash, ::Proc, nil - config_attr :quota_project, nil, ::String, nil - config_attr :universe_domain, nil, ::String, nil - config_attr :logger, :default, ::Logger, nil, :default - - # @private - def initialize parent_config = nil - @parent_config = parent_config unless parent_config.nil? - - yield self if block_given? - end - - ## - # Configurations for individual RPCs - # @return [Rpcs] - # - def rpcs - @rpcs ||= begin - parent_rpcs = nil - parent_rpcs = @parent_config.rpcs if defined?(@parent_config) && @parent_config.respond_to?(:rpcs) - Rpcs.new parent_rpcs - end - end - - ## - # Configuration for the channel pool - # @return [::Gapic::ServiceStub::ChannelPool::Configuration] - # - def channel_pool - @channel_pool ||= ::Gapic::ServiceStub::ChannelPool::Configuration.new - end - - ## - # Configuration RPC class for the Operations API. - # - # Includes fields providing the configuration for each RPC in this service. - # Each configuration object is of type `Gapic::Config::Method` and includes - # the following configuration fields: - # - # * `timeout` (*type:* `Numeric`) - The call timeout in seconds - # * `metadata` (*type:* `Hash{Symbol=>String}`) - Additional gRPC headers - # * `retry_policy (*type:* `Hash`) - The retry policy. The policy fields - # include the following keys: - # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds. - # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds. - # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier. - # * `:retry_codes` (*type:* `Array`) - The error codes that should - # trigger a retry. - # - class Rpcs - ## - # RPC-specific configuration for `list_operations` - # @return [::Gapic::Config::Method] - # - attr_reader :list_operations - ## - # RPC-specific configuration for `get_operation` - # @return [::Gapic::Config::Method] - # - attr_reader :get_operation - ## - # RPC-specific configuration for `delete_operation` - # @return [::Gapic::Config::Method] - # - attr_reader :delete_operation - ## - # RPC-specific configuration for `cancel_operation` - # @return [::Gapic::Config::Method] - # - attr_reader :cancel_operation - ## - # RPC-specific configuration for `wait_operation` - # @return [::Gapic::Config::Method] - # - attr_reader :wait_operation - - # @private - def initialize parent_rpcs = nil - list_operations_config = parent_rpcs.list_operations if parent_rpcs.respond_to? :list_operations - @list_operations = ::Gapic::Config::Method.new list_operations_config - get_operation_config = parent_rpcs.get_operation if parent_rpcs.respond_to? :get_operation - @get_operation = ::Gapic::Config::Method.new get_operation_config - delete_operation_config = parent_rpcs.delete_operation if parent_rpcs.respond_to? :delete_operation - @delete_operation = ::Gapic::Config::Method.new delete_operation_config - cancel_operation_config = parent_rpcs.cancel_operation if parent_rpcs.respond_to? :cancel_operation - @cancel_operation = ::Gapic::Config::Method.new cancel_operation_config - wait_operation_config = parent_rpcs.wait_operation if parent_rpcs.respond_to? :wait_operation - @wait_operation = ::Gapic::Config::Method.new wait_operation_config - - yield self if block_given? - end - end - end - end - end - end - end - end - end -end diff --git a/owl-bot-staging/google-cloud-security-private_ca-v1/lib/google/cloud/security/private_ca/v1/certificate_authority_service/paths.rb b/owl-bot-staging/google-cloud-security-private_ca-v1/lib/google/cloud/security/private_ca/v1/certificate_authority_service/paths.rb deleted file mode 100644 index 57c61d556fb1..000000000000 --- a/owl-bot-staging/google-cloud-security-private_ca-v1/lib/google/cloud/security/private_ca/v1/certificate_authority_service/paths.rb +++ /dev/null @@ -1,155 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - - -module Google - module Cloud - module Security - module PrivateCA - module V1 - module CertificateAuthorityService - # Path helper methods for the CertificateAuthorityService API. - module Paths - ## - # Create a fully-qualified CaPool resource string. - # - # The resource will be in the following format: - # - # `projects/{project}/locations/{location}/caPools/{ca_pool}` - # - # @param project [String] - # @param location [String] - # @param ca_pool [String] - # - # @return [::String] - def ca_pool_path project:, location:, ca_pool: - raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" - raise ::ArgumentError, "location cannot contain /" if location.to_s.include? "/" - - "projects/#{project}/locations/#{location}/caPools/#{ca_pool}" - end - - ## - # Create a fully-qualified Certificate resource string. - # - # The resource will be in the following format: - # - # `projects/{project}/locations/{location}/caPools/{ca_pool}/certificates/{certificate}` - # - # @param project [String] - # @param location [String] - # @param ca_pool [String] - # @param certificate [String] - # - # @return [::String] - def certificate_path project:, location:, ca_pool:, certificate: - raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" - raise ::ArgumentError, "location cannot contain /" if location.to_s.include? "/" - raise ::ArgumentError, "ca_pool cannot contain /" if ca_pool.to_s.include? "/" - - "projects/#{project}/locations/#{location}/caPools/#{ca_pool}/certificates/#{certificate}" - end - - ## - # Create a fully-qualified CertificateAuthority resource string. - # - # The resource will be in the following format: - # - # `projects/{project}/locations/{location}/caPools/{ca_pool}/certificateAuthorities/{certificate_authority}` - # - # @param project [String] - # @param location [String] - # @param ca_pool [String] - # @param certificate_authority [String] - # - # @return [::String] - def certificate_authority_path project:, location:, ca_pool:, certificate_authority: - raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" - raise ::ArgumentError, "location cannot contain /" if location.to_s.include? "/" - raise ::ArgumentError, "ca_pool cannot contain /" if ca_pool.to_s.include? "/" - - "projects/#{project}/locations/#{location}/caPools/#{ca_pool}/certificateAuthorities/#{certificate_authority}" - end - - ## - # Create a fully-qualified CertificateRevocationList resource string. - # - # The resource will be in the following format: - # - # `projects/{project}/locations/{location}/caPools/{ca_pool}/certificateAuthorities/{certificate_authority}/certificateRevocationLists/{certificate_revocation_list}` - # - # @param project [String] - # @param location [String] - # @param ca_pool [String] - # @param certificate_authority [String] - # @param certificate_revocation_list [String] - # - # @return [::String] - def certificate_revocation_list_path project:, location:, ca_pool:, certificate_authority:, certificate_revocation_list: - raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" - raise ::ArgumentError, "location cannot contain /" if location.to_s.include? "/" - raise ::ArgumentError, "ca_pool cannot contain /" if ca_pool.to_s.include? "/" - raise ::ArgumentError, "certificate_authority cannot contain /" if certificate_authority.to_s.include? "/" - - "projects/#{project}/locations/#{location}/caPools/#{ca_pool}/certificateAuthorities/#{certificate_authority}/certificateRevocationLists/#{certificate_revocation_list}" - end - - ## - # Create a fully-qualified CertificateTemplate resource string. - # - # The resource will be in the following format: - # - # `projects/{project}/locations/{location}/certificateTemplates/{certificate_template}` - # - # @param project [String] - # @param location [String] - # @param certificate_template [String] - # - # @return [::String] - def certificate_template_path project:, location:, certificate_template: - raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" - raise ::ArgumentError, "location cannot contain /" if location.to_s.include? "/" - - "projects/#{project}/locations/#{location}/certificateTemplates/#{certificate_template}" - 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 - - extend self - end - end - end - end - end - end -end diff --git a/owl-bot-staging/google-cloud-security-private_ca-v1/lib/google/cloud/security/private_ca/v1/certificate_authority_service/rest.rb b/owl-bot-staging/google-cloud-security-private_ca-v1/lib/google/cloud/security/private_ca/v1/certificate_authority_service/rest.rb deleted file mode 100644 index 04c2876adc55..000000000000 --- a/owl-bot-staging/google-cloud-security-private_ca-v1/lib/google/cloud/security/private_ca/v1/certificate_authority_service/rest.rb +++ /dev/null @@ -1,58 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -require "gapic/rest" -require "gapic/config" -require "gapic/config/method" - -require "google/cloud/security/private_ca/v1/version" -require "google/cloud/security/private_ca/v1/bindings_override" - -require "google/cloud/security/private_ca/v1/certificate_authority_service/credentials" -require "google/cloud/security/private_ca/v1/certificate_authority_service/paths" -require "google/cloud/security/private_ca/v1/certificate_authority_service/rest/operations" -require "google/cloud/security/private_ca/v1/certificate_authority_service/rest/client" - -module Google - module Cloud - module Security - module PrivateCA - module V1 - ## - # [Certificate Authority - # Service][google.cloud.security.privateca.v1.CertificateAuthorityService] - # manages private certificate authorities and issued certificates. - # - # To load this service and instantiate a REST client: - # - # require "google/cloud/security/private_ca/v1/certificate_authority_service/rest" - # client = ::Google::Cloud::Security::PrivateCA::V1::CertificateAuthorityService::Rest::Client.new - # - module CertificateAuthorityService - # Client for the REST transport - module Rest - end - end - end - end - end - end -end - -helper_path = ::File.join __dir__, "rest", "helpers.rb" -require "google/cloud/security/private_ca/v1/certificate_authority_service/rest/helpers" if ::File.file? helper_path diff --git a/owl-bot-staging/google-cloud-security-private_ca-v1/lib/google/cloud/security/private_ca/v1/certificate_authority_service/rest/client.rb b/owl-bot-staging/google-cloud-security-private_ca-v1/lib/google/cloud/security/private_ca/v1/certificate_authority_service/rest/client.rb deleted file mode 100644 index ece5850c8a47..000000000000 --- a/owl-bot-staging/google-cloud-security-private_ca-v1/lib/google/cloud/security/private_ca/v1/certificate_authority_service/rest/client.rb +++ /dev/null @@ -1,3567 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -require "google/cloud/errors" -require "google/cloud/security/privateca/v1/service_pb" -require "google/cloud/security/private_ca/v1/certificate_authority_service/rest/service_stub" -require "google/cloud/location/rest" -require "google/iam/v1/rest" - -module Google - module Cloud - module Security - module PrivateCA - module V1 - module CertificateAuthorityService - module Rest - ## - # REST client for the CertificateAuthorityService service. - # - # [Certificate Authority - # Service][google.cloud.security.privateca.v1.CertificateAuthorityService] - # manages private certificate authorities and issued certificates. - # - class Client - # @private - API_VERSION = "" - - # @private - DEFAULT_ENDPOINT_TEMPLATE = "privateca.$UNIVERSE_DOMAIN$" - - include Paths - - # @private - attr_reader :certificate_authority_service_stub - - ## - # Configure the CertificateAuthorityService Client class. - # - # See {::Google::Cloud::Security::PrivateCA::V1::CertificateAuthorityService::Rest::Client::Configuration} - # for a description of the configuration fields. - # - # @example - # - # # Modify the configuration for all CertificateAuthorityService clients - # ::Google::Cloud::Security::PrivateCA::V1::CertificateAuthorityService::Rest::Client.configure do |config| - # config.timeout = 10.0 - # end - # - # @yield [config] Configure the Client client. - # @yieldparam config [Client::Configuration] - # - # @return [Client::Configuration] - # - def self.configure - @configure ||= begin - namespace = ["Google", "Cloud", "Security", "PrivateCA", "V1"] - parent_config = while namespace.any? - parent_name = namespace.join "::" - parent_const = const_get parent_name - break parent_const.configure if parent_const.respond_to? :configure - namespace.pop - end - default_config = Client::Configuration.new parent_config - - default_config.timeout = 60.0 - default_config.retry_policy = { - initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [2, 14, 4] - } - - default_config - end - yield @configure if block_given? - @configure - end - - ## - # Configure the CertificateAuthorityService Client instance. - # - # The configuration is set to the derived mode, meaning that values can be changed, - # but structural changes (adding new fields, etc.) are not allowed. Structural changes - # should be made on {Client.configure}. - # - # See {::Google::Cloud::Security::PrivateCA::V1::CertificateAuthorityService::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 - @certificate_authority_service_stub.universe_domain - end - - ## - # Create a new CertificateAuthorityService REST client object. - # - # @example - # - # # Create a client using the default configuration - # client = ::Google::Cloud::Security::PrivateCA::V1::CertificateAuthorityService::Rest::Client.new - # - # # Create a client using a custom configuration - # client = ::Google::Cloud::Security::PrivateCA::V1::CertificateAuthorityService::Rest::Client.new do |config| - # config.timeout = 10.0 - # end - # - # @yield [config] Configure the CertificateAuthorityService client. - # @yieldparam config [Client::Configuration] - # - def initialize - # Create the configuration object - @config = Configuration.new Client.configure - - # Yield the configuration if needed - yield @config if block_given? - - # Create credentials - credentials = @config.credentials - # Use self-signed JWT if the endpoint is unchanged from default, - # but only if the default endpoint does not have a region prefix. - enable_self_signed_jwt = @config.endpoint.nil? || - (@config.endpoint == Configuration::DEFAULT_ENDPOINT && - !@config.endpoint.split(".").first.include?("-")) - credentials ||= Credentials.default scope: @config.scope, - enable_self_signed_jwt: enable_self_signed_jwt - if credentials.is_a?(::String) || credentials.is_a?(::Hash) - credentials = Credentials.new credentials, scope: @config.scope - end - - @quota_project_id = @config.quota_project - @quota_project_id ||= credentials.quota_project_id if credentials.respond_to? :quota_project_id - - @operations_client = ::Google::Cloud::Security::PrivateCA::V1::CertificateAuthorityService::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 - - @certificate_authority_service_stub = ::Google::Cloud::Security::PrivateCA::V1::CertificateAuthorityService::Rest::ServiceStub.new( - endpoint: @config.endpoint, - endpoint_template: DEFAULT_ENDPOINT_TEMPLATE, - universe_domain: @config.universe_domain, - credentials: credentials, - logger: @config.logger - ) - - @certificate_authority_service_stub.logger(stub: true)&.info do |entry| - entry.set_system_name - entry.set_service - entry.message = "Created client for #{entry.service}" - entry.set_credentials_fields credentials - entry.set "customEndpoint", @config.endpoint if @config.endpoint - entry.set "defaultTimeout", @config.timeout if @config.timeout - entry.set "quotaProject", @quota_project_id if @quota_project_id - end - - @location_client = Google::Cloud::Location::Locations::Rest::Client.new do |config| - config.credentials = credentials - config.quota_project = @quota_project_id - config.endpoint = @certificate_authority_service_stub.endpoint - config.universe_domain = @certificate_authority_service_stub.universe_domain - config.bindings_override = @config.bindings_override - config.logger = @certificate_authority_service_stub.logger if config.respond_to? :logger= - end - - @iam_policy_client = Google::Iam::V1::IAMPolicy::Rest::Client.new do |config| - config.credentials = credentials - config.quota_project = @quota_project_id - config.endpoint = @certificate_authority_service_stub.endpoint - config.universe_domain = @certificate_authority_service_stub.universe_domain - config.bindings_override = @config.bindings_override - config.logger = @certificate_authority_service_stub.logger if config.respond_to? :logger= - end - end - - ## - # Get the associated client for long-running operations. - # - # @return [::Google::Cloud::Security::PrivateCA::V1::CertificateAuthorityService::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 - - ## - # Get the associated client for mix-in of the IAMPolicy. - # - # @return [Google::Iam::V1::IAMPolicy::Rest::Client] - # - attr_reader :iam_policy_client - - ## - # The logger used for request/response debug logging. - # - # @return [Logger] - # - def logger - @certificate_authority_service_stub.logger - end - - # Service calls - - ## - # Create a new {::Google::Cloud::Security::PrivateCA::V1::Certificate Certificate} - # in a given Project, Location from a particular - # {::Google::Cloud::Security::PrivateCA::V1::CaPool CaPool}. - # - # @overload create_certificate(request, options = nil) - # Pass arguments to `create_certificate` via a request object, either of type - # {::Google::Cloud::Security::PrivateCA::V1::CreateCertificateRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Security::PrivateCA::V1::CreateCertificateRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_certificate(parent: nil, certificate_id: nil, certificate: nil, request_id: nil, validate_only: nil, issuing_certificate_authority_id: nil) - # Pass arguments to `create_certificate` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param parent [::String] - # Required. The resource name of the - # {::Google::Cloud::Security::PrivateCA::V1::CaPool CaPool} associated with the - # {::Google::Cloud::Security::PrivateCA::V1::Certificate Certificate}, in the - # format `projects/*/locations/*/caPools/*`. - # @param certificate_id [::String] - # Optional. It must be unique within a location and match the regular - # expression `[a-zA-Z0-9_-]{1,63}`. This field is required when using a - # {::Google::Cloud::Security::PrivateCA::V1::CertificateAuthority CertificateAuthority} - # in the Enterprise - # {::Google::Cloud::Security::PrivateCA::V1::CertificateAuthority#tier CertificateAuthority.tier}, - # but is optional and its value is ignored otherwise. - # @param certificate [::Google::Cloud::Security::PrivateCA::V1::Certificate, ::Hash] - # Required. A {::Google::Cloud::Security::PrivateCA::V1::Certificate Certificate} - # with initial field values. - # @param request_id [::String] - # Optional. An ID to identify requests. Specify a unique request ID so that - # if you must retry your request, the server will know to ignore the request - # if it has already been completed. The server will guarantee that for at - # least 60 minutes since the first request. - # - # For example, consider a situation where you make an initial request and the - # request times out. If you make the request again with the same request ID, - # the server can check if original operation with the same request ID was - # received, and if so, will ignore the second request. This prevents clients - # from accidentally creating duplicate commitments. - # - # The request ID must be a valid UUID with the exception that zero UUID is - # not supported (00000000-0000-0000-0000-000000000000). - # @param validate_only [::Boolean] - # Optional. If this is true, no - # {::Google::Cloud::Security::PrivateCA::V1::Certificate Certificate} resource will - # be persisted regardless of the - # {::Google::Cloud::Security::PrivateCA::V1::CaPool CaPool}'s - # {::Google::Cloud::Security::PrivateCA::V1::CaPool#tier tier}, and the returned - # {::Google::Cloud::Security::PrivateCA::V1::Certificate Certificate} will not - # contain the - # {::Google::Cloud::Security::PrivateCA::V1::Certificate#pem_certificate pem_certificate} - # field. - # @param issuing_certificate_authority_id [::String] - # Optional. The resource ID of the - # {::Google::Cloud::Security::PrivateCA::V1::CertificateAuthority CertificateAuthority} - # that should issue the certificate. This optional field will ignore the - # load-balancing scheme of the Pool and directly issue the certificate from - # the CA with the specified ID, contained in the same - # {::Google::Cloud::Security::PrivateCA::V1::CaPool CaPool} referenced by `parent`. - # Per-CA quota rules apply. If left empty, a - # {::Google::Cloud::Security::PrivateCA::V1::CertificateAuthority CertificateAuthority} - # will be chosen from the {::Google::Cloud::Security::PrivateCA::V1::CaPool CaPool} - # by the service. For example, to issue a - # {::Google::Cloud::Security::PrivateCA::V1::Certificate Certificate} from a - # Certificate Authority with resource name - # "projects/my-project/locations/us-central1/caPools/my-pool/certificateAuthorities/my-ca", - # you can set the - # {::Google::Cloud::Security::PrivateCA::V1::CreateCertificateRequest#parent parent} - # to "projects/my-project/locations/us-central1/caPools/my-pool" and the - # {::Google::Cloud::Security::PrivateCA::V1::CreateCertificateRequest#issuing_certificate_authority_id issuing_certificate_authority_id} - # to "my-ca". - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Cloud::Security::PrivateCA::V1::Certificate] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::Security::PrivateCA::V1::Certificate] - # - # @raise [::Google::Cloud::Error] if the REST call is aborted. - # - # @example Basic example - # require "google/cloud/security/private_ca/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Security::PrivateCA::V1::CertificateAuthorityService::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Security::PrivateCA::V1::CreateCertificateRequest.new - # - # # Call the create_certificate method. - # result = client.create_certificate request - # - # # The returned object is of type Google::Cloud::Security::PrivateCA::V1::Certificate. - # p result - # - def create_certificate request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Security::PrivateCA::V1::CreateCertificateRequest - - # Converts hash 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_certificate.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::Security::PrivateCA::V1::VERSION, - transports_version_send: [:rest] - - call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - options.apply_defaults timeout: @config.rpcs.create_certificate.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.create_certificate.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @certificate_authority_service_stub.create_certificate request, options do |result, operation| - yield result, operation if block_given? - end - rescue ::Gapic::Rest::Error => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Returns a {::Google::Cloud::Security::PrivateCA::V1::Certificate Certificate}. - # - # @overload get_certificate(request, options = nil) - # Pass arguments to `get_certificate` via a request object, either of type - # {::Google::Cloud::Security::PrivateCA::V1::GetCertificateRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Security::PrivateCA::V1::GetCertificateRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_certificate(name: nil) - # Pass arguments to `get_certificate` via keyword arguments. Note that at - # least one keyword argument is 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 {::Google::Cloud::Security::PrivateCA::V1::Certificate#name name} - # of the {::Google::Cloud::Security::PrivateCA::V1::Certificate Certificate} to - # get. - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Cloud::Security::PrivateCA::V1::Certificate] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::Security::PrivateCA::V1::Certificate] - # - # @raise [::Google::Cloud::Error] if the REST call is aborted. - # - # @example Basic example - # require "google/cloud/security/private_ca/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Security::PrivateCA::V1::CertificateAuthorityService::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Security::PrivateCA::V1::GetCertificateRequest.new - # - # # Call the get_certificate method. - # result = client.get_certificate request - # - # # The returned object is of type Google::Cloud::Security::PrivateCA::V1::Certificate. - # p result - # - def get_certificate request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Security::PrivateCA::V1::GetCertificateRequest - - # Converts hash 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_certificate.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::Security::PrivateCA::V1::VERSION, - transports_version_send: [:rest] - - call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - options.apply_defaults timeout: @config.rpcs.get_certificate.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.get_certificate.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @certificate_authority_service_stub.get_certificate request, options do |result, operation| - yield result, operation if block_given? - end - rescue ::Gapic::Rest::Error => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Lists {::Google::Cloud::Security::PrivateCA::V1::Certificate Certificates}. - # - # @overload list_certificates(request, options = nil) - # Pass arguments to `list_certificates` via a request object, either of type - # {::Google::Cloud::Security::PrivateCA::V1::ListCertificatesRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Security::PrivateCA::V1::ListCertificatesRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_certificates(parent: nil, page_size: nil, page_token: nil, filter: nil, order_by: nil) - # Pass arguments to `list_certificates` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param parent [::String] - # Required. The resource name of the location associated with the - # {::Google::Cloud::Security::PrivateCA::V1::Certificate Certificates}, in the - # format `projects/*/locations/*/caPools/*`. - # @param page_size [::Integer] - # Optional. Limit on the number of - # {::Google::Cloud::Security::PrivateCA::V1::Certificate Certificates} to include - # in the response. Further - # {::Google::Cloud::Security::PrivateCA::V1::Certificate Certificates} can - # subsequently be obtained by including the - # {::Google::Cloud::Security::PrivateCA::V1::ListCertificatesResponse#next_page_token ListCertificatesResponse.next_page_token} - # in a subsequent request. If unspecified, the server will pick an - # appropriate default. - # @param page_token [::String] - # Optional. Pagination token, returned earlier via - # {::Google::Cloud::Security::PrivateCA::V1::ListCertificatesResponse#next_page_token ListCertificatesResponse.next_page_token}. - # @param filter [::String] - # Optional. Only include resources that match the filter in the response. For - # details on supported filters and syntax, see [Certificates Filtering - # documentation](https://cloud.google.com/certificate-authority-service/docs/sorting-filtering-certificates#filtering_support). - # @param order_by [::String] - # Optional. Specify how the results should be sorted. For details on - # supported fields and syntax, see [Certificates Sorting - # documentation](https://cloud.google.com/certificate-authority-service/docs/sorting-filtering-certificates#sorting_support). - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Gapic::Rest::PagedEnumerable<::Google::Cloud::Security::PrivateCA::V1::Certificate>] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Gapic::Rest::PagedEnumerable<::Google::Cloud::Security::PrivateCA::V1::Certificate>] - # - # @raise [::Google::Cloud::Error] if the REST call is aborted. - # - # @example Basic example - # require "google/cloud/security/private_ca/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Security::PrivateCA::V1::CertificateAuthorityService::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Security::PrivateCA::V1::ListCertificatesRequest.new - # - # # Call the list_certificates method. - # result = client.list_certificates request - # - # # The returned object is of type Gapic::PagedEnumerable. You can iterate - # # over elements, and API calls will be issued to fetch pages as needed. - # result.each do |item| - # # Each element is of type ::Google::Cloud::Security::PrivateCA::V1::Certificate. - # p item - # end - # - def list_certificates request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Security::PrivateCA::V1::ListCertificatesRequest - - # Converts hash 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_certificates.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::Security::PrivateCA::V1::VERSION, - transports_version_send: [:rest] - - call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - options.apply_defaults timeout: @config.rpcs.list_certificates.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.list_certificates.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @certificate_authority_service_stub.list_certificates request, options do |result, operation| - result = ::Gapic::Rest::PagedEnumerable.new @certificate_authority_service_stub, :list_certificates, "certificates", 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 - - ## - # Revoke a {::Google::Cloud::Security::PrivateCA::V1::Certificate Certificate}. - # - # @overload revoke_certificate(request, options = nil) - # Pass arguments to `revoke_certificate` via a request object, either of type - # {::Google::Cloud::Security::PrivateCA::V1::RevokeCertificateRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Security::PrivateCA::V1::RevokeCertificateRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @overload revoke_certificate(name: nil, reason: nil, request_id: nil) - # Pass arguments to `revoke_certificate` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param name [::String] - # Required. The resource name for this - # {::Google::Cloud::Security::PrivateCA::V1::Certificate Certificate} in the format - # `projects/*/locations/*/caPools/*/certificates/*`. - # @param reason [::Google::Cloud::Security::PrivateCA::V1::RevocationReason] - # Required. The - # {::Google::Cloud::Security::PrivateCA::V1::RevocationReason RevocationReason} for - # revoking this certificate. - # @param request_id [::String] - # Optional. An ID to identify requests. Specify a unique request ID so that - # if you must retry your request, the server will know to ignore the request - # if it has already been completed. The server will guarantee that for at - # least 60 minutes since the first request. - # - # For example, consider a situation where you make an initial request and - # the request times out. If you make the request again with the same request - # ID, the server can check if original operation with the same request ID - # was received, and if so, will ignore the second request. This prevents - # clients from accidentally creating duplicate commitments. - # - # The request ID must be a valid UUID with the exception that zero UUID is - # not supported (00000000-0000-0000-0000-000000000000). - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Cloud::Security::PrivateCA::V1::Certificate] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::Security::PrivateCA::V1::Certificate] - # - # @raise [::Google::Cloud::Error] if the REST call is aborted. - # - # @example Basic example - # require "google/cloud/security/private_ca/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Security::PrivateCA::V1::CertificateAuthorityService::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Security::PrivateCA::V1::RevokeCertificateRequest.new - # - # # Call the revoke_certificate method. - # result = client.revoke_certificate request - # - # # The returned object is of type Google::Cloud::Security::PrivateCA::V1::Certificate. - # p result - # - def revoke_certificate request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Security::PrivateCA::V1::RevokeCertificateRequest - - # Converts hash 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.revoke_certificate.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::Security::PrivateCA::V1::VERSION, - transports_version_send: [:rest] - - call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - options.apply_defaults timeout: @config.rpcs.revoke_certificate.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.revoke_certificate.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @certificate_authority_service_stub.revoke_certificate 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 - - ## - # Update a {::Google::Cloud::Security::PrivateCA::V1::Certificate Certificate}. - # Currently, the only field you can update is the - # {::Google::Cloud::Security::PrivateCA::V1::Certificate#labels labels} field. - # - # @overload update_certificate(request, options = nil) - # Pass arguments to `update_certificate` via a request object, either of type - # {::Google::Cloud::Security::PrivateCA::V1::UpdateCertificateRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Security::PrivateCA::V1::UpdateCertificateRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_certificate(certificate: nil, update_mask: nil, request_id: nil) - # Pass arguments to `update_certificate` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param certificate [::Google::Cloud::Security::PrivateCA::V1::Certificate, ::Hash] - # Required. {::Google::Cloud::Security::PrivateCA::V1::Certificate Certificate} - # with updated values. - # @param update_mask [::Google::Protobuf::FieldMask, ::Hash] - # Required. A list of fields to be updated in this request. - # @param request_id [::String] - # Optional. An ID to identify requests. Specify a unique request ID so that - # if you must retry your request, the server will know to ignore the request - # if it has already been completed. The server will guarantee that for at - # least 60 minutes since the first request. - # - # For example, consider a situation where you make an initial request and - # the request times out. If you make the request again with the same request - # ID, the server can check if original operation with the same request ID - # was received, and if so, will ignore the second request. This prevents - # clients from accidentally creating duplicate commitments. - # - # The request ID must be a valid UUID with the exception that zero UUID is - # not supported (00000000-0000-0000-0000-000000000000). - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Cloud::Security::PrivateCA::V1::Certificate] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::Security::PrivateCA::V1::Certificate] - # - # @raise [::Google::Cloud::Error] if the REST call is aborted. - # - # @example Basic example - # require "google/cloud/security/private_ca/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Security::PrivateCA::V1::CertificateAuthorityService::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Security::PrivateCA::V1::UpdateCertificateRequest.new - # - # # Call the update_certificate method. - # result = client.update_certificate request - # - # # The returned object is of type Google::Cloud::Security::PrivateCA::V1::Certificate. - # p result - # - def update_certificate request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Security::PrivateCA::V1::UpdateCertificateRequest - - # Converts hash 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_certificate.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::Security::PrivateCA::V1::VERSION, - transports_version_send: [:rest] - - call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - options.apply_defaults timeout: @config.rpcs.update_certificate.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.update_certificate.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @certificate_authority_service_stub.update_certificate 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 - - ## - # Activate a - # {::Google::Cloud::Security::PrivateCA::V1::CertificateAuthority CertificateAuthority} - # that is in state - # {::Google::Cloud::Security::PrivateCA::V1::CertificateAuthority::State::AWAITING_USER_ACTIVATION AWAITING_USER_ACTIVATION} - # and is of type - # {::Google::Cloud::Security::PrivateCA::V1::CertificateAuthority::Type::SUBORDINATE SUBORDINATE}. - # After the parent Certificate Authority signs a certificate signing request - # from - # {::Google::Cloud::Security::PrivateCA::V1::CertificateAuthorityService::Rest::Client#fetch_certificate_authority_csr FetchCertificateAuthorityCsr}, - # this method can complete the activation process. - # - # @overload activate_certificate_authority(request, options = nil) - # Pass arguments to `activate_certificate_authority` via a request object, either of type - # {::Google::Cloud::Security::PrivateCA::V1::ActivateCertificateAuthorityRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Security::PrivateCA::V1::ActivateCertificateAuthorityRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @overload activate_certificate_authority(name: nil, pem_ca_certificate: nil, subordinate_config: nil, request_id: nil) - # Pass arguments to `activate_certificate_authority` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param name [::String] - # Required. The resource name for this - # {::Google::Cloud::Security::PrivateCA::V1::CertificateAuthority CertificateAuthority} - # in the format `projects/*/locations/*/caPools/*/certificateAuthorities/*`. - # @param pem_ca_certificate [::String] - # Required. The signed CA certificate issued from - # {::Google::Cloud::Security::PrivateCA::V1::FetchCertificateAuthorityCsrResponse#pem_csr FetchCertificateAuthorityCsrResponse.pem_csr}. - # @param subordinate_config [::Google::Cloud::Security::PrivateCA::V1::SubordinateConfig, ::Hash] - # Required. Must include information about the issuer of - # 'pem_ca_certificate', and any further issuers until the self-signed CA. - # @param request_id [::String] - # Optional. An ID to identify requests. Specify a unique request ID so that - # if you must retry your request, the server will know to ignore the request - # if it has already been completed. The server will guarantee that for at - # least 60 minutes since the first request. - # - # For example, consider a situation where you make an initial request and - # the request times out. If you make the request again with the same request - # ID, the server can check if original operation with the same request ID - # was received, and if so, will ignore the second request. This prevents - # clients from accidentally creating duplicate commitments. - # - # The request ID must be a valid UUID with the exception that zero UUID is - # not supported (00000000-0000-0000-0000-000000000000). - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Gapic::Operation] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Gapic::Operation] - # - # @raise [::Google::Cloud::Error] if the REST call is aborted. - # - # @example Basic example - # require "google/cloud/security/private_ca/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Security::PrivateCA::V1::CertificateAuthorityService::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Security::PrivateCA::V1::ActivateCertificateAuthorityRequest.new - # - # # Call the activate_certificate_authority method. - # result = client.activate_certificate_authority 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 activate_certificate_authority request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Security::PrivateCA::V1::ActivateCertificateAuthorityRequest - - # Converts hash 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.activate_certificate_authority.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::Security::PrivateCA::V1::VERSION, - transports_version_send: [:rest] - - call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - options.apply_defaults timeout: @config.rpcs.activate_certificate_authority.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.activate_certificate_authority.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @certificate_authority_service_stub.activate_certificate_authority 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 - - ## - # Create a new - # {::Google::Cloud::Security::PrivateCA::V1::CertificateAuthority CertificateAuthority} - # in a given Project and Location. - # - # @overload create_certificate_authority(request, options = nil) - # Pass arguments to `create_certificate_authority` via a request object, either of type - # {::Google::Cloud::Security::PrivateCA::V1::CreateCertificateAuthorityRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Security::PrivateCA::V1::CreateCertificateAuthorityRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_certificate_authority(parent: nil, certificate_authority_id: nil, certificate_authority: nil, request_id: nil) - # Pass arguments to `create_certificate_authority` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param parent [::String] - # Required. The resource name of the - # {::Google::Cloud::Security::PrivateCA::V1::CaPool CaPool} associated with the - # {::Google::Cloud::Security::PrivateCA::V1::CertificateAuthority CertificateAuthorities}, - # in the format `projects/*/locations/*/caPools/*`. - # @param certificate_authority_id [::String] - # Required. It must be unique within a location and match the regular - # expression `[a-zA-Z0-9_-]{1,63}` - # @param certificate_authority [::Google::Cloud::Security::PrivateCA::V1::CertificateAuthority, ::Hash] - # Required. A - # {::Google::Cloud::Security::PrivateCA::V1::CertificateAuthority CertificateAuthority} - # with initial field values. - # @param request_id [::String] - # Optional. An ID to identify requests. Specify a unique request ID so that - # if you must retry your request, the server will know to ignore the request - # if it has already been completed. The server will guarantee that for at - # least 60 minutes since the first request. - # - # For example, consider a situation where you make an initial request and - # the request times out. If you make the request again with the same request - # ID, the server can check if original operation with the same request ID - # was received, and if so, will ignore the second request. This prevents - # clients from accidentally creating duplicate commitments. - # - # The request ID must be a valid UUID with the exception that zero UUID is - # not supported (00000000-0000-0000-0000-000000000000). - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Gapic::Operation] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Gapic::Operation] - # - # @raise [::Google::Cloud::Error] if the REST call is aborted. - # - # @example Basic example - # require "google/cloud/security/private_ca/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Security::PrivateCA::V1::CertificateAuthorityService::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Security::PrivateCA::V1::CreateCertificateAuthorityRequest.new - # - # # Call the create_certificate_authority method. - # result = client.create_certificate_authority 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_certificate_authority request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Security::PrivateCA::V1::CreateCertificateAuthorityRequest - - # Converts hash 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_certificate_authority.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::Security::PrivateCA::V1::VERSION, - transports_version_send: [:rest] - - call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - options.apply_defaults timeout: @config.rpcs.create_certificate_authority.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.create_certificate_authority.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @certificate_authority_service_stub.create_certificate_authority 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 - - ## - # Disable a - # {::Google::Cloud::Security::PrivateCA::V1::CertificateAuthority CertificateAuthority}. - # - # @overload disable_certificate_authority(request, options = nil) - # Pass arguments to `disable_certificate_authority` via a request object, either of type - # {::Google::Cloud::Security::PrivateCA::V1::DisableCertificateAuthorityRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Security::PrivateCA::V1::DisableCertificateAuthorityRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @overload disable_certificate_authority(name: nil, request_id: nil, ignore_dependent_resources: nil) - # Pass arguments to `disable_certificate_authority` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param name [::String] - # Required. The resource name for this - # {::Google::Cloud::Security::PrivateCA::V1::CertificateAuthority CertificateAuthority} - # in the format `projects/*/locations/*/caPools/*/certificateAuthorities/*`. - # @param request_id [::String] - # Optional. An ID to identify requests. Specify a unique request ID so that - # if you must retry your request, the server will know to ignore the request - # if it has already been completed. The server will guarantee that for at - # least 60 minutes since the first request. - # - # For example, consider a situation where you make an initial request and - # the request times out. If you make the request again with the same request - # ID, the server can check if original operation with the same request ID - # was received, and if so, will ignore the second request. This prevents - # clients from accidentally creating duplicate commitments. - # - # The request ID must be a valid UUID with the exception that zero UUID is - # not supported (00000000-0000-0000-0000-000000000000). - # @param ignore_dependent_resources [::Boolean] - # Optional. This field allows this CA to be disabled even if it's being - # depended on by another resource. However, doing so may result in unintended - # and unrecoverable effects on any dependent resources since the CA will - # no longer be able to issue certificates. - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Gapic::Operation] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Gapic::Operation] - # - # @raise [::Google::Cloud::Error] if the REST call is aborted. - # - # @example Basic example - # require "google/cloud/security/private_ca/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Security::PrivateCA::V1::CertificateAuthorityService::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Security::PrivateCA::V1::DisableCertificateAuthorityRequest.new - # - # # Call the disable_certificate_authority method. - # result = client.disable_certificate_authority 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 disable_certificate_authority request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Security::PrivateCA::V1::DisableCertificateAuthorityRequest - - # Converts hash and nil to an options object - options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h - - # Customize the options with defaults - call_metadata = @config.rpcs.disable_certificate_authority.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::Security::PrivateCA::V1::VERSION, - transports_version_send: [:rest] - - call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - options.apply_defaults timeout: @config.rpcs.disable_certificate_authority.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.disable_certificate_authority.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @certificate_authority_service_stub.disable_certificate_authority 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 - - ## - # Enable a - # {::Google::Cloud::Security::PrivateCA::V1::CertificateAuthority CertificateAuthority}. - # - # @overload enable_certificate_authority(request, options = nil) - # Pass arguments to `enable_certificate_authority` via a request object, either of type - # {::Google::Cloud::Security::PrivateCA::V1::EnableCertificateAuthorityRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Security::PrivateCA::V1::EnableCertificateAuthorityRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @overload enable_certificate_authority(name: nil, request_id: nil) - # Pass arguments to `enable_certificate_authority` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param name [::String] - # Required. The resource name for this - # {::Google::Cloud::Security::PrivateCA::V1::CertificateAuthority CertificateAuthority} - # in the format `projects/*/locations/*/caPools/*/certificateAuthorities/*`. - # @param request_id [::String] - # Optional. An ID to identify requests. Specify a unique request ID so that - # if you must retry your request, the server will know to ignore the request - # if it has already been completed. The server will guarantee that for at - # least 60 minutes since the first request. - # - # For example, consider a situation where you make an initial request and - # the request times out. If you make the request again with the same request - # ID, the server can check if original operation with the same request ID - # was received, and if so, will ignore the second request. This prevents - # clients from accidentally creating duplicate commitments. - # - # The request ID must be a valid UUID with the exception that zero UUID is - # not supported (00000000-0000-0000-0000-000000000000). - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Gapic::Operation] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Gapic::Operation] - # - # @raise [::Google::Cloud::Error] if the REST call is aborted. - # - # @example Basic example - # require "google/cloud/security/private_ca/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Security::PrivateCA::V1::CertificateAuthorityService::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Security::PrivateCA::V1::EnableCertificateAuthorityRequest.new - # - # # Call the enable_certificate_authority method. - # result = client.enable_certificate_authority 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 enable_certificate_authority request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Security::PrivateCA::V1::EnableCertificateAuthorityRequest - - # Converts hash and nil to an options object - options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h - - # Customize the options with defaults - call_metadata = @config.rpcs.enable_certificate_authority.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::Security::PrivateCA::V1::VERSION, - transports_version_send: [:rest] - - call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - options.apply_defaults timeout: @config.rpcs.enable_certificate_authority.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.enable_certificate_authority.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @certificate_authority_service_stub.enable_certificate_authority 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 - - ## - # Fetch a certificate signing request (CSR) from a - # {::Google::Cloud::Security::PrivateCA::V1::CertificateAuthority CertificateAuthority} - # that is in state - # {::Google::Cloud::Security::PrivateCA::V1::CertificateAuthority::State::AWAITING_USER_ACTIVATION AWAITING_USER_ACTIVATION} - # and is of type - # {::Google::Cloud::Security::PrivateCA::V1::CertificateAuthority::Type::SUBORDINATE SUBORDINATE}. - # The CSR must then be signed by the desired parent Certificate Authority, - # which could be another - # {::Google::Cloud::Security::PrivateCA::V1::CertificateAuthority CertificateAuthority} - # resource, or could be an on-prem certificate authority. See also - # {::Google::Cloud::Security::PrivateCA::V1::CertificateAuthorityService::Rest::Client#activate_certificate_authority ActivateCertificateAuthority}. - # - # @overload fetch_certificate_authority_csr(request, options = nil) - # Pass arguments to `fetch_certificate_authority_csr` via a request object, either of type - # {::Google::Cloud::Security::PrivateCA::V1::FetchCertificateAuthorityCsrRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Security::PrivateCA::V1::FetchCertificateAuthorityCsrRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @overload fetch_certificate_authority_csr(name: nil) - # Pass arguments to `fetch_certificate_authority_csr` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param name [::String] - # Required. The resource name for this - # {::Google::Cloud::Security::PrivateCA::V1::CertificateAuthority CertificateAuthority} - # in the format `projects/*/locations/*/caPools/*/certificateAuthorities/*`. - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Cloud::Security::PrivateCA::V1::FetchCertificateAuthorityCsrResponse] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::Security::PrivateCA::V1::FetchCertificateAuthorityCsrResponse] - # - # @raise [::Google::Cloud::Error] if the REST call is aborted. - # - # @example Basic example - # require "google/cloud/security/private_ca/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Security::PrivateCA::V1::CertificateAuthorityService::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Security::PrivateCA::V1::FetchCertificateAuthorityCsrRequest.new - # - # # Call the fetch_certificate_authority_csr method. - # result = client.fetch_certificate_authority_csr request - # - # # The returned object is of type Google::Cloud::Security::PrivateCA::V1::FetchCertificateAuthorityCsrResponse. - # p result - # - def fetch_certificate_authority_csr request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Security::PrivateCA::V1::FetchCertificateAuthorityCsrRequest - - # Converts hash 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.fetch_certificate_authority_csr.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::Security::PrivateCA::V1::VERSION, - transports_version_send: [:rest] - - call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - options.apply_defaults timeout: @config.rpcs.fetch_certificate_authority_csr.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.fetch_certificate_authority_csr.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @certificate_authority_service_stub.fetch_certificate_authority_csr request, options do |result, operation| - yield result, operation if block_given? - end - rescue ::Gapic::Rest::Error => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Returns a - # {::Google::Cloud::Security::PrivateCA::V1::CertificateAuthority CertificateAuthority}. - # - # @overload get_certificate_authority(request, options = nil) - # Pass arguments to `get_certificate_authority` via a request object, either of type - # {::Google::Cloud::Security::PrivateCA::V1::GetCertificateAuthorityRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Security::PrivateCA::V1::GetCertificateAuthorityRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_certificate_authority(name: nil) - # Pass arguments to `get_certificate_authority` via keyword arguments. Note that at - # least one keyword argument is 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 - # {::Google::Cloud::Security::PrivateCA::V1::CertificateAuthority#name name} of the - # {::Google::Cloud::Security::PrivateCA::V1::CertificateAuthority CertificateAuthority} - # to get. - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Cloud::Security::PrivateCA::V1::CertificateAuthority] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::Security::PrivateCA::V1::CertificateAuthority] - # - # @raise [::Google::Cloud::Error] if the REST call is aborted. - # - # @example Basic example - # require "google/cloud/security/private_ca/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Security::PrivateCA::V1::CertificateAuthorityService::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Security::PrivateCA::V1::GetCertificateAuthorityRequest.new - # - # # Call the get_certificate_authority method. - # result = client.get_certificate_authority request - # - # # The returned object is of type Google::Cloud::Security::PrivateCA::V1::CertificateAuthority. - # p result - # - def get_certificate_authority request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Security::PrivateCA::V1::GetCertificateAuthorityRequest - - # Converts hash 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_certificate_authority.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::Security::PrivateCA::V1::VERSION, - transports_version_send: [:rest] - - call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - options.apply_defaults timeout: @config.rpcs.get_certificate_authority.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.get_certificate_authority.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @certificate_authority_service_stub.get_certificate_authority request, options do |result, operation| - yield result, operation if block_given? - end - rescue ::Gapic::Rest::Error => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Lists - # {::Google::Cloud::Security::PrivateCA::V1::CertificateAuthority CertificateAuthorities}. - # - # @overload list_certificate_authorities(request, options = nil) - # Pass arguments to `list_certificate_authorities` via a request object, either of type - # {::Google::Cloud::Security::PrivateCA::V1::ListCertificateAuthoritiesRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Security::PrivateCA::V1::ListCertificateAuthoritiesRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_certificate_authorities(parent: nil, page_size: nil, page_token: nil, filter: nil, order_by: nil) - # Pass arguments to `list_certificate_authorities` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param parent [::String] - # Required. The resource name of the - # {::Google::Cloud::Security::PrivateCA::V1::CaPool CaPool} associated with the - # {::Google::Cloud::Security::PrivateCA::V1::CertificateAuthority CertificateAuthorities}, - # in the format `projects/*/locations/*/caPools/*`. - # @param page_size [::Integer] - # Optional. Limit on the number of - # {::Google::Cloud::Security::PrivateCA::V1::CertificateAuthority CertificateAuthorities} - # to include in the response. Further - # {::Google::Cloud::Security::PrivateCA::V1::CertificateAuthority CertificateAuthorities} - # can subsequently be obtained by including the - # {::Google::Cloud::Security::PrivateCA::V1::ListCertificateAuthoritiesResponse#next_page_token ListCertificateAuthoritiesResponse.next_page_token} - # in a subsequent request. If unspecified, the server will pick an - # appropriate default. - # @param page_token [::String] - # Optional. Pagination token, returned earlier via - # {::Google::Cloud::Security::PrivateCA::V1::ListCertificateAuthoritiesResponse#next_page_token ListCertificateAuthoritiesResponse.next_page_token}. - # @param filter [::String] - # Optional. Only include resources that match the filter in the response. - # @param order_by [::String] - # Optional. Specify how the results should be sorted. - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Gapic::Rest::PagedEnumerable<::Google::Cloud::Security::PrivateCA::V1::CertificateAuthority>] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Gapic::Rest::PagedEnumerable<::Google::Cloud::Security::PrivateCA::V1::CertificateAuthority>] - # - # @raise [::Google::Cloud::Error] if the REST call is aborted. - # - # @example Basic example - # require "google/cloud/security/private_ca/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Security::PrivateCA::V1::CertificateAuthorityService::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Security::PrivateCA::V1::ListCertificateAuthoritiesRequest.new - # - # # Call the list_certificate_authorities method. - # result = client.list_certificate_authorities request - # - # # The returned object is of type Gapic::PagedEnumerable. You can iterate - # # over elements, and API calls will be issued to fetch pages as needed. - # result.each do |item| - # # Each element is of type ::Google::Cloud::Security::PrivateCA::V1::CertificateAuthority. - # p item - # end - # - def list_certificate_authorities request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Security::PrivateCA::V1::ListCertificateAuthoritiesRequest - - # Converts hash 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_certificate_authorities.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::Security::PrivateCA::V1::VERSION, - transports_version_send: [:rest] - - call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - options.apply_defaults timeout: @config.rpcs.list_certificate_authorities.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.list_certificate_authorities.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @certificate_authority_service_stub.list_certificate_authorities request, options do |result, operation| - result = ::Gapic::Rest::PagedEnumerable.new @certificate_authority_service_stub, :list_certificate_authorities, "certificate_authorities", 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 - - ## - # Undelete a - # {::Google::Cloud::Security::PrivateCA::V1::CertificateAuthority CertificateAuthority} - # that has been deleted. - # - # @overload undelete_certificate_authority(request, options = nil) - # Pass arguments to `undelete_certificate_authority` via a request object, either of type - # {::Google::Cloud::Security::PrivateCA::V1::UndeleteCertificateAuthorityRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Security::PrivateCA::V1::UndeleteCertificateAuthorityRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @overload undelete_certificate_authority(name: nil, request_id: nil) - # Pass arguments to `undelete_certificate_authority` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param name [::String] - # Required. The resource name for this - # {::Google::Cloud::Security::PrivateCA::V1::CertificateAuthority CertificateAuthority} - # in the format `projects/*/locations/*/caPools/*/certificateAuthorities/*`. - # @param request_id [::String] - # Optional. An ID to identify requests. Specify a unique request ID so that - # if you must retry your request, the server will know to ignore the request - # if it has already been completed. The server will guarantee that for at - # least 60 minutes since the first request. - # - # For example, consider a situation where you make an initial request and - # the request times out. If you make the request again with the same request - # ID, the server can check if original operation with the same request ID - # was received, and if so, will ignore the second request. This prevents - # clients from accidentally creating duplicate commitments. - # - # The request ID must be a valid UUID with the exception that zero UUID is - # not supported (00000000-0000-0000-0000-000000000000). - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Gapic::Operation] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Gapic::Operation] - # - # @raise [::Google::Cloud::Error] if the REST call is aborted. - # - # @example Basic example - # require "google/cloud/security/private_ca/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Security::PrivateCA::V1::CertificateAuthorityService::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Security::PrivateCA::V1::UndeleteCertificateAuthorityRequest.new - # - # # Call the undelete_certificate_authority method. - # result = client.undelete_certificate_authority 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 undelete_certificate_authority request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Security::PrivateCA::V1::UndeleteCertificateAuthorityRequest - - # Converts hash 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.undelete_certificate_authority.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::Security::PrivateCA::V1::VERSION, - transports_version_send: [:rest] - - call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - options.apply_defaults timeout: @config.rpcs.undelete_certificate_authority.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.undelete_certificate_authority.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @certificate_authority_service_stub.undelete_certificate_authority 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 - - ## - # Delete a - # {::Google::Cloud::Security::PrivateCA::V1::CertificateAuthority CertificateAuthority}. - # - # @overload delete_certificate_authority(request, options = nil) - # Pass arguments to `delete_certificate_authority` via a request object, either of type - # {::Google::Cloud::Security::PrivateCA::V1::DeleteCertificateAuthorityRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Security::PrivateCA::V1::DeleteCertificateAuthorityRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_certificate_authority(name: nil, request_id: nil, ignore_active_certificates: nil, skip_grace_period: nil, ignore_dependent_resources: nil) - # Pass arguments to `delete_certificate_authority` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param name [::String] - # Required. The resource name for this - # {::Google::Cloud::Security::PrivateCA::V1::CertificateAuthority CertificateAuthority} - # in the format `projects/*/locations/*/caPools/*/certificateAuthorities/*`. - # @param request_id [::String] - # Optional. An ID to identify requests. Specify a unique request ID so that - # if you must retry your request, the server will know to ignore the request - # if it has already been completed. The server will guarantee that for at - # least 60 minutes since the first request. - # - # For example, consider a situation where you make an initial request and - # the request times out. If you make the request again with the same request - # ID, the server can check if original operation with the same request ID - # was received, and if so, will ignore the second request. This prevents - # clients from accidentally creating duplicate commitments. - # - # The request ID must be a valid UUID with the exception that zero UUID is - # not supported (00000000-0000-0000-0000-000000000000). - # @param ignore_active_certificates [::Boolean] - # Optional. This field allows the CA to be deleted even if the CA has - # active certs. Active certs include both unrevoked and unexpired certs. - # @param skip_grace_period [::Boolean] - # Optional. If this flag is set, the Certificate Authority will be deleted as - # soon as possible without a 30-day grace period where undeletion would have - # been allowed. If you proceed, there will be no way to recover this CA. - # @param ignore_dependent_resources [::Boolean] - # Optional. This field allows this CA to be deleted even if it's being - # depended on by another resource. However, doing so may result in unintended - # and unrecoverable effects on any dependent resources since the CA will - # no longer be able to issue certificates. - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Gapic::Operation] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Gapic::Operation] - # - # @raise [::Google::Cloud::Error] if the REST call is aborted. - # - # @example Basic example - # require "google/cloud/security/private_ca/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Security::PrivateCA::V1::CertificateAuthorityService::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Security::PrivateCA::V1::DeleteCertificateAuthorityRequest.new - # - # # Call the delete_certificate_authority method. - # result = client.delete_certificate_authority 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_certificate_authority request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Security::PrivateCA::V1::DeleteCertificateAuthorityRequest - - # Converts hash 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_certificate_authority.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::Security::PrivateCA::V1::VERSION, - transports_version_send: [:rest] - - call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - options.apply_defaults timeout: @config.rpcs.delete_certificate_authority.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.delete_certificate_authority.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @certificate_authority_service_stub.delete_certificate_authority 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 - - ## - # Update a - # {::Google::Cloud::Security::PrivateCA::V1::CertificateAuthority CertificateAuthority}. - # - # @overload update_certificate_authority(request, options = nil) - # Pass arguments to `update_certificate_authority` via a request object, either of type - # {::Google::Cloud::Security::PrivateCA::V1::UpdateCertificateAuthorityRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Security::PrivateCA::V1::UpdateCertificateAuthorityRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_certificate_authority(certificate_authority: nil, update_mask: nil, request_id: nil) - # Pass arguments to `update_certificate_authority` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param certificate_authority [::Google::Cloud::Security::PrivateCA::V1::CertificateAuthority, ::Hash] - # Required. - # {::Google::Cloud::Security::PrivateCA::V1::CertificateAuthority CertificateAuthority} - # with updated values. - # @param update_mask [::Google::Protobuf::FieldMask, ::Hash] - # Required. A list of fields to be updated in this request. - # @param request_id [::String] - # Optional. An ID to identify requests. Specify a unique request ID so that - # if you must retry your request, the server will know to ignore the request - # if it has already been completed. The server will guarantee that for at - # least 60 minutes since the first request. - # - # For example, consider a situation where you make an initial request and - # the request times out. If you make the request again with the same request - # ID, the server can check if original operation with the same request ID - # was received, and if so, will ignore the second request. This prevents - # clients from accidentally creating duplicate commitments. - # - # The request ID must be a valid UUID with the exception that zero UUID is - # not supported (00000000-0000-0000-0000-000000000000). - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Gapic::Operation] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Gapic::Operation] - # - # @raise [::Google::Cloud::Error] if the REST call is aborted. - # - # @example Basic example - # require "google/cloud/security/private_ca/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Security::PrivateCA::V1::CertificateAuthorityService::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Security::PrivateCA::V1::UpdateCertificateAuthorityRequest.new - # - # # Call the update_certificate_authority method. - # result = client.update_certificate_authority 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_certificate_authority request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Security::PrivateCA::V1::UpdateCertificateAuthorityRequest - - # Converts hash 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_certificate_authority.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::Security::PrivateCA::V1::VERSION, - transports_version_send: [:rest] - - call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - options.apply_defaults timeout: @config.rpcs.update_certificate_authority.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.update_certificate_authority.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @certificate_authority_service_stub.update_certificate_authority 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 - - ## - # Create a {::Google::Cloud::Security::PrivateCA::V1::CaPool CaPool}. - # - # @overload create_ca_pool(request, options = nil) - # Pass arguments to `create_ca_pool` via a request object, either of type - # {::Google::Cloud::Security::PrivateCA::V1::CreateCaPoolRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Security::PrivateCA::V1::CreateCaPoolRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_ca_pool(parent: nil, ca_pool_id: nil, ca_pool: nil, request_id: nil) - # Pass arguments to `create_ca_pool` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param parent [::String] - # Required. The resource name of the location associated with the - # {::Google::Cloud::Security::PrivateCA::V1::CaPool CaPool}, in the format - # `projects/*/locations/*`. - # @param ca_pool_id [::String] - # Required. It must be unique within a location and match the regular - # expression `[a-zA-Z0-9_-]{1,63}` - # @param ca_pool [::Google::Cloud::Security::PrivateCA::V1::CaPool, ::Hash] - # Required. A {::Google::Cloud::Security::PrivateCA::V1::CaPool CaPool} with - # initial field values. - # @param request_id [::String] - # Optional. An ID to identify requests. Specify a unique request ID so that - # if you must retry your request, the server will know to ignore the request - # if it has already been completed. The server will guarantee that for at - # least 60 minutes since the first request. - # - # For example, consider a situation where you make an initial request and - # the request times out. If you make the request again with the same request - # ID, the server can check if original operation with the same request ID - # was received, and if so, will ignore the second request. This prevents - # clients from accidentally creating duplicate commitments. - # - # The request ID must be a valid UUID with the exception that zero UUID is - # not supported (00000000-0000-0000-0000-000000000000). - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Gapic::Operation] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Gapic::Operation] - # - # @raise [::Google::Cloud::Error] if the REST call is aborted. - # - # @example Basic example - # require "google/cloud/security/private_ca/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Security::PrivateCA::V1::CertificateAuthorityService::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Security::PrivateCA::V1::CreateCaPoolRequest.new - # - # # Call the create_ca_pool method. - # result = client.create_ca_pool 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_ca_pool request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Security::PrivateCA::V1::CreateCaPoolRequest - - # Converts hash 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_ca_pool.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::Security::PrivateCA::V1::VERSION, - transports_version_send: [:rest] - - call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - options.apply_defaults timeout: @config.rpcs.create_ca_pool.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.create_ca_pool.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @certificate_authority_service_stub.create_ca_pool 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 - - ## - # Update a {::Google::Cloud::Security::PrivateCA::V1::CaPool CaPool}. - # - # @overload update_ca_pool(request, options = nil) - # Pass arguments to `update_ca_pool` via a request object, either of type - # {::Google::Cloud::Security::PrivateCA::V1::UpdateCaPoolRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Security::PrivateCA::V1::UpdateCaPoolRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_ca_pool(ca_pool: nil, update_mask: nil, request_id: nil) - # Pass arguments to `update_ca_pool` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param ca_pool [::Google::Cloud::Security::PrivateCA::V1::CaPool, ::Hash] - # Required. {::Google::Cloud::Security::PrivateCA::V1::CaPool CaPool} with updated - # values. - # @param update_mask [::Google::Protobuf::FieldMask, ::Hash] - # Required. A list of fields to be updated in this request. - # @param request_id [::String] - # Optional. An ID to identify requests. Specify a unique request ID so that - # if you must retry your request, the server will know to ignore the request - # if it has already been completed. The server will guarantee that for at - # least 60 minutes since the first request. - # - # For example, consider a situation where you make an initial request and - # the request times out. If you make the request again with the same request - # ID, the server can check if original operation with the same request ID - # was received, and if so, will ignore the second request. This prevents - # clients from accidentally creating duplicate commitments. - # - # The request ID must be a valid UUID with the exception that zero UUID is - # not supported (00000000-0000-0000-0000-000000000000). - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Gapic::Operation] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Gapic::Operation] - # - # @raise [::Google::Cloud::Error] if the REST call is aborted. - # - # @example Basic example - # require "google/cloud/security/private_ca/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Security::PrivateCA::V1::CertificateAuthorityService::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Security::PrivateCA::V1::UpdateCaPoolRequest.new - # - # # Call the update_ca_pool method. - # result = client.update_ca_pool 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_ca_pool request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Security::PrivateCA::V1::UpdateCaPoolRequest - - # Converts hash 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_ca_pool.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::Security::PrivateCA::V1::VERSION, - transports_version_send: [:rest] - - call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - options.apply_defaults timeout: @config.rpcs.update_ca_pool.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.update_ca_pool.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @certificate_authority_service_stub.update_ca_pool 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 - - ## - # Returns a {::Google::Cloud::Security::PrivateCA::V1::CaPool CaPool}. - # - # @overload get_ca_pool(request, options = nil) - # Pass arguments to `get_ca_pool` via a request object, either of type - # {::Google::Cloud::Security::PrivateCA::V1::GetCaPoolRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Security::PrivateCA::V1::GetCaPoolRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_ca_pool(name: nil) - # Pass arguments to `get_ca_pool` via keyword arguments. Note that at - # least one keyword argument is 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 {::Google::Cloud::Security::PrivateCA::V1::CaPool#name name} of the - # {::Google::Cloud::Security::PrivateCA::V1::CaPool CaPool} to get. - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Cloud::Security::PrivateCA::V1::CaPool] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::Security::PrivateCA::V1::CaPool] - # - # @raise [::Google::Cloud::Error] if the REST call is aborted. - # - # @example Basic example - # require "google/cloud/security/private_ca/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Security::PrivateCA::V1::CertificateAuthorityService::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Security::PrivateCA::V1::GetCaPoolRequest.new - # - # # Call the get_ca_pool method. - # result = client.get_ca_pool request - # - # # The returned object is of type Google::Cloud::Security::PrivateCA::V1::CaPool. - # p result - # - def get_ca_pool request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Security::PrivateCA::V1::GetCaPoolRequest - - # Converts hash 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_ca_pool.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::Security::PrivateCA::V1::VERSION, - transports_version_send: [:rest] - - call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - options.apply_defaults timeout: @config.rpcs.get_ca_pool.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.get_ca_pool.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @certificate_authority_service_stub.get_ca_pool request, options do |result, operation| - yield result, operation if block_given? - end - rescue ::Gapic::Rest::Error => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Lists {::Google::Cloud::Security::PrivateCA::V1::CaPool CaPools}. - # - # @overload list_ca_pools(request, options = nil) - # Pass arguments to `list_ca_pools` via a request object, either of type - # {::Google::Cloud::Security::PrivateCA::V1::ListCaPoolsRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Security::PrivateCA::V1::ListCaPoolsRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_ca_pools(parent: nil, page_size: nil, page_token: nil, filter: nil, order_by: nil) - # Pass arguments to `list_ca_pools` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param parent [::String] - # Required. The resource name of the location associated with the - # {::Google::Cloud::Security::PrivateCA::V1::CaPool CaPools}, in the format - # `projects/*/locations/*`. - # @param page_size [::Integer] - # Optional. Limit on the number of - # {::Google::Cloud::Security::PrivateCA::V1::CaPool CaPools} to include in the - # response. Further {::Google::Cloud::Security::PrivateCA::V1::CaPool CaPools} can - # subsequently be obtained by including the - # {::Google::Cloud::Security::PrivateCA::V1::ListCaPoolsResponse#next_page_token ListCaPoolsResponse.next_page_token} - # in a subsequent request. If unspecified, the server will pick an - # appropriate default. - # @param page_token [::String] - # Optional. Pagination token, returned earlier via - # {::Google::Cloud::Security::PrivateCA::V1::ListCaPoolsResponse#next_page_token ListCaPoolsResponse.next_page_token}. - # @param filter [::String] - # Optional. Only include resources that match the filter in the response. - # @param order_by [::String] - # Optional. Specify how the results should be sorted. - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Gapic::Rest::PagedEnumerable<::Google::Cloud::Security::PrivateCA::V1::CaPool>] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Gapic::Rest::PagedEnumerable<::Google::Cloud::Security::PrivateCA::V1::CaPool>] - # - # @raise [::Google::Cloud::Error] if the REST call is aborted. - # - # @example Basic example - # require "google/cloud/security/private_ca/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Security::PrivateCA::V1::CertificateAuthorityService::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Security::PrivateCA::V1::ListCaPoolsRequest.new - # - # # Call the list_ca_pools method. - # result = client.list_ca_pools request - # - # # The returned object is of type Gapic::PagedEnumerable. You can iterate - # # over elements, and API calls will be issued to fetch pages as needed. - # result.each do |item| - # # Each element is of type ::Google::Cloud::Security::PrivateCA::V1::CaPool. - # p item - # end - # - def list_ca_pools request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Security::PrivateCA::V1::ListCaPoolsRequest - - # Converts hash 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_ca_pools.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::Security::PrivateCA::V1::VERSION, - transports_version_send: [:rest] - - call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - options.apply_defaults timeout: @config.rpcs.list_ca_pools.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.list_ca_pools.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @certificate_authority_service_stub.list_ca_pools request, options do |result, operation| - result = ::Gapic::Rest::PagedEnumerable.new @certificate_authority_service_stub, :list_ca_pools, "ca_pools", 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 - - ## - # Delete a {::Google::Cloud::Security::PrivateCA::V1::CaPool CaPool}. - # - # @overload delete_ca_pool(request, options = nil) - # Pass arguments to `delete_ca_pool` via a request object, either of type - # {::Google::Cloud::Security::PrivateCA::V1::DeleteCaPoolRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Security::PrivateCA::V1::DeleteCaPoolRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_ca_pool(name: nil, request_id: nil, ignore_dependent_resources: nil) - # Pass arguments to `delete_ca_pool` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param name [::String] - # Required. The resource name for this - # {::Google::Cloud::Security::PrivateCA::V1::CaPool CaPool} in the format - # `projects/*/locations/*/caPools/*`. - # @param request_id [::String] - # Optional. An ID to identify requests. Specify a unique request ID so that - # if you must retry your request, the server will know to ignore the request - # if it has already been completed. The server will guarantee that for at - # least 60 minutes since the first request. - # - # For example, consider a situation where you make an initial request and - # the request times out. If you make the request again with the same request - # ID, the server can check if original operation with the same request ID - # was received, and if so, will ignore the second request. This prevents - # clients from accidentally creating duplicate commitments. - # - # The request ID must be a valid UUID with the exception that zero UUID is - # not supported (00000000-0000-0000-0000-000000000000). - # @param ignore_dependent_resources [::Boolean] - # Optional. This field allows this pool to be deleted even if it's being - # depended on by another resource. However, doing so may result in unintended - # and unrecoverable effects on any dependent resources since the pool will - # no longer be able to issue certificates. - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Gapic::Operation] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Gapic::Operation] - # - # @raise [::Google::Cloud::Error] if the REST call is aborted. - # - # @example Basic example - # require "google/cloud/security/private_ca/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Security::PrivateCA::V1::CertificateAuthorityService::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Security::PrivateCA::V1::DeleteCaPoolRequest.new - # - # # Call the delete_ca_pool method. - # result = client.delete_ca_pool 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_ca_pool request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Security::PrivateCA::V1::DeleteCaPoolRequest - - # Converts hash 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_ca_pool.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::Security::PrivateCA::V1::VERSION, - transports_version_send: [:rest] - - call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - options.apply_defaults timeout: @config.rpcs.delete_ca_pool.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.delete_ca_pool.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @certificate_authority_service_stub.delete_ca_pool 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 - - ## - # FetchCaCerts returns the current trust anchor for the - # {::Google::Cloud::Security::PrivateCA::V1::CaPool CaPool}. This will include CA - # certificate chains for all certificate authorities in the ENABLED, - # DISABLED, or STAGED states. - # - # @overload fetch_ca_certs(request, options = nil) - # Pass arguments to `fetch_ca_certs` via a request object, either of type - # {::Google::Cloud::Security::PrivateCA::V1::FetchCaCertsRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Security::PrivateCA::V1::FetchCaCertsRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @overload fetch_ca_certs(ca_pool: nil, request_id: nil) - # Pass arguments to `fetch_ca_certs` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param ca_pool [::String] - # Required. The resource name for the - # {::Google::Cloud::Security::PrivateCA::V1::CaPool CaPool} in the format - # `projects/*/locations/*/caPools/*`. - # @param request_id [::String] - # Optional. An ID to identify requests. Specify a unique request ID so that - # if you must retry your request, the server will know to ignore the request - # if it has already been completed. The server will guarantee that for at - # least 60 minutes since the first request. - # - # For example, consider a situation where you make an initial request and - # the request times out. If you make the request again with the same request - # ID, the server can check if original operation with the same request ID - # was received, and if so, will ignore the second request. This prevents - # clients from accidentally creating duplicate commitments. - # - # The request ID must be a valid UUID with the exception that zero UUID is - # not supported (00000000-0000-0000-0000-000000000000). - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Cloud::Security::PrivateCA::V1::FetchCaCertsResponse] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::Security::PrivateCA::V1::FetchCaCertsResponse] - # - # @raise [::Google::Cloud::Error] if the REST call is aborted. - # - # @example Basic example - # require "google/cloud/security/private_ca/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Security::PrivateCA::V1::CertificateAuthorityService::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Security::PrivateCA::V1::FetchCaCertsRequest.new - # - # # Call the fetch_ca_certs method. - # result = client.fetch_ca_certs request - # - # # The returned object is of type Google::Cloud::Security::PrivateCA::V1::FetchCaCertsResponse. - # p result - # - def fetch_ca_certs request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Security::PrivateCA::V1::FetchCaCertsRequest - - # Converts hash 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.fetch_ca_certs.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::Security::PrivateCA::V1::VERSION, - transports_version_send: [:rest] - - call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - options.apply_defaults timeout: @config.rpcs.fetch_ca_certs.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.fetch_ca_certs.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @certificate_authority_service_stub.fetch_ca_certs request, options do |result, operation| - yield result, operation if block_given? - end - rescue ::Gapic::Rest::Error => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Returns a - # {::Google::Cloud::Security::PrivateCA::V1::CertificateRevocationList CertificateRevocationList}. - # - # @overload get_certificate_revocation_list(request, options = nil) - # Pass arguments to `get_certificate_revocation_list` via a request object, either of type - # {::Google::Cloud::Security::PrivateCA::V1::GetCertificateRevocationListRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Security::PrivateCA::V1::GetCertificateRevocationListRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_certificate_revocation_list(name: nil) - # Pass arguments to `get_certificate_revocation_list` via keyword arguments. Note that at - # least one keyword argument is 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 - # {::Google::Cloud::Security::PrivateCA::V1::CertificateRevocationList#name name} - # of the - # {::Google::Cloud::Security::PrivateCA::V1::CertificateRevocationList CertificateRevocationList} - # to get. - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Cloud::Security::PrivateCA::V1::CertificateRevocationList] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::Security::PrivateCA::V1::CertificateRevocationList] - # - # @raise [::Google::Cloud::Error] if the REST call is aborted. - # - # @example Basic example - # require "google/cloud/security/private_ca/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Security::PrivateCA::V1::CertificateAuthorityService::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Security::PrivateCA::V1::GetCertificateRevocationListRequest.new - # - # # Call the get_certificate_revocation_list method. - # result = client.get_certificate_revocation_list request - # - # # The returned object is of type Google::Cloud::Security::PrivateCA::V1::CertificateRevocationList. - # p result - # - def get_certificate_revocation_list request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Security::PrivateCA::V1::GetCertificateRevocationListRequest - - # Converts hash 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_certificate_revocation_list.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::Security::PrivateCA::V1::VERSION, - transports_version_send: [:rest] - - call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - options.apply_defaults timeout: @config.rpcs.get_certificate_revocation_list.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.get_certificate_revocation_list.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @certificate_authority_service_stub.get_certificate_revocation_list request, options do |result, operation| - yield result, operation if block_given? - end - rescue ::Gapic::Rest::Error => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Lists - # {::Google::Cloud::Security::PrivateCA::V1::CertificateRevocationList CertificateRevocationLists}. - # - # @overload list_certificate_revocation_lists(request, options = nil) - # Pass arguments to `list_certificate_revocation_lists` via a request object, either of type - # {::Google::Cloud::Security::PrivateCA::V1::ListCertificateRevocationListsRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Security::PrivateCA::V1::ListCertificateRevocationListsRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_certificate_revocation_lists(parent: nil, page_size: nil, page_token: nil, filter: nil, order_by: nil) - # Pass arguments to `list_certificate_revocation_lists` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param parent [::String] - # Required. The resource name of the location associated with the - # {::Google::Cloud::Security::PrivateCA::V1::CertificateRevocationList CertificateRevocationLists}, - # in the format `projects/*/locations/*/caPools/*/certificateAuthorities/*`. - # @param page_size [::Integer] - # Optional. Limit on the number of - # {::Google::Cloud::Security::PrivateCA::V1::CertificateRevocationList CertificateRevocationLists} - # to include in the response. Further - # {::Google::Cloud::Security::PrivateCA::V1::CertificateRevocationList CertificateRevocationLists} - # can subsequently be obtained by including the - # {::Google::Cloud::Security::PrivateCA::V1::ListCertificateRevocationListsResponse#next_page_token ListCertificateRevocationListsResponse.next_page_token} - # in a subsequent request. If unspecified, the server will pick an - # appropriate default. - # @param page_token [::String] - # Optional. Pagination token, returned earlier via - # {::Google::Cloud::Security::PrivateCA::V1::ListCertificateRevocationListsResponse#next_page_token ListCertificateRevocationListsResponse.next_page_token}. - # @param filter [::String] - # Optional. Only include resources that match the filter in the response. - # @param order_by [::String] - # Optional. Specify how the results should be sorted. - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Gapic::Rest::PagedEnumerable<::Google::Cloud::Security::PrivateCA::V1::CertificateRevocationList>] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Gapic::Rest::PagedEnumerable<::Google::Cloud::Security::PrivateCA::V1::CertificateRevocationList>] - # - # @raise [::Google::Cloud::Error] if the REST call is aborted. - # - # @example Basic example - # require "google/cloud/security/private_ca/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Security::PrivateCA::V1::CertificateAuthorityService::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Security::PrivateCA::V1::ListCertificateRevocationListsRequest.new - # - # # Call the list_certificate_revocation_lists method. - # result = client.list_certificate_revocation_lists request - # - # # The returned object is of type Gapic::PagedEnumerable. You can iterate - # # over elements, and API calls will be issued to fetch pages as needed. - # result.each do |item| - # # Each element is of type ::Google::Cloud::Security::PrivateCA::V1::CertificateRevocationList. - # p item - # end - # - def list_certificate_revocation_lists request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Security::PrivateCA::V1::ListCertificateRevocationListsRequest - - # Converts hash 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_certificate_revocation_lists.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::Security::PrivateCA::V1::VERSION, - transports_version_send: [:rest] - - call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - options.apply_defaults timeout: @config.rpcs.list_certificate_revocation_lists.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.list_certificate_revocation_lists.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @certificate_authority_service_stub.list_certificate_revocation_lists request, options do |result, operation| - result = ::Gapic::Rest::PagedEnumerable.new @certificate_authority_service_stub, :list_certificate_revocation_lists, "certificate_revocation_lists", 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 - - ## - # Update a - # {::Google::Cloud::Security::PrivateCA::V1::CertificateRevocationList CertificateRevocationList}. - # - # @overload update_certificate_revocation_list(request, options = nil) - # Pass arguments to `update_certificate_revocation_list` via a request object, either of type - # {::Google::Cloud::Security::PrivateCA::V1::UpdateCertificateRevocationListRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Security::PrivateCA::V1::UpdateCertificateRevocationListRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_certificate_revocation_list(certificate_revocation_list: nil, update_mask: nil, request_id: nil) - # Pass arguments to `update_certificate_revocation_list` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param certificate_revocation_list [::Google::Cloud::Security::PrivateCA::V1::CertificateRevocationList, ::Hash] - # Required. - # {::Google::Cloud::Security::PrivateCA::V1::CertificateRevocationList CertificateRevocationList} - # with updated values. - # @param update_mask [::Google::Protobuf::FieldMask, ::Hash] - # Required. A list of fields to be updated in this request. - # @param request_id [::String] - # Optional. An ID to identify requests. Specify a unique request ID so that - # if you must retry your request, the server will know to ignore the request - # if it has already been completed. The server will guarantee that for at - # least 60 minutes since the first request. - # - # For example, consider a situation where you make an initial request and - # the request times out. If you make the request again with the same request - # ID, the server can check if original operation with the same request ID - # was received, and if so, will ignore the second request. This prevents - # clients from accidentally creating duplicate commitments. - # - # The request ID must be a valid UUID with the exception that zero UUID is - # not supported (00000000-0000-0000-0000-000000000000). - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Gapic::Operation] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Gapic::Operation] - # - # @raise [::Google::Cloud::Error] if the REST call is aborted. - # - # @example Basic example - # require "google/cloud/security/private_ca/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Security::PrivateCA::V1::CertificateAuthorityService::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Security::PrivateCA::V1::UpdateCertificateRevocationListRequest.new - # - # # Call the update_certificate_revocation_list method. - # result = client.update_certificate_revocation_list 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_certificate_revocation_list request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Security::PrivateCA::V1::UpdateCertificateRevocationListRequest - - # Converts hash 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_certificate_revocation_list.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::Security::PrivateCA::V1::VERSION, - transports_version_send: [:rest] - - call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - options.apply_defaults timeout: @config.rpcs.update_certificate_revocation_list.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.update_certificate_revocation_list.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @certificate_authority_service_stub.update_certificate_revocation_list 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 - - ## - # Create a new - # {::Google::Cloud::Security::PrivateCA::V1::CertificateTemplate CertificateTemplate} - # in a given Project and Location. - # - # @overload create_certificate_template(request, options = nil) - # Pass arguments to `create_certificate_template` via a request object, either of type - # {::Google::Cloud::Security::PrivateCA::V1::CreateCertificateTemplateRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Security::PrivateCA::V1::CreateCertificateTemplateRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_certificate_template(parent: nil, certificate_template_id: nil, certificate_template: nil, request_id: nil) - # Pass arguments to `create_certificate_template` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param parent [::String] - # Required. The resource name of the location associated with the - # {::Google::Cloud::Security::PrivateCA::V1::CertificateTemplate CertificateTemplate}, - # in the format `projects/*/locations/*`. - # @param certificate_template_id [::String] - # Required. It must be unique within a location and match the regular - # expression `[a-zA-Z0-9_-]{1,63}` - # @param certificate_template [::Google::Cloud::Security::PrivateCA::V1::CertificateTemplate, ::Hash] - # Required. A - # {::Google::Cloud::Security::PrivateCA::V1::CertificateTemplate CertificateTemplate} - # with initial field values. - # @param request_id [::String] - # Optional. An ID to identify requests. Specify a unique request ID so that - # if you must retry your request, the server will know to ignore the request - # if it has already been completed. The server will guarantee that for at - # least 60 minutes since the first request. - # - # For example, consider a situation where you make an initial request and - # the request times out. If you make the request again with the same request - # ID, the server can check if original operation with the same request ID - # was received, and if so, will ignore the second request. This prevents - # clients from accidentally creating duplicate commitments. - # - # The request ID must be a valid UUID with the exception that zero UUID is - # not supported (00000000-0000-0000-0000-000000000000). - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Gapic::Operation] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Gapic::Operation] - # - # @raise [::Google::Cloud::Error] if the REST call is aborted. - # - # @example Basic example - # require "google/cloud/security/private_ca/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Security::PrivateCA::V1::CertificateAuthorityService::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Security::PrivateCA::V1::CreateCertificateTemplateRequest.new - # - # # Call the create_certificate_template method. - # result = client.create_certificate_template 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_certificate_template request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Security::PrivateCA::V1::CreateCertificateTemplateRequest - - # Converts hash 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_certificate_template.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::Security::PrivateCA::V1::VERSION, - transports_version_send: [:rest] - - call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - options.apply_defaults timeout: @config.rpcs.create_certificate_template.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.create_certificate_template.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @certificate_authority_service_stub.create_certificate_template 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 - - ## - # DeleteCertificateTemplate deletes a - # {::Google::Cloud::Security::PrivateCA::V1::CertificateTemplate CertificateTemplate}. - # - # @overload delete_certificate_template(request, options = nil) - # Pass arguments to `delete_certificate_template` via a request object, either of type - # {::Google::Cloud::Security::PrivateCA::V1::DeleteCertificateTemplateRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Security::PrivateCA::V1::DeleteCertificateTemplateRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_certificate_template(name: nil, request_id: nil) - # Pass arguments to `delete_certificate_template` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param name [::String] - # Required. The resource name for this - # {::Google::Cloud::Security::PrivateCA::V1::CertificateTemplate CertificateTemplate} - # in the format `projects/*/locations/*/certificateTemplates/*`. - # @param request_id [::String] - # Optional. An ID to identify requests. Specify a unique request ID so that - # if you must retry your request, the server will know to ignore the request - # if it has already been completed. The server will guarantee that for at - # least 60 minutes since the first request. - # - # For example, consider a situation where you make an initial request and - # the request times out. If you make the request again with the same request - # ID, the server can check if original operation with the same request ID - # was received, and if so, will ignore the second request. This prevents - # clients from accidentally creating duplicate commitments. - # - # The request ID must be a valid UUID with the exception that zero UUID is - # not supported (00000000-0000-0000-0000-000000000000). - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Gapic::Operation] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Gapic::Operation] - # - # @raise [::Google::Cloud::Error] if the REST call is aborted. - # - # @example Basic example - # require "google/cloud/security/private_ca/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Security::PrivateCA::V1::CertificateAuthorityService::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Security::PrivateCA::V1::DeleteCertificateTemplateRequest.new - # - # # Call the delete_certificate_template method. - # result = client.delete_certificate_template 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_certificate_template request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Security::PrivateCA::V1::DeleteCertificateTemplateRequest - - # Converts hash 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_certificate_template.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::Security::PrivateCA::V1::VERSION, - transports_version_send: [:rest] - - call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - options.apply_defaults timeout: @config.rpcs.delete_certificate_template.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.delete_certificate_template.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @certificate_authority_service_stub.delete_certificate_template 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 - - ## - # Returns a - # {::Google::Cloud::Security::PrivateCA::V1::CertificateTemplate CertificateTemplate}. - # - # @overload get_certificate_template(request, options = nil) - # Pass arguments to `get_certificate_template` via a request object, either of type - # {::Google::Cloud::Security::PrivateCA::V1::GetCertificateTemplateRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Security::PrivateCA::V1::GetCertificateTemplateRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_certificate_template(name: nil) - # Pass arguments to `get_certificate_template` via keyword arguments. Note that at - # least one keyword argument is 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 - # {::Google::Cloud::Security::PrivateCA::V1::CertificateTemplate#name name} of the - # {::Google::Cloud::Security::PrivateCA::V1::CertificateTemplate CertificateTemplate} - # to get. - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Cloud::Security::PrivateCA::V1::CertificateTemplate] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::Security::PrivateCA::V1::CertificateTemplate] - # - # @raise [::Google::Cloud::Error] if the REST call is aborted. - # - # @example Basic example - # require "google/cloud/security/private_ca/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Security::PrivateCA::V1::CertificateAuthorityService::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Security::PrivateCA::V1::GetCertificateTemplateRequest.new - # - # # Call the get_certificate_template method. - # result = client.get_certificate_template request - # - # # The returned object is of type Google::Cloud::Security::PrivateCA::V1::CertificateTemplate. - # p result - # - def get_certificate_template request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Security::PrivateCA::V1::GetCertificateTemplateRequest - - # Converts hash 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_certificate_template.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::Security::PrivateCA::V1::VERSION, - transports_version_send: [:rest] - - call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - options.apply_defaults timeout: @config.rpcs.get_certificate_template.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.get_certificate_template.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @certificate_authority_service_stub.get_certificate_template request, options do |result, operation| - yield result, operation if block_given? - end - rescue ::Gapic::Rest::Error => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Lists - # {::Google::Cloud::Security::PrivateCA::V1::CertificateTemplate CertificateTemplates}. - # - # @overload list_certificate_templates(request, options = nil) - # Pass arguments to `list_certificate_templates` via a request object, either of type - # {::Google::Cloud::Security::PrivateCA::V1::ListCertificateTemplatesRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Security::PrivateCA::V1::ListCertificateTemplatesRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_certificate_templates(parent: nil, page_size: nil, page_token: nil, filter: nil, order_by: nil) - # Pass arguments to `list_certificate_templates` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param parent [::String] - # Required. The resource name of the location associated with the - # {::Google::Cloud::Security::PrivateCA::V1::CertificateTemplate CertificateTemplates}, - # in the format `projects/*/locations/*`. - # @param page_size [::Integer] - # Optional. Limit on the number of - # {::Google::Cloud::Security::PrivateCA::V1::CertificateTemplate CertificateTemplates} - # to include in the response. Further - # {::Google::Cloud::Security::PrivateCA::V1::CertificateTemplate CertificateTemplates} - # can subsequently be obtained by including the - # {::Google::Cloud::Security::PrivateCA::V1::ListCertificateTemplatesResponse#next_page_token ListCertificateTemplatesResponse.next_page_token} - # in a subsequent request. If unspecified, the server will pick an - # appropriate default. - # @param page_token [::String] - # Optional. Pagination token, returned earlier via - # {::Google::Cloud::Security::PrivateCA::V1::ListCertificateTemplatesResponse#next_page_token ListCertificateTemplatesResponse.next_page_token}. - # @param filter [::String] - # Optional. Only include resources that match the filter in the response. - # @param order_by [::String] - # Optional. Specify how the results should be sorted. - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Gapic::Rest::PagedEnumerable<::Google::Cloud::Security::PrivateCA::V1::CertificateTemplate>] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Gapic::Rest::PagedEnumerable<::Google::Cloud::Security::PrivateCA::V1::CertificateTemplate>] - # - # @raise [::Google::Cloud::Error] if the REST call is aborted. - # - # @example Basic example - # require "google/cloud/security/private_ca/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Security::PrivateCA::V1::CertificateAuthorityService::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Security::PrivateCA::V1::ListCertificateTemplatesRequest.new - # - # # Call the list_certificate_templates method. - # result = client.list_certificate_templates request - # - # # The returned object is of type Gapic::PagedEnumerable. You can iterate - # # over elements, and API calls will be issued to fetch pages as needed. - # result.each do |item| - # # Each element is of type ::Google::Cloud::Security::PrivateCA::V1::CertificateTemplate. - # p item - # end - # - def list_certificate_templates request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Security::PrivateCA::V1::ListCertificateTemplatesRequest - - # Converts hash 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_certificate_templates.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::Security::PrivateCA::V1::VERSION, - transports_version_send: [:rest] - - call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - options.apply_defaults timeout: @config.rpcs.list_certificate_templates.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.list_certificate_templates.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @certificate_authority_service_stub.list_certificate_templates request, options do |result, operation| - result = ::Gapic::Rest::PagedEnumerable.new @certificate_authority_service_stub, :list_certificate_templates, "certificate_templates", 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 - - ## - # Update a - # {::Google::Cloud::Security::PrivateCA::V1::CertificateTemplate CertificateTemplate}. - # - # @overload update_certificate_template(request, options = nil) - # Pass arguments to `update_certificate_template` via a request object, either of type - # {::Google::Cloud::Security::PrivateCA::V1::UpdateCertificateTemplateRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Security::PrivateCA::V1::UpdateCertificateTemplateRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_certificate_template(certificate_template: nil, update_mask: nil, request_id: nil) - # Pass arguments to `update_certificate_template` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param certificate_template [::Google::Cloud::Security::PrivateCA::V1::CertificateTemplate, ::Hash] - # Required. - # {::Google::Cloud::Security::PrivateCA::V1::CertificateTemplate CertificateTemplate} - # with updated values. - # @param update_mask [::Google::Protobuf::FieldMask, ::Hash] - # Required. A list of fields to be updated in this request. - # @param request_id [::String] - # Optional. An ID to identify requests. Specify a unique request ID so that - # if you must retry your request, the server will know to ignore the request - # if it has already been completed. The server will guarantee that for at - # least 60 minutes since the first request. - # - # For example, consider a situation where you make an initial request and - # the request times out. If you make the request again with the same request - # ID, the server can check if original operation with the same request ID - # was received, and if so, will ignore the second request. This prevents - # clients from accidentally creating duplicate commitments. - # - # The request ID must be a valid UUID with the exception that zero UUID is - # not supported (00000000-0000-0000-0000-000000000000). - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Gapic::Operation] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Gapic::Operation] - # - # @raise [::Google::Cloud::Error] if the REST call is aborted. - # - # @example Basic example - # require "google/cloud/security/private_ca/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Security::PrivateCA::V1::CertificateAuthorityService::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Security::PrivateCA::V1::UpdateCertificateTemplateRequest.new - # - # # Call the update_certificate_template method. - # result = client.update_certificate_template 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_certificate_template request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Security::PrivateCA::V1::UpdateCertificateTemplateRequest - - # Converts hash 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_certificate_template.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::Security::PrivateCA::V1::VERSION, - transports_version_send: [:rest] - - call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - options.apply_defaults timeout: @config.rpcs.update_certificate_template.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.update_certificate_template.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @certificate_authority_service_stub.update_certificate_template 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 - - ## - # Configuration class for the CertificateAuthorityService REST API. - # - # This class represents the configuration for CertificateAuthorityService REST, - # providing control over timeouts, retry behavior, logging, transport - # parameters, and other low-level controls. Certain parameters can also be - # applied individually to specific RPCs. See - # {::Google::Cloud::Security::PrivateCA::V1::CertificateAuthorityService::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_certificate to 20 seconds, - # # and all remaining timeouts to 10 seconds. - # ::Google::Cloud::Security::PrivateCA::V1::CertificateAuthorityService::Rest::Client.configure do |config| - # config.timeout = 10.0 - # config.rpcs.create_certificate.timeout = 20.0 - # end - # - # # Apply the above configuration only to a new client. - # client = ::Google::Cloud::Security::PrivateCA::V1::CertificateAuthorityService::Rest::Client.new do |config| - # config.timeout = 10.0 - # config.rpcs.create_certificate.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 = "privateca.googleapis.com" - - config_attr :endpoint, nil, ::String, nil - config_attr :credentials, nil do |value| - allowed = [::String, ::Hash, ::Proc, ::Symbol, ::Google::Auth::Credentials, ::Google::Auth::BaseClient, ::Signet::OAuth2::Client, nil] - allowed.any? { |klass| klass === value } - end - config_attr :scope, nil, ::String, ::Array, nil - config_attr :lib_name, nil, ::String, nil - config_attr :lib_version, nil, ::String, nil - config_attr :timeout, nil, ::Numeric, nil - config_attr :metadata, nil, ::Hash, nil - config_attr :retry_policy, nil, ::Hash, ::Proc, nil - config_attr :quota_project, nil, ::String, nil - config_attr :universe_domain, nil, ::String, nil - - # @private - # Overrides for http bindings for the RPCs of this service - # are only used when this service is used as mixin, and only - # by the host service. - # @return [::Hash{::Symbol=>::Array<::Gapic::Rest::GrpcTranscoder::HttpBinding>}] - config_attr :bindings_override, {}, ::Hash, nil - config_attr :logger, :default, ::Logger, nil, :default - - # @private - def initialize parent_config = nil - @parent_config = parent_config unless parent_config.nil? - - yield self if block_given? - end - - ## - # Configurations for individual RPCs - # @return [Rpcs] - # - def rpcs - @rpcs ||= begin - parent_rpcs = nil - parent_rpcs = @parent_config.rpcs if defined?(@parent_config) && @parent_config.respond_to?(:rpcs) - Rpcs.new parent_rpcs - end - end - - ## - # Configuration RPC class for the CertificateAuthorityService 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_certificate` - # @return [::Gapic::Config::Method] - # - attr_reader :create_certificate - ## - # RPC-specific configuration for `get_certificate` - # @return [::Gapic::Config::Method] - # - attr_reader :get_certificate - ## - # RPC-specific configuration for `list_certificates` - # @return [::Gapic::Config::Method] - # - attr_reader :list_certificates - ## - # RPC-specific configuration for `revoke_certificate` - # @return [::Gapic::Config::Method] - # - attr_reader :revoke_certificate - ## - # RPC-specific configuration for `update_certificate` - # @return [::Gapic::Config::Method] - # - attr_reader :update_certificate - ## - # RPC-specific configuration for `activate_certificate_authority` - # @return [::Gapic::Config::Method] - # - attr_reader :activate_certificate_authority - ## - # RPC-specific configuration for `create_certificate_authority` - # @return [::Gapic::Config::Method] - # - attr_reader :create_certificate_authority - ## - # RPC-specific configuration for `disable_certificate_authority` - # @return [::Gapic::Config::Method] - # - attr_reader :disable_certificate_authority - ## - # RPC-specific configuration for `enable_certificate_authority` - # @return [::Gapic::Config::Method] - # - attr_reader :enable_certificate_authority - ## - # RPC-specific configuration for `fetch_certificate_authority_csr` - # @return [::Gapic::Config::Method] - # - attr_reader :fetch_certificate_authority_csr - ## - # RPC-specific configuration for `get_certificate_authority` - # @return [::Gapic::Config::Method] - # - attr_reader :get_certificate_authority - ## - # RPC-specific configuration for `list_certificate_authorities` - # @return [::Gapic::Config::Method] - # - attr_reader :list_certificate_authorities - ## - # RPC-specific configuration for `undelete_certificate_authority` - # @return [::Gapic::Config::Method] - # - attr_reader :undelete_certificate_authority - ## - # RPC-specific configuration for `delete_certificate_authority` - # @return [::Gapic::Config::Method] - # - attr_reader :delete_certificate_authority - ## - # RPC-specific configuration for `update_certificate_authority` - # @return [::Gapic::Config::Method] - # - attr_reader :update_certificate_authority - ## - # RPC-specific configuration for `create_ca_pool` - # @return [::Gapic::Config::Method] - # - attr_reader :create_ca_pool - ## - # RPC-specific configuration for `update_ca_pool` - # @return [::Gapic::Config::Method] - # - attr_reader :update_ca_pool - ## - # RPC-specific configuration for `get_ca_pool` - # @return [::Gapic::Config::Method] - # - attr_reader :get_ca_pool - ## - # RPC-specific configuration for `list_ca_pools` - # @return [::Gapic::Config::Method] - # - attr_reader :list_ca_pools - ## - # RPC-specific configuration for `delete_ca_pool` - # @return [::Gapic::Config::Method] - # - attr_reader :delete_ca_pool - ## - # RPC-specific configuration for `fetch_ca_certs` - # @return [::Gapic::Config::Method] - # - attr_reader :fetch_ca_certs - ## - # RPC-specific configuration for `get_certificate_revocation_list` - # @return [::Gapic::Config::Method] - # - attr_reader :get_certificate_revocation_list - ## - # RPC-specific configuration for `list_certificate_revocation_lists` - # @return [::Gapic::Config::Method] - # - attr_reader :list_certificate_revocation_lists - ## - # RPC-specific configuration for `update_certificate_revocation_list` - # @return [::Gapic::Config::Method] - # - attr_reader :update_certificate_revocation_list - ## - # RPC-specific configuration for `create_certificate_template` - # @return [::Gapic::Config::Method] - # - attr_reader :create_certificate_template - ## - # RPC-specific configuration for `delete_certificate_template` - # @return [::Gapic::Config::Method] - # - attr_reader :delete_certificate_template - ## - # RPC-specific configuration for `get_certificate_template` - # @return [::Gapic::Config::Method] - # - attr_reader :get_certificate_template - ## - # RPC-specific configuration for `list_certificate_templates` - # @return [::Gapic::Config::Method] - # - attr_reader :list_certificate_templates - ## - # RPC-specific configuration for `update_certificate_template` - # @return [::Gapic::Config::Method] - # - attr_reader :update_certificate_template - - # @private - def initialize parent_rpcs = nil - create_certificate_config = parent_rpcs.create_certificate if parent_rpcs.respond_to? :create_certificate - @create_certificate = ::Gapic::Config::Method.new create_certificate_config - get_certificate_config = parent_rpcs.get_certificate if parent_rpcs.respond_to? :get_certificate - @get_certificate = ::Gapic::Config::Method.new get_certificate_config - list_certificates_config = parent_rpcs.list_certificates if parent_rpcs.respond_to? :list_certificates - @list_certificates = ::Gapic::Config::Method.new list_certificates_config - revoke_certificate_config = parent_rpcs.revoke_certificate if parent_rpcs.respond_to? :revoke_certificate - @revoke_certificate = ::Gapic::Config::Method.new revoke_certificate_config - update_certificate_config = parent_rpcs.update_certificate if parent_rpcs.respond_to? :update_certificate - @update_certificate = ::Gapic::Config::Method.new update_certificate_config - activate_certificate_authority_config = parent_rpcs.activate_certificate_authority if parent_rpcs.respond_to? :activate_certificate_authority - @activate_certificate_authority = ::Gapic::Config::Method.new activate_certificate_authority_config - create_certificate_authority_config = parent_rpcs.create_certificate_authority if parent_rpcs.respond_to? :create_certificate_authority - @create_certificate_authority = ::Gapic::Config::Method.new create_certificate_authority_config - disable_certificate_authority_config = parent_rpcs.disable_certificate_authority if parent_rpcs.respond_to? :disable_certificate_authority - @disable_certificate_authority = ::Gapic::Config::Method.new disable_certificate_authority_config - enable_certificate_authority_config = parent_rpcs.enable_certificate_authority if parent_rpcs.respond_to? :enable_certificate_authority - @enable_certificate_authority = ::Gapic::Config::Method.new enable_certificate_authority_config - fetch_certificate_authority_csr_config = parent_rpcs.fetch_certificate_authority_csr if parent_rpcs.respond_to? :fetch_certificate_authority_csr - @fetch_certificate_authority_csr = ::Gapic::Config::Method.new fetch_certificate_authority_csr_config - get_certificate_authority_config = parent_rpcs.get_certificate_authority if parent_rpcs.respond_to? :get_certificate_authority - @get_certificate_authority = ::Gapic::Config::Method.new get_certificate_authority_config - list_certificate_authorities_config = parent_rpcs.list_certificate_authorities if parent_rpcs.respond_to? :list_certificate_authorities - @list_certificate_authorities = ::Gapic::Config::Method.new list_certificate_authorities_config - undelete_certificate_authority_config = parent_rpcs.undelete_certificate_authority if parent_rpcs.respond_to? :undelete_certificate_authority - @undelete_certificate_authority = ::Gapic::Config::Method.new undelete_certificate_authority_config - delete_certificate_authority_config = parent_rpcs.delete_certificate_authority if parent_rpcs.respond_to? :delete_certificate_authority - @delete_certificate_authority = ::Gapic::Config::Method.new delete_certificate_authority_config - update_certificate_authority_config = parent_rpcs.update_certificate_authority if parent_rpcs.respond_to? :update_certificate_authority - @update_certificate_authority = ::Gapic::Config::Method.new update_certificate_authority_config - create_ca_pool_config = parent_rpcs.create_ca_pool if parent_rpcs.respond_to? :create_ca_pool - @create_ca_pool = ::Gapic::Config::Method.new create_ca_pool_config - update_ca_pool_config = parent_rpcs.update_ca_pool if parent_rpcs.respond_to? :update_ca_pool - @update_ca_pool = ::Gapic::Config::Method.new update_ca_pool_config - get_ca_pool_config = parent_rpcs.get_ca_pool if parent_rpcs.respond_to? :get_ca_pool - @get_ca_pool = ::Gapic::Config::Method.new get_ca_pool_config - list_ca_pools_config = parent_rpcs.list_ca_pools if parent_rpcs.respond_to? :list_ca_pools - @list_ca_pools = ::Gapic::Config::Method.new list_ca_pools_config - delete_ca_pool_config = parent_rpcs.delete_ca_pool if parent_rpcs.respond_to? :delete_ca_pool - @delete_ca_pool = ::Gapic::Config::Method.new delete_ca_pool_config - fetch_ca_certs_config = parent_rpcs.fetch_ca_certs if parent_rpcs.respond_to? :fetch_ca_certs - @fetch_ca_certs = ::Gapic::Config::Method.new fetch_ca_certs_config - get_certificate_revocation_list_config = parent_rpcs.get_certificate_revocation_list if parent_rpcs.respond_to? :get_certificate_revocation_list - @get_certificate_revocation_list = ::Gapic::Config::Method.new get_certificate_revocation_list_config - list_certificate_revocation_lists_config = parent_rpcs.list_certificate_revocation_lists if parent_rpcs.respond_to? :list_certificate_revocation_lists - @list_certificate_revocation_lists = ::Gapic::Config::Method.new list_certificate_revocation_lists_config - update_certificate_revocation_list_config = parent_rpcs.update_certificate_revocation_list if parent_rpcs.respond_to? :update_certificate_revocation_list - @update_certificate_revocation_list = ::Gapic::Config::Method.new update_certificate_revocation_list_config - create_certificate_template_config = parent_rpcs.create_certificate_template if parent_rpcs.respond_to? :create_certificate_template - @create_certificate_template = ::Gapic::Config::Method.new create_certificate_template_config - delete_certificate_template_config = parent_rpcs.delete_certificate_template if parent_rpcs.respond_to? :delete_certificate_template - @delete_certificate_template = ::Gapic::Config::Method.new delete_certificate_template_config - get_certificate_template_config = parent_rpcs.get_certificate_template if parent_rpcs.respond_to? :get_certificate_template - @get_certificate_template = ::Gapic::Config::Method.new get_certificate_template_config - list_certificate_templates_config = parent_rpcs.list_certificate_templates if parent_rpcs.respond_to? :list_certificate_templates - @list_certificate_templates = ::Gapic::Config::Method.new list_certificate_templates_config - update_certificate_template_config = parent_rpcs.update_certificate_template if parent_rpcs.respond_to? :update_certificate_template - @update_certificate_template = ::Gapic::Config::Method.new update_certificate_template_config - - yield self if block_given? - end - end - end - end - end - end - end - end - end - end -end diff --git a/owl-bot-staging/google-cloud-security-private_ca-v1/lib/google/cloud/security/private_ca/v1/certificate_authority_service/rest/operations.rb b/owl-bot-staging/google-cloud-security-private_ca-v1/lib/google/cloud/security/private_ca/v1/certificate_authority_service/rest/operations.rb deleted file mode 100644 index 16b00060e07e..000000000000 --- a/owl-bot-staging/google-cloud-security-private_ca-v1/lib/google/cloud/security/private_ca/v1/certificate_authority_service/rest/operations.rb +++ /dev/null @@ -1,927 +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 Cloud - module Security - module PrivateCA - module V1 - module CertificateAuthorityService - module Rest - # Service that implements Longrunning Operations API. - class Operations - # @private - API_VERSION = "" - - # @private - DEFAULT_ENDPOINT_TEMPLATE = "privateca.$UNIVERSE_DOMAIN$" - - # @private - attr_reader :operations_stub - - ## - # Configuration for the CertificateAuthorityService 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 CertificateAuthorityService 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::Security::PrivateCA::V1::VERSION, - transports_version_send: [:rest] - - call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - options.apply_defaults timeout: @config.rpcs.list_operations.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.list_operations.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @operations_stub.list_operations request, options do |result, operation| - result = ::Gapic::Rest::PagedEnumerable.new @operations_stub, :list_operations, "operations", request, result, options - yield result, operation if block_given? - 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::Security::PrivateCA::V1::VERSION, - transports_version_send: [:rest] - - call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - options.apply_defaults timeout: @config.rpcs.get_operation.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.get_operation.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @operations_stub.get_operation request, options do |result, operation| - result = ::Gapic::Operation.new result, @operations_client, options: options - yield result, operation if block_given? - 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::Security::PrivateCA::V1::VERSION, - transports_version_send: [:rest] - - call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - options.apply_defaults timeout: @config.rpcs.delete_operation.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.delete_operation.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @operations_stub.delete_operation request, options do |result, operation| - yield result, operation if block_given? - 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::Security::PrivateCA::V1::VERSION, - transports_version_send: [:rest] - - call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - options.apply_defaults timeout: @config.rpcs.cancel_operation.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.cancel_operation.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @operations_stub.cancel_operation request, options do |result, operation| - yield result, operation if block_given? - 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 = "privateca.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}/operations", - matches: [ - ["name", %r{^projects/[^/]+/locations/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the get_operation REST call - # - # @param request_pb [::Google::Longrunning::GetOperationRequest] - # A request object representing the call parameters. Required. - # @return [Array(String, [String, nil], Hash{String => String})] - # Uri, Body, Query string parameters - def self.transcode_get_operation_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :get, - uri_template: "/v1/{name}", - matches: [ - ["name", %r{^projects/[^/]+/locations/[^/]+/operations/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the delete_operation REST call - # - # @param request_pb [::Google::Longrunning::DeleteOperationRequest] - # A request object representing the call parameters. Required. - # @return [Array(String, [String, nil], Hash{String => String})] - # Uri, Body, Query string parameters - def self.transcode_delete_operation_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :delete, - uri_template: "/v1/{name}", - matches: [ - ["name", %r{^projects/[^/]+/locations/[^/]+/operations/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the cancel_operation REST call - # - # @param request_pb [::Google::Longrunning::CancelOperationRequest] - # A request object representing the call parameters. Required. - # @return [Array(String, [String, nil], Hash{String => String})] - # Uri, Body, Query string parameters - def self.transcode_cancel_operation_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :post, - uri_template: "/v1/{name}:cancel", - body: "*", - matches: [ - ["name", %r{^projects/[^/]+/locations/[^/]+/operations/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - end - end - end - end - end - end - end -end diff --git a/owl-bot-staging/google-cloud-security-private_ca-v1/lib/google/cloud/security/private_ca/v1/certificate_authority_service/rest/service_stub.rb b/owl-bot-staging/google-cloud-security-private_ca-v1/lib/google/cloud/security/private_ca/v1/certificate_authority_service/rest/service_stub.rb deleted file mode 100644 index 1665c56a8de6..000000000000 --- a/owl-bot-staging/google-cloud-security-private_ca-v1/lib/google/cloud/security/private_ca/v1/certificate_authority_service/rest/service_stub.rb +++ /dev/null @@ -1,1867 +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/security/privateca/v1/service_pb" - -module Google - module Cloud - module Security - module PrivateCA - module V1 - module CertificateAuthorityService - module Rest - ## - # REST service stub for the CertificateAuthorityService 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_certificate REST call - # - # @param request_pb [::Google::Cloud::Security::PrivateCA::V1::CreateCertificateRequest] - # A request object representing the call parameters. Required. - # @param options [::Gapic::CallOptions] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Cloud::Security::PrivateCA::V1::Certificate] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::Security::PrivateCA::V1::Certificate] - # A result object deserialized from the server's reply - def create_certificate request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_create_certificate_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_certificate", - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Cloud::Security::PrivateCA::V1::Certificate.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_certificate REST call - # - # @param request_pb [::Google::Cloud::Security::PrivateCA::V1::GetCertificateRequest] - # A request object representing the call parameters. Required. - # @param options [::Gapic::CallOptions] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Cloud::Security::PrivateCA::V1::Certificate] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::Security::PrivateCA::V1::Certificate] - # A result object deserialized from the server's reply - def get_certificate request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_get_certificate_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_certificate", - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Cloud::Security::PrivateCA::V1::Certificate.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_certificates REST call - # - # @param request_pb [::Google::Cloud::Security::PrivateCA::V1::ListCertificatesRequest] - # A request object representing the call parameters. Required. - # @param options [::Gapic::CallOptions] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Cloud::Security::PrivateCA::V1::ListCertificatesResponse] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::Security::PrivateCA::V1::ListCertificatesResponse] - # A result object deserialized from the server's reply - def list_certificates request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_list_certificates_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_certificates", - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Cloud::Security::PrivateCA::V1::ListCertificatesResponse.decode_json response.body, ignore_unknown_fields: true - catch :response do - yield result, operation if block_given? - result - end - end - - ## - # Baseline implementation for the revoke_certificate REST call - # - # @param request_pb [::Google::Cloud::Security::PrivateCA::V1::RevokeCertificateRequest] - # A request object representing the call parameters. Required. - # @param options [::Gapic::CallOptions] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Cloud::Security::PrivateCA::V1::Certificate] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::Security::PrivateCA::V1::Certificate] - # A result object deserialized from the server's reply - def revoke_certificate request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_revoke_certificate_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: "revoke_certificate", - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Cloud::Security::PrivateCA::V1::Certificate.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_certificate REST call - # - # @param request_pb [::Google::Cloud::Security::PrivateCA::V1::UpdateCertificateRequest] - # A request object representing the call parameters. Required. - # @param options [::Gapic::CallOptions] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Cloud::Security::PrivateCA::V1::Certificate] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::Security::PrivateCA::V1::Certificate] - # A result object deserialized from the server's reply - def update_certificate request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_update_certificate_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_certificate", - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Cloud::Security::PrivateCA::V1::Certificate.decode_json response.body, ignore_unknown_fields: true - catch :response do - yield result, operation if block_given? - result - end - end - - ## - # Baseline implementation for the activate_certificate_authority REST call - # - # @param request_pb [::Google::Cloud::Security::PrivateCA::V1::ActivateCertificateAuthorityRequest] - # 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 activate_certificate_authority request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_activate_certificate_authority_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: "activate_certificate_authority", - 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 create_certificate_authority REST call - # - # @param request_pb [::Google::Cloud::Security::PrivateCA::V1::CreateCertificateAuthorityRequest] - # 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_certificate_authority request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_create_certificate_authority_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_certificate_authority", - 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 disable_certificate_authority REST call - # - # @param request_pb [::Google::Cloud::Security::PrivateCA::V1::DisableCertificateAuthorityRequest] - # 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 disable_certificate_authority request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_disable_certificate_authority_request request_pb - query_string_params = if query_string_params.any? - query_string_params.to_h { |p| p.split "=", 2 } - else - {} - end - - response = @client_stub.make_http_request( - verb, - uri: uri, - body: body || "", - params: query_string_params, - method_name: "disable_certificate_authority", - 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 enable_certificate_authority REST call - # - # @param request_pb [::Google::Cloud::Security::PrivateCA::V1::EnableCertificateAuthorityRequest] - # 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 enable_certificate_authority request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_enable_certificate_authority_request request_pb - query_string_params = if query_string_params.any? - query_string_params.to_h { |p| p.split "=", 2 } - else - {} - end - - response = @client_stub.make_http_request( - verb, - uri: uri, - body: body || "", - params: query_string_params, - method_name: "enable_certificate_authority", - 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 fetch_certificate_authority_csr REST call - # - # @param request_pb [::Google::Cloud::Security::PrivateCA::V1::FetchCertificateAuthorityCsrRequest] - # A request object representing the call parameters. Required. - # @param options [::Gapic::CallOptions] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Cloud::Security::PrivateCA::V1::FetchCertificateAuthorityCsrResponse] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::Security::PrivateCA::V1::FetchCertificateAuthorityCsrResponse] - # A result object deserialized from the server's reply - def fetch_certificate_authority_csr request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_fetch_certificate_authority_csr_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: "fetch_certificate_authority_csr", - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Cloud::Security::PrivateCA::V1::FetchCertificateAuthorityCsrResponse.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_certificate_authority REST call - # - # @param request_pb [::Google::Cloud::Security::PrivateCA::V1::GetCertificateAuthorityRequest] - # A request object representing the call parameters. Required. - # @param options [::Gapic::CallOptions] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Cloud::Security::PrivateCA::V1::CertificateAuthority] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::Security::PrivateCA::V1::CertificateAuthority] - # A result object deserialized from the server's reply - def get_certificate_authority request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_get_certificate_authority_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_certificate_authority", - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Cloud::Security::PrivateCA::V1::CertificateAuthority.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_certificate_authorities REST call - # - # @param request_pb [::Google::Cloud::Security::PrivateCA::V1::ListCertificateAuthoritiesRequest] - # A request object representing the call parameters. Required. - # @param options [::Gapic::CallOptions] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Cloud::Security::PrivateCA::V1::ListCertificateAuthoritiesResponse] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::Security::PrivateCA::V1::ListCertificateAuthoritiesResponse] - # A result object deserialized from the server's reply - def list_certificate_authorities request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_list_certificate_authorities_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_certificate_authorities", - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Cloud::Security::PrivateCA::V1::ListCertificateAuthoritiesResponse.decode_json response.body, ignore_unknown_fields: true - catch :response do - yield result, operation if block_given? - result - end - end - - ## - # Baseline implementation for the undelete_certificate_authority REST call - # - # @param request_pb [::Google::Cloud::Security::PrivateCA::V1::UndeleteCertificateAuthorityRequest] - # 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 undelete_certificate_authority request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_undelete_certificate_authority_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: "undelete_certificate_authority", - 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_certificate_authority REST call - # - # @param request_pb [::Google::Cloud::Security::PrivateCA::V1::DeleteCertificateAuthorityRequest] - # 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_certificate_authority request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_delete_certificate_authority_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_certificate_authority", - 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 update_certificate_authority REST call - # - # @param request_pb [::Google::Cloud::Security::PrivateCA::V1::UpdateCertificateAuthorityRequest] - # 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_certificate_authority request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_update_certificate_authority_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_certificate_authority", - 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 create_ca_pool REST call - # - # @param request_pb [::Google::Cloud::Security::PrivateCA::V1::CreateCaPoolRequest] - # 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_ca_pool request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_create_ca_pool_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_ca_pool", - 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 update_ca_pool REST call - # - # @param request_pb [::Google::Cloud::Security::PrivateCA::V1::UpdateCaPoolRequest] - # 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_ca_pool request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_update_ca_pool_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_ca_pool", - 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_ca_pool REST call - # - # @param request_pb [::Google::Cloud::Security::PrivateCA::V1::GetCaPoolRequest] - # A request object representing the call parameters. Required. - # @param options [::Gapic::CallOptions] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Cloud::Security::PrivateCA::V1::CaPool] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::Security::PrivateCA::V1::CaPool] - # A result object deserialized from the server's reply - def get_ca_pool request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_get_ca_pool_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_ca_pool", - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Cloud::Security::PrivateCA::V1::CaPool.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_ca_pools REST call - # - # @param request_pb [::Google::Cloud::Security::PrivateCA::V1::ListCaPoolsRequest] - # A request object representing the call parameters. Required. - # @param options [::Gapic::CallOptions] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Cloud::Security::PrivateCA::V1::ListCaPoolsResponse] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::Security::PrivateCA::V1::ListCaPoolsResponse] - # A result object deserialized from the server's reply - def list_ca_pools request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_list_ca_pools_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_ca_pools", - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Cloud::Security::PrivateCA::V1::ListCaPoolsResponse.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_ca_pool REST call - # - # @param request_pb [::Google::Cloud::Security::PrivateCA::V1::DeleteCaPoolRequest] - # 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_ca_pool request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_delete_ca_pool_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_ca_pool", - 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 fetch_ca_certs REST call - # - # @param request_pb [::Google::Cloud::Security::PrivateCA::V1::FetchCaCertsRequest] - # A request object representing the call parameters. Required. - # @param options [::Gapic::CallOptions] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Cloud::Security::PrivateCA::V1::FetchCaCertsResponse] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::Security::PrivateCA::V1::FetchCaCertsResponse] - # A result object deserialized from the server's reply - def fetch_ca_certs request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_fetch_ca_certs_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: "fetch_ca_certs", - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Cloud::Security::PrivateCA::V1::FetchCaCertsResponse.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_certificate_revocation_list REST call - # - # @param request_pb [::Google::Cloud::Security::PrivateCA::V1::GetCertificateRevocationListRequest] - # A request object representing the call parameters. Required. - # @param options [::Gapic::CallOptions] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Cloud::Security::PrivateCA::V1::CertificateRevocationList] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::Security::PrivateCA::V1::CertificateRevocationList] - # A result object deserialized from the server's reply - def get_certificate_revocation_list request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_get_certificate_revocation_list_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_certificate_revocation_list", - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Cloud::Security::PrivateCA::V1::CertificateRevocationList.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_certificate_revocation_lists REST call - # - # @param request_pb [::Google::Cloud::Security::PrivateCA::V1::ListCertificateRevocationListsRequest] - # A request object representing the call parameters. Required. - # @param options [::Gapic::CallOptions] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Cloud::Security::PrivateCA::V1::ListCertificateRevocationListsResponse] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::Security::PrivateCA::V1::ListCertificateRevocationListsResponse] - # A result object deserialized from the server's reply - def list_certificate_revocation_lists request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_list_certificate_revocation_lists_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_certificate_revocation_lists", - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Cloud::Security::PrivateCA::V1::ListCertificateRevocationListsResponse.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_certificate_revocation_list REST call - # - # @param request_pb [::Google::Cloud::Security::PrivateCA::V1::UpdateCertificateRevocationListRequest] - # 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_certificate_revocation_list request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_update_certificate_revocation_list_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_certificate_revocation_list", - 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 create_certificate_template REST call - # - # @param request_pb [::Google::Cloud::Security::PrivateCA::V1::CreateCertificateTemplateRequest] - # 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_certificate_template request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_create_certificate_template_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_certificate_template", - 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_certificate_template REST call - # - # @param request_pb [::Google::Cloud::Security::PrivateCA::V1::DeleteCertificateTemplateRequest] - # 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_certificate_template request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_delete_certificate_template_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_certificate_template", - 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_certificate_template REST call - # - # @param request_pb [::Google::Cloud::Security::PrivateCA::V1::GetCertificateTemplateRequest] - # A request object representing the call parameters. Required. - # @param options [::Gapic::CallOptions] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Cloud::Security::PrivateCA::V1::CertificateTemplate] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::Security::PrivateCA::V1::CertificateTemplate] - # A result object deserialized from the server's reply - def get_certificate_template request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_get_certificate_template_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_certificate_template", - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Cloud::Security::PrivateCA::V1::CertificateTemplate.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_certificate_templates REST call - # - # @param request_pb [::Google::Cloud::Security::PrivateCA::V1::ListCertificateTemplatesRequest] - # A request object representing the call parameters. Required. - # @param options [::Gapic::CallOptions] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Cloud::Security::PrivateCA::V1::ListCertificateTemplatesResponse] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::Security::PrivateCA::V1::ListCertificateTemplatesResponse] - # A result object deserialized from the server's reply - def list_certificate_templates request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_list_certificate_templates_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_certificate_templates", - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Cloud::Security::PrivateCA::V1::ListCertificateTemplatesResponse.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_certificate_template REST call - # - # @param request_pb [::Google::Cloud::Security::PrivateCA::V1::UpdateCertificateTemplateRequest] - # 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_certificate_template request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_update_certificate_template_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_certificate_template", - 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 - - ## - # @private - # - # GRPC transcoding helper method for the create_certificate REST call - # - # @param request_pb [::Google::Cloud::Security::PrivateCA::V1::CreateCertificateRequest] - # 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_certificate_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :post, - uri_template: "/v1/{parent}/certificates", - body: "certificate", - matches: [ - ["parent", %r{^projects/[^/]+/locations/[^/]+/caPools/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the get_certificate REST call - # - # @param request_pb [::Google::Cloud::Security::PrivateCA::V1::GetCertificateRequest] - # 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_certificate_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :get, - uri_template: "/v1/{name}", - matches: [ - ["name", %r{^projects/[^/]+/locations/[^/]+/caPools/[^/]+/certificates/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the list_certificates REST call - # - # @param request_pb [::Google::Cloud::Security::PrivateCA::V1::ListCertificatesRequest] - # 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_certificates_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :get, - uri_template: "/v1/{parent}/certificates", - matches: [ - ["parent", %r{^projects/[^/]+/locations/[^/]+/caPools/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the revoke_certificate REST call - # - # @param request_pb [::Google::Cloud::Security::PrivateCA::V1::RevokeCertificateRequest] - # A request object representing the call parameters. Required. - # @return [Array(String, [String, nil], Hash{String => String})] - # Uri, Body, Query string parameters - def self.transcode_revoke_certificate_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :post, - uri_template: "/v1/{name}:revoke", - body: "*", - matches: [ - ["name", %r{^projects/[^/]+/locations/[^/]+/caPools/[^/]+/certificates/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the update_certificate REST call - # - # @param request_pb [::Google::Cloud::Security::PrivateCA::V1::UpdateCertificateRequest] - # 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_certificate_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :patch, - uri_template: "/v1/{certificate.name}", - body: "certificate", - matches: [ - ["certificate.name", %r{^projects/[^/]+/locations/[^/]+/caPools/[^/]+/certificates/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the activate_certificate_authority REST call - # - # @param request_pb [::Google::Cloud::Security::PrivateCA::V1::ActivateCertificateAuthorityRequest] - # A request object representing the call parameters. Required. - # @return [Array(String, [String, nil], Hash{String => String})] - # Uri, Body, Query string parameters - def self.transcode_activate_certificate_authority_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :post, - uri_template: "/v1/{name}:activate", - body: "*", - matches: [ - ["name", %r{^projects/[^/]+/locations/[^/]+/caPools/[^/]+/certificateAuthorities/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the create_certificate_authority REST call - # - # @param request_pb [::Google::Cloud::Security::PrivateCA::V1::CreateCertificateAuthorityRequest] - # 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_certificate_authority_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :post, - uri_template: "/v1/{parent}/certificateAuthorities", - body: "certificate_authority", - matches: [ - ["parent", %r{^projects/[^/]+/locations/[^/]+/caPools/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the disable_certificate_authority REST call - # - # @param request_pb [::Google::Cloud::Security::PrivateCA::V1::DisableCertificateAuthorityRequest] - # A request object representing the call parameters. Required. - # @return [Array(String, [String, nil], Hash{String => String})] - # Uri, Body, Query string parameters - def self.transcode_disable_certificate_authority_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :post, - uri_template: "/v1/{name}:disable", - body: "*", - matches: [ - ["name", %r{^projects/[^/]+/locations/[^/]+/caPools/[^/]+/certificateAuthorities/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the enable_certificate_authority REST call - # - # @param request_pb [::Google::Cloud::Security::PrivateCA::V1::EnableCertificateAuthorityRequest] - # A request object representing the call parameters. Required. - # @return [Array(String, [String, nil], Hash{String => String})] - # Uri, Body, Query string parameters - def self.transcode_enable_certificate_authority_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :post, - uri_template: "/v1/{name}:enable", - body: "*", - matches: [ - ["name", %r{^projects/[^/]+/locations/[^/]+/caPools/[^/]+/certificateAuthorities/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the fetch_certificate_authority_csr REST call - # - # @param request_pb [::Google::Cloud::Security::PrivateCA::V1::FetchCertificateAuthorityCsrRequest] - # A request object representing the call parameters. Required. - # @return [Array(String, [String, nil], Hash{String => String})] - # Uri, Body, Query string parameters - def self.transcode_fetch_certificate_authority_csr_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :get, - uri_template: "/v1/{name}:fetch", - matches: [ - ["name", %r{^projects/[^/]+/locations/[^/]+/caPools/[^/]+/certificateAuthorities/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the get_certificate_authority REST call - # - # @param request_pb [::Google::Cloud::Security::PrivateCA::V1::GetCertificateAuthorityRequest] - # 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_certificate_authority_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :get, - uri_template: "/v1/{name}", - matches: [ - ["name", %r{^projects/[^/]+/locations/[^/]+/caPools/[^/]+/certificateAuthorities/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the list_certificate_authorities REST call - # - # @param request_pb [::Google::Cloud::Security::PrivateCA::V1::ListCertificateAuthoritiesRequest] - # 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_certificate_authorities_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :get, - uri_template: "/v1/{parent}/certificateAuthorities", - matches: [ - ["parent", %r{^projects/[^/]+/locations/[^/]+/caPools/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the undelete_certificate_authority REST call - # - # @param request_pb [::Google::Cloud::Security::PrivateCA::V1::UndeleteCertificateAuthorityRequest] - # A request object representing the call parameters. Required. - # @return [Array(String, [String, nil], Hash{String => String})] - # Uri, Body, Query string parameters - def self.transcode_undelete_certificate_authority_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :post, - uri_template: "/v1/{name}:undelete", - body: "*", - matches: [ - ["name", %r{^projects/[^/]+/locations/[^/]+/caPools/[^/]+/certificateAuthorities/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the delete_certificate_authority REST call - # - # @param request_pb [::Google::Cloud::Security::PrivateCA::V1::DeleteCertificateAuthorityRequest] - # 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_certificate_authority_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :delete, - uri_template: "/v1/{name}", - matches: [ - ["name", %r{^projects/[^/]+/locations/[^/]+/caPools/[^/]+/certificateAuthorities/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the update_certificate_authority REST call - # - # @param request_pb [::Google::Cloud::Security::PrivateCA::V1::UpdateCertificateAuthorityRequest] - # 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_certificate_authority_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :patch, - uri_template: "/v1/{certificate_authority.name}", - body: "certificate_authority", - matches: [ - ["certificate_authority.name", %r{^projects/[^/]+/locations/[^/]+/caPools/[^/]+/certificateAuthorities/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the create_ca_pool REST call - # - # @param request_pb [::Google::Cloud::Security::PrivateCA::V1::CreateCaPoolRequest] - # 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_ca_pool_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :post, - uri_template: "/v1/{parent}/caPools", - body: "ca_pool", - matches: [ - ["parent", %r{^projects/[^/]+/locations/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the update_ca_pool REST call - # - # @param request_pb [::Google::Cloud::Security::PrivateCA::V1::UpdateCaPoolRequest] - # 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_ca_pool_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :patch, - uri_template: "/v1/{ca_pool.name}", - body: "ca_pool", - matches: [ - ["ca_pool.name", %r{^projects/[^/]+/locations/[^/]+/caPools/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the get_ca_pool REST call - # - # @param request_pb [::Google::Cloud::Security::PrivateCA::V1::GetCaPoolRequest] - # 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_ca_pool_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :get, - uri_template: "/v1/{name}", - matches: [ - ["name", %r{^projects/[^/]+/locations/[^/]+/caPools/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the list_ca_pools REST call - # - # @param request_pb [::Google::Cloud::Security::PrivateCA::V1::ListCaPoolsRequest] - # 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_ca_pools_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :get, - uri_template: "/v1/{parent}/caPools", - matches: [ - ["parent", %r{^projects/[^/]+/locations/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the delete_ca_pool REST call - # - # @param request_pb [::Google::Cloud::Security::PrivateCA::V1::DeleteCaPoolRequest] - # 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_ca_pool_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :delete, - uri_template: "/v1/{name}", - matches: [ - ["name", %r{^projects/[^/]+/locations/[^/]+/caPools/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the fetch_ca_certs REST call - # - # @param request_pb [::Google::Cloud::Security::PrivateCA::V1::FetchCaCertsRequest] - # A request object representing the call parameters. Required. - # @return [Array(String, [String, nil], Hash{String => String})] - # Uri, Body, Query string parameters - def self.transcode_fetch_ca_certs_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :post, - uri_template: "/v1/{ca_pool}:fetchCaCerts", - body: "*", - matches: [ - ["ca_pool", %r{^projects/[^/]+/locations/[^/]+/caPools/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the get_certificate_revocation_list REST call - # - # @param request_pb [::Google::Cloud::Security::PrivateCA::V1::GetCertificateRevocationListRequest] - # 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_certificate_revocation_list_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :get, - uri_template: "/v1/{name}", - matches: [ - ["name", %r{^projects/[^/]+/locations/[^/]+/caPools/[^/]+/certificateAuthorities/[^/]+/certificateRevocationLists/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the list_certificate_revocation_lists REST call - # - # @param request_pb [::Google::Cloud::Security::PrivateCA::V1::ListCertificateRevocationListsRequest] - # 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_certificate_revocation_lists_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :get, - uri_template: "/v1/{parent}/certificateRevocationLists", - matches: [ - ["parent", %r{^projects/[^/]+/locations/[^/]+/caPools/[^/]+/certificateAuthorities/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the update_certificate_revocation_list REST call - # - # @param request_pb [::Google::Cloud::Security::PrivateCA::V1::UpdateCertificateRevocationListRequest] - # 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_certificate_revocation_list_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :patch, - uri_template: "/v1/{certificate_revocation_list.name}", - body: "certificate_revocation_list", - matches: [ - ["certificate_revocation_list.name", %r{^projects/[^/]+/locations/[^/]+/caPools/[^/]+/certificateAuthorities/[^/]+/certificateRevocationLists/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the create_certificate_template REST call - # - # @param request_pb [::Google::Cloud::Security::PrivateCA::V1::CreateCertificateTemplateRequest] - # 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_certificate_template_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :post, - uri_template: "/v1/{parent}/certificateTemplates", - body: "certificate_template", - matches: [ - ["parent", %r{^projects/[^/]+/locations/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the delete_certificate_template REST call - # - # @param request_pb [::Google::Cloud::Security::PrivateCA::V1::DeleteCertificateTemplateRequest] - # 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_certificate_template_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :delete, - uri_template: "/v1/{name}", - matches: [ - ["name", %r{^projects/[^/]+/locations/[^/]+/certificateTemplates/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the get_certificate_template REST call - # - # @param request_pb [::Google::Cloud::Security::PrivateCA::V1::GetCertificateTemplateRequest] - # 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_certificate_template_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :get, - uri_template: "/v1/{name}", - matches: [ - ["name", %r{^projects/[^/]+/locations/[^/]+/certificateTemplates/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the list_certificate_templates REST call - # - # @param request_pb [::Google::Cloud::Security::PrivateCA::V1::ListCertificateTemplatesRequest] - # 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_certificate_templates_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :get, - uri_template: "/v1/{parent}/certificateTemplates", - matches: [ - ["parent", %r{^projects/[^/]+/locations/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the update_certificate_template REST call - # - # @param request_pb [::Google::Cloud::Security::PrivateCA::V1::UpdateCertificateTemplateRequest] - # 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_certificate_template_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :patch, - uri_template: "/v1/{certificate_template.name}", - body: "certificate_template", - matches: [ - ["certificate_template.name", %r{^projects/[^/]+/locations/[^/]+/certificateTemplates/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - end - end - end - end - end - end - end -end diff --git a/owl-bot-staging/google-cloud-security-private_ca-v1/lib/google/cloud/security/private_ca/v1/rest.rb b/owl-bot-staging/google-cloud-security-private_ca-v1/lib/google/cloud/security/private_ca/v1/rest.rb deleted file mode 100644 index 32ff1bdaacad..000000000000 --- a/owl-bot-staging/google-cloud-security-private_ca-v1/lib/google/cloud/security/private_ca/v1/rest.rb +++ /dev/null @@ -1,40 +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/security/private_ca/v1/certificate_authority_service/rest" -require "google/cloud/security/private_ca/v1/bindings_override" -require "google/cloud/security/private_ca/v1/version" - -module Google - module Cloud - module Security - module PrivateCA - ## - # To load just the REST part of this package, including all its services, and instantiate a REST client: - # - # @example - # - # require "google/cloud/security/private_ca/v1/rest" - # client = ::Google::Cloud::Security::PrivateCA::V1::CertificateAuthorityService::Rest::Client.new - # - module V1 - end - end - end - end -end diff --git a/owl-bot-staging/google-cloud-security-private_ca-v1/lib/google/cloud/security/private_ca/v1/version.rb b/owl-bot-staging/google-cloud-security-private_ca-v1/lib/google/cloud/security/private_ca/v1/version.rb deleted file mode 100644 index c9a5e76697ad..000000000000 --- a/owl-bot-staging/google-cloud-security-private_ca-v1/lib/google/cloud/security/private_ca/v1/version.rb +++ /dev/null @@ -1,30 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - - -module Google - module Cloud - module Security - module PrivateCA - module V1 - VERSION = "0.0.1" - end - end - end - end -end diff --git a/owl-bot-staging/google-cloud-security-private_ca-v1/lib/google/cloud/security/privateca/v1/resources_pb.rb b/owl-bot-staging/google-cloud-security-private_ca-v1/lib/google/cloud/security/privateca/v1/resources_pb.rb deleted file mode 100644 index 127b639f665e..000000000000 --- a/owl-bot-staging/google-cloud-security-private_ca-v1/lib/google/cloud/security/privateca/v1/resources_pb.rb +++ /dev/null @@ -1,80 +0,0 @@ -# frozen_string_literal: true -# Generated by the protocol buffer compiler. DO NOT EDIT! -# source: google/cloud/security/privateca/v1/resources.proto - -require 'google/protobuf' - -require 'google/api/field_behavior_pb' -require 'google/api/resource_pb' -require 'google/protobuf/duration_pb' -require 'google/protobuf/timestamp_pb' -require 'google/type/expr_pb' - - -descriptor_data = "\n2google/cloud/security/privateca/v1/resources.proto\x12\"google.cloud.security.privateca.v1\x1a\x1fgoogle/api/field_behavior.proto\x1a\x19google/api/resource.proto\x1a\x1egoogle/protobuf/duration.proto\x1a\x1fgoogle/protobuf/timestamp.proto\x1a\x16google/type/expr.proto\"\x86\x12\n\x14\x43\x65rtificateAuthority\x12\x11\n\x04name\x18\x01 \x01(\tB\x03\xe0\x41\x08\x12S\n\x04type\x18\x02 \x01(\x0e\x32=.google.cloud.security.privateca.v1.CertificateAuthority.TypeB\x06\xe0\x41\x02\xe0\x41\x05\x12M\n\x06\x63onfig\x18\x03 \x01(\x0b\x32\x35.google.cloud.security.privateca.v1.CertificateConfigB\x06\xe0\x41\x02\xe0\x41\x05\x12\x33\n\x08lifetime\x18\x04 \x01(\x0b\x32\x19.google.protobuf.DurationB\x06\xe0\x41\x02\xe0\x41\x05\x12\x61\n\x08key_spec\x18\x05 \x01(\x0b\x32G.google.cloud.security.privateca.v1.CertificateAuthority.KeyVersionSpecB\x06\xe0\x41\x02\xe0\x41\x05\x12V\n\x12subordinate_config\x18\x06 \x01(\x0b\x32\x35.google.cloud.security.privateca.v1.SubordinateConfigB\x03\xe0\x41\x01\x12\x42\n\x04tier\x18\x07 \x01(\x0e\x32/.google.cloud.security.privateca.v1.CaPool.TierB\x03\xe0\x41\x03\x12R\n\x05state\x18\x08 \x01(\x0e\x32>.google.cloud.security.privateca.v1.CertificateAuthority.StateB\x03\xe0\x41\x03\x12 \n\x13pem_ca_certificates\x18\t \x03(\tB\x03\xe0\x41\x03\x12\x64\n\x1b\x63\x61_certificate_descriptions\x18\n \x03(\x0b\x32:.google.cloud.security.privateca.v1.CertificateDescriptionB\x03\xe0\x41\x03\x12\x17\n\ngcs_bucket\x18\x0b \x01(\tB\x03\xe0\x41\x05\x12]\n\x0b\x61\x63\x63\x65ss_urls\x18\x0c \x01(\x0b\x32\x43.google.cloud.security.privateca.v1.CertificateAuthority.AccessUrlsB\x03\xe0\x41\x03\x12\x34\n\x0b\x63reate_time\x18\r \x01(\x0b\x32\x1a.google.protobuf.TimestampB\x03\xe0\x41\x03\x12\x34\n\x0bupdate_time\x18\x0e \x01(\x0b\x32\x1a.google.protobuf.TimestampB\x03\xe0\x41\x03\x12\x34\n\x0b\x64\x65lete_time\x18\x0f \x01(\x0b\x32\x1a.google.protobuf.TimestampB\x03\xe0\x41\x03\x12\x34\n\x0b\x65xpire_time\x18\x10 \x01(\x0b\x32\x1a.google.protobuf.TimestampB\x03\xe0\x41\x03\x12Y\n\x06labels\x18\x11 \x03(\x0b\x32\x44.google.cloud.security.privateca.v1.CertificateAuthority.LabelsEntryB\x03\xe0\x41\x01\x12u\n\x18user_defined_access_urls\x18\x12 \x01(\x0b\x32N.google.cloud.security.privateca.v1.CertificateAuthority.UserDefinedAccessUrlsB\x03\xe0\x41\x01\x12\x1a\n\rsatisfies_pzs\x18\x13 \x01(\x08\x42\x03\xe0\x41\x03\x12\x1a\n\rsatisfies_pzi\x18\x14 \x01(\x08\x42\x03\xe0\x41\x03\x1aH\n\nAccessUrls\x12!\n\x19\x63\x61_certificate_access_url\x18\x01 \x01(\t\x12\x17\n\x0f\x63rl_access_urls\x18\x02 \x03(\t\x1a\xa0\x01\n\x0eKeyVersionSpec\x12\x1f\n\x15\x63loud_kms_key_version\x18\x01 \x01(\tH\x00\x12_\n\talgorithm\x18\x02 \x01(\x0e\x32J.google.cloud.security.privateca.v1.CertificateAuthority.SignHashAlgorithmH\x00\x42\x0c\n\nKeyVersion\x1a`\n\x15UserDefinedAccessUrls\x12)\n\x1c\x61ia_issuing_certificate_urls\x18\x01 \x03(\tB\x03\xe0\x41\x01\x12\x1c\n\x0f\x63rl_access_urls\x18\x02 \x03(\tB\x03\xe0\x41\x01\x1a-\n\x0bLabelsEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12\r\n\x05value\x18\x02 \x01(\t:\x02\x38\x01\">\n\x04Type\x12\x14\n\x10TYPE_UNSPECIFIED\x10\x00\x12\x0f\n\x0bSELF_SIGNED\x10\x01\x12\x0f\n\x0bSUBORDINATE\x10\x02\"p\n\x05State\x12\x15\n\x11STATE_UNSPECIFIED\x10\x00\x12\x0b\n\x07\x45NABLED\x10\x01\x12\x0c\n\x08\x44ISABLED\x10\x02\x12\n\n\x06STAGED\x10\x03\x12\x1c\n\x18\x41WAITING_USER_ACTIVATION\x10\x04\x12\x0b\n\x07\x44\x45LETED\x10\x05\"\xfc\x01\n\x11SignHashAlgorithm\x12#\n\x1fSIGN_HASH_ALGORITHM_UNSPECIFIED\x10\x00\x12\x17\n\x13RSA_PSS_2048_SHA256\x10\x01\x12\x17\n\x13RSA_PSS_3072_SHA256\x10\x02\x12\x17\n\x13RSA_PSS_4096_SHA256\x10\x03\x12\x19\n\x15RSA_PKCS1_2048_SHA256\x10\x06\x12\x19\n\x15RSA_PKCS1_3072_SHA256\x10\x07\x12\x19\n\x15RSA_PKCS1_4096_SHA256\x10\x08\x12\x12\n\x0e\x45\x43_P256_SHA256\x10\x04\x12\x12\n\x0e\x45\x43_P384_SHA384\x10\x05:\x9d\x01\xea\x41\x99\x01\n-privateca.googleapis.com/CertificateAuthority\x12hprojects/{project}/locations/{location}/caPools/{ca_pool}/certificateAuthorities/{certificate_authority}\"\xdc\x10\n\x06\x43\x61Pool\x12\x11\n\x04name\x18\x01 \x01(\tB\x03\xe0\x41\x08\x12\x45\n\x04tier\x18\x02 \x01(\x0e\x32/.google.cloud.security.privateca.v1.CaPool.TierB\x06\xe0\x41\x02\xe0\x41\x05\x12W\n\x0fissuance_policy\x18\x03 \x01(\x0b\x32\x39.google.cloud.security.privateca.v1.CaPool.IssuancePolicyB\x03\xe0\x41\x01\x12]\n\x12publishing_options\x18\x04 \x01(\x0b\x32<.google.cloud.security.privateca.v1.CaPool.PublishingOptionsB\x03\xe0\x41\x01\x12K\n\x06labels\x18\x05 \x03(\x0b\x32\x36.google.cloud.security.privateca.v1.CaPool.LabelsEntryB\x03\xe0\x41\x01\x1a\xfb\x01\n\x11PublishingOptions\x12\x1c\n\x0fpublish_ca_cert\x18\x01 \x01(\x08\x42\x03\xe0\x41\x01\x12\x18\n\x0bpublish_crl\x18\x02 \x01(\x08\x42\x03\xe0\x41\x01\x12i\n\x0f\x65ncoding_format\x18\x03 \x01(\x0e\x32K.google.cloud.security.privateca.v1.CaPool.PublishingOptions.EncodingFormatB\x03\xe0\x41\x01\"C\n\x0e\x45ncodingFormat\x12\x1f\n\x1b\x45NCODING_FORMAT_UNSPECIFIED\x10\x00\x12\x07\n\x03PEM\x10\x01\x12\x07\n\x03\x44\x45R\x10\x02\x1a\xaa\n\n\x0eIssuancePolicy\x12h\n\x11\x61llowed_key_types\x18\x01 \x03(\x0b\x32H.google.cloud.security.privateca.v1.CaPool.IssuancePolicy.AllowedKeyTypeB\x03\xe0\x41\x01\x12\x39\n\x11\x62\x61\x63kdate_duration\x18\x07 \x01(\x0b\x32\x19.google.protobuf.DurationB\x03\xe0\x41\x01\x12\x38\n\x10maximum_lifetime\x18\x02 \x01(\x0b\x32\x19.google.protobuf.DurationB\x03\xe0\x41\x01\x12l\n\x16\x61llowed_issuance_modes\x18\x03 \x01(\x0b\x32G.google.cloud.security.privateca.v1.CaPool.IssuancePolicy.IssuanceModesB\x03\xe0\x41\x01\x12P\n\x0f\x62\x61seline_values\x18\x04 \x01(\x0b\x32\x32.google.cloud.security.privateca.v1.X509ParametersB\x03\xe0\x41\x01\x12\x65\n\x14identity_constraints\x18\x05 \x01(\x0b\x32\x42.google.cloud.security.privateca.v1.CertificateIdentityConstraintsB\x03\xe0\x41\x01\x12h\n\x16passthrough_extensions\x18\x06 \x01(\x0b\x32\x43.google.cloud.security.privateca.v1.CertificateExtensionConstraintsB\x03\xe0\x41\x01\x1a\xc5\x04\n\x0e\x41llowedKeyType\x12\x62\n\x03rsa\x18\x01 \x01(\x0b\x32S.google.cloud.security.privateca.v1.CaPool.IssuancePolicy.AllowedKeyType.RsaKeyTypeH\x00\x12l\n\x0e\x65lliptic_curve\x18\x02 \x01(\x0b\x32R.google.cloud.security.privateca.v1.CaPool.IssuancePolicy.AllowedKeyType.EcKeyTypeH\x00\x1aJ\n\nRsaKeyType\x12\x1d\n\x10min_modulus_size\x18\x01 \x01(\x03\x42\x03\xe0\x41\x01\x12\x1d\n\x10max_modulus_size\x18\x02 \x01(\x03\x42\x03\xe0\x41\x01\x1a\x88\x02\n\tEcKeyType\x12\x89\x01\n\x13signature_algorithm\x18\x01 \x01(\x0e\x32g.google.cloud.security.privateca.v1.CaPool.IssuancePolicy.AllowedKeyType.EcKeyType.EcSignatureAlgorithmB\x03\xe0\x41\x01\"o\n\x14\x45\x63SignatureAlgorithm\x12&\n\"EC_SIGNATURE_ALGORITHM_UNSPECIFIED\x10\x00\x12\x0e\n\nECDSA_P256\x10\x01\x12\x0e\n\nECDSA_P384\x10\x02\x12\x0f\n\x0b\x45\x44\x44SA_25519\x10\x03\x42\n\n\x08key_type\x1a`\n\rIssuanceModes\x12%\n\x18\x61llow_csr_based_issuance\x18\x01 \x01(\x08\x42\x03\xe0\x41\x01\x12(\n\x1b\x61llow_config_based_issuance\x18\x02 \x01(\x08\x42\x03\xe0\x41\x01\x1a-\n\x0bLabelsEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12\r\n\x05value\x18\x02 \x01(\t:\x02\x38\x01\"8\n\x04Tier\x12\x14\n\x10TIER_UNSPECIFIED\x10\x00\x12\x0e\n\nENTERPRISE\x10\x01\x12\n\n\x06\x44\x45VOPS\x10\x02:_\xea\x41\\\n\x1fprivateca.googleapis.com/CaPool\x12\x39projects/{project}/locations/{location}/caPools/{ca_pool}\"\xbc\x08\n\x19\x43\x65rtificateRevocationList\x12\x11\n\x04name\x18\x01 \x01(\tB\x03\xe0\x41\x08\x12\x1c\n\x0fsequence_number\x18\x02 \x01(\x03\x42\x03\xe0\x41\x03\x12s\n\x14revoked_certificates\x18\x03 \x03(\x0b\x32P.google.cloud.security.privateca.v1.CertificateRevocationList.RevokedCertificateB\x03\xe0\x41\x03\x12\x14\n\x07pem_crl\x18\x04 \x01(\tB\x03\xe0\x41\x03\x12\x17\n\naccess_url\x18\x05 \x01(\tB\x03\xe0\x41\x03\x12W\n\x05state\x18\x06 \x01(\x0e\x32\x43.google.cloud.security.privateca.v1.CertificateRevocationList.StateB\x03\xe0\x41\x03\x12\x34\n\x0b\x63reate_time\x18\x07 \x01(\x0b\x32\x1a.google.protobuf.TimestampB\x03\xe0\x41\x03\x12\x34\n\x0bupdate_time\x18\x08 \x01(\x0b\x32\x1a.google.protobuf.TimestampB\x03\xe0\x41\x03\x12\x18\n\x0brevision_id\x18\t \x01(\tB\x03\xe0\x41\x03\x12^\n\x06labels\x18\n \x03(\x0b\x32I.google.cloud.security.privateca.v1.CertificateRevocationList.LabelsEntryB\x03\xe0\x41\x01\x1a\xc0\x01\n\x12RevokedCertificate\x12>\n\x0b\x63\x65rtificate\x18\x01 \x01(\tB)\xfa\x41&\n$privateca.googleapis.com/Certificate\x12\x19\n\x11hex_serial_number\x18\x02 \x01(\t\x12O\n\x11revocation_reason\x18\x03 \x01(\x0e\x32\x34.google.cloud.security.privateca.v1.RevocationReason\x1a-\n\x0bLabelsEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12\r\n\x05value\x18\x02 \x01(\t:\x02\x38\x01\":\n\x05State\x12\x15\n\x11STATE_UNSPECIFIED\x10\x00\x12\n\n\x06\x41\x43TIVE\x10\x01\x12\x0e\n\nSUPERSEDED\x10\x02:\xdc\x01\xea\x41\xd8\x01\n2privateca.googleapis.com/CertificateRevocationList\x12\xa1\x01projects/{project}/locations/{location}/caPools/{ca_pool}/certificateAuthorities/{certificate_authority}/certificateRevocationLists/{certificate_revocation_list}\"\xe6\t\n\x0b\x43\x65rtificate\x12\x11\n\x04name\x18\x01 \x01(\tB\x03\xe0\x41\x08\x12\x16\n\x07pem_csr\x18\x02 \x01(\tB\x03\xe0\x41\x05H\x00\x12L\n\x06\x63onfig\x18\x03 \x01(\x0b\x32\x35.google.cloud.security.privateca.v1.CertificateConfigB\x03\xe0\x41\x05H\x00\x12[\n\x1cissuer_certificate_authority\x18\x04 \x01(\tB5\xe0\x41\x03\xfa\x41/\n-privateca.googleapis.com/CertificateAuthority\x12\x33\n\x08lifetime\x18\x05 \x01(\x0b\x32\x19.google.protobuf.DurationB\x06\xe0\x41\x02\xe0\x41\x05\x12R\n\x14\x63\x65rtificate_template\x18\x06 \x01(\tB4\xe0\x41\x05\xfa\x41.\n,privateca.googleapis.com/CertificateTemplate\x12Q\n\x0csubject_mode\x18\x07 \x01(\x0e\x32\x36.google.cloud.security.privateca.v1.SubjectRequestModeB\x03\xe0\x41\x05\x12\x62\n\x12revocation_details\x18\x08 \x01(\x0b\x32\x41.google.cloud.security.privateca.v1.Certificate.RevocationDetailsB\x03\xe0\x41\x03\x12\x1c\n\x0fpem_certificate\x18\t \x01(\tB\x03\xe0\x41\x03\x12`\n\x17\x63\x65rtificate_description\x18\n \x01(\x0b\x32:.google.cloud.security.privateca.v1.CertificateDescriptionB\x03\xe0\x41\x03\x12\"\n\x15pem_certificate_chain\x18\x0b \x03(\tB\x03\xe0\x41\x03\x12\x34\n\x0b\x63reate_time\x18\x0c \x01(\x0b\x32\x1a.google.protobuf.TimestampB\x03\xe0\x41\x03\x12\x34\n\x0bupdate_time\x18\r \x01(\x0b\x32\x1a.google.protobuf.TimestampB\x03\xe0\x41\x03\x12P\n\x06labels\x18\x0e \x03(\x0b\x32;.google.cloud.security.privateca.v1.Certificate.LabelsEntryB\x03\xe0\x41\x01\x1a\x98\x01\n\x11RevocationDetails\x12N\n\x10revocation_state\x18\x01 \x01(\x0e\x32\x34.google.cloud.security.privateca.v1.RevocationReason\x12\x33\n\x0frevocation_time\x18\x02 \x01(\x0b\x32\x1a.google.protobuf.Timestamp\x1a-\n\x0bLabelsEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12\r\n\x05value\x18\x02 \x01(\t:\x02\x38\x01:\x7f\xea\x41|\n$privateca.googleapis.com/Certificate\x12Tprojects/{project}/locations/{location}/caPools/{ca_pool}/certificates/{certificate}B\x14\n\x12\x63\x65rtificate_config\"\xa0\x06\n\x13\x43\x65rtificateTemplate\x12\x11\n\x04name\x18\x01 \x01(\tB\x03\xe0\x41\x08\x12\x38\n\x10maximum_lifetime\x18\t \x01(\x0b\x32\x19.google.protobuf.DurationB\x03\xe0\x41\x01\x12R\n\x11predefined_values\x18\x02 \x01(\x0b\x32\x32.google.cloud.security.privateca.v1.X509ParametersB\x03\xe0\x41\x01\x12\x65\n\x14identity_constraints\x18\x03 \x01(\x0b\x32\x42.google.cloud.security.privateca.v1.CertificateIdentityConstraintsB\x03\xe0\x41\x01\x12h\n\x16passthrough_extensions\x18\x04 \x01(\x0b\x32\x43.google.cloud.security.privateca.v1.CertificateExtensionConstraintsB\x03\xe0\x41\x01\x12\x18\n\x0b\x64\x65scription\x18\x05 \x01(\tB\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\x12X\n\x06labels\x18\x08 \x03(\x0b\x32\x43.google.cloud.security.privateca.v1.CertificateTemplate.LabelsEntryB\x03\xe0\x41\x01\x1a-\n\x0bLabelsEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12\r\n\x05value\x18\x02 \x01(\t:\x02\x38\x01:\x87\x01\xea\x41\x83\x01\n,privateca.googleapis.com/CertificateTemplate\x12Sprojects/{project}/locations/{location}/certificateTemplates/{certificate_template}\"\xce\x06\n\x0eX509Parameters\x12\x44\n\tkey_usage\x18\x01 \x01(\x0b\x32,.google.cloud.security.privateca.v1.KeyUsageB\x03\xe0\x41\x01\x12U\n\nca_options\x18\x02 \x01(\x0b\x32<.google.cloud.security.privateca.v1.X509Parameters.CaOptionsB\x03\xe0\x41\x01\x12\x45\n\npolicy_ids\x18\x03 \x03(\x0b\x32,.google.cloud.security.privateca.v1.ObjectIdB\x03\xe0\x41\x01\x12\x1d\n\x10\x61ia_ocsp_servers\x18\x04 \x03(\tB\x03\xe0\x41\x01\x12\x61\n\x10name_constraints\x18\x06 \x01(\x0b\x32\x42.google.cloud.security.privateca.v1.X509Parameters.NameConstraintsB\x03\xe0\x41\x01\x12U\n\x15\x61\x64\x64itional_extensions\x18\x05 \x03(\x0b\x32\x31.google.cloud.security.privateca.v1.X509ExtensionB\x03\xe0\x41\x01\x1as\n\tCaOptions\x12\x17\n\x05is_ca\x18\x01 \x01(\x08\x42\x03\xe0\x41\x01H\x00\x88\x01\x01\x12(\n\x16max_issuer_path_length\x18\x02 \x01(\x05\x42\x03\xe0\x41\x01H\x01\x88\x01\x01\x42\x08\n\x06_is_caB\x19\n\x17_max_issuer_path_length\x1a\x89\x02\n\x0fNameConstraints\x12\x10\n\x08\x63ritical\x18\x01 \x01(\x08\x12\x1b\n\x13permitted_dns_names\x18\x02 \x03(\t\x12\x1a\n\x12\x65xcluded_dns_names\x18\x03 \x03(\t\x12\x1b\n\x13permitted_ip_ranges\x18\x04 \x03(\t\x12\x1a\n\x12\x65xcluded_ip_ranges\x18\x05 \x03(\t\x12!\n\x19permitted_email_addresses\x18\x06 \x03(\t\x12 \n\x18\x65xcluded_email_addresses\x18\x07 \x03(\t\x12\x16\n\x0epermitted_uris\x18\x08 \x03(\t\x12\x15\n\rexcluded_uris\x18\t \x03(\t\"\xa9\x02\n\x11SubordinateConfig\x12V\n\x15\x63\x65rtificate_authority\x18\x01 \x01(\tB5\xe0\x41\x02\xfa\x41/\n-privateca.googleapis.com/CertificateAuthorityH\x00\x12m\n\x10pem_issuer_chain\x18\x02 \x01(\x0b\x32L.google.cloud.security.privateca.v1.SubordinateConfig.SubordinateConfigChainB\x03\xe0\x41\x02H\x00\x1a\x37\n\x16SubordinateConfigChain\x12\x1d\n\x10pem_certificates\x18\x01 \x03(\tB\x03\xe0\x41\x02\x42\x14\n\x12subordinate_config\"\x9d\x01\n\tPublicKey\x12\x10\n\x03key\x18\x01 \x01(\x0c\x42\x03\xe0\x41\x02\x12L\n\x06\x66ormat\x18\x02 \x01(\x0e\x32\x37.google.cloud.security.privateca.v1.PublicKey.KeyFormatB\x03\xe0\x41\x02\"0\n\tKeyFormat\x12\x1a\n\x16KEY_FORMAT_UNSPECIFIED\x10\x00\x12\x07\n\x03PEM\x10\x01\"\xac\x04\n\x11\x43\x65rtificateConfig\x12`\n\x0esubject_config\x18\x01 \x01(\x0b\x32\x43.google.cloud.security.privateca.v1.CertificateConfig.SubjectConfigB\x03\xe0\x41\x02\x12L\n\x0bx509_config\x18\x02 \x01(\x0b\x32\x32.google.cloud.security.privateca.v1.X509ParametersB\x03\xe0\x41\x02\x12\x46\n\npublic_key\x18\x03 \x01(\x0b\x32-.google.cloud.security.privateca.v1.PublicKeyB\x03\xe0\x41\x01\x12X\n\x0esubject_key_id\x18\x04 \x01(\x0b\x32;.google.cloud.security.privateca.v1.CertificateConfig.KeyIdB\x03\xe0\x41\x01\x1a\xa6\x01\n\rSubjectConfig\x12\x41\n\x07subject\x18\x01 \x01(\x0b\x32+.google.cloud.security.privateca.v1.SubjectB\x03\xe0\x41\x01\x12R\n\x10subject_alt_name\x18\x02 \x01(\x0b\x32\x33.google.cloud.security.privateca.v1.SubjectAltNamesB\x03\xe0\x41\x01\x1a\x1c\n\x05KeyId\x12\x13\n\x06key_id\x18\x01 \x01(\tB\x03\xe0\x41\x02\"\xc1\x08\n\x16\x43\x65rtificateDescription\x12j\n\x13subject_description\x18\x01 \x01(\x0b\x32M.google.cloud.security.privateca.v1.CertificateDescription.SubjectDescription\x12L\n\x10x509_description\x18\x02 \x01(\x0b\x32\x32.google.cloud.security.privateca.v1.X509Parameters\x12\x41\n\npublic_key\x18\x03 \x01(\x0b\x32-.google.cloud.security.privateca.v1.PublicKey\x12X\n\x0esubject_key_id\x18\x04 \x01(\x0b\x32@.google.cloud.security.privateca.v1.CertificateDescription.KeyId\x12Z\n\x10\x61uthority_key_id\x18\x05 \x01(\x0b\x32@.google.cloud.security.privateca.v1.CertificateDescription.KeyId\x12\x1f\n\x17\x63rl_distribution_points\x18\x06 \x03(\t\x12$\n\x1c\x61ia_issuing_certificate_urls\x18\x07 \x03(\t\x12k\n\x10\x63\x65rt_fingerprint\x18\x08 \x01(\x0b\x32Q.google.cloud.security.privateca.v1.CertificateDescription.CertificateFingerprint\x12\x1e\n\x16tbs_certificate_digest\x18\t \x01(\t\x1a\xd2\x02\n\x12SubjectDescription\x12<\n\x07subject\x18\x01 \x01(\x0b\x32+.google.cloud.security.privateca.v1.Subject\x12M\n\x10subject_alt_name\x18\x02 \x01(\x0b\x32\x33.google.cloud.security.privateca.v1.SubjectAltNames\x12\x19\n\x11hex_serial_number\x18\x03 \x01(\t\x12+\n\x08lifetime\x18\x04 \x01(\x0b\x32\x19.google.protobuf.Duration\x12\x33\n\x0fnot_before_time\x18\x05 \x01(\x0b\x32\x1a.google.protobuf.Timestamp\x12\x32\n\x0enot_after_time\x18\x06 \x01(\x0b\x32\x1a.google.protobuf.Timestamp\x1a\x1c\n\x05KeyId\x12\x13\n\x06key_id\x18\x01 \x01(\tB\x03\xe0\x41\x01\x1a-\n\x16\x43\x65rtificateFingerprint\x12\x13\n\x0bsha256_hash\x18\x01 \x01(\t\"\'\n\x08ObjectId\x12\x1b\n\x0eobject_id_path\x18\x01 \x03(\x05\x42\x03\xe0\x41\x02\"\x80\x01\n\rX509Extension\x12\x44\n\tobject_id\x18\x01 \x01(\x0b\x32,.google.cloud.security.privateca.v1.ObjectIdB\x03\xe0\x41\x02\x12\x15\n\x08\x63ritical\x18\x02 \x01(\x08\x42\x03\xe0\x41\x01\x12\x12\n\x05value\x18\x03 \x01(\x0c\x42\x03\xe0\x41\x02\"\xa2\x05\n\x08KeyUsage\x12T\n\x0e\x62\x61se_key_usage\x18\x01 \x01(\x0b\x32<.google.cloud.security.privateca.v1.KeyUsage.KeyUsageOptions\x12`\n\x12\x65xtended_key_usage\x18\x02 \x01(\x0b\x32\x44.google.cloud.security.privateca.v1.KeyUsage.ExtendedKeyUsageOptions\x12Q\n\x1bunknown_extended_key_usages\x18\x03 \x03(\x0b\x32,.google.cloud.security.privateca.v1.ObjectId\x1a\xe7\x01\n\x0fKeyUsageOptions\x12\x19\n\x11\x64igital_signature\x18\x01 \x01(\x08\x12\x1a\n\x12\x63ontent_commitment\x18\x02 \x01(\x08\x12\x18\n\x10key_encipherment\x18\x03 \x01(\x08\x12\x19\n\x11\x64\x61ta_encipherment\x18\x04 \x01(\x08\x12\x15\n\rkey_agreement\x18\x05 \x01(\x08\x12\x11\n\tcert_sign\x18\x06 \x01(\x08\x12\x10\n\x08\x63rl_sign\x18\x07 \x01(\x08\x12\x15\n\rencipher_only\x18\x08 \x01(\x08\x12\x15\n\rdecipher_only\x18\t \x01(\x08\x1a\xa0\x01\n\x17\x45xtendedKeyUsageOptions\x12\x13\n\x0bserver_auth\x18\x01 \x01(\x08\x12\x13\n\x0b\x63lient_auth\x18\x02 \x01(\x08\x12\x14\n\x0c\x63ode_signing\x18\x03 \x01(\x08\x12\x18\n\x10\x65mail_protection\x18\x04 \x01(\x08\x12\x15\n\rtime_stamping\x18\x05 \x01(\x08\x12\x14\n\x0cocsp_signing\x18\x06 \x01(\x08\"\xbe\x01\n\x15\x41ttributeTypeAndValue\x12\x41\n\x04type\x18\x01 \x01(\x0e\x32\x31.google.cloud.security.privateca.v1.AttributeTypeH\x00\x12\x41\n\tobject_id\x18\x02 \x01(\x0b\x32,.google.cloud.security.privateca.v1.ObjectIdH\x00\x12\r\n\x05value\x18\x03 \x01(\tB\x10\n\x0e\x61ttribute_type\"j\n\x19RelativeDistinguishedName\x12M\n\nattributes\x18\x01 \x03(\x0b\x32\x39.google.cloud.security.privateca.v1.AttributeTypeAndValue\"\x8d\x02\n\x07Subject\x12\x13\n\x0b\x63ommon_name\x18\x01 \x01(\t\x12\x14\n\x0c\x63ountry_code\x18\x02 \x01(\t\x12\x14\n\x0corganization\x18\x03 \x01(\t\x12\x1b\n\x13organizational_unit\x18\x04 \x01(\t\x12\x10\n\x08locality\x18\x05 \x01(\t\x12\x10\n\x08province\x18\x06 \x01(\t\x12\x16\n\x0estreet_address\x18\x07 \x01(\t\x12\x13\n\x0bpostal_code\x18\x08 \x01(\t\x12S\n\x0crdn_sequence\x18\t \x03(\x0b\x32=.google.cloud.security.privateca.v1.RelativeDistinguishedName\"\xa9\x01\n\x0fSubjectAltNames\x12\x11\n\tdns_names\x18\x01 \x03(\t\x12\x0c\n\x04uris\x18\x02 \x03(\t\x12\x17\n\x0f\x65mail_addresses\x18\x03 \x03(\t\x12\x14\n\x0cip_addresses\x18\x04 \x03(\t\x12\x46\n\x0b\x63ustom_sans\x18\x05 \x03(\x0b\x32\x31.google.cloud.security.privateca.v1.X509Extension\"\xfa\x01\n\x1e\x43\x65rtificateIdentityConstraints\x12.\n\x0e\x63\x65l_expression\x18\x01 \x01(\x0b\x32\x11.google.type.ExprB\x03\xe0\x41\x01\x12+\n\x19\x61llow_subject_passthrough\x18\x02 \x01(\x08\x42\x03\xe0\x41\x02H\x00\x88\x01\x01\x12\x35\n#allow_subject_alt_names_passthrough\x18\x03 \x01(\x08\x42\x03\xe0\x41\x02H\x01\x88\x01\x01\x42\x1c\n\x1a_allow_subject_passthroughB&\n$_allow_subject_alt_names_passthrough\"\xb4\x03\n\x1f\x43\x65rtificateExtensionConstraints\x12|\n\x10known_extensions\x18\x01 \x03(\x0e\x32].google.cloud.security.privateca.v1.CertificateExtensionConstraints.KnownCertificateExtensionB\x03\xe0\x41\x01\x12P\n\x15\x61\x64\x64itional_extensions\x18\x02 \x03(\x0b\x32,.google.cloud.security.privateca.v1.ObjectIdB\x03\xe0\x41\x01\"\xc0\x01\n\x19KnownCertificateExtension\x12+\n\'KNOWN_CERTIFICATE_EXTENSION_UNSPECIFIED\x10\x00\x12\x12\n\x0e\x42\x41SE_KEY_USAGE\x10\x01\x12\x16\n\x12\x45XTENDED_KEY_USAGE\x10\x02\x12\x0e\n\nCA_OPTIONS\x10\x03\x12\x0e\n\nPOLICY_IDS\x10\x04\x12\x14\n\x10\x41IA_OCSP_SERVERS\x10\x05\x12\x14\n\x10NAME_CONSTRAINTS\x10\x06*\xbe\x01\n\rAttributeType\x12\x1e\n\x1a\x41TTRIBUTE_TYPE_UNSPECIFIED\x10\x00\x12\x0f\n\x0b\x43OMMON_NAME\x10\x01\x12\x10\n\x0c\x43OUNTRY_CODE\x10\x02\x12\x10\n\x0cORGANIZATION\x10\x03\x12\x17\n\x13ORGANIZATIONAL_UNIT\x10\x04\x12\x0c\n\x08LOCALITY\x10\x05\x12\x0c\n\x08PROVINCE\x10\x06\x12\x12\n\x0eSTREET_ADDRESS\x10\x07\x12\x0f\n\x0bPOSTAL_CODE\x10\x08*\x87\x02\n\x10RevocationReason\x12!\n\x1dREVOCATION_REASON_UNSPECIFIED\x10\x00\x12\x12\n\x0eKEY_COMPROMISE\x10\x01\x12$\n CERTIFICATE_AUTHORITY_COMPROMISE\x10\x02\x12\x17\n\x13\x41\x46\x46ILIATION_CHANGED\x10\x03\x12\x0e\n\nSUPERSEDED\x10\x04\x12\x1a\n\x16\x43\x45SSATION_OF_OPERATION\x10\x05\x12\x14\n\x10\x43\x45RTIFICATE_HOLD\x10\x06\x12\x17\n\x13PRIVILEGE_WITHDRAWN\x10\x07\x12\"\n\x1e\x41TTRIBUTE_AUTHORITY_COMPROMISE\x10\x08*o\n\x12SubjectRequestMode\x12$\n SUBJECT_REQUEST_MODE_UNSPECIFIED\x10\x00\x12\x0b\n\x07\x44\x45\x46\x41ULT\x10\x01\x12\x10\n\x0cRDN_SEQUENCE\x10\x03\x12\x14\n\x10REFLECTED_SPIFFE\x10\x02\x42\xfc\x01\n&com.google.cloud.security.privateca.v1B\x17PrivateCaResourcesProtoP\x01ZDcloud.google.com/go/security/privateca/apiv1/privatecapb;privatecapb\xaa\x02\"Google.Cloud.Security.PrivateCA.V1\xca\x02\"Google\\Cloud\\Security\\PrivateCA\\V1\xea\x02&Google::Cloud::Security::PrivateCA::V1b\x06proto3" - -pool = ::Google::Protobuf::DescriptorPool.generated_pool -pool.add_serialized_file(descriptor_data) - -module Google - module Cloud - module Security - module PrivateCA - module V1 - CertificateAuthority = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.security.privateca.v1.CertificateAuthority").msgclass - CertificateAuthority::AccessUrls = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.security.privateca.v1.CertificateAuthority.AccessUrls").msgclass - CertificateAuthority::KeyVersionSpec = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.security.privateca.v1.CertificateAuthority.KeyVersionSpec").msgclass - CertificateAuthority::UserDefinedAccessUrls = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.security.privateca.v1.CertificateAuthority.UserDefinedAccessUrls").msgclass - CertificateAuthority::Type = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.security.privateca.v1.CertificateAuthority.Type").enummodule - CertificateAuthority::State = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.security.privateca.v1.CertificateAuthority.State").enummodule - CertificateAuthority::SignHashAlgorithm = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.security.privateca.v1.CertificateAuthority.SignHashAlgorithm").enummodule - CaPool = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.security.privateca.v1.CaPool").msgclass - CaPool::PublishingOptions = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.security.privateca.v1.CaPool.PublishingOptions").msgclass - CaPool::PublishingOptions::EncodingFormat = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.security.privateca.v1.CaPool.PublishingOptions.EncodingFormat").enummodule - CaPool::IssuancePolicy = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.security.privateca.v1.CaPool.IssuancePolicy").msgclass - CaPool::IssuancePolicy::AllowedKeyType = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.security.privateca.v1.CaPool.IssuancePolicy.AllowedKeyType").msgclass - CaPool::IssuancePolicy::AllowedKeyType::RsaKeyType = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.security.privateca.v1.CaPool.IssuancePolicy.AllowedKeyType.RsaKeyType").msgclass - CaPool::IssuancePolicy::AllowedKeyType::EcKeyType = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.security.privateca.v1.CaPool.IssuancePolicy.AllowedKeyType.EcKeyType").msgclass - CaPool::IssuancePolicy::AllowedKeyType::EcKeyType::EcSignatureAlgorithm = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.security.privateca.v1.CaPool.IssuancePolicy.AllowedKeyType.EcKeyType.EcSignatureAlgorithm").enummodule - CaPool::IssuancePolicy::IssuanceModes = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.security.privateca.v1.CaPool.IssuancePolicy.IssuanceModes").msgclass - CaPool::Tier = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.security.privateca.v1.CaPool.Tier").enummodule - CertificateRevocationList = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.security.privateca.v1.CertificateRevocationList").msgclass - CertificateRevocationList::RevokedCertificate = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.security.privateca.v1.CertificateRevocationList.RevokedCertificate").msgclass - CertificateRevocationList::State = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.security.privateca.v1.CertificateRevocationList.State").enummodule - Certificate = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.security.privateca.v1.Certificate").msgclass - Certificate::RevocationDetails = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.security.privateca.v1.Certificate.RevocationDetails").msgclass - CertificateTemplate = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.security.privateca.v1.CertificateTemplate").msgclass - X509Parameters = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.security.privateca.v1.X509Parameters").msgclass - X509Parameters::CaOptions = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.security.privateca.v1.X509Parameters.CaOptions").msgclass - X509Parameters::NameConstraints = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.security.privateca.v1.X509Parameters.NameConstraints").msgclass - SubordinateConfig = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.security.privateca.v1.SubordinateConfig").msgclass - SubordinateConfig::SubordinateConfigChain = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.security.privateca.v1.SubordinateConfig.SubordinateConfigChain").msgclass - PublicKey = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.security.privateca.v1.PublicKey").msgclass - PublicKey::KeyFormat = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.security.privateca.v1.PublicKey.KeyFormat").enummodule - CertificateConfig = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.security.privateca.v1.CertificateConfig").msgclass - CertificateConfig::SubjectConfig = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.security.privateca.v1.CertificateConfig.SubjectConfig").msgclass - CertificateConfig::KeyId = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.security.privateca.v1.CertificateConfig.KeyId").msgclass - CertificateDescription = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.security.privateca.v1.CertificateDescription").msgclass - CertificateDescription::SubjectDescription = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.security.privateca.v1.CertificateDescription.SubjectDescription").msgclass - CertificateDescription::KeyId = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.security.privateca.v1.CertificateDescription.KeyId").msgclass - CertificateDescription::CertificateFingerprint = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.security.privateca.v1.CertificateDescription.CertificateFingerprint").msgclass - ObjectId = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.security.privateca.v1.ObjectId").msgclass - X509Extension = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.security.privateca.v1.X509Extension").msgclass - KeyUsage = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.security.privateca.v1.KeyUsage").msgclass - KeyUsage::KeyUsageOptions = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.security.privateca.v1.KeyUsage.KeyUsageOptions").msgclass - KeyUsage::ExtendedKeyUsageOptions = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.security.privateca.v1.KeyUsage.ExtendedKeyUsageOptions").msgclass - AttributeTypeAndValue = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.security.privateca.v1.AttributeTypeAndValue").msgclass - RelativeDistinguishedName = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.security.privateca.v1.RelativeDistinguishedName").msgclass - Subject = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.security.privateca.v1.Subject").msgclass - SubjectAltNames = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.security.privateca.v1.SubjectAltNames").msgclass - CertificateIdentityConstraints = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.security.privateca.v1.CertificateIdentityConstraints").msgclass - CertificateExtensionConstraints = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.security.privateca.v1.CertificateExtensionConstraints").msgclass - CertificateExtensionConstraints::KnownCertificateExtension = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.security.privateca.v1.CertificateExtensionConstraints.KnownCertificateExtension").enummodule - AttributeType = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.security.privateca.v1.AttributeType").enummodule - RevocationReason = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.security.privateca.v1.RevocationReason").enummodule - SubjectRequestMode = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.security.privateca.v1.SubjectRequestMode").enummodule - end - end - end - end -end diff --git a/owl-bot-staging/google-cloud-security-private_ca-v1/lib/google/cloud/security/privateca/v1/service_pb.rb b/owl-bot-staging/google-cloud-security-private_ca-v1/lib/google/cloud/security/privateca/v1/service_pb.rb deleted file mode 100644 index f329659efa1f..000000000000 --- a/owl-bot-staging/google-cloud-security-private_ca-v1/lib/google/cloud/security/privateca/v1/service_pb.rb +++ /dev/null @@ -1,71 +0,0 @@ -# frozen_string_literal: true -# Generated by the protocol buffer compiler. DO NOT EDIT! -# source: google/cloud/security/privateca/v1/service.proto - -require 'google/protobuf' - -require 'google/api/annotations_pb' -require 'google/api/client_pb' -require 'google/api/field_behavior_pb' -require 'google/api/field_info_pb' -require 'google/api/resource_pb' -require 'google/cloud/security/privateca/v1/resources_pb' -require 'google/longrunning/operations_pb' -require 'google/protobuf/empty_pb' -require 'google/protobuf/field_mask_pb' -require 'google/protobuf/timestamp_pb' - - -descriptor_data = "\n0google/cloud/security/privateca/v1/service.proto\x12\"google.cloud.security.privateca.v1\x1a\x1cgoogle/api/annotations.proto\x1a\x17google/api/client.proto\x1a\x1fgoogle/api/field_behavior.proto\x1a\x1bgoogle/api/field_info.proto\x1a\x19google/api/resource.proto\x1a\x32google/cloud/security/privateca/v1/resources.proto\x1a#google/longrunning/operations.proto\x1a\x1bgoogle/protobuf/empty.proto\x1a google/protobuf/field_mask.proto\x1a\x1fgoogle/protobuf/timestamp.proto\"\x9f\x02\n\x18\x43reateCertificateRequest\x12\x37\n\x06parent\x18\x01 \x01(\tB\'\xe0\x41\x02\xfa\x41!\n\x1fprivateca.googleapis.com/CaPool\x12\x1b\n\x0e\x63\x65rtificate_id\x18\x02 \x01(\tB\x03\xe0\x41\x01\x12I\n\x0b\x63\x65rtificate\x18\x03 \x01(\x0b\x32/.google.cloud.security.privateca.v1.CertificateB\x03\xe0\x41\x02\x12\x17\n\nrequest_id\x18\x04 \x01(\tB\x03\xe0\x41\x01\x12\x1a\n\rvalidate_only\x18\x05 \x01(\x08\x42\x03\xe0\x41\x01\x12-\n issuing_certificate_authority_id\x18\x06 \x01(\tB\x03\xe0\x41\x01\"S\n\x15GetCertificateRequest\x12:\n\x04name\x18\x01 \x01(\tB,\xe0\x41\x02\xfa\x41&\n$privateca.googleapis.com/Certificate\"\xaf\x01\n\x17ListCertificatesRequest\x12\x37\n\x06parent\x18\x01 \x01(\tB\'\xe0\x41\x02\xfa\x41!\n\x1fprivateca.googleapis.com/CaPool\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\x12\x15\n\x08order_by\x18\x05 \x01(\tB\x03\xe0\x41\x01\"\x8f\x01\n\x18ListCertificatesResponse\x12\x45\n\x0c\x63\x65rtificates\x18\x01 \x03(\x0b\x32/.google.cloud.security.privateca.v1.Certificate\x12\x17\n\x0fnext_page_token\x18\x02 \x01(\t\x12\x13\n\x0bunreachable\x18\x03 \x03(\t\"\xba\x01\n\x18RevokeCertificateRequest\x12:\n\x04name\x18\x01 \x01(\tB,\xe0\x41\x02\xfa\x41&\n$privateca.googleapis.com/Certificate\x12I\n\x06reason\x18\x02 \x01(\x0e\x32\x34.google.cloud.security.privateca.v1.RevocationReasonB\x03\xe0\x41\x02\x12\x17\n\nrequest_id\x18\x03 \x01(\tB\x03\xe0\x41\x01\"\xb4\x01\n\x18UpdateCertificateRequest\x12I\n\x0b\x63\x65rtificate\x18\x01 \x01(\x0b\x32/.google.cloud.security.privateca.v1.CertificateB\x03\xe0\x41\x02\x12\x34\n\x0bupdate_mask\x18\x02 \x01(\x0b\x32\x1a.google.protobuf.FieldMaskB\x03\xe0\x41\x02\x12\x17\n\nrequest_id\x18\x03 \x01(\tB\x03\xe0\x41\x01\"\x84\x02\n#ActivateCertificateAuthorityRequest\x12\x43\n\x04name\x18\x01 \x01(\tB5\xe0\x41\x02\xfa\x41/\n-privateca.googleapis.com/CertificateAuthority\x12\x1f\n\x12pem_ca_certificate\x18\x02 \x01(\tB\x03\xe0\x41\x02\x12V\n\x12subordinate_config\x18\x03 \x01(\x0b\x32\x35.google.cloud.security.privateca.v1.SubordinateConfigB\x03\xe0\x41\x02\x12\x1f\n\nrequest_id\x18\x04 \x01(\tB\x0b\xe0\x41\x01\xe2\x8c\xcf\xd7\x08\x02\x08\x01\"\xfa\x01\n!CreateCertificateAuthorityRequest\x12\x37\n\x06parent\x18\x01 \x01(\tB\'\xe0\x41\x02\xfa\x41!\n\x1fprivateca.googleapis.com/CaPool\x12%\n\x18\x63\x65rtificate_authority_id\x18\x02 \x01(\tB\x03\xe0\x41\x02\x12\\\n\x15\x63\x65rtificate_authority\x18\x03 \x01(\x0b\x32\x38.google.cloud.security.privateca.v1.CertificateAuthorityB\x03\xe0\x41\x02\x12\x17\n\nrequest_id\x18\x04 \x01(\tB\x03\xe0\x41\x01\"\xb3\x01\n\"DisableCertificateAuthorityRequest\x12\x43\n\x04name\x18\x01 \x01(\tB5\xe0\x41\x02\xfa\x41/\n-privateca.googleapis.com/CertificateAuthority\x12\x1f\n\nrequest_id\x18\x02 \x01(\tB\x0b\xe0\x41\x01\xe2\x8c\xcf\xd7\x08\x02\x08\x01\x12\'\n\x1aignore_dependent_resources\x18\x03 \x01(\x08\x42\x03\xe0\x41\x01\"\x89\x01\n!EnableCertificateAuthorityRequest\x12\x43\n\x04name\x18\x01 \x01(\tB5\xe0\x41\x02\xfa\x41/\n-privateca.googleapis.com/CertificateAuthority\x12\x1f\n\nrequest_id\x18\x02 \x01(\tB\x0b\xe0\x41\x01\xe2\x8c\xcf\xd7\x08\x02\x08\x01\"j\n#FetchCertificateAuthorityCsrRequest\x12\x43\n\x04name\x18\x01 \x01(\tB5\xe0\x41\x02\xfa\x41/\n-privateca.googleapis.com/CertificateAuthority\"<\n$FetchCertificateAuthorityCsrResponse\x12\x14\n\x07pem_csr\x18\x01 \x01(\tB\x03\xe0\x41\x03\"e\n\x1eGetCertificateAuthorityRequest\x12\x43\n\x04name\x18\x01 \x01(\tB5\xe0\x41\x02\xfa\x41/\n-privateca.googleapis.com/CertificateAuthority\"\xb9\x01\n!ListCertificateAuthoritiesRequest\x12\x37\n\x06parent\x18\x01 \x01(\tB\'\xe0\x41\x02\xfa\x41!\n\x1fprivateca.googleapis.com/CaPool\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\x12\x15\n\x08order_by\x18\x05 \x01(\tB\x03\xe0\x41\x01\"\xad\x01\n\"ListCertificateAuthoritiesResponse\x12Y\n\x17\x63\x65rtificate_authorities\x18\x01 \x03(\x0b\x32\x38.google.cloud.security.privateca.v1.CertificateAuthority\x12\x17\n\x0fnext_page_token\x18\x02 \x01(\t\x12\x13\n\x0bunreachable\x18\x03 \x03(\t\"\x8b\x01\n#UndeleteCertificateAuthorityRequest\x12\x43\n\x04name\x18\x01 \x01(\tB5\xe0\x41\x02\xfa\x41/\n-privateca.googleapis.com/CertificateAuthority\x12\x1f\n\nrequest_id\x18\x02 \x01(\tB\x0b\xe0\x41\x01\xe2\x8c\xcf\xd7\x08\x02\x08\x01\"\xfb\x01\n!DeleteCertificateAuthorityRequest\x12\x43\n\x04name\x18\x01 \x01(\tB5\xe0\x41\x02\xfa\x41/\n-privateca.googleapis.com/CertificateAuthority\x12\x1f\n\nrequest_id\x18\x02 \x01(\tB\x0b\xe0\x41\x01\xe2\x8c\xcf\xd7\x08\x02\x08\x01\x12\'\n\x1aignore_active_certificates\x18\x04 \x01(\x08\x42\x03\xe0\x41\x01\x12\x1e\n\x11skip_grace_period\x18\x05 \x01(\x08\x42\x03\xe0\x41\x01\x12\'\n\x1aignore_dependent_resources\x18\x06 \x01(\x08\x42\x03\xe0\x41\x01\"\xd8\x01\n!UpdateCertificateAuthorityRequest\x12\\\n\x15\x63\x65rtificate_authority\x18\x01 \x01(\x0b\x32\x38.google.cloud.security.privateca.v1.CertificateAuthorityB\x03\xe0\x41\x02\x12\x34\n\x0bupdate_mask\x18\x02 \x01(\x0b\x32\x1a.google.protobuf.FieldMaskB\x03\xe0\x41\x02\x12\x1f\n\nrequest_id\x18\x03 \x01(\tB\x0b\xe0\x41\x01\xe2\x8c\xcf\xd7\x08\x02\x08\x01\"\xcc\x01\n\x13\x43reateCaPoolRequest\x12\x39\n\x06parent\x18\x01 \x01(\tB)\xe0\x41\x02\xfa\x41#\n!locations.googleapis.com/Location\x12\x17\n\nca_pool_id\x18\x02 \x01(\tB\x03\xe0\x41\x02\x12@\n\x07\x63\x61_pool\x18\x03 \x01(\x0b\x32*.google.cloud.security.privateca.v1.CaPoolB\x03\xe0\x41\x02\x12\x1f\n\nrequest_id\x18\x04 \x01(\tB\x0b\xe0\x41\x01\xe2\x8c\xcf\xd7\x08\x02\x08\x01\"\xae\x01\n\x13UpdateCaPoolRequest\x12@\n\x07\x63\x61_pool\x18\x01 \x01(\x0b\x32*.google.cloud.security.privateca.v1.CaPoolB\x03\xe0\x41\x02\x12\x34\n\x0bupdate_mask\x18\x02 \x01(\x0b\x32\x1a.google.protobuf.FieldMaskB\x03\xe0\x41\x02\x12\x1f\n\nrequest_id\x18\x03 \x01(\tB\x0b\xe0\x41\x01\xe2\x8c\xcf\xd7\x08\x02\x08\x01\"\x96\x01\n\x13\x44\x65leteCaPoolRequest\x12\x35\n\x04name\x18\x01 \x01(\tB\'\xe0\x41\x02\xfa\x41!\n\x1fprivateca.googleapis.com/CaPool\x12\x1f\n\nrequest_id\x18\x02 \x01(\tB\x0b\xe0\x41\x01\xe2\x8c\xcf\xd7\x08\x02\x08\x01\x12\'\n\x1aignore_dependent_resources\x18\x04 \x01(\x08\x42\x03\xe0\x41\x01\"h\n\x13\x46\x65tchCaCertsRequest\x12\x38\n\x07\x63\x61_pool\x18\x01 \x01(\tB\'\xe0\x41\x02\xfa\x41!\n\x1fprivateca.googleapis.com/CaPool\x12\x17\n\nrequest_id\x18\x02 \x01(\tB\x03\xe0\x41\x01\"\x8f\x01\n\x14\x46\x65tchCaCertsResponse\x12T\n\x08\x63\x61_certs\x18\x01 \x03(\x0b\x32\x42.google.cloud.security.privateca.v1.FetchCaCertsResponse.CertChain\x1a!\n\tCertChain\x12\x14\n\x0c\x63\x65rtificates\x18\x01 \x03(\t\"I\n\x10GetCaPoolRequest\x12\x35\n\x04name\x18\x01 \x01(\tB\'\xe0\x41\x02\xfa\x41!\n\x1fprivateca.googleapis.com/CaPool\"\xac\x01\n\x12ListCaPoolsRequest\x12\x39\n\x06parent\x18\x01 \x01(\tB)\xe0\x41\x02\xfa\x41#\n!locations.googleapis.com/Location\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\x12\x15\n\x08order_by\x18\x05 \x01(\tB\x03\xe0\x41\x01\"\x81\x01\n\x13ListCaPoolsResponse\x12<\n\x08\x63\x61_pools\x18\x01 \x03(\x0b\x32*.google.cloud.security.privateca.v1.CaPool\x12\x17\n\x0fnext_page_token\x18\x02 \x01(\t\x12\x13\n\x0bunreachable\x18\x03 \x03(\t\"o\n#GetCertificateRevocationListRequest\x12H\n\x04name\x18\x01 \x01(\tB:\xe0\x41\x02\xfa\x41\x34\n2privateca.googleapis.com/CertificateRevocationList\"\xcb\x01\n%ListCertificateRevocationListsRequest\x12\x45\n\x06parent\x18\x01 \x01(\tB5\xe0\x41\x02\xfa\x41/\n-privateca.googleapis.com/CertificateAuthority\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\x12\x15\n\x08order_by\x18\x05 \x01(\tB\x03\xe0\x41\x01\"\xbb\x01\n&ListCertificateRevocationListsResponse\x12\x63\n\x1c\x63\x65rtificate_revocation_lists\x18\x01 \x03(\x0b\x32=.google.cloud.security.privateca.v1.CertificateRevocationList\x12\x17\n\x0fnext_page_token\x18\x02 \x01(\t\x12\x13\n\x0bunreachable\x18\x03 \x03(\t\"\xe0\x01\n&UpdateCertificateRevocationListRequest\x12g\n\x1b\x63\x65rtificate_revocation_list\x18\x01 \x01(\x0b\x32=.google.cloud.security.privateca.v1.CertificateRevocationListB\x03\xe0\x41\x02\x12\x34\n\x0bupdate_mask\x18\x02 \x01(\x0b\x32\x1a.google.protobuf.FieldMaskB\x03\xe0\x41\x02\x12\x17\n\nrequest_id\x18\x03 \x01(\tB\x03\xe0\x41\x01\"\x80\x02\n CreateCertificateTemplateRequest\x12\x39\n\x06parent\x18\x01 \x01(\tB)\xe0\x41\x02\xfa\x41#\n!locations.googleapis.com/Location\x12$\n\x17\x63\x65rtificate_template_id\x18\x02 \x01(\tB\x03\xe0\x41\x02\x12Z\n\x14\x63\x65rtificate_template\x18\x03 \x01(\x0b\x32\x37.google.cloud.security.privateca.v1.CertificateTemplateB\x03\xe0\x41\x02\x12\x1f\n\nrequest_id\x18\x04 \x01(\tB\x0b\xe0\x41\x01\xe2\x8c\xcf\xd7\x08\x02\x08\x01\"\x87\x01\n DeleteCertificateTemplateRequest\x12\x42\n\x04name\x18\x01 \x01(\tB4\xe0\x41\x02\xfa\x41.\n,privateca.googleapis.com/CertificateTemplate\x12\x1f\n\nrequest_id\x18\x02 \x01(\tB\x0b\xe0\x41\x01\xe2\x8c\xcf\xd7\x08\x02\x08\x01\"c\n\x1dGetCertificateTemplateRequest\x12\x42\n\x04name\x18\x01 \x01(\tB4\xe0\x41\x02\xfa\x41.\n,privateca.googleapis.com/CertificateTemplate\"\xb9\x01\n\x1fListCertificateTemplatesRequest\x12\x39\n\x06parent\x18\x01 \x01(\tB)\xe0\x41\x02\xfa\x41#\n!locations.googleapis.com/Location\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\x12\x15\n\x08order_by\x18\x05 \x01(\tB\x03\xe0\x41\x01\"\xa8\x01\n ListCertificateTemplatesResponse\x12V\n\x15\x63\x65rtificate_templates\x18\x01 \x03(\x0b\x32\x37.google.cloud.security.privateca.v1.CertificateTemplate\x12\x17\n\x0fnext_page_token\x18\x02 \x01(\t\x12\x13\n\x0bunreachable\x18\x03 \x03(\t\"\xd5\x01\n UpdateCertificateTemplateRequest\x12Z\n\x14\x63\x65rtificate_template\x18\x01 \x01(\x0b\x32\x37.google.cloud.security.privateca.v1.CertificateTemplateB\x03\xe0\x41\x02\x12\x34\n\x0bupdate_mask\x18\x02 \x01(\x0b\x32\x1a.google.protobuf.FieldMaskB\x03\xe0\x41\x02\x12\x1f\n\nrequest_id\x18\x03 \x01(\tB\x0b\xe0\x41\x01\xe2\x8c\xcf\xd7\x08\x02\x08\x01\"\x80\x02\n\x11OperationMetadata\x12\x34\n\x0b\x63reate_time\x18\x01 \x01(\x0b\x32\x1a.google.protobuf.TimestampB\x03\xe0\x41\x03\x12\x31\n\x08\x65nd_time\x18\x02 \x01(\x0b\x32\x1a.google.protobuf.TimestampB\x03\xe0\x41\x03\x12\x13\n\x06target\x18\x03 \x01(\tB\x03\xe0\x41\x03\x12\x11\n\x04verb\x18\x04 \x01(\tB\x03\xe0\x41\x03\x12\x1b\n\x0estatus_message\x18\x05 \x01(\tB\x03\xe0\x41\x03\x12#\n\x16requested_cancellation\x18\x06 \x01(\x08\x42\x03\xe0\x41\x03\x12\x18\n\x0b\x61pi_version\x18\x07 \x01(\tB\x03\xe0\x41\x03\x32\xfa;\n\x1b\x43\x65rtificateAuthorityService\x12\xf7\x01\n\x11\x43reateCertificate\x12<.google.cloud.security.privateca.v1.CreateCertificateRequest\x1a/.google.cloud.security.privateca.v1.Certificate\"s\xda\x41!parent,certificate,certificate_id\x82\xd3\xe4\x93\x02I\":/v1/{parent=projects/*/locations/*/caPools/*}/certificates:\x0b\x63\x65rtificate\x12\xc7\x01\n\x0eGetCertificate\x12\x39.google.cloud.security.privateca.v1.GetCertificateRequest\x1a/.google.cloud.security.privateca.v1.Certificate\"I\xda\x41\x04name\x82\xd3\xe4\x93\x02<\x12:/v1/{name=projects/*/locations/*/caPools/*/certificates/*}\x12\xda\x01\n\x10ListCertificates\x12;.google.cloud.security.privateca.v1.ListCertificatesRequest\x1a<.google.cloud.security.privateca.v1.ListCertificatesResponse\"K\xda\x41\x06parent\x82\xd3\xe4\x93\x02<\x12:/v1/{parent=projects/*/locations/*/caPools/*}/certificates\x12\xd7\x01\n\x11RevokeCertificate\x12<.google.cloud.security.privateca.v1.RevokeCertificateRequest\x1a/.google.cloud.security.privateca.v1.Certificate\"S\xda\x41\x04name\x82\xd3\xe4\x93\x02\x46\"A/v1/{name=projects/*/locations/*/caPools/*/certificates/*}:revoke:\x01*\x12\xf9\x01\n\x11UpdateCertificate\x12<.google.cloud.security.privateca.v1.UpdateCertificateRequest\x1a/.google.cloud.security.privateca.v1.Certificate\"u\xda\x41\x17\x63\x65rtificate,update_mask\x82\xd3\xe4\x93\x02U2F/v1/{certificate.name=projects/*/locations/*/caPools/*/certificates/*}:\x0b\x63\x65rtificate\x12\x94\x02\n\x1c\x41\x63tivateCertificateAuthority\x12G.google.cloud.security.privateca.v1.ActivateCertificateAuthorityRequest\x1a\x1d.google.longrunning.Operation\"\x8b\x01\xca\x41)\n\x14\x43\x65rtificateAuthority\x12\x11OperationMetadata\xda\x41\x04name\x82\xd3\xe4\x93\x02R\"M/v1/{name=projects/*/locations/*/caPools/*/certificateAuthorities/*}:activate:\x01*\x12\xcc\x02\n\x1a\x43reateCertificateAuthority\x12\x45.google.cloud.security.privateca.v1.CreateCertificateAuthorityRequest\x1a\x1d.google.longrunning.Operation\"\xc7\x01\xca\x41)\n\x14\x43\x65rtificateAuthority\x12\x11OperationMetadata\xda\x41\x35parent,certificate_authority,certificate_authority_id\x82\xd3\xe4\x93\x02]\"D/v1/{parent=projects/*/locations/*/caPools/*}/certificateAuthorities:\x15\x63\x65rtificate_authority\x12\x91\x02\n\x1b\x44isableCertificateAuthority\x12\x46.google.cloud.security.privateca.v1.DisableCertificateAuthorityRequest\x1a\x1d.google.longrunning.Operation\"\x8a\x01\xca\x41)\n\x14\x43\x65rtificateAuthority\x12\x11OperationMetadata\xda\x41\x04name\x82\xd3\xe4\x93\x02Q\"L/v1/{name=projects/*/locations/*/caPools/*/certificateAuthorities/*}:disable:\x01*\x12\x8e\x02\n\x1a\x45nableCertificateAuthority\x12\x45.google.cloud.security.privateca.v1.EnableCertificateAuthorityRequest\x1a\x1d.google.longrunning.Operation\"\x89\x01\xca\x41)\n\x14\x43\x65rtificateAuthority\x12\x11OperationMetadata\xda\x41\x04name\x82\xd3\xe4\x93\x02P\"K/v1/{name=projects/*/locations/*/caPools/*/certificateAuthorities/*}:enable:\x01*\x12\x8c\x02\n\x1c\x46\x65tchCertificateAuthorityCsr\x12G.google.cloud.security.privateca.v1.FetchCertificateAuthorityCsrRequest\x1aH.google.cloud.security.privateca.v1.FetchCertificateAuthorityCsrResponse\"Y\xda\x41\x04name\x82\xd3\xe4\x93\x02L\x12J/v1/{name=projects/*/locations/*/caPools/*/certificateAuthorities/*}:fetch\x12\xec\x01\n\x17GetCertificateAuthority\x12\x42.google.cloud.security.privateca.v1.GetCertificateAuthorityRequest\x1a\x38.google.cloud.security.privateca.v1.CertificateAuthority\"S\xda\x41\x04name\x82\xd3\xe4\x93\x02\x46\x12\x44/v1/{name=projects/*/locations/*/caPools/*/certificateAuthorities/*}\x12\x82\x02\n\x1aListCertificateAuthorities\x12\x45.google.cloud.security.privateca.v1.ListCertificateAuthoritiesRequest\x1a\x46.google.cloud.security.privateca.v1.ListCertificateAuthoritiesResponse\"U\xda\x41\x06parent\x82\xd3\xe4\x93\x02\x46\x12\x44/v1/{parent=projects/*/locations/*/caPools/*}/certificateAuthorities\x12\x94\x02\n\x1cUndeleteCertificateAuthority\x12G.google.cloud.security.privateca.v1.UndeleteCertificateAuthorityRequest\x1a\x1d.google.longrunning.Operation\"\x8b\x01\xca\x41)\n\x14\x43\x65rtificateAuthority\x12\x11OperationMetadata\xda\x41\x04name\x82\xd3\xe4\x93\x02R\"M/v1/{name=projects/*/locations/*/caPools/*/certificateAuthorities/*}:undelete:\x01*\x12\x83\x02\n\x1a\x44\x65leteCertificateAuthority\x12\x45.google.cloud.security.privateca.v1.DeleteCertificateAuthorityRequest\x1a\x1d.google.longrunning.Operation\"\x7f\xca\x41)\n\x14\x43\x65rtificateAuthority\x12\x11OperationMetadata\xda\x41\x04name\x82\xd3\xe4\x93\x02\x46*D/v1/{name=projects/*/locations/*/caPools/*/certificateAuthorities/*}\x12\xce\x02\n\x1aUpdateCertificateAuthority\x12\x45.google.cloud.security.privateca.v1.UpdateCertificateAuthorityRequest\x1a\x1d.google.longrunning.Operation\"\xc9\x01\xca\x41)\n\x14\x43\x65rtificateAuthority\x12\x11OperationMetadata\xda\x41!certificate_authority,update_mask\x82\xd3\xe4\x93\x02s2Z/v1/{certificate_authority.name=projects/*/locations/*/caPools/*/certificateAuthorities/*}:\x15\x63\x65rtificate_authority\x12\xde\x01\n\x0c\x43reateCaPool\x12\x37.google.cloud.security.privateca.v1.CreateCaPoolRequest\x1a\x1d.google.longrunning.Operation\"v\xca\x41\x1b\n\x06\x43\x61Pool\x12\x11OperationMetadata\xda\x41\x19parent,ca_pool,ca_pool_id\x82\xd3\xe4\x93\x02\x36\"+/v1/{parent=projects/*/locations/*}/caPools:\x07\x63\x61_pool\x12\xe0\x01\n\x0cUpdateCaPool\x12\x37.google.cloud.security.privateca.v1.UpdateCaPoolRequest\x1a\x1d.google.longrunning.Operation\"x\xca\x41\x1b\n\x06\x43\x61Pool\x12\x11OperationMetadata\xda\x41\x13\x63\x61_pool,update_mask\x82\xd3\xe4\x93\x02>23/v1/{ca_pool.name=projects/*/locations/*/caPools/*}:\x07\x63\x61_pool\x12\xa9\x01\n\tGetCaPool\x12\x34.google.cloud.security.privateca.v1.GetCaPoolRequest\x1a*.google.cloud.security.privateca.v1.CaPool\":\xda\x41\x04name\x82\xd3\xe4\x93\x02-\x12+/v1/{name=projects/*/locations/*/caPools/*}\x12\xbc\x01\n\x0bListCaPools\x12\x36.google.cloud.security.privateca.v1.ListCaPoolsRequest\x1a\x37.google.cloud.security.privateca.v1.ListCaPoolsResponse\"<\xda\x41\x06parent\x82\xd3\xe4\x93\x02-\x12+/v1/{parent=projects/*/locations/*}/caPools\x12\xcf\x01\n\x0c\x44\x65leteCaPool\x12\x37.google.cloud.security.privateca.v1.DeleteCaPoolRequest\x1a\x1d.google.longrunning.Operation\"g\xca\x41*\n\x15google.protobuf.Empty\x12\x11OperationMetadata\xda\x41\x04name\x82\xd3\xe4\x93\x02-*+/v1/{name=projects/*/locations/*/caPools/*}\x12\xd3\x01\n\x0c\x46\x65tchCaCerts\x12\x37.google.cloud.security.privateca.v1.FetchCaCertsRequest\x1a\x38.google.cloud.security.privateca.v1.FetchCaCertsResponse\"P\xda\x41\x07\x63\x61_pool\x82\xd3\xe4\x93\x02@\";/v1/{ca_pool=projects/*/locations/*/caPools/*}:fetchCaCerts:\x01*\x12\x98\x02\n\x1cGetCertificateRevocationList\x12G.google.cloud.security.privateca.v1.GetCertificateRevocationListRequest\x1a=.google.cloud.security.privateca.v1.CertificateRevocationList\"p\xda\x41\x04name\x82\xd3\xe4\x93\x02\x63\x12\x61/v1/{name=projects/*/locations/*/caPools/*/certificateAuthorities/*/certificateRevocationLists/*}\x12\xab\x02\n\x1eListCertificateRevocationLists\x12I.google.cloud.security.privateca.v1.ListCertificateRevocationListsRequest\x1aJ.google.cloud.security.privateca.v1.ListCertificateRevocationListsResponse\"r\xda\x41\x06parent\x82\xd3\xe4\x93\x02\x63\x12\x61/v1/{parent=projects/*/locations/*/caPools/*/certificateAuthorities/*}/certificateRevocationLists\x12\x8d\x03\n\x1fUpdateCertificateRevocationList\x12J.google.cloud.security.privateca.v1.UpdateCertificateRevocationListRequest\x1a\x1d.google.longrunning.Operation\"\xfe\x01\xca\x41.\n\x19\x43\x65rtificateRevocationList\x12\x11OperationMetadata\xda\x41\'certificate_revocation_list,update_mask\x82\xd3\xe4\x93\x02\x9c\x01\x32}/v1/{certificate_revocation_list.name=projects/*/locations/*/caPools/*/certificateAuthorities/*/certificateRevocationLists/*}:\x1b\x63\x65rtificate_revocation_list\x12\xba\x02\n\x19\x43reateCertificateTemplate\x12\x44.google.cloud.security.privateca.v1.CreateCertificateTemplateRequest\x1a\x1d.google.longrunning.Operation\"\xb7\x01\xca\x41(\n\x13\x43\x65rtificateTemplate\x12\x11OperationMetadata\xda\x41\x33parent,certificate_template,certificate_template_id\x82\xd3\xe4\x93\x02P\"8/v1/{parent=projects/*/locations/*}/certificateTemplates:\x14\x63\x65rtificate_template\x12\x9a\x02\n\x19\x44\x65leteCertificateTemplate\x12\x44.google.cloud.security.privateca.v1.DeleteCertificateTemplateRequest\x1a\x1d.google.longrunning.Operation\"\x97\x01\xca\x41M\n\x15google.protobuf.Empty\x12\x34google.cloud.security.privateca.v1.OperationMetadata\xda\x41\x04name\x82\xd3\xe4\x93\x02:*8/v1/{name=projects/*/locations/*/certificateTemplates/*}\x12\xdd\x01\n\x16GetCertificateTemplate\x12\x41.google.cloud.security.privateca.v1.GetCertificateTemplateRequest\x1a\x37.google.cloud.security.privateca.v1.CertificateTemplate\"G\xda\x41\x04name\x82\xd3\xe4\x93\x02:\x12\x38/v1/{name=projects/*/locations/*/certificateTemplates/*}\x12\xf0\x01\n\x18ListCertificateTemplates\x12\x43.google.cloud.security.privateca.v1.ListCertificateTemplatesRequest\x1a\x44.google.cloud.security.privateca.v1.ListCertificateTemplatesResponse\"I\xda\x41\x06parent\x82\xd3\xe4\x93\x02:\x12\x38/v1/{parent=projects/*/locations/*}/certificateTemplates\x12\xbc\x02\n\x19UpdateCertificateTemplate\x12\x44.google.cloud.security.privateca.v1.UpdateCertificateTemplateRequest\x1a\x1d.google.longrunning.Operation\"\xb9\x01\xca\x41(\n\x13\x43\x65rtificateTemplate\x12\x11OperationMetadata\xda\x41 certificate_template,update_mask\x82\xd3\xe4\x93\x02\x65\x32M/v1/{certificate_template.name=projects/*/locations/*/certificateTemplates/*}:\x14\x63\x65rtificate_template\x1aL\xca\x41\x18privateca.googleapis.com\xd2\x41.https://www.googleapis.com/auth/cloud-platformB\xf3\x01\n&com.google.cloud.security.privateca.v1B\x0ePrivateCaProtoP\x01ZDcloud.google.com/go/security/privateca/apiv1/privatecapb;privatecapb\xaa\x02\"Google.Cloud.Security.PrivateCA.V1\xca\x02\"Google\\Cloud\\Security\\PrivateCA\\V1\xea\x02&Google::Cloud::Security::PrivateCA::V1b\x06proto3" - -pool = ::Google::Protobuf::DescriptorPool.generated_pool -pool.add_serialized_file(descriptor_data) - -module Google - module Cloud - module Security - module PrivateCA - module V1 - CreateCertificateRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.security.privateca.v1.CreateCertificateRequest").msgclass - GetCertificateRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.security.privateca.v1.GetCertificateRequest").msgclass - ListCertificatesRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.security.privateca.v1.ListCertificatesRequest").msgclass - ListCertificatesResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.security.privateca.v1.ListCertificatesResponse").msgclass - RevokeCertificateRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.security.privateca.v1.RevokeCertificateRequest").msgclass - UpdateCertificateRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.security.privateca.v1.UpdateCertificateRequest").msgclass - ActivateCertificateAuthorityRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.security.privateca.v1.ActivateCertificateAuthorityRequest").msgclass - CreateCertificateAuthorityRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.security.privateca.v1.CreateCertificateAuthorityRequest").msgclass - DisableCertificateAuthorityRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.security.privateca.v1.DisableCertificateAuthorityRequest").msgclass - EnableCertificateAuthorityRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.security.privateca.v1.EnableCertificateAuthorityRequest").msgclass - FetchCertificateAuthorityCsrRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.security.privateca.v1.FetchCertificateAuthorityCsrRequest").msgclass - FetchCertificateAuthorityCsrResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.security.privateca.v1.FetchCertificateAuthorityCsrResponse").msgclass - GetCertificateAuthorityRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.security.privateca.v1.GetCertificateAuthorityRequest").msgclass - ListCertificateAuthoritiesRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.security.privateca.v1.ListCertificateAuthoritiesRequest").msgclass - ListCertificateAuthoritiesResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.security.privateca.v1.ListCertificateAuthoritiesResponse").msgclass - UndeleteCertificateAuthorityRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.security.privateca.v1.UndeleteCertificateAuthorityRequest").msgclass - DeleteCertificateAuthorityRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.security.privateca.v1.DeleteCertificateAuthorityRequest").msgclass - UpdateCertificateAuthorityRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.security.privateca.v1.UpdateCertificateAuthorityRequest").msgclass - CreateCaPoolRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.security.privateca.v1.CreateCaPoolRequest").msgclass - UpdateCaPoolRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.security.privateca.v1.UpdateCaPoolRequest").msgclass - DeleteCaPoolRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.security.privateca.v1.DeleteCaPoolRequest").msgclass - FetchCaCertsRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.security.privateca.v1.FetchCaCertsRequest").msgclass - FetchCaCertsResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.security.privateca.v1.FetchCaCertsResponse").msgclass - FetchCaCertsResponse::CertChain = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.security.privateca.v1.FetchCaCertsResponse.CertChain").msgclass - GetCaPoolRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.security.privateca.v1.GetCaPoolRequest").msgclass - ListCaPoolsRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.security.privateca.v1.ListCaPoolsRequest").msgclass - ListCaPoolsResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.security.privateca.v1.ListCaPoolsResponse").msgclass - GetCertificateRevocationListRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.security.privateca.v1.GetCertificateRevocationListRequest").msgclass - ListCertificateRevocationListsRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.security.privateca.v1.ListCertificateRevocationListsRequest").msgclass - ListCertificateRevocationListsResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.security.privateca.v1.ListCertificateRevocationListsResponse").msgclass - UpdateCertificateRevocationListRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.security.privateca.v1.UpdateCertificateRevocationListRequest").msgclass - CreateCertificateTemplateRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.security.privateca.v1.CreateCertificateTemplateRequest").msgclass - DeleteCertificateTemplateRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.security.privateca.v1.DeleteCertificateTemplateRequest").msgclass - GetCertificateTemplateRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.security.privateca.v1.GetCertificateTemplateRequest").msgclass - ListCertificateTemplatesRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.security.privateca.v1.ListCertificateTemplatesRequest").msgclass - ListCertificateTemplatesResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.security.privateca.v1.ListCertificateTemplatesResponse").msgclass - UpdateCertificateTemplateRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.security.privateca.v1.UpdateCertificateTemplateRequest").msgclass - OperationMetadata = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.security.privateca.v1.OperationMetadata").msgclass - end - end - end - end -end diff --git a/owl-bot-staging/google-cloud-security-private_ca-v1/lib/google/cloud/security/privateca/v1/service_services_pb.rb b/owl-bot-staging/google-cloud-security-private_ca-v1/lib/google/cloud/security/privateca/v1/service_services_pb.rb deleted file mode 100644 index b7d70569cc84..000000000000 --- a/owl-bot-staging/google-cloud-security-private_ca-v1/lib/google/cloud/security/privateca/v1/service_services_pb.rb +++ /dev/null @@ -1,150 +0,0 @@ -# Generated by the protocol buffer compiler. DO NOT EDIT! -# Source: google/cloud/security/privateca/v1/service.proto for package 'Google.Cloud.Security.PrivateCA.V1' -# Original file comments: -# 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 -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. -# - -require 'grpc' -require 'google/cloud/security/privateca/v1/service_pb' - -module Google - module Cloud - module Security - module PrivateCA - module V1 - module CertificateAuthorityService - # [Certificate Authority - # Service][google.cloud.security.privateca.v1.CertificateAuthorityService] - # manages private certificate authorities and issued certificates. - class Service - - include ::GRPC::GenericService - - self.marshal_class_method = :encode - self.unmarshal_class_method = :decode - self.service_name = 'google.cloud.security.privateca.v1.CertificateAuthorityService' - - # Create a new [Certificate][google.cloud.security.privateca.v1.Certificate] - # in a given Project, Location from a particular - # [CaPool][google.cloud.security.privateca.v1.CaPool]. - rpc :CreateCertificate, ::Google::Cloud::Security::PrivateCA::V1::CreateCertificateRequest, ::Google::Cloud::Security::PrivateCA::V1::Certificate - # Returns a [Certificate][google.cloud.security.privateca.v1.Certificate]. - rpc :GetCertificate, ::Google::Cloud::Security::PrivateCA::V1::GetCertificateRequest, ::Google::Cloud::Security::PrivateCA::V1::Certificate - # Lists [Certificates][google.cloud.security.privateca.v1.Certificate]. - rpc :ListCertificates, ::Google::Cloud::Security::PrivateCA::V1::ListCertificatesRequest, ::Google::Cloud::Security::PrivateCA::V1::ListCertificatesResponse - # Revoke a [Certificate][google.cloud.security.privateca.v1.Certificate]. - rpc :RevokeCertificate, ::Google::Cloud::Security::PrivateCA::V1::RevokeCertificateRequest, ::Google::Cloud::Security::PrivateCA::V1::Certificate - # Update a [Certificate][google.cloud.security.privateca.v1.Certificate]. - # Currently, the only field you can update is the - # [labels][google.cloud.security.privateca.v1.Certificate.labels] field. - rpc :UpdateCertificate, ::Google::Cloud::Security::PrivateCA::V1::UpdateCertificateRequest, ::Google::Cloud::Security::PrivateCA::V1::Certificate - # Activate a - # [CertificateAuthority][google.cloud.security.privateca.v1.CertificateAuthority] - # that is in state - # [AWAITING_USER_ACTIVATION][google.cloud.security.privateca.v1.CertificateAuthority.State.AWAITING_USER_ACTIVATION] - # and is of type - # [SUBORDINATE][google.cloud.security.privateca.v1.CertificateAuthority.Type.SUBORDINATE]. - # After the parent Certificate Authority signs a certificate signing request - # from - # [FetchCertificateAuthorityCsr][google.cloud.security.privateca.v1.CertificateAuthorityService.FetchCertificateAuthorityCsr], - # this method can complete the activation process. - rpc :ActivateCertificateAuthority, ::Google::Cloud::Security::PrivateCA::V1::ActivateCertificateAuthorityRequest, ::Google::Longrunning::Operation - # Create a new - # [CertificateAuthority][google.cloud.security.privateca.v1.CertificateAuthority] - # in a given Project and Location. - rpc :CreateCertificateAuthority, ::Google::Cloud::Security::PrivateCA::V1::CreateCertificateAuthorityRequest, ::Google::Longrunning::Operation - # Disable a - # [CertificateAuthority][google.cloud.security.privateca.v1.CertificateAuthority]. - rpc :DisableCertificateAuthority, ::Google::Cloud::Security::PrivateCA::V1::DisableCertificateAuthorityRequest, ::Google::Longrunning::Operation - # Enable a - # [CertificateAuthority][google.cloud.security.privateca.v1.CertificateAuthority]. - rpc :EnableCertificateAuthority, ::Google::Cloud::Security::PrivateCA::V1::EnableCertificateAuthorityRequest, ::Google::Longrunning::Operation - # Fetch a certificate signing request (CSR) from a - # [CertificateAuthority][google.cloud.security.privateca.v1.CertificateAuthority] - # that is in state - # [AWAITING_USER_ACTIVATION][google.cloud.security.privateca.v1.CertificateAuthority.State.AWAITING_USER_ACTIVATION] - # and is of type - # [SUBORDINATE][google.cloud.security.privateca.v1.CertificateAuthority.Type.SUBORDINATE]. - # The CSR must then be signed by the desired parent Certificate Authority, - # which could be another - # [CertificateAuthority][google.cloud.security.privateca.v1.CertificateAuthority] - # resource, or could be an on-prem certificate authority. See also - # [ActivateCertificateAuthority][google.cloud.security.privateca.v1.CertificateAuthorityService.ActivateCertificateAuthority]. - rpc :FetchCertificateAuthorityCsr, ::Google::Cloud::Security::PrivateCA::V1::FetchCertificateAuthorityCsrRequest, ::Google::Cloud::Security::PrivateCA::V1::FetchCertificateAuthorityCsrResponse - # Returns a - # [CertificateAuthority][google.cloud.security.privateca.v1.CertificateAuthority]. - rpc :GetCertificateAuthority, ::Google::Cloud::Security::PrivateCA::V1::GetCertificateAuthorityRequest, ::Google::Cloud::Security::PrivateCA::V1::CertificateAuthority - # Lists - # [CertificateAuthorities][google.cloud.security.privateca.v1.CertificateAuthority]. - rpc :ListCertificateAuthorities, ::Google::Cloud::Security::PrivateCA::V1::ListCertificateAuthoritiesRequest, ::Google::Cloud::Security::PrivateCA::V1::ListCertificateAuthoritiesResponse - # Undelete a - # [CertificateAuthority][google.cloud.security.privateca.v1.CertificateAuthority] - # that has been deleted. - rpc :UndeleteCertificateAuthority, ::Google::Cloud::Security::PrivateCA::V1::UndeleteCertificateAuthorityRequest, ::Google::Longrunning::Operation - # Delete a - # [CertificateAuthority][google.cloud.security.privateca.v1.CertificateAuthority]. - rpc :DeleteCertificateAuthority, ::Google::Cloud::Security::PrivateCA::V1::DeleteCertificateAuthorityRequest, ::Google::Longrunning::Operation - # Update a - # [CertificateAuthority][google.cloud.security.privateca.v1.CertificateAuthority]. - rpc :UpdateCertificateAuthority, ::Google::Cloud::Security::PrivateCA::V1::UpdateCertificateAuthorityRequest, ::Google::Longrunning::Operation - # Create a [CaPool][google.cloud.security.privateca.v1.CaPool]. - rpc :CreateCaPool, ::Google::Cloud::Security::PrivateCA::V1::CreateCaPoolRequest, ::Google::Longrunning::Operation - # Update a [CaPool][google.cloud.security.privateca.v1.CaPool]. - rpc :UpdateCaPool, ::Google::Cloud::Security::PrivateCA::V1::UpdateCaPoolRequest, ::Google::Longrunning::Operation - # Returns a [CaPool][google.cloud.security.privateca.v1.CaPool]. - rpc :GetCaPool, ::Google::Cloud::Security::PrivateCA::V1::GetCaPoolRequest, ::Google::Cloud::Security::PrivateCA::V1::CaPool - # Lists [CaPools][google.cloud.security.privateca.v1.CaPool]. - rpc :ListCaPools, ::Google::Cloud::Security::PrivateCA::V1::ListCaPoolsRequest, ::Google::Cloud::Security::PrivateCA::V1::ListCaPoolsResponse - # Delete a [CaPool][google.cloud.security.privateca.v1.CaPool]. - rpc :DeleteCaPool, ::Google::Cloud::Security::PrivateCA::V1::DeleteCaPoolRequest, ::Google::Longrunning::Operation - # FetchCaCerts returns the current trust anchor for the - # [CaPool][google.cloud.security.privateca.v1.CaPool]. This will include CA - # certificate chains for all certificate authorities in the ENABLED, - # DISABLED, or STAGED states. - rpc :FetchCaCerts, ::Google::Cloud::Security::PrivateCA::V1::FetchCaCertsRequest, ::Google::Cloud::Security::PrivateCA::V1::FetchCaCertsResponse - # Returns a - # [CertificateRevocationList][google.cloud.security.privateca.v1.CertificateRevocationList]. - rpc :GetCertificateRevocationList, ::Google::Cloud::Security::PrivateCA::V1::GetCertificateRevocationListRequest, ::Google::Cloud::Security::PrivateCA::V1::CertificateRevocationList - # Lists - # [CertificateRevocationLists][google.cloud.security.privateca.v1.CertificateRevocationList]. - rpc :ListCertificateRevocationLists, ::Google::Cloud::Security::PrivateCA::V1::ListCertificateRevocationListsRequest, ::Google::Cloud::Security::PrivateCA::V1::ListCertificateRevocationListsResponse - # Update a - # [CertificateRevocationList][google.cloud.security.privateca.v1.CertificateRevocationList]. - rpc :UpdateCertificateRevocationList, ::Google::Cloud::Security::PrivateCA::V1::UpdateCertificateRevocationListRequest, ::Google::Longrunning::Operation - # Create a new - # [CertificateTemplate][google.cloud.security.privateca.v1.CertificateTemplate] - # in a given Project and Location. - rpc :CreateCertificateTemplate, ::Google::Cloud::Security::PrivateCA::V1::CreateCertificateTemplateRequest, ::Google::Longrunning::Operation - # DeleteCertificateTemplate deletes a - # [CertificateTemplate][google.cloud.security.privateca.v1.CertificateTemplate]. - rpc :DeleteCertificateTemplate, ::Google::Cloud::Security::PrivateCA::V1::DeleteCertificateTemplateRequest, ::Google::Longrunning::Operation - # Returns a - # [CertificateTemplate][google.cloud.security.privateca.v1.CertificateTemplate]. - rpc :GetCertificateTemplate, ::Google::Cloud::Security::PrivateCA::V1::GetCertificateTemplateRequest, ::Google::Cloud::Security::PrivateCA::V1::CertificateTemplate - # Lists - # [CertificateTemplates][google.cloud.security.privateca.v1.CertificateTemplate]. - rpc :ListCertificateTemplates, ::Google::Cloud::Security::PrivateCA::V1::ListCertificateTemplatesRequest, ::Google::Cloud::Security::PrivateCA::V1::ListCertificateTemplatesResponse - # Update a - # [CertificateTemplate][google.cloud.security.privateca.v1.CertificateTemplate]. - rpc :UpdateCertificateTemplate, ::Google::Cloud::Security::PrivateCA::V1::UpdateCertificateTemplateRequest, ::Google::Longrunning::Operation - end - - Stub = Service.rpc_stub_class - end - end - end - end - end -end diff --git a/owl-bot-staging/google-cloud-security-private_ca-v1/proto_docs/README.md b/owl-bot-staging/google-cloud-security-private_ca-v1/proto_docs/README.md deleted file mode 100644 index c573f864e64a..000000000000 --- a/owl-bot-staging/google-cloud-security-private_ca-v1/proto_docs/README.md +++ /dev/null @@ -1,4 +0,0 @@ -# Certificate Authority Service V1 Protocol Buffer Documentation - -These files are for the YARD documentation of the generated protobuf files. -They are not intended to be required or loaded at runtime. diff --git a/owl-bot-staging/google-cloud-security-private_ca-v1/proto_docs/google/api/client.rb b/owl-bot-staging/google-cloud-security-private_ca-v1/proto_docs/google/api/client.rb deleted file mode 100644 index 5089551e9ea4..000000000000 --- a/owl-bot-staging/google-cloud-security-private_ca-v1/proto_docs/google/api/client.rb +++ /dev/null @@ -1,589 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - - -module Google - module Api - # Required information for every language. - # @!attribute [rw] reference_docs_uri - # @deprecated This field is deprecated and may be removed in the next major version update. - # @return [::String] - # Link to automatically generated reference documentation. Example: - # https://cloud.google.com/nodejs/docs/reference/asset/latest - # @!attribute [rw] destinations - # @return [::Array<::Google::Api::ClientLibraryDestination>] - # The destination where API teams want this client library to be published. - # @!attribute [rw] selective_gapic_generation - # @return [::Google::Api::SelectiveGapicGeneration] - # Configuration for which RPCs should be generated in the GAPIC client. - class CommonLanguageSettings - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Details about how and where to publish client libraries. - # @!attribute [rw] version - # @return [::String] - # Version of the API to apply these settings to. This is the full protobuf - # package for the API, ending in the version element. - # Examples: "google.cloud.speech.v1" and "google.spanner.admin.database.v1". - # @!attribute [rw] launch_stage - # @return [::Google::Api::LaunchStage] - # Launch stage of this version of the API. - # @!attribute [rw] rest_numeric_enums - # @return [::Boolean] - # When using transport=rest, the client request will encode enums as - # numbers rather than strings. - # @!attribute [rw] java_settings - # @return [::Google::Api::JavaSettings] - # Settings for legacy Java features, supported in the Service YAML. - # @!attribute [rw] cpp_settings - # @return [::Google::Api::CppSettings] - # Settings for C++ client libraries. - # @!attribute [rw] php_settings - # @return [::Google::Api::PhpSettings] - # Settings for PHP client libraries. - # @!attribute [rw] python_settings - # @return [::Google::Api::PythonSettings] - # Settings for Python client libraries. - # @!attribute [rw] node_settings - # @return [::Google::Api::NodeSettings] - # Settings for Node client libraries. - # @!attribute [rw] dotnet_settings - # @return [::Google::Api::DotnetSettings] - # Settings for .NET client libraries. - # @!attribute [rw] ruby_settings - # @return [::Google::Api::RubySettings] - # Settings for Ruby client libraries. - # @!attribute [rw] go_settings - # @return [::Google::Api::GoSettings] - # Settings for Go client libraries. - class ClientLibrarySettings - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # This message configures the settings for publishing [Google Cloud Client - # libraries](https://cloud.google.com/apis/docs/cloud-client-libraries) - # generated from the service config. - # @!attribute [rw] method_settings - # @return [::Array<::Google::Api::MethodSettings>] - # A list of API method settings, e.g. the behavior for methods that use the - # long-running operation pattern. - # @!attribute [rw] new_issue_uri - # @return [::String] - # Link to a *public* URI where users can report issues. Example: - # https://issuetracker.google.com/issues/new?component=190865&template=1161103 - # @!attribute [rw] documentation_uri - # @return [::String] - # Link to product home page. Example: - # https://cloud.google.com/asset-inventory/docs/overview - # @!attribute [rw] api_short_name - # @return [::String] - # Used as a tracking tag when collecting data about the APIs developer - # relations artifacts like docs, packages delivered to package managers, - # etc. Example: "speech". - # @!attribute [rw] github_label - # @return [::String] - # GitHub label to apply to issues and pull requests opened for this API. - # @!attribute [rw] codeowner_github_teams - # @return [::Array<::String>] - # GitHub teams to be added to CODEOWNERS in the directory in GitHub - # containing source code for the client libraries for this API. - # @!attribute [rw] doc_tag_prefix - # @return [::String] - # A prefix used in sample code when demarking regions to be included in - # documentation. - # @!attribute [rw] organization - # @return [::Google::Api::ClientLibraryOrganization] - # For whom the client library is being published. - # @!attribute [rw] library_settings - # @return [::Array<::Google::Api::ClientLibrarySettings>] - # Client library settings. If the same version string appears multiple - # times in this list, then the last one wins. Settings from earlier - # settings with the same version string are discarded. - # @!attribute [rw] proto_reference_documentation_uri - # @return [::String] - # Optional link to proto reference documentation. Example: - # https://cloud.google.com/pubsub/lite/docs/reference/rpc - # @!attribute [rw] rest_reference_documentation_uri - # @return [::String] - # Optional link to REST reference documentation. Example: - # https://cloud.google.com/pubsub/lite/docs/reference/rest - class Publishing - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Settings for Java client libraries. - # @!attribute [rw] library_package - # @return [::String] - # The package name to use in Java. Clobbers the java_package option - # set in the protobuf. This should be used **only** by APIs - # who have already set the language_settings.java.package_name" field - # in gapic.yaml. API teams should use the protobuf java_package option - # where possible. - # - # Example of a YAML configuration:: - # - # publishing: - # 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. - # @!attribute [rw] methods - # @return [::Array<::String>] - # An allowlist of the fully qualified names of RPCs that should be included - # on public client surfaces. - # @!attribute [rw] generate_omitted_as_internal - # @return [::Boolean] - # Setting this to true indicates to the client generators that methods - # that would be excluded from the generation should instead be generated - # in a way that indicates these methods should not be consumed by - # end users. How this is expressed is up to individual language - # implementations to decide. Some examples may be: added annotations, - # obfuscated identifiers, or other language idiomatic patterns. - class SelectiveGapicGeneration - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # `BatchingConfigProto` defines the batching configuration for an API method. - # @!attribute [rw] thresholds - # @return [::Google::Api::BatchingSettingsProto] - # The thresholds which trigger a batched request to be sent. - # @!attribute [rw] batch_descriptor - # @return [::Google::Api::BatchingDescriptorProto] - # The request and response fields used in batching. - class BatchingConfigProto - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # `BatchingSettingsProto` specifies a set of batching thresholds, each of - # which acts as a trigger to send a batch of messages as a request. At least - # one threshold must be positive nonzero. - # @!attribute [rw] element_count_threshold - # @return [::Integer] - # The number of elements of a field collected into a batch which, if - # exceeded, causes the batch to be sent. - # @!attribute [rw] request_byte_threshold - # @return [::Integer] - # The aggregated size of the batched field which, if exceeded, causes the - # batch to be sent. This size is computed by aggregating the sizes of the - # request field to be batched, not of the entire request message. - # @!attribute [rw] delay_threshold - # @return [::Google::Protobuf::Duration] - # The duration after which a batch should be sent, starting from the addition - # of the first message to that batch. - # @!attribute [rw] element_count_limit - # @return [::Integer] - # The maximum number of elements collected in a batch that could be accepted - # by server. - # @!attribute [rw] request_byte_limit - # @return [::Integer] - # The maximum size of the request that could be accepted by server. - # @!attribute [rw] flow_control_element_limit - # @return [::Integer] - # The maximum number of elements allowed by flow control. - # @!attribute [rw] flow_control_byte_limit - # @return [::Integer] - # The maximum size of data allowed by flow control. - # @!attribute [rw] flow_control_limit_exceeded_behavior - # @return [::Google::Api::FlowControlLimitExceededBehaviorProto] - # The behavior to take when the flow control limit is exceeded. - class BatchingSettingsProto - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # `BatchingDescriptorProto` specifies the fields of the request message to be - # used for batching, and, optionally, the fields of the response message to be - # used for demultiplexing. - # @!attribute [rw] batched_field - # @return [::String] - # The repeated field in the request message to be aggregated by batching. - # @!attribute [rw] discriminator_fields - # @return [::Array<::String>] - # A list of the fields in the request message. Two requests will be batched - # together only if the values of every field specified in - # `request_discriminator_fields` is equal between the two requests. - # @!attribute [rw] subresponse_field - # @return [::String] - # Optional. When present, indicates the field in the response message to be - # used to demultiplex the response into multiple response messages, in - # correspondence with the multiple request messages originally batched - # together. - class BatchingDescriptorProto - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # The organization for which the client libraries are being published. - # Affects the url where generated docs are published, etc. - module ClientLibraryOrganization - # Not useful. - CLIENT_LIBRARY_ORGANIZATION_UNSPECIFIED = 0 - - # Google Cloud Platform Org. - CLOUD = 1 - - # Ads (Advertising) Org. - ADS = 2 - - # Photos Org. - PHOTOS = 3 - - # Street View Org. - STREET_VIEW = 4 - - # Shopping Org. - SHOPPING = 5 - - # Geo Org. - GEO = 6 - - # Generative AI - https://developers.generativeai.google - GENERATIVE_AI = 7 - end - - # To where should client libraries be published? - module ClientLibraryDestination - # Client libraries will neither be generated nor published to package - # managers. - CLIENT_LIBRARY_DESTINATION_UNSPECIFIED = 0 - - # Generate the client library in a repo under github.com/googleapis, - # but don't publish it to package managers. - GITHUB = 10 - - # Publish the library to package managers like nuget.org and npmjs.com. - PACKAGE_MANAGER = 20 - end - - # The behavior to take when the flow control limit is exceeded. - module FlowControlLimitExceededBehaviorProto - # Default behavior, system-defined. - UNSET_BEHAVIOR = 0 - - # Stop operation, raise error. - THROW_EXCEPTION = 1 - - # Pause operation until limit clears. - BLOCK = 2 - - # Continue operation, disregard limit. - IGNORE = 3 - end - end -end diff --git a/owl-bot-staging/google-cloud-security-private_ca-v1/proto_docs/google/api/field_behavior.rb b/owl-bot-staging/google-cloud-security-private_ca-v1/proto_docs/google/api/field_behavior.rb deleted file mode 100644 index 582be187d115..000000000000 --- a/owl-bot-staging/google-cloud-security-private_ca-v1/proto_docs/google/api/field_behavior.rb +++ /dev/null @@ -1,85 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - - -module Google - module Api - # An indicator of the behavior of a given field (for example, that a field - # is required in requests, or given as output but ignored as input). - # This **does not** change the behavior in protocol buffers itself; it only - # denotes the behavior and may affect how API tooling handles the field. - # - # Note: This enum **may** receive new values in the future. - module FieldBehavior - # Conventional default for enums. Do not use this. - FIELD_BEHAVIOR_UNSPECIFIED = 0 - - # Specifically denotes a field as optional. - # While all fields in protocol buffers are optional, this may be specified - # for emphasis if appropriate. - OPTIONAL = 1 - - # Denotes a field as required. - # This indicates that the field **must** be provided as part of the request, - # and failure to do so will cause an error (usually `INVALID_ARGUMENT`). - REQUIRED = 2 - - # Denotes a field as output only. - # This indicates that the field is provided in responses, but including the - # field in a request does nothing (the server *must* ignore it and - # *must not* throw an error as a result of the field's presence). - OUTPUT_ONLY = 3 - - # Denotes a field as input only. - # This indicates that the field is provided in requests, and the - # corresponding field is not included in output. - INPUT_ONLY = 4 - - # Denotes a field as immutable. - # This indicates that the field may be set once in a request to create a - # resource, but may not be changed thereafter. - IMMUTABLE = 5 - - # Denotes that a (repeated) field is an unordered list. - # This indicates that the service may provide the elements of the list - # in any arbitrary order, rather than the order the user originally - # provided. Additionally, the list's order may or may not be stable. - UNORDERED_LIST = 6 - - # Denotes that this field returns a non-empty default value if not set. - # This indicates that if the user provides the empty value in a request, - # a non-empty value will be returned. The user will not be aware of what - # non-empty value to expect. - NON_EMPTY_DEFAULT = 7 - - # Denotes that the field in a resource (a message annotated with - # google.api.resource) is used in the resource name to uniquely identify the - # resource. For AIP-compliant APIs, this should only be applied to the - # `name` field on the resource. - # - # This behavior should not be applied to references to other resources within - # the message. - # - # The identifier field of resources often have different field behavior - # depending on the request it is embedded in (e.g. for Create methods name - # is optional and unused, while for Update methods it is required). Instead - # of method-specific annotations, only `IDENTIFIER` is required. - IDENTIFIER = 8 - end - end -end diff --git a/owl-bot-staging/google-cloud-security-private_ca-v1/proto_docs/google/api/field_info.rb b/owl-bot-staging/google-cloud-security-private_ca-v1/proto_docs/google/api/field_info.rb deleted file mode 100644 index 0f5acf0a5538..000000000000 --- a/owl-bot-staging/google-cloud-security-private_ca-v1/proto_docs/google/api/field_info.rb +++ /dev/null @@ -1,88 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - - -module Google - module Api - # Rich semantic information of an API field beyond basic typing. - # @!attribute [rw] format - # @return [::Google::Api::FieldInfo::Format] - # The standard format of a field value. This does not explicitly configure - # any API consumer, just documents the API's format for the field it is - # applied to. - # @!attribute [rw] referenced_types - # @return [::Array<::Google::Api::TypeReference>] - # The type(s) that the annotated, generic field may represent. - # - # Currently, this must only be used on fields of type `google.protobuf.Any`. - # Supporting other generic types may be considered in the future. - class FieldInfo - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - - # The standard format of a field value. The supported formats are all backed - # by either an RFC defined by the IETF or a Google-defined AIP. - module Format - # Default, unspecified value. - FORMAT_UNSPECIFIED = 0 - - # Universally Unique Identifier, version 4, value as defined by - # https://datatracker.ietf.org/doc/html/rfc4122. The value may be - # normalized to entirely lowercase letters. For example, the value - # `F47AC10B-58CC-0372-8567-0E02B2C3D479` would be normalized to - # `f47ac10b-58cc-0372-8567-0e02b2c3d479`. - UUID4 = 1 - - # Internet Protocol v4 value as defined by [RFC - # 791](https://datatracker.ietf.org/doc/html/rfc791). The value may be - # condensed, with leading zeros in each octet stripped. For example, - # `001.022.233.040` would be condensed to `1.22.233.40`. - IPV4 = 2 - - # Internet Protocol v6 value as defined by [RFC - # 2460](https://datatracker.ietf.org/doc/html/rfc2460). The value may be - # normalized to entirely lowercase letters with zeros compressed, following - # [RFC 5952](https://datatracker.ietf.org/doc/html/rfc5952). For example, - # the value `2001:0DB8:0::0` would be normalized to `2001:db8::`. - IPV6 = 3 - - # An IP address in either v4 or v6 format as described by the individual - # values defined herein. See the comments on the IPV4 and IPV6 types for - # allowed normalizations of each. - IPV4_OR_IPV6 = 4 - end - end - - # A reference to a message type, for use in {::Google::Api::FieldInfo FieldInfo}. - # @!attribute [rw] type_name - # @return [::String] - # The name of the type that the annotated, generic field may represent. - # If the type is in the same protobuf package, the value can be the simple - # message name e.g., `"MyMessage"`. Otherwise, the value must be the - # fully-qualified message name e.g., `"google.library.v1.Book"`. - # - # If the type(s) are unknown to the service (e.g. the field accepts generic - # user input), use the wildcard `"*"` to denote this behavior. - # - # See [AIP-202](https://google.aip.dev/202#type-references) for more details. - class TypeReference - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - end -end diff --git a/owl-bot-staging/google-cloud-security-private_ca-v1/proto_docs/google/api/launch_stage.rb b/owl-bot-staging/google-cloud-security-private_ca-v1/proto_docs/google/api/launch_stage.rb deleted file mode 100644 index 9392a413fb1b..000000000000 --- a/owl-bot-staging/google-cloud-security-private_ca-v1/proto_docs/google/api/launch_stage.rb +++ /dev/null @@ -1,71 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - - -module Google - module Api - # The launch stage as defined by [Google Cloud Platform - # Launch Stages](https://cloud.google.com/terms/launch-stages). - module LaunchStage - # Do not use this default value. - LAUNCH_STAGE_UNSPECIFIED = 0 - - # The feature is not yet implemented. Users can not use it. - UNIMPLEMENTED = 6 - - # Prelaunch features are hidden from users and are only visible internally. - PRELAUNCH = 7 - - # Early Access features are limited to a closed group of testers. To use - # these features, you must sign up in advance and sign a Trusted Tester - # agreement (which includes confidentiality provisions). These features may - # be unstable, changed in backward-incompatible ways, and are not - # guaranteed to be released. - EARLY_ACCESS = 1 - - # Alpha is a limited availability test for releases before they are cleared - # for widespread use. By Alpha, all significant design issues are resolved - # and we are in the process of verifying functionality. Alpha customers - # need to apply for access, agree to applicable terms, and have their - # projects allowlisted. Alpha releases don't have to be feature complete, - # no SLAs are provided, and there are no technical support obligations, but - # they will be far enough along that customers can actually use them in - # test environments or for limited-use tests -- just like they would in - # normal production cases. - ALPHA = 2 - - # Beta is the point at which we are ready to open a release for any - # customer to use. There are no SLA or technical support obligations in a - # Beta release. Products will be complete from a feature perspective, but - # may have some open outstanding issues. Beta releases are suitable for - # limited production use cases. - BETA = 3 - - # GA features are open to all developers and are considered stable and - # fully qualified for production use. - GA = 4 - - # Deprecated features are scheduled to be shut down and removed. For more - # information, see the "Deprecation Policy" section of our [Terms of - # Service](https://cloud.google.com/terms/) - # and the [Google Cloud Platform Subject to the Deprecation - # Policy](https://cloud.google.com/terms/deprecation) documentation. - DEPRECATED = 5 - end - end -end diff --git a/owl-bot-staging/google-cloud-security-private_ca-v1/proto_docs/google/api/resource.rb b/owl-bot-staging/google-cloud-security-private_ca-v1/proto_docs/google/api/resource.rb deleted file mode 100644 index 25dec4847ac1..000000000000 --- a/owl-bot-staging/google-cloud-security-private_ca-v1/proto_docs/google/api/resource.rb +++ /dev/null @@ -1,227 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - - -module Google - module Api - # A simple descriptor of a resource type. - # - # ResourceDescriptor annotates a resource message (either by means of a - # protobuf annotation or use in the service config), and associates the - # resource's schema, the resource type, and the pattern of the resource name. - # - # Example: - # - # message Topic { - # // Indicates this message defines a resource schema. - # // Declares the resource type in the format of {service}/{kind}. - # // For Kubernetes resources, the format is {api group}/{kind}. - # option (google.api.resource) = { - # type: "pubsub.googleapis.com/Topic" - # pattern: "projects/{project}/topics/{topic}" - # }; - # } - # - # The ResourceDescriptor Yaml config will look like: - # - # resources: - # - type: "pubsub.googleapis.com/Topic" - # pattern: "projects/{project}/topics/{topic}" - # - # Sometimes, resources have multiple patterns, typically because they can - # live under multiple parents. - # - # Example: - # - # message LogEntry { - # option (google.api.resource) = { - # type: "logging.googleapis.com/LogEntry" - # pattern: "projects/{project}/logs/{log}" - # pattern: "folders/{folder}/logs/{log}" - # pattern: "organizations/{organization}/logs/{log}" - # pattern: "billingAccounts/{billing_account}/logs/{log}" - # }; - # } - # - # The ResourceDescriptor Yaml config will look like: - # - # resources: - # - type: 'logging.googleapis.com/LogEntry' - # pattern: "projects/{project}/logs/{log}" - # pattern: "folders/{folder}/logs/{log}" - # pattern: "organizations/{organization}/logs/{log}" - # pattern: "billingAccounts/{billing_account}/logs/{log}" - # @!attribute [rw] type - # @return [::String] - # The resource type. It must be in the format of - # \\{service_name}/\\{resource_type_kind}. The `resource_type_kind` must be - # singular and must not include version numbers. - # - # Example: `storage.googleapis.com/Bucket` - # - # The value of the resource_type_kind must follow the regular expression - # /[A-Za-z][a-zA-Z0-9]+/. It should start with an upper case character and - # should use PascalCase (UpperCamelCase). The maximum number of - # characters allowed for the `resource_type_kind` is 100. - # @!attribute [rw] pattern - # @return [::Array<::String>] - # Optional. The relative resource name pattern associated with this resource - # type. The DNS prefix of the full resource name shouldn't be specified here. - # - # The path pattern must follow the syntax, which aligns with HTTP binding - # syntax: - # - # Template = Segment { "/" Segment } ; - # Segment = LITERAL | Variable ; - # Variable = "{" LITERAL "}" ; - # - # Examples: - # - # - "projects/\\{project}/topics/\\{topic}" - # - "projects/\\{project}/knowledgeBases/\\{knowledge_base}" - # - # The components in braces correspond to the IDs for each resource in the - # hierarchy. It is expected that, if multiple patterns are provided, - # the same component name (e.g. "project") refers to IDs of the same - # type of resource. - # @!attribute [rw] name_field - # @return [::String] - # Optional. The field on the resource that designates the resource name - # field. If omitted, this is assumed to be "name". - # @!attribute [rw] history - # @return [::Google::Api::ResourceDescriptor::History] - # Optional. The historical or future-looking state of the resource pattern. - # - # Example: - # - # // The InspectTemplate message originally only supported resource - # // names with organization, and project was added later. - # message InspectTemplate { - # option (google.api.resource) = { - # type: "dlp.googleapis.com/InspectTemplate" - # pattern: - # "organizations/{organization}/inspectTemplates/{inspect_template}" - # pattern: "projects/{project}/inspectTemplates/{inspect_template}" - # history: ORIGINALLY_SINGLE_PATTERN - # }; - # } - # @!attribute [rw] plural - # @return [::String] - # The plural name used in the resource name and permission names, such as - # 'projects' for the resource name of 'projects/\\{project}' and the permission - # name of 'cloudresourcemanager.googleapis.com/projects.get'. One exception - # to this is for Nested Collections that have stuttering names, as defined - # in [AIP-122](https://google.aip.dev/122#nested-collections), where the - # collection ID in the resource name pattern does not necessarily directly - # match the `plural` value. - # - # It is the same concept of the `plural` field in k8s CRD spec - # https://kubernetes.io/docs/tasks/access-kubernetes-api/custom-resources/custom-resource-definitions/ - # - # Note: The plural form is required even for singleton resources. See - # https://aip.dev/156 - # @!attribute [rw] singular - # @return [::String] - # The same concept of the `singular` field in k8s CRD spec - # https://kubernetes.io/docs/tasks/access-kubernetes-api/custom-resources/custom-resource-definitions/ - # Such as "project" for the `resourcemanager.googleapis.com/Project` type. - # @!attribute [rw] style - # @return [::Array<::Google::Api::ResourceDescriptor::Style>] - # Style flag(s) for this resource. - # These indicate that a resource is expected to conform to a given - # style. See the specific style flags for additional information. - class ResourceDescriptor - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - - # A description of the historical or future-looking state of the - # resource pattern. - module History - # The "unset" value. - HISTORY_UNSPECIFIED = 0 - - # The resource originally had one pattern and launched as such, and - # additional patterns were added later. - ORIGINALLY_SINGLE_PATTERN = 1 - - # The resource has one pattern, but the API owner expects to add more - # later. (This is the inverse of ORIGINALLY_SINGLE_PATTERN, and prevents - # that from being necessary once there are multiple patterns.) - FUTURE_MULTI_PATTERN = 2 - end - - # A flag representing a specific style that a resource claims to conform to. - module Style - # The unspecified value. Do not use. - STYLE_UNSPECIFIED = 0 - - # This resource is intended to be "declarative-friendly". - # - # Declarative-friendly resources must be more strictly consistent, and - # setting this to true communicates to tools that this resource should - # adhere to declarative-friendly expectations. - # - # Note: This is used by the API linter (linter.aip.dev) to enable - # additional checks. - DECLARATIVE_FRIENDLY = 1 - end - end - - # Defines a proto annotation that describes a string field that refers to - # an API resource. - # @!attribute [rw] type - # @return [::String] - # The resource type that the annotated field references. - # - # Example: - # - # message Subscription { - # string topic = 2 [(google.api.resource_reference) = { - # type: "pubsub.googleapis.com/Topic" - # }]; - # } - # - # Occasionally, a field may reference an arbitrary resource. In this case, - # APIs use the special value * in their resource reference. - # - # Example: - # - # message GetIamPolicyRequest { - # string resource = 2 [(google.api.resource_reference) = { - # type: "*" - # }]; - # } - # @!attribute [rw] child_type - # @return [::String] - # The resource type of a child collection that the annotated field - # references. This is useful for annotating the `parent` field that - # doesn't have a fixed resource type. - # - # Example: - # - # message ListLogEntriesRequest { - # string parent = 1 [(google.api.resource_reference) = { - # child_type: "logging.googleapis.com/LogEntry" - # }; - # } - class ResourceReference - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - end -end diff --git a/owl-bot-staging/google-cloud-security-private_ca-v1/proto_docs/google/cloud/security/privateca/v1/resources.rb b/owl-bot-staging/google-cloud-security-private_ca-v1/proto_docs/google/cloud/security/privateca/v1/resources.rb deleted file mode 100644 index 11ccb21b09f2..000000000000 --- a/owl-bot-staging/google-cloud-security-private_ca-v1/proto_docs/google/cloud/security/privateca/v1/resources.rb +++ /dev/null @@ -1,1676 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - - -module Google - module Cloud - module Security - module PrivateCA - module V1 - # A - # {::Google::Cloud::Security::PrivateCA::V1::CertificateAuthority CertificateAuthority} - # represents an individual Certificate Authority. A - # {::Google::Cloud::Security::PrivateCA::V1::CertificateAuthority CertificateAuthority} - # can be used to create - # {::Google::Cloud::Security::PrivateCA::V1::Certificate Certificates}. - # @!attribute [rw] name - # @return [::String] - # Identifier. The resource name for this - # {::Google::Cloud::Security::PrivateCA::V1::CertificateAuthority CertificateAuthority} - # in the format `projects/*/locations/*/caPools/*/certificateAuthorities/*`. - # @!attribute [rw] type - # @return [::Google::Cloud::Security::PrivateCA::V1::CertificateAuthority::Type] - # Required. Immutable. The - # {::Google::Cloud::Security::PrivateCA::V1::CertificateAuthority::Type Type} of - # this - # {::Google::Cloud::Security::PrivateCA::V1::CertificateAuthority CertificateAuthority}. - # @!attribute [rw] config - # @return [::Google::Cloud::Security::PrivateCA::V1::CertificateConfig] - # Required. Immutable. The config used to create a self-signed X.509 - # certificate or CSR. - # @!attribute [rw] lifetime - # @return [::Google::Protobuf::Duration] - # Required. Immutable. The desired lifetime of the CA certificate. Used to - # create the "not_before_time" and "not_after_time" fields inside an X.509 - # certificate. - # @!attribute [rw] key_spec - # @return [::Google::Cloud::Security::PrivateCA::V1::CertificateAuthority::KeyVersionSpec] - # Required. Immutable. Used when issuing certificates for this - # {::Google::Cloud::Security::PrivateCA::V1::CertificateAuthority CertificateAuthority}. - # If this - # {::Google::Cloud::Security::PrivateCA::V1::CertificateAuthority CertificateAuthority} - # is a self-signed CertificateAuthority, this key is also used to sign the - # self-signed CA certificate. Otherwise, it is used to sign a CSR. - # @!attribute [rw] subordinate_config - # @return [::Google::Cloud::Security::PrivateCA::V1::SubordinateConfig] - # Optional. If this is a subordinate - # {::Google::Cloud::Security::PrivateCA::V1::CertificateAuthority CertificateAuthority}, - # this field will be set with the subordinate configuration, which describes - # its issuers. This may be updated, but this - # {::Google::Cloud::Security::PrivateCA::V1::CertificateAuthority CertificateAuthority} - # must continue to validate. - # @!attribute [r] tier - # @return [::Google::Cloud::Security::PrivateCA::V1::CaPool::Tier] - # Output only. The - # {::Google::Cloud::Security::PrivateCA::V1::CaPool::Tier CaPool.Tier} of the - # {::Google::Cloud::Security::PrivateCA::V1::CaPool CaPool} that includes this - # {::Google::Cloud::Security::PrivateCA::V1::CertificateAuthority CertificateAuthority}. - # @!attribute [r] state - # @return [::Google::Cloud::Security::PrivateCA::V1::CertificateAuthority::State] - # Output only. The - # {::Google::Cloud::Security::PrivateCA::V1::CertificateAuthority::State State} for - # this - # {::Google::Cloud::Security::PrivateCA::V1::CertificateAuthority CertificateAuthority}. - # @!attribute [r] pem_ca_certificates - # @return [::Array<::String>] - # Output only. This - # {::Google::Cloud::Security::PrivateCA::V1::CertificateAuthority CertificateAuthority}'s - # certificate chain, including the current - # {::Google::Cloud::Security::PrivateCA::V1::CertificateAuthority CertificateAuthority}'s - # certificate. Ordered such that the root issuer is the final element - # (consistent with RFC 5246). For a self-signed CA, this will only list the - # current - # {::Google::Cloud::Security::PrivateCA::V1::CertificateAuthority CertificateAuthority}'s - # certificate. - # @!attribute [r] ca_certificate_descriptions - # @return [::Array<::Google::Cloud::Security::PrivateCA::V1::CertificateDescription>] - # Output only. A structured description of this - # {::Google::Cloud::Security::PrivateCA::V1::CertificateAuthority CertificateAuthority}'s - # CA certificate and its issuers. Ordered as self-to-root. - # @!attribute [rw] gcs_bucket - # @return [::String] - # Immutable. The name of a Cloud Storage bucket where this - # {::Google::Cloud::Security::PrivateCA::V1::CertificateAuthority CertificateAuthority} - # will publish content, such as the CA certificate and CRLs. This must be a - # bucket name, without any prefixes (such as `gs://`) or suffixes (such as - # `.googleapis.com`). For example, to use a bucket named `my-bucket`, you - # would simply specify `my-bucket`. If not specified, a managed bucket will - # be created. - # @!attribute [r] access_urls - # @return [::Google::Cloud::Security::PrivateCA::V1::CertificateAuthority::AccessUrls] - # Output only. URLs for accessing content published by this CA, such as the - # CA certificate and CRLs. - # @!attribute [r] create_time - # @return [::Google::Protobuf::Timestamp] - # Output only. The time at which this - # {::Google::Cloud::Security::PrivateCA::V1::CertificateAuthority CertificateAuthority} - # was created. - # @!attribute [r] update_time - # @return [::Google::Protobuf::Timestamp] - # Output only. The time at which this - # {::Google::Cloud::Security::PrivateCA::V1::CertificateAuthority CertificateAuthority} - # was last updated. - # @!attribute [r] delete_time - # @return [::Google::Protobuf::Timestamp] - # Output only. The time at which this - # {::Google::Cloud::Security::PrivateCA::V1::CertificateAuthority CertificateAuthority} - # was soft deleted, if it is in the - # {::Google::Cloud::Security::PrivateCA::V1::CertificateAuthority::State::DELETED DELETED} - # state. - # @!attribute [r] expire_time - # @return [::Google::Protobuf::Timestamp] - # Output only. The time at which this - # {::Google::Cloud::Security::PrivateCA::V1::CertificateAuthority CertificateAuthority} - # will be permanently purged, if it is in the - # {::Google::Cloud::Security::PrivateCA::V1::CertificateAuthority::State::DELETED DELETED} - # state. - # @!attribute [rw] labels - # @return [::Google::Protobuf::Map{::String => ::String}] - # Optional. Labels with user-defined metadata. - # @!attribute [rw] user_defined_access_urls - # @return [::Google::Cloud::Security::PrivateCA::V1::CertificateAuthority::UserDefinedAccessUrls] - # Optional. User-defined URLs for CA certificate and CRLs. The service does - # not publish content to these URLs. It is up to the user to mirror content - # to these URLs. - # @!attribute [r] satisfies_pzs - # @return [::Boolean] - # Output only. Reserved for future use. - # @!attribute [r] satisfies_pzi - # @return [::Boolean] - # Output only. Reserved for future use. - class CertificateAuthority - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - - # URLs where a - # {::Google::Cloud::Security::PrivateCA::V1::CertificateAuthority CertificateAuthority} - # will publish content. - # @!attribute [rw] ca_certificate_access_url - # @return [::String] - # The URL where this - # {::Google::Cloud::Security::PrivateCA::V1::CertificateAuthority CertificateAuthority}'s - # CA certificate is published. This will only be set for CAs that have been - # activated. - # @!attribute [rw] crl_access_urls - # @return [::Array<::String>] - # The URLs where this - # {::Google::Cloud::Security::PrivateCA::V1::CertificateAuthority CertificateAuthority}'s - # CRLs are published. This will only be set for CAs that have been - # activated. - class AccessUrls - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # A Cloud KMS key configuration that a - # {::Google::Cloud::Security::PrivateCA::V1::CertificateAuthority CertificateAuthority} - # will use. - # @!attribute [rw] cloud_kms_key_version - # @return [::String] - # The resource name for an existing Cloud KMS CryptoKeyVersion in the - # format - # `projects/*/locations/*/keyRings/*/cryptoKeys/*/cryptoKeyVersions/*`. - # This option enables full flexibility in the key's capabilities and - # properties. - # - # Note: The following fields are mutually exclusive: `cloud_kms_key_version`, `algorithm`. If a field in that set is populated, all other fields in the set will automatically be cleared. - # @!attribute [rw] algorithm - # @return [::Google::Cloud::Security::PrivateCA::V1::CertificateAuthority::SignHashAlgorithm] - # The algorithm to use for creating a managed Cloud KMS key for a for a - # simplified experience. All managed keys will be have their - # [ProtectionLevel][google.cloud.kms.v1.ProtectionLevel] as `HSM`. - # - # Note: The following fields are mutually exclusive: `algorithm`, `cloud_kms_key_version`. If a field in that set is populated, all other fields in the set will automatically be cleared. - class KeyVersionSpec - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # User-defined URLs for accessing content published by this - # {::Google::Cloud::Security::PrivateCA::V1::CertificateAuthority CertificateAuthority}. - # @!attribute [rw] aia_issuing_certificate_urls - # @return [::Array<::String>] - # Optional. A list of URLs where the issuer CA certificate may be - # downloaded, which appears in the "Authority Information Access" extension - # in the certificate. If specified, the default [Cloud Storage - # URLs][google.cloud.security.privateca.v1.CertificateAuthority.AccessUrls.ca_certificate_access_url] - # will be omitted. - # @!attribute [rw] crl_access_urls - # @return [::Array<::String>] - # Optional. A list of URLs where to obtain CRL information, i.e. - # the DistributionPoint.fullName described by - # https://tools.ietf.org/html/rfc5280#section-4.2.1.13. - # If specified, the default - # [Cloud Storage - # URLs][google.cloud.security.privateca.v1.CertificateAuthority.AccessUrls.crl_access_urls] - # will be omitted. - class UserDefinedAccessUrls - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # @!attribute [rw] key - # @return [::String] - # @!attribute [rw] value - # @return [::String] - class LabelsEntry - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # The type of a - # {::Google::Cloud::Security::PrivateCA::V1::CertificateAuthority CertificateAuthority}, - # indicating its issuing chain. - module Type - # Not specified. - TYPE_UNSPECIFIED = 0 - - # Self-signed CA. - SELF_SIGNED = 1 - - # Subordinate CA. Could be issued by a Private CA - # {::Google::Cloud::Security::PrivateCA::V1::CertificateAuthority CertificateAuthority} - # or an unmanaged CA. - SUBORDINATE = 2 - end - - # The state of a - # {::Google::Cloud::Security::PrivateCA::V1::CertificateAuthority CertificateAuthority}, - # indicating if it can be used. - module State - # Not specified. - STATE_UNSPECIFIED = 0 - - # Certificates can be issued from this CA. CRLs will be generated for this - # CA. The CA will be part of the - # {::Google::Cloud::Security::PrivateCA::V1::CaPool CaPool}'s trust anchor, and - # will be used to issue certificates from the - # {::Google::Cloud::Security::PrivateCA::V1::CaPool CaPool}. - ENABLED = 1 - - # Certificates cannot be issued from this CA. CRLs will still be generated. - # The CA will be part of the - # {::Google::Cloud::Security::PrivateCA::V1::CaPool CaPool}'s trust anchor, but - # will not be used to issue certificates from the - # {::Google::Cloud::Security::PrivateCA::V1::CaPool CaPool}. - DISABLED = 2 - - # Certificates can be issued from this CA. CRLs will be generated for this - # CA. The CA will be part of the - # {::Google::Cloud::Security::PrivateCA::V1::CaPool CaPool}'s trust anchor, but - # will not be used to issue certificates from the - # {::Google::Cloud::Security::PrivateCA::V1::CaPool CaPool}. - STAGED = 3 - - # Certificates cannot be issued from this CA. CRLs will not be generated. - # The CA will not be part of the - # {::Google::Cloud::Security::PrivateCA::V1::CaPool CaPool}'s trust anchor, and - # will not be used to issue certificates from the - # {::Google::Cloud::Security::PrivateCA::V1::CaPool CaPool}. - AWAITING_USER_ACTIVATION = 4 - - # Certificates cannot be issued from this CA. CRLs will not be generated. - # The CA may still be recovered by calling - # {::Google::Cloud::Security::PrivateCA::V1::CertificateAuthorityService::Client#undelete_certificate_authority CertificateAuthorityService.UndeleteCertificateAuthority} - # before - # {::Google::Cloud::Security::PrivateCA::V1::CertificateAuthority#expire_time expire_time}. - # The CA will not be part of the - # {::Google::Cloud::Security::PrivateCA::V1::CaPool CaPool}'s trust anchor, and - # will not be used to issue certificates from the - # {::Google::Cloud::Security::PrivateCA::V1::CaPool CaPool}. - DELETED = 5 - end - - # The algorithm of a Cloud KMS CryptoKeyVersion of a - # [CryptoKey][google.cloud.kms.v1.CryptoKey] with the - # [CryptoKeyPurpose][google.cloud.kms.v1.CryptoKey.CryptoKeyPurpose] value - # `ASYMMETRIC_SIGN`. These values correspond to the - # [CryptoKeyVersionAlgorithm][google.cloud.kms.v1.CryptoKeyVersion.CryptoKeyVersionAlgorithm] - # values. For RSA signing algorithms, the PSS algorithms should be preferred, - # use PKCS1 algorithms if required for compatibility. For further - # recommendations, see - # https://cloud.google.com/kms/docs/algorithms#algorithm_recommendations. - module SignHashAlgorithm - # Not specified. - SIGN_HASH_ALGORITHM_UNSPECIFIED = 0 - - # maps to CryptoKeyVersionAlgorithm.RSA_SIGN_PSS_2048_SHA256 - RSA_PSS_2048_SHA256 = 1 - - # maps to CryptoKeyVersionAlgorithm. RSA_SIGN_PSS_3072_SHA256 - RSA_PSS_3072_SHA256 = 2 - - # maps to CryptoKeyVersionAlgorithm.RSA_SIGN_PSS_4096_SHA256 - RSA_PSS_4096_SHA256 = 3 - - # maps to CryptoKeyVersionAlgorithm.RSA_SIGN_PKCS1_2048_SHA256 - RSA_PKCS1_2048_SHA256 = 6 - - # maps to CryptoKeyVersionAlgorithm.RSA_SIGN_PKCS1_3072_SHA256 - RSA_PKCS1_3072_SHA256 = 7 - - # maps to CryptoKeyVersionAlgorithm.RSA_SIGN_PKCS1_4096_SHA256 - RSA_PKCS1_4096_SHA256 = 8 - - # maps to CryptoKeyVersionAlgorithm.EC_SIGN_P256_SHA256 - EC_P256_SHA256 = 4 - - # maps to CryptoKeyVersionAlgorithm.EC_SIGN_P384_SHA384 - EC_P384_SHA384 = 5 - end - end - - # A {::Google::Cloud::Security::PrivateCA::V1::CaPool CaPool} represents a group of - # {::Google::Cloud::Security::PrivateCA::V1::CertificateAuthority CertificateAuthorities} - # that form a trust anchor. A - # {::Google::Cloud::Security::PrivateCA::V1::CaPool CaPool} can be used to manage - # issuance policies for one or more - # {::Google::Cloud::Security::PrivateCA::V1::CertificateAuthority CertificateAuthority} - # resources and to rotate CA certificates in and out of the trust anchor. - # @!attribute [rw] name - # @return [::String] - # Identifier. The resource name for this - # {::Google::Cloud::Security::PrivateCA::V1::CaPool CaPool} in the format - # `projects/*/locations/*/caPools/*`. - # @!attribute [rw] tier - # @return [::Google::Cloud::Security::PrivateCA::V1::CaPool::Tier] - # Required. Immutable. The - # {::Google::Cloud::Security::PrivateCA::V1::CaPool::Tier Tier} of this - # {::Google::Cloud::Security::PrivateCA::V1::CaPool CaPool}. - # @!attribute [rw] issuance_policy - # @return [::Google::Cloud::Security::PrivateCA::V1::CaPool::IssuancePolicy] - # Optional. The - # {::Google::Cloud::Security::PrivateCA::V1::CaPool::IssuancePolicy IssuancePolicy} - # to control how - # {::Google::Cloud::Security::PrivateCA::V1::Certificate Certificates} will be - # issued from this {::Google::Cloud::Security::PrivateCA::V1::CaPool CaPool}. - # @!attribute [rw] publishing_options - # @return [::Google::Cloud::Security::PrivateCA::V1::CaPool::PublishingOptions] - # Optional. The - # {::Google::Cloud::Security::PrivateCA::V1::CaPool::PublishingOptions PublishingOptions} - # to follow when issuing - # {::Google::Cloud::Security::PrivateCA::V1::Certificate Certificates} from any - # {::Google::Cloud::Security::PrivateCA::V1::CertificateAuthority CertificateAuthority} - # in this {::Google::Cloud::Security::PrivateCA::V1::CaPool CaPool}. - # @!attribute [rw] labels - # @return [::Google::Protobuf::Map{::String => ::String}] - # Optional. Labels with user-defined metadata. - class CaPool - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - - # Options relating to the publication of each - # {::Google::Cloud::Security::PrivateCA::V1::CertificateAuthority CertificateAuthority}'s - # CA certificate and CRLs and their inclusion as extensions in issued - # {::Google::Cloud::Security::PrivateCA::V1::Certificate Certificates}. The options - # set here apply to certificates issued by any - # {::Google::Cloud::Security::PrivateCA::V1::CertificateAuthority CertificateAuthority} - # in the {::Google::Cloud::Security::PrivateCA::V1::CaPool CaPool}. - # @!attribute [rw] publish_ca_cert - # @return [::Boolean] - # Optional. When true, publishes each - # {::Google::Cloud::Security::PrivateCA::V1::CertificateAuthority CertificateAuthority}'s - # CA certificate and includes its URL in the "Authority Information Access" - # X.509 extension in all issued - # {::Google::Cloud::Security::PrivateCA::V1::Certificate Certificates}. If this - # is false, the CA certificate will not be published and the corresponding - # X.509 extension will not be written in issued certificates. - # @!attribute [rw] publish_crl - # @return [::Boolean] - # Optional. When true, publishes each - # {::Google::Cloud::Security::PrivateCA::V1::CertificateAuthority CertificateAuthority}'s - # CRL and includes its URL in the "CRL Distribution Points" X.509 extension - # in all issued - # {::Google::Cloud::Security::PrivateCA::V1::Certificate Certificates}. If this - # is false, CRLs will not be published and the corresponding X.509 - # extension will not be written in issued certificates. CRLs will expire 7 - # days from their creation. However, we will rebuild daily. CRLs are also - # rebuilt shortly after a certificate is revoked. - # @!attribute [rw] encoding_format - # @return [::Google::Cloud::Security::PrivateCA::V1::CaPool::PublishingOptions::EncodingFormat] - # Optional. Specifies the encoding format of each - # {::Google::Cloud::Security::PrivateCA::V1::CertificateAuthority CertificateAuthority} - # resource's CA certificate and CRLs. If this is omitted, CA certificates - # and CRLs will be published in PEM. - class PublishingOptions - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - - # Supported encoding formats for publishing. - module EncodingFormat - # Not specified. By default, PEM format will be used. - ENCODING_FORMAT_UNSPECIFIED = 0 - - # The - # {::Google::Cloud::Security::PrivateCA::V1::CertificateAuthority CertificateAuthority}'s - # CA certificate and CRLs will be published in PEM format. - PEM = 1 - - # The - # {::Google::Cloud::Security::PrivateCA::V1::CertificateAuthority CertificateAuthority}'s - # CA certificate and CRLs will be published in DER format. - DER = 2 - end - end - - # Defines controls over all certificate issuance within a - # {::Google::Cloud::Security::PrivateCA::V1::CaPool CaPool}. - # @!attribute [rw] allowed_key_types - # @return [::Array<::Google::Cloud::Security::PrivateCA::V1::CaPool::IssuancePolicy::AllowedKeyType>] - # Optional. If any - # {::Google::Cloud::Security::PrivateCA::V1::CaPool::IssuancePolicy::AllowedKeyType AllowedKeyType} - # is specified, then the certificate request's public key must match one of - # the key types listed here. Otherwise, any key may be used. - # @!attribute [rw] backdate_duration - # @return [::Google::Protobuf::Duration] - # Optional. The duration to backdate all certificates issued from this - # {::Google::Cloud::Security::PrivateCA::V1::CaPool CaPool}. If not set, the - # certificates will be issued with a not_before_time of the issuance time - # (i.e. the current time). If set, the certificates will be issued with a - # not_before_time of the issuance time minus the backdate_duration. The - # not_after_time will be adjusted to preserve the requested lifetime. The - # backdate_duration must be less than or equal to 48 hours. - # @!attribute [rw] maximum_lifetime - # @return [::Google::Protobuf::Duration] - # Optional. The maximum lifetime allowed for issued - # {::Google::Cloud::Security::PrivateCA::V1::Certificate Certificates}. Note that - # if the issuing - # {::Google::Cloud::Security::PrivateCA::V1::CertificateAuthority CertificateAuthority} - # expires before a - # {::Google::Cloud::Security::PrivateCA::V1::Certificate Certificate} resource's - # requested maximum_lifetime, the effective lifetime will be explicitly - # truncated to match it. - # @!attribute [rw] allowed_issuance_modes - # @return [::Google::Cloud::Security::PrivateCA::V1::CaPool::IssuancePolicy::IssuanceModes] - # Optional. If specified, then only methods allowed in the - # {::Google::Cloud::Security::PrivateCA::V1::CaPool::IssuancePolicy::IssuanceModes IssuanceModes} - # may be used to issue - # {::Google::Cloud::Security::PrivateCA::V1::Certificate Certificates}. - # @!attribute [rw] baseline_values - # @return [::Google::Cloud::Security::PrivateCA::V1::X509Parameters] - # Optional. A set of X.509 values that will be applied to all certificates - # issued through this {::Google::Cloud::Security::PrivateCA::V1::CaPool CaPool}. - # If a certificate request includes conflicting values for the same - # properties, they will be overwritten by the values defined here. If a - # certificate request uses a - # {::Google::Cloud::Security::PrivateCA::V1::CertificateTemplate CertificateTemplate} - # that defines conflicting - # {::Google::Cloud::Security::PrivateCA::V1::CertificateTemplate#predefined_values predefined_values} - # for the same properties, the certificate issuance request will fail. - # @!attribute [rw] identity_constraints - # @return [::Google::Cloud::Security::PrivateCA::V1::CertificateIdentityConstraints] - # Optional. Describes constraints on identities that may appear in - # {::Google::Cloud::Security::PrivateCA::V1::Certificate Certificates} issued - # through this {::Google::Cloud::Security::PrivateCA::V1::CaPool CaPool}. If this - # is omitted, then this {::Google::Cloud::Security::PrivateCA::V1::CaPool CaPool} - # will not add restrictions on a certificate's identity. - # @!attribute [rw] passthrough_extensions - # @return [::Google::Cloud::Security::PrivateCA::V1::CertificateExtensionConstraints] - # Optional. Describes the set of X.509 extensions that may appear in a - # {::Google::Cloud::Security::PrivateCA::V1::Certificate Certificate} issued - # through this {::Google::Cloud::Security::PrivateCA::V1::CaPool CaPool}. If a - # certificate request sets extensions that don't appear in the - # {::Google::Cloud::Security::PrivateCA::V1::CaPool::IssuancePolicy#passthrough_extensions passthrough_extensions}, - # those extensions will be dropped. If a certificate request uses a - # {::Google::Cloud::Security::PrivateCA::V1::CertificateTemplate CertificateTemplate} - # with - # {::Google::Cloud::Security::PrivateCA::V1::CertificateTemplate#predefined_values predefined_values} - # that don't appear here, the certificate issuance request will fail. If - # this is omitted, then this - # {::Google::Cloud::Security::PrivateCA::V1::CaPool CaPool} will not add - # restrictions on a certificate's X.509 extensions. These constraints do - # not apply to X.509 extensions set in this - # {::Google::Cloud::Security::PrivateCA::V1::CaPool CaPool}'s - # {::Google::Cloud::Security::PrivateCA::V1::CaPool::IssuancePolicy#baseline_values baseline_values}. - class IssuancePolicy - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - - # Describes a "type" of key that may be used in a - # {::Google::Cloud::Security::PrivateCA::V1::Certificate Certificate} issued from - # a {::Google::Cloud::Security::PrivateCA::V1::CaPool CaPool}. Note that a single - # {::Google::Cloud::Security::PrivateCA::V1::CaPool::IssuancePolicy::AllowedKeyType AllowedKeyType} - # may refer to either a fully-qualified key algorithm, such as RSA 4096, or - # a family of key algorithms, such as any RSA key. - # @!attribute [rw] rsa - # @return [::Google::Cloud::Security::PrivateCA::V1::CaPool::IssuancePolicy::AllowedKeyType::RsaKeyType] - # Represents an allowed RSA key type. - # - # Note: The following fields are mutually exclusive: `rsa`, `elliptic_curve`. If a field in that set is populated, all other fields in the set will automatically be cleared. - # @!attribute [rw] elliptic_curve - # @return [::Google::Cloud::Security::PrivateCA::V1::CaPool::IssuancePolicy::AllowedKeyType::EcKeyType] - # Represents an allowed Elliptic Curve key type. - # - # Note: The following fields are mutually exclusive: `elliptic_curve`, `rsa`. If a field in that set is populated, all other fields in the set will automatically be cleared. - class AllowedKeyType - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - - # Describes an RSA key that may be used in a - # {::Google::Cloud::Security::PrivateCA::V1::Certificate Certificate} issued - # from a {::Google::Cloud::Security::PrivateCA::V1::CaPool CaPool}. - # @!attribute [rw] min_modulus_size - # @return [::Integer] - # Optional. The minimum allowed RSA modulus size (inclusive), in bits. - # If this is not set, or if set to zero, the service-level min RSA - # modulus size will continue to apply. - # @!attribute [rw] max_modulus_size - # @return [::Integer] - # Optional. The maximum allowed RSA modulus size (inclusive), in bits. - # If this is not set, or if set to zero, the service will not enforce - # an explicit upper bound on RSA modulus sizes. - class RsaKeyType - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Describes an Elliptic Curve key that may be used in a - # {::Google::Cloud::Security::PrivateCA::V1::Certificate Certificate} issued - # from a {::Google::Cloud::Security::PrivateCA::V1::CaPool CaPool}. - # @!attribute [rw] signature_algorithm - # @return [::Google::Cloud::Security::PrivateCA::V1::CaPool::IssuancePolicy::AllowedKeyType::EcKeyType::EcSignatureAlgorithm] - # Optional. A signature algorithm that must be used. If this is - # omitted, any EC-based signature algorithm will be allowed. - class EcKeyType - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - - # Describes an elliptic curve-based signature algorithm that may be - # used in a - # {::Google::Cloud::Security::PrivateCA::V1::Certificate Certificate} issued - # from a {::Google::Cloud::Security::PrivateCA::V1::CaPool CaPool}. - module EcSignatureAlgorithm - # Not specified. Signifies that any signature algorithm may be used. - EC_SIGNATURE_ALGORITHM_UNSPECIFIED = 0 - - # Refers to the Elliptic Curve Digital Signature Algorithm over the - # NIST P-256 curve. - ECDSA_P256 = 1 - - # Refers to the Elliptic Curve Digital Signature Algorithm over the - # NIST P-384 curve. - ECDSA_P384 = 2 - - # Refers to the Edwards-curve Digital Signature Algorithm over curve - # 25519, as described in RFC 8410. - EDDSA_25519 = 3 - end - end - end - - # {::Google::Cloud::Security::PrivateCA::V1::CaPool::IssuancePolicy::IssuanceModes IssuanceModes} - # specifies the allowed ways in which - # {::Google::Cloud::Security::PrivateCA::V1::Certificate Certificates} may be - # requested from this {::Google::Cloud::Security::PrivateCA::V1::CaPool CaPool}. - # @!attribute [rw] allow_csr_based_issuance - # @return [::Boolean] - # Optional. When true, allows callers to create - # {::Google::Cloud::Security::PrivateCA::V1::Certificate Certificates} by - # specifying a CSR. - # @!attribute [rw] allow_config_based_issuance - # @return [::Boolean] - # Optional. When true, allows callers to create - # {::Google::Cloud::Security::PrivateCA::V1::Certificate Certificates} by - # specifying a - # {::Google::Cloud::Security::PrivateCA::V1::CertificateConfig CertificateConfig}. - class IssuanceModes - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - end - - # @!attribute [rw] key - # @return [::String] - # @!attribute [rw] value - # @return [::String] - class LabelsEntry - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # The tier of a {::Google::Cloud::Security::PrivateCA::V1::CaPool CaPool}, - # indicating its supported functionality and/or billing SKU. - module Tier - # Not specified. - TIER_UNSPECIFIED = 0 - - # Enterprise tier. - ENTERPRISE = 1 - - # DevOps tier. - DEVOPS = 2 - end - end - - # A - # {::Google::Cloud::Security::PrivateCA::V1::CertificateRevocationList CertificateRevocationList} - # corresponds to a signed X.509 certificate Revocation List (CRL). A CRL - # contains the serial numbers of certificates that should no longer be trusted. - # @!attribute [rw] name - # @return [::String] - # Identifier. The resource name for this - # {::Google::Cloud::Security::PrivateCA::V1::CertificateRevocationList CertificateRevocationList} - # in the format `projects/*/locations/*/caPools/*certificateAuthorities/*/ - # certificateRevocationLists/*`. - # @!attribute [r] sequence_number - # @return [::Integer] - # Output only. The CRL sequence number that appears in pem_crl. - # @!attribute [r] revoked_certificates - # @return [::Array<::Google::Cloud::Security::PrivateCA::V1::CertificateRevocationList::RevokedCertificate>] - # Output only. The revoked serial numbers that appear in pem_crl. - # @!attribute [r] pem_crl - # @return [::String] - # Output only. The PEM-encoded X.509 CRL. - # @!attribute [r] access_url - # @return [::String] - # Output only. The location where 'pem_crl' can be accessed. - # @!attribute [r] state - # @return [::Google::Cloud::Security::PrivateCA::V1::CertificateRevocationList::State] - # Output only. The - # {::Google::Cloud::Security::PrivateCA::V1::CertificateRevocationList::State State} - # for this - # {::Google::Cloud::Security::PrivateCA::V1::CertificateRevocationList CertificateRevocationList}. - # @!attribute [r] create_time - # @return [::Google::Protobuf::Timestamp] - # Output only. The time at which this - # {::Google::Cloud::Security::PrivateCA::V1::CertificateRevocationList CertificateRevocationList} - # was created. - # @!attribute [r] update_time - # @return [::Google::Protobuf::Timestamp] - # Output only. The time at which this - # {::Google::Cloud::Security::PrivateCA::V1::CertificateRevocationList CertificateRevocationList} - # was updated. - # @!attribute [r] revision_id - # @return [::String] - # Output only. The revision ID of this - # {::Google::Cloud::Security::PrivateCA::V1::CertificateRevocationList CertificateRevocationList}. - # A new revision is committed whenever a new CRL is published. The format is - # an 8-character hexadecimal string. - # @!attribute [rw] labels - # @return [::Google::Protobuf::Map{::String => ::String}] - # Optional. Labels with user-defined metadata. - class CertificateRevocationList - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - - # Describes a revoked - # {::Google::Cloud::Security::PrivateCA::V1::Certificate Certificate}. - # @!attribute [rw] certificate - # @return [::String] - # The resource name for the - # {::Google::Cloud::Security::PrivateCA::V1::Certificate Certificate} in the - # format `projects/*/locations/*/caPools/*/certificates/*`. - # @!attribute [rw] hex_serial_number - # @return [::String] - # The serial number of the - # {::Google::Cloud::Security::PrivateCA::V1::Certificate Certificate}. - # @!attribute [rw] revocation_reason - # @return [::Google::Cloud::Security::PrivateCA::V1::RevocationReason] - # The reason the - # {::Google::Cloud::Security::PrivateCA::V1::Certificate Certificate} was - # revoked. - class RevokedCertificate - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # @!attribute [rw] key - # @return [::String] - # @!attribute [rw] value - # @return [::String] - class LabelsEntry - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # The state of a - # {::Google::Cloud::Security::PrivateCA::V1::CertificateRevocationList CertificateRevocationList}, - # indicating if it is current. - module State - # Not specified. - STATE_UNSPECIFIED = 0 - - # The - # {::Google::Cloud::Security::PrivateCA::V1::CertificateRevocationList CertificateRevocationList} - # is up to date. - ACTIVE = 1 - - # The - # {::Google::Cloud::Security::PrivateCA::V1::CertificateRevocationList CertificateRevocationList} - # is no longer current. - SUPERSEDED = 2 - end - end - - # A {::Google::Cloud::Security::PrivateCA::V1::Certificate Certificate} corresponds - # to a signed X.509 certificate issued by a - # {::Google::Cloud::Security::PrivateCA::V1::CertificateAuthority CertificateAuthority}. - # @!attribute [rw] name - # @return [::String] - # Identifier. The resource name for this - # {::Google::Cloud::Security::PrivateCA::V1::Certificate Certificate} in the format - # `projects/*/locations/*/caPools/*/certificates/*`. - # @!attribute [rw] pem_csr - # @return [::String] - # Immutable. A pem-encoded X.509 certificate signing request (CSR). - # - # Note: The following fields are mutually exclusive: `pem_csr`, `config`. If a field in that set is populated, all other fields in the set will automatically be cleared. - # @!attribute [rw] config - # @return [::Google::Cloud::Security::PrivateCA::V1::CertificateConfig] - # Immutable. A description of the certificate and key that does not require - # X.509 or ASN.1. - # - # Note: The following fields are mutually exclusive: `config`, `pem_csr`. If a field in that set is populated, all other fields in the set will automatically be cleared. - # @!attribute [r] issuer_certificate_authority - # @return [::String] - # Output only. The resource name of the issuing - # {::Google::Cloud::Security::PrivateCA::V1::CertificateAuthority CertificateAuthority} - # in the format `projects/*/locations/*/caPools/*/certificateAuthorities/*`. - # @!attribute [rw] lifetime - # @return [::Google::Protobuf::Duration] - # Required. Immutable. The desired lifetime of a certificate. Used to create - # the "not_before_time" and "not_after_time" fields inside an X.509 - # certificate. Note that the lifetime may be truncated if it would extend - # past the life of any certificate authority in the issuing chain. - # @!attribute [rw] certificate_template - # @return [::String] - # Immutable. The resource name for a - # {::Google::Cloud::Security::PrivateCA::V1::CertificateTemplate CertificateTemplate} - # used to issue this certificate, in the format - # `projects/*/locations/*/certificateTemplates/*`. - # If this is specified, the caller must have the necessary permission to - # use this template. If this is omitted, no template will be used. - # This template must be in the same location as the - # {::Google::Cloud::Security::PrivateCA::V1::Certificate Certificate}. - # @!attribute [rw] subject_mode - # @return [::Google::Cloud::Security::PrivateCA::V1::SubjectRequestMode] - # Immutable. Specifies how the - # {::Google::Cloud::Security::PrivateCA::V1::Certificate Certificate}'s identity - # fields are to be decided. If this is omitted, the `DEFAULT` subject mode - # will be used. - # @!attribute [r] revocation_details - # @return [::Google::Cloud::Security::PrivateCA::V1::Certificate::RevocationDetails] - # Output only. Details regarding the revocation of this - # {::Google::Cloud::Security::PrivateCA::V1::Certificate Certificate}. This - # {::Google::Cloud::Security::PrivateCA::V1::Certificate Certificate} is considered - # revoked if and only if this field is present. - # @!attribute [r] pem_certificate - # @return [::String] - # Output only. The pem-encoded, signed X.509 certificate. - # @!attribute [r] certificate_description - # @return [::Google::Cloud::Security::PrivateCA::V1::CertificateDescription] - # Output only. A structured description of the issued X.509 certificate. - # @!attribute [r] pem_certificate_chain - # @return [::Array<::String>] - # Output only. The chain that may be used to verify the X.509 certificate. - # Expected to be in issuer-to-root order according to RFC 5246. - # @!attribute [r] create_time - # @return [::Google::Protobuf::Timestamp] - # Output only. The time at which this - # {::Google::Cloud::Security::PrivateCA::V1::Certificate Certificate} was created. - # @!attribute [r] update_time - # @return [::Google::Protobuf::Timestamp] - # Output only. The time at which this - # {::Google::Cloud::Security::PrivateCA::V1::Certificate Certificate} was updated. - # @!attribute [rw] labels - # @return [::Google::Protobuf::Map{::String => ::String}] - # Optional. Labels with user-defined metadata. - class Certificate - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - - # Describes fields that are relavent to the revocation of a - # {::Google::Cloud::Security::PrivateCA::V1::Certificate Certificate}. - # @!attribute [rw] revocation_state - # @return [::Google::Cloud::Security::PrivateCA::V1::RevocationReason] - # Indicates why a - # {::Google::Cloud::Security::PrivateCA::V1::Certificate Certificate} was - # revoked. - # @!attribute [rw] revocation_time - # @return [::Google::Protobuf::Timestamp] - # The time at which this - # {::Google::Cloud::Security::PrivateCA::V1::Certificate Certificate} was - # revoked. - class RevocationDetails - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # @!attribute [rw] key - # @return [::String] - # @!attribute [rw] value - # @return [::String] - class LabelsEntry - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - end - - # A - # {::Google::Cloud::Security::PrivateCA::V1::CertificateTemplate CertificateTemplate} - # refers to a managed template for certificate issuance. - # @!attribute [rw] name - # @return [::String] - # Identifier. The resource name for this - # {::Google::Cloud::Security::PrivateCA::V1::CertificateTemplate CertificateTemplate} - # in the format `projects/*/locations/*/certificateTemplates/*`. - # @!attribute [rw] maximum_lifetime - # @return [::Google::Protobuf::Duration] - # Optional. The maximum lifetime allowed for issued - # {::Google::Cloud::Security::PrivateCA::V1::Certificate Certificates} that use - # this template. If the issuing - # {::Google::Cloud::Security::PrivateCA::V1::CaPool CaPool} resource's - # {::Google::Cloud::Security::PrivateCA::V1::CaPool::IssuancePolicy IssuancePolicy} - # specifies a - # {::Google::Cloud::Security::PrivateCA::V1::CaPool::IssuancePolicy#maximum_lifetime maximum_lifetime} - # the minimum of the two durations will be the maximum lifetime for issued - # {::Google::Cloud::Security::PrivateCA::V1::Certificate Certificates}. Note that - # if the issuing - # {::Google::Cloud::Security::PrivateCA::V1::CertificateAuthority CertificateAuthority} - # expires before a - # {::Google::Cloud::Security::PrivateCA::V1::Certificate Certificate}'s requested - # maximum_lifetime, the effective lifetime will be explicitly truncated - # to match it. - # @!attribute [rw] predefined_values - # @return [::Google::Cloud::Security::PrivateCA::V1::X509Parameters] - # Optional. A set of X.509 values that will be applied to all issued - # certificates that use this template. If the certificate request includes - # conflicting values for the same properties, they will be overwritten by the - # values defined here. If the issuing - # {::Google::Cloud::Security::PrivateCA::V1::CaPool CaPool}'s - # {::Google::Cloud::Security::PrivateCA::V1::CaPool::IssuancePolicy IssuancePolicy} - # defines conflicting - # {::Google::Cloud::Security::PrivateCA::V1::CaPool::IssuancePolicy#baseline_values baseline_values} - # for the same properties, the certificate issuance request will fail. - # @!attribute [rw] identity_constraints - # @return [::Google::Cloud::Security::PrivateCA::V1::CertificateIdentityConstraints] - # Optional. Describes constraints on identities that may be appear in - # {::Google::Cloud::Security::PrivateCA::V1::Certificate Certificates} issued using - # this template. If this is omitted, then this template will not add - # restrictions on a certificate's identity. - # @!attribute [rw] passthrough_extensions - # @return [::Google::Cloud::Security::PrivateCA::V1::CertificateExtensionConstraints] - # Optional. Describes the set of X.509 extensions that may appear in a - # {::Google::Cloud::Security::PrivateCA::V1::Certificate Certificate} issued using - # this - # {::Google::Cloud::Security::PrivateCA::V1::CertificateTemplate CertificateTemplate}. - # If a certificate request sets extensions that don't appear in the - # {::Google::Cloud::Security::PrivateCA::V1::CertificateTemplate#passthrough_extensions passthrough_extensions}, - # those extensions will be dropped. If the issuing - # {::Google::Cloud::Security::PrivateCA::V1::CaPool CaPool}'s - # {::Google::Cloud::Security::PrivateCA::V1::CaPool::IssuancePolicy IssuancePolicy} - # defines - # {::Google::Cloud::Security::PrivateCA::V1::CaPool::IssuancePolicy#baseline_values baseline_values} - # that don't appear here, the certificate issuance request will fail. If this - # is omitted, then this template will not add restrictions on a certificate's - # X.509 extensions. These constraints do not apply to X.509 extensions set in - # this - # {::Google::Cloud::Security::PrivateCA::V1::CertificateTemplate CertificateTemplate}'s - # {::Google::Cloud::Security::PrivateCA::V1::CertificateTemplate#predefined_values predefined_values}. - # @!attribute [rw] description - # @return [::String] - # Optional. A human-readable description of scenarios this template is - # intended for. - # @!attribute [r] create_time - # @return [::Google::Protobuf::Timestamp] - # Output only. The time at which this - # {::Google::Cloud::Security::PrivateCA::V1::CertificateTemplate CertificateTemplate} - # was created. - # @!attribute [r] update_time - # @return [::Google::Protobuf::Timestamp] - # Output only. The time at which this - # {::Google::Cloud::Security::PrivateCA::V1::CertificateTemplate CertificateTemplate} - # was updated. - # @!attribute [rw] labels - # @return [::Google::Protobuf::Map{::String => ::String}] - # Optional. Labels with user-defined metadata. - class CertificateTemplate - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - - # @!attribute [rw] key - # @return [::String] - # @!attribute [rw] value - # @return [::String] - class LabelsEntry - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - end - - # An {::Google::Cloud::Security::PrivateCA::V1::X509Parameters X509Parameters} is - # used to describe certain fields of an X.509 certificate, such as the key - # usage fields, fields specific to CA certificates, certificate policy - # extensions and custom extensions. - # @!attribute [rw] key_usage - # @return [::Google::Cloud::Security::PrivateCA::V1::KeyUsage] - # Optional. Indicates the intended use for keys that correspond to a - # certificate. - # @!attribute [rw] ca_options - # @return [::Google::Cloud::Security::PrivateCA::V1::X509Parameters::CaOptions] - # Optional. Describes options in this - # {::Google::Cloud::Security::PrivateCA::V1::X509Parameters X509Parameters} that - # are relevant in a CA certificate. If not specified, a default basic - # constraints extension with `is_ca=false` will be added for leaf - # certificates. - # @!attribute [rw] policy_ids - # @return [::Array<::Google::Cloud::Security::PrivateCA::V1::ObjectId>] - # Optional. Describes the X.509 certificate policy object identifiers, per - # https://tools.ietf.org/html/rfc5280#section-4.2.1.4. - # @!attribute [rw] aia_ocsp_servers - # @return [::Array<::String>] - # Optional. Describes Online Certificate Status Protocol (OCSP) endpoint - # addresses that appear in the "Authority Information Access" extension in - # the certificate. - # @!attribute [rw] name_constraints - # @return [::Google::Cloud::Security::PrivateCA::V1::X509Parameters::NameConstraints] - # Optional. Describes the X.509 name constraints extension. - # @!attribute [rw] additional_extensions - # @return [::Array<::Google::Cloud::Security::PrivateCA::V1::X509Extension>] - # Optional. Describes custom X.509 extensions. - class X509Parameters - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - - # Describes the X.509 basic constraints extension, per [RFC 5280 - # section 4.2.1.9](https://tools.ietf.org/html/rfc5280#section-4.2.1.9) - # @!attribute [rw] is_ca - # @return [::Boolean] - # Optional. Refers to the "CA" boolean field in the X.509 extension. - # When this value is missing, the basic constraints extension will be - # omitted from the certificate. - # @!attribute [rw] max_issuer_path_length - # @return [::Integer] - # Optional. Refers to the path length constraint field in the X.509 - # extension. For a CA certificate, this value describes the depth of - # subordinate CA certificates that are allowed. If this value is less than - # 0, the request will fail. If this value is missing, the max path length - # will be omitted from the certificate. - class CaOptions - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Describes the X.509 name constraints extension, per - # https://tools.ietf.org/html/rfc5280#section-4.2.1.10 - # @!attribute [rw] critical - # @return [::Boolean] - # Indicates whether or not the name constraints are marked critical. - # @!attribute [rw] permitted_dns_names - # @return [::Array<::String>] - # Contains permitted DNS names. Any DNS name that can be - # constructed by simply adding zero or more labels to - # the left-hand side of the name satisfies the name constraint. - # For example, `example.com`, `www.example.com`, `www.sub.example.com` - # would satisfy `example.com` while `example1.com` does not. - # @!attribute [rw] excluded_dns_names - # @return [::Array<::String>] - # Contains excluded DNS names. Any DNS name that can be - # constructed by simply adding zero or more labels to - # the left-hand side of the name satisfies the name constraint. - # For example, `example.com`, `www.example.com`, `www.sub.example.com` - # would satisfy `example.com` while `example1.com` does not. - # @!attribute [rw] permitted_ip_ranges - # @return [::Array<::String>] - # Contains the permitted IP ranges. For IPv4 addresses, the ranges - # are expressed using CIDR notation as specified in RFC 4632. - # For IPv6 addresses, the ranges are expressed in similar encoding as IPv4 - # addresses. - # @!attribute [rw] excluded_ip_ranges - # @return [::Array<::String>] - # Contains the excluded IP ranges. For IPv4 addresses, the ranges - # are expressed using CIDR notation as specified in RFC 4632. - # For IPv6 addresses, the ranges are expressed in similar encoding as IPv4 - # addresses. - # @!attribute [rw] permitted_email_addresses - # @return [::Array<::String>] - # Contains the permitted email addresses. The value can be a particular - # email address, a hostname to indicate all email addresses on that host or - # a domain with a leading period (e.g. `.example.com`) to indicate - # all email addresses in that domain. - # @!attribute [rw] excluded_email_addresses - # @return [::Array<::String>] - # Contains the excluded email addresses. The value can be a particular - # email address, a hostname to indicate all email addresses on that host or - # a domain with a leading period (e.g. `.example.com`) to indicate - # all email addresses in that domain. - # @!attribute [rw] permitted_uris - # @return [::Array<::String>] - # Contains the permitted URIs that apply to the host part of the name. - # The value can be a hostname or a domain with a - # leading period (like `.example.com`) - # @!attribute [rw] excluded_uris - # @return [::Array<::String>] - # Contains the excluded URIs that apply to the host part of the name. - # The value can be a hostname or a domain with a - # leading period (like `.example.com`) - class NameConstraints - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - end - - # Describes a subordinate CA's issuers. This is either a resource name to a - # known issuing - # {::Google::Cloud::Security::PrivateCA::V1::CertificateAuthority CertificateAuthority}, - # or a PEM issuer certificate chain. - # @!attribute [rw] certificate_authority - # @return [::String] - # Required. This can refer to a - # {::Google::Cloud::Security::PrivateCA::V1::CertificateAuthority CertificateAuthority} - # that was used to create a subordinate - # {::Google::Cloud::Security::PrivateCA::V1::CertificateAuthority CertificateAuthority}. - # This field is used for information and usability purposes only. The - # resource name is in the format - # `projects/*/locations/*/caPools/*/certificateAuthorities/*`. - # - # Note: The following fields are mutually exclusive: `certificate_authority`, `pem_issuer_chain`. If a field in that set is populated, all other fields in the set will automatically be cleared. - # @!attribute [rw] pem_issuer_chain - # @return [::Google::Cloud::Security::PrivateCA::V1::SubordinateConfig::SubordinateConfigChain] - # Required. Contains the PEM certificate chain for the issuers of this - # {::Google::Cloud::Security::PrivateCA::V1::CertificateAuthority CertificateAuthority}, - # but not pem certificate for this CA itself. - # - # Note: The following fields are mutually exclusive: `pem_issuer_chain`, `certificate_authority`. If a field in that set is populated, all other fields in the set will automatically be cleared. - class SubordinateConfig - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - - # This message describes a subordinate CA's issuer certificate chain. This - # wrapper exists for compatibility reasons. - # @!attribute [rw] pem_certificates - # @return [::Array<::String>] - # Required. Expected to be in leaf-to-root order according to RFC 5246. - class SubordinateConfigChain - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - end - - # A {::Google::Cloud::Security::PrivateCA::V1::PublicKey PublicKey} describes a - # public key. - # @!attribute [rw] key - # @return [::String] - # Required. A public key. The padding and encoding - # must match with the `KeyFormat` value specified for the `format` field. - # @!attribute [rw] format - # @return [::Google::Cloud::Security::PrivateCA::V1::PublicKey::KeyFormat] - # Required. The format of the public key. - class PublicKey - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - - # Types of public keys formats that are supported. Currently, only `PEM` - # format is supported. - module KeyFormat - # Default unspecified value. - KEY_FORMAT_UNSPECIFIED = 0 - - # The key is PEM-encoded as defined in [RFC - # 7468](https://tools.ietf.org/html/rfc7468). It can be any of the - # following: a PEM-encoded PKCS#1/RFC 3447 RSAPublicKey - # structure, an RFC 5280 - # [SubjectPublicKeyInfo](https://tools.ietf.org/html/rfc5280#section-4.1) - # or a PEM-encoded X.509 certificate signing request (CSR). If a - # [SubjectPublicKeyInfo](https://tools.ietf.org/html/rfc5280#section-4.1) - # is specified, it can contain a A PEM-encoded PKCS#1/RFC 3447 RSAPublicKey - # or a NIST P-256/secp256r1/prime256v1 or P-384 key. If a CSR is specified, - # it will used solely for the purpose of extracting the public key. When - # generated by the service, it will always be an RFC 5280 - # [SubjectPublicKeyInfo](https://tools.ietf.org/html/rfc5280#section-4.1) - # structure containing an algorithm identifier and a key. - PEM = 1 - end - end - - # A {::Google::Cloud::Security::PrivateCA::V1::CertificateConfig CertificateConfig} - # describes an X.509 certificate or CSR that is to be created, as an - # alternative to using ASN.1. - # @!attribute [rw] subject_config - # @return [::Google::Cloud::Security::PrivateCA::V1::CertificateConfig::SubjectConfig] - # Required. Specifies some of the values in a certificate that are related to - # the subject. - # @!attribute [rw] x509_config - # @return [::Google::Cloud::Security::PrivateCA::V1::X509Parameters] - # Required. Describes how some of the technical X.509 fields in a certificate - # should be populated. - # @!attribute [rw] public_key - # @return [::Google::Cloud::Security::PrivateCA::V1::PublicKey] - # Optional. The public key that corresponds to this config. This is, for - # example, used when issuing - # {::Google::Cloud::Security::PrivateCA::V1::Certificate Certificates}, but not - # when creating a self-signed - # {::Google::Cloud::Security::PrivateCA::V1::CertificateAuthority CertificateAuthority} - # or - # {::Google::Cloud::Security::PrivateCA::V1::CertificateAuthority CertificateAuthority} - # CSR. - # @!attribute [rw] subject_key_id - # @return [::Google::Cloud::Security::PrivateCA::V1::CertificateConfig::KeyId] - # Optional. When specified this provides a custom SKI to be used in the - # certificate. This should only be used to maintain a SKI of an existing CA - # originally created outside CA service, which was not generated using method - # (1) described in RFC 5280 section 4.2.1.2. - class CertificateConfig - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - - # These values are used to create the distinguished name and subject - # alternative name fields in an X.509 certificate. - # @!attribute [rw] subject - # @return [::Google::Cloud::Security::PrivateCA::V1::Subject] - # Optional. Contains distinguished name fields such as the common name, - # location and organization. - # @!attribute [rw] subject_alt_name - # @return [::Google::Cloud::Security::PrivateCA::V1::SubjectAltNames] - # Optional. The subject alternative name fields. - class SubjectConfig - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # A KeyId identifies a specific public key, usually by hashing the public - # key. - # @!attribute [rw] key_id - # @return [::String] - # Required. The value of this KeyId encoded in lowercase hexadecimal. This - # is most likely the 160 bit SHA-1 hash of the public key. - class KeyId - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - end - - # A - # {::Google::Cloud::Security::PrivateCA::V1::CertificateDescription CertificateDescription} - # describes an X.509 certificate or CSR that has been issued, as an alternative - # to using ASN.1 / X.509. - # @!attribute [rw] subject_description - # @return [::Google::Cloud::Security::PrivateCA::V1::CertificateDescription::SubjectDescription] - # Describes some of the values in a certificate that are related to the - # subject and lifetime. - # @!attribute [rw] x509_description - # @return [::Google::Cloud::Security::PrivateCA::V1::X509Parameters] - # Describes some of the technical X.509 fields in a certificate. - # @!attribute [rw] public_key - # @return [::Google::Cloud::Security::PrivateCA::V1::PublicKey] - # The public key that corresponds to an issued certificate. - # @!attribute [rw] subject_key_id - # @return [::Google::Cloud::Security::PrivateCA::V1::CertificateDescription::KeyId] - # Provides a means of identifiying certificates that contain a particular - # public key, per https://tools.ietf.org/html/rfc5280#section-4.2.1.2. - # @!attribute [rw] authority_key_id - # @return [::Google::Cloud::Security::PrivateCA::V1::CertificateDescription::KeyId] - # Identifies the subject_key_id of the parent certificate, per - # https://tools.ietf.org/html/rfc5280#section-4.2.1.1 - # @!attribute [rw] crl_distribution_points - # @return [::Array<::String>] - # Describes a list of locations to obtain CRL information, i.e. - # the DistributionPoint.fullName described by - # https://tools.ietf.org/html/rfc5280#section-4.2.1.13 - # @!attribute [rw] aia_issuing_certificate_urls - # @return [::Array<::String>] - # Describes lists of issuer CA certificate URLs that appear in the - # "Authority Information Access" extension in the certificate. - # @!attribute [rw] cert_fingerprint - # @return [::Google::Cloud::Security::PrivateCA::V1::CertificateDescription::CertificateFingerprint] - # The hash of the x.509 certificate. - # @!attribute [rw] tbs_certificate_digest - # @return [::String] - # The hash of the pre-signed certificate, which will be signed by the CA. - # Corresponds to the TBS Certificate in - # https://tools.ietf.org/html/rfc5280#section-4.1.2. The field will always be - # populated. - class CertificateDescription - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - - # These values describe fields in an issued X.509 certificate such as the - # distinguished name, subject alternative names, serial number, and lifetime. - # @!attribute [rw] subject - # @return [::Google::Cloud::Security::PrivateCA::V1::Subject] - # Contains distinguished name fields such as the common name, location and - # / organization. - # @!attribute [rw] subject_alt_name - # @return [::Google::Cloud::Security::PrivateCA::V1::SubjectAltNames] - # The subject alternative name fields. - # @!attribute [rw] hex_serial_number - # @return [::String] - # The serial number encoded in lowercase hexadecimal. - # @!attribute [rw] lifetime - # @return [::Google::Protobuf::Duration] - # For convenience, the actual lifetime of an issued certificate. - # @!attribute [rw] not_before_time - # @return [::Google::Protobuf::Timestamp] - # The time at which the certificate becomes valid. - # @!attribute [rw] not_after_time - # @return [::Google::Protobuf::Timestamp] - # The time after which the certificate is expired. - # Per RFC 5280, the validity period for a certificate is the period of time - # from not_before_time through not_after_time, inclusive. - # Corresponds to 'not_before_time' + 'lifetime' - 1 second. - class SubjectDescription - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # A KeyId identifies a specific public key, usually by hashing the public - # key. - # @!attribute [rw] key_id - # @return [::String] - # Optional. The value of this KeyId encoded in lowercase hexadecimal. This - # is most likely the 160 bit SHA-1 hash of the public key. - class KeyId - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # A group of fingerprints for the x509 certificate. - # @!attribute [rw] sha256_hash - # @return [::String] - # The SHA 256 hash, encoded in hexadecimal, of the DER x509 certificate. - class CertificateFingerprint - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - end - - # An {::Google::Cloud::Security::PrivateCA::V1::ObjectId ObjectId} specifies an - # object identifier (OID). These provide context and describe types in ASN.1 - # messages. - # @!attribute [rw] object_id_path - # @return [::Array<::Integer>] - # Required. The parts of an OID path. The most significant parts of the path - # come first. - class ObjectId - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # An {::Google::Cloud::Security::PrivateCA::V1::X509Extension X509Extension} - # specifies an X.509 extension, which may be used in different parts of X.509 - # objects like certificates, CSRs, and CRLs. - # @!attribute [rw] object_id - # @return [::Google::Cloud::Security::PrivateCA::V1::ObjectId] - # Required. The OID for this X.509 extension. - # @!attribute [rw] critical - # @return [::Boolean] - # Optional. Indicates whether or not this extension is critical (i.e., if the - # client does not know how to handle this extension, the client should - # consider this to be an error). - # @!attribute [rw] value - # @return [::String] - # Required. The value of this X.509 extension. - class X509Extension - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # A {::Google::Cloud::Security::PrivateCA::V1::KeyUsage KeyUsage} describes key usage - # values that may appear in an X.509 certificate. - # @!attribute [rw] base_key_usage - # @return [::Google::Cloud::Security::PrivateCA::V1::KeyUsage::KeyUsageOptions] - # Describes high-level ways in which a key may be used. - # @!attribute [rw] extended_key_usage - # @return [::Google::Cloud::Security::PrivateCA::V1::KeyUsage::ExtendedKeyUsageOptions] - # Detailed scenarios in which a key may be used. - # @!attribute [rw] unknown_extended_key_usages - # @return [::Array<::Google::Cloud::Security::PrivateCA::V1::ObjectId>] - # Used to describe extended key usages that are not listed in the - # {::Google::Cloud::Security::PrivateCA::V1::KeyUsage::ExtendedKeyUsageOptions KeyUsage.ExtendedKeyUsageOptions} - # message. - class KeyUsage - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - - # {::Google::Cloud::Security::PrivateCA::V1::KeyUsage::KeyUsageOptions KeyUsage.KeyUsageOptions} - # corresponds to the key usage values described in - # https://tools.ietf.org/html/rfc5280#section-4.2.1.3. - # @!attribute [rw] digital_signature - # @return [::Boolean] - # The key may be used for digital signatures. - # @!attribute [rw] content_commitment - # @return [::Boolean] - # The key may be used for cryptographic commitments. Note that this may - # also be referred to as "non-repudiation". - # @!attribute [rw] key_encipherment - # @return [::Boolean] - # The key may be used to encipher other keys. - # @!attribute [rw] data_encipherment - # @return [::Boolean] - # The key may be used to encipher data. - # @!attribute [rw] key_agreement - # @return [::Boolean] - # The key may be used in a key agreement protocol. - # @!attribute [rw] cert_sign - # @return [::Boolean] - # The key may be used to sign certificates. - # @!attribute [rw] crl_sign - # @return [::Boolean] - # The key may be used sign certificate revocation lists. - # @!attribute [rw] encipher_only - # @return [::Boolean] - # The key may be used to encipher only. - # @!attribute [rw] decipher_only - # @return [::Boolean] - # The key may be used to decipher only. - class KeyUsageOptions - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # {::Google::Cloud::Security::PrivateCA::V1::KeyUsage::ExtendedKeyUsageOptions KeyUsage.ExtendedKeyUsageOptions} - # has fields that correspond to certain common OIDs that could be specified - # as an extended key usage value. - # @!attribute [rw] server_auth - # @return [::Boolean] - # Corresponds to OID 1.3.6.1.5.5.7.3.1. Officially described as "TLS WWW - # server authentication", though regularly used for non-WWW TLS. - # @!attribute [rw] client_auth - # @return [::Boolean] - # Corresponds to OID 1.3.6.1.5.5.7.3.2. Officially described as "TLS WWW - # client authentication", though regularly used for non-WWW TLS. - # @!attribute [rw] code_signing - # @return [::Boolean] - # Corresponds to OID 1.3.6.1.5.5.7.3.3. Officially described as "Signing of - # downloadable executable code client authentication". - # @!attribute [rw] email_protection - # @return [::Boolean] - # Corresponds to OID 1.3.6.1.5.5.7.3.4. Officially described as "Email - # protection". - # @!attribute [rw] time_stamping - # @return [::Boolean] - # Corresponds to OID 1.3.6.1.5.5.7.3.8. Officially described as "Binding - # the hash of an object to a time". - # @!attribute [rw] ocsp_signing - # @return [::Boolean] - # Corresponds to OID 1.3.6.1.5.5.7.3.9. Officially described as "Signing - # OCSP responses". - class ExtendedKeyUsageOptions - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - end - - # {::Google::Cloud::Security::PrivateCA::V1::AttributeTypeAndValue AttributeTypeAndValue} - # specifies an attribute type and value. It can use either a OID or enum value - # to specify the attribute type. - # @!attribute [rw] type - # @return [::Google::Cloud::Security::PrivateCA::V1::AttributeType] - # The attribute type of the attribute and value pair. - # - # Note: The following fields are mutually exclusive: `type`, `object_id`. If a field in that set is populated, all other fields in the set will automatically be cleared. - # @!attribute [rw] object_id - # @return [::Google::Cloud::Security::PrivateCA::V1::ObjectId] - # Object ID for an attribute type of an attribute and value pair. - # - # Note: The following fields are mutually exclusive: `object_id`, `type`. If a field in that set is populated, all other fields in the set will automatically be cleared. - # @!attribute [rw] value - # @return [::String] - # The value for the attribute type. - class AttributeTypeAndValue - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # {::Google::Cloud::Security::PrivateCA::V1::RelativeDistinguishedName RelativeDistinguishedName} - # specifies a relative distinguished name which will be used to build a - # distinguished name. - # @!attribute [rw] attributes - # @return [::Array<::Google::Cloud::Security::PrivateCA::V1::AttributeTypeAndValue>] - # Attributes describes the attribute value assertions in the RDN. - class RelativeDistinguishedName - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # {::Google::Cloud::Security::PrivateCA::V1::Subject Subject} describes parts of a - # distinguished name that, in turn, describes the subject of the certificate. - # @!attribute [rw] common_name - # @return [::String] - # The "common name" of the subject. - # @!attribute [rw] country_code - # @return [::String] - # The country code of the subject. - # @!attribute [rw] organization - # @return [::String] - # The organization of the subject. - # @!attribute [rw] organizational_unit - # @return [::String] - # The organizational_unit of the subject. - # @!attribute [rw] locality - # @return [::String] - # The locality or city of the subject. - # @!attribute [rw] province - # @return [::String] - # The province, territory, or regional state of the subject. - # @!attribute [rw] street_address - # @return [::String] - # The street address of the subject. - # @!attribute [rw] postal_code - # @return [::String] - # The postal code of the subject. - # @!attribute [rw] rdn_sequence - # @return [::Array<::Google::Cloud::Security::PrivateCA::V1::RelativeDistinguishedName>] - # This field can be used in place of the named subject fields. - class Subject - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # {::Google::Cloud::Security::PrivateCA::V1::SubjectAltNames SubjectAltNames} - # corresponds to a more modern way of listing what the asserted identity is in - # a certificate (i.e., compared to the "common name" in the distinguished - # name). - # @!attribute [rw] dns_names - # @return [::Array<::String>] - # Contains only valid, fully-qualified host names. - # @!attribute [rw] uris - # @return [::Array<::String>] - # Contains only valid RFC 3986 URIs. - # @!attribute [rw] email_addresses - # @return [::Array<::String>] - # Contains only valid RFC 2822 E-mail addresses. - # @!attribute [rw] ip_addresses - # @return [::Array<::String>] - # Contains only valid 32-bit IPv4 addresses or RFC 4291 IPv6 addresses. - # @!attribute [rw] custom_sans - # @return [::Array<::Google::Cloud::Security::PrivateCA::V1::X509Extension>] - # Contains additional subject alternative name values. - # For each custom_san, the `value` field must contain an ASN.1 encoded - # UTF8String. - class SubjectAltNames - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Describes constraints on a - # {::Google::Cloud::Security::PrivateCA::V1::Certificate Certificate}'s - # {::Google::Cloud::Security::PrivateCA::V1::Subject Subject} and - # {::Google::Cloud::Security::PrivateCA::V1::SubjectAltNames SubjectAltNames}. - # @!attribute [rw] cel_expression - # @return [::Google::Type::Expr] - # Optional. A CEL expression that may be used to validate the resolved X.509 - # Subject and/or Subject Alternative Name before a certificate is signed. To - # see the full allowed syntax and some examples, see - # https://cloud.google.com/certificate-authority-service/docs/using-cel - # @!attribute [rw] allow_subject_passthrough - # @return [::Boolean] - # Required. If this is true, the - # {::Google::Cloud::Security::PrivateCA::V1::Subject Subject} field may be copied - # from a certificate request into the signed certificate. Otherwise, the - # requested {::Google::Cloud::Security::PrivateCA::V1::Subject Subject} will be - # discarded. - # @!attribute [rw] allow_subject_alt_names_passthrough - # @return [::Boolean] - # Required. If this is true, the - # {::Google::Cloud::Security::PrivateCA::V1::SubjectAltNames SubjectAltNames} - # extension may be copied from a certificate request into the signed - # certificate. Otherwise, the requested - # {::Google::Cloud::Security::PrivateCA::V1::SubjectAltNames SubjectAltNames} will - # be discarded. - class CertificateIdentityConstraints - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Describes a set of X.509 extensions that may be part of some certificate - # issuance controls. - # @!attribute [rw] known_extensions - # @return [::Array<::Google::Cloud::Security::PrivateCA::V1::CertificateExtensionConstraints::KnownCertificateExtension>] - # Optional. A set of named X.509 extensions. Will be combined with - # {::Google::Cloud::Security::PrivateCA::V1::CertificateExtensionConstraints#additional_extensions additional_extensions} - # to determine the full set of X.509 extensions. - # @!attribute [rw] additional_extensions - # @return [::Array<::Google::Cloud::Security::PrivateCA::V1::ObjectId>] - # Optional. A set of {::Google::Cloud::Security::PrivateCA::V1::ObjectId ObjectIds} - # identifying custom X.509 extensions. Will be combined with - # {::Google::Cloud::Security::PrivateCA::V1::CertificateExtensionConstraints#known_extensions known_extensions} - # to determine the full set of X.509 extensions. - class CertificateExtensionConstraints - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - - # Describes well-known X.509 extensions that can appear in a - # {::Google::Cloud::Security::PrivateCA::V1::Certificate Certificate}, not - # including the - # {::Google::Cloud::Security::PrivateCA::V1::SubjectAltNames SubjectAltNames} - # extension. - module KnownCertificateExtension - # Not specified. - KNOWN_CERTIFICATE_EXTENSION_UNSPECIFIED = 0 - - # Refers to a certificate's Key Usage extension, as described in [RFC 5280 - # section 4.2.1.3](https://tools.ietf.org/html/rfc5280#section-4.2.1.3). - # This corresponds to the - # {::Google::Cloud::Security::PrivateCA::V1::KeyUsage#base_key_usage KeyUsage.base_key_usage} - # field. - BASE_KEY_USAGE = 1 - - # Refers to a certificate's Extended Key Usage extension, as described in - # [RFC 5280 - # section 4.2.1.12](https://tools.ietf.org/html/rfc5280#section-4.2.1.12). - # This corresponds to the - # {::Google::Cloud::Security::PrivateCA::V1::KeyUsage#extended_key_usage KeyUsage.extended_key_usage} - # message. - EXTENDED_KEY_USAGE = 2 - - # Refers to a certificate's Basic Constraints extension, as described in - # [RFC 5280 - # section 4.2.1.9](https://tools.ietf.org/html/rfc5280#section-4.2.1.9). - # This corresponds to the - # {::Google::Cloud::Security::PrivateCA::V1::X509Parameters#ca_options X509Parameters.ca_options} - # field. - CA_OPTIONS = 3 - - # Refers to a certificate's Policy object identifiers, as described in - # [RFC 5280 - # section 4.2.1.4](https://tools.ietf.org/html/rfc5280#section-4.2.1.4). - # This corresponds to the - # {::Google::Cloud::Security::PrivateCA::V1::X509Parameters#policy_ids X509Parameters.policy_ids} - # field. - POLICY_IDS = 4 - - # Refers to OCSP servers in a certificate's Authority Information Access - # extension, as described in - # [RFC 5280 - # section 4.2.2.1](https://tools.ietf.org/html/rfc5280#section-4.2.2.1), - # This corresponds to the - # {::Google::Cloud::Security::PrivateCA::V1::X509Parameters#aia_ocsp_servers X509Parameters.aia_ocsp_servers} - # field. - AIA_OCSP_SERVERS = 5 - - # Refers to Name Constraints extension as described in - # [RFC 5280 - # section 4.2.1.10](https://tools.ietf.org/html/rfc5280#section-4.2.1.10) - NAME_CONSTRAINTS = 6 - end - end - - # {::Google::Cloud::Security::PrivateCA::V1::AttributeType AttributeType} specifies - # the type of Attribute in a relative distinguished name. - module AttributeType - # Attribute type is unspecified. - ATTRIBUTE_TYPE_UNSPECIFIED = 0 - - # The "common name" of the subject. - COMMON_NAME = 1 - - # The country code of the subject. - COUNTRY_CODE = 2 - - # The organization of the subject. - ORGANIZATION = 3 - - # The organizational unit of the subject. - ORGANIZATIONAL_UNIT = 4 - - # The locality or city of the subject. - LOCALITY = 5 - - # The province, territory, or regional state of the subject. - PROVINCE = 6 - - # The street address of the subject. - STREET_ADDRESS = 7 - - # The postal code of the subject. - POSTAL_CODE = 8 - end - - # A {::Google::Cloud::Security::PrivateCA::V1::RevocationReason RevocationReason} - # indicates whether a - # {::Google::Cloud::Security::PrivateCA::V1::Certificate Certificate} has been - # revoked, and the reason for revocation. These correspond to standard - # revocation reasons from RFC 5280. Note that the enum labels and values in - # this definition are not the same ASN.1 values defined in RFC 5280. These - # values will be translated to the correct ASN.1 values when a CRL is created. - module RevocationReason - # Default unspecified value. This value does indicate that a - # {::Google::Cloud::Security::PrivateCA::V1::Certificate Certificate} has been - # revoked, but that a reason has not been recorded. - REVOCATION_REASON_UNSPECIFIED = 0 - - # Key material for this - # {::Google::Cloud::Security::PrivateCA::V1::Certificate Certificate} may have - # leaked. - KEY_COMPROMISE = 1 - - # The key material for a certificate authority in the issuing path may have - # leaked. - CERTIFICATE_AUTHORITY_COMPROMISE = 2 - - # The subject or other attributes in this - # {::Google::Cloud::Security::PrivateCA::V1::Certificate Certificate} have changed. - AFFILIATION_CHANGED = 3 - - # This {::Google::Cloud::Security::PrivateCA::V1::Certificate Certificate} has been - # superseded. - SUPERSEDED = 4 - - # This {::Google::Cloud::Security::PrivateCA::V1::Certificate Certificate} or - # entities in the issuing path have ceased to operate. - CESSATION_OF_OPERATION = 5 - - # This {::Google::Cloud::Security::PrivateCA::V1::Certificate Certificate} should - # not be considered valid, it is expected that it may become valid in the - # future. - CERTIFICATE_HOLD = 6 - - # This {::Google::Cloud::Security::PrivateCA::V1::Certificate Certificate} no - # longer has permission to assert the listed attributes. - PRIVILEGE_WITHDRAWN = 7 - - # The authority which determines appropriate attributes for a - # {::Google::Cloud::Security::PrivateCA::V1::Certificate Certificate} may have been - # compromised. - ATTRIBUTE_AUTHORITY_COMPROMISE = 8 - end - - # Describes the way in which a - # {::Google::Cloud::Security::PrivateCA::V1::Certificate Certificate}'s - # {::Google::Cloud::Security::PrivateCA::V1::Subject Subject} and/or - # {::Google::Cloud::Security::PrivateCA::V1::SubjectAltNames SubjectAltNames} will be - # resolved. - module SubjectRequestMode - # Not specified. - SUBJECT_REQUEST_MODE_UNSPECIFIED = 0 - - # The default mode used in most cases. Indicates that the certificate's - # {::Google::Cloud::Security::PrivateCA::V1::Subject Subject} and/or - # {::Google::Cloud::Security::PrivateCA::V1::SubjectAltNames SubjectAltNames} are - # specified in the certificate request. This mode requires the caller to have - # the `privateca.certificates.create` permission. - DEFAULT = 1 - - # A mode used to get an accurate representation of the Subject - # field's distinguished name. Indicates that the certificate's - # {::Google::Cloud::Security::PrivateCA::V1::Subject Subject} and/or - # {::Google::Cloud::Security::PrivateCA::V1::SubjectAltNames SubjectAltNames} are - # specified in the certificate request. When parsing a PEM CSR this mode will - # maintain the sequence of RDNs found in the CSR's subject field in the - # issued {::Google::Cloud::Security::PrivateCA::V1::Certificate Certificate}. This - # mode requires the caller to have the `privateca.certificates.create` - # permission. - RDN_SEQUENCE = 3 - - # A mode reserved for special cases. Indicates that the certificate should - # have one SPIFFE - # {::Google::Cloud::Security::PrivateCA::V1::SubjectAltNames SubjectAltNames} set - # by the service based on the caller's identity. This mode will ignore any - # explicitly specified {::Google::Cloud::Security::PrivateCA::V1::Subject Subject} - # and/or - # {::Google::Cloud::Security::PrivateCA::V1::SubjectAltNames SubjectAltNames} in - # the certificate request. This mode requires the caller to have the - # `privateca.certificates.createForSelf` permission. - REFLECTED_SPIFFE = 2 - end - end - end - end - end -end diff --git a/owl-bot-staging/google-cloud-security-private_ca-v1/proto_docs/google/cloud/security/privateca/v1/service.rb b/owl-bot-staging/google-cloud-security-private_ca-v1/proto_docs/google/cloud/security/privateca/v1/service.rb deleted file mode 100644 index 10d9dbfcc739..000000000000 --- a/owl-bot-staging/google-cloud-security-private_ca-v1/proto_docs/google/cloud/security/privateca/v1/service.rb +++ /dev/null @@ -1,1032 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - - -module Google - module Cloud - module Security - module PrivateCA - module V1 - # Request message for - # {::Google::Cloud::Security::PrivateCA::V1::CertificateAuthorityService::Client#create_certificate CertificateAuthorityService.CreateCertificate}. - # @!attribute [rw] parent - # @return [::String] - # Required. The resource name of the - # {::Google::Cloud::Security::PrivateCA::V1::CaPool CaPool} associated with the - # {::Google::Cloud::Security::PrivateCA::V1::Certificate Certificate}, in the - # format `projects/*/locations/*/caPools/*`. - # @!attribute [rw] certificate_id - # @return [::String] - # Optional. It must be unique within a location and match the regular - # expression `[a-zA-Z0-9_-]{1,63}`. This field is required when using a - # {::Google::Cloud::Security::PrivateCA::V1::CertificateAuthority CertificateAuthority} - # in the Enterprise - # {::Google::Cloud::Security::PrivateCA::V1::CertificateAuthority#tier CertificateAuthority.tier}, - # but is optional and its value is ignored otherwise. - # @!attribute [rw] certificate - # @return [::Google::Cloud::Security::PrivateCA::V1::Certificate] - # Required. A {::Google::Cloud::Security::PrivateCA::V1::Certificate Certificate} - # with initial field values. - # @!attribute [rw] request_id - # @return [::String] - # Optional. An ID to identify requests. Specify a unique request ID so that - # if you must retry your request, the server will know to ignore the request - # if it has already been completed. The server will guarantee that for at - # least 60 minutes since the first request. - # - # For example, consider a situation where you make an initial request and the - # request times out. If you make the request again with the same request ID, - # the server can check if original operation with the same request ID was - # received, and if so, will ignore the second request. This prevents clients - # from accidentally creating duplicate commitments. - # - # The request ID must be a valid UUID with the exception that zero UUID is - # not supported (00000000-0000-0000-0000-000000000000). - # @!attribute [rw] validate_only - # @return [::Boolean] - # Optional. If this is true, no - # {::Google::Cloud::Security::PrivateCA::V1::Certificate Certificate} resource will - # be persisted regardless of the - # {::Google::Cloud::Security::PrivateCA::V1::CaPool CaPool}'s - # {::Google::Cloud::Security::PrivateCA::V1::CaPool#tier tier}, and the returned - # {::Google::Cloud::Security::PrivateCA::V1::Certificate Certificate} will not - # contain the - # {::Google::Cloud::Security::PrivateCA::V1::Certificate#pem_certificate pem_certificate} - # field. - # @!attribute [rw] issuing_certificate_authority_id - # @return [::String] - # Optional. The resource ID of the - # {::Google::Cloud::Security::PrivateCA::V1::CertificateAuthority CertificateAuthority} - # that should issue the certificate. This optional field will ignore the - # load-balancing scheme of the Pool and directly issue the certificate from - # the CA with the specified ID, contained in the same - # {::Google::Cloud::Security::PrivateCA::V1::CaPool CaPool} referenced by `parent`. - # Per-CA quota rules apply. If left empty, a - # {::Google::Cloud::Security::PrivateCA::V1::CertificateAuthority CertificateAuthority} - # will be chosen from the {::Google::Cloud::Security::PrivateCA::V1::CaPool CaPool} - # by the service. For example, to issue a - # {::Google::Cloud::Security::PrivateCA::V1::Certificate Certificate} from a - # Certificate Authority with resource name - # "projects/my-project/locations/us-central1/caPools/my-pool/certificateAuthorities/my-ca", - # you can set the - # {::Google::Cloud::Security::PrivateCA::V1::CreateCertificateRequest#parent parent} - # to "projects/my-project/locations/us-central1/caPools/my-pool" and the - # {::Google::Cloud::Security::PrivateCA::V1::CreateCertificateRequest#issuing_certificate_authority_id issuing_certificate_authority_id} - # to "my-ca". - class CreateCertificateRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Request message for - # {::Google::Cloud::Security::PrivateCA::V1::CertificateAuthorityService::Client#get_certificate CertificateAuthorityService.GetCertificate}. - # @!attribute [rw] name - # @return [::String] - # Required. The {::Google::Cloud::Security::PrivateCA::V1::Certificate#name name} - # of the {::Google::Cloud::Security::PrivateCA::V1::Certificate Certificate} to - # get. - class GetCertificateRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Request message for - # {::Google::Cloud::Security::PrivateCA::V1::CertificateAuthorityService::Client#list_certificates CertificateAuthorityService.ListCertificates}. - # @!attribute [rw] parent - # @return [::String] - # Required. The resource name of the location associated with the - # {::Google::Cloud::Security::PrivateCA::V1::Certificate Certificates}, in the - # format `projects/*/locations/*/caPools/*`. - # @!attribute [rw] page_size - # @return [::Integer] - # Optional. Limit on the number of - # {::Google::Cloud::Security::PrivateCA::V1::Certificate Certificates} to include - # in the response. Further - # {::Google::Cloud::Security::PrivateCA::V1::Certificate Certificates} can - # subsequently be obtained by including the - # {::Google::Cloud::Security::PrivateCA::V1::ListCertificatesResponse#next_page_token ListCertificatesResponse.next_page_token} - # in a subsequent request. If unspecified, the server will pick an - # appropriate default. - # @!attribute [rw] page_token - # @return [::String] - # Optional. Pagination token, returned earlier via - # {::Google::Cloud::Security::PrivateCA::V1::ListCertificatesResponse#next_page_token ListCertificatesResponse.next_page_token}. - # @!attribute [rw] filter - # @return [::String] - # Optional. Only include resources that match the filter in the response. For - # details on supported filters and syntax, see [Certificates Filtering - # documentation](https://cloud.google.com/certificate-authority-service/docs/sorting-filtering-certificates#filtering_support). - # @!attribute [rw] order_by - # @return [::String] - # Optional. Specify how the results should be sorted. For details on - # supported fields and syntax, see [Certificates Sorting - # documentation](https://cloud.google.com/certificate-authority-service/docs/sorting-filtering-certificates#sorting_support). - class ListCertificatesRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Response message for - # {::Google::Cloud::Security::PrivateCA::V1::CertificateAuthorityService::Client#list_certificates CertificateAuthorityService.ListCertificates}. - # @!attribute [rw] certificates - # @return [::Array<::Google::Cloud::Security::PrivateCA::V1::Certificate>] - # The list of {::Google::Cloud::Security::PrivateCA::V1::Certificate Certificates}. - # @!attribute [rw] next_page_token - # @return [::String] - # A token to retrieve next page of results. Pass this value in - # {::Google::Cloud::Security::PrivateCA::V1::ListCertificatesRequest#page_token ListCertificatesRequest.page_token} - # to retrieve the next page of results. - # @!attribute [rw] unreachable - # @return [::Array<::String>] - # A list of locations (e.g. "us-west1") that could not be reached. - class ListCertificatesResponse - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Request message for - # {::Google::Cloud::Security::PrivateCA::V1::CertificateAuthorityService::Client#revoke_certificate CertificateAuthorityService.RevokeCertificate}. - # @!attribute [rw] name - # @return [::String] - # Required. The resource name for this - # {::Google::Cloud::Security::PrivateCA::V1::Certificate Certificate} in the format - # `projects/*/locations/*/caPools/*/certificates/*`. - # @!attribute [rw] reason - # @return [::Google::Cloud::Security::PrivateCA::V1::RevocationReason] - # Required. The - # {::Google::Cloud::Security::PrivateCA::V1::RevocationReason RevocationReason} for - # revoking this certificate. - # @!attribute [rw] request_id - # @return [::String] - # Optional. An ID to identify requests. Specify a unique request ID so that - # if you must retry your request, the server will know to ignore the request - # if it has already been completed. The server will guarantee that for at - # least 60 minutes since the first request. - # - # For example, consider a situation where you make an initial request and - # the request times out. If you make the request again with the same request - # ID, the server can check if original operation with the same request ID - # was received, and if so, will ignore the second request. This prevents - # clients from accidentally creating duplicate commitments. - # - # The request ID must be a valid UUID with the exception that zero UUID is - # not supported (00000000-0000-0000-0000-000000000000). - class RevokeCertificateRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Request message for - # {::Google::Cloud::Security::PrivateCA::V1::CertificateAuthorityService::Client#update_certificate CertificateAuthorityService.UpdateCertificate}. - # @!attribute [rw] certificate - # @return [::Google::Cloud::Security::PrivateCA::V1::Certificate] - # Required. {::Google::Cloud::Security::PrivateCA::V1::Certificate Certificate} - # with updated values. - # @!attribute [rw] update_mask - # @return [::Google::Protobuf::FieldMask] - # Required. A list of fields to be updated in this request. - # @!attribute [rw] request_id - # @return [::String] - # Optional. An ID to identify requests. Specify a unique request ID so that - # if you must retry your request, the server will know to ignore the request - # if it has already been completed. The server will guarantee that for at - # least 60 minutes since the first request. - # - # For example, consider a situation where you make an initial request and - # the request times out. If you make the request again with the same request - # ID, the server can check if original operation with the same request ID - # was received, and if so, will ignore the second request. This prevents - # clients from accidentally creating duplicate commitments. - # - # The request ID must be a valid UUID with the exception that zero UUID is - # not supported (00000000-0000-0000-0000-000000000000). - class UpdateCertificateRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Request message for - # {::Google::Cloud::Security::PrivateCA::V1::CertificateAuthorityService::Client#activate_certificate_authority CertificateAuthorityService.ActivateCertificateAuthority}. - # @!attribute [rw] name - # @return [::String] - # Required. The resource name for this - # {::Google::Cloud::Security::PrivateCA::V1::CertificateAuthority CertificateAuthority} - # in the format `projects/*/locations/*/caPools/*/certificateAuthorities/*`. - # @!attribute [rw] pem_ca_certificate - # @return [::String] - # Required. The signed CA certificate issued from - # {::Google::Cloud::Security::PrivateCA::V1::FetchCertificateAuthorityCsrResponse#pem_csr FetchCertificateAuthorityCsrResponse.pem_csr}. - # @!attribute [rw] subordinate_config - # @return [::Google::Cloud::Security::PrivateCA::V1::SubordinateConfig] - # Required. Must include information about the issuer of - # 'pem_ca_certificate', and any further issuers until the self-signed CA. - # @!attribute [rw] request_id - # @return [::String] - # Optional. An ID to identify requests. Specify a unique request ID so that - # if you must retry your request, the server will know to ignore the request - # if it has already been completed. The server will guarantee that for at - # least 60 minutes since the first request. - # - # For example, consider a situation where you make an initial request and - # the request times out. If you make the request again with the same request - # ID, the server can check if original operation with the same request ID - # was received, and if so, will ignore the second request. This prevents - # clients from accidentally creating duplicate commitments. - # - # The request ID must be a valid UUID with the exception that zero UUID is - # not supported (00000000-0000-0000-0000-000000000000). - class ActivateCertificateAuthorityRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Request message for - # {::Google::Cloud::Security::PrivateCA::V1::CertificateAuthorityService::Client#create_certificate_authority CertificateAuthorityService.CreateCertificateAuthority}. - # @!attribute [rw] parent - # @return [::String] - # Required. The resource name of the - # {::Google::Cloud::Security::PrivateCA::V1::CaPool CaPool} associated with the - # {::Google::Cloud::Security::PrivateCA::V1::CertificateAuthority CertificateAuthorities}, - # in the format `projects/*/locations/*/caPools/*`. - # @!attribute [rw] certificate_authority_id - # @return [::String] - # Required. It must be unique within a location and match the regular - # expression `[a-zA-Z0-9_-]{1,63}` - # @!attribute [rw] certificate_authority - # @return [::Google::Cloud::Security::PrivateCA::V1::CertificateAuthority] - # Required. A - # {::Google::Cloud::Security::PrivateCA::V1::CertificateAuthority CertificateAuthority} - # with initial field values. - # @!attribute [rw] request_id - # @return [::String] - # Optional. An ID to identify requests. Specify a unique request ID so that - # if you must retry your request, the server will know to ignore the request - # if it has already been completed. The server will guarantee that for at - # least 60 minutes since the first request. - # - # For example, consider a situation where you make an initial request and - # the request times out. If you make the request again with the same request - # ID, the server can check if original operation with the same request ID - # was received, and if so, will ignore the second request. This prevents - # clients from accidentally creating duplicate commitments. - # - # The request ID must be a valid UUID with the exception that zero UUID is - # not supported (00000000-0000-0000-0000-000000000000). - class CreateCertificateAuthorityRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Request message for - # {::Google::Cloud::Security::PrivateCA::V1::CertificateAuthorityService::Client#disable_certificate_authority CertificateAuthorityService.DisableCertificateAuthority}. - # @!attribute [rw] name - # @return [::String] - # Required. The resource name for this - # {::Google::Cloud::Security::PrivateCA::V1::CertificateAuthority CertificateAuthority} - # in the format `projects/*/locations/*/caPools/*/certificateAuthorities/*`. - # @!attribute [rw] request_id - # @return [::String] - # Optional. An ID to identify requests. Specify a unique request ID so that - # if you must retry your request, the server will know to ignore the request - # if it has already been completed. The server will guarantee that for at - # least 60 minutes since the first request. - # - # For example, consider a situation where you make an initial request and - # the request times out. If you make the request again with the same request - # ID, the server can check if original operation with the same request ID - # was received, and if so, will ignore the second request. This prevents - # clients from accidentally creating duplicate commitments. - # - # The request ID must be a valid UUID with the exception that zero UUID is - # not supported (00000000-0000-0000-0000-000000000000). - # @!attribute [rw] ignore_dependent_resources - # @return [::Boolean] - # Optional. This field allows this CA to be disabled even if it's being - # depended on by another resource. However, doing so may result in unintended - # and unrecoverable effects on any dependent resources since the CA will - # no longer be able to issue certificates. - class DisableCertificateAuthorityRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Request message for - # {::Google::Cloud::Security::PrivateCA::V1::CertificateAuthorityService::Client#enable_certificate_authority CertificateAuthorityService.EnableCertificateAuthority}. - # @!attribute [rw] name - # @return [::String] - # Required. The resource name for this - # {::Google::Cloud::Security::PrivateCA::V1::CertificateAuthority CertificateAuthority} - # in the format `projects/*/locations/*/caPools/*/certificateAuthorities/*`. - # @!attribute [rw] request_id - # @return [::String] - # Optional. An ID to identify requests. Specify a unique request ID so that - # if you must retry your request, the server will know to ignore the request - # if it has already been completed. The server will guarantee that for at - # least 60 minutes since the first request. - # - # For example, consider a situation where you make an initial request and - # the request times out. If you make the request again with the same request - # ID, the server can check if original operation with the same request ID - # was received, and if so, will ignore the second request. This prevents - # clients from accidentally creating duplicate commitments. - # - # The request ID must be a valid UUID with the exception that zero UUID is - # not supported (00000000-0000-0000-0000-000000000000). - class EnableCertificateAuthorityRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Request message for - # {::Google::Cloud::Security::PrivateCA::V1::CertificateAuthorityService::Client#fetch_certificate_authority_csr CertificateAuthorityService.FetchCertificateAuthorityCsr}. - # @!attribute [rw] name - # @return [::String] - # Required. The resource name for this - # {::Google::Cloud::Security::PrivateCA::V1::CertificateAuthority CertificateAuthority} - # in the format `projects/*/locations/*/caPools/*/certificateAuthorities/*`. - class FetchCertificateAuthorityCsrRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Response message for - # {::Google::Cloud::Security::PrivateCA::V1::CertificateAuthorityService::Client#fetch_certificate_authority_csr CertificateAuthorityService.FetchCertificateAuthorityCsr}. - # @!attribute [r] pem_csr - # @return [::String] - # Output only. The PEM-encoded signed certificate signing request (CSR). - class FetchCertificateAuthorityCsrResponse - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Request message for - # {::Google::Cloud::Security::PrivateCA::V1::CertificateAuthorityService::Client#get_certificate_authority CertificateAuthorityService.GetCertificateAuthority}. - # @!attribute [rw] name - # @return [::String] - # Required. The - # {::Google::Cloud::Security::PrivateCA::V1::CertificateAuthority#name name} of the - # {::Google::Cloud::Security::PrivateCA::V1::CertificateAuthority CertificateAuthority} - # to get. - class GetCertificateAuthorityRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Request message for - # {::Google::Cloud::Security::PrivateCA::V1::CertificateAuthorityService::Client#list_certificate_authorities CertificateAuthorityService.ListCertificateAuthorities}. - # @!attribute [rw] parent - # @return [::String] - # Required. The resource name of the - # {::Google::Cloud::Security::PrivateCA::V1::CaPool CaPool} associated with the - # {::Google::Cloud::Security::PrivateCA::V1::CertificateAuthority CertificateAuthorities}, - # in the format `projects/*/locations/*/caPools/*`. - # @!attribute [rw] page_size - # @return [::Integer] - # Optional. Limit on the number of - # {::Google::Cloud::Security::PrivateCA::V1::CertificateAuthority CertificateAuthorities} - # to include in the response. Further - # {::Google::Cloud::Security::PrivateCA::V1::CertificateAuthority CertificateAuthorities} - # can subsequently be obtained by including the - # {::Google::Cloud::Security::PrivateCA::V1::ListCertificateAuthoritiesResponse#next_page_token ListCertificateAuthoritiesResponse.next_page_token} - # in a subsequent request. If unspecified, the server will pick an - # appropriate default. - # @!attribute [rw] page_token - # @return [::String] - # Optional. Pagination token, returned earlier via - # {::Google::Cloud::Security::PrivateCA::V1::ListCertificateAuthoritiesResponse#next_page_token ListCertificateAuthoritiesResponse.next_page_token}. - # @!attribute [rw] filter - # @return [::String] - # Optional. Only include resources that match the filter in the response. - # @!attribute [rw] order_by - # @return [::String] - # Optional. Specify how the results should be sorted. - class ListCertificateAuthoritiesRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Response message for - # {::Google::Cloud::Security::PrivateCA::V1::CertificateAuthorityService::Client#list_certificate_authorities CertificateAuthorityService.ListCertificateAuthorities}. - # @!attribute [rw] certificate_authorities - # @return [::Array<::Google::Cloud::Security::PrivateCA::V1::CertificateAuthority>] - # The list of - # {::Google::Cloud::Security::PrivateCA::V1::CertificateAuthority CertificateAuthorities}. - # @!attribute [rw] next_page_token - # @return [::String] - # A token to retrieve next page of results. Pass this value in - # {::Google::Cloud::Security::PrivateCA::V1::ListCertificateAuthoritiesRequest#page_token ListCertificateAuthoritiesRequest.page_token} - # to retrieve the next page of results. - # @!attribute [rw] unreachable - # @return [::Array<::String>] - # A list of locations (e.g. "us-west1") that could not be reached. - class ListCertificateAuthoritiesResponse - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Request message for - # {::Google::Cloud::Security::PrivateCA::V1::CertificateAuthorityService::Client#undelete_certificate_authority CertificateAuthorityService.UndeleteCertificateAuthority}. - # @!attribute [rw] name - # @return [::String] - # Required. The resource name for this - # {::Google::Cloud::Security::PrivateCA::V1::CertificateAuthority CertificateAuthority} - # in the format `projects/*/locations/*/caPools/*/certificateAuthorities/*`. - # @!attribute [rw] request_id - # @return [::String] - # Optional. An ID to identify requests. Specify a unique request ID so that - # if you must retry your request, the server will know to ignore the request - # if it has already been completed. The server will guarantee that for at - # least 60 minutes since the first request. - # - # For example, consider a situation where you make an initial request and - # the request times out. If you make the request again with the same request - # ID, the server can check if original operation with the same request ID - # was received, and if so, will ignore the second request. This prevents - # clients from accidentally creating duplicate commitments. - # - # The request ID must be a valid UUID with the exception that zero UUID is - # not supported (00000000-0000-0000-0000-000000000000). - class UndeleteCertificateAuthorityRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Request message for - # {::Google::Cloud::Security::PrivateCA::V1::CertificateAuthorityService::Client#delete_certificate_authority CertificateAuthorityService.DeleteCertificateAuthority}. - # @!attribute [rw] name - # @return [::String] - # Required. The resource name for this - # {::Google::Cloud::Security::PrivateCA::V1::CertificateAuthority CertificateAuthority} - # in the format `projects/*/locations/*/caPools/*/certificateAuthorities/*`. - # @!attribute [rw] request_id - # @return [::String] - # Optional. An ID to identify requests. Specify a unique request ID so that - # if you must retry your request, the server will know to ignore the request - # if it has already been completed. The server will guarantee that for at - # least 60 minutes since the first request. - # - # For example, consider a situation where you make an initial request and - # the request times out. If you make the request again with the same request - # ID, the server can check if original operation with the same request ID - # was received, and if so, will ignore the second request. This prevents - # clients from accidentally creating duplicate commitments. - # - # The request ID must be a valid UUID with the exception that zero UUID is - # not supported (00000000-0000-0000-0000-000000000000). - # @!attribute [rw] ignore_active_certificates - # @return [::Boolean] - # Optional. This field allows the CA to be deleted even if the CA has - # active certs. Active certs include both unrevoked and unexpired certs. - # @!attribute [rw] skip_grace_period - # @return [::Boolean] - # Optional. If this flag is set, the Certificate Authority will be deleted as - # soon as possible without a 30-day grace period where undeletion would have - # been allowed. If you proceed, there will be no way to recover this CA. - # @!attribute [rw] ignore_dependent_resources - # @return [::Boolean] - # Optional. This field allows this CA to be deleted even if it's being - # depended on by another resource. However, doing so may result in unintended - # and unrecoverable effects on any dependent resources since the CA will - # no longer be able to issue certificates. - class DeleteCertificateAuthorityRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Request message for - # {::Google::Cloud::Security::PrivateCA::V1::CertificateAuthorityService::Client#update_certificate_authority CertificateAuthorityService.UpdateCertificateAuthority}. - # @!attribute [rw] certificate_authority - # @return [::Google::Cloud::Security::PrivateCA::V1::CertificateAuthority] - # Required. - # {::Google::Cloud::Security::PrivateCA::V1::CertificateAuthority CertificateAuthority} - # with updated values. - # @!attribute [rw] update_mask - # @return [::Google::Protobuf::FieldMask] - # Required. A list of fields to be updated in this request. - # @!attribute [rw] request_id - # @return [::String] - # Optional. An ID to identify requests. Specify a unique request ID so that - # if you must retry your request, the server will know to ignore the request - # if it has already been completed. The server will guarantee that for at - # least 60 minutes since the first request. - # - # For example, consider a situation where you make an initial request and - # the request times out. If you make the request again with the same request - # ID, the server can check if original operation with the same request ID - # was received, and if so, will ignore the second request. This prevents - # clients from accidentally creating duplicate commitments. - # - # The request ID must be a valid UUID with the exception that zero UUID is - # not supported (00000000-0000-0000-0000-000000000000). - class UpdateCertificateAuthorityRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Request message for - # {::Google::Cloud::Security::PrivateCA::V1::CertificateAuthorityService::Client#create_ca_pool CertificateAuthorityService.CreateCaPool}. - # @!attribute [rw] parent - # @return [::String] - # Required. The resource name of the location associated with the - # {::Google::Cloud::Security::PrivateCA::V1::CaPool CaPool}, in the format - # `projects/*/locations/*`. - # @!attribute [rw] ca_pool_id - # @return [::String] - # Required. It must be unique within a location and match the regular - # expression `[a-zA-Z0-9_-]{1,63}` - # @!attribute [rw] ca_pool - # @return [::Google::Cloud::Security::PrivateCA::V1::CaPool] - # Required. A {::Google::Cloud::Security::PrivateCA::V1::CaPool CaPool} with - # initial field values. - # @!attribute [rw] request_id - # @return [::String] - # Optional. An ID to identify requests. Specify a unique request ID so that - # if you must retry your request, the server will know to ignore the request - # if it has already been completed. The server will guarantee that for at - # least 60 minutes since the first request. - # - # For example, consider a situation where you make an initial request and - # the request times out. If you make the request again with the same request - # ID, the server can check if original operation with the same request ID - # was received, and if so, will ignore the second request. This prevents - # clients from accidentally creating duplicate commitments. - # - # The request ID must be a valid UUID with the exception that zero UUID is - # not supported (00000000-0000-0000-0000-000000000000). - class CreateCaPoolRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Request message for - # {::Google::Cloud::Security::PrivateCA::V1::CertificateAuthorityService::Client#update_ca_pool CertificateAuthorityService.UpdateCaPool}. - # @!attribute [rw] ca_pool - # @return [::Google::Cloud::Security::PrivateCA::V1::CaPool] - # Required. {::Google::Cloud::Security::PrivateCA::V1::CaPool CaPool} with updated - # values. - # @!attribute [rw] update_mask - # @return [::Google::Protobuf::FieldMask] - # Required. A list of fields to be updated in this request. - # @!attribute [rw] request_id - # @return [::String] - # Optional. An ID to identify requests. Specify a unique request ID so that - # if you must retry your request, the server will know to ignore the request - # if it has already been completed. The server will guarantee that for at - # least 60 minutes since the first request. - # - # For example, consider a situation where you make an initial request and - # the request times out. If you make the request again with the same request - # ID, the server can check if original operation with the same request ID - # was received, and if so, will ignore the second request. This prevents - # clients from accidentally creating duplicate commitments. - # - # The request ID must be a valid UUID with the exception that zero UUID is - # not supported (00000000-0000-0000-0000-000000000000). - class UpdateCaPoolRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Request message for - # {::Google::Cloud::Security::PrivateCA::V1::CertificateAuthorityService::Client#delete_ca_pool CertificateAuthorityService.DeleteCaPool}. - # @!attribute [rw] name - # @return [::String] - # Required. The resource name for this - # {::Google::Cloud::Security::PrivateCA::V1::CaPool CaPool} in the format - # `projects/*/locations/*/caPools/*`. - # @!attribute [rw] request_id - # @return [::String] - # Optional. An ID to identify requests. Specify a unique request ID so that - # if you must retry your request, the server will know to ignore the request - # if it has already been completed. The server will guarantee that for at - # least 60 minutes since the first request. - # - # For example, consider a situation where you make an initial request and - # the request times out. If you make the request again with the same request - # ID, the server can check if original operation with the same request ID - # was received, and if so, will ignore the second request. This prevents - # clients from accidentally creating duplicate commitments. - # - # The request ID must be a valid UUID with the exception that zero UUID is - # not supported (00000000-0000-0000-0000-000000000000). - # @!attribute [rw] ignore_dependent_resources - # @return [::Boolean] - # Optional. This field allows this pool to be deleted even if it's being - # depended on by another resource. However, doing so may result in unintended - # and unrecoverable effects on any dependent resources since the pool will - # no longer be able to issue certificates. - class DeleteCaPoolRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Request message for - # {::Google::Cloud::Security::PrivateCA::V1::CertificateAuthorityService::Client#fetch_ca_certs CertificateAuthorityService.FetchCaCerts}. - # @!attribute [rw] ca_pool - # @return [::String] - # Required. The resource name for the - # {::Google::Cloud::Security::PrivateCA::V1::CaPool CaPool} in the format - # `projects/*/locations/*/caPools/*`. - # @!attribute [rw] request_id - # @return [::String] - # Optional. An ID to identify requests. Specify a unique request ID so that - # if you must retry your request, the server will know to ignore the request - # if it has already been completed. The server will guarantee that for at - # least 60 minutes since the first request. - # - # For example, consider a situation where you make an initial request and - # the request times out. If you make the request again with the same request - # ID, the server can check if original operation with the same request ID - # was received, and if so, will ignore the second request. This prevents - # clients from accidentally creating duplicate commitments. - # - # The request ID must be a valid UUID with the exception that zero UUID is - # not supported (00000000-0000-0000-0000-000000000000). - class FetchCaCertsRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Response message for - # {::Google::Cloud::Security::PrivateCA::V1::CertificateAuthorityService::Client#fetch_ca_certs CertificateAuthorityService.FetchCaCerts}. - # @!attribute [rw] ca_certs - # @return [::Array<::Google::Cloud::Security::PrivateCA::V1::FetchCaCertsResponse::CertChain>] - # The PEM encoded CA certificate chains of all certificate authorities in - # this {::Google::Cloud::Security::PrivateCA::V1::CaPool CaPool} in the ENABLED, - # DISABLED, or STAGED states. - class FetchCaCertsResponse - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - - # @!attribute [rw] certificates - # @return [::Array<::String>] - # The certificates that form the CA chain, from leaf to root order. - class CertChain - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - end - - # Request message for - # {::Google::Cloud::Security::PrivateCA::V1::CertificateAuthorityService::Client#get_ca_pool CertificateAuthorityService.GetCaPool}. - # @!attribute [rw] name - # @return [::String] - # Required. The {::Google::Cloud::Security::PrivateCA::V1::CaPool#name name} of the - # {::Google::Cloud::Security::PrivateCA::V1::CaPool CaPool} to get. - class GetCaPoolRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Request message for - # {::Google::Cloud::Security::PrivateCA::V1::CertificateAuthorityService::Client#list_ca_pools CertificateAuthorityService.ListCaPools}. - # @!attribute [rw] parent - # @return [::String] - # Required. The resource name of the location associated with the - # {::Google::Cloud::Security::PrivateCA::V1::CaPool CaPools}, in the format - # `projects/*/locations/*`. - # @!attribute [rw] page_size - # @return [::Integer] - # Optional. Limit on the number of - # {::Google::Cloud::Security::PrivateCA::V1::CaPool CaPools} to include in the - # response. Further {::Google::Cloud::Security::PrivateCA::V1::CaPool CaPools} can - # subsequently be obtained by including the - # {::Google::Cloud::Security::PrivateCA::V1::ListCaPoolsResponse#next_page_token ListCaPoolsResponse.next_page_token} - # in a subsequent request. If unspecified, the server will pick an - # appropriate default. - # @!attribute [rw] page_token - # @return [::String] - # Optional. Pagination token, returned earlier via - # {::Google::Cloud::Security::PrivateCA::V1::ListCaPoolsResponse#next_page_token ListCaPoolsResponse.next_page_token}. - # @!attribute [rw] filter - # @return [::String] - # Optional. Only include resources that match the filter in the response. - # @!attribute [rw] order_by - # @return [::String] - # Optional. Specify how the results should be sorted. - class ListCaPoolsRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Response message for - # {::Google::Cloud::Security::PrivateCA::V1::CertificateAuthorityService::Client#list_ca_pools CertificateAuthorityService.ListCaPools}. - # @!attribute [rw] ca_pools - # @return [::Array<::Google::Cloud::Security::PrivateCA::V1::CaPool>] - # The list of {::Google::Cloud::Security::PrivateCA::V1::CaPool CaPools}. - # @!attribute [rw] next_page_token - # @return [::String] - # A token to retrieve next page of results. Pass this value in - # {::Google::Cloud::Security::PrivateCA::V1::ListCertificateAuthoritiesRequest#page_token ListCertificateAuthoritiesRequest.page_token} - # to retrieve the next page of results. - # @!attribute [rw] unreachable - # @return [::Array<::String>] - # A list of locations (e.g. "us-west1") that could not be reached. - class ListCaPoolsResponse - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Request message for - # {::Google::Cloud::Security::PrivateCA::V1::CertificateAuthorityService::Client#get_certificate_revocation_list CertificateAuthorityService.GetCertificateRevocationList}. - # @!attribute [rw] name - # @return [::String] - # Required. The - # {::Google::Cloud::Security::PrivateCA::V1::CertificateRevocationList#name name} - # of the - # {::Google::Cloud::Security::PrivateCA::V1::CertificateRevocationList CertificateRevocationList} - # to get. - class GetCertificateRevocationListRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Request message for - # {::Google::Cloud::Security::PrivateCA::V1::CertificateAuthorityService::Client#list_certificate_revocation_lists CertificateAuthorityService.ListCertificateRevocationLists}. - # @!attribute [rw] parent - # @return [::String] - # Required. The resource name of the location associated with the - # {::Google::Cloud::Security::PrivateCA::V1::CertificateRevocationList CertificateRevocationLists}, - # in the format `projects/*/locations/*/caPools/*/certificateAuthorities/*`. - # @!attribute [rw] page_size - # @return [::Integer] - # Optional. Limit on the number of - # {::Google::Cloud::Security::PrivateCA::V1::CertificateRevocationList CertificateRevocationLists} - # to include in the response. Further - # {::Google::Cloud::Security::PrivateCA::V1::CertificateRevocationList CertificateRevocationLists} - # can subsequently be obtained by including the - # {::Google::Cloud::Security::PrivateCA::V1::ListCertificateRevocationListsResponse#next_page_token ListCertificateRevocationListsResponse.next_page_token} - # in a subsequent request. If unspecified, the server will pick an - # appropriate default. - # @!attribute [rw] page_token - # @return [::String] - # Optional. Pagination token, returned earlier via - # {::Google::Cloud::Security::PrivateCA::V1::ListCertificateRevocationListsResponse#next_page_token ListCertificateRevocationListsResponse.next_page_token}. - # @!attribute [rw] filter - # @return [::String] - # Optional. Only include resources that match the filter in the response. - # @!attribute [rw] order_by - # @return [::String] - # Optional. Specify how the results should be sorted. - class ListCertificateRevocationListsRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Response message for - # {::Google::Cloud::Security::PrivateCA::V1::CertificateAuthorityService::Client#list_certificate_revocation_lists CertificateAuthorityService.ListCertificateRevocationLists}. - # @!attribute [rw] certificate_revocation_lists - # @return [::Array<::Google::Cloud::Security::PrivateCA::V1::CertificateRevocationList>] - # The list of - # {::Google::Cloud::Security::PrivateCA::V1::CertificateRevocationList CertificateRevocationLists}. - # @!attribute [rw] next_page_token - # @return [::String] - # A token to retrieve next page of results. Pass this value in - # {::Google::Cloud::Security::PrivateCA::V1::ListCertificateRevocationListsRequest#page_token ListCertificateRevocationListsRequest.page_token} - # to retrieve the next page of results. - # @!attribute [rw] unreachable - # @return [::Array<::String>] - # A list of locations (e.g. "us-west1") that could not be reached. - class ListCertificateRevocationListsResponse - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Request message for - # {::Google::Cloud::Security::PrivateCA::V1::CertificateAuthorityService::Client#update_certificate_revocation_list CertificateAuthorityService.UpdateCertificateRevocationList}. - # @!attribute [rw] certificate_revocation_list - # @return [::Google::Cloud::Security::PrivateCA::V1::CertificateRevocationList] - # Required. - # {::Google::Cloud::Security::PrivateCA::V1::CertificateRevocationList CertificateRevocationList} - # with updated values. - # @!attribute [rw] update_mask - # @return [::Google::Protobuf::FieldMask] - # Required. A list of fields to be updated in this request. - # @!attribute [rw] request_id - # @return [::String] - # Optional. An ID to identify requests. Specify a unique request ID so that - # if you must retry your request, the server will know to ignore the request - # if it has already been completed. The server will guarantee that for at - # least 60 minutes since the first request. - # - # For example, consider a situation where you make an initial request and - # the request times out. If you make the request again with the same request - # ID, the server can check if original operation with the same request ID - # was received, and if so, will ignore the second request. This prevents - # clients from accidentally creating duplicate commitments. - # - # The request ID must be a valid UUID with the exception that zero UUID is - # not supported (00000000-0000-0000-0000-000000000000). - class UpdateCertificateRevocationListRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Request message for - # {::Google::Cloud::Security::PrivateCA::V1::CertificateAuthorityService::Client#create_certificate_template CertificateAuthorityService.CreateCertificateTemplate}. - # @!attribute [rw] parent - # @return [::String] - # Required. The resource name of the location associated with the - # {::Google::Cloud::Security::PrivateCA::V1::CertificateTemplate CertificateTemplate}, - # in the format `projects/*/locations/*`. - # @!attribute [rw] certificate_template_id - # @return [::String] - # Required. It must be unique within a location and match the regular - # expression `[a-zA-Z0-9_-]{1,63}` - # @!attribute [rw] certificate_template - # @return [::Google::Cloud::Security::PrivateCA::V1::CertificateTemplate] - # Required. A - # {::Google::Cloud::Security::PrivateCA::V1::CertificateTemplate CertificateTemplate} - # with initial field values. - # @!attribute [rw] request_id - # @return [::String] - # Optional. An ID to identify requests. Specify a unique request ID so that - # if you must retry your request, the server will know to ignore the request - # if it has already been completed. The server will guarantee that for at - # least 60 minutes since the first request. - # - # For example, consider a situation where you make an initial request and - # the request times out. If you make the request again with the same request - # ID, the server can check if original operation with the same request ID - # was received, and if so, will ignore the second request. This prevents - # clients from accidentally creating duplicate commitments. - # - # The request ID must be a valid UUID with the exception that zero UUID is - # not supported (00000000-0000-0000-0000-000000000000). - class CreateCertificateTemplateRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Request message for - # {::Google::Cloud::Security::PrivateCA::V1::CertificateAuthorityService::Client#delete_certificate_template CertificateAuthorityService.DeleteCertificateTemplate}. - # @!attribute [rw] name - # @return [::String] - # Required. The resource name for this - # {::Google::Cloud::Security::PrivateCA::V1::CertificateTemplate CertificateTemplate} - # in the format `projects/*/locations/*/certificateTemplates/*`. - # @!attribute [rw] request_id - # @return [::String] - # Optional. An ID to identify requests. Specify a unique request ID so that - # if you must retry your request, the server will know to ignore the request - # if it has already been completed. The server will guarantee that for at - # least 60 minutes since the first request. - # - # For example, consider a situation where you make an initial request and - # the request times out. If you make the request again with the same request - # ID, the server can check if original operation with the same request ID - # was received, and if so, will ignore the second request. This prevents - # clients from accidentally creating duplicate commitments. - # - # The request ID must be a valid UUID with the exception that zero UUID is - # not supported (00000000-0000-0000-0000-000000000000). - class DeleteCertificateTemplateRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Request message for - # {::Google::Cloud::Security::PrivateCA::V1::CertificateAuthorityService::Client#get_certificate_template CertificateAuthorityService.GetCertificateTemplate}. - # @!attribute [rw] name - # @return [::String] - # Required. The - # {::Google::Cloud::Security::PrivateCA::V1::CertificateTemplate#name name} of the - # {::Google::Cloud::Security::PrivateCA::V1::CertificateTemplate CertificateTemplate} - # to get. - class GetCertificateTemplateRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Request message for - # {::Google::Cloud::Security::PrivateCA::V1::CertificateAuthorityService::Client#list_certificate_templates CertificateAuthorityService.ListCertificateTemplates}. - # @!attribute [rw] parent - # @return [::String] - # Required. The resource name of the location associated with the - # {::Google::Cloud::Security::PrivateCA::V1::CertificateTemplate CertificateTemplates}, - # in the format `projects/*/locations/*`. - # @!attribute [rw] page_size - # @return [::Integer] - # Optional. Limit on the number of - # {::Google::Cloud::Security::PrivateCA::V1::CertificateTemplate CertificateTemplates} - # to include in the response. Further - # {::Google::Cloud::Security::PrivateCA::V1::CertificateTemplate CertificateTemplates} - # can subsequently be obtained by including the - # {::Google::Cloud::Security::PrivateCA::V1::ListCertificateTemplatesResponse#next_page_token ListCertificateTemplatesResponse.next_page_token} - # in a subsequent request. If unspecified, the server will pick an - # appropriate default. - # @!attribute [rw] page_token - # @return [::String] - # Optional. Pagination token, returned earlier via - # {::Google::Cloud::Security::PrivateCA::V1::ListCertificateTemplatesResponse#next_page_token ListCertificateTemplatesResponse.next_page_token}. - # @!attribute [rw] filter - # @return [::String] - # Optional. Only include resources that match the filter in the response. - # @!attribute [rw] order_by - # @return [::String] - # Optional. Specify how the results should be sorted. - class ListCertificateTemplatesRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Response message for - # {::Google::Cloud::Security::PrivateCA::V1::CertificateAuthorityService::Client#list_certificate_templates CertificateAuthorityService.ListCertificateTemplates}. - # @!attribute [rw] certificate_templates - # @return [::Array<::Google::Cloud::Security::PrivateCA::V1::CertificateTemplate>] - # The list of - # {::Google::Cloud::Security::PrivateCA::V1::CertificateTemplate CertificateTemplates}. - # @!attribute [rw] next_page_token - # @return [::String] - # A token to retrieve next page of results. Pass this value in - # {::Google::Cloud::Security::PrivateCA::V1::ListCertificateTemplatesRequest#page_token ListCertificateTemplatesRequest.page_token} - # to retrieve the next page of results. - # @!attribute [rw] unreachable - # @return [::Array<::String>] - # A list of locations (e.g. "us-west1") that could not be reached. - class ListCertificateTemplatesResponse - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Request message for - # {::Google::Cloud::Security::PrivateCA::V1::CertificateAuthorityService::Client#update_certificate_template CertificateAuthorityService.UpdateCertificateTemplate}. - # @!attribute [rw] certificate_template - # @return [::Google::Cloud::Security::PrivateCA::V1::CertificateTemplate] - # Required. - # {::Google::Cloud::Security::PrivateCA::V1::CertificateTemplate CertificateTemplate} - # with updated values. - # @!attribute [rw] update_mask - # @return [::Google::Protobuf::FieldMask] - # Required. A list of fields to be updated in this request. - # @!attribute [rw] request_id - # @return [::String] - # Optional. An ID to identify requests. Specify a unique request ID so that - # if you must retry your request, the server will know to ignore the request - # if it has already been completed. The server will guarantee that for at - # least 60 minutes since the first request. - # - # For example, consider a situation where you make an initial request and - # the request times out. If you make the request again with the same request - # ID, the server can check if original operation with the same request ID - # was received, and if so, will ignore the second request. This prevents - # clients from accidentally creating duplicate commitments. - # - # The request ID must be a valid UUID with the exception that zero UUID is - # not supported (00000000-0000-0000-0000-000000000000). - class UpdateCertificateTemplateRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Represents the metadata of the long-running operation. - # @!attribute [r] create_time - # @return [::Google::Protobuf::Timestamp] - # Output only. The time the operation was created. - # @!attribute [r] end_time - # @return [::Google::Protobuf::Timestamp] - # Output only. The time the operation finished running. - # @!attribute [r] target - # @return [::String] - # Output only. Server-defined resource path for the target of the operation. - # @!attribute [r] verb - # @return [::String] - # Output only. Name of the verb executed by the operation. - # @!attribute [r] status_message - # @return [::String] - # Output only. Human-readable status of the operation, if any. - # @!attribute [r] requested_cancellation - # @return [::Boolean] - # Output only. Identifies whether the user has requested cancellation - # of the operation. Operations that have successfully been cancelled - # have - # {::Google::Longrunning::Operation#error google.longrunning.Operation.error} - # value with a {::Google::Rpc::Status#code google.rpc.Status.code} of 1, - # corresponding to `Code.CANCELLED`. - # @!attribute [r] api_version - # @return [::String] - # Output only. API version used to start the operation. - class OperationMetadata - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - end - end - end - end -end diff --git a/owl-bot-staging/google-cloud-security-private_ca-v1/proto_docs/google/longrunning/operations.rb b/owl-bot-staging/google-cloud-security-private_ca-v1/proto_docs/google/longrunning/operations.rb deleted file mode 100644 index 7a757f512165..000000000000 --- a/owl-bot-staging/google-cloud-security-private_ca-v1/proto_docs/google/longrunning/operations.rb +++ /dev/null @@ -1,191 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - - -module Google - module Longrunning - # This resource represents a long-running operation that is the result of a - # network API call. - # @!attribute [rw] name - # @return [::String] - # The server-assigned name, which is only unique within the same service that - # originally returns it. If you use the default HTTP mapping, the - # `name` should be a resource name ending with `operations/{unique_id}`. - # @!attribute [rw] metadata - # @return [::Google::Protobuf::Any] - # Service-specific metadata associated with the operation. It typically - # contains progress information and common metadata such as create time. - # Some services might not provide such metadata. Any method that returns a - # long-running operation should document the metadata type, if any. - # @!attribute [rw] done - # @return [::Boolean] - # If the value is `false`, it means the operation is still in progress. - # If `true`, the operation is completed, and either `error` or `response` is - # available. - # @!attribute [rw] error - # @return [::Google::Rpc::Status] - # The error result of the operation in case of failure or cancellation. - # - # Note: The following fields are mutually exclusive: `error`, `response`. If a field in that set is populated, all other fields in the set will automatically be cleared. - # @!attribute [rw] response - # @return [::Google::Protobuf::Any] - # The normal, successful response of the operation. If the original - # method returns no data on success, such as `Delete`, the response is - # `google.protobuf.Empty`. If the original method is standard - # `Get`/`Create`/`Update`, the response should be the resource. For other - # methods, the response should have the type `XxxResponse`, where `Xxx` - # is the original method name. For example, if the original method name - # is `TakeSnapshot()`, the inferred response type is - # `TakeSnapshotResponse`. - # - # Note: The following fields are mutually exclusive: `response`, `error`. If a field in that set is populated, all other fields in the set will automatically be cleared. - class Operation - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # The request message for - # Operations.GetOperation. - # @!attribute [rw] name - # @return [::String] - # The name of the operation resource. - class GetOperationRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # The request message for - # Operations.ListOperations. - # @!attribute [rw] name - # @return [::String] - # The name of the operation's parent resource. - # @!attribute [rw] filter - # @return [::String] - # The standard list filter. - # @!attribute [rw] page_size - # @return [::Integer] - # The standard list page size. - # @!attribute [rw] page_token - # @return [::String] - # The standard list page token. - # @!attribute [rw] return_partial_success - # @return [::Boolean] - # When set to `true`, operations that are reachable are returned as normal, - # and those that are unreachable are returned in the - # [ListOperationsResponse.unreachable] field. - # - # This can only be `true` when reading across collections e.g. when `parent` - # is set to `"projects/example/locations/-"`. - # - # This field is not by default supported and will result in an - # `UNIMPLEMENTED` error if set unless explicitly documented otherwise in - # service or product specific documentation. - class ListOperationsRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # The response message for - # Operations.ListOperations. - # @!attribute [rw] operations - # @return [::Array<::Google::Longrunning::Operation>] - # A list of operations that matches the specified filter in the request. - # @!attribute [rw] next_page_token - # @return [::String] - # The standard List next-page token. - # @!attribute [rw] unreachable - # @return [::Array<::String>] - # Unordered list. Unreachable resources. Populated when the request sets - # `ListOperationsRequest.return_partial_success` and reads across - # collections e.g. when attempting to list all resources across all supported - # locations. - class ListOperationsResponse - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # The request message for - # Operations.CancelOperation. - # @!attribute [rw] name - # @return [::String] - # The name of the operation resource to be cancelled. - class CancelOperationRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # The request message for - # Operations.DeleteOperation. - # @!attribute [rw] name - # @return [::String] - # The name of the operation resource to be deleted. - class DeleteOperationRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # The request message for - # Operations.WaitOperation. - # @!attribute [rw] name - # @return [::String] - # The name of the operation resource to wait on. - # @!attribute [rw] timeout - # @return [::Google::Protobuf::Duration] - # The maximum duration to wait before timing out. If left blank, the wait - # will be at most the time permitted by the underlying HTTP/RPC protocol. - # If RPC context deadline is also specified, the shorter one will be used. - class WaitOperationRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # A message representing the message types used by a long-running operation. - # - # Example: - # - # rpc Export(ExportRequest) returns (google.longrunning.Operation) { - # option (google.longrunning.operation_info) = { - # response_type: "ExportResponse" - # metadata_type: "ExportMetadata" - # }; - # } - # @!attribute [rw] response_type - # @return [::String] - # Required. The message name of the primary return type for this - # long-running operation. - # This type will be used to deserialize the LRO's response. - # - # If the response is in a different package from the rpc, a fully-qualified - # message name must be used (e.g. `google.protobuf.Struct`). - # - # Note: Altering this value constitutes a breaking change. - # @!attribute [rw] metadata_type - # @return [::String] - # Required. The message name of the metadata type for this long-running - # operation. - # - # If the response is in a different package from the rpc, a fully-qualified - # message name must be used (e.g. `google.protobuf.Struct`). - # - # Note: Altering this value constitutes a breaking change. - class OperationInfo - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - end -end diff --git a/owl-bot-staging/google-cloud-security-private_ca-v1/proto_docs/google/protobuf/any.rb b/owl-bot-staging/google-cloud-security-private_ca-v1/proto_docs/google/protobuf/any.rb deleted file mode 100644 index 58691995f02e..000000000000 --- a/owl-bot-staging/google-cloud-security-private_ca-v1/proto_docs/google/protobuf/any.rb +++ /dev/null @@ -1,145 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - - -module Google - module Protobuf - # `Any` contains an arbitrary serialized protocol buffer message along with a - # URL that describes the type of the serialized message. - # - # Protobuf library provides support to pack/unpack Any values in the form - # of utility functions or additional generated methods of the Any type. - # - # Example 1: Pack and unpack a message in C++. - # - # Foo foo = ...; - # Any any; - # any.PackFrom(foo); - # ... - # if (any.UnpackTo(&foo)) { - # ... - # } - # - # Example 2: Pack and unpack a message in Java. - # - # Foo foo = ...; - # Any any = Any.pack(foo); - # ... - # if (any.is(Foo.class)) { - # foo = any.unpack(Foo.class); - # } - # // or ... - # if (any.isSameTypeAs(Foo.getDefaultInstance())) { - # foo = any.unpack(Foo.getDefaultInstance()); - # } - # - # Example 3: Pack and unpack a message in Python. - # - # foo = Foo(...) - # any = Any() - # any.Pack(foo) - # ... - # if any.Is(Foo.DESCRIPTOR): - # any.Unpack(foo) - # ... - # - # Example 4: Pack and unpack a message in Go - # - # foo := &pb.Foo{...} - # any, err := anypb.New(foo) - # if err != nil { - # ... - # } - # ... - # foo := &pb.Foo{} - # if err := any.UnmarshalTo(foo); err != nil { - # ... - # } - # - # The pack methods provided by protobuf library will by default use - # 'type.googleapis.com/full.type.name' as the type URL and the unpack - # methods only use the fully qualified type name after the last '/' - # in the type URL, for example "foo.bar.com/x/y.z" will yield type - # name "y.z". - # - # JSON - # ==== - # The JSON representation of an `Any` value uses the regular - # representation of the deserialized, embedded message, with an - # additional field `@type` which contains the type URL. Example: - # - # package google.profile; - # message Person { - # string first_name = 1; - # string last_name = 2; - # } - # - # { - # "@type": "type.googleapis.com/google.profile.Person", - # "firstName": , - # "lastName": - # } - # - # If the embedded message type is well-known and has a custom JSON - # representation, that representation will be embedded adding a field - # `value` which holds the custom JSON in addition to the `@type` - # field. Example (for message [google.protobuf.Duration][]): - # - # { - # "@type": "type.googleapis.com/google.protobuf.Duration", - # "value": "1.212s" - # } - # @!attribute [rw] type_url - # @return [::String] - # A URL/resource name that uniquely identifies the type of the serialized - # protocol buffer message. This string must contain at least - # one "/" character. The last segment of the URL's path must represent - # the fully qualified name of the type (as in - # `path/google.protobuf.Duration`). The name should be in a canonical form - # (e.g., leading "." is not accepted). - # - # In practice, teams usually precompile into the binary all types that they - # expect it to use in the context of Any. However, for URLs which use the - # scheme `http`, `https`, or no scheme, one can optionally set up a type - # server that maps type URLs to message definitions as follows: - # - # * If no scheme is provided, `https` is assumed. - # * An HTTP GET on the URL must yield a [google.protobuf.Type][] - # value in binary format, or produce an error. - # * Applications are allowed to cache lookup results based on the - # URL, or have them precompiled into a binary to avoid any - # lookup. Therefore, binary compatibility needs to be preserved - # on changes to types. (Use versioned type names to manage - # breaking changes.) - # - # Note: this functionality is not currently available in the official - # protobuf release, and it is not used for type URLs beginning with - # type.googleapis.com. As of May 2023, there are no widely used type server - # implementations and no plans to implement one. - # - # Schemes other than `http`, `https` (or the empty scheme) might be - # used with implementation specific semantics. - # @!attribute [rw] value - # @return [::String] - # Must be a valid serialized protocol buffer of the above specified type. - class Any - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - end -end diff --git a/owl-bot-staging/google-cloud-security-private_ca-v1/proto_docs/google/protobuf/duration.rb b/owl-bot-staging/google-cloud-security-private_ca-v1/proto_docs/google/protobuf/duration.rb deleted file mode 100644 index ea59f1f91daf..000000000000 --- a/owl-bot-staging/google-cloud-security-private_ca-v1/proto_docs/google/protobuf/duration.rb +++ /dev/null @@ -1,98 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - - -module Google - module Protobuf - # A Duration represents a signed, fixed-length span of time represented - # as a count of seconds and fractions of seconds at nanosecond - # resolution. It is independent of any calendar and concepts like "day" - # or "month". It is related to Timestamp in that the difference between - # two Timestamp values is a Duration and it can be added or subtracted - # from a Timestamp. Range is approximately +-10,000 years. - # - # # Examples - # - # Example 1: Compute Duration from two Timestamps in pseudo code. - # - # Timestamp start = ...; - # Timestamp end = ...; - # Duration duration = ...; - # - # duration.seconds = end.seconds - start.seconds; - # duration.nanos = end.nanos - start.nanos; - # - # if (duration.seconds < 0 && duration.nanos > 0) { - # duration.seconds += 1; - # duration.nanos -= 1000000000; - # } else if (duration.seconds > 0 && duration.nanos < 0) { - # duration.seconds -= 1; - # duration.nanos += 1000000000; - # } - # - # Example 2: Compute Timestamp from Timestamp + Duration in pseudo code. - # - # Timestamp start = ...; - # Duration duration = ...; - # Timestamp end = ...; - # - # end.seconds = start.seconds + duration.seconds; - # end.nanos = start.nanos + duration.nanos; - # - # if (end.nanos < 0) { - # end.seconds -= 1; - # end.nanos += 1000000000; - # } else if (end.nanos >= 1000000000) { - # end.seconds += 1; - # end.nanos -= 1000000000; - # } - # - # Example 3: Compute Duration from datetime.timedelta in Python. - # - # td = datetime.timedelta(days=3, minutes=10) - # duration = Duration() - # duration.FromTimedelta(td) - # - # # JSON Mapping - # - # In JSON format, the Duration type is encoded as a string rather than an - # object, where the string ends in the suffix "s" (indicating seconds) and - # is preceded by the number of seconds, with nanoseconds expressed as - # fractional seconds. For example, 3 seconds with 0 nanoseconds should be - # encoded in JSON format as "3s", while 3 seconds and 1 nanosecond should - # be expressed in JSON format as "3.000000001s", and 3 seconds and 1 - # microsecond should be expressed in JSON format as "3.000001s". - # @!attribute [rw] seconds - # @return [::Integer] - # Signed seconds of the span of time. Must be from -315,576,000,000 - # to +315,576,000,000 inclusive. Note: these bounds are computed from: - # 60 sec/min * 60 min/hr * 24 hr/day * 365.25 days/year * 10000 years - # @!attribute [rw] nanos - # @return [::Integer] - # Signed fractions of a second at nanosecond resolution of the span - # of time. Durations less than one second are represented with a 0 - # `seconds` field and a positive or negative `nanos` field. For durations - # of one second or more, a non-zero value for the `nanos` field must be - # of the same sign as the `seconds` field. Must be from -999,999,999 - # to +999,999,999 inclusive. - class Duration - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - end -end diff --git a/owl-bot-staging/google-cloud-security-private_ca-v1/proto_docs/google/protobuf/empty.rb b/owl-bot-staging/google-cloud-security-private_ca-v1/proto_docs/google/protobuf/empty.rb deleted file mode 100644 index 83e4481834a6..000000000000 --- a/owl-bot-staging/google-cloud-security-private_ca-v1/proto_docs/google/protobuf/empty.rb +++ /dev/null @@ -1,34 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - - -module Google - module Protobuf - # A generic empty message that you can re-use to avoid defining duplicated - # empty messages in your APIs. A typical example is to use it as the request - # or the response type of an API method. For instance: - # - # service Foo { - # rpc Bar(google.protobuf.Empty) returns (google.protobuf.Empty); - # } - class Empty - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - end -end diff --git a/owl-bot-staging/google-cloud-security-private_ca-v1/proto_docs/google/protobuf/field_mask.rb b/owl-bot-staging/google-cloud-security-private_ca-v1/proto_docs/google/protobuf/field_mask.rb deleted file mode 100644 index 7f3ffc78601a..000000000000 --- a/owl-bot-staging/google-cloud-security-private_ca-v1/proto_docs/google/protobuf/field_mask.rb +++ /dev/null @@ -1,229 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - - -module Google - module Protobuf - # `FieldMask` represents a set of symbolic field paths, for example: - # - # paths: "f.a" - # paths: "f.b.d" - # - # Here `f` represents a field in some root message, `a` and `b` - # fields in the message found in `f`, and `d` a field found in the - # message in `f.b`. - # - # Field masks are used to specify a subset of fields that should be - # returned by a get operation or modified by an update operation. - # Field masks also have a custom JSON encoding (see below). - # - # # Field Masks in Projections - # - # When used in the context of a projection, a response message or - # sub-message is filtered by the API to only contain those fields as - # specified in the mask. For example, if the mask in the previous - # example is applied to a response message as follows: - # - # f { - # a : 22 - # b { - # d : 1 - # x : 2 - # } - # y : 13 - # } - # z: 8 - # - # The result will not contain specific values for fields x,y and z - # (their value will be set to the default, and omitted in proto text - # output): - # - # - # f { - # a : 22 - # b { - # d : 1 - # } - # } - # - # A repeated field is not allowed except at the last position of a - # paths string. - # - # If a FieldMask object is not present in a get operation, the - # operation applies to all fields (as if a FieldMask of all fields - # had been specified). - # - # Note that a field mask does not necessarily apply to the - # top-level response message. In case of a REST get operation, the - # field mask applies directly to the response, but in case of a REST - # list operation, the mask instead applies to each individual message - # in the returned resource list. In case of a REST custom method, - # other definitions may be used. Where the mask applies will be - # clearly documented together with its declaration in the API. In - # any case, the effect on the returned resource/resources is required - # behavior for APIs. - # - # # Field Masks in Update Operations - # - # A field mask in update operations specifies which fields of the - # targeted resource are going to be updated. The API is required - # to only change the values of the fields as specified in the mask - # and leave the others untouched. If a resource is passed in to - # describe the updated values, the API ignores the values of all - # fields not covered by the mask. - # - # If a repeated field is specified for an update operation, new values will - # be appended to the existing repeated field in the target resource. Note that - # a repeated field is only allowed in the last position of a `paths` string. - # - # If a sub-message is specified in the last position of the field mask for an - # update operation, then new value will be merged into the existing sub-message - # in the target resource. - # - # For example, given the target message: - # - # f { - # b { - # d: 1 - # x: 2 - # } - # c: [1] - # } - # - # And an update message: - # - # f { - # b { - # d: 10 - # } - # c: [2] - # } - # - # then if the field mask is: - # - # paths: ["f.b", "f.c"] - # - # then the result will be: - # - # f { - # b { - # d: 10 - # x: 2 - # } - # c: [1, 2] - # } - # - # An implementation may provide options to override this default behavior for - # repeated and message fields. - # - # In order to reset a field's value to the default, the field must - # be in the mask and set to the default value in the provided resource. - # Hence, in order to reset all fields of a resource, provide a default - # instance of the resource and set all fields in the mask, or do - # not provide a mask as described below. - # - # If a field mask is not present on update, the operation applies to - # all fields (as if a field mask of all fields has been specified). - # Note that in the presence of schema evolution, this may mean that - # fields the client does not know and has therefore not filled into - # the request will be reset to their default. If this is unwanted - # behavior, a specific service may require a client to always specify - # a field mask, producing an error if not. - # - # As with get operations, the location of the resource which - # describes the updated values in the request message depends on the - # operation kind. In any case, the effect of the field mask is - # required to be honored by the API. - # - # ## Considerations for HTTP REST - # - # The HTTP kind of an update operation which uses a field mask must - # be set to PATCH instead of PUT in order to satisfy HTTP semantics - # (PUT must only be used for full updates). - # - # # JSON Encoding of Field Masks - # - # In JSON, a field mask is encoded as a single string where paths are - # separated by a comma. Fields name in each path are converted - # to/from lower-camel naming conventions. - # - # As an example, consider the following message declarations: - # - # message Profile { - # User user = 1; - # Photo photo = 2; - # } - # message User { - # string display_name = 1; - # string address = 2; - # } - # - # In proto a field mask for `Profile` may look as such: - # - # mask { - # paths: "user.display_name" - # paths: "photo" - # } - # - # In JSON, the same mask is represented as below: - # - # { - # mask: "user.displayName,photo" - # } - # - # # Field Masks and Oneof Fields - # - # Field masks treat fields in oneofs just as regular fields. Consider the - # following message: - # - # message SampleMessage { - # oneof test_oneof { - # string name = 4; - # SubMessage sub_message = 9; - # } - # } - # - # The field mask can be: - # - # mask { - # paths: "name" - # } - # - # Or: - # - # mask { - # paths: "sub_message" - # } - # - # Note that oneof type names ("test_oneof" in this case) cannot be used in - # paths. - # - # ## Field Mask Verification - # - # The implementation of any API method which has a FieldMask type field in the - # request should verify the included field paths, and return an - # `INVALID_ARGUMENT` error if any path is unmappable. - # @!attribute [rw] paths - # @return [::Array<::String>] - # The set of field mask paths. - class FieldMask - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - end -end diff --git a/owl-bot-staging/google-cloud-security-private_ca-v1/proto_docs/google/protobuf/timestamp.rb b/owl-bot-staging/google-cloud-security-private_ca-v1/proto_docs/google/protobuf/timestamp.rb deleted file mode 100644 index 74352be9c58c..000000000000 --- a/owl-bot-staging/google-cloud-security-private_ca-v1/proto_docs/google/protobuf/timestamp.rb +++ /dev/null @@ -1,127 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - - -module Google - module Protobuf - # A Timestamp represents a point in time independent of any time zone or local - # calendar, encoded as a count of seconds and fractions of seconds at - # nanosecond resolution. The count is relative to an epoch at UTC midnight on - # January 1, 1970, in the proleptic Gregorian calendar which extends the - # Gregorian calendar backwards to year one. - # - # All minutes are 60 seconds long. Leap seconds are "smeared" so that no leap - # second table is needed for interpretation, using a [24-hour linear - # smear](https://developers.google.com/time/smear). - # - # The range is from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59.999999999Z. By - # restricting to that range, we ensure that we can convert to and from [RFC - # 3339](https://www.ietf.org/rfc/rfc3339.txt) date strings. - # - # # Examples - # - # Example 1: Compute Timestamp from POSIX `time()`. - # - # Timestamp timestamp; - # timestamp.set_seconds(time(NULL)); - # timestamp.set_nanos(0); - # - # Example 2: Compute Timestamp from POSIX `gettimeofday()`. - # - # struct timeval tv; - # gettimeofday(&tv, NULL); - # - # Timestamp timestamp; - # timestamp.set_seconds(tv.tv_sec); - # timestamp.set_nanos(tv.tv_usec * 1000); - # - # Example 3: Compute Timestamp from Win32 `GetSystemTimeAsFileTime()`. - # - # FILETIME ft; - # GetSystemTimeAsFileTime(&ft); - # UINT64 ticks = (((UINT64)ft.dwHighDateTime) << 32) | ft.dwLowDateTime; - # - # // A Windows tick is 100 nanoseconds. Windows epoch 1601-01-01T00:00:00Z - # // is 11644473600 seconds before Unix epoch 1970-01-01T00:00:00Z. - # Timestamp timestamp; - # timestamp.set_seconds((INT64) ((ticks / 10000000) - 11644473600LL)); - # timestamp.set_nanos((INT32) ((ticks % 10000000) * 100)); - # - # Example 4: Compute Timestamp from Java `System.currentTimeMillis()`. - # - # long millis = System.currentTimeMillis(); - # - # Timestamp timestamp = Timestamp.newBuilder().setSeconds(millis / 1000) - # .setNanos((int) ((millis % 1000) * 1000000)).build(); - # - # Example 5: Compute Timestamp from Java `Instant.now()`. - # - # Instant now = Instant.now(); - # - # Timestamp timestamp = - # Timestamp.newBuilder().setSeconds(now.getEpochSecond()) - # .setNanos(now.getNano()).build(); - # - # Example 6: Compute Timestamp from current time in Python. - # - # timestamp = Timestamp() - # timestamp.GetCurrentTime() - # - # # JSON Mapping - # - # In JSON format, the Timestamp type is encoded as a string in the - # [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format. That is, the - # format is "\\{year}-\\{month}-\\{day}T\\{hour}:\\{min}:\\{sec}[.\\{frac_sec}]Z" - # where \\{year} is always expressed using four digits while \\{month}, \\{day}, - # \\{hour}, \\{min}, and \\{sec} are zero-padded to two digits each. The fractional - # seconds, which can go up to 9 digits (i.e. up to 1 nanosecond resolution), - # are optional. The "Z" suffix indicates the timezone ("UTC"); the timezone - # is required. A proto3 JSON serializer should always use UTC (as indicated by - # "Z") when printing the Timestamp type and a proto3 JSON parser should be - # able to accept both UTC and other timezones (as indicated by an offset). - # - # For example, "2017-01-15T01:30:15.01Z" encodes 15.01 seconds past - # 01:30 UTC on January 15, 2017. - # - # In JavaScript, one can convert a Date object to this format using the - # standard - # [toISOString()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toISOString) - # method. In Python, a standard `datetime.datetime` object can be converted - # to this format using - # [`strftime`](https://docs.python.org/2/library/time.html#time.strftime) with - # the time format spec '%Y-%m-%dT%H:%M:%S.%fZ'. Likewise, in Java, one can use - # the Joda Time's [`ISODateTimeFormat.dateTime()`]( - # http://joda-time.sourceforge.net/apidocs/org/joda/time/format/ISODateTimeFormat.html#dateTime() - # ) to obtain a formatter capable of generating timestamps in this format. - # @!attribute [rw] seconds - # @return [::Integer] - # Represents seconds of UTC time since Unix epoch - # 1970-01-01T00:00:00Z. Must be from 0001-01-01T00:00:00Z to - # 9999-12-31T23:59:59Z inclusive. - # @!attribute [rw] nanos - # @return [::Integer] - # Non-negative fractions of a second at nanosecond resolution. Negative - # second values with fractions must still have non-negative nanos values - # that count forward in time. Must be from 0 to 999,999,999 - # inclusive. - class Timestamp - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - end -end diff --git a/owl-bot-staging/google-cloud-security-private_ca-v1/proto_docs/google/rpc/status.rb b/owl-bot-staging/google-cloud-security-private_ca-v1/proto_docs/google/rpc/status.rb deleted file mode 100644 index c1a1c07eb2db..000000000000 --- a/owl-bot-staging/google-cloud-security-private_ca-v1/proto_docs/google/rpc/status.rb +++ /dev/null @@ -1,48 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - - -module Google - module Rpc - # The `Status` type defines a logical error model that is suitable for - # different programming environments, including REST APIs and RPC APIs. It is - # used by [gRPC](https://github.com/grpc). Each `Status` message contains - # three pieces of data: error code, error message, and error details. - # - # You can find out more about this error model and how to work with it in the - # [API Design Guide](https://cloud.google.com/apis/design/errors). - # @!attribute [rw] code - # @return [::Integer] - # The status code, which should be an enum value of - # [google.rpc.Code][google.rpc.Code]. - # @!attribute [rw] message - # @return [::String] - # A developer-facing error message, which should be in English. Any - # user-facing error message should be localized and sent in the - # {::Google::Rpc::Status#details google.rpc.Status.details} field, or localized - # by the client. - # @!attribute [rw] details - # @return [::Array<::Google::Protobuf::Any>] - # A list of messages that carry the error details. There is a common set of - # message types for APIs to use. - class Status - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - end -end diff --git a/owl-bot-staging/google-cloud-security-private_ca-v1/proto_docs/google/type/expr.rb b/owl-bot-staging/google-cloud-security-private_ca-v1/proto_docs/google/type/expr.rb deleted file mode 100644 index 53e7733b6592..000000000000 --- a/owl-bot-staging/google-cloud-security-private_ca-v1/proto_docs/google/type/expr.rb +++ /dev/null @@ -1,75 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - - -module Google - module Type - # Represents a textual expression in the Common Expression Language (CEL) - # syntax. CEL is a C-like expression language. The syntax and semantics of CEL - # are documented at https://github.com/google/cel-spec. - # - # Example (Comparison): - # - # title: "Summary size limit" - # description: "Determines if a summary is less than 100 chars" - # expression: "document.summary.size() < 100" - # - # Example (Equality): - # - # title: "Requestor is owner" - # description: "Determines if requestor is the document owner" - # expression: "document.owner == request.auth.claims.email" - # - # Example (Logic): - # - # title: "Public documents" - # description: "Determine whether the document should be publicly visible" - # expression: "document.type != 'private' && document.type != 'internal'" - # - # Example (Data Manipulation): - # - # title: "Notification string" - # description: "Create a notification string with a timestamp." - # expression: "'New message received at ' + string(document.create_time)" - # - # The exact variables and functions that may be referenced within an expression - # are determined by the service that evaluates it. See the service - # documentation for additional information. - # @!attribute [rw] expression - # @return [::String] - # Textual representation of an expression in Common Expression Language - # syntax. - # @!attribute [rw] title - # @return [::String] - # Optional. Title for the expression, i.e. a short string describing - # its purpose. This can be used e.g. in UIs which allow to enter the - # expression. - # @!attribute [rw] description - # @return [::String] - # Optional. Description of the expression. This is a longer text which - # describes the expression, e.g. when hovered over it in a UI. - # @!attribute [rw] location - # @return [::String] - # Optional. String indicating the location of the expression for error - # reporting, e.g. a file name and a position in the file. - class Expr - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - end -end diff --git a/owl-bot-staging/google-cloud-security-private_ca-v1/snippets/Gemfile b/owl-bot-staging/google-cloud-security-private_ca-v1/snippets/Gemfile deleted file mode 100644 index 15d0144fd102..000000000000 --- a/owl-bot-staging/google-cloud-security-private_ca-v1/snippets/Gemfile +++ /dev/null @@ -1,32 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -source "https://rubygems.org" - -if ENV["GOOGLE_CLOUD_SAMPLES_TEST"] == "master" - gem "google-cloud-security-private_ca-v1", path: "../" -else - gem "google-cloud-security-private_ca-v1" -end - -group :test do - gem "google-style", "~> 1.26.1" - gem "minitest", "~> 5.16" - gem "minitest-focus", "~> 1.1" - gem "minitest-hooks", "~> 1.5" -end diff --git a/owl-bot-staging/google-cloud-security-private_ca-v1/snippets/certificate_authority_service/activate_certificate_authority.rb b/owl-bot-staging/google-cloud-security-private_ca-v1/snippets/certificate_authority_service/activate_certificate_authority.rb deleted file mode 100644 index 2ca2884e3cdb..000000000000 --- a/owl-bot-staging/google-cloud-security-private_ca-v1/snippets/certificate_authority_service/activate_certificate_authority.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 privateca_v1_generated_CertificateAuthorityService_ActivateCertificateAuthority_sync] -require "google/cloud/security/private_ca/v1" - -## -# Snippet for the activate_certificate_authority call in the CertificateAuthorityService service -# -# This snippet has been automatically generated and should be regarded as a code -# template only. It will require modifications to work: -# - It may require correct/in-range values for request initialization. -# - It may require specifying regional endpoints when creating the service -# client as shown in https://cloud.google.com/ruby/docs/reference. -# -# This is an auto-generated example demonstrating basic usage of -# Google::Cloud::Security::PrivateCA::V1::CertificateAuthorityService::Client#activate_certificate_authority. -# -def activate_certificate_authority - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::Security::PrivateCA::V1::CertificateAuthorityService::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::Security::PrivateCA::V1::ActivateCertificateAuthorityRequest.new - - # Call the activate_certificate_authority method. - result = client.activate_certificate_authority 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 privateca_v1_generated_CertificateAuthorityService_ActivateCertificateAuthority_sync] diff --git a/owl-bot-staging/google-cloud-security-private_ca-v1/snippets/certificate_authority_service/create_ca_pool.rb b/owl-bot-staging/google-cloud-security-private_ca-v1/snippets/certificate_authority_service/create_ca_pool.rb deleted file mode 100644 index 2086f329dd24..000000000000 --- a/owl-bot-staging/google-cloud-security-private_ca-v1/snippets/certificate_authority_service/create_ca_pool.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 privateca_v1_generated_CertificateAuthorityService_CreateCaPool_sync] -require "google/cloud/security/private_ca/v1" - -## -# Snippet for the create_ca_pool call in the CertificateAuthorityService service -# -# This snippet has been automatically generated and should be regarded as a code -# template only. It will require modifications to work: -# - It may require correct/in-range values for request initialization. -# - It may require specifying regional endpoints when creating the service -# client as shown in https://cloud.google.com/ruby/docs/reference. -# -# This is an auto-generated example demonstrating basic usage of -# Google::Cloud::Security::PrivateCA::V1::CertificateAuthorityService::Client#create_ca_pool. -# -def create_ca_pool - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::Security::PrivateCA::V1::CertificateAuthorityService::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::Security::PrivateCA::V1::CreateCaPoolRequest.new - - # Call the create_ca_pool method. - result = client.create_ca_pool 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 privateca_v1_generated_CertificateAuthorityService_CreateCaPool_sync] diff --git a/owl-bot-staging/google-cloud-security-private_ca-v1/snippets/certificate_authority_service/create_certificate.rb b/owl-bot-staging/google-cloud-security-private_ca-v1/snippets/certificate_authority_service/create_certificate.rb deleted file mode 100644 index 02ba1cd69a00..000000000000 --- a/owl-bot-staging/google-cloud-security-private_ca-v1/snippets/certificate_authority_service/create_certificate.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 privateca_v1_generated_CertificateAuthorityService_CreateCertificate_sync] -require "google/cloud/security/private_ca/v1" - -## -# Snippet for the create_certificate call in the CertificateAuthorityService service -# -# This snippet has been automatically generated and should be regarded as a code -# template only. It will require modifications to work: -# - It may require correct/in-range values for request initialization. -# - It may require specifying regional endpoints when creating the service -# client as shown in https://cloud.google.com/ruby/docs/reference. -# -# This is an auto-generated example demonstrating basic usage of -# Google::Cloud::Security::PrivateCA::V1::CertificateAuthorityService::Client#create_certificate. -# -def create_certificate - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::Security::PrivateCA::V1::CertificateAuthorityService::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::Security::PrivateCA::V1::CreateCertificateRequest.new - - # Call the create_certificate method. - result = client.create_certificate request - - # The returned object is of type Google::Cloud::Security::PrivateCA::V1::Certificate. - p result -end -# [END privateca_v1_generated_CertificateAuthorityService_CreateCertificate_sync] diff --git a/owl-bot-staging/google-cloud-security-private_ca-v1/snippets/certificate_authority_service/create_certificate_authority.rb b/owl-bot-staging/google-cloud-security-private_ca-v1/snippets/certificate_authority_service/create_certificate_authority.rb deleted file mode 100644 index 837bf4f5e52b..000000000000 --- a/owl-bot-staging/google-cloud-security-private_ca-v1/snippets/certificate_authority_service/create_certificate_authority.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 privateca_v1_generated_CertificateAuthorityService_CreateCertificateAuthority_sync] -require "google/cloud/security/private_ca/v1" - -## -# Snippet for the create_certificate_authority call in the CertificateAuthorityService service -# -# This snippet has been automatically generated and should be regarded as a code -# template only. It will require modifications to work: -# - It may require correct/in-range values for request initialization. -# - It may require specifying regional endpoints when creating the service -# client as shown in https://cloud.google.com/ruby/docs/reference. -# -# This is an auto-generated example demonstrating basic usage of -# Google::Cloud::Security::PrivateCA::V1::CertificateAuthorityService::Client#create_certificate_authority. -# -def create_certificate_authority - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::Security::PrivateCA::V1::CertificateAuthorityService::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::Security::PrivateCA::V1::CreateCertificateAuthorityRequest.new - - # Call the create_certificate_authority method. - result = client.create_certificate_authority 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 privateca_v1_generated_CertificateAuthorityService_CreateCertificateAuthority_sync] diff --git a/owl-bot-staging/google-cloud-security-private_ca-v1/snippets/certificate_authority_service/create_certificate_template.rb b/owl-bot-staging/google-cloud-security-private_ca-v1/snippets/certificate_authority_service/create_certificate_template.rb deleted file mode 100644 index 04864381efcf..000000000000 --- a/owl-bot-staging/google-cloud-security-private_ca-v1/snippets/certificate_authority_service/create_certificate_template.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 privateca_v1_generated_CertificateAuthorityService_CreateCertificateTemplate_sync] -require "google/cloud/security/private_ca/v1" - -## -# Snippet for the create_certificate_template call in the CertificateAuthorityService service -# -# This snippet has been automatically generated and should be regarded as a code -# template only. It will require modifications to work: -# - It may require correct/in-range values for request initialization. -# - It may require specifying regional endpoints when creating the service -# client as shown in https://cloud.google.com/ruby/docs/reference. -# -# This is an auto-generated example demonstrating basic usage of -# Google::Cloud::Security::PrivateCA::V1::CertificateAuthorityService::Client#create_certificate_template. -# -def create_certificate_template - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::Security::PrivateCA::V1::CertificateAuthorityService::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::Security::PrivateCA::V1::CreateCertificateTemplateRequest.new - - # Call the create_certificate_template method. - result = client.create_certificate_template 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 privateca_v1_generated_CertificateAuthorityService_CreateCertificateTemplate_sync] diff --git a/owl-bot-staging/google-cloud-security-private_ca-v1/snippets/certificate_authority_service/delete_ca_pool.rb b/owl-bot-staging/google-cloud-security-private_ca-v1/snippets/certificate_authority_service/delete_ca_pool.rb deleted file mode 100644 index d83ae4819dc9..000000000000 --- a/owl-bot-staging/google-cloud-security-private_ca-v1/snippets/certificate_authority_service/delete_ca_pool.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 privateca_v1_generated_CertificateAuthorityService_DeleteCaPool_sync] -require "google/cloud/security/private_ca/v1" - -## -# Snippet for the delete_ca_pool call in the CertificateAuthorityService service -# -# This snippet has been automatically generated and should be regarded as a code -# template only. It will require modifications to work: -# - It may require correct/in-range values for request initialization. -# - It may require specifying regional endpoints when creating the service -# client as shown in https://cloud.google.com/ruby/docs/reference. -# -# This is an auto-generated example demonstrating basic usage of -# Google::Cloud::Security::PrivateCA::V1::CertificateAuthorityService::Client#delete_ca_pool. -# -def delete_ca_pool - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::Security::PrivateCA::V1::CertificateAuthorityService::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::Security::PrivateCA::V1::DeleteCaPoolRequest.new - - # Call the delete_ca_pool method. - result = client.delete_ca_pool 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 privateca_v1_generated_CertificateAuthorityService_DeleteCaPool_sync] diff --git a/owl-bot-staging/google-cloud-security-private_ca-v1/snippets/certificate_authority_service/delete_certificate_authority.rb b/owl-bot-staging/google-cloud-security-private_ca-v1/snippets/certificate_authority_service/delete_certificate_authority.rb deleted file mode 100644 index 25db9c72707e..000000000000 --- a/owl-bot-staging/google-cloud-security-private_ca-v1/snippets/certificate_authority_service/delete_certificate_authority.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 privateca_v1_generated_CertificateAuthorityService_DeleteCertificateAuthority_sync] -require "google/cloud/security/private_ca/v1" - -## -# Snippet for the delete_certificate_authority call in the CertificateAuthorityService service -# -# This snippet has been automatically generated and should be regarded as a code -# template only. It will require modifications to work: -# - It may require correct/in-range values for request initialization. -# - It may require specifying regional endpoints when creating the service -# client as shown in https://cloud.google.com/ruby/docs/reference. -# -# This is an auto-generated example demonstrating basic usage of -# Google::Cloud::Security::PrivateCA::V1::CertificateAuthorityService::Client#delete_certificate_authority. -# -def delete_certificate_authority - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::Security::PrivateCA::V1::CertificateAuthorityService::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::Security::PrivateCA::V1::DeleteCertificateAuthorityRequest.new - - # Call the delete_certificate_authority method. - result = client.delete_certificate_authority 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 privateca_v1_generated_CertificateAuthorityService_DeleteCertificateAuthority_sync] diff --git a/owl-bot-staging/google-cloud-security-private_ca-v1/snippets/certificate_authority_service/delete_certificate_template.rb b/owl-bot-staging/google-cloud-security-private_ca-v1/snippets/certificate_authority_service/delete_certificate_template.rb deleted file mode 100644 index ffd2b9603f86..000000000000 --- a/owl-bot-staging/google-cloud-security-private_ca-v1/snippets/certificate_authority_service/delete_certificate_template.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 privateca_v1_generated_CertificateAuthorityService_DeleteCertificateTemplate_sync] -require "google/cloud/security/private_ca/v1" - -## -# Snippet for the delete_certificate_template call in the CertificateAuthorityService service -# -# This snippet has been automatically generated and should be regarded as a code -# template only. It will require modifications to work: -# - It may require correct/in-range values for request initialization. -# - It may require specifying regional endpoints when creating the service -# client as shown in https://cloud.google.com/ruby/docs/reference. -# -# This is an auto-generated example demonstrating basic usage of -# Google::Cloud::Security::PrivateCA::V1::CertificateAuthorityService::Client#delete_certificate_template. -# -def delete_certificate_template - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::Security::PrivateCA::V1::CertificateAuthorityService::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::Security::PrivateCA::V1::DeleteCertificateTemplateRequest.new - - # Call the delete_certificate_template method. - result = client.delete_certificate_template 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 privateca_v1_generated_CertificateAuthorityService_DeleteCertificateTemplate_sync] diff --git a/owl-bot-staging/google-cloud-security-private_ca-v1/snippets/certificate_authority_service/disable_certificate_authority.rb b/owl-bot-staging/google-cloud-security-private_ca-v1/snippets/certificate_authority_service/disable_certificate_authority.rb deleted file mode 100644 index cf6fffe863ae..000000000000 --- a/owl-bot-staging/google-cloud-security-private_ca-v1/snippets/certificate_authority_service/disable_certificate_authority.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 privateca_v1_generated_CertificateAuthorityService_DisableCertificateAuthority_sync] -require "google/cloud/security/private_ca/v1" - -## -# Snippet for the disable_certificate_authority call in the CertificateAuthorityService service -# -# This snippet has been automatically generated and should be regarded as a code -# template only. It will require modifications to work: -# - It may require correct/in-range values for request initialization. -# - It may require specifying regional endpoints when creating the service -# client as shown in https://cloud.google.com/ruby/docs/reference. -# -# This is an auto-generated example demonstrating basic usage of -# Google::Cloud::Security::PrivateCA::V1::CertificateAuthorityService::Client#disable_certificate_authority. -# -def disable_certificate_authority - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::Security::PrivateCA::V1::CertificateAuthorityService::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::Security::PrivateCA::V1::DisableCertificateAuthorityRequest.new - - # Call the disable_certificate_authority method. - result = client.disable_certificate_authority 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 privateca_v1_generated_CertificateAuthorityService_DisableCertificateAuthority_sync] diff --git a/owl-bot-staging/google-cloud-security-private_ca-v1/snippets/certificate_authority_service/enable_certificate_authority.rb b/owl-bot-staging/google-cloud-security-private_ca-v1/snippets/certificate_authority_service/enable_certificate_authority.rb deleted file mode 100644 index 66ab672c075a..000000000000 --- a/owl-bot-staging/google-cloud-security-private_ca-v1/snippets/certificate_authority_service/enable_certificate_authority.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 privateca_v1_generated_CertificateAuthorityService_EnableCertificateAuthority_sync] -require "google/cloud/security/private_ca/v1" - -## -# Snippet for the enable_certificate_authority call in the CertificateAuthorityService service -# -# This snippet has been automatically generated and should be regarded as a code -# template only. It will require modifications to work: -# - It may require correct/in-range values for request initialization. -# - It may require specifying regional endpoints when creating the service -# client as shown in https://cloud.google.com/ruby/docs/reference. -# -# This is an auto-generated example demonstrating basic usage of -# Google::Cloud::Security::PrivateCA::V1::CertificateAuthorityService::Client#enable_certificate_authority. -# -def enable_certificate_authority - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::Security::PrivateCA::V1::CertificateAuthorityService::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::Security::PrivateCA::V1::EnableCertificateAuthorityRequest.new - - # Call the enable_certificate_authority method. - result = client.enable_certificate_authority 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 privateca_v1_generated_CertificateAuthorityService_EnableCertificateAuthority_sync] diff --git a/owl-bot-staging/google-cloud-security-private_ca-v1/snippets/certificate_authority_service/fetch_ca_certs.rb b/owl-bot-staging/google-cloud-security-private_ca-v1/snippets/certificate_authority_service/fetch_ca_certs.rb deleted file mode 100644 index 939e386615d0..000000000000 --- a/owl-bot-staging/google-cloud-security-private_ca-v1/snippets/certificate_authority_service/fetch_ca_certs.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 privateca_v1_generated_CertificateAuthorityService_FetchCaCerts_sync] -require "google/cloud/security/private_ca/v1" - -## -# Snippet for the fetch_ca_certs call in the CertificateAuthorityService service -# -# This snippet has been automatically generated and should be regarded as a code -# template only. It will require modifications to work: -# - It may require correct/in-range values for request initialization. -# - It may require specifying regional endpoints when creating the service -# client as shown in https://cloud.google.com/ruby/docs/reference. -# -# This is an auto-generated example demonstrating basic usage of -# Google::Cloud::Security::PrivateCA::V1::CertificateAuthorityService::Client#fetch_ca_certs. -# -def fetch_ca_certs - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::Security::PrivateCA::V1::CertificateAuthorityService::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::Security::PrivateCA::V1::FetchCaCertsRequest.new - - # Call the fetch_ca_certs method. - result = client.fetch_ca_certs request - - # The returned object is of type Google::Cloud::Security::PrivateCA::V1::FetchCaCertsResponse. - p result -end -# [END privateca_v1_generated_CertificateAuthorityService_FetchCaCerts_sync] diff --git a/owl-bot-staging/google-cloud-security-private_ca-v1/snippets/certificate_authority_service/fetch_certificate_authority_csr.rb b/owl-bot-staging/google-cloud-security-private_ca-v1/snippets/certificate_authority_service/fetch_certificate_authority_csr.rb deleted file mode 100644 index f51e0bff99ab..000000000000 --- a/owl-bot-staging/google-cloud-security-private_ca-v1/snippets/certificate_authority_service/fetch_certificate_authority_csr.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 privateca_v1_generated_CertificateAuthorityService_FetchCertificateAuthorityCsr_sync] -require "google/cloud/security/private_ca/v1" - -## -# Snippet for the fetch_certificate_authority_csr call in the CertificateAuthorityService service -# -# This snippet has been automatically generated and should be regarded as a code -# template only. It will require modifications to work: -# - It may require correct/in-range values for request initialization. -# - It may require specifying regional endpoints when creating the service -# client as shown in https://cloud.google.com/ruby/docs/reference. -# -# This is an auto-generated example demonstrating basic usage of -# Google::Cloud::Security::PrivateCA::V1::CertificateAuthorityService::Client#fetch_certificate_authority_csr. -# -def fetch_certificate_authority_csr - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::Security::PrivateCA::V1::CertificateAuthorityService::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::Security::PrivateCA::V1::FetchCertificateAuthorityCsrRequest.new - - # Call the fetch_certificate_authority_csr method. - result = client.fetch_certificate_authority_csr request - - # The returned object is of type Google::Cloud::Security::PrivateCA::V1::FetchCertificateAuthorityCsrResponse. - p result -end -# [END privateca_v1_generated_CertificateAuthorityService_FetchCertificateAuthorityCsr_sync] diff --git a/owl-bot-staging/google-cloud-security-private_ca-v1/snippets/certificate_authority_service/get_ca_pool.rb b/owl-bot-staging/google-cloud-security-private_ca-v1/snippets/certificate_authority_service/get_ca_pool.rb deleted file mode 100644 index c82b3ce69063..000000000000 --- a/owl-bot-staging/google-cloud-security-private_ca-v1/snippets/certificate_authority_service/get_ca_pool.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 privateca_v1_generated_CertificateAuthorityService_GetCaPool_sync] -require "google/cloud/security/private_ca/v1" - -## -# Snippet for the get_ca_pool call in the CertificateAuthorityService service -# -# This snippet has been automatically generated and should be regarded as a code -# template only. It will require modifications to work: -# - It may require correct/in-range values for request initialization. -# - It may require specifying regional endpoints when creating the service -# client as shown in https://cloud.google.com/ruby/docs/reference. -# -# This is an auto-generated example demonstrating basic usage of -# Google::Cloud::Security::PrivateCA::V1::CertificateAuthorityService::Client#get_ca_pool. -# -def get_ca_pool - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::Security::PrivateCA::V1::CertificateAuthorityService::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::Security::PrivateCA::V1::GetCaPoolRequest.new - - # Call the get_ca_pool method. - result = client.get_ca_pool request - - # The returned object is of type Google::Cloud::Security::PrivateCA::V1::CaPool. - p result -end -# [END privateca_v1_generated_CertificateAuthorityService_GetCaPool_sync] diff --git a/owl-bot-staging/google-cloud-security-private_ca-v1/snippets/certificate_authority_service/get_certificate.rb b/owl-bot-staging/google-cloud-security-private_ca-v1/snippets/certificate_authority_service/get_certificate.rb deleted file mode 100644 index ce87f3b91296..000000000000 --- a/owl-bot-staging/google-cloud-security-private_ca-v1/snippets/certificate_authority_service/get_certificate.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 privateca_v1_generated_CertificateAuthorityService_GetCertificate_sync] -require "google/cloud/security/private_ca/v1" - -## -# Snippet for the get_certificate call in the CertificateAuthorityService service -# -# This snippet has been automatically generated and should be regarded as a code -# template only. It will require modifications to work: -# - It may require correct/in-range values for request initialization. -# - It may require specifying regional endpoints when creating the service -# client as shown in https://cloud.google.com/ruby/docs/reference. -# -# This is an auto-generated example demonstrating basic usage of -# Google::Cloud::Security::PrivateCA::V1::CertificateAuthorityService::Client#get_certificate. -# -def get_certificate - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::Security::PrivateCA::V1::CertificateAuthorityService::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::Security::PrivateCA::V1::GetCertificateRequest.new - - # Call the get_certificate method. - result = client.get_certificate request - - # The returned object is of type Google::Cloud::Security::PrivateCA::V1::Certificate. - p result -end -# [END privateca_v1_generated_CertificateAuthorityService_GetCertificate_sync] diff --git a/owl-bot-staging/google-cloud-security-private_ca-v1/snippets/certificate_authority_service/get_certificate_authority.rb b/owl-bot-staging/google-cloud-security-private_ca-v1/snippets/certificate_authority_service/get_certificate_authority.rb deleted file mode 100644 index 0fb13b1d62ac..000000000000 --- a/owl-bot-staging/google-cloud-security-private_ca-v1/snippets/certificate_authority_service/get_certificate_authority.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 privateca_v1_generated_CertificateAuthorityService_GetCertificateAuthority_sync] -require "google/cloud/security/private_ca/v1" - -## -# Snippet for the get_certificate_authority call in the CertificateAuthorityService service -# -# This snippet has been automatically generated and should be regarded as a code -# template only. It will require modifications to work: -# - It may require correct/in-range values for request initialization. -# - It may require specifying regional endpoints when creating the service -# client as shown in https://cloud.google.com/ruby/docs/reference. -# -# This is an auto-generated example demonstrating basic usage of -# Google::Cloud::Security::PrivateCA::V1::CertificateAuthorityService::Client#get_certificate_authority. -# -def get_certificate_authority - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::Security::PrivateCA::V1::CertificateAuthorityService::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::Security::PrivateCA::V1::GetCertificateAuthorityRequest.new - - # Call the get_certificate_authority method. - result = client.get_certificate_authority request - - # The returned object is of type Google::Cloud::Security::PrivateCA::V1::CertificateAuthority. - p result -end -# [END privateca_v1_generated_CertificateAuthorityService_GetCertificateAuthority_sync] diff --git a/owl-bot-staging/google-cloud-security-private_ca-v1/snippets/certificate_authority_service/get_certificate_revocation_list.rb b/owl-bot-staging/google-cloud-security-private_ca-v1/snippets/certificate_authority_service/get_certificate_revocation_list.rb deleted file mode 100644 index e840b4be9acc..000000000000 --- a/owl-bot-staging/google-cloud-security-private_ca-v1/snippets/certificate_authority_service/get_certificate_revocation_list.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 privateca_v1_generated_CertificateAuthorityService_GetCertificateRevocationList_sync] -require "google/cloud/security/private_ca/v1" - -## -# Snippet for the get_certificate_revocation_list call in the CertificateAuthorityService service -# -# This snippet has been automatically generated and should be regarded as a code -# template only. It will require modifications to work: -# - It may require correct/in-range values for request initialization. -# - It may require specifying regional endpoints when creating the service -# client as shown in https://cloud.google.com/ruby/docs/reference. -# -# This is an auto-generated example demonstrating basic usage of -# Google::Cloud::Security::PrivateCA::V1::CertificateAuthorityService::Client#get_certificate_revocation_list. -# -def get_certificate_revocation_list - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::Security::PrivateCA::V1::CertificateAuthorityService::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::Security::PrivateCA::V1::GetCertificateRevocationListRequest.new - - # Call the get_certificate_revocation_list method. - result = client.get_certificate_revocation_list request - - # The returned object is of type Google::Cloud::Security::PrivateCA::V1::CertificateRevocationList. - p result -end -# [END privateca_v1_generated_CertificateAuthorityService_GetCertificateRevocationList_sync] diff --git a/owl-bot-staging/google-cloud-security-private_ca-v1/snippets/certificate_authority_service/get_certificate_template.rb b/owl-bot-staging/google-cloud-security-private_ca-v1/snippets/certificate_authority_service/get_certificate_template.rb deleted file mode 100644 index d084f7fa5d49..000000000000 --- a/owl-bot-staging/google-cloud-security-private_ca-v1/snippets/certificate_authority_service/get_certificate_template.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 privateca_v1_generated_CertificateAuthorityService_GetCertificateTemplate_sync] -require "google/cloud/security/private_ca/v1" - -## -# Snippet for the get_certificate_template call in the CertificateAuthorityService service -# -# This snippet has been automatically generated and should be regarded as a code -# template only. It will require modifications to work: -# - It may require correct/in-range values for request initialization. -# - It may require specifying regional endpoints when creating the service -# client as shown in https://cloud.google.com/ruby/docs/reference. -# -# This is an auto-generated example demonstrating basic usage of -# Google::Cloud::Security::PrivateCA::V1::CertificateAuthorityService::Client#get_certificate_template. -# -def get_certificate_template - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::Security::PrivateCA::V1::CertificateAuthorityService::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::Security::PrivateCA::V1::GetCertificateTemplateRequest.new - - # Call the get_certificate_template method. - result = client.get_certificate_template request - - # The returned object is of type Google::Cloud::Security::PrivateCA::V1::CertificateTemplate. - p result -end -# [END privateca_v1_generated_CertificateAuthorityService_GetCertificateTemplate_sync] diff --git a/owl-bot-staging/google-cloud-security-private_ca-v1/snippets/certificate_authority_service/list_ca_pools.rb b/owl-bot-staging/google-cloud-security-private_ca-v1/snippets/certificate_authority_service/list_ca_pools.rb deleted file mode 100644 index 0de634246136..000000000000 --- a/owl-bot-staging/google-cloud-security-private_ca-v1/snippets/certificate_authority_service/list_ca_pools.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 privateca_v1_generated_CertificateAuthorityService_ListCaPools_sync] -require "google/cloud/security/private_ca/v1" - -## -# Snippet for the list_ca_pools call in the CertificateAuthorityService service -# -# This snippet has been automatically generated and should be regarded as a code -# template only. It will require modifications to work: -# - It may require correct/in-range values for request initialization. -# - It may require specifying regional endpoints when creating the service -# client as shown in https://cloud.google.com/ruby/docs/reference. -# -# This is an auto-generated example demonstrating basic usage of -# Google::Cloud::Security::PrivateCA::V1::CertificateAuthorityService::Client#list_ca_pools. -# -def list_ca_pools - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::Security::PrivateCA::V1::CertificateAuthorityService::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::Security::PrivateCA::V1::ListCaPoolsRequest.new - - # Call the list_ca_pools method. - result = client.list_ca_pools request - - # The returned object is of type Gapic::PagedEnumerable. You can iterate - # over elements, and API calls will be issued to fetch pages as needed. - result.each do |item| - # Each element is of type ::Google::Cloud::Security::PrivateCA::V1::CaPool. - p item - end -end -# [END privateca_v1_generated_CertificateAuthorityService_ListCaPools_sync] diff --git a/owl-bot-staging/google-cloud-security-private_ca-v1/snippets/certificate_authority_service/list_certificate_authorities.rb b/owl-bot-staging/google-cloud-security-private_ca-v1/snippets/certificate_authority_service/list_certificate_authorities.rb deleted file mode 100644 index c2e06a669891..000000000000 --- a/owl-bot-staging/google-cloud-security-private_ca-v1/snippets/certificate_authority_service/list_certificate_authorities.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 privateca_v1_generated_CertificateAuthorityService_ListCertificateAuthorities_sync] -require "google/cloud/security/private_ca/v1" - -## -# Snippet for the list_certificate_authorities call in the CertificateAuthorityService service -# -# This snippet has been automatically generated and should be regarded as a code -# template only. It will require modifications to work: -# - It may require correct/in-range values for request initialization. -# - It may require specifying regional endpoints when creating the service -# client as shown in https://cloud.google.com/ruby/docs/reference. -# -# This is an auto-generated example demonstrating basic usage of -# Google::Cloud::Security::PrivateCA::V1::CertificateAuthorityService::Client#list_certificate_authorities. -# -def list_certificate_authorities - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::Security::PrivateCA::V1::CertificateAuthorityService::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::Security::PrivateCA::V1::ListCertificateAuthoritiesRequest.new - - # Call the list_certificate_authorities method. - result = client.list_certificate_authorities request - - # The returned object is of type Gapic::PagedEnumerable. You can iterate - # over elements, and API calls will be issued to fetch pages as needed. - result.each do |item| - # Each element is of type ::Google::Cloud::Security::PrivateCA::V1::CertificateAuthority. - p item - end -end -# [END privateca_v1_generated_CertificateAuthorityService_ListCertificateAuthorities_sync] diff --git a/owl-bot-staging/google-cloud-security-private_ca-v1/snippets/certificate_authority_service/list_certificate_revocation_lists.rb b/owl-bot-staging/google-cloud-security-private_ca-v1/snippets/certificate_authority_service/list_certificate_revocation_lists.rb deleted file mode 100644 index 32d72bf58c5c..000000000000 --- a/owl-bot-staging/google-cloud-security-private_ca-v1/snippets/certificate_authority_service/list_certificate_revocation_lists.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 privateca_v1_generated_CertificateAuthorityService_ListCertificateRevocationLists_sync] -require "google/cloud/security/private_ca/v1" - -## -# Snippet for the list_certificate_revocation_lists call in the CertificateAuthorityService service -# -# This snippet has been automatically generated and should be regarded as a code -# template only. It will require modifications to work: -# - It may require correct/in-range values for request initialization. -# - It may require specifying regional endpoints when creating the service -# client as shown in https://cloud.google.com/ruby/docs/reference. -# -# This is an auto-generated example demonstrating basic usage of -# Google::Cloud::Security::PrivateCA::V1::CertificateAuthorityService::Client#list_certificate_revocation_lists. -# -def list_certificate_revocation_lists - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::Security::PrivateCA::V1::CertificateAuthorityService::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::Security::PrivateCA::V1::ListCertificateRevocationListsRequest.new - - # Call the list_certificate_revocation_lists method. - result = client.list_certificate_revocation_lists request - - # The returned object is of type Gapic::PagedEnumerable. You can iterate - # over elements, and API calls will be issued to fetch pages as needed. - result.each do |item| - # Each element is of type ::Google::Cloud::Security::PrivateCA::V1::CertificateRevocationList. - p item - end -end -# [END privateca_v1_generated_CertificateAuthorityService_ListCertificateRevocationLists_sync] diff --git a/owl-bot-staging/google-cloud-security-private_ca-v1/snippets/certificate_authority_service/list_certificate_templates.rb b/owl-bot-staging/google-cloud-security-private_ca-v1/snippets/certificate_authority_service/list_certificate_templates.rb deleted file mode 100644 index 269ed16695f8..000000000000 --- a/owl-bot-staging/google-cloud-security-private_ca-v1/snippets/certificate_authority_service/list_certificate_templates.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 privateca_v1_generated_CertificateAuthorityService_ListCertificateTemplates_sync] -require "google/cloud/security/private_ca/v1" - -## -# Snippet for the list_certificate_templates call in the CertificateAuthorityService service -# -# This snippet has been automatically generated and should be regarded as a code -# template only. It will require modifications to work: -# - It may require correct/in-range values for request initialization. -# - It may require specifying regional endpoints when creating the service -# client as shown in https://cloud.google.com/ruby/docs/reference. -# -# This is an auto-generated example demonstrating basic usage of -# Google::Cloud::Security::PrivateCA::V1::CertificateAuthorityService::Client#list_certificate_templates. -# -def list_certificate_templates - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::Security::PrivateCA::V1::CertificateAuthorityService::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::Security::PrivateCA::V1::ListCertificateTemplatesRequest.new - - # Call the list_certificate_templates method. - result = client.list_certificate_templates request - - # The returned object is of type Gapic::PagedEnumerable. You can iterate - # over elements, and API calls will be issued to fetch pages as needed. - result.each do |item| - # Each element is of type ::Google::Cloud::Security::PrivateCA::V1::CertificateTemplate. - p item - end -end -# [END privateca_v1_generated_CertificateAuthorityService_ListCertificateTemplates_sync] diff --git a/owl-bot-staging/google-cloud-security-private_ca-v1/snippets/certificate_authority_service/list_certificates.rb b/owl-bot-staging/google-cloud-security-private_ca-v1/snippets/certificate_authority_service/list_certificates.rb deleted file mode 100644 index dfdcae76c14f..000000000000 --- a/owl-bot-staging/google-cloud-security-private_ca-v1/snippets/certificate_authority_service/list_certificates.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 privateca_v1_generated_CertificateAuthorityService_ListCertificates_sync] -require "google/cloud/security/private_ca/v1" - -## -# Snippet for the list_certificates call in the CertificateAuthorityService service -# -# This snippet has been automatically generated and should be regarded as a code -# template only. It will require modifications to work: -# - It may require correct/in-range values for request initialization. -# - It may require specifying regional endpoints when creating the service -# client as shown in https://cloud.google.com/ruby/docs/reference. -# -# This is an auto-generated example demonstrating basic usage of -# Google::Cloud::Security::PrivateCA::V1::CertificateAuthorityService::Client#list_certificates. -# -def list_certificates - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::Security::PrivateCA::V1::CertificateAuthorityService::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::Security::PrivateCA::V1::ListCertificatesRequest.new - - # Call the list_certificates method. - result = client.list_certificates request - - # The returned object is of type Gapic::PagedEnumerable. You can iterate - # over elements, and API calls will be issued to fetch pages as needed. - result.each do |item| - # Each element is of type ::Google::Cloud::Security::PrivateCA::V1::Certificate. - p item - end -end -# [END privateca_v1_generated_CertificateAuthorityService_ListCertificates_sync] diff --git a/owl-bot-staging/google-cloud-security-private_ca-v1/snippets/certificate_authority_service/revoke_certificate.rb b/owl-bot-staging/google-cloud-security-private_ca-v1/snippets/certificate_authority_service/revoke_certificate.rb deleted file mode 100644 index 85e6363d58ac..000000000000 --- a/owl-bot-staging/google-cloud-security-private_ca-v1/snippets/certificate_authority_service/revoke_certificate.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 privateca_v1_generated_CertificateAuthorityService_RevokeCertificate_sync] -require "google/cloud/security/private_ca/v1" - -## -# Snippet for the revoke_certificate call in the CertificateAuthorityService service -# -# This snippet has been automatically generated and should be regarded as a code -# template only. It will require modifications to work: -# - It may require correct/in-range values for request initialization. -# - It may require specifying regional endpoints when creating the service -# client as shown in https://cloud.google.com/ruby/docs/reference. -# -# This is an auto-generated example demonstrating basic usage of -# Google::Cloud::Security::PrivateCA::V1::CertificateAuthorityService::Client#revoke_certificate. -# -def revoke_certificate - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::Security::PrivateCA::V1::CertificateAuthorityService::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::Security::PrivateCA::V1::RevokeCertificateRequest.new - - # Call the revoke_certificate method. - result = client.revoke_certificate request - - # The returned object is of type Google::Cloud::Security::PrivateCA::V1::Certificate. - p result -end -# [END privateca_v1_generated_CertificateAuthorityService_RevokeCertificate_sync] diff --git a/owl-bot-staging/google-cloud-security-private_ca-v1/snippets/certificate_authority_service/undelete_certificate_authority.rb b/owl-bot-staging/google-cloud-security-private_ca-v1/snippets/certificate_authority_service/undelete_certificate_authority.rb deleted file mode 100644 index 0aaba870e26d..000000000000 --- a/owl-bot-staging/google-cloud-security-private_ca-v1/snippets/certificate_authority_service/undelete_certificate_authority.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 privateca_v1_generated_CertificateAuthorityService_UndeleteCertificateAuthority_sync] -require "google/cloud/security/private_ca/v1" - -## -# Snippet for the undelete_certificate_authority call in the CertificateAuthorityService service -# -# This snippet has been automatically generated and should be regarded as a code -# template only. It will require modifications to work: -# - It may require correct/in-range values for request initialization. -# - It may require specifying regional endpoints when creating the service -# client as shown in https://cloud.google.com/ruby/docs/reference. -# -# This is an auto-generated example demonstrating basic usage of -# Google::Cloud::Security::PrivateCA::V1::CertificateAuthorityService::Client#undelete_certificate_authority. -# -def undelete_certificate_authority - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::Security::PrivateCA::V1::CertificateAuthorityService::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::Security::PrivateCA::V1::UndeleteCertificateAuthorityRequest.new - - # Call the undelete_certificate_authority method. - result = client.undelete_certificate_authority 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 privateca_v1_generated_CertificateAuthorityService_UndeleteCertificateAuthority_sync] diff --git a/owl-bot-staging/google-cloud-security-private_ca-v1/snippets/certificate_authority_service/update_ca_pool.rb b/owl-bot-staging/google-cloud-security-private_ca-v1/snippets/certificate_authority_service/update_ca_pool.rb deleted file mode 100644 index ff687e1efbc2..000000000000 --- a/owl-bot-staging/google-cloud-security-private_ca-v1/snippets/certificate_authority_service/update_ca_pool.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 privateca_v1_generated_CertificateAuthorityService_UpdateCaPool_sync] -require "google/cloud/security/private_ca/v1" - -## -# Snippet for the update_ca_pool call in the CertificateAuthorityService service -# -# This snippet has been automatically generated and should be regarded as a code -# template only. It will require modifications to work: -# - It may require correct/in-range values for request initialization. -# - It may require specifying regional endpoints when creating the service -# client as shown in https://cloud.google.com/ruby/docs/reference. -# -# This is an auto-generated example demonstrating basic usage of -# Google::Cloud::Security::PrivateCA::V1::CertificateAuthorityService::Client#update_ca_pool. -# -def update_ca_pool - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::Security::PrivateCA::V1::CertificateAuthorityService::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::Security::PrivateCA::V1::UpdateCaPoolRequest.new - - # Call the update_ca_pool method. - result = client.update_ca_pool 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 privateca_v1_generated_CertificateAuthorityService_UpdateCaPool_sync] diff --git a/owl-bot-staging/google-cloud-security-private_ca-v1/snippets/certificate_authority_service/update_certificate.rb b/owl-bot-staging/google-cloud-security-private_ca-v1/snippets/certificate_authority_service/update_certificate.rb deleted file mode 100644 index 82e041db102b..000000000000 --- a/owl-bot-staging/google-cloud-security-private_ca-v1/snippets/certificate_authority_service/update_certificate.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 privateca_v1_generated_CertificateAuthorityService_UpdateCertificate_sync] -require "google/cloud/security/private_ca/v1" - -## -# Snippet for the update_certificate call in the CertificateAuthorityService service -# -# This snippet has been automatically generated and should be regarded as a code -# template only. It will require modifications to work: -# - It may require correct/in-range values for request initialization. -# - It may require specifying regional endpoints when creating the service -# client as shown in https://cloud.google.com/ruby/docs/reference. -# -# This is an auto-generated example demonstrating basic usage of -# Google::Cloud::Security::PrivateCA::V1::CertificateAuthorityService::Client#update_certificate. -# -def update_certificate - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::Security::PrivateCA::V1::CertificateAuthorityService::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::Security::PrivateCA::V1::UpdateCertificateRequest.new - - # Call the update_certificate method. - result = client.update_certificate request - - # The returned object is of type Google::Cloud::Security::PrivateCA::V1::Certificate. - p result -end -# [END privateca_v1_generated_CertificateAuthorityService_UpdateCertificate_sync] diff --git a/owl-bot-staging/google-cloud-security-private_ca-v1/snippets/certificate_authority_service/update_certificate_authority.rb b/owl-bot-staging/google-cloud-security-private_ca-v1/snippets/certificate_authority_service/update_certificate_authority.rb deleted file mode 100644 index 4f4aacbc82f0..000000000000 --- a/owl-bot-staging/google-cloud-security-private_ca-v1/snippets/certificate_authority_service/update_certificate_authority.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 privateca_v1_generated_CertificateAuthorityService_UpdateCertificateAuthority_sync] -require "google/cloud/security/private_ca/v1" - -## -# Snippet for the update_certificate_authority call in the CertificateAuthorityService service -# -# This snippet has been automatically generated and should be regarded as a code -# template only. It will require modifications to work: -# - It may require correct/in-range values for request initialization. -# - It may require specifying regional endpoints when creating the service -# client as shown in https://cloud.google.com/ruby/docs/reference. -# -# This is an auto-generated example demonstrating basic usage of -# Google::Cloud::Security::PrivateCA::V1::CertificateAuthorityService::Client#update_certificate_authority. -# -def update_certificate_authority - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::Security::PrivateCA::V1::CertificateAuthorityService::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::Security::PrivateCA::V1::UpdateCertificateAuthorityRequest.new - - # Call the update_certificate_authority method. - result = client.update_certificate_authority 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 privateca_v1_generated_CertificateAuthorityService_UpdateCertificateAuthority_sync] diff --git a/owl-bot-staging/google-cloud-security-private_ca-v1/snippets/certificate_authority_service/update_certificate_revocation_list.rb b/owl-bot-staging/google-cloud-security-private_ca-v1/snippets/certificate_authority_service/update_certificate_revocation_list.rb deleted file mode 100644 index 3f573ab17f29..000000000000 --- a/owl-bot-staging/google-cloud-security-private_ca-v1/snippets/certificate_authority_service/update_certificate_revocation_list.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 privateca_v1_generated_CertificateAuthorityService_UpdateCertificateRevocationList_sync] -require "google/cloud/security/private_ca/v1" - -## -# Snippet for the update_certificate_revocation_list call in the CertificateAuthorityService service -# -# This snippet has been automatically generated and should be regarded as a code -# template only. It will require modifications to work: -# - It may require correct/in-range values for request initialization. -# - It may require specifying regional endpoints when creating the service -# client as shown in https://cloud.google.com/ruby/docs/reference. -# -# This is an auto-generated example demonstrating basic usage of -# Google::Cloud::Security::PrivateCA::V1::CertificateAuthorityService::Client#update_certificate_revocation_list. -# -def update_certificate_revocation_list - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::Security::PrivateCA::V1::CertificateAuthorityService::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::Security::PrivateCA::V1::UpdateCertificateRevocationListRequest.new - - # Call the update_certificate_revocation_list method. - result = client.update_certificate_revocation_list 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 privateca_v1_generated_CertificateAuthorityService_UpdateCertificateRevocationList_sync] diff --git a/owl-bot-staging/google-cloud-security-private_ca-v1/snippets/certificate_authority_service/update_certificate_template.rb b/owl-bot-staging/google-cloud-security-private_ca-v1/snippets/certificate_authority_service/update_certificate_template.rb deleted file mode 100644 index 037307454cb4..000000000000 --- a/owl-bot-staging/google-cloud-security-private_ca-v1/snippets/certificate_authority_service/update_certificate_template.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 privateca_v1_generated_CertificateAuthorityService_UpdateCertificateTemplate_sync] -require "google/cloud/security/private_ca/v1" - -## -# Snippet for the update_certificate_template call in the CertificateAuthorityService service -# -# This snippet has been automatically generated and should be regarded as a code -# template only. It will require modifications to work: -# - It may require correct/in-range values for request initialization. -# - It may require specifying regional endpoints when creating the service -# client as shown in https://cloud.google.com/ruby/docs/reference. -# -# This is an auto-generated example demonstrating basic usage of -# Google::Cloud::Security::PrivateCA::V1::CertificateAuthorityService::Client#update_certificate_template. -# -def update_certificate_template - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::Security::PrivateCA::V1::CertificateAuthorityService::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::Security::PrivateCA::V1::UpdateCertificateTemplateRequest.new - - # Call the update_certificate_template method. - result = client.update_certificate_template 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 privateca_v1_generated_CertificateAuthorityService_UpdateCertificateTemplate_sync] diff --git a/owl-bot-staging/google-cloud-security-private_ca-v1/snippets/snippet_metadata_google.cloud.security.privateca.v1.json b/owl-bot-staging/google-cloud-security-private_ca-v1/snippets/snippet_metadata_google.cloud.security.privateca.v1.json deleted file mode 100644 index 9534d7bc3fea..000000000000 --- a/owl-bot-staging/google-cloud-security-private_ca-v1/snippets/snippet_metadata_google.cloud.security.privateca.v1.json +++ /dev/null @@ -1,1175 +0,0 @@ -{ - "client_library": { - "name": "google-cloud-security-private_ca-v1", - "version": "", - "language": "RUBY", - "apis": [ - { - "id": "google.cloud.security.privateca.v1", - "version": "v1" - } - ] - }, - "snippets": [ - { - "region_tag": "privateca_v1_generated_CertificateAuthorityService_CreateCertificate_sync", - "title": "Snippet for the create_certificate call in the CertificateAuthorityService service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Security::PrivateCA::V1::CertificateAuthorityService::Client#create_certificate.", - "file": "certificate_authority_service/create_certificate.rb", - "language": "RUBY", - "client_method": { - "short_name": "create_certificate", - "full_name": "::Google::Cloud::Security::PrivateCA::V1::CertificateAuthorityService::Client#create_certificate", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::Security::PrivateCA::V1::CreateCertificateRequest", - "name": "request" - } - ], - "result_type": "::Google::Cloud::Security::PrivateCA::V1::Certificate", - "client": { - "short_name": "CertificateAuthorityService::Client", - "full_name": "::Google::Cloud::Security::PrivateCA::V1::CertificateAuthorityService::Client" - }, - "method": { - "short_name": "CreateCertificate", - "full_name": "google.cloud.security.privateca.v1.CertificateAuthorityService.CreateCertificate", - "service": { - "short_name": "CertificateAuthorityService", - "full_name": "google.cloud.security.privateca.v1.CertificateAuthorityService" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 46, - "type": "FULL" - } - ] - }, - { - "region_tag": "privateca_v1_generated_CertificateAuthorityService_GetCertificate_sync", - "title": "Snippet for the get_certificate call in the CertificateAuthorityService service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Security::PrivateCA::V1::CertificateAuthorityService::Client#get_certificate.", - "file": "certificate_authority_service/get_certificate.rb", - "language": "RUBY", - "client_method": { - "short_name": "get_certificate", - "full_name": "::Google::Cloud::Security::PrivateCA::V1::CertificateAuthorityService::Client#get_certificate", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::Security::PrivateCA::V1::GetCertificateRequest", - "name": "request" - } - ], - "result_type": "::Google::Cloud::Security::PrivateCA::V1::Certificate", - "client": { - "short_name": "CertificateAuthorityService::Client", - "full_name": "::Google::Cloud::Security::PrivateCA::V1::CertificateAuthorityService::Client" - }, - "method": { - "short_name": "GetCertificate", - "full_name": "google.cloud.security.privateca.v1.CertificateAuthorityService.GetCertificate", - "service": { - "short_name": "CertificateAuthorityService", - "full_name": "google.cloud.security.privateca.v1.CertificateAuthorityService" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 46, - "type": "FULL" - } - ] - }, - { - "region_tag": "privateca_v1_generated_CertificateAuthorityService_ListCertificates_sync", - "title": "Snippet for the list_certificates call in the CertificateAuthorityService service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Security::PrivateCA::V1::CertificateAuthorityService::Client#list_certificates.", - "file": "certificate_authority_service/list_certificates.rb", - "language": "RUBY", - "client_method": { - "short_name": "list_certificates", - "full_name": "::Google::Cloud::Security::PrivateCA::V1::CertificateAuthorityService::Client#list_certificates", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::Security::PrivateCA::V1::ListCertificatesRequest", - "name": "request" - } - ], - "result_type": "::Google::Cloud::Security::PrivateCA::V1::ListCertificatesResponse", - "client": { - "short_name": "CertificateAuthorityService::Client", - "full_name": "::Google::Cloud::Security::PrivateCA::V1::CertificateAuthorityService::Client" - }, - "method": { - "short_name": "ListCertificates", - "full_name": "google.cloud.security.privateca.v1.CertificateAuthorityService.ListCertificates", - "service": { - "short_name": "CertificateAuthorityService", - "full_name": "google.cloud.security.privateca.v1.CertificateAuthorityService" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 50, - "type": "FULL" - } - ] - }, - { - "region_tag": "privateca_v1_generated_CertificateAuthorityService_RevokeCertificate_sync", - "title": "Snippet for the revoke_certificate call in the CertificateAuthorityService service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Security::PrivateCA::V1::CertificateAuthorityService::Client#revoke_certificate.", - "file": "certificate_authority_service/revoke_certificate.rb", - "language": "RUBY", - "client_method": { - "short_name": "revoke_certificate", - "full_name": "::Google::Cloud::Security::PrivateCA::V1::CertificateAuthorityService::Client#revoke_certificate", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::Security::PrivateCA::V1::RevokeCertificateRequest", - "name": "request" - } - ], - "result_type": "::Google::Cloud::Security::PrivateCA::V1::Certificate", - "client": { - "short_name": "CertificateAuthorityService::Client", - "full_name": "::Google::Cloud::Security::PrivateCA::V1::CertificateAuthorityService::Client" - }, - "method": { - "short_name": "RevokeCertificate", - "full_name": "google.cloud.security.privateca.v1.CertificateAuthorityService.RevokeCertificate", - "service": { - "short_name": "CertificateAuthorityService", - "full_name": "google.cloud.security.privateca.v1.CertificateAuthorityService" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 46, - "type": "FULL" - } - ] - }, - { - "region_tag": "privateca_v1_generated_CertificateAuthorityService_UpdateCertificate_sync", - "title": "Snippet for the update_certificate call in the CertificateAuthorityService service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Security::PrivateCA::V1::CertificateAuthorityService::Client#update_certificate.", - "file": "certificate_authority_service/update_certificate.rb", - "language": "RUBY", - "client_method": { - "short_name": "update_certificate", - "full_name": "::Google::Cloud::Security::PrivateCA::V1::CertificateAuthorityService::Client#update_certificate", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::Security::PrivateCA::V1::UpdateCertificateRequest", - "name": "request" - } - ], - "result_type": "::Google::Cloud::Security::PrivateCA::V1::Certificate", - "client": { - "short_name": "CertificateAuthorityService::Client", - "full_name": "::Google::Cloud::Security::PrivateCA::V1::CertificateAuthorityService::Client" - }, - "method": { - "short_name": "UpdateCertificate", - "full_name": "google.cloud.security.privateca.v1.CertificateAuthorityService.UpdateCertificate", - "service": { - "short_name": "CertificateAuthorityService", - "full_name": "google.cloud.security.privateca.v1.CertificateAuthorityService" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 46, - "type": "FULL" - } - ] - }, - { - "region_tag": "privateca_v1_generated_CertificateAuthorityService_ActivateCertificateAuthority_sync", - "title": "Snippet for the activate_certificate_authority call in the CertificateAuthorityService service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Security::PrivateCA::V1::CertificateAuthorityService::Client#activate_certificate_authority.", - "file": "certificate_authority_service/activate_certificate_authority.rb", - "language": "RUBY", - "client_method": { - "short_name": "activate_certificate_authority", - "full_name": "::Google::Cloud::Security::PrivateCA::V1::CertificateAuthorityService::Client#activate_certificate_authority", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::Security::PrivateCA::V1::ActivateCertificateAuthorityRequest", - "name": "request" - } - ], - "result_type": "::Google::Longrunning::Operation", - "client": { - "short_name": "CertificateAuthorityService::Client", - "full_name": "::Google::Cloud::Security::PrivateCA::V1::CertificateAuthorityService::Client" - }, - "method": { - "short_name": "ActivateCertificateAuthority", - "full_name": "google.cloud.security.privateca.v1.CertificateAuthorityService.ActivateCertificateAuthority", - "service": { - "short_name": "CertificateAuthorityService", - "full_name": "google.cloud.security.privateca.v1.CertificateAuthorityService" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 53, - "type": "FULL" - } - ] - }, - { - "region_tag": "privateca_v1_generated_CertificateAuthorityService_CreateCertificateAuthority_sync", - "title": "Snippet for the create_certificate_authority call in the CertificateAuthorityService service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Security::PrivateCA::V1::CertificateAuthorityService::Client#create_certificate_authority.", - "file": "certificate_authority_service/create_certificate_authority.rb", - "language": "RUBY", - "client_method": { - "short_name": "create_certificate_authority", - "full_name": "::Google::Cloud::Security::PrivateCA::V1::CertificateAuthorityService::Client#create_certificate_authority", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::Security::PrivateCA::V1::CreateCertificateAuthorityRequest", - "name": "request" - } - ], - "result_type": "::Google::Longrunning::Operation", - "client": { - "short_name": "CertificateAuthorityService::Client", - "full_name": "::Google::Cloud::Security::PrivateCA::V1::CertificateAuthorityService::Client" - }, - "method": { - "short_name": "CreateCertificateAuthority", - "full_name": "google.cloud.security.privateca.v1.CertificateAuthorityService.CreateCertificateAuthority", - "service": { - "short_name": "CertificateAuthorityService", - "full_name": "google.cloud.security.privateca.v1.CertificateAuthorityService" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 53, - "type": "FULL" - } - ] - }, - { - "region_tag": "privateca_v1_generated_CertificateAuthorityService_DisableCertificateAuthority_sync", - "title": "Snippet for the disable_certificate_authority call in the CertificateAuthorityService service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Security::PrivateCA::V1::CertificateAuthorityService::Client#disable_certificate_authority.", - "file": "certificate_authority_service/disable_certificate_authority.rb", - "language": "RUBY", - "client_method": { - "short_name": "disable_certificate_authority", - "full_name": "::Google::Cloud::Security::PrivateCA::V1::CertificateAuthorityService::Client#disable_certificate_authority", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::Security::PrivateCA::V1::DisableCertificateAuthorityRequest", - "name": "request" - } - ], - "result_type": "::Google::Longrunning::Operation", - "client": { - "short_name": "CertificateAuthorityService::Client", - "full_name": "::Google::Cloud::Security::PrivateCA::V1::CertificateAuthorityService::Client" - }, - "method": { - "short_name": "DisableCertificateAuthority", - "full_name": "google.cloud.security.privateca.v1.CertificateAuthorityService.DisableCertificateAuthority", - "service": { - "short_name": "CertificateAuthorityService", - "full_name": "google.cloud.security.privateca.v1.CertificateAuthorityService" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 53, - "type": "FULL" - } - ] - }, - { - "region_tag": "privateca_v1_generated_CertificateAuthorityService_EnableCertificateAuthority_sync", - "title": "Snippet for the enable_certificate_authority call in the CertificateAuthorityService service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Security::PrivateCA::V1::CertificateAuthorityService::Client#enable_certificate_authority.", - "file": "certificate_authority_service/enable_certificate_authority.rb", - "language": "RUBY", - "client_method": { - "short_name": "enable_certificate_authority", - "full_name": "::Google::Cloud::Security::PrivateCA::V1::CertificateAuthorityService::Client#enable_certificate_authority", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::Security::PrivateCA::V1::EnableCertificateAuthorityRequest", - "name": "request" - } - ], - "result_type": "::Google::Longrunning::Operation", - "client": { - "short_name": "CertificateAuthorityService::Client", - "full_name": "::Google::Cloud::Security::PrivateCA::V1::CertificateAuthorityService::Client" - }, - "method": { - "short_name": "EnableCertificateAuthority", - "full_name": "google.cloud.security.privateca.v1.CertificateAuthorityService.EnableCertificateAuthority", - "service": { - "short_name": "CertificateAuthorityService", - "full_name": "google.cloud.security.privateca.v1.CertificateAuthorityService" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 53, - "type": "FULL" - } - ] - }, - { - "region_tag": "privateca_v1_generated_CertificateAuthorityService_FetchCertificateAuthorityCsr_sync", - "title": "Snippet for the fetch_certificate_authority_csr call in the CertificateAuthorityService service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Security::PrivateCA::V1::CertificateAuthorityService::Client#fetch_certificate_authority_csr.", - "file": "certificate_authority_service/fetch_certificate_authority_csr.rb", - "language": "RUBY", - "client_method": { - "short_name": "fetch_certificate_authority_csr", - "full_name": "::Google::Cloud::Security::PrivateCA::V1::CertificateAuthorityService::Client#fetch_certificate_authority_csr", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::Security::PrivateCA::V1::FetchCertificateAuthorityCsrRequest", - "name": "request" - } - ], - "result_type": "::Google::Cloud::Security::PrivateCA::V1::FetchCertificateAuthorityCsrResponse", - "client": { - "short_name": "CertificateAuthorityService::Client", - "full_name": "::Google::Cloud::Security::PrivateCA::V1::CertificateAuthorityService::Client" - }, - "method": { - "short_name": "FetchCertificateAuthorityCsr", - "full_name": "google.cloud.security.privateca.v1.CertificateAuthorityService.FetchCertificateAuthorityCsr", - "service": { - "short_name": "CertificateAuthorityService", - "full_name": "google.cloud.security.privateca.v1.CertificateAuthorityService" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 46, - "type": "FULL" - } - ] - }, - { - "region_tag": "privateca_v1_generated_CertificateAuthorityService_GetCertificateAuthority_sync", - "title": "Snippet for the get_certificate_authority call in the CertificateAuthorityService service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Security::PrivateCA::V1::CertificateAuthorityService::Client#get_certificate_authority.", - "file": "certificate_authority_service/get_certificate_authority.rb", - "language": "RUBY", - "client_method": { - "short_name": "get_certificate_authority", - "full_name": "::Google::Cloud::Security::PrivateCA::V1::CertificateAuthorityService::Client#get_certificate_authority", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::Security::PrivateCA::V1::GetCertificateAuthorityRequest", - "name": "request" - } - ], - "result_type": "::Google::Cloud::Security::PrivateCA::V1::CertificateAuthority", - "client": { - "short_name": "CertificateAuthorityService::Client", - "full_name": "::Google::Cloud::Security::PrivateCA::V1::CertificateAuthorityService::Client" - }, - "method": { - "short_name": "GetCertificateAuthority", - "full_name": "google.cloud.security.privateca.v1.CertificateAuthorityService.GetCertificateAuthority", - "service": { - "short_name": "CertificateAuthorityService", - "full_name": "google.cloud.security.privateca.v1.CertificateAuthorityService" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 46, - "type": "FULL" - } - ] - }, - { - "region_tag": "privateca_v1_generated_CertificateAuthorityService_ListCertificateAuthorities_sync", - "title": "Snippet for the list_certificate_authorities call in the CertificateAuthorityService service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Security::PrivateCA::V1::CertificateAuthorityService::Client#list_certificate_authorities.", - "file": "certificate_authority_service/list_certificate_authorities.rb", - "language": "RUBY", - "client_method": { - "short_name": "list_certificate_authorities", - "full_name": "::Google::Cloud::Security::PrivateCA::V1::CertificateAuthorityService::Client#list_certificate_authorities", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::Security::PrivateCA::V1::ListCertificateAuthoritiesRequest", - "name": "request" - } - ], - "result_type": "::Google::Cloud::Security::PrivateCA::V1::ListCertificateAuthoritiesResponse", - "client": { - "short_name": "CertificateAuthorityService::Client", - "full_name": "::Google::Cloud::Security::PrivateCA::V1::CertificateAuthorityService::Client" - }, - "method": { - "short_name": "ListCertificateAuthorities", - "full_name": "google.cloud.security.privateca.v1.CertificateAuthorityService.ListCertificateAuthorities", - "service": { - "short_name": "CertificateAuthorityService", - "full_name": "google.cloud.security.privateca.v1.CertificateAuthorityService" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 50, - "type": "FULL" - } - ] - }, - { - "region_tag": "privateca_v1_generated_CertificateAuthorityService_UndeleteCertificateAuthority_sync", - "title": "Snippet for the undelete_certificate_authority call in the CertificateAuthorityService service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Security::PrivateCA::V1::CertificateAuthorityService::Client#undelete_certificate_authority.", - "file": "certificate_authority_service/undelete_certificate_authority.rb", - "language": "RUBY", - "client_method": { - "short_name": "undelete_certificate_authority", - "full_name": "::Google::Cloud::Security::PrivateCA::V1::CertificateAuthorityService::Client#undelete_certificate_authority", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::Security::PrivateCA::V1::UndeleteCertificateAuthorityRequest", - "name": "request" - } - ], - "result_type": "::Google::Longrunning::Operation", - "client": { - "short_name": "CertificateAuthorityService::Client", - "full_name": "::Google::Cloud::Security::PrivateCA::V1::CertificateAuthorityService::Client" - }, - "method": { - "short_name": "UndeleteCertificateAuthority", - "full_name": "google.cloud.security.privateca.v1.CertificateAuthorityService.UndeleteCertificateAuthority", - "service": { - "short_name": "CertificateAuthorityService", - "full_name": "google.cloud.security.privateca.v1.CertificateAuthorityService" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 53, - "type": "FULL" - } - ] - }, - { - "region_tag": "privateca_v1_generated_CertificateAuthorityService_DeleteCertificateAuthority_sync", - "title": "Snippet for the delete_certificate_authority call in the CertificateAuthorityService service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Security::PrivateCA::V1::CertificateAuthorityService::Client#delete_certificate_authority.", - "file": "certificate_authority_service/delete_certificate_authority.rb", - "language": "RUBY", - "client_method": { - "short_name": "delete_certificate_authority", - "full_name": "::Google::Cloud::Security::PrivateCA::V1::CertificateAuthorityService::Client#delete_certificate_authority", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::Security::PrivateCA::V1::DeleteCertificateAuthorityRequest", - "name": "request" - } - ], - "result_type": "::Google::Longrunning::Operation", - "client": { - "short_name": "CertificateAuthorityService::Client", - "full_name": "::Google::Cloud::Security::PrivateCA::V1::CertificateAuthorityService::Client" - }, - "method": { - "short_name": "DeleteCertificateAuthority", - "full_name": "google.cloud.security.privateca.v1.CertificateAuthorityService.DeleteCertificateAuthority", - "service": { - "short_name": "CertificateAuthorityService", - "full_name": "google.cloud.security.privateca.v1.CertificateAuthorityService" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 53, - "type": "FULL" - } - ] - }, - { - "region_tag": "privateca_v1_generated_CertificateAuthorityService_UpdateCertificateAuthority_sync", - "title": "Snippet for the update_certificate_authority call in the CertificateAuthorityService service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Security::PrivateCA::V1::CertificateAuthorityService::Client#update_certificate_authority.", - "file": "certificate_authority_service/update_certificate_authority.rb", - "language": "RUBY", - "client_method": { - "short_name": "update_certificate_authority", - "full_name": "::Google::Cloud::Security::PrivateCA::V1::CertificateAuthorityService::Client#update_certificate_authority", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::Security::PrivateCA::V1::UpdateCertificateAuthorityRequest", - "name": "request" - } - ], - "result_type": "::Google::Longrunning::Operation", - "client": { - "short_name": "CertificateAuthorityService::Client", - "full_name": "::Google::Cloud::Security::PrivateCA::V1::CertificateAuthorityService::Client" - }, - "method": { - "short_name": "UpdateCertificateAuthority", - "full_name": "google.cloud.security.privateca.v1.CertificateAuthorityService.UpdateCertificateAuthority", - "service": { - "short_name": "CertificateAuthorityService", - "full_name": "google.cloud.security.privateca.v1.CertificateAuthorityService" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 53, - "type": "FULL" - } - ] - }, - { - "region_tag": "privateca_v1_generated_CertificateAuthorityService_CreateCaPool_sync", - "title": "Snippet for the create_ca_pool call in the CertificateAuthorityService service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Security::PrivateCA::V1::CertificateAuthorityService::Client#create_ca_pool.", - "file": "certificate_authority_service/create_ca_pool.rb", - "language": "RUBY", - "client_method": { - "short_name": "create_ca_pool", - "full_name": "::Google::Cloud::Security::PrivateCA::V1::CertificateAuthorityService::Client#create_ca_pool", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::Security::PrivateCA::V1::CreateCaPoolRequest", - "name": "request" - } - ], - "result_type": "::Google::Longrunning::Operation", - "client": { - "short_name": "CertificateAuthorityService::Client", - "full_name": "::Google::Cloud::Security::PrivateCA::V1::CertificateAuthorityService::Client" - }, - "method": { - "short_name": "CreateCaPool", - "full_name": "google.cloud.security.privateca.v1.CertificateAuthorityService.CreateCaPool", - "service": { - "short_name": "CertificateAuthorityService", - "full_name": "google.cloud.security.privateca.v1.CertificateAuthorityService" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 53, - "type": "FULL" - } - ] - }, - { - "region_tag": "privateca_v1_generated_CertificateAuthorityService_UpdateCaPool_sync", - "title": "Snippet for the update_ca_pool call in the CertificateAuthorityService service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Security::PrivateCA::V1::CertificateAuthorityService::Client#update_ca_pool.", - "file": "certificate_authority_service/update_ca_pool.rb", - "language": "RUBY", - "client_method": { - "short_name": "update_ca_pool", - "full_name": "::Google::Cloud::Security::PrivateCA::V1::CertificateAuthorityService::Client#update_ca_pool", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::Security::PrivateCA::V1::UpdateCaPoolRequest", - "name": "request" - } - ], - "result_type": "::Google::Longrunning::Operation", - "client": { - "short_name": "CertificateAuthorityService::Client", - "full_name": "::Google::Cloud::Security::PrivateCA::V1::CertificateAuthorityService::Client" - }, - "method": { - "short_name": "UpdateCaPool", - "full_name": "google.cloud.security.privateca.v1.CertificateAuthorityService.UpdateCaPool", - "service": { - "short_name": "CertificateAuthorityService", - "full_name": "google.cloud.security.privateca.v1.CertificateAuthorityService" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 53, - "type": "FULL" - } - ] - }, - { - "region_tag": "privateca_v1_generated_CertificateAuthorityService_GetCaPool_sync", - "title": "Snippet for the get_ca_pool call in the CertificateAuthorityService service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Security::PrivateCA::V1::CertificateAuthorityService::Client#get_ca_pool.", - "file": "certificate_authority_service/get_ca_pool.rb", - "language": "RUBY", - "client_method": { - "short_name": "get_ca_pool", - "full_name": "::Google::Cloud::Security::PrivateCA::V1::CertificateAuthorityService::Client#get_ca_pool", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::Security::PrivateCA::V1::GetCaPoolRequest", - "name": "request" - } - ], - "result_type": "::Google::Cloud::Security::PrivateCA::V1::CaPool", - "client": { - "short_name": "CertificateAuthorityService::Client", - "full_name": "::Google::Cloud::Security::PrivateCA::V1::CertificateAuthorityService::Client" - }, - "method": { - "short_name": "GetCaPool", - "full_name": "google.cloud.security.privateca.v1.CertificateAuthorityService.GetCaPool", - "service": { - "short_name": "CertificateAuthorityService", - "full_name": "google.cloud.security.privateca.v1.CertificateAuthorityService" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 46, - "type": "FULL" - } - ] - }, - { - "region_tag": "privateca_v1_generated_CertificateAuthorityService_ListCaPools_sync", - "title": "Snippet for the list_ca_pools call in the CertificateAuthorityService service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Security::PrivateCA::V1::CertificateAuthorityService::Client#list_ca_pools.", - "file": "certificate_authority_service/list_ca_pools.rb", - "language": "RUBY", - "client_method": { - "short_name": "list_ca_pools", - "full_name": "::Google::Cloud::Security::PrivateCA::V1::CertificateAuthorityService::Client#list_ca_pools", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::Security::PrivateCA::V1::ListCaPoolsRequest", - "name": "request" - } - ], - "result_type": "::Google::Cloud::Security::PrivateCA::V1::ListCaPoolsResponse", - "client": { - "short_name": "CertificateAuthorityService::Client", - "full_name": "::Google::Cloud::Security::PrivateCA::V1::CertificateAuthorityService::Client" - }, - "method": { - "short_name": "ListCaPools", - "full_name": "google.cloud.security.privateca.v1.CertificateAuthorityService.ListCaPools", - "service": { - "short_name": "CertificateAuthorityService", - "full_name": "google.cloud.security.privateca.v1.CertificateAuthorityService" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 50, - "type": "FULL" - } - ] - }, - { - "region_tag": "privateca_v1_generated_CertificateAuthorityService_DeleteCaPool_sync", - "title": "Snippet for the delete_ca_pool call in the CertificateAuthorityService service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Security::PrivateCA::V1::CertificateAuthorityService::Client#delete_ca_pool.", - "file": "certificate_authority_service/delete_ca_pool.rb", - "language": "RUBY", - "client_method": { - "short_name": "delete_ca_pool", - "full_name": "::Google::Cloud::Security::PrivateCA::V1::CertificateAuthorityService::Client#delete_ca_pool", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::Security::PrivateCA::V1::DeleteCaPoolRequest", - "name": "request" - } - ], - "result_type": "::Google::Longrunning::Operation", - "client": { - "short_name": "CertificateAuthorityService::Client", - "full_name": "::Google::Cloud::Security::PrivateCA::V1::CertificateAuthorityService::Client" - }, - "method": { - "short_name": "DeleteCaPool", - "full_name": "google.cloud.security.privateca.v1.CertificateAuthorityService.DeleteCaPool", - "service": { - "short_name": "CertificateAuthorityService", - "full_name": "google.cloud.security.privateca.v1.CertificateAuthorityService" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 53, - "type": "FULL" - } - ] - }, - { - "region_tag": "privateca_v1_generated_CertificateAuthorityService_FetchCaCerts_sync", - "title": "Snippet for the fetch_ca_certs call in the CertificateAuthorityService service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Security::PrivateCA::V1::CertificateAuthorityService::Client#fetch_ca_certs.", - "file": "certificate_authority_service/fetch_ca_certs.rb", - "language": "RUBY", - "client_method": { - "short_name": "fetch_ca_certs", - "full_name": "::Google::Cloud::Security::PrivateCA::V1::CertificateAuthorityService::Client#fetch_ca_certs", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::Security::PrivateCA::V1::FetchCaCertsRequest", - "name": "request" - } - ], - "result_type": "::Google::Cloud::Security::PrivateCA::V1::FetchCaCertsResponse", - "client": { - "short_name": "CertificateAuthorityService::Client", - "full_name": "::Google::Cloud::Security::PrivateCA::V1::CertificateAuthorityService::Client" - }, - "method": { - "short_name": "FetchCaCerts", - "full_name": "google.cloud.security.privateca.v1.CertificateAuthorityService.FetchCaCerts", - "service": { - "short_name": "CertificateAuthorityService", - "full_name": "google.cloud.security.privateca.v1.CertificateAuthorityService" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 46, - "type": "FULL" - } - ] - }, - { - "region_tag": "privateca_v1_generated_CertificateAuthorityService_GetCertificateRevocationList_sync", - "title": "Snippet for the get_certificate_revocation_list call in the CertificateAuthorityService service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Security::PrivateCA::V1::CertificateAuthorityService::Client#get_certificate_revocation_list.", - "file": "certificate_authority_service/get_certificate_revocation_list.rb", - "language": "RUBY", - "client_method": { - "short_name": "get_certificate_revocation_list", - "full_name": "::Google::Cloud::Security::PrivateCA::V1::CertificateAuthorityService::Client#get_certificate_revocation_list", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::Security::PrivateCA::V1::GetCertificateRevocationListRequest", - "name": "request" - } - ], - "result_type": "::Google::Cloud::Security::PrivateCA::V1::CertificateRevocationList", - "client": { - "short_name": "CertificateAuthorityService::Client", - "full_name": "::Google::Cloud::Security::PrivateCA::V1::CertificateAuthorityService::Client" - }, - "method": { - "short_name": "GetCertificateRevocationList", - "full_name": "google.cloud.security.privateca.v1.CertificateAuthorityService.GetCertificateRevocationList", - "service": { - "short_name": "CertificateAuthorityService", - "full_name": "google.cloud.security.privateca.v1.CertificateAuthorityService" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 46, - "type": "FULL" - } - ] - }, - { - "region_tag": "privateca_v1_generated_CertificateAuthorityService_ListCertificateRevocationLists_sync", - "title": "Snippet for the list_certificate_revocation_lists call in the CertificateAuthorityService service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Security::PrivateCA::V1::CertificateAuthorityService::Client#list_certificate_revocation_lists.", - "file": "certificate_authority_service/list_certificate_revocation_lists.rb", - "language": "RUBY", - "client_method": { - "short_name": "list_certificate_revocation_lists", - "full_name": "::Google::Cloud::Security::PrivateCA::V1::CertificateAuthorityService::Client#list_certificate_revocation_lists", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::Security::PrivateCA::V1::ListCertificateRevocationListsRequest", - "name": "request" - } - ], - "result_type": "::Google::Cloud::Security::PrivateCA::V1::ListCertificateRevocationListsResponse", - "client": { - "short_name": "CertificateAuthorityService::Client", - "full_name": "::Google::Cloud::Security::PrivateCA::V1::CertificateAuthorityService::Client" - }, - "method": { - "short_name": "ListCertificateRevocationLists", - "full_name": "google.cloud.security.privateca.v1.CertificateAuthorityService.ListCertificateRevocationLists", - "service": { - "short_name": "CertificateAuthorityService", - "full_name": "google.cloud.security.privateca.v1.CertificateAuthorityService" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 50, - "type": "FULL" - } - ] - }, - { - "region_tag": "privateca_v1_generated_CertificateAuthorityService_UpdateCertificateRevocationList_sync", - "title": "Snippet for the update_certificate_revocation_list call in the CertificateAuthorityService service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Security::PrivateCA::V1::CertificateAuthorityService::Client#update_certificate_revocation_list.", - "file": "certificate_authority_service/update_certificate_revocation_list.rb", - "language": "RUBY", - "client_method": { - "short_name": "update_certificate_revocation_list", - "full_name": "::Google::Cloud::Security::PrivateCA::V1::CertificateAuthorityService::Client#update_certificate_revocation_list", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::Security::PrivateCA::V1::UpdateCertificateRevocationListRequest", - "name": "request" - } - ], - "result_type": "::Google::Longrunning::Operation", - "client": { - "short_name": "CertificateAuthorityService::Client", - "full_name": "::Google::Cloud::Security::PrivateCA::V1::CertificateAuthorityService::Client" - }, - "method": { - "short_name": "UpdateCertificateRevocationList", - "full_name": "google.cloud.security.privateca.v1.CertificateAuthorityService.UpdateCertificateRevocationList", - "service": { - "short_name": "CertificateAuthorityService", - "full_name": "google.cloud.security.privateca.v1.CertificateAuthorityService" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 53, - "type": "FULL" - } - ] - }, - { - "region_tag": "privateca_v1_generated_CertificateAuthorityService_CreateCertificateTemplate_sync", - "title": "Snippet for the create_certificate_template call in the CertificateAuthorityService service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Security::PrivateCA::V1::CertificateAuthorityService::Client#create_certificate_template.", - "file": "certificate_authority_service/create_certificate_template.rb", - "language": "RUBY", - "client_method": { - "short_name": "create_certificate_template", - "full_name": "::Google::Cloud::Security::PrivateCA::V1::CertificateAuthorityService::Client#create_certificate_template", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::Security::PrivateCA::V1::CreateCertificateTemplateRequest", - "name": "request" - } - ], - "result_type": "::Google::Longrunning::Operation", - "client": { - "short_name": "CertificateAuthorityService::Client", - "full_name": "::Google::Cloud::Security::PrivateCA::V1::CertificateAuthorityService::Client" - }, - "method": { - "short_name": "CreateCertificateTemplate", - "full_name": "google.cloud.security.privateca.v1.CertificateAuthorityService.CreateCertificateTemplate", - "service": { - "short_name": "CertificateAuthorityService", - "full_name": "google.cloud.security.privateca.v1.CertificateAuthorityService" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 53, - "type": "FULL" - } - ] - }, - { - "region_tag": "privateca_v1_generated_CertificateAuthorityService_DeleteCertificateTemplate_sync", - "title": "Snippet for the delete_certificate_template call in the CertificateAuthorityService service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Security::PrivateCA::V1::CertificateAuthorityService::Client#delete_certificate_template.", - "file": "certificate_authority_service/delete_certificate_template.rb", - "language": "RUBY", - "client_method": { - "short_name": "delete_certificate_template", - "full_name": "::Google::Cloud::Security::PrivateCA::V1::CertificateAuthorityService::Client#delete_certificate_template", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::Security::PrivateCA::V1::DeleteCertificateTemplateRequest", - "name": "request" - } - ], - "result_type": "::Google::Longrunning::Operation", - "client": { - "short_name": "CertificateAuthorityService::Client", - "full_name": "::Google::Cloud::Security::PrivateCA::V1::CertificateAuthorityService::Client" - }, - "method": { - "short_name": "DeleteCertificateTemplate", - "full_name": "google.cloud.security.privateca.v1.CertificateAuthorityService.DeleteCertificateTemplate", - "service": { - "short_name": "CertificateAuthorityService", - "full_name": "google.cloud.security.privateca.v1.CertificateAuthorityService" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 53, - "type": "FULL" - } - ] - }, - { - "region_tag": "privateca_v1_generated_CertificateAuthorityService_GetCertificateTemplate_sync", - "title": "Snippet for the get_certificate_template call in the CertificateAuthorityService service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Security::PrivateCA::V1::CertificateAuthorityService::Client#get_certificate_template.", - "file": "certificate_authority_service/get_certificate_template.rb", - "language": "RUBY", - "client_method": { - "short_name": "get_certificate_template", - "full_name": "::Google::Cloud::Security::PrivateCA::V1::CertificateAuthorityService::Client#get_certificate_template", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::Security::PrivateCA::V1::GetCertificateTemplateRequest", - "name": "request" - } - ], - "result_type": "::Google::Cloud::Security::PrivateCA::V1::CertificateTemplate", - "client": { - "short_name": "CertificateAuthorityService::Client", - "full_name": "::Google::Cloud::Security::PrivateCA::V1::CertificateAuthorityService::Client" - }, - "method": { - "short_name": "GetCertificateTemplate", - "full_name": "google.cloud.security.privateca.v1.CertificateAuthorityService.GetCertificateTemplate", - "service": { - "short_name": "CertificateAuthorityService", - "full_name": "google.cloud.security.privateca.v1.CertificateAuthorityService" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 46, - "type": "FULL" - } - ] - }, - { - "region_tag": "privateca_v1_generated_CertificateAuthorityService_ListCertificateTemplates_sync", - "title": "Snippet for the list_certificate_templates call in the CertificateAuthorityService service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Security::PrivateCA::V1::CertificateAuthorityService::Client#list_certificate_templates.", - "file": "certificate_authority_service/list_certificate_templates.rb", - "language": "RUBY", - "client_method": { - "short_name": "list_certificate_templates", - "full_name": "::Google::Cloud::Security::PrivateCA::V1::CertificateAuthorityService::Client#list_certificate_templates", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::Security::PrivateCA::V1::ListCertificateTemplatesRequest", - "name": "request" - } - ], - "result_type": "::Google::Cloud::Security::PrivateCA::V1::ListCertificateTemplatesResponse", - "client": { - "short_name": "CertificateAuthorityService::Client", - "full_name": "::Google::Cloud::Security::PrivateCA::V1::CertificateAuthorityService::Client" - }, - "method": { - "short_name": "ListCertificateTemplates", - "full_name": "google.cloud.security.privateca.v1.CertificateAuthorityService.ListCertificateTemplates", - "service": { - "short_name": "CertificateAuthorityService", - "full_name": "google.cloud.security.privateca.v1.CertificateAuthorityService" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 50, - "type": "FULL" - } - ] - }, - { - "region_tag": "privateca_v1_generated_CertificateAuthorityService_UpdateCertificateTemplate_sync", - "title": "Snippet for the update_certificate_template call in the CertificateAuthorityService service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Security::PrivateCA::V1::CertificateAuthorityService::Client#update_certificate_template.", - "file": "certificate_authority_service/update_certificate_template.rb", - "language": "RUBY", - "client_method": { - "short_name": "update_certificate_template", - "full_name": "::Google::Cloud::Security::PrivateCA::V1::CertificateAuthorityService::Client#update_certificate_template", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::Security::PrivateCA::V1::UpdateCertificateTemplateRequest", - "name": "request" - } - ], - "result_type": "::Google::Longrunning::Operation", - "client": { - "short_name": "CertificateAuthorityService::Client", - "full_name": "::Google::Cloud::Security::PrivateCA::V1::CertificateAuthorityService::Client" - }, - "method": { - "short_name": "UpdateCertificateTemplate", - "full_name": "google.cloud.security.privateca.v1.CertificateAuthorityService.UpdateCertificateTemplate", - "service": { - "short_name": "CertificateAuthorityService", - "full_name": "google.cloud.security.privateca.v1.CertificateAuthorityService" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 53, - "type": "FULL" - } - ] - } - ] -} \ No newline at end of file diff --git a/owl-bot-staging/google-cloud-security-private_ca-v1/test/google/cloud/security/private_ca/v1/certificate_authority_service_operations_test.rb b/owl-bot-staging/google-cloud-security-private_ca-v1/test/google/cloud/security/private_ca/v1/certificate_authority_service_operations_test.rb deleted file mode 100644 index fe6266d30538..000000000000 --- a/owl-bot-staging/google-cloud-security-private_ca-v1/test/google/cloud/security/private_ca/v1/certificate_authority_service_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/cloud/security/privateca/v1/service_pb" -require "google/cloud/security/privateca/v1/service_services_pb" -require "google/cloud/security/private_ca/v1/certificate_authority_service" - -class ::Google::Cloud::Security::PrivateCA::V1::CertificateAuthorityService::OperationsTest < Minitest::Test - class ClientStub - attr_accessor :call_rpc_count, :requests - - def initialize response, operation, &block - @response = response - @operation = operation - @block = block - @call_rpc_count = 0 - @requests = [] - end - - def call_rpc *args, **kwargs - @call_rpc_count += 1 - - @requests << @block&.call(*args, **kwargs) - - catch :response do - yield @response, @operation if block_given? - @response - end - end - - def endpoint - "endpoint.example.com" - end - - def universe_domain - "example.com" - end - - def stub_logger - nil - end - - def logger - nil - end - end - - def test_list_operations - # Create GRPC objects. - grpc_response = ::Google::Longrunning::ListOperationsResponse.new - grpc_operation = GRPC::ActiveCall::Operation.new nil - grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - grpc_options = {} - - # Create request parameters for a unary method. - name = "hello world" - filter = "hello world" - page_size = 42 - page_token = "hello world" - return_partial_success = true - - list_operations_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :list_operations, name - assert_kind_of ::Google::Longrunning::ListOperationsRequest, request - assert_equal "hello world", request["name"] - assert_equal "hello world", request["filter"] - assert_equal 42, request["page_size"] - assert_equal "hello world", request["page_token"] - assert_equal true, request["return_partial_success"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, list_operations_client_stub do - # Create client - client = ::Google::Cloud::Security::PrivateCA::V1::CertificateAuthorityService::Operations.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.list_operations({ name: name, filter: filter, page_size: page_size, page_token: page_token, return_partial_success: return_partial_success }) do |response, operation| - assert_kind_of Gapic::PagedEnumerable, response - assert_equal grpc_response, response.response - assert_equal grpc_operation, operation - end - - # Use named arguments - client.list_operations name: name, filter: filter, page_size: page_size, page_token: page_token, return_partial_success: return_partial_success do |response, operation| - assert_kind_of Gapic::PagedEnumerable, response - assert_equal grpc_response, response.response - assert_equal grpc_operation, operation - end - - # Use protobuf object - client.list_operations ::Google::Longrunning::ListOperationsRequest.new(name: name, filter: filter, page_size: page_size, page_token: page_token, return_partial_success: return_partial_success) do |response, operation| - assert_kind_of Gapic::PagedEnumerable, response - assert_equal grpc_response, response.response - assert_equal grpc_operation, operation - end - - # Use hash object with options - client.list_operations({ name: name, filter: filter, page_size: page_size, page_token: page_token, return_partial_success: return_partial_success }, grpc_options) do |response, operation| - assert_kind_of Gapic::PagedEnumerable, response - assert_equal grpc_response, response.response - assert_equal grpc_operation, operation - end - - # Use protobuf object with options - client.list_operations(::Google::Longrunning::ListOperationsRequest.new(name: name, filter: filter, page_size: page_size, page_token: page_token, return_partial_success: return_partial_success), grpc_options) do |response, operation| - assert_kind_of Gapic::PagedEnumerable, response - assert_equal grpc_response, response.response - assert_equal grpc_operation, operation - end - - # Verify method calls - assert_equal 5, list_operations_client_stub.call_rpc_count - end - end - - def test_get_operation - # Create GRPC objects. - grpc_response = ::Google::Longrunning::Operation.new - grpc_operation = GRPC::ActiveCall::Operation.new nil - grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - grpc_options = {} - - # Create request parameters for a unary method. - name = "hello world" - - get_operation_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :get_operation, name - assert_kind_of ::Google::Longrunning::GetOperationRequest, request - assert_equal "hello world", request["name"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, get_operation_client_stub do - # Create client - client = ::Google::Cloud::Security::PrivateCA::V1::CertificateAuthorityService::Operations.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.get_operation({ name: name }) do |response, operation| - assert_kind_of Gapic::Operation, response - assert_equal grpc_response, response.grpc_op - assert_equal grpc_operation, operation - end - - # Use named arguments - client.get_operation name: name do |response, operation| - assert_kind_of Gapic::Operation, response - assert_equal grpc_response, response.grpc_op - assert_equal grpc_operation, operation - end - - # Use protobuf object - client.get_operation ::Google::Longrunning::GetOperationRequest.new(name: name) do |response, operation| - assert_kind_of Gapic::Operation, response - assert_equal grpc_response, response.grpc_op - assert_equal grpc_operation, operation - end - - # Use hash object with options - client.get_operation({ name: name }, grpc_options) do |response, operation| - assert_kind_of Gapic::Operation, response - assert_equal grpc_response, response.grpc_op - assert_equal grpc_operation, operation - end - - # Use protobuf object with options - client.get_operation(::Google::Longrunning::GetOperationRequest.new(name: name), grpc_options) do |response, operation| - assert_kind_of Gapic::Operation, response - assert_equal grpc_response, response.grpc_op - assert_equal grpc_operation, operation - end - - # Verify method calls - assert_equal 5, get_operation_client_stub.call_rpc_count - end - end - - def test_delete_operation - # Create GRPC objects. - grpc_response = ::Google::Protobuf::Empty.new - grpc_operation = GRPC::ActiveCall::Operation.new nil - grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - grpc_options = {} - - # Create request parameters for a unary method. - name = "hello world" - - delete_operation_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :delete_operation, name - assert_kind_of ::Google::Longrunning::DeleteOperationRequest, request - assert_equal "hello world", request["name"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, delete_operation_client_stub do - # Create client - client = ::Google::Cloud::Security::PrivateCA::V1::CertificateAuthorityService::Operations.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.delete_operation({ name: name }) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use named arguments - client.delete_operation name: name do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object - client.delete_operation ::Google::Longrunning::DeleteOperationRequest.new(name: name) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use hash object with options - client.delete_operation({ name: name }, grpc_options) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object with options - client.delete_operation(::Google::Longrunning::DeleteOperationRequest.new(name: name), grpc_options) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Verify method calls - assert_equal 5, delete_operation_client_stub.call_rpc_count - end - end - - def test_cancel_operation - # Create GRPC objects. - grpc_response = ::Google::Protobuf::Empty.new - grpc_operation = GRPC::ActiveCall::Operation.new nil - grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - grpc_options = {} - - # Create request parameters for a unary method. - name = "hello world" - - cancel_operation_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :cancel_operation, name - assert_kind_of ::Google::Longrunning::CancelOperationRequest, request - assert_equal "hello world", request["name"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, cancel_operation_client_stub do - # Create client - client = ::Google::Cloud::Security::PrivateCA::V1::CertificateAuthorityService::Operations.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.cancel_operation({ name: name }) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use named arguments - client.cancel_operation name: name do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object - client.cancel_operation ::Google::Longrunning::CancelOperationRequest.new(name: name) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use hash object with options - client.cancel_operation({ name: name }, grpc_options) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object with options - client.cancel_operation(::Google::Longrunning::CancelOperationRequest.new(name: name), grpc_options) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Verify method calls - assert_equal 5, cancel_operation_client_stub.call_rpc_count - end - end - - def test_wait_operation - # Create GRPC objects. - grpc_response = ::Google::Longrunning::Operation.new - grpc_operation = GRPC::ActiveCall::Operation.new nil - grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - grpc_options = {} - - # Create request parameters for a unary method. - name = "hello world" - timeout = {} - - wait_operation_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :wait_operation, name - assert_kind_of ::Google::Longrunning::WaitOperationRequest, request - assert_equal "hello world", request["name"] - assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Protobuf::Duration), request["timeout"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, wait_operation_client_stub do - # Create client - client = ::Google::Cloud::Security::PrivateCA::V1::CertificateAuthorityService::Operations.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.wait_operation({ name: name, timeout: timeout }) do |response, operation| - assert_kind_of Gapic::Operation, response - assert_equal grpc_response, response.grpc_op - assert_equal grpc_operation, operation - end - - # Use named arguments - client.wait_operation name: name, timeout: timeout do |response, operation| - assert_kind_of Gapic::Operation, response - assert_equal grpc_response, response.grpc_op - assert_equal grpc_operation, operation - end - - # Use protobuf object - client.wait_operation ::Google::Longrunning::WaitOperationRequest.new(name: name, timeout: timeout) do |response, operation| - assert_kind_of Gapic::Operation, response - assert_equal grpc_response, response.grpc_op - assert_equal grpc_operation, operation - end - - # Use hash object with options - client.wait_operation({ name: name, timeout: timeout }, grpc_options) do |response, operation| - assert_kind_of Gapic::Operation, response - assert_equal grpc_response, response.grpc_op - assert_equal grpc_operation, operation - end - - # Use protobuf object with options - client.wait_operation(::Google::Longrunning::WaitOperationRequest.new(name: name, timeout: timeout), grpc_options) do |response, operation| - assert_kind_of Gapic::Operation, response - assert_equal grpc_response, response.grpc_op - assert_equal grpc_operation, operation - end - - # Verify method calls - assert_equal 5, wait_operation_client_stub.call_rpc_count - end - end - - def test_configure - grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - - client = block_config = config = nil - dummy_stub = ClientStub.new nil, nil - Gapic::ServiceStub.stub :new, dummy_stub do - client = ::Google::Cloud::Security::PrivateCA::V1::CertificateAuthorityService::Operations.new do |config| - config.credentials = grpc_channel - end - end - - config = client.configure do |c| - block_config = c - end - - assert_same block_config, config - assert_kind_of ::Google::Cloud::Security::PrivateCA::V1::CertificateAuthorityService::Operations::Configuration, config - end -end diff --git a/owl-bot-staging/google-cloud-security-private_ca-v1/test/google/cloud/security/private_ca/v1/certificate_authority_service_paths_test.rb b/owl-bot-staging/google-cloud-security-private_ca-v1/test/google/cloud/security/private_ca/v1/certificate_authority_service_paths_test.rb deleted file mode 100644 index b5b52911b307..000000000000 --- a/owl-bot-staging/google-cloud-security-private_ca-v1/test/google/cloud/security/private_ca/v1/certificate_authority_service_paths_test.rb +++ /dev/null @@ -1,115 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -require "helper" - -require "gapic/grpc/service_stub" - -require "google/cloud/security/private_ca/v1/certificate_authority_service" - -class ::Google::Cloud::Security::PrivateCA::V1::CertificateAuthorityService::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_ca_pool_path - grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - ::Gapic::ServiceStub.stub :new, DummyStub.new do - client = ::Google::Cloud::Security::PrivateCA::V1::CertificateAuthorityService::Client.new do |config| - config.credentials = grpc_channel - end - - path = client.ca_pool_path project: "value0", location: "value1", ca_pool: "value2" - assert_equal "projects/value0/locations/value1/caPools/value2", path - end - end - - def test_certificate_path - grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - ::Gapic::ServiceStub.stub :new, DummyStub.new do - client = ::Google::Cloud::Security::PrivateCA::V1::CertificateAuthorityService::Client.new do |config| - config.credentials = grpc_channel - end - - path = client.certificate_path project: "value0", location: "value1", ca_pool: "value2", certificate: "value3" - assert_equal "projects/value0/locations/value1/caPools/value2/certificates/value3", path - end - end - - def test_certificate_authority_path - grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - ::Gapic::ServiceStub.stub :new, DummyStub.new do - client = ::Google::Cloud::Security::PrivateCA::V1::CertificateAuthorityService::Client.new do |config| - config.credentials = grpc_channel - end - - path = client.certificate_authority_path project: "value0", location: "value1", ca_pool: "value2", certificate_authority: "value3" - assert_equal "projects/value0/locations/value1/caPools/value2/certificateAuthorities/value3", path - end - end - - def test_certificate_revocation_list_path - grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - ::Gapic::ServiceStub.stub :new, DummyStub.new do - client = ::Google::Cloud::Security::PrivateCA::V1::CertificateAuthorityService::Client.new do |config| - config.credentials = grpc_channel - end - - path = client.certificate_revocation_list_path project: "value0", location: "value1", ca_pool: "value2", certificate_authority: "value3", certificate_revocation_list: "value4" - assert_equal "projects/value0/locations/value1/caPools/value2/certificateAuthorities/value3/certificateRevocationLists/value4", path - end - end - - def test_certificate_template_path - grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - ::Gapic::ServiceStub.stub :new, DummyStub.new do - client = ::Google::Cloud::Security::PrivateCA::V1::CertificateAuthorityService::Client.new do |config| - config.credentials = grpc_channel - end - - path = client.certificate_template_path project: "value0", location: "value1", certificate_template: "value2" - assert_equal "projects/value0/locations/value1/certificateTemplates/value2", path - end - end - - def test_location_path - grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - ::Gapic::ServiceStub.stub :new, DummyStub.new do - client = ::Google::Cloud::Security::PrivateCA::V1::CertificateAuthorityService::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 -end diff --git a/owl-bot-staging/google-cloud-security-private_ca-v1/test/google/cloud/security/private_ca/v1/certificate_authority_service_rest_test.rb b/owl-bot-staging/google-cloud-security-private_ca-v1/test/google/cloud/security/private_ca/v1/certificate_authority_service_rest_test.rb deleted file mode 100644 index 43086e9a3a4a..000000000000 --- a/owl-bot-staging/google-cloud-security-private_ca-v1/test/google/cloud/security/private_ca/v1/certificate_authority_service_rest_test.rb +++ /dev/null @@ -1,1726 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -require "helper" -require "gapic/rest" -require "google/cloud/security/privateca/v1/service_pb" -require "google/cloud/security/private_ca/v1/certificate_authority_service/rest" - - -class ::Google::Cloud::Security::PrivateCA::V1::CertificateAuthorityService::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_certificate - # Create test objects. - client_result = ::Google::Cloud::Security::PrivateCA::V1::Certificate.new - http_response = OpenStruct.new body: client_result.to_json - - call_options = {} - - # Create request parameters for a unary method. - parent = "hello world" - certificate_id = "hello world" - certificate = {} - request_id = "hello world" - validate_only = true - issuing_certificate_authority_id = "hello world" - - create_certificate_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| - assert options.metadata.key? :"x-goog-api-client" - assert options.metadata[:"x-goog-api-client"].include? "rest" - refute options.metadata[:"x-goog-api-client"].include? "grpc" - end - - ::Google::Cloud::Security::PrivateCA::V1::CertificateAuthorityService::Rest::ServiceStub.stub :transcode_create_certificate_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, create_certificate_client_stub do - # Create client - client = ::Google::Cloud::Security::PrivateCA::V1::CertificateAuthorityService::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - client.create_certificate({ parent: parent, certificate_id: certificate_id, certificate: certificate, request_id: request_id, validate_only: validate_only, issuing_certificate_authority_id: issuing_certificate_authority_id }) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use named arguments - client.create_certificate parent: parent, certificate_id: certificate_id, certificate: certificate, request_id: request_id, validate_only: validate_only, issuing_certificate_authority_id: issuing_certificate_authority_id do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object - client.create_certificate ::Google::Cloud::Security::PrivateCA::V1::CreateCertificateRequest.new(parent: parent, certificate_id: certificate_id, certificate: certificate, request_id: request_id, validate_only: validate_only, issuing_certificate_authority_id: issuing_certificate_authority_id) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use hash object with options - client.create_certificate({ parent: parent, certificate_id: certificate_id, certificate: certificate, request_id: request_id, validate_only: validate_only, issuing_certificate_authority_id: issuing_certificate_authority_id }, call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object with options - client.create_certificate(::Google::Cloud::Security::PrivateCA::V1::CreateCertificateRequest.new(parent: parent, certificate_id: certificate_id, certificate: certificate, request_id: request_id, validate_only: validate_only, issuing_certificate_authority_id: issuing_certificate_authority_id), call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Verify method calls - assert_equal 5, create_certificate_client_stub.call_count - end - end - end - - def test_get_certificate - # Create test objects. - client_result = ::Google::Cloud::Security::PrivateCA::V1::Certificate.new - http_response = OpenStruct.new body: client_result.to_json - - call_options = {} - - # Create request parameters for a unary method. - name = "hello world" - - get_certificate_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| - assert options.metadata.key? :"x-goog-api-client" - assert options.metadata[:"x-goog-api-client"].include? "rest" - refute options.metadata[:"x-goog-api-client"].include? "grpc" - end - - ::Google::Cloud::Security::PrivateCA::V1::CertificateAuthorityService::Rest::ServiceStub.stub :transcode_get_certificate_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, get_certificate_client_stub do - # Create client - client = ::Google::Cloud::Security::PrivateCA::V1::CertificateAuthorityService::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - client.get_certificate({ name: name }) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use named arguments - client.get_certificate name: name do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object - client.get_certificate ::Google::Cloud::Security::PrivateCA::V1::GetCertificateRequest.new(name: name) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use hash object with options - client.get_certificate({ name: name }, call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object with options - client.get_certificate(::Google::Cloud::Security::PrivateCA::V1::GetCertificateRequest.new(name: name), call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Verify method calls - assert_equal 5, get_certificate_client_stub.call_count - end - end - end - - def test_list_certificates - # Create test objects. - client_result = ::Google::Cloud::Security::PrivateCA::V1::ListCertificatesResponse.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" - order_by = "hello world" - - list_certificates_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| - assert options.metadata.key? :"x-goog-api-client" - assert options.metadata[:"x-goog-api-client"].include? "rest" - refute options.metadata[:"x-goog-api-client"].include? "grpc" - end - - ::Google::Cloud::Security::PrivateCA::V1::CertificateAuthorityService::Rest::ServiceStub.stub :transcode_list_certificates_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, list_certificates_client_stub do - # Create client - client = ::Google::Cloud::Security::PrivateCA::V1::CertificateAuthorityService::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - client.list_certificates({ parent: parent, page_size: page_size, page_token: page_token, filter: filter, order_by: order_by }) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use named arguments - client.list_certificates parent: parent, page_size: page_size, page_token: page_token, filter: filter, order_by: order_by do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object - client.list_certificates ::Google::Cloud::Security::PrivateCA::V1::ListCertificatesRequest.new(parent: parent, page_size: page_size, page_token: page_token, filter: filter, order_by: order_by) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use hash object with options - client.list_certificates({ parent: parent, page_size: page_size, page_token: page_token, filter: filter, order_by: order_by }, call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object with options - client.list_certificates(::Google::Cloud::Security::PrivateCA::V1::ListCertificatesRequest.new(parent: parent, page_size: page_size, page_token: page_token, filter: filter, order_by: order_by), call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Verify method calls - assert_equal 5, list_certificates_client_stub.call_count - end - end - end - - def test_revoke_certificate - # Create test objects. - client_result = ::Google::Cloud::Security::PrivateCA::V1::Certificate.new - http_response = OpenStruct.new body: client_result.to_json - - call_options = {} - - # Create request parameters for a unary method. - name = "hello world" - reason = :REVOCATION_REASON_UNSPECIFIED - request_id = "hello world" - - revoke_certificate_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| - assert options.metadata.key? :"x-goog-api-client" - assert options.metadata[:"x-goog-api-client"].include? "rest" - refute options.metadata[:"x-goog-api-client"].include? "grpc" - end - - ::Google::Cloud::Security::PrivateCA::V1::CertificateAuthorityService::Rest::ServiceStub.stub :transcode_revoke_certificate_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, revoke_certificate_client_stub do - # Create client - client = ::Google::Cloud::Security::PrivateCA::V1::CertificateAuthorityService::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - client.revoke_certificate({ name: name, reason: reason, request_id: request_id }) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use named arguments - client.revoke_certificate name: name, reason: reason, request_id: request_id do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object - client.revoke_certificate ::Google::Cloud::Security::PrivateCA::V1::RevokeCertificateRequest.new(name: name, reason: reason, request_id: request_id) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use hash object with options - client.revoke_certificate({ name: name, reason: reason, request_id: request_id }, call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object with options - client.revoke_certificate(::Google::Cloud::Security::PrivateCA::V1::RevokeCertificateRequest.new(name: name, reason: reason, request_id: request_id), call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Verify method calls - assert_equal 5, revoke_certificate_client_stub.call_count - end - end - end - - def test_update_certificate - # Create test objects. - client_result = ::Google::Cloud::Security::PrivateCA::V1::Certificate.new - http_response = OpenStruct.new body: client_result.to_json - - call_options = {} - - # Create request parameters for a unary method. - certificate = {} - update_mask = {} - request_id = "hello world" - - update_certificate_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| - assert options.metadata.key? :"x-goog-api-client" - assert options.metadata[:"x-goog-api-client"].include? "rest" - refute options.metadata[:"x-goog-api-client"].include? "grpc" - end - - ::Google::Cloud::Security::PrivateCA::V1::CertificateAuthorityService::Rest::ServiceStub.stub :transcode_update_certificate_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, update_certificate_client_stub do - # Create client - client = ::Google::Cloud::Security::PrivateCA::V1::CertificateAuthorityService::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - client.update_certificate({ certificate: certificate, update_mask: update_mask, request_id: request_id }) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use named arguments - client.update_certificate certificate: certificate, update_mask: update_mask, request_id: request_id do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object - client.update_certificate ::Google::Cloud::Security::PrivateCA::V1::UpdateCertificateRequest.new(certificate: certificate, update_mask: update_mask, request_id: request_id) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use hash object with options - client.update_certificate({ certificate: certificate, update_mask: update_mask, request_id: request_id }, call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object with options - client.update_certificate(::Google::Cloud::Security::PrivateCA::V1::UpdateCertificateRequest.new(certificate: certificate, update_mask: update_mask, request_id: request_id), call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Verify method calls - assert_equal 5, update_certificate_client_stub.call_count - end - end - end - - def test_activate_certificate_authority - # 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" - pem_ca_certificate = "hello world" - subordinate_config = {} - request_id = "hello world" - - activate_certificate_authority_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| - assert options.metadata.key? :"x-goog-api-client" - assert options.metadata[:"x-goog-api-client"].include? "rest" - refute options.metadata[:"x-goog-api-client"].include? "grpc" - end - - ::Google::Cloud::Security::PrivateCA::V1::CertificateAuthorityService::Rest::ServiceStub.stub :transcode_activate_certificate_authority_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, activate_certificate_authority_client_stub do - # Create client - client = ::Google::Cloud::Security::PrivateCA::V1::CertificateAuthorityService::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - client.activate_certificate_authority({ name: name, pem_ca_certificate: pem_ca_certificate, subordinate_config: subordinate_config, request_id: request_id }) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use named arguments - client.activate_certificate_authority name: name, pem_ca_certificate: pem_ca_certificate, subordinate_config: subordinate_config, request_id: request_id do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object - client.activate_certificate_authority ::Google::Cloud::Security::PrivateCA::V1::ActivateCertificateAuthorityRequest.new(name: name, pem_ca_certificate: pem_ca_certificate, subordinate_config: subordinate_config, request_id: request_id) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use hash object with options - client.activate_certificate_authority({ name: name, pem_ca_certificate: pem_ca_certificate, subordinate_config: subordinate_config, request_id: request_id }, call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object with options - client.activate_certificate_authority(::Google::Cloud::Security::PrivateCA::V1::ActivateCertificateAuthorityRequest.new(name: name, pem_ca_certificate: pem_ca_certificate, subordinate_config: subordinate_config, request_id: request_id), call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Verify method calls - assert_equal 5, activate_certificate_authority_client_stub.call_count - end - end - end - - def test_create_certificate_authority - # 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" - certificate_authority_id = "hello world" - certificate_authority = {} - request_id = "hello world" - - create_certificate_authority_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| - assert options.metadata.key? :"x-goog-api-client" - assert options.metadata[:"x-goog-api-client"].include? "rest" - refute options.metadata[:"x-goog-api-client"].include? "grpc" - end - - ::Google::Cloud::Security::PrivateCA::V1::CertificateAuthorityService::Rest::ServiceStub.stub :transcode_create_certificate_authority_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, create_certificate_authority_client_stub do - # Create client - client = ::Google::Cloud::Security::PrivateCA::V1::CertificateAuthorityService::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - client.create_certificate_authority({ parent: parent, certificate_authority_id: certificate_authority_id, certificate_authority: certificate_authority, request_id: request_id }) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use named arguments - client.create_certificate_authority parent: parent, certificate_authority_id: certificate_authority_id, certificate_authority: certificate_authority, request_id: request_id do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object - client.create_certificate_authority ::Google::Cloud::Security::PrivateCA::V1::CreateCertificateAuthorityRequest.new(parent: parent, certificate_authority_id: certificate_authority_id, certificate_authority: certificate_authority, request_id: request_id) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use hash object with options - client.create_certificate_authority({ parent: parent, certificate_authority_id: certificate_authority_id, certificate_authority: certificate_authority, request_id: request_id }, call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object with options - client.create_certificate_authority(::Google::Cloud::Security::PrivateCA::V1::CreateCertificateAuthorityRequest.new(parent: parent, certificate_authority_id: certificate_authority_id, certificate_authority: certificate_authority, request_id: request_id), call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Verify method calls - assert_equal 5, create_certificate_authority_client_stub.call_count - end - end - end - - def test_disable_certificate_authority - # 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" - request_id = "hello world" - ignore_dependent_resources = true - - disable_certificate_authority_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| - assert options.metadata.key? :"x-goog-api-client" - assert options.metadata[:"x-goog-api-client"].include? "rest" - refute options.metadata[:"x-goog-api-client"].include? "grpc" - end - - ::Google::Cloud::Security::PrivateCA::V1::CertificateAuthorityService::Rest::ServiceStub.stub :transcode_disable_certificate_authority_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, disable_certificate_authority_client_stub do - # Create client - client = ::Google::Cloud::Security::PrivateCA::V1::CertificateAuthorityService::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - client.disable_certificate_authority({ name: name, request_id: request_id, ignore_dependent_resources: ignore_dependent_resources }) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use named arguments - client.disable_certificate_authority name: name, request_id: request_id, ignore_dependent_resources: ignore_dependent_resources do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object - client.disable_certificate_authority ::Google::Cloud::Security::PrivateCA::V1::DisableCertificateAuthorityRequest.new(name: name, request_id: request_id, ignore_dependent_resources: ignore_dependent_resources) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use hash object with options - client.disable_certificate_authority({ name: name, request_id: request_id, ignore_dependent_resources: ignore_dependent_resources }, call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object with options - client.disable_certificate_authority(::Google::Cloud::Security::PrivateCA::V1::DisableCertificateAuthorityRequest.new(name: name, request_id: request_id, ignore_dependent_resources: ignore_dependent_resources), call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Verify method calls - assert_equal 5, disable_certificate_authority_client_stub.call_count - end - end - end - - def test_enable_certificate_authority - # 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" - request_id = "hello world" - - enable_certificate_authority_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| - assert options.metadata.key? :"x-goog-api-client" - assert options.metadata[:"x-goog-api-client"].include? "rest" - refute options.metadata[:"x-goog-api-client"].include? "grpc" - end - - ::Google::Cloud::Security::PrivateCA::V1::CertificateAuthorityService::Rest::ServiceStub.stub :transcode_enable_certificate_authority_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, enable_certificate_authority_client_stub do - # Create client - client = ::Google::Cloud::Security::PrivateCA::V1::CertificateAuthorityService::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - client.enable_certificate_authority({ name: name, request_id: request_id }) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use named arguments - client.enable_certificate_authority name: name, request_id: request_id do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object - client.enable_certificate_authority ::Google::Cloud::Security::PrivateCA::V1::EnableCertificateAuthorityRequest.new(name: name, request_id: request_id) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use hash object with options - client.enable_certificate_authority({ name: name, request_id: request_id }, call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object with options - client.enable_certificate_authority(::Google::Cloud::Security::PrivateCA::V1::EnableCertificateAuthorityRequest.new(name: name, request_id: request_id), call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Verify method calls - assert_equal 5, enable_certificate_authority_client_stub.call_count - end - end - end - - def test_fetch_certificate_authority_csr - # Create test objects. - client_result = ::Google::Cloud::Security::PrivateCA::V1::FetchCertificateAuthorityCsrResponse.new - http_response = OpenStruct.new body: client_result.to_json - - call_options = {} - - # Create request parameters for a unary method. - name = "hello world" - - fetch_certificate_authority_csr_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| - assert options.metadata.key? :"x-goog-api-client" - assert options.metadata[:"x-goog-api-client"].include? "rest" - refute options.metadata[:"x-goog-api-client"].include? "grpc" - end - - ::Google::Cloud::Security::PrivateCA::V1::CertificateAuthorityService::Rest::ServiceStub.stub :transcode_fetch_certificate_authority_csr_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, fetch_certificate_authority_csr_client_stub do - # Create client - client = ::Google::Cloud::Security::PrivateCA::V1::CertificateAuthorityService::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - client.fetch_certificate_authority_csr({ name: name }) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use named arguments - client.fetch_certificate_authority_csr name: name do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object - client.fetch_certificate_authority_csr ::Google::Cloud::Security::PrivateCA::V1::FetchCertificateAuthorityCsrRequest.new(name: name) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use hash object with options - client.fetch_certificate_authority_csr({ name: name }, call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object with options - client.fetch_certificate_authority_csr(::Google::Cloud::Security::PrivateCA::V1::FetchCertificateAuthorityCsrRequest.new(name: name), call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Verify method calls - assert_equal 5, fetch_certificate_authority_csr_client_stub.call_count - end - end - end - - def test_get_certificate_authority - # Create test objects. - client_result = ::Google::Cloud::Security::PrivateCA::V1::CertificateAuthority.new - http_response = OpenStruct.new body: client_result.to_json - - call_options = {} - - # Create request parameters for a unary method. - name = "hello world" - - get_certificate_authority_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| - assert options.metadata.key? :"x-goog-api-client" - assert options.metadata[:"x-goog-api-client"].include? "rest" - refute options.metadata[:"x-goog-api-client"].include? "grpc" - end - - ::Google::Cloud::Security::PrivateCA::V1::CertificateAuthorityService::Rest::ServiceStub.stub :transcode_get_certificate_authority_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, get_certificate_authority_client_stub do - # Create client - client = ::Google::Cloud::Security::PrivateCA::V1::CertificateAuthorityService::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - client.get_certificate_authority({ name: name }) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use named arguments - client.get_certificate_authority name: name do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object - client.get_certificate_authority ::Google::Cloud::Security::PrivateCA::V1::GetCertificateAuthorityRequest.new(name: name) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use hash object with options - client.get_certificate_authority({ name: name }, call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object with options - client.get_certificate_authority(::Google::Cloud::Security::PrivateCA::V1::GetCertificateAuthorityRequest.new(name: name), call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Verify method calls - assert_equal 5, get_certificate_authority_client_stub.call_count - end - end - end - - def test_list_certificate_authorities - # Create test objects. - client_result = ::Google::Cloud::Security::PrivateCA::V1::ListCertificateAuthoritiesResponse.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" - order_by = "hello world" - - list_certificate_authorities_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| - assert options.metadata.key? :"x-goog-api-client" - assert options.metadata[:"x-goog-api-client"].include? "rest" - refute options.metadata[:"x-goog-api-client"].include? "grpc" - end - - ::Google::Cloud::Security::PrivateCA::V1::CertificateAuthorityService::Rest::ServiceStub.stub :transcode_list_certificate_authorities_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, list_certificate_authorities_client_stub do - # Create client - client = ::Google::Cloud::Security::PrivateCA::V1::CertificateAuthorityService::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - client.list_certificate_authorities({ parent: parent, page_size: page_size, page_token: page_token, filter: filter, order_by: order_by }) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use named arguments - client.list_certificate_authorities parent: parent, page_size: page_size, page_token: page_token, filter: filter, order_by: order_by do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object - client.list_certificate_authorities ::Google::Cloud::Security::PrivateCA::V1::ListCertificateAuthoritiesRequest.new(parent: parent, page_size: page_size, page_token: page_token, filter: filter, order_by: order_by) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use hash object with options - client.list_certificate_authorities({ parent: parent, page_size: page_size, page_token: page_token, filter: filter, order_by: order_by }, call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object with options - client.list_certificate_authorities(::Google::Cloud::Security::PrivateCA::V1::ListCertificateAuthoritiesRequest.new(parent: parent, page_size: page_size, page_token: page_token, filter: filter, order_by: order_by), call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Verify method calls - assert_equal 5, list_certificate_authorities_client_stub.call_count - end - end - end - - def test_undelete_certificate_authority - # 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" - request_id = "hello world" - - undelete_certificate_authority_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| - assert options.metadata.key? :"x-goog-api-client" - assert options.metadata[:"x-goog-api-client"].include? "rest" - refute options.metadata[:"x-goog-api-client"].include? "grpc" - end - - ::Google::Cloud::Security::PrivateCA::V1::CertificateAuthorityService::Rest::ServiceStub.stub :transcode_undelete_certificate_authority_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, undelete_certificate_authority_client_stub do - # Create client - client = ::Google::Cloud::Security::PrivateCA::V1::CertificateAuthorityService::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - client.undelete_certificate_authority({ name: name, request_id: request_id }) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use named arguments - client.undelete_certificate_authority name: name, request_id: request_id do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object - client.undelete_certificate_authority ::Google::Cloud::Security::PrivateCA::V1::UndeleteCertificateAuthorityRequest.new(name: name, request_id: request_id) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use hash object with options - client.undelete_certificate_authority({ name: name, request_id: request_id }, call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object with options - client.undelete_certificate_authority(::Google::Cloud::Security::PrivateCA::V1::UndeleteCertificateAuthorityRequest.new(name: name, request_id: request_id), call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Verify method calls - assert_equal 5, undelete_certificate_authority_client_stub.call_count - end - end - end - - def test_delete_certificate_authority - # 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" - request_id = "hello world" - ignore_active_certificates = true - skip_grace_period = true - ignore_dependent_resources = true - - delete_certificate_authority_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| - assert options.metadata.key? :"x-goog-api-client" - assert options.metadata[:"x-goog-api-client"].include? "rest" - refute options.metadata[:"x-goog-api-client"].include? "grpc" - end - - ::Google::Cloud::Security::PrivateCA::V1::CertificateAuthorityService::Rest::ServiceStub.stub :transcode_delete_certificate_authority_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, delete_certificate_authority_client_stub do - # Create client - client = ::Google::Cloud::Security::PrivateCA::V1::CertificateAuthorityService::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - client.delete_certificate_authority({ name: name, request_id: request_id, ignore_active_certificates: ignore_active_certificates, skip_grace_period: skip_grace_period, ignore_dependent_resources: ignore_dependent_resources }) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use named arguments - client.delete_certificate_authority name: name, request_id: request_id, ignore_active_certificates: ignore_active_certificates, skip_grace_period: skip_grace_period, ignore_dependent_resources: ignore_dependent_resources do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object - client.delete_certificate_authority ::Google::Cloud::Security::PrivateCA::V1::DeleteCertificateAuthorityRequest.new(name: name, request_id: request_id, ignore_active_certificates: ignore_active_certificates, skip_grace_period: skip_grace_period, ignore_dependent_resources: ignore_dependent_resources) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use hash object with options - client.delete_certificate_authority({ name: name, request_id: request_id, ignore_active_certificates: ignore_active_certificates, skip_grace_period: skip_grace_period, ignore_dependent_resources: ignore_dependent_resources }, call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object with options - client.delete_certificate_authority(::Google::Cloud::Security::PrivateCA::V1::DeleteCertificateAuthorityRequest.new(name: name, request_id: request_id, ignore_active_certificates: ignore_active_certificates, skip_grace_period: skip_grace_period, ignore_dependent_resources: ignore_dependent_resources), call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Verify method calls - assert_equal 5, delete_certificate_authority_client_stub.call_count - end - end - end - - def test_update_certificate_authority - # 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. - certificate_authority = {} - update_mask = {} - request_id = "hello world" - - update_certificate_authority_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| - assert options.metadata.key? :"x-goog-api-client" - assert options.metadata[:"x-goog-api-client"].include? "rest" - refute options.metadata[:"x-goog-api-client"].include? "grpc" - end - - ::Google::Cloud::Security::PrivateCA::V1::CertificateAuthorityService::Rest::ServiceStub.stub :transcode_update_certificate_authority_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, update_certificate_authority_client_stub do - # Create client - client = ::Google::Cloud::Security::PrivateCA::V1::CertificateAuthorityService::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - client.update_certificate_authority({ certificate_authority: certificate_authority, update_mask: update_mask, request_id: request_id }) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use named arguments - client.update_certificate_authority certificate_authority: certificate_authority, update_mask: update_mask, request_id: request_id do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object - client.update_certificate_authority ::Google::Cloud::Security::PrivateCA::V1::UpdateCertificateAuthorityRequest.new(certificate_authority: certificate_authority, update_mask: update_mask, request_id: request_id) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use hash object with options - client.update_certificate_authority({ certificate_authority: certificate_authority, update_mask: update_mask, request_id: request_id }, call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object with options - client.update_certificate_authority(::Google::Cloud::Security::PrivateCA::V1::UpdateCertificateAuthorityRequest.new(certificate_authority: certificate_authority, update_mask: update_mask, request_id: request_id), call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Verify method calls - assert_equal 5, update_certificate_authority_client_stub.call_count - end - end - end - - def test_create_ca_pool - # 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" - ca_pool_id = "hello world" - ca_pool = {} - request_id = "hello world" - - create_ca_pool_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| - assert options.metadata.key? :"x-goog-api-client" - assert options.metadata[:"x-goog-api-client"].include? "rest" - refute options.metadata[:"x-goog-api-client"].include? "grpc" - end - - ::Google::Cloud::Security::PrivateCA::V1::CertificateAuthorityService::Rest::ServiceStub.stub :transcode_create_ca_pool_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, create_ca_pool_client_stub do - # Create client - client = ::Google::Cloud::Security::PrivateCA::V1::CertificateAuthorityService::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - client.create_ca_pool({ parent: parent, ca_pool_id: ca_pool_id, ca_pool: ca_pool, request_id: request_id }) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use named arguments - client.create_ca_pool parent: parent, ca_pool_id: ca_pool_id, ca_pool: ca_pool, request_id: request_id do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object - client.create_ca_pool ::Google::Cloud::Security::PrivateCA::V1::CreateCaPoolRequest.new(parent: parent, ca_pool_id: ca_pool_id, ca_pool: ca_pool, request_id: request_id) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use hash object with options - client.create_ca_pool({ parent: parent, ca_pool_id: ca_pool_id, ca_pool: ca_pool, request_id: request_id }, call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object with options - client.create_ca_pool(::Google::Cloud::Security::PrivateCA::V1::CreateCaPoolRequest.new(parent: parent, ca_pool_id: ca_pool_id, ca_pool: ca_pool, request_id: request_id), call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Verify method calls - assert_equal 5, create_ca_pool_client_stub.call_count - end - end - end - - def test_update_ca_pool - # 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. - ca_pool = {} - update_mask = {} - request_id = "hello world" - - update_ca_pool_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| - assert options.metadata.key? :"x-goog-api-client" - assert options.metadata[:"x-goog-api-client"].include? "rest" - refute options.metadata[:"x-goog-api-client"].include? "grpc" - end - - ::Google::Cloud::Security::PrivateCA::V1::CertificateAuthorityService::Rest::ServiceStub.stub :transcode_update_ca_pool_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, update_ca_pool_client_stub do - # Create client - client = ::Google::Cloud::Security::PrivateCA::V1::CertificateAuthorityService::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - client.update_ca_pool({ ca_pool: ca_pool, update_mask: update_mask, request_id: request_id }) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use named arguments - client.update_ca_pool ca_pool: ca_pool, update_mask: update_mask, request_id: request_id do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object - client.update_ca_pool ::Google::Cloud::Security::PrivateCA::V1::UpdateCaPoolRequest.new(ca_pool: ca_pool, update_mask: update_mask, request_id: request_id) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use hash object with options - client.update_ca_pool({ ca_pool: ca_pool, update_mask: update_mask, request_id: request_id }, call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object with options - client.update_ca_pool(::Google::Cloud::Security::PrivateCA::V1::UpdateCaPoolRequest.new(ca_pool: ca_pool, update_mask: update_mask, request_id: request_id), call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Verify method calls - assert_equal 5, update_ca_pool_client_stub.call_count - end - end - end - - def test_get_ca_pool - # Create test objects. - client_result = ::Google::Cloud::Security::PrivateCA::V1::CaPool.new - http_response = OpenStruct.new body: client_result.to_json - - call_options = {} - - # Create request parameters for a unary method. - name = "hello world" - - get_ca_pool_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| - assert options.metadata.key? :"x-goog-api-client" - assert options.metadata[:"x-goog-api-client"].include? "rest" - refute options.metadata[:"x-goog-api-client"].include? "grpc" - end - - ::Google::Cloud::Security::PrivateCA::V1::CertificateAuthorityService::Rest::ServiceStub.stub :transcode_get_ca_pool_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, get_ca_pool_client_stub do - # Create client - client = ::Google::Cloud::Security::PrivateCA::V1::CertificateAuthorityService::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - client.get_ca_pool({ name: name }) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use named arguments - client.get_ca_pool name: name do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object - client.get_ca_pool ::Google::Cloud::Security::PrivateCA::V1::GetCaPoolRequest.new(name: name) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use hash object with options - client.get_ca_pool({ name: name }, call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object with options - client.get_ca_pool(::Google::Cloud::Security::PrivateCA::V1::GetCaPoolRequest.new(name: name), call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Verify method calls - assert_equal 5, get_ca_pool_client_stub.call_count - end - end - end - - def test_list_ca_pools - # Create test objects. - client_result = ::Google::Cloud::Security::PrivateCA::V1::ListCaPoolsResponse.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" - order_by = "hello world" - - list_ca_pools_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| - assert options.metadata.key? :"x-goog-api-client" - assert options.metadata[:"x-goog-api-client"].include? "rest" - refute options.metadata[:"x-goog-api-client"].include? "grpc" - end - - ::Google::Cloud::Security::PrivateCA::V1::CertificateAuthorityService::Rest::ServiceStub.stub :transcode_list_ca_pools_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, list_ca_pools_client_stub do - # Create client - client = ::Google::Cloud::Security::PrivateCA::V1::CertificateAuthorityService::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - client.list_ca_pools({ parent: parent, page_size: page_size, page_token: page_token, filter: filter, order_by: order_by }) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use named arguments - client.list_ca_pools parent: parent, page_size: page_size, page_token: page_token, filter: filter, order_by: order_by do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object - client.list_ca_pools ::Google::Cloud::Security::PrivateCA::V1::ListCaPoolsRequest.new(parent: parent, page_size: page_size, page_token: page_token, filter: filter, order_by: order_by) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use hash object with options - client.list_ca_pools({ parent: parent, page_size: page_size, page_token: page_token, filter: filter, order_by: order_by }, call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object with options - client.list_ca_pools(::Google::Cloud::Security::PrivateCA::V1::ListCaPoolsRequest.new(parent: parent, page_size: page_size, page_token: page_token, filter: filter, order_by: order_by), call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Verify method calls - assert_equal 5, list_ca_pools_client_stub.call_count - end - end - end - - def test_delete_ca_pool - # 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" - request_id = "hello world" - ignore_dependent_resources = true - - delete_ca_pool_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| - assert options.metadata.key? :"x-goog-api-client" - assert options.metadata[:"x-goog-api-client"].include? "rest" - refute options.metadata[:"x-goog-api-client"].include? "grpc" - end - - ::Google::Cloud::Security::PrivateCA::V1::CertificateAuthorityService::Rest::ServiceStub.stub :transcode_delete_ca_pool_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, delete_ca_pool_client_stub do - # Create client - client = ::Google::Cloud::Security::PrivateCA::V1::CertificateAuthorityService::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - client.delete_ca_pool({ name: name, request_id: request_id, ignore_dependent_resources: ignore_dependent_resources }) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use named arguments - client.delete_ca_pool name: name, request_id: request_id, ignore_dependent_resources: ignore_dependent_resources do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object - client.delete_ca_pool ::Google::Cloud::Security::PrivateCA::V1::DeleteCaPoolRequest.new(name: name, request_id: request_id, ignore_dependent_resources: ignore_dependent_resources) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use hash object with options - client.delete_ca_pool({ name: name, request_id: request_id, ignore_dependent_resources: ignore_dependent_resources }, call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object with options - client.delete_ca_pool(::Google::Cloud::Security::PrivateCA::V1::DeleteCaPoolRequest.new(name: name, request_id: request_id, ignore_dependent_resources: ignore_dependent_resources), call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Verify method calls - assert_equal 5, delete_ca_pool_client_stub.call_count - end - end - end - - def test_fetch_ca_certs - # Create test objects. - client_result = ::Google::Cloud::Security::PrivateCA::V1::FetchCaCertsResponse.new - http_response = OpenStruct.new body: client_result.to_json - - call_options = {} - - # Create request parameters for a unary method. - ca_pool = "hello world" - request_id = "hello world" - - fetch_ca_certs_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| - assert options.metadata.key? :"x-goog-api-client" - assert options.metadata[:"x-goog-api-client"].include? "rest" - refute options.metadata[:"x-goog-api-client"].include? "grpc" - end - - ::Google::Cloud::Security::PrivateCA::V1::CertificateAuthorityService::Rest::ServiceStub.stub :transcode_fetch_ca_certs_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, fetch_ca_certs_client_stub do - # Create client - client = ::Google::Cloud::Security::PrivateCA::V1::CertificateAuthorityService::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - client.fetch_ca_certs({ ca_pool: ca_pool, request_id: request_id }) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use named arguments - client.fetch_ca_certs ca_pool: ca_pool, request_id: request_id do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object - client.fetch_ca_certs ::Google::Cloud::Security::PrivateCA::V1::FetchCaCertsRequest.new(ca_pool: ca_pool, request_id: request_id) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use hash object with options - client.fetch_ca_certs({ ca_pool: ca_pool, request_id: request_id }, call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object with options - client.fetch_ca_certs(::Google::Cloud::Security::PrivateCA::V1::FetchCaCertsRequest.new(ca_pool: ca_pool, request_id: request_id), call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Verify method calls - assert_equal 5, fetch_ca_certs_client_stub.call_count - end - end - end - - def test_get_certificate_revocation_list - # Create test objects. - client_result = ::Google::Cloud::Security::PrivateCA::V1::CertificateRevocationList.new - http_response = OpenStruct.new body: client_result.to_json - - call_options = {} - - # Create request parameters for a unary method. - name = "hello world" - - get_certificate_revocation_list_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| - assert options.metadata.key? :"x-goog-api-client" - assert options.metadata[:"x-goog-api-client"].include? "rest" - refute options.metadata[:"x-goog-api-client"].include? "grpc" - end - - ::Google::Cloud::Security::PrivateCA::V1::CertificateAuthorityService::Rest::ServiceStub.stub :transcode_get_certificate_revocation_list_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, get_certificate_revocation_list_client_stub do - # Create client - client = ::Google::Cloud::Security::PrivateCA::V1::CertificateAuthorityService::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - client.get_certificate_revocation_list({ name: name }) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use named arguments - client.get_certificate_revocation_list name: name do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object - client.get_certificate_revocation_list ::Google::Cloud::Security::PrivateCA::V1::GetCertificateRevocationListRequest.new(name: name) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use hash object with options - client.get_certificate_revocation_list({ name: name }, call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object with options - client.get_certificate_revocation_list(::Google::Cloud::Security::PrivateCA::V1::GetCertificateRevocationListRequest.new(name: name), call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Verify method calls - assert_equal 5, get_certificate_revocation_list_client_stub.call_count - end - end - end - - def test_list_certificate_revocation_lists - # Create test objects. - client_result = ::Google::Cloud::Security::PrivateCA::V1::ListCertificateRevocationListsResponse.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" - order_by = "hello world" - - list_certificate_revocation_lists_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| - assert options.metadata.key? :"x-goog-api-client" - assert options.metadata[:"x-goog-api-client"].include? "rest" - refute options.metadata[:"x-goog-api-client"].include? "grpc" - end - - ::Google::Cloud::Security::PrivateCA::V1::CertificateAuthorityService::Rest::ServiceStub.stub :transcode_list_certificate_revocation_lists_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, list_certificate_revocation_lists_client_stub do - # Create client - client = ::Google::Cloud::Security::PrivateCA::V1::CertificateAuthorityService::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - client.list_certificate_revocation_lists({ parent: parent, page_size: page_size, page_token: page_token, filter: filter, order_by: order_by }) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use named arguments - client.list_certificate_revocation_lists parent: parent, page_size: page_size, page_token: page_token, filter: filter, order_by: order_by do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object - client.list_certificate_revocation_lists ::Google::Cloud::Security::PrivateCA::V1::ListCertificateRevocationListsRequest.new(parent: parent, page_size: page_size, page_token: page_token, filter: filter, order_by: order_by) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use hash object with options - client.list_certificate_revocation_lists({ parent: parent, page_size: page_size, page_token: page_token, filter: filter, order_by: order_by }, call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object with options - client.list_certificate_revocation_lists(::Google::Cloud::Security::PrivateCA::V1::ListCertificateRevocationListsRequest.new(parent: parent, page_size: page_size, page_token: page_token, filter: filter, order_by: order_by), call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Verify method calls - assert_equal 5, list_certificate_revocation_lists_client_stub.call_count - end - end - end - - def test_update_certificate_revocation_list - # 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. - certificate_revocation_list = {} - update_mask = {} - request_id = "hello world" - - update_certificate_revocation_list_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| - assert options.metadata.key? :"x-goog-api-client" - assert options.metadata[:"x-goog-api-client"].include? "rest" - refute options.metadata[:"x-goog-api-client"].include? "grpc" - end - - ::Google::Cloud::Security::PrivateCA::V1::CertificateAuthorityService::Rest::ServiceStub.stub :transcode_update_certificate_revocation_list_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, update_certificate_revocation_list_client_stub do - # Create client - client = ::Google::Cloud::Security::PrivateCA::V1::CertificateAuthorityService::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - client.update_certificate_revocation_list({ certificate_revocation_list: certificate_revocation_list, update_mask: update_mask, request_id: request_id }) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use named arguments - client.update_certificate_revocation_list certificate_revocation_list: certificate_revocation_list, update_mask: update_mask, request_id: request_id do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object - client.update_certificate_revocation_list ::Google::Cloud::Security::PrivateCA::V1::UpdateCertificateRevocationListRequest.new(certificate_revocation_list: certificate_revocation_list, update_mask: update_mask, request_id: request_id) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use hash object with options - client.update_certificate_revocation_list({ certificate_revocation_list: certificate_revocation_list, update_mask: update_mask, request_id: request_id }, call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object with options - client.update_certificate_revocation_list(::Google::Cloud::Security::PrivateCA::V1::UpdateCertificateRevocationListRequest.new(certificate_revocation_list: certificate_revocation_list, update_mask: update_mask, request_id: request_id), call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Verify method calls - assert_equal 5, update_certificate_revocation_list_client_stub.call_count - end - end - end - - def test_create_certificate_template - # 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" - certificate_template_id = "hello world" - certificate_template = {} - request_id = "hello world" - - create_certificate_template_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| - assert options.metadata.key? :"x-goog-api-client" - assert options.metadata[:"x-goog-api-client"].include? "rest" - refute options.metadata[:"x-goog-api-client"].include? "grpc" - end - - ::Google::Cloud::Security::PrivateCA::V1::CertificateAuthorityService::Rest::ServiceStub.stub :transcode_create_certificate_template_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, create_certificate_template_client_stub do - # Create client - client = ::Google::Cloud::Security::PrivateCA::V1::CertificateAuthorityService::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - client.create_certificate_template({ parent: parent, certificate_template_id: certificate_template_id, certificate_template: certificate_template, request_id: request_id }) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use named arguments - client.create_certificate_template parent: parent, certificate_template_id: certificate_template_id, certificate_template: certificate_template, request_id: request_id do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object - client.create_certificate_template ::Google::Cloud::Security::PrivateCA::V1::CreateCertificateTemplateRequest.new(parent: parent, certificate_template_id: certificate_template_id, certificate_template: certificate_template, request_id: request_id) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use hash object with options - client.create_certificate_template({ parent: parent, certificate_template_id: certificate_template_id, certificate_template: certificate_template, request_id: request_id }, call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object with options - client.create_certificate_template(::Google::Cloud::Security::PrivateCA::V1::CreateCertificateTemplateRequest.new(parent: parent, certificate_template_id: certificate_template_id, certificate_template: certificate_template, request_id: request_id), call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Verify method calls - assert_equal 5, create_certificate_template_client_stub.call_count - end - end - end - - def test_delete_certificate_template - # 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" - request_id = "hello world" - - delete_certificate_template_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| - assert options.metadata.key? :"x-goog-api-client" - assert options.metadata[:"x-goog-api-client"].include? "rest" - refute options.metadata[:"x-goog-api-client"].include? "grpc" - end - - ::Google::Cloud::Security::PrivateCA::V1::CertificateAuthorityService::Rest::ServiceStub.stub :transcode_delete_certificate_template_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, delete_certificate_template_client_stub do - # Create client - client = ::Google::Cloud::Security::PrivateCA::V1::CertificateAuthorityService::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - client.delete_certificate_template({ name: name, request_id: request_id }) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use named arguments - client.delete_certificate_template name: name, request_id: request_id do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object - client.delete_certificate_template ::Google::Cloud::Security::PrivateCA::V1::DeleteCertificateTemplateRequest.new(name: name, request_id: request_id) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use hash object with options - client.delete_certificate_template({ name: name, request_id: request_id }, call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object with options - client.delete_certificate_template(::Google::Cloud::Security::PrivateCA::V1::DeleteCertificateTemplateRequest.new(name: name, request_id: request_id), call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Verify method calls - assert_equal 5, delete_certificate_template_client_stub.call_count - end - end - end - - def test_get_certificate_template - # Create test objects. - client_result = ::Google::Cloud::Security::PrivateCA::V1::CertificateTemplate.new - http_response = OpenStruct.new body: client_result.to_json - - call_options = {} - - # Create request parameters for a unary method. - name = "hello world" - - get_certificate_template_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| - assert options.metadata.key? :"x-goog-api-client" - assert options.metadata[:"x-goog-api-client"].include? "rest" - refute options.metadata[:"x-goog-api-client"].include? "grpc" - end - - ::Google::Cloud::Security::PrivateCA::V1::CertificateAuthorityService::Rest::ServiceStub.stub :transcode_get_certificate_template_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, get_certificate_template_client_stub do - # Create client - client = ::Google::Cloud::Security::PrivateCA::V1::CertificateAuthorityService::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - client.get_certificate_template({ name: name }) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use named arguments - client.get_certificate_template name: name do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object - client.get_certificate_template ::Google::Cloud::Security::PrivateCA::V1::GetCertificateTemplateRequest.new(name: name) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use hash object with options - client.get_certificate_template({ name: name }, call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object with options - client.get_certificate_template(::Google::Cloud::Security::PrivateCA::V1::GetCertificateTemplateRequest.new(name: name), call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Verify method calls - assert_equal 5, get_certificate_template_client_stub.call_count - end - end - end - - def test_list_certificate_templates - # Create test objects. - client_result = ::Google::Cloud::Security::PrivateCA::V1::ListCertificateTemplatesResponse.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" - order_by = "hello world" - - list_certificate_templates_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| - assert options.metadata.key? :"x-goog-api-client" - assert options.metadata[:"x-goog-api-client"].include? "rest" - refute options.metadata[:"x-goog-api-client"].include? "grpc" - end - - ::Google::Cloud::Security::PrivateCA::V1::CertificateAuthorityService::Rest::ServiceStub.stub :transcode_list_certificate_templates_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, list_certificate_templates_client_stub do - # Create client - client = ::Google::Cloud::Security::PrivateCA::V1::CertificateAuthorityService::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - client.list_certificate_templates({ parent: parent, page_size: page_size, page_token: page_token, filter: filter, order_by: order_by }) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use named arguments - client.list_certificate_templates parent: parent, page_size: page_size, page_token: page_token, filter: filter, order_by: order_by do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object - client.list_certificate_templates ::Google::Cloud::Security::PrivateCA::V1::ListCertificateTemplatesRequest.new(parent: parent, page_size: page_size, page_token: page_token, filter: filter, order_by: order_by) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use hash object with options - client.list_certificate_templates({ parent: parent, page_size: page_size, page_token: page_token, filter: filter, order_by: order_by }, call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object with options - client.list_certificate_templates(::Google::Cloud::Security::PrivateCA::V1::ListCertificateTemplatesRequest.new(parent: parent, page_size: page_size, page_token: page_token, filter: filter, order_by: order_by), call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Verify method calls - assert_equal 5, list_certificate_templates_client_stub.call_count - end - end - end - - def test_update_certificate_template - # 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. - certificate_template = {} - update_mask = {} - request_id = "hello world" - - update_certificate_template_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| - assert options.metadata.key? :"x-goog-api-client" - assert options.metadata[:"x-goog-api-client"].include? "rest" - refute options.metadata[:"x-goog-api-client"].include? "grpc" - end - - ::Google::Cloud::Security::PrivateCA::V1::CertificateAuthorityService::Rest::ServiceStub.stub :transcode_update_certificate_template_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, update_certificate_template_client_stub do - # Create client - client = ::Google::Cloud::Security::PrivateCA::V1::CertificateAuthorityService::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - client.update_certificate_template({ certificate_template: certificate_template, update_mask: update_mask, request_id: request_id }) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use named arguments - client.update_certificate_template certificate_template: certificate_template, update_mask: update_mask, request_id: request_id do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object - client.update_certificate_template ::Google::Cloud::Security::PrivateCA::V1::UpdateCertificateTemplateRequest.new(certificate_template: certificate_template, update_mask: update_mask, request_id: request_id) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use hash object with options - client.update_certificate_template({ certificate_template: certificate_template, update_mask: update_mask, request_id: request_id }, call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object with options - client.update_certificate_template(::Google::Cloud::Security::PrivateCA::V1::UpdateCertificateTemplateRequest.new(certificate_template: certificate_template, update_mask: update_mask, request_id: request_id), call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Verify method calls - assert_equal 5, update_certificate_template_client_stub.call_count - end - end - end - - def test_configure - credentials_token = :dummy_value - - client = block_config = config = nil - dummy_stub = ClientStub.new nil - Gapic::Rest::ClientStub.stub :new, dummy_stub do - client = ::Google::Cloud::Security::PrivateCA::V1::CertificateAuthorityService::Rest::Client.new do |config| - config.credentials = credentials_token - end - end - - config = client.configure do |c| - block_config = c - end - - assert_same block_config, config - assert_kind_of ::Google::Cloud::Security::PrivateCA::V1::CertificateAuthorityService::Rest::Client::Configuration, config - end -end diff --git a/owl-bot-staging/google-cloud-security-private_ca-v1/test/google/cloud/security/private_ca/v1/certificate_authority_service_test.rb b/owl-bot-staging/google-cloud-security-private_ca-v1/test/google/cloud/security/private_ca/v1/certificate_authority_service_test.rb deleted file mode 100644 index 85e8ca47f9dc..000000000000 --- a/owl-bot-staging/google-cloud-security-private_ca-v1/test/google/cloud/security/private_ca/v1/certificate_authority_service_test.rb +++ /dev/null @@ -1,2017 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -require "helper" - -require "gapic/grpc/service_stub" - -require "google/cloud/security/privateca/v1/service_pb" -require "google/cloud/security/private_ca/v1/certificate_authority_service" - -class ::Google::Cloud::Security::PrivateCA::V1::CertificateAuthorityService::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_certificate - # Create GRPC objects. - grpc_response = ::Google::Cloud::Security::PrivateCA::V1::Certificate.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" - certificate_id = "hello world" - certificate = {} - request_id = "hello world" - validate_only = true - issuing_certificate_authority_id = "hello world" - - create_certificate_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :create_certificate, name - assert_kind_of ::Google::Cloud::Security::PrivateCA::V1::CreateCertificateRequest, request - assert_equal "hello world", request["parent"] - assert_equal "hello world", request["certificate_id"] - assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::Security::PrivateCA::V1::Certificate), request["certificate"] - assert_equal "hello world", request["request_id"] - assert_equal true, request["validate_only"] - assert_equal "hello world", request["issuing_certificate_authority_id"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, create_certificate_client_stub do - # Create client - client = ::Google::Cloud::Security::PrivateCA::V1::CertificateAuthorityService::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.create_certificate({ parent: parent, certificate_id: certificate_id, certificate: certificate, request_id: request_id, validate_only: validate_only, issuing_certificate_authority_id: issuing_certificate_authority_id }) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use named arguments - client.create_certificate parent: parent, certificate_id: certificate_id, certificate: certificate, request_id: request_id, validate_only: validate_only, issuing_certificate_authority_id: issuing_certificate_authority_id do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object - client.create_certificate ::Google::Cloud::Security::PrivateCA::V1::CreateCertificateRequest.new(parent: parent, certificate_id: certificate_id, certificate: certificate, request_id: request_id, validate_only: validate_only, issuing_certificate_authority_id: issuing_certificate_authority_id) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use hash object with options - client.create_certificate({ parent: parent, certificate_id: certificate_id, certificate: certificate, request_id: request_id, validate_only: validate_only, issuing_certificate_authority_id: issuing_certificate_authority_id }, grpc_options) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object with options - client.create_certificate(::Google::Cloud::Security::PrivateCA::V1::CreateCertificateRequest.new(parent: parent, certificate_id: certificate_id, certificate: certificate, request_id: request_id, validate_only: validate_only, issuing_certificate_authority_id: issuing_certificate_authority_id), grpc_options) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Verify method calls - assert_equal 5, create_certificate_client_stub.call_rpc_count - end - end - - def test_get_certificate - # Create GRPC objects. - grpc_response = ::Google::Cloud::Security::PrivateCA::V1::Certificate.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_certificate_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :get_certificate, name - assert_kind_of ::Google::Cloud::Security::PrivateCA::V1::GetCertificateRequest, request - assert_equal "hello world", request["name"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, get_certificate_client_stub do - # Create client - client = ::Google::Cloud::Security::PrivateCA::V1::CertificateAuthorityService::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.get_certificate({ name: name }) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use named arguments - client.get_certificate name: name do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object - client.get_certificate ::Google::Cloud::Security::PrivateCA::V1::GetCertificateRequest.new(name: name) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use hash object with options - client.get_certificate({ 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_certificate(::Google::Cloud::Security::PrivateCA::V1::GetCertificateRequest.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_certificate_client_stub.call_rpc_count - end - end - - def test_list_certificates - # Create GRPC objects. - grpc_response = ::Google::Cloud::Security::PrivateCA::V1::ListCertificatesResponse.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" - order_by = "hello world" - - list_certificates_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :list_certificates, name - assert_kind_of ::Google::Cloud::Security::PrivateCA::V1::ListCertificatesRequest, 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"] - assert_equal "hello world", request["order_by"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, list_certificates_client_stub do - # Create client - client = ::Google::Cloud::Security::PrivateCA::V1::CertificateAuthorityService::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.list_certificates({ parent: parent, page_size: page_size, page_token: page_token, filter: filter, order_by: order_by }) 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_certificates parent: parent, page_size: page_size, page_token: page_token, filter: filter, order_by: order_by 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_certificates ::Google::Cloud::Security::PrivateCA::V1::ListCertificatesRequest.new(parent: parent, page_size: page_size, page_token: page_token, filter: filter, order_by: order_by) 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_certificates({ parent: parent, page_size: page_size, page_token: page_token, filter: filter, order_by: order_by }, 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_certificates(::Google::Cloud::Security::PrivateCA::V1::ListCertificatesRequest.new(parent: parent, page_size: page_size, page_token: page_token, filter: filter, order_by: order_by), 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_certificates_client_stub.call_rpc_count - end - end - - def test_revoke_certificate - # Create GRPC objects. - grpc_response = ::Google::Cloud::Security::PrivateCA::V1::Certificate.new - grpc_operation = GRPC::ActiveCall::Operation.new nil - grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - grpc_options = {} - - # Create request parameters for a unary method. - name = "hello world" - reason = :REVOCATION_REASON_UNSPECIFIED - request_id = "hello world" - - revoke_certificate_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :revoke_certificate, name - assert_kind_of ::Google::Cloud::Security::PrivateCA::V1::RevokeCertificateRequest, request - assert_equal "hello world", request["name"] - assert_equal :REVOCATION_REASON_UNSPECIFIED, request["reason"] - assert_equal "hello world", request["request_id"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, revoke_certificate_client_stub do - # Create client - client = ::Google::Cloud::Security::PrivateCA::V1::CertificateAuthorityService::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.revoke_certificate({ name: name, reason: reason, request_id: request_id }) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use named arguments - client.revoke_certificate name: name, reason: reason, request_id: request_id do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object - client.revoke_certificate ::Google::Cloud::Security::PrivateCA::V1::RevokeCertificateRequest.new(name: name, reason: reason, request_id: request_id) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use hash object with options - client.revoke_certificate({ name: name, reason: reason, request_id: request_id }, grpc_options) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object with options - client.revoke_certificate(::Google::Cloud::Security::PrivateCA::V1::RevokeCertificateRequest.new(name: name, reason: reason, request_id: request_id), grpc_options) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Verify method calls - assert_equal 5, revoke_certificate_client_stub.call_rpc_count - end - end - - def test_update_certificate - # Create GRPC objects. - grpc_response = ::Google::Cloud::Security::PrivateCA::V1::Certificate.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. - certificate = {} - update_mask = {} - request_id = "hello world" - - update_certificate_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :update_certificate, name - assert_kind_of ::Google::Cloud::Security::PrivateCA::V1::UpdateCertificateRequest, request - assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::Security::PrivateCA::V1::Certificate), request["certificate"] - assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Protobuf::FieldMask), request["update_mask"] - assert_equal "hello world", request["request_id"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, update_certificate_client_stub do - # Create client - client = ::Google::Cloud::Security::PrivateCA::V1::CertificateAuthorityService::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.update_certificate({ certificate: certificate, update_mask: update_mask, request_id: request_id }) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use named arguments - client.update_certificate certificate: certificate, update_mask: update_mask, request_id: request_id do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object - client.update_certificate ::Google::Cloud::Security::PrivateCA::V1::UpdateCertificateRequest.new(certificate: certificate, update_mask: update_mask, request_id: request_id) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use hash object with options - client.update_certificate({ certificate: certificate, update_mask: update_mask, request_id: request_id }, grpc_options) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object with options - client.update_certificate(::Google::Cloud::Security::PrivateCA::V1::UpdateCertificateRequest.new(certificate: certificate, update_mask: update_mask, request_id: request_id), grpc_options) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Verify method calls - assert_equal 5, update_certificate_client_stub.call_rpc_count - end - end - - def test_activate_certificate_authority - # 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" - pem_ca_certificate = "hello world" - subordinate_config = {} - request_id = "hello world" - - activate_certificate_authority_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :activate_certificate_authority, name - assert_kind_of ::Google::Cloud::Security::PrivateCA::V1::ActivateCertificateAuthorityRequest, request - assert_equal "hello world", request["name"] - assert_equal "hello world", request["pem_ca_certificate"] - assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::Security::PrivateCA::V1::SubordinateConfig), request["subordinate_config"] - assert_equal "hello world", request["request_id"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, activate_certificate_authority_client_stub do - # Create client - client = ::Google::Cloud::Security::PrivateCA::V1::CertificateAuthorityService::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.activate_certificate_authority({ name: name, pem_ca_certificate: pem_ca_certificate, subordinate_config: subordinate_config, request_id: request_id }) do |response, operation| - assert_kind_of Gapic::Operation, response - assert_equal grpc_response, response.grpc_op - assert_equal grpc_operation, operation - end - - # Use named arguments - client.activate_certificate_authority name: name, pem_ca_certificate: pem_ca_certificate, subordinate_config: subordinate_config, request_id: request_id do |response, operation| - assert_kind_of Gapic::Operation, response - assert_equal grpc_response, response.grpc_op - assert_equal grpc_operation, operation - end - - # Use protobuf object - client.activate_certificate_authority ::Google::Cloud::Security::PrivateCA::V1::ActivateCertificateAuthorityRequest.new(name: name, pem_ca_certificate: pem_ca_certificate, subordinate_config: subordinate_config, request_id: request_id) do |response, operation| - assert_kind_of Gapic::Operation, response - assert_equal grpc_response, response.grpc_op - assert_equal grpc_operation, operation - end - - # Use hash object with options - client.activate_certificate_authority({ name: name, pem_ca_certificate: pem_ca_certificate, subordinate_config: subordinate_config, request_id: request_id }, grpc_options) do |response, operation| - assert_kind_of Gapic::Operation, response - assert_equal grpc_response, response.grpc_op - assert_equal grpc_operation, operation - end - - # Use protobuf object with options - client.activate_certificate_authority(::Google::Cloud::Security::PrivateCA::V1::ActivateCertificateAuthorityRequest.new(name: name, pem_ca_certificate: pem_ca_certificate, subordinate_config: subordinate_config, request_id: request_id), grpc_options) do |response, operation| - assert_kind_of Gapic::Operation, response - assert_equal grpc_response, response.grpc_op - assert_equal grpc_operation, operation - end - - # Verify method calls - assert_equal 5, activate_certificate_authority_client_stub.call_rpc_count - end - end - - def test_create_certificate_authority - # 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" - certificate_authority_id = "hello world" - certificate_authority = {} - request_id = "hello world" - - create_certificate_authority_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :create_certificate_authority, name - assert_kind_of ::Google::Cloud::Security::PrivateCA::V1::CreateCertificateAuthorityRequest, request - assert_equal "hello world", request["parent"] - assert_equal "hello world", request["certificate_authority_id"] - assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::Security::PrivateCA::V1::CertificateAuthority), request["certificate_authority"] - assert_equal "hello world", request["request_id"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, create_certificate_authority_client_stub do - # Create client - client = ::Google::Cloud::Security::PrivateCA::V1::CertificateAuthorityService::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.create_certificate_authority({ parent: parent, certificate_authority_id: certificate_authority_id, certificate_authority: certificate_authority, request_id: request_id }) do |response, operation| - assert_kind_of Gapic::Operation, response - assert_equal grpc_response, response.grpc_op - assert_equal grpc_operation, operation - end - - # Use named arguments - client.create_certificate_authority parent: parent, certificate_authority_id: certificate_authority_id, certificate_authority: certificate_authority, request_id: request_id do |response, operation| - assert_kind_of Gapic::Operation, response - assert_equal grpc_response, response.grpc_op - assert_equal grpc_operation, operation - end - - # Use protobuf object - client.create_certificate_authority ::Google::Cloud::Security::PrivateCA::V1::CreateCertificateAuthorityRequest.new(parent: parent, certificate_authority_id: certificate_authority_id, certificate_authority: certificate_authority, request_id: request_id) do |response, operation| - assert_kind_of Gapic::Operation, response - assert_equal grpc_response, response.grpc_op - assert_equal grpc_operation, operation - end - - # Use hash object with options - client.create_certificate_authority({ parent: parent, certificate_authority_id: certificate_authority_id, certificate_authority: certificate_authority, request_id: request_id }, grpc_options) do |response, operation| - assert_kind_of Gapic::Operation, response - assert_equal grpc_response, response.grpc_op - assert_equal grpc_operation, operation - end - - # Use protobuf object with options - client.create_certificate_authority(::Google::Cloud::Security::PrivateCA::V1::CreateCertificateAuthorityRequest.new(parent: parent, certificate_authority_id: certificate_authority_id, certificate_authority: certificate_authority, request_id: request_id), grpc_options) do |response, operation| - assert_kind_of Gapic::Operation, response - assert_equal grpc_response, response.grpc_op - assert_equal grpc_operation, operation - end - - # Verify method calls - assert_equal 5, create_certificate_authority_client_stub.call_rpc_count - end - end - - def test_disable_certificate_authority - # 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" - request_id = "hello world" - ignore_dependent_resources = true - - disable_certificate_authority_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :disable_certificate_authority, name - assert_kind_of ::Google::Cloud::Security::PrivateCA::V1::DisableCertificateAuthorityRequest, request - assert_equal "hello world", request["name"] - assert_equal "hello world", request["request_id"] - assert_equal true, request["ignore_dependent_resources"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, disable_certificate_authority_client_stub do - # Create client - client = ::Google::Cloud::Security::PrivateCA::V1::CertificateAuthorityService::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.disable_certificate_authority({ name: name, request_id: request_id, ignore_dependent_resources: ignore_dependent_resources }) 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.disable_certificate_authority name: name, request_id: request_id, ignore_dependent_resources: ignore_dependent_resources 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.disable_certificate_authority ::Google::Cloud::Security::PrivateCA::V1::DisableCertificateAuthorityRequest.new(name: name, request_id: request_id, ignore_dependent_resources: ignore_dependent_resources) 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.disable_certificate_authority({ name: name, request_id: request_id, ignore_dependent_resources: ignore_dependent_resources }, 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.disable_certificate_authority(::Google::Cloud::Security::PrivateCA::V1::DisableCertificateAuthorityRequest.new(name: name, request_id: request_id, ignore_dependent_resources: ignore_dependent_resources), 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, disable_certificate_authority_client_stub.call_rpc_count - end - end - - def test_enable_certificate_authority - # 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" - request_id = "hello world" - - enable_certificate_authority_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :enable_certificate_authority, name - assert_kind_of ::Google::Cloud::Security::PrivateCA::V1::EnableCertificateAuthorityRequest, request - assert_equal "hello world", request["name"] - assert_equal "hello world", request["request_id"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, enable_certificate_authority_client_stub do - # Create client - client = ::Google::Cloud::Security::PrivateCA::V1::CertificateAuthorityService::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.enable_certificate_authority({ name: name, request_id: request_id }) do |response, operation| - assert_kind_of Gapic::Operation, response - assert_equal grpc_response, response.grpc_op - assert_equal grpc_operation, operation - end - - # Use named arguments - client.enable_certificate_authority name: name, request_id: request_id do |response, operation| - assert_kind_of Gapic::Operation, response - assert_equal grpc_response, response.grpc_op - assert_equal grpc_operation, operation - end - - # Use protobuf object - client.enable_certificate_authority ::Google::Cloud::Security::PrivateCA::V1::EnableCertificateAuthorityRequest.new(name: name, request_id: request_id) do |response, operation| - assert_kind_of Gapic::Operation, response - assert_equal grpc_response, response.grpc_op - assert_equal grpc_operation, operation - end - - # Use hash object with options - client.enable_certificate_authority({ name: name, request_id: request_id }, grpc_options) do |response, operation| - assert_kind_of Gapic::Operation, response - assert_equal grpc_response, response.grpc_op - assert_equal grpc_operation, operation - end - - # Use protobuf object with options - client.enable_certificate_authority(::Google::Cloud::Security::PrivateCA::V1::EnableCertificateAuthorityRequest.new(name: name, request_id: request_id), grpc_options) do |response, operation| - assert_kind_of Gapic::Operation, response - assert_equal grpc_response, response.grpc_op - assert_equal grpc_operation, operation - end - - # Verify method calls - assert_equal 5, enable_certificate_authority_client_stub.call_rpc_count - end - end - - def test_fetch_certificate_authority_csr - # Create GRPC objects. - grpc_response = ::Google::Cloud::Security::PrivateCA::V1::FetchCertificateAuthorityCsrResponse.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" - - fetch_certificate_authority_csr_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :fetch_certificate_authority_csr, name - assert_kind_of ::Google::Cloud::Security::PrivateCA::V1::FetchCertificateAuthorityCsrRequest, request - assert_equal "hello world", request["name"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, fetch_certificate_authority_csr_client_stub do - # Create client - client = ::Google::Cloud::Security::PrivateCA::V1::CertificateAuthorityService::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.fetch_certificate_authority_csr({ name: name }) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use named arguments - client.fetch_certificate_authority_csr name: name do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object - client.fetch_certificate_authority_csr ::Google::Cloud::Security::PrivateCA::V1::FetchCertificateAuthorityCsrRequest.new(name: name) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use hash object with options - client.fetch_certificate_authority_csr({ name: name }, grpc_options) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object with options - client.fetch_certificate_authority_csr(::Google::Cloud::Security::PrivateCA::V1::FetchCertificateAuthorityCsrRequest.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, fetch_certificate_authority_csr_client_stub.call_rpc_count - end - end - - def test_get_certificate_authority - # Create GRPC objects. - grpc_response = ::Google::Cloud::Security::PrivateCA::V1::CertificateAuthority.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_certificate_authority_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :get_certificate_authority, name - assert_kind_of ::Google::Cloud::Security::PrivateCA::V1::GetCertificateAuthorityRequest, request - assert_equal "hello world", request["name"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, get_certificate_authority_client_stub do - # Create client - client = ::Google::Cloud::Security::PrivateCA::V1::CertificateAuthorityService::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.get_certificate_authority({ name: name }) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use named arguments - client.get_certificate_authority name: name do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object - client.get_certificate_authority ::Google::Cloud::Security::PrivateCA::V1::GetCertificateAuthorityRequest.new(name: name) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use hash object with options - client.get_certificate_authority({ 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_certificate_authority(::Google::Cloud::Security::PrivateCA::V1::GetCertificateAuthorityRequest.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_certificate_authority_client_stub.call_rpc_count - end - end - - def test_list_certificate_authorities - # Create GRPC objects. - grpc_response = ::Google::Cloud::Security::PrivateCA::V1::ListCertificateAuthoritiesResponse.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" - order_by = "hello world" - - list_certificate_authorities_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :list_certificate_authorities, name - assert_kind_of ::Google::Cloud::Security::PrivateCA::V1::ListCertificateAuthoritiesRequest, 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"] - assert_equal "hello world", request["order_by"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, list_certificate_authorities_client_stub do - # Create client - client = ::Google::Cloud::Security::PrivateCA::V1::CertificateAuthorityService::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.list_certificate_authorities({ parent: parent, page_size: page_size, page_token: page_token, filter: filter, order_by: order_by }) 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_certificate_authorities parent: parent, page_size: page_size, page_token: page_token, filter: filter, order_by: order_by 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_certificate_authorities ::Google::Cloud::Security::PrivateCA::V1::ListCertificateAuthoritiesRequest.new(parent: parent, page_size: page_size, page_token: page_token, filter: filter, order_by: order_by) 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_certificate_authorities({ parent: parent, page_size: page_size, page_token: page_token, filter: filter, order_by: order_by }, 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_certificate_authorities(::Google::Cloud::Security::PrivateCA::V1::ListCertificateAuthoritiesRequest.new(parent: parent, page_size: page_size, page_token: page_token, filter: filter, order_by: order_by), 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_certificate_authorities_client_stub.call_rpc_count - end - end - - def test_undelete_certificate_authority - # 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" - request_id = "hello world" - - undelete_certificate_authority_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :undelete_certificate_authority, name - assert_kind_of ::Google::Cloud::Security::PrivateCA::V1::UndeleteCertificateAuthorityRequest, request - assert_equal "hello world", request["name"] - assert_equal "hello world", request["request_id"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, undelete_certificate_authority_client_stub do - # Create client - client = ::Google::Cloud::Security::PrivateCA::V1::CertificateAuthorityService::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.undelete_certificate_authority({ name: name, request_id: request_id }) do |response, operation| - assert_kind_of Gapic::Operation, response - assert_equal grpc_response, response.grpc_op - assert_equal grpc_operation, operation - end - - # Use named arguments - client.undelete_certificate_authority name: name, request_id: request_id do |response, operation| - assert_kind_of Gapic::Operation, response - assert_equal grpc_response, response.grpc_op - assert_equal grpc_operation, operation - end - - # Use protobuf object - client.undelete_certificate_authority ::Google::Cloud::Security::PrivateCA::V1::UndeleteCertificateAuthorityRequest.new(name: name, request_id: request_id) do |response, operation| - assert_kind_of Gapic::Operation, response - assert_equal grpc_response, response.grpc_op - assert_equal grpc_operation, operation - end - - # Use hash object with options - client.undelete_certificate_authority({ name: name, request_id: request_id }, grpc_options) do |response, operation| - assert_kind_of Gapic::Operation, response - assert_equal grpc_response, response.grpc_op - assert_equal grpc_operation, operation - end - - # Use protobuf object with options - client.undelete_certificate_authority(::Google::Cloud::Security::PrivateCA::V1::UndeleteCertificateAuthorityRequest.new(name: name, request_id: request_id), grpc_options) do |response, operation| - assert_kind_of Gapic::Operation, response - assert_equal grpc_response, response.grpc_op - assert_equal grpc_operation, operation - end - - # Verify method calls - assert_equal 5, undelete_certificate_authority_client_stub.call_rpc_count - end - end - - def test_delete_certificate_authority - # 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" - request_id = "hello world" - ignore_active_certificates = true - skip_grace_period = true - ignore_dependent_resources = true - - delete_certificate_authority_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :delete_certificate_authority, name - assert_kind_of ::Google::Cloud::Security::PrivateCA::V1::DeleteCertificateAuthorityRequest, request - assert_equal "hello world", request["name"] - assert_equal "hello world", request["request_id"] - assert_equal true, request["ignore_active_certificates"] - assert_equal true, request["skip_grace_period"] - assert_equal true, request["ignore_dependent_resources"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, delete_certificate_authority_client_stub do - # Create client - client = ::Google::Cloud::Security::PrivateCA::V1::CertificateAuthorityService::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.delete_certificate_authority({ name: name, request_id: request_id, ignore_active_certificates: ignore_active_certificates, skip_grace_period: skip_grace_period, ignore_dependent_resources: ignore_dependent_resources }) 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_certificate_authority name: name, request_id: request_id, ignore_active_certificates: ignore_active_certificates, skip_grace_period: skip_grace_period, ignore_dependent_resources: ignore_dependent_resources 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_certificate_authority ::Google::Cloud::Security::PrivateCA::V1::DeleteCertificateAuthorityRequest.new(name: name, request_id: request_id, ignore_active_certificates: ignore_active_certificates, skip_grace_period: skip_grace_period, ignore_dependent_resources: ignore_dependent_resources) 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_certificate_authority({ name: name, request_id: request_id, ignore_active_certificates: ignore_active_certificates, skip_grace_period: skip_grace_period, ignore_dependent_resources: ignore_dependent_resources }, 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_certificate_authority(::Google::Cloud::Security::PrivateCA::V1::DeleteCertificateAuthorityRequest.new(name: name, request_id: request_id, ignore_active_certificates: ignore_active_certificates, skip_grace_period: skip_grace_period, ignore_dependent_resources: ignore_dependent_resources), 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_certificate_authority_client_stub.call_rpc_count - end - end - - def test_update_certificate_authority - # 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. - certificate_authority = {} - update_mask = {} - request_id = "hello world" - - update_certificate_authority_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :update_certificate_authority, name - assert_kind_of ::Google::Cloud::Security::PrivateCA::V1::UpdateCertificateAuthorityRequest, request - assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::Security::PrivateCA::V1::CertificateAuthority), request["certificate_authority"] - assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Protobuf::FieldMask), request["update_mask"] - assert_equal "hello world", request["request_id"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, update_certificate_authority_client_stub do - # Create client - client = ::Google::Cloud::Security::PrivateCA::V1::CertificateAuthorityService::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.update_certificate_authority({ certificate_authority: certificate_authority, update_mask: update_mask, request_id: request_id }) do |response, operation| - assert_kind_of Gapic::Operation, response - assert_equal grpc_response, response.grpc_op - assert_equal grpc_operation, operation - end - - # Use named arguments - client.update_certificate_authority certificate_authority: certificate_authority, update_mask: update_mask, request_id: request_id do |response, operation| - assert_kind_of Gapic::Operation, response - assert_equal grpc_response, response.grpc_op - assert_equal grpc_operation, operation - end - - # Use protobuf object - client.update_certificate_authority ::Google::Cloud::Security::PrivateCA::V1::UpdateCertificateAuthorityRequest.new(certificate_authority: certificate_authority, update_mask: update_mask, request_id: request_id) do |response, operation| - assert_kind_of Gapic::Operation, response - assert_equal grpc_response, response.grpc_op - assert_equal grpc_operation, operation - end - - # Use hash object with options - client.update_certificate_authority({ certificate_authority: certificate_authority, update_mask: update_mask, request_id: request_id }, grpc_options) do |response, operation| - assert_kind_of Gapic::Operation, response - assert_equal grpc_response, response.grpc_op - assert_equal grpc_operation, operation - end - - # Use protobuf object with options - client.update_certificate_authority(::Google::Cloud::Security::PrivateCA::V1::UpdateCertificateAuthorityRequest.new(certificate_authority: certificate_authority, update_mask: update_mask, request_id: request_id), grpc_options) do |response, operation| - assert_kind_of Gapic::Operation, response - assert_equal grpc_response, response.grpc_op - assert_equal grpc_operation, operation - end - - # Verify method calls - assert_equal 5, update_certificate_authority_client_stub.call_rpc_count - end - end - - def test_create_ca_pool - # 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" - ca_pool_id = "hello world" - ca_pool = {} - request_id = "hello world" - - create_ca_pool_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :create_ca_pool, name - assert_kind_of ::Google::Cloud::Security::PrivateCA::V1::CreateCaPoolRequest, request - assert_equal "hello world", request["parent"] - assert_equal "hello world", request["ca_pool_id"] - assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::Security::PrivateCA::V1::CaPool), request["ca_pool"] - assert_equal "hello world", request["request_id"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, create_ca_pool_client_stub do - # Create client - client = ::Google::Cloud::Security::PrivateCA::V1::CertificateAuthorityService::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.create_ca_pool({ parent: parent, ca_pool_id: ca_pool_id, ca_pool: ca_pool, request_id: request_id }) do |response, operation| - assert_kind_of Gapic::Operation, response - assert_equal grpc_response, response.grpc_op - assert_equal grpc_operation, operation - end - - # Use named arguments - client.create_ca_pool parent: parent, ca_pool_id: ca_pool_id, ca_pool: ca_pool, request_id: request_id do |response, operation| - assert_kind_of Gapic::Operation, response - assert_equal grpc_response, response.grpc_op - assert_equal grpc_operation, operation - end - - # Use protobuf object - client.create_ca_pool ::Google::Cloud::Security::PrivateCA::V1::CreateCaPoolRequest.new(parent: parent, ca_pool_id: ca_pool_id, ca_pool: ca_pool, request_id: request_id) do |response, operation| - assert_kind_of Gapic::Operation, response - assert_equal grpc_response, response.grpc_op - assert_equal grpc_operation, operation - end - - # Use hash object with options - client.create_ca_pool({ parent: parent, ca_pool_id: ca_pool_id, ca_pool: ca_pool, request_id: request_id }, grpc_options) do |response, operation| - assert_kind_of Gapic::Operation, response - assert_equal grpc_response, response.grpc_op - assert_equal grpc_operation, operation - end - - # Use protobuf object with options - client.create_ca_pool(::Google::Cloud::Security::PrivateCA::V1::CreateCaPoolRequest.new(parent: parent, ca_pool_id: ca_pool_id, ca_pool: ca_pool, request_id: request_id), grpc_options) do |response, operation| - assert_kind_of Gapic::Operation, response - assert_equal grpc_response, response.grpc_op - assert_equal grpc_operation, operation - end - - # Verify method calls - assert_equal 5, create_ca_pool_client_stub.call_rpc_count - end - end - - def test_update_ca_pool - # 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. - ca_pool = {} - update_mask = {} - request_id = "hello world" - - update_ca_pool_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :update_ca_pool, name - assert_kind_of ::Google::Cloud::Security::PrivateCA::V1::UpdateCaPoolRequest, request - assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::Security::PrivateCA::V1::CaPool), request["ca_pool"] - assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Protobuf::FieldMask), request["update_mask"] - assert_equal "hello world", request["request_id"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, update_ca_pool_client_stub do - # Create client - client = ::Google::Cloud::Security::PrivateCA::V1::CertificateAuthorityService::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.update_ca_pool({ ca_pool: ca_pool, update_mask: update_mask, request_id: request_id }) do |response, operation| - assert_kind_of Gapic::Operation, response - assert_equal grpc_response, response.grpc_op - assert_equal grpc_operation, operation - end - - # Use named arguments - client.update_ca_pool ca_pool: ca_pool, update_mask: update_mask, request_id: request_id do |response, operation| - assert_kind_of Gapic::Operation, response - assert_equal grpc_response, response.grpc_op - assert_equal grpc_operation, operation - end - - # Use protobuf object - client.update_ca_pool ::Google::Cloud::Security::PrivateCA::V1::UpdateCaPoolRequest.new(ca_pool: ca_pool, update_mask: update_mask, request_id: request_id) do |response, operation| - assert_kind_of Gapic::Operation, response - assert_equal grpc_response, response.grpc_op - assert_equal grpc_operation, operation - end - - # Use hash object with options - client.update_ca_pool({ ca_pool: ca_pool, update_mask: update_mask, request_id: request_id }, grpc_options) do |response, operation| - assert_kind_of Gapic::Operation, response - assert_equal grpc_response, response.grpc_op - assert_equal grpc_operation, operation - end - - # Use protobuf object with options - client.update_ca_pool(::Google::Cloud::Security::PrivateCA::V1::UpdateCaPoolRequest.new(ca_pool: ca_pool, update_mask: update_mask, request_id: request_id), grpc_options) do |response, operation| - assert_kind_of Gapic::Operation, response - assert_equal grpc_response, response.grpc_op - assert_equal grpc_operation, operation - end - - # Verify method calls - assert_equal 5, update_ca_pool_client_stub.call_rpc_count - end - end - - def test_get_ca_pool - # Create GRPC objects. - grpc_response = ::Google::Cloud::Security::PrivateCA::V1::CaPool.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_ca_pool_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :get_ca_pool, name - assert_kind_of ::Google::Cloud::Security::PrivateCA::V1::GetCaPoolRequest, request - assert_equal "hello world", request["name"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, get_ca_pool_client_stub do - # Create client - client = ::Google::Cloud::Security::PrivateCA::V1::CertificateAuthorityService::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.get_ca_pool({ name: name }) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use named arguments - client.get_ca_pool name: name do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object - client.get_ca_pool ::Google::Cloud::Security::PrivateCA::V1::GetCaPoolRequest.new(name: name) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use hash object with options - client.get_ca_pool({ 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_ca_pool(::Google::Cloud::Security::PrivateCA::V1::GetCaPoolRequest.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_ca_pool_client_stub.call_rpc_count - end - end - - def test_list_ca_pools - # Create GRPC objects. - grpc_response = ::Google::Cloud::Security::PrivateCA::V1::ListCaPoolsResponse.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" - order_by = "hello world" - - list_ca_pools_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :list_ca_pools, name - assert_kind_of ::Google::Cloud::Security::PrivateCA::V1::ListCaPoolsRequest, 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"] - assert_equal "hello world", request["order_by"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, list_ca_pools_client_stub do - # Create client - client = ::Google::Cloud::Security::PrivateCA::V1::CertificateAuthorityService::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.list_ca_pools({ parent: parent, page_size: page_size, page_token: page_token, filter: filter, order_by: order_by }) 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_ca_pools parent: parent, page_size: page_size, page_token: page_token, filter: filter, order_by: order_by 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_ca_pools ::Google::Cloud::Security::PrivateCA::V1::ListCaPoolsRequest.new(parent: parent, page_size: page_size, page_token: page_token, filter: filter, order_by: order_by) 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_ca_pools({ parent: parent, page_size: page_size, page_token: page_token, filter: filter, order_by: order_by }, 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_ca_pools(::Google::Cloud::Security::PrivateCA::V1::ListCaPoolsRequest.new(parent: parent, page_size: page_size, page_token: page_token, filter: filter, order_by: order_by), 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_ca_pools_client_stub.call_rpc_count - end - end - - def test_delete_ca_pool - # 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" - request_id = "hello world" - ignore_dependent_resources = true - - delete_ca_pool_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :delete_ca_pool, name - assert_kind_of ::Google::Cloud::Security::PrivateCA::V1::DeleteCaPoolRequest, request - assert_equal "hello world", request["name"] - assert_equal "hello world", request["request_id"] - assert_equal true, request["ignore_dependent_resources"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, delete_ca_pool_client_stub do - # Create client - client = ::Google::Cloud::Security::PrivateCA::V1::CertificateAuthorityService::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.delete_ca_pool({ name: name, request_id: request_id, ignore_dependent_resources: ignore_dependent_resources }) 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_ca_pool name: name, request_id: request_id, ignore_dependent_resources: ignore_dependent_resources 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_ca_pool ::Google::Cloud::Security::PrivateCA::V1::DeleteCaPoolRequest.new(name: name, request_id: request_id, ignore_dependent_resources: ignore_dependent_resources) 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_ca_pool({ name: name, request_id: request_id, ignore_dependent_resources: ignore_dependent_resources }, 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_ca_pool(::Google::Cloud::Security::PrivateCA::V1::DeleteCaPoolRequest.new(name: name, request_id: request_id, ignore_dependent_resources: ignore_dependent_resources), 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_ca_pool_client_stub.call_rpc_count - end - end - - def test_fetch_ca_certs - # Create GRPC objects. - grpc_response = ::Google::Cloud::Security::PrivateCA::V1::FetchCaCertsResponse.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. - ca_pool = "hello world" - request_id = "hello world" - - fetch_ca_certs_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :fetch_ca_certs, name - assert_kind_of ::Google::Cloud::Security::PrivateCA::V1::FetchCaCertsRequest, request - assert_equal "hello world", request["ca_pool"] - assert_equal "hello world", request["request_id"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, fetch_ca_certs_client_stub do - # Create client - client = ::Google::Cloud::Security::PrivateCA::V1::CertificateAuthorityService::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.fetch_ca_certs({ ca_pool: ca_pool, request_id: request_id }) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use named arguments - client.fetch_ca_certs ca_pool: ca_pool, request_id: request_id do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object - client.fetch_ca_certs ::Google::Cloud::Security::PrivateCA::V1::FetchCaCertsRequest.new(ca_pool: ca_pool, request_id: request_id) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use hash object with options - client.fetch_ca_certs({ ca_pool: ca_pool, request_id: request_id }, grpc_options) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object with options - client.fetch_ca_certs(::Google::Cloud::Security::PrivateCA::V1::FetchCaCertsRequest.new(ca_pool: ca_pool, request_id: request_id), grpc_options) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Verify method calls - assert_equal 5, fetch_ca_certs_client_stub.call_rpc_count - end - end - - def test_get_certificate_revocation_list - # Create GRPC objects. - grpc_response = ::Google::Cloud::Security::PrivateCA::V1::CertificateRevocationList.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_certificate_revocation_list_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :get_certificate_revocation_list, name - assert_kind_of ::Google::Cloud::Security::PrivateCA::V1::GetCertificateRevocationListRequest, request - assert_equal "hello world", request["name"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, get_certificate_revocation_list_client_stub do - # Create client - client = ::Google::Cloud::Security::PrivateCA::V1::CertificateAuthorityService::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.get_certificate_revocation_list({ name: name }) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use named arguments - client.get_certificate_revocation_list name: name do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object - client.get_certificate_revocation_list ::Google::Cloud::Security::PrivateCA::V1::GetCertificateRevocationListRequest.new(name: name) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use hash object with options - client.get_certificate_revocation_list({ 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_certificate_revocation_list(::Google::Cloud::Security::PrivateCA::V1::GetCertificateRevocationListRequest.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_certificate_revocation_list_client_stub.call_rpc_count - end - end - - def test_list_certificate_revocation_lists - # Create GRPC objects. - grpc_response = ::Google::Cloud::Security::PrivateCA::V1::ListCertificateRevocationListsResponse.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" - order_by = "hello world" - - list_certificate_revocation_lists_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :list_certificate_revocation_lists, name - assert_kind_of ::Google::Cloud::Security::PrivateCA::V1::ListCertificateRevocationListsRequest, 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"] - assert_equal "hello world", request["order_by"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, list_certificate_revocation_lists_client_stub do - # Create client - client = ::Google::Cloud::Security::PrivateCA::V1::CertificateAuthorityService::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.list_certificate_revocation_lists({ parent: parent, page_size: page_size, page_token: page_token, filter: filter, order_by: order_by }) 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_certificate_revocation_lists parent: parent, page_size: page_size, page_token: page_token, filter: filter, order_by: order_by 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_certificate_revocation_lists ::Google::Cloud::Security::PrivateCA::V1::ListCertificateRevocationListsRequest.new(parent: parent, page_size: page_size, page_token: page_token, filter: filter, order_by: order_by) 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_certificate_revocation_lists({ parent: parent, page_size: page_size, page_token: page_token, filter: filter, order_by: order_by }, 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_certificate_revocation_lists(::Google::Cloud::Security::PrivateCA::V1::ListCertificateRevocationListsRequest.new(parent: parent, page_size: page_size, page_token: page_token, filter: filter, order_by: order_by), 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_certificate_revocation_lists_client_stub.call_rpc_count - end - end - - def test_update_certificate_revocation_list - # 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. - certificate_revocation_list = {} - update_mask = {} - request_id = "hello world" - - update_certificate_revocation_list_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :update_certificate_revocation_list, name - assert_kind_of ::Google::Cloud::Security::PrivateCA::V1::UpdateCertificateRevocationListRequest, request - assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::Security::PrivateCA::V1::CertificateRevocationList), request["certificate_revocation_list"] - assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Protobuf::FieldMask), request["update_mask"] - assert_equal "hello world", request["request_id"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, update_certificate_revocation_list_client_stub do - # Create client - client = ::Google::Cloud::Security::PrivateCA::V1::CertificateAuthorityService::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.update_certificate_revocation_list({ certificate_revocation_list: certificate_revocation_list, update_mask: update_mask, request_id: request_id }) do |response, operation| - assert_kind_of Gapic::Operation, response - assert_equal grpc_response, response.grpc_op - assert_equal grpc_operation, operation - end - - # Use named arguments - client.update_certificate_revocation_list certificate_revocation_list: certificate_revocation_list, update_mask: update_mask, request_id: request_id do |response, operation| - assert_kind_of Gapic::Operation, response - assert_equal grpc_response, response.grpc_op - assert_equal grpc_operation, operation - end - - # Use protobuf object - client.update_certificate_revocation_list ::Google::Cloud::Security::PrivateCA::V1::UpdateCertificateRevocationListRequest.new(certificate_revocation_list: certificate_revocation_list, update_mask: update_mask, request_id: request_id) do |response, operation| - assert_kind_of Gapic::Operation, response - assert_equal grpc_response, response.grpc_op - assert_equal grpc_operation, operation - end - - # Use hash object with options - client.update_certificate_revocation_list({ certificate_revocation_list: certificate_revocation_list, update_mask: update_mask, request_id: request_id }, grpc_options) do |response, operation| - assert_kind_of Gapic::Operation, response - assert_equal grpc_response, response.grpc_op - assert_equal grpc_operation, operation - end - - # Use protobuf object with options - client.update_certificate_revocation_list(::Google::Cloud::Security::PrivateCA::V1::UpdateCertificateRevocationListRequest.new(certificate_revocation_list: certificate_revocation_list, update_mask: update_mask, request_id: request_id), grpc_options) do |response, operation| - assert_kind_of Gapic::Operation, response - assert_equal grpc_response, response.grpc_op - assert_equal grpc_operation, operation - end - - # Verify method calls - assert_equal 5, update_certificate_revocation_list_client_stub.call_rpc_count - end - end - - def test_create_certificate_template - # 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" - certificate_template_id = "hello world" - certificate_template = {} - request_id = "hello world" - - create_certificate_template_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :create_certificate_template, name - assert_kind_of ::Google::Cloud::Security::PrivateCA::V1::CreateCertificateTemplateRequest, request - assert_equal "hello world", request["parent"] - assert_equal "hello world", request["certificate_template_id"] - assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::Security::PrivateCA::V1::CertificateTemplate), request["certificate_template"] - assert_equal "hello world", request["request_id"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, create_certificate_template_client_stub do - # Create client - client = ::Google::Cloud::Security::PrivateCA::V1::CertificateAuthorityService::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.create_certificate_template({ parent: parent, certificate_template_id: certificate_template_id, certificate_template: certificate_template, request_id: request_id }) do |response, operation| - assert_kind_of Gapic::Operation, response - assert_equal grpc_response, response.grpc_op - assert_equal grpc_operation, operation - end - - # Use named arguments - client.create_certificate_template parent: parent, certificate_template_id: certificate_template_id, certificate_template: certificate_template, request_id: request_id do |response, operation| - assert_kind_of Gapic::Operation, response - assert_equal grpc_response, response.grpc_op - assert_equal grpc_operation, operation - end - - # Use protobuf object - client.create_certificate_template ::Google::Cloud::Security::PrivateCA::V1::CreateCertificateTemplateRequest.new(parent: parent, certificate_template_id: certificate_template_id, certificate_template: certificate_template, request_id: request_id) do |response, operation| - assert_kind_of Gapic::Operation, response - assert_equal grpc_response, response.grpc_op - assert_equal grpc_operation, operation - end - - # Use hash object with options - client.create_certificate_template({ parent: parent, certificate_template_id: certificate_template_id, certificate_template: certificate_template, request_id: request_id }, grpc_options) do |response, operation| - assert_kind_of Gapic::Operation, response - assert_equal grpc_response, response.grpc_op - assert_equal grpc_operation, operation - end - - # Use protobuf object with options - client.create_certificate_template(::Google::Cloud::Security::PrivateCA::V1::CreateCertificateTemplateRequest.new(parent: parent, certificate_template_id: certificate_template_id, certificate_template: certificate_template, request_id: request_id), grpc_options) do |response, operation| - assert_kind_of Gapic::Operation, response - assert_equal grpc_response, response.grpc_op - assert_equal grpc_operation, operation - end - - # Verify method calls - assert_equal 5, create_certificate_template_client_stub.call_rpc_count - end - end - - def test_delete_certificate_template - # 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" - request_id = "hello world" - - delete_certificate_template_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :delete_certificate_template, name - assert_kind_of ::Google::Cloud::Security::PrivateCA::V1::DeleteCertificateTemplateRequest, request - assert_equal "hello world", request["name"] - assert_equal "hello world", request["request_id"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, delete_certificate_template_client_stub do - # Create client - client = ::Google::Cloud::Security::PrivateCA::V1::CertificateAuthorityService::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.delete_certificate_template({ name: name, request_id: request_id }) do |response, operation| - assert_kind_of Gapic::Operation, response - assert_equal grpc_response, response.grpc_op - assert_equal grpc_operation, operation - end - - # Use named arguments - client.delete_certificate_template name: name, request_id: request_id do |response, operation| - assert_kind_of Gapic::Operation, response - assert_equal grpc_response, response.grpc_op - assert_equal grpc_operation, operation - end - - # Use protobuf object - client.delete_certificate_template ::Google::Cloud::Security::PrivateCA::V1::DeleteCertificateTemplateRequest.new(name: name, request_id: request_id) do |response, operation| - assert_kind_of Gapic::Operation, response - assert_equal grpc_response, response.grpc_op - assert_equal grpc_operation, operation - end - - # Use hash object with options - client.delete_certificate_template({ name: name, request_id: request_id }, grpc_options) do |response, operation| - assert_kind_of Gapic::Operation, response - assert_equal grpc_response, response.grpc_op - assert_equal grpc_operation, operation - end - - # Use protobuf object with options - client.delete_certificate_template(::Google::Cloud::Security::PrivateCA::V1::DeleteCertificateTemplateRequest.new(name: name, request_id: request_id), grpc_options) do |response, operation| - assert_kind_of Gapic::Operation, response - assert_equal grpc_response, response.grpc_op - assert_equal grpc_operation, operation - end - - # Verify method calls - assert_equal 5, delete_certificate_template_client_stub.call_rpc_count - end - end - - def test_get_certificate_template - # Create GRPC objects. - grpc_response = ::Google::Cloud::Security::PrivateCA::V1::CertificateTemplate.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_certificate_template_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :get_certificate_template, name - assert_kind_of ::Google::Cloud::Security::PrivateCA::V1::GetCertificateTemplateRequest, request - assert_equal "hello world", request["name"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, get_certificate_template_client_stub do - # Create client - client = ::Google::Cloud::Security::PrivateCA::V1::CertificateAuthorityService::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.get_certificate_template({ name: name }) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use named arguments - client.get_certificate_template name: name do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object - client.get_certificate_template ::Google::Cloud::Security::PrivateCA::V1::GetCertificateTemplateRequest.new(name: name) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use hash object with options - client.get_certificate_template({ 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_certificate_template(::Google::Cloud::Security::PrivateCA::V1::GetCertificateTemplateRequest.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_certificate_template_client_stub.call_rpc_count - end - end - - def test_list_certificate_templates - # Create GRPC objects. - grpc_response = ::Google::Cloud::Security::PrivateCA::V1::ListCertificateTemplatesResponse.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" - order_by = "hello world" - - list_certificate_templates_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :list_certificate_templates, name - assert_kind_of ::Google::Cloud::Security::PrivateCA::V1::ListCertificateTemplatesRequest, 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"] - assert_equal "hello world", request["order_by"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, list_certificate_templates_client_stub do - # Create client - client = ::Google::Cloud::Security::PrivateCA::V1::CertificateAuthorityService::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.list_certificate_templates({ parent: parent, page_size: page_size, page_token: page_token, filter: filter, order_by: order_by }) 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_certificate_templates parent: parent, page_size: page_size, page_token: page_token, filter: filter, order_by: order_by 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_certificate_templates ::Google::Cloud::Security::PrivateCA::V1::ListCertificateTemplatesRequest.new(parent: parent, page_size: page_size, page_token: page_token, filter: filter, order_by: order_by) 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_certificate_templates({ parent: parent, page_size: page_size, page_token: page_token, filter: filter, order_by: order_by }, 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_certificate_templates(::Google::Cloud::Security::PrivateCA::V1::ListCertificateTemplatesRequest.new(parent: parent, page_size: page_size, page_token: page_token, filter: filter, order_by: order_by), 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_certificate_templates_client_stub.call_rpc_count - end - end - - def test_update_certificate_template - # 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. - certificate_template = {} - update_mask = {} - request_id = "hello world" - - update_certificate_template_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :update_certificate_template, name - assert_kind_of ::Google::Cloud::Security::PrivateCA::V1::UpdateCertificateTemplateRequest, request - assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::Security::PrivateCA::V1::CertificateTemplate), request["certificate_template"] - assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Protobuf::FieldMask), request["update_mask"] - assert_equal "hello world", request["request_id"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, update_certificate_template_client_stub do - # Create client - client = ::Google::Cloud::Security::PrivateCA::V1::CertificateAuthorityService::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.update_certificate_template({ certificate_template: certificate_template, update_mask: update_mask, request_id: request_id }) do |response, operation| - assert_kind_of Gapic::Operation, response - assert_equal grpc_response, response.grpc_op - assert_equal grpc_operation, operation - end - - # Use named arguments - client.update_certificate_template certificate_template: certificate_template, update_mask: update_mask, request_id: request_id do |response, operation| - assert_kind_of Gapic::Operation, response - assert_equal grpc_response, response.grpc_op - assert_equal grpc_operation, operation - end - - # Use protobuf object - client.update_certificate_template ::Google::Cloud::Security::PrivateCA::V1::UpdateCertificateTemplateRequest.new(certificate_template: certificate_template, update_mask: update_mask, request_id: request_id) do |response, operation| - assert_kind_of Gapic::Operation, response - assert_equal grpc_response, response.grpc_op - assert_equal grpc_operation, operation - end - - # Use hash object with options - client.update_certificate_template({ certificate_template: certificate_template, update_mask: update_mask, request_id: request_id }, grpc_options) do |response, operation| - assert_kind_of Gapic::Operation, response - assert_equal grpc_response, response.grpc_op - assert_equal grpc_operation, operation - end - - # Use protobuf object with options - client.update_certificate_template(::Google::Cloud::Security::PrivateCA::V1::UpdateCertificateTemplateRequest.new(certificate_template: certificate_template, update_mask: update_mask, request_id: request_id), grpc_options) do |response, operation| - assert_kind_of Gapic::Operation, response - assert_equal grpc_response, response.grpc_op - assert_equal grpc_operation, operation - end - - # Verify method calls - assert_equal 5, update_certificate_template_client_stub.call_rpc_count - end - end - - def test_configure - grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - - client = block_config = config = nil - dummy_stub = ClientStub.new nil, nil - Gapic::ServiceStub.stub :new, dummy_stub do - client = ::Google::Cloud::Security::PrivateCA::V1::CertificateAuthorityService::Client.new do |config| - config.credentials = grpc_channel - end - end - - config = client.configure do |c| - block_config = c - end - - assert_same block_config, config - assert_kind_of ::Google::Cloud::Security::PrivateCA::V1::CertificateAuthorityService::Client::Configuration, config - end - - def test_credentials - key = OpenSSL::PKey::RSA.new 2048 - cred_json = { - "private_key" => key.to_pem, - "client_email" => "app@developer.gserviceaccount.com", - "type" => "service_account" - } - key_file = StringIO.new cred_json.to_json - creds = Google::Auth::ServiceAccountCredentials.make_creds({ json_key_io: key_file }) - - dummy_stub = ClientStub.new nil, nil - Gapic::ServiceStub.stub :new, dummy_stub do - client = ::Google::Cloud::Security::PrivateCA::V1::CertificateAuthorityService::Client.new do |config| - config.credentials = creds - end - assert_kind_of ::Google::Cloud::Security::PrivateCA::V1::CertificateAuthorityService::Client, client - assert_equal creds, client.configure.credentials - end - end - - def test_operations_client - grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - - client = nil - dummy_stub = ClientStub.new nil, nil - Gapic::ServiceStub.stub :new, dummy_stub do - client = ::Google::Cloud::Security::PrivateCA::V1::CertificateAuthorityService::Client.new do |config| - config.credentials = grpc_channel - end - end - - assert_kind_of ::Google::Cloud::Security::PrivateCA::V1::CertificateAuthorityService::Operations, client.operations_client - end -end diff --git a/owl-bot-staging/google-cloud-security-private_ca-v1/test/helper.rb b/owl-bot-staging/google-cloud-security-private_ca-v1/test/helper.rb deleted file mode 100644 index 672b337030e7..000000000000 --- a/owl-bot-staging/google-cloud-security-private_ca-v1/test/helper.rb +++ /dev/null @@ -1,26 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -require "minitest/autorun" -require "minitest/focus" -require "minitest/mock" -require "minitest/rg" - -require "grpc" - -require "ostruct" diff --git a/owl-bot-staging/google-cloud-security-private_ca-v1beta1/.gitignore b/owl-bot-staging/google-cloud-security-private_ca-v1beta1/.gitignore deleted file mode 100644 index 0135b6bc6cfc..000000000000 --- a/owl-bot-staging/google-cloud-security-private_ca-v1beta1/.gitignore +++ /dev/null @@ -1,22 +0,0 @@ -# Ignore bundler lockfiles -Gemfile.lock -gems.locked - -# Ignore documentation output -doc/* -.yardoc/* - -# Ignore test output -coverage/* - -# Ignore build artifacts -pkg/* - -# Ignore files commonly present in certain dev environments -.vagrant -.DS_STORE -.idea -*.iml - -# Ignore synth output -__pycache__ diff --git a/owl-bot-staging/google-cloud-security-private_ca-v1beta1/.repo-metadata.json b/owl-bot-staging/google-cloud-security-private_ca-v1beta1/.repo-metadata.json deleted file mode 100644 index a2c53d30db17..000000000000 --- a/owl-bot-staging/google-cloud-security-private_ca-v1beta1/.repo-metadata.json +++ /dev/null @@ -1,18 +0,0 @@ -{ - "api_id": "privateca.googleapis.com", - "api_shortname": "privateca", - "client_documentation": "https://cloud.google.com/ruby/docs/reference/google-cloud-security-private_ca-v1beta1/latest", - "distribution_name": "google-cloud-security-private_ca-v1beta1", - "is_cloud": true, - "language": "ruby", - "name": "privateca", - "name_pretty": "Certificate Authority Service V1beta1 API", - "product_documentation": "https://cloud.google.com/certificate-authority-service/", - "release_level": "unreleased", - "repo": "googleapis/google-cloud-ruby", - "requires_billing": true, - "ruby-cloud-description": "Certificate Authority Service is a highly available, scalable Google Cloud service that enables you to simplify, automate, and customize the deployment, management, and security of private certificate authorities (CA). Note that google-cloud-security-private_ca-v1beta1 is a version-specific client library. For most uses, we recommend installing the main client library google-cloud-security-private_ca instead. See the readme for more details.", - "ruby-cloud-env-prefix": "PRIVATE_CA", - "ruby-cloud-product-url": "https://cloud.google.com/certificate-authority-service/", - "library_type": "GAPIC_AUTO" -} diff --git a/owl-bot-staging/google-cloud-security-private_ca-v1beta1/.rubocop.yml b/owl-bot-staging/google-cloud-security-private_ca-v1beta1/.rubocop.yml deleted file mode 100644 index fd09dadd27e7..000000000000 --- a/owl-bot-staging/google-cloud-security-private_ca-v1beta1/.rubocop.yml +++ /dev/null @@ -1,33 +0,0 @@ -inherit_gem: - google-style: google-style.yml - -AllCops: - Exclude: - - "google-cloud-security-private_ca-v1beta1.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-security-private_ca-v1beta1.rb" diff --git a/owl-bot-staging/google-cloud-security-private_ca-v1beta1/.toys.rb b/owl-bot-staging/google-cloud-security-private_ca-v1beta1/.toys.rb deleted file mode 100644 index 177e22456e8a..000000000000 --- a/owl-bot-staging/google-cloud-security-private_ca-v1beta1/.toys.rb +++ /dev/null @@ -1,28 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -toys_version! ">= 0.15.3" - -if ENV["RUBY_COMMON_TOOLS"] - common_tools_dir = File.expand_path ENV["RUBY_COMMON_TOOLS"] - load File.join(common_tools_dir, "toys", "gapic") -else - load_git remote: "https://github.com/googleapis/ruby-common-tools.git", - path: "toys/gapic", - update: true -end diff --git a/owl-bot-staging/google-cloud-security-private_ca-v1beta1/.yardopts b/owl-bot-staging/google-cloud-security-private_ca-v1beta1/.yardopts deleted file mode 100644 index 0500d6ab419b..000000000000 --- a/owl-bot-staging/google-cloud-security-private_ca-v1beta1/.yardopts +++ /dev/null @@ -1,12 +0,0 @@ ---no-private ---title="Certificate Authority Service V1beta1 API" ---exclude _pb\.rb$ ---markup markdown ---markup-provider redcarpet - -./lib/**/*.rb -./proto_docs/**/*.rb -- -README.md -LICENSE.md -AUTHENTICATION.md diff --git a/owl-bot-staging/google-cloud-security-private_ca-v1beta1/AUTHENTICATION.md b/owl-bot-staging/google-cloud-security-private_ca-v1beta1/AUTHENTICATION.md deleted file mode 100644 index af0fea24815e..000000000000 --- a/owl-bot-staging/google-cloud-security-private_ca-v1beta1/AUTHENTICATION.md +++ /dev/null @@ -1,122 +0,0 @@ -# Authentication - -The recommended way to authenticate to the google-cloud-security-private_ca-v1beta1 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-security-private_ca-v1beta1 library provides several mechanisms to configure your system. -Generally, using Application Default Credentials to facilitate automatic -credentials discovery is the easist method. But if you need to explicitly specify -credentials, there are several methods available to you. - -Credentials are accepted in the following ways, in the following order or precedence: - -1. Credentials specified in method arguments -2. Credentials specified in configuration -3. Credentials pointed to or included in environment variables -4. Credentials found in local ADC file -5. Credentials returned by the metadata server for the attached service account (GCP) - -### Configuration - -You can configure a path to a JSON credentials file, either for an individual client object or -globally, for all client objects. The JSON file can contain credentials created for -[workload identity federation](https://cloud.google.com/iam/docs/workload-identity-federation), -[workforce identity federation](https://cloud.google.com/iam/docs/workforce-identity-federation), or a -[service account key](https://cloud.google.com/docs/authentication/provide-credentials-adc#local-key). - -Note: Service account keys are a security risk if not managed correctly. You should -[choose a more secure alternative to service account keys](https://cloud.google.com/docs/authentication#auth-decision-tree) -whenever possible. - -To configure a credentials file for an individual client initialization: - -```ruby -require "google/cloud/security/private_ca/v1beta1" - -client = ::Google::Cloud::Security::PrivateCA::V1beta1::CertificateAuthorityService::Client.new do |config| - config.credentials = "path/to/credentialfile.json" -end -``` - -To configure a credentials file globally for all clients: - -```ruby -require "google/cloud/security/private_ca/v1beta1" - -::Google::Cloud::Security::PrivateCA::V1beta1::CertificateAuthorityService::Client.configure do |config| - config.credentials = "path/to/credentialfile.json" -end - -client = ::Google::Cloud::Security::PrivateCA::V1beta1::CertificateAuthorityService::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-security-private_ca-v1beta1 -checks for credentials are: - -* `GOOGLE_CLOUD_CREDENTIALS` - Path to JSON file, or JSON contents -* `GOOGLE_APPLICATION_CREDENTIALS` - Path to JSON file - -```ruby -require "google/cloud/security/private_ca/v1beta1" - -ENV["GOOGLE_APPLICATION_CREDENTIALS"] = "path/to/credentialfile.json" - -client = ::Google::Cloud::Security::PrivateCA::V1beta1::CertificateAuthorityService::Client.new -``` - -### Local ADC file - -You can set up a local ADC file with your user credentials for authentication during -development. If credentials are not provided in code or in environment variables, -then the local ADC credentials are discovered. - -Follow the steps in [Quickstart](#quickstart) to set up a local ADC file. - -### Google Cloud Platform environments - -When running on Google Cloud Platform (GCP), including Google Compute Engine -(GCE), Google Kubernetes Engine (GKE), Google App Engine (GAE), Google Cloud -Functions (GCF) and Cloud Run, credentials are retrieved from the attached -service account automatically. Code should be written as if already authenticated. - -For more information, see -[Set up ADC for Google Cloud services](https://cloud.google.com/docs/authentication/provide-credentials-adc#attached-sa). diff --git a/owl-bot-staging/google-cloud-security-private_ca-v1beta1/CHANGELOG.md b/owl-bot-staging/google-cloud-security-private_ca-v1beta1/CHANGELOG.md deleted file mode 100644 index f88957a62ba2..000000000000 --- a/owl-bot-staging/google-cloud-security-private_ca-v1beta1/CHANGELOG.md +++ /dev/null @@ -1,2 +0,0 @@ -# Release History - diff --git a/owl-bot-staging/google-cloud-security-private_ca-v1beta1/Gemfile b/owl-bot-staging/google-cloud-security-private_ca-v1beta1/Gemfile deleted file mode 100644 index 1d08558908d8..000000000000 --- a/owl-bot-staging/google-cloud-security-private_ca-v1beta1/Gemfile +++ /dev/null @@ -1,14 +0,0 @@ -source "https://rubygems.org" - -gemspec - -gem "google-style", "~> 1.32.0" -gem "irb", "~> 1.17" -gem "minitest", "~> 6.0.2" -gem "minitest-focus", "~> 1.4" -gem "minitest-mock", "~> 5.27" -gem "minitest-rg", "~> 5.3" -gem "ostruct", "~> 0.5.5" -gem "rake", ">= 13.0" -gem "redcarpet", "~> 3.6" -gem "yard", "~> 0.9" diff --git a/owl-bot-staging/google-cloud-security-private_ca-v1beta1/LICENSE.md b/owl-bot-staging/google-cloud-security-private_ca-v1beta1/LICENSE.md deleted file mode 100644 index c261857ba6ad..000000000000 --- a/owl-bot-staging/google-cloud-security-private_ca-v1beta1/LICENSE.md +++ /dev/null @@ -1,201 +0,0 @@ - Apache License - Version 2.0, January 2004 - http://www.apache.org/licenses/ - - TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION - - 1. Definitions. - - "License" shall mean the terms and conditions for use, reproduction, - and distribution as defined by Sections 1 through 9 of this document. - - "Licensor" shall mean the copyright owner or entity authorized by - the copyright owner that is granting the License. - - "Legal Entity" shall mean the union of the acting entity and all - other entities that control, are controlled by, or are under common - control with that entity. For the purposes of this definition, - "control" means (i) the power, direct or indirect, to cause the - direction or management of such entity, whether by contract or - otherwise, or (ii) ownership of fifty percent (50%) or more of the - outstanding shares, or (iii) beneficial ownership of such entity. - - "You" (or "Your") shall mean an individual or Legal Entity - exercising permissions granted by this License. - - "Source" form shall mean the preferred form for making modifications, - including but not limited to software source code, documentation - source, and configuration files. - - "Object" form shall mean any form resulting from mechanical - transformation or translation of a Source form, including but - not limited to compiled object code, generated documentation, - and conversions to other media types. - - "Work" shall mean the work of authorship, whether in Source or - Object form, made available under the License, as indicated by a - copyright notice that is included in or attached to the work - (an example is provided in the Appendix below). - - "Derivative Works" shall mean any work, whether in Source or Object - form, that is based on (or derived from) the Work and for which the - editorial revisions, annotations, elaborations, or other modifications - represent, as a whole, an original work of authorship. For the purposes - of this License, Derivative Works shall not include works that remain - separable from, or merely link (or bind by name) to the interfaces of, - the Work and Derivative Works thereof. - - "Contribution" shall mean any work of authorship, including - the original version of the Work and any modifications or additions - to that Work or Derivative Works thereof, that is intentionally - submitted to Licensor for inclusion in the Work by the copyright owner - or by an individual or Legal Entity authorized to submit on behalf of - the copyright owner. For the purposes of this definition, "submitted" - means any form of electronic, verbal, or written communication sent - to the Licensor or its representatives, including but not limited to - communication on electronic mailing lists, source code control systems, - and issue tracking systems that are managed by, or on behalf of, the - Licensor for the purpose of discussing and improving the Work, but - excluding communication that is conspicuously marked or otherwise - designated in writing by the copyright owner as "Not a Contribution." - - "Contributor" shall mean Licensor and any individual or Legal Entity - on behalf of whom a Contribution has been received by Licensor and - subsequently incorporated within the Work. - - 2. Grant of Copyright License. Subject to the terms and conditions of - this License, each Contributor hereby grants to You a perpetual, - worldwide, non-exclusive, no-charge, royalty-free, irrevocable - copyright license to reproduce, prepare Derivative Works of, - publicly display, publicly perform, sublicense, and distribute the - Work and such Derivative Works in Source or Object form. - - 3. Grant of Patent License. Subject to the terms and conditions of - this License, each Contributor hereby grants to You a perpetual, - worldwide, non-exclusive, no-charge, royalty-free, irrevocable - (except as stated in this section) patent license to make, have made, - use, offer to sell, sell, import, and otherwise transfer the Work, - where such license applies only to those patent claims licensable - by such Contributor that are necessarily infringed by their - Contribution(s) alone or by combination of their Contribution(s) - with the Work to which such Contribution(s) was submitted. If You - institute patent litigation against any entity (including a - cross-claim or counterclaim in a lawsuit) alleging that the Work - or a Contribution incorporated within the Work constitutes direct - or contributory patent infringement, then any patent licenses - granted to You under this License for that Work shall terminate - as of the date such litigation is filed. - - 4. Redistribution. You may reproduce and distribute copies of the - Work or Derivative Works thereof in any medium, with or without - modifications, and in Source or Object form, provided that You - meet the following conditions: - - (a) You must give any other recipients of the Work or - Derivative Works a copy of this License; and - - (b) You must cause any modified files to carry prominent notices - stating that You changed the files; and - - (c) You must retain, in the Source form of any Derivative Works - that You distribute, all copyright, patent, trademark, and - attribution notices from the Source form of the Work, - excluding those notices that do not pertain to any part of - the Derivative Works; and - - (d) If the Work includes a "NOTICE" text file as part of its - distribution, then any Derivative Works that You distribute must - include a readable copy of the attribution notices contained - within such NOTICE file, excluding those notices that do not - pertain to any part of the Derivative Works, in at least one - of the following places: within a NOTICE text file distributed - as part of the Derivative Works; within the Source form or - documentation, if provided along with the Derivative Works; or, - within a display generated by the Derivative Works, if and - wherever such third-party notices normally appear. The contents - of the NOTICE file are for informational purposes only and - do not modify the License. You may add Your own attribution - notices within Derivative Works that You distribute, alongside - or as an addendum to the NOTICE text from the Work, provided - that such additional attribution notices cannot be construed - as modifying the License. - - You may add Your own copyright statement to Your modifications and - may provide additional or different license terms and conditions - for use, reproduction, or distribution of Your modifications, or - for any such Derivative Works as a whole, provided Your use, - reproduction, and distribution of the Work otherwise complies with - the conditions stated in this License. - - 5. Submission of Contributions. Unless You explicitly state otherwise, - any Contribution intentionally submitted for inclusion in the Work - by You to the Licensor shall be under the terms and conditions of - this License, without any additional terms or conditions. - Notwithstanding the above, nothing herein shall supersede or modify - the terms of any separate license agreement you may have executed - with Licensor regarding such Contributions. - - 6. Trademarks. This License does not grant permission to use the trade - names, trademarks, service marks, or product names of the Licensor, - except as required for reasonable and customary use in describing the - origin of the Work and reproducing the content of the NOTICE file. - - 7. Disclaimer of Warranty. Unless required by applicable law or - agreed to in writing, Licensor provides the Work (and each - Contributor provides its Contributions) on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or - implied, including, without limitation, any warranties or conditions - of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A - PARTICULAR PURPOSE. You are solely responsible for determining the - appropriateness of using or redistributing the Work and assume any - risks associated with Your exercise of permissions under this License. - - 8. Limitation of Liability. In no event and under no legal theory, - whether in tort (including negligence), contract, or otherwise, - unless required by applicable law (such as deliberate and grossly - negligent acts) or agreed to in writing, shall any Contributor be - liable to You for damages, including any direct, indirect, special, - incidental, or consequential damages of any character arising as a - result of this License or out of the use or inability to use the - Work (including but not limited to damages for loss of goodwill, - work stoppage, computer failure or malfunction, or any and all - other commercial damages or losses), even if such Contributor - has been advised of the possibility of such damages. - - 9. Accepting Warranty or Additional Liability. While redistributing - the Work or Derivative Works thereof, You may choose to offer, - and charge a fee for, acceptance of support, warranty, indemnity, - or other liability obligations and/or rights consistent with this - License. However, in accepting such obligations, You may act only - on Your own behalf and on Your sole responsibility, not on behalf - of any other Contributor, and only if You agree to indemnify, - defend, and hold each Contributor harmless for any liability - incurred by, or claims asserted against, such Contributor by reason - of your accepting any such warranty or additional liability. - - END OF TERMS AND CONDITIONS - - APPENDIX: How to apply the Apache License to your work. - - To apply the Apache License to your work, attach the following - boilerplate notice, with the fields enclosed by brackets "[]" - replaced with your own identifying information. (Don't include - the brackets!) The text should be enclosed in the appropriate - comment syntax for the file format. We also recommend that a - file or class name and description of purpose be included on the - same "printed page" as the copyright notice for easier - identification within third-party archives. - - Copyright [yyyy] [name of copyright owner] - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. diff --git a/owl-bot-staging/google-cloud-security-private_ca-v1beta1/README.md b/owl-bot-staging/google-cloud-security-private_ca-v1beta1/README.md deleted file mode 100644 index 6a08b9d9f604..000000000000 --- a/owl-bot-staging/google-cloud-security-private_ca-v1beta1/README.md +++ /dev/null @@ -1,154 +0,0 @@ -# Ruby Client for the Certificate Authority Service V1beta1 API - -API Client library for the Certificate Authority Service V1beta1 API - -Certificate Authority Service is a highly available, scalable Google Cloud service that enables you to simplify, automate, and customize the deployment, management, and security of private certificate authorities (CA). - -https://github.com/googleapis/google-cloud-ruby - -This gem is a _versioned_ client. It provides basic client classes for a -specific version of the Certificate Authority Service V1beta1 API. Most users should consider using -the main client gem, -[google-cloud-security-private_ca](https://rubygems.org/gems/google-cloud-security-private_ca). -See the section below titled *Which client should I use?* for more information. - -## Installation - -``` -$ gem install google-cloud-security-private_ca-v1beta1 -``` - -## 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/privateca.googleapis.com) -1. [Set up authentication.](AUTHENTICATION.md) - -## Quick Start - -```ruby -require "google/cloud/security/private_ca/v1beta1" - -client = ::Google::Cloud::Security::PrivateCA::V1beta1::CertificateAuthorityService::Client.new -request = ::Google::Cloud::Security::PrivateCA::V1beta1::CreateCertificateRequest.new # (request fields as keyword arguments...) -response = client.create_certificate request -``` - -View the [Client Library Documentation](https://cloud.google.com/ruby/docs/reference/google-cloud-security-private_ca-v1beta1/latest) -for class and method documentation. - -See also the [Product Documentation](https://cloud.google.com/certificate-authority-service/) -for general usage information. - -## Debug Logging - -This library comes with opt-in Debug Logging that can help you troubleshoot -your application's integration with the API. When logging is activated, key -events such as requests and responses, along with data payloads and metadata -such as headers and client configuration, are logged to the standard error -stream. - -**WARNING:** Client Library Debug Logging includes your data payloads in -plaintext, which could include sensitive data such as PII for yourself or your -customers, private keys, or other security data that could be compromising if -leaked. Always practice good data hygiene with your application logs, and follow -the principle of least access. Google also recommends that Client Library Debug -Logging be enabled only temporarily during active debugging, and not used -permanently in production. - -To enable logging, set the environment variable `GOOGLE_SDK_RUBY_LOGGING_GEMS` -to the value `all`. Alternatively, you can set the value to a comma-delimited -list of client library gem names. This will select the default logging behavior, -which writes logs to the standard error stream. On a local workstation, this may -result in logs appearing on the console. When running on a Google Cloud hosting -service such as [Google Cloud Run](https://cloud.google.com/run), this generally -results in logs appearing alongside your application logs in the -[Google Cloud Logging](https://cloud.google.com/logging/) service. - -You can customize logging by modifying the `logger` configuration when -constructing a client object. For example: - -```ruby -require "google/cloud/security/private_ca/v1beta1" -require "logger" - -client = ::Google::Cloud::Security::PrivateCA::V1beta1::CertificateAuthorityService::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-security-private_ca`, -and lower-level _versioned_ client libraries with names such as -`google-cloud-security-private_ca-v1beta1`. -_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-security-private_ca`. -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-security-private_ca-v1beta1`. - -### What about the google-apis- clients? - -Client library gems with names that begin with `google-apis-` are based on an -older code generation technology. They talk to a REST/JSON backend (whereas -most modern clients talk to a [gRPC](https://grpc.io/) backend) and they may -not offer the same performance, features, and ease of use provided by more -modern clients. - -The `google-apis-` clients have wide coverage across Google services, so you -might need to use one if there is no modern client available for the service. -However, if a modern client is available, we generally recommend it over the -older `google-apis-` clients. diff --git a/owl-bot-staging/google-cloud-security-private_ca-v1beta1/Rakefile b/owl-bot-staging/google-cloud-security-private_ca-v1beta1/Rakefile deleted file mode 100644 index 26402e7d932d..000000000000 --- a/owl-bot-staging/google-cloud-security-private_ca-v1beta1/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-security-private_ca-v1beta1 acceptance tests." -task :acceptance, :project, :keyfile do |t, args| - project = args[:project] - project ||= - ENV["PRIVATE_CA_TEST_PROJECT"] || - ENV["GCLOUD_TEST_PROJECT"] - keyfile = args[:keyfile] - keyfile ||= - ENV["PRIVATE_CA_TEST_KEYFILE"] || - ENV["GCLOUD_TEST_KEYFILE"] - if keyfile - keyfile = File.read keyfile - else - keyfile ||= - ENV["PRIVATE_CA_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 PRIVATE_CA_TEST_PROJECT=test123 PRIVATE_CA_TEST_KEYFILE=/path/to/keyfile.json rake acceptance" - end - require "google/cloud/security/private_ca/v1beta1/certificate_authority_service/credentials" - ::Google::Cloud::Security::PrivateCA::V1beta1::CertificateAuthorityService::Credentials.env_vars.each do |path| - ENV[path] = nil - end - ENV["PRIVATE_CA_PROJECT"] = project - ENV["PRIVATE_CA_TEST_PROJECT"] = project - ENV["PRIVATE_CA_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-security-private_ca-v1beta1 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-security-private_ca-v1beta1 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-security-private_ca-v1beta1 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-security-private_ca-v1beta1 gem does not have doctest tests." -end - -desc "Run the CI build" -task :ci do - header "BUILDING google-cloud-security-private_ca-v1beta1" - header "google-cloud-security-private_ca-v1beta1 rubocop", "*" - Rake::Task[:rubocop].invoke - header "google-cloud-security-private_ca-v1beta1 yard", "*" - Rake::Task[:yard].invoke - header "google-cloud-security-private_ca-v1beta1 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-security-private_ca-v1beta1 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-security-private_ca-v1beta1 acceptance", "*" - Rake::Task[:acceptance].invoke - end - task :a do - # This is a handy shortcut to save typing - Rake::Task["ci:acceptance"].invoke - end -end - -task default: :test - -def header str, token = "#" - line_length = str.length + 8 - puts "" - puts token * line_length - puts "#{token * 3} #{str} #{token * 3}" - puts token * line_length - puts "" -end diff --git a/owl-bot-staging/google-cloud-security-private_ca-v1beta1/gapic_metadata.json b/owl-bot-staging/google-cloud-security-private_ca-v1beta1/gapic_metadata.json deleted file mode 100644 index 7a5ef08f6ba7..000000000000 --- a/owl-bot-staging/google-cloud-security-private_ca-v1beta1/gapic_metadata.json +++ /dev/null @@ -1,118 +0,0 @@ -{ - "schema": "1.0", - "comment": "This file maps proto services/RPCs to the corresponding library clients/methods", - "language": "ruby", - "protoPackage": "google.cloud.security.privateca.v1beta1", - "libraryPackage": "::Google::Cloud::Security::PrivateCA::V1beta1", - "services": { - "CertificateAuthorityService": { - "clients": { - "grpc": { - "libraryClient": "::Google::Cloud::Security::PrivateCA::V1beta1::CertificateAuthorityService::Client", - "rpcs": { - "CreateCertificate": { - "methods": [ - "create_certificate" - ] - }, - "GetCertificate": { - "methods": [ - "get_certificate" - ] - }, - "ListCertificates": { - "methods": [ - "list_certificates" - ] - }, - "RevokeCertificate": { - "methods": [ - "revoke_certificate" - ] - }, - "UpdateCertificate": { - "methods": [ - "update_certificate" - ] - }, - "ActivateCertificateAuthority": { - "methods": [ - "activate_certificate_authority" - ] - }, - "CreateCertificateAuthority": { - "methods": [ - "create_certificate_authority" - ] - }, - "DisableCertificateAuthority": { - "methods": [ - "disable_certificate_authority" - ] - }, - "EnableCertificateAuthority": { - "methods": [ - "enable_certificate_authority" - ] - }, - "FetchCertificateAuthorityCsr": { - "methods": [ - "fetch_certificate_authority_csr" - ] - }, - "GetCertificateAuthority": { - "methods": [ - "get_certificate_authority" - ] - }, - "ListCertificateAuthorities": { - "methods": [ - "list_certificate_authorities" - ] - }, - "RestoreCertificateAuthority": { - "methods": [ - "restore_certificate_authority" - ] - }, - "ScheduleDeleteCertificateAuthority": { - "methods": [ - "schedule_delete_certificate_authority" - ] - }, - "UpdateCertificateAuthority": { - "methods": [ - "update_certificate_authority" - ] - }, - "GetCertificateRevocationList": { - "methods": [ - "get_certificate_revocation_list" - ] - }, - "ListCertificateRevocationLists": { - "methods": [ - "list_certificate_revocation_lists" - ] - }, - "UpdateCertificateRevocationList": { - "methods": [ - "update_certificate_revocation_list" - ] - }, - "GetReusableConfig": { - "methods": [ - "get_reusable_config" - ] - }, - "ListReusableConfigs": { - "methods": [ - "list_reusable_configs" - ] - } - } - } - } - } - } -} diff --git a/owl-bot-staging/google-cloud-security-private_ca-v1beta1/google-cloud-security-private_ca-v1beta1.gemspec b/owl-bot-staging/google-cloud-security-private_ca-v1beta1/google-cloud-security-private_ca-v1beta1.gemspec deleted file mode 100644 index 870ee8c8861b..000000000000 --- a/owl-bot-staging/google-cloud-security-private_ca-v1beta1/google-cloud-security-private_ca-v1beta1.gemspec +++ /dev/null @@ -1,28 +0,0 @@ -# -*- ruby -*- -# encoding: utf-8 - -require File.expand_path("lib/google/cloud/security/private_ca/v1beta1/version", __dir__) - -Gem::Specification.new do |gem| - gem.name = "google-cloud-security-private_ca-v1beta1" - gem.version = Google::Cloud::Security::PrivateCA::V1beta1::VERSION - - gem.authors = ["Google LLC"] - gem.email = "googleapis-packages@google.com" - gem.description = "Certificate Authority Service is a highly available, scalable Google Cloud service that enables you to simplify, automate, and customize the deployment, management, and security of private certificate authorities (CA). Note that google-cloud-security-private_ca-v1beta1 is a version-specific client library. For most uses, we recommend installing the main client library google-cloud-security-private_ca instead. See the readme for more details." - gem.summary = "API Client library for the Certificate Authority Service V1beta1 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" -end diff --git a/owl-bot-staging/google-cloud-security-private_ca-v1beta1/lib/google-cloud-security-private_ca-v1beta1.rb b/owl-bot-staging/google-cloud-security-private_ca-v1beta1/lib/google-cloud-security-private_ca-v1beta1.rb deleted file mode 100644 index 472d24065727..000000000000 --- a/owl-bot-staging/google-cloud-security-private_ca-v1beta1/lib/google-cloud-security-private_ca-v1beta1.rb +++ /dev/null @@ -1,21 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -# This gem does not autoload during Bundler.require. To load this gem, -# issue explicit require statements for the packages desired, e.g.: -# require "google/cloud/security/private_ca/v1beta1" diff --git a/owl-bot-staging/google-cloud-security-private_ca-v1beta1/lib/google/cloud/security/private_ca/v1beta1.rb b/owl-bot-staging/google-cloud-security-private_ca-v1beta1/lib/google/cloud/security/private_ca/v1beta1.rb deleted file mode 100644 index d311a3538d33..000000000000 --- a/owl-bot-staging/google-cloud-security-private_ca-v1beta1/lib/google/cloud/security/private_ca/v1beta1.rb +++ /dev/null @@ -1,47 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -require "google/cloud/security/private_ca/v1beta1/certificate_authority_service" -require "google/cloud/security/private_ca/v1beta1/version" - -module Google - module Cloud - module Security - module PrivateCA - ## - # API client module. - # - # @example Load this package, including all its services, and instantiate a gRPC client - # - # require "google/cloud/security/private_ca/v1beta1" - # client = ::Google::Cloud::Security::PrivateCA::V1beta1::CertificateAuthorityService::Client.new - # - # @example Load this package, including all its services, and instantiate a REST client - # - # require "google/cloud/security/private_ca/v1beta1" - # client = ::Google::Cloud::Security::PrivateCA::V1beta1::CertificateAuthorityService::Rest::Client.new - # - module V1beta1 - end - end - end - end -end - -helper_path = ::File.join __dir__, "v1beta1", "_helpers.rb" -require "google/cloud/security/private_ca/v1beta1/_helpers" if ::File.file? helper_path diff --git a/owl-bot-staging/google-cloud-security-private_ca-v1beta1/lib/google/cloud/security/private_ca/v1beta1/certificate_authority_service.rb b/owl-bot-staging/google-cloud-security-private_ca-v1beta1/lib/google/cloud/security/private_ca/v1beta1/certificate_authority_service.rb deleted file mode 100644 index e8e34962137a..000000000000 --- a/owl-bot-staging/google-cloud-security-private_ca-v1beta1/lib/google/cloud/security/private_ca/v1beta1/certificate_authority_service.rb +++ /dev/null @@ -1,59 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -require "gapic/common" -require "gapic/config" -require "gapic/config/method" - -require "google/cloud/security/private_ca/v1beta1/version" - -require "google/cloud/security/private_ca/v1beta1/certificate_authority_service/credentials" -require "google/cloud/security/private_ca/v1beta1/certificate_authority_service/paths" -require "google/cloud/security/private_ca/v1beta1/certificate_authority_service/operations" -require "google/cloud/security/private_ca/v1beta1/certificate_authority_service/client" -require "google/cloud/security/private_ca/v1beta1/certificate_authority_service/rest" - -module Google - module Cloud - module Security - module PrivateCA - module V1beta1 - ## - # {::Google::Cloud::Security::PrivateCA::V1beta1::CertificateAuthorityService::Client Certificate Authority Service} manages private - # certificate authorities and issued certificates. - # - # @example Load this service and instantiate a gRPC client - # - # require "google/cloud/security/private_ca/v1beta1/certificate_authority_service" - # client = ::Google::Cloud::Security::PrivateCA::V1beta1::CertificateAuthorityService::Client.new - # - # @example Load this service and instantiate a REST client - # - # require "google/cloud/security/private_ca/v1beta1/certificate_authority_service/rest" - # client = ::Google::Cloud::Security::PrivateCA::V1beta1::CertificateAuthorityService::Rest::Client.new - # - module CertificateAuthorityService - end - end - end - end - end -end - -helper_path = ::File.join __dir__, "certificate_authority_service", "helpers.rb" -require "google/cloud/security/private_ca/v1beta1/certificate_authority_service/helpers" if ::File.file? helper_path diff --git a/owl-bot-staging/google-cloud-security-private_ca-v1beta1/lib/google/cloud/security/private_ca/v1beta1/certificate_authority_service/client.rb b/owl-bot-staging/google-cloud-security-private_ca-v1beta1/lib/google/cloud/security/private_ca/v1beta1/certificate_authority_service/client.rb deleted file mode 100644 index a3c4dd1f0fce..000000000000 --- a/owl-bot-staging/google-cloud-security-private_ca-v1beta1/lib/google/cloud/security/private_ca/v1beta1/certificate_authority_service/client.rb +++ /dev/null @@ -1,2614 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -require "google/cloud/errors" -require "google/cloud/security/privateca/v1beta1/service_pb" - -module Google - module Cloud - module Security - module PrivateCA - module V1beta1 - module CertificateAuthorityService - ## - # Client for the CertificateAuthorityService service. - # - # {::Google::Cloud::Security::PrivateCA::V1beta1::CertificateAuthorityService::Client Certificate Authority Service} manages private - # certificate authorities and issued certificates. - # - class Client - # @private - API_VERSION = "" - - # @private - DEFAULT_ENDPOINT_TEMPLATE = "privateca.$UNIVERSE_DOMAIN$" - - include Paths - - # @private - attr_reader :certificate_authority_service_stub - - ## - # Configure the CertificateAuthorityService Client class. - # - # See {::Google::Cloud::Security::PrivateCA::V1beta1::CertificateAuthorityService::Client::Configuration} - # for a description of the configuration fields. - # - # @example - # - # # Modify the configuration for all CertificateAuthorityService clients - # ::Google::Cloud::Security::PrivateCA::V1beta1::CertificateAuthorityService::Client.configure do |config| - # config.timeout = 10.0 - # end - # - # @yield [config] Configure the Client client. - # @yieldparam config [Client::Configuration] - # - # @return [Client::Configuration] - # - def self.configure - @configure ||= begin - namespace = ["Google", "Cloud", "Security", "PrivateCA", "V1beta1"] - parent_config = while namespace.any? - parent_name = namespace.join "::" - parent_const = const_get parent_name - break parent_const.configure if parent_const.respond_to? :configure - namespace.pop - end - default_config = Client::Configuration.new parent_config - - default_config.timeout = 60.0 - default_config.retry_policy = { - initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [2, 14, 4] - } - - default_config - end - yield @configure if block_given? - @configure - end - - ## - # Configure the CertificateAuthorityService Client instance. - # - # The configuration is set to the derived mode, meaning that values can be changed, - # but structural changes (adding new fields, etc.) are not allowed. Structural changes - # should be made on {Client.configure}. - # - # See {::Google::Cloud::Security::PrivateCA::V1beta1::CertificateAuthorityService::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 - @certificate_authority_service_stub.universe_domain - end - - ## - # Create a new CertificateAuthorityService client object. - # - # @example - # - # # Create a client using the default configuration - # client = ::Google::Cloud::Security::PrivateCA::V1beta1::CertificateAuthorityService::Client.new - # - # # Create a client using a custom configuration - # client = ::Google::Cloud::Security::PrivateCA::V1beta1::CertificateAuthorityService::Client.new do |config| - # config.timeout = 10.0 - # end - # - # @yield [config] Configure the CertificateAuthorityService client. - # @yieldparam config [Client::Configuration] - # - def initialize - # These require statements are intentionally placed here to initialize - # the gRPC module only when it's required. - # See https://github.com/googleapis/toolkit/issues/446 - require "gapic/grpc" - require "google/cloud/security/privateca/v1beta1/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 - - @certificate_authority_service_stub = ::Gapic::ServiceStub.new( - ::Google::Cloud::Security::PrivateCA::V1beta1::CertificateAuthorityService::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 - ) - - @certificate_authority_service_stub.stub_logger&.info do |entry| - entry.set_system_name - entry.set_service - entry.message = "Created client for #{entry.service}" - entry.set_credentials_fields credentials - entry.set "customEndpoint", @config.endpoint if @config.endpoint - entry.set "defaultTimeout", @config.timeout if @config.timeout - entry.set "quotaProject", @quota_project_id if @quota_project_id - end - end - - ## - # Get the associated client for long-running operations. - # - # @return [::Google::Cloud::Security::PrivateCA::V1beta1::CertificateAuthorityService::Operations] - # - attr_reader :operations_client - - ## - # The logger used for request/response debug logging. - # - # @return [Logger] - # - def logger - @certificate_authority_service_stub.logger - end - - # Service calls - - ## - # Create a new {::Google::Cloud::Security::PrivateCA::V1beta1::Certificate Certificate} in a given Project, Location from a particular - # {::Google::Cloud::Security::PrivateCA::V1beta1::CertificateAuthority CertificateAuthority}. - # - # @overload create_certificate(request, options = nil) - # Pass arguments to `create_certificate` via a request object, either of type - # {::Google::Cloud::Security::PrivateCA::V1beta1::CreateCertificateRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Security::PrivateCA::V1beta1::CreateCertificateRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_certificate(parent: nil, certificate_id: nil, certificate: nil, request_id: nil) - # Pass arguments to `create_certificate` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param parent [::String] - # Required. The resource name of the location and {::Google::Cloud::Security::PrivateCA::V1beta1::CertificateAuthority CertificateAuthority} - # associated with the {::Google::Cloud::Security::PrivateCA::V1beta1::Certificate Certificate}, in the format - # `projects/*/locations/*/certificateAuthorities/*`. - # @param certificate_id [::String] - # Optional. It must be unique within a location and match the regular - # expression `[a-zA-Z0-9_-]{1,63}`. This field is required when using a - # {::Google::Cloud::Security::PrivateCA::V1beta1::CertificateAuthority CertificateAuthority} in the Enterprise {::Google::Cloud::Security::PrivateCA::V1beta1::CertificateAuthority::Tier CertificateAuthority.Tier}, - # but is optional and its value is ignored otherwise. - # @param certificate [::Google::Cloud::Security::PrivateCA::V1beta1::Certificate, ::Hash] - # Required. A {::Google::Cloud::Security::PrivateCA::V1beta1::Certificate Certificate} with initial field values. - # @param request_id [::String] - # Optional. An ID to identify requests. Specify a unique request ID so that if you must - # retry your request, the server will know to ignore the request if it has - # already been completed. The server will guarantee that for at least 60 - # minutes since the first request. - # - # For example, consider a situation where you make an initial request and t - # he request times out. If you make the request again with the same request - # ID, the server can check if original operation with the same request ID - # was received, and if so, will ignore the second request. This prevents - # clients from accidentally creating duplicate commitments. - # - # The request ID must be a valid UUID with the exception that zero UUID is - # not supported (00000000-0000-0000-0000-000000000000). - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Google::Cloud::Security::PrivateCA::V1beta1::Certificate] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Google::Cloud::Security::PrivateCA::V1beta1::Certificate] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/cloud/security/private_ca/v1beta1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Security::PrivateCA::V1beta1::CertificateAuthorityService::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Security::PrivateCA::V1beta1::CreateCertificateRequest.new - # - # # Call the create_certificate method. - # result = client.create_certificate request - # - # # The returned object is of type Google::Cloud::Security::PrivateCA::V1beta1::Certificate. - # p result - # - def create_certificate request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Security::PrivateCA::V1beta1::CreateCertificateRequest - - # Converts hash 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_certificate.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::Security::PrivateCA::V1beta1::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_certificate.timeout, - metadata: metadata, - retry_policy: @config.rpcs.create_certificate.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @certificate_authority_service_stub.call_rpc :create_certificate, request, options: options do |response, operation| - yield response, operation if block_given? - end - rescue ::GRPC::BadStatus => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Returns a {::Google::Cloud::Security::PrivateCA::V1beta1::Certificate Certificate}. - # - # @overload get_certificate(request, options = nil) - # Pass arguments to `get_certificate` via a request object, either of type - # {::Google::Cloud::Security::PrivateCA::V1beta1::GetCertificateRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Security::PrivateCA::V1beta1::GetCertificateRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_certificate(name: nil) - # Pass arguments to `get_certificate` via keyword arguments. Note that at - # least one keyword argument is 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 {::Google::Cloud::Security::PrivateCA::V1beta1::Certificate#name name} of the {::Google::Cloud::Security::PrivateCA::V1beta1::Certificate Certificate} to get. - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Google::Cloud::Security::PrivateCA::V1beta1::Certificate] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Google::Cloud::Security::PrivateCA::V1beta1::Certificate] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/cloud/security/private_ca/v1beta1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Security::PrivateCA::V1beta1::CertificateAuthorityService::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Security::PrivateCA::V1beta1::GetCertificateRequest.new - # - # # Call the get_certificate method. - # result = client.get_certificate request - # - # # The returned object is of type Google::Cloud::Security::PrivateCA::V1beta1::Certificate. - # p result - # - def get_certificate request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Security::PrivateCA::V1beta1::GetCertificateRequest - - # Converts hash 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_certificate.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::Security::PrivateCA::V1beta1::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_certificate.timeout, - metadata: metadata, - retry_policy: @config.rpcs.get_certificate.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @certificate_authority_service_stub.call_rpc :get_certificate, request, options: options do |response, operation| - yield response, operation if block_given? - end - rescue ::GRPC::BadStatus => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Lists {::Google::Cloud::Security::PrivateCA::V1beta1::Certificate Certificates}. - # - # @overload list_certificates(request, options = nil) - # Pass arguments to `list_certificates` via a request object, either of type - # {::Google::Cloud::Security::PrivateCA::V1beta1::ListCertificatesRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Security::PrivateCA::V1beta1::ListCertificatesRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_certificates(parent: nil, page_size: nil, page_token: nil, filter: nil, order_by: nil) - # Pass arguments to `list_certificates` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param parent [::String] - # Required. The resource name of the location associated with the - # {::Google::Cloud::Security::PrivateCA::V1beta1::Certificate Certificates}, in the format - # `projects/*/locations/*/certificateauthorities/*`. - # @param page_size [::Integer] - # Optional. Limit on the number of - # {::Google::Cloud::Security::PrivateCA::V1beta1::Certificate Certificates} to include in the - # response. Further {::Google::Cloud::Security::PrivateCA::V1beta1::Certificate Certificates} can subsequently be obtained - # by including the - # {::Google::Cloud::Security::PrivateCA::V1beta1::ListCertificatesResponse#next_page_token ListCertificatesResponse.next_page_token} in a subsequent - # request. If unspecified, the server will pick an appropriate default. - # @param page_token [::String] - # Optional. Pagination token, returned earlier via - # {::Google::Cloud::Security::PrivateCA::V1beta1::ListCertificatesResponse#next_page_token ListCertificatesResponse.next_page_token}. - # @param filter [::String] - # Optional. Only include resources that match the filter in the response. For details - # on supported filters and syntax, see [Certificates Filtering - # documentation](https://cloud.google.com/certificate-authority-service/docs/sorting-filtering-certificates#filtering_support). - # @param order_by [::String] - # Optional. Specify how the results should be sorted. For details on supported fields - # and syntax, see [Certificates Sorting - # documentation](https://cloud.google.com/certificate-authority-service/docs/sorting-filtering-certificates#sorting_support). - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Gapic::PagedEnumerable<::Google::Cloud::Security::PrivateCA::V1beta1::Certificate>] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Gapic::PagedEnumerable<::Google::Cloud::Security::PrivateCA::V1beta1::Certificate>] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/cloud/security/private_ca/v1beta1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Security::PrivateCA::V1beta1::CertificateAuthorityService::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Security::PrivateCA::V1beta1::ListCertificatesRequest.new - # - # # Call the list_certificates method. - # result = client.list_certificates request - # - # # The returned object is of type Gapic::PagedEnumerable. You can iterate - # # over elements, and API calls will be issued to fetch pages as needed. - # result.each do |item| - # # Each element is of type ::Google::Cloud::Security::PrivateCA::V1beta1::Certificate. - # p item - # end - # - def list_certificates request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Security::PrivateCA::V1beta1::ListCertificatesRequest - - # Converts hash 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_certificates.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::Security::PrivateCA::V1beta1::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_certificates.timeout, - metadata: metadata, - retry_policy: @config.rpcs.list_certificates.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @certificate_authority_service_stub.call_rpc :list_certificates, request, options: options do |response, operation| - response = ::Gapic::PagedEnumerable.new @certificate_authority_service_stub, :list_certificates, 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 - - ## - # Revoke a {::Google::Cloud::Security::PrivateCA::V1beta1::Certificate Certificate}. - # - # @overload revoke_certificate(request, options = nil) - # Pass arguments to `revoke_certificate` via a request object, either of type - # {::Google::Cloud::Security::PrivateCA::V1beta1::RevokeCertificateRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Security::PrivateCA::V1beta1::RevokeCertificateRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. - # - # @overload revoke_certificate(name: nil, reason: nil, request_id: nil) - # Pass arguments to `revoke_certificate` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param name [::String] - # Required. The resource name for this {::Google::Cloud::Security::PrivateCA::V1beta1::Certificate Certificate} in the - # format `projects/*/locations/*/certificateAuthorities/*/certificates/*`. - # @param reason [::Google::Cloud::Security::PrivateCA::V1beta1::RevocationReason] - # Required. The {::Google::Cloud::Security::PrivateCA::V1beta1::RevocationReason RevocationReason} for revoking this certificate. - # @param request_id [::String] - # Optional. An ID to identify requests. Specify a unique request ID so that if you must - # retry your request, the server will know to ignore the request if it has - # already been completed. The server will guarantee that for at least 60 - # minutes since the first request. - # - # For example, consider a situation where you make an initial request and t - # he request times out. If you make the request again with the same request - # ID, the server can check if original operation with the same request ID - # was received, and if so, will ignore the second request. This prevents - # clients from accidentally creating duplicate commitments. - # - # The request ID must be a valid UUID with the exception that zero UUID is - # not supported (00000000-0000-0000-0000-000000000000). - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Google::Cloud::Security::PrivateCA::V1beta1::Certificate] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Google::Cloud::Security::PrivateCA::V1beta1::Certificate] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/cloud/security/private_ca/v1beta1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Security::PrivateCA::V1beta1::CertificateAuthorityService::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Security::PrivateCA::V1beta1::RevokeCertificateRequest.new - # - # # Call the revoke_certificate method. - # result = client.revoke_certificate request - # - # # The returned object is of type Google::Cloud::Security::PrivateCA::V1beta1::Certificate. - # p result - # - def revoke_certificate request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Security::PrivateCA::V1beta1::RevokeCertificateRequest - - # Converts hash 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.revoke_certificate.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::Security::PrivateCA::V1beta1::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.revoke_certificate.timeout, - metadata: metadata, - retry_policy: @config.rpcs.revoke_certificate.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @certificate_authority_service_stub.call_rpc :revoke_certificate, 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 - - ## - # Update a {::Google::Cloud::Security::PrivateCA::V1beta1::Certificate Certificate}. Currently, the only field you can update is the - # {::Google::Cloud::Security::PrivateCA::V1beta1::Certificate#labels labels} field. - # - # @overload update_certificate(request, options = nil) - # Pass arguments to `update_certificate` via a request object, either of type - # {::Google::Cloud::Security::PrivateCA::V1beta1::UpdateCertificateRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Security::PrivateCA::V1beta1::UpdateCertificateRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_certificate(certificate: nil, update_mask: nil, request_id: nil) - # Pass arguments to `update_certificate` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param certificate [::Google::Cloud::Security::PrivateCA::V1beta1::Certificate, ::Hash] - # Required. {::Google::Cloud::Security::PrivateCA::V1beta1::Certificate Certificate} with updated values. - # @param update_mask [::Google::Protobuf::FieldMask, ::Hash] - # Required. A list of fields to be updated in this request. - # @param request_id [::String] - # Optional. An ID to identify requests. Specify a unique request ID so that if you must - # retry your request, the server will know to ignore the request if it has - # already been completed. The server will guarantee that for at least 60 - # minutes since the first request. - # - # For example, consider a situation where you make an initial request and t - # he request times out. If you make the request again with the same request - # ID, the server can check if original operation with the same request ID - # was received, and if so, will ignore the second request. This prevents - # clients from accidentally creating duplicate commitments. - # - # The request ID must be a valid UUID with the exception that zero UUID is - # not supported (00000000-0000-0000-0000-000000000000). - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Google::Cloud::Security::PrivateCA::V1beta1::Certificate] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Google::Cloud::Security::PrivateCA::V1beta1::Certificate] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/cloud/security/private_ca/v1beta1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Security::PrivateCA::V1beta1::CertificateAuthorityService::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Security::PrivateCA::V1beta1::UpdateCertificateRequest.new - # - # # Call the update_certificate method. - # result = client.update_certificate request - # - # # The returned object is of type Google::Cloud::Security::PrivateCA::V1beta1::Certificate. - # p result - # - def update_certificate request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Security::PrivateCA::V1beta1::UpdateCertificateRequest - - # Converts hash 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_certificate.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::Security::PrivateCA::V1beta1::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.certificate&.name - header_params["certificate.name"] = request.certificate.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_certificate.timeout, - metadata: metadata, - retry_policy: @config.rpcs.update_certificate.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @certificate_authority_service_stub.call_rpc :update_certificate, 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 - - ## - # Activate a {::Google::Cloud::Security::PrivateCA::V1beta1::CertificateAuthority CertificateAuthority} that is in state - # {::Google::Cloud::Security::PrivateCA::V1beta1::CertificateAuthority::State::PENDING_ACTIVATION PENDING_ACTIVATION} and is - # of type {::Google::Cloud::Security::PrivateCA::V1beta1::CertificateAuthority::Type::SUBORDINATE SUBORDINATE}. After the - # parent Certificate Authority signs a certificate signing request from - # {::Google::Cloud::Security::PrivateCA::V1beta1::CertificateAuthorityService::Client#fetch_certificate_authority_csr FetchCertificateAuthorityCsr}, this method can complete the activation - # process. - # - # @overload activate_certificate_authority(request, options = nil) - # Pass arguments to `activate_certificate_authority` via a request object, either of type - # {::Google::Cloud::Security::PrivateCA::V1beta1::ActivateCertificateAuthorityRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Security::PrivateCA::V1beta1::ActivateCertificateAuthorityRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. - # - # @overload activate_certificate_authority(name: nil, pem_ca_certificate: nil, subordinate_config: nil, request_id: nil) - # Pass arguments to `activate_certificate_authority` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param name [::String] - # Required. The resource name for this {::Google::Cloud::Security::PrivateCA::V1beta1::CertificateAuthority CertificateAuthority} in the - # format `projects/*/locations/*/certificateAuthorities/*`. - # @param pem_ca_certificate [::String] - # Required. The signed CA certificate issued from - # {::Google::Cloud::Security::PrivateCA::V1beta1::FetchCertificateAuthorityCsrResponse#pem_csr FetchCertificateAuthorityCsrResponse.pem_csr}. - # @param subordinate_config [::Google::Cloud::Security::PrivateCA::V1beta1::SubordinateConfig, ::Hash] - # Required. Must include information about the issuer of 'pem_ca_certificate', and any - # further issuers until the self-signed CA. - # @param request_id [::String] - # Optional. An ID to identify requests. Specify a unique request ID so that if you must - # retry your request, the server will know to ignore the request if it has - # already been completed. The server will guarantee that for at least 60 - # minutes since the first request. - # - # For example, consider a situation where you make an initial request and t - # he request times out. If you make the request again with the same request - # ID, the server can check if original operation with the same request ID - # was received, and if so, will ignore the second request. This prevents - # clients from accidentally creating duplicate commitments. - # - # The request ID must be a valid UUID with the exception that zero UUID is - # not supported (00000000-0000-0000-0000-000000000000). - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Gapic::Operation] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Gapic::Operation] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/cloud/security/private_ca/v1beta1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Security::PrivateCA::V1beta1::CertificateAuthorityService::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Security::PrivateCA::V1beta1::ActivateCertificateAuthorityRequest.new - # - # # Call the activate_certificate_authority method. - # result = client.activate_certificate_authority 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 activate_certificate_authority request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Security::PrivateCA::V1beta1::ActivateCertificateAuthorityRequest - - # Converts hash 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.activate_certificate_authority.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::Security::PrivateCA::V1beta1::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.activate_certificate_authority.timeout, - metadata: metadata, - retry_policy: @config.rpcs.activate_certificate_authority.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @certificate_authority_service_stub.call_rpc :activate_certificate_authority, 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 - - ## - # Create a new {::Google::Cloud::Security::PrivateCA::V1beta1::CertificateAuthority CertificateAuthority} in a given Project and Location. - # - # @overload create_certificate_authority(request, options = nil) - # Pass arguments to `create_certificate_authority` via a request object, either of type - # {::Google::Cloud::Security::PrivateCA::V1beta1::CreateCertificateAuthorityRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Security::PrivateCA::V1beta1::CreateCertificateAuthorityRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_certificate_authority(parent: nil, certificate_authority_id: nil, certificate_authority: nil, request_id: nil) - # Pass arguments to `create_certificate_authority` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param parent [::String] - # Required. The resource name of the location associated with the - # {::Google::Cloud::Security::PrivateCA::V1beta1::CertificateAuthority CertificateAuthorities}, in the format - # `projects/*/locations/*`. - # @param certificate_authority_id [::String] - # Required. It must be unique within a location and match the regular - # expression `[a-zA-Z0-9_-]{1,63}` - # @param certificate_authority [::Google::Cloud::Security::PrivateCA::V1beta1::CertificateAuthority, ::Hash] - # Required. A {::Google::Cloud::Security::PrivateCA::V1beta1::CertificateAuthority CertificateAuthority} with initial field values. - # @param request_id [::String] - # Optional. An ID to identify requests. Specify a unique request ID so that if you must - # retry your request, the server will know to ignore the request if it has - # already been completed. The server will guarantee that for at least 60 - # minutes since the first request. - # - # For example, consider a situation where you make an initial request and t - # he request times out. If you make the request again with the same request - # ID, the server can check if original operation with the same request ID - # was received, and if so, will ignore the second request. This prevents - # clients from accidentally creating duplicate commitments. - # - # The request ID must be a valid UUID with the exception that zero UUID is - # not supported (00000000-0000-0000-0000-000000000000). - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Gapic::Operation] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Gapic::Operation] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/cloud/security/private_ca/v1beta1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Security::PrivateCA::V1beta1::CertificateAuthorityService::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Security::PrivateCA::V1beta1::CreateCertificateAuthorityRequest.new - # - # # Call the create_certificate_authority method. - # result = client.create_certificate_authority 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_certificate_authority request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Security::PrivateCA::V1beta1::CreateCertificateAuthorityRequest - - # Converts hash 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_certificate_authority.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::Security::PrivateCA::V1beta1::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_certificate_authority.timeout, - metadata: metadata, - retry_policy: @config.rpcs.create_certificate_authority.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @certificate_authority_service_stub.call_rpc :create_certificate_authority, 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 - - ## - # Disable a {::Google::Cloud::Security::PrivateCA::V1beta1::CertificateAuthority CertificateAuthority}. - # - # @overload disable_certificate_authority(request, options = nil) - # Pass arguments to `disable_certificate_authority` via a request object, either of type - # {::Google::Cloud::Security::PrivateCA::V1beta1::DisableCertificateAuthorityRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Security::PrivateCA::V1beta1::DisableCertificateAuthorityRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. - # - # @overload disable_certificate_authority(name: nil, request_id: nil) - # Pass arguments to `disable_certificate_authority` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param name [::String] - # Required. The resource name for this {::Google::Cloud::Security::PrivateCA::V1beta1::CertificateAuthority CertificateAuthority} in the - # format `projects/*/locations/*/certificateAuthorities/*`. - # @param request_id [::String] - # Optional. An ID to identify requests. Specify a unique request ID so that if you must - # retry your request, the server will know to ignore the request if it has - # already been completed. The server will guarantee that for at least 60 - # minutes since the first request. - # - # For example, consider a situation where you make an initial request and t - # he request times out. If you make the request again with the same request - # ID, the server can check if original operation with the same request ID - # was received, and if so, will ignore the second request. This prevents - # clients from accidentally creating duplicate commitments. - # - # The request ID must be a valid UUID with the exception that zero UUID is - # not supported (00000000-0000-0000-0000-000000000000). - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Gapic::Operation] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Gapic::Operation] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/cloud/security/private_ca/v1beta1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Security::PrivateCA::V1beta1::CertificateAuthorityService::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Security::PrivateCA::V1beta1::DisableCertificateAuthorityRequest.new - # - # # Call the disable_certificate_authority method. - # result = client.disable_certificate_authority 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 disable_certificate_authority request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Security::PrivateCA::V1beta1::DisableCertificateAuthorityRequest - - # Converts hash and nil to an options object - options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h - - # Customize the options with defaults - metadata = @config.rpcs.disable_certificate_authority.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::Security::PrivateCA::V1beta1::VERSION - metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - header_params = {} - if request.name - header_params["name"] = request.name - end - - request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") - metadata[:"x-goog-request-params"] ||= request_params_header - - options.apply_defaults timeout: @config.rpcs.disable_certificate_authority.timeout, - metadata: metadata, - retry_policy: @config.rpcs.disable_certificate_authority.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @certificate_authority_service_stub.call_rpc :disable_certificate_authority, 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 - - ## - # Enable a {::Google::Cloud::Security::PrivateCA::V1beta1::CertificateAuthority CertificateAuthority}. - # - # @overload enable_certificate_authority(request, options = nil) - # Pass arguments to `enable_certificate_authority` via a request object, either of type - # {::Google::Cloud::Security::PrivateCA::V1beta1::EnableCertificateAuthorityRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Security::PrivateCA::V1beta1::EnableCertificateAuthorityRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. - # - # @overload enable_certificate_authority(name: nil, request_id: nil) - # Pass arguments to `enable_certificate_authority` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param name [::String] - # Required. The resource name for this {::Google::Cloud::Security::PrivateCA::V1beta1::CertificateAuthority CertificateAuthority} in the - # format `projects/*/locations/*/certificateAuthorities/*`. - # @param request_id [::String] - # Optional. An ID to identify requests. Specify a unique request ID so that if you must - # retry your request, the server will know to ignore the request if it has - # already been completed. The server will guarantee that for at least 60 - # minutes since the first request. - # - # For example, consider a situation where you make an initial request and t - # he request times out. If you make the request again with the same request - # ID, the server can check if original operation with the same request ID - # was received, and if so, will ignore the second request. This prevents - # clients from accidentally creating duplicate commitments. - # - # The request ID must be a valid UUID with the exception that zero UUID is - # not supported (00000000-0000-0000-0000-000000000000). - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Gapic::Operation] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Gapic::Operation] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/cloud/security/private_ca/v1beta1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Security::PrivateCA::V1beta1::CertificateAuthorityService::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Security::PrivateCA::V1beta1::EnableCertificateAuthorityRequest.new - # - # # Call the enable_certificate_authority method. - # result = client.enable_certificate_authority 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 enable_certificate_authority request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Security::PrivateCA::V1beta1::EnableCertificateAuthorityRequest - - # Converts hash and nil to an options object - options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h - - # Customize the options with defaults - metadata = @config.rpcs.enable_certificate_authority.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::Security::PrivateCA::V1beta1::VERSION - metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - header_params = {} - if request.name - header_params["name"] = request.name - end - - request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") - metadata[:"x-goog-request-params"] ||= request_params_header - - options.apply_defaults timeout: @config.rpcs.enable_certificate_authority.timeout, - metadata: metadata, - retry_policy: @config.rpcs.enable_certificate_authority.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @certificate_authority_service_stub.call_rpc :enable_certificate_authority, 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 - - ## - # Fetch a certificate signing request (CSR) from a {::Google::Cloud::Security::PrivateCA::V1beta1::CertificateAuthority CertificateAuthority} - # that is in state - # {::Google::Cloud::Security::PrivateCA::V1beta1::CertificateAuthority::State::PENDING_ACTIVATION PENDING_ACTIVATION} and is - # of type {::Google::Cloud::Security::PrivateCA::V1beta1::CertificateAuthority::Type::SUBORDINATE SUBORDINATE}. The CSR must - # then be signed by the desired parent Certificate Authority, which could be - # another {::Google::Cloud::Security::PrivateCA::V1beta1::CertificateAuthority CertificateAuthority} resource, or could be an on-prem - # certificate authority. See also {::Google::Cloud::Security::PrivateCA::V1beta1::CertificateAuthorityService::Client#activate_certificate_authority ActivateCertificateAuthority}. - # - # @overload fetch_certificate_authority_csr(request, options = nil) - # Pass arguments to `fetch_certificate_authority_csr` via a request object, either of type - # {::Google::Cloud::Security::PrivateCA::V1beta1::FetchCertificateAuthorityCsrRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Security::PrivateCA::V1beta1::FetchCertificateAuthorityCsrRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. - # - # @overload fetch_certificate_authority_csr(name: nil) - # Pass arguments to `fetch_certificate_authority_csr` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param name [::String] - # Required. The resource name for this {::Google::Cloud::Security::PrivateCA::V1beta1::CertificateAuthority CertificateAuthority} in the - # format `projects/*/locations/*/certificateAuthorities/*`. - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Google::Cloud::Security::PrivateCA::V1beta1::FetchCertificateAuthorityCsrResponse] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Google::Cloud::Security::PrivateCA::V1beta1::FetchCertificateAuthorityCsrResponse] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/cloud/security/private_ca/v1beta1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Security::PrivateCA::V1beta1::CertificateAuthorityService::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Security::PrivateCA::V1beta1::FetchCertificateAuthorityCsrRequest.new - # - # # Call the fetch_certificate_authority_csr method. - # result = client.fetch_certificate_authority_csr request - # - # # The returned object is of type Google::Cloud::Security::PrivateCA::V1beta1::FetchCertificateAuthorityCsrResponse. - # p result - # - def fetch_certificate_authority_csr request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Security::PrivateCA::V1beta1::FetchCertificateAuthorityCsrRequest - - # Converts hash 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.fetch_certificate_authority_csr.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::Security::PrivateCA::V1beta1::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.fetch_certificate_authority_csr.timeout, - metadata: metadata, - retry_policy: @config.rpcs.fetch_certificate_authority_csr.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @certificate_authority_service_stub.call_rpc :fetch_certificate_authority_csr, request, options: options do |response, operation| - yield response, operation if block_given? - end - rescue ::GRPC::BadStatus => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Returns a {::Google::Cloud::Security::PrivateCA::V1beta1::CertificateAuthority CertificateAuthority}. - # - # @overload get_certificate_authority(request, options = nil) - # Pass arguments to `get_certificate_authority` via a request object, either of type - # {::Google::Cloud::Security::PrivateCA::V1beta1::GetCertificateAuthorityRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Security::PrivateCA::V1beta1::GetCertificateAuthorityRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_certificate_authority(name: nil) - # Pass arguments to `get_certificate_authority` via keyword arguments. Note that at - # least one keyword argument is 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 {::Google::Cloud::Security::PrivateCA::V1beta1::CertificateAuthority#name name} of the {::Google::Cloud::Security::PrivateCA::V1beta1::CertificateAuthority CertificateAuthority} to - # get. - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Google::Cloud::Security::PrivateCA::V1beta1::CertificateAuthority] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Google::Cloud::Security::PrivateCA::V1beta1::CertificateAuthority] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/cloud/security/private_ca/v1beta1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Security::PrivateCA::V1beta1::CertificateAuthorityService::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Security::PrivateCA::V1beta1::GetCertificateAuthorityRequest.new - # - # # Call the get_certificate_authority method. - # result = client.get_certificate_authority request - # - # # The returned object is of type Google::Cloud::Security::PrivateCA::V1beta1::CertificateAuthority. - # p result - # - def get_certificate_authority request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Security::PrivateCA::V1beta1::GetCertificateAuthorityRequest - - # Converts hash 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_certificate_authority.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::Security::PrivateCA::V1beta1::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_certificate_authority.timeout, - metadata: metadata, - retry_policy: @config.rpcs.get_certificate_authority.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @certificate_authority_service_stub.call_rpc :get_certificate_authority, request, options: options do |response, operation| - yield response, operation if block_given? - end - rescue ::GRPC::BadStatus => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Lists {::Google::Cloud::Security::PrivateCA::V1beta1::CertificateAuthority CertificateAuthorities}. - # - # @overload list_certificate_authorities(request, options = nil) - # Pass arguments to `list_certificate_authorities` via a request object, either of type - # {::Google::Cloud::Security::PrivateCA::V1beta1::ListCertificateAuthoritiesRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Security::PrivateCA::V1beta1::ListCertificateAuthoritiesRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_certificate_authorities(parent: nil, page_size: nil, page_token: nil, filter: nil, order_by: nil) - # Pass arguments to `list_certificate_authorities` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param parent [::String] - # Required. The resource name of the location associated with the - # {::Google::Cloud::Security::PrivateCA::V1beta1::CertificateAuthority CertificateAuthorities}, in the format - # `projects/*/locations/*`. - # @param page_size [::Integer] - # Optional. Limit on the number of {::Google::Cloud::Security::PrivateCA::V1beta1::CertificateAuthority CertificateAuthorities} to - # include in the response. - # Further {::Google::Cloud::Security::PrivateCA::V1beta1::CertificateAuthority CertificateAuthorities} can subsequently be - # obtained by including the - # {::Google::Cloud::Security::PrivateCA::V1beta1::ListCertificateAuthoritiesResponse#next_page_token ListCertificateAuthoritiesResponse.next_page_token} in a subsequent - # request. If unspecified, the server will pick an appropriate default. - # @param page_token [::String] - # Optional. Pagination token, returned earlier via - # {::Google::Cloud::Security::PrivateCA::V1beta1::ListCertificateAuthoritiesResponse#next_page_token ListCertificateAuthoritiesResponse.next_page_token}. - # @param filter [::String] - # Optional. Only include resources that match the filter in the response. - # @param order_by [::String] - # Optional. Specify how the results should be sorted. - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Gapic::PagedEnumerable<::Google::Cloud::Security::PrivateCA::V1beta1::CertificateAuthority>] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Gapic::PagedEnumerable<::Google::Cloud::Security::PrivateCA::V1beta1::CertificateAuthority>] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/cloud/security/private_ca/v1beta1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Security::PrivateCA::V1beta1::CertificateAuthorityService::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Security::PrivateCA::V1beta1::ListCertificateAuthoritiesRequest.new - # - # # Call the list_certificate_authorities method. - # result = client.list_certificate_authorities request - # - # # The returned object is of type Gapic::PagedEnumerable. You can iterate - # # over elements, and API calls will be issued to fetch pages as needed. - # result.each do |item| - # # Each element is of type ::Google::Cloud::Security::PrivateCA::V1beta1::CertificateAuthority. - # p item - # end - # - def list_certificate_authorities request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Security::PrivateCA::V1beta1::ListCertificateAuthoritiesRequest - - # Converts hash 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_certificate_authorities.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::Security::PrivateCA::V1beta1::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_certificate_authorities.timeout, - metadata: metadata, - retry_policy: @config.rpcs.list_certificate_authorities.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @certificate_authority_service_stub.call_rpc :list_certificate_authorities, request, options: options do |response, operation| - response = ::Gapic::PagedEnumerable.new @certificate_authority_service_stub, :list_certificate_authorities, 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 - - ## - # Restore a {::Google::Cloud::Security::PrivateCA::V1beta1::CertificateAuthority CertificateAuthority} that is scheduled for deletion. - # - # @overload restore_certificate_authority(request, options = nil) - # Pass arguments to `restore_certificate_authority` via a request object, either of type - # {::Google::Cloud::Security::PrivateCA::V1beta1::RestoreCertificateAuthorityRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Security::PrivateCA::V1beta1::RestoreCertificateAuthorityRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. - # - # @overload restore_certificate_authority(name: nil, request_id: nil) - # Pass arguments to `restore_certificate_authority` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param name [::String] - # Required. The resource name for this {::Google::Cloud::Security::PrivateCA::V1beta1::CertificateAuthority CertificateAuthority} in the - # format `projects/*/locations/*/certificateAuthorities/*`. - # @param request_id [::String] - # Optional. An ID to identify requests. Specify a unique request ID so that if you must - # retry your request, the server will know to ignore the request if it has - # already been completed. The server will guarantee that for at least 60 - # minutes since the first request. - # - # For example, consider a situation where you make an initial request and t - # he request times out. If you make the request again with the same request - # ID, the server can check if original operation with the same request ID - # was received, and if so, will ignore the second request. This prevents - # clients from accidentally creating duplicate commitments. - # - # The request ID must be a valid UUID with the exception that zero UUID is - # not supported (00000000-0000-0000-0000-000000000000). - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Gapic::Operation] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Gapic::Operation] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/cloud/security/private_ca/v1beta1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Security::PrivateCA::V1beta1::CertificateAuthorityService::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Security::PrivateCA::V1beta1::RestoreCertificateAuthorityRequest.new - # - # # Call the restore_certificate_authority method. - # result = client.restore_certificate_authority 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 restore_certificate_authority request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Security::PrivateCA::V1beta1::RestoreCertificateAuthorityRequest - - # Converts hash 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.restore_certificate_authority.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::Security::PrivateCA::V1beta1::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.restore_certificate_authority.timeout, - metadata: metadata, - retry_policy: @config.rpcs.restore_certificate_authority.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @certificate_authority_service_stub.call_rpc :restore_certificate_authority, 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 - - ## - # Schedule a {::Google::Cloud::Security::PrivateCA::V1beta1::CertificateAuthority CertificateAuthority} for deletion. - # - # @overload schedule_delete_certificate_authority(request, options = nil) - # Pass arguments to `schedule_delete_certificate_authority` via a request object, either of type - # {::Google::Cloud::Security::PrivateCA::V1beta1::ScheduleDeleteCertificateAuthorityRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Security::PrivateCA::V1beta1::ScheduleDeleteCertificateAuthorityRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. - # - # @overload schedule_delete_certificate_authority(name: nil, request_id: nil) - # Pass arguments to `schedule_delete_certificate_authority` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param name [::String] - # Required. The resource name for this {::Google::Cloud::Security::PrivateCA::V1beta1::CertificateAuthority CertificateAuthority} in the - # format `projects/*/locations/*/certificateAuthorities/*`. - # @param request_id [::String] - # Optional. An ID to identify requests. Specify a unique request ID so that if you must - # retry your request, the server will know to ignore the request if it has - # already been completed. The server will guarantee that for at least 60 - # minutes since the first request. - # - # For example, consider a situation where you make an initial request and t - # he request times out. If you make the request again with the same request - # ID, the server can check if original operation with the same request ID - # was received, and if so, will ignore the second request. This prevents - # clients from accidentally creating duplicate commitments. - # - # The request ID must be a valid UUID with the exception that zero UUID is - # not supported (00000000-0000-0000-0000-000000000000). - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Gapic::Operation] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Gapic::Operation] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/cloud/security/private_ca/v1beta1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Security::PrivateCA::V1beta1::CertificateAuthorityService::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Security::PrivateCA::V1beta1::ScheduleDeleteCertificateAuthorityRequest.new - # - # # Call the schedule_delete_certificate_authority method. - # result = client.schedule_delete_certificate_authority 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 schedule_delete_certificate_authority request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Security::PrivateCA::V1beta1::ScheduleDeleteCertificateAuthorityRequest - - # Converts hash 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.schedule_delete_certificate_authority.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::Security::PrivateCA::V1beta1::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.schedule_delete_certificate_authority.timeout, - metadata: metadata, - retry_policy: @config.rpcs.schedule_delete_certificate_authority.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @certificate_authority_service_stub.call_rpc :schedule_delete_certificate_authority, 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 - - ## - # Update a {::Google::Cloud::Security::PrivateCA::V1beta1::CertificateAuthority CertificateAuthority}. - # - # @overload update_certificate_authority(request, options = nil) - # Pass arguments to `update_certificate_authority` via a request object, either of type - # {::Google::Cloud::Security::PrivateCA::V1beta1::UpdateCertificateAuthorityRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Security::PrivateCA::V1beta1::UpdateCertificateAuthorityRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_certificate_authority(certificate_authority: nil, update_mask: nil, request_id: nil) - # Pass arguments to `update_certificate_authority` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param certificate_authority [::Google::Cloud::Security::PrivateCA::V1beta1::CertificateAuthority, ::Hash] - # Required. {::Google::Cloud::Security::PrivateCA::V1beta1::CertificateAuthority CertificateAuthority} with updated values. - # @param update_mask [::Google::Protobuf::FieldMask, ::Hash] - # Required. A list of fields to be updated in this request. - # @param request_id [::String] - # Optional. An ID to identify requests. Specify a unique request ID so that if you must - # retry your request, the server will know to ignore the request if it has - # already been completed. The server will guarantee that for at least 60 - # minutes since the first request. - # - # For example, consider a situation where you make an initial request and t - # he request times out. If you make the request again with the same request - # ID, the server can check if original operation with the same request ID - # was received, and if so, will ignore the second request. This prevents - # clients from accidentally creating duplicate commitments. - # - # The request ID must be a valid UUID with the exception that zero UUID is - # not supported (00000000-0000-0000-0000-000000000000). - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Gapic::Operation] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Gapic::Operation] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/cloud/security/private_ca/v1beta1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Security::PrivateCA::V1beta1::CertificateAuthorityService::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Security::PrivateCA::V1beta1::UpdateCertificateAuthorityRequest.new - # - # # Call the update_certificate_authority method. - # result = client.update_certificate_authority 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_certificate_authority request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Security::PrivateCA::V1beta1::UpdateCertificateAuthorityRequest - - # Converts hash 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_certificate_authority.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::Security::PrivateCA::V1beta1::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.certificate_authority&.name - header_params["certificate_authority.name"] = request.certificate_authority.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_certificate_authority.timeout, - metadata: metadata, - retry_policy: @config.rpcs.update_certificate_authority.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @certificate_authority_service_stub.call_rpc :update_certificate_authority, request, options: options do |response, operation| - response = ::Gapic::Operation.new response, @operations_client, options: options - yield response, operation if block_given? - throw :response, response - end - rescue ::GRPC::BadStatus => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Returns a {::Google::Cloud::Security::PrivateCA::V1beta1::CertificateRevocationList CertificateRevocationList}. - # - # @overload get_certificate_revocation_list(request, options = nil) - # Pass arguments to `get_certificate_revocation_list` via a request object, either of type - # {::Google::Cloud::Security::PrivateCA::V1beta1::GetCertificateRevocationListRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Security::PrivateCA::V1beta1::GetCertificateRevocationListRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_certificate_revocation_list(name: nil) - # Pass arguments to `get_certificate_revocation_list` via keyword arguments. Note that at - # least one keyword argument is 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 {::Google::Cloud::Security::PrivateCA::V1beta1::CertificateRevocationList#name name} of the - # {::Google::Cloud::Security::PrivateCA::V1beta1::CertificateRevocationList CertificateRevocationList} to get. - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Google::Cloud::Security::PrivateCA::V1beta1::CertificateRevocationList] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Google::Cloud::Security::PrivateCA::V1beta1::CertificateRevocationList] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/cloud/security/private_ca/v1beta1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Security::PrivateCA::V1beta1::CertificateAuthorityService::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Security::PrivateCA::V1beta1::GetCertificateRevocationListRequest.new - # - # # Call the get_certificate_revocation_list method. - # result = client.get_certificate_revocation_list request - # - # # The returned object is of type Google::Cloud::Security::PrivateCA::V1beta1::CertificateRevocationList. - # p result - # - def get_certificate_revocation_list request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Security::PrivateCA::V1beta1::GetCertificateRevocationListRequest - - # Converts hash 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_certificate_revocation_list.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::Security::PrivateCA::V1beta1::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_certificate_revocation_list.timeout, - metadata: metadata, - retry_policy: @config.rpcs.get_certificate_revocation_list.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @certificate_authority_service_stub.call_rpc :get_certificate_revocation_list, request, options: options do |response, operation| - yield response, operation if block_given? - end - rescue ::GRPC::BadStatus => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Lists {::Google::Cloud::Security::PrivateCA::V1beta1::CertificateRevocationList CertificateRevocationLists}. - # - # @overload list_certificate_revocation_lists(request, options = nil) - # Pass arguments to `list_certificate_revocation_lists` via a request object, either of type - # {::Google::Cloud::Security::PrivateCA::V1beta1::ListCertificateRevocationListsRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Security::PrivateCA::V1beta1::ListCertificateRevocationListsRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_certificate_revocation_lists(parent: nil, page_size: nil, page_token: nil, filter: nil, order_by: nil) - # Pass arguments to `list_certificate_revocation_lists` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param parent [::String] - # Required. The resource name of the location associated with the - # {::Google::Cloud::Security::PrivateCA::V1beta1::CertificateRevocationList CertificateRevocationLists}, in the format - # `projects/*/locations/*/certificateauthorities/*`. - # @param page_size [::Integer] - # Optional. Limit on the number of - # {::Google::Cloud::Security::PrivateCA::V1beta1::CertificateRevocationList CertificateRevocationLists} to include in the - # response. Further {::Google::Cloud::Security::PrivateCA::V1beta1::CertificateRevocationList CertificateRevocationLists} - # can subsequently be obtained by including the - # {::Google::Cloud::Security::PrivateCA::V1beta1::ListCertificateRevocationListsResponse#next_page_token ListCertificateRevocationListsResponse.next_page_token} in a subsequent - # request. If unspecified, the server will pick an appropriate default. - # @param page_token [::String] - # Optional. Pagination token, returned earlier via - # {::Google::Cloud::Security::PrivateCA::V1beta1::ListCertificateRevocationListsResponse#next_page_token ListCertificateRevocationListsResponse.next_page_token}. - # @param filter [::String] - # Optional. Only include resources that match the filter in the response. - # @param order_by [::String] - # Optional. Specify how the results should be sorted. - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Gapic::PagedEnumerable<::Google::Cloud::Security::PrivateCA::V1beta1::CertificateRevocationList>] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Gapic::PagedEnumerable<::Google::Cloud::Security::PrivateCA::V1beta1::CertificateRevocationList>] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/cloud/security/private_ca/v1beta1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Security::PrivateCA::V1beta1::CertificateAuthorityService::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Security::PrivateCA::V1beta1::ListCertificateRevocationListsRequest.new - # - # # Call the list_certificate_revocation_lists method. - # result = client.list_certificate_revocation_lists request - # - # # The returned object is of type Gapic::PagedEnumerable. You can iterate - # # over elements, and API calls will be issued to fetch pages as needed. - # result.each do |item| - # # Each element is of type ::Google::Cloud::Security::PrivateCA::V1beta1::CertificateRevocationList. - # p item - # end - # - def list_certificate_revocation_lists request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Security::PrivateCA::V1beta1::ListCertificateRevocationListsRequest - - # Converts hash 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_certificate_revocation_lists.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::Security::PrivateCA::V1beta1::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_certificate_revocation_lists.timeout, - metadata: metadata, - retry_policy: @config.rpcs.list_certificate_revocation_lists.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @certificate_authority_service_stub.call_rpc :list_certificate_revocation_lists, request, options: options do |response, operation| - response = ::Gapic::PagedEnumerable.new @certificate_authority_service_stub, :list_certificate_revocation_lists, 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 - - ## - # Update a {::Google::Cloud::Security::PrivateCA::V1beta1::CertificateRevocationList CertificateRevocationList}. - # - # @overload update_certificate_revocation_list(request, options = nil) - # Pass arguments to `update_certificate_revocation_list` via a request object, either of type - # {::Google::Cloud::Security::PrivateCA::V1beta1::UpdateCertificateRevocationListRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Security::PrivateCA::V1beta1::UpdateCertificateRevocationListRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_certificate_revocation_list(certificate_revocation_list: nil, update_mask: nil, request_id: nil) - # Pass arguments to `update_certificate_revocation_list` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param certificate_revocation_list [::Google::Cloud::Security::PrivateCA::V1beta1::CertificateRevocationList, ::Hash] - # Required. {::Google::Cloud::Security::PrivateCA::V1beta1::CertificateRevocationList CertificateRevocationList} with updated values. - # @param update_mask [::Google::Protobuf::FieldMask, ::Hash] - # Required. A list of fields to be updated in this request. - # @param request_id [::String] - # Optional. An ID to identify requests. Specify a unique request ID so that if you must - # retry your request, the server will know to ignore the request if it has - # already been completed. The server will guarantee that for at least 60 - # minutes since the first request. - # - # For example, consider a situation where you make an initial request and t - # he request times out. If you make the request again with the same request - # ID, the server can check if original operation with the same request ID - # was received, and if so, will ignore the second request. This prevents - # clients from accidentally creating duplicate commitments. - # - # The request ID must be a valid UUID with the exception that zero UUID is - # not supported (00000000-0000-0000-0000-000000000000). - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Gapic::Operation] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Gapic::Operation] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/cloud/security/private_ca/v1beta1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Security::PrivateCA::V1beta1::CertificateAuthorityService::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Security::PrivateCA::V1beta1::UpdateCertificateRevocationListRequest.new - # - # # Call the update_certificate_revocation_list method. - # result = client.update_certificate_revocation_list 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_certificate_revocation_list request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Security::PrivateCA::V1beta1::UpdateCertificateRevocationListRequest - - # Converts hash 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_certificate_revocation_list.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::Security::PrivateCA::V1beta1::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.certificate_revocation_list&.name - header_params["certificate_revocation_list.name"] = request.certificate_revocation_list.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_certificate_revocation_list.timeout, - metadata: metadata, - retry_policy: @config.rpcs.update_certificate_revocation_list.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @certificate_authority_service_stub.call_rpc :update_certificate_revocation_list, request, options: options do |response, operation| - response = ::Gapic::Operation.new response, @operations_client, options: options - yield response, operation if block_given? - throw :response, response - end - rescue ::GRPC::BadStatus => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Returns a {::Google::Cloud::Security::PrivateCA::V1beta1::ReusableConfig ReusableConfig}. - # - # @overload get_reusable_config(request, options = nil) - # Pass arguments to `get_reusable_config` via a request object, either of type - # {::Google::Cloud::Security::PrivateCA::V1beta1::GetReusableConfigRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Security::PrivateCA::V1beta1::GetReusableConfigRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_reusable_config(name: nil) - # Pass arguments to `get_reusable_config` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param name [::String] - # Required. The [name][ReusableConfigs.name] of the [ReusableConfigs][] to get. - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Google::Cloud::Security::PrivateCA::V1beta1::ReusableConfig] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Google::Cloud::Security::PrivateCA::V1beta1::ReusableConfig] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/cloud/security/private_ca/v1beta1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Security::PrivateCA::V1beta1::CertificateAuthorityService::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Security::PrivateCA::V1beta1::GetReusableConfigRequest.new - # - # # Call the get_reusable_config method. - # result = client.get_reusable_config request - # - # # The returned object is of type Google::Cloud::Security::PrivateCA::V1beta1::ReusableConfig. - # p result - # - def get_reusable_config request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Security::PrivateCA::V1beta1::GetReusableConfigRequest - - # Converts hash 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_reusable_config.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::Security::PrivateCA::V1beta1::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_reusable_config.timeout, - metadata: metadata, - retry_policy: @config.rpcs.get_reusable_config.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @certificate_authority_service_stub.call_rpc :get_reusable_config, request, options: options do |response, operation| - yield response, operation if block_given? - end - rescue ::GRPC::BadStatus => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Lists {::Google::Cloud::Security::PrivateCA::V1beta1::ReusableConfig ReusableConfigs}. - # - # @overload list_reusable_configs(request, options = nil) - # Pass arguments to `list_reusable_configs` via a request object, either of type - # {::Google::Cloud::Security::PrivateCA::V1beta1::ListReusableConfigsRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Security::PrivateCA::V1beta1::ListReusableConfigsRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_reusable_configs(parent: nil, page_size: nil, page_token: nil, filter: nil, order_by: nil) - # Pass arguments to `list_reusable_configs` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param parent [::String] - # Required. The resource name of the location associated with the - # {::Google::Cloud::Security::PrivateCA::V1beta1::ReusableConfig ReusableConfigs}, in the format - # `projects/*/locations/*`. - # @param page_size [::Integer] - # Optional. Limit on the number of - # {::Google::Cloud::Security::PrivateCA::V1beta1::ReusableConfig ReusableConfigs} to include in the response. - # Further {::Google::Cloud::Security::PrivateCA::V1beta1::ReusableConfig ReusableConfigs} can subsequently be - # obtained by including the - # {::Google::Cloud::Security::PrivateCA::V1beta1::ListReusableConfigsResponse#next_page_token ListReusableConfigsResponse.next_page_token} in a subsequent request. If - # unspecified, the server will pick an appropriate default. - # @param page_token [::String] - # Optional. Pagination token, returned earlier via - # {::Google::Cloud::Security::PrivateCA::V1beta1::ListReusableConfigsResponse#next_page_token ListReusableConfigsResponse.next_page_token}. - # @param filter [::String] - # Optional. Only include resources that match the filter in the response. - # @param order_by [::String] - # Optional. Specify how the results should be sorted. - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Gapic::PagedEnumerable<::Google::Cloud::Security::PrivateCA::V1beta1::ReusableConfig>] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Gapic::PagedEnumerable<::Google::Cloud::Security::PrivateCA::V1beta1::ReusableConfig>] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/cloud/security/private_ca/v1beta1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Security::PrivateCA::V1beta1::CertificateAuthorityService::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Security::PrivateCA::V1beta1::ListReusableConfigsRequest.new - # - # # Call the list_reusable_configs method. - # result = client.list_reusable_configs request - # - # # The returned object is of type Gapic::PagedEnumerable. You can iterate - # # over elements, and API calls will be issued to fetch pages as needed. - # result.each do |item| - # # Each element is of type ::Google::Cloud::Security::PrivateCA::V1beta1::ReusableConfig. - # p item - # end - # - def list_reusable_configs request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Security::PrivateCA::V1beta1::ListReusableConfigsRequest - - # Converts hash 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_reusable_configs.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::Security::PrivateCA::V1beta1::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_reusable_configs.timeout, - metadata: metadata, - retry_policy: @config.rpcs.list_reusable_configs.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @certificate_authority_service_stub.call_rpc :list_reusable_configs, request, options: options do |response, operation| - response = ::Gapic::PagedEnumerable.new @certificate_authority_service_stub, :list_reusable_configs, 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 CertificateAuthorityService API. - # - # This class represents the configuration for CertificateAuthorityService, - # providing control over timeouts, retry behavior, logging, transport - # parameters, and other low-level controls. Certain parameters can also be - # applied individually to specific RPCs. See - # {::Google::Cloud::Security::PrivateCA::V1beta1::CertificateAuthorityService::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_certificate to 20 seconds, - # # and all remaining timeouts to 10 seconds. - # ::Google::Cloud::Security::PrivateCA::V1beta1::CertificateAuthorityService::Client.configure do |config| - # config.timeout = 10.0 - # config.rpcs.create_certificate.timeout = 20.0 - # end - # - # # Apply the above configuration only to a new client. - # client = ::Google::Cloud::Security::PrivateCA::V1beta1::CertificateAuthorityService::Client.new do |config| - # config.timeout = 10.0 - # config.rpcs.create_certificate.timeout = 20.0 - # end - # - # @!attribute [rw] endpoint - # A custom service endpoint, as a hostname or hostname:port. The default is - # nil, indicating to use the default endpoint in the current universe domain. - # @return [::String,nil] - # @!attribute [rw] credentials - # Credentials to send with calls. You may provide any of the following types: - # * (`Google::Auth::Credentials`) A googleauth credentials object - # (see the [googleauth docs](https://rubydoc.info/gems/googleauth/Google/Auth/Credentials)) - # * (`Signet::OAuth2::Client`) A signet oauth2 client object - # (see the [signet docs](https://rubydoc.info/gems/signet/Signet/OAuth2/Client)) - # * (`GRPC::Core::Channel`) a gRPC channel with included credentials - # * (`GRPC::Core::ChannelCredentials`) a gRPC credentails object - # * (`nil`) indicating no credentials - # - # @note Warning: Passing a `String` to a keyfile path or a `Hash` of credentials - # is deprecated. Providing an unvalidated credential configuration to - # Google APIs can compromise the security of your systems and data. - # - # @example - # - # # The recommended way to provide credentials is to use the `make_creds` method - # # on the appropriate credentials class for your environment. - # - # require "googleauth" - # - # credentials = ::Google::Auth::ServiceAccountCredentials.make_creds( - # json_key_io: ::File.open("/path/to/keyfile.json") - # ) - # - # client = ::Google::Cloud::Security::PrivateCA::V1beta1::CertificateAuthorityService::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 = "privateca.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 CertificateAuthorityService 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_certificate` - # @return [::Gapic::Config::Method] - # - attr_reader :create_certificate - ## - # RPC-specific configuration for `get_certificate` - # @return [::Gapic::Config::Method] - # - attr_reader :get_certificate - ## - # RPC-specific configuration for `list_certificates` - # @return [::Gapic::Config::Method] - # - attr_reader :list_certificates - ## - # RPC-specific configuration for `revoke_certificate` - # @return [::Gapic::Config::Method] - # - attr_reader :revoke_certificate - ## - # RPC-specific configuration for `update_certificate` - # @return [::Gapic::Config::Method] - # - attr_reader :update_certificate - ## - # RPC-specific configuration for `activate_certificate_authority` - # @return [::Gapic::Config::Method] - # - attr_reader :activate_certificate_authority - ## - # RPC-specific configuration for `create_certificate_authority` - # @return [::Gapic::Config::Method] - # - attr_reader :create_certificate_authority - ## - # RPC-specific configuration for `disable_certificate_authority` - # @return [::Gapic::Config::Method] - # - attr_reader :disable_certificate_authority - ## - # RPC-specific configuration for `enable_certificate_authority` - # @return [::Gapic::Config::Method] - # - attr_reader :enable_certificate_authority - ## - # RPC-specific configuration for `fetch_certificate_authority_csr` - # @return [::Gapic::Config::Method] - # - attr_reader :fetch_certificate_authority_csr - ## - # RPC-specific configuration for `get_certificate_authority` - # @return [::Gapic::Config::Method] - # - attr_reader :get_certificate_authority - ## - # RPC-specific configuration for `list_certificate_authorities` - # @return [::Gapic::Config::Method] - # - attr_reader :list_certificate_authorities - ## - # RPC-specific configuration for `restore_certificate_authority` - # @return [::Gapic::Config::Method] - # - attr_reader :restore_certificate_authority - ## - # RPC-specific configuration for `schedule_delete_certificate_authority` - # @return [::Gapic::Config::Method] - # - attr_reader :schedule_delete_certificate_authority - ## - # RPC-specific configuration for `update_certificate_authority` - # @return [::Gapic::Config::Method] - # - attr_reader :update_certificate_authority - ## - # RPC-specific configuration for `get_certificate_revocation_list` - # @return [::Gapic::Config::Method] - # - attr_reader :get_certificate_revocation_list - ## - # RPC-specific configuration for `list_certificate_revocation_lists` - # @return [::Gapic::Config::Method] - # - attr_reader :list_certificate_revocation_lists - ## - # RPC-specific configuration for `update_certificate_revocation_list` - # @return [::Gapic::Config::Method] - # - attr_reader :update_certificate_revocation_list - ## - # RPC-specific configuration for `get_reusable_config` - # @return [::Gapic::Config::Method] - # - attr_reader :get_reusable_config - ## - # RPC-specific configuration for `list_reusable_configs` - # @return [::Gapic::Config::Method] - # - attr_reader :list_reusable_configs - - # @private - def initialize parent_rpcs = nil - create_certificate_config = parent_rpcs.create_certificate if parent_rpcs.respond_to? :create_certificate - @create_certificate = ::Gapic::Config::Method.new create_certificate_config - get_certificate_config = parent_rpcs.get_certificate if parent_rpcs.respond_to? :get_certificate - @get_certificate = ::Gapic::Config::Method.new get_certificate_config - list_certificates_config = parent_rpcs.list_certificates if parent_rpcs.respond_to? :list_certificates - @list_certificates = ::Gapic::Config::Method.new list_certificates_config - revoke_certificate_config = parent_rpcs.revoke_certificate if parent_rpcs.respond_to? :revoke_certificate - @revoke_certificate = ::Gapic::Config::Method.new revoke_certificate_config - update_certificate_config = parent_rpcs.update_certificate if parent_rpcs.respond_to? :update_certificate - @update_certificate = ::Gapic::Config::Method.new update_certificate_config - activate_certificate_authority_config = parent_rpcs.activate_certificate_authority if parent_rpcs.respond_to? :activate_certificate_authority - @activate_certificate_authority = ::Gapic::Config::Method.new activate_certificate_authority_config - create_certificate_authority_config = parent_rpcs.create_certificate_authority if parent_rpcs.respond_to? :create_certificate_authority - @create_certificate_authority = ::Gapic::Config::Method.new create_certificate_authority_config - disable_certificate_authority_config = parent_rpcs.disable_certificate_authority if parent_rpcs.respond_to? :disable_certificate_authority - @disable_certificate_authority = ::Gapic::Config::Method.new disable_certificate_authority_config - enable_certificate_authority_config = parent_rpcs.enable_certificate_authority if parent_rpcs.respond_to? :enable_certificate_authority - @enable_certificate_authority = ::Gapic::Config::Method.new enable_certificate_authority_config - fetch_certificate_authority_csr_config = parent_rpcs.fetch_certificate_authority_csr if parent_rpcs.respond_to? :fetch_certificate_authority_csr - @fetch_certificate_authority_csr = ::Gapic::Config::Method.new fetch_certificate_authority_csr_config - get_certificate_authority_config = parent_rpcs.get_certificate_authority if parent_rpcs.respond_to? :get_certificate_authority - @get_certificate_authority = ::Gapic::Config::Method.new get_certificate_authority_config - list_certificate_authorities_config = parent_rpcs.list_certificate_authorities if parent_rpcs.respond_to? :list_certificate_authorities - @list_certificate_authorities = ::Gapic::Config::Method.new list_certificate_authorities_config - restore_certificate_authority_config = parent_rpcs.restore_certificate_authority if parent_rpcs.respond_to? :restore_certificate_authority - @restore_certificate_authority = ::Gapic::Config::Method.new restore_certificate_authority_config - schedule_delete_certificate_authority_config = parent_rpcs.schedule_delete_certificate_authority if parent_rpcs.respond_to? :schedule_delete_certificate_authority - @schedule_delete_certificate_authority = ::Gapic::Config::Method.new schedule_delete_certificate_authority_config - update_certificate_authority_config = parent_rpcs.update_certificate_authority if parent_rpcs.respond_to? :update_certificate_authority - @update_certificate_authority = ::Gapic::Config::Method.new update_certificate_authority_config - get_certificate_revocation_list_config = parent_rpcs.get_certificate_revocation_list if parent_rpcs.respond_to? :get_certificate_revocation_list - @get_certificate_revocation_list = ::Gapic::Config::Method.new get_certificate_revocation_list_config - list_certificate_revocation_lists_config = parent_rpcs.list_certificate_revocation_lists if parent_rpcs.respond_to? :list_certificate_revocation_lists - @list_certificate_revocation_lists = ::Gapic::Config::Method.new list_certificate_revocation_lists_config - update_certificate_revocation_list_config = parent_rpcs.update_certificate_revocation_list if parent_rpcs.respond_to? :update_certificate_revocation_list - @update_certificate_revocation_list = ::Gapic::Config::Method.new update_certificate_revocation_list_config - get_reusable_config_config = parent_rpcs.get_reusable_config if parent_rpcs.respond_to? :get_reusable_config - @get_reusable_config = ::Gapic::Config::Method.new get_reusable_config_config - list_reusable_configs_config = parent_rpcs.list_reusable_configs if parent_rpcs.respond_to? :list_reusable_configs - @list_reusable_configs = ::Gapic::Config::Method.new list_reusable_configs_config - - yield self if block_given? - end - end - end - end - end - end - end - end - end -end diff --git a/owl-bot-staging/google-cloud-security-private_ca-v1beta1/lib/google/cloud/security/private_ca/v1beta1/certificate_authority_service/credentials.rb b/owl-bot-staging/google-cloud-security-private_ca-v1beta1/lib/google/cloud/security/private_ca/v1beta1/certificate_authority_service/credentials.rb deleted file mode 100644 index 4790c8bbb309..000000000000 --- a/owl-bot-staging/google-cloud-security-private_ca-v1beta1/lib/google/cloud/security/private_ca/v1beta1/certificate_authority_service/credentials.rb +++ /dev/null @@ -1,53 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -require "googleauth" - -module Google - module Cloud - module Security - module PrivateCA - module V1beta1 - module CertificateAuthorityService - # Credentials for the CertificateAuthorityService API. - class Credentials < ::Google::Auth::Credentials - self.scope = [ - "https://www.googleapis.com/auth/cloud-platform" - ] - self.env_vars = [ - "PRIVATE_CA_CREDENTIALS", - "PRIVATE_CA_KEYFILE", - "GOOGLE_CLOUD_CREDENTIALS", - "GOOGLE_CLOUD_KEYFILE", - "GCLOUD_KEYFILE", - "PRIVATE_CA_CREDENTIALS_JSON", - "PRIVATE_CA_KEYFILE_JSON", - "GOOGLE_CLOUD_CREDENTIALS_JSON", - "GOOGLE_CLOUD_KEYFILE_JSON", - "GCLOUD_KEYFILE_JSON" - ] - self.paths = [ - "~/.config/google_cloud/application_default_credentials.json" - ] - end - end - end - end - end - end -end diff --git a/owl-bot-staging/google-cloud-security-private_ca-v1beta1/lib/google/cloud/security/private_ca/v1beta1/certificate_authority_service/operations.rb b/owl-bot-staging/google-cloud-security-private_ca-v1beta1/lib/google/cloud/security/private_ca/v1beta1/certificate_authority_service/operations.rb deleted file mode 100644 index 867569d9291a..000000000000 --- a/owl-bot-staging/google-cloud-security-private_ca-v1beta1/lib/google/cloud/security/private_ca/v1beta1/certificate_authority_service/operations.rb +++ /dev/null @@ -1,843 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -require "gapic/operation" -require "google/longrunning/operations_pb" - -module Google - module Cloud - module Security - module PrivateCA - module V1beta1 - module CertificateAuthorityService - # Service that implements Longrunning Operations API. - class Operations - # @private - API_VERSION = "" - - # @private - DEFAULT_ENDPOINT_TEMPLATE = "privateca.$UNIVERSE_DOMAIN$" - - # @private - attr_reader :operations_stub - - ## - # Configuration for the CertificateAuthorityService 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 CertificateAuthorityService 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::Security::PrivateCA::V1beta1::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::Security::PrivateCA::V1beta1::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::Security::PrivateCA::V1beta1::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::Security::PrivateCA::V1beta1::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::Security::PrivateCA::V1beta1::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 = "privateca.googleapis.com" - - config_attr :endpoint, nil, ::String, nil - config_attr :credentials, nil do |value| - allowed = [::String, ::Hash, ::Proc, ::Symbol, ::Google::Auth::Credentials, ::Google::Auth::BaseClient, ::Signet::OAuth2::Client, nil] - allowed += [::GRPC::Core::Channel, ::GRPC::Core::ChannelCredentials] if defined? ::GRPC::Core::Channel - allowed.any? { |klass| klass === value } - end - config_attr :scope, nil, ::String, ::Array, nil - config_attr :lib_name, nil, ::String, nil - config_attr :lib_version, nil, ::String, nil - config_attr(:channel_args, { "grpc.service_config_disable_resolution" => 1 }, ::Hash, nil) - config_attr :interceptors, nil, ::Array, nil - config_attr :timeout, nil, ::Numeric, nil - config_attr :metadata, nil, ::Hash, nil - config_attr :retry_policy, nil, ::Hash, ::Proc, nil - config_attr :quota_project, nil, ::String, nil - config_attr :universe_domain, nil, ::String, nil - config_attr :logger, :default, ::Logger, nil, :default - - # @private - def initialize parent_config = nil - @parent_config = parent_config unless parent_config.nil? - - yield self if block_given? - end - - ## - # Configurations for individual RPCs - # @return [Rpcs] - # - def rpcs - @rpcs ||= begin - parent_rpcs = nil - parent_rpcs = @parent_config.rpcs if defined?(@parent_config) && @parent_config.respond_to?(:rpcs) - Rpcs.new parent_rpcs - end - end - - ## - # Configuration for the channel pool - # @return [::Gapic::ServiceStub::ChannelPool::Configuration] - # - def channel_pool - @channel_pool ||= ::Gapic::ServiceStub::ChannelPool::Configuration.new - end - - ## - # Configuration RPC class for the Operations API. - # - # Includes fields providing the configuration for each RPC in this service. - # Each configuration object is of type `Gapic::Config::Method` and includes - # the following configuration fields: - # - # * `timeout` (*type:* `Numeric`) - The call timeout in seconds - # * `metadata` (*type:* `Hash{Symbol=>String}`) - Additional gRPC headers - # * `retry_policy (*type:* `Hash`) - The retry policy. The policy fields - # include the following keys: - # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds. - # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds. - # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier. - # * `:retry_codes` (*type:* `Array`) - The error codes that should - # trigger a retry. - # - class Rpcs - ## - # RPC-specific configuration for `list_operations` - # @return [::Gapic::Config::Method] - # - attr_reader :list_operations - ## - # RPC-specific configuration for `get_operation` - # @return [::Gapic::Config::Method] - # - attr_reader :get_operation - ## - # RPC-specific configuration for `delete_operation` - # @return [::Gapic::Config::Method] - # - attr_reader :delete_operation - ## - # RPC-specific configuration for `cancel_operation` - # @return [::Gapic::Config::Method] - # - attr_reader :cancel_operation - ## - # RPC-specific configuration for `wait_operation` - # @return [::Gapic::Config::Method] - # - attr_reader :wait_operation - - # @private - def initialize parent_rpcs = nil - list_operations_config = parent_rpcs.list_operations if parent_rpcs.respond_to? :list_operations - @list_operations = ::Gapic::Config::Method.new list_operations_config - get_operation_config = parent_rpcs.get_operation if parent_rpcs.respond_to? :get_operation - @get_operation = ::Gapic::Config::Method.new get_operation_config - delete_operation_config = parent_rpcs.delete_operation if parent_rpcs.respond_to? :delete_operation - @delete_operation = ::Gapic::Config::Method.new delete_operation_config - cancel_operation_config = parent_rpcs.cancel_operation if parent_rpcs.respond_to? :cancel_operation - @cancel_operation = ::Gapic::Config::Method.new cancel_operation_config - wait_operation_config = parent_rpcs.wait_operation if parent_rpcs.respond_to? :wait_operation - @wait_operation = ::Gapic::Config::Method.new wait_operation_config - - yield self if block_given? - end - end - end - end - end - end - end - end - end -end diff --git a/owl-bot-staging/google-cloud-security-private_ca-v1beta1/lib/google/cloud/security/private_ca/v1beta1/certificate_authority_service/paths.rb b/owl-bot-staging/google-cloud-security-private_ca-v1beta1/lib/google/cloud/security/private_ca/v1beta1/certificate_authority_service/paths.rb deleted file mode 100644 index ba157f7e9c6d..000000000000 --- a/owl-bot-staging/google-cloud-security-private_ca-v1beta1/lib/google/cloud/security/private_ca/v1beta1/certificate_authority_service/paths.rb +++ /dev/null @@ -1,132 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - - -module Google - module Cloud - module Security - module PrivateCA - module V1beta1 - module CertificateAuthorityService - # Path helper methods for the CertificateAuthorityService API. - module Paths - ## - # Create a fully-qualified Certificate resource string. - # - # The resource will be in the following format: - # - # `projects/{project}/locations/{location}/certificateAuthorities/{certificate_authority}/certificates/{certificate}` - # - # @param project [String] - # @param location [String] - # @param certificate_authority [String] - # @param certificate [String] - # - # @return [::String] - def certificate_path project:, location:, certificate_authority:, certificate: - raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" - raise ::ArgumentError, "location cannot contain /" if location.to_s.include? "/" - raise ::ArgumentError, "certificate_authority cannot contain /" if certificate_authority.to_s.include? "/" - - "projects/#{project}/locations/#{location}/certificateAuthorities/#{certificate_authority}/certificates/#{certificate}" - end - - ## - # Create a fully-qualified CertificateAuthority resource string. - # - # The resource will be in the following format: - # - # `projects/{project}/locations/{location}/certificateAuthorities/{certificate_authority}` - # - # @param project [String] - # @param location [String] - # @param certificate_authority [String] - # - # @return [::String] - def certificate_authority_path project:, location:, certificate_authority: - raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" - raise ::ArgumentError, "location cannot contain /" if location.to_s.include? "/" - - "projects/#{project}/locations/#{location}/certificateAuthorities/#{certificate_authority}" - end - - ## - # Create a fully-qualified CertificateRevocationList resource string. - # - # The resource will be in the following format: - # - # `projects/{project}/locations/{location}/certificateAuthorities/{certificate_authority}/certificateRevocationLists/{certificate_revocation_list}` - # - # @param project [String] - # @param location [String] - # @param certificate_authority [String] - # @param certificate_revocation_list [String] - # - # @return [::String] - def certificate_revocation_list_path project:, location:, certificate_authority:, certificate_revocation_list: - raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" - raise ::ArgumentError, "location cannot contain /" if location.to_s.include? "/" - raise ::ArgumentError, "certificate_authority cannot contain /" if certificate_authority.to_s.include? "/" - - "projects/#{project}/locations/#{location}/certificateAuthorities/#{certificate_authority}/certificateRevocationLists/#{certificate_revocation_list}" - 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 ReusableConfig resource string. - # - # The resource will be in the following format: - # - # `projects/{project}/locations/{location}/reusableConfigs/{reusable_config}` - # - # @param project [String] - # @param location [String] - # @param reusable_config [String] - # - # @return [::String] - def reusable_config_path project:, location:, reusable_config: - raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" - raise ::ArgumentError, "location cannot contain /" if location.to_s.include? "/" - - "projects/#{project}/locations/#{location}/reusableConfigs/#{reusable_config}" - end - - extend self - end - end - end - end - end - end -end diff --git a/owl-bot-staging/google-cloud-security-private_ca-v1beta1/lib/google/cloud/security/private_ca/v1beta1/certificate_authority_service/rest.rb b/owl-bot-staging/google-cloud-security-private_ca-v1beta1/lib/google/cloud/security/private_ca/v1beta1/certificate_authority_service/rest.rb deleted file mode 100644 index 8e50943b6059..000000000000 --- a/owl-bot-staging/google-cloud-security-private_ca-v1beta1/lib/google/cloud/security/private_ca/v1beta1/certificate_authority_service/rest.rb +++ /dev/null @@ -1,56 +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/security/private_ca/v1beta1/version" - -require "google/cloud/security/private_ca/v1beta1/certificate_authority_service/credentials" -require "google/cloud/security/private_ca/v1beta1/certificate_authority_service/paths" -require "google/cloud/security/private_ca/v1beta1/certificate_authority_service/rest/operations" -require "google/cloud/security/private_ca/v1beta1/certificate_authority_service/rest/client" - -module Google - module Cloud - module Security - module PrivateCA - module V1beta1 - ## - # {::Google::Cloud::Security::PrivateCA::V1beta1::CertificateAuthorityService::Client Certificate Authority Service} manages private - # certificate authorities and issued certificates. - # - # To load this service and instantiate a REST client: - # - # require "google/cloud/security/private_ca/v1beta1/certificate_authority_service/rest" - # client = ::Google::Cloud::Security::PrivateCA::V1beta1::CertificateAuthorityService::Rest::Client.new - # - module CertificateAuthorityService - # Client for the REST transport - module Rest - end - end - end - end - end - end -end - -helper_path = ::File.join __dir__, "rest", "helpers.rb" -require "google/cloud/security/private_ca/v1beta1/certificate_authority_service/rest/helpers" if ::File.file? helper_path diff --git a/owl-bot-staging/google-cloud-security-private_ca-v1beta1/lib/google/cloud/security/private_ca/v1beta1/certificate_authority_service/rest/client.rb b/owl-bot-staging/google-cloud-security-private_ca-v1beta1/lib/google/cloud/security/private_ca/v1beta1/certificate_authority_service/rest/client.rb deleted file mode 100644 index 1f02af1b5446..000000000000 --- a/owl-bot-staging/google-cloud-security-private_ca-v1beta1/lib/google/cloud/security/private_ca/v1beta1/certificate_authority_service/rest/client.rb +++ /dev/null @@ -1,2431 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -require "google/cloud/errors" -require "google/cloud/security/privateca/v1beta1/service_pb" -require "google/cloud/security/private_ca/v1beta1/certificate_authority_service/rest/service_stub" - -module Google - module Cloud - module Security - module PrivateCA - module V1beta1 - module CertificateAuthorityService - module Rest - ## - # REST client for the CertificateAuthorityService service. - # - # {::Google::Cloud::Security::PrivateCA::V1beta1::CertificateAuthorityService::Rest::Client Certificate Authority Service} manages private - # certificate authorities and issued certificates. - # - class Client - # @private - API_VERSION = "" - - # @private - DEFAULT_ENDPOINT_TEMPLATE = "privateca.$UNIVERSE_DOMAIN$" - - include Paths - - # @private - attr_reader :certificate_authority_service_stub - - ## - # Configure the CertificateAuthorityService Client class. - # - # See {::Google::Cloud::Security::PrivateCA::V1beta1::CertificateAuthorityService::Rest::Client::Configuration} - # for a description of the configuration fields. - # - # @example - # - # # Modify the configuration for all CertificateAuthorityService clients - # ::Google::Cloud::Security::PrivateCA::V1beta1::CertificateAuthorityService::Rest::Client.configure do |config| - # config.timeout = 10.0 - # end - # - # @yield [config] Configure the Client client. - # @yieldparam config [Client::Configuration] - # - # @return [Client::Configuration] - # - def self.configure - @configure ||= begin - namespace = ["Google", "Cloud", "Security", "PrivateCA", "V1beta1"] - parent_config = while namespace.any? - parent_name = namespace.join "::" - parent_const = const_get parent_name - break parent_const.configure if parent_const.respond_to? :configure - namespace.pop - end - default_config = Client::Configuration.new parent_config - - default_config.timeout = 60.0 - default_config.retry_policy = { - initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [2, 14, 4] - } - - default_config - end - yield @configure if block_given? - @configure - end - - ## - # Configure the CertificateAuthorityService Client instance. - # - # The configuration is set to the derived mode, meaning that values can be changed, - # but structural changes (adding new fields, etc.) are not allowed. Structural changes - # should be made on {Client.configure}. - # - # See {::Google::Cloud::Security::PrivateCA::V1beta1::CertificateAuthorityService::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 - @certificate_authority_service_stub.universe_domain - end - - ## - # Create a new CertificateAuthorityService REST client object. - # - # @example - # - # # Create a client using the default configuration - # client = ::Google::Cloud::Security::PrivateCA::V1beta1::CertificateAuthorityService::Rest::Client.new - # - # # Create a client using a custom configuration - # client = ::Google::Cloud::Security::PrivateCA::V1beta1::CertificateAuthorityService::Rest::Client.new do |config| - # config.timeout = 10.0 - # end - # - # @yield [config] Configure the CertificateAuthorityService client. - # @yieldparam config [Client::Configuration] - # - def initialize - # Create the configuration object - @config = Configuration.new Client.configure - - # Yield the configuration if needed - yield @config if block_given? - - # Create credentials - credentials = @config.credentials - # Use self-signed JWT if the endpoint is unchanged from default, - # but only if the default endpoint does not have a region prefix. - enable_self_signed_jwt = @config.endpoint.nil? || - (@config.endpoint == Configuration::DEFAULT_ENDPOINT && - !@config.endpoint.split(".").first.include?("-")) - credentials ||= Credentials.default scope: @config.scope, - enable_self_signed_jwt: enable_self_signed_jwt - if credentials.is_a?(::String) || credentials.is_a?(::Hash) - credentials = Credentials.new credentials, scope: @config.scope - end - - @quota_project_id = @config.quota_project - @quota_project_id ||= credentials.quota_project_id if credentials.respond_to? :quota_project_id - - @operations_client = ::Google::Cloud::Security::PrivateCA::V1beta1::CertificateAuthorityService::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 - - @certificate_authority_service_stub = ::Google::Cloud::Security::PrivateCA::V1beta1::CertificateAuthorityService::Rest::ServiceStub.new( - endpoint: @config.endpoint, - endpoint_template: DEFAULT_ENDPOINT_TEMPLATE, - universe_domain: @config.universe_domain, - credentials: credentials, - logger: @config.logger - ) - - @certificate_authority_service_stub.logger(stub: true)&.info do |entry| - entry.set_system_name - entry.set_service - entry.message = "Created client for #{entry.service}" - entry.set_credentials_fields credentials - entry.set "customEndpoint", @config.endpoint if @config.endpoint - entry.set "defaultTimeout", @config.timeout if @config.timeout - entry.set "quotaProject", @quota_project_id if @quota_project_id - end - end - - ## - # Get the associated client for long-running operations. - # - # @return [::Google::Cloud::Security::PrivateCA::V1beta1::CertificateAuthorityService::Rest::Operations] - # - attr_reader :operations_client - - ## - # The logger used for request/response debug logging. - # - # @return [Logger] - # - def logger - @certificate_authority_service_stub.logger - end - - # Service calls - - ## - # Create a new {::Google::Cloud::Security::PrivateCA::V1beta1::Certificate Certificate} in a given Project, Location from a particular - # {::Google::Cloud::Security::PrivateCA::V1beta1::CertificateAuthority CertificateAuthority}. - # - # @overload create_certificate(request, options = nil) - # Pass arguments to `create_certificate` via a request object, either of type - # {::Google::Cloud::Security::PrivateCA::V1beta1::CreateCertificateRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Security::PrivateCA::V1beta1::CreateCertificateRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_certificate(parent: nil, certificate_id: nil, certificate: nil, request_id: nil) - # Pass arguments to `create_certificate` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param parent [::String] - # Required. The resource name of the location and {::Google::Cloud::Security::PrivateCA::V1beta1::CertificateAuthority CertificateAuthority} - # associated with the {::Google::Cloud::Security::PrivateCA::V1beta1::Certificate Certificate}, in the format - # `projects/*/locations/*/certificateAuthorities/*`. - # @param certificate_id [::String] - # Optional. It must be unique within a location and match the regular - # expression `[a-zA-Z0-9_-]{1,63}`. This field is required when using a - # {::Google::Cloud::Security::PrivateCA::V1beta1::CertificateAuthority CertificateAuthority} in the Enterprise {::Google::Cloud::Security::PrivateCA::V1beta1::CertificateAuthority::Tier CertificateAuthority.Tier}, - # but is optional and its value is ignored otherwise. - # @param certificate [::Google::Cloud::Security::PrivateCA::V1beta1::Certificate, ::Hash] - # Required. A {::Google::Cloud::Security::PrivateCA::V1beta1::Certificate Certificate} with initial field values. - # @param request_id [::String] - # Optional. An ID to identify requests. Specify a unique request ID so that if you must - # retry your request, the server will know to ignore the request if it has - # already been completed. The server will guarantee that for at least 60 - # minutes since the first request. - # - # For example, consider a situation where you make an initial request and t - # he request times out. If you make the request again with the same request - # ID, the server can check if original operation with the same request ID - # was received, and if so, will ignore the second request. This prevents - # clients from accidentally creating duplicate commitments. - # - # The request ID must be a valid UUID with the exception that zero UUID is - # not supported (00000000-0000-0000-0000-000000000000). - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Cloud::Security::PrivateCA::V1beta1::Certificate] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::Security::PrivateCA::V1beta1::Certificate] - # - # @raise [::Google::Cloud::Error] if the REST call is aborted. - # - # @example Basic example - # require "google/cloud/security/private_ca/v1beta1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Security::PrivateCA::V1beta1::CertificateAuthorityService::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Security::PrivateCA::V1beta1::CreateCertificateRequest.new - # - # # Call the create_certificate method. - # result = client.create_certificate request - # - # # The returned object is of type Google::Cloud::Security::PrivateCA::V1beta1::Certificate. - # p result - # - def create_certificate request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Security::PrivateCA::V1beta1::CreateCertificateRequest - - # Converts hash 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_certificate.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::Security::PrivateCA::V1beta1::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_certificate.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.create_certificate.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @certificate_authority_service_stub.create_certificate request, options do |result, operation| - yield result, operation if block_given? - end - rescue ::Gapic::Rest::Error => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Returns a {::Google::Cloud::Security::PrivateCA::V1beta1::Certificate Certificate}. - # - # @overload get_certificate(request, options = nil) - # Pass arguments to `get_certificate` via a request object, either of type - # {::Google::Cloud::Security::PrivateCA::V1beta1::GetCertificateRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Security::PrivateCA::V1beta1::GetCertificateRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_certificate(name: nil) - # Pass arguments to `get_certificate` via keyword arguments. Note that at - # least one keyword argument is 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 {::Google::Cloud::Security::PrivateCA::V1beta1::Certificate#name name} of the {::Google::Cloud::Security::PrivateCA::V1beta1::Certificate Certificate} to get. - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Cloud::Security::PrivateCA::V1beta1::Certificate] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::Security::PrivateCA::V1beta1::Certificate] - # - # @raise [::Google::Cloud::Error] if the REST call is aborted. - # - # @example Basic example - # require "google/cloud/security/private_ca/v1beta1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Security::PrivateCA::V1beta1::CertificateAuthorityService::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Security::PrivateCA::V1beta1::GetCertificateRequest.new - # - # # Call the get_certificate method. - # result = client.get_certificate request - # - # # The returned object is of type Google::Cloud::Security::PrivateCA::V1beta1::Certificate. - # p result - # - def get_certificate request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Security::PrivateCA::V1beta1::GetCertificateRequest - - # Converts hash 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_certificate.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::Security::PrivateCA::V1beta1::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_certificate.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.get_certificate.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @certificate_authority_service_stub.get_certificate request, options do |result, operation| - yield result, operation if block_given? - end - rescue ::Gapic::Rest::Error => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Lists {::Google::Cloud::Security::PrivateCA::V1beta1::Certificate Certificates}. - # - # @overload list_certificates(request, options = nil) - # Pass arguments to `list_certificates` via a request object, either of type - # {::Google::Cloud::Security::PrivateCA::V1beta1::ListCertificatesRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Security::PrivateCA::V1beta1::ListCertificatesRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_certificates(parent: nil, page_size: nil, page_token: nil, filter: nil, order_by: nil) - # Pass arguments to `list_certificates` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param parent [::String] - # Required. The resource name of the location associated with the - # {::Google::Cloud::Security::PrivateCA::V1beta1::Certificate Certificates}, in the format - # `projects/*/locations/*/certificateauthorities/*`. - # @param page_size [::Integer] - # Optional. Limit on the number of - # {::Google::Cloud::Security::PrivateCA::V1beta1::Certificate Certificates} to include in the - # response. Further {::Google::Cloud::Security::PrivateCA::V1beta1::Certificate Certificates} can subsequently be obtained - # by including the - # {::Google::Cloud::Security::PrivateCA::V1beta1::ListCertificatesResponse#next_page_token ListCertificatesResponse.next_page_token} in a subsequent - # request. If unspecified, the server will pick an appropriate default. - # @param page_token [::String] - # Optional. Pagination token, returned earlier via - # {::Google::Cloud::Security::PrivateCA::V1beta1::ListCertificatesResponse#next_page_token ListCertificatesResponse.next_page_token}. - # @param filter [::String] - # Optional. Only include resources that match the filter in the response. For details - # on supported filters and syntax, see [Certificates Filtering - # documentation](https://cloud.google.com/certificate-authority-service/docs/sorting-filtering-certificates#filtering_support). - # @param order_by [::String] - # Optional. Specify how the results should be sorted. For details on supported fields - # and syntax, see [Certificates Sorting - # documentation](https://cloud.google.com/certificate-authority-service/docs/sorting-filtering-certificates#sorting_support). - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Gapic::Rest::PagedEnumerable<::Google::Cloud::Security::PrivateCA::V1beta1::Certificate>] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Gapic::Rest::PagedEnumerable<::Google::Cloud::Security::PrivateCA::V1beta1::Certificate>] - # - # @raise [::Google::Cloud::Error] if the REST call is aborted. - # - # @example Basic example - # require "google/cloud/security/private_ca/v1beta1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Security::PrivateCA::V1beta1::CertificateAuthorityService::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Security::PrivateCA::V1beta1::ListCertificatesRequest.new - # - # # Call the list_certificates method. - # result = client.list_certificates request - # - # # The returned object is of type Gapic::PagedEnumerable. You can iterate - # # over elements, and API calls will be issued to fetch pages as needed. - # result.each do |item| - # # Each element is of type ::Google::Cloud::Security::PrivateCA::V1beta1::Certificate. - # p item - # end - # - def list_certificates request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Security::PrivateCA::V1beta1::ListCertificatesRequest - - # Converts hash 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_certificates.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::Security::PrivateCA::V1beta1::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_certificates.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.list_certificates.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @certificate_authority_service_stub.list_certificates request, options do |result, operation| - result = ::Gapic::Rest::PagedEnumerable.new @certificate_authority_service_stub, :list_certificates, "certificates", 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 - - ## - # Revoke a {::Google::Cloud::Security::PrivateCA::V1beta1::Certificate Certificate}. - # - # @overload revoke_certificate(request, options = nil) - # Pass arguments to `revoke_certificate` via a request object, either of type - # {::Google::Cloud::Security::PrivateCA::V1beta1::RevokeCertificateRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Security::PrivateCA::V1beta1::RevokeCertificateRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @overload revoke_certificate(name: nil, reason: nil, request_id: nil) - # Pass arguments to `revoke_certificate` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param name [::String] - # Required. The resource name for this {::Google::Cloud::Security::PrivateCA::V1beta1::Certificate Certificate} in the - # format `projects/*/locations/*/certificateAuthorities/*/certificates/*`. - # @param reason [::Google::Cloud::Security::PrivateCA::V1beta1::RevocationReason] - # Required. The {::Google::Cloud::Security::PrivateCA::V1beta1::RevocationReason RevocationReason} for revoking this certificate. - # @param request_id [::String] - # Optional. An ID to identify requests. Specify a unique request ID so that if you must - # retry your request, the server will know to ignore the request if it has - # already been completed. The server will guarantee that for at least 60 - # minutes since the first request. - # - # For example, consider a situation where you make an initial request and t - # he request times out. If you make the request again with the same request - # ID, the server can check if original operation with the same request ID - # was received, and if so, will ignore the second request. This prevents - # clients from accidentally creating duplicate commitments. - # - # The request ID must be a valid UUID with the exception that zero UUID is - # not supported (00000000-0000-0000-0000-000000000000). - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Cloud::Security::PrivateCA::V1beta1::Certificate] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::Security::PrivateCA::V1beta1::Certificate] - # - # @raise [::Google::Cloud::Error] if the REST call is aborted. - # - # @example Basic example - # require "google/cloud/security/private_ca/v1beta1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Security::PrivateCA::V1beta1::CertificateAuthorityService::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Security::PrivateCA::V1beta1::RevokeCertificateRequest.new - # - # # Call the revoke_certificate method. - # result = client.revoke_certificate request - # - # # The returned object is of type Google::Cloud::Security::PrivateCA::V1beta1::Certificate. - # p result - # - def revoke_certificate request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Security::PrivateCA::V1beta1::RevokeCertificateRequest - - # Converts hash 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.revoke_certificate.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::Security::PrivateCA::V1beta1::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.revoke_certificate.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.revoke_certificate.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @certificate_authority_service_stub.revoke_certificate 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 - - ## - # Update a {::Google::Cloud::Security::PrivateCA::V1beta1::Certificate Certificate}. Currently, the only field you can update is the - # {::Google::Cloud::Security::PrivateCA::V1beta1::Certificate#labels labels} field. - # - # @overload update_certificate(request, options = nil) - # Pass arguments to `update_certificate` via a request object, either of type - # {::Google::Cloud::Security::PrivateCA::V1beta1::UpdateCertificateRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Security::PrivateCA::V1beta1::UpdateCertificateRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_certificate(certificate: nil, update_mask: nil, request_id: nil) - # Pass arguments to `update_certificate` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param certificate [::Google::Cloud::Security::PrivateCA::V1beta1::Certificate, ::Hash] - # Required. {::Google::Cloud::Security::PrivateCA::V1beta1::Certificate Certificate} with updated values. - # @param update_mask [::Google::Protobuf::FieldMask, ::Hash] - # Required. A list of fields to be updated in this request. - # @param request_id [::String] - # Optional. An ID to identify requests. Specify a unique request ID so that if you must - # retry your request, the server will know to ignore the request if it has - # already been completed. The server will guarantee that for at least 60 - # minutes since the first request. - # - # For example, consider a situation where you make an initial request and t - # he request times out. If you make the request again with the same request - # ID, the server can check if original operation with the same request ID - # was received, and if so, will ignore the second request. This prevents - # clients from accidentally creating duplicate commitments. - # - # The request ID must be a valid UUID with the exception that zero UUID is - # not supported (00000000-0000-0000-0000-000000000000). - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Cloud::Security::PrivateCA::V1beta1::Certificate] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::Security::PrivateCA::V1beta1::Certificate] - # - # @raise [::Google::Cloud::Error] if the REST call is aborted. - # - # @example Basic example - # require "google/cloud/security/private_ca/v1beta1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Security::PrivateCA::V1beta1::CertificateAuthorityService::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Security::PrivateCA::V1beta1::UpdateCertificateRequest.new - # - # # Call the update_certificate method. - # result = client.update_certificate request - # - # # The returned object is of type Google::Cloud::Security::PrivateCA::V1beta1::Certificate. - # p result - # - def update_certificate request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Security::PrivateCA::V1beta1::UpdateCertificateRequest - - # Converts hash 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_certificate.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::Security::PrivateCA::V1beta1::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_certificate.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.update_certificate.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @certificate_authority_service_stub.update_certificate 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 - - ## - # Activate a {::Google::Cloud::Security::PrivateCA::V1beta1::CertificateAuthority CertificateAuthority} that is in state - # {::Google::Cloud::Security::PrivateCA::V1beta1::CertificateAuthority::State::PENDING_ACTIVATION PENDING_ACTIVATION} and is - # of type {::Google::Cloud::Security::PrivateCA::V1beta1::CertificateAuthority::Type::SUBORDINATE SUBORDINATE}. After the - # parent Certificate Authority signs a certificate signing request from - # {::Google::Cloud::Security::PrivateCA::V1beta1::CertificateAuthorityService::Rest::Client#fetch_certificate_authority_csr FetchCertificateAuthorityCsr}, this method can complete the activation - # process. - # - # @overload activate_certificate_authority(request, options = nil) - # Pass arguments to `activate_certificate_authority` via a request object, either of type - # {::Google::Cloud::Security::PrivateCA::V1beta1::ActivateCertificateAuthorityRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Security::PrivateCA::V1beta1::ActivateCertificateAuthorityRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @overload activate_certificate_authority(name: nil, pem_ca_certificate: nil, subordinate_config: nil, request_id: nil) - # Pass arguments to `activate_certificate_authority` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param name [::String] - # Required. The resource name for this {::Google::Cloud::Security::PrivateCA::V1beta1::CertificateAuthority CertificateAuthority} in the - # format `projects/*/locations/*/certificateAuthorities/*`. - # @param pem_ca_certificate [::String] - # Required. The signed CA certificate issued from - # {::Google::Cloud::Security::PrivateCA::V1beta1::FetchCertificateAuthorityCsrResponse#pem_csr FetchCertificateAuthorityCsrResponse.pem_csr}. - # @param subordinate_config [::Google::Cloud::Security::PrivateCA::V1beta1::SubordinateConfig, ::Hash] - # Required. Must include information about the issuer of 'pem_ca_certificate', and any - # further issuers until the self-signed CA. - # @param request_id [::String] - # Optional. An ID to identify requests. Specify a unique request ID so that if you must - # retry your request, the server will know to ignore the request if it has - # already been completed. The server will guarantee that for at least 60 - # minutes since the first request. - # - # For example, consider a situation where you make an initial request and t - # he request times out. If you make the request again with the same request - # ID, the server can check if original operation with the same request ID - # was received, and if so, will ignore the second request. This prevents - # clients from accidentally creating duplicate commitments. - # - # The request ID must be a valid UUID with the exception that zero UUID is - # not supported (00000000-0000-0000-0000-000000000000). - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Gapic::Operation] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Gapic::Operation] - # - # @raise [::Google::Cloud::Error] if the REST call is aborted. - # - # @example Basic example - # require "google/cloud/security/private_ca/v1beta1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Security::PrivateCA::V1beta1::CertificateAuthorityService::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Security::PrivateCA::V1beta1::ActivateCertificateAuthorityRequest.new - # - # # Call the activate_certificate_authority method. - # result = client.activate_certificate_authority 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 activate_certificate_authority request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Security::PrivateCA::V1beta1::ActivateCertificateAuthorityRequest - - # Converts hash 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.activate_certificate_authority.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::Security::PrivateCA::V1beta1::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.activate_certificate_authority.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.activate_certificate_authority.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @certificate_authority_service_stub.activate_certificate_authority 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 - - ## - # Create a new {::Google::Cloud::Security::PrivateCA::V1beta1::CertificateAuthority CertificateAuthority} in a given Project and Location. - # - # @overload create_certificate_authority(request, options = nil) - # Pass arguments to `create_certificate_authority` via a request object, either of type - # {::Google::Cloud::Security::PrivateCA::V1beta1::CreateCertificateAuthorityRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Security::PrivateCA::V1beta1::CreateCertificateAuthorityRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_certificate_authority(parent: nil, certificate_authority_id: nil, certificate_authority: nil, request_id: nil) - # Pass arguments to `create_certificate_authority` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param parent [::String] - # Required. The resource name of the location associated with the - # {::Google::Cloud::Security::PrivateCA::V1beta1::CertificateAuthority CertificateAuthorities}, in the format - # `projects/*/locations/*`. - # @param certificate_authority_id [::String] - # Required. It must be unique within a location and match the regular - # expression `[a-zA-Z0-9_-]{1,63}` - # @param certificate_authority [::Google::Cloud::Security::PrivateCA::V1beta1::CertificateAuthority, ::Hash] - # Required. A {::Google::Cloud::Security::PrivateCA::V1beta1::CertificateAuthority CertificateAuthority} with initial field values. - # @param request_id [::String] - # Optional. An ID to identify requests. Specify a unique request ID so that if you must - # retry your request, the server will know to ignore the request if it has - # already been completed. The server will guarantee that for at least 60 - # minutes since the first request. - # - # For example, consider a situation where you make an initial request and t - # he request times out. If you make the request again with the same request - # ID, the server can check if original operation with the same request ID - # was received, and if so, will ignore the second request. This prevents - # clients from accidentally creating duplicate commitments. - # - # The request ID must be a valid UUID with the exception that zero UUID is - # not supported (00000000-0000-0000-0000-000000000000). - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Gapic::Operation] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Gapic::Operation] - # - # @raise [::Google::Cloud::Error] if the REST call is aborted. - # - # @example Basic example - # require "google/cloud/security/private_ca/v1beta1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Security::PrivateCA::V1beta1::CertificateAuthorityService::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Security::PrivateCA::V1beta1::CreateCertificateAuthorityRequest.new - # - # # Call the create_certificate_authority method. - # result = client.create_certificate_authority 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_certificate_authority request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Security::PrivateCA::V1beta1::CreateCertificateAuthorityRequest - - # Converts hash 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_certificate_authority.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::Security::PrivateCA::V1beta1::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_certificate_authority.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.create_certificate_authority.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @certificate_authority_service_stub.create_certificate_authority 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 - - ## - # Disable a {::Google::Cloud::Security::PrivateCA::V1beta1::CertificateAuthority CertificateAuthority}. - # - # @overload disable_certificate_authority(request, options = nil) - # Pass arguments to `disable_certificate_authority` via a request object, either of type - # {::Google::Cloud::Security::PrivateCA::V1beta1::DisableCertificateAuthorityRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Security::PrivateCA::V1beta1::DisableCertificateAuthorityRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @overload disable_certificate_authority(name: nil, request_id: nil) - # Pass arguments to `disable_certificate_authority` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param name [::String] - # Required. The resource name for this {::Google::Cloud::Security::PrivateCA::V1beta1::CertificateAuthority CertificateAuthority} in the - # format `projects/*/locations/*/certificateAuthorities/*`. - # @param request_id [::String] - # Optional. An ID to identify requests. Specify a unique request ID so that if you must - # retry your request, the server will know to ignore the request if it has - # already been completed. The server will guarantee that for at least 60 - # minutes since the first request. - # - # For example, consider a situation where you make an initial request and t - # he request times out. If you make the request again with the same request - # ID, the server can check if original operation with the same request ID - # was received, and if so, will ignore the second request. This prevents - # clients from accidentally creating duplicate commitments. - # - # The request ID must be a valid UUID with the exception that zero UUID is - # not supported (00000000-0000-0000-0000-000000000000). - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Gapic::Operation] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Gapic::Operation] - # - # @raise [::Google::Cloud::Error] if the REST call is aborted. - # - # @example Basic example - # require "google/cloud/security/private_ca/v1beta1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Security::PrivateCA::V1beta1::CertificateAuthorityService::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Security::PrivateCA::V1beta1::DisableCertificateAuthorityRequest.new - # - # # Call the disable_certificate_authority method. - # result = client.disable_certificate_authority 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 disable_certificate_authority request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Security::PrivateCA::V1beta1::DisableCertificateAuthorityRequest - - # Converts hash and nil to an options object - options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h - - # Customize the options with defaults - call_metadata = @config.rpcs.disable_certificate_authority.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::Security::PrivateCA::V1beta1::VERSION, - transports_version_send: [:rest] - - call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - options.apply_defaults timeout: @config.rpcs.disable_certificate_authority.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.disable_certificate_authority.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @certificate_authority_service_stub.disable_certificate_authority 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 - - ## - # Enable a {::Google::Cloud::Security::PrivateCA::V1beta1::CertificateAuthority CertificateAuthority}. - # - # @overload enable_certificate_authority(request, options = nil) - # Pass arguments to `enable_certificate_authority` via a request object, either of type - # {::Google::Cloud::Security::PrivateCA::V1beta1::EnableCertificateAuthorityRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Security::PrivateCA::V1beta1::EnableCertificateAuthorityRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @overload enable_certificate_authority(name: nil, request_id: nil) - # Pass arguments to `enable_certificate_authority` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param name [::String] - # Required. The resource name for this {::Google::Cloud::Security::PrivateCA::V1beta1::CertificateAuthority CertificateAuthority} in the - # format `projects/*/locations/*/certificateAuthorities/*`. - # @param request_id [::String] - # Optional. An ID to identify requests. Specify a unique request ID so that if you must - # retry your request, the server will know to ignore the request if it has - # already been completed. The server will guarantee that for at least 60 - # minutes since the first request. - # - # For example, consider a situation where you make an initial request and t - # he request times out. If you make the request again with the same request - # ID, the server can check if original operation with the same request ID - # was received, and if so, will ignore the second request. This prevents - # clients from accidentally creating duplicate commitments. - # - # The request ID must be a valid UUID with the exception that zero UUID is - # not supported (00000000-0000-0000-0000-000000000000). - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Gapic::Operation] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Gapic::Operation] - # - # @raise [::Google::Cloud::Error] if the REST call is aborted. - # - # @example Basic example - # require "google/cloud/security/private_ca/v1beta1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Security::PrivateCA::V1beta1::CertificateAuthorityService::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Security::PrivateCA::V1beta1::EnableCertificateAuthorityRequest.new - # - # # Call the enable_certificate_authority method. - # result = client.enable_certificate_authority 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 enable_certificate_authority request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Security::PrivateCA::V1beta1::EnableCertificateAuthorityRequest - - # Converts hash and nil to an options object - options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h - - # Customize the options with defaults - call_metadata = @config.rpcs.enable_certificate_authority.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::Security::PrivateCA::V1beta1::VERSION, - transports_version_send: [:rest] - - call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - options.apply_defaults timeout: @config.rpcs.enable_certificate_authority.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.enable_certificate_authority.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @certificate_authority_service_stub.enable_certificate_authority 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 - - ## - # Fetch a certificate signing request (CSR) from a {::Google::Cloud::Security::PrivateCA::V1beta1::CertificateAuthority CertificateAuthority} - # that is in state - # {::Google::Cloud::Security::PrivateCA::V1beta1::CertificateAuthority::State::PENDING_ACTIVATION PENDING_ACTIVATION} and is - # of type {::Google::Cloud::Security::PrivateCA::V1beta1::CertificateAuthority::Type::SUBORDINATE SUBORDINATE}. The CSR must - # then be signed by the desired parent Certificate Authority, which could be - # another {::Google::Cloud::Security::PrivateCA::V1beta1::CertificateAuthority CertificateAuthority} resource, or could be an on-prem - # certificate authority. See also {::Google::Cloud::Security::PrivateCA::V1beta1::CertificateAuthorityService::Rest::Client#activate_certificate_authority ActivateCertificateAuthority}. - # - # @overload fetch_certificate_authority_csr(request, options = nil) - # Pass arguments to `fetch_certificate_authority_csr` via a request object, either of type - # {::Google::Cloud::Security::PrivateCA::V1beta1::FetchCertificateAuthorityCsrRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Security::PrivateCA::V1beta1::FetchCertificateAuthorityCsrRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @overload fetch_certificate_authority_csr(name: nil) - # Pass arguments to `fetch_certificate_authority_csr` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param name [::String] - # Required. The resource name for this {::Google::Cloud::Security::PrivateCA::V1beta1::CertificateAuthority CertificateAuthority} in the - # format `projects/*/locations/*/certificateAuthorities/*`. - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Cloud::Security::PrivateCA::V1beta1::FetchCertificateAuthorityCsrResponse] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::Security::PrivateCA::V1beta1::FetchCertificateAuthorityCsrResponse] - # - # @raise [::Google::Cloud::Error] if the REST call is aborted. - # - # @example Basic example - # require "google/cloud/security/private_ca/v1beta1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Security::PrivateCA::V1beta1::CertificateAuthorityService::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Security::PrivateCA::V1beta1::FetchCertificateAuthorityCsrRequest.new - # - # # Call the fetch_certificate_authority_csr method. - # result = client.fetch_certificate_authority_csr request - # - # # The returned object is of type Google::Cloud::Security::PrivateCA::V1beta1::FetchCertificateAuthorityCsrResponse. - # p result - # - def fetch_certificate_authority_csr request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Security::PrivateCA::V1beta1::FetchCertificateAuthorityCsrRequest - - # Converts hash 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.fetch_certificate_authority_csr.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::Security::PrivateCA::V1beta1::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.fetch_certificate_authority_csr.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.fetch_certificate_authority_csr.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @certificate_authority_service_stub.fetch_certificate_authority_csr request, options do |result, operation| - yield result, operation if block_given? - end - rescue ::Gapic::Rest::Error => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Returns a {::Google::Cloud::Security::PrivateCA::V1beta1::CertificateAuthority CertificateAuthority}. - # - # @overload get_certificate_authority(request, options = nil) - # Pass arguments to `get_certificate_authority` via a request object, either of type - # {::Google::Cloud::Security::PrivateCA::V1beta1::GetCertificateAuthorityRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Security::PrivateCA::V1beta1::GetCertificateAuthorityRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_certificate_authority(name: nil) - # Pass arguments to `get_certificate_authority` via keyword arguments. Note that at - # least one keyword argument is 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 {::Google::Cloud::Security::PrivateCA::V1beta1::CertificateAuthority#name name} of the {::Google::Cloud::Security::PrivateCA::V1beta1::CertificateAuthority CertificateAuthority} to - # get. - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Cloud::Security::PrivateCA::V1beta1::CertificateAuthority] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::Security::PrivateCA::V1beta1::CertificateAuthority] - # - # @raise [::Google::Cloud::Error] if the REST call is aborted. - # - # @example Basic example - # require "google/cloud/security/private_ca/v1beta1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Security::PrivateCA::V1beta1::CertificateAuthorityService::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Security::PrivateCA::V1beta1::GetCertificateAuthorityRequest.new - # - # # Call the get_certificate_authority method. - # result = client.get_certificate_authority request - # - # # The returned object is of type Google::Cloud::Security::PrivateCA::V1beta1::CertificateAuthority. - # p result - # - def get_certificate_authority request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Security::PrivateCA::V1beta1::GetCertificateAuthorityRequest - - # Converts hash 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_certificate_authority.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::Security::PrivateCA::V1beta1::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_certificate_authority.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.get_certificate_authority.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @certificate_authority_service_stub.get_certificate_authority request, options do |result, operation| - yield result, operation if block_given? - end - rescue ::Gapic::Rest::Error => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Lists {::Google::Cloud::Security::PrivateCA::V1beta1::CertificateAuthority CertificateAuthorities}. - # - # @overload list_certificate_authorities(request, options = nil) - # Pass arguments to `list_certificate_authorities` via a request object, either of type - # {::Google::Cloud::Security::PrivateCA::V1beta1::ListCertificateAuthoritiesRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Security::PrivateCA::V1beta1::ListCertificateAuthoritiesRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_certificate_authorities(parent: nil, page_size: nil, page_token: nil, filter: nil, order_by: nil) - # Pass arguments to `list_certificate_authorities` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param parent [::String] - # Required. The resource name of the location associated with the - # {::Google::Cloud::Security::PrivateCA::V1beta1::CertificateAuthority CertificateAuthorities}, in the format - # `projects/*/locations/*`. - # @param page_size [::Integer] - # Optional. Limit on the number of {::Google::Cloud::Security::PrivateCA::V1beta1::CertificateAuthority CertificateAuthorities} to - # include in the response. - # Further {::Google::Cloud::Security::PrivateCA::V1beta1::CertificateAuthority CertificateAuthorities} can subsequently be - # obtained by including the - # {::Google::Cloud::Security::PrivateCA::V1beta1::ListCertificateAuthoritiesResponse#next_page_token ListCertificateAuthoritiesResponse.next_page_token} in a subsequent - # request. If unspecified, the server will pick an appropriate default. - # @param page_token [::String] - # Optional. Pagination token, returned earlier via - # {::Google::Cloud::Security::PrivateCA::V1beta1::ListCertificateAuthoritiesResponse#next_page_token ListCertificateAuthoritiesResponse.next_page_token}. - # @param filter [::String] - # Optional. Only include resources that match the filter in the response. - # @param order_by [::String] - # Optional. Specify how the results should be sorted. - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Gapic::Rest::PagedEnumerable<::Google::Cloud::Security::PrivateCA::V1beta1::CertificateAuthority>] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Gapic::Rest::PagedEnumerable<::Google::Cloud::Security::PrivateCA::V1beta1::CertificateAuthority>] - # - # @raise [::Google::Cloud::Error] if the REST call is aborted. - # - # @example Basic example - # require "google/cloud/security/private_ca/v1beta1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Security::PrivateCA::V1beta1::CertificateAuthorityService::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Security::PrivateCA::V1beta1::ListCertificateAuthoritiesRequest.new - # - # # Call the list_certificate_authorities method. - # result = client.list_certificate_authorities request - # - # # The returned object is of type Gapic::PagedEnumerable. You can iterate - # # over elements, and API calls will be issued to fetch pages as needed. - # result.each do |item| - # # Each element is of type ::Google::Cloud::Security::PrivateCA::V1beta1::CertificateAuthority. - # p item - # end - # - def list_certificate_authorities request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Security::PrivateCA::V1beta1::ListCertificateAuthoritiesRequest - - # Converts hash 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_certificate_authorities.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::Security::PrivateCA::V1beta1::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_certificate_authorities.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.list_certificate_authorities.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @certificate_authority_service_stub.list_certificate_authorities request, options do |result, operation| - result = ::Gapic::Rest::PagedEnumerable.new @certificate_authority_service_stub, :list_certificate_authorities, "certificate_authorities", 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 - - ## - # Restore a {::Google::Cloud::Security::PrivateCA::V1beta1::CertificateAuthority CertificateAuthority} that is scheduled for deletion. - # - # @overload restore_certificate_authority(request, options = nil) - # Pass arguments to `restore_certificate_authority` via a request object, either of type - # {::Google::Cloud::Security::PrivateCA::V1beta1::RestoreCertificateAuthorityRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Security::PrivateCA::V1beta1::RestoreCertificateAuthorityRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @overload restore_certificate_authority(name: nil, request_id: nil) - # Pass arguments to `restore_certificate_authority` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param name [::String] - # Required. The resource name for this {::Google::Cloud::Security::PrivateCA::V1beta1::CertificateAuthority CertificateAuthority} in the - # format `projects/*/locations/*/certificateAuthorities/*`. - # @param request_id [::String] - # Optional. An ID to identify requests. Specify a unique request ID so that if you must - # retry your request, the server will know to ignore the request if it has - # already been completed. The server will guarantee that for at least 60 - # minutes since the first request. - # - # For example, consider a situation where you make an initial request and t - # he request times out. If you make the request again with the same request - # ID, the server can check if original operation with the same request ID - # was received, and if so, will ignore the second request. This prevents - # clients from accidentally creating duplicate commitments. - # - # The request ID must be a valid UUID with the exception that zero UUID is - # not supported (00000000-0000-0000-0000-000000000000). - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Gapic::Operation] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Gapic::Operation] - # - # @raise [::Google::Cloud::Error] if the REST call is aborted. - # - # @example Basic example - # require "google/cloud/security/private_ca/v1beta1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Security::PrivateCA::V1beta1::CertificateAuthorityService::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Security::PrivateCA::V1beta1::RestoreCertificateAuthorityRequest.new - # - # # Call the restore_certificate_authority method. - # result = client.restore_certificate_authority 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 restore_certificate_authority request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Security::PrivateCA::V1beta1::RestoreCertificateAuthorityRequest - - # Converts hash 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.restore_certificate_authority.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::Security::PrivateCA::V1beta1::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.restore_certificate_authority.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.restore_certificate_authority.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @certificate_authority_service_stub.restore_certificate_authority 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 - - ## - # Schedule a {::Google::Cloud::Security::PrivateCA::V1beta1::CertificateAuthority CertificateAuthority} for deletion. - # - # @overload schedule_delete_certificate_authority(request, options = nil) - # Pass arguments to `schedule_delete_certificate_authority` via a request object, either of type - # {::Google::Cloud::Security::PrivateCA::V1beta1::ScheduleDeleteCertificateAuthorityRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Security::PrivateCA::V1beta1::ScheduleDeleteCertificateAuthorityRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @overload schedule_delete_certificate_authority(name: nil, request_id: nil) - # Pass arguments to `schedule_delete_certificate_authority` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param name [::String] - # Required. The resource name for this {::Google::Cloud::Security::PrivateCA::V1beta1::CertificateAuthority CertificateAuthority} in the - # format `projects/*/locations/*/certificateAuthorities/*`. - # @param request_id [::String] - # Optional. An ID to identify requests. Specify a unique request ID so that if you must - # retry your request, the server will know to ignore the request if it has - # already been completed. The server will guarantee that for at least 60 - # minutes since the first request. - # - # For example, consider a situation where you make an initial request and t - # he request times out. If you make the request again with the same request - # ID, the server can check if original operation with the same request ID - # was received, and if so, will ignore the second request. This prevents - # clients from accidentally creating duplicate commitments. - # - # The request ID must be a valid UUID with the exception that zero UUID is - # not supported (00000000-0000-0000-0000-000000000000). - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Gapic::Operation] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Gapic::Operation] - # - # @raise [::Google::Cloud::Error] if the REST call is aborted. - # - # @example Basic example - # require "google/cloud/security/private_ca/v1beta1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Security::PrivateCA::V1beta1::CertificateAuthorityService::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Security::PrivateCA::V1beta1::ScheduleDeleteCertificateAuthorityRequest.new - # - # # Call the schedule_delete_certificate_authority method. - # result = client.schedule_delete_certificate_authority 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 schedule_delete_certificate_authority request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Security::PrivateCA::V1beta1::ScheduleDeleteCertificateAuthorityRequest - - # Converts hash 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.schedule_delete_certificate_authority.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::Security::PrivateCA::V1beta1::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.schedule_delete_certificate_authority.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.schedule_delete_certificate_authority.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @certificate_authority_service_stub.schedule_delete_certificate_authority 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 - - ## - # Update a {::Google::Cloud::Security::PrivateCA::V1beta1::CertificateAuthority CertificateAuthority}. - # - # @overload update_certificate_authority(request, options = nil) - # Pass arguments to `update_certificate_authority` via a request object, either of type - # {::Google::Cloud::Security::PrivateCA::V1beta1::UpdateCertificateAuthorityRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Security::PrivateCA::V1beta1::UpdateCertificateAuthorityRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_certificate_authority(certificate_authority: nil, update_mask: nil, request_id: nil) - # Pass arguments to `update_certificate_authority` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param certificate_authority [::Google::Cloud::Security::PrivateCA::V1beta1::CertificateAuthority, ::Hash] - # Required. {::Google::Cloud::Security::PrivateCA::V1beta1::CertificateAuthority CertificateAuthority} with updated values. - # @param update_mask [::Google::Protobuf::FieldMask, ::Hash] - # Required. A list of fields to be updated in this request. - # @param request_id [::String] - # Optional. An ID to identify requests. Specify a unique request ID so that if you must - # retry your request, the server will know to ignore the request if it has - # already been completed. The server will guarantee that for at least 60 - # minutes since the first request. - # - # For example, consider a situation where you make an initial request and t - # he request times out. If you make the request again with the same request - # ID, the server can check if original operation with the same request ID - # was received, and if so, will ignore the second request. This prevents - # clients from accidentally creating duplicate commitments. - # - # The request ID must be a valid UUID with the exception that zero UUID is - # not supported (00000000-0000-0000-0000-000000000000). - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Gapic::Operation] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Gapic::Operation] - # - # @raise [::Google::Cloud::Error] if the REST call is aborted. - # - # @example Basic example - # require "google/cloud/security/private_ca/v1beta1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Security::PrivateCA::V1beta1::CertificateAuthorityService::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Security::PrivateCA::V1beta1::UpdateCertificateAuthorityRequest.new - # - # # Call the update_certificate_authority method. - # result = client.update_certificate_authority 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_certificate_authority request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Security::PrivateCA::V1beta1::UpdateCertificateAuthorityRequest - - # Converts hash 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_certificate_authority.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::Security::PrivateCA::V1beta1::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_certificate_authority.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.update_certificate_authority.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @certificate_authority_service_stub.update_certificate_authority 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 - - ## - # Returns a {::Google::Cloud::Security::PrivateCA::V1beta1::CertificateRevocationList CertificateRevocationList}. - # - # @overload get_certificate_revocation_list(request, options = nil) - # Pass arguments to `get_certificate_revocation_list` via a request object, either of type - # {::Google::Cloud::Security::PrivateCA::V1beta1::GetCertificateRevocationListRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Security::PrivateCA::V1beta1::GetCertificateRevocationListRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_certificate_revocation_list(name: nil) - # Pass arguments to `get_certificate_revocation_list` via keyword arguments. Note that at - # least one keyword argument is 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 {::Google::Cloud::Security::PrivateCA::V1beta1::CertificateRevocationList#name name} of the - # {::Google::Cloud::Security::PrivateCA::V1beta1::CertificateRevocationList CertificateRevocationList} to get. - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Cloud::Security::PrivateCA::V1beta1::CertificateRevocationList] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::Security::PrivateCA::V1beta1::CertificateRevocationList] - # - # @raise [::Google::Cloud::Error] if the REST call is aborted. - # - # @example Basic example - # require "google/cloud/security/private_ca/v1beta1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Security::PrivateCA::V1beta1::CertificateAuthorityService::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Security::PrivateCA::V1beta1::GetCertificateRevocationListRequest.new - # - # # Call the get_certificate_revocation_list method. - # result = client.get_certificate_revocation_list request - # - # # The returned object is of type Google::Cloud::Security::PrivateCA::V1beta1::CertificateRevocationList. - # p result - # - def get_certificate_revocation_list request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Security::PrivateCA::V1beta1::GetCertificateRevocationListRequest - - # Converts hash 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_certificate_revocation_list.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::Security::PrivateCA::V1beta1::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_certificate_revocation_list.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.get_certificate_revocation_list.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @certificate_authority_service_stub.get_certificate_revocation_list request, options do |result, operation| - yield result, operation if block_given? - end - rescue ::Gapic::Rest::Error => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Lists {::Google::Cloud::Security::PrivateCA::V1beta1::CertificateRevocationList CertificateRevocationLists}. - # - # @overload list_certificate_revocation_lists(request, options = nil) - # Pass arguments to `list_certificate_revocation_lists` via a request object, either of type - # {::Google::Cloud::Security::PrivateCA::V1beta1::ListCertificateRevocationListsRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Security::PrivateCA::V1beta1::ListCertificateRevocationListsRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_certificate_revocation_lists(parent: nil, page_size: nil, page_token: nil, filter: nil, order_by: nil) - # Pass arguments to `list_certificate_revocation_lists` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param parent [::String] - # Required. The resource name of the location associated with the - # {::Google::Cloud::Security::PrivateCA::V1beta1::CertificateRevocationList CertificateRevocationLists}, in the format - # `projects/*/locations/*/certificateauthorities/*`. - # @param page_size [::Integer] - # Optional. Limit on the number of - # {::Google::Cloud::Security::PrivateCA::V1beta1::CertificateRevocationList CertificateRevocationLists} to include in the - # response. Further {::Google::Cloud::Security::PrivateCA::V1beta1::CertificateRevocationList CertificateRevocationLists} - # can subsequently be obtained by including the - # {::Google::Cloud::Security::PrivateCA::V1beta1::ListCertificateRevocationListsResponse#next_page_token ListCertificateRevocationListsResponse.next_page_token} in a subsequent - # request. If unspecified, the server will pick an appropriate default. - # @param page_token [::String] - # Optional. Pagination token, returned earlier via - # {::Google::Cloud::Security::PrivateCA::V1beta1::ListCertificateRevocationListsResponse#next_page_token ListCertificateRevocationListsResponse.next_page_token}. - # @param filter [::String] - # Optional. Only include resources that match the filter in the response. - # @param order_by [::String] - # Optional. Specify how the results should be sorted. - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Gapic::Rest::PagedEnumerable<::Google::Cloud::Security::PrivateCA::V1beta1::CertificateRevocationList>] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Gapic::Rest::PagedEnumerable<::Google::Cloud::Security::PrivateCA::V1beta1::CertificateRevocationList>] - # - # @raise [::Google::Cloud::Error] if the REST call is aborted. - # - # @example Basic example - # require "google/cloud/security/private_ca/v1beta1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Security::PrivateCA::V1beta1::CertificateAuthorityService::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Security::PrivateCA::V1beta1::ListCertificateRevocationListsRequest.new - # - # # Call the list_certificate_revocation_lists method. - # result = client.list_certificate_revocation_lists request - # - # # The returned object is of type Gapic::PagedEnumerable. You can iterate - # # over elements, and API calls will be issued to fetch pages as needed. - # result.each do |item| - # # Each element is of type ::Google::Cloud::Security::PrivateCA::V1beta1::CertificateRevocationList. - # p item - # end - # - def list_certificate_revocation_lists request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Security::PrivateCA::V1beta1::ListCertificateRevocationListsRequest - - # Converts hash 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_certificate_revocation_lists.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::Security::PrivateCA::V1beta1::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_certificate_revocation_lists.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.list_certificate_revocation_lists.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @certificate_authority_service_stub.list_certificate_revocation_lists request, options do |result, operation| - result = ::Gapic::Rest::PagedEnumerable.new @certificate_authority_service_stub, :list_certificate_revocation_lists, "certificate_revocation_lists", 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 - - ## - # Update a {::Google::Cloud::Security::PrivateCA::V1beta1::CertificateRevocationList CertificateRevocationList}. - # - # @overload update_certificate_revocation_list(request, options = nil) - # Pass arguments to `update_certificate_revocation_list` via a request object, either of type - # {::Google::Cloud::Security::PrivateCA::V1beta1::UpdateCertificateRevocationListRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Security::PrivateCA::V1beta1::UpdateCertificateRevocationListRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_certificate_revocation_list(certificate_revocation_list: nil, update_mask: nil, request_id: nil) - # Pass arguments to `update_certificate_revocation_list` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param certificate_revocation_list [::Google::Cloud::Security::PrivateCA::V1beta1::CertificateRevocationList, ::Hash] - # Required. {::Google::Cloud::Security::PrivateCA::V1beta1::CertificateRevocationList CertificateRevocationList} with updated values. - # @param update_mask [::Google::Protobuf::FieldMask, ::Hash] - # Required. A list of fields to be updated in this request. - # @param request_id [::String] - # Optional. An ID to identify requests. Specify a unique request ID so that if you must - # retry your request, the server will know to ignore the request if it has - # already been completed. The server will guarantee that for at least 60 - # minutes since the first request. - # - # For example, consider a situation where you make an initial request and t - # he request times out. If you make the request again with the same request - # ID, the server can check if original operation with the same request ID - # was received, and if so, will ignore the second request. This prevents - # clients from accidentally creating duplicate commitments. - # - # The request ID must be a valid UUID with the exception that zero UUID is - # not supported (00000000-0000-0000-0000-000000000000). - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Gapic::Operation] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Gapic::Operation] - # - # @raise [::Google::Cloud::Error] if the REST call is aborted. - # - # @example Basic example - # require "google/cloud/security/private_ca/v1beta1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Security::PrivateCA::V1beta1::CertificateAuthorityService::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Security::PrivateCA::V1beta1::UpdateCertificateRevocationListRequest.new - # - # # Call the update_certificate_revocation_list method. - # result = client.update_certificate_revocation_list 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_certificate_revocation_list request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Security::PrivateCA::V1beta1::UpdateCertificateRevocationListRequest - - # Converts hash 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_certificate_revocation_list.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::Security::PrivateCA::V1beta1::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_certificate_revocation_list.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.update_certificate_revocation_list.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @certificate_authority_service_stub.update_certificate_revocation_list 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 - - ## - # Returns a {::Google::Cloud::Security::PrivateCA::V1beta1::ReusableConfig ReusableConfig}. - # - # @overload get_reusable_config(request, options = nil) - # Pass arguments to `get_reusable_config` via a request object, either of type - # {::Google::Cloud::Security::PrivateCA::V1beta1::GetReusableConfigRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Security::PrivateCA::V1beta1::GetReusableConfigRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_reusable_config(name: nil) - # Pass arguments to `get_reusable_config` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param name [::String] - # Required. The [name][ReusableConfigs.name] of the [ReusableConfigs][] to get. - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Cloud::Security::PrivateCA::V1beta1::ReusableConfig] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::Security::PrivateCA::V1beta1::ReusableConfig] - # - # @raise [::Google::Cloud::Error] if the REST call is aborted. - # - # @example Basic example - # require "google/cloud/security/private_ca/v1beta1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Security::PrivateCA::V1beta1::CertificateAuthorityService::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Security::PrivateCA::V1beta1::GetReusableConfigRequest.new - # - # # Call the get_reusable_config method. - # result = client.get_reusable_config request - # - # # The returned object is of type Google::Cloud::Security::PrivateCA::V1beta1::ReusableConfig. - # p result - # - def get_reusable_config request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Security::PrivateCA::V1beta1::GetReusableConfigRequest - - # Converts hash 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_reusable_config.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::Security::PrivateCA::V1beta1::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_reusable_config.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.get_reusable_config.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @certificate_authority_service_stub.get_reusable_config request, options do |result, operation| - yield result, operation if block_given? - end - rescue ::Gapic::Rest::Error => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Lists {::Google::Cloud::Security::PrivateCA::V1beta1::ReusableConfig ReusableConfigs}. - # - # @overload list_reusable_configs(request, options = nil) - # Pass arguments to `list_reusable_configs` via a request object, either of type - # {::Google::Cloud::Security::PrivateCA::V1beta1::ListReusableConfigsRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Security::PrivateCA::V1beta1::ListReusableConfigsRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_reusable_configs(parent: nil, page_size: nil, page_token: nil, filter: nil, order_by: nil) - # Pass arguments to `list_reusable_configs` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param parent [::String] - # Required. The resource name of the location associated with the - # {::Google::Cloud::Security::PrivateCA::V1beta1::ReusableConfig ReusableConfigs}, in the format - # `projects/*/locations/*`. - # @param page_size [::Integer] - # Optional. Limit on the number of - # {::Google::Cloud::Security::PrivateCA::V1beta1::ReusableConfig ReusableConfigs} to include in the response. - # Further {::Google::Cloud::Security::PrivateCA::V1beta1::ReusableConfig ReusableConfigs} can subsequently be - # obtained by including the - # {::Google::Cloud::Security::PrivateCA::V1beta1::ListReusableConfigsResponse#next_page_token ListReusableConfigsResponse.next_page_token} in a subsequent request. If - # unspecified, the server will pick an appropriate default. - # @param page_token [::String] - # Optional. Pagination token, returned earlier via - # {::Google::Cloud::Security::PrivateCA::V1beta1::ListReusableConfigsResponse#next_page_token ListReusableConfigsResponse.next_page_token}. - # @param filter [::String] - # Optional. Only include resources that match the filter in the response. - # @param order_by [::String] - # Optional. Specify how the results should be sorted. - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Gapic::Rest::PagedEnumerable<::Google::Cloud::Security::PrivateCA::V1beta1::ReusableConfig>] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Gapic::Rest::PagedEnumerable<::Google::Cloud::Security::PrivateCA::V1beta1::ReusableConfig>] - # - # @raise [::Google::Cloud::Error] if the REST call is aborted. - # - # @example Basic example - # require "google/cloud/security/private_ca/v1beta1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Security::PrivateCA::V1beta1::CertificateAuthorityService::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Security::PrivateCA::V1beta1::ListReusableConfigsRequest.new - # - # # Call the list_reusable_configs method. - # result = client.list_reusable_configs request - # - # # The returned object is of type Gapic::PagedEnumerable. You can iterate - # # over elements, and API calls will be issued to fetch pages as needed. - # result.each do |item| - # # Each element is of type ::Google::Cloud::Security::PrivateCA::V1beta1::ReusableConfig. - # p item - # end - # - def list_reusable_configs request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Security::PrivateCA::V1beta1::ListReusableConfigsRequest - - # Converts hash 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_reusable_configs.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::Security::PrivateCA::V1beta1::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_reusable_configs.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.list_reusable_configs.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @certificate_authority_service_stub.list_reusable_configs request, options do |result, operation| - result = ::Gapic::Rest::PagedEnumerable.new @certificate_authority_service_stub, :list_reusable_configs, "reusable_configs", 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 CertificateAuthorityService REST API. - # - # This class represents the configuration for CertificateAuthorityService REST, - # providing control over timeouts, retry behavior, logging, transport - # parameters, and other low-level controls. Certain parameters can also be - # applied individually to specific RPCs. See - # {::Google::Cloud::Security::PrivateCA::V1beta1::CertificateAuthorityService::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_certificate to 20 seconds, - # # and all remaining timeouts to 10 seconds. - # ::Google::Cloud::Security::PrivateCA::V1beta1::CertificateAuthorityService::Rest::Client.configure do |config| - # config.timeout = 10.0 - # config.rpcs.create_certificate.timeout = 20.0 - # end - # - # # Apply the above configuration only to a new client. - # client = ::Google::Cloud::Security::PrivateCA::V1beta1::CertificateAuthorityService::Rest::Client.new do |config| - # config.timeout = 10.0 - # config.rpcs.create_certificate.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 = "privateca.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 CertificateAuthorityService 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_certificate` - # @return [::Gapic::Config::Method] - # - attr_reader :create_certificate - ## - # RPC-specific configuration for `get_certificate` - # @return [::Gapic::Config::Method] - # - attr_reader :get_certificate - ## - # RPC-specific configuration for `list_certificates` - # @return [::Gapic::Config::Method] - # - attr_reader :list_certificates - ## - # RPC-specific configuration for `revoke_certificate` - # @return [::Gapic::Config::Method] - # - attr_reader :revoke_certificate - ## - # RPC-specific configuration for `update_certificate` - # @return [::Gapic::Config::Method] - # - attr_reader :update_certificate - ## - # RPC-specific configuration for `activate_certificate_authority` - # @return [::Gapic::Config::Method] - # - attr_reader :activate_certificate_authority - ## - # RPC-specific configuration for `create_certificate_authority` - # @return [::Gapic::Config::Method] - # - attr_reader :create_certificate_authority - ## - # RPC-specific configuration for `disable_certificate_authority` - # @return [::Gapic::Config::Method] - # - attr_reader :disable_certificate_authority - ## - # RPC-specific configuration for `enable_certificate_authority` - # @return [::Gapic::Config::Method] - # - attr_reader :enable_certificate_authority - ## - # RPC-specific configuration for `fetch_certificate_authority_csr` - # @return [::Gapic::Config::Method] - # - attr_reader :fetch_certificate_authority_csr - ## - # RPC-specific configuration for `get_certificate_authority` - # @return [::Gapic::Config::Method] - # - attr_reader :get_certificate_authority - ## - # RPC-specific configuration for `list_certificate_authorities` - # @return [::Gapic::Config::Method] - # - attr_reader :list_certificate_authorities - ## - # RPC-specific configuration for `restore_certificate_authority` - # @return [::Gapic::Config::Method] - # - attr_reader :restore_certificate_authority - ## - # RPC-specific configuration for `schedule_delete_certificate_authority` - # @return [::Gapic::Config::Method] - # - attr_reader :schedule_delete_certificate_authority - ## - # RPC-specific configuration for `update_certificate_authority` - # @return [::Gapic::Config::Method] - # - attr_reader :update_certificate_authority - ## - # RPC-specific configuration for `get_certificate_revocation_list` - # @return [::Gapic::Config::Method] - # - attr_reader :get_certificate_revocation_list - ## - # RPC-specific configuration for `list_certificate_revocation_lists` - # @return [::Gapic::Config::Method] - # - attr_reader :list_certificate_revocation_lists - ## - # RPC-specific configuration for `update_certificate_revocation_list` - # @return [::Gapic::Config::Method] - # - attr_reader :update_certificate_revocation_list - ## - # RPC-specific configuration for `get_reusable_config` - # @return [::Gapic::Config::Method] - # - attr_reader :get_reusable_config - ## - # RPC-specific configuration for `list_reusable_configs` - # @return [::Gapic::Config::Method] - # - attr_reader :list_reusable_configs - - # @private - def initialize parent_rpcs = nil - create_certificate_config = parent_rpcs.create_certificate if parent_rpcs.respond_to? :create_certificate - @create_certificate = ::Gapic::Config::Method.new create_certificate_config - get_certificate_config = parent_rpcs.get_certificate if parent_rpcs.respond_to? :get_certificate - @get_certificate = ::Gapic::Config::Method.new get_certificate_config - list_certificates_config = parent_rpcs.list_certificates if parent_rpcs.respond_to? :list_certificates - @list_certificates = ::Gapic::Config::Method.new list_certificates_config - revoke_certificate_config = parent_rpcs.revoke_certificate if parent_rpcs.respond_to? :revoke_certificate - @revoke_certificate = ::Gapic::Config::Method.new revoke_certificate_config - update_certificate_config = parent_rpcs.update_certificate if parent_rpcs.respond_to? :update_certificate - @update_certificate = ::Gapic::Config::Method.new update_certificate_config - activate_certificate_authority_config = parent_rpcs.activate_certificate_authority if parent_rpcs.respond_to? :activate_certificate_authority - @activate_certificate_authority = ::Gapic::Config::Method.new activate_certificate_authority_config - create_certificate_authority_config = parent_rpcs.create_certificate_authority if parent_rpcs.respond_to? :create_certificate_authority - @create_certificate_authority = ::Gapic::Config::Method.new create_certificate_authority_config - disable_certificate_authority_config = parent_rpcs.disable_certificate_authority if parent_rpcs.respond_to? :disable_certificate_authority - @disable_certificate_authority = ::Gapic::Config::Method.new disable_certificate_authority_config - enable_certificate_authority_config = parent_rpcs.enable_certificate_authority if parent_rpcs.respond_to? :enable_certificate_authority - @enable_certificate_authority = ::Gapic::Config::Method.new enable_certificate_authority_config - fetch_certificate_authority_csr_config = parent_rpcs.fetch_certificate_authority_csr if parent_rpcs.respond_to? :fetch_certificate_authority_csr - @fetch_certificate_authority_csr = ::Gapic::Config::Method.new fetch_certificate_authority_csr_config - get_certificate_authority_config = parent_rpcs.get_certificate_authority if parent_rpcs.respond_to? :get_certificate_authority - @get_certificate_authority = ::Gapic::Config::Method.new get_certificate_authority_config - list_certificate_authorities_config = parent_rpcs.list_certificate_authorities if parent_rpcs.respond_to? :list_certificate_authorities - @list_certificate_authorities = ::Gapic::Config::Method.new list_certificate_authorities_config - restore_certificate_authority_config = parent_rpcs.restore_certificate_authority if parent_rpcs.respond_to? :restore_certificate_authority - @restore_certificate_authority = ::Gapic::Config::Method.new restore_certificate_authority_config - schedule_delete_certificate_authority_config = parent_rpcs.schedule_delete_certificate_authority if parent_rpcs.respond_to? :schedule_delete_certificate_authority - @schedule_delete_certificate_authority = ::Gapic::Config::Method.new schedule_delete_certificate_authority_config - update_certificate_authority_config = parent_rpcs.update_certificate_authority if parent_rpcs.respond_to? :update_certificate_authority - @update_certificate_authority = ::Gapic::Config::Method.new update_certificate_authority_config - get_certificate_revocation_list_config = parent_rpcs.get_certificate_revocation_list if parent_rpcs.respond_to? :get_certificate_revocation_list - @get_certificate_revocation_list = ::Gapic::Config::Method.new get_certificate_revocation_list_config - list_certificate_revocation_lists_config = parent_rpcs.list_certificate_revocation_lists if parent_rpcs.respond_to? :list_certificate_revocation_lists - @list_certificate_revocation_lists = ::Gapic::Config::Method.new list_certificate_revocation_lists_config - update_certificate_revocation_list_config = parent_rpcs.update_certificate_revocation_list if parent_rpcs.respond_to? :update_certificate_revocation_list - @update_certificate_revocation_list = ::Gapic::Config::Method.new update_certificate_revocation_list_config - get_reusable_config_config = parent_rpcs.get_reusable_config if parent_rpcs.respond_to? :get_reusable_config - @get_reusable_config = ::Gapic::Config::Method.new get_reusable_config_config - list_reusable_configs_config = parent_rpcs.list_reusable_configs if parent_rpcs.respond_to? :list_reusable_configs - @list_reusable_configs = ::Gapic::Config::Method.new list_reusable_configs_config - - yield self if block_given? - end - end - end - end - end - end - end - end - end - end -end diff --git a/owl-bot-staging/google-cloud-security-private_ca-v1beta1/lib/google/cloud/security/private_ca/v1beta1/certificate_authority_service/rest/operations.rb b/owl-bot-staging/google-cloud-security-private_ca-v1beta1/lib/google/cloud/security/private_ca/v1beta1/certificate_authority_service/rest/operations.rb deleted file mode 100644 index b42b59bde28a..000000000000 --- a/owl-bot-staging/google-cloud-security-private_ca-v1beta1/lib/google/cloud/security/private_ca/v1beta1/certificate_authority_service/rest/operations.rb +++ /dev/null @@ -1,927 +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 Cloud - module Security - module PrivateCA - module V1beta1 - module CertificateAuthorityService - module Rest - # Service that implements Longrunning Operations API. - class Operations - # @private - API_VERSION = "" - - # @private - DEFAULT_ENDPOINT_TEMPLATE = "privateca.$UNIVERSE_DOMAIN$" - - # @private - attr_reader :operations_stub - - ## - # Configuration for the CertificateAuthorityService 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 CertificateAuthorityService 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::Security::PrivateCA::V1beta1::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::Security::PrivateCA::V1beta1::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::Security::PrivateCA::V1beta1::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::Security::PrivateCA::V1beta1::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 = "privateca.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: "/v1beta1/{name}/operations", - matches: [ - ["name", %r{^projects/[^/]+/locations/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the get_operation REST call - # - # @param request_pb [::Google::Longrunning::GetOperationRequest] - # A request object representing the call parameters. Required. - # @return [Array(String, [String, nil], Hash{String => String})] - # Uri, Body, Query string parameters - def self.transcode_get_operation_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :get, - uri_template: "/v1beta1/{name}", - matches: [ - ["name", %r{^projects/[^/]+/locations/[^/]+/operations/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the delete_operation REST call - # - # @param request_pb [::Google::Longrunning::DeleteOperationRequest] - # A request object representing the call parameters. Required. - # @return [Array(String, [String, nil], Hash{String => String})] - # Uri, Body, Query string parameters - def self.transcode_delete_operation_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :delete, - uri_template: "/v1beta1/{name}", - matches: [ - ["name", %r{^projects/[^/]+/locations/[^/]+/operations/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the cancel_operation REST call - # - # @param request_pb [::Google::Longrunning::CancelOperationRequest] - # A request object representing the call parameters. Required. - # @return [Array(String, [String, nil], Hash{String => String})] - # Uri, Body, Query string parameters - def self.transcode_cancel_operation_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :post, - uri_template: "/v1beta1/{name}:cancel", - body: "*", - matches: [ - ["name", %r{^projects/[^/]+/locations/[^/]+/operations/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - end - end - end - end - end - end - end -end diff --git a/owl-bot-staging/google-cloud-security-private_ca-v1beta1/lib/google/cloud/security/private_ca/v1beta1/certificate_authority_service/rest/service_stub.rb b/owl-bot-staging/google-cloud-security-private_ca-v1beta1/lib/google/cloud/security/private_ca/v1beta1/certificate_authority_service/rest/service_stub.rb deleted file mode 100644 index 0dd294029796..000000000000 --- a/owl-bot-staging/google-cloud-security-private_ca-v1beta1/lib/google/cloud/security/private_ca/v1beta1/certificate_authority_service/rest/service_stub.rb +++ /dev/null @@ -1,1314 +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/security/privateca/v1beta1/service_pb" - -module Google - module Cloud - module Security - module PrivateCA - module V1beta1 - module CertificateAuthorityService - module Rest - ## - # REST service stub for the CertificateAuthorityService 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_certificate REST call - # - # @param request_pb [::Google::Cloud::Security::PrivateCA::V1beta1::CreateCertificateRequest] - # A request object representing the call parameters. Required. - # @param options [::Gapic::CallOptions] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Cloud::Security::PrivateCA::V1beta1::Certificate] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::Security::PrivateCA::V1beta1::Certificate] - # A result object deserialized from the server's reply - def create_certificate request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_create_certificate_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_certificate", - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Cloud::Security::PrivateCA::V1beta1::Certificate.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_certificate REST call - # - # @param request_pb [::Google::Cloud::Security::PrivateCA::V1beta1::GetCertificateRequest] - # A request object representing the call parameters. Required. - # @param options [::Gapic::CallOptions] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Cloud::Security::PrivateCA::V1beta1::Certificate] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::Security::PrivateCA::V1beta1::Certificate] - # A result object deserialized from the server's reply - def get_certificate request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_get_certificate_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_certificate", - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Cloud::Security::PrivateCA::V1beta1::Certificate.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_certificates REST call - # - # @param request_pb [::Google::Cloud::Security::PrivateCA::V1beta1::ListCertificatesRequest] - # A request object representing the call parameters. Required. - # @param options [::Gapic::CallOptions] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Cloud::Security::PrivateCA::V1beta1::ListCertificatesResponse] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::Security::PrivateCA::V1beta1::ListCertificatesResponse] - # A result object deserialized from the server's reply - def list_certificates request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_list_certificates_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_certificates", - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Cloud::Security::PrivateCA::V1beta1::ListCertificatesResponse.decode_json response.body, ignore_unknown_fields: true - catch :response do - yield result, operation if block_given? - result - end - end - - ## - # Baseline implementation for the revoke_certificate REST call - # - # @param request_pb [::Google::Cloud::Security::PrivateCA::V1beta1::RevokeCertificateRequest] - # A request object representing the call parameters. Required. - # @param options [::Gapic::CallOptions] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Cloud::Security::PrivateCA::V1beta1::Certificate] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::Security::PrivateCA::V1beta1::Certificate] - # A result object deserialized from the server's reply - def revoke_certificate request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_revoke_certificate_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: "revoke_certificate", - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Cloud::Security::PrivateCA::V1beta1::Certificate.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_certificate REST call - # - # @param request_pb [::Google::Cloud::Security::PrivateCA::V1beta1::UpdateCertificateRequest] - # A request object representing the call parameters. Required. - # @param options [::Gapic::CallOptions] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Cloud::Security::PrivateCA::V1beta1::Certificate] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::Security::PrivateCA::V1beta1::Certificate] - # A result object deserialized from the server's reply - def update_certificate request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_update_certificate_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_certificate", - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Cloud::Security::PrivateCA::V1beta1::Certificate.decode_json response.body, ignore_unknown_fields: true - catch :response do - yield result, operation if block_given? - result - end - end - - ## - # Baseline implementation for the activate_certificate_authority REST call - # - # @param request_pb [::Google::Cloud::Security::PrivateCA::V1beta1::ActivateCertificateAuthorityRequest] - # 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 activate_certificate_authority request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_activate_certificate_authority_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: "activate_certificate_authority", - 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 create_certificate_authority REST call - # - # @param request_pb [::Google::Cloud::Security::PrivateCA::V1beta1::CreateCertificateAuthorityRequest] - # 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_certificate_authority request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_create_certificate_authority_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_certificate_authority", - 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 disable_certificate_authority REST call - # - # @param request_pb [::Google::Cloud::Security::PrivateCA::V1beta1::DisableCertificateAuthorityRequest] - # 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 disable_certificate_authority request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_disable_certificate_authority_request request_pb - query_string_params = if query_string_params.any? - query_string_params.to_h { |p| p.split "=", 2 } - else - {} - end - - response = @client_stub.make_http_request( - verb, - uri: uri, - body: body || "", - params: query_string_params, - method_name: "disable_certificate_authority", - 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 enable_certificate_authority REST call - # - # @param request_pb [::Google::Cloud::Security::PrivateCA::V1beta1::EnableCertificateAuthorityRequest] - # 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 enable_certificate_authority request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_enable_certificate_authority_request request_pb - query_string_params = if query_string_params.any? - query_string_params.to_h { |p| p.split "=", 2 } - else - {} - end - - response = @client_stub.make_http_request( - verb, - uri: uri, - body: body || "", - params: query_string_params, - method_name: "enable_certificate_authority", - 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 fetch_certificate_authority_csr REST call - # - # @param request_pb [::Google::Cloud::Security::PrivateCA::V1beta1::FetchCertificateAuthorityCsrRequest] - # A request object representing the call parameters. Required. - # @param options [::Gapic::CallOptions] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Cloud::Security::PrivateCA::V1beta1::FetchCertificateAuthorityCsrResponse] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::Security::PrivateCA::V1beta1::FetchCertificateAuthorityCsrResponse] - # A result object deserialized from the server's reply - def fetch_certificate_authority_csr request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_fetch_certificate_authority_csr_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: "fetch_certificate_authority_csr", - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Cloud::Security::PrivateCA::V1beta1::FetchCertificateAuthorityCsrResponse.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_certificate_authority REST call - # - # @param request_pb [::Google::Cloud::Security::PrivateCA::V1beta1::GetCertificateAuthorityRequest] - # A request object representing the call parameters. Required. - # @param options [::Gapic::CallOptions] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Cloud::Security::PrivateCA::V1beta1::CertificateAuthority] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::Security::PrivateCA::V1beta1::CertificateAuthority] - # A result object deserialized from the server's reply - def get_certificate_authority request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_get_certificate_authority_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_certificate_authority", - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Cloud::Security::PrivateCA::V1beta1::CertificateAuthority.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_certificate_authorities REST call - # - # @param request_pb [::Google::Cloud::Security::PrivateCA::V1beta1::ListCertificateAuthoritiesRequest] - # A request object representing the call parameters. Required. - # @param options [::Gapic::CallOptions] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Cloud::Security::PrivateCA::V1beta1::ListCertificateAuthoritiesResponse] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::Security::PrivateCA::V1beta1::ListCertificateAuthoritiesResponse] - # A result object deserialized from the server's reply - def list_certificate_authorities request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_list_certificate_authorities_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_certificate_authorities", - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Cloud::Security::PrivateCA::V1beta1::ListCertificateAuthoritiesResponse.decode_json response.body, ignore_unknown_fields: true - catch :response do - yield result, operation if block_given? - result - end - end - - ## - # Baseline implementation for the restore_certificate_authority REST call - # - # @param request_pb [::Google::Cloud::Security::PrivateCA::V1beta1::RestoreCertificateAuthorityRequest] - # 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 restore_certificate_authority request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_restore_certificate_authority_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: "restore_certificate_authority", - 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 schedule_delete_certificate_authority REST call - # - # @param request_pb [::Google::Cloud::Security::PrivateCA::V1beta1::ScheduleDeleteCertificateAuthorityRequest] - # 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 schedule_delete_certificate_authority request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_schedule_delete_certificate_authority_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: "schedule_delete_certificate_authority", - 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 update_certificate_authority REST call - # - # @param request_pb [::Google::Cloud::Security::PrivateCA::V1beta1::UpdateCertificateAuthorityRequest] - # 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_certificate_authority request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_update_certificate_authority_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_certificate_authority", - 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_certificate_revocation_list REST call - # - # @param request_pb [::Google::Cloud::Security::PrivateCA::V1beta1::GetCertificateRevocationListRequest] - # A request object representing the call parameters. Required. - # @param options [::Gapic::CallOptions] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Cloud::Security::PrivateCA::V1beta1::CertificateRevocationList] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::Security::PrivateCA::V1beta1::CertificateRevocationList] - # A result object deserialized from the server's reply - def get_certificate_revocation_list request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_get_certificate_revocation_list_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_certificate_revocation_list", - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Cloud::Security::PrivateCA::V1beta1::CertificateRevocationList.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_certificate_revocation_lists REST call - # - # @param request_pb [::Google::Cloud::Security::PrivateCA::V1beta1::ListCertificateRevocationListsRequest] - # A request object representing the call parameters. Required. - # @param options [::Gapic::CallOptions] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Cloud::Security::PrivateCA::V1beta1::ListCertificateRevocationListsResponse] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::Security::PrivateCA::V1beta1::ListCertificateRevocationListsResponse] - # A result object deserialized from the server's reply - def list_certificate_revocation_lists request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_list_certificate_revocation_lists_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_certificate_revocation_lists", - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Cloud::Security::PrivateCA::V1beta1::ListCertificateRevocationListsResponse.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_certificate_revocation_list REST call - # - # @param request_pb [::Google::Cloud::Security::PrivateCA::V1beta1::UpdateCertificateRevocationListRequest] - # 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_certificate_revocation_list request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_update_certificate_revocation_list_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_certificate_revocation_list", - 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_reusable_config REST call - # - # @param request_pb [::Google::Cloud::Security::PrivateCA::V1beta1::GetReusableConfigRequest] - # A request object representing the call parameters. Required. - # @param options [::Gapic::CallOptions] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Cloud::Security::PrivateCA::V1beta1::ReusableConfig] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::Security::PrivateCA::V1beta1::ReusableConfig] - # A result object deserialized from the server's reply - def get_reusable_config request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_get_reusable_config_request request_pb - query_string_params = if query_string_params.any? - query_string_params.to_h { |p| p.split "=", 2 } - else - {} - end - - response = @client_stub.make_http_request( - verb, - uri: uri, - body: body || "", - params: query_string_params, - method_name: "get_reusable_config", - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Cloud::Security::PrivateCA::V1beta1::ReusableConfig.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_reusable_configs REST call - # - # @param request_pb [::Google::Cloud::Security::PrivateCA::V1beta1::ListReusableConfigsRequest] - # A request object representing the call parameters. Required. - # @param options [::Gapic::CallOptions] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Cloud::Security::PrivateCA::V1beta1::ListReusableConfigsResponse] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::Security::PrivateCA::V1beta1::ListReusableConfigsResponse] - # A result object deserialized from the server's reply - def list_reusable_configs request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_list_reusable_configs_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_reusable_configs", - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Cloud::Security::PrivateCA::V1beta1::ListReusableConfigsResponse.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_certificate REST call - # - # @param request_pb [::Google::Cloud::Security::PrivateCA::V1beta1::CreateCertificateRequest] - # 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_certificate_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :post, - uri_template: "/v1beta1/{parent}/certificates", - body: "certificate", - matches: [ - ["parent", %r{^projects/[^/]+/locations/[^/]+/certificateAuthorities/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the get_certificate REST call - # - # @param request_pb [::Google::Cloud::Security::PrivateCA::V1beta1::GetCertificateRequest] - # 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_certificate_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :get, - uri_template: "/v1beta1/{name}", - matches: [ - ["name", %r{^projects/[^/]+/locations/[^/]+/certificateAuthorities/[^/]+/certificates/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the list_certificates REST call - # - # @param request_pb [::Google::Cloud::Security::PrivateCA::V1beta1::ListCertificatesRequest] - # 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_certificates_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :get, - uri_template: "/v1beta1/{parent}/certificates", - matches: [ - ["parent", %r{^projects/[^/]+/locations/[^/]+/certificateAuthorities/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the revoke_certificate REST call - # - # @param request_pb [::Google::Cloud::Security::PrivateCA::V1beta1::RevokeCertificateRequest] - # A request object representing the call parameters. Required. - # @return [Array(String, [String, nil], Hash{String => String})] - # Uri, Body, Query string parameters - def self.transcode_revoke_certificate_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :post, - uri_template: "/v1beta1/{name}:revoke", - body: "*", - matches: [ - ["name", %r{^projects/[^/]+/locations/[^/]+/certificateAuthorities/[^/]+/certificates/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the update_certificate REST call - # - # @param request_pb [::Google::Cloud::Security::PrivateCA::V1beta1::UpdateCertificateRequest] - # 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_certificate_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :patch, - uri_template: "/v1beta1/{certificate.name}", - body: "certificate", - matches: [ - ["certificate.name", %r{^projects/[^/]+/locations/[^/]+/certificateAuthorities/[^/]+/certificates/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the activate_certificate_authority REST call - # - # @param request_pb [::Google::Cloud::Security::PrivateCA::V1beta1::ActivateCertificateAuthorityRequest] - # A request object representing the call parameters. Required. - # @return [Array(String, [String, nil], Hash{String => String})] - # Uri, Body, Query string parameters - def self.transcode_activate_certificate_authority_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :post, - uri_template: "/v1beta1/{name}:activate", - body: "*", - matches: [ - ["name", %r{^projects/[^/]+/locations/[^/]+/certificateAuthorities/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the create_certificate_authority REST call - # - # @param request_pb [::Google::Cloud::Security::PrivateCA::V1beta1::CreateCertificateAuthorityRequest] - # 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_certificate_authority_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :post, - uri_template: "/v1beta1/{parent}/certificateAuthorities", - body: "certificate_authority", - matches: [ - ["parent", %r{^projects/[^/]+/locations/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the disable_certificate_authority REST call - # - # @param request_pb [::Google::Cloud::Security::PrivateCA::V1beta1::DisableCertificateAuthorityRequest] - # A request object representing the call parameters. Required. - # @return [Array(String, [String, nil], Hash{String => String})] - # Uri, Body, Query string parameters - def self.transcode_disable_certificate_authority_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :post, - uri_template: "/v1beta1/{name}:disable", - body: "*", - matches: [ - ["name", %r{^projects/[^/]+/locations/[^/]+/certificateAuthorities/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the enable_certificate_authority REST call - # - # @param request_pb [::Google::Cloud::Security::PrivateCA::V1beta1::EnableCertificateAuthorityRequest] - # A request object representing the call parameters. Required. - # @return [Array(String, [String, nil], Hash{String => String})] - # Uri, Body, Query string parameters - def self.transcode_enable_certificate_authority_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :post, - uri_template: "/v1beta1/{name}:enable", - body: "*", - matches: [ - ["name", %r{^projects/[^/]+/locations/[^/]+/certificateAuthorities/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the fetch_certificate_authority_csr REST call - # - # @param request_pb [::Google::Cloud::Security::PrivateCA::V1beta1::FetchCertificateAuthorityCsrRequest] - # A request object representing the call parameters. Required. - # @return [Array(String, [String, nil], Hash{String => String})] - # Uri, Body, Query string parameters - def self.transcode_fetch_certificate_authority_csr_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :get, - uri_template: "/v1beta1/{name}:fetch", - matches: [ - ["name", %r{^projects/[^/]+/locations/[^/]+/certificateAuthorities/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the get_certificate_authority REST call - # - # @param request_pb [::Google::Cloud::Security::PrivateCA::V1beta1::GetCertificateAuthorityRequest] - # 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_certificate_authority_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :get, - uri_template: "/v1beta1/{name}", - matches: [ - ["name", %r{^projects/[^/]+/locations/[^/]+/certificateAuthorities/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the list_certificate_authorities REST call - # - # @param request_pb [::Google::Cloud::Security::PrivateCA::V1beta1::ListCertificateAuthoritiesRequest] - # 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_certificate_authorities_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :get, - uri_template: "/v1beta1/{parent}/certificateAuthorities", - matches: [ - ["parent", %r{^projects/[^/]+/locations/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the restore_certificate_authority REST call - # - # @param request_pb [::Google::Cloud::Security::PrivateCA::V1beta1::RestoreCertificateAuthorityRequest] - # A request object representing the call parameters. Required. - # @return [Array(String, [String, nil], Hash{String => String})] - # Uri, Body, Query string parameters - def self.transcode_restore_certificate_authority_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :post, - uri_template: "/v1beta1/{name}:restore", - body: "*", - matches: [ - ["name", %r{^projects/[^/]+/locations/[^/]+/certificateAuthorities/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the schedule_delete_certificate_authority REST call - # - # @param request_pb [::Google::Cloud::Security::PrivateCA::V1beta1::ScheduleDeleteCertificateAuthorityRequest] - # A request object representing the call parameters. Required. - # @return [Array(String, [String, nil], Hash{String => String})] - # Uri, Body, Query string parameters - def self.transcode_schedule_delete_certificate_authority_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :post, - uri_template: "/v1beta1/{name}:scheduleDelete", - body: "*", - matches: [ - ["name", %r{^projects/[^/]+/locations/[^/]+/certificateAuthorities/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the update_certificate_authority REST call - # - # @param request_pb [::Google::Cloud::Security::PrivateCA::V1beta1::UpdateCertificateAuthorityRequest] - # 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_certificate_authority_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :patch, - uri_template: "/v1beta1/{certificate_authority.name}", - body: "certificate_authority", - matches: [ - ["certificate_authority.name", %r{^projects/[^/]+/locations/[^/]+/certificateAuthorities/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the get_certificate_revocation_list REST call - # - # @param request_pb [::Google::Cloud::Security::PrivateCA::V1beta1::GetCertificateRevocationListRequest] - # 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_certificate_revocation_list_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :get, - uri_template: "/v1beta1/{name}", - matches: [ - ["name", %r{^projects/[^/]+/locations/[^/]+/certificateAuthorities/[^/]+/certificateRevocationLists/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the list_certificate_revocation_lists REST call - # - # @param request_pb [::Google::Cloud::Security::PrivateCA::V1beta1::ListCertificateRevocationListsRequest] - # 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_certificate_revocation_lists_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :get, - uri_template: "/v1beta1/{parent}/certificateRevocationLists", - matches: [ - ["parent", %r{^projects/[^/]+/locations/[^/]+/certificateAuthorities/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the update_certificate_revocation_list REST call - # - # @param request_pb [::Google::Cloud::Security::PrivateCA::V1beta1::UpdateCertificateRevocationListRequest] - # 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_certificate_revocation_list_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :patch, - uri_template: "/v1beta1/{certificate_revocation_list.name}", - body: "certificate_revocation_list", - matches: [ - ["certificate_revocation_list.name", %r{^projects/[^/]+/locations/[^/]+/certificateAuthorities/[^/]+/certificateRevocationLists/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the get_reusable_config REST call - # - # @param request_pb [::Google::Cloud::Security::PrivateCA::V1beta1::GetReusableConfigRequest] - # 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_reusable_config_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :get, - uri_template: "/v1beta1/{name}", - matches: [ - ["name", %r{^projects/[^/]+/locations/[^/]+/reusableConfigs/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the list_reusable_configs REST call - # - # @param request_pb [::Google::Cloud::Security::PrivateCA::V1beta1::ListReusableConfigsRequest] - # 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_reusable_configs_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :get, - uri_template: "/v1beta1/{parent}/reusableConfigs", - matches: [ - ["parent", %r{^projects/[^/]+/locations/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - end - end - end - end - end - end - end -end diff --git a/owl-bot-staging/google-cloud-security-private_ca-v1beta1/lib/google/cloud/security/private_ca/v1beta1/rest.rb b/owl-bot-staging/google-cloud-security-private_ca-v1beta1/lib/google/cloud/security/private_ca/v1beta1/rest.rb deleted file mode 100644 index 0edf85a556a2..000000000000 --- a/owl-bot-staging/google-cloud-security-private_ca-v1beta1/lib/google/cloud/security/private_ca/v1beta1/rest.rb +++ /dev/null @@ -1,39 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -require "google/cloud/security/private_ca/v1beta1/certificate_authority_service/rest" -require "google/cloud/security/private_ca/v1beta1/version" - -module Google - module Cloud - module Security - module PrivateCA - ## - # To load just the REST part of this package, including all its services, and instantiate a REST client: - # - # @example - # - # require "google/cloud/security/private_ca/v1beta1/rest" - # client = ::Google::Cloud::Security::PrivateCA::V1beta1::CertificateAuthorityService::Rest::Client.new - # - module V1beta1 - end - end - end - end -end diff --git a/owl-bot-staging/google-cloud-security-private_ca-v1beta1/lib/google/cloud/security/private_ca/v1beta1/version.rb b/owl-bot-staging/google-cloud-security-private_ca-v1beta1/lib/google/cloud/security/private_ca/v1beta1/version.rb deleted file mode 100644 index 348951b0ad41..000000000000 --- a/owl-bot-staging/google-cloud-security-private_ca-v1beta1/lib/google/cloud/security/private_ca/v1beta1/version.rb +++ /dev/null @@ -1,30 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - - -module Google - module Cloud - module Security - module PrivateCA - module V1beta1 - VERSION = "0.0.1" - end - end - end - end -end diff --git a/owl-bot-staging/google-cloud-security-private_ca-v1beta1/lib/google/cloud/security/privateca/v1beta1/resources_pb.rb b/owl-bot-staging/google-cloud-security-private_ca-v1beta1/lib/google/cloud/security/privateca/v1beta1/resources_pb.rb deleted file mode 100644 index 0a964f805bc2..000000000000 --- a/owl-bot-staging/google-cloud-security-private_ca-v1beta1/lib/google/cloud/security/privateca/v1beta1/resources_pb.rb +++ /dev/null @@ -1,67 +0,0 @@ -# frozen_string_literal: true -# Generated by the protocol buffer compiler. DO NOT EDIT! -# source: google/cloud/security/privateca/v1beta1/resources.proto - -require 'google/protobuf' - -require 'google/api/field_behavior_pb' -require 'google/api/resource_pb' -require 'google/protobuf/duration_pb' -require 'google/protobuf/timestamp_pb' -require 'google/protobuf/wrappers_pb' - - -descriptor_data = "\n7google/cloud/security/privateca/v1beta1/resources.proto\x12\'google.cloud.security.privateca.v1beta1\x1a\x1fgoogle/api/field_behavior.proto\x1a\x19google/api/resource.proto\x1a\x1egoogle/protobuf/duration.proto\x1a\x1fgoogle/protobuf/timestamp.proto\x1a\x1egoogle/protobuf/wrappers.proto\"\xa8\x1c\n\x14\x43\x65rtificateAuthority\x12\x11\n\x04name\x18\x01 \x01(\tB\x03\xe0\x41\x03\x12X\n\x04type\x18\x02 \x01(\x0e\x32\x42.google.cloud.security.privateca.v1beta1.CertificateAuthority.TypeB\x06\xe0\x41\x02\xe0\x41\x05\x12X\n\x04tier\x18\x03 \x01(\x0e\x32\x42.google.cloud.security.privateca.v1beta1.CertificateAuthority.TierB\x06\xe0\x41\x02\xe0\x41\x05\x12R\n\x06\x63onfig\x18\x04 \x01(\x0b\x32:.google.cloud.security.privateca.v1beta1.CertificateConfigB\x06\xe0\x41\x02\xe0\x41\x05\x12\x30\n\x08lifetime\x18\x05 \x01(\x0b\x32\x19.google.protobuf.DurationB\x03\xe0\x41\x02\x12\x66\n\x08key_spec\x18\x06 \x01(\x0b\x32L.google.cloud.security.privateca.v1beta1.CertificateAuthority.KeyVersionSpecB\x06\xe0\x41\x02\xe0\x41\x05\x12y\n\x12\x63\x65rtificate_policy\x18\x07 \x01(\x0b\x32X.google.cloud.security.privateca.v1beta1.CertificateAuthority.CertificateAuthorityPolicyB\x03\xe0\x41\x01\x12j\n\x0fissuing_options\x18\x08 \x01(\x0b\x32L.google.cloud.security.privateca.v1beta1.CertificateAuthority.IssuingOptionsB\x03\xe0\x41\x01\x12[\n\x12subordinate_config\x18\x13 \x01(\x0b\x32:.google.cloud.security.privateca.v1beta1.SubordinateConfigB\x03\xe0\x41\x01\x12W\n\x05state\x18\n \x01(\x0e\x32\x43.google.cloud.security.privateca.v1beta1.CertificateAuthority.StateB\x03\xe0\x41\x03\x12 \n\x13pem_ca_certificates\x18\t \x03(\tB\x03\xe0\x41\x03\x12i\n\x1b\x63\x61_certificate_descriptions\x18\x0c \x03(\x0b\x32?.google.cloud.security.privateca.v1beta1.CertificateDescriptionB\x03\xe0\x41\x03\x12\x17\n\ngcs_bucket\x18\r \x01(\tB\x03\xe0\x41\x05\x12\x62\n\x0b\x61\x63\x63\x65ss_urls\x18\x0e \x01(\x0b\x32H.google.cloud.security.privateca.v1beta1.CertificateAuthority.AccessUrlsB\x03\xe0\x41\x03\x12\x34\n\x0b\x63reate_time\x18\x0f \x01(\x0b\x32\x1a.google.protobuf.TimestampB\x03\xe0\x41\x03\x12\x34\n\x0bupdate_time\x18\x10 \x01(\x0b\x32\x1a.google.protobuf.TimestampB\x03\xe0\x41\x03\x12\x34\n\x0b\x64\x65lete_time\x18\x11 \x01(\x0b\x32\x1a.google.protobuf.TimestampB\x03\xe0\x41\x03\x12^\n\x06labels\x18\x12 \x03(\x0b\x32I.google.cloud.security.privateca.v1beta1.CertificateAuthority.LabelsEntryB\x03\xe0\x41\x01\x1aW\n\x0eIssuingOptions\x12 \n\x13include_ca_cert_url\x18\x01 \x01(\x08\x42\x03\xe0\x41\x02\x12#\n\x16include_crl_access_url\x18\x02 \x01(\x08\x42\x03\xe0\x41\x02\x1a\xbe\t\n\x1a\x43\x65rtificateAuthorityPolicy\x12\x8e\x01\n\x13\x61llowed_config_list\x18\x01 \x01(\x0b\x32j.google.cloud.security.privateca.v1beta1.CertificateAuthority.CertificateAuthorityPolicy.AllowedConfigListB\x03\xe0\x41\x01H\x00\x12\x66\n\x17overwrite_config_values\x18\x02 \x01(\x0b\x32>.google.cloud.security.privateca.v1beta1.ReusableConfigWrapperB\x03\xe0\x41\x01H\x00\x12\x62\n#allowed_locations_and_organizations\x18\x03 \x03(\x0b\x32\x30.google.cloud.security.privateca.v1beta1.SubjectB\x03\xe0\x41\x01\x12!\n\x14\x61llowed_common_names\x18\x04 \x03(\tB\x03\xe0\x41\x01\x12\x8a\x01\n\x0c\x61llowed_sans\x18\x05 \x01(\x0b\x32o.google.cloud.security.privateca.v1beta1.CertificateAuthority.CertificateAuthorityPolicy.AllowedSubjectAltNamesB\x03\xe0\x41\x01\x12\x38\n\x10maximum_lifetime\x18\x06 \x01(\x0b\x32\x19.google.protobuf.DurationB\x03\xe0\x41\x01\x12\x8b\x01\n\x16\x61llowed_issuance_modes\x18\x08 \x01(\x0b\x32\x66.google.cloud.security.privateca.v1beta1.CertificateAuthority.CertificateAuthorityPolicy.IssuanceModesB\x03\xe0\x41\x01\x1aw\n\x11\x41llowedConfigList\x12\x62\n\x15\x61llowed_config_values\x18\x01 \x03(\x0b\x32>.google.cloud.security.privateca.v1beta1.ReusableConfigWrapperB\x03\xe0\x41\x02\x1a\xde\x01\n\x16\x41llowedSubjectAltNames\x12\x1e\n\x11\x61llowed_dns_names\x18\x01 \x03(\tB\x03\xe0\x41\x01\x12\x19\n\x0c\x61llowed_uris\x18\x02 \x03(\tB\x03\xe0\x41\x01\x12$\n\x17\x61llowed_email_addresses\x18\x03 \x03(\tB\x03\xe0\x41\x01\x12\x18\n\x0b\x61llowed_ips\x18\x04 \x03(\tB\x03\xe0\x41\x01\x12)\n\x1c\x61llow_globbing_dns_wildcards\x18\x05 \x01(\x08\x42\x03\xe0\x41\x01\x12\x1e\n\x11\x61llow_custom_sans\x18\x06 \x01(\x08\x42\x03\xe0\x41\x01\x1a`\n\rIssuanceModes\x12%\n\x18\x61llow_csr_based_issuance\x18\x01 \x01(\x08\x42\x03\xe0\x41\x02\x12(\n\x1b\x61llow_config_based_issuance\x18\x02 \x01(\x08\x42\x03\xe0\x41\x02\x42\x0f\n\rconfig_policy\x1aG\n\nAccessUrls\x12!\n\x19\x63\x61_certificate_access_url\x18\x01 \x01(\t\x12\x16\n\x0e\x63rl_access_url\x18\x02 \x01(\t\x1a\xaf\x01\n\x0eKeyVersionSpec\x12$\n\x15\x63loud_kms_key_version\x18\x01 \x01(\tB\x03\xe0\x41\x02H\x00\x12i\n\talgorithm\x18\x02 \x01(\x0e\x32O.google.cloud.security.privateca.v1beta1.CertificateAuthority.SignHashAlgorithmB\x03\xe0\x41\x02H\x00\x42\x0c\n\nKeyVersion\x1a-\n\x0bLabelsEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12\r\n\x05value\x18\x02 \x01(\t:\x02\x38\x01\">\n\x04Type\x12\x14\n\x10TYPE_UNSPECIFIED\x10\x00\x12\x0f\n\x0bSELF_SIGNED\x10\x01\x12\x0f\n\x0bSUBORDINATE\x10\x02\"8\n\x04Tier\x12\x14\n\x10TIER_UNSPECIFIED\x10\x00\x12\x0e\n\nENTERPRISE\x10\x01\x12\n\n\x06\x44\x45VOPS\x10\x02\"g\n\x05State\x12\x15\n\x11STATE_UNSPECIFIED\x10\x00\x12\x0b\n\x07\x45NABLED\x10\x01\x12\x0c\n\x08\x44ISABLED\x10\x02\x12\x16\n\x12PENDING_ACTIVATION\x10\x03\x12\x14\n\x10PENDING_DELETION\x10\x04\"\xfc\x01\n\x11SignHashAlgorithm\x12#\n\x1fSIGN_HASH_ALGORITHM_UNSPECIFIED\x10\x00\x12\x17\n\x13RSA_PSS_2048_SHA256\x10\x01\x12\x17\n\x13RSA_PSS_3072_SHA256\x10\x02\x12\x17\n\x13RSA_PSS_4096_SHA256\x10\x03\x12\x19\n\x15RSA_PKCS1_2048_SHA256\x10\x06\x12\x19\n\x15RSA_PKCS1_3072_SHA256\x10\x07\x12\x19\n\x15RSA_PKCS1_4096_SHA256\x10\x08\x12\x12\n\x0e\x45\x43_P256_SHA256\x10\x04\x12\x12\n\x0e\x45\x43_P384_SHA384\x10\x05:\x8b\x01\xea\x41\x87\x01\n-privateca.googleapis.com/CertificateAuthority\x12Vprojects/{project}/locations/{location}/certificateAuthorities/{certificate_authority}\"\xf9\x07\n\x19\x43\x65rtificateRevocationList\x12\x11\n\x04name\x18\x01 \x01(\tB\x03\xe0\x41\x03\x12\x1c\n\x0fsequence_number\x18\x02 \x01(\x03\x42\x03\xe0\x41\x03\x12x\n\x14revoked_certificates\x18\x03 \x03(\x0b\x32U.google.cloud.security.privateca.v1beta1.CertificateRevocationList.RevokedCertificateB\x03\xe0\x41\x03\x12\x14\n\x07pem_crl\x18\x04 \x01(\tB\x03\xe0\x41\x03\x12\x17\n\naccess_url\x18\x05 \x01(\tB\x03\xe0\x41\x03\x12\\\n\x05state\x18\x06 \x01(\x0e\x32H.google.cloud.security.privateca.v1beta1.CertificateRevocationList.StateB\x03\xe0\x41\x03\x12\x34\n\x0b\x63reate_time\x18\x07 \x01(\x0b\x32\x1a.google.protobuf.TimestampB\x03\xe0\x41\x03\x12\x34\n\x0bupdate_time\x18\x08 \x01(\x0b\x32\x1a.google.protobuf.TimestampB\x03\xe0\x41\x03\x12\x63\n\x06labels\x18\t \x03(\x0b\x32N.google.cloud.security.privateca.v1beta1.CertificateRevocationList.LabelsEntryB\x03\xe0\x41\x01\x1a\x9a\x01\n\x12RevokedCertificate\x12\x13\n\x0b\x63\x65rtificate\x18\x01 \x01(\t\x12\x19\n\x11hex_serial_number\x18\x02 \x01(\t\x12T\n\x11revocation_reason\x18\x03 \x01(\x0e\x32\x39.google.cloud.security.privateca.v1beta1.RevocationReason\x1a-\n\x0bLabelsEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12\r\n\x05value\x18\x02 \x01(\t:\x02\x38\x01\":\n\x05State\x12\x15\n\x11STATE_UNSPECIFIED\x10\x00\x12\n\n\x06\x41\x43TIVE\x10\x01\x12\x0e\n\nSUPERSEDED\x10\x02:\xca\x01\xea\x41\xc6\x01\n2privateca.googleapis.com/CertificateRevocationList\x12\x8f\x01projects/{project}/locations/{location}/certificateAuthorities/{certificate_authority}/certificateRevocationLists/{certificate_revocation_list}\"\x9a\x08\n\x0b\x43\x65rtificate\x12\x11\n\x04name\x18\x01 \x01(\tB\x03\xe0\x41\x03\x12\x16\n\x07pem_csr\x18\x02 \x01(\tB\x03\xe0\x41\x05H\x00\x12Q\n\x06\x63onfig\x18\x03 \x01(\x0b\x32:.google.cloud.security.privateca.v1beta1.CertificateConfigB\x03\xe0\x41\x05H\x00\x12\x33\n\x08lifetime\x18\x04 \x01(\x0b\x32\x19.google.protobuf.DurationB\x06\xe0\x41\x02\xe0\x41\x05\x12g\n\x12revocation_details\x18\x05 \x01(\x0b\x32\x46.google.cloud.security.privateca.v1beta1.Certificate.RevocationDetailsB\x03\xe0\x41\x03\x12\x1c\n\x0fpem_certificate\x18\x06 \x01(\tB\x03\xe0\x41\x03\x12\x65\n\x17\x63\x65rtificate_description\x18\x07 \x01(\x0b\x32?.google.cloud.security.privateca.v1beta1.CertificateDescriptionB\x03\xe0\x41\x03\x12\"\n\x15pem_certificate_chain\x18\x08 \x03(\tB\x03\xe0\x41\x03\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\x12U\n\x06labels\x18\x0b \x03(\x0b\x32@.google.cloud.security.privateca.v1beta1.Certificate.LabelsEntryB\x03\xe0\x41\x01\x1a\x9d\x01\n\x11RevocationDetails\x12S\n\x10revocation_state\x18\x01 \x01(\x0e\x32\x39.google.cloud.security.privateca.v1beta1.RevocationReason\x12\x33\n\x0frevocation_time\x18\x02 \x01(\x0b\x32\x1a.google.protobuf.Timestamp\x1a-\n\x0bLabelsEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12\r\n\x05value\x18\x02 \x01(\t:\x02\x38\x01:\x9d\x01\xea\x41\x99\x01\n$privateca.googleapis.com/Certificate\x12qprojects/{project}/locations/{location}/certificateAuthorities/{certificate_authority}/certificates/{certificate}B\x14\n\x12\x63\x65rtificate_config\"\xff\x03\n\x0eReusableConfig\x12\x11\n\x04name\x18\x01 \x01(\tB\x03\xe0\x41\x03\x12R\n\x06values\x18\x02 \x01(\x0b\x32=.google.cloud.security.privateca.v1beta1.ReusableConfigValuesB\x03\xe0\x41\x02\x12\x18\n\x0b\x64\x65scription\x18\x03 \x01(\tB\x03\xe0\x41\x01\x12\x34\n\x0b\x63reate_time\x18\x04 \x01(\x0b\x32\x1a.google.protobuf.TimestampB\x03\xe0\x41\x03\x12\x34\n\x0bupdate_time\x18\x05 \x01(\x0b\x32\x1a.google.protobuf.TimestampB\x03\xe0\x41\x03\x12X\n\x06labels\x18\x06 \x03(\x0b\x32\x43.google.cloud.security.privateca.v1beta1.ReusableConfig.LabelsEntryB\x03\xe0\x41\x01\x1a-\n\x0bLabelsEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12\r\n\x05value\x18\x02 \x01(\t:\x02\x38\x01:w\xea\x41t\n\'privateca.googleapis.com/ReusableConfig\x12Iprojects/{project}/locations/{location}/reusableConfigs/{reusable_config}\"\x89\x04\n\x14ReusableConfigValues\x12I\n\tkey_usage\x18\x01 \x01(\x0b\x32\x31.google.cloud.security.privateca.v1beta1.KeyUsageB\x03\xe0\x41\x01\x12`\n\nca_options\x18\x02 \x01(\x0b\x32G.google.cloud.security.privateca.v1beta1.ReusableConfigValues.CaOptionsB\x03\xe0\x41\x01\x12J\n\npolicy_ids\x18\x03 \x03(\x0b\x32\x31.google.cloud.security.privateca.v1beta1.ObjectIdB\x03\xe0\x41\x01\x12\x1d\n\x10\x61ia_ocsp_servers\x18\x04 \x03(\tB\x03\xe0\x41\x01\x12Z\n\x15\x61\x64\x64itional_extensions\x18\x05 \x03(\x0b\x32\x36.google.cloud.security.privateca.v1beta1.X509ExtensionB\x03\xe0\x41\x01\x1a}\n\tCaOptions\x12.\n\x05is_ca\x18\x01 \x01(\x0b\x32\x1a.google.protobuf.BoolValueB\x03\xe0\x41\x01\x12@\n\x16max_issuer_path_length\x18\x02 \x01(\x0b\x32\x1b.google.protobuf.Int32ValueB\x03\xe0\x41\x01\"\xae\x01\n\x15ReusableConfigWrapper\x12\x1e\n\x0freusable_config\x18\x01 \x01(\tB\x03\xe0\x41\x02H\x00\x12\x64\n\x16reusable_config_values\x18\x02 \x01(\x0b\x32=.google.cloud.security.privateca.v1beta1.ReusableConfigValuesB\x03\xe0\x41\x02H\x00\x42\x0f\n\rconfig_values\"\xfc\x01\n\x11SubordinateConfig\x12$\n\x15\x63\x65rtificate_authority\x18\x01 \x01(\tB\x03\xe0\x41\x02H\x00\x12r\n\x10pem_issuer_chain\x18\x02 \x01(\x0b\x32Q.google.cloud.security.privateca.v1beta1.SubordinateConfig.SubordinateConfigChainB\x03\xe0\x41\x02H\x00\x1a\x37\n\x16SubordinateConfigChain\x12\x1d\n\x10pem_certificates\x18\x01 \x03(\tB\x03\xe0\x41\x02\x42\x14\n\x12subordinate_config\"\xb2\x01\n\tPublicKey\x12M\n\x04type\x18\x01 \x01(\x0e\x32:.google.cloud.security.privateca.v1beta1.PublicKey.KeyTypeB\x03\xe0\x41\x02\x12\x10\n\x03key\x18\x02 \x01(\x0c\x42\x03\xe0\x41\x02\"D\n\x07KeyType\x12\x18\n\x14KEY_TYPE_UNSPECIFIED\x10\x00\x12\x0f\n\x0bPEM_RSA_KEY\x10\x01\x12\x0e\n\nPEM_EC_KEY\x10\x02\"\xf2\x03\n\x11\x43\x65rtificateConfig\x12\x65\n\x0esubject_config\x18\x01 \x01(\x0b\x32H.google.cloud.security.privateca.v1beta1.CertificateConfig.SubjectConfigB\x03\xe0\x41\x02\x12\\\n\x0freusable_config\x18\x02 \x01(\x0b\x32>.google.cloud.security.privateca.v1beta1.ReusableConfigWrapperB\x03\xe0\x41\x02\x12K\n\npublic_key\x18\x03 \x01(\x0b\x32\x32.google.cloud.security.privateca.v1beta1.PublicKeyB\x03\xe0\x41\x01\x1a\xca\x01\n\rSubjectConfig\x12\x46\n\x07subject\x18\x01 \x01(\x0b\x32\x30.google.cloud.security.privateca.v1beta1.SubjectB\x03\xe0\x41\x02\x12\x18\n\x0b\x63ommon_name\x18\x02 \x01(\tB\x03\xe0\x41\x01\x12W\n\x10subject_alt_name\x18\x03 \x01(\x0b\x32\x38.google.cloud.security.privateca.v1beta1.SubjectAltNamesB\x03\xe0\x41\x01\"\xe1\x08\n\x16\x43\x65rtificateDescription\x12o\n\x13subject_description\x18\x01 \x01(\x0b\x32R.google.cloud.security.privateca.v1beta1.CertificateDescription.SubjectDescription\x12T\n\rconfig_values\x18\x02 \x01(\x0b\x32=.google.cloud.security.privateca.v1beta1.ReusableConfigValues\x12\x46\n\npublic_key\x18\x03 \x01(\x0b\x32\x32.google.cloud.security.privateca.v1beta1.PublicKey\x12]\n\x0esubject_key_id\x18\x04 \x01(\x0b\x32\x45.google.cloud.security.privateca.v1beta1.CertificateDescription.KeyId\x12_\n\x10\x61uthority_key_id\x18\x05 \x01(\x0b\x32\x45.google.cloud.security.privateca.v1beta1.CertificateDescription.KeyId\x12\x1f\n\x17\x63rl_distribution_points\x18\x06 \x03(\t\x12$\n\x1c\x61ia_issuing_certificate_urls\x18\x07 \x03(\t\x12p\n\x10\x63\x65rt_fingerprint\x18\x08 \x01(\x0b\x32V.google.cloud.security.privateca.v1beta1.CertificateDescription.CertificateFingerprint\x1a\xf1\x02\n\x12SubjectDescription\x12\x41\n\x07subject\x18\x01 \x01(\x0b\x32\x30.google.cloud.security.privateca.v1beta1.Subject\x12\x13\n\x0b\x63ommon_name\x18\x02 \x01(\t\x12R\n\x10subject_alt_name\x18\x03 \x01(\x0b\x32\x38.google.cloud.security.privateca.v1beta1.SubjectAltNames\x12\x19\n\x11hex_serial_number\x18\x04 \x01(\t\x12+\n\x08lifetime\x18\x05 \x01(\x0b\x32\x19.google.protobuf.Duration\x12\x33\n\x0fnot_before_time\x18\x06 \x01(\x0b\x32\x1a.google.protobuf.Timestamp\x12\x32\n\x0enot_after_time\x18\x07 \x01(\x0b\x32\x1a.google.protobuf.Timestamp\x1a\x1c\n\x05KeyId\x12\x13\n\x06key_id\x18\x01 \x01(\tB\x03\xe0\x41\x01\x1a-\n\x16\x43\x65rtificateFingerprint\x12\x13\n\x0bsha256_hash\x18\x01 \x01(\t\"\'\n\x08ObjectId\x12\x1b\n\x0eobject_id_path\x18\x01 \x03(\x05\x42\x03\xe0\x41\x02\"\x85\x01\n\rX509Extension\x12I\n\tobject_id\x18\x01 \x01(\x0b\x32\x31.google.cloud.security.privateca.v1beta1.ObjectIdB\x03\xe0\x41\x02\x12\x15\n\x08\x63ritical\x18\x02 \x01(\x08\x42\x03\xe0\x41\x02\x12\x12\n\x05value\x18\x03 \x01(\x0c\x42\x03\xe0\x41\x02\"\xb1\x05\n\x08KeyUsage\x12Y\n\x0e\x62\x61se_key_usage\x18\x01 \x01(\x0b\x32\x41.google.cloud.security.privateca.v1beta1.KeyUsage.KeyUsageOptions\x12\x65\n\x12\x65xtended_key_usage\x18\x02 \x01(\x0b\x32I.google.cloud.security.privateca.v1beta1.KeyUsage.ExtendedKeyUsageOptions\x12V\n\x1bunknown_extended_key_usages\x18\x03 \x03(\x0b\x32\x31.google.cloud.security.privateca.v1beta1.ObjectId\x1a\xe7\x01\n\x0fKeyUsageOptions\x12\x19\n\x11\x64igital_signature\x18\x01 \x01(\x08\x12\x1a\n\x12\x63ontent_commitment\x18\x02 \x01(\x08\x12\x18\n\x10key_encipherment\x18\x03 \x01(\x08\x12\x19\n\x11\x64\x61ta_encipherment\x18\x04 \x01(\x08\x12\x15\n\rkey_agreement\x18\x05 \x01(\x08\x12\x11\n\tcert_sign\x18\x06 \x01(\x08\x12\x10\n\x08\x63rl_sign\x18\x07 \x01(\x08\x12\x15\n\rencipher_only\x18\x08 \x01(\x08\x12\x15\n\rdecipher_only\x18\t \x01(\x08\x1a\xa0\x01\n\x17\x45xtendedKeyUsageOptions\x12\x13\n\x0bserver_auth\x18\x01 \x01(\x08\x12\x13\n\x0b\x63lient_auth\x18\x02 \x01(\x08\x12\x14\n\x0c\x63ode_signing\x18\x03 \x01(\x08\x12\x18\n\x10\x65mail_protection\x18\x04 \x01(\x08\x12\x15\n\rtime_stamping\x18\x05 \x01(\x08\x12\x14\n\x0cocsp_signing\x18\x06 \x01(\x08\"\xa3\x01\n\x07Subject\x12\x14\n\x0c\x63ountry_code\x18\x01 \x01(\t\x12\x14\n\x0corganization\x18\x02 \x01(\t\x12\x1b\n\x13organizational_unit\x18\x03 \x01(\t\x12\x10\n\x08locality\x18\x04 \x01(\t\x12\x10\n\x08province\x18\x05 \x01(\t\x12\x16\n\x0estreet_address\x18\x06 \x01(\t\x12\x13\n\x0bpostal_code\x18\x07 \x01(\t\"\xae\x01\n\x0fSubjectAltNames\x12\x11\n\tdns_names\x18\x01 \x03(\t\x12\x0c\n\x04uris\x18\x02 \x03(\t\x12\x17\n\x0f\x65mail_addresses\x18\x03 \x03(\t\x12\x14\n\x0cip_addresses\x18\x04 \x03(\t\x12K\n\x0b\x63ustom_sans\x18\x05 \x03(\x0b\x32\x36.google.cloud.security.privateca.v1beta1.X509Extension*\x87\x02\n\x10RevocationReason\x12!\n\x1dREVOCATION_REASON_UNSPECIFIED\x10\x00\x12\x12\n\x0eKEY_COMPROMISE\x10\x01\x12$\n CERTIFICATE_AUTHORITY_COMPROMISE\x10\x02\x12\x17\n\x13\x41\x46\x46ILIATION_CHANGED\x10\x03\x12\x0e\n\nSUPERSEDED\x10\x04\x12\x1a\n\x16\x43\x45SSATION_OF_OPERATION\x10\x05\x12\x14\n\x10\x43\x45RTIFICATE_HOLD\x10\x06\x12\x17\n\x13PRIVILEGE_WITHDRAWN\x10\x07\x12\"\n\x1e\x41TTRIBUTE_AUTHORITY_COMPROMISE\x10\x08\x42\x98\x02\n+com.google.cloud.security.privateca.v1beta1B\x17PrivateCaResourcesProtoP\x01ZIcloud.google.com/go/security/privateca/apiv1beta1/privatecapb;privatecapb\xf8\x01\x01\xaa\x02\'Google.Cloud.Security.PrivateCA.V1Beta1\xca\x02\'Google\\Cloud\\Security\\PrivateCA\\V1beta1\xea\x02+Google::Cloud::Security::PrivateCA::V1beta1b\x06proto3" - -pool = ::Google::Protobuf::DescriptorPool.generated_pool -pool.add_serialized_file(descriptor_data) - -module Google - module Cloud - module Security - module PrivateCA - module V1beta1 - CertificateAuthority = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.security.privateca.v1beta1.CertificateAuthority").msgclass - CertificateAuthority::IssuingOptions = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.security.privateca.v1beta1.CertificateAuthority.IssuingOptions").msgclass - CertificateAuthority::CertificateAuthorityPolicy = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.security.privateca.v1beta1.CertificateAuthority.CertificateAuthorityPolicy").msgclass - CertificateAuthority::CertificateAuthorityPolicy::AllowedConfigList = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.security.privateca.v1beta1.CertificateAuthority.CertificateAuthorityPolicy.AllowedConfigList").msgclass - CertificateAuthority::CertificateAuthorityPolicy::AllowedSubjectAltNames = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.security.privateca.v1beta1.CertificateAuthority.CertificateAuthorityPolicy.AllowedSubjectAltNames").msgclass - CertificateAuthority::CertificateAuthorityPolicy::IssuanceModes = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.security.privateca.v1beta1.CertificateAuthority.CertificateAuthorityPolicy.IssuanceModes").msgclass - CertificateAuthority::AccessUrls = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.security.privateca.v1beta1.CertificateAuthority.AccessUrls").msgclass - CertificateAuthority::KeyVersionSpec = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.security.privateca.v1beta1.CertificateAuthority.KeyVersionSpec").msgclass - CertificateAuthority::Type = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.security.privateca.v1beta1.CertificateAuthority.Type").enummodule - CertificateAuthority::Tier = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.security.privateca.v1beta1.CertificateAuthority.Tier").enummodule - CertificateAuthority::State = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.security.privateca.v1beta1.CertificateAuthority.State").enummodule - CertificateAuthority::SignHashAlgorithm = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.security.privateca.v1beta1.CertificateAuthority.SignHashAlgorithm").enummodule - CertificateRevocationList = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.security.privateca.v1beta1.CertificateRevocationList").msgclass - CertificateRevocationList::RevokedCertificate = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.security.privateca.v1beta1.CertificateRevocationList.RevokedCertificate").msgclass - CertificateRevocationList::State = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.security.privateca.v1beta1.CertificateRevocationList.State").enummodule - Certificate = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.security.privateca.v1beta1.Certificate").msgclass - Certificate::RevocationDetails = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.security.privateca.v1beta1.Certificate.RevocationDetails").msgclass - ReusableConfig = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.security.privateca.v1beta1.ReusableConfig").msgclass - ReusableConfigValues = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.security.privateca.v1beta1.ReusableConfigValues").msgclass - ReusableConfigValues::CaOptions = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.security.privateca.v1beta1.ReusableConfigValues.CaOptions").msgclass - ReusableConfigWrapper = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.security.privateca.v1beta1.ReusableConfigWrapper").msgclass - SubordinateConfig = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.security.privateca.v1beta1.SubordinateConfig").msgclass - SubordinateConfig::SubordinateConfigChain = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.security.privateca.v1beta1.SubordinateConfig.SubordinateConfigChain").msgclass - PublicKey = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.security.privateca.v1beta1.PublicKey").msgclass - PublicKey::KeyType = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.security.privateca.v1beta1.PublicKey.KeyType").enummodule - CertificateConfig = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.security.privateca.v1beta1.CertificateConfig").msgclass - CertificateConfig::SubjectConfig = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.security.privateca.v1beta1.CertificateConfig.SubjectConfig").msgclass - CertificateDescription = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.security.privateca.v1beta1.CertificateDescription").msgclass - CertificateDescription::SubjectDescription = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.security.privateca.v1beta1.CertificateDescription.SubjectDescription").msgclass - CertificateDescription::KeyId = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.security.privateca.v1beta1.CertificateDescription.KeyId").msgclass - CertificateDescription::CertificateFingerprint = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.security.privateca.v1beta1.CertificateDescription.CertificateFingerprint").msgclass - ObjectId = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.security.privateca.v1beta1.ObjectId").msgclass - X509Extension = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.security.privateca.v1beta1.X509Extension").msgclass - KeyUsage = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.security.privateca.v1beta1.KeyUsage").msgclass - KeyUsage::KeyUsageOptions = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.security.privateca.v1beta1.KeyUsage.KeyUsageOptions").msgclass - KeyUsage::ExtendedKeyUsageOptions = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.security.privateca.v1beta1.KeyUsage.ExtendedKeyUsageOptions").msgclass - Subject = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.security.privateca.v1beta1.Subject").msgclass - SubjectAltNames = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.security.privateca.v1beta1.SubjectAltNames").msgclass - RevocationReason = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.security.privateca.v1beta1.RevocationReason").enummodule - end - end - end - end -end diff --git a/owl-bot-staging/google-cloud-security-private_ca-v1beta1/lib/google/cloud/security/privateca/v1beta1/service_pb.rb b/owl-bot-staging/google-cloud-security-private_ca-v1beta1/lib/google/cloud/security/privateca/v1beta1/service_pb.rb deleted file mode 100644 index a760dc678bed..000000000000 --- a/owl-bot-staging/google-cloud-security-private_ca-v1beta1/lib/google/cloud/security/privateca/v1beta1/service_pb.rb +++ /dev/null @@ -1,57 +0,0 @@ -# frozen_string_literal: true -# Generated by the protocol buffer compiler. DO NOT EDIT! -# source: google/cloud/security/privateca/v1beta1/service.proto - -require 'google/protobuf' - -require 'google/api/annotations_pb' -require 'google/api/client_pb' -require 'google/api/field_behavior_pb' -require 'google/api/resource_pb' -require 'google/cloud/security/privateca/v1beta1/resources_pb' -require 'google/longrunning/operations_pb' -require 'google/protobuf/field_mask_pb' -require 'google/protobuf/timestamp_pb' - - -descriptor_data = "\n5google/cloud/security/privateca/v1beta1/service.proto\x12\'google.cloud.security.privateca.v1beta1\x1a\x1cgoogle/api/annotations.proto\x1a\x17google/api/client.proto\x1a\x1fgoogle/api/field_behavior.proto\x1a\x19google/api/resource.proto\x1a\x37google/cloud/security/privateca/v1beta1/resources.proto\x1a#google/longrunning/operations.proto\x1a google/protobuf/field_mask.proto\x1a\x1fgoogle/protobuf/timestamp.proto\"\xe7\x01\n\x18\x43reateCertificateRequest\x12\x45\n\x06parent\x18\x01 \x01(\tB5\xe0\x41\x02\xfa\x41/\n-privateca.googleapis.com/CertificateAuthority\x12\x1b\n\x0e\x63\x65rtificate_id\x18\x02 \x01(\tB\x03\xe0\x41\x01\x12N\n\x0b\x63\x65rtificate\x18\x03 \x01(\x0b\x32\x34.google.cloud.security.privateca.v1beta1.CertificateB\x03\xe0\x41\x02\x12\x17\n\nrequest_id\x18\x04 \x01(\tB\x03\xe0\x41\x01\"S\n\x15GetCertificateRequest\x12:\n\x04name\x18\x01 \x01(\tB,\xe0\x41\x02\xfa\x41&\n$privateca.googleapis.com/Certificate\"\xbd\x01\n\x17ListCertificatesRequest\x12\x45\n\x06parent\x18\x01 \x01(\tB5\xe0\x41\x02\xfa\x41/\n-privateca.googleapis.com/CertificateAuthority\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\x12\x15\n\x08order_by\x18\x05 \x01(\tB\x03\xe0\x41\x01\"\x94\x01\n\x18ListCertificatesResponse\x12J\n\x0c\x63\x65rtificates\x18\x01 \x03(\x0b\x32\x34.google.cloud.security.privateca.v1beta1.Certificate\x12\x17\n\x0fnext_page_token\x18\x02 \x01(\t\x12\x13\n\x0bunreachable\x18\x03 \x03(\t\"\xbf\x01\n\x18RevokeCertificateRequest\x12:\n\x04name\x18\x01 \x01(\tB,\xe0\x41\x02\xfa\x41&\n$privateca.googleapis.com/Certificate\x12N\n\x06reason\x18\x02 \x01(\x0e\x32\x39.google.cloud.security.privateca.v1beta1.RevocationReasonB\x03\xe0\x41\x02\x12\x17\n\nrequest_id\x18\x03 \x01(\tB\x03\xe0\x41\x01\"\xb9\x01\n\x18UpdateCertificateRequest\x12N\n\x0b\x63\x65rtificate\x18\x01 \x01(\x0b\x32\x34.google.cloud.security.privateca.v1beta1.CertificateB\x03\xe0\x41\x02\x12\x34\n\x0bupdate_mask\x18\x02 \x01(\x0b\x32\x1a.google.protobuf.FieldMaskB\x03\xe0\x41\x02\x12\x17\n\nrequest_id\x18\x03 \x01(\tB\x03\xe0\x41\x01\"\x81\x02\n#ActivateCertificateAuthorityRequest\x12\x43\n\x04name\x18\x01 \x01(\tB5\xe0\x41\x02\xfa\x41/\n-privateca.googleapis.com/CertificateAuthority\x12\x1f\n\x12pem_ca_certificate\x18\x02 \x01(\tB\x03\xe0\x41\x02\x12[\n\x12subordinate_config\x18\x03 \x01(\x0b\x32:.google.cloud.security.privateca.v1beta1.SubordinateConfigB\x03\xe0\x41\x02\x12\x17\n\nrequest_id\x18\x04 \x01(\tB\x03\xe0\x41\x01\"\x81\x02\n!CreateCertificateAuthorityRequest\x12\x39\n\x06parent\x18\x01 \x01(\tB)\xe0\x41\x02\xfa\x41#\n!locations.googleapis.com/Location\x12%\n\x18\x63\x65rtificate_authority_id\x18\x02 \x01(\tB\x03\xe0\x41\x02\x12\x61\n\x15\x63\x65rtificate_authority\x18\x03 \x01(\x0b\x32=.google.cloud.security.privateca.v1beta1.CertificateAuthorityB\x03\xe0\x41\x02\x12\x17\n\nrequest_id\x18\x04 \x01(\tB\x03\xe0\x41\x01\"\x82\x01\n\"DisableCertificateAuthorityRequest\x12\x43\n\x04name\x18\x01 \x01(\tB5\xe0\x41\x02\xfa\x41/\n-privateca.googleapis.com/CertificateAuthority\x12\x17\n\nrequest_id\x18\x02 \x01(\tB\x03\xe0\x41\x01\"\x81\x01\n!EnableCertificateAuthorityRequest\x12\x43\n\x04name\x18\x01 \x01(\tB5\xe0\x41\x02\xfa\x41/\n-privateca.googleapis.com/CertificateAuthority\x12\x17\n\nrequest_id\x18\x02 \x01(\tB\x03\xe0\x41\x01\"j\n#FetchCertificateAuthorityCsrRequest\x12\x43\n\x04name\x18\x01 \x01(\tB5\xe0\x41\x02\xfa\x41/\n-privateca.googleapis.com/CertificateAuthority\"<\n$FetchCertificateAuthorityCsrResponse\x12\x14\n\x07pem_csr\x18\x01 \x01(\tB\x03\xe0\x41\x03\"e\n\x1eGetCertificateAuthorityRequest\x12\x43\n\x04name\x18\x01 \x01(\tB5\xe0\x41\x02\xfa\x41/\n-privateca.googleapis.com/CertificateAuthority\"\xbb\x01\n!ListCertificateAuthoritiesRequest\x12\x39\n\x06parent\x18\x01 \x01(\tB)\xe0\x41\x02\xfa\x41#\n!locations.googleapis.com/Location\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\x12\x15\n\x08order_by\x18\x05 \x01(\tB\x03\xe0\x41\x01\"\xb2\x01\n\"ListCertificateAuthoritiesResponse\x12^\n\x17\x63\x65rtificate_authorities\x18\x01 \x03(\x0b\x32=.google.cloud.security.privateca.v1beta1.CertificateAuthority\x12\x17\n\x0fnext_page_token\x18\x02 \x01(\t\x12\x13\n\x0bunreachable\x18\x03 \x03(\t\"\x82\x01\n\"RestoreCertificateAuthorityRequest\x12\x43\n\x04name\x18\x01 \x01(\tB5\xe0\x41\x02\xfa\x41/\n-privateca.googleapis.com/CertificateAuthority\x12\x17\n\nrequest_id\x18\x02 \x01(\tB\x03\xe0\x41\x01\"\x89\x01\n)ScheduleDeleteCertificateAuthorityRequest\x12\x43\n\x04name\x18\x01 \x01(\tB5\xe0\x41\x02\xfa\x41/\n-privateca.googleapis.com/CertificateAuthority\x12\x17\n\nrequest_id\x18\x02 \x01(\tB\x03\xe0\x41\x01\"\xd5\x01\n!UpdateCertificateAuthorityRequest\x12\x61\n\x15\x63\x65rtificate_authority\x18\x01 \x01(\x0b\x32=.google.cloud.security.privateca.v1beta1.CertificateAuthorityB\x03\xe0\x41\x02\x12\x34\n\x0bupdate_mask\x18\x02 \x01(\x0b\x32\x1a.google.protobuf.FieldMaskB\x03\xe0\x41\x02\x12\x17\n\nrequest_id\x18\x03 \x01(\tB\x03\xe0\x41\x01\"o\n#GetCertificateRevocationListRequest\x12H\n\x04name\x18\x01 \x01(\tB:\xe0\x41\x02\xfa\x41\x34\n2privateca.googleapis.com/CertificateRevocationList\"\xcb\x01\n%ListCertificateRevocationListsRequest\x12\x45\n\x06parent\x18\x01 \x01(\tB5\xe0\x41\x02\xfa\x41/\n-privateca.googleapis.com/CertificateAuthority\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\x12\x15\n\x08order_by\x18\x05 \x01(\tB\x03\xe0\x41\x01\"\xc0\x01\n&ListCertificateRevocationListsResponse\x12h\n\x1c\x63\x65rtificate_revocation_lists\x18\x01 \x03(\x0b\x32\x42.google.cloud.security.privateca.v1beta1.CertificateRevocationList\x12\x17\n\x0fnext_page_token\x18\x02 \x01(\t\x12\x13\n\x0bunreachable\x18\x03 \x03(\t\"\xe5\x01\n&UpdateCertificateRevocationListRequest\x12l\n\x1b\x63\x65rtificate_revocation_list\x18\x01 \x01(\x0b\x32\x42.google.cloud.security.privateca.v1beta1.CertificateRevocationListB\x03\xe0\x41\x02\x12\x34\n\x0bupdate_mask\x18\x02 \x01(\x0b\x32\x1a.google.protobuf.FieldMaskB\x03\xe0\x41\x02\x12\x17\n\nrequest_id\x18\x03 \x01(\tB\x03\xe0\x41\x01\"Y\n\x18GetReusableConfigRequest\x12=\n\x04name\x18\x01 \x01(\tB/\xe0\x41\x02\xfa\x41)\n\'privateca.googleapis.com/ReusableConfig\"\xb4\x01\n\x1aListReusableConfigsRequest\x12\x39\n\x06parent\x18\x01 \x01(\tB)\xe0\x41\x02\xfa\x41#\n!locations.googleapis.com/Location\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\x12\x15\n\x08order_by\x18\x05 \x01(\tB\x03\xe0\x41\x01\"\x9e\x01\n\x1bListReusableConfigsResponse\x12Q\n\x10reusable_configs\x18\x01 \x03(\x0b\x32\x37.google.cloud.security.privateca.v1beta1.ReusableConfig\x12\x17\n\x0fnext_page_token\x18\x02 \x01(\t\x12\x13\n\x0bunreachable\x18\x03 \x03(\t\"\x80\x02\n\x11OperationMetadata\x12\x34\n\x0b\x63reate_time\x18\x01 \x01(\x0b\x32\x1a.google.protobuf.TimestampB\x03\xe0\x41\x03\x12\x31\n\x08\x65nd_time\x18\x02 \x01(\x0b\x32\x1a.google.protobuf.TimestampB\x03\xe0\x41\x03\x12\x13\n\x06target\x18\x03 \x01(\tB\x03\xe0\x41\x03\x12\x11\n\x04verb\x18\x04 \x01(\tB\x03\xe0\x41\x03\x12\x1b\n\x0estatus_message\x18\x05 \x01(\tB\x03\xe0\x41\x03\x12#\n\x16requested_cancellation\x18\x06 \x01(\x08\x42\x03\xe0\x41\x03\x12\x18\n\x0b\x61pi_version\x18\x07 \x01(\tB\x03\xe0\x41\x03\x32\xd1,\n\x1b\x43\x65rtificateAuthorityService\x12\x96\x02\n\x11\x43reateCertificate\x12\x41.google.cloud.security.privateca.v1beta1.CreateCertificateRequest\x1a\x34.google.cloud.security.privateca.v1beta1.Certificate\"\x87\x01\xda\x41!parent,certificate,certificate_id\x82\xd3\xe4\x93\x02]\"N/v1beta1/{parent=projects/*/locations/*/certificateAuthorities/*}/certificates:\x0b\x63\x65rtificate\x12\xe5\x01\n\x0eGetCertificate\x12>.google.cloud.security.privateca.v1beta1.GetCertificateRequest\x1a\x34.google.cloud.security.privateca.v1beta1.Certificate\"]\xda\x41\x04name\x82\xd3\xe4\x93\x02P\x12N/v1beta1/{name=projects/*/locations/*/certificateAuthorities/*/certificates/*}\x12\xf8\x01\n\x10ListCertificates\x12@.google.cloud.security.privateca.v1beta1.ListCertificatesRequest\x1a\x41.google.cloud.security.privateca.v1beta1.ListCertificatesResponse\"_\xda\x41\x06parent\x82\xd3\xe4\x93\x02P\x12N/v1beta1/{parent=projects/*/locations/*/certificateAuthorities/*}/certificates\x12\xf5\x01\n\x11RevokeCertificate\x12\x41.google.cloud.security.privateca.v1beta1.RevokeCertificateRequest\x1a\x34.google.cloud.security.privateca.v1beta1.Certificate\"g\xda\x41\x04name\x82\xd3\xe4\x93\x02Z\"U/v1beta1/{name=projects/*/locations/*/certificateAuthorities/*/certificates/*}:revoke:\x01*\x12\x98\x02\n\x11UpdateCertificate\x12\x41.google.cloud.security.privateca.v1beta1.UpdateCertificateRequest\x1a\x34.google.cloud.security.privateca.v1beta1.Certificate\"\x89\x01\xda\x41\x17\x63\x65rtificate,update_mask\x82\xd3\xe4\x93\x02i2Z/v1beta1/{certificate.name=projects/*/locations/*/certificateAuthorities/*/certificates/*}:\x0b\x63\x65rtificate\x12\x94\x02\n\x1c\x41\x63tivateCertificateAuthority\x12L.google.cloud.security.privateca.v1beta1.ActivateCertificateAuthorityRequest\x1a\x1d.google.longrunning.Operation\"\x86\x01\xca\x41)\n\x14\x43\x65rtificateAuthority\x12\x11OperationMetadata\xda\x41\x04name\x82\xd3\xe4\x93\x02M\"H/v1beta1/{name=projects/*/locations/*/certificateAuthorities/*}:activate:\x01*\x12\xcc\x02\n\x1a\x43reateCertificateAuthority\x12J.google.cloud.security.privateca.v1beta1.CreateCertificateAuthorityRequest\x1a\x1d.google.longrunning.Operation\"\xc2\x01\xca\x41)\n\x14\x43\x65rtificateAuthority\x12\x11OperationMetadata\xda\x41\x35parent,certificate_authority,certificate_authority_id\x82\xd3\xe4\x93\x02X\"?/v1beta1/{parent=projects/*/locations/*}/certificateAuthorities:\x15\x63\x65rtificate_authority\x12\x91\x02\n\x1b\x44isableCertificateAuthority\x12K.google.cloud.security.privateca.v1beta1.DisableCertificateAuthorityRequest\x1a\x1d.google.longrunning.Operation\"\x85\x01\xca\x41)\n\x14\x43\x65rtificateAuthority\x12\x11OperationMetadata\xda\x41\x04name\x82\xd3\xe4\x93\x02L\"G/v1beta1/{name=projects/*/locations/*/certificateAuthorities/*}:disable:\x01*\x12\x8e\x02\n\x1a\x45nableCertificateAuthority\x12J.google.cloud.security.privateca.v1beta1.EnableCertificateAuthorityRequest\x1a\x1d.google.longrunning.Operation\"\x84\x01\xca\x41)\n\x14\x43\x65rtificateAuthority\x12\x11OperationMetadata\xda\x41\x04name\x82\xd3\xe4\x93\x02K\"F/v1beta1/{name=projects/*/locations/*/certificateAuthorities/*}:enable:\x01*\x12\x91\x02\n\x1c\x46\x65tchCertificateAuthorityCsr\x12L.google.cloud.security.privateca.v1beta1.FetchCertificateAuthorityCsrRequest\x1aM.google.cloud.security.privateca.v1beta1.FetchCertificateAuthorityCsrResponse\"T\xda\x41\x04name\x82\xd3\xe4\x93\x02G\x12\x45/v1beta1/{name=projects/*/locations/*/certificateAuthorities/*}:fetch\x12\xf1\x01\n\x17GetCertificateAuthority\x12G.google.cloud.security.privateca.v1beta1.GetCertificateAuthorityRequest\x1a=.google.cloud.security.privateca.v1beta1.CertificateAuthority\"N\xda\x41\x04name\x82\xd3\xe4\x93\x02\x41\x12?/v1beta1/{name=projects/*/locations/*/certificateAuthorities/*}\x12\x87\x02\n\x1aListCertificateAuthorities\x12J.google.cloud.security.privateca.v1beta1.ListCertificateAuthoritiesRequest\x1aK.google.cloud.security.privateca.v1beta1.ListCertificateAuthoritiesResponse\"P\xda\x41\x06parent\x82\xd3\xe4\x93\x02\x41\x12?/v1beta1/{parent=projects/*/locations/*}/certificateAuthorities\x12\x91\x02\n\x1bRestoreCertificateAuthority\x12K.google.cloud.security.privateca.v1beta1.RestoreCertificateAuthorityRequest\x1a\x1d.google.longrunning.Operation\"\x85\x01\xca\x41)\n\x14\x43\x65rtificateAuthority\x12\x11OperationMetadata\xda\x41\x04name\x82\xd3\xe4\x93\x02L\"G/v1beta1/{name=projects/*/locations/*/certificateAuthorities/*}:restore:\x01*\x12\xa6\x02\n\"ScheduleDeleteCertificateAuthority\x12R.google.cloud.security.privateca.v1beta1.ScheduleDeleteCertificateAuthorityRequest\x1a\x1d.google.longrunning.Operation\"\x8c\x01\xca\x41)\n\x14\x43\x65rtificateAuthority\x12\x11OperationMetadata\xda\x41\x04name\x82\xd3\xe4\x93\x02S\"N/v1beta1/{name=projects/*/locations/*/certificateAuthorities/*}:scheduleDelete:\x01*\x12\xce\x02\n\x1aUpdateCertificateAuthority\x12J.google.cloud.security.privateca.v1beta1.UpdateCertificateAuthorityRequest\x1a\x1d.google.longrunning.Operation\"\xc4\x01\xca\x41)\n\x14\x43\x65rtificateAuthority\x12\x11OperationMetadata\xda\x41!certificate_authority,update_mask\x82\xd3\xe4\x93\x02n2U/v1beta1/{certificate_authority.name=projects/*/locations/*/certificateAuthorities/*}:\x15\x63\x65rtificate_authority\x12\x9d\x02\n\x1cGetCertificateRevocationList\x12L.google.cloud.security.privateca.v1beta1.GetCertificateRevocationListRequest\x1a\x42.google.cloud.security.privateca.v1beta1.CertificateRevocationList\"k\xda\x41\x04name\x82\xd3\xe4\x93\x02^\x12\\/v1beta1/{name=projects/*/locations/*/certificateAuthorities/*/certificateRevocationLists/*}\x12\xb0\x02\n\x1eListCertificateRevocationLists\x12N.google.cloud.security.privateca.v1beta1.ListCertificateRevocationListsRequest\x1aO.google.cloud.security.privateca.v1beta1.ListCertificateRevocationListsResponse\"m\xda\x41\x06parent\x82\xd3\xe4\x93\x02^\x12\\/v1beta1/{parent=projects/*/locations/*/certificateAuthorities/*}/certificateRevocationLists\x12\x8d\x03\n\x1fUpdateCertificateRevocationList\x12O.google.cloud.security.privateca.v1beta1.UpdateCertificateRevocationListRequest\x1a\x1d.google.longrunning.Operation\"\xf9\x01\xca\x41.\n\x19\x43\x65rtificateRevocationList\x12\x11OperationMetadata\xda\x41\'certificate_revocation_list,update_mask\x82\xd3\xe4\x93\x02\x97\x01\x32x/v1beta1/{certificate_revocation_list.name=projects/*/locations/*/certificateAuthorities/*/certificateRevocationLists/*}:\x1b\x63\x65rtificate_revocation_list\x12\xd8\x01\n\x11GetReusableConfig\x12\x41.google.cloud.security.privateca.v1beta1.GetReusableConfigRequest\x1a\x37.google.cloud.security.privateca.v1beta1.ReusableConfig\"G\xda\x41\x04name\x82\xd3\xe4\x93\x02:\x12\x38/v1beta1/{name=projects/*/locations/*/reusableConfigs/*}\x12\xeb\x01\n\x13ListReusableConfigs\x12\x43.google.cloud.security.privateca.v1beta1.ListReusableConfigsRequest\x1a\x44.google.cloud.security.privateca.v1beta1.ListReusableConfigsResponse\"I\xda\x41\x06parent\x82\xd3\xe4\x93\x02:\x12\x38/v1beta1/{parent=projects/*/locations/*}/reusableConfigs\x1aL\xca\x41\x18privateca.googleapis.com\xd2\x41.https://www.googleapis.com/auth/cloud-platformB\x8f\x02\n+com.google.cloud.security.privateca.v1beta1B\x0ePrivateCaProtoP\x01ZIcloud.google.com/go/security/privateca/apiv1beta1/privatecapb;privatecapb\xf8\x01\x01\xaa\x02\'Google.Cloud.Security.PrivateCA.V1Beta1\xca\x02\'Google\\Cloud\\Security\\PrivateCA\\V1beta1\xea\x02+Google::Cloud::Security::PrivateCA::V1beta1b\x06proto3" - -pool = ::Google::Protobuf::DescriptorPool.generated_pool -pool.add_serialized_file(descriptor_data) - -module Google - module Cloud - module Security - module PrivateCA - module V1beta1 - CreateCertificateRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.security.privateca.v1beta1.CreateCertificateRequest").msgclass - GetCertificateRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.security.privateca.v1beta1.GetCertificateRequest").msgclass - ListCertificatesRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.security.privateca.v1beta1.ListCertificatesRequest").msgclass - ListCertificatesResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.security.privateca.v1beta1.ListCertificatesResponse").msgclass - RevokeCertificateRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.security.privateca.v1beta1.RevokeCertificateRequest").msgclass - UpdateCertificateRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.security.privateca.v1beta1.UpdateCertificateRequest").msgclass - ActivateCertificateAuthorityRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.security.privateca.v1beta1.ActivateCertificateAuthorityRequest").msgclass - CreateCertificateAuthorityRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.security.privateca.v1beta1.CreateCertificateAuthorityRequest").msgclass - DisableCertificateAuthorityRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.security.privateca.v1beta1.DisableCertificateAuthorityRequest").msgclass - EnableCertificateAuthorityRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.security.privateca.v1beta1.EnableCertificateAuthorityRequest").msgclass - FetchCertificateAuthorityCsrRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.security.privateca.v1beta1.FetchCertificateAuthorityCsrRequest").msgclass - FetchCertificateAuthorityCsrResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.security.privateca.v1beta1.FetchCertificateAuthorityCsrResponse").msgclass - GetCertificateAuthorityRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.security.privateca.v1beta1.GetCertificateAuthorityRequest").msgclass - ListCertificateAuthoritiesRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.security.privateca.v1beta1.ListCertificateAuthoritiesRequest").msgclass - ListCertificateAuthoritiesResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.security.privateca.v1beta1.ListCertificateAuthoritiesResponse").msgclass - RestoreCertificateAuthorityRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.security.privateca.v1beta1.RestoreCertificateAuthorityRequest").msgclass - ScheduleDeleteCertificateAuthorityRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.security.privateca.v1beta1.ScheduleDeleteCertificateAuthorityRequest").msgclass - UpdateCertificateAuthorityRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.security.privateca.v1beta1.UpdateCertificateAuthorityRequest").msgclass - GetCertificateRevocationListRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.security.privateca.v1beta1.GetCertificateRevocationListRequest").msgclass - ListCertificateRevocationListsRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.security.privateca.v1beta1.ListCertificateRevocationListsRequest").msgclass - ListCertificateRevocationListsResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.security.privateca.v1beta1.ListCertificateRevocationListsResponse").msgclass - UpdateCertificateRevocationListRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.security.privateca.v1beta1.UpdateCertificateRevocationListRequest").msgclass - GetReusableConfigRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.security.privateca.v1beta1.GetReusableConfigRequest").msgclass - ListReusableConfigsRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.security.privateca.v1beta1.ListReusableConfigsRequest").msgclass - ListReusableConfigsResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.security.privateca.v1beta1.ListReusableConfigsResponse").msgclass - OperationMetadata = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.security.privateca.v1beta1.OperationMetadata").msgclass - end - end - end - end -end diff --git a/owl-bot-staging/google-cloud-security-private_ca-v1beta1/lib/google/cloud/security/privateca/v1beta1/service_services_pb.rb b/owl-bot-staging/google-cloud-security-private_ca-v1beta1/lib/google/cloud/security/privateca/v1beta1/service_services_pb.rb deleted file mode 100644 index 5d3942b0c029..000000000000 --- a/owl-bot-staging/google-cloud-security-private_ca-v1beta1/lib/google/cloud/security/privateca/v1beta1/service_services_pb.rb +++ /dev/null @@ -1,99 +0,0 @@ -# Generated by the protocol buffer compiler. DO NOT EDIT! -# Source: google/cloud/security/privateca/v1beta1/service.proto for package 'Google.Cloud.Security.PrivateCA.V1beta1' -# Original file comments: -# 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 -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. -# - -require 'grpc' -require 'google/cloud/security/privateca/v1beta1/service_pb' - -module Google - module Cloud - module Security - module PrivateCA - module V1beta1 - module CertificateAuthorityService - # [Certificate Authority Service][google.cloud.security.privateca.v1beta1.CertificateAuthorityService] manages private - # certificate authorities and issued certificates. - class Service - - include ::GRPC::GenericService - - self.marshal_class_method = :encode - self.unmarshal_class_method = :decode - self.service_name = 'google.cloud.security.privateca.v1beta1.CertificateAuthorityService' - - # Create a new [Certificate][google.cloud.security.privateca.v1beta1.Certificate] in a given Project, Location from a particular - # [CertificateAuthority][google.cloud.security.privateca.v1beta1.CertificateAuthority]. - rpc :CreateCertificate, ::Google::Cloud::Security::PrivateCA::V1beta1::CreateCertificateRequest, ::Google::Cloud::Security::PrivateCA::V1beta1::Certificate - # Returns a [Certificate][google.cloud.security.privateca.v1beta1.Certificate]. - rpc :GetCertificate, ::Google::Cloud::Security::PrivateCA::V1beta1::GetCertificateRequest, ::Google::Cloud::Security::PrivateCA::V1beta1::Certificate - # Lists [Certificates][google.cloud.security.privateca.v1beta1.Certificate]. - rpc :ListCertificates, ::Google::Cloud::Security::PrivateCA::V1beta1::ListCertificatesRequest, ::Google::Cloud::Security::PrivateCA::V1beta1::ListCertificatesResponse - # Revoke a [Certificate][google.cloud.security.privateca.v1beta1.Certificate]. - rpc :RevokeCertificate, ::Google::Cloud::Security::PrivateCA::V1beta1::RevokeCertificateRequest, ::Google::Cloud::Security::PrivateCA::V1beta1::Certificate - # Update a [Certificate][google.cloud.security.privateca.v1beta1.Certificate]. Currently, the only field you can update is the - # [labels][google.cloud.security.privateca.v1beta1.Certificate.labels] field. - rpc :UpdateCertificate, ::Google::Cloud::Security::PrivateCA::V1beta1::UpdateCertificateRequest, ::Google::Cloud::Security::PrivateCA::V1beta1::Certificate - # Activate a [CertificateAuthority][google.cloud.security.privateca.v1beta1.CertificateAuthority] that is in state - # [PENDING_ACTIVATION][google.cloud.security.privateca.v1beta1.CertificateAuthority.State.PENDING_ACTIVATION] and is - # of type [SUBORDINATE][google.cloud.security.privateca.v1beta1.CertificateAuthority.Type.SUBORDINATE]. After the - # parent Certificate Authority signs a certificate signing request from - # [FetchCertificateAuthorityCsr][google.cloud.security.privateca.v1beta1.CertificateAuthorityService.FetchCertificateAuthorityCsr], this method can complete the activation - # process. - rpc :ActivateCertificateAuthority, ::Google::Cloud::Security::PrivateCA::V1beta1::ActivateCertificateAuthorityRequest, ::Google::Longrunning::Operation - # Create a new [CertificateAuthority][google.cloud.security.privateca.v1beta1.CertificateAuthority] in a given Project and Location. - rpc :CreateCertificateAuthority, ::Google::Cloud::Security::PrivateCA::V1beta1::CreateCertificateAuthorityRequest, ::Google::Longrunning::Operation - # Disable a [CertificateAuthority][google.cloud.security.privateca.v1beta1.CertificateAuthority]. - rpc :DisableCertificateAuthority, ::Google::Cloud::Security::PrivateCA::V1beta1::DisableCertificateAuthorityRequest, ::Google::Longrunning::Operation - # Enable a [CertificateAuthority][google.cloud.security.privateca.v1beta1.CertificateAuthority]. - rpc :EnableCertificateAuthority, ::Google::Cloud::Security::PrivateCA::V1beta1::EnableCertificateAuthorityRequest, ::Google::Longrunning::Operation - # Fetch a certificate signing request (CSR) from a [CertificateAuthority][google.cloud.security.privateca.v1beta1.CertificateAuthority] - # that is in state - # [PENDING_ACTIVATION][google.cloud.security.privateca.v1beta1.CertificateAuthority.State.PENDING_ACTIVATION] and is - # of type [SUBORDINATE][google.cloud.security.privateca.v1beta1.CertificateAuthority.Type.SUBORDINATE]. The CSR must - # then be signed by the desired parent Certificate Authority, which could be - # another [CertificateAuthority][google.cloud.security.privateca.v1beta1.CertificateAuthority] resource, or could be an on-prem - # certificate authority. See also [ActivateCertificateAuthority][google.cloud.security.privateca.v1beta1.CertificateAuthorityService.ActivateCertificateAuthority]. - rpc :FetchCertificateAuthorityCsr, ::Google::Cloud::Security::PrivateCA::V1beta1::FetchCertificateAuthorityCsrRequest, ::Google::Cloud::Security::PrivateCA::V1beta1::FetchCertificateAuthorityCsrResponse - # Returns a [CertificateAuthority][google.cloud.security.privateca.v1beta1.CertificateAuthority]. - rpc :GetCertificateAuthority, ::Google::Cloud::Security::PrivateCA::V1beta1::GetCertificateAuthorityRequest, ::Google::Cloud::Security::PrivateCA::V1beta1::CertificateAuthority - # Lists [CertificateAuthorities][google.cloud.security.privateca.v1beta1.CertificateAuthority]. - rpc :ListCertificateAuthorities, ::Google::Cloud::Security::PrivateCA::V1beta1::ListCertificateAuthoritiesRequest, ::Google::Cloud::Security::PrivateCA::V1beta1::ListCertificateAuthoritiesResponse - # Restore a [CertificateAuthority][google.cloud.security.privateca.v1beta1.CertificateAuthority] that is scheduled for deletion. - rpc :RestoreCertificateAuthority, ::Google::Cloud::Security::PrivateCA::V1beta1::RestoreCertificateAuthorityRequest, ::Google::Longrunning::Operation - # Schedule a [CertificateAuthority][google.cloud.security.privateca.v1beta1.CertificateAuthority] for deletion. - rpc :ScheduleDeleteCertificateAuthority, ::Google::Cloud::Security::PrivateCA::V1beta1::ScheduleDeleteCertificateAuthorityRequest, ::Google::Longrunning::Operation - # Update a [CertificateAuthority][google.cloud.security.privateca.v1beta1.CertificateAuthority]. - rpc :UpdateCertificateAuthority, ::Google::Cloud::Security::PrivateCA::V1beta1::UpdateCertificateAuthorityRequest, ::Google::Longrunning::Operation - # Returns a [CertificateRevocationList][google.cloud.security.privateca.v1beta1.CertificateRevocationList]. - rpc :GetCertificateRevocationList, ::Google::Cloud::Security::PrivateCA::V1beta1::GetCertificateRevocationListRequest, ::Google::Cloud::Security::PrivateCA::V1beta1::CertificateRevocationList - # Lists [CertificateRevocationLists][google.cloud.security.privateca.v1beta1.CertificateRevocationList]. - rpc :ListCertificateRevocationLists, ::Google::Cloud::Security::PrivateCA::V1beta1::ListCertificateRevocationListsRequest, ::Google::Cloud::Security::PrivateCA::V1beta1::ListCertificateRevocationListsResponse - # Update a [CertificateRevocationList][google.cloud.security.privateca.v1beta1.CertificateRevocationList]. - rpc :UpdateCertificateRevocationList, ::Google::Cloud::Security::PrivateCA::V1beta1::UpdateCertificateRevocationListRequest, ::Google::Longrunning::Operation - # Returns a [ReusableConfig][google.cloud.security.privateca.v1beta1.ReusableConfig]. - rpc :GetReusableConfig, ::Google::Cloud::Security::PrivateCA::V1beta1::GetReusableConfigRequest, ::Google::Cloud::Security::PrivateCA::V1beta1::ReusableConfig - # Lists [ReusableConfigs][google.cloud.security.privateca.v1beta1.ReusableConfig]. - rpc :ListReusableConfigs, ::Google::Cloud::Security::PrivateCA::V1beta1::ListReusableConfigsRequest, ::Google::Cloud::Security::PrivateCA::V1beta1::ListReusableConfigsResponse - end - - Stub = Service.rpc_stub_class - end - end - end - end - end -end diff --git a/owl-bot-staging/google-cloud-security-private_ca-v1beta1/proto_docs/README.md b/owl-bot-staging/google-cloud-security-private_ca-v1beta1/proto_docs/README.md deleted file mode 100644 index 3e513ef757bc..000000000000 --- a/owl-bot-staging/google-cloud-security-private_ca-v1beta1/proto_docs/README.md +++ /dev/null @@ -1,4 +0,0 @@ -# Certificate Authority Service V1beta1 Protocol Buffer Documentation - -These files are for the YARD documentation of the generated protobuf files. -They are not intended to be required or loaded at runtime. diff --git a/owl-bot-staging/google-cloud-security-private_ca-v1beta1/proto_docs/google/api/client.rb b/owl-bot-staging/google-cloud-security-private_ca-v1beta1/proto_docs/google/api/client.rb deleted file mode 100644 index 5089551e9ea4..000000000000 --- a/owl-bot-staging/google-cloud-security-private_ca-v1beta1/proto_docs/google/api/client.rb +++ /dev/null @@ -1,589 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - - -module Google - module Api - # Required information for every language. - # @!attribute [rw] reference_docs_uri - # @deprecated This field is deprecated and may be removed in the next major version update. - # @return [::String] - # Link to automatically generated reference documentation. Example: - # https://cloud.google.com/nodejs/docs/reference/asset/latest - # @!attribute [rw] destinations - # @return [::Array<::Google::Api::ClientLibraryDestination>] - # The destination where API teams want this client library to be published. - # @!attribute [rw] selective_gapic_generation - # @return [::Google::Api::SelectiveGapicGeneration] - # Configuration for which RPCs should be generated in the GAPIC client. - class CommonLanguageSettings - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Details about how and where to publish client libraries. - # @!attribute [rw] version - # @return [::String] - # Version of the API to apply these settings to. This is the full protobuf - # package for the API, ending in the version element. - # Examples: "google.cloud.speech.v1" and "google.spanner.admin.database.v1". - # @!attribute [rw] launch_stage - # @return [::Google::Api::LaunchStage] - # Launch stage of this version of the API. - # @!attribute [rw] rest_numeric_enums - # @return [::Boolean] - # When using transport=rest, the client request will encode enums as - # numbers rather than strings. - # @!attribute [rw] java_settings - # @return [::Google::Api::JavaSettings] - # Settings for legacy Java features, supported in the Service YAML. - # @!attribute [rw] cpp_settings - # @return [::Google::Api::CppSettings] - # Settings for C++ client libraries. - # @!attribute [rw] php_settings - # @return [::Google::Api::PhpSettings] - # Settings for PHP client libraries. - # @!attribute [rw] python_settings - # @return [::Google::Api::PythonSettings] - # Settings for Python client libraries. - # @!attribute [rw] node_settings - # @return [::Google::Api::NodeSettings] - # Settings for Node client libraries. - # @!attribute [rw] dotnet_settings - # @return [::Google::Api::DotnetSettings] - # Settings for .NET client libraries. - # @!attribute [rw] ruby_settings - # @return [::Google::Api::RubySettings] - # Settings for Ruby client libraries. - # @!attribute [rw] go_settings - # @return [::Google::Api::GoSettings] - # Settings for Go client libraries. - class ClientLibrarySettings - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # This message configures the settings for publishing [Google Cloud Client - # libraries](https://cloud.google.com/apis/docs/cloud-client-libraries) - # generated from the service config. - # @!attribute [rw] method_settings - # @return [::Array<::Google::Api::MethodSettings>] - # A list of API method settings, e.g. the behavior for methods that use the - # long-running operation pattern. - # @!attribute [rw] new_issue_uri - # @return [::String] - # Link to a *public* URI where users can report issues. Example: - # https://issuetracker.google.com/issues/new?component=190865&template=1161103 - # @!attribute [rw] documentation_uri - # @return [::String] - # Link to product home page. Example: - # https://cloud.google.com/asset-inventory/docs/overview - # @!attribute [rw] api_short_name - # @return [::String] - # Used as a tracking tag when collecting data about the APIs developer - # relations artifacts like docs, packages delivered to package managers, - # etc. Example: "speech". - # @!attribute [rw] github_label - # @return [::String] - # GitHub label to apply to issues and pull requests opened for this API. - # @!attribute [rw] codeowner_github_teams - # @return [::Array<::String>] - # GitHub teams to be added to CODEOWNERS in the directory in GitHub - # containing source code for the client libraries for this API. - # @!attribute [rw] doc_tag_prefix - # @return [::String] - # A prefix used in sample code when demarking regions to be included in - # documentation. - # @!attribute [rw] organization - # @return [::Google::Api::ClientLibraryOrganization] - # For whom the client library is being published. - # @!attribute [rw] library_settings - # @return [::Array<::Google::Api::ClientLibrarySettings>] - # Client library settings. If the same version string appears multiple - # times in this list, then the last one wins. Settings from earlier - # settings with the same version string are discarded. - # @!attribute [rw] proto_reference_documentation_uri - # @return [::String] - # Optional link to proto reference documentation. Example: - # https://cloud.google.com/pubsub/lite/docs/reference/rpc - # @!attribute [rw] rest_reference_documentation_uri - # @return [::String] - # Optional link to REST reference documentation. Example: - # https://cloud.google.com/pubsub/lite/docs/reference/rest - class Publishing - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Settings for Java client libraries. - # @!attribute [rw] library_package - # @return [::String] - # The package name to use in Java. Clobbers the java_package option - # set in the protobuf. This should be used **only** by APIs - # who have already set the language_settings.java.package_name" field - # in gapic.yaml. API teams should use the protobuf java_package option - # where possible. - # - # Example of a YAML configuration:: - # - # publishing: - # 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. - # @!attribute [rw] methods - # @return [::Array<::String>] - # An allowlist of the fully qualified names of RPCs that should be included - # on public client surfaces. - # @!attribute [rw] generate_omitted_as_internal - # @return [::Boolean] - # Setting this to true indicates to the client generators that methods - # that would be excluded from the generation should instead be generated - # in a way that indicates these methods should not be consumed by - # end users. How this is expressed is up to individual language - # implementations to decide. Some examples may be: added annotations, - # obfuscated identifiers, or other language idiomatic patterns. - class SelectiveGapicGeneration - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # `BatchingConfigProto` defines the batching configuration for an API method. - # @!attribute [rw] thresholds - # @return [::Google::Api::BatchingSettingsProto] - # The thresholds which trigger a batched request to be sent. - # @!attribute [rw] batch_descriptor - # @return [::Google::Api::BatchingDescriptorProto] - # The request and response fields used in batching. - class BatchingConfigProto - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # `BatchingSettingsProto` specifies a set of batching thresholds, each of - # which acts as a trigger to send a batch of messages as a request. At least - # one threshold must be positive nonzero. - # @!attribute [rw] element_count_threshold - # @return [::Integer] - # The number of elements of a field collected into a batch which, if - # exceeded, causes the batch to be sent. - # @!attribute [rw] request_byte_threshold - # @return [::Integer] - # The aggregated size of the batched field which, if exceeded, causes the - # batch to be sent. This size is computed by aggregating the sizes of the - # request field to be batched, not of the entire request message. - # @!attribute [rw] delay_threshold - # @return [::Google::Protobuf::Duration] - # The duration after which a batch should be sent, starting from the addition - # of the first message to that batch. - # @!attribute [rw] element_count_limit - # @return [::Integer] - # The maximum number of elements collected in a batch that could be accepted - # by server. - # @!attribute [rw] request_byte_limit - # @return [::Integer] - # The maximum size of the request that could be accepted by server. - # @!attribute [rw] flow_control_element_limit - # @return [::Integer] - # The maximum number of elements allowed by flow control. - # @!attribute [rw] flow_control_byte_limit - # @return [::Integer] - # The maximum size of data allowed by flow control. - # @!attribute [rw] flow_control_limit_exceeded_behavior - # @return [::Google::Api::FlowControlLimitExceededBehaviorProto] - # The behavior to take when the flow control limit is exceeded. - class BatchingSettingsProto - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # `BatchingDescriptorProto` specifies the fields of the request message to be - # used for batching, and, optionally, the fields of the response message to be - # used for demultiplexing. - # @!attribute [rw] batched_field - # @return [::String] - # The repeated field in the request message to be aggregated by batching. - # @!attribute [rw] discriminator_fields - # @return [::Array<::String>] - # A list of the fields in the request message. Two requests will be batched - # together only if the values of every field specified in - # `request_discriminator_fields` is equal between the two requests. - # @!attribute [rw] subresponse_field - # @return [::String] - # Optional. When present, indicates the field in the response message to be - # used to demultiplex the response into multiple response messages, in - # correspondence with the multiple request messages originally batched - # together. - class BatchingDescriptorProto - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # The organization for which the client libraries are being published. - # Affects the url where generated docs are published, etc. - module ClientLibraryOrganization - # Not useful. - CLIENT_LIBRARY_ORGANIZATION_UNSPECIFIED = 0 - - # Google Cloud Platform Org. - CLOUD = 1 - - # Ads (Advertising) Org. - ADS = 2 - - # Photos Org. - PHOTOS = 3 - - # Street View Org. - STREET_VIEW = 4 - - # Shopping Org. - SHOPPING = 5 - - # Geo Org. - GEO = 6 - - # Generative AI - https://developers.generativeai.google - GENERATIVE_AI = 7 - end - - # To where should client libraries be published? - module ClientLibraryDestination - # Client libraries will neither be generated nor published to package - # managers. - CLIENT_LIBRARY_DESTINATION_UNSPECIFIED = 0 - - # Generate the client library in a repo under github.com/googleapis, - # but don't publish it to package managers. - GITHUB = 10 - - # Publish the library to package managers like nuget.org and npmjs.com. - PACKAGE_MANAGER = 20 - end - - # The behavior to take when the flow control limit is exceeded. - module FlowControlLimitExceededBehaviorProto - # Default behavior, system-defined. - UNSET_BEHAVIOR = 0 - - # Stop operation, raise error. - THROW_EXCEPTION = 1 - - # Pause operation until limit clears. - BLOCK = 2 - - # Continue operation, disregard limit. - IGNORE = 3 - end - end -end diff --git a/owl-bot-staging/google-cloud-security-private_ca-v1beta1/proto_docs/google/api/field_behavior.rb b/owl-bot-staging/google-cloud-security-private_ca-v1beta1/proto_docs/google/api/field_behavior.rb deleted file mode 100644 index 582be187d115..000000000000 --- a/owl-bot-staging/google-cloud-security-private_ca-v1beta1/proto_docs/google/api/field_behavior.rb +++ /dev/null @@ -1,85 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - - -module Google - module Api - # An indicator of the behavior of a given field (for example, that a field - # is required in requests, or given as output but ignored as input). - # This **does not** change the behavior in protocol buffers itself; it only - # denotes the behavior and may affect how API tooling handles the field. - # - # Note: This enum **may** receive new values in the future. - module FieldBehavior - # Conventional default for enums. Do not use this. - FIELD_BEHAVIOR_UNSPECIFIED = 0 - - # Specifically denotes a field as optional. - # While all fields in protocol buffers are optional, this may be specified - # for emphasis if appropriate. - OPTIONAL = 1 - - # Denotes a field as required. - # This indicates that the field **must** be provided as part of the request, - # and failure to do so will cause an error (usually `INVALID_ARGUMENT`). - REQUIRED = 2 - - # Denotes a field as output only. - # This indicates that the field is provided in responses, but including the - # field in a request does nothing (the server *must* ignore it and - # *must not* throw an error as a result of the field's presence). - OUTPUT_ONLY = 3 - - # Denotes a field as input only. - # This indicates that the field is provided in requests, and the - # corresponding field is not included in output. - INPUT_ONLY = 4 - - # Denotes a field as immutable. - # This indicates that the field may be set once in a request to create a - # resource, but may not be changed thereafter. - IMMUTABLE = 5 - - # Denotes that a (repeated) field is an unordered list. - # This indicates that the service may provide the elements of the list - # in any arbitrary order, rather than the order the user originally - # provided. Additionally, the list's order may or may not be stable. - UNORDERED_LIST = 6 - - # Denotes that this field returns a non-empty default value if not set. - # This indicates that if the user provides the empty value in a request, - # a non-empty value will be returned. The user will not be aware of what - # non-empty value to expect. - NON_EMPTY_DEFAULT = 7 - - # Denotes that the field in a resource (a message annotated with - # google.api.resource) is used in the resource name to uniquely identify the - # resource. For AIP-compliant APIs, this should only be applied to the - # `name` field on the resource. - # - # This behavior should not be applied to references to other resources within - # the message. - # - # The identifier field of resources often have different field behavior - # depending on the request it is embedded in (e.g. for Create methods name - # is optional and unused, while for Update methods it is required). Instead - # of method-specific annotations, only `IDENTIFIER` is required. - IDENTIFIER = 8 - end - end -end diff --git a/owl-bot-staging/google-cloud-security-private_ca-v1beta1/proto_docs/google/api/launch_stage.rb b/owl-bot-staging/google-cloud-security-private_ca-v1beta1/proto_docs/google/api/launch_stage.rb deleted file mode 100644 index 9392a413fb1b..000000000000 --- a/owl-bot-staging/google-cloud-security-private_ca-v1beta1/proto_docs/google/api/launch_stage.rb +++ /dev/null @@ -1,71 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - - -module Google - module Api - # The launch stage as defined by [Google Cloud Platform - # Launch Stages](https://cloud.google.com/terms/launch-stages). - module LaunchStage - # Do not use this default value. - LAUNCH_STAGE_UNSPECIFIED = 0 - - # The feature is not yet implemented. Users can not use it. - UNIMPLEMENTED = 6 - - # Prelaunch features are hidden from users and are only visible internally. - PRELAUNCH = 7 - - # Early Access features are limited to a closed group of testers. To use - # these features, you must sign up in advance and sign a Trusted Tester - # agreement (which includes confidentiality provisions). These features may - # be unstable, changed in backward-incompatible ways, and are not - # guaranteed to be released. - EARLY_ACCESS = 1 - - # Alpha is a limited availability test for releases before they are cleared - # for widespread use. By Alpha, all significant design issues are resolved - # and we are in the process of verifying functionality. Alpha customers - # need to apply for access, agree to applicable terms, and have their - # projects allowlisted. Alpha releases don't have to be feature complete, - # no SLAs are provided, and there are no technical support obligations, but - # they will be far enough along that customers can actually use them in - # test environments or for limited-use tests -- just like they would in - # normal production cases. - ALPHA = 2 - - # Beta is the point at which we are ready to open a release for any - # customer to use. There are no SLA or technical support obligations in a - # Beta release. Products will be complete from a feature perspective, but - # may have some open outstanding issues. Beta releases are suitable for - # limited production use cases. - BETA = 3 - - # GA features are open to all developers and are considered stable and - # fully qualified for production use. - GA = 4 - - # Deprecated features are scheduled to be shut down and removed. For more - # information, see the "Deprecation Policy" section of our [Terms of - # Service](https://cloud.google.com/terms/) - # and the [Google Cloud Platform Subject to the Deprecation - # Policy](https://cloud.google.com/terms/deprecation) documentation. - DEPRECATED = 5 - end - end -end diff --git a/owl-bot-staging/google-cloud-security-private_ca-v1beta1/proto_docs/google/api/resource.rb b/owl-bot-staging/google-cloud-security-private_ca-v1beta1/proto_docs/google/api/resource.rb deleted file mode 100644 index 25dec4847ac1..000000000000 --- a/owl-bot-staging/google-cloud-security-private_ca-v1beta1/proto_docs/google/api/resource.rb +++ /dev/null @@ -1,227 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - - -module Google - module Api - # A simple descriptor of a resource type. - # - # ResourceDescriptor annotates a resource message (either by means of a - # protobuf annotation or use in the service config), and associates the - # resource's schema, the resource type, and the pattern of the resource name. - # - # Example: - # - # message Topic { - # // Indicates this message defines a resource schema. - # // Declares the resource type in the format of {service}/{kind}. - # // For Kubernetes resources, the format is {api group}/{kind}. - # option (google.api.resource) = { - # type: "pubsub.googleapis.com/Topic" - # pattern: "projects/{project}/topics/{topic}" - # }; - # } - # - # The ResourceDescriptor Yaml config will look like: - # - # resources: - # - type: "pubsub.googleapis.com/Topic" - # pattern: "projects/{project}/topics/{topic}" - # - # Sometimes, resources have multiple patterns, typically because they can - # live under multiple parents. - # - # Example: - # - # message LogEntry { - # option (google.api.resource) = { - # type: "logging.googleapis.com/LogEntry" - # pattern: "projects/{project}/logs/{log}" - # pattern: "folders/{folder}/logs/{log}" - # pattern: "organizations/{organization}/logs/{log}" - # pattern: "billingAccounts/{billing_account}/logs/{log}" - # }; - # } - # - # The ResourceDescriptor Yaml config will look like: - # - # resources: - # - type: 'logging.googleapis.com/LogEntry' - # pattern: "projects/{project}/logs/{log}" - # pattern: "folders/{folder}/logs/{log}" - # pattern: "organizations/{organization}/logs/{log}" - # pattern: "billingAccounts/{billing_account}/logs/{log}" - # @!attribute [rw] type - # @return [::String] - # The resource type. It must be in the format of - # \\{service_name}/\\{resource_type_kind}. The `resource_type_kind` must be - # singular and must not include version numbers. - # - # Example: `storage.googleapis.com/Bucket` - # - # The value of the resource_type_kind must follow the regular expression - # /[A-Za-z][a-zA-Z0-9]+/. It should start with an upper case character and - # should use PascalCase (UpperCamelCase). The maximum number of - # characters allowed for the `resource_type_kind` is 100. - # @!attribute [rw] pattern - # @return [::Array<::String>] - # Optional. The relative resource name pattern associated with this resource - # type. The DNS prefix of the full resource name shouldn't be specified here. - # - # The path pattern must follow the syntax, which aligns with HTTP binding - # syntax: - # - # Template = Segment { "/" Segment } ; - # Segment = LITERAL | Variable ; - # Variable = "{" LITERAL "}" ; - # - # Examples: - # - # - "projects/\\{project}/topics/\\{topic}" - # - "projects/\\{project}/knowledgeBases/\\{knowledge_base}" - # - # The components in braces correspond to the IDs for each resource in the - # hierarchy. It is expected that, if multiple patterns are provided, - # the same component name (e.g. "project") refers to IDs of the same - # type of resource. - # @!attribute [rw] name_field - # @return [::String] - # Optional. The field on the resource that designates the resource name - # field. If omitted, this is assumed to be "name". - # @!attribute [rw] history - # @return [::Google::Api::ResourceDescriptor::History] - # Optional. The historical or future-looking state of the resource pattern. - # - # Example: - # - # // The InspectTemplate message originally only supported resource - # // names with organization, and project was added later. - # message InspectTemplate { - # option (google.api.resource) = { - # type: "dlp.googleapis.com/InspectTemplate" - # pattern: - # "organizations/{organization}/inspectTemplates/{inspect_template}" - # pattern: "projects/{project}/inspectTemplates/{inspect_template}" - # history: ORIGINALLY_SINGLE_PATTERN - # }; - # } - # @!attribute [rw] plural - # @return [::String] - # The plural name used in the resource name and permission names, such as - # 'projects' for the resource name of 'projects/\\{project}' and the permission - # name of 'cloudresourcemanager.googleapis.com/projects.get'. One exception - # to this is for Nested Collections that have stuttering names, as defined - # in [AIP-122](https://google.aip.dev/122#nested-collections), where the - # collection ID in the resource name pattern does not necessarily directly - # match the `plural` value. - # - # It is the same concept of the `plural` field in k8s CRD spec - # https://kubernetes.io/docs/tasks/access-kubernetes-api/custom-resources/custom-resource-definitions/ - # - # Note: The plural form is required even for singleton resources. See - # https://aip.dev/156 - # @!attribute [rw] singular - # @return [::String] - # The same concept of the `singular` field in k8s CRD spec - # https://kubernetes.io/docs/tasks/access-kubernetes-api/custom-resources/custom-resource-definitions/ - # Such as "project" for the `resourcemanager.googleapis.com/Project` type. - # @!attribute [rw] style - # @return [::Array<::Google::Api::ResourceDescriptor::Style>] - # Style flag(s) for this resource. - # These indicate that a resource is expected to conform to a given - # style. See the specific style flags for additional information. - class ResourceDescriptor - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - - # A description of the historical or future-looking state of the - # resource pattern. - module History - # The "unset" value. - HISTORY_UNSPECIFIED = 0 - - # The resource originally had one pattern and launched as such, and - # additional patterns were added later. - ORIGINALLY_SINGLE_PATTERN = 1 - - # The resource has one pattern, but the API owner expects to add more - # later. (This is the inverse of ORIGINALLY_SINGLE_PATTERN, and prevents - # that from being necessary once there are multiple patterns.) - FUTURE_MULTI_PATTERN = 2 - end - - # A flag representing a specific style that a resource claims to conform to. - module Style - # The unspecified value. Do not use. - STYLE_UNSPECIFIED = 0 - - # This resource is intended to be "declarative-friendly". - # - # Declarative-friendly resources must be more strictly consistent, and - # setting this to true communicates to tools that this resource should - # adhere to declarative-friendly expectations. - # - # Note: This is used by the API linter (linter.aip.dev) to enable - # additional checks. - DECLARATIVE_FRIENDLY = 1 - end - end - - # Defines a proto annotation that describes a string field that refers to - # an API resource. - # @!attribute [rw] type - # @return [::String] - # The resource type that the annotated field references. - # - # Example: - # - # message Subscription { - # string topic = 2 [(google.api.resource_reference) = { - # type: "pubsub.googleapis.com/Topic" - # }]; - # } - # - # Occasionally, a field may reference an arbitrary resource. In this case, - # APIs use the special value * in their resource reference. - # - # Example: - # - # message GetIamPolicyRequest { - # string resource = 2 [(google.api.resource_reference) = { - # type: "*" - # }]; - # } - # @!attribute [rw] child_type - # @return [::String] - # The resource type of a child collection that the annotated field - # references. This is useful for annotating the `parent` field that - # doesn't have a fixed resource type. - # - # Example: - # - # message ListLogEntriesRequest { - # string parent = 1 [(google.api.resource_reference) = { - # child_type: "logging.googleapis.com/LogEntry" - # }; - # } - class ResourceReference - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - end -end diff --git a/owl-bot-staging/google-cloud-security-private_ca-v1beta1/proto_docs/google/cloud/security/privateca/v1beta1/resources.rb b/owl-bot-staging/google-cloud-security-private_ca-v1beta1/proto_docs/google/cloud/security/privateca/v1beta1/resources.rb deleted file mode 100644 index 195a33eff695..000000000000 --- a/owl-bot-staging/google-cloud-security-private_ca-v1beta1/proto_docs/google/cloud/security/privateca/v1beta1/resources.rb +++ /dev/null @@ -1,1001 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - - -module Google - module Cloud - module Security - module PrivateCA - module V1beta1 - # A {::Google::Cloud::Security::PrivateCA::V1beta1::CertificateAuthority CertificateAuthority} represents an individual Certificate Authority. - # A {::Google::Cloud::Security::PrivateCA::V1beta1::CertificateAuthority CertificateAuthority} can be used to create {::Google::Cloud::Security::PrivateCA::V1beta1::Certificate Certificates}. - # @!attribute [r] name - # @return [::String] - # Output only. The resource name for this {::Google::Cloud::Security::PrivateCA::V1beta1::CertificateAuthority CertificateAuthority} in the - # format `projects/*/locations/*/certificateAuthorities/*`. - # @!attribute [rw] type - # @return [::Google::Cloud::Security::PrivateCA::V1beta1::CertificateAuthority::Type] - # Required. Immutable. The {::Google::Cloud::Security::PrivateCA::V1beta1::CertificateAuthority::Type Type} of this {::Google::Cloud::Security::PrivateCA::V1beta1::CertificateAuthority CertificateAuthority}. - # @!attribute [rw] tier - # @return [::Google::Cloud::Security::PrivateCA::V1beta1::CertificateAuthority::Tier] - # Required. Immutable. The {::Google::Cloud::Security::PrivateCA::V1beta1::CertificateAuthority::Tier Tier} of this {::Google::Cloud::Security::PrivateCA::V1beta1::CertificateAuthority CertificateAuthority}. - # @!attribute [rw] config - # @return [::Google::Cloud::Security::PrivateCA::V1beta1::CertificateConfig] - # Required. Immutable. The config used to create a self-signed X.509 certificate or CSR. - # @!attribute [rw] lifetime - # @return [::Google::Protobuf::Duration] - # Required. The desired lifetime of the CA certificate. Used to create the - # "not_before_time" and "not_after_time" fields inside an X.509 - # certificate. - # @!attribute [rw] key_spec - # @return [::Google::Cloud::Security::PrivateCA::V1beta1::CertificateAuthority::KeyVersionSpec] - # Required. Immutable. Used when issuing certificates for this {::Google::Cloud::Security::PrivateCA::V1beta1::CertificateAuthority CertificateAuthority}. If this - # {::Google::Cloud::Security::PrivateCA::V1beta1::CertificateAuthority CertificateAuthority} is a self-signed CertificateAuthority, this key - # is also used to sign the self-signed CA certificate. Otherwise, it - # is used to sign a CSR. - # @!attribute [rw] certificate_policy - # @return [::Google::Cloud::Security::PrivateCA::V1beta1::CertificateAuthority::CertificateAuthorityPolicy] - # Optional. The {::Google::Cloud::Security::PrivateCA::V1beta1::CertificateAuthority::CertificateAuthorityPolicy CertificateAuthorityPolicy} to enforce when issuing - # {::Google::Cloud::Security::PrivateCA::V1beta1::Certificate Certificates} from this {::Google::Cloud::Security::PrivateCA::V1beta1::CertificateAuthority CertificateAuthority}. - # @!attribute [rw] issuing_options - # @return [::Google::Cloud::Security::PrivateCA::V1beta1::CertificateAuthority::IssuingOptions] - # Optional. The {::Google::Cloud::Security::PrivateCA::V1beta1::CertificateAuthority::IssuingOptions IssuingOptions} to follow when issuing {::Google::Cloud::Security::PrivateCA::V1beta1::Certificate Certificates} - # from this {::Google::Cloud::Security::PrivateCA::V1beta1::CertificateAuthority CertificateAuthority}. - # @!attribute [rw] subordinate_config - # @return [::Google::Cloud::Security::PrivateCA::V1beta1::SubordinateConfig] - # Optional. If this is a subordinate {::Google::Cloud::Security::PrivateCA::V1beta1::CertificateAuthority CertificateAuthority}, this field will be set - # with the subordinate configuration, which describes its issuers. This may - # be updated, but this {::Google::Cloud::Security::PrivateCA::V1beta1::CertificateAuthority CertificateAuthority} must continue to validate. - # @!attribute [r] state - # @return [::Google::Cloud::Security::PrivateCA::V1beta1::CertificateAuthority::State] - # Output only. The {::Google::Cloud::Security::PrivateCA::V1beta1::CertificateAuthority::State State} for this {::Google::Cloud::Security::PrivateCA::V1beta1::CertificateAuthority CertificateAuthority}. - # @!attribute [r] pem_ca_certificates - # @return [::Array<::String>] - # Output only. This {::Google::Cloud::Security::PrivateCA::V1beta1::CertificateAuthority CertificateAuthority}'s certificate chain, including the current - # {::Google::Cloud::Security::PrivateCA::V1beta1::CertificateAuthority CertificateAuthority}'s certificate. Ordered such that the root issuer - # is the final element (consistent with RFC 5246). For a self-signed CA, this - # will only list the current {::Google::Cloud::Security::PrivateCA::V1beta1::CertificateAuthority CertificateAuthority}'s certificate. - # @!attribute [r] ca_certificate_descriptions - # @return [::Array<::Google::Cloud::Security::PrivateCA::V1beta1::CertificateDescription>] - # Output only. A structured description of this {::Google::Cloud::Security::PrivateCA::V1beta1::CertificateAuthority CertificateAuthority}'s CA certificate - # and its issuers. Ordered as self-to-root. - # @!attribute [rw] gcs_bucket - # @return [::String] - # Immutable. The name of a Cloud Storage bucket where this {::Google::Cloud::Security::PrivateCA::V1beta1::CertificateAuthority CertificateAuthority} will - # publish content, such as the CA certificate and CRLs. This must be a bucket - # name, without any prefixes (such as `gs://`) or suffixes (such as - # `.googleapis.com`). For example, to use a bucket named `my-bucket`, you - # would simply specify `my-bucket`. If not specified, a managed bucket will - # be created. - # @!attribute [r] access_urls - # @return [::Google::Cloud::Security::PrivateCA::V1beta1::CertificateAuthority::AccessUrls] - # Output only. URLs for accessing content published by this CA, such as the CA certificate - # and CRLs. - # @!attribute [r] create_time - # @return [::Google::Protobuf::Timestamp] - # Output only. The time at which this {::Google::Cloud::Security::PrivateCA::V1beta1::CertificateAuthority CertificateAuthority} was created. - # @!attribute [r] update_time - # @return [::Google::Protobuf::Timestamp] - # Output only. The time at which this {::Google::Cloud::Security::PrivateCA::V1beta1::CertificateAuthority CertificateAuthority} was updated. - # @!attribute [r] delete_time - # @return [::Google::Protobuf::Timestamp] - # Output only. The time at which this {::Google::Cloud::Security::PrivateCA::V1beta1::CertificateAuthority CertificateAuthority} will be deleted, if - # scheduled for deletion. - # @!attribute [rw] labels - # @return [::Google::Protobuf::Map{::String => ::String}] - # Optional. Labels with user-defined metadata. - class CertificateAuthority - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - - # Options that affect all certificates issued by a {::Google::Cloud::Security::PrivateCA::V1beta1::CertificateAuthority CertificateAuthority}. - # @!attribute [rw] include_ca_cert_url - # @return [::Boolean] - # Required. When true, includes a URL to the issuing CA certificate in the - # "authority information access" X.509 extension. - # @!attribute [rw] include_crl_access_url - # @return [::Boolean] - # Required. When true, includes a URL to the CRL corresponding to certificates - # issued from a {::Google::Cloud::Security::PrivateCA::V1beta1::CertificateAuthority CertificateAuthority}. - # CRLs will expire 7 days from their creation. However, we will rebuild - # daily. CRLs are also rebuilt shortly after a certificate is revoked. - class IssuingOptions - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # The issuing policy for a {::Google::Cloud::Security::PrivateCA::V1beta1::CertificateAuthority CertificateAuthority}. - # {::Google::Cloud::Security::PrivateCA::V1beta1::Certificate Certificates} will not be successfully issued from this - # {::Google::Cloud::Security::PrivateCA::V1beta1::CertificateAuthority CertificateAuthority} if they violate the policy. - # @!attribute [rw] allowed_config_list - # @return [::Google::Cloud::Security::PrivateCA::V1beta1::CertificateAuthority::CertificateAuthorityPolicy::AllowedConfigList] - # Optional. All {::Google::Cloud::Security::PrivateCA::V1beta1::Certificate Certificates} issued by the {::Google::Cloud::Security::PrivateCA::V1beta1::CertificateAuthority CertificateAuthority} - # must match at least one listed {::Google::Cloud::Security::PrivateCA::V1beta1::ReusableConfigWrapper ReusableConfigWrapper} in the list. - # - # Note: The following fields are mutually exclusive: `allowed_config_list`, `overwrite_config_values`. If a field in that set is populated, all other fields in the set will automatically be cleared. - # @!attribute [rw] overwrite_config_values - # @return [::Google::Cloud::Security::PrivateCA::V1beta1::ReusableConfigWrapper] - # Optional. All {::Google::Cloud::Security::PrivateCA::V1beta1::Certificate Certificates} issued by the {::Google::Cloud::Security::PrivateCA::V1beta1::CertificateAuthority CertificateAuthority} - # will use the provided configuration values, overwriting any requested - # configuration values. - # - # Note: The following fields are mutually exclusive: `overwrite_config_values`, `allowed_config_list`. If a field in that set is populated, all other fields in the set will automatically be cleared. - # @!attribute [rw] allowed_locations_and_organizations - # @return [::Array<::Google::Cloud::Security::PrivateCA::V1beta1::Subject>] - # Optional. If any {::Google::Cloud::Security::PrivateCA::V1beta1::Subject Subject} is specified here, then all - # {::Google::Cloud::Security::PrivateCA::V1beta1::Certificate Certificates} issued by the {::Google::Cloud::Security::PrivateCA::V1beta1::CertificateAuthority CertificateAuthority} must - # match at least one listed {::Google::Cloud::Security::PrivateCA::V1beta1::Subject Subject}. If a {::Google::Cloud::Security::PrivateCA::V1beta1::Subject Subject} has an empty - # field, any value will be allowed for that field. - # @!attribute [rw] allowed_common_names - # @return [::Array<::String>] - # Optional. If any value is specified here, then all - # {::Google::Cloud::Security::PrivateCA::V1beta1::Certificate Certificates} issued by the {::Google::Cloud::Security::PrivateCA::V1beta1::CertificateAuthority CertificateAuthority} must - # match at least one listed value. If no value is specified, all values - # will be allowed for this fied. Glob patterns are also supported. - # @!attribute [rw] allowed_sans - # @return [::Google::Cloud::Security::PrivateCA::V1beta1::CertificateAuthority::CertificateAuthorityPolicy::AllowedSubjectAltNames] - # Optional. If a {::Google::Cloud::Security::PrivateCA::V1beta1::CertificateAuthority::CertificateAuthorityPolicy::AllowedSubjectAltNames AllowedSubjectAltNames} is specified here, then all - # {::Google::Cloud::Security::PrivateCA::V1beta1::Certificate Certificates} issued by the {::Google::Cloud::Security::PrivateCA::V1beta1::CertificateAuthority CertificateAuthority} must - # match {::Google::Cloud::Security::PrivateCA::V1beta1::CertificateAuthority::CertificateAuthorityPolicy::AllowedSubjectAltNames AllowedSubjectAltNames}. If no value or an empty value - # is specified, any value will be allowed for the {::Google::Cloud::Security::PrivateCA::V1beta1::SubjectAltNames SubjectAltNames} - # field. - # @!attribute [rw] maximum_lifetime - # @return [::Google::Protobuf::Duration] - # Optional. The maximum lifetime allowed by the {::Google::Cloud::Security::PrivateCA::V1beta1::CertificateAuthority CertificateAuthority}. Note that - # if the any part if the issuing chain expires before a {::Google::Cloud::Security::PrivateCA::V1beta1::Certificate Certificate}'s - # requested maximum_lifetime, the effective lifetime will be explicitly - # truncated. - # @!attribute [rw] allowed_issuance_modes - # @return [::Google::Cloud::Security::PrivateCA::V1beta1::CertificateAuthority::CertificateAuthorityPolicy::IssuanceModes] - # Optional. If specified, then only methods allowed in the {::Google::Cloud::Security::PrivateCA::V1beta1::CertificateAuthority::CertificateAuthorityPolicy::IssuanceModes IssuanceModes} may be - # used to issue {::Google::Cloud::Security::PrivateCA::V1beta1::Certificate Certificates}. - class CertificateAuthorityPolicy - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - - # @!attribute [rw] allowed_config_values - # @return [::Array<::Google::Cloud::Security::PrivateCA::V1beta1::ReusableConfigWrapper>] - # Required. All {::Google::Cloud::Security::PrivateCA::V1beta1::Certificate Certificates} issued by the {::Google::Cloud::Security::PrivateCA::V1beta1::CertificateAuthority CertificateAuthority} - # must match at least one listed {::Google::Cloud::Security::PrivateCA::V1beta1::ReusableConfigWrapper ReusableConfigWrapper}. If a - # {::Google::Cloud::Security::PrivateCA::V1beta1::ReusableConfigWrapper ReusableConfigWrapper} has an empty field, any value will be - # allowed for that field. - class AllowedConfigList - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # {::Google::Cloud::Security::PrivateCA::V1beta1::CertificateAuthority::CertificateAuthorityPolicy::AllowedSubjectAltNames AllowedSubjectAltNames} specifies the allowed values for - # {::Google::Cloud::Security::PrivateCA::V1beta1::SubjectAltNames SubjectAltNames} by the {::Google::Cloud::Security::PrivateCA::V1beta1::CertificateAuthority CertificateAuthority} when issuing - # {::Google::Cloud::Security::PrivateCA::V1beta1::Certificate Certificates}. - # @!attribute [rw] allowed_dns_names - # @return [::Array<::String>] - # Optional. Contains valid, fully-qualified host names. Glob patterns are also - # supported. To allow an explicit wildcard certificate, escape with - # backlash (i.e. `\*`). - # E.g. for globbed entries: `*bar.com` will allow `foo.bar.com`, but not - # `*.bar.com`, unless the {::Google::Cloud::Security::PrivateCA::V1beta1::CertificateAuthority::CertificateAuthorityPolicy::AllowedSubjectAltNames#allow_globbing_dns_wildcards allow_globbing_dns_wildcards} field is set. - # E.g. for wildcard entries: `\*.bar.com` will allow `*.bar.com`, but not - # `foo.bar.com`. - # @!attribute [rw] allowed_uris - # @return [::Array<::String>] - # Optional. Contains valid RFC 3986 URIs. Glob patterns are also supported. To - # match across path seperators (i.e. '/') use the double star glob - # pattern (i.e. '**'). - # @!attribute [rw] allowed_email_addresses - # @return [::Array<::String>] - # Optional. Contains valid RFC 2822 E-mail addresses. Glob patterns are also - # supported. - # @!attribute [rw] allowed_ips - # @return [::Array<::String>] - # Optional. Contains valid 32-bit IPv4 addresses and subnet ranges or RFC 4291 IPv6 - # addresses and subnet ranges. Subnet ranges are specified using the - # '/' notation (e.g. 10.0.0.0/8, 2001:700:300:1800::/64). Glob patterns - # are supported only for ip address entries (i.e. not for subnet ranges). - # @!attribute [rw] allow_globbing_dns_wildcards - # @return [::Boolean] - # Optional. Specifies if glob patterns used for {::Google::Cloud::Security::PrivateCA::V1beta1::CertificateAuthority::CertificateAuthorityPolicy::AllowedSubjectAltNames#allowed_dns_names allowed_dns_names} allows - # wildcard certificates. - # @!attribute [rw] allow_custom_sans - # @return [::Boolean] - # Optional. Specifies if to allow custom X509Extension values. - class AllowedSubjectAltNames - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # {::Google::Cloud::Security::PrivateCA::V1beta1::CertificateAuthority::CertificateAuthorityPolicy::IssuanceModes IssuanceModes} specifies the allowed ways in which - # {::Google::Cloud::Security::PrivateCA::V1beta1::Certificate Certificates} may be requested from this - # {::Google::Cloud::Security::PrivateCA::V1beta1::CertificateAuthority CertificateAuthority}. - # @!attribute [rw] allow_csr_based_issuance - # @return [::Boolean] - # Required. When true, allows callers to create {::Google::Cloud::Security::PrivateCA::V1beta1::Certificate Certificates} by - # specifying a CSR. - # @!attribute [rw] allow_config_based_issuance - # @return [::Boolean] - # Required. When true, allows callers to create {::Google::Cloud::Security::PrivateCA::V1beta1::Certificate Certificates} by - # specifying a {::Google::Cloud::Security::PrivateCA::V1beta1::CertificateConfig CertificateConfig}. - class IssuanceModes - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - end - - # URLs where a {::Google::Cloud::Security::PrivateCA::V1beta1::CertificateAuthority CertificateAuthority} will publish content. - # @!attribute [rw] ca_certificate_access_url - # @return [::String] - # The URL where this {::Google::Cloud::Security::PrivateCA::V1beta1::CertificateAuthority CertificateAuthority}'s CA certificate is - # published. This will only be set for CAs that have been activated. - # @!attribute [rw] crl_access_url - # @return [::String] - # The URL where this {::Google::Cloud::Security::PrivateCA::V1beta1::CertificateAuthority CertificateAuthority}'s CRLs are published. This - # will only be set for CAs that have been activated. - class AccessUrls - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # A Cloud KMS key configuration that a {::Google::Cloud::Security::PrivateCA::V1beta1::CertificateAuthority CertificateAuthority} will use. - # @!attribute [rw] cloud_kms_key_version - # @return [::String] - # Required. The resource name for an existing Cloud KMS CryptoKeyVersion in the - # format - # `projects/*/locations/*/keyRings/*/cryptoKeys/*/cryptoKeyVersions/*`. - # This option enables full flexibility in the key's capabilities and - # properties. - # - # Note: The following fields are mutually exclusive: `cloud_kms_key_version`, `algorithm`. If a field in that set is populated, all other fields in the set will automatically be cleared. - # @!attribute [rw] algorithm - # @return [::Google::Cloud::Security::PrivateCA::V1beta1::CertificateAuthority::SignHashAlgorithm] - # Required. The algorithm to use for creating a managed Cloud KMS key for a for a - # simplified experience. All managed keys will be have their - # [ProtectionLevel][google.cloud.kms.v1.ProtectionLevel] as `HSM`. - # - # Note: The following fields are mutually exclusive: `algorithm`, `cloud_kms_key_version`. If a field in that set is populated, all other fields in the set will automatically be cleared. - class KeyVersionSpec - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # @!attribute [rw] key - # @return [::String] - # @!attribute [rw] value - # @return [::String] - class LabelsEntry - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # The type of a {::Google::Cloud::Security::PrivateCA::V1beta1::CertificateAuthority CertificateAuthority}, indicating its issuing chain. - module Type - # Not specified. - TYPE_UNSPECIFIED = 0 - - # Self-signed CA. - SELF_SIGNED = 1 - - # Subordinate CA. Could be issued by a Private CA {::Google::Cloud::Security::PrivateCA::V1beta1::CertificateAuthority CertificateAuthority} - # or an unmanaged CA. - SUBORDINATE = 2 - end - - # The tier of a {::Google::Cloud::Security::PrivateCA::V1beta1::CertificateAuthority CertificateAuthority}, indicating its supported - # functionality and/or billing SKU. - module Tier - # Not specified. - TIER_UNSPECIFIED = 0 - - # Enterprise tier. - ENTERPRISE = 1 - - # DevOps tier. - DEVOPS = 2 - end - - # The state of a {::Google::Cloud::Security::PrivateCA::V1beta1::CertificateAuthority CertificateAuthority}, indicating if it can be used. - module State - # Not specified. - STATE_UNSPECIFIED = 0 - - # Certificates can be issued from this CA. CRLs will be generated for this - # CA. - ENABLED = 1 - - # Certificates cannot be issued from this CA. CRLs will still be generated. - DISABLED = 2 - - # Certificates cannot be issued from this CA. CRLs will not be generated. - PENDING_ACTIVATION = 3 - - # Certificates cannot be issued from this CA. CRLs will not be generated. - PENDING_DELETION = 4 - end - - # The algorithm of a Cloud KMS CryptoKeyVersion of a - # [CryptoKey][google.cloud.kms.v1.CryptoKey] with the - # [CryptoKeyPurpose][google.cloud.kms.v1.CryptoKey.CryptoKeyPurpose] value - # `ASYMMETRIC_SIGN`. These values correspond to the - # [CryptoKeyVersionAlgorithm][google.cloud.kms.v1.CryptoKeyVersion.CryptoKeyVersionAlgorithm] - # values. For RSA signing algorithms, the PSS algorithms should be preferred, - # use PKCS1 algorithms if required for compatibility. For further - # recommandations, see - # https://cloud.google.com/kms/docs/algorithms#algorithm_recommendations. - module SignHashAlgorithm - # Not specified. - SIGN_HASH_ALGORITHM_UNSPECIFIED = 0 - - # maps to CryptoKeyVersionAlgorithm.RSA_SIGN_PSS_2048_SHA256 - RSA_PSS_2048_SHA256 = 1 - - # maps to CryptoKeyVersionAlgorithm. RSA_SIGN_PSS_3072_SHA256 - RSA_PSS_3072_SHA256 = 2 - - # maps to CryptoKeyVersionAlgorithm.RSA_SIGN_PSS_4096_SHA256 - RSA_PSS_4096_SHA256 = 3 - - # maps to CryptoKeyVersionAlgorithm.RSA_SIGN_PKCS1_2048_SHA256 - RSA_PKCS1_2048_SHA256 = 6 - - # maps to CryptoKeyVersionAlgorithm.RSA_SIGN_PKCS1_3072_SHA256 - RSA_PKCS1_3072_SHA256 = 7 - - # maps to CryptoKeyVersionAlgorithm.RSA_SIGN_PKCS1_4096_SHA256 - RSA_PKCS1_4096_SHA256 = 8 - - # maps to CryptoKeyVersionAlgorithm.EC_SIGN_P256_SHA256 - EC_P256_SHA256 = 4 - - # maps to CryptoKeyVersionAlgorithm.EC_SIGN_P384_SHA384 - EC_P384_SHA384 = 5 - end - end - - # A {::Google::Cloud::Security::PrivateCA::V1beta1::CertificateRevocationList CertificateRevocationList} corresponds to a signed X.509 certificate - # Revocation List (CRL). A CRL contains the serial numbers of certificates that - # should no longer be trusted. - # @!attribute [r] name - # @return [::String] - # Output only. The resource path for this {::Google::Cloud::Security::PrivateCA::V1beta1::CertificateRevocationList CertificateRevocationList} in - # the format - # `projects/*/locations/*/certificateAuthorities/*/ - # certificateRevocationLists/*`. - # @!attribute [r] sequence_number - # @return [::Integer] - # Output only. The CRL sequence number that appears in pem_crl. - # @!attribute [r] revoked_certificates - # @return [::Array<::Google::Cloud::Security::PrivateCA::V1beta1::CertificateRevocationList::RevokedCertificate>] - # Output only. The revoked serial numbers that appear in pem_crl. - # @!attribute [r] pem_crl - # @return [::String] - # Output only. The PEM-encoded X.509 CRL. - # @!attribute [r] access_url - # @return [::String] - # Output only. The location where 'pem_crl' can be accessed. - # @!attribute [r] state - # @return [::Google::Cloud::Security::PrivateCA::V1beta1::CertificateRevocationList::State] - # Output only. The {::Google::Cloud::Security::PrivateCA::V1beta1::CertificateRevocationList::State State} for this {::Google::Cloud::Security::PrivateCA::V1beta1::CertificateRevocationList CertificateRevocationList}. - # @!attribute [r] create_time - # @return [::Google::Protobuf::Timestamp] - # Output only. The time at which this {::Google::Cloud::Security::PrivateCA::V1beta1::CertificateRevocationList CertificateRevocationList} was created. - # @!attribute [r] update_time - # @return [::Google::Protobuf::Timestamp] - # Output only. The time at which this {::Google::Cloud::Security::PrivateCA::V1beta1::CertificateRevocationList CertificateRevocationList} was updated. - # @!attribute [rw] labels - # @return [::Google::Protobuf::Map{::String => ::String}] - # Optional. Labels with user-defined metadata. - class CertificateRevocationList - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - - # Describes a revoked {::Google::Cloud::Security::PrivateCA::V1beta1::Certificate Certificate}. - # @!attribute [rw] certificate - # @return [::String] - # The resource path for the {::Google::Cloud::Security::PrivateCA::V1beta1::Certificate Certificate} in the format - # `projects/*/locations/*/certificateAuthorities/*/certificates/*`. - # @!attribute [rw] hex_serial_number - # @return [::String] - # The serial number of the {::Google::Cloud::Security::PrivateCA::V1beta1::Certificate Certificate}. - # @!attribute [rw] revocation_reason - # @return [::Google::Cloud::Security::PrivateCA::V1beta1::RevocationReason] - # The reason the {::Google::Cloud::Security::PrivateCA::V1beta1::Certificate Certificate} was revoked. - class RevokedCertificate - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # @!attribute [rw] key - # @return [::String] - # @!attribute [rw] value - # @return [::String] - class LabelsEntry - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # The state of a {::Google::Cloud::Security::PrivateCA::V1beta1::CertificateRevocationList CertificateRevocationList}, indicating if it is current. - module State - # Not specified. - STATE_UNSPECIFIED = 0 - - # The {::Google::Cloud::Security::PrivateCA::V1beta1::CertificateRevocationList CertificateRevocationList} is up to date. - ACTIVE = 1 - - # The {::Google::Cloud::Security::PrivateCA::V1beta1::CertificateRevocationList CertificateRevocationList} is no longer current. - SUPERSEDED = 2 - end - end - - # A {::Google::Cloud::Security::PrivateCA::V1beta1::Certificate Certificate} corresponds to a signed X.509 certificate issued by a - # {::Google::Cloud::Security::PrivateCA::V1beta1::CertificateAuthority CertificateAuthority}. - # @!attribute [r] name - # @return [::String] - # Output only. The resource path for this {::Google::Cloud::Security::PrivateCA::V1beta1::Certificate Certificate} in the format - # `projects/*/locations/*/certificateAuthorities/*/certificates/*`. - # @!attribute [rw] pem_csr - # @return [::String] - # Immutable. A pem-encoded X.509 certificate signing request (CSR). - # - # Note: The following fields are mutually exclusive: `pem_csr`, `config`. If a field in that set is populated, all other fields in the set will automatically be cleared. - # @!attribute [rw] config - # @return [::Google::Cloud::Security::PrivateCA::V1beta1::CertificateConfig] - # Immutable. A description of the certificate and key that does not require X.509 or - # ASN.1. - # - # Note: The following fields are mutually exclusive: `config`, `pem_csr`. If a field in that set is populated, all other fields in the set will automatically be cleared. - # @!attribute [rw] lifetime - # @return [::Google::Protobuf::Duration] - # Required. Immutable. The desired lifetime of a certificate. Used to create the - # "not_before_time" and "not_after_time" fields inside an X.509 - # certificate. Note that the lifetime may be truncated if it would extend - # past the life of any certificate authority in the issuing chain. - # @!attribute [r] revocation_details - # @return [::Google::Cloud::Security::PrivateCA::V1beta1::Certificate::RevocationDetails] - # Output only. Details regarding the revocation of this {::Google::Cloud::Security::PrivateCA::V1beta1::Certificate Certificate}. This - # {::Google::Cloud::Security::PrivateCA::V1beta1::Certificate Certificate} is considered revoked if and only if this field is present. - # @!attribute [r] pem_certificate - # @return [::String] - # Output only. The pem-encoded, signed X.509 certificate. - # @!attribute [r] certificate_description - # @return [::Google::Cloud::Security::PrivateCA::V1beta1::CertificateDescription] - # Output only. A structured description of the issued X.509 certificate. - # @!attribute [r] pem_certificate_chain - # @return [::Array<::String>] - # Output only. The chain that may be used to verify the X.509 certificate. Expected to be - # in issuer-to-root order according to RFC 5246. - # @!attribute [r] create_time - # @return [::Google::Protobuf::Timestamp] - # Output only. The time at which this {::Google::Cloud::Security::PrivateCA::V1beta1::Certificate Certificate} was created. - # @!attribute [r] update_time - # @return [::Google::Protobuf::Timestamp] - # Output only. The time at which this {::Google::Cloud::Security::PrivateCA::V1beta1::Certificate Certificate} was updated. - # @!attribute [rw] labels - # @return [::Google::Protobuf::Map{::String => ::String}] - # Optional. Labels with user-defined metadata. - class Certificate - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - - # Describes fields that are relavent to the revocation of a {::Google::Cloud::Security::PrivateCA::V1beta1::Certificate Certificate}. - # @!attribute [rw] revocation_state - # @return [::Google::Cloud::Security::PrivateCA::V1beta1::RevocationReason] - # Indicates why a {::Google::Cloud::Security::PrivateCA::V1beta1::Certificate Certificate} was revoked. - # @!attribute [rw] revocation_time - # @return [::Google::Protobuf::Timestamp] - # The time at which this {::Google::Cloud::Security::PrivateCA::V1beta1::Certificate Certificate} was revoked. - class RevocationDetails - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # @!attribute [rw] key - # @return [::String] - # @!attribute [rw] value - # @return [::String] - class LabelsEntry - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - end - - # A {::Google::Cloud::Security::PrivateCA::V1beta1::ReusableConfig ReusableConfig} refers to a managed {::Google::Cloud::Security::PrivateCA::V1beta1::ReusableConfigValues ReusableConfigValues}. Those, in - # turn, are used to describe certain fields of an X.509 certificate, such as - # the key usage fields, fields specific to CA certificates, certificate policy - # extensions and custom extensions. - # @!attribute [r] name - # @return [::String] - # Output only. The resource path for this {::Google::Cloud::Security::PrivateCA::V1beta1::ReusableConfig ReusableConfig} in the format - # `projects/*/locations/*/reusableConfigs/*`. - # @!attribute [rw] values - # @return [::Google::Cloud::Security::PrivateCA::V1beta1::ReusableConfigValues] - # Required. The config values. - # @!attribute [rw] description - # @return [::String] - # Optional. A human-readable description of scenarios these ReusableConfigValues may be - # compatible with. - # @!attribute [r] create_time - # @return [::Google::Protobuf::Timestamp] - # Output only. The time at which this {::Google::Cloud::Security::PrivateCA::V1beta1::ReusableConfig ReusableConfig} was created. - # @!attribute [r] update_time - # @return [::Google::Protobuf::Timestamp] - # Output only. The time at which this {::Google::Cloud::Security::PrivateCA::V1beta1::ReusableConfig ReusableConfig} was updated. - # @!attribute [rw] labels - # @return [::Google::Protobuf::Map{::String => ::String}] - # Optional. Labels with user-defined metadata. - class ReusableConfig - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - - # @!attribute [rw] key - # @return [::String] - # @!attribute [rw] value - # @return [::String] - class LabelsEntry - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - end - - # A {::Google::Cloud::Security::PrivateCA::V1beta1::ReusableConfigValues ReusableConfigValues} is used to describe certain fields of an - # X.509 certificate, such as the key usage fields, fields specific to CA - # certificates, certificate policy extensions and custom extensions. - # @!attribute [rw] key_usage - # @return [::Google::Cloud::Security::PrivateCA::V1beta1::KeyUsage] - # Optional. Indicates the intended use for keys that correspond to a certificate. - # @!attribute [rw] ca_options - # @return [::Google::Cloud::Security::PrivateCA::V1beta1::ReusableConfigValues::CaOptions] - # Optional. Describes options in this {::Google::Cloud::Security::PrivateCA::V1beta1::ReusableConfigValues ReusableConfigValues} that are - # relevant in a CA certificate. - # @!attribute [rw] policy_ids - # @return [::Array<::Google::Cloud::Security::PrivateCA::V1beta1::ObjectId>] - # Optional. Describes the X.509 certificate policy object identifiers, per - # https://tools.ietf.org/html/rfc5280#section-4.2.1.4. - # @!attribute [rw] aia_ocsp_servers - # @return [::Array<::String>] - # Optional. Describes Online Certificate Status Protocol (OCSP) endpoint addresses - # that appear in the "Authority Information Access" extension in the - # certificate. - # @!attribute [rw] additional_extensions - # @return [::Array<::Google::Cloud::Security::PrivateCA::V1beta1::X509Extension>] - # Optional. Describes custom X.509 extensions. - class ReusableConfigValues - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - - # Describes values that are relevant in a CA certificate. - # @!attribute [rw] is_ca - # @return [::Google::Protobuf::BoolValue] - # Optional. Refers to the "CA" X.509 extension, which is a boolean value. When this - # value is missing, the extension will be omitted from the CA certificate. - # @!attribute [rw] max_issuer_path_length - # @return [::Google::Protobuf::Int32Value] - # Optional. Refers to the path length restriction X.509 extension. For a CA - # certificate, this value describes the depth of subordinate CA - # certificates that are allowed. - # If this value is less than 0, the request will fail. - # If this value is missing, the max path length will be omitted from the - # CA certificate. - class CaOptions - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - end - - # A {::Google::Cloud::Security::PrivateCA::V1beta1::ReusableConfigWrapper ReusableConfigWrapper} describes values that may assist in creating an - # X.509 certificate, or a reference to a pre-defined set of values. - # @!attribute [rw] reusable_config - # @return [::String] - # Required. A resource path to a {::Google::Cloud::Security::PrivateCA::V1beta1::ReusableConfig ReusableConfig} in the format - # `projects/*/locations/*/reusableConfigs/*`. - # - # Note: The following fields are mutually exclusive: `reusable_config`, `reusable_config_values`. If a field in that set is populated, all other fields in the set will automatically be cleared. - # @!attribute [rw] reusable_config_values - # @return [::Google::Cloud::Security::PrivateCA::V1beta1::ReusableConfigValues] - # Required. A user-specified inline {::Google::Cloud::Security::PrivateCA::V1beta1::ReusableConfigValues ReusableConfigValues}. - # - # Note: The following fields are mutually exclusive: `reusable_config_values`, `reusable_config`. If a field in that set is populated, all other fields in the set will automatically be cleared. - class ReusableConfigWrapper - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Describes a subordinate CA's issuers. This is either a resource path to a - # known issuing {::Google::Cloud::Security::PrivateCA::V1beta1::CertificateAuthority CertificateAuthority}, or a PEM issuer certificate chain. - # @!attribute [rw] certificate_authority - # @return [::String] - # Required. This can refer to a {::Google::Cloud::Security::PrivateCA::V1beta1::CertificateAuthority CertificateAuthority} in the same project that - # was used to create a subordinate {::Google::Cloud::Security::PrivateCA::V1beta1::CertificateAuthority CertificateAuthority}. This field - # is used for information and usability purposes only. The resource name - # is in the format `projects/*/locations/*/certificateAuthorities/*`. - # - # Note: The following fields are mutually exclusive: `certificate_authority`, `pem_issuer_chain`. If a field in that set is populated, all other fields in the set will automatically be cleared. - # @!attribute [rw] pem_issuer_chain - # @return [::Google::Cloud::Security::PrivateCA::V1beta1::SubordinateConfig::SubordinateConfigChain] - # Required. Contains the PEM certificate chain for the issuers of this - # {::Google::Cloud::Security::PrivateCA::V1beta1::CertificateAuthority CertificateAuthority}, but not pem certificate for this CA itself. - # - # Note: The following fields are mutually exclusive: `pem_issuer_chain`, `certificate_authority`. If a field in that set is populated, all other fields in the set will automatically be cleared. - class SubordinateConfig - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - - # This message describes a subordinate CA's issuer certificate chain. This - # wrapper exists for compatibility reasons. - # @!attribute [rw] pem_certificates - # @return [::Array<::String>] - # Required. Expected to be in leaf-to-root order according to RFC 5246. - class SubordinateConfigChain - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - end - - # A {::Google::Cloud::Security::PrivateCA::V1beta1::PublicKey PublicKey} describes a public key. - # @!attribute [rw] type - # @return [::Google::Cloud::Security::PrivateCA::V1beta1::PublicKey::KeyType] - # Required. The type of public key. - # @!attribute [rw] key - # @return [::String] - # Required. A public key. Padding and encoding varies by 'KeyType' and is described - # along with the KeyType values. - class PublicKey - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - - # Types of public keys that are supported. - # At a minimum, we support RSA and ECDSA, for the key sizes or curves listed: - # https://cloud.google.com/kms/docs/algorithms#asymmetric_signing_algorithms - module KeyType - # Default unspecified value. - KEY_TYPE_UNSPECIFIED = 0 - - # A PEM-encoded PKCS#1/RFC 3447 RSAPrivateKey structure. - PEM_RSA_KEY = 1 - - # A PEM-encoded compressed NIST P-256/secp256r1/prime256v1 or P-384 key. - PEM_EC_KEY = 2 - end - end - - # A {::Google::Cloud::Security::PrivateCA::V1beta1::CertificateConfig CertificateConfig} describes an X.509 certificate or CSR that is to be - # created, as an alternative to using ASN.1. - # @!attribute [rw] subject_config - # @return [::Google::Cloud::Security::PrivateCA::V1beta1::CertificateConfig::SubjectConfig] - # Required. Specifies some of the values in a certificate that are related to the - # subject. - # @!attribute [rw] reusable_config - # @return [::Google::Cloud::Security::PrivateCA::V1beta1::ReusableConfigWrapper] - # Required. Describes how some of the technical fields in a certificate should be - # populated. - # @!attribute [rw] public_key - # @return [::Google::Cloud::Security::PrivateCA::V1beta1::PublicKey] - # Optional. The public key that corresponds to this config. This is, for example, used - # when issuing {::Google::Cloud::Security::PrivateCA::V1beta1::Certificate Certificates}, but not when creating a - # self-signed {::Google::Cloud::Security::PrivateCA::V1beta1::CertificateAuthority CertificateAuthority} or {::Google::Cloud::Security::PrivateCA::V1beta1::CertificateAuthority CertificateAuthority} CSR. - class CertificateConfig - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - - # These values are used to create the distinguished name and subject - # alternative name fields in an X.509 certificate. - # @!attribute [rw] subject - # @return [::Google::Cloud::Security::PrivateCA::V1beta1::Subject] - # Required. Contains distinguished name fields such as the location and organization. - # @!attribute [rw] common_name - # @return [::String] - # Optional. The "common name" of the distinguished name. - # @!attribute [rw] subject_alt_name - # @return [::Google::Cloud::Security::PrivateCA::V1beta1::SubjectAltNames] - # Optional. The subject alternative name fields. - class SubjectConfig - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - end - - # A {::Google::Cloud::Security::PrivateCA::V1beta1::CertificateDescription CertificateDescription} describes an X.509 certificate or CSR that has - # been issued, as an alternative to using ASN.1 / X.509. - # @!attribute [rw] subject_description - # @return [::Google::Cloud::Security::PrivateCA::V1beta1::CertificateDescription::SubjectDescription] - # Describes some of the values in a certificate that are related to the - # subject and lifetime. - # @!attribute [rw] config_values - # @return [::Google::Cloud::Security::PrivateCA::V1beta1::ReusableConfigValues] - # Describes some of the technical fields in a certificate. - # @!attribute [rw] public_key - # @return [::Google::Cloud::Security::PrivateCA::V1beta1::PublicKey] - # The public key that corresponds to an issued certificate. - # @!attribute [rw] subject_key_id - # @return [::Google::Cloud::Security::PrivateCA::V1beta1::CertificateDescription::KeyId] - # Provides a means of identifiying certificates that contain a particular - # public key, per https://tools.ietf.org/html/rfc5280#section-4.2.1.2. - # @!attribute [rw] authority_key_id - # @return [::Google::Cloud::Security::PrivateCA::V1beta1::CertificateDescription::KeyId] - # Identifies the subject_key_id of the parent certificate, per - # https://tools.ietf.org/html/rfc5280#section-4.2.1.1 - # @!attribute [rw] crl_distribution_points - # @return [::Array<::String>] - # Describes a list of locations to obtain CRL information, i.e. - # the DistributionPoint.fullName described by - # https://tools.ietf.org/html/rfc5280#section-4.2.1.13 - # @!attribute [rw] aia_issuing_certificate_urls - # @return [::Array<::String>] - # Describes lists of issuer CA certificate URLs that appear in the - # "Authority Information Access" extension in the certificate. - # @!attribute [rw] cert_fingerprint - # @return [::Google::Cloud::Security::PrivateCA::V1beta1::CertificateDescription::CertificateFingerprint] - # The hash of the x.509 certificate. - class CertificateDescription - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - - # These values describe fields in an issued X.509 certificate such as the - # distinguished name, subject alternative names, serial number, and lifetime. - # @!attribute [rw] subject - # @return [::Google::Cloud::Security::PrivateCA::V1beta1::Subject] - # Contains distinguished name fields such as the location and organization. - # @!attribute [rw] common_name - # @return [::String] - # The "common name" of the distinguished name. - # @!attribute [rw] subject_alt_name - # @return [::Google::Cloud::Security::PrivateCA::V1beta1::SubjectAltNames] - # The subject alternative name fields. - # @!attribute [rw] hex_serial_number - # @return [::String] - # The serial number encoded in lowercase hexadecimal. - # @!attribute [rw] lifetime - # @return [::Google::Protobuf::Duration] - # For convenience, the actual lifetime of an issued certificate. - # Corresponds to 'not_after_time' - 'not_before_time'. - # @!attribute [rw] not_before_time - # @return [::Google::Protobuf::Timestamp] - # The time at which the certificate becomes valid. - # @!attribute [rw] not_after_time - # @return [::Google::Protobuf::Timestamp] - # The time at which the certificate expires. - class SubjectDescription - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # A KeyId identifies a specific public key, usually by hashing the public - # key. - # @!attribute [rw] key_id - # @return [::String] - # Optional. The value of this KeyId encoded in lowercase hexadecimal. This is most - # likely the 160 bit SHA-1 hash of the public key. - class KeyId - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # A group of fingerprints for the x509 certificate. - # @!attribute [rw] sha256_hash - # @return [::String] - # The SHA 256 hash, encoded in hexadecimal, of the DER x509 certificate. - class CertificateFingerprint - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - end - - # An {::Google::Cloud::Security::PrivateCA::V1beta1::ObjectId ObjectId} specifies an object identifier (OID). These provide context - # and describe types in ASN.1 messages. - # @!attribute [rw] object_id_path - # @return [::Array<::Integer>] - # Required. The parts of an OID path. The most significant parts of the path come - # first. - class ObjectId - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # An {::Google::Cloud::Security::PrivateCA::V1beta1::X509Extension X509Extension} specifies an X.509 extension, which may be used in - # different parts of X.509 objects like certificates, CSRs, and CRLs. - # @!attribute [rw] object_id - # @return [::Google::Cloud::Security::PrivateCA::V1beta1::ObjectId] - # Required. The OID for this X.509 extension. - # @!attribute [rw] critical - # @return [::Boolean] - # Required. Indicates whether or not this extension is critical (i.e., if the client - # does not know how to handle this extension, the client should consider this - # to be an error). - # @!attribute [rw] value - # @return [::String] - # Required. The value of this X.509 extension. - class X509Extension - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # A {::Google::Cloud::Security::PrivateCA::V1beta1::KeyUsage KeyUsage} describes key usage values that may appear in an X.509 - # certificate. - # @!attribute [rw] base_key_usage - # @return [::Google::Cloud::Security::PrivateCA::V1beta1::KeyUsage::KeyUsageOptions] - # Describes high-level ways in which a key may be used. - # @!attribute [rw] extended_key_usage - # @return [::Google::Cloud::Security::PrivateCA::V1beta1::KeyUsage::ExtendedKeyUsageOptions] - # Detailed scenarios in which a key may be used. - # @!attribute [rw] unknown_extended_key_usages - # @return [::Array<::Google::Cloud::Security::PrivateCA::V1beta1::ObjectId>] - # Used to describe extended key usages that are not listed in the - # {::Google::Cloud::Security::PrivateCA::V1beta1::KeyUsage::ExtendedKeyUsageOptions KeyUsage.ExtendedKeyUsageOptions} message. - class KeyUsage - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - - # {::Google::Cloud::Security::PrivateCA::V1beta1::KeyUsage::KeyUsageOptions KeyUsage.KeyUsageOptions} corresponds to the key usage values - # described in https://tools.ietf.org/html/rfc5280#section-4.2.1.3. - # @!attribute [rw] digital_signature - # @return [::Boolean] - # The key may be used for digital signatures. - # @!attribute [rw] content_commitment - # @return [::Boolean] - # The key may be used for cryptographic commitments. Note that this may - # also be referred to as "non-repudiation". - # @!attribute [rw] key_encipherment - # @return [::Boolean] - # The key may be used to encipher other keys. - # @!attribute [rw] data_encipherment - # @return [::Boolean] - # The key may be used to encipher data. - # @!attribute [rw] key_agreement - # @return [::Boolean] - # The key may be used in a key agreement protocol. - # @!attribute [rw] cert_sign - # @return [::Boolean] - # The key may be used to sign certificates. - # @!attribute [rw] crl_sign - # @return [::Boolean] - # The key may be used sign certificate revocation lists. - # @!attribute [rw] encipher_only - # @return [::Boolean] - # The key may be used to encipher only. - # @!attribute [rw] decipher_only - # @return [::Boolean] - # The key may be used to decipher only. - class KeyUsageOptions - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # {::Google::Cloud::Security::PrivateCA::V1beta1::KeyUsage::ExtendedKeyUsageOptions KeyUsage.ExtendedKeyUsageOptions} has fields that correspond to - # certain common OIDs that could be specified as an extended key usage value. - # @!attribute [rw] server_auth - # @return [::Boolean] - # Corresponds to OID 1.3.6.1.5.5.7.3.1. Officially described as "TLS WWW - # server authentication", though regularly used for non-WWW TLS. - # @!attribute [rw] client_auth - # @return [::Boolean] - # Corresponds to OID 1.3.6.1.5.5.7.3.2. Officially described as "TLS WWW - # client authentication", though regularly used for non-WWW TLS. - # @!attribute [rw] code_signing - # @return [::Boolean] - # Corresponds to OID 1.3.6.1.5.5.7.3.3. Officially described as "Signing of - # downloadable executable code client authentication". - # @!attribute [rw] email_protection - # @return [::Boolean] - # Corresponds to OID 1.3.6.1.5.5.7.3.4. Officially described as "Email - # protection". - # @!attribute [rw] time_stamping - # @return [::Boolean] - # Corresponds to OID 1.3.6.1.5.5.7.3.8. Officially described as "Binding - # the hash of an object to a time". - # @!attribute [rw] ocsp_signing - # @return [::Boolean] - # Corresponds to OID 1.3.6.1.5.5.7.3.9. Officially described as "Signing - # OCSP responses". - class ExtendedKeyUsageOptions - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - end - - # {::Google::Cloud::Security::PrivateCA::V1beta1::Subject Subject} describes parts of a distinguished name that, in turn, - # describes the subject of the certificate. - # @!attribute [rw] country_code - # @return [::String] - # The country code of the subject. - # @!attribute [rw] organization - # @return [::String] - # The organization of the subject. - # @!attribute [rw] organizational_unit - # @return [::String] - # The organizational_unit of the subject. - # @!attribute [rw] locality - # @return [::String] - # The locality or city of the subject. - # @!attribute [rw] province - # @return [::String] - # The province, territory, or regional state of the subject. - # @!attribute [rw] street_address - # @return [::String] - # The street address of the subject. - # @!attribute [rw] postal_code - # @return [::String] - # The postal code of the subject. - class Subject - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # {::Google::Cloud::Security::PrivateCA::V1beta1::SubjectAltNames SubjectAltNames} corresponds to a more modern way of listing what - # the asserted identity is in a certificate (i.e., compared to the "common - # name" in the distinguished name). - # @!attribute [rw] dns_names - # @return [::Array<::String>] - # Contains only valid, fully-qualified host names. - # @!attribute [rw] uris - # @return [::Array<::String>] - # Contains only valid RFC 3986 URIs. - # @!attribute [rw] email_addresses - # @return [::Array<::String>] - # Contains only valid RFC 2822 E-mail addresses. - # @!attribute [rw] ip_addresses - # @return [::Array<::String>] - # Contains only valid 32-bit IPv4 addresses or RFC 4291 IPv6 addresses. - # @!attribute [rw] custom_sans - # @return [::Array<::Google::Cloud::Security::PrivateCA::V1beta1::X509Extension>] - # Contains additional subject alternative name values. - class SubjectAltNames - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # A {::Google::Cloud::Security::PrivateCA::V1beta1::RevocationReason RevocationReason} indicates whether a {::Google::Cloud::Security::PrivateCA::V1beta1::Certificate Certificate} has been revoked, - # and the reason for revocation. These correspond to standard revocation - # reasons from RFC 5280. Note that the enum labels and values in this - # definition are not the same ASN.1 values defined in RFC 5280. These values - # will be translated to the correct ASN.1 values when a CRL is created. - module RevocationReason - # Default unspecified value. This value does indicate that a {::Google::Cloud::Security::PrivateCA::V1beta1::Certificate Certificate} - # has been revoked, but that a reason has not been recorded. - REVOCATION_REASON_UNSPECIFIED = 0 - - # Key material for this {::Google::Cloud::Security::PrivateCA::V1beta1::Certificate Certificate} may have leaked. - KEY_COMPROMISE = 1 - - # The key material for a certificate authority in the issuing path may have - # leaked. - CERTIFICATE_AUTHORITY_COMPROMISE = 2 - - # The subject or other attributes in this {::Google::Cloud::Security::PrivateCA::V1beta1::Certificate Certificate} have changed. - AFFILIATION_CHANGED = 3 - - # This {::Google::Cloud::Security::PrivateCA::V1beta1::Certificate Certificate} has been superseded. - SUPERSEDED = 4 - - # This {::Google::Cloud::Security::PrivateCA::V1beta1::Certificate Certificate} or entities in the issuing path have ceased to - # operate. - CESSATION_OF_OPERATION = 5 - - # This {::Google::Cloud::Security::PrivateCA::V1beta1::Certificate Certificate} should not be considered valid, it is expected that it - # may become valid in the future. - CERTIFICATE_HOLD = 6 - - # This {::Google::Cloud::Security::PrivateCA::V1beta1::Certificate Certificate} no longer has permission to assert the listed - # attributes. - PRIVILEGE_WITHDRAWN = 7 - - # The authority which determines appropriate attributes for a {::Google::Cloud::Security::PrivateCA::V1beta1::Certificate Certificate} - # may have been compromised. - ATTRIBUTE_AUTHORITY_COMPROMISE = 8 - end - end - end - end - end -end diff --git a/owl-bot-staging/google-cloud-security-private_ca-v1beta1/proto_docs/google/cloud/security/privateca/v1beta1/service.rb b/owl-bot-staging/google-cloud-security-private_ca-v1beta1/proto_docs/google/cloud/security/privateca/v1beta1/service.rb deleted file mode 100644 index 6a9041ea2415..000000000000 --- a/owl-bot-staging/google-cloud-security-private_ca-v1beta1/proto_docs/google/cloud/security/privateca/v1beta1/service.rb +++ /dev/null @@ -1,633 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - - -module Google - module Cloud - module Security - module PrivateCA - module V1beta1 - # Request message for {::Google::Cloud::Security::PrivateCA::V1beta1::CertificateAuthorityService::Client#create_certificate CertificateAuthorityService.CreateCertificate}. - # @!attribute [rw] parent - # @return [::String] - # Required. The resource name of the location and {::Google::Cloud::Security::PrivateCA::V1beta1::CertificateAuthority CertificateAuthority} - # associated with the {::Google::Cloud::Security::PrivateCA::V1beta1::Certificate Certificate}, in the format - # `projects/*/locations/*/certificateAuthorities/*`. - # @!attribute [rw] certificate_id - # @return [::String] - # Optional. It must be unique within a location and match the regular - # expression `[a-zA-Z0-9_-]{1,63}`. This field is required when using a - # {::Google::Cloud::Security::PrivateCA::V1beta1::CertificateAuthority CertificateAuthority} in the Enterprise {::Google::Cloud::Security::PrivateCA::V1beta1::CertificateAuthority::Tier CertificateAuthority.Tier}, - # but is optional and its value is ignored otherwise. - # @!attribute [rw] certificate - # @return [::Google::Cloud::Security::PrivateCA::V1beta1::Certificate] - # Required. A {::Google::Cloud::Security::PrivateCA::V1beta1::Certificate Certificate} with initial field values. - # @!attribute [rw] request_id - # @return [::String] - # Optional. An ID to identify requests. Specify a unique request ID so that if you must - # retry your request, the server will know to ignore the request if it has - # already been completed. The server will guarantee that for at least 60 - # minutes since the first request. - # - # For example, consider a situation where you make an initial request and t - # he request times out. If you make the request again with the same request - # ID, the server can check if original operation with the same request ID - # was received, and if so, will ignore the second request. This prevents - # clients from accidentally creating duplicate commitments. - # - # The request ID must be a valid UUID with the exception that zero UUID is - # not supported (00000000-0000-0000-0000-000000000000). - class CreateCertificateRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Request message for - # {::Google::Cloud::Security::PrivateCA::V1beta1::CertificateAuthorityService::Client#get_certificate CertificateAuthorityService.GetCertificate}. - # @!attribute [rw] name - # @return [::String] - # Required. The {::Google::Cloud::Security::PrivateCA::V1beta1::Certificate#name name} of the {::Google::Cloud::Security::PrivateCA::V1beta1::Certificate Certificate} to get. - class GetCertificateRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Request message for {::Google::Cloud::Security::PrivateCA::V1beta1::CertificateAuthorityService::Client#list_certificates CertificateAuthorityService.ListCertificates}. - # @!attribute [rw] parent - # @return [::String] - # Required. The resource name of the location associated with the - # {::Google::Cloud::Security::PrivateCA::V1beta1::Certificate Certificates}, in the format - # `projects/*/locations/*/certificateauthorities/*`. - # @!attribute [rw] page_size - # @return [::Integer] - # Optional. Limit on the number of - # {::Google::Cloud::Security::PrivateCA::V1beta1::Certificate Certificates} to include in the - # response. Further {::Google::Cloud::Security::PrivateCA::V1beta1::Certificate Certificates} can subsequently be obtained - # by including the - # {::Google::Cloud::Security::PrivateCA::V1beta1::ListCertificatesResponse#next_page_token ListCertificatesResponse.next_page_token} in a subsequent - # request. If unspecified, the server will pick an appropriate default. - # @!attribute [rw] page_token - # @return [::String] - # Optional. Pagination token, returned earlier via - # {::Google::Cloud::Security::PrivateCA::V1beta1::ListCertificatesResponse#next_page_token ListCertificatesResponse.next_page_token}. - # @!attribute [rw] filter - # @return [::String] - # Optional. Only include resources that match the filter in the response. For details - # on supported filters and syntax, see [Certificates Filtering - # documentation](https://cloud.google.com/certificate-authority-service/docs/sorting-filtering-certificates#filtering_support). - # @!attribute [rw] order_by - # @return [::String] - # Optional. Specify how the results should be sorted. For details on supported fields - # and syntax, see [Certificates Sorting - # documentation](https://cloud.google.com/certificate-authority-service/docs/sorting-filtering-certificates#sorting_support). - class ListCertificatesRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Response message for {::Google::Cloud::Security::PrivateCA::V1beta1::CertificateAuthorityService::Client#list_certificates CertificateAuthorityService.ListCertificates}. - # @!attribute [rw] certificates - # @return [::Array<::Google::Cloud::Security::PrivateCA::V1beta1::Certificate>] - # The list of {::Google::Cloud::Security::PrivateCA::V1beta1::Certificate Certificates}. - # @!attribute [rw] next_page_token - # @return [::String] - # A token to retrieve next page of results. Pass this value in - # [ListCertificatesRequest.next_page_token][] to retrieve the - # next page of results. - # @!attribute [rw] unreachable - # @return [::Array<::String>] - # A list of locations (e.g. "us-west1") that could not be reached. - class ListCertificatesResponse - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Request message for - # {::Google::Cloud::Security::PrivateCA::V1beta1::CertificateAuthorityService::Client#revoke_certificate CertificateAuthorityService.RevokeCertificate}. - # @!attribute [rw] name - # @return [::String] - # Required. The resource name for this {::Google::Cloud::Security::PrivateCA::V1beta1::Certificate Certificate} in the - # format `projects/*/locations/*/certificateAuthorities/*/certificates/*`. - # @!attribute [rw] reason - # @return [::Google::Cloud::Security::PrivateCA::V1beta1::RevocationReason] - # Required. The {::Google::Cloud::Security::PrivateCA::V1beta1::RevocationReason RevocationReason} for revoking this certificate. - # @!attribute [rw] request_id - # @return [::String] - # Optional. An ID to identify requests. Specify a unique request ID so that if you must - # retry your request, the server will know to ignore the request if it has - # already been completed. The server will guarantee that for at least 60 - # minutes since the first request. - # - # For example, consider a situation where you make an initial request and t - # he request times out. If you make the request again with the same request - # ID, the server can check if original operation with the same request ID - # was received, and if so, will ignore the second request. This prevents - # clients from accidentally creating duplicate commitments. - # - # The request ID must be a valid UUID with the exception that zero UUID is - # not supported (00000000-0000-0000-0000-000000000000). - class RevokeCertificateRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Request message for {::Google::Cloud::Security::PrivateCA::V1beta1::CertificateAuthorityService::Client#update_certificate CertificateAuthorityService.UpdateCertificate}. - # @!attribute [rw] certificate - # @return [::Google::Cloud::Security::PrivateCA::V1beta1::Certificate] - # Required. {::Google::Cloud::Security::PrivateCA::V1beta1::Certificate Certificate} with updated values. - # @!attribute [rw] update_mask - # @return [::Google::Protobuf::FieldMask] - # Required. A list of fields to be updated in this request. - # @!attribute [rw] request_id - # @return [::String] - # Optional. An ID to identify requests. Specify a unique request ID so that if you must - # retry your request, the server will know to ignore the request if it has - # already been completed. The server will guarantee that for at least 60 - # minutes since the first request. - # - # For example, consider a situation where you make an initial request and t - # he request times out. If you make the request again with the same request - # ID, the server can check if original operation with the same request ID - # was received, and if so, will ignore the second request. This prevents - # clients from accidentally creating duplicate commitments. - # - # The request ID must be a valid UUID with the exception that zero UUID is - # not supported (00000000-0000-0000-0000-000000000000). - class UpdateCertificateRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Request message for - # {::Google::Cloud::Security::PrivateCA::V1beta1::CertificateAuthorityService::Client#activate_certificate_authority CertificateAuthorityService.ActivateCertificateAuthority}. - # @!attribute [rw] name - # @return [::String] - # Required. The resource name for this {::Google::Cloud::Security::PrivateCA::V1beta1::CertificateAuthority CertificateAuthority} in the - # format `projects/*/locations/*/certificateAuthorities/*`. - # @!attribute [rw] pem_ca_certificate - # @return [::String] - # Required. The signed CA certificate issued from - # {::Google::Cloud::Security::PrivateCA::V1beta1::FetchCertificateAuthorityCsrResponse#pem_csr FetchCertificateAuthorityCsrResponse.pem_csr}. - # @!attribute [rw] subordinate_config - # @return [::Google::Cloud::Security::PrivateCA::V1beta1::SubordinateConfig] - # Required. Must include information about the issuer of 'pem_ca_certificate', and any - # further issuers until the self-signed CA. - # @!attribute [rw] request_id - # @return [::String] - # Optional. An ID to identify requests. Specify a unique request ID so that if you must - # retry your request, the server will know to ignore the request if it has - # already been completed. The server will guarantee that for at least 60 - # minutes since the first request. - # - # For example, consider a situation where you make an initial request and t - # he request times out. If you make the request again with the same request - # ID, the server can check if original operation with the same request ID - # was received, and if so, will ignore the second request. This prevents - # clients from accidentally creating duplicate commitments. - # - # The request ID must be a valid UUID with the exception that zero UUID is - # not supported (00000000-0000-0000-0000-000000000000). - class ActivateCertificateAuthorityRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Request message for - # {::Google::Cloud::Security::PrivateCA::V1beta1::CertificateAuthorityService::Client#create_certificate_authority CertificateAuthorityService.CreateCertificateAuthority}. - # @!attribute [rw] parent - # @return [::String] - # Required. The resource name of the location associated with the - # {::Google::Cloud::Security::PrivateCA::V1beta1::CertificateAuthority CertificateAuthorities}, in the format - # `projects/*/locations/*`. - # @!attribute [rw] certificate_authority_id - # @return [::String] - # Required. It must be unique within a location and match the regular - # expression `[a-zA-Z0-9_-]{1,63}` - # @!attribute [rw] certificate_authority - # @return [::Google::Cloud::Security::PrivateCA::V1beta1::CertificateAuthority] - # Required. A {::Google::Cloud::Security::PrivateCA::V1beta1::CertificateAuthority CertificateAuthority} with initial field values. - # @!attribute [rw] request_id - # @return [::String] - # Optional. An ID to identify requests. Specify a unique request ID so that if you must - # retry your request, the server will know to ignore the request if it has - # already been completed. The server will guarantee that for at least 60 - # minutes since the first request. - # - # For example, consider a situation where you make an initial request and t - # he request times out. If you make the request again with the same request - # ID, the server can check if original operation with the same request ID - # was received, and if so, will ignore the second request. This prevents - # clients from accidentally creating duplicate commitments. - # - # The request ID must be a valid UUID with the exception that zero UUID is - # not supported (00000000-0000-0000-0000-000000000000). - class CreateCertificateAuthorityRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Request message for - # {::Google::Cloud::Security::PrivateCA::V1beta1::CertificateAuthorityService::Client#disable_certificate_authority CertificateAuthorityService.DisableCertificateAuthority}. - # @!attribute [rw] name - # @return [::String] - # Required. The resource name for this {::Google::Cloud::Security::PrivateCA::V1beta1::CertificateAuthority CertificateAuthority} in the - # format `projects/*/locations/*/certificateAuthorities/*`. - # @!attribute [rw] request_id - # @return [::String] - # Optional. An ID to identify requests. Specify a unique request ID so that if you must - # retry your request, the server will know to ignore the request if it has - # already been completed. The server will guarantee that for at least 60 - # minutes since the first request. - # - # For example, consider a situation where you make an initial request and t - # he request times out. If you make the request again with the same request - # ID, the server can check if original operation with the same request ID - # was received, and if so, will ignore the second request. This prevents - # clients from accidentally creating duplicate commitments. - # - # The request ID must be a valid UUID with the exception that zero UUID is - # not supported (00000000-0000-0000-0000-000000000000). - class DisableCertificateAuthorityRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Request message for - # {::Google::Cloud::Security::PrivateCA::V1beta1::CertificateAuthorityService::Client#enable_certificate_authority CertificateAuthorityService.EnableCertificateAuthority}. - # @!attribute [rw] name - # @return [::String] - # Required. The resource name for this {::Google::Cloud::Security::PrivateCA::V1beta1::CertificateAuthority CertificateAuthority} in the - # format `projects/*/locations/*/certificateAuthorities/*`. - # @!attribute [rw] request_id - # @return [::String] - # Optional. An ID to identify requests. Specify a unique request ID so that if you must - # retry your request, the server will know to ignore the request if it has - # already been completed. The server will guarantee that for at least 60 - # minutes since the first request. - # - # For example, consider a situation where you make an initial request and t - # he request times out. If you make the request again with the same request - # ID, the server can check if original operation with the same request ID - # was received, and if so, will ignore the second request. This prevents - # clients from accidentally creating duplicate commitments. - # - # The request ID must be a valid UUID with the exception that zero UUID is - # not supported (00000000-0000-0000-0000-000000000000). - class EnableCertificateAuthorityRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Request message for - # {::Google::Cloud::Security::PrivateCA::V1beta1::CertificateAuthorityService::Client#fetch_certificate_authority_csr CertificateAuthorityService.FetchCertificateAuthorityCsr}. - # @!attribute [rw] name - # @return [::String] - # Required. The resource name for this {::Google::Cloud::Security::PrivateCA::V1beta1::CertificateAuthority CertificateAuthority} in the - # format `projects/*/locations/*/certificateAuthorities/*`. - class FetchCertificateAuthorityCsrRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Response message for - # {::Google::Cloud::Security::PrivateCA::V1beta1::CertificateAuthorityService::Client#fetch_certificate_authority_csr CertificateAuthorityService.FetchCertificateAuthorityCsr}. - # @!attribute [r] pem_csr - # @return [::String] - # Output only. The PEM-encoded signed certificate signing request (CSR). - class FetchCertificateAuthorityCsrResponse - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Request message for {::Google::Cloud::Security::PrivateCA::V1beta1::CertificateAuthorityService::Client#get_certificate_authority CertificateAuthorityService.GetCertificateAuthority}. - # @!attribute [rw] name - # @return [::String] - # Required. The {::Google::Cloud::Security::PrivateCA::V1beta1::CertificateAuthority#name name} of the {::Google::Cloud::Security::PrivateCA::V1beta1::CertificateAuthority CertificateAuthority} to - # get. - class GetCertificateAuthorityRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Request message for - # {::Google::Cloud::Security::PrivateCA::V1beta1::CertificateAuthorityService::Client#list_certificate_authorities CertificateAuthorityService.ListCertificateAuthorities}. - # @!attribute [rw] parent - # @return [::String] - # Required. The resource name of the location associated with the - # {::Google::Cloud::Security::PrivateCA::V1beta1::CertificateAuthority CertificateAuthorities}, in the format - # `projects/*/locations/*`. - # @!attribute [rw] page_size - # @return [::Integer] - # Optional. Limit on the number of {::Google::Cloud::Security::PrivateCA::V1beta1::CertificateAuthority CertificateAuthorities} to - # include in the response. - # Further {::Google::Cloud::Security::PrivateCA::V1beta1::CertificateAuthority CertificateAuthorities} can subsequently be - # obtained by including the - # {::Google::Cloud::Security::PrivateCA::V1beta1::ListCertificateAuthoritiesResponse#next_page_token ListCertificateAuthoritiesResponse.next_page_token} in a subsequent - # request. If unspecified, the server will pick an appropriate default. - # @!attribute [rw] page_token - # @return [::String] - # Optional. Pagination token, returned earlier via - # {::Google::Cloud::Security::PrivateCA::V1beta1::ListCertificateAuthoritiesResponse#next_page_token ListCertificateAuthoritiesResponse.next_page_token}. - # @!attribute [rw] filter - # @return [::String] - # Optional. Only include resources that match the filter in the response. - # @!attribute [rw] order_by - # @return [::String] - # Optional. Specify how the results should be sorted. - class ListCertificateAuthoritiesRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Response message for - # {::Google::Cloud::Security::PrivateCA::V1beta1::CertificateAuthorityService::Client#list_certificate_authorities CertificateAuthorityService.ListCertificateAuthorities}. - # @!attribute [rw] certificate_authorities - # @return [::Array<::Google::Cloud::Security::PrivateCA::V1beta1::CertificateAuthority>] - # The list of {::Google::Cloud::Security::PrivateCA::V1beta1::CertificateAuthority CertificateAuthorities}. - # @!attribute [rw] next_page_token - # @return [::String] - # A token to retrieve next page of results. Pass this value in - # [ListCertificateAuthoritiesRequest.next_page_token][] to retrieve the next - # page of results. - # @!attribute [rw] unreachable - # @return [::Array<::String>] - # A list of locations (e.g. "us-west1") that could not be reached. - class ListCertificateAuthoritiesResponse - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Request message for - # {::Google::Cloud::Security::PrivateCA::V1beta1::CertificateAuthorityService::Client#restore_certificate_authority CertificateAuthorityService.RestoreCertificateAuthority}. - # @!attribute [rw] name - # @return [::String] - # Required. The resource name for this {::Google::Cloud::Security::PrivateCA::V1beta1::CertificateAuthority CertificateAuthority} in the - # format `projects/*/locations/*/certificateAuthorities/*`. - # @!attribute [rw] request_id - # @return [::String] - # Optional. An ID to identify requests. Specify a unique request ID so that if you must - # retry your request, the server will know to ignore the request if it has - # already been completed. The server will guarantee that for at least 60 - # minutes since the first request. - # - # For example, consider a situation where you make an initial request and t - # he request times out. If you make the request again with the same request - # ID, the server can check if original operation with the same request ID - # was received, and if so, will ignore the second request. This prevents - # clients from accidentally creating duplicate commitments. - # - # The request ID must be a valid UUID with the exception that zero UUID is - # not supported (00000000-0000-0000-0000-000000000000). - class RestoreCertificateAuthorityRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Request message for - # {::Google::Cloud::Security::PrivateCA::V1beta1::CertificateAuthorityService::Client#schedule_delete_certificate_authority CertificateAuthorityService.ScheduleDeleteCertificateAuthority}. - # @!attribute [rw] name - # @return [::String] - # Required. The resource name for this {::Google::Cloud::Security::PrivateCA::V1beta1::CertificateAuthority CertificateAuthority} in the - # format `projects/*/locations/*/certificateAuthorities/*`. - # @!attribute [rw] request_id - # @return [::String] - # Optional. An ID to identify requests. Specify a unique request ID so that if you must - # retry your request, the server will know to ignore the request if it has - # already been completed. The server will guarantee that for at least 60 - # minutes since the first request. - # - # For example, consider a situation where you make an initial request and t - # he request times out. If you make the request again with the same request - # ID, the server can check if original operation with the same request ID - # was received, and if so, will ignore the second request. This prevents - # clients from accidentally creating duplicate commitments. - # - # The request ID must be a valid UUID with the exception that zero UUID is - # not supported (00000000-0000-0000-0000-000000000000). - class ScheduleDeleteCertificateAuthorityRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Request message for - # {::Google::Cloud::Security::PrivateCA::V1beta1::CertificateAuthorityService::Client#update_certificate_authority CertificateAuthorityService.UpdateCertificateAuthority}. - # @!attribute [rw] certificate_authority - # @return [::Google::Cloud::Security::PrivateCA::V1beta1::CertificateAuthority] - # Required. {::Google::Cloud::Security::PrivateCA::V1beta1::CertificateAuthority CertificateAuthority} with updated values. - # @!attribute [rw] update_mask - # @return [::Google::Protobuf::FieldMask] - # Required. A list of fields to be updated in this request. - # @!attribute [rw] request_id - # @return [::String] - # Optional. An ID to identify requests. Specify a unique request ID so that if you must - # retry your request, the server will know to ignore the request if it has - # already been completed. The server will guarantee that for at least 60 - # minutes since the first request. - # - # For example, consider a situation where you make an initial request and t - # he request times out. If you make the request again with the same request - # ID, the server can check if original operation with the same request ID - # was received, and if so, will ignore the second request. This prevents - # clients from accidentally creating duplicate commitments. - # - # The request ID must be a valid UUID with the exception that zero UUID is - # not supported (00000000-0000-0000-0000-000000000000). - class UpdateCertificateAuthorityRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Request message for - # {::Google::Cloud::Security::PrivateCA::V1beta1::CertificateAuthorityService::Client#get_certificate_revocation_list CertificateAuthorityService.GetCertificateRevocationList}. - # @!attribute [rw] name - # @return [::String] - # Required. The {::Google::Cloud::Security::PrivateCA::V1beta1::CertificateRevocationList#name name} of the - # {::Google::Cloud::Security::PrivateCA::V1beta1::CertificateRevocationList CertificateRevocationList} to get. - class GetCertificateRevocationListRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Request message for - # {::Google::Cloud::Security::PrivateCA::V1beta1::CertificateAuthorityService::Client#list_certificate_revocation_lists CertificateAuthorityService.ListCertificateRevocationLists}. - # @!attribute [rw] parent - # @return [::String] - # Required. The resource name of the location associated with the - # {::Google::Cloud::Security::PrivateCA::V1beta1::CertificateRevocationList CertificateRevocationLists}, in the format - # `projects/*/locations/*/certificateauthorities/*`. - # @!attribute [rw] page_size - # @return [::Integer] - # Optional. Limit on the number of - # {::Google::Cloud::Security::PrivateCA::V1beta1::CertificateRevocationList CertificateRevocationLists} to include in the - # response. Further {::Google::Cloud::Security::PrivateCA::V1beta1::CertificateRevocationList CertificateRevocationLists} - # can subsequently be obtained by including the - # {::Google::Cloud::Security::PrivateCA::V1beta1::ListCertificateRevocationListsResponse#next_page_token ListCertificateRevocationListsResponse.next_page_token} in a subsequent - # request. If unspecified, the server will pick an appropriate default. - # @!attribute [rw] page_token - # @return [::String] - # Optional. Pagination token, returned earlier via - # {::Google::Cloud::Security::PrivateCA::V1beta1::ListCertificateRevocationListsResponse#next_page_token ListCertificateRevocationListsResponse.next_page_token}. - # @!attribute [rw] filter - # @return [::String] - # Optional. Only include resources that match the filter in the response. - # @!attribute [rw] order_by - # @return [::String] - # Optional. Specify how the results should be sorted. - class ListCertificateRevocationListsRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Response message for - # {::Google::Cloud::Security::PrivateCA::V1beta1::CertificateAuthorityService::Client#list_certificate_revocation_lists CertificateAuthorityService.ListCertificateRevocationLists}. - # @!attribute [rw] certificate_revocation_lists - # @return [::Array<::Google::Cloud::Security::PrivateCA::V1beta1::CertificateRevocationList>] - # The list of {::Google::Cloud::Security::PrivateCA::V1beta1::CertificateRevocationList CertificateRevocationLists}. - # @!attribute [rw] next_page_token - # @return [::String] - # A token to retrieve next page of results. Pass this value in - # [ListCertificateRevocationListsRequest.next_page_token][] to retrieve the - # next page of results. - # @!attribute [rw] unreachable - # @return [::Array<::String>] - # A list of locations (e.g. "us-west1") that could not be reached. - class ListCertificateRevocationListsResponse - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Request message for - # {::Google::Cloud::Security::PrivateCA::V1beta1::CertificateAuthorityService::Client#update_certificate_revocation_list CertificateAuthorityService.UpdateCertificateRevocationList}. - # @!attribute [rw] certificate_revocation_list - # @return [::Google::Cloud::Security::PrivateCA::V1beta1::CertificateRevocationList] - # Required. {::Google::Cloud::Security::PrivateCA::V1beta1::CertificateRevocationList CertificateRevocationList} with updated values. - # @!attribute [rw] update_mask - # @return [::Google::Protobuf::FieldMask] - # Required. A list of fields to be updated in this request. - # @!attribute [rw] request_id - # @return [::String] - # Optional. An ID to identify requests. Specify a unique request ID so that if you must - # retry your request, the server will know to ignore the request if it has - # already been completed. The server will guarantee that for at least 60 - # minutes since the first request. - # - # For example, consider a situation where you make an initial request and t - # he request times out. If you make the request again with the same request - # ID, the server can check if original operation with the same request ID - # was received, and if so, will ignore the second request. This prevents - # clients from accidentally creating duplicate commitments. - # - # The request ID must be a valid UUID with the exception that zero UUID is - # not supported (00000000-0000-0000-0000-000000000000). - class UpdateCertificateRevocationListRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Request message for - # {::Google::Cloud::Security::PrivateCA::V1beta1::CertificateAuthorityService::Client#get_reusable_config CertificateAuthorityService.GetReusableConfig}. - # @!attribute [rw] name - # @return [::String] - # Required. The [name][ReusableConfigs.name] of the [ReusableConfigs][] to get. - class GetReusableConfigRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Request message for - # {::Google::Cloud::Security::PrivateCA::V1beta1::CertificateAuthorityService::Client#list_reusable_configs CertificateAuthorityService.ListReusableConfigs}. - # @!attribute [rw] parent - # @return [::String] - # Required. The resource name of the location associated with the - # {::Google::Cloud::Security::PrivateCA::V1beta1::ReusableConfig ReusableConfigs}, in the format - # `projects/*/locations/*`. - # @!attribute [rw] page_size - # @return [::Integer] - # Optional. Limit on the number of - # {::Google::Cloud::Security::PrivateCA::V1beta1::ReusableConfig ReusableConfigs} to include in the response. - # Further {::Google::Cloud::Security::PrivateCA::V1beta1::ReusableConfig ReusableConfigs} can subsequently be - # obtained by including the - # {::Google::Cloud::Security::PrivateCA::V1beta1::ListReusableConfigsResponse#next_page_token ListReusableConfigsResponse.next_page_token} in a subsequent request. If - # unspecified, the server will pick an appropriate default. - # @!attribute [rw] page_token - # @return [::String] - # Optional. Pagination token, returned earlier via - # {::Google::Cloud::Security::PrivateCA::V1beta1::ListReusableConfigsResponse#next_page_token ListReusableConfigsResponse.next_page_token}. - # @!attribute [rw] filter - # @return [::String] - # Optional. Only include resources that match the filter in the response. - # @!attribute [rw] order_by - # @return [::String] - # Optional. Specify how the results should be sorted. - class ListReusableConfigsRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Response message for - # {::Google::Cloud::Security::PrivateCA::V1beta1::CertificateAuthorityService::Client#list_reusable_configs CertificateAuthorityService.ListReusableConfigs}. - # @!attribute [rw] reusable_configs - # @return [::Array<::Google::Cloud::Security::PrivateCA::V1beta1::ReusableConfig>] - # The list of {::Google::Cloud::Security::PrivateCA::V1beta1::ReusableConfig ReusableConfigs}. - # @!attribute [rw] next_page_token - # @return [::String] - # A token to retrieve next page of results. Pass this value in - # [ListReusableConfigsRequest.next_page_token][] to retrieve - # the next page of results. - # @!attribute [rw] unreachable - # @return [::Array<::String>] - # A list of locations (e.g. "us-west1") that could not be reached. - class ListReusableConfigsResponse - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Represents the metadata of the long-running operation. - # @!attribute [r] create_time - # @return [::Google::Protobuf::Timestamp] - # Output only. The time the operation was created. - # @!attribute [r] end_time - # @return [::Google::Protobuf::Timestamp] - # Output only. The time the operation finished running. - # @!attribute [r] target - # @return [::String] - # Output only. Server-defined resource path for the target of the operation. - # @!attribute [r] verb - # @return [::String] - # Output only. Name of the verb executed by the operation. - # @!attribute [r] status_message - # @return [::String] - # Output only. Human-readable status of the operation, if any. - # @!attribute [r] requested_cancellation - # @return [::Boolean] - # Output only. Identifies whether the user has requested cancellation - # of the operation. Operations that have successfully been cancelled - # have [Operation.error][] value with a {::Google::Rpc::Status#code google.rpc.Status.code} of 1, - # corresponding to `Code.CANCELLED`. - # @!attribute [r] api_version - # @return [::String] - # Output only. API version used to start the operation. - class OperationMetadata - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - end - end - end - end -end diff --git a/owl-bot-staging/google-cloud-security-private_ca-v1beta1/proto_docs/google/longrunning/operations.rb b/owl-bot-staging/google-cloud-security-private_ca-v1beta1/proto_docs/google/longrunning/operations.rb deleted file mode 100644 index 7a757f512165..000000000000 --- a/owl-bot-staging/google-cloud-security-private_ca-v1beta1/proto_docs/google/longrunning/operations.rb +++ /dev/null @@ -1,191 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - - -module Google - module Longrunning - # This resource represents a long-running operation that is the result of a - # network API call. - # @!attribute [rw] name - # @return [::String] - # The server-assigned name, which is only unique within the same service that - # originally returns it. If you use the default HTTP mapping, the - # `name` should be a resource name ending with `operations/{unique_id}`. - # @!attribute [rw] metadata - # @return [::Google::Protobuf::Any] - # Service-specific metadata associated with the operation. It typically - # contains progress information and common metadata such as create time. - # Some services might not provide such metadata. Any method that returns a - # long-running operation should document the metadata type, if any. - # @!attribute [rw] done - # @return [::Boolean] - # If the value is `false`, it means the operation is still in progress. - # If `true`, the operation is completed, and either `error` or `response` is - # available. - # @!attribute [rw] error - # @return [::Google::Rpc::Status] - # The error result of the operation in case of failure or cancellation. - # - # Note: The following fields are mutually exclusive: `error`, `response`. If a field in that set is populated, all other fields in the set will automatically be cleared. - # @!attribute [rw] response - # @return [::Google::Protobuf::Any] - # The normal, successful response of the operation. If the original - # method returns no data on success, such as `Delete`, the response is - # `google.protobuf.Empty`. If the original method is standard - # `Get`/`Create`/`Update`, the response should be the resource. For other - # methods, the response should have the type `XxxResponse`, where `Xxx` - # is the original method name. For example, if the original method name - # is `TakeSnapshot()`, the inferred response type is - # `TakeSnapshotResponse`. - # - # Note: The following fields are mutually exclusive: `response`, `error`. If a field in that set is populated, all other fields in the set will automatically be cleared. - class Operation - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # The request message for - # Operations.GetOperation. - # @!attribute [rw] name - # @return [::String] - # The name of the operation resource. - class GetOperationRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # The request message for - # Operations.ListOperations. - # @!attribute [rw] name - # @return [::String] - # The name of the operation's parent resource. - # @!attribute [rw] filter - # @return [::String] - # The standard list filter. - # @!attribute [rw] page_size - # @return [::Integer] - # The standard list page size. - # @!attribute [rw] page_token - # @return [::String] - # The standard list page token. - # @!attribute [rw] return_partial_success - # @return [::Boolean] - # When set to `true`, operations that are reachable are returned as normal, - # and those that are unreachable are returned in the - # [ListOperationsResponse.unreachable] field. - # - # This can only be `true` when reading across collections e.g. when `parent` - # is set to `"projects/example/locations/-"`. - # - # This field is not by default supported and will result in an - # `UNIMPLEMENTED` error if set unless explicitly documented otherwise in - # service or product specific documentation. - class ListOperationsRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # The response message for - # Operations.ListOperations. - # @!attribute [rw] operations - # @return [::Array<::Google::Longrunning::Operation>] - # A list of operations that matches the specified filter in the request. - # @!attribute [rw] next_page_token - # @return [::String] - # The standard List next-page token. - # @!attribute [rw] unreachable - # @return [::Array<::String>] - # Unordered list. Unreachable resources. Populated when the request sets - # `ListOperationsRequest.return_partial_success` and reads across - # collections e.g. when attempting to list all resources across all supported - # locations. - class ListOperationsResponse - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # The request message for - # Operations.CancelOperation. - # @!attribute [rw] name - # @return [::String] - # The name of the operation resource to be cancelled. - class CancelOperationRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # The request message for - # Operations.DeleteOperation. - # @!attribute [rw] name - # @return [::String] - # The name of the operation resource to be deleted. - class DeleteOperationRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # The request message for - # Operations.WaitOperation. - # @!attribute [rw] name - # @return [::String] - # The name of the operation resource to wait on. - # @!attribute [rw] timeout - # @return [::Google::Protobuf::Duration] - # The maximum duration to wait before timing out. If left blank, the wait - # will be at most the time permitted by the underlying HTTP/RPC protocol. - # If RPC context deadline is also specified, the shorter one will be used. - class WaitOperationRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # A message representing the message types used by a long-running operation. - # - # Example: - # - # rpc Export(ExportRequest) returns (google.longrunning.Operation) { - # option (google.longrunning.operation_info) = { - # response_type: "ExportResponse" - # metadata_type: "ExportMetadata" - # }; - # } - # @!attribute [rw] response_type - # @return [::String] - # Required. The message name of the primary return type for this - # long-running operation. - # This type will be used to deserialize the LRO's response. - # - # If the response is in a different package from the rpc, a fully-qualified - # message name must be used (e.g. `google.protobuf.Struct`). - # - # Note: Altering this value constitutes a breaking change. - # @!attribute [rw] metadata_type - # @return [::String] - # Required. The message name of the metadata type for this long-running - # operation. - # - # If the response is in a different package from the rpc, a fully-qualified - # message name must be used (e.g. `google.protobuf.Struct`). - # - # Note: Altering this value constitutes a breaking change. - class OperationInfo - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - end -end diff --git a/owl-bot-staging/google-cloud-security-private_ca-v1beta1/proto_docs/google/protobuf/any.rb b/owl-bot-staging/google-cloud-security-private_ca-v1beta1/proto_docs/google/protobuf/any.rb deleted file mode 100644 index 58691995f02e..000000000000 --- a/owl-bot-staging/google-cloud-security-private_ca-v1beta1/proto_docs/google/protobuf/any.rb +++ /dev/null @@ -1,145 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - - -module Google - module Protobuf - # `Any` contains an arbitrary serialized protocol buffer message along with a - # URL that describes the type of the serialized message. - # - # Protobuf library provides support to pack/unpack Any values in the form - # of utility functions or additional generated methods of the Any type. - # - # Example 1: Pack and unpack a message in C++. - # - # Foo foo = ...; - # Any any; - # any.PackFrom(foo); - # ... - # if (any.UnpackTo(&foo)) { - # ... - # } - # - # Example 2: Pack and unpack a message in Java. - # - # Foo foo = ...; - # Any any = Any.pack(foo); - # ... - # if (any.is(Foo.class)) { - # foo = any.unpack(Foo.class); - # } - # // or ... - # if (any.isSameTypeAs(Foo.getDefaultInstance())) { - # foo = any.unpack(Foo.getDefaultInstance()); - # } - # - # Example 3: Pack and unpack a message in Python. - # - # foo = Foo(...) - # any = Any() - # any.Pack(foo) - # ... - # if any.Is(Foo.DESCRIPTOR): - # any.Unpack(foo) - # ... - # - # Example 4: Pack and unpack a message in Go - # - # foo := &pb.Foo{...} - # any, err := anypb.New(foo) - # if err != nil { - # ... - # } - # ... - # foo := &pb.Foo{} - # if err := any.UnmarshalTo(foo); err != nil { - # ... - # } - # - # The pack methods provided by protobuf library will by default use - # 'type.googleapis.com/full.type.name' as the type URL and the unpack - # methods only use the fully qualified type name after the last '/' - # in the type URL, for example "foo.bar.com/x/y.z" will yield type - # name "y.z". - # - # JSON - # ==== - # The JSON representation of an `Any` value uses the regular - # representation of the deserialized, embedded message, with an - # additional field `@type` which contains the type URL. Example: - # - # package google.profile; - # message Person { - # string first_name = 1; - # string last_name = 2; - # } - # - # { - # "@type": "type.googleapis.com/google.profile.Person", - # "firstName": , - # "lastName": - # } - # - # If the embedded message type is well-known and has a custom JSON - # representation, that representation will be embedded adding a field - # `value` which holds the custom JSON in addition to the `@type` - # field. Example (for message [google.protobuf.Duration][]): - # - # { - # "@type": "type.googleapis.com/google.protobuf.Duration", - # "value": "1.212s" - # } - # @!attribute [rw] type_url - # @return [::String] - # A URL/resource name that uniquely identifies the type of the serialized - # protocol buffer message. This string must contain at least - # one "/" character. The last segment of the URL's path must represent - # the fully qualified name of the type (as in - # `path/google.protobuf.Duration`). The name should be in a canonical form - # (e.g., leading "." is not accepted). - # - # In practice, teams usually precompile into the binary all types that they - # expect it to use in the context of Any. However, for URLs which use the - # scheme `http`, `https`, or no scheme, one can optionally set up a type - # server that maps type URLs to message definitions as follows: - # - # * If no scheme is provided, `https` is assumed. - # * An HTTP GET on the URL must yield a [google.protobuf.Type][] - # value in binary format, or produce an error. - # * Applications are allowed to cache lookup results based on the - # URL, or have them precompiled into a binary to avoid any - # lookup. Therefore, binary compatibility needs to be preserved - # on changes to types. (Use versioned type names to manage - # breaking changes.) - # - # Note: this functionality is not currently available in the official - # protobuf release, and it is not used for type URLs beginning with - # type.googleapis.com. As of May 2023, there are no widely used type server - # implementations and no plans to implement one. - # - # Schemes other than `http`, `https` (or the empty scheme) might be - # used with implementation specific semantics. - # @!attribute [rw] value - # @return [::String] - # Must be a valid serialized protocol buffer of the above specified type. - class Any - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - end -end diff --git a/owl-bot-staging/google-cloud-security-private_ca-v1beta1/proto_docs/google/protobuf/duration.rb b/owl-bot-staging/google-cloud-security-private_ca-v1beta1/proto_docs/google/protobuf/duration.rb deleted file mode 100644 index ea59f1f91daf..000000000000 --- a/owl-bot-staging/google-cloud-security-private_ca-v1beta1/proto_docs/google/protobuf/duration.rb +++ /dev/null @@ -1,98 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - - -module Google - module Protobuf - # A Duration represents a signed, fixed-length span of time represented - # as a count of seconds and fractions of seconds at nanosecond - # resolution. It is independent of any calendar and concepts like "day" - # or "month". It is related to Timestamp in that the difference between - # two Timestamp values is a Duration and it can be added or subtracted - # from a Timestamp. Range is approximately +-10,000 years. - # - # # Examples - # - # Example 1: Compute Duration from two Timestamps in pseudo code. - # - # Timestamp start = ...; - # Timestamp end = ...; - # Duration duration = ...; - # - # duration.seconds = end.seconds - start.seconds; - # duration.nanos = end.nanos - start.nanos; - # - # if (duration.seconds < 0 && duration.nanos > 0) { - # duration.seconds += 1; - # duration.nanos -= 1000000000; - # } else if (duration.seconds > 0 && duration.nanos < 0) { - # duration.seconds -= 1; - # duration.nanos += 1000000000; - # } - # - # Example 2: Compute Timestamp from Timestamp + Duration in pseudo code. - # - # Timestamp start = ...; - # Duration duration = ...; - # Timestamp end = ...; - # - # end.seconds = start.seconds + duration.seconds; - # end.nanos = start.nanos + duration.nanos; - # - # if (end.nanos < 0) { - # end.seconds -= 1; - # end.nanos += 1000000000; - # } else if (end.nanos >= 1000000000) { - # end.seconds += 1; - # end.nanos -= 1000000000; - # } - # - # Example 3: Compute Duration from datetime.timedelta in Python. - # - # td = datetime.timedelta(days=3, minutes=10) - # duration = Duration() - # duration.FromTimedelta(td) - # - # # JSON Mapping - # - # In JSON format, the Duration type is encoded as a string rather than an - # object, where the string ends in the suffix "s" (indicating seconds) and - # is preceded by the number of seconds, with nanoseconds expressed as - # fractional seconds. For example, 3 seconds with 0 nanoseconds should be - # encoded in JSON format as "3s", while 3 seconds and 1 nanosecond should - # be expressed in JSON format as "3.000000001s", and 3 seconds and 1 - # microsecond should be expressed in JSON format as "3.000001s". - # @!attribute [rw] seconds - # @return [::Integer] - # Signed seconds of the span of time. Must be from -315,576,000,000 - # to +315,576,000,000 inclusive. Note: these bounds are computed from: - # 60 sec/min * 60 min/hr * 24 hr/day * 365.25 days/year * 10000 years - # @!attribute [rw] nanos - # @return [::Integer] - # Signed fractions of a second at nanosecond resolution of the span - # of time. Durations less than one second are represented with a 0 - # `seconds` field and a positive or negative `nanos` field. For durations - # of one second or more, a non-zero value for the `nanos` field must be - # of the same sign as the `seconds` field. Must be from -999,999,999 - # to +999,999,999 inclusive. - class Duration - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - end -end diff --git a/owl-bot-staging/google-cloud-security-private_ca-v1beta1/proto_docs/google/protobuf/empty.rb b/owl-bot-staging/google-cloud-security-private_ca-v1beta1/proto_docs/google/protobuf/empty.rb deleted file mode 100644 index 83e4481834a6..000000000000 --- a/owl-bot-staging/google-cloud-security-private_ca-v1beta1/proto_docs/google/protobuf/empty.rb +++ /dev/null @@ -1,34 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - - -module Google - module Protobuf - # A generic empty message that you can re-use to avoid defining duplicated - # empty messages in your APIs. A typical example is to use it as the request - # or the response type of an API method. For instance: - # - # service Foo { - # rpc Bar(google.protobuf.Empty) returns (google.protobuf.Empty); - # } - class Empty - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - end -end diff --git a/owl-bot-staging/google-cloud-security-private_ca-v1beta1/proto_docs/google/protobuf/field_mask.rb b/owl-bot-staging/google-cloud-security-private_ca-v1beta1/proto_docs/google/protobuf/field_mask.rb deleted file mode 100644 index 7f3ffc78601a..000000000000 --- a/owl-bot-staging/google-cloud-security-private_ca-v1beta1/proto_docs/google/protobuf/field_mask.rb +++ /dev/null @@ -1,229 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - - -module Google - module Protobuf - # `FieldMask` represents a set of symbolic field paths, for example: - # - # paths: "f.a" - # paths: "f.b.d" - # - # Here `f` represents a field in some root message, `a` and `b` - # fields in the message found in `f`, and `d` a field found in the - # message in `f.b`. - # - # Field masks are used to specify a subset of fields that should be - # returned by a get operation or modified by an update operation. - # Field masks also have a custom JSON encoding (see below). - # - # # Field Masks in Projections - # - # When used in the context of a projection, a response message or - # sub-message is filtered by the API to only contain those fields as - # specified in the mask. For example, if the mask in the previous - # example is applied to a response message as follows: - # - # f { - # a : 22 - # b { - # d : 1 - # x : 2 - # } - # y : 13 - # } - # z: 8 - # - # The result will not contain specific values for fields x,y and z - # (their value will be set to the default, and omitted in proto text - # output): - # - # - # f { - # a : 22 - # b { - # d : 1 - # } - # } - # - # A repeated field is not allowed except at the last position of a - # paths string. - # - # If a FieldMask object is not present in a get operation, the - # operation applies to all fields (as if a FieldMask of all fields - # had been specified). - # - # Note that a field mask does not necessarily apply to the - # top-level response message. In case of a REST get operation, the - # field mask applies directly to the response, but in case of a REST - # list operation, the mask instead applies to each individual message - # in the returned resource list. In case of a REST custom method, - # other definitions may be used. Where the mask applies will be - # clearly documented together with its declaration in the API. In - # any case, the effect on the returned resource/resources is required - # behavior for APIs. - # - # # Field Masks in Update Operations - # - # A field mask in update operations specifies which fields of the - # targeted resource are going to be updated. The API is required - # to only change the values of the fields as specified in the mask - # and leave the others untouched. If a resource is passed in to - # describe the updated values, the API ignores the values of all - # fields not covered by the mask. - # - # If a repeated field is specified for an update operation, new values will - # be appended to the existing repeated field in the target resource. Note that - # a repeated field is only allowed in the last position of a `paths` string. - # - # If a sub-message is specified in the last position of the field mask for an - # update operation, then new value will be merged into the existing sub-message - # in the target resource. - # - # For example, given the target message: - # - # f { - # b { - # d: 1 - # x: 2 - # } - # c: [1] - # } - # - # And an update message: - # - # f { - # b { - # d: 10 - # } - # c: [2] - # } - # - # then if the field mask is: - # - # paths: ["f.b", "f.c"] - # - # then the result will be: - # - # f { - # b { - # d: 10 - # x: 2 - # } - # c: [1, 2] - # } - # - # An implementation may provide options to override this default behavior for - # repeated and message fields. - # - # In order to reset a field's value to the default, the field must - # be in the mask and set to the default value in the provided resource. - # Hence, in order to reset all fields of a resource, provide a default - # instance of the resource and set all fields in the mask, or do - # not provide a mask as described below. - # - # If a field mask is not present on update, the operation applies to - # all fields (as if a field mask of all fields has been specified). - # Note that in the presence of schema evolution, this may mean that - # fields the client does not know and has therefore not filled into - # the request will be reset to their default. If this is unwanted - # behavior, a specific service may require a client to always specify - # a field mask, producing an error if not. - # - # As with get operations, the location of the resource which - # describes the updated values in the request message depends on the - # operation kind. In any case, the effect of the field mask is - # required to be honored by the API. - # - # ## Considerations for HTTP REST - # - # The HTTP kind of an update operation which uses a field mask must - # be set to PATCH instead of PUT in order to satisfy HTTP semantics - # (PUT must only be used for full updates). - # - # # JSON Encoding of Field Masks - # - # In JSON, a field mask is encoded as a single string where paths are - # separated by a comma. Fields name in each path are converted - # to/from lower-camel naming conventions. - # - # As an example, consider the following message declarations: - # - # message Profile { - # User user = 1; - # Photo photo = 2; - # } - # message User { - # string display_name = 1; - # string address = 2; - # } - # - # In proto a field mask for `Profile` may look as such: - # - # mask { - # paths: "user.display_name" - # paths: "photo" - # } - # - # In JSON, the same mask is represented as below: - # - # { - # mask: "user.displayName,photo" - # } - # - # # Field Masks and Oneof Fields - # - # Field masks treat fields in oneofs just as regular fields. Consider the - # following message: - # - # message SampleMessage { - # oneof test_oneof { - # string name = 4; - # SubMessage sub_message = 9; - # } - # } - # - # The field mask can be: - # - # mask { - # paths: "name" - # } - # - # Or: - # - # mask { - # paths: "sub_message" - # } - # - # Note that oneof type names ("test_oneof" in this case) cannot be used in - # paths. - # - # ## Field Mask Verification - # - # The implementation of any API method which has a FieldMask type field in the - # request should verify the included field paths, and return an - # `INVALID_ARGUMENT` error if any path is unmappable. - # @!attribute [rw] paths - # @return [::Array<::String>] - # The set of field mask paths. - class FieldMask - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - end -end diff --git a/owl-bot-staging/google-cloud-security-private_ca-v1beta1/proto_docs/google/protobuf/timestamp.rb b/owl-bot-staging/google-cloud-security-private_ca-v1beta1/proto_docs/google/protobuf/timestamp.rb deleted file mode 100644 index 74352be9c58c..000000000000 --- a/owl-bot-staging/google-cloud-security-private_ca-v1beta1/proto_docs/google/protobuf/timestamp.rb +++ /dev/null @@ -1,127 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - - -module Google - module Protobuf - # A Timestamp represents a point in time independent of any time zone or local - # calendar, encoded as a count of seconds and fractions of seconds at - # nanosecond resolution. The count is relative to an epoch at UTC midnight on - # January 1, 1970, in the proleptic Gregorian calendar which extends the - # Gregorian calendar backwards to year one. - # - # All minutes are 60 seconds long. Leap seconds are "smeared" so that no leap - # second table is needed for interpretation, using a [24-hour linear - # smear](https://developers.google.com/time/smear). - # - # The range is from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59.999999999Z. By - # restricting to that range, we ensure that we can convert to and from [RFC - # 3339](https://www.ietf.org/rfc/rfc3339.txt) date strings. - # - # # Examples - # - # Example 1: Compute Timestamp from POSIX `time()`. - # - # Timestamp timestamp; - # timestamp.set_seconds(time(NULL)); - # timestamp.set_nanos(0); - # - # Example 2: Compute Timestamp from POSIX `gettimeofday()`. - # - # struct timeval tv; - # gettimeofday(&tv, NULL); - # - # Timestamp timestamp; - # timestamp.set_seconds(tv.tv_sec); - # timestamp.set_nanos(tv.tv_usec * 1000); - # - # Example 3: Compute Timestamp from Win32 `GetSystemTimeAsFileTime()`. - # - # FILETIME ft; - # GetSystemTimeAsFileTime(&ft); - # UINT64 ticks = (((UINT64)ft.dwHighDateTime) << 32) | ft.dwLowDateTime; - # - # // A Windows tick is 100 nanoseconds. Windows epoch 1601-01-01T00:00:00Z - # // is 11644473600 seconds before Unix epoch 1970-01-01T00:00:00Z. - # Timestamp timestamp; - # timestamp.set_seconds((INT64) ((ticks / 10000000) - 11644473600LL)); - # timestamp.set_nanos((INT32) ((ticks % 10000000) * 100)); - # - # Example 4: Compute Timestamp from Java `System.currentTimeMillis()`. - # - # long millis = System.currentTimeMillis(); - # - # Timestamp timestamp = Timestamp.newBuilder().setSeconds(millis / 1000) - # .setNanos((int) ((millis % 1000) * 1000000)).build(); - # - # Example 5: Compute Timestamp from Java `Instant.now()`. - # - # Instant now = Instant.now(); - # - # Timestamp timestamp = - # Timestamp.newBuilder().setSeconds(now.getEpochSecond()) - # .setNanos(now.getNano()).build(); - # - # Example 6: Compute Timestamp from current time in Python. - # - # timestamp = Timestamp() - # timestamp.GetCurrentTime() - # - # # JSON Mapping - # - # In JSON format, the Timestamp type is encoded as a string in the - # [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format. That is, the - # format is "\\{year}-\\{month}-\\{day}T\\{hour}:\\{min}:\\{sec}[.\\{frac_sec}]Z" - # where \\{year} is always expressed using four digits while \\{month}, \\{day}, - # \\{hour}, \\{min}, and \\{sec} are zero-padded to two digits each. The fractional - # seconds, which can go up to 9 digits (i.e. up to 1 nanosecond resolution), - # are optional. The "Z" suffix indicates the timezone ("UTC"); the timezone - # is required. A proto3 JSON serializer should always use UTC (as indicated by - # "Z") when printing the Timestamp type and a proto3 JSON parser should be - # able to accept both UTC and other timezones (as indicated by an offset). - # - # For example, "2017-01-15T01:30:15.01Z" encodes 15.01 seconds past - # 01:30 UTC on January 15, 2017. - # - # In JavaScript, one can convert a Date object to this format using the - # standard - # [toISOString()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toISOString) - # method. In Python, a standard `datetime.datetime` object can be converted - # to this format using - # [`strftime`](https://docs.python.org/2/library/time.html#time.strftime) with - # the time format spec '%Y-%m-%dT%H:%M:%S.%fZ'. Likewise, in Java, one can use - # the Joda Time's [`ISODateTimeFormat.dateTime()`]( - # http://joda-time.sourceforge.net/apidocs/org/joda/time/format/ISODateTimeFormat.html#dateTime() - # ) to obtain a formatter capable of generating timestamps in this format. - # @!attribute [rw] seconds - # @return [::Integer] - # Represents seconds of UTC time since Unix epoch - # 1970-01-01T00:00:00Z. Must be from 0001-01-01T00:00:00Z to - # 9999-12-31T23:59:59Z inclusive. - # @!attribute [rw] nanos - # @return [::Integer] - # Non-negative fractions of a second at nanosecond resolution. Negative - # second values with fractions must still have non-negative nanos values - # that count forward in time. Must be from 0 to 999,999,999 - # inclusive. - class Timestamp - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - end -end diff --git a/owl-bot-staging/google-cloud-security-private_ca-v1beta1/proto_docs/google/protobuf/wrappers.rb b/owl-bot-staging/google-cloud-security-private_ca-v1beta1/proto_docs/google/protobuf/wrappers.rb deleted file mode 100644 index 9a7c0269fa42..000000000000 --- a/owl-bot-staging/google-cloud-security-private_ca-v1beta1/proto_docs/google/protobuf/wrappers.rb +++ /dev/null @@ -1,148 +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 - # Wrapper message for `double`. - # - # The JSON representation for `DoubleValue` is JSON number. - # - # Not recommended for use in new APIs, but still useful for legacy APIs and - # has no plan to be removed. - # @!attribute [rw] value - # @return [::Float] - # The double value. - class DoubleValue - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Wrapper message for `float`. - # - # The JSON representation for `FloatValue` is JSON number. - # - # Not recommended for use in new APIs, but still useful for legacy APIs and - # has no plan to be removed. - # @!attribute [rw] value - # @return [::Float] - # The float value. - class FloatValue - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Wrapper message for `int64`. - # - # The JSON representation for `Int64Value` is JSON string. - # - # Not recommended for use in new APIs, but still useful for legacy APIs and - # has no plan to be removed. - # @!attribute [rw] value - # @return [::Integer] - # The int64 value. - class Int64Value - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Wrapper message for `uint64`. - # - # The JSON representation for `UInt64Value` is JSON string. - # - # Not recommended for use in new APIs, but still useful for legacy APIs and - # has no plan to be removed. - # @!attribute [rw] value - # @return [::Integer] - # The uint64 value. - class UInt64Value - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Wrapper message for `int32`. - # - # The JSON representation for `Int32Value` is JSON number. - # - # Not recommended for use in new APIs, but still useful for legacy APIs and - # has no plan to be removed. - # @!attribute [rw] value - # @return [::Integer] - # The int32 value. - class Int32Value - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Wrapper message for `uint32`. - # - # The JSON representation for `UInt32Value` is JSON number. - # - # Not recommended for use in new APIs, but still useful for legacy APIs and - # has no plan to be removed. - # @!attribute [rw] value - # @return [::Integer] - # The uint32 value. - class UInt32Value - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Wrapper message for `bool`. - # - # The JSON representation for `BoolValue` is JSON `true` and `false`. - # - # Not recommended for use in new APIs, but still useful for legacy APIs and - # has no plan to be removed. - # @!attribute [rw] value - # @return [::Boolean] - # The bool value. - class BoolValue - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Wrapper message for `string`. - # - # The JSON representation for `StringValue` is JSON string. - # - # Not recommended for use in new APIs, but still useful for legacy APIs and - # has no plan to be removed. - # @!attribute [rw] value - # @return [::String] - # The string value. - class StringValue - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Wrapper message for `bytes`. - # - # The JSON representation for `BytesValue` is JSON string. - # - # Not recommended for use in new APIs, but still useful for legacy APIs and - # has no plan to be removed. - # @!attribute [rw] value - # @return [::String] - # The bytes value. - class BytesValue - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - end -end diff --git a/owl-bot-staging/google-cloud-security-private_ca-v1beta1/proto_docs/google/rpc/status.rb b/owl-bot-staging/google-cloud-security-private_ca-v1beta1/proto_docs/google/rpc/status.rb deleted file mode 100644 index c1a1c07eb2db..000000000000 --- a/owl-bot-staging/google-cloud-security-private_ca-v1beta1/proto_docs/google/rpc/status.rb +++ /dev/null @@ -1,48 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - - -module Google - module Rpc - # The `Status` type defines a logical error model that is suitable for - # different programming environments, including REST APIs and RPC APIs. It is - # used by [gRPC](https://github.com/grpc). Each `Status` message contains - # three pieces of data: error code, error message, and error details. - # - # You can find out more about this error model and how to work with it in the - # [API Design Guide](https://cloud.google.com/apis/design/errors). - # @!attribute [rw] code - # @return [::Integer] - # The status code, which should be an enum value of - # [google.rpc.Code][google.rpc.Code]. - # @!attribute [rw] message - # @return [::String] - # A developer-facing error message, which should be in English. Any - # user-facing error message should be localized and sent in the - # {::Google::Rpc::Status#details google.rpc.Status.details} field, or localized - # by the client. - # @!attribute [rw] details - # @return [::Array<::Google::Protobuf::Any>] - # A list of messages that carry the error details. There is a common set of - # message types for APIs to use. - class Status - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - end -end diff --git a/owl-bot-staging/google-cloud-security-private_ca-v1beta1/snippets/Gemfile b/owl-bot-staging/google-cloud-security-private_ca-v1beta1/snippets/Gemfile deleted file mode 100644 index adf37d01f04f..000000000000 --- a/owl-bot-staging/google-cloud-security-private_ca-v1beta1/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-security-private_ca-v1beta1", path: "../" -else - gem "google-cloud-security-private_ca-v1beta1" -end - -group :test do - gem "google-style", "~> 1.26.1" - gem "minitest", "~> 5.16" - gem "minitest-focus", "~> 1.1" - gem "minitest-hooks", "~> 1.5" -end diff --git a/owl-bot-staging/google-cloud-security-private_ca-v1beta1/snippets/certificate_authority_service/activate_certificate_authority.rb b/owl-bot-staging/google-cloud-security-private_ca-v1beta1/snippets/certificate_authority_service/activate_certificate_authority.rb deleted file mode 100644 index ab8a12841445..000000000000 --- a/owl-bot-staging/google-cloud-security-private_ca-v1beta1/snippets/certificate_authority_service/activate_certificate_authority.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 privateca_v1beta1_generated_CertificateAuthorityService_ActivateCertificateAuthority_sync] -require "google/cloud/security/private_ca/v1beta1" - -## -# Snippet for the activate_certificate_authority call in the CertificateAuthorityService service -# -# This snippet has been automatically generated and should be regarded as a code -# template only. It will require modifications to work: -# - It may require correct/in-range values for request initialization. -# - It may require specifying regional endpoints when creating the service -# client as shown in https://cloud.google.com/ruby/docs/reference. -# -# This is an auto-generated example demonstrating basic usage of -# Google::Cloud::Security::PrivateCA::V1beta1::CertificateAuthorityService::Client#activate_certificate_authority. -# -def activate_certificate_authority - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::Security::PrivateCA::V1beta1::CertificateAuthorityService::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::Security::PrivateCA::V1beta1::ActivateCertificateAuthorityRequest.new - - # Call the activate_certificate_authority method. - result = client.activate_certificate_authority 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 privateca_v1beta1_generated_CertificateAuthorityService_ActivateCertificateAuthority_sync] diff --git a/owl-bot-staging/google-cloud-security-private_ca-v1beta1/snippets/certificate_authority_service/create_certificate.rb b/owl-bot-staging/google-cloud-security-private_ca-v1beta1/snippets/certificate_authority_service/create_certificate.rb deleted file mode 100644 index f6c5d439434c..000000000000 --- a/owl-bot-staging/google-cloud-security-private_ca-v1beta1/snippets/certificate_authority_service/create_certificate.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 privateca_v1beta1_generated_CertificateAuthorityService_CreateCertificate_sync] -require "google/cloud/security/private_ca/v1beta1" - -## -# Snippet for the create_certificate call in the CertificateAuthorityService service -# -# This snippet has been automatically generated and should be regarded as a code -# template only. It will require modifications to work: -# - It may require correct/in-range values for request initialization. -# - It may require specifying regional endpoints when creating the service -# client as shown in https://cloud.google.com/ruby/docs/reference. -# -# This is an auto-generated example demonstrating basic usage of -# Google::Cloud::Security::PrivateCA::V1beta1::CertificateAuthorityService::Client#create_certificate. -# -def create_certificate - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::Security::PrivateCA::V1beta1::CertificateAuthorityService::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::Security::PrivateCA::V1beta1::CreateCertificateRequest.new - - # Call the create_certificate method. - result = client.create_certificate request - - # The returned object is of type Google::Cloud::Security::PrivateCA::V1beta1::Certificate. - p result -end -# [END privateca_v1beta1_generated_CertificateAuthorityService_CreateCertificate_sync] diff --git a/owl-bot-staging/google-cloud-security-private_ca-v1beta1/snippets/certificate_authority_service/create_certificate_authority.rb b/owl-bot-staging/google-cloud-security-private_ca-v1beta1/snippets/certificate_authority_service/create_certificate_authority.rb deleted file mode 100644 index b2fe7f84db0b..000000000000 --- a/owl-bot-staging/google-cloud-security-private_ca-v1beta1/snippets/certificate_authority_service/create_certificate_authority.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 privateca_v1beta1_generated_CertificateAuthorityService_CreateCertificateAuthority_sync] -require "google/cloud/security/private_ca/v1beta1" - -## -# Snippet for the create_certificate_authority call in the CertificateAuthorityService service -# -# This snippet has been automatically generated and should be regarded as a code -# template only. It will require modifications to work: -# - It may require correct/in-range values for request initialization. -# - It may require specifying regional endpoints when creating the service -# client as shown in https://cloud.google.com/ruby/docs/reference. -# -# This is an auto-generated example demonstrating basic usage of -# Google::Cloud::Security::PrivateCA::V1beta1::CertificateAuthorityService::Client#create_certificate_authority. -# -def create_certificate_authority - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::Security::PrivateCA::V1beta1::CertificateAuthorityService::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::Security::PrivateCA::V1beta1::CreateCertificateAuthorityRequest.new - - # Call the create_certificate_authority method. - result = client.create_certificate_authority 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 privateca_v1beta1_generated_CertificateAuthorityService_CreateCertificateAuthority_sync] diff --git a/owl-bot-staging/google-cloud-security-private_ca-v1beta1/snippets/certificate_authority_service/disable_certificate_authority.rb b/owl-bot-staging/google-cloud-security-private_ca-v1beta1/snippets/certificate_authority_service/disable_certificate_authority.rb deleted file mode 100644 index 6613651f079c..000000000000 --- a/owl-bot-staging/google-cloud-security-private_ca-v1beta1/snippets/certificate_authority_service/disable_certificate_authority.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 privateca_v1beta1_generated_CertificateAuthorityService_DisableCertificateAuthority_sync] -require "google/cloud/security/private_ca/v1beta1" - -## -# Snippet for the disable_certificate_authority call in the CertificateAuthorityService service -# -# This snippet has been automatically generated and should be regarded as a code -# template only. It will require modifications to work: -# - It may require correct/in-range values for request initialization. -# - It may require specifying regional endpoints when creating the service -# client as shown in https://cloud.google.com/ruby/docs/reference. -# -# This is an auto-generated example demonstrating basic usage of -# Google::Cloud::Security::PrivateCA::V1beta1::CertificateAuthorityService::Client#disable_certificate_authority. -# -def disable_certificate_authority - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::Security::PrivateCA::V1beta1::CertificateAuthorityService::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::Security::PrivateCA::V1beta1::DisableCertificateAuthorityRequest.new - - # Call the disable_certificate_authority method. - result = client.disable_certificate_authority 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 privateca_v1beta1_generated_CertificateAuthorityService_DisableCertificateAuthority_sync] diff --git a/owl-bot-staging/google-cloud-security-private_ca-v1beta1/snippets/certificate_authority_service/enable_certificate_authority.rb b/owl-bot-staging/google-cloud-security-private_ca-v1beta1/snippets/certificate_authority_service/enable_certificate_authority.rb deleted file mode 100644 index 156ab4130e0f..000000000000 --- a/owl-bot-staging/google-cloud-security-private_ca-v1beta1/snippets/certificate_authority_service/enable_certificate_authority.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 privateca_v1beta1_generated_CertificateAuthorityService_EnableCertificateAuthority_sync] -require "google/cloud/security/private_ca/v1beta1" - -## -# Snippet for the enable_certificate_authority call in the CertificateAuthorityService service -# -# This snippet has been automatically generated and should be regarded as a code -# template only. It will require modifications to work: -# - It may require correct/in-range values for request initialization. -# - It may require specifying regional endpoints when creating the service -# client as shown in https://cloud.google.com/ruby/docs/reference. -# -# This is an auto-generated example demonstrating basic usage of -# Google::Cloud::Security::PrivateCA::V1beta1::CertificateAuthorityService::Client#enable_certificate_authority. -# -def enable_certificate_authority - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::Security::PrivateCA::V1beta1::CertificateAuthorityService::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::Security::PrivateCA::V1beta1::EnableCertificateAuthorityRequest.new - - # Call the enable_certificate_authority method. - result = client.enable_certificate_authority 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 privateca_v1beta1_generated_CertificateAuthorityService_EnableCertificateAuthority_sync] diff --git a/owl-bot-staging/google-cloud-security-private_ca-v1beta1/snippets/certificate_authority_service/fetch_certificate_authority_csr.rb b/owl-bot-staging/google-cloud-security-private_ca-v1beta1/snippets/certificate_authority_service/fetch_certificate_authority_csr.rb deleted file mode 100644 index bce7583a24ab..000000000000 --- a/owl-bot-staging/google-cloud-security-private_ca-v1beta1/snippets/certificate_authority_service/fetch_certificate_authority_csr.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 privateca_v1beta1_generated_CertificateAuthorityService_FetchCertificateAuthorityCsr_sync] -require "google/cloud/security/private_ca/v1beta1" - -## -# Snippet for the fetch_certificate_authority_csr call in the CertificateAuthorityService service -# -# This snippet has been automatically generated and should be regarded as a code -# template only. It will require modifications to work: -# - It may require correct/in-range values for request initialization. -# - It may require specifying regional endpoints when creating the service -# client as shown in https://cloud.google.com/ruby/docs/reference. -# -# This is an auto-generated example demonstrating basic usage of -# Google::Cloud::Security::PrivateCA::V1beta1::CertificateAuthorityService::Client#fetch_certificate_authority_csr. -# -def fetch_certificate_authority_csr - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::Security::PrivateCA::V1beta1::CertificateAuthorityService::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::Security::PrivateCA::V1beta1::FetchCertificateAuthorityCsrRequest.new - - # Call the fetch_certificate_authority_csr method. - result = client.fetch_certificate_authority_csr request - - # The returned object is of type Google::Cloud::Security::PrivateCA::V1beta1::FetchCertificateAuthorityCsrResponse. - p result -end -# [END privateca_v1beta1_generated_CertificateAuthorityService_FetchCertificateAuthorityCsr_sync] diff --git a/owl-bot-staging/google-cloud-security-private_ca-v1beta1/snippets/certificate_authority_service/get_certificate.rb b/owl-bot-staging/google-cloud-security-private_ca-v1beta1/snippets/certificate_authority_service/get_certificate.rb deleted file mode 100644 index 962f824a4495..000000000000 --- a/owl-bot-staging/google-cloud-security-private_ca-v1beta1/snippets/certificate_authority_service/get_certificate.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 privateca_v1beta1_generated_CertificateAuthorityService_GetCertificate_sync] -require "google/cloud/security/private_ca/v1beta1" - -## -# Snippet for the get_certificate call in the CertificateAuthorityService service -# -# This snippet has been automatically generated and should be regarded as a code -# template only. It will require modifications to work: -# - It may require correct/in-range values for request initialization. -# - It may require specifying regional endpoints when creating the service -# client as shown in https://cloud.google.com/ruby/docs/reference. -# -# This is an auto-generated example demonstrating basic usage of -# Google::Cloud::Security::PrivateCA::V1beta1::CertificateAuthorityService::Client#get_certificate. -# -def get_certificate - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::Security::PrivateCA::V1beta1::CertificateAuthorityService::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::Security::PrivateCA::V1beta1::GetCertificateRequest.new - - # Call the get_certificate method. - result = client.get_certificate request - - # The returned object is of type Google::Cloud::Security::PrivateCA::V1beta1::Certificate. - p result -end -# [END privateca_v1beta1_generated_CertificateAuthorityService_GetCertificate_sync] diff --git a/owl-bot-staging/google-cloud-security-private_ca-v1beta1/snippets/certificate_authority_service/get_certificate_authority.rb b/owl-bot-staging/google-cloud-security-private_ca-v1beta1/snippets/certificate_authority_service/get_certificate_authority.rb deleted file mode 100644 index b9a58c2a9ff6..000000000000 --- a/owl-bot-staging/google-cloud-security-private_ca-v1beta1/snippets/certificate_authority_service/get_certificate_authority.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 privateca_v1beta1_generated_CertificateAuthorityService_GetCertificateAuthority_sync] -require "google/cloud/security/private_ca/v1beta1" - -## -# Snippet for the get_certificate_authority call in the CertificateAuthorityService service -# -# This snippet has been automatically generated and should be regarded as a code -# template only. It will require modifications to work: -# - It may require correct/in-range values for request initialization. -# - It may require specifying regional endpoints when creating the service -# client as shown in https://cloud.google.com/ruby/docs/reference. -# -# This is an auto-generated example demonstrating basic usage of -# Google::Cloud::Security::PrivateCA::V1beta1::CertificateAuthorityService::Client#get_certificate_authority. -# -def get_certificate_authority - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::Security::PrivateCA::V1beta1::CertificateAuthorityService::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::Security::PrivateCA::V1beta1::GetCertificateAuthorityRequest.new - - # Call the get_certificate_authority method. - result = client.get_certificate_authority request - - # The returned object is of type Google::Cloud::Security::PrivateCA::V1beta1::CertificateAuthority. - p result -end -# [END privateca_v1beta1_generated_CertificateAuthorityService_GetCertificateAuthority_sync] diff --git a/owl-bot-staging/google-cloud-security-private_ca-v1beta1/snippets/certificate_authority_service/get_certificate_revocation_list.rb b/owl-bot-staging/google-cloud-security-private_ca-v1beta1/snippets/certificate_authority_service/get_certificate_revocation_list.rb deleted file mode 100644 index a380979a1c64..000000000000 --- a/owl-bot-staging/google-cloud-security-private_ca-v1beta1/snippets/certificate_authority_service/get_certificate_revocation_list.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 privateca_v1beta1_generated_CertificateAuthorityService_GetCertificateRevocationList_sync] -require "google/cloud/security/private_ca/v1beta1" - -## -# Snippet for the get_certificate_revocation_list call in the CertificateAuthorityService service -# -# This snippet has been automatically generated and should be regarded as a code -# template only. It will require modifications to work: -# - It may require correct/in-range values for request initialization. -# - It may require specifying regional endpoints when creating the service -# client as shown in https://cloud.google.com/ruby/docs/reference. -# -# This is an auto-generated example demonstrating basic usage of -# Google::Cloud::Security::PrivateCA::V1beta1::CertificateAuthorityService::Client#get_certificate_revocation_list. -# -def get_certificate_revocation_list - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::Security::PrivateCA::V1beta1::CertificateAuthorityService::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::Security::PrivateCA::V1beta1::GetCertificateRevocationListRequest.new - - # Call the get_certificate_revocation_list method. - result = client.get_certificate_revocation_list request - - # The returned object is of type Google::Cloud::Security::PrivateCA::V1beta1::CertificateRevocationList. - p result -end -# [END privateca_v1beta1_generated_CertificateAuthorityService_GetCertificateRevocationList_sync] diff --git a/owl-bot-staging/google-cloud-security-private_ca-v1beta1/snippets/certificate_authority_service/get_reusable_config.rb b/owl-bot-staging/google-cloud-security-private_ca-v1beta1/snippets/certificate_authority_service/get_reusable_config.rb deleted file mode 100644 index 6a7a96769e22..000000000000 --- a/owl-bot-staging/google-cloud-security-private_ca-v1beta1/snippets/certificate_authority_service/get_reusable_config.rb +++ /dev/null @@ -1,47 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -# [START privateca_v1beta1_generated_CertificateAuthorityService_GetReusableConfig_sync] -require "google/cloud/security/private_ca/v1beta1" - -## -# Snippet for the get_reusable_config call in the CertificateAuthorityService service -# -# This snippet has been automatically generated and should be regarded as a code -# template only. It will require modifications to work: -# - It may require correct/in-range values for request initialization. -# - It may require specifying regional endpoints when creating the service -# client as shown in https://cloud.google.com/ruby/docs/reference. -# -# This is an auto-generated example demonstrating basic usage of -# Google::Cloud::Security::PrivateCA::V1beta1::CertificateAuthorityService::Client#get_reusable_config. -# -def get_reusable_config - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::Security::PrivateCA::V1beta1::CertificateAuthorityService::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::Security::PrivateCA::V1beta1::GetReusableConfigRequest.new - - # Call the get_reusable_config method. - result = client.get_reusable_config request - - # The returned object is of type Google::Cloud::Security::PrivateCA::V1beta1::ReusableConfig. - p result -end -# [END privateca_v1beta1_generated_CertificateAuthorityService_GetReusableConfig_sync] diff --git a/owl-bot-staging/google-cloud-security-private_ca-v1beta1/snippets/certificate_authority_service/list_certificate_authorities.rb b/owl-bot-staging/google-cloud-security-private_ca-v1beta1/snippets/certificate_authority_service/list_certificate_authorities.rb deleted file mode 100644 index fdb7607043c0..000000000000 --- a/owl-bot-staging/google-cloud-security-private_ca-v1beta1/snippets/certificate_authority_service/list_certificate_authorities.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 privateca_v1beta1_generated_CertificateAuthorityService_ListCertificateAuthorities_sync] -require "google/cloud/security/private_ca/v1beta1" - -## -# Snippet for the list_certificate_authorities call in the CertificateAuthorityService service -# -# This snippet has been automatically generated and should be regarded as a code -# template only. It will require modifications to work: -# - It may require correct/in-range values for request initialization. -# - It may require specifying regional endpoints when creating the service -# client as shown in https://cloud.google.com/ruby/docs/reference. -# -# This is an auto-generated example demonstrating basic usage of -# Google::Cloud::Security::PrivateCA::V1beta1::CertificateAuthorityService::Client#list_certificate_authorities. -# -def list_certificate_authorities - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::Security::PrivateCA::V1beta1::CertificateAuthorityService::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::Security::PrivateCA::V1beta1::ListCertificateAuthoritiesRequest.new - - # Call the list_certificate_authorities method. - result = client.list_certificate_authorities request - - # The returned object is of type Gapic::PagedEnumerable. You can iterate - # over elements, and API calls will be issued to fetch pages as needed. - result.each do |item| - # Each element is of type ::Google::Cloud::Security::PrivateCA::V1beta1::CertificateAuthority. - p item - end -end -# [END privateca_v1beta1_generated_CertificateAuthorityService_ListCertificateAuthorities_sync] diff --git a/owl-bot-staging/google-cloud-security-private_ca-v1beta1/snippets/certificate_authority_service/list_certificate_revocation_lists.rb b/owl-bot-staging/google-cloud-security-private_ca-v1beta1/snippets/certificate_authority_service/list_certificate_revocation_lists.rb deleted file mode 100644 index 158024198454..000000000000 --- a/owl-bot-staging/google-cloud-security-private_ca-v1beta1/snippets/certificate_authority_service/list_certificate_revocation_lists.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 privateca_v1beta1_generated_CertificateAuthorityService_ListCertificateRevocationLists_sync] -require "google/cloud/security/private_ca/v1beta1" - -## -# Snippet for the list_certificate_revocation_lists call in the CertificateAuthorityService service -# -# This snippet has been automatically generated and should be regarded as a code -# template only. It will require modifications to work: -# - It may require correct/in-range values for request initialization. -# - It may require specifying regional endpoints when creating the service -# client as shown in https://cloud.google.com/ruby/docs/reference. -# -# This is an auto-generated example demonstrating basic usage of -# Google::Cloud::Security::PrivateCA::V1beta1::CertificateAuthorityService::Client#list_certificate_revocation_lists. -# -def list_certificate_revocation_lists - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::Security::PrivateCA::V1beta1::CertificateAuthorityService::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::Security::PrivateCA::V1beta1::ListCertificateRevocationListsRequest.new - - # Call the list_certificate_revocation_lists method. - result = client.list_certificate_revocation_lists request - - # The returned object is of type Gapic::PagedEnumerable. You can iterate - # over elements, and API calls will be issued to fetch pages as needed. - result.each do |item| - # Each element is of type ::Google::Cloud::Security::PrivateCA::V1beta1::CertificateRevocationList. - p item - end -end -# [END privateca_v1beta1_generated_CertificateAuthorityService_ListCertificateRevocationLists_sync] diff --git a/owl-bot-staging/google-cloud-security-private_ca-v1beta1/snippets/certificate_authority_service/list_certificates.rb b/owl-bot-staging/google-cloud-security-private_ca-v1beta1/snippets/certificate_authority_service/list_certificates.rb deleted file mode 100644 index 2b396f505408..000000000000 --- a/owl-bot-staging/google-cloud-security-private_ca-v1beta1/snippets/certificate_authority_service/list_certificates.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 privateca_v1beta1_generated_CertificateAuthorityService_ListCertificates_sync] -require "google/cloud/security/private_ca/v1beta1" - -## -# Snippet for the list_certificates call in the CertificateAuthorityService service -# -# This snippet has been automatically generated and should be regarded as a code -# template only. It will require modifications to work: -# - It may require correct/in-range values for request initialization. -# - It may require specifying regional endpoints when creating the service -# client as shown in https://cloud.google.com/ruby/docs/reference. -# -# This is an auto-generated example demonstrating basic usage of -# Google::Cloud::Security::PrivateCA::V1beta1::CertificateAuthorityService::Client#list_certificates. -# -def list_certificates - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::Security::PrivateCA::V1beta1::CertificateAuthorityService::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::Security::PrivateCA::V1beta1::ListCertificatesRequest.new - - # Call the list_certificates method. - result = client.list_certificates request - - # The returned object is of type Gapic::PagedEnumerable. You can iterate - # over elements, and API calls will be issued to fetch pages as needed. - result.each do |item| - # Each element is of type ::Google::Cloud::Security::PrivateCA::V1beta1::Certificate. - p item - end -end -# [END privateca_v1beta1_generated_CertificateAuthorityService_ListCertificates_sync] diff --git a/owl-bot-staging/google-cloud-security-private_ca-v1beta1/snippets/certificate_authority_service/list_reusable_configs.rb b/owl-bot-staging/google-cloud-security-private_ca-v1beta1/snippets/certificate_authority_service/list_reusable_configs.rb deleted file mode 100644 index d437b3c44dc1..000000000000 --- a/owl-bot-staging/google-cloud-security-private_ca-v1beta1/snippets/certificate_authority_service/list_reusable_configs.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 privateca_v1beta1_generated_CertificateAuthorityService_ListReusableConfigs_sync] -require "google/cloud/security/private_ca/v1beta1" - -## -# Snippet for the list_reusable_configs call in the CertificateAuthorityService service -# -# This snippet has been automatically generated and should be regarded as a code -# template only. It will require modifications to work: -# - It may require correct/in-range values for request initialization. -# - It may require specifying regional endpoints when creating the service -# client as shown in https://cloud.google.com/ruby/docs/reference. -# -# This is an auto-generated example demonstrating basic usage of -# Google::Cloud::Security::PrivateCA::V1beta1::CertificateAuthorityService::Client#list_reusable_configs. -# -def list_reusable_configs - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::Security::PrivateCA::V1beta1::CertificateAuthorityService::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::Security::PrivateCA::V1beta1::ListReusableConfigsRequest.new - - # Call the list_reusable_configs method. - result = client.list_reusable_configs request - - # The returned object is of type Gapic::PagedEnumerable. You can iterate - # over elements, and API calls will be issued to fetch pages as needed. - result.each do |item| - # Each element is of type ::Google::Cloud::Security::PrivateCA::V1beta1::ReusableConfig. - p item - end -end -# [END privateca_v1beta1_generated_CertificateAuthorityService_ListReusableConfigs_sync] diff --git a/owl-bot-staging/google-cloud-security-private_ca-v1beta1/snippets/certificate_authority_service/restore_certificate_authority.rb b/owl-bot-staging/google-cloud-security-private_ca-v1beta1/snippets/certificate_authority_service/restore_certificate_authority.rb deleted file mode 100644 index e19de799588b..000000000000 --- a/owl-bot-staging/google-cloud-security-private_ca-v1beta1/snippets/certificate_authority_service/restore_certificate_authority.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 privateca_v1beta1_generated_CertificateAuthorityService_RestoreCertificateAuthority_sync] -require "google/cloud/security/private_ca/v1beta1" - -## -# Snippet for the restore_certificate_authority call in the CertificateAuthorityService service -# -# This snippet has been automatically generated and should be regarded as a code -# template only. It will require modifications to work: -# - It may require correct/in-range values for request initialization. -# - It may require specifying regional endpoints when creating the service -# client as shown in https://cloud.google.com/ruby/docs/reference. -# -# This is an auto-generated example demonstrating basic usage of -# Google::Cloud::Security::PrivateCA::V1beta1::CertificateAuthorityService::Client#restore_certificate_authority. -# -def restore_certificate_authority - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::Security::PrivateCA::V1beta1::CertificateAuthorityService::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::Security::PrivateCA::V1beta1::RestoreCertificateAuthorityRequest.new - - # Call the restore_certificate_authority method. - result = client.restore_certificate_authority 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 privateca_v1beta1_generated_CertificateAuthorityService_RestoreCertificateAuthority_sync] diff --git a/owl-bot-staging/google-cloud-security-private_ca-v1beta1/snippets/certificate_authority_service/revoke_certificate.rb b/owl-bot-staging/google-cloud-security-private_ca-v1beta1/snippets/certificate_authority_service/revoke_certificate.rb deleted file mode 100644 index 08d0bd7161b6..000000000000 --- a/owl-bot-staging/google-cloud-security-private_ca-v1beta1/snippets/certificate_authority_service/revoke_certificate.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 privateca_v1beta1_generated_CertificateAuthorityService_RevokeCertificate_sync] -require "google/cloud/security/private_ca/v1beta1" - -## -# Snippet for the revoke_certificate call in the CertificateAuthorityService service -# -# This snippet has been automatically generated and should be regarded as a code -# template only. It will require modifications to work: -# - It may require correct/in-range values for request initialization. -# - It may require specifying regional endpoints when creating the service -# client as shown in https://cloud.google.com/ruby/docs/reference. -# -# This is an auto-generated example demonstrating basic usage of -# Google::Cloud::Security::PrivateCA::V1beta1::CertificateAuthorityService::Client#revoke_certificate. -# -def revoke_certificate - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::Security::PrivateCA::V1beta1::CertificateAuthorityService::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::Security::PrivateCA::V1beta1::RevokeCertificateRequest.new - - # Call the revoke_certificate method. - result = client.revoke_certificate request - - # The returned object is of type Google::Cloud::Security::PrivateCA::V1beta1::Certificate. - p result -end -# [END privateca_v1beta1_generated_CertificateAuthorityService_RevokeCertificate_sync] diff --git a/owl-bot-staging/google-cloud-security-private_ca-v1beta1/snippets/certificate_authority_service/schedule_delete_certificate_authority.rb b/owl-bot-staging/google-cloud-security-private_ca-v1beta1/snippets/certificate_authority_service/schedule_delete_certificate_authority.rb deleted file mode 100644 index 2b22da6654c9..000000000000 --- a/owl-bot-staging/google-cloud-security-private_ca-v1beta1/snippets/certificate_authority_service/schedule_delete_certificate_authority.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 privateca_v1beta1_generated_CertificateAuthorityService_ScheduleDeleteCertificateAuthority_sync] -require "google/cloud/security/private_ca/v1beta1" - -## -# Snippet for the schedule_delete_certificate_authority call in the CertificateAuthorityService service -# -# This snippet has been automatically generated and should be regarded as a code -# template only. It will require modifications to work: -# - It may require correct/in-range values for request initialization. -# - It may require specifying regional endpoints when creating the service -# client as shown in https://cloud.google.com/ruby/docs/reference. -# -# This is an auto-generated example demonstrating basic usage of -# Google::Cloud::Security::PrivateCA::V1beta1::CertificateAuthorityService::Client#schedule_delete_certificate_authority. -# -def schedule_delete_certificate_authority - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::Security::PrivateCA::V1beta1::CertificateAuthorityService::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::Security::PrivateCA::V1beta1::ScheduleDeleteCertificateAuthorityRequest.new - - # Call the schedule_delete_certificate_authority method. - result = client.schedule_delete_certificate_authority 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 privateca_v1beta1_generated_CertificateAuthorityService_ScheduleDeleteCertificateAuthority_sync] diff --git a/owl-bot-staging/google-cloud-security-private_ca-v1beta1/snippets/certificate_authority_service/update_certificate.rb b/owl-bot-staging/google-cloud-security-private_ca-v1beta1/snippets/certificate_authority_service/update_certificate.rb deleted file mode 100644 index eb82a46e2dc6..000000000000 --- a/owl-bot-staging/google-cloud-security-private_ca-v1beta1/snippets/certificate_authority_service/update_certificate.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 privateca_v1beta1_generated_CertificateAuthorityService_UpdateCertificate_sync] -require "google/cloud/security/private_ca/v1beta1" - -## -# Snippet for the update_certificate call in the CertificateAuthorityService service -# -# This snippet has been automatically generated and should be regarded as a code -# template only. It will require modifications to work: -# - It may require correct/in-range values for request initialization. -# - It may require specifying regional endpoints when creating the service -# client as shown in https://cloud.google.com/ruby/docs/reference. -# -# This is an auto-generated example demonstrating basic usage of -# Google::Cloud::Security::PrivateCA::V1beta1::CertificateAuthorityService::Client#update_certificate. -# -def update_certificate - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::Security::PrivateCA::V1beta1::CertificateAuthorityService::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::Security::PrivateCA::V1beta1::UpdateCertificateRequest.new - - # Call the update_certificate method. - result = client.update_certificate request - - # The returned object is of type Google::Cloud::Security::PrivateCA::V1beta1::Certificate. - p result -end -# [END privateca_v1beta1_generated_CertificateAuthorityService_UpdateCertificate_sync] diff --git a/owl-bot-staging/google-cloud-security-private_ca-v1beta1/snippets/certificate_authority_service/update_certificate_authority.rb b/owl-bot-staging/google-cloud-security-private_ca-v1beta1/snippets/certificate_authority_service/update_certificate_authority.rb deleted file mode 100644 index 62a552d0ae19..000000000000 --- a/owl-bot-staging/google-cloud-security-private_ca-v1beta1/snippets/certificate_authority_service/update_certificate_authority.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 privateca_v1beta1_generated_CertificateAuthorityService_UpdateCertificateAuthority_sync] -require "google/cloud/security/private_ca/v1beta1" - -## -# Snippet for the update_certificate_authority call in the CertificateAuthorityService service -# -# This snippet has been automatically generated and should be regarded as a code -# template only. It will require modifications to work: -# - It may require correct/in-range values for request initialization. -# - It may require specifying regional endpoints when creating the service -# client as shown in https://cloud.google.com/ruby/docs/reference. -# -# This is an auto-generated example demonstrating basic usage of -# Google::Cloud::Security::PrivateCA::V1beta1::CertificateAuthorityService::Client#update_certificate_authority. -# -def update_certificate_authority - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::Security::PrivateCA::V1beta1::CertificateAuthorityService::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::Security::PrivateCA::V1beta1::UpdateCertificateAuthorityRequest.new - - # Call the update_certificate_authority method. - result = client.update_certificate_authority 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 privateca_v1beta1_generated_CertificateAuthorityService_UpdateCertificateAuthority_sync] diff --git a/owl-bot-staging/google-cloud-security-private_ca-v1beta1/snippets/certificate_authority_service/update_certificate_revocation_list.rb b/owl-bot-staging/google-cloud-security-private_ca-v1beta1/snippets/certificate_authority_service/update_certificate_revocation_list.rb deleted file mode 100644 index 2755200a457d..000000000000 --- a/owl-bot-staging/google-cloud-security-private_ca-v1beta1/snippets/certificate_authority_service/update_certificate_revocation_list.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 privateca_v1beta1_generated_CertificateAuthorityService_UpdateCertificateRevocationList_sync] -require "google/cloud/security/private_ca/v1beta1" - -## -# Snippet for the update_certificate_revocation_list call in the CertificateAuthorityService service -# -# This snippet has been automatically generated and should be regarded as a code -# template only. It will require modifications to work: -# - It may require correct/in-range values for request initialization. -# - It may require specifying regional endpoints when creating the service -# client as shown in https://cloud.google.com/ruby/docs/reference. -# -# This is an auto-generated example demonstrating basic usage of -# Google::Cloud::Security::PrivateCA::V1beta1::CertificateAuthorityService::Client#update_certificate_revocation_list. -# -def update_certificate_revocation_list - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::Security::PrivateCA::V1beta1::CertificateAuthorityService::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::Security::PrivateCA::V1beta1::UpdateCertificateRevocationListRequest.new - - # Call the update_certificate_revocation_list method. - result = client.update_certificate_revocation_list 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 privateca_v1beta1_generated_CertificateAuthorityService_UpdateCertificateRevocationList_sync] diff --git a/owl-bot-staging/google-cloud-security-private_ca-v1beta1/snippets/snippet_metadata_google.cloud.security.privateca.v1beta1.json b/owl-bot-staging/google-cloud-security-private_ca-v1beta1/snippets/snippet_metadata_google.cloud.security.privateca.v1beta1.json deleted file mode 100644 index 78cd94bd4302..000000000000 --- a/owl-bot-staging/google-cloud-security-private_ca-v1beta1/snippets/snippet_metadata_google.cloud.security.privateca.v1beta1.json +++ /dev/null @@ -1,815 +0,0 @@ -{ - "client_library": { - "name": "google-cloud-security-private_ca-v1beta1", - "version": "", - "language": "RUBY", - "apis": [ - { - "id": "google.cloud.security.privateca.v1beta1", - "version": "v1beta1" - } - ] - }, - "snippets": [ - { - "region_tag": "privateca_v1beta1_generated_CertificateAuthorityService_CreateCertificate_sync", - "title": "Snippet for the create_certificate call in the CertificateAuthorityService service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Security::PrivateCA::V1beta1::CertificateAuthorityService::Client#create_certificate.", - "file": "certificate_authority_service/create_certificate.rb", - "language": "RUBY", - "client_method": { - "short_name": "create_certificate", - "full_name": "::Google::Cloud::Security::PrivateCA::V1beta1::CertificateAuthorityService::Client#create_certificate", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::Security::PrivateCA::V1beta1::CreateCertificateRequest", - "name": "request" - } - ], - "result_type": "::Google::Cloud::Security::PrivateCA::V1beta1::Certificate", - "client": { - "short_name": "CertificateAuthorityService::Client", - "full_name": "::Google::Cloud::Security::PrivateCA::V1beta1::CertificateAuthorityService::Client" - }, - "method": { - "short_name": "CreateCertificate", - "full_name": "google.cloud.security.privateca.v1beta1.CertificateAuthorityService.CreateCertificate", - "service": { - "short_name": "CertificateAuthorityService", - "full_name": "google.cloud.security.privateca.v1beta1.CertificateAuthorityService" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 46, - "type": "FULL" - } - ] - }, - { - "region_tag": "privateca_v1beta1_generated_CertificateAuthorityService_GetCertificate_sync", - "title": "Snippet for the get_certificate call in the CertificateAuthorityService service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Security::PrivateCA::V1beta1::CertificateAuthorityService::Client#get_certificate.", - "file": "certificate_authority_service/get_certificate.rb", - "language": "RUBY", - "client_method": { - "short_name": "get_certificate", - "full_name": "::Google::Cloud::Security::PrivateCA::V1beta1::CertificateAuthorityService::Client#get_certificate", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::Security::PrivateCA::V1beta1::GetCertificateRequest", - "name": "request" - } - ], - "result_type": "::Google::Cloud::Security::PrivateCA::V1beta1::Certificate", - "client": { - "short_name": "CertificateAuthorityService::Client", - "full_name": "::Google::Cloud::Security::PrivateCA::V1beta1::CertificateAuthorityService::Client" - }, - "method": { - "short_name": "GetCertificate", - "full_name": "google.cloud.security.privateca.v1beta1.CertificateAuthorityService.GetCertificate", - "service": { - "short_name": "CertificateAuthorityService", - "full_name": "google.cloud.security.privateca.v1beta1.CertificateAuthorityService" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 46, - "type": "FULL" - } - ] - }, - { - "region_tag": "privateca_v1beta1_generated_CertificateAuthorityService_ListCertificates_sync", - "title": "Snippet for the list_certificates call in the CertificateAuthorityService service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Security::PrivateCA::V1beta1::CertificateAuthorityService::Client#list_certificates.", - "file": "certificate_authority_service/list_certificates.rb", - "language": "RUBY", - "client_method": { - "short_name": "list_certificates", - "full_name": "::Google::Cloud::Security::PrivateCA::V1beta1::CertificateAuthorityService::Client#list_certificates", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::Security::PrivateCA::V1beta1::ListCertificatesRequest", - "name": "request" - } - ], - "result_type": "::Google::Cloud::Security::PrivateCA::V1beta1::ListCertificatesResponse", - "client": { - "short_name": "CertificateAuthorityService::Client", - "full_name": "::Google::Cloud::Security::PrivateCA::V1beta1::CertificateAuthorityService::Client" - }, - "method": { - "short_name": "ListCertificates", - "full_name": "google.cloud.security.privateca.v1beta1.CertificateAuthorityService.ListCertificates", - "service": { - "short_name": "CertificateAuthorityService", - "full_name": "google.cloud.security.privateca.v1beta1.CertificateAuthorityService" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 50, - "type": "FULL" - } - ] - }, - { - "region_tag": "privateca_v1beta1_generated_CertificateAuthorityService_RevokeCertificate_sync", - "title": "Snippet for the revoke_certificate call in the CertificateAuthorityService service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Security::PrivateCA::V1beta1::CertificateAuthorityService::Client#revoke_certificate.", - "file": "certificate_authority_service/revoke_certificate.rb", - "language": "RUBY", - "client_method": { - "short_name": "revoke_certificate", - "full_name": "::Google::Cloud::Security::PrivateCA::V1beta1::CertificateAuthorityService::Client#revoke_certificate", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::Security::PrivateCA::V1beta1::RevokeCertificateRequest", - "name": "request" - } - ], - "result_type": "::Google::Cloud::Security::PrivateCA::V1beta1::Certificate", - "client": { - "short_name": "CertificateAuthorityService::Client", - "full_name": "::Google::Cloud::Security::PrivateCA::V1beta1::CertificateAuthorityService::Client" - }, - "method": { - "short_name": "RevokeCertificate", - "full_name": "google.cloud.security.privateca.v1beta1.CertificateAuthorityService.RevokeCertificate", - "service": { - "short_name": "CertificateAuthorityService", - "full_name": "google.cloud.security.privateca.v1beta1.CertificateAuthorityService" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 46, - "type": "FULL" - } - ] - }, - { - "region_tag": "privateca_v1beta1_generated_CertificateAuthorityService_UpdateCertificate_sync", - "title": "Snippet for the update_certificate call in the CertificateAuthorityService service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Security::PrivateCA::V1beta1::CertificateAuthorityService::Client#update_certificate.", - "file": "certificate_authority_service/update_certificate.rb", - "language": "RUBY", - "client_method": { - "short_name": "update_certificate", - "full_name": "::Google::Cloud::Security::PrivateCA::V1beta1::CertificateAuthorityService::Client#update_certificate", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::Security::PrivateCA::V1beta1::UpdateCertificateRequest", - "name": "request" - } - ], - "result_type": "::Google::Cloud::Security::PrivateCA::V1beta1::Certificate", - "client": { - "short_name": "CertificateAuthorityService::Client", - "full_name": "::Google::Cloud::Security::PrivateCA::V1beta1::CertificateAuthorityService::Client" - }, - "method": { - "short_name": "UpdateCertificate", - "full_name": "google.cloud.security.privateca.v1beta1.CertificateAuthorityService.UpdateCertificate", - "service": { - "short_name": "CertificateAuthorityService", - "full_name": "google.cloud.security.privateca.v1beta1.CertificateAuthorityService" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 46, - "type": "FULL" - } - ] - }, - { - "region_tag": "privateca_v1beta1_generated_CertificateAuthorityService_ActivateCertificateAuthority_sync", - "title": "Snippet for the activate_certificate_authority call in the CertificateAuthorityService service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Security::PrivateCA::V1beta1::CertificateAuthorityService::Client#activate_certificate_authority.", - "file": "certificate_authority_service/activate_certificate_authority.rb", - "language": "RUBY", - "client_method": { - "short_name": "activate_certificate_authority", - "full_name": "::Google::Cloud::Security::PrivateCA::V1beta1::CertificateAuthorityService::Client#activate_certificate_authority", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::Security::PrivateCA::V1beta1::ActivateCertificateAuthorityRequest", - "name": "request" - } - ], - "result_type": "::Google::Longrunning::Operation", - "client": { - "short_name": "CertificateAuthorityService::Client", - "full_name": "::Google::Cloud::Security::PrivateCA::V1beta1::CertificateAuthorityService::Client" - }, - "method": { - "short_name": "ActivateCertificateAuthority", - "full_name": "google.cloud.security.privateca.v1beta1.CertificateAuthorityService.ActivateCertificateAuthority", - "service": { - "short_name": "CertificateAuthorityService", - "full_name": "google.cloud.security.privateca.v1beta1.CertificateAuthorityService" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 53, - "type": "FULL" - } - ] - }, - { - "region_tag": "privateca_v1beta1_generated_CertificateAuthorityService_CreateCertificateAuthority_sync", - "title": "Snippet for the create_certificate_authority call in the CertificateAuthorityService service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Security::PrivateCA::V1beta1::CertificateAuthorityService::Client#create_certificate_authority.", - "file": "certificate_authority_service/create_certificate_authority.rb", - "language": "RUBY", - "client_method": { - "short_name": "create_certificate_authority", - "full_name": "::Google::Cloud::Security::PrivateCA::V1beta1::CertificateAuthorityService::Client#create_certificate_authority", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::Security::PrivateCA::V1beta1::CreateCertificateAuthorityRequest", - "name": "request" - } - ], - "result_type": "::Google::Longrunning::Operation", - "client": { - "short_name": "CertificateAuthorityService::Client", - "full_name": "::Google::Cloud::Security::PrivateCA::V1beta1::CertificateAuthorityService::Client" - }, - "method": { - "short_name": "CreateCertificateAuthority", - "full_name": "google.cloud.security.privateca.v1beta1.CertificateAuthorityService.CreateCertificateAuthority", - "service": { - "short_name": "CertificateAuthorityService", - "full_name": "google.cloud.security.privateca.v1beta1.CertificateAuthorityService" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 53, - "type": "FULL" - } - ] - }, - { - "region_tag": "privateca_v1beta1_generated_CertificateAuthorityService_DisableCertificateAuthority_sync", - "title": "Snippet for the disable_certificate_authority call in the CertificateAuthorityService service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Security::PrivateCA::V1beta1::CertificateAuthorityService::Client#disable_certificate_authority.", - "file": "certificate_authority_service/disable_certificate_authority.rb", - "language": "RUBY", - "client_method": { - "short_name": "disable_certificate_authority", - "full_name": "::Google::Cloud::Security::PrivateCA::V1beta1::CertificateAuthorityService::Client#disable_certificate_authority", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::Security::PrivateCA::V1beta1::DisableCertificateAuthorityRequest", - "name": "request" - } - ], - "result_type": "::Google::Longrunning::Operation", - "client": { - "short_name": "CertificateAuthorityService::Client", - "full_name": "::Google::Cloud::Security::PrivateCA::V1beta1::CertificateAuthorityService::Client" - }, - "method": { - "short_name": "DisableCertificateAuthority", - "full_name": "google.cloud.security.privateca.v1beta1.CertificateAuthorityService.DisableCertificateAuthority", - "service": { - "short_name": "CertificateAuthorityService", - "full_name": "google.cloud.security.privateca.v1beta1.CertificateAuthorityService" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 53, - "type": "FULL" - } - ] - }, - { - "region_tag": "privateca_v1beta1_generated_CertificateAuthorityService_EnableCertificateAuthority_sync", - "title": "Snippet for the enable_certificate_authority call in the CertificateAuthorityService service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Security::PrivateCA::V1beta1::CertificateAuthorityService::Client#enable_certificate_authority.", - "file": "certificate_authority_service/enable_certificate_authority.rb", - "language": "RUBY", - "client_method": { - "short_name": "enable_certificate_authority", - "full_name": "::Google::Cloud::Security::PrivateCA::V1beta1::CertificateAuthorityService::Client#enable_certificate_authority", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::Security::PrivateCA::V1beta1::EnableCertificateAuthorityRequest", - "name": "request" - } - ], - "result_type": "::Google::Longrunning::Operation", - "client": { - "short_name": "CertificateAuthorityService::Client", - "full_name": "::Google::Cloud::Security::PrivateCA::V1beta1::CertificateAuthorityService::Client" - }, - "method": { - "short_name": "EnableCertificateAuthority", - "full_name": "google.cloud.security.privateca.v1beta1.CertificateAuthorityService.EnableCertificateAuthority", - "service": { - "short_name": "CertificateAuthorityService", - "full_name": "google.cloud.security.privateca.v1beta1.CertificateAuthorityService" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 53, - "type": "FULL" - } - ] - }, - { - "region_tag": "privateca_v1beta1_generated_CertificateAuthorityService_FetchCertificateAuthorityCsr_sync", - "title": "Snippet for the fetch_certificate_authority_csr call in the CertificateAuthorityService service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Security::PrivateCA::V1beta1::CertificateAuthorityService::Client#fetch_certificate_authority_csr.", - "file": "certificate_authority_service/fetch_certificate_authority_csr.rb", - "language": "RUBY", - "client_method": { - "short_name": "fetch_certificate_authority_csr", - "full_name": "::Google::Cloud::Security::PrivateCA::V1beta1::CertificateAuthorityService::Client#fetch_certificate_authority_csr", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::Security::PrivateCA::V1beta1::FetchCertificateAuthorityCsrRequest", - "name": "request" - } - ], - "result_type": "::Google::Cloud::Security::PrivateCA::V1beta1::FetchCertificateAuthorityCsrResponse", - "client": { - "short_name": "CertificateAuthorityService::Client", - "full_name": "::Google::Cloud::Security::PrivateCA::V1beta1::CertificateAuthorityService::Client" - }, - "method": { - "short_name": "FetchCertificateAuthorityCsr", - "full_name": "google.cloud.security.privateca.v1beta1.CertificateAuthorityService.FetchCertificateAuthorityCsr", - "service": { - "short_name": "CertificateAuthorityService", - "full_name": "google.cloud.security.privateca.v1beta1.CertificateAuthorityService" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 46, - "type": "FULL" - } - ] - }, - { - "region_tag": "privateca_v1beta1_generated_CertificateAuthorityService_GetCertificateAuthority_sync", - "title": "Snippet for the get_certificate_authority call in the CertificateAuthorityService service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Security::PrivateCA::V1beta1::CertificateAuthorityService::Client#get_certificate_authority.", - "file": "certificate_authority_service/get_certificate_authority.rb", - "language": "RUBY", - "client_method": { - "short_name": "get_certificate_authority", - "full_name": "::Google::Cloud::Security::PrivateCA::V1beta1::CertificateAuthorityService::Client#get_certificate_authority", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::Security::PrivateCA::V1beta1::GetCertificateAuthorityRequest", - "name": "request" - } - ], - "result_type": "::Google::Cloud::Security::PrivateCA::V1beta1::CertificateAuthority", - "client": { - "short_name": "CertificateAuthorityService::Client", - "full_name": "::Google::Cloud::Security::PrivateCA::V1beta1::CertificateAuthorityService::Client" - }, - "method": { - "short_name": "GetCertificateAuthority", - "full_name": "google.cloud.security.privateca.v1beta1.CertificateAuthorityService.GetCertificateAuthority", - "service": { - "short_name": "CertificateAuthorityService", - "full_name": "google.cloud.security.privateca.v1beta1.CertificateAuthorityService" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 46, - "type": "FULL" - } - ] - }, - { - "region_tag": "privateca_v1beta1_generated_CertificateAuthorityService_ListCertificateAuthorities_sync", - "title": "Snippet for the list_certificate_authorities call in the CertificateAuthorityService service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Security::PrivateCA::V1beta1::CertificateAuthorityService::Client#list_certificate_authorities.", - "file": "certificate_authority_service/list_certificate_authorities.rb", - "language": "RUBY", - "client_method": { - "short_name": "list_certificate_authorities", - "full_name": "::Google::Cloud::Security::PrivateCA::V1beta1::CertificateAuthorityService::Client#list_certificate_authorities", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::Security::PrivateCA::V1beta1::ListCertificateAuthoritiesRequest", - "name": "request" - } - ], - "result_type": "::Google::Cloud::Security::PrivateCA::V1beta1::ListCertificateAuthoritiesResponse", - "client": { - "short_name": "CertificateAuthorityService::Client", - "full_name": "::Google::Cloud::Security::PrivateCA::V1beta1::CertificateAuthorityService::Client" - }, - "method": { - "short_name": "ListCertificateAuthorities", - "full_name": "google.cloud.security.privateca.v1beta1.CertificateAuthorityService.ListCertificateAuthorities", - "service": { - "short_name": "CertificateAuthorityService", - "full_name": "google.cloud.security.privateca.v1beta1.CertificateAuthorityService" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 50, - "type": "FULL" - } - ] - }, - { - "region_tag": "privateca_v1beta1_generated_CertificateAuthorityService_RestoreCertificateAuthority_sync", - "title": "Snippet for the restore_certificate_authority call in the CertificateAuthorityService service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Security::PrivateCA::V1beta1::CertificateAuthorityService::Client#restore_certificate_authority.", - "file": "certificate_authority_service/restore_certificate_authority.rb", - "language": "RUBY", - "client_method": { - "short_name": "restore_certificate_authority", - "full_name": "::Google::Cloud::Security::PrivateCA::V1beta1::CertificateAuthorityService::Client#restore_certificate_authority", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::Security::PrivateCA::V1beta1::RestoreCertificateAuthorityRequest", - "name": "request" - } - ], - "result_type": "::Google::Longrunning::Operation", - "client": { - "short_name": "CertificateAuthorityService::Client", - "full_name": "::Google::Cloud::Security::PrivateCA::V1beta1::CertificateAuthorityService::Client" - }, - "method": { - "short_name": "RestoreCertificateAuthority", - "full_name": "google.cloud.security.privateca.v1beta1.CertificateAuthorityService.RestoreCertificateAuthority", - "service": { - "short_name": "CertificateAuthorityService", - "full_name": "google.cloud.security.privateca.v1beta1.CertificateAuthorityService" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 53, - "type": "FULL" - } - ] - }, - { - "region_tag": "privateca_v1beta1_generated_CertificateAuthorityService_ScheduleDeleteCertificateAuthority_sync", - "title": "Snippet for the schedule_delete_certificate_authority call in the CertificateAuthorityService service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Security::PrivateCA::V1beta1::CertificateAuthorityService::Client#schedule_delete_certificate_authority.", - "file": "certificate_authority_service/schedule_delete_certificate_authority.rb", - "language": "RUBY", - "client_method": { - "short_name": "schedule_delete_certificate_authority", - "full_name": "::Google::Cloud::Security::PrivateCA::V1beta1::CertificateAuthorityService::Client#schedule_delete_certificate_authority", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::Security::PrivateCA::V1beta1::ScheduleDeleteCertificateAuthorityRequest", - "name": "request" - } - ], - "result_type": "::Google::Longrunning::Operation", - "client": { - "short_name": "CertificateAuthorityService::Client", - "full_name": "::Google::Cloud::Security::PrivateCA::V1beta1::CertificateAuthorityService::Client" - }, - "method": { - "short_name": "ScheduleDeleteCertificateAuthority", - "full_name": "google.cloud.security.privateca.v1beta1.CertificateAuthorityService.ScheduleDeleteCertificateAuthority", - "service": { - "short_name": "CertificateAuthorityService", - "full_name": "google.cloud.security.privateca.v1beta1.CertificateAuthorityService" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 53, - "type": "FULL" - } - ] - }, - { - "region_tag": "privateca_v1beta1_generated_CertificateAuthorityService_UpdateCertificateAuthority_sync", - "title": "Snippet for the update_certificate_authority call in the CertificateAuthorityService service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Security::PrivateCA::V1beta1::CertificateAuthorityService::Client#update_certificate_authority.", - "file": "certificate_authority_service/update_certificate_authority.rb", - "language": "RUBY", - "client_method": { - "short_name": "update_certificate_authority", - "full_name": "::Google::Cloud::Security::PrivateCA::V1beta1::CertificateAuthorityService::Client#update_certificate_authority", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::Security::PrivateCA::V1beta1::UpdateCertificateAuthorityRequest", - "name": "request" - } - ], - "result_type": "::Google::Longrunning::Operation", - "client": { - "short_name": "CertificateAuthorityService::Client", - "full_name": "::Google::Cloud::Security::PrivateCA::V1beta1::CertificateAuthorityService::Client" - }, - "method": { - "short_name": "UpdateCertificateAuthority", - "full_name": "google.cloud.security.privateca.v1beta1.CertificateAuthorityService.UpdateCertificateAuthority", - "service": { - "short_name": "CertificateAuthorityService", - "full_name": "google.cloud.security.privateca.v1beta1.CertificateAuthorityService" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 53, - "type": "FULL" - } - ] - }, - { - "region_tag": "privateca_v1beta1_generated_CertificateAuthorityService_GetCertificateRevocationList_sync", - "title": "Snippet for the get_certificate_revocation_list call in the CertificateAuthorityService service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Security::PrivateCA::V1beta1::CertificateAuthorityService::Client#get_certificate_revocation_list.", - "file": "certificate_authority_service/get_certificate_revocation_list.rb", - "language": "RUBY", - "client_method": { - "short_name": "get_certificate_revocation_list", - "full_name": "::Google::Cloud::Security::PrivateCA::V1beta1::CertificateAuthorityService::Client#get_certificate_revocation_list", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::Security::PrivateCA::V1beta1::GetCertificateRevocationListRequest", - "name": "request" - } - ], - "result_type": "::Google::Cloud::Security::PrivateCA::V1beta1::CertificateRevocationList", - "client": { - "short_name": "CertificateAuthorityService::Client", - "full_name": "::Google::Cloud::Security::PrivateCA::V1beta1::CertificateAuthorityService::Client" - }, - "method": { - "short_name": "GetCertificateRevocationList", - "full_name": "google.cloud.security.privateca.v1beta1.CertificateAuthorityService.GetCertificateRevocationList", - "service": { - "short_name": "CertificateAuthorityService", - "full_name": "google.cloud.security.privateca.v1beta1.CertificateAuthorityService" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 46, - "type": "FULL" - } - ] - }, - { - "region_tag": "privateca_v1beta1_generated_CertificateAuthorityService_ListCertificateRevocationLists_sync", - "title": "Snippet for the list_certificate_revocation_lists call in the CertificateAuthorityService service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Security::PrivateCA::V1beta1::CertificateAuthorityService::Client#list_certificate_revocation_lists.", - "file": "certificate_authority_service/list_certificate_revocation_lists.rb", - "language": "RUBY", - "client_method": { - "short_name": "list_certificate_revocation_lists", - "full_name": "::Google::Cloud::Security::PrivateCA::V1beta1::CertificateAuthorityService::Client#list_certificate_revocation_lists", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::Security::PrivateCA::V1beta1::ListCertificateRevocationListsRequest", - "name": "request" - } - ], - "result_type": "::Google::Cloud::Security::PrivateCA::V1beta1::ListCertificateRevocationListsResponse", - "client": { - "short_name": "CertificateAuthorityService::Client", - "full_name": "::Google::Cloud::Security::PrivateCA::V1beta1::CertificateAuthorityService::Client" - }, - "method": { - "short_name": "ListCertificateRevocationLists", - "full_name": "google.cloud.security.privateca.v1beta1.CertificateAuthorityService.ListCertificateRevocationLists", - "service": { - "short_name": "CertificateAuthorityService", - "full_name": "google.cloud.security.privateca.v1beta1.CertificateAuthorityService" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 50, - "type": "FULL" - } - ] - }, - { - "region_tag": "privateca_v1beta1_generated_CertificateAuthorityService_UpdateCertificateRevocationList_sync", - "title": "Snippet for the update_certificate_revocation_list call in the CertificateAuthorityService service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Security::PrivateCA::V1beta1::CertificateAuthorityService::Client#update_certificate_revocation_list.", - "file": "certificate_authority_service/update_certificate_revocation_list.rb", - "language": "RUBY", - "client_method": { - "short_name": "update_certificate_revocation_list", - "full_name": "::Google::Cloud::Security::PrivateCA::V1beta1::CertificateAuthorityService::Client#update_certificate_revocation_list", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::Security::PrivateCA::V1beta1::UpdateCertificateRevocationListRequest", - "name": "request" - } - ], - "result_type": "::Google::Longrunning::Operation", - "client": { - "short_name": "CertificateAuthorityService::Client", - "full_name": "::Google::Cloud::Security::PrivateCA::V1beta1::CertificateAuthorityService::Client" - }, - "method": { - "short_name": "UpdateCertificateRevocationList", - "full_name": "google.cloud.security.privateca.v1beta1.CertificateAuthorityService.UpdateCertificateRevocationList", - "service": { - "short_name": "CertificateAuthorityService", - "full_name": "google.cloud.security.privateca.v1beta1.CertificateAuthorityService" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 53, - "type": "FULL" - } - ] - }, - { - "region_tag": "privateca_v1beta1_generated_CertificateAuthorityService_GetReusableConfig_sync", - "title": "Snippet for the get_reusable_config call in the CertificateAuthorityService service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Security::PrivateCA::V1beta1::CertificateAuthorityService::Client#get_reusable_config.", - "file": "certificate_authority_service/get_reusable_config.rb", - "language": "RUBY", - "client_method": { - "short_name": "get_reusable_config", - "full_name": "::Google::Cloud::Security::PrivateCA::V1beta1::CertificateAuthorityService::Client#get_reusable_config", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::Security::PrivateCA::V1beta1::GetReusableConfigRequest", - "name": "request" - } - ], - "result_type": "::Google::Cloud::Security::PrivateCA::V1beta1::ReusableConfig", - "client": { - "short_name": "CertificateAuthorityService::Client", - "full_name": "::Google::Cloud::Security::PrivateCA::V1beta1::CertificateAuthorityService::Client" - }, - "method": { - "short_name": "GetReusableConfig", - "full_name": "google.cloud.security.privateca.v1beta1.CertificateAuthorityService.GetReusableConfig", - "service": { - "short_name": "CertificateAuthorityService", - "full_name": "google.cloud.security.privateca.v1beta1.CertificateAuthorityService" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 46, - "type": "FULL" - } - ] - }, - { - "region_tag": "privateca_v1beta1_generated_CertificateAuthorityService_ListReusableConfigs_sync", - "title": "Snippet for the list_reusable_configs call in the CertificateAuthorityService service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Security::PrivateCA::V1beta1::CertificateAuthorityService::Client#list_reusable_configs.", - "file": "certificate_authority_service/list_reusable_configs.rb", - "language": "RUBY", - "client_method": { - "short_name": "list_reusable_configs", - "full_name": "::Google::Cloud::Security::PrivateCA::V1beta1::CertificateAuthorityService::Client#list_reusable_configs", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::Security::PrivateCA::V1beta1::ListReusableConfigsRequest", - "name": "request" - } - ], - "result_type": "::Google::Cloud::Security::PrivateCA::V1beta1::ListReusableConfigsResponse", - "client": { - "short_name": "CertificateAuthorityService::Client", - "full_name": "::Google::Cloud::Security::PrivateCA::V1beta1::CertificateAuthorityService::Client" - }, - "method": { - "short_name": "ListReusableConfigs", - "full_name": "google.cloud.security.privateca.v1beta1.CertificateAuthorityService.ListReusableConfigs", - "service": { - "short_name": "CertificateAuthorityService", - "full_name": "google.cloud.security.privateca.v1beta1.CertificateAuthorityService" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 50, - "type": "FULL" - } - ] - } - ] -} \ No newline at end of file diff --git a/owl-bot-staging/google-cloud-security-private_ca-v1beta1/test/google/cloud/security/private_ca/v1beta1/certificate_authority_service_operations_test.rb b/owl-bot-staging/google-cloud-security-private_ca-v1beta1/test/google/cloud/security/private_ca/v1beta1/certificate_authority_service_operations_test.rb deleted file mode 100644 index 8004da61f35d..000000000000 --- a/owl-bot-staging/google-cloud-security-private_ca-v1beta1/test/google/cloud/security/private_ca/v1beta1/certificate_authority_service_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/cloud/security/privateca/v1beta1/service_pb" -require "google/cloud/security/privateca/v1beta1/service_services_pb" -require "google/cloud/security/private_ca/v1beta1/certificate_authority_service" - -class ::Google::Cloud::Security::PrivateCA::V1beta1::CertificateAuthorityService::OperationsTest < Minitest::Test - class ClientStub - attr_accessor :call_rpc_count, :requests - - def initialize response, operation, &block - @response = response - @operation = operation - @block = block - @call_rpc_count = 0 - @requests = [] - end - - def call_rpc *args, **kwargs - @call_rpc_count += 1 - - @requests << @block&.call(*args, **kwargs) - - catch :response do - yield @response, @operation if block_given? - @response - end - end - - def endpoint - "endpoint.example.com" - end - - def universe_domain - "example.com" - end - - def stub_logger - nil - end - - def logger - nil - end - end - - def test_list_operations - # Create GRPC objects. - grpc_response = ::Google::Longrunning::ListOperationsResponse.new - grpc_operation = GRPC::ActiveCall::Operation.new nil - grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - grpc_options = {} - - # Create request parameters for a unary method. - name = "hello world" - filter = "hello world" - page_size = 42 - page_token = "hello world" - return_partial_success = true - - list_operations_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :list_operations, name - assert_kind_of ::Google::Longrunning::ListOperationsRequest, request - assert_equal "hello world", request["name"] - assert_equal "hello world", request["filter"] - assert_equal 42, request["page_size"] - assert_equal "hello world", request["page_token"] - assert_equal true, request["return_partial_success"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, list_operations_client_stub do - # Create client - client = ::Google::Cloud::Security::PrivateCA::V1beta1::CertificateAuthorityService::Operations.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.list_operations({ name: name, filter: filter, page_size: page_size, page_token: page_token, return_partial_success: return_partial_success }) do |response, operation| - assert_kind_of Gapic::PagedEnumerable, response - assert_equal grpc_response, response.response - assert_equal grpc_operation, operation - end - - # Use named arguments - client.list_operations name: name, filter: filter, page_size: page_size, page_token: page_token, return_partial_success: return_partial_success do |response, operation| - assert_kind_of Gapic::PagedEnumerable, response - assert_equal grpc_response, response.response - assert_equal grpc_operation, operation - end - - # Use protobuf object - client.list_operations ::Google::Longrunning::ListOperationsRequest.new(name: name, filter: filter, page_size: page_size, page_token: page_token, return_partial_success: return_partial_success) do |response, operation| - assert_kind_of Gapic::PagedEnumerable, response - assert_equal grpc_response, response.response - assert_equal grpc_operation, operation - end - - # Use hash object with options - client.list_operations({ name: name, filter: filter, page_size: page_size, page_token: page_token, return_partial_success: return_partial_success }, grpc_options) do |response, operation| - assert_kind_of Gapic::PagedEnumerable, response - assert_equal grpc_response, response.response - assert_equal grpc_operation, operation - end - - # Use protobuf object with options - client.list_operations(::Google::Longrunning::ListOperationsRequest.new(name: name, filter: filter, page_size: page_size, page_token: page_token, return_partial_success: return_partial_success), grpc_options) do |response, operation| - assert_kind_of Gapic::PagedEnumerable, response - assert_equal grpc_response, response.response - assert_equal grpc_operation, operation - end - - # Verify method calls - assert_equal 5, list_operations_client_stub.call_rpc_count - end - end - - def test_get_operation - # Create GRPC objects. - grpc_response = ::Google::Longrunning::Operation.new - grpc_operation = GRPC::ActiveCall::Operation.new nil - grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - grpc_options = {} - - # Create request parameters for a unary method. - name = "hello world" - - get_operation_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :get_operation, name - assert_kind_of ::Google::Longrunning::GetOperationRequest, request - assert_equal "hello world", request["name"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, get_operation_client_stub do - # Create client - client = ::Google::Cloud::Security::PrivateCA::V1beta1::CertificateAuthorityService::Operations.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.get_operation({ name: name }) do |response, operation| - assert_kind_of Gapic::Operation, response - assert_equal grpc_response, response.grpc_op - assert_equal grpc_operation, operation - end - - # Use named arguments - client.get_operation name: name do |response, operation| - assert_kind_of Gapic::Operation, response - assert_equal grpc_response, response.grpc_op - assert_equal grpc_operation, operation - end - - # Use protobuf object - client.get_operation ::Google::Longrunning::GetOperationRequest.new(name: name) do |response, operation| - assert_kind_of Gapic::Operation, response - assert_equal grpc_response, response.grpc_op - assert_equal grpc_operation, operation - end - - # Use hash object with options - client.get_operation({ name: name }, grpc_options) do |response, operation| - assert_kind_of Gapic::Operation, response - assert_equal grpc_response, response.grpc_op - assert_equal grpc_operation, operation - end - - # Use protobuf object with options - client.get_operation(::Google::Longrunning::GetOperationRequest.new(name: name), grpc_options) do |response, operation| - assert_kind_of Gapic::Operation, response - assert_equal grpc_response, response.grpc_op - assert_equal grpc_operation, operation - end - - # Verify method calls - assert_equal 5, get_operation_client_stub.call_rpc_count - end - end - - def test_delete_operation - # Create GRPC objects. - grpc_response = ::Google::Protobuf::Empty.new - grpc_operation = GRPC::ActiveCall::Operation.new nil - grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - grpc_options = {} - - # Create request parameters for a unary method. - name = "hello world" - - delete_operation_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :delete_operation, name - assert_kind_of ::Google::Longrunning::DeleteOperationRequest, request - assert_equal "hello world", request["name"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, delete_operation_client_stub do - # Create client - client = ::Google::Cloud::Security::PrivateCA::V1beta1::CertificateAuthorityService::Operations.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.delete_operation({ name: name }) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use named arguments - client.delete_operation name: name do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object - client.delete_operation ::Google::Longrunning::DeleteOperationRequest.new(name: name) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use hash object with options - client.delete_operation({ name: name }, grpc_options) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object with options - client.delete_operation(::Google::Longrunning::DeleteOperationRequest.new(name: name), grpc_options) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Verify method calls - assert_equal 5, delete_operation_client_stub.call_rpc_count - end - end - - def test_cancel_operation - # Create GRPC objects. - grpc_response = ::Google::Protobuf::Empty.new - grpc_operation = GRPC::ActiveCall::Operation.new nil - grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - grpc_options = {} - - # Create request parameters for a unary method. - name = "hello world" - - cancel_operation_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :cancel_operation, name - assert_kind_of ::Google::Longrunning::CancelOperationRequest, request - assert_equal "hello world", request["name"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, cancel_operation_client_stub do - # Create client - client = ::Google::Cloud::Security::PrivateCA::V1beta1::CertificateAuthorityService::Operations.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.cancel_operation({ name: name }) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use named arguments - client.cancel_operation name: name do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object - client.cancel_operation ::Google::Longrunning::CancelOperationRequest.new(name: name) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use hash object with options - client.cancel_operation({ name: name }, grpc_options) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object with options - client.cancel_operation(::Google::Longrunning::CancelOperationRequest.new(name: name), grpc_options) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Verify method calls - assert_equal 5, cancel_operation_client_stub.call_rpc_count - end - end - - def test_wait_operation - # Create GRPC objects. - grpc_response = ::Google::Longrunning::Operation.new - grpc_operation = GRPC::ActiveCall::Operation.new nil - grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - grpc_options = {} - - # Create request parameters for a unary method. - name = "hello world" - timeout = {} - - wait_operation_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :wait_operation, name - assert_kind_of ::Google::Longrunning::WaitOperationRequest, request - assert_equal "hello world", request["name"] - assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Protobuf::Duration), request["timeout"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, wait_operation_client_stub do - # Create client - client = ::Google::Cloud::Security::PrivateCA::V1beta1::CertificateAuthorityService::Operations.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.wait_operation({ name: name, timeout: timeout }) do |response, operation| - assert_kind_of Gapic::Operation, response - assert_equal grpc_response, response.grpc_op - assert_equal grpc_operation, operation - end - - # Use named arguments - client.wait_operation name: name, timeout: timeout do |response, operation| - assert_kind_of Gapic::Operation, response - assert_equal grpc_response, response.grpc_op - assert_equal grpc_operation, operation - end - - # Use protobuf object - client.wait_operation ::Google::Longrunning::WaitOperationRequest.new(name: name, timeout: timeout) do |response, operation| - assert_kind_of Gapic::Operation, response - assert_equal grpc_response, response.grpc_op - assert_equal grpc_operation, operation - end - - # Use hash object with options - client.wait_operation({ name: name, timeout: timeout }, grpc_options) do |response, operation| - assert_kind_of Gapic::Operation, response - assert_equal grpc_response, response.grpc_op - assert_equal grpc_operation, operation - end - - # Use protobuf object with options - client.wait_operation(::Google::Longrunning::WaitOperationRequest.new(name: name, timeout: timeout), grpc_options) do |response, operation| - assert_kind_of Gapic::Operation, response - assert_equal grpc_response, response.grpc_op - assert_equal grpc_operation, operation - end - - # Verify method calls - assert_equal 5, wait_operation_client_stub.call_rpc_count - end - end - - def test_configure - grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - - client = block_config = config = nil - dummy_stub = ClientStub.new nil, nil - Gapic::ServiceStub.stub :new, dummy_stub do - client = ::Google::Cloud::Security::PrivateCA::V1beta1::CertificateAuthorityService::Operations.new do |config| - config.credentials = grpc_channel - end - end - - config = client.configure do |c| - block_config = c - end - - assert_same block_config, config - assert_kind_of ::Google::Cloud::Security::PrivateCA::V1beta1::CertificateAuthorityService::Operations::Configuration, config - end -end diff --git a/owl-bot-staging/google-cloud-security-private_ca-v1beta1/test/google/cloud/security/private_ca/v1beta1/certificate_authority_service_paths_test.rb b/owl-bot-staging/google-cloud-security-private_ca-v1beta1/test/google/cloud/security/private_ca/v1beta1/certificate_authority_service_paths_test.rb deleted file mode 100644 index 7c0d1c542ef3..000000000000 --- a/owl-bot-staging/google-cloud-security-private_ca-v1beta1/test/google/cloud/security/private_ca/v1beta1/certificate_authority_service_paths_test.rb +++ /dev/null @@ -1,103 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -require "helper" - -require "gapic/grpc/service_stub" - -require "google/cloud/security/private_ca/v1beta1/certificate_authority_service" - -class ::Google::Cloud::Security::PrivateCA::V1beta1::CertificateAuthorityService::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_certificate_path - grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - ::Gapic::ServiceStub.stub :new, DummyStub.new do - client = ::Google::Cloud::Security::PrivateCA::V1beta1::CertificateAuthorityService::Client.new do |config| - config.credentials = grpc_channel - end - - path = client.certificate_path project: "value0", location: "value1", certificate_authority: "value2", certificate: "value3" - assert_equal "projects/value0/locations/value1/certificateAuthorities/value2/certificates/value3", path - end - end - - def test_certificate_authority_path - grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - ::Gapic::ServiceStub.stub :new, DummyStub.new do - client = ::Google::Cloud::Security::PrivateCA::V1beta1::CertificateAuthorityService::Client.new do |config| - config.credentials = grpc_channel - end - - path = client.certificate_authority_path project: "value0", location: "value1", certificate_authority: "value2" - assert_equal "projects/value0/locations/value1/certificateAuthorities/value2", path - end - end - - def test_certificate_revocation_list_path - grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - ::Gapic::ServiceStub.stub :new, DummyStub.new do - client = ::Google::Cloud::Security::PrivateCA::V1beta1::CertificateAuthorityService::Client.new do |config| - config.credentials = grpc_channel - end - - path = client.certificate_revocation_list_path project: "value0", location: "value1", certificate_authority: "value2", certificate_revocation_list: "value3" - assert_equal "projects/value0/locations/value1/certificateAuthorities/value2/certificateRevocationLists/value3", path - end - end - - def test_location_path - grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - ::Gapic::ServiceStub.stub :new, DummyStub.new do - client = ::Google::Cloud::Security::PrivateCA::V1beta1::CertificateAuthorityService::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_reusable_config_path - grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - ::Gapic::ServiceStub.stub :new, DummyStub.new do - client = ::Google::Cloud::Security::PrivateCA::V1beta1::CertificateAuthorityService::Client.new do |config| - config.credentials = grpc_channel - end - - path = client.reusable_config_path project: "value0", location: "value1", reusable_config: "value2" - assert_equal "projects/value0/locations/value1/reusableConfigs/value2", path - end - end -end diff --git a/owl-bot-staging/google-cloud-security-private_ca-v1beta1/test/google/cloud/security/private_ca/v1beta1/certificate_authority_service_rest_test.rb b/owl-bot-staging/google-cloud-security-private_ca-v1beta1/test/google/cloud/security/private_ca/v1beta1/certificate_authority_service_rest_test.rb deleted file mode 100644 index 4222ffbc14e5..000000000000 --- a/owl-bot-staging/google-cloud-security-private_ca-v1beta1/test/google/cloud/security/private_ca/v1beta1/certificate_authority_service_rest_test.rb +++ /dev/null @@ -1,1216 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -require "helper" -require "gapic/rest" -require "google/cloud/security/privateca/v1beta1/service_pb" -require "google/cloud/security/private_ca/v1beta1/certificate_authority_service/rest" - - -class ::Google::Cloud::Security::PrivateCA::V1beta1::CertificateAuthorityService::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_certificate - # Create test objects. - client_result = ::Google::Cloud::Security::PrivateCA::V1beta1::Certificate.new - http_response = OpenStruct.new body: client_result.to_json - - call_options = {} - - # Create request parameters for a unary method. - parent = "hello world" - certificate_id = "hello world" - certificate = {} - request_id = "hello world" - - create_certificate_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| - assert options.metadata.key? :"x-goog-api-client" - assert options.metadata[:"x-goog-api-client"].include? "rest" - refute options.metadata[:"x-goog-api-client"].include? "grpc" - end - - ::Google::Cloud::Security::PrivateCA::V1beta1::CertificateAuthorityService::Rest::ServiceStub.stub :transcode_create_certificate_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, create_certificate_client_stub do - # Create client - client = ::Google::Cloud::Security::PrivateCA::V1beta1::CertificateAuthorityService::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - client.create_certificate({ parent: parent, certificate_id: certificate_id, certificate: certificate, request_id: request_id }) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use named arguments - client.create_certificate parent: parent, certificate_id: certificate_id, certificate: certificate, request_id: request_id do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object - client.create_certificate ::Google::Cloud::Security::PrivateCA::V1beta1::CreateCertificateRequest.new(parent: parent, certificate_id: certificate_id, certificate: certificate, request_id: request_id) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use hash object with options - client.create_certificate({ parent: parent, certificate_id: certificate_id, certificate: certificate, request_id: request_id }, call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object with options - client.create_certificate(::Google::Cloud::Security::PrivateCA::V1beta1::CreateCertificateRequest.new(parent: parent, certificate_id: certificate_id, certificate: certificate, request_id: request_id), call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Verify method calls - assert_equal 5, create_certificate_client_stub.call_count - end - end - end - - def test_get_certificate - # Create test objects. - client_result = ::Google::Cloud::Security::PrivateCA::V1beta1::Certificate.new - http_response = OpenStruct.new body: client_result.to_json - - call_options = {} - - # Create request parameters for a unary method. - name = "hello world" - - get_certificate_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| - assert options.metadata.key? :"x-goog-api-client" - assert options.metadata[:"x-goog-api-client"].include? "rest" - refute options.metadata[:"x-goog-api-client"].include? "grpc" - end - - ::Google::Cloud::Security::PrivateCA::V1beta1::CertificateAuthorityService::Rest::ServiceStub.stub :transcode_get_certificate_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, get_certificate_client_stub do - # Create client - client = ::Google::Cloud::Security::PrivateCA::V1beta1::CertificateAuthorityService::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - client.get_certificate({ name: name }) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use named arguments - client.get_certificate name: name do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object - client.get_certificate ::Google::Cloud::Security::PrivateCA::V1beta1::GetCertificateRequest.new(name: name) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use hash object with options - client.get_certificate({ name: name }, call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object with options - client.get_certificate(::Google::Cloud::Security::PrivateCA::V1beta1::GetCertificateRequest.new(name: name), call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Verify method calls - assert_equal 5, get_certificate_client_stub.call_count - end - end - end - - def test_list_certificates - # Create test objects. - client_result = ::Google::Cloud::Security::PrivateCA::V1beta1::ListCertificatesResponse.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" - order_by = "hello world" - - list_certificates_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| - assert options.metadata.key? :"x-goog-api-client" - assert options.metadata[:"x-goog-api-client"].include? "rest" - refute options.metadata[:"x-goog-api-client"].include? "grpc" - end - - ::Google::Cloud::Security::PrivateCA::V1beta1::CertificateAuthorityService::Rest::ServiceStub.stub :transcode_list_certificates_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, list_certificates_client_stub do - # Create client - client = ::Google::Cloud::Security::PrivateCA::V1beta1::CertificateAuthorityService::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - client.list_certificates({ parent: parent, page_size: page_size, page_token: page_token, filter: filter, order_by: order_by }) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use named arguments - client.list_certificates parent: parent, page_size: page_size, page_token: page_token, filter: filter, order_by: order_by do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object - client.list_certificates ::Google::Cloud::Security::PrivateCA::V1beta1::ListCertificatesRequest.new(parent: parent, page_size: page_size, page_token: page_token, filter: filter, order_by: order_by) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use hash object with options - client.list_certificates({ parent: parent, page_size: page_size, page_token: page_token, filter: filter, order_by: order_by }, call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object with options - client.list_certificates(::Google::Cloud::Security::PrivateCA::V1beta1::ListCertificatesRequest.new(parent: parent, page_size: page_size, page_token: page_token, filter: filter, order_by: order_by), call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Verify method calls - assert_equal 5, list_certificates_client_stub.call_count - end - end - end - - def test_revoke_certificate - # Create test objects. - client_result = ::Google::Cloud::Security::PrivateCA::V1beta1::Certificate.new - http_response = OpenStruct.new body: client_result.to_json - - call_options = {} - - # Create request parameters for a unary method. - name = "hello world" - reason = :REVOCATION_REASON_UNSPECIFIED - request_id = "hello world" - - revoke_certificate_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| - assert options.metadata.key? :"x-goog-api-client" - assert options.metadata[:"x-goog-api-client"].include? "rest" - refute options.metadata[:"x-goog-api-client"].include? "grpc" - end - - ::Google::Cloud::Security::PrivateCA::V1beta1::CertificateAuthorityService::Rest::ServiceStub.stub :transcode_revoke_certificate_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, revoke_certificate_client_stub do - # Create client - client = ::Google::Cloud::Security::PrivateCA::V1beta1::CertificateAuthorityService::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - client.revoke_certificate({ name: name, reason: reason, request_id: request_id }) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use named arguments - client.revoke_certificate name: name, reason: reason, request_id: request_id do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object - client.revoke_certificate ::Google::Cloud::Security::PrivateCA::V1beta1::RevokeCertificateRequest.new(name: name, reason: reason, request_id: request_id) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use hash object with options - client.revoke_certificate({ name: name, reason: reason, request_id: request_id }, call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object with options - client.revoke_certificate(::Google::Cloud::Security::PrivateCA::V1beta1::RevokeCertificateRequest.new(name: name, reason: reason, request_id: request_id), call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Verify method calls - assert_equal 5, revoke_certificate_client_stub.call_count - end - end - end - - def test_update_certificate - # Create test objects. - client_result = ::Google::Cloud::Security::PrivateCA::V1beta1::Certificate.new - http_response = OpenStruct.new body: client_result.to_json - - call_options = {} - - # Create request parameters for a unary method. - certificate = {} - update_mask = {} - request_id = "hello world" - - update_certificate_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| - assert options.metadata.key? :"x-goog-api-client" - assert options.metadata[:"x-goog-api-client"].include? "rest" - refute options.metadata[:"x-goog-api-client"].include? "grpc" - end - - ::Google::Cloud::Security::PrivateCA::V1beta1::CertificateAuthorityService::Rest::ServiceStub.stub :transcode_update_certificate_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, update_certificate_client_stub do - # Create client - client = ::Google::Cloud::Security::PrivateCA::V1beta1::CertificateAuthorityService::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - client.update_certificate({ certificate: certificate, update_mask: update_mask, request_id: request_id }) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use named arguments - client.update_certificate certificate: certificate, update_mask: update_mask, request_id: request_id do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object - client.update_certificate ::Google::Cloud::Security::PrivateCA::V1beta1::UpdateCertificateRequest.new(certificate: certificate, update_mask: update_mask, request_id: request_id) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use hash object with options - client.update_certificate({ certificate: certificate, update_mask: update_mask, request_id: request_id }, call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object with options - client.update_certificate(::Google::Cloud::Security::PrivateCA::V1beta1::UpdateCertificateRequest.new(certificate: certificate, update_mask: update_mask, request_id: request_id), call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Verify method calls - assert_equal 5, update_certificate_client_stub.call_count - end - end - end - - def test_activate_certificate_authority - # 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" - pem_ca_certificate = "hello world" - subordinate_config = {} - request_id = "hello world" - - activate_certificate_authority_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| - assert options.metadata.key? :"x-goog-api-client" - assert options.metadata[:"x-goog-api-client"].include? "rest" - refute options.metadata[:"x-goog-api-client"].include? "grpc" - end - - ::Google::Cloud::Security::PrivateCA::V1beta1::CertificateAuthorityService::Rest::ServiceStub.stub :transcode_activate_certificate_authority_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, activate_certificate_authority_client_stub do - # Create client - client = ::Google::Cloud::Security::PrivateCA::V1beta1::CertificateAuthorityService::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - client.activate_certificate_authority({ name: name, pem_ca_certificate: pem_ca_certificate, subordinate_config: subordinate_config, request_id: request_id }) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use named arguments - client.activate_certificate_authority name: name, pem_ca_certificate: pem_ca_certificate, subordinate_config: subordinate_config, request_id: request_id do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object - client.activate_certificate_authority ::Google::Cloud::Security::PrivateCA::V1beta1::ActivateCertificateAuthorityRequest.new(name: name, pem_ca_certificate: pem_ca_certificate, subordinate_config: subordinate_config, request_id: request_id) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use hash object with options - client.activate_certificate_authority({ name: name, pem_ca_certificate: pem_ca_certificate, subordinate_config: subordinate_config, request_id: request_id }, call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object with options - client.activate_certificate_authority(::Google::Cloud::Security::PrivateCA::V1beta1::ActivateCertificateAuthorityRequest.new(name: name, pem_ca_certificate: pem_ca_certificate, subordinate_config: subordinate_config, request_id: request_id), call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Verify method calls - assert_equal 5, activate_certificate_authority_client_stub.call_count - end - end - end - - def test_create_certificate_authority - # 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" - certificate_authority_id = "hello world" - certificate_authority = {} - request_id = "hello world" - - create_certificate_authority_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| - assert options.metadata.key? :"x-goog-api-client" - assert options.metadata[:"x-goog-api-client"].include? "rest" - refute options.metadata[:"x-goog-api-client"].include? "grpc" - end - - ::Google::Cloud::Security::PrivateCA::V1beta1::CertificateAuthorityService::Rest::ServiceStub.stub :transcode_create_certificate_authority_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, create_certificate_authority_client_stub do - # Create client - client = ::Google::Cloud::Security::PrivateCA::V1beta1::CertificateAuthorityService::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - client.create_certificate_authority({ parent: parent, certificate_authority_id: certificate_authority_id, certificate_authority: certificate_authority, request_id: request_id }) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use named arguments - client.create_certificate_authority parent: parent, certificate_authority_id: certificate_authority_id, certificate_authority: certificate_authority, request_id: request_id do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object - client.create_certificate_authority ::Google::Cloud::Security::PrivateCA::V1beta1::CreateCertificateAuthorityRequest.new(parent: parent, certificate_authority_id: certificate_authority_id, certificate_authority: certificate_authority, request_id: request_id) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use hash object with options - client.create_certificate_authority({ parent: parent, certificate_authority_id: certificate_authority_id, certificate_authority: certificate_authority, request_id: request_id }, call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object with options - client.create_certificate_authority(::Google::Cloud::Security::PrivateCA::V1beta1::CreateCertificateAuthorityRequest.new(parent: parent, certificate_authority_id: certificate_authority_id, certificate_authority: certificate_authority, request_id: request_id), call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Verify method calls - assert_equal 5, create_certificate_authority_client_stub.call_count - end - end - end - - def test_disable_certificate_authority - # 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" - request_id = "hello world" - - disable_certificate_authority_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| - assert options.metadata.key? :"x-goog-api-client" - assert options.metadata[:"x-goog-api-client"].include? "rest" - refute options.metadata[:"x-goog-api-client"].include? "grpc" - end - - ::Google::Cloud::Security::PrivateCA::V1beta1::CertificateAuthorityService::Rest::ServiceStub.stub :transcode_disable_certificate_authority_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, disable_certificate_authority_client_stub do - # Create client - client = ::Google::Cloud::Security::PrivateCA::V1beta1::CertificateAuthorityService::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - client.disable_certificate_authority({ name: name, request_id: request_id }) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use named arguments - client.disable_certificate_authority name: name, request_id: request_id do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object - client.disable_certificate_authority ::Google::Cloud::Security::PrivateCA::V1beta1::DisableCertificateAuthorityRequest.new(name: name, request_id: request_id) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use hash object with options - client.disable_certificate_authority({ name: name, request_id: request_id }, call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object with options - client.disable_certificate_authority(::Google::Cloud::Security::PrivateCA::V1beta1::DisableCertificateAuthorityRequest.new(name: name, request_id: request_id), call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Verify method calls - assert_equal 5, disable_certificate_authority_client_stub.call_count - end - end - end - - def test_enable_certificate_authority - # 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" - request_id = "hello world" - - enable_certificate_authority_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| - assert options.metadata.key? :"x-goog-api-client" - assert options.metadata[:"x-goog-api-client"].include? "rest" - refute options.metadata[:"x-goog-api-client"].include? "grpc" - end - - ::Google::Cloud::Security::PrivateCA::V1beta1::CertificateAuthorityService::Rest::ServiceStub.stub :transcode_enable_certificate_authority_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, enable_certificate_authority_client_stub do - # Create client - client = ::Google::Cloud::Security::PrivateCA::V1beta1::CertificateAuthorityService::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - client.enable_certificate_authority({ name: name, request_id: request_id }) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use named arguments - client.enable_certificate_authority name: name, request_id: request_id do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object - client.enable_certificate_authority ::Google::Cloud::Security::PrivateCA::V1beta1::EnableCertificateAuthorityRequest.new(name: name, request_id: request_id) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use hash object with options - client.enable_certificate_authority({ name: name, request_id: request_id }, call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object with options - client.enable_certificate_authority(::Google::Cloud::Security::PrivateCA::V1beta1::EnableCertificateAuthorityRequest.new(name: name, request_id: request_id), call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Verify method calls - assert_equal 5, enable_certificate_authority_client_stub.call_count - end - end - end - - def test_fetch_certificate_authority_csr - # Create test objects. - client_result = ::Google::Cloud::Security::PrivateCA::V1beta1::FetchCertificateAuthorityCsrResponse.new - http_response = OpenStruct.new body: client_result.to_json - - call_options = {} - - # Create request parameters for a unary method. - name = "hello world" - - fetch_certificate_authority_csr_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| - assert options.metadata.key? :"x-goog-api-client" - assert options.metadata[:"x-goog-api-client"].include? "rest" - refute options.metadata[:"x-goog-api-client"].include? "grpc" - end - - ::Google::Cloud::Security::PrivateCA::V1beta1::CertificateAuthorityService::Rest::ServiceStub.stub :transcode_fetch_certificate_authority_csr_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, fetch_certificate_authority_csr_client_stub do - # Create client - client = ::Google::Cloud::Security::PrivateCA::V1beta1::CertificateAuthorityService::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - client.fetch_certificate_authority_csr({ name: name }) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use named arguments - client.fetch_certificate_authority_csr name: name do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object - client.fetch_certificate_authority_csr ::Google::Cloud::Security::PrivateCA::V1beta1::FetchCertificateAuthorityCsrRequest.new(name: name) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use hash object with options - client.fetch_certificate_authority_csr({ name: name }, call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object with options - client.fetch_certificate_authority_csr(::Google::Cloud::Security::PrivateCA::V1beta1::FetchCertificateAuthorityCsrRequest.new(name: name), call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Verify method calls - assert_equal 5, fetch_certificate_authority_csr_client_stub.call_count - end - end - end - - def test_get_certificate_authority - # Create test objects. - client_result = ::Google::Cloud::Security::PrivateCA::V1beta1::CertificateAuthority.new - http_response = OpenStruct.new body: client_result.to_json - - call_options = {} - - # Create request parameters for a unary method. - name = "hello world" - - get_certificate_authority_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| - assert options.metadata.key? :"x-goog-api-client" - assert options.metadata[:"x-goog-api-client"].include? "rest" - refute options.metadata[:"x-goog-api-client"].include? "grpc" - end - - ::Google::Cloud::Security::PrivateCA::V1beta1::CertificateAuthorityService::Rest::ServiceStub.stub :transcode_get_certificate_authority_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, get_certificate_authority_client_stub do - # Create client - client = ::Google::Cloud::Security::PrivateCA::V1beta1::CertificateAuthorityService::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - client.get_certificate_authority({ name: name }) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use named arguments - client.get_certificate_authority name: name do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object - client.get_certificate_authority ::Google::Cloud::Security::PrivateCA::V1beta1::GetCertificateAuthorityRequest.new(name: name) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use hash object with options - client.get_certificate_authority({ name: name }, call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object with options - client.get_certificate_authority(::Google::Cloud::Security::PrivateCA::V1beta1::GetCertificateAuthorityRequest.new(name: name), call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Verify method calls - assert_equal 5, get_certificate_authority_client_stub.call_count - end - end - end - - def test_list_certificate_authorities - # Create test objects. - client_result = ::Google::Cloud::Security::PrivateCA::V1beta1::ListCertificateAuthoritiesResponse.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" - order_by = "hello world" - - list_certificate_authorities_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| - assert options.metadata.key? :"x-goog-api-client" - assert options.metadata[:"x-goog-api-client"].include? "rest" - refute options.metadata[:"x-goog-api-client"].include? "grpc" - end - - ::Google::Cloud::Security::PrivateCA::V1beta1::CertificateAuthorityService::Rest::ServiceStub.stub :transcode_list_certificate_authorities_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, list_certificate_authorities_client_stub do - # Create client - client = ::Google::Cloud::Security::PrivateCA::V1beta1::CertificateAuthorityService::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - client.list_certificate_authorities({ parent: parent, page_size: page_size, page_token: page_token, filter: filter, order_by: order_by }) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use named arguments - client.list_certificate_authorities parent: parent, page_size: page_size, page_token: page_token, filter: filter, order_by: order_by do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object - client.list_certificate_authorities ::Google::Cloud::Security::PrivateCA::V1beta1::ListCertificateAuthoritiesRequest.new(parent: parent, page_size: page_size, page_token: page_token, filter: filter, order_by: order_by) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use hash object with options - client.list_certificate_authorities({ parent: parent, page_size: page_size, page_token: page_token, filter: filter, order_by: order_by }, call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object with options - client.list_certificate_authorities(::Google::Cloud::Security::PrivateCA::V1beta1::ListCertificateAuthoritiesRequest.new(parent: parent, page_size: page_size, page_token: page_token, filter: filter, order_by: order_by), call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Verify method calls - assert_equal 5, list_certificate_authorities_client_stub.call_count - end - end - end - - def test_restore_certificate_authority - # 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" - request_id = "hello world" - - restore_certificate_authority_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| - assert options.metadata.key? :"x-goog-api-client" - assert options.metadata[:"x-goog-api-client"].include? "rest" - refute options.metadata[:"x-goog-api-client"].include? "grpc" - end - - ::Google::Cloud::Security::PrivateCA::V1beta1::CertificateAuthorityService::Rest::ServiceStub.stub :transcode_restore_certificate_authority_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, restore_certificate_authority_client_stub do - # Create client - client = ::Google::Cloud::Security::PrivateCA::V1beta1::CertificateAuthorityService::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - client.restore_certificate_authority({ name: name, request_id: request_id }) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use named arguments - client.restore_certificate_authority name: name, request_id: request_id do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object - client.restore_certificate_authority ::Google::Cloud::Security::PrivateCA::V1beta1::RestoreCertificateAuthorityRequest.new(name: name, request_id: request_id) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use hash object with options - client.restore_certificate_authority({ name: name, request_id: request_id }, call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object with options - client.restore_certificate_authority(::Google::Cloud::Security::PrivateCA::V1beta1::RestoreCertificateAuthorityRequest.new(name: name, request_id: request_id), call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Verify method calls - assert_equal 5, restore_certificate_authority_client_stub.call_count - end - end - end - - def test_schedule_delete_certificate_authority - # 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" - request_id = "hello world" - - schedule_delete_certificate_authority_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| - assert options.metadata.key? :"x-goog-api-client" - assert options.metadata[:"x-goog-api-client"].include? "rest" - refute options.metadata[:"x-goog-api-client"].include? "grpc" - end - - ::Google::Cloud::Security::PrivateCA::V1beta1::CertificateAuthorityService::Rest::ServiceStub.stub :transcode_schedule_delete_certificate_authority_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, schedule_delete_certificate_authority_client_stub do - # Create client - client = ::Google::Cloud::Security::PrivateCA::V1beta1::CertificateAuthorityService::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - client.schedule_delete_certificate_authority({ name: name, request_id: request_id }) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use named arguments - client.schedule_delete_certificate_authority name: name, request_id: request_id do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object - client.schedule_delete_certificate_authority ::Google::Cloud::Security::PrivateCA::V1beta1::ScheduleDeleteCertificateAuthorityRequest.new(name: name, request_id: request_id) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use hash object with options - client.schedule_delete_certificate_authority({ name: name, request_id: request_id }, call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object with options - client.schedule_delete_certificate_authority(::Google::Cloud::Security::PrivateCA::V1beta1::ScheduleDeleteCertificateAuthorityRequest.new(name: name, request_id: request_id), call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Verify method calls - assert_equal 5, schedule_delete_certificate_authority_client_stub.call_count - end - end - end - - def test_update_certificate_authority - # 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. - certificate_authority = {} - update_mask = {} - request_id = "hello world" - - update_certificate_authority_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| - assert options.metadata.key? :"x-goog-api-client" - assert options.metadata[:"x-goog-api-client"].include? "rest" - refute options.metadata[:"x-goog-api-client"].include? "grpc" - end - - ::Google::Cloud::Security::PrivateCA::V1beta1::CertificateAuthorityService::Rest::ServiceStub.stub :transcode_update_certificate_authority_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, update_certificate_authority_client_stub do - # Create client - client = ::Google::Cloud::Security::PrivateCA::V1beta1::CertificateAuthorityService::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - client.update_certificate_authority({ certificate_authority: certificate_authority, update_mask: update_mask, request_id: request_id }) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use named arguments - client.update_certificate_authority certificate_authority: certificate_authority, update_mask: update_mask, request_id: request_id do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object - client.update_certificate_authority ::Google::Cloud::Security::PrivateCA::V1beta1::UpdateCertificateAuthorityRequest.new(certificate_authority: certificate_authority, update_mask: update_mask, request_id: request_id) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use hash object with options - client.update_certificate_authority({ certificate_authority: certificate_authority, update_mask: update_mask, request_id: request_id }, call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object with options - client.update_certificate_authority(::Google::Cloud::Security::PrivateCA::V1beta1::UpdateCertificateAuthorityRequest.new(certificate_authority: certificate_authority, update_mask: update_mask, request_id: request_id), call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Verify method calls - assert_equal 5, update_certificate_authority_client_stub.call_count - end - end - end - - def test_get_certificate_revocation_list - # Create test objects. - client_result = ::Google::Cloud::Security::PrivateCA::V1beta1::CertificateRevocationList.new - http_response = OpenStruct.new body: client_result.to_json - - call_options = {} - - # Create request parameters for a unary method. - name = "hello world" - - get_certificate_revocation_list_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| - assert options.metadata.key? :"x-goog-api-client" - assert options.metadata[:"x-goog-api-client"].include? "rest" - refute options.metadata[:"x-goog-api-client"].include? "grpc" - end - - ::Google::Cloud::Security::PrivateCA::V1beta1::CertificateAuthorityService::Rest::ServiceStub.stub :transcode_get_certificate_revocation_list_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, get_certificate_revocation_list_client_stub do - # Create client - client = ::Google::Cloud::Security::PrivateCA::V1beta1::CertificateAuthorityService::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - client.get_certificate_revocation_list({ name: name }) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use named arguments - client.get_certificate_revocation_list name: name do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object - client.get_certificate_revocation_list ::Google::Cloud::Security::PrivateCA::V1beta1::GetCertificateRevocationListRequest.new(name: name) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use hash object with options - client.get_certificate_revocation_list({ name: name }, call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object with options - client.get_certificate_revocation_list(::Google::Cloud::Security::PrivateCA::V1beta1::GetCertificateRevocationListRequest.new(name: name), call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Verify method calls - assert_equal 5, get_certificate_revocation_list_client_stub.call_count - end - end - end - - def test_list_certificate_revocation_lists - # Create test objects. - client_result = ::Google::Cloud::Security::PrivateCA::V1beta1::ListCertificateRevocationListsResponse.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" - order_by = "hello world" - - list_certificate_revocation_lists_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| - assert options.metadata.key? :"x-goog-api-client" - assert options.metadata[:"x-goog-api-client"].include? "rest" - refute options.metadata[:"x-goog-api-client"].include? "grpc" - end - - ::Google::Cloud::Security::PrivateCA::V1beta1::CertificateAuthorityService::Rest::ServiceStub.stub :transcode_list_certificate_revocation_lists_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, list_certificate_revocation_lists_client_stub do - # Create client - client = ::Google::Cloud::Security::PrivateCA::V1beta1::CertificateAuthorityService::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - client.list_certificate_revocation_lists({ parent: parent, page_size: page_size, page_token: page_token, filter: filter, order_by: order_by }) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use named arguments - client.list_certificate_revocation_lists parent: parent, page_size: page_size, page_token: page_token, filter: filter, order_by: order_by do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object - client.list_certificate_revocation_lists ::Google::Cloud::Security::PrivateCA::V1beta1::ListCertificateRevocationListsRequest.new(parent: parent, page_size: page_size, page_token: page_token, filter: filter, order_by: order_by) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use hash object with options - client.list_certificate_revocation_lists({ parent: parent, page_size: page_size, page_token: page_token, filter: filter, order_by: order_by }, call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object with options - client.list_certificate_revocation_lists(::Google::Cloud::Security::PrivateCA::V1beta1::ListCertificateRevocationListsRequest.new(parent: parent, page_size: page_size, page_token: page_token, filter: filter, order_by: order_by), call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Verify method calls - assert_equal 5, list_certificate_revocation_lists_client_stub.call_count - end - end - end - - def test_update_certificate_revocation_list - # 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. - certificate_revocation_list = {} - update_mask = {} - request_id = "hello world" - - update_certificate_revocation_list_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| - assert options.metadata.key? :"x-goog-api-client" - assert options.metadata[:"x-goog-api-client"].include? "rest" - refute options.metadata[:"x-goog-api-client"].include? "grpc" - end - - ::Google::Cloud::Security::PrivateCA::V1beta1::CertificateAuthorityService::Rest::ServiceStub.stub :transcode_update_certificate_revocation_list_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, update_certificate_revocation_list_client_stub do - # Create client - client = ::Google::Cloud::Security::PrivateCA::V1beta1::CertificateAuthorityService::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - client.update_certificate_revocation_list({ certificate_revocation_list: certificate_revocation_list, update_mask: update_mask, request_id: request_id }) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use named arguments - client.update_certificate_revocation_list certificate_revocation_list: certificate_revocation_list, update_mask: update_mask, request_id: request_id do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object - client.update_certificate_revocation_list ::Google::Cloud::Security::PrivateCA::V1beta1::UpdateCertificateRevocationListRequest.new(certificate_revocation_list: certificate_revocation_list, update_mask: update_mask, request_id: request_id) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use hash object with options - client.update_certificate_revocation_list({ certificate_revocation_list: certificate_revocation_list, update_mask: update_mask, request_id: request_id }, call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object with options - client.update_certificate_revocation_list(::Google::Cloud::Security::PrivateCA::V1beta1::UpdateCertificateRevocationListRequest.new(certificate_revocation_list: certificate_revocation_list, update_mask: update_mask, request_id: request_id), call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Verify method calls - assert_equal 5, update_certificate_revocation_list_client_stub.call_count - end - end - end - - def test_get_reusable_config - # Create test objects. - client_result = ::Google::Cloud::Security::PrivateCA::V1beta1::ReusableConfig.new - http_response = OpenStruct.new body: client_result.to_json - - call_options = {} - - # Create request parameters for a unary method. - name = "hello world" - - get_reusable_config_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| - assert options.metadata.key? :"x-goog-api-client" - assert options.metadata[:"x-goog-api-client"].include? "rest" - refute options.metadata[:"x-goog-api-client"].include? "grpc" - end - - ::Google::Cloud::Security::PrivateCA::V1beta1::CertificateAuthorityService::Rest::ServiceStub.stub :transcode_get_reusable_config_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, get_reusable_config_client_stub do - # Create client - client = ::Google::Cloud::Security::PrivateCA::V1beta1::CertificateAuthorityService::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - client.get_reusable_config({ name: name }) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use named arguments - client.get_reusable_config name: name do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object - client.get_reusable_config ::Google::Cloud::Security::PrivateCA::V1beta1::GetReusableConfigRequest.new(name: name) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use hash object with options - client.get_reusable_config({ name: name }, call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object with options - client.get_reusable_config(::Google::Cloud::Security::PrivateCA::V1beta1::GetReusableConfigRequest.new(name: name), call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Verify method calls - assert_equal 5, get_reusable_config_client_stub.call_count - end - end - end - - def test_list_reusable_configs - # Create test objects. - client_result = ::Google::Cloud::Security::PrivateCA::V1beta1::ListReusableConfigsResponse.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" - order_by = "hello world" - - list_reusable_configs_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| - assert options.metadata.key? :"x-goog-api-client" - assert options.metadata[:"x-goog-api-client"].include? "rest" - refute options.metadata[:"x-goog-api-client"].include? "grpc" - end - - ::Google::Cloud::Security::PrivateCA::V1beta1::CertificateAuthorityService::Rest::ServiceStub.stub :transcode_list_reusable_configs_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, list_reusable_configs_client_stub do - # Create client - client = ::Google::Cloud::Security::PrivateCA::V1beta1::CertificateAuthorityService::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - client.list_reusable_configs({ parent: parent, page_size: page_size, page_token: page_token, filter: filter, order_by: order_by }) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use named arguments - client.list_reusable_configs parent: parent, page_size: page_size, page_token: page_token, filter: filter, order_by: order_by do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object - client.list_reusable_configs ::Google::Cloud::Security::PrivateCA::V1beta1::ListReusableConfigsRequest.new(parent: parent, page_size: page_size, page_token: page_token, filter: filter, order_by: order_by) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use hash object with options - client.list_reusable_configs({ parent: parent, page_size: page_size, page_token: page_token, filter: filter, order_by: order_by }, call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object with options - client.list_reusable_configs(::Google::Cloud::Security::PrivateCA::V1beta1::ListReusableConfigsRequest.new(parent: parent, page_size: page_size, page_token: page_token, filter: filter, order_by: order_by), call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Verify method calls - assert_equal 5, list_reusable_configs_client_stub.call_count - end - end - end - - def test_configure - credentials_token = :dummy_value - - client = block_config = config = nil - dummy_stub = ClientStub.new nil - Gapic::Rest::ClientStub.stub :new, dummy_stub do - client = ::Google::Cloud::Security::PrivateCA::V1beta1::CertificateAuthorityService::Rest::Client.new do |config| - config.credentials = credentials_token - end - end - - config = client.configure do |c| - block_config = c - end - - assert_same block_config, config - assert_kind_of ::Google::Cloud::Security::PrivateCA::V1beta1::CertificateAuthorityService::Rest::Client::Configuration, config - end -end diff --git a/owl-bot-staging/google-cloud-security-private_ca-v1beta1/test/google/cloud/security/private_ca/v1beta1/certificate_authority_service_test.rb b/owl-bot-staging/google-cloud-security-private_ca-v1beta1/test/google/cloud/security/private_ca/v1beta1/certificate_authority_service_test.rb deleted file mode 100644 index 9344cc18168d..000000000000 --- a/owl-bot-staging/google-cloud-security-private_ca-v1beta1/test/google/cloud/security/private_ca/v1beta1/certificate_authority_service_test.rb +++ /dev/null @@ -1,1412 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -require "helper" - -require "gapic/grpc/service_stub" - -require "google/cloud/security/privateca/v1beta1/service_pb" -require "google/cloud/security/private_ca/v1beta1/certificate_authority_service" - -class ::Google::Cloud::Security::PrivateCA::V1beta1::CertificateAuthorityService::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_certificate - # Create GRPC objects. - grpc_response = ::Google::Cloud::Security::PrivateCA::V1beta1::Certificate.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" - certificate_id = "hello world" - certificate = {} - request_id = "hello world" - - create_certificate_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :create_certificate, name - assert_kind_of ::Google::Cloud::Security::PrivateCA::V1beta1::CreateCertificateRequest, request - assert_equal "hello world", request["parent"] - assert_equal "hello world", request["certificate_id"] - assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::Security::PrivateCA::V1beta1::Certificate), request["certificate"] - assert_equal "hello world", request["request_id"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, create_certificate_client_stub do - # Create client - client = ::Google::Cloud::Security::PrivateCA::V1beta1::CertificateAuthorityService::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.create_certificate({ parent: parent, certificate_id: certificate_id, certificate: certificate, request_id: request_id }) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use named arguments - client.create_certificate parent: parent, certificate_id: certificate_id, certificate: certificate, request_id: request_id do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object - client.create_certificate ::Google::Cloud::Security::PrivateCA::V1beta1::CreateCertificateRequest.new(parent: parent, certificate_id: certificate_id, certificate: certificate, request_id: request_id) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use hash object with options - client.create_certificate({ parent: parent, certificate_id: certificate_id, certificate: certificate, request_id: request_id }, grpc_options) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object with options - client.create_certificate(::Google::Cloud::Security::PrivateCA::V1beta1::CreateCertificateRequest.new(parent: parent, certificate_id: certificate_id, certificate: certificate, request_id: request_id), grpc_options) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Verify method calls - assert_equal 5, create_certificate_client_stub.call_rpc_count - end - end - - def test_get_certificate - # Create GRPC objects. - grpc_response = ::Google::Cloud::Security::PrivateCA::V1beta1::Certificate.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_certificate_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :get_certificate, name - assert_kind_of ::Google::Cloud::Security::PrivateCA::V1beta1::GetCertificateRequest, request - assert_equal "hello world", request["name"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, get_certificate_client_stub do - # Create client - client = ::Google::Cloud::Security::PrivateCA::V1beta1::CertificateAuthorityService::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.get_certificate({ name: name }) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use named arguments - client.get_certificate name: name do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object - client.get_certificate ::Google::Cloud::Security::PrivateCA::V1beta1::GetCertificateRequest.new(name: name) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use hash object with options - client.get_certificate({ 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_certificate(::Google::Cloud::Security::PrivateCA::V1beta1::GetCertificateRequest.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_certificate_client_stub.call_rpc_count - end - end - - def test_list_certificates - # Create GRPC objects. - grpc_response = ::Google::Cloud::Security::PrivateCA::V1beta1::ListCertificatesResponse.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" - order_by = "hello world" - - list_certificates_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :list_certificates, name - assert_kind_of ::Google::Cloud::Security::PrivateCA::V1beta1::ListCertificatesRequest, 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"] - assert_equal "hello world", request["order_by"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, list_certificates_client_stub do - # Create client - client = ::Google::Cloud::Security::PrivateCA::V1beta1::CertificateAuthorityService::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.list_certificates({ parent: parent, page_size: page_size, page_token: page_token, filter: filter, order_by: order_by }) 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_certificates parent: parent, page_size: page_size, page_token: page_token, filter: filter, order_by: order_by 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_certificates ::Google::Cloud::Security::PrivateCA::V1beta1::ListCertificatesRequest.new(parent: parent, page_size: page_size, page_token: page_token, filter: filter, order_by: order_by) 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_certificates({ parent: parent, page_size: page_size, page_token: page_token, filter: filter, order_by: order_by }, 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_certificates(::Google::Cloud::Security::PrivateCA::V1beta1::ListCertificatesRequest.new(parent: parent, page_size: page_size, page_token: page_token, filter: filter, order_by: order_by), 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_certificates_client_stub.call_rpc_count - end - end - - def test_revoke_certificate - # Create GRPC objects. - grpc_response = ::Google::Cloud::Security::PrivateCA::V1beta1::Certificate.new - grpc_operation = GRPC::ActiveCall::Operation.new nil - grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - grpc_options = {} - - # Create request parameters for a unary method. - name = "hello world" - reason = :REVOCATION_REASON_UNSPECIFIED - request_id = "hello world" - - revoke_certificate_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :revoke_certificate, name - assert_kind_of ::Google::Cloud::Security::PrivateCA::V1beta1::RevokeCertificateRequest, request - assert_equal "hello world", request["name"] - assert_equal :REVOCATION_REASON_UNSPECIFIED, request["reason"] - assert_equal "hello world", request["request_id"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, revoke_certificate_client_stub do - # Create client - client = ::Google::Cloud::Security::PrivateCA::V1beta1::CertificateAuthorityService::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.revoke_certificate({ name: name, reason: reason, request_id: request_id }) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use named arguments - client.revoke_certificate name: name, reason: reason, request_id: request_id do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object - client.revoke_certificate ::Google::Cloud::Security::PrivateCA::V1beta1::RevokeCertificateRequest.new(name: name, reason: reason, request_id: request_id) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use hash object with options - client.revoke_certificate({ name: name, reason: reason, request_id: request_id }, grpc_options) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object with options - client.revoke_certificate(::Google::Cloud::Security::PrivateCA::V1beta1::RevokeCertificateRequest.new(name: name, reason: reason, request_id: request_id), grpc_options) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Verify method calls - assert_equal 5, revoke_certificate_client_stub.call_rpc_count - end - end - - def test_update_certificate - # Create GRPC objects. - grpc_response = ::Google::Cloud::Security::PrivateCA::V1beta1::Certificate.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. - certificate = {} - update_mask = {} - request_id = "hello world" - - update_certificate_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :update_certificate, name - assert_kind_of ::Google::Cloud::Security::PrivateCA::V1beta1::UpdateCertificateRequest, request - assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::Security::PrivateCA::V1beta1::Certificate), request["certificate"] - assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Protobuf::FieldMask), request["update_mask"] - assert_equal "hello world", request["request_id"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, update_certificate_client_stub do - # Create client - client = ::Google::Cloud::Security::PrivateCA::V1beta1::CertificateAuthorityService::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.update_certificate({ certificate: certificate, update_mask: update_mask, request_id: request_id }) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use named arguments - client.update_certificate certificate: certificate, update_mask: update_mask, request_id: request_id do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object - client.update_certificate ::Google::Cloud::Security::PrivateCA::V1beta1::UpdateCertificateRequest.new(certificate: certificate, update_mask: update_mask, request_id: request_id) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use hash object with options - client.update_certificate({ certificate: certificate, update_mask: update_mask, request_id: request_id }, grpc_options) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object with options - client.update_certificate(::Google::Cloud::Security::PrivateCA::V1beta1::UpdateCertificateRequest.new(certificate: certificate, update_mask: update_mask, request_id: request_id), grpc_options) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Verify method calls - assert_equal 5, update_certificate_client_stub.call_rpc_count - end - end - - def test_activate_certificate_authority - # 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" - pem_ca_certificate = "hello world" - subordinate_config = {} - request_id = "hello world" - - activate_certificate_authority_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :activate_certificate_authority, name - assert_kind_of ::Google::Cloud::Security::PrivateCA::V1beta1::ActivateCertificateAuthorityRequest, request - assert_equal "hello world", request["name"] - assert_equal "hello world", request["pem_ca_certificate"] - assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::Security::PrivateCA::V1beta1::SubordinateConfig), request["subordinate_config"] - assert_equal "hello world", request["request_id"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, activate_certificate_authority_client_stub do - # Create client - client = ::Google::Cloud::Security::PrivateCA::V1beta1::CertificateAuthorityService::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.activate_certificate_authority({ name: name, pem_ca_certificate: pem_ca_certificate, subordinate_config: subordinate_config, request_id: request_id }) do |response, operation| - assert_kind_of Gapic::Operation, response - assert_equal grpc_response, response.grpc_op - assert_equal grpc_operation, operation - end - - # Use named arguments - client.activate_certificate_authority name: name, pem_ca_certificate: pem_ca_certificate, subordinate_config: subordinate_config, request_id: request_id do |response, operation| - assert_kind_of Gapic::Operation, response - assert_equal grpc_response, response.grpc_op - assert_equal grpc_operation, operation - end - - # Use protobuf object - client.activate_certificate_authority ::Google::Cloud::Security::PrivateCA::V1beta1::ActivateCertificateAuthorityRequest.new(name: name, pem_ca_certificate: pem_ca_certificate, subordinate_config: subordinate_config, request_id: request_id) do |response, operation| - assert_kind_of Gapic::Operation, response - assert_equal grpc_response, response.grpc_op - assert_equal grpc_operation, operation - end - - # Use hash object with options - client.activate_certificate_authority({ name: name, pem_ca_certificate: pem_ca_certificate, subordinate_config: subordinate_config, request_id: request_id }, grpc_options) do |response, operation| - assert_kind_of Gapic::Operation, response - assert_equal grpc_response, response.grpc_op - assert_equal grpc_operation, operation - end - - # Use protobuf object with options - client.activate_certificate_authority(::Google::Cloud::Security::PrivateCA::V1beta1::ActivateCertificateAuthorityRequest.new(name: name, pem_ca_certificate: pem_ca_certificate, subordinate_config: subordinate_config, request_id: request_id), grpc_options) do |response, operation| - assert_kind_of Gapic::Operation, response - assert_equal grpc_response, response.grpc_op - assert_equal grpc_operation, operation - end - - # Verify method calls - assert_equal 5, activate_certificate_authority_client_stub.call_rpc_count - end - end - - def test_create_certificate_authority - # 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" - certificate_authority_id = "hello world" - certificate_authority = {} - request_id = "hello world" - - create_certificate_authority_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :create_certificate_authority, name - assert_kind_of ::Google::Cloud::Security::PrivateCA::V1beta1::CreateCertificateAuthorityRequest, request - assert_equal "hello world", request["parent"] - assert_equal "hello world", request["certificate_authority_id"] - assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::Security::PrivateCA::V1beta1::CertificateAuthority), request["certificate_authority"] - assert_equal "hello world", request["request_id"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, create_certificate_authority_client_stub do - # Create client - client = ::Google::Cloud::Security::PrivateCA::V1beta1::CertificateAuthorityService::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.create_certificate_authority({ parent: parent, certificate_authority_id: certificate_authority_id, certificate_authority: certificate_authority, request_id: request_id }) do |response, operation| - assert_kind_of Gapic::Operation, response - assert_equal grpc_response, response.grpc_op - assert_equal grpc_operation, operation - end - - # Use named arguments - client.create_certificate_authority parent: parent, certificate_authority_id: certificate_authority_id, certificate_authority: certificate_authority, request_id: request_id do |response, operation| - assert_kind_of Gapic::Operation, response - assert_equal grpc_response, response.grpc_op - assert_equal grpc_operation, operation - end - - # Use protobuf object - client.create_certificate_authority ::Google::Cloud::Security::PrivateCA::V1beta1::CreateCertificateAuthorityRequest.new(parent: parent, certificate_authority_id: certificate_authority_id, certificate_authority: certificate_authority, request_id: request_id) do |response, operation| - assert_kind_of Gapic::Operation, response - assert_equal grpc_response, response.grpc_op - assert_equal grpc_operation, operation - end - - # Use hash object with options - client.create_certificate_authority({ parent: parent, certificate_authority_id: certificate_authority_id, certificate_authority: certificate_authority, request_id: request_id }, grpc_options) do |response, operation| - assert_kind_of Gapic::Operation, response - assert_equal grpc_response, response.grpc_op - assert_equal grpc_operation, operation - end - - # Use protobuf object with options - client.create_certificate_authority(::Google::Cloud::Security::PrivateCA::V1beta1::CreateCertificateAuthorityRequest.new(parent: parent, certificate_authority_id: certificate_authority_id, certificate_authority: certificate_authority, request_id: request_id), grpc_options) do |response, operation| - assert_kind_of Gapic::Operation, response - assert_equal grpc_response, response.grpc_op - assert_equal grpc_operation, operation - end - - # Verify method calls - assert_equal 5, create_certificate_authority_client_stub.call_rpc_count - end - end - - def test_disable_certificate_authority - # 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" - request_id = "hello world" - - disable_certificate_authority_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :disable_certificate_authority, name - assert_kind_of ::Google::Cloud::Security::PrivateCA::V1beta1::DisableCertificateAuthorityRequest, request - assert_equal "hello world", request["name"] - assert_equal "hello world", request["request_id"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, disable_certificate_authority_client_stub do - # Create client - client = ::Google::Cloud::Security::PrivateCA::V1beta1::CertificateAuthorityService::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.disable_certificate_authority({ name: name, request_id: request_id }) do |response, operation| - assert_kind_of Gapic::Operation, response - assert_equal grpc_response, response.grpc_op - assert_equal grpc_operation, operation - end - - # Use named arguments - client.disable_certificate_authority name: name, request_id: request_id do |response, operation| - assert_kind_of Gapic::Operation, response - assert_equal grpc_response, response.grpc_op - assert_equal grpc_operation, operation - end - - # Use protobuf object - client.disable_certificate_authority ::Google::Cloud::Security::PrivateCA::V1beta1::DisableCertificateAuthorityRequest.new(name: name, request_id: request_id) do |response, operation| - assert_kind_of Gapic::Operation, response - assert_equal grpc_response, response.grpc_op - assert_equal grpc_operation, operation - end - - # Use hash object with options - client.disable_certificate_authority({ name: name, request_id: request_id }, grpc_options) do |response, operation| - assert_kind_of Gapic::Operation, response - assert_equal grpc_response, response.grpc_op - assert_equal grpc_operation, operation - end - - # Use protobuf object with options - client.disable_certificate_authority(::Google::Cloud::Security::PrivateCA::V1beta1::DisableCertificateAuthorityRequest.new(name: name, request_id: request_id), grpc_options) do |response, operation| - assert_kind_of Gapic::Operation, response - assert_equal grpc_response, response.grpc_op - assert_equal grpc_operation, operation - end - - # Verify method calls - assert_equal 5, disable_certificate_authority_client_stub.call_rpc_count - end - end - - def test_enable_certificate_authority - # 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" - request_id = "hello world" - - enable_certificate_authority_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :enable_certificate_authority, name - assert_kind_of ::Google::Cloud::Security::PrivateCA::V1beta1::EnableCertificateAuthorityRequest, request - assert_equal "hello world", request["name"] - assert_equal "hello world", request["request_id"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, enable_certificate_authority_client_stub do - # Create client - client = ::Google::Cloud::Security::PrivateCA::V1beta1::CertificateAuthorityService::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.enable_certificate_authority({ name: name, request_id: request_id }) do |response, operation| - assert_kind_of Gapic::Operation, response - assert_equal grpc_response, response.grpc_op - assert_equal grpc_operation, operation - end - - # Use named arguments - client.enable_certificate_authority name: name, request_id: request_id do |response, operation| - assert_kind_of Gapic::Operation, response - assert_equal grpc_response, response.grpc_op - assert_equal grpc_operation, operation - end - - # Use protobuf object - client.enable_certificate_authority ::Google::Cloud::Security::PrivateCA::V1beta1::EnableCertificateAuthorityRequest.new(name: name, request_id: request_id) do |response, operation| - assert_kind_of Gapic::Operation, response - assert_equal grpc_response, response.grpc_op - assert_equal grpc_operation, operation - end - - # Use hash object with options - client.enable_certificate_authority({ name: name, request_id: request_id }, grpc_options) do |response, operation| - assert_kind_of Gapic::Operation, response - assert_equal grpc_response, response.grpc_op - assert_equal grpc_operation, operation - end - - # Use protobuf object with options - client.enable_certificate_authority(::Google::Cloud::Security::PrivateCA::V1beta1::EnableCertificateAuthorityRequest.new(name: name, request_id: request_id), grpc_options) do |response, operation| - assert_kind_of Gapic::Operation, response - assert_equal grpc_response, response.grpc_op - assert_equal grpc_operation, operation - end - - # Verify method calls - assert_equal 5, enable_certificate_authority_client_stub.call_rpc_count - end - end - - def test_fetch_certificate_authority_csr - # Create GRPC objects. - grpc_response = ::Google::Cloud::Security::PrivateCA::V1beta1::FetchCertificateAuthorityCsrResponse.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" - - fetch_certificate_authority_csr_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :fetch_certificate_authority_csr, name - assert_kind_of ::Google::Cloud::Security::PrivateCA::V1beta1::FetchCertificateAuthorityCsrRequest, request - assert_equal "hello world", request["name"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, fetch_certificate_authority_csr_client_stub do - # Create client - client = ::Google::Cloud::Security::PrivateCA::V1beta1::CertificateAuthorityService::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.fetch_certificate_authority_csr({ name: name }) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use named arguments - client.fetch_certificate_authority_csr name: name do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object - client.fetch_certificate_authority_csr ::Google::Cloud::Security::PrivateCA::V1beta1::FetchCertificateAuthorityCsrRequest.new(name: name) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use hash object with options - client.fetch_certificate_authority_csr({ name: name }, grpc_options) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object with options - client.fetch_certificate_authority_csr(::Google::Cloud::Security::PrivateCA::V1beta1::FetchCertificateAuthorityCsrRequest.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, fetch_certificate_authority_csr_client_stub.call_rpc_count - end - end - - def test_get_certificate_authority - # Create GRPC objects. - grpc_response = ::Google::Cloud::Security::PrivateCA::V1beta1::CertificateAuthority.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_certificate_authority_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :get_certificate_authority, name - assert_kind_of ::Google::Cloud::Security::PrivateCA::V1beta1::GetCertificateAuthorityRequest, request - assert_equal "hello world", request["name"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, get_certificate_authority_client_stub do - # Create client - client = ::Google::Cloud::Security::PrivateCA::V1beta1::CertificateAuthorityService::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.get_certificate_authority({ name: name }) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use named arguments - client.get_certificate_authority name: name do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object - client.get_certificate_authority ::Google::Cloud::Security::PrivateCA::V1beta1::GetCertificateAuthorityRequest.new(name: name) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use hash object with options - client.get_certificate_authority({ 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_certificate_authority(::Google::Cloud::Security::PrivateCA::V1beta1::GetCertificateAuthorityRequest.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_certificate_authority_client_stub.call_rpc_count - end - end - - def test_list_certificate_authorities - # Create GRPC objects. - grpc_response = ::Google::Cloud::Security::PrivateCA::V1beta1::ListCertificateAuthoritiesResponse.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" - order_by = "hello world" - - list_certificate_authorities_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :list_certificate_authorities, name - assert_kind_of ::Google::Cloud::Security::PrivateCA::V1beta1::ListCertificateAuthoritiesRequest, 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"] - assert_equal "hello world", request["order_by"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, list_certificate_authorities_client_stub do - # Create client - client = ::Google::Cloud::Security::PrivateCA::V1beta1::CertificateAuthorityService::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.list_certificate_authorities({ parent: parent, page_size: page_size, page_token: page_token, filter: filter, order_by: order_by }) 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_certificate_authorities parent: parent, page_size: page_size, page_token: page_token, filter: filter, order_by: order_by 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_certificate_authorities ::Google::Cloud::Security::PrivateCA::V1beta1::ListCertificateAuthoritiesRequest.new(parent: parent, page_size: page_size, page_token: page_token, filter: filter, order_by: order_by) 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_certificate_authorities({ parent: parent, page_size: page_size, page_token: page_token, filter: filter, order_by: order_by }, 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_certificate_authorities(::Google::Cloud::Security::PrivateCA::V1beta1::ListCertificateAuthoritiesRequest.new(parent: parent, page_size: page_size, page_token: page_token, filter: filter, order_by: order_by), 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_certificate_authorities_client_stub.call_rpc_count - end - end - - def test_restore_certificate_authority - # 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" - request_id = "hello world" - - restore_certificate_authority_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :restore_certificate_authority, name - assert_kind_of ::Google::Cloud::Security::PrivateCA::V1beta1::RestoreCertificateAuthorityRequest, request - assert_equal "hello world", request["name"] - assert_equal "hello world", request["request_id"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, restore_certificate_authority_client_stub do - # Create client - client = ::Google::Cloud::Security::PrivateCA::V1beta1::CertificateAuthorityService::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.restore_certificate_authority({ name: name, request_id: request_id }) do |response, operation| - assert_kind_of Gapic::Operation, response - assert_equal grpc_response, response.grpc_op - assert_equal grpc_operation, operation - end - - # Use named arguments - client.restore_certificate_authority name: name, request_id: request_id do |response, operation| - assert_kind_of Gapic::Operation, response - assert_equal grpc_response, response.grpc_op - assert_equal grpc_operation, operation - end - - # Use protobuf object - client.restore_certificate_authority ::Google::Cloud::Security::PrivateCA::V1beta1::RestoreCertificateAuthorityRequest.new(name: name, request_id: request_id) do |response, operation| - assert_kind_of Gapic::Operation, response - assert_equal grpc_response, response.grpc_op - assert_equal grpc_operation, operation - end - - # Use hash object with options - client.restore_certificate_authority({ name: name, request_id: request_id }, grpc_options) do |response, operation| - assert_kind_of Gapic::Operation, response - assert_equal grpc_response, response.grpc_op - assert_equal grpc_operation, operation - end - - # Use protobuf object with options - client.restore_certificate_authority(::Google::Cloud::Security::PrivateCA::V1beta1::RestoreCertificateAuthorityRequest.new(name: name, request_id: request_id), grpc_options) do |response, operation| - assert_kind_of Gapic::Operation, response - assert_equal grpc_response, response.grpc_op - assert_equal grpc_operation, operation - end - - # Verify method calls - assert_equal 5, restore_certificate_authority_client_stub.call_rpc_count - end - end - - def test_schedule_delete_certificate_authority - # 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" - request_id = "hello world" - - schedule_delete_certificate_authority_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :schedule_delete_certificate_authority, name - assert_kind_of ::Google::Cloud::Security::PrivateCA::V1beta1::ScheduleDeleteCertificateAuthorityRequest, request - assert_equal "hello world", request["name"] - assert_equal "hello world", request["request_id"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, schedule_delete_certificate_authority_client_stub do - # Create client - client = ::Google::Cloud::Security::PrivateCA::V1beta1::CertificateAuthorityService::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.schedule_delete_certificate_authority({ name: name, request_id: request_id }) do |response, operation| - assert_kind_of Gapic::Operation, response - assert_equal grpc_response, response.grpc_op - assert_equal grpc_operation, operation - end - - # Use named arguments - client.schedule_delete_certificate_authority name: name, request_id: request_id do |response, operation| - assert_kind_of Gapic::Operation, response - assert_equal grpc_response, response.grpc_op - assert_equal grpc_operation, operation - end - - # Use protobuf object - client.schedule_delete_certificate_authority ::Google::Cloud::Security::PrivateCA::V1beta1::ScheduleDeleteCertificateAuthorityRequest.new(name: name, request_id: request_id) do |response, operation| - assert_kind_of Gapic::Operation, response - assert_equal grpc_response, response.grpc_op - assert_equal grpc_operation, operation - end - - # Use hash object with options - client.schedule_delete_certificate_authority({ name: name, request_id: request_id }, grpc_options) do |response, operation| - assert_kind_of Gapic::Operation, response - assert_equal grpc_response, response.grpc_op - assert_equal grpc_operation, operation - end - - # Use protobuf object with options - client.schedule_delete_certificate_authority(::Google::Cloud::Security::PrivateCA::V1beta1::ScheduleDeleteCertificateAuthorityRequest.new(name: name, request_id: request_id), grpc_options) do |response, operation| - assert_kind_of Gapic::Operation, response - assert_equal grpc_response, response.grpc_op - assert_equal grpc_operation, operation - end - - # Verify method calls - assert_equal 5, schedule_delete_certificate_authority_client_stub.call_rpc_count - end - end - - def test_update_certificate_authority - # 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. - certificate_authority = {} - update_mask = {} - request_id = "hello world" - - update_certificate_authority_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :update_certificate_authority, name - assert_kind_of ::Google::Cloud::Security::PrivateCA::V1beta1::UpdateCertificateAuthorityRequest, request - assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::Security::PrivateCA::V1beta1::CertificateAuthority), request["certificate_authority"] - assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Protobuf::FieldMask), request["update_mask"] - assert_equal "hello world", request["request_id"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, update_certificate_authority_client_stub do - # Create client - client = ::Google::Cloud::Security::PrivateCA::V1beta1::CertificateAuthorityService::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.update_certificate_authority({ certificate_authority: certificate_authority, update_mask: update_mask, request_id: request_id }) do |response, operation| - assert_kind_of Gapic::Operation, response - assert_equal grpc_response, response.grpc_op - assert_equal grpc_operation, operation - end - - # Use named arguments - client.update_certificate_authority certificate_authority: certificate_authority, update_mask: update_mask, request_id: request_id do |response, operation| - assert_kind_of Gapic::Operation, response - assert_equal grpc_response, response.grpc_op - assert_equal grpc_operation, operation - end - - # Use protobuf object - client.update_certificate_authority ::Google::Cloud::Security::PrivateCA::V1beta1::UpdateCertificateAuthorityRequest.new(certificate_authority: certificate_authority, update_mask: update_mask, request_id: request_id) do |response, operation| - assert_kind_of Gapic::Operation, response - assert_equal grpc_response, response.grpc_op - assert_equal grpc_operation, operation - end - - # Use hash object with options - client.update_certificate_authority({ certificate_authority: certificate_authority, update_mask: update_mask, request_id: request_id }, grpc_options) do |response, operation| - assert_kind_of Gapic::Operation, response - assert_equal grpc_response, response.grpc_op - assert_equal grpc_operation, operation - end - - # Use protobuf object with options - client.update_certificate_authority(::Google::Cloud::Security::PrivateCA::V1beta1::UpdateCertificateAuthorityRequest.new(certificate_authority: certificate_authority, update_mask: update_mask, request_id: request_id), grpc_options) do |response, operation| - assert_kind_of Gapic::Operation, response - assert_equal grpc_response, response.grpc_op - assert_equal grpc_operation, operation - end - - # Verify method calls - assert_equal 5, update_certificate_authority_client_stub.call_rpc_count - end - end - - def test_get_certificate_revocation_list - # Create GRPC objects. - grpc_response = ::Google::Cloud::Security::PrivateCA::V1beta1::CertificateRevocationList.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_certificate_revocation_list_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :get_certificate_revocation_list, name - assert_kind_of ::Google::Cloud::Security::PrivateCA::V1beta1::GetCertificateRevocationListRequest, request - assert_equal "hello world", request["name"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, get_certificate_revocation_list_client_stub do - # Create client - client = ::Google::Cloud::Security::PrivateCA::V1beta1::CertificateAuthorityService::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.get_certificate_revocation_list({ name: name }) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use named arguments - client.get_certificate_revocation_list name: name do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object - client.get_certificate_revocation_list ::Google::Cloud::Security::PrivateCA::V1beta1::GetCertificateRevocationListRequest.new(name: name) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use hash object with options - client.get_certificate_revocation_list({ 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_certificate_revocation_list(::Google::Cloud::Security::PrivateCA::V1beta1::GetCertificateRevocationListRequest.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_certificate_revocation_list_client_stub.call_rpc_count - end - end - - def test_list_certificate_revocation_lists - # Create GRPC objects. - grpc_response = ::Google::Cloud::Security::PrivateCA::V1beta1::ListCertificateRevocationListsResponse.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" - order_by = "hello world" - - list_certificate_revocation_lists_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :list_certificate_revocation_lists, name - assert_kind_of ::Google::Cloud::Security::PrivateCA::V1beta1::ListCertificateRevocationListsRequest, 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"] - assert_equal "hello world", request["order_by"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, list_certificate_revocation_lists_client_stub do - # Create client - client = ::Google::Cloud::Security::PrivateCA::V1beta1::CertificateAuthorityService::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.list_certificate_revocation_lists({ parent: parent, page_size: page_size, page_token: page_token, filter: filter, order_by: order_by }) 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_certificate_revocation_lists parent: parent, page_size: page_size, page_token: page_token, filter: filter, order_by: order_by 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_certificate_revocation_lists ::Google::Cloud::Security::PrivateCA::V1beta1::ListCertificateRevocationListsRequest.new(parent: parent, page_size: page_size, page_token: page_token, filter: filter, order_by: order_by) 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_certificate_revocation_lists({ parent: parent, page_size: page_size, page_token: page_token, filter: filter, order_by: order_by }, 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_certificate_revocation_lists(::Google::Cloud::Security::PrivateCA::V1beta1::ListCertificateRevocationListsRequest.new(parent: parent, page_size: page_size, page_token: page_token, filter: filter, order_by: order_by), 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_certificate_revocation_lists_client_stub.call_rpc_count - end - end - - def test_update_certificate_revocation_list - # 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. - certificate_revocation_list = {} - update_mask = {} - request_id = "hello world" - - update_certificate_revocation_list_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :update_certificate_revocation_list, name - assert_kind_of ::Google::Cloud::Security::PrivateCA::V1beta1::UpdateCertificateRevocationListRequest, request - assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::Security::PrivateCA::V1beta1::CertificateRevocationList), request["certificate_revocation_list"] - assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Protobuf::FieldMask), request["update_mask"] - assert_equal "hello world", request["request_id"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, update_certificate_revocation_list_client_stub do - # Create client - client = ::Google::Cloud::Security::PrivateCA::V1beta1::CertificateAuthorityService::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.update_certificate_revocation_list({ certificate_revocation_list: certificate_revocation_list, update_mask: update_mask, request_id: request_id }) do |response, operation| - assert_kind_of Gapic::Operation, response - assert_equal grpc_response, response.grpc_op - assert_equal grpc_operation, operation - end - - # Use named arguments - client.update_certificate_revocation_list certificate_revocation_list: certificate_revocation_list, update_mask: update_mask, request_id: request_id do |response, operation| - assert_kind_of Gapic::Operation, response - assert_equal grpc_response, response.grpc_op - assert_equal grpc_operation, operation - end - - # Use protobuf object - client.update_certificate_revocation_list ::Google::Cloud::Security::PrivateCA::V1beta1::UpdateCertificateRevocationListRequest.new(certificate_revocation_list: certificate_revocation_list, update_mask: update_mask, request_id: request_id) do |response, operation| - assert_kind_of Gapic::Operation, response - assert_equal grpc_response, response.grpc_op - assert_equal grpc_operation, operation - end - - # Use hash object with options - client.update_certificate_revocation_list({ certificate_revocation_list: certificate_revocation_list, update_mask: update_mask, request_id: request_id }, grpc_options) do |response, operation| - assert_kind_of Gapic::Operation, response - assert_equal grpc_response, response.grpc_op - assert_equal grpc_operation, operation - end - - # Use protobuf object with options - client.update_certificate_revocation_list(::Google::Cloud::Security::PrivateCA::V1beta1::UpdateCertificateRevocationListRequest.new(certificate_revocation_list: certificate_revocation_list, update_mask: update_mask, request_id: request_id), grpc_options) do |response, operation| - assert_kind_of Gapic::Operation, response - assert_equal grpc_response, response.grpc_op - assert_equal grpc_operation, operation - end - - # Verify method calls - assert_equal 5, update_certificate_revocation_list_client_stub.call_rpc_count - end - end - - def test_get_reusable_config - # Create GRPC objects. - grpc_response = ::Google::Cloud::Security::PrivateCA::V1beta1::ReusableConfig.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_reusable_config_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :get_reusable_config, name - assert_kind_of ::Google::Cloud::Security::PrivateCA::V1beta1::GetReusableConfigRequest, request - assert_equal "hello world", request["name"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, get_reusable_config_client_stub do - # Create client - client = ::Google::Cloud::Security::PrivateCA::V1beta1::CertificateAuthorityService::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.get_reusable_config({ name: name }) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use named arguments - client.get_reusable_config name: name do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object - client.get_reusable_config ::Google::Cloud::Security::PrivateCA::V1beta1::GetReusableConfigRequest.new(name: name) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use hash object with options - client.get_reusable_config({ name: name }, grpc_options) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object with options - client.get_reusable_config(::Google::Cloud::Security::PrivateCA::V1beta1::GetReusableConfigRequest.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_reusable_config_client_stub.call_rpc_count - end - end - - def test_list_reusable_configs - # Create GRPC objects. - grpc_response = ::Google::Cloud::Security::PrivateCA::V1beta1::ListReusableConfigsResponse.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" - order_by = "hello world" - - list_reusable_configs_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :list_reusable_configs, name - assert_kind_of ::Google::Cloud::Security::PrivateCA::V1beta1::ListReusableConfigsRequest, 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"] - assert_equal "hello world", request["order_by"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, list_reusable_configs_client_stub do - # Create client - client = ::Google::Cloud::Security::PrivateCA::V1beta1::CertificateAuthorityService::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.list_reusable_configs({ parent: parent, page_size: page_size, page_token: page_token, filter: filter, order_by: order_by }) 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_reusable_configs parent: parent, page_size: page_size, page_token: page_token, filter: filter, order_by: order_by 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_reusable_configs ::Google::Cloud::Security::PrivateCA::V1beta1::ListReusableConfigsRequest.new(parent: parent, page_size: page_size, page_token: page_token, filter: filter, order_by: order_by) 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_reusable_configs({ parent: parent, page_size: page_size, page_token: page_token, filter: filter, order_by: order_by }, 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_reusable_configs(::Google::Cloud::Security::PrivateCA::V1beta1::ListReusableConfigsRequest.new(parent: parent, page_size: page_size, page_token: page_token, filter: filter, order_by: order_by), 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_reusable_configs_client_stub.call_rpc_count - end - end - - def test_configure - grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - - client = block_config = config = nil - dummy_stub = ClientStub.new nil, nil - Gapic::ServiceStub.stub :new, dummy_stub do - client = ::Google::Cloud::Security::PrivateCA::V1beta1::CertificateAuthorityService::Client.new do |config| - config.credentials = grpc_channel - end - end - - config = client.configure do |c| - block_config = c - end - - assert_same block_config, config - assert_kind_of ::Google::Cloud::Security::PrivateCA::V1beta1::CertificateAuthorityService::Client::Configuration, config - end - - def test_credentials - key = OpenSSL::PKey::RSA.new 2048 - cred_json = { - "private_key" => key.to_pem, - "client_email" => "app@developer.gserviceaccount.com", - "type" => "service_account" - } - key_file = StringIO.new cred_json.to_json - creds = Google::Auth::ServiceAccountCredentials.make_creds({ json_key_io: key_file }) - - dummy_stub = ClientStub.new nil, nil - Gapic::ServiceStub.stub :new, dummy_stub do - client = ::Google::Cloud::Security::PrivateCA::V1beta1::CertificateAuthorityService::Client.new do |config| - config.credentials = creds - end - assert_kind_of ::Google::Cloud::Security::PrivateCA::V1beta1::CertificateAuthorityService::Client, client - assert_equal creds, client.configure.credentials - end - end - - def test_operations_client - grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - - client = nil - dummy_stub = ClientStub.new nil, nil - Gapic::ServiceStub.stub :new, dummy_stub do - client = ::Google::Cloud::Security::PrivateCA::V1beta1::CertificateAuthorityService::Client.new do |config| - config.credentials = grpc_channel - end - end - - assert_kind_of ::Google::Cloud::Security::PrivateCA::V1beta1::CertificateAuthorityService::Operations, client.operations_client - end -end diff --git a/owl-bot-staging/google-cloud-security-private_ca-v1beta1/test/helper.rb b/owl-bot-staging/google-cloud-security-private_ca-v1beta1/test/helper.rb deleted file mode 100644 index 672b337030e7..000000000000 --- a/owl-bot-staging/google-cloud-security-private_ca-v1beta1/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" diff --git a/owl-bot-staging/google-cloud-security-public_ca-v1/.gitignore b/owl-bot-staging/google-cloud-security-public_ca-v1/.gitignore deleted file mode 100644 index 0135b6bc6cfc..000000000000 --- a/owl-bot-staging/google-cloud-security-public_ca-v1/.gitignore +++ /dev/null @@ -1,22 +0,0 @@ -# Ignore bundler lockfiles -Gemfile.lock -gems.locked - -# Ignore documentation output -doc/* -.yardoc/* - -# Ignore test output -coverage/* - -# Ignore build artifacts -pkg/* - -# Ignore files commonly present in certain dev environments -.vagrant -.DS_STORE -.idea -*.iml - -# Ignore synth output -__pycache__ diff --git a/owl-bot-staging/google-cloud-security-public_ca-v1/.repo-metadata.json b/owl-bot-staging/google-cloud-security-public_ca-v1/.repo-metadata.json deleted file mode 100644 index 788249a8ed1b..000000000000 --- a/owl-bot-staging/google-cloud-security-public_ca-v1/.repo-metadata.json +++ /dev/null @@ -1,17 +0,0 @@ -{ - "api_id": "publicca.googleapis.com", - "api_shortname": "publicca", - "client_documentation": "https://cloud.google.com/ruby/docs/reference/google-cloud-security-public_ca-v1/latest", - "distribution_name": "google-cloud-security-public_ca-v1", - "is_cloud": true, - "language": "ruby", - "name": "publicca", - "name_pretty": "Public Certificate Authority V1 API", - "product_documentation": "https://cloud.google.com/certificate-manager/docs/public-ca", - "release_level": "unreleased", - "repo": "googleapis/google-cloud-ruby", - "requires_billing": true, - "ruby-cloud-description": "The Public Certificate Authority API may be used to create and manage ACME external account binding keys associated with Google Trust Services' publicly trusted certificate authority. Note that google-cloud-security-public_ca-v1 is a version-specific client library. For most uses, we recommend installing the main client library google-cloud-security-public_ca instead. See the readme for more details.", - "ruby-cloud-product-url": "https://cloud.google.com/certificate-manager/docs/public-ca", - "library_type": "GAPIC_AUTO" -} diff --git a/owl-bot-staging/google-cloud-security-public_ca-v1/.rubocop.yml b/owl-bot-staging/google-cloud-security-public_ca-v1/.rubocop.yml deleted file mode 100644 index 87973206ac40..000000000000 --- a/owl-bot-staging/google-cloud-security-public_ca-v1/.rubocop.yml +++ /dev/null @@ -1,33 +0,0 @@ -inherit_gem: - google-style: google-style.yml - -AllCops: - Exclude: - - "google-cloud-security-public_ca-v1.gemspec" - - "lib/**/*_pb.rb" - - "proto_docs/**/*" - - "test/**/*" - - "acceptance/**/*" - - "samples/acceptance/**/*" - - "Rakefile" - -Layout/LineLength: - Enabled: false -Metrics/AbcSize: - Enabled: false -Metrics/ClassLength: - Enabled: false -Metrics/CyclomaticComplexity: - Enabled: false -Metrics/MethodLength: - Enabled: false -Metrics/ModuleLength: - Enabled: false -Metrics/PerceivedComplexity: - Enabled: false -Naming/AccessorMethodName: - Exclude: - - "snippets/**/*.rb" -Naming/FileName: - Exclude: - - "lib/google-cloud-security-public_ca-v1.rb" diff --git a/owl-bot-staging/google-cloud-security-public_ca-v1/.toys.rb b/owl-bot-staging/google-cloud-security-public_ca-v1/.toys.rb deleted file mode 100644 index 177e22456e8a..000000000000 --- a/owl-bot-staging/google-cloud-security-public_ca-v1/.toys.rb +++ /dev/null @@ -1,28 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -toys_version! ">= 0.15.3" - -if ENV["RUBY_COMMON_TOOLS"] - common_tools_dir = File.expand_path ENV["RUBY_COMMON_TOOLS"] - load File.join(common_tools_dir, "toys", "gapic") -else - load_git remote: "https://github.com/googleapis/ruby-common-tools.git", - path: "toys/gapic", - update: true -end diff --git a/owl-bot-staging/google-cloud-security-public_ca-v1/.yardopts b/owl-bot-staging/google-cloud-security-public_ca-v1/.yardopts deleted file mode 100644 index 70e9c4ada96c..000000000000 --- a/owl-bot-staging/google-cloud-security-public_ca-v1/.yardopts +++ /dev/null @@ -1,12 +0,0 @@ ---no-private ---title="Public Certificate Authority V1 API" ---exclude _pb\.rb$ ---markup markdown ---markup-provider redcarpet - -./lib/**/*.rb -./proto_docs/**/*.rb -- -README.md -LICENSE.md -AUTHENTICATION.md diff --git a/owl-bot-staging/google-cloud-security-public_ca-v1/AUTHENTICATION.md b/owl-bot-staging/google-cloud-security-public_ca-v1/AUTHENTICATION.md deleted file mode 100644 index e674781ece98..000000000000 --- a/owl-bot-staging/google-cloud-security-public_ca-v1/AUTHENTICATION.md +++ /dev/null @@ -1,122 +0,0 @@ -# Authentication - -The recommended way to authenticate to the google-cloud-security-public_ca-v1 library is to use -[Application Default Credentials (ADC)](https://cloud.google.com/docs/authentication/application-default-credentials). -To review all of your authentication options, see [Credentials lookup](#credential-lookup). - -## Quickstart - -The following example shows how to set up authentication for a local development -environment with your user credentials. - -**NOTE:** This method is _not_ recommended for running in production. User credentials -should be used only during development. - -1. [Download and install the Google Cloud CLI](https://cloud.google.com/sdk). -2. Set up a local ADC file with your user credentials: - -```sh -gcloud auth application-default login -``` - -3. Write code as if already authenticated. - -For more information about setting up authentication for a local development environment, see -[Set up Application Default Credentials](https://cloud.google.com/docs/authentication/provide-credentials-adc#local-dev). - -## Credential Lookup - -The google-cloud-security-public_ca-v1 library provides several mechanisms to configure your system. -Generally, using Application Default Credentials to facilitate automatic -credentials discovery is the easist method. But if you need to explicitly specify -credentials, there are several methods available to you. - -Credentials are accepted in the following ways, in the following order or precedence: - -1. Credentials specified in method arguments -2. Credentials specified in configuration -3. Credentials pointed to or included in environment variables -4. Credentials found in local ADC file -5. Credentials returned by the metadata server for the attached service account (GCP) - -### Configuration - -You can configure a path to a JSON credentials file, either for an individual client object or -globally, for all client objects. The JSON file can contain credentials created for -[workload identity federation](https://cloud.google.com/iam/docs/workload-identity-federation), -[workforce identity federation](https://cloud.google.com/iam/docs/workforce-identity-federation), or a -[service account key](https://cloud.google.com/docs/authentication/provide-credentials-adc#local-key). - -Note: Service account keys are a security risk if not managed correctly. You should -[choose a more secure alternative to service account keys](https://cloud.google.com/docs/authentication#auth-decision-tree) -whenever possible. - -To configure a credentials file for an individual client initialization: - -```ruby -require "google/cloud/security/public_ca/v1" - -client = ::Google::Cloud::Security::PublicCA::V1::PublicCertificateAuthorityService::Client.new do |config| - config.credentials = "path/to/credentialfile.json" -end -``` - -To configure a credentials file globally for all clients: - -```ruby -require "google/cloud/security/public_ca/v1" - -::Google::Cloud::Security::PublicCA::V1::PublicCertificateAuthorityService::Client.configure do |config| - config.credentials = "path/to/credentialfile.json" -end - -client = ::Google::Cloud::Security::PublicCA::V1::PublicCertificateAuthorityService::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-security-public_ca-v1 -checks for credentials are: - -* `GOOGLE_CLOUD_CREDENTIALS` - Path to JSON file, or JSON contents -* `GOOGLE_APPLICATION_CREDENTIALS` - Path to JSON file - -```ruby -require "google/cloud/security/public_ca/v1" - -ENV["GOOGLE_APPLICATION_CREDENTIALS"] = "path/to/credentialfile.json" - -client = ::Google::Cloud::Security::PublicCA::V1::PublicCertificateAuthorityService::Client.new -``` - -### Local ADC file - -You can set up a local ADC file with your user credentials for authentication during -development. If credentials are not provided in code or in environment variables, -then the local ADC credentials are discovered. - -Follow the steps in [Quickstart](#quickstart) to set up a local ADC file. - -### Google Cloud Platform environments - -When running on Google Cloud Platform (GCP), including Google Compute Engine -(GCE), Google Kubernetes Engine (GKE), Google App Engine (GAE), Google Cloud -Functions (GCF) and Cloud Run, credentials are retrieved from the attached -service account automatically. Code should be written as if already authenticated. - -For more information, see -[Set up ADC for Google Cloud services](https://cloud.google.com/docs/authentication/provide-credentials-adc#attached-sa). diff --git a/owl-bot-staging/google-cloud-security-public_ca-v1/CHANGELOG.md b/owl-bot-staging/google-cloud-security-public_ca-v1/CHANGELOG.md deleted file mode 100644 index f88957a62ba2..000000000000 --- a/owl-bot-staging/google-cloud-security-public_ca-v1/CHANGELOG.md +++ /dev/null @@ -1,2 +0,0 @@ -# Release History - diff --git a/owl-bot-staging/google-cloud-security-public_ca-v1/Gemfile b/owl-bot-staging/google-cloud-security-public_ca-v1/Gemfile deleted file mode 100644 index 1d08558908d8..000000000000 --- a/owl-bot-staging/google-cloud-security-public_ca-v1/Gemfile +++ /dev/null @@ -1,14 +0,0 @@ -source "https://rubygems.org" - -gemspec - -gem "google-style", "~> 1.32.0" -gem "irb", "~> 1.17" -gem "minitest", "~> 6.0.2" -gem "minitest-focus", "~> 1.4" -gem "minitest-mock", "~> 5.27" -gem "minitest-rg", "~> 5.3" -gem "ostruct", "~> 0.5.5" -gem "rake", ">= 13.0" -gem "redcarpet", "~> 3.6" -gem "yard", "~> 0.9" diff --git a/owl-bot-staging/google-cloud-security-public_ca-v1/LICENSE.md b/owl-bot-staging/google-cloud-security-public_ca-v1/LICENSE.md deleted file mode 100644 index c261857ba6ad..000000000000 --- a/owl-bot-staging/google-cloud-security-public_ca-v1/LICENSE.md +++ /dev/null @@ -1,201 +0,0 @@ - Apache License - Version 2.0, January 2004 - http://www.apache.org/licenses/ - - TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION - - 1. Definitions. - - "License" shall mean the terms and conditions for use, reproduction, - and distribution as defined by Sections 1 through 9 of this document. - - "Licensor" shall mean the copyright owner or entity authorized by - the copyright owner that is granting the License. - - "Legal Entity" shall mean the union of the acting entity and all - other entities that control, are controlled by, or are under common - control with that entity. For the purposes of this definition, - "control" means (i) the power, direct or indirect, to cause the - direction or management of such entity, whether by contract or - otherwise, or (ii) ownership of fifty percent (50%) or more of the - outstanding shares, or (iii) beneficial ownership of such entity. - - "You" (or "Your") shall mean an individual or Legal Entity - exercising permissions granted by this License. - - "Source" form shall mean the preferred form for making modifications, - including but not limited to software source code, documentation - source, and configuration files. - - "Object" form shall mean any form resulting from mechanical - transformation or translation of a Source form, including but - not limited to compiled object code, generated documentation, - and conversions to other media types. - - "Work" shall mean the work of authorship, whether in Source or - Object form, made available under the License, as indicated by a - copyright notice that is included in or attached to the work - (an example is provided in the Appendix below). - - "Derivative Works" shall mean any work, whether in Source or Object - form, that is based on (or derived from) the Work and for which the - editorial revisions, annotations, elaborations, or other modifications - represent, as a whole, an original work of authorship. For the purposes - of this License, Derivative Works shall not include works that remain - separable from, or merely link (or bind by name) to the interfaces of, - the Work and Derivative Works thereof. - - "Contribution" shall mean any work of authorship, including - the original version of the Work and any modifications or additions - to that Work or Derivative Works thereof, that is intentionally - submitted to Licensor for inclusion in the Work by the copyright owner - or by an individual or Legal Entity authorized to submit on behalf of - the copyright owner. For the purposes of this definition, "submitted" - means any form of electronic, verbal, or written communication sent - to the Licensor or its representatives, including but not limited to - communication on electronic mailing lists, source code control systems, - and issue tracking systems that are managed by, or on behalf of, the - Licensor for the purpose of discussing and improving the Work, but - excluding communication that is conspicuously marked or otherwise - designated in writing by the copyright owner as "Not a Contribution." - - "Contributor" shall mean Licensor and any individual or Legal Entity - on behalf of whom a Contribution has been received by Licensor and - subsequently incorporated within the Work. - - 2. Grant of Copyright License. Subject to the terms and conditions of - this License, each Contributor hereby grants to You a perpetual, - worldwide, non-exclusive, no-charge, royalty-free, irrevocable - copyright license to reproduce, prepare Derivative Works of, - publicly display, publicly perform, sublicense, and distribute the - Work and such Derivative Works in Source or Object form. - - 3. Grant of Patent License. Subject to the terms and conditions of - this License, each Contributor hereby grants to You a perpetual, - worldwide, non-exclusive, no-charge, royalty-free, irrevocable - (except as stated in this section) patent license to make, have made, - use, offer to sell, sell, import, and otherwise transfer the Work, - where such license applies only to those patent claims licensable - by such Contributor that are necessarily infringed by their - Contribution(s) alone or by combination of their Contribution(s) - with the Work to which such Contribution(s) was submitted. If You - institute patent litigation against any entity (including a - cross-claim or counterclaim in a lawsuit) alleging that the Work - or a Contribution incorporated within the Work constitutes direct - or contributory patent infringement, then any patent licenses - granted to You under this License for that Work shall terminate - as of the date such litigation is filed. - - 4. Redistribution. You may reproduce and distribute copies of the - Work or Derivative Works thereof in any medium, with or without - modifications, and in Source or Object form, provided that You - meet the following conditions: - - (a) You must give any other recipients of the Work or - Derivative Works a copy of this License; and - - (b) You must cause any modified files to carry prominent notices - stating that You changed the files; and - - (c) You must retain, in the Source form of any Derivative Works - that You distribute, all copyright, patent, trademark, and - attribution notices from the Source form of the Work, - excluding those notices that do not pertain to any part of - the Derivative Works; and - - (d) If the Work includes a "NOTICE" text file as part of its - distribution, then any Derivative Works that You distribute must - include a readable copy of the attribution notices contained - within such NOTICE file, excluding those notices that do not - pertain to any part of the Derivative Works, in at least one - of the following places: within a NOTICE text file distributed - as part of the Derivative Works; within the Source form or - documentation, if provided along with the Derivative Works; or, - within a display generated by the Derivative Works, if and - wherever such third-party notices normally appear. The contents - of the NOTICE file are for informational purposes only and - do not modify the License. You may add Your own attribution - notices within Derivative Works that You distribute, alongside - or as an addendum to the NOTICE text from the Work, provided - that such additional attribution notices cannot be construed - as modifying the License. - - You may add Your own copyright statement to Your modifications and - may provide additional or different license terms and conditions - for use, reproduction, or distribution of Your modifications, or - for any such Derivative Works as a whole, provided Your use, - reproduction, and distribution of the Work otherwise complies with - the conditions stated in this License. - - 5. Submission of Contributions. Unless You explicitly state otherwise, - any Contribution intentionally submitted for inclusion in the Work - by You to the Licensor shall be under the terms and conditions of - this License, without any additional terms or conditions. - Notwithstanding the above, nothing herein shall supersede or modify - the terms of any separate license agreement you may have executed - with Licensor regarding such Contributions. - - 6. Trademarks. This License does not grant permission to use the trade - names, trademarks, service marks, or product names of the Licensor, - except as required for reasonable and customary use in describing the - origin of the Work and reproducing the content of the NOTICE file. - - 7. Disclaimer of Warranty. Unless required by applicable law or - agreed to in writing, Licensor provides the Work (and each - Contributor provides its Contributions) on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or - implied, including, without limitation, any warranties or conditions - of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A - PARTICULAR PURPOSE. You are solely responsible for determining the - appropriateness of using or redistributing the Work and assume any - risks associated with Your exercise of permissions under this License. - - 8. Limitation of Liability. In no event and under no legal theory, - whether in tort (including negligence), contract, or otherwise, - unless required by applicable law (such as deliberate and grossly - negligent acts) or agreed to in writing, shall any Contributor be - liable to You for damages, including any direct, indirect, special, - incidental, or consequential damages of any character arising as a - result of this License or out of the use or inability to use the - Work (including but not limited to damages for loss of goodwill, - work stoppage, computer failure or malfunction, or any and all - other commercial damages or losses), even if such Contributor - has been advised of the possibility of such damages. - - 9. Accepting Warranty or Additional Liability. While redistributing - the Work or Derivative Works thereof, You may choose to offer, - and charge a fee for, acceptance of support, warranty, indemnity, - or other liability obligations and/or rights consistent with this - License. However, in accepting such obligations, You may act only - on Your own behalf and on Your sole responsibility, not on behalf - of any other Contributor, and only if You agree to indemnify, - defend, and hold each Contributor harmless for any liability - incurred by, or claims asserted against, such Contributor by reason - of your accepting any such warranty or additional liability. - - END OF TERMS AND CONDITIONS - - APPENDIX: How to apply the Apache License to your work. - - To apply the Apache License to your work, attach the following - boilerplate notice, with the fields enclosed by brackets "[]" - replaced with your own identifying information. (Don't include - the brackets!) The text should be enclosed in the appropriate - comment syntax for the file format. We also recommend that a - file or class name and description of purpose be included on the - same "printed page" as the copyright notice for easier - identification within third-party archives. - - Copyright [yyyy] [name of copyright owner] - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. diff --git a/owl-bot-staging/google-cloud-security-public_ca-v1/README.md b/owl-bot-staging/google-cloud-security-public_ca-v1/README.md deleted file mode 100644 index 8c67c2b3443d..000000000000 --- a/owl-bot-staging/google-cloud-security-public_ca-v1/README.md +++ /dev/null @@ -1,154 +0,0 @@ -# Ruby Client for the Public Certificate Authority V1 API - -The Public Certificate Authority API may be used to create and manage ACME external account binding keys associated with Google Trust Services' publicly trusted certificate authority. - -The Public Certificate Authority API may be used to create and manage ACME external account binding keys associated with Google Trust Services' publicly trusted certificate authority. - -https://github.com/googleapis/google-cloud-ruby - -This gem is a _versioned_ client. It provides basic client classes for a -specific version of the Public Certificate Authority V1 API. Most users should consider using -the main client gem, -[google-cloud-security-public_ca](https://rubygems.org/gems/google-cloud-security-public_ca). -See the section below titled *Which client should I use?* for more information. - -## Installation - -``` -$ gem install google-cloud-security-public_ca-v1 -``` - -## Before You Begin - -In order to use this library, you first need to go through the following steps: - -1. [Select or create a Cloud Platform project.](https://console.cloud.google.com/project) -1. [Enable billing for your project.](https://cloud.google.com/billing/docs/how-to/modify-project#enable_billing_for_a_project) -1. [Enable the API.](https://console.cloud.google.com/apis/library/publicca.googleapis.com) -1. [Set up authentication.](AUTHENTICATION.md) - -## Quick Start - -```ruby -require "google/cloud/security/public_ca/v1" - -client = ::Google::Cloud::Security::PublicCA::V1::PublicCertificateAuthorityService::Client.new -request = ::Google::Cloud::Security::PublicCA::V1::CreateExternalAccountKeyRequest.new # (request fields as keyword arguments...) -response = client.create_external_account_key request -``` - -View the [Client Library Documentation](https://cloud.google.com/ruby/docs/reference/google-cloud-security-public_ca-v1/latest) -for class and method documentation. - -See also the [Product Documentation](https://cloud.google.com/certificate-manager/docs/public-ca) -for general usage information. - -## Debug Logging - -This library comes with opt-in Debug Logging that can help you troubleshoot -your application's integration with the API. When logging is activated, key -events such as requests and responses, along with data payloads and metadata -such as headers and client configuration, are logged to the standard error -stream. - -**WARNING:** Client Library Debug Logging includes your data payloads in -plaintext, which could include sensitive data such as PII for yourself or your -customers, private keys, or other security data that could be compromising if -leaked. Always practice good data hygiene with your application logs, and follow -the principle of least access. Google also recommends that Client Library Debug -Logging be enabled only temporarily during active debugging, and not used -permanently in production. - -To enable logging, set the environment variable `GOOGLE_SDK_RUBY_LOGGING_GEMS` -to the value `all`. Alternatively, you can set the value to a comma-delimited -list of client library gem names. This will select the default logging behavior, -which writes logs to the standard error stream. On a local workstation, this may -result in logs appearing on the console. When running on a Google Cloud hosting -service such as [Google Cloud Run](https://cloud.google.com/run), this generally -results in logs appearing alongside your application logs in the -[Google Cloud Logging](https://cloud.google.com/logging/) service. - -You can customize logging by modifying the `logger` configuration when -constructing a client object. For example: - -```ruby -require "google/cloud/security/public_ca/v1" -require "logger" - -client = ::Google::Cloud::Security::PublicCA::V1::PublicCertificateAuthorityService::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-security-public_ca`, -and lower-level _versioned_ client libraries with names such as -`google-cloud-security-public_ca-v1`. -_In most cases, you should install the main client._ - -### What's the difference between the main client and a versioned client? - -A _versioned client_ provides a basic set of data types and client classes for -a _single version_ of a specific service. (That is, for a service with multiple -versions, there might be a separate versioned client for each service version.) -Most versioned clients are written and maintained by a code generator. - -The _main client_ is designed to provide you with the _recommended_ client -interfaces for the service. There will be only one main client for any given -service, even a service with multiple versions. The main client includes -factory methods for constructing the client objects we recommend for most -users. In some cases, those will be classes provided by an underlying versioned -client; in other cases, they will be handwritten higher-level client objects -with additional capabilities, convenience methods, or best practices built in. -Generally, the main client will default to a recommended service version, -although in some cases you can override this if you need to talk to a specific -service version. - -### Why would I want to use the main client? - -We recommend that most users install the main client gem for a service. You can -identify this gem as the one _without_ a version in its name, e.g. -`google-cloud-security-public_ca`. -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-security-public_ca-v1`. - -### What about the google-apis- clients? - -Client library gems with names that begin with `google-apis-` are based on an -older code generation technology. They talk to a REST/JSON backend (whereas -most modern clients talk to a [gRPC](https://grpc.io/) backend) and they may -not offer the same performance, features, and ease of use provided by more -modern clients. - -The `google-apis-` clients have wide coverage across Google services, so you -might need to use one if there is no modern client available for the service. -However, if a modern client is available, we generally recommend it over the -older `google-apis-` clients. diff --git a/owl-bot-staging/google-cloud-security-public_ca-v1/Rakefile b/owl-bot-staging/google-cloud-security-public_ca-v1/Rakefile deleted file mode 100644 index 2959daaebab6..000000000000 --- a/owl-bot-staging/google-cloud-security-public_ca-v1/Rakefile +++ /dev/null @@ -1,169 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -require "bundler/setup" -require "bundler/gem_tasks" - -require "rubocop/rake_task" -RuboCop::RakeTask.new - -require "rake/testtask" -desc "Run tests." -Rake::TestTask.new do |t| - t.libs << "test" - t.test_files = FileList["test/**/*_test.rb"] - t.warning = false -end - -desc "Runs the smoke tests." -Rake::TestTask.new :smoke_test do |t| - t.test_files = FileList["acceptance/**/*smoke_test.rb"] - t.warning = false -end - -# Acceptance tests -desc "Run the google-cloud-security-public_ca-v1 acceptance tests." -task :acceptance, :project, :keyfile do |t, args| - project = args[:project] - project ||= - ENV["GOOGLE_CLOUD_TEST_PROJECT"] || - ENV["GCLOUD_TEST_PROJECT"] - keyfile = args[:keyfile] - keyfile ||= - ENV["GOOGLE_CLOUD_TEST_KEYFILE"] || - ENV["GCLOUD_TEST_KEYFILE"] - if keyfile - keyfile = File.read keyfile - else - keyfile ||= - ENV["GOOGLE_CLOUD_TEST_KEYFILE_JSON"] || - ENV["GCLOUD_TEST_KEYFILE_JSON"] - end - if project.nil? || keyfile.nil? - fail "You must provide a project and keyfile. e.g. rake acceptance[test123, /path/to/keyfile.json] or GOOGLE_CLOUD_TEST_PROJECT=test123 GOOGLE_CLOUD_TEST_KEYFILE=/path/to/keyfile.json rake acceptance" - end - require "google/cloud/security/public_ca/v1/public_certificate_authority_service/credentials" - ::Google::Cloud::Security::PublicCA::V1::PublicCertificateAuthorityService::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-security-public_ca-v1 gem has no acceptance tests." - end - end - - desc "Run acceptance cleanup." - task :cleanup do - end -end - -task :samples do - Rake::Task["samples:latest"].invoke -end - -namespace :samples do - task :latest do - if File.directory? "samples" - Dir.chdir "samples" do - Bundler.with_clean_env do - ENV["GOOGLE_CLOUD_SAMPLES_TEST"] = "not_master" - sh "bundle update" - sh "bundle exec rake test" - end - end - else - puts "The google-cloud-security-public_ca-v1 gem has no samples to test." - end - end - - task :master do - if File.directory? "samples" - Dir.chdir "samples" do - Bundler.with_clean_env do - ENV["GOOGLE_CLOUD_SAMPLES_TEST"] = "master" - sh "bundle update" - sh "bundle exec rake test" - end - end - else - puts "The google-cloud-security-public_ca-v1 gem has no samples to test." - end - end -end - -require "yard" -require "yard/rake/yardoc_task" -YARD::Rake::YardocTask.new do |y| - y.options << "--fail-on-warning" -end - -desc "Run yard-doctest example tests." -task :doctest do - puts "The google-cloud-security-public_ca-v1 gem does not have doctest tests." -end - -desc "Run the CI build" -task :ci do - header "BUILDING google-cloud-security-public_ca-v1" - header "google-cloud-security-public_ca-v1 rubocop", "*" - Rake::Task[:rubocop].invoke - header "google-cloud-security-public_ca-v1 yard", "*" - Rake::Task[:yard].invoke - header "google-cloud-security-public_ca-v1 test", "*" - Rake::Task[:test].invoke -end - -namespace :ci do - desc "Run the CI build, with smoke tests." - task :smoke_test do - Rake::Task[:ci].invoke - header "google-cloud-security-public_ca-v1 smoke_test", "*" - Rake::Task[:smoke_test].invoke - end - desc "Run the CI build, with acceptance tests." - task :acceptance do - Rake::Task[:ci].invoke - header "google-cloud-security-public_ca-v1 acceptance", "*" - Rake::Task[:acceptance].invoke - end - task :a do - # This is a handy shortcut to save typing - Rake::Task["ci:acceptance"].invoke - end -end - -task default: :test - -def header str, token = "#" - line_length = str.length + 8 - puts "" - puts token * line_length - puts "#{token * 3} #{str} #{token * 3}" - puts token * line_length - puts "" -end diff --git a/owl-bot-staging/google-cloud-security-public_ca-v1/gapic_metadata.json b/owl-bot-staging/google-cloud-security-public_ca-v1/gapic_metadata.json deleted file mode 100644 index 654c3bdcaf0f..000000000000 --- a/owl-bot-staging/google-cloud-security-public_ca-v1/gapic_metadata.json +++ /dev/null @@ -1,23 +0,0 @@ -{ - "schema": "1.0", - "comment": "This file maps proto services/RPCs to the corresponding library clients/methods", - "language": "ruby", - "protoPackage": "google.cloud.security.publicca.v1", - "libraryPackage": "::Google::Cloud::Security::PublicCA::V1", - "services": { - "PublicCertificateAuthorityService": { - "clients": { - "grpc": { - "libraryClient": "::Google::Cloud::Security::PublicCA::V1::PublicCertificateAuthorityService::Client", - "rpcs": { - "CreateExternalAccountKey": { - "methods": [ - "create_external_account_key" - ] - } - } - } - } - } - } -} diff --git a/owl-bot-staging/google-cloud-security-public_ca-v1/google-cloud-security-public_ca-v1.gemspec b/owl-bot-staging/google-cloud-security-public_ca-v1/google-cloud-security-public_ca-v1.gemspec deleted file mode 100644 index e28f870af1f5..000000000000 --- a/owl-bot-staging/google-cloud-security-public_ca-v1/google-cloud-security-public_ca-v1.gemspec +++ /dev/null @@ -1,28 +0,0 @@ -# -*- ruby -*- -# encoding: utf-8 - -require File.expand_path("lib/google/cloud/security/public_ca/v1/version", __dir__) - -Gem::Specification.new do |gem| - gem.name = "google-cloud-security-public_ca-v1" - gem.version = Google::Cloud::Security::PublicCA::V1::VERSION - - gem.authors = ["Google LLC"] - gem.email = "googleapis-packages@google.com" - gem.description = "The Public Certificate Authority API may be used to create and manage ACME external account binding keys associated with Google Trust Services' publicly trusted certificate authority. Note that google-cloud-security-public_ca-v1 is a version-specific client library. For most uses, we recommend installing the main client library google-cloud-security-public_ca instead. See the readme for more details." - gem.summary = "The Public Certificate Authority API may be used to create and manage ACME external account binding keys associated with Google Trust Services' publicly trusted certificate authority." - 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" -end diff --git a/owl-bot-staging/google-cloud-security-public_ca-v1/lib/google-cloud-security-public_ca-v1.rb b/owl-bot-staging/google-cloud-security-public_ca-v1/lib/google-cloud-security-public_ca-v1.rb deleted file mode 100644 index dc9dd30bc691..000000000000 --- a/owl-bot-staging/google-cloud-security-public_ca-v1/lib/google-cloud-security-public_ca-v1.rb +++ /dev/null @@ -1,21 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -# This gem does not autoload during Bundler.require. To load this gem, -# issue explicit require statements for the packages desired, e.g.: -# require "google/cloud/security/public_ca/v1" diff --git a/owl-bot-staging/google-cloud-security-public_ca-v1/lib/google/cloud/security/public_ca/v1.rb b/owl-bot-staging/google-cloud-security-public_ca-v1/lib/google/cloud/security/public_ca/v1.rb deleted file mode 100644 index 9fa2b063e2b5..000000000000 --- a/owl-bot-staging/google-cloud-security-public_ca-v1/lib/google/cloud/security/public_ca/v1.rb +++ /dev/null @@ -1,47 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -require "google/cloud/security/public_ca/v1/public_certificate_authority_service" -require "google/cloud/security/public_ca/v1/version" - -module Google - module Cloud - module Security - module PublicCA - ## - # API client module. - # - # @example Load this package, including all its services, and instantiate a gRPC client - # - # require "google/cloud/security/public_ca/v1" - # client = ::Google::Cloud::Security::PublicCA::V1::PublicCertificateAuthorityService::Client.new - # - # @example Load this package, including all its services, and instantiate a REST client - # - # require "google/cloud/security/public_ca/v1" - # client = ::Google::Cloud::Security::PublicCA::V1::PublicCertificateAuthorityService::Rest::Client.new - # - module V1 - end - end - end - end -end - -helper_path = ::File.join __dir__, "v1", "_helpers.rb" -require "google/cloud/security/public_ca/v1/_helpers" if ::File.file? helper_path diff --git a/owl-bot-staging/google-cloud-security-public_ca-v1/lib/google/cloud/security/public_ca/v1/public_certificate_authority_service.rb b/owl-bot-staging/google-cloud-security-public_ca-v1/lib/google/cloud/security/public_ca/v1/public_certificate_authority_service.rb deleted file mode 100644 index 31344956f931..000000000000 --- a/owl-bot-staging/google-cloud-security-public_ca-v1/lib/google/cloud/security/public_ca/v1/public_certificate_authority_service.rb +++ /dev/null @@ -1,59 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -require "gapic/common" -require "gapic/config" -require "gapic/config/method" - -require "google/cloud/security/public_ca/v1/version" - -require "google/cloud/security/public_ca/v1/public_certificate_authority_service/credentials" -require "google/cloud/security/public_ca/v1/public_certificate_authority_service/paths" -require "google/cloud/security/public_ca/v1/public_certificate_authority_service/client" -require "google/cloud/security/public_ca/v1/public_certificate_authority_service/rest" - -module Google - module Cloud - module Security - module PublicCA - module V1 - ## - # Manages the resources required for ACME [external account - # binding](https://tools.ietf.org/html/rfc8555#section-7.3.4) for - # the public certificate authority service. - # - # @example Load this service and instantiate a gRPC client - # - # require "google/cloud/security/public_ca/v1/public_certificate_authority_service" - # client = ::Google::Cloud::Security::PublicCA::V1::PublicCertificateAuthorityService::Client.new - # - # @example Load this service and instantiate a REST client - # - # require "google/cloud/security/public_ca/v1/public_certificate_authority_service/rest" - # client = ::Google::Cloud::Security::PublicCA::V1::PublicCertificateAuthorityService::Rest::Client.new - # - module PublicCertificateAuthorityService - end - end - end - end - end -end - -helper_path = ::File.join __dir__, "public_certificate_authority_service", "helpers.rb" -require "google/cloud/security/public_ca/v1/public_certificate_authority_service/helpers" if ::File.file? helper_path diff --git a/owl-bot-staging/google-cloud-security-public_ca-v1/lib/google/cloud/security/public_ca/v1/public_certificate_authority_service/client.rb b/owl-bot-staging/google-cloud-security-public_ca-v1/lib/google/cloud/security/public_ca/v1/public_certificate_authority_service/client.rb deleted file mode 100644 index 04d86a7b153a..000000000000 --- a/owl-bot-staging/google-cloud-security-public_ca-v1/lib/google/cloud/security/public_ca/v1/public_certificate_authority_service/client.rb +++ /dev/null @@ -1,492 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -require "google/cloud/errors" -require "google/cloud/security/publicca/v1/service_pb" - -module Google - module Cloud - module Security - module PublicCA - module V1 - module PublicCertificateAuthorityService - ## - # Client for the PublicCertificateAuthorityService service. - # - # Manages the resources required for ACME [external account - # binding](https://tools.ietf.org/html/rfc8555#section-7.3.4) for - # the public certificate authority service. - # - class Client - # @private - API_VERSION = "" - - # @private - DEFAULT_ENDPOINT_TEMPLATE = "publicca.$UNIVERSE_DOMAIN$" - - include Paths - - # @private - attr_reader :public_certificate_authority_service_stub - - ## - # Configure the PublicCertificateAuthorityService Client class. - # - # See {::Google::Cloud::Security::PublicCA::V1::PublicCertificateAuthorityService::Client::Configuration} - # for a description of the configuration fields. - # - # @example - # - # # Modify the configuration for all PublicCertificateAuthorityService clients - # ::Google::Cloud::Security::PublicCA::V1::PublicCertificateAuthorityService::Client.configure do |config| - # config.timeout = 10.0 - # end - # - # @yield [config] Configure the Client client. - # @yieldparam config [Client::Configuration] - # - # @return [Client::Configuration] - # - def self.configure - @configure ||= begin - namespace = ["Google", "Cloud", "Security", "PublicCA", "V1"] - parent_config = while namespace.any? - parent_name = namespace.join "::" - parent_const = const_get parent_name - break parent_const.configure if parent_const.respond_to? :configure - namespace.pop - end - default_config = Client::Configuration.new parent_config - - default_config.timeout = 60.0 - default_config.retry_policy = { - initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [14] - } - - default_config - end - yield @configure if block_given? - @configure - end - - ## - # Configure the PublicCertificateAuthorityService Client instance. - # - # The configuration is set to the derived mode, meaning that values can be changed, - # but structural changes (adding new fields, etc.) are not allowed. Structural changes - # should be made on {Client.configure}. - # - # See {::Google::Cloud::Security::PublicCA::V1::PublicCertificateAuthorityService::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 - @public_certificate_authority_service_stub.universe_domain - end - - ## - # Create a new PublicCertificateAuthorityService client object. - # - # @example - # - # # Create a client using the default configuration - # client = ::Google::Cloud::Security::PublicCA::V1::PublicCertificateAuthorityService::Client.new - # - # # Create a client using a custom configuration - # client = ::Google::Cloud::Security::PublicCA::V1::PublicCertificateAuthorityService::Client.new do |config| - # config.timeout = 10.0 - # end - # - # @yield [config] Configure the PublicCertificateAuthorityService client. - # @yieldparam config [Client::Configuration] - # - def initialize - # These require statements are intentionally placed here to initialize - # the gRPC module only when it's required. - # See https://github.com/googleapis/toolkit/issues/446 - require "gapic/grpc" - require "google/cloud/security/publicca/v1/service_services_pb" - - # Create the configuration object - @config = Configuration.new Client.configure - - # Yield the configuration if needed - yield @config if block_given? - - # Create credentials - credentials = @config.credentials - # Use self-signed JWT if the endpoint is unchanged from default, - # but only if the default endpoint does not have a region prefix. - enable_self_signed_jwt = @config.endpoint.nil? || - (@config.endpoint == Configuration::DEFAULT_ENDPOINT && - !@config.endpoint.split(".").first.include?("-")) - credentials ||= Credentials.default scope: @config.scope, - enable_self_signed_jwt: enable_self_signed_jwt - if credentials.is_a?(::String) || credentials.is_a?(::Hash) - credentials = Credentials.new credentials, scope: @config.scope - end - @quota_project_id = @config.quota_project - @quota_project_id ||= credentials.quota_project_id if credentials.respond_to? :quota_project_id - - @public_certificate_authority_service_stub = ::Gapic::ServiceStub.new( - ::Google::Cloud::Security::PublicCA::V1::PublicCertificateAuthorityService::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 - ) - - @public_certificate_authority_service_stub.stub_logger&.info do |entry| - entry.set_system_name - entry.set_service - entry.message = "Created client for #{entry.service}" - entry.set_credentials_fields credentials - entry.set "customEndpoint", @config.endpoint if @config.endpoint - entry.set "defaultTimeout", @config.timeout if @config.timeout - entry.set "quotaProject", @quota_project_id if @quota_project_id - end - end - - ## - # The logger used for request/response debug logging. - # - # @return [Logger] - # - def logger - @public_certificate_authority_service_stub.logger - end - - # Service calls - - ## - # Creates a new - # {::Google::Cloud::Security::PublicCA::V1::ExternalAccountKey ExternalAccountKey} - # bound to the project. - # - # @overload create_external_account_key(request, options = nil) - # Pass arguments to `create_external_account_key` via a request object, either of type - # {::Google::Cloud::Security::PublicCA::V1::CreateExternalAccountKeyRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Security::PublicCA::V1::CreateExternalAccountKeyRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_external_account_key(parent: nil, external_account_key: nil) - # Pass arguments to `create_external_account_key` via keyword arguments. Note that at - # least one keyword argument is 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 external_account_key will be - # created. Format: projects/[project_id]/locations/[location]. At present - # only the "global" location is supported. - # @param external_account_key [::Google::Cloud::Security::PublicCA::V1::ExternalAccountKey, ::Hash] - # Required. The external account key to create. This field only exists to - # future-proof the API. At present, all fields in ExternalAccountKey are - # output only and all values are ignored. For the purpose of the - # CreateExternalAccountKeyRequest, set it to a default/empty value. - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Google::Cloud::Security::PublicCA::V1::ExternalAccountKey] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Google::Cloud::Security::PublicCA::V1::ExternalAccountKey] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/cloud/security/public_ca/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Security::PublicCA::V1::PublicCertificateAuthorityService::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Security::PublicCA::V1::CreateExternalAccountKeyRequest.new - # - # # Call the create_external_account_key method. - # result = client.create_external_account_key request - # - # # The returned object is of type Google::Cloud::Security::PublicCA::V1::ExternalAccountKey. - # p result - # - def create_external_account_key request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Security::PublicCA::V1::CreateExternalAccountKeyRequest - - # Converts hash 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_external_account_key.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::Security::PublicCA::V1::VERSION - metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - header_params = {} - if request.parent - header_params["parent"] = request.parent - end - - request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") - metadata[:"x-goog-request-params"] ||= request_params_header - - options.apply_defaults timeout: @config.rpcs.create_external_account_key.timeout, - metadata: metadata, - retry_policy: @config.rpcs.create_external_account_key.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @public_certificate_authority_service_stub.call_rpc :create_external_account_key, request, options: options do |response, operation| - yield response, operation if block_given? - end - rescue ::GRPC::BadStatus => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Configuration class for the PublicCertificateAuthorityService API. - # - # This class represents the configuration for PublicCertificateAuthorityService, - # providing control over timeouts, retry behavior, logging, transport - # parameters, and other low-level controls. Certain parameters can also be - # applied individually to specific RPCs. See - # {::Google::Cloud::Security::PublicCA::V1::PublicCertificateAuthorityService::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_external_account_key to 20 seconds, - # # and all remaining timeouts to 10 seconds. - # ::Google::Cloud::Security::PublicCA::V1::PublicCertificateAuthorityService::Client.configure do |config| - # config.timeout = 10.0 - # config.rpcs.create_external_account_key.timeout = 20.0 - # end - # - # # Apply the above configuration only to a new client. - # client = ::Google::Cloud::Security::PublicCA::V1::PublicCertificateAuthorityService::Client.new do |config| - # config.timeout = 10.0 - # config.rpcs.create_external_account_key.timeout = 20.0 - # end - # - # @!attribute [rw] endpoint - # A custom service endpoint, as a hostname or hostname:port. The default is - # nil, indicating to use the default endpoint in the current universe domain. - # @return [::String,nil] - # @!attribute [rw] credentials - # Credentials to send with calls. You may provide any of the following types: - # * (`Google::Auth::Credentials`) A googleauth credentials object - # (see the [googleauth docs](https://rubydoc.info/gems/googleauth/Google/Auth/Credentials)) - # * (`Signet::OAuth2::Client`) A signet oauth2 client object - # (see the [signet docs](https://rubydoc.info/gems/signet/Signet/OAuth2/Client)) - # * (`GRPC::Core::Channel`) a gRPC channel with included credentials - # * (`GRPC::Core::ChannelCredentials`) a gRPC credentails object - # * (`nil`) indicating no credentials - # - # @note Warning: Passing a `String` to a keyfile path or a `Hash` of credentials - # is deprecated. Providing an unvalidated credential configuration to - # Google APIs can compromise the security of your systems and data. - # - # @example - # - # # The recommended way to provide credentials is to use the `make_creds` method - # # on the appropriate credentials class for your environment. - # - # require "googleauth" - # - # credentials = ::Google::Auth::ServiceAccountCredentials.make_creds( - # json_key_io: ::File.open("/path/to/keyfile.json") - # ) - # - # client = ::Google::Cloud::Security::PublicCA::V1::PublicCertificateAuthorityService::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 = "publicca.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 PublicCertificateAuthorityService 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_external_account_key` - # @return [::Gapic::Config::Method] - # - attr_reader :create_external_account_key - - # @private - def initialize parent_rpcs = nil - create_external_account_key_config = parent_rpcs.create_external_account_key if parent_rpcs.respond_to? :create_external_account_key - @create_external_account_key = ::Gapic::Config::Method.new create_external_account_key_config - - yield self if block_given? - end - end - end - end - end - end - end - end - end -end diff --git a/owl-bot-staging/google-cloud-security-public_ca-v1/lib/google/cloud/security/public_ca/v1/public_certificate_authority_service/credentials.rb b/owl-bot-staging/google-cloud-security-public_ca-v1/lib/google/cloud/security/public_ca/v1/public_certificate_authority_service/credentials.rb deleted file mode 100644 index 653fd16c5675..000000000000 --- a/owl-bot-staging/google-cloud-security-public_ca-v1/lib/google/cloud/security/public_ca/v1/public_certificate_authority_service/credentials.rb +++ /dev/null @@ -1,49 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -require "googleauth" - -module Google - module Cloud - module Security - module PublicCA - module V1 - module PublicCertificateAuthorityService - # Credentials for the PublicCertificateAuthorityService API. - class Credentials < ::Google::Auth::Credentials - self.scope = [ - "https://www.googleapis.com/auth/cloud-platform" - ] - self.env_vars = [ - "GOOGLE_CLOUD_CREDENTIALS", - "GOOGLE_CLOUD_KEYFILE", - "GCLOUD_KEYFILE", - "GOOGLE_CLOUD_CREDENTIALS_JSON", - "GOOGLE_CLOUD_KEYFILE_JSON", - "GCLOUD_KEYFILE_JSON" - ] - self.paths = [ - "~/.config/google_cloud/application_default_credentials.json" - ] - end - end - end - end - end - end -end diff --git a/owl-bot-staging/google-cloud-security-public_ca-v1/lib/google/cloud/security/public_ca/v1/public_certificate_authority_service/paths.rb b/owl-bot-staging/google-cloud-security-public_ca-v1/lib/google/cloud/security/public_ca/v1/public_certificate_authority_service/paths.rb deleted file mode 100644 index e77bca2284db..000000000000 --- a/owl-bot-staging/google-cloud-security-public_ca-v1/lib/google/cloud/security/public_ca/v1/public_certificate_authority_service/paths.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 Cloud - module Security - module PublicCA - module V1 - module PublicCertificateAuthorityService - # Path helper methods for the PublicCertificateAuthorityService API. - module Paths - ## - # Create a fully-qualified ExternalAccountKey resource string. - # - # The resource will be in the following format: - # - # `projects/{project}/locations/{location}/externalAccountKeys/{external_account_key}` - # - # @param project [String] - # @param location [String] - # @param external_account_key [String] - # - # @return [::String] - def external_account_key_path project:, location:, external_account_key: - raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" - raise ::ArgumentError, "location cannot contain /" if location.to_s.include? "/" - - "projects/#{project}/locations/#{location}/externalAccountKeys/#{external_account_key}" - 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 - - extend self - end - end - end - end - end - end -end diff --git a/owl-bot-staging/google-cloud-security-public_ca-v1/lib/google/cloud/security/public_ca/v1/public_certificate_authority_service/rest.rb b/owl-bot-staging/google-cloud-security-public_ca-v1/lib/google/cloud/security/public_ca/v1/public_certificate_authority_service/rest.rb deleted file mode 100644 index 5244fb7928e9..000000000000 --- a/owl-bot-staging/google-cloud-security-public_ca-v1/lib/google/cloud/security/public_ca/v1/public_certificate_authority_service/rest.rb +++ /dev/null @@ -1,56 +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/security/public_ca/v1/version" - -require "google/cloud/security/public_ca/v1/public_certificate_authority_service/credentials" -require "google/cloud/security/public_ca/v1/public_certificate_authority_service/paths" -require "google/cloud/security/public_ca/v1/public_certificate_authority_service/rest/client" - -module Google - module Cloud - module Security - module PublicCA - module V1 - ## - # Manages the resources required for ACME [external account - # binding](https://tools.ietf.org/html/rfc8555#section-7.3.4) for - # the public certificate authority service. - # - # To load this service and instantiate a REST client: - # - # require "google/cloud/security/public_ca/v1/public_certificate_authority_service/rest" - # client = ::Google::Cloud::Security::PublicCA::V1::PublicCertificateAuthorityService::Rest::Client.new - # - module PublicCertificateAuthorityService - # Client for the REST transport - module Rest - end - end - end - end - end - end -end - -helper_path = ::File.join __dir__, "rest", "helpers.rb" -require "google/cloud/security/public_ca/v1/public_certificate_authority_service/rest/helpers" if ::File.file? helper_path diff --git a/owl-bot-staging/google-cloud-security-public_ca-v1/lib/google/cloud/security/public_ca/v1/public_certificate_authority_service/rest/client.rb b/owl-bot-staging/google-cloud-security-public_ca-v1/lib/google/cloud/security/public_ca/v1/public_certificate_authority_service/rest/client.rb deleted file mode 100644 index cb487099325f..000000000000 --- a/owl-bot-staging/google-cloud-security-public_ca-v1/lib/google/cloud/security/public_ca/v1/public_certificate_authority_service/rest/client.rb +++ /dev/null @@ -1,442 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -require "google/cloud/errors" -require "google/cloud/security/publicca/v1/service_pb" -require "google/cloud/security/public_ca/v1/public_certificate_authority_service/rest/service_stub" - -module Google - module Cloud - module Security - module PublicCA - module V1 - module PublicCertificateAuthorityService - module Rest - ## - # REST client for the PublicCertificateAuthorityService service. - # - # Manages the resources required for ACME [external account - # binding](https://tools.ietf.org/html/rfc8555#section-7.3.4) for - # the public certificate authority service. - # - class Client - # @private - API_VERSION = "" - - # @private - DEFAULT_ENDPOINT_TEMPLATE = "publicca.$UNIVERSE_DOMAIN$" - - include Paths - - # @private - attr_reader :public_certificate_authority_service_stub - - ## - # Configure the PublicCertificateAuthorityService Client class. - # - # See {::Google::Cloud::Security::PublicCA::V1::PublicCertificateAuthorityService::Rest::Client::Configuration} - # for a description of the configuration fields. - # - # @example - # - # # Modify the configuration for all PublicCertificateAuthorityService clients - # ::Google::Cloud::Security::PublicCA::V1::PublicCertificateAuthorityService::Rest::Client.configure do |config| - # config.timeout = 10.0 - # end - # - # @yield [config] Configure the Client client. - # @yieldparam config [Client::Configuration] - # - # @return [Client::Configuration] - # - def self.configure - @configure ||= begin - namespace = ["Google", "Cloud", "Security", "PublicCA", "V1"] - parent_config = while namespace.any? - parent_name = namespace.join "::" - parent_const = const_get parent_name - break parent_const.configure if parent_const.respond_to? :configure - namespace.pop - end - default_config = Client::Configuration.new parent_config - - default_config.timeout = 60.0 - default_config.retry_policy = { - initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [14] - } - - default_config - end - yield @configure if block_given? - @configure - end - - ## - # Configure the PublicCertificateAuthorityService Client instance. - # - # The configuration is set to the derived mode, meaning that values can be changed, - # but structural changes (adding new fields, etc.) are not allowed. Structural changes - # should be made on {Client.configure}. - # - # See {::Google::Cloud::Security::PublicCA::V1::PublicCertificateAuthorityService::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 - @public_certificate_authority_service_stub.universe_domain - end - - ## - # Create a new PublicCertificateAuthorityService REST client object. - # - # @example - # - # # Create a client using the default configuration - # client = ::Google::Cloud::Security::PublicCA::V1::PublicCertificateAuthorityService::Rest::Client.new - # - # # Create a client using a custom configuration - # client = ::Google::Cloud::Security::PublicCA::V1::PublicCertificateAuthorityService::Rest::Client.new do |config| - # config.timeout = 10.0 - # end - # - # @yield [config] Configure the PublicCertificateAuthorityService 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 - - @public_certificate_authority_service_stub = ::Google::Cloud::Security::PublicCA::V1::PublicCertificateAuthorityService::Rest::ServiceStub.new( - endpoint: @config.endpoint, - endpoint_template: DEFAULT_ENDPOINT_TEMPLATE, - universe_domain: @config.universe_domain, - credentials: credentials, - logger: @config.logger - ) - - @public_certificate_authority_service_stub.logger(stub: true)&.info do |entry| - entry.set_system_name - entry.set_service - entry.message = "Created client for #{entry.service}" - entry.set_credentials_fields credentials - entry.set "customEndpoint", @config.endpoint if @config.endpoint - entry.set "defaultTimeout", @config.timeout if @config.timeout - entry.set "quotaProject", @quota_project_id if @quota_project_id - end - end - - ## - # The logger used for request/response debug logging. - # - # @return [Logger] - # - def logger - @public_certificate_authority_service_stub.logger - end - - # Service calls - - ## - # Creates a new - # {::Google::Cloud::Security::PublicCA::V1::ExternalAccountKey ExternalAccountKey} - # bound to the project. - # - # @overload create_external_account_key(request, options = nil) - # Pass arguments to `create_external_account_key` via a request object, either of type - # {::Google::Cloud::Security::PublicCA::V1::CreateExternalAccountKeyRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Security::PublicCA::V1::CreateExternalAccountKeyRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_external_account_key(parent: nil, external_account_key: nil) - # Pass arguments to `create_external_account_key` via keyword arguments. Note that at - # least one keyword argument is 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 external_account_key will be - # created. Format: projects/[project_id]/locations/[location]. At present - # only the "global" location is supported. - # @param external_account_key [::Google::Cloud::Security::PublicCA::V1::ExternalAccountKey, ::Hash] - # Required. The external account key to create. This field only exists to - # future-proof the API. At present, all fields in ExternalAccountKey are - # output only and all values are ignored. For the purpose of the - # CreateExternalAccountKeyRequest, set it to a default/empty value. - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Cloud::Security::PublicCA::V1::ExternalAccountKey] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::Security::PublicCA::V1::ExternalAccountKey] - # - # @raise [::Google::Cloud::Error] if the REST call is aborted. - # - # @example Basic example - # require "google/cloud/security/public_ca/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Security::PublicCA::V1::PublicCertificateAuthorityService::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Security::PublicCA::V1::CreateExternalAccountKeyRequest.new - # - # # Call the create_external_account_key method. - # result = client.create_external_account_key request - # - # # The returned object is of type Google::Cloud::Security::PublicCA::V1::ExternalAccountKey. - # p result - # - def create_external_account_key request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Security::PublicCA::V1::CreateExternalAccountKeyRequest - - # Converts hash 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_external_account_key.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::Security::PublicCA::V1::VERSION, - transports_version_send: [:rest] - - call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - options.apply_defaults timeout: @config.rpcs.create_external_account_key.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.create_external_account_key.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @public_certificate_authority_service_stub.create_external_account_key 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 PublicCertificateAuthorityService REST API. - # - # This class represents the configuration for PublicCertificateAuthorityService REST, - # providing control over timeouts, retry behavior, logging, transport - # parameters, and other low-level controls. Certain parameters can also be - # applied individually to specific RPCs. See - # {::Google::Cloud::Security::PublicCA::V1::PublicCertificateAuthorityService::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_external_account_key to 20 seconds, - # # and all remaining timeouts to 10 seconds. - # ::Google::Cloud::Security::PublicCA::V1::PublicCertificateAuthorityService::Rest::Client.configure do |config| - # config.timeout = 10.0 - # config.rpcs.create_external_account_key.timeout = 20.0 - # end - # - # # Apply the above configuration only to a new client. - # client = ::Google::Cloud::Security::PublicCA::V1::PublicCertificateAuthorityService::Rest::Client.new do |config| - # config.timeout = 10.0 - # config.rpcs.create_external_account_key.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 = "publicca.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 PublicCertificateAuthorityService 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_external_account_key` - # @return [::Gapic::Config::Method] - # - attr_reader :create_external_account_key - - # @private - def initialize parent_rpcs = nil - create_external_account_key_config = parent_rpcs.create_external_account_key if parent_rpcs.respond_to? :create_external_account_key - @create_external_account_key = ::Gapic::Config::Method.new create_external_account_key_config - - yield self if block_given? - end - end - end - end - end - end - end - end - end - end -end diff --git a/owl-bot-staging/google-cloud-security-public_ca-v1/lib/google/cloud/security/public_ca/v1/public_certificate_authority_service/rest/service_stub.rb b/owl-bot-staging/google-cloud-security-public_ca-v1/lib/google/cloud/security/public_ca/v1/public_certificate_authority_service/rest/service_stub.rb deleted file mode 100644 index 2ff54a4784c6..000000000000 --- a/owl-bot-staging/google-cloud-security-public_ca-v1/lib/google/cloud/security/public_ca/v1/public_certificate_authority_service/rest/service_stub.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! - -require "google/cloud/security/publicca/v1/service_pb" - -module Google - module Cloud - module Security - module PublicCA - module V1 - module PublicCertificateAuthorityService - module Rest - ## - # REST service stub for the PublicCertificateAuthorityService 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_external_account_key REST call - # - # @param request_pb [::Google::Cloud::Security::PublicCA::V1::CreateExternalAccountKeyRequest] - # A request object representing the call parameters. Required. - # @param options [::Gapic::CallOptions] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Cloud::Security::PublicCA::V1::ExternalAccountKey] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::Security::PublicCA::V1::ExternalAccountKey] - # A result object deserialized from the server's reply - def create_external_account_key request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_create_external_account_key_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_external_account_key", - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Cloud::Security::PublicCA::V1::ExternalAccountKey.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_external_account_key REST call - # - # @param request_pb [::Google::Cloud::Security::PublicCA::V1::CreateExternalAccountKeyRequest] - # 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_external_account_key_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :post, - uri_template: "/v1/{parent}/externalAccountKeys", - body: "external_account_key", - matches: [ - ["parent", %r{^projects/[^/]+/locations/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - end - end - end - end - end - end - end -end diff --git a/owl-bot-staging/google-cloud-security-public_ca-v1/lib/google/cloud/security/public_ca/v1/rest.rb b/owl-bot-staging/google-cloud-security-public_ca-v1/lib/google/cloud/security/public_ca/v1/rest.rb deleted file mode 100644 index 6b6fd27d8bc9..000000000000 --- a/owl-bot-staging/google-cloud-security-public_ca-v1/lib/google/cloud/security/public_ca/v1/rest.rb +++ /dev/null @@ -1,39 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -require "google/cloud/security/public_ca/v1/public_certificate_authority_service/rest" -require "google/cloud/security/public_ca/v1/version" - -module Google - module Cloud - module Security - module PublicCA - ## - # To load just the REST part of this package, including all its services, and instantiate a REST client: - # - # @example - # - # require "google/cloud/security/public_ca/v1/rest" - # client = ::Google::Cloud::Security::PublicCA::V1::PublicCertificateAuthorityService::Rest::Client.new - # - module V1 - end - end - end - end -end diff --git a/owl-bot-staging/google-cloud-security-public_ca-v1/lib/google/cloud/security/public_ca/v1/version.rb b/owl-bot-staging/google-cloud-security-public_ca-v1/lib/google/cloud/security/public_ca/v1/version.rb deleted file mode 100644 index 2af1514737b4..000000000000 --- a/owl-bot-staging/google-cloud-security-public_ca-v1/lib/google/cloud/security/public_ca/v1/version.rb +++ /dev/null @@ -1,30 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - - -module Google - module Cloud - module Security - module PublicCA - module V1 - VERSION = "0.0.1" - end - end - end - end -end diff --git a/owl-bot-staging/google-cloud-security-public_ca-v1/lib/google/cloud/security/publicca/v1/resources_pb.rb b/owl-bot-staging/google-cloud-security-public_ca-v1/lib/google/cloud/security/publicca/v1/resources_pb.rb deleted file mode 100644 index 53a5bd6da1c6..000000000000 --- a/owl-bot-staging/google-cloud-security-public_ca-v1/lib/google/cloud/security/publicca/v1/resources_pb.rb +++ /dev/null @@ -1,26 +0,0 @@ -# frozen_string_literal: true -# Generated by the protocol buffer compiler. DO NOT EDIT! -# source: google/cloud/security/publicca/v1/resources.proto - -require 'google/protobuf' - -require 'google/api/field_behavior_pb' -require 'google/api/resource_pb' - - -descriptor_data = "\n1google/cloud/security/publicca/v1/resources.proto\x12!google.cloud.security.publicca.v1\x1a\x1fgoogle/api/field_behavior.proto\x1a\x19google/api/resource.proto\"\xdd\x01\n\x12\x45xternalAccountKey\x12\x11\n\x04name\x18\x01 \x01(\tB\x03\xe0\x41\x03\x12\x13\n\x06key_id\x18\x02 \x01(\tB\x03\xe0\x41\x03\x12\x18\n\x0b\x62\x36\x34_mac_key\x18\x03 \x01(\x0c\x42\x03\xe0\x41\x03:\x84\x01\xea\x41\x80\x01\n*publicca.googleapis.com/ExternalAccountKey\x12Rprojects/{project}/locations/{location}/externalAccountKeys/{external_account_key}B\xec\x01\n%com.google.cloud.security.publicca.v1B\x0eResourcesProtoP\x01ZAcloud.google.com/go/security/publicca/apiv1/publiccapb;publiccapb\xaa\x02!Google.Cloud.Security.PublicCA.V1\xca\x02!Google\\Cloud\\Security\\PublicCA\\V1\xea\x02%Google::Cloud::Security::PublicCA::V1b\x06proto3" - -pool = ::Google::Protobuf::DescriptorPool.generated_pool -pool.add_serialized_file(descriptor_data) - -module Google - module Cloud - module Security - module PublicCA - module V1 - ExternalAccountKey = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.security.publicca.v1.ExternalAccountKey").msgclass - end - end - end - end -end diff --git a/owl-bot-staging/google-cloud-security-public_ca-v1/lib/google/cloud/security/publicca/v1/service_pb.rb b/owl-bot-staging/google-cloud-security-public_ca-v1/lib/google/cloud/security/publicca/v1/service_pb.rb deleted file mode 100644 index 1634096e4011..000000000000 --- a/owl-bot-staging/google-cloud-security-public_ca-v1/lib/google/cloud/security/publicca/v1/service_pb.rb +++ /dev/null @@ -1,29 +0,0 @@ -# frozen_string_literal: true -# Generated by the protocol buffer compiler. DO NOT EDIT! -# source: google/cloud/security/publicca/v1/service.proto - -require 'google/protobuf' - -require 'google/api/annotations_pb' -require 'google/api/client_pb' -require 'google/api/field_behavior_pb' -require 'google/api/resource_pb' -require 'google/cloud/security/publicca/v1/resources_pb' - - -descriptor_data = "\n/google/cloud/security/publicca/v1/service.proto\x12!google.cloud.security.publicca.v1\x1a\x1cgoogle/api/annotations.proto\x1a\x17google/api/client.proto\x1a\x1fgoogle/api/field_behavior.proto\x1a\x19google/api/resource.proto\x1a\x31google/cloud/security/publicca/v1/resources.proto\"\xbf\x01\n\x1f\x43reateExternalAccountKeyRequest\x12\x42\n\x06parent\x18\x01 \x01(\tB2\xe0\x41\x02\xfa\x41,\x12*publicca.googleapis.com/ExternalAccountKey\x12X\n\x14\x65xternal_account_key\x18\x02 \x01(\x0b\x32\x35.google.cloud.security.publicca.v1.ExternalAccountKeyB\x03\xe0\x41\x02\x32\xfd\x02\n!PublicCertificateAuthorityService\x12\x8a\x02\n\x18\x43reateExternalAccountKey\x12\x42.google.cloud.security.publicca.v1.CreateExternalAccountKeyRequest\x1a\x35.google.cloud.security.publicca.v1.ExternalAccountKey\"s\xda\x41\x1bparent,external_account_key\x82\xd3\xe4\x93\x02O\"7/v1/{parent=projects/*/locations/*}/externalAccountKeys:\x14\x65xternal_account_key\x1aK\xca\x41\x17publicca.googleapis.com\xd2\x41.https://www.googleapis.com/auth/cloud-platformB\xea\x01\n%com.google.cloud.security.publicca.v1B\x0cServiceProtoP\x01ZAcloud.google.com/go/security/publicca/apiv1/publiccapb;publiccapb\xaa\x02!Google.Cloud.Security.PublicCA.V1\xca\x02!Google\\Cloud\\Security\\PublicCA\\V1\xea\x02%Google::Cloud::Security::PublicCA::V1b\x06proto3" - -pool = ::Google::Protobuf::DescriptorPool.generated_pool -pool.add_serialized_file(descriptor_data) - -module Google - module Cloud - module Security - module PublicCA - module V1 - CreateExternalAccountKeyRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.security.publicca.v1.CreateExternalAccountKeyRequest").msgclass - end - end - end - end -end diff --git a/owl-bot-staging/google-cloud-security-public_ca-v1/lib/google/cloud/security/publicca/v1/service_services_pb.rb b/owl-bot-staging/google-cloud-security-public_ca-v1/lib/google/cloud/security/publicca/v1/service_services_pb.rb deleted file mode 100644 index 01e8e7cf5fde..000000000000 --- a/owl-bot-staging/google-cloud-security-public_ca-v1/lib/google/cloud/security/publicca/v1/service_services_pb.rb +++ /dev/null @@ -1,51 +0,0 @@ -# Generated by the protocol buffer compiler. DO NOT EDIT! -# Source: google/cloud/security/publicca/v1/service.proto for package 'Google.Cloud.Security.PublicCA.V1' -# Original file comments: -# 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 -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. -# - -require 'grpc' -require 'google/cloud/security/publicca/v1/service_pb' - -module Google - module Cloud - module Security - module PublicCA - module V1 - module PublicCertificateAuthorityService - # Manages the resources required for ACME [external account - # binding](https://tools.ietf.org/html/rfc8555#section-7.3.4) for - # the public certificate authority service. - class Service - - include ::GRPC::GenericService - - self.marshal_class_method = :encode - self.unmarshal_class_method = :decode - self.service_name = 'google.cloud.security.publicca.v1.PublicCertificateAuthorityService' - - # Creates a new - # [ExternalAccountKey][google.cloud.security.publicca.v1.ExternalAccountKey] - # bound to the project. - rpc :CreateExternalAccountKey, ::Google::Cloud::Security::PublicCA::V1::CreateExternalAccountKeyRequest, ::Google::Cloud::Security::PublicCA::V1::ExternalAccountKey - end - - Stub = Service.rpc_stub_class - end - end - end - end - end -end diff --git a/owl-bot-staging/google-cloud-security-public_ca-v1/proto_docs/README.md b/owl-bot-staging/google-cloud-security-public_ca-v1/proto_docs/README.md deleted file mode 100644 index dd40054c287f..000000000000 --- a/owl-bot-staging/google-cloud-security-public_ca-v1/proto_docs/README.md +++ /dev/null @@ -1,4 +0,0 @@ -# Public Certificate Authority V1 Protocol Buffer Documentation - -These files are for the YARD documentation of the generated protobuf files. -They are not intended to be required or loaded at runtime. diff --git a/owl-bot-staging/google-cloud-security-public_ca-v1/proto_docs/google/api/client.rb b/owl-bot-staging/google-cloud-security-public_ca-v1/proto_docs/google/api/client.rb deleted file mode 100644 index 5089551e9ea4..000000000000 --- a/owl-bot-staging/google-cloud-security-public_ca-v1/proto_docs/google/api/client.rb +++ /dev/null @@ -1,589 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - - -module Google - module Api - # Required information for every language. - # @!attribute [rw] reference_docs_uri - # @deprecated This field is deprecated and may be removed in the next major version update. - # @return [::String] - # Link to automatically generated reference documentation. Example: - # https://cloud.google.com/nodejs/docs/reference/asset/latest - # @!attribute [rw] destinations - # @return [::Array<::Google::Api::ClientLibraryDestination>] - # The destination where API teams want this client library to be published. - # @!attribute [rw] selective_gapic_generation - # @return [::Google::Api::SelectiveGapicGeneration] - # Configuration for which RPCs should be generated in the GAPIC client. - class CommonLanguageSettings - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Details about how and where to publish client libraries. - # @!attribute [rw] version - # @return [::String] - # Version of the API to apply these settings to. This is the full protobuf - # package for the API, ending in the version element. - # Examples: "google.cloud.speech.v1" and "google.spanner.admin.database.v1". - # @!attribute [rw] launch_stage - # @return [::Google::Api::LaunchStage] - # Launch stage of this version of the API. - # @!attribute [rw] rest_numeric_enums - # @return [::Boolean] - # When using transport=rest, the client request will encode enums as - # numbers rather than strings. - # @!attribute [rw] java_settings - # @return [::Google::Api::JavaSettings] - # Settings for legacy Java features, supported in the Service YAML. - # @!attribute [rw] cpp_settings - # @return [::Google::Api::CppSettings] - # Settings for C++ client libraries. - # @!attribute [rw] php_settings - # @return [::Google::Api::PhpSettings] - # Settings for PHP client libraries. - # @!attribute [rw] python_settings - # @return [::Google::Api::PythonSettings] - # Settings for Python client libraries. - # @!attribute [rw] node_settings - # @return [::Google::Api::NodeSettings] - # Settings for Node client libraries. - # @!attribute [rw] dotnet_settings - # @return [::Google::Api::DotnetSettings] - # Settings for .NET client libraries. - # @!attribute [rw] ruby_settings - # @return [::Google::Api::RubySettings] - # Settings for Ruby client libraries. - # @!attribute [rw] go_settings - # @return [::Google::Api::GoSettings] - # Settings for Go client libraries. - class ClientLibrarySettings - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # This message configures the settings for publishing [Google Cloud Client - # libraries](https://cloud.google.com/apis/docs/cloud-client-libraries) - # generated from the service config. - # @!attribute [rw] method_settings - # @return [::Array<::Google::Api::MethodSettings>] - # A list of API method settings, e.g. the behavior for methods that use the - # long-running operation pattern. - # @!attribute [rw] new_issue_uri - # @return [::String] - # Link to a *public* URI where users can report issues. Example: - # https://issuetracker.google.com/issues/new?component=190865&template=1161103 - # @!attribute [rw] documentation_uri - # @return [::String] - # Link to product home page. Example: - # https://cloud.google.com/asset-inventory/docs/overview - # @!attribute [rw] api_short_name - # @return [::String] - # Used as a tracking tag when collecting data about the APIs developer - # relations artifacts like docs, packages delivered to package managers, - # etc. Example: "speech". - # @!attribute [rw] github_label - # @return [::String] - # GitHub label to apply to issues and pull requests opened for this API. - # @!attribute [rw] codeowner_github_teams - # @return [::Array<::String>] - # GitHub teams to be added to CODEOWNERS in the directory in GitHub - # containing source code for the client libraries for this API. - # @!attribute [rw] doc_tag_prefix - # @return [::String] - # A prefix used in sample code when demarking regions to be included in - # documentation. - # @!attribute [rw] organization - # @return [::Google::Api::ClientLibraryOrganization] - # For whom the client library is being published. - # @!attribute [rw] library_settings - # @return [::Array<::Google::Api::ClientLibrarySettings>] - # Client library settings. If the same version string appears multiple - # times in this list, then the last one wins. Settings from earlier - # settings with the same version string are discarded. - # @!attribute [rw] proto_reference_documentation_uri - # @return [::String] - # Optional link to proto reference documentation. Example: - # https://cloud.google.com/pubsub/lite/docs/reference/rpc - # @!attribute [rw] rest_reference_documentation_uri - # @return [::String] - # Optional link to REST reference documentation. Example: - # https://cloud.google.com/pubsub/lite/docs/reference/rest - class Publishing - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Settings for Java client libraries. - # @!attribute [rw] library_package - # @return [::String] - # The package name to use in Java. Clobbers the java_package option - # set in the protobuf. This should be used **only** by APIs - # who have already set the language_settings.java.package_name" field - # in gapic.yaml. API teams should use the protobuf java_package option - # where possible. - # - # Example of a YAML configuration:: - # - # publishing: - # 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. - # @!attribute [rw] methods - # @return [::Array<::String>] - # An allowlist of the fully qualified names of RPCs that should be included - # on public client surfaces. - # @!attribute [rw] generate_omitted_as_internal - # @return [::Boolean] - # Setting this to true indicates to the client generators that methods - # that would be excluded from the generation should instead be generated - # in a way that indicates these methods should not be consumed by - # end users. How this is expressed is up to individual language - # implementations to decide. Some examples may be: added annotations, - # obfuscated identifiers, or other language idiomatic patterns. - class SelectiveGapicGeneration - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # `BatchingConfigProto` defines the batching configuration for an API method. - # @!attribute [rw] thresholds - # @return [::Google::Api::BatchingSettingsProto] - # The thresholds which trigger a batched request to be sent. - # @!attribute [rw] batch_descriptor - # @return [::Google::Api::BatchingDescriptorProto] - # The request and response fields used in batching. - class BatchingConfigProto - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # `BatchingSettingsProto` specifies a set of batching thresholds, each of - # which acts as a trigger to send a batch of messages as a request. At least - # one threshold must be positive nonzero. - # @!attribute [rw] element_count_threshold - # @return [::Integer] - # The number of elements of a field collected into a batch which, if - # exceeded, causes the batch to be sent. - # @!attribute [rw] request_byte_threshold - # @return [::Integer] - # The aggregated size of the batched field which, if exceeded, causes the - # batch to be sent. This size is computed by aggregating the sizes of the - # request field to be batched, not of the entire request message. - # @!attribute [rw] delay_threshold - # @return [::Google::Protobuf::Duration] - # The duration after which a batch should be sent, starting from the addition - # of the first message to that batch. - # @!attribute [rw] element_count_limit - # @return [::Integer] - # The maximum number of elements collected in a batch that could be accepted - # by server. - # @!attribute [rw] request_byte_limit - # @return [::Integer] - # The maximum size of the request that could be accepted by server. - # @!attribute [rw] flow_control_element_limit - # @return [::Integer] - # The maximum number of elements allowed by flow control. - # @!attribute [rw] flow_control_byte_limit - # @return [::Integer] - # The maximum size of data allowed by flow control. - # @!attribute [rw] flow_control_limit_exceeded_behavior - # @return [::Google::Api::FlowControlLimitExceededBehaviorProto] - # The behavior to take when the flow control limit is exceeded. - class BatchingSettingsProto - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # `BatchingDescriptorProto` specifies the fields of the request message to be - # used for batching, and, optionally, the fields of the response message to be - # used for demultiplexing. - # @!attribute [rw] batched_field - # @return [::String] - # The repeated field in the request message to be aggregated by batching. - # @!attribute [rw] discriminator_fields - # @return [::Array<::String>] - # A list of the fields in the request message. Two requests will be batched - # together only if the values of every field specified in - # `request_discriminator_fields` is equal between the two requests. - # @!attribute [rw] subresponse_field - # @return [::String] - # Optional. When present, indicates the field in the response message to be - # used to demultiplex the response into multiple response messages, in - # correspondence with the multiple request messages originally batched - # together. - class BatchingDescriptorProto - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # The organization for which the client libraries are being published. - # Affects the url where generated docs are published, etc. - module ClientLibraryOrganization - # Not useful. - CLIENT_LIBRARY_ORGANIZATION_UNSPECIFIED = 0 - - # Google Cloud Platform Org. - CLOUD = 1 - - # Ads (Advertising) Org. - ADS = 2 - - # Photos Org. - PHOTOS = 3 - - # Street View Org. - STREET_VIEW = 4 - - # Shopping Org. - SHOPPING = 5 - - # Geo Org. - GEO = 6 - - # Generative AI - https://developers.generativeai.google - GENERATIVE_AI = 7 - end - - # To where should client libraries be published? - module ClientLibraryDestination - # Client libraries will neither be generated nor published to package - # managers. - CLIENT_LIBRARY_DESTINATION_UNSPECIFIED = 0 - - # Generate the client library in a repo under github.com/googleapis, - # but don't publish it to package managers. - GITHUB = 10 - - # Publish the library to package managers like nuget.org and npmjs.com. - PACKAGE_MANAGER = 20 - end - - # The behavior to take when the flow control limit is exceeded. - module FlowControlLimitExceededBehaviorProto - # Default behavior, system-defined. - UNSET_BEHAVIOR = 0 - - # Stop operation, raise error. - THROW_EXCEPTION = 1 - - # Pause operation until limit clears. - BLOCK = 2 - - # Continue operation, disregard limit. - IGNORE = 3 - end - end -end diff --git a/owl-bot-staging/google-cloud-security-public_ca-v1/proto_docs/google/api/field_behavior.rb b/owl-bot-staging/google-cloud-security-public_ca-v1/proto_docs/google/api/field_behavior.rb deleted file mode 100644 index 582be187d115..000000000000 --- a/owl-bot-staging/google-cloud-security-public_ca-v1/proto_docs/google/api/field_behavior.rb +++ /dev/null @@ -1,85 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - - -module Google - module Api - # An indicator of the behavior of a given field (for example, that a field - # is required in requests, or given as output but ignored as input). - # This **does not** change the behavior in protocol buffers itself; it only - # denotes the behavior and may affect how API tooling handles the field. - # - # Note: This enum **may** receive new values in the future. - module FieldBehavior - # Conventional default for enums. Do not use this. - FIELD_BEHAVIOR_UNSPECIFIED = 0 - - # Specifically denotes a field as optional. - # While all fields in protocol buffers are optional, this may be specified - # for emphasis if appropriate. - OPTIONAL = 1 - - # Denotes a field as required. - # This indicates that the field **must** be provided as part of the request, - # and failure to do so will cause an error (usually `INVALID_ARGUMENT`). - REQUIRED = 2 - - # Denotes a field as output only. - # This indicates that the field is provided in responses, but including the - # field in a request does nothing (the server *must* ignore it and - # *must not* throw an error as a result of the field's presence). - OUTPUT_ONLY = 3 - - # Denotes a field as input only. - # This indicates that the field is provided in requests, and the - # corresponding field is not included in output. - INPUT_ONLY = 4 - - # Denotes a field as immutable. - # This indicates that the field may be set once in a request to create a - # resource, but may not be changed thereafter. - IMMUTABLE = 5 - - # Denotes that a (repeated) field is an unordered list. - # This indicates that the service may provide the elements of the list - # in any arbitrary order, rather than the order the user originally - # provided. Additionally, the list's order may or may not be stable. - UNORDERED_LIST = 6 - - # Denotes that this field returns a non-empty default value if not set. - # This indicates that if the user provides the empty value in a request, - # a non-empty value will be returned. The user will not be aware of what - # non-empty value to expect. - NON_EMPTY_DEFAULT = 7 - - # Denotes that the field in a resource (a message annotated with - # google.api.resource) is used in the resource name to uniquely identify the - # resource. For AIP-compliant APIs, this should only be applied to the - # `name` field on the resource. - # - # This behavior should not be applied to references to other resources within - # the message. - # - # The identifier field of resources often have different field behavior - # depending on the request it is embedded in (e.g. for Create methods name - # is optional and unused, while for Update methods it is required). Instead - # of method-specific annotations, only `IDENTIFIER` is required. - IDENTIFIER = 8 - end - end -end diff --git a/owl-bot-staging/google-cloud-security-public_ca-v1/proto_docs/google/api/launch_stage.rb b/owl-bot-staging/google-cloud-security-public_ca-v1/proto_docs/google/api/launch_stage.rb deleted file mode 100644 index 9392a413fb1b..000000000000 --- a/owl-bot-staging/google-cloud-security-public_ca-v1/proto_docs/google/api/launch_stage.rb +++ /dev/null @@ -1,71 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - - -module Google - module Api - # The launch stage as defined by [Google Cloud Platform - # Launch Stages](https://cloud.google.com/terms/launch-stages). - module LaunchStage - # Do not use this default value. - LAUNCH_STAGE_UNSPECIFIED = 0 - - # The feature is not yet implemented. Users can not use it. - UNIMPLEMENTED = 6 - - # Prelaunch features are hidden from users and are only visible internally. - PRELAUNCH = 7 - - # Early Access features are limited to a closed group of testers. To use - # these features, you must sign up in advance and sign a Trusted Tester - # agreement (which includes confidentiality provisions). These features may - # be unstable, changed in backward-incompatible ways, and are not - # guaranteed to be released. - EARLY_ACCESS = 1 - - # Alpha is a limited availability test for releases before they are cleared - # for widespread use. By Alpha, all significant design issues are resolved - # and we are in the process of verifying functionality. Alpha customers - # need to apply for access, agree to applicable terms, and have their - # projects allowlisted. Alpha releases don't have to be feature complete, - # no SLAs are provided, and there are no technical support obligations, but - # they will be far enough along that customers can actually use them in - # test environments or for limited-use tests -- just like they would in - # normal production cases. - ALPHA = 2 - - # Beta is the point at which we are ready to open a release for any - # customer to use. There are no SLA or technical support obligations in a - # Beta release. Products will be complete from a feature perspective, but - # may have some open outstanding issues. Beta releases are suitable for - # limited production use cases. - BETA = 3 - - # GA features are open to all developers and are considered stable and - # fully qualified for production use. - GA = 4 - - # Deprecated features are scheduled to be shut down and removed. For more - # information, see the "Deprecation Policy" section of our [Terms of - # Service](https://cloud.google.com/terms/) - # and the [Google Cloud Platform Subject to the Deprecation - # Policy](https://cloud.google.com/terms/deprecation) documentation. - DEPRECATED = 5 - end - end -end diff --git a/owl-bot-staging/google-cloud-security-public_ca-v1/proto_docs/google/api/resource.rb b/owl-bot-staging/google-cloud-security-public_ca-v1/proto_docs/google/api/resource.rb deleted file mode 100644 index 25dec4847ac1..000000000000 --- a/owl-bot-staging/google-cloud-security-public_ca-v1/proto_docs/google/api/resource.rb +++ /dev/null @@ -1,227 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - - -module Google - module Api - # A simple descriptor of a resource type. - # - # ResourceDescriptor annotates a resource message (either by means of a - # protobuf annotation or use in the service config), and associates the - # resource's schema, the resource type, and the pattern of the resource name. - # - # Example: - # - # message Topic { - # // Indicates this message defines a resource schema. - # // Declares the resource type in the format of {service}/{kind}. - # // For Kubernetes resources, the format is {api group}/{kind}. - # option (google.api.resource) = { - # type: "pubsub.googleapis.com/Topic" - # pattern: "projects/{project}/topics/{topic}" - # }; - # } - # - # The ResourceDescriptor Yaml config will look like: - # - # resources: - # - type: "pubsub.googleapis.com/Topic" - # pattern: "projects/{project}/topics/{topic}" - # - # Sometimes, resources have multiple patterns, typically because they can - # live under multiple parents. - # - # Example: - # - # message LogEntry { - # option (google.api.resource) = { - # type: "logging.googleapis.com/LogEntry" - # pattern: "projects/{project}/logs/{log}" - # pattern: "folders/{folder}/logs/{log}" - # pattern: "organizations/{organization}/logs/{log}" - # pattern: "billingAccounts/{billing_account}/logs/{log}" - # }; - # } - # - # The ResourceDescriptor Yaml config will look like: - # - # resources: - # - type: 'logging.googleapis.com/LogEntry' - # pattern: "projects/{project}/logs/{log}" - # pattern: "folders/{folder}/logs/{log}" - # pattern: "organizations/{organization}/logs/{log}" - # pattern: "billingAccounts/{billing_account}/logs/{log}" - # @!attribute [rw] type - # @return [::String] - # The resource type. It must be in the format of - # \\{service_name}/\\{resource_type_kind}. The `resource_type_kind` must be - # singular and must not include version numbers. - # - # Example: `storage.googleapis.com/Bucket` - # - # The value of the resource_type_kind must follow the regular expression - # /[A-Za-z][a-zA-Z0-9]+/. It should start with an upper case character and - # should use PascalCase (UpperCamelCase). The maximum number of - # characters allowed for the `resource_type_kind` is 100. - # @!attribute [rw] pattern - # @return [::Array<::String>] - # Optional. The relative resource name pattern associated with this resource - # type. The DNS prefix of the full resource name shouldn't be specified here. - # - # The path pattern must follow the syntax, which aligns with HTTP binding - # syntax: - # - # Template = Segment { "/" Segment } ; - # Segment = LITERAL | Variable ; - # Variable = "{" LITERAL "}" ; - # - # Examples: - # - # - "projects/\\{project}/topics/\\{topic}" - # - "projects/\\{project}/knowledgeBases/\\{knowledge_base}" - # - # The components in braces correspond to the IDs for each resource in the - # hierarchy. It is expected that, if multiple patterns are provided, - # the same component name (e.g. "project") refers to IDs of the same - # type of resource. - # @!attribute [rw] name_field - # @return [::String] - # Optional. The field on the resource that designates the resource name - # field. If omitted, this is assumed to be "name". - # @!attribute [rw] history - # @return [::Google::Api::ResourceDescriptor::History] - # Optional. The historical or future-looking state of the resource pattern. - # - # Example: - # - # // The InspectTemplate message originally only supported resource - # // names with organization, and project was added later. - # message InspectTemplate { - # option (google.api.resource) = { - # type: "dlp.googleapis.com/InspectTemplate" - # pattern: - # "organizations/{organization}/inspectTemplates/{inspect_template}" - # pattern: "projects/{project}/inspectTemplates/{inspect_template}" - # history: ORIGINALLY_SINGLE_PATTERN - # }; - # } - # @!attribute [rw] plural - # @return [::String] - # The plural name used in the resource name and permission names, such as - # 'projects' for the resource name of 'projects/\\{project}' and the permission - # name of 'cloudresourcemanager.googleapis.com/projects.get'. One exception - # to this is for Nested Collections that have stuttering names, as defined - # in [AIP-122](https://google.aip.dev/122#nested-collections), where the - # collection ID in the resource name pattern does not necessarily directly - # match the `plural` value. - # - # It is the same concept of the `plural` field in k8s CRD spec - # https://kubernetes.io/docs/tasks/access-kubernetes-api/custom-resources/custom-resource-definitions/ - # - # Note: The plural form is required even for singleton resources. See - # https://aip.dev/156 - # @!attribute [rw] singular - # @return [::String] - # The same concept of the `singular` field in k8s CRD spec - # https://kubernetes.io/docs/tasks/access-kubernetes-api/custom-resources/custom-resource-definitions/ - # Such as "project" for the `resourcemanager.googleapis.com/Project` type. - # @!attribute [rw] style - # @return [::Array<::Google::Api::ResourceDescriptor::Style>] - # Style flag(s) for this resource. - # These indicate that a resource is expected to conform to a given - # style. See the specific style flags for additional information. - class ResourceDescriptor - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - - # A description of the historical or future-looking state of the - # resource pattern. - module History - # The "unset" value. - HISTORY_UNSPECIFIED = 0 - - # The resource originally had one pattern and launched as such, and - # additional patterns were added later. - ORIGINALLY_SINGLE_PATTERN = 1 - - # The resource has one pattern, but the API owner expects to add more - # later. (This is the inverse of ORIGINALLY_SINGLE_PATTERN, and prevents - # that from being necessary once there are multiple patterns.) - FUTURE_MULTI_PATTERN = 2 - end - - # A flag representing a specific style that a resource claims to conform to. - module Style - # The unspecified value. Do not use. - STYLE_UNSPECIFIED = 0 - - # This resource is intended to be "declarative-friendly". - # - # Declarative-friendly resources must be more strictly consistent, and - # setting this to true communicates to tools that this resource should - # adhere to declarative-friendly expectations. - # - # Note: This is used by the API linter (linter.aip.dev) to enable - # additional checks. - DECLARATIVE_FRIENDLY = 1 - end - end - - # Defines a proto annotation that describes a string field that refers to - # an API resource. - # @!attribute [rw] type - # @return [::String] - # The resource type that the annotated field references. - # - # Example: - # - # message Subscription { - # string topic = 2 [(google.api.resource_reference) = { - # type: "pubsub.googleapis.com/Topic" - # }]; - # } - # - # Occasionally, a field may reference an arbitrary resource. In this case, - # APIs use the special value * in their resource reference. - # - # Example: - # - # message GetIamPolicyRequest { - # string resource = 2 [(google.api.resource_reference) = { - # type: "*" - # }]; - # } - # @!attribute [rw] child_type - # @return [::String] - # The resource type of a child collection that the annotated field - # references. This is useful for annotating the `parent` field that - # doesn't have a fixed resource type. - # - # Example: - # - # message ListLogEntriesRequest { - # string parent = 1 [(google.api.resource_reference) = { - # child_type: "logging.googleapis.com/LogEntry" - # }; - # } - class ResourceReference - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - end -end diff --git a/owl-bot-staging/google-cloud-security-public_ca-v1/proto_docs/google/cloud/security/publicca/v1/resources.rb b/owl-bot-staging/google-cloud-security-public_ca-v1/proto_docs/google/cloud/security/publicca/v1/resources.rb deleted file mode 100644 index e74175a67df7..000000000000 --- a/owl-bot-staging/google-cloud-security-public_ca-v1/proto_docs/google/cloud/security/publicca/v1/resources.rb +++ /dev/null @@ -1,49 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - - -module Google - module Cloud - module Security - module PublicCA - module V1 - # A representation of an ExternalAccountKey used for [external account - # binding](https://tools.ietf.org/html/rfc8555#section-7.3.4) within ACME. - # @!attribute [r] name - # @return [::String] - # Output only. Resource name. - # projects/\\{project}/locations/\\{location}/externalAccountKeys/\\{key_id} - # @!attribute [r] key_id - # @return [::String] - # Output only. Key ID. - # It is generated by the PublicCertificateAuthorityService - # when the ExternalAccountKey is created - # @!attribute [r] b64_mac_key - # @return [::String] - # Output only. Base64-URL-encoded HS256 key. - # It is generated by the PublicCertificateAuthorityService - # when the ExternalAccountKey is created - class ExternalAccountKey - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - end - end - end - end -end diff --git a/owl-bot-staging/google-cloud-security-public_ca-v1/proto_docs/google/cloud/security/publicca/v1/service.rb b/owl-bot-staging/google-cloud-security-public_ca-v1/proto_docs/google/cloud/security/publicca/v1/service.rb deleted file mode 100644 index 75c611fc4533..000000000000 --- a/owl-bot-staging/google-cloud-security-public_ca-v1/proto_docs/google/cloud/security/publicca/v1/service.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! - - -module Google - module Cloud - module Security - module PublicCA - module V1 - # Creates a new - # {::Google::Cloud::Security::PublicCA::V1::ExternalAccountKey ExternalAccountKey} in - # a given project. - # @!attribute [rw] parent - # @return [::String] - # Required. The parent resource where this external_account_key will be - # created. Format: projects/[project_id]/locations/[location]. At present - # only the "global" location is supported. - # @!attribute [rw] external_account_key - # @return [::Google::Cloud::Security::PublicCA::V1::ExternalAccountKey] - # Required. The external account key to create. This field only exists to - # future-proof the API. At present, all fields in ExternalAccountKey are - # output only and all values are ignored. For the purpose of the - # CreateExternalAccountKeyRequest, set it to a default/empty value. - class CreateExternalAccountKeyRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - end - end - end - end -end diff --git a/owl-bot-staging/google-cloud-security-public_ca-v1/proto_docs/google/protobuf/duration.rb b/owl-bot-staging/google-cloud-security-public_ca-v1/proto_docs/google/protobuf/duration.rb deleted file mode 100644 index ea59f1f91daf..000000000000 --- a/owl-bot-staging/google-cloud-security-public_ca-v1/proto_docs/google/protobuf/duration.rb +++ /dev/null @@ -1,98 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - - -module Google - module Protobuf - # A Duration represents a signed, fixed-length span of time represented - # as a count of seconds and fractions of seconds at nanosecond - # resolution. It is independent of any calendar and concepts like "day" - # or "month". It is related to Timestamp in that the difference between - # two Timestamp values is a Duration and it can be added or subtracted - # from a Timestamp. Range is approximately +-10,000 years. - # - # # Examples - # - # Example 1: Compute Duration from two Timestamps in pseudo code. - # - # Timestamp start = ...; - # Timestamp end = ...; - # Duration duration = ...; - # - # duration.seconds = end.seconds - start.seconds; - # duration.nanos = end.nanos - start.nanos; - # - # if (duration.seconds < 0 && duration.nanos > 0) { - # duration.seconds += 1; - # duration.nanos -= 1000000000; - # } else if (duration.seconds > 0 && duration.nanos < 0) { - # duration.seconds -= 1; - # duration.nanos += 1000000000; - # } - # - # Example 2: Compute Timestamp from Timestamp + Duration in pseudo code. - # - # Timestamp start = ...; - # Duration duration = ...; - # Timestamp end = ...; - # - # end.seconds = start.seconds + duration.seconds; - # end.nanos = start.nanos + duration.nanos; - # - # if (end.nanos < 0) { - # end.seconds -= 1; - # end.nanos += 1000000000; - # } else if (end.nanos >= 1000000000) { - # end.seconds += 1; - # end.nanos -= 1000000000; - # } - # - # Example 3: Compute Duration from datetime.timedelta in Python. - # - # td = datetime.timedelta(days=3, minutes=10) - # duration = Duration() - # duration.FromTimedelta(td) - # - # # JSON Mapping - # - # In JSON format, the Duration type is encoded as a string rather than an - # object, where the string ends in the suffix "s" (indicating seconds) and - # is preceded by the number of seconds, with nanoseconds expressed as - # fractional seconds. For example, 3 seconds with 0 nanoseconds should be - # encoded in JSON format as "3s", while 3 seconds and 1 nanosecond should - # be expressed in JSON format as "3.000000001s", and 3 seconds and 1 - # microsecond should be expressed in JSON format as "3.000001s". - # @!attribute [rw] seconds - # @return [::Integer] - # Signed seconds of the span of time. Must be from -315,576,000,000 - # to +315,576,000,000 inclusive. Note: these bounds are computed from: - # 60 sec/min * 60 min/hr * 24 hr/day * 365.25 days/year * 10000 years - # @!attribute [rw] nanos - # @return [::Integer] - # Signed fractions of a second at nanosecond resolution of the span - # of time. Durations less than one second are represented with a 0 - # `seconds` field and a positive or negative `nanos` field. For durations - # of one second or more, a non-zero value for the `nanos` field must be - # of the same sign as the `seconds` field. Must be from -999,999,999 - # to +999,999,999 inclusive. - class Duration - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - end -end diff --git a/owl-bot-staging/google-cloud-security-public_ca-v1/snippets/Gemfile b/owl-bot-staging/google-cloud-security-public_ca-v1/snippets/Gemfile deleted file mode 100644 index 11c3ad8913f6..000000000000 --- a/owl-bot-staging/google-cloud-security-public_ca-v1/snippets/Gemfile +++ /dev/null @@ -1,32 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -source "https://rubygems.org" - -if ENV["GOOGLE_CLOUD_SAMPLES_TEST"] == "master" - gem "google-cloud-security-public_ca-v1", path: "../" -else - gem "google-cloud-security-public_ca-v1" -end - -group :test do - gem "google-style", "~> 1.26.1" - gem "minitest", "~> 5.16" - gem "minitest-focus", "~> 1.1" - gem "minitest-hooks", "~> 1.5" -end diff --git a/owl-bot-staging/google-cloud-security-public_ca-v1/snippets/public_certificate_authority_service/create_external_account_key.rb b/owl-bot-staging/google-cloud-security-public_ca-v1/snippets/public_certificate_authority_service/create_external_account_key.rb deleted file mode 100644 index 9cd2edf8d818..000000000000 --- a/owl-bot-staging/google-cloud-security-public_ca-v1/snippets/public_certificate_authority_service/create_external_account_key.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 publicca_v1_generated_PublicCertificateAuthorityService_CreateExternalAccountKey_sync] -require "google/cloud/security/public_ca/v1" - -## -# Snippet for the create_external_account_key call in the PublicCertificateAuthorityService service -# -# This snippet has been automatically generated and should be regarded as a code -# template only. It will require modifications to work: -# - It may require correct/in-range values for request initialization. -# - It may require specifying regional endpoints when creating the service -# client as shown in https://cloud.google.com/ruby/docs/reference. -# -# This is an auto-generated example demonstrating basic usage of -# Google::Cloud::Security::PublicCA::V1::PublicCertificateAuthorityService::Client#create_external_account_key. -# -def create_external_account_key - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::Security::PublicCA::V1::PublicCertificateAuthorityService::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::Security::PublicCA::V1::CreateExternalAccountKeyRequest.new - - # Call the create_external_account_key method. - result = client.create_external_account_key request - - # The returned object is of type Google::Cloud::Security::PublicCA::V1::ExternalAccountKey. - p result -end -# [END publicca_v1_generated_PublicCertificateAuthorityService_CreateExternalAccountKey_sync] diff --git a/owl-bot-staging/google-cloud-security-public_ca-v1/snippets/snippet_metadata_google.cloud.security.publicca.v1.json b/owl-bot-staging/google-cloud-security-public_ca-v1/snippets/snippet_metadata_google.cloud.security.publicca.v1.json deleted file mode 100644 index 07eaff75255d..000000000000 --- a/owl-bot-staging/google-cloud-security-public_ca-v1/snippets/snippet_metadata_google.cloud.security.publicca.v1.json +++ /dev/null @@ -1,55 +0,0 @@ -{ - "client_library": { - "name": "google-cloud-security-public_ca-v1", - "version": "", - "language": "RUBY", - "apis": [ - { - "id": "google.cloud.security.publicca.v1", - "version": "v1" - } - ] - }, - "snippets": [ - { - "region_tag": "publicca_v1_generated_PublicCertificateAuthorityService_CreateExternalAccountKey_sync", - "title": "Snippet for the create_external_account_key call in the PublicCertificateAuthorityService service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Security::PublicCA::V1::PublicCertificateAuthorityService::Client#create_external_account_key.", - "file": "public_certificate_authority_service/create_external_account_key.rb", - "language": "RUBY", - "client_method": { - "short_name": "create_external_account_key", - "full_name": "::Google::Cloud::Security::PublicCA::V1::PublicCertificateAuthorityService::Client#create_external_account_key", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::Security::PublicCA::V1::CreateExternalAccountKeyRequest", - "name": "request" - } - ], - "result_type": "::Google::Cloud::Security::PublicCA::V1::ExternalAccountKey", - "client": { - "short_name": "PublicCertificateAuthorityService::Client", - "full_name": "::Google::Cloud::Security::PublicCA::V1::PublicCertificateAuthorityService::Client" - }, - "method": { - "short_name": "CreateExternalAccountKey", - "full_name": "google.cloud.security.publicca.v1.PublicCertificateAuthorityService.CreateExternalAccountKey", - "service": { - "short_name": "PublicCertificateAuthorityService", - "full_name": "google.cloud.security.publicca.v1.PublicCertificateAuthorityService" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 46, - "type": "FULL" - } - ] - } - ] -} \ No newline at end of file diff --git a/owl-bot-staging/google-cloud-security-public_ca-v1/test/google/cloud/security/public_ca/v1/public_certificate_authority_service_paths_test.rb b/owl-bot-staging/google-cloud-security-public_ca-v1/test/google/cloud/security/public_ca/v1/public_certificate_authority_service_paths_test.rb deleted file mode 100644 index 34194282dddf..000000000000 --- a/owl-bot-staging/google-cloud-security-public_ca-v1/test/google/cloud/security/public_ca/v1/public_certificate_authority_service_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/cloud/security/public_ca/v1/public_certificate_authority_service" - -class ::Google::Cloud::Security::PublicCA::V1::PublicCertificateAuthorityService::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_external_account_key_path - grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - ::Gapic::ServiceStub.stub :new, DummyStub.new do - client = ::Google::Cloud::Security::PublicCA::V1::PublicCertificateAuthorityService::Client.new do |config| - config.credentials = grpc_channel - end - - path = client.external_account_key_path project: "value0", location: "value1", external_account_key: "value2" - assert_equal "projects/value0/locations/value1/externalAccountKeys/value2", path - end - end - - def test_location_path - grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - ::Gapic::ServiceStub.stub :new, DummyStub.new do - client = ::Google::Cloud::Security::PublicCA::V1::PublicCertificateAuthorityService::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 -end diff --git a/owl-bot-staging/google-cloud-security-public_ca-v1/test/google/cloud/security/public_ca/v1/public_certificate_authority_service_rest_test.rb b/owl-bot-staging/google-cloud-security-public_ca-v1/test/google/cloud/security/public_ca/v1/public_certificate_authority_service_rest_test.rb deleted file mode 100644 index 2dc6d34d76b5..000000000000 --- a/owl-bot-staging/google-cloud-security-public_ca-v1/test/google/cloud/security/public_ca/v1/public_certificate_authority_service_rest_test.rb +++ /dev/null @@ -1,154 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -require "helper" -require "gapic/rest" -require "google/cloud/security/publicca/v1/service_pb" -require "google/cloud/security/public_ca/v1/public_certificate_authority_service/rest" - - -class ::Google::Cloud::Security::PublicCA::V1::PublicCertificateAuthorityService::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_external_account_key - # Create test objects. - client_result = ::Google::Cloud::Security::PublicCA::V1::ExternalAccountKey.new - http_response = OpenStruct.new body: client_result.to_json - - call_options = {} - - # Create request parameters for a unary method. - parent = "hello world" - external_account_key = {} - - create_external_account_key_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| - assert options.metadata.key? :"x-goog-api-client" - assert options.metadata[:"x-goog-api-client"].include? "rest" - refute options.metadata[:"x-goog-api-client"].include? "grpc" - end - - ::Google::Cloud::Security::PublicCA::V1::PublicCertificateAuthorityService::Rest::ServiceStub.stub :transcode_create_external_account_key_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, create_external_account_key_client_stub do - # Create client - client = ::Google::Cloud::Security::PublicCA::V1::PublicCertificateAuthorityService::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - client.create_external_account_key({ parent: parent, external_account_key: external_account_key }) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use named arguments - client.create_external_account_key parent: parent, external_account_key: external_account_key do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object - client.create_external_account_key ::Google::Cloud::Security::PublicCA::V1::CreateExternalAccountKeyRequest.new(parent: parent, external_account_key: external_account_key) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use hash object with options - client.create_external_account_key({ parent: parent, external_account_key: external_account_key }, call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object with options - client.create_external_account_key(::Google::Cloud::Security::PublicCA::V1::CreateExternalAccountKeyRequest.new(parent: parent, external_account_key: external_account_key), call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Verify method calls - assert_equal 5, create_external_account_key_client_stub.call_count - end - end - end - - def test_configure - credentials_token = :dummy_value - - client = block_config = config = nil - dummy_stub = ClientStub.new nil - Gapic::Rest::ClientStub.stub :new, dummy_stub do - client = ::Google::Cloud::Security::PublicCA::V1::PublicCertificateAuthorityService::Rest::Client.new do |config| - config.credentials = credentials_token - end - end - - config = client.configure do |c| - block_config = c - end - - assert_same block_config, config - assert_kind_of ::Google::Cloud::Security::PublicCA::V1::PublicCertificateAuthorityService::Rest::Client::Configuration, config - end -end diff --git a/owl-bot-staging/google-cloud-security-public_ca-v1/test/google/cloud/security/public_ca/v1/public_certificate_authority_service_test.rb b/owl-bot-staging/google-cloud-security-public_ca-v1/test/google/cloud/security/public_ca/v1/public_certificate_authority_service_test.rb deleted file mode 100644 index 7f05c7c96849..000000000000 --- a/owl-bot-staging/google-cloud-security-public_ca-v1/test/google/cloud/security/public_ca/v1/public_certificate_authority_service_test.rb +++ /dev/null @@ -1,164 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -require "helper" - -require "gapic/grpc/service_stub" - -require "google/cloud/security/publicca/v1/service_pb" -require "google/cloud/security/public_ca/v1/public_certificate_authority_service" - -class ::Google::Cloud::Security::PublicCA::V1::PublicCertificateAuthorityService::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_external_account_key - # Create GRPC objects. - grpc_response = ::Google::Cloud::Security::PublicCA::V1::ExternalAccountKey.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" - external_account_key = {} - - create_external_account_key_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :create_external_account_key, name - assert_kind_of ::Google::Cloud::Security::PublicCA::V1::CreateExternalAccountKeyRequest, request - assert_equal "hello world", request["parent"] - assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::Security::PublicCA::V1::ExternalAccountKey), request["external_account_key"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, create_external_account_key_client_stub do - # Create client - client = ::Google::Cloud::Security::PublicCA::V1::PublicCertificateAuthorityService::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.create_external_account_key({ parent: parent, external_account_key: external_account_key }) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use named arguments - client.create_external_account_key parent: parent, external_account_key: external_account_key do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object - client.create_external_account_key ::Google::Cloud::Security::PublicCA::V1::CreateExternalAccountKeyRequest.new(parent: parent, external_account_key: external_account_key) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use hash object with options - client.create_external_account_key({ parent: parent, external_account_key: external_account_key }, grpc_options) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object with options - client.create_external_account_key(::Google::Cloud::Security::PublicCA::V1::CreateExternalAccountKeyRequest.new(parent: parent, external_account_key: external_account_key), grpc_options) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Verify method calls - assert_equal 5, create_external_account_key_client_stub.call_rpc_count - end - end - - def test_configure - grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - - client = block_config = config = nil - dummy_stub = ClientStub.new nil, nil - Gapic::ServiceStub.stub :new, dummy_stub do - client = ::Google::Cloud::Security::PublicCA::V1::PublicCertificateAuthorityService::Client.new do |config| - config.credentials = grpc_channel - end - end - - config = client.configure do |c| - block_config = c - end - - assert_same block_config, config - assert_kind_of ::Google::Cloud::Security::PublicCA::V1::PublicCertificateAuthorityService::Client::Configuration, config - end - - def test_credentials - key = OpenSSL::PKey::RSA.new 2048 - cred_json = { - "private_key" => key.to_pem, - "client_email" => "app@developer.gserviceaccount.com", - "type" => "service_account" - } - key_file = StringIO.new cred_json.to_json - creds = Google::Auth::ServiceAccountCredentials.make_creds({ json_key_io: key_file }) - - dummy_stub = ClientStub.new nil, nil - Gapic::ServiceStub.stub :new, dummy_stub do - client = ::Google::Cloud::Security::PublicCA::V1::PublicCertificateAuthorityService::Client.new do |config| - config.credentials = creds - end - assert_kind_of ::Google::Cloud::Security::PublicCA::V1::PublicCertificateAuthorityService::Client, client - assert_equal creds, client.configure.credentials - end - end -end diff --git a/owl-bot-staging/google-cloud-security-public_ca-v1/test/helper.rb b/owl-bot-staging/google-cloud-security-public_ca-v1/test/helper.rb deleted file mode 100644 index 672b337030e7..000000000000 --- a/owl-bot-staging/google-cloud-security-public_ca-v1/test/helper.rb +++ /dev/null @@ -1,26 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -require "minitest/autorun" -require "minitest/focus" -require "minitest/mock" -require "minitest/rg" - -require "grpc" - -require "ostruct" diff --git a/owl-bot-staging/google-cloud-security-public_ca-v1beta1/.gitignore b/owl-bot-staging/google-cloud-security-public_ca-v1beta1/.gitignore deleted file mode 100644 index 0135b6bc6cfc..000000000000 --- a/owl-bot-staging/google-cloud-security-public_ca-v1beta1/.gitignore +++ /dev/null @@ -1,22 +0,0 @@ -# Ignore bundler lockfiles -Gemfile.lock -gems.locked - -# Ignore documentation output -doc/* -.yardoc/* - -# Ignore test output -coverage/* - -# Ignore build artifacts -pkg/* - -# Ignore files commonly present in certain dev environments -.vagrant -.DS_STORE -.idea -*.iml - -# Ignore synth output -__pycache__ diff --git a/owl-bot-staging/google-cloud-security-public_ca-v1beta1/.repo-metadata.json b/owl-bot-staging/google-cloud-security-public_ca-v1beta1/.repo-metadata.json deleted file mode 100644 index 1921daa59753..000000000000 --- a/owl-bot-staging/google-cloud-security-public_ca-v1beta1/.repo-metadata.json +++ /dev/null @@ -1,17 +0,0 @@ -{ - "api_id": "publicca.googleapis.com", - "api_shortname": "publicca", - "client_documentation": "https://cloud.google.com/ruby/docs/reference/google-cloud-security-public_ca-v1beta1/latest", - "distribution_name": "google-cloud-security-public_ca-v1beta1", - "is_cloud": true, - "language": "ruby", - "name": "publicca", - "name_pretty": "Public Certificate Authority V1beta1 API", - "product_documentation": "https://cloud.google.com/certificate-manager/docs/public-ca/", - "release_level": "unreleased", - "repo": "googleapis/google-cloud-ruby", - "requires_billing": true, - "ruby-cloud-description": "Certificate Manager's Public Certificate Authority (CA) functionality allows you to provision and deploy widely trusted X.509 certificates after validating that the certificate requester controls the domains. Certificate Manager lets you directly and programmatically request publicly trusted TLS certificates that are already in the root of trust stores used by major browsers, operating systems, and applications. You can use these TLS certificates to authenticate and encrypt internet traffic. Note that google-cloud-security-public_ca-v1beta1 is a version-specific client library. For most uses, we recommend installing the main client library google-cloud-security-public_ca instead. See the readme for more details.", - "ruby-cloud-product-url": "https://cloud.google.com/certificate-manager/docs/public-ca/", - "library_type": "GAPIC_AUTO" -} diff --git a/owl-bot-staging/google-cloud-security-public_ca-v1beta1/.rubocop.yml b/owl-bot-staging/google-cloud-security-public_ca-v1beta1/.rubocop.yml deleted file mode 100644 index a101e8d603d8..000000000000 --- a/owl-bot-staging/google-cloud-security-public_ca-v1beta1/.rubocop.yml +++ /dev/null @@ -1,33 +0,0 @@ -inherit_gem: - google-style: google-style.yml - -AllCops: - Exclude: - - "google-cloud-security-public_ca-v1beta1.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-security-public_ca-v1beta1.rb" diff --git a/owl-bot-staging/google-cloud-security-public_ca-v1beta1/.toys.rb b/owl-bot-staging/google-cloud-security-public_ca-v1beta1/.toys.rb deleted file mode 100644 index 177e22456e8a..000000000000 --- a/owl-bot-staging/google-cloud-security-public_ca-v1beta1/.toys.rb +++ /dev/null @@ -1,28 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -toys_version! ">= 0.15.3" - -if ENV["RUBY_COMMON_TOOLS"] - common_tools_dir = File.expand_path ENV["RUBY_COMMON_TOOLS"] - load File.join(common_tools_dir, "toys", "gapic") -else - load_git remote: "https://github.com/googleapis/ruby-common-tools.git", - path: "toys/gapic", - update: true -end diff --git a/owl-bot-staging/google-cloud-security-public_ca-v1beta1/.yardopts b/owl-bot-staging/google-cloud-security-public_ca-v1beta1/.yardopts deleted file mode 100644 index 1bdee498ff8f..000000000000 --- a/owl-bot-staging/google-cloud-security-public_ca-v1beta1/.yardopts +++ /dev/null @@ -1,12 +0,0 @@ ---no-private ---title="Public Certificate Authority V1beta1 API" ---exclude _pb\.rb$ ---markup markdown ---markup-provider redcarpet - -./lib/**/*.rb -./proto_docs/**/*.rb -- -README.md -LICENSE.md -AUTHENTICATION.md diff --git a/owl-bot-staging/google-cloud-security-public_ca-v1beta1/AUTHENTICATION.md b/owl-bot-staging/google-cloud-security-public_ca-v1beta1/AUTHENTICATION.md deleted file mode 100644 index 351b191af971..000000000000 --- a/owl-bot-staging/google-cloud-security-public_ca-v1beta1/AUTHENTICATION.md +++ /dev/null @@ -1,122 +0,0 @@ -# Authentication - -The recommended way to authenticate to the google-cloud-security-public_ca-v1beta1 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-security-public_ca-v1beta1 library provides several mechanisms to configure your system. -Generally, using Application Default Credentials to facilitate automatic -credentials discovery is the easist method. But if you need to explicitly specify -credentials, there are several methods available to you. - -Credentials are accepted in the following ways, in the following order or precedence: - -1. Credentials specified in method arguments -2. Credentials specified in configuration -3. Credentials pointed to or included in environment variables -4. Credentials found in local ADC file -5. Credentials returned by the metadata server for the attached service account (GCP) - -### Configuration - -You can configure a path to a JSON credentials file, either for an individual client object or -globally, for all client objects. The JSON file can contain credentials created for -[workload identity federation](https://cloud.google.com/iam/docs/workload-identity-federation), -[workforce identity federation](https://cloud.google.com/iam/docs/workforce-identity-federation), or a -[service account key](https://cloud.google.com/docs/authentication/provide-credentials-adc#local-key). - -Note: Service account keys are a security risk if not managed correctly. You should -[choose a more secure alternative to service account keys](https://cloud.google.com/docs/authentication#auth-decision-tree) -whenever possible. - -To configure a credentials file for an individual client initialization: - -```ruby -require "google/cloud/security/public_ca/v1beta1" - -client = ::Google::Cloud::Security::PublicCA::V1beta1::PublicCertificateAuthorityService::Client.new do |config| - config.credentials = "path/to/credentialfile.json" -end -``` - -To configure a credentials file globally for all clients: - -```ruby -require "google/cloud/security/public_ca/v1beta1" - -::Google::Cloud::Security::PublicCA::V1beta1::PublicCertificateAuthorityService::Client.configure do |config| - config.credentials = "path/to/credentialfile.json" -end - -client = ::Google::Cloud::Security::PublicCA::V1beta1::PublicCertificateAuthorityService::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-security-public_ca-v1beta1 -checks for credentials are: - -* `GOOGLE_CLOUD_CREDENTIALS` - Path to JSON file, or JSON contents -* `GOOGLE_APPLICATION_CREDENTIALS` - Path to JSON file - -```ruby -require "google/cloud/security/public_ca/v1beta1" - -ENV["GOOGLE_APPLICATION_CREDENTIALS"] = "path/to/credentialfile.json" - -client = ::Google::Cloud::Security::PublicCA::V1beta1::PublicCertificateAuthorityService::Client.new -``` - -### Local ADC file - -You can set up a local ADC file with your user credentials for authentication during -development. If credentials are not provided in code or in environment variables, -then the local ADC credentials are discovered. - -Follow the steps in [Quickstart](#quickstart) to set up a local ADC file. - -### Google Cloud Platform environments - -When running on Google Cloud Platform (GCP), including Google Compute Engine -(GCE), Google Kubernetes Engine (GKE), Google App Engine (GAE), Google Cloud -Functions (GCF) and Cloud Run, credentials are retrieved from the attached -service account automatically. Code should be written as if already authenticated. - -For more information, see -[Set up ADC for Google Cloud services](https://cloud.google.com/docs/authentication/provide-credentials-adc#attached-sa). diff --git a/owl-bot-staging/google-cloud-security-public_ca-v1beta1/CHANGELOG.md b/owl-bot-staging/google-cloud-security-public_ca-v1beta1/CHANGELOG.md deleted file mode 100644 index f88957a62ba2..000000000000 --- a/owl-bot-staging/google-cloud-security-public_ca-v1beta1/CHANGELOG.md +++ /dev/null @@ -1,2 +0,0 @@ -# Release History - diff --git a/owl-bot-staging/google-cloud-security-public_ca-v1beta1/Gemfile b/owl-bot-staging/google-cloud-security-public_ca-v1beta1/Gemfile deleted file mode 100644 index 1d08558908d8..000000000000 --- a/owl-bot-staging/google-cloud-security-public_ca-v1beta1/Gemfile +++ /dev/null @@ -1,14 +0,0 @@ -source "https://rubygems.org" - -gemspec - -gem "google-style", "~> 1.32.0" -gem "irb", "~> 1.17" -gem "minitest", "~> 6.0.2" -gem "minitest-focus", "~> 1.4" -gem "minitest-mock", "~> 5.27" -gem "minitest-rg", "~> 5.3" -gem "ostruct", "~> 0.5.5" -gem "rake", ">= 13.0" -gem "redcarpet", "~> 3.6" -gem "yard", "~> 0.9" diff --git a/owl-bot-staging/google-cloud-security-public_ca-v1beta1/LICENSE.md b/owl-bot-staging/google-cloud-security-public_ca-v1beta1/LICENSE.md deleted file mode 100644 index c261857ba6ad..000000000000 --- a/owl-bot-staging/google-cloud-security-public_ca-v1beta1/LICENSE.md +++ /dev/null @@ -1,201 +0,0 @@ - Apache License - Version 2.0, January 2004 - http://www.apache.org/licenses/ - - TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION - - 1. Definitions. - - "License" shall mean the terms and conditions for use, reproduction, - and distribution as defined by Sections 1 through 9 of this document. - - "Licensor" shall mean the copyright owner or entity authorized by - the copyright owner that is granting the License. - - "Legal Entity" shall mean the union of the acting entity and all - other entities that control, are controlled by, or are under common - control with that entity. For the purposes of this definition, - "control" means (i) the power, direct or indirect, to cause the - direction or management of such entity, whether by contract or - otherwise, or (ii) ownership of fifty percent (50%) or more of the - outstanding shares, or (iii) beneficial ownership of such entity. - - "You" (or "Your") shall mean an individual or Legal Entity - exercising permissions granted by this License. - - "Source" form shall mean the preferred form for making modifications, - including but not limited to software source code, documentation - source, and configuration files. - - "Object" form shall mean any form resulting from mechanical - transformation or translation of a Source form, including but - not limited to compiled object code, generated documentation, - and conversions to other media types. - - "Work" shall mean the work of authorship, whether in Source or - Object form, made available under the License, as indicated by a - copyright notice that is included in or attached to the work - (an example is provided in the Appendix below). - - "Derivative Works" shall mean any work, whether in Source or Object - form, that is based on (or derived from) the Work and for which the - editorial revisions, annotations, elaborations, or other modifications - represent, as a whole, an original work of authorship. For the purposes - of this License, Derivative Works shall not include works that remain - separable from, or merely link (or bind by name) to the interfaces of, - the Work and Derivative Works thereof. - - "Contribution" shall mean any work of authorship, including - the original version of the Work and any modifications or additions - to that Work or Derivative Works thereof, that is intentionally - submitted to Licensor for inclusion in the Work by the copyright owner - or by an individual or Legal Entity authorized to submit on behalf of - the copyright owner. For the purposes of this definition, "submitted" - means any form of electronic, verbal, or written communication sent - to the Licensor or its representatives, including but not limited to - communication on electronic mailing lists, source code control systems, - and issue tracking systems that are managed by, or on behalf of, the - Licensor for the purpose of discussing and improving the Work, but - excluding communication that is conspicuously marked or otherwise - designated in writing by the copyright owner as "Not a Contribution." - - "Contributor" shall mean Licensor and any individual or Legal Entity - on behalf of whom a Contribution has been received by Licensor and - subsequently incorporated within the Work. - - 2. Grant of Copyright License. Subject to the terms and conditions of - this License, each Contributor hereby grants to You a perpetual, - worldwide, non-exclusive, no-charge, royalty-free, irrevocable - copyright license to reproduce, prepare Derivative Works of, - publicly display, publicly perform, sublicense, and distribute the - Work and such Derivative Works in Source or Object form. - - 3. Grant of Patent License. Subject to the terms and conditions of - this License, each Contributor hereby grants to You a perpetual, - worldwide, non-exclusive, no-charge, royalty-free, irrevocable - (except as stated in this section) patent license to make, have made, - use, offer to sell, sell, import, and otherwise transfer the Work, - where such license applies only to those patent claims licensable - by such Contributor that are necessarily infringed by their - Contribution(s) alone or by combination of their Contribution(s) - with the Work to which such Contribution(s) was submitted. If You - institute patent litigation against any entity (including a - cross-claim or counterclaim in a lawsuit) alleging that the Work - or a Contribution incorporated within the Work constitutes direct - or contributory patent infringement, then any patent licenses - granted to You under this License for that Work shall terminate - as of the date such litigation is filed. - - 4. Redistribution. You may reproduce and distribute copies of the - Work or Derivative Works thereof in any medium, with or without - modifications, and in Source or Object form, provided that You - meet the following conditions: - - (a) You must give any other recipients of the Work or - Derivative Works a copy of this License; and - - (b) You must cause any modified files to carry prominent notices - stating that You changed the files; and - - (c) You must retain, in the Source form of any Derivative Works - that You distribute, all copyright, patent, trademark, and - attribution notices from the Source form of the Work, - excluding those notices that do not pertain to any part of - the Derivative Works; and - - (d) If the Work includes a "NOTICE" text file as part of its - distribution, then any Derivative Works that You distribute must - include a readable copy of the attribution notices contained - within such NOTICE file, excluding those notices that do not - pertain to any part of the Derivative Works, in at least one - of the following places: within a NOTICE text file distributed - as part of the Derivative Works; within the Source form or - documentation, if provided along with the Derivative Works; or, - within a display generated by the Derivative Works, if and - wherever such third-party notices normally appear. The contents - of the NOTICE file are for informational purposes only and - do not modify the License. You may add Your own attribution - notices within Derivative Works that You distribute, alongside - or as an addendum to the NOTICE text from the Work, provided - that such additional attribution notices cannot be construed - as modifying the License. - - You may add Your own copyright statement to Your modifications and - may provide additional or different license terms and conditions - for use, reproduction, or distribution of Your modifications, or - for any such Derivative Works as a whole, provided Your use, - reproduction, and distribution of the Work otherwise complies with - the conditions stated in this License. - - 5. Submission of Contributions. Unless You explicitly state otherwise, - any Contribution intentionally submitted for inclusion in the Work - by You to the Licensor shall be under the terms and conditions of - this License, without any additional terms or conditions. - Notwithstanding the above, nothing herein shall supersede or modify - the terms of any separate license agreement you may have executed - with Licensor regarding such Contributions. - - 6. Trademarks. This License does not grant permission to use the trade - names, trademarks, service marks, or product names of the Licensor, - except as required for reasonable and customary use in describing the - origin of the Work and reproducing the content of the NOTICE file. - - 7. Disclaimer of Warranty. Unless required by applicable law or - agreed to in writing, Licensor provides the Work (and each - Contributor provides its Contributions) on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or - implied, including, without limitation, any warranties or conditions - of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A - PARTICULAR PURPOSE. You are solely responsible for determining the - appropriateness of using or redistributing the Work and assume any - risks associated with Your exercise of permissions under this License. - - 8. Limitation of Liability. In no event and under no legal theory, - whether in tort (including negligence), contract, or otherwise, - unless required by applicable law (such as deliberate and grossly - negligent acts) or agreed to in writing, shall any Contributor be - liable to You for damages, including any direct, indirect, special, - incidental, or consequential damages of any character arising as a - result of this License or out of the use or inability to use the - Work (including but not limited to damages for loss of goodwill, - work stoppage, computer failure or malfunction, or any and all - other commercial damages or losses), even if such Contributor - has been advised of the possibility of such damages. - - 9. Accepting Warranty or Additional Liability. While redistributing - the Work or Derivative Works thereof, You may choose to offer, - and charge a fee for, acceptance of support, warranty, indemnity, - or other liability obligations and/or rights consistent with this - License. However, in accepting such obligations, You may act only - on Your own behalf and on Your sole responsibility, not on behalf - of any other Contributor, and only if You agree to indemnify, - defend, and hold each Contributor harmless for any liability - incurred by, or claims asserted against, such Contributor by reason - of your accepting any such warranty or additional liability. - - END OF TERMS AND CONDITIONS - - APPENDIX: How to apply the Apache License to your work. - - To apply the Apache License to your work, attach the following - boilerplate notice, with the fields enclosed by brackets "[]" - replaced with your own identifying information. (Don't include - the brackets!) The text should be enclosed in the appropriate - comment syntax for the file format. We also recommend that a - file or class name and description of purpose be included on the - same "printed page" as the copyright notice for easier - identification within third-party archives. - - Copyright [yyyy] [name of copyright owner] - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. diff --git a/owl-bot-staging/google-cloud-security-public_ca-v1beta1/README.md b/owl-bot-staging/google-cloud-security-public_ca-v1beta1/README.md deleted file mode 100644 index 5242eb0ad60b..000000000000 --- a/owl-bot-staging/google-cloud-security-public_ca-v1beta1/README.md +++ /dev/null @@ -1,154 +0,0 @@ -# Ruby Client for the Public Certificate Authority V1beta1 API - -The Public Certificate Authority API may be used to create and manage ACME external account binding keys associated with Google Trust Services' publicly trusted certificate authority. - -Certificate Manager's Public Certificate Authority (CA) functionality allows you to provision and deploy widely trusted X.509 certificates after validating that the certificate requester controls the domains. Certificate Manager lets you directly and programmatically request publicly trusted TLS certificates that are already in the root of trust stores used by major browsers, operating systems, and applications. You can use these TLS certificates to authenticate and encrypt internet traffic. - -https://github.com/googleapis/google-cloud-ruby - -This gem is a _versioned_ client. It provides basic client classes for a -specific version of the Public Certificate Authority V1beta1 API. Most users should consider using -the main client gem, -[google-cloud-security-public_ca](https://rubygems.org/gems/google-cloud-security-public_ca). -See the section below titled *Which client should I use?* for more information. - -## Installation - -``` -$ gem install google-cloud-security-public_ca-v1beta1 -``` - -## 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/publicca.googleapis.com) -1. [Set up authentication.](AUTHENTICATION.md) - -## Quick Start - -```ruby -require "google/cloud/security/public_ca/v1beta1" - -client = ::Google::Cloud::Security::PublicCA::V1beta1::PublicCertificateAuthorityService::Client.new -request = ::Google::Cloud::Security::PublicCA::V1beta1::CreateExternalAccountKeyRequest.new # (request fields as keyword arguments...) -response = client.create_external_account_key request -``` - -View the [Client Library Documentation](https://cloud.google.com/ruby/docs/reference/google-cloud-security-public_ca-v1beta1/latest) -for class and method documentation. - -See also the [Product Documentation](https://cloud.google.com/certificate-manager/docs/public-ca/) -for general usage information. - -## Debug Logging - -This library comes with opt-in Debug Logging that can help you troubleshoot -your application's integration with the API. When logging is activated, key -events such as requests and responses, along with data payloads and metadata -such as headers and client configuration, are logged to the standard error -stream. - -**WARNING:** Client Library Debug Logging includes your data payloads in -plaintext, which could include sensitive data such as PII for yourself or your -customers, private keys, or other security data that could be compromising if -leaked. Always practice good data hygiene with your application logs, and follow -the principle of least access. Google also recommends that Client Library Debug -Logging be enabled only temporarily during active debugging, and not used -permanently in production. - -To enable logging, set the environment variable `GOOGLE_SDK_RUBY_LOGGING_GEMS` -to the value `all`. Alternatively, you can set the value to a comma-delimited -list of client library gem names. This will select the default logging behavior, -which writes logs to the standard error stream. On a local workstation, this may -result in logs appearing on the console. When running on a Google Cloud hosting -service such as [Google Cloud Run](https://cloud.google.com/run), this generally -results in logs appearing alongside your application logs in the -[Google Cloud Logging](https://cloud.google.com/logging/) service. - -You can customize logging by modifying the `logger` configuration when -constructing a client object. For example: - -```ruby -require "google/cloud/security/public_ca/v1beta1" -require "logger" - -client = ::Google::Cloud::Security::PublicCA::V1beta1::PublicCertificateAuthorityService::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-security-public_ca`, -and lower-level _versioned_ client libraries with names such as -`google-cloud-security-public_ca-v1beta1`. -_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-security-public_ca`. -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-security-public_ca-v1beta1`. - -### What about the google-apis- clients? - -Client library gems with names that begin with `google-apis-` are based on an -older code generation technology. They talk to a REST/JSON backend (whereas -most modern clients talk to a [gRPC](https://grpc.io/) backend) and they may -not offer the same performance, features, and ease of use provided by more -modern clients. - -The `google-apis-` clients have wide coverage across Google services, so you -might need to use one if there is no modern client available for the service. -However, if a modern client is available, we generally recommend it over the -older `google-apis-` clients. diff --git a/owl-bot-staging/google-cloud-security-public_ca-v1beta1/Rakefile b/owl-bot-staging/google-cloud-security-public_ca-v1beta1/Rakefile deleted file mode 100644 index 6e756d84cb22..000000000000 --- a/owl-bot-staging/google-cloud-security-public_ca-v1beta1/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-security-public_ca-v1beta1 acceptance tests." -task :acceptance, :project, :keyfile do |t, args| - project = args[:project] - project ||= - ENV["GOOGLE_CLOUD_TEST_PROJECT"] || - ENV["GCLOUD_TEST_PROJECT"] - keyfile = args[:keyfile] - keyfile ||= - ENV["GOOGLE_CLOUD_TEST_KEYFILE"] || - ENV["GCLOUD_TEST_KEYFILE"] - if keyfile - keyfile = File.read keyfile - else - keyfile ||= - ENV["GOOGLE_CLOUD_TEST_KEYFILE_JSON"] || - ENV["GCLOUD_TEST_KEYFILE_JSON"] - end - if project.nil? || keyfile.nil? - fail "You must provide a project and keyfile. e.g. rake acceptance[test123, /path/to/keyfile.json] or GOOGLE_CLOUD_TEST_PROJECT=test123 GOOGLE_CLOUD_TEST_KEYFILE=/path/to/keyfile.json rake acceptance" - end - require "google/cloud/security/public_ca/v1beta1/public_certificate_authority_service/credentials" - ::Google::Cloud::Security::PublicCA::V1beta1::PublicCertificateAuthorityService::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-security-public_ca-v1beta1 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-security-public_ca-v1beta1 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-security-public_ca-v1beta1 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-security-public_ca-v1beta1 gem does not have doctest tests." -end - -desc "Run the CI build" -task :ci do - header "BUILDING google-cloud-security-public_ca-v1beta1" - header "google-cloud-security-public_ca-v1beta1 rubocop", "*" - Rake::Task[:rubocop].invoke - header "google-cloud-security-public_ca-v1beta1 yard", "*" - Rake::Task[:yard].invoke - header "google-cloud-security-public_ca-v1beta1 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-security-public_ca-v1beta1 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-security-public_ca-v1beta1 acceptance", "*" - Rake::Task[:acceptance].invoke - end - task :a do - # This is a handy shortcut to save typing - Rake::Task["ci:acceptance"].invoke - end -end - -task default: :test - -def header str, token = "#" - line_length = str.length + 8 - puts "" - puts token * line_length - puts "#{token * 3} #{str} #{token * 3}" - puts token * line_length - puts "" -end diff --git a/owl-bot-staging/google-cloud-security-public_ca-v1beta1/gapic_metadata.json b/owl-bot-staging/google-cloud-security-public_ca-v1beta1/gapic_metadata.json deleted file mode 100644 index 8797303d6141..000000000000 --- a/owl-bot-staging/google-cloud-security-public_ca-v1beta1/gapic_metadata.json +++ /dev/null @@ -1,23 +0,0 @@ -{ - "schema": "1.0", - "comment": "This file maps proto services/RPCs to the corresponding library clients/methods", - "language": "ruby", - "protoPackage": "google.cloud.security.publicca.v1beta1", - "libraryPackage": "::Google::Cloud::Security::PublicCA::V1beta1", - "services": { - "PublicCertificateAuthorityService": { - "clients": { - "grpc": { - "libraryClient": "::Google::Cloud::Security::PublicCA::V1beta1::PublicCertificateAuthorityService::Client", - "rpcs": { - "CreateExternalAccountKey": { - "methods": [ - "create_external_account_key" - ] - } - } - } - } - } - } -} diff --git a/owl-bot-staging/google-cloud-security-public_ca-v1beta1/google-cloud-security-public_ca-v1beta1.gemspec b/owl-bot-staging/google-cloud-security-public_ca-v1beta1/google-cloud-security-public_ca-v1beta1.gemspec deleted file mode 100644 index ff6127e51c1f..000000000000 --- a/owl-bot-staging/google-cloud-security-public_ca-v1beta1/google-cloud-security-public_ca-v1beta1.gemspec +++ /dev/null @@ -1,28 +0,0 @@ -# -*- ruby -*- -# encoding: utf-8 - -require File.expand_path("lib/google/cloud/security/public_ca/v1beta1/version", __dir__) - -Gem::Specification.new do |gem| - gem.name = "google-cloud-security-public_ca-v1beta1" - gem.version = Google::Cloud::Security::PublicCA::V1beta1::VERSION - - gem.authors = ["Google LLC"] - gem.email = "googleapis-packages@google.com" - gem.description = "Certificate Manager's Public Certificate Authority (CA) functionality allows you to provision and deploy widely trusted X.509 certificates after validating that the certificate requester controls the domains. Certificate Manager lets you directly and programmatically request publicly trusted TLS certificates that are already in the root of trust stores used by major browsers, operating systems, and applications. You can use these TLS certificates to authenticate and encrypt internet traffic. Note that google-cloud-security-public_ca-v1beta1 is a version-specific client library. For most uses, we recommend installing the main client library google-cloud-security-public_ca instead. See the readme for more details." - gem.summary = "The Public Certificate Authority API may be used to create and manage ACME external account binding keys associated with Google Trust Services' publicly trusted certificate authority." - 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" -end diff --git a/owl-bot-staging/google-cloud-security-public_ca-v1beta1/lib/google-cloud-security-public_ca-v1beta1.rb b/owl-bot-staging/google-cloud-security-public_ca-v1beta1/lib/google-cloud-security-public_ca-v1beta1.rb deleted file mode 100644 index d6dee1be9611..000000000000 --- a/owl-bot-staging/google-cloud-security-public_ca-v1beta1/lib/google-cloud-security-public_ca-v1beta1.rb +++ /dev/null @@ -1,21 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -# This gem does not autoload during Bundler.require. To load this gem, -# issue explicit require statements for the packages desired, e.g.: -# require "google/cloud/security/public_ca/v1beta1" diff --git a/owl-bot-staging/google-cloud-security-public_ca-v1beta1/lib/google/cloud/security/public_ca/v1beta1.rb b/owl-bot-staging/google-cloud-security-public_ca-v1beta1/lib/google/cloud/security/public_ca/v1beta1.rb deleted file mode 100644 index a8f607059a31..000000000000 --- a/owl-bot-staging/google-cloud-security-public_ca-v1beta1/lib/google/cloud/security/public_ca/v1beta1.rb +++ /dev/null @@ -1,47 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -require "google/cloud/security/public_ca/v1beta1/public_certificate_authority_service" -require "google/cloud/security/public_ca/v1beta1/version" - -module Google - module Cloud - module Security - module PublicCA - ## - # API client module. - # - # @example Load this package, including all its services, and instantiate a gRPC client - # - # require "google/cloud/security/public_ca/v1beta1" - # client = ::Google::Cloud::Security::PublicCA::V1beta1::PublicCertificateAuthorityService::Client.new - # - # @example Load this package, including all its services, and instantiate a REST client - # - # require "google/cloud/security/public_ca/v1beta1" - # client = ::Google::Cloud::Security::PublicCA::V1beta1::PublicCertificateAuthorityService::Rest::Client.new - # - module V1beta1 - end - end - end - end -end - -helper_path = ::File.join __dir__, "v1beta1", "_helpers.rb" -require "google/cloud/security/public_ca/v1beta1/_helpers" if ::File.file? helper_path diff --git a/owl-bot-staging/google-cloud-security-public_ca-v1beta1/lib/google/cloud/security/public_ca/v1beta1/public_certificate_authority_service.rb b/owl-bot-staging/google-cloud-security-public_ca-v1beta1/lib/google/cloud/security/public_ca/v1beta1/public_certificate_authority_service.rb deleted file mode 100644 index 745b3f31d4cb..000000000000 --- a/owl-bot-staging/google-cloud-security-public_ca-v1beta1/lib/google/cloud/security/public_ca/v1beta1/public_certificate_authority_service.rb +++ /dev/null @@ -1,59 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -require "gapic/common" -require "gapic/config" -require "gapic/config/method" - -require "google/cloud/security/public_ca/v1beta1/version" - -require "google/cloud/security/public_ca/v1beta1/public_certificate_authority_service/credentials" -require "google/cloud/security/public_ca/v1beta1/public_certificate_authority_service/paths" -require "google/cloud/security/public_ca/v1beta1/public_certificate_authority_service/client" -require "google/cloud/security/public_ca/v1beta1/public_certificate_authority_service/rest" - -module Google - module Cloud - module Security - module PublicCA - module V1beta1 - ## - # Manages the resources required for ACME [external account - # binding](https://tools.ietf.org/html/rfc8555#section-7.3.4) for - # the public certificate authority service. - # - # @example Load this service and instantiate a gRPC client - # - # require "google/cloud/security/public_ca/v1beta1/public_certificate_authority_service" - # client = ::Google::Cloud::Security::PublicCA::V1beta1::PublicCertificateAuthorityService::Client.new - # - # @example Load this service and instantiate a REST client - # - # require "google/cloud/security/public_ca/v1beta1/public_certificate_authority_service/rest" - # client = ::Google::Cloud::Security::PublicCA::V1beta1::PublicCertificateAuthorityService::Rest::Client.new - # - module PublicCertificateAuthorityService - end - end - end - end - end -end - -helper_path = ::File.join __dir__, "public_certificate_authority_service", "helpers.rb" -require "google/cloud/security/public_ca/v1beta1/public_certificate_authority_service/helpers" if ::File.file? helper_path diff --git a/owl-bot-staging/google-cloud-security-public_ca-v1beta1/lib/google/cloud/security/public_ca/v1beta1/public_certificate_authority_service/client.rb b/owl-bot-staging/google-cloud-security-public_ca-v1beta1/lib/google/cloud/security/public_ca/v1beta1/public_certificate_authority_service/client.rb deleted file mode 100644 index dcc1105d93aa..000000000000 --- a/owl-bot-staging/google-cloud-security-public_ca-v1beta1/lib/google/cloud/security/public_ca/v1beta1/public_certificate_authority_service/client.rb +++ /dev/null @@ -1,492 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -require "google/cloud/errors" -require "google/cloud/security/publicca/v1beta1/service_pb" - -module Google - module Cloud - module Security - module PublicCA - module V1beta1 - module PublicCertificateAuthorityService - ## - # Client for the PublicCertificateAuthorityService service. - # - # Manages the resources required for ACME [external account - # binding](https://tools.ietf.org/html/rfc8555#section-7.3.4) for - # the public certificate authority service. - # - class Client - # @private - API_VERSION = "" - - # @private - DEFAULT_ENDPOINT_TEMPLATE = "publicca.$UNIVERSE_DOMAIN$" - - include Paths - - # @private - attr_reader :public_certificate_authority_service_stub - - ## - # Configure the PublicCertificateAuthorityService Client class. - # - # See {::Google::Cloud::Security::PublicCA::V1beta1::PublicCertificateAuthorityService::Client::Configuration} - # for a description of the configuration fields. - # - # @example - # - # # Modify the configuration for all PublicCertificateAuthorityService clients - # ::Google::Cloud::Security::PublicCA::V1beta1::PublicCertificateAuthorityService::Client.configure do |config| - # config.timeout = 10.0 - # end - # - # @yield [config] Configure the Client client. - # @yieldparam config [Client::Configuration] - # - # @return [Client::Configuration] - # - def self.configure - @configure ||= begin - namespace = ["Google", "Cloud", "Security", "PublicCA", "V1beta1"] - parent_config = while namespace.any? - parent_name = namespace.join "::" - parent_const = const_get parent_name - break parent_const.configure if parent_const.respond_to? :configure - namespace.pop - end - default_config = Client::Configuration.new parent_config - - default_config.timeout = 60.0 - default_config.retry_policy = { - initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [14] - } - - default_config - end - yield @configure if block_given? - @configure - end - - ## - # Configure the PublicCertificateAuthorityService Client instance. - # - # The configuration is set to the derived mode, meaning that values can be changed, - # but structural changes (adding new fields, etc.) are not allowed. Structural changes - # should be made on {Client.configure}. - # - # See {::Google::Cloud::Security::PublicCA::V1beta1::PublicCertificateAuthorityService::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 - @public_certificate_authority_service_stub.universe_domain - end - - ## - # Create a new PublicCertificateAuthorityService client object. - # - # @example - # - # # Create a client using the default configuration - # client = ::Google::Cloud::Security::PublicCA::V1beta1::PublicCertificateAuthorityService::Client.new - # - # # Create a client using a custom configuration - # client = ::Google::Cloud::Security::PublicCA::V1beta1::PublicCertificateAuthorityService::Client.new do |config| - # config.timeout = 10.0 - # end - # - # @yield [config] Configure the PublicCertificateAuthorityService client. - # @yieldparam config [Client::Configuration] - # - def initialize - # These require statements are intentionally placed here to initialize - # the gRPC module only when it's required. - # See https://github.com/googleapis/toolkit/issues/446 - require "gapic/grpc" - require "google/cloud/security/publicca/v1beta1/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 - - @public_certificate_authority_service_stub = ::Gapic::ServiceStub.new( - ::Google::Cloud::Security::PublicCA::V1beta1::PublicCertificateAuthorityService::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 - ) - - @public_certificate_authority_service_stub.stub_logger&.info do |entry| - entry.set_system_name - entry.set_service - entry.message = "Created client for #{entry.service}" - entry.set_credentials_fields credentials - entry.set "customEndpoint", @config.endpoint if @config.endpoint - entry.set "defaultTimeout", @config.timeout if @config.timeout - entry.set "quotaProject", @quota_project_id if @quota_project_id - end - end - - ## - # The logger used for request/response debug logging. - # - # @return [Logger] - # - def logger - @public_certificate_authority_service_stub.logger - end - - # Service calls - - ## - # Creates a new - # {::Google::Cloud::Security::PublicCA::V1beta1::ExternalAccountKey ExternalAccountKey} - # bound to the project. - # - # @overload create_external_account_key(request, options = nil) - # Pass arguments to `create_external_account_key` via a request object, either of type - # {::Google::Cloud::Security::PublicCA::V1beta1::CreateExternalAccountKeyRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Security::PublicCA::V1beta1::CreateExternalAccountKeyRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_external_account_key(parent: nil, external_account_key: nil) - # Pass arguments to `create_external_account_key` via keyword arguments. Note that at - # least one keyword argument is 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 external_account_key will be - # created. Format: projects/[project_id]/locations/[location]. At present - # only the "global" location is supported. - # @param external_account_key [::Google::Cloud::Security::PublicCA::V1beta1::ExternalAccountKey, ::Hash] - # Required. The external account key to create. This field only exists to - # future-proof the API. At present, all fields in ExternalAccountKey are - # output only and all values are ignored. For the purpose of the - # CreateExternalAccountKeyRequest, set it to a default/empty value. - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Google::Cloud::Security::PublicCA::V1beta1::ExternalAccountKey] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Google::Cloud::Security::PublicCA::V1beta1::ExternalAccountKey] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/cloud/security/public_ca/v1beta1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Security::PublicCA::V1beta1::PublicCertificateAuthorityService::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Security::PublicCA::V1beta1::CreateExternalAccountKeyRequest.new - # - # # Call the create_external_account_key method. - # result = client.create_external_account_key request - # - # # The returned object is of type Google::Cloud::Security::PublicCA::V1beta1::ExternalAccountKey. - # p result - # - def create_external_account_key request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Security::PublicCA::V1beta1::CreateExternalAccountKeyRequest - - # Converts hash 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_external_account_key.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::Security::PublicCA::V1beta1::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_external_account_key.timeout, - metadata: metadata, - retry_policy: @config.rpcs.create_external_account_key.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @public_certificate_authority_service_stub.call_rpc :create_external_account_key, request, options: options do |response, operation| - yield response, operation if block_given? - end - rescue ::GRPC::BadStatus => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Configuration class for the PublicCertificateAuthorityService API. - # - # This class represents the configuration for PublicCertificateAuthorityService, - # providing control over timeouts, retry behavior, logging, transport - # parameters, and other low-level controls. Certain parameters can also be - # applied individually to specific RPCs. See - # {::Google::Cloud::Security::PublicCA::V1beta1::PublicCertificateAuthorityService::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_external_account_key to 20 seconds, - # # and all remaining timeouts to 10 seconds. - # ::Google::Cloud::Security::PublicCA::V1beta1::PublicCertificateAuthorityService::Client.configure do |config| - # config.timeout = 10.0 - # config.rpcs.create_external_account_key.timeout = 20.0 - # end - # - # # Apply the above configuration only to a new client. - # client = ::Google::Cloud::Security::PublicCA::V1beta1::PublicCertificateAuthorityService::Client.new do |config| - # config.timeout = 10.0 - # config.rpcs.create_external_account_key.timeout = 20.0 - # end - # - # @!attribute [rw] endpoint - # A custom service endpoint, as a hostname or hostname:port. The default is - # nil, indicating to use the default endpoint in the current universe domain. - # @return [::String,nil] - # @!attribute [rw] credentials - # Credentials to send with calls. You may provide any of the following types: - # * (`Google::Auth::Credentials`) A googleauth credentials object - # (see the [googleauth docs](https://rubydoc.info/gems/googleauth/Google/Auth/Credentials)) - # * (`Signet::OAuth2::Client`) A signet oauth2 client object - # (see the [signet docs](https://rubydoc.info/gems/signet/Signet/OAuth2/Client)) - # * (`GRPC::Core::Channel`) a gRPC channel with included credentials - # * (`GRPC::Core::ChannelCredentials`) a gRPC credentails object - # * (`nil`) indicating no credentials - # - # @note Warning: Passing a `String` to a keyfile path or a `Hash` of credentials - # is deprecated. Providing an unvalidated credential configuration to - # Google APIs can compromise the security of your systems and data. - # - # @example - # - # # The recommended way to provide credentials is to use the `make_creds` method - # # on the appropriate credentials class for your environment. - # - # require "googleauth" - # - # credentials = ::Google::Auth::ServiceAccountCredentials.make_creds( - # json_key_io: ::File.open("/path/to/keyfile.json") - # ) - # - # client = ::Google::Cloud::Security::PublicCA::V1beta1::PublicCertificateAuthorityService::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 = "publicca.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 PublicCertificateAuthorityService 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_external_account_key` - # @return [::Gapic::Config::Method] - # - attr_reader :create_external_account_key - - # @private - def initialize parent_rpcs = nil - create_external_account_key_config = parent_rpcs.create_external_account_key if parent_rpcs.respond_to? :create_external_account_key - @create_external_account_key = ::Gapic::Config::Method.new create_external_account_key_config - - yield self if block_given? - end - end - end - end - end - end - end - end - end -end diff --git a/owl-bot-staging/google-cloud-security-public_ca-v1beta1/lib/google/cloud/security/public_ca/v1beta1/public_certificate_authority_service/credentials.rb b/owl-bot-staging/google-cloud-security-public_ca-v1beta1/lib/google/cloud/security/public_ca/v1beta1/public_certificate_authority_service/credentials.rb deleted file mode 100644 index 89cb30d53806..000000000000 --- a/owl-bot-staging/google-cloud-security-public_ca-v1beta1/lib/google/cloud/security/public_ca/v1beta1/public_certificate_authority_service/credentials.rb +++ /dev/null @@ -1,49 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -require "googleauth" - -module Google - module Cloud - module Security - module PublicCA - module V1beta1 - module PublicCertificateAuthorityService - # Credentials for the PublicCertificateAuthorityService API. - class Credentials < ::Google::Auth::Credentials - self.scope = [ - "https://www.googleapis.com/auth/cloud-platform" - ] - self.env_vars = [ - "GOOGLE_CLOUD_CREDENTIALS", - "GOOGLE_CLOUD_KEYFILE", - "GCLOUD_KEYFILE", - "GOOGLE_CLOUD_CREDENTIALS_JSON", - "GOOGLE_CLOUD_KEYFILE_JSON", - "GCLOUD_KEYFILE_JSON" - ] - self.paths = [ - "~/.config/google_cloud/application_default_credentials.json" - ] - end - end - end - end - end - end -end diff --git a/owl-bot-staging/google-cloud-security-public_ca-v1beta1/lib/google/cloud/security/public_ca/v1beta1/public_certificate_authority_service/paths.rb b/owl-bot-staging/google-cloud-security-public_ca-v1beta1/lib/google/cloud/security/public_ca/v1beta1/public_certificate_authority_service/paths.rb deleted file mode 100644 index 2b60298d5d3f..000000000000 --- a/owl-bot-staging/google-cloud-security-public_ca-v1beta1/lib/google/cloud/security/public_ca/v1beta1/public_certificate_authority_service/paths.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 Cloud - module Security - module PublicCA - module V1beta1 - module PublicCertificateAuthorityService - # Path helper methods for the PublicCertificateAuthorityService API. - module Paths - ## - # Create a fully-qualified ExternalAccountKey resource string. - # - # The resource will be in the following format: - # - # `projects/{project}/locations/{location}/externalAccountKeys/{external_account_key}` - # - # @param project [String] - # @param location [String] - # @param external_account_key [String] - # - # @return [::String] - def external_account_key_path project:, location:, external_account_key: - raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" - raise ::ArgumentError, "location cannot contain /" if location.to_s.include? "/" - - "projects/#{project}/locations/#{location}/externalAccountKeys/#{external_account_key}" - 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 - - extend self - end - end - end - end - end - end -end diff --git a/owl-bot-staging/google-cloud-security-public_ca-v1beta1/lib/google/cloud/security/public_ca/v1beta1/public_certificate_authority_service/rest.rb b/owl-bot-staging/google-cloud-security-public_ca-v1beta1/lib/google/cloud/security/public_ca/v1beta1/public_certificate_authority_service/rest.rb deleted file mode 100644 index e022b4af197b..000000000000 --- a/owl-bot-staging/google-cloud-security-public_ca-v1beta1/lib/google/cloud/security/public_ca/v1beta1/public_certificate_authority_service/rest.rb +++ /dev/null @@ -1,56 +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/security/public_ca/v1beta1/version" - -require "google/cloud/security/public_ca/v1beta1/public_certificate_authority_service/credentials" -require "google/cloud/security/public_ca/v1beta1/public_certificate_authority_service/paths" -require "google/cloud/security/public_ca/v1beta1/public_certificate_authority_service/rest/client" - -module Google - module Cloud - module Security - module PublicCA - module V1beta1 - ## - # Manages the resources required for ACME [external account - # binding](https://tools.ietf.org/html/rfc8555#section-7.3.4) for - # the public certificate authority service. - # - # To load this service and instantiate a REST client: - # - # require "google/cloud/security/public_ca/v1beta1/public_certificate_authority_service/rest" - # client = ::Google::Cloud::Security::PublicCA::V1beta1::PublicCertificateAuthorityService::Rest::Client.new - # - module PublicCertificateAuthorityService - # Client for the REST transport - module Rest - end - end - end - end - end - end -end - -helper_path = ::File.join __dir__, "rest", "helpers.rb" -require "google/cloud/security/public_ca/v1beta1/public_certificate_authority_service/rest/helpers" if ::File.file? helper_path diff --git a/owl-bot-staging/google-cloud-security-public_ca-v1beta1/lib/google/cloud/security/public_ca/v1beta1/public_certificate_authority_service/rest/client.rb b/owl-bot-staging/google-cloud-security-public_ca-v1beta1/lib/google/cloud/security/public_ca/v1beta1/public_certificate_authority_service/rest/client.rb deleted file mode 100644 index db98415432a6..000000000000 --- a/owl-bot-staging/google-cloud-security-public_ca-v1beta1/lib/google/cloud/security/public_ca/v1beta1/public_certificate_authority_service/rest/client.rb +++ /dev/null @@ -1,442 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -require "google/cloud/errors" -require "google/cloud/security/publicca/v1beta1/service_pb" -require "google/cloud/security/public_ca/v1beta1/public_certificate_authority_service/rest/service_stub" - -module Google - module Cloud - module Security - module PublicCA - module V1beta1 - module PublicCertificateAuthorityService - module Rest - ## - # REST client for the PublicCertificateAuthorityService service. - # - # Manages the resources required for ACME [external account - # binding](https://tools.ietf.org/html/rfc8555#section-7.3.4) for - # the public certificate authority service. - # - class Client - # @private - API_VERSION = "" - - # @private - DEFAULT_ENDPOINT_TEMPLATE = "publicca.$UNIVERSE_DOMAIN$" - - include Paths - - # @private - attr_reader :public_certificate_authority_service_stub - - ## - # Configure the PublicCertificateAuthorityService Client class. - # - # See {::Google::Cloud::Security::PublicCA::V1beta1::PublicCertificateAuthorityService::Rest::Client::Configuration} - # for a description of the configuration fields. - # - # @example - # - # # Modify the configuration for all PublicCertificateAuthorityService clients - # ::Google::Cloud::Security::PublicCA::V1beta1::PublicCertificateAuthorityService::Rest::Client.configure do |config| - # config.timeout = 10.0 - # end - # - # @yield [config] Configure the Client client. - # @yieldparam config [Client::Configuration] - # - # @return [Client::Configuration] - # - def self.configure - @configure ||= begin - namespace = ["Google", "Cloud", "Security", "PublicCA", "V1beta1"] - parent_config = while namespace.any? - parent_name = namespace.join "::" - parent_const = const_get parent_name - break parent_const.configure if parent_const.respond_to? :configure - namespace.pop - end - default_config = Client::Configuration.new parent_config - - default_config.timeout = 60.0 - default_config.retry_policy = { - initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [14] - } - - default_config - end - yield @configure if block_given? - @configure - end - - ## - # Configure the PublicCertificateAuthorityService Client instance. - # - # The configuration is set to the derived mode, meaning that values can be changed, - # but structural changes (adding new fields, etc.) are not allowed. Structural changes - # should be made on {Client.configure}. - # - # See {::Google::Cloud::Security::PublicCA::V1beta1::PublicCertificateAuthorityService::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 - @public_certificate_authority_service_stub.universe_domain - end - - ## - # Create a new PublicCertificateAuthorityService REST client object. - # - # @example - # - # # Create a client using the default configuration - # client = ::Google::Cloud::Security::PublicCA::V1beta1::PublicCertificateAuthorityService::Rest::Client.new - # - # # Create a client using a custom configuration - # client = ::Google::Cloud::Security::PublicCA::V1beta1::PublicCertificateAuthorityService::Rest::Client.new do |config| - # config.timeout = 10.0 - # end - # - # @yield [config] Configure the PublicCertificateAuthorityService 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 - - @public_certificate_authority_service_stub = ::Google::Cloud::Security::PublicCA::V1beta1::PublicCertificateAuthorityService::Rest::ServiceStub.new( - endpoint: @config.endpoint, - endpoint_template: DEFAULT_ENDPOINT_TEMPLATE, - universe_domain: @config.universe_domain, - credentials: credentials, - logger: @config.logger - ) - - @public_certificate_authority_service_stub.logger(stub: true)&.info do |entry| - entry.set_system_name - entry.set_service - entry.message = "Created client for #{entry.service}" - entry.set_credentials_fields credentials - entry.set "customEndpoint", @config.endpoint if @config.endpoint - entry.set "defaultTimeout", @config.timeout if @config.timeout - entry.set "quotaProject", @quota_project_id if @quota_project_id - end - end - - ## - # The logger used for request/response debug logging. - # - # @return [Logger] - # - def logger - @public_certificate_authority_service_stub.logger - end - - # Service calls - - ## - # Creates a new - # {::Google::Cloud::Security::PublicCA::V1beta1::ExternalAccountKey ExternalAccountKey} - # bound to the project. - # - # @overload create_external_account_key(request, options = nil) - # Pass arguments to `create_external_account_key` via a request object, either of type - # {::Google::Cloud::Security::PublicCA::V1beta1::CreateExternalAccountKeyRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Security::PublicCA::V1beta1::CreateExternalAccountKeyRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_external_account_key(parent: nil, external_account_key: nil) - # Pass arguments to `create_external_account_key` via keyword arguments. Note that at - # least one keyword argument is 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 external_account_key will be - # created. Format: projects/[project_id]/locations/[location]. At present - # only the "global" location is supported. - # @param external_account_key [::Google::Cloud::Security::PublicCA::V1beta1::ExternalAccountKey, ::Hash] - # Required. The external account key to create. This field only exists to - # future-proof the API. At present, all fields in ExternalAccountKey are - # output only and all values are ignored. For the purpose of the - # CreateExternalAccountKeyRequest, set it to a default/empty value. - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Cloud::Security::PublicCA::V1beta1::ExternalAccountKey] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::Security::PublicCA::V1beta1::ExternalAccountKey] - # - # @raise [::Google::Cloud::Error] if the REST call is aborted. - # - # @example Basic example - # require "google/cloud/security/public_ca/v1beta1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Security::PublicCA::V1beta1::PublicCertificateAuthorityService::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Security::PublicCA::V1beta1::CreateExternalAccountKeyRequest.new - # - # # Call the create_external_account_key method. - # result = client.create_external_account_key request - # - # # The returned object is of type Google::Cloud::Security::PublicCA::V1beta1::ExternalAccountKey. - # p result - # - def create_external_account_key request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Security::PublicCA::V1beta1::CreateExternalAccountKeyRequest - - # Converts hash 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_external_account_key.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::Security::PublicCA::V1beta1::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_external_account_key.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.create_external_account_key.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @public_certificate_authority_service_stub.create_external_account_key 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 PublicCertificateAuthorityService REST API. - # - # This class represents the configuration for PublicCertificateAuthorityService REST, - # providing control over timeouts, retry behavior, logging, transport - # parameters, and other low-level controls. Certain parameters can also be - # applied individually to specific RPCs. See - # {::Google::Cloud::Security::PublicCA::V1beta1::PublicCertificateAuthorityService::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_external_account_key to 20 seconds, - # # and all remaining timeouts to 10 seconds. - # ::Google::Cloud::Security::PublicCA::V1beta1::PublicCertificateAuthorityService::Rest::Client.configure do |config| - # config.timeout = 10.0 - # config.rpcs.create_external_account_key.timeout = 20.0 - # end - # - # # Apply the above configuration only to a new client. - # client = ::Google::Cloud::Security::PublicCA::V1beta1::PublicCertificateAuthorityService::Rest::Client.new do |config| - # config.timeout = 10.0 - # config.rpcs.create_external_account_key.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 = "publicca.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 PublicCertificateAuthorityService 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_external_account_key` - # @return [::Gapic::Config::Method] - # - attr_reader :create_external_account_key - - # @private - def initialize parent_rpcs = nil - create_external_account_key_config = parent_rpcs.create_external_account_key if parent_rpcs.respond_to? :create_external_account_key - @create_external_account_key = ::Gapic::Config::Method.new create_external_account_key_config - - yield self if block_given? - end - end - end - end - end - end - end - end - end - end -end diff --git a/owl-bot-staging/google-cloud-security-public_ca-v1beta1/lib/google/cloud/security/public_ca/v1beta1/public_certificate_authority_service/rest/service_stub.rb b/owl-bot-staging/google-cloud-security-public_ca-v1beta1/lib/google/cloud/security/public_ca/v1beta1/public_certificate_authority_service/rest/service_stub.rb deleted file mode 100644 index 7ee907e245d0..000000000000 --- a/owl-bot-staging/google-cloud-security-public_ca-v1beta1/lib/google/cloud/security/public_ca/v1beta1/public_certificate_authority_service/rest/service_stub.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! - -require "google/cloud/security/publicca/v1beta1/service_pb" - -module Google - module Cloud - module Security - module PublicCA - module V1beta1 - module PublicCertificateAuthorityService - module Rest - ## - # REST service stub for the PublicCertificateAuthorityService 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_external_account_key REST call - # - # @param request_pb [::Google::Cloud::Security::PublicCA::V1beta1::CreateExternalAccountKeyRequest] - # A request object representing the call parameters. Required. - # @param options [::Gapic::CallOptions] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Cloud::Security::PublicCA::V1beta1::ExternalAccountKey] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::Security::PublicCA::V1beta1::ExternalAccountKey] - # A result object deserialized from the server's reply - def create_external_account_key request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_create_external_account_key_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_external_account_key", - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Cloud::Security::PublicCA::V1beta1::ExternalAccountKey.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_external_account_key REST call - # - # @param request_pb [::Google::Cloud::Security::PublicCA::V1beta1::CreateExternalAccountKeyRequest] - # 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_external_account_key_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :post, - uri_template: "/v1beta1/{parent}/externalAccountKeys", - body: "external_account_key", - matches: [ - ["parent", %r{^projects/[^/]+/locations/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - end - end - end - end - end - end - end -end diff --git a/owl-bot-staging/google-cloud-security-public_ca-v1beta1/lib/google/cloud/security/public_ca/v1beta1/rest.rb b/owl-bot-staging/google-cloud-security-public_ca-v1beta1/lib/google/cloud/security/public_ca/v1beta1/rest.rb deleted file mode 100644 index 0d388c9d0dd9..000000000000 --- a/owl-bot-staging/google-cloud-security-public_ca-v1beta1/lib/google/cloud/security/public_ca/v1beta1/rest.rb +++ /dev/null @@ -1,39 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -require "google/cloud/security/public_ca/v1beta1/public_certificate_authority_service/rest" -require "google/cloud/security/public_ca/v1beta1/version" - -module Google - module Cloud - module Security - module PublicCA - ## - # To load just the REST part of this package, including all its services, and instantiate a REST client: - # - # @example - # - # require "google/cloud/security/public_ca/v1beta1/rest" - # client = ::Google::Cloud::Security::PublicCA::V1beta1::PublicCertificateAuthorityService::Rest::Client.new - # - module V1beta1 - end - end - end - end -end diff --git a/owl-bot-staging/google-cloud-security-public_ca-v1beta1/lib/google/cloud/security/public_ca/v1beta1/version.rb b/owl-bot-staging/google-cloud-security-public_ca-v1beta1/lib/google/cloud/security/public_ca/v1beta1/version.rb deleted file mode 100644 index f223859cedd7..000000000000 --- a/owl-bot-staging/google-cloud-security-public_ca-v1beta1/lib/google/cloud/security/public_ca/v1beta1/version.rb +++ /dev/null @@ -1,30 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - - -module Google - module Cloud - module Security - module PublicCA - module V1beta1 - VERSION = "0.0.1" - end - end - end - end -end diff --git a/owl-bot-staging/google-cloud-security-public_ca-v1beta1/lib/google/cloud/security/publicca/v1beta1/resources_pb.rb b/owl-bot-staging/google-cloud-security-public_ca-v1beta1/lib/google/cloud/security/publicca/v1beta1/resources_pb.rb deleted file mode 100644 index 553386d14371..000000000000 --- a/owl-bot-staging/google-cloud-security-public_ca-v1beta1/lib/google/cloud/security/publicca/v1beta1/resources_pb.rb +++ /dev/null @@ -1,26 +0,0 @@ -# frozen_string_literal: true -# Generated by the protocol buffer compiler. DO NOT EDIT! -# source: google/cloud/security/publicca/v1beta1/resources.proto - -require 'google/protobuf' - -require 'google/api/field_behavior_pb' -require 'google/api/resource_pb' - - -descriptor_data = "\n6google/cloud/security/publicca/v1beta1/resources.proto\x12&google.cloud.security.publicca.v1beta1\x1a\x1fgoogle/api/field_behavior.proto\x1a\x19google/api/resource.proto\"\xdd\x01\n\x12\x45xternalAccountKey\x12\x11\n\x04name\x18\x01 \x01(\tB\x03\xe0\x41\x03\x12\x13\n\x06key_id\x18\x02 \x01(\tB\x03\xe0\x41\x03\x12\x18\n\x0b\x62\x36\x34_mac_key\x18\x03 \x01(\x0c\x42\x03\xe0\x41\x03:\x84\x01\xea\x41\x80\x01\n*publicca.googleapis.com/ExternalAccountKey\x12Rprojects/{project}/locations/{location}/externalAccountKeys/{external_account_key}B\x85\x02\n*com.google.cloud.security.publicca.v1beta1B\x0eResourcesProtoP\x01ZFcloud.google.com/go/security/publicca/apiv1beta1/publiccapb;publiccapb\xaa\x02&Google.Cloud.Security.PublicCA.V1Beta1\xca\x02&Google\\Cloud\\Security\\PublicCA\\V1beta1\xea\x02*Google::Cloud::Security::PublicCA::V1beta1b\x06proto3" - -pool = ::Google::Protobuf::DescriptorPool.generated_pool -pool.add_serialized_file(descriptor_data) - -module Google - module Cloud - module Security - module PublicCA - module V1beta1 - ExternalAccountKey = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.security.publicca.v1beta1.ExternalAccountKey").msgclass - end - end - end - end -end diff --git a/owl-bot-staging/google-cloud-security-public_ca-v1beta1/lib/google/cloud/security/publicca/v1beta1/service_pb.rb b/owl-bot-staging/google-cloud-security-public_ca-v1beta1/lib/google/cloud/security/publicca/v1beta1/service_pb.rb deleted file mode 100644 index 2bc2dd127081..000000000000 --- a/owl-bot-staging/google-cloud-security-public_ca-v1beta1/lib/google/cloud/security/publicca/v1beta1/service_pb.rb +++ /dev/null @@ -1,29 +0,0 @@ -# frozen_string_literal: true -# Generated by the protocol buffer compiler. DO NOT EDIT! -# source: google/cloud/security/publicca/v1beta1/service.proto - -require 'google/protobuf' - -require 'google/api/annotations_pb' -require 'google/api/client_pb' -require 'google/api/field_behavior_pb' -require 'google/api/resource_pb' -require 'google/cloud/security/publicca/v1beta1/resources_pb' - - -descriptor_data = "\n4google/cloud/security/publicca/v1beta1/service.proto\x12&google.cloud.security.publicca.v1beta1\x1a\x1cgoogle/api/annotations.proto\x1a\x17google/api/client.proto\x1a\x1fgoogle/api/field_behavior.proto\x1a\x19google/api/resource.proto\x1a\x36google/cloud/security/publicca/v1beta1/resources.proto\"\xc4\x01\n\x1f\x43reateExternalAccountKeyRequest\x12\x42\n\x06parent\x18\x01 \x01(\tB2\xe0\x41\x02\xfa\x41,\x12*publicca.googleapis.com/ExternalAccountKey\x12]\n\x14\x65xternal_account_key\x18\x02 \x01(\x0b\x32:.google.cloud.security.publicca.v1beta1.ExternalAccountKeyB\x03\xe0\x41\x02\x32\x8c\x03\n!PublicCertificateAuthorityService\x12\x99\x02\n\x18\x43reateExternalAccountKey\x12G.google.cloud.security.publicca.v1beta1.CreateExternalAccountKeyRequest\x1a:.google.cloud.security.publicca.v1beta1.ExternalAccountKey\"x\xda\x41\x1bparent,external_account_key\x82\xd3\xe4\x93\x02T\"] - # The destination where API teams want this client library to be published. - # @!attribute [rw] selective_gapic_generation - # @return [::Google::Api::SelectiveGapicGeneration] - # Configuration for which RPCs should be generated in the GAPIC client. - class CommonLanguageSettings - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Details about how and where to publish client libraries. - # @!attribute [rw] version - # @return [::String] - # Version of the API to apply these settings to. This is the full protobuf - # package for the API, ending in the version element. - # Examples: "google.cloud.speech.v1" and "google.spanner.admin.database.v1". - # @!attribute [rw] launch_stage - # @return [::Google::Api::LaunchStage] - # Launch stage of this version of the API. - # @!attribute [rw] rest_numeric_enums - # @return [::Boolean] - # When using transport=rest, the client request will encode enums as - # numbers rather than strings. - # @!attribute [rw] java_settings - # @return [::Google::Api::JavaSettings] - # Settings for legacy Java features, supported in the Service YAML. - # @!attribute [rw] cpp_settings - # @return [::Google::Api::CppSettings] - # Settings for C++ client libraries. - # @!attribute [rw] php_settings - # @return [::Google::Api::PhpSettings] - # Settings for PHP client libraries. - # @!attribute [rw] python_settings - # @return [::Google::Api::PythonSettings] - # Settings for Python client libraries. - # @!attribute [rw] node_settings - # @return [::Google::Api::NodeSettings] - # Settings for Node client libraries. - # @!attribute [rw] dotnet_settings - # @return [::Google::Api::DotnetSettings] - # Settings for .NET client libraries. - # @!attribute [rw] ruby_settings - # @return [::Google::Api::RubySettings] - # Settings for Ruby client libraries. - # @!attribute [rw] go_settings - # @return [::Google::Api::GoSettings] - # Settings for Go client libraries. - class ClientLibrarySettings - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # This message configures the settings for publishing [Google Cloud Client - # libraries](https://cloud.google.com/apis/docs/cloud-client-libraries) - # generated from the service config. - # @!attribute [rw] method_settings - # @return [::Array<::Google::Api::MethodSettings>] - # A list of API method settings, e.g. the behavior for methods that use the - # long-running operation pattern. - # @!attribute [rw] new_issue_uri - # @return [::String] - # Link to a *public* URI where users can report issues. Example: - # https://issuetracker.google.com/issues/new?component=190865&template=1161103 - # @!attribute [rw] documentation_uri - # @return [::String] - # Link to product home page. Example: - # https://cloud.google.com/asset-inventory/docs/overview - # @!attribute [rw] api_short_name - # @return [::String] - # Used as a tracking tag when collecting data about the APIs developer - # relations artifacts like docs, packages delivered to package managers, - # etc. Example: "speech". - # @!attribute [rw] github_label - # @return [::String] - # GitHub label to apply to issues and pull requests opened for this API. - # @!attribute [rw] codeowner_github_teams - # @return [::Array<::String>] - # GitHub teams to be added to CODEOWNERS in the directory in GitHub - # containing source code for the client libraries for this API. - # @!attribute [rw] doc_tag_prefix - # @return [::String] - # A prefix used in sample code when demarking regions to be included in - # documentation. - # @!attribute [rw] organization - # @return [::Google::Api::ClientLibraryOrganization] - # For whom the client library is being published. - # @!attribute [rw] library_settings - # @return [::Array<::Google::Api::ClientLibrarySettings>] - # Client library settings. If the same version string appears multiple - # times in this list, then the last one wins. Settings from earlier - # settings with the same version string are discarded. - # @!attribute [rw] proto_reference_documentation_uri - # @return [::String] - # Optional link to proto reference documentation. Example: - # https://cloud.google.com/pubsub/lite/docs/reference/rpc - # @!attribute [rw] rest_reference_documentation_uri - # @return [::String] - # Optional link to REST reference documentation. Example: - # https://cloud.google.com/pubsub/lite/docs/reference/rest - class Publishing - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Settings for Java client libraries. - # @!attribute [rw] library_package - # @return [::String] - # The package name to use in Java. Clobbers the java_package option - # set in the protobuf. This should be used **only** by APIs - # who have already set the language_settings.java.package_name" field - # in gapic.yaml. API teams should use the protobuf java_package option - # where possible. - # - # Example of a YAML configuration:: - # - # publishing: - # 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. - # @!attribute [rw] methods - # @return [::Array<::String>] - # An allowlist of the fully qualified names of RPCs that should be included - # on public client surfaces. - # @!attribute [rw] generate_omitted_as_internal - # @return [::Boolean] - # Setting this to true indicates to the client generators that methods - # that would be excluded from the generation should instead be generated - # in a way that indicates these methods should not be consumed by - # end users. How this is expressed is up to individual language - # implementations to decide. Some examples may be: added annotations, - # obfuscated identifiers, or other language idiomatic patterns. - class SelectiveGapicGeneration - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # `BatchingConfigProto` defines the batching configuration for an API method. - # @!attribute [rw] thresholds - # @return [::Google::Api::BatchingSettingsProto] - # The thresholds which trigger a batched request to be sent. - # @!attribute [rw] batch_descriptor - # @return [::Google::Api::BatchingDescriptorProto] - # The request and response fields used in batching. - class BatchingConfigProto - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # `BatchingSettingsProto` specifies a set of batching thresholds, each of - # which acts as a trigger to send a batch of messages as a request. At least - # one threshold must be positive nonzero. - # @!attribute [rw] element_count_threshold - # @return [::Integer] - # The number of elements of a field collected into a batch which, if - # exceeded, causes the batch to be sent. - # @!attribute [rw] request_byte_threshold - # @return [::Integer] - # The aggregated size of the batched field which, if exceeded, causes the - # batch to be sent. This size is computed by aggregating the sizes of the - # request field to be batched, not of the entire request message. - # @!attribute [rw] delay_threshold - # @return [::Google::Protobuf::Duration] - # The duration after which a batch should be sent, starting from the addition - # of the first message to that batch. - # @!attribute [rw] element_count_limit - # @return [::Integer] - # The maximum number of elements collected in a batch that could be accepted - # by server. - # @!attribute [rw] request_byte_limit - # @return [::Integer] - # The maximum size of the request that could be accepted by server. - # @!attribute [rw] flow_control_element_limit - # @return [::Integer] - # The maximum number of elements allowed by flow control. - # @!attribute [rw] flow_control_byte_limit - # @return [::Integer] - # The maximum size of data allowed by flow control. - # @!attribute [rw] flow_control_limit_exceeded_behavior - # @return [::Google::Api::FlowControlLimitExceededBehaviorProto] - # The behavior to take when the flow control limit is exceeded. - class BatchingSettingsProto - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # `BatchingDescriptorProto` specifies the fields of the request message to be - # used for batching, and, optionally, the fields of the response message to be - # used for demultiplexing. - # @!attribute [rw] batched_field - # @return [::String] - # The repeated field in the request message to be aggregated by batching. - # @!attribute [rw] discriminator_fields - # @return [::Array<::String>] - # A list of the fields in the request message. Two requests will be batched - # together only if the values of every field specified in - # `request_discriminator_fields` is equal between the two requests. - # @!attribute [rw] subresponse_field - # @return [::String] - # Optional. When present, indicates the field in the response message to be - # used to demultiplex the response into multiple response messages, in - # correspondence with the multiple request messages originally batched - # together. - class BatchingDescriptorProto - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # The organization for which the client libraries are being published. - # Affects the url where generated docs are published, etc. - module ClientLibraryOrganization - # Not useful. - CLIENT_LIBRARY_ORGANIZATION_UNSPECIFIED = 0 - - # Google Cloud Platform Org. - CLOUD = 1 - - # Ads (Advertising) Org. - ADS = 2 - - # Photos Org. - PHOTOS = 3 - - # Street View Org. - STREET_VIEW = 4 - - # Shopping Org. - SHOPPING = 5 - - # Geo Org. - GEO = 6 - - # Generative AI - https://developers.generativeai.google - GENERATIVE_AI = 7 - end - - # To where should client libraries be published? - module ClientLibraryDestination - # Client libraries will neither be generated nor published to package - # managers. - CLIENT_LIBRARY_DESTINATION_UNSPECIFIED = 0 - - # Generate the client library in a repo under github.com/googleapis, - # but don't publish it to package managers. - GITHUB = 10 - - # Publish the library to package managers like nuget.org and npmjs.com. - PACKAGE_MANAGER = 20 - end - - # The behavior to take when the flow control limit is exceeded. - module FlowControlLimitExceededBehaviorProto - # Default behavior, system-defined. - UNSET_BEHAVIOR = 0 - - # Stop operation, raise error. - THROW_EXCEPTION = 1 - - # Pause operation until limit clears. - BLOCK = 2 - - # Continue operation, disregard limit. - IGNORE = 3 - end - end -end diff --git a/owl-bot-staging/google-cloud-security-public_ca-v1beta1/proto_docs/google/api/field_behavior.rb b/owl-bot-staging/google-cloud-security-public_ca-v1beta1/proto_docs/google/api/field_behavior.rb deleted file mode 100644 index 582be187d115..000000000000 --- a/owl-bot-staging/google-cloud-security-public_ca-v1beta1/proto_docs/google/api/field_behavior.rb +++ /dev/null @@ -1,85 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - - -module Google - module Api - # An indicator of the behavior of a given field (for example, that a field - # is required in requests, or given as output but ignored as input). - # This **does not** change the behavior in protocol buffers itself; it only - # denotes the behavior and may affect how API tooling handles the field. - # - # Note: This enum **may** receive new values in the future. - module FieldBehavior - # Conventional default for enums. Do not use this. - FIELD_BEHAVIOR_UNSPECIFIED = 0 - - # Specifically denotes a field as optional. - # While all fields in protocol buffers are optional, this may be specified - # for emphasis if appropriate. - OPTIONAL = 1 - - # Denotes a field as required. - # This indicates that the field **must** be provided as part of the request, - # and failure to do so will cause an error (usually `INVALID_ARGUMENT`). - REQUIRED = 2 - - # Denotes a field as output only. - # This indicates that the field is provided in responses, but including the - # field in a request does nothing (the server *must* ignore it and - # *must not* throw an error as a result of the field's presence). - OUTPUT_ONLY = 3 - - # Denotes a field as input only. - # This indicates that the field is provided in requests, and the - # corresponding field is not included in output. - INPUT_ONLY = 4 - - # Denotes a field as immutable. - # This indicates that the field may be set once in a request to create a - # resource, but may not be changed thereafter. - IMMUTABLE = 5 - - # Denotes that a (repeated) field is an unordered list. - # This indicates that the service may provide the elements of the list - # in any arbitrary order, rather than the order the user originally - # provided. Additionally, the list's order may or may not be stable. - UNORDERED_LIST = 6 - - # Denotes that this field returns a non-empty default value if not set. - # This indicates that if the user provides the empty value in a request, - # a non-empty value will be returned. The user will not be aware of what - # non-empty value to expect. - NON_EMPTY_DEFAULT = 7 - - # Denotes that the field in a resource (a message annotated with - # google.api.resource) is used in the resource name to uniquely identify the - # resource. For AIP-compliant APIs, this should only be applied to the - # `name` field on the resource. - # - # This behavior should not be applied to references to other resources within - # the message. - # - # The identifier field of resources often have different field behavior - # depending on the request it is embedded in (e.g. for Create methods name - # is optional and unused, while for Update methods it is required). Instead - # of method-specific annotations, only `IDENTIFIER` is required. - IDENTIFIER = 8 - end - end -end diff --git a/owl-bot-staging/google-cloud-security-public_ca-v1beta1/proto_docs/google/api/launch_stage.rb b/owl-bot-staging/google-cloud-security-public_ca-v1beta1/proto_docs/google/api/launch_stage.rb deleted file mode 100644 index 9392a413fb1b..000000000000 --- a/owl-bot-staging/google-cloud-security-public_ca-v1beta1/proto_docs/google/api/launch_stage.rb +++ /dev/null @@ -1,71 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - - -module Google - module Api - # The launch stage as defined by [Google Cloud Platform - # Launch Stages](https://cloud.google.com/terms/launch-stages). - module LaunchStage - # Do not use this default value. - LAUNCH_STAGE_UNSPECIFIED = 0 - - # The feature is not yet implemented. Users can not use it. - UNIMPLEMENTED = 6 - - # Prelaunch features are hidden from users and are only visible internally. - PRELAUNCH = 7 - - # Early Access features are limited to a closed group of testers. To use - # these features, you must sign up in advance and sign a Trusted Tester - # agreement (which includes confidentiality provisions). These features may - # be unstable, changed in backward-incompatible ways, and are not - # guaranteed to be released. - EARLY_ACCESS = 1 - - # Alpha is a limited availability test for releases before they are cleared - # for widespread use. By Alpha, all significant design issues are resolved - # and we are in the process of verifying functionality. Alpha customers - # need to apply for access, agree to applicable terms, and have their - # projects allowlisted. Alpha releases don't have to be feature complete, - # no SLAs are provided, and there are no technical support obligations, but - # they will be far enough along that customers can actually use them in - # test environments or for limited-use tests -- just like they would in - # normal production cases. - ALPHA = 2 - - # Beta is the point at which we are ready to open a release for any - # customer to use. There are no SLA or technical support obligations in a - # Beta release. Products will be complete from a feature perspective, but - # may have some open outstanding issues. Beta releases are suitable for - # limited production use cases. - BETA = 3 - - # GA features are open to all developers and are considered stable and - # fully qualified for production use. - GA = 4 - - # Deprecated features are scheduled to be shut down and removed. For more - # information, see the "Deprecation Policy" section of our [Terms of - # Service](https://cloud.google.com/terms/) - # and the [Google Cloud Platform Subject to the Deprecation - # Policy](https://cloud.google.com/terms/deprecation) documentation. - DEPRECATED = 5 - end - end -end diff --git a/owl-bot-staging/google-cloud-security-public_ca-v1beta1/proto_docs/google/api/resource.rb b/owl-bot-staging/google-cloud-security-public_ca-v1beta1/proto_docs/google/api/resource.rb deleted file mode 100644 index 25dec4847ac1..000000000000 --- a/owl-bot-staging/google-cloud-security-public_ca-v1beta1/proto_docs/google/api/resource.rb +++ /dev/null @@ -1,227 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - - -module Google - module Api - # A simple descriptor of a resource type. - # - # ResourceDescriptor annotates a resource message (either by means of a - # protobuf annotation or use in the service config), and associates the - # resource's schema, the resource type, and the pattern of the resource name. - # - # Example: - # - # message Topic { - # // Indicates this message defines a resource schema. - # // Declares the resource type in the format of {service}/{kind}. - # // For Kubernetes resources, the format is {api group}/{kind}. - # option (google.api.resource) = { - # type: "pubsub.googleapis.com/Topic" - # pattern: "projects/{project}/topics/{topic}" - # }; - # } - # - # The ResourceDescriptor Yaml config will look like: - # - # resources: - # - type: "pubsub.googleapis.com/Topic" - # pattern: "projects/{project}/topics/{topic}" - # - # Sometimes, resources have multiple patterns, typically because they can - # live under multiple parents. - # - # Example: - # - # message LogEntry { - # option (google.api.resource) = { - # type: "logging.googleapis.com/LogEntry" - # pattern: "projects/{project}/logs/{log}" - # pattern: "folders/{folder}/logs/{log}" - # pattern: "organizations/{organization}/logs/{log}" - # pattern: "billingAccounts/{billing_account}/logs/{log}" - # }; - # } - # - # The ResourceDescriptor Yaml config will look like: - # - # resources: - # - type: 'logging.googleapis.com/LogEntry' - # pattern: "projects/{project}/logs/{log}" - # pattern: "folders/{folder}/logs/{log}" - # pattern: "organizations/{organization}/logs/{log}" - # pattern: "billingAccounts/{billing_account}/logs/{log}" - # @!attribute [rw] type - # @return [::String] - # The resource type. It must be in the format of - # \\{service_name}/\\{resource_type_kind}. The `resource_type_kind` must be - # singular and must not include version numbers. - # - # Example: `storage.googleapis.com/Bucket` - # - # The value of the resource_type_kind must follow the regular expression - # /[A-Za-z][a-zA-Z0-9]+/. It should start with an upper case character and - # should use PascalCase (UpperCamelCase). The maximum number of - # characters allowed for the `resource_type_kind` is 100. - # @!attribute [rw] pattern - # @return [::Array<::String>] - # Optional. The relative resource name pattern associated with this resource - # type. The DNS prefix of the full resource name shouldn't be specified here. - # - # The path pattern must follow the syntax, which aligns with HTTP binding - # syntax: - # - # Template = Segment { "/" Segment } ; - # Segment = LITERAL | Variable ; - # Variable = "{" LITERAL "}" ; - # - # Examples: - # - # - "projects/\\{project}/topics/\\{topic}" - # - "projects/\\{project}/knowledgeBases/\\{knowledge_base}" - # - # The components in braces correspond to the IDs for each resource in the - # hierarchy. It is expected that, if multiple patterns are provided, - # the same component name (e.g. "project") refers to IDs of the same - # type of resource. - # @!attribute [rw] name_field - # @return [::String] - # Optional. The field on the resource that designates the resource name - # field. If omitted, this is assumed to be "name". - # @!attribute [rw] history - # @return [::Google::Api::ResourceDescriptor::History] - # Optional. The historical or future-looking state of the resource pattern. - # - # Example: - # - # // The InspectTemplate message originally only supported resource - # // names with organization, and project was added later. - # message InspectTemplate { - # option (google.api.resource) = { - # type: "dlp.googleapis.com/InspectTemplate" - # pattern: - # "organizations/{organization}/inspectTemplates/{inspect_template}" - # pattern: "projects/{project}/inspectTemplates/{inspect_template}" - # history: ORIGINALLY_SINGLE_PATTERN - # }; - # } - # @!attribute [rw] plural - # @return [::String] - # The plural name used in the resource name and permission names, such as - # 'projects' for the resource name of 'projects/\\{project}' and the permission - # name of 'cloudresourcemanager.googleapis.com/projects.get'. One exception - # to this is for Nested Collections that have stuttering names, as defined - # in [AIP-122](https://google.aip.dev/122#nested-collections), where the - # collection ID in the resource name pattern does not necessarily directly - # match the `plural` value. - # - # It is the same concept of the `plural` field in k8s CRD spec - # https://kubernetes.io/docs/tasks/access-kubernetes-api/custom-resources/custom-resource-definitions/ - # - # Note: The plural form is required even for singleton resources. See - # https://aip.dev/156 - # @!attribute [rw] singular - # @return [::String] - # The same concept of the `singular` field in k8s CRD spec - # https://kubernetes.io/docs/tasks/access-kubernetes-api/custom-resources/custom-resource-definitions/ - # Such as "project" for the `resourcemanager.googleapis.com/Project` type. - # @!attribute [rw] style - # @return [::Array<::Google::Api::ResourceDescriptor::Style>] - # Style flag(s) for this resource. - # These indicate that a resource is expected to conform to a given - # style. See the specific style flags for additional information. - class ResourceDescriptor - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - - # A description of the historical or future-looking state of the - # resource pattern. - module History - # The "unset" value. - HISTORY_UNSPECIFIED = 0 - - # The resource originally had one pattern and launched as such, and - # additional patterns were added later. - ORIGINALLY_SINGLE_PATTERN = 1 - - # The resource has one pattern, but the API owner expects to add more - # later. (This is the inverse of ORIGINALLY_SINGLE_PATTERN, and prevents - # that from being necessary once there are multiple patterns.) - FUTURE_MULTI_PATTERN = 2 - end - - # A flag representing a specific style that a resource claims to conform to. - module Style - # The unspecified value. Do not use. - STYLE_UNSPECIFIED = 0 - - # This resource is intended to be "declarative-friendly". - # - # Declarative-friendly resources must be more strictly consistent, and - # setting this to true communicates to tools that this resource should - # adhere to declarative-friendly expectations. - # - # Note: This is used by the API linter (linter.aip.dev) to enable - # additional checks. - DECLARATIVE_FRIENDLY = 1 - end - end - - # Defines a proto annotation that describes a string field that refers to - # an API resource. - # @!attribute [rw] type - # @return [::String] - # The resource type that the annotated field references. - # - # Example: - # - # message Subscription { - # string topic = 2 [(google.api.resource_reference) = { - # type: "pubsub.googleapis.com/Topic" - # }]; - # } - # - # Occasionally, a field may reference an arbitrary resource. In this case, - # APIs use the special value * in their resource reference. - # - # Example: - # - # message GetIamPolicyRequest { - # string resource = 2 [(google.api.resource_reference) = { - # type: "*" - # }]; - # } - # @!attribute [rw] child_type - # @return [::String] - # The resource type of a child collection that the annotated field - # references. This is useful for annotating the `parent` field that - # doesn't have a fixed resource type. - # - # Example: - # - # message ListLogEntriesRequest { - # string parent = 1 [(google.api.resource_reference) = { - # child_type: "logging.googleapis.com/LogEntry" - # }; - # } - class ResourceReference - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - end -end diff --git a/owl-bot-staging/google-cloud-security-public_ca-v1beta1/proto_docs/google/cloud/security/publicca/v1beta1/resources.rb b/owl-bot-staging/google-cloud-security-public_ca-v1beta1/proto_docs/google/cloud/security/publicca/v1beta1/resources.rb deleted file mode 100644 index 33b7199f7982..000000000000 --- a/owl-bot-staging/google-cloud-security-public_ca-v1beta1/proto_docs/google/cloud/security/publicca/v1beta1/resources.rb +++ /dev/null @@ -1,49 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - - -module Google - module Cloud - module Security - module PublicCA - module V1beta1 - # A representation of an ExternalAccountKey used for [external account - # binding](https://tools.ietf.org/html/rfc8555#section-7.3.4) within ACME. - # @!attribute [r] name - # @return [::String] - # Output only. Resource name. - # projects/\\{project}/locations/\\{location}/externalAccountKeys/\\{key_id} - # @!attribute [r] key_id - # @return [::String] - # Output only. Key ID. - # It is generated by the PublicCertificateAuthorityService - # when the ExternalAccountKey is created - # @!attribute [r] b64_mac_key - # @return [::String] - # Output only. Base64-URL-encoded HS256 key. - # It is generated by the PublicCertificateAuthorityService - # when the ExternalAccountKey is created - class ExternalAccountKey - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - end - end - end - end -end diff --git a/owl-bot-staging/google-cloud-security-public_ca-v1beta1/proto_docs/google/cloud/security/publicca/v1beta1/service.rb b/owl-bot-staging/google-cloud-security-public_ca-v1beta1/proto_docs/google/cloud/security/publicca/v1beta1/service.rb deleted file mode 100644 index 6e3cba96d99a..000000000000 --- a/owl-bot-staging/google-cloud-security-public_ca-v1beta1/proto_docs/google/cloud/security/publicca/v1beta1/service.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! - - -module Google - module Cloud - module Security - module PublicCA - module V1beta1 - # Creates a new - # {::Google::Cloud::Security::PublicCA::V1beta1::ExternalAccountKey ExternalAccountKey} - # in a given project. - # @!attribute [rw] parent - # @return [::String] - # Required. The parent resource where this external_account_key will be - # created. Format: projects/[project_id]/locations/[location]. At present - # only the "global" location is supported. - # @!attribute [rw] external_account_key - # @return [::Google::Cloud::Security::PublicCA::V1beta1::ExternalAccountKey] - # Required. The external account key to create. This field only exists to - # future-proof the API. At present, all fields in ExternalAccountKey are - # output only and all values are ignored. For the purpose of the - # CreateExternalAccountKeyRequest, set it to a default/empty value. - class CreateExternalAccountKeyRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - end - end - end - end -end diff --git a/owl-bot-staging/google-cloud-security-public_ca-v1beta1/proto_docs/google/protobuf/duration.rb b/owl-bot-staging/google-cloud-security-public_ca-v1beta1/proto_docs/google/protobuf/duration.rb deleted file mode 100644 index ea59f1f91daf..000000000000 --- a/owl-bot-staging/google-cloud-security-public_ca-v1beta1/proto_docs/google/protobuf/duration.rb +++ /dev/null @@ -1,98 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - - -module Google - module Protobuf - # A Duration represents a signed, fixed-length span of time represented - # as a count of seconds and fractions of seconds at nanosecond - # resolution. It is independent of any calendar and concepts like "day" - # or "month". It is related to Timestamp in that the difference between - # two Timestamp values is a Duration and it can be added or subtracted - # from a Timestamp. Range is approximately +-10,000 years. - # - # # Examples - # - # Example 1: Compute Duration from two Timestamps in pseudo code. - # - # Timestamp start = ...; - # Timestamp end = ...; - # Duration duration = ...; - # - # duration.seconds = end.seconds - start.seconds; - # duration.nanos = end.nanos - start.nanos; - # - # if (duration.seconds < 0 && duration.nanos > 0) { - # duration.seconds += 1; - # duration.nanos -= 1000000000; - # } else if (duration.seconds > 0 && duration.nanos < 0) { - # duration.seconds -= 1; - # duration.nanos += 1000000000; - # } - # - # Example 2: Compute Timestamp from Timestamp + Duration in pseudo code. - # - # Timestamp start = ...; - # Duration duration = ...; - # Timestamp end = ...; - # - # end.seconds = start.seconds + duration.seconds; - # end.nanos = start.nanos + duration.nanos; - # - # if (end.nanos < 0) { - # end.seconds -= 1; - # end.nanos += 1000000000; - # } else if (end.nanos >= 1000000000) { - # end.seconds += 1; - # end.nanos -= 1000000000; - # } - # - # Example 3: Compute Duration from datetime.timedelta in Python. - # - # td = datetime.timedelta(days=3, minutes=10) - # duration = Duration() - # duration.FromTimedelta(td) - # - # # JSON Mapping - # - # In JSON format, the Duration type is encoded as a string rather than an - # object, where the string ends in the suffix "s" (indicating seconds) and - # is preceded by the number of seconds, with nanoseconds expressed as - # fractional seconds. For example, 3 seconds with 0 nanoseconds should be - # encoded in JSON format as "3s", while 3 seconds and 1 nanosecond should - # be expressed in JSON format as "3.000000001s", and 3 seconds and 1 - # microsecond should be expressed in JSON format as "3.000001s". - # @!attribute [rw] seconds - # @return [::Integer] - # Signed seconds of the span of time. Must be from -315,576,000,000 - # to +315,576,000,000 inclusive. Note: these bounds are computed from: - # 60 sec/min * 60 min/hr * 24 hr/day * 365.25 days/year * 10000 years - # @!attribute [rw] nanos - # @return [::Integer] - # Signed fractions of a second at nanosecond resolution of the span - # of time. Durations less than one second are represented with a 0 - # `seconds` field and a positive or negative `nanos` field. For durations - # of one second or more, a non-zero value for the `nanos` field must be - # of the same sign as the `seconds` field. Must be from -999,999,999 - # to +999,999,999 inclusive. - class Duration - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - end -end diff --git a/owl-bot-staging/google-cloud-security-public_ca-v1beta1/snippets/Gemfile b/owl-bot-staging/google-cloud-security-public_ca-v1beta1/snippets/Gemfile deleted file mode 100644 index 6a4051095df9..000000000000 --- a/owl-bot-staging/google-cloud-security-public_ca-v1beta1/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-security-public_ca-v1beta1", path: "../" -else - gem "google-cloud-security-public_ca-v1beta1" -end - -group :test do - gem "google-style", "~> 1.26.1" - gem "minitest", "~> 5.16" - gem "minitest-focus", "~> 1.1" - gem "minitest-hooks", "~> 1.5" -end diff --git a/owl-bot-staging/google-cloud-security-public_ca-v1beta1/snippets/public_certificate_authority_service/create_external_account_key.rb b/owl-bot-staging/google-cloud-security-public_ca-v1beta1/snippets/public_certificate_authority_service/create_external_account_key.rb deleted file mode 100644 index 0bb4a0e7e161..000000000000 --- a/owl-bot-staging/google-cloud-security-public_ca-v1beta1/snippets/public_certificate_authority_service/create_external_account_key.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 publicca_v1beta1_generated_PublicCertificateAuthorityService_CreateExternalAccountKey_sync] -require "google/cloud/security/public_ca/v1beta1" - -## -# Snippet for the create_external_account_key call in the PublicCertificateAuthorityService service -# -# This snippet has been automatically generated and should be regarded as a code -# template only. It will require modifications to work: -# - It may require correct/in-range values for request initialization. -# - It may require specifying regional endpoints when creating the service -# client as shown in https://cloud.google.com/ruby/docs/reference. -# -# This is an auto-generated example demonstrating basic usage of -# Google::Cloud::Security::PublicCA::V1beta1::PublicCertificateAuthorityService::Client#create_external_account_key. -# -def create_external_account_key - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::Security::PublicCA::V1beta1::PublicCertificateAuthorityService::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::Security::PublicCA::V1beta1::CreateExternalAccountKeyRequest.new - - # Call the create_external_account_key method. - result = client.create_external_account_key request - - # The returned object is of type Google::Cloud::Security::PublicCA::V1beta1::ExternalAccountKey. - p result -end -# [END publicca_v1beta1_generated_PublicCertificateAuthorityService_CreateExternalAccountKey_sync] diff --git a/owl-bot-staging/google-cloud-security-public_ca-v1beta1/snippets/snippet_metadata_google.cloud.security.publicca.v1beta1.json b/owl-bot-staging/google-cloud-security-public_ca-v1beta1/snippets/snippet_metadata_google.cloud.security.publicca.v1beta1.json deleted file mode 100644 index ae2a322a235b..000000000000 --- a/owl-bot-staging/google-cloud-security-public_ca-v1beta1/snippets/snippet_metadata_google.cloud.security.publicca.v1beta1.json +++ /dev/null @@ -1,55 +0,0 @@ -{ - "client_library": { - "name": "google-cloud-security-public_ca-v1beta1", - "version": "", - "language": "RUBY", - "apis": [ - { - "id": "google.cloud.security.publicca.v1beta1", - "version": "v1beta1" - } - ] - }, - "snippets": [ - { - "region_tag": "publicca_v1beta1_generated_PublicCertificateAuthorityService_CreateExternalAccountKey_sync", - "title": "Snippet for the create_external_account_key call in the PublicCertificateAuthorityService service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Security::PublicCA::V1beta1::PublicCertificateAuthorityService::Client#create_external_account_key.", - "file": "public_certificate_authority_service/create_external_account_key.rb", - "language": "RUBY", - "client_method": { - "short_name": "create_external_account_key", - "full_name": "::Google::Cloud::Security::PublicCA::V1beta1::PublicCertificateAuthorityService::Client#create_external_account_key", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::Security::PublicCA::V1beta1::CreateExternalAccountKeyRequest", - "name": "request" - } - ], - "result_type": "::Google::Cloud::Security::PublicCA::V1beta1::ExternalAccountKey", - "client": { - "short_name": "PublicCertificateAuthorityService::Client", - "full_name": "::Google::Cloud::Security::PublicCA::V1beta1::PublicCertificateAuthorityService::Client" - }, - "method": { - "short_name": "CreateExternalAccountKey", - "full_name": "google.cloud.security.publicca.v1beta1.PublicCertificateAuthorityService.CreateExternalAccountKey", - "service": { - "short_name": "PublicCertificateAuthorityService", - "full_name": "google.cloud.security.publicca.v1beta1.PublicCertificateAuthorityService" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 46, - "type": "FULL" - } - ] - } - ] -} \ No newline at end of file diff --git a/owl-bot-staging/google-cloud-security-public_ca-v1beta1/test/google/cloud/security/public_ca/v1beta1/public_certificate_authority_service_paths_test.rb b/owl-bot-staging/google-cloud-security-public_ca-v1beta1/test/google/cloud/security/public_ca/v1beta1/public_certificate_authority_service_paths_test.rb deleted file mode 100644 index b2b32a19a595..000000000000 --- a/owl-bot-staging/google-cloud-security-public_ca-v1beta1/test/google/cloud/security/public_ca/v1beta1/public_certificate_authority_service_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/cloud/security/public_ca/v1beta1/public_certificate_authority_service" - -class ::Google::Cloud::Security::PublicCA::V1beta1::PublicCertificateAuthorityService::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_external_account_key_path - grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - ::Gapic::ServiceStub.stub :new, DummyStub.new do - client = ::Google::Cloud::Security::PublicCA::V1beta1::PublicCertificateAuthorityService::Client.new do |config| - config.credentials = grpc_channel - end - - path = client.external_account_key_path project: "value0", location: "value1", external_account_key: "value2" - assert_equal "projects/value0/locations/value1/externalAccountKeys/value2", path - end - end - - def test_location_path - grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - ::Gapic::ServiceStub.stub :new, DummyStub.new do - client = ::Google::Cloud::Security::PublicCA::V1beta1::PublicCertificateAuthorityService::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 -end diff --git a/owl-bot-staging/google-cloud-security-public_ca-v1beta1/test/google/cloud/security/public_ca/v1beta1/public_certificate_authority_service_rest_test.rb b/owl-bot-staging/google-cloud-security-public_ca-v1beta1/test/google/cloud/security/public_ca/v1beta1/public_certificate_authority_service_rest_test.rb deleted file mode 100644 index 0edc55e0cce5..000000000000 --- a/owl-bot-staging/google-cloud-security-public_ca-v1beta1/test/google/cloud/security/public_ca/v1beta1/public_certificate_authority_service_rest_test.rb +++ /dev/null @@ -1,154 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -require "helper" -require "gapic/rest" -require "google/cloud/security/publicca/v1beta1/service_pb" -require "google/cloud/security/public_ca/v1beta1/public_certificate_authority_service/rest" - - -class ::Google::Cloud::Security::PublicCA::V1beta1::PublicCertificateAuthorityService::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_external_account_key - # Create test objects. - client_result = ::Google::Cloud::Security::PublicCA::V1beta1::ExternalAccountKey.new - http_response = OpenStruct.new body: client_result.to_json - - call_options = {} - - # Create request parameters for a unary method. - parent = "hello world" - external_account_key = {} - - create_external_account_key_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| - assert options.metadata.key? :"x-goog-api-client" - assert options.metadata[:"x-goog-api-client"].include? "rest" - refute options.metadata[:"x-goog-api-client"].include? "grpc" - end - - ::Google::Cloud::Security::PublicCA::V1beta1::PublicCertificateAuthorityService::Rest::ServiceStub.stub :transcode_create_external_account_key_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, create_external_account_key_client_stub do - # Create client - client = ::Google::Cloud::Security::PublicCA::V1beta1::PublicCertificateAuthorityService::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - client.create_external_account_key({ parent: parent, external_account_key: external_account_key }) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use named arguments - client.create_external_account_key parent: parent, external_account_key: external_account_key do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object - client.create_external_account_key ::Google::Cloud::Security::PublicCA::V1beta1::CreateExternalAccountKeyRequest.new(parent: parent, external_account_key: external_account_key) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use hash object with options - client.create_external_account_key({ parent: parent, external_account_key: external_account_key }, call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object with options - client.create_external_account_key(::Google::Cloud::Security::PublicCA::V1beta1::CreateExternalAccountKeyRequest.new(parent: parent, external_account_key: external_account_key), call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Verify method calls - assert_equal 5, create_external_account_key_client_stub.call_count - end - end - end - - def test_configure - credentials_token = :dummy_value - - client = block_config = config = nil - dummy_stub = ClientStub.new nil - Gapic::Rest::ClientStub.stub :new, dummy_stub do - client = ::Google::Cloud::Security::PublicCA::V1beta1::PublicCertificateAuthorityService::Rest::Client.new do |config| - config.credentials = credentials_token - end - end - - config = client.configure do |c| - block_config = c - end - - assert_same block_config, config - assert_kind_of ::Google::Cloud::Security::PublicCA::V1beta1::PublicCertificateAuthorityService::Rest::Client::Configuration, config - end -end diff --git a/owl-bot-staging/google-cloud-security-public_ca-v1beta1/test/google/cloud/security/public_ca/v1beta1/public_certificate_authority_service_test.rb b/owl-bot-staging/google-cloud-security-public_ca-v1beta1/test/google/cloud/security/public_ca/v1beta1/public_certificate_authority_service_test.rb deleted file mode 100644 index 4c998739d2e0..000000000000 --- a/owl-bot-staging/google-cloud-security-public_ca-v1beta1/test/google/cloud/security/public_ca/v1beta1/public_certificate_authority_service_test.rb +++ /dev/null @@ -1,164 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -require "helper" - -require "gapic/grpc/service_stub" - -require "google/cloud/security/publicca/v1beta1/service_pb" -require "google/cloud/security/public_ca/v1beta1/public_certificate_authority_service" - -class ::Google::Cloud::Security::PublicCA::V1beta1::PublicCertificateAuthorityService::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_external_account_key - # Create GRPC objects. - grpc_response = ::Google::Cloud::Security::PublicCA::V1beta1::ExternalAccountKey.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" - external_account_key = {} - - create_external_account_key_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :create_external_account_key, name - assert_kind_of ::Google::Cloud::Security::PublicCA::V1beta1::CreateExternalAccountKeyRequest, request - assert_equal "hello world", request["parent"] - assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::Security::PublicCA::V1beta1::ExternalAccountKey), request["external_account_key"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, create_external_account_key_client_stub do - # Create client - client = ::Google::Cloud::Security::PublicCA::V1beta1::PublicCertificateAuthorityService::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.create_external_account_key({ parent: parent, external_account_key: external_account_key }) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use named arguments - client.create_external_account_key parent: parent, external_account_key: external_account_key do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object - client.create_external_account_key ::Google::Cloud::Security::PublicCA::V1beta1::CreateExternalAccountKeyRequest.new(parent: parent, external_account_key: external_account_key) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use hash object with options - client.create_external_account_key({ parent: parent, external_account_key: external_account_key }, grpc_options) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object with options - client.create_external_account_key(::Google::Cloud::Security::PublicCA::V1beta1::CreateExternalAccountKeyRequest.new(parent: parent, external_account_key: external_account_key), grpc_options) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Verify method calls - assert_equal 5, create_external_account_key_client_stub.call_rpc_count - end - end - - def test_configure - grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - - client = block_config = config = nil - dummy_stub = ClientStub.new nil, nil - Gapic::ServiceStub.stub :new, dummy_stub do - client = ::Google::Cloud::Security::PublicCA::V1beta1::PublicCertificateAuthorityService::Client.new do |config| - config.credentials = grpc_channel - end - end - - config = client.configure do |c| - block_config = c - end - - assert_same block_config, config - assert_kind_of ::Google::Cloud::Security::PublicCA::V1beta1::PublicCertificateAuthorityService::Client::Configuration, config - end - - def test_credentials - key = OpenSSL::PKey::RSA.new 2048 - cred_json = { - "private_key" => key.to_pem, - "client_email" => "app@developer.gserviceaccount.com", - "type" => "service_account" - } - key_file = StringIO.new cred_json.to_json - creds = Google::Auth::ServiceAccountCredentials.make_creds({ json_key_io: key_file }) - - dummy_stub = ClientStub.new nil, nil - Gapic::ServiceStub.stub :new, dummy_stub do - client = ::Google::Cloud::Security::PublicCA::V1beta1::PublicCertificateAuthorityService::Client.new do |config| - config.credentials = creds - end - assert_kind_of ::Google::Cloud::Security::PublicCA::V1beta1::PublicCertificateAuthorityService::Client, client - assert_equal creds, client.configure.credentials - end - end -end diff --git a/owl-bot-staging/google-cloud-security-public_ca-v1beta1/test/helper.rb b/owl-bot-staging/google-cloud-security-public_ca-v1beta1/test/helper.rb deleted file mode 100644 index 672b337030e7..000000000000 --- a/owl-bot-staging/google-cloud-security-public_ca-v1beta1/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" diff --git a/owl-bot-staging/google-cloud-security_center-v1/.gitignore b/owl-bot-staging/google-cloud-security_center-v1/.gitignore deleted file mode 100644 index 0135b6bc6cfc..000000000000 --- a/owl-bot-staging/google-cloud-security_center-v1/.gitignore +++ /dev/null @@ -1,22 +0,0 @@ -# Ignore bundler lockfiles -Gemfile.lock -gems.locked - -# Ignore documentation output -doc/* -.yardoc/* - -# Ignore test output -coverage/* - -# Ignore build artifacts -pkg/* - -# Ignore files commonly present in certain dev environments -.vagrant -.DS_STORE -.idea -*.iml - -# Ignore synth output -__pycache__ diff --git a/owl-bot-staging/google-cloud-security_center-v1/.repo-metadata.json b/owl-bot-staging/google-cloud-security_center-v1/.repo-metadata.json deleted file mode 100644 index 1db7926905f8..000000000000 --- a/owl-bot-staging/google-cloud-security_center-v1/.repo-metadata.json +++ /dev/null @@ -1,18 +0,0 @@ -{ - "api_id": "securitycenter.googleapis.com", - "api_shortname": "securitycenter", - "client_documentation": "https://cloud.google.com/ruby/docs/reference/google-cloud-security_center-v1/latest", - "distribution_name": "google-cloud-security_center-v1", - "is_cloud": true, - "language": "ruby", - "name": "securitycenter", - "name_pretty": "Cloud Security Command Center V1 API", - "product_documentation": "https://cloud.google.com/security-command-center", - "release_level": "unreleased", - "repo": "googleapis/google-cloud-ruby", - "requires_billing": true, - "ruby-cloud-description": "Security Command Center API provides access to temporal views of assets and findings within an organization. Note that google-cloud-security_center-v1 is a version-specific client library. For most uses, we recommend installing the main client library google-cloud-security_center instead. See the readme for more details.", - "ruby-cloud-env-prefix": "SECURITY_CENTER", - "ruby-cloud-product-url": "https://cloud.google.com/security-command-center", - "library_type": "GAPIC_AUTO" -} diff --git a/owl-bot-staging/google-cloud-security_center-v1/.rubocop.yml b/owl-bot-staging/google-cloud-security_center-v1/.rubocop.yml deleted file mode 100644 index cd91eea56b45..000000000000 --- a/owl-bot-staging/google-cloud-security_center-v1/.rubocop.yml +++ /dev/null @@ -1,33 +0,0 @@ -inherit_gem: - google-style: google-style.yml - -AllCops: - Exclude: - - "google-cloud-security_center-v1.gemspec" - - "lib/**/*_pb.rb" - - "proto_docs/**/*" - - "test/**/*" - - "acceptance/**/*" - - "samples/acceptance/**/*" - - "Rakefile" - -Layout/LineLength: - Enabled: false -Metrics/AbcSize: - Enabled: false -Metrics/ClassLength: - Enabled: false -Metrics/CyclomaticComplexity: - Enabled: false -Metrics/MethodLength: - Enabled: false -Metrics/ModuleLength: - Enabled: false -Metrics/PerceivedComplexity: - Enabled: false -Naming/AccessorMethodName: - Exclude: - - "snippets/**/*.rb" -Naming/FileName: - Exclude: - - "lib/google-cloud-security_center-v1.rb" diff --git a/owl-bot-staging/google-cloud-security_center-v1/.toys.rb b/owl-bot-staging/google-cloud-security_center-v1/.toys.rb deleted file mode 100644 index 177e22456e8a..000000000000 --- a/owl-bot-staging/google-cloud-security_center-v1/.toys.rb +++ /dev/null @@ -1,28 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -toys_version! ">= 0.15.3" - -if ENV["RUBY_COMMON_TOOLS"] - common_tools_dir = File.expand_path ENV["RUBY_COMMON_TOOLS"] - load File.join(common_tools_dir, "toys", "gapic") -else - load_git remote: "https://github.com/googleapis/ruby-common-tools.git", - path: "toys/gapic", - update: true -end diff --git a/owl-bot-staging/google-cloud-security_center-v1/.yardopts b/owl-bot-staging/google-cloud-security_center-v1/.yardopts deleted file mode 100644 index 1a401945abab..000000000000 --- a/owl-bot-staging/google-cloud-security_center-v1/.yardopts +++ /dev/null @@ -1,12 +0,0 @@ ---no-private ---title="Cloud Security Command Center V1 API" ---exclude _pb\.rb$ ---markup markdown ---markup-provider redcarpet - -./lib/**/*.rb -./proto_docs/**/*.rb -- -README.md -LICENSE.md -AUTHENTICATION.md diff --git a/owl-bot-staging/google-cloud-security_center-v1/AUTHENTICATION.md b/owl-bot-staging/google-cloud-security_center-v1/AUTHENTICATION.md deleted file mode 100644 index ba9af184f351..000000000000 --- a/owl-bot-staging/google-cloud-security_center-v1/AUTHENTICATION.md +++ /dev/null @@ -1,122 +0,0 @@ -# Authentication - -The recommended way to authenticate to the google-cloud-security_center-v1 library is to use -[Application Default Credentials (ADC)](https://cloud.google.com/docs/authentication/application-default-credentials). -To review all of your authentication options, see [Credentials lookup](#credential-lookup). - -## Quickstart - -The following example shows how to set up authentication for a local development -environment with your user credentials. - -**NOTE:** This method is _not_ recommended for running in production. User credentials -should be used only during development. - -1. [Download and install the Google Cloud CLI](https://cloud.google.com/sdk). -2. Set up a local ADC file with your user credentials: - -```sh -gcloud auth application-default login -``` - -3. Write code as if already authenticated. - -For more information about setting up authentication for a local development environment, see -[Set up Application Default Credentials](https://cloud.google.com/docs/authentication/provide-credentials-adc#local-dev). - -## Credential Lookup - -The google-cloud-security_center-v1 library provides several mechanisms to configure your system. -Generally, using Application Default Credentials to facilitate automatic -credentials discovery is the easist method. But if you need to explicitly specify -credentials, there are several methods available to you. - -Credentials are accepted in the following ways, in the following order or precedence: - -1. Credentials specified in method arguments -2. Credentials specified in configuration -3. Credentials pointed to or included in environment variables -4. Credentials found in local ADC file -5. Credentials returned by the metadata server for the attached service account (GCP) - -### Configuration - -You can configure a path to a JSON credentials file, either for an individual client object or -globally, for all client objects. The JSON file can contain credentials created for -[workload identity federation](https://cloud.google.com/iam/docs/workload-identity-federation), -[workforce identity federation](https://cloud.google.com/iam/docs/workforce-identity-federation), or a -[service account key](https://cloud.google.com/docs/authentication/provide-credentials-adc#local-key). - -Note: Service account keys are a security risk if not managed correctly. You should -[choose a more secure alternative to service account keys](https://cloud.google.com/docs/authentication#auth-decision-tree) -whenever possible. - -To configure a credentials file for an individual client initialization: - -```ruby -require "google/cloud/security_center/v1" - -client = ::Google::Cloud::SecurityCenter::V1::SecurityCenter::Client.new do |config| - config.credentials = "path/to/credentialfile.json" -end -``` - -To configure a credentials file globally for all clients: - -```ruby -require "google/cloud/security_center/v1" - -::Google::Cloud::SecurityCenter::V1::SecurityCenter::Client.configure do |config| - config.credentials = "path/to/credentialfile.json" -end - -client = ::Google::Cloud::SecurityCenter::V1::SecurityCenter::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-security_center-v1 -checks for credentials are: - -* `GOOGLE_CLOUD_CREDENTIALS` - Path to JSON file, or JSON contents -* `GOOGLE_APPLICATION_CREDENTIALS` - Path to JSON file - -```ruby -require "google/cloud/security_center/v1" - -ENV["GOOGLE_APPLICATION_CREDENTIALS"] = "path/to/credentialfile.json" - -client = ::Google::Cloud::SecurityCenter::V1::SecurityCenter::Client.new -``` - -### Local ADC file - -You can set up a local ADC file with your user credentials for authentication during -development. If credentials are not provided in code or in environment variables, -then the local ADC credentials are discovered. - -Follow the steps in [Quickstart](#quickstart) to set up a local ADC file. - -### Google Cloud Platform environments - -When running on Google Cloud Platform (GCP), including Google Compute Engine -(GCE), Google Kubernetes Engine (GKE), Google App Engine (GAE), Google Cloud -Functions (GCF) and Cloud Run, credentials are retrieved from the attached -service account automatically. Code should be written as if already authenticated. - -For more information, see -[Set up ADC for Google Cloud services](https://cloud.google.com/docs/authentication/provide-credentials-adc#attached-sa). diff --git a/owl-bot-staging/google-cloud-security_center-v1/CHANGELOG.md b/owl-bot-staging/google-cloud-security_center-v1/CHANGELOG.md deleted file mode 100644 index f88957a62ba2..000000000000 --- a/owl-bot-staging/google-cloud-security_center-v1/CHANGELOG.md +++ /dev/null @@ -1,2 +0,0 @@ -# Release History - diff --git a/owl-bot-staging/google-cloud-security_center-v1/Gemfile b/owl-bot-staging/google-cloud-security_center-v1/Gemfile deleted file mode 100644 index 1d08558908d8..000000000000 --- a/owl-bot-staging/google-cloud-security_center-v1/Gemfile +++ /dev/null @@ -1,14 +0,0 @@ -source "https://rubygems.org" - -gemspec - -gem "google-style", "~> 1.32.0" -gem "irb", "~> 1.17" -gem "minitest", "~> 6.0.2" -gem "minitest-focus", "~> 1.4" -gem "minitest-mock", "~> 5.27" -gem "minitest-rg", "~> 5.3" -gem "ostruct", "~> 0.5.5" -gem "rake", ">= 13.0" -gem "redcarpet", "~> 3.6" -gem "yard", "~> 0.9" diff --git a/owl-bot-staging/google-cloud-security_center-v1/LICENSE.md b/owl-bot-staging/google-cloud-security_center-v1/LICENSE.md deleted file mode 100644 index c261857ba6ad..000000000000 --- a/owl-bot-staging/google-cloud-security_center-v1/LICENSE.md +++ /dev/null @@ -1,201 +0,0 @@ - Apache License - Version 2.0, January 2004 - http://www.apache.org/licenses/ - - TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION - - 1. Definitions. - - "License" shall mean the terms and conditions for use, reproduction, - and distribution as defined by Sections 1 through 9 of this document. - - "Licensor" shall mean the copyright owner or entity authorized by - the copyright owner that is granting the License. - - "Legal Entity" shall mean the union of the acting entity and all - other entities that control, are controlled by, or are under common - control with that entity. For the purposes of this definition, - "control" means (i) the power, direct or indirect, to cause the - direction or management of such entity, whether by contract or - otherwise, or (ii) ownership of fifty percent (50%) or more of the - outstanding shares, or (iii) beneficial ownership of such entity. - - "You" (or "Your") shall mean an individual or Legal Entity - exercising permissions granted by this License. - - "Source" form shall mean the preferred form for making modifications, - including but not limited to software source code, documentation - source, and configuration files. - - "Object" form shall mean any form resulting from mechanical - transformation or translation of a Source form, including but - not limited to compiled object code, generated documentation, - and conversions to other media types. - - "Work" shall mean the work of authorship, whether in Source or - Object form, made available under the License, as indicated by a - copyright notice that is included in or attached to the work - (an example is provided in the Appendix below). - - "Derivative Works" shall mean any work, whether in Source or Object - form, that is based on (or derived from) the Work and for which the - editorial revisions, annotations, elaborations, or other modifications - represent, as a whole, an original work of authorship. For the purposes - of this License, Derivative Works shall not include works that remain - separable from, or merely link (or bind by name) to the interfaces of, - the Work and Derivative Works thereof. - - "Contribution" shall mean any work of authorship, including - the original version of the Work and any modifications or additions - to that Work or Derivative Works thereof, that is intentionally - submitted to Licensor for inclusion in the Work by the copyright owner - or by an individual or Legal Entity authorized to submit on behalf of - the copyright owner. For the purposes of this definition, "submitted" - means any form of electronic, verbal, or written communication sent - to the Licensor or its representatives, including but not limited to - communication on electronic mailing lists, source code control systems, - and issue tracking systems that are managed by, or on behalf of, the - Licensor for the purpose of discussing and improving the Work, but - excluding communication that is conspicuously marked or otherwise - designated in writing by the copyright owner as "Not a Contribution." - - "Contributor" shall mean Licensor and any individual or Legal Entity - on behalf of whom a Contribution has been received by Licensor and - subsequently incorporated within the Work. - - 2. Grant of Copyright License. Subject to the terms and conditions of - this License, each Contributor hereby grants to You a perpetual, - worldwide, non-exclusive, no-charge, royalty-free, irrevocable - copyright license to reproduce, prepare Derivative Works of, - publicly display, publicly perform, sublicense, and distribute the - Work and such Derivative Works in Source or Object form. - - 3. Grant of Patent License. Subject to the terms and conditions of - this License, each Contributor hereby grants to You a perpetual, - worldwide, non-exclusive, no-charge, royalty-free, irrevocable - (except as stated in this section) patent license to make, have made, - use, offer to sell, sell, import, and otherwise transfer the Work, - where such license applies only to those patent claims licensable - by such Contributor that are necessarily infringed by their - Contribution(s) alone or by combination of their Contribution(s) - with the Work to which such Contribution(s) was submitted. If You - institute patent litigation against any entity (including a - cross-claim or counterclaim in a lawsuit) alleging that the Work - or a Contribution incorporated within the Work constitutes direct - or contributory patent infringement, then any patent licenses - granted to You under this License for that Work shall terminate - as of the date such litigation is filed. - - 4. Redistribution. You may reproduce and distribute copies of the - Work or Derivative Works thereof in any medium, with or without - modifications, and in Source or Object form, provided that You - meet the following conditions: - - (a) You must give any other recipients of the Work or - Derivative Works a copy of this License; and - - (b) You must cause any modified files to carry prominent notices - stating that You changed the files; and - - (c) You must retain, in the Source form of any Derivative Works - that You distribute, all copyright, patent, trademark, and - attribution notices from the Source form of the Work, - excluding those notices that do not pertain to any part of - the Derivative Works; and - - (d) If the Work includes a "NOTICE" text file as part of its - distribution, then any Derivative Works that You distribute must - include a readable copy of the attribution notices contained - within such NOTICE file, excluding those notices that do not - pertain to any part of the Derivative Works, in at least one - of the following places: within a NOTICE text file distributed - as part of the Derivative Works; within the Source form or - documentation, if provided along with the Derivative Works; or, - within a display generated by the Derivative Works, if and - wherever such third-party notices normally appear. The contents - of the NOTICE file are for informational purposes only and - do not modify the License. You may add Your own attribution - notices within Derivative Works that You distribute, alongside - or as an addendum to the NOTICE text from the Work, provided - that such additional attribution notices cannot be construed - as modifying the License. - - You may add Your own copyright statement to Your modifications and - may provide additional or different license terms and conditions - for use, reproduction, or distribution of Your modifications, or - for any such Derivative Works as a whole, provided Your use, - reproduction, and distribution of the Work otherwise complies with - the conditions stated in this License. - - 5. Submission of Contributions. Unless You explicitly state otherwise, - any Contribution intentionally submitted for inclusion in the Work - by You to the Licensor shall be under the terms and conditions of - this License, without any additional terms or conditions. - Notwithstanding the above, nothing herein shall supersede or modify - the terms of any separate license agreement you may have executed - with Licensor regarding such Contributions. - - 6. Trademarks. This License does not grant permission to use the trade - names, trademarks, service marks, or product names of the Licensor, - except as required for reasonable and customary use in describing the - origin of the Work and reproducing the content of the NOTICE file. - - 7. Disclaimer of Warranty. Unless required by applicable law or - agreed to in writing, Licensor provides the Work (and each - Contributor provides its Contributions) on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or - implied, including, without limitation, any warranties or conditions - of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A - PARTICULAR PURPOSE. You are solely responsible for determining the - appropriateness of using or redistributing the Work and assume any - risks associated with Your exercise of permissions under this License. - - 8. Limitation of Liability. In no event and under no legal theory, - whether in tort (including negligence), contract, or otherwise, - unless required by applicable law (such as deliberate and grossly - negligent acts) or agreed to in writing, shall any Contributor be - liable to You for damages, including any direct, indirect, special, - incidental, or consequential damages of any character arising as a - result of this License or out of the use or inability to use the - Work (including but not limited to damages for loss of goodwill, - work stoppage, computer failure or malfunction, or any and all - other commercial damages or losses), even if such Contributor - has been advised of the possibility of such damages. - - 9. Accepting Warranty or Additional Liability. While redistributing - the Work or Derivative Works thereof, You may choose to offer, - and charge a fee for, acceptance of support, warranty, indemnity, - or other liability obligations and/or rights consistent with this - License. However, in accepting such obligations, You may act only - on Your own behalf and on Your sole responsibility, not on behalf - of any other Contributor, and only if You agree to indemnify, - defend, and hold each Contributor harmless for any liability - incurred by, or claims asserted against, such Contributor by reason - of your accepting any such warranty or additional liability. - - END OF TERMS AND CONDITIONS - - APPENDIX: How to apply the Apache License to your work. - - To apply the Apache License to your work, attach the following - boilerplate notice, with the fields enclosed by brackets "[]" - replaced with your own identifying information. (Don't include - the brackets!) The text should be enclosed in the appropriate - comment syntax for the file format. We also recommend that a - file or class name and description of purpose be included on the - same "printed page" as the copyright notice for easier - identification within third-party archives. - - Copyright [yyyy] [name of copyright owner] - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. diff --git a/owl-bot-staging/google-cloud-security_center-v1/README.md b/owl-bot-staging/google-cloud-security_center-v1/README.md deleted file mode 100644 index 31112eac75be..000000000000 --- a/owl-bot-staging/google-cloud-security_center-v1/README.md +++ /dev/null @@ -1,153 +0,0 @@ -# Ruby Client for the Cloud Security Command Center V1 API - -Security Command Center API provides access to temporal views of assets and findings within an organization. - - -https://github.com/googleapis/google-cloud-ruby - -This gem is a _versioned_ client. It provides basic client classes for a -specific version of the Cloud Security Command Center V1 API. Most users should consider using -the main client gem, -[google-cloud-security_center](https://rubygems.org/gems/google-cloud-security_center). -See the section below titled *Which client should I use?* for more information. - -## Installation - -``` -$ gem install google-cloud-security_center-v1 -``` - -## Before You Begin - -In order to use this library, you first need to go through the following steps: - -1. [Select or create a Cloud Platform project.](https://console.cloud.google.com/project) -1. [Enable billing for your project.](https://cloud.google.com/billing/docs/how-to/modify-project#enable_billing_for_a_project) -1. [Enable the API.](https://console.cloud.google.com/apis/library/securitycenter.googleapis.com) -1. [Set up authentication.](AUTHENTICATION.md) - -## Quick Start - -```ruby -require "google/cloud/security_center/v1" - -client = ::Google::Cloud::SecurityCenter::V1::SecurityCenter::Client.new -request = ::Google::Cloud::SecurityCenter::V1::BulkMuteFindingsRequest.new # (request fields as keyword arguments...) -response = client.bulk_mute_findings request -``` - -View the [Client Library Documentation](https://cloud.google.com/ruby/docs/reference/google-cloud-security_center-v1/latest) -for class and method documentation. - -See also the [Product Documentation](https://cloud.google.com/security-command-center) -for general usage information. - -## Debug Logging - -This library comes with opt-in Debug Logging that can help you troubleshoot -your application's integration with the API. When logging is activated, key -events such as requests and responses, along with data payloads and metadata -such as headers and client configuration, are logged to the standard error -stream. - -**WARNING:** Client Library Debug Logging includes your data payloads in -plaintext, which could include sensitive data such as PII for yourself or your -customers, private keys, or other security data that could be compromising if -leaked. Always practice good data hygiene with your application logs, and follow -the principle of least access. Google also recommends that Client Library Debug -Logging be enabled only temporarily during active debugging, and not used -permanently in production. - -To enable logging, set the environment variable `GOOGLE_SDK_RUBY_LOGGING_GEMS` -to the value `all`. Alternatively, you can set the value to a comma-delimited -list of client library gem names. This will select the default logging behavior, -which writes logs to the standard error stream. On a local workstation, this may -result in logs appearing on the console. When running on a Google Cloud hosting -service such as [Google Cloud Run](https://cloud.google.com/run), this generally -results in logs appearing alongside your application logs in the -[Google Cloud Logging](https://cloud.google.com/logging/) service. - -You can customize logging by modifying the `logger` configuration when -constructing a client object. For example: - -```ruby -require "google/cloud/security_center/v1" -require "logger" - -client = ::Google::Cloud::SecurityCenter::V1::SecurityCenter::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-security_center`, -and lower-level _versioned_ client libraries with names such as -`google-cloud-security_center-v1`. -_In most cases, you should install the main client._ - -### What's the difference between the main client and a versioned client? - -A _versioned client_ provides a basic set of data types and client classes for -a _single version_ of a specific service. (That is, for a service with multiple -versions, there might be a separate versioned client for each service version.) -Most versioned clients are written and maintained by a code generator. - -The _main client_ is designed to provide you with the _recommended_ client -interfaces for the service. There will be only one main client for any given -service, even a service with multiple versions. The main client includes -factory methods for constructing the client objects we recommend for most -users. In some cases, those will be classes provided by an underlying versioned -client; in other cases, they will be handwritten higher-level client objects -with additional capabilities, convenience methods, or best practices built in. -Generally, the main client will default to a recommended service version, -although in some cases you can override this if you need to talk to a specific -service version. - -### Why would I want to use the main client? - -We recommend that most users install the main client gem for a service. You can -identify this gem as the one _without_ a version in its name, e.g. -`google-cloud-security_center`. -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-security_center-v1`. - -### What about the google-apis- clients? - -Client library gems with names that begin with `google-apis-` are based on an -older code generation technology. They talk to a REST/JSON backend (whereas -most modern clients talk to a [gRPC](https://grpc.io/) backend) and they may -not offer the same performance, features, and ease of use provided by more -modern clients. - -The `google-apis-` clients have wide coverage across Google services, so you -might need to use one if there is no modern client available for the service. -However, if a modern client is available, we generally recommend it over the -older `google-apis-` clients. diff --git a/owl-bot-staging/google-cloud-security_center-v1/Rakefile b/owl-bot-staging/google-cloud-security_center-v1/Rakefile deleted file mode 100644 index 11860dec5013..000000000000 --- a/owl-bot-staging/google-cloud-security_center-v1/Rakefile +++ /dev/null @@ -1,169 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -require "bundler/setup" -require "bundler/gem_tasks" - -require "rubocop/rake_task" -RuboCop::RakeTask.new - -require "rake/testtask" -desc "Run tests." -Rake::TestTask.new do |t| - t.libs << "test" - t.test_files = FileList["test/**/*_test.rb"] - t.warning = false -end - -desc "Runs the smoke tests." -Rake::TestTask.new :smoke_test do |t| - t.test_files = FileList["acceptance/**/*smoke_test.rb"] - t.warning = false -end - -# Acceptance tests -desc "Run the google-cloud-security_center-v1 acceptance tests." -task :acceptance, :project, :keyfile do |t, args| - project = args[:project] - project ||= - ENV["SECURITY_CENTER_TEST_PROJECT"] || - ENV["GCLOUD_TEST_PROJECT"] - keyfile = args[:keyfile] - keyfile ||= - ENV["SECURITY_CENTER_TEST_KEYFILE"] || - ENV["GCLOUD_TEST_KEYFILE"] - if keyfile - keyfile = File.read keyfile - else - keyfile ||= - ENV["SECURITY_CENTER_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 SECURITY_CENTER_TEST_PROJECT=test123 SECURITY_CENTER_TEST_KEYFILE=/path/to/keyfile.json rake acceptance" - end - require "google/cloud/security_center/v1/security_center/credentials" - ::Google::Cloud::SecurityCenter::V1::SecurityCenter::Credentials.env_vars.each do |path| - ENV[path] = nil - end - ENV["SECURITY_CENTER_PROJECT"] = project - ENV["SECURITY_CENTER_TEST_PROJECT"] = project - ENV["SECURITY_CENTER_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-security_center-v1 gem has no acceptance tests." - end - end - - desc "Run acceptance cleanup." - task :cleanup do - end -end - -task :samples do - Rake::Task["samples:latest"].invoke -end - -namespace :samples do - task :latest do - if File.directory? "samples" - Dir.chdir "samples" do - Bundler.with_clean_env do - ENV["GOOGLE_CLOUD_SAMPLES_TEST"] = "not_master" - sh "bundle update" - sh "bundle exec rake test" - end - end - else - puts "The google-cloud-security_center-v1 gem has no samples to test." - end - end - - task :master do - if File.directory? "samples" - Dir.chdir "samples" do - Bundler.with_clean_env do - ENV["GOOGLE_CLOUD_SAMPLES_TEST"] = "master" - sh "bundle update" - sh "bundle exec rake test" - end - end - else - puts "The google-cloud-security_center-v1 gem has no samples to test." - end - end -end - -require "yard" -require "yard/rake/yardoc_task" -YARD::Rake::YardocTask.new do |y| - y.options << "--fail-on-warning" -end - -desc "Run yard-doctest example tests." -task :doctest do - puts "The google-cloud-security_center-v1 gem does not have doctest tests." -end - -desc "Run the CI build" -task :ci do - header "BUILDING google-cloud-security_center-v1" - header "google-cloud-security_center-v1 rubocop", "*" - Rake::Task[:rubocop].invoke - header "google-cloud-security_center-v1 yard", "*" - Rake::Task[:yard].invoke - header "google-cloud-security_center-v1 test", "*" - Rake::Task[:test].invoke -end - -namespace :ci do - desc "Run the CI build, with smoke tests." - task :smoke_test do - Rake::Task[:ci].invoke - header "google-cloud-security_center-v1 smoke_test", "*" - Rake::Task[:smoke_test].invoke - end - desc "Run the CI build, with acceptance tests." - task :acceptance do - Rake::Task[:ci].invoke - header "google-cloud-security_center-v1 acceptance", "*" - Rake::Task[:acceptance].invoke - end - task :a do - # This is a handy shortcut to save typing - Rake::Task["ci:acceptance"].invoke - end -end - -task default: :test - -def header str, token = "#" - line_length = str.length + 8 - puts "" - puts token * line_length - puts "#{token * 3} #{str} #{token * 3}" - puts token * line_length - puts "" -end diff --git a/owl-bot-staging/google-cloud-security_center-v1/gapic_metadata.json b/owl-bot-staging/google-cloud-security_center-v1/gapic_metadata.json deleted file mode 100644 index 2a9d62ebb4ad..000000000000 --- a/owl-bot-staging/google-cloud-security_center-v1/gapic_metadata.json +++ /dev/null @@ -1,333 +0,0 @@ -{ - "schema": "1.0", - "comment": "This file maps proto services/RPCs to the corresponding library clients/methods", - "language": "ruby", - "protoPackage": "google.cloud.securitycenter.v1", - "libraryPackage": "::Google::Cloud::SecurityCenter::V1", - "services": { - "SecurityCenter": { - "clients": { - "grpc": { - "libraryClient": "::Google::Cloud::SecurityCenter::V1::SecurityCenter::Client", - "rpcs": { - "BulkMuteFindings": { - "methods": [ - "bulk_mute_findings" - ] - }, - "CreateSecurityHealthAnalyticsCustomModule": { - "methods": [ - "create_security_health_analytics_custom_module" - ] - }, - "CreateSource": { - "methods": [ - "create_source" - ] - }, - "CreateFinding": { - "methods": [ - "create_finding" - ] - }, - "CreateMuteConfig": { - "methods": [ - "create_mute_config" - ] - }, - "CreateNotificationConfig": { - "methods": [ - "create_notification_config" - ] - }, - "DeleteMuteConfig": { - "methods": [ - "delete_mute_config" - ] - }, - "DeleteNotificationConfig": { - "methods": [ - "delete_notification_config" - ] - }, - "DeleteSecurityHealthAnalyticsCustomModule": { - "methods": [ - "delete_security_health_analytics_custom_module" - ] - }, - "GetSimulation": { - "methods": [ - "get_simulation" - ] - }, - "GetValuedResource": { - "methods": [ - "get_valued_resource" - ] - }, - "GetBigQueryExport": { - "methods": [ - "get_big_query_export" - ] - }, - "GetIamPolicy": { - "methods": [ - "get_iam_policy" - ] - }, - "GetMuteConfig": { - "methods": [ - "get_mute_config" - ] - }, - "GetNotificationConfig": { - "methods": [ - "get_notification_config" - ] - }, - "GetOrganizationSettings": { - "methods": [ - "get_organization_settings" - ] - }, - "GetEffectiveSecurityHealthAnalyticsCustomModule": { - "methods": [ - "get_effective_security_health_analytics_custom_module" - ] - }, - "GetSecurityHealthAnalyticsCustomModule": { - "methods": [ - "get_security_health_analytics_custom_module" - ] - }, - "GetSource": { - "methods": [ - "get_source" - ] - }, - "GroupAssets": { - "methods": [ - "group_assets" - ] - }, - "GroupFindings": { - "methods": [ - "group_findings" - ] - }, - "ListAssets": { - "methods": [ - "list_assets" - ] - }, - "ListDescendantSecurityHealthAnalyticsCustomModules": { - "methods": [ - "list_descendant_security_health_analytics_custom_modules" - ] - }, - "ListFindings": { - "methods": [ - "list_findings" - ] - }, - "ListMuteConfigs": { - "methods": [ - "list_mute_configs" - ] - }, - "ListNotificationConfigs": { - "methods": [ - "list_notification_configs" - ] - }, - "ListEffectiveSecurityHealthAnalyticsCustomModules": { - "methods": [ - "list_effective_security_health_analytics_custom_modules" - ] - }, - "ListSecurityHealthAnalyticsCustomModules": { - "methods": [ - "list_security_health_analytics_custom_modules" - ] - }, - "ListSources": { - "methods": [ - "list_sources" - ] - }, - "RunAssetDiscovery": { - "methods": [ - "run_asset_discovery" - ] - }, - "SetFindingState": { - "methods": [ - "set_finding_state" - ] - }, - "SetMute": { - "methods": [ - "set_mute" - ] - }, - "SetIamPolicy": { - "methods": [ - "set_iam_policy" - ] - }, - "TestIamPermissions": { - "methods": [ - "test_iam_permissions" - ] - }, - "SimulateSecurityHealthAnalyticsCustomModule": { - "methods": [ - "simulate_security_health_analytics_custom_module" - ] - }, - "UpdateExternalSystem": { - "methods": [ - "update_external_system" - ] - }, - "UpdateFinding": { - "methods": [ - "update_finding" - ] - }, - "UpdateMuteConfig": { - "methods": [ - "update_mute_config" - ] - }, - "UpdateNotificationConfig": { - "methods": [ - "update_notification_config" - ] - }, - "UpdateOrganizationSettings": { - "methods": [ - "update_organization_settings" - ] - }, - "UpdateSecurityHealthAnalyticsCustomModule": { - "methods": [ - "update_security_health_analytics_custom_module" - ] - }, - "UpdateSource": { - "methods": [ - "update_source" - ] - }, - "UpdateSecurityMarks": { - "methods": [ - "update_security_marks" - ] - }, - "CreateBigQueryExport": { - "methods": [ - "create_big_query_export" - ] - }, - "DeleteBigQueryExport": { - "methods": [ - "delete_big_query_export" - ] - }, - "UpdateBigQueryExport": { - "methods": [ - "update_big_query_export" - ] - }, - "ListBigQueryExports": { - "methods": [ - "list_big_query_exports" - ] - }, - "CreateEventThreatDetectionCustomModule": { - "methods": [ - "create_event_threat_detection_custom_module" - ] - }, - "DeleteEventThreatDetectionCustomModule": { - "methods": [ - "delete_event_threat_detection_custom_module" - ] - }, - "GetEventThreatDetectionCustomModule": { - "methods": [ - "get_event_threat_detection_custom_module" - ] - }, - "ListDescendantEventThreatDetectionCustomModules": { - "methods": [ - "list_descendant_event_threat_detection_custom_modules" - ] - }, - "ListEventThreatDetectionCustomModules": { - "methods": [ - "list_event_threat_detection_custom_modules" - ] - }, - "UpdateEventThreatDetectionCustomModule": { - "methods": [ - "update_event_threat_detection_custom_module" - ] - }, - "ValidateEventThreatDetectionCustomModule": { - "methods": [ - "validate_event_threat_detection_custom_module" - ] - }, - "GetEffectiveEventThreatDetectionCustomModule": { - "methods": [ - "get_effective_event_threat_detection_custom_module" - ] - }, - "ListEffectiveEventThreatDetectionCustomModules": { - "methods": [ - "list_effective_event_threat_detection_custom_modules" - ] - }, - "BatchCreateResourceValueConfigs": { - "methods": [ - "batch_create_resource_value_configs" - ] - }, - "DeleteResourceValueConfig": { - "methods": [ - "delete_resource_value_config" - ] - }, - "GetResourceValueConfig": { - "methods": [ - "get_resource_value_config" - ] - }, - "ListResourceValueConfigs": { - "methods": [ - "list_resource_value_configs" - ] - }, - "UpdateResourceValueConfig": { - "methods": [ - "update_resource_value_config" - ] - }, - "ListValuedResources": { - "methods": [ - "list_valued_resources" - ] - }, - "ListAttackPaths": { - "methods": [ - "list_attack_paths" - ] - } - } - } - } - } - } -} diff --git a/owl-bot-staging/google-cloud-security_center-v1/google-cloud-security_center-v1.gemspec b/owl-bot-staging/google-cloud-security_center-v1/google-cloud-security_center-v1.gemspec deleted file mode 100644 index 2ea1431c6518..000000000000 --- a/owl-bot-staging/google-cloud-security_center-v1/google-cloud-security_center-v1.gemspec +++ /dev/null @@ -1,29 +0,0 @@ -# -*- ruby -*- -# encoding: utf-8 - -require File.expand_path("lib/google/cloud/security_center/v1/version", __dir__) - -Gem::Specification.new do |gem| - gem.name = "google-cloud-security_center-v1" - gem.version = Google::Cloud::SecurityCenter::V1::VERSION - - gem.authors = ["Google LLC"] - gem.email = "googleapis-packages@google.com" - gem.description = "Security Command Center API provides access to temporal views of assets and findings within an organization. Note that google-cloud-security_center-v1 is a version-specific client library. For most uses, we recommend installing the main client library google-cloud-security_center instead. See the readme for more details." - gem.summary = "Security Command Center API provides access to temporal views of assets and findings within an organization." - 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 "grpc-google-iam-v1", "~> 1.11" -end diff --git a/owl-bot-staging/google-cloud-security_center-v1/lib/google-cloud-security_center-v1.rb b/owl-bot-staging/google-cloud-security_center-v1/lib/google-cloud-security_center-v1.rb deleted file mode 100644 index b1f8c90a70d9..000000000000 --- a/owl-bot-staging/google-cloud-security_center-v1/lib/google-cloud-security_center-v1.rb +++ /dev/null @@ -1,21 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -# This gem does not autoload during Bundler.require. To load this gem, -# issue explicit require statements for the packages desired, e.g.: -# require "google/cloud/security_center/v1" diff --git a/owl-bot-staging/google-cloud-security_center-v1/lib/google/cloud/security_center/v1.rb b/owl-bot-staging/google-cloud-security_center-v1/lib/google/cloud/security_center/v1.rb deleted file mode 100644 index 64e25fbd3ded..000000000000 --- a/owl-bot-staging/google-cloud-security_center-v1/lib/google/cloud/security_center/v1.rb +++ /dev/null @@ -1,45 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -require "google/cloud/security_center/v1/security_center" -require "google/cloud/security_center/v1/version" - -module Google - module Cloud - module SecurityCenter - ## - # API client module. - # - # @example Load this package, including all its services, and instantiate a gRPC client - # - # require "google/cloud/security_center/v1" - # client = ::Google::Cloud::SecurityCenter::V1::SecurityCenter::Client.new - # - # @example Load this package, including all its services, and instantiate a REST client - # - # require "google/cloud/security_center/v1" - # client = ::Google::Cloud::SecurityCenter::V1::SecurityCenter::Rest::Client.new - # - module V1 - end - end - end -end - -helper_path = ::File.join __dir__, "v1", "_helpers.rb" -require "google/cloud/security_center/v1/_helpers" if ::File.file? helper_path diff --git a/owl-bot-staging/google-cloud-security_center-v1/lib/google/cloud/security_center/v1/rest.rb b/owl-bot-staging/google-cloud-security_center-v1/lib/google/cloud/security_center/v1/rest.rb deleted file mode 100644 index c11148195761..000000000000 --- a/owl-bot-staging/google-cloud-security_center-v1/lib/google/cloud/security_center/v1/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/cloud/security_center/v1/security_center/rest" -require "google/cloud/security_center/v1/version" - -module Google - module Cloud - module SecurityCenter - ## - # To load just the REST part of this package, including all its services, and instantiate a REST client: - # - # @example - # - # require "google/cloud/security_center/v1/rest" - # client = ::Google::Cloud::SecurityCenter::V1::SecurityCenter::Rest::Client.new - # - module V1 - end - end - end -end diff --git a/owl-bot-staging/google-cloud-security_center-v1/lib/google/cloud/security_center/v1/security_center.rb b/owl-bot-staging/google-cloud-security_center-v1/lib/google/cloud/security_center/v1/security_center.rb deleted file mode 100644 index 20883d6fbc43..000000000000 --- a/owl-bot-staging/google-cloud-security_center-v1/lib/google/cloud/security_center/v1/security_center.rb +++ /dev/null @@ -1,56 +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/security_center/v1/version" - -require "google/cloud/security_center/v1/security_center/credentials" -require "google/cloud/security_center/v1/security_center/paths" -require "google/cloud/security_center/v1/security_center/operations" -require "google/cloud/security_center/v1/security_center/client" -require "google/cloud/security_center/v1/security_center/rest" - -module Google - module Cloud - module SecurityCenter - module V1 - ## - # V1 APIs for Security Center service. - # - # @example Load this service and instantiate a gRPC client - # - # require "google/cloud/security_center/v1/security_center" - # client = ::Google::Cloud::SecurityCenter::V1::SecurityCenter::Client.new - # - # @example Load this service and instantiate a REST client - # - # require "google/cloud/security_center/v1/security_center/rest" - # client = ::Google::Cloud::SecurityCenter::V1::SecurityCenter::Rest::Client.new - # - module SecurityCenter - end - end - end - end -end - -helper_path = ::File.join __dir__, "security_center", "helpers.rb" -require "google/cloud/security_center/v1/security_center/helpers" if ::File.file? helper_path diff --git a/owl-bot-staging/google-cloud-security_center-v1/lib/google/cloud/security_center/v1/security_center/client.rb b/owl-bot-staging/google-cloud-security_center-v1/lib/google/cloud/security_center/v1/security_center/client.rb deleted file mode 100644 index e616499f5121..000000000000 --- a/owl-bot-staging/google-cloud-security_center-v1/lib/google/cloud/security_center/v1/security_center/client.rb +++ /dev/null @@ -1,7458 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -require "google/cloud/errors" -require "google/cloud/securitycenter/v1/securitycenter_service_pb" - -module Google - module Cloud - module SecurityCenter - module V1 - module SecurityCenter - ## - # Client for the SecurityCenter service. - # - # V1 APIs for Security Center service. - # - class Client - # @private - API_VERSION = "" - - # @private - DEFAULT_ENDPOINT_TEMPLATE = "securitycenter.$UNIVERSE_DOMAIN$" - - include Paths - - # @private - attr_reader :security_center_stub - - ## - # Configure the SecurityCenter Client class. - # - # See {::Google::Cloud::SecurityCenter::V1::SecurityCenter::Client::Configuration} - # for a description of the configuration fields. - # - # @example - # - # # Modify the configuration for all SecurityCenter clients - # ::Google::Cloud::SecurityCenter::V1::SecurityCenter::Client.configure do |config| - # config.timeout = 10.0 - # end - # - # @yield [config] Configure the Client client. - # @yieldparam config [Client::Configuration] - # - # @return [Client::Configuration] - # - def self.configure - @configure ||= begin - namespace = ["Google", "Cloud", "SecurityCenter", "V1"] - parent_config = while namespace.any? - parent_name = namespace.join "::" - parent_const = const_get parent_name - break parent_const.configure if parent_const.respond_to? :configure - namespace.pop - end - default_config = Client::Configuration.new parent_config - - default_config.rpcs.create_security_health_analytics_custom_module.timeout = 60.0 - - default_config.rpcs.create_source.timeout = 60.0 - - default_config.rpcs.create_finding.timeout = 60.0 - - default_config.rpcs.create_notification_config.timeout = 60.0 - - default_config.rpcs.delete_notification_config.timeout = 60.0 - - default_config.rpcs.delete_security_health_analytics_custom_module.timeout = 60.0 - - default_config.rpcs.get_iam_policy.timeout = 60.0 - default_config.rpcs.get_iam_policy.retry_policy = { - initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [4, 14] - } - - default_config.rpcs.get_notification_config.timeout = 60.0 - default_config.rpcs.get_notification_config.retry_policy = { - initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [4, 14] - } - - default_config.rpcs.get_organization_settings.timeout = 60.0 - default_config.rpcs.get_organization_settings.retry_policy = { - initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [4, 14] - } - - default_config.rpcs.get_effective_security_health_analytics_custom_module.timeout = 60.0 - default_config.rpcs.get_effective_security_health_analytics_custom_module.retry_policy = { - initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [4, 14] - } - - default_config.rpcs.get_security_health_analytics_custom_module.timeout = 60.0 - default_config.rpcs.get_security_health_analytics_custom_module.retry_policy = { - initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [4, 14] - } - - default_config.rpcs.get_source.timeout = 60.0 - default_config.rpcs.get_source.retry_policy = { - initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [4, 14] - } - - default_config.rpcs.group_assets.timeout = 480.0 - default_config.rpcs.group_assets.retry_policy = { - initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [4, 14] - } - - default_config.rpcs.group_findings.timeout = 480.0 - default_config.rpcs.group_findings.retry_policy = { - initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [4, 14] - } - - default_config.rpcs.list_assets.timeout = 480.0 - default_config.rpcs.list_assets.retry_policy = { - initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [4, 14] - } - - default_config.rpcs.list_descendant_security_health_analytics_custom_modules.timeout = 60.0 - default_config.rpcs.list_descendant_security_health_analytics_custom_modules.retry_policy = { - initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [4, 14] - } - - default_config.rpcs.list_findings.timeout = 480.0 - default_config.rpcs.list_findings.retry_policy = { - initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [4, 14] - } - - default_config.rpcs.list_notification_configs.timeout = 60.0 - default_config.rpcs.list_notification_configs.retry_policy = { - initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [4, 14] - } - - default_config.rpcs.list_effective_security_health_analytics_custom_modules.timeout = 60.0 - default_config.rpcs.list_effective_security_health_analytics_custom_modules.retry_policy = { - initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [4, 14] - } - - default_config.rpcs.list_security_health_analytics_custom_modules.timeout = 60.0 - default_config.rpcs.list_security_health_analytics_custom_modules.retry_policy = { - initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [4, 14] - } - - default_config.rpcs.list_sources.timeout = 60.0 - default_config.rpcs.list_sources.retry_policy = { - initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [4, 14] - } - - default_config.rpcs.run_asset_discovery.timeout = 60.0 - - default_config.rpcs.set_finding_state.timeout = 60.0 - - default_config.rpcs.set_iam_policy.timeout = 60.0 - - default_config.rpcs.test_iam_permissions.timeout = 60.0 - default_config.rpcs.test_iam_permissions.retry_policy = { - initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [4, 14] - } - - default_config.rpcs.update_finding.timeout = 60.0 - - default_config.rpcs.update_notification_config.timeout = 60.0 - - default_config.rpcs.update_organization_settings.timeout = 60.0 - - default_config.rpcs.update_security_health_analytics_custom_module.timeout = 60.0 - - default_config.rpcs.update_source.timeout = 60.0 - - default_config.rpcs.update_security_marks.timeout = 480.0 - - default_config - end - yield @configure if block_given? - @configure - end - - ## - # Configure the SecurityCenter Client instance. - # - # The configuration is set to the derived mode, meaning that values can be changed, - # but structural changes (adding new fields, etc.) are not allowed. Structural changes - # should be made on {Client.configure}. - # - # See {::Google::Cloud::SecurityCenter::V1::SecurityCenter::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 - @security_center_stub.universe_domain - end - - ## - # Create a new SecurityCenter client object. - # - # @example - # - # # Create a client using the default configuration - # client = ::Google::Cloud::SecurityCenter::V1::SecurityCenter::Client.new - # - # # Create a client using a custom configuration - # client = ::Google::Cloud::SecurityCenter::V1::SecurityCenter::Client.new do |config| - # config.timeout = 10.0 - # end - # - # @yield [config] Configure the SecurityCenter client. - # @yieldparam config [Client::Configuration] - # - def initialize - # These require statements are intentionally placed here to initialize - # the gRPC module only when it's required. - # See https://github.com/googleapis/toolkit/issues/446 - require "gapic/grpc" - require "google/cloud/securitycenter/v1/securitycenter_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 - - @security_center_stub = ::Gapic::ServiceStub.new( - ::Google::Cloud::SecurityCenter::V1::SecurityCenter::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 - ) - - @security_center_stub.stub_logger&.info do |entry| - entry.set_system_name - entry.set_service - entry.message = "Created client for #{entry.service}" - entry.set_credentials_fields credentials - entry.set "customEndpoint", @config.endpoint if @config.endpoint - entry.set "defaultTimeout", @config.timeout if @config.timeout - entry.set "quotaProject", @quota_project_id if @quota_project_id - end - end - - ## - # Get the associated client for long-running operations. - # - # @return [::Google::Cloud::SecurityCenter::V1::SecurityCenter::Operations] - # - attr_reader :operations_client - - ## - # The logger used for request/response debug logging. - # - # @return [Logger] - # - def logger - @security_center_stub.logger - end - - # Service calls - - ## - # Kicks off an LRO to bulk mute findings for a parent based on a filter. The - # parent can be either an organization, folder or project. The findings - # matched by the filter will be muted after the LRO is done. - # - # @overload bulk_mute_findings(request, options = nil) - # Pass arguments to `bulk_mute_findings` via a request object, either of type - # {::Google::Cloud::SecurityCenter::V1::BulkMuteFindingsRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::SecurityCenter::V1::BulkMuteFindingsRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. - # - # @overload bulk_mute_findings(parent: nil, filter: nil, mute_annotation: nil, mute_state: nil) - # Pass arguments to `bulk_mute_findings` via keyword arguments. Note that at - # least one keyword argument is 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, at which bulk action needs to be applied. Its format - # is `organizations/[organization_id]`, `folders/[folder_id]`, - # `projects/[project_id]`. - # @param filter [::String] - # Expression that identifies findings that should be updated. - # The expression is a list of zero or more restrictions combined - # via logical operators `AND` and `OR`. Parentheses are supported, and `OR` - # has higher precedence than `AND`. - # - # Restrictions have the form ` ` and may have a - # `-` character in front of them to indicate negation. The fields map to - # those defined in the corresponding resource. - # - # The supported operators are: - # - # * `=` for all value types. - # * `>`, `<`, `>=`, `<=` for integer values. - # * `:`, meaning substring matching, for strings. - # - # The supported value types are: - # - # * string literals in quotes. - # * integer literals without quotes. - # * boolean literals `true` and `false` without quotes. - # @param mute_annotation [::String] - # This can be a mute configuration name or any identifier for mute/unmute - # of findings based on the filter. - # @param mute_state [::Google::Cloud::SecurityCenter::V1::BulkMuteFindingsRequest::MuteState] - # Optional. All findings matching the given filter will have their mute state - # set to this value. The default value is `MUTED`. Setting this to - # `UNDEFINED` will clear the mute state on all matching findings. - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Gapic::Operation] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Gapic::Operation] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/cloud/security_center/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::SecurityCenter::V1::SecurityCenter::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::SecurityCenter::V1::BulkMuteFindingsRequest.new - # - # # Call the bulk_mute_findings method. - # result = client.bulk_mute_findings 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 bulk_mute_findings request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::SecurityCenter::V1::BulkMuteFindingsRequest - - # Converts hash 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.bulk_mute_findings.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::SecurityCenter::V1::VERSION - metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - header_params = {} - if request.parent - header_params["parent"] = request.parent - end - - request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") - metadata[:"x-goog-request-params"] ||= request_params_header - - options.apply_defaults timeout: @config.rpcs.bulk_mute_findings.timeout, - metadata: metadata, - retry_policy: @config.rpcs.bulk_mute_findings.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @security_center_stub.call_rpc :bulk_mute_findings, 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 - - ## - # Creates a resident SecurityHealthAnalyticsCustomModule at the scope of the - # given CRM parent, and also creates inherited - # SecurityHealthAnalyticsCustomModules for all CRM descendants of the given - # parent. These modules are enabled by default. - # - # @overload create_security_health_analytics_custom_module(request, options = nil) - # Pass arguments to `create_security_health_analytics_custom_module` via a request object, either of type - # {::Google::Cloud::SecurityCenter::V1::CreateSecurityHealthAnalyticsCustomModuleRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::SecurityCenter::V1::CreateSecurityHealthAnalyticsCustomModuleRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_security_health_analytics_custom_module(parent: nil, security_health_analytics_custom_module: nil) - # Pass arguments to `create_security_health_analytics_custom_module` via keyword arguments. Note that at - # least one keyword argument is 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. Resource name of the new custom module's parent. Its format is - # `organizations/{organization}/securityHealthAnalyticsSettings`, - # `folders/{folder}/securityHealthAnalyticsSettings`, or - # `projects/{project}/securityHealthAnalyticsSettings` - # @param security_health_analytics_custom_module [::Google::Cloud::SecurityCenter::V1::SecurityHealthAnalyticsCustomModule, ::Hash] - # Required. SecurityHealthAnalytics custom module to create. The provided - # name is ignored and reset with provided parent information and - # server-generated ID. - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Google::Cloud::SecurityCenter::V1::SecurityHealthAnalyticsCustomModule] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Google::Cloud::SecurityCenter::V1::SecurityHealthAnalyticsCustomModule] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/cloud/security_center/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::SecurityCenter::V1::SecurityCenter::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::SecurityCenter::V1::CreateSecurityHealthAnalyticsCustomModuleRequest.new - # - # # Call the create_security_health_analytics_custom_module method. - # result = client.create_security_health_analytics_custom_module request - # - # # The returned object is of type Google::Cloud::SecurityCenter::V1::SecurityHealthAnalyticsCustomModule. - # p result - # - def create_security_health_analytics_custom_module request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::SecurityCenter::V1::CreateSecurityHealthAnalyticsCustomModuleRequest - - # Converts hash 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_security_health_analytics_custom_module.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::SecurityCenter::V1::VERSION - metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - header_params = {} - if request.parent - header_params["parent"] = request.parent - end - - request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") - metadata[:"x-goog-request-params"] ||= request_params_header - - options.apply_defaults timeout: @config.rpcs.create_security_health_analytics_custom_module.timeout, - metadata: metadata, - retry_policy: @config.rpcs.create_security_health_analytics_custom_module.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @security_center_stub.call_rpc :create_security_health_analytics_custom_module, request, options: options do |response, operation| - yield response, operation if block_given? - end - rescue ::GRPC::BadStatus => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Creates a source. - # - # @overload create_source(request, options = nil) - # Pass arguments to `create_source` via a request object, either of type - # {::Google::Cloud::SecurityCenter::V1::CreateSourceRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::SecurityCenter::V1::CreateSourceRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_source(parent: nil, source: nil) - # Pass arguments to `create_source` via keyword arguments. Note that at - # least one keyword argument is 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. Resource name of the new source's parent. Its format should be - # `organizations/[organization_id]`. - # @param source [::Google::Cloud::SecurityCenter::V1::Source, ::Hash] - # Required. The Source being created, only the display_name and description - # will be used. All other fields will be ignored. - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Google::Cloud::SecurityCenter::V1::Source] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Google::Cloud::SecurityCenter::V1::Source] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/cloud/security_center/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::SecurityCenter::V1::SecurityCenter::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::SecurityCenter::V1::CreateSourceRequest.new - # - # # Call the create_source method. - # result = client.create_source request - # - # # The returned object is of type Google::Cloud::SecurityCenter::V1::Source. - # p result - # - def create_source request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::SecurityCenter::V1::CreateSourceRequest - - # Converts hash 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_source.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::SecurityCenter::V1::VERSION - metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - header_params = {} - if request.parent - header_params["parent"] = request.parent - end - - request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") - metadata[:"x-goog-request-params"] ||= request_params_header - - options.apply_defaults timeout: @config.rpcs.create_source.timeout, - metadata: metadata, - retry_policy: @config.rpcs.create_source.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @security_center_stub.call_rpc :create_source, request, options: options do |response, operation| - yield response, operation if block_given? - end - rescue ::GRPC::BadStatus => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Creates a finding. The corresponding source must exist for finding creation - # to succeed. - # - # @overload create_finding(request, options = nil) - # Pass arguments to `create_finding` via a request object, either of type - # {::Google::Cloud::SecurityCenter::V1::CreateFindingRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::SecurityCenter::V1::CreateFindingRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_finding(parent: nil, finding_id: nil, finding: nil) - # Pass arguments to `create_finding` via keyword arguments. Note that at - # least one keyword argument is 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. Resource name of the new finding's parent. Its format should be - # `organizations/[organization_id]/sources/[source_id]`. - # @param finding_id [::String] - # Required. Unique identifier provided by the client within the parent scope. - # It must be alphanumeric and less than or equal to 32 characters and - # greater than 0 characters in length. - # @param finding [::Google::Cloud::SecurityCenter::V1::Finding, ::Hash] - # Required. The Finding being created. The name and security_marks will be - # ignored as they are both output only fields on this resource. - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Google::Cloud::SecurityCenter::V1::Finding] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Google::Cloud::SecurityCenter::V1::Finding] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/cloud/security_center/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::SecurityCenter::V1::SecurityCenter::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::SecurityCenter::V1::CreateFindingRequest.new - # - # # Call the create_finding method. - # result = client.create_finding request - # - # # The returned object is of type Google::Cloud::SecurityCenter::V1::Finding. - # p result - # - def create_finding request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::SecurityCenter::V1::CreateFindingRequest - - # Converts hash 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_finding.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::SecurityCenter::V1::VERSION - metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - header_params = {} - if request.parent - header_params["parent"] = request.parent - end - - request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") - metadata[:"x-goog-request-params"] ||= request_params_header - - options.apply_defaults timeout: @config.rpcs.create_finding.timeout, - metadata: metadata, - retry_policy: @config.rpcs.create_finding.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @security_center_stub.call_rpc :create_finding, request, options: options do |response, operation| - yield response, operation if block_given? - end - rescue ::GRPC::BadStatus => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Creates a mute config. - # - # @overload create_mute_config(request, options = nil) - # Pass arguments to `create_mute_config` via a request object, either of type - # {::Google::Cloud::SecurityCenter::V1::CreateMuteConfigRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::SecurityCenter::V1::CreateMuteConfigRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_mute_config(parent: nil, mute_config: nil, mute_config_id: nil) - # Pass arguments to `create_mute_config` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param parent [::String] - # Required. Resource name of the new mute configs's parent. Its format is - # `organizations/[organization_id]`, `folders/[folder_id]`, or - # `projects/[project_id]`. - # @param mute_config [::Google::Cloud::SecurityCenter::V1::MuteConfig, ::Hash] - # Required. The mute config being created. - # @param mute_config_id [::String] - # Required. Unique identifier provided by the client within the parent scope. - # It must consist of only lowercase letters, numbers, and hyphens, must start - # with a letter, must end with either a letter or a number, and must be 63 - # characters or less. - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Google::Cloud::SecurityCenter::V1::MuteConfig] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Google::Cloud::SecurityCenter::V1::MuteConfig] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/cloud/security_center/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::SecurityCenter::V1::SecurityCenter::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::SecurityCenter::V1::CreateMuteConfigRequest.new - # - # # Call the create_mute_config method. - # result = client.create_mute_config request - # - # # The returned object is of type Google::Cloud::SecurityCenter::V1::MuteConfig. - # p result - # - def create_mute_config request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::SecurityCenter::V1::CreateMuteConfigRequest - - # Converts hash 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_mute_config.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::SecurityCenter::V1::VERSION - metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - header_params = {} - if request.parent - header_params["parent"] = request.parent - end - - request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") - metadata[:"x-goog-request-params"] ||= request_params_header - - options.apply_defaults timeout: @config.rpcs.create_mute_config.timeout, - metadata: metadata, - retry_policy: @config.rpcs.create_mute_config.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @security_center_stub.call_rpc :create_mute_config, request, options: options do |response, operation| - yield response, operation if block_given? - end - rescue ::GRPC::BadStatus => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Creates a notification config. - # - # @overload create_notification_config(request, options = nil) - # Pass arguments to `create_notification_config` via a request object, either of type - # {::Google::Cloud::SecurityCenter::V1::CreateNotificationConfigRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::SecurityCenter::V1::CreateNotificationConfigRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_notification_config(parent: nil, config_id: nil, notification_config: nil) - # Pass arguments to `create_notification_config` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param parent [::String] - # Required. Resource name of the new notification config's parent. Its format - # is `organizations/[organization_id]`, `folders/[folder_id]`, or - # `projects/[project_id]`. - # @param config_id [::String] - # Required. - # Unique identifier provided by the client within the parent scope. - # It must be between 1 and 128 characters and contain alphanumeric - # characters, underscores, or hyphens only. - # @param notification_config [::Google::Cloud::SecurityCenter::V1::NotificationConfig, ::Hash] - # Required. The notification config being created. The name and the service - # account will be ignored as they are both output only fields on this - # resource. - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Google::Cloud::SecurityCenter::V1::NotificationConfig] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Google::Cloud::SecurityCenter::V1::NotificationConfig] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/cloud/security_center/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::SecurityCenter::V1::SecurityCenter::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::SecurityCenter::V1::CreateNotificationConfigRequest.new - # - # # Call the create_notification_config method. - # result = client.create_notification_config request - # - # # The returned object is of type Google::Cloud::SecurityCenter::V1::NotificationConfig. - # p result - # - def create_notification_config request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::SecurityCenter::V1::CreateNotificationConfigRequest - - # Converts hash 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_notification_config.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::SecurityCenter::V1::VERSION - metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - header_params = {} - if request.parent - header_params["parent"] = request.parent - end - - request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") - metadata[:"x-goog-request-params"] ||= request_params_header - - options.apply_defaults timeout: @config.rpcs.create_notification_config.timeout, - metadata: metadata, - retry_policy: @config.rpcs.create_notification_config.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @security_center_stub.call_rpc :create_notification_config, request, options: options do |response, operation| - yield response, operation if block_given? - end - rescue ::GRPC::BadStatus => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Deletes an existing mute config. - # - # @overload delete_mute_config(request, options = nil) - # Pass arguments to `delete_mute_config` via a request object, either of type - # {::Google::Cloud::SecurityCenter::V1::DeleteMuteConfigRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::SecurityCenter::V1::DeleteMuteConfigRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_mute_config(name: nil) - # Pass arguments to `delete_mute_config` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param name [::String] - # Required. Name of the mute config to delete. Its format is - # `organizations/{organization}/muteConfigs/{config_id}`, - # `folders/{folder}/muteConfigs/{config_id}`, - # `projects/{project}/muteConfigs/{config_id}`, - # `organizations/{organization}/locations/global/muteConfigs/{config_id}`, - # `folders/{folder}/locations/global/muteConfigs/{config_id}`, or - # `projects/{project}/locations/global/muteConfigs/{config_id}`. - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Google::Protobuf::Empty] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Google::Protobuf::Empty] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/cloud/security_center/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::SecurityCenter::V1::SecurityCenter::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::SecurityCenter::V1::DeleteMuteConfigRequest.new - # - # # Call the delete_mute_config method. - # result = client.delete_mute_config request - # - # # The returned object is of type Google::Protobuf::Empty. - # p result - # - def delete_mute_config request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::SecurityCenter::V1::DeleteMuteConfigRequest - - # Converts hash 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_mute_config.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::SecurityCenter::V1::VERSION - metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - header_params = {} - if request.name - header_params["name"] = request.name - end - - request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") - metadata[:"x-goog-request-params"] ||= request_params_header - - options.apply_defaults timeout: @config.rpcs.delete_mute_config.timeout, - metadata: metadata, - retry_policy: @config.rpcs.delete_mute_config.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @security_center_stub.call_rpc :delete_mute_config, request, options: options do |response, operation| - yield response, operation if block_given? - end - rescue ::GRPC::BadStatus => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Deletes a notification config. - # - # @overload delete_notification_config(request, options = nil) - # Pass arguments to `delete_notification_config` via a request object, either of type - # {::Google::Cloud::SecurityCenter::V1::DeleteNotificationConfigRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::SecurityCenter::V1::DeleteNotificationConfigRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_notification_config(name: nil) - # Pass arguments to `delete_notification_config` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param name [::String] - # Required. Name of the notification config to delete. Its format is - # `organizations/[organization_id]/notificationConfigs/[config_id]`, - # `folders/[folder_id]/notificationConfigs/[config_id]`, - # or `projects/[project_id]/notificationConfigs/[config_id]`. - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Google::Protobuf::Empty] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Google::Protobuf::Empty] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/cloud/security_center/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::SecurityCenter::V1::SecurityCenter::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::SecurityCenter::V1::DeleteNotificationConfigRequest.new - # - # # Call the delete_notification_config method. - # result = client.delete_notification_config request - # - # # The returned object is of type Google::Protobuf::Empty. - # p result - # - def delete_notification_config request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::SecurityCenter::V1::DeleteNotificationConfigRequest - - # Converts hash 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_notification_config.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::SecurityCenter::V1::VERSION - metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - header_params = {} - if request.name - header_params["name"] = request.name - end - - request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") - metadata[:"x-goog-request-params"] ||= request_params_header - - options.apply_defaults timeout: @config.rpcs.delete_notification_config.timeout, - metadata: metadata, - retry_policy: @config.rpcs.delete_notification_config.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @security_center_stub.call_rpc :delete_notification_config, request, options: options do |response, operation| - yield response, operation if block_given? - end - rescue ::GRPC::BadStatus => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Deletes the specified SecurityHealthAnalyticsCustomModule and all of its - # descendants in the CRM hierarchy. This method is only supported for - # resident custom modules. - # - # @overload delete_security_health_analytics_custom_module(request, options = nil) - # Pass arguments to `delete_security_health_analytics_custom_module` via a request object, either of type - # {::Google::Cloud::SecurityCenter::V1::DeleteSecurityHealthAnalyticsCustomModuleRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::SecurityCenter::V1::DeleteSecurityHealthAnalyticsCustomModuleRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_security_health_analytics_custom_module(name: nil) - # Pass arguments to `delete_security_health_analytics_custom_module` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param name [::String] - # Required. Name of the custom module to delete. Its format is - # `organizations/{organization}/securityHealthAnalyticsSettings/customModules/{customModule}`, - # `folders/{folder}/securityHealthAnalyticsSettings/customModules/{customModule}`, - # or - # `projects/{project}/securityHealthAnalyticsSettings/customModules/{customModule}` - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Google::Protobuf::Empty] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Google::Protobuf::Empty] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/cloud/security_center/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::SecurityCenter::V1::SecurityCenter::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::SecurityCenter::V1::DeleteSecurityHealthAnalyticsCustomModuleRequest.new - # - # # Call the delete_security_health_analytics_custom_module method. - # result = client.delete_security_health_analytics_custom_module request - # - # # The returned object is of type Google::Protobuf::Empty. - # p result - # - def delete_security_health_analytics_custom_module request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::SecurityCenter::V1::DeleteSecurityHealthAnalyticsCustomModuleRequest - - # Converts hash 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_security_health_analytics_custom_module.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::SecurityCenter::V1::VERSION - metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - header_params = {} - if request.name - header_params["name"] = request.name - end - - request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") - metadata[:"x-goog-request-params"] ||= request_params_header - - options.apply_defaults timeout: @config.rpcs.delete_security_health_analytics_custom_module.timeout, - metadata: metadata, - retry_policy: @config.rpcs.delete_security_health_analytics_custom_module.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @security_center_stub.call_rpc :delete_security_health_analytics_custom_module, 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 - - ## - # Get the simulation by name or the latest simulation for the given - # organization. - # - # @overload get_simulation(request, options = nil) - # Pass arguments to `get_simulation` via a request object, either of type - # {::Google::Cloud::SecurityCenter::V1::GetSimulationRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::SecurityCenter::V1::GetSimulationRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_simulation(name: nil) - # Pass arguments to `get_simulation` via keyword arguments. Note that at - # least one keyword argument is 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 organization name or simulation name of this simulation - # - # Valid format: - # `organizations/{organization}/simulations/latest` - # `organizations/{organization}/simulations/{simulation}` - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Google::Cloud::SecurityCenter::V1::Simulation] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Google::Cloud::SecurityCenter::V1::Simulation] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/cloud/security_center/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::SecurityCenter::V1::SecurityCenter::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::SecurityCenter::V1::GetSimulationRequest.new - # - # # Call the get_simulation method. - # result = client.get_simulation request - # - # # The returned object is of type Google::Cloud::SecurityCenter::V1::Simulation. - # p result - # - def get_simulation request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::SecurityCenter::V1::GetSimulationRequest - - # Converts hash 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_simulation.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::SecurityCenter::V1::VERSION - metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - header_params = {} - if request.name - header_params["name"] = request.name - end - - request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") - metadata[:"x-goog-request-params"] ||= request_params_header - - options.apply_defaults timeout: @config.rpcs.get_simulation.timeout, - metadata: metadata, - retry_policy: @config.rpcs.get_simulation.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @security_center_stub.call_rpc :get_simulation, 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 - - ## - # Get the valued resource by name - # - # @overload get_valued_resource(request, options = nil) - # Pass arguments to `get_valued_resource` via a request object, either of type - # {::Google::Cloud::SecurityCenter::V1::GetValuedResourceRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::SecurityCenter::V1::GetValuedResourceRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_valued_resource(name: nil) - # Pass arguments to `get_valued_resource` via keyword arguments. Note that at - # least one keyword argument is 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 this valued resource - # - # Valid format: - # `organizations/{organization}/simulations/{simulation}/valuedResources/{valued_resource}` - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Google::Cloud::SecurityCenter::V1::ValuedResource] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Google::Cloud::SecurityCenter::V1::ValuedResource] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/cloud/security_center/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::SecurityCenter::V1::SecurityCenter::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::SecurityCenter::V1::GetValuedResourceRequest.new - # - # # Call the get_valued_resource method. - # result = client.get_valued_resource request - # - # # The returned object is of type Google::Cloud::SecurityCenter::V1::ValuedResource. - # p result - # - def get_valued_resource request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::SecurityCenter::V1::GetValuedResourceRequest - - # Converts hash 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_valued_resource.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::SecurityCenter::V1::VERSION - metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - header_params = {} - if request.name - header_params["name"] = request.name - end - - request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") - metadata[:"x-goog-request-params"] ||= request_params_header - - options.apply_defaults timeout: @config.rpcs.get_valued_resource.timeout, - metadata: metadata, - retry_policy: @config.rpcs.get_valued_resource.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @security_center_stub.call_rpc :get_valued_resource, request, options: options do |response, operation| - yield response, operation if block_given? - end - rescue ::GRPC::BadStatus => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Gets a BigQuery export. - # - # @overload get_big_query_export(request, options = nil) - # Pass arguments to `get_big_query_export` via a request object, either of type - # {::Google::Cloud::SecurityCenter::V1::GetBigQueryExportRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::SecurityCenter::V1::GetBigQueryExportRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_big_query_export(name: nil) - # Pass arguments to `get_big_query_export` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param name [::String] - # Required. Name of the BigQuery export to retrieve. Its format is - # `organizations/{organization}/bigQueryExports/{export_id}`, - # `folders/{folder}/bigQueryExports/{export_id}`, or - # `projects/{project}/bigQueryExports/{export_id}` - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Google::Cloud::SecurityCenter::V1::BigQueryExport] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Google::Cloud::SecurityCenter::V1::BigQueryExport] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/cloud/security_center/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::SecurityCenter::V1::SecurityCenter::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::SecurityCenter::V1::GetBigQueryExportRequest.new - # - # # Call the get_big_query_export method. - # result = client.get_big_query_export request - # - # # The returned object is of type Google::Cloud::SecurityCenter::V1::BigQueryExport. - # p result - # - def get_big_query_export request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::SecurityCenter::V1::GetBigQueryExportRequest - - # Converts hash 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_big_query_export.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::SecurityCenter::V1::VERSION - metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - header_params = {} - if request.name - header_params["name"] = request.name - end - - request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") - metadata[:"x-goog-request-params"] ||= request_params_header - - options.apply_defaults timeout: @config.rpcs.get_big_query_export.timeout, - metadata: metadata, - retry_policy: @config.rpcs.get_big_query_export.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @security_center_stub.call_rpc :get_big_query_export, request, options: options do |response, operation| - yield response, operation if block_given? - end - rescue ::GRPC::BadStatus => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Gets the access control policy on the specified Source. - # - # @overload get_iam_policy(request, options = nil) - # Pass arguments to `get_iam_policy` via a request object, either of type - # {::Google::Iam::V1::GetIamPolicyRequest} or an equivalent Hash. - # - # @param request [::Google::Iam::V1::GetIamPolicyRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. - # - # @overload get_iam_policy(resource: nil, options: nil) - # Pass arguments to `get_iam_policy` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param resource [::String] - # REQUIRED: The resource for which the policy is being requested. - # See the operation documentation for the appropriate value for this field. - # @param options [::Google::Iam::V1::GetPolicyOptions, ::Hash] - # OPTIONAL: A `GetPolicyOptions` object for specifying options to - # `GetIamPolicy`. - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Google::Iam::V1::Policy] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Google::Iam::V1::Policy] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/cloud/security_center/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::SecurityCenter::V1::SecurityCenter::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Iam::V1::GetIamPolicyRequest.new - # - # # Call the get_iam_policy method. - # result = client.get_iam_policy request - # - # # The returned object is of type Google::Iam::V1::Policy. - # p result - # - def get_iam_policy request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Iam::V1::GetIamPolicyRequest - - # Converts hash and nil to an options object - options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h - - # Customize the options with defaults - metadata = @config.rpcs.get_iam_policy.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::SecurityCenter::V1::VERSION - metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - header_params = {} - if request.resource - header_params["resource"] = request.resource - end - - request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") - metadata[:"x-goog-request-params"] ||= request_params_header - - options.apply_defaults timeout: @config.rpcs.get_iam_policy.timeout, - metadata: metadata, - retry_policy: @config.rpcs.get_iam_policy.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @security_center_stub.call_rpc :get_iam_policy, request, options: options do |response, operation| - yield response, operation if block_given? - end - rescue ::GRPC::BadStatus => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Gets a mute config. - # - # @overload get_mute_config(request, options = nil) - # Pass arguments to `get_mute_config` via a request object, either of type - # {::Google::Cloud::SecurityCenter::V1::GetMuteConfigRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::SecurityCenter::V1::GetMuteConfigRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_mute_config(name: nil) - # Pass arguments to `get_mute_config` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param name [::String] - # Required. Name of the mute config to retrieve. Its format is - # `organizations/{organization}/muteConfigs/{config_id}`, - # `folders/{folder}/muteConfigs/{config_id}`, - # `projects/{project}/muteConfigs/{config_id}`, - # `organizations/{organization}/locations/global/muteConfigs/{config_id}`, - # `folders/{folder}/locations/global/muteConfigs/{config_id}`, or - # `projects/{project}/locations/global/muteConfigs/{config_id}`. - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Google::Cloud::SecurityCenter::V1::MuteConfig] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Google::Cloud::SecurityCenter::V1::MuteConfig] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/cloud/security_center/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::SecurityCenter::V1::SecurityCenter::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::SecurityCenter::V1::GetMuteConfigRequest.new - # - # # Call the get_mute_config method. - # result = client.get_mute_config request - # - # # The returned object is of type Google::Cloud::SecurityCenter::V1::MuteConfig. - # p result - # - def get_mute_config request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::SecurityCenter::V1::GetMuteConfigRequest - - # Converts hash 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_mute_config.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::SecurityCenter::V1::VERSION - metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - header_params = {} - if request.name - header_params["name"] = request.name - end - - request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") - metadata[:"x-goog-request-params"] ||= request_params_header - - options.apply_defaults timeout: @config.rpcs.get_mute_config.timeout, - metadata: metadata, - retry_policy: @config.rpcs.get_mute_config.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @security_center_stub.call_rpc :get_mute_config, request, options: options do |response, operation| - yield response, operation if block_given? - end - rescue ::GRPC::BadStatus => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Gets a notification config. - # - # @overload get_notification_config(request, options = nil) - # Pass arguments to `get_notification_config` via a request object, either of type - # {::Google::Cloud::SecurityCenter::V1::GetNotificationConfigRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::SecurityCenter::V1::GetNotificationConfigRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_notification_config(name: nil) - # Pass arguments to `get_notification_config` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param name [::String] - # Required. Name of the notification config to get. Its format is - # `organizations/[organization_id]/notificationConfigs/[config_id]`, - # `folders/[folder_id]/notificationConfigs/[config_id]`, - # or `projects/[project_id]/notificationConfigs/[config_id]`. - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Google::Cloud::SecurityCenter::V1::NotificationConfig] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Google::Cloud::SecurityCenter::V1::NotificationConfig] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/cloud/security_center/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::SecurityCenter::V1::SecurityCenter::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::SecurityCenter::V1::GetNotificationConfigRequest.new - # - # # Call the get_notification_config method. - # result = client.get_notification_config request - # - # # The returned object is of type Google::Cloud::SecurityCenter::V1::NotificationConfig. - # p result - # - def get_notification_config request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::SecurityCenter::V1::GetNotificationConfigRequest - - # Converts hash 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_notification_config.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::SecurityCenter::V1::VERSION - metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - header_params = {} - if request.name - header_params["name"] = request.name - end - - request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") - metadata[:"x-goog-request-params"] ||= request_params_header - - options.apply_defaults timeout: @config.rpcs.get_notification_config.timeout, - metadata: metadata, - retry_policy: @config.rpcs.get_notification_config.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @security_center_stub.call_rpc :get_notification_config, request, options: options do |response, operation| - yield response, operation if block_given? - end - rescue ::GRPC::BadStatus => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Gets the settings for an organization. - # - # @overload get_organization_settings(request, options = nil) - # Pass arguments to `get_organization_settings` via a request object, either of type - # {::Google::Cloud::SecurityCenter::V1::GetOrganizationSettingsRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::SecurityCenter::V1::GetOrganizationSettingsRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. - # - # @overload get_organization_settings(name: nil) - # Pass arguments to `get_organization_settings` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param name [::String] - # Required. Name of the organization to get organization settings for. Its - # format is `organizations/[organization_id]/organizationSettings`. - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Google::Cloud::SecurityCenter::V1::OrganizationSettings] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Google::Cloud::SecurityCenter::V1::OrganizationSettings] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/cloud/security_center/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::SecurityCenter::V1::SecurityCenter::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::SecurityCenter::V1::GetOrganizationSettingsRequest.new - # - # # Call the get_organization_settings method. - # result = client.get_organization_settings request - # - # # The returned object is of type Google::Cloud::SecurityCenter::V1::OrganizationSettings. - # p result - # - def get_organization_settings request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::SecurityCenter::V1::GetOrganizationSettingsRequest - - # Converts hash and nil to an options object - options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h - - # Customize the options with defaults - metadata = @config.rpcs.get_organization_settings.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::SecurityCenter::V1::VERSION - metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - header_params = {} - if request.name - header_params["name"] = request.name - end - - request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") - metadata[:"x-goog-request-params"] ||= request_params_header - - options.apply_defaults timeout: @config.rpcs.get_organization_settings.timeout, - metadata: metadata, - retry_policy: @config.rpcs.get_organization_settings.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @security_center_stub.call_rpc :get_organization_settings, request, options: options do |response, operation| - yield response, operation if block_given? - end - rescue ::GRPC::BadStatus => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Retrieves an EffectiveSecurityHealthAnalyticsCustomModule. - # - # @overload get_effective_security_health_analytics_custom_module(request, options = nil) - # Pass arguments to `get_effective_security_health_analytics_custom_module` via a request object, either of type - # {::Google::Cloud::SecurityCenter::V1::GetEffectiveSecurityHealthAnalyticsCustomModuleRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::SecurityCenter::V1::GetEffectiveSecurityHealthAnalyticsCustomModuleRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_effective_security_health_analytics_custom_module(name: nil) - # Pass arguments to `get_effective_security_health_analytics_custom_module` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param name [::String] - # Required. Name of the effective custom module to get. Its format is - # `organizations/{organization}/securityHealthAnalyticsSettings/effectiveCustomModules/{customModule}`, - # `folders/{folder}/securityHealthAnalyticsSettings/effectiveCustomModules/{customModule}`, - # or - # `projects/{project}/securityHealthAnalyticsSettings/effectiveCustomModules/{customModule}` - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Google::Cloud::SecurityCenter::V1::EffectiveSecurityHealthAnalyticsCustomModule] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Google::Cloud::SecurityCenter::V1::EffectiveSecurityHealthAnalyticsCustomModule] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/cloud/security_center/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::SecurityCenter::V1::SecurityCenter::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::SecurityCenter::V1::GetEffectiveSecurityHealthAnalyticsCustomModuleRequest.new - # - # # Call the get_effective_security_health_analytics_custom_module method. - # result = client.get_effective_security_health_analytics_custom_module request - # - # # The returned object is of type Google::Cloud::SecurityCenter::V1::EffectiveSecurityHealthAnalyticsCustomModule. - # p result - # - def get_effective_security_health_analytics_custom_module request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::SecurityCenter::V1::GetEffectiveSecurityHealthAnalyticsCustomModuleRequest - - # Converts hash 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_effective_security_health_analytics_custom_module.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::SecurityCenter::V1::VERSION - metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - header_params = {} - if request.name - header_params["name"] = request.name - end - - request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") - metadata[:"x-goog-request-params"] ||= request_params_header - - options.apply_defaults timeout: @config.rpcs.get_effective_security_health_analytics_custom_module.timeout, - metadata: metadata, - retry_policy: @config.rpcs.get_effective_security_health_analytics_custom_module.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @security_center_stub.call_rpc :get_effective_security_health_analytics_custom_module, request, options: options do |response, operation| - yield response, operation if block_given? - end - rescue ::GRPC::BadStatus => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Retrieves a SecurityHealthAnalyticsCustomModule. - # - # @overload get_security_health_analytics_custom_module(request, options = nil) - # Pass arguments to `get_security_health_analytics_custom_module` via a request object, either of type - # {::Google::Cloud::SecurityCenter::V1::GetSecurityHealthAnalyticsCustomModuleRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::SecurityCenter::V1::GetSecurityHealthAnalyticsCustomModuleRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_security_health_analytics_custom_module(name: nil) - # Pass arguments to `get_security_health_analytics_custom_module` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param name [::String] - # Required. Name of the custom module to get. Its format is - # `organizations/{organization}/securityHealthAnalyticsSettings/customModules/{customModule}`, - # `folders/{folder}/securityHealthAnalyticsSettings/customModules/{customModule}`, - # or - # `projects/{project}/securityHealthAnalyticsSettings/customModules/{customModule}` - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Google::Cloud::SecurityCenter::V1::SecurityHealthAnalyticsCustomModule] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Google::Cloud::SecurityCenter::V1::SecurityHealthAnalyticsCustomModule] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/cloud/security_center/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::SecurityCenter::V1::SecurityCenter::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::SecurityCenter::V1::GetSecurityHealthAnalyticsCustomModuleRequest.new - # - # # Call the get_security_health_analytics_custom_module method. - # result = client.get_security_health_analytics_custom_module request - # - # # The returned object is of type Google::Cloud::SecurityCenter::V1::SecurityHealthAnalyticsCustomModule. - # p result - # - def get_security_health_analytics_custom_module request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::SecurityCenter::V1::GetSecurityHealthAnalyticsCustomModuleRequest - - # Converts hash 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_security_health_analytics_custom_module.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::SecurityCenter::V1::VERSION - metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - header_params = {} - if request.name - header_params["name"] = request.name - end - - request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") - metadata[:"x-goog-request-params"] ||= request_params_header - - options.apply_defaults timeout: @config.rpcs.get_security_health_analytics_custom_module.timeout, - metadata: metadata, - retry_policy: @config.rpcs.get_security_health_analytics_custom_module.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @security_center_stub.call_rpc :get_security_health_analytics_custom_module, request, options: options do |response, operation| - yield response, operation if block_given? - end - rescue ::GRPC::BadStatus => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Gets a source. - # - # @overload get_source(request, options = nil) - # Pass arguments to `get_source` via a request object, either of type - # {::Google::Cloud::SecurityCenter::V1::GetSourceRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::SecurityCenter::V1::GetSourceRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_source(name: nil) - # Pass arguments to `get_source` via keyword arguments. Note that at - # least one keyword argument is 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. Relative resource name of the source. Its format is - # `organizations/[organization_id]/source/[source_id]`. - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Google::Cloud::SecurityCenter::V1::Source] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Google::Cloud::SecurityCenter::V1::Source] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/cloud/security_center/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::SecurityCenter::V1::SecurityCenter::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::SecurityCenter::V1::GetSourceRequest.new - # - # # Call the get_source method. - # result = client.get_source request - # - # # The returned object is of type Google::Cloud::SecurityCenter::V1::Source. - # p result - # - def get_source request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::SecurityCenter::V1::GetSourceRequest - - # Converts hash 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_source.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::SecurityCenter::V1::VERSION - metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - header_params = {} - if request.name - header_params["name"] = request.name - end - - request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") - metadata[:"x-goog-request-params"] ||= request_params_header - - options.apply_defaults timeout: @config.rpcs.get_source.timeout, - metadata: metadata, - retry_policy: @config.rpcs.get_source.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @security_center_stub.call_rpc :get_source, 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 - - ## - # Filters an organization's assets and groups them by their specified - # properties. - # - # @deprecated This method is deprecated and may be removed in the next major version update. - # - # @overload group_assets(request, options = nil) - # Pass arguments to `group_assets` via a request object, either of type - # {::Google::Cloud::SecurityCenter::V1::GroupAssetsRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::SecurityCenter::V1::GroupAssetsRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. - # - # @overload group_assets(parent: nil, filter: nil, group_by: nil, compare_duration: nil, read_time: nil, page_token: nil, page_size: nil) - # Pass arguments to `group_assets` via keyword arguments. Note that at - # least one keyword argument is 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 name of the parent to group the assets by. Its format is - # `organizations/[organization_id]`, `folders/[folder_id]`, or - # `projects/[project_id]`. - # @param filter [::String] - # Expression that defines the filter to apply across assets. - # The expression is a list of zero or more restrictions combined via logical - # operators `AND` and `OR`. - # Parentheses are supported, and `OR` has higher precedence than `AND`. - # - # Restrictions have the form ` ` and may have a `-` - # character in front of them to indicate negation. The fields map to those - # defined in the Asset resource. Examples include: - # - # * name - # * security_center_properties.resource_name - # * resource_properties.a_property - # * security_marks.marks.marka - # - # The supported operators are: - # - # * `=` for all value types. - # * `>`, `<`, `>=`, `<=` for integer values. - # * `:`, meaning substring matching, for strings. - # - # The supported value types are: - # - # * string literals in quotes. - # * integer literals without quotes. - # * boolean literals `true` and `false` without quotes. - # - # The following field and operator combinations are supported: - # - # * name: `=` - # * update_time: `=`, `>`, `<`, `>=`, `<=` - # - # Usage: This should be milliseconds since epoch or an RFC3339 string. - # Examples: - # `update_time = "2019-06-10T16:07:18-07:00"` - # `update_time = 1560208038000` - # - # * create_time: `=`, `>`, `<`, `>=`, `<=` - # - # Usage: This should be milliseconds since epoch or an RFC3339 string. - # Examples: - # `create_time = "2019-06-10T16:07:18-07:00"` - # `create_time = 1560208038000` - # - # * iam_policy.policy_blob: `=`, `:` - # * resource_properties: `=`, `:`, `>`, `<`, `>=`, `<=` - # * security_marks.marks: `=`, `:` - # * security_center_properties.resource_name: `=`, `:` - # * security_center_properties.resource_display_name: `=`, `:` - # * security_center_properties.resource_type: `=`, `:` - # * security_center_properties.resource_parent: `=`, `:` - # * security_center_properties.resource_parent_display_name: `=`, `:` - # * security_center_properties.resource_project: `=`, `:` - # * security_center_properties.resource_project_display_name: `=`, `:` - # * security_center_properties.resource_owners: `=`, `:` - # - # For example, `resource_properties.size = 100` is a valid filter string. - # - # Use a partial match on the empty string to filter based on a property - # existing: `resource_properties.my_property : ""` - # - # Use a negated partial match on the empty string to filter based on a - # property not existing: `-resource_properties.my_property : ""` - # @param group_by [::String] - # Required. Expression that defines what assets fields to use for grouping. - # The string value should follow SQL syntax: comma separated list of fields. - # For example: - # "security_center_properties.resource_project,security_center_properties.project". - # - # The following fields are supported when compare_duration is not set: - # - # * security_center_properties.resource_project - # * security_center_properties.resource_project_display_name - # * security_center_properties.resource_type - # * security_center_properties.resource_parent - # * security_center_properties.resource_parent_display_name - # - # The following fields are supported when compare_duration is set: - # - # * security_center_properties.resource_type - # * security_center_properties.resource_project_display_name - # * security_center_properties.resource_parent_display_name - # @param compare_duration [::Google::Protobuf::Duration, ::Hash] - # When compare_duration is set, the GroupResult's "state_change" property is - # updated to indicate whether the asset was added, removed, or remained - # present during the compare_duration period of time that precedes the - # read_time. This is the time between (read_time - compare_duration) and - # read_time. - # - # The state change value is derived based on the presence of the asset at the - # two points in time. Intermediate state changes between the two times don't - # affect the result. For example, the results aren't affected if the asset is - # removed and re-created again. - # - # Possible "state_change" values when compare_duration is specified: - # - # * "ADDED": indicates that the asset was not present at the start of - # compare_duration, but present at reference_time. - # * "REMOVED": indicates that the asset was present at the start of - # compare_duration, but not present at reference_time. - # * "ACTIVE": indicates that the asset was present at both the - # start and the end of the time period defined by - # compare_duration and reference_time. - # - # If compare_duration is not specified, then the only possible state_change - # is "UNUSED", which will be the state_change set for all assets present at - # read_time. - # - # If this field is set then `state_change` must be a specified field in - # `group_by`. - # @param read_time [::Google::Protobuf::Timestamp, ::Hash] - # Time used as a reference point when filtering assets. The filter is limited - # to assets existing at the supplied time and their values are those at that - # specific time. Absence of this field will default to the API's version of - # NOW. - # @param page_token [::String] - # The value returned by the last `GroupAssetsResponse`; indicates - # that this is a continuation of a prior `GroupAssets` call, and that the - # system should return the next page of data. - # @param page_size [::Integer] - # The maximum number of results to return in a single response. Default is - # 10, minimum is 1, maximum is 1000. - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Gapic::PagedEnumerable<::Google::Cloud::SecurityCenter::V1::GroupResult>] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Gapic::PagedEnumerable<::Google::Cloud::SecurityCenter::V1::GroupResult>] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/cloud/security_center/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::SecurityCenter::V1::SecurityCenter::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::SecurityCenter::V1::GroupAssetsRequest.new - # - # # Call the group_assets method. - # result = client.group_assets request - # - # # The returned object is of type Gapic::PagedEnumerable. You can iterate - # # over elements, and API calls will be issued to fetch pages as needed. - # result.each do |item| - # # Each element is of type ::Google::Cloud::SecurityCenter::V1::GroupResult. - # p item - # end - # - def group_assets request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::SecurityCenter::V1::GroupAssetsRequest - - # Converts hash 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.group_assets.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::SecurityCenter::V1::VERSION - metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - header_params = {} - if request.parent - header_params["parent"] = request.parent - end - - request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") - metadata[:"x-goog-request-params"] ||= request_params_header - - options.apply_defaults timeout: @config.rpcs.group_assets.timeout, - metadata: metadata, - retry_policy: @config.rpcs.group_assets.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @security_center_stub.call_rpc :group_assets, request, options: options do |response, operation| - response = ::Gapic::PagedEnumerable.new @security_center_stub, :group_assets, 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 - - ## - # Filters an organization or source's findings and groups them by their - # specified properties. - # - # To group across all sources provide a `-` as the source id. - # Example: /v1/organizations/\\{organization_id}/sources/-/findings, - # /v1/folders/\\{folder_id}/sources/-/findings, - # /v1/projects/\\{project_id}/sources/-/findings - # - # @overload group_findings(request, options = nil) - # Pass arguments to `group_findings` via a request object, either of type - # {::Google::Cloud::SecurityCenter::V1::GroupFindingsRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::SecurityCenter::V1::GroupFindingsRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. - # - # @overload group_findings(parent: nil, filter: nil, group_by: nil, read_time: nil, compare_duration: nil, page_token: nil, page_size: nil) - # Pass arguments to `group_findings` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param parent [::String] - # Required. Name of the source to groupBy. Its format is - # `organizations/[organization_id]/sources/[source_id]`, - # `folders/[folder_id]/sources/[source_id]`, or - # `projects/[project_id]/sources/[source_id]`. To groupBy across all sources - # provide a source_id of `-`. For example: - # `organizations/{organization_id}/sources/-, folders/{folder_id}/sources/-`, - # or `projects/{project_id}/sources/-` - # @param filter [::String] - # Expression that defines the filter to apply across findings. - # The expression is a list of one or more restrictions combined via logical - # operators `AND` and `OR`. - # Parentheses are supported, and `OR` has higher precedence than `AND`. - # - # Restrictions have the form ` ` and may have a `-` - # character in front of them to indicate negation. Examples include: - # - # * name - # * source_properties.a_property - # * security_marks.marks.marka - # - # The supported operators are: - # - # * `=` for all value types. - # * `>`, `<`, `>=`, `<=` for integer values. - # * `:`, meaning substring matching, for strings. - # - # The supported value types are: - # - # * string literals in quotes. - # * integer literals without quotes. - # * boolean literals `true` and `false` without quotes. - # - # The following field and operator combinations are supported: - # - # * name: `=` - # * parent: `=`, `:` - # * resource_name: `=`, `:` - # * state: `=`, `:` - # * category: `=`, `:` - # * external_uri: `=`, `:` - # * event_time: `=`, `>`, `<`, `>=`, `<=` - # - # Usage: This should be milliseconds since epoch or an RFC3339 string. - # Examples: - # `event_time = "2019-06-10T16:07:18-07:00"` - # `event_time = 1560208038000` - # - # * severity: `=`, `:` - # * workflow_state: `=`, `:` - # * security_marks.marks: `=`, `:` - # * source_properties: `=`, `:`, `>`, `<`, `>=`, `<=` - # - # For example, `source_properties.size = 100` is a valid filter string. - # - # Use a partial match on the empty string to filter based on a property - # existing: `source_properties.my_property : ""` - # - # Use a negated partial match on the empty string to filter based on a - # property not existing: `-source_properties.my_property : ""` - # - # * resource: - # * resource.name: `=`, `:` - # * resource.parent_name: `=`, `:` - # * resource.parent_display_name: `=`, `:` - # * resource.project_name: `=`, `:` - # * resource.project_display_name: `=`, `:` - # * resource.type: `=`, `:` - # @param group_by [::String] - # Required. Expression that defines what assets fields to use for grouping - # (including `state_change`). The string value should follow SQL syntax: - # comma separated list of fields. For example: "parent,resource_name". - # - # The following fields are supported when compare_duration is set: - # - # * state_change - # @param read_time [::Google::Protobuf::Timestamp, ::Hash] - # Time used as a reference point when filtering findings. The filter is - # limited to findings existing at the supplied time and their values are - # those at that specific time. Absence of this field will default to the - # API's version of NOW. - # @param compare_duration [::Google::Protobuf::Duration, ::Hash] - # When compare_duration is set, the GroupResult's "state_change" attribute is - # updated to indicate whether the finding had its state changed, the - # finding's state remained unchanged, or if the finding was added during the - # compare_duration period of time that precedes the read_time. This is the - # time between (read_time - compare_duration) and read_time. - # - # The state_change value is derived based on the presence and state of the - # finding at the two points in time. Intermediate state changes between the - # two times don't affect the result. For example, the results aren't affected - # if the finding is made inactive and then active again. - # - # Possible "state_change" values when compare_duration is specified: - # - # * "CHANGED": indicates that the finding was present and matched the given - # filter at the start of compare_duration, but changed its - # state at read_time. - # * "UNCHANGED": indicates that the finding was present and matched the given - # filter at the start of compare_duration and did not change - # state at read_time. - # * "ADDED": indicates that the finding did not match the given filter or - # was not present at the start of compare_duration, but was - # present at read_time. - # * "REMOVED": indicates that the finding was present and matched the - # filter at the start of compare_duration, but did not match - # the filter at read_time. - # - # If compare_duration is not specified, then the only possible state_change - # is "UNUSED", which will be the state_change set for all findings present - # at read_time. - # - # If this field is set then `state_change` must be a specified field in - # `group_by`. - # @param page_token [::String] - # The value returned by the last `GroupFindingsResponse`; indicates - # that this is a continuation of a prior `GroupFindings` call, and - # that the system should return the next page of data. - # @param page_size [::Integer] - # The maximum number of results to return in a single response. Default is - # 10, minimum is 1, maximum is 1000. - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Gapic::PagedEnumerable<::Google::Cloud::SecurityCenter::V1::GroupResult>] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Gapic::PagedEnumerable<::Google::Cloud::SecurityCenter::V1::GroupResult>] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/cloud/security_center/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::SecurityCenter::V1::SecurityCenter::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::SecurityCenter::V1::GroupFindingsRequest.new - # - # # Call the group_findings method. - # result = client.group_findings request - # - # # The returned object is of type Gapic::PagedEnumerable. You can iterate - # # over elements, and API calls will be issued to fetch pages as needed. - # result.each do |item| - # # Each element is of type ::Google::Cloud::SecurityCenter::V1::GroupResult. - # p item - # end - # - def group_findings request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::SecurityCenter::V1::GroupFindingsRequest - - # Converts hash 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.group_findings.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::SecurityCenter::V1::VERSION - metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - header_params = {} - if request.parent - header_params["parent"] = request.parent - end - - request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") - metadata[:"x-goog-request-params"] ||= request_params_header - - options.apply_defaults timeout: @config.rpcs.group_findings.timeout, - metadata: metadata, - retry_policy: @config.rpcs.group_findings.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @security_center_stub.call_rpc :group_findings, request, options: options do |response, operation| - response = ::Gapic::PagedEnumerable.new @security_center_stub, :group_findings, 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 - - ## - # Lists an organization's assets. - # - # @deprecated This method is deprecated and may be removed in the next major version update. - # - # @overload list_assets(request, options = nil) - # Pass arguments to `list_assets` via a request object, either of type - # {::Google::Cloud::SecurityCenter::V1::ListAssetsRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::SecurityCenter::V1::ListAssetsRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_assets(parent: nil, filter: nil, order_by: nil, read_time: nil, compare_duration: nil, field_mask: nil, page_token: nil, page_size: nil) - # Pass arguments to `list_assets` via keyword arguments. Note that at - # least one keyword argument is 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 name of the parent resource that contains the assets. The - # value that you can specify on parent depends on the method in which you - # specify parent. You can specify one of the following values: - # `organizations/[organization_id]`, `folders/[folder_id]`, or - # `projects/[project_id]`. - # @param filter [::String] - # Expression that defines the filter to apply across assets. - # The expression is a list of zero or more restrictions combined via logical - # operators `AND` and `OR`. - # Parentheses are supported, and `OR` has higher precedence than `AND`. - # - # Restrictions have the form ` ` and may have a `-` - # character in front of them to indicate negation. The fields map to those - # defined in the Asset resource. Examples include: - # - # * name - # * security_center_properties.resource_name - # * resource_properties.a_property - # * security_marks.marks.marka - # - # The supported operators are: - # - # * `=` for all value types. - # * `>`, `<`, `>=`, `<=` for integer values. - # * `:`, meaning substring matching, for strings. - # - # The supported value types are: - # - # * string literals in quotes. - # * integer literals without quotes. - # * boolean literals `true` and `false` without quotes. - # - # The following are the allowed field and operator combinations: - # - # * name: `=` - # * update_time: `=`, `>`, `<`, `>=`, `<=` - # - # Usage: This should be milliseconds since epoch or an RFC3339 string. - # Examples: - # `update_time = "2019-06-10T16:07:18-07:00"` - # `update_time = 1560208038000` - # - # * create_time: `=`, `>`, `<`, `>=`, `<=` - # - # Usage: This should be milliseconds since epoch or an RFC3339 string. - # Examples: - # `create_time = "2019-06-10T16:07:18-07:00"` - # `create_time = 1560208038000` - # - # * iam_policy.policy_blob: `=`, `:` - # * resource_properties: `=`, `:`, `>`, `<`, `>=`, `<=` - # * security_marks.marks: `=`, `:` - # * security_center_properties.resource_name: `=`, `:` - # * security_center_properties.resource_display_name: `=`, `:` - # * security_center_properties.resource_type: `=`, `:` - # * security_center_properties.resource_parent: `=`, `:` - # * security_center_properties.resource_parent_display_name: `=`, `:` - # * security_center_properties.resource_project: `=`, `:` - # * security_center_properties.resource_project_display_name: `=`, `:` - # * security_center_properties.resource_owners: `=`, `:` - # - # For example, `resource_properties.size = 100` is a valid filter string. - # - # Use a partial match on the empty string to filter based on a property - # existing: `resource_properties.my_property : ""` - # - # Use a negated partial match on the empty string to filter based on a - # property not existing: `-resource_properties.my_property : ""` - # @param order_by [::String] - # Expression that defines what fields and order to use for sorting. The - # string value should follow SQL syntax: comma separated list of fields. For - # example: "name,resource_properties.a_property". The default sorting order - # is ascending. To specify descending order for a field, a suffix " desc" - # should be appended to the field name. For example: "name - # desc,resource_properties.a_property". Redundant space characters in the - # syntax are insignificant. "name desc,resource_properties.a_property" and " - # name desc , resource_properties.a_property " are equivalent. - # - # The following fields are supported: - # name - # update_time - # resource_properties - # security_marks.marks - # security_center_properties.resource_name - # security_center_properties.resource_display_name - # security_center_properties.resource_parent - # security_center_properties.resource_parent_display_name - # security_center_properties.resource_project - # security_center_properties.resource_project_display_name - # security_center_properties.resource_type - # @param read_time [::Google::Protobuf::Timestamp, ::Hash] - # Time used as a reference point when filtering assets. The filter is limited - # to assets existing at the supplied time and their values are those at that - # specific time. Absence of this field will default to the API's version of - # NOW. - # @param compare_duration [::Google::Protobuf::Duration, ::Hash] - # When compare_duration is set, the ListAssetsResult's "state_change" - # attribute is updated to indicate whether the asset was added, removed, or - # remained present during the compare_duration period of time that precedes - # the read_time. This is the time between (read_time - compare_duration) and - # read_time. - # - # The state_change value is derived based on the presence of the asset at the - # two points in time. Intermediate state changes between the two times don't - # affect the result. For example, the results aren't affected if the asset is - # removed and re-created again. - # - # Possible "state_change" values when compare_duration is specified: - # - # * "ADDED": indicates that the asset was not present at the start of - # compare_duration, but present at read_time. - # * "REMOVED": indicates that the asset was present at the start of - # compare_duration, but not present at read_time. - # * "ACTIVE": indicates that the asset was present at both the - # start and the end of the time period defined by - # compare_duration and read_time. - # - # If compare_duration is not specified, then the only possible state_change - # is "UNUSED", which will be the state_change set for all assets present at - # read_time. - # @param field_mask [::Google::Protobuf::FieldMask, ::Hash] - # A field mask to specify the ListAssetsResult fields to be listed in the - # response. - # An empty field mask will list all fields. - # @param page_token [::String] - # The value returned by the last `ListAssetsResponse`; indicates - # that this is a continuation of a prior `ListAssets` call, and - # that the system should return the next page of data. - # @param page_size [::Integer] - # The maximum number of results to return in a single response. Default is - # 10, minimum is 1, maximum is 1000. - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Gapic::PagedEnumerable<::Google::Cloud::SecurityCenter::V1::ListAssetsResponse::ListAssetsResult>] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Gapic::PagedEnumerable<::Google::Cloud::SecurityCenter::V1::ListAssetsResponse::ListAssetsResult>] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/cloud/security_center/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::SecurityCenter::V1::SecurityCenter::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::SecurityCenter::V1::ListAssetsRequest.new - # - # # Call the list_assets method. - # result = client.list_assets request - # - # # The returned object is of type Gapic::PagedEnumerable. You can iterate - # # over elements, and API calls will be issued to fetch pages as needed. - # result.each do |item| - # # Each element is of type ::Google::Cloud::SecurityCenter::V1::ListAssetsResponse::ListAssetsResult. - # p item - # end - # - def list_assets request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::SecurityCenter::V1::ListAssetsRequest - - # Converts hash 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_assets.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::SecurityCenter::V1::VERSION - metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - header_params = {} - if request.parent - header_params["parent"] = request.parent - end - - request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") - metadata[:"x-goog-request-params"] ||= request_params_header - - options.apply_defaults timeout: @config.rpcs.list_assets.timeout, - metadata: metadata, - retry_policy: @config.rpcs.list_assets.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @security_center_stub.call_rpc :list_assets, request, options: options do |response, operation| - response = ::Gapic::PagedEnumerable.new @security_center_stub, :list_assets, 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 a list of all resident SecurityHealthAnalyticsCustomModules under - # the given CRM parent and all of the parent’s CRM descendants. - # - # @overload list_descendant_security_health_analytics_custom_modules(request, options = nil) - # Pass arguments to `list_descendant_security_health_analytics_custom_modules` via a request object, either of type - # {::Google::Cloud::SecurityCenter::V1::ListDescendantSecurityHealthAnalyticsCustomModulesRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::SecurityCenter::V1::ListDescendantSecurityHealthAnalyticsCustomModulesRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_descendant_security_health_analytics_custom_modules(parent: nil, page_size: nil, page_token: nil) - # Pass arguments to `list_descendant_security_health_analytics_custom_modules` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param parent [::String] - # Required. Name of parent to list descendant custom modules. Its format is - # `organizations/{organization}/securityHealthAnalyticsSettings`, - # `folders/{folder}/securityHealthAnalyticsSettings`, or - # `projects/{project}/securityHealthAnalyticsSettings` - # @param page_size [::Integer] - # The maximum number of results to return in a single response. Default is - # 10, minimum is 1, maximum is 1000. - # @param page_token [::String] - # The value returned by the last call indicating a continuation - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Gapic::PagedEnumerable<::Google::Cloud::SecurityCenter::V1::SecurityHealthAnalyticsCustomModule>] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Gapic::PagedEnumerable<::Google::Cloud::SecurityCenter::V1::SecurityHealthAnalyticsCustomModule>] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/cloud/security_center/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::SecurityCenter::V1::SecurityCenter::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::SecurityCenter::V1::ListDescendantSecurityHealthAnalyticsCustomModulesRequest.new - # - # # Call the list_descendant_security_health_analytics_custom_modules method. - # result = client.list_descendant_security_health_analytics_custom_modules request - # - # # The returned object is of type Gapic::PagedEnumerable. You can iterate - # # over elements, and API calls will be issued to fetch pages as needed. - # result.each do |item| - # # Each element is of type ::Google::Cloud::SecurityCenter::V1::SecurityHealthAnalyticsCustomModule. - # p item - # end - # - def list_descendant_security_health_analytics_custom_modules request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::SecurityCenter::V1::ListDescendantSecurityHealthAnalyticsCustomModulesRequest - - # Converts hash 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_descendant_security_health_analytics_custom_modules.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::SecurityCenter::V1::VERSION - metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - header_params = {} - if request.parent - header_params["parent"] = request.parent - end - - request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") - metadata[:"x-goog-request-params"] ||= request_params_header - - options.apply_defaults timeout: @config.rpcs.list_descendant_security_health_analytics_custom_modules.timeout, - metadata: metadata, - retry_policy: @config.rpcs.list_descendant_security_health_analytics_custom_modules.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @security_center_stub.call_rpc :list_descendant_security_health_analytics_custom_modules, request, options: options do |response, operation| - response = ::Gapic::PagedEnumerable.new @security_center_stub, :list_descendant_security_health_analytics_custom_modules, 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 - - ## - # Lists an organization or source's findings. - # - # To list across all sources provide a `-` as the source id. - # Example: /v1/organizations/\\{organization_id}/sources/-/findings - # - # @overload list_findings(request, options = nil) - # Pass arguments to `list_findings` via a request object, either of type - # {::Google::Cloud::SecurityCenter::V1::ListFindingsRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::SecurityCenter::V1::ListFindingsRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_findings(parent: nil, filter: nil, order_by: nil, read_time: nil, compare_duration: nil, field_mask: nil, page_token: nil, page_size: nil) - # Pass arguments to `list_findings` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param parent [::String] - # Required. Name of the source the findings belong to. Its format is - # `organizations/[organization_id]/sources/[source_id]`, - # `folders/[folder_id]/sources/[source_id]`, or - # `projects/[project_id]/sources/[source_id]`. To list across all sources - # provide a source_id of `-`. For example: - # `organizations/{organization_id}/sources/-`, - # `folders/{folder_id}/sources/-` or `projects/{projects_id}/sources/-` - # @param filter [::String] - # Expression that defines the filter to apply across findings. - # The expression is a list of one or more restrictions combined via logical - # operators `AND` and `OR`. - # Parentheses are supported, and `OR` has higher precedence than `AND`. - # - # Restrictions have the form ` ` and may have a `-` - # character in front of them to indicate negation. Examples include: - # - # * name - # * source_properties.a_property - # * security_marks.marks.marka - # - # The supported operators are: - # - # * `=` for all value types. - # * `>`, `<`, `>=`, `<=` for integer values. - # * `:`, meaning substring matching, for strings. - # - # The supported value types are: - # - # * string literals in quotes. - # * integer literals without quotes. - # * boolean literals `true` and `false` without quotes. - # - # The following field and operator combinations are supported: - # - # * name: `=` - # * parent: `=`, `:` - # * resource_name: `=`, `:` - # * state: `=`, `:` - # * category: `=`, `:` - # * external_uri: `=`, `:` - # * event_time: `=`, `>`, `<`, `>=`, `<=` - # - # Usage: This should be milliseconds since epoch or an RFC3339 string. - # Examples: - # `event_time = "2019-06-10T16:07:18-07:00"` - # `event_time = 1560208038000` - # - # * severity: `=`, `:` - # * workflow_state: `=`, `:` - # * security_marks.marks: `=`, `:` - # * source_properties: `=`, `:`, `>`, `<`, `>=`, `<=` - # - # For example, `source_properties.size = 100` is a valid filter string. - # - # Use a partial match on the empty string to filter based on a property - # existing: `source_properties.my_property : ""` - # - # Use a negated partial match on the empty string to filter based on a - # property not existing: `-source_properties.my_property : ""` - # - # * resource: - # * resource.name: `=`, `:` - # * resource.parent_name: `=`, `:` - # * resource.parent_display_name: `=`, `:` - # * resource.project_name: `=`, `:` - # * resource.project_display_name: `=`, `:` - # * resource.type: `=`, `:` - # * resource.folders.resource_folder: `=`, `:` - # * resource.display_name: `=`, `:` - # @param order_by [::String] - # Expression that defines what fields and order to use for sorting. The - # string value should follow SQL syntax: comma separated list of fields. For - # example: "name,resource_properties.a_property". The default sorting order - # is ascending. To specify descending order for a field, a suffix " desc" - # should be appended to the field name. For example: "name - # desc,source_properties.a_property". Redundant space characters in the - # syntax are insignificant. "name desc,source_properties.a_property" and " - # name desc , source_properties.a_property " are equivalent. - # - # The following fields are supported: - # name - # parent - # state - # category - # resource_name - # event_time - # source_properties - # security_marks.marks - # @param read_time [::Google::Protobuf::Timestamp, ::Hash] - # Time used as a reference point when filtering findings. The filter is - # limited to findings existing at the supplied time and their values are - # those at that specific time. Absence of this field will default to the - # API's version of NOW. - # @param compare_duration [::Google::Protobuf::Duration, ::Hash] - # When compare_duration is set, the ListFindingsResult's "state_change" - # attribute is updated to indicate whether the finding had its state changed, - # the finding's state remained unchanged, or if the finding was added in any - # state during the compare_duration period of time that precedes the - # read_time. This is the time between (read_time - compare_duration) and - # read_time. - # - # The state_change value is derived based on the presence and state of the - # finding at the two points in time. Intermediate state changes between the - # two times don't affect the result. For example, the results aren't affected - # if the finding is made inactive and then active again. - # - # Possible "state_change" values when compare_duration is specified: - # - # * "CHANGED": indicates that the finding was present and matched the given - # filter at the start of compare_duration, but changed its - # state at read_time. - # * "UNCHANGED": indicates that the finding was present and matched the given - # filter at the start of compare_duration and did not change - # state at read_time. - # * "ADDED": indicates that the finding did not match the given filter or - # was not present at the start of compare_duration, but was - # present at read_time. - # * "REMOVED": indicates that the finding was present and matched the - # filter at the start of compare_duration, but did not match - # the filter at read_time. - # - # If compare_duration is not specified, then the only possible state_change - # is "UNUSED", which will be the state_change set for all findings present at - # read_time. - # @param field_mask [::Google::Protobuf::FieldMask, ::Hash] - # A field mask to specify the Finding fields to be listed in the response. - # An empty field mask will list all fields. - # @param page_token [::String] - # The value returned by the last `ListFindingsResponse`; indicates - # that this is a continuation of a prior `ListFindings` call, and - # that the system should return the next page of data. - # @param page_size [::Integer] - # The maximum number of results to return in a single response. Default is - # 10, minimum is 1, maximum is 1000. - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Gapic::PagedEnumerable<::Google::Cloud::SecurityCenter::V1::ListFindingsResponse::ListFindingsResult>] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Gapic::PagedEnumerable<::Google::Cloud::SecurityCenter::V1::ListFindingsResponse::ListFindingsResult>] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/cloud/security_center/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::SecurityCenter::V1::SecurityCenter::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::SecurityCenter::V1::ListFindingsRequest.new - # - # # Call the list_findings method. - # result = client.list_findings request - # - # # The returned object is of type Gapic::PagedEnumerable. You can iterate - # # over elements, and API calls will be issued to fetch pages as needed. - # result.each do |item| - # # Each element is of type ::Google::Cloud::SecurityCenter::V1::ListFindingsResponse::ListFindingsResult. - # p item - # end - # - def list_findings request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::SecurityCenter::V1::ListFindingsRequest - - # Converts hash 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_findings.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::SecurityCenter::V1::VERSION - metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - header_params = {} - if request.parent - header_params["parent"] = request.parent - end - - request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") - metadata[:"x-goog-request-params"] ||= request_params_header - - options.apply_defaults timeout: @config.rpcs.list_findings.timeout, - metadata: metadata, - retry_policy: @config.rpcs.list_findings.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @security_center_stub.call_rpc :list_findings, request, options: options do |response, operation| - response = ::Gapic::PagedEnumerable.new @security_center_stub, :list_findings, 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 - - ## - # Lists mute configs. - # - # @overload list_mute_configs(request, options = nil) - # Pass arguments to `list_mute_configs` via a request object, either of type - # {::Google::Cloud::SecurityCenter::V1::ListMuteConfigsRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::SecurityCenter::V1::ListMuteConfigsRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_mute_configs(parent: nil, page_size: nil, page_token: nil) - # Pass arguments to `list_mute_configs` via keyword arguments. Note that at - # least one keyword argument is 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, which owns the collection of mute configs. Its format - # is `organizations/[organization_id]`, `folders/[folder_id]`, - # `projects/[project_id]`. - # @param page_size [::Integer] - # The maximum number of configs to return. The service may return fewer than - # this value. - # If unspecified, at most 10 configs will be returned. - # The maximum value is 1000; values above 1000 will be coerced to 1000. - # @param page_token [::String] - # A page token, received from a previous `ListMuteConfigs` call. - # Provide this to retrieve the subsequent page. - # - # When paginating, all other parameters provided to `ListMuteConfigs` 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::Cloud::SecurityCenter::V1::MuteConfig>] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Gapic::PagedEnumerable<::Google::Cloud::SecurityCenter::V1::MuteConfig>] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/cloud/security_center/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::SecurityCenter::V1::SecurityCenter::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::SecurityCenter::V1::ListMuteConfigsRequest.new - # - # # Call the list_mute_configs method. - # result = client.list_mute_configs request - # - # # The returned object is of type Gapic::PagedEnumerable. You can iterate - # # over elements, and API calls will be issued to fetch pages as needed. - # result.each do |item| - # # Each element is of type ::Google::Cloud::SecurityCenter::V1::MuteConfig. - # p item - # end - # - def list_mute_configs request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::SecurityCenter::V1::ListMuteConfigsRequest - - # Converts hash 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_mute_configs.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::SecurityCenter::V1::VERSION - metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - header_params = {} - if request.parent - header_params["parent"] = request.parent - end - - request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") - metadata[:"x-goog-request-params"] ||= request_params_header - - options.apply_defaults timeout: @config.rpcs.list_mute_configs.timeout, - metadata: metadata, - retry_policy: @config.rpcs.list_mute_configs.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @security_center_stub.call_rpc :list_mute_configs, request, options: options do |response, operation| - response = ::Gapic::PagedEnumerable.new @security_center_stub, :list_mute_configs, 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 - - ## - # Lists notification configs. - # - # @overload list_notification_configs(request, options = nil) - # Pass arguments to `list_notification_configs` via a request object, either of type - # {::Google::Cloud::SecurityCenter::V1::ListNotificationConfigsRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::SecurityCenter::V1::ListNotificationConfigsRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_notification_configs(parent: nil, page_token: nil, page_size: nil) - # Pass arguments to `list_notification_configs` via keyword arguments. Note that at - # least one keyword argument is 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 name of the parent in which to list the notification - # configurations. Its format is "organizations/[organization_id]", - # "folders/[folder_id]", or "projects/[project_id]". - # @param page_token [::String] - # The value returned by the last `ListNotificationConfigsResponse`; indicates - # that this is a continuation of a prior `ListNotificationConfigs` call, and - # that the system should return the next page of data. - # @param page_size [::Integer] - # The maximum number of results to return in a single response. Default is - # 10, minimum is 1, maximum is 1000. - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Gapic::PagedEnumerable<::Google::Cloud::SecurityCenter::V1::NotificationConfig>] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Gapic::PagedEnumerable<::Google::Cloud::SecurityCenter::V1::NotificationConfig>] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/cloud/security_center/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::SecurityCenter::V1::SecurityCenter::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::SecurityCenter::V1::ListNotificationConfigsRequest.new - # - # # Call the list_notification_configs method. - # result = client.list_notification_configs request - # - # # The returned object is of type Gapic::PagedEnumerable. You can iterate - # # over elements, and API calls will be issued to fetch pages as needed. - # result.each do |item| - # # Each element is of type ::Google::Cloud::SecurityCenter::V1::NotificationConfig. - # p item - # end - # - def list_notification_configs request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::SecurityCenter::V1::ListNotificationConfigsRequest - - # Converts hash 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_notification_configs.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::SecurityCenter::V1::VERSION - metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - header_params = {} - if request.parent - header_params["parent"] = request.parent - end - - request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") - metadata[:"x-goog-request-params"] ||= request_params_header - - options.apply_defaults timeout: @config.rpcs.list_notification_configs.timeout, - metadata: metadata, - retry_policy: @config.rpcs.list_notification_configs.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @security_center_stub.call_rpc :list_notification_configs, request, options: options do |response, operation| - response = ::Gapic::PagedEnumerable.new @security_center_stub, :list_notification_configs, 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 a list of all EffectiveSecurityHealthAnalyticsCustomModules for the - # given parent. This includes resident modules defined at the scope of the - # parent, and inherited modules, inherited from CRM ancestors. - # - # @overload list_effective_security_health_analytics_custom_modules(request, options = nil) - # Pass arguments to `list_effective_security_health_analytics_custom_modules` via a request object, either of type - # {::Google::Cloud::SecurityCenter::V1::ListEffectiveSecurityHealthAnalyticsCustomModulesRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::SecurityCenter::V1::ListEffectiveSecurityHealthAnalyticsCustomModulesRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_effective_security_health_analytics_custom_modules(parent: nil, page_size: nil, page_token: nil) - # Pass arguments to `list_effective_security_health_analytics_custom_modules` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param parent [::String] - # Required. Name of parent to list effective custom modules. Its format is - # `organizations/{organization}/securityHealthAnalyticsSettings`, - # `folders/{folder}/securityHealthAnalyticsSettings`, or - # `projects/{project}/securityHealthAnalyticsSettings` - # @param page_size [::Integer] - # The maximum number of results to return in a single response. Default is - # 10, minimum is 1, maximum is 1000. - # @param page_token [::String] - # The value returned by the last call indicating a continuation - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Gapic::PagedEnumerable<::Google::Cloud::SecurityCenter::V1::EffectiveSecurityHealthAnalyticsCustomModule>] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Gapic::PagedEnumerable<::Google::Cloud::SecurityCenter::V1::EffectiveSecurityHealthAnalyticsCustomModule>] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/cloud/security_center/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::SecurityCenter::V1::SecurityCenter::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::SecurityCenter::V1::ListEffectiveSecurityHealthAnalyticsCustomModulesRequest.new - # - # # Call the list_effective_security_health_analytics_custom_modules method. - # result = client.list_effective_security_health_analytics_custom_modules request - # - # # The returned object is of type Gapic::PagedEnumerable. You can iterate - # # over elements, and API calls will be issued to fetch pages as needed. - # result.each do |item| - # # Each element is of type ::Google::Cloud::SecurityCenter::V1::EffectiveSecurityHealthAnalyticsCustomModule. - # p item - # end - # - def list_effective_security_health_analytics_custom_modules request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::SecurityCenter::V1::ListEffectiveSecurityHealthAnalyticsCustomModulesRequest - - # Converts hash 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_effective_security_health_analytics_custom_modules.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::SecurityCenter::V1::VERSION - metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - header_params = {} - if request.parent - header_params["parent"] = request.parent - end - - request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") - metadata[:"x-goog-request-params"] ||= request_params_header - - options.apply_defaults timeout: @config.rpcs.list_effective_security_health_analytics_custom_modules.timeout, - metadata: metadata, - retry_policy: @config.rpcs.list_effective_security_health_analytics_custom_modules.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @security_center_stub.call_rpc :list_effective_security_health_analytics_custom_modules, request, options: options do |response, operation| - response = ::Gapic::PagedEnumerable.new @security_center_stub, :list_effective_security_health_analytics_custom_modules, 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 a list of all SecurityHealthAnalyticsCustomModules for the given - # parent. This includes resident modules defined at the scope of the parent, - # and inherited modules, inherited from CRM ancestors. - # - # @overload list_security_health_analytics_custom_modules(request, options = nil) - # Pass arguments to `list_security_health_analytics_custom_modules` via a request object, either of type - # {::Google::Cloud::SecurityCenter::V1::ListSecurityHealthAnalyticsCustomModulesRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::SecurityCenter::V1::ListSecurityHealthAnalyticsCustomModulesRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_security_health_analytics_custom_modules(parent: nil, page_size: nil, page_token: nil) - # Pass arguments to `list_security_health_analytics_custom_modules` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param parent [::String] - # Required. Name of parent to list custom modules. Its format is - # `organizations/{organization}/securityHealthAnalyticsSettings`, - # `folders/{folder}/securityHealthAnalyticsSettings`, or - # `projects/{project}/securityHealthAnalyticsSettings` - # @param page_size [::Integer] - # The maximum number of results to return in a single response. Default is - # 10, minimum is 1, maximum is 1000. - # @param page_token [::String] - # The value returned by the last call indicating a continuation - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Gapic::PagedEnumerable<::Google::Cloud::SecurityCenter::V1::SecurityHealthAnalyticsCustomModule>] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Gapic::PagedEnumerable<::Google::Cloud::SecurityCenter::V1::SecurityHealthAnalyticsCustomModule>] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/cloud/security_center/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::SecurityCenter::V1::SecurityCenter::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::SecurityCenter::V1::ListSecurityHealthAnalyticsCustomModulesRequest.new - # - # # Call the list_security_health_analytics_custom_modules method. - # result = client.list_security_health_analytics_custom_modules request - # - # # The returned object is of type Gapic::PagedEnumerable. You can iterate - # # over elements, and API calls will be issued to fetch pages as needed. - # result.each do |item| - # # Each element is of type ::Google::Cloud::SecurityCenter::V1::SecurityHealthAnalyticsCustomModule. - # p item - # end - # - def list_security_health_analytics_custom_modules request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::SecurityCenter::V1::ListSecurityHealthAnalyticsCustomModulesRequest - - # Converts hash 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_security_health_analytics_custom_modules.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::SecurityCenter::V1::VERSION - metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - header_params = {} - if request.parent - header_params["parent"] = request.parent - end - - request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") - metadata[:"x-goog-request-params"] ||= request_params_header - - options.apply_defaults timeout: @config.rpcs.list_security_health_analytics_custom_modules.timeout, - metadata: metadata, - retry_policy: @config.rpcs.list_security_health_analytics_custom_modules.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @security_center_stub.call_rpc :list_security_health_analytics_custom_modules, request, options: options do |response, operation| - response = ::Gapic::PagedEnumerable.new @security_center_stub, :list_security_health_analytics_custom_modules, 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 - - ## - # Lists all sources belonging to an organization. - # - # @overload list_sources(request, options = nil) - # Pass arguments to `list_sources` via a request object, either of type - # {::Google::Cloud::SecurityCenter::V1::ListSourcesRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::SecurityCenter::V1::ListSourcesRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_sources(parent: nil, page_token: nil, page_size: nil) - # Pass arguments to `list_sources` via keyword arguments. Note that at - # least one keyword argument is 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. Resource name of the parent of sources to list. Its format should - # be `organizations/[organization_id]`, `folders/[folder_id]`, or - # `projects/[project_id]`. - # @param page_token [::String] - # The value returned by the last `ListSourcesResponse`; indicates - # that this is a continuation of a prior `ListSources` call, and - # that the system should return the next page of data. - # @param page_size [::Integer] - # The maximum number of results to return in a single response. Default is - # 10, minimum is 1, maximum is 1000. - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Gapic::PagedEnumerable<::Google::Cloud::SecurityCenter::V1::Source>] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Gapic::PagedEnumerable<::Google::Cloud::SecurityCenter::V1::Source>] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/cloud/security_center/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::SecurityCenter::V1::SecurityCenter::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::SecurityCenter::V1::ListSourcesRequest.new - # - # # Call the list_sources method. - # result = client.list_sources request - # - # # The returned object is of type Gapic::PagedEnumerable. You can iterate - # # over elements, and API calls will be issued to fetch pages as needed. - # result.each do |item| - # # Each element is of type ::Google::Cloud::SecurityCenter::V1::Source. - # p item - # end - # - def list_sources request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::SecurityCenter::V1::ListSourcesRequest - - # Converts hash 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_sources.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::SecurityCenter::V1::VERSION - metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - header_params = {} - if request.parent - header_params["parent"] = request.parent - end - - request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") - metadata[:"x-goog-request-params"] ||= request_params_header - - options.apply_defaults timeout: @config.rpcs.list_sources.timeout, - metadata: metadata, - retry_policy: @config.rpcs.list_sources.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @security_center_stub.call_rpc :list_sources, request, options: options do |response, operation| - response = ::Gapic::PagedEnumerable.new @security_center_stub, :list_sources, 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 - - ## - # Runs asset discovery. The discovery is tracked with a long-running - # operation. - # - # This API can only be called with limited frequency for an organization. If - # it is called too frequently the caller will receive a TOO_MANY_REQUESTS - # error. - # - # @deprecated This method is deprecated and may be removed in the next major version update. - # - # @overload run_asset_discovery(request, options = nil) - # Pass arguments to `run_asset_discovery` via a request object, either of type - # {::Google::Cloud::SecurityCenter::V1::RunAssetDiscoveryRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::SecurityCenter::V1::RunAssetDiscoveryRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. - # - # @overload run_asset_discovery(parent: nil) - # Pass arguments to `run_asset_discovery` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param parent [::String] - # Required. Name of the organization to run asset discovery for. Its format - # is `organizations/[organization_id]`. - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Gapic::Operation] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Gapic::Operation] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/cloud/security_center/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::SecurityCenter::V1::SecurityCenter::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::SecurityCenter::V1::RunAssetDiscoveryRequest.new - # - # # Call the run_asset_discovery method. - # result = client.run_asset_discovery 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 run_asset_discovery request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::SecurityCenter::V1::RunAssetDiscoveryRequest - - # Converts hash 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.run_asset_discovery.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::SecurityCenter::V1::VERSION - metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - header_params = {} - if request.parent - header_params["parent"] = request.parent - end - - request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") - metadata[:"x-goog-request-params"] ||= request_params_header - - options.apply_defaults timeout: @config.rpcs.run_asset_discovery.timeout, - metadata: metadata, - retry_policy: @config.rpcs.run_asset_discovery.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @security_center_stub.call_rpc :run_asset_discovery, request, options: options do |response, operation| - response = ::Gapic::Operation.new response, @operations_client, options: options - yield response, operation if block_given? - throw :response, response - end - rescue ::GRPC::BadStatus => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Updates the state of a finding. - # - # @overload set_finding_state(request, options = nil) - # Pass arguments to `set_finding_state` via a request object, either of type - # {::Google::Cloud::SecurityCenter::V1::SetFindingStateRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::SecurityCenter::V1::SetFindingStateRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. - # - # @overload set_finding_state(name: nil, state: nil, start_time: nil) - # Pass arguments to `set_finding_state` via keyword arguments. Note that at - # least one keyword argument is 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 [relative resource - # name](https://cloud.google.com/apis/design/resource_names#relative_resource_name) - # of the finding. Example: - # `organizations/{organization_id}/sources/{source_id}/findings/{finding_id}`, - # `folders/{folder_id}/sources/{source_id}/findings/{finding_id}`, - # `projects/{project_id}/sources/{source_id}/findings/{finding_id}`. - # @param state [::Google::Cloud::SecurityCenter::V1::Finding::State] - # Required. The desired State of the finding. - # @param start_time [::Google::Protobuf::Timestamp, ::Hash] - # Required. The time at which the updated state takes effect. - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Google::Cloud::SecurityCenter::V1::Finding] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Google::Cloud::SecurityCenter::V1::Finding] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/cloud/security_center/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::SecurityCenter::V1::SecurityCenter::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::SecurityCenter::V1::SetFindingStateRequest.new - # - # # Call the set_finding_state method. - # result = client.set_finding_state request - # - # # The returned object is of type Google::Cloud::SecurityCenter::V1::Finding. - # p result - # - def set_finding_state request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::SecurityCenter::V1::SetFindingStateRequest - - # Converts hash and nil to an options object - options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h - - # Customize the options with defaults - metadata = @config.rpcs.set_finding_state.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::SecurityCenter::V1::VERSION - metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - header_params = {} - if request.name - header_params["name"] = request.name - end - - request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") - metadata[:"x-goog-request-params"] ||= request_params_header - - options.apply_defaults timeout: @config.rpcs.set_finding_state.timeout, - metadata: metadata, - retry_policy: @config.rpcs.set_finding_state.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @security_center_stub.call_rpc :set_finding_state, request, options: options do |response, operation| - yield response, operation if block_given? - end - rescue ::GRPC::BadStatus => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Updates the mute state of a finding. - # - # @overload set_mute(request, options = nil) - # Pass arguments to `set_mute` via a request object, either of type - # {::Google::Cloud::SecurityCenter::V1::SetMuteRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::SecurityCenter::V1::SetMuteRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. - # - # @overload set_mute(name: nil, mute: nil) - # Pass arguments to `set_mute` via keyword arguments. Note that at - # least one keyword argument is 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 [relative resource - # name](https://cloud.google.com/apis/design/resource_names#relative_resource_name) - # of the finding. Example: - # `organizations/{organization_id}/sources/{source_id}/findings/{finding_id}`, - # `folders/{folder_id}/sources/{source_id}/findings/{finding_id}`, - # `projects/{project_id}/sources/{source_id}/findings/{finding_id}`. - # @param mute [::Google::Cloud::SecurityCenter::V1::Finding::Mute] - # Required. The desired state of the Mute. - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Google::Cloud::SecurityCenter::V1::Finding] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Google::Cloud::SecurityCenter::V1::Finding] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/cloud/security_center/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::SecurityCenter::V1::SecurityCenter::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::SecurityCenter::V1::SetMuteRequest.new - # - # # Call the set_mute method. - # result = client.set_mute request - # - # # The returned object is of type Google::Cloud::SecurityCenter::V1::Finding. - # p result - # - def set_mute request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::SecurityCenter::V1::SetMuteRequest - - # Converts hash and nil to an options object - options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h - - # Customize the options with defaults - metadata = @config.rpcs.set_mute.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::SecurityCenter::V1::VERSION - metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - header_params = {} - if request.name - header_params["name"] = request.name - end - - request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") - metadata[:"x-goog-request-params"] ||= request_params_header - - options.apply_defaults timeout: @config.rpcs.set_mute.timeout, - metadata: metadata, - retry_policy: @config.rpcs.set_mute.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @security_center_stub.call_rpc :set_mute, request, options: options do |response, operation| - yield response, operation if block_given? - end - rescue ::GRPC::BadStatus => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Sets the access control policy on the specified Source. - # - # @overload set_iam_policy(request, options = nil) - # Pass arguments to `set_iam_policy` via a request object, either of type - # {::Google::Iam::V1::SetIamPolicyRequest} or an equivalent Hash. - # - # @param request [::Google::Iam::V1::SetIamPolicyRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. - # - # @overload set_iam_policy(resource: nil, policy: nil, update_mask: nil) - # Pass arguments to `set_iam_policy` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param resource [::String] - # REQUIRED: The resource for which the policy is being specified. - # See the operation documentation for the appropriate value for this field. - # @param policy [::Google::Iam::V1::Policy, ::Hash] - # REQUIRED: The complete policy to be applied to the `resource`. The size of - # the policy is limited to a few 10s of KB. An empty policy is a - # valid policy but certain Cloud Platform services (such as Projects) - # might reject them. - # @param update_mask [::Google::Protobuf::FieldMask, ::Hash] - # OPTIONAL: A FieldMask specifying which fields of the policy to modify. Only - # the fields in the mask will be modified. If no mask is provided, the - # following default mask is used: - # - # `paths: "bindings, etag"` - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Google::Iam::V1::Policy] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Google::Iam::V1::Policy] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/cloud/security_center/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::SecurityCenter::V1::SecurityCenter::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Iam::V1::SetIamPolicyRequest.new - # - # # Call the set_iam_policy method. - # result = client.set_iam_policy request - # - # # The returned object is of type Google::Iam::V1::Policy. - # p result - # - def set_iam_policy request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Iam::V1::SetIamPolicyRequest - - # Converts hash and nil to an options object - options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h - - # Customize the options with defaults - metadata = @config.rpcs.set_iam_policy.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::SecurityCenter::V1::VERSION - metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - header_params = {} - if request.resource - header_params["resource"] = request.resource - end - - request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") - metadata[:"x-goog-request-params"] ||= request_params_header - - options.apply_defaults timeout: @config.rpcs.set_iam_policy.timeout, - metadata: metadata, - retry_policy: @config.rpcs.set_iam_policy.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @security_center_stub.call_rpc :set_iam_policy, request, options: options do |response, operation| - yield response, operation if block_given? - end - rescue ::GRPC::BadStatus => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Returns the permissions that a caller has on the specified source. - # - # @overload test_iam_permissions(request, options = nil) - # Pass arguments to `test_iam_permissions` via a request object, either of type - # {::Google::Iam::V1::TestIamPermissionsRequest} or an equivalent Hash. - # - # @param request [::Google::Iam::V1::TestIamPermissionsRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. - # - # @overload test_iam_permissions(resource: nil, permissions: nil) - # Pass arguments to `test_iam_permissions` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param resource [::String] - # REQUIRED: The resource for which the policy detail is being requested. - # See the operation documentation for the appropriate value for this field. - # @param permissions [::Array<::String>] - # The set of permissions to check for the `resource`. Permissions with - # wildcards (such as '*' or 'storage.*') are not allowed. For more - # information see - # [IAM Overview](https://cloud.google.com/iam/docs/overview#permissions). - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Google::Iam::V1::TestIamPermissionsResponse] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Google::Iam::V1::TestIamPermissionsResponse] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/cloud/security_center/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::SecurityCenter::V1::SecurityCenter::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Iam::V1::TestIamPermissionsRequest.new - # - # # Call the test_iam_permissions method. - # result = client.test_iam_permissions request - # - # # The returned object is of type Google::Iam::V1::TestIamPermissionsResponse. - # p result - # - def test_iam_permissions request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Iam::V1::TestIamPermissionsRequest - - # Converts hash and nil to an options object - options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h - - # Customize the options with defaults - metadata = @config.rpcs.test_iam_permissions.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::SecurityCenter::V1::VERSION - metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - header_params = {} - if request.resource - header_params["resource"] = request.resource - end - - request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") - metadata[:"x-goog-request-params"] ||= request_params_header - - options.apply_defaults timeout: @config.rpcs.test_iam_permissions.timeout, - metadata: metadata, - retry_policy: @config.rpcs.test_iam_permissions.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @security_center_stub.call_rpc :test_iam_permissions, request, options: options do |response, operation| - yield response, operation if block_given? - end - rescue ::GRPC::BadStatus => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Simulates a given SecurityHealthAnalyticsCustomModule and Resource. - # - # @overload simulate_security_health_analytics_custom_module(request, options = nil) - # Pass arguments to `simulate_security_health_analytics_custom_module` via a request object, either of type - # {::Google::Cloud::SecurityCenter::V1::SimulateSecurityHealthAnalyticsCustomModuleRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::SecurityCenter::V1::SimulateSecurityHealthAnalyticsCustomModuleRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. - # - # @overload simulate_security_health_analytics_custom_module(parent: nil, custom_config: nil, resource: nil) - # Pass arguments to `simulate_security_health_analytics_custom_module` via keyword arguments. Note that at - # least one keyword argument is 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 relative resource name of the organization, project, or - # folder. For more information about relative resource names, see [Relative - # Resource - # Name](https://cloud.google.com/apis/design/resource_names#relative_resource_name) - # Example: `organizations/{organization_id}` - # @param custom_config [::Google::Cloud::SecurityCenter::V1::CustomConfig, ::Hash] - # Required. The custom configuration that you need to test. - # @param resource [::Google::Cloud::SecurityCenter::V1::SimulateSecurityHealthAnalyticsCustomModuleRequest::SimulatedResource, ::Hash] - # Required. Resource data to simulate custom module against. - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Google::Cloud::SecurityCenter::V1::SimulateSecurityHealthAnalyticsCustomModuleResponse] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Google::Cloud::SecurityCenter::V1::SimulateSecurityHealthAnalyticsCustomModuleResponse] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/cloud/security_center/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::SecurityCenter::V1::SecurityCenter::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::SecurityCenter::V1::SimulateSecurityHealthAnalyticsCustomModuleRequest.new - # - # # Call the simulate_security_health_analytics_custom_module method. - # result = client.simulate_security_health_analytics_custom_module request - # - # # The returned object is of type Google::Cloud::SecurityCenter::V1::SimulateSecurityHealthAnalyticsCustomModuleResponse. - # p result - # - def simulate_security_health_analytics_custom_module request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::SecurityCenter::V1::SimulateSecurityHealthAnalyticsCustomModuleRequest - - # Converts hash 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.simulate_security_health_analytics_custom_module.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::SecurityCenter::V1::VERSION - metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - header_params = {} - if request.parent - header_params["parent"] = request.parent - end - - request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") - metadata[:"x-goog-request-params"] ||= request_params_header - - options.apply_defaults timeout: @config.rpcs.simulate_security_health_analytics_custom_module.timeout, - metadata: metadata, - retry_policy: @config.rpcs.simulate_security_health_analytics_custom_module.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @security_center_stub.call_rpc :simulate_security_health_analytics_custom_module, 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 external system. This is for a given finding. - # - # @overload update_external_system(request, options = nil) - # Pass arguments to `update_external_system` via a request object, either of type - # {::Google::Cloud::SecurityCenter::V1::UpdateExternalSystemRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::SecurityCenter::V1::UpdateExternalSystemRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_external_system(external_system: nil, update_mask: nil) - # Pass arguments to `update_external_system` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param external_system [::Google::Cloud::SecurityCenter::V1::ExternalSystem, ::Hash] - # Required. The external system resource to update. - # @param update_mask [::Google::Protobuf::FieldMask, ::Hash] - # The FieldMask to use when updating the external system resource. - # - # If empty all mutable fields will be updated. - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Google::Cloud::SecurityCenter::V1::ExternalSystem] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Google::Cloud::SecurityCenter::V1::ExternalSystem] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/cloud/security_center/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::SecurityCenter::V1::SecurityCenter::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::SecurityCenter::V1::UpdateExternalSystemRequest.new - # - # # Call the update_external_system method. - # result = client.update_external_system request - # - # # The returned object is of type Google::Cloud::SecurityCenter::V1::ExternalSystem. - # p result - # - def update_external_system request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::SecurityCenter::V1::UpdateExternalSystemRequest - - # Converts hash 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_external_system.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::SecurityCenter::V1::VERSION - metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - header_params = {} - if request.external_system&.name - header_params["external_system.name"] = request.external_system.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_external_system.timeout, - metadata: metadata, - retry_policy: @config.rpcs.update_external_system.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @security_center_stub.call_rpc :update_external_system, request, options: options do |response, operation| - yield response, operation if block_given? - end - rescue ::GRPC::BadStatus => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Creates or updates a finding. The corresponding source must exist for a - # finding creation to succeed. - # - # @overload update_finding(request, options = nil) - # Pass arguments to `update_finding` via a request object, either of type - # {::Google::Cloud::SecurityCenter::V1::UpdateFindingRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::SecurityCenter::V1::UpdateFindingRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_finding(finding: nil, update_mask: nil) - # Pass arguments to `update_finding` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param finding [::Google::Cloud::SecurityCenter::V1::Finding, ::Hash] - # Required. The finding resource to update or create if it does not already - # exist. parent, security_marks, and update_time will be ignored. - # - # In the case of creation, the finding id portion of the name must be - # alphanumeric and less than or equal to 32 characters and greater than 0 - # characters in length. - # @param update_mask [::Google::Protobuf::FieldMask, ::Hash] - # The FieldMask to use when updating the finding resource. This field should - # not be specified when creating a finding. - # - # When updating a finding, an empty mask is treated as updating all mutable - # fields and replacing source_properties. Individual source_properties can - # be added/updated by using "source_properties." in the field - # mask. - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Google::Cloud::SecurityCenter::V1::Finding] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Google::Cloud::SecurityCenter::V1::Finding] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/cloud/security_center/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::SecurityCenter::V1::SecurityCenter::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::SecurityCenter::V1::UpdateFindingRequest.new - # - # # Call the update_finding method. - # result = client.update_finding request - # - # # The returned object is of type Google::Cloud::SecurityCenter::V1::Finding. - # p result - # - def update_finding request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::SecurityCenter::V1::UpdateFindingRequest - - # Converts hash 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_finding.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::SecurityCenter::V1::VERSION - metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - header_params = {} - if request.finding&.name - header_params["finding.name"] = request.finding.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_finding.timeout, - metadata: metadata, - retry_policy: @config.rpcs.update_finding.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @security_center_stub.call_rpc :update_finding, 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 mute config. - # - # @overload update_mute_config(request, options = nil) - # Pass arguments to `update_mute_config` via a request object, either of type - # {::Google::Cloud::SecurityCenter::V1::UpdateMuteConfigRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::SecurityCenter::V1::UpdateMuteConfigRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_mute_config(mute_config: nil, update_mask: nil) - # Pass arguments to `update_mute_config` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param mute_config [::Google::Cloud::SecurityCenter::V1::MuteConfig, ::Hash] - # Required. The mute config being updated. - # @param update_mask [::Google::Protobuf::FieldMask, ::Hash] - # The list of fields to be updated. - # If empty all mutable fields will be updated. - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Google::Cloud::SecurityCenter::V1::MuteConfig] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Google::Cloud::SecurityCenter::V1::MuteConfig] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/cloud/security_center/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::SecurityCenter::V1::SecurityCenter::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::SecurityCenter::V1::UpdateMuteConfigRequest.new - # - # # Call the update_mute_config method. - # result = client.update_mute_config request - # - # # The returned object is of type Google::Cloud::SecurityCenter::V1::MuteConfig. - # p result - # - def update_mute_config request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::SecurityCenter::V1::UpdateMuteConfigRequest - - # Converts hash 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_mute_config.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::SecurityCenter::V1::VERSION - metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - header_params = {} - if request.mute_config&.name - header_params["mute_config.name"] = request.mute_config.name - end - - request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") - metadata[:"x-goog-request-params"] ||= request_params_header - - options.apply_defaults timeout: @config.rpcs.update_mute_config.timeout, - metadata: metadata, - retry_policy: @config.rpcs.update_mute_config.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @security_center_stub.call_rpc :update_mute_config, request, options: options do |response, operation| - yield response, operation if block_given? - end - rescue ::GRPC::BadStatus => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Updates a notification config. The following update - # fields are allowed: description, pubsub_topic, streaming_config.filter - # - # @overload update_notification_config(request, options = nil) - # Pass arguments to `update_notification_config` via a request object, either of type - # {::Google::Cloud::SecurityCenter::V1::UpdateNotificationConfigRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::SecurityCenter::V1::UpdateNotificationConfigRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_notification_config(notification_config: nil, update_mask: nil) - # Pass arguments to `update_notification_config` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param notification_config [::Google::Cloud::SecurityCenter::V1::NotificationConfig, ::Hash] - # Required. The notification config to update. - # @param update_mask [::Google::Protobuf::FieldMask, ::Hash] - # The FieldMask to use when updating the notification config. - # - # If empty all mutable fields will be updated. - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Google::Cloud::SecurityCenter::V1::NotificationConfig] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Google::Cloud::SecurityCenter::V1::NotificationConfig] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/cloud/security_center/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::SecurityCenter::V1::SecurityCenter::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::SecurityCenter::V1::UpdateNotificationConfigRequest.new - # - # # Call the update_notification_config method. - # result = client.update_notification_config request - # - # # The returned object is of type Google::Cloud::SecurityCenter::V1::NotificationConfig. - # p result - # - def update_notification_config request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::SecurityCenter::V1::UpdateNotificationConfigRequest - - # Converts hash 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_notification_config.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::SecurityCenter::V1::VERSION - metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - header_params = {} - if request.notification_config&.name - header_params["notification_config.name"] = request.notification_config.name - end - - request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") - metadata[:"x-goog-request-params"] ||= request_params_header - - options.apply_defaults timeout: @config.rpcs.update_notification_config.timeout, - metadata: metadata, - retry_policy: @config.rpcs.update_notification_config.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @security_center_stub.call_rpc :update_notification_config, request, options: options do |response, operation| - yield response, operation if block_given? - end - rescue ::GRPC::BadStatus => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Updates an organization's settings. - # - # @overload update_organization_settings(request, options = nil) - # Pass arguments to `update_organization_settings` via a request object, either of type - # {::Google::Cloud::SecurityCenter::V1::UpdateOrganizationSettingsRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::SecurityCenter::V1::UpdateOrganizationSettingsRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. - # - # @overload update_organization_settings(organization_settings: nil, update_mask: nil) - # Pass arguments to `update_organization_settings` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param organization_settings [::Google::Cloud::SecurityCenter::V1::OrganizationSettings, ::Hash] - # Required. The organization settings resource to update. - # @param update_mask [::Google::Protobuf::FieldMask, ::Hash] - # The FieldMask to use when updating the settings resource. - # - # If empty all mutable fields will be updated. - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Google::Cloud::SecurityCenter::V1::OrganizationSettings] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Google::Cloud::SecurityCenter::V1::OrganizationSettings] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/cloud/security_center/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::SecurityCenter::V1::SecurityCenter::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::SecurityCenter::V1::UpdateOrganizationSettingsRequest.new - # - # # Call the update_organization_settings method. - # result = client.update_organization_settings request - # - # # The returned object is of type Google::Cloud::SecurityCenter::V1::OrganizationSettings. - # p result - # - def update_organization_settings request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::SecurityCenter::V1::UpdateOrganizationSettingsRequest - - # Converts hash and nil to an options object - options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h - - # Customize the options with defaults - metadata = @config.rpcs.update_organization_settings.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::SecurityCenter::V1::VERSION - metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - header_params = {} - if request.organization_settings&.name - header_params["organization_settings.name"] = request.organization_settings.name - end - - request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") - metadata[:"x-goog-request-params"] ||= request_params_header - - options.apply_defaults timeout: @config.rpcs.update_organization_settings.timeout, - metadata: metadata, - retry_policy: @config.rpcs.update_organization_settings.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @security_center_stub.call_rpc :update_organization_settings, request, options: options do |response, operation| - yield response, operation if block_given? - end - rescue ::GRPC::BadStatus => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Updates the SecurityHealthAnalyticsCustomModule under the given name based - # on the given update mask. Updating the enablement state is supported on - # both resident and inherited modules (though resident modules cannot have an - # enablement state of "inherited"). Updating the display name and custom - # config of a module is supported on resident modules only. - # - # @overload update_security_health_analytics_custom_module(request, options = nil) - # Pass arguments to `update_security_health_analytics_custom_module` via a request object, either of type - # {::Google::Cloud::SecurityCenter::V1::UpdateSecurityHealthAnalyticsCustomModuleRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::SecurityCenter::V1::UpdateSecurityHealthAnalyticsCustomModuleRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_security_health_analytics_custom_module(security_health_analytics_custom_module: nil, update_mask: nil) - # Pass arguments to `update_security_health_analytics_custom_module` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param security_health_analytics_custom_module [::Google::Cloud::SecurityCenter::V1::SecurityHealthAnalyticsCustomModule, ::Hash] - # Required. The SecurityHealthAnalytics custom module to update. - # @param update_mask [::Google::Protobuf::FieldMask, ::Hash] - # The list of fields to be updated. The only fields that can be updated are - # `enablement_state` and `custom_config`. If empty or set to the wildcard - # value `*`, both `enablement_state` and `custom_config` are updated. - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Google::Cloud::SecurityCenter::V1::SecurityHealthAnalyticsCustomModule] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Google::Cloud::SecurityCenter::V1::SecurityHealthAnalyticsCustomModule] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/cloud/security_center/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::SecurityCenter::V1::SecurityCenter::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::SecurityCenter::V1::UpdateSecurityHealthAnalyticsCustomModuleRequest.new - # - # # Call the update_security_health_analytics_custom_module method. - # result = client.update_security_health_analytics_custom_module request - # - # # The returned object is of type Google::Cloud::SecurityCenter::V1::SecurityHealthAnalyticsCustomModule. - # p result - # - def update_security_health_analytics_custom_module request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::SecurityCenter::V1::UpdateSecurityHealthAnalyticsCustomModuleRequest - - # Converts hash 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_security_health_analytics_custom_module.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::SecurityCenter::V1::VERSION - metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - header_params = {} - if request.security_health_analytics_custom_module&.name - header_params["security_health_analytics_custom_module.name"] = request.security_health_analytics_custom_module.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_security_health_analytics_custom_module.timeout, - metadata: metadata, - retry_policy: @config.rpcs.update_security_health_analytics_custom_module.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @security_center_stub.call_rpc :update_security_health_analytics_custom_module, 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 source. - # - # @overload update_source(request, options = nil) - # Pass arguments to `update_source` via a request object, either of type - # {::Google::Cloud::SecurityCenter::V1::UpdateSourceRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::SecurityCenter::V1::UpdateSourceRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_source(source: nil, update_mask: nil) - # Pass arguments to `update_source` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param source [::Google::Cloud::SecurityCenter::V1::Source, ::Hash] - # Required. The source resource to update. - # @param update_mask [::Google::Protobuf::FieldMask, ::Hash] - # The FieldMask to use when updating the source resource. - # - # If empty all mutable fields will be updated. - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Google::Cloud::SecurityCenter::V1::Source] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Google::Cloud::SecurityCenter::V1::Source] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/cloud/security_center/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::SecurityCenter::V1::SecurityCenter::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::SecurityCenter::V1::UpdateSourceRequest.new - # - # # Call the update_source method. - # result = client.update_source request - # - # # The returned object is of type Google::Cloud::SecurityCenter::V1::Source. - # p result - # - def update_source request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::SecurityCenter::V1::UpdateSourceRequest - - # Converts hash 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_source.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::SecurityCenter::V1::VERSION - metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - header_params = {} - if request.source&.name - header_params["source.name"] = request.source.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_source.timeout, - metadata: metadata, - retry_policy: @config.rpcs.update_source.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @security_center_stub.call_rpc :update_source, 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 security marks. - # - # @overload update_security_marks(request, options = nil) - # Pass arguments to `update_security_marks` via a request object, either of type - # {::Google::Cloud::SecurityCenter::V1::UpdateSecurityMarksRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::SecurityCenter::V1::UpdateSecurityMarksRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_security_marks(security_marks: nil, update_mask: nil, start_time: nil) - # Pass arguments to `update_security_marks` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param security_marks [::Google::Cloud::SecurityCenter::V1::SecurityMarks, ::Hash] - # Required. The security marks resource to update. - # @param update_mask [::Google::Protobuf::FieldMask, ::Hash] - # The FieldMask to use when updating the security marks resource. - # - # The field mask must not contain duplicate fields. - # If empty or set to "marks", all marks will be replaced. Individual - # marks can be updated using "marks.". - # @param start_time [::Google::Protobuf::Timestamp, ::Hash] - # The time at which the updated SecurityMarks take effect. - # If not set uses current server time. Updates will be applied to the - # SecurityMarks that are active immediately preceding this time. Must be - # earlier or equal to the server time. - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Google::Cloud::SecurityCenter::V1::SecurityMarks] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Google::Cloud::SecurityCenter::V1::SecurityMarks] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/cloud/security_center/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::SecurityCenter::V1::SecurityCenter::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::SecurityCenter::V1::UpdateSecurityMarksRequest.new - # - # # Call the update_security_marks method. - # result = client.update_security_marks request - # - # # The returned object is of type Google::Cloud::SecurityCenter::V1::SecurityMarks. - # p result - # - def update_security_marks request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::SecurityCenter::V1::UpdateSecurityMarksRequest - - # Converts hash 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_security_marks.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::SecurityCenter::V1::VERSION - metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - header_params = {} - if request.security_marks&.name - header_params["security_marks.name"] = request.security_marks.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_security_marks.timeout, - metadata: metadata, - retry_policy: @config.rpcs.update_security_marks.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @security_center_stub.call_rpc :update_security_marks, request, options: options do |response, operation| - yield response, operation if block_given? - end - rescue ::GRPC::BadStatus => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Creates a BigQuery export. - # - # @overload create_big_query_export(request, options = nil) - # Pass arguments to `create_big_query_export` via a request object, either of type - # {::Google::Cloud::SecurityCenter::V1::CreateBigQueryExportRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::SecurityCenter::V1::CreateBigQueryExportRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_big_query_export(parent: nil, big_query_export: nil, big_query_export_id: nil) - # Pass arguments to `create_big_query_export` via keyword arguments. Note that at - # least one keyword argument is 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 name of the parent resource of the new BigQuery export. Its - # format is `organizations/[organization_id]`, `folders/[folder_id]`, or - # `projects/[project_id]`. - # @param big_query_export [::Google::Cloud::SecurityCenter::V1::BigQueryExport, ::Hash] - # Required. The BigQuery export being created. - # @param big_query_export_id [::String] - # Required. Unique identifier provided by the client within the parent scope. - # It must consist of only lowercase letters, numbers, and hyphens, must start - # with a letter, must end with either a letter or a number, and must be 63 - # characters or less. - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Google::Cloud::SecurityCenter::V1::BigQueryExport] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Google::Cloud::SecurityCenter::V1::BigQueryExport] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/cloud/security_center/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::SecurityCenter::V1::SecurityCenter::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::SecurityCenter::V1::CreateBigQueryExportRequest.new - # - # # Call the create_big_query_export method. - # result = client.create_big_query_export request - # - # # The returned object is of type Google::Cloud::SecurityCenter::V1::BigQueryExport. - # p result - # - def create_big_query_export request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::SecurityCenter::V1::CreateBigQueryExportRequest - - # Converts hash 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_big_query_export.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::SecurityCenter::V1::VERSION - metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - header_params = {} - if request.parent - header_params["parent"] = request.parent - end - - request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") - metadata[:"x-goog-request-params"] ||= request_params_header - - options.apply_defaults timeout: @config.rpcs.create_big_query_export.timeout, - metadata: metadata, - retry_policy: @config.rpcs.create_big_query_export.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @security_center_stub.call_rpc :create_big_query_export, request, options: options do |response, operation| - yield response, operation if block_given? - end - rescue ::GRPC::BadStatus => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Deletes an existing BigQuery export. - # - # @overload delete_big_query_export(request, options = nil) - # Pass arguments to `delete_big_query_export` via a request object, either of type - # {::Google::Cloud::SecurityCenter::V1::DeleteBigQueryExportRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::SecurityCenter::V1::DeleteBigQueryExportRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_big_query_export(name: nil) - # Pass arguments to `delete_big_query_export` via keyword arguments. Note that at - # least one keyword argument is 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 BigQuery export to delete. Its format is - # `organizations/{organization}/bigQueryExports/{export_id}`, - # `folders/{folder}/bigQueryExports/{export_id}`, or - # `projects/{project}/bigQueryExports/{export_id}` - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Google::Protobuf::Empty] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Google::Protobuf::Empty] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/cloud/security_center/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::SecurityCenter::V1::SecurityCenter::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::SecurityCenter::V1::DeleteBigQueryExportRequest.new - # - # # Call the delete_big_query_export method. - # result = client.delete_big_query_export request - # - # # The returned object is of type Google::Protobuf::Empty. - # p result - # - def delete_big_query_export request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::SecurityCenter::V1::DeleteBigQueryExportRequest - - # Converts hash 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_big_query_export.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::SecurityCenter::V1::VERSION - metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - header_params = {} - if request.name - header_params["name"] = request.name - end - - request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") - metadata[:"x-goog-request-params"] ||= request_params_header - - options.apply_defaults timeout: @config.rpcs.delete_big_query_export.timeout, - metadata: metadata, - retry_policy: @config.rpcs.delete_big_query_export.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @security_center_stub.call_rpc :delete_big_query_export, 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 BigQuery export. - # - # @overload update_big_query_export(request, options = nil) - # Pass arguments to `update_big_query_export` via a request object, either of type - # {::Google::Cloud::SecurityCenter::V1::UpdateBigQueryExportRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::SecurityCenter::V1::UpdateBigQueryExportRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_big_query_export(big_query_export: nil, update_mask: nil) - # Pass arguments to `update_big_query_export` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param big_query_export [::Google::Cloud::SecurityCenter::V1::BigQueryExport, ::Hash] - # Required. The BigQuery export being updated. - # @param update_mask [::Google::Protobuf::FieldMask, ::Hash] - # The list of fields to be updated. - # If empty all mutable fields will be updated. - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Google::Cloud::SecurityCenter::V1::BigQueryExport] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Google::Cloud::SecurityCenter::V1::BigQueryExport] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/cloud/security_center/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::SecurityCenter::V1::SecurityCenter::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::SecurityCenter::V1::UpdateBigQueryExportRequest.new - # - # # Call the update_big_query_export method. - # result = client.update_big_query_export request - # - # # The returned object is of type Google::Cloud::SecurityCenter::V1::BigQueryExport. - # p result - # - def update_big_query_export request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::SecurityCenter::V1::UpdateBigQueryExportRequest - - # Converts hash 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_big_query_export.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::SecurityCenter::V1::VERSION - metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - header_params = {} - if request.big_query_export&.name - header_params["big_query_export.name"] = request.big_query_export.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_big_query_export.timeout, - metadata: metadata, - retry_policy: @config.rpcs.update_big_query_export.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @security_center_stub.call_rpc :update_big_query_export, request, options: options do |response, operation| - yield response, operation if block_given? - end - rescue ::GRPC::BadStatus => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Lists BigQuery exports. Note that when requesting BigQuery exports at a - # given level all exports under that level are also returned e.g. if - # requesting BigQuery exports under a folder, then all BigQuery exports - # immediately under the folder plus the ones created under the projects - # within the folder are returned. - # - # @overload list_big_query_exports(request, options = nil) - # Pass arguments to `list_big_query_exports` via a request object, either of type - # {::Google::Cloud::SecurityCenter::V1::ListBigQueryExportsRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::SecurityCenter::V1::ListBigQueryExportsRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_big_query_exports(parent: nil, page_size: nil, page_token: nil) - # Pass arguments to `list_big_query_exports` via keyword arguments. Note that at - # least one keyword argument is 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, which owns the collection of BigQuery exports. Its - # format is `organizations/[organization_id]`, `folders/[folder_id]`, - # `projects/[project_id]`. - # @param page_size [::Integer] - # The maximum number of configs to return. The service may return fewer than - # this value. - # If unspecified, at most 10 configs will be returned. - # The maximum value is 1000; values above 1000 will be coerced to 1000. - # @param page_token [::String] - # A page token, received from a previous `ListBigQueryExports` call. - # Provide this to retrieve the subsequent page. - # When paginating, all other parameters provided to `ListBigQueryExports` - # 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::Cloud::SecurityCenter::V1::BigQueryExport>] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Gapic::PagedEnumerable<::Google::Cloud::SecurityCenter::V1::BigQueryExport>] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/cloud/security_center/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::SecurityCenter::V1::SecurityCenter::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::SecurityCenter::V1::ListBigQueryExportsRequest.new - # - # # Call the list_big_query_exports method. - # result = client.list_big_query_exports request - # - # # The returned object is of type Gapic::PagedEnumerable. You can iterate - # # over elements, and API calls will be issued to fetch pages as needed. - # result.each do |item| - # # Each element is of type ::Google::Cloud::SecurityCenter::V1::BigQueryExport. - # p item - # end - # - def list_big_query_exports request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::SecurityCenter::V1::ListBigQueryExportsRequest - - # Converts hash 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_big_query_exports.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::SecurityCenter::V1::VERSION - metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - header_params = {} - if request.parent - header_params["parent"] = request.parent - end - - request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") - metadata[:"x-goog-request-params"] ||= request_params_header - - options.apply_defaults timeout: @config.rpcs.list_big_query_exports.timeout, - metadata: metadata, - retry_policy: @config.rpcs.list_big_query_exports.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @security_center_stub.call_rpc :list_big_query_exports, request, options: options do |response, operation| - response = ::Gapic::PagedEnumerable.new @security_center_stub, :list_big_query_exports, request, response, operation, options - yield response, operation if block_given? - throw :response, response - end - rescue ::GRPC::BadStatus => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Creates a resident Event Threat Detection custom module at the scope of the - # given Resource Manager parent, and also creates inherited custom modules - # for all descendants of the given parent. These modules are enabled by - # default. - # - # @overload create_event_threat_detection_custom_module(request, options = nil) - # Pass arguments to `create_event_threat_detection_custom_module` via a request object, either of type - # {::Google::Cloud::SecurityCenter::V1::CreateEventThreatDetectionCustomModuleRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::SecurityCenter::V1::CreateEventThreatDetectionCustomModuleRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_event_threat_detection_custom_module(parent: nil, event_threat_detection_custom_module: nil) - # Pass arguments to `create_event_threat_detection_custom_module` via keyword arguments. Note that at - # least one keyword argument is 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 new custom module's parent. - # - # Its format is: - # - # * `organizations/{organization}/eventThreatDetectionSettings`. - # * `folders/{folder}/eventThreatDetectionSettings`. - # * `projects/{project}/eventThreatDetectionSettings`. - # @param event_threat_detection_custom_module [::Google::Cloud::SecurityCenter::V1::EventThreatDetectionCustomModule, ::Hash] - # Required. The module to create. The - # event_threat_detection_custom_module.name will be ignored and server - # generated. - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Google::Cloud::SecurityCenter::V1::EventThreatDetectionCustomModule] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Google::Cloud::SecurityCenter::V1::EventThreatDetectionCustomModule] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/cloud/security_center/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::SecurityCenter::V1::SecurityCenter::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::SecurityCenter::V1::CreateEventThreatDetectionCustomModuleRequest.new - # - # # Call the create_event_threat_detection_custom_module method. - # result = client.create_event_threat_detection_custom_module request - # - # # The returned object is of type Google::Cloud::SecurityCenter::V1::EventThreatDetectionCustomModule. - # p result - # - def create_event_threat_detection_custom_module request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::SecurityCenter::V1::CreateEventThreatDetectionCustomModuleRequest - - # Converts hash 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_event_threat_detection_custom_module.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::SecurityCenter::V1::VERSION - metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - header_params = {} - if request.parent - header_params["parent"] = request.parent - end - - request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") - metadata[:"x-goog-request-params"] ||= request_params_header - - options.apply_defaults timeout: @config.rpcs.create_event_threat_detection_custom_module.timeout, - metadata: metadata, - retry_policy: @config.rpcs.create_event_threat_detection_custom_module.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @security_center_stub.call_rpc :create_event_threat_detection_custom_module, request, options: options do |response, operation| - yield response, operation if block_given? - end - rescue ::GRPC::BadStatus => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Deletes the specified Event Threat Detection custom module and all of its - # descendants in the Resource Manager hierarchy. This method is only - # supported for resident custom modules. - # - # @overload delete_event_threat_detection_custom_module(request, options = nil) - # Pass arguments to `delete_event_threat_detection_custom_module` via a request object, either of type - # {::Google::Cloud::SecurityCenter::V1::DeleteEventThreatDetectionCustomModuleRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::SecurityCenter::V1::DeleteEventThreatDetectionCustomModuleRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_event_threat_detection_custom_module(name: nil) - # Pass arguments to `delete_event_threat_detection_custom_module` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param name [::String] - # Required. Name of the custom module to delete. - # - # Its format is: - # - # * `organizations/{organization}/eventThreatDetectionSettings/customModules/{module}`. - # * `folders/{folder}/eventThreatDetectionSettings/customModules/{module}`. - # * `projects/{project}/eventThreatDetectionSettings/customModules/{module}`. - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Google::Protobuf::Empty] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Google::Protobuf::Empty] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/cloud/security_center/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::SecurityCenter::V1::SecurityCenter::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::SecurityCenter::V1::DeleteEventThreatDetectionCustomModuleRequest.new - # - # # Call the delete_event_threat_detection_custom_module method. - # result = client.delete_event_threat_detection_custom_module request - # - # # The returned object is of type Google::Protobuf::Empty. - # p result - # - def delete_event_threat_detection_custom_module request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::SecurityCenter::V1::DeleteEventThreatDetectionCustomModuleRequest - - # Converts hash 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_event_threat_detection_custom_module.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::SecurityCenter::V1::VERSION - metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - header_params = {} - if request.name - header_params["name"] = request.name - end - - request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") - metadata[:"x-goog-request-params"] ||= request_params_header - - options.apply_defaults timeout: @config.rpcs.delete_event_threat_detection_custom_module.timeout, - metadata: metadata, - retry_policy: @config.rpcs.delete_event_threat_detection_custom_module.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @security_center_stub.call_rpc :delete_event_threat_detection_custom_module, request, options: options do |response, operation| - yield response, operation if block_given? - end - rescue ::GRPC::BadStatus => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Gets an Event Threat Detection custom module. - # - # @overload get_event_threat_detection_custom_module(request, options = nil) - # Pass arguments to `get_event_threat_detection_custom_module` via a request object, either of type - # {::Google::Cloud::SecurityCenter::V1::GetEventThreatDetectionCustomModuleRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::SecurityCenter::V1::GetEventThreatDetectionCustomModuleRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_event_threat_detection_custom_module(name: nil) - # Pass arguments to `get_event_threat_detection_custom_module` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param name [::String] - # Required. Name of the custom module to get. - # - # Its format is: - # - # * `organizations/{organization}/eventThreatDetectionSettings/customModules/{module}`. - # * `folders/{folder}/eventThreatDetectionSettings/customModules/{module}`. - # * `projects/{project}/eventThreatDetectionSettings/customModules/{module}`. - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Google::Cloud::SecurityCenter::V1::EventThreatDetectionCustomModule] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Google::Cloud::SecurityCenter::V1::EventThreatDetectionCustomModule] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/cloud/security_center/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::SecurityCenter::V1::SecurityCenter::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::SecurityCenter::V1::GetEventThreatDetectionCustomModuleRequest.new - # - # # Call the get_event_threat_detection_custom_module method. - # result = client.get_event_threat_detection_custom_module request - # - # # The returned object is of type Google::Cloud::SecurityCenter::V1::EventThreatDetectionCustomModule. - # p result - # - def get_event_threat_detection_custom_module request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::SecurityCenter::V1::GetEventThreatDetectionCustomModuleRequest - - # Converts hash 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_event_threat_detection_custom_module.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::SecurityCenter::V1::VERSION - metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - header_params = {} - if request.name - header_params["name"] = request.name - end - - request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") - metadata[:"x-goog-request-params"] ||= request_params_header - - options.apply_defaults timeout: @config.rpcs.get_event_threat_detection_custom_module.timeout, - metadata: metadata, - retry_policy: @config.rpcs.get_event_threat_detection_custom_module.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @security_center_stub.call_rpc :get_event_threat_detection_custom_module, request, options: options do |response, operation| - yield response, operation if block_given? - end - rescue ::GRPC::BadStatus => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Lists all resident Event Threat Detection custom modules under the - # given Resource Manager parent and its descendants. - # - # @overload list_descendant_event_threat_detection_custom_modules(request, options = nil) - # Pass arguments to `list_descendant_event_threat_detection_custom_modules` via a request object, either of type - # {::Google::Cloud::SecurityCenter::V1::ListDescendantEventThreatDetectionCustomModulesRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::SecurityCenter::V1::ListDescendantEventThreatDetectionCustomModulesRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_descendant_event_threat_detection_custom_modules(parent: nil, page_token: nil, page_size: nil) - # Pass arguments to `list_descendant_event_threat_detection_custom_modules` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param parent [::String] - # Required. Name of the parent to list custom modules under. - # - # Its format is: - # - # * `organizations/{organization}/eventThreatDetectionSettings`. - # * `folders/{folder}/eventThreatDetectionSettings`. - # * `projects/{project}/eventThreatDetectionSettings`. - # @param page_token [::String] - # A page token, received from a previous - # `ListDescendantEventThreatDetectionCustomModules` call. Provide this to - # retrieve the subsequent page. - # - # When paginating, all other parameters provided to - # `ListDescendantEventThreatDetectionCustomModules` must match the call that - # provided the page token. - # @param page_size [::Integer] - # The maximum number of modules to return. The service may return fewer than - # this value. - # If unspecified, at most 10 configs will be returned. - # The maximum value is 1000; values above 1000 will be coerced to 1000. - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Gapic::PagedEnumerable<::Google::Cloud::SecurityCenter::V1::EventThreatDetectionCustomModule>] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Gapic::PagedEnumerable<::Google::Cloud::SecurityCenter::V1::EventThreatDetectionCustomModule>] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/cloud/security_center/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::SecurityCenter::V1::SecurityCenter::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::SecurityCenter::V1::ListDescendantEventThreatDetectionCustomModulesRequest.new - # - # # Call the list_descendant_event_threat_detection_custom_modules method. - # result = client.list_descendant_event_threat_detection_custom_modules request - # - # # The returned object is of type Gapic::PagedEnumerable. You can iterate - # # over elements, and API calls will be issued to fetch pages as needed. - # result.each do |item| - # # Each element is of type ::Google::Cloud::SecurityCenter::V1::EventThreatDetectionCustomModule. - # p item - # end - # - def list_descendant_event_threat_detection_custom_modules request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::SecurityCenter::V1::ListDescendantEventThreatDetectionCustomModulesRequest - - # Converts hash 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_descendant_event_threat_detection_custom_modules.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::SecurityCenter::V1::VERSION - metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - header_params = {} - if request.parent - header_params["parent"] = request.parent - end - - request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") - metadata[:"x-goog-request-params"] ||= request_params_header - - options.apply_defaults timeout: @config.rpcs.list_descendant_event_threat_detection_custom_modules.timeout, - metadata: metadata, - retry_policy: @config.rpcs.list_descendant_event_threat_detection_custom_modules.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @security_center_stub.call_rpc :list_descendant_event_threat_detection_custom_modules, request, options: options do |response, operation| - response = ::Gapic::PagedEnumerable.new @security_center_stub, :list_descendant_event_threat_detection_custom_modules, 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 - - ## - # Lists all Event Threat Detection custom modules for the given - # Resource Manager parent. This includes resident modules defined at the - # scope of the parent along with modules inherited from ancestors. - # - # @overload list_event_threat_detection_custom_modules(request, options = nil) - # Pass arguments to `list_event_threat_detection_custom_modules` via a request object, either of type - # {::Google::Cloud::SecurityCenter::V1::ListEventThreatDetectionCustomModulesRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::SecurityCenter::V1::ListEventThreatDetectionCustomModulesRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_event_threat_detection_custom_modules(parent: nil, page_token: nil, page_size: nil) - # Pass arguments to `list_event_threat_detection_custom_modules` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param parent [::String] - # Required. Name of the parent to list custom modules under. - # - # Its format is: - # - # * `organizations/{organization}/eventThreatDetectionSettings`. - # * `folders/{folder}/eventThreatDetectionSettings`. - # * `projects/{project}/eventThreatDetectionSettings`. - # @param page_token [::String] - # A page token, received from a previous - # `ListEventThreatDetectionCustomModules` call. Provide this to retrieve the - # subsequent page. - # - # When paginating, all other parameters provided to - # `ListEventThreatDetectionCustomModules` must match the call that provided - # the page token. - # @param page_size [::Integer] - # The maximum number of modules to return. The service may return fewer than - # this value. - # If unspecified, at most 10 configs will be returned. - # The maximum value is 1000; values above 1000 will be coerced to 1000. - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Gapic::PagedEnumerable<::Google::Cloud::SecurityCenter::V1::EventThreatDetectionCustomModule>] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Gapic::PagedEnumerable<::Google::Cloud::SecurityCenter::V1::EventThreatDetectionCustomModule>] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/cloud/security_center/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::SecurityCenter::V1::SecurityCenter::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::SecurityCenter::V1::ListEventThreatDetectionCustomModulesRequest.new - # - # # Call the list_event_threat_detection_custom_modules method. - # result = client.list_event_threat_detection_custom_modules request - # - # # The returned object is of type Gapic::PagedEnumerable. You can iterate - # # over elements, and API calls will be issued to fetch pages as needed. - # result.each do |item| - # # Each element is of type ::Google::Cloud::SecurityCenter::V1::EventThreatDetectionCustomModule. - # p item - # end - # - def list_event_threat_detection_custom_modules request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::SecurityCenter::V1::ListEventThreatDetectionCustomModulesRequest - - # Converts hash 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_event_threat_detection_custom_modules.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::SecurityCenter::V1::VERSION - metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - header_params = {} - if request.parent - header_params["parent"] = request.parent - end - - request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") - metadata[:"x-goog-request-params"] ||= request_params_header - - options.apply_defaults timeout: @config.rpcs.list_event_threat_detection_custom_modules.timeout, - metadata: metadata, - retry_policy: @config.rpcs.list_event_threat_detection_custom_modules.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @security_center_stub.call_rpc :list_event_threat_detection_custom_modules, request, options: options do |response, operation| - response = ::Gapic::PagedEnumerable.new @security_center_stub, :list_event_threat_detection_custom_modules, 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 - - ## - # Updates the Event Threat Detection custom module with the given name based - # on the given update mask. Updating the enablement state is supported for - # both resident and inherited modules (though resident modules cannot have an - # enablement state of "inherited"). Updating the display name or - # configuration of a module is supported for resident modules only. The type - # of a module cannot be changed. - # - # @overload update_event_threat_detection_custom_module(request, options = nil) - # Pass arguments to `update_event_threat_detection_custom_module` via a request object, either of type - # {::Google::Cloud::SecurityCenter::V1::UpdateEventThreatDetectionCustomModuleRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::SecurityCenter::V1::UpdateEventThreatDetectionCustomModuleRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_event_threat_detection_custom_module(event_threat_detection_custom_module: nil, update_mask: nil) - # Pass arguments to `update_event_threat_detection_custom_module` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param event_threat_detection_custom_module [::Google::Cloud::SecurityCenter::V1::EventThreatDetectionCustomModule, ::Hash] - # Required. The module being updated. - # @param update_mask [::Google::Protobuf::FieldMask, ::Hash] - # The list of fields to be updated. - # If empty all mutable fields will be updated. - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Google::Cloud::SecurityCenter::V1::EventThreatDetectionCustomModule] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Google::Cloud::SecurityCenter::V1::EventThreatDetectionCustomModule] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/cloud/security_center/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::SecurityCenter::V1::SecurityCenter::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::SecurityCenter::V1::UpdateEventThreatDetectionCustomModuleRequest.new - # - # # Call the update_event_threat_detection_custom_module method. - # result = client.update_event_threat_detection_custom_module request - # - # # The returned object is of type Google::Cloud::SecurityCenter::V1::EventThreatDetectionCustomModule. - # p result - # - def update_event_threat_detection_custom_module request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::SecurityCenter::V1::UpdateEventThreatDetectionCustomModuleRequest - - # Converts hash 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_event_threat_detection_custom_module.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::SecurityCenter::V1::VERSION - metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - header_params = {} - if request.event_threat_detection_custom_module&.name - header_params["event_threat_detection_custom_module.name"] = request.event_threat_detection_custom_module.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_event_threat_detection_custom_module.timeout, - metadata: metadata, - retry_policy: @config.rpcs.update_event_threat_detection_custom_module.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @security_center_stub.call_rpc :update_event_threat_detection_custom_module, 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 - - ## - # Validates the given Event Threat Detection custom module. - # - # @overload validate_event_threat_detection_custom_module(request, options = nil) - # Pass arguments to `validate_event_threat_detection_custom_module` via a request object, either of type - # {::Google::Cloud::SecurityCenter::V1::ValidateEventThreatDetectionCustomModuleRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::SecurityCenter::V1::ValidateEventThreatDetectionCustomModuleRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. - # - # @overload validate_event_threat_detection_custom_module(parent: nil, raw_text: nil, type: nil) - # Pass arguments to `validate_event_threat_detection_custom_module` via keyword arguments. Note that at - # least one keyword argument is 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. Resource name of the parent to validate the Custom Module under. - # - # Its format is: - # - # * `organizations/{organization}/eventThreatDetectionSettings`. - # * `folders/{folder}/eventThreatDetectionSettings`. - # * `projects/{project}/eventThreatDetectionSettings`. - # @param raw_text [::String] - # Required. The raw text of the module's contents. Used to generate error - # messages. - # @param type [::String] - # Required. The type of the module (e.g. CONFIGURABLE_BAD_IP). - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Google::Cloud::SecurityCenter::V1::ValidateEventThreatDetectionCustomModuleResponse] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Google::Cloud::SecurityCenter::V1::ValidateEventThreatDetectionCustomModuleResponse] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/cloud/security_center/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::SecurityCenter::V1::SecurityCenter::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::SecurityCenter::V1::ValidateEventThreatDetectionCustomModuleRequest.new - # - # # Call the validate_event_threat_detection_custom_module method. - # result = client.validate_event_threat_detection_custom_module request - # - # # The returned object is of type Google::Cloud::SecurityCenter::V1::ValidateEventThreatDetectionCustomModuleResponse. - # p result - # - def validate_event_threat_detection_custom_module request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::SecurityCenter::V1::ValidateEventThreatDetectionCustomModuleRequest - - # Converts hash 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.validate_event_threat_detection_custom_module.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::SecurityCenter::V1::VERSION - metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - header_params = {} - if request.parent - header_params["parent"] = request.parent - end - - request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") - metadata[:"x-goog-request-params"] ||= request_params_header - - options.apply_defaults timeout: @config.rpcs.validate_event_threat_detection_custom_module.timeout, - metadata: metadata, - retry_policy: @config.rpcs.validate_event_threat_detection_custom_module.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @security_center_stub.call_rpc :validate_event_threat_detection_custom_module, request, options: options do |response, operation| - yield response, operation if block_given? - end - rescue ::GRPC::BadStatus => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Gets an effective Event Threat Detection custom module at the given level. - # - # @overload get_effective_event_threat_detection_custom_module(request, options = nil) - # Pass arguments to `get_effective_event_threat_detection_custom_module` via a request object, either of type - # {::Google::Cloud::SecurityCenter::V1::GetEffectiveEventThreatDetectionCustomModuleRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::SecurityCenter::V1::GetEffectiveEventThreatDetectionCustomModuleRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_effective_event_threat_detection_custom_module(name: nil) - # Pass arguments to `get_effective_event_threat_detection_custom_module` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param name [::String] - # Required. The resource name of the effective Event Threat Detection custom - # module. - # - # Its format is: - # - # * `organizations/{organization}/eventThreatDetectionSettings/effectiveCustomModules/{module}`. - # * `folders/{folder}/eventThreatDetectionSettings/effectiveCustomModules/{module}`. - # * `projects/{project}/eventThreatDetectionSettings/effectiveCustomModules/{module}`. - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Google::Cloud::SecurityCenter::V1::EffectiveEventThreatDetectionCustomModule] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Google::Cloud::SecurityCenter::V1::EffectiveEventThreatDetectionCustomModule] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/cloud/security_center/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::SecurityCenter::V1::SecurityCenter::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::SecurityCenter::V1::GetEffectiveEventThreatDetectionCustomModuleRequest.new - # - # # Call the get_effective_event_threat_detection_custom_module method. - # result = client.get_effective_event_threat_detection_custom_module request - # - # # The returned object is of type Google::Cloud::SecurityCenter::V1::EffectiveEventThreatDetectionCustomModule. - # p result - # - def get_effective_event_threat_detection_custom_module request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::SecurityCenter::V1::GetEffectiveEventThreatDetectionCustomModuleRequest - - # Converts hash 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_effective_event_threat_detection_custom_module.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::SecurityCenter::V1::VERSION - metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - header_params = {} - if request.name - header_params["name"] = request.name - end - - request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") - metadata[:"x-goog-request-params"] ||= request_params_header - - options.apply_defaults timeout: @config.rpcs.get_effective_event_threat_detection_custom_module.timeout, - metadata: metadata, - retry_policy: @config.rpcs.get_effective_event_threat_detection_custom_module.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @security_center_stub.call_rpc :get_effective_event_threat_detection_custom_module, request, options: options do |response, operation| - yield response, operation if block_given? - end - rescue ::GRPC::BadStatus => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Lists all effective Event Threat Detection custom modules for the - # given parent. This includes resident modules defined at the scope of the - # parent along with modules inherited from its ancestors. - # - # @overload list_effective_event_threat_detection_custom_modules(request, options = nil) - # Pass arguments to `list_effective_event_threat_detection_custom_modules` via a request object, either of type - # {::Google::Cloud::SecurityCenter::V1::ListEffectiveEventThreatDetectionCustomModulesRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::SecurityCenter::V1::ListEffectiveEventThreatDetectionCustomModulesRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_effective_event_threat_detection_custom_modules(parent: nil, page_token: nil, page_size: nil) - # Pass arguments to `list_effective_event_threat_detection_custom_modules` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param parent [::String] - # Required. Name of the parent to list custom modules for. - # - # Its format is: - # - # * `organizations/{organization}/eventThreatDetectionSettings`. - # * `folders/{folder}/eventThreatDetectionSettings`. - # * `projects/{project}/eventThreatDetectionSettings`. - # @param page_token [::String] - # A page token, received from a previous - # `ListEffectiveEventThreatDetectionCustomModules` call. Provide this to - # retrieve the subsequent page. - # - # When paginating, all other parameters provided to - # `ListEffectiveEventThreatDetectionCustomModules` must match the call that - # provided the page token. - # @param page_size [::Integer] - # The maximum number of modules to return. The service may return fewer than - # this value. - # If unspecified, at most 10 configs will be returned. - # The maximum value is 1000; values above 1000 will be coerced to 1000. - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Gapic::PagedEnumerable<::Google::Cloud::SecurityCenter::V1::EffectiveEventThreatDetectionCustomModule>] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Gapic::PagedEnumerable<::Google::Cloud::SecurityCenter::V1::EffectiveEventThreatDetectionCustomModule>] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/cloud/security_center/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::SecurityCenter::V1::SecurityCenter::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::SecurityCenter::V1::ListEffectiveEventThreatDetectionCustomModulesRequest.new - # - # # Call the list_effective_event_threat_detection_custom_modules method. - # result = client.list_effective_event_threat_detection_custom_modules request - # - # # The returned object is of type Gapic::PagedEnumerable. You can iterate - # # over elements, and API calls will be issued to fetch pages as needed. - # result.each do |item| - # # Each element is of type ::Google::Cloud::SecurityCenter::V1::EffectiveEventThreatDetectionCustomModule. - # p item - # end - # - def list_effective_event_threat_detection_custom_modules request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::SecurityCenter::V1::ListEffectiveEventThreatDetectionCustomModulesRequest - - # Converts hash 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_effective_event_threat_detection_custom_modules.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::SecurityCenter::V1::VERSION - metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - header_params = {} - if request.parent - header_params["parent"] = request.parent - end - - request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") - metadata[:"x-goog-request-params"] ||= request_params_header - - options.apply_defaults timeout: @config.rpcs.list_effective_event_threat_detection_custom_modules.timeout, - metadata: metadata, - retry_policy: @config.rpcs.list_effective_event_threat_detection_custom_modules.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @security_center_stub.call_rpc :list_effective_event_threat_detection_custom_modules, request, options: options do |response, operation| - response = ::Gapic::PagedEnumerable.new @security_center_stub, :list_effective_event_threat_detection_custom_modules, request, response, operation, options - yield response, operation if block_given? - throw :response, response - end - rescue ::GRPC::BadStatus => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Creates a ResourceValueConfig for an organization. Maps user's tags to - # difference resource values for use by the attack path simulation. - # - # @overload batch_create_resource_value_configs(request, options = nil) - # Pass arguments to `batch_create_resource_value_configs` via a request object, either of type - # {::Google::Cloud::SecurityCenter::V1::BatchCreateResourceValueConfigsRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::SecurityCenter::V1::BatchCreateResourceValueConfigsRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. - # - # @overload batch_create_resource_value_configs(parent: nil, requests: nil) - # Pass arguments to `batch_create_resource_value_configs` via keyword arguments. Note that at - # least one keyword argument is 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. Resource name of the new ResourceValueConfig's parent. - # The parent field in the CreateResourceValueConfigRequest - # messages must either be empty or match this field. - # @param requests [::Array<::Google::Cloud::SecurityCenter::V1::CreateResourceValueConfigRequest, ::Hash>] - # Required. The resource value configs to be created. - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Google::Cloud::SecurityCenter::V1::BatchCreateResourceValueConfigsResponse] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Google::Cloud::SecurityCenter::V1::BatchCreateResourceValueConfigsResponse] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/cloud/security_center/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::SecurityCenter::V1::SecurityCenter::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::SecurityCenter::V1::BatchCreateResourceValueConfigsRequest.new - # - # # Call the batch_create_resource_value_configs method. - # result = client.batch_create_resource_value_configs request - # - # # The returned object is of type Google::Cloud::SecurityCenter::V1::BatchCreateResourceValueConfigsResponse. - # p result - # - def batch_create_resource_value_configs request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::SecurityCenter::V1::BatchCreateResourceValueConfigsRequest - - # Converts hash 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.batch_create_resource_value_configs.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::SecurityCenter::V1::VERSION - metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - header_params = {} - if request.parent - header_params["parent"] = request.parent - end - - request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") - metadata[:"x-goog-request-params"] ||= request_params_header - - options.apply_defaults timeout: @config.rpcs.batch_create_resource_value_configs.timeout, - metadata: metadata, - retry_policy: @config.rpcs.batch_create_resource_value_configs.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @security_center_stub.call_rpc :batch_create_resource_value_configs, request, options: options do |response, operation| - yield response, operation if block_given? - end - rescue ::GRPC::BadStatus => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Deletes a ResourceValueConfig. - # - # @overload delete_resource_value_config(request, options = nil) - # Pass arguments to `delete_resource_value_config` via a request object, either of type - # {::Google::Cloud::SecurityCenter::V1::DeleteResourceValueConfigRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::SecurityCenter::V1::DeleteResourceValueConfigRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_resource_value_config(name: nil) - # Pass arguments to `delete_resource_value_config` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param name [::String] - # Required. Name of the ResourceValueConfig to delete - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Google::Protobuf::Empty] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Google::Protobuf::Empty] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/cloud/security_center/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::SecurityCenter::V1::SecurityCenter::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::SecurityCenter::V1::DeleteResourceValueConfigRequest.new - # - # # Call the delete_resource_value_config method. - # result = client.delete_resource_value_config request - # - # # The returned object is of type Google::Protobuf::Empty. - # p result - # - def delete_resource_value_config request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::SecurityCenter::V1::DeleteResourceValueConfigRequest - - # Converts hash 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_resource_value_config.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::SecurityCenter::V1::VERSION - metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - header_params = {} - if request.name - header_params["name"] = request.name - end - - request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") - metadata[:"x-goog-request-params"] ||= request_params_header - - options.apply_defaults timeout: @config.rpcs.delete_resource_value_config.timeout, - metadata: metadata, - retry_policy: @config.rpcs.delete_resource_value_config.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @security_center_stub.call_rpc :delete_resource_value_config, request, options: options do |response, operation| - yield response, operation if block_given? - end - rescue ::GRPC::BadStatus => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Gets a ResourceValueConfig. - # - # @overload get_resource_value_config(request, options = nil) - # Pass arguments to `get_resource_value_config` via a request object, either of type - # {::Google::Cloud::SecurityCenter::V1::GetResourceValueConfigRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::SecurityCenter::V1::GetResourceValueConfigRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_resource_value_config(name: nil) - # Pass arguments to `get_resource_value_config` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param name [::String] - # Required. Name of the resource value config to retrieve. Its format is - # `organizations/{organization}/resourceValueConfigs/{config_id}`. - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Google::Cloud::SecurityCenter::V1::ResourceValueConfig] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Google::Cloud::SecurityCenter::V1::ResourceValueConfig] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/cloud/security_center/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::SecurityCenter::V1::SecurityCenter::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::SecurityCenter::V1::GetResourceValueConfigRequest.new - # - # # Call the get_resource_value_config method. - # result = client.get_resource_value_config request - # - # # The returned object is of type Google::Cloud::SecurityCenter::V1::ResourceValueConfig. - # p result - # - def get_resource_value_config request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::SecurityCenter::V1::GetResourceValueConfigRequest - - # Converts hash 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_resource_value_config.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::SecurityCenter::V1::VERSION - metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - header_params = {} - if request.name - header_params["name"] = request.name - end - - request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") - metadata[:"x-goog-request-params"] ||= request_params_header - - options.apply_defaults timeout: @config.rpcs.get_resource_value_config.timeout, - metadata: metadata, - retry_policy: @config.rpcs.get_resource_value_config.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @security_center_stub.call_rpc :get_resource_value_config, request, options: options do |response, operation| - yield response, operation if block_given? - end - rescue ::GRPC::BadStatus => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Lists all ResourceValueConfigs. - # - # @overload list_resource_value_configs(request, options = nil) - # Pass arguments to `list_resource_value_configs` via a request object, either of type - # {::Google::Cloud::SecurityCenter::V1::ListResourceValueConfigsRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::SecurityCenter::V1::ListResourceValueConfigsRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_resource_value_configs(parent: nil, page_size: nil, page_token: nil) - # Pass arguments to `list_resource_value_configs` via keyword arguments. Note that at - # least one keyword argument is 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, which owns the collection of resource value configs. - # Its format is - # `organizations/[organization_id]` - # @param page_size [::Integer] - # The number of results to return. The service may return fewer than - # this value. - # If unspecified, at most 10 configs will be returned. - # The maximum value is 1000; values above 1000 will be coerced to 1000. - # @param page_token [::String] - # A page token, received from a previous `ListResourceValueConfigs` call. - # Provide this to retrieve the subsequent page. - # - # When paginating, all other parameters provided to - # `ListResourceValueConfigs` must match the call that provided the - # page token. - # - # page_size can be specified, and the new page_size will be used. - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Gapic::PagedEnumerable<::Google::Cloud::SecurityCenter::V1::ResourceValueConfig>] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Gapic::PagedEnumerable<::Google::Cloud::SecurityCenter::V1::ResourceValueConfig>] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/cloud/security_center/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::SecurityCenter::V1::SecurityCenter::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::SecurityCenter::V1::ListResourceValueConfigsRequest.new - # - # # Call the list_resource_value_configs method. - # result = client.list_resource_value_configs request - # - # # The returned object is of type Gapic::PagedEnumerable. You can iterate - # # over elements, and API calls will be issued to fetch pages as needed. - # result.each do |item| - # # Each element is of type ::Google::Cloud::SecurityCenter::V1::ResourceValueConfig. - # p item - # end - # - def list_resource_value_configs request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::SecurityCenter::V1::ListResourceValueConfigsRequest - - # Converts hash 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_resource_value_configs.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::SecurityCenter::V1::VERSION - metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - header_params = {} - if request.parent - header_params["parent"] = request.parent - end - - request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") - metadata[:"x-goog-request-params"] ||= request_params_header - - options.apply_defaults timeout: @config.rpcs.list_resource_value_configs.timeout, - metadata: metadata, - retry_policy: @config.rpcs.list_resource_value_configs.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @security_center_stub.call_rpc :list_resource_value_configs, request, options: options do |response, operation| - response = ::Gapic::PagedEnumerable.new @security_center_stub, :list_resource_value_configs, 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 - - ## - # Updates an existing ResourceValueConfigs with new rules. - # - # @overload update_resource_value_config(request, options = nil) - # Pass arguments to `update_resource_value_config` via a request object, either of type - # {::Google::Cloud::SecurityCenter::V1::UpdateResourceValueConfigRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::SecurityCenter::V1::UpdateResourceValueConfigRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_resource_value_config(resource_value_config: nil, update_mask: nil) - # Pass arguments to `update_resource_value_config` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param resource_value_config [::Google::Cloud::SecurityCenter::V1::ResourceValueConfig, ::Hash] - # Required. The resource value config being updated. - # @param update_mask [::Google::Protobuf::FieldMask, ::Hash] - # The list of fields to be updated. - # If empty all mutable fields will be updated. - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Google::Cloud::SecurityCenter::V1::ResourceValueConfig] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Google::Cloud::SecurityCenter::V1::ResourceValueConfig] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/cloud/security_center/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::SecurityCenter::V1::SecurityCenter::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::SecurityCenter::V1::UpdateResourceValueConfigRequest.new - # - # # Call the update_resource_value_config method. - # result = client.update_resource_value_config request - # - # # The returned object is of type Google::Cloud::SecurityCenter::V1::ResourceValueConfig. - # p result - # - def update_resource_value_config request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::SecurityCenter::V1::UpdateResourceValueConfigRequest - - # Converts hash 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_resource_value_config.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::SecurityCenter::V1::VERSION - metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - header_params = {} - if request.resource_value_config&.name - header_params["resource_value_config.name"] = request.resource_value_config.name - end - - request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") - metadata[:"x-goog-request-params"] ||= request_params_header - - options.apply_defaults timeout: @config.rpcs.update_resource_value_config.timeout, - metadata: metadata, - retry_policy: @config.rpcs.update_resource_value_config.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @security_center_stub.call_rpc :update_resource_value_config, request, options: options do |response, operation| - yield response, operation if block_given? - end - rescue ::GRPC::BadStatus => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Lists the valued resources for a set of simulation results and filter. - # - # @overload list_valued_resources(request, options = nil) - # Pass arguments to `list_valued_resources` via a request object, either of type - # {::Google::Cloud::SecurityCenter::V1::ListValuedResourcesRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::SecurityCenter::V1::ListValuedResourcesRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_valued_resources(parent: nil, filter: nil, page_token: nil, page_size: nil, order_by: nil) - # Pass arguments to `list_valued_resources` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param parent [::String] - # Required. Name of parent to list valued resources. - # - # Valid formats: - # `organizations/{organization}`, - # `organizations/{organization}/simulations/{simulation}` - # `organizations/{organization}/simulations/{simulation}/attackExposureResults/{attack_exposure_result_v2}` - # @param filter [::String] - # The filter expression that filters the valued resources in the response. - # Supported fields: - # - # * `resource_value` supports = - # * `resource_type` supports = - # @param page_token [::String] - # The value returned by the last `ListValuedResourcesResponse`; indicates - # that this is a continuation of a prior `ListValuedResources` call, and - # that the system should return the next page of data. - # @param page_size [::Integer] - # The maximum number of results to return in a single response. Default is - # 10, minimum is 1, maximum is 1000. - # @param order_by [::String] - # Optional. The fields by which to order the valued resources response. - # - # Supported fields: - # - # * `exposed_score` - # - # * `resource_value` - # - # * `resource_type` - # - # * `resource` - # - # * `display_name` - # - # Values should be a comma separated list of fields. For example: - # `exposed_score,resource_value`. - # - # The default sorting order is descending. To specify ascending or descending - # order for a field, append a ` ASC` or a ` DESC` suffix, respectively; for - # example: `exposed_score DESC`. - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Gapic::PagedEnumerable<::Google::Cloud::SecurityCenter::V1::ValuedResource>] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Gapic::PagedEnumerable<::Google::Cloud::SecurityCenter::V1::ValuedResource>] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/cloud/security_center/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::SecurityCenter::V1::SecurityCenter::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::SecurityCenter::V1::ListValuedResourcesRequest.new - # - # # Call the list_valued_resources method. - # result = client.list_valued_resources request - # - # # The returned object is of type Gapic::PagedEnumerable. You can iterate - # # over elements, and API calls will be issued to fetch pages as needed. - # result.each do |item| - # # Each element is of type ::Google::Cloud::SecurityCenter::V1::ValuedResource. - # p item - # end - # - def list_valued_resources request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::SecurityCenter::V1::ListValuedResourcesRequest - - # Converts hash 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_valued_resources.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::SecurityCenter::V1::VERSION - metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - header_params = {} - if request.parent - header_params["parent"] = request.parent - end - - request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") - metadata[:"x-goog-request-params"] ||= request_params_header - - options.apply_defaults timeout: @config.rpcs.list_valued_resources.timeout, - metadata: metadata, - retry_policy: @config.rpcs.list_valued_resources.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @security_center_stub.call_rpc :list_valued_resources, request, options: options do |response, operation| - response = ::Gapic::PagedEnumerable.new @security_center_stub, :list_valued_resources, 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 - - ## - # Lists the attack paths for a set of simulation results or valued resources - # and filter. - # - # @overload list_attack_paths(request, options = nil) - # Pass arguments to `list_attack_paths` via a request object, either of type - # {::Google::Cloud::SecurityCenter::V1::ListAttackPathsRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::SecurityCenter::V1::ListAttackPathsRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_attack_paths(parent: nil, filter: nil, page_token: nil, page_size: nil) - # Pass arguments to `list_attack_paths` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param parent [::String] - # Required. Name of parent to list attack paths. - # - # Valid formats: - # `organizations/{organization}`, - # `organizations/{organization}/simulations/{simulation}` - # `organizations/{organization}/simulations/{simulation}/attackExposureResults/{attack_exposure_result_v2}` - # `organizations/{organization}/simulations/{simulation}/valuedResources/{valued_resource}` - # @param filter [::String] - # The filter expression that filters the attack path in the response. - # Supported fields: - # - # * `valued_resources` supports = - # @param page_token [::String] - # The value returned by the last `ListAttackPathsResponse`; indicates - # that this is a continuation of a prior `ListAttackPaths` call, and - # that the system should return the next page of data. - # @param page_size [::Integer] - # The maximum number of results to return in a single response. Default is - # 10, minimum is 1, maximum is 1000. - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Gapic::PagedEnumerable<::Google::Cloud::SecurityCenter::V1::AttackPath>] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Gapic::PagedEnumerable<::Google::Cloud::SecurityCenter::V1::AttackPath>] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/cloud/security_center/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::SecurityCenter::V1::SecurityCenter::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::SecurityCenter::V1::ListAttackPathsRequest.new - # - # # Call the list_attack_paths method. - # result = client.list_attack_paths request - # - # # The returned object is of type Gapic::PagedEnumerable. You can iterate - # # over elements, and API calls will be issued to fetch pages as needed. - # result.each do |item| - # # Each element is of type ::Google::Cloud::SecurityCenter::V1::AttackPath. - # p item - # end - # - def list_attack_paths request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::SecurityCenter::V1::ListAttackPathsRequest - - # Converts hash 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_attack_paths.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::SecurityCenter::V1::VERSION - metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - header_params = {} - if request.parent - header_params["parent"] = request.parent - end - - request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") - metadata[:"x-goog-request-params"] ||= request_params_header - - options.apply_defaults timeout: @config.rpcs.list_attack_paths.timeout, - metadata: metadata, - retry_policy: @config.rpcs.list_attack_paths.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @security_center_stub.call_rpc :list_attack_paths, request, options: options do |response, operation| - response = ::Gapic::PagedEnumerable.new @security_center_stub, :list_attack_paths, 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 SecurityCenter API. - # - # This class represents the configuration for SecurityCenter, - # providing control over timeouts, retry behavior, logging, transport - # parameters, and other low-level controls. Certain parameters can also be - # applied individually to specific RPCs. See - # {::Google::Cloud::SecurityCenter::V1::SecurityCenter::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 - # # bulk_mute_findings to 20 seconds, - # # and all remaining timeouts to 10 seconds. - # ::Google::Cloud::SecurityCenter::V1::SecurityCenter::Client.configure do |config| - # config.timeout = 10.0 - # config.rpcs.bulk_mute_findings.timeout = 20.0 - # end - # - # # Apply the above configuration only to a new client. - # client = ::Google::Cloud::SecurityCenter::V1::SecurityCenter::Client.new do |config| - # config.timeout = 10.0 - # config.rpcs.bulk_mute_findings.timeout = 20.0 - # end - # - # @!attribute [rw] endpoint - # A custom service endpoint, as a hostname or hostname:port. The default is - # nil, indicating to use the default endpoint in the current universe domain. - # @return [::String,nil] - # @!attribute [rw] credentials - # Credentials to send with calls. You may provide any of the following types: - # * (`Google::Auth::Credentials`) A googleauth credentials object - # (see the [googleauth docs](https://rubydoc.info/gems/googleauth/Google/Auth/Credentials)) - # * (`Signet::OAuth2::Client`) A signet oauth2 client object - # (see the [signet docs](https://rubydoc.info/gems/signet/Signet/OAuth2/Client)) - # * (`GRPC::Core::Channel`) a gRPC channel with included credentials - # * (`GRPC::Core::ChannelCredentials`) a gRPC credentails object - # * (`nil`) indicating no credentials - # - # @note Warning: Passing a `String` to a keyfile path or a `Hash` of credentials - # is deprecated. Providing an unvalidated credential configuration to - # Google APIs can compromise the security of your systems and data. - # - # @example - # - # # The recommended way to provide credentials is to use the `make_creds` method - # # on the appropriate credentials class for your environment. - # - # require "googleauth" - # - # credentials = ::Google::Auth::ServiceAccountCredentials.make_creds( - # json_key_io: ::File.open("/path/to/keyfile.json") - # ) - # - # client = ::Google::Cloud::SecurityCenter::V1::SecurityCenter::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 = "securitycenter.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 SecurityCenter 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 `bulk_mute_findings` - # @return [::Gapic::Config::Method] - # - attr_reader :bulk_mute_findings - ## - # RPC-specific configuration for `create_security_health_analytics_custom_module` - # @return [::Gapic::Config::Method] - # - attr_reader :create_security_health_analytics_custom_module - ## - # RPC-specific configuration for `create_source` - # @return [::Gapic::Config::Method] - # - attr_reader :create_source - ## - # RPC-specific configuration for `create_finding` - # @return [::Gapic::Config::Method] - # - attr_reader :create_finding - ## - # RPC-specific configuration for `create_mute_config` - # @return [::Gapic::Config::Method] - # - attr_reader :create_mute_config - ## - # RPC-specific configuration for `create_notification_config` - # @return [::Gapic::Config::Method] - # - attr_reader :create_notification_config - ## - # RPC-specific configuration for `delete_mute_config` - # @return [::Gapic::Config::Method] - # - attr_reader :delete_mute_config - ## - # RPC-specific configuration for `delete_notification_config` - # @return [::Gapic::Config::Method] - # - attr_reader :delete_notification_config - ## - # RPC-specific configuration for `delete_security_health_analytics_custom_module` - # @return [::Gapic::Config::Method] - # - attr_reader :delete_security_health_analytics_custom_module - ## - # RPC-specific configuration for `get_simulation` - # @return [::Gapic::Config::Method] - # - attr_reader :get_simulation - ## - # RPC-specific configuration for `get_valued_resource` - # @return [::Gapic::Config::Method] - # - attr_reader :get_valued_resource - ## - # RPC-specific configuration for `get_big_query_export` - # @return [::Gapic::Config::Method] - # - attr_reader :get_big_query_export - ## - # RPC-specific configuration for `get_iam_policy` - # @return [::Gapic::Config::Method] - # - attr_reader :get_iam_policy - ## - # RPC-specific configuration for `get_mute_config` - # @return [::Gapic::Config::Method] - # - attr_reader :get_mute_config - ## - # RPC-specific configuration for `get_notification_config` - # @return [::Gapic::Config::Method] - # - attr_reader :get_notification_config - ## - # RPC-specific configuration for `get_organization_settings` - # @return [::Gapic::Config::Method] - # - attr_reader :get_organization_settings - ## - # RPC-specific configuration for `get_effective_security_health_analytics_custom_module` - # @return [::Gapic::Config::Method] - # - attr_reader :get_effective_security_health_analytics_custom_module - ## - # RPC-specific configuration for `get_security_health_analytics_custom_module` - # @return [::Gapic::Config::Method] - # - attr_reader :get_security_health_analytics_custom_module - ## - # RPC-specific configuration for `get_source` - # @return [::Gapic::Config::Method] - # - attr_reader :get_source - ## - # RPC-specific configuration for `group_assets` - # @return [::Gapic::Config::Method] - # - attr_reader :group_assets - ## - # RPC-specific configuration for `group_findings` - # @return [::Gapic::Config::Method] - # - attr_reader :group_findings - ## - # RPC-specific configuration for `list_assets` - # @return [::Gapic::Config::Method] - # - attr_reader :list_assets - ## - # RPC-specific configuration for `list_descendant_security_health_analytics_custom_modules` - # @return [::Gapic::Config::Method] - # - attr_reader :list_descendant_security_health_analytics_custom_modules - ## - # RPC-specific configuration for `list_findings` - # @return [::Gapic::Config::Method] - # - attr_reader :list_findings - ## - # RPC-specific configuration for `list_mute_configs` - # @return [::Gapic::Config::Method] - # - attr_reader :list_mute_configs - ## - # RPC-specific configuration for `list_notification_configs` - # @return [::Gapic::Config::Method] - # - attr_reader :list_notification_configs - ## - # RPC-specific configuration for `list_effective_security_health_analytics_custom_modules` - # @return [::Gapic::Config::Method] - # - attr_reader :list_effective_security_health_analytics_custom_modules - ## - # RPC-specific configuration for `list_security_health_analytics_custom_modules` - # @return [::Gapic::Config::Method] - # - attr_reader :list_security_health_analytics_custom_modules - ## - # RPC-specific configuration for `list_sources` - # @return [::Gapic::Config::Method] - # - attr_reader :list_sources - ## - # RPC-specific configuration for `run_asset_discovery` - # @return [::Gapic::Config::Method] - # - attr_reader :run_asset_discovery - ## - # RPC-specific configuration for `set_finding_state` - # @return [::Gapic::Config::Method] - # - attr_reader :set_finding_state - ## - # RPC-specific configuration for `set_mute` - # @return [::Gapic::Config::Method] - # - attr_reader :set_mute - ## - # RPC-specific configuration for `set_iam_policy` - # @return [::Gapic::Config::Method] - # - attr_reader :set_iam_policy - ## - # RPC-specific configuration for `test_iam_permissions` - # @return [::Gapic::Config::Method] - # - attr_reader :test_iam_permissions - ## - # RPC-specific configuration for `simulate_security_health_analytics_custom_module` - # @return [::Gapic::Config::Method] - # - attr_reader :simulate_security_health_analytics_custom_module - ## - # RPC-specific configuration for `update_external_system` - # @return [::Gapic::Config::Method] - # - attr_reader :update_external_system - ## - # RPC-specific configuration for `update_finding` - # @return [::Gapic::Config::Method] - # - attr_reader :update_finding - ## - # RPC-specific configuration for `update_mute_config` - # @return [::Gapic::Config::Method] - # - attr_reader :update_mute_config - ## - # RPC-specific configuration for `update_notification_config` - # @return [::Gapic::Config::Method] - # - attr_reader :update_notification_config - ## - # RPC-specific configuration for `update_organization_settings` - # @return [::Gapic::Config::Method] - # - attr_reader :update_organization_settings - ## - # RPC-specific configuration for `update_security_health_analytics_custom_module` - # @return [::Gapic::Config::Method] - # - attr_reader :update_security_health_analytics_custom_module - ## - # RPC-specific configuration for `update_source` - # @return [::Gapic::Config::Method] - # - attr_reader :update_source - ## - # RPC-specific configuration for `update_security_marks` - # @return [::Gapic::Config::Method] - # - attr_reader :update_security_marks - ## - # RPC-specific configuration for `create_big_query_export` - # @return [::Gapic::Config::Method] - # - attr_reader :create_big_query_export - ## - # RPC-specific configuration for `delete_big_query_export` - # @return [::Gapic::Config::Method] - # - attr_reader :delete_big_query_export - ## - # RPC-specific configuration for `update_big_query_export` - # @return [::Gapic::Config::Method] - # - attr_reader :update_big_query_export - ## - # RPC-specific configuration for `list_big_query_exports` - # @return [::Gapic::Config::Method] - # - attr_reader :list_big_query_exports - ## - # RPC-specific configuration for `create_event_threat_detection_custom_module` - # @return [::Gapic::Config::Method] - # - attr_reader :create_event_threat_detection_custom_module - ## - # RPC-specific configuration for `delete_event_threat_detection_custom_module` - # @return [::Gapic::Config::Method] - # - attr_reader :delete_event_threat_detection_custom_module - ## - # RPC-specific configuration for `get_event_threat_detection_custom_module` - # @return [::Gapic::Config::Method] - # - attr_reader :get_event_threat_detection_custom_module - ## - # RPC-specific configuration for `list_descendant_event_threat_detection_custom_modules` - # @return [::Gapic::Config::Method] - # - attr_reader :list_descendant_event_threat_detection_custom_modules - ## - # RPC-specific configuration for `list_event_threat_detection_custom_modules` - # @return [::Gapic::Config::Method] - # - attr_reader :list_event_threat_detection_custom_modules - ## - # RPC-specific configuration for `update_event_threat_detection_custom_module` - # @return [::Gapic::Config::Method] - # - attr_reader :update_event_threat_detection_custom_module - ## - # RPC-specific configuration for `validate_event_threat_detection_custom_module` - # @return [::Gapic::Config::Method] - # - attr_reader :validate_event_threat_detection_custom_module - ## - # RPC-specific configuration for `get_effective_event_threat_detection_custom_module` - # @return [::Gapic::Config::Method] - # - attr_reader :get_effective_event_threat_detection_custom_module - ## - # RPC-specific configuration for `list_effective_event_threat_detection_custom_modules` - # @return [::Gapic::Config::Method] - # - attr_reader :list_effective_event_threat_detection_custom_modules - ## - # RPC-specific configuration for `batch_create_resource_value_configs` - # @return [::Gapic::Config::Method] - # - attr_reader :batch_create_resource_value_configs - ## - # RPC-specific configuration for `delete_resource_value_config` - # @return [::Gapic::Config::Method] - # - attr_reader :delete_resource_value_config - ## - # RPC-specific configuration for `get_resource_value_config` - # @return [::Gapic::Config::Method] - # - attr_reader :get_resource_value_config - ## - # RPC-specific configuration for `list_resource_value_configs` - # @return [::Gapic::Config::Method] - # - attr_reader :list_resource_value_configs - ## - # RPC-specific configuration for `update_resource_value_config` - # @return [::Gapic::Config::Method] - # - attr_reader :update_resource_value_config - ## - # RPC-specific configuration for `list_valued_resources` - # @return [::Gapic::Config::Method] - # - attr_reader :list_valued_resources - ## - # RPC-specific configuration for `list_attack_paths` - # @return [::Gapic::Config::Method] - # - attr_reader :list_attack_paths - - # @private - def initialize parent_rpcs = nil - bulk_mute_findings_config = parent_rpcs.bulk_mute_findings if parent_rpcs.respond_to? :bulk_mute_findings - @bulk_mute_findings = ::Gapic::Config::Method.new bulk_mute_findings_config - create_security_health_analytics_custom_module_config = parent_rpcs.create_security_health_analytics_custom_module if parent_rpcs.respond_to? :create_security_health_analytics_custom_module - @create_security_health_analytics_custom_module = ::Gapic::Config::Method.new create_security_health_analytics_custom_module_config - create_source_config = parent_rpcs.create_source if parent_rpcs.respond_to? :create_source - @create_source = ::Gapic::Config::Method.new create_source_config - create_finding_config = parent_rpcs.create_finding if parent_rpcs.respond_to? :create_finding - @create_finding = ::Gapic::Config::Method.new create_finding_config - create_mute_config_config = parent_rpcs.create_mute_config if parent_rpcs.respond_to? :create_mute_config - @create_mute_config = ::Gapic::Config::Method.new create_mute_config_config - create_notification_config_config = parent_rpcs.create_notification_config if parent_rpcs.respond_to? :create_notification_config - @create_notification_config = ::Gapic::Config::Method.new create_notification_config_config - delete_mute_config_config = parent_rpcs.delete_mute_config if parent_rpcs.respond_to? :delete_mute_config - @delete_mute_config = ::Gapic::Config::Method.new delete_mute_config_config - delete_notification_config_config = parent_rpcs.delete_notification_config if parent_rpcs.respond_to? :delete_notification_config - @delete_notification_config = ::Gapic::Config::Method.new delete_notification_config_config - delete_security_health_analytics_custom_module_config = parent_rpcs.delete_security_health_analytics_custom_module if parent_rpcs.respond_to? :delete_security_health_analytics_custom_module - @delete_security_health_analytics_custom_module = ::Gapic::Config::Method.new delete_security_health_analytics_custom_module_config - get_simulation_config = parent_rpcs.get_simulation if parent_rpcs.respond_to? :get_simulation - @get_simulation = ::Gapic::Config::Method.new get_simulation_config - get_valued_resource_config = parent_rpcs.get_valued_resource if parent_rpcs.respond_to? :get_valued_resource - @get_valued_resource = ::Gapic::Config::Method.new get_valued_resource_config - get_big_query_export_config = parent_rpcs.get_big_query_export if parent_rpcs.respond_to? :get_big_query_export - @get_big_query_export = ::Gapic::Config::Method.new get_big_query_export_config - get_iam_policy_config = parent_rpcs.get_iam_policy if parent_rpcs.respond_to? :get_iam_policy - @get_iam_policy = ::Gapic::Config::Method.new get_iam_policy_config - get_mute_config_config = parent_rpcs.get_mute_config if parent_rpcs.respond_to? :get_mute_config - @get_mute_config = ::Gapic::Config::Method.new get_mute_config_config - get_notification_config_config = parent_rpcs.get_notification_config if parent_rpcs.respond_to? :get_notification_config - @get_notification_config = ::Gapic::Config::Method.new get_notification_config_config - get_organization_settings_config = parent_rpcs.get_organization_settings if parent_rpcs.respond_to? :get_organization_settings - @get_organization_settings = ::Gapic::Config::Method.new get_organization_settings_config - get_effective_security_health_analytics_custom_module_config = parent_rpcs.get_effective_security_health_analytics_custom_module if parent_rpcs.respond_to? :get_effective_security_health_analytics_custom_module - @get_effective_security_health_analytics_custom_module = ::Gapic::Config::Method.new get_effective_security_health_analytics_custom_module_config - get_security_health_analytics_custom_module_config = parent_rpcs.get_security_health_analytics_custom_module if parent_rpcs.respond_to? :get_security_health_analytics_custom_module - @get_security_health_analytics_custom_module = ::Gapic::Config::Method.new get_security_health_analytics_custom_module_config - get_source_config = parent_rpcs.get_source if parent_rpcs.respond_to? :get_source - @get_source = ::Gapic::Config::Method.new get_source_config - group_assets_config = parent_rpcs.group_assets if parent_rpcs.respond_to? :group_assets - @group_assets = ::Gapic::Config::Method.new group_assets_config - group_findings_config = parent_rpcs.group_findings if parent_rpcs.respond_to? :group_findings - @group_findings = ::Gapic::Config::Method.new group_findings_config - list_assets_config = parent_rpcs.list_assets if parent_rpcs.respond_to? :list_assets - @list_assets = ::Gapic::Config::Method.new list_assets_config - list_descendant_security_health_analytics_custom_modules_config = parent_rpcs.list_descendant_security_health_analytics_custom_modules if parent_rpcs.respond_to? :list_descendant_security_health_analytics_custom_modules - @list_descendant_security_health_analytics_custom_modules = ::Gapic::Config::Method.new list_descendant_security_health_analytics_custom_modules_config - list_findings_config = parent_rpcs.list_findings if parent_rpcs.respond_to? :list_findings - @list_findings = ::Gapic::Config::Method.new list_findings_config - list_mute_configs_config = parent_rpcs.list_mute_configs if parent_rpcs.respond_to? :list_mute_configs - @list_mute_configs = ::Gapic::Config::Method.new list_mute_configs_config - list_notification_configs_config = parent_rpcs.list_notification_configs if parent_rpcs.respond_to? :list_notification_configs - @list_notification_configs = ::Gapic::Config::Method.new list_notification_configs_config - list_effective_security_health_analytics_custom_modules_config = parent_rpcs.list_effective_security_health_analytics_custom_modules if parent_rpcs.respond_to? :list_effective_security_health_analytics_custom_modules - @list_effective_security_health_analytics_custom_modules = ::Gapic::Config::Method.new list_effective_security_health_analytics_custom_modules_config - list_security_health_analytics_custom_modules_config = parent_rpcs.list_security_health_analytics_custom_modules if parent_rpcs.respond_to? :list_security_health_analytics_custom_modules - @list_security_health_analytics_custom_modules = ::Gapic::Config::Method.new list_security_health_analytics_custom_modules_config - list_sources_config = parent_rpcs.list_sources if parent_rpcs.respond_to? :list_sources - @list_sources = ::Gapic::Config::Method.new list_sources_config - run_asset_discovery_config = parent_rpcs.run_asset_discovery if parent_rpcs.respond_to? :run_asset_discovery - @run_asset_discovery = ::Gapic::Config::Method.new run_asset_discovery_config - set_finding_state_config = parent_rpcs.set_finding_state if parent_rpcs.respond_to? :set_finding_state - @set_finding_state = ::Gapic::Config::Method.new set_finding_state_config - set_mute_config = parent_rpcs.set_mute if parent_rpcs.respond_to? :set_mute - @set_mute = ::Gapic::Config::Method.new set_mute_config - set_iam_policy_config = parent_rpcs.set_iam_policy if parent_rpcs.respond_to? :set_iam_policy - @set_iam_policy = ::Gapic::Config::Method.new set_iam_policy_config - test_iam_permissions_config = parent_rpcs.test_iam_permissions if parent_rpcs.respond_to? :test_iam_permissions - @test_iam_permissions = ::Gapic::Config::Method.new test_iam_permissions_config - simulate_security_health_analytics_custom_module_config = parent_rpcs.simulate_security_health_analytics_custom_module if parent_rpcs.respond_to? :simulate_security_health_analytics_custom_module - @simulate_security_health_analytics_custom_module = ::Gapic::Config::Method.new simulate_security_health_analytics_custom_module_config - update_external_system_config = parent_rpcs.update_external_system if parent_rpcs.respond_to? :update_external_system - @update_external_system = ::Gapic::Config::Method.new update_external_system_config - update_finding_config = parent_rpcs.update_finding if parent_rpcs.respond_to? :update_finding - @update_finding = ::Gapic::Config::Method.new update_finding_config - update_mute_config_config = parent_rpcs.update_mute_config if parent_rpcs.respond_to? :update_mute_config - @update_mute_config = ::Gapic::Config::Method.new update_mute_config_config - update_notification_config_config = parent_rpcs.update_notification_config if parent_rpcs.respond_to? :update_notification_config - @update_notification_config = ::Gapic::Config::Method.new update_notification_config_config - update_organization_settings_config = parent_rpcs.update_organization_settings if parent_rpcs.respond_to? :update_organization_settings - @update_organization_settings = ::Gapic::Config::Method.new update_organization_settings_config - update_security_health_analytics_custom_module_config = parent_rpcs.update_security_health_analytics_custom_module if parent_rpcs.respond_to? :update_security_health_analytics_custom_module - @update_security_health_analytics_custom_module = ::Gapic::Config::Method.new update_security_health_analytics_custom_module_config - update_source_config = parent_rpcs.update_source if parent_rpcs.respond_to? :update_source - @update_source = ::Gapic::Config::Method.new update_source_config - update_security_marks_config = parent_rpcs.update_security_marks if parent_rpcs.respond_to? :update_security_marks - @update_security_marks = ::Gapic::Config::Method.new update_security_marks_config - create_big_query_export_config = parent_rpcs.create_big_query_export if parent_rpcs.respond_to? :create_big_query_export - @create_big_query_export = ::Gapic::Config::Method.new create_big_query_export_config - delete_big_query_export_config = parent_rpcs.delete_big_query_export if parent_rpcs.respond_to? :delete_big_query_export - @delete_big_query_export = ::Gapic::Config::Method.new delete_big_query_export_config - update_big_query_export_config = parent_rpcs.update_big_query_export if parent_rpcs.respond_to? :update_big_query_export - @update_big_query_export = ::Gapic::Config::Method.new update_big_query_export_config - list_big_query_exports_config = parent_rpcs.list_big_query_exports if parent_rpcs.respond_to? :list_big_query_exports - @list_big_query_exports = ::Gapic::Config::Method.new list_big_query_exports_config - create_event_threat_detection_custom_module_config = parent_rpcs.create_event_threat_detection_custom_module if parent_rpcs.respond_to? :create_event_threat_detection_custom_module - @create_event_threat_detection_custom_module = ::Gapic::Config::Method.new create_event_threat_detection_custom_module_config - delete_event_threat_detection_custom_module_config = parent_rpcs.delete_event_threat_detection_custom_module if parent_rpcs.respond_to? :delete_event_threat_detection_custom_module - @delete_event_threat_detection_custom_module = ::Gapic::Config::Method.new delete_event_threat_detection_custom_module_config - get_event_threat_detection_custom_module_config = parent_rpcs.get_event_threat_detection_custom_module if parent_rpcs.respond_to? :get_event_threat_detection_custom_module - @get_event_threat_detection_custom_module = ::Gapic::Config::Method.new get_event_threat_detection_custom_module_config - list_descendant_event_threat_detection_custom_modules_config = parent_rpcs.list_descendant_event_threat_detection_custom_modules if parent_rpcs.respond_to? :list_descendant_event_threat_detection_custom_modules - @list_descendant_event_threat_detection_custom_modules = ::Gapic::Config::Method.new list_descendant_event_threat_detection_custom_modules_config - list_event_threat_detection_custom_modules_config = parent_rpcs.list_event_threat_detection_custom_modules if parent_rpcs.respond_to? :list_event_threat_detection_custom_modules - @list_event_threat_detection_custom_modules = ::Gapic::Config::Method.new list_event_threat_detection_custom_modules_config - update_event_threat_detection_custom_module_config = parent_rpcs.update_event_threat_detection_custom_module if parent_rpcs.respond_to? :update_event_threat_detection_custom_module - @update_event_threat_detection_custom_module = ::Gapic::Config::Method.new update_event_threat_detection_custom_module_config - validate_event_threat_detection_custom_module_config = parent_rpcs.validate_event_threat_detection_custom_module if parent_rpcs.respond_to? :validate_event_threat_detection_custom_module - @validate_event_threat_detection_custom_module = ::Gapic::Config::Method.new validate_event_threat_detection_custom_module_config - get_effective_event_threat_detection_custom_module_config = parent_rpcs.get_effective_event_threat_detection_custom_module if parent_rpcs.respond_to? :get_effective_event_threat_detection_custom_module - @get_effective_event_threat_detection_custom_module = ::Gapic::Config::Method.new get_effective_event_threat_detection_custom_module_config - list_effective_event_threat_detection_custom_modules_config = parent_rpcs.list_effective_event_threat_detection_custom_modules if parent_rpcs.respond_to? :list_effective_event_threat_detection_custom_modules - @list_effective_event_threat_detection_custom_modules = ::Gapic::Config::Method.new list_effective_event_threat_detection_custom_modules_config - batch_create_resource_value_configs_config = parent_rpcs.batch_create_resource_value_configs if parent_rpcs.respond_to? :batch_create_resource_value_configs - @batch_create_resource_value_configs = ::Gapic::Config::Method.new batch_create_resource_value_configs_config - delete_resource_value_config_config = parent_rpcs.delete_resource_value_config if parent_rpcs.respond_to? :delete_resource_value_config - @delete_resource_value_config = ::Gapic::Config::Method.new delete_resource_value_config_config - get_resource_value_config_config = parent_rpcs.get_resource_value_config if parent_rpcs.respond_to? :get_resource_value_config - @get_resource_value_config = ::Gapic::Config::Method.new get_resource_value_config_config - list_resource_value_configs_config = parent_rpcs.list_resource_value_configs if parent_rpcs.respond_to? :list_resource_value_configs - @list_resource_value_configs = ::Gapic::Config::Method.new list_resource_value_configs_config - update_resource_value_config_config = parent_rpcs.update_resource_value_config if parent_rpcs.respond_to? :update_resource_value_config - @update_resource_value_config = ::Gapic::Config::Method.new update_resource_value_config_config - list_valued_resources_config = parent_rpcs.list_valued_resources if parent_rpcs.respond_to? :list_valued_resources - @list_valued_resources = ::Gapic::Config::Method.new list_valued_resources_config - list_attack_paths_config = parent_rpcs.list_attack_paths if parent_rpcs.respond_to? :list_attack_paths - @list_attack_paths = ::Gapic::Config::Method.new list_attack_paths_config - - yield self if block_given? - end - end - end - end - end - end - end - end -end diff --git a/owl-bot-staging/google-cloud-security_center-v1/lib/google/cloud/security_center/v1/security_center/credentials.rb b/owl-bot-staging/google-cloud-security_center-v1/lib/google/cloud/security_center/v1/security_center/credentials.rb deleted file mode 100644 index 4bb0187caca1..000000000000 --- a/owl-bot-staging/google-cloud-security_center-v1/lib/google/cloud/security_center/v1/security_center/credentials.rb +++ /dev/null @@ -1,51 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -require "googleauth" - -module Google - module Cloud - module SecurityCenter - module V1 - module SecurityCenter - # Credentials for the SecurityCenter API. - class Credentials < ::Google::Auth::Credentials - self.scope = [ - "https://www.googleapis.com/auth/cloud-platform" - ] - self.env_vars = [ - "SECURITY_CENTER_CREDENTIALS", - "SECURITY_CENTER_KEYFILE", - "GOOGLE_CLOUD_CREDENTIALS", - "GOOGLE_CLOUD_KEYFILE", - "GCLOUD_KEYFILE", - "SECURITY_CENTER_CREDENTIALS_JSON", - "SECURITY_CENTER_KEYFILE_JSON", - "GOOGLE_CLOUD_CREDENTIALS_JSON", - "GOOGLE_CLOUD_KEYFILE_JSON", - "GCLOUD_KEYFILE_JSON" - ] - self.paths = [ - "~/.config/google_cloud/application_default_credentials.json" - ] - end - end - end - end - end -end diff --git a/owl-bot-staging/google-cloud-security_center-v1/lib/google/cloud/security_center/v1/security_center/operations.rb b/owl-bot-staging/google-cloud-security_center-v1/lib/google/cloud/security_center/v1/security_center/operations.rb deleted file mode 100644 index c1c3e432c637..000000000000 --- a/owl-bot-staging/google-cloud-security_center-v1/lib/google/cloud/security_center/v1/security_center/operations.rb +++ /dev/null @@ -1,841 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -require "gapic/operation" -require "google/longrunning/operations_pb" - -module Google - module Cloud - module SecurityCenter - module V1 - module SecurityCenter - # Service that implements Longrunning Operations API. - class Operations - # @private - API_VERSION = "" - - # @private - DEFAULT_ENDPOINT_TEMPLATE = "securitycenter.$UNIVERSE_DOMAIN$" - - # @private - attr_reader :operations_stub - - ## - # Configuration for the SecurityCenter 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 SecurityCenter 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::SecurityCenter::V1::VERSION - metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - header_params = {} - if request.name - header_params["name"] = request.name - end - - request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") - metadata[:"x-goog-request-params"] ||= request_params_header - - options.apply_defaults timeout: @config.rpcs.list_operations.timeout, - metadata: metadata, - retry_policy: @config.rpcs.list_operations.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @operations_stub.call_rpc :list_operations, request, options: options do |response, operation| - wrap_lro_operation = ->(op_response) { ::Gapic::Operation.new op_response, @operations_client } - response = ::Gapic::PagedEnumerable.new @operations_stub, :list_operations, request, response, operation, options, format_resource: wrap_lro_operation - yield response, operation if block_given? - 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::SecurityCenter::V1::VERSION - metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - header_params = {} - if request.name - header_params["name"] = request.name - end - - request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") - metadata[:"x-goog-request-params"] ||= request_params_header - - options.apply_defaults timeout: @config.rpcs.get_operation.timeout, - metadata: metadata, - retry_policy: @config.rpcs.get_operation.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @operations_stub.call_rpc :get_operation, request, options: options do |response, operation| - response = ::Gapic::Operation.new response, @operations_client, options: options - yield response, operation if block_given? - 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::SecurityCenter::V1::VERSION - metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - header_params = {} - if request.name - header_params["name"] = request.name - end - - request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") - metadata[:"x-goog-request-params"] ||= request_params_header - - options.apply_defaults timeout: @config.rpcs.delete_operation.timeout, - metadata: metadata, - retry_policy: @config.rpcs.delete_operation.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @operations_stub.call_rpc :delete_operation, request, options: options do |response, operation| - yield response, operation if block_given? - 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::SecurityCenter::V1::VERSION - metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - header_params = {} - if request.name - header_params["name"] = request.name - end - - request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") - metadata[:"x-goog-request-params"] ||= request_params_header - - options.apply_defaults timeout: @config.rpcs.cancel_operation.timeout, - metadata: metadata, - retry_policy: @config.rpcs.cancel_operation.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @operations_stub.call_rpc :cancel_operation, request, options: options do |response, operation| - yield response, operation if block_given? - 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::SecurityCenter::V1::VERSION - metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - options.apply_defaults timeout: @config.rpcs.wait_operation.timeout, - metadata: metadata, - retry_policy: @config.rpcs.wait_operation.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @operations_stub.call_rpc :wait_operation, request, options: options do |response, operation| - response = ::Gapic::Operation.new response, @operations_client, options: options - yield response, operation if block_given? - 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 = "securitycenter.googleapis.com" - - config_attr :endpoint, nil, ::String, nil - config_attr :credentials, nil do |value| - allowed = [::String, ::Hash, ::Proc, ::Symbol, ::Google::Auth::Credentials, ::Google::Auth::BaseClient, ::Signet::OAuth2::Client, nil] - allowed += [::GRPC::Core::Channel, ::GRPC::Core::ChannelCredentials] if defined? ::GRPC::Core::Channel - allowed.any? { |klass| klass === value } - end - config_attr :scope, nil, ::String, ::Array, nil - config_attr :lib_name, nil, ::String, nil - config_attr :lib_version, nil, ::String, nil - config_attr(:channel_args, { "grpc.service_config_disable_resolution" => 1 }, ::Hash, nil) - config_attr :interceptors, nil, ::Array, nil - config_attr :timeout, nil, ::Numeric, nil - config_attr :metadata, nil, ::Hash, nil - config_attr :retry_policy, nil, ::Hash, ::Proc, nil - config_attr :quota_project, nil, ::String, nil - config_attr :universe_domain, nil, ::String, nil - config_attr :logger, :default, ::Logger, nil, :default - - # @private - def initialize parent_config = nil - @parent_config = parent_config unless parent_config.nil? - - yield self if block_given? - end - - ## - # Configurations for individual RPCs - # @return [Rpcs] - # - def rpcs - @rpcs ||= begin - parent_rpcs = nil - parent_rpcs = @parent_config.rpcs if defined?(@parent_config) && @parent_config.respond_to?(:rpcs) - Rpcs.new parent_rpcs - end - end - - ## - # Configuration for the channel pool - # @return [::Gapic::ServiceStub::ChannelPool::Configuration] - # - def channel_pool - @channel_pool ||= ::Gapic::ServiceStub::ChannelPool::Configuration.new - end - - ## - # Configuration RPC class for the Operations API. - # - # Includes fields providing the configuration for each RPC in this service. - # Each configuration object is of type `Gapic::Config::Method` and includes - # the following configuration fields: - # - # * `timeout` (*type:* `Numeric`) - The call timeout in seconds - # * `metadata` (*type:* `Hash{Symbol=>String}`) - Additional gRPC headers - # * `retry_policy (*type:* `Hash`) - The retry policy. The policy fields - # include the following keys: - # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds. - # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds. - # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier. - # * `:retry_codes` (*type:* `Array`) - The error codes that should - # trigger a retry. - # - class Rpcs - ## - # RPC-specific configuration for `list_operations` - # @return [::Gapic::Config::Method] - # - attr_reader :list_operations - ## - # RPC-specific configuration for `get_operation` - # @return [::Gapic::Config::Method] - # - attr_reader :get_operation - ## - # RPC-specific configuration for `delete_operation` - # @return [::Gapic::Config::Method] - # - attr_reader :delete_operation - ## - # RPC-specific configuration for `cancel_operation` - # @return [::Gapic::Config::Method] - # - attr_reader :cancel_operation - ## - # RPC-specific configuration for `wait_operation` - # @return [::Gapic::Config::Method] - # - attr_reader :wait_operation - - # @private - def initialize parent_rpcs = nil - list_operations_config = parent_rpcs.list_operations if parent_rpcs.respond_to? :list_operations - @list_operations = ::Gapic::Config::Method.new list_operations_config - get_operation_config = parent_rpcs.get_operation if parent_rpcs.respond_to? :get_operation - @get_operation = ::Gapic::Config::Method.new get_operation_config - delete_operation_config = parent_rpcs.delete_operation if parent_rpcs.respond_to? :delete_operation - @delete_operation = ::Gapic::Config::Method.new delete_operation_config - cancel_operation_config = parent_rpcs.cancel_operation if parent_rpcs.respond_to? :cancel_operation - @cancel_operation = ::Gapic::Config::Method.new cancel_operation_config - wait_operation_config = parent_rpcs.wait_operation if parent_rpcs.respond_to? :wait_operation - @wait_operation = ::Gapic::Config::Method.new wait_operation_config - - yield self if block_given? - end - end - end - end - end - end - end - end -end diff --git a/owl-bot-staging/google-cloud-security_center-v1/lib/google/cloud/security_center/v1/security_center/paths.rb b/owl-bot-staging/google-cloud-security_center-v1/lib/google/cloud/security_center/v1/security_center/paths.rb deleted file mode 100644 index 74f6066a7b65..000000000000 --- a/owl-bot-staging/google-cloud-security_center-v1/lib/google/cloud/security_center/v1/security_center/paths.rb +++ /dev/null @@ -1,1127 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - - -module Google - module Cloud - module SecurityCenter - module V1 - module SecurityCenter - # Path helper methods for the SecurityCenter API. - module Paths - ## - # Create a fully-qualified BigQueryExport resource string. - # - # @overload big_query_export_path(organization:, export:) - # The resource will be in the following format: - # - # `organizations/{organization}/bigQueryExports/{export}` - # - # @param organization [String] - # @param export [String] - # - # @overload big_query_export_path(folder:, export:) - # The resource will be in the following format: - # - # `folders/{folder}/bigQueryExports/{export}` - # - # @param folder [String] - # @param export [String] - # - # @overload big_query_export_path(project:, export:) - # The resource will be in the following format: - # - # `projects/{project}/bigQueryExports/{export}` - # - # @param project [String] - # @param export [String] - # - # @return [::String] - def big_query_export_path **args - resources = { - "export:organization" => (proc do |organization:, export:| - raise ::ArgumentError, "organization cannot contain /" if organization.to_s.include? "/" - - "organizations/#{organization}/bigQueryExports/#{export}" - end), - "export:folder" => (proc do |folder:, export:| - raise ::ArgumentError, "folder cannot contain /" if folder.to_s.include? "/" - - "folders/#{folder}/bigQueryExports/#{export}" - end), - "export:project" => (proc do |project:, export:| - raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" - - "projects/#{project}/bigQueryExports/#{export}" - 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 DlpJob resource string. - # - # @overload dlp_job_path(project:, dlp_job:) - # The resource will be in the following format: - # - # `projects/{project}/dlpJobs/{dlp_job}` - # - # @param project [String] - # @param dlp_job [String] - # - # @overload dlp_job_path(project:, location:, dlp_job:) - # The resource will be in the following format: - # - # `projects/{project}/locations/{location}/dlpJobs/{dlp_job}` - # - # @param project [String] - # @param location [String] - # @param dlp_job [String] - # - # @return [::String] - def dlp_job_path **args - resources = { - "dlp_job:project" => (proc do |project:, dlp_job:| - raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" - - "projects/#{project}/dlpJobs/#{dlp_job}" - end), - "dlp_job:location:project" => (proc do |project:, location:, dlp_job:| - raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" - raise ::ArgumentError, "location cannot contain /" if location.to_s.include? "/" - - "projects/#{project}/locations/#{location}/dlpJobs/#{dlp_job}" - 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 EffectiveEventThreatDetectionCustomModule resource string. - # - # @overload effective_event_threat_detection_custom_module_path(organization:, module:) - # The resource will be in the following format: - # - # `organizations/{organization}/eventThreatDetectionSettings/effectiveCustomModules/{module}` - # - # @param organization [String] - # @param module [String] - # - # @overload effective_event_threat_detection_custom_module_path(folder:, module:) - # The resource will be in the following format: - # - # `folders/{folder}/eventThreatDetectionSettings/effectiveCustomModules/{module}` - # - # @param folder [String] - # @param module [String] - # - # @overload effective_event_threat_detection_custom_module_path(project:, module:) - # The resource will be in the following format: - # - # `projects/{project}/eventThreatDetectionSettings/effectiveCustomModules/{module}` - # - # @param project [String] - # @param module [String] - # - # @return [::String] - def effective_event_threat_detection_custom_module_path **args - resources = { - "module:organization" => (proc do |organization:, module:| - raise ::ArgumentError, "organization cannot contain /" if organization.to_s.include? "/" - - "organizations/#{organization}/eventThreatDetectionSettings/effectiveCustomModules/#{binding.local_variable_get :module}" - end), - "folder:module" => (proc do |folder:, module:| - raise ::ArgumentError, "folder cannot contain /" if folder.to_s.include? "/" - - "folders/#{folder}/eventThreatDetectionSettings/effectiveCustomModules/#{binding.local_variable_get :module}" - end), - "module:project" => (proc do |project:, module:| - raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" - - "projects/#{project}/eventThreatDetectionSettings/effectiveCustomModules/#{binding.local_variable_get :module}" - 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 EffectiveSecurityHealthAnalyticsCustomModule resource string. - # - # @overload effective_security_health_analytics_custom_module_path(organization:, effective_custom_module:) - # The resource will be in the following format: - # - # `organizations/{organization}/securityHealthAnalyticsSettings/effectiveCustomModules/{effective_custom_module}` - # - # @param organization [String] - # @param effective_custom_module [String] - # - # @overload effective_security_health_analytics_custom_module_path(folder:, effective_custom_module:) - # The resource will be in the following format: - # - # `folders/{folder}/securityHealthAnalyticsSettings/effectiveCustomModules/{effective_custom_module}` - # - # @param folder [String] - # @param effective_custom_module [String] - # - # @overload effective_security_health_analytics_custom_module_path(project:, effective_custom_module:) - # The resource will be in the following format: - # - # `projects/{project}/securityHealthAnalyticsSettings/effectiveCustomModules/{effective_custom_module}` - # - # @param project [String] - # @param effective_custom_module [String] - # - # @return [::String] - def effective_security_health_analytics_custom_module_path **args - resources = { - "effective_custom_module:organization" => (proc do |organization:, effective_custom_module:| - raise ::ArgumentError, "organization cannot contain /" if organization.to_s.include? "/" - - "organizations/#{organization}/securityHealthAnalyticsSettings/effectiveCustomModules/#{effective_custom_module}" - end), - "effective_custom_module:folder" => (proc do |folder:, effective_custom_module:| - raise ::ArgumentError, "folder cannot contain /" if folder.to_s.include? "/" - - "folders/#{folder}/securityHealthAnalyticsSettings/effectiveCustomModules/#{effective_custom_module}" - end), - "effective_custom_module:project" => (proc do |project:, effective_custom_module:| - raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" - - "projects/#{project}/securityHealthAnalyticsSettings/effectiveCustomModules/#{effective_custom_module}" - 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 EventThreatDetectionCustomModule resource string. - # - # @overload event_threat_detection_custom_module_path(organization:, module:) - # The resource will be in the following format: - # - # `organizations/{organization}/eventThreatDetectionSettings/customModules/{module}` - # - # @param organization [String] - # @param module [String] - # - # @overload event_threat_detection_custom_module_path(folder:, module:) - # The resource will be in the following format: - # - # `folders/{folder}/eventThreatDetectionSettings/customModules/{module}` - # - # @param folder [String] - # @param module [String] - # - # @overload event_threat_detection_custom_module_path(project:, module:) - # The resource will be in the following format: - # - # `projects/{project}/eventThreatDetectionSettings/customModules/{module}` - # - # @param project [String] - # @param module [String] - # - # @return [::String] - def event_threat_detection_custom_module_path **args - resources = { - "module:organization" => (proc do |organization:, module:| - raise ::ArgumentError, "organization cannot contain /" if organization.to_s.include? "/" - - "organizations/#{organization}/eventThreatDetectionSettings/customModules/#{binding.local_variable_get :module}" - end), - "folder:module" => (proc do |folder:, module:| - raise ::ArgumentError, "folder cannot contain /" if folder.to_s.include? "/" - - "folders/#{folder}/eventThreatDetectionSettings/customModules/#{binding.local_variable_get :module}" - end), - "module:project" => (proc do |project:, module:| - raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" - - "projects/#{project}/eventThreatDetectionSettings/customModules/#{binding.local_variable_get :module}" - 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 EventThreatDetectionSettings resource string. - # - # @overload event_threat_detection_settings_path(organization:) - # The resource will be in the following format: - # - # `organizations/{organization}/eventThreatDetectionSettings` - # - # @param organization [String] - # - # @overload event_threat_detection_settings_path(folder:) - # The resource will be in the following format: - # - # `folders/{folder}/eventThreatDetectionSettings` - # - # @param folder [String] - # - # @overload event_threat_detection_settings_path(project:) - # The resource will be in the following format: - # - # `projects/{project}/eventThreatDetectionSettings` - # - # @param project [String] - # - # @return [::String] - def event_threat_detection_settings_path **args - resources = { - "organization" => (proc do |organization:| - "organizations/#{organization}/eventThreatDetectionSettings" - end), - "folder" => (proc do |folder:| - "folders/#{folder}/eventThreatDetectionSettings" - end), - "project" => (proc do |project:| - "projects/#{project}/eventThreatDetectionSettings" - 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 ExternalSystem resource string. - # - # @overload external_system_path(organization:, source:, finding:, externalsystem:) - # The resource will be in the following format: - # - # `organizations/{organization}/sources/{source}/findings/{finding}/externalSystems/{externalsystem}` - # - # @param organization [String] - # @param source [String] - # @param finding [String] - # @param externalsystem [String] - # - # @overload external_system_path(folder:, source:, finding:, externalsystem:) - # The resource will be in the following format: - # - # `folders/{folder}/sources/{source}/findings/{finding}/externalSystems/{externalsystem}` - # - # @param folder [String] - # @param source [String] - # @param finding [String] - # @param externalsystem [String] - # - # @overload external_system_path(project:, source:, finding:, externalsystem:) - # The resource will be in the following format: - # - # `projects/{project}/sources/{source}/findings/{finding}/externalSystems/{externalsystem}` - # - # @param project [String] - # @param source [String] - # @param finding [String] - # @param externalsystem [String] - # - # @return [::String] - def external_system_path **args - resources = { - "externalsystem:finding:organization:source" => (proc do |organization:, source:, finding:, externalsystem:| - raise ::ArgumentError, "organization cannot contain /" if organization.to_s.include? "/" - raise ::ArgumentError, "source cannot contain /" if source.to_s.include? "/" - raise ::ArgumentError, "finding cannot contain /" if finding.to_s.include? "/" - - "organizations/#{organization}/sources/#{source}/findings/#{finding}/externalSystems/#{externalsystem}" - end), - "externalsystem:finding:folder:source" => (proc do |folder:, source:, finding:, externalsystem:| - raise ::ArgumentError, "folder cannot contain /" if folder.to_s.include? "/" - raise ::ArgumentError, "source cannot contain /" if source.to_s.include? "/" - raise ::ArgumentError, "finding cannot contain /" if finding.to_s.include? "/" - - "folders/#{folder}/sources/#{source}/findings/#{finding}/externalSystems/#{externalsystem}" - end), - "externalsystem:finding:project:source" => (proc do |project:, source:, finding:, externalsystem:| - raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" - raise ::ArgumentError, "source cannot contain /" if source.to_s.include? "/" - raise ::ArgumentError, "finding cannot contain /" if finding.to_s.include? "/" - - "projects/#{project}/sources/#{source}/findings/#{finding}/externalSystems/#{externalsystem}" - 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 Finding resource string. - # - # @overload finding_path(organization:, source:, finding:) - # The resource will be in the following format: - # - # `organizations/{organization}/sources/{source}/findings/{finding}` - # - # @param organization [String] - # @param source [String] - # @param finding [String] - # - # @overload finding_path(folder:, source:, finding:) - # The resource will be in the following format: - # - # `folders/{folder}/sources/{source}/findings/{finding}` - # - # @param folder [String] - # @param source [String] - # @param finding [String] - # - # @overload finding_path(project:, source:, finding:) - # The resource will be in the following format: - # - # `projects/{project}/sources/{source}/findings/{finding}` - # - # @param project [String] - # @param source [String] - # @param finding [String] - # - # @return [::String] - def finding_path **args - resources = { - "finding:organization:source" => (proc do |organization:, source:, finding:| - raise ::ArgumentError, "organization cannot contain /" if organization.to_s.include? "/" - raise ::ArgumentError, "source cannot contain /" if source.to_s.include? "/" - - "organizations/#{organization}/sources/#{source}/findings/#{finding}" - end), - "finding:folder:source" => (proc do |folder:, source:, finding:| - raise ::ArgumentError, "folder cannot contain /" if folder.to_s.include? "/" - raise ::ArgumentError, "source cannot contain /" if source.to_s.include? "/" - - "folders/#{folder}/sources/#{source}/findings/#{finding}" - end), - "finding:project:source" => (proc do |project:, source:, finding:| - raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" - raise ::ArgumentError, "source cannot contain /" if source.to_s.include? "/" - - "projects/#{project}/sources/#{source}/findings/#{finding}" - 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 Folder resource string. - # - # The resource will be in the following format: - # - # `folders/{folder}` - # - # @param folder [String] - # - # @return [::String] - def folder_path folder: - "folders/#{folder}" - 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 MuteConfig resource string. - # - # @overload mute_config_path(organization:, mute_config:) - # The resource will be in the following format: - # - # `organizations/{organization}/muteConfigs/{mute_config}` - # - # @param organization [String] - # @param mute_config [String] - # - # @overload mute_config_path(folder:, mute_config:) - # The resource will be in the following format: - # - # `folders/{folder}/muteConfigs/{mute_config}` - # - # @param folder [String] - # @param mute_config [String] - # - # @overload mute_config_path(project:, mute_config:) - # The resource will be in the following format: - # - # `projects/{project}/muteConfigs/{mute_config}` - # - # @param project [String] - # @param mute_config [String] - # - # @overload mute_config_path(organization:, location:, mute_config:) - # The resource will be in the following format: - # - # `organizations/{organization}/locations/{location}/muteConfigs/{mute_config}` - # - # @param organization [String] - # @param location [String] - # @param mute_config [String] - # - # @overload mute_config_path(folder:, location:, mute_config:) - # The resource will be in the following format: - # - # `folders/{folder}/locations/{location}/muteConfigs/{mute_config}` - # - # @param folder [String] - # @param location [String] - # @param mute_config [String] - # - # @overload mute_config_path(project:, location:, mute_config:) - # The resource will be in the following format: - # - # `projects/{project}/locations/{location}/muteConfigs/{mute_config}` - # - # @param project [String] - # @param location [String] - # @param mute_config [String] - # - # @return [::String] - def mute_config_path **args - resources = { - "mute_config:organization" => (proc do |organization:, mute_config:| - raise ::ArgumentError, "organization cannot contain /" if organization.to_s.include? "/" - - "organizations/#{organization}/muteConfigs/#{mute_config}" - end), - "folder:mute_config" => (proc do |folder:, mute_config:| - raise ::ArgumentError, "folder cannot contain /" if folder.to_s.include? "/" - - "folders/#{folder}/muteConfigs/#{mute_config}" - end), - "mute_config:project" => (proc do |project:, mute_config:| - raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" - - "projects/#{project}/muteConfigs/#{mute_config}" - end), - "location:mute_config:organization" => (proc do |organization:, location:, mute_config:| - raise ::ArgumentError, "organization cannot contain /" if organization.to_s.include? "/" - raise ::ArgumentError, "location cannot contain /" if location.to_s.include? "/" - - "organizations/#{organization}/locations/#{location}/muteConfigs/#{mute_config}" - end), - "folder:location:mute_config" => (proc do |folder:, location:, mute_config:| - raise ::ArgumentError, "folder cannot contain /" if folder.to_s.include? "/" - raise ::ArgumentError, "location cannot contain /" if location.to_s.include? "/" - - "folders/#{folder}/locations/#{location}/muteConfigs/#{mute_config}" - end), - "location:mute_config:project" => (proc do |project:, location:, mute_config:| - raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" - raise ::ArgumentError, "location cannot contain /" if location.to_s.include? "/" - - "projects/#{project}/locations/#{location}/muteConfigs/#{mute_config}" - 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 NotificationConfig resource string. - # - # @overload notification_config_path(organization:, notification_config:) - # The resource will be in the following format: - # - # `organizations/{organization}/notificationConfigs/{notification_config}` - # - # @param organization [String] - # @param notification_config [String] - # - # @overload notification_config_path(folder:, notification_config:) - # The resource will be in the following format: - # - # `folders/{folder}/notificationConfigs/{notification_config}` - # - # @param folder [String] - # @param notification_config [String] - # - # @overload notification_config_path(project:, notification_config:) - # The resource will be in the following format: - # - # `projects/{project}/notificationConfigs/{notification_config}` - # - # @param project [String] - # @param notification_config [String] - # - # @return [::String] - def notification_config_path **args - resources = { - "notification_config:organization" => (proc do |organization:, notification_config:| - raise ::ArgumentError, "organization cannot contain /" if organization.to_s.include? "/" - - "organizations/#{organization}/notificationConfigs/#{notification_config}" - end), - "folder:notification_config" => (proc do |folder:, notification_config:| - raise ::ArgumentError, "folder cannot contain /" if folder.to_s.include? "/" - - "folders/#{folder}/notificationConfigs/#{notification_config}" - end), - "notification_config:project" => (proc do |project:, notification_config:| - raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" - - "projects/#{project}/notificationConfigs/#{notification_config}" - 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 Organization resource string. - # - # The resource will be in the following format: - # - # `organizations/{organization}` - # - # @param organization [String] - # - # @return [::String] - def organization_path organization: - "organizations/#{organization}" - 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 OrganizationSettings resource string. - # - # The resource will be in the following format: - # - # `organizations/{organization}/organizationSettings` - # - # @param organization [String] - # - # @return [::String] - def organization_settings_path organization: - "organizations/#{organization}/organizationSettings" - end - - ## - # Create a fully-qualified OrganizationSimulation resource string. - # - # The resource will be in the following format: - # - # `organizations/{organization}/simulations/{simulation}` - # - # @param organization [String] - # @param simulation [String] - # - # @return [::String] - def organization_simulation_path organization:, simulation: - raise ::ArgumentError, "organization cannot contain /" if organization.to_s.include? "/" - - "organizations/#{organization}/simulations/#{simulation}" - end - - ## - # Create a fully-qualified Policy resource string. - # - # @overload policy_path(organization:, constraint_name:) - # The resource will be in the following format: - # - # `organizations/{organization}/policies/{constraint_name}` - # - # @param organization [String] - # @param constraint_name [String] - # - # @overload policy_path(folder:, constraint_name:) - # The resource will be in the following format: - # - # `folders/{folder}/policies/{constraint_name}` - # - # @param folder [String] - # @param constraint_name [String] - # - # @overload policy_path(project:, constraint_name:) - # The resource will be in the following format: - # - # `projects/{project}/policies/{constraint_name}` - # - # @param project [String] - # @param constraint_name [String] - # - # @return [::String] - def policy_path **args - resources = { - "constraint_name:organization" => (proc do |organization:, constraint_name:| - raise ::ArgumentError, "organization cannot contain /" if organization.to_s.include? "/" - - "organizations/#{organization}/policies/#{constraint_name}" - end), - "constraint_name:folder" => (proc do |folder:, constraint_name:| - raise ::ArgumentError, "folder cannot contain /" if folder.to_s.include? "/" - - "folders/#{folder}/policies/#{constraint_name}" - end), - "constraint_name:project" => (proc do |project:, constraint_name:| - raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" - - "projects/#{project}/policies/#{constraint_name}" - 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 Project resource string. - # - # The resource will be in the following format: - # - # `projects/{project}` - # - # @param project [String] - # - # @return [::String] - def project_path project: - "projects/#{project}" - end - - ## - # Create a fully-qualified ResourceValueConfig resource string. - # - # The resource will be in the following format: - # - # `organizations/{organization}/resourceValueConfigs/{resource_value_config}` - # - # @param organization [String] - # @param resource_value_config [String] - # - # @return [::String] - def resource_value_config_path organization:, resource_value_config: - raise ::ArgumentError, "organization cannot contain /" if organization.to_s.include? "/" - - "organizations/#{organization}/resourceValueConfigs/#{resource_value_config}" - end - - ## - # Create a fully-qualified SecurityHealthAnalyticsCustomModule resource string. - # - # @overload security_health_analytics_custom_module_path(organization:, custom_module:) - # The resource will be in the following format: - # - # `organizations/{organization}/securityHealthAnalyticsSettings/customModules/{custom_module}` - # - # @param organization [String] - # @param custom_module [String] - # - # @overload security_health_analytics_custom_module_path(folder:, custom_module:) - # The resource will be in the following format: - # - # `folders/{folder}/securityHealthAnalyticsSettings/customModules/{custom_module}` - # - # @param folder [String] - # @param custom_module [String] - # - # @overload security_health_analytics_custom_module_path(project:, custom_module:) - # The resource will be in the following format: - # - # `projects/{project}/securityHealthAnalyticsSettings/customModules/{custom_module}` - # - # @param project [String] - # @param custom_module [String] - # - # @return [::String] - def security_health_analytics_custom_module_path **args - resources = { - "custom_module:organization" => (proc do |organization:, custom_module:| - raise ::ArgumentError, "organization cannot contain /" if organization.to_s.include? "/" - - "organizations/#{organization}/securityHealthAnalyticsSettings/customModules/#{custom_module}" - end), - "custom_module:folder" => (proc do |folder:, custom_module:| - raise ::ArgumentError, "folder cannot contain /" if folder.to_s.include? "/" - - "folders/#{folder}/securityHealthAnalyticsSettings/customModules/#{custom_module}" - end), - "custom_module:project" => (proc do |project:, custom_module:| - raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" - - "projects/#{project}/securityHealthAnalyticsSettings/customModules/#{custom_module}" - 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 SecurityHealthAnalyticsSettings resource string. - # - # @overload security_health_analytics_settings_path(organization:) - # The resource will be in the following format: - # - # `organizations/{organization}/securityHealthAnalyticsSettings` - # - # @param organization [String] - # - # @overload security_health_analytics_settings_path(folder:) - # The resource will be in the following format: - # - # `folders/{folder}/securityHealthAnalyticsSettings` - # - # @param folder [String] - # - # @overload security_health_analytics_settings_path(project:) - # The resource will be in the following format: - # - # `projects/{project}/securityHealthAnalyticsSettings` - # - # @param project [String] - # - # @return [::String] - def security_health_analytics_settings_path **args - resources = { - "organization" => (proc do |organization:| - "organizations/#{organization}/securityHealthAnalyticsSettings" - end), - "folder" => (proc do |folder:| - "folders/#{folder}/securityHealthAnalyticsSettings" - end), - "project" => (proc do |project:| - "projects/#{project}/securityHealthAnalyticsSettings" - 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 SecurityMarks resource string. - # - # @overload security_marks_path(organization:, asset:) - # The resource will be in the following format: - # - # `organizations/{organization}/assets/{asset}/securityMarks` - # - # @param organization [String] - # @param asset [String] - # - # @overload security_marks_path(organization:, source:, finding:) - # The resource will be in the following format: - # - # `organizations/{organization}/sources/{source}/findings/{finding}/securityMarks` - # - # @param organization [String] - # @param source [String] - # @param finding [String] - # - # @overload security_marks_path(folder:, asset:) - # The resource will be in the following format: - # - # `folders/{folder}/assets/{asset}/securityMarks` - # - # @param folder [String] - # @param asset [String] - # - # @overload security_marks_path(project:, asset:) - # The resource will be in the following format: - # - # `projects/{project}/assets/{asset}/securityMarks` - # - # @param project [String] - # @param asset [String] - # - # @overload security_marks_path(folder:, source:, finding:) - # The resource will be in the following format: - # - # `folders/{folder}/sources/{source}/findings/{finding}/securityMarks` - # - # @param folder [String] - # @param source [String] - # @param finding [String] - # - # @overload security_marks_path(project:, source:, finding:) - # The resource will be in the following format: - # - # `projects/{project}/sources/{source}/findings/{finding}/securityMarks` - # - # @param project [String] - # @param source [String] - # @param finding [String] - # - # @return [::String] - def security_marks_path **args - resources = { - "asset:organization" => (proc do |organization:, asset:| - raise ::ArgumentError, "organization cannot contain /" if organization.to_s.include? "/" - - "organizations/#{organization}/assets/#{asset}/securityMarks" - end), - "finding:organization:source" => (proc do |organization:, source:, finding:| - raise ::ArgumentError, "organization cannot contain /" if organization.to_s.include? "/" - raise ::ArgumentError, "source cannot contain /" if source.to_s.include? "/" - - "organizations/#{organization}/sources/#{source}/findings/#{finding}/securityMarks" - end), - "asset:folder" => (proc do |folder:, asset:| - raise ::ArgumentError, "folder cannot contain /" if folder.to_s.include? "/" - - "folders/#{folder}/assets/#{asset}/securityMarks" - end), - "asset:project" => (proc do |project:, asset:| - raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" - - "projects/#{project}/assets/#{asset}/securityMarks" - end), - "finding:folder:source" => (proc do |folder:, source:, finding:| - raise ::ArgumentError, "folder cannot contain /" if folder.to_s.include? "/" - raise ::ArgumentError, "source cannot contain /" if source.to_s.include? "/" - - "folders/#{folder}/sources/#{source}/findings/#{finding}/securityMarks" - end), - "finding:project:source" => (proc do |project:, source:, finding:| - raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" - raise ::ArgumentError, "source cannot contain /" if source.to_s.include? "/" - - "projects/#{project}/sources/#{source}/findings/#{finding}/securityMarks" - 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 Simulation resource string. - # - # The resource will be in the following format: - # - # `organizations/{organization}/simulations/{simulation}` - # - # @param organization [String] - # @param simulation [String] - # - # @return [::String] - def simulation_path organization:, simulation: - raise ::ArgumentError, "organization cannot contain /" if organization.to_s.include? "/" - - "organizations/#{organization}/simulations/#{simulation}" - end - - ## - # Create a fully-qualified Source resource string. - # - # @overload source_path(organization:, source:) - # The resource will be in the following format: - # - # `organizations/{organization}/sources/{source}` - # - # @param organization [String] - # @param source [String] - # - # @overload source_path(folder:, source:) - # The resource will be in the following format: - # - # `folders/{folder}/sources/{source}` - # - # @param folder [String] - # @param source [String] - # - # @overload source_path(project:, source:) - # The resource will be in the following format: - # - # `projects/{project}/sources/{source}` - # - # @param project [String] - # @param source [String] - # - # @return [::String] - def source_path **args - resources = { - "organization:source" => (proc do |organization:, source:| - raise ::ArgumentError, "organization cannot contain /" if organization.to_s.include? "/" - - "organizations/#{organization}/sources/#{source}" - end), - "folder:source" => (proc do |folder:, source:| - raise ::ArgumentError, "folder cannot contain /" if folder.to_s.include? "/" - - "folders/#{folder}/sources/#{source}" - end), - "project:source" => (proc do |project:, source:| - raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" - - "projects/#{project}/sources/#{source}" - 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 TableDataProfile resource string. - # - # @overload table_data_profile_path(project:, table_profile:) - # The resource will be in the following format: - # - # `projects/{project}/tableProfiles/{table_profile}` - # - # @param project [String] - # @param table_profile [String] - # - # @overload table_data_profile_path(project:, location:, table_profile:) - # The resource will be in the following format: - # - # `projects/{project}/locations/{location}/tableProfiles/{table_profile}` - # - # @param project [String] - # @param location [String] - # @param table_profile [String] - # - # @return [::String] - def table_data_profile_path **args - resources = { - "project:table_profile" => (proc do |project:, table_profile:| - raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" - - "projects/#{project}/tableProfiles/#{table_profile}" - end), - "location:project:table_profile" => (proc do |project:, location:, table_profile:| - raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" - raise ::ArgumentError, "location cannot contain /" if location.to_s.include? "/" - - "projects/#{project}/locations/#{location}/tableProfiles/#{table_profile}" - end) - } - - resource = resources[args.keys.sort.join(":")] - raise ::ArgumentError, "no resource found for values #{args.keys}" if resource.nil? - resource.call(**args) - end - - ## - # Create a fully-qualified Topic resource string. - # - # The resource will be in the following format: - # - # `projects/{project}/topics/{topic}` - # - # @param project [String] - # @param topic [String] - # - # @return [::String] - def topic_path project:, topic: - raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" - - "projects/#{project}/topics/#{topic}" - end - - ## - # Create a fully-qualified ValuedResource resource string. - # - # The resource will be in the following format: - # - # `organizations/{organization}/simulations/{simulation}/valuedResources/{valued_resource}` - # - # @param organization [String] - # @param simulation [String] - # @param valued_resource [String] - # - # @return [::String] - def valued_resource_path organization:, simulation:, valued_resource: - raise ::ArgumentError, "organization cannot contain /" if organization.to_s.include? "/" - raise ::ArgumentError, "simulation cannot contain /" if simulation.to_s.include? "/" - - "organizations/#{organization}/simulations/#{simulation}/valuedResources/#{valued_resource}" - end - - extend self - end - end - end - end - end -end diff --git a/owl-bot-staging/google-cloud-security_center-v1/lib/google/cloud/security_center/v1/security_center/rest.rb b/owl-bot-staging/google-cloud-security_center-v1/lib/google/cloud/security_center/v1/security_center/rest.rb deleted file mode 100644 index 9148bffe706d..000000000000 --- a/owl-bot-staging/google-cloud-security_center-v1/lib/google/cloud/security_center/v1/security_center/rest.rb +++ /dev/null @@ -1,53 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -require "gapic/rest" -require "gapic/config" -require "gapic/config/method" - -require "google/cloud/security_center/v1/version" - -require "google/cloud/security_center/v1/security_center/credentials" -require "google/cloud/security_center/v1/security_center/paths" -require "google/cloud/security_center/v1/security_center/rest/operations" -require "google/cloud/security_center/v1/security_center/rest/client" - -module Google - module Cloud - module SecurityCenter - module V1 - ## - # V1 APIs for Security Center service. - # - # To load this service and instantiate a REST client: - # - # require "google/cloud/security_center/v1/security_center/rest" - # client = ::Google::Cloud::SecurityCenter::V1::SecurityCenter::Rest::Client.new - # - module SecurityCenter - # Client for the REST transport - module Rest - end - end - end - end - end -end - -helper_path = ::File.join __dir__, "rest", "helpers.rb" -require "google/cloud/security_center/v1/security_center/rest/helpers" if ::File.file? helper_path diff --git a/owl-bot-staging/google-cloud-security_center-v1/lib/google/cloud/security_center/v1/security_center/rest/client.rb b/owl-bot-staging/google-cloud-security_center-v1/lib/google/cloud/security_center/v1/security_center/rest/client.rb deleted file mode 100644 index f3f3d089b09a..000000000000 --- a/owl-bot-staging/google-cloud-security_center-v1/lib/google/cloud/security_center/v1/security_center/rest/client.rb +++ /dev/null @@ -1,6968 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -require "google/cloud/errors" -require "google/cloud/securitycenter/v1/securitycenter_service_pb" -require "google/cloud/security_center/v1/security_center/rest/service_stub" - -module Google - module Cloud - module SecurityCenter - module V1 - module SecurityCenter - module Rest - ## - # REST client for the SecurityCenter service. - # - # V1 APIs for Security Center service. - # - class Client - # @private - API_VERSION = "" - - # @private - DEFAULT_ENDPOINT_TEMPLATE = "securitycenter.$UNIVERSE_DOMAIN$" - - include Paths - - # @private - attr_reader :security_center_stub - - ## - # Configure the SecurityCenter Client class. - # - # See {::Google::Cloud::SecurityCenter::V1::SecurityCenter::Rest::Client::Configuration} - # for a description of the configuration fields. - # - # @example - # - # # Modify the configuration for all SecurityCenter clients - # ::Google::Cloud::SecurityCenter::V1::SecurityCenter::Rest::Client.configure do |config| - # config.timeout = 10.0 - # end - # - # @yield [config] Configure the Client client. - # @yieldparam config [Client::Configuration] - # - # @return [Client::Configuration] - # - def self.configure - @configure ||= begin - namespace = ["Google", "Cloud", "SecurityCenter", "V1"] - parent_config = while namespace.any? - parent_name = namespace.join "::" - parent_const = const_get parent_name - break parent_const.configure if parent_const.respond_to? :configure - namespace.pop - end - default_config = Client::Configuration.new parent_config - - default_config.rpcs.create_security_health_analytics_custom_module.timeout = 60.0 - - default_config.rpcs.create_source.timeout = 60.0 - - default_config.rpcs.create_finding.timeout = 60.0 - - default_config.rpcs.create_notification_config.timeout = 60.0 - - default_config.rpcs.delete_notification_config.timeout = 60.0 - - default_config.rpcs.delete_security_health_analytics_custom_module.timeout = 60.0 - - default_config.rpcs.get_iam_policy.timeout = 60.0 - default_config.rpcs.get_iam_policy.retry_policy = { - initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [4, 14] - } - - default_config.rpcs.get_notification_config.timeout = 60.0 - default_config.rpcs.get_notification_config.retry_policy = { - initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [4, 14] - } - - default_config.rpcs.get_organization_settings.timeout = 60.0 - default_config.rpcs.get_organization_settings.retry_policy = { - initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [4, 14] - } - - default_config.rpcs.get_effective_security_health_analytics_custom_module.timeout = 60.0 - default_config.rpcs.get_effective_security_health_analytics_custom_module.retry_policy = { - initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [4, 14] - } - - default_config.rpcs.get_security_health_analytics_custom_module.timeout = 60.0 - default_config.rpcs.get_security_health_analytics_custom_module.retry_policy = { - initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [4, 14] - } - - default_config.rpcs.get_source.timeout = 60.0 - default_config.rpcs.get_source.retry_policy = { - initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [4, 14] - } - - default_config.rpcs.group_assets.timeout = 480.0 - default_config.rpcs.group_assets.retry_policy = { - initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [4, 14] - } - - default_config.rpcs.group_findings.timeout = 480.0 - default_config.rpcs.group_findings.retry_policy = { - initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [4, 14] - } - - default_config.rpcs.list_assets.timeout = 480.0 - default_config.rpcs.list_assets.retry_policy = { - initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [4, 14] - } - - default_config.rpcs.list_descendant_security_health_analytics_custom_modules.timeout = 60.0 - default_config.rpcs.list_descendant_security_health_analytics_custom_modules.retry_policy = { - initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [4, 14] - } - - default_config.rpcs.list_findings.timeout = 480.0 - default_config.rpcs.list_findings.retry_policy = { - initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [4, 14] - } - - default_config.rpcs.list_notification_configs.timeout = 60.0 - default_config.rpcs.list_notification_configs.retry_policy = { - initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [4, 14] - } - - default_config.rpcs.list_effective_security_health_analytics_custom_modules.timeout = 60.0 - default_config.rpcs.list_effective_security_health_analytics_custom_modules.retry_policy = { - initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [4, 14] - } - - default_config.rpcs.list_security_health_analytics_custom_modules.timeout = 60.0 - default_config.rpcs.list_security_health_analytics_custom_modules.retry_policy = { - initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [4, 14] - } - - default_config.rpcs.list_sources.timeout = 60.0 - default_config.rpcs.list_sources.retry_policy = { - initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [4, 14] - } - - default_config.rpcs.run_asset_discovery.timeout = 60.0 - - default_config.rpcs.set_finding_state.timeout = 60.0 - - default_config.rpcs.set_iam_policy.timeout = 60.0 - - default_config.rpcs.test_iam_permissions.timeout = 60.0 - default_config.rpcs.test_iam_permissions.retry_policy = { - initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [4, 14] - } - - default_config.rpcs.update_finding.timeout = 60.0 - - default_config.rpcs.update_notification_config.timeout = 60.0 - - default_config.rpcs.update_organization_settings.timeout = 60.0 - - default_config.rpcs.update_security_health_analytics_custom_module.timeout = 60.0 - - default_config.rpcs.update_source.timeout = 60.0 - - default_config.rpcs.update_security_marks.timeout = 480.0 - - default_config - end - yield @configure if block_given? - @configure - end - - ## - # Configure the SecurityCenter Client instance. - # - # The configuration is set to the derived mode, meaning that values can be changed, - # but structural changes (adding new fields, etc.) are not allowed. Structural changes - # should be made on {Client.configure}. - # - # See {::Google::Cloud::SecurityCenter::V1::SecurityCenter::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 - @security_center_stub.universe_domain - end - - ## - # Create a new SecurityCenter REST client object. - # - # @example - # - # # Create a client using the default configuration - # client = ::Google::Cloud::SecurityCenter::V1::SecurityCenter::Rest::Client.new - # - # # Create a client using a custom configuration - # client = ::Google::Cloud::SecurityCenter::V1::SecurityCenter::Rest::Client.new do |config| - # config.timeout = 10.0 - # end - # - # @yield [config] Configure the SecurityCenter client. - # @yieldparam config [Client::Configuration] - # - def initialize - # Create the configuration object - @config = Configuration.new Client.configure - - # Yield the configuration if needed - yield @config if block_given? - - # Create credentials - credentials = @config.credentials - # Use self-signed JWT if the endpoint is unchanged from default, - # but only if the default endpoint does not have a region prefix. - enable_self_signed_jwt = @config.endpoint.nil? || - (@config.endpoint == Configuration::DEFAULT_ENDPOINT && - !@config.endpoint.split(".").first.include?("-")) - credentials ||= Credentials.default scope: @config.scope, - enable_self_signed_jwt: enable_self_signed_jwt - if credentials.is_a?(::String) || credentials.is_a?(::Hash) - credentials = Credentials.new credentials, scope: @config.scope - end - - @quota_project_id = @config.quota_project - @quota_project_id ||= credentials.quota_project_id if credentials.respond_to? :quota_project_id - - @operations_client = ::Google::Cloud::SecurityCenter::V1::SecurityCenter::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 - - @security_center_stub = ::Google::Cloud::SecurityCenter::V1::SecurityCenter::Rest::ServiceStub.new( - endpoint: @config.endpoint, - endpoint_template: DEFAULT_ENDPOINT_TEMPLATE, - universe_domain: @config.universe_domain, - credentials: credentials, - logger: @config.logger - ) - - @security_center_stub.logger(stub: true)&.info do |entry| - entry.set_system_name - entry.set_service - entry.message = "Created client for #{entry.service}" - entry.set_credentials_fields credentials - entry.set "customEndpoint", @config.endpoint if @config.endpoint - entry.set "defaultTimeout", @config.timeout if @config.timeout - entry.set "quotaProject", @quota_project_id if @quota_project_id - end - end - - ## - # Get the associated client for long-running operations. - # - # @return [::Google::Cloud::SecurityCenter::V1::SecurityCenter::Rest::Operations] - # - attr_reader :operations_client - - ## - # The logger used for request/response debug logging. - # - # @return [Logger] - # - def logger - @security_center_stub.logger - end - - # Service calls - - ## - # Kicks off an LRO to bulk mute findings for a parent based on a filter. The - # parent can be either an organization, folder or project. The findings - # matched by the filter will be muted after the LRO is done. - # - # @overload bulk_mute_findings(request, options = nil) - # Pass arguments to `bulk_mute_findings` via a request object, either of type - # {::Google::Cloud::SecurityCenter::V1::BulkMuteFindingsRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::SecurityCenter::V1::BulkMuteFindingsRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @overload bulk_mute_findings(parent: nil, filter: nil, mute_annotation: nil, mute_state: nil) - # Pass arguments to `bulk_mute_findings` via keyword arguments. Note that at - # least one keyword argument is 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, at which bulk action needs to be applied. Its format - # is `organizations/[organization_id]`, `folders/[folder_id]`, - # `projects/[project_id]`. - # @param filter [::String] - # Expression that identifies findings that should be updated. - # The expression is a list of zero or more restrictions combined - # via logical operators `AND` and `OR`. Parentheses are supported, and `OR` - # has higher precedence than `AND`. - # - # Restrictions have the form ` ` and may have a - # `-` character in front of them to indicate negation. The fields map to - # those defined in the corresponding resource. - # - # The supported operators are: - # - # * `=` for all value types. - # * `>`, `<`, `>=`, `<=` for integer values. - # * `:`, meaning substring matching, for strings. - # - # The supported value types are: - # - # * string literals in quotes. - # * integer literals without quotes. - # * boolean literals `true` and `false` without quotes. - # @param mute_annotation [::String] - # This can be a mute configuration name or any identifier for mute/unmute - # of findings based on the filter. - # @param mute_state [::Google::Cloud::SecurityCenter::V1::BulkMuteFindingsRequest::MuteState] - # Optional. All findings matching the given filter will have their mute state - # set to this value. The default value is `MUTED`. Setting this to - # `UNDEFINED` will clear the mute state on all matching findings. - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Gapic::Operation] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Gapic::Operation] - # - # @raise [::Google::Cloud::Error] if the REST call is aborted. - # - # @example Basic example - # require "google/cloud/security_center/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::SecurityCenter::V1::SecurityCenter::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::SecurityCenter::V1::BulkMuteFindingsRequest.new - # - # # Call the bulk_mute_findings method. - # result = client.bulk_mute_findings 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 bulk_mute_findings request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::SecurityCenter::V1::BulkMuteFindingsRequest - - # Converts hash 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.bulk_mute_findings.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::SecurityCenter::V1::VERSION, - transports_version_send: [:rest] - - call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - options.apply_defaults timeout: @config.rpcs.bulk_mute_findings.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.bulk_mute_findings.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @security_center_stub.bulk_mute_findings 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 - - ## - # Creates a resident SecurityHealthAnalyticsCustomModule at the scope of the - # given CRM parent, and also creates inherited - # SecurityHealthAnalyticsCustomModules for all CRM descendants of the given - # parent. These modules are enabled by default. - # - # @overload create_security_health_analytics_custom_module(request, options = nil) - # Pass arguments to `create_security_health_analytics_custom_module` via a request object, either of type - # {::Google::Cloud::SecurityCenter::V1::CreateSecurityHealthAnalyticsCustomModuleRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::SecurityCenter::V1::CreateSecurityHealthAnalyticsCustomModuleRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_security_health_analytics_custom_module(parent: nil, security_health_analytics_custom_module: nil) - # Pass arguments to `create_security_health_analytics_custom_module` via keyword arguments. Note that at - # least one keyword argument is 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. Resource name of the new custom module's parent. Its format is - # `organizations/{organization}/securityHealthAnalyticsSettings`, - # `folders/{folder}/securityHealthAnalyticsSettings`, or - # `projects/{project}/securityHealthAnalyticsSettings` - # @param security_health_analytics_custom_module [::Google::Cloud::SecurityCenter::V1::SecurityHealthAnalyticsCustomModule, ::Hash] - # Required. SecurityHealthAnalytics custom module to create. The provided - # name is ignored and reset with provided parent information and - # server-generated ID. - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Cloud::SecurityCenter::V1::SecurityHealthAnalyticsCustomModule] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::SecurityCenter::V1::SecurityHealthAnalyticsCustomModule] - # - # @raise [::Google::Cloud::Error] if the REST call is aborted. - # - # @example Basic example - # require "google/cloud/security_center/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::SecurityCenter::V1::SecurityCenter::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::SecurityCenter::V1::CreateSecurityHealthAnalyticsCustomModuleRequest.new - # - # # Call the create_security_health_analytics_custom_module method. - # result = client.create_security_health_analytics_custom_module request - # - # # The returned object is of type Google::Cloud::SecurityCenter::V1::SecurityHealthAnalyticsCustomModule. - # p result - # - def create_security_health_analytics_custom_module request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::SecurityCenter::V1::CreateSecurityHealthAnalyticsCustomModuleRequest - - # Converts hash 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_security_health_analytics_custom_module.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::SecurityCenter::V1::VERSION, - transports_version_send: [:rest] - - call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - options.apply_defaults timeout: @config.rpcs.create_security_health_analytics_custom_module.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.create_security_health_analytics_custom_module.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @security_center_stub.create_security_health_analytics_custom_module request, options do |result, operation| - yield result, operation if block_given? - end - rescue ::Gapic::Rest::Error => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Creates a source. - # - # @overload create_source(request, options = nil) - # Pass arguments to `create_source` via a request object, either of type - # {::Google::Cloud::SecurityCenter::V1::CreateSourceRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::SecurityCenter::V1::CreateSourceRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_source(parent: nil, source: nil) - # Pass arguments to `create_source` via keyword arguments. Note that at - # least one keyword argument is 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. Resource name of the new source's parent. Its format should be - # `organizations/[organization_id]`. - # @param source [::Google::Cloud::SecurityCenter::V1::Source, ::Hash] - # Required. The Source being created, only the display_name and description - # will be used. All other fields will be ignored. - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Cloud::SecurityCenter::V1::Source] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::SecurityCenter::V1::Source] - # - # @raise [::Google::Cloud::Error] if the REST call is aborted. - # - # @example Basic example - # require "google/cloud/security_center/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::SecurityCenter::V1::SecurityCenter::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::SecurityCenter::V1::CreateSourceRequest.new - # - # # Call the create_source method. - # result = client.create_source request - # - # # The returned object is of type Google::Cloud::SecurityCenter::V1::Source. - # p result - # - def create_source request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::SecurityCenter::V1::CreateSourceRequest - - # Converts hash 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_source.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::SecurityCenter::V1::VERSION, - transports_version_send: [:rest] - - call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - options.apply_defaults timeout: @config.rpcs.create_source.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.create_source.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @security_center_stub.create_source request, options do |result, operation| - yield result, operation if block_given? - end - rescue ::Gapic::Rest::Error => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Creates a finding. The corresponding source must exist for finding creation - # to succeed. - # - # @overload create_finding(request, options = nil) - # Pass arguments to `create_finding` via a request object, either of type - # {::Google::Cloud::SecurityCenter::V1::CreateFindingRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::SecurityCenter::V1::CreateFindingRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_finding(parent: nil, finding_id: nil, finding: nil) - # Pass arguments to `create_finding` via keyword arguments. Note that at - # least one keyword argument is 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. Resource name of the new finding's parent. Its format should be - # `organizations/[organization_id]/sources/[source_id]`. - # @param finding_id [::String] - # Required. Unique identifier provided by the client within the parent scope. - # It must be alphanumeric and less than or equal to 32 characters and - # greater than 0 characters in length. - # @param finding [::Google::Cloud::SecurityCenter::V1::Finding, ::Hash] - # Required. The Finding being created. The name and security_marks will be - # ignored as they are both output only fields on this resource. - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Cloud::SecurityCenter::V1::Finding] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::SecurityCenter::V1::Finding] - # - # @raise [::Google::Cloud::Error] if the REST call is aborted. - # - # @example Basic example - # require "google/cloud/security_center/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::SecurityCenter::V1::SecurityCenter::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::SecurityCenter::V1::CreateFindingRequest.new - # - # # Call the create_finding method. - # result = client.create_finding request - # - # # The returned object is of type Google::Cloud::SecurityCenter::V1::Finding. - # p result - # - def create_finding request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::SecurityCenter::V1::CreateFindingRequest - - # Converts hash 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_finding.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::SecurityCenter::V1::VERSION, - transports_version_send: [:rest] - - call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - options.apply_defaults timeout: @config.rpcs.create_finding.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.create_finding.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @security_center_stub.create_finding request, options do |result, operation| - yield result, operation if block_given? - end - rescue ::Gapic::Rest::Error => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Creates a mute config. - # - # @overload create_mute_config(request, options = nil) - # Pass arguments to `create_mute_config` via a request object, either of type - # {::Google::Cloud::SecurityCenter::V1::CreateMuteConfigRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::SecurityCenter::V1::CreateMuteConfigRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_mute_config(parent: nil, mute_config: nil, mute_config_id: nil) - # Pass arguments to `create_mute_config` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param parent [::String] - # Required. Resource name of the new mute configs's parent. Its format is - # `organizations/[organization_id]`, `folders/[folder_id]`, or - # `projects/[project_id]`. - # @param mute_config [::Google::Cloud::SecurityCenter::V1::MuteConfig, ::Hash] - # Required. The mute config being created. - # @param mute_config_id [::String] - # Required. Unique identifier provided by the client within the parent scope. - # It must consist of only lowercase letters, numbers, and hyphens, must start - # with a letter, must end with either a letter or a number, and must be 63 - # characters or less. - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Cloud::SecurityCenter::V1::MuteConfig] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::SecurityCenter::V1::MuteConfig] - # - # @raise [::Google::Cloud::Error] if the REST call is aborted. - # - # @example Basic example - # require "google/cloud/security_center/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::SecurityCenter::V1::SecurityCenter::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::SecurityCenter::V1::CreateMuteConfigRequest.new - # - # # Call the create_mute_config method. - # result = client.create_mute_config request - # - # # The returned object is of type Google::Cloud::SecurityCenter::V1::MuteConfig. - # p result - # - def create_mute_config request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::SecurityCenter::V1::CreateMuteConfigRequest - - # Converts hash 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_mute_config.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::SecurityCenter::V1::VERSION, - transports_version_send: [:rest] - - call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - options.apply_defaults timeout: @config.rpcs.create_mute_config.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.create_mute_config.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @security_center_stub.create_mute_config request, options do |result, operation| - yield result, operation if block_given? - end - rescue ::Gapic::Rest::Error => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Creates a notification config. - # - # @overload create_notification_config(request, options = nil) - # Pass arguments to `create_notification_config` via a request object, either of type - # {::Google::Cloud::SecurityCenter::V1::CreateNotificationConfigRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::SecurityCenter::V1::CreateNotificationConfigRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_notification_config(parent: nil, config_id: nil, notification_config: nil) - # Pass arguments to `create_notification_config` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param parent [::String] - # Required. Resource name of the new notification config's parent. Its format - # is `organizations/[organization_id]`, `folders/[folder_id]`, or - # `projects/[project_id]`. - # @param config_id [::String] - # Required. - # Unique identifier provided by the client within the parent scope. - # It must be between 1 and 128 characters and contain alphanumeric - # characters, underscores, or hyphens only. - # @param notification_config [::Google::Cloud::SecurityCenter::V1::NotificationConfig, ::Hash] - # Required. The notification config being created. The name and the service - # account will be ignored as they are both output only fields on this - # resource. - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Cloud::SecurityCenter::V1::NotificationConfig] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::SecurityCenter::V1::NotificationConfig] - # - # @raise [::Google::Cloud::Error] if the REST call is aborted. - # - # @example Basic example - # require "google/cloud/security_center/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::SecurityCenter::V1::SecurityCenter::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::SecurityCenter::V1::CreateNotificationConfigRequest.new - # - # # Call the create_notification_config method. - # result = client.create_notification_config request - # - # # The returned object is of type Google::Cloud::SecurityCenter::V1::NotificationConfig. - # p result - # - def create_notification_config request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::SecurityCenter::V1::CreateNotificationConfigRequest - - # Converts hash 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_notification_config.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::SecurityCenter::V1::VERSION, - transports_version_send: [:rest] - - call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - options.apply_defaults timeout: @config.rpcs.create_notification_config.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.create_notification_config.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @security_center_stub.create_notification_config request, options do |result, operation| - yield result, operation if block_given? - end - rescue ::Gapic::Rest::Error => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Deletes an existing mute config. - # - # @overload delete_mute_config(request, options = nil) - # Pass arguments to `delete_mute_config` via a request object, either of type - # {::Google::Cloud::SecurityCenter::V1::DeleteMuteConfigRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::SecurityCenter::V1::DeleteMuteConfigRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_mute_config(name: nil) - # Pass arguments to `delete_mute_config` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param name [::String] - # Required. Name of the mute config to delete. Its format is - # `organizations/{organization}/muteConfigs/{config_id}`, - # `folders/{folder}/muteConfigs/{config_id}`, - # `projects/{project}/muteConfigs/{config_id}`, - # `organizations/{organization}/locations/global/muteConfigs/{config_id}`, - # `folders/{folder}/locations/global/muteConfigs/{config_id}`, or - # `projects/{project}/locations/global/muteConfigs/{config_id}`. - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Protobuf::Empty] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Protobuf::Empty] - # - # @raise [::Google::Cloud::Error] if the REST call is aborted. - # - # @example Basic example - # require "google/cloud/security_center/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::SecurityCenter::V1::SecurityCenter::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::SecurityCenter::V1::DeleteMuteConfigRequest.new - # - # # Call the delete_mute_config method. - # result = client.delete_mute_config request - # - # # The returned object is of type Google::Protobuf::Empty. - # p result - # - def delete_mute_config request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::SecurityCenter::V1::DeleteMuteConfigRequest - - # Converts hash 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_mute_config.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::SecurityCenter::V1::VERSION, - transports_version_send: [:rest] - - call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - options.apply_defaults timeout: @config.rpcs.delete_mute_config.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.delete_mute_config.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @security_center_stub.delete_mute_config request, options do |result, operation| - yield result, operation if block_given? - end - rescue ::Gapic::Rest::Error => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Deletes a notification config. - # - # @overload delete_notification_config(request, options = nil) - # Pass arguments to `delete_notification_config` via a request object, either of type - # {::Google::Cloud::SecurityCenter::V1::DeleteNotificationConfigRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::SecurityCenter::V1::DeleteNotificationConfigRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_notification_config(name: nil) - # Pass arguments to `delete_notification_config` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param name [::String] - # Required. Name of the notification config to delete. Its format is - # `organizations/[organization_id]/notificationConfigs/[config_id]`, - # `folders/[folder_id]/notificationConfigs/[config_id]`, - # or `projects/[project_id]/notificationConfigs/[config_id]`. - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Protobuf::Empty] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Protobuf::Empty] - # - # @raise [::Google::Cloud::Error] if the REST call is aborted. - # - # @example Basic example - # require "google/cloud/security_center/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::SecurityCenter::V1::SecurityCenter::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::SecurityCenter::V1::DeleteNotificationConfigRequest.new - # - # # Call the delete_notification_config method. - # result = client.delete_notification_config request - # - # # The returned object is of type Google::Protobuf::Empty. - # p result - # - def delete_notification_config request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::SecurityCenter::V1::DeleteNotificationConfigRequest - - # Converts hash 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_notification_config.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::SecurityCenter::V1::VERSION, - transports_version_send: [:rest] - - call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - options.apply_defaults timeout: @config.rpcs.delete_notification_config.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.delete_notification_config.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @security_center_stub.delete_notification_config request, options do |result, operation| - yield result, operation if block_given? - end - rescue ::Gapic::Rest::Error => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Deletes the specified SecurityHealthAnalyticsCustomModule and all of its - # descendants in the CRM hierarchy. This method is only supported for - # resident custom modules. - # - # @overload delete_security_health_analytics_custom_module(request, options = nil) - # Pass arguments to `delete_security_health_analytics_custom_module` via a request object, either of type - # {::Google::Cloud::SecurityCenter::V1::DeleteSecurityHealthAnalyticsCustomModuleRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::SecurityCenter::V1::DeleteSecurityHealthAnalyticsCustomModuleRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_security_health_analytics_custom_module(name: nil) - # Pass arguments to `delete_security_health_analytics_custom_module` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param name [::String] - # Required. Name of the custom module to delete. Its format is - # `organizations/{organization}/securityHealthAnalyticsSettings/customModules/{customModule}`, - # `folders/{folder}/securityHealthAnalyticsSettings/customModules/{customModule}`, - # or - # `projects/{project}/securityHealthAnalyticsSettings/customModules/{customModule}` - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Protobuf::Empty] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Protobuf::Empty] - # - # @raise [::Google::Cloud::Error] if the REST call is aborted. - # - # @example Basic example - # require "google/cloud/security_center/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::SecurityCenter::V1::SecurityCenter::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::SecurityCenter::V1::DeleteSecurityHealthAnalyticsCustomModuleRequest.new - # - # # Call the delete_security_health_analytics_custom_module method. - # result = client.delete_security_health_analytics_custom_module request - # - # # The returned object is of type Google::Protobuf::Empty. - # p result - # - def delete_security_health_analytics_custom_module request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::SecurityCenter::V1::DeleteSecurityHealthAnalyticsCustomModuleRequest - - # Converts hash 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_security_health_analytics_custom_module.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::SecurityCenter::V1::VERSION, - transports_version_send: [:rest] - - call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - options.apply_defaults timeout: @config.rpcs.delete_security_health_analytics_custom_module.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.delete_security_health_analytics_custom_module.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @security_center_stub.delete_security_health_analytics_custom_module 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 - - ## - # Get the simulation by name or the latest simulation for the given - # organization. - # - # @overload get_simulation(request, options = nil) - # Pass arguments to `get_simulation` via a request object, either of type - # {::Google::Cloud::SecurityCenter::V1::GetSimulationRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::SecurityCenter::V1::GetSimulationRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_simulation(name: nil) - # Pass arguments to `get_simulation` via keyword arguments. Note that at - # least one keyword argument is 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 organization name or simulation name of this simulation - # - # Valid format: - # `organizations/{organization}/simulations/latest` - # `organizations/{organization}/simulations/{simulation}` - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Cloud::SecurityCenter::V1::Simulation] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::SecurityCenter::V1::Simulation] - # - # @raise [::Google::Cloud::Error] if the REST call is aborted. - # - # @example Basic example - # require "google/cloud/security_center/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::SecurityCenter::V1::SecurityCenter::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::SecurityCenter::V1::GetSimulationRequest.new - # - # # Call the get_simulation method. - # result = client.get_simulation request - # - # # The returned object is of type Google::Cloud::SecurityCenter::V1::Simulation. - # p result - # - def get_simulation request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::SecurityCenter::V1::GetSimulationRequest - - # Converts hash 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_simulation.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::SecurityCenter::V1::VERSION, - transports_version_send: [:rest] - - call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - options.apply_defaults timeout: @config.rpcs.get_simulation.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.get_simulation.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @security_center_stub.get_simulation 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 - - ## - # Get the valued resource by name - # - # @overload get_valued_resource(request, options = nil) - # Pass arguments to `get_valued_resource` via a request object, either of type - # {::Google::Cloud::SecurityCenter::V1::GetValuedResourceRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::SecurityCenter::V1::GetValuedResourceRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_valued_resource(name: nil) - # Pass arguments to `get_valued_resource` via keyword arguments. Note that at - # least one keyword argument is 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 this valued resource - # - # Valid format: - # `organizations/{organization}/simulations/{simulation}/valuedResources/{valued_resource}` - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Cloud::SecurityCenter::V1::ValuedResource] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::SecurityCenter::V1::ValuedResource] - # - # @raise [::Google::Cloud::Error] if the REST call is aborted. - # - # @example Basic example - # require "google/cloud/security_center/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::SecurityCenter::V1::SecurityCenter::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::SecurityCenter::V1::GetValuedResourceRequest.new - # - # # Call the get_valued_resource method. - # result = client.get_valued_resource request - # - # # The returned object is of type Google::Cloud::SecurityCenter::V1::ValuedResource. - # p result - # - def get_valued_resource request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::SecurityCenter::V1::GetValuedResourceRequest - - # Converts hash 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_valued_resource.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::SecurityCenter::V1::VERSION, - transports_version_send: [:rest] - - call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - options.apply_defaults timeout: @config.rpcs.get_valued_resource.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.get_valued_resource.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @security_center_stub.get_valued_resource request, options do |result, operation| - yield result, operation if block_given? - end - rescue ::Gapic::Rest::Error => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Gets a BigQuery export. - # - # @overload get_big_query_export(request, options = nil) - # Pass arguments to `get_big_query_export` via a request object, either of type - # {::Google::Cloud::SecurityCenter::V1::GetBigQueryExportRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::SecurityCenter::V1::GetBigQueryExportRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_big_query_export(name: nil) - # Pass arguments to `get_big_query_export` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param name [::String] - # Required. Name of the BigQuery export to retrieve. Its format is - # `organizations/{organization}/bigQueryExports/{export_id}`, - # `folders/{folder}/bigQueryExports/{export_id}`, or - # `projects/{project}/bigQueryExports/{export_id}` - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Cloud::SecurityCenter::V1::BigQueryExport] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::SecurityCenter::V1::BigQueryExport] - # - # @raise [::Google::Cloud::Error] if the REST call is aborted. - # - # @example Basic example - # require "google/cloud/security_center/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::SecurityCenter::V1::SecurityCenter::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::SecurityCenter::V1::GetBigQueryExportRequest.new - # - # # Call the get_big_query_export method. - # result = client.get_big_query_export request - # - # # The returned object is of type Google::Cloud::SecurityCenter::V1::BigQueryExport. - # p result - # - def get_big_query_export request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::SecurityCenter::V1::GetBigQueryExportRequest - - # Converts hash 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_big_query_export.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::SecurityCenter::V1::VERSION, - transports_version_send: [:rest] - - call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - options.apply_defaults timeout: @config.rpcs.get_big_query_export.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.get_big_query_export.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @security_center_stub.get_big_query_export request, options do |result, operation| - yield result, operation if block_given? - end - rescue ::Gapic::Rest::Error => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Gets the access control policy on the specified Source. - # - # @overload get_iam_policy(request, options = nil) - # Pass arguments to `get_iam_policy` via a request object, either of type - # {::Google::Iam::V1::GetIamPolicyRequest} or an equivalent Hash. - # - # @param request [::Google::Iam::V1::GetIamPolicyRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @overload get_iam_policy(resource: nil, options: nil) - # Pass arguments to `get_iam_policy` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param resource [::String] - # REQUIRED: The resource for which the policy is being requested. - # See the operation documentation for the appropriate value for this field. - # @param options [::Google::Iam::V1::GetPolicyOptions, ::Hash] - # OPTIONAL: A `GetPolicyOptions` object for specifying options to - # `GetIamPolicy`. - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Iam::V1::Policy] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Iam::V1::Policy] - # - # @raise [::Google::Cloud::Error] if the REST call is aborted. - # - # @example Basic example - # require "google/cloud/security_center/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::SecurityCenter::V1::SecurityCenter::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Iam::V1::GetIamPolicyRequest.new - # - # # Call the get_iam_policy method. - # result = client.get_iam_policy request - # - # # The returned object is of type Google::Iam::V1::Policy. - # p result - # - def get_iam_policy request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Iam::V1::GetIamPolicyRequest - - # Converts hash and nil to an options object - options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h - - # Customize the options with defaults - call_metadata = @config.rpcs.get_iam_policy.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::SecurityCenter::V1::VERSION, - transports_version_send: [:rest] - - call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - options.apply_defaults timeout: @config.rpcs.get_iam_policy.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.get_iam_policy.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @security_center_stub.get_iam_policy request, options do |result, operation| - yield result, operation if block_given? - end - rescue ::Gapic::Rest::Error => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Gets a mute config. - # - # @overload get_mute_config(request, options = nil) - # Pass arguments to `get_mute_config` via a request object, either of type - # {::Google::Cloud::SecurityCenter::V1::GetMuteConfigRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::SecurityCenter::V1::GetMuteConfigRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_mute_config(name: nil) - # Pass arguments to `get_mute_config` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param name [::String] - # Required. Name of the mute config to retrieve. Its format is - # `organizations/{organization}/muteConfigs/{config_id}`, - # `folders/{folder}/muteConfigs/{config_id}`, - # `projects/{project}/muteConfigs/{config_id}`, - # `organizations/{organization}/locations/global/muteConfigs/{config_id}`, - # `folders/{folder}/locations/global/muteConfigs/{config_id}`, or - # `projects/{project}/locations/global/muteConfigs/{config_id}`. - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Cloud::SecurityCenter::V1::MuteConfig] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::SecurityCenter::V1::MuteConfig] - # - # @raise [::Google::Cloud::Error] if the REST call is aborted. - # - # @example Basic example - # require "google/cloud/security_center/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::SecurityCenter::V1::SecurityCenter::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::SecurityCenter::V1::GetMuteConfigRequest.new - # - # # Call the get_mute_config method. - # result = client.get_mute_config request - # - # # The returned object is of type Google::Cloud::SecurityCenter::V1::MuteConfig. - # p result - # - def get_mute_config request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::SecurityCenter::V1::GetMuteConfigRequest - - # Converts hash 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_mute_config.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::SecurityCenter::V1::VERSION, - transports_version_send: [:rest] - - call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - options.apply_defaults timeout: @config.rpcs.get_mute_config.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.get_mute_config.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @security_center_stub.get_mute_config request, options do |result, operation| - yield result, operation if block_given? - end - rescue ::Gapic::Rest::Error => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Gets a notification config. - # - # @overload get_notification_config(request, options = nil) - # Pass arguments to `get_notification_config` via a request object, either of type - # {::Google::Cloud::SecurityCenter::V1::GetNotificationConfigRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::SecurityCenter::V1::GetNotificationConfigRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_notification_config(name: nil) - # Pass arguments to `get_notification_config` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param name [::String] - # Required. Name of the notification config to get. Its format is - # `organizations/[organization_id]/notificationConfigs/[config_id]`, - # `folders/[folder_id]/notificationConfigs/[config_id]`, - # or `projects/[project_id]/notificationConfigs/[config_id]`. - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Cloud::SecurityCenter::V1::NotificationConfig] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::SecurityCenter::V1::NotificationConfig] - # - # @raise [::Google::Cloud::Error] if the REST call is aborted. - # - # @example Basic example - # require "google/cloud/security_center/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::SecurityCenter::V1::SecurityCenter::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::SecurityCenter::V1::GetNotificationConfigRequest.new - # - # # Call the get_notification_config method. - # result = client.get_notification_config request - # - # # The returned object is of type Google::Cloud::SecurityCenter::V1::NotificationConfig. - # p result - # - def get_notification_config request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::SecurityCenter::V1::GetNotificationConfigRequest - - # Converts hash 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_notification_config.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::SecurityCenter::V1::VERSION, - transports_version_send: [:rest] - - call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - options.apply_defaults timeout: @config.rpcs.get_notification_config.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.get_notification_config.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @security_center_stub.get_notification_config request, options do |result, operation| - yield result, operation if block_given? - end - rescue ::Gapic::Rest::Error => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Gets the settings for an organization. - # - # @overload get_organization_settings(request, options = nil) - # Pass arguments to `get_organization_settings` via a request object, either of type - # {::Google::Cloud::SecurityCenter::V1::GetOrganizationSettingsRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::SecurityCenter::V1::GetOrganizationSettingsRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @overload get_organization_settings(name: nil) - # Pass arguments to `get_organization_settings` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param name [::String] - # Required. Name of the organization to get organization settings for. Its - # format is `organizations/[organization_id]/organizationSettings`. - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Cloud::SecurityCenter::V1::OrganizationSettings] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::SecurityCenter::V1::OrganizationSettings] - # - # @raise [::Google::Cloud::Error] if the REST call is aborted. - # - # @example Basic example - # require "google/cloud/security_center/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::SecurityCenter::V1::SecurityCenter::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::SecurityCenter::V1::GetOrganizationSettingsRequest.new - # - # # Call the get_organization_settings method. - # result = client.get_organization_settings request - # - # # The returned object is of type Google::Cloud::SecurityCenter::V1::OrganizationSettings. - # p result - # - def get_organization_settings request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::SecurityCenter::V1::GetOrganizationSettingsRequest - - # Converts hash and nil to an options object - options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h - - # Customize the options with defaults - call_metadata = @config.rpcs.get_organization_settings.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::SecurityCenter::V1::VERSION, - transports_version_send: [:rest] - - call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - options.apply_defaults timeout: @config.rpcs.get_organization_settings.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.get_organization_settings.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @security_center_stub.get_organization_settings 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 - - ## - # Retrieves an EffectiveSecurityHealthAnalyticsCustomModule. - # - # @overload get_effective_security_health_analytics_custom_module(request, options = nil) - # Pass arguments to `get_effective_security_health_analytics_custom_module` via a request object, either of type - # {::Google::Cloud::SecurityCenter::V1::GetEffectiveSecurityHealthAnalyticsCustomModuleRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::SecurityCenter::V1::GetEffectiveSecurityHealthAnalyticsCustomModuleRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_effective_security_health_analytics_custom_module(name: nil) - # Pass arguments to `get_effective_security_health_analytics_custom_module` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param name [::String] - # Required. Name of the effective custom module to get. Its format is - # `organizations/{organization}/securityHealthAnalyticsSettings/effectiveCustomModules/{customModule}`, - # `folders/{folder}/securityHealthAnalyticsSettings/effectiveCustomModules/{customModule}`, - # or - # `projects/{project}/securityHealthAnalyticsSettings/effectiveCustomModules/{customModule}` - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Cloud::SecurityCenter::V1::EffectiveSecurityHealthAnalyticsCustomModule] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::SecurityCenter::V1::EffectiveSecurityHealthAnalyticsCustomModule] - # - # @raise [::Google::Cloud::Error] if the REST call is aborted. - # - # @example Basic example - # require "google/cloud/security_center/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::SecurityCenter::V1::SecurityCenter::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::SecurityCenter::V1::GetEffectiveSecurityHealthAnalyticsCustomModuleRequest.new - # - # # Call the get_effective_security_health_analytics_custom_module method. - # result = client.get_effective_security_health_analytics_custom_module request - # - # # The returned object is of type Google::Cloud::SecurityCenter::V1::EffectiveSecurityHealthAnalyticsCustomModule. - # p result - # - def get_effective_security_health_analytics_custom_module request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::SecurityCenter::V1::GetEffectiveSecurityHealthAnalyticsCustomModuleRequest - - # Converts hash 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_effective_security_health_analytics_custom_module.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::SecurityCenter::V1::VERSION, - transports_version_send: [:rest] - - call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - options.apply_defaults timeout: @config.rpcs.get_effective_security_health_analytics_custom_module.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.get_effective_security_health_analytics_custom_module.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @security_center_stub.get_effective_security_health_analytics_custom_module 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 - - ## - # Retrieves a SecurityHealthAnalyticsCustomModule. - # - # @overload get_security_health_analytics_custom_module(request, options = nil) - # Pass arguments to `get_security_health_analytics_custom_module` via a request object, either of type - # {::Google::Cloud::SecurityCenter::V1::GetSecurityHealthAnalyticsCustomModuleRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::SecurityCenter::V1::GetSecurityHealthAnalyticsCustomModuleRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_security_health_analytics_custom_module(name: nil) - # Pass arguments to `get_security_health_analytics_custom_module` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param name [::String] - # Required. Name of the custom module to get. Its format is - # `organizations/{organization}/securityHealthAnalyticsSettings/customModules/{customModule}`, - # `folders/{folder}/securityHealthAnalyticsSettings/customModules/{customModule}`, - # or - # `projects/{project}/securityHealthAnalyticsSettings/customModules/{customModule}` - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Cloud::SecurityCenter::V1::SecurityHealthAnalyticsCustomModule] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::SecurityCenter::V1::SecurityHealthAnalyticsCustomModule] - # - # @raise [::Google::Cloud::Error] if the REST call is aborted. - # - # @example Basic example - # require "google/cloud/security_center/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::SecurityCenter::V1::SecurityCenter::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::SecurityCenter::V1::GetSecurityHealthAnalyticsCustomModuleRequest.new - # - # # Call the get_security_health_analytics_custom_module method. - # result = client.get_security_health_analytics_custom_module request - # - # # The returned object is of type Google::Cloud::SecurityCenter::V1::SecurityHealthAnalyticsCustomModule. - # p result - # - def get_security_health_analytics_custom_module request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::SecurityCenter::V1::GetSecurityHealthAnalyticsCustomModuleRequest - - # Converts hash 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_security_health_analytics_custom_module.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::SecurityCenter::V1::VERSION, - transports_version_send: [:rest] - - call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - options.apply_defaults timeout: @config.rpcs.get_security_health_analytics_custom_module.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.get_security_health_analytics_custom_module.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @security_center_stub.get_security_health_analytics_custom_module request, options do |result, operation| - yield result, operation if block_given? - end - rescue ::Gapic::Rest::Error => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Gets a source. - # - # @overload get_source(request, options = nil) - # Pass arguments to `get_source` via a request object, either of type - # {::Google::Cloud::SecurityCenter::V1::GetSourceRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::SecurityCenter::V1::GetSourceRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_source(name: nil) - # Pass arguments to `get_source` via keyword arguments. Note that at - # least one keyword argument is 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. Relative resource name of the source. Its format is - # `organizations/[organization_id]/source/[source_id]`. - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Cloud::SecurityCenter::V1::Source] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::SecurityCenter::V1::Source] - # - # @raise [::Google::Cloud::Error] if the REST call is aborted. - # - # @example Basic example - # require "google/cloud/security_center/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::SecurityCenter::V1::SecurityCenter::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::SecurityCenter::V1::GetSourceRequest.new - # - # # Call the get_source method. - # result = client.get_source request - # - # # The returned object is of type Google::Cloud::SecurityCenter::V1::Source. - # p result - # - def get_source request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::SecurityCenter::V1::GetSourceRequest - - # Converts hash 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_source.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::SecurityCenter::V1::VERSION, - transports_version_send: [:rest] - - call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - options.apply_defaults timeout: @config.rpcs.get_source.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.get_source.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @security_center_stub.get_source 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 - - ## - # Filters an organization's assets and groups them by their specified - # properties. - # - # @overload group_assets(request, options = nil) - # Pass arguments to `group_assets` via a request object, either of type - # {::Google::Cloud::SecurityCenter::V1::GroupAssetsRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::SecurityCenter::V1::GroupAssetsRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @overload group_assets(parent: nil, filter: nil, group_by: nil, compare_duration: nil, read_time: nil, page_token: nil, page_size: nil) - # Pass arguments to `group_assets` via keyword arguments. Note that at - # least one keyword argument is 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 name of the parent to group the assets by. Its format is - # `organizations/[organization_id]`, `folders/[folder_id]`, or - # `projects/[project_id]`. - # @param filter [::String] - # Expression that defines the filter to apply across assets. - # The expression is a list of zero or more restrictions combined via logical - # operators `AND` and `OR`. - # Parentheses are supported, and `OR` has higher precedence than `AND`. - # - # Restrictions have the form ` ` and may have a `-` - # character in front of them to indicate negation. The fields map to those - # defined in the Asset resource. Examples include: - # - # * name - # * security_center_properties.resource_name - # * resource_properties.a_property - # * security_marks.marks.marka - # - # The supported operators are: - # - # * `=` for all value types. - # * `>`, `<`, `>=`, `<=` for integer values. - # * `:`, meaning substring matching, for strings. - # - # The supported value types are: - # - # * string literals in quotes. - # * integer literals without quotes. - # * boolean literals `true` and `false` without quotes. - # - # The following field and operator combinations are supported: - # - # * name: `=` - # * update_time: `=`, `>`, `<`, `>=`, `<=` - # - # Usage: This should be milliseconds since epoch or an RFC3339 string. - # Examples: - # `update_time = "2019-06-10T16:07:18-07:00"` - # `update_time = 1560208038000` - # - # * create_time: `=`, `>`, `<`, `>=`, `<=` - # - # Usage: This should be milliseconds since epoch or an RFC3339 string. - # Examples: - # `create_time = "2019-06-10T16:07:18-07:00"` - # `create_time = 1560208038000` - # - # * iam_policy.policy_blob: `=`, `:` - # * resource_properties: `=`, `:`, `>`, `<`, `>=`, `<=` - # * security_marks.marks: `=`, `:` - # * security_center_properties.resource_name: `=`, `:` - # * security_center_properties.resource_display_name: `=`, `:` - # * security_center_properties.resource_type: `=`, `:` - # * security_center_properties.resource_parent: `=`, `:` - # * security_center_properties.resource_parent_display_name: `=`, `:` - # * security_center_properties.resource_project: `=`, `:` - # * security_center_properties.resource_project_display_name: `=`, `:` - # * security_center_properties.resource_owners: `=`, `:` - # - # For example, `resource_properties.size = 100` is a valid filter string. - # - # Use a partial match on the empty string to filter based on a property - # existing: `resource_properties.my_property : ""` - # - # Use a negated partial match on the empty string to filter based on a - # property not existing: `-resource_properties.my_property : ""` - # @param group_by [::String] - # Required. Expression that defines what assets fields to use for grouping. - # The string value should follow SQL syntax: comma separated list of fields. - # For example: - # "security_center_properties.resource_project,security_center_properties.project". - # - # The following fields are supported when compare_duration is not set: - # - # * security_center_properties.resource_project - # * security_center_properties.resource_project_display_name - # * security_center_properties.resource_type - # * security_center_properties.resource_parent - # * security_center_properties.resource_parent_display_name - # - # The following fields are supported when compare_duration is set: - # - # * security_center_properties.resource_type - # * security_center_properties.resource_project_display_name - # * security_center_properties.resource_parent_display_name - # @param compare_duration [::Google::Protobuf::Duration, ::Hash] - # When compare_duration is set, the GroupResult's "state_change" property is - # updated to indicate whether the asset was added, removed, or remained - # present during the compare_duration period of time that precedes the - # read_time. This is the time between (read_time - compare_duration) and - # read_time. - # - # The state change value is derived based on the presence of the asset at the - # two points in time. Intermediate state changes between the two times don't - # affect the result. For example, the results aren't affected if the asset is - # removed and re-created again. - # - # Possible "state_change" values when compare_duration is specified: - # - # * "ADDED": indicates that the asset was not present at the start of - # compare_duration, but present at reference_time. - # * "REMOVED": indicates that the asset was present at the start of - # compare_duration, but not present at reference_time. - # * "ACTIVE": indicates that the asset was present at both the - # start and the end of the time period defined by - # compare_duration and reference_time. - # - # If compare_duration is not specified, then the only possible state_change - # is "UNUSED", which will be the state_change set for all assets present at - # read_time. - # - # If this field is set then `state_change` must be a specified field in - # `group_by`. - # @param read_time [::Google::Protobuf::Timestamp, ::Hash] - # Time used as a reference point when filtering assets. The filter is limited - # to assets existing at the supplied time and their values are those at that - # specific time. Absence of this field will default to the API's version of - # NOW. - # @param page_token [::String] - # The value returned by the last `GroupAssetsResponse`; indicates - # that this is a continuation of a prior `GroupAssets` call, and that the - # system should return the next page of data. - # @param page_size [::Integer] - # The maximum number of results to return in a single response. Default is - # 10, minimum is 1, maximum is 1000. - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Gapic::Rest::PagedEnumerable<::Google::Cloud::SecurityCenter::V1::GroupResult>] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Gapic::Rest::PagedEnumerable<::Google::Cloud::SecurityCenter::V1::GroupResult>] - # - # @raise [::Google::Cloud::Error] if the REST call is aborted. - # - # @example Basic example - # require "google/cloud/security_center/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::SecurityCenter::V1::SecurityCenter::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::SecurityCenter::V1::GroupAssetsRequest.new - # - # # Call the group_assets method. - # result = client.group_assets request - # - # # The returned object is of type Gapic::PagedEnumerable. You can iterate - # # over elements, and API calls will be issued to fetch pages as needed. - # result.each do |item| - # # Each element is of type ::Google::Cloud::SecurityCenter::V1::GroupResult. - # p item - # end - # - def group_assets request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::SecurityCenter::V1::GroupAssetsRequest - - # Converts hash 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.group_assets.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::SecurityCenter::V1::VERSION, - transports_version_send: [:rest] - - call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - options.apply_defaults timeout: @config.rpcs.group_assets.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.group_assets.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @security_center_stub.group_assets request, options do |result, operation| - result = ::Gapic::Rest::PagedEnumerable.new @security_center_stub, :group_assets, "group_by_results", 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 - - ## - # Filters an organization or source's findings and groups them by their - # specified properties. - # - # To group across all sources provide a `-` as the source id. - # Example: /v1/organizations/\\{organization_id}/sources/-/findings, - # /v1/folders/\\{folder_id}/sources/-/findings, - # /v1/projects/\\{project_id}/sources/-/findings - # - # @overload group_findings(request, options = nil) - # Pass arguments to `group_findings` via a request object, either of type - # {::Google::Cloud::SecurityCenter::V1::GroupFindingsRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::SecurityCenter::V1::GroupFindingsRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @overload group_findings(parent: nil, filter: nil, group_by: nil, read_time: nil, compare_duration: nil, page_token: nil, page_size: nil) - # Pass arguments to `group_findings` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param parent [::String] - # Required. Name of the source to groupBy. Its format is - # `organizations/[organization_id]/sources/[source_id]`, - # `folders/[folder_id]/sources/[source_id]`, or - # `projects/[project_id]/sources/[source_id]`. To groupBy across all sources - # provide a source_id of `-`. For example: - # `organizations/{organization_id}/sources/-, folders/{folder_id}/sources/-`, - # or `projects/{project_id}/sources/-` - # @param filter [::String] - # Expression that defines the filter to apply across findings. - # The expression is a list of one or more restrictions combined via logical - # operators `AND` and `OR`. - # Parentheses are supported, and `OR` has higher precedence than `AND`. - # - # Restrictions have the form ` ` and may have a `-` - # character in front of them to indicate negation. Examples include: - # - # * name - # * source_properties.a_property - # * security_marks.marks.marka - # - # The supported operators are: - # - # * `=` for all value types. - # * `>`, `<`, `>=`, `<=` for integer values. - # * `:`, meaning substring matching, for strings. - # - # The supported value types are: - # - # * string literals in quotes. - # * integer literals without quotes. - # * boolean literals `true` and `false` without quotes. - # - # The following field and operator combinations are supported: - # - # * name: `=` - # * parent: `=`, `:` - # * resource_name: `=`, `:` - # * state: `=`, `:` - # * category: `=`, `:` - # * external_uri: `=`, `:` - # * event_time: `=`, `>`, `<`, `>=`, `<=` - # - # Usage: This should be milliseconds since epoch or an RFC3339 string. - # Examples: - # `event_time = "2019-06-10T16:07:18-07:00"` - # `event_time = 1560208038000` - # - # * severity: `=`, `:` - # * workflow_state: `=`, `:` - # * security_marks.marks: `=`, `:` - # * source_properties: `=`, `:`, `>`, `<`, `>=`, `<=` - # - # For example, `source_properties.size = 100` is a valid filter string. - # - # Use a partial match on the empty string to filter based on a property - # existing: `source_properties.my_property : ""` - # - # Use a negated partial match on the empty string to filter based on a - # property not existing: `-source_properties.my_property : ""` - # - # * resource: - # * resource.name: `=`, `:` - # * resource.parent_name: `=`, `:` - # * resource.parent_display_name: `=`, `:` - # * resource.project_name: `=`, `:` - # * resource.project_display_name: `=`, `:` - # * resource.type: `=`, `:` - # @param group_by [::String] - # Required. Expression that defines what assets fields to use for grouping - # (including `state_change`). The string value should follow SQL syntax: - # comma separated list of fields. For example: "parent,resource_name". - # - # The following fields are supported when compare_duration is set: - # - # * state_change - # @param read_time [::Google::Protobuf::Timestamp, ::Hash] - # Time used as a reference point when filtering findings. The filter is - # limited to findings existing at the supplied time and their values are - # those at that specific time. Absence of this field will default to the - # API's version of NOW. - # @param compare_duration [::Google::Protobuf::Duration, ::Hash] - # When compare_duration is set, the GroupResult's "state_change" attribute is - # updated to indicate whether the finding had its state changed, the - # finding's state remained unchanged, or if the finding was added during the - # compare_duration period of time that precedes the read_time. This is the - # time between (read_time - compare_duration) and read_time. - # - # The state_change value is derived based on the presence and state of the - # finding at the two points in time. Intermediate state changes between the - # two times don't affect the result. For example, the results aren't affected - # if the finding is made inactive and then active again. - # - # Possible "state_change" values when compare_duration is specified: - # - # * "CHANGED": indicates that the finding was present and matched the given - # filter at the start of compare_duration, but changed its - # state at read_time. - # * "UNCHANGED": indicates that the finding was present and matched the given - # filter at the start of compare_duration and did not change - # state at read_time. - # * "ADDED": indicates that the finding did not match the given filter or - # was not present at the start of compare_duration, but was - # present at read_time. - # * "REMOVED": indicates that the finding was present and matched the - # filter at the start of compare_duration, but did not match - # the filter at read_time. - # - # If compare_duration is not specified, then the only possible state_change - # is "UNUSED", which will be the state_change set for all findings present - # at read_time. - # - # If this field is set then `state_change` must be a specified field in - # `group_by`. - # @param page_token [::String] - # The value returned by the last `GroupFindingsResponse`; indicates - # that this is a continuation of a prior `GroupFindings` call, and - # that the system should return the next page of data. - # @param page_size [::Integer] - # The maximum number of results to return in a single response. Default is - # 10, minimum is 1, maximum is 1000. - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Gapic::Rest::PagedEnumerable<::Google::Cloud::SecurityCenter::V1::GroupResult>] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Gapic::Rest::PagedEnumerable<::Google::Cloud::SecurityCenter::V1::GroupResult>] - # - # @raise [::Google::Cloud::Error] if the REST call is aborted. - # - # @example Basic example - # require "google/cloud/security_center/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::SecurityCenter::V1::SecurityCenter::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::SecurityCenter::V1::GroupFindingsRequest.new - # - # # Call the group_findings method. - # result = client.group_findings request - # - # # The returned object is of type Gapic::PagedEnumerable. You can iterate - # # over elements, and API calls will be issued to fetch pages as needed. - # result.each do |item| - # # Each element is of type ::Google::Cloud::SecurityCenter::V1::GroupResult. - # p item - # end - # - def group_findings request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::SecurityCenter::V1::GroupFindingsRequest - - # Converts hash 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.group_findings.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::SecurityCenter::V1::VERSION, - transports_version_send: [:rest] - - call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - options.apply_defaults timeout: @config.rpcs.group_findings.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.group_findings.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @security_center_stub.group_findings request, options do |result, operation| - result = ::Gapic::Rest::PagedEnumerable.new @security_center_stub, :group_findings, "group_by_results", 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 - - ## - # Lists an organization's assets. - # - # @overload list_assets(request, options = nil) - # Pass arguments to `list_assets` via a request object, either of type - # {::Google::Cloud::SecurityCenter::V1::ListAssetsRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::SecurityCenter::V1::ListAssetsRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_assets(parent: nil, filter: nil, order_by: nil, read_time: nil, compare_duration: nil, field_mask: nil, page_token: nil, page_size: nil) - # Pass arguments to `list_assets` via keyword arguments. Note that at - # least one keyword argument is 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 name of the parent resource that contains the assets. The - # value that you can specify on parent depends on the method in which you - # specify parent. You can specify one of the following values: - # `organizations/[organization_id]`, `folders/[folder_id]`, or - # `projects/[project_id]`. - # @param filter [::String] - # Expression that defines the filter to apply across assets. - # The expression is a list of zero or more restrictions combined via logical - # operators `AND` and `OR`. - # Parentheses are supported, and `OR` has higher precedence than `AND`. - # - # Restrictions have the form ` ` and may have a `-` - # character in front of them to indicate negation. The fields map to those - # defined in the Asset resource. Examples include: - # - # * name - # * security_center_properties.resource_name - # * resource_properties.a_property - # * security_marks.marks.marka - # - # The supported operators are: - # - # * `=` for all value types. - # * `>`, `<`, `>=`, `<=` for integer values. - # * `:`, meaning substring matching, for strings. - # - # The supported value types are: - # - # * string literals in quotes. - # * integer literals without quotes. - # * boolean literals `true` and `false` without quotes. - # - # The following are the allowed field and operator combinations: - # - # * name: `=` - # * update_time: `=`, `>`, `<`, `>=`, `<=` - # - # Usage: This should be milliseconds since epoch or an RFC3339 string. - # Examples: - # `update_time = "2019-06-10T16:07:18-07:00"` - # `update_time = 1560208038000` - # - # * create_time: `=`, `>`, `<`, `>=`, `<=` - # - # Usage: This should be milliseconds since epoch or an RFC3339 string. - # Examples: - # `create_time = "2019-06-10T16:07:18-07:00"` - # `create_time = 1560208038000` - # - # * iam_policy.policy_blob: `=`, `:` - # * resource_properties: `=`, `:`, `>`, `<`, `>=`, `<=` - # * security_marks.marks: `=`, `:` - # * security_center_properties.resource_name: `=`, `:` - # * security_center_properties.resource_display_name: `=`, `:` - # * security_center_properties.resource_type: `=`, `:` - # * security_center_properties.resource_parent: `=`, `:` - # * security_center_properties.resource_parent_display_name: `=`, `:` - # * security_center_properties.resource_project: `=`, `:` - # * security_center_properties.resource_project_display_name: `=`, `:` - # * security_center_properties.resource_owners: `=`, `:` - # - # For example, `resource_properties.size = 100` is a valid filter string. - # - # Use a partial match on the empty string to filter based on a property - # existing: `resource_properties.my_property : ""` - # - # Use a negated partial match on the empty string to filter based on a - # property not existing: `-resource_properties.my_property : ""` - # @param order_by [::String] - # Expression that defines what fields and order to use for sorting. The - # string value should follow SQL syntax: comma separated list of fields. For - # example: "name,resource_properties.a_property". The default sorting order - # is ascending. To specify descending order for a field, a suffix " desc" - # should be appended to the field name. For example: "name - # desc,resource_properties.a_property". Redundant space characters in the - # syntax are insignificant. "name desc,resource_properties.a_property" and " - # name desc , resource_properties.a_property " are equivalent. - # - # The following fields are supported: - # name - # update_time - # resource_properties - # security_marks.marks - # security_center_properties.resource_name - # security_center_properties.resource_display_name - # security_center_properties.resource_parent - # security_center_properties.resource_parent_display_name - # security_center_properties.resource_project - # security_center_properties.resource_project_display_name - # security_center_properties.resource_type - # @param read_time [::Google::Protobuf::Timestamp, ::Hash] - # Time used as a reference point when filtering assets. The filter is limited - # to assets existing at the supplied time and their values are those at that - # specific time. Absence of this field will default to the API's version of - # NOW. - # @param compare_duration [::Google::Protobuf::Duration, ::Hash] - # When compare_duration is set, the ListAssetsResult's "state_change" - # attribute is updated to indicate whether the asset was added, removed, or - # remained present during the compare_duration period of time that precedes - # the read_time. This is the time between (read_time - compare_duration) and - # read_time. - # - # The state_change value is derived based on the presence of the asset at the - # two points in time. Intermediate state changes between the two times don't - # affect the result. For example, the results aren't affected if the asset is - # removed and re-created again. - # - # Possible "state_change" values when compare_duration is specified: - # - # * "ADDED": indicates that the asset was not present at the start of - # compare_duration, but present at read_time. - # * "REMOVED": indicates that the asset was present at the start of - # compare_duration, but not present at read_time. - # * "ACTIVE": indicates that the asset was present at both the - # start and the end of the time period defined by - # compare_duration and read_time. - # - # If compare_duration is not specified, then the only possible state_change - # is "UNUSED", which will be the state_change set for all assets present at - # read_time. - # @param field_mask [::Google::Protobuf::FieldMask, ::Hash] - # A field mask to specify the ListAssetsResult fields to be listed in the - # response. - # An empty field mask will list all fields. - # @param page_token [::String] - # The value returned by the last `ListAssetsResponse`; indicates - # that this is a continuation of a prior `ListAssets` call, and - # that the system should return the next page of data. - # @param page_size [::Integer] - # The maximum number of results to return in a single response. Default is - # 10, minimum is 1, maximum is 1000. - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Gapic::Rest::PagedEnumerable<::Google::Cloud::SecurityCenter::V1::ListAssetsResponse::ListAssetsResult>] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Gapic::Rest::PagedEnumerable<::Google::Cloud::SecurityCenter::V1::ListAssetsResponse::ListAssetsResult>] - # - # @raise [::Google::Cloud::Error] if the REST call is aborted. - # - # @example Basic example - # require "google/cloud/security_center/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::SecurityCenter::V1::SecurityCenter::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::SecurityCenter::V1::ListAssetsRequest.new - # - # # Call the list_assets method. - # result = client.list_assets request - # - # # The returned object is of type Gapic::PagedEnumerable. You can iterate - # # over elements, and API calls will be issued to fetch pages as needed. - # result.each do |item| - # # Each element is of type ::Google::Cloud::SecurityCenter::V1::ListAssetsResponse::ListAssetsResult. - # p item - # end - # - def list_assets request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::SecurityCenter::V1::ListAssetsRequest - - # Converts hash 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_assets.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::SecurityCenter::V1::VERSION, - transports_version_send: [:rest] - - call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - options.apply_defaults timeout: @config.rpcs.list_assets.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.list_assets.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @security_center_stub.list_assets request, options do |result, operation| - result = ::Gapic::Rest::PagedEnumerable.new @security_center_stub, :list_assets, "list_assets_results", 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 a list of all resident SecurityHealthAnalyticsCustomModules under - # the given CRM parent and all of the parent’s CRM descendants. - # - # @overload list_descendant_security_health_analytics_custom_modules(request, options = nil) - # Pass arguments to `list_descendant_security_health_analytics_custom_modules` via a request object, either of type - # {::Google::Cloud::SecurityCenter::V1::ListDescendantSecurityHealthAnalyticsCustomModulesRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::SecurityCenter::V1::ListDescendantSecurityHealthAnalyticsCustomModulesRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_descendant_security_health_analytics_custom_modules(parent: nil, page_size: nil, page_token: nil) - # Pass arguments to `list_descendant_security_health_analytics_custom_modules` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param parent [::String] - # Required. Name of parent to list descendant custom modules. Its format is - # `organizations/{organization}/securityHealthAnalyticsSettings`, - # `folders/{folder}/securityHealthAnalyticsSettings`, or - # `projects/{project}/securityHealthAnalyticsSettings` - # @param page_size [::Integer] - # The maximum number of results to return in a single response. Default is - # 10, minimum is 1, maximum is 1000. - # @param page_token [::String] - # The value returned by the last call indicating a continuation - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Gapic::Rest::PagedEnumerable<::Google::Cloud::SecurityCenter::V1::SecurityHealthAnalyticsCustomModule>] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Gapic::Rest::PagedEnumerable<::Google::Cloud::SecurityCenter::V1::SecurityHealthAnalyticsCustomModule>] - # - # @raise [::Google::Cloud::Error] if the REST call is aborted. - # - # @example Basic example - # require "google/cloud/security_center/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::SecurityCenter::V1::SecurityCenter::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::SecurityCenter::V1::ListDescendantSecurityHealthAnalyticsCustomModulesRequest.new - # - # # Call the list_descendant_security_health_analytics_custom_modules method. - # result = client.list_descendant_security_health_analytics_custom_modules request - # - # # The returned object is of type Gapic::PagedEnumerable. You can iterate - # # over elements, and API calls will be issued to fetch pages as needed. - # result.each do |item| - # # Each element is of type ::Google::Cloud::SecurityCenter::V1::SecurityHealthAnalyticsCustomModule. - # p item - # end - # - def list_descendant_security_health_analytics_custom_modules request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::SecurityCenter::V1::ListDescendantSecurityHealthAnalyticsCustomModulesRequest - - # Converts hash 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_descendant_security_health_analytics_custom_modules.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::SecurityCenter::V1::VERSION, - transports_version_send: [:rest] - - call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - options.apply_defaults timeout: @config.rpcs.list_descendant_security_health_analytics_custom_modules.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.list_descendant_security_health_analytics_custom_modules.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @security_center_stub.list_descendant_security_health_analytics_custom_modules request, options do |result, operation| - result = ::Gapic::Rest::PagedEnumerable.new @security_center_stub, :list_descendant_security_health_analytics_custom_modules, "security_health_analytics_custom_modules", 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 - - ## - # Lists an organization or source's findings. - # - # To list across all sources provide a `-` as the source id. - # Example: /v1/organizations/\\{organization_id}/sources/-/findings - # - # @overload list_findings(request, options = nil) - # Pass arguments to `list_findings` via a request object, either of type - # {::Google::Cloud::SecurityCenter::V1::ListFindingsRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::SecurityCenter::V1::ListFindingsRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_findings(parent: nil, filter: nil, order_by: nil, read_time: nil, compare_duration: nil, field_mask: nil, page_token: nil, page_size: nil) - # Pass arguments to `list_findings` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param parent [::String] - # Required. Name of the source the findings belong to. Its format is - # `organizations/[organization_id]/sources/[source_id]`, - # `folders/[folder_id]/sources/[source_id]`, or - # `projects/[project_id]/sources/[source_id]`. To list across all sources - # provide a source_id of `-`. For example: - # `organizations/{organization_id}/sources/-`, - # `folders/{folder_id}/sources/-` or `projects/{projects_id}/sources/-` - # @param filter [::String] - # Expression that defines the filter to apply across findings. - # The expression is a list of one or more restrictions combined via logical - # operators `AND` and `OR`. - # Parentheses are supported, and `OR` has higher precedence than `AND`. - # - # Restrictions have the form ` ` and may have a `-` - # character in front of them to indicate negation. Examples include: - # - # * name - # * source_properties.a_property - # * security_marks.marks.marka - # - # The supported operators are: - # - # * `=` for all value types. - # * `>`, `<`, `>=`, `<=` for integer values. - # * `:`, meaning substring matching, for strings. - # - # The supported value types are: - # - # * string literals in quotes. - # * integer literals without quotes. - # * boolean literals `true` and `false` without quotes. - # - # The following field and operator combinations are supported: - # - # * name: `=` - # * parent: `=`, `:` - # * resource_name: `=`, `:` - # * state: `=`, `:` - # * category: `=`, `:` - # * external_uri: `=`, `:` - # * event_time: `=`, `>`, `<`, `>=`, `<=` - # - # Usage: This should be milliseconds since epoch or an RFC3339 string. - # Examples: - # `event_time = "2019-06-10T16:07:18-07:00"` - # `event_time = 1560208038000` - # - # * severity: `=`, `:` - # * workflow_state: `=`, `:` - # * security_marks.marks: `=`, `:` - # * source_properties: `=`, `:`, `>`, `<`, `>=`, `<=` - # - # For example, `source_properties.size = 100` is a valid filter string. - # - # Use a partial match on the empty string to filter based on a property - # existing: `source_properties.my_property : ""` - # - # Use a negated partial match on the empty string to filter based on a - # property not existing: `-source_properties.my_property : ""` - # - # * resource: - # * resource.name: `=`, `:` - # * resource.parent_name: `=`, `:` - # * resource.parent_display_name: `=`, `:` - # * resource.project_name: `=`, `:` - # * resource.project_display_name: `=`, `:` - # * resource.type: `=`, `:` - # * resource.folders.resource_folder: `=`, `:` - # * resource.display_name: `=`, `:` - # @param order_by [::String] - # Expression that defines what fields and order to use for sorting. The - # string value should follow SQL syntax: comma separated list of fields. For - # example: "name,resource_properties.a_property". The default sorting order - # is ascending. To specify descending order for a field, a suffix " desc" - # should be appended to the field name. For example: "name - # desc,source_properties.a_property". Redundant space characters in the - # syntax are insignificant. "name desc,source_properties.a_property" and " - # name desc , source_properties.a_property " are equivalent. - # - # The following fields are supported: - # name - # parent - # state - # category - # resource_name - # event_time - # source_properties - # security_marks.marks - # @param read_time [::Google::Protobuf::Timestamp, ::Hash] - # Time used as a reference point when filtering findings. The filter is - # limited to findings existing at the supplied time and their values are - # those at that specific time. Absence of this field will default to the - # API's version of NOW. - # @param compare_duration [::Google::Protobuf::Duration, ::Hash] - # When compare_duration is set, the ListFindingsResult's "state_change" - # attribute is updated to indicate whether the finding had its state changed, - # the finding's state remained unchanged, or if the finding was added in any - # state during the compare_duration period of time that precedes the - # read_time. This is the time between (read_time - compare_duration) and - # read_time. - # - # The state_change value is derived based on the presence and state of the - # finding at the two points in time. Intermediate state changes between the - # two times don't affect the result. For example, the results aren't affected - # if the finding is made inactive and then active again. - # - # Possible "state_change" values when compare_duration is specified: - # - # * "CHANGED": indicates that the finding was present and matched the given - # filter at the start of compare_duration, but changed its - # state at read_time. - # * "UNCHANGED": indicates that the finding was present and matched the given - # filter at the start of compare_duration and did not change - # state at read_time. - # * "ADDED": indicates that the finding did not match the given filter or - # was not present at the start of compare_duration, but was - # present at read_time. - # * "REMOVED": indicates that the finding was present and matched the - # filter at the start of compare_duration, but did not match - # the filter at read_time. - # - # If compare_duration is not specified, then the only possible state_change - # is "UNUSED", which will be the state_change set for all findings present at - # read_time. - # @param field_mask [::Google::Protobuf::FieldMask, ::Hash] - # A field mask to specify the Finding fields to be listed in the response. - # An empty field mask will list all fields. - # @param page_token [::String] - # The value returned by the last `ListFindingsResponse`; indicates - # that this is a continuation of a prior `ListFindings` call, and - # that the system should return the next page of data. - # @param page_size [::Integer] - # The maximum number of results to return in a single response. Default is - # 10, minimum is 1, maximum is 1000. - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Gapic::Rest::PagedEnumerable<::Google::Cloud::SecurityCenter::V1::ListFindingsResponse::ListFindingsResult>] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Gapic::Rest::PagedEnumerable<::Google::Cloud::SecurityCenter::V1::ListFindingsResponse::ListFindingsResult>] - # - # @raise [::Google::Cloud::Error] if the REST call is aborted. - # - # @example Basic example - # require "google/cloud/security_center/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::SecurityCenter::V1::SecurityCenter::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::SecurityCenter::V1::ListFindingsRequest.new - # - # # Call the list_findings method. - # result = client.list_findings request - # - # # The returned object is of type Gapic::PagedEnumerable. You can iterate - # # over elements, and API calls will be issued to fetch pages as needed. - # result.each do |item| - # # Each element is of type ::Google::Cloud::SecurityCenter::V1::ListFindingsResponse::ListFindingsResult. - # p item - # end - # - def list_findings request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::SecurityCenter::V1::ListFindingsRequest - - # Converts hash 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_findings.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::SecurityCenter::V1::VERSION, - transports_version_send: [:rest] - - call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - options.apply_defaults timeout: @config.rpcs.list_findings.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.list_findings.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @security_center_stub.list_findings request, options do |result, operation| - result = ::Gapic::Rest::PagedEnumerable.new @security_center_stub, :list_findings, "list_findings_results", 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 - - ## - # Lists mute configs. - # - # @overload list_mute_configs(request, options = nil) - # Pass arguments to `list_mute_configs` via a request object, either of type - # {::Google::Cloud::SecurityCenter::V1::ListMuteConfigsRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::SecurityCenter::V1::ListMuteConfigsRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_mute_configs(parent: nil, page_size: nil, page_token: nil) - # Pass arguments to `list_mute_configs` via keyword arguments. Note that at - # least one keyword argument is 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, which owns the collection of mute configs. Its format - # is `organizations/[organization_id]`, `folders/[folder_id]`, - # `projects/[project_id]`. - # @param page_size [::Integer] - # The maximum number of configs to return. The service may return fewer than - # this value. - # If unspecified, at most 10 configs will be returned. - # The maximum value is 1000; values above 1000 will be coerced to 1000. - # @param page_token [::String] - # A page token, received from a previous `ListMuteConfigs` call. - # Provide this to retrieve the subsequent page. - # - # When paginating, all other parameters provided to `ListMuteConfigs` 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::Cloud::SecurityCenter::V1::MuteConfig>] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Gapic::Rest::PagedEnumerable<::Google::Cloud::SecurityCenter::V1::MuteConfig>] - # - # @raise [::Google::Cloud::Error] if the REST call is aborted. - # - # @example Basic example - # require "google/cloud/security_center/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::SecurityCenter::V1::SecurityCenter::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::SecurityCenter::V1::ListMuteConfigsRequest.new - # - # # Call the list_mute_configs method. - # result = client.list_mute_configs request - # - # # The returned object is of type Gapic::PagedEnumerable. You can iterate - # # over elements, and API calls will be issued to fetch pages as needed. - # result.each do |item| - # # Each element is of type ::Google::Cloud::SecurityCenter::V1::MuteConfig. - # p item - # end - # - def list_mute_configs request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::SecurityCenter::V1::ListMuteConfigsRequest - - # Converts hash 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_mute_configs.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::SecurityCenter::V1::VERSION, - transports_version_send: [:rest] - - call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - options.apply_defaults timeout: @config.rpcs.list_mute_configs.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.list_mute_configs.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @security_center_stub.list_mute_configs request, options do |result, operation| - result = ::Gapic::Rest::PagedEnumerable.new @security_center_stub, :list_mute_configs, "mute_configs", 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 - - ## - # Lists notification configs. - # - # @overload list_notification_configs(request, options = nil) - # Pass arguments to `list_notification_configs` via a request object, either of type - # {::Google::Cloud::SecurityCenter::V1::ListNotificationConfigsRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::SecurityCenter::V1::ListNotificationConfigsRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_notification_configs(parent: nil, page_token: nil, page_size: nil) - # Pass arguments to `list_notification_configs` via keyword arguments. Note that at - # least one keyword argument is 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 name of the parent in which to list the notification - # configurations. Its format is "organizations/[organization_id]", - # "folders/[folder_id]", or "projects/[project_id]". - # @param page_token [::String] - # The value returned by the last `ListNotificationConfigsResponse`; indicates - # that this is a continuation of a prior `ListNotificationConfigs` call, and - # that the system should return the next page of data. - # @param page_size [::Integer] - # The maximum number of results to return in a single response. Default is - # 10, minimum is 1, maximum is 1000. - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Gapic::Rest::PagedEnumerable<::Google::Cloud::SecurityCenter::V1::NotificationConfig>] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Gapic::Rest::PagedEnumerable<::Google::Cloud::SecurityCenter::V1::NotificationConfig>] - # - # @raise [::Google::Cloud::Error] if the REST call is aborted. - # - # @example Basic example - # require "google/cloud/security_center/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::SecurityCenter::V1::SecurityCenter::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::SecurityCenter::V1::ListNotificationConfigsRequest.new - # - # # Call the list_notification_configs method. - # result = client.list_notification_configs request - # - # # The returned object is of type Gapic::PagedEnumerable. You can iterate - # # over elements, and API calls will be issued to fetch pages as needed. - # result.each do |item| - # # Each element is of type ::Google::Cloud::SecurityCenter::V1::NotificationConfig. - # p item - # end - # - def list_notification_configs request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::SecurityCenter::V1::ListNotificationConfigsRequest - - # Converts hash 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_notification_configs.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::SecurityCenter::V1::VERSION, - transports_version_send: [:rest] - - call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - options.apply_defaults timeout: @config.rpcs.list_notification_configs.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.list_notification_configs.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @security_center_stub.list_notification_configs request, options do |result, operation| - result = ::Gapic::Rest::PagedEnumerable.new @security_center_stub, :list_notification_configs, "notification_configs", 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 a list of all EffectiveSecurityHealthAnalyticsCustomModules for the - # given parent. This includes resident modules defined at the scope of the - # parent, and inherited modules, inherited from CRM ancestors. - # - # @overload list_effective_security_health_analytics_custom_modules(request, options = nil) - # Pass arguments to `list_effective_security_health_analytics_custom_modules` via a request object, either of type - # {::Google::Cloud::SecurityCenter::V1::ListEffectiveSecurityHealthAnalyticsCustomModulesRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::SecurityCenter::V1::ListEffectiveSecurityHealthAnalyticsCustomModulesRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_effective_security_health_analytics_custom_modules(parent: nil, page_size: nil, page_token: nil) - # Pass arguments to `list_effective_security_health_analytics_custom_modules` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param parent [::String] - # Required. Name of parent to list effective custom modules. Its format is - # `organizations/{organization}/securityHealthAnalyticsSettings`, - # `folders/{folder}/securityHealthAnalyticsSettings`, or - # `projects/{project}/securityHealthAnalyticsSettings` - # @param page_size [::Integer] - # The maximum number of results to return in a single response. Default is - # 10, minimum is 1, maximum is 1000. - # @param page_token [::String] - # The value returned by the last call indicating a continuation - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Gapic::Rest::PagedEnumerable<::Google::Cloud::SecurityCenter::V1::EffectiveSecurityHealthAnalyticsCustomModule>] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Gapic::Rest::PagedEnumerable<::Google::Cloud::SecurityCenter::V1::EffectiveSecurityHealthAnalyticsCustomModule>] - # - # @raise [::Google::Cloud::Error] if the REST call is aborted. - # - # @example Basic example - # require "google/cloud/security_center/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::SecurityCenter::V1::SecurityCenter::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::SecurityCenter::V1::ListEffectiveSecurityHealthAnalyticsCustomModulesRequest.new - # - # # Call the list_effective_security_health_analytics_custom_modules method. - # result = client.list_effective_security_health_analytics_custom_modules request - # - # # The returned object is of type Gapic::PagedEnumerable. You can iterate - # # over elements, and API calls will be issued to fetch pages as needed. - # result.each do |item| - # # Each element is of type ::Google::Cloud::SecurityCenter::V1::EffectiveSecurityHealthAnalyticsCustomModule. - # p item - # end - # - def list_effective_security_health_analytics_custom_modules request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::SecurityCenter::V1::ListEffectiveSecurityHealthAnalyticsCustomModulesRequest - - # Converts hash 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_effective_security_health_analytics_custom_modules.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::SecurityCenter::V1::VERSION, - transports_version_send: [:rest] - - call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - options.apply_defaults timeout: @config.rpcs.list_effective_security_health_analytics_custom_modules.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.list_effective_security_health_analytics_custom_modules.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @security_center_stub.list_effective_security_health_analytics_custom_modules request, options do |result, operation| - result = ::Gapic::Rest::PagedEnumerable.new @security_center_stub, :list_effective_security_health_analytics_custom_modules, "effective_security_health_analytics_custom_modules", 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 a list of all SecurityHealthAnalyticsCustomModules for the given - # parent. This includes resident modules defined at the scope of the parent, - # and inherited modules, inherited from CRM ancestors. - # - # @overload list_security_health_analytics_custom_modules(request, options = nil) - # Pass arguments to `list_security_health_analytics_custom_modules` via a request object, either of type - # {::Google::Cloud::SecurityCenter::V1::ListSecurityHealthAnalyticsCustomModulesRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::SecurityCenter::V1::ListSecurityHealthAnalyticsCustomModulesRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_security_health_analytics_custom_modules(parent: nil, page_size: nil, page_token: nil) - # Pass arguments to `list_security_health_analytics_custom_modules` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param parent [::String] - # Required. Name of parent to list custom modules. Its format is - # `organizations/{organization}/securityHealthAnalyticsSettings`, - # `folders/{folder}/securityHealthAnalyticsSettings`, or - # `projects/{project}/securityHealthAnalyticsSettings` - # @param page_size [::Integer] - # The maximum number of results to return in a single response. Default is - # 10, minimum is 1, maximum is 1000. - # @param page_token [::String] - # The value returned by the last call indicating a continuation - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Gapic::Rest::PagedEnumerable<::Google::Cloud::SecurityCenter::V1::SecurityHealthAnalyticsCustomModule>] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Gapic::Rest::PagedEnumerable<::Google::Cloud::SecurityCenter::V1::SecurityHealthAnalyticsCustomModule>] - # - # @raise [::Google::Cloud::Error] if the REST call is aborted. - # - # @example Basic example - # require "google/cloud/security_center/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::SecurityCenter::V1::SecurityCenter::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::SecurityCenter::V1::ListSecurityHealthAnalyticsCustomModulesRequest.new - # - # # Call the list_security_health_analytics_custom_modules method. - # result = client.list_security_health_analytics_custom_modules request - # - # # The returned object is of type Gapic::PagedEnumerable. You can iterate - # # over elements, and API calls will be issued to fetch pages as needed. - # result.each do |item| - # # Each element is of type ::Google::Cloud::SecurityCenter::V1::SecurityHealthAnalyticsCustomModule. - # p item - # end - # - def list_security_health_analytics_custom_modules request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::SecurityCenter::V1::ListSecurityHealthAnalyticsCustomModulesRequest - - # Converts hash 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_security_health_analytics_custom_modules.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::SecurityCenter::V1::VERSION, - transports_version_send: [:rest] - - call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - options.apply_defaults timeout: @config.rpcs.list_security_health_analytics_custom_modules.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.list_security_health_analytics_custom_modules.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @security_center_stub.list_security_health_analytics_custom_modules request, options do |result, operation| - result = ::Gapic::Rest::PagedEnumerable.new @security_center_stub, :list_security_health_analytics_custom_modules, "security_health_analytics_custom_modules", 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 - - ## - # Lists all sources belonging to an organization. - # - # @overload list_sources(request, options = nil) - # Pass arguments to `list_sources` via a request object, either of type - # {::Google::Cloud::SecurityCenter::V1::ListSourcesRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::SecurityCenter::V1::ListSourcesRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_sources(parent: nil, page_token: nil, page_size: nil) - # Pass arguments to `list_sources` via keyword arguments. Note that at - # least one keyword argument is 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. Resource name of the parent of sources to list. Its format should - # be `organizations/[organization_id]`, `folders/[folder_id]`, or - # `projects/[project_id]`. - # @param page_token [::String] - # The value returned by the last `ListSourcesResponse`; indicates - # that this is a continuation of a prior `ListSources` call, and - # that the system should return the next page of data. - # @param page_size [::Integer] - # The maximum number of results to return in a single response. Default is - # 10, minimum is 1, maximum is 1000. - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Gapic::Rest::PagedEnumerable<::Google::Cloud::SecurityCenter::V1::Source>] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Gapic::Rest::PagedEnumerable<::Google::Cloud::SecurityCenter::V1::Source>] - # - # @raise [::Google::Cloud::Error] if the REST call is aborted. - # - # @example Basic example - # require "google/cloud/security_center/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::SecurityCenter::V1::SecurityCenter::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::SecurityCenter::V1::ListSourcesRequest.new - # - # # Call the list_sources method. - # result = client.list_sources request - # - # # The returned object is of type Gapic::PagedEnumerable. You can iterate - # # over elements, and API calls will be issued to fetch pages as needed. - # result.each do |item| - # # Each element is of type ::Google::Cloud::SecurityCenter::V1::Source. - # p item - # end - # - def list_sources request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::SecurityCenter::V1::ListSourcesRequest - - # Converts hash 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_sources.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::SecurityCenter::V1::VERSION, - transports_version_send: [:rest] - - call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - options.apply_defaults timeout: @config.rpcs.list_sources.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.list_sources.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @security_center_stub.list_sources request, options do |result, operation| - result = ::Gapic::Rest::PagedEnumerable.new @security_center_stub, :list_sources, "sources", 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 - - ## - # Runs asset discovery. The discovery is tracked with a long-running - # operation. - # - # This API can only be called with limited frequency for an organization. If - # it is called too frequently the caller will receive a TOO_MANY_REQUESTS - # error. - # - # @overload run_asset_discovery(request, options = nil) - # Pass arguments to `run_asset_discovery` via a request object, either of type - # {::Google::Cloud::SecurityCenter::V1::RunAssetDiscoveryRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::SecurityCenter::V1::RunAssetDiscoveryRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @overload run_asset_discovery(parent: nil) - # Pass arguments to `run_asset_discovery` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param parent [::String] - # Required. Name of the organization to run asset discovery for. Its format - # is `organizations/[organization_id]`. - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Gapic::Operation] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Gapic::Operation] - # - # @raise [::Google::Cloud::Error] if the REST call is aborted. - # - # @example Basic example - # require "google/cloud/security_center/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::SecurityCenter::V1::SecurityCenter::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::SecurityCenter::V1::RunAssetDiscoveryRequest.new - # - # # Call the run_asset_discovery method. - # result = client.run_asset_discovery 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 run_asset_discovery request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::SecurityCenter::V1::RunAssetDiscoveryRequest - - # Converts hash 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.run_asset_discovery.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::SecurityCenter::V1::VERSION, - transports_version_send: [:rest] - - call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - options.apply_defaults timeout: @config.rpcs.run_asset_discovery.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.run_asset_discovery.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @security_center_stub.run_asset_discovery 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 - - ## - # Updates the state of a finding. - # - # @overload set_finding_state(request, options = nil) - # Pass arguments to `set_finding_state` via a request object, either of type - # {::Google::Cloud::SecurityCenter::V1::SetFindingStateRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::SecurityCenter::V1::SetFindingStateRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @overload set_finding_state(name: nil, state: nil, start_time: nil) - # Pass arguments to `set_finding_state` via keyword arguments. Note that at - # least one keyword argument is 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 [relative resource - # name](https://cloud.google.com/apis/design/resource_names#relative_resource_name) - # of the finding. Example: - # `organizations/{organization_id}/sources/{source_id}/findings/{finding_id}`, - # `folders/{folder_id}/sources/{source_id}/findings/{finding_id}`, - # `projects/{project_id}/sources/{source_id}/findings/{finding_id}`. - # @param state [::Google::Cloud::SecurityCenter::V1::Finding::State] - # Required. The desired State of the finding. - # @param start_time [::Google::Protobuf::Timestamp, ::Hash] - # Required. The time at which the updated state takes effect. - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Cloud::SecurityCenter::V1::Finding] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::SecurityCenter::V1::Finding] - # - # @raise [::Google::Cloud::Error] if the REST call is aborted. - # - # @example Basic example - # require "google/cloud/security_center/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::SecurityCenter::V1::SecurityCenter::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::SecurityCenter::V1::SetFindingStateRequest.new - # - # # Call the set_finding_state method. - # result = client.set_finding_state request - # - # # The returned object is of type Google::Cloud::SecurityCenter::V1::Finding. - # p result - # - def set_finding_state request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::SecurityCenter::V1::SetFindingStateRequest - - # Converts hash and nil to an options object - options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h - - # Customize the options with defaults - call_metadata = @config.rpcs.set_finding_state.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::SecurityCenter::V1::VERSION, - transports_version_send: [:rest] - - call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - options.apply_defaults timeout: @config.rpcs.set_finding_state.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.set_finding_state.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @security_center_stub.set_finding_state request, options do |result, operation| - yield result, operation if block_given? - end - rescue ::Gapic::Rest::Error => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Updates the mute state of a finding. - # - # @overload set_mute(request, options = nil) - # Pass arguments to `set_mute` via a request object, either of type - # {::Google::Cloud::SecurityCenter::V1::SetMuteRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::SecurityCenter::V1::SetMuteRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @overload set_mute(name: nil, mute: nil) - # Pass arguments to `set_mute` via keyword arguments. Note that at - # least one keyword argument is 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 [relative resource - # name](https://cloud.google.com/apis/design/resource_names#relative_resource_name) - # of the finding. Example: - # `organizations/{organization_id}/sources/{source_id}/findings/{finding_id}`, - # `folders/{folder_id}/sources/{source_id}/findings/{finding_id}`, - # `projects/{project_id}/sources/{source_id}/findings/{finding_id}`. - # @param mute [::Google::Cloud::SecurityCenter::V1::Finding::Mute] - # Required. The desired state of the Mute. - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Cloud::SecurityCenter::V1::Finding] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::SecurityCenter::V1::Finding] - # - # @raise [::Google::Cloud::Error] if the REST call is aborted. - # - # @example Basic example - # require "google/cloud/security_center/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::SecurityCenter::V1::SecurityCenter::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::SecurityCenter::V1::SetMuteRequest.new - # - # # Call the set_mute method. - # result = client.set_mute request - # - # # The returned object is of type Google::Cloud::SecurityCenter::V1::Finding. - # p result - # - def set_mute request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::SecurityCenter::V1::SetMuteRequest - - # Converts hash and nil to an options object - options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h - - # Customize the options with defaults - call_metadata = @config.rpcs.set_mute.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::SecurityCenter::V1::VERSION, - transports_version_send: [:rest] - - call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - options.apply_defaults timeout: @config.rpcs.set_mute.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.set_mute.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @security_center_stub.set_mute request, options do |result, operation| - yield result, operation if block_given? - end - rescue ::Gapic::Rest::Error => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Sets the access control policy on the specified Source. - # - # @overload set_iam_policy(request, options = nil) - # Pass arguments to `set_iam_policy` via a request object, either of type - # {::Google::Iam::V1::SetIamPolicyRequest} or an equivalent Hash. - # - # @param request [::Google::Iam::V1::SetIamPolicyRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @overload set_iam_policy(resource: nil, policy: nil, update_mask: nil) - # Pass arguments to `set_iam_policy` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param resource [::String] - # REQUIRED: The resource for which the policy is being specified. - # See the operation documentation for the appropriate value for this field. - # @param policy [::Google::Iam::V1::Policy, ::Hash] - # REQUIRED: The complete policy to be applied to the `resource`. The size of - # the policy is limited to a few 10s of KB. An empty policy is a - # valid policy but certain Cloud Platform services (such as Projects) - # might reject them. - # @param update_mask [::Google::Protobuf::FieldMask, ::Hash] - # OPTIONAL: A FieldMask specifying which fields of the policy to modify. Only - # the fields in the mask will be modified. If no mask is provided, the - # following default mask is used: - # - # `paths: "bindings, etag"` - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Iam::V1::Policy] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Iam::V1::Policy] - # - # @raise [::Google::Cloud::Error] if the REST call is aborted. - # - # @example Basic example - # require "google/cloud/security_center/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::SecurityCenter::V1::SecurityCenter::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Iam::V1::SetIamPolicyRequest.new - # - # # Call the set_iam_policy method. - # result = client.set_iam_policy request - # - # # The returned object is of type Google::Iam::V1::Policy. - # p result - # - def set_iam_policy request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Iam::V1::SetIamPolicyRequest - - # Converts hash and nil to an options object - options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h - - # Customize the options with defaults - call_metadata = @config.rpcs.set_iam_policy.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::SecurityCenter::V1::VERSION, - transports_version_send: [:rest] - - call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - options.apply_defaults timeout: @config.rpcs.set_iam_policy.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.set_iam_policy.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @security_center_stub.set_iam_policy request, options do |result, operation| - yield result, operation if block_given? - end - rescue ::Gapic::Rest::Error => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Returns the permissions that a caller has on the specified source. - # - # @overload test_iam_permissions(request, options = nil) - # Pass arguments to `test_iam_permissions` via a request object, either of type - # {::Google::Iam::V1::TestIamPermissionsRequest} or an equivalent Hash. - # - # @param request [::Google::Iam::V1::TestIamPermissionsRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @overload test_iam_permissions(resource: nil, permissions: nil) - # Pass arguments to `test_iam_permissions` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param resource [::String] - # REQUIRED: The resource for which the policy detail is being requested. - # See the operation documentation for the appropriate value for this field. - # @param permissions [::Array<::String>] - # The set of permissions to check for the `resource`. Permissions with - # wildcards (such as '*' or 'storage.*') are not allowed. For more - # information see - # [IAM Overview](https://cloud.google.com/iam/docs/overview#permissions). - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Iam::V1::TestIamPermissionsResponse] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Iam::V1::TestIamPermissionsResponse] - # - # @raise [::Google::Cloud::Error] if the REST call is aborted. - # - # @example Basic example - # require "google/cloud/security_center/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::SecurityCenter::V1::SecurityCenter::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Iam::V1::TestIamPermissionsRequest.new - # - # # Call the test_iam_permissions method. - # result = client.test_iam_permissions request - # - # # The returned object is of type Google::Iam::V1::TestIamPermissionsResponse. - # p result - # - def test_iam_permissions request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Iam::V1::TestIamPermissionsRequest - - # Converts hash and nil to an options object - options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h - - # Customize the options with defaults - call_metadata = @config.rpcs.test_iam_permissions.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::SecurityCenter::V1::VERSION, - transports_version_send: [:rest] - - call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - options.apply_defaults timeout: @config.rpcs.test_iam_permissions.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.test_iam_permissions.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @security_center_stub.test_iam_permissions request, options do |result, operation| - yield result, operation if block_given? - end - rescue ::Gapic::Rest::Error => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Simulates a given SecurityHealthAnalyticsCustomModule and Resource. - # - # @overload simulate_security_health_analytics_custom_module(request, options = nil) - # Pass arguments to `simulate_security_health_analytics_custom_module` via a request object, either of type - # {::Google::Cloud::SecurityCenter::V1::SimulateSecurityHealthAnalyticsCustomModuleRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::SecurityCenter::V1::SimulateSecurityHealthAnalyticsCustomModuleRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @overload simulate_security_health_analytics_custom_module(parent: nil, custom_config: nil, resource: nil) - # Pass arguments to `simulate_security_health_analytics_custom_module` via keyword arguments. Note that at - # least one keyword argument is 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 relative resource name of the organization, project, or - # folder. For more information about relative resource names, see [Relative - # Resource - # Name](https://cloud.google.com/apis/design/resource_names#relative_resource_name) - # Example: `organizations/{organization_id}` - # @param custom_config [::Google::Cloud::SecurityCenter::V1::CustomConfig, ::Hash] - # Required. The custom configuration that you need to test. - # @param resource [::Google::Cloud::SecurityCenter::V1::SimulateSecurityHealthAnalyticsCustomModuleRequest::SimulatedResource, ::Hash] - # Required. Resource data to simulate custom module against. - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Cloud::SecurityCenter::V1::SimulateSecurityHealthAnalyticsCustomModuleResponse] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::SecurityCenter::V1::SimulateSecurityHealthAnalyticsCustomModuleResponse] - # - # @raise [::Google::Cloud::Error] if the REST call is aborted. - # - # @example Basic example - # require "google/cloud/security_center/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::SecurityCenter::V1::SecurityCenter::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::SecurityCenter::V1::SimulateSecurityHealthAnalyticsCustomModuleRequest.new - # - # # Call the simulate_security_health_analytics_custom_module method. - # result = client.simulate_security_health_analytics_custom_module request - # - # # The returned object is of type Google::Cloud::SecurityCenter::V1::SimulateSecurityHealthAnalyticsCustomModuleResponse. - # p result - # - def simulate_security_health_analytics_custom_module request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::SecurityCenter::V1::SimulateSecurityHealthAnalyticsCustomModuleRequest - - # Converts hash 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.simulate_security_health_analytics_custom_module.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::SecurityCenter::V1::VERSION, - transports_version_send: [:rest] - - call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - options.apply_defaults timeout: @config.rpcs.simulate_security_health_analytics_custom_module.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.simulate_security_health_analytics_custom_module.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @security_center_stub.simulate_security_health_analytics_custom_module 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 external system. This is for a given finding. - # - # @overload update_external_system(request, options = nil) - # Pass arguments to `update_external_system` via a request object, either of type - # {::Google::Cloud::SecurityCenter::V1::UpdateExternalSystemRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::SecurityCenter::V1::UpdateExternalSystemRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_external_system(external_system: nil, update_mask: nil) - # Pass arguments to `update_external_system` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param external_system [::Google::Cloud::SecurityCenter::V1::ExternalSystem, ::Hash] - # Required. The external system resource to update. - # @param update_mask [::Google::Protobuf::FieldMask, ::Hash] - # The FieldMask to use when updating the external system resource. - # - # If empty all mutable fields will be updated. - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Cloud::SecurityCenter::V1::ExternalSystem] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::SecurityCenter::V1::ExternalSystem] - # - # @raise [::Google::Cloud::Error] if the REST call is aborted. - # - # @example Basic example - # require "google/cloud/security_center/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::SecurityCenter::V1::SecurityCenter::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::SecurityCenter::V1::UpdateExternalSystemRequest.new - # - # # Call the update_external_system method. - # result = client.update_external_system request - # - # # The returned object is of type Google::Cloud::SecurityCenter::V1::ExternalSystem. - # p result - # - def update_external_system request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::SecurityCenter::V1::UpdateExternalSystemRequest - - # Converts hash 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_external_system.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::SecurityCenter::V1::VERSION, - transports_version_send: [:rest] - - call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - options.apply_defaults timeout: @config.rpcs.update_external_system.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.update_external_system.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @security_center_stub.update_external_system request, options do |result, operation| - yield result, operation if block_given? - end - rescue ::Gapic::Rest::Error => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Creates or updates a finding. The corresponding source must exist for a - # finding creation to succeed. - # - # @overload update_finding(request, options = nil) - # Pass arguments to `update_finding` via a request object, either of type - # {::Google::Cloud::SecurityCenter::V1::UpdateFindingRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::SecurityCenter::V1::UpdateFindingRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_finding(finding: nil, update_mask: nil) - # Pass arguments to `update_finding` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param finding [::Google::Cloud::SecurityCenter::V1::Finding, ::Hash] - # Required. The finding resource to update or create if it does not already - # exist. parent, security_marks, and update_time will be ignored. - # - # In the case of creation, the finding id portion of the name must be - # alphanumeric and less than or equal to 32 characters and greater than 0 - # characters in length. - # @param update_mask [::Google::Protobuf::FieldMask, ::Hash] - # The FieldMask to use when updating the finding resource. This field should - # not be specified when creating a finding. - # - # When updating a finding, an empty mask is treated as updating all mutable - # fields and replacing source_properties. Individual source_properties can - # be added/updated by using "source_properties." in the field - # mask. - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Cloud::SecurityCenter::V1::Finding] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::SecurityCenter::V1::Finding] - # - # @raise [::Google::Cloud::Error] if the REST call is aborted. - # - # @example Basic example - # require "google/cloud/security_center/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::SecurityCenter::V1::SecurityCenter::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::SecurityCenter::V1::UpdateFindingRequest.new - # - # # Call the update_finding method. - # result = client.update_finding request - # - # # The returned object is of type Google::Cloud::SecurityCenter::V1::Finding. - # p result - # - def update_finding request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::SecurityCenter::V1::UpdateFindingRequest - - # Converts hash 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_finding.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::SecurityCenter::V1::VERSION, - transports_version_send: [:rest] - - call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - options.apply_defaults timeout: @config.rpcs.update_finding.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.update_finding.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @security_center_stub.update_finding 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 mute config. - # - # @overload update_mute_config(request, options = nil) - # Pass arguments to `update_mute_config` via a request object, either of type - # {::Google::Cloud::SecurityCenter::V1::UpdateMuteConfigRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::SecurityCenter::V1::UpdateMuteConfigRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_mute_config(mute_config: nil, update_mask: nil) - # Pass arguments to `update_mute_config` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param mute_config [::Google::Cloud::SecurityCenter::V1::MuteConfig, ::Hash] - # Required. The mute config being updated. - # @param update_mask [::Google::Protobuf::FieldMask, ::Hash] - # The list of fields to be updated. - # If empty all mutable fields will be updated. - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Cloud::SecurityCenter::V1::MuteConfig] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::SecurityCenter::V1::MuteConfig] - # - # @raise [::Google::Cloud::Error] if the REST call is aborted. - # - # @example Basic example - # require "google/cloud/security_center/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::SecurityCenter::V1::SecurityCenter::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::SecurityCenter::V1::UpdateMuteConfigRequest.new - # - # # Call the update_mute_config method. - # result = client.update_mute_config request - # - # # The returned object is of type Google::Cloud::SecurityCenter::V1::MuteConfig. - # p result - # - def update_mute_config request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::SecurityCenter::V1::UpdateMuteConfigRequest - - # Converts hash 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_mute_config.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::SecurityCenter::V1::VERSION, - transports_version_send: [:rest] - - call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - options.apply_defaults timeout: @config.rpcs.update_mute_config.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.update_mute_config.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @security_center_stub.update_mute_config request, options do |result, operation| - yield result, operation if block_given? - end - rescue ::Gapic::Rest::Error => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Updates a notification config. The following update - # fields are allowed: description, pubsub_topic, streaming_config.filter - # - # @overload update_notification_config(request, options = nil) - # Pass arguments to `update_notification_config` via a request object, either of type - # {::Google::Cloud::SecurityCenter::V1::UpdateNotificationConfigRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::SecurityCenter::V1::UpdateNotificationConfigRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_notification_config(notification_config: nil, update_mask: nil) - # Pass arguments to `update_notification_config` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param notification_config [::Google::Cloud::SecurityCenter::V1::NotificationConfig, ::Hash] - # Required. The notification config to update. - # @param update_mask [::Google::Protobuf::FieldMask, ::Hash] - # The FieldMask to use when updating the notification config. - # - # If empty all mutable fields will be updated. - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Cloud::SecurityCenter::V1::NotificationConfig] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::SecurityCenter::V1::NotificationConfig] - # - # @raise [::Google::Cloud::Error] if the REST call is aborted. - # - # @example Basic example - # require "google/cloud/security_center/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::SecurityCenter::V1::SecurityCenter::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::SecurityCenter::V1::UpdateNotificationConfigRequest.new - # - # # Call the update_notification_config method. - # result = client.update_notification_config request - # - # # The returned object is of type Google::Cloud::SecurityCenter::V1::NotificationConfig. - # p result - # - def update_notification_config request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::SecurityCenter::V1::UpdateNotificationConfigRequest - - # Converts hash 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_notification_config.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::SecurityCenter::V1::VERSION, - transports_version_send: [:rest] - - call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - options.apply_defaults timeout: @config.rpcs.update_notification_config.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.update_notification_config.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @security_center_stub.update_notification_config request, options do |result, operation| - yield result, operation if block_given? - end - rescue ::Gapic::Rest::Error => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Updates an organization's settings. - # - # @overload update_organization_settings(request, options = nil) - # Pass arguments to `update_organization_settings` via a request object, either of type - # {::Google::Cloud::SecurityCenter::V1::UpdateOrganizationSettingsRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::SecurityCenter::V1::UpdateOrganizationSettingsRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @overload update_organization_settings(organization_settings: nil, update_mask: nil) - # Pass arguments to `update_organization_settings` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param organization_settings [::Google::Cloud::SecurityCenter::V1::OrganizationSettings, ::Hash] - # Required. The organization settings resource to update. - # @param update_mask [::Google::Protobuf::FieldMask, ::Hash] - # The FieldMask to use when updating the settings resource. - # - # If empty all mutable fields will be updated. - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Cloud::SecurityCenter::V1::OrganizationSettings] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::SecurityCenter::V1::OrganizationSettings] - # - # @raise [::Google::Cloud::Error] if the REST call is aborted. - # - # @example Basic example - # require "google/cloud/security_center/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::SecurityCenter::V1::SecurityCenter::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::SecurityCenter::V1::UpdateOrganizationSettingsRequest.new - # - # # Call the update_organization_settings method. - # result = client.update_organization_settings request - # - # # The returned object is of type Google::Cloud::SecurityCenter::V1::OrganizationSettings. - # p result - # - def update_organization_settings request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::SecurityCenter::V1::UpdateOrganizationSettingsRequest - - # Converts hash and nil to an options object - options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h - - # Customize the options with defaults - call_metadata = @config.rpcs.update_organization_settings.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::SecurityCenter::V1::VERSION, - transports_version_send: [:rest] - - call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - options.apply_defaults timeout: @config.rpcs.update_organization_settings.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.update_organization_settings.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @security_center_stub.update_organization_settings request, options do |result, operation| - yield result, operation if block_given? - end - rescue ::Gapic::Rest::Error => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Updates the SecurityHealthAnalyticsCustomModule under the given name based - # on the given update mask. Updating the enablement state is supported on - # both resident and inherited modules (though resident modules cannot have an - # enablement state of "inherited"). Updating the display name and custom - # config of a module is supported on resident modules only. - # - # @overload update_security_health_analytics_custom_module(request, options = nil) - # Pass arguments to `update_security_health_analytics_custom_module` via a request object, either of type - # {::Google::Cloud::SecurityCenter::V1::UpdateSecurityHealthAnalyticsCustomModuleRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::SecurityCenter::V1::UpdateSecurityHealthAnalyticsCustomModuleRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_security_health_analytics_custom_module(security_health_analytics_custom_module: nil, update_mask: nil) - # Pass arguments to `update_security_health_analytics_custom_module` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param security_health_analytics_custom_module [::Google::Cloud::SecurityCenter::V1::SecurityHealthAnalyticsCustomModule, ::Hash] - # Required. The SecurityHealthAnalytics custom module to update. - # @param update_mask [::Google::Protobuf::FieldMask, ::Hash] - # The list of fields to be updated. The only fields that can be updated are - # `enablement_state` and `custom_config`. If empty or set to the wildcard - # value `*`, both `enablement_state` and `custom_config` are updated. - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Cloud::SecurityCenter::V1::SecurityHealthAnalyticsCustomModule] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::SecurityCenter::V1::SecurityHealthAnalyticsCustomModule] - # - # @raise [::Google::Cloud::Error] if the REST call is aborted. - # - # @example Basic example - # require "google/cloud/security_center/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::SecurityCenter::V1::SecurityCenter::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::SecurityCenter::V1::UpdateSecurityHealthAnalyticsCustomModuleRequest.new - # - # # Call the update_security_health_analytics_custom_module method. - # result = client.update_security_health_analytics_custom_module request - # - # # The returned object is of type Google::Cloud::SecurityCenter::V1::SecurityHealthAnalyticsCustomModule. - # p result - # - def update_security_health_analytics_custom_module request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::SecurityCenter::V1::UpdateSecurityHealthAnalyticsCustomModuleRequest - - # Converts hash 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_security_health_analytics_custom_module.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::SecurityCenter::V1::VERSION, - transports_version_send: [:rest] - - call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - options.apply_defaults timeout: @config.rpcs.update_security_health_analytics_custom_module.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.update_security_health_analytics_custom_module.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @security_center_stub.update_security_health_analytics_custom_module 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 source. - # - # @overload update_source(request, options = nil) - # Pass arguments to `update_source` via a request object, either of type - # {::Google::Cloud::SecurityCenter::V1::UpdateSourceRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::SecurityCenter::V1::UpdateSourceRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_source(source: nil, update_mask: nil) - # Pass arguments to `update_source` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param source [::Google::Cloud::SecurityCenter::V1::Source, ::Hash] - # Required. The source resource to update. - # @param update_mask [::Google::Protobuf::FieldMask, ::Hash] - # The FieldMask to use when updating the source resource. - # - # If empty all mutable fields will be updated. - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Cloud::SecurityCenter::V1::Source] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::SecurityCenter::V1::Source] - # - # @raise [::Google::Cloud::Error] if the REST call is aborted. - # - # @example Basic example - # require "google/cloud/security_center/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::SecurityCenter::V1::SecurityCenter::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::SecurityCenter::V1::UpdateSourceRequest.new - # - # # Call the update_source method. - # result = client.update_source request - # - # # The returned object is of type Google::Cloud::SecurityCenter::V1::Source. - # p result - # - def update_source request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::SecurityCenter::V1::UpdateSourceRequest - - # Converts hash 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_source.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::SecurityCenter::V1::VERSION, - transports_version_send: [:rest] - - call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - options.apply_defaults timeout: @config.rpcs.update_source.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.update_source.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @security_center_stub.update_source 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 security marks. - # - # @overload update_security_marks(request, options = nil) - # Pass arguments to `update_security_marks` via a request object, either of type - # {::Google::Cloud::SecurityCenter::V1::UpdateSecurityMarksRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::SecurityCenter::V1::UpdateSecurityMarksRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_security_marks(security_marks: nil, update_mask: nil, start_time: nil) - # Pass arguments to `update_security_marks` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param security_marks [::Google::Cloud::SecurityCenter::V1::SecurityMarks, ::Hash] - # Required. The security marks resource to update. - # @param update_mask [::Google::Protobuf::FieldMask, ::Hash] - # The FieldMask to use when updating the security marks resource. - # - # The field mask must not contain duplicate fields. - # If empty or set to "marks", all marks will be replaced. Individual - # marks can be updated using "marks.". - # @param start_time [::Google::Protobuf::Timestamp, ::Hash] - # The time at which the updated SecurityMarks take effect. - # If not set uses current server time. Updates will be applied to the - # SecurityMarks that are active immediately preceding this time. Must be - # earlier or equal to the server time. - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Cloud::SecurityCenter::V1::SecurityMarks] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::SecurityCenter::V1::SecurityMarks] - # - # @raise [::Google::Cloud::Error] if the REST call is aborted. - # - # @example Basic example - # require "google/cloud/security_center/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::SecurityCenter::V1::SecurityCenter::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::SecurityCenter::V1::UpdateSecurityMarksRequest.new - # - # # Call the update_security_marks method. - # result = client.update_security_marks request - # - # # The returned object is of type Google::Cloud::SecurityCenter::V1::SecurityMarks. - # p result - # - def update_security_marks request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::SecurityCenter::V1::UpdateSecurityMarksRequest - - # Converts hash 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_security_marks.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::SecurityCenter::V1::VERSION, - transports_version_send: [:rest] - - call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - options.apply_defaults timeout: @config.rpcs.update_security_marks.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.update_security_marks.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @security_center_stub.update_security_marks request, options do |result, operation| - yield result, operation if block_given? - end - rescue ::Gapic::Rest::Error => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Creates a BigQuery export. - # - # @overload create_big_query_export(request, options = nil) - # Pass arguments to `create_big_query_export` via a request object, either of type - # {::Google::Cloud::SecurityCenter::V1::CreateBigQueryExportRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::SecurityCenter::V1::CreateBigQueryExportRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_big_query_export(parent: nil, big_query_export: nil, big_query_export_id: nil) - # Pass arguments to `create_big_query_export` via keyword arguments. Note that at - # least one keyword argument is 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 name of the parent resource of the new BigQuery export. Its - # format is `organizations/[organization_id]`, `folders/[folder_id]`, or - # `projects/[project_id]`. - # @param big_query_export [::Google::Cloud::SecurityCenter::V1::BigQueryExport, ::Hash] - # Required. The BigQuery export being created. - # @param big_query_export_id [::String] - # Required. Unique identifier provided by the client within the parent scope. - # It must consist of only lowercase letters, numbers, and hyphens, must start - # with a letter, must end with either a letter or a number, and must be 63 - # characters or less. - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Cloud::SecurityCenter::V1::BigQueryExport] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::SecurityCenter::V1::BigQueryExport] - # - # @raise [::Google::Cloud::Error] if the REST call is aborted. - # - # @example Basic example - # require "google/cloud/security_center/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::SecurityCenter::V1::SecurityCenter::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::SecurityCenter::V1::CreateBigQueryExportRequest.new - # - # # Call the create_big_query_export method. - # result = client.create_big_query_export request - # - # # The returned object is of type Google::Cloud::SecurityCenter::V1::BigQueryExport. - # p result - # - def create_big_query_export request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::SecurityCenter::V1::CreateBigQueryExportRequest - - # Converts hash 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_big_query_export.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::SecurityCenter::V1::VERSION, - transports_version_send: [:rest] - - call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - options.apply_defaults timeout: @config.rpcs.create_big_query_export.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.create_big_query_export.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @security_center_stub.create_big_query_export request, options do |result, operation| - yield result, operation if block_given? - end - rescue ::Gapic::Rest::Error => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Deletes an existing BigQuery export. - # - # @overload delete_big_query_export(request, options = nil) - # Pass arguments to `delete_big_query_export` via a request object, either of type - # {::Google::Cloud::SecurityCenter::V1::DeleteBigQueryExportRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::SecurityCenter::V1::DeleteBigQueryExportRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_big_query_export(name: nil) - # Pass arguments to `delete_big_query_export` via keyword arguments. Note that at - # least one keyword argument is 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 BigQuery export to delete. Its format is - # `organizations/{organization}/bigQueryExports/{export_id}`, - # `folders/{folder}/bigQueryExports/{export_id}`, or - # `projects/{project}/bigQueryExports/{export_id}` - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Protobuf::Empty] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Protobuf::Empty] - # - # @raise [::Google::Cloud::Error] if the REST call is aborted. - # - # @example Basic example - # require "google/cloud/security_center/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::SecurityCenter::V1::SecurityCenter::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::SecurityCenter::V1::DeleteBigQueryExportRequest.new - # - # # Call the delete_big_query_export method. - # result = client.delete_big_query_export request - # - # # The returned object is of type Google::Protobuf::Empty. - # p result - # - def delete_big_query_export request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::SecurityCenter::V1::DeleteBigQueryExportRequest - - # Converts hash 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_big_query_export.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::SecurityCenter::V1::VERSION, - transports_version_send: [:rest] - - call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - options.apply_defaults timeout: @config.rpcs.delete_big_query_export.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.delete_big_query_export.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @security_center_stub.delete_big_query_export 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 BigQuery export. - # - # @overload update_big_query_export(request, options = nil) - # Pass arguments to `update_big_query_export` via a request object, either of type - # {::Google::Cloud::SecurityCenter::V1::UpdateBigQueryExportRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::SecurityCenter::V1::UpdateBigQueryExportRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_big_query_export(big_query_export: nil, update_mask: nil) - # Pass arguments to `update_big_query_export` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param big_query_export [::Google::Cloud::SecurityCenter::V1::BigQueryExport, ::Hash] - # Required. The BigQuery export being updated. - # @param update_mask [::Google::Protobuf::FieldMask, ::Hash] - # The list of fields to be updated. - # If empty all mutable fields will be updated. - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Cloud::SecurityCenter::V1::BigQueryExport] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::SecurityCenter::V1::BigQueryExport] - # - # @raise [::Google::Cloud::Error] if the REST call is aborted. - # - # @example Basic example - # require "google/cloud/security_center/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::SecurityCenter::V1::SecurityCenter::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::SecurityCenter::V1::UpdateBigQueryExportRequest.new - # - # # Call the update_big_query_export method. - # result = client.update_big_query_export request - # - # # The returned object is of type Google::Cloud::SecurityCenter::V1::BigQueryExport. - # p result - # - def update_big_query_export request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::SecurityCenter::V1::UpdateBigQueryExportRequest - - # Converts hash 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_big_query_export.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::SecurityCenter::V1::VERSION, - transports_version_send: [:rest] - - call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - options.apply_defaults timeout: @config.rpcs.update_big_query_export.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.update_big_query_export.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @security_center_stub.update_big_query_export request, options do |result, operation| - yield result, operation if block_given? - end - rescue ::Gapic::Rest::Error => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Lists BigQuery exports. Note that when requesting BigQuery exports at a - # given level all exports under that level are also returned e.g. if - # requesting BigQuery exports under a folder, then all BigQuery exports - # immediately under the folder plus the ones created under the projects - # within the folder are returned. - # - # @overload list_big_query_exports(request, options = nil) - # Pass arguments to `list_big_query_exports` via a request object, either of type - # {::Google::Cloud::SecurityCenter::V1::ListBigQueryExportsRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::SecurityCenter::V1::ListBigQueryExportsRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_big_query_exports(parent: nil, page_size: nil, page_token: nil) - # Pass arguments to `list_big_query_exports` via keyword arguments. Note that at - # least one keyword argument is 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, which owns the collection of BigQuery exports. Its - # format is `organizations/[organization_id]`, `folders/[folder_id]`, - # `projects/[project_id]`. - # @param page_size [::Integer] - # The maximum number of configs to return. The service may return fewer than - # this value. - # If unspecified, at most 10 configs will be returned. - # The maximum value is 1000; values above 1000 will be coerced to 1000. - # @param page_token [::String] - # A page token, received from a previous `ListBigQueryExports` call. - # Provide this to retrieve the subsequent page. - # When paginating, all other parameters provided to `ListBigQueryExports` - # 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::Cloud::SecurityCenter::V1::BigQueryExport>] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Gapic::Rest::PagedEnumerable<::Google::Cloud::SecurityCenter::V1::BigQueryExport>] - # - # @raise [::Google::Cloud::Error] if the REST call is aborted. - # - # @example Basic example - # require "google/cloud/security_center/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::SecurityCenter::V1::SecurityCenter::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::SecurityCenter::V1::ListBigQueryExportsRequest.new - # - # # Call the list_big_query_exports method. - # result = client.list_big_query_exports request - # - # # The returned object is of type Gapic::PagedEnumerable. You can iterate - # # over elements, and API calls will be issued to fetch pages as needed. - # result.each do |item| - # # Each element is of type ::Google::Cloud::SecurityCenter::V1::BigQueryExport. - # p item - # end - # - def list_big_query_exports request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::SecurityCenter::V1::ListBigQueryExportsRequest - - # Converts hash 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_big_query_exports.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::SecurityCenter::V1::VERSION, - transports_version_send: [:rest] - - call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - options.apply_defaults timeout: @config.rpcs.list_big_query_exports.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.list_big_query_exports.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @security_center_stub.list_big_query_exports request, options do |result, operation| - result = ::Gapic::Rest::PagedEnumerable.new @security_center_stub, :list_big_query_exports, "big_query_exports", request, result, options - yield result, operation if block_given? - throw :response, result - end - rescue ::Gapic::Rest::Error => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Creates a resident Event Threat Detection custom module at the scope of the - # given Resource Manager parent, and also creates inherited custom modules - # for all descendants of the given parent. These modules are enabled by - # default. - # - # @overload create_event_threat_detection_custom_module(request, options = nil) - # Pass arguments to `create_event_threat_detection_custom_module` via a request object, either of type - # {::Google::Cloud::SecurityCenter::V1::CreateEventThreatDetectionCustomModuleRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::SecurityCenter::V1::CreateEventThreatDetectionCustomModuleRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_event_threat_detection_custom_module(parent: nil, event_threat_detection_custom_module: nil) - # Pass arguments to `create_event_threat_detection_custom_module` via keyword arguments. Note that at - # least one keyword argument is 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 new custom module's parent. - # - # Its format is: - # - # * `organizations/{organization}/eventThreatDetectionSettings`. - # * `folders/{folder}/eventThreatDetectionSettings`. - # * `projects/{project}/eventThreatDetectionSettings`. - # @param event_threat_detection_custom_module [::Google::Cloud::SecurityCenter::V1::EventThreatDetectionCustomModule, ::Hash] - # Required. The module to create. The - # event_threat_detection_custom_module.name will be ignored and server - # generated. - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Cloud::SecurityCenter::V1::EventThreatDetectionCustomModule] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::SecurityCenter::V1::EventThreatDetectionCustomModule] - # - # @raise [::Google::Cloud::Error] if the REST call is aborted. - # - # @example Basic example - # require "google/cloud/security_center/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::SecurityCenter::V1::SecurityCenter::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::SecurityCenter::V1::CreateEventThreatDetectionCustomModuleRequest.new - # - # # Call the create_event_threat_detection_custom_module method. - # result = client.create_event_threat_detection_custom_module request - # - # # The returned object is of type Google::Cloud::SecurityCenter::V1::EventThreatDetectionCustomModule. - # p result - # - def create_event_threat_detection_custom_module request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::SecurityCenter::V1::CreateEventThreatDetectionCustomModuleRequest - - # Converts hash 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_event_threat_detection_custom_module.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::SecurityCenter::V1::VERSION, - transports_version_send: [:rest] - - call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - options.apply_defaults timeout: @config.rpcs.create_event_threat_detection_custom_module.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.create_event_threat_detection_custom_module.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @security_center_stub.create_event_threat_detection_custom_module request, options do |result, operation| - yield result, operation if block_given? - end - rescue ::Gapic::Rest::Error => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Deletes the specified Event Threat Detection custom module and all of its - # descendants in the Resource Manager hierarchy. This method is only - # supported for resident custom modules. - # - # @overload delete_event_threat_detection_custom_module(request, options = nil) - # Pass arguments to `delete_event_threat_detection_custom_module` via a request object, either of type - # {::Google::Cloud::SecurityCenter::V1::DeleteEventThreatDetectionCustomModuleRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::SecurityCenter::V1::DeleteEventThreatDetectionCustomModuleRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_event_threat_detection_custom_module(name: nil) - # Pass arguments to `delete_event_threat_detection_custom_module` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param name [::String] - # Required. Name of the custom module to delete. - # - # Its format is: - # - # * `organizations/{organization}/eventThreatDetectionSettings/customModules/{module}`. - # * `folders/{folder}/eventThreatDetectionSettings/customModules/{module}`. - # * `projects/{project}/eventThreatDetectionSettings/customModules/{module}`. - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Protobuf::Empty] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Protobuf::Empty] - # - # @raise [::Google::Cloud::Error] if the REST call is aborted. - # - # @example Basic example - # require "google/cloud/security_center/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::SecurityCenter::V1::SecurityCenter::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::SecurityCenter::V1::DeleteEventThreatDetectionCustomModuleRequest.new - # - # # Call the delete_event_threat_detection_custom_module method. - # result = client.delete_event_threat_detection_custom_module request - # - # # The returned object is of type Google::Protobuf::Empty. - # p result - # - def delete_event_threat_detection_custom_module request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::SecurityCenter::V1::DeleteEventThreatDetectionCustomModuleRequest - - # Converts hash 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_event_threat_detection_custom_module.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::SecurityCenter::V1::VERSION, - transports_version_send: [:rest] - - call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - options.apply_defaults timeout: @config.rpcs.delete_event_threat_detection_custom_module.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.delete_event_threat_detection_custom_module.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @security_center_stub.delete_event_threat_detection_custom_module request, options do |result, operation| - yield result, operation if block_given? - end - rescue ::Gapic::Rest::Error => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Gets an Event Threat Detection custom module. - # - # @overload get_event_threat_detection_custom_module(request, options = nil) - # Pass arguments to `get_event_threat_detection_custom_module` via a request object, either of type - # {::Google::Cloud::SecurityCenter::V1::GetEventThreatDetectionCustomModuleRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::SecurityCenter::V1::GetEventThreatDetectionCustomModuleRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_event_threat_detection_custom_module(name: nil) - # Pass arguments to `get_event_threat_detection_custom_module` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param name [::String] - # Required. Name of the custom module to get. - # - # Its format is: - # - # * `organizations/{organization}/eventThreatDetectionSettings/customModules/{module}`. - # * `folders/{folder}/eventThreatDetectionSettings/customModules/{module}`. - # * `projects/{project}/eventThreatDetectionSettings/customModules/{module}`. - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Cloud::SecurityCenter::V1::EventThreatDetectionCustomModule] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::SecurityCenter::V1::EventThreatDetectionCustomModule] - # - # @raise [::Google::Cloud::Error] if the REST call is aborted. - # - # @example Basic example - # require "google/cloud/security_center/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::SecurityCenter::V1::SecurityCenter::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::SecurityCenter::V1::GetEventThreatDetectionCustomModuleRequest.new - # - # # Call the get_event_threat_detection_custom_module method. - # result = client.get_event_threat_detection_custom_module request - # - # # The returned object is of type Google::Cloud::SecurityCenter::V1::EventThreatDetectionCustomModule. - # p result - # - def get_event_threat_detection_custom_module request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::SecurityCenter::V1::GetEventThreatDetectionCustomModuleRequest - - # Converts hash 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_event_threat_detection_custom_module.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::SecurityCenter::V1::VERSION, - transports_version_send: [:rest] - - call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - options.apply_defaults timeout: @config.rpcs.get_event_threat_detection_custom_module.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.get_event_threat_detection_custom_module.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @security_center_stub.get_event_threat_detection_custom_module request, options do |result, operation| - yield result, operation if block_given? - end - rescue ::Gapic::Rest::Error => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Lists all resident Event Threat Detection custom modules under the - # given Resource Manager parent and its descendants. - # - # @overload list_descendant_event_threat_detection_custom_modules(request, options = nil) - # Pass arguments to `list_descendant_event_threat_detection_custom_modules` via a request object, either of type - # {::Google::Cloud::SecurityCenter::V1::ListDescendantEventThreatDetectionCustomModulesRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::SecurityCenter::V1::ListDescendantEventThreatDetectionCustomModulesRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_descendant_event_threat_detection_custom_modules(parent: nil, page_token: nil, page_size: nil) - # Pass arguments to `list_descendant_event_threat_detection_custom_modules` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param parent [::String] - # Required. Name of the parent to list custom modules under. - # - # Its format is: - # - # * `organizations/{organization}/eventThreatDetectionSettings`. - # * `folders/{folder}/eventThreatDetectionSettings`. - # * `projects/{project}/eventThreatDetectionSettings`. - # @param page_token [::String] - # A page token, received from a previous - # `ListDescendantEventThreatDetectionCustomModules` call. Provide this to - # retrieve the subsequent page. - # - # When paginating, all other parameters provided to - # `ListDescendantEventThreatDetectionCustomModules` must match the call that - # provided the page token. - # @param page_size [::Integer] - # The maximum number of modules to return. The service may return fewer than - # this value. - # If unspecified, at most 10 configs will be returned. - # The maximum value is 1000; values above 1000 will be coerced to 1000. - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Gapic::Rest::PagedEnumerable<::Google::Cloud::SecurityCenter::V1::EventThreatDetectionCustomModule>] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Gapic::Rest::PagedEnumerable<::Google::Cloud::SecurityCenter::V1::EventThreatDetectionCustomModule>] - # - # @raise [::Google::Cloud::Error] if the REST call is aborted. - # - # @example Basic example - # require "google/cloud/security_center/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::SecurityCenter::V1::SecurityCenter::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::SecurityCenter::V1::ListDescendantEventThreatDetectionCustomModulesRequest.new - # - # # Call the list_descendant_event_threat_detection_custom_modules method. - # result = client.list_descendant_event_threat_detection_custom_modules request - # - # # The returned object is of type Gapic::PagedEnumerable. You can iterate - # # over elements, and API calls will be issued to fetch pages as needed. - # result.each do |item| - # # Each element is of type ::Google::Cloud::SecurityCenter::V1::EventThreatDetectionCustomModule. - # p item - # end - # - def list_descendant_event_threat_detection_custom_modules request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::SecurityCenter::V1::ListDescendantEventThreatDetectionCustomModulesRequest - - # Converts hash 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_descendant_event_threat_detection_custom_modules.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::SecurityCenter::V1::VERSION, - transports_version_send: [:rest] - - call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - options.apply_defaults timeout: @config.rpcs.list_descendant_event_threat_detection_custom_modules.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.list_descendant_event_threat_detection_custom_modules.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @security_center_stub.list_descendant_event_threat_detection_custom_modules request, options do |result, operation| - result = ::Gapic::Rest::PagedEnumerable.new @security_center_stub, :list_descendant_event_threat_detection_custom_modules, "event_threat_detection_custom_modules", 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 - - ## - # Lists all Event Threat Detection custom modules for the given - # Resource Manager parent. This includes resident modules defined at the - # scope of the parent along with modules inherited from ancestors. - # - # @overload list_event_threat_detection_custom_modules(request, options = nil) - # Pass arguments to `list_event_threat_detection_custom_modules` via a request object, either of type - # {::Google::Cloud::SecurityCenter::V1::ListEventThreatDetectionCustomModulesRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::SecurityCenter::V1::ListEventThreatDetectionCustomModulesRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_event_threat_detection_custom_modules(parent: nil, page_token: nil, page_size: nil) - # Pass arguments to `list_event_threat_detection_custom_modules` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param parent [::String] - # Required. Name of the parent to list custom modules under. - # - # Its format is: - # - # * `organizations/{organization}/eventThreatDetectionSettings`. - # * `folders/{folder}/eventThreatDetectionSettings`. - # * `projects/{project}/eventThreatDetectionSettings`. - # @param page_token [::String] - # A page token, received from a previous - # `ListEventThreatDetectionCustomModules` call. Provide this to retrieve the - # subsequent page. - # - # When paginating, all other parameters provided to - # `ListEventThreatDetectionCustomModules` must match the call that provided - # the page token. - # @param page_size [::Integer] - # The maximum number of modules to return. The service may return fewer than - # this value. - # If unspecified, at most 10 configs will be returned. - # The maximum value is 1000; values above 1000 will be coerced to 1000. - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Gapic::Rest::PagedEnumerable<::Google::Cloud::SecurityCenter::V1::EventThreatDetectionCustomModule>] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Gapic::Rest::PagedEnumerable<::Google::Cloud::SecurityCenter::V1::EventThreatDetectionCustomModule>] - # - # @raise [::Google::Cloud::Error] if the REST call is aborted. - # - # @example Basic example - # require "google/cloud/security_center/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::SecurityCenter::V1::SecurityCenter::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::SecurityCenter::V1::ListEventThreatDetectionCustomModulesRequest.new - # - # # Call the list_event_threat_detection_custom_modules method. - # result = client.list_event_threat_detection_custom_modules request - # - # # The returned object is of type Gapic::PagedEnumerable. You can iterate - # # over elements, and API calls will be issued to fetch pages as needed. - # result.each do |item| - # # Each element is of type ::Google::Cloud::SecurityCenter::V1::EventThreatDetectionCustomModule. - # p item - # end - # - def list_event_threat_detection_custom_modules request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::SecurityCenter::V1::ListEventThreatDetectionCustomModulesRequest - - # Converts hash 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_event_threat_detection_custom_modules.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::SecurityCenter::V1::VERSION, - transports_version_send: [:rest] - - call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - options.apply_defaults timeout: @config.rpcs.list_event_threat_detection_custom_modules.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.list_event_threat_detection_custom_modules.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @security_center_stub.list_event_threat_detection_custom_modules request, options do |result, operation| - result = ::Gapic::Rest::PagedEnumerable.new @security_center_stub, :list_event_threat_detection_custom_modules, "event_threat_detection_custom_modules", 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 - - ## - # Updates the Event Threat Detection custom module with the given name based - # on the given update mask. Updating the enablement state is supported for - # both resident and inherited modules (though resident modules cannot have an - # enablement state of "inherited"). Updating the display name or - # configuration of a module is supported for resident modules only. The type - # of a module cannot be changed. - # - # @overload update_event_threat_detection_custom_module(request, options = nil) - # Pass arguments to `update_event_threat_detection_custom_module` via a request object, either of type - # {::Google::Cloud::SecurityCenter::V1::UpdateEventThreatDetectionCustomModuleRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::SecurityCenter::V1::UpdateEventThreatDetectionCustomModuleRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_event_threat_detection_custom_module(event_threat_detection_custom_module: nil, update_mask: nil) - # Pass arguments to `update_event_threat_detection_custom_module` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param event_threat_detection_custom_module [::Google::Cloud::SecurityCenter::V1::EventThreatDetectionCustomModule, ::Hash] - # Required. The module being updated. - # @param update_mask [::Google::Protobuf::FieldMask, ::Hash] - # The list of fields to be updated. - # If empty all mutable fields will be updated. - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Cloud::SecurityCenter::V1::EventThreatDetectionCustomModule] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::SecurityCenter::V1::EventThreatDetectionCustomModule] - # - # @raise [::Google::Cloud::Error] if the REST call is aborted. - # - # @example Basic example - # require "google/cloud/security_center/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::SecurityCenter::V1::SecurityCenter::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::SecurityCenter::V1::UpdateEventThreatDetectionCustomModuleRequest.new - # - # # Call the update_event_threat_detection_custom_module method. - # result = client.update_event_threat_detection_custom_module request - # - # # The returned object is of type Google::Cloud::SecurityCenter::V1::EventThreatDetectionCustomModule. - # p result - # - def update_event_threat_detection_custom_module request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::SecurityCenter::V1::UpdateEventThreatDetectionCustomModuleRequest - - # Converts hash 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_event_threat_detection_custom_module.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::SecurityCenter::V1::VERSION, - transports_version_send: [:rest] - - call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - options.apply_defaults timeout: @config.rpcs.update_event_threat_detection_custom_module.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.update_event_threat_detection_custom_module.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @security_center_stub.update_event_threat_detection_custom_module 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 - - ## - # Validates the given Event Threat Detection custom module. - # - # @overload validate_event_threat_detection_custom_module(request, options = nil) - # Pass arguments to `validate_event_threat_detection_custom_module` via a request object, either of type - # {::Google::Cloud::SecurityCenter::V1::ValidateEventThreatDetectionCustomModuleRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::SecurityCenter::V1::ValidateEventThreatDetectionCustomModuleRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @overload validate_event_threat_detection_custom_module(parent: nil, raw_text: nil, type: nil) - # Pass arguments to `validate_event_threat_detection_custom_module` via keyword arguments. Note that at - # least one keyword argument is 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. Resource name of the parent to validate the Custom Module under. - # - # Its format is: - # - # * `organizations/{organization}/eventThreatDetectionSettings`. - # * `folders/{folder}/eventThreatDetectionSettings`. - # * `projects/{project}/eventThreatDetectionSettings`. - # @param raw_text [::String] - # Required. The raw text of the module's contents. Used to generate error - # messages. - # @param type [::String] - # Required. The type of the module (e.g. CONFIGURABLE_BAD_IP). - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Cloud::SecurityCenter::V1::ValidateEventThreatDetectionCustomModuleResponse] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::SecurityCenter::V1::ValidateEventThreatDetectionCustomModuleResponse] - # - # @raise [::Google::Cloud::Error] if the REST call is aborted. - # - # @example Basic example - # require "google/cloud/security_center/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::SecurityCenter::V1::SecurityCenter::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::SecurityCenter::V1::ValidateEventThreatDetectionCustomModuleRequest.new - # - # # Call the validate_event_threat_detection_custom_module method. - # result = client.validate_event_threat_detection_custom_module request - # - # # The returned object is of type Google::Cloud::SecurityCenter::V1::ValidateEventThreatDetectionCustomModuleResponse. - # p result - # - def validate_event_threat_detection_custom_module request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::SecurityCenter::V1::ValidateEventThreatDetectionCustomModuleRequest - - # Converts hash 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.validate_event_threat_detection_custom_module.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::SecurityCenter::V1::VERSION, - transports_version_send: [:rest] - - call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - options.apply_defaults timeout: @config.rpcs.validate_event_threat_detection_custom_module.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.validate_event_threat_detection_custom_module.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @security_center_stub.validate_event_threat_detection_custom_module request, options do |result, operation| - yield result, operation if block_given? - end - rescue ::Gapic::Rest::Error => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Gets an effective Event Threat Detection custom module at the given level. - # - # @overload get_effective_event_threat_detection_custom_module(request, options = nil) - # Pass arguments to `get_effective_event_threat_detection_custom_module` via a request object, either of type - # {::Google::Cloud::SecurityCenter::V1::GetEffectiveEventThreatDetectionCustomModuleRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::SecurityCenter::V1::GetEffectiveEventThreatDetectionCustomModuleRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_effective_event_threat_detection_custom_module(name: nil) - # Pass arguments to `get_effective_event_threat_detection_custom_module` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param name [::String] - # Required. The resource name of the effective Event Threat Detection custom - # module. - # - # Its format is: - # - # * `organizations/{organization}/eventThreatDetectionSettings/effectiveCustomModules/{module}`. - # * `folders/{folder}/eventThreatDetectionSettings/effectiveCustomModules/{module}`. - # * `projects/{project}/eventThreatDetectionSettings/effectiveCustomModules/{module}`. - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Cloud::SecurityCenter::V1::EffectiveEventThreatDetectionCustomModule] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::SecurityCenter::V1::EffectiveEventThreatDetectionCustomModule] - # - # @raise [::Google::Cloud::Error] if the REST call is aborted. - # - # @example Basic example - # require "google/cloud/security_center/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::SecurityCenter::V1::SecurityCenter::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::SecurityCenter::V1::GetEffectiveEventThreatDetectionCustomModuleRequest.new - # - # # Call the get_effective_event_threat_detection_custom_module method. - # result = client.get_effective_event_threat_detection_custom_module request - # - # # The returned object is of type Google::Cloud::SecurityCenter::V1::EffectiveEventThreatDetectionCustomModule. - # p result - # - def get_effective_event_threat_detection_custom_module request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::SecurityCenter::V1::GetEffectiveEventThreatDetectionCustomModuleRequest - - # Converts hash 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_effective_event_threat_detection_custom_module.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::SecurityCenter::V1::VERSION, - transports_version_send: [:rest] - - call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - options.apply_defaults timeout: @config.rpcs.get_effective_event_threat_detection_custom_module.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.get_effective_event_threat_detection_custom_module.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @security_center_stub.get_effective_event_threat_detection_custom_module request, options do |result, operation| - yield result, operation if block_given? - end - rescue ::Gapic::Rest::Error => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Lists all effective Event Threat Detection custom modules for the - # given parent. This includes resident modules defined at the scope of the - # parent along with modules inherited from its ancestors. - # - # @overload list_effective_event_threat_detection_custom_modules(request, options = nil) - # Pass arguments to `list_effective_event_threat_detection_custom_modules` via a request object, either of type - # {::Google::Cloud::SecurityCenter::V1::ListEffectiveEventThreatDetectionCustomModulesRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::SecurityCenter::V1::ListEffectiveEventThreatDetectionCustomModulesRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_effective_event_threat_detection_custom_modules(parent: nil, page_token: nil, page_size: nil) - # Pass arguments to `list_effective_event_threat_detection_custom_modules` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param parent [::String] - # Required. Name of the parent to list custom modules for. - # - # Its format is: - # - # * `organizations/{organization}/eventThreatDetectionSettings`. - # * `folders/{folder}/eventThreatDetectionSettings`. - # * `projects/{project}/eventThreatDetectionSettings`. - # @param page_token [::String] - # A page token, received from a previous - # `ListEffectiveEventThreatDetectionCustomModules` call. Provide this to - # retrieve the subsequent page. - # - # When paginating, all other parameters provided to - # `ListEffectiveEventThreatDetectionCustomModules` must match the call that - # provided the page token. - # @param page_size [::Integer] - # The maximum number of modules to return. The service may return fewer than - # this value. - # If unspecified, at most 10 configs will be returned. - # The maximum value is 1000; values above 1000 will be coerced to 1000. - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Gapic::Rest::PagedEnumerable<::Google::Cloud::SecurityCenter::V1::EffectiveEventThreatDetectionCustomModule>] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Gapic::Rest::PagedEnumerable<::Google::Cloud::SecurityCenter::V1::EffectiveEventThreatDetectionCustomModule>] - # - # @raise [::Google::Cloud::Error] if the REST call is aborted. - # - # @example Basic example - # require "google/cloud/security_center/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::SecurityCenter::V1::SecurityCenter::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::SecurityCenter::V1::ListEffectiveEventThreatDetectionCustomModulesRequest.new - # - # # Call the list_effective_event_threat_detection_custom_modules method. - # result = client.list_effective_event_threat_detection_custom_modules request - # - # # The returned object is of type Gapic::PagedEnumerable. You can iterate - # # over elements, and API calls will be issued to fetch pages as needed. - # result.each do |item| - # # Each element is of type ::Google::Cloud::SecurityCenter::V1::EffectiveEventThreatDetectionCustomModule. - # p item - # end - # - def list_effective_event_threat_detection_custom_modules request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::SecurityCenter::V1::ListEffectiveEventThreatDetectionCustomModulesRequest - - # Converts hash 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_effective_event_threat_detection_custom_modules.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::SecurityCenter::V1::VERSION, - transports_version_send: [:rest] - - call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - options.apply_defaults timeout: @config.rpcs.list_effective_event_threat_detection_custom_modules.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.list_effective_event_threat_detection_custom_modules.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @security_center_stub.list_effective_event_threat_detection_custom_modules request, options do |result, operation| - result = ::Gapic::Rest::PagedEnumerable.new @security_center_stub, :list_effective_event_threat_detection_custom_modules, "effective_event_threat_detection_custom_modules", request, result, options - yield result, operation if block_given? - throw :response, result - end - rescue ::Gapic::Rest::Error => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Creates a ResourceValueConfig for an organization. Maps user's tags to - # difference resource values for use by the attack path simulation. - # - # @overload batch_create_resource_value_configs(request, options = nil) - # Pass arguments to `batch_create_resource_value_configs` via a request object, either of type - # {::Google::Cloud::SecurityCenter::V1::BatchCreateResourceValueConfigsRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::SecurityCenter::V1::BatchCreateResourceValueConfigsRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @overload batch_create_resource_value_configs(parent: nil, requests: nil) - # Pass arguments to `batch_create_resource_value_configs` via keyword arguments. Note that at - # least one keyword argument is 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. Resource name of the new ResourceValueConfig's parent. - # The parent field in the CreateResourceValueConfigRequest - # messages must either be empty or match this field. - # @param requests [::Array<::Google::Cloud::SecurityCenter::V1::CreateResourceValueConfigRequest, ::Hash>] - # Required. The resource value configs to be created. - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Cloud::SecurityCenter::V1::BatchCreateResourceValueConfigsResponse] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::SecurityCenter::V1::BatchCreateResourceValueConfigsResponse] - # - # @raise [::Google::Cloud::Error] if the REST call is aborted. - # - # @example Basic example - # require "google/cloud/security_center/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::SecurityCenter::V1::SecurityCenter::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::SecurityCenter::V1::BatchCreateResourceValueConfigsRequest.new - # - # # Call the batch_create_resource_value_configs method. - # result = client.batch_create_resource_value_configs request - # - # # The returned object is of type Google::Cloud::SecurityCenter::V1::BatchCreateResourceValueConfigsResponse. - # p result - # - def batch_create_resource_value_configs request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::SecurityCenter::V1::BatchCreateResourceValueConfigsRequest - - # Converts hash 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.batch_create_resource_value_configs.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::SecurityCenter::V1::VERSION, - transports_version_send: [:rest] - - call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - options.apply_defaults timeout: @config.rpcs.batch_create_resource_value_configs.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.batch_create_resource_value_configs.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @security_center_stub.batch_create_resource_value_configs request, options do |result, operation| - yield result, operation if block_given? - end - rescue ::Gapic::Rest::Error => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Deletes a ResourceValueConfig. - # - # @overload delete_resource_value_config(request, options = nil) - # Pass arguments to `delete_resource_value_config` via a request object, either of type - # {::Google::Cloud::SecurityCenter::V1::DeleteResourceValueConfigRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::SecurityCenter::V1::DeleteResourceValueConfigRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_resource_value_config(name: nil) - # Pass arguments to `delete_resource_value_config` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param name [::String] - # Required. Name of the ResourceValueConfig to delete - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Protobuf::Empty] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Protobuf::Empty] - # - # @raise [::Google::Cloud::Error] if the REST call is aborted. - # - # @example Basic example - # require "google/cloud/security_center/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::SecurityCenter::V1::SecurityCenter::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::SecurityCenter::V1::DeleteResourceValueConfigRequest.new - # - # # Call the delete_resource_value_config method. - # result = client.delete_resource_value_config request - # - # # The returned object is of type Google::Protobuf::Empty. - # p result - # - def delete_resource_value_config request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::SecurityCenter::V1::DeleteResourceValueConfigRequest - - # Converts hash 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_resource_value_config.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::SecurityCenter::V1::VERSION, - transports_version_send: [:rest] - - call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - options.apply_defaults timeout: @config.rpcs.delete_resource_value_config.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.delete_resource_value_config.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @security_center_stub.delete_resource_value_config request, options do |result, operation| - yield result, operation if block_given? - end - rescue ::Gapic::Rest::Error => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Gets a ResourceValueConfig. - # - # @overload get_resource_value_config(request, options = nil) - # Pass arguments to `get_resource_value_config` via a request object, either of type - # {::Google::Cloud::SecurityCenter::V1::GetResourceValueConfigRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::SecurityCenter::V1::GetResourceValueConfigRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_resource_value_config(name: nil) - # Pass arguments to `get_resource_value_config` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param name [::String] - # Required. Name of the resource value config to retrieve. Its format is - # `organizations/{organization}/resourceValueConfigs/{config_id}`. - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Cloud::SecurityCenter::V1::ResourceValueConfig] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::SecurityCenter::V1::ResourceValueConfig] - # - # @raise [::Google::Cloud::Error] if the REST call is aborted. - # - # @example Basic example - # require "google/cloud/security_center/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::SecurityCenter::V1::SecurityCenter::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::SecurityCenter::V1::GetResourceValueConfigRequest.new - # - # # Call the get_resource_value_config method. - # result = client.get_resource_value_config request - # - # # The returned object is of type Google::Cloud::SecurityCenter::V1::ResourceValueConfig. - # p result - # - def get_resource_value_config request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::SecurityCenter::V1::GetResourceValueConfigRequest - - # Converts hash 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_resource_value_config.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::SecurityCenter::V1::VERSION, - transports_version_send: [:rest] - - call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - options.apply_defaults timeout: @config.rpcs.get_resource_value_config.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.get_resource_value_config.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @security_center_stub.get_resource_value_config request, options do |result, operation| - yield result, operation if block_given? - end - rescue ::Gapic::Rest::Error => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Lists all ResourceValueConfigs. - # - # @overload list_resource_value_configs(request, options = nil) - # Pass arguments to `list_resource_value_configs` via a request object, either of type - # {::Google::Cloud::SecurityCenter::V1::ListResourceValueConfigsRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::SecurityCenter::V1::ListResourceValueConfigsRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_resource_value_configs(parent: nil, page_size: nil, page_token: nil) - # Pass arguments to `list_resource_value_configs` via keyword arguments. Note that at - # least one keyword argument is 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, which owns the collection of resource value configs. - # Its format is - # `organizations/[organization_id]` - # @param page_size [::Integer] - # The number of results to return. The service may return fewer than - # this value. - # If unspecified, at most 10 configs will be returned. - # The maximum value is 1000; values above 1000 will be coerced to 1000. - # @param page_token [::String] - # A page token, received from a previous `ListResourceValueConfigs` call. - # Provide this to retrieve the subsequent page. - # - # When paginating, all other parameters provided to - # `ListResourceValueConfigs` must match the call that provided the - # page token. - # - # page_size can be specified, and the new page_size will be used. - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Gapic::Rest::PagedEnumerable<::Google::Cloud::SecurityCenter::V1::ResourceValueConfig>] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Gapic::Rest::PagedEnumerable<::Google::Cloud::SecurityCenter::V1::ResourceValueConfig>] - # - # @raise [::Google::Cloud::Error] if the REST call is aborted. - # - # @example Basic example - # require "google/cloud/security_center/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::SecurityCenter::V1::SecurityCenter::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::SecurityCenter::V1::ListResourceValueConfigsRequest.new - # - # # Call the list_resource_value_configs method. - # result = client.list_resource_value_configs request - # - # # The returned object is of type Gapic::PagedEnumerable. You can iterate - # # over elements, and API calls will be issued to fetch pages as needed. - # result.each do |item| - # # Each element is of type ::Google::Cloud::SecurityCenter::V1::ResourceValueConfig. - # p item - # end - # - def list_resource_value_configs request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::SecurityCenter::V1::ListResourceValueConfigsRequest - - # Converts hash 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_resource_value_configs.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::SecurityCenter::V1::VERSION, - transports_version_send: [:rest] - - call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - options.apply_defaults timeout: @config.rpcs.list_resource_value_configs.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.list_resource_value_configs.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @security_center_stub.list_resource_value_configs request, options do |result, operation| - result = ::Gapic::Rest::PagedEnumerable.new @security_center_stub, :list_resource_value_configs, "resource_value_configs", 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 - - ## - # Updates an existing ResourceValueConfigs with new rules. - # - # @overload update_resource_value_config(request, options = nil) - # Pass arguments to `update_resource_value_config` via a request object, either of type - # {::Google::Cloud::SecurityCenter::V1::UpdateResourceValueConfigRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::SecurityCenter::V1::UpdateResourceValueConfigRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_resource_value_config(resource_value_config: nil, update_mask: nil) - # Pass arguments to `update_resource_value_config` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param resource_value_config [::Google::Cloud::SecurityCenter::V1::ResourceValueConfig, ::Hash] - # Required. The resource value config being updated. - # @param update_mask [::Google::Protobuf::FieldMask, ::Hash] - # The list of fields to be updated. - # If empty all mutable fields will be updated. - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Cloud::SecurityCenter::V1::ResourceValueConfig] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::SecurityCenter::V1::ResourceValueConfig] - # - # @raise [::Google::Cloud::Error] if the REST call is aborted. - # - # @example Basic example - # require "google/cloud/security_center/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::SecurityCenter::V1::SecurityCenter::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::SecurityCenter::V1::UpdateResourceValueConfigRequest.new - # - # # Call the update_resource_value_config method. - # result = client.update_resource_value_config request - # - # # The returned object is of type Google::Cloud::SecurityCenter::V1::ResourceValueConfig. - # p result - # - def update_resource_value_config request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::SecurityCenter::V1::UpdateResourceValueConfigRequest - - # Converts hash 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_resource_value_config.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::SecurityCenter::V1::VERSION, - transports_version_send: [:rest] - - call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - options.apply_defaults timeout: @config.rpcs.update_resource_value_config.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.update_resource_value_config.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @security_center_stub.update_resource_value_config request, options do |result, operation| - yield result, operation if block_given? - end - rescue ::Gapic::Rest::Error => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Lists the valued resources for a set of simulation results and filter. - # - # @overload list_valued_resources(request, options = nil) - # Pass arguments to `list_valued_resources` via a request object, either of type - # {::Google::Cloud::SecurityCenter::V1::ListValuedResourcesRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::SecurityCenter::V1::ListValuedResourcesRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_valued_resources(parent: nil, filter: nil, page_token: nil, page_size: nil, order_by: nil) - # Pass arguments to `list_valued_resources` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param parent [::String] - # Required. Name of parent to list valued resources. - # - # Valid formats: - # `organizations/{organization}`, - # `organizations/{organization}/simulations/{simulation}` - # `organizations/{organization}/simulations/{simulation}/attackExposureResults/{attack_exposure_result_v2}` - # @param filter [::String] - # The filter expression that filters the valued resources in the response. - # Supported fields: - # - # * `resource_value` supports = - # * `resource_type` supports = - # @param page_token [::String] - # The value returned by the last `ListValuedResourcesResponse`; indicates - # that this is a continuation of a prior `ListValuedResources` call, and - # that the system should return the next page of data. - # @param page_size [::Integer] - # The maximum number of results to return in a single response. Default is - # 10, minimum is 1, maximum is 1000. - # @param order_by [::String] - # Optional. The fields by which to order the valued resources response. - # - # Supported fields: - # - # * `exposed_score` - # - # * `resource_value` - # - # * `resource_type` - # - # * `resource` - # - # * `display_name` - # - # Values should be a comma separated list of fields. For example: - # `exposed_score,resource_value`. - # - # The default sorting order is descending. To specify ascending or descending - # order for a field, append a ` ASC` or a ` DESC` suffix, respectively; for - # example: `exposed_score DESC`. - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Gapic::Rest::PagedEnumerable<::Google::Cloud::SecurityCenter::V1::ValuedResource>] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Gapic::Rest::PagedEnumerable<::Google::Cloud::SecurityCenter::V1::ValuedResource>] - # - # @raise [::Google::Cloud::Error] if the REST call is aborted. - # - # @example Basic example - # require "google/cloud/security_center/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::SecurityCenter::V1::SecurityCenter::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::SecurityCenter::V1::ListValuedResourcesRequest.new - # - # # Call the list_valued_resources method. - # result = client.list_valued_resources request - # - # # The returned object is of type Gapic::PagedEnumerable. You can iterate - # # over elements, and API calls will be issued to fetch pages as needed. - # result.each do |item| - # # Each element is of type ::Google::Cloud::SecurityCenter::V1::ValuedResource. - # p item - # end - # - def list_valued_resources request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::SecurityCenter::V1::ListValuedResourcesRequest - - # Converts hash 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_valued_resources.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::SecurityCenter::V1::VERSION, - transports_version_send: [:rest] - - call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - options.apply_defaults timeout: @config.rpcs.list_valued_resources.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.list_valued_resources.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @security_center_stub.list_valued_resources request, options do |result, operation| - result = ::Gapic::Rest::PagedEnumerable.new @security_center_stub, :list_valued_resources, "valued_resources", 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 - - ## - # Lists the attack paths for a set of simulation results or valued resources - # and filter. - # - # @overload list_attack_paths(request, options = nil) - # Pass arguments to `list_attack_paths` via a request object, either of type - # {::Google::Cloud::SecurityCenter::V1::ListAttackPathsRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::SecurityCenter::V1::ListAttackPathsRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_attack_paths(parent: nil, filter: nil, page_token: nil, page_size: nil) - # Pass arguments to `list_attack_paths` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param parent [::String] - # Required. Name of parent to list attack paths. - # - # Valid formats: - # `organizations/{organization}`, - # `organizations/{organization}/simulations/{simulation}` - # `organizations/{organization}/simulations/{simulation}/attackExposureResults/{attack_exposure_result_v2}` - # `organizations/{organization}/simulations/{simulation}/valuedResources/{valued_resource}` - # @param filter [::String] - # The filter expression that filters the attack path in the response. - # Supported fields: - # - # * `valued_resources` supports = - # @param page_token [::String] - # The value returned by the last `ListAttackPathsResponse`; indicates - # that this is a continuation of a prior `ListAttackPaths` call, and - # that the system should return the next page of data. - # @param page_size [::Integer] - # The maximum number of results to return in a single response. Default is - # 10, minimum is 1, maximum is 1000. - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Gapic::Rest::PagedEnumerable<::Google::Cloud::SecurityCenter::V1::AttackPath>] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Gapic::Rest::PagedEnumerable<::Google::Cloud::SecurityCenter::V1::AttackPath>] - # - # @raise [::Google::Cloud::Error] if the REST call is aborted. - # - # @example Basic example - # require "google/cloud/security_center/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::SecurityCenter::V1::SecurityCenter::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::SecurityCenter::V1::ListAttackPathsRequest.new - # - # # Call the list_attack_paths method. - # result = client.list_attack_paths request - # - # # The returned object is of type Gapic::PagedEnumerable. You can iterate - # # over elements, and API calls will be issued to fetch pages as needed. - # result.each do |item| - # # Each element is of type ::Google::Cloud::SecurityCenter::V1::AttackPath. - # p item - # end - # - def list_attack_paths request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::SecurityCenter::V1::ListAttackPathsRequest - - # Converts hash 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_attack_paths.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::SecurityCenter::V1::VERSION, - transports_version_send: [:rest] - - call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - options.apply_defaults timeout: @config.rpcs.list_attack_paths.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.list_attack_paths.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @security_center_stub.list_attack_paths request, options do |result, operation| - result = ::Gapic::Rest::PagedEnumerable.new @security_center_stub, :list_attack_paths, "attack_paths", 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 SecurityCenter REST API. - # - # This class represents the configuration for SecurityCenter REST, - # providing control over timeouts, retry behavior, logging, transport - # parameters, and other low-level controls. Certain parameters can also be - # applied individually to specific RPCs. See - # {::Google::Cloud::SecurityCenter::V1::SecurityCenter::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 - # # bulk_mute_findings to 20 seconds, - # # and all remaining timeouts to 10 seconds. - # ::Google::Cloud::SecurityCenter::V1::SecurityCenter::Rest::Client.configure do |config| - # config.timeout = 10.0 - # config.rpcs.bulk_mute_findings.timeout = 20.0 - # end - # - # # Apply the above configuration only to a new client. - # client = ::Google::Cloud::SecurityCenter::V1::SecurityCenter::Rest::Client.new do |config| - # config.timeout = 10.0 - # config.rpcs.bulk_mute_findings.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 = "securitycenter.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 SecurityCenter 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 `bulk_mute_findings` - # @return [::Gapic::Config::Method] - # - attr_reader :bulk_mute_findings - ## - # RPC-specific configuration for `create_security_health_analytics_custom_module` - # @return [::Gapic::Config::Method] - # - attr_reader :create_security_health_analytics_custom_module - ## - # RPC-specific configuration for `create_source` - # @return [::Gapic::Config::Method] - # - attr_reader :create_source - ## - # RPC-specific configuration for `create_finding` - # @return [::Gapic::Config::Method] - # - attr_reader :create_finding - ## - # RPC-specific configuration for `create_mute_config` - # @return [::Gapic::Config::Method] - # - attr_reader :create_mute_config - ## - # RPC-specific configuration for `create_notification_config` - # @return [::Gapic::Config::Method] - # - attr_reader :create_notification_config - ## - # RPC-specific configuration for `delete_mute_config` - # @return [::Gapic::Config::Method] - # - attr_reader :delete_mute_config - ## - # RPC-specific configuration for `delete_notification_config` - # @return [::Gapic::Config::Method] - # - attr_reader :delete_notification_config - ## - # RPC-specific configuration for `delete_security_health_analytics_custom_module` - # @return [::Gapic::Config::Method] - # - attr_reader :delete_security_health_analytics_custom_module - ## - # RPC-specific configuration for `get_simulation` - # @return [::Gapic::Config::Method] - # - attr_reader :get_simulation - ## - # RPC-specific configuration for `get_valued_resource` - # @return [::Gapic::Config::Method] - # - attr_reader :get_valued_resource - ## - # RPC-specific configuration for `get_big_query_export` - # @return [::Gapic::Config::Method] - # - attr_reader :get_big_query_export - ## - # RPC-specific configuration for `get_iam_policy` - # @return [::Gapic::Config::Method] - # - attr_reader :get_iam_policy - ## - # RPC-specific configuration for `get_mute_config` - # @return [::Gapic::Config::Method] - # - attr_reader :get_mute_config - ## - # RPC-specific configuration for `get_notification_config` - # @return [::Gapic::Config::Method] - # - attr_reader :get_notification_config - ## - # RPC-specific configuration for `get_organization_settings` - # @return [::Gapic::Config::Method] - # - attr_reader :get_organization_settings - ## - # RPC-specific configuration for `get_effective_security_health_analytics_custom_module` - # @return [::Gapic::Config::Method] - # - attr_reader :get_effective_security_health_analytics_custom_module - ## - # RPC-specific configuration for `get_security_health_analytics_custom_module` - # @return [::Gapic::Config::Method] - # - attr_reader :get_security_health_analytics_custom_module - ## - # RPC-specific configuration for `get_source` - # @return [::Gapic::Config::Method] - # - attr_reader :get_source - ## - # RPC-specific configuration for `group_assets` - # @return [::Gapic::Config::Method] - # - attr_reader :group_assets - ## - # RPC-specific configuration for `group_findings` - # @return [::Gapic::Config::Method] - # - attr_reader :group_findings - ## - # RPC-specific configuration for `list_assets` - # @return [::Gapic::Config::Method] - # - attr_reader :list_assets - ## - # RPC-specific configuration for `list_descendant_security_health_analytics_custom_modules` - # @return [::Gapic::Config::Method] - # - attr_reader :list_descendant_security_health_analytics_custom_modules - ## - # RPC-specific configuration for `list_findings` - # @return [::Gapic::Config::Method] - # - attr_reader :list_findings - ## - # RPC-specific configuration for `list_mute_configs` - # @return [::Gapic::Config::Method] - # - attr_reader :list_mute_configs - ## - # RPC-specific configuration for `list_notification_configs` - # @return [::Gapic::Config::Method] - # - attr_reader :list_notification_configs - ## - # RPC-specific configuration for `list_effective_security_health_analytics_custom_modules` - # @return [::Gapic::Config::Method] - # - attr_reader :list_effective_security_health_analytics_custom_modules - ## - # RPC-specific configuration for `list_security_health_analytics_custom_modules` - # @return [::Gapic::Config::Method] - # - attr_reader :list_security_health_analytics_custom_modules - ## - # RPC-specific configuration for `list_sources` - # @return [::Gapic::Config::Method] - # - attr_reader :list_sources - ## - # RPC-specific configuration for `run_asset_discovery` - # @return [::Gapic::Config::Method] - # - attr_reader :run_asset_discovery - ## - # RPC-specific configuration for `set_finding_state` - # @return [::Gapic::Config::Method] - # - attr_reader :set_finding_state - ## - # RPC-specific configuration for `set_mute` - # @return [::Gapic::Config::Method] - # - attr_reader :set_mute - ## - # RPC-specific configuration for `set_iam_policy` - # @return [::Gapic::Config::Method] - # - attr_reader :set_iam_policy - ## - # RPC-specific configuration for `test_iam_permissions` - # @return [::Gapic::Config::Method] - # - attr_reader :test_iam_permissions - ## - # RPC-specific configuration for `simulate_security_health_analytics_custom_module` - # @return [::Gapic::Config::Method] - # - attr_reader :simulate_security_health_analytics_custom_module - ## - # RPC-specific configuration for `update_external_system` - # @return [::Gapic::Config::Method] - # - attr_reader :update_external_system - ## - # RPC-specific configuration for `update_finding` - # @return [::Gapic::Config::Method] - # - attr_reader :update_finding - ## - # RPC-specific configuration for `update_mute_config` - # @return [::Gapic::Config::Method] - # - attr_reader :update_mute_config - ## - # RPC-specific configuration for `update_notification_config` - # @return [::Gapic::Config::Method] - # - attr_reader :update_notification_config - ## - # RPC-specific configuration for `update_organization_settings` - # @return [::Gapic::Config::Method] - # - attr_reader :update_organization_settings - ## - # RPC-specific configuration for `update_security_health_analytics_custom_module` - # @return [::Gapic::Config::Method] - # - attr_reader :update_security_health_analytics_custom_module - ## - # RPC-specific configuration for `update_source` - # @return [::Gapic::Config::Method] - # - attr_reader :update_source - ## - # RPC-specific configuration for `update_security_marks` - # @return [::Gapic::Config::Method] - # - attr_reader :update_security_marks - ## - # RPC-specific configuration for `create_big_query_export` - # @return [::Gapic::Config::Method] - # - attr_reader :create_big_query_export - ## - # RPC-specific configuration for `delete_big_query_export` - # @return [::Gapic::Config::Method] - # - attr_reader :delete_big_query_export - ## - # RPC-specific configuration for `update_big_query_export` - # @return [::Gapic::Config::Method] - # - attr_reader :update_big_query_export - ## - # RPC-specific configuration for `list_big_query_exports` - # @return [::Gapic::Config::Method] - # - attr_reader :list_big_query_exports - ## - # RPC-specific configuration for `create_event_threat_detection_custom_module` - # @return [::Gapic::Config::Method] - # - attr_reader :create_event_threat_detection_custom_module - ## - # RPC-specific configuration for `delete_event_threat_detection_custom_module` - # @return [::Gapic::Config::Method] - # - attr_reader :delete_event_threat_detection_custom_module - ## - # RPC-specific configuration for `get_event_threat_detection_custom_module` - # @return [::Gapic::Config::Method] - # - attr_reader :get_event_threat_detection_custom_module - ## - # RPC-specific configuration for `list_descendant_event_threat_detection_custom_modules` - # @return [::Gapic::Config::Method] - # - attr_reader :list_descendant_event_threat_detection_custom_modules - ## - # RPC-specific configuration for `list_event_threat_detection_custom_modules` - # @return [::Gapic::Config::Method] - # - attr_reader :list_event_threat_detection_custom_modules - ## - # RPC-specific configuration for `update_event_threat_detection_custom_module` - # @return [::Gapic::Config::Method] - # - attr_reader :update_event_threat_detection_custom_module - ## - # RPC-specific configuration for `validate_event_threat_detection_custom_module` - # @return [::Gapic::Config::Method] - # - attr_reader :validate_event_threat_detection_custom_module - ## - # RPC-specific configuration for `get_effective_event_threat_detection_custom_module` - # @return [::Gapic::Config::Method] - # - attr_reader :get_effective_event_threat_detection_custom_module - ## - # RPC-specific configuration for `list_effective_event_threat_detection_custom_modules` - # @return [::Gapic::Config::Method] - # - attr_reader :list_effective_event_threat_detection_custom_modules - ## - # RPC-specific configuration for `batch_create_resource_value_configs` - # @return [::Gapic::Config::Method] - # - attr_reader :batch_create_resource_value_configs - ## - # RPC-specific configuration for `delete_resource_value_config` - # @return [::Gapic::Config::Method] - # - attr_reader :delete_resource_value_config - ## - # RPC-specific configuration for `get_resource_value_config` - # @return [::Gapic::Config::Method] - # - attr_reader :get_resource_value_config - ## - # RPC-specific configuration for `list_resource_value_configs` - # @return [::Gapic::Config::Method] - # - attr_reader :list_resource_value_configs - ## - # RPC-specific configuration for `update_resource_value_config` - # @return [::Gapic::Config::Method] - # - attr_reader :update_resource_value_config - ## - # RPC-specific configuration for `list_valued_resources` - # @return [::Gapic::Config::Method] - # - attr_reader :list_valued_resources - ## - # RPC-specific configuration for `list_attack_paths` - # @return [::Gapic::Config::Method] - # - attr_reader :list_attack_paths - - # @private - def initialize parent_rpcs = nil - bulk_mute_findings_config = parent_rpcs.bulk_mute_findings if parent_rpcs.respond_to? :bulk_mute_findings - @bulk_mute_findings = ::Gapic::Config::Method.new bulk_mute_findings_config - create_security_health_analytics_custom_module_config = parent_rpcs.create_security_health_analytics_custom_module if parent_rpcs.respond_to? :create_security_health_analytics_custom_module - @create_security_health_analytics_custom_module = ::Gapic::Config::Method.new create_security_health_analytics_custom_module_config - create_source_config = parent_rpcs.create_source if parent_rpcs.respond_to? :create_source - @create_source = ::Gapic::Config::Method.new create_source_config - create_finding_config = parent_rpcs.create_finding if parent_rpcs.respond_to? :create_finding - @create_finding = ::Gapic::Config::Method.new create_finding_config - create_mute_config_config = parent_rpcs.create_mute_config if parent_rpcs.respond_to? :create_mute_config - @create_mute_config = ::Gapic::Config::Method.new create_mute_config_config - create_notification_config_config = parent_rpcs.create_notification_config if parent_rpcs.respond_to? :create_notification_config - @create_notification_config = ::Gapic::Config::Method.new create_notification_config_config - delete_mute_config_config = parent_rpcs.delete_mute_config if parent_rpcs.respond_to? :delete_mute_config - @delete_mute_config = ::Gapic::Config::Method.new delete_mute_config_config - delete_notification_config_config = parent_rpcs.delete_notification_config if parent_rpcs.respond_to? :delete_notification_config - @delete_notification_config = ::Gapic::Config::Method.new delete_notification_config_config - delete_security_health_analytics_custom_module_config = parent_rpcs.delete_security_health_analytics_custom_module if parent_rpcs.respond_to? :delete_security_health_analytics_custom_module - @delete_security_health_analytics_custom_module = ::Gapic::Config::Method.new delete_security_health_analytics_custom_module_config - get_simulation_config = parent_rpcs.get_simulation if parent_rpcs.respond_to? :get_simulation - @get_simulation = ::Gapic::Config::Method.new get_simulation_config - get_valued_resource_config = parent_rpcs.get_valued_resource if parent_rpcs.respond_to? :get_valued_resource - @get_valued_resource = ::Gapic::Config::Method.new get_valued_resource_config - get_big_query_export_config = parent_rpcs.get_big_query_export if parent_rpcs.respond_to? :get_big_query_export - @get_big_query_export = ::Gapic::Config::Method.new get_big_query_export_config - get_iam_policy_config = parent_rpcs.get_iam_policy if parent_rpcs.respond_to? :get_iam_policy - @get_iam_policy = ::Gapic::Config::Method.new get_iam_policy_config - get_mute_config_config = parent_rpcs.get_mute_config if parent_rpcs.respond_to? :get_mute_config - @get_mute_config = ::Gapic::Config::Method.new get_mute_config_config - get_notification_config_config = parent_rpcs.get_notification_config if parent_rpcs.respond_to? :get_notification_config - @get_notification_config = ::Gapic::Config::Method.new get_notification_config_config - get_organization_settings_config = parent_rpcs.get_organization_settings if parent_rpcs.respond_to? :get_organization_settings - @get_organization_settings = ::Gapic::Config::Method.new get_organization_settings_config - get_effective_security_health_analytics_custom_module_config = parent_rpcs.get_effective_security_health_analytics_custom_module if parent_rpcs.respond_to? :get_effective_security_health_analytics_custom_module - @get_effective_security_health_analytics_custom_module = ::Gapic::Config::Method.new get_effective_security_health_analytics_custom_module_config - get_security_health_analytics_custom_module_config = parent_rpcs.get_security_health_analytics_custom_module if parent_rpcs.respond_to? :get_security_health_analytics_custom_module - @get_security_health_analytics_custom_module = ::Gapic::Config::Method.new get_security_health_analytics_custom_module_config - get_source_config = parent_rpcs.get_source if parent_rpcs.respond_to? :get_source - @get_source = ::Gapic::Config::Method.new get_source_config - group_assets_config = parent_rpcs.group_assets if parent_rpcs.respond_to? :group_assets - @group_assets = ::Gapic::Config::Method.new group_assets_config - group_findings_config = parent_rpcs.group_findings if parent_rpcs.respond_to? :group_findings - @group_findings = ::Gapic::Config::Method.new group_findings_config - list_assets_config = parent_rpcs.list_assets if parent_rpcs.respond_to? :list_assets - @list_assets = ::Gapic::Config::Method.new list_assets_config - list_descendant_security_health_analytics_custom_modules_config = parent_rpcs.list_descendant_security_health_analytics_custom_modules if parent_rpcs.respond_to? :list_descendant_security_health_analytics_custom_modules - @list_descendant_security_health_analytics_custom_modules = ::Gapic::Config::Method.new list_descendant_security_health_analytics_custom_modules_config - list_findings_config = parent_rpcs.list_findings if parent_rpcs.respond_to? :list_findings - @list_findings = ::Gapic::Config::Method.new list_findings_config - list_mute_configs_config = parent_rpcs.list_mute_configs if parent_rpcs.respond_to? :list_mute_configs - @list_mute_configs = ::Gapic::Config::Method.new list_mute_configs_config - list_notification_configs_config = parent_rpcs.list_notification_configs if parent_rpcs.respond_to? :list_notification_configs - @list_notification_configs = ::Gapic::Config::Method.new list_notification_configs_config - list_effective_security_health_analytics_custom_modules_config = parent_rpcs.list_effective_security_health_analytics_custom_modules if parent_rpcs.respond_to? :list_effective_security_health_analytics_custom_modules - @list_effective_security_health_analytics_custom_modules = ::Gapic::Config::Method.new list_effective_security_health_analytics_custom_modules_config - list_security_health_analytics_custom_modules_config = parent_rpcs.list_security_health_analytics_custom_modules if parent_rpcs.respond_to? :list_security_health_analytics_custom_modules - @list_security_health_analytics_custom_modules = ::Gapic::Config::Method.new list_security_health_analytics_custom_modules_config - list_sources_config = parent_rpcs.list_sources if parent_rpcs.respond_to? :list_sources - @list_sources = ::Gapic::Config::Method.new list_sources_config - run_asset_discovery_config = parent_rpcs.run_asset_discovery if parent_rpcs.respond_to? :run_asset_discovery - @run_asset_discovery = ::Gapic::Config::Method.new run_asset_discovery_config - set_finding_state_config = parent_rpcs.set_finding_state if parent_rpcs.respond_to? :set_finding_state - @set_finding_state = ::Gapic::Config::Method.new set_finding_state_config - set_mute_config = parent_rpcs.set_mute if parent_rpcs.respond_to? :set_mute - @set_mute = ::Gapic::Config::Method.new set_mute_config - set_iam_policy_config = parent_rpcs.set_iam_policy if parent_rpcs.respond_to? :set_iam_policy - @set_iam_policy = ::Gapic::Config::Method.new set_iam_policy_config - test_iam_permissions_config = parent_rpcs.test_iam_permissions if parent_rpcs.respond_to? :test_iam_permissions - @test_iam_permissions = ::Gapic::Config::Method.new test_iam_permissions_config - simulate_security_health_analytics_custom_module_config = parent_rpcs.simulate_security_health_analytics_custom_module if parent_rpcs.respond_to? :simulate_security_health_analytics_custom_module - @simulate_security_health_analytics_custom_module = ::Gapic::Config::Method.new simulate_security_health_analytics_custom_module_config - update_external_system_config = parent_rpcs.update_external_system if parent_rpcs.respond_to? :update_external_system - @update_external_system = ::Gapic::Config::Method.new update_external_system_config - update_finding_config = parent_rpcs.update_finding if parent_rpcs.respond_to? :update_finding - @update_finding = ::Gapic::Config::Method.new update_finding_config - update_mute_config_config = parent_rpcs.update_mute_config if parent_rpcs.respond_to? :update_mute_config - @update_mute_config = ::Gapic::Config::Method.new update_mute_config_config - update_notification_config_config = parent_rpcs.update_notification_config if parent_rpcs.respond_to? :update_notification_config - @update_notification_config = ::Gapic::Config::Method.new update_notification_config_config - update_organization_settings_config = parent_rpcs.update_organization_settings if parent_rpcs.respond_to? :update_organization_settings - @update_organization_settings = ::Gapic::Config::Method.new update_organization_settings_config - update_security_health_analytics_custom_module_config = parent_rpcs.update_security_health_analytics_custom_module if parent_rpcs.respond_to? :update_security_health_analytics_custom_module - @update_security_health_analytics_custom_module = ::Gapic::Config::Method.new update_security_health_analytics_custom_module_config - update_source_config = parent_rpcs.update_source if parent_rpcs.respond_to? :update_source - @update_source = ::Gapic::Config::Method.new update_source_config - update_security_marks_config = parent_rpcs.update_security_marks if parent_rpcs.respond_to? :update_security_marks - @update_security_marks = ::Gapic::Config::Method.new update_security_marks_config - create_big_query_export_config = parent_rpcs.create_big_query_export if parent_rpcs.respond_to? :create_big_query_export - @create_big_query_export = ::Gapic::Config::Method.new create_big_query_export_config - delete_big_query_export_config = parent_rpcs.delete_big_query_export if parent_rpcs.respond_to? :delete_big_query_export - @delete_big_query_export = ::Gapic::Config::Method.new delete_big_query_export_config - update_big_query_export_config = parent_rpcs.update_big_query_export if parent_rpcs.respond_to? :update_big_query_export - @update_big_query_export = ::Gapic::Config::Method.new update_big_query_export_config - list_big_query_exports_config = parent_rpcs.list_big_query_exports if parent_rpcs.respond_to? :list_big_query_exports - @list_big_query_exports = ::Gapic::Config::Method.new list_big_query_exports_config - create_event_threat_detection_custom_module_config = parent_rpcs.create_event_threat_detection_custom_module if parent_rpcs.respond_to? :create_event_threat_detection_custom_module - @create_event_threat_detection_custom_module = ::Gapic::Config::Method.new create_event_threat_detection_custom_module_config - delete_event_threat_detection_custom_module_config = parent_rpcs.delete_event_threat_detection_custom_module if parent_rpcs.respond_to? :delete_event_threat_detection_custom_module - @delete_event_threat_detection_custom_module = ::Gapic::Config::Method.new delete_event_threat_detection_custom_module_config - get_event_threat_detection_custom_module_config = parent_rpcs.get_event_threat_detection_custom_module if parent_rpcs.respond_to? :get_event_threat_detection_custom_module - @get_event_threat_detection_custom_module = ::Gapic::Config::Method.new get_event_threat_detection_custom_module_config - list_descendant_event_threat_detection_custom_modules_config = parent_rpcs.list_descendant_event_threat_detection_custom_modules if parent_rpcs.respond_to? :list_descendant_event_threat_detection_custom_modules - @list_descendant_event_threat_detection_custom_modules = ::Gapic::Config::Method.new list_descendant_event_threat_detection_custom_modules_config - list_event_threat_detection_custom_modules_config = parent_rpcs.list_event_threat_detection_custom_modules if parent_rpcs.respond_to? :list_event_threat_detection_custom_modules - @list_event_threat_detection_custom_modules = ::Gapic::Config::Method.new list_event_threat_detection_custom_modules_config - update_event_threat_detection_custom_module_config = parent_rpcs.update_event_threat_detection_custom_module if parent_rpcs.respond_to? :update_event_threat_detection_custom_module - @update_event_threat_detection_custom_module = ::Gapic::Config::Method.new update_event_threat_detection_custom_module_config - validate_event_threat_detection_custom_module_config = parent_rpcs.validate_event_threat_detection_custom_module if parent_rpcs.respond_to? :validate_event_threat_detection_custom_module - @validate_event_threat_detection_custom_module = ::Gapic::Config::Method.new validate_event_threat_detection_custom_module_config - get_effective_event_threat_detection_custom_module_config = parent_rpcs.get_effective_event_threat_detection_custom_module if parent_rpcs.respond_to? :get_effective_event_threat_detection_custom_module - @get_effective_event_threat_detection_custom_module = ::Gapic::Config::Method.new get_effective_event_threat_detection_custom_module_config - list_effective_event_threat_detection_custom_modules_config = parent_rpcs.list_effective_event_threat_detection_custom_modules if parent_rpcs.respond_to? :list_effective_event_threat_detection_custom_modules - @list_effective_event_threat_detection_custom_modules = ::Gapic::Config::Method.new list_effective_event_threat_detection_custom_modules_config - batch_create_resource_value_configs_config = parent_rpcs.batch_create_resource_value_configs if parent_rpcs.respond_to? :batch_create_resource_value_configs - @batch_create_resource_value_configs = ::Gapic::Config::Method.new batch_create_resource_value_configs_config - delete_resource_value_config_config = parent_rpcs.delete_resource_value_config if parent_rpcs.respond_to? :delete_resource_value_config - @delete_resource_value_config = ::Gapic::Config::Method.new delete_resource_value_config_config - get_resource_value_config_config = parent_rpcs.get_resource_value_config if parent_rpcs.respond_to? :get_resource_value_config - @get_resource_value_config = ::Gapic::Config::Method.new get_resource_value_config_config - list_resource_value_configs_config = parent_rpcs.list_resource_value_configs if parent_rpcs.respond_to? :list_resource_value_configs - @list_resource_value_configs = ::Gapic::Config::Method.new list_resource_value_configs_config - update_resource_value_config_config = parent_rpcs.update_resource_value_config if parent_rpcs.respond_to? :update_resource_value_config - @update_resource_value_config = ::Gapic::Config::Method.new update_resource_value_config_config - list_valued_resources_config = parent_rpcs.list_valued_resources if parent_rpcs.respond_to? :list_valued_resources - @list_valued_resources = ::Gapic::Config::Method.new list_valued_resources_config - list_attack_paths_config = parent_rpcs.list_attack_paths if parent_rpcs.respond_to? :list_attack_paths - @list_attack_paths = ::Gapic::Config::Method.new list_attack_paths_config - - yield self if block_given? - end - end - end - end - end - end - end - end - end -end diff --git a/owl-bot-staging/google-cloud-security_center-v1/lib/google/cloud/security_center/v1/security_center/rest/operations.rb b/owl-bot-staging/google-cloud-security_center-v1/lib/google/cloud/security_center/v1/security_center/rest/operations.rb deleted file mode 100644 index 800790c23351..000000000000 --- a/owl-bot-staging/google-cloud-security_center-v1/lib/google/cloud/security_center/v1/security_center/rest/operations.rb +++ /dev/null @@ -1,924 +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 Cloud - module SecurityCenter - module V1 - module SecurityCenter - module Rest - # Service that implements Longrunning Operations API. - class Operations - # @private - API_VERSION = "" - - # @private - DEFAULT_ENDPOINT_TEMPLATE = "securitycenter.$UNIVERSE_DOMAIN$" - - # @private - attr_reader :operations_stub - - ## - # Configuration for the SecurityCenter 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 SecurityCenter 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::SecurityCenter::V1::VERSION, - transports_version_send: [:rest] - - call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - options.apply_defaults timeout: @config.rpcs.list_operations.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.list_operations.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @operations_stub.list_operations request, options do |result, operation| - result = ::Gapic::Rest::PagedEnumerable.new @operations_stub, :list_operations, "operations", request, result, options - yield result, operation if block_given? - 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::SecurityCenter::V1::VERSION, - transports_version_send: [:rest] - - call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - options.apply_defaults timeout: @config.rpcs.get_operation.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.get_operation.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @operations_stub.get_operation request, options do |result, operation| - result = ::Gapic::Operation.new result, @operations_client, options: options - yield result, operation if block_given? - 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::SecurityCenter::V1::VERSION, - transports_version_send: [:rest] - - call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - options.apply_defaults timeout: @config.rpcs.delete_operation.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.delete_operation.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @operations_stub.delete_operation request, options do |result, operation| - yield result, operation if block_given? - 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::SecurityCenter::V1::VERSION, - transports_version_send: [:rest] - - call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - options.apply_defaults timeout: @config.rpcs.cancel_operation.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.cancel_operation.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @operations_stub.cancel_operation request, options do |result, operation| - yield result, operation if block_given? - 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 = "securitycenter.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{^organizations/[^/]+/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: "/v1/{name}", - matches: [ - ["name", %r{^organizations/[^/]+/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{^organizations/[^/]+/operations/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the cancel_operation REST call - # - # @param request_pb [::Google::Longrunning::CancelOperationRequest] - # A request object representing the call parameters. Required. - # @return [Array(String, [String, nil], Hash{String => String})] - # Uri, Body, Query string parameters - def self.transcode_cancel_operation_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :post, - uri_template: "/v1/{name}:cancel", - matches: [ - ["name", %r{^organizations/[^/]+/operations/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - end - end - end - end - end - end -end diff --git a/owl-bot-staging/google-cloud-security_center-v1/lib/google/cloud/security_center/v1/security_center/rest/service_stub.rb b/owl-bot-staging/google-cloud-security_center-v1/lib/google/cloud/security_center/v1/security_center/rest/service_stub.rb deleted file mode 100644 index 6b84754bb951..000000000000 --- a/owl-bot-staging/google-cloud-security_center-v1/lib/google/cloud/security_center/v1/security_center/rest/service_stub.rb +++ /dev/null @@ -1,4766 +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/securitycenter/v1/securitycenter_service_pb" - -module Google - module Cloud - module SecurityCenter - module V1 - module SecurityCenter - module Rest - ## - # REST service stub for the SecurityCenter 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 bulk_mute_findings REST call - # - # @param request_pb [::Google::Cloud::SecurityCenter::V1::BulkMuteFindingsRequest] - # 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 bulk_mute_findings request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_bulk_mute_findings_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: "bulk_mute_findings", - 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 create_security_health_analytics_custom_module REST call - # - # @param request_pb [::Google::Cloud::SecurityCenter::V1::CreateSecurityHealthAnalyticsCustomModuleRequest] - # A request object representing the call parameters. Required. - # @param options [::Gapic::CallOptions] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Cloud::SecurityCenter::V1::SecurityHealthAnalyticsCustomModule] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::SecurityCenter::V1::SecurityHealthAnalyticsCustomModule] - # A result object deserialized from the server's reply - def create_security_health_analytics_custom_module request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_create_security_health_analytics_custom_module_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_security_health_analytics_custom_module", - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Cloud::SecurityCenter::V1::SecurityHealthAnalyticsCustomModule.decode_json response.body, ignore_unknown_fields: true - catch :response do - yield result, operation if block_given? - result - end - end - - ## - # Baseline implementation for the create_source REST call - # - # @param request_pb [::Google::Cloud::SecurityCenter::V1::CreateSourceRequest] - # A request object representing the call parameters. Required. - # @param options [::Gapic::CallOptions] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Cloud::SecurityCenter::V1::Source] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::SecurityCenter::V1::Source] - # A result object deserialized from the server's reply - def create_source request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_create_source_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_source", - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Cloud::SecurityCenter::V1::Source.decode_json response.body, ignore_unknown_fields: true - catch :response do - yield result, operation if block_given? - result - end - end - - ## - # Baseline implementation for the create_finding REST call - # - # @param request_pb [::Google::Cloud::SecurityCenter::V1::CreateFindingRequest] - # A request object representing the call parameters. Required. - # @param options [::Gapic::CallOptions] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Cloud::SecurityCenter::V1::Finding] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::SecurityCenter::V1::Finding] - # A result object deserialized from the server's reply - def create_finding request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_create_finding_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_finding", - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Cloud::SecurityCenter::V1::Finding.decode_json response.body, ignore_unknown_fields: true - catch :response do - yield result, operation if block_given? - result - end - end - - ## - # Baseline implementation for the create_mute_config REST call - # - # @param request_pb [::Google::Cloud::SecurityCenter::V1::CreateMuteConfigRequest] - # A request object representing the call parameters. Required. - # @param options [::Gapic::CallOptions] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Cloud::SecurityCenter::V1::MuteConfig] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::SecurityCenter::V1::MuteConfig] - # A result object deserialized from the server's reply - def create_mute_config request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_create_mute_config_request request_pb - query_string_params = if query_string_params.any? - query_string_params.to_h { |p| p.split "=", 2 } - else - {} - end - - response = @client_stub.make_http_request( - verb, - uri: uri, - body: body || "", - params: query_string_params, - method_name: "create_mute_config", - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Cloud::SecurityCenter::V1::MuteConfig.decode_json response.body, ignore_unknown_fields: true - catch :response do - yield result, operation if block_given? - result - end - end - - ## - # Baseline implementation for the create_notification_config REST call - # - # @param request_pb [::Google::Cloud::SecurityCenter::V1::CreateNotificationConfigRequest] - # A request object representing the call parameters. Required. - # @param options [::Gapic::CallOptions] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Cloud::SecurityCenter::V1::NotificationConfig] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::SecurityCenter::V1::NotificationConfig] - # A result object deserialized from the server's reply - def create_notification_config request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_create_notification_config_request request_pb - query_string_params = if query_string_params.any? - query_string_params.to_h { |p| p.split "=", 2 } - else - {} - end - - response = @client_stub.make_http_request( - verb, - uri: uri, - body: body || "", - params: query_string_params, - method_name: "create_notification_config", - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Cloud::SecurityCenter::V1::NotificationConfig.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_mute_config REST call - # - # @param request_pb [::Google::Cloud::SecurityCenter::V1::DeleteMuteConfigRequest] - # 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_mute_config request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_delete_mute_config_request request_pb - query_string_params = if query_string_params.any? - query_string_params.to_h { |p| p.split "=", 2 } - else - {} - end - - response = @client_stub.make_http_request( - verb, - uri: uri, - body: body || "", - params: query_string_params, - method_name: "delete_mute_config", - 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 delete_notification_config REST call - # - # @param request_pb [::Google::Cloud::SecurityCenter::V1::DeleteNotificationConfigRequest] - # 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_notification_config request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_delete_notification_config_request request_pb - query_string_params = if query_string_params.any? - query_string_params.to_h { |p| p.split "=", 2 } - else - {} - end - - response = @client_stub.make_http_request( - verb, - uri: uri, - body: body || "", - params: query_string_params, - method_name: "delete_notification_config", - 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 delete_security_health_analytics_custom_module REST call - # - # @param request_pb [::Google::Cloud::SecurityCenter::V1::DeleteSecurityHealthAnalyticsCustomModuleRequest] - # 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_security_health_analytics_custom_module request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_delete_security_health_analytics_custom_module_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_security_health_analytics_custom_module", - 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 get_simulation REST call - # - # @param request_pb [::Google::Cloud::SecurityCenter::V1::GetSimulationRequest] - # A request object representing the call parameters. Required. - # @param options [::Gapic::CallOptions] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Cloud::SecurityCenter::V1::Simulation] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::SecurityCenter::V1::Simulation] - # A result object deserialized from the server's reply - def get_simulation request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_get_simulation_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_simulation", - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Cloud::SecurityCenter::V1::Simulation.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_valued_resource REST call - # - # @param request_pb [::Google::Cloud::SecurityCenter::V1::GetValuedResourceRequest] - # A request object representing the call parameters. Required. - # @param options [::Gapic::CallOptions] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Cloud::SecurityCenter::V1::ValuedResource] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::SecurityCenter::V1::ValuedResource] - # A result object deserialized from the server's reply - def get_valued_resource request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_get_valued_resource_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_valued_resource", - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Cloud::SecurityCenter::V1::ValuedResource.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_big_query_export REST call - # - # @param request_pb [::Google::Cloud::SecurityCenter::V1::GetBigQueryExportRequest] - # A request object representing the call parameters. Required. - # @param options [::Gapic::CallOptions] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Cloud::SecurityCenter::V1::BigQueryExport] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::SecurityCenter::V1::BigQueryExport] - # A result object deserialized from the server's reply - def get_big_query_export request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_get_big_query_export_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_big_query_export", - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Cloud::SecurityCenter::V1::BigQueryExport.decode_json response.body, ignore_unknown_fields: true - catch :response do - yield result, operation if block_given? - result - end - end - - ## - # Baseline implementation for the get_iam_policy REST call - # - # @param request_pb [::Google::Iam::V1::GetIamPolicyRequest] - # A request object representing the call parameters. Required. - # @param options [::Gapic::CallOptions] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Iam::V1::Policy] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Iam::V1::Policy] - # A result object deserialized from the server's reply - def get_iam_policy request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_get_iam_policy_request request_pb - query_string_params = if query_string_params.any? - query_string_params.to_h { |p| p.split "=", 2 } - else - {} - end - - response = @client_stub.make_http_request( - verb, - uri: uri, - body: body || "", - params: query_string_params, - method_name: "get_iam_policy", - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Iam::V1::Policy.decode_json response.body, ignore_unknown_fields: true - catch :response do - yield result, operation if block_given? - result - end - end - - ## - # Baseline implementation for the get_mute_config REST call - # - # @param request_pb [::Google::Cloud::SecurityCenter::V1::GetMuteConfigRequest] - # A request object representing the call parameters. Required. - # @param options [::Gapic::CallOptions] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Cloud::SecurityCenter::V1::MuteConfig] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::SecurityCenter::V1::MuteConfig] - # A result object deserialized from the server's reply - def get_mute_config request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_get_mute_config_request request_pb - query_string_params = if query_string_params.any? - query_string_params.to_h { |p| p.split "=", 2 } - else - {} - end - - response = @client_stub.make_http_request( - verb, - uri: uri, - body: body || "", - params: query_string_params, - method_name: "get_mute_config", - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Cloud::SecurityCenter::V1::MuteConfig.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_notification_config REST call - # - # @param request_pb [::Google::Cloud::SecurityCenter::V1::GetNotificationConfigRequest] - # A request object representing the call parameters. Required. - # @param options [::Gapic::CallOptions] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Cloud::SecurityCenter::V1::NotificationConfig] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::SecurityCenter::V1::NotificationConfig] - # A result object deserialized from the server's reply - def get_notification_config request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_get_notification_config_request request_pb - query_string_params = if query_string_params.any? - query_string_params.to_h { |p| p.split "=", 2 } - else - {} - end - - response = @client_stub.make_http_request( - verb, - uri: uri, - body: body || "", - params: query_string_params, - method_name: "get_notification_config", - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Cloud::SecurityCenter::V1::NotificationConfig.decode_json response.body, ignore_unknown_fields: true - catch :response do - yield result, operation if block_given? - result - end - end - - ## - # Baseline implementation for the get_organization_settings REST call - # - # @param request_pb [::Google::Cloud::SecurityCenter::V1::GetOrganizationSettingsRequest] - # A request object representing the call parameters. Required. - # @param options [::Gapic::CallOptions] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Cloud::SecurityCenter::V1::OrganizationSettings] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::SecurityCenter::V1::OrganizationSettings] - # A result object deserialized from the server's reply - def get_organization_settings request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_get_organization_settings_request request_pb - query_string_params = if query_string_params.any? - query_string_params.to_h { |p| p.split "=", 2 } - else - {} - end - - response = @client_stub.make_http_request( - verb, - uri: uri, - body: body || "", - params: query_string_params, - method_name: "get_organization_settings", - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Cloud::SecurityCenter::V1::OrganizationSettings.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_effective_security_health_analytics_custom_module REST call - # - # @param request_pb [::Google::Cloud::SecurityCenter::V1::GetEffectiveSecurityHealthAnalyticsCustomModuleRequest] - # A request object representing the call parameters. Required. - # @param options [::Gapic::CallOptions] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Cloud::SecurityCenter::V1::EffectiveSecurityHealthAnalyticsCustomModule] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::SecurityCenter::V1::EffectiveSecurityHealthAnalyticsCustomModule] - # A result object deserialized from the server's reply - def get_effective_security_health_analytics_custom_module request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_get_effective_security_health_analytics_custom_module_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_effective_security_health_analytics_custom_module", - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Cloud::SecurityCenter::V1::EffectiveSecurityHealthAnalyticsCustomModule.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_security_health_analytics_custom_module REST call - # - # @param request_pb [::Google::Cloud::SecurityCenter::V1::GetSecurityHealthAnalyticsCustomModuleRequest] - # A request object representing the call parameters. Required. - # @param options [::Gapic::CallOptions] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Cloud::SecurityCenter::V1::SecurityHealthAnalyticsCustomModule] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::SecurityCenter::V1::SecurityHealthAnalyticsCustomModule] - # A result object deserialized from the server's reply - def get_security_health_analytics_custom_module request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_get_security_health_analytics_custom_module_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_security_health_analytics_custom_module", - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Cloud::SecurityCenter::V1::SecurityHealthAnalyticsCustomModule.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_source REST call - # - # @param request_pb [::Google::Cloud::SecurityCenter::V1::GetSourceRequest] - # A request object representing the call parameters. Required. - # @param options [::Gapic::CallOptions] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Cloud::SecurityCenter::V1::Source] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::SecurityCenter::V1::Source] - # A result object deserialized from the server's reply - def get_source request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_get_source_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_source", - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Cloud::SecurityCenter::V1::Source.decode_json response.body, ignore_unknown_fields: true - catch :response do - yield result, operation if block_given? - result - end - end - - ## - # Baseline implementation for the group_assets REST call - # - # @param request_pb [::Google::Cloud::SecurityCenter::V1::GroupAssetsRequest] - # A request object representing the call parameters. Required. - # @param options [::Gapic::CallOptions] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Cloud::SecurityCenter::V1::GroupAssetsResponse] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::SecurityCenter::V1::GroupAssetsResponse] - # A result object deserialized from the server's reply - def group_assets request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_group_assets_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: "group_assets", - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Cloud::SecurityCenter::V1::GroupAssetsResponse.decode_json response.body, ignore_unknown_fields: true - catch :response do - yield result, operation if block_given? - result - end - end - - ## - # Baseline implementation for the group_findings REST call - # - # @param request_pb [::Google::Cloud::SecurityCenter::V1::GroupFindingsRequest] - # A request object representing the call parameters. Required. - # @param options [::Gapic::CallOptions] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Cloud::SecurityCenter::V1::GroupFindingsResponse] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::SecurityCenter::V1::GroupFindingsResponse] - # A result object deserialized from the server's reply - def group_findings request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_group_findings_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: "group_findings", - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Cloud::SecurityCenter::V1::GroupFindingsResponse.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_assets REST call - # - # @param request_pb [::Google::Cloud::SecurityCenter::V1::ListAssetsRequest] - # A request object representing the call parameters. Required. - # @param options [::Gapic::CallOptions] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Cloud::SecurityCenter::V1::ListAssetsResponse] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::SecurityCenter::V1::ListAssetsResponse] - # A result object deserialized from the server's reply - def list_assets request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_list_assets_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_assets", - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Cloud::SecurityCenter::V1::ListAssetsResponse.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_descendant_security_health_analytics_custom_modules REST call - # - # @param request_pb [::Google::Cloud::SecurityCenter::V1::ListDescendantSecurityHealthAnalyticsCustomModulesRequest] - # A request object representing the call parameters. Required. - # @param options [::Gapic::CallOptions] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Cloud::SecurityCenter::V1::ListDescendantSecurityHealthAnalyticsCustomModulesResponse] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::SecurityCenter::V1::ListDescendantSecurityHealthAnalyticsCustomModulesResponse] - # A result object deserialized from the server's reply - def list_descendant_security_health_analytics_custom_modules request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_list_descendant_security_health_analytics_custom_modules_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_descendant_security_health_analytics_custom_modules", - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Cloud::SecurityCenter::V1::ListDescendantSecurityHealthAnalyticsCustomModulesResponse.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_findings REST call - # - # @param request_pb [::Google::Cloud::SecurityCenter::V1::ListFindingsRequest] - # A request object representing the call parameters. Required. - # @param options [::Gapic::CallOptions] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Cloud::SecurityCenter::V1::ListFindingsResponse] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::SecurityCenter::V1::ListFindingsResponse] - # A result object deserialized from the server's reply - def list_findings request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_list_findings_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_findings", - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Cloud::SecurityCenter::V1::ListFindingsResponse.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_mute_configs REST call - # - # @param request_pb [::Google::Cloud::SecurityCenter::V1::ListMuteConfigsRequest] - # A request object representing the call parameters. Required. - # @param options [::Gapic::CallOptions] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Cloud::SecurityCenter::V1::ListMuteConfigsResponse] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::SecurityCenter::V1::ListMuteConfigsResponse] - # A result object deserialized from the server's reply - def list_mute_configs request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_list_mute_configs_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_mute_configs", - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Cloud::SecurityCenter::V1::ListMuteConfigsResponse.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_notification_configs REST call - # - # @param request_pb [::Google::Cloud::SecurityCenter::V1::ListNotificationConfigsRequest] - # A request object representing the call parameters. Required. - # @param options [::Gapic::CallOptions] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Cloud::SecurityCenter::V1::ListNotificationConfigsResponse] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::SecurityCenter::V1::ListNotificationConfigsResponse] - # A result object deserialized from the server's reply - def list_notification_configs request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_list_notification_configs_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_notification_configs", - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Cloud::SecurityCenter::V1::ListNotificationConfigsResponse.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_effective_security_health_analytics_custom_modules REST call - # - # @param request_pb [::Google::Cloud::SecurityCenter::V1::ListEffectiveSecurityHealthAnalyticsCustomModulesRequest] - # A request object representing the call parameters. Required. - # @param options [::Gapic::CallOptions] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Cloud::SecurityCenter::V1::ListEffectiveSecurityHealthAnalyticsCustomModulesResponse] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::SecurityCenter::V1::ListEffectiveSecurityHealthAnalyticsCustomModulesResponse] - # A result object deserialized from the server's reply - def list_effective_security_health_analytics_custom_modules request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_list_effective_security_health_analytics_custom_modules_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_effective_security_health_analytics_custom_modules", - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Cloud::SecurityCenter::V1::ListEffectiveSecurityHealthAnalyticsCustomModulesResponse.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_security_health_analytics_custom_modules REST call - # - # @param request_pb [::Google::Cloud::SecurityCenter::V1::ListSecurityHealthAnalyticsCustomModulesRequest] - # A request object representing the call parameters. Required. - # @param options [::Gapic::CallOptions] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Cloud::SecurityCenter::V1::ListSecurityHealthAnalyticsCustomModulesResponse] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::SecurityCenter::V1::ListSecurityHealthAnalyticsCustomModulesResponse] - # A result object deserialized from the server's reply - def list_security_health_analytics_custom_modules request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_list_security_health_analytics_custom_modules_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_security_health_analytics_custom_modules", - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Cloud::SecurityCenter::V1::ListSecurityHealthAnalyticsCustomModulesResponse.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_sources REST call - # - # @param request_pb [::Google::Cloud::SecurityCenter::V1::ListSourcesRequest] - # A request object representing the call parameters. Required. - # @param options [::Gapic::CallOptions] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Cloud::SecurityCenter::V1::ListSourcesResponse] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::SecurityCenter::V1::ListSourcesResponse] - # A result object deserialized from the server's reply - def list_sources request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_list_sources_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_sources", - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Cloud::SecurityCenter::V1::ListSourcesResponse.decode_json response.body, ignore_unknown_fields: true - catch :response do - yield result, operation if block_given? - result - end - end - - ## - # Baseline implementation for the run_asset_discovery REST call - # - # @param request_pb [::Google::Cloud::SecurityCenter::V1::RunAssetDiscoveryRequest] - # 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 run_asset_discovery request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_run_asset_discovery_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: "run_asset_discovery", - 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 set_finding_state REST call - # - # @param request_pb [::Google::Cloud::SecurityCenter::V1::SetFindingStateRequest] - # A request object representing the call parameters. Required. - # @param options [::Gapic::CallOptions] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Cloud::SecurityCenter::V1::Finding] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::SecurityCenter::V1::Finding] - # A result object deserialized from the server's reply - def set_finding_state request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_set_finding_state_request request_pb - query_string_params = if query_string_params.any? - query_string_params.to_h { |p| p.split "=", 2 } - else - {} - end - - response = @client_stub.make_http_request( - verb, - uri: uri, - body: body || "", - params: query_string_params, - method_name: "set_finding_state", - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Cloud::SecurityCenter::V1::Finding.decode_json response.body, ignore_unknown_fields: true - catch :response do - yield result, operation if block_given? - result - end - end - - ## - # Baseline implementation for the set_mute REST call - # - # @param request_pb [::Google::Cloud::SecurityCenter::V1::SetMuteRequest] - # A request object representing the call parameters. Required. - # @param options [::Gapic::CallOptions] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Cloud::SecurityCenter::V1::Finding] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::SecurityCenter::V1::Finding] - # A result object deserialized from the server's reply - def set_mute request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_set_mute_request request_pb - query_string_params = if query_string_params.any? - query_string_params.to_h { |p| p.split "=", 2 } - else - {} - end - - response = @client_stub.make_http_request( - verb, - uri: uri, - body: body || "", - params: query_string_params, - method_name: "set_mute", - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Cloud::SecurityCenter::V1::Finding.decode_json response.body, ignore_unknown_fields: true - catch :response do - yield result, operation if block_given? - result - end - end - - ## - # Baseline implementation for the set_iam_policy REST call - # - # @param request_pb [::Google::Iam::V1::SetIamPolicyRequest] - # A request object representing the call parameters. Required. - # @param options [::Gapic::CallOptions] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Iam::V1::Policy] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Iam::V1::Policy] - # A result object deserialized from the server's reply - def set_iam_policy request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_set_iam_policy_request request_pb - query_string_params = if query_string_params.any? - query_string_params.to_h { |p| p.split "=", 2 } - else - {} - end - - response = @client_stub.make_http_request( - verb, - uri: uri, - body: body || "", - params: query_string_params, - method_name: "set_iam_policy", - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Iam::V1::Policy.decode_json response.body, ignore_unknown_fields: true - catch :response do - yield result, operation if block_given? - result - end - end - - ## - # Baseline implementation for the test_iam_permissions REST call - # - # @param request_pb [::Google::Iam::V1::TestIamPermissionsRequest] - # A request object representing the call parameters. Required. - # @param options [::Gapic::CallOptions] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Iam::V1::TestIamPermissionsResponse] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Iam::V1::TestIamPermissionsResponse] - # A result object deserialized from the server's reply - def test_iam_permissions request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_test_iam_permissions_request request_pb - query_string_params = if query_string_params.any? - query_string_params.to_h { |p| p.split "=", 2 } - else - {} - end - - response = @client_stub.make_http_request( - verb, - uri: uri, - body: body || "", - params: query_string_params, - method_name: "test_iam_permissions", - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Iam::V1::TestIamPermissionsResponse.decode_json response.body, ignore_unknown_fields: true - catch :response do - yield result, operation if block_given? - result - end - end - - ## - # Baseline implementation for the simulate_security_health_analytics_custom_module REST call - # - # @param request_pb [::Google::Cloud::SecurityCenter::V1::SimulateSecurityHealthAnalyticsCustomModuleRequest] - # A request object representing the call parameters. Required. - # @param options [::Gapic::CallOptions] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Cloud::SecurityCenter::V1::SimulateSecurityHealthAnalyticsCustomModuleResponse] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::SecurityCenter::V1::SimulateSecurityHealthAnalyticsCustomModuleResponse] - # A result object deserialized from the server's reply - def simulate_security_health_analytics_custom_module request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_simulate_security_health_analytics_custom_module_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: "simulate_security_health_analytics_custom_module", - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Cloud::SecurityCenter::V1::SimulateSecurityHealthAnalyticsCustomModuleResponse.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_external_system REST call - # - # @param request_pb [::Google::Cloud::SecurityCenter::V1::UpdateExternalSystemRequest] - # A request object representing the call parameters. Required. - # @param options [::Gapic::CallOptions] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Cloud::SecurityCenter::V1::ExternalSystem] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::SecurityCenter::V1::ExternalSystem] - # A result object deserialized from the server's reply - def update_external_system request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_update_external_system_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_external_system", - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Cloud::SecurityCenter::V1::ExternalSystem.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_finding REST call - # - # @param request_pb [::Google::Cloud::SecurityCenter::V1::UpdateFindingRequest] - # A request object representing the call parameters. Required. - # @param options [::Gapic::CallOptions] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Cloud::SecurityCenter::V1::Finding] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::SecurityCenter::V1::Finding] - # A result object deserialized from the server's reply - def update_finding request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_update_finding_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_finding", - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Cloud::SecurityCenter::V1::Finding.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_mute_config REST call - # - # @param request_pb [::Google::Cloud::SecurityCenter::V1::UpdateMuteConfigRequest] - # A request object representing the call parameters. Required. - # @param options [::Gapic::CallOptions] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Cloud::SecurityCenter::V1::MuteConfig] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::SecurityCenter::V1::MuteConfig] - # A result object deserialized from the server's reply - def update_mute_config request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_update_mute_config_request request_pb - query_string_params = if query_string_params.any? - query_string_params.to_h { |p| p.split "=", 2 } - else - {} - end - - response = @client_stub.make_http_request( - verb, - uri: uri, - body: body || "", - params: query_string_params, - method_name: "update_mute_config", - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Cloud::SecurityCenter::V1::MuteConfig.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_notification_config REST call - # - # @param request_pb [::Google::Cloud::SecurityCenter::V1::UpdateNotificationConfigRequest] - # A request object representing the call parameters. Required. - # @param options [::Gapic::CallOptions] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Cloud::SecurityCenter::V1::NotificationConfig] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::SecurityCenter::V1::NotificationConfig] - # A result object deserialized from the server's reply - def update_notification_config request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_update_notification_config_request request_pb - query_string_params = if query_string_params.any? - query_string_params.to_h { |p| p.split "=", 2 } - else - {} - end - - response = @client_stub.make_http_request( - verb, - uri: uri, - body: body || "", - params: query_string_params, - method_name: "update_notification_config", - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Cloud::SecurityCenter::V1::NotificationConfig.decode_json response.body, ignore_unknown_fields: true - catch :response do - yield result, operation if block_given? - result - end - end - - ## - # Baseline implementation for the update_organization_settings REST call - # - # @param request_pb [::Google::Cloud::SecurityCenter::V1::UpdateOrganizationSettingsRequest] - # A request object representing the call parameters. Required. - # @param options [::Gapic::CallOptions] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Cloud::SecurityCenter::V1::OrganizationSettings] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::SecurityCenter::V1::OrganizationSettings] - # A result object deserialized from the server's reply - def update_organization_settings request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_update_organization_settings_request request_pb - query_string_params = if query_string_params.any? - query_string_params.to_h { |p| p.split "=", 2 } - else - {} - end - - response = @client_stub.make_http_request( - verb, - uri: uri, - body: body || "", - params: query_string_params, - method_name: "update_organization_settings", - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Cloud::SecurityCenter::V1::OrganizationSettings.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_security_health_analytics_custom_module REST call - # - # @param request_pb [::Google::Cloud::SecurityCenter::V1::UpdateSecurityHealthAnalyticsCustomModuleRequest] - # A request object representing the call parameters. Required. - # @param options [::Gapic::CallOptions] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Cloud::SecurityCenter::V1::SecurityHealthAnalyticsCustomModule] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::SecurityCenter::V1::SecurityHealthAnalyticsCustomModule] - # A result object deserialized from the server's reply - def update_security_health_analytics_custom_module request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_update_security_health_analytics_custom_module_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_security_health_analytics_custom_module", - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Cloud::SecurityCenter::V1::SecurityHealthAnalyticsCustomModule.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_source REST call - # - # @param request_pb [::Google::Cloud::SecurityCenter::V1::UpdateSourceRequest] - # A request object representing the call parameters. Required. - # @param options [::Gapic::CallOptions] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Cloud::SecurityCenter::V1::Source] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::SecurityCenter::V1::Source] - # A result object deserialized from the server's reply - def update_source request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_update_source_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_source", - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Cloud::SecurityCenter::V1::Source.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_security_marks REST call - # - # @param request_pb [::Google::Cloud::SecurityCenter::V1::UpdateSecurityMarksRequest] - # A request object representing the call parameters. Required. - # @param options [::Gapic::CallOptions] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Cloud::SecurityCenter::V1::SecurityMarks] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::SecurityCenter::V1::SecurityMarks] - # A result object deserialized from the server's reply - def update_security_marks request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_update_security_marks_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_security_marks", - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Cloud::SecurityCenter::V1::SecurityMarks.decode_json response.body, ignore_unknown_fields: true - catch :response do - yield result, operation if block_given? - result - end - end - - ## - # Baseline implementation for the create_big_query_export REST call - # - # @param request_pb [::Google::Cloud::SecurityCenter::V1::CreateBigQueryExportRequest] - # A request object representing the call parameters. Required. - # @param options [::Gapic::CallOptions] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Cloud::SecurityCenter::V1::BigQueryExport] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::SecurityCenter::V1::BigQueryExport] - # A result object deserialized from the server's reply - def create_big_query_export request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_create_big_query_export_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_big_query_export", - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Cloud::SecurityCenter::V1::BigQueryExport.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_big_query_export REST call - # - # @param request_pb [::Google::Cloud::SecurityCenter::V1::DeleteBigQueryExportRequest] - # 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_big_query_export request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_delete_big_query_export_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_big_query_export", - 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 update_big_query_export REST call - # - # @param request_pb [::Google::Cloud::SecurityCenter::V1::UpdateBigQueryExportRequest] - # A request object representing the call parameters. Required. - # @param options [::Gapic::CallOptions] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Cloud::SecurityCenter::V1::BigQueryExport] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::SecurityCenter::V1::BigQueryExport] - # A result object deserialized from the server's reply - def update_big_query_export request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_update_big_query_export_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_big_query_export", - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Cloud::SecurityCenter::V1::BigQueryExport.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_big_query_exports REST call - # - # @param request_pb [::Google::Cloud::SecurityCenter::V1::ListBigQueryExportsRequest] - # A request object representing the call parameters. Required. - # @param options [::Gapic::CallOptions] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Cloud::SecurityCenter::V1::ListBigQueryExportsResponse] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::SecurityCenter::V1::ListBigQueryExportsResponse] - # A result object deserialized from the server's reply - def list_big_query_exports request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_list_big_query_exports_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_big_query_exports", - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Cloud::SecurityCenter::V1::ListBigQueryExportsResponse.decode_json response.body, ignore_unknown_fields: true - catch :response do - yield result, operation if block_given? - result - end - end - - ## - # Baseline implementation for the create_event_threat_detection_custom_module REST call - # - # @param request_pb [::Google::Cloud::SecurityCenter::V1::CreateEventThreatDetectionCustomModuleRequest] - # A request object representing the call parameters. Required. - # @param options [::Gapic::CallOptions] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Cloud::SecurityCenter::V1::EventThreatDetectionCustomModule] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::SecurityCenter::V1::EventThreatDetectionCustomModule] - # A result object deserialized from the server's reply - def create_event_threat_detection_custom_module request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_create_event_threat_detection_custom_module_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_event_threat_detection_custom_module", - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Cloud::SecurityCenter::V1::EventThreatDetectionCustomModule.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_event_threat_detection_custom_module REST call - # - # @param request_pb [::Google::Cloud::SecurityCenter::V1::DeleteEventThreatDetectionCustomModuleRequest] - # 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_event_threat_detection_custom_module request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_delete_event_threat_detection_custom_module_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_event_threat_detection_custom_module", - 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 get_event_threat_detection_custom_module REST call - # - # @param request_pb [::Google::Cloud::SecurityCenter::V1::GetEventThreatDetectionCustomModuleRequest] - # A request object representing the call parameters. Required. - # @param options [::Gapic::CallOptions] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Cloud::SecurityCenter::V1::EventThreatDetectionCustomModule] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::SecurityCenter::V1::EventThreatDetectionCustomModule] - # A result object deserialized from the server's reply - def get_event_threat_detection_custom_module request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_get_event_threat_detection_custom_module_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_event_threat_detection_custom_module", - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Cloud::SecurityCenter::V1::EventThreatDetectionCustomModule.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_descendant_event_threat_detection_custom_modules REST call - # - # @param request_pb [::Google::Cloud::SecurityCenter::V1::ListDescendantEventThreatDetectionCustomModulesRequest] - # A request object representing the call parameters. Required. - # @param options [::Gapic::CallOptions] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Cloud::SecurityCenter::V1::ListDescendantEventThreatDetectionCustomModulesResponse] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::SecurityCenter::V1::ListDescendantEventThreatDetectionCustomModulesResponse] - # A result object deserialized from the server's reply - def list_descendant_event_threat_detection_custom_modules request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_list_descendant_event_threat_detection_custom_modules_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_descendant_event_threat_detection_custom_modules", - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Cloud::SecurityCenter::V1::ListDescendantEventThreatDetectionCustomModulesResponse.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_event_threat_detection_custom_modules REST call - # - # @param request_pb [::Google::Cloud::SecurityCenter::V1::ListEventThreatDetectionCustomModulesRequest] - # A request object representing the call parameters. Required. - # @param options [::Gapic::CallOptions] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Cloud::SecurityCenter::V1::ListEventThreatDetectionCustomModulesResponse] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::SecurityCenter::V1::ListEventThreatDetectionCustomModulesResponse] - # A result object deserialized from the server's reply - def list_event_threat_detection_custom_modules request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_list_event_threat_detection_custom_modules_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_event_threat_detection_custom_modules", - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Cloud::SecurityCenter::V1::ListEventThreatDetectionCustomModulesResponse.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_event_threat_detection_custom_module REST call - # - # @param request_pb [::Google::Cloud::SecurityCenter::V1::UpdateEventThreatDetectionCustomModuleRequest] - # A request object representing the call parameters. Required. - # @param options [::Gapic::CallOptions] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Cloud::SecurityCenter::V1::EventThreatDetectionCustomModule] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::SecurityCenter::V1::EventThreatDetectionCustomModule] - # A result object deserialized from the server's reply - def update_event_threat_detection_custom_module request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_update_event_threat_detection_custom_module_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_event_threat_detection_custom_module", - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Cloud::SecurityCenter::V1::EventThreatDetectionCustomModule.decode_json response.body, ignore_unknown_fields: true - catch :response do - yield result, operation if block_given? - result - end - end - - ## - # Baseline implementation for the validate_event_threat_detection_custom_module REST call - # - # @param request_pb [::Google::Cloud::SecurityCenter::V1::ValidateEventThreatDetectionCustomModuleRequest] - # A request object representing the call parameters. Required. - # @param options [::Gapic::CallOptions] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Cloud::SecurityCenter::V1::ValidateEventThreatDetectionCustomModuleResponse] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::SecurityCenter::V1::ValidateEventThreatDetectionCustomModuleResponse] - # A result object deserialized from the server's reply - def validate_event_threat_detection_custom_module request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_validate_event_threat_detection_custom_module_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: "validate_event_threat_detection_custom_module", - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Cloud::SecurityCenter::V1::ValidateEventThreatDetectionCustomModuleResponse.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_effective_event_threat_detection_custom_module REST call - # - # @param request_pb [::Google::Cloud::SecurityCenter::V1::GetEffectiveEventThreatDetectionCustomModuleRequest] - # A request object representing the call parameters. Required. - # @param options [::Gapic::CallOptions] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Cloud::SecurityCenter::V1::EffectiveEventThreatDetectionCustomModule] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::SecurityCenter::V1::EffectiveEventThreatDetectionCustomModule] - # A result object deserialized from the server's reply - def get_effective_event_threat_detection_custom_module request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_get_effective_event_threat_detection_custom_module_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_effective_event_threat_detection_custom_module", - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Cloud::SecurityCenter::V1::EffectiveEventThreatDetectionCustomModule.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_effective_event_threat_detection_custom_modules REST call - # - # @param request_pb [::Google::Cloud::SecurityCenter::V1::ListEffectiveEventThreatDetectionCustomModulesRequest] - # A request object representing the call parameters. Required. - # @param options [::Gapic::CallOptions] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Cloud::SecurityCenter::V1::ListEffectiveEventThreatDetectionCustomModulesResponse] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::SecurityCenter::V1::ListEffectiveEventThreatDetectionCustomModulesResponse] - # A result object deserialized from the server's reply - def list_effective_event_threat_detection_custom_modules request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_list_effective_event_threat_detection_custom_modules_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_effective_event_threat_detection_custom_modules", - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Cloud::SecurityCenter::V1::ListEffectiveEventThreatDetectionCustomModulesResponse.decode_json response.body, ignore_unknown_fields: true - catch :response do - yield result, operation if block_given? - result - end - end - - ## - # Baseline implementation for the batch_create_resource_value_configs REST call - # - # @param request_pb [::Google::Cloud::SecurityCenter::V1::BatchCreateResourceValueConfigsRequest] - # A request object representing the call parameters. Required. - # @param options [::Gapic::CallOptions] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Cloud::SecurityCenter::V1::BatchCreateResourceValueConfigsResponse] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::SecurityCenter::V1::BatchCreateResourceValueConfigsResponse] - # A result object deserialized from the server's reply - def batch_create_resource_value_configs request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_batch_create_resource_value_configs_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: "batch_create_resource_value_configs", - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Cloud::SecurityCenter::V1::BatchCreateResourceValueConfigsResponse.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_resource_value_config REST call - # - # @param request_pb [::Google::Cloud::SecurityCenter::V1::DeleteResourceValueConfigRequest] - # 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_resource_value_config request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_delete_resource_value_config_request request_pb - query_string_params = if query_string_params.any? - query_string_params.to_h { |p| p.split "=", 2 } - else - {} - end - - response = @client_stub.make_http_request( - verb, - uri: uri, - body: body || "", - params: query_string_params, - method_name: "delete_resource_value_config", - 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 get_resource_value_config REST call - # - # @param request_pb [::Google::Cloud::SecurityCenter::V1::GetResourceValueConfigRequest] - # A request object representing the call parameters. Required. - # @param options [::Gapic::CallOptions] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Cloud::SecurityCenter::V1::ResourceValueConfig] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::SecurityCenter::V1::ResourceValueConfig] - # A result object deserialized from the server's reply - def get_resource_value_config request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_get_resource_value_config_request request_pb - query_string_params = if query_string_params.any? - query_string_params.to_h { |p| p.split "=", 2 } - else - {} - end - - response = @client_stub.make_http_request( - verb, - uri: uri, - body: body || "", - params: query_string_params, - method_name: "get_resource_value_config", - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Cloud::SecurityCenter::V1::ResourceValueConfig.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_resource_value_configs REST call - # - # @param request_pb [::Google::Cloud::SecurityCenter::V1::ListResourceValueConfigsRequest] - # A request object representing the call parameters. Required. - # @param options [::Gapic::CallOptions] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Cloud::SecurityCenter::V1::ListResourceValueConfigsResponse] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::SecurityCenter::V1::ListResourceValueConfigsResponse] - # A result object deserialized from the server's reply - def list_resource_value_configs request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_list_resource_value_configs_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_resource_value_configs", - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Cloud::SecurityCenter::V1::ListResourceValueConfigsResponse.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_resource_value_config REST call - # - # @param request_pb [::Google::Cloud::SecurityCenter::V1::UpdateResourceValueConfigRequest] - # A request object representing the call parameters. Required. - # @param options [::Gapic::CallOptions] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Cloud::SecurityCenter::V1::ResourceValueConfig] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::SecurityCenter::V1::ResourceValueConfig] - # A result object deserialized from the server's reply - def update_resource_value_config request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_update_resource_value_config_request request_pb - query_string_params = if query_string_params.any? - query_string_params.to_h { |p| p.split "=", 2 } - else - {} - end - - response = @client_stub.make_http_request( - verb, - uri: uri, - body: body || "", - params: query_string_params, - method_name: "update_resource_value_config", - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Cloud::SecurityCenter::V1::ResourceValueConfig.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_valued_resources REST call - # - # @param request_pb [::Google::Cloud::SecurityCenter::V1::ListValuedResourcesRequest] - # A request object representing the call parameters. Required. - # @param options [::Gapic::CallOptions] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Cloud::SecurityCenter::V1::ListValuedResourcesResponse] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::SecurityCenter::V1::ListValuedResourcesResponse] - # A result object deserialized from the server's reply - def list_valued_resources request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_list_valued_resources_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_valued_resources", - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Cloud::SecurityCenter::V1::ListValuedResourcesResponse.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_attack_paths REST call - # - # @param request_pb [::Google::Cloud::SecurityCenter::V1::ListAttackPathsRequest] - # A request object representing the call parameters. Required. - # @param options [::Gapic::CallOptions] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Cloud::SecurityCenter::V1::ListAttackPathsResponse] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::SecurityCenter::V1::ListAttackPathsResponse] - # A result object deserialized from the server's reply - def list_attack_paths request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_list_attack_paths_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_attack_paths", - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Cloud::SecurityCenter::V1::ListAttackPathsResponse.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 bulk_mute_findings REST call - # - # @param request_pb [::Google::Cloud::SecurityCenter::V1::BulkMuteFindingsRequest] - # A request object representing the call parameters. Required. - # @return [Array(String, [String, nil], Hash{String => String})] - # Uri, Body, Query string parameters - def self.transcode_bulk_mute_findings_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :post, - uri_template: "/v1/{parent}/findings:bulkMute", - body: "*", - matches: [ - ["parent", %r{^organizations/[^/]+/?$}, false] - ] - ) - .with_bindings( - uri_method: :post, - uri_template: "/v1/{parent}/findings:bulkMute", - body: "*", - matches: [ - ["parent", %r{^folders/[^/]+/?$}, false] - ] - ) - .with_bindings( - uri_method: :post, - uri_template: "/v1/{parent}/findings:bulkMute", - body: "*", - matches: [ - ["parent", %r{^projects/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the create_security_health_analytics_custom_module REST call - # - # @param request_pb [::Google::Cloud::SecurityCenter::V1::CreateSecurityHealthAnalyticsCustomModuleRequest] - # 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_security_health_analytics_custom_module_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :post, - uri_template: "/v1/{parent}/customModules", - body: "security_health_analytics_custom_module", - matches: [ - ["parent", %r{^organizations/[^/]+/securityHealthAnalyticsSettings/?$}, false] - ] - ) - .with_bindings( - uri_method: :post, - uri_template: "/v1/{parent}/customModules", - body: "security_health_analytics_custom_module", - matches: [ - ["parent", %r{^folders/[^/]+/securityHealthAnalyticsSettings/?$}, false] - ] - ) - .with_bindings( - uri_method: :post, - uri_template: "/v1/{parent}/customModules", - body: "security_health_analytics_custom_module", - matches: [ - ["parent", %r{^projects/[^/]+/securityHealthAnalyticsSettings/?$}, false] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the create_source REST call - # - # @param request_pb [::Google::Cloud::SecurityCenter::V1::CreateSourceRequest] - # 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_source_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :post, - uri_template: "/v1/{parent}/sources", - body: "source", - matches: [ - ["parent", %r{^organizations/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the create_finding REST call - # - # @param request_pb [::Google::Cloud::SecurityCenter::V1::CreateFindingRequest] - # 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_finding_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :post, - uri_template: "/v1/{parent}/findings", - body: "finding", - matches: [ - ["parent", %r{^organizations/[^/]+/sources/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the create_mute_config REST call - # - # @param request_pb [::Google::Cloud::SecurityCenter::V1::CreateMuteConfigRequest] - # 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_mute_config_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :post, - uri_template: "/v1/{parent}/muteConfigs", - body: "mute_config", - matches: [ - ["parent", %r{^organizations/[^/]+/?$}, false] - ] - ) - .with_bindings( - uri_method: :post, - uri_template: "/v1/{parent}/muteConfigs", - body: "mute_config", - matches: [ - ["parent", %r{^organizations/[^/]+/locations/[^/]+/?$}, false] - ] - ) - .with_bindings( - uri_method: :post, - uri_template: "/v1/{parent}/muteConfigs", - body: "mute_config", - matches: [ - ["parent", %r{^folders/[^/]+/?$}, false] - ] - ) - .with_bindings( - uri_method: :post, - uri_template: "/v1/{parent}/muteConfigs", - body: "mute_config", - matches: [ - ["parent", %r{^folders/[^/]+/locations/[^/]+/?$}, false] - ] - ) - .with_bindings( - uri_method: :post, - uri_template: "/v1/{parent}/muteConfigs", - body: "mute_config", - matches: [ - ["parent", %r{^projects/[^/]+/?$}, false] - ] - ) - .with_bindings( - uri_method: :post, - uri_template: "/v1/{parent}/muteConfigs", - body: "mute_config", - matches: [ - ["parent", %r{^projects/[^/]+/locations/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the create_notification_config REST call - # - # @param request_pb [::Google::Cloud::SecurityCenter::V1::CreateNotificationConfigRequest] - # 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_notification_config_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :post, - uri_template: "/v1/{parent}/notificationConfigs", - body: "notification_config", - matches: [ - ["parent", %r{^organizations/[^/]+/?$}, false] - ] - ) - .with_bindings( - uri_method: :post, - uri_template: "/v1/{parent}/notificationConfigs", - body: "notification_config", - matches: [ - ["parent", %r{^folders/[^/]+/?$}, false] - ] - ) - .with_bindings( - uri_method: :post, - uri_template: "/v1/{parent}/notificationConfigs", - body: "notification_config", - matches: [ - ["parent", %r{^projects/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the delete_mute_config REST call - # - # @param request_pb [::Google::Cloud::SecurityCenter::V1::DeleteMuteConfigRequest] - # 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_mute_config_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :delete, - uri_template: "/v1/{name}", - matches: [ - ["name", %r{^organizations/[^/]+/muteConfigs/[^/]+/?$}, false] - ] - ) - .with_bindings( - uri_method: :delete, - uri_template: "/v1/{name}", - matches: [ - ["name", %r{^folders/[^/]+/muteConfigs/[^/]+/?$}, false] - ] - ) - .with_bindings( - uri_method: :delete, - uri_template: "/v1/{name}", - matches: [ - ["name", %r{^projects/[^/]+/muteConfigs/[^/]+/?$}, false] - ] - ) - .with_bindings( - uri_method: :delete, - uri_template: "/v1/{name}", - matches: [ - ["name", %r{^organizations/[^/]+/locations/[^/]+/muteConfigs/[^/]+/?$}, false] - ] - ) - .with_bindings( - uri_method: :delete, - uri_template: "/v1/{name}", - matches: [ - ["name", %r{^folders/[^/]+/locations/[^/]+/muteConfigs/[^/]+/?$}, false] - ] - ) - .with_bindings( - uri_method: :delete, - uri_template: "/v1/{name}", - matches: [ - ["name", %r{^projects/[^/]+/locations/[^/]+/muteConfigs/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the delete_notification_config REST call - # - # @param request_pb [::Google::Cloud::SecurityCenter::V1::DeleteNotificationConfigRequest] - # 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_notification_config_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :delete, - uri_template: "/v1/{name}", - matches: [ - ["name", %r{^organizations/[^/]+/notificationConfigs/[^/]+/?$}, false] - ] - ) - .with_bindings( - uri_method: :delete, - uri_template: "/v1/{name}", - matches: [ - ["name", %r{^folders/[^/]+/notificationConfigs/[^/]+/?$}, false] - ] - ) - .with_bindings( - uri_method: :delete, - uri_template: "/v1/{name}", - matches: [ - ["name", %r{^projects/[^/]+/notificationConfigs/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the delete_security_health_analytics_custom_module REST call - # - # @param request_pb [::Google::Cloud::SecurityCenter::V1::DeleteSecurityHealthAnalyticsCustomModuleRequest] - # 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_security_health_analytics_custom_module_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :delete, - uri_template: "/v1/{name}", - matches: [ - ["name", %r{^organizations/[^/]+/securityHealthAnalyticsSettings/customModules/[^/]+/?$}, false] - ] - ) - .with_bindings( - uri_method: :delete, - uri_template: "/v1/{name}", - matches: [ - ["name", %r{^folders/[^/]+/securityHealthAnalyticsSettings/customModules/[^/]+/?$}, false] - ] - ) - .with_bindings( - uri_method: :delete, - uri_template: "/v1/{name}", - matches: [ - ["name", %r{^projects/[^/]+/securityHealthAnalyticsSettings/customModules/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the get_simulation REST call - # - # @param request_pb [::Google::Cloud::SecurityCenter::V1::GetSimulationRequest] - # 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_simulation_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :get, - uri_template: "/v1/{name}", - matches: [ - ["name", %r{^organizations/[^/]+/simulations/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the get_valued_resource REST call - # - # @param request_pb [::Google::Cloud::SecurityCenter::V1::GetValuedResourceRequest] - # 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_valued_resource_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :get, - uri_template: "/v1/{name}", - matches: [ - ["name", %r{^organizations/[^/]+/simulations/[^/]+/valuedResources/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the get_big_query_export REST call - # - # @param request_pb [::Google::Cloud::SecurityCenter::V1::GetBigQueryExportRequest] - # 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_big_query_export_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :get, - uri_template: "/v1/{name}", - matches: [ - ["name", %r{^organizations/[^/]+/bigQueryExports/[^/]+/?$}, false] - ] - ) - .with_bindings( - uri_method: :get, - uri_template: "/v1/{name}", - matches: [ - ["name", %r{^folders/[^/]+/bigQueryExports/[^/]+/?$}, false] - ] - ) - .with_bindings( - uri_method: :get, - uri_template: "/v1/{name}", - matches: [ - ["name", %r{^projects/[^/]+/bigQueryExports/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the get_iam_policy REST call - # - # @param request_pb [::Google::Iam::V1::GetIamPolicyRequest] - # A request object representing the call parameters. Required. - # @return [Array(String, [String, nil], Hash{String => String})] - # Uri, Body, Query string parameters - def self.transcode_get_iam_policy_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :post, - uri_template: "/v1/{resource}:getIamPolicy", - body: "*", - matches: [ - ["resource", %r{^organizations/[^/]+/sources/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the get_mute_config REST call - # - # @param request_pb [::Google::Cloud::SecurityCenter::V1::GetMuteConfigRequest] - # 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_mute_config_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :get, - uri_template: "/v1/{name}", - matches: [ - ["name", %r{^organizations/[^/]+/muteConfigs/[^/]+/?$}, false] - ] - ) - .with_bindings( - uri_method: :get, - uri_template: "/v1/{name}", - matches: [ - ["name", %r{^folders/[^/]+/muteConfigs/[^/]+/?$}, false] - ] - ) - .with_bindings( - uri_method: :get, - uri_template: "/v1/{name}", - matches: [ - ["name", %r{^projects/[^/]+/muteConfigs/[^/]+/?$}, false] - ] - ) - .with_bindings( - uri_method: :get, - uri_template: "/v1/{name}", - matches: [ - ["name", %r{^organizations/[^/]+/locations/[^/]+/muteConfigs/[^/]+/?$}, false] - ] - ) - .with_bindings( - uri_method: :get, - uri_template: "/v1/{name}", - matches: [ - ["name", %r{^folders/[^/]+/locations/[^/]+/muteConfigs/[^/]+/?$}, false] - ] - ) - .with_bindings( - uri_method: :get, - uri_template: "/v1/{name}", - matches: [ - ["name", %r{^projects/[^/]+/locations/[^/]+/muteConfigs/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the get_notification_config REST call - # - # @param request_pb [::Google::Cloud::SecurityCenter::V1::GetNotificationConfigRequest] - # 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_notification_config_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :get, - uri_template: "/v1/{name}", - matches: [ - ["name", %r{^organizations/[^/]+/notificationConfigs/[^/]+/?$}, false] - ] - ) - .with_bindings( - uri_method: :get, - uri_template: "/v1/{name}", - matches: [ - ["name", %r{^folders/[^/]+/notificationConfigs/[^/]+/?$}, false] - ] - ) - .with_bindings( - uri_method: :get, - uri_template: "/v1/{name}", - matches: [ - ["name", %r{^projects/[^/]+/notificationConfigs/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the get_organization_settings REST call - # - # @param request_pb [::Google::Cloud::SecurityCenter::V1::GetOrganizationSettingsRequest] - # A request object representing the call parameters. Required. - # @return [Array(String, [String, nil], Hash{String => String})] - # Uri, Body, Query string parameters - def self.transcode_get_organization_settings_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :get, - uri_template: "/v1/{name}", - matches: [ - ["name", %r{^organizations/[^/]+/organizationSettings/?$}, false] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the get_effective_security_health_analytics_custom_module REST call - # - # @param request_pb [::Google::Cloud::SecurityCenter::V1::GetEffectiveSecurityHealthAnalyticsCustomModuleRequest] - # 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_effective_security_health_analytics_custom_module_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :get, - uri_template: "/v1/{name}", - matches: [ - ["name", %r{^organizations/[^/]+/securityHealthAnalyticsSettings/effectiveCustomModules/[^/]+/?$}, false] - ] - ) - .with_bindings( - uri_method: :get, - uri_template: "/v1/{name}", - matches: [ - ["name", %r{^folders/[^/]+/securityHealthAnalyticsSettings/effectiveCustomModules/[^/]+/?$}, false] - ] - ) - .with_bindings( - uri_method: :get, - uri_template: "/v1/{name}", - matches: [ - ["name", %r{^projects/[^/]+/securityHealthAnalyticsSettings/effectiveCustomModules/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the get_security_health_analytics_custom_module REST call - # - # @param request_pb [::Google::Cloud::SecurityCenter::V1::GetSecurityHealthAnalyticsCustomModuleRequest] - # 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_security_health_analytics_custom_module_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :get, - uri_template: "/v1/{name}", - matches: [ - ["name", %r{^organizations/[^/]+/securityHealthAnalyticsSettings/customModules/[^/]+/?$}, false] - ] - ) - .with_bindings( - uri_method: :get, - uri_template: "/v1/{name}", - matches: [ - ["name", %r{^folders/[^/]+/securityHealthAnalyticsSettings/customModules/[^/]+/?$}, false] - ] - ) - .with_bindings( - uri_method: :get, - uri_template: "/v1/{name}", - matches: [ - ["name", %r{^projects/[^/]+/securityHealthAnalyticsSettings/customModules/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the get_source REST call - # - # @param request_pb [::Google::Cloud::SecurityCenter::V1::GetSourceRequest] - # 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_source_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :get, - uri_template: "/v1/{name}", - matches: [ - ["name", %r{^organizations/[^/]+/sources/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the group_assets REST call - # - # @param request_pb [::Google::Cloud::SecurityCenter::V1::GroupAssetsRequest] - # A request object representing the call parameters. Required. - # @return [Array(String, [String, nil], Hash{String => String})] - # Uri, Body, Query string parameters - def self.transcode_group_assets_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :post, - uri_template: "/v1/{parent}/assets:group", - body: "*", - matches: [ - ["parent", %r{^organizations/[^/]+/?$}, false] - ] - ) - .with_bindings( - uri_method: :post, - uri_template: "/v1/{parent}/assets:group", - body: "*", - matches: [ - ["parent", %r{^folders/[^/]+/?$}, false] - ] - ) - .with_bindings( - uri_method: :post, - uri_template: "/v1/{parent}/assets:group", - body: "*", - matches: [ - ["parent", %r{^projects/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the group_findings REST call - # - # @param request_pb [::Google::Cloud::SecurityCenter::V1::GroupFindingsRequest] - # A request object representing the call parameters. Required. - # @return [Array(String, [String, nil], Hash{String => String})] - # Uri, Body, Query string parameters - def self.transcode_group_findings_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :post, - uri_template: "/v1/{parent}/findings:group", - body: "*", - matches: [ - ["parent", %r{^organizations/[^/]+/sources/[^/]+/?$}, false] - ] - ) - .with_bindings( - uri_method: :post, - uri_template: "/v1/{parent}/findings:group", - body: "*", - matches: [ - ["parent", %r{^folders/[^/]+/sources/[^/]+/?$}, false] - ] - ) - .with_bindings( - uri_method: :post, - uri_template: "/v1/{parent}/findings:group", - body: "*", - matches: [ - ["parent", %r{^projects/[^/]+/sources/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the list_assets REST call - # - # @param request_pb [::Google::Cloud::SecurityCenter::V1::ListAssetsRequest] - # 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_assets_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :get, - uri_template: "/v1/{parent}/assets", - matches: [ - ["parent", %r{^organizations/[^/]+/?$}, false] - ] - ) - .with_bindings( - uri_method: :get, - uri_template: "/v1/{parent}/assets", - matches: [ - ["parent", %r{^folders/[^/]+/?$}, false] - ] - ) - .with_bindings( - uri_method: :get, - uri_template: "/v1/{parent}/assets", - matches: [ - ["parent", %r{^projects/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the list_descendant_security_health_analytics_custom_modules REST call - # - # @param request_pb [::Google::Cloud::SecurityCenter::V1::ListDescendantSecurityHealthAnalyticsCustomModulesRequest] - # 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_descendant_security_health_analytics_custom_modules_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :get, - uri_template: "/v1/{parent}/customModules:listDescendant", - matches: [ - ["parent", %r{^organizations/[^/]+/securityHealthAnalyticsSettings/?$}, false] - ] - ) - .with_bindings( - uri_method: :get, - uri_template: "/v1/{parent}/customModules:listDescendant", - matches: [ - ["parent", %r{^folders/[^/]+/securityHealthAnalyticsSettings/?$}, false] - ] - ) - .with_bindings( - uri_method: :get, - uri_template: "/v1/{parent}/customModules:listDescendant", - matches: [ - ["parent", %r{^projects/[^/]+/securityHealthAnalyticsSettings/?$}, false] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the list_findings REST call - # - # @param request_pb [::Google::Cloud::SecurityCenter::V1::ListFindingsRequest] - # 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_findings_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :get, - uri_template: "/v1/{parent}/findings", - matches: [ - ["parent", %r{^organizations/[^/]+/sources/[^/]+/?$}, false] - ] - ) - .with_bindings( - uri_method: :get, - uri_template: "/v1/{parent}/findings", - matches: [ - ["parent", %r{^folders/[^/]+/sources/[^/]+/?$}, false] - ] - ) - .with_bindings( - uri_method: :get, - uri_template: "/v1/{parent}/findings", - matches: [ - ["parent", %r{^projects/[^/]+/sources/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the list_mute_configs REST call - # - # @param request_pb [::Google::Cloud::SecurityCenter::V1::ListMuteConfigsRequest] - # 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_mute_configs_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :get, - uri_template: "/v1/{parent}/muteConfigs", - matches: [ - ["parent", %r{^organizations/[^/]+/?$}, false] - ] - ) - .with_bindings( - uri_method: :get, - uri_template: "/v1/{parent}/muteConfigs", - matches: [ - ["parent", %r{^folders/[^/]+/?$}, false] - ] - ) - .with_bindings( - uri_method: :get, - uri_template: "/v1/{parent}/muteConfigs", - matches: [ - ["parent", %r{^projects/[^/]+/?$}, false] - ] - ) - .with_bindings( - uri_method: :get, - uri_template: "/v1/{parent}", - matches: [ - ["parent", %r{^organizations/[^/]+/locations/[^/]+/muteConfigs/?$}, false] - ] - ) - .with_bindings( - uri_method: :get, - uri_template: "/v1/{parent}", - matches: [ - ["parent", %r{^folders/[^/]+/locations/[^/]+/muteConfigs/?$}, false] - ] - ) - .with_bindings( - uri_method: :get, - uri_template: "/v1/{parent}", - matches: [ - ["parent", %r{^projects/[^/]+/locations/[^/]+/muteConfigs/?$}, false] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the list_notification_configs REST call - # - # @param request_pb [::Google::Cloud::SecurityCenter::V1::ListNotificationConfigsRequest] - # 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_notification_configs_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :get, - uri_template: "/v1/{parent}/notificationConfigs", - matches: [ - ["parent", %r{^organizations/[^/]+/?$}, false] - ] - ) - .with_bindings( - uri_method: :get, - uri_template: "/v1/{parent}/notificationConfigs", - matches: [ - ["parent", %r{^folders/[^/]+/?$}, false] - ] - ) - .with_bindings( - uri_method: :get, - uri_template: "/v1/{parent}/notificationConfigs", - matches: [ - ["parent", %r{^projects/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the list_effective_security_health_analytics_custom_modules REST call - # - # @param request_pb [::Google::Cloud::SecurityCenter::V1::ListEffectiveSecurityHealthAnalyticsCustomModulesRequest] - # 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_effective_security_health_analytics_custom_modules_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :get, - uri_template: "/v1/{parent}/effectiveCustomModules", - matches: [ - ["parent", %r{^organizations/[^/]+/securityHealthAnalyticsSettings/?$}, false] - ] - ) - .with_bindings( - uri_method: :get, - uri_template: "/v1/{parent}/effectiveCustomModules", - matches: [ - ["parent", %r{^folders/[^/]+/securityHealthAnalyticsSettings/?$}, false] - ] - ) - .with_bindings( - uri_method: :get, - uri_template: "/v1/{parent}/effectiveCustomModules", - matches: [ - ["parent", %r{^projects/[^/]+/securityHealthAnalyticsSettings/?$}, false] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the list_security_health_analytics_custom_modules REST call - # - # @param request_pb [::Google::Cloud::SecurityCenter::V1::ListSecurityHealthAnalyticsCustomModulesRequest] - # 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_security_health_analytics_custom_modules_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :get, - uri_template: "/v1/{parent}/customModules", - matches: [ - ["parent", %r{^organizations/[^/]+/securityHealthAnalyticsSettings/?$}, false] - ] - ) - .with_bindings( - uri_method: :get, - uri_template: "/v1/{parent}/customModules", - matches: [ - ["parent", %r{^folders/[^/]+/securityHealthAnalyticsSettings/?$}, false] - ] - ) - .with_bindings( - uri_method: :get, - uri_template: "/v1/{parent}/customModules", - matches: [ - ["parent", %r{^projects/[^/]+/securityHealthAnalyticsSettings/?$}, false] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the list_sources REST call - # - # @param request_pb [::Google::Cloud::SecurityCenter::V1::ListSourcesRequest] - # 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_sources_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :get, - uri_template: "/v1/{parent}/sources", - matches: [ - ["parent", %r{^organizations/[^/]+/?$}, false] - ] - ) - .with_bindings( - uri_method: :get, - uri_template: "/v1/{parent}/sources", - matches: [ - ["parent", %r{^folders/[^/]+/?$}, false] - ] - ) - .with_bindings( - uri_method: :get, - uri_template: "/v1/{parent}/sources", - matches: [ - ["parent", %r{^projects/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the run_asset_discovery REST call - # - # @param request_pb [::Google::Cloud::SecurityCenter::V1::RunAssetDiscoveryRequest] - # A request object representing the call parameters. Required. - # @return [Array(String, [String, nil], Hash{String => String})] - # Uri, Body, Query string parameters - def self.transcode_run_asset_discovery_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :post, - uri_template: "/v1/{parent}/assets:runDiscovery", - body: "*", - matches: [ - ["parent", %r{^organizations/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the set_finding_state REST call - # - # @param request_pb [::Google::Cloud::SecurityCenter::V1::SetFindingStateRequest] - # A request object representing the call parameters. Required. - # @return [Array(String, [String, nil], Hash{String => String})] - # Uri, Body, Query string parameters - def self.transcode_set_finding_state_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :post, - uri_template: "/v1/{name}:setState", - body: "*", - matches: [ - ["name", %r{^organizations/[^/]+/sources/[^/]+/findings/[^/]+/?$}, false] - ] - ) - .with_bindings( - uri_method: :post, - uri_template: "/v1/{name}:setState", - body: "*", - matches: [ - ["name", %r{^folders/[^/]+/sources/[^/]+/findings/[^/]+/?$}, false] - ] - ) - .with_bindings( - uri_method: :post, - uri_template: "/v1/{name}:setState", - body: "*", - matches: [ - ["name", %r{^projects/[^/]+/sources/[^/]+/findings/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the set_mute REST call - # - # @param request_pb [::Google::Cloud::SecurityCenter::V1::SetMuteRequest] - # A request object representing the call parameters. Required. - # @return [Array(String, [String, nil], Hash{String => String})] - # Uri, Body, Query string parameters - def self.transcode_set_mute_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :post, - uri_template: "/v1/{name}:setMute", - body: "*", - matches: [ - ["name", %r{^organizations/[^/]+/sources/[^/]+/findings/[^/]+/?$}, false] - ] - ) - .with_bindings( - uri_method: :post, - uri_template: "/v1/{name}:setMute", - body: "*", - matches: [ - ["name", %r{^folders/[^/]+/sources/[^/]+/findings/[^/]+/?$}, false] - ] - ) - .with_bindings( - uri_method: :post, - uri_template: "/v1/{name}:setMute", - body: "*", - matches: [ - ["name", %r{^projects/[^/]+/sources/[^/]+/findings/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the set_iam_policy REST call - # - # @param request_pb [::Google::Iam::V1::SetIamPolicyRequest] - # A request object representing the call parameters. Required. - # @return [Array(String, [String, nil], Hash{String => String})] - # Uri, Body, Query string parameters - def self.transcode_set_iam_policy_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :post, - uri_template: "/v1/{resource}:setIamPolicy", - body: "*", - matches: [ - ["resource", %r{^organizations/[^/]+/sources/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the test_iam_permissions REST call - # - # @param request_pb [::Google::Iam::V1::TestIamPermissionsRequest] - # A request object representing the call parameters. Required. - # @return [Array(String, [String, nil], Hash{String => String})] - # Uri, Body, Query string parameters - def self.transcode_test_iam_permissions_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :post, - uri_template: "/v1/{resource}:testIamPermissions", - body: "*", - matches: [ - ["resource", %r{^organizations/[^/]+/sources/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the simulate_security_health_analytics_custom_module REST call - # - # @param request_pb [::Google::Cloud::SecurityCenter::V1::SimulateSecurityHealthAnalyticsCustomModuleRequest] - # A request object representing the call parameters. Required. - # @return [Array(String, [String, nil], Hash{String => String})] - # Uri, Body, Query string parameters - def self.transcode_simulate_security_health_analytics_custom_module_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :post, - uri_template: "/v1/{parent}/customModules:simulate", - body: "*", - matches: [ - ["parent", %r{^organizations/[^/]+/securityHealthAnalyticsSettings/?$}, false] - ] - ) - .with_bindings( - uri_method: :post, - uri_template: "/v1/{parent}/customModules:simulate", - body: "*", - matches: [ - ["parent", %r{^folders/[^/]+/securityHealthAnalyticsSettings/?$}, false] - ] - ) - .with_bindings( - uri_method: :post, - uri_template: "/v1/{parent}/customModules:simulate", - body: "*", - matches: [ - ["parent", %r{^projects/[^/]+/securityHealthAnalyticsSettings/?$}, false] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the update_external_system REST call - # - # @param request_pb [::Google::Cloud::SecurityCenter::V1::UpdateExternalSystemRequest] - # 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_external_system_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :patch, - uri_template: "/v1/{external_system.name}", - body: "external_system", - matches: [ - ["external_system.name", %r{^organizations/[^/]+/sources/[^/]+/findings/[^/]+/externalSystems/[^/]+/?$}, false] - ] - ) - .with_bindings( - uri_method: :patch, - uri_template: "/v1/{external_system.name}", - body: "external_system", - matches: [ - ["external_system.name", %r{^folders/[^/]+/sources/[^/]+/findings/[^/]+/externalSystems/[^/]+/?$}, false] - ] - ) - .with_bindings( - uri_method: :patch, - uri_template: "/v1/{external_system.name}", - body: "external_system", - matches: [ - ["external_system.name", %r{^projects/[^/]+/sources/[^/]+/findings/[^/]+/externalSystems/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the update_finding REST call - # - # @param request_pb [::Google::Cloud::SecurityCenter::V1::UpdateFindingRequest] - # 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_finding_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :patch, - uri_template: "/v1/{finding.name}", - body: "finding", - matches: [ - ["finding.name", %r{^organizations/[^/]+/sources/[^/]+/findings/[^/]+/?$}, false] - ] - ) - .with_bindings( - uri_method: :patch, - uri_template: "/v1/{finding.name}", - body: "finding", - matches: [ - ["finding.name", %r{^folders/[^/]+/sources/[^/]+/findings/[^/]+/?$}, false] - ] - ) - .with_bindings( - uri_method: :patch, - uri_template: "/v1/{finding.name}", - body: "finding", - matches: [ - ["finding.name", %r{^projects/[^/]+/sources/[^/]+/findings/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the update_mute_config REST call - # - # @param request_pb [::Google::Cloud::SecurityCenter::V1::UpdateMuteConfigRequest] - # 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_mute_config_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :patch, - uri_template: "/v1/{mute_config.name}", - body: "mute_config", - matches: [ - ["mute_config.name", %r{^organizations/[^/]+/muteConfigs/[^/]+/?$}, false] - ] - ) - .with_bindings( - uri_method: :patch, - uri_template: "/v1/{mute_config.name}", - body: "mute_config", - matches: [ - ["mute_config.name", %r{^folders/[^/]+/muteConfigs/[^/]+/?$}, false] - ] - ) - .with_bindings( - uri_method: :patch, - uri_template: "/v1/{mute_config.name}", - body: "mute_config", - matches: [ - ["mute_config.name", %r{^projects/[^/]+/muteConfigs/[^/]+/?$}, false] - ] - ) - .with_bindings( - uri_method: :patch, - uri_template: "/v1/{mute_config.name}", - body: "mute_config", - matches: [ - ["mute_config.name", %r{^organizations/[^/]+/locations/[^/]+/muteConfigs/[^/]+/?$}, false] - ] - ) - .with_bindings( - uri_method: :patch, - uri_template: "/v1/{mute_config.name}", - body: "mute_config", - matches: [ - ["mute_config.name", %r{^folders/[^/]+/locations/[^/]+/muteConfigs/[^/]+/?$}, false] - ] - ) - .with_bindings( - uri_method: :patch, - uri_template: "/v1/{mute_config.name}", - body: "mute_config", - matches: [ - ["mute_config.name", %r{^projects/[^/]+/locations/[^/]+/muteConfigs/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the update_notification_config REST call - # - # @param request_pb [::Google::Cloud::SecurityCenter::V1::UpdateNotificationConfigRequest] - # 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_notification_config_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :patch, - uri_template: "/v1/{notification_config.name}", - body: "notification_config", - matches: [ - ["notification_config.name", %r{^organizations/[^/]+/notificationConfigs/[^/]+/?$}, false] - ] - ) - .with_bindings( - uri_method: :patch, - uri_template: "/v1/{notification_config.name}", - body: "notification_config", - matches: [ - ["notification_config.name", %r{^folders/[^/]+/notificationConfigs/[^/]+/?$}, false] - ] - ) - .with_bindings( - uri_method: :patch, - uri_template: "/v1/{notification_config.name}", - body: "notification_config", - matches: [ - ["notification_config.name", %r{^projects/[^/]+/notificationConfigs/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the update_organization_settings REST call - # - # @param request_pb [::Google::Cloud::SecurityCenter::V1::UpdateOrganizationSettingsRequest] - # A request object representing the call parameters. Required. - # @return [Array(String, [String, nil], Hash{String => String})] - # Uri, Body, Query string parameters - def self.transcode_update_organization_settings_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :patch, - uri_template: "/v1/{organization_settings.name}", - body: "organization_settings", - matches: [ - ["organization_settings.name", %r{^organizations/[^/]+/organizationSettings/?$}, false] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the update_security_health_analytics_custom_module REST call - # - # @param request_pb [::Google::Cloud::SecurityCenter::V1::UpdateSecurityHealthAnalyticsCustomModuleRequest] - # 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_security_health_analytics_custom_module_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :patch, - uri_template: "/v1/{security_health_analytics_custom_module.name}", - body: "security_health_analytics_custom_module", - matches: [ - ["security_health_analytics_custom_module.name", %r{^organizations/[^/]+/securityHealthAnalyticsSettings/customModules/[^/]+/?$}, false] - ] - ) - .with_bindings( - uri_method: :patch, - uri_template: "/v1/{security_health_analytics_custom_module.name}", - body: "security_health_analytics_custom_module", - matches: [ - ["security_health_analytics_custom_module.name", %r{^folders/[^/]+/securityHealthAnalyticsSettings/customModules/[^/]+/?$}, false] - ] - ) - .with_bindings( - uri_method: :patch, - uri_template: "/v1/{security_health_analytics_custom_module.name}", - body: "security_health_analytics_custom_module", - matches: [ - ["security_health_analytics_custom_module.name", %r{^projects/[^/]+/securityHealthAnalyticsSettings/customModules/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the update_source REST call - # - # @param request_pb [::Google::Cloud::SecurityCenter::V1::UpdateSourceRequest] - # 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_source_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :patch, - uri_template: "/v1/{source.name}", - body: "source", - matches: [ - ["source.name", %r{^organizations/[^/]+/sources/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the update_security_marks REST call - # - # @param request_pb [::Google::Cloud::SecurityCenter::V1::UpdateSecurityMarksRequest] - # 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_security_marks_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :patch, - uri_template: "/v1/{security_marks.name}", - body: "security_marks", - matches: [ - ["security_marks.name", %r{^organizations/[^/]+/assets/[^/]+/securityMarks/?$}, false] - ] - ) - .with_bindings( - uri_method: :patch, - uri_template: "/v1/{security_marks.name}", - body: "security_marks", - matches: [ - ["security_marks.name", %r{^folders/[^/]+/assets/[^/]+/securityMarks/?$}, false] - ] - ) - .with_bindings( - uri_method: :patch, - uri_template: "/v1/{security_marks.name}", - body: "security_marks", - matches: [ - ["security_marks.name", %r{^projects/[^/]+/assets/[^/]+/securityMarks/?$}, false] - ] - ) - .with_bindings( - uri_method: :patch, - uri_template: "/v1/{security_marks.name}", - body: "security_marks", - matches: [ - ["security_marks.name", %r{^organizations/[^/]+/sources/[^/]+/findings/[^/]+/securityMarks/?$}, false] - ] - ) - .with_bindings( - uri_method: :patch, - uri_template: "/v1/{security_marks.name}", - body: "security_marks", - matches: [ - ["security_marks.name", %r{^folders/[^/]+/sources/[^/]+/findings/[^/]+/securityMarks/?$}, false] - ] - ) - .with_bindings( - uri_method: :patch, - uri_template: "/v1/{security_marks.name}", - body: "security_marks", - matches: [ - ["security_marks.name", %r{^projects/[^/]+/sources/[^/]+/findings/[^/]+/securityMarks/?$}, false] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the create_big_query_export REST call - # - # @param request_pb [::Google::Cloud::SecurityCenter::V1::CreateBigQueryExportRequest] - # 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_big_query_export_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :post, - uri_template: "/v1/{parent}/bigQueryExports", - body: "big_query_export", - matches: [ - ["parent", %r{^organizations/[^/]+/?$}, false] - ] - ) - .with_bindings( - uri_method: :post, - uri_template: "/v1/{parent}/bigQueryExports", - body: "big_query_export", - matches: [ - ["parent", %r{^folders/[^/]+/?$}, false] - ] - ) - .with_bindings( - uri_method: :post, - uri_template: "/v1/{parent}/bigQueryExports", - body: "big_query_export", - matches: [ - ["parent", %r{^projects/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the delete_big_query_export REST call - # - # @param request_pb [::Google::Cloud::SecurityCenter::V1::DeleteBigQueryExportRequest] - # 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_big_query_export_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :delete, - uri_template: "/v1/{name}", - matches: [ - ["name", %r{^organizations/[^/]+/bigQueryExports/[^/]+/?$}, false] - ] - ) - .with_bindings( - uri_method: :delete, - uri_template: "/v1/{name}", - matches: [ - ["name", %r{^folders/[^/]+/bigQueryExports/[^/]+/?$}, false] - ] - ) - .with_bindings( - uri_method: :delete, - uri_template: "/v1/{name}", - matches: [ - ["name", %r{^projects/[^/]+/bigQueryExports/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the update_big_query_export REST call - # - # @param request_pb [::Google::Cloud::SecurityCenter::V1::UpdateBigQueryExportRequest] - # 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_big_query_export_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :patch, - uri_template: "/v1/{big_query_export.name}", - body: "big_query_export", - matches: [ - ["big_query_export.name", %r{^organizations/[^/]+/bigQueryExports/[^/]+/?$}, false] - ] - ) - .with_bindings( - uri_method: :patch, - uri_template: "/v1/{big_query_export.name}", - body: "big_query_export", - matches: [ - ["big_query_export.name", %r{^folders/[^/]+/bigQueryExports/[^/]+/?$}, false] - ] - ) - .with_bindings( - uri_method: :patch, - uri_template: "/v1/{big_query_export.name}", - body: "big_query_export", - matches: [ - ["big_query_export.name", %r{^projects/[^/]+/bigQueryExports/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the list_big_query_exports REST call - # - # @param request_pb [::Google::Cloud::SecurityCenter::V1::ListBigQueryExportsRequest] - # 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_big_query_exports_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :get, - uri_template: "/v1/{parent}/bigQueryExports", - matches: [ - ["parent", %r{^organizations/[^/]+/?$}, false] - ] - ) - .with_bindings( - uri_method: :get, - uri_template: "/v1/{parent}/bigQueryExports", - matches: [ - ["parent", %r{^folders/[^/]+/?$}, false] - ] - ) - .with_bindings( - uri_method: :get, - uri_template: "/v1/{parent}/bigQueryExports", - matches: [ - ["parent", %r{^projects/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the create_event_threat_detection_custom_module REST call - # - # @param request_pb [::Google::Cloud::SecurityCenter::V1::CreateEventThreatDetectionCustomModuleRequest] - # 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_event_threat_detection_custom_module_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :post, - uri_template: "/v1/{parent}/customModules", - body: "event_threat_detection_custom_module", - matches: [ - ["parent", %r{^organizations/[^/]+/eventThreatDetectionSettings/?$}, false] - ] - ) - .with_bindings( - uri_method: :post, - uri_template: "/v1/{parent}/customModules", - body: "event_threat_detection_custom_module", - matches: [ - ["parent", %r{^folders/[^/]+/eventThreatDetectionSettings/?$}, false] - ] - ) - .with_bindings( - uri_method: :post, - uri_template: "/v1/{parent}/customModules", - body: "event_threat_detection_custom_module", - matches: [ - ["parent", %r{^projects/[^/]+/eventThreatDetectionSettings/?$}, false] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the delete_event_threat_detection_custom_module REST call - # - # @param request_pb [::Google::Cloud::SecurityCenter::V1::DeleteEventThreatDetectionCustomModuleRequest] - # 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_event_threat_detection_custom_module_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :delete, - uri_template: "/v1/{name}", - matches: [ - ["name", %r{^organizations/[^/]+/eventThreatDetectionSettings/customModules/[^/]+/?$}, false] - ] - ) - .with_bindings( - uri_method: :delete, - uri_template: "/v1/{name}", - matches: [ - ["name", %r{^folders/[^/]+/eventThreatDetectionSettings/customModules/[^/]+/?$}, false] - ] - ) - .with_bindings( - uri_method: :delete, - uri_template: "/v1/{name}", - matches: [ - ["name", %r{^projects/[^/]+/eventThreatDetectionSettings/customModules/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the get_event_threat_detection_custom_module REST call - # - # @param request_pb [::Google::Cloud::SecurityCenter::V1::GetEventThreatDetectionCustomModuleRequest] - # 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_event_threat_detection_custom_module_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :get, - uri_template: "/v1/{name}", - matches: [ - ["name", %r{^organizations/[^/]+/eventThreatDetectionSettings/customModules/[^/]+/?$}, false] - ] - ) - .with_bindings( - uri_method: :get, - uri_template: "/v1/{name}", - matches: [ - ["name", %r{^folders/[^/]+/eventThreatDetectionSettings/customModules/[^/]+/?$}, false] - ] - ) - .with_bindings( - uri_method: :get, - uri_template: "/v1/{name}", - matches: [ - ["name", %r{^projects/[^/]+/eventThreatDetectionSettings/customModules/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the list_descendant_event_threat_detection_custom_modules REST call - # - # @param request_pb [::Google::Cloud::SecurityCenter::V1::ListDescendantEventThreatDetectionCustomModulesRequest] - # 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_descendant_event_threat_detection_custom_modules_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :get, - uri_template: "/v1/{parent}/customModules:listDescendant", - matches: [ - ["parent", %r{^organizations/[^/]+/eventThreatDetectionSettings/?$}, false] - ] - ) - .with_bindings( - uri_method: :get, - uri_template: "/v1/{parent}/customModules:listDescendant", - matches: [ - ["parent", %r{^folders/[^/]+/eventThreatDetectionSettings/?$}, false] - ] - ) - .with_bindings( - uri_method: :get, - uri_template: "/v1/{parent}/customModules:listDescendant", - matches: [ - ["parent", %r{^projects/[^/]+/eventThreatDetectionSettings/?$}, false] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the list_event_threat_detection_custom_modules REST call - # - # @param request_pb [::Google::Cloud::SecurityCenter::V1::ListEventThreatDetectionCustomModulesRequest] - # 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_event_threat_detection_custom_modules_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :get, - uri_template: "/v1/{parent}/customModules", - matches: [ - ["parent", %r{^organizations/[^/]+/eventThreatDetectionSettings/?$}, false] - ] - ) - .with_bindings( - uri_method: :get, - uri_template: "/v1/{parent}/customModules", - matches: [ - ["parent", %r{^folders/[^/]+/eventThreatDetectionSettings/?$}, false] - ] - ) - .with_bindings( - uri_method: :get, - uri_template: "/v1/{parent}/customModules", - matches: [ - ["parent", %r{^projects/[^/]+/eventThreatDetectionSettings/?$}, false] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the update_event_threat_detection_custom_module REST call - # - # @param request_pb [::Google::Cloud::SecurityCenter::V1::UpdateEventThreatDetectionCustomModuleRequest] - # 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_event_threat_detection_custom_module_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :patch, - uri_template: "/v1/{event_threat_detection_custom_module.name}", - body: "event_threat_detection_custom_module", - matches: [ - ["event_threat_detection_custom_module.name", %r{^organizations/[^/]+/eventThreatDetectionSettings/customModules/[^/]+/?$}, false] - ] - ) - .with_bindings( - uri_method: :patch, - uri_template: "/v1/{event_threat_detection_custom_module.name}", - body: "event_threat_detection_custom_module", - matches: [ - ["event_threat_detection_custom_module.name", %r{^folders/[^/]+/eventThreatDetectionSettings/customModules/[^/]+/?$}, false] - ] - ) - .with_bindings( - uri_method: :patch, - uri_template: "/v1/{event_threat_detection_custom_module.name}", - body: "event_threat_detection_custom_module", - matches: [ - ["event_threat_detection_custom_module.name", %r{^projects/[^/]+/eventThreatDetectionSettings/customModules/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the validate_event_threat_detection_custom_module REST call - # - # @param request_pb [::Google::Cloud::SecurityCenter::V1::ValidateEventThreatDetectionCustomModuleRequest] - # A request object representing the call parameters. Required. - # @return [Array(String, [String, nil], Hash{String => String})] - # Uri, Body, Query string parameters - def self.transcode_validate_event_threat_detection_custom_module_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :post, - uri_template: "/v1/{parent}:validateCustomModule", - body: "*", - matches: [ - ["parent", %r{^organizations/[^/]+/eventThreatDetectionSettings/?$}, false] - ] - ) - .with_bindings( - uri_method: :post, - uri_template: "/v1/{parent}:validateCustomModule", - body: "*", - matches: [ - ["parent", %r{^folders/[^/]+/eventThreatDetectionSettings/?$}, false] - ] - ) - .with_bindings( - uri_method: :post, - uri_template: "/v1/{parent}:validateCustomModule", - body: "*", - matches: [ - ["parent", %r{^projects/[^/]+/eventThreatDetectionSettings/?$}, false] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the get_effective_event_threat_detection_custom_module REST call - # - # @param request_pb [::Google::Cloud::SecurityCenter::V1::GetEffectiveEventThreatDetectionCustomModuleRequest] - # 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_effective_event_threat_detection_custom_module_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :get, - uri_template: "/v1/{name}", - matches: [ - ["name", %r{^organizations/[^/]+/eventThreatDetectionSettings/effectiveCustomModules/[^/]+/?$}, false] - ] - ) - .with_bindings( - uri_method: :get, - uri_template: "/v1/{name}", - matches: [ - ["name", %r{^folders/[^/]+/eventThreatDetectionSettings/effectiveCustomModules/[^/]+/?$}, false] - ] - ) - .with_bindings( - uri_method: :get, - uri_template: "/v1/{name}", - matches: [ - ["name", %r{^projects/[^/]+/eventThreatDetectionSettings/effectiveCustomModules/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the list_effective_event_threat_detection_custom_modules REST call - # - # @param request_pb [::Google::Cloud::SecurityCenter::V1::ListEffectiveEventThreatDetectionCustomModulesRequest] - # 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_effective_event_threat_detection_custom_modules_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :get, - uri_template: "/v1/{parent}/effectiveCustomModules", - matches: [ - ["parent", %r{^organizations/[^/]+/eventThreatDetectionSettings/?$}, false] - ] - ) - .with_bindings( - uri_method: :get, - uri_template: "/v1/{parent}/effectiveCustomModules", - matches: [ - ["parent", %r{^folders/[^/]+/eventThreatDetectionSettings/?$}, false] - ] - ) - .with_bindings( - uri_method: :get, - uri_template: "/v1/{parent}/effectiveCustomModules", - matches: [ - ["parent", %r{^projects/[^/]+/eventThreatDetectionSettings/?$}, false] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the batch_create_resource_value_configs REST call - # - # @param request_pb [::Google::Cloud::SecurityCenter::V1::BatchCreateResourceValueConfigsRequest] - # A request object representing the call parameters. Required. - # @return [Array(String, [String, nil], Hash{String => String})] - # Uri, Body, Query string parameters - def self.transcode_batch_create_resource_value_configs_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :post, - uri_template: "/v1/{parent}/resourceValueConfigs:batchCreate", - body: "*", - matches: [ - ["parent", %r{^organizations/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the delete_resource_value_config REST call - # - # @param request_pb [::Google::Cloud::SecurityCenter::V1::DeleteResourceValueConfigRequest] - # 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_resource_value_config_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :delete, - uri_template: "/v1/{name}", - matches: [ - ["name", %r{^organizations/[^/]+/resourceValueConfigs/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the get_resource_value_config REST call - # - # @param request_pb [::Google::Cloud::SecurityCenter::V1::GetResourceValueConfigRequest] - # 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_resource_value_config_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :get, - uri_template: "/v1/{name}", - matches: [ - ["name", %r{^organizations/[^/]+/resourceValueConfigs/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the list_resource_value_configs REST call - # - # @param request_pb [::Google::Cloud::SecurityCenter::V1::ListResourceValueConfigsRequest] - # 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_resource_value_configs_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :get, - uri_template: "/v1/{parent}/resourceValueConfigs", - matches: [ - ["parent", %r{^organizations/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the update_resource_value_config REST call - # - # @param request_pb [::Google::Cloud::SecurityCenter::V1::UpdateResourceValueConfigRequest] - # 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_resource_value_config_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :patch, - uri_template: "/v1/{resource_value_config.name}", - body: "resource_value_config", - matches: [ - ["resource_value_config.name", %r{^organizations/[^/]+/resourceValueConfigs/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the list_valued_resources REST call - # - # @param request_pb [::Google::Cloud::SecurityCenter::V1::ListValuedResourcesRequest] - # 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_valued_resources_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :get, - uri_template: "/v1/{parent}/valuedResources", - matches: [ - ["parent", %r{^organizations/[^/]+/simulations/[^/]+/?$}, false] - ] - ) - .with_bindings( - uri_method: :get, - uri_template: "/v1/{parent}/valuedResources", - matches: [ - ["parent", %r{^organizations/[^/]+/simulations/[^/]+/attackExposureResults/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the list_attack_paths REST call - # - # @param request_pb [::Google::Cloud::SecurityCenter::V1::ListAttackPathsRequest] - # 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_attack_paths_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :get, - uri_template: "/v1/{parent}/attackPaths", - matches: [ - ["parent", %r{^organizations/[^/]+/simulations/[^/]+/?$}, false] - ] - ) - .with_bindings( - uri_method: :get, - uri_template: "/v1/{parent}/attackPaths", - matches: [ - ["parent", %r{^organizations/[^/]+/simulations/[^/]+/valuedResources/[^/]+/?$}, false] - ] - ) - .with_bindings( - uri_method: :get, - uri_template: "/v1/{parent}/attackPaths", - matches: [ - ["parent", %r{^organizations/[^/]+/simulations/[^/]+/attackExposureResults/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - end - end - end - end - end - end -end diff --git a/owl-bot-staging/google-cloud-security_center-v1/lib/google/cloud/security_center/v1/version.rb b/owl-bot-staging/google-cloud-security_center-v1/lib/google/cloud/security_center/v1/version.rb deleted file mode 100644 index 1c19ab7f4c05..000000000000 --- a/owl-bot-staging/google-cloud-security_center-v1/lib/google/cloud/security_center/v1/version.rb +++ /dev/null @@ -1,28 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - - -module Google - module Cloud - module SecurityCenter - module V1 - VERSION = "0.0.1" - end - end - end -end diff --git a/owl-bot-staging/google-cloud-security_center-v1/lib/google/cloud/securitycenter/v1/access_pb.rb b/owl-bot-staging/google-cloud-security_center-v1/lib/google/cloud/securitycenter/v1/access_pb.rb deleted file mode 100644 index 65cfc17f9bbb..000000000000 --- a/owl-bot-staging/google-cloud-security_center-v1/lib/google/cloud/securitycenter/v1/access_pb.rb +++ /dev/null @@ -1,23 +0,0 @@ -# frozen_string_literal: true -# Generated by the protocol buffer compiler. DO NOT EDIT! -# source: google/cloud/securitycenter/v1/access.proto - -require 'google/protobuf' - - -descriptor_data = "\n+google/cloud/securitycenter/v1/access.proto\x12\x1egoogle.cloud.securitycenter.v1\"\x89\x03\n\x06\x41\x63\x63\x65ss\x12\x17\n\x0fprincipal_email\x18\x01 \x01(\t\x12\x11\n\tcaller_ip\x18\x02 \x01(\t\x12\x42\n\rcaller_ip_geo\x18\x03 \x01(\x0b\x32+.google.cloud.securitycenter.v1.Geolocation\x12\x19\n\x11user_agent_family\x18\x04 \x01(\t\x12\x12\n\nuser_agent\x18\x0c \x01(\t\x12\x14\n\x0cservice_name\x18\x05 \x01(\t\x12\x13\n\x0bmethod_name\x18\x06 \x01(\t\x12\x19\n\x11principal_subject\x18\x07 \x01(\t\x12 \n\x18service_account_key_name\x18\x08 \x01(\t\x12\x65\n\x1fservice_account_delegation_info\x18\t \x03(\x0b\x32<.google.cloud.securitycenter.v1.ServiceAccountDelegationInfo\x12\x11\n\tuser_name\x18\x0b \x01(\t\"R\n\x1cServiceAccountDelegationInfo\x12\x17\n\x0fprincipal_email\x18\x01 \x01(\t\x12\x19\n\x11principal_subject\x18\x02 \x01(\t\"\"\n\x0bGeolocation\x12\x13\n\x0bregion_code\x18\x01 \x01(\tB\xe5\x01\n\"com.google.cloud.securitycenter.v1B\x0b\x41\x63\x63\x65ssProtoP\x01ZJcloud.google.com/go/securitycenter/apiv1/securitycenterpb;securitycenterpb\xaa\x02\x1eGoogle.Cloud.SecurityCenter.V1\xca\x02\x1eGoogle\\Cloud\\SecurityCenter\\V1\xea\x02!Google::Cloud::SecurityCenter::V1b\x06proto3" - -pool = ::Google::Protobuf::DescriptorPool.generated_pool -pool.add_serialized_file(descriptor_data) - -module Google - module Cloud - module SecurityCenter - module V1 - Access = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.securitycenter.v1.Access").msgclass - ServiceAccountDelegationInfo = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.securitycenter.v1.ServiceAccountDelegationInfo").msgclass - Geolocation = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.securitycenter.v1.Geolocation").msgclass - end - end - end -end diff --git a/owl-bot-staging/google-cloud-security_center-v1/lib/google/cloud/securitycenter/v1/application_pb.rb b/owl-bot-staging/google-cloud-security_center-v1/lib/google/cloud/securitycenter/v1/application_pb.rb deleted file mode 100644 index 716a87e5400a..000000000000 --- a/owl-bot-staging/google-cloud-security_center-v1/lib/google/cloud/securitycenter/v1/application_pb.rb +++ /dev/null @@ -1,21 +0,0 @@ -# frozen_string_literal: true -# Generated by the protocol buffer compiler. DO NOT EDIT! -# source: google/cloud/securitycenter/v1/application.proto - -require 'google/protobuf' - - -descriptor_data = "\n0google/cloud/securitycenter/v1/application.proto\x12\x1egoogle.cloud.securitycenter.v1\"1\n\x0b\x41pplication\x12\x10\n\x08\x62\x61se_uri\x18\x01 \x01(\t\x12\x10\n\x08\x66ull_uri\x18\x02 \x01(\tB\xea\x01\n\"com.google.cloud.securitycenter.v1B\x10\x41pplicationProtoP\x01ZJcloud.google.com/go/securitycenter/apiv1/securitycenterpb;securitycenterpb\xaa\x02\x1eGoogle.Cloud.SecurityCenter.V1\xca\x02\x1eGoogle\\Cloud\\SecurityCenter\\V1\xea\x02!Google::Cloud::SecurityCenter::V1b\x06proto3" - -pool = ::Google::Protobuf::DescriptorPool.generated_pool -pool.add_serialized_file(descriptor_data) - -module Google - module Cloud - module SecurityCenter - module V1 - Application = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.securitycenter.v1.Application").msgclass - end - end - end -end diff --git a/owl-bot-staging/google-cloud-security_center-v1/lib/google/cloud/securitycenter/v1/asset_pb.rb b/owl-bot-staging/google-cloud-security_center-v1/lib/google/cloud/securitycenter/v1/asset_pb.rb deleted file mode 100644 index 7bbe0a82baf9..000000000000 --- a/owl-bot-staging/google-cloud-security_center-v1/lib/google/cloud/securitycenter/v1/asset_pb.rb +++ /dev/null @@ -1,29 +0,0 @@ -# frozen_string_literal: true -# Generated by the protocol buffer compiler. DO NOT EDIT! -# source: google/cloud/securitycenter/v1/asset.proto - -require 'google/protobuf' - -require 'google/api/resource_pb' -require 'google/cloud/securitycenter/v1/folder_pb' -require 'google/cloud/securitycenter/v1/security_marks_pb' -require 'google/protobuf/struct_pb' -require 'google/protobuf/timestamp_pb' - - -descriptor_data = "\n*google/cloud/securitycenter/v1/asset.proto\x12\x1egoogle.cloud.securitycenter.v1\x1a\x19google/api/resource.proto\x1a+google/cloud/securitycenter/v1/folder.proto\x1a\x33google/cloud/securitycenter/v1/security_marks.proto\x1a\x1cgoogle/protobuf/struct.proto\x1a\x1fgoogle/protobuf/timestamp.proto\"\xb8\x08\n\x05\x41sset\x12\x0c\n\x04name\x18\x01 \x01(\t\x12\x62\n\x1asecurity_center_properties\x18\x02 \x01(\x0b\x32>.google.cloud.securitycenter.v1.Asset.SecurityCenterProperties\x12Z\n\x13resource_properties\x18\x07 \x03(\x0b\x32=.google.cloud.securitycenter.v1.Asset.ResourcePropertiesEntry\x12\x45\n\x0esecurity_marks\x18\x08 \x01(\x0b\x32-.google.cloud.securitycenter.v1.SecurityMarks\x12/\n\x0b\x63reate_time\x18\t \x01(\x0b\x32\x1a.google.protobuf.Timestamp\x12/\n\x0bupdate_time\x18\n \x01(\x0b\x32\x1a.google.protobuf.Timestamp\x12\x43\n\niam_policy\x18\x0b \x01(\x0b\x32/.google.cloud.securitycenter.v1.Asset.IamPolicy\x12\x16\n\x0e\x63\x61nonical_name\x18\r \x01(\t\x1a\xb9\x02\n\x18SecurityCenterProperties\x12\x15\n\rresource_name\x18\x01 \x01(\t\x12\x15\n\rresource_type\x18\x02 \x01(\t\x12\x17\n\x0fresource_parent\x18\x03 \x01(\t\x12\x18\n\x10resource_project\x18\x04 \x01(\t\x12\x17\n\x0fresource_owners\x18\x05 \x03(\t\x12\x1d\n\x15resource_display_name\x18\x06 \x01(\t\x12$\n\x1cresource_parent_display_name\x18\x07 \x01(\t\x12%\n\x1dresource_project_display_name\x18\x08 \x01(\t\x12\x37\n\x07\x66olders\x18\n \x03(\x0b\x32&.google.cloud.securitycenter.v1.Folder\x1a \n\tIamPolicy\x12\x13\n\x0bpolicy_blob\x18\x01 \x01(\t\x1aQ\n\x17ResourcePropertiesEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12%\n\x05value\x18\x02 \x01(\x0b\x32\x16.google.protobuf.Value:\x02\x38\x01:\xa9\x01\xea\x41\xa5\x01\n#securitycenter.googleapis.com/Asset\x12+organizations/{organization}/assets/{asset}\x12\x1f\x66olders/{folder}/assets/{asset}\x12!projects/{project}/assets/{asset}*\x06\x61ssets2\x05\x61ssetB\xd8\x01\n\"com.google.cloud.securitycenter.v1P\x01ZJcloud.google.com/go/securitycenter/apiv1/securitycenterpb;securitycenterpb\xaa\x02\x1eGoogle.Cloud.SecurityCenter.V1\xca\x02\x1eGoogle\\Cloud\\SecurityCenter\\V1\xea\x02!Google::Cloud::SecurityCenter::V1b\x06proto3" - -pool = ::Google::Protobuf::DescriptorPool.generated_pool -pool.add_serialized_file(descriptor_data) - -module Google - module Cloud - module SecurityCenter - module V1 - Asset = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.securitycenter.v1.Asset").msgclass - Asset::SecurityCenterProperties = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.securitycenter.v1.Asset.SecurityCenterProperties").msgclass - Asset::IamPolicy = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.securitycenter.v1.Asset.IamPolicy").msgclass - end - end - end -end diff --git a/owl-bot-staging/google-cloud-security_center-v1/lib/google/cloud/securitycenter/v1/attack_exposure_pb.rb b/owl-bot-staging/google-cloud-security_center-v1/lib/google/cloud/securitycenter/v1/attack_exposure_pb.rb deleted file mode 100644 index 874c9ce74d43..000000000000 --- a/owl-bot-staging/google-cloud-security_center-v1/lib/google/cloud/securitycenter/v1/attack_exposure_pb.rb +++ /dev/null @@ -1,24 +0,0 @@ -# frozen_string_literal: true -# Generated by the protocol buffer compiler. DO NOT EDIT! -# source: google/cloud/securitycenter/v1/attack_exposure.proto - -require 'google/protobuf' - -require 'google/protobuf/timestamp_pb' - - -descriptor_data = "\n4google/cloud/securitycenter/v1/attack_exposure.proto\x12\x1egoogle.cloud.securitycenter.v1\x1a\x1fgoogle/protobuf/timestamp.proto\"\x8a\x03\n\x0e\x41ttackExposure\x12\r\n\x05score\x18\x01 \x01(\x01\x12;\n\x17latest_calculation_time\x18\x02 \x01(\x0b\x32\x1a.google.protobuf.Timestamp\x12\x1e\n\x16\x61ttack_exposure_result\x18\x03 \x01(\t\x12\x43\n\x05state\x18\x04 \x01(\x0e\x32\x34.google.cloud.securitycenter.v1.AttackExposure.State\x12*\n\"exposed_high_value_resources_count\x18\x05 \x01(\x05\x12,\n$exposed_medium_value_resources_count\x18\x06 \x01(\x05\x12)\n!exposed_low_value_resources_count\x18\x07 \x01(\x05\"B\n\x05State\x12\x15\n\x11STATE_UNSPECIFIED\x10\x00\x12\x0e\n\nCALCULATED\x10\x01\x12\x12\n\x0eNOT_CALCULATED\x10\x02\x42\xed\x01\n\"com.google.cloud.securitycenter.v1B\x13\x41ttackExposureProtoP\x01ZJcloud.google.com/go/securitycenter/apiv1/securitycenterpb;securitycenterpb\xaa\x02\x1eGoogle.Cloud.SecurityCenter.V1\xca\x02\x1eGoogle\\Cloud\\SecurityCenter\\V1\xea\x02!Google::Cloud::SecurityCenter::V1b\x06proto3" - -pool = ::Google::Protobuf::DescriptorPool.generated_pool -pool.add_serialized_file(descriptor_data) - -module Google - module Cloud - module SecurityCenter - module V1 - AttackExposure = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.securitycenter.v1.AttackExposure").msgclass - AttackExposure::State = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.securitycenter.v1.AttackExposure.State").enummodule - end - end - end -end diff --git a/owl-bot-staging/google-cloud-security_center-v1/lib/google/cloud/securitycenter/v1/attack_path_pb.rb b/owl-bot-staging/google-cloud-security_center-v1/lib/google/cloud/securitycenter/v1/attack_path_pb.rb deleted file mode 100644 index 9a0cc9065451..000000000000 --- a/owl-bot-staging/google-cloud-security_center-v1/lib/google/cloud/securitycenter/v1/attack_path_pb.rb +++ /dev/null @@ -1,28 +0,0 @@ -# frozen_string_literal: true -# Generated by the protocol buffer compiler. DO NOT EDIT! -# source: google/cloud/securitycenter/v1/attack_path.proto - -require 'google/protobuf' - -require 'google/api/resource_pb' - - -descriptor_data = "\n0google/cloud/securitycenter/v1/attack_path.proto\x12\x1egoogle.cloud.securitycenter.v1\x1a\x19google/api/resource.proto\"\xe7\t\n\nAttackPath\x12\x0c\n\x04name\x18\x01 \x01(\t\x12M\n\npath_nodes\x18\x02 \x03(\x0b\x32\x39.google.cloud.securitycenter.v1.AttackPath.AttackPathNode\x12H\n\x05\x65\x64ges\x18\x03 \x03(\x0b\x32\x39.google.cloud.securitycenter.v1.AttackPath.AttackPathEdge\x1a\xbd\x06\n\x0e\x41ttackPathNode\x12\x10\n\x08resource\x18\x01 \x01(\t\x12\x15\n\rresource_type\x18\x02 \x01(\t\x12\x14\n\x0c\x64isplay_name\x18\x03 \x01(\t\x12p\n\x13\x61ssociated_findings\x18\x04 \x03(\x0b\x32S.google.cloud.securitycenter.v1.AttackPath.AttackPathNode.PathNodeAssociatedFinding\x12\x0c\n\x04uuid\x18\x05 \x01(\t\x12^\n\x0c\x61ttack_steps\x18\x06 \x03(\x0b\x32H.google.cloud.securitycenter.v1.AttackPath.AttackPathNode.AttackStepNode\x1a^\n\x19PathNodeAssociatedFinding\x12\x19\n\x11\x63\x61nonical_finding\x18\x01 \x01(\t\x12\x18\n\x10\x66inding_category\x18\x02 \x01(\t\x12\x0c\n\x04name\x18\x03 \x01(\t\x1a\xb0\x02\n\x0e\x41ttackStepNode\x12\x0c\n\x04uuid\x18\x01 \x01(\t\x12P\n\x04type\x18\x02 \x01(\x0e\x32\x42.google.cloud.securitycenter.v1.AttackPath.AttackPathNode.NodeType\x12\x14\n\x0c\x64isplay_name\x18\x03 \x01(\t\x12\x64\n\x06labels\x18\x04 \x03(\x0b\x32T.google.cloud.securitycenter.v1.AttackPath.AttackPathNode.AttackStepNode.LabelsEntry\x12\x13\n\x0b\x64\x65scription\x18\x05 \x01(\t\x1a-\n\x0bLabelsEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12\r\n\x05value\x18\x02 \x01(\t:\x02\x38\x01\"y\n\x08NodeType\x12\x19\n\x15NODE_TYPE_UNSPECIFIED\x10\x00\x12\x11\n\rNODE_TYPE_AND\x10\x01\x12\x10\n\x0cNODE_TYPE_OR\x10\x02\x12\x15\n\x11NODE_TYPE_DEFENSE\x10\x03\x12\x16\n\x12NODE_TYPE_ATTACKER\x10\x04\x1a\x35\n\x0e\x41ttackPathEdge\x12\x0e\n\x06source\x18\x01 \x01(\t\x12\x13\n\x0b\x64\x65stination\x18\x02 \x01(\t:\xba\x01\xea\x41\xb6\x01\n(securitycenter.googleapis.com/AttackPath\x12qorganizations/{organization}/simulations/{simulation}/valuedResources/{valued_resource}/attackPaths/{attack_path}*\x0b\x61ttackPaths2\nattackPathB\xe9\x01\n\"com.google.cloud.securitycenter.v1B\x0f\x41ttackPathProtoP\x01ZJcloud.google.com/go/securitycenter/apiv1/securitycenterpb;securitycenterpb\xaa\x02\x1eGoogle.Cloud.SecurityCenter.V1\xca\x02\x1eGoogle\\Cloud\\SecurityCenter\\V1\xea\x02!Google::Cloud::SecurityCenter::V1b\x06proto3" - -pool = ::Google::Protobuf::DescriptorPool.generated_pool -pool.add_serialized_file(descriptor_data) - -module Google - module Cloud - module SecurityCenter - module V1 - AttackPath = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.securitycenter.v1.AttackPath").msgclass - AttackPath::AttackPathNode = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.securitycenter.v1.AttackPath.AttackPathNode").msgclass - AttackPath::AttackPathNode::PathNodeAssociatedFinding = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.securitycenter.v1.AttackPath.AttackPathNode.PathNodeAssociatedFinding").msgclass - AttackPath::AttackPathNode::AttackStepNode = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.securitycenter.v1.AttackPath.AttackPathNode.AttackStepNode").msgclass - AttackPath::AttackPathNode::NodeType = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.securitycenter.v1.AttackPath.AttackPathNode.NodeType").enummodule - AttackPath::AttackPathEdge = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.securitycenter.v1.AttackPath.AttackPathEdge").msgclass - end - end - end -end diff --git a/owl-bot-staging/google-cloud-security_center-v1/lib/google/cloud/securitycenter/v1/backup_disaster_recovery_pb.rb b/owl-bot-staging/google-cloud-security_center-v1/lib/google/cloud/securitycenter/v1/backup_disaster_recovery_pb.rb deleted file mode 100644 index 0e004d7fc559..000000000000 --- a/owl-bot-staging/google-cloud-security_center-v1/lib/google/cloud/securitycenter/v1/backup_disaster_recovery_pb.rb +++ /dev/null @@ -1,23 +0,0 @@ -# frozen_string_literal: true -# Generated by the protocol buffer compiler. DO NOT EDIT! -# source: google/cloud/securitycenter/v1/backup_disaster_recovery.proto - -require 'google/protobuf' - -require 'google/protobuf/timestamp_pb' - - -descriptor_data = "\n=google/cloud/securitycenter/v1/backup_disaster_recovery.proto\x12\x1egoogle.cloud.securitycenter.v1\x1a\x1fgoogle/protobuf/timestamp.proto\"\x86\x02\n\x16\x42\x61\x63kupDisasterRecovery\x12\x17\n\x0f\x62\x61\x63kup_template\x18\x01 \x01(\t\x12\x10\n\x08policies\x18\x02 \x03(\t\x12\x0c\n\x04host\x18\x03 \x01(\t\x12\x14\n\x0c\x61pplications\x18\x04 \x03(\t\x12\x14\n\x0cstorage_pool\x18\x05 \x01(\t\x12\x16\n\x0epolicy_options\x18\x06 \x03(\t\x12\x0f\n\x07profile\x18\x07 \x01(\t\x12\x11\n\tappliance\x18\x08 \x01(\t\x12\x13\n\x0b\x62\x61\x63kup_type\x18\t \x01(\t\x12\x36\n\x12\x62\x61\x63kup_create_time\x18\n \x01(\x0b\x32\x1a.google.protobuf.TimestampB\xf5\x01\n\"com.google.cloud.securitycenter.v1B\x1b\x42\x61\x63kupDisasterRecoveryProtoP\x01ZJcloud.google.com/go/securitycenter/apiv1/securitycenterpb;securitycenterpb\xaa\x02\x1eGoogle.Cloud.SecurityCenter.V1\xca\x02\x1eGoogle\\Cloud\\SecurityCenter\\V1\xea\x02!Google::Cloud::SecurityCenter::V1b\x06proto3" - -pool = ::Google::Protobuf::DescriptorPool.generated_pool -pool.add_serialized_file(descriptor_data) - -module Google - module Cloud - module SecurityCenter - module V1 - BackupDisasterRecovery = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.securitycenter.v1.BackupDisasterRecovery").msgclass - end - end - end -end diff --git a/owl-bot-staging/google-cloud-security_center-v1/lib/google/cloud/securitycenter/v1/bigquery_export_pb.rb b/owl-bot-staging/google-cloud-security_center-v1/lib/google/cloud/securitycenter/v1/bigquery_export_pb.rb deleted file mode 100644 index dd2586de3962..000000000000 --- a/owl-bot-staging/google-cloud-security_center-v1/lib/google/cloud/securitycenter/v1/bigquery_export_pb.rb +++ /dev/null @@ -1,25 +0,0 @@ -# frozen_string_literal: true -# Generated by the protocol buffer compiler. DO NOT EDIT! -# source: google/cloud/securitycenter/v1/bigquery_export.proto - -require 'google/protobuf' - -require 'google/api/field_behavior_pb' -require 'google/api/resource_pb' -require 'google/protobuf/timestamp_pb' - - -descriptor_data = "\n4google/cloud/securitycenter/v1/bigquery_export.proto\x12\x1egoogle.cloud.securitycenter.v1\x1a\x1fgoogle/api/field_behavior.proto\x1a\x19google/api/resource.proto\x1a\x1fgoogle/protobuf/timestamp.proto\"\xde\x03\n\x0e\x42igQueryExport\x12\x0c\n\x04name\x18\x01 \x01(\t\x12\x13\n\x0b\x64\x65scription\x18\x02 \x01(\t\x12\x0e\n\x06\x66ilter\x18\x03 \x01(\t\x12\x0f\n\x07\x64\x61taset\x18\x04 \x01(\t\x12\x34\n\x0b\x63reate_time\x18\x05 \x01(\x0b\x32\x1a.google.protobuf.TimestampB\x03\xe0\x41\x03\x12\x34\n\x0bupdate_time\x18\x06 \x01(\x0b\x32\x1a.google.protobuf.TimestampB\x03\xe0\x41\x03\x12\x1f\n\x12most_recent_editor\x18\x07 \x01(\tB\x03\xe0\x41\x03\x12\x16\n\tprincipal\x18\x08 \x01(\tB\x03\xe0\x41\x03:\xe2\x01\xea\x41\xde\x01\n,securitycenter.googleapis.com/BigQueryExport\x12\x35organizations/{organization}/bigQueryExports/{export}\x12)folders/{folder}/bigQueryExports/{export}\x12+projects/{project}/bigQueryExports/{export}*\x0f\x62igQueryExports2\x0e\x62igQueryExportB\xed\x01\n\"com.google.cloud.securitycenter.v1B\x13\x42igQueryExportProtoP\x01ZJcloud.google.com/go/securitycenter/apiv1/securitycenterpb;securitycenterpb\xaa\x02\x1eGoogle.Cloud.SecurityCenter.V1\xca\x02\x1eGoogle\\Cloud\\SecurityCenter\\V1\xea\x02!Google::Cloud::SecurityCenter::V1b\x06proto3" - -pool = ::Google::Protobuf::DescriptorPool.generated_pool -pool.add_serialized_file(descriptor_data) - -module Google - module Cloud - module SecurityCenter - module V1 - BigQueryExport = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.securitycenter.v1.BigQueryExport").msgclass - end - end - end -end diff --git a/owl-bot-staging/google-cloud-security_center-v1/lib/google/cloud/securitycenter/v1/chokepoint_pb.rb b/owl-bot-staging/google-cloud-security_center-v1/lib/google/cloud/securitycenter/v1/chokepoint_pb.rb deleted file mode 100644 index bcdd9d0754f3..000000000000 --- a/owl-bot-staging/google-cloud-security_center-v1/lib/google/cloud/securitycenter/v1/chokepoint_pb.rb +++ /dev/null @@ -1,21 +0,0 @@ -# frozen_string_literal: true -# Generated by the protocol buffer compiler. DO NOT EDIT! -# source: google/cloud/securitycenter/v1/chokepoint.proto - -require 'google/protobuf' - - -descriptor_data = "\n/google/cloud/securitycenter/v1/chokepoint.proto\x12\x1egoogle.cloud.securitycenter.v1\"&\n\nChokepoint\x12\x18\n\x10related_findings\x18\x01 \x03(\tB\xe9\x01\n\"com.google.cloud.securitycenter.v1B\x0f\x43hokepointProtoP\x01ZJcloud.google.com/go/securitycenter/apiv1/securitycenterpb;securitycenterpb\xaa\x02\x1eGoogle.Cloud.SecurityCenter.V1\xca\x02\x1eGoogle\\Cloud\\SecurityCenter\\V1\xea\x02!Google::Cloud::SecurityCenter::V1b\x06proto3" - -pool = ::Google::Protobuf::DescriptorPool.generated_pool -pool.add_serialized_file(descriptor_data) - -module Google - module Cloud - module SecurityCenter - module V1 - Chokepoint = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.securitycenter.v1.Chokepoint").msgclass - end - end - end -end diff --git a/owl-bot-staging/google-cloud-security_center-v1/lib/google/cloud/securitycenter/v1/cloud_armor_pb.rb b/owl-bot-staging/google-cloud-security_center-v1/lib/google/cloud/securitycenter/v1/cloud_armor_pb.rb deleted file mode 100644 index 5d2aca35a2a8..000000000000 --- a/owl-bot-staging/google-cloud-security_center-v1/lib/google/cloud/securitycenter/v1/cloud_armor_pb.rb +++ /dev/null @@ -1,27 +0,0 @@ -# frozen_string_literal: true -# Generated by the protocol buffer compiler. DO NOT EDIT! -# source: google/cloud/securitycenter/v1/cloud_armor.proto - -require 'google/protobuf' - -require 'google/protobuf/duration_pb' - - -descriptor_data = "\n0google/cloud/securitycenter/v1/cloud_armor.proto\x12\x1egoogle.cloud.securitycenter.v1\x1a\x1egoogle/protobuf/duration.proto\"\xde\x02\n\nCloudArmor\x12G\n\x0fsecurity_policy\x18\x01 \x01(\x0b\x32..google.cloud.securitycenter.v1.SecurityPolicy\x12:\n\x08requests\x18\x02 \x01(\x0b\x32(.google.cloud.securitycenter.v1.Requests\x12O\n\x13\x61\x64\x61ptive_protection\x18\x03 \x01(\x0b\x32\x32.google.cloud.securitycenter.v1.AdaptiveProtection\x12\x36\n\x06\x61ttack\x18\x04 \x01(\x0b\x32&.google.cloud.securitycenter.v1.Attack\x12\x15\n\rthreat_vector\x18\x05 \x01(\t\x12+\n\x08\x64uration\x18\x06 \x01(\x0b\x32\x19.google.protobuf.Duration\"=\n\x0eSecurityPolicy\x12\x0c\n\x04name\x18\x01 \x01(\t\x12\x0c\n\x04type\x18\x02 \x01(\t\x12\x0f\n\x07preview\x18\x03 \x01(\x08\"j\n\x08Requests\x12\r\n\x05ratio\x18\x01 \x01(\x01\x12\x1a\n\x12short_term_allowed\x18\x02 \x01(\x05\x12\x19\n\x11long_term_allowed\x18\x03 \x01(\x05\x12\x18\n\x10long_term_denied\x18\x04 \x01(\x05\"(\n\x12\x41\x64\x61ptiveProtection\x12\x12\n\nconfidence\x18\x01 \x01(\x01\"H\n\x06\x41ttack\x12\x12\n\nvolume_pps\x18\x01 \x01(\x05\x12\x12\n\nvolume_bps\x18\x02 \x01(\x05\x12\x16\n\x0e\x63lassification\x18\x03 \x01(\tB\xe9\x01\n\"com.google.cloud.securitycenter.v1B\x0f\x43loudArmorProtoP\x01ZJcloud.google.com/go/securitycenter/apiv1/securitycenterpb;securitycenterpb\xaa\x02\x1eGoogle.Cloud.SecurityCenter.V1\xca\x02\x1eGoogle\\Cloud\\SecurityCenter\\V1\xea\x02!Google::Cloud::SecurityCenter::V1b\x06proto3" - -pool = ::Google::Protobuf::DescriptorPool.generated_pool -pool.add_serialized_file(descriptor_data) - -module Google - module Cloud - module SecurityCenter - module V1 - CloudArmor = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.securitycenter.v1.CloudArmor").msgclass - SecurityPolicy = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.securitycenter.v1.SecurityPolicy").msgclass - Requests = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.securitycenter.v1.Requests").msgclass - AdaptiveProtection = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.securitycenter.v1.AdaptiveProtection").msgclass - Attack = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.securitycenter.v1.Attack").msgclass - end - end - end -end diff --git a/owl-bot-staging/google-cloud-security_center-v1/lib/google/cloud/securitycenter/v1/cloud_dlp_data_profile_pb.rb b/owl-bot-staging/google-cloud-security_center-v1/lib/google/cloud/securitycenter/v1/cloud_dlp_data_profile_pb.rb deleted file mode 100644 index 96dd00769215..000000000000 --- a/owl-bot-staging/google-cloud-security_center-v1/lib/google/cloud/securitycenter/v1/cloud_dlp_data_profile_pb.rb +++ /dev/null @@ -1,27 +0,0 @@ -# frozen_string_literal: true -# Generated by the protocol buffer compiler. DO NOT EDIT! -# source: google/cloud/securitycenter/v1/cloud_dlp_data_profile.proto - -require 'google/protobuf' - -require 'google/api/resource_pb' - - -descriptor_data = "\n;google/cloud/securitycenter/v1/cloud_dlp_data_profile.proto\x12\x1egoogle.cloud.securitycenter.v1\x1a\x19google/api/resource.proto\"\xb2\x02\n\x13\x43loudDlpDataProfile\x12>\n\x0c\x64\x61ta_profile\x18\x01 \x01(\tB(\xfa\x41%\n#dlp.googleapis.com/TableDataProfile\x12S\n\x0bparent_type\x18\x02 \x01(\x0e\x32>.google.cloud.securitycenter.v1.CloudDlpDataProfile.ParentType\x12<\n\ninfo_types\x18\x03 \x03(\x0b\x32(.google.cloud.securitycenter.v1.InfoType\"H\n\nParentType\x12\x1b\n\x17PARENT_TYPE_UNSPECIFIED\x10\x00\x12\x10\n\x0cORGANIZATION\x10\x01\x12\x0b\n\x07PROJECT\x10\x02\"v\n\x08InfoType\x12\x0c\n\x04name\x18\x01 \x01(\t\x12\x0f\n\x07version\x18\x02 \x01(\t\x12K\n\x11sensitivity_score\x18\x03 \x01(\x0b\x32\x30.google.cloud.securitycenter.v1.SensitivityScore\"\x8a\x02\n\x10SensitivityScore\x12U\n\x05score\x18\x01 \x01(\x0e\x32\x46.google.cloud.securitycenter.v1.SensitivityScore.SensitivityScoreLevel\"\x9e\x01\n\x15SensitivityScoreLevel\x12\'\n#SENSITIVITY_SCORE_LEVEL_UNSPECIFIED\x10\x00\x12\x13\n\x0fSENSITIVITY_LOW\x10\n\x12\x17\n\x13SENSITIVITY_UNKNOWN\x10\x0c\x12\x18\n\x14SENSITIVITY_MODERATE\x10\x14\x12\x14\n\x10SENSITIVITY_HIGH\x10\x1e\x42\x94\x03\n\"com.google.cloud.securitycenter.v1B\x18\x43loudDlpDataProfileProtoP\x01ZJcloud.google.com/go/securitycenter/apiv1/securitycenterpb;securitycenterpb\xaa\x02\x1eGoogle.Cloud.SecurityCenter.V1\xca\x02\x1eGoogle\\Cloud\\SecurityCenter\\V1\xea\x02!Google::Cloud::SecurityCenter::V1\xea\x41\x9e\x01\n#dlp.googleapis.com/TableDataProfile\x12\x30projects/{project}/tableProfiles/{table_profile}\x12\x45projects/{project}/locations/{location}/tableProfiles/{table_profile}b\x06proto3" - -pool = ::Google::Protobuf::DescriptorPool.generated_pool -pool.add_serialized_file(descriptor_data) - -module Google - module Cloud - module SecurityCenter - module V1 - CloudDlpDataProfile = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.securitycenter.v1.CloudDlpDataProfile").msgclass - CloudDlpDataProfile::ParentType = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.securitycenter.v1.CloudDlpDataProfile.ParentType").enummodule - InfoType = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.securitycenter.v1.InfoType").msgclass - SensitivityScore = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.securitycenter.v1.SensitivityScore").msgclass - SensitivityScore::SensitivityScoreLevel = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.securitycenter.v1.SensitivityScore.SensitivityScoreLevel").enummodule - end - end - end -end diff --git a/owl-bot-staging/google-cloud-security_center-v1/lib/google/cloud/securitycenter/v1/cloud_dlp_inspection_pb.rb b/owl-bot-staging/google-cloud-security_center-v1/lib/google/cloud/securitycenter/v1/cloud_dlp_inspection_pb.rb deleted file mode 100644 index 6908abf33a2c..000000000000 --- a/owl-bot-staging/google-cloud-security_center-v1/lib/google/cloud/securitycenter/v1/cloud_dlp_inspection_pb.rb +++ /dev/null @@ -1,23 +0,0 @@ -# frozen_string_literal: true -# Generated by the protocol buffer compiler. DO NOT EDIT! -# source: google/cloud/securitycenter/v1/cloud_dlp_inspection.proto - -require 'google/protobuf' - -require 'google/api/resource_pb' - - -descriptor_data = "\n9google/cloud/securitycenter/v1/cloud_dlp_inspection.proto\x12\x1egoogle.cloud.securitycenter.v1\x1a\x19google/api/resource.proto\"\x88\x01\n\x12\x43loudDlpInspection\x12\x33\n\x0binspect_job\x18\x01 \x01(\tB\x1e\xfa\x41\x1b\n\x19\x64lp.googleapis.com/DlpJob\x12\x11\n\tinfo_type\x18\x02 \x01(\t\x12\x17\n\x0finfo_type_count\x18\x03 \x01(\x03\x12\x11\n\tfull_scan\x18\x04 \x01(\x08\x42\xf0\x02\n\"com.google.cloud.securitycenter.v1B\x17\x43loudDlpInspectionProtoP\x01ZJcloud.google.com/go/securitycenter/apiv1/securitycenterpb;securitycenterpb\xaa\x02\x1eGoogle.Cloud.SecurityCenter.V1\xca\x02\x1eGoogle\\Cloud\\SecurityCenter\\V1\xea\x02!Google::Cloud::SecurityCenter::V1\xea\x41|\n\x19\x64lp.googleapis.com/DlpJob\x12$projects/{project}/dlpJobs/{dlp_job}\x12\x39projects/{project}/locations/{location}/dlpJobs/{dlp_job}b\x06proto3" - -pool = ::Google::Protobuf::DescriptorPool.generated_pool -pool.add_serialized_file(descriptor_data) - -module Google - module Cloud - module SecurityCenter - module V1 - CloudDlpInspection = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.securitycenter.v1.CloudDlpInspection").msgclass - end - end - end -end diff --git a/owl-bot-staging/google-cloud-security_center-v1/lib/google/cloud/securitycenter/v1/compliance_pb.rb b/owl-bot-staging/google-cloud-security_center-v1/lib/google/cloud/securitycenter/v1/compliance_pb.rb deleted file mode 100644 index db60def7251c..000000000000 --- a/owl-bot-staging/google-cloud-security_center-v1/lib/google/cloud/securitycenter/v1/compliance_pb.rb +++ /dev/null @@ -1,21 +0,0 @@ -# frozen_string_literal: true -# Generated by the protocol buffer compiler. DO NOT EDIT! -# source: google/cloud/securitycenter/v1/compliance.proto - -require 'google/protobuf' - - -descriptor_data = "\n/google/cloud/securitycenter/v1/compliance.proto\x12\x1egoogle.cloud.securitycenter.v1\"<\n\nCompliance\x12\x10\n\x08standard\x18\x01 \x01(\t\x12\x0f\n\x07version\x18\x02 \x01(\t\x12\x0b\n\x03ids\x18\x03 \x03(\tB\xe9\x01\n\"com.google.cloud.securitycenter.v1B\x0f\x43omplianceProtoP\x01ZJcloud.google.com/go/securitycenter/apiv1/securitycenterpb;securitycenterpb\xaa\x02\x1eGoogle.Cloud.SecurityCenter.V1\xca\x02\x1eGoogle\\Cloud\\SecurityCenter\\V1\xea\x02!Google::Cloud::SecurityCenter::V1b\x06proto3" - -pool = ::Google::Protobuf::DescriptorPool.generated_pool -pool.add_serialized_file(descriptor_data) - -module Google - module Cloud - module SecurityCenter - module V1 - Compliance = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.securitycenter.v1.Compliance").msgclass - end - end - end -end diff --git a/owl-bot-staging/google-cloud-security_center-v1/lib/google/cloud/securitycenter/v1/connection_pb.rb b/owl-bot-staging/google-cloud-security_center-v1/lib/google/cloud/securitycenter/v1/connection_pb.rb deleted file mode 100644 index eb0b9ee52115..000000000000 --- a/owl-bot-staging/google-cloud-security_center-v1/lib/google/cloud/securitycenter/v1/connection_pb.rb +++ /dev/null @@ -1,22 +0,0 @@ -# frozen_string_literal: true -# Generated by the protocol buffer compiler. DO NOT EDIT! -# source: google/cloud/securitycenter/v1/connection.proto - -require 'google/protobuf' - - -descriptor_data = "\n/google/cloud/securitycenter/v1/connection.proto\x12\x1egoogle.cloud.securitycenter.v1\"\x81\x02\n\nConnection\x12\x16\n\x0e\x64\x65stination_ip\x18\x01 \x01(\t\x12\x18\n\x10\x64\x65stination_port\x18\x02 \x01(\x05\x12\x11\n\tsource_ip\x18\x03 \x01(\t\x12\x13\n\x0bsource_port\x18\x04 \x01(\x05\x12\x45\n\x08protocol\x18\x05 \x01(\x0e\x32\x33.google.cloud.securitycenter.v1.Connection.Protocol\"R\n\x08Protocol\x12\x18\n\x14PROTOCOL_UNSPECIFIED\x10\x00\x12\x08\n\x04ICMP\x10\x01\x12\x07\n\x03TCP\x10\x06\x12\x07\n\x03UDP\x10\x11\x12\x07\n\x03GRE\x10/\x12\x07\n\x03\x45SP\x10\x32\x42\xe9\x01\n\"com.google.cloud.securitycenter.v1B\x0f\x43onnectionProtoP\x01ZJcloud.google.com/go/securitycenter/apiv1/securitycenterpb;securitycenterpb\xaa\x02\x1eGoogle.Cloud.SecurityCenter.V1\xca\x02\x1eGoogle\\Cloud\\SecurityCenter\\V1\xea\x02!Google::Cloud::SecurityCenter::V1b\x06proto3" - -pool = ::Google::Protobuf::DescriptorPool.generated_pool -pool.add_serialized_file(descriptor_data) - -module Google - module Cloud - module SecurityCenter - module V1 - Connection = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.securitycenter.v1.Connection").msgclass - Connection::Protocol = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.securitycenter.v1.Connection.Protocol").enummodule - end - end - end -end diff --git a/owl-bot-staging/google-cloud-security_center-v1/lib/google/cloud/securitycenter/v1/contact_details_pb.rb b/owl-bot-staging/google-cloud-security_center-v1/lib/google/cloud/securitycenter/v1/contact_details_pb.rb deleted file mode 100644 index 82b5fea649e6..000000000000 --- a/owl-bot-staging/google-cloud-security_center-v1/lib/google/cloud/securitycenter/v1/contact_details_pb.rb +++ /dev/null @@ -1,22 +0,0 @@ -# frozen_string_literal: true -# Generated by the protocol buffer compiler. DO NOT EDIT! -# source: google/cloud/securitycenter/v1/contact_details.proto - -require 'google/protobuf' - - -descriptor_data = "\n4google/cloud/securitycenter/v1/contact_details.proto\x12\x1egoogle.cloud.securitycenter.v1\"K\n\x0e\x43ontactDetails\x12\x39\n\x08\x63ontacts\x18\x01 \x03(\x0b\x32\'.google.cloud.securitycenter.v1.Contact\"\x18\n\x07\x43ontact\x12\r\n\x05\x65mail\x18\x01 \x01(\tB\xed\x01\n\"com.google.cloud.securitycenter.v1B\x13\x43ontactDetailsProtoP\x01ZJcloud.google.com/go/securitycenter/apiv1/securitycenterpb;securitycenterpb\xaa\x02\x1eGoogle.Cloud.SecurityCenter.V1\xca\x02\x1eGoogle\\Cloud\\SecurityCenter\\V1\xea\x02!Google::Cloud::SecurityCenter::V1b\x06proto3" - -pool = ::Google::Protobuf::DescriptorPool.generated_pool -pool.add_serialized_file(descriptor_data) - -module Google - module Cloud - module SecurityCenter - module V1 - ContactDetails = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.securitycenter.v1.ContactDetails").msgclass - Contact = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.securitycenter.v1.Contact").msgclass - end - end - end -end diff --git a/owl-bot-staging/google-cloud-security_center-v1/lib/google/cloud/securitycenter/v1/container_pb.rb b/owl-bot-staging/google-cloud-security_center-v1/lib/google/cloud/securitycenter/v1/container_pb.rb deleted file mode 100644 index 114721a06e25..000000000000 --- a/owl-bot-staging/google-cloud-security_center-v1/lib/google/cloud/securitycenter/v1/container_pb.rb +++ /dev/null @@ -1,24 +0,0 @@ -# frozen_string_literal: true -# Generated by the protocol buffer compiler. DO NOT EDIT! -# source: google/cloud/securitycenter/v1/container.proto - -require 'google/protobuf' - -require 'google/cloud/securitycenter/v1/label_pb' -require 'google/protobuf/timestamp_pb' - - -descriptor_data = "\n.google/cloud/securitycenter/v1/container.proto\x12\x1egoogle.cloud.securitycenter.v1\x1a*google/cloud/securitycenter/v1/label.proto\x1a\x1fgoogle/protobuf/timestamp.proto\"\xa0\x01\n\tContainer\x12\x0c\n\x04name\x18\x01 \x01(\t\x12\x0b\n\x03uri\x18\x02 \x01(\t\x12\x10\n\x08image_id\x18\x03 \x01(\t\x12\x35\n\x06labels\x18\x04 \x03(\x0b\x32%.google.cloud.securitycenter.v1.Label\x12/\n\x0b\x63reate_time\x18\x05 \x01(\x0b\x32\x1a.google.protobuf.TimestampB\xe8\x01\n\"com.google.cloud.securitycenter.v1B\x0e\x43ontainerProtoP\x01ZJcloud.google.com/go/securitycenter/apiv1/securitycenterpb;securitycenterpb\xaa\x02\x1eGoogle.Cloud.SecurityCenter.V1\xca\x02\x1eGoogle\\Cloud\\SecurityCenter\\V1\xea\x02!Google::Cloud::SecurityCenter::V1b\x06proto3" - -pool = ::Google::Protobuf::DescriptorPool.generated_pool -pool.add_serialized_file(descriptor_data) - -module Google - module Cloud - module SecurityCenter - module V1 - Container = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.securitycenter.v1.Container").msgclass - end - end - end -end diff --git a/owl-bot-staging/google-cloud-security_center-v1/lib/google/cloud/securitycenter/v1/database_pb.rb b/owl-bot-staging/google-cloud-security_center-v1/lib/google/cloud/securitycenter/v1/database_pb.rb deleted file mode 100644 index 14a2d4b30426..000000000000 --- a/owl-bot-staging/google-cloud-security_center-v1/lib/google/cloud/securitycenter/v1/database_pb.rb +++ /dev/null @@ -1,21 +0,0 @@ -# frozen_string_literal: true -# Generated by the protocol buffer compiler. DO NOT EDIT! -# source: google/cloud/securitycenter/v1/database.proto - -require 'google/protobuf' - - -descriptor_data = "\n-google/cloud/securitycenter/v1/database.proto\x12\x1egoogle.cloud.securitycenter.v1\"s\n\x08\x44\x61tabase\x12\x0c\n\x04name\x18\x01 \x01(\t\x12\x14\n\x0c\x64isplay_name\x18\x02 \x01(\t\x12\x11\n\tuser_name\x18\x03 \x01(\t\x12\r\n\x05query\x18\x04 \x01(\t\x12\x10\n\x08grantees\x18\x05 \x03(\t\x12\x0f\n\x07version\x18\x06 \x01(\tB\xe7\x01\n\"com.google.cloud.securitycenter.v1B\rDatabaseProtoP\x01ZJcloud.google.com/go/securitycenter/apiv1/securitycenterpb;securitycenterpb\xaa\x02\x1eGoogle.Cloud.SecurityCenter.V1\xca\x02\x1eGoogle\\Cloud\\SecurityCenter\\V1\xea\x02!Google::Cloud::SecurityCenter::V1b\x06proto3" - -pool = ::Google::Protobuf::DescriptorPool.generated_pool -pool.add_serialized_file(descriptor_data) - -module Google - module Cloud - module SecurityCenter - module V1 - Database = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.securitycenter.v1.Database").msgclass - end - end - end -end diff --git a/owl-bot-staging/google-cloud-security_center-v1/lib/google/cloud/securitycenter/v1/effective_event_threat_detection_custom_module_pb.rb b/owl-bot-staging/google-cloud-security_center-v1/lib/google/cloud/securitycenter/v1/effective_event_threat_detection_custom_module_pb.rb deleted file mode 100644 index b7cff88c9276..000000000000 --- a/owl-bot-staging/google-cloud-security_center-v1/lib/google/cloud/securitycenter/v1/effective_event_threat_detection_custom_module_pb.rb +++ /dev/null @@ -1,26 +0,0 @@ -# frozen_string_literal: true -# Generated by the protocol buffer compiler. DO NOT EDIT! -# source: google/cloud/securitycenter/v1/effective_event_threat_detection_custom_module.proto - -require 'google/protobuf' - -require 'google/api/field_behavior_pb' -require 'google/api/resource_pb' -require 'google/protobuf/struct_pb' - - -descriptor_data = "\nSgoogle/cloud/securitycenter/v1/effective_event_threat_detection_custom_module.proto\x12\x1egoogle.cloud.securitycenter.v1\x1a\x1fgoogle/api/field_behavior.proto\x1a\x19google/api/resource.proto\x1a\x1cgoogle/protobuf/struct.proto\"\xc9\x05\n)EffectiveEventThreatDetectionCustomModule\x12\x11\n\x04name\x18\x01 \x01(\tB\x03\xe0\x41\x03\x12,\n\x06\x63onfig\x18\x02 \x01(\x0b\x32\x17.google.protobuf.StructB\x03\xe0\x41\x03\x12x\n\x10\x65nablement_state\x18\x03 \x01(\x0e\x32Y.google.cloud.securitycenter.v1.EffectiveEventThreatDetectionCustomModule.EnablementStateB\x03\xe0\x41\x03\x12\x11\n\x04type\x18\x04 \x01(\tB\x03\xe0\x41\x03\x12\x19\n\x0c\x64isplay_name\x18\x05 \x01(\tB\x03\xe0\x41\x03\x12\x18\n\x0b\x64\x65scription\x18\x06 \x01(\tB\x03\xe0\x41\x03\"N\n\x0f\x45nablementState\x12 \n\x1c\x45NABLEMENT_STATE_UNSPECIFIED\x10\x00\x12\x0b\n\x07\x45NABLED\x10\x01\x12\x0c\n\x08\x44ISABLED\x10\x02:\xc8\x02\xea\x41\xc4\x02\nGsecuritycenter.googleapis.com/EffectiveEventThreatDetectionCustomModule\x12Yorganizations/{organization}/eventThreatDetectionSettings/effectiveCustomModules/{module}\x12Mfolders/{folder}/eventThreatDetectionSettings/effectiveCustomModules/{module}\x12Oprojects/{project}/eventThreatDetectionSettings/effectiveCustomModules/{module}B\x88\x02\n\"com.google.cloud.securitycenter.v1B.EffectiveEventThreatDetectionCustomModuleProtoP\x01ZJcloud.google.com/go/securitycenter/apiv1/securitycenterpb;securitycenterpb\xaa\x02\x1eGoogle.Cloud.SecurityCenter.V1\xca\x02\x1eGoogle\\Cloud\\SecurityCenter\\V1\xea\x02!Google::Cloud::SecurityCenter::V1b\x06proto3" - -pool = ::Google::Protobuf::DescriptorPool.generated_pool -pool.add_serialized_file(descriptor_data) - -module Google - module Cloud - module SecurityCenter - module V1 - EffectiveEventThreatDetectionCustomModule = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.securitycenter.v1.EffectiveEventThreatDetectionCustomModule").msgclass - EffectiveEventThreatDetectionCustomModule::EnablementState = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.securitycenter.v1.EffectiveEventThreatDetectionCustomModule.EnablementState").enummodule - end - end - end -end diff --git a/owl-bot-staging/google-cloud-security_center-v1/lib/google/cloud/securitycenter/v1/effective_security_health_analytics_custom_module_pb.rb b/owl-bot-staging/google-cloud-security_center-v1/lib/google/cloud/securitycenter/v1/effective_security_health_analytics_custom_module_pb.rb deleted file mode 100644 index 398d13b78b09..000000000000 --- a/owl-bot-staging/google-cloud-security_center-v1/lib/google/cloud/securitycenter/v1/effective_security_health_analytics_custom_module_pb.rb +++ /dev/null @@ -1,26 +0,0 @@ -# frozen_string_literal: true -# Generated by the protocol buffer compiler. DO NOT EDIT! -# source: google/cloud/securitycenter/v1/effective_security_health_analytics_custom_module.proto - -require 'google/protobuf' - -require 'google/api/field_behavior_pb' -require 'google/api/resource_pb' -require 'google/cloud/securitycenter/v1/security_health_analytics_custom_config_pb' - - -descriptor_data = "\nVgoogle/cloud/securitycenter/v1/effective_security_health_analytics_custom_module.proto\x12\x1egoogle.cloud.securitycenter.v1\x1a\x1fgoogle/api/field_behavior.proto\x1a\x19google/api/resource.proto\x1aLgoogle/cloud/securitycenter/v1/security_health_analytics_custom_config.proto\"\xfd\x05\n,EffectiveSecurityHealthAnalyticsCustomModule\x12\x11\n\x04name\x18\x01 \x01(\tB\x03\xe0\x41\x03\x12H\n\rcustom_config\x18\x02 \x01(\x0b\x32,.google.cloud.securitycenter.v1.CustomConfigB\x03\xe0\x41\x03\x12{\n\x10\x65nablement_state\x18\x03 \x01(\x0e\x32\\.google.cloud.securitycenter.v1.EffectiveSecurityHealthAnalyticsCustomModule.EnablementStateB\x03\xe0\x41\x03\x12\x19\n\x0c\x64isplay_name\x18\x04 \x01(\tB\x03\xe0\x41\x03\"N\n\x0f\x45nablementState\x12 \n\x1c\x45NABLEMENT_STATE_UNSPECIFIED\x10\x00\x12\x0b\n\x07\x45NABLED\x10\x01\x12\x0c\n\x08\x44ISABLED\x10\x02:\x87\x03\xea\x41\x83\x03\nJsecuritycenter.googleapis.com/EffectiveSecurityHealthAnalyticsCustomModule\x12morganizations/{organization}/securityHealthAnalyticsSettings/effectiveCustomModules/{effective_custom_module}\x12\x61\x66olders/{folder}/securityHealthAnalyticsSettings/effectiveCustomModules/{effective_custom_module}\x12\x63projects/{project}/securityHealthAnalyticsSettings/effectiveCustomModules/{effective_custom_module}B\x8b\x02\n\"com.google.cloud.securitycenter.v1B1EffectiveSecurityHealthAnalyticsCustomModuleProtoP\x01ZJcloud.google.com/go/securitycenter/apiv1/securitycenterpb;securitycenterpb\xaa\x02\x1eGoogle.Cloud.SecurityCenter.V1\xca\x02\x1eGoogle\\Cloud\\SecurityCenter\\V1\xea\x02!Google::Cloud::SecurityCenter::V1b\x06proto3" - -pool = ::Google::Protobuf::DescriptorPool.generated_pool -pool.add_serialized_file(descriptor_data) - -module Google - module Cloud - module SecurityCenter - module V1 - EffectiveSecurityHealthAnalyticsCustomModule = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.securitycenter.v1.EffectiveSecurityHealthAnalyticsCustomModule").msgclass - EffectiveSecurityHealthAnalyticsCustomModule::EnablementState = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.securitycenter.v1.EffectiveSecurityHealthAnalyticsCustomModule.EnablementState").enummodule - end - end - end -end diff --git a/owl-bot-staging/google-cloud-security_center-v1/lib/google/cloud/securitycenter/v1/event_threat_detection_custom_module_pb.rb b/owl-bot-staging/google-cloud-security_center-v1/lib/google/cloud/securitycenter/v1/event_threat_detection_custom_module_pb.rb deleted file mode 100644 index 2b24bf1f56c4..000000000000 --- a/owl-bot-staging/google-cloud-security_center-v1/lib/google/cloud/securitycenter/v1/event_threat_detection_custom_module_pb.rb +++ /dev/null @@ -1,27 +0,0 @@ -# frozen_string_literal: true -# Generated by the protocol buffer compiler. DO NOT EDIT! -# source: google/cloud/securitycenter/v1/event_threat_detection_custom_module.proto - -require 'google/protobuf' - -require 'google/api/field_behavior_pb' -require 'google/api/resource_pb' -require 'google/protobuf/struct_pb' -require 'google/protobuf/timestamp_pb' - - -descriptor_data = "\nIgoogle/cloud/securitycenter/v1/event_threat_detection_custom_module.proto\x12\x1egoogle.cloud.securitycenter.v1\x1a\x1fgoogle/api/field_behavior.proto\x1a\x19google/api/resource.proto\x1a\x1cgoogle/protobuf/struct.proto\x1a\x1fgoogle/protobuf/timestamp.proto\"\xba\x06\n EventThreatDetectionCustomModule\x12\x11\n\x04name\x18\x01 \x01(\tB\x03\xe0\x41\x05\x12\'\n\x06\x63onfig\x18\x02 \x01(\x0b\x32\x17.google.protobuf.Struct\x12_\n\x0f\x61ncestor_module\x18\x03 \x01(\tBF\xe0\x41\x03\xfa\x41@\n>securitycenter.googleapis.com/EventThreatDetectionCustomModule\x12j\n\x10\x65nablement_state\x18\x04 \x01(\x0e\x32P.google.cloud.securitycenter.v1.EventThreatDetectionCustomModule.EnablementState\x12\x0c\n\x04type\x18\x05 \x01(\t\x12\x14\n\x0c\x64isplay_name\x18\x06 \x01(\t\x12\x13\n\x0b\x64\x65scription\x18\x07 \x01(\t\x12\x34\n\x0bupdate_time\x18\x08 \x01(\x0b\x32\x1a.google.protobuf.TimestampB\x03\xe0\x41\x03\x12\x18\n\x0blast_editor\x18\t \x01(\tB\x03\xe0\x41\x03\"]\n\x0f\x45nablementState\x12 \n\x1c\x45NABLEMENT_STATE_UNSPECIFIED\x10\x00\x12\x0b\n\x07\x45NABLED\x10\x01\x12\x0c\n\x08\x44ISABLED\x10\x02\x12\r\n\tINHERITED\x10\x03:\xa4\x02\xea\x41\xa0\x02\n>securitycenter.googleapis.com/EventThreatDetectionCustomModule\x12Porganizations/{organization}/eventThreatDetectionSettings/customModules/{module}\x12\x44\x66olders/{folder}/eventThreatDetectionSettings/customModules/{module}\x12\x46projects/{project}/eventThreatDetectionSettings/customModules/{module}B\xff\x01\n\"com.google.cloud.securitycenter.v1B%EventThreatDetectionCustomModuleProtoP\x01ZJcloud.google.com/go/securitycenter/apiv1/securitycenterpb;securitycenterpb\xaa\x02\x1eGoogle.Cloud.SecurityCenter.V1\xca\x02\x1eGoogle\\Cloud\\SecurityCenter\\V1\xea\x02!Google::Cloud::SecurityCenter::V1b\x06proto3" - -pool = ::Google::Protobuf::DescriptorPool.generated_pool -pool.add_serialized_file(descriptor_data) - -module Google - module Cloud - module SecurityCenter - module V1 - EventThreatDetectionCustomModule = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.securitycenter.v1.EventThreatDetectionCustomModule").msgclass - EventThreatDetectionCustomModule::EnablementState = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.securitycenter.v1.EventThreatDetectionCustomModule.EnablementState").enummodule - end - end - end -end diff --git a/owl-bot-staging/google-cloud-security_center-v1/lib/google/cloud/securitycenter/v1/event_threat_detection_custom_module_validation_errors_pb.rb b/owl-bot-staging/google-cloud-security_center-v1/lib/google/cloud/securitycenter/v1/event_threat_detection_custom_module_validation_errors_pb.rb deleted file mode 100644 index d900e952525b..000000000000 --- a/owl-bot-staging/google-cloud-security_center-v1/lib/google/cloud/securitycenter/v1/event_threat_detection_custom_module_validation_errors_pb.rb +++ /dev/null @@ -1,23 +0,0 @@ -# frozen_string_literal: true -# Generated by the protocol buffer compiler. DO NOT EDIT! -# source: google/cloud/securitycenter/v1/event_threat_detection_custom_module_validation_errors.proto - -require 'google/protobuf' - - -descriptor_data = "\n[google/cloud/securitycenter/v1/event_threat_detection_custom_module_validation_errors.proto\x12\x1egoogle.cloud.securitycenter.v1\"k\n\x1c\x43ustomModuleValidationErrors\x12K\n\x06\x65rrors\x18\x01 \x03(\x0b\x32;.google.cloud.securitycenter.v1.CustomModuleValidationError\"\xd2\x01\n\x1b\x43ustomModuleValidationError\x12\x13\n\x0b\x64\x65scription\x18\x01 \x01(\t\x12\x12\n\nfield_path\x18\x02 \x01(\t\x12<\n\x05start\x18\x03 \x01(\x0b\x32(.google.cloud.securitycenter.v1.PositionH\x00\x88\x01\x01\x12:\n\x03\x65nd\x18\x04 \x01(\x0b\x32(.google.cloud.securitycenter.v1.PositionH\x01\x88\x01\x01\x42\x08\n\x06_startB\x06\n\x04_end\"6\n\x08Position\x12\x13\n\x0bline_number\x18\x01 \x01(\x05\x12\x15\n\rcolumn_number\x18\x02 \x01(\x05\x42\x8f\x02\n\"com.google.cloud.securitycenter.v1B5EventThreatDetectionCustomModuleValidationErrorsProtoP\x01ZJcloud.google.com/go/securitycenter/apiv1/securitycenterpb;securitycenterpb\xaa\x02\x1eGoogle.Cloud.SecurityCenter.V1\xca\x02\x1eGoogle\\Cloud\\SecurityCenter\\V1\xea\x02!Google::Cloud::SecurityCenter::V1b\x06proto3" - -pool = ::Google::Protobuf::DescriptorPool.generated_pool -pool.add_serialized_file(descriptor_data) - -module Google - module Cloud - module SecurityCenter - module V1 - CustomModuleValidationErrors = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.securitycenter.v1.CustomModuleValidationErrors").msgclass - CustomModuleValidationError = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.securitycenter.v1.CustomModuleValidationError").msgclass - Position = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.securitycenter.v1.Position").msgclass - end - end - end -end diff --git a/owl-bot-staging/google-cloud-security_center-v1/lib/google/cloud/securitycenter/v1/exfiltration_pb.rb b/owl-bot-staging/google-cloud-security_center-v1/lib/google/cloud/securitycenter/v1/exfiltration_pb.rb deleted file mode 100644 index f444b911b8fd..000000000000 --- a/owl-bot-staging/google-cloud-security_center-v1/lib/google/cloud/securitycenter/v1/exfiltration_pb.rb +++ /dev/null @@ -1,22 +0,0 @@ -# frozen_string_literal: true -# Generated by the protocol buffer compiler. DO NOT EDIT! -# source: google/cloud/securitycenter/v1/exfiltration.proto - -require 'google/protobuf' - - -descriptor_data = "\n1google/cloud/securitycenter/v1/exfiltration.proto\x12\x1egoogle.cloud.securitycenter.v1\"\xaf\x01\n\x0c\x45xfiltration\x12>\n\x07sources\x18\x01 \x03(\x0b\x32-.google.cloud.securitycenter.v1.ExfilResource\x12>\n\x07targets\x18\x02 \x03(\x0b\x32-.google.cloud.securitycenter.v1.ExfilResource\x12\x1f\n\x17total_exfiltrated_bytes\x18\x03 \x01(\x03\"1\n\rExfilResource\x12\x0c\n\x04name\x18\x01 \x01(\t\x12\x12\n\ncomponents\x18\x02 \x03(\tB\xeb\x01\n\"com.google.cloud.securitycenter.v1B\x11\x45xfiltrationProtoP\x01ZJcloud.google.com/go/securitycenter/apiv1/securitycenterpb;securitycenterpb\xaa\x02\x1eGoogle.Cloud.SecurityCenter.V1\xca\x02\x1eGoogle\\Cloud\\SecurityCenter\\V1\xea\x02!Google::Cloud::SecurityCenter::V1b\x06proto3" - -pool = ::Google::Protobuf::DescriptorPool.generated_pool -pool.add_serialized_file(descriptor_data) - -module Google - module Cloud - module SecurityCenter - module V1 - Exfiltration = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.securitycenter.v1.Exfiltration").msgclass - ExfilResource = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.securitycenter.v1.ExfilResource").msgclass - end - end - end -end diff --git a/owl-bot-staging/google-cloud-security_center-v1/lib/google/cloud/securitycenter/v1/external_exposure_pb.rb b/owl-bot-staging/google-cloud-security_center-v1/lib/google/cloud/securitycenter/v1/external_exposure_pb.rb deleted file mode 100644 index 637251a7df01..000000000000 --- a/owl-bot-staging/google-cloud-security_center-v1/lib/google/cloud/securitycenter/v1/external_exposure_pb.rb +++ /dev/null @@ -1,23 +0,0 @@ -# frozen_string_literal: true -# Generated by the protocol buffer compiler. DO NOT EDIT! -# source: google/cloud/securitycenter/v1/external_exposure.proto - -require 'google/protobuf' - -require 'google/api/field_info_pb' - - -descriptor_data = "\n6google/cloud/securitycenter/v1/external_exposure.proto\x12\x1egoogle.cloud.securitycenter.v1\x1a\x1bgoogle/api/field_info.proto\"\xed\x02\n\x10\x45xternalExposure\x12$\n\x12private_ip_address\x18\x01 \x01(\tB\x08\xe2\x8c\xcf\xd7\x08\x02\x08\x04\x12\x14\n\x0cprivate_port\x18\x02 \x01(\t\x12\x17\n\x0f\x65xposed_service\x18\x03 \x01(\t\x12#\n\x11public_ip_address\x18\x04 \x01(\tB\x08\xe2\x8c\xcf\xd7\x08\x02\x08\x04\x12\x13\n\x0bpublic_port\x18\x05 \x01(\t\x12\x18\n\x10\x65xposed_endpoint\x18\x06 \x01(\t\x12%\n\x1dload_balancer_firewall_policy\x18\x07 \x01(\t\x12\x1f\n\x17service_firewall_policy\x18\x08 \x01(\t\x12\x17\n\x0f\x66orwarding_rule\x18\t \x01(\t\x12\x17\n\x0f\x62\x61\x63kend_service\x18\n \x01(\t\x12\x16\n\x0einstance_group\x18\x0b \x01(\t\x12\x1e\n\x16network_endpoint_group\x18\x0c \x01(\tB\xef\x01\n\"com.google.cloud.securitycenter.v1B\x15\x45xternalExposureProtoP\x01ZJcloud.google.com/go/securitycenter/apiv1/securitycenterpb;securitycenterpb\xaa\x02\x1eGoogle.Cloud.SecurityCenter.V1\xca\x02\x1eGoogle\\Cloud\\SecurityCenter\\V1\xea\x02!Google::Cloud::SecurityCenter::V1b\x06proto3" - -pool = ::Google::Protobuf::DescriptorPool.generated_pool -pool.add_serialized_file(descriptor_data) - -module Google - module Cloud - module SecurityCenter - module V1 - ExternalExposure = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.securitycenter.v1.ExternalExposure").msgclass - end - end - end -end diff --git a/owl-bot-staging/google-cloud-security_center-v1/lib/google/cloud/securitycenter/v1/external_system_pb.rb b/owl-bot-staging/google-cloud-security_center-v1/lib/google/cloud/securitycenter/v1/external_system_pb.rb deleted file mode 100644 index 6b43636594f3..000000000000 --- a/owl-bot-staging/google-cloud-security_center-v1/lib/google/cloud/securitycenter/v1/external_system_pb.rb +++ /dev/null @@ -1,25 +0,0 @@ -# frozen_string_literal: true -# Generated by the protocol buffer compiler. DO NOT EDIT! -# source: google/cloud/securitycenter/v1/external_system.proto - -require 'google/protobuf' - -require 'google/api/resource_pb' -require 'google/protobuf/timestamp_pb' - - -descriptor_data = "\n4google/cloud/securitycenter/v1/external_system.proto\x12\x1egoogle.cloud.securitycenter.v1\x1a\x19google/api/resource.proto\x1a\x1fgoogle/protobuf/timestamp.proto\"\xa3\x07\n\x0e\x45xternalSystem\x12\x0c\n\x04name\x18\x01 \x01(\t\x12\x11\n\tassignees\x18\x02 \x03(\t\x12\x14\n\x0c\x65xternal_uid\x18\x03 \x01(\t\x12\x0e\n\x06status\x18\x04 \x01(\t\x12?\n\x1b\x65xternal_system_update_time\x18\x05 \x01(\x0b\x32\x1a.google.protobuf.Timestamp\x12\x10\n\x08\x63\x61se_uri\x18\x06 \x01(\t\x12\x15\n\rcase_priority\x18\x07 \x01(\t\x12,\n\x08\x63\x61se_sla\x18\t \x01(\x0b\x32\x1a.google.protobuf.Timestamp\x12\x34\n\x10\x63\x61se_create_time\x18\n \x01(\x0b\x32\x1a.google.protobuf.Timestamp\x12\x33\n\x0f\x63\x61se_close_time\x18\x0b \x01(\x0b\x32\x1a.google.protobuf.Timestamp\x12N\n\x0bticket_info\x18\x08 \x01(\x0b\x32\x39.google.cloud.securitycenter.v1.ExternalSystem.TicketInfo\x1a\x8d\x01\n\nTicketInfo\x12\n\n\x02id\x18\x01 \x01(\t\x12\x10\n\x08\x61ssignee\x18\x02 \x01(\t\x12\x13\n\x0b\x64\x65scription\x18\x03 \x01(\t\x12\x0b\n\x03uri\x18\x04 \x01(\t\x12\x0e\n\x06status\x18\x05 \x01(\t\x12/\n\x0bupdate_time\x18\x06 \x01(\x0b\x32\x1a.google.protobuf.Timestamp:\xe6\x02\xea\x41\xe2\x02\n,securitycenter.googleapis.com/ExternalSystem\x12\x61organizations/{organization}/sources/{source}/findings/{finding}/externalSystems/{externalsystem}\x12Ufolders/{folder}/sources/{source}/findings/{finding}/externalSystems/{externalsystem}\x12Wprojects/{project}/sources/{source}/findings/{finding}/externalSystems/{externalsystem}*\x0f\x65xternalSystems2\x0e\x65xternalSystemB\xed\x01\n\"com.google.cloud.securitycenter.v1B\x13\x45xternalSystemProtoP\x01ZJcloud.google.com/go/securitycenter/apiv1/securitycenterpb;securitycenterpb\xaa\x02\x1eGoogle.Cloud.SecurityCenter.V1\xca\x02\x1eGoogle\\Cloud\\SecurityCenter\\V1\xea\x02!Google::Cloud::SecurityCenter::V1b\x06proto3" - -pool = ::Google::Protobuf::DescriptorPool.generated_pool -pool.add_serialized_file(descriptor_data) - -module Google - module Cloud - module SecurityCenter - module V1 - ExternalSystem = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.securitycenter.v1.ExternalSystem").msgclass - ExternalSystem::TicketInfo = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.securitycenter.v1.ExternalSystem.TicketInfo").msgclass - end - end - end -end diff --git a/owl-bot-staging/google-cloud-security_center-v1/lib/google/cloud/securitycenter/v1/file_pb.rb b/owl-bot-staging/google-cloud-security_center-v1/lib/google/cloud/securitycenter/v1/file_pb.rb deleted file mode 100644 index 1b28cd79a63b..000000000000 --- a/owl-bot-staging/google-cloud-security_center-v1/lib/google/cloud/securitycenter/v1/file_pb.rb +++ /dev/null @@ -1,22 +0,0 @@ -# frozen_string_literal: true -# Generated by the protocol buffer compiler. DO NOT EDIT! -# source: google/cloud/securitycenter/v1/file.proto - -require 'google/protobuf' - - -descriptor_data = "\n)google/cloud/securitycenter/v1/file.proto\x12\x1egoogle.cloud.securitycenter.v1\"\xf0\x01\n\x04\x46ile\x12\x0c\n\x04path\x18\x01 \x01(\t\x12\x0c\n\x04size\x18\x02 \x01(\x03\x12\x0e\n\x06sha256\x18\x03 \x01(\t\x12\x13\n\x0bhashed_size\x18\x04 \x01(\x03\x12\x18\n\x10partially_hashed\x18\x05 \x01(\x08\x12\x10\n\x08\x63ontents\x18\x06 \x01(\t\x12@\n\tdisk_path\x18\x07 \x01(\x0b\x32-.google.cloud.securitycenter.v1.File.DiskPath\x1a\x39\n\x08\x44iskPath\x12\x16\n\x0epartition_uuid\x18\x01 \x01(\t\x12\x15\n\rrelative_path\x18\x02 \x01(\tB\xe3\x01\n\"com.google.cloud.securitycenter.v1B\tFileProtoP\x01ZJcloud.google.com/go/securitycenter/apiv1/securitycenterpb;securitycenterpb\xaa\x02\x1eGoogle.Cloud.SecurityCenter.V1\xca\x02\x1eGoogle\\Cloud\\SecurityCenter\\V1\xea\x02!Google::Cloud::SecurityCenter::V1b\x06proto3" - -pool = ::Google::Protobuf::DescriptorPool.generated_pool -pool.add_serialized_file(descriptor_data) - -module Google - module Cloud - module SecurityCenter - module V1 - File = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.securitycenter.v1.File").msgclass - File::DiskPath = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.securitycenter.v1.File.DiskPath").msgclass - end - end - end -end diff --git a/owl-bot-staging/google-cloud-security_center-v1/lib/google/cloud/securitycenter/v1/finding_pb.rb b/owl-bot-staging/google-cloud-security_center-v1/lib/google/cloud/securitycenter/v1/finding_pb.rb deleted file mode 100644 index 07d8c81a0ec8..000000000000 --- a/owl-bot-staging/google-cloud-security_center-v1/lib/google/cloud/securitycenter/v1/finding_pb.rb +++ /dev/null @@ -1,65 +0,0 @@ -# frozen_string_literal: true -# Generated by the protocol buffer compiler. DO NOT EDIT! -# source: google/cloud/securitycenter/v1/finding.proto - -require 'google/protobuf' - -require 'google/api/field_behavior_pb' -require 'google/api/resource_pb' -require 'google/cloud/securitycenter/v1/access_pb' -require 'google/cloud/securitycenter/v1/application_pb' -require 'google/cloud/securitycenter/v1/attack_exposure_pb' -require 'google/cloud/securitycenter/v1/backup_disaster_recovery_pb' -require 'google/cloud/securitycenter/v1/chokepoint_pb' -require 'google/cloud/securitycenter/v1/cloud_armor_pb' -require 'google/cloud/securitycenter/v1/cloud_dlp_data_profile_pb' -require 'google/cloud/securitycenter/v1/cloud_dlp_inspection_pb' -require 'google/cloud/securitycenter/v1/compliance_pb' -require 'google/cloud/securitycenter/v1/connection_pb' -require 'google/cloud/securitycenter/v1/contact_details_pb' -require 'google/cloud/securitycenter/v1/container_pb' -require 'google/cloud/securitycenter/v1/database_pb' -require 'google/cloud/securitycenter/v1/exfiltration_pb' -require 'google/cloud/securitycenter/v1/external_exposure_pb' -require 'google/cloud/securitycenter/v1/external_system_pb' -require 'google/cloud/securitycenter/v1/file_pb' -require 'google/cloud/securitycenter/v1/group_membership_pb' -require 'google/cloud/securitycenter/v1/iam_binding_pb' -require 'google/cloud/securitycenter/v1/indicator_pb' -require 'google/cloud/securitycenter/v1/kernel_rootkit_pb' -require 'google/cloud/securitycenter/v1/kubernetes_pb' -require 'google/cloud/securitycenter/v1/load_balancer_pb' -require 'google/cloud/securitycenter/v1/log_entry_pb' -require 'google/cloud/securitycenter/v1/mitre_attack_pb' -require 'google/cloud/securitycenter/v1/notebook_pb' -require 'google/cloud/securitycenter/v1/org_policy_pb' -require 'google/cloud/securitycenter/v1/process_pb' -require 'google/cloud/securitycenter/v1/security_marks_pb' -require 'google/cloud/securitycenter/v1/security_posture_pb' -require 'google/cloud/securitycenter/v1/toxic_combination_pb' -require 'google/cloud/securitycenter/v1/vulnerability_pb' -require 'google/protobuf/struct_pb' -require 'google/protobuf/timestamp_pb' - - -descriptor_data = "\n,google/cloud/securitycenter/v1/finding.proto\x12\x1egoogle.cloud.securitycenter.v1\x1a\x1fgoogle/api/field_behavior.proto\x1a\x19google/api/resource.proto\x1a+google/cloud/securitycenter/v1/access.proto\x1a\x30google/cloud/securitycenter/v1/application.proto\x1a\x34google/cloud/securitycenter/v1/attack_exposure.proto\x1a=google/cloud/securitycenter/v1/backup_disaster_recovery.proto\x1a/google/cloud/securitycenter/v1/chokepoint.proto\x1a\x30google/cloud/securitycenter/v1/cloud_armor.proto\x1a;google/cloud/securitycenter/v1/cloud_dlp_data_profile.proto\x1a\x39google/cloud/securitycenter/v1/cloud_dlp_inspection.proto\x1a/google/cloud/securitycenter/v1/compliance.proto\x1a/google/cloud/securitycenter/v1/connection.proto\x1a\x34google/cloud/securitycenter/v1/contact_details.proto\x1a.google/cloud/securitycenter/v1/container.proto\x1a-google/cloud/securitycenter/v1/database.proto\x1a\x31google/cloud/securitycenter/v1/exfiltration.proto\x1a\x36google/cloud/securitycenter/v1/external_exposure.proto\x1a\x34google/cloud/securitycenter/v1/external_system.proto\x1a)google/cloud/securitycenter/v1/file.proto\x1a\x35google/cloud/securitycenter/v1/group_membership.proto\x1a\x30google/cloud/securitycenter/v1/iam_binding.proto\x1a.google/cloud/securitycenter/v1/indicator.proto\x1a\x33google/cloud/securitycenter/v1/kernel_rootkit.proto\x1a/google/cloud/securitycenter/v1/kubernetes.proto\x1a\x32google/cloud/securitycenter/v1/load_balancer.proto\x1a.google/cloud/securitycenter/v1/log_entry.proto\x1a\x31google/cloud/securitycenter/v1/mitre_attack.proto\x1a-google/cloud/securitycenter/v1/notebook.proto\x1a/google/cloud/securitycenter/v1/org_policy.proto\x1a,google/cloud/securitycenter/v1/process.proto\x1a\x33google/cloud/securitycenter/v1/security_marks.proto\x1a\x35google/cloud/securitycenter/v1/security_posture.proto\x1a\x36google/cloud/securitycenter/v1/toxic_combination.proto\x1a\x32google/cloud/securitycenter/v1/vulnerability.proto\x1a\x1cgoogle/protobuf/struct.proto\x1a\x1fgoogle/protobuf/timestamp.proto\"\xd8\"\n\x07\x46inding\x12\x0c\n\x04name\x18\x01 \x01(\t\x12\x0e\n\x06parent\x18\x02 \x01(\t\x12\x15\n\rresource_name\x18\x03 \x01(\t\x12<\n\x05state\x18\x04 \x01(\x0e\x32-.google.cloud.securitycenter.v1.Finding.State\x12\x10\n\x08\x63\x61tegory\x18\x05 \x01(\t\x12\x14\n\x0c\x65xternal_uri\x18\x06 \x01(\t\x12X\n\x11source_properties\x18\x07 \x03(\x0b\x32=.google.cloud.securitycenter.v1.Finding.SourcePropertiesEntry\x12J\n\x0esecurity_marks\x18\x08 \x01(\x0b\x32-.google.cloud.securitycenter.v1.SecurityMarksB\x03\xe0\x41\x03\x12.\n\nevent_time\x18\t \x01(\x0b\x32\x1a.google.protobuf.Timestamp\x12/\n\x0b\x63reate_time\x18\n \x01(\x0b\x32\x1a.google.protobuf.Timestamp\x12\x42\n\x08severity\x18\x0c \x01(\x0e\x32\x30.google.cloud.securitycenter.v1.Finding.Severity\x12\x16\n\x0e\x63\x61nonical_name\x18\x0e \x01(\t\x12:\n\x04mute\x18\x0f \x01(\x0e\x32,.google.cloud.securitycenter.v1.Finding.Mute\x12K\n\rfinding_class\x18\x11 \x01(\x0e\x32\x34.google.cloud.securitycenter.v1.Finding.FindingClass\x12<\n\tindicator\x18\x12 \x01(\x0b\x32).google.cloud.securitycenter.v1.Indicator\x12\x44\n\rvulnerability\x18\x14 \x01(\x0b\x32-.google.cloud.securitycenter.v1.Vulnerability\x12\x39\n\x10mute_update_time\x18\x15 \x01(\x0b\x32\x1a.google.protobuf.TimestampB\x03\xe0\x41\x03\x12[\n\x10\x65xternal_systems\x18\x16 \x03(\x0b\x32<.google.cloud.securitycenter.v1.Finding.ExternalSystemsEntryB\x03\xe0\x41\x03\x12\x41\n\x0cmitre_attack\x18\x19 \x01(\x0b\x32+.google.cloud.securitycenter.v1.MitreAttack\x12\x36\n\x06\x61\x63\x63\x65ss\x18\x1a \x01(\x0b\x32&.google.cloud.securitycenter.v1.Access\x12?\n\x0b\x63onnections\x18\x1f \x03(\x0b\x32*.google.cloud.securitycenter.v1.Connection\x12\x16\n\x0emute_initiator\x18\x1c \x01(\t\x12H\n\tmute_info\x18= \x01(\x0b\x32\x30.google.cloud.securitycenter.v1.Finding.MuteInfoB\x03\xe0\x41\x03\x12:\n\tprocesses\x18\x1e \x03(\x0b\x32\'.google.cloud.securitycenter.v1.Process\x12L\n\x08\x63ontacts\x18! \x03(\x0b\x32\x35.google.cloud.securitycenter.v1.Finding.ContactsEntryB\x03\xe0\x41\x03\x12?\n\x0b\x63ompliances\x18\" \x03(\x0b\x32*.google.cloud.securitycenter.v1.Compliance\x12 \n\x13parent_display_name\x18$ \x01(\tB\x03\xe0\x41\x03\x12\x13\n\x0b\x64\x65scription\x18% \x01(\t\x12\x42\n\x0c\x65xfiltration\x18& \x01(\x0b\x32,.google.cloud.securitycenter.v1.Exfiltration\x12@\n\x0ciam_bindings\x18\' \x03(\x0b\x32*.google.cloud.securitycenter.v1.IamBinding\x12\x12\n\nnext_steps\x18( \x01(\t\x12\x13\n\x0bmodule_name\x18) \x01(\t\x12=\n\ncontainers\x18* \x03(\x0b\x32).google.cloud.securitycenter.v1.Container\x12>\n\nkubernetes\x18+ \x01(\x0b\x32*.google.cloud.securitycenter.v1.Kubernetes\x12:\n\x08\x64\x61tabase\x18, \x01(\x0b\x32(.google.cloud.securitycenter.v1.Database\x12G\n\x0f\x61ttack_exposure\x18- \x01(\x0b\x32..google.cloud.securitycenter.v1.AttackExposure\x12\x33\n\x05\x66iles\x18. \x03(\x0b\x32$.google.cloud.securitycenter.v1.File\x12P\n\x14\x63loud_dlp_inspection\x18\x30 \x01(\x0b\x32\x32.google.cloud.securitycenter.v1.CloudDlpInspection\x12S\n\x16\x63loud_dlp_data_profile\x18\x31 \x01(\x0b\x32\x33.google.cloud.securitycenter.v1.CloudDlpDataProfile\x12\x45\n\x0ekernel_rootkit\x18\x32 \x01(\x0b\x32-.google.cloud.securitycenter.v1.KernelRootkit\x12?\n\x0corg_policies\x18\x33 \x03(\x0b\x32).google.cloud.securitycenter.v1.OrgPolicy\x12@\n\x0b\x61pplication\x18\x35 \x01(\x0b\x32+.google.cloud.securitycenter.v1.Application\x12X\n\x18\x62\x61\x63kup_disaster_recovery\x18\x37 \x01(\x0b\x32\x36.google.cloud.securitycenter.v1.BackupDisasterRecovery\x12I\n\x10security_posture\x18\x38 \x01(\x0b\x32/.google.cloud.securitycenter.v1.SecurityPosture\x12=\n\x0blog_entries\x18\x39 \x03(\x0b\x32(.google.cloud.securitycenter.v1.LogEntry\x12\x44\n\x0eload_balancers\x18: \x03(\x0b\x32,.google.cloud.securitycenter.v1.LoadBalancer\x12?\n\x0b\x63loud_armor\x18; \x01(\x0b\x32*.google.cloud.securitycenter.v1.CloudArmor\x12:\n\x08notebook\x18? \x01(\x0b\x32(.google.cloud.securitycenter.v1.Notebook\x12K\n\x11toxic_combination\x18@ \x01(\x0b\x32\x30.google.cloud.securitycenter.v1.ToxicCombination\x12J\n\x11group_memberships\x18\x41 \x03(\x0b\x32/.google.cloud.securitycenter.v1.GroupMembership\x12>\n\nchokepoint\x18M \x01(\x0b\x32*.google.cloud.securitycenter.v1.Chokepoint\x12K\n\x11\x65xternal_exposure\x18T \x01(\x0b\x32\x30.google.cloud.securitycenter.v1.ExternalExposure\x1a\x93\x03\n\x08MuteInfo\x12P\n\x0bstatic_mute\x18\x01 \x01(\x0b\x32;.google.cloud.securitycenter.v1.Finding.MuteInfo.StaticMute\x12`\n\x14\x64ynamic_mute_records\x18\x02 \x03(\x0b\x32\x42.google.cloud.securitycenter.v1.Finding.MuteInfo.DynamicMuteRecord\x1ay\n\nStaticMute\x12;\n\x05state\x18\x01 \x01(\x0e\x32,.google.cloud.securitycenter.v1.Finding.Mute\x12.\n\napply_time\x18\x02 \x01(\x0b\x32\x1a.google.protobuf.Timestamp\x1aX\n\x11\x44ynamicMuteRecord\x12\x13\n\x0bmute_config\x18\x01 \x01(\t\x12.\n\nmatch_time\x18\x02 \x01(\x0b\x32\x1a.google.protobuf.Timestamp\x1aO\n\x15SourcePropertiesEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12%\n\x05value\x18\x02 \x01(\x0b\x32\x16.google.protobuf.Value:\x02\x38\x01\x1a\x66\n\x14\x45xternalSystemsEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12=\n\x05value\x18\x02 \x01(\x0b\x32..google.cloud.securitycenter.v1.ExternalSystem:\x02\x38\x01\x1a_\n\rContactsEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12=\n\x05value\x18\x02 \x01(\x0b\x32..google.cloud.securitycenter.v1.ContactDetails:\x02\x38\x01\"8\n\x05State\x12\x15\n\x11STATE_UNSPECIFIED\x10\x00\x12\n\n\x06\x41\x43TIVE\x10\x01\x12\x0c\n\x08INACTIVE\x10\x02\"Q\n\x08Severity\x12\x18\n\x14SEVERITY_UNSPECIFIED\x10\x00\x12\x0c\n\x08\x43RITICAL\x10\x01\x12\x08\n\x04HIGH\x10\x02\x12\n\n\x06MEDIUM\x10\x03\x12\x07\n\x03LOW\x10\x04\"C\n\x04Mute\x12\x14\n\x10MUTE_UNSPECIFIED\x10\x00\x12\t\n\x05MUTED\x10\x01\x12\x0b\n\x07UNMUTED\x10\x02\x12\r\n\tUNDEFINED\x10\x04\"\xf0\x01\n\x0c\x46indingClass\x12\x1d\n\x19\x46INDING_CLASS_UNSPECIFIED\x10\x00\x12\n\n\x06THREAT\x10\x01\x12\x11\n\rVULNERABILITY\x10\x02\x12\x14\n\x10MISCONFIGURATION\x10\x03\x12\x0f\n\x0bOBSERVATION\x10\x04\x12\r\n\tSCC_ERROR\x10\x05\x12\x15\n\x11POSTURE_VIOLATION\x10\x06\x12\x15\n\x11TOXIC_COMBINATION\x10\x07\x12\x17\n\x13SENSITIVE_DATA_RISK\x10\x08\x12\x0e\n\nCHOKEPOINT\x10\t\x12\x15\n\x11\x45XTERNAL_EXPOSURE\x10\n:\xee\x01\xea\x41\xea\x01\n%securitycenter.googleapis.com/Finding\x12@organizations/{organization}/sources/{source}/findings/{finding}\x12\x34\x66olders/{folder}/sources/{source}/findings/{finding}\x12\x36projects/{project}/sources/{source}/findings/{finding}*\x08\x66indings2\x07\x66indingB\xd8\x01\n\"com.google.cloud.securitycenter.v1P\x01ZJcloud.google.com/go/securitycenter/apiv1/securitycenterpb;securitycenterpb\xaa\x02\x1eGoogle.Cloud.SecurityCenter.V1\xca\x02\x1eGoogle\\Cloud\\SecurityCenter\\V1\xea\x02!Google::Cloud::SecurityCenter::V1b\x06proto3" - -pool = ::Google::Protobuf::DescriptorPool.generated_pool -pool.add_serialized_file(descriptor_data) - -module Google - module Cloud - module SecurityCenter - module V1 - Finding = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.securitycenter.v1.Finding").msgclass - Finding::MuteInfo = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.securitycenter.v1.Finding.MuteInfo").msgclass - Finding::MuteInfo::StaticMute = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.securitycenter.v1.Finding.MuteInfo.StaticMute").msgclass - Finding::MuteInfo::DynamicMuteRecord = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.securitycenter.v1.Finding.MuteInfo.DynamicMuteRecord").msgclass - Finding::State = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.securitycenter.v1.Finding.State").enummodule - Finding::Severity = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.securitycenter.v1.Finding.Severity").enummodule - Finding::Mute = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.securitycenter.v1.Finding.Mute").enummodule - Finding::FindingClass = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.securitycenter.v1.Finding.FindingClass").enummodule - end - end - end -end diff --git a/owl-bot-staging/google-cloud-security_center-v1/lib/google/cloud/securitycenter/v1/folder_pb.rb b/owl-bot-staging/google-cloud-security_center-v1/lib/google/cloud/securitycenter/v1/folder_pb.rb deleted file mode 100644 index e25a1821948f..000000000000 --- a/owl-bot-staging/google-cloud-security_center-v1/lib/google/cloud/securitycenter/v1/folder_pb.rb +++ /dev/null @@ -1,21 +0,0 @@ -# frozen_string_literal: true -# Generated by the protocol buffer compiler. DO NOT EDIT! -# source: google/cloud/securitycenter/v1/folder.proto - -require 'google/protobuf' - - -descriptor_data = "\n+google/cloud/securitycenter/v1/folder.proto\x12\x1egoogle.cloud.securitycenter.v1\"G\n\x06\x46older\x12\x17\n\x0fresource_folder\x18\x01 \x01(\t\x12$\n\x1cresource_folder_display_name\x18\x02 \x01(\tB\xe5\x01\n\"com.google.cloud.securitycenter.v1B\x0b\x46olderProtoP\x01ZJcloud.google.com/go/securitycenter/apiv1/securitycenterpb;securitycenterpb\xaa\x02\x1eGoogle.Cloud.SecurityCenter.V1\xca\x02\x1eGoogle\\Cloud\\SecurityCenter\\V1\xea\x02!Google::Cloud::SecurityCenter::V1b\x06proto3" - -pool = ::Google::Protobuf::DescriptorPool.generated_pool -pool.add_serialized_file(descriptor_data) - -module Google - module Cloud - module SecurityCenter - module V1 - Folder = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.securitycenter.v1.Folder").msgclass - end - end - end -end diff --git a/owl-bot-staging/google-cloud-security_center-v1/lib/google/cloud/securitycenter/v1/group_membership_pb.rb b/owl-bot-staging/google-cloud-security_center-v1/lib/google/cloud/securitycenter/v1/group_membership_pb.rb deleted file mode 100644 index 1f47d17f32d9..000000000000 --- a/owl-bot-staging/google-cloud-security_center-v1/lib/google/cloud/securitycenter/v1/group_membership_pb.rb +++ /dev/null @@ -1,22 +0,0 @@ -# frozen_string_literal: true -# Generated by the protocol buffer compiler. DO NOT EDIT! -# source: google/cloud/securitycenter/v1/group_membership.proto - -require 'google/protobuf' - - -descriptor_data = "\n5google/cloud/securitycenter/v1/group_membership.proto\x12\x1egoogle.cloud.securitycenter.v1\"\xd8\x01\n\x0fGroupMembership\x12M\n\ngroup_type\x18\x01 \x01(\x0e\x32\x39.google.cloud.securitycenter.v1.GroupMembership.GroupType\x12\x10\n\x08group_id\x18\x02 \x01(\t\"d\n\tGroupType\x12\x1a\n\x16GROUP_TYPE_UNSPECIFIED\x10\x00\x12 \n\x1cGROUP_TYPE_TOXIC_COMBINATION\x10\x01\x12\x19\n\x15GROUP_TYPE_CHOKEPOINT\x10\x03\x42\xee\x01\n\"com.google.cloud.securitycenter.v1B\x14GroupMembershipProtoP\x01ZJcloud.google.com/go/securitycenter/apiv1/securitycenterpb;securitycenterpb\xaa\x02\x1eGoogle.Cloud.SecurityCenter.V1\xca\x02\x1eGoogle\\Cloud\\SecurityCenter\\V1\xea\x02!Google::Cloud::SecurityCenter::V1b\x06proto3" - -pool = ::Google::Protobuf::DescriptorPool.generated_pool -pool.add_serialized_file(descriptor_data) - -module Google - module Cloud - module SecurityCenter - module V1 - GroupMembership = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.securitycenter.v1.GroupMembership").msgclass - GroupMembership::GroupType = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.securitycenter.v1.GroupMembership.GroupType").enummodule - end - end - end -end diff --git a/owl-bot-staging/google-cloud-security_center-v1/lib/google/cloud/securitycenter/v1/iam_binding_pb.rb b/owl-bot-staging/google-cloud-security_center-v1/lib/google/cloud/securitycenter/v1/iam_binding_pb.rb deleted file mode 100644 index 7a11d5d9ab1f..000000000000 --- a/owl-bot-staging/google-cloud-security_center-v1/lib/google/cloud/securitycenter/v1/iam_binding_pb.rb +++ /dev/null @@ -1,22 +0,0 @@ -# frozen_string_literal: true -# Generated by the protocol buffer compiler. DO NOT EDIT! -# source: google/cloud/securitycenter/v1/iam_binding.proto - -require 'google/protobuf' - - -descriptor_data = "\n0google/cloud/securitycenter/v1/iam_binding.proto\x12\x1egoogle.cloud.securitycenter.v1\"\xa4\x01\n\nIamBinding\x12\x41\n\x06\x61\x63tion\x18\x01 \x01(\x0e\x32\x31.google.cloud.securitycenter.v1.IamBinding.Action\x12\x0c\n\x04role\x18\x02 \x01(\t\x12\x0e\n\x06member\x18\x03 \x01(\t\"5\n\x06\x41\x63tion\x12\x16\n\x12\x41\x43TION_UNSPECIFIED\x10\x00\x12\x07\n\x03\x41\x44\x44\x10\x01\x12\n\n\x06REMOVE\x10\x02\x42\xe9\x01\n\"com.google.cloud.securitycenter.v1B\x0fIamBindingProtoP\x01ZJcloud.google.com/go/securitycenter/apiv1/securitycenterpb;securitycenterpb\xaa\x02\x1eGoogle.Cloud.SecurityCenter.V1\xca\x02\x1eGoogle\\Cloud\\SecurityCenter\\V1\xea\x02!Google::Cloud::SecurityCenter::V1b\x06proto3" - -pool = ::Google::Protobuf::DescriptorPool.generated_pool -pool.add_serialized_file(descriptor_data) - -module Google - module Cloud - module SecurityCenter - module V1 - IamBinding = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.securitycenter.v1.IamBinding").msgclass - IamBinding::Action = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.securitycenter.v1.IamBinding.Action").enummodule - end - end - end -end diff --git a/owl-bot-staging/google-cloud-security_center-v1/lib/google/cloud/securitycenter/v1/indicator_pb.rb b/owl-bot-staging/google-cloud-security_center-v1/lib/google/cloud/securitycenter/v1/indicator_pb.rb deleted file mode 100644 index 6fd4289eea6b..000000000000 --- a/owl-bot-staging/google-cloud-security_center-v1/lib/google/cloud/securitycenter/v1/indicator_pb.rb +++ /dev/null @@ -1,26 +0,0 @@ -# frozen_string_literal: true -# Generated by the protocol buffer compiler. DO NOT EDIT! -# source: google/cloud/securitycenter/v1/indicator.proto - -require 'google/protobuf' - - -descriptor_data = "\n.google/cloud/securitycenter/v1/indicator.proto\x12\x1egoogle.cloud.securitycenter.v1\"\xd9\x06\n\tIndicator\x12\x14\n\x0cip_addresses\x18\x01 \x03(\t\x12\x0f\n\x07\x64omains\x18\x02 \x03(\t\x12N\n\nsignatures\x18\x03 \x03(\x0b\x32:.google.cloud.securitycenter.v1.Indicator.ProcessSignature\x12\x0c\n\x04uris\x18\x04 \x03(\t\x1a\xc6\x05\n\x10ProcessSignature\x12o\n\x15memory_hash_signature\x18\x06 \x01(\x0b\x32N.google.cloud.securitycenter.v1.Indicator.ProcessSignature.MemoryHashSignatureH\x00\x12k\n\x13yara_rule_signature\x18\x07 \x01(\x0b\x32L.google.cloud.securitycenter.v1.Indicator.ProcessSignature.YaraRuleSignatureH\x00\x12`\n\x0esignature_type\x18\x08 \x01(\x0e\x32H.google.cloud.securitycenter.v1.Indicator.ProcessSignature.SignatureType\x1a\xd6\x01\n\x13MemoryHashSignature\x12\x15\n\rbinary_family\x18\x01 \x01(\t\x12l\n\ndetections\x18\x04 \x03(\x0b\x32X.google.cloud.securitycenter.v1.Indicator.ProcessSignature.MemoryHashSignature.Detection\x1a:\n\tDetection\x12\x0e\n\x06\x62inary\x18\x02 \x01(\t\x12\x1d\n\x15percent_pages_matched\x18\x03 \x01(\x01\x1a&\n\x11YaraRuleSignature\x12\x11\n\tyara_rule\x18\x05 \x01(\t\"d\n\rSignatureType\x12\x1e\n\x1aSIGNATURE_TYPE_UNSPECIFIED\x10\x00\x12\x1a\n\x16SIGNATURE_TYPE_PROCESS\x10\x01\x12\x17\n\x13SIGNATURE_TYPE_FILE\x10\x02\x42\x0b\n\tsignatureB\xe8\x01\n\"com.google.cloud.securitycenter.v1B\x0eIndicatorProtoP\x01ZJcloud.google.com/go/securitycenter/apiv1/securitycenterpb;securitycenterpb\xaa\x02\x1eGoogle.Cloud.SecurityCenter.V1\xca\x02\x1eGoogle\\Cloud\\SecurityCenter\\V1\xea\x02!Google::Cloud::SecurityCenter::V1b\x06proto3" - -pool = ::Google::Protobuf::DescriptorPool.generated_pool -pool.add_serialized_file(descriptor_data) - -module Google - module Cloud - module SecurityCenter - module V1 - Indicator = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.securitycenter.v1.Indicator").msgclass - Indicator::ProcessSignature = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.securitycenter.v1.Indicator.ProcessSignature").msgclass - Indicator::ProcessSignature::MemoryHashSignature = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.securitycenter.v1.Indicator.ProcessSignature.MemoryHashSignature").msgclass - Indicator::ProcessSignature::MemoryHashSignature::Detection = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.securitycenter.v1.Indicator.ProcessSignature.MemoryHashSignature.Detection").msgclass - Indicator::ProcessSignature::YaraRuleSignature = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.securitycenter.v1.Indicator.ProcessSignature.YaraRuleSignature").msgclass - Indicator::ProcessSignature::SignatureType = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.securitycenter.v1.Indicator.ProcessSignature.SignatureType").enummodule - end - end - end -end diff --git a/owl-bot-staging/google-cloud-security_center-v1/lib/google/cloud/securitycenter/v1/kernel_rootkit_pb.rb b/owl-bot-staging/google-cloud-security_center-v1/lib/google/cloud/securitycenter/v1/kernel_rootkit_pb.rb deleted file mode 100644 index 20e8cb2e66b9..000000000000 --- a/owl-bot-staging/google-cloud-security_center-v1/lib/google/cloud/securitycenter/v1/kernel_rootkit_pb.rb +++ /dev/null @@ -1,21 +0,0 @@ -# frozen_string_literal: true -# Generated by the protocol buffer compiler. DO NOT EDIT! -# source: google/cloud/securitycenter/v1/kernel_rootkit.proto - -require 'google/protobuf' - - -descriptor_data = "\n3google/cloud/securitycenter/v1/kernel_rootkit.proto\x12\x1egoogle.cloud.securitycenter.v1\"\xd7\x02\n\rKernelRootkit\x12\x0c\n\x04name\x18\x01 \x01(\t\x12$\n\x1cunexpected_code_modification\x18\x02 \x01(\x08\x12.\n&unexpected_read_only_data_modification\x18\x03 \x01(\x08\x12!\n\x19unexpected_ftrace_handler\x18\x04 \x01(\x08\x12!\n\x19unexpected_kprobe_handler\x18\x05 \x01(\x08\x12$\n\x1cunexpected_kernel_code_pages\x18\x06 \x01(\x08\x12&\n\x1eunexpected_system_call_handler\x18\x07 \x01(\x08\x12$\n\x1cunexpected_interrupt_handler\x18\x08 \x01(\x08\x12(\n unexpected_processes_in_runqueue\x18\t \x01(\x08\x42\xec\x01\n\"com.google.cloud.securitycenter.v1B\x12KernelRootkitProtoP\x01ZJcloud.google.com/go/securitycenter/apiv1/securitycenterpb;securitycenterpb\xaa\x02\x1eGoogle.Cloud.SecurityCenter.V1\xca\x02\x1eGoogle\\Cloud\\SecurityCenter\\V1\xea\x02!Google::Cloud::SecurityCenter::V1b\x06proto3" - -pool = ::Google::Protobuf::DescriptorPool.generated_pool -pool.add_serialized_file(descriptor_data) - -module Google - module Cloud - module SecurityCenter - module V1 - KernelRootkit = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.securitycenter.v1.KernelRootkit").msgclass - end - end - end -end diff --git a/owl-bot-staging/google-cloud-security_center-v1/lib/google/cloud/securitycenter/v1/kubernetes_pb.rb b/owl-bot-staging/google-cloud-security_center-v1/lib/google/cloud/securitycenter/v1/kubernetes_pb.rb deleted file mode 100644 index 469575235393..000000000000 --- a/owl-bot-staging/google-cloud-security_center-v1/lib/google/cloud/securitycenter/v1/kubernetes_pb.rb +++ /dev/null @@ -1,34 +0,0 @@ -# frozen_string_literal: true -# Generated by the protocol buffer compiler. DO NOT EDIT! -# source: google/cloud/securitycenter/v1/kubernetes.proto - -require 'google/protobuf' - -require 'google/cloud/securitycenter/v1/container_pb' -require 'google/cloud/securitycenter/v1/label_pb' - - -descriptor_data = "\n/google/cloud/securitycenter/v1/kubernetes.proto\x12\x1egoogle.cloud.securitycenter.v1\x1a.google/cloud/securitycenter/v1/container.proto\x1a*google/cloud/securitycenter/v1/label.proto\"\x82\x0c\n\nKubernetes\x12<\n\x04pods\x18\x01 \x03(\x0b\x32..google.cloud.securitycenter.v1.Kubernetes.Pod\x12>\n\x05nodes\x18\x02 \x03(\x0b\x32/.google.cloud.securitycenter.v1.Kubernetes.Node\x12G\n\nnode_pools\x18\x03 \x03(\x0b\x32\x33.google.cloud.securitycenter.v1.Kubernetes.NodePool\x12>\n\x05roles\x18\x04 \x03(\x0b\x32/.google.cloud.securitycenter.v1.Kubernetes.Role\x12\x44\n\x08\x62indings\x18\x05 \x03(\x0b\x32\x32.google.cloud.securitycenter.v1.Kubernetes.Binding\x12O\n\x0e\x61\x63\x63\x65ss_reviews\x18\x06 \x03(\x0b\x32\x37.google.cloud.securitycenter.v1.Kubernetes.AccessReview\x12\x42\n\x07objects\x18\x07 \x03(\x0b\x32\x31.google.cloud.securitycenter.v1.Kubernetes.Object\x1a\x95\x01\n\x03Pod\x12\n\n\x02ns\x18\x01 \x01(\t\x12\x0c\n\x04name\x18\x02 \x01(\t\x12\x35\n\x06labels\x18\x03 \x03(\x0b\x32%.google.cloud.securitycenter.v1.Label\x12=\n\ncontainers\x18\x04 \x03(\x0b\x32).google.cloud.securitycenter.v1.Container\x1a\x14\n\x04Node\x12\x0c\n\x04name\x18\x01 \x01(\t\x1aX\n\x08NodePool\x12\x0c\n\x04name\x18\x01 \x01(\t\x12>\n\x05nodes\x18\x02 \x03(\x0b\x32/.google.cloud.securitycenter.v1.Kubernetes.Node\x1a\x9e\x01\n\x04Role\x12\x42\n\x04kind\x18\x01 \x01(\x0e\x32\x34.google.cloud.securitycenter.v1.Kubernetes.Role.Kind\x12\n\n\x02ns\x18\x02 \x01(\t\x12\x0c\n\x04name\x18\x03 \x01(\t\"8\n\x04Kind\x12\x14\n\x10KIND_UNSPECIFIED\x10\x00\x12\x08\n\x04ROLE\x10\x01\x12\x10\n\x0c\x43LUSTER_ROLE\x10\x02\x1a\xa8\x01\n\x07\x42inding\x12\n\n\x02ns\x18\x01 \x01(\t\x12\x0c\n\x04name\x18\x02 \x01(\t\x12=\n\x04role\x18\x03 \x01(\x0b\x32/.google.cloud.securitycenter.v1.Kubernetes.Role\x12\x44\n\x08subjects\x18\x04 \x03(\x0b\x32\x32.google.cloud.securitycenter.v1.Kubernetes.Subject\x1a\xbe\x01\n\x07Subject\x12I\n\x04kind\x18\x01 \x01(\x0e\x32;.google.cloud.securitycenter.v1.Kubernetes.Subject.AuthType\x12\n\n\x02ns\x18\x02 \x01(\t\x12\x0c\n\x04name\x18\x03 \x01(\t\"N\n\x08\x41uthType\x12\x19\n\x15\x41UTH_TYPE_UNSPECIFIED\x10\x00\x12\x08\n\x04USER\x10\x01\x12\x12\n\x0eSERVICEACCOUNT\x10\x02\x12\t\n\x05GROUP\x10\x03\x1a}\n\x0c\x41\x63\x63\x65ssReview\x12\r\n\x05group\x18\x01 \x01(\t\x12\n\n\x02ns\x18\x02 \x01(\t\x12\x0c\n\x04name\x18\x03 \x01(\t\x12\x10\n\x08resource\x18\x04 \x01(\t\x12\x13\n\x0bsubresource\x18\x05 \x01(\t\x12\x0c\n\x04verb\x18\x06 \x01(\t\x12\x0f\n\x07version\x18\x07 \x01(\t\x1a~\n\x06Object\x12\r\n\x05group\x18\x01 \x01(\t\x12\x0c\n\x04kind\x18\x02 \x01(\t\x12\n\n\x02ns\x18\x03 \x01(\t\x12\x0c\n\x04name\x18\x04 \x01(\t\x12=\n\ncontainers\x18\x05 \x03(\x0b\x32).google.cloud.securitycenter.v1.ContainerB\xe9\x01\n\"com.google.cloud.securitycenter.v1B\x0fKubernetesProtoP\x01ZJcloud.google.com/go/securitycenter/apiv1/securitycenterpb;securitycenterpb\xaa\x02\x1eGoogle.Cloud.SecurityCenter.V1\xca\x02\x1eGoogle\\Cloud\\SecurityCenter\\V1\xea\x02!Google::Cloud::SecurityCenter::V1b\x06proto3" - -pool = ::Google::Protobuf::DescriptorPool.generated_pool -pool.add_serialized_file(descriptor_data) - -module Google - module Cloud - module SecurityCenter - module V1 - Kubernetes = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.securitycenter.v1.Kubernetes").msgclass - Kubernetes::Pod = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.securitycenter.v1.Kubernetes.Pod").msgclass - Kubernetes::Node = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.securitycenter.v1.Kubernetes.Node").msgclass - Kubernetes::NodePool = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.securitycenter.v1.Kubernetes.NodePool").msgclass - Kubernetes::Role = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.securitycenter.v1.Kubernetes.Role").msgclass - Kubernetes::Role::Kind = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.securitycenter.v1.Kubernetes.Role.Kind").enummodule - Kubernetes::Binding = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.securitycenter.v1.Kubernetes.Binding").msgclass - Kubernetes::Subject = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.securitycenter.v1.Kubernetes.Subject").msgclass - Kubernetes::Subject::AuthType = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.securitycenter.v1.Kubernetes.Subject.AuthType").enummodule - Kubernetes::AccessReview = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.securitycenter.v1.Kubernetes.AccessReview").msgclass - Kubernetes::Object = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.securitycenter.v1.Kubernetes.Object").msgclass - end - end - end -end diff --git a/owl-bot-staging/google-cloud-security_center-v1/lib/google/cloud/securitycenter/v1/label_pb.rb b/owl-bot-staging/google-cloud-security_center-v1/lib/google/cloud/securitycenter/v1/label_pb.rb deleted file mode 100644 index 814fe4dfd80b..000000000000 --- a/owl-bot-staging/google-cloud-security_center-v1/lib/google/cloud/securitycenter/v1/label_pb.rb +++ /dev/null @@ -1,21 +0,0 @@ -# frozen_string_literal: true -# Generated by the protocol buffer compiler. DO NOT EDIT! -# source: google/cloud/securitycenter/v1/label.proto - -require 'google/protobuf' - - -descriptor_data = "\n*google/cloud/securitycenter/v1/label.proto\x12\x1egoogle.cloud.securitycenter.v1\"$\n\x05Label\x12\x0c\n\x04name\x18\x01 \x01(\t\x12\r\n\x05value\x18\x02 \x01(\tB\xe4\x01\n\"com.google.cloud.securitycenter.v1B\nLabelProtoP\x01ZJcloud.google.com/go/securitycenter/apiv1/securitycenterpb;securitycenterpb\xaa\x02\x1eGoogle.Cloud.SecurityCenter.V1\xca\x02\x1eGoogle\\Cloud\\SecurityCenter\\V1\xea\x02!Google::Cloud::SecurityCenter::V1b\x06proto3" - -pool = ::Google::Protobuf::DescriptorPool.generated_pool -pool.add_serialized_file(descriptor_data) - -module Google - module Cloud - module SecurityCenter - module V1 - Label = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.securitycenter.v1.Label").msgclass - end - end - end -end diff --git a/owl-bot-staging/google-cloud-security_center-v1/lib/google/cloud/securitycenter/v1/load_balancer_pb.rb b/owl-bot-staging/google-cloud-security_center-v1/lib/google/cloud/securitycenter/v1/load_balancer_pb.rb deleted file mode 100644 index 486b320844ef..000000000000 --- a/owl-bot-staging/google-cloud-security_center-v1/lib/google/cloud/securitycenter/v1/load_balancer_pb.rb +++ /dev/null @@ -1,21 +0,0 @@ -# frozen_string_literal: true -# Generated by the protocol buffer compiler. DO NOT EDIT! -# source: google/cloud/securitycenter/v1/load_balancer.proto - -require 'google/protobuf' - - -descriptor_data = "\n2google/cloud/securitycenter/v1/load_balancer.proto\x12\x1egoogle.cloud.securitycenter.v1\"\x1c\n\x0cLoadBalancer\x12\x0c\n\x04name\x18\x01 \x01(\tB\xeb\x01\n\"com.google.cloud.securitycenter.v1B\x11LoadBalancerProtoP\x01ZJcloud.google.com/go/securitycenter/apiv1/securitycenterpb;securitycenterpb\xaa\x02\x1eGoogle.Cloud.SecurityCenter.V1\xca\x02\x1eGoogle\\Cloud\\SecurityCenter\\V1\xea\x02!Google::Cloud::SecurityCenter::V1b\x06proto3" - -pool = ::Google::Protobuf::DescriptorPool.generated_pool -pool.add_serialized_file(descriptor_data) - -module Google - module Cloud - module SecurityCenter - module V1 - LoadBalancer = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.securitycenter.v1.LoadBalancer").msgclass - end - end - end -end diff --git a/owl-bot-staging/google-cloud-security_center-v1/lib/google/cloud/securitycenter/v1/log_entry_pb.rb b/owl-bot-staging/google-cloud-security_center-v1/lib/google/cloud/securitycenter/v1/log_entry_pb.rb deleted file mode 100644 index edec9da51f37..000000000000 --- a/owl-bot-staging/google-cloud-security_center-v1/lib/google/cloud/securitycenter/v1/log_entry_pb.rb +++ /dev/null @@ -1,24 +0,0 @@ -# frozen_string_literal: true -# Generated by the protocol buffer compiler. DO NOT EDIT! -# source: google/cloud/securitycenter/v1/log_entry.proto - -require 'google/protobuf' - -require 'google/protobuf/timestamp_pb' - - -descriptor_data = "\n.google/cloud/securitycenter/v1/log_entry.proto\x12\x1egoogle.cloud.securitycenter.v1\x1a\x1fgoogle/protobuf/timestamp.proto\"i\n\x08LogEntry\x12P\n\x13\x63loud_logging_entry\x18\x01 \x01(\x0b\x32\x31.google.cloud.securitycenter.v1.CloudLoggingEntryH\x00\x42\x0b\n\tlog_entry\"\x81\x01\n\x11\x43loudLoggingEntry\x12\x11\n\tinsert_id\x18\x01 \x01(\t\x12\x0e\n\x06log_id\x18\x02 \x01(\t\x12\x1a\n\x12resource_container\x18\x03 \x01(\t\x12-\n\ttimestamp\x18\x04 \x01(\x0b\x32\x1a.google.protobuf.TimestampB\xe7\x01\n\"com.google.cloud.securitycenter.v1B\rLogEntryProtoP\x01ZJcloud.google.com/go/securitycenter/apiv1/securitycenterpb;securitycenterpb\xaa\x02\x1eGoogle.Cloud.SecurityCenter.V1\xca\x02\x1eGoogle\\Cloud\\SecurityCenter\\V1\xea\x02!Google::Cloud::SecurityCenter::V1b\x06proto3" - -pool = ::Google::Protobuf::DescriptorPool.generated_pool -pool.add_serialized_file(descriptor_data) - -module Google - module Cloud - module SecurityCenter - module V1 - LogEntry = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.securitycenter.v1.LogEntry").msgclass - CloudLoggingEntry = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.securitycenter.v1.CloudLoggingEntry").msgclass - end - end - end -end diff --git a/owl-bot-staging/google-cloud-security_center-v1/lib/google/cloud/securitycenter/v1/mitre_attack_pb.rb b/owl-bot-staging/google-cloud-security_center-v1/lib/google/cloud/securitycenter/v1/mitre_attack_pb.rb deleted file mode 100644 index 76a147892b01..000000000000 --- a/owl-bot-staging/google-cloud-security_center-v1/lib/google/cloud/securitycenter/v1/mitre_attack_pb.rb +++ /dev/null @@ -1,23 +0,0 @@ -# frozen_string_literal: true -# Generated by the protocol buffer compiler. DO NOT EDIT! -# source: google/cloud/securitycenter/v1/mitre_attack.proto - -require 'google/protobuf' - - -descriptor_data = "\n1google/cloud/securitycenter/v1/mitre_attack.proto\x12\x1egoogle.cloud.securitycenter.v1\"\xbc\x13\n\x0bMitreAttack\x12J\n\x0eprimary_tactic\x18\x01 \x01(\x0e\x32\x32.google.cloud.securitycenter.v1.MitreAttack.Tactic\x12Q\n\x12primary_techniques\x18\x02 \x03(\x0e\x32\x35.google.cloud.securitycenter.v1.MitreAttack.Technique\x12N\n\x12\x61\x64\x64itional_tactics\x18\x03 \x03(\x0e\x32\x32.google.cloud.securitycenter.v1.MitreAttack.Tactic\x12T\n\x15\x61\x64\x64itional_techniques\x18\x04 \x03(\x0e\x32\x35.google.cloud.securitycenter.v1.MitreAttack.Technique\x12\x0f\n\x07version\x18\x05 \x01(\t\"\xb4\x02\n\x06Tactic\x12\x16\n\x12TACTIC_UNSPECIFIED\x10\x00\x12\x12\n\x0eRECONNAISSANCE\x10\x01\x12\x18\n\x14RESOURCE_DEVELOPMENT\x10\x02\x12\x12\n\x0eINITIAL_ACCESS\x10\x05\x12\r\n\tEXECUTION\x10\x03\x12\x0f\n\x0bPERSISTENCE\x10\x06\x12\x18\n\x14PRIVILEGE_ESCALATION\x10\x08\x12\x13\n\x0f\x44\x45\x46\x45NSE_EVASION\x10\x07\x12\x15\n\x11\x43REDENTIAL_ACCESS\x10\t\x12\r\n\tDISCOVERY\x10\n\x12\x14\n\x10LATERAL_MOVEMENT\x10\x0b\x12\x0e\n\nCOLLECTION\x10\x0c\x12\x17\n\x13\x43OMMAND_AND_CONTROL\x10\x04\x12\x10\n\x0c\x45XFILTRATION\x10\r\x12\n\n\x06IMPACT\x10\x0e\"\x9f\x0e\n\tTechnique\x12\x19\n\x15TECHNIQUE_UNSPECIFIED\x10\x00\x12\x10\n\x0cMASQUERADING\x10\x31\x12%\n!MATCH_LEGITIMATE_NAME_OR_LOCATION\x10\x32\x12(\n$BOOT_OR_LOGON_INITIALIZATION_SCRIPTS\x10%\x12\x11\n\rSTARTUP_ITEMS\x10&\x12\x1d\n\x19NETWORK_SERVICE_DISCOVERY\x10 \x12\x15\n\x11PROCESS_DISCOVERY\x10\x38\x12%\n!COMMAND_AND_SCRIPTING_INTERPRETER\x10\x06\x12\x0e\n\nUNIX_SHELL\x10\x07\x12\n\n\x06PYTHON\x10;\x12)\n%EXPLOITATION_FOR_PRIVILEGE_ESCALATION\x10?\x12\x1f\n\x1bPERMISSION_GROUPS_DISCOVERY\x10\x12\x12\x10\n\x0c\x43LOUD_GROUPS\x10\x13\x12#\n\x1fINDICATOR_REMOVAL_FILE_DELETION\x10@\x12\x1e\n\x1a\x41PPLICATION_LAYER_PROTOCOL\x10-\x12\x07\n\x03\x44NS\x10.\x12\x1d\n\x19SOFTWARE_DEPLOYMENT_TOOLS\x10/\x12\x12\n\x0eVALID_ACCOUNTS\x10\x0e\x12\x14\n\x10\x44\x45\x46\x41ULT_ACCOUNTS\x10#\x12\x12\n\x0eLOCAL_ACCOUNTS\x10\x0f\x12\x12\n\x0e\x43LOUD_ACCOUNTS\x10\x10\x12\t\n\x05PROXY\x10\t\x12\x12\n\x0e\x45XTERNAL_PROXY\x10\n\x12\x13\n\x0fMULTI_HOP_PROXY\x10\x0b\x12\x18\n\x14\x41\x43\x43OUNT_MANIPULATION\x10\x16\x12 \n\x1c\x41\x44\x44ITIONAL_CLOUD_CREDENTIALS\x10(\x12\x17\n\x13SSH_AUTHORIZED_KEYS\x10\x17\x12&\n\"ADDITIONAL_CONTAINER_CLUSTER_ROLES\x10:\x12\x19\n\x15INGRESS_TOOL_TRANSFER\x10\x03\x12\x0e\n\nNATIVE_API\x10\x04\x12\x0f\n\x0b\x42RUTE_FORCE\x10,\x12\x12\n\x0eSHARED_MODULES\x10\x05\x12\x1d\n\x19\x41\x43\x43\x45SS_TOKEN_MANIPULATION\x10!\x12 \n\x1cTOKEN_IMPERSONATION_OR_THEFT\x10\'\x12%\n!EXPLOIT_PUBLIC_FACING_APPLICATION\x10\x1b\x12\x1e\n\x1a\x44OMAIN_POLICY_MODIFICATION\x10\x1e\x12\x14\n\x10\x44\x41TA_DESTRUCTION\x10\x1d\x12\x10\n\x0cSERVICE_STOP\x10\x34\x12\x1b\n\x17INHIBIT_SYSTEM_RECOVERY\x10$\x12\x16\n\x12RESOURCE_HIJACKING\x10\x08\x12\x1d\n\x19NETWORK_DENIAL_OF_SERVICE\x10\x11\x12\x1b\n\x17\x43LOUD_SERVICE_DISCOVERY\x10\x30\x12\"\n\x1eSTEAL_APPLICATION_ACCESS_TOKEN\x10*\x12\x1a\n\x16\x41\x43\x43OUNT_ACCESS_REMOVAL\x10\x33\x12\x1c\n\x18STEAL_WEB_SESSION_COOKIE\x10\x19\x12#\n\x1f\x43REATE_OR_MODIFY_SYSTEM_PROCESS\x10\x18\x12%\n!ABUSE_ELEVATION_CONTROL_MECHANISM\x10\"\x12\x19\n\x15UNSECURED_CREDENTIALS\x10\r\x12!\n\x1dMODIFY_AUTHENTICATION_PROCESS\x10\x1c\x12\x13\n\x0fIMPAIR_DEFENSES\x10\x1f\x12\x1b\n\x17\x44ISABLE_OR_MODIFY_TOOLS\x10\x37\x12!\n\x1d\x45XFILTRATION_OVER_WEB_SERVICE\x10\x14\x12!\n\x1d\x45XFILTRATION_TO_CLOUD_STORAGE\x10\x15\x12\x16\n\x12\x44YNAMIC_RESOLUTION\x10\x0c\x12\x19\n\x15LATERAL_TOOL_TRANSFER\x10)\x12\'\n#MODIFY_CLOUD_COMPUTE_INFRASTRUCTURE\x10\x1a\x12\x13\n\x0f\x43REATE_SNAPSHOT\x10\x36\x12\"\n\x1e\x43LOUD_INFRASTRUCTURE_DISCOVERY\x10\x35\x12\x17\n\x13OBTAIN_CAPABILITIES\x10+\x12\x13\n\x0f\x41\x43TIVE_SCANNING\x10\x01\x12\x16\n\x12SCANNING_IP_BLOCKS\x10\x02\x12$\n CONTAINER_ADMINISTRATION_COMMAND\x10<\x12\x12\n\x0e\x45SCAPE_TO_HOST\x10=\x12$\n CONTAINER_AND_RESOURCE_DISCOVERY\x10\x39\x12.\n*STEAL_OR_FORGE_AUTHENTICATION_CERTIFICATES\x10>B\xea\x01\n\"com.google.cloud.securitycenter.v1B\x10MitreAttackProtoP\x01ZJcloud.google.com/go/securitycenter/apiv1/securitycenterpb;securitycenterpb\xaa\x02\x1eGoogle.Cloud.SecurityCenter.V1\xca\x02\x1eGoogle\\Cloud\\SecurityCenter\\V1\xea\x02!Google::Cloud::SecurityCenter::V1b\x06proto3" - -pool = ::Google::Protobuf::DescriptorPool.generated_pool -pool.add_serialized_file(descriptor_data) - -module Google - module Cloud - module SecurityCenter - module V1 - MitreAttack = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.securitycenter.v1.MitreAttack").msgclass - MitreAttack::Tactic = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.securitycenter.v1.MitreAttack.Tactic").enummodule - MitreAttack::Technique = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.securitycenter.v1.MitreAttack.Technique").enummodule - end - end - end -end diff --git a/owl-bot-staging/google-cloud-security_center-v1/lib/google/cloud/securitycenter/v1/mute_config_pb.rb b/owl-bot-staging/google-cloud-security_center-v1/lib/google/cloud/securitycenter/v1/mute_config_pb.rb deleted file mode 100644 index 6f270729b563..000000000000 --- a/owl-bot-staging/google-cloud-security_center-v1/lib/google/cloud/securitycenter/v1/mute_config_pb.rb +++ /dev/null @@ -1,26 +0,0 @@ -# frozen_string_literal: true -# Generated by the protocol buffer compiler. DO NOT EDIT! -# source: google/cloud/securitycenter/v1/mute_config.proto - -require 'google/protobuf' - -require 'google/api/field_behavior_pb' -require 'google/api/resource_pb' -require 'google/protobuf/timestamp_pb' - - -descriptor_data = "\n0google/cloud/securitycenter/v1/mute_config.proto\x12\x1egoogle.cloud.securitycenter.v1\x1a\x1fgoogle/api/field_behavior.proto\x1a\x19google/api/resource.proto\x1a\x1fgoogle/protobuf/timestamp.proto\"\xe9\x06\n\nMuteConfig\x12\x0c\n\x04name\x18\x01 \x01(\t\x12\x18\n\x0c\x64isplay_name\x18\x02 \x01(\tB\x02\x18\x01\x12\x13\n\x0b\x64\x65scription\x18\x03 \x01(\t\x12\x13\n\x06\x66ilter\x18\x04 \x01(\tB\x03\xe0\x41\x02\x12\x34\n\x0b\x63reate_time\x18\x05 \x01(\x0b\x32\x1a.google.protobuf.TimestampB\x03\xe0\x41\x03\x12\x34\n\x0bupdate_time\x18\x06 \x01(\x0b\x32\x1a.google.protobuf.TimestampB\x03\xe0\x41\x03\x12\x1f\n\x12most_recent_editor\x18\x07 \x01(\tB\x03\xe0\x41\x03\x12L\n\x04type\x18\x08 \x01(\x0e\x32\x39.google.cloud.securitycenter.v1.MuteConfig.MuteConfigTypeB\x03\xe0\x41\x01\x12\x34\n\x0b\x65xpiry_time\x18\t \x01(\x0b\x32\x1a.google.protobuf.TimestampB\x03\xe0\x41\x01\"K\n\x0eMuteConfigType\x12 \n\x1cMUTE_CONFIG_TYPE_UNSPECIFIED\x10\x00\x12\n\n\x06STATIC\x10\x01\x12\x0b\n\x07\x44YNAMIC\x10\x02:\xaa\x03\xea\x41\xa6\x03\n(securitycenter.googleapis.com/MuteConfig\x12\x36organizations/{organization}/muteConfigs/{mute_config}\x12*folders/{folder}/muteConfigs/{mute_config}\x12,projects/{project}/muteConfigs/{mute_config}\x12Korganizations/{organization}/locations/{location}/muteConfigs/{mute_config}\x12?folders/{folder}/locations/{location}/muteConfigs/{mute_config}\x12\x41projects/{project}/locations/{location}/muteConfigs/{mute_config}*\x0bmuteConfigs2\nmuteConfigB\xe9\x01\n\"com.google.cloud.securitycenter.v1B\x0fMuteConfigProtoP\x01ZJcloud.google.com/go/securitycenter/apiv1/securitycenterpb;securitycenterpb\xaa\x02\x1eGoogle.Cloud.SecurityCenter.V1\xca\x02\x1eGoogle\\Cloud\\SecurityCenter\\V1\xea\x02!Google::Cloud::SecurityCenter::V1b\x06proto3" - -pool = ::Google::Protobuf::DescriptorPool.generated_pool -pool.add_serialized_file(descriptor_data) - -module Google - module Cloud - module SecurityCenter - module V1 - MuteConfig = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.securitycenter.v1.MuteConfig").msgclass - MuteConfig::MuteConfigType = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.securitycenter.v1.MuteConfig.MuteConfigType").enummodule - end - end - end -end diff --git a/owl-bot-staging/google-cloud-security_center-v1/lib/google/cloud/securitycenter/v1/notebook_pb.rb b/owl-bot-staging/google-cloud-security_center-v1/lib/google/cloud/securitycenter/v1/notebook_pb.rb deleted file mode 100644 index f8cc3f85eb77..000000000000 --- a/owl-bot-staging/google-cloud-security_center-v1/lib/google/cloud/securitycenter/v1/notebook_pb.rb +++ /dev/null @@ -1,23 +0,0 @@ -# frozen_string_literal: true -# Generated by the protocol buffer compiler. DO NOT EDIT! -# source: google/cloud/securitycenter/v1/notebook.proto - -require 'google/protobuf' - -require 'google/protobuf/timestamp_pb' - - -descriptor_data = "\n-google/cloud/securitycenter/v1/notebook.proto\x12\x1egoogle.cloud.securitycenter.v1\x1a\x1fgoogle/protobuf/timestamp.proto\"x\n\x08Notebook\x12\x0c\n\x04name\x18\x01 \x01(\t\x12\x0f\n\x07service\x18\x02 \x01(\t\x12\x13\n\x0blast_author\x18\x03 \x01(\t\x12\x38\n\x14notebook_update_time\x18\x04 \x01(\x0b\x32\x1a.google.protobuf.TimestampB\xe7\x01\n\"com.google.cloud.securitycenter.v1B\rNotebookProtoP\x01ZJcloud.google.com/go/securitycenter/apiv1/securitycenterpb;securitycenterpb\xaa\x02\x1eGoogle.Cloud.SecurityCenter.V1\xca\x02\x1eGoogle\\Cloud\\SecurityCenter\\V1\xea\x02!Google::Cloud::SecurityCenter::V1b\x06proto3" - -pool = ::Google::Protobuf::DescriptorPool.generated_pool -pool.add_serialized_file(descriptor_data) - -module Google - module Cloud - module SecurityCenter - module V1 - Notebook = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.securitycenter.v1.Notebook").msgclass - end - end - end -end diff --git a/owl-bot-staging/google-cloud-security_center-v1/lib/google/cloud/securitycenter/v1/notification_config_pb.rb b/owl-bot-staging/google-cloud-security_center-v1/lib/google/cloud/securitycenter/v1/notification_config_pb.rb deleted file mode 100644 index df0bb0cecc79..000000000000 --- a/owl-bot-staging/google-cloud-security_center-v1/lib/google/cloud/securitycenter/v1/notification_config_pb.rb +++ /dev/null @@ -1,25 +0,0 @@ -# frozen_string_literal: true -# Generated by the protocol buffer compiler. DO NOT EDIT! -# source: google/cloud/securitycenter/v1/notification_config.proto - -require 'google/protobuf' - -require 'google/api/field_behavior_pb' -require 'google/api/resource_pb' - - -descriptor_data = "\n8google/cloud/securitycenter/v1/notification_config.proto\x12\x1egoogle.cloud.securitycenter.v1\x1a\x1fgoogle/api/field_behavior.proto\x1a\x19google/api/resource.proto\"\xc5\x04\n\x12NotificationConfig\x12\x0c\n\x04name\x18\x01 \x01(\t\x12\x13\n\x0b\x64\x65scription\x18\x02 \x01(\t\x12\x36\n\x0cpubsub_topic\x18\x03 \x01(\tB \xfa\x41\x1d\n\x1bpubsub.googleapis.com/Topic\x12\x1c\n\x0fservice_account\x18\x04 \x01(\tB\x03\xe0\x41\x03\x12^\n\x10streaming_config\x18\x05 \x01(\x0b\x32\x42.google.cloud.securitycenter.v1.NotificationConfig.StreamingConfigH\x00\x1a!\n\x0fStreamingConfig\x12\x0e\n\x06\x66ilter\x18\x01 \x01(\t:\xa1\x02\xea\x41\x9d\x02\n0securitycenter.googleapis.com/NotificationConfig\x12\x46organizations/{organization}/notificationConfigs/{notification_config}\x12:folders/{folder}/notificationConfigs/{notification_config}\x12\n\x04name\x18\x01 \x01(\tB0\xe0\x41\x02\xfa\x41*\n(securitycenter.googleapis.com/MuteConfig\"i\n\x1f\x44\x65leteNotificationConfigRequest\x12\x46\n\x04name\x18\x01 \x01(\tB8\xe0\x41\x02\xfa\x41\x32\n0securitycenter.googleapis.com/NotificationConfig\"\x8b\x01\n0DeleteSecurityHealthAnalyticsCustomModuleRequest\x12W\n\x04name\x18\x01 \x01(\tBI\xe0\x41\x02\xfa\x41\x43\nAsecuritycenter.googleapis.com/SecurityHealthAnalyticsCustomModule\"^\n\x18GetBigQueryExportRequest\x12\x42\n\x04name\x18\x01 \x01(\tB4\xe0\x41\x02\xfa\x41.\n,securitycenter.googleapis.com/BigQueryExport\"V\n\x14GetMuteConfigRequest\x12>\n\x04name\x18\x01 \x01(\tB0\xe0\x41\x02\xfa\x41*\n(securitycenter.googleapis.com/MuteConfig\"f\n\x1cGetNotificationConfigRequest\x12\x46\n\x04name\x18\x01 \x01(\tB8\xe0\x41\x02\xfa\x41\x32\n0securitycenter.googleapis.com/NotificationConfig\"j\n\x1eGetOrganizationSettingsRequest\x12H\n\x04name\x18\x01 \x01(\tB:\xe0\x41\x02\xfa\x41\x34\n2securitycenter.googleapis.com/OrganizationSettings\"\x9a\x01\n6GetEffectiveSecurityHealthAnalyticsCustomModuleRequest\x12`\n\x04name\x18\x01 \x01(\tBR\xe0\x41\x02\xfa\x41L\nJsecuritycenter.googleapis.com/EffectiveSecurityHealthAnalyticsCustomModule\"\x88\x01\n-GetSecurityHealthAnalyticsCustomModuleRequest\x12W\n\x04name\x18\x01 \x01(\tBI\xe0\x41\x02\xfa\x41\x43\nAsecuritycenter.googleapis.com/SecurityHealthAnalyticsCustomModule\"N\n\x10GetSourceRequest\x12:\n\x04name\x18\x01 \x01(\tB,\xe0\x41\x02\xfa\x41&\n$securitycenter.googleapis.com/Source\"\x83\x02\n\x12GroupAssetsRequest\x12;\n\x06parent\x18\x01 \x01(\tB+\xe0\x41\x02\xfa\x41%\x12#securitycenter.googleapis.com/Asset\x12\x0e\n\x06\x66ilter\x18\x02 \x01(\t\x12\x15\n\x08group_by\x18\x03 \x01(\tB\x03\xe0\x41\x02\x12\x33\n\x10\x63ompare_duration\x18\x04 \x01(\x0b\x32\x19.google.protobuf.Duration\x12-\n\tread_time\x18\x05 \x01(\x0b\x32\x1a.google.protobuf.Timestamp\x12\x12\n\npage_token\x18\x07 \x01(\t\x12\x11\n\tpage_size\x18\x08 \x01(\x05\"\xb8\x01\n\x13GroupAssetsResponse\x12\x45\n\x10group_by_results\x18\x01 \x03(\x0b\x32+.google.cloud.securitycenter.v1.GroupResult\x12-\n\tread_time\x18\x02 \x01(\x0b\x32\x1a.google.protobuf.Timestamp\x12\x17\n\x0fnext_page_token\x18\x03 \x01(\t\x12\x12\n\ntotal_size\x18\x04 \x01(\x05\"\x86\x02\n\x14GroupFindingsRequest\x12<\n\x06parent\x18\x01 \x01(\tB,\xe0\x41\x02\xfa\x41&\n$securitycenter.googleapis.com/Source\x12\x0e\n\x06\x66ilter\x18\x02 \x01(\t\x12\x15\n\x08group_by\x18\x03 \x01(\tB\x03\xe0\x41\x02\x12-\n\tread_time\x18\x04 \x01(\x0b\x32\x1a.google.protobuf.Timestamp\x12\x33\n\x10\x63ompare_duration\x18\x05 \x01(\x0b\x32\x19.google.protobuf.Duration\x12\x12\n\npage_token\x18\x07 \x01(\t\x12\x11\n\tpage_size\x18\x08 \x01(\x05\"\xba\x01\n\x15GroupFindingsResponse\x12\x45\n\x10group_by_results\x18\x01 \x03(\x0b\x32+.google.cloud.securitycenter.v1.GroupResult\x12-\n\tread_time\x18\x02 \x01(\x0b\x32\x1a.google.protobuf.Timestamp\x12\x17\n\x0fnext_page_token\x18\x03 \x01(\t\x12\x12\n\ntotal_size\x18\x04 \x01(\x05\"\xb8\x01\n\x0bGroupResult\x12O\n\nproperties\x18\x01 \x03(\x0b\x32;.google.cloud.securitycenter.v1.GroupResult.PropertiesEntry\x12\r\n\x05\x63ount\x18\x02 \x01(\x03\x1aI\n\x0fPropertiesEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12%\n\x05value\x18\x02 \x01(\x0b\x32\x16.google.protobuf.Value:\x02\x38\x01\"\xbd\x01\n9ListDescendantSecurityHealthAnalyticsCustomModulesRequest\x12Y\n\x06parent\x18\x01 \x01(\tBI\xe0\x41\x02\xfa\x41\x43\x12\x41securitycenter.googleapis.com/SecurityHealthAnalyticsCustomModule\x12\x11\n\tpage_size\x18\x02 \x01(\x05\x12\x12\n\npage_token\x18\x03 \x01(\t\"\xcc\x01\n:ListDescendantSecurityHealthAnalyticsCustomModulesResponse\x12u\n(security_health_analytics_custom_modules\x18\x01 \x03(\x0b\x32\x43.google.cloud.securitycenter.v1.SecurityHealthAnalyticsCustomModule\x12\x17\n\x0fnext_page_token\x18\x02 \x01(\t\"\xb0\x01\n\x1aListValuedResourcesRequest\x12\x44\n\x06parent\x18\x01 \x01(\tB4\xe0\x41\x02\xfa\x41.\x12,securitycenter.googleapis.com/ValuedResource\x12\x0e\n\x06\x66ilter\x18\x02 \x01(\t\x12\x12\n\npage_token\x18\x03 \x01(\t\x12\x11\n\tpage_size\x18\x04 \x01(\x05\x12\x15\n\x08order_by\x18\x05 \x01(\tB\x03\xe0\x41\x01\"\x94\x01\n\x1bListValuedResourcesResponse\x12H\n\x10valued_resources\x18\x01 \x03(\x0b\x32..google.cloud.securitycenter.v1.ValuedResource\x12\x17\n\x0fnext_page_token\x18\x02 \x01(\t\x12\x12\n\ntotal_size\x18\x03 \x01(\x05\"\x91\x01\n\x16ListAttackPathsRequest\x12@\n\x06parent\x18\x01 \x01(\tB0\xe0\x41\x02\xfa\x41*\x12(securitycenter.googleapis.com/AttackPath\x12\x0e\n\x06\x66ilter\x18\x02 \x01(\t\x12\x12\n\npage_token\x18\x03 \x01(\t\x12\x11\n\tpage_size\x18\x04 \x01(\x05\"t\n\x17ListAttackPathsResponse\x12@\n\x0c\x61ttack_paths\x18\x01 \x03(\x0b\x32*.google.cloud.securitycenter.v1.AttackPath\x12\x17\n\x0fnext_page_token\x18\x02 \x01(\t\"V\n\x14GetSimulationRequest\x12>\n\x04name\x18\x01 \x01(\tB0\xe0\x41\x02\xfa\x41*\n(securitycenter.googleapis.com/Simulation\"^\n\x18GetValuedResourceRequest\x12\x42\n\x04name\x18\x01 \x01(\tB4\xe0\x41\x02\xfa\x41.\n,securitycenter.googleapis.com/ValuedResource\"\x81\x01\n\x16ListMuteConfigsRequest\x12@\n\x06parent\x18\x01 \x01(\tB0\xe0\x41\x02\xfa\x41*\x12(securitycenter.googleapis.com/MuteConfig\x12\x11\n\tpage_size\x18\x02 \x01(\x05\x12\x12\n\npage_token\x18\x03 \x01(\t\"t\n\x17ListMuteConfigsResponse\x12@\n\x0cmute_configs\x18\x01 \x03(\x0b\x32*.google.cloud.securitycenter.v1.MuteConfig\x12\x17\n\x0fnext_page_token\x18\x02 \x01(\t\"\x91\x01\n\x1eListNotificationConfigsRequest\x12H\n\x06parent\x18\x01 \x01(\tB8\xe0\x41\x02\xfa\x41\x32\x12\x30securitycenter.googleapis.com/NotificationConfig\x12\x12\n\npage_token\x18\x02 \x01(\t\x12\x11\n\tpage_size\x18\x03 \x01(\x05\"\x8c\x01\n\x1fListNotificationConfigsResponse\x12P\n\x14notification_configs\x18\x01 \x03(\x0b\x32\x32.google.cloud.securitycenter.v1.NotificationConfig\x12\x17\n\x0fnext_page_token\x18\x02 \x01(\t\"\xbc\x01\n8ListEffectiveSecurityHealthAnalyticsCustomModulesRequest\x12Y\n\x06parent\x18\x01 \x01(\tBI\xe0\x41\x02\xfa\x41\x43\x12\x41securitycenter.googleapis.com/SecurityHealthAnalyticsCustomModule\x12\x11\n\tpage_size\x18\x02 \x01(\x05\x12\x12\n\npage_token\x18\x03 \x01(\t\"\xdf\x01\n9ListEffectiveSecurityHealthAnalyticsCustomModulesResponse\x12\x88\x01\n2effective_security_health_analytics_custom_modules\x18\x01 \x03(\x0b\x32L.google.cloud.securitycenter.v1.EffectiveSecurityHealthAnalyticsCustomModule\x12\x17\n\x0fnext_page_token\x18\x02 \x01(\t\"\xb3\x01\n/ListSecurityHealthAnalyticsCustomModulesRequest\x12Y\n\x06parent\x18\x01 \x01(\tBI\xe0\x41\x02\xfa\x41\x43\x12\x41securitycenter.googleapis.com/SecurityHealthAnalyticsCustomModule\x12\x11\n\tpage_size\x18\x02 \x01(\x05\x12\x12\n\npage_token\x18\x03 \x01(\t\"\xc2\x01\n0ListSecurityHealthAnalyticsCustomModulesResponse\x12u\n(security_health_analytics_custom_modules\x18\x01 \x03(\x0b\x32\x43.google.cloud.securitycenter.v1.SecurityHealthAnalyticsCustomModule\x12\x17\n\x0fnext_page_token\x18\x02 \x01(\t\"y\n\x12ListSourcesRequest\x12<\n\x06parent\x18\x01 \x01(\tB,\xe0\x41\x02\xfa\x41&\x12$securitycenter.googleapis.com/Source\x12\x12\n\npage_token\x18\x02 \x01(\t\x12\x11\n\tpage_size\x18\x07 \x01(\x05\"g\n\x13ListSourcesResponse\x12\x37\n\x07sources\x18\x01 \x03(\x0b\x32&.google.cloud.securitycenter.v1.Source\x12\x17\n\x0fnext_page_token\x18\x02 \x01(\t\"\xad\x02\n\x11ListAssetsRequest\x12;\n\x06parent\x18\x01 \x01(\tB+\xe0\x41\x02\xfa\x41%\x12#securitycenter.googleapis.com/Asset\x12\x0e\n\x06\x66ilter\x18\x02 \x01(\t\x12\x10\n\x08order_by\x18\x03 \x01(\t\x12-\n\tread_time\x18\x04 \x01(\x0b\x32\x1a.google.protobuf.Timestamp\x12\x33\n\x10\x63ompare_duration\x18\x05 \x01(\x0b\x32\x19.google.protobuf.Duration\x12.\n\nfield_mask\x18\x07 \x01(\x0b\x32\x1a.google.protobuf.FieldMask\x12\x12\n\npage_token\x18\x08 \x01(\t\x12\x11\n\tpage_size\x18\t \x01(\x05\"\xc3\x03\n\x12ListAssetsResponse\x12`\n\x13list_assets_results\x18\x01 \x03(\x0b\x32\x43.google.cloud.securitycenter.v1.ListAssetsResponse.ListAssetsResult\x12-\n\tread_time\x18\x02 \x01(\x0b\x32\x1a.google.protobuf.Timestamp\x12\x17\n\x0fnext_page_token\x18\x03 \x01(\t\x12\x12\n\ntotal_size\x18\x04 \x01(\x05\x1a\xee\x01\n\x10ListAssetsResult\x12\x34\n\x05\x61sset\x18\x01 \x01(\x0b\x32%.google.cloud.securitycenter.v1.Asset\x12\x65\n\x0cstate_change\x18\x02 \x01(\x0e\x32O.google.cloud.securitycenter.v1.ListAssetsResponse.ListAssetsResult.StateChange\"=\n\x0bStateChange\x12\n\n\x06UNUSED\x10\x00\x12\t\n\x05\x41\x44\x44\x45\x44\x10\x01\x12\x0b\n\x07REMOVED\x10\x02\x12\n\n\x06\x41\x43TIVE\x10\x03\"\xb0\x02\n\x13ListFindingsRequest\x12<\n\x06parent\x18\x01 \x01(\tB,\xe0\x41\x02\xfa\x41&\n$securitycenter.googleapis.com/Source\x12\x0e\n\x06\x66ilter\x18\x02 \x01(\t\x12\x10\n\x08order_by\x18\x03 \x01(\t\x12-\n\tread_time\x18\x04 \x01(\x0b\x32\x1a.google.protobuf.Timestamp\x12\x33\n\x10\x63ompare_duration\x18\x05 \x01(\x0b\x32\x19.google.protobuf.Duration\x12.\n\nfield_mask\x18\x07 \x01(\x0b\x32\x1a.google.protobuf.FieldMask\x12\x12\n\npage_token\x18\x08 \x01(\t\x12\x11\n\tpage_size\x18\t \x01(\x05\"\xb8\t\n\x14ListFindingsResponse\x12\x66\n\x15list_findings_results\x18\x01 \x03(\x0b\x32G.google.cloud.securitycenter.v1.ListFindingsResponse.ListFindingsResult\x12-\n\tread_time\x18\x02 \x01(\x0b\x32\x1a.google.protobuf.Timestamp\x12\x17\n\x0fnext_page_token\x18\x03 \x01(\t\x12\x12\n\ntotal_size\x18\x04 \x01(\x05\x1a\xdb\x07\n\x12ListFindingsResult\x12\x38\n\x07\x66inding\x18\x01 \x01(\x0b\x32\'.google.cloud.securitycenter.v1.Finding\x12i\n\x0cstate_change\x18\x02 \x01(\x0e\x32S.google.cloud.securitycenter.v1.ListFindingsResponse.ListFindingsResult.StateChange\x12g\n\x08resource\x18\x03 \x01(\x0b\x32P.google.cloud.securitycenter.v1.ListFindingsResponse.ListFindingsResult.ResourceB\x03\xe0\x41\x03\x1a\xe7\x04\n\x08Resource\x12\x0c\n\x04name\x18\x01 \x01(\t\x12\x14\n\x0c\x64isplay_name\x18\x08 \x01(\t\x12\x0c\n\x04type\x18\x06 \x01(\t\x12\x14\n\x0cproject_name\x18\x02 \x01(\t\x12\x1c\n\x14project_display_name\x18\x03 \x01(\t\x12\x13\n\x0bparent_name\x18\x04 \x01(\t\x12\x1b\n\x13parent_display_name\x18\x05 \x01(\t\x12\x37\n\x07\x66olders\x18\x07 \x03(\x0b\x32&.google.cloud.securitycenter.v1.Folder\x12\x45\n\x0e\x63loud_provider\x18\t \x01(\x0e\x32-.google.cloud.securitycenter.v1.CloudProvider\x12\x14\n\x0corganization\x18\n \x01(\t\x12\x0f\n\x07service\x18\x0b \x01(\t\x12\x10\n\x08location\x18\x0c \x01(\t\x12\x43\n\x0c\x61ws_metadata\x18\x10 \x01(\x0b\x32+.google.cloud.securitycenter.v1.AwsMetadataH\x00\x12G\n\x0e\x61zure_metadata\x18\x11 \x01(\x0b\x32-.google.cloud.securitycenter.v1.AzureMetadataH\x00\x12\x43\n\rresource_path\x18\x12 \x01(\x0b\x32,.google.cloud.securitycenter.v1.ResourcePath\x12\x1c\n\x14resource_path_string\x18\x13 \x01(\tB\x19\n\x17\x63loud_provider_metadata\"M\n\x0bStateChange\x12\n\n\x06UNUSED\x10\x00\x12\x0b\n\x07\x43HANGED\x10\x01\x12\r\n\tUNCHANGED\x10\x02\x12\t\n\x05\x41\x44\x44\x45\x44\x10\x03\x12\x0b\n\x07REMOVED\x10\x04\"\xcd\x01\n\x16SetFindingStateRequest\x12;\n\x04name\x18\x01 \x01(\tB-\xe0\x41\x02\xfa\x41\'\n%securitycenter.googleapis.com/Finding\x12\x41\n\x05state\x18\x02 \x01(\x0e\x32-.google.cloud.securitycenter.v1.Finding.StateB\x03\xe0\x41\x02\x12\x33\n\nstart_time\x18\x03 \x01(\x0b\x32\x1a.google.protobuf.TimestampB\x03\xe0\x41\x02\"\x8e\x01\n\x0eSetMuteRequest\x12;\n\x04name\x18\x01 \x01(\tB-\xe0\x41\x02\xfa\x41\'\n%securitycenter.googleapis.com/Finding\x12?\n\x04mute\x18\x02 \x01(\x0e\x32,.google.cloud.securitycenter.v1.Finding.MuteB\x03\xe0\x41\x02\"d\n\x18RunAssetDiscoveryRequest\x12H\n\x06parent\x18\x01 \x01(\tB8\xe0\x41\x02\xfa\x41\x32\n0cloudresourcemanager.googleapis.com/Organization\"\xac\x03\n2SimulateSecurityHealthAnalyticsCustomModuleRequest\x12\x13\n\x06parent\x18\x01 \x01(\tB\x03\xe0\x41\x02\x12H\n\rcustom_config\x18\x02 \x01(\x0b\x32,.google.cloud.securitycenter.v1.CustomConfigB\x03\xe0\x41\x02\x12{\n\x08resource\x18\x03 \x01(\x0b\x32\x64.google.cloud.securitycenter.v1.SimulateSecurityHealthAnalyticsCustomModuleRequest.SimulatedResourceB\x03\xe0\x41\x02\x1a\x99\x01\n\x11SimulatedResource\x12\x1a\n\rresource_type\x18\x01 \x01(\tB\x03\xe0\x41\x02\x12\x33\n\rresource_data\x18\x02 \x01(\x0b\x32\x17.google.protobuf.StructB\x03\xe0\x41\x01\x12\x33\n\x0fiam_policy_data\x18\x03 \x01(\x0b\x32\x15.google.iam.v1.PolicyB\x03\xe0\x41\x01\"\xd9\x02\n3SimulateSecurityHealthAnalyticsCustomModuleResponse\x12s\n\x06result\x18\x01 \x01(\x0b\x32\x63.google.cloud.securitycenter.v1.SimulateSecurityHealthAnalyticsCustomModuleResponse.SimulatedResult\x1a\xac\x01\n\x0fSimulatedResult\x12:\n\x07\x66inding\x18\x01 \x01(\x0b\x32\'.google.cloud.securitycenter.v1.FindingH\x00\x12.\n\x0cno_violation\x18\x02 \x01(\x0b\x32\x16.google.protobuf.EmptyH\x00\x12#\n\x05\x65rror\x18\x03 \x01(\x0b\x32\x12.google.rpc.StatusH\x00\x42\x08\n\x06result\"\x9c\x01\n\x1bUpdateExternalSystemRequest\x12L\n\x0f\x65xternal_system\x18\x01 \x01(\x0b\x32..google.cloud.securitycenter.v1.ExternalSystemB\x03\xe0\x41\x02\x12/\n\x0bupdate_mask\x18\x02 \x01(\x0b\x32\x1a.google.protobuf.FieldMask\"\x86\x01\n\x14UpdateFindingRequest\x12=\n\x07\x66inding\x18\x01 \x01(\x0b\x32\'.google.cloud.securitycenter.v1.FindingB\x03\xe0\x41\x02\x12/\n\x0bupdate_mask\x18\x02 \x01(\x0b\x32\x1a.google.protobuf.FieldMask\"\x90\x01\n\x17UpdateMuteConfigRequest\x12\x44\n\x0bmute_config\x18\x01 \x01(\x0b\x32*.google.cloud.securitycenter.v1.MuteConfigB\x03\xe0\x41\x02\x12/\n\x0bupdate_mask\x18\x02 \x01(\x0b\x32\x1a.google.protobuf.FieldMask\"\xa8\x01\n\x1fUpdateNotificationConfigRequest\x12T\n\x13notification_config\x18\x01 \x01(\x0b\x32\x32.google.cloud.securitycenter.v1.NotificationConfigB\x03\xe0\x41\x02\x12/\n\x0bupdate_mask\x18\x02 \x01(\x0b\x32\x1a.google.protobuf.FieldMask\"\xae\x01\n!UpdateOrganizationSettingsRequest\x12X\n\x15organization_settings\x18\x01 \x01(\x0b\x32\x34.google.cloud.securitycenter.v1.OrganizationSettingsB\x03\xe0\x41\x02\x12/\n\x0bupdate_mask\x18\x02 \x01(\x0b\x32\x1a.google.protobuf.FieldMask\"\xde\x01\n0UpdateSecurityHealthAnalyticsCustomModuleRequest\x12y\n\'security_health_analytics_custom_module\x18\x01 \x01(\x0b\x32\x43.google.cloud.securitycenter.v1.SecurityHealthAnalyticsCustomModuleB\x03\xe0\x41\x02\x12/\n\x0bupdate_mask\x18\x02 \x01(\x0b\x32\x1a.google.protobuf.FieldMask\"\x83\x01\n\x13UpdateSourceRequest\x12;\n\x06source\x18\x01 \x01(\x0b\x32&.google.cloud.securitycenter.v1.SourceB\x03\xe0\x41\x02\x12/\n\x0bupdate_mask\x18\x02 \x01(\x0b\x32\x1a.google.protobuf.FieldMask\"\xc9\x01\n\x1aUpdateSecurityMarksRequest\x12J\n\x0esecurity_marks\x18\x01 \x01(\x0b\x32-.google.cloud.securitycenter.v1.SecurityMarksB\x03\xe0\x41\x02\x12/\n\x0bupdate_mask\x18\x02 \x01(\x0b\x32\x1a.google.protobuf.FieldMask\x12.\n\nstart_time\x18\x03 \x01(\x0b\x32\x1a.google.protobuf.Timestamp\"\xd4\x01\n\x1b\x43reateBigQueryExportRequest\x12\x44\n\x06parent\x18\x01 \x01(\tB4\xe0\x41\x02\xfa\x41.\x12,securitycenter.googleapis.com/BigQueryExport\x12M\n\x10\x62ig_query_export\x18\x02 \x01(\x0b\x32..google.cloud.securitycenter.v1.BigQueryExportB\x03\xe0\x41\x02\x12 \n\x13\x62ig_query_export_id\x18\x03 \x01(\tB\x03\xe0\x41\x02\"\x9d\x01\n\x1bUpdateBigQueryExportRequest\x12M\n\x10\x62ig_query_export\x18\x01 \x01(\x0b\x32..google.cloud.securitycenter.v1.BigQueryExportB\x03\xe0\x41\x02\x12/\n\x0bupdate_mask\x18\x02 \x01(\x0b\x32\x1a.google.protobuf.FieldMask\"\x89\x01\n\x1aListBigQueryExportsRequest\x12\x44\n\x06parent\x18\x01 \x01(\tB4\xe0\x41\x02\xfa\x41.\x12,securitycenter.googleapis.com/BigQueryExport\x12\x11\n\tpage_size\x18\x02 \x01(\x05\x12\x12\n\npage_token\x18\x03 \x01(\t\"\x81\x01\n\x1bListBigQueryExportsResponse\x12I\n\x11\x62ig_query_exports\x18\x01 \x03(\x0b\x32..google.cloud.securitycenter.v1.BigQueryExport\x12\x17\n\x0fnext_page_token\x18\x02 \x01(\t\"a\n\x1b\x44\x65leteBigQueryExportRequest\x12\x42\n\x04name\x18\x01 \x01(\tB4\xe0\x41\x02\xfa\x41.\n,securitycenter.googleapis.com/BigQueryExport\"\xfc\x01\n-CreateEventThreatDetectionCustomModuleRequest\x12V\n\x06parent\x18\x01 \x01(\tBF\xe0\x41\x02\xfa\x41@\x12>securitycenter.googleapis.com/EventThreatDetectionCustomModule\x12s\n$event_threat_detection_custom_module\x18\x02 \x01(\x0b\x32@.google.cloud.securitycenter.v1.EventThreatDetectionCustomModuleB\x03\xe0\x41\x02\"\xb3\x01\n/ValidateEventThreatDetectionCustomModuleRequest\x12V\n\x06parent\x18\x01 \x01(\tBF\xe0\x41\x02\xfa\x41@\x12>securitycenter.googleapis.com/EventThreatDetectionCustomModule\x12\x15\n\x08raw_text\x18\x02 \x01(\tB\x03\xe0\x41\x02\x12\x11\n\x04type\x18\x03 \x01(\tB\x03\xe0\x41\x02\"\x80\x01\n0ValidateEventThreatDetectionCustomModuleResponse\x12L\n\x06\x65rrors\x18\x02 \x01(\x0b\x32<.google.cloud.securitycenter.v1.CustomModuleValidationErrors\"\x85\x01\n-DeleteEventThreatDetectionCustomModuleRequest\x12T\n\x04name\x18\x01 \x01(\tBF\xe0\x41\x02\xfa\x41@\n>securitycenter.googleapis.com/EventThreatDetectionCustomModule\"\x82\x01\n*GetEventThreatDetectionCustomModuleRequest\x12T\n\x04name\x18\x01 \x01(\tBF\xe0\x41\x02\xfa\x41@\n>securitycenter.googleapis.com/EventThreatDetectionCustomModule\"\xb7\x01\n6ListDescendantEventThreatDetectionCustomModulesRequest\x12V\n\x06parent\x18\x01 \x01(\tBF\xe0\x41\x02\xfa\x41@\x12>securitycenter.googleapis.com/EventThreatDetectionCustomModule\x12\x12\n\npage_token\x18\x02 \x01(\t\x12\x11\n\tpage_size\x18\x03 \x01(\x05\"\xc3\x01\n7ListDescendantEventThreatDetectionCustomModulesResponse\x12o\n%event_threat_detection_custom_modules\x18\x01 \x03(\x0b\x32@.google.cloud.securitycenter.v1.EventThreatDetectionCustomModule\x12\x17\n\x0fnext_page_token\x18\x02 \x01(\t\"\xad\x01\n,ListEventThreatDetectionCustomModulesRequest\x12V\n\x06parent\x18\x01 \x01(\tBF\xe0\x41\x02\xfa\x41@\x12>securitycenter.googleapis.com/EventThreatDetectionCustomModule\x12\x12\n\npage_token\x18\x02 \x01(\t\x12\x11\n\tpage_size\x18\x03 \x01(\x05\"\xb9\x01\n-ListEventThreatDetectionCustomModulesResponse\x12o\n%event_threat_detection_custom_modules\x18\x01 \x03(\x0b\x32@.google.cloud.securitycenter.v1.EventThreatDetectionCustomModule\x12\x17\n\x0fnext_page_token\x18\x02 \x01(\t\"\xd5\x01\n-UpdateEventThreatDetectionCustomModuleRequest\x12s\n$event_threat_detection_custom_module\x18\x01 \x01(\x0b\x32@.google.cloud.securitycenter.v1.EventThreatDetectionCustomModuleB\x03\xe0\x41\x02\x12/\n\x0bupdate_mask\x18\x02 \x01(\x0b\x32\x1a.google.protobuf.FieldMask\"\x94\x01\n3GetEffectiveEventThreatDetectionCustomModuleRequest\x12]\n\x04name\x18\x01 \x01(\tBO\xe0\x41\x02\xfa\x41I\nGsecuritycenter.googleapis.com/EffectiveEventThreatDetectionCustomModule\"\xbf\x01\n5ListEffectiveEventThreatDetectionCustomModulesRequest\x12_\n\x06parent\x18\x01 \x01(\tBO\xe0\x41\x02\xfa\x41I\x12Gsecuritycenter.googleapis.com/EffectiveEventThreatDetectionCustomModule\x12\x12\n\npage_token\x18\x02 \x01(\t\x12\x11\n\tpage_size\x18\x03 \x01(\x05\"\xd6\x01\n6ListEffectiveEventThreatDetectionCustomModulesResponse\x12\x82\x01\n/effective_event_threat_detection_custom_modules\x18\x01 \x03(\x0b\x32I.google.cloud.securitycenter.v1.EffectiveEventThreatDetectionCustomModule\x12\x17\n\x0fnext_page_token\x18\x02 \x01(\t2\xf7\xb2\x01\n\x0eSecurityCenter\x12\xe2\x02\n\x10\x42ulkMuteFindings\x12\x37.google.cloud.securitycenter.v1.BulkMuteFindingsRequest\x1a\x1d.google.longrunning.Operation\"\xf5\x01\xca\x41P\n7google.cloud.securitycenter.v1.BulkMuteFindingsResponse\x12\x15google.protobuf.Empty\xda\x41\x06parent\x82\xd3\xe4\x93\x02\x92\x01\"./v1/{parent=organizations/*}/findings:bulkMute:\x01*Z-\"(/v1/{parent=folders/*}/findings:bulkMute:\x01*Z.\")/v1/{parent=projects/*}/findings:bulkMute:\x01*\x12\xd5\x04\n)CreateSecurityHealthAnalyticsCustomModule\x12P.google.cloud.securitycenter.v1.CreateSecurityHealthAnalyticsCustomModuleRequest\x1a\x43.google.cloud.securitycenter.v1.SecurityHealthAnalyticsCustomModule\"\x90\x03\xda\x41.parent,security_health_analytics_custom_module\x82\xd3\xe4\x93\x02\xd8\x02\"J/v1/{parent=organizations/*/securityHealthAnalyticsSettings}/customModules:\'security_health_analytics_custom_moduleZo\"D/v1/{parent=folders/*/securityHealthAnalyticsSettings}/customModules:\'security_health_analytics_custom_moduleZp\"E/v1/{parent=projects/*/securityHealthAnalyticsSettings}/customModules:\'security_health_analytics_custom_module\x12\xb1\x01\n\x0c\x43reateSource\x12\x33.google.cloud.securitycenter.v1.CreateSourceRequest\x1a&.google.cloud.securitycenter.v1.Source\"D\xda\x41\rparent,source\x82\xd3\xe4\x93\x02.\"$/v1/{parent=organizations/*}/sources:\x06source\x12\xcc\x01\n\rCreateFinding\x12\x34.google.cloud.securitycenter.v1.CreateFindingRequest\x1a\'.google.cloud.securitycenter.v1.Finding\"\\\xda\x41\x19parent,finding_id,finding\x82\xd3\xe4\x93\x02:\"//v1/{parent=organizations/*/sources/*}/findings:\x07\x66inding\x12\x9c\x04\n\x10\x43reateMuteConfig\x12\x37.google.cloud.securitycenter.v1.CreateMuteConfigRequest\x1a*.google.cloud.securitycenter.v1.MuteConfig\"\xa2\x03\xda\x41\x12parent,mute_config\xda\x41!parent,mute_config,mute_config_id\x82\xd3\xe4\x93\x02\xe2\x02\"(/v1/{parent=organizations/*}/muteConfigs:\x0bmute_configZC\"4/v1/{parent=organizations/*/locations/*}/muteConfigs:\x0bmute_configZ1\"\"/v1/{parent=folders/*}/muteConfigs:\x0bmute_configZ=\"./v1/{parent=folders/*/locations/*}/muteConfigs:\x0bmute_configZ2\"#/v1/{parent=projects/*}/muteConfigs:\x0bmute_configZ>\"//v1/{parent=projects/*/locations/*}/muteConfigs:\x0bmute_config\x12\xab\x03\n\x18\x43reateNotificationConfig\x12?.google.cloud.securitycenter.v1.CreateNotificationConfigRequest\x1a\x32.google.cloud.securitycenter.v1.NotificationConfig\"\x99\x02\xda\x41$parent,config_id,notification_config\xda\x41\x1aparent,notification_config\x82\xd3\xe4\x93\x02\xce\x01\"0/v1/{parent=organizations/*}/notificationConfigs:\x13notification_configZA\"*/v1/{parent=folders/*}/notificationConfigs:\x13notification_configZB\"+/v1/{parent=projects/*}/notificationConfigs:\x13notification_config\x12\x88\x03\n\x10\x44\x65leteMuteConfig\x12\x37.google.cloud.securitycenter.v1.DeleteMuteConfigRequest\x1a\x16.google.protobuf.Empty\"\xa2\x02\xda\x41\x04name\x82\xd3\xe4\x93\x02\x94\x02*(/v1/{name=organizations/*/muteConfigs/*}Z$*\"/v1/{name=folders/*/muteConfigs/*}Z%*#/v1/{name=projects/*/muteConfigs/*}Z6*4/v1/{name=organizations/*/locations/*/muteConfigs/*}Z0*./v1/{name=folders/*/locations/*/muteConfigs/*}Z1*//v1/{name=projects/*/locations/*/muteConfigs/*}\x12\x93\x02\n\x18\x44\x65leteNotificationConfig\x12?.google.cloud.securitycenter.v1.DeleteNotificationConfigRequest\x1a\x16.google.protobuf.Empty\"\x9d\x01\xda\x41\x04name\x82\xd3\xe4\x93\x02\x8f\x01*0/v1/{name=organizations/*/notificationConfigs/*}Z,**/v1/{name=folders/*/notificationConfigs/*}Z-*+/v1/{name=projects/*/notificationConfigs/*}\x12\x83\x03\n)DeleteSecurityHealthAnalyticsCustomModule\x12P.google.cloud.securitycenter.v1.DeleteSecurityHealthAnalyticsCustomModuleRequest\x1a\x16.google.protobuf.Empty\"\xeb\x01\xda\x41\x04name\x82\xd3\xe4\x93\x02\xdd\x01*J/v1/{name=organizations/*/securityHealthAnalyticsSettings/customModules/*}ZF*D/v1/{name=folders/*/securityHealthAnalyticsSettings/customModules/*}ZG*E/v1/{name=projects/*/securityHealthAnalyticsSettings/customModules/*}\x12\xaa\x01\n\rGetSimulation\x12\x34.google.cloud.securitycenter.v1.GetSimulationRequest\x1a*.google.cloud.securitycenter.v1.Simulation\"7\xda\x41\x04name\x82\xd3\xe4\x93\x02*\x12(/v1/{name=organizations/*/simulations/*}\x12\xc8\x01\n\x11GetValuedResource\x12\x38.google.cloud.securitycenter.v1.GetValuedResourceRequest\x1a..google.cloud.securitycenter.v1.ValuedResource\"I\xda\x41\x04name\x82\xd3\xe4\x93\x02<\x12:/v1/{name=organizations/*/simulations/*/valuedResources/*}\x12\x91\x02\n\x11GetBigQueryExport\x12\x38.google.cloud.securitycenter.v1.GetBigQueryExportRequest\x1a..google.cloud.securitycenter.v1.BigQueryExport\"\x91\x01\xda\x41\x04name\x82\xd3\xe4\x93\x02\x83\x01\x12,/v1/{name=organizations/*/bigQueryExports/*}Z(\x12&/v1/{name=folders/*/bigQueryExports/*}Z)\x12\'/v1/{name=projects/*/bigQueryExports/*}\x12\x96\x01\n\x0cGetIamPolicy\x12\".google.iam.v1.GetIamPolicyRequest\x1a\x15.google.iam.v1.Policy\"K\xda\x41\x08resource\x82\xd3\xe4\x93\x02:\"5/v1/{resource=organizations/*/sources/*}:getIamPolicy:\x01*\x12\x96\x03\n\rGetMuteConfig\x12\x34.google.cloud.securitycenter.v1.GetMuteConfigRequest\x1a*.google.cloud.securitycenter.v1.MuteConfig\"\xa2\x02\xda\x41\x04name\x82\xd3\xe4\x93\x02\x94\x02\x12(/v1/{name=organizations/*/muteConfigs/*}Z$\x12\"/v1/{name=folders/*/muteConfigs/*}Z%\x12#/v1/{name=projects/*/muteConfigs/*}Z6\x12\x34/v1/{name=organizations/*/locations/*/muteConfigs/*}Z0\x12./v1/{name=folders/*/locations/*/muteConfigs/*}Z1\x12//v1/{name=projects/*/locations/*/muteConfigs/*}\x12\xa9\x02\n\x15GetNotificationConfig\x12<.google.cloud.securitycenter.v1.GetNotificationConfigRequest\x1a\x32.google.cloud.securitycenter.v1.NotificationConfig\"\x9d\x01\xda\x41\x04name\x82\xd3\xe4\x93\x02\x8f\x01\x12\x30/v1/{name=organizations/*/notificationConfigs/*}Z,\x12*/v1/{name=folders/*/notificationConfigs/*}Z-\x12+/v1/{name=projects/*/notificationConfigs/*}\x12\xcf\x01\n\x17GetOrganizationSettings\x12>.google.cloud.securitycenter.v1.GetOrganizationSettingsRequest\x1a\x34.google.cloud.securitycenter.v1.OrganizationSettings\">\xda\x41\x04name\x82\xd3\xe4\x93\x02\x31\x12//v1/{name=organizations/*/organizationSettings}\x12\xe0\x03\n/GetEffectiveSecurityHealthAnalyticsCustomModule\x12V.google.cloud.securitycenter.v1.GetEffectiveSecurityHealthAnalyticsCustomModuleRequest\x1aL.google.cloud.securitycenter.v1.EffectiveSecurityHealthAnalyticsCustomModule\"\x86\x02\xda\x41\x04name\x82\xd3\xe4\x93\x02\xf8\x01\x12S/v1/{name=organizations/*/securityHealthAnalyticsSettings/effectiveCustomModules/*}ZO\x12M/v1/{name=folders/*/securityHealthAnalyticsSettings/effectiveCustomModules/*}ZP\x12N/v1/{name=projects/*/securityHealthAnalyticsSettings/effectiveCustomModules/*}\x12\xaa\x03\n&GetSecurityHealthAnalyticsCustomModule\x12M.google.cloud.securitycenter.v1.GetSecurityHealthAnalyticsCustomModuleRequest\x1a\x43.google.cloud.securitycenter.v1.SecurityHealthAnalyticsCustomModule\"\xeb\x01\xda\x41\x04name\x82\xd3\xe4\x93\x02\xdd\x01\x12J/v1/{name=organizations/*/securityHealthAnalyticsSettings/customModules/*}ZF\x12\x44/v1/{name=folders/*/securityHealthAnalyticsSettings/customModules/*}ZG\x12\x45/v1/{name=projects/*/securityHealthAnalyticsSettings/customModules/*}\x12\x9a\x01\n\tGetSource\x12\x30.google.cloud.securitycenter.v1.GetSourceRequest\x1a&.google.cloud.securitycenter.v1.Source\"3\xda\x41\x04name\x82\xd3\xe4\x93\x02&\x12$/v1/{name=organizations/*/sources/*}\x12\x86\x02\n\x0bGroupAssets\x12\x32.google.cloud.securitycenter.v1.GroupAssetsRequest\x1a\x33.google.cloud.securitycenter.v1.GroupAssetsResponse\"\x8d\x01\x88\x02\x01\x82\xd3\xe4\x93\x02\x83\x01\")/v1/{parent=organizations/*}/assets:group:\x01*Z(\"#/v1/{parent=folders/*}/assets:group:\x01*Z)\"$/v1/{parent=projects/*}/assets:group:\x01*\x12\xbf\x02\n\rGroupFindings\x12\x34.google.cloud.securitycenter.v1.GroupFindingsRequest\x1a\x35.google.cloud.securitycenter.v1.GroupFindingsResponse\"\xc0\x01\xda\x41\x0fparent,group_by\x82\xd3\xe4\x93\x02\xa7\x01\"5/v1/{parent=organizations/*/sources/*}/findings:group:\x01*Z4\"//v1/{parent=folders/*/sources/*}/findings:group:\x01*Z5\"0/v1/{parent=projects/*/sources/*}/findings:group:\x01*\x12\xe6\x01\n\nListAssets\x12\x31.google.cloud.securitycenter.v1.ListAssetsRequest\x1a\x32.google.cloud.securitycenter.v1.ListAssetsResponse\"q\x88\x02\x01\x82\xd3\xe4\x93\x02h\x12#/v1/{parent=organizations/*}/assetsZ\x1f\x12\x1d/v1/{parent=folders/*}/assetsZ \x12\x1e/v1/{parent=projects/*}/assets\x12\x88\x04\n2ListDescendantSecurityHealthAnalyticsCustomModules\x12Y.google.cloud.securitycenter.v1.ListDescendantSecurityHealthAnalyticsCustomModulesRequest\x1aZ.google.cloud.securitycenter.v1.ListDescendantSecurityHealthAnalyticsCustomModulesResponse\"\x9a\x02\xda\x41\x06parent\x82\xd3\xe4\x93\x02\x8a\x02\x12Y/v1/{parent=organizations/*/securityHealthAnalyticsSettings}/customModules:listDescendantZU\x12S/v1/{parent=folders/*/securityHealthAnalyticsSettings}/customModules:listDescendantZV\x12T/v1/{parent=projects/*/securityHealthAnalyticsSettings}/customModules:listDescendant\x12\x8f\x02\n\x0cListFindings\x12\x33.google.cloud.securitycenter.v1.ListFindingsRequest\x1a\x34.google.cloud.securitycenter.v1.ListFindingsResponse\"\x93\x01\x82\xd3\xe4\x93\x02\x8c\x01\x12//v1/{parent=organizations/*/sources/*}/findingsZ+\x12)/v1/{parent=folders/*/sources/*}/findingsZ,\x12*/v1/{parent=projects/*/sources/*}/findings\x12\xa9\x03\n\x0fListMuteConfigs\x12\x36.google.cloud.securitycenter.v1.ListMuteConfigsRequest\x1a\x37.google.cloud.securitycenter.v1.ListMuteConfigsResponse\"\xa4\x02\xda\x41\x06parent\x82\xd3\xe4\x93\x02\x94\x02\x12(/v1/{parent=organizations/*}/muteConfigsZ$\x12\"/v1/{parent=folders/*}/muteConfigsZ%\x12#/v1/{parent=projects/*}/muteConfigsZ6\x12\x34/v1/{parent=organizations/*/locations/*/muteConfigs}Z0\x12./v1/{parent=folders/*/locations/*/muteConfigs}Z1\x12//v1/{parent=projects/*/locations/*/muteConfigs}\x12\xbc\x02\n\x17ListNotificationConfigs\x12>.google.cloud.securitycenter.v1.ListNotificationConfigsRequest\x1a?.google.cloud.securitycenter.v1.ListNotificationConfigsResponse\"\x9f\x01\xda\x41\x06parent\x82\xd3\xe4\x93\x02\x8f\x01\x12\x30/v1/{parent=organizations/*}/notificationConfigsZ,\x12*/v1/{parent=folders/*}/notificationConfigsZ-\x12+/v1/{parent=projects/*}/notificationConfigs\x12\xf3\x03\n1ListEffectiveSecurityHealthAnalyticsCustomModules\x12X.google.cloud.securitycenter.v1.ListEffectiveSecurityHealthAnalyticsCustomModulesRequest\x1aY.google.cloud.securitycenter.v1.ListEffectiveSecurityHealthAnalyticsCustomModulesResponse\"\x88\x02\xda\x41\x06parent\x82\xd3\xe4\x93\x02\xf8\x01\x12S/v1/{parent=organizations/*/securityHealthAnalyticsSettings}/effectiveCustomModulesZO\x12M/v1/{parent=folders/*/securityHealthAnalyticsSettings}/effectiveCustomModulesZP\x12N/v1/{parent=projects/*/securityHealthAnalyticsSettings}/effectiveCustomModules\x12\xbd\x03\n(ListSecurityHealthAnalyticsCustomModules\x12O.google.cloud.securitycenter.v1.ListSecurityHealthAnalyticsCustomModulesRequest\x1aP.google.cloud.securitycenter.v1.ListSecurityHealthAnalyticsCustomModulesResponse\"\xed\x01\xda\x41\x06parent\x82\xd3\xe4\x93\x02\xdd\x01\x12J/v1/{parent=organizations/*/securityHealthAnalyticsSettings}/customModulesZF\x12\x44/v1/{parent=folders/*/securityHealthAnalyticsSettings}/customModulesZG\x12\x45/v1/{parent=projects/*/securityHealthAnalyticsSettings}/customModules\x12\xf2\x01\n\x0bListSources\x12\x32.google.cloud.securitycenter.v1.ListSourcesRequest\x1a\x33.google.cloud.securitycenter.v1.ListSourcesResponse\"z\xda\x41\x06parent\x82\xd3\xe4\x93\x02k\x12$/v1/{parent=organizations/*}/sourcesZ \x12\x1e/v1/{parent=folders/*}/sourcesZ!\x12\x1f/v1/{parent=projects/*}/sources\x12\x8a\x02\n\x11RunAssetDiscovery\x12\x38.google.cloud.securitycenter.v1.RunAssetDiscoveryRequest\x1a\x1d.google.longrunning.Operation\"\x9b\x01\x88\x02\x01\xca\x41Q\n8google.cloud.securitycenter.v1.RunAssetDiscoveryResponse\x12\x15google.protobuf.Empty\xda\x41\x06parent\x82\xd3\xe4\x93\x02\x35\"0/v1/{parent=organizations/*}/assets:runDiscovery:\x01*\x12\xc4\x02\n\x0fSetFindingState\x12\x36.google.cloud.securitycenter.v1.SetFindingStateRequest\x1a\'.google.cloud.securitycenter.v1.Finding\"\xcf\x01\xda\x41\x15name,state,start_time\x82\xd3\xe4\x93\x02\xb0\x01\"8/v1/{name=organizations/*/sources/*/findings/*}:setState:\x01*Z7\"2/v1/{name=folders/*/sources/*/findings/*}:setState:\x01*Z8\"3/v1/{name=projects/*/sources/*/findings/*}:setState:\x01*\x12\xa5\x02\n\x07SetMute\x12..google.cloud.securitycenter.v1.SetMuteRequest\x1a\'.google.cloud.securitycenter.v1.Finding\"\xc0\x01\xda\x41\tname,mute\x82\xd3\xe4\x93\x02\xad\x01\"7/v1/{name=organizations/*/sources/*/findings/*}:setMute:\x01*Z6\"1/v1/{name=folders/*/sources/*/findings/*}:setMute:\x01*Z7\"2/v1/{name=projects/*/sources/*/findings/*}:setMute:\x01*\x12\x9d\x01\n\x0cSetIamPolicy\x12\".google.iam.v1.SetIamPolicyRequest\x1a\x15.google.iam.v1.Policy\"R\xda\x41\x0fresource,policy\x82\xd3\xe4\x93\x02:\"5/v1/{resource=organizations/*/sources/*}:setIamPolicy:\x01*\x12\xc8\x01\n\x12TestIamPermissions\x12(.google.iam.v1.TestIamPermissionsRequest\x1a).google.iam.v1.TestIamPermissionsResponse\"]\xda\x41\x14resource,permissions\x82\xd3\xe4\x93\x02@\";/v1/{resource=organizations/*/sources/*}:testIamPermissions:\x01*\x12\x81\x04\n+SimulateSecurityHealthAnalyticsCustomModule\x12R.google.cloud.securitycenter.v1.SimulateSecurityHealthAnalyticsCustomModuleRequest\x1aS.google.cloud.securitycenter.v1.SimulateSecurityHealthAnalyticsCustomModuleResponse\"\xa8\x02\xda\x41\x1dparent,custom_config,resource\x82\xd3\xe4\x93\x02\x81\x02\"S/v1/{parent=organizations/*/securityHealthAnalyticsSettings}/customModules:simulate:\x01*ZR\"M/v1/{parent=folders/*/securityHealthAnalyticsSettings}/customModules:simulate:\x01*ZS\"N/v1/{parent=projects/*/securityHealthAnalyticsSettings}/customModules:simulate:\x01*\x12\xd0\x03\n\x14UpdateExternalSystem\x12;.google.cloud.securitycenter.v1.UpdateExternalSystemRequest\x1a..google.cloud.securitycenter.v1.ExternalSystem\"\xca\x02\xda\x41\x1b\x65xternal_system,update_mask\x82\xd3\xe4\x93\x02\xa5\x02\x32Q/v1/{external_system.name=organizations/*/sources/*/findings/*/externalSystems/*}:\x0f\x65xternal_systemZ^2K/v1/{external_system.name=folders/*/sources/*/findings/*/externalSystems/*}:\x0f\x65xternal_systemZ_2L/v1/{external_system.name=projects/*/sources/*/findings/*/externalSystems/*}:\x0f\x65xternal_system\x12\xc1\x02\n\rUpdateFinding\x12\x34.google.cloud.securitycenter.v1.UpdateFindingRequest\x1a\'.google.cloud.securitycenter.v1.Finding\"\xd0\x01\xda\x41\x07\x66inding\x82\xd3\xe4\x93\x02\xbf\x01\x32\x37/v1/{finding.name=organizations/*/sources/*/findings/*}:\x07\x66indingZ<21/v1/{finding.name=folders/*/sources/*/findings/*}:\x07\x66indingZ=22/v1/{finding.name=projects/*/sources/*/findings/*}:\x07\x66inding\x12\xc5\x04\n\x10UpdateMuteConfig\x12\x37.google.cloud.securitycenter.v1.UpdateMuteConfigRequest\x1a*.google.cloud.securitycenter.v1.MuteConfig\"\xcb\x03\xda\x41\x17mute_config,update_mask\x82\xd3\xe4\x93\x02\xaa\x03\x32\x34/v1/{mute_config.name=organizations/*/muteConfigs/*}:\x0bmute_configZ=2./v1/{mute_config.name=folders/*/muteConfigs/*}:\x0bmute_configZ>2//v1/{mute_config.name=projects/*/muteConfigs/*}:\x0bmute_configZO2@/v1/{mute_config.name=organizations/*/locations/*/muteConfigs/*}:\x0bmute_configZI2:/v1/{mute_config.name=folders/*/locations/*/muteConfigs/*}:\x0bmute_configZJ2;/v1/{mute_config.name=projects/*/locations/*/muteConfigs/*}:\x0bmute_config\x12\xdb\x03\n\x18UpdateNotificationConfig\x12?.google.cloud.securitycenter.v1.UpdateNotificationConfigRequest\x1a\x32.google.cloud.securitycenter.v1.NotificationConfig\"\xc9\x02\xda\x41\x13notification_config\xda\x41\x1fnotification_config,update_mask\x82\xd3\xe4\x93\x02\x8a\x02\x32\x44/v1/{notification_config.name=organizations/*/notificationConfigs/*}:\x13notification_configZU2>/v1/{notification_config.name=folders/*/notificationConfigs/*}:\x13notification_configZV2?/v1/{notification_config.name=projects/*/notificationConfigs/*}:\x13notification_config\x12\x93\x02\n\x1aUpdateOrganizationSettings\x12\x41.google.cloud.securitycenter.v1.UpdateOrganizationSettingsRequest\x1a\x34.google.cloud.securitycenter.v1.OrganizationSettings\"|\xda\x41\x15organization_settings\x82\xd3\xe4\x93\x02^2E/v1/{organization_settings.name=organizations/*/organizationSettings}:\x15organization_settings\x12\xd4\x05\n)UpdateSecurityHealthAnalyticsCustomModule\x12P.google.cloud.securitycenter.v1.UpdateSecurityHealthAnalyticsCustomModuleRequest\x1a\x43.google.cloud.securitycenter.v1.SecurityHealthAnalyticsCustomModule\"\x8f\x04\xda\x41\x33security_health_analytics_custom_module,update_mask\x82\xd3\xe4\x93\x02\xd2\x03\x32r/v1/{security_health_analytics_custom_module.name=organizations/*/securityHealthAnalyticsSettings/customModules/*}:\'security_health_analytics_custom_moduleZ\x97\x01\x32l/v1/{security_health_analytics_custom_module.name=folders/*/securityHealthAnalyticsSettings/customModules/*}:\'security_health_analytics_custom_moduleZ\x98\x01\x32m/v1/{security_health_analytics_custom_module.name=projects/*/securityHealthAnalyticsSettings/customModules/*}:\'security_health_analytics_custom_module\x12\xb1\x01\n\x0cUpdateSource\x12\x33.google.cloud.securitycenter.v1.UpdateSourceRequest\x1a&.google.cloud.securitycenter.v1.Source\"D\xda\x41\x06source\x82\xd3\xe4\x93\x02\x35\x32+/v1/{source.name=organizations/*/sources/*}:\x06source\x12\x9f\x05\n\x13UpdateSecurityMarks\x12:.google.cloud.securitycenter.v1.UpdateSecurityMarksRequest\x1a-.google.cloud.securitycenter.v1.SecurityMarks\"\x9c\x04\xda\x41\x0esecurity_marks\x82\xd3\xe4\x93\x02\x84\x04\x32@/v1/{security_marks.name=organizations/*/assets/*/securityMarks}:\x0esecurity_marksZL2:/v1/{security_marks.name=folders/*/assets/*/securityMarks}:\x0esecurity_marksZM2;/v1/{security_marks.name=projects/*/assets/*/securityMarks}:\x0esecurity_marksZ^2L/v1/{security_marks.name=organizations/*/sources/*/findings/*/securityMarks}:\x0esecurity_marksZX2F/v1/{security_marks.name=folders/*/sources/*/findings/*/securityMarks}:\x0esecurity_marksZY2G/v1/{security_marks.name=projects/*/sources/*/findings/*/securityMarks}:\x0esecurity_marks\x12\xf4\x02\n\x14\x43reateBigQueryExport\x12;.google.cloud.securitycenter.v1.CreateBigQueryExportRequest\x1a..google.cloud.securitycenter.v1.BigQueryExport\"\xee\x01\xda\x41+parent,big_query_export,big_query_export_id\x82\xd3\xe4\x93\x02\xb9\x01\",/v1/{parent=organizations/*}/bigQueryExports:\x10\x62ig_query_exportZ:\"&/v1/{parent=folders/*}/bigQueryExports:\x10\x62ig_query_exportZ;\"\'/v1/{parent=projects/*}/bigQueryExports:\x10\x62ig_query_export\x12\xff\x01\n\x14\x44\x65leteBigQueryExport\x12;.google.cloud.securitycenter.v1.DeleteBigQueryExportRequest\x1a\x16.google.protobuf.Empty\"\x91\x01\xda\x41\x04name\x82\xd3\xe4\x93\x02\x83\x01*,/v1/{name=organizations/*/bigQueryExports/*}Z(*&/v1/{name=folders/*/bigQueryExports/*}Z)*\'/v1/{name=projects/*/bigQueryExports/*}\x12\x98\x03\n\x14UpdateBigQueryExport\x12;.google.cloud.securitycenter.v1.UpdateBigQueryExportRequest\x1a..google.cloud.securitycenter.v1.BigQueryExport\"\x92\x02\xda\x41\x1c\x62ig_query_export,update_mask\x82\xd3\xe4\x93\x02\xec\x01\x32=/v1/{big_query_export.name=organizations/*/bigQueryExports/*}:\x10\x62ig_query_exportZK27/v1/{big_query_export.name=folders/*/bigQueryExports/*}:\x10\x62ig_query_exportZL28/v1/{big_query_export.name=projects/*/bigQueryExports/*}:\x10\x62ig_query_export\x12\xa4\x02\n\x13ListBigQueryExports\x12:.google.cloud.securitycenter.v1.ListBigQueryExportsRequest\x1a;.google.cloud.securitycenter.v1.ListBigQueryExportsResponse\"\x93\x01\xda\x41\x06parent\x82\xd3\xe4\x93\x02\x83\x01\x12,/v1/{parent=organizations/*}/bigQueryExportsZ(\x12&/v1/{parent=folders/*}/bigQueryExportsZ)\x12\'/v1/{parent=projects/*}/bigQueryExports\x12\xb7\x04\n&CreateEventThreatDetectionCustomModule\x12M.google.cloud.securitycenter.v1.CreateEventThreatDetectionCustomModuleRequest\x1a@.google.cloud.securitycenter.v1.EventThreatDetectionCustomModule\"\xfb\x02\xda\x41+parent,event_threat_detection_custom_module\x82\xd3\xe4\x93\x02\xc6\x02\"G/v1/{parent=organizations/*/eventThreatDetectionSettings}/customModules:$event_threat_detection_custom_moduleZi\"A/v1/{parent=folders/*/eventThreatDetectionSettings}/customModules:$event_threat_detection_custom_moduleZj\"B/v1/{parent=projects/*/eventThreatDetectionSettings}/customModules:$event_threat_detection_custom_module\x12\xf4\x02\n&DeleteEventThreatDetectionCustomModule\x12M.google.cloud.securitycenter.v1.DeleteEventThreatDetectionCustomModuleRequest\x1a\x16.google.protobuf.Empty\"\xe2\x01\xda\x41\x04name\x82\xd3\xe4\x93\x02\xd4\x01*G/v1/{name=organizations/*/eventThreatDetectionSettings/customModules/*}ZC*A/v1/{name=folders/*/eventThreatDetectionSettings/customModules/*}ZD*B/v1/{name=projects/*/eventThreatDetectionSettings/customModules/*}\x12\x98\x03\n#GetEventThreatDetectionCustomModule\x12J.google.cloud.securitycenter.v1.GetEventThreatDetectionCustomModuleRequest\x1a@.google.cloud.securitycenter.v1.EventThreatDetectionCustomModule\"\xe2\x01\xda\x41\x04name\x82\xd3\xe4\x93\x02\xd4\x01\x12G/v1/{name=organizations/*/eventThreatDetectionSettings/customModules/*}ZC\x12\x41/v1/{name=folders/*/eventThreatDetectionSettings/customModules/*}ZD\x12\x42/v1/{name=projects/*/eventThreatDetectionSettings/customModules/*}\x12\xf6\x03\n/ListDescendantEventThreatDetectionCustomModules\x12V.google.cloud.securitycenter.v1.ListDescendantEventThreatDetectionCustomModulesRequest\x1aW.google.cloud.securitycenter.v1.ListDescendantEventThreatDetectionCustomModulesResponse\"\x91\x02\xda\x41\x06parent\x82\xd3\xe4\x93\x02\x81\x02\x12V/v1/{parent=organizations/*/eventThreatDetectionSettings}/customModules:listDescendantZR\x12P/v1/{parent=folders/*/eventThreatDetectionSettings}/customModules:listDescendantZS\x12Q/v1/{parent=projects/*/eventThreatDetectionSettings}/customModules:listDescendant\x12\xab\x03\n%ListEventThreatDetectionCustomModules\x12L.google.cloud.securitycenter.v1.ListEventThreatDetectionCustomModulesRequest\x1aM.google.cloud.securitycenter.v1.ListEventThreatDetectionCustomModulesResponse\"\xe4\x01\xda\x41\x06parent\x82\xd3\xe4\x93\x02\xd4\x01\x12G/v1/{parent=organizations/*/eventThreatDetectionSettings}/customModulesZC\x12\x41/v1/{parent=folders/*/eventThreatDetectionSettings}/customModulesZD\x12\x42/v1/{parent=projects/*/eventThreatDetectionSettings}/customModules\x12\xad\x05\n&UpdateEventThreatDetectionCustomModule\x12M.google.cloud.securitycenter.v1.UpdateEventThreatDetectionCustomModuleRequest\x1a@.google.cloud.securitycenter.v1.EventThreatDetectionCustomModule\"\xf1\x03\xda\x41\x30\x65vent_threat_detection_custom_module,update_mask\x82\xd3\xe4\x93\x02\xb7\x03\x32l/v1/{event_threat_detection_custom_module.name=organizations/*/eventThreatDetectionSettings/customModules/*}:$event_threat_detection_custom_moduleZ\x8e\x01\x32\x66/v1/{event_threat_detection_custom_module.name=folders/*/eventThreatDetectionSettings/customModules/*}:$event_threat_detection_custom_moduleZ\x8f\x01\x32g/v1/{event_threat_detection_custom_module.name=projects/*/eventThreatDetectionSettings/customModules/*}:$event_threat_detection_custom_module\x12\xc9\x03\n(ValidateEventThreatDetectionCustomModule\x12O.google.cloud.securitycenter.v1.ValidateEventThreatDetectionCustomModuleRequest\x1aP.google.cloud.securitycenter.v1.ValidateEventThreatDetectionCustomModuleResponse\"\xf9\x01\x82\xd3\xe4\x93\x02\xf2\x01\"N/v1/{parent=organizations/*/eventThreatDetectionSettings}:validateCustomModule:\x01*ZM\"H/v1/{parent=folders/*/eventThreatDetectionSettings}:validateCustomModule:\x01*ZN\"I/v1/{parent=projects/*/eventThreatDetectionSettings}:validateCustomModule:\x01*\x12\xce\x03\n,GetEffectiveEventThreatDetectionCustomModule\x12S.google.cloud.securitycenter.v1.GetEffectiveEventThreatDetectionCustomModuleRequest\x1aI.google.cloud.securitycenter.v1.EffectiveEventThreatDetectionCustomModule\"\xfd\x01\xda\x41\x04name\x82\xd3\xe4\x93\x02\xef\x01\x12P/v1/{name=organizations/*/eventThreatDetectionSettings/effectiveCustomModules/*}ZL\x12J/v1/{name=folders/*/eventThreatDetectionSettings/effectiveCustomModules/*}ZM\x12K/v1/{name=projects/*/eventThreatDetectionSettings/effectiveCustomModules/*}\x12\xe1\x03\n.ListEffectiveEventThreatDetectionCustomModules\x12U.google.cloud.securitycenter.v1.ListEffectiveEventThreatDetectionCustomModulesRequest\x1aV.google.cloud.securitycenter.v1.ListEffectiveEventThreatDetectionCustomModulesResponse\"\xff\x01\xda\x41\x06parent\x82\xd3\xe4\x93\x02\xef\x01\x12P/v1/{parent=organizations/*/eventThreatDetectionSettings}/effectiveCustomModulesZL\x12J/v1/{parent=folders/*/eventThreatDetectionSettings}/effectiveCustomModulesZM\x12K/v1/{parent=projects/*/eventThreatDetectionSettings}/effectiveCustomModules\x12\x8e\x02\n\x1f\x42\x61tchCreateResourceValueConfigs\x12\x46.google.cloud.securitycenter.v1.BatchCreateResourceValueConfigsRequest\x1aG.google.cloud.securitycenter.v1.BatchCreateResourceValueConfigsResponse\"Z\xda\x41\x0fparent,requests\x82\xd3\xe4\x93\x02\x42\"=/v1/{parent=organizations/*}/resourceValueConfigs:batchCreate:\x01*\x12\xb7\x01\n\x19\x44\x65leteResourceValueConfig\x12@.google.cloud.securitycenter.v1.DeleteResourceValueConfigRequest\x1a\x16.google.protobuf.Empty\"@\xda\x41\x04name\x82\xd3\xe4\x93\x02\x33*1/v1/{name=organizations/*/resourceValueConfigs/*}\x12\xce\x01\n\x16GetResourceValueConfig\x12=.google.cloud.securitycenter.v1.GetResourceValueConfigRequest\x1a\x33.google.cloud.securitycenter.v1.ResourceValueConfig\"@\xda\x41\x04name\x82\xd3\xe4\x93\x02\x33\x12\x31/v1/{name=organizations/*/resourceValueConfigs/*}\x12\xe1\x01\n\x18ListResourceValueConfigs\x12?.google.cloud.securitycenter.v1.ListResourceValueConfigsRequest\x1a@.google.cloud.securitycenter.v1.ListResourceValueConfigsResponse\"B\xda\x41\x06parent\x82\xd3\xe4\x93\x02\x33\x12\x31/v1/{parent=organizations/*}/resourceValueConfigs\x12\x9f\x02\n\x19UpdateResourceValueConfig\x12@.google.cloud.securitycenter.v1.UpdateResourceValueConfigRequest\x1a\x33.google.cloud.securitycenter.v1.ResourceValueConfig\"\x8a\x01\xda\x41!resource_value_config,update_mask\x82\xd3\xe4\x93\x02`2G/v1/{resource_value_config.name=organizations/*/resourceValueConfigs/*}:\x15resource_value_config\x12\xb3\x02\n\x13ListValuedResources\x12:.google.cloud.securitycenter.v1.ListValuedResourcesRequest\x1a;.google.cloud.securitycenter.v1.ListValuedResourcesResponse\"\xa2\x01\xda\x41\x06parent\x82\xd3\xe4\x93\x02\x92\x01\x12:/v1/{parent=organizations/*/simulations/*}/valuedResourcesZT\x12R/v1/{parent=organizations/*/simulations/*/attackExposureResults/*}/valuedResources\x12\xeb\x02\n\x0fListAttackPaths\x12\x36.google.cloud.securitycenter.v1.ListAttackPathsRequest\x1a\x37.google.cloud.securitycenter.v1.ListAttackPathsResponse\"\xe6\x01\xda\x41\x06parent\x82\xd3\xe4\x93\x02\xd6\x01\x12\x36/v1/{parent=organizations/*/simulations/*}/attackPathsZJ\x12H/v1/{parent=organizations/*/simulations/*/valuedResources/*}/attackPathsZP\x12N/v1/{parent=organizations/*/simulations/*/attackExposureResults/*}/attackPaths\x1aQ\xca\x41\x1dsecuritycenter.googleapis.com\xd2\x41.https://www.googleapis.com/auth/cloud-platformB\xe5\x05\n\"com.google.cloud.securitycenter.v1P\x01ZJcloud.google.com/go/securitycenter/apiv1/securitycenterpb;securitycenterpb\xaa\x02\x1eGoogle.Cloud.SecurityCenter.V1\xca\x02\x1eGoogle\\Cloud\\SecurityCenter\\V1\xea\x02!Google::Cloud::SecurityCenter::V1\xea\x41g\n2securitycenter.googleapis.com/OrganizationLocation\x12\x31organizations/{organization}/locations/{location}\xea\x41U\n,securitycenter.googleapis.com/FolderLocation\x12%folders/{folder}/locations/{location}\xea\x41m\n4securitycenter.googleapis.com/OrganizationSimulation\x12\x35organizations/{organization}/simulations/{simulation}\xea\x41\xd7\x01\n:securitycenter.googleapis.com/EventThreatDetectionSettings\x12\x39organizations/{organization}/eventThreatDetectionSettings\x12-folders/{folder}/eventThreatDetectionSettings\x12/projects/{project}/eventThreatDetectionSettingsb\x06proto3" - -pool = ::Google::Protobuf::DescriptorPool.generated_pool -pool.add_serialized_file(descriptor_data) - -module Google - module Cloud - module SecurityCenter - module V1 - BulkMuteFindingsRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.securitycenter.v1.BulkMuteFindingsRequest").msgclass - BulkMuteFindingsRequest::MuteState = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.securitycenter.v1.BulkMuteFindingsRequest.MuteState").enummodule - BulkMuteFindingsResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.securitycenter.v1.BulkMuteFindingsResponse").msgclass - CreateFindingRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.securitycenter.v1.CreateFindingRequest").msgclass - CreateMuteConfigRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.securitycenter.v1.CreateMuteConfigRequest").msgclass - CreateResourceValueConfigRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.securitycenter.v1.CreateResourceValueConfigRequest").msgclass - BatchCreateResourceValueConfigsRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.securitycenter.v1.BatchCreateResourceValueConfigsRequest").msgclass - BatchCreateResourceValueConfigsResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.securitycenter.v1.BatchCreateResourceValueConfigsResponse").msgclass - DeleteResourceValueConfigRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.securitycenter.v1.DeleteResourceValueConfigRequest").msgclass - GetResourceValueConfigRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.securitycenter.v1.GetResourceValueConfigRequest").msgclass - ListResourceValueConfigsRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.securitycenter.v1.ListResourceValueConfigsRequest").msgclass - ListResourceValueConfigsResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.securitycenter.v1.ListResourceValueConfigsResponse").msgclass - UpdateResourceValueConfigRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.securitycenter.v1.UpdateResourceValueConfigRequest").msgclass - CreateNotificationConfigRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.securitycenter.v1.CreateNotificationConfigRequest").msgclass - CreateSecurityHealthAnalyticsCustomModuleRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.securitycenter.v1.CreateSecurityHealthAnalyticsCustomModuleRequest").msgclass - CreateSourceRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.securitycenter.v1.CreateSourceRequest").msgclass - DeleteMuteConfigRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.securitycenter.v1.DeleteMuteConfigRequest").msgclass - DeleteNotificationConfigRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.securitycenter.v1.DeleteNotificationConfigRequest").msgclass - DeleteSecurityHealthAnalyticsCustomModuleRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.securitycenter.v1.DeleteSecurityHealthAnalyticsCustomModuleRequest").msgclass - GetBigQueryExportRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.securitycenter.v1.GetBigQueryExportRequest").msgclass - GetMuteConfigRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.securitycenter.v1.GetMuteConfigRequest").msgclass - GetNotificationConfigRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.securitycenter.v1.GetNotificationConfigRequest").msgclass - GetOrganizationSettingsRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.securitycenter.v1.GetOrganizationSettingsRequest").msgclass - GetEffectiveSecurityHealthAnalyticsCustomModuleRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.securitycenter.v1.GetEffectiveSecurityHealthAnalyticsCustomModuleRequest").msgclass - GetSecurityHealthAnalyticsCustomModuleRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.securitycenter.v1.GetSecurityHealthAnalyticsCustomModuleRequest").msgclass - GetSourceRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.securitycenter.v1.GetSourceRequest").msgclass - GroupAssetsRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.securitycenter.v1.GroupAssetsRequest").msgclass - GroupAssetsResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.securitycenter.v1.GroupAssetsResponse").msgclass - GroupFindingsRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.securitycenter.v1.GroupFindingsRequest").msgclass - GroupFindingsResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.securitycenter.v1.GroupFindingsResponse").msgclass - GroupResult = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.securitycenter.v1.GroupResult").msgclass - ListDescendantSecurityHealthAnalyticsCustomModulesRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.securitycenter.v1.ListDescendantSecurityHealthAnalyticsCustomModulesRequest").msgclass - ListDescendantSecurityHealthAnalyticsCustomModulesResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.securitycenter.v1.ListDescendantSecurityHealthAnalyticsCustomModulesResponse").msgclass - ListValuedResourcesRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.securitycenter.v1.ListValuedResourcesRequest").msgclass - ListValuedResourcesResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.securitycenter.v1.ListValuedResourcesResponse").msgclass - ListAttackPathsRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.securitycenter.v1.ListAttackPathsRequest").msgclass - ListAttackPathsResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.securitycenter.v1.ListAttackPathsResponse").msgclass - GetSimulationRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.securitycenter.v1.GetSimulationRequest").msgclass - GetValuedResourceRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.securitycenter.v1.GetValuedResourceRequest").msgclass - ListMuteConfigsRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.securitycenter.v1.ListMuteConfigsRequest").msgclass - ListMuteConfigsResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.securitycenter.v1.ListMuteConfigsResponse").msgclass - ListNotificationConfigsRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.securitycenter.v1.ListNotificationConfigsRequest").msgclass - ListNotificationConfigsResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.securitycenter.v1.ListNotificationConfigsResponse").msgclass - ListEffectiveSecurityHealthAnalyticsCustomModulesRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.securitycenter.v1.ListEffectiveSecurityHealthAnalyticsCustomModulesRequest").msgclass - ListEffectiveSecurityHealthAnalyticsCustomModulesResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.securitycenter.v1.ListEffectiveSecurityHealthAnalyticsCustomModulesResponse").msgclass - ListSecurityHealthAnalyticsCustomModulesRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.securitycenter.v1.ListSecurityHealthAnalyticsCustomModulesRequest").msgclass - ListSecurityHealthAnalyticsCustomModulesResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.securitycenter.v1.ListSecurityHealthAnalyticsCustomModulesResponse").msgclass - ListSourcesRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.securitycenter.v1.ListSourcesRequest").msgclass - ListSourcesResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.securitycenter.v1.ListSourcesResponse").msgclass - ListAssetsRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.securitycenter.v1.ListAssetsRequest").msgclass - ListAssetsResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.securitycenter.v1.ListAssetsResponse").msgclass - ListAssetsResponse::ListAssetsResult = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.securitycenter.v1.ListAssetsResponse.ListAssetsResult").msgclass - ListAssetsResponse::ListAssetsResult::StateChange = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.securitycenter.v1.ListAssetsResponse.ListAssetsResult.StateChange").enummodule - ListFindingsRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.securitycenter.v1.ListFindingsRequest").msgclass - ListFindingsResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.securitycenter.v1.ListFindingsResponse").msgclass - ListFindingsResponse::ListFindingsResult = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.securitycenter.v1.ListFindingsResponse.ListFindingsResult").msgclass - ListFindingsResponse::ListFindingsResult::Resource = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.securitycenter.v1.ListFindingsResponse.ListFindingsResult.Resource").msgclass - ListFindingsResponse::ListFindingsResult::StateChange = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.securitycenter.v1.ListFindingsResponse.ListFindingsResult.StateChange").enummodule - SetFindingStateRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.securitycenter.v1.SetFindingStateRequest").msgclass - SetMuteRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.securitycenter.v1.SetMuteRequest").msgclass - RunAssetDiscoveryRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.securitycenter.v1.RunAssetDiscoveryRequest").msgclass - SimulateSecurityHealthAnalyticsCustomModuleRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.securitycenter.v1.SimulateSecurityHealthAnalyticsCustomModuleRequest").msgclass - SimulateSecurityHealthAnalyticsCustomModuleRequest::SimulatedResource = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.securitycenter.v1.SimulateSecurityHealthAnalyticsCustomModuleRequest.SimulatedResource").msgclass - SimulateSecurityHealthAnalyticsCustomModuleResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.securitycenter.v1.SimulateSecurityHealthAnalyticsCustomModuleResponse").msgclass - SimulateSecurityHealthAnalyticsCustomModuleResponse::SimulatedResult = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.securitycenter.v1.SimulateSecurityHealthAnalyticsCustomModuleResponse.SimulatedResult").msgclass - UpdateExternalSystemRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.securitycenter.v1.UpdateExternalSystemRequest").msgclass - UpdateFindingRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.securitycenter.v1.UpdateFindingRequest").msgclass - UpdateMuteConfigRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.securitycenter.v1.UpdateMuteConfigRequest").msgclass - UpdateNotificationConfigRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.securitycenter.v1.UpdateNotificationConfigRequest").msgclass - UpdateOrganizationSettingsRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.securitycenter.v1.UpdateOrganizationSettingsRequest").msgclass - UpdateSecurityHealthAnalyticsCustomModuleRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.securitycenter.v1.UpdateSecurityHealthAnalyticsCustomModuleRequest").msgclass - UpdateSourceRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.securitycenter.v1.UpdateSourceRequest").msgclass - UpdateSecurityMarksRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.securitycenter.v1.UpdateSecurityMarksRequest").msgclass - CreateBigQueryExportRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.securitycenter.v1.CreateBigQueryExportRequest").msgclass - UpdateBigQueryExportRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.securitycenter.v1.UpdateBigQueryExportRequest").msgclass - ListBigQueryExportsRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.securitycenter.v1.ListBigQueryExportsRequest").msgclass - ListBigQueryExportsResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.securitycenter.v1.ListBigQueryExportsResponse").msgclass - DeleteBigQueryExportRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.securitycenter.v1.DeleteBigQueryExportRequest").msgclass - CreateEventThreatDetectionCustomModuleRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.securitycenter.v1.CreateEventThreatDetectionCustomModuleRequest").msgclass - ValidateEventThreatDetectionCustomModuleRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.securitycenter.v1.ValidateEventThreatDetectionCustomModuleRequest").msgclass - ValidateEventThreatDetectionCustomModuleResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.securitycenter.v1.ValidateEventThreatDetectionCustomModuleResponse").msgclass - DeleteEventThreatDetectionCustomModuleRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.securitycenter.v1.DeleteEventThreatDetectionCustomModuleRequest").msgclass - GetEventThreatDetectionCustomModuleRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.securitycenter.v1.GetEventThreatDetectionCustomModuleRequest").msgclass - ListDescendantEventThreatDetectionCustomModulesRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.securitycenter.v1.ListDescendantEventThreatDetectionCustomModulesRequest").msgclass - ListDescendantEventThreatDetectionCustomModulesResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.securitycenter.v1.ListDescendantEventThreatDetectionCustomModulesResponse").msgclass - ListEventThreatDetectionCustomModulesRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.securitycenter.v1.ListEventThreatDetectionCustomModulesRequest").msgclass - ListEventThreatDetectionCustomModulesResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.securitycenter.v1.ListEventThreatDetectionCustomModulesResponse").msgclass - UpdateEventThreatDetectionCustomModuleRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.securitycenter.v1.UpdateEventThreatDetectionCustomModuleRequest").msgclass - GetEffectiveEventThreatDetectionCustomModuleRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.securitycenter.v1.GetEffectiveEventThreatDetectionCustomModuleRequest").msgclass - ListEffectiveEventThreatDetectionCustomModulesRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.securitycenter.v1.ListEffectiveEventThreatDetectionCustomModulesRequest").msgclass - ListEffectiveEventThreatDetectionCustomModulesResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.securitycenter.v1.ListEffectiveEventThreatDetectionCustomModulesResponse").msgclass - end - end - end -end diff --git a/owl-bot-staging/google-cloud-security_center-v1/lib/google/cloud/securitycenter/v1/securitycenter_service_services_pb.rb b/owl-bot-staging/google-cloud-security_center-v1/lib/google/cloud/securitycenter/v1/securitycenter_service_services_pb.rb deleted file mode 100644 index 0d62cc122298..000000000000 --- a/owl-bot-staging/google-cloud-security_center-v1/lib/google/cloud/securitycenter/v1/securitycenter_service_services_pb.rb +++ /dev/null @@ -1,226 +0,0 @@ -# Generated by the protocol buffer compiler. DO NOT EDIT! -# Source: google/cloud/securitycenter/v1/securitycenter_service.proto for package 'Google.Cloud.SecurityCenter.V1' -# Original file comments: -# 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 -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. -# - -require 'grpc' -require 'google/cloud/securitycenter/v1/securitycenter_service_pb' - -module Google - module Cloud - module SecurityCenter - module V1 - module SecurityCenter - # V1 APIs for Security Center service. - class Service - - include ::GRPC::GenericService - - self.marshal_class_method = :encode - self.unmarshal_class_method = :decode - self.service_name = 'google.cloud.securitycenter.v1.SecurityCenter' - - # Kicks off an LRO to bulk mute findings for a parent based on a filter. The - # parent can be either an organization, folder or project. The findings - # matched by the filter will be muted after the LRO is done. - rpc :BulkMuteFindings, ::Google::Cloud::SecurityCenter::V1::BulkMuteFindingsRequest, ::Google::Longrunning::Operation - # Creates a resident SecurityHealthAnalyticsCustomModule at the scope of the - # given CRM parent, and also creates inherited - # SecurityHealthAnalyticsCustomModules for all CRM descendants of the given - # parent. These modules are enabled by default. - rpc :CreateSecurityHealthAnalyticsCustomModule, ::Google::Cloud::SecurityCenter::V1::CreateSecurityHealthAnalyticsCustomModuleRequest, ::Google::Cloud::SecurityCenter::V1::SecurityHealthAnalyticsCustomModule - # Creates a source. - rpc :CreateSource, ::Google::Cloud::SecurityCenter::V1::CreateSourceRequest, ::Google::Cloud::SecurityCenter::V1::Source - # Creates a finding. The corresponding source must exist for finding creation - # to succeed. - rpc :CreateFinding, ::Google::Cloud::SecurityCenter::V1::CreateFindingRequest, ::Google::Cloud::SecurityCenter::V1::Finding - # Creates a mute config. - rpc :CreateMuteConfig, ::Google::Cloud::SecurityCenter::V1::CreateMuteConfigRequest, ::Google::Cloud::SecurityCenter::V1::MuteConfig - # Creates a notification config. - rpc :CreateNotificationConfig, ::Google::Cloud::SecurityCenter::V1::CreateNotificationConfigRequest, ::Google::Cloud::SecurityCenter::V1::NotificationConfig - # Deletes an existing mute config. - rpc :DeleteMuteConfig, ::Google::Cloud::SecurityCenter::V1::DeleteMuteConfigRequest, ::Google::Protobuf::Empty - # Deletes a notification config. - rpc :DeleteNotificationConfig, ::Google::Cloud::SecurityCenter::V1::DeleteNotificationConfigRequest, ::Google::Protobuf::Empty - # Deletes the specified SecurityHealthAnalyticsCustomModule and all of its - # descendants in the CRM hierarchy. This method is only supported for - # resident custom modules. - rpc :DeleteSecurityHealthAnalyticsCustomModule, ::Google::Cloud::SecurityCenter::V1::DeleteSecurityHealthAnalyticsCustomModuleRequest, ::Google::Protobuf::Empty - # Get the simulation by name or the latest simulation for the given - # organization. - rpc :GetSimulation, ::Google::Cloud::SecurityCenter::V1::GetSimulationRequest, ::Google::Cloud::SecurityCenter::V1::Simulation - # Get the valued resource by name - rpc :GetValuedResource, ::Google::Cloud::SecurityCenter::V1::GetValuedResourceRequest, ::Google::Cloud::SecurityCenter::V1::ValuedResource - # Gets a BigQuery export. - rpc :GetBigQueryExport, ::Google::Cloud::SecurityCenter::V1::GetBigQueryExportRequest, ::Google::Cloud::SecurityCenter::V1::BigQueryExport - # Gets the access control policy on the specified Source. - rpc :GetIamPolicy, ::Google::Iam::V1::GetIamPolicyRequest, ::Google::Iam::V1::Policy - # Gets a mute config. - rpc :GetMuteConfig, ::Google::Cloud::SecurityCenter::V1::GetMuteConfigRequest, ::Google::Cloud::SecurityCenter::V1::MuteConfig - # Gets a notification config. - rpc :GetNotificationConfig, ::Google::Cloud::SecurityCenter::V1::GetNotificationConfigRequest, ::Google::Cloud::SecurityCenter::V1::NotificationConfig - # Gets the settings for an organization. - rpc :GetOrganizationSettings, ::Google::Cloud::SecurityCenter::V1::GetOrganizationSettingsRequest, ::Google::Cloud::SecurityCenter::V1::OrganizationSettings - # Retrieves an EffectiveSecurityHealthAnalyticsCustomModule. - rpc :GetEffectiveSecurityHealthAnalyticsCustomModule, ::Google::Cloud::SecurityCenter::V1::GetEffectiveSecurityHealthAnalyticsCustomModuleRequest, ::Google::Cloud::SecurityCenter::V1::EffectiveSecurityHealthAnalyticsCustomModule - # Retrieves a SecurityHealthAnalyticsCustomModule. - rpc :GetSecurityHealthAnalyticsCustomModule, ::Google::Cloud::SecurityCenter::V1::GetSecurityHealthAnalyticsCustomModuleRequest, ::Google::Cloud::SecurityCenter::V1::SecurityHealthAnalyticsCustomModule - # Gets a source. - rpc :GetSource, ::Google::Cloud::SecurityCenter::V1::GetSourceRequest, ::Google::Cloud::SecurityCenter::V1::Source - # Filters an organization's assets and groups them by their specified - # properties. - rpc :GroupAssets, ::Google::Cloud::SecurityCenter::V1::GroupAssetsRequest, ::Google::Cloud::SecurityCenter::V1::GroupAssetsResponse - # Filters an organization or source's findings and groups them by their - # specified properties. - # - # To group across all sources provide a `-` as the source id. - # Example: /v1/organizations/{organization_id}/sources/-/findings, - # /v1/folders/{folder_id}/sources/-/findings, - # /v1/projects/{project_id}/sources/-/findings - rpc :GroupFindings, ::Google::Cloud::SecurityCenter::V1::GroupFindingsRequest, ::Google::Cloud::SecurityCenter::V1::GroupFindingsResponse - # Lists an organization's assets. - rpc :ListAssets, ::Google::Cloud::SecurityCenter::V1::ListAssetsRequest, ::Google::Cloud::SecurityCenter::V1::ListAssetsResponse - # Returns a list of all resident SecurityHealthAnalyticsCustomModules under - # the given CRM parent and all of the parent’s CRM descendants. - rpc :ListDescendantSecurityHealthAnalyticsCustomModules, ::Google::Cloud::SecurityCenter::V1::ListDescendantSecurityHealthAnalyticsCustomModulesRequest, ::Google::Cloud::SecurityCenter::V1::ListDescendantSecurityHealthAnalyticsCustomModulesResponse - # Lists an organization or source's findings. - # - # To list across all sources provide a `-` as the source id. - # Example: /v1/organizations/{organization_id}/sources/-/findings - rpc :ListFindings, ::Google::Cloud::SecurityCenter::V1::ListFindingsRequest, ::Google::Cloud::SecurityCenter::V1::ListFindingsResponse - # Lists mute configs. - rpc :ListMuteConfigs, ::Google::Cloud::SecurityCenter::V1::ListMuteConfigsRequest, ::Google::Cloud::SecurityCenter::V1::ListMuteConfigsResponse - # Lists notification configs. - rpc :ListNotificationConfigs, ::Google::Cloud::SecurityCenter::V1::ListNotificationConfigsRequest, ::Google::Cloud::SecurityCenter::V1::ListNotificationConfigsResponse - # Returns a list of all EffectiveSecurityHealthAnalyticsCustomModules for the - # given parent. This includes resident modules defined at the scope of the - # parent, and inherited modules, inherited from CRM ancestors. - rpc :ListEffectiveSecurityHealthAnalyticsCustomModules, ::Google::Cloud::SecurityCenter::V1::ListEffectiveSecurityHealthAnalyticsCustomModulesRequest, ::Google::Cloud::SecurityCenter::V1::ListEffectiveSecurityHealthAnalyticsCustomModulesResponse - # Returns a list of all SecurityHealthAnalyticsCustomModules for the given - # parent. This includes resident modules defined at the scope of the parent, - # and inherited modules, inherited from CRM ancestors. - rpc :ListSecurityHealthAnalyticsCustomModules, ::Google::Cloud::SecurityCenter::V1::ListSecurityHealthAnalyticsCustomModulesRequest, ::Google::Cloud::SecurityCenter::V1::ListSecurityHealthAnalyticsCustomModulesResponse - # Lists all sources belonging to an organization. - rpc :ListSources, ::Google::Cloud::SecurityCenter::V1::ListSourcesRequest, ::Google::Cloud::SecurityCenter::V1::ListSourcesResponse - # Runs asset discovery. The discovery is tracked with a long-running - # operation. - # - # This API can only be called with limited frequency for an organization. If - # it is called too frequently the caller will receive a TOO_MANY_REQUESTS - # error. - rpc :RunAssetDiscovery, ::Google::Cloud::SecurityCenter::V1::RunAssetDiscoveryRequest, ::Google::Longrunning::Operation - # Updates the state of a finding. - rpc :SetFindingState, ::Google::Cloud::SecurityCenter::V1::SetFindingStateRequest, ::Google::Cloud::SecurityCenter::V1::Finding - # Updates the mute state of a finding. - rpc :SetMute, ::Google::Cloud::SecurityCenter::V1::SetMuteRequest, ::Google::Cloud::SecurityCenter::V1::Finding - # Sets the access control policy on the specified Source. - rpc :SetIamPolicy, ::Google::Iam::V1::SetIamPolicyRequest, ::Google::Iam::V1::Policy - # Returns the permissions that a caller has on the specified source. - rpc :TestIamPermissions, ::Google::Iam::V1::TestIamPermissionsRequest, ::Google::Iam::V1::TestIamPermissionsResponse - # Simulates a given SecurityHealthAnalyticsCustomModule and Resource. - rpc :SimulateSecurityHealthAnalyticsCustomModule, ::Google::Cloud::SecurityCenter::V1::SimulateSecurityHealthAnalyticsCustomModuleRequest, ::Google::Cloud::SecurityCenter::V1::SimulateSecurityHealthAnalyticsCustomModuleResponse - # Updates external system. This is for a given finding. - rpc :UpdateExternalSystem, ::Google::Cloud::SecurityCenter::V1::UpdateExternalSystemRequest, ::Google::Cloud::SecurityCenter::V1::ExternalSystem - # Creates or updates a finding. The corresponding source must exist for a - # finding creation to succeed. - rpc :UpdateFinding, ::Google::Cloud::SecurityCenter::V1::UpdateFindingRequest, ::Google::Cloud::SecurityCenter::V1::Finding - # Updates a mute config. - rpc :UpdateMuteConfig, ::Google::Cloud::SecurityCenter::V1::UpdateMuteConfigRequest, ::Google::Cloud::SecurityCenter::V1::MuteConfig - # - # Updates a notification config. The following update - # fields are allowed: description, pubsub_topic, streaming_config.filter - rpc :UpdateNotificationConfig, ::Google::Cloud::SecurityCenter::V1::UpdateNotificationConfigRequest, ::Google::Cloud::SecurityCenter::V1::NotificationConfig - # Updates an organization's settings. - rpc :UpdateOrganizationSettings, ::Google::Cloud::SecurityCenter::V1::UpdateOrganizationSettingsRequest, ::Google::Cloud::SecurityCenter::V1::OrganizationSettings - # Updates the SecurityHealthAnalyticsCustomModule under the given name based - # on the given update mask. Updating the enablement state is supported on - # both resident and inherited modules (though resident modules cannot have an - # enablement state of "inherited"). Updating the display name and custom - # config of a module is supported on resident modules only. - rpc :UpdateSecurityHealthAnalyticsCustomModule, ::Google::Cloud::SecurityCenter::V1::UpdateSecurityHealthAnalyticsCustomModuleRequest, ::Google::Cloud::SecurityCenter::V1::SecurityHealthAnalyticsCustomModule - # Updates a source. - rpc :UpdateSource, ::Google::Cloud::SecurityCenter::V1::UpdateSourceRequest, ::Google::Cloud::SecurityCenter::V1::Source - # Updates security marks. - rpc :UpdateSecurityMarks, ::Google::Cloud::SecurityCenter::V1::UpdateSecurityMarksRequest, ::Google::Cloud::SecurityCenter::V1::SecurityMarks - # Creates a BigQuery export. - rpc :CreateBigQueryExport, ::Google::Cloud::SecurityCenter::V1::CreateBigQueryExportRequest, ::Google::Cloud::SecurityCenter::V1::BigQueryExport - # Deletes an existing BigQuery export. - rpc :DeleteBigQueryExport, ::Google::Cloud::SecurityCenter::V1::DeleteBigQueryExportRequest, ::Google::Protobuf::Empty - # Updates a BigQuery export. - rpc :UpdateBigQueryExport, ::Google::Cloud::SecurityCenter::V1::UpdateBigQueryExportRequest, ::Google::Cloud::SecurityCenter::V1::BigQueryExport - # Lists BigQuery exports. Note that when requesting BigQuery exports at a - # given level all exports under that level are also returned e.g. if - # requesting BigQuery exports under a folder, then all BigQuery exports - # immediately under the folder plus the ones created under the projects - # within the folder are returned. - rpc :ListBigQueryExports, ::Google::Cloud::SecurityCenter::V1::ListBigQueryExportsRequest, ::Google::Cloud::SecurityCenter::V1::ListBigQueryExportsResponse - # Creates a resident Event Threat Detection custom module at the scope of the - # given Resource Manager parent, and also creates inherited custom modules - # for all descendants of the given parent. These modules are enabled by - # default. - rpc :CreateEventThreatDetectionCustomModule, ::Google::Cloud::SecurityCenter::V1::CreateEventThreatDetectionCustomModuleRequest, ::Google::Cloud::SecurityCenter::V1::EventThreatDetectionCustomModule - # Deletes the specified Event Threat Detection custom module and all of its - # descendants in the Resource Manager hierarchy. This method is only - # supported for resident custom modules. - rpc :DeleteEventThreatDetectionCustomModule, ::Google::Cloud::SecurityCenter::V1::DeleteEventThreatDetectionCustomModuleRequest, ::Google::Protobuf::Empty - # Gets an Event Threat Detection custom module. - rpc :GetEventThreatDetectionCustomModule, ::Google::Cloud::SecurityCenter::V1::GetEventThreatDetectionCustomModuleRequest, ::Google::Cloud::SecurityCenter::V1::EventThreatDetectionCustomModule - # Lists all resident Event Threat Detection custom modules under the - # given Resource Manager parent and its descendants. - rpc :ListDescendantEventThreatDetectionCustomModules, ::Google::Cloud::SecurityCenter::V1::ListDescendantEventThreatDetectionCustomModulesRequest, ::Google::Cloud::SecurityCenter::V1::ListDescendantEventThreatDetectionCustomModulesResponse - # Lists all Event Threat Detection custom modules for the given - # Resource Manager parent. This includes resident modules defined at the - # scope of the parent along with modules inherited from ancestors. - rpc :ListEventThreatDetectionCustomModules, ::Google::Cloud::SecurityCenter::V1::ListEventThreatDetectionCustomModulesRequest, ::Google::Cloud::SecurityCenter::V1::ListEventThreatDetectionCustomModulesResponse - # Updates the Event Threat Detection custom module with the given name based - # on the given update mask. Updating the enablement state is supported for - # both resident and inherited modules (though resident modules cannot have an - # enablement state of "inherited"). Updating the display name or - # configuration of a module is supported for resident modules only. The type - # of a module cannot be changed. - rpc :UpdateEventThreatDetectionCustomModule, ::Google::Cloud::SecurityCenter::V1::UpdateEventThreatDetectionCustomModuleRequest, ::Google::Cloud::SecurityCenter::V1::EventThreatDetectionCustomModule - # Validates the given Event Threat Detection custom module. - rpc :ValidateEventThreatDetectionCustomModule, ::Google::Cloud::SecurityCenter::V1::ValidateEventThreatDetectionCustomModuleRequest, ::Google::Cloud::SecurityCenter::V1::ValidateEventThreatDetectionCustomModuleResponse - # Gets an effective Event Threat Detection custom module at the given level. - rpc :GetEffectiveEventThreatDetectionCustomModule, ::Google::Cloud::SecurityCenter::V1::GetEffectiveEventThreatDetectionCustomModuleRequest, ::Google::Cloud::SecurityCenter::V1::EffectiveEventThreatDetectionCustomModule - # Lists all effective Event Threat Detection custom modules for the - # given parent. This includes resident modules defined at the scope of the - # parent along with modules inherited from its ancestors. - rpc :ListEffectiveEventThreatDetectionCustomModules, ::Google::Cloud::SecurityCenter::V1::ListEffectiveEventThreatDetectionCustomModulesRequest, ::Google::Cloud::SecurityCenter::V1::ListEffectiveEventThreatDetectionCustomModulesResponse - # Creates a ResourceValueConfig for an organization. Maps user's tags to - # difference resource values for use by the attack path simulation. - rpc :BatchCreateResourceValueConfigs, ::Google::Cloud::SecurityCenter::V1::BatchCreateResourceValueConfigsRequest, ::Google::Cloud::SecurityCenter::V1::BatchCreateResourceValueConfigsResponse - # Deletes a ResourceValueConfig. - rpc :DeleteResourceValueConfig, ::Google::Cloud::SecurityCenter::V1::DeleteResourceValueConfigRequest, ::Google::Protobuf::Empty - # Gets a ResourceValueConfig. - rpc :GetResourceValueConfig, ::Google::Cloud::SecurityCenter::V1::GetResourceValueConfigRequest, ::Google::Cloud::SecurityCenter::V1::ResourceValueConfig - # Lists all ResourceValueConfigs. - rpc :ListResourceValueConfigs, ::Google::Cloud::SecurityCenter::V1::ListResourceValueConfigsRequest, ::Google::Cloud::SecurityCenter::V1::ListResourceValueConfigsResponse - # Updates an existing ResourceValueConfigs with new rules. - rpc :UpdateResourceValueConfig, ::Google::Cloud::SecurityCenter::V1::UpdateResourceValueConfigRequest, ::Google::Cloud::SecurityCenter::V1::ResourceValueConfig - # Lists the valued resources for a set of simulation results and filter. - rpc :ListValuedResources, ::Google::Cloud::SecurityCenter::V1::ListValuedResourcesRequest, ::Google::Cloud::SecurityCenter::V1::ListValuedResourcesResponse - # Lists the attack paths for a set of simulation results or valued resources - # and filter. - rpc :ListAttackPaths, ::Google::Cloud::SecurityCenter::V1::ListAttackPathsRequest, ::Google::Cloud::SecurityCenter::V1::ListAttackPathsResponse - end - - Stub = Service.rpc_stub_class - end - end - end - end -end diff --git a/owl-bot-staging/google-cloud-security_center-v1/lib/google/cloud/securitycenter/v1/simulation_pb.rb b/owl-bot-staging/google-cloud-security_center-v1/lib/google/cloud/securitycenter/v1/simulation_pb.rb deleted file mode 100644 index 577a4d977a3a..000000000000 --- a/owl-bot-staging/google-cloud-security_center-v1/lib/google/cloud/securitycenter/v1/simulation_pb.rb +++ /dev/null @@ -1,27 +0,0 @@ -# frozen_string_literal: true -# Generated by the protocol buffer compiler. DO NOT EDIT! -# source: google/cloud/securitycenter/v1/simulation.proto - -require 'google/protobuf' - -require 'google/api/field_behavior_pb' -require 'google/api/resource_pb' -require 'google/cloud/securitycenter/v1/resource_pb' -require 'google/cloud/securitycenter/v1/valued_resource_pb' -require 'google/protobuf/timestamp_pb' - - -descriptor_data = "\n/google/cloud/securitycenter/v1/simulation.proto\x12\x1egoogle.cloud.securitycenter.v1\x1a\x1fgoogle/api/field_behavior.proto\x1a\x19google/api/resource.proto\x1a-google/cloud/securitycenter/v1/resource.proto\x1a\x34google/cloud/securitycenter/v1/valued_resource.proto\x1a\x1fgoogle/protobuf/timestamp.proto\"\xfc\x02\n\nSimulation\x12\x0c\n\x04name\x18\x01 \x01(\t\x12\x34\n\x0b\x63reate_time\x18\x02 \x01(\x0b\x32\x1a.google.protobuf.TimestampB\x03\xe0\x41\x03\x12\x64\n\x1fresource_value_configs_metadata\x18\x03 \x03(\x0b\x32;.google.cloud.securitycenter.v1.ResourceValueConfigMetadata\x12\x45\n\x0e\x63loud_provider\x18\x04 \x01(\x0e\x32-.google.cloud.securitycenter.v1.CloudProvider:}\xea\x41z\n(securitycenter.googleapis.com/Simulation\x12\x35organizations/{organization}/simulations/{simulation}*\x0bsimulations2\nsimulationB\xe9\x01\n\"com.google.cloud.securitycenter.v1B\x0fSimulationProtoP\x01ZJcloud.google.com/go/securitycenter/apiv1/securitycenterpb;securitycenterpb\xaa\x02\x1eGoogle.Cloud.SecurityCenter.V1\xca\x02\x1eGoogle\\Cloud\\SecurityCenter\\V1\xea\x02!Google::Cloud::SecurityCenter::V1b\x06proto3" - -pool = ::Google::Protobuf::DescriptorPool.generated_pool -pool.add_serialized_file(descriptor_data) - -module Google - module Cloud - module SecurityCenter - module V1 - Simulation = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.securitycenter.v1.Simulation").msgclass - end - end - end -end diff --git a/owl-bot-staging/google-cloud-security_center-v1/lib/google/cloud/securitycenter/v1/source_pb.rb b/owl-bot-staging/google-cloud-security_center-v1/lib/google/cloud/securitycenter/v1/source_pb.rb deleted file mode 100644 index 2f7921ed6f0b..000000000000 --- a/owl-bot-staging/google-cloud-security_center-v1/lib/google/cloud/securitycenter/v1/source_pb.rb +++ /dev/null @@ -1,23 +0,0 @@ -# frozen_string_literal: true -# Generated by the protocol buffer compiler. DO NOT EDIT! -# source: google/cloud/securitycenter/v1/source.proto - -require 'google/protobuf' - -require 'google/api/resource_pb' - - -descriptor_data = "\n+google/cloud/securitycenter/v1/source.proto\x12\x1egoogle.cloud.securitycenter.v1\x1a\x19google/api/resource.proto\"\xfd\x01\n\x06Source\x12\x0c\n\x04name\x18\x01 \x01(\t\x12\x14\n\x0c\x64isplay_name\x18\x02 \x01(\t\x12\x13\n\x0b\x64\x65scription\x18\x03 \x01(\t\x12\x16\n\x0e\x63\x61nonical_name\x18\x0e \x01(\t:\xa1\x01\xea\x41\x9d\x01\n$securitycenter.googleapis.com/Source\x12-organizations/{organization}/sources/{source}\x12!folders/{folder}/sources/{source}\x12#projects/{project}/sources/{source}B\xd8\x01\n\"com.google.cloud.securitycenter.v1P\x01ZJcloud.google.com/go/securitycenter/apiv1/securitycenterpb;securitycenterpb\xaa\x02\x1eGoogle.Cloud.SecurityCenter.V1\xca\x02\x1eGoogle\\Cloud\\SecurityCenter\\V1\xea\x02!Google::Cloud::SecurityCenter::V1b\x06proto3" - -pool = ::Google::Protobuf::DescriptorPool.generated_pool -pool.add_serialized_file(descriptor_data) - -module Google - module Cloud - module SecurityCenter - module V1 - Source = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.securitycenter.v1.Source").msgclass - end - end - end -end diff --git a/owl-bot-staging/google-cloud-security_center-v1/lib/google/cloud/securitycenter/v1/toxic_combination_pb.rb b/owl-bot-staging/google-cloud-security_center-v1/lib/google/cloud/securitycenter/v1/toxic_combination_pb.rb deleted file mode 100644 index 78da4c94159e..000000000000 --- a/owl-bot-staging/google-cloud-security_center-v1/lib/google/cloud/securitycenter/v1/toxic_combination_pb.rb +++ /dev/null @@ -1,21 +0,0 @@ -# frozen_string_literal: true -# Generated by the protocol buffer compiler. DO NOT EDIT! -# source: google/cloud/securitycenter/v1/toxic_combination.proto - -require 'google/protobuf' - - -descriptor_data = "\n6google/cloud/securitycenter/v1/toxic_combination.proto\x12\x1egoogle.cloud.securitycenter.v1\"K\n\x10ToxicCombination\x12\x1d\n\x15\x61ttack_exposure_score\x18\x01 \x01(\x01\x12\x18\n\x10related_findings\x18\x02 \x03(\tB\xef\x01\n\"com.google.cloud.securitycenter.v1B\x15ToxicCombinationProtoP\x01ZJcloud.google.com/go/securitycenter/apiv1/securitycenterpb;securitycenterpb\xaa\x02\x1eGoogle.Cloud.SecurityCenter.V1\xca\x02\x1eGoogle\\Cloud\\SecurityCenter\\V1\xea\x02!Google::Cloud::SecurityCenter::V1b\x06proto3" - -pool = ::Google::Protobuf::DescriptorPool.generated_pool -pool.add_serialized_file(descriptor_data) - -module Google - module Cloud - module SecurityCenter - module V1 - ToxicCombination = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.securitycenter.v1.ToxicCombination").msgclass - end - end - end -end diff --git a/owl-bot-staging/google-cloud-security_center-v1/lib/google/cloud/securitycenter/v1/valued_resource_pb.rb b/owl-bot-staging/google-cloud-security_center-v1/lib/google/cloud/securitycenter/v1/valued_resource_pb.rb deleted file mode 100644 index c0a8708958bb..000000000000 --- a/owl-bot-staging/google-cloud-security_center-v1/lib/google/cloud/securitycenter/v1/valued_resource_pb.rb +++ /dev/null @@ -1,25 +0,0 @@ -# frozen_string_literal: true -# Generated by the protocol buffer compiler. DO NOT EDIT! -# source: google/cloud/securitycenter/v1/valued_resource.proto - -require 'google/protobuf' - -require 'google/api/resource_pb' - - -descriptor_data = "\n4google/cloud/securitycenter/v1/valued_resource.proto\x12\x1egoogle.cloud.securitycenter.v1\x1a\x19google/api/resource.proto\"\xd8\x04\n\x0eValuedResource\x12\x0c\n\x04name\x18\x01 \x01(\t\x12\x10\n\x08resource\x18\x02 \x01(\t\x12\x15\n\rresource_type\x18\x03 \x01(\t\x12\x14\n\x0c\x64isplay_name\x18\x04 \x01(\t\x12T\n\x0eresource_value\x18\x05 \x01(\x0e\x32<.google.cloud.securitycenter.v1.ValuedResource.ResourceValue\x12\x15\n\rexposed_score\x18\x06 \x01(\x01\x12`\n\x1bresource_value_configs_used\x18\x07 \x03(\x0b\x32;.google.cloud.securitycenter.v1.ResourceValueConfigMetadata\"{\n\rResourceValue\x12\x1e\n\x1aRESOURCE_VALUE_UNSPECIFIED\x10\x00\x12\x16\n\x12RESOURCE_VALUE_LOW\x10\x01\x12\x19\n\x15RESOURCE_VALUE_MEDIUM\x10\x02\x12\x17\n\x13RESOURCE_VALUE_HIGH\x10\x03:\xac\x01\xea\x41\xa8\x01\n,securitycenter.googleapis.com/ValuedResource\x12Worganizations/{organization}/simulations/{simulation}/valuedResources/{valued_resource}*\x0fvaluedResources2\x0evaluedResource\"+\n\x1bResourceValueConfigMetadata\x12\x0c\n\x04name\x18\x01 \x01(\tB\xed\x01\n\"com.google.cloud.securitycenter.v1B\x13ValuedResourceProtoP\x01ZJcloud.google.com/go/securitycenter/apiv1/securitycenterpb;securitycenterpb\xaa\x02\x1eGoogle.Cloud.SecurityCenter.V1\xca\x02\x1eGoogle\\Cloud\\SecurityCenter\\V1\xea\x02!Google::Cloud::SecurityCenter::V1b\x06proto3" - -pool = ::Google::Protobuf::DescriptorPool.generated_pool -pool.add_serialized_file(descriptor_data) - -module Google - module Cloud - module SecurityCenter - module V1 - ValuedResource = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.securitycenter.v1.ValuedResource").msgclass - ValuedResource::ResourceValue = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.securitycenter.v1.ValuedResource.ResourceValue").enummodule - ResourceValueConfigMetadata = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.securitycenter.v1.ResourceValueConfigMetadata").msgclass - end - end - end -end diff --git a/owl-bot-staging/google-cloud-security_center-v1/lib/google/cloud/securitycenter/v1/vulnerability_pb.rb b/owl-bot-staging/google-cloud-security_center-v1/lib/google/cloud/securitycenter/v1/vulnerability_pb.rb deleted file mode 100644 index 64dcf8c6b5f7..000000000000 --- a/owl-bot-staging/google-cloud-security_center-v1/lib/google/cloud/securitycenter/v1/vulnerability_pb.rb +++ /dev/null @@ -1,36 +0,0 @@ -# frozen_string_literal: true -# Generated by the protocol buffer compiler. DO NOT EDIT! -# source: google/cloud/securitycenter/v1/vulnerability.proto - -require 'google/protobuf' - -require 'google/protobuf/timestamp_pb' - - -descriptor_data = "\n2google/cloud/securitycenter/v1/vulnerability.proto\x12\x1egoogle.cloud.securitycenter.v1\x1a\x1fgoogle/protobuf/timestamp.proto\"\x92\x02\n\rVulnerability\x12\x30\n\x03\x63ve\x18\x01 \x01(\x0b\x32#.google.cloud.securitycenter.v1.Cve\x12\x42\n\x11offending_package\x18\x02 \x01(\x0b\x32\'.google.cloud.securitycenter.v1.Package\x12>\n\rfixed_package\x18\x03 \x01(\x0b\x32\'.google.cloud.securitycenter.v1.Package\x12K\n\x11security_bulletin\x18\x04 \x01(\x0b\x32\x30.google.cloud.securitycenter.v1.SecurityBulletin\"\x8a\x05\n\x03\x43ve\x12\n\n\x02id\x18\x01 \x01(\t\x12=\n\nreferences\x18\x02 \x03(\x0b\x32).google.cloud.securitycenter.v1.Reference\x12\x36\n\x06\x63vssv3\x18\x03 \x01(\x0b\x32&.google.cloud.securitycenter.v1.Cvssv3\x12\x1e\n\x16upstream_fix_available\x18\x04 \x01(\x08\x12>\n\x06impact\x18\x05 \x01(\x0e\x32..google.cloud.securitycenter.v1.Cve.RiskRating\x12W\n\x15\x65xploitation_activity\x18\x06 \x01(\x0e\x32\x38.google.cloud.securitycenter.v1.Cve.ExploitationActivity\x12\x1c\n\x14observed_in_the_wild\x18\x07 \x01(\x08\x12\x10\n\x08zero_day\x18\x08 \x01(\x08\x12\x38\n\x14\x65xploit_release_date\x18\t \x01(\x0b\x32\x1a.google.protobuf.Timestamp\"V\n\nRiskRating\x12\x1b\n\x17RISK_RATING_UNSPECIFIED\x10\x00\x12\x07\n\x03LOW\x10\x01\x12\n\n\x06MEDIUM\x10\x02\x12\x08\n\x04HIGH\x10\x03\x12\x0c\n\x08\x43RITICAL\x10\x04\"\x84\x01\n\x14\x45xploitationActivity\x12%\n!EXPLOITATION_ACTIVITY_UNSPECIFIED\x10\x00\x12\x08\n\x04WIDE\x10\x01\x12\r\n\tCONFIRMED\x10\x02\x12\r\n\tAVAILABLE\x10\x03\x12\x0f\n\x0b\x41NTICIPATED\x10\x04\x12\x0c\n\x08NO_KNOWN\x10\x05\"(\n\tReference\x12\x0e\n\x06source\x18\x01 \x01(\t\x12\x0b\n\x03uri\x18\x02 \x01(\t\"\xb1\n\n\x06\x43vssv3\x12\x12\n\nbase_score\x18\x01 \x01(\x01\x12J\n\rattack_vector\x18\x05 \x01(\x0e\x32\x33.google.cloud.securitycenter.v1.Cvssv3.AttackVector\x12R\n\x11\x61ttack_complexity\x18\x06 \x01(\x0e\x32\x37.google.cloud.securitycenter.v1.Cvssv3.AttackComplexity\x12V\n\x13privileges_required\x18\x07 \x01(\x0e\x32\x39.google.cloud.securitycenter.v1.Cvssv3.PrivilegesRequired\x12P\n\x10user_interaction\x18\x08 \x01(\x0e\x32\x36.google.cloud.securitycenter.v1.Cvssv3.UserInteraction\x12;\n\x05scope\x18\t \x01(\x0e\x32,.google.cloud.securitycenter.v1.Cvssv3.Scope\x12M\n\x16\x63onfidentiality_impact\x18\n \x01(\x0e\x32-.google.cloud.securitycenter.v1.Cvssv3.Impact\x12G\n\x10integrity_impact\x18\x0b \x01(\x0e\x32-.google.cloud.securitycenter.v1.Cvssv3.Impact\x12J\n\x13\x61vailability_impact\x18\x0c \x01(\x0e\x32-.google.cloud.securitycenter.v1.Cvssv3.Impact\"\x99\x01\n\x0c\x41ttackVector\x12\x1d\n\x19\x41TTACK_VECTOR_UNSPECIFIED\x10\x00\x12\x19\n\x15\x41TTACK_VECTOR_NETWORK\x10\x01\x12\x1a\n\x16\x41TTACK_VECTOR_ADJACENT\x10\x02\x12\x17\n\x13\x41TTACK_VECTOR_LOCAL\x10\x03\x12\x1a\n\x16\x41TTACK_VECTOR_PHYSICAL\x10\x04\"l\n\x10\x41ttackComplexity\x12!\n\x1d\x41TTACK_COMPLEXITY_UNSPECIFIED\x10\x00\x12\x19\n\x15\x41TTACK_COMPLEXITY_LOW\x10\x01\x12\x1a\n\x16\x41TTACK_COMPLEXITY_HIGH\x10\x02\"\x92\x01\n\x12PrivilegesRequired\x12#\n\x1fPRIVILEGES_REQUIRED_UNSPECIFIED\x10\x00\x12\x1c\n\x18PRIVILEGES_REQUIRED_NONE\x10\x01\x12\x1b\n\x17PRIVILEGES_REQUIRED_LOW\x10\x02\x12\x1c\n\x18PRIVILEGES_REQUIRED_HIGH\x10\x03\"m\n\x0fUserInteraction\x12 \n\x1cUSER_INTERACTION_UNSPECIFIED\x10\x00\x12\x19\n\x15USER_INTERACTION_NONE\x10\x01\x12\x1d\n\x19USER_INTERACTION_REQUIRED\x10\x02\"F\n\x05Scope\x12\x15\n\x11SCOPE_UNSPECIFIED\x10\x00\x12\x13\n\x0fSCOPE_UNCHANGED\x10\x01\x12\x11\n\rSCOPE_CHANGED\x10\x02\"R\n\x06Impact\x12\x16\n\x12IMPACT_UNSPECIFIED\x10\x00\x12\x0f\n\x0bIMPACT_HIGH\x10\x01\x12\x0e\n\nIMPACT_LOW\x10\x02\x12\x0f\n\x0bIMPACT_NONE\x10\x03\"_\n\x07Package\x12\x14\n\x0cpackage_name\x18\x01 \x01(\t\x12\x0f\n\x07\x63pe_uri\x18\x02 \x01(\t\x12\x14\n\x0cpackage_type\x18\x03 \x01(\t\x12\x17\n\x0fpackage_version\x18\x04 \x01(\t\"\x7f\n\x10SecurityBulletin\x12\x13\n\x0b\x62ulletin_id\x18\x01 \x01(\t\x12\x33\n\x0fsubmission_time\x18\x02 \x01(\x0b\x32\x1a.google.protobuf.Timestamp\x12!\n\x19suggested_upgrade_version\x18\x03 \x01(\tB\xec\x01\n\"com.google.cloud.securitycenter.v1B\x12VulnerabilityProtoP\x01ZJcloud.google.com/go/securitycenter/apiv1/securitycenterpb;securitycenterpb\xaa\x02\x1eGoogle.Cloud.SecurityCenter.V1\xca\x02\x1eGoogle\\Cloud\\SecurityCenter\\V1\xea\x02!Google::Cloud::SecurityCenter::V1b\x06proto3" - -pool = ::Google::Protobuf::DescriptorPool.generated_pool -pool.add_serialized_file(descriptor_data) - -module Google - module Cloud - module SecurityCenter - module V1 - Vulnerability = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.securitycenter.v1.Vulnerability").msgclass - Cve = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.securitycenter.v1.Cve").msgclass - Cve::RiskRating = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.securitycenter.v1.Cve.RiskRating").enummodule - Cve::ExploitationActivity = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.securitycenter.v1.Cve.ExploitationActivity").enummodule - Reference = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.securitycenter.v1.Reference").msgclass - Cvssv3 = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.securitycenter.v1.Cvssv3").msgclass - Cvssv3::AttackVector = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.securitycenter.v1.Cvssv3.AttackVector").enummodule - Cvssv3::AttackComplexity = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.securitycenter.v1.Cvssv3.AttackComplexity").enummodule - Cvssv3::PrivilegesRequired = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.securitycenter.v1.Cvssv3.PrivilegesRequired").enummodule - Cvssv3::UserInteraction = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.securitycenter.v1.Cvssv3.UserInteraction").enummodule - Cvssv3::Scope = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.securitycenter.v1.Cvssv3.Scope").enummodule - Cvssv3::Impact = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.securitycenter.v1.Cvssv3.Impact").enummodule - Package = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.securitycenter.v1.Package").msgclass - SecurityBulletin = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.securitycenter.v1.SecurityBulletin").msgclass - end - end - end -end diff --git a/owl-bot-staging/google-cloud-security_center-v1/proto_docs/README.md b/owl-bot-staging/google-cloud-security_center-v1/proto_docs/README.md deleted file mode 100644 index 2477ff9d487e..000000000000 --- a/owl-bot-staging/google-cloud-security_center-v1/proto_docs/README.md +++ /dev/null @@ -1,4 +0,0 @@ -# Cloud Security Command Center V1 Protocol Buffer Documentation - -These files are for the YARD documentation of the generated protobuf files. -They are not intended to be required or loaded at runtime. diff --git a/owl-bot-staging/google-cloud-security_center-v1/proto_docs/google/api/client.rb b/owl-bot-staging/google-cloud-security_center-v1/proto_docs/google/api/client.rb deleted file mode 100644 index 5089551e9ea4..000000000000 --- a/owl-bot-staging/google-cloud-security_center-v1/proto_docs/google/api/client.rb +++ /dev/null @@ -1,589 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - - -module Google - module Api - # Required information for every language. - # @!attribute [rw] reference_docs_uri - # @deprecated This field is deprecated and may be removed in the next major version update. - # @return [::String] - # Link to automatically generated reference documentation. Example: - # https://cloud.google.com/nodejs/docs/reference/asset/latest - # @!attribute [rw] destinations - # @return [::Array<::Google::Api::ClientLibraryDestination>] - # The destination where API teams want this client library to be published. - # @!attribute [rw] selective_gapic_generation - # @return [::Google::Api::SelectiveGapicGeneration] - # Configuration for which RPCs should be generated in the GAPIC client. - class CommonLanguageSettings - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Details about how and where to publish client libraries. - # @!attribute [rw] version - # @return [::String] - # Version of the API to apply these settings to. This is the full protobuf - # package for the API, ending in the version element. - # Examples: "google.cloud.speech.v1" and "google.spanner.admin.database.v1". - # @!attribute [rw] launch_stage - # @return [::Google::Api::LaunchStage] - # Launch stage of this version of the API. - # @!attribute [rw] rest_numeric_enums - # @return [::Boolean] - # When using transport=rest, the client request will encode enums as - # numbers rather than strings. - # @!attribute [rw] java_settings - # @return [::Google::Api::JavaSettings] - # Settings for legacy Java features, supported in the Service YAML. - # @!attribute [rw] cpp_settings - # @return [::Google::Api::CppSettings] - # Settings for C++ client libraries. - # @!attribute [rw] php_settings - # @return [::Google::Api::PhpSettings] - # Settings for PHP client libraries. - # @!attribute [rw] python_settings - # @return [::Google::Api::PythonSettings] - # Settings for Python client libraries. - # @!attribute [rw] node_settings - # @return [::Google::Api::NodeSettings] - # Settings for Node client libraries. - # @!attribute [rw] dotnet_settings - # @return [::Google::Api::DotnetSettings] - # Settings for .NET client libraries. - # @!attribute [rw] ruby_settings - # @return [::Google::Api::RubySettings] - # Settings for Ruby client libraries. - # @!attribute [rw] go_settings - # @return [::Google::Api::GoSettings] - # Settings for Go client libraries. - class ClientLibrarySettings - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # This message configures the settings for publishing [Google Cloud Client - # libraries](https://cloud.google.com/apis/docs/cloud-client-libraries) - # generated from the service config. - # @!attribute [rw] method_settings - # @return [::Array<::Google::Api::MethodSettings>] - # A list of API method settings, e.g. the behavior for methods that use the - # long-running operation pattern. - # @!attribute [rw] new_issue_uri - # @return [::String] - # Link to a *public* URI where users can report issues. Example: - # https://issuetracker.google.com/issues/new?component=190865&template=1161103 - # @!attribute [rw] documentation_uri - # @return [::String] - # Link to product home page. Example: - # https://cloud.google.com/asset-inventory/docs/overview - # @!attribute [rw] api_short_name - # @return [::String] - # Used as a tracking tag when collecting data about the APIs developer - # relations artifacts like docs, packages delivered to package managers, - # etc. Example: "speech". - # @!attribute [rw] github_label - # @return [::String] - # GitHub label to apply to issues and pull requests opened for this API. - # @!attribute [rw] codeowner_github_teams - # @return [::Array<::String>] - # GitHub teams to be added to CODEOWNERS in the directory in GitHub - # containing source code for the client libraries for this API. - # @!attribute [rw] doc_tag_prefix - # @return [::String] - # A prefix used in sample code when demarking regions to be included in - # documentation. - # @!attribute [rw] organization - # @return [::Google::Api::ClientLibraryOrganization] - # For whom the client library is being published. - # @!attribute [rw] library_settings - # @return [::Array<::Google::Api::ClientLibrarySettings>] - # Client library settings. If the same version string appears multiple - # times in this list, then the last one wins. Settings from earlier - # settings with the same version string are discarded. - # @!attribute [rw] proto_reference_documentation_uri - # @return [::String] - # Optional link to proto reference documentation. Example: - # https://cloud.google.com/pubsub/lite/docs/reference/rpc - # @!attribute [rw] rest_reference_documentation_uri - # @return [::String] - # Optional link to REST reference documentation. Example: - # https://cloud.google.com/pubsub/lite/docs/reference/rest - class Publishing - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Settings for Java client libraries. - # @!attribute [rw] library_package - # @return [::String] - # The package name to use in Java. Clobbers the java_package option - # set in the protobuf. This should be used **only** by APIs - # who have already set the language_settings.java.package_name" field - # in gapic.yaml. API teams should use the protobuf java_package option - # where possible. - # - # Example of a YAML configuration:: - # - # publishing: - # 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. - # @!attribute [rw] methods - # @return [::Array<::String>] - # An allowlist of the fully qualified names of RPCs that should be included - # on public client surfaces. - # @!attribute [rw] generate_omitted_as_internal - # @return [::Boolean] - # Setting this to true indicates to the client generators that methods - # that would be excluded from the generation should instead be generated - # in a way that indicates these methods should not be consumed by - # end users. How this is expressed is up to individual language - # implementations to decide. Some examples may be: added annotations, - # obfuscated identifiers, or other language idiomatic patterns. - class SelectiveGapicGeneration - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # `BatchingConfigProto` defines the batching configuration for an API method. - # @!attribute [rw] thresholds - # @return [::Google::Api::BatchingSettingsProto] - # The thresholds which trigger a batched request to be sent. - # @!attribute [rw] batch_descriptor - # @return [::Google::Api::BatchingDescriptorProto] - # The request and response fields used in batching. - class BatchingConfigProto - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # `BatchingSettingsProto` specifies a set of batching thresholds, each of - # which acts as a trigger to send a batch of messages as a request. At least - # one threshold must be positive nonzero. - # @!attribute [rw] element_count_threshold - # @return [::Integer] - # The number of elements of a field collected into a batch which, if - # exceeded, causes the batch to be sent. - # @!attribute [rw] request_byte_threshold - # @return [::Integer] - # The aggregated size of the batched field which, if exceeded, causes the - # batch to be sent. This size is computed by aggregating the sizes of the - # request field to be batched, not of the entire request message. - # @!attribute [rw] delay_threshold - # @return [::Google::Protobuf::Duration] - # The duration after which a batch should be sent, starting from the addition - # of the first message to that batch. - # @!attribute [rw] element_count_limit - # @return [::Integer] - # The maximum number of elements collected in a batch that could be accepted - # by server. - # @!attribute [rw] request_byte_limit - # @return [::Integer] - # The maximum size of the request that could be accepted by server. - # @!attribute [rw] flow_control_element_limit - # @return [::Integer] - # The maximum number of elements allowed by flow control. - # @!attribute [rw] flow_control_byte_limit - # @return [::Integer] - # The maximum size of data allowed by flow control. - # @!attribute [rw] flow_control_limit_exceeded_behavior - # @return [::Google::Api::FlowControlLimitExceededBehaviorProto] - # The behavior to take when the flow control limit is exceeded. - class BatchingSettingsProto - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # `BatchingDescriptorProto` specifies the fields of the request message to be - # used for batching, and, optionally, the fields of the response message to be - # used for demultiplexing. - # @!attribute [rw] batched_field - # @return [::String] - # The repeated field in the request message to be aggregated by batching. - # @!attribute [rw] discriminator_fields - # @return [::Array<::String>] - # A list of the fields in the request message. Two requests will be batched - # together only if the values of every field specified in - # `request_discriminator_fields` is equal between the two requests. - # @!attribute [rw] subresponse_field - # @return [::String] - # Optional. When present, indicates the field in the response message to be - # used to demultiplex the response into multiple response messages, in - # correspondence with the multiple request messages originally batched - # together. - class BatchingDescriptorProto - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # The organization for which the client libraries are being published. - # Affects the url where generated docs are published, etc. - module ClientLibraryOrganization - # Not useful. - CLIENT_LIBRARY_ORGANIZATION_UNSPECIFIED = 0 - - # Google Cloud Platform Org. - CLOUD = 1 - - # Ads (Advertising) Org. - ADS = 2 - - # Photos Org. - PHOTOS = 3 - - # Street View Org. - STREET_VIEW = 4 - - # Shopping Org. - SHOPPING = 5 - - # Geo Org. - GEO = 6 - - # Generative AI - https://developers.generativeai.google - GENERATIVE_AI = 7 - end - - # To where should client libraries be published? - module ClientLibraryDestination - # Client libraries will neither be generated nor published to package - # managers. - CLIENT_LIBRARY_DESTINATION_UNSPECIFIED = 0 - - # Generate the client library in a repo under github.com/googleapis, - # but don't publish it to package managers. - GITHUB = 10 - - # Publish the library to package managers like nuget.org and npmjs.com. - PACKAGE_MANAGER = 20 - end - - # The behavior to take when the flow control limit is exceeded. - module FlowControlLimitExceededBehaviorProto - # Default behavior, system-defined. - UNSET_BEHAVIOR = 0 - - # Stop operation, raise error. - THROW_EXCEPTION = 1 - - # Pause operation until limit clears. - BLOCK = 2 - - # Continue operation, disregard limit. - IGNORE = 3 - end - end -end diff --git a/owl-bot-staging/google-cloud-security_center-v1/proto_docs/google/api/field_behavior.rb b/owl-bot-staging/google-cloud-security_center-v1/proto_docs/google/api/field_behavior.rb deleted file mode 100644 index 582be187d115..000000000000 --- a/owl-bot-staging/google-cloud-security_center-v1/proto_docs/google/api/field_behavior.rb +++ /dev/null @@ -1,85 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - - -module Google - module Api - # An indicator of the behavior of a given field (for example, that a field - # is required in requests, or given as output but ignored as input). - # This **does not** change the behavior in protocol buffers itself; it only - # denotes the behavior and may affect how API tooling handles the field. - # - # Note: This enum **may** receive new values in the future. - module FieldBehavior - # Conventional default for enums. Do not use this. - FIELD_BEHAVIOR_UNSPECIFIED = 0 - - # Specifically denotes a field as optional. - # While all fields in protocol buffers are optional, this may be specified - # for emphasis if appropriate. - OPTIONAL = 1 - - # Denotes a field as required. - # This indicates that the field **must** be provided as part of the request, - # and failure to do so will cause an error (usually `INVALID_ARGUMENT`). - REQUIRED = 2 - - # Denotes a field as output only. - # This indicates that the field is provided in responses, but including the - # field in a request does nothing (the server *must* ignore it and - # *must not* throw an error as a result of the field's presence). - OUTPUT_ONLY = 3 - - # Denotes a field as input only. - # This indicates that the field is provided in requests, and the - # corresponding field is not included in output. - INPUT_ONLY = 4 - - # Denotes a field as immutable. - # This indicates that the field may be set once in a request to create a - # resource, but may not be changed thereafter. - IMMUTABLE = 5 - - # Denotes that a (repeated) field is an unordered list. - # This indicates that the service may provide the elements of the list - # in any arbitrary order, rather than the order the user originally - # provided. Additionally, the list's order may or may not be stable. - UNORDERED_LIST = 6 - - # Denotes that this field returns a non-empty default value if not set. - # This indicates that if the user provides the empty value in a request, - # a non-empty value will be returned. The user will not be aware of what - # non-empty value to expect. - NON_EMPTY_DEFAULT = 7 - - # Denotes that the field in a resource (a message annotated with - # google.api.resource) is used in the resource name to uniquely identify the - # resource. For AIP-compliant APIs, this should only be applied to the - # `name` field on the resource. - # - # This behavior should not be applied to references to other resources within - # the message. - # - # The identifier field of resources often have different field behavior - # depending on the request it is embedded in (e.g. for Create methods name - # is optional and unused, while for Update methods it is required). Instead - # of method-specific annotations, only `IDENTIFIER` is required. - IDENTIFIER = 8 - end - end -end diff --git a/owl-bot-staging/google-cloud-security_center-v1/proto_docs/google/api/field_info.rb b/owl-bot-staging/google-cloud-security_center-v1/proto_docs/google/api/field_info.rb deleted file mode 100644 index 0f5acf0a5538..000000000000 --- a/owl-bot-staging/google-cloud-security_center-v1/proto_docs/google/api/field_info.rb +++ /dev/null @@ -1,88 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - - -module Google - module Api - # Rich semantic information of an API field beyond basic typing. - # @!attribute [rw] format - # @return [::Google::Api::FieldInfo::Format] - # The standard format of a field value. This does not explicitly configure - # any API consumer, just documents the API's format for the field it is - # applied to. - # @!attribute [rw] referenced_types - # @return [::Array<::Google::Api::TypeReference>] - # The type(s) that the annotated, generic field may represent. - # - # Currently, this must only be used on fields of type `google.protobuf.Any`. - # Supporting other generic types may be considered in the future. - class FieldInfo - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - - # The standard format of a field value. The supported formats are all backed - # by either an RFC defined by the IETF or a Google-defined AIP. - module Format - # Default, unspecified value. - FORMAT_UNSPECIFIED = 0 - - # Universally Unique Identifier, version 4, value as defined by - # https://datatracker.ietf.org/doc/html/rfc4122. The value may be - # normalized to entirely lowercase letters. For example, the value - # `F47AC10B-58CC-0372-8567-0E02B2C3D479` would be normalized to - # `f47ac10b-58cc-0372-8567-0e02b2c3d479`. - UUID4 = 1 - - # Internet Protocol v4 value as defined by [RFC - # 791](https://datatracker.ietf.org/doc/html/rfc791). The value may be - # condensed, with leading zeros in each octet stripped. For example, - # `001.022.233.040` would be condensed to `1.22.233.40`. - IPV4 = 2 - - # Internet Protocol v6 value as defined by [RFC - # 2460](https://datatracker.ietf.org/doc/html/rfc2460). The value may be - # normalized to entirely lowercase letters with zeros compressed, following - # [RFC 5952](https://datatracker.ietf.org/doc/html/rfc5952). For example, - # the value `2001:0DB8:0::0` would be normalized to `2001:db8::`. - IPV6 = 3 - - # An IP address in either v4 or v6 format as described by the individual - # values defined herein. See the comments on the IPV4 and IPV6 types for - # allowed normalizations of each. - IPV4_OR_IPV6 = 4 - end - end - - # A reference to a message type, for use in {::Google::Api::FieldInfo FieldInfo}. - # @!attribute [rw] type_name - # @return [::String] - # The name of the type that the annotated, generic field may represent. - # If the type is in the same protobuf package, the value can be the simple - # message name e.g., `"MyMessage"`. Otherwise, the value must be the - # fully-qualified message name e.g., `"google.library.v1.Book"`. - # - # If the type(s) are unknown to the service (e.g. the field accepts generic - # user input), use the wildcard `"*"` to denote this behavior. - # - # See [AIP-202](https://google.aip.dev/202#type-references) for more details. - class TypeReference - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - end -end diff --git a/owl-bot-staging/google-cloud-security_center-v1/proto_docs/google/api/launch_stage.rb b/owl-bot-staging/google-cloud-security_center-v1/proto_docs/google/api/launch_stage.rb deleted file mode 100644 index 9392a413fb1b..000000000000 --- a/owl-bot-staging/google-cloud-security_center-v1/proto_docs/google/api/launch_stage.rb +++ /dev/null @@ -1,71 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - - -module Google - module Api - # The launch stage as defined by [Google Cloud Platform - # Launch Stages](https://cloud.google.com/terms/launch-stages). - module LaunchStage - # Do not use this default value. - LAUNCH_STAGE_UNSPECIFIED = 0 - - # The feature is not yet implemented. Users can not use it. - UNIMPLEMENTED = 6 - - # Prelaunch features are hidden from users and are only visible internally. - PRELAUNCH = 7 - - # Early Access features are limited to a closed group of testers. To use - # these features, you must sign up in advance and sign a Trusted Tester - # agreement (which includes confidentiality provisions). These features may - # be unstable, changed in backward-incompatible ways, and are not - # guaranteed to be released. - EARLY_ACCESS = 1 - - # Alpha is a limited availability test for releases before they are cleared - # for widespread use. By Alpha, all significant design issues are resolved - # and we are in the process of verifying functionality. Alpha customers - # need to apply for access, agree to applicable terms, and have their - # projects allowlisted. Alpha releases don't have to be feature complete, - # no SLAs are provided, and there are no technical support obligations, but - # they will be far enough along that customers can actually use them in - # test environments or for limited-use tests -- just like they would in - # normal production cases. - ALPHA = 2 - - # Beta is the point at which we are ready to open a release for any - # customer to use. There are no SLA or technical support obligations in a - # Beta release. Products will be complete from a feature perspective, but - # may have some open outstanding issues. Beta releases are suitable for - # limited production use cases. - BETA = 3 - - # GA features are open to all developers and are considered stable and - # fully qualified for production use. - GA = 4 - - # Deprecated features are scheduled to be shut down and removed. For more - # information, see the "Deprecation Policy" section of our [Terms of - # Service](https://cloud.google.com/terms/) - # and the [Google Cloud Platform Subject to the Deprecation - # Policy](https://cloud.google.com/terms/deprecation) documentation. - DEPRECATED = 5 - end - end -end diff --git a/owl-bot-staging/google-cloud-security_center-v1/proto_docs/google/api/resource.rb b/owl-bot-staging/google-cloud-security_center-v1/proto_docs/google/api/resource.rb deleted file mode 100644 index 25dec4847ac1..000000000000 --- a/owl-bot-staging/google-cloud-security_center-v1/proto_docs/google/api/resource.rb +++ /dev/null @@ -1,227 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - - -module Google - module Api - # A simple descriptor of a resource type. - # - # ResourceDescriptor annotates a resource message (either by means of a - # protobuf annotation or use in the service config), and associates the - # resource's schema, the resource type, and the pattern of the resource name. - # - # Example: - # - # message Topic { - # // Indicates this message defines a resource schema. - # // Declares the resource type in the format of {service}/{kind}. - # // For Kubernetes resources, the format is {api group}/{kind}. - # option (google.api.resource) = { - # type: "pubsub.googleapis.com/Topic" - # pattern: "projects/{project}/topics/{topic}" - # }; - # } - # - # The ResourceDescriptor Yaml config will look like: - # - # resources: - # - type: "pubsub.googleapis.com/Topic" - # pattern: "projects/{project}/topics/{topic}" - # - # Sometimes, resources have multiple patterns, typically because they can - # live under multiple parents. - # - # Example: - # - # message LogEntry { - # option (google.api.resource) = { - # type: "logging.googleapis.com/LogEntry" - # pattern: "projects/{project}/logs/{log}" - # pattern: "folders/{folder}/logs/{log}" - # pattern: "organizations/{organization}/logs/{log}" - # pattern: "billingAccounts/{billing_account}/logs/{log}" - # }; - # } - # - # The ResourceDescriptor Yaml config will look like: - # - # resources: - # - type: 'logging.googleapis.com/LogEntry' - # pattern: "projects/{project}/logs/{log}" - # pattern: "folders/{folder}/logs/{log}" - # pattern: "organizations/{organization}/logs/{log}" - # pattern: "billingAccounts/{billing_account}/logs/{log}" - # @!attribute [rw] type - # @return [::String] - # The resource type. It must be in the format of - # \\{service_name}/\\{resource_type_kind}. The `resource_type_kind` must be - # singular and must not include version numbers. - # - # Example: `storage.googleapis.com/Bucket` - # - # The value of the resource_type_kind must follow the regular expression - # /[A-Za-z][a-zA-Z0-9]+/. It should start with an upper case character and - # should use PascalCase (UpperCamelCase). The maximum number of - # characters allowed for the `resource_type_kind` is 100. - # @!attribute [rw] pattern - # @return [::Array<::String>] - # Optional. The relative resource name pattern associated with this resource - # type. The DNS prefix of the full resource name shouldn't be specified here. - # - # The path pattern must follow the syntax, which aligns with HTTP binding - # syntax: - # - # Template = Segment { "/" Segment } ; - # Segment = LITERAL | Variable ; - # Variable = "{" LITERAL "}" ; - # - # Examples: - # - # - "projects/\\{project}/topics/\\{topic}" - # - "projects/\\{project}/knowledgeBases/\\{knowledge_base}" - # - # The components in braces correspond to the IDs for each resource in the - # hierarchy. It is expected that, if multiple patterns are provided, - # the same component name (e.g. "project") refers to IDs of the same - # type of resource. - # @!attribute [rw] name_field - # @return [::String] - # Optional. The field on the resource that designates the resource name - # field. If omitted, this is assumed to be "name". - # @!attribute [rw] history - # @return [::Google::Api::ResourceDescriptor::History] - # Optional. The historical or future-looking state of the resource pattern. - # - # Example: - # - # // The InspectTemplate message originally only supported resource - # // names with organization, and project was added later. - # message InspectTemplate { - # option (google.api.resource) = { - # type: "dlp.googleapis.com/InspectTemplate" - # pattern: - # "organizations/{organization}/inspectTemplates/{inspect_template}" - # pattern: "projects/{project}/inspectTemplates/{inspect_template}" - # history: ORIGINALLY_SINGLE_PATTERN - # }; - # } - # @!attribute [rw] plural - # @return [::String] - # The plural name used in the resource name and permission names, such as - # 'projects' for the resource name of 'projects/\\{project}' and the permission - # name of 'cloudresourcemanager.googleapis.com/projects.get'. One exception - # to this is for Nested Collections that have stuttering names, as defined - # in [AIP-122](https://google.aip.dev/122#nested-collections), where the - # collection ID in the resource name pattern does not necessarily directly - # match the `plural` value. - # - # It is the same concept of the `plural` field in k8s CRD spec - # https://kubernetes.io/docs/tasks/access-kubernetes-api/custom-resources/custom-resource-definitions/ - # - # Note: The plural form is required even for singleton resources. See - # https://aip.dev/156 - # @!attribute [rw] singular - # @return [::String] - # The same concept of the `singular` field in k8s CRD spec - # https://kubernetes.io/docs/tasks/access-kubernetes-api/custom-resources/custom-resource-definitions/ - # Such as "project" for the `resourcemanager.googleapis.com/Project` type. - # @!attribute [rw] style - # @return [::Array<::Google::Api::ResourceDescriptor::Style>] - # Style flag(s) for this resource. - # These indicate that a resource is expected to conform to a given - # style. See the specific style flags for additional information. - class ResourceDescriptor - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - - # A description of the historical or future-looking state of the - # resource pattern. - module History - # The "unset" value. - HISTORY_UNSPECIFIED = 0 - - # The resource originally had one pattern and launched as such, and - # additional patterns were added later. - ORIGINALLY_SINGLE_PATTERN = 1 - - # The resource has one pattern, but the API owner expects to add more - # later. (This is the inverse of ORIGINALLY_SINGLE_PATTERN, and prevents - # that from being necessary once there are multiple patterns.) - FUTURE_MULTI_PATTERN = 2 - end - - # A flag representing a specific style that a resource claims to conform to. - module Style - # The unspecified value. Do not use. - STYLE_UNSPECIFIED = 0 - - # This resource is intended to be "declarative-friendly". - # - # Declarative-friendly resources must be more strictly consistent, and - # setting this to true communicates to tools that this resource should - # adhere to declarative-friendly expectations. - # - # Note: This is used by the API linter (linter.aip.dev) to enable - # additional checks. - DECLARATIVE_FRIENDLY = 1 - end - end - - # Defines a proto annotation that describes a string field that refers to - # an API resource. - # @!attribute [rw] type - # @return [::String] - # The resource type that the annotated field references. - # - # Example: - # - # message Subscription { - # string topic = 2 [(google.api.resource_reference) = { - # type: "pubsub.googleapis.com/Topic" - # }]; - # } - # - # Occasionally, a field may reference an arbitrary resource. In this case, - # APIs use the special value * in their resource reference. - # - # Example: - # - # message GetIamPolicyRequest { - # string resource = 2 [(google.api.resource_reference) = { - # type: "*" - # }]; - # } - # @!attribute [rw] child_type - # @return [::String] - # The resource type of a child collection that the annotated field - # references. This is useful for annotating the `parent` field that - # doesn't have a fixed resource type. - # - # Example: - # - # message ListLogEntriesRequest { - # string parent = 1 [(google.api.resource_reference) = { - # child_type: "logging.googleapis.com/LogEntry" - # }; - # } - class ResourceReference - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - end -end diff --git a/owl-bot-staging/google-cloud-security_center-v1/proto_docs/google/cloud/securitycenter/v1/access.rb b/owl-bot-staging/google-cloud-security_center-v1/proto_docs/google/cloud/securitycenter/v1/access.rb deleted file mode 100644 index 31e390d3f8a1..000000000000 --- a/owl-bot-staging/google-cloud-security_center-v1/proto_docs/google/cloud/securitycenter/v1/access.rb +++ /dev/null @@ -1,120 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - - -module Google - module Cloud - module SecurityCenter - module V1 - # Represents an access event. - # @!attribute [rw] principal_email - # @return [::String] - # Associated email, such as "foo@google.com". - # - # The email address of the authenticated user or a service account acting on - # behalf of a third party principal making the request. For third party - # identity callers, the `principal_subject` field is populated instead of - # this field. For privacy reasons, the principal email address is sometimes - # redacted. For more information, see [Caller identities in audit - # logs](https://cloud.google.com/logging/docs/audit#user-id). - # @!attribute [rw] caller_ip - # @return [::String] - # Caller's IP address, such as "1.1.1.1". - # @!attribute [rw] caller_ip_geo - # @return [::Google::Cloud::SecurityCenter::V1::Geolocation] - # The caller IP's geolocation, which identifies where the call came from. - # @!attribute [rw] user_agent_family - # @return [::String] - # Type of user agent associated with the finding. For example, an operating - # system shell or an embedded or standalone application. - # @!attribute [rw] user_agent - # @return [::String] - # The caller's user agent string associated with the finding. - # @!attribute [rw] service_name - # @return [::String] - # This is the API service that the service account made a call to, e.g. - # "iam.googleapis.com" - # @!attribute [rw] method_name - # @return [::String] - # The method that the service account called, e.g. "SetIamPolicy". - # @!attribute [rw] principal_subject - # @return [::String] - # A string that represents the principal_subject that is associated with the - # identity. Unlike `principal_email`, `principal_subject` supports principals - # that aren't associated with email addresses, such as third party - # principals. For most identities, the format is - # `principal://iam.googleapis.com/{identity pool name}/subject/{subject}`. - # Some GKE identities, such as GKE_WORKLOAD, FREEFORM, and GKE_HUB_WORKLOAD, - # still use the legacy format `serviceAccount:{identity pool - # name}[\\{subject}]`. - # @!attribute [rw] service_account_key_name - # @return [::String] - # The name of the service account key that was used to create or exchange - # credentials when authenticating the service account that made the request. - # This is a scheme-less URI full resource name. For example: - # - # "//iam.googleapis.com/projects/\\{PROJECT_ID}/serviceAccounts/\\{ACCOUNT}/keys/\\{key}". - # @!attribute [rw] service_account_delegation_info - # @return [::Array<::Google::Cloud::SecurityCenter::V1::ServiceAccountDelegationInfo>] - # The identity delegation history of an authenticated service account that - # made the request. The `serviceAccountDelegationInfo[]` object contains - # information about the real authorities that try to access Google Cloud - # resources by delegating on a service account. When multiple authorities are - # present, they are guaranteed to be sorted based on the original ordering of - # the identity delegation events. - # @!attribute [rw] user_name - # @return [::String] - # A string that represents a username. The username provided depends on the - # type of the finding and is likely not an IAM principal. For example, this - # can be a system username if the finding is related to a virtual machine, or - # it can be an application login username. - class Access - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Identity delegation history of an authenticated service account. - # @!attribute [rw] principal_email - # @return [::String] - # The email address of a Google account. - # @!attribute [rw] principal_subject - # @return [::String] - # A string representing the principal_subject associated with the identity. - # As compared to `principal_email`, supports principals that aren't - # associated with email addresses, such as third party principals. For most - # identities, the format will be `principal://iam.googleapis.com/{identity - # pool name}/subjects/\\{subject}` except for some GKE identities - # (GKE_WORKLOAD, FREEFORM, GKE_HUB_WORKLOAD) that are still in the legacy - # format `serviceAccount:{identity pool name}[{subject}]` - class ServiceAccountDelegationInfo - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Represents a geographical location for a given access. - # @!attribute [rw] region_code - # @return [::String] - # A CLDR. - class Geolocation - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - end - end - end -end diff --git a/owl-bot-staging/google-cloud-security_center-v1/proto_docs/google/cloud/securitycenter/v1/application.rb b/owl-bot-staging/google-cloud-security_center-v1/proto_docs/google/cloud/securitycenter/v1/application.rb deleted file mode 100644 index 219bf34fde42..000000000000 --- a/owl-bot-staging/google-cloud-security_center-v1/proto_docs/google/cloud/securitycenter/v1/application.rb +++ /dev/null @@ -1,40 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - - -module Google - module Cloud - module SecurityCenter - module V1 - # Represents an application associated with a finding. - # @!attribute [rw] base_uri - # @return [::String] - # The base URI that identifies the network location of the application in - # which the vulnerability was detected. For example, `http://example.com`. - # @!attribute [rw] full_uri - # @return [::String] - # The full URI with payload that can be used to reproduce the - # vulnerability. For example, `http://example.com?p=aMmYgI6H`. - class Application - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - end - end - end -end diff --git a/owl-bot-staging/google-cloud-security_center-v1/proto_docs/google/cloud/securitycenter/v1/asset.rb b/owl-bot-staging/google-cloud-security_center-v1/proto_docs/google/cloud/securitycenter/v1/asset.rb deleted file mode 100644 index d04b5a46cc91..000000000000 --- a/owl-bot-staging/google-cloud-security_center-v1/proto_docs/google/cloud/securitycenter/v1/asset.rb +++ /dev/null @@ -1,141 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - - -module Google - module Cloud - module SecurityCenter - module V1 - # Security Command Center representation of a Google Cloud - # resource. - # - # The Asset is a Security Command Center resource that captures information - # about a single Google Cloud resource. All modifications to an Asset are only - # within the context of Security Command Center and don't affect the referenced - # Google Cloud resource. - # @!attribute [rw] name - # @return [::String] - # The relative resource name of this asset. See: - # https://cloud.google.com/apis/design/resource_names#relative_resource_name - # Example: - # "organizations/\\{organization_id}/assets/\\{asset_id}". - # @!attribute [rw] security_center_properties - # @return [::Google::Cloud::SecurityCenter::V1::Asset::SecurityCenterProperties] - # Security Command Center managed properties. These properties are managed by - # Security Command Center and cannot be modified by the user. - # @!attribute [rw] resource_properties - # @return [::Google::Protobuf::Map{::String => ::Google::Protobuf::Value}] - # Resource managed properties. These properties are managed and defined by - # the Google Cloud resource and cannot be modified by the user. - # @!attribute [rw] security_marks - # @return [::Google::Cloud::SecurityCenter::V1::SecurityMarks] - # User specified security marks. These marks are entirely managed by the user - # and come from the SecurityMarks resource that belongs to the asset. - # @!attribute [rw] create_time - # @return [::Google::Protobuf::Timestamp] - # The time at which the asset was created in Security Command Center. - # @!attribute [rw] update_time - # @return [::Google::Protobuf::Timestamp] - # The time at which the asset was last updated or added in Cloud SCC. - # @!attribute [rw] iam_policy - # @return [::Google::Cloud::SecurityCenter::V1::Asset::IamPolicy] - # Cloud IAM Policy information associated with the Google Cloud resource - # described by the Security Command Center asset. This information is managed - # and defined by the Google Cloud resource and cannot be modified by the - # user. - # @!attribute [rw] canonical_name - # @return [::String] - # The canonical name of the resource. It's either - # "organizations/\\{organization_id}/assets/\\{asset_id}", - # "folders/\\{folder_id}/assets/\\{asset_id}" or - # "projects/\\{project_number}/assets/\\{asset_id}", depending on the closest CRM - # ancestor of the resource. - class Asset - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - - # Security Command Center managed properties. These properties are managed by - # Security Command Center and cannot be modified by the user. - # @!attribute [rw] resource_name - # @return [::String] - # The full resource name of the Google Cloud resource this asset - # represents. This field is immutable after create time. See: - # https://cloud.google.com/apis/design/resource_names#full_resource_name - # @!attribute [rw] resource_type - # @return [::String] - # The type of the Google Cloud resource. Examples include: APPLICATION, - # PROJECT, and ORGANIZATION. This is a case insensitive field defined by - # Security Command Center and/or the producer of the resource and is - # immutable after create time. - # @!attribute [rw] resource_parent - # @return [::String] - # The full resource name of the immediate parent of the resource. See: - # https://cloud.google.com/apis/design/resource_names#full_resource_name - # @!attribute [rw] resource_project - # @return [::String] - # The full resource name of the project the resource belongs to. See: - # https://cloud.google.com/apis/design/resource_names#full_resource_name - # @!attribute [rw] resource_owners - # @return [::Array<::String>] - # Owners of the Google Cloud resource. - # @!attribute [rw] resource_display_name - # @return [::String] - # The user defined display name for this resource. - # @!attribute [rw] resource_parent_display_name - # @return [::String] - # The user defined display name for the parent of this resource. - # @!attribute [rw] resource_project_display_name - # @return [::String] - # The user defined display name for the project of this resource. - # @!attribute [rw] folders - # @return [::Array<::Google::Cloud::SecurityCenter::V1::Folder>] - # Contains a Folder message for each folder in the assets ancestry. - # The first folder is the deepest nested folder, and the last folder is the - # folder directly under the Organization. - class SecurityCenterProperties - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Cloud IAM Policy information associated with the Google Cloud resource - # described by the Security Command Center asset. This information is managed - # and defined by the Google Cloud resource and cannot be modified by the - # user. - # @!attribute [rw] policy_blob - # @return [::String] - # The JSON representation of the Policy associated with the asset. - # See https://cloud.google.com/iam/reference/rest/v1/Policy for format - # details. - class IamPolicy - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # @!attribute [rw] key - # @return [::String] - # @!attribute [rw] value - # @return [::Google::Protobuf::Value] - class ResourcePropertiesEntry - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - end - end - end - end -end diff --git a/owl-bot-staging/google-cloud-security_center-v1/proto_docs/google/cloud/securitycenter/v1/attack_exposure.rb b/owl-bot-staging/google-cloud-security_center-v1/proto_docs/google/cloud/securitycenter/v1/attack_exposure.rb deleted file mode 100644 index 51bd94f1fd18..000000000000 --- a/owl-bot-staging/google-cloud-security_center-v1/proto_docs/google/cloud/securitycenter/v1/attack_exposure.rb +++ /dev/null @@ -1,73 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - - -module Google - module Cloud - module SecurityCenter - module V1 - # An attack exposure contains the results of an attack path simulation run. - # @!attribute [rw] score - # @return [::Float] - # A number between 0 (inclusive) and infinity that represents how important - # this finding is to remediate. The higher the score, the more important it - # is to remediate. - # @!attribute [rw] latest_calculation_time - # @return [::Google::Protobuf::Timestamp] - # The most recent time the attack exposure was updated on this finding. - # @!attribute [rw] attack_exposure_result - # @return [::String] - # The resource name of the attack path simulation result that contains the - # details regarding this attack exposure score. - # Example: `organizations/123/simulations/456/attackExposureResults/789` - # @!attribute [rw] state - # @return [::Google::Cloud::SecurityCenter::V1::AttackExposure::State] - # What state this AttackExposure is in. This captures whether or not an - # attack exposure has been calculated or not. - # @!attribute [rw] exposed_high_value_resources_count - # @return [::Integer] - # The number of high value resources that are exposed as a result of this - # finding. - # @!attribute [rw] exposed_medium_value_resources_count - # @return [::Integer] - # The number of medium value resources that are exposed as a result of this - # finding. - # @!attribute [rw] exposed_low_value_resources_count - # @return [::Integer] - # The number of high value resources that are exposed as a result of this - # finding. - class AttackExposure - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - - # This enum defines the various states an AttackExposure can be in. - module State - # The state is not specified. - STATE_UNSPECIFIED = 0 - - # The attack exposure has been calculated. - CALCULATED = 1 - - # The attack exposure has not been calculated. - NOT_CALCULATED = 2 - end - end - end - end - end -end diff --git a/owl-bot-staging/google-cloud-security_center-v1/proto_docs/google/cloud/securitycenter/v1/attack_path.rb b/owl-bot-staging/google-cloud-security_center-v1/proto_docs/google/cloud/securitycenter/v1/attack_path.rb deleted file mode 100644 index 9a78a90341b5..000000000000 --- a/owl-bot-staging/google-cloud-security_center-v1/proto_docs/google/cloud/securitycenter/v1/attack_path.rb +++ /dev/null @@ -1,147 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - - -module Google - module Cloud - module SecurityCenter - module V1 - # A path that an attacker could take to reach an exposed resource. - # @!attribute [rw] name - # @return [::String] - # The attack path name, for example, - # `organizations/12/simulation/34/valuedResources/56/attackPaths/78` - # @!attribute [rw] path_nodes - # @return [::Array<::Google::Cloud::SecurityCenter::V1::AttackPath::AttackPathNode>] - # A list of nodes that exist in this attack path. - # @!attribute [rw] edges - # @return [::Array<::Google::Cloud::SecurityCenter::V1::AttackPath::AttackPathEdge>] - # A list of the edges between nodes in this attack path. - class AttackPath - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - - # Represents one point that an attacker passes through in this attack path. - # @!attribute [rw] resource - # @return [::String] - # The name of the resource at this point in the attack path. - # The format of the name follows the Cloud Asset Inventory [resource - # name - # format](https://cloud.google.com/asset-inventory/docs/resource-name-format) - # @!attribute [rw] resource_type - # @return [::String] - # The [supported resource - # type](https://cloud.google.com/asset-inventory/docs/supported-asset-types) - # @!attribute [rw] display_name - # @return [::String] - # Human-readable name of this resource. - # @!attribute [rw] associated_findings - # @return [::Array<::Google::Cloud::SecurityCenter::V1::AttackPath::AttackPathNode::PathNodeAssociatedFinding>] - # The findings associated with this node in the attack path. - # @!attribute [rw] uuid - # @return [::String] - # Unique id of the attack path node. - # @!attribute [rw] attack_steps - # @return [::Array<::Google::Cloud::SecurityCenter::V1::AttackPath::AttackPathNode::AttackStepNode>] - # A list of attack step nodes that exist in this attack path node. - class AttackPathNode - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - - # A finding that is associated with this node in the attack path. - # @!attribute [rw] canonical_finding - # @return [::String] - # Canonical name of the associated findings. Example: - # `organizations/123/sources/456/findings/789` - # @!attribute [rw] finding_category - # @return [::String] - # The additional taxonomy group within findings from a given source. - # @!attribute [rw] name - # @return [::String] - # Full resource name of the finding. - class PathNodeAssociatedFinding - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Detailed steps the attack can take between path nodes. - # @!attribute [rw] uuid - # @return [::String] - # Unique ID for one Node - # @!attribute [rw] type - # @return [::Google::Cloud::SecurityCenter::V1::AttackPath::AttackPathNode::NodeType] - # Attack step type. Can be either AND, OR or DEFENSE - # @!attribute [rw] display_name - # @return [::String] - # User friendly name of the attack step - # @!attribute [rw] labels - # @return [::Google::Protobuf::Map{::String => ::String}] - # Attack step labels for metadata - # @!attribute [rw] description - # @return [::String] - # Attack step description - class AttackStepNode - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - - # @!attribute [rw] key - # @return [::String] - # @!attribute [rw] value - # @return [::String] - class LabelsEntry - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - end - - # The type of the incoming attack step node. - module NodeType - # Type not specified - NODE_TYPE_UNSPECIFIED = 0 - - # Incoming edge joined with AND - NODE_TYPE_AND = 1 - - # Incoming edge joined with OR - NODE_TYPE_OR = 2 - - # Incoming edge is defense - NODE_TYPE_DEFENSE = 3 - - # Incoming edge is attacker - NODE_TYPE_ATTACKER = 4 - end - end - - # Represents a connection between a source node and a destination node in - # this attack path. - # @!attribute [rw] source - # @return [::String] - # The attack node uuid of the source node. - # @!attribute [rw] destination - # @return [::String] - # The attack node uuid of the destination node. - class AttackPathEdge - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - end - end - end - end -end diff --git a/owl-bot-staging/google-cloud-security_center-v1/proto_docs/google/cloud/securitycenter/v1/backup_disaster_recovery.rb b/owl-bot-staging/google-cloud-security_center-v1/proto_docs/google/cloud/securitycenter/v1/backup_disaster_recovery.rb deleted file mode 100644 index 8f4297aa756e..000000000000 --- a/owl-bot-staging/google-cloud-security_center-v1/proto_docs/google/cloud/securitycenter/v1/backup_disaster_recovery.rb +++ /dev/null @@ -1,90 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - - -module Google - module Cloud - module SecurityCenter - module V1 - # Information related to Google Cloud Backup and DR Service findings. - # @!attribute [rw] backup_template - # @return [::String] - # The name of a Backup and DR template which comprises one or more backup - # policies. See the [Backup and DR - # documentation](https://cloud.google.com/backup-disaster-recovery/docs/concepts/backup-plan#temp) - # for more information. For example, `snap-ov`. - # @!attribute [rw] policies - # @return [::Array<::String>] - # The names of Backup and DR policies that are associated with a template - # and that define when to run a backup, how frequently to run a backup, and - # how long to retain the backup image. For example, `onvaults`. - # @!attribute [rw] host - # @return [::String] - # The name of a Backup and DR host, which is managed by the backup and - # recovery appliance and known to the management console. The host can be of - # type Generic (for example, Compute Engine, SQL Server, Oracle DB, SMB file - # system, etc.), vCenter, or an ESX server. See the [Backup and DR - # documentation on - # hosts](https://cloud.google.com/backup-disaster-recovery/docs/configuration/manage-hosts-and-their-applications) - # for more information. For example, `centos7-01`. - # @!attribute [rw] applications - # @return [::Array<::String>] - # The names of Backup and DR applications. An application is a VM, database, - # or file system on a managed host monitored by a backup and recovery - # appliance. For example, `centos7-01-vol00`, `centos7-01-vol01`, - # `centos7-01-vol02`. - # @!attribute [rw] storage_pool - # @return [::String] - # The name of the Backup and DR storage pool that the backup and recovery - # appliance is storing data in. The storage pool could be of type Cloud, - # Primary, Snapshot, or OnVault. See the [Backup and DR documentation on - # storage - # pools](https://cloud.google.com/backup-disaster-recovery/docs/concepts/storage-pools). - # For example, `DiskPoolOne`. - # @!attribute [rw] policy_options - # @return [::Array<::String>] - # The names of Backup and DR advanced policy options of a policy applying to - # an application. See the [Backup and DR documentation on policy - # options](https://cloud.google.com/backup-disaster-recovery/docs/create-plan/policy-settings). - # For example, `skipofflineappsincongrp, nounmap`. - # @!attribute [rw] profile - # @return [::String] - # The name of the Backup and DR resource profile that specifies the storage - # media for backups of application and VM data. See the [Backup and DR - # documentation on - # profiles](https://cloud.google.com/backup-disaster-recovery/docs/concepts/backup-plan#profile). - # For example, `GCP`. - # @!attribute [rw] appliance - # @return [::String] - # The name of the Backup and DR appliance that captures, moves, and manages - # the lifecycle of backup data. For example, `backup-server-57137`. - # @!attribute [rw] backup_type - # @return [::String] - # The backup type of the Backup and DR image. - # For example, `Snapshot`, `Remote Snapshot`, `OnVault`. - # @!attribute [rw] backup_create_time - # @return [::Google::Protobuf::Timestamp] - # The timestamp at which the Backup and DR backup was created. - class BackupDisasterRecovery - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - end - end - end -end diff --git a/owl-bot-staging/google-cloud-security_center-v1/proto_docs/google/cloud/securitycenter/v1/bigquery_export.rb b/owl-bot-staging/google-cloud-security_center-v1/proto_docs/google/cloud/securitycenter/v1/bigquery_export.rb deleted file mode 100644 index f558699d1218..000000000000 --- a/owl-bot-staging/google-cloud-security_center-v1/proto_docs/google/cloud/securitycenter/v1/bigquery_export.rb +++ /dev/null @@ -1,92 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - - -module Google - module Cloud - module SecurityCenter - module V1 - # Configures how to deliver Findings to BigQuery Instance. - # @!attribute [rw] name - # @return [::String] - # The relative resource name of this export. See: - # https://cloud.google.com/apis/design/resource_names#relative_resource_name. - # Example format: - # "organizations/\\{organization_id}/bigQueryExports/\\{export_id}" Example - # format: "folders/\\{folder_id}/bigQueryExports/\\{export_id}" Example format: - # "projects/\\{project_id}/bigQueryExports/\\{export_id}" - # This field is provided in responses, and is ignored when provided in create - # requests. - # @!attribute [rw] description - # @return [::String] - # The description of the export (max of 1024 characters). - # @!attribute [rw] filter - # @return [::String] - # Expression that defines the filter to apply across create/update events - # of findings. The expression is a list of zero or more restrictions combined - # via logical operators `AND` and `OR`. Parentheses are supported, and `OR` - # has higher precedence than `AND`. - # - # Restrictions have the form ` ` and may have a - # `-` character in front of them to indicate negation. The fields map to - # those defined in the corresponding resource. - # - # The supported operators are: - # - # * `=` for all value types. - # * `>`, `<`, `>=`, `<=` for integer values. - # * `:`, meaning substring matching, for strings. - # - # The supported value types are: - # - # * string literals in quotes. - # * integer literals without quotes. - # * boolean literals `true` and `false` without quotes. - # @!attribute [rw] dataset - # @return [::String] - # The dataset to write findings' updates to. Its format is - # "projects/[project_id]/datasets/[bigquery_dataset_id]". - # BigQuery Dataset unique ID must contain only letters (a-z, A-Z), numbers - # (0-9), or underscores (_). - # @!attribute [r] create_time - # @return [::Google::Protobuf::Timestamp] - # Output only. The time at which the BigQuery export was created. - # This field is set by the server and will be ignored if provided on export - # on creation. - # @!attribute [r] update_time - # @return [::Google::Protobuf::Timestamp] - # Output only. The most recent time at which the BigQuery export was updated. - # This field is set by the server and will be ignored if provided on export - # creation or update. - # @!attribute [r] most_recent_editor - # @return [::String] - # Output only. Email address of the user who last edited the BigQuery export. - # This field is set by the server and will be ignored if provided on export - # creation or update. - # @!attribute [r] principal - # @return [::String] - # Output only. The service account that needs permission to create table and - # upload data to the BigQuery dataset. - class BigQueryExport - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - end - end - end -end diff --git a/owl-bot-staging/google-cloud-security_center-v1/proto_docs/google/cloud/securitycenter/v1/chokepoint.rb b/owl-bot-staging/google-cloud-security_center-v1/proto_docs/google/cloud/securitycenter/v1/chokepoint.rb deleted file mode 100644 index d16907c3f4b8..000000000000 --- a/owl-bot-staging/google-cloud-security_center-v1/proto_docs/google/cloud/securitycenter/v1/chokepoint.rb +++ /dev/null @@ -1,39 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - - -module Google - module Cloud - module SecurityCenter - module V1 - # Contains details about a chokepoint, which is a resource or resource group - # where high-risk attack paths converge, based on [attack path simulations] - # (https://cloud.google.com/security-command-center/docs/attack-exposure-learn#attack_path_simulations). - # @!attribute [rw] related_findings - # @return [::Array<::String>] - # List of resource names of findings associated with this chokepoint. - # For example, organizations/123/sources/456/findings/789. - # This list will have at most 100 findings. - class Chokepoint - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - end - end - end -end diff --git a/owl-bot-staging/google-cloud-security_center-v1/proto_docs/google/cloud/securitycenter/v1/cloud_armor.rb b/owl-bot-staging/google-cloud-security_center-v1/proto_docs/google/cloud/securitycenter/v1/cloud_armor.rb deleted file mode 100644 index 589ad76bf248..000000000000 --- a/owl-bot-staging/google-cloud-security_center-v1/proto_docs/google/cloud/securitycenter/v1/cloud_armor.rb +++ /dev/null @@ -1,128 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - - -module Google - module Cloud - module SecurityCenter - module V1 - # Fields related to Google Cloud Armor findings. - # @!attribute [rw] security_policy - # @return [::Google::Cloud::SecurityCenter::V1::SecurityPolicy] - # Information about the [Google Cloud Armor security - # policy](https://cloud.google.com/armor/docs/security-policy-overview) - # relevant to the finding. - # @!attribute [rw] requests - # @return [::Google::Cloud::SecurityCenter::V1::Requests] - # Information about incoming requests evaluated by [Google Cloud Armor - # security - # policies](https://cloud.google.com/armor/docs/security-policy-overview). - # @!attribute [rw] adaptive_protection - # @return [::Google::Cloud::SecurityCenter::V1::AdaptiveProtection] - # Information about potential Layer 7 DDoS attacks identified by [Google - # Cloud Armor Adaptive - # Protection](https://cloud.google.com/armor/docs/adaptive-protection-overview). - # @!attribute [rw] attack - # @return [::Google::Cloud::SecurityCenter::V1::Attack] - # Information about DDoS attack volume and classification. - # @!attribute [rw] threat_vector - # @return [::String] - # Distinguish between volumetric & protocol DDoS attack and - # application layer attacks. For example, "L3_4" for Layer 3 and Layer 4 DDoS - # attacks, or "L_7" for Layer 7 DDoS attacks. - # @!attribute [rw] duration - # @return [::Google::Protobuf::Duration] - # Duration of attack from the start until the current moment (updated every 5 - # minutes). - class CloudArmor - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Information about the [Google Cloud Armor security - # policy](https://cloud.google.com/armor/docs/security-policy-overview) - # relevant to the finding. - # @!attribute [rw] name - # @return [::String] - # The name of the Google Cloud Armor security policy, for example, - # "my-security-policy". - # @!attribute [rw] type - # @return [::String] - # The type of Google Cloud Armor security policy for example, 'backend - # security policy', 'edge security policy', 'network edge security policy', - # or 'always-on DDoS protection'. - # @!attribute [rw] preview - # @return [::Boolean] - # Whether or not the associated rule or policy is in preview mode. - class SecurityPolicy - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Information about the requests relevant to the finding. - # @!attribute [rw] ratio - # @return [::Float] - # For 'Increasing deny ratio', the ratio is the denied traffic divided by the - # allowed traffic. For 'Allowed traffic spike', the ratio is the allowed - # traffic in the short term divided by allowed traffic in the long term. - # @!attribute [rw] short_term_allowed - # @return [::Integer] - # Allowed RPS (requests per second) in the short term. - # @!attribute [rw] long_term_allowed - # @return [::Integer] - # Allowed RPS (requests per second) over the long term. - # @!attribute [rw] long_term_denied - # @return [::Integer] - # Denied RPS (requests per second) over the long term. - class Requests - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Information about [Google Cloud Armor Adaptive - # Protection](https://cloud.google.com/armor/docs/cloud-armor-overview#google-cloud-armor-adaptive-protection). - # @!attribute [rw] confidence - # @return [::Float] - # A score of 0 means that there is low confidence that the detected event is - # an actual attack. A score of 1 means that there is high confidence that the - # detected event is an attack. See the [Adaptive Protection - # documentation](https://cloud.google.com/armor/docs/adaptive-protection-overview#configure-alert-tuning) - # for further explanation. - class AdaptiveProtection - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Information about DDoS attack volume and classification. - # @!attribute [rw] volume_pps - # @return [::Integer] - # Total PPS (packets per second) volume of attack. - # @!attribute [rw] volume_bps - # @return [::Integer] - # Total BPS (bytes per second) volume of attack. - # @!attribute [rw] classification - # @return [::String] - # Type of attack, for example, 'SYN-flood', 'NTP-udp', or 'CHARGEN-udp'. - class Attack - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - end - end - end -end diff --git a/owl-bot-staging/google-cloud-security_center-v1/proto_docs/google/cloud/securitycenter/v1/cloud_dlp_data_profile.rb b/owl-bot-staging/google-cloud-security_center-v1/proto_docs/google/cloud/securitycenter/v1/cloud_dlp_data_profile.rb deleted file mode 100644 index 83d9ad22a479..000000000000 --- a/owl-bot-staging/google-cloud-security_center-v1/proto_docs/google/cloud/securitycenter/v1/cloud_dlp_data_profile.rb +++ /dev/null @@ -1,114 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - - -module Google - module Cloud - module SecurityCenter - module V1 - # The [data profile](https://cloud.google.com/dlp/docs/data-profiles) - # associated with the finding. - # @!attribute [rw] data_profile - # @return [::String] - # Name of the data profile, for example, - # `projects/123/locations/europe/tableProfiles/8383929`. - # @!attribute [rw] parent_type - # @return [::Google::Cloud::SecurityCenter::V1::CloudDlpDataProfile::ParentType] - # The resource hierarchy level at which the data profile was generated. - # @!attribute [rw] info_types - # @return [::Array<::Google::Cloud::SecurityCenter::V1::InfoType>] - # Type of information detected by SDP. - # Info type includes name, version and sensitivity of the detected - # information type. - class CloudDlpDataProfile - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - - # Parents for configurations that produce data profile findings. - module ParentType - # Unspecified parent type. - PARENT_TYPE_UNSPECIFIED = 0 - - # Organization-level configurations. - ORGANIZATION = 1 - - # Project-level configurations. - PROJECT = 2 - end - end - - # Type of information detected by the API. - # @!attribute [rw] name - # @return [::String] - # Name of the information type. Either a name of your choosing when - # creating a CustomInfoType, or one of the names listed - # at - # https://cloud.google.com/sensitive-data-protection/docs/infotypes-reference - # when specifying a built-in type. When sending Cloud DLP results to Data - # Catalog, infoType names should conform to the pattern - # `[A-Za-z0-9$_-]{1,64}`. - # @!attribute [rw] version - # @return [::String] - # Optional version name for this InfoType. - # @!attribute [rw] sensitivity_score - # @return [::Google::Cloud::SecurityCenter::V1::SensitivityScore] - # Optional custom sensitivity for this InfoType. - # This only applies to data profiling. - class InfoType - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Score is calculated from of all elements in the data profile. - # A higher level means the data is more sensitive. - # @!attribute [rw] score - # @return [::Google::Cloud::SecurityCenter::V1::SensitivityScore::SensitivityScoreLevel] - # The sensitivity score applied to the resource. - class SensitivityScore - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - - # Various sensitivity score levels for resources. - module SensitivityScoreLevel - # Unused. - SENSITIVITY_SCORE_LEVEL_UNSPECIFIED = 0 - - # No sensitive information detected. The resource isn't publicly - # accessible. - SENSITIVITY_LOW = 10 - - # Unable to determine sensitivity. - SENSITIVITY_UNKNOWN = 12 - - # Medium risk. Contains personally identifiable information (PII), - # potentially sensitive data, or fields with free-text data that are at a - # higher risk of having intermittent sensitive data. Consider limiting - # access. - SENSITIVITY_MODERATE = 20 - - # High risk. Sensitive personally identifiable information (SPII) can be - # present. Exfiltration of data can lead to user data loss. - # Re-identification of users might be possible. Consider limiting usage and - # or removing SPII. - SENSITIVITY_HIGH = 30 - end - end - end - end - end -end diff --git a/owl-bot-staging/google-cloud-security_center-v1/proto_docs/google/cloud/securitycenter/v1/cloud_dlp_inspection.rb b/owl-bot-staging/google-cloud-security_center-v1/proto_docs/google/cloud/securitycenter/v1/cloud_dlp_inspection.rb deleted file mode 100644 index 9faad618c6f4..000000000000 --- a/owl-bot-staging/google-cloud-security_center-v1/proto_docs/google/cloud/securitycenter/v1/cloud_dlp_inspection.rb +++ /dev/null @@ -1,50 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - - -module Google - module Cloud - module SecurityCenter - module V1 - # Details about the Cloud Data Loss Prevention (Cloud DLP) [inspection - # job](https://cloud.google.com/dlp/docs/concepts-job-triggers) that produced - # the finding. - # @!attribute [rw] inspect_job - # @return [::String] - # Name of the inspection job, for example, - # `projects/123/locations/europe/dlpJobs/i-8383929`. - # @!attribute [rw] info_type - # @return [::String] - # The type of information (or - # *[infoType](https://cloud.google.com/dlp/docs/infotypes-reference)*) found, - # for example, `EMAIL_ADDRESS` or `STREET_ADDRESS`. - # @!attribute [rw] info_type_count - # @return [::Integer] - # The number of times Cloud DLP found this infoType within this job - # and resource. - # @!attribute [rw] full_scan - # @return [::Boolean] - # Whether Cloud DLP scanned the complete resource or a sampled subset. - class CloudDlpInspection - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - end - end - end -end diff --git a/owl-bot-staging/google-cloud-security_center-v1/proto_docs/google/cloud/securitycenter/v1/compliance.rb b/owl-bot-staging/google-cloud-security_center-v1/proto_docs/google/cloud/securitycenter/v1/compliance.rb deleted file mode 100644 index 158ef2e388fe..000000000000 --- a/owl-bot-staging/google-cloud-security_center-v1/proto_docs/google/cloud/securitycenter/v1/compliance.rb +++ /dev/null @@ -1,43 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - - -module Google - module Cloud - module SecurityCenter - module V1 - # Contains compliance information about a security standard indicating unmet - # recommendations. - # @!attribute [rw] standard - # @return [::String] - # Industry-wide compliance standards or benchmarks, such as CIS, PCI, and - # OWASP. - # @!attribute [rw] version - # @return [::String] - # Version of the standard or benchmark, for example, 1.1 - # @!attribute [rw] ids - # @return [::Array<::String>] - # Policies within the standard or benchmark, for example, A.12.4.1 - class Compliance - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - end - end - end -end diff --git a/owl-bot-staging/google-cloud-security_center-v1/proto_docs/google/cloud/securitycenter/v1/connection.rb b/owl-bot-staging/google-cloud-security_center-v1/proto_docs/google/cloud/securitycenter/v1/connection.rb deleted file mode 100644 index b44d3c237ea7..000000000000 --- a/owl-bot-staging/google-cloud-security_center-v1/proto_docs/google/cloud/securitycenter/v1/connection.rb +++ /dev/null @@ -1,70 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - - -module Google - module Cloud - module SecurityCenter - module V1 - # Contains information about the IP connection associated with the finding. - # @!attribute [rw] destination_ip - # @return [::String] - # Destination IP address. Not present for sockets that are listening and not - # connected. - # @!attribute [rw] destination_port - # @return [::Integer] - # Destination port. Not present for sockets that are listening and not - # connected. - # @!attribute [rw] source_ip - # @return [::String] - # Source IP address. - # @!attribute [rw] source_port - # @return [::Integer] - # Source port. - # @!attribute [rw] protocol - # @return [::Google::Cloud::SecurityCenter::V1::Connection::Protocol] - # IANA Internet Protocol Number such as TCP(6) and UDP(17). - class Connection - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - - # IANA Internet Protocol Number such as TCP(6) and UDP(17). - module Protocol - # Unspecified protocol (not HOPOPT). - PROTOCOL_UNSPECIFIED = 0 - - # Internet Control Message Protocol. - ICMP = 1 - - # Transmission Control Protocol. - TCP = 6 - - # User Datagram Protocol. - UDP = 17 - - # Generic Routing Encapsulation. - GRE = 47 - - # Encap Security Payload. - ESP = 50 - end - end - end - end - end -end diff --git a/owl-bot-staging/google-cloud-security_center-v1/proto_docs/google/cloud/securitycenter/v1/contact_details.rb b/owl-bot-staging/google-cloud-security_center-v1/proto_docs/google/cloud/securitycenter/v1/contact_details.rb deleted file mode 100644 index de91713678d6..000000000000 --- a/owl-bot-staging/google-cloud-security_center-v1/proto_docs/google/cloud/securitycenter/v1/contact_details.rb +++ /dev/null @@ -1,44 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - - -module Google - module Cloud - module SecurityCenter - module V1 - # Details about specific contacts - # @!attribute [rw] contacts - # @return [::Array<::Google::Cloud::SecurityCenter::V1::Contact>] - # A list of contacts - class ContactDetails - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # The email address of a contact. - # @!attribute [rw] email - # @return [::String] - # An email address. For example, "`person123@company.com`". - class Contact - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - end - end - end -end diff --git a/owl-bot-staging/google-cloud-security_center-v1/proto_docs/google/cloud/securitycenter/v1/container.rb b/owl-bot-staging/google-cloud-security_center-v1/proto_docs/google/cloud/securitycenter/v1/container.rb deleted file mode 100644 index acc0a1015fa9..000000000000 --- a/owl-bot-staging/google-cloud-security_center-v1/proto_docs/google/cloud/securitycenter/v1/container.rb +++ /dev/null @@ -1,49 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - - -module Google - module Cloud - module SecurityCenter - module V1 - # Container associated with the finding. - # @!attribute [rw] name - # @return [::String] - # Name of the container. - # @!attribute [rw] uri - # @return [::String] - # Container image URI provided when configuring a pod or container. This - # string can identify a container image version using mutable tags. - # @!attribute [rw] image_id - # @return [::String] - # Optional container image ID, if provided by the container runtime. Uniquely - # identifies the container image launched using a container image digest. - # @!attribute [rw] labels - # @return [::Array<::Google::Cloud::SecurityCenter::V1::Label>] - # Container labels, as provided by the container runtime. - # @!attribute [rw] create_time - # @return [::Google::Protobuf::Timestamp] - # The time that the container was created. - class Container - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - end - end - end -end diff --git a/owl-bot-staging/google-cloud-security_center-v1/proto_docs/google/cloud/securitycenter/v1/database.rb b/owl-bot-staging/google-cloud-security_center-v1/proto_docs/google/cloud/securitycenter/v1/database.rb deleted file mode 100644 index 2294178aef6c..000000000000 --- a/owl-bot-staging/google-cloud-security_center-v1/proto_docs/google/cloud/securitycenter/v1/database.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 Cloud - module SecurityCenter - module V1 - # Represents database access information, such as queries. A database may be a - # sub-resource of an instance (as in the case of Cloud SQL instances or Cloud - # Spanner instances), or the database instance itself. Some database resources - # might not have the [full resource - # name](https://google.aip.dev/122#full-resource-names) populated because these - # resource types, such as Cloud SQL databases, are not yet supported by Cloud - # Asset Inventory. In these cases only the display name is provided. - # @!attribute [rw] name - # @return [::String] - # Some database resources may not have the [full resource - # name](https://google.aip.dev/122#full-resource-names) populated because - # these resource types are not yet supported by Cloud Asset Inventory (e.g. - # Cloud SQL databases). In these cases only the display name will be - # provided. - # The [full resource name](https://google.aip.dev/122#full-resource-names) of - # the database that the user connected to, if it is supported by Cloud Asset - # Inventory. - # @!attribute [rw] display_name - # @return [::String] - # The human-readable name of the database that the user connected to. - # @!attribute [rw] user_name - # @return [::String] - # The username used to connect to the database. The username might not be an - # IAM principal and does not have a set format. - # @!attribute [rw] query - # @return [::String] - # The SQL statement that is associated with the database access. - # @!attribute [rw] grantees - # @return [::Array<::String>] - # The target usernames, roles, or groups of an SQL privilege grant, which is - # not an IAM policy change. - # @!attribute [rw] version - # @return [::String] - # The version of the database, for example, POSTGRES_14. - # See [the complete - # list](https://cloud.google.com/sql/docs/mysql/admin-api/rest/v1/SqlDatabaseVersion). - class Database - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - end - end - end -end diff --git a/owl-bot-staging/google-cloud-security_center-v1/proto_docs/google/cloud/securitycenter/v1/effective_event_threat_detection_custom_module.rb b/owl-bot-staging/google-cloud-security_center-v1/proto_docs/google/cloud/securitycenter/v1/effective_event_threat_detection_custom_module.rb deleted file mode 100644 index 06a03cf035f5..000000000000 --- a/owl-bot-staging/google-cloud-security_center-v1/proto_docs/google/cloud/securitycenter/v1/effective_event_threat_detection_custom_module.rb +++ /dev/null @@ -1,77 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - - -module Google - module Cloud - module SecurityCenter - module V1 - # An EffectiveEventThreatDetectionCustomModule is the representation of - # an Event Threat Detection custom module at a specified level of the - # resource hierarchy: organization, folder, or project. If a custom module is - # inherited from a parent organization or folder, the value of the - # `enablement_state` property in EffectiveEventThreatDetectionCustomModule is - # set to the value that is effective in the parent, instead of `INHERITED`. - # For example, if the module is enabled in a parent organization or folder, the - # effective `enablement_state` for the module in all child folders or projects - # is also `enabled`. EffectiveEventThreatDetectionCustomModule is read-only. - # @!attribute [r] name - # @return [::String] - # Output only. The resource name of the effective ETD custom module. - # - # Its format is: - # - # * `organizations/{organization}/eventThreatDetectionSettings/effectiveCustomModules/{module}`. - # * `folders/{folder}/eventThreatDetectionSettings/effectiveCustomModules/{module}`. - # * `projects/{project}/eventThreatDetectionSettings/effectiveCustomModules/{module}`. - # @!attribute [r] config - # @return [::Google::Protobuf::Struct] - # Output only. Config for the effective module. - # @!attribute [r] enablement_state - # @return [::Google::Cloud::SecurityCenter::V1::EffectiveEventThreatDetectionCustomModule::EnablementState] - # Output only. The effective state of enablement for the module at the given - # level of the hierarchy. - # @!attribute [r] type - # @return [::String] - # Output only. Type for the module. e.g. CONFIGURABLE_BAD_IP. - # @!attribute [r] display_name - # @return [::String] - # Output only. The human readable name to be displayed for the module. - # @!attribute [r] description - # @return [::String] - # Output only. The description for the module. - class EffectiveEventThreatDetectionCustomModule - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - - # The enablement state of the module. - module EnablementState - # Unspecified enablement state. - ENABLEMENT_STATE_UNSPECIFIED = 0 - - # The module is enabled at the given level. - ENABLED = 1 - - # The module is disabled at the given level. - DISABLED = 2 - end - end - end - end - end -end diff --git a/owl-bot-staging/google-cloud-security_center-v1/proto_docs/google/cloud/securitycenter/v1/effective_security_health_analytics_custom_module.rb b/owl-bot-staging/google-cloud-security_center-v1/proto_docs/google/cloud/securitycenter/v1/effective_security_health_analytics_custom_module.rb deleted file mode 100644 index 83aab7af710b..000000000000 --- a/owl-bot-staging/google-cloud-security_center-v1/proto_docs/google/cloud/securitycenter/v1/effective_security_health_analytics_custom_module.rb +++ /dev/null @@ -1,73 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - - -module Google - module Cloud - module SecurityCenter - module V1 - # An EffectiveSecurityHealthAnalyticsCustomModule is the representation of - # a Security Health Analytics custom module at a specified level of the - # resource hierarchy: organization, folder, or project. If a custom module is - # inherited from a parent organization or folder, the value of the - # `enablementState` property in EffectiveSecurityHealthAnalyticsCustomModule is - # set to the value that is effective in the parent, instead of `INHERITED`. - # For example, if the module is enabled in a parent organization or folder, the - # effective enablement_state for the module in all child folders or projects is - # also `enabled`. EffectiveSecurityHealthAnalyticsCustomModule is read-only. - # @!attribute [r] name - # @return [::String] - # Output only. The resource name of the custom module. - # Its format is - # "organizations/\\{organization}/securityHealthAnalyticsSettings/effectiveCustomModules/\\{customModule}", - # or - # "folders/\\{folder}/securityHealthAnalyticsSettings/effectiveCustomModules/\\{customModule}", - # or - # "projects/\\{project}/securityHealthAnalyticsSettings/effectiveCustomModules/\\{customModule}" - # @!attribute [r] custom_config - # @return [::Google::Cloud::SecurityCenter::V1::CustomConfig] - # Output only. The user-specified configuration for the module. - # @!attribute [r] enablement_state - # @return [::Google::Cloud::SecurityCenter::V1::EffectiveSecurityHealthAnalyticsCustomModule::EnablementState] - # Output only. The effective state of enablement for the module at the given - # level of the hierarchy. - # @!attribute [r] display_name - # @return [::String] - # Output only. The display name for the custom module. The name must be - # between 1 and 128 characters, start with a lowercase letter, and contain - # alphanumeric characters or underscores only. - class EffectiveSecurityHealthAnalyticsCustomModule - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - - # The enablement state of the module. - module EnablementState - # Unspecified enablement state. - ENABLEMENT_STATE_UNSPECIFIED = 0 - - # The module is enabled at the given level. - ENABLED = 1 - - # The module is disabled at the given level. - DISABLED = 2 - end - end - end - end - end -end diff --git a/owl-bot-staging/google-cloud-security_center-v1/proto_docs/google/cloud/securitycenter/v1/event_threat_detection_custom_module.rb b/owl-bot-staging/google-cloud-security_center-v1/proto_docs/google/cloud/securitycenter/v1/event_threat_detection_custom_module.rb deleted file mode 100644 index e5b28d560c27..000000000000 --- a/owl-bot-staging/google-cloud-security_center-v1/proto_docs/google/cloud/securitycenter/v1/event_threat_detection_custom_module.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 Cloud - module SecurityCenter - module V1 - # Represents an instance of an Event Threat Detection custom module, - # including its full module name, display name, enablement state, and last - # updated time. You can create a custom module at the organization, folder, or - # project level. Custom modules that you create at the organization or folder - # level are inherited by child folders and projects. - # @!attribute [rw] name - # @return [::String] - # Immutable. The resource name of the Event Threat Detection custom module. - # - # Its format is: - # - # * `organizations/{organization}/eventThreatDetectionSettings/customModules/{module}`. - # * `folders/{folder}/eventThreatDetectionSettings/customModules/{module}`. - # * `projects/{project}/eventThreatDetectionSettings/customModules/{module}`. - # @!attribute [rw] config - # @return [::Google::Protobuf::Struct] - # Config for the module. For the resident module, its config value is defined - # at this level. For the inherited module, its config value is inherited from - # the ancestor module. - # @!attribute [r] ancestor_module - # @return [::String] - # Output only. The closest ancestor module that this module inherits the - # enablement state from. The format is the same as the - # EventThreatDetectionCustomModule resource name. - # @!attribute [rw] enablement_state - # @return [::Google::Cloud::SecurityCenter::V1::EventThreatDetectionCustomModule::EnablementState] - # The state of enablement for the module at the given level of the hierarchy. - # @!attribute [rw] type - # @return [::String] - # Type for the module. e.g. CONFIGURABLE_BAD_IP. - # @!attribute [rw] display_name - # @return [::String] - # The human readable name to be displayed for the module. - # @!attribute [rw] description - # @return [::String] - # The description for the module. - # @!attribute [r] update_time - # @return [::Google::Protobuf::Timestamp] - # Output only. The time the module was last updated. - # @!attribute [r] last_editor - # @return [::String] - # Output only. The editor the module was last updated by. - class EventThreatDetectionCustomModule - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - - # The enablement state of the module. - module EnablementState - # Unspecified enablement state. - ENABLEMENT_STATE_UNSPECIFIED = 0 - - # The module is enabled at the given level. - ENABLED = 1 - - # The module is disabled at the given level. - DISABLED = 2 - - # When the enablement state is inherited. - INHERITED = 3 - end - end - end - end - end -end diff --git a/owl-bot-staging/google-cloud-security_center-v1/proto_docs/google/cloud/securitycenter/v1/event_threat_detection_custom_module_validation_errors.rb b/owl-bot-staging/google-cloud-security_center-v1/proto_docs/google/cloud/securitycenter/v1/event_threat_detection_custom_module_validation_errors.rb deleted file mode 100644 index 0751dbe51e9a..000000000000 --- a/owl-bot-staging/google-cloud-security_center-v1/proto_docs/google/cloud/securitycenter/v1/event_threat_detection_custom_module_validation_errors.rb +++ /dev/null @@ -1,69 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - - -module Google - module Cloud - module SecurityCenter - module V1 - # A list of zero or more errors encountered while validating the uploaded - # configuration of an Event Threat Detection Custom Module. - # @!attribute [rw] errors - # @return [::Array<::Google::Cloud::SecurityCenter::V1::CustomModuleValidationError>] - class CustomModuleValidationErrors - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # An error encountered while validating the uploaded configuration of an - # Event Threat Detection Custom Module. - # @!attribute [rw] description - # @return [::String] - # A description of the error, suitable for human consumption. Required. - # @!attribute [rw] field_path - # @return [::String] - # The path, in RFC 8901 JSON Pointer format, to the field that failed - # validation. This may be left empty if no specific field is affected. - # @!attribute [rw] start - # @return [::Google::Cloud::SecurityCenter::V1::Position] - # The initial position of the error in the uploaded text version of the - # module. This field may be omitted if no specific position applies, or if - # one could not be computed. - # @!attribute [rw] end - # @return [::Google::Cloud::SecurityCenter::V1::Position] - # The end position of the error in the uploaded text version of the - # module. This field may be omitted if no specific position applies, or if - # one could not be computed.. - class CustomModuleValidationError - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # A position in the uploaded text version of a module. - # @!attribute [rw] line_number - # @return [::Integer] - # @!attribute [rw] column_number - # @return [::Integer] - class Position - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - end - end - end -end diff --git a/owl-bot-staging/google-cloud-security_center-v1/proto_docs/google/cloud/securitycenter/v1/exfiltration.rb b/owl-bot-staging/google-cloud-security_center-v1/proto_docs/google/cloud/securitycenter/v1/exfiltration.rb deleted file mode 100644 index 718388b29179..000000000000 --- a/owl-bot-staging/google-cloud-security_center-v1/proto_docs/google/cloud/securitycenter/v1/exfiltration.rb +++ /dev/null @@ -1,64 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - - -module Google - module Cloud - module SecurityCenter - module V1 - # Exfiltration represents a data exfiltration attempt from one or more sources - # to one or more targets. The `sources` attribute lists the sources of the - # exfiltrated data. The `targets` attribute lists the destinations the data was - # copied to. - # @!attribute [rw] sources - # @return [::Array<::Google::Cloud::SecurityCenter::V1::ExfilResource>] - # If there are multiple sources, then the data is considered "joined" between - # them. For instance, BigQuery can join multiple tables, and each - # table would be considered a source. - # @!attribute [rw] targets - # @return [::Array<::Google::Cloud::SecurityCenter::V1::ExfilResource>] - # If there are multiple targets, each target would get a complete copy of the - # "joined" source data. - # @!attribute [rw] total_exfiltrated_bytes - # @return [::Integer] - # Total exfiltrated bytes processed for the entire job. - class Exfiltration - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Resource where data was exfiltrated from or exfiltrated to. - # @!attribute [rw] name - # @return [::String] - # The resource's [full resource - # name](https://cloud.google.com/apis/design/resource_names#full_resource_name). - # @!attribute [rw] components - # @return [::Array<::String>] - # Subcomponents of the asset that was exfiltrated, like URIs used during - # exfiltration, table names, databases, and filenames. For example, multiple - # tables might have been exfiltrated from the same Cloud SQL instance, or - # multiple files might have been exfiltrated from the same Cloud Storage - # bucket. - class ExfilResource - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - end - end - end -end diff --git a/owl-bot-staging/google-cloud-security_center-v1/proto_docs/google/cloud/securitycenter/v1/external_exposure.rb b/owl-bot-staging/google-cloud-security_center-v1/proto_docs/google/cloud/securitycenter/v1/external_exposure.rb deleted file mode 100644 index 8b10d2880776..000000000000 --- a/owl-bot-staging/google-cloud-security_center-v1/proto_docs/google/cloud/securitycenter/v1/external_exposure.rb +++ /dev/null @@ -1,77 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - - -module Google - module Cloud - module SecurityCenter - module V1 - # Details about the externally exposed resource associated with the finding. - # @!attribute [rw] private_ip_address - # @return [::String] - # Private IP address of the exposed endpoint. - # @!attribute [rw] private_port - # @return [::String] - # Port number associated with private IP address. - # @!attribute [rw] exposed_service - # @return [::String] - # The name and version of the service, for example, "Jupyter - # Notebook 6.14.0". - # @!attribute [rw] public_ip_address - # @return [::String] - # Public IP address of the exposed endpoint. - # @!attribute [rw] public_port - # @return [::String] - # Public port number of the exposed endpoint. - # @!attribute [rw] exposed_endpoint - # @return [::String] - # The resource which is running the exposed service, for example, - # "//compute.googleapis.com/projects/\\{project-id}/zones/\\{zone}/instances/\\{instance}.” - # @!attribute [rw] load_balancer_firewall_policy - # @return [::String] - # The full resource name of the load balancer firewall policy, for example, - # "//compute.googleapis.com/projects/\\{project-id}/global/firewallPolicies/\\{policy-name}". - # @!attribute [rw] service_firewall_policy - # @return [::String] - # The full resource name of the firewall policy of the exposed service, for - # example, - # "//compute.googleapis.com/projects/\\{project-id}/global/firewallPolicies/\\{policy-name}". - # @!attribute [rw] forwarding_rule - # @return [::String] - # The full resource name of the forwarding rule, for example, - # "//compute.googleapis.com/projects/\\{project-id}/global/forwardingRules/\\{forwarding-rule-name}". - # @!attribute [rw] backend_service - # @return [::String] - # The full resource name of load balancer backend service, for example, - # "//compute.googleapis.com/projects/\\{project-id}/global/backendServices/\\{name}". - # @!attribute [rw] instance_group - # @return [::String] - # The full resource name of the instance group, for example, - # "//compute.googleapis.com/projects/\\{project-id}/global/instanceGroups/\\{name}". - # @!attribute [rw] network_endpoint_group - # @return [::String] - # The full resource name of the network endpoint group, for example, - # "//compute.googleapis.com/projects/\\{project-id}/global/networkEndpointGroups/\\{name}". - class ExternalExposure - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - end - end - end -end diff --git a/owl-bot-staging/google-cloud-security_center-v1/proto_docs/google/cloud/securitycenter/v1/external_system.rb b/owl-bot-staging/google-cloud-security_center-v1/proto_docs/google/cloud/securitycenter/v1/external_system.rb deleted file mode 100644 index 9a0f33c8a79a..000000000000 --- a/owl-bot-staging/google-cloud-security_center-v1/proto_docs/google/cloud/securitycenter/v1/external_system.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 Cloud - module SecurityCenter - module V1 - # Representation of third party SIEM/SOAR fields within SCC. - # @!attribute [rw] name - # @return [::String] - # Full resource name of the external system, for example: - # "organizations/1234/sources/5678/findings/123456/externalSystems/jira", - # "folders/1234/sources/5678/findings/123456/externalSystems/jira", - # "projects/1234/sources/5678/findings/123456/externalSystems/jira" - # @!attribute [rw] assignees - # @return [::Array<::String>] - # References primary/secondary etc assignees in the external system. - # @!attribute [rw] external_uid - # @return [::String] - # The identifier that's used to track the finding's corresponding case in the - # external system. - # @!attribute [rw] status - # @return [::String] - # The most recent status of the finding's corresponding case, as reported by - # the external system. - # @!attribute [rw] external_system_update_time - # @return [::Google::Protobuf::Timestamp] - # The time when the case was last updated, as reported by the external - # system. - # @!attribute [rw] case_uri - # @return [::String] - # The link to the finding's corresponding case in the external system. - # @!attribute [rw] case_priority - # @return [::String] - # The priority of the finding's corresponding case in the external system. - # @!attribute [rw] case_sla - # @return [::Google::Protobuf::Timestamp] - # The SLA of the finding's corresponding case in the external system. - # @!attribute [rw] case_create_time - # @return [::Google::Protobuf::Timestamp] - # The time when the case was created, as reported by the external system. - # @!attribute [rw] case_close_time - # @return [::Google::Protobuf::Timestamp] - # The time when the case was closed, as reported by the external system. - # @!attribute [rw] ticket_info - # @return [::Google::Cloud::SecurityCenter::V1::ExternalSystem::TicketInfo] - # Information about the ticket, if any, that is being used to track the - # resolution of the issue that is identified by this finding. - class ExternalSystem - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - - # Information about the ticket, if any, that is being used to track the - # resolution of the issue that is identified by this finding. - # @!attribute [rw] id - # @return [::String] - # The identifier of the ticket in the ticket system. - # @!attribute [rw] assignee - # @return [::String] - # The assignee of the ticket in the ticket system. - # @!attribute [rw] description - # @return [::String] - # The description of the ticket in the ticket system. - # @!attribute [rw] uri - # @return [::String] - # The link to the ticket in the ticket system. - # @!attribute [rw] status - # @return [::String] - # The latest status of the ticket, as reported by the ticket system. - # @!attribute [rw] update_time - # @return [::Google::Protobuf::Timestamp] - # The time when the ticket was last updated, as reported by the ticket - # system. - class TicketInfo - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - end - end - end - end -end diff --git a/owl-bot-staging/google-cloud-security_center-v1/proto_docs/google/cloud/securitycenter/v1/file.rb b/owl-bot-staging/google-cloud-security_center-v1/proto_docs/google/cloud/securitycenter/v1/file.rb deleted file mode 100644 index 7e7468407e6a..000000000000 --- a/owl-bot-staging/google-cloud-security_center-v1/proto_docs/google/cloud/securitycenter/v1/file.rb +++ /dev/null @@ -1,72 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - - -module Google - module Cloud - module SecurityCenter - module V1 - # File information about the related binary/library used by an executable, or - # the script used by a script interpreter - # @!attribute [rw] path - # @return [::String] - # Absolute path of the file as a JSON encoded string. - # @!attribute [rw] size - # @return [::Integer] - # Size of the file in bytes. - # @!attribute [rw] sha256 - # @return [::String] - # SHA256 hash of the first hashed_size bytes of the file encoded as a - # hex string. If hashed_size == size, sha256 represents the SHA256 hash - # of the entire file. - # @!attribute [rw] hashed_size - # @return [::Integer] - # The length in bytes of the file prefix that was hashed. If - # hashed_size == size, any hashes reported represent the entire - # file. - # @!attribute [rw] partially_hashed - # @return [::Boolean] - # True when the hash covers only a prefix of the file. - # @!attribute [rw] contents - # @return [::String] - # Prefix of the file contents as a JSON-encoded string. - # @!attribute [rw] disk_path - # @return [::Google::Cloud::SecurityCenter::V1::File::DiskPath] - # Path of the file in terms of underlying disk/partition identifiers. - class File - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - - # Path of the file in terms of underlying disk/partition identifiers. - # @!attribute [rw] partition_uuid - # @return [::String] - # UUID of the partition (format - # https://wiki.archlinux.org/title/persistent_block_device_naming#by-uuid) - # @!attribute [rw] relative_path - # @return [::String] - # Relative path of the file in the partition as a JSON encoded string. - # Example: /home/user1/executable_file.sh - class DiskPath - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - end - end - end - end -end diff --git a/owl-bot-staging/google-cloud-security_center-v1/proto_docs/google/cloud/securitycenter/v1/finding.rb b/owl-bot-staging/google-cloud-security_center-v1/proto_docs/google/cloud/securitycenter/v1/finding.rb deleted file mode 100644 index 0ca04a21cd53..000000000000 --- a/owl-bot-staging/google-cloud-security_center-v1/proto_docs/google/cloud/securitycenter/v1/finding.rb +++ /dev/null @@ -1,477 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - - -module Google - module Cloud - module SecurityCenter - module V1 - # Security Command Center finding. - # - # A finding is a record of assessment data like security, risk, health, or - # privacy, that is ingested into Security Command Center for presentation, - # notification, analysis, policy testing, and enforcement. For example, a - # cross-site scripting (XSS) vulnerability in an App Engine application is a - # finding. - # @!attribute [rw] name - # @return [::String] - # The [relative resource - # name](https://cloud.google.com/apis/design/resource_names#relative_resource_name) - # of the finding. Example: - # "organizations/\\{organization_id}/sources/\\{source_id}/findings/\\{finding_id}", - # "folders/\\{folder_id}/sources/\\{source_id}/findings/\\{finding_id}", - # "projects/\\{project_id}/sources/\\{source_id}/findings/\\{finding_id}". - # @!attribute [rw] parent - # @return [::String] - # The relative resource name of the source the finding belongs to. See: - # https://cloud.google.com/apis/design/resource_names#relative_resource_name - # This field is immutable after creation time. - # For example: - # "organizations/\\{organization_id}/sources/\\{source_id}" - # @!attribute [rw] resource_name - # @return [::String] - # For findings on Google Cloud resources, the full resource - # name of the Google Cloud resource this finding is for. See: - # https://cloud.google.com/apis/design/resource_names#full_resource_name - # When the finding is for a non-Google Cloud resource, the resourceName can - # be a customer or partner defined string. This field is immutable after - # creation time. - # @!attribute [rw] state - # @return [::Google::Cloud::SecurityCenter::V1::Finding::State] - # The state of the finding. - # @!attribute [rw] category - # @return [::String] - # The additional taxonomy group within findings from a given source. - # This field is immutable after creation time. - # Example: "XSS_FLASH_INJECTION" - # @!attribute [rw] external_uri - # @return [::String] - # The URI that, if available, points to a web page outside of Security - # Command Center where additional information about the finding can be found. - # This field is guaranteed to be either empty or a well formed URL. - # @!attribute [rw] source_properties - # @return [::Google::Protobuf::Map{::String => ::Google::Protobuf::Value}] - # Source specific properties. These properties are managed by the source - # that writes the finding. The key names in the source_properties map must be - # between 1 and 255 characters, and must start with a letter and contain - # alphanumeric characters or underscores only. - # @!attribute [r] security_marks - # @return [::Google::Cloud::SecurityCenter::V1::SecurityMarks] - # Output only. User specified security marks. These marks are entirely - # managed by the user and come from the SecurityMarks resource that belongs - # to the finding. - # @!attribute [rw] event_time - # @return [::Google::Protobuf::Timestamp] - # The time the finding was first detected. If an existing finding is updated, - # then this is the time the update occurred. - # For example, if the finding represents an open firewall, this property - # captures the time the detector believes the firewall became open. The - # accuracy is determined by the detector. If the finding is later resolved, - # then this time reflects when the finding was resolved. This must not - # be set to a value greater than the current timestamp. - # @!attribute [rw] create_time - # @return [::Google::Protobuf::Timestamp] - # The time at which the finding was created in Security Command Center. - # @!attribute [rw] severity - # @return [::Google::Cloud::SecurityCenter::V1::Finding::Severity] - # The severity of the finding. This field is managed by the source that - # writes the finding. - # @!attribute [rw] canonical_name - # @return [::String] - # The canonical name of the finding. It's either - # "organizations/\\{organization_id}/sources/\\{source_id}/findings/\\{finding_id}", - # "folders/\\{folder_id}/sources/\\{source_id}/findings/\\{finding_id}" or - # "projects/\\{project_number}/sources/\\{source_id}/findings/\\{finding_id}", - # depending on the closest CRM ancestor of the resource associated with the - # finding. - # @!attribute [rw] mute - # @return [::Google::Cloud::SecurityCenter::V1::Finding::Mute] - # Indicates the mute state of a finding (either muted, unmuted - # or undefined). Unlike other attributes of a finding, a finding provider - # shouldn't set the value of mute. - # @!attribute [rw] finding_class - # @return [::Google::Cloud::SecurityCenter::V1::Finding::FindingClass] - # The class of the finding. - # @!attribute [rw] indicator - # @return [::Google::Cloud::SecurityCenter::V1::Indicator] - # Represents what's commonly known as an *indicator of compromise* (IoC) in - # computer forensics. This is an artifact observed on a network or in an - # operating system that, with high confidence, indicates a computer - # intrusion. For more information, see [Indicator of - # compromise](https://en.wikipedia.org/wiki/Indicator_of_compromise). - # @!attribute [rw] vulnerability - # @return [::Google::Cloud::SecurityCenter::V1::Vulnerability] - # Represents vulnerability-specific fields like CVE and CVSS scores. - # CVE stands for Common Vulnerabilities and Exposures - # (https://cve.mitre.org/about/) - # @!attribute [r] mute_update_time - # @return [::Google::Protobuf::Timestamp] - # Output only. The most recent time this finding was muted or unmuted. - # @!attribute [r] external_systems - # @return [::Google::Protobuf::Map{::String => ::Google::Cloud::SecurityCenter::V1::ExternalSystem}] - # Output only. Third party SIEM/SOAR fields within SCC, contains external - # system information and external system finding fields. - # @!attribute [rw] mitre_attack - # @return [::Google::Cloud::SecurityCenter::V1::MitreAttack] - # MITRE ATT&CK tactics and techniques related to this finding. - # See: https://attack.mitre.org - # @!attribute [rw] access - # @return [::Google::Cloud::SecurityCenter::V1::Access] - # Access details associated with the finding, such as more information on the - # caller, which method was accessed, and from where. - # @!attribute [rw] connections - # @return [::Array<::Google::Cloud::SecurityCenter::V1::Connection>] - # Contains information about the IP connection associated with the finding. - # @!attribute [rw] mute_initiator - # @return [::String] - # Records additional information about the mute operation, for example, the - # [mute configuration](/security-command-center/docs/how-to-mute-findings) - # that muted the finding and the user who muted the finding. - # @!attribute [r] mute_info - # @return [::Google::Cloud::SecurityCenter::V1::Finding::MuteInfo] - # Output only. The mute information regarding this finding. - # @!attribute [rw] processes - # @return [::Array<::Google::Cloud::SecurityCenter::V1::Process>] - # Represents operating system processes associated with the Finding. - # @!attribute [r] contacts - # @return [::Google::Protobuf::Map{::String => ::Google::Cloud::SecurityCenter::V1::ContactDetails}] - # Output only. Map containing the points of contact for the given finding. - # The key represents the type of contact, while the value contains a list of - # all the contacts that pertain. Please refer to: - # https://cloud.google.com/resource-manager/docs/managing-notification-contacts#notification-categories - # - # { - # "security": { - # "contacts": [ - # { - # "email": "person1@company.com" - # }, - # { - # "email": "person2@company.com" - # } - # ] - # } - # } - # @!attribute [rw] compliances - # @return [::Array<::Google::Cloud::SecurityCenter::V1::Compliance>] - # Contains compliance information for security standards associated to the - # finding. - # @!attribute [r] parent_display_name - # @return [::String] - # Output only. The human readable display name of the finding source such as - # "Event Threat Detection" or "Security Health Analytics". - # @!attribute [rw] description - # @return [::String] - # Contains more details about the finding. - # @!attribute [rw] exfiltration - # @return [::Google::Cloud::SecurityCenter::V1::Exfiltration] - # Represents exfiltrations associated with the finding. - # @!attribute [rw] iam_bindings - # @return [::Array<::Google::Cloud::SecurityCenter::V1::IamBinding>] - # Represents IAM bindings associated with the finding. - # @!attribute [rw] next_steps - # @return [::String] - # Steps to address the finding. - # @!attribute [rw] module_name - # @return [::String] - # Unique identifier of the module which generated the finding. - # Example: - # folders/598186756061/securityHealthAnalyticsSettings/customModules/56799441161885 - # @!attribute [rw] containers - # @return [::Array<::Google::Cloud::SecurityCenter::V1::Container>] - # Containers associated with the finding. This field provides information for - # both Kubernetes and non-Kubernetes containers. - # @!attribute [rw] kubernetes - # @return [::Google::Cloud::SecurityCenter::V1::Kubernetes] - # Kubernetes resources associated with the finding. - # @!attribute [rw] database - # @return [::Google::Cloud::SecurityCenter::V1::Database] - # Database associated with the finding. - # @!attribute [rw] attack_exposure - # @return [::Google::Cloud::SecurityCenter::V1::AttackExposure] - # The results of an attack path simulation relevant to this finding. - # @!attribute [rw] files - # @return [::Array<::Google::Cloud::SecurityCenter::V1::File>] - # File associated with the finding. - # @!attribute [rw] cloud_dlp_inspection - # @return [::Google::Cloud::SecurityCenter::V1::CloudDlpInspection] - # Cloud Data Loss Prevention (Cloud DLP) inspection results that are - # associated with the finding. - # @!attribute [rw] cloud_dlp_data_profile - # @return [::Google::Cloud::SecurityCenter::V1::CloudDlpDataProfile] - # Cloud DLP data profile that is associated with the finding. - # @!attribute [rw] kernel_rootkit - # @return [::Google::Cloud::SecurityCenter::V1::KernelRootkit] - # Signature of the kernel rootkit. - # @!attribute [rw] org_policies - # @return [::Array<::Google::Cloud::SecurityCenter::V1::OrgPolicy>] - # Contains information about the org policies associated with the finding. - # @!attribute [rw] application - # @return [::Google::Cloud::SecurityCenter::V1::Application] - # Represents an application associated with the finding. - # @!attribute [rw] backup_disaster_recovery - # @return [::Google::Cloud::SecurityCenter::V1::BackupDisasterRecovery] - # Fields related to Backup and DR findings. - # @!attribute [rw] security_posture - # @return [::Google::Cloud::SecurityCenter::V1::SecurityPosture] - # The security posture associated with the finding. - # @!attribute [rw] log_entries - # @return [::Array<::Google::Cloud::SecurityCenter::V1::LogEntry>] - # Log entries that are relevant to the finding. - # @!attribute [rw] load_balancers - # @return [::Array<::Google::Cloud::SecurityCenter::V1::LoadBalancer>] - # The load balancers associated with the finding. - # @!attribute [rw] cloud_armor - # @return [::Google::Cloud::SecurityCenter::V1::CloudArmor] - # Fields related to Cloud Armor findings. - # @!attribute [rw] notebook - # @return [::Google::Cloud::SecurityCenter::V1::Notebook] - # Notebook associated with the finding. - # @!attribute [rw] toxic_combination - # @return [::Google::Cloud::SecurityCenter::V1::ToxicCombination] - # Contains details about a group of security issues that, when the issues - # occur together, represent a greater risk than when the issues occur - # independently. A group of such issues is referred to as a toxic - # combination. - # This field cannot be updated. Its value is ignored in all update requests. - # @!attribute [rw] group_memberships - # @return [::Array<::Google::Cloud::SecurityCenter::V1::GroupMembership>] - # Contains details about groups of which this finding is a member. A group is - # a collection of findings that are related in some way. - # This field cannot be updated. Its value is ignored in all update requests. - # @!attribute [rw] chokepoint - # @return [::Google::Cloud::SecurityCenter::V1::Chokepoint] - # Contains details about a chokepoint, which is a resource or resource group - # where high-risk attack paths converge, based on [attack path simulations] - # (https://cloud.google.com/security-command-center/docs/attack-exposure-learn#attack_path_simulations). - # This field cannot be updated. Its value is ignored in all update requests. - # @!attribute [rw] external_exposure - # @return [::Google::Cloud::SecurityCenter::V1::ExternalExposure] - # External exposure associated with the finding. - class Finding - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - - # Mute information about the finding, including whether the finding has a - # static mute or any matching dynamic mute rules. - # @!attribute [rw] static_mute - # @return [::Google::Cloud::SecurityCenter::V1::Finding::MuteInfo::StaticMute] - # If set, the static mute applied to this finding. Static mutes override - # dynamic mutes. If unset, there is no static mute. - # @!attribute [rw] dynamic_mute_records - # @return [::Array<::Google::Cloud::SecurityCenter::V1::Finding::MuteInfo::DynamicMuteRecord>] - # The list of dynamic mute rules that currently match the finding. - class MuteInfo - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - - # Information about the static mute state. A static mute state overrides - # any dynamic mute rules that apply to this finding. The static mute state - # can be set by a static mute rule or by muting the finding directly. - # @!attribute [rw] state - # @return [::Google::Cloud::SecurityCenter::V1::Finding::Mute] - # The static mute state. If the value is `MUTED` or `UNMUTED`, then the - # finding's overall mute state will have the same value. - # @!attribute [rw] apply_time - # @return [::Google::Protobuf::Timestamp] - # When the static mute was applied. - class StaticMute - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # The record of a dynamic mute rule that matches the finding. - # @!attribute [rw] mute_config - # @return [::String] - # The relative resource name of the mute rule, represented by a mute - # config, that created this record, for example - # `organizations/123/muteConfigs/mymuteconfig` or - # `organizations/123/locations/global/muteConfigs/mymuteconfig`. - # @!attribute [rw] match_time - # @return [::Google::Protobuf::Timestamp] - # When the dynamic mute rule first matched the finding. - class DynamicMuteRecord - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - end - - # @!attribute [rw] key - # @return [::String] - # @!attribute [rw] value - # @return [::Google::Protobuf::Value] - class SourcePropertiesEntry - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # @!attribute [rw] key - # @return [::String] - # @!attribute [rw] value - # @return [::Google::Cloud::SecurityCenter::V1::ExternalSystem] - class ExternalSystemsEntry - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # @!attribute [rw] key - # @return [::String] - # @!attribute [rw] value - # @return [::Google::Cloud::SecurityCenter::V1::ContactDetails] - class ContactsEntry - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # The state of the finding. - module State - # Unspecified state. - STATE_UNSPECIFIED = 0 - - # The finding requires attention and has not been addressed yet. - ACTIVE = 1 - - # The finding has been fixed, triaged as a non-issue or otherwise addressed - # and is no longer active. - INACTIVE = 2 - end - - # The severity of the finding. - module Severity - # This value is used for findings when a source doesn't write a severity - # value. - SEVERITY_UNSPECIFIED = 0 - - # Vulnerability: - # A critical vulnerability is easily discoverable by an external actor, - # exploitable, and results in the direct ability to execute arbitrary code, - # exfiltrate data, and otherwise gain additional access and privileges to - # cloud resources and workloads. Examples include publicly accessible - # unprotected user data and public SSH access with weak or no - # passwords. - # - # Threat: - # Indicates a threat that is able to access, modify, or delete data or - # execute unauthorized code within existing resources. - CRITICAL = 1 - - # Vulnerability: - # A high risk vulnerability can be easily discovered and exploited in - # combination with other vulnerabilities in order to gain direct access and - # the ability to execute arbitrary code, exfiltrate data, and otherwise - # gain additional access and privileges to cloud resources and workloads. - # An example is a database with weak or no passwords that is only - # accessible internally. This database could easily be compromised by an - # actor that had access to the internal network. - # - # Threat: - # Indicates a threat that is able to create new computational resources in - # an environment but not able to access data or execute code in existing - # resources. - HIGH = 2 - - # Vulnerability: - # A medium risk vulnerability could be used by an actor to gain access to - # resources or privileges that enable them to eventually (through multiple - # steps or a complex exploit) gain access and the ability to execute - # arbitrary code or exfiltrate data. An example is a service account with - # access to more projects than it should have. If an actor gains access to - # the service account, they could potentially use that access to manipulate - # a project the service account was not intended to. - # - # Threat: - # Indicates a threat that is able to cause operational impact but may not - # access data or execute unauthorized code. - MEDIUM = 3 - - # Vulnerability: - # A low risk vulnerability hampers a security organization's ability to - # detect vulnerabilities or active threats in their deployment, or prevents - # the root cause investigation of security issues. An example is monitoring - # and logs being disabled for resource configurations and access. - # - # Threat: - # Indicates a threat that has obtained minimal access to an environment but - # is not able to access data, execute code, or create resources. - LOW = 4 - end - - # Mute state a finding can be in. - module Mute - # Unspecified. - MUTE_UNSPECIFIED = 0 - - # Finding has been muted. - MUTED = 1 - - # Finding has been unmuted. - UNMUTED = 2 - - # Finding has never been muted/unmuted. - UNDEFINED = 4 - end - - # Represents what kind of Finding it is. - module FindingClass - # Unspecified finding class. - FINDING_CLASS_UNSPECIFIED = 0 - - # Describes unwanted or malicious activity. - THREAT = 1 - - # Describes a potential weakness in software that increases risk to - # Confidentiality & Integrity & Availability. - VULNERABILITY = 2 - - # Describes a potential weakness in cloud resource/asset configuration that - # increases risk. - MISCONFIGURATION = 3 - - # Describes a security observation that is for informational purposes. - OBSERVATION = 4 - - # Describes an error that prevents some SCC functionality. - SCC_ERROR = 5 - - # Describes a potential security risk due to a change in the security - # posture. - POSTURE_VIOLATION = 6 - - # Describes a group of security issues that, when the issues - # occur together, represent a greater risk than when the issues occur - # independently. A group of such issues is referred to as a toxic - # combination. - TOXIC_COMBINATION = 7 - - # Describes a potential security risk to data assets that contain sensitive - # data. - SENSITIVE_DATA_RISK = 8 - - # Describes a resource or resource group where high risk attack paths - # converge, based on attack path simulations (APS). - CHOKEPOINT = 9 - - # Describes a potential security risk due to the resource being exposed to - # the internet. - EXTERNAL_EXPOSURE = 10 - end - end - end - end - end -end diff --git a/owl-bot-staging/google-cloud-security_center-v1/proto_docs/google/cloud/securitycenter/v1/folder.rb b/owl-bot-staging/google-cloud-security_center-v1/proto_docs/google/cloud/securitycenter/v1/folder.rb deleted file mode 100644 index 18f745ec7791..000000000000 --- a/owl-bot-staging/google-cloud-security_center-v1/proto_docs/google/cloud/securitycenter/v1/folder.rb +++ /dev/null @@ -1,40 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - - -module Google - module Cloud - module SecurityCenter - module V1 - # Message that contains the resource name and display name of a folder - # resource. - # @!attribute [rw] resource_folder - # @return [::String] - # Full resource name of this folder. See: - # https://cloud.google.com/apis/design/resource_names#full_resource_name - # @!attribute [rw] resource_folder_display_name - # @return [::String] - # The user defined display name for this folder. - class Folder - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - end - end - end -end diff --git a/owl-bot-staging/google-cloud-security_center-v1/proto_docs/google/cloud/securitycenter/v1/group_membership.rb b/owl-bot-staging/google-cloud-security_center-v1/proto_docs/google/cloud/securitycenter/v1/group_membership.rb deleted file mode 100644 index 78f19b012cf5..000000000000 --- a/owl-bot-staging/google-cloud-security_center-v1/proto_docs/google/cloud/securitycenter/v1/group_membership.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! - - -module Google - module Cloud - module SecurityCenter - module V1 - # Contains details about groups of which this finding is a member. A group is a - # collection of findings that are related in some way. - # @!attribute [rw] group_type - # @return [::Google::Cloud::SecurityCenter::V1::GroupMembership::GroupType] - # Type of group. - # @!attribute [rw] group_id - # @return [::String] - # ID of the group. - class GroupMembership - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - - # Possible types of groups. - module GroupType - # Default value. - GROUP_TYPE_UNSPECIFIED = 0 - - # Group represents a toxic combination. - GROUP_TYPE_TOXIC_COMBINATION = 1 - - # Group represents a chokepoint. - GROUP_TYPE_CHOKEPOINT = 3 - end - end - end - end - end -end diff --git a/owl-bot-staging/google-cloud-security_center-v1/proto_docs/google/cloud/securitycenter/v1/iam_binding.rb b/owl-bot-staging/google-cloud-security_center-v1/proto_docs/google/cloud/securitycenter/v1/iam_binding.rb deleted file mode 100644 index 0444b9de78dc..000000000000 --- a/owl-bot-staging/google-cloud-security_center-v1/proto_docs/google/cloud/securitycenter/v1/iam_binding.rb +++ /dev/null @@ -1,56 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - - -module Google - module Cloud - module SecurityCenter - module V1 - # Represents a particular IAM binding, which captures a member's role addition, - # removal, or state. - # @!attribute [rw] action - # @return [::Google::Cloud::SecurityCenter::V1::IamBinding::Action] - # The action that was performed on a Binding. - # @!attribute [rw] role - # @return [::String] - # Role that is assigned to "members". - # For example, "roles/viewer", "roles/editor", or "roles/owner". - # @!attribute [rw] member - # @return [::String] - # A single identity requesting access for a Cloud Platform resource, for - # example, "foo@google.com". - class IamBinding - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - - # The type of action performed on a Binding in a policy. - module Action - # Unspecified. - ACTION_UNSPECIFIED = 0 - - # Addition of a Binding. - ADD = 1 - - # Removal of a Binding. - REMOVE = 2 - end - end - end - end - end -end diff --git a/owl-bot-staging/google-cloud-security_center-v1/proto_docs/google/cloud/securitycenter/v1/indicator.rb b/owl-bot-staging/google-cloud-security_center-v1/proto_docs/google/cloud/securitycenter/v1/indicator.rb deleted file mode 100644 index 518ba2e5451a..000000000000 --- a/owl-bot-staging/google-cloud-security_center-v1/proto_docs/google/cloud/securitycenter/v1/indicator.rb +++ /dev/null @@ -1,116 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - - -module Google - module Cloud - module SecurityCenter - module V1 - # Represents what's commonly known as an _indicator of compromise_ (IoC) in - # computer forensics. This is an artifact observed on a network or in an - # operating system that, with high confidence, indicates a computer intrusion. - # For more information, see [Indicator of - # compromise](https://en.wikipedia.org/wiki/Indicator_of_compromise). - # @!attribute [rw] ip_addresses - # @return [::Array<::String>] - # The list of IP addresses that are associated with the finding. - # @!attribute [rw] domains - # @return [::Array<::String>] - # List of domains associated to the Finding. - # @!attribute [rw] signatures - # @return [::Array<::Google::Cloud::SecurityCenter::V1::Indicator::ProcessSignature>] - # The list of matched signatures indicating that the given - # process is present in the environment. - # @!attribute [rw] uris - # @return [::Array<::String>] - # The list of URIs associated to the Findings. - class Indicator - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - - # Indicates what signature matched this process. - # @!attribute [rw] memory_hash_signature - # @return [::Google::Cloud::SecurityCenter::V1::Indicator::ProcessSignature::MemoryHashSignature] - # Signature indicating that a binary family was matched. - # - # Note: The following fields are mutually exclusive: `memory_hash_signature`, `yara_rule_signature`. If a field in that set is populated, all other fields in the set will automatically be cleared. - # @!attribute [rw] yara_rule_signature - # @return [::Google::Cloud::SecurityCenter::V1::Indicator::ProcessSignature::YaraRuleSignature] - # Signature indicating that a YARA rule was matched. - # - # Note: The following fields are mutually exclusive: `yara_rule_signature`, `memory_hash_signature`. If a field in that set is populated, all other fields in the set will automatically be cleared. - # @!attribute [rw] signature_type - # @return [::Google::Cloud::SecurityCenter::V1::Indicator::ProcessSignature::SignatureType] - # Describes the type of resource associated with the signature. - class ProcessSignature - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - - # A signature corresponding to memory page hashes. - # @!attribute [rw] binary_family - # @return [::String] - # The binary family. - # @!attribute [rw] detections - # @return [::Array<::Google::Cloud::SecurityCenter::V1::Indicator::ProcessSignature::MemoryHashSignature::Detection>] - # The list of memory hash detections contributing to the binary family - # match. - class MemoryHashSignature - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - - # Memory hash detection contributing to the binary family match. - # @!attribute [rw] binary - # @return [::String] - # The name of the binary associated with the memory hash - # signature detection. - # @!attribute [rw] percent_pages_matched - # @return [::Float] - # The percentage of memory page hashes in the signature - # that were matched. - class Detection - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - end - - # A signature corresponding to a YARA rule. - # @!attribute [rw] yara_rule - # @return [::String] - # The name of the YARA rule. - class YaraRuleSignature - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Possible resource types to be associated with a signature. - module SignatureType - # The default signature type. - SIGNATURE_TYPE_UNSPECIFIED = 0 - - # Used for signatures concerning processes. - SIGNATURE_TYPE_PROCESS = 1 - - # Used for signatures concerning disks. - SIGNATURE_TYPE_FILE = 2 - end - end - end - end - end - end -end diff --git a/owl-bot-staging/google-cloud-security_center-v1/proto_docs/google/cloud/securitycenter/v1/kernel_rootkit.rb b/owl-bot-staging/google-cloud-security_center-v1/proto_docs/google/cloud/securitycenter/v1/kernel_rootkit.rb deleted file mode 100644 index 9fc2809838c2..000000000000 --- a/owl-bot-staging/google-cloud-security_center-v1/proto_docs/google/cloud/securitycenter/v1/kernel_rootkit.rb +++ /dev/null @@ -1,66 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - - -module Google - module Cloud - module SecurityCenter - module V1 - # Kernel mode rootkit signatures. - # @!attribute [rw] name - # @return [::String] - # Rootkit name, when available. - # @!attribute [rw] unexpected_code_modification - # @return [::Boolean] - # True if unexpected modifications of kernel code memory are present. - # @!attribute [rw] unexpected_read_only_data_modification - # @return [::Boolean] - # True if unexpected modifications of kernel read-only data memory are - # present. - # @!attribute [rw] unexpected_ftrace_handler - # @return [::Boolean] - # True if `ftrace` points are present with callbacks pointing to regions - # that are not in the expected kernel or module code range. - # @!attribute [rw] unexpected_kprobe_handler - # @return [::Boolean] - # True if `kprobe` points are present with callbacks pointing to regions - # that are not in the expected kernel or module code range. - # @!attribute [rw] unexpected_kernel_code_pages - # @return [::Boolean] - # True if kernel code pages that are not in the expected kernel or module - # code regions are present. - # @!attribute [rw] unexpected_system_call_handler - # @return [::Boolean] - # True if system call handlers that are are not in the expected kernel or - # module code regions are present. - # @!attribute [rw] unexpected_interrupt_handler - # @return [::Boolean] - # True if interrupt handlers that are are not in the expected kernel or - # module code regions are present. - # @!attribute [rw] unexpected_processes_in_runqueue - # @return [::Boolean] - # True if unexpected processes in the scheduler run queue are present. Such - # processes are in the run queue, but not in the process task list. - class KernelRootkit - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - end - end - end -end diff --git a/owl-bot-staging/google-cloud-security_center-v1/proto_docs/google/cloud/securitycenter/v1/kubernetes.rb b/owl-bot-staging/google-cloud-security_center-v1/proto_docs/google/cloud/securitycenter/v1/kubernetes.rb deleted file mode 100644 index 6286084901a9..000000000000 --- a/owl-bot-staging/google-cloud-security_center-v1/proto_docs/google/cloud/securitycenter/v1/kubernetes.rb +++ /dev/null @@ -1,241 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - - -module Google - module Cloud - module SecurityCenter - module V1 - # Kubernetes-related attributes. - # @!attribute [rw] pods - # @return [::Array<::Google::Cloud::SecurityCenter::V1::Kubernetes::Pod>] - # Kubernetes - # [Pods](https://cloud.google.com/kubernetes-engine/docs/concepts/pod) - # associated with the finding. This field contains Pod records for each - # container that is owned by a Pod. - # @!attribute [rw] nodes - # @return [::Array<::Google::Cloud::SecurityCenter::V1::Kubernetes::Node>] - # Provides Kubernetes - # [node](https://cloud.google.com/kubernetes-engine/docs/concepts/cluster-architecture#nodes) - # information. - # @!attribute [rw] node_pools - # @return [::Array<::Google::Cloud::SecurityCenter::V1::Kubernetes::NodePool>] - # GKE [node - # pools](https://cloud.google.com/kubernetes-engine/docs/concepts/node-pools) - # associated with the finding. This field contains node pool information for - # each node, when it is available. - # @!attribute [rw] roles - # @return [::Array<::Google::Cloud::SecurityCenter::V1::Kubernetes::Role>] - # Provides Kubernetes role information for findings that involve [Roles or - # ClusterRoles](https://cloud.google.com/kubernetes-engine/docs/how-to/role-based-access-control). - # @!attribute [rw] bindings - # @return [::Array<::Google::Cloud::SecurityCenter::V1::Kubernetes::Binding>] - # Provides Kubernetes role binding information for findings that involve - # [RoleBindings or - # ClusterRoleBindings](https://cloud.google.com/kubernetes-engine/docs/how-to/role-based-access-control). - # @!attribute [rw] access_reviews - # @return [::Array<::Google::Cloud::SecurityCenter::V1::Kubernetes::AccessReview>] - # Provides information on any Kubernetes access reviews (privilege checks) - # relevant to the finding. - # @!attribute [rw] objects - # @return [::Array<::Google::Cloud::SecurityCenter::V1::Kubernetes::Object>] - # Kubernetes objects related to the finding. - class Kubernetes - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - - # A Kubernetes Pod. - # @!attribute [rw] ns - # @return [::String] - # Kubernetes Pod namespace. - # @!attribute [rw] name - # @return [::String] - # Kubernetes Pod name. - # @!attribute [rw] labels - # @return [::Array<::Google::Cloud::SecurityCenter::V1::Label>] - # Pod labels. For Kubernetes containers, these are applied to the - # container. - # @!attribute [rw] containers - # @return [::Array<::Google::Cloud::SecurityCenter::V1::Container>] - # Pod containers associated with this finding, if any. - class Pod - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Kubernetes nodes associated with the finding. - # @!attribute [rw] name - # @return [::String] - # [Full resource name](https://google.aip.dev/122#full-resource-names) of - # the Compute Engine VM running the cluster node. - class Node - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Provides GKE node pool information. - # @!attribute [rw] name - # @return [::String] - # Kubernetes node pool name. - # @!attribute [rw] nodes - # @return [::Array<::Google::Cloud::SecurityCenter::V1::Kubernetes::Node>] - # Nodes associated with the finding. - class NodePool - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Kubernetes Role or ClusterRole. - # @!attribute [rw] kind - # @return [::Google::Cloud::SecurityCenter::V1::Kubernetes::Role::Kind] - # Role type. - # @!attribute [rw] ns - # @return [::String] - # Role namespace. - # @!attribute [rw] name - # @return [::String] - # Role name. - class Role - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - - # Types of Kubernetes roles. - module Kind - # Role type is not specified. - KIND_UNSPECIFIED = 0 - - # Kubernetes Role. - ROLE = 1 - - # Kubernetes ClusterRole. - CLUSTER_ROLE = 2 - end - end - - # Represents a Kubernetes RoleBinding or ClusterRoleBinding. - # @!attribute [rw] ns - # @return [::String] - # Namespace for the binding. - # @!attribute [rw] name - # @return [::String] - # Name for the binding. - # @!attribute [rw] role - # @return [::Google::Cloud::SecurityCenter::V1::Kubernetes::Role] - # The Role or ClusterRole referenced by the binding. - # @!attribute [rw] subjects - # @return [::Array<::Google::Cloud::SecurityCenter::V1::Kubernetes::Subject>] - # Represents one or more subjects that are bound to the role. Not always - # available for PATCH requests. - class Binding - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Represents a Kubernetes subject. - # @!attribute [rw] kind - # @return [::Google::Cloud::SecurityCenter::V1::Kubernetes::Subject::AuthType] - # Authentication type for the subject. - # @!attribute [rw] ns - # @return [::String] - # Namespace for the subject. - # @!attribute [rw] name - # @return [::String] - # Name for the subject. - class Subject - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - - # Auth types that can be used for the subject's kind field. - module AuthType - # Authentication is not specified. - AUTH_TYPE_UNSPECIFIED = 0 - - # User with valid certificate. - USER = 1 - - # Users managed by Kubernetes API with credentials stored as secrets. - SERVICEACCOUNT = 2 - - # Collection of users. - GROUP = 3 - end - end - - # Conveys information about a Kubernetes access review (such as one returned - # by a [`kubectl auth - # can-i`](https://kubernetes.io/docs/reference/access-authn-authz/authorization/#checking-api-access) - # command) that was involved in a finding. - # @!attribute [rw] group - # @return [::String] - # The API group of the resource. "*" means all. - # @!attribute [rw] ns - # @return [::String] - # Namespace of the action being requested. Currently, there is no - # distinction between no namespace and all namespaces. Both - # are represented by "" (empty). - # @!attribute [rw] name - # @return [::String] - # The name of the resource being requested. Empty means all. - # @!attribute [rw] resource - # @return [::String] - # The optional resource type requested. "*" means all. - # @!attribute [rw] subresource - # @return [::String] - # The optional subresource type. - # @!attribute [rw] verb - # @return [::String] - # A Kubernetes resource API verb, like get, list, watch, create, update, - # delete, proxy. "*" means all. - # @!attribute [rw] version - # @return [::String] - # The API version of the resource. "*" means all. - class AccessReview - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Kubernetes object related to the finding, uniquely identified by GKNN. - # Used if the object Kind is not one of Pod, Node, NodePool, Binding, or - # AccessReview. - # @!attribute [rw] group - # @return [::String] - # Kubernetes object group, such as "policy.k8s.io/v1". - # @!attribute [rw] kind - # @return [::String] - # Kubernetes object kind, such as "Namespace". - # @!attribute [rw] ns - # @return [::String] - # Kubernetes object namespace. Must be a valid DNS label. Named - # "ns" to avoid collision with C++ namespace keyword. For details see - # https://kubernetes.io/docs/tasks/administer-cluster/namespaces/. - # @!attribute [rw] name - # @return [::String] - # Kubernetes object name. For details see - # https://kubernetes.io/docs/concepts/overview/working-with-objects/names/. - # @!attribute [rw] containers - # @return [::Array<::Google::Cloud::SecurityCenter::V1::Container>] - # Pod containers associated with this finding, if any. - class Object - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - end - end - end - end -end diff --git a/owl-bot-staging/google-cloud-security_center-v1/proto_docs/google/cloud/securitycenter/v1/label.rb b/owl-bot-staging/google-cloud-security_center-v1/proto_docs/google/cloud/securitycenter/v1/label.rb deleted file mode 100644 index d3887e4fc185..000000000000 --- a/owl-bot-staging/google-cloud-security_center-v1/proto_docs/google/cloud/securitycenter/v1/label.rb +++ /dev/null @@ -1,41 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - - -module Google - module Cloud - module SecurityCenter - module V1 - # Represents a generic name-value label. A label has separate name and value - # fields to support filtering with the `contains()` function. For more - # information, see [Filtering on array-type - # fields](https://cloud.google.com/security-command-center/docs/how-to-api-list-findings#array-contains-filtering). - # @!attribute [rw] name - # @return [::String] - # Name of the label. - # @!attribute [rw] value - # @return [::String] - # Value that corresponds to the label's name. - class Label - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - end - end - end -end diff --git a/owl-bot-staging/google-cloud-security_center-v1/proto_docs/google/cloud/securitycenter/v1/load_balancer.rb b/owl-bot-staging/google-cloud-security_center-v1/proto_docs/google/cloud/securitycenter/v1/load_balancer.rb deleted file mode 100644 index be5ec1bb5606..000000000000 --- a/owl-bot-staging/google-cloud-security_center-v1/proto_docs/google/cloud/securitycenter/v1/load_balancer.rb +++ /dev/null @@ -1,36 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - - -module Google - module Cloud - module SecurityCenter - module V1 - # Contains information related to the load balancer associated with the - # finding. - # @!attribute [rw] name - # @return [::String] - # The name of the load balancer associated with the finding. - class LoadBalancer - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - end - end - end -end diff --git a/owl-bot-staging/google-cloud-security_center-v1/proto_docs/google/cloud/securitycenter/v1/log_entry.rb b/owl-bot-staging/google-cloud-security_center-v1/proto_docs/google/cloud/securitycenter/v1/log_entry.rb deleted file mode 100644 index 6f028cba55b8..000000000000 --- a/owl-bot-staging/google-cloud-security_center-v1/proto_docs/google/cloud/securitycenter/v1/log_entry.rb +++ /dev/null @@ -1,58 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - - -module Google - module Cloud - module SecurityCenter - module V1 - # An individual entry in a log. - # @!attribute [rw] cloud_logging_entry - # @return [::Google::Cloud::SecurityCenter::V1::CloudLoggingEntry] - # An individual entry in a log stored in Cloud Logging. - class LogEntry - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Metadata taken from a [Cloud Logging - # LogEntry](https://cloud.google.com/logging/docs/reference/v2/rest/v2/LogEntry) - # @!attribute [rw] insert_id - # @return [::String] - # A unique identifier for the log entry. - # @!attribute [rw] log_id - # @return [::String] - # The type of the log (part of `log_name`. `log_name` is the resource name of - # the log to which this log entry belongs). For example: - # `cloudresourcemanager.googleapis.com/activity`. Note that this field is not - # URL-encoded, unlike the `LOG_ID` field in `LogEntry`. - # @!attribute [rw] resource_container - # @return [::String] - # The organization, folder, or project of the monitored resource that - # produced this log entry. - # @!attribute [rw] timestamp - # @return [::Google::Protobuf::Timestamp] - # The time the event described by the log entry occurred. - class CloudLoggingEntry - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - end - end - end -end diff --git a/owl-bot-staging/google-cloud-security_center-v1/proto_docs/google/cloud/securitycenter/v1/mitre_attack.rb b/owl-bot-staging/google-cloud-security_center-v1/proto_docs/google/cloud/securitycenter/v1/mitre_attack.rb deleted file mode 100644 index 6e17500226e7..000000000000 --- a/owl-bot-staging/google-cloud-security_center-v1/proto_docs/google/cloud/securitycenter/v1/mitre_attack.rb +++ /dev/null @@ -1,303 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - - -module Google - module Cloud - module SecurityCenter - module V1 - # MITRE ATT&CK tactics and techniques related to this finding. - # See: https://attack.mitre.org - # @!attribute [rw] primary_tactic - # @return [::Google::Cloud::SecurityCenter::V1::MitreAttack::Tactic] - # The MITRE ATT&CK tactic most closely represented by this finding, if any. - # @!attribute [rw] primary_techniques - # @return [::Array<::Google::Cloud::SecurityCenter::V1::MitreAttack::Technique>] - # The MITRE ATT&CK technique most closely represented by this finding, if - # any. primary_techniques is a repeated field because there are multiple - # levels of MITRE ATT&CK techniques. If the technique most closely - # represented by this finding is a sub-technique (e.g. `SCANNING_IP_BLOCKS`), - # both the sub-technique and its parent technique(s) will be listed (e.g. - # `SCANNING_IP_BLOCKS`, `ACTIVE_SCANNING`). - # @!attribute [rw] additional_tactics - # @return [::Array<::Google::Cloud::SecurityCenter::V1::MitreAttack::Tactic>] - # Additional MITRE ATT&CK tactics related to this finding, if any. - # @!attribute [rw] additional_techniques - # @return [::Array<::Google::Cloud::SecurityCenter::V1::MitreAttack::Technique>] - # Additional MITRE ATT&CK techniques related to this finding, if any, along - # with any of their respective parent techniques. - # @!attribute [rw] version - # @return [::String] - # The MITRE ATT&CK version referenced by the above fields. E.g. "8". - class MitreAttack - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - - # MITRE ATT&CK tactics that can be referenced by SCC findings. - # See: https://attack.mitre.org/tactics/enterprise/ - module Tactic - # Unspecified value. - TACTIC_UNSPECIFIED = 0 - - # TA0043 - RECONNAISSANCE = 1 - - # TA0042 - RESOURCE_DEVELOPMENT = 2 - - # TA0001 - INITIAL_ACCESS = 5 - - # TA0002 - EXECUTION = 3 - - # TA0003 - PERSISTENCE = 6 - - # TA0004 - PRIVILEGE_ESCALATION = 8 - - # TA0005 - DEFENSE_EVASION = 7 - - # TA0006 - CREDENTIAL_ACCESS = 9 - - # TA0007 - DISCOVERY = 10 - - # TA0008 - LATERAL_MOVEMENT = 11 - - # TA0009 - COLLECTION = 12 - - # TA0011 - COMMAND_AND_CONTROL = 4 - - # TA0010 - EXFILTRATION = 13 - - # TA0040 - IMPACT = 14 - end - - # MITRE ATT&CK techniques that can be referenced by SCC findings. - # See: https://attack.mitre.org/techniques/enterprise/ - # Next ID: 65 - module Technique - # Unspecified value. - TECHNIQUE_UNSPECIFIED = 0 - - # T1036 - MASQUERADING = 49 - - # T1036.005 - MATCH_LEGITIMATE_NAME_OR_LOCATION = 50 - - # T1037 - BOOT_OR_LOGON_INITIALIZATION_SCRIPTS = 37 - - # T1037.005 - STARTUP_ITEMS = 38 - - # T1046 - NETWORK_SERVICE_DISCOVERY = 32 - - # T1057 - PROCESS_DISCOVERY = 56 - - # T1059 - COMMAND_AND_SCRIPTING_INTERPRETER = 6 - - # T1059.004 - UNIX_SHELL = 7 - - # T1059.006 - PYTHON = 59 - - # T1068 - EXPLOITATION_FOR_PRIVILEGE_ESCALATION = 63 - - # T1069 - PERMISSION_GROUPS_DISCOVERY = 18 - - # T1069.003 - CLOUD_GROUPS = 19 - - # T1070.004 - INDICATOR_REMOVAL_FILE_DELETION = 64 - - # T1071 - APPLICATION_LAYER_PROTOCOL = 45 - - # T1071.004 - DNS = 46 - - # T1072 - SOFTWARE_DEPLOYMENT_TOOLS = 47 - - # T1078 - VALID_ACCOUNTS = 14 - - # T1078.001 - DEFAULT_ACCOUNTS = 35 - - # T1078.003 - LOCAL_ACCOUNTS = 15 - - # T1078.004 - CLOUD_ACCOUNTS = 16 - - # T1090 - PROXY = 9 - - # T1090.002 - EXTERNAL_PROXY = 10 - - # T1090.003 - MULTI_HOP_PROXY = 11 - - # T1098 - ACCOUNT_MANIPULATION = 22 - - # T1098.001 - ADDITIONAL_CLOUD_CREDENTIALS = 40 - - # T1098.004 - SSH_AUTHORIZED_KEYS = 23 - - # T1098.006 - ADDITIONAL_CONTAINER_CLUSTER_ROLES = 58 - - # T1105 - INGRESS_TOOL_TRANSFER = 3 - - # T1106 - NATIVE_API = 4 - - # T1110 - BRUTE_FORCE = 44 - - # T1129 - SHARED_MODULES = 5 - - # T1134 - ACCESS_TOKEN_MANIPULATION = 33 - - # T1134.001 - TOKEN_IMPERSONATION_OR_THEFT = 39 - - # T1190 - EXPLOIT_PUBLIC_FACING_APPLICATION = 27 - - # T1484 - DOMAIN_POLICY_MODIFICATION = 30 - - # T1485 - DATA_DESTRUCTION = 29 - - # T1489 - SERVICE_STOP = 52 - - # T1490 - INHIBIT_SYSTEM_RECOVERY = 36 - - # T1496 - RESOURCE_HIJACKING = 8 - - # T1498 - NETWORK_DENIAL_OF_SERVICE = 17 - - # T1526 - CLOUD_SERVICE_DISCOVERY = 48 - - # T1528 - STEAL_APPLICATION_ACCESS_TOKEN = 42 - - # T1531 - ACCOUNT_ACCESS_REMOVAL = 51 - - # T1539 - STEAL_WEB_SESSION_COOKIE = 25 - - # T1543 - CREATE_OR_MODIFY_SYSTEM_PROCESS = 24 - - # T1548 - ABUSE_ELEVATION_CONTROL_MECHANISM = 34 - - # T1552 - UNSECURED_CREDENTIALS = 13 - - # T1556 - MODIFY_AUTHENTICATION_PROCESS = 28 - - # T1562 - IMPAIR_DEFENSES = 31 - - # T1562.001 - DISABLE_OR_MODIFY_TOOLS = 55 - - # T1567 - EXFILTRATION_OVER_WEB_SERVICE = 20 - - # T1567.002 - EXFILTRATION_TO_CLOUD_STORAGE = 21 - - # T1568 - DYNAMIC_RESOLUTION = 12 - - # T1570 - LATERAL_TOOL_TRANSFER = 41 - - # T1578 - MODIFY_CLOUD_COMPUTE_INFRASTRUCTURE = 26 - - # T1578.001 - CREATE_SNAPSHOT = 54 - - # T1580 - CLOUD_INFRASTRUCTURE_DISCOVERY = 53 - - # T1588 - OBTAIN_CAPABILITIES = 43 - - # T1595 - ACTIVE_SCANNING = 1 - - # T1595.001 - SCANNING_IP_BLOCKS = 2 - - # T1609 - CONTAINER_ADMINISTRATION_COMMAND = 60 - - # T1611 - ESCAPE_TO_HOST = 61 - - # T1613 - CONTAINER_AND_RESOURCE_DISCOVERY = 57 - - # T1649 - STEAL_OR_FORGE_AUTHENTICATION_CERTIFICATES = 62 - end - end - end - end - end -end diff --git a/owl-bot-staging/google-cloud-security_center-v1/proto_docs/google/cloud/securitycenter/v1/mute_config.rb b/owl-bot-staging/google-cloud-security_center-v1/proto_docs/google/cloud/securitycenter/v1/mute_config.rb deleted file mode 100644 index ef639857ed11..000000000000 --- a/owl-bot-staging/google-cloud-security_center-v1/proto_docs/google/cloud/securitycenter/v1/mute_config.rb +++ /dev/null @@ -1,116 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - - -module Google - module Cloud - module SecurityCenter - module V1 - # A mute config is a Cloud SCC resource that contains the configuration - # to mute create/update events of findings. - # @!attribute [rw] name - # @return [::String] - # This field will be ignored if provided on config creation. Format - # `organizations/{organization}/muteConfigs/{mute_config}` - # `folders/{folder}/muteConfigs/{mute_config}` - # `projects/{project}/muteConfigs/{mute_config}` - # `organizations/{organization}/locations/global/muteConfigs/{mute_config}` - # `folders/{folder}/locations/global/muteConfigs/{mute_config}` - # `projects/{project}/locations/global/muteConfigs/{mute_config}` - # @!attribute [rw] display_name - # @deprecated This field is deprecated and may be removed in the next major version update. - # @return [::String] - # The human readable name to be displayed for the mute config. - # @!attribute [rw] description - # @return [::String] - # A description of the mute config. - # @!attribute [rw] filter - # @return [::String] - # Required. An expression that defines the filter to apply across - # create/update events of findings. While creating a filter string, be - # mindful of the scope in which the mute configuration is being created. - # E.g., If a filter contains project = X but is created under the project = Y - # scope, it might not match any findings. - # - # The following field and operator combinations are supported: - # - # * severity: `=`, `:` - # * category: `=`, `:` - # * resource.name: `=`, `:` - # * resource.project_name: `=`, `:` - # * resource.project_display_name: `=`, `:` - # * resource.folders.resource_folder: `=`, `:` - # * resource.parent_name: `=`, `:` - # * resource.parent_display_name: `=`, `:` - # * resource.type: `=`, `:` - # * finding_class: `=`, `:` - # * indicator.ip_addresses: `=`, `:` - # * indicator.domains: `=`, `:` - # @!attribute [r] create_time - # @return [::Google::Protobuf::Timestamp] - # Output only. The time at which the mute config was created. - # This field is set by the server and will be ignored if provided on config - # creation. - # @!attribute [r] update_time - # @return [::Google::Protobuf::Timestamp] - # Output only. The most recent time at which the mute config was updated. - # This field is set by the server and will be ignored if provided on config - # creation or update. - # @!attribute [r] most_recent_editor - # @return [::String] - # Output only. Email address of the user who last edited the mute config. - # This field is set by the server and will be ignored if provided on config - # creation or update. - # @!attribute [rw] type - # @return [::Google::Cloud::SecurityCenter::V1::MuteConfig::MuteConfigType] - # Optional. The type of the mute config, which determines what type of mute - # state the config affects. The static mute state takes precedence over the - # dynamic mute state. Immutable after creation. STATIC by default if not set - # during creation. - # @!attribute [rw] expiry_time - # @return [::Google::Protobuf::Timestamp] - # Optional. The expiry of the mute config. Only applicable for dynamic - # configs. If the expiry is set, when the config expires, it is removed from - # all findings. - class MuteConfig - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - - # The type of MuteConfig. - module MuteConfigType - # Unused. - MUTE_CONFIG_TYPE_UNSPECIFIED = 0 - - # A static mute config, which sets the static mute state of future matching - # findings to muted. Once the static mute state has been set, finding or - # config modifications will not affect the state. - STATIC = 1 - - # A dynamic mute config, which is applied to existing and future matching - # findings, setting their dynamic mute state to "muted". If the config is - # updated or deleted, or a matching finding is updated, such that the - # finding doesn't match the config, the config will be removed from the - # finding, and the finding's dynamic mute state may become "unmuted" - # (unless other configs still match). - DYNAMIC = 2 - end - end - end - end - end -end diff --git a/owl-bot-staging/google-cloud-security_center-v1/proto_docs/google/cloud/securitycenter/v1/notebook.rb b/owl-bot-staging/google-cloud-security_center-v1/proto_docs/google/cloud/securitycenter/v1/notebook.rb deleted file mode 100644 index c1a520b911b6..000000000000 --- a/owl-bot-staging/google-cloud-security_center-v1/proto_docs/google/cloud/securitycenter/v1/notebook.rb +++ /dev/null @@ -1,46 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - - -module Google - module Cloud - module SecurityCenter - module V1 - # Represents a Jupyter notebook IPYNB file, such as a [Colab Enterprise - # notebook](https://cloud.google.com/colab/docs/introduction) file, that is - # associated with a finding. - # @!attribute [rw] name - # @return [::String] - # The name of the notebook. - # @!attribute [rw] service - # @return [::String] - # The source notebook service, for example, "Colab Enterprise". - # @!attribute [rw] last_author - # @return [::String] - # The user ID of the latest author to modify the notebook. - # @!attribute [rw] notebook_update_time - # @return [::Google::Protobuf::Timestamp] - # The most recent time the notebook was updated. - class Notebook - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - end - end - end -end diff --git a/owl-bot-staging/google-cloud-security_center-v1/proto_docs/google/cloud/securitycenter/v1/notification_config.rb b/owl-bot-staging/google-cloud-security_center-v1/proto_docs/google/cloud/securitycenter/v1/notification_config.rb deleted file mode 100644 index 76042f526f38..000000000000 --- a/owl-bot-staging/google-cloud-security_center-v1/proto_docs/google/cloud/securitycenter/v1/notification_config.rb +++ /dev/null @@ -1,87 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - - -module Google - module Cloud - module SecurityCenter - module V1 - # Cloud Security Command Center (Cloud SCC) notification configs. - # - # A notification config is a Cloud SCC resource that contains the configuration - # to send notifications for create/update events of findings, assets and etc. - # @!attribute [rw] name - # @return [::String] - # The relative resource name of this notification config. See: - # https://cloud.google.com/apis/design/resource_names#relative_resource_name - # Example: - # "organizations/\\{organization_id}/notificationConfigs/notify_public_bucket", - # "folders/\\{folder_id}/notificationConfigs/notify_public_bucket", - # or "projects/\\{project_id}/notificationConfigs/notify_public_bucket". - # @!attribute [rw] description - # @return [::String] - # The description of the notification config (max of 1024 characters). - # @!attribute [rw] pubsub_topic - # @return [::String] - # The Pub/Sub topic to send notifications to. Its format is - # "projects/[project_id]/topics/[topic]". - # @!attribute [r] service_account - # @return [::String] - # Output only. The service account that needs "pubsub.topics.publish" - # permission to publish to the Pub/Sub topic. - # @!attribute [rw] streaming_config - # @return [::Google::Cloud::SecurityCenter::V1::NotificationConfig::StreamingConfig] - # The config for triggering streaming-based notifications. - class NotificationConfig - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - - # The config for streaming-based notifications, which send each event as soon - # as it is detected. - # @!attribute [rw] filter - # @return [::String] - # Expression that defines the filter to apply across create/update events - # of assets or findings as specified by the event type. The expression is a - # list of zero or more restrictions combined via logical operators `AND` - # and `OR`. Parentheses are supported, and `OR` has higher precedence than - # `AND`. - # - # Restrictions have the form ` ` and may have a - # `-` character in front of them to indicate negation. The fields map to - # those defined in the corresponding resource. - # - # The supported operators are: - # - # * `=` for all value types. - # * `>`, `<`, `>=`, `<=` for integer values. - # * `:`, meaning substring matching, for strings. - # - # The supported value types are: - # - # * string literals in quotes. - # * integer literals without quotes. - # * boolean literals `true` and `false` without quotes. - class StreamingConfig - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - end - end - end - end -end diff --git a/owl-bot-staging/google-cloud-security_center-v1/proto_docs/google/cloud/securitycenter/v1/notification_message.rb b/owl-bot-staging/google-cloud-security_center-v1/proto_docs/google/cloud/securitycenter/v1/notification_message.rb deleted file mode 100644 index 117cc8daf4cc..000000000000 --- a/owl-bot-staging/google-cloud-security_center-v1/proto_docs/google/cloud/securitycenter/v1/notification_message.rb +++ /dev/null @@ -1,42 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - - -module Google - module Cloud - module SecurityCenter - module V1 - # Cloud SCC's Notification - # @!attribute [rw] notification_config_name - # @return [::String] - # Name of the notification config that generated current notification. - # @!attribute [rw] finding - # @return [::Google::Cloud::SecurityCenter::V1::Finding] - # If it's a Finding based notification config, this field will be - # populated. - # @!attribute [rw] resource - # @return [::Google::Cloud::SecurityCenter::V1::Resource] - # The Cloud resource tied to this notification's Finding. - class NotificationMessage - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - end - end - end -end diff --git a/owl-bot-staging/google-cloud-security_center-v1/proto_docs/google/cloud/securitycenter/v1/org_policy.rb b/owl-bot-staging/google-cloud-security_center-v1/proto_docs/google/cloud/securitycenter/v1/org_policy.rb deleted file mode 100644 index dd2663301322..000000000000 --- a/owl-bot-staging/google-cloud-security_center-v1/proto_docs/google/cloud/securitycenter/v1/org_policy.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! - - -module Google - module Cloud - module SecurityCenter - module V1 - # Contains information about the org policies associated with the finding. - # @!attribute [rw] name - # @return [::String] - # The resource name of the org policy. - # Example: - # "organizations/\\{organization_id}/policies/\\{constraint_name}" - class OrgPolicy - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - end - end - end -end diff --git a/owl-bot-staging/google-cloud-security_center-v1/proto_docs/google/cloud/securitycenter/v1/organization_settings.rb b/owl-bot-staging/google-cloud-security_center-v1/proto_docs/google/cloud/securitycenter/v1/organization_settings.rb deleted file mode 100644 index d75d60b378de..000000000000 --- a/owl-bot-staging/google-cloud-security_center-v1/proto_docs/google/cloud/securitycenter/v1/organization_settings.rb +++ /dev/null @@ -1,86 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - - -module Google - module Cloud - module SecurityCenter - module V1 - # User specified settings that are attached to the Security Command - # Center organization. - # @!attribute [rw] name - # @return [::String] - # The relative resource name of the settings. See: - # https://cloud.google.com/apis/design/resource_names#relative_resource_name - # Example: - # "organizations/\\{organization_id}/organizationSettings". - # @!attribute [rw] enable_asset_discovery - # @return [::Boolean] - # A flag that indicates if Asset Discovery should be enabled. If the flag is - # set to `true`, then discovery of assets will occur. If it is set to - # `false`, all historical assets will remain, but discovery of future assets - # will not occur. - # @!attribute [rw] asset_discovery_config - # @return [::Google::Cloud::SecurityCenter::V1::OrganizationSettings::AssetDiscoveryConfig] - # The configuration used for Asset Discovery runs. - class OrganizationSettings - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - - # The configuration used for Asset Discovery runs. - # @!attribute [rw] project_ids - # @return [::Array<::String>] - # The project ids to use for filtering asset discovery. - # @!attribute [rw] inclusion_mode - # @return [::Google::Cloud::SecurityCenter::V1::OrganizationSettings::AssetDiscoveryConfig::InclusionMode] - # The mode to use for filtering asset discovery. - # @!attribute [rw] folder_ids - # @return [::Array<::String>] - # The folder ids to use for filtering asset discovery. - # It consists of only digits, e.g., 756619654966. - class AssetDiscoveryConfig - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - - # The mode of inclusion when running Asset Discovery. - # Asset discovery can be limited by explicitly identifying projects to be - # included or excluded. If INCLUDE_ONLY is set, then only those projects - # within the organization and their children are discovered during asset - # discovery. If EXCLUDE is set, then projects that don't match those - # projects are discovered during asset discovery. If neither are set, then - # all projects within the organization are discovered during asset - # discovery. - module InclusionMode - # Unspecified. Setting the mode with this value will disable - # inclusion/exclusion filtering for Asset Discovery. - INCLUSION_MODE_UNSPECIFIED = 0 - - # Asset Discovery will capture only the resources within the projects - # specified. All other resources will be ignored. - INCLUDE_ONLY = 1 - - # Asset Discovery will ignore all resources under the projects specified. - # All other resources will be retrieved. - EXCLUDE = 2 - end - end - end - end - end - end -end diff --git a/owl-bot-staging/google-cloud-security_center-v1/proto_docs/google/cloud/securitycenter/v1/process.rb b/owl-bot-staging/google-cloud-security_center-v1/proto_docs/google/cloud/securitycenter/v1/process.rb deleted file mode 100644 index 7c14c9d1baf2..000000000000 --- a/owl-bot-staging/google-cloud-security_center-v1/proto_docs/google/cloud/securitycenter/v1/process.rb +++ /dev/null @@ -1,79 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - - -module Google - module Cloud - module SecurityCenter - module V1 - # Represents an operating system process. - # @!attribute [rw] name - # @return [::String] - # The process name, as displayed in utilities like `top` and `ps`. This name - # can be accessed through `/proc/[pid]/comm` and changed with - # `prctl(PR_SET_NAME)`. - # @!attribute [rw] binary - # @return [::Google::Cloud::SecurityCenter::V1::File] - # File information for the process executable. - # @!attribute [rw] libraries - # @return [::Array<::Google::Cloud::SecurityCenter::V1::File>] - # File information for libraries loaded by the process. - # @!attribute [rw] script - # @return [::Google::Cloud::SecurityCenter::V1::File] - # When the process represents the invocation of a script, `binary` provides - # information about the interpreter, while `script` provides information - # about the script file provided to the interpreter. - # @!attribute [rw] args - # @return [::Array<::String>] - # Process arguments as JSON encoded strings. - # @!attribute [rw] arguments_truncated - # @return [::Boolean] - # True if `args` is incomplete. - # @!attribute [rw] env_variables - # @return [::Array<::Google::Cloud::SecurityCenter::V1::EnvironmentVariable>] - # Process environment variables. - # @!attribute [rw] env_variables_truncated - # @return [::Boolean] - # True if `env_variables` is incomplete. - # @!attribute [rw] pid - # @return [::Integer] - # The process ID. - # @!attribute [rw] parent_pid - # @return [::Integer] - # The parent process ID. - class Process - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # A name-value pair representing an environment variable used in an operating - # system process. - # @!attribute [rw] name - # @return [::String] - # Environment variable name as a JSON encoded string. - # @!attribute [rw] val - # @return [::String] - # Environment variable value as a JSON encoded string. - class EnvironmentVariable - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - end - end - end -end diff --git a/owl-bot-staging/google-cloud-security_center-v1/proto_docs/google/cloud/securitycenter/v1/resource.rb b/owl-bot-staging/google-cloud-security_center-v1/proto_docs/google/cloud/securitycenter/v1/resource.rb deleted file mode 100644 index 5783203927c7..000000000000 --- a/owl-bot-staging/google-cloud-security_center-v1/proto_docs/google/cloud/securitycenter/v1/resource.rb +++ /dev/null @@ -1,286 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - - -module Google - module Cloud - module SecurityCenter - module V1 - # Information related to the Google Cloud resource. - # @!attribute [rw] name - # @return [::String] - # The full resource name of the resource. See: - # https://cloud.google.com/apis/design/resource_names#full_resource_name - # @!attribute [rw] display_name - # @return [::String] - # The human readable name of the resource. - # @!attribute [rw] type - # @return [::String] - # The full resource type of the resource. - # @!attribute [rw] project - # @return [::String] - # The full resource name of project that the resource belongs to. - # @!attribute [rw] project_display_name - # @return [::String] - # The project ID that the resource belongs to. - # @!attribute [rw] parent - # @return [::String] - # The full resource name of resource's parent. - # @!attribute [rw] parent_display_name - # @return [::String] - # The human readable name of resource's parent. - # @!attribute [r] folders - # @return [::Array<::Google::Cloud::SecurityCenter::V1::Folder>] - # Output only. Contains a Folder message for each folder in the assets - # ancestry. The first folder is the deepest nested folder, and the last - # folder is the folder directly under the Organization. - # @!attribute [rw] cloud_provider - # @return [::Google::Cloud::SecurityCenter::V1::CloudProvider] - # Indicates which cloud provider the resource resides in. - # @!attribute [rw] organization - # @return [::String] - # Indicates which organization or tenant in the cloud provider the finding - # applies to. - # @!attribute [rw] service - # @return [::String] - # The parent service or product from which the resource is provided, for - # example, GKE or SNS. - # @!attribute [rw] location - # @return [::String] - # The region or location of the service (if applicable). - # @!attribute [rw] aws_metadata - # @return [::Google::Cloud::SecurityCenter::V1::AwsMetadata] - # The AWS metadata associated with the finding. - # - # Note: The following fields are mutually exclusive: `aws_metadata`, `azure_metadata`. If a field in that set is populated, all other fields in the set will automatically be cleared. - # @!attribute [rw] azure_metadata - # @return [::Google::Cloud::SecurityCenter::V1::AzureMetadata] - # The Azure metadata associated with the finding. - # - # Note: The following fields are mutually exclusive: `azure_metadata`, `aws_metadata`. If a field in that set is populated, all other fields in the set will automatically be cleared. - # @!attribute [rw] resource_path - # @return [::Google::Cloud::SecurityCenter::V1::ResourcePath] - # Provides the path to the resource within the resource hierarchy. - # @!attribute [rw] resource_path_string - # @return [::String] - # A string representation of the resource path. - # For Google Cloud, it has the format of - # `organizations/{organization_id}/folders/{folder_id}/folders/{folder_id}/projects/{project_id}` - # where there can be any number of folders. - # For AWS, it has the format of - # `org/{organization_id}/ou/{organizational_unit_id}/ou/{organizational_unit_id}/account/{account_id}` - # where there can be any number of organizational units. - # For Azure, it has the format of - # `mg/{management_group_id}/mg/{management_group_id}/subscription/{subscription_id}/rg/{resource_group_name}` - # where there can be any number of management groups. - class Resource - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # AWS metadata associated with the resource, only applicable if the finding's - # cloud provider is Amazon Web Services. - # @!attribute [rw] organization - # @return [::Google::Cloud::SecurityCenter::V1::AwsMetadata::AwsOrganization] - # The AWS organization associated with the resource. - # @!attribute [rw] organizational_units - # @return [::Array<::Google::Cloud::SecurityCenter::V1::AwsMetadata::AwsOrganizationalUnit>] - # A list of AWS organizational units associated with the resource, ordered - # from lowest level (closest to the account) to highest level. - # @!attribute [rw] account - # @return [::Google::Cloud::SecurityCenter::V1::AwsMetadata::AwsAccount] - # The AWS account associated with the resource. - class AwsMetadata - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - - # An organization is a collection of accounts that are centrally managed - # together using consolidated billing, organized hierarchically with - # organizational units (OUs), and controlled with policies. - # @!attribute [rw] id - # @return [::String] - # The unique identifier (ID) for the organization. The regex pattern for an - # organization ID string requires "o-" followed by from 10 to 32 lowercase - # letters or digits. - class AwsOrganization - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # An Organizational Unit (OU) is a container of AWS accounts within a root of - # an organization. Policies that are attached to an OU apply to all accounts - # contained in that OU and in any child OUs. - # @!attribute [rw] id - # @return [::String] - # The unique identifier (ID) associated with this OU. The regex pattern for - # an organizational unit ID string requires "ou-" followed by from 4 to 32 - # lowercase letters or digits (the ID of the root that contains the OU). - # This string is followed by a second "-" dash and from 8 to 32 additional - # lowercase letters or digits. For example, "ou-ab12-cd34ef56". - # @!attribute [rw] name - # @return [::String] - # The friendly name of the OU. - class AwsOrganizationalUnit - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # An AWS account that is a member of an organization. - # @!attribute [rw] id - # @return [::String] - # The unique identifier (ID) of the account, containing exactly 12 digits. - # @!attribute [rw] name - # @return [::String] - # The friendly name of this account. - class AwsAccount - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - end - - # Azure metadata associated with the resource, only applicable if the finding's - # cloud provider is Microsoft Azure. - # @!attribute [rw] management_groups - # @return [::Array<::Google::Cloud::SecurityCenter::V1::AzureMetadata::AzureManagementGroup>] - # A list of Azure management groups associated with the resource, ordered - # from lowest level (closest to the subscription) to highest level. - # @!attribute [rw] subscription - # @return [::Google::Cloud::SecurityCenter::V1::AzureMetadata::AzureSubscription] - # The Azure subscription associated with the resource. - # @!attribute [rw] resource_group - # @return [::Google::Cloud::SecurityCenter::V1::AzureMetadata::AzureResourceGroup] - # The Azure resource group associated with the resource. - class AzureMetadata - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - - # Represents an Azure management group. - # @!attribute [rw] id - # @return [::String] - # The UUID of the Azure management group, for example, - # `20000000-0001-0000-0000-000000000000`. - # @!attribute [rw] display_name - # @return [::String] - # The display name of the Azure management group. - class AzureManagementGroup - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Represents an Azure subscription. - # @!attribute [rw] id - # @return [::String] - # The UUID of the Azure subscription, for example, - # `291bba3f-e0a5-47bc-a099-3bdcb2a50a05`. - # @!attribute [rw] display_name - # @return [::String] - # The display name of the Azure subscription. - class AzureSubscription - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Represents an Azure resource group. - # @!attribute [rw] name - # @return [::String] - # The name of the Azure resource group. This is not a UUID. - class AzureResourceGroup - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - end - - # Represents the path of resources leading up to the resource this finding is - # about. - # @!attribute [rw] nodes - # @return [::Array<::Google::Cloud::SecurityCenter::V1::ResourcePath::ResourcePathNode>] - # The list of nodes that make the up resource path, ordered from lowest - # level to highest level. - class ResourcePath - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - - # A node within the resource path. Each node represents a resource within the - # resource hierarchy. - # @!attribute [rw] node_type - # @return [::Google::Cloud::SecurityCenter::V1::ResourcePath::ResourcePathNodeType] - # The type of resource this node represents. - # @!attribute [rw] id - # @return [::String] - # The ID of the resource this node represents. - # @!attribute [rw] display_name - # @return [::String] - # The display name of the resource this node represents. - class ResourcePathNode - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # The type of resource the node represents. - module ResourcePathNodeType - # Node type is unspecified. - RESOURCE_PATH_NODE_TYPE_UNSPECIFIED = 0 - - # The node represents a Google Cloud organization. - GCP_ORGANIZATION = 1 - - # The node represents a Google Cloud folder. - GCP_FOLDER = 2 - - # The node represents a Google Cloud project. - GCP_PROJECT = 3 - - # The node represents an AWS organization. - AWS_ORGANIZATION = 4 - - # The node represents an AWS organizational unit. - AWS_ORGANIZATIONAL_UNIT = 5 - - # The node represents an AWS account. - AWS_ACCOUNT = 6 - - # The node represents an Azure management group. - AZURE_MANAGEMENT_GROUP = 7 - - # The node represents an Azure subscription. - AZURE_SUBSCRIPTION = 8 - - # The node represents an Azure resource group. - AZURE_RESOURCE_GROUP = 9 - end - end - - # Enumeration representing the various cloud providers a finding's resource - # could reside in. - module CloudProvider - # The cloud provider is unspecified. - CLOUD_PROVIDER_UNSPECIFIED = 0 - - # The cloud provider is Google Cloud Platform. - GOOGLE_CLOUD_PLATFORM = 1 - - # The cloud provider is Amazon Web Services. - AMAZON_WEB_SERVICES = 2 - - # The cloud provider is Microsoft Azure. - MICROSOFT_AZURE = 3 - end - end - end - end -end diff --git a/owl-bot-staging/google-cloud-security_center-v1/proto_docs/google/cloud/securitycenter/v1/resource_value_config.rb b/owl-bot-staging/google-cloud-security_center-v1/proto_docs/google/cloud/securitycenter/v1/resource_value_config.rb deleted file mode 100644 index f231fe97ed46..000000000000 --- a/owl-bot-staging/google-cloud-security_center-v1/proto_docs/google/cloud/securitycenter/v1/resource_value_config.rb +++ /dev/null @@ -1,125 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - - -module Google - module Cloud - module SecurityCenter - module V1 - # A resource value configuration (RVC) is a mapping configuration of user's - # resources to resource values. Used in Attack path simulations. - # @!attribute [rw] name - # @return [::String] - # Name for the resource value configuration - # @!attribute [rw] resource_value - # @return [::Google::Cloud::SecurityCenter::V1::ResourceValue] - # Required. Resource value level this expression represents - # @!attribute [rw] tag_values - # @return [::Array<::String>] - # Required. Tag values combined with `AND` to check against. - # Values in the form "tagValues/123" - # Example: `[ "tagValues/123", "tagValues/456", "tagValues/789" ]` - # https://cloud.google.com/resource-manager/docs/tags/tags-creating-and-managing - # @!attribute [rw] resource_type - # @return [::String] - # Apply resource_value only to resources that match resource_type. - # resource_type will be checked with `AND` of other resources. - # For example, "storage.googleapis.com/Bucket" with resource_value "HIGH" - # will apply "HIGH" value only to "storage.googleapis.com/Bucket" resources. - # @!attribute [rw] scope - # @return [::String] - # Project or folder to scope this configuration to. - # For example, "project/456" would apply this configuration only to resources - # in "project/456" scope will be checked with `AND` of other - # resources. - # @!attribute [rw] resource_labels_selector - # @return [::Google::Protobuf::Map{::String => ::String}] - # List of resource labels to search for, evaluated with `AND`. - # For example, `"resource_labels_selector": {"key": "value", "env": "prod"}` - # will match resources with labels "key": "value" `AND` "env": - # "prod" - # https://cloud.google.com/resource-manager/docs/creating-managing-labels - # @!attribute [rw] description - # @return [::String] - # Description of the resource value configuration. - # @!attribute [r] create_time - # @return [::Google::Protobuf::Timestamp] - # Output only. Timestamp this resource value configuration was created. - # @!attribute [r] update_time - # @return [::Google::Protobuf::Timestamp] - # Output only. Timestamp this resource value configuration was last updated. - # @!attribute [rw] cloud_provider - # @return [::Google::Cloud::SecurityCenter::V1::CloudProvider] - # Cloud provider this configuration applies to - # @!attribute [rw] sensitive_data_protection_mapping - # @return [::Google::Cloud::SecurityCenter::V1::ResourceValueConfig::SensitiveDataProtectionMapping] - # A mapping of the sensitivity on Sensitive Data Protection finding to - # resource values. This mapping can only be used in combination with a - # resource_type that is related to BigQuery, e.g. - # "bigquery.googleapis.com/Dataset". - class ResourceValueConfig - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - - # Resource value mapping for Sensitive Data Protection findings. - # If any of these mappings have a resource value that is not unspecified, - # the resource_value field will be ignored when reading this configuration. - # @!attribute [rw] high_sensitivity_mapping - # @return [::Google::Cloud::SecurityCenter::V1::ResourceValue] - # Resource value mapping for high-sensitivity Sensitive Data Protection - # findings - # @!attribute [rw] medium_sensitivity_mapping - # @return [::Google::Cloud::SecurityCenter::V1::ResourceValue] - # Resource value mapping for medium-sensitivity Sensitive Data Protection - # findings - class SensitiveDataProtectionMapping - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # @!attribute [rw] key - # @return [::String] - # @!attribute [rw] value - # @return [::String] - class ResourceLabelsSelectorEntry - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - end - - # Value enum to map to a resource - module ResourceValue - # Unspecific value - RESOURCE_VALUE_UNSPECIFIED = 0 - - # High resource value - HIGH = 1 - - # Medium resource value - MEDIUM = 2 - - # Low resource value - LOW = 3 - - # No resource value, e.g. ignore these resources - NONE = 4 - end - end - end - end -end diff --git a/owl-bot-staging/google-cloud-security_center-v1/proto_docs/google/cloud/securitycenter/v1/run_asset_discovery_response.rb b/owl-bot-staging/google-cloud-security_center-v1/proto_docs/google/cloud/securitycenter/v1/run_asset_discovery_response.rb deleted file mode 100644 index c00c755d2726..000000000000 --- a/owl-bot-staging/google-cloud-security_center-v1/proto_docs/google/cloud/securitycenter/v1/run_asset_discovery_response.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! - - -module Google - module Cloud - module SecurityCenter - module V1 - # Response of asset discovery run - # @!attribute [rw] state - # @return [::Google::Cloud::SecurityCenter::V1::RunAssetDiscoveryResponse::State] - # The state of an asset discovery run. - # @!attribute [rw] duration - # @return [::Google::Protobuf::Duration] - # The duration between asset discovery run start and end - class RunAssetDiscoveryResponse - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - - # The state of an asset discovery run. - module State - # Asset discovery run state was unspecified. - STATE_UNSPECIFIED = 0 - - # Asset discovery run completed successfully. - COMPLETED = 1 - - # Asset discovery run was cancelled with tasks still pending, as another - # run for the same organization was started with a higher priority. - SUPERSEDED = 2 - - # Asset discovery run was killed and terminated. - TERMINATED = 3 - end - end - end - end - end -end diff --git a/owl-bot-staging/google-cloud-security_center-v1/proto_docs/google/cloud/securitycenter/v1/security_health_analytics_custom_config.rb b/owl-bot-staging/google-cloud-security_center-v1/proto_docs/google/cloud/securitycenter/v1/security_health_analytics_custom_config.rb deleted file mode 100644 index 042d8ac3a7b6..000000000000 --- a/owl-bot-staging/google-cloud-security_center-v1/proto_docs/google/cloud/securitycenter/v1/security_health_analytics_custom_config.rb +++ /dev/null @@ -1,112 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - - -module Google - module Cloud - module SecurityCenter - module V1 - # Defines the properties in a custom module configuration for Security - # Health Analytics. Use the custom module configuration to create custom - # detectors that generate custom findings for resources that you specify. - # @!attribute [rw] predicate - # @return [::Google::Type::Expr] - # The CEL expression to evaluate to produce findings. When the expression - # evaluates to true against a resource, a finding is generated. - # @!attribute [rw] custom_output - # @return [::Google::Cloud::SecurityCenter::V1::CustomConfig::CustomOutputSpec] - # Custom output properties. - # @!attribute [rw] resource_selector - # @return [::Google::Cloud::SecurityCenter::V1::CustomConfig::ResourceSelector] - # The resource types that the custom module operates on. Each custom module - # can specify up to 5 resource types. - # @!attribute [rw] severity - # @return [::Google::Cloud::SecurityCenter::V1::CustomConfig::Severity] - # The severity to assign to findings generated by the module. - # @!attribute [rw] description - # @return [::String] - # Text that describes the vulnerability or misconfiguration that the custom - # module detects. This explanation is returned with each finding instance to - # help investigators understand the detected issue. The text must be enclosed - # in quotation marks. - # @!attribute [rw] recommendation - # @return [::String] - # An explanation of the recommended steps that security teams can take to - # resolve the detected issue. This explanation is returned with each finding - # generated by this module in the `nextSteps` property of the finding JSON. - class CustomConfig - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - - # A set of optional name-value pairs that define custom source properties to - # return with each finding that is generated by the custom module. The custom - # source properties that are defined here are included in the finding JSON - # under `sourceProperties`. - # @!attribute [rw] properties - # @return [::Array<::Google::Cloud::SecurityCenter::V1::CustomConfig::CustomOutputSpec::Property>] - # A list of custom output properties to add to the finding. - class CustomOutputSpec - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - - # An individual name-value pair that defines a custom source property. - # @!attribute [rw] name - # @return [::String] - # Name of the property for the custom output. - # @!attribute [rw] value_expression - # @return [::Google::Type::Expr] - # The CEL expression for the custom output. A resource property can be - # specified to return the value of the property or a text string enclosed - # in quotation marks. - class Property - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - end - - # Resource for selecting resource type. - # @!attribute [rw] resource_types - # @return [::Array<::String>] - # The resource types to run the detector on. - class ResourceSelector - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Defines the valid value options for the severity of a finding. - module Severity - # Unspecified severity. - SEVERITY_UNSPECIFIED = 0 - - # Critical severity. - CRITICAL = 1 - - # High severity. - HIGH = 2 - - # Medium severity. - MEDIUM = 3 - - # Low severity. - LOW = 4 - end - end - end - end - end -end diff --git a/owl-bot-staging/google-cloud-security_center-v1/proto_docs/google/cloud/securitycenter/v1/security_health_analytics_custom_module.rb b/owl-bot-staging/google-cloud-security_center-v1/proto_docs/google/cloud/securitycenter/v1/security_health_analytics_custom_module.rb deleted file mode 100644 index 0b327125cfc6..000000000000 --- a/owl-bot-staging/google-cloud-security_center-v1/proto_docs/google/cloud/securitycenter/v1/security_health_analytics_custom_module.rb +++ /dev/null @@ -1,90 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - - -module Google - module Cloud - module SecurityCenter - module V1 - # Represents an instance of a Security Health Analytics custom module, - # including its full module name, display name, enablement state, and last - # updated time. You can create a custom module at the organization, folder, or - # project level. Custom modules that you create at the organization or folder - # level are inherited by the child folders and projects. - # @!attribute [rw] name - # @return [::String] - # Immutable. The resource name of the custom module. - # Its format is - # "organizations/\\{organization}/securityHealthAnalyticsSettings/customModules/\\{customModule}", - # or - # "folders/\\{folder}/securityHealthAnalyticsSettings/customModules/\\{customModule}", - # or - # "projects/\\{project}/securityHealthAnalyticsSettings/customModules/\\{customModule}" - # - # The id \\{customModule} is server-generated and is not user settable. - # It will be a numeric id containing 1-20 digits. - # @!attribute [rw] display_name - # @return [::String] - # The display name of the Security Health Analytics custom module. This - # display name becomes the finding category for all findings that are - # returned by this custom module. The display name must be between 1 and - # 128 characters, start with a lowercase letter, and contain alphanumeric - # characters or underscores only. - # @!attribute [rw] enablement_state - # @return [::Google::Cloud::SecurityCenter::V1::SecurityHealthAnalyticsCustomModule::EnablementState] - # The enablement state of the custom module. - # @!attribute [r] update_time - # @return [::Google::Protobuf::Timestamp] - # Output only. The time at which the custom module was last updated. - # @!attribute [r] last_editor - # @return [::String] - # Output only. The editor that last updated the custom module. - # @!attribute [r] ancestor_module - # @return [::String] - # Output only. If empty, indicates that the custom module was created in the - # organization, folder, or project in which you are viewing the custom - # module. Otherwise, `ancestor_module` specifies the organization or folder - # from which the custom module is inherited. - # @!attribute [rw] custom_config - # @return [::Google::Cloud::SecurityCenter::V1::CustomConfig] - # The user specified custom configuration for the module. - class SecurityHealthAnalyticsCustomModule - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - - # Possible enablement states of a custom module. - module EnablementState - # Unspecified enablement state. - ENABLEMENT_STATE_UNSPECIFIED = 0 - - # The module is enabled at the given CRM resource. - ENABLED = 1 - - # The module is disabled at the given CRM resource. - DISABLED = 2 - - # State is inherited from an ancestor module. The module will either - # be effectively ENABLED or DISABLED based on its closest non-inherited - # ancestor module in the CRM hierarchy. - INHERITED = 3 - end - end - end - end - end -end diff --git a/owl-bot-staging/google-cloud-security_center-v1/proto_docs/google/cloud/securitycenter/v1/security_marks.rb b/owl-bot-staging/google-cloud-security_center-v1/proto_docs/google/cloud/securitycenter/v1/security_marks.rb deleted file mode 100644 index 0fd162583773..000000000000 --- a/owl-bot-staging/google-cloud-security_center-v1/proto_docs/google/cloud/securitycenter/v1/security_marks.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 Cloud - module SecurityCenter - module V1 - # User specified security marks that are attached to the parent Security - # Command Center resource. Security marks are scoped within a Security Command - # Center organization -- they can be modified and viewed by all users who have - # proper permissions on the organization. - # @!attribute [rw] name - # @return [::String] - # The relative resource name of the SecurityMarks. See: - # https://cloud.google.com/apis/design/resource_names#relative_resource_name - # Examples: - # "organizations/\\{organization_id}/assets/\\{asset_id}/securityMarks" - # "organizations/\\{organization_id}/sources/\\{source_id}/findings/\\{finding_id}/securityMarks". - # @!attribute [rw] marks - # @return [::Google::Protobuf::Map{::String => ::String}] - # Mutable user specified security marks belonging to the parent resource. - # Constraints are as follows: - # - # * Keys and values are treated as case insensitive - # * Keys must be between 1 - 256 characters (inclusive) - # * Keys must be letters, numbers, underscores, or dashes - # * Values have leading and trailing whitespace trimmed, remaining - # characters must be between 1 - 4096 characters (inclusive) - # @!attribute [rw] canonical_name - # @return [::String] - # The canonical name of the marks. - # Examples: - # "organizations/\\{organization_id}/assets/\\{asset_id}/securityMarks" - # "folders/\\{folder_id}/assets/\\{asset_id}/securityMarks" - # "projects/\\{project_number}/assets/\\{asset_id}/securityMarks" - # "organizations/\\{organization_id}/sources/\\{source_id}/findings/\\{finding_id}/securityMarks" - # "folders/\\{folder_id}/sources/\\{source_id}/findings/\\{finding_id}/securityMarks" - # "projects/\\{project_number}/sources/\\{source_id}/findings/\\{finding_id}/securityMarks" - class SecurityMarks - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - - # @!attribute [rw] key - # @return [::String] - # @!attribute [rw] value - # @return [::String] - class MarksEntry - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - end - end - end - end -end diff --git a/owl-bot-staging/google-cloud-security_center-v1/proto_docs/google/cloud/securitycenter/v1/security_posture.rb b/owl-bot-staging/google-cloud-security_center-v1/proto_docs/google/cloud/securitycenter/v1/security_posture.rb deleted file mode 100644 index fb8f89c609e0..000000000000 --- a/owl-bot-staging/google-cloud-security_center-v1/proto_docs/google/cloud/securitycenter/v1/security_posture.rb +++ /dev/null @@ -1,83 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - - -module Google - module Cloud - module SecurityCenter - module V1 - # Represents a posture that is deployed on Google Cloud by the - # Security Command Center Posture Management service. - # A posture contains one or more policy sets. A policy set is a - # group of policies that enforce a set of security rules on Google - # Cloud. - # @!attribute [rw] name - # @return [::String] - # Name of the posture, for example, `CIS-Posture`. - # @!attribute [rw] revision_id - # @return [::String] - # The version of the posture, for example, `c7cfa2a8`. - # @!attribute [rw] posture_deployment_resource - # @return [::String] - # The project, folder, or organization on which the posture is deployed, - # for example, `projects/{project_number}`. - # @!attribute [rw] posture_deployment - # @return [::String] - # The name of the posture deployment, for example, - # `organizations/{org_id}/posturedeployments/{posture_deployment_id}`. - # @!attribute [rw] changed_policy - # @return [::String] - # The name of the updated policy, for example, - # `projects/{project_id}/policies/{constraint_name}`. - # @!attribute [rw] policy_set - # @return [::String] - # The name of the updated policyset, for example, `cis-policyset`. - # @!attribute [rw] policy - # @return [::String] - # The ID of the updated policy, for example, `compute-policy-1`. - # @!attribute [rw] policy_drift_details - # @return [::Array<::Google::Cloud::SecurityCenter::V1::SecurityPosture::PolicyDriftDetails>] - # The details about a change in an updated policy that violates the deployed - # posture. - class SecurityPosture - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - - # The policy field that violates the deployed posture and its expected and - # detected values. - # @!attribute [rw] field - # @return [::String] - # The name of the updated field, for example - # constraint.implementation.policy_rules[0].enforce - # @!attribute [rw] expected_value - # @return [::String] - # The value of this field that was configured in a posture, for example, - # `true` or `allowed_values={"projects/29831892"}`. - # @!attribute [rw] detected_value - # @return [::String] - # The detected value that violates the deployed posture, for example, - # `false` or `allowed_values={"projects/22831892"}`. - class PolicyDriftDetails - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - end - end - end - end -end diff --git a/owl-bot-staging/google-cloud-security_center-v1/proto_docs/google/cloud/securitycenter/v1/securitycenter_service.rb b/owl-bot-staging/google-cloud-security_center-v1/proto_docs/google/cloud/securitycenter/v1/securitycenter_service.rb deleted file mode 100644 index 6b9045050b73..000000000000 --- a/owl-bot-staging/google-cloud-security_center-v1/proto_docs/google/cloud/securitycenter/v1/securitycenter_service.rb +++ /dev/null @@ -1,2146 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - - -module Google - module Cloud - module SecurityCenter - module V1 - # Request message for bulk findings update. - # - # Note: - # 1. If multiple bulk update requests match the same resource, the order in - # which they get executed is not defined. - # 2. Once a bulk operation is started, there is no way to stop it. - # @!attribute [rw] parent - # @return [::String] - # Required. The parent, at which bulk action needs to be applied. Its format - # is `organizations/[organization_id]`, `folders/[folder_id]`, - # `projects/[project_id]`. - # @!attribute [rw] filter - # @return [::String] - # Expression that identifies findings that should be updated. - # The expression is a list of zero or more restrictions combined - # via logical operators `AND` and `OR`. Parentheses are supported, and `OR` - # has higher precedence than `AND`. - # - # Restrictions have the form ` ` and may have a - # `-` character in front of them to indicate negation. The fields map to - # those defined in the corresponding resource. - # - # The supported operators are: - # - # * `=` for all value types. - # * `>`, `<`, `>=`, `<=` for integer values. - # * `:`, meaning substring matching, for strings. - # - # The supported value types are: - # - # * string literals in quotes. - # * integer literals without quotes. - # * boolean literals `true` and `false` without quotes. - # @!attribute [rw] mute_annotation - # @deprecated This field is deprecated and may be removed in the next major version update. - # @return [::String] - # This can be a mute configuration name or any identifier for mute/unmute - # of findings based on the filter. - # @!attribute [rw] mute_state - # @return [::Google::Cloud::SecurityCenter::V1::BulkMuteFindingsRequest::MuteState] - # Optional. All findings matching the given filter will have their mute state - # set to this value. The default value is `MUTED`. Setting this to - # `UNDEFINED` will clear the mute state on all matching findings. - class BulkMuteFindingsRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - - # The mute state. - module MuteState - # Unused. - MUTE_STATE_UNSPECIFIED = 0 - - # Matching findings will be muted (default). - MUTED = 1 - - # Matching findings will have their mute state cleared. - UNDEFINED = 2 - end - end - - # The response to a BulkMute request. Contains the LRO information. - class BulkMuteFindingsResponse - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Request message for creating a finding. - # @!attribute [rw] parent - # @return [::String] - # Required. Resource name of the new finding's parent. Its format should be - # `organizations/[organization_id]/sources/[source_id]`. - # @!attribute [rw] finding_id - # @return [::String] - # Required. Unique identifier provided by the client within the parent scope. - # It must be alphanumeric and less than or equal to 32 characters and - # greater than 0 characters in length. - # @!attribute [rw] finding - # @return [::Google::Cloud::SecurityCenter::V1::Finding] - # Required. The Finding being created. The name and security_marks will be - # ignored as they are both output only fields on this resource. - class CreateFindingRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Request message for creating a mute config. - # @!attribute [rw] parent - # @return [::String] - # Required. Resource name of the new mute configs's parent. Its format is - # `organizations/[organization_id]`, `folders/[folder_id]`, or - # `projects/[project_id]`. - # @!attribute [rw] mute_config - # @return [::Google::Cloud::SecurityCenter::V1::MuteConfig] - # Required. The mute config being created. - # @!attribute [rw] mute_config_id - # @return [::String] - # Required. Unique identifier provided by the client within the parent scope. - # It must consist of only lowercase letters, numbers, and hyphens, must start - # with a letter, must end with either a letter or a number, and must be 63 - # characters or less. - class CreateMuteConfigRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Request message to create single resource value config - # @!attribute [rw] parent - # @return [::String] - # Required. Resource name of the new ResourceValueConfig's parent. - # @!attribute [rw] resource_value_config - # @return [::Google::Cloud::SecurityCenter::V1::ResourceValueConfig] - # Required. The resource value config being created. - class CreateResourceValueConfigRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Request message to create multiple resource value configs - # @!attribute [rw] parent - # @return [::String] - # Required. Resource name of the new ResourceValueConfig's parent. - # The parent field in the CreateResourceValueConfigRequest - # messages must either be empty or match this field. - # @!attribute [rw] requests - # @return [::Array<::Google::Cloud::SecurityCenter::V1::CreateResourceValueConfigRequest>] - # Required. The resource value configs to be created. - class BatchCreateResourceValueConfigsRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Response message for BatchCreateResourceValueConfigs - # @!attribute [rw] resource_value_configs - # @return [::Array<::Google::Cloud::SecurityCenter::V1::ResourceValueConfig>] - # The resource value configs created - class BatchCreateResourceValueConfigsResponse - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Request message to delete resource value config - # @!attribute [rw] name - # @return [::String] - # Required. Name of the ResourceValueConfig to delete - class DeleteResourceValueConfigRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Request message to get resource value config - # @!attribute [rw] name - # @return [::String] - # Required. Name of the resource value config to retrieve. Its format is - # `organizations/{organization}/resourceValueConfigs/{config_id}`. - class GetResourceValueConfigRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Request message to list resource value configs of a parent - # @!attribute [rw] parent - # @return [::String] - # Required. The parent, which owns the collection of resource value configs. - # Its format is - # `organizations/[organization_id]` - # @!attribute [rw] page_size - # @return [::Integer] - # The number of results to return. The service may return fewer than - # this value. - # If unspecified, at most 10 configs will be returned. - # The maximum value is 1000; values above 1000 will be coerced to 1000. - # @!attribute [rw] page_token - # @return [::String] - # A page token, received from a previous `ListResourceValueConfigs` call. - # Provide this to retrieve the subsequent page. - # - # When paginating, all other parameters provided to - # `ListResourceValueConfigs` must match the call that provided the - # page token. - # - # page_size can be specified, and the new page_size will be used. - class ListResourceValueConfigsRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Response message to list resource value configs - # @!attribute [rw] resource_value_configs - # @return [::Array<::Google::Cloud::SecurityCenter::V1::ResourceValueConfig>] - # The resource value configs from the specified parent. - # @!attribute [rw] next_page_token - # @return [::String] - # A token, which can be sent as `page_token` to retrieve the next page. - # If this field is empty, there are no subsequent pages. - class ListResourceValueConfigsResponse - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Request message to update resource value config - # @!attribute [rw] resource_value_config - # @return [::Google::Cloud::SecurityCenter::V1::ResourceValueConfig] - # Required. The resource value config being updated. - # @!attribute [rw] update_mask - # @return [::Google::Protobuf::FieldMask] - # The list of fields to be updated. - # If empty all mutable fields will be updated. - class UpdateResourceValueConfigRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Request message for creating a notification config. - # @!attribute [rw] parent - # @return [::String] - # Required. Resource name of the new notification config's parent. Its format - # is `organizations/[organization_id]`, `folders/[folder_id]`, or - # `projects/[project_id]`. - # @!attribute [rw] config_id - # @return [::String] - # Required. - # Unique identifier provided by the client within the parent scope. - # It must be between 1 and 128 characters and contain alphanumeric - # characters, underscores, or hyphens only. - # @!attribute [rw] notification_config - # @return [::Google::Cloud::SecurityCenter::V1::NotificationConfig] - # Required. The notification config being created. The name and the service - # account will be ignored as they are both output only fields on this - # resource. - class CreateNotificationConfigRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Request message for creating Security Health Analytics custom modules. - # @!attribute [rw] parent - # @return [::String] - # Required. Resource name of the new custom module's parent. Its format is - # `organizations/{organization}/securityHealthAnalyticsSettings`, - # `folders/{folder}/securityHealthAnalyticsSettings`, or - # `projects/{project}/securityHealthAnalyticsSettings` - # @!attribute [rw] security_health_analytics_custom_module - # @return [::Google::Cloud::SecurityCenter::V1::SecurityHealthAnalyticsCustomModule] - # Required. SecurityHealthAnalytics custom module to create. The provided - # name is ignored and reset with provided parent information and - # server-generated ID. - class CreateSecurityHealthAnalyticsCustomModuleRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Request message for creating a source. - # @!attribute [rw] parent - # @return [::String] - # Required. Resource name of the new source's parent. Its format should be - # `organizations/[organization_id]`. - # @!attribute [rw] source - # @return [::Google::Cloud::SecurityCenter::V1::Source] - # Required. The Source being created, only the display_name and description - # will be used. All other fields will be ignored. - class CreateSourceRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Request message for deleting a mute config. - # @!attribute [rw] name - # @return [::String] - # Required. Name of the mute config to delete. Its format is - # `organizations/{organization}/muteConfigs/{config_id}`, - # `folders/{folder}/muteConfigs/{config_id}`, - # `projects/{project}/muteConfigs/{config_id}`, - # `organizations/{organization}/locations/global/muteConfigs/{config_id}`, - # `folders/{folder}/locations/global/muteConfigs/{config_id}`, or - # `projects/{project}/locations/global/muteConfigs/{config_id}`. - class DeleteMuteConfigRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Request message for deleting a notification config. - # @!attribute [rw] name - # @return [::String] - # Required. Name of the notification config to delete. Its format is - # `organizations/[organization_id]/notificationConfigs/[config_id]`, - # `folders/[folder_id]/notificationConfigs/[config_id]`, - # or `projects/[project_id]/notificationConfigs/[config_id]`. - class DeleteNotificationConfigRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Request message for deleting Security Health Analytics custom modules. - # @!attribute [rw] name - # @return [::String] - # Required. Name of the custom module to delete. Its format is - # `organizations/{organization}/securityHealthAnalyticsSettings/customModules/{customModule}`, - # `folders/{folder}/securityHealthAnalyticsSettings/customModules/{customModule}`, - # or - # `projects/{project}/securityHealthAnalyticsSettings/customModules/{customModule}` - class DeleteSecurityHealthAnalyticsCustomModuleRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Request message for retrieving a BigQuery export. - # @!attribute [rw] name - # @return [::String] - # Required. Name of the BigQuery export to retrieve. Its format is - # `organizations/{organization}/bigQueryExports/{export_id}`, - # `folders/{folder}/bigQueryExports/{export_id}`, or - # `projects/{project}/bigQueryExports/{export_id}` - class GetBigQueryExportRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Request message for retrieving a mute config. - # @!attribute [rw] name - # @return [::String] - # Required. Name of the mute config to retrieve. Its format is - # `organizations/{organization}/muteConfigs/{config_id}`, - # `folders/{folder}/muteConfigs/{config_id}`, - # `projects/{project}/muteConfigs/{config_id}`, - # `organizations/{organization}/locations/global/muteConfigs/{config_id}`, - # `folders/{folder}/locations/global/muteConfigs/{config_id}`, or - # `projects/{project}/locations/global/muteConfigs/{config_id}`. - class GetMuteConfigRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Request message for getting a notification config. - # @!attribute [rw] name - # @return [::String] - # Required. Name of the notification config to get. Its format is - # `organizations/[organization_id]/notificationConfigs/[config_id]`, - # `folders/[folder_id]/notificationConfigs/[config_id]`, - # or `projects/[project_id]/notificationConfigs/[config_id]`. - class GetNotificationConfigRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Request message for getting organization settings. - # @!attribute [rw] name - # @return [::String] - # Required. Name of the organization to get organization settings for. Its - # format is `organizations/[organization_id]/organizationSettings`. - class GetOrganizationSettingsRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Request message for getting effective Security Health Analytics custom - # modules. - # @!attribute [rw] name - # @return [::String] - # Required. Name of the effective custom module to get. Its format is - # `organizations/{organization}/securityHealthAnalyticsSettings/effectiveCustomModules/{customModule}`, - # `folders/{folder}/securityHealthAnalyticsSettings/effectiveCustomModules/{customModule}`, - # or - # `projects/{project}/securityHealthAnalyticsSettings/effectiveCustomModules/{customModule}` - class GetEffectiveSecurityHealthAnalyticsCustomModuleRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Request message for getting Security Health Analytics custom modules. - # @!attribute [rw] name - # @return [::String] - # Required. Name of the custom module to get. Its format is - # `organizations/{organization}/securityHealthAnalyticsSettings/customModules/{customModule}`, - # `folders/{folder}/securityHealthAnalyticsSettings/customModules/{customModule}`, - # or - # `projects/{project}/securityHealthAnalyticsSettings/customModules/{customModule}` - class GetSecurityHealthAnalyticsCustomModuleRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Request message for getting a source. - # @!attribute [rw] name - # @return [::String] - # Required. Relative resource name of the source. Its format is - # `organizations/[organization_id]/source/[source_id]`. - class GetSourceRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Request message for grouping by assets. - # @!attribute [rw] parent - # @return [::String] - # Required. The name of the parent to group the assets by. Its format is - # `organizations/[organization_id]`, `folders/[folder_id]`, or - # `projects/[project_id]`. - # @!attribute [rw] filter - # @return [::String] - # Expression that defines the filter to apply across assets. - # The expression is a list of zero or more restrictions combined via logical - # operators `AND` and `OR`. - # Parentheses are supported, and `OR` has higher precedence than `AND`. - # - # Restrictions have the form ` ` and may have a `-` - # character in front of them to indicate negation. The fields map to those - # defined in the Asset resource. Examples include: - # - # * name - # * security_center_properties.resource_name - # * resource_properties.a_property - # * security_marks.marks.marka - # - # The supported operators are: - # - # * `=` for all value types. - # * `>`, `<`, `>=`, `<=` for integer values. - # * `:`, meaning substring matching, for strings. - # - # The supported value types are: - # - # * string literals in quotes. - # * integer literals without quotes. - # * boolean literals `true` and `false` without quotes. - # - # The following field and operator combinations are supported: - # - # * name: `=` - # * update_time: `=`, `>`, `<`, `>=`, `<=` - # - # Usage: This should be milliseconds since epoch or an RFC3339 string. - # Examples: - # `update_time = "2019-06-10T16:07:18-07:00"` - # `update_time = 1560208038000` - # - # * create_time: `=`, `>`, `<`, `>=`, `<=` - # - # Usage: This should be milliseconds since epoch or an RFC3339 string. - # Examples: - # `create_time = "2019-06-10T16:07:18-07:00"` - # `create_time = 1560208038000` - # - # * iam_policy.policy_blob: `=`, `:` - # * resource_properties: `=`, `:`, `>`, `<`, `>=`, `<=` - # * security_marks.marks: `=`, `:` - # * security_center_properties.resource_name: `=`, `:` - # * security_center_properties.resource_display_name: `=`, `:` - # * security_center_properties.resource_type: `=`, `:` - # * security_center_properties.resource_parent: `=`, `:` - # * security_center_properties.resource_parent_display_name: `=`, `:` - # * security_center_properties.resource_project: `=`, `:` - # * security_center_properties.resource_project_display_name: `=`, `:` - # * security_center_properties.resource_owners: `=`, `:` - # - # For example, `resource_properties.size = 100` is a valid filter string. - # - # Use a partial match on the empty string to filter based on a property - # existing: `resource_properties.my_property : ""` - # - # Use a negated partial match on the empty string to filter based on a - # property not existing: `-resource_properties.my_property : ""` - # @!attribute [rw] group_by - # @return [::String] - # Required. Expression that defines what assets fields to use for grouping. - # The string value should follow SQL syntax: comma separated list of fields. - # For example: - # "security_center_properties.resource_project,security_center_properties.project". - # - # The following fields are supported when compare_duration is not set: - # - # * security_center_properties.resource_project - # * security_center_properties.resource_project_display_name - # * security_center_properties.resource_type - # * security_center_properties.resource_parent - # * security_center_properties.resource_parent_display_name - # - # The following fields are supported when compare_duration is set: - # - # * security_center_properties.resource_type - # * security_center_properties.resource_project_display_name - # * security_center_properties.resource_parent_display_name - # @!attribute [rw] compare_duration - # @return [::Google::Protobuf::Duration] - # When compare_duration is set, the GroupResult's "state_change" property is - # updated to indicate whether the asset was added, removed, or remained - # present during the compare_duration period of time that precedes the - # read_time. This is the time between (read_time - compare_duration) and - # read_time. - # - # The state change value is derived based on the presence of the asset at the - # two points in time. Intermediate state changes between the two times don't - # affect the result. For example, the results aren't affected if the asset is - # removed and re-created again. - # - # Possible "state_change" values when compare_duration is specified: - # - # * "ADDED": indicates that the asset was not present at the start of - # compare_duration, but present at reference_time. - # * "REMOVED": indicates that the asset was present at the start of - # compare_duration, but not present at reference_time. - # * "ACTIVE": indicates that the asset was present at both the - # start and the end of the time period defined by - # compare_duration and reference_time. - # - # If compare_duration is not specified, then the only possible state_change - # is "UNUSED", which will be the state_change set for all assets present at - # read_time. - # - # If this field is set then `state_change` must be a specified field in - # `group_by`. - # @!attribute [rw] read_time - # @return [::Google::Protobuf::Timestamp] - # Time used as a reference point when filtering assets. The filter is limited - # to assets existing at the supplied time and their values are those at that - # specific time. Absence of this field will default to the API's version of - # NOW. - # @!attribute [rw] page_token - # @return [::String] - # The value returned by the last `GroupAssetsResponse`; indicates - # that this is a continuation of a prior `GroupAssets` call, and that the - # system should return the next page of data. - # @!attribute [rw] page_size - # @return [::Integer] - # The maximum number of results to return in a single response. Default is - # 10, minimum is 1, maximum is 1000. - class GroupAssetsRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Response message for grouping by assets. - # @!attribute [rw] group_by_results - # @return [::Array<::Google::Cloud::SecurityCenter::V1::GroupResult>] - # Group results. There exists an element for each existing unique - # combination of property/values. The element contains a count for the number - # of times those specific property/values appear. - # @!attribute [rw] read_time - # @return [::Google::Protobuf::Timestamp] - # Time used for executing the groupBy request. - # @!attribute [rw] next_page_token - # @return [::String] - # Token to retrieve the next page of results, or empty if there are no more - # results. - # @!attribute [rw] total_size - # @return [::Integer] - # The total number of results matching the query. - class GroupAssetsResponse - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Request message for grouping by findings. - # @!attribute [rw] parent - # @return [::String] - # Required. Name of the source to groupBy. Its format is - # `organizations/[organization_id]/sources/[source_id]`, - # `folders/[folder_id]/sources/[source_id]`, or - # `projects/[project_id]/sources/[source_id]`. To groupBy across all sources - # provide a source_id of `-`. For example: - # `organizations/{organization_id}/sources/-, folders/{folder_id}/sources/-`, - # or `projects/{project_id}/sources/-` - # @!attribute [rw] filter - # @return [::String] - # Expression that defines the filter to apply across findings. - # The expression is a list of one or more restrictions combined via logical - # operators `AND` and `OR`. - # Parentheses are supported, and `OR` has higher precedence than `AND`. - # - # Restrictions have the form ` ` and may have a `-` - # character in front of them to indicate negation. Examples include: - # - # * name - # * source_properties.a_property - # * security_marks.marks.marka - # - # The supported operators are: - # - # * `=` for all value types. - # * `>`, `<`, `>=`, `<=` for integer values. - # * `:`, meaning substring matching, for strings. - # - # The supported value types are: - # - # * string literals in quotes. - # * integer literals without quotes. - # * boolean literals `true` and `false` without quotes. - # - # The following field and operator combinations are supported: - # - # * name: `=` - # * parent: `=`, `:` - # * resource_name: `=`, `:` - # * state: `=`, `:` - # * category: `=`, `:` - # * external_uri: `=`, `:` - # * event_time: `=`, `>`, `<`, `>=`, `<=` - # - # Usage: This should be milliseconds since epoch or an RFC3339 string. - # Examples: - # `event_time = "2019-06-10T16:07:18-07:00"` - # `event_time = 1560208038000` - # - # * severity: `=`, `:` - # * workflow_state: `=`, `:` - # * security_marks.marks: `=`, `:` - # * source_properties: `=`, `:`, `>`, `<`, `>=`, `<=` - # - # For example, `source_properties.size = 100` is a valid filter string. - # - # Use a partial match on the empty string to filter based on a property - # existing: `source_properties.my_property : ""` - # - # Use a negated partial match on the empty string to filter based on a - # property not existing: `-source_properties.my_property : ""` - # - # * resource: - # * resource.name: `=`, `:` - # * resource.parent_name: `=`, `:` - # * resource.parent_display_name: `=`, `:` - # * resource.project_name: `=`, `:` - # * resource.project_display_name: `=`, `:` - # * resource.type: `=`, `:` - # @!attribute [rw] group_by - # @return [::String] - # Required. Expression that defines what assets fields to use for grouping - # (including `state_change`). The string value should follow SQL syntax: - # comma separated list of fields. For example: "parent,resource_name". - # - # The following fields are supported when compare_duration is set: - # - # * state_change - # @!attribute [rw] read_time - # @return [::Google::Protobuf::Timestamp] - # Time used as a reference point when filtering findings. The filter is - # limited to findings existing at the supplied time and their values are - # those at that specific time. Absence of this field will default to the - # API's version of NOW. - # @!attribute [rw] compare_duration - # @return [::Google::Protobuf::Duration] - # When compare_duration is set, the GroupResult's "state_change" attribute is - # updated to indicate whether the finding had its state changed, the - # finding's state remained unchanged, or if the finding was added during the - # compare_duration period of time that precedes the read_time. This is the - # time between (read_time - compare_duration) and read_time. - # - # The state_change value is derived based on the presence and state of the - # finding at the two points in time. Intermediate state changes between the - # two times don't affect the result. For example, the results aren't affected - # if the finding is made inactive and then active again. - # - # Possible "state_change" values when compare_duration is specified: - # - # * "CHANGED": indicates that the finding was present and matched the given - # filter at the start of compare_duration, but changed its - # state at read_time. - # * "UNCHANGED": indicates that the finding was present and matched the given - # filter at the start of compare_duration and did not change - # state at read_time. - # * "ADDED": indicates that the finding did not match the given filter or - # was not present at the start of compare_duration, but was - # present at read_time. - # * "REMOVED": indicates that the finding was present and matched the - # filter at the start of compare_duration, but did not match - # the filter at read_time. - # - # If compare_duration is not specified, then the only possible state_change - # is "UNUSED", which will be the state_change set for all findings present - # at read_time. - # - # If this field is set then `state_change` must be a specified field in - # `group_by`. - # @!attribute [rw] page_token - # @return [::String] - # The value returned by the last `GroupFindingsResponse`; indicates - # that this is a continuation of a prior `GroupFindings` call, and - # that the system should return the next page of data. - # @!attribute [rw] page_size - # @return [::Integer] - # The maximum number of results to return in a single response. Default is - # 10, minimum is 1, maximum is 1000. - class GroupFindingsRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Response message for group by findings. - # @!attribute [rw] group_by_results - # @return [::Array<::Google::Cloud::SecurityCenter::V1::GroupResult>] - # Group results. There exists an element for each existing unique - # combination of property/values. The element contains a count for the number - # of times those specific property/values appear. - # @!attribute [rw] read_time - # @return [::Google::Protobuf::Timestamp] - # Time used for executing the groupBy request. - # @!attribute [rw] next_page_token - # @return [::String] - # Token to retrieve the next page of results, or empty if there are no more - # results. - # @!attribute [rw] total_size - # @return [::Integer] - # The total number of results matching the query. - class GroupFindingsResponse - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Result containing the properties and count of a groupBy request. - # @!attribute [rw] properties - # @return [::Google::Protobuf::Map{::String => ::Google::Protobuf::Value}] - # Properties matching the groupBy fields in the request. - # @!attribute [rw] count - # @return [::Integer] - # Total count of resources for the given properties. - class GroupResult - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - - # @!attribute [rw] key - # @return [::String] - # @!attribute [rw] value - # @return [::Google::Protobuf::Value] - class PropertiesEntry - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - end - - # Request message for listing descendant Security Health Analytics custom - # modules. - # @!attribute [rw] parent - # @return [::String] - # Required. Name of parent to list descendant custom modules. Its format is - # `organizations/{organization}/securityHealthAnalyticsSettings`, - # `folders/{folder}/securityHealthAnalyticsSettings`, or - # `projects/{project}/securityHealthAnalyticsSettings` - # @!attribute [rw] page_size - # @return [::Integer] - # The maximum number of results to return in a single response. Default is - # 10, minimum is 1, maximum is 1000. - # @!attribute [rw] page_token - # @return [::String] - # The value returned by the last call indicating a continuation - class ListDescendantSecurityHealthAnalyticsCustomModulesRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Response message for listing descendant Security Health Analytics custom - # modules. - # @!attribute [rw] security_health_analytics_custom_modules - # @return [::Array<::Google::Cloud::SecurityCenter::V1::SecurityHealthAnalyticsCustomModule>] - # Custom modules belonging to the requested parent and its descendants. - # @!attribute [rw] next_page_token - # @return [::String] - # If not empty, indicates that there may be more custom modules to be - # returned. - class ListDescendantSecurityHealthAnalyticsCustomModulesResponse - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Request message for listing the valued resources for a given simulation. - # @!attribute [rw] parent - # @return [::String] - # Required. Name of parent to list valued resources. - # - # Valid formats: - # `organizations/{organization}`, - # `organizations/{organization}/simulations/{simulation}` - # `organizations/{organization}/simulations/{simulation}/attackExposureResults/{attack_exposure_result_v2}` - # @!attribute [rw] filter - # @return [::String] - # The filter expression that filters the valued resources in the response. - # Supported fields: - # - # * `resource_value` supports = - # * `resource_type` supports = - # @!attribute [rw] page_token - # @return [::String] - # The value returned by the last `ListValuedResourcesResponse`; indicates - # that this is a continuation of a prior `ListValuedResources` call, and - # that the system should return the next page of data. - # @!attribute [rw] page_size - # @return [::Integer] - # The maximum number of results to return in a single response. Default is - # 10, minimum is 1, maximum is 1000. - # @!attribute [rw] order_by - # @return [::String] - # Optional. The fields by which to order the valued resources response. - # - # Supported fields: - # - # * `exposed_score` - # - # * `resource_value` - # - # * `resource_type` - # - # * `resource` - # - # * `display_name` - # - # Values should be a comma separated list of fields. For example: - # `exposed_score,resource_value`. - # - # The default sorting order is descending. To specify ascending or descending - # order for a field, append a ` ASC` or a ` DESC` suffix, respectively; for - # example: `exposed_score DESC`. - class ListValuedResourcesRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Response message for listing the valued resources for a given simulation. - # @!attribute [rw] valued_resources - # @return [::Array<::Google::Cloud::SecurityCenter::V1::ValuedResource>] - # The valued resources that the attack path simulation identified. - # @!attribute [rw] next_page_token - # @return [::String] - # Token to retrieve the next page of results, or empty if there are no more - # results. - # @!attribute [rw] total_size - # @return [::Integer] - # The estimated total number of results matching the query. - class ListValuedResourcesResponse - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Request message for listing the attack paths for a given simulation or valued - # resource. - # @!attribute [rw] parent - # @return [::String] - # Required. Name of parent to list attack paths. - # - # Valid formats: - # `organizations/{organization}`, - # `organizations/{organization}/simulations/{simulation}` - # `organizations/{organization}/simulations/{simulation}/attackExposureResults/{attack_exposure_result_v2}` - # `organizations/{organization}/simulations/{simulation}/valuedResources/{valued_resource}` - # @!attribute [rw] filter - # @return [::String] - # The filter expression that filters the attack path in the response. - # Supported fields: - # - # * `valued_resources` supports = - # @!attribute [rw] page_token - # @return [::String] - # The value returned by the last `ListAttackPathsResponse`; indicates - # that this is a continuation of a prior `ListAttackPaths` call, and - # that the system should return the next page of data. - # @!attribute [rw] page_size - # @return [::Integer] - # The maximum number of results to return in a single response. Default is - # 10, minimum is 1, maximum is 1000. - class ListAttackPathsRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Response message for listing the attack paths for a given simulation or - # valued resource. - # @!attribute [rw] attack_paths - # @return [::Array<::Google::Cloud::SecurityCenter::V1::AttackPath>] - # The attack paths that the attack path simulation identified. - # @!attribute [rw] next_page_token - # @return [::String] - # Token to retrieve the next page of results, or empty if there are no more - # results. - class ListAttackPathsResponse - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Request message for getting simulation. - # Simulation name can include "latest" to retrieve the latest simulation - # For example, "organizations/123/simulations/latest" - # @!attribute [rw] name - # @return [::String] - # Required. The organization name or simulation name of this simulation - # - # Valid format: - # `organizations/{organization}/simulations/latest` - # `organizations/{organization}/simulations/{simulation}` - class GetSimulationRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Request message for getting a valued resource. - # @!attribute [rw] name - # @return [::String] - # Required. The name of this valued resource - # - # Valid format: - # `organizations/{organization}/simulations/{simulation}/valuedResources/{valued_resource}` - class GetValuedResourceRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Request message for listing mute configs at a given scope e.g. organization, - # folder or project. - # @!attribute [rw] parent - # @return [::String] - # Required. The parent, which owns the collection of mute configs. Its format - # is `organizations/[organization_id]`, `folders/[folder_id]`, - # `projects/[project_id]`. - # @!attribute [rw] page_size - # @return [::Integer] - # The maximum number of configs to return. The service may return fewer than - # this value. - # If unspecified, at most 10 configs will be returned. - # The maximum value is 1000; values above 1000 will be coerced to 1000. - # @!attribute [rw] page_token - # @return [::String] - # A page token, received from a previous `ListMuteConfigs` call. - # Provide this to retrieve the subsequent page. - # - # When paginating, all other parameters provided to `ListMuteConfigs` must - # match the call that provided the page token. - class ListMuteConfigsRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Response message for listing mute configs. - # @!attribute [rw] mute_configs - # @return [::Array<::Google::Cloud::SecurityCenter::V1::MuteConfig>] - # The mute configs from the specified parent. - # @!attribute [rw] next_page_token - # @return [::String] - # A token, which can be sent as `page_token` to retrieve the next page. - # If this field is omitted, there are no subsequent pages. - class ListMuteConfigsResponse - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Request message for listing notification configs. - # @!attribute [rw] parent - # @return [::String] - # Required. The name of the parent in which to list the notification - # configurations. Its format is "organizations/[organization_id]", - # "folders/[folder_id]", or "projects/[project_id]". - # @!attribute [rw] page_token - # @return [::String] - # The value returned by the last `ListNotificationConfigsResponse`; indicates - # that this is a continuation of a prior `ListNotificationConfigs` call, and - # that the system should return the next page of data. - # @!attribute [rw] page_size - # @return [::Integer] - # The maximum number of results to return in a single response. Default is - # 10, minimum is 1, maximum is 1000. - class ListNotificationConfigsRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Response message for listing notification configs. - # @!attribute [rw] notification_configs - # @return [::Array<::Google::Cloud::SecurityCenter::V1::NotificationConfig>] - # Notification configs belonging to the requested parent. - # @!attribute [rw] next_page_token - # @return [::String] - # Token to retrieve the next page of results, or empty if there are no more - # results. - class ListNotificationConfigsResponse - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Request message for listing effective Security Health Analytics custom - # modules. - # @!attribute [rw] parent - # @return [::String] - # Required. Name of parent to list effective custom modules. Its format is - # `organizations/{organization}/securityHealthAnalyticsSettings`, - # `folders/{folder}/securityHealthAnalyticsSettings`, or - # `projects/{project}/securityHealthAnalyticsSettings` - # @!attribute [rw] page_size - # @return [::Integer] - # The maximum number of results to return in a single response. Default is - # 10, minimum is 1, maximum is 1000. - # @!attribute [rw] page_token - # @return [::String] - # The value returned by the last call indicating a continuation - class ListEffectiveSecurityHealthAnalyticsCustomModulesRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Response message for listing effective Security Health Analytics custom - # modules. - # @!attribute [rw] effective_security_health_analytics_custom_modules - # @return [::Array<::Google::Cloud::SecurityCenter::V1::EffectiveSecurityHealthAnalyticsCustomModule>] - # Effective custom modules belonging to the requested parent. - # @!attribute [rw] next_page_token - # @return [::String] - # If not empty, indicates that there may be more effective custom modules to - # be returned. - class ListEffectiveSecurityHealthAnalyticsCustomModulesResponse - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Request message for listing Security Health Analytics custom modules. - # @!attribute [rw] parent - # @return [::String] - # Required. Name of parent to list custom modules. Its format is - # `organizations/{organization}/securityHealthAnalyticsSettings`, - # `folders/{folder}/securityHealthAnalyticsSettings`, or - # `projects/{project}/securityHealthAnalyticsSettings` - # @!attribute [rw] page_size - # @return [::Integer] - # The maximum number of results to return in a single response. Default is - # 10, minimum is 1, maximum is 1000. - # @!attribute [rw] page_token - # @return [::String] - # The value returned by the last call indicating a continuation - class ListSecurityHealthAnalyticsCustomModulesRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Response message for listing Security Health Analytics custom modules. - # @!attribute [rw] security_health_analytics_custom_modules - # @return [::Array<::Google::Cloud::SecurityCenter::V1::SecurityHealthAnalyticsCustomModule>] - # Custom modules belonging to the requested parent. - # @!attribute [rw] next_page_token - # @return [::String] - # If not empty, indicates that there may be more custom modules to be - # returned. - class ListSecurityHealthAnalyticsCustomModulesResponse - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Request message for listing sources. - # @!attribute [rw] parent - # @return [::String] - # Required. Resource name of the parent of sources to list. Its format should - # be `organizations/[organization_id]`, `folders/[folder_id]`, or - # `projects/[project_id]`. - # @!attribute [rw] page_token - # @return [::String] - # The value returned by the last `ListSourcesResponse`; indicates - # that this is a continuation of a prior `ListSources` call, and - # that the system should return the next page of data. - # @!attribute [rw] page_size - # @return [::Integer] - # The maximum number of results to return in a single response. Default is - # 10, minimum is 1, maximum is 1000. - class ListSourcesRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Response message for listing sources. - # @!attribute [rw] sources - # @return [::Array<::Google::Cloud::SecurityCenter::V1::Source>] - # Sources belonging to the requested parent. - # @!attribute [rw] next_page_token - # @return [::String] - # Token to retrieve the next page of results, or empty if there are no more - # results. - class ListSourcesResponse - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Request message for listing assets. - # @!attribute [rw] parent - # @return [::String] - # Required. The name of the parent resource that contains the assets. The - # value that you can specify on parent depends on the method in which you - # specify parent. You can specify one of the following values: - # `organizations/[organization_id]`, `folders/[folder_id]`, or - # `projects/[project_id]`. - # @!attribute [rw] filter - # @return [::String] - # Expression that defines the filter to apply across assets. - # The expression is a list of zero or more restrictions combined via logical - # operators `AND` and `OR`. - # Parentheses are supported, and `OR` has higher precedence than `AND`. - # - # Restrictions have the form ` ` and may have a `-` - # character in front of them to indicate negation. The fields map to those - # defined in the Asset resource. Examples include: - # - # * name - # * security_center_properties.resource_name - # * resource_properties.a_property - # * security_marks.marks.marka - # - # The supported operators are: - # - # * `=` for all value types. - # * `>`, `<`, `>=`, `<=` for integer values. - # * `:`, meaning substring matching, for strings. - # - # The supported value types are: - # - # * string literals in quotes. - # * integer literals without quotes. - # * boolean literals `true` and `false` without quotes. - # - # The following are the allowed field and operator combinations: - # - # * name: `=` - # * update_time: `=`, `>`, `<`, `>=`, `<=` - # - # Usage: This should be milliseconds since epoch or an RFC3339 string. - # Examples: - # `update_time = "2019-06-10T16:07:18-07:00"` - # `update_time = 1560208038000` - # - # * create_time: `=`, `>`, `<`, `>=`, `<=` - # - # Usage: This should be milliseconds since epoch or an RFC3339 string. - # Examples: - # `create_time = "2019-06-10T16:07:18-07:00"` - # `create_time = 1560208038000` - # - # * iam_policy.policy_blob: `=`, `:` - # * resource_properties: `=`, `:`, `>`, `<`, `>=`, `<=` - # * security_marks.marks: `=`, `:` - # * security_center_properties.resource_name: `=`, `:` - # * security_center_properties.resource_display_name: `=`, `:` - # * security_center_properties.resource_type: `=`, `:` - # * security_center_properties.resource_parent: `=`, `:` - # * security_center_properties.resource_parent_display_name: `=`, `:` - # * security_center_properties.resource_project: `=`, `:` - # * security_center_properties.resource_project_display_name: `=`, `:` - # * security_center_properties.resource_owners: `=`, `:` - # - # For example, `resource_properties.size = 100` is a valid filter string. - # - # Use a partial match on the empty string to filter based on a property - # existing: `resource_properties.my_property : ""` - # - # Use a negated partial match on the empty string to filter based on a - # property not existing: `-resource_properties.my_property : ""` - # @!attribute [rw] order_by - # @return [::String] - # Expression that defines what fields and order to use for sorting. The - # string value should follow SQL syntax: comma separated list of fields. For - # example: "name,resource_properties.a_property". The default sorting order - # is ascending. To specify descending order for a field, a suffix " desc" - # should be appended to the field name. For example: "name - # desc,resource_properties.a_property". Redundant space characters in the - # syntax are insignificant. "name desc,resource_properties.a_property" and " - # name desc , resource_properties.a_property " are equivalent. - # - # The following fields are supported: - # name - # update_time - # resource_properties - # security_marks.marks - # security_center_properties.resource_name - # security_center_properties.resource_display_name - # security_center_properties.resource_parent - # security_center_properties.resource_parent_display_name - # security_center_properties.resource_project - # security_center_properties.resource_project_display_name - # security_center_properties.resource_type - # @!attribute [rw] read_time - # @return [::Google::Protobuf::Timestamp] - # Time used as a reference point when filtering assets. The filter is limited - # to assets existing at the supplied time and their values are those at that - # specific time. Absence of this field will default to the API's version of - # NOW. - # @!attribute [rw] compare_duration - # @return [::Google::Protobuf::Duration] - # When compare_duration is set, the ListAssetsResult's "state_change" - # attribute is updated to indicate whether the asset was added, removed, or - # remained present during the compare_duration period of time that precedes - # the read_time. This is the time between (read_time - compare_duration) and - # read_time. - # - # The state_change value is derived based on the presence of the asset at the - # two points in time. Intermediate state changes between the two times don't - # affect the result. For example, the results aren't affected if the asset is - # removed and re-created again. - # - # Possible "state_change" values when compare_duration is specified: - # - # * "ADDED": indicates that the asset was not present at the start of - # compare_duration, but present at read_time. - # * "REMOVED": indicates that the asset was present at the start of - # compare_duration, but not present at read_time. - # * "ACTIVE": indicates that the asset was present at both the - # start and the end of the time period defined by - # compare_duration and read_time. - # - # If compare_duration is not specified, then the only possible state_change - # is "UNUSED", which will be the state_change set for all assets present at - # read_time. - # @!attribute [rw] field_mask - # @return [::Google::Protobuf::FieldMask] - # A field mask to specify the ListAssetsResult fields to be listed in the - # response. - # An empty field mask will list all fields. - # @!attribute [rw] page_token - # @return [::String] - # The value returned by the last `ListAssetsResponse`; indicates - # that this is a continuation of a prior `ListAssets` call, and - # that the system should return the next page of data. - # @!attribute [rw] page_size - # @return [::Integer] - # The maximum number of results to return in a single response. Default is - # 10, minimum is 1, maximum is 1000. - class ListAssetsRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Response message for listing assets. - # @!attribute [rw] list_assets_results - # @return [::Array<::Google::Cloud::SecurityCenter::V1::ListAssetsResponse::ListAssetsResult>] - # Assets matching the list request. - # @!attribute [rw] read_time - # @return [::Google::Protobuf::Timestamp] - # Time used for executing the list request. - # @!attribute [rw] next_page_token - # @return [::String] - # Token to retrieve the next page of results, or empty if there are no more - # results. - # @!attribute [rw] total_size - # @return [::Integer] - # The total number of assets matching the query. - class ListAssetsResponse - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - - # Result containing the Asset and its State. - # @!attribute [rw] asset - # @return [::Google::Cloud::SecurityCenter::V1::Asset] - # Asset matching the search request. - # @!attribute [rw] state_change - # @return [::Google::Cloud::SecurityCenter::V1::ListAssetsResponse::ListAssetsResult::StateChange] - # State change of the asset between the points in time. - class ListAssetsResult - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - - # The change in state of the asset. - # - # When querying across two points in time this describes - # the change between the two points: ADDED, REMOVED, or ACTIVE. - # If there was no compare_duration supplied in the request the state change - # will be: UNUSED - module StateChange - # State change is unused, this is the canonical default for this enum. - UNUSED = 0 - - # Asset was added between the points in time. - ADDED = 1 - - # Asset was removed between the points in time. - REMOVED = 2 - - # Asset was present at both point(s) in time. - ACTIVE = 3 - end - end - end - - # Request message for listing findings. - # @!attribute [rw] parent - # @return [::String] - # Required. Name of the source the findings belong to. Its format is - # `organizations/[organization_id]/sources/[source_id]`, - # `folders/[folder_id]/sources/[source_id]`, or - # `projects/[project_id]/sources/[source_id]`. To list across all sources - # provide a source_id of `-`. For example: - # `organizations/{organization_id}/sources/-`, - # `folders/{folder_id}/sources/-` or `projects/{projects_id}/sources/-` - # @!attribute [rw] filter - # @return [::String] - # Expression that defines the filter to apply across findings. - # The expression is a list of one or more restrictions combined via logical - # operators `AND` and `OR`. - # Parentheses are supported, and `OR` has higher precedence than `AND`. - # - # Restrictions have the form ` ` and may have a `-` - # character in front of them to indicate negation. Examples include: - # - # * name - # * source_properties.a_property - # * security_marks.marks.marka - # - # The supported operators are: - # - # * `=` for all value types. - # * `>`, `<`, `>=`, `<=` for integer values. - # * `:`, meaning substring matching, for strings. - # - # The supported value types are: - # - # * string literals in quotes. - # * integer literals without quotes. - # * boolean literals `true` and `false` without quotes. - # - # The following field and operator combinations are supported: - # - # * name: `=` - # * parent: `=`, `:` - # * resource_name: `=`, `:` - # * state: `=`, `:` - # * category: `=`, `:` - # * external_uri: `=`, `:` - # * event_time: `=`, `>`, `<`, `>=`, `<=` - # - # Usage: This should be milliseconds since epoch or an RFC3339 string. - # Examples: - # `event_time = "2019-06-10T16:07:18-07:00"` - # `event_time = 1560208038000` - # - # * severity: `=`, `:` - # * workflow_state: `=`, `:` - # * security_marks.marks: `=`, `:` - # * source_properties: `=`, `:`, `>`, `<`, `>=`, `<=` - # - # For example, `source_properties.size = 100` is a valid filter string. - # - # Use a partial match on the empty string to filter based on a property - # existing: `source_properties.my_property : ""` - # - # Use a negated partial match on the empty string to filter based on a - # property not existing: `-source_properties.my_property : ""` - # - # * resource: - # * resource.name: `=`, `:` - # * resource.parent_name: `=`, `:` - # * resource.parent_display_name: `=`, `:` - # * resource.project_name: `=`, `:` - # * resource.project_display_name: `=`, `:` - # * resource.type: `=`, `:` - # * resource.folders.resource_folder: `=`, `:` - # * resource.display_name: `=`, `:` - # @!attribute [rw] order_by - # @return [::String] - # Expression that defines what fields and order to use for sorting. The - # string value should follow SQL syntax: comma separated list of fields. For - # example: "name,resource_properties.a_property". The default sorting order - # is ascending. To specify descending order for a field, a suffix " desc" - # should be appended to the field name. For example: "name - # desc,source_properties.a_property". Redundant space characters in the - # syntax are insignificant. "name desc,source_properties.a_property" and " - # name desc , source_properties.a_property " are equivalent. - # - # The following fields are supported: - # name - # parent - # state - # category - # resource_name - # event_time - # source_properties - # security_marks.marks - # @!attribute [rw] read_time - # @return [::Google::Protobuf::Timestamp] - # Time used as a reference point when filtering findings. The filter is - # limited to findings existing at the supplied time and their values are - # those at that specific time. Absence of this field will default to the - # API's version of NOW. - # @!attribute [rw] compare_duration - # @return [::Google::Protobuf::Duration] - # When compare_duration is set, the ListFindingsResult's "state_change" - # attribute is updated to indicate whether the finding had its state changed, - # the finding's state remained unchanged, or if the finding was added in any - # state during the compare_duration period of time that precedes the - # read_time. This is the time between (read_time - compare_duration) and - # read_time. - # - # The state_change value is derived based on the presence and state of the - # finding at the two points in time. Intermediate state changes between the - # two times don't affect the result. For example, the results aren't affected - # if the finding is made inactive and then active again. - # - # Possible "state_change" values when compare_duration is specified: - # - # * "CHANGED": indicates that the finding was present and matched the given - # filter at the start of compare_duration, but changed its - # state at read_time. - # * "UNCHANGED": indicates that the finding was present and matched the given - # filter at the start of compare_duration and did not change - # state at read_time. - # * "ADDED": indicates that the finding did not match the given filter or - # was not present at the start of compare_duration, but was - # present at read_time. - # * "REMOVED": indicates that the finding was present and matched the - # filter at the start of compare_duration, but did not match - # the filter at read_time. - # - # If compare_duration is not specified, then the only possible state_change - # is "UNUSED", which will be the state_change set for all findings present at - # read_time. - # @!attribute [rw] field_mask - # @return [::Google::Protobuf::FieldMask] - # A field mask to specify the Finding fields to be listed in the response. - # An empty field mask will list all fields. - # @!attribute [rw] page_token - # @return [::String] - # The value returned by the last `ListFindingsResponse`; indicates - # that this is a continuation of a prior `ListFindings` call, and - # that the system should return the next page of data. - # @!attribute [rw] page_size - # @return [::Integer] - # The maximum number of results to return in a single response. Default is - # 10, minimum is 1, maximum is 1000. - class ListFindingsRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Response message for listing findings. - # @!attribute [rw] list_findings_results - # @return [::Array<::Google::Cloud::SecurityCenter::V1::ListFindingsResponse::ListFindingsResult>] - # Findings matching the list request. - # @!attribute [rw] read_time - # @return [::Google::Protobuf::Timestamp] - # Time used for executing the list request. - # @!attribute [rw] next_page_token - # @return [::String] - # Token to retrieve the next page of results, or empty if there are no more - # results. - # @!attribute [rw] total_size - # @return [::Integer] - # The total number of findings matching the query. - class ListFindingsResponse - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - - # Result containing the Finding and its StateChange. - # @!attribute [rw] finding - # @return [::Google::Cloud::SecurityCenter::V1::Finding] - # Finding matching the search request. - # @!attribute [rw] state_change - # @return [::Google::Cloud::SecurityCenter::V1::ListFindingsResponse::ListFindingsResult::StateChange] - # State change of the finding between the points in time. - # @!attribute [r] resource - # @return [::Google::Cloud::SecurityCenter::V1::ListFindingsResponse::ListFindingsResult::Resource] - # Output only. Resource that is associated with this finding. - class ListFindingsResult - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - - # Information related to the Google Cloud resource that is - # associated with this finding. - # @!attribute [rw] name - # @return [::String] - # The full resource name of the resource. See: - # https://cloud.google.com/apis/design/resource_names#full_resource_name - # @!attribute [rw] display_name - # @return [::String] - # The human readable name of the resource. - # @!attribute [rw] type - # @return [::String] - # The full resource type of the resource. - # @!attribute [rw] project_name - # @return [::String] - # The full resource name of project that the resource belongs to. - # @!attribute [rw] project_display_name - # @return [::String] - # The project ID that the resource belongs to. - # @!attribute [rw] parent_name - # @return [::String] - # The full resource name of resource's parent. - # @!attribute [rw] parent_display_name - # @return [::String] - # The human readable name of resource's parent. - # @!attribute [rw] folders - # @return [::Array<::Google::Cloud::SecurityCenter::V1::Folder>] - # Contains a Folder message for each folder in the assets ancestry. - # The first folder is the deepest nested folder, and the last folder is - # the folder directly under the Organization. - # @!attribute [rw] cloud_provider - # @return [::Google::Cloud::SecurityCenter::V1::CloudProvider] - # Indicates which cloud provider the finding is from. - # @!attribute [rw] organization - # @return [::String] - # Indicates which organization / tenant the finding is for. - # @!attribute [rw] service - # @return [::String] - # The service or resource provider associated with the resource. - # @!attribute [rw] location - # @return [::String] - # The region or location of the service (if applicable). - # @!attribute [rw] aws_metadata - # @return [::Google::Cloud::SecurityCenter::V1::AwsMetadata] - # The AWS metadata associated with the finding. - # - # Note: The following fields are mutually exclusive: `aws_metadata`, `azure_metadata`. If a field in that set is populated, all other fields in the set will automatically be cleared. - # @!attribute [rw] azure_metadata - # @return [::Google::Cloud::SecurityCenter::V1::AzureMetadata] - # The Azure metadata associated with the finding. - # - # Note: The following fields are mutually exclusive: `azure_metadata`, `aws_metadata`. If a field in that set is populated, all other fields in the set will automatically be cleared. - # @!attribute [rw] resource_path - # @return [::Google::Cloud::SecurityCenter::V1::ResourcePath] - # Provides the path to the resource within the resource hierarchy. - # @!attribute [rw] resource_path_string - # @return [::String] - # A string representation of the resource path. - # For Google Cloud, it has the format of - # `org/{organization_id}/folder/{folder_id}/folder/{folder_id}/project/{project_id}` - # where there can be any number of folders. - # For AWS, it has the format of - # `org/{organization_id}/ou/{organizational_unit_id}/ou/{organizational_unit_id}/account/{account_id}` - # where there can be any number of organizational units. - # For Azure, it has the format of - # `mg/{management_group_id}/mg/{management_group_id}/subscription/{subscription_id}/rg/{resource_group_name}` - # where there can be any number of management groups. - class Resource - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # The change in state of the finding. - # - # When querying across two points in time this describes - # the change in the finding between the two points: CHANGED, UNCHANGED, - # ADDED, or REMOVED. Findings can not be deleted, so REMOVED implies that - # the finding at timestamp does not match the filter specified, but it did - # at timestamp - compare_duration. If there was no compare_duration - # supplied in the request the state change will be: UNUSED - module StateChange - # State change is unused, this is the canonical default for this enum. - UNUSED = 0 - - # The finding has changed state in some way between the points in time - # and existed at both points. - CHANGED = 1 - - # The finding has not changed state between the points in time and - # existed at both points. - UNCHANGED = 2 - - # The finding was created between the points in time. - ADDED = 3 - - # The finding at timestamp does not match the filter specified, but it - # did at timestamp - compare_duration. - REMOVED = 4 - end - end - end - - # Request message for updating a finding's state. - # @!attribute [rw] name - # @return [::String] - # Required. The [relative resource - # name](https://cloud.google.com/apis/design/resource_names#relative_resource_name) - # of the finding. Example: - # `organizations/{organization_id}/sources/{source_id}/findings/{finding_id}`, - # `folders/{folder_id}/sources/{source_id}/findings/{finding_id}`, - # `projects/{project_id}/sources/{source_id}/findings/{finding_id}`. - # @!attribute [rw] state - # @return [::Google::Cloud::SecurityCenter::V1::Finding::State] - # Required. The desired State of the finding. - # @!attribute [rw] start_time - # @return [::Google::Protobuf::Timestamp] - # Required. The time at which the updated state takes effect. - class SetFindingStateRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Request message for updating a finding's mute status. - # @!attribute [rw] name - # @return [::String] - # Required. The [relative resource - # name](https://cloud.google.com/apis/design/resource_names#relative_resource_name) - # of the finding. Example: - # `organizations/{organization_id}/sources/{source_id}/findings/{finding_id}`, - # `folders/{folder_id}/sources/{source_id}/findings/{finding_id}`, - # `projects/{project_id}/sources/{source_id}/findings/{finding_id}`. - # @!attribute [rw] mute - # @return [::Google::Cloud::SecurityCenter::V1::Finding::Mute] - # Required. The desired state of the Mute. - class SetMuteRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Request message for running asset discovery for an organization. - # @!attribute [rw] parent - # @return [::String] - # Required. Name of the organization to run asset discovery for. Its format - # is `organizations/[organization_id]`. - class RunAssetDiscoveryRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Request message to simulate a CustomConfig against a given test resource. - # Maximum size of the request is 4 MB by default. - # @!attribute [rw] parent - # @return [::String] - # Required. The relative resource name of the organization, project, or - # folder. For more information about relative resource names, see [Relative - # Resource - # Name](https://cloud.google.com/apis/design/resource_names#relative_resource_name) - # Example: `organizations/{organization_id}` - # @!attribute [rw] custom_config - # @return [::Google::Cloud::SecurityCenter::V1::CustomConfig] - # Required. The custom configuration that you need to test. - # @!attribute [rw] resource - # @return [::Google::Cloud::SecurityCenter::V1::SimulateSecurityHealthAnalyticsCustomModuleRequest::SimulatedResource] - # Required. Resource data to simulate custom module against. - class SimulateSecurityHealthAnalyticsCustomModuleRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - - # Manually constructed resource name. If the custom module evaluates against - # only the resource data, you can omit the `iam_policy_data` field. If it - # evaluates only the `iam_policy_data` field, you can omit the resource data. - # @!attribute [rw] resource_type - # @return [::String] - # Required. The type of the resource, for example, - # `compute.googleapis.com/Disk`. - # @!attribute [rw] resource_data - # @return [::Google::Protobuf::Struct] - # Optional. A representation of the Google Cloud resource. Should match the - # Google Cloud resource JSON format. - # @!attribute [rw] iam_policy_data - # @return [::Google::Iam::V1::Policy] - # Optional. A representation of the IAM policy. - class SimulatedResource - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - end - - # Response message for simulating a `SecurityHealthAnalyticsCustomModule` - # against a given resource. - # @!attribute [rw] result - # @return [::Google::Cloud::SecurityCenter::V1::SimulateSecurityHealthAnalyticsCustomModuleResponse::SimulatedResult] - # Result for test case in the corresponding request. - class SimulateSecurityHealthAnalyticsCustomModuleResponse - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - - # Possible test result. - # @!attribute [rw] finding - # @return [::Google::Cloud::SecurityCenter::V1::Finding] - # Finding that would be published for the test case, - # if a violation is detected. - # - # Note: The following fields are mutually exclusive: `finding`, `no_violation`, `error`. If a field in that set is populated, all other fields in the set will automatically be cleared. - # @!attribute [rw] no_violation - # @return [::Google::Protobuf::Empty] - # Indicates that the test case does not trigger any violation. - # - # Note: The following fields are mutually exclusive: `no_violation`, `finding`, `error`. If a field in that set is populated, all other fields in the set will automatically be cleared. - # @!attribute [rw] error - # @return [::Google::Rpc::Status] - # Error encountered during the test. - # - # Note: The following fields are mutually exclusive: `error`, `finding`, `no_violation`. If a field in that set is populated, all other fields in the set will automatically be cleared. - class SimulatedResult - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - end - - # Request message for updating a ExternalSystem resource. - # @!attribute [rw] external_system - # @return [::Google::Cloud::SecurityCenter::V1::ExternalSystem] - # Required. The external system resource to update. - # @!attribute [rw] update_mask - # @return [::Google::Protobuf::FieldMask] - # The FieldMask to use when updating the external system resource. - # - # If empty all mutable fields will be updated. - class UpdateExternalSystemRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Request message for updating or creating a finding. - # @!attribute [rw] finding - # @return [::Google::Cloud::SecurityCenter::V1::Finding] - # Required. The finding resource to update or create if it does not already - # exist. parent, security_marks, and update_time will be ignored. - # - # In the case of creation, the finding id portion of the name must be - # alphanumeric and less than or equal to 32 characters and greater than 0 - # characters in length. - # @!attribute [rw] update_mask - # @return [::Google::Protobuf::FieldMask] - # The FieldMask to use when updating the finding resource. This field should - # not be specified when creating a finding. - # - # When updating a finding, an empty mask is treated as updating all mutable - # fields and replacing source_properties. Individual source_properties can - # be added/updated by using "source_properties." in the field - # mask. - class UpdateFindingRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Request message for updating a mute config. - # @!attribute [rw] mute_config - # @return [::Google::Cloud::SecurityCenter::V1::MuteConfig] - # Required. The mute config being updated. - # @!attribute [rw] update_mask - # @return [::Google::Protobuf::FieldMask] - # The list of fields to be updated. - # If empty all mutable fields will be updated. - class UpdateMuteConfigRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Request message for updating a notification config. - # @!attribute [rw] notification_config - # @return [::Google::Cloud::SecurityCenter::V1::NotificationConfig] - # Required. The notification config to update. - # @!attribute [rw] update_mask - # @return [::Google::Protobuf::FieldMask] - # The FieldMask to use when updating the notification config. - # - # If empty all mutable fields will be updated. - class UpdateNotificationConfigRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Request message for updating an organization's settings. - # @!attribute [rw] organization_settings - # @return [::Google::Cloud::SecurityCenter::V1::OrganizationSettings] - # Required. The organization settings resource to update. - # @!attribute [rw] update_mask - # @return [::Google::Protobuf::FieldMask] - # The FieldMask to use when updating the settings resource. - # - # If empty all mutable fields will be updated. - class UpdateOrganizationSettingsRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Request message for updating Security Health Analytics custom modules. - # @!attribute [rw] security_health_analytics_custom_module - # @return [::Google::Cloud::SecurityCenter::V1::SecurityHealthAnalyticsCustomModule] - # Required. The SecurityHealthAnalytics custom module to update. - # @!attribute [rw] update_mask - # @return [::Google::Protobuf::FieldMask] - # The list of fields to be updated. The only fields that can be updated are - # `enablement_state` and `custom_config`. If empty or set to the wildcard - # value `*`, both `enablement_state` and `custom_config` are updated. - class UpdateSecurityHealthAnalyticsCustomModuleRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Request message for updating a source. - # @!attribute [rw] source - # @return [::Google::Cloud::SecurityCenter::V1::Source] - # Required. The source resource to update. - # @!attribute [rw] update_mask - # @return [::Google::Protobuf::FieldMask] - # The FieldMask to use when updating the source resource. - # - # If empty all mutable fields will be updated. - class UpdateSourceRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Request message for updating a SecurityMarks resource. - # @!attribute [rw] security_marks - # @return [::Google::Cloud::SecurityCenter::V1::SecurityMarks] - # Required. The security marks resource to update. - # @!attribute [rw] update_mask - # @return [::Google::Protobuf::FieldMask] - # The FieldMask to use when updating the security marks resource. - # - # The field mask must not contain duplicate fields. - # If empty or set to "marks", all marks will be replaced. Individual - # marks can be updated using "marks.". - # @!attribute [rw] start_time - # @return [::Google::Protobuf::Timestamp] - # The time at which the updated SecurityMarks take effect. - # If not set uses current server time. Updates will be applied to the - # SecurityMarks that are active immediately preceding this time. Must be - # earlier or equal to the server time. - class UpdateSecurityMarksRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Request message for creating a BigQuery export. - # @!attribute [rw] parent - # @return [::String] - # Required. The name of the parent resource of the new BigQuery export. Its - # format is `organizations/[organization_id]`, `folders/[folder_id]`, or - # `projects/[project_id]`. - # @!attribute [rw] big_query_export - # @return [::Google::Cloud::SecurityCenter::V1::BigQueryExport] - # Required. The BigQuery export being created. - # @!attribute [rw] big_query_export_id - # @return [::String] - # Required. Unique identifier provided by the client within the parent scope. - # It must consist of only lowercase letters, numbers, and hyphens, must start - # with a letter, must end with either a letter or a number, and must be 63 - # characters or less. - class CreateBigQueryExportRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Request message for updating a BigQuery export. - # @!attribute [rw] big_query_export - # @return [::Google::Cloud::SecurityCenter::V1::BigQueryExport] - # Required. The BigQuery export being updated. - # @!attribute [rw] update_mask - # @return [::Google::Protobuf::FieldMask] - # The list of fields to be updated. - # If empty all mutable fields will be updated. - class UpdateBigQueryExportRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Request message for listing BigQuery exports at a given scope e.g. - # organization, folder or project. - # @!attribute [rw] parent - # @return [::String] - # Required. The parent, which owns the collection of BigQuery exports. Its - # format is `organizations/[organization_id]`, `folders/[folder_id]`, - # `projects/[project_id]`. - # @!attribute [rw] page_size - # @return [::Integer] - # The maximum number of configs to return. The service may return fewer than - # this value. - # If unspecified, at most 10 configs will be returned. - # The maximum value is 1000; values above 1000 will be coerced to 1000. - # @!attribute [rw] page_token - # @return [::String] - # A page token, received from a previous `ListBigQueryExports` call. - # Provide this to retrieve the subsequent page. - # When paginating, all other parameters provided to `ListBigQueryExports` - # must match the call that provided the page token. - class ListBigQueryExportsRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Response message for listing BigQuery exports. - # @!attribute [rw] big_query_exports - # @return [::Array<::Google::Cloud::SecurityCenter::V1::BigQueryExport>] - # The BigQuery exports from the specified parent. - # @!attribute [rw] next_page_token - # @return [::String] - # A token, which can be sent as `page_token` to retrieve the next page. - # If this field is omitted, there are no subsequent pages. - class ListBigQueryExportsResponse - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Request message for deleting a BigQuery export. - # @!attribute [rw] name - # @return [::String] - # Required. The name of the BigQuery export to delete. Its format is - # `organizations/{organization}/bigQueryExports/{export_id}`, - # `folders/{folder}/bigQueryExports/{export_id}`, or - # `projects/{project}/bigQueryExports/{export_id}` - class DeleteBigQueryExportRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Request to create an Event Threat Detection custom module. - # @!attribute [rw] parent - # @return [::String] - # Required. The new custom module's parent. - # - # Its format is: - # - # * `organizations/{organization}/eventThreatDetectionSettings`. - # * `folders/{folder}/eventThreatDetectionSettings`. - # * `projects/{project}/eventThreatDetectionSettings`. - # @!attribute [rw] event_threat_detection_custom_module - # @return [::Google::Cloud::SecurityCenter::V1::EventThreatDetectionCustomModule] - # Required. The module to create. The - # event_threat_detection_custom_module.name will be ignored and server - # generated. - class CreateEventThreatDetectionCustomModuleRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Request to validate an Event Threat Detection custom module. - # @!attribute [rw] parent - # @return [::String] - # Required. Resource name of the parent to validate the Custom Module under. - # - # Its format is: - # - # * `organizations/{organization}/eventThreatDetectionSettings`. - # * `folders/{folder}/eventThreatDetectionSettings`. - # * `projects/{project}/eventThreatDetectionSettings`. - # @!attribute [rw] raw_text - # @return [::String] - # Required. The raw text of the module's contents. Used to generate error - # messages. - # @!attribute [rw] type - # @return [::String] - # Required. The type of the module (e.g. CONFIGURABLE_BAD_IP). - class ValidateEventThreatDetectionCustomModuleRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Response to validating an Event Threat Detection custom module. - # @!attribute [rw] errors - # @return [::Google::Cloud::SecurityCenter::V1::CustomModuleValidationErrors] - # A list of errors returned by the validator. If the list is empty, there - # were no errors. - class ValidateEventThreatDetectionCustomModuleResponse - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Request to delete an Event Threat Detection custom module. - # @!attribute [rw] name - # @return [::String] - # Required. Name of the custom module to delete. - # - # Its format is: - # - # * `organizations/{organization}/eventThreatDetectionSettings/customModules/{module}`. - # * `folders/{folder}/eventThreatDetectionSettings/customModules/{module}`. - # * `projects/{project}/eventThreatDetectionSettings/customModules/{module}`. - class DeleteEventThreatDetectionCustomModuleRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Request to get an Event Threat Detection custom module. - # @!attribute [rw] name - # @return [::String] - # Required. Name of the custom module to get. - # - # Its format is: - # - # * `organizations/{organization}/eventThreatDetectionSettings/customModules/{module}`. - # * `folders/{folder}/eventThreatDetectionSettings/customModules/{module}`. - # * `projects/{project}/eventThreatDetectionSettings/customModules/{module}`. - class GetEventThreatDetectionCustomModuleRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Request to list current and descendant resident Event Threat Detection custom - # modules. - # @!attribute [rw] parent - # @return [::String] - # Required. Name of the parent to list custom modules under. - # - # Its format is: - # - # * `organizations/{organization}/eventThreatDetectionSettings`. - # * `folders/{folder}/eventThreatDetectionSettings`. - # * `projects/{project}/eventThreatDetectionSettings`. - # @!attribute [rw] page_token - # @return [::String] - # A page token, received from a previous - # `ListDescendantEventThreatDetectionCustomModules` call. Provide this to - # retrieve the subsequent page. - # - # When paginating, all other parameters provided to - # `ListDescendantEventThreatDetectionCustomModules` must match the call that - # provided the page token. - # @!attribute [rw] page_size - # @return [::Integer] - # The maximum number of modules to return. The service may return fewer than - # this value. - # If unspecified, at most 10 configs will be returned. - # The maximum value is 1000; values above 1000 will be coerced to 1000. - class ListDescendantEventThreatDetectionCustomModulesRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Response for listing current and descendant resident - # Event Threat Detection custom modules. - # @!attribute [rw] event_threat_detection_custom_modules - # @return [::Array<::Google::Cloud::SecurityCenter::V1::EventThreatDetectionCustomModule>] - # Custom modules belonging to the requested parent. - # @!attribute [rw] next_page_token - # @return [::String] - # A token, which can be sent as `page_token` to retrieve the next page. - # If this field is omitted, there are no subsequent pages. - class ListDescendantEventThreatDetectionCustomModulesResponse - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Request to list Event Threat Detection custom modules. - # @!attribute [rw] parent - # @return [::String] - # Required. Name of the parent to list custom modules under. - # - # Its format is: - # - # * `organizations/{organization}/eventThreatDetectionSettings`. - # * `folders/{folder}/eventThreatDetectionSettings`. - # * `projects/{project}/eventThreatDetectionSettings`. - # @!attribute [rw] page_token - # @return [::String] - # A page token, received from a previous - # `ListEventThreatDetectionCustomModules` call. Provide this to retrieve the - # subsequent page. - # - # When paginating, all other parameters provided to - # `ListEventThreatDetectionCustomModules` must match the call that provided - # the page token. - # @!attribute [rw] page_size - # @return [::Integer] - # The maximum number of modules to return. The service may return fewer than - # this value. - # If unspecified, at most 10 configs will be returned. - # The maximum value is 1000; values above 1000 will be coerced to 1000. - class ListEventThreatDetectionCustomModulesRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Response for listing Event Threat Detection custom modules. - # @!attribute [rw] event_threat_detection_custom_modules - # @return [::Array<::Google::Cloud::SecurityCenter::V1::EventThreatDetectionCustomModule>] - # Custom modules belonging to the requested parent. - # @!attribute [rw] next_page_token - # @return [::String] - # A token, which can be sent as `page_token` to retrieve the next page. - # If this field is omitted, there are no subsequent pages. - class ListEventThreatDetectionCustomModulesResponse - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Request to update an Event Threat Detection custom module. - # @!attribute [rw] event_threat_detection_custom_module - # @return [::Google::Cloud::SecurityCenter::V1::EventThreatDetectionCustomModule] - # Required. The module being updated. - # @!attribute [rw] update_mask - # @return [::Google::Protobuf::FieldMask] - # The list of fields to be updated. - # If empty all mutable fields will be updated. - class UpdateEventThreatDetectionCustomModuleRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Request to get an EffectiveEventThreatDetectionCustomModule. - # @!attribute [rw] name - # @return [::String] - # Required. The resource name of the effective Event Threat Detection custom - # module. - # - # Its format is: - # - # * `organizations/{organization}/eventThreatDetectionSettings/effectiveCustomModules/{module}`. - # * `folders/{folder}/eventThreatDetectionSettings/effectiveCustomModules/{module}`. - # * `projects/{project}/eventThreatDetectionSettings/effectiveCustomModules/{module}`. - class GetEffectiveEventThreatDetectionCustomModuleRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Request to list effective Event Threat Detection custom modules. - # @!attribute [rw] parent - # @return [::String] - # Required. Name of the parent to list custom modules for. - # - # Its format is: - # - # * `organizations/{organization}/eventThreatDetectionSettings`. - # * `folders/{folder}/eventThreatDetectionSettings`. - # * `projects/{project}/eventThreatDetectionSettings`. - # @!attribute [rw] page_token - # @return [::String] - # A page token, received from a previous - # `ListEffectiveEventThreatDetectionCustomModules` call. Provide this to - # retrieve the subsequent page. - # - # When paginating, all other parameters provided to - # `ListEffectiveEventThreatDetectionCustomModules` must match the call that - # provided the page token. - # @!attribute [rw] page_size - # @return [::Integer] - # The maximum number of modules to return. The service may return fewer than - # this value. - # If unspecified, at most 10 configs will be returned. - # The maximum value is 1000; values above 1000 will be coerced to 1000. - class ListEffectiveEventThreatDetectionCustomModulesRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Response for listing EffectiveEventThreatDetectionCustomModules. - # @!attribute [rw] effective_event_threat_detection_custom_modules - # @return [::Array<::Google::Cloud::SecurityCenter::V1::EffectiveEventThreatDetectionCustomModule>] - # Effective custom modules belonging to the requested parent. - # @!attribute [rw] next_page_token - # @return [::String] - # A token, which can be sent as `page_token` to retrieve the next page. - # If this field is omitted, there are no subsequent pages. - class ListEffectiveEventThreatDetectionCustomModulesResponse - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - end - end - end -end diff --git a/owl-bot-staging/google-cloud-security_center-v1/proto_docs/google/cloud/securitycenter/v1/simulation.rb b/owl-bot-staging/google-cloud-security_center-v1/proto_docs/google/cloud/securitycenter/v1/simulation.rb deleted file mode 100644 index 63924f12b411..000000000000 --- a/owl-bot-staging/google-cloud-security_center-v1/proto_docs/google/cloud/securitycenter/v1/simulation.rb +++ /dev/null @@ -1,46 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - - -module Google - module Cloud - module SecurityCenter - module V1 - # Attack path simulation - # @!attribute [rw] name - # @return [::String] - # Full resource name of the Simulation: - # `organizations/123/simulations/456` - # @!attribute [r] create_time - # @return [::Google::Protobuf::Timestamp] - # Output only. Time simulation was created - # @!attribute [rw] resource_value_configs_metadata - # @return [::Array<::Google::Cloud::SecurityCenter::V1::ResourceValueConfigMetadata>] - # Resource value configurations' metadata used in this simulation. Maximum of - # 100. - # @!attribute [rw] cloud_provider - # @return [::Google::Cloud::SecurityCenter::V1::CloudProvider] - # Indicates which cloud provider was used in this simulation. - class Simulation - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - end - end - end -end diff --git a/owl-bot-staging/google-cloud-security_center-v1/proto_docs/google/cloud/securitycenter/v1/source.rb b/owl-bot-staging/google-cloud-security_center-v1/proto_docs/google/cloud/securitycenter/v1/source.rb deleted file mode 100644 index 4ccbdd08fd29..000000000000 --- a/owl-bot-staging/google-cloud-security_center-v1/proto_docs/google/cloud/securitycenter/v1/source.rb +++ /dev/null @@ -1,65 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - - -module Google - module Cloud - module SecurityCenter - module V1 - # Security Command Center finding source. A finding source - # is an entity or a mechanism that can produce a finding. A source is like a - # container of findings that come from the same scanner, logger, monitor, and - # other tools. - # @!attribute [rw] name - # @return [::String] - # The relative resource name of this source. See: - # https://cloud.google.com/apis/design/resource_names#relative_resource_name - # Example: - # "organizations/\\{organization_id}/sources/\\{source_id}" - # @!attribute [rw] display_name - # @return [::String] - # The source's display name. - # A source's display name must be unique amongst its siblings, for example, - # two sources with the same parent can't share the same display name. - # The display name must have a length between 1 and 64 characters - # (inclusive). - # @!attribute [rw] description - # @return [::String] - # The description of the source (max of 1024 characters). - # Example: - # "Web Security Scanner is a web security scanner for common - # vulnerabilities in App Engine applications. It can automatically - # scan and detect four common vulnerabilities, including cross-site-scripting - # (XSS), Flash injection, mixed content (HTTP in HTTPS), and - # outdated or insecure libraries." - # @!attribute [rw] canonical_name - # @return [::String] - # The canonical name of the finding source. It's either - # "organizations/\\{organization_id}/sources/\\{source_id}", - # "folders/\\{folder_id}/sources/\\{source_id}", or - # "projects/\\{project_number}/sources/\\{source_id}", - # depending on the closest CRM ancestor of the resource associated with the - # finding. - class Source - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - end - end - end -end diff --git a/owl-bot-staging/google-cloud-security_center-v1/proto_docs/google/cloud/securitycenter/v1/toxic_combination.rb b/owl-bot-staging/google-cloud-security_center-v1/proto_docs/google/cloud/securitycenter/v1/toxic_combination.rb deleted file mode 100644 index 4ad02b3ce5f0..000000000000 --- a/owl-bot-staging/google-cloud-security_center-v1/proto_docs/google/cloud/securitycenter/v1/toxic_combination.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! - - -module Google - module Cloud - module SecurityCenter - module V1 - # Contains details about a group of security issues that, when the issues - # occur together, represent a greater risk than when the issues occur - # independently. A group of such issues is referred to as a toxic combination. - # @!attribute [rw] attack_exposure_score - # @return [::Float] - # The - # [Attack exposure - # score](https://cloud.google.com/security-command-center/docs/attack-exposure-learn#attack_exposure_scores) - # of this toxic combination. The score is a measure of how much this toxic - # combination exposes one or more high-value resources to potential attack. - # @!attribute [rw] related_findings - # @return [::Array<::String>] - # List of resource names of findings associated with this toxic combination. - # For example, `organizations/123/sources/456/findings/789`. - class ToxicCombination - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - end - end - end -end diff --git a/owl-bot-staging/google-cloud-security_center-v1/proto_docs/google/cloud/securitycenter/v1/valued_resource.rb b/owl-bot-staging/google-cloud-security_center-v1/proto_docs/google/cloud/securitycenter/v1/valued_resource.rb deleted file mode 100644 index 1cd95d5b43f1..000000000000 --- a/owl-bot-staging/google-cloud-security_center-v1/proto_docs/google/cloud/securitycenter/v1/valued_resource.rb +++ /dev/null @@ -1,86 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - - -module Google - module Cloud - module SecurityCenter - module V1 - # A resource that is determined to have value to a user's system - # @!attribute [rw] name - # @return [::String] - # Valued resource name, for example, - # e.g.: - # `organizations/123/simulations/456/valuedResources/789` - # @!attribute [rw] resource - # @return [::String] - # The - # [full resource - # name](https://cloud.google.com/apis/design/resource_names#full_resource_name) - # of the valued resource. - # @!attribute [rw] resource_type - # @return [::String] - # The [resource - # type](https://cloud.google.com/asset-inventory/docs/supported-asset-types) - # of the valued resource. - # @!attribute [rw] display_name - # @return [::String] - # Human-readable name of the valued resource. - # @!attribute [rw] resource_value - # @return [::Google::Cloud::SecurityCenter::V1::ValuedResource::ResourceValue] - # How valuable this resource is. - # @!attribute [rw] exposed_score - # @return [::Float] - # Exposed score for this valued resource. A value of 0 means no exposure was - # detected exposure. - # @!attribute [rw] resource_value_configs_used - # @return [::Array<::Google::Cloud::SecurityCenter::V1::ResourceValueConfigMetadata>] - # List of resource value configurations' metadata used to determine the value - # of this resource. Maximum of 100. - class ValuedResource - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - - # How valuable the resource is. - module ResourceValue - # The resource value isn't specified. - RESOURCE_VALUE_UNSPECIFIED = 0 - - # This is a low-value resource. - RESOURCE_VALUE_LOW = 1 - - # This is a medium-value resource. - RESOURCE_VALUE_MEDIUM = 2 - - # This is a high-value resource. - RESOURCE_VALUE_HIGH = 3 - end - end - - # Metadata about a ResourceValueConfig. For example, id and name. - # @!attribute [rw] name - # @return [::String] - # Resource value config name - class ResourceValueConfigMetadata - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - end - end - end -end diff --git a/owl-bot-staging/google-cloud-security_center-v1/proto_docs/google/cloud/securitycenter/v1/vulnerability.rb b/owl-bot-staging/google-cloud-security_center-v1/proto_docs/google/cloud/securitycenter/v1/vulnerability.rb deleted file mode 100644 index aadd507c0a50..000000000000 --- a/owl-bot-staging/google-cloud-security_center-v1/proto_docs/google/cloud/securitycenter/v1/vulnerability.rb +++ /dev/null @@ -1,336 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - - -module Google - module Cloud - module SecurityCenter - module V1 - # Refers to common vulnerability fields e.g. cve, cvss, cwe etc. - # @!attribute [rw] cve - # @return [::Google::Cloud::SecurityCenter::V1::Cve] - # CVE stands for Common Vulnerabilities and Exposures - # (https://cve.mitre.org/about/) - # @!attribute [rw] offending_package - # @return [::Google::Cloud::SecurityCenter::V1::Package] - # The offending package is relevant to the finding. - # @!attribute [rw] fixed_package - # @return [::Google::Cloud::SecurityCenter::V1::Package] - # The fixed package is relevant to the finding. - # @!attribute [rw] security_bulletin - # @return [::Google::Cloud::SecurityCenter::V1::SecurityBulletin] - # The security bulletin is relevant to this finding. - class Vulnerability - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # CVE stands for Common Vulnerabilities and Exposures. - # Information from the [CVE - # record](https://www.cve.org/ResourcesSupport/Glossary) that describes this - # vulnerability. - # @!attribute [rw] id - # @return [::String] - # The unique identifier for the vulnerability. e.g. CVE-2021-34527 - # @!attribute [rw] references - # @return [::Array<::Google::Cloud::SecurityCenter::V1::Reference>] - # Additional information about the CVE. - # e.g. https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2021-34527 - # @!attribute [rw] cvssv3 - # @return [::Google::Cloud::SecurityCenter::V1::Cvssv3] - # Describe Common Vulnerability Scoring System specified at - # https://www.first.org/cvss/v3.1/specification-document - # @!attribute [rw] upstream_fix_available - # @return [::Boolean] - # Whether upstream fix is available for the CVE. - # @!attribute [rw] impact - # @return [::Google::Cloud::SecurityCenter::V1::Cve::RiskRating] - # The potential impact of the vulnerability if it was to be exploited. - # @!attribute [rw] exploitation_activity - # @return [::Google::Cloud::SecurityCenter::V1::Cve::ExploitationActivity] - # The exploitation activity of the vulnerability in the wild. - # @!attribute [rw] observed_in_the_wild - # @return [::Boolean] - # Whether or not the vulnerability has been observed in the wild. - # @!attribute [rw] zero_day - # @return [::Boolean] - # Whether or not the vulnerability was zero day when the finding was - # published. - # @!attribute [rw] exploit_release_date - # @return [::Google::Protobuf::Timestamp] - # Date the first publicly available exploit or PoC was released. - class Cve - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - - # The possible values of impact of the vulnerability if it was to be - # exploited. - module RiskRating - # Invalid or empty value. - RISK_RATING_UNSPECIFIED = 0 - - # Exploitation would have little to no security impact. - LOW = 1 - - # Exploitation would enable attackers to perform activities, or could allow - # attackers to have a direct impact, but would require additional steps. - MEDIUM = 2 - - # Exploitation would enable attackers to have a notable direct impact - # without needing to overcome any major mitigating factors. - HIGH = 3 - - # Exploitation would fundamentally undermine the security of affected - # systems, enable actors to perform significant attacks with minimal - # effort, with little to no mitigating factors to overcome. - CRITICAL = 4 - end - - # The possible values of exploitation activity of the vulnerability in the - # wild. - module ExploitationActivity - # Invalid or empty value. - EXPLOITATION_ACTIVITY_UNSPECIFIED = 0 - - # Exploitation has been reported or confirmed to widely occur. - WIDE = 1 - - # Limited reported or confirmed exploitation activities. - CONFIRMED = 2 - - # Exploit is publicly available. - AVAILABLE = 3 - - # No known exploitation activity, but has a high potential for - # exploitation. - ANTICIPATED = 4 - - # No known exploitation activity. - NO_KNOWN = 5 - end - end - - # Additional Links - # @!attribute [rw] source - # @return [::String] - # Source of the reference e.g. NVD - # @!attribute [rw] uri - # @return [::String] - # Uri for the mentioned source e.g. - # https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2021-34527. - class Reference - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Common Vulnerability Scoring System version 3. - # @!attribute [rw] base_score - # @return [::Float] - # The base score is a function of the base metric scores. - # @!attribute [rw] attack_vector - # @return [::Google::Cloud::SecurityCenter::V1::Cvssv3::AttackVector] - # Base Metrics - # Represents the intrinsic characteristics of a vulnerability that are - # constant over time and across user environments. - # This metric reflects the context by which vulnerability exploitation is - # possible. - # @!attribute [rw] attack_complexity - # @return [::Google::Cloud::SecurityCenter::V1::Cvssv3::AttackComplexity] - # This metric describes the conditions beyond the attacker's control that - # must exist in order to exploit the vulnerability. - # @!attribute [rw] privileges_required - # @return [::Google::Cloud::SecurityCenter::V1::Cvssv3::PrivilegesRequired] - # This metric describes the level of privileges an attacker must possess - # before successfully exploiting the vulnerability. - # @!attribute [rw] user_interaction - # @return [::Google::Cloud::SecurityCenter::V1::Cvssv3::UserInteraction] - # This metric captures the requirement for a human user, other than the - # attacker, to participate in the successful compromise of the vulnerable - # component. - # @!attribute [rw] scope - # @return [::Google::Cloud::SecurityCenter::V1::Cvssv3::Scope] - # The Scope metric captures whether a vulnerability in one vulnerable - # component impacts resources in components beyond its security scope. - # @!attribute [rw] confidentiality_impact - # @return [::Google::Cloud::SecurityCenter::V1::Cvssv3::Impact] - # This metric measures the impact to the confidentiality of the information - # resources managed by a software component due to a successfully exploited - # vulnerability. - # @!attribute [rw] integrity_impact - # @return [::Google::Cloud::SecurityCenter::V1::Cvssv3::Impact] - # This metric measures the impact to integrity of a successfully exploited - # vulnerability. - # @!attribute [rw] availability_impact - # @return [::Google::Cloud::SecurityCenter::V1::Cvssv3::Impact] - # This metric measures the impact to the availability of the impacted - # component resulting from a successfully exploited vulnerability. - class Cvssv3 - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - - # This metric reflects the context by which vulnerability exploitation is - # possible. - module AttackVector - # Invalid value. - ATTACK_VECTOR_UNSPECIFIED = 0 - - # The vulnerable component is bound to the network stack and the set of - # possible attackers extends beyond the other options listed below, up to - # and including the entire Internet. - ATTACK_VECTOR_NETWORK = 1 - - # The vulnerable component is bound to the network stack, but the attack is - # limited at the protocol level to a logically adjacent topology. - ATTACK_VECTOR_ADJACENT = 2 - - # The vulnerable component is not bound to the network stack and the - # attacker's path is via read/write/execute capabilities. - ATTACK_VECTOR_LOCAL = 3 - - # The attack requires the attacker to physically touch or manipulate the - # vulnerable component. - ATTACK_VECTOR_PHYSICAL = 4 - end - - # This metric describes the conditions beyond the attacker's control that - # must exist in order to exploit the vulnerability. - module AttackComplexity - # Invalid value. - ATTACK_COMPLEXITY_UNSPECIFIED = 0 - - # Specialized access conditions or extenuating circumstances do not exist. - # An attacker can expect repeatable success when attacking the vulnerable - # component. - ATTACK_COMPLEXITY_LOW = 1 - - # A successful attack depends on conditions beyond the attacker's control. - # That is, a successful attack cannot be accomplished at will, but requires - # the attacker to invest in some measurable amount of effort in preparation - # or execution against the vulnerable component before a successful attack - # can be expected. - ATTACK_COMPLEXITY_HIGH = 2 - end - - # This metric describes the level of privileges an attacker must possess - # before successfully exploiting the vulnerability. - module PrivilegesRequired - # Invalid value. - PRIVILEGES_REQUIRED_UNSPECIFIED = 0 - - # The attacker is unauthorized prior to attack, and therefore does not - # require any access to settings or files of the vulnerable system to - # carry out an attack. - PRIVILEGES_REQUIRED_NONE = 1 - - # The attacker requires privileges that provide basic user capabilities - # that could normally affect only settings and files owned by a user. - # Alternatively, an attacker with Low privileges has the ability to access - # only non-sensitive resources. - PRIVILEGES_REQUIRED_LOW = 2 - - # The attacker requires privileges that provide significant (e.g., - # administrative) control over the vulnerable component allowing access to - # component-wide settings and files. - PRIVILEGES_REQUIRED_HIGH = 3 - end - - # This metric captures the requirement for a human user, other than the - # attacker, to participate in the successful compromise of the vulnerable - # component. - module UserInteraction - # Invalid value. - USER_INTERACTION_UNSPECIFIED = 0 - - # The vulnerable system can be exploited without interaction from any user. - USER_INTERACTION_NONE = 1 - - # Successful exploitation of this vulnerability requires a user to take - # some action before the vulnerability can be exploited. - USER_INTERACTION_REQUIRED = 2 - end - - # The Scope metric captures whether a vulnerability in one vulnerable - # component impacts resources in components beyond its security scope. - module Scope - # Invalid value. - SCOPE_UNSPECIFIED = 0 - - # An exploited vulnerability can only affect resources managed by the same - # security authority. - SCOPE_UNCHANGED = 1 - - # An exploited vulnerability can affect resources beyond the security scope - # managed by the security authority of the vulnerable component. - SCOPE_CHANGED = 2 - end - - # The Impact metrics capture the effects of a successfully exploited - # vulnerability on the component that suffers the worst outcome that is most - # directly and predictably associated with the attack. - module Impact - # Invalid value. - IMPACT_UNSPECIFIED = 0 - - # High impact. - IMPACT_HIGH = 1 - - # Low impact. - IMPACT_LOW = 2 - - # No impact. - IMPACT_NONE = 3 - end - end - - # Package is a generic definition of a package. - # @!attribute [rw] package_name - # @return [::String] - # The name of the package where the vulnerability was detected. - # @!attribute [rw] cpe_uri - # @return [::String] - # The CPE URI where the vulnerability was detected. - # @!attribute [rw] package_type - # @return [::String] - # Type of package, for example, os, maven, or go. - # @!attribute [rw] package_version - # @return [::String] - # The version of the package. - class Package - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # SecurityBulletin are notifications of vulnerabilities of Google products. - # @!attribute [rw] bulletin_id - # @return [::String] - # ID of the bulletin corresponding to the vulnerability. - # @!attribute [rw] submission_time - # @return [::Google::Protobuf::Timestamp] - # Submission time of this Security Bulletin. - # @!attribute [rw] suggested_upgrade_version - # @return [::String] - # This represents a version that the cluster receiving this notification - # should be upgraded to, based on its current version. For example, 1.15.0 - class SecurityBulletin - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - end - end - end -end diff --git a/owl-bot-staging/google-cloud-security_center-v1/proto_docs/google/iam/v1/iam_policy.rb b/owl-bot-staging/google-cloud-security_center-v1/proto_docs/google/iam/v1/iam_policy.rb deleted file mode 100644 index 5445c77f8258..000000000000 --- a/owl-bot-staging/google-cloud-security_center-v1/proto_docs/google/iam/v1/iam_policy.rb +++ /dev/null @@ -1,87 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - - -module Google - module Iam - module V1 - # Request message for `SetIamPolicy` method. - # @!attribute [rw] resource - # @return [::String] - # REQUIRED: The resource for which the policy is being specified. - # See the operation documentation for the appropriate value for this field. - # @!attribute [rw] policy - # @return [::Google::Iam::V1::Policy] - # REQUIRED: The complete policy to be applied to the `resource`. The size of - # the policy is limited to a few 10s of KB. An empty policy is a - # valid policy but certain Cloud Platform services (such as Projects) - # might reject them. - # @!attribute [rw] update_mask - # @return [::Google::Protobuf::FieldMask] - # OPTIONAL: A FieldMask specifying which fields of the policy to modify. Only - # the fields in the mask will be modified. If no mask is provided, the - # following default mask is used: - # - # `paths: "bindings, etag"` - class SetIamPolicyRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Request message for `GetIamPolicy` method. - # @!attribute [rw] resource - # @return [::String] - # REQUIRED: The resource for which the policy is being requested. - # See the operation documentation for the appropriate value for this field. - # @!attribute [rw] options - # @return [::Google::Iam::V1::GetPolicyOptions] - # OPTIONAL: A `GetPolicyOptions` object for specifying options to - # `GetIamPolicy`. - class GetIamPolicyRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Request message for `TestIamPermissions` method. - # @!attribute [rw] resource - # @return [::String] - # REQUIRED: The resource for which the policy detail is being requested. - # See the operation documentation for the appropriate value for this field. - # @!attribute [rw] permissions - # @return [::Array<::String>] - # The set of permissions to check for the `resource`. Permissions with - # wildcards (such as '*' or 'storage.*') are not allowed. For more - # information see - # [IAM Overview](https://cloud.google.com/iam/docs/overview#permissions). - class TestIamPermissionsRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Response message for `TestIamPermissions` method. - # @!attribute [rw] permissions - # @return [::Array<::String>] - # A subset of `TestPermissionsRequest.permissions` that the caller is - # allowed. - class TestIamPermissionsResponse - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - end - end -end diff --git a/owl-bot-staging/google-cloud-security_center-v1/proto_docs/google/iam/v1/options.rb b/owl-bot-staging/google-cloud-security_center-v1/proto_docs/google/iam/v1/options.rb deleted file mode 100644 index 60713d995b86..000000000000 --- a/owl-bot-staging/google-cloud-security_center-v1/proto_docs/google/iam/v1/options.rb +++ /dev/null @@ -1,50 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - - -module Google - module Iam - module V1 - # Encapsulates settings provided to GetIamPolicy. - # @!attribute [rw] requested_policy_version - # @return [::Integer] - # Optional. The maximum policy version that will be used to format the - # policy. - # - # Valid values are 0, 1, and 3. Requests specifying an invalid value will be - # rejected. - # - # Requests for policies with any conditional role bindings must specify - # version 3. Policies with no conditional role bindings may specify any valid - # value or leave the field unset. - # - # The policy in the response might use the policy version that you specified, - # or it might use a lower policy version. For example, if you specify version - # 3, but the policy has no conditional role bindings, the response uses - # version 1. - # - # To learn which resources support conditions in their IAM policies, see the - # [IAM - # documentation](https://cloud.google.com/iam/help/conditions/resource-policies). - class GetPolicyOptions - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - end - end -end diff --git a/owl-bot-staging/google-cloud-security_center-v1/proto_docs/google/iam/v1/policy.rb b/owl-bot-staging/google-cloud-security_center-v1/proto_docs/google/iam/v1/policy.rb deleted file mode 100644 index 999575b797df..000000000000 --- a/owl-bot-staging/google-cloud-security_center-v1/proto_docs/google/iam/v1/policy.rb +++ /dev/null @@ -1,426 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - - -module Google - module Iam - module V1 - # An Identity and Access Management (IAM) policy, which specifies access - # controls for Google Cloud resources. - # - # - # A `Policy` is a collection of `bindings`. A `binding` binds one or more - # `members`, or principals, to a single `role`. Principals can be user - # accounts, service accounts, Google groups, and domains (such as G Suite). A - # `role` is a named list of permissions; each `role` can be an IAM predefined - # role or a user-created custom role. - # - # For some types of Google Cloud resources, a `binding` can also specify a - # `condition`, which is a logical expression that allows access to a resource - # only if the expression evaluates to `true`. A condition can add constraints - # based on attributes of the request, the resource, or both. To learn which - # resources support conditions in their IAM policies, see the - # [IAM - # documentation](https://cloud.google.com/iam/help/conditions/resource-policies). - # - # **JSON example:** - # - # ``` - # { - # "bindings": [ - # { - # "role": "roles/resourcemanager.organizationAdmin", - # "members": [ - # "user:mike@example.com", - # "group:admins@example.com", - # "domain:google.com", - # "serviceAccount:my-project-id@appspot.gserviceaccount.com" - # ] - # }, - # { - # "role": "roles/resourcemanager.organizationViewer", - # "members": [ - # "user:eve@example.com" - # ], - # "condition": { - # "title": "expirable access", - # "description": "Does not grant access after Sep 2020", - # "expression": "request.time < - # timestamp('2020-10-01T00:00:00.000Z')", - # } - # } - # ], - # "etag": "BwWWja0YfJA=", - # "version": 3 - # } - # ``` - # - # **YAML example:** - # - # ``` - # bindings: - # - members: - # - user:mike@example.com - # - group:admins@example.com - # - domain:google.com - # - serviceAccount:my-project-id@appspot.gserviceaccount.com - # role: roles/resourcemanager.organizationAdmin - # - members: - # - user:eve@example.com - # role: roles/resourcemanager.organizationViewer - # condition: - # title: expirable access - # description: Does not grant access after Sep 2020 - # expression: request.time < timestamp('2020-10-01T00:00:00.000Z') - # etag: BwWWja0YfJA= - # version: 3 - # ``` - # - # For a description of IAM and its features, see the - # [IAM documentation](https://cloud.google.com/iam/docs/). - # @!attribute [rw] version - # @return [::Integer] - # Specifies the format of the policy. - # - # Valid values are `0`, `1`, and `3`. Requests that specify an invalid value - # are rejected. - # - # Any operation that affects conditional role bindings must specify version - # `3`. This requirement applies to the following operations: - # - # * Getting a policy that includes a conditional role binding - # * Adding a conditional role binding to a policy - # * Changing a conditional role binding in a policy - # * Removing any role binding, with or without a condition, from a policy - # that includes conditions - # - # **Important:** If you use IAM Conditions, you must include the `etag` field - # whenever you call `setIamPolicy`. If you omit this field, then IAM allows - # you to overwrite a version `3` policy with a version `1` policy, and all of - # the conditions in the version `3` policy are lost. - # - # If a policy does not include any conditions, operations on that policy may - # specify any valid version or leave the field unset. - # - # To learn which resources support conditions in their IAM policies, see the - # [IAM - # documentation](https://cloud.google.com/iam/help/conditions/resource-policies). - # @!attribute [rw] bindings - # @return [::Array<::Google::Iam::V1::Binding>] - # Associates a list of `members`, or principals, with a `role`. Optionally, - # may specify a `condition` that determines how and when the `bindings` are - # applied. Each of the `bindings` must contain at least one principal. - # - # The `bindings` in a `Policy` can refer to up to 1,500 principals; up to 250 - # of these principals can be Google groups. Each occurrence of a principal - # counts towards these limits. For example, if the `bindings` grant 50 - # different roles to `user:alice@example.com`, and not to any other - # principal, then you can add another 1,450 principals to the `bindings` in - # the `Policy`. - # @!attribute [rw] audit_configs - # @return [::Array<::Google::Iam::V1::AuditConfig>] - # Specifies cloud audit logging configuration for this policy. - # @!attribute [rw] etag - # @return [::String] - # `etag` is used for optimistic concurrency control as a way to help - # prevent simultaneous updates of a policy from overwriting each other. - # It is strongly suggested that systems make use of the `etag` in the - # read-modify-write cycle to perform policy updates in order to avoid race - # conditions: An `etag` is returned in the response to `getIamPolicy`, and - # systems are expected to put that etag in the request to `setIamPolicy` to - # ensure that their change will be applied to the same version of the policy. - # - # **Important:** If you use IAM Conditions, you must include the `etag` field - # whenever you call `setIamPolicy`. If you omit this field, then IAM allows - # you to overwrite a version `3` policy with a version `1` policy, and all of - # the conditions in the version `3` policy are lost. - class Policy - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Associates `members`, or principals, with a `role`. - # @!attribute [rw] role - # @return [::String] - # Role that is assigned to the list of `members`, or principals. - # For example, `roles/viewer`, `roles/editor`, or `roles/owner`. - # @!attribute [rw] members - # @return [::Array<::String>] - # Specifies the principals requesting access for a Google Cloud resource. - # `members` can have the following values: - # - # * `allUsers`: A special identifier that represents anyone who is - # on the internet; with or without a Google account. - # - # * `allAuthenticatedUsers`: A special identifier that represents anyone - # who is authenticated with a Google account or a service account. - # - # * `user:{emailid}`: An email address that represents a specific Google - # account. For example, `alice@example.com` . - # - # - # * `serviceAccount:{emailid}`: An email address that represents a service - # account. For example, `my-other-app@appspot.gserviceaccount.com`. - # - # * `group:{emailid}`: An email address that represents a Google group. - # For example, `admins@example.com`. - # - # * `deleted:user:{emailid}?uid={uniqueid}`: An email address (plus unique - # identifier) representing a user that has been recently deleted. For - # example, `alice@example.com?uid=123456789012345678901`. If the user is - # recovered, this value reverts to `user:{emailid}` and the recovered user - # retains the role in the binding. - # - # * `deleted:serviceAccount:{emailid}?uid={uniqueid}`: An email address (plus - # unique identifier) representing a service account that has been recently - # deleted. For example, - # `my-other-app@appspot.gserviceaccount.com?uid=123456789012345678901`. - # If the service account is undeleted, this value reverts to - # `serviceAccount:{emailid}` and the undeleted service account retains the - # role in the binding. - # - # * `deleted:group:{emailid}?uid={uniqueid}`: An email address (plus unique - # identifier) representing a Google group that has been recently - # deleted. For example, `admins@example.com?uid=123456789012345678901`. If - # the group is recovered, this value reverts to `group:{emailid}` and the - # recovered group retains the role in the binding. - # - # - # * `domain:{domain}`: The G Suite domain (primary) that represents all the - # users of that domain. For example, `google.com` or `example.com`. - # @!attribute [rw] condition - # @return [::Google::Type::Expr] - # The condition that is associated with this binding. - # - # If the condition evaluates to `true`, then this binding applies to the - # current request. - # - # If the condition evaluates to `false`, then this binding does not apply to - # the current request. However, a different role binding might grant the same - # role to one or more of the principals in this binding. - # - # To learn which resources support conditions in their IAM policies, see the - # [IAM - # documentation](https://cloud.google.com/iam/help/conditions/resource-policies). - class Binding - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Specifies the audit configuration for a service. - # The configuration determines which permission types are logged, and what - # identities, if any, are exempted from logging. - # An AuditConfig must have one or more AuditLogConfigs. - # - # If there are AuditConfigs for both `allServices` and a specific service, - # the union of the two AuditConfigs is used for that service: the log_types - # specified in each AuditConfig are enabled, and the exempted_members in each - # AuditLogConfig are exempted. - # - # Example Policy with multiple AuditConfigs: - # - # { - # "audit_configs": [ - # { - # "service": "allServices", - # "audit_log_configs": [ - # { - # "log_type": "DATA_READ", - # "exempted_members": [ - # "user:jose@example.com" - # ] - # }, - # { - # "log_type": "DATA_WRITE" - # }, - # { - # "log_type": "ADMIN_READ" - # } - # ] - # }, - # { - # "service": "sampleservice.googleapis.com", - # "audit_log_configs": [ - # { - # "log_type": "DATA_READ" - # }, - # { - # "log_type": "DATA_WRITE", - # "exempted_members": [ - # "user:aliya@example.com" - # ] - # } - # ] - # } - # ] - # } - # - # For sampleservice, this policy enables DATA_READ, DATA_WRITE and ADMIN_READ - # logging. It also exempts `jose@example.com` from DATA_READ logging, and - # `aliya@example.com` from DATA_WRITE logging. - # @!attribute [rw] service - # @return [::String] - # Specifies a service that will be enabled for audit logging. - # For example, `storage.googleapis.com`, `cloudsql.googleapis.com`. - # `allServices` is a special value that covers all services. - # @!attribute [rw] audit_log_configs - # @return [::Array<::Google::Iam::V1::AuditLogConfig>] - # The configuration for logging of each type of permission. - class AuditConfig - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Provides the configuration for logging a type of permissions. - # Example: - # - # { - # "audit_log_configs": [ - # { - # "log_type": "DATA_READ", - # "exempted_members": [ - # "user:jose@example.com" - # ] - # }, - # { - # "log_type": "DATA_WRITE" - # } - # ] - # } - # - # This enables 'DATA_READ' and 'DATA_WRITE' logging, while exempting - # jose@example.com from DATA_READ logging. - # @!attribute [rw] log_type - # @return [::Google::Iam::V1::AuditLogConfig::LogType] - # The log type that this config enables. - # @!attribute [rw] exempted_members - # @return [::Array<::String>] - # Specifies the identities that do not cause logging for this type of - # permission. - # Follows the same format of - # [Binding.members][google.iam.v1.Binding.members]. - class AuditLogConfig - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - - # The list of valid permission types for which logging can be configured. - # Admin writes are always logged, and are not configurable. - module LogType - # Default case. Should never be this. - LOG_TYPE_UNSPECIFIED = 0 - - # Admin reads. Example: CloudIAM getIamPolicy - ADMIN_READ = 1 - - # Data writes. Example: CloudSQL Users create - DATA_WRITE = 2 - - # Data reads. Example: CloudSQL Users list - DATA_READ = 3 - end - end - - # The difference delta between two policies. - # @!attribute [rw] binding_deltas - # @return [::Array<::Google::Iam::V1::BindingDelta>] - # The delta for Bindings between two policies. - # @!attribute [rw] audit_config_deltas - # @return [::Array<::Google::Iam::V1::AuditConfigDelta>] - # The delta for AuditConfigs between two policies. - class PolicyDelta - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # One delta entry for Binding. Each individual change (only one member in each - # entry) to a binding will be a separate entry. - # @!attribute [rw] action - # @return [::Google::Iam::V1::BindingDelta::Action] - # The action that was performed on a Binding. - # Required - # @!attribute [rw] role - # @return [::String] - # Role that is assigned to `members`. - # For example, `roles/viewer`, `roles/editor`, or `roles/owner`. - # Required - # @!attribute [rw] member - # @return [::String] - # A single identity requesting access for a Google Cloud resource. - # Follows the same format of Binding.members. - # Required - # @!attribute [rw] condition - # @return [::Google::Type::Expr] - # The condition that is associated with this binding. - class BindingDelta - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - - # The type of action performed on a Binding in a policy. - module Action - # Unspecified. - ACTION_UNSPECIFIED = 0 - - # Addition of a Binding. - ADD = 1 - - # Removal of a Binding. - REMOVE = 2 - end - end - - # One delta entry for AuditConfig. Each individual change (only one - # exempted_member in each entry) to a AuditConfig will be a separate entry. - # @!attribute [rw] action - # @return [::Google::Iam::V1::AuditConfigDelta::Action] - # The action that was performed on an audit configuration in a policy. - # Required - # @!attribute [rw] service - # @return [::String] - # Specifies a service that was configured for Cloud Audit Logging. - # For example, `storage.googleapis.com`, `cloudsql.googleapis.com`. - # `allServices` is a special value that covers all services. - # Required - # @!attribute [rw] exempted_member - # @return [::String] - # A single identity that is exempted from "data access" audit - # logging for the `service` specified above. - # Follows the same format of Binding.members. - # @!attribute [rw] log_type - # @return [::String] - # Specifies the log_type that was be enabled. ADMIN_ACTIVITY is always - # enabled, and cannot be configured. - # Required - class AuditConfigDelta - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - - # The type of action performed on an audit configuration in a policy. - module Action - # Unspecified. - ACTION_UNSPECIFIED = 0 - - # Addition of an audit configuration. - ADD = 1 - - # Removal of an audit configuration. - REMOVE = 2 - end - end - end - end -end diff --git a/owl-bot-staging/google-cloud-security_center-v1/proto_docs/google/longrunning/operations.rb b/owl-bot-staging/google-cloud-security_center-v1/proto_docs/google/longrunning/operations.rb deleted file mode 100644 index 7a757f512165..000000000000 --- a/owl-bot-staging/google-cloud-security_center-v1/proto_docs/google/longrunning/operations.rb +++ /dev/null @@ -1,191 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - - -module Google - module Longrunning - # This resource represents a long-running operation that is the result of a - # network API call. - # @!attribute [rw] name - # @return [::String] - # The server-assigned name, which is only unique within the same service that - # originally returns it. If you use the default HTTP mapping, the - # `name` should be a resource name ending with `operations/{unique_id}`. - # @!attribute [rw] metadata - # @return [::Google::Protobuf::Any] - # Service-specific metadata associated with the operation. It typically - # contains progress information and common metadata such as create time. - # Some services might not provide such metadata. Any method that returns a - # long-running operation should document the metadata type, if any. - # @!attribute [rw] done - # @return [::Boolean] - # If the value is `false`, it means the operation is still in progress. - # If `true`, the operation is completed, and either `error` or `response` is - # available. - # @!attribute [rw] error - # @return [::Google::Rpc::Status] - # The error result of the operation in case of failure or cancellation. - # - # Note: The following fields are mutually exclusive: `error`, `response`. If a field in that set is populated, all other fields in the set will automatically be cleared. - # @!attribute [rw] response - # @return [::Google::Protobuf::Any] - # The normal, successful response of the operation. If the original - # method returns no data on success, such as `Delete`, the response is - # `google.protobuf.Empty`. If the original method is standard - # `Get`/`Create`/`Update`, the response should be the resource. For other - # methods, the response should have the type `XxxResponse`, where `Xxx` - # is the original method name. For example, if the original method name - # is `TakeSnapshot()`, the inferred response type is - # `TakeSnapshotResponse`. - # - # Note: The following fields are mutually exclusive: `response`, `error`. If a field in that set is populated, all other fields in the set will automatically be cleared. - class Operation - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # The request message for - # Operations.GetOperation. - # @!attribute [rw] name - # @return [::String] - # The name of the operation resource. - class GetOperationRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # The request message for - # Operations.ListOperations. - # @!attribute [rw] name - # @return [::String] - # The name of the operation's parent resource. - # @!attribute [rw] filter - # @return [::String] - # The standard list filter. - # @!attribute [rw] page_size - # @return [::Integer] - # The standard list page size. - # @!attribute [rw] page_token - # @return [::String] - # The standard list page token. - # @!attribute [rw] return_partial_success - # @return [::Boolean] - # When set to `true`, operations that are reachable are returned as normal, - # and those that are unreachable are returned in the - # [ListOperationsResponse.unreachable] field. - # - # This can only be `true` when reading across collections e.g. when `parent` - # is set to `"projects/example/locations/-"`. - # - # This field is not by default supported and will result in an - # `UNIMPLEMENTED` error if set unless explicitly documented otherwise in - # service or product specific documentation. - class ListOperationsRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # The response message for - # Operations.ListOperations. - # @!attribute [rw] operations - # @return [::Array<::Google::Longrunning::Operation>] - # A list of operations that matches the specified filter in the request. - # @!attribute [rw] next_page_token - # @return [::String] - # The standard List next-page token. - # @!attribute [rw] unreachable - # @return [::Array<::String>] - # Unordered list. Unreachable resources. Populated when the request sets - # `ListOperationsRequest.return_partial_success` and reads across - # collections e.g. when attempting to list all resources across all supported - # locations. - class ListOperationsResponse - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # The request message for - # Operations.CancelOperation. - # @!attribute [rw] name - # @return [::String] - # The name of the operation resource to be cancelled. - class CancelOperationRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # The request message for - # Operations.DeleteOperation. - # @!attribute [rw] name - # @return [::String] - # The name of the operation resource to be deleted. - class DeleteOperationRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # The request message for - # Operations.WaitOperation. - # @!attribute [rw] name - # @return [::String] - # The name of the operation resource to wait on. - # @!attribute [rw] timeout - # @return [::Google::Protobuf::Duration] - # The maximum duration to wait before timing out. If left blank, the wait - # will be at most the time permitted by the underlying HTTP/RPC protocol. - # If RPC context deadline is also specified, the shorter one will be used. - class WaitOperationRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # A message representing the message types used by a long-running operation. - # - # Example: - # - # rpc Export(ExportRequest) returns (google.longrunning.Operation) { - # option (google.longrunning.operation_info) = { - # response_type: "ExportResponse" - # metadata_type: "ExportMetadata" - # }; - # } - # @!attribute [rw] response_type - # @return [::String] - # Required. The message name of the primary return type for this - # long-running operation. - # This type will be used to deserialize the LRO's response. - # - # If the response is in a different package from the rpc, a fully-qualified - # message name must be used (e.g. `google.protobuf.Struct`). - # - # Note: Altering this value constitutes a breaking change. - # @!attribute [rw] metadata_type - # @return [::String] - # Required. The message name of the metadata type for this long-running - # operation. - # - # If the response is in a different package from the rpc, a fully-qualified - # message name must be used (e.g. `google.protobuf.Struct`). - # - # Note: Altering this value constitutes a breaking change. - class OperationInfo - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - end -end diff --git a/owl-bot-staging/google-cloud-security_center-v1/proto_docs/google/protobuf/any.rb b/owl-bot-staging/google-cloud-security_center-v1/proto_docs/google/protobuf/any.rb deleted file mode 100644 index 58691995f02e..000000000000 --- a/owl-bot-staging/google-cloud-security_center-v1/proto_docs/google/protobuf/any.rb +++ /dev/null @@ -1,145 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - - -module Google - module Protobuf - # `Any` contains an arbitrary serialized protocol buffer message along with a - # URL that describes the type of the serialized message. - # - # Protobuf library provides support to pack/unpack Any values in the form - # of utility functions or additional generated methods of the Any type. - # - # Example 1: Pack and unpack a message in C++. - # - # Foo foo = ...; - # Any any; - # any.PackFrom(foo); - # ... - # if (any.UnpackTo(&foo)) { - # ... - # } - # - # Example 2: Pack and unpack a message in Java. - # - # Foo foo = ...; - # Any any = Any.pack(foo); - # ... - # if (any.is(Foo.class)) { - # foo = any.unpack(Foo.class); - # } - # // or ... - # if (any.isSameTypeAs(Foo.getDefaultInstance())) { - # foo = any.unpack(Foo.getDefaultInstance()); - # } - # - # Example 3: Pack and unpack a message in Python. - # - # foo = Foo(...) - # any = Any() - # any.Pack(foo) - # ... - # if any.Is(Foo.DESCRIPTOR): - # any.Unpack(foo) - # ... - # - # Example 4: Pack and unpack a message in Go - # - # foo := &pb.Foo{...} - # any, err := anypb.New(foo) - # if err != nil { - # ... - # } - # ... - # foo := &pb.Foo{} - # if err := any.UnmarshalTo(foo); err != nil { - # ... - # } - # - # The pack methods provided by protobuf library will by default use - # 'type.googleapis.com/full.type.name' as the type URL and the unpack - # methods only use the fully qualified type name after the last '/' - # in the type URL, for example "foo.bar.com/x/y.z" will yield type - # name "y.z". - # - # JSON - # ==== - # The JSON representation of an `Any` value uses the regular - # representation of the deserialized, embedded message, with an - # additional field `@type` which contains the type URL. Example: - # - # package google.profile; - # message Person { - # string first_name = 1; - # string last_name = 2; - # } - # - # { - # "@type": "type.googleapis.com/google.profile.Person", - # "firstName": , - # "lastName": - # } - # - # If the embedded message type is well-known and has a custom JSON - # representation, that representation will be embedded adding a field - # `value` which holds the custom JSON in addition to the `@type` - # field. Example (for message [google.protobuf.Duration][]): - # - # { - # "@type": "type.googleapis.com/google.protobuf.Duration", - # "value": "1.212s" - # } - # @!attribute [rw] type_url - # @return [::String] - # A URL/resource name that uniquely identifies the type of the serialized - # protocol buffer message. This string must contain at least - # one "/" character. The last segment of the URL's path must represent - # the fully qualified name of the type (as in - # `path/google.protobuf.Duration`). The name should be in a canonical form - # (e.g., leading "." is not accepted). - # - # In practice, teams usually precompile into the binary all types that they - # expect it to use in the context of Any. However, for URLs which use the - # scheme `http`, `https`, or no scheme, one can optionally set up a type - # server that maps type URLs to message definitions as follows: - # - # * If no scheme is provided, `https` is assumed. - # * An HTTP GET on the URL must yield a [google.protobuf.Type][] - # value in binary format, or produce an error. - # * Applications are allowed to cache lookup results based on the - # URL, or have them precompiled into a binary to avoid any - # lookup. Therefore, binary compatibility needs to be preserved - # on changes to types. (Use versioned type names to manage - # breaking changes.) - # - # Note: this functionality is not currently available in the official - # protobuf release, and it is not used for type URLs beginning with - # type.googleapis.com. As of May 2023, there are no widely used type server - # implementations and no plans to implement one. - # - # Schemes other than `http`, `https` (or the empty scheme) might be - # used with implementation specific semantics. - # @!attribute [rw] value - # @return [::String] - # Must be a valid serialized protocol buffer of the above specified type. - class Any - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - end -end diff --git a/owl-bot-staging/google-cloud-security_center-v1/proto_docs/google/protobuf/duration.rb b/owl-bot-staging/google-cloud-security_center-v1/proto_docs/google/protobuf/duration.rb deleted file mode 100644 index ea59f1f91daf..000000000000 --- a/owl-bot-staging/google-cloud-security_center-v1/proto_docs/google/protobuf/duration.rb +++ /dev/null @@ -1,98 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - - -module Google - module Protobuf - # A Duration represents a signed, fixed-length span of time represented - # as a count of seconds and fractions of seconds at nanosecond - # resolution. It is independent of any calendar and concepts like "day" - # or "month". It is related to Timestamp in that the difference between - # two Timestamp values is a Duration and it can be added or subtracted - # from a Timestamp. Range is approximately +-10,000 years. - # - # # Examples - # - # Example 1: Compute Duration from two Timestamps in pseudo code. - # - # Timestamp start = ...; - # Timestamp end = ...; - # Duration duration = ...; - # - # duration.seconds = end.seconds - start.seconds; - # duration.nanos = end.nanos - start.nanos; - # - # if (duration.seconds < 0 && duration.nanos > 0) { - # duration.seconds += 1; - # duration.nanos -= 1000000000; - # } else if (duration.seconds > 0 && duration.nanos < 0) { - # duration.seconds -= 1; - # duration.nanos += 1000000000; - # } - # - # Example 2: Compute Timestamp from Timestamp + Duration in pseudo code. - # - # Timestamp start = ...; - # Duration duration = ...; - # Timestamp end = ...; - # - # end.seconds = start.seconds + duration.seconds; - # end.nanos = start.nanos + duration.nanos; - # - # if (end.nanos < 0) { - # end.seconds -= 1; - # end.nanos += 1000000000; - # } else if (end.nanos >= 1000000000) { - # end.seconds += 1; - # end.nanos -= 1000000000; - # } - # - # Example 3: Compute Duration from datetime.timedelta in Python. - # - # td = datetime.timedelta(days=3, minutes=10) - # duration = Duration() - # duration.FromTimedelta(td) - # - # # JSON Mapping - # - # In JSON format, the Duration type is encoded as a string rather than an - # object, where the string ends in the suffix "s" (indicating seconds) and - # is preceded by the number of seconds, with nanoseconds expressed as - # fractional seconds. For example, 3 seconds with 0 nanoseconds should be - # encoded in JSON format as "3s", while 3 seconds and 1 nanosecond should - # be expressed in JSON format as "3.000000001s", and 3 seconds and 1 - # microsecond should be expressed in JSON format as "3.000001s". - # @!attribute [rw] seconds - # @return [::Integer] - # Signed seconds of the span of time. Must be from -315,576,000,000 - # to +315,576,000,000 inclusive. Note: these bounds are computed from: - # 60 sec/min * 60 min/hr * 24 hr/day * 365.25 days/year * 10000 years - # @!attribute [rw] nanos - # @return [::Integer] - # Signed fractions of a second at nanosecond resolution of the span - # of time. Durations less than one second are represented with a 0 - # `seconds` field and a positive or negative `nanos` field. For durations - # of one second or more, a non-zero value for the `nanos` field must be - # of the same sign as the `seconds` field. Must be from -999,999,999 - # to +999,999,999 inclusive. - class Duration - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - end -end diff --git a/owl-bot-staging/google-cloud-security_center-v1/proto_docs/google/protobuf/empty.rb b/owl-bot-staging/google-cloud-security_center-v1/proto_docs/google/protobuf/empty.rb deleted file mode 100644 index 83e4481834a6..000000000000 --- a/owl-bot-staging/google-cloud-security_center-v1/proto_docs/google/protobuf/empty.rb +++ /dev/null @@ -1,34 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - - -module Google - module Protobuf - # A generic empty message that you can re-use to avoid defining duplicated - # empty messages in your APIs. A typical example is to use it as the request - # or the response type of an API method. For instance: - # - # service Foo { - # rpc Bar(google.protobuf.Empty) returns (google.protobuf.Empty); - # } - class Empty - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - end -end diff --git a/owl-bot-staging/google-cloud-security_center-v1/proto_docs/google/protobuf/field_mask.rb b/owl-bot-staging/google-cloud-security_center-v1/proto_docs/google/protobuf/field_mask.rb deleted file mode 100644 index 7f3ffc78601a..000000000000 --- a/owl-bot-staging/google-cloud-security_center-v1/proto_docs/google/protobuf/field_mask.rb +++ /dev/null @@ -1,229 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - - -module Google - module Protobuf - # `FieldMask` represents a set of symbolic field paths, for example: - # - # paths: "f.a" - # paths: "f.b.d" - # - # Here `f` represents a field in some root message, `a` and `b` - # fields in the message found in `f`, and `d` a field found in the - # message in `f.b`. - # - # Field masks are used to specify a subset of fields that should be - # returned by a get operation or modified by an update operation. - # Field masks also have a custom JSON encoding (see below). - # - # # Field Masks in Projections - # - # When used in the context of a projection, a response message or - # sub-message is filtered by the API to only contain those fields as - # specified in the mask. For example, if the mask in the previous - # example is applied to a response message as follows: - # - # f { - # a : 22 - # b { - # d : 1 - # x : 2 - # } - # y : 13 - # } - # z: 8 - # - # The result will not contain specific values for fields x,y and z - # (their value will be set to the default, and omitted in proto text - # output): - # - # - # f { - # a : 22 - # b { - # d : 1 - # } - # } - # - # A repeated field is not allowed except at the last position of a - # paths string. - # - # If a FieldMask object is not present in a get operation, the - # operation applies to all fields (as if a FieldMask of all fields - # had been specified). - # - # Note that a field mask does not necessarily apply to the - # top-level response message. In case of a REST get operation, the - # field mask applies directly to the response, but in case of a REST - # list operation, the mask instead applies to each individual message - # in the returned resource list. In case of a REST custom method, - # other definitions may be used. Where the mask applies will be - # clearly documented together with its declaration in the API. In - # any case, the effect on the returned resource/resources is required - # behavior for APIs. - # - # # Field Masks in Update Operations - # - # A field mask in update operations specifies which fields of the - # targeted resource are going to be updated. The API is required - # to only change the values of the fields as specified in the mask - # and leave the others untouched. If a resource is passed in to - # describe the updated values, the API ignores the values of all - # fields not covered by the mask. - # - # If a repeated field is specified for an update operation, new values will - # be appended to the existing repeated field in the target resource. Note that - # a repeated field is only allowed in the last position of a `paths` string. - # - # If a sub-message is specified in the last position of the field mask for an - # update operation, then new value will be merged into the existing sub-message - # in the target resource. - # - # For example, given the target message: - # - # f { - # b { - # d: 1 - # x: 2 - # } - # c: [1] - # } - # - # And an update message: - # - # f { - # b { - # d: 10 - # } - # c: [2] - # } - # - # then if the field mask is: - # - # paths: ["f.b", "f.c"] - # - # then the result will be: - # - # f { - # b { - # d: 10 - # x: 2 - # } - # c: [1, 2] - # } - # - # An implementation may provide options to override this default behavior for - # repeated and message fields. - # - # In order to reset a field's value to the default, the field must - # be in the mask and set to the default value in the provided resource. - # Hence, in order to reset all fields of a resource, provide a default - # instance of the resource and set all fields in the mask, or do - # not provide a mask as described below. - # - # If a field mask is not present on update, the operation applies to - # all fields (as if a field mask of all fields has been specified). - # Note that in the presence of schema evolution, this may mean that - # fields the client does not know and has therefore not filled into - # the request will be reset to their default. If this is unwanted - # behavior, a specific service may require a client to always specify - # a field mask, producing an error if not. - # - # As with get operations, the location of the resource which - # describes the updated values in the request message depends on the - # operation kind. In any case, the effect of the field mask is - # required to be honored by the API. - # - # ## Considerations for HTTP REST - # - # The HTTP kind of an update operation which uses a field mask must - # be set to PATCH instead of PUT in order to satisfy HTTP semantics - # (PUT must only be used for full updates). - # - # # JSON Encoding of Field Masks - # - # In JSON, a field mask is encoded as a single string where paths are - # separated by a comma. Fields name in each path are converted - # to/from lower-camel naming conventions. - # - # As an example, consider the following message declarations: - # - # message Profile { - # User user = 1; - # Photo photo = 2; - # } - # message User { - # string display_name = 1; - # string address = 2; - # } - # - # In proto a field mask for `Profile` may look as such: - # - # mask { - # paths: "user.display_name" - # paths: "photo" - # } - # - # In JSON, the same mask is represented as below: - # - # { - # mask: "user.displayName,photo" - # } - # - # # Field Masks and Oneof Fields - # - # Field masks treat fields in oneofs just as regular fields. Consider the - # following message: - # - # message SampleMessage { - # oneof test_oneof { - # string name = 4; - # SubMessage sub_message = 9; - # } - # } - # - # The field mask can be: - # - # mask { - # paths: "name" - # } - # - # Or: - # - # mask { - # paths: "sub_message" - # } - # - # Note that oneof type names ("test_oneof" in this case) cannot be used in - # paths. - # - # ## Field Mask Verification - # - # The implementation of any API method which has a FieldMask type field in the - # request should verify the included field paths, and return an - # `INVALID_ARGUMENT` error if any path is unmappable. - # @!attribute [rw] paths - # @return [::Array<::String>] - # The set of field mask paths. - class FieldMask - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - end -end diff --git a/owl-bot-staging/google-cloud-security_center-v1/proto_docs/google/protobuf/struct.rb b/owl-bot-staging/google-cloud-security_center-v1/proto_docs/google/protobuf/struct.rb deleted file mode 100644 index 39e1aca868d2..000000000000 --- a/owl-bot-staging/google-cloud-security_center-v1/proto_docs/google/protobuf/struct.rb +++ /dev/null @@ -1,108 +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 - # `Struct` represents a structured data value, consisting of fields - # which map to dynamically typed values. In some languages, `Struct` - # might be supported by a native representation. For example, in - # scripting languages like JS a struct is represented as an - # object. The details of that representation are described together - # with the proto support for the language. - # - # The JSON representation for `Struct` is JSON object. - # @!attribute [rw] fields - # @return [::Google::Protobuf::Map{::String => ::Google::Protobuf::Value}] - # Unordered map of dynamically typed values. - class Struct - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - - # @!attribute [rw] key - # @return [::String] - # @!attribute [rw] value - # @return [::Google::Protobuf::Value] - class FieldsEntry - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - end - - # `Value` represents a dynamically typed value which can be either - # null, a number, a string, a boolean, a recursive struct value, or a - # list of values. A producer of value is expected to set one of these - # variants. Absence of any variant indicates an error. - # - # The JSON representation for `Value` is JSON value. - # @!attribute [rw] null_value - # @return [::Google::Protobuf::NullValue] - # Represents a null value. - # - # Note: The following fields are mutually exclusive: `null_value`, `number_value`, `string_value`, `bool_value`, `struct_value`, `list_value`. If a field in that set is populated, all other fields in the set will automatically be cleared. - # @!attribute [rw] number_value - # @return [::Float] - # Represents a double value. - # - # Note: The following fields are mutually exclusive: `number_value`, `null_value`, `string_value`, `bool_value`, `struct_value`, `list_value`. If a field in that set is populated, all other fields in the set will automatically be cleared. - # @!attribute [rw] string_value - # @return [::String] - # Represents a string value. - # - # Note: The following fields are mutually exclusive: `string_value`, `null_value`, `number_value`, `bool_value`, `struct_value`, `list_value`. If a field in that set is populated, all other fields in the set will automatically be cleared. - # @!attribute [rw] bool_value - # @return [::Boolean] - # Represents a boolean value. - # - # Note: The following fields are mutually exclusive: `bool_value`, `null_value`, `number_value`, `string_value`, `struct_value`, `list_value`. If a field in that set is populated, all other fields in the set will automatically be cleared. - # @!attribute [rw] struct_value - # @return [::Google::Protobuf::Struct] - # Represents a structured value. - # - # Note: The following fields are mutually exclusive: `struct_value`, `null_value`, `number_value`, `string_value`, `bool_value`, `list_value`. If a field in that set is populated, all other fields in the set will automatically be cleared. - # @!attribute [rw] list_value - # @return [::Google::Protobuf::ListValue] - # Represents a repeated `Value`. - # - # Note: The following fields are mutually exclusive: `list_value`, `null_value`, `number_value`, `string_value`, `bool_value`, `struct_value`. If a field in that set is populated, all other fields in the set will automatically be cleared. - class Value - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # `ListValue` is a wrapper around a repeated field of values. - # - # The JSON representation for `ListValue` is JSON array. - # @!attribute [rw] values - # @return [::Array<::Google::Protobuf::Value>] - # Repeated field of dynamically typed values. - class ListValue - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # `NullValue` is a singleton enumeration to represent the null value for the - # `Value` type union. - # - # The JSON representation for `NullValue` is JSON `null`. - module NullValue - # Null value. - NULL_VALUE = 0 - end - end -end diff --git a/owl-bot-staging/google-cloud-security_center-v1/proto_docs/google/protobuf/timestamp.rb b/owl-bot-staging/google-cloud-security_center-v1/proto_docs/google/protobuf/timestamp.rb deleted file mode 100644 index 74352be9c58c..000000000000 --- a/owl-bot-staging/google-cloud-security_center-v1/proto_docs/google/protobuf/timestamp.rb +++ /dev/null @@ -1,127 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - - -module Google - module Protobuf - # A Timestamp represents a point in time independent of any time zone or local - # calendar, encoded as a count of seconds and fractions of seconds at - # nanosecond resolution. The count is relative to an epoch at UTC midnight on - # January 1, 1970, in the proleptic Gregorian calendar which extends the - # Gregorian calendar backwards to year one. - # - # All minutes are 60 seconds long. Leap seconds are "smeared" so that no leap - # second table is needed for interpretation, using a [24-hour linear - # smear](https://developers.google.com/time/smear). - # - # The range is from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59.999999999Z. By - # restricting to that range, we ensure that we can convert to and from [RFC - # 3339](https://www.ietf.org/rfc/rfc3339.txt) date strings. - # - # # Examples - # - # Example 1: Compute Timestamp from POSIX `time()`. - # - # Timestamp timestamp; - # timestamp.set_seconds(time(NULL)); - # timestamp.set_nanos(0); - # - # Example 2: Compute Timestamp from POSIX `gettimeofday()`. - # - # struct timeval tv; - # gettimeofday(&tv, NULL); - # - # Timestamp timestamp; - # timestamp.set_seconds(tv.tv_sec); - # timestamp.set_nanos(tv.tv_usec * 1000); - # - # Example 3: Compute Timestamp from Win32 `GetSystemTimeAsFileTime()`. - # - # FILETIME ft; - # GetSystemTimeAsFileTime(&ft); - # UINT64 ticks = (((UINT64)ft.dwHighDateTime) << 32) | ft.dwLowDateTime; - # - # // A Windows tick is 100 nanoseconds. Windows epoch 1601-01-01T00:00:00Z - # // is 11644473600 seconds before Unix epoch 1970-01-01T00:00:00Z. - # Timestamp timestamp; - # timestamp.set_seconds((INT64) ((ticks / 10000000) - 11644473600LL)); - # timestamp.set_nanos((INT32) ((ticks % 10000000) * 100)); - # - # Example 4: Compute Timestamp from Java `System.currentTimeMillis()`. - # - # long millis = System.currentTimeMillis(); - # - # Timestamp timestamp = Timestamp.newBuilder().setSeconds(millis / 1000) - # .setNanos((int) ((millis % 1000) * 1000000)).build(); - # - # Example 5: Compute Timestamp from Java `Instant.now()`. - # - # Instant now = Instant.now(); - # - # Timestamp timestamp = - # Timestamp.newBuilder().setSeconds(now.getEpochSecond()) - # .setNanos(now.getNano()).build(); - # - # Example 6: Compute Timestamp from current time in Python. - # - # timestamp = Timestamp() - # timestamp.GetCurrentTime() - # - # # JSON Mapping - # - # In JSON format, the Timestamp type is encoded as a string in the - # [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format. That is, the - # format is "\\{year}-\\{month}-\\{day}T\\{hour}:\\{min}:\\{sec}[.\\{frac_sec}]Z" - # where \\{year} is always expressed using four digits while \\{month}, \\{day}, - # \\{hour}, \\{min}, and \\{sec} are zero-padded to two digits each. The fractional - # seconds, which can go up to 9 digits (i.e. up to 1 nanosecond resolution), - # are optional. The "Z" suffix indicates the timezone ("UTC"); the timezone - # is required. A proto3 JSON serializer should always use UTC (as indicated by - # "Z") when printing the Timestamp type and a proto3 JSON parser should be - # able to accept both UTC and other timezones (as indicated by an offset). - # - # For example, "2017-01-15T01:30:15.01Z" encodes 15.01 seconds past - # 01:30 UTC on January 15, 2017. - # - # In JavaScript, one can convert a Date object to this format using the - # standard - # [toISOString()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toISOString) - # method. In Python, a standard `datetime.datetime` object can be converted - # to this format using - # [`strftime`](https://docs.python.org/2/library/time.html#time.strftime) with - # the time format spec '%Y-%m-%dT%H:%M:%S.%fZ'. Likewise, in Java, one can use - # the Joda Time's [`ISODateTimeFormat.dateTime()`]( - # http://joda-time.sourceforge.net/apidocs/org/joda/time/format/ISODateTimeFormat.html#dateTime() - # ) to obtain a formatter capable of generating timestamps in this format. - # @!attribute [rw] seconds - # @return [::Integer] - # Represents seconds of UTC time since Unix epoch - # 1970-01-01T00:00:00Z. Must be from 0001-01-01T00:00:00Z to - # 9999-12-31T23:59:59Z inclusive. - # @!attribute [rw] nanos - # @return [::Integer] - # Non-negative fractions of a second at nanosecond resolution. Negative - # second values with fractions must still have non-negative nanos values - # that count forward in time. Must be from 0 to 999,999,999 - # inclusive. - class Timestamp - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - end -end diff --git a/owl-bot-staging/google-cloud-security_center-v1/proto_docs/google/rpc/status.rb b/owl-bot-staging/google-cloud-security_center-v1/proto_docs/google/rpc/status.rb deleted file mode 100644 index c1a1c07eb2db..000000000000 --- a/owl-bot-staging/google-cloud-security_center-v1/proto_docs/google/rpc/status.rb +++ /dev/null @@ -1,48 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - - -module Google - module Rpc - # The `Status` type defines a logical error model that is suitable for - # different programming environments, including REST APIs and RPC APIs. It is - # used by [gRPC](https://github.com/grpc). Each `Status` message contains - # three pieces of data: error code, error message, and error details. - # - # You can find out more about this error model and how to work with it in the - # [API Design Guide](https://cloud.google.com/apis/design/errors). - # @!attribute [rw] code - # @return [::Integer] - # The status code, which should be an enum value of - # [google.rpc.Code][google.rpc.Code]. - # @!attribute [rw] message - # @return [::String] - # A developer-facing error message, which should be in English. Any - # user-facing error message should be localized and sent in the - # {::Google::Rpc::Status#details google.rpc.Status.details} field, or localized - # by the client. - # @!attribute [rw] details - # @return [::Array<::Google::Protobuf::Any>] - # A list of messages that carry the error details. There is a common set of - # message types for APIs to use. - class Status - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - end -end diff --git a/owl-bot-staging/google-cloud-security_center-v1/proto_docs/google/type/expr.rb b/owl-bot-staging/google-cloud-security_center-v1/proto_docs/google/type/expr.rb deleted file mode 100644 index 53e7733b6592..000000000000 --- a/owl-bot-staging/google-cloud-security_center-v1/proto_docs/google/type/expr.rb +++ /dev/null @@ -1,75 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - - -module Google - module Type - # Represents a textual expression in the Common Expression Language (CEL) - # syntax. CEL is a C-like expression language. The syntax and semantics of CEL - # are documented at https://github.com/google/cel-spec. - # - # Example (Comparison): - # - # title: "Summary size limit" - # description: "Determines if a summary is less than 100 chars" - # expression: "document.summary.size() < 100" - # - # Example (Equality): - # - # title: "Requestor is owner" - # description: "Determines if requestor is the document owner" - # expression: "document.owner == request.auth.claims.email" - # - # Example (Logic): - # - # title: "Public documents" - # description: "Determine whether the document should be publicly visible" - # expression: "document.type != 'private' && document.type != 'internal'" - # - # Example (Data Manipulation): - # - # title: "Notification string" - # description: "Create a notification string with a timestamp." - # expression: "'New message received at ' + string(document.create_time)" - # - # The exact variables and functions that may be referenced within an expression - # are determined by the service that evaluates it. See the service - # documentation for additional information. - # @!attribute [rw] expression - # @return [::String] - # Textual representation of an expression in Common Expression Language - # syntax. - # @!attribute [rw] title - # @return [::String] - # Optional. Title for the expression, i.e. a short string describing - # its purpose. This can be used e.g. in UIs which allow to enter the - # expression. - # @!attribute [rw] description - # @return [::String] - # Optional. Description of the expression. This is a longer text which - # describes the expression, e.g. when hovered over it in a UI. - # @!attribute [rw] location - # @return [::String] - # Optional. String indicating the location of the expression for error - # reporting, e.g. a file name and a position in the file. - class Expr - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - end -end diff --git a/owl-bot-staging/google-cloud-security_center-v1/snippets/Gemfile b/owl-bot-staging/google-cloud-security_center-v1/snippets/Gemfile deleted file mode 100644 index f16288a177ba..000000000000 --- a/owl-bot-staging/google-cloud-security_center-v1/snippets/Gemfile +++ /dev/null @@ -1,32 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -source "https://rubygems.org" - -if ENV["GOOGLE_CLOUD_SAMPLES_TEST"] == "master" - gem "google-cloud-security_center-v1", path: "../" -else - gem "google-cloud-security_center-v1" -end - -group :test do - gem "google-style", "~> 1.26.1" - gem "minitest", "~> 5.16" - gem "minitest-focus", "~> 1.1" - gem "minitest-hooks", "~> 1.5" -end diff --git a/owl-bot-staging/google-cloud-security_center-v1/snippets/security_center/batch_create_resource_value_configs.rb b/owl-bot-staging/google-cloud-security_center-v1/snippets/security_center/batch_create_resource_value_configs.rb deleted file mode 100644 index 62423aec31af..000000000000 --- a/owl-bot-staging/google-cloud-security_center-v1/snippets/security_center/batch_create_resource_value_configs.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 securitycenter_v1_generated_SecurityCenter_BatchCreateResourceValueConfigs_sync] -require "google/cloud/security_center/v1" - -## -# Snippet for the batch_create_resource_value_configs call in the SecurityCenter service -# -# This snippet has been automatically generated and should be regarded as a code -# template only. It will require modifications to work: -# - It may require correct/in-range values for request initialization. -# - It may require specifying regional endpoints when creating the service -# client as shown in https://cloud.google.com/ruby/docs/reference. -# -# This is an auto-generated example demonstrating basic usage of -# Google::Cloud::SecurityCenter::V1::SecurityCenter::Client#batch_create_resource_value_configs. -# -def batch_create_resource_value_configs - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::SecurityCenter::V1::SecurityCenter::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::SecurityCenter::V1::BatchCreateResourceValueConfigsRequest.new - - # Call the batch_create_resource_value_configs method. - result = client.batch_create_resource_value_configs request - - # The returned object is of type Google::Cloud::SecurityCenter::V1::BatchCreateResourceValueConfigsResponse. - p result -end -# [END securitycenter_v1_generated_SecurityCenter_BatchCreateResourceValueConfigs_sync] diff --git a/owl-bot-staging/google-cloud-security_center-v1/snippets/security_center/bulk_mute_findings.rb b/owl-bot-staging/google-cloud-security_center-v1/snippets/security_center/bulk_mute_findings.rb deleted file mode 100644 index 93db8d1e0876..000000000000 --- a/owl-bot-staging/google-cloud-security_center-v1/snippets/security_center/bulk_mute_findings.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 securitycenter_v1_generated_SecurityCenter_BulkMuteFindings_sync] -require "google/cloud/security_center/v1" - -## -# Snippet for the bulk_mute_findings call in the SecurityCenter service -# -# This snippet has been automatically generated and should be regarded as a code -# template only. It will require modifications to work: -# - It may require correct/in-range values for request initialization. -# - It may require specifying regional endpoints when creating the service -# client as shown in https://cloud.google.com/ruby/docs/reference. -# -# This is an auto-generated example demonstrating basic usage of -# Google::Cloud::SecurityCenter::V1::SecurityCenter::Client#bulk_mute_findings. -# -def bulk_mute_findings - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::SecurityCenter::V1::SecurityCenter::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::SecurityCenter::V1::BulkMuteFindingsRequest.new - - # Call the bulk_mute_findings method. - result = client.bulk_mute_findings 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 securitycenter_v1_generated_SecurityCenter_BulkMuteFindings_sync] diff --git a/owl-bot-staging/google-cloud-security_center-v1/snippets/security_center/create_big_query_export.rb b/owl-bot-staging/google-cloud-security_center-v1/snippets/security_center/create_big_query_export.rb deleted file mode 100644 index be92178bf7b4..000000000000 --- a/owl-bot-staging/google-cloud-security_center-v1/snippets/security_center/create_big_query_export.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 securitycenter_v1_generated_SecurityCenter_CreateBigQueryExport_sync] -require "google/cloud/security_center/v1" - -## -# Snippet for the create_big_query_export call in the SecurityCenter service -# -# This snippet has been automatically generated and should be regarded as a code -# template only. It will require modifications to work: -# - It may require correct/in-range values for request initialization. -# - It may require specifying regional endpoints when creating the service -# client as shown in https://cloud.google.com/ruby/docs/reference. -# -# This is an auto-generated example demonstrating basic usage of -# Google::Cloud::SecurityCenter::V1::SecurityCenter::Client#create_big_query_export. -# -def create_big_query_export - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::SecurityCenter::V1::SecurityCenter::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::SecurityCenter::V1::CreateBigQueryExportRequest.new - - # Call the create_big_query_export method. - result = client.create_big_query_export request - - # The returned object is of type Google::Cloud::SecurityCenter::V1::BigQueryExport. - p result -end -# [END securitycenter_v1_generated_SecurityCenter_CreateBigQueryExport_sync] diff --git a/owl-bot-staging/google-cloud-security_center-v1/snippets/security_center/create_event_threat_detection_custom_module.rb b/owl-bot-staging/google-cloud-security_center-v1/snippets/security_center/create_event_threat_detection_custom_module.rb deleted file mode 100644 index 08036d256638..000000000000 --- a/owl-bot-staging/google-cloud-security_center-v1/snippets/security_center/create_event_threat_detection_custom_module.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 securitycenter_v1_generated_SecurityCenter_CreateEventThreatDetectionCustomModule_sync] -require "google/cloud/security_center/v1" - -## -# Snippet for the create_event_threat_detection_custom_module call in the SecurityCenter service -# -# This snippet has been automatically generated and should be regarded as a code -# template only. It will require modifications to work: -# - It may require correct/in-range values for request initialization. -# - It may require specifying regional endpoints when creating the service -# client as shown in https://cloud.google.com/ruby/docs/reference. -# -# This is an auto-generated example demonstrating basic usage of -# Google::Cloud::SecurityCenter::V1::SecurityCenter::Client#create_event_threat_detection_custom_module. -# -def create_event_threat_detection_custom_module - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::SecurityCenter::V1::SecurityCenter::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::SecurityCenter::V1::CreateEventThreatDetectionCustomModuleRequest.new - - # Call the create_event_threat_detection_custom_module method. - result = client.create_event_threat_detection_custom_module request - - # The returned object is of type Google::Cloud::SecurityCenter::V1::EventThreatDetectionCustomModule. - p result -end -# [END securitycenter_v1_generated_SecurityCenter_CreateEventThreatDetectionCustomModule_sync] diff --git a/owl-bot-staging/google-cloud-security_center-v1/snippets/security_center/create_finding.rb b/owl-bot-staging/google-cloud-security_center-v1/snippets/security_center/create_finding.rb deleted file mode 100644 index 0b195fb59e80..000000000000 --- a/owl-bot-staging/google-cloud-security_center-v1/snippets/security_center/create_finding.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 securitycenter_v1_generated_SecurityCenter_CreateFinding_sync] -require "google/cloud/security_center/v1" - -## -# Snippet for the create_finding call in the SecurityCenter service -# -# This snippet has been automatically generated and should be regarded as a code -# template only. It will require modifications to work: -# - It may require correct/in-range values for request initialization. -# - It may require specifying regional endpoints when creating the service -# client as shown in https://cloud.google.com/ruby/docs/reference. -# -# This is an auto-generated example demonstrating basic usage of -# Google::Cloud::SecurityCenter::V1::SecurityCenter::Client#create_finding. -# -def create_finding - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::SecurityCenter::V1::SecurityCenter::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::SecurityCenter::V1::CreateFindingRequest.new - - # Call the create_finding method. - result = client.create_finding request - - # The returned object is of type Google::Cloud::SecurityCenter::V1::Finding. - p result -end -# [END securitycenter_v1_generated_SecurityCenter_CreateFinding_sync] diff --git a/owl-bot-staging/google-cloud-security_center-v1/snippets/security_center/create_mute_config.rb b/owl-bot-staging/google-cloud-security_center-v1/snippets/security_center/create_mute_config.rb deleted file mode 100644 index 7c91c84d013c..000000000000 --- a/owl-bot-staging/google-cloud-security_center-v1/snippets/security_center/create_mute_config.rb +++ /dev/null @@ -1,47 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -# [START securitycenter_v1_generated_SecurityCenter_CreateMuteConfig_sync] -require "google/cloud/security_center/v1" - -## -# Snippet for the create_mute_config call in the SecurityCenter service -# -# This snippet has been automatically generated and should be regarded as a code -# template only. It will require modifications to work: -# - It may require correct/in-range values for request initialization. -# - It may require specifying regional endpoints when creating the service -# client as shown in https://cloud.google.com/ruby/docs/reference. -# -# This is an auto-generated example demonstrating basic usage of -# Google::Cloud::SecurityCenter::V1::SecurityCenter::Client#create_mute_config. -# -def create_mute_config - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::SecurityCenter::V1::SecurityCenter::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::SecurityCenter::V1::CreateMuteConfigRequest.new - - # Call the create_mute_config method. - result = client.create_mute_config request - - # The returned object is of type Google::Cloud::SecurityCenter::V1::MuteConfig. - p result -end -# [END securitycenter_v1_generated_SecurityCenter_CreateMuteConfig_sync] diff --git a/owl-bot-staging/google-cloud-security_center-v1/snippets/security_center/create_notification_config.rb b/owl-bot-staging/google-cloud-security_center-v1/snippets/security_center/create_notification_config.rb deleted file mode 100644 index 9d25cf280532..000000000000 --- a/owl-bot-staging/google-cloud-security_center-v1/snippets/security_center/create_notification_config.rb +++ /dev/null @@ -1,47 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -# [START securitycenter_v1_generated_SecurityCenter_CreateNotificationConfig_sync] -require "google/cloud/security_center/v1" - -## -# Snippet for the create_notification_config call in the SecurityCenter service -# -# This snippet has been automatically generated and should be regarded as a code -# template only. It will require modifications to work: -# - It may require correct/in-range values for request initialization. -# - It may require specifying regional endpoints when creating the service -# client as shown in https://cloud.google.com/ruby/docs/reference. -# -# This is an auto-generated example demonstrating basic usage of -# Google::Cloud::SecurityCenter::V1::SecurityCenter::Client#create_notification_config. -# -def create_notification_config - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::SecurityCenter::V1::SecurityCenter::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::SecurityCenter::V1::CreateNotificationConfigRequest.new - - # Call the create_notification_config method. - result = client.create_notification_config request - - # The returned object is of type Google::Cloud::SecurityCenter::V1::NotificationConfig. - p result -end -# [END securitycenter_v1_generated_SecurityCenter_CreateNotificationConfig_sync] diff --git a/owl-bot-staging/google-cloud-security_center-v1/snippets/security_center/create_security_health_analytics_custom_module.rb b/owl-bot-staging/google-cloud-security_center-v1/snippets/security_center/create_security_health_analytics_custom_module.rb deleted file mode 100644 index 5de06ad0e47b..000000000000 --- a/owl-bot-staging/google-cloud-security_center-v1/snippets/security_center/create_security_health_analytics_custom_module.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 securitycenter_v1_generated_SecurityCenter_CreateSecurityHealthAnalyticsCustomModule_sync] -require "google/cloud/security_center/v1" - -## -# Snippet for the create_security_health_analytics_custom_module call in the SecurityCenter service -# -# This snippet has been automatically generated and should be regarded as a code -# template only. It will require modifications to work: -# - It may require correct/in-range values for request initialization. -# - It may require specifying regional endpoints when creating the service -# client as shown in https://cloud.google.com/ruby/docs/reference. -# -# This is an auto-generated example demonstrating basic usage of -# Google::Cloud::SecurityCenter::V1::SecurityCenter::Client#create_security_health_analytics_custom_module. -# -def create_security_health_analytics_custom_module - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::SecurityCenter::V1::SecurityCenter::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::SecurityCenter::V1::CreateSecurityHealthAnalyticsCustomModuleRequest.new - - # Call the create_security_health_analytics_custom_module method. - result = client.create_security_health_analytics_custom_module request - - # The returned object is of type Google::Cloud::SecurityCenter::V1::SecurityHealthAnalyticsCustomModule. - p result -end -# [END securitycenter_v1_generated_SecurityCenter_CreateSecurityHealthAnalyticsCustomModule_sync] diff --git a/owl-bot-staging/google-cloud-security_center-v1/snippets/security_center/create_source.rb b/owl-bot-staging/google-cloud-security_center-v1/snippets/security_center/create_source.rb deleted file mode 100644 index 426ebeba8ec5..000000000000 --- a/owl-bot-staging/google-cloud-security_center-v1/snippets/security_center/create_source.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 securitycenter_v1_generated_SecurityCenter_CreateSource_sync] -require "google/cloud/security_center/v1" - -## -# Snippet for the create_source call in the SecurityCenter service -# -# This snippet has been automatically generated and should be regarded as a code -# template only. It will require modifications to work: -# - It may require correct/in-range values for request initialization. -# - It may require specifying regional endpoints when creating the service -# client as shown in https://cloud.google.com/ruby/docs/reference. -# -# This is an auto-generated example demonstrating basic usage of -# Google::Cloud::SecurityCenter::V1::SecurityCenter::Client#create_source. -# -def create_source - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::SecurityCenter::V1::SecurityCenter::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::SecurityCenter::V1::CreateSourceRequest.new - - # Call the create_source method. - result = client.create_source request - - # The returned object is of type Google::Cloud::SecurityCenter::V1::Source. - p result -end -# [END securitycenter_v1_generated_SecurityCenter_CreateSource_sync] diff --git a/owl-bot-staging/google-cloud-security_center-v1/snippets/security_center/delete_big_query_export.rb b/owl-bot-staging/google-cloud-security_center-v1/snippets/security_center/delete_big_query_export.rb deleted file mode 100644 index e549c6d67597..000000000000 --- a/owl-bot-staging/google-cloud-security_center-v1/snippets/security_center/delete_big_query_export.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 securitycenter_v1_generated_SecurityCenter_DeleteBigQueryExport_sync] -require "google/cloud/security_center/v1" - -## -# Snippet for the delete_big_query_export call in the SecurityCenter service -# -# This snippet has been automatically generated and should be regarded as a code -# template only. It will require modifications to work: -# - It may require correct/in-range values for request initialization. -# - It may require specifying regional endpoints when creating the service -# client as shown in https://cloud.google.com/ruby/docs/reference. -# -# This is an auto-generated example demonstrating basic usage of -# Google::Cloud::SecurityCenter::V1::SecurityCenter::Client#delete_big_query_export. -# -def delete_big_query_export - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::SecurityCenter::V1::SecurityCenter::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::SecurityCenter::V1::DeleteBigQueryExportRequest.new - - # Call the delete_big_query_export method. - result = client.delete_big_query_export request - - # The returned object is of type Google::Protobuf::Empty. - p result -end -# [END securitycenter_v1_generated_SecurityCenter_DeleteBigQueryExport_sync] diff --git a/owl-bot-staging/google-cloud-security_center-v1/snippets/security_center/delete_event_threat_detection_custom_module.rb b/owl-bot-staging/google-cloud-security_center-v1/snippets/security_center/delete_event_threat_detection_custom_module.rb deleted file mode 100644 index 9da872ba42f6..000000000000 --- a/owl-bot-staging/google-cloud-security_center-v1/snippets/security_center/delete_event_threat_detection_custom_module.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 securitycenter_v1_generated_SecurityCenter_DeleteEventThreatDetectionCustomModule_sync] -require "google/cloud/security_center/v1" - -## -# Snippet for the delete_event_threat_detection_custom_module call in the SecurityCenter service -# -# This snippet has been automatically generated and should be regarded as a code -# template only. It will require modifications to work: -# - It may require correct/in-range values for request initialization. -# - It may require specifying regional endpoints when creating the service -# client as shown in https://cloud.google.com/ruby/docs/reference. -# -# This is an auto-generated example demonstrating basic usage of -# Google::Cloud::SecurityCenter::V1::SecurityCenter::Client#delete_event_threat_detection_custom_module. -# -def delete_event_threat_detection_custom_module - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::SecurityCenter::V1::SecurityCenter::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::SecurityCenter::V1::DeleteEventThreatDetectionCustomModuleRequest.new - - # Call the delete_event_threat_detection_custom_module method. - result = client.delete_event_threat_detection_custom_module request - - # The returned object is of type Google::Protobuf::Empty. - p result -end -# [END securitycenter_v1_generated_SecurityCenter_DeleteEventThreatDetectionCustomModule_sync] diff --git a/owl-bot-staging/google-cloud-security_center-v1/snippets/security_center/delete_mute_config.rb b/owl-bot-staging/google-cloud-security_center-v1/snippets/security_center/delete_mute_config.rb deleted file mode 100644 index ea8a60533934..000000000000 --- a/owl-bot-staging/google-cloud-security_center-v1/snippets/security_center/delete_mute_config.rb +++ /dev/null @@ -1,47 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -# [START securitycenter_v1_generated_SecurityCenter_DeleteMuteConfig_sync] -require "google/cloud/security_center/v1" - -## -# Snippet for the delete_mute_config call in the SecurityCenter service -# -# This snippet has been automatically generated and should be regarded as a code -# template only. It will require modifications to work: -# - It may require correct/in-range values for request initialization. -# - It may require specifying regional endpoints when creating the service -# client as shown in https://cloud.google.com/ruby/docs/reference. -# -# This is an auto-generated example demonstrating basic usage of -# Google::Cloud::SecurityCenter::V1::SecurityCenter::Client#delete_mute_config. -# -def delete_mute_config - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::SecurityCenter::V1::SecurityCenter::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::SecurityCenter::V1::DeleteMuteConfigRequest.new - - # Call the delete_mute_config method. - result = client.delete_mute_config request - - # The returned object is of type Google::Protobuf::Empty. - p result -end -# [END securitycenter_v1_generated_SecurityCenter_DeleteMuteConfig_sync] diff --git a/owl-bot-staging/google-cloud-security_center-v1/snippets/security_center/delete_notification_config.rb b/owl-bot-staging/google-cloud-security_center-v1/snippets/security_center/delete_notification_config.rb deleted file mode 100644 index 6bc88e7ff81e..000000000000 --- a/owl-bot-staging/google-cloud-security_center-v1/snippets/security_center/delete_notification_config.rb +++ /dev/null @@ -1,47 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -# [START securitycenter_v1_generated_SecurityCenter_DeleteNotificationConfig_sync] -require "google/cloud/security_center/v1" - -## -# Snippet for the delete_notification_config call in the SecurityCenter service -# -# This snippet has been automatically generated and should be regarded as a code -# template only. It will require modifications to work: -# - It may require correct/in-range values for request initialization. -# - It may require specifying regional endpoints when creating the service -# client as shown in https://cloud.google.com/ruby/docs/reference. -# -# This is an auto-generated example demonstrating basic usage of -# Google::Cloud::SecurityCenter::V1::SecurityCenter::Client#delete_notification_config. -# -def delete_notification_config - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::SecurityCenter::V1::SecurityCenter::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::SecurityCenter::V1::DeleteNotificationConfigRequest.new - - # Call the delete_notification_config method. - result = client.delete_notification_config request - - # The returned object is of type Google::Protobuf::Empty. - p result -end -# [END securitycenter_v1_generated_SecurityCenter_DeleteNotificationConfig_sync] diff --git a/owl-bot-staging/google-cloud-security_center-v1/snippets/security_center/delete_resource_value_config.rb b/owl-bot-staging/google-cloud-security_center-v1/snippets/security_center/delete_resource_value_config.rb deleted file mode 100644 index a39d9a23c8fd..000000000000 --- a/owl-bot-staging/google-cloud-security_center-v1/snippets/security_center/delete_resource_value_config.rb +++ /dev/null @@ -1,47 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -# [START securitycenter_v1_generated_SecurityCenter_DeleteResourceValueConfig_sync] -require "google/cloud/security_center/v1" - -## -# Snippet for the delete_resource_value_config call in the SecurityCenter service -# -# This snippet has been automatically generated and should be regarded as a code -# template only. It will require modifications to work: -# - It may require correct/in-range values for request initialization. -# - It may require specifying regional endpoints when creating the service -# client as shown in https://cloud.google.com/ruby/docs/reference. -# -# This is an auto-generated example demonstrating basic usage of -# Google::Cloud::SecurityCenter::V1::SecurityCenter::Client#delete_resource_value_config. -# -def delete_resource_value_config - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::SecurityCenter::V1::SecurityCenter::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::SecurityCenter::V1::DeleteResourceValueConfigRequest.new - - # Call the delete_resource_value_config method. - result = client.delete_resource_value_config request - - # The returned object is of type Google::Protobuf::Empty. - p result -end -# [END securitycenter_v1_generated_SecurityCenter_DeleteResourceValueConfig_sync] diff --git a/owl-bot-staging/google-cloud-security_center-v1/snippets/security_center/delete_security_health_analytics_custom_module.rb b/owl-bot-staging/google-cloud-security_center-v1/snippets/security_center/delete_security_health_analytics_custom_module.rb deleted file mode 100644 index 946a821c16e2..000000000000 --- a/owl-bot-staging/google-cloud-security_center-v1/snippets/security_center/delete_security_health_analytics_custom_module.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 securitycenter_v1_generated_SecurityCenter_DeleteSecurityHealthAnalyticsCustomModule_sync] -require "google/cloud/security_center/v1" - -## -# Snippet for the delete_security_health_analytics_custom_module call in the SecurityCenter service -# -# This snippet has been automatically generated and should be regarded as a code -# template only. It will require modifications to work: -# - It may require correct/in-range values for request initialization. -# - It may require specifying regional endpoints when creating the service -# client as shown in https://cloud.google.com/ruby/docs/reference. -# -# This is an auto-generated example demonstrating basic usage of -# Google::Cloud::SecurityCenter::V1::SecurityCenter::Client#delete_security_health_analytics_custom_module. -# -def delete_security_health_analytics_custom_module - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::SecurityCenter::V1::SecurityCenter::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::SecurityCenter::V1::DeleteSecurityHealthAnalyticsCustomModuleRequest.new - - # Call the delete_security_health_analytics_custom_module method. - result = client.delete_security_health_analytics_custom_module request - - # The returned object is of type Google::Protobuf::Empty. - p result -end -# [END securitycenter_v1_generated_SecurityCenter_DeleteSecurityHealthAnalyticsCustomModule_sync] diff --git a/owl-bot-staging/google-cloud-security_center-v1/snippets/security_center/get_big_query_export.rb b/owl-bot-staging/google-cloud-security_center-v1/snippets/security_center/get_big_query_export.rb deleted file mode 100644 index 1c58bd5b0d78..000000000000 --- a/owl-bot-staging/google-cloud-security_center-v1/snippets/security_center/get_big_query_export.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 securitycenter_v1_generated_SecurityCenter_GetBigQueryExport_sync] -require "google/cloud/security_center/v1" - -## -# Snippet for the get_big_query_export call in the SecurityCenter service -# -# This snippet has been automatically generated and should be regarded as a code -# template only. It will require modifications to work: -# - It may require correct/in-range values for request initialization. -# - It may require specifying regional endpoints when creating the service -# client as shown in https://cloud.google.com/ruby/docs/reference. -# -# This is an auto-generated example demonstrating basic usage of -# Google::Cloud::SecurityCenter::V1::SecurityCenter::Client#get_big_query_export. -# -def get_big_query_export - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::SecurityCenter::V1::SecurityCenter::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::SecurityCenter::V1::GetBigQueryExportRequest.new - - # Call the get_big_query_export method. - result = client.get_big_query_export request - - # The returned object is of type Google::Cloud::SecurityCenter::V1::BigQueryExport. - p result -end -# [END securitycenter_v1_generated_SecurityCenter_GetBigQueryExport_sync] diff --git a/owl-bot-staging/google-cloud-security_center-v1/snippets/security_center/get_effective_event_threat_detection_custom_module.rb b/owl-bot-staging/google-cloud-security_center-v1/snippets/security_center/get_effective_event_threat_detection_custom_module.rb deleted file mode 100644 index be112113b672..000000000000 --- a/owl-bot-staging/google-cloud-security_center-v1/snippets/security_center/get_effective_event_threat_detection_custom_module.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 securitycenter_v1_generated_SecurityCenter_GetEffectiveEventThreatDetectionCustomModule_sync] -require "google/cloud/security_center/v1" - -## -# Snippet for the get_effective_event_threat_detection_custom_module call in the SecurityCenter service -# -# This snippet has been automatically generated and should be regarded as a code -# template only. It will require modifications to work: -# - It may require correct/in-range values for request initialization. -# - It may require specifying regional endpoints when creating the service -# client as shown in https://cloud.google.com/ruby/docs/reference. -# -# This is an auto-generated example demonstrating basic usage of -# Google::Cloud::SecurityCenter::V1::SecurityCenter::Client#get_effective_event_threat_detection_custom_module. -# -def get_effective_event_threat_detection_custom_module - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::SecurityCenter::V1::SecurityCenter::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::SecurityCenter::V1::GetEffectiveEventThreatDetectionCustomModuleRequest.new - - # Call the get_effective_event_threat_detection_custom_module method. - result = client.get_effective_event_threat_detection_custom_module request - - # The returned object is of type Google::Cloud::SecurityCenter::V1::EffectiveEventThreatDetectionCustomModule. - p result -end -# [END securitycenter_v1_generated_SecurityCenter_GetEffectiveEventThreatDetectionCustomModule_sync] diff --git a/owl-bot-staging/google-cloud-security_center-v1/snippets/security_center/get_effective_security_health_analytics_custom_module.rb b/owl-bot-staging/google-cloud-security_center-v1/snippets/security_center/get_effective_security_health_analytics_custom_module.rb deleted file mode 100644 index 7db2ddb3ecfc..000000000000 --- a/owl-bot-staging/google-cloud-security_center-v1/snippets/security_center/get_effective_security_health_analytics_custom_module.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 securitycenter_v1_generated_SecurityCenter_GetEffectiveSecurityHealthAnalyticsCustomModule_sync] -require "google/cloud/security_center/v1" - -## -# Snippet for the get_effective_security_health_analytics_custom_module call in the SecurityCenter service -# -# This snippet has been automatically generated and should be regarded as a code -# template only. It will require modifications to work: -# - It may require correct/in-range values for request initialization. -# - It may require specifying regional endpoints when creating the service -# client as shown in https://cloud.google.com/ruby/docs/reference. -# -# This is an auto-generated example demonstrating basic usage of -# Google::Cloud::SecurityCenter::V1::SecurityCenter::Client#get_effective_security_health_analytics_custom_module. -# -def get_effective_security_health_analytics_custom_module - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::SecurityCenter::V1::SecurityCenter::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::SecurityCenter::V1::GetEffectiveSecurityHealthAnalyticsCustomModuleRequest.new - - # Call the get_effective_security_health_analytics_custom_module method. - result = client.get_effective_security_health_analytics_custom_module request - - # The returned object is of type Google::Cloud::SecurityCenter::V1::EffectiveSecurityHealthAnalyticsCustomModule. - p result -end -# [END securitycenter_v1_generated_SecurityCenter_GetEffectiveSecurityHealthAnalyticsCustomModule_sync] diff --git a/owl-bot-staging/google-cloud-security_center-v1/snippets/security_center/get_event_threat_detection_custom_module.rb b/owl-bot-staging/google-cloud-security_center-v1/snippets/security_center/get_event_threat_detection_custom_module.rb deleted file mode 100644 index ec5742081391..000000000000 --- a/owl-bot-staging/google-cloud-security_center-v1/snippets/security_center/get_event_threat_detection_custom_module.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 securitycenter_v1_generated_SecurityCenter_GetEventThreatDetectionCustomModule_sync] -require "google/cloud/security_center/v1" - -## -# Snippet for the get_event_threat_detection_custom_module call in the SecurityCenter service -# -# This snippet has been automatically generated and should be regarded as a code -# template only. It will require modifications to work: -# - It may require correct/in-range values for request initialization. -# - It may require specifying regional endpoints when creating the service -# client as shown in https://cloud.google.com/ruby/docs/reference. -# -# This is an auto-generated example demonstrating basic usage of -# Google::Cloud::SecurityCenter::V1::SecurityCenter::Client#get_event_threat_detection_custom_module. -# -def get_event_threat_detection_custom_module - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::SecurityCenter::V1::SecurityCenter::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::SecurityCenter::V1::GetEventThreatDetectionCustomModuleRequest.new - - # Call the get_event_threat_detection_custom_module method. - result = client.get_event_threat_detection_custom_module request - - # The returned object is of type Google::Cloud::SecurityCenter::V1::EventThreatDetectionCustomModule. - p result -end -# [END securitycenter_v1_generated_SecurityCenter_GetEventThreatDetectionCustomModule_sync] diff --git a/owl-bot-staging/google-cloud-security_center-v1/snippets/security_center/get_iam_policy.rb b/owl-bot-staging/google-cloud-security_center-v1/snippets/security_center/get_iam_policy.rb deleted file mode 100644 index 2b9a6db77e1e..000000000000 --- a/owl-bot-staging/google-cloud-security_center-v1/snippets/security_center/get_iam_policy.rb +++ /dev/null @@ -1,47 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -# [START securitycenter_v1_generated_SecurityCenter_GetIamPolicy_sync] -require "google/cloud/security_center/v1" - -## -# Snippet for the get_iam_policy call in the SecurityCenter service -# -# This snippet has been automatically generated and should be regarded as a code -# template only. It will require modifications to work: -# - It may require correct/in-range values for request initialization. -# - It may require specifying regional endpoints when creating the service -# client as shown in https://cloud.google.com/ruby/docs/reference. -# -# This is an auto-generated example demonstrating basic usage of -# Google::Cloud::SecurityCenter::V1::SecurityCenter::Client#get_iam_policy. -# -def get_iam_policy - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::SecurityCenter::V1::SecurityCenter::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Iam::V1::GetIamPolicyRequest.new - - # Call the get_iam_policy method. - result = client.get_iam_policy request - - # The returned object is of type Google::Iam::V1::Policy. - p result -end -# [END securitycenter_v1_generated_SecurityCenter_GetIamPolicy_sync] diff --git a/owl-bot-staging/google-cloud-security_center-v1/snippets/security_center/get_mute_config.rb b/owl-bot-staging/google-cloud-security_center-v1/snippets/security_center/get_mute_config.rb deleted file mode 100644 index 48df3fdf3201..000000000000 --- a/owl-bot-staging/google-cloud-security_center-v1/snippets/security_center/get_mute_config.rb +++ /dev/null @@ -1,47 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -# [START securitycenter_v1_generated_SecurityCenter_GetMuteConfig_sync] -require "google/cloud/security_center/v1" - -## -# Snippet for the get_mute_config call in the SecurityCenter service -# -# This snippet has been automatically generated and should be regarded as a code -# template only. It will require modifications to work: -# - It may require correct/in-range values for request initialization. -# - It may require specifying regional endpoints when creating the service -# client as shown in https://cloud.google.com/ruby/docs/reference. -# -# This is an auto-generated example demonstrating basic usage of -# Google::Cloud::SecurityCenter::V1::SecurityCenter::Client#get_mute_config. -# -def get_mute_config - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::SecurityCenter::V1::SecurityCenter::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::SecurityCenter::V1::GetMuteConfigRequest.new - - # Call the get_mute_config method. - result = client.get_mute_config request - - # The returned object is of type Google::Cloud::SecurityCenter::V1::MuteConfig. - p result -end -# [END securitycenter_v1_generated_SecurityCenter_GetMuteConfig_sync] diff --git a/owl-bot-staging/google-cloud-security_center-v1/snippets/security_center/get_notification_config.rb b/owl-bot-staging/google-cloud-security_center-v1/snippets/security_center/get_notification_config.rb deleted file mode 100644 index 6b5a3b4c0d68..000000000000 --- a/owl-bot-staging/google-cloud-security_center-v1/snippets/security_center/get_notification_config.rb +++ /dev/null @@ -1,47 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -# [START securitycenter_v1_generated_SecurityCenter_GetNotificationConfig_sync] -require "google/cloud/security_center/v1" - -## -# Snippet for the get_notification_config call in the SecurityCenter service -# -# This snippet has been automatically generated and should be regarded as a code -# template only. It will require modifications to work: -# - It may require correct/in-range values for request initialization. -# - It may require specifying regional endpoints when creating the service -# client as shown in https://cloud.google.com/ruby/docs/reference. -# -# This is an auto-generated example demonstrating basic usage of -# Google::Cloud::SecurityCenter::V1::SecurityCenter::Client#get_notification_config. -# -def get_notification_config - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::SecurityCenter::V1::SecurityCenter::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::SecurityCenter::V1::GetNotificationConfigRequest.new - - # Call the get_notification_config method. - result = client.get_notification_config request - - # The returned object is of type Google::Cloud::SecurityCenter::V1::NotificationConfig. - p result -end -# [END securitycenter_v1_generated_SecurityCenter_GetNotificationConfig_sync] diff --git a/owl-bot-staging/google-cloud-security_center-v1/snippets/security_center/get_organization_settings.rb b/owl-bot-staging/google-cloud-security_center-v1/snippets/security_center/get_organization_settings.rb deleted file mode 100644 index b4b9f24ba65c..000000000000 --- a/owl-bot-staging/google-cloud-security_center-v1/snippets/security_center/get_organization_settings.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 securitycenter_v1_generated_SecurityCenter_GetOrganizationSettings_sync] -require "google/cloud/security_center/v1" - -## -# Snippet for the get_organization_settings call in the SecurityCenter service -# -# This snippet has been automatically generated and should be regarded as a code -# template only. It will require modifications to work: -# - It may require correct/in-range values for request initialization. -# - It may require specifying regional endpoints when creating the service -# client as shown in https://cloud.google.com/ruby/docs/reference. -# -# This is an auto-generated example demonstrating basic usage of -# Google::Cloud::SecurityCenter::V1::SecurityCenter::Client#get_organization_settings. -# -def get_organization_settings - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::SecurityCenter::V1::SecurityCenter::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::SecurityCenter::V1::GetOrganizationSettingsRequest.new - - # Call the get_organization_settings method. - result = client.get_organization_settings request - - # The returned object is of type Google::Cloud::SecurityCenter::V1::OrganizationSettings. - p result -end -# [END securitycenter_v1_generated_SecurityCenter_GetOrganizationSettings_sync] diff --git a/owl-bot-staging/google-cloud-security_center-v1/snippets/security_center/get_resource_value_config.rb b/owl-bot-staging/google-cloud-security_center-v1/snippets/security_center/get_resource_value_config.rb deleted file mode 100644 index d40c67a9eba0..000000000000 --- a/owl-bot-staging/google-cloud-security_center-v1/snippets/security_center/get_resource_value_config.rb +++ /dev/null @@ -1,47 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -# [START securitycenter_v1_generated_SecurityCenter_GetResourceValueConfig_sync] -require "google/cloud/security_center/v1" - -## -# Snippet for the get_resource_value_config call in the SecurityCenter service -# -# This snippet has been automatically generated and should be regarded as a code -# template only. It will require modifications to work: -# - It may require correct/in-range values for request initialization. -# - It may require specifying regional endpoints when creating the service -# client as shown in https://cloud.google.com/ruby/docs/reference. -# -# This is an auto-generated example demonstrating basic usage of -# Google::Cloud::SecurityCenter::V1::SecurityCenter::Client#get_resource_value_config. -# -def get_resource_value_config - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::SecurityCenter::V1::SecurityCenter::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::SecurityCenter::V1::GetResourceValueConfigRequest.new - - # Call the get_resource_value_config method. - result = client.get_resource_value_config request - - # The returned object is of type Google::Cloud::SecurityCenter::V1::ResourceValueConfig. - p result -end -# [END securitycenter_v1_generated_SecurityCenter_GetResourceValueConfig_sync] diff --git a/owl-bot-staging/google-cloud-security_center-v1/snippets/security_center/get_security_health_analytics_custom_module.rb b/owl-bot-staging/google-cloud-security_center-v1/snippets/security_center/get_security_health_analytics_custom_module.rb deleted file mode 100644 index a4f9f8ef3f19..000000000000 --- a/owl-bot-staging/google-cloud-security_center-v1/snippets/security_center/get_security_health_analytics_custom_module.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 securitycenter_v1_generated_SecurityCenter_GetSecurityHealthAnalyticsCustomModule_sync] -require "google/cloud/security_center/v1" - -## -# Snippet for the get_security_health_analytics_custom_module call in the SecurityCenter service -# -# This snippet has been automatically generated and should be regarded as a code -# template only. It will require modifications to work: -# - It may require correct/in-range values for request initialization. -# - It may require specifying regional endpoints when creating the service -# client as shown in https://cloud.google.com/ruby/docs/reference. -# -# This is an auto-generated example demonstrating basic usage of -# Google::Cloud::SecurityCenter::V1::SecurityCenter::Client#get_security_health_analytics_custom_module. -# -def get_security_health_analytics_custom_module - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::SecurityCenter::V1::SecurityCenter::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::SecurityCenter::V1::GetSecurityHealthAnalyticsCustomModuleRequest.new - - # Call the get_security_health_analytics_custom_module method. - result = client.get_security_health_analytics_custom_module request - - # The returned object is of type Google::Cloud::SecurityCenter::V1::SecurityHealthAnalyticsCustomModule. - p result -end -# [END securitycenter_v1_generated_SecurityCenter_GetSecurityHealthAnalyticsCustomModule_sync] diff --git a/owl-bot-staging/google-cloud-security_center-v1/snippets/security_center/get_simulation.rb b/owl-bot-staging/google-cloud-security_center-v1/snippets/security_center/get_simulation.rb deleted file mode 100644 index c0a1d22fa00d..000000000000 --- a/owl-bot-staging/google-cloud-security_center-v1/snippets/security_center/get_simulation.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 securitycenter_v1_generated_SecurityCenter_GetSimulation_sync] -require "google/cloud/security_center/v1" - -## -# Snippet for the get_simulation call in the SecurityCenter service -# -# This snippet has been automatically generated and should be regarded as a code -# template only. It will require modifications to work: -# - It may require correct/in-range values for request initialization. -# - It may require specifying regional endpoints when creating the service -# client as shown in https://cloud.google.com/ruby/docs/reference. -# -# This is an auto-generated example demonstrating basic usage of -# Google::Cloud::SecurityCenter::V1::SecurityCenter::Client#get_simulation. -# -def get_simulation - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::SecurityCenter::V1::SecurityCenter::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::SecurityCenter::V1::GetSimulationRequest.new - - # Call the get_simulation method. - result = client.get_simulation request - - # The returned object is of type Google::Cloud::SecurityCenter::V1::Simulation. - p result -end -# [END securitycenter_v1_generated_SecurityCenter_GetSimulation_sync] diff --git a/owl-bot-staging/google-cloud-security_center-v1/snippets/security_center/get_source.rb b/owl-bot-staging/google-cloud-security_center-v1/snippets/security_center/get_source.rb deleted file mode 100644 index bd7c16821102..000000000000 --- a/owl-bot-staging/google-cloud-security_center-v1/snippets/security_center/get_source.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 securitycenter_v1_generated_SecurityCenter_GetSource_sync] -require "google/cloud/security_center/v1" - -## -# Snippet for the get_source call in the SecurityCenter service -# -# This snippet has been automatically generated and should be regarded as a code -# template only. It will require modifications to work: -# - It may require correct/in-range values for request initialization. -# - It may require specifying regional endpoints when creating the service -# client as shown in https://cloud.google.com/ruby/docs/reference. -# -# This is an auto-generated example demonstrating basic usage of -# Google::Cloud::SecurityCenter::V1::SecurityCenter::Client#get_source. -# -def get_source - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::SecurityCenter::V1::SecurityCenter::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::SecurityCenter::V1::GetSourceRequest.new - - # Call the get_source method. - result = client.get_source request - - # The returned object is of type Google::Cloud::SecurityCenter::V1::Source. - p result -end -# [END securitycenter_v1_generated_SecurityCenter_GetSource_sync] diff --git a/owl-bot-staging/google-cloud-security_center-v1/snippets/security_center/get_valued_resource.rb b/owl-bot-staging/google-cloud-security_center-v1/snippets/security_center/get_valued_resource.rb deleted file mode 100644 index 8c1d07bdc6de..000000000000 --- a/owl-bot-staging/google-cloud-security_center-v1/snippets/security_center/get_valued_resource.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 securitycenter_v1_generated_SecurityCenter_GetValuedResource_sync] -require "google/cloud/security_center/v1" - -## -# Snippet for the get_valued_resource call in the SecurityCenter service -# -# This snippet has been automatically generated and should be regarded as a code -# template only. It will require modifications to work: -# - It may require correct/in-range values for request initialization. -# - It may require specifying regional endpoints when creating the service -# client as shown in https://cloud.google.com/ruby/docs/reference. -# -# This is an auto-generated example demonstrating basic usage of -# Google::Cloud::SecurityCenter::V1::SecurityCenter::Client#get_valued_resource. -# -def get_valued_resource - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::SecurityCenter::V1::SecurityCenter::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::SecurityCenter::V1::GetValuedResourceRequest.new - - # Call the get_valued_resource method. - result = client.get_valued_resource request - - # The returned object is of type Google::Cloud::SecurityCenter::V1::ValuedResource. - p result -end -# [END securitycenter_v1_generated_SecurityCenter_GetValuedResource_sync] diff --git a/owl-bot-staging/google-cloud-security_center-v1/snippets/security_center/group_assets.rb b/owl-bot-staging/google-cloud-security_center-v1/snippets/security_center/group_assets.rb deleted file mode 100644 index ae956d56813e..000000000000 --- a/owl-bot-staging/google-cloud-security_center-v1/snippets/security_center/group_assets.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 securitycenter_v1_generated_SecurityCenter_GroupAssets_sync] -require "google/cloud/security_center/v1" - -## -# Snippet for the group_assets call in the SecurityCenter service -# -# This snippet has been automatically generated and should be regarded as a code -# template only. It will require modifications to work: -# - It may require correct/in-range values for request initialization. -# - It may require specifying regional endpoints when creating the service -# client as shown in https://cloud.google.com/ruby/docs/reference. -# -# This is an auto-generated example demonstrating basic usage of -# Google::Cloud::SecurityCenter::V1::SecurityCenter::Client#group_assets. -# -def group_assets - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::SecurityCenter::V1::SecurityCenter::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::SecurityCenter::V1::GroupAssetsRequest.new - - # Call the group_assets method. - result = client.group_assets request - - # The returned object is of type Gapic::PagedEnumerable. You can iterate - # over elements, and API calls will be issued to fetch pages as needed. - result.each do |item| - # Each element is of type ::Google::Cloud::SecurityCenter::V1::GroupResult. - p item - end -end -# [END securitycenter_v1_generated_SecurityCenter_GroupAssets_sync] diff --git a/owl-bot-staging/google-cloud-security_center-v1/snippets/security_center/group_findings.rb b/owl-bot-staging/google-cloud-security_center-v1/snippets/security_center/group_findings.rb deleted file mode 100644 index c4786c15f09b..000000000000 --- a/owl-bot-staging/google-cloud-security_center-v1/snippets/security_center/group_findings.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 securitycenter_v1_generated_SecurityCenter_GroupFindings_sync] -require "google/cloud/security_center/v1" - -## -# Snippet for the group_findings call in the SecurityCenter service -# -# This snippet has been automatically generated and should be regarded as a code -# template only. It will require modifications to work: -# - It may require correct/in-range values for request initialization. -# - It may require specifying regional endpoints when creating the service -# client as shown in https://cloud.google.com/ruby/docs/reference. -# -# This is an auto-generated example demonstrating basic usage of -# Google::Cloud::SecurityCenter::V1::SecurityCenter::Client#group_findings. -# -def group_findings - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::SecurityCenter::V1::SecurityCenter::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::SecurityCenter::V1::GroupFindingsRequest.new - - # Call the group_findings method. - result = client.group_findings request - - # The returned object is of type Gapic::PagedEnumerable. You can iterate - # over elements, and API calls will be issued to fetch pages as needed. - result.each do |item| - # Each element is of type ::Google::Cloud::SecurityCenter::V1::GroupResult. - p item - end -end -# [END securitycenter_v1_generated_SecurityCenter_GroupFindings_sync] diff --git a/owl-bot-staging/google-cloud-security_center-v1/snippets/security_center/list_assets.rb b/owl-bot-staging/google-cloud-security_center-v1/snippets/security_center/list_assets.rb deleted file mode 100644 index ceeaebf8d86d..000000000000 --- a/owl-bot-staging/google-cloud-security_center-v1/snippets/security_center/list_assets.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 securitycenter_v1_generated_SecurityCenter_ListAssets_sync] -require "google/cloud/security_center/v1" - -## -# Snippet for the list_assets call in the SecurityCenter service -# -# This snippet has been automatically generated and should be regarded as a code -# template only. It will require modifications to work: -# - It may require correct/in-range values for request initialization. -# - It may require specifying regional endpoints when creating the service -# client as shown in https://cloud.google.com/ruby/docs/reference. -# -# This is an auto-generated example demonstrating basic usage of -# Google::Cloud::SecurityCenter::V1::SecurityCenter::Client#list_assets. -# -def list_assets - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::SecurityCenter::V1::SecurityCenter::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::SecurityCenter::V1::ListAssetsRequest.new - - # Call the list_assets method. - result = client.list_assets request - - # The returned object is of type Gapic::PagedEnumerable. You can iterate - # over elements, and API calls will be issued to fetch pages as needed. - result.each do |item| - # Each element is of type ::Google::Cloud::SecurityCenter::V1::ListAssetsResponse::ListAssetsResult. - p item - end -end -# [END securitycenter_v1_generated_SecurityCenter_ListAssets_sync] diff --git a/owl-bot-staging/google-cloud-security_center-v1/snippets/security_center/list_attack_paths.rb b/owl-bot-staging/google-cloud-security_center-v1/snippets/security_center/list_attack_paths.rb deleted file mode 100644 index 5862a15cff4a..000000000000 --- a/owl-bot-staging/google-cloud-security_center-v1/snippets/security_center/list_attack_paths.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 securitycenter_v1_generated_SecurityCenter_ListAttackPaths_sync] -require "google/cloud/security_center/v1" - -## -# Snippet for the list_attack_paths call in the SecurityCenter service -# -# This snippet has been automatically generated and should be regarded as a code -# template only. It will require modifications to work: -# - It may require correct/in-range values for request initialization. -# - It may require specifying regional endpoints when creating the service -# client as shown in https://cloud.google.com/ruby/docs/reference. -# -# This is an auto-generated example demonstrating basic usage of -# Google::Cloud::SecurityCenter::V1::SecurityCenter::Client#list_attack_paths. -# -def list_attack_paths - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::SecurityCenter::V1::SecurityCenter::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::SecurityCenter::V1::ListAttackPathsRequest.new - - # Call the list_attack_paths method. - result = client.list_attack_paths request - - # The returned object is of type Gapic::PagedEnumerable. You can iterate - # over elements, and API calls will be issued to fetch pages as needed. - result.each do |item| - # Each element is of type ::Google::Cloud::SecurityCenter::V1::AttackPath. - p item - end -end -# [END securitycenter_v1_generated_SecurityCenter_ListAttackPaths_sync] diff --git a/owl-bot-staging/google-cloud-security_center-v1/snippets/security_center/list_big_query_exports.rb b/owl-bot-staging/google-cloud-security_center-v1/snippets/security_center/list_big_query_exports.rb deleted file mode 100644 index 3746c178ec2f..000000000000 --- a/owl-bot-staging/google-cloud-security_center-v1/snippets/security_center/list_big_query_exports.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 securitycenter_v1_generated_SecurityCenter_ListBigQueryExports_sync] -require "google/cloud/security_center/v1" - -## -# Snippet for the list_big_query_exports call in the SecurityCenter service -# -# This snippet has been automatically generated and should be regarded as a code -# template only. It will require modifications to work: -# - It may require correct/in-range values for request initialization. -# - It may require specifying regional endpoints when creating the service -# client as shown in https://cloud.google.com/ruby/docs/reference. -# -# This is an auto-generated example demonstrating basic usage of -# Google::Cloud::SecurityCenter::V1::SecurityCenter::Client#list_big_query_exports. -# -def list_big_query_exports - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::SecurityCenter::V1::SecurityCenter::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::SecurityCenter::V1::ListBigQueryExportsRequest.new - - # Call the list_big_query_exports method. - result = client.list_big_query_exports request - - # The returned object is of type Gapic::PagedEnumerable. You can iterate - # over elements, and API calls will be issued to fetch pages as needed. - result.each do |item| - # Each element is of type ::Google::Cloud::SecurityCenter::V1::BigQueryExport. - p item - end -end -# [END securitycenter_v1_generated_SecurityCenter_ListBigQueryExports_sync] diff --git a/owl-bot-staging/google-cloud-security_center-v1/snippets/security_center/list_descendant_event_threat_detection_custom_modules.rb b/owl-bot-staging/google-cloud-security_center-v1/snippets/security_center/list_descendant_event_threat_detection_custom_modules.rb deleted file mode 100644 index 5dacc91c28be..000000000000 --- a/owl-bot-staging/google-cloud-security_center-v1/snippets/security_center/list_descendant_event_threat_detection_custom_modules.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 securitycenter_v1_generated_SecurityCenter_ListDescendantEventThreatDetectionCustomModules_sync] -require "google/cloud/security_center/v1" - -## -# Snippet for the list_descendant_event_threat_detection_custom_modules call in the SecurityCenter service -# -# This snippet has been automatically generated and should be regarded as a code -# template only. It will require modifications to work: -# - It may require correct/in-range values for request initialization. -# - It may require specifying regional endpoints when creating the service -# client as shown in https://cloud.google.com/ruby/docs/reference. -# -# This is an auto-generated example demonstrating basic usage of -# Google::Cloud::SecurityCenter::V1::SecurityCenter::Client#list_descendant_event_threat_detection_custom_modules. -# -def list_descendant_event_threat_detection_custom_modules - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::SecurityCenter::V1::SecurityCenter::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::SecurityCenter::V1::ListDescendantEventThreatDetectionCustomModulesRequest.new - - # Call the list_descendant_event_threat_detection_custom_modules method. - result = client.list_descendant_event_threat_detection_custom_modules request - - # The returned object is of type Gapic::PagedEnumerable. You can iterate - # over elements, and API calls will be issued to fetch pages as needed. - result.each do |item| - # Each element is of type ::Google::Cloud::SecurityCenter::V1::EventThreatDetectionCustomModule. - p item - end -end -# [END securitycenter_v1_generated_SecurityCenter_ListDescendantEventThreatDetectionCustomModules_sync] diff --git a/owl-bot-staging/google-cloud-security_center-v1/snippets/security_center/list_descendant_security_health_analytics_custom_modules.rb b/owl-bot-staging/google-cloud-security_center-v1/snippets/security_center/list_descendant_security_health_analytics_custom_modules.rb deleted file mode 100644 index 5f821c75b303..000000000000 --- a/owl-bot-staging/google-cloud-security_center-v1/snippets/security_center/list_descendant_security_health_analytics_custom_modules.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 securitycenter_v1_generated_SecurityCenter_ListDescendantSecurityHealthAnalyticsCustomModules_sync] -require "google/cloud/security_center/v1" - -## -# Snippet for the list_descendant_security_health_analytics_custom_modules call in the SecurityCenter service -# -# This snippet has been automatically generated and should be regarded as a code -# template only. It will require modifications to work: -# - It may require correct/in-range values for request initialization. -# - It may require specifying regional endpoints when creating the service -# client as shown in https://cloud.google.com/ruby/docs/reference. -# -# This is an auto-generated example demonstrating basic usage of -# Google::Cloud::SecurityCenter::V1::SecurityCenter::Client#list_descendant_security_health_analytics_custom_modules. -# -def list_descendant_security_health_analytics_custom_modules - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::SecurityCenter::V1::SecurityCenter::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::SecurityCenter::V1::ListDescendantSecurityHealthAnalyticsCustomModulesRequest.new - - # Call the list_descendant_security_health_analytics_custom_modules method. - result = client.list_descendant_security_health_analytics_custom_modules request - - # The returned object is of type Gapic::PagedEnumerable. You can iterate - # over elements, and API calls will be issued to fetch pages as needed. - result.each do |item| - # Each element is of type ::Google::Cloud::SecurityCenter::V1::SecurityHealthAnalyticsCustomModule. - p item - end -end -# [END securitycenter_v1_generated_SecurityCenter_ListDescendantSecurityHealthAnalyticsCustomModules_sync] diff --git a/owl-bot-staging/google-cloud-security_center-v1/snippets/security_center/list_effective_event_threat_detection_custom_modules.rb b/owl-bot-staging/google-cloud-security_center-v1/snippets/security_center/list_effective_event_threat_detection_custom_modules.rb deleted file mode 100644 index 39414a8834dd..000000000000 --- a/owl-bot-staging/google-cloud-security_center-v1/snippets/security_center/list_effective_event_threat_detection_custom_modules.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 securitycenter_v1_generated_SecurityCenter_ListEffectiveEventThreatDetectionCustomModules_sync] -require "google/cloud/security_center/v1" - -## -# Snippet for the list_effective_event_threat_detection_custom_modules call in the SecurityCenter service -# -# This snippet has been automatically generated and should be regarded as a code -# template only. It will require modifications to work: -# - It may require correct/in-range values for request initialization. -# - It may require specifying regional endpoints when creating the service -# client as shown in https://cloud.google.com/ruby/docs/reference. -# -# This is an auto-generated example demonstrating basic usage of -# Google::Cloud::SecurityCenter::V1::SecurityCenter::Client#list_effective_event_threat_detection_custom_modules. -# -def list_effective_event_threat_detection_custom_modules - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::SecurityCenter::V1::SecurityCenter::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::SecurityCenter::V1::ListEffectiveEventThreatDetectionCustomModulesRequest.new - - # Call the list_effective_event_threat_detection_custom_modules method. - result = client.list_effective_event_threat_detection_custom_modules request - - # The returned object is of type Gapic::PagedEnumerable. You can iterate - # over elements, and API calls will be issued to fetch pages as needed. - result.each do |item| - # Each element is of type ::Google::Cloud::SecurityCenter::V1::EffectiveEventThreatDetectionCustomModule. - p item - end -end -# [END securitycenter_v1_generated_SecurityCenter_ListEffectiveEventThreatDetectionCustomModules_sync] diff --git a/owl-bot-staging/google-cloud-security_center-v1/snippets/security_center/list_effective_security_health_analytics_custom_modules.rb b/owl-bot-staging/google-cloud-security_center-v1/snippets/security_center/list_effective_security_health_analytics_custom_modules.rb deleted file mode 100644 index 964e57448ce6..000000000000 --- a/owl-bot-staging/google-cloud-security_center-v1/snippets/security_center/list_effective_security_health_analytics_custom_modules.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 securitycenter_v1_generated_SecurityCenter_ListEffectiveSecurityHealthAnalyticsCustomModules_sync] -require "google/cloud/security_center/v1" - -## -# Snippet for the list_effective_security_health_analytics_custom_modules call in the SecurityCenter service -# -# This snippet has been automatically generated and should be regarded as a code -# template only. It will require modifications to work: -# - It may require correct/in-range values for request initialization. -# - It may require specifying regional endpoints when creating the service -# client as shown in https://cloud.google.com/ruby/docs/reference. -# -# This is an auto-generated example demonstrating basic usage of -# Google::Cloud::SecurityCenter::V1::SecurityCenter::Client#list_effective_security_health_analytics_custom_modules. -# -def list_effective_security_health_analytics_custom_modules - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::SecurityCenter::V1::SecurityCenter::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::SecurityCenter::V1::ListEffectiveSecurityHealthAnalyticsCustomModulesRequest.new - - # Call the list_effective_security_health_analytics_custom_modules method. - result = client.list_effective_security_health_analytics_custom_modules request - - # The returned object is of type Gapic::PagedEnumerable. You can iterate - # over elements, and API calls will be issued to fetch pages as needed. - result.each do |item| - # Each element is of type ::Google::Cloud::SecurityCenter::V1::EffectiveSecurityHealthAnalyticsCustomModule. - p item - end -end -# [END securitycenter_v1_generated_SecurityCenter_ListEffectiveSecurityHealthAnalyticsCustomModules_sync] diff --git a/owl-bot-staging/google-cloud-security_center-v1/snippets/security_center/list_event_threat_detection_custom_modules.rb b/owl-bot-staging/google-cloud-security_center-v1/snippets/security_center/list_event_threat_detection_custom_modules.rb deleted file mode 100644 index 41b6dd7a76c0..000000000000 --- a/owl-bot-staging/google-cloud-security_center-v1/snippets/security_center/list_event_threat_detection_custom_modules.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 securitycenter_v1_generated_SecurityCenter_ListEventThreatDetectionCustomModules_sync] -require "google/cloud/security_center/v1" - -## -# Snippet for the list_event_threat_detection_custom_modules call in the SecurityCenter service -# -# This snippet has been automatically generated and should be regarded as a code -# template only. It will require modifications to work: -# - It may require correct/in-range values for request initialization. -# - It may require specifying regional endpoints when creating the service -# client as shown in https://cloud.google.com/ruby/docs/reference. -# -# This is an auto-generated example demonstrating basic usage of -# Google::Cloud::SecurityCenter::V1::SecurityCenter::Client#list_event_threat_detection_custom_modules. -# -def list_event_threat_detection_custom_modules - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::SecurityCenter::V1::SecurityCenter::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::SecurityCenter::V1::ListEventThreatDetectionCustomModulesRequest.new - - # Call the list_event_threat_detection_custom_modules method. - result = client.list_event_threat_detection_custom_modules request - - # The returned object is of type Gapic::PagedEnumerable. You can iterate - # over elements, and API calls will be issued to fetch pages as needed. - result.each do |item| - # Each element is of type ::Google::Cloud::SecurityCenter::V1::EventThreatDetectionCustomModule. - p item - end -end -# [END securitycenter_v1_generated_SecurityCenter_ListEventThreatDetectionCustomModules_sync] diff --git a/owl-bot-staging/google-cloud-security_center-v1/snippets/security_center/list_findings.rb b/owl-bot-staging/google-cloud-security_center-v1/snippets/security_center/list_findings.rb deleted file mode 100644 index 57fb4cae4392..000000000000 --- a/owl-bot-staging/google-cloud-security_center-v1/snippets/security_center/list_findings.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 securitycenter_v1_generated_SecurityCenter_ListFindings_sync] -require "google/cloud/security_center/v1" - -## -# Snippet for the list_findings call in the SecurityCenter service -# -# This snippet has been automatically generated and should be regarded as a code -# template only. It will require modifications to work: -# - It may require correct/in-range values for request initialization. -# - It may require specifying regional endpoints when creating the service -# client as shown in https://cloud.google.com/ruby/docs/reference. -# -# This is an auto-generated example demonstrating basic usage of -# Google::Cloud::SecurityCenter::V1::SecurityCenter::Client#list_findings. -# -def list_findings - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::SecurityCenter::V1::SecurityCenter::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::SecurityCenter::V1::ListFindingsRequest.new - - # Call the list_findings method. - result = client.list_findings request - - # The returned object is of type Gapic::PagedEnumerable. You can iterate - # over elements, and API calls will be issued to fetch pages as needed. - result.each do |item| - # Each element is of type ::Google::Cloud::SecurityCenter::V1::ListFindingsResponse::ListFindingsResult. - p item - end -end -# [END securitycenter_v1_generated_SecurityCenter_ListFindings_sync] diff --git a/owl-bot-staging/google-cloud-security_center-v1/snippets/security_center/list_mute_configs.rb b/owl-bot-staging/google-cloud-security_center-v1/snippets/security_center/list_mute_configs.rb deleted file mode 100644 index eb1fdb03d97d..000000000000 --- a/owl-bot-staging/google-cloud-security_center-v1/snippets/security_center/list_mute_configs.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 securitycenter_v1_generated_SecurityCenter_ListMuteConfigs_sync] -require "google/cloud/security_center/v1" - -## -# Snippet for the list_mute_configs call in the SecurityCenter service -# -# This snippet has been automatically generated and should be regarded as a code -# template only. It will require modifications to work: -# - It may require correct/in-range values for request initialization. -# - It may require specifying regional endpoints when creating the service -# client as shown in https://cloud.google.com/ruby/docs/reference. -# -# This is an auto-generated example demonstrating basic usage of -# Google::Cloud::SecurityCenter::V1::SecurityCenter::Client#list_mute_configs. -# -def list_mute_configs - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::SecurityCenter::V1::SecurityCenter::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::SecurityCenter::V1::ListMuteConfigsRequest.new - - # Call the list_mute_configs method. - result = client.list_mute_configs request - - # The returned object is of type Gapic::PagedEnumerable. You can iterate - # over elements, and API calls will be issued to fetch pages as needed. - result.each do |item| - # Each element is of type ::Google::Cloud::SecurityCenter::V1::MuteConfig. - p item - end -end -# [END securitycenter_v1_generated_SecurityCenter_ListMuteConfigs_sync] diff --git a/owl-bot-staging/google-cloud-security_center-v1/snippets/security_center/list_notification_configs.rb b/owl-bot-staging/google-cloud-security_center-v1/snippets/security_center/list_notification_configs.rb deleted file mode 100644 index b7b5eee3314f..000000000000 --- a/owl-bot-staging/google-cloud-security_center-v1/snippets/security_center/list_notification_configs.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 securitycenter_v1_generated_SecurityCenter_ListNotificationConfigs_sync] -require "google/cloud/security_center/v1" - -## -# Snippet for the list_notification_configs call in the SecurityCenter service -# -# This snippet has been automatically generated and should be regarded as a code -# template only. It will require modifications to work: -# - It may require correct/in-range values for request initialization. -# - It may require specifying regional endpoints when creating the service -# client as shown in https://cloud.google.com/ruby/docs/reference. -# -# This is an auto-generated example demonstrating basic usage of -# Google::Cloud::SecurityCenter::V1::SecurityCenter::Client#list_notification_configs. -# -def list_notification_configs - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::SecurityCenter::V1::SecurityCenter::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::SecurityCenter::V1::ListNotificationConfigsRequest.new - - # Call the list_notification_configs method. - result = client.list_notification_configs request - - # The returned object is of type Gapic::PagedEnumerable. You can iterate - # over elements, and API calls will be issued to fetch pages as needed. - result.each do |item| - # Each element is of type ::Google::Cloud::SecurityCenter::V1::NotificationConfig. - p item - end -end -# [END securitycenter_v1_generated_SecurityCenter_ListNotificationConfigs_sync] diff --git a/owl-bot-staging/google-cloud-security_center-v1/snippets/security_center/list_resource_value_configs.rb b/owl-bot-staging/google-cloud-security_center-v1/snippets/security_center/list_resource_value_configs.rb deleted file mode 100644 index 251454a75ea0..000000000000 --- a/owl-bot-staging/google-cloud-security_center-v1/snippets/security_center/list_resource_value_configs.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 securitycenter_v1_generated_SecurityCenter_ListResourceValueConfigs_sync] -require "google/cloud/security_center/v1" - -## -# Snippet for the list_resource_value_configs call in the SecurityCenter service -# -# This snippet has been automatically generated and should be regarded as a code -# template only. It will require modifications to work: -# - It may require correct/in-range values for request initialization. -# - It may require specifying regional endpoints when creating the service -# client as shown in https://cloud.google.com/ruby/docs/reference. -# -# This is an auto-generated example demonstrating basic usage of -# Google::Cloud::SecurityCenter::V1::SecurityCenter::Client#list_resource_value_configs. -# -def list_resource_value_configs - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::SecurityCenter::V1::SecurityCenter::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::SecurityCenter::V1::ListResourceValueConfigsRequest.new - - # Call the list_resource_value_configs method. - result = client.list_resource_value_configs request - - # The returned object is of type Gapic::PagedEnumerable. You can iterate - # over elements, and API calls will be issued to fetch pages as needed. - result.each do |item| - # Each element is of type ::Google::Cloud::SecurityCenter::V1::ResourceValueConfig. - p item - end -end -# [END securitycenter_v1_generated_SecurityCenter_ListResourceValueConfigs_sync] diff --git a/owl-bot-staging/google-cloud-security_center-v1/snippets/security_center/list_security_health_analytics_custom_modules.rb b/owl-bot-staging/google-cloud-security_center-v1/snippets/security_center/list_security_health_analytics_custom_modules.rb deleted file mode 100644 index 1c67c25b10d3..000000000000 --- a/owl-bot-staging/google-cloud-security_center-v1/snippets/security_center/list_security_health_analytics_custom_modules.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 securitycenter_v1_generated_SecurityCenter_ListSecurityHealthAnalyticsCustomModules_sync] -require "google/cloud/security_center/v1" - -## -# Snippet for the list_security_health_analytics_custom_modules call in the SecurityCenter service -# -# This snippet has been automatically generated and should be regarded as a code -# template only. It will require modifications to work: -# - It may require correct/in-range values for request initialization. -# - It may require specifying regional endpoints when creating the service -# client as shown in https://cloud.google.com/ruby/docs/reference. -# -# This is an auto-generated example demonstrating basic usage of -# Google::Cloud::SecurityCenter::V1::SecurityCenter::Client#list_security_health_analytics_custom_modules. -# -def list_security_health_analytics_custom_modules - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::SecurityCenter::V1::SecurityCenter::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::SecurityCenter::V1::ListSecurityHealthAnalyticsCustomModulesRequest.new - - # Call the list_security_health_analytics_custom_modules method. - result = client.list_security_health_analytics_custom_modules request - - # The returned object is of type Gapic::PagedEnumerable. You can iterate - # over elements, and API calls will be issued to fetch pages as needed. - result.each do |item| - # Each element is of type ::Google::Cloud::SecurityCenter::V1::SecurityHealthAnalyticsCustomModule. - p item - end -end -# [END securitycenter_v1_generated_SecurityCenter_ListSecurityHealthAnalyticsCustomModules_sync] diff --git a/owl-bot-staging/google-cloud-security_center-v1/snippets/security_center/list_sources.rb b/owl-bot-staging/google-cloud-security_center-v1/snippets/security_center/list_sources.rb deleted file mode 100644 index c97a5da2a253..000000000000 --- a/owl-bot-staging/google-cloud-security_center-v1/snippets/security_center/list_sources.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 securitycenter_v1_generated_SecurityCenter_ListSources_sync] -require "google/cloud/security_center/v1" - -## -# Snippet for the list_sources call in the SecurityCenter service -# -# This snippet has been automatically generated and should be regarded as a code -# template only. It will require modifications to work: -# - It may require correct/in-range values for request initialization. -# - It may require specifying regional endpoints when creating the service -# client as shown in https://cloud.google.com/ruby/docs/reference. -# -# This is an auto-generated example demonstrating basic usage of -# Google::Cloud::SecurityCenter::V1::SecurityCenter::Client#list_sources. -# -def list_sources - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::SecurityCenter::V1::SecurityCenter::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::SecurityCenter::V1::ListSourcesRequest.new - - # Call the list_sources method. - result = client.list_sources request - - # The returned object is of type Gapic::PagedEnumerable. You can iterate - # over elements, and API calls will be issued to fetch pages as needed. - result.each do |item| - # Each element is of type ::Google::Cloud::SecurityCenter::V1::Source. - p item - end -end -# [END securitycenter_v1_generated_SecurityCenter_ListSources_sync] diff --git a/owl-bot-staging/google-cloud-security_center-v1/snippets/security_center/list_valued_resources.rb b/owl-bot-staging/google-cloud-security_center-v1/snippets/security_center/list_valued_resources.rb deleted file mode 100644 index 2dfc8bf0281c..000000000000 --- a/owl-bot-staging/google-cloud-security_center-v1/snippets/security_center/list_valued_resources.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 securitycenter_v1_generated_SecurityCenter_ListValuedResources_sync] -require "google/cloud/security_center/v1" - -## -# Snippet for the list_valued_resources call in the SecurityCenter service -# -# This snippet has been automatically generated and should be regarded as a code -# template only. It will require modifications to work: -# - It may require correct/in-range values for request initialization. -# - It may require specifying regional endpoints when creating the service -# client as shown in https://cloud.google.com/ruby/docs/reference. -# -# This is an auto-generated example demonstrating basic usage of -# Google::Cloud::SecurityCenter::V1::SecurityCenter::Client#list_valued_resources. -# -def list_valued_resources - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::SecurityCenter::V1::SecurityCenter::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::SecurityCenter::V1::ListValuedResourcesRequest.new - - # Call the list_valued_resources method. - result = client.list_valued_resources request - - # The returned object is of type Gapic::PagedEnumerable. You can iterate - # over elements, and API calls will be issued to fetch pages as needed. - result.each do |item| - # Each element is of type ::Google::Cloud::SecurityCenter::V1::ValuedResource. - p item - end -end -# [END securitycenter_v1_generated_SecurityCenter_ListValuedResources_sync] diff --git a/owl-bot-staging/google-cloud-security_center-v1/snippets/security_center/run_asset_discovery.rb b/owl-bot-staging/google-cloud-security_center-v1/snippets/security_center/run_asset_discovery.rb deleted file mode 100644 index b4992daa0dfc..000000000000 --- a/owl-bot-staging/google-cloud-security_center-v1/snippets/security_center/run_asset_discovery.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 securitycenter_v1_generated_SecurityCenter_RunAssetDiscovery_sync] -require "google/cloud/security_center/v1" - -## -# Snippet for the run_asset_discovery call in the SecurityCenter service -# -# This snippet has been automatically generated and should be regarded as a code -# template only. It will require modifications to work: -# - It may require correct/in-range values for request initialization. -# - It may require specifying regional endpoints when creating the service -# client as shown in https://cloud.google.com/ruby/docs/reference. -# -# This is an auto-generated example demonstrating basic usage of -# Google::Cloud::SecurityCenter::V1::SecurityCenter::Client#run_asset_discovery. -# -def run_asset_discovery - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::SecurityCenter::V1::SecurityCenter::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::SecurityCenter::V1::RunAssetDiscoveryRequest.new - - # Call the run_asset_discovery method. - result = client.run_asset_discovery 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 securitycenter_v1_generated_SecurityCenter_RunAssetDiscovery_sync] diff --git a/owl-bot-staging/google-cloud-security_center-v1/snippets/security_center/set_finding_state.rb b/owl-bot-staging/google-cloud-security_center-v1/snippets/security_center/set_finding_state.rb deleted file mode 100644 index 46ec0d32e12b..000000000000 --- a/owl-bot-staging/google-cloud-security_center-v1/snippets/security_center/set_finding_state.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 securitycenter_v1_generated_SecurityCenter_SetFindingState_sync] -require "google/cloud/security_center/v1" - -## -# Snippet for the set_finding_state call in the SecurityCenter service -# -# This snippet has been automatically generated and should be regarded as a code -# template only. It will require modifications to work: -# - It may require correct/in-range values for request initialization. -# - It may require specifying regional endpoints when creating the service -# client as shown in https://cloud.google.com/ruby/docs/reference. -# -# This is an auto-generated example demonstrating basic usage of -# Google::Cloud::SecurityCenter::V1::SecurityCenter::Client#set_finding_state. -# -def set_finding_state - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::SecurityCenter::V1::SecurityCenter::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::SecurityCenter::V1::SetFindingStateRequest.new - - # Call the set_finding_state method. - result = client.set_finding_state request - - # The returned object is of type Google::Cloud::SecurityCenter::V1::Finding. - p result -end -# [END securitycenter_v1_generated_SecurityCenter_SetFindingState_sync] diff --git a/owl-bot-staging/google-cloud-security_center-v1/snippets/security_center/set_iam_policy.rb b/owl-bot-staging/google-cloud-security_center-v1/snippets/security_center/set_iam_policy.rb deleted file mode 100644 index 61c6f0c2658c..000000000000 --- a/owl-bot-staging/google-cloud-security_center-v1/snippets/security_center/set_iam_policy.rb +++ /dev/null @@ -1,47 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -# [START securitycenter_v1_generated_SecurityCenter_SetIamPolicy_sync] -require "google/cloud/security_center/v1" - -## -# Snippet for the set_iam_policy call in the SecurityCenter service -# -# This snippet has been automatically generated and should be regarded as a code -# template only. It will require modifications to work: -# - It may require correct/in-range values for request initialization. -# - It may require specifying regional endpoints when creating the service -# client as shown in https://cloud.google.com/ruby/docs/reference. -# -# This is an auto-generated example demonstrating basic usage of -# Google::Cloud::SecurityCenter::V1::SecurityCenter::Client#set_iam_policy. -# -def set_iam_policy - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::SecurityCenter::V1::SecurityCenter::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Iam::V1::SetIamPolicyRequest.new - - # Call the set_iam_policy method. - result = client.set_iam_policy request - - # The returned object is of type Google::Iam::V1::Policy. - p result -end -# [END securitycenter_v1_generated_SecurityCenter_SetIamPolicy_sync] diff --git a/owl-bot-staging/google-cloud-security_center-v1/snippets/security_center/set_mute.rb b/owl-bot-staging/google-cloud-security_center-v1/snippets/security_center/set_mute.rb deleted file mode 100644 index 0d8d48794099..000000000000 --- a/owl-bot-staging/google-cloud-security_center-v1/snippets/security_center/set_mute.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 securitycenter_v1_generated_SecurityCenter_SetMute_sync] -require "google/cloud/security_center/v1" - -## -# Snippet for the set_mute call in the SecurityCenter service -# -# This snippet has been automatically generated and should be regarded as a code -# template only. It will require modifications to work: -# - It may require correct/in-range values for request initialization. -# - It may require specifying regional endpoints when creating the service -# client as shown in https://cloud.google.com/ruby/docs/reference. -# -# This is an auto-generated example demonstrating basic usage of -# Google::Cloud::SecurityCenter::V1::SecurityCenter::Client#set_mute. -# -def set_mute - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::SecurityCenter::V1::SecurityCenter::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::SecurityCenter::V1::SetMuteRequest.new - - # Call the set_mute method. - result = client.set_mute request - - # The returned object is of type Google::Cloud::SecurityCenter::V1::Finding. - p result -end -# [END securitycenter_v1_generated_SecurityCenter_SetMute_sync] diff --git a/owl-bot-staging/google-cloud-security_center-v1/snippets/security_center/simulate_security_health_analytics_custom_module.rb b/owl-bot-staging/google-cloud-security_center-v1/snippets/security_center/simulate_security_health_analytics_custom_module.rb deleted file mode 100644 index 6573cca21b08..000000000000 --- a/owl-bot-staging/google-cloud-security_center-v1/snippets/security_center/simulate_security_health_analytics_custom_module.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 securitycenter_v1_generated_SecurityCenter_SimulateSecurityHealthAnalyticsCustomModule_sync] -require "google/cloud/security_center/v1" - -## -# Snippet for the simulate_security_health_analytics_custom_module call in the SecurityCenter service -# -# This snippet has been automatically generated and should be regarded as a code -# template only. It will require modifications to work: -# - It may require correct/in-range values for request initialization. -# - It may require specifying regional endpoints when creating the service -# client as shown in https://cloud.google.com/ruby/docs/reference. -# -# This is an auto-generated example demonstrating basic usage of -# Google::Cloud::SecurityCenter::V1::SecurityCenter::Client#simulate_security_health_analytics_custom_module. -# -def simulate_security_health_analytics_custom_module - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::SecurityCenter::V1::SecurityCenter::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::SecurityCenter::V1::SimulateSecurityHealthAnalyticsCustomModuleRequest.new - - # Call the simulate_security_health_analytics_custom_module method. - result = client.simulate_security_health_analytics_custom_module request - - # The returned object is of type Google::Cloud::SecurityCenter::V1::SimulateSecurityHealthAnalyticsCustomModuleResponse. - p result -end -# [END securitycenter_v1_generated_SecurityCenter_SimulateSecurityHealthAnalyticsCustomModule_sync] diff --git a/owl-bot-staging/google-cloud-security_center-v1/snippets/security_center/test_iam_permissions.rb b/owl-bot-staging/google-cloud-security_center-v1/snippets/security_center/test_iam_permissions.rb deleted file mode 100644 index 2beb6f525829..000000000000 --- a/owl-bot-staging/google-cloud-security_center-v1/snippets/security_center/test_iam_permissions.rb +++ /dev/null @@ -1,47 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -# [START securitycenter_v1_generated_SecurityCenter_TestIamPermissions_sync] -require "google/cloud/security_center/v1" - -## -# Snippet for the test_iam_permissions call in the SecurityCenter service -# -# This snippet has been automatically generated and should be regarded as a code -# template only. It will require modifications to work: -# - It may require correct/in-range values for request initialization. -# - It may require specifying regional endpoints when creating the service -# client as shown in https://cloud.google.com/ruby/docs/reference. -# -# This is an auto-generated example demonstrating basic usage of -# Google::Cloud::SecurityCenter::V1::SecurityCenter::Client#test_iam_permissions. -# -def test_iam_permissions - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::SecurityCenter::V1::SecurityCenter::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Iam::V1::TestIamPermissionsRequest.new - - # Call the test_iam_permissions method. - result = client.test_iam_permissions request - - # The returned object is of type Google::Iam::V1::TestIamPermissionsResponse. - p result -end -# [END securitycenter_v1_generated_SecurityCenter_TestIamPermissions_sync] diff --git a/owl-bot-staging/google-cloud-security_center-v1/snippets/security_center/update_big_query_export.rb b/owl-bot-staging/google-cloud-security_center-v1/snippets/security_center/update_big_query_export.rb deleted file mode 100644 index 64a07908fd64..000000000000 --- a/owl-bot-staging/google-cloud-security_center-v1/snippets/security_center/update_big_query_export.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 securitycenter_v1_generated_SecurityCenter_UpdateBigQueryExport_sync] -require "google/cloud/security_center/v1" - -## -# Snippet for the update_big_query_export call in the SecurityCenter service -# -# This snippet has been automatically generated and should be regarded as a code -# template only. It will require modifications to work: -# - It may require correct/in-range values for request initialization. -# - It may require specifying regional endpoints when creating the service -# client as shown in https://cloud.google.com/ruby/docs/reference. -# -# This is an auto-generated example demonstrating basic usage of -# Google::Cloud::SecurityCenter::V1::SecurityCenter::Client#update_big_query_export. -# -def update_big_query_export - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::SecurityCenter::V1::SecurityCenter::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::SecurityCenter::V1::UpdateBigQueryExportRequest.new - - # Call the update_big_query_export method. - result = client.update_big_query_export request - - # The returned object is of type Google::Cloud::SecurityCenter::V1::BigQueryExport. - p result -end -# [END securitycenter_v1_generated_SecurityCenter_UpdateBigQueryExport_sync] diff --git a/owl-bot-staging/google-cloud-security_center-v1/snippets/security_center/update_event_threat_detection_custom_module.rb b/owl-bot-staging/google-cloud-security_center-v1/snippets/security_center/update_event_threat_detection_custom_module.rb deleted file mode 100644 index 20ba7f0b690c..000000000000 --- a/owl-bot-staging/google-cloud-security_center-v1/snippets/security_center/update_event_threat_detection_custom_module.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 securitycenter_v1_generated_SecurityCenter_UpdateEventThreatDetectionCustomModule_sync] -require "google/cloud/security_center/v1" - -## -# Snippet for the update_event_threat_detection_custom_module call in the SecurityCenter service -# -# This snippet has been automatically generated and should be regarded as a code -# template only. It will require modifications to work: -# - It may require correct/in-range values for request initialization. -# - It may require specifying regional endpoints when creating the service -# client as shown in https://cloud.google.com/ruby/docs/reference. -# -# This is an auto-generated example demonstrating basic usage of -# Google::Cloud::SecurityCenter::V1::SecurityCenter::Client#update_event_threat_detection_custom_module. -# -def update_event_threat_detection_custom_module - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::SecurityCenter::V1::SecurityCenter::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::SecurityCenter::V1::UpdateEventThreatDetectionCustomModuleRequest.new - - # Call the update_event_threat_detection_custom_module method. - result = client.update_event_threat_detection_custom_module request - - # The returned object is of type Google::Cloud::SecurityCenter::V1::EventThreatDetectionCustomModule. - p result -end -# [END securitycenter_v1_generated_SecurityCenter_UpdateEventThreatDetectionCustomModule_sync] diff --git a/owl-bot-staging/google-cloud-security_center-v1/snippets/security_center/update_external_system.rb b/owl-bot-staging/google-cloud-security_center-v1/snippets/security_center/update_external_system.rb deleted file mode 100644 index 4ec047a6fb39..000000000000 --- a/owl-bot-staging/google-cloud-security_center-v1/snippets/security_center/update_external_system.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 securitycenter_v1_generated_SecurityCenter_UpdateExternalSystem_sync] -require "google/cloud/security_center/v1" - -## -# Snippet for the update_external_system call in the SecurityCenter service -# -# This snippet has been automatically generated and should be regarded as a code -# template only. It will require modifications to work: -# - It may require correct/in-range values for request initialization. -# - It may require specifying regional endpoints when creating the service -# client as shown in https://cloud.google.com/ruby/docs/reference. -# -# This is an auto-generated example demonstrating basic usage of -# Google::Cloud::SecurityCenter::V1::SecurityCenter::Client#update_external_system. -# -def update_external_system - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::SecurityCenter::V1::SecurityCenter::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::SecurityCenter::V1::UpdateExternalSystemRequest.new - - # Call the update_external_system method. - result = client.update_external_system request - - # The returned object is of type Google::Cloud::SecurityCenter::V1::ExternalSystem. - p result -end -# [END securitycenter_v1_generated_SecurityCenter_UpdateExternalSystem_sync] diff --git a/owl-bot-staging/google-cloud-security_center-v1/snippets/security_center/update_finding.rb b/owl-bot-staging/google-cloud-security_center-v1/snippets/security_center/update_finding.rb deleted file mode 100644 index 39355b256e0d..000000000000 --- a/owl-bot-staging/google-cloud-security_center-v1/snippets/security_center/update_finding.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 securitycenter_v1_generated_SecurityCenter_UpdateFinding_sync] -require "google/cloud/security_center/v1" - -## -# Snippet for the update_finding call in the SecurityCenter service -# -# This snippet has been automatically generated and should be regarded as a code -# template only. It will require modifications to work: -# - It may require correct/in-range values for request initialization. -# - It may require specifying regional endpoints when creating the service -# client as shown in https://cloud.google.com/ruby/docs/reference. -# -# This is an auto-generated example demonstrating basic usage of -# Google::Cloud::SecurityCenter::V1::SecurityCenter::Client#update_finding. -# -def update_finding - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::SecurityCenter::V1::SecurityCenter::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::SecurityCenter::V1::UpdateFindingRequest.new - - # Call the update_finding method. - result = client.update_finding request - - # The returned object is of type Google::Cloud::SecurityCenter::V1::Finding. - p result -end -# [END securitycenter_v1_generated_SecurityCenter_UpdateFinding_sync] diff --git a/owl-bot-staging/google-cloud-security_center-v1/snippets/security_center/update_mute_config.rb b/owl-bot-staging/google-cloud-security_center-v1/snippets/security_center/update_mute_config.rb deleted file mode 100644 index aa233b884d74..000000000000 --- a/owl-bot-staging/google-cloud-security_center-v1/snippets/security_center/update_mute_config.rb +++ /dev/null @@ -1,47 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -# [START securitycenter_v1_generated_SecurityCenter_UpdateMuteConfig_sync] -require "google/cloud/security_center/v1" - -## -# Snippet for the update_mute_config call in the SecurityCenter service -# -# This snippet has been automatically generated and should be regarded as a code -# template only. It will require modifications to work: -# - It may require correct/in-range values for request initialization. -# - It may require specifying regional endpoints when creating the service -# client as shown in https://cloud.google.com/ruby/docs/reference. -# -# This is an auto-generated example demonstrating basic usage of -# Google::Cloud::SecurityCenter::V1::SecurityCenter::Client#update_mute_config. -# -def update_mute_config - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::SecurityCenter::V1::SecurityCenter::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::SecurityCenter::V1::UpdateMuteConfigRequest.new - - # Call the update_mute_config method. - result = client.update_mute_config request - - # The returned object is of type Google::Cloud::SecurityCenter::V1::MuteConfig. - p result -end -# [END securitycenter_v1_generated_SecurityCenter_UpdateMuteConfig_sync] diff --git a/owl-bot-staging/google-cloud-security_center-v1/snippets/security_center/update_notification_config.rb b/owl-bot-staging/google-cloud-security_center-v1/snippets/security_center/update_notification_config.rb deleted file mode 100644 index f976002b3515..000000000000 --- a/owl-bot-staging/google-cloud-security_center-v1/snippets/security_center/update_notification_config.rb +++ /dev/null @@ -1,47 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -# [START securitycenter_v1_generated_SecurityCenter_UpdateNotificationConfig_sync] -require "google/cloud/security_center/v1" - -## -# Snippet for the update_notification_config call in the SecurityCenter service -# -# This snippet has been automatically generated and should be regarded as a code -# template only. It will require modifications to work: -# - It may require correct/in-range values for request initialization. -# - It may require specifying regional endpoints when creating the service -# client as shown in https://cloud.google.com/ruby/docs/reference. -# -# This is an auto-generated example demonstrating basic usage of -# Google::Cloud::SecurityCenter::V1::SecurityCenter::Client#update_notification_config. -# -def update_notification_config - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::SecurityCenter::V1::SecurityCenter::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::SecurityCenter::V1::UpdateNotificationConfigRequest.new - - # Call the update_notification_config method. - result = client.update_notification_config request - - # The returned object is of type Google::Cloud::SecurityCenter::V1::NotificationConfig. - p result -end -# [END securitycenter_v1_generated_SecurityCenter_UpdateNotificationConfig_sync] diff --git a/owl-bot-staging/google-cloud-security_center-v1/snippets/security_center/update_organization_settings.rb b/owl-bot-staging/google-cloud-security_center-v1/snippets/security_center/update_organization_settings.rb deleted file mode 100644 index a4f402013e90..000000000000 --- a/owl-bot-staging/google-cloud-security_center-v1/snippets/security_center/update_organization_settings.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 securitycenter_v1_generated_SecurityCenter_UpdateOrganizationSettings_sync] -require "google/cloud/security_center/v1" - -## -# Snippet for the update_organization_settings call in the SecurityCenter service -# -# This snippet has been automatically generated and should be regarded as a code -# template only. It will require modifications to work: -# - It may require correct/in-range values for request initialization. -# - It may require specifying regional endpoints when creating the service -# client as shown in https://cloud.google.com/ruby/docs/reference. -# -# This is an auto-generated example demonstrating basic usage of -# Google::Cloud::SecurityCenter::V1::SecurityCenter::Client#update_organization_settings. -# -def update_organization_settings - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::SecurityCenter::V1::SecurityCenter::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::SecurityCenter::V1::UpdateOrganizationSettingsRequest.new - - # Call the update_organization_settings method. - result = client.update_organization_settings request - - # The returned object is of type Google::Cloud::SecurityCenter::V1::OrganizationSettings. - p result -end -# [END securitycenter_v1_generated_SecurityCenter_UpdateOrganizationSettings_sync] diff --git a/owl-bot-staging/google-cloud-security_center-v1/snippets/security_center/update_resource_value_config.rb b/owl-bot-staging/google-cloud-security_center-v1/snippets/security_center/update_resource_value_config.rb deleted file mode 100644 index 40a21d5efc16..000000000000 --- a/owl-bot-staging/google-cloud-security_center-v1/snippets/security_center/update_resource_value_config.rb +++ /dev/null @@ -1,47 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -# [START securitycenter_v1_generated_SecurityCenter_UpdateResourceValueConfig_sync] -require "google/cloud/security_center/v1" - -## -# Snippet for the update_resource_value_config call in the SecurityCenter service -# -# This snippet has been automatically generated and should be regarded as a code -# template only. It will require modifications to work: -# - It may require correct/in-range values for request initialization. -# - It may require specifying regional endpoints when creating the service -# client as shown in https://cloud.google.com/ruby/docs/reference. -# -# This is an auto-generated example demonstrating basic usage of -# Google::Cloud::SecurityCenter::V1::SecurityCenter::Client#update_resource_value_config. -# -def update_resource_value_config - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::SecurityCenter::V1::SecurityCenter::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::SecurityCenter::V1::UpdateResourceValueConfigRequest.new - - # Call the update_resource_value_config method. - result = client.update_resource_value_config request - - # The returned object is of type Google::Cloud::SecurityCenter::V1::ResourceValueConfig. - p result -end -# [END securitycenter_v1_generated_SecurityCenter_UpdateResourceValueConfig_sync] diff --git a/owl-bot-staging/google-cloud-security_center-v1/snippets/security_center/update_security_health_analytics_custom_module.rb b/owl-bot-staging/google-cloud-security_center-v1/snippets/security_center/update_security_health_analytics_custom_module.rb deleted file mode 100644 index 8e83edf227ea..000000000000 --- a/owl-bot-staging/google-cloud-security_center-v1/snippets/security_center/update_security_health_analytics_custom_module.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 securitycenter_v1_generated_SecurityCenter_UpdateSecurityHealthAnalyticsCustomModule_sync] -require "google/cloud/security_center/v1" - -## -# Snippet for the update_security_health_analytics_custom_module call in the SecurityCenter service -# -# This snippet has been automatically generated and should be regarded as a code -# template only. It will require modifications to work: -# - It may require correct/in-range values for request initialization. -# - It may require specifying regional endpoints when creating the service -# client as shown in https://cloud.google.com/ruby/docs/reference. -# -# This is an auto-generated example demonstrating basic usage of -# Google::Cloud::SecurityCenter::V1::SecurityCenter::Client#update_security_health_analytics_custom_module. -# -def update_security_health_analytics_custom_module - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::SecurityCenter::V1::SecurityCenter::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::SecurityCenter::V1::UpdateSecurityHealthAnalyticsCustomModuleRequest.new - - # Call the update_security_health_analytics_custom_module method. - result = client.update_security_health_analytics_custom_module request - - # The returned object is of type Google::Cloud::SecurityCenter::V1::SecurityHealthAnalyticsCustomModule. - p result -end -# [END securitycenter_v1_generated_SecurityCenter_UpdateSecurityHealthAnalyticsCustomModule_sync] diff --git a/owl-bot-staging/google-cloud-security_center-v1/snippets/security_center/update_security_marks.rb b/owl-bot-staging/google-cloud-security_center-v1/snippets/security_center/update_security_marks.rb deleted file mode 100644 index 04da82c1a94b..000000000000 --- a/owl-bot-staging/google-cloud-security_center-v1/snippets/security_center/update_security_marks.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 securitycenter_v1_generated_SecurityCenter_UpdateSecurityMarks_sync] -require "google/cloud/security_center/v1" - -## -# Snippet for the update_security_marks call in the SecurityCenter service -# -# This snippet has been automatically generated and should be regarded as a code -# template only. It will require modifications to work: -# - It may require correct/in-range values for request initialization. -# - It may require specifying regional endpoints when creating the service -# client as shown in https://cloud.google.com/ruby/docs/reference. -# -# This is an auto-generated example demonstrating basic usage of -# Google::Cloud::SecurityCenter::V1::SecurityCenter::Client#update_security_marks. -# -def update_security_marks - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::SecurityCenter::V1::SecurityCenter::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::SecurityCenter::V1::UpdateSecurityMarksRequest.new - - # Call the update_security_marks method. - result = client.update_security_marks request - - # The returned object is of type Google::Cloud::SecurityCenter::V1::SecurityMarks. - p result -end -# [END securitycenter_v1_generated_SecurityCenter_UpdateSecurityMarks_sync] diff --git a/owl-bot-staging/google-cloud-security_center-v1/snippets/security_center/update_source.rb b/owl-bot-staging/google-cloud-security_center-v1/snippets/security_center/update_source.rb deleted file mode 100644 index 6f0ba52cd6f1..000000000000 --- a/owl-bot-staging/google-cloud-security_center-v1/snippets/security_center/update_source.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 securitycenter_v1_generated_SecurityCenter_UpdateSource_sync] -require "google/cloud/security_center/v1" - -## -# Snippet for the update_source call in the SecurityCenter service -# -# This snippet has been automatically generated and should be regarded as a code -# template only. It will require modifications to work: -# - It may require correct/in-range values for request initialization. -# - It may require specifying regional endpoints when creating the service -# client as shown in https://cloud.google.com/ruby/docs/reference. -# -# This is an auto-generated example demonstrating basic usage of -# Google::Cloud::SecurityCenter::V1::SecurityCenter::Client#update_source. -# -def update_source - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::SecurityCenter::V1::SecurityCenter::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::SecurityCenter::V1::UpdateSourceRequest.new - - # Call the update_source method. - result = client.update_source request - - # The returned object is of type Google::Cloud::SecurityCenter::V1::Source. - p result -end -# [END securitycenter_v1_generated_SecurityCenter_UpdateSource_sync] diff --git a/owl-bot-staging/google-cloud-security_center-v1/snippets/security_center/validate_event_threat_detection_custom_module.rb b/owl-bot-staging/google-cloud-security_center-v1/snippets/security_center/validate_event_threat_detection_custom_module.rb deleted file mode 100644 index 31919bb29465..000000000000 --- a/owl-bot-staging/google-cloud-security_center-v1/snippets/security_center/validate_event_threat_detection_custom_module.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 securitycenter_v1_generated_SecurityCenter_ValidateEventThreatDetectionCustomModule_sync] -require "google/cloud/security_center/v1" - -## -# Snippet for the validate_event_threat_detection_custom_module call in the SecurityCenter service -# -# This snippet has been automatically generated and should be regarded as a code -# template only. It will require modifications to work: -# - It may require correct/in-range values for request initialization. -# - It may require specifying regional endpoints when creating the service -# client as shown in https://cloud.google.com/ruby/docs/reference. -# -# This is an auto-generated example demonstrating basic usage of -# Google::Cloud::SecurityCenter::V1::SecurityCenter::Client#validate_event_threat_detection_custom_module. -# -def validate_event_threat_detection_custom_module - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::SecurityCenter::V1::SecurityCenter::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::SecurityCenter::V1::ValidateEventThreatDetectionCustomModuleRequest.new - - # Call the validate_event_threat_detection_custom_module method. - result = client.validate_event_threat_detection_custom_module request - - # The returned object is of type Google::Cloud::SecurityCenter::V1::ValidateEventThreatDetectionCustomModuleResponse. - p result -end -# [END securitycenter_v1_generated_SecurityCenter_ValidateEventThreatDetectionCustomModule_sync] diff --git a/owl-bot-staging/google-cloud-security_center-v1/snippets/snippet_metadata_google.cloud.securitycenter.v1.json b/owl-bot-staging/google-cloud-security_center-v1/snippets/snippet_metadata_google.cloud.securitycenter.v1.json deleted file mode 100644 index 97ec18a5449f..000000000000 --- a/owl-bot-staging/google-cloud-security_center-v1/snippets/snippet_metadata_google.cloud.securitycenter.v1.json +++ /dev/null @@ -1,2535 +0,0 @@ -{ - "client_library": { - "name": "google-cloud-security_center-v1", - "version": "", - "language": "RUBY", - "apis": [ - { - "id": "google.cloud.securitycenter.v1", - "version": "v1" - } - ] - }, - "snippets": [ - { - "region_tag": "securitycenter_v1_generated_SecurityCenter_BulkMuteFindings_sync", - "title": "Snippet for the bulk_mute_findings call in the SecurityCenter service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::SecurityCenter::V1::SecurityCenter::Client#bulk_mute_findings.", - "file": "security_center/bulk_mute_findings.rb", - "language": "RUBY", - "client_method": { - "short_name": "bulk_mute_findings", - "full_name": "::Google::Cloud::SecurityCenter::V1::SecurityCenter::Client#bulk_mute_findings", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::SecurityCenter::V1::BulkMuteFindingsRequest", - "name": "request" - } - ], - "result_type": "::Google::Longrunning::Operation", - "client": { - "short_name": "SecurityCenter::Client", - "full_name": "::Google::Cloud::SecurityCenter::V1::SecurityCenter::Client" - }, - "method": { - "short_name": "BulkMuteFindings", - "full_name": "google.cloud.securitycenter.v1.SecurityCenter.BulkMuteFindings", - "service": { - "short_name": "SecurityCenter", - "full_name": "google.cloud.securitycenter.v1.SecurityCenter" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 53, - "type": "FULL" - } - ] - }, - { - "region_tag": "securitycenter_v1_generated_SecurityCenter_CreateSecurityHealthAnalyticsCustomModule_sync", - "title": "Snippet for the create_security_health_analytics_custom_module call in the SecurityCenter service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::SecurityCenter::V1::SecurityCenter::Client#create_security_health_analytics_custom_module.", - "file": "security_center/create_security_health_analytics_custom_module.rb", - "language": "RUBY", - "client_method": { - "short_name": "create_security_health_analytics_custom_module", - "full_name": "::Google::Cloud::SecurityCenter::V1::SecurityCenter::Client#create_security_health_analytics_custom_module", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::SecurityCenter::V1::CreateSecurityHealthAnalyticsCustomModuleRequest", - "name": "request" - } - ], - "result_type": "::Google::Cloud::SecurityCenter::V1::SecurityHealthAnalyticsCustomModule", - "client": { - "short_name": "SecurityCenter::Client", - "full_name": "::Google::Cloud::SecurityCenter::V1::SecurityCenter::Client" - }, - "method": { - "short_name": "CreateSecurityHealthAnalyticsCustomModule", - "full_name": "google.cloud.securitycenter.v1.SecurityCenter.CreateSecurityHealthAnalyticsCustomModule", - "service": { - "short_name": "SecurityCenter", - "full_name": "google.cloud.securitycenter.v1.SecurityCenter" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 46, - "type": "FULL" - } - ] - }, - { - "region_tag": "securitycenter_v1_generated_SecurityCenter_CreateSource_sync", - "title": "Snippet for the create_source call in the SecurityCenter service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::SecurityCenter::V1::SecurityCenter::Client#create_source.", - "file": "security_center/create_source.rb", - "language": "RUBY", - "client_method": { - "short_name": "create_source", - "full_name": "::Google::Cloud::SecurityCenter::V1::SecurityCenter::Client#create_source", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::SecurityCenter::V1::CreateSourceRequest", - "name": "request" - } - ], - "result_type": "::Google::Cloud::SecurityCenter::V1::Source", - "client": { - "short_name": "SecurityCenter::Client", - "full_name": "::Google::Cloud::SecurityCenter::V1::SecurityCenter::Client" - }, - "method": { - "short_name": "CreateSource", - "full_name": "google.cloud.securitycenter.v1.SecurityCenter.CreateSource", - "service": { - "short_name": "SecurityCenter", - "full_name": "google.cloud.securitycenter.v1.SecurityCenter" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 46, - "type": "FULL" - } - ] - }, - { - "region_tag": "securitycenter_v1_generated_SecurityCenter_CreateFinding_sync", - "title": "Snippet for the create_finding call in the SecurityCenter service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::SecurityCenter::V1::SecurityCenter::Client#create_finding.", - "file": "security_center/create_finding.rb", - "language": "RUBY", - "client_method": { - "short_name": "create_finding", - "full_name": "::Google::Cloud::SecurityCenter::V1::SecurityCenter::Client#create_finding", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::SecurityCenter::V1::CreateFindingRequest", - "name": "request" - } - ], - "result_type": "::Google::Cloud::SecurityCenter::V1::Finding", - "client": { - "short_name": "SecurityCenter::Client", - "full_name": "::Google::Cloud::SecurityCenter::V1::SecurityCenter::Client" - }, - "method": { - "short_name": "CreateFinding", - "full_name": "google.cloud.securitycenter.v1.SecurityCenter.CreateFinding", - "service": { - "short_name": "SecurityCenter", - "full_name": "google.cloud.securitycenter.v1.SecurityCenter" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 46, - "type": "FULL" - } - ] - }, - { - "region_tag": "securitycenter_v1_generated_SecurityCenter_CreateMuteConfig_sync", - "title": "Snippet for the create_mute_config call in the SecurityCenter service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::SecurityCenter::V1::SecurityCenter::Client#create_mute_config.", - "file": "security_center/create_mute_config.rb", - "language": "RUBY", - "client_method": { - "short_name": "create_mute_config", - "full_name": "::Google::Cloud::SecurityCenter::V1::SecurityCenter::Client#create_mute_config", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::SecurityCenter::V1::CreateMuteConfigRequest", - "name": "request" - } - ], - "result_type": "::Google::Cloud::SecurityCenter::V1::MuteConfig", - "client": { - "short_name": "SecurityCenter::Client", - "full_name": "::Google::Cloud::SecurityCenter::V1::SecurityCenter::Client" - }, - "method": { - "short_name": "CreateMuteConfig", - "full_name": "google.cloud.securitycenter.v1.SecurityCenter.CreateMuteConfig", - "service": { - "short_name": "SecurityCenter", - "full_name": "google.cloud.securitycenter.v1.SecurityCenter" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 46, - "type": "FULL" - } - ] - }, - { - "region_tag": "securitycenter_v1_generated_SecurityCenter_CreateNotificationConfig_sync", - "title": "Snippet for the create_notification_config call in the SecurityCenter service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::SecurityCenter::V1::SecurityCenter::Client#create_notification_config.", - "file": "security_center/create_notification_config.rb", - "language": "RUBY", - "client_method": { - "short_name": "create_notification_config", - "full_name": "::Google::Cloud::SecurityCenter::V1::SecurityCenter::Client#create_notification_config", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::SecurityCenter::V1::CreateNotificationConfigRequest", - "name": "request" - } - ], - "result_type": "::Google::Cloud::SecurityCenter::V1::NotificationConfig", - "client": { - "short_name": "SecurityCenter::Client", - "full_name": "::Google::Cloud::SecurityCenter::V1::SecurityCenter::Client" - }, - "method": { - "short_name": "CreateNotificationConfig", - "full_name": "google.cloud.securitycenter.v1.SecurityCenter.CreateNotificationConfig", - "service": { - "short_name": "SecurityCenter", - "full_name": "google.cloud.securitycenter.v1.SecurityCenter" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 46, - "type": "FULL" - } - ] - }, - { - "region_tag": "securitycenter_v1_generated_SecurityCenter_DeleteMuteConfig_sync", - "title": "Snippet for the delete_mute_config call in the SecurityCenter service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::SecurityCenter::V1::SecurityCenter::Client#delete_mute_config.", - "file": "security_center/delete_mute_config.rb", - "language": "RUBY", - "client_method": { - "short_name": "delete_mute_config", - "full_name": "::Google::Cloud::SecurityCenter::V1::SecurityCenter::Client#delete_mute_config", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::SecurityCenter::V1::DeleteMuteConfigRequest", - "name": "request" - } - ], - "result_type": "::Google::Protobuf::Empty", - "client": { - "short_name": "SecurityCenter::Client", - "full_name": "::Google::Cloud::SecurityCenter::V1::SecurityCenter::Client" - }, - "method": { - "short_name": "DeleteMuteConfig", - "full_name": "google.cloud.securitycenter.v1.SecurityCenter.DeleteMuteConfig", - "service": { - "short_name": "SecurityCenter", - "full_name": "google.cloud.securitycenter.v1.SecurityCenter" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 46, - "type": "FULL" - } - ] - }, - { - "region_tag": "securitycenter_v1_generated_SecurityCenter_DeleteNotificationConfig_sync", - "title": "Snippet for the delete_notification_config call in the SecurityCenter service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::SecurityCenter::V1::SecurityCenter::Client#delete_notification_config.", - "file": "security_center/delete_notification_config.rb", - "language": "RUBY", - "client_method": { - "short_name": "delete_notification_config", - "full_name": "::Google::Cloud::SecurityCenter::V1::SecurityCenter::Client#delete_notification_config", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::SecurityCenter::V1::DeleteNotificationConfigRequest", - "name": "request" - } - ], - "result_type": "::Google::Protobuf::Empty", - "client": { - "short_name": "SecurityCenter::Client", - "full_name": "::Google::Cloud::SecurityCenter::V1::SecurityCenter::Client" - }, - "method": { - "short_name": "DeleteNotificationConfig", - "full_name": "google.cloud.securitycenter.v1.SecurityCenter.DeleteNotificationConfig", - "service": { - "short_name": "SecurityCenter", - "full_name": "google.cloud.securitycenter.v1.SecurityCenter" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 46, - "type": "FULL" - } - ] - }, - { - "region_tag": "securitycenter_v1_generated_SecurityCenter_DeleteSecurityHealthAnalyticsCustomModule_sync", - "title": "Snippet for the delete_security_health_analytics_custom_module call in the SecurityCenter service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::SecurityCenter::V1::SecurityCenter::Client#delete_security_health_analytics_custom_module.", - "file": "security_center/delete_security_health_analytics_custom_module.rb", - "language": "RUBY", - "client_method": { - "short_name": "delete_security_health_analytics_custom_module", - "full_name": "::Google::Cloud::SecurityCenter::V1::SecurityCenter::Client#delete_security_health_analytics_custom_module", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::SecurityCenter::V1::DeleteSecurityHealthAnalyticsCustomModuleRequest", - "name": "request" - } - ], - "result_type": "::Google::Protobuf::Empty", - "client": { - "short_name": "SecurityCenter::Client", - "full_name": "::Google::Cloud::SecurityCenter::V1::SecurityCenter::Client" - }, - "method": { - "short_name": "DeleteSecurityHealthAnalyticsCustomModule", - "full_name": "google.cloud.securitycenter.v1.SecurityCenter.DeleteSecurityHealthAnalyticsCustomModule", - "service": { - "short_name": "SecurityCenter", - "full_name": "google.cloud.securitycenter.v1.SecurityCenter" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 46, - "type": "FULL" - } - ] - }, - { - "region_tag": "securitycenter_v1_generated_SecurityCenter_GetSimulation_sync", - "title": "Snippet for the get_simulation call in the SecurityCenter service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::SecurityCenter::V1::SecurityCenter::Client#get_simulation.", - "file": "security_center/get_simulation.rb", - "language": "RUBY", - "client_method": { - "short_name": "get_simulation", - "full_name": "::Google::Cloud::SecurityCenter::V1::SecurityCenter::Client#get_simulation", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::SecurityCenter::V1::GetSimulationRequest", - "name": "request" - } - ], - "result_type": "::Google::Cloud::SecurityCenter::V1::Simulation", - "client": { - "short_name": "SecurityCenter::Client", - "full_name": "::Google::Cloud::SecurityCenter::V1::SecurityCenter::Client" - }, - "method": { - "short_name": "GetSimulation", - "full_name": "google.cloud.securitycenter.v1.SecurityCenter.GetSimulation", - "service": { - "short_name": "SecurityCenter", - "full_name": "google.cloud.securitycenter.v1.SecurityCenter" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 46, - "type": "FULL" - } - ] - }, - { - "region_tag": "securitycenter_v1_generated_SecurityCenter_GetValuedResource_sync", - "title": "Snippet for the get_valued_resource call in the SecurityCenter service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::SecurityCenter::V1::SecurityCenter::Client#get_valued_resource.", - "file": "security_center/get_valued_resource.rb", - "language": "RUBY", - "client_method": { - "short_name": "get_valued_resource", - "full_name": "::Google::Cloud::SecurityCenter::V1::SecurityCenter::Client#get_valued_resource", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::SecurityCenter::V1::GetValuedResourceRequest", - "name": "request" - } - ], - "result_type": "::Google::Cloud::SecurityCenter::V1::ValuedResource", - "client": { - "short_name": "SecurityCenter::Client", - "full_name": "::Google::Cloud::SecurityCenter::V1::SecurityCenter::Client" - }, - "method": { - "short_name": "GetValuedResource", - "full_name": "google.cloud.securitycenter.v1.SecurityCenter.GetValuedResource", - "service": { - "short_name": "SecurityCenter", - "full_name": "google.cloud.securitycenter.v1.SecurityCenter" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 46, - "type": "FULL" - } - ] - }, - { - "region_tag": "securitycenter_v1_generated_SecurityCenter_GetBigQueryExport_sync", - "title": "Snippet for the get_big_query_export call in the SecurityCenter service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::SecurityCenter::V1::SecurityCenter::Client#get_big_query_export.", - "file": "security_center/get_big_query_export.rb", - "language": "RUBY", - "client_method": { - "short_name": "get_big_query_export", - "full_name": "::Google::Cloud::SecurityCenter::V1::SecurityCenter::Client#get_big_query_export", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::SecurityCenter::V1::GetBigQueryExportRequest", - "name": "request" - } - ], - "result_type": "::Google::Cloud::SecurityCenter::V1::BigQueryExport", - "client": { - "short_name": "SecurityCenter::Client", - "full_name": "::Google::Cloud::SecurityCenter::V1::SecurityCenter::Client" - }, - "method": { - "short_name": "GetBigQueryExport", - "full_name": "google.cloud.securitycenter.v1.SecurityCenter.GetBigQueryExport", - "service": { - "short_name": "SecurityCenter", - "full_name": "google.cloud.securitycenter.v1.SecurityCenter" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 46, - "type": "FULL" - } - ] - }, - { - "region_tag": "securitycenter_v1_generated_SecurityCenter_GetIamPolicy_sync", - "title": "Snippet for the get_iam_policy call in the SecurityCenter service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::SecurityCenter::V1::SecurityCenter::Client#get_iam_policy.", - "file": "security_center/get_iam_policy.rb", - "language": "RUBY", - "client_method": { - "short_name": "get_iam_policy", - "full_name": "::Google::Cloud::SecurityCenter::V1::SecurityCenter::Client#get_iam_policy", - "async": false, - "parameters": [ - { - "type": "::Google::Iam::V1::GetIamPolicyRequest", - "name": "request" - } - ], - "result_type": "::Google::Iam::V1::Policy", - "client": { - "short_name": "SecurityCenter::Client", - "full_name": "::Google::Cloud::SecurityCenter::V1::SecurityCenter::Client" - }, - "method": { - "short_name": "GetIamPolicy", - "full_name": "google.cloud.securitycenter.v1.SecurityCenter.GetIamPolicy", - "service": { - "short_name": "SecurityCenter", - "full_name": "google.cloud.securitycenter.v1.SecurityCenter" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 46, - "type": "FULL" - } - ] - }, - { - "region_tag": "securitycenter_v1_generated_SecurityCenter_GetMuteConfig_sync", - "title": "Snippet for the get_mute_config call in the SecurityCenter service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::SecurityCenter::V1::SecurityCenter::Client#get_mute_config.", - "file": "security_center/get_mute_config.rb", - "language": "RUBY", - "client_method": { - "short_name": "get_mute_config", - "full_name": "::Google::Cloud::SecurityCenter::V1::SecurityCenter::Client#get_mute_config", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::SecurityCenter::V1::GetMuteConfigRequest", - "name": "request" - } - ], - "result_type": "::Google::Cloud::SecurityCenter::V1::MuteConfig", - "client": { - "short_name": "SecurityCenter::Client", - "full_name": "::Google::Cloud::SecurityCenter::V1::SecurityCenter::Client" - }, - "method": { - "short_name": "GetMuteConfig", - "full_name": "google.cloud.securitycenter.v1.SecurityCenter.GetMuteConfig", - "service": { - "short_name": "SecurityCenter", - "full_name": "google.cloud.securitycenter.v1.SecurityCenter" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 46, - "type": "FULL" - } - ] - }, - { - "region_tag": "securitycenter_v1_generated_SecurityCenter_GetNotificationConfig_sync", - "title": "Snippet for the get_notification_config call in the SecurityCenter service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::SecurityCenter::V1::SecurityCenter::Client#get_notification_config.", - "file": "security_center/get_notification_config.rb", - "language": "RUBY", - "client_method": { - "short_name": "get_notification_config", - "full_name": "::Google::Cloud::SecurityCenter::V1::SecurityCenter::Client#get_notification_config", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::SecurityCenter::V1::GetNotificationConfigRequest", - "name": "request" - } - ], - "result_type": "::Google::Cloud::SecurityCenter::V1::NotificationConfig", - "client": { - "short_name": "SecurityCenter::Client", - "full_name": "::Google::Cloud::SecurityCenter::V1::SecurityCenter::Client" - }, - "method": { - "short_name": "GetNotificationConfig", - "full_name": "google.cloud.securitycenter.v1.SecurityCenter.GetNotificationConfig", - "service": { - "short_name": "SecurityCenter", - "full_name": "google.cloud.securitycenter.v1.SecurityCenter" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 46, - "type": "FULL" - } - ] - }, - { - "region_tag": "securitycenter_v1_generated_SecurityCenter_GetOrganizationSettings_sync", - "title": "Snippet for the get_organization_settings call in the SecurityCenter service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::SecurityCenter::V1::SecurityCenter::Client#get_organization_settings.", - "file": "security_center/get_organization_settings.rb", - "language": "RUBY", - "client_method": { - "short_name": "get_organization_settings", - "full_name": "::Google::Cloud::SecurityCenter::V1::SecurityCenter::Client#get_organization_settings", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::SecurityCenter::V1::GetOrganizationSettingsRequest", - "name": "request" - } - ], - "result_type": "::Google::Cloud::SecurityCenter::V1::OrganizationSettings", - "client": { - "short_name": "SecurityCenter::Client", - "full_name": "::Google::Cloud::SecurityCenter::V1::SecurityCenter::Client" - }, - "method": { - "short_name": "GetOrganizationSettings", - "full_name": "google.cloud.securitycenter.v1.SecurityCenter.GetOrganizationSettings", - "service": { - "short_name": "SecurityCenter", - "full_name": "google.cloud.securitycenter.v1.SecurityCenter" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 46, - "type": "FULL" - } - ] - }, - { - "region_tag": "securitycenter_v1_generated_SecurityCenter_GetEffectiveSecurityHealthAnalyticsCustomModule_sync", - "title": "Snippet for the get_effective_security_health_analytics_custom_module call in the SecurityCenter service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::SecurityCenter::V1::SecurityCenter::Client#get_effective_security_health_analytics_custom_module.", - "file": "security_center/get_effective_security_health_analytics_custom_module.rb", - "language": "RUBY", - "client_method": { - "short_name": "get_effective_security_health_analytics_custom_module", - "full_name": "::Google::Cloud::SecurityCenter::V1::SecurityCenter::Client#get_effective_security_health_analytics_custom_module", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::SecurityCenter::V1::GetEffectiveSecurityHealthAnalyticsCustomModuleRequest", - "name": "request" - } - ], - "result_type": "::Google::Cloud::SecurityCenter::V1::EffectiveSecurityHealthAnalyticsCustomModule", - "client": { - "short_name": "SecurityCenter::Client", - "full_name": "::Google::Cloud::SecurityCenter::V1::SecurityCenter::Client" - }, - "method": { - "short_name": "GetEffectiveSecurityHealthAnalyticsCustomModule", - "full_name": "google.cloud.securitycenter.v1.SecurityCenter.GetEffectiveSecurityHealthAnalyticsCustomModule", - "service": { - "short_name": "SecurityCenter", - "full_name": "google.cloud.securitycenter.v1.SecurityCenter" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 46, - "type": "FULL" - } - ] - }, - { - "region_tag": "securitycenter_v1_generated_SecurityCenter_GetSecurityHealthAnalyticsCustomModule_sync", - "title": "Snippet for the get_security_health_analytics_custom_module call in the SecurityCenter service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::SecurityCenter::V1::SecurityCenter::Client#get_security_health_analytics_custom_module.", - "file": "security_center/get_security_health_analytics_custom_module.rb", - "language": "RUBY", - "client_method": { - "short_name": "get_security_health_analytics_custom_module", - "full_name": "::Google::Cloud::SecurityCenter::V1::SecurityCenter::Client#get_security_health_analytics_custom_module", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::SecurityCenter::V1::GetSecurityHealthAnalyticsCustomModuleRequest", - "name": "request" - } - ], - "result_type": "::Google::Cloud::SecurityCenter::V1::SecurityHealthAnalyticsCustomModule", - "client": { - "short_name": "SecurityCenter::Client", - "full_name": "::Google::Cloud::SecurityCenter::V1::SecurityCenter::Client" - }, - "method": { - "short_name": "GetSecurityHealthAnalyticsCustomModule", - "full_name": "google.cloud.securitycenter.v1.SecurityCenter.GetSecurityHealthAnalyticsCustomModule", - "service": { - "short_name": "SecurityCenter", - "full_name": "google.cloud.securitycenter.v1.SecurityCenter" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 46, - "type": "FULL" - } - ] - }, - { - "region_tag": "securitycenter_v1_generated_SecurityCenter_GetSource_sync", - "title": "Snippet for the get_source call in the SecurityCenter service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::SecurityCenter::V1::SecurityCenter::Client#get_source.", - "file": "security_center/get_source.rb", - "language": "RUBY", - "client_method": { - "short_name": "get_source", - "full_name": "::Google::Cloud::SecurityCenter::V1::SecurityCenter::Client#get_source", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::SecurityCenter::V1::GetSourceRequest", - "name": "request" - } - ], - "result_type": "::Google::Cloud::SecurityCenter::V1::Source", - "client": { - "short_name": "SecurityCenter::Client", - "full_name": "::Google::Cloud::SecurityCenter::V1::SecurityCenter::Client" - }, - "method": { - "short_name": "GetSource", - "full_name": "google.cloud.securitycenter.v1.SecurityCenter.GetSource", - "service": { - "short_name": "SecurityCenter", - "full_name": "google.cloud.securitycenter.v1.SecurityCenter" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 46, - "type": "FULL" - } - ] - }, - { - "region_tag": "securitycenter_v1_generated_SecurityCenter_GroupAssets_sync", - "title": "Snippet for the group_assets call in the SecurityCenter service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::SecurityCenter::V1::SecurityCenter::Client#group_assets.", - "file": "security_center/group_assets.rb", - "language": "RUBY", - "client_method": { - "short_name": "group_assets", - "full_name": "::Google::Cloud::SecurityCenter::V1::SecurityCenter::Client#group_assets", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::SecurityCenter::V1::GroupAssetsRequest", - "name": "request" - } - ], - "result_type": "::Google::Cloud::SecurityCenter::V1::GroupAssetsResponse", - "client": { - "short_name": "SecurityCenter::Client", - "full_name": "::Google::Cloud::SecurityCenter::V1::SecurityCenter::Client" - }, - "method": { - "short_name": "GroupAssets", - "full_name": "google.cloud.securitycenter.v1.SecurityCenter.GroupAssets", - "service": { - "short_name": "SecurityCenter", - "full_name": "google.cloud.securitycenter.v1.SecurityCenter" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 50, - "type": "FULL" - } - ] - }, - { - "region_tag": "securitycenter_v1_generated_SecurityCenter_GroupFindings_sync", - "title": "Snippet for the group_findings call in the SecurityCenter service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::SecurityCenter::V1::SecurityCenter::Client#group_findings.", - "file": "security_center/group_findings.rb", - "language": "RUBY", - "client_method": { - "short_name": "group_findings", - "full_name": "::Google::Cloud::SecurityCenter::V1::SecurityCenter::Client#group_findings", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::SecurityCenter::V1::GroupFindingsRequest", - "name": "request" - } - ], - "result_type": "::Google::Cloud::SecurityCenter::V1::GroupFindingsResponse", - "client": { - "short_name": "SecurityCenter::Client", - "full_name": "::Google::Cloud::SecurityCenter::V1::SecurityCenter::Client" - }, - "method": { - "short_name": "GroupFindings", - "full_name": "google.cloud.securitycenter.v1.SecurityCenter.GroupFindings", - "service": { - "short_name": "SecurityCenter", - "full_name": "google.cloud.securitycenter.v1.SecurityCenter" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 50, - "type": "FULL" - } - ] - }, - { - "region_tag": "securitycenter_v1_generated_SecurityCenter_ListAssets_sync", - "title": "Snippet for the list_assets call in the SecurityCenter service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::SecurityCenter::V1::SecurityCenter::Client#list_assets.", - "file": "security_center/list_assets.rb", - "language": "RUBY", - "client_method": { - "short_name": "list_assets", - "full_name": "::Google::Cloud::SecurityCenter::V1::SecurityCenter::Client#list_assets", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::SecurityCenter::V1::ListAssetsRequest", - "name": "request" - } - ], - "result_type": "::Google::Cloud::SecurityCenter::V1::ListAssetsResponse", - "client": { - "short_name": "SecurityCenter::Client", - "full_name": "::Google::Cloud::SecurityCenter::V1::SecurityCenter::Client" - }, - "method": { - "short_name": "ListAssets", - "full_name": "google.cloud.securitycenter.v1.SecurityCenter.ListAssets", - "service": { - "short_name": "SecurityCenter", - "full_name": "google.cloud.securitycenter.v1.SecurityCenter" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 50, - "type": "FULL" - } - ] - }, - { - "region_tag": "securitycenter_v1_generated_SecurityCenter_ListDescendantSecurityHealthAnalyticsCustomModules_sync", - "title": "Snippet for the list_descendant_security_health_analytics_custom_modules call in the SecurityCenter service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::SecurityCenter::V1::SecurityCenter::Client#list_descendant_security_health_analytics_custom_modules.", - "file": "security_center/list_descendant_security_health_analytics_custom_modules.rb", - "language": "RUBY", - "client_method": { - "short_name": "list_descendant_security_health_analytics_custom_modules", - "full_name": "::Google::Cloud::SecurityCenter::V1::SecurityCenter::Client#list_descendant_security_health_analytics_custom_modules", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::SecurityCenter::V1::ListDescendantSecurityHealthAnalyticsCustomModulesRequest", - "name": "request" - } - ], - "result_type": "::Google::Cloud::SecurityCenter::V1::ListDescendantSecurityHealthAnalyticsCustomModulesResponse", - "client": { - "short_name": "SecurityCenter::Client", - "full_name": "::Google::Cloud::SecurityCenter::V1::SecurityCenter::Client" - }, - "method": { - "short_name": "ListDescendantSecurityHealthAnalyticsCustomModules", - "full_name": "google.cloud.securitycenter.v1.SecurityCenter.ListDescendantSecurityHealthAnalyticsCustomModules", - "service": { - "short_name": "SecurityCenter", - "full_name": "google.cloud.securitycenter.v1.SecurityCenter" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 50, - "type": "FULL" - } - ] - }, - { - "region_tag": "securitycenter_v1_generated_SecurityCenter_ListFindings_sync", - "title": "Snippet for the list_findings call in the SecurityCenter service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::SecurityCenter::V1::SecurityCenter::Client#list_findings.", - "file": "security_center/list_findings.rb", - "language": "RUBY", - "client_method": { - "short_name": "list_findings", - "full_name": "::Google::Cloud::SecurityCenter::V1::SecurityCenter::Client#list_findings", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::SecurityCenter::V1::ListFindingsRequest", - "name": "request" - } - ], - "result_type": "::Google::Cloud::SecurityCenter::V1::ListFindingsResponse", - "client": { - "short_name": "SecurityCenter::Client", - "full_name": "::Google::Cloud::SecurityCenter::V1::SecurityCenter::Client" - }, - "method": { - "short_name": "ListFindings", - "full_name": "google.cloud.securitycenter.v1.SecurityCenter.ListFindings", - "service": { - "short_name": "SecurityCenter", - "full_name": "google.cloud.securitycenter.v1.SecurityCenter" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 50, - "type": "FULL" - } - ] - }, - { - "region_tag": "securitycenter_v1_generated_SecurityCenter_ListMuteConfigs_sync", - "title": "Snippet for the list_mute_configs call in the SecurityCenter service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::SecurityCenter::V1::SecurityCenter::Client#list_mute_configs.", - "file": "security_center/list_mute_configs.rb", - "language": "RUBY", - "client_method": { - "short_name": "list_mute_configs", - "full_name": "::Google::Cloud::SecurityCenter::V1::SecurityCenter::Client#list_mute_configs", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::SecurityCenter::V1::ListMuteConfigsRequest", - "name": "request" - } - ], - "result_type": "::Google::Cloud::SecurityCenter::V1::ListMuteConfigsResponse", - "client": { - "short_name": "SecurityCenter::Client", - "full_name": "::Google::Cloud::SecurityCenter::V1::SecurityCenter::Client" - }, - "method": { - "short_name": "ListMuteConfigs", - "full_name": "google.cloud.securitycenter.v1.SecurityCenter.ListMuteConfigs", - "service": { - "short_name": "SecurityCenter", - "full_name": "google.cloud.securitycenter.v1.SecurityCenter" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 50, - "type": "FULL" - } - ] - }, - { - "region_tag": "securitycenter_v1_generated_SecurityCenter_ListNotificationConfigs_sync", - "title": "Snippet for the list_notification_configs call in the SecurityCenter service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::SecurityCenter::V1::SecurityCenter::Client#list_notification_configs.", - "file": "security_center/list_notification_configs.rb", - "language": "RUBY", - "client_method": { - "short_name": "list_notification_configs", - "full_name": "::Google::Cloud::SecurityCenter::V1::SecurityCenter::Client#list_notification_configs", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::SecurityCenter::V1::ListNotificationConfigsRequest", - "name": "request" - } - ], - "result_type": "::Google::Cloud::SecurityCenter::V1::ListNotificationConfigsResponse", - "client": { - "short_name": "SecurityCenter::Client", - "full_name": "::Google::Cloud::SecurityCenter::V1::SecurityCenter::Client" - }, - "method": { - "short_name": "ListNotificationConfigs", - "full_name": "google.cloud.securitycenter.v1.SecurityCenter.ListNotificationConfigs", - "service": { - "short_name": "SecurityCenter", - "full_name": "google.cloud.securitycenter.v1.SecurityCenter" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 50, - "type": "FULL" - } - ] - }, - { - "region_tag": "securitycenter_v1_generated_SecurityCenter_ListEffectiveSecurityHealthAnalyticsCustomModules_sync", - "title": "Snippet for the list_effective_security_health_analytics_custom_modules call in the SecurityCenter service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::SecurityCenter::V1::SecurityCenter::Client#list_effective_security_health_analytics_custom_modules.", - "file": "security_center/list_effective_security_health_analytics_custom_modules.rb", - "language": "RUBY", - "client_method": { - "short_name": "list_effective_security_health_analytics_custom_modules", - "full_name": "::Google::Cloud::SecurityCenter::V1::SecurityCenter::Client#list_effective_security_health_analytics_custom_modules", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::SecurityCenter::V1::ListEffectiveSecurityHealthAnalyticsCustomModulesRequest", - "name": "request" - } - ], - "result_type": "::Google::Cloud::SecurityCenter::V1::ListEffectiveSecurityHealthAnalyticsCustomModulesResponse", - "client": { - "short_name": "SecurityCenter::Client", - "full_name": "::Google::Cloud::SecurityCenter::V1::SecurityCenter::Client" - }, - "method": { - "short_name": "ListEffectiveSecurityHealthAnalyticsCustomModules", - "full_name": "google.cloud.securitycenter.v1.SecurityCenter.ListEffectiveSecurityHealthAnalyticsCustomModules", - "service": { - "short_name": "SecurityCenter", - "full_name": "google.cloud.securitycenter.v1.SecurityCenter" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 50, - "type": "FULL" - } - ] - }, - { - "region_tag": "securitycenter_v1_generated_SecurityCenter_ListSecurityHealthAnalyticsCustomModules_sync", - "title": "Snippet for the list_security_health_analytics_custom_modules call in the SecurityCenter service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::SecurityCenter::V1::SecurityCenter::Client#list_security_health_analytics_custom_modules.", - "file": "security_center/list_security_health_analytics_custom_modules.rb", - "language": "RUBY", - "client_method": { - "short_name": "list_security_health_analytics_custom_modules", - "full_name": "::Google::Cloud::SecurityCenter::V1::SecurityCenter::Client#list_security_health_analytics_custom_modules", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::SecurityCenter::V1::ListSecurityHealthAnalyticsCustomModulesRequest", - "name": "request" - } - ], - "result_type": "::Google::Cloud::SecurityCenter::V1::ListSecurityHealthAnalyticsCustomModulesResponse", - "client": { - "short_name": "SecurityCenter::Client", - "full_name": "::Google::Cloud::SecurityCenter::V1::SecurityCenter::Client" - }, - "method": { - "short_name": "ListSecurityHealthAnalyticsCustomModules", - "full_name": "google.cloud.securitycenter.v1.SecurityCenter.ListSecurityHealthAnalyticsCustomModules", - "service": { - "short_name": "SecurityCenter", - "full_name": "google.cloud.securitycenter.v1.SecurityCenter" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 50, - "type": "FULL" - } - ] - }, - { - "region_tag": "securitycenter_v1_generated_SecurityCenter_ListSources_sync", - "title": "Snippet for the list_sources call in the SecurityCenter service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::SecurityCenter::V1::SecurityCenter::Client#list_sources.", - "file": "security_center/list_sources.rb", - "language": "RUBY", - "client_method": { - "short_name": "list_sources", - "full_name": "::Google::Cloud::SecurityCenter::V1::SecurityCenter::Client#list_sources", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::SecurityCenter::V1::ListSourcesRequest", - "name": "request" - } - ], - "result_type": "::Google::Cloud::SecurityCenter::V1::ListSourcesResponse", - "client": { - "short_name": "SecurityCenter::Client", - "full_name": "::Google::Cloud::SecurityCenter::V1::SecurityCenter::Client" - }, - "method": { - "short_name": "ListSources", - "full_name": "google.cloud.securitycenter.v1.SecurityCenter.ListSources", - "service": { - "short_name": "SecurityCenter", - "full_name": "google.cloud.securitycenter.v1.SecurityCenter" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 50, - "type": "FULL" - } - ] - }, - { - "region_tag": "securitycenter_v1_generated_SecurityCenter_RunAssetDiscovery_sync", - "title": "Snippet for the run_asset_discovery call in the SecurityCenter service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::SecurityCenter::V1::SecurityCenter::Client#run_asset_discovery.", - "file": "security_center/run_asset_discovery.rb", - "language": "RUBY", - "client_method": { - "short_name": "run_asset_discovery", - "full_name": "::Google::Cloud::SecurityCenter::V1::SecurityCenter::Client#run_asset_discovery", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::SecurityCenter::V1::RunAssetDiscoveryRequest", - "name": "request" - } - ], - "result_type": "::Google::Longrunning::Operation", - "client": { - "short_name": "SecurityCenter::Client", - "full_name": "::Google::Cloud::SecurityCenter::V1::SecurityCenter::Client" - }, - "method": { - "short_name": "RunAssetDiscovery", - "full_name": "google.cloud.securitycenter.v1.SecurityCenter.RunAssetDiscovery", - "service": { - "short_name": "SecurityCenter", - "full_name": "google.cloud.securitycenter.v1.SecurityCenter" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 53, - "type": "FULL" - } - ] - }, - { - "region_tag": "securitycenter_v1_generated_SecurityCenter_SetFindingState_sync", - "title": "Snippet for the set_finding_state call in the SecurityCenter service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::SecurityCenter::V1::SecurityCenter::Client#set_finding_state.", - "file": "security_center/set_finding_state.rb", - "language": "RUBY", - "client_method": { - "short_name": "set_finding_state", - "full_name": "::Google::Cloud::SecurityCenter::V1::SecurityCenter::Client#set_finding_state", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::SecurityCenter::V1::SetFindingStateRequest", - "name": "request" - } - ], - "result_type": "::Google::Cloud::SecurityCenter::V1::Finding", - "client": { - "short_name": "SecurityCenter::Client", - "full_name": "::Google::Cloud::SecurityCenter::V1::SecurityCenter::Client" - }, - "method": { - "short_name": "SetFindingState", - "full_name": "google.cloud.securitycenter.v1.SecurityCenter.SetFindingState", - "service": { - "short_name": "SecurityCenter", - "full_name": "google.cloud.securitycenter.v1.SecurityCenter" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 46, - "type": "FULL" - } - ] - }, - { - "region_tag": "securitycenter_v1_generated_SecurityCenter_SetMute_sync", - "title": "Snippet for the set_mute call in the SecurityCenter service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::SecurityCenter::V1::SecurityCenter::Client#set_mute.", - "file": "security_center/set_mute.rb", - "language": "RUBY", - "client_method": { - "short_name": "set_mute", - "full_name": "::Google::Cloud::SecurityCenter::V1::SecurityCenter::Client#set_mute", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::SecurityCenter::V1::SetMuteRequest", - "name": "request" - } - ], - "result_type": "::Google::Cloud::SecurityCenter::V1::Finding", - "client": { - "short_name": "SecurityCenter::Client", - "full_name": "::Google::Cloud::SecurityCenter::V1::SecurityCenter::Client" - }, - "method": { - "short_name": "SetMute", - "full_name": "google.cloud.securitycenter.v1.SecurityCenter.SetMute", - "service": { - "short_name": "SecurityCenter", - "full_name": "google.cloud.securitycenter.v1.SecurityCenter" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 46, - "type": "FULL" - } - ] - }, - { - "region_tag": "securitycenter_v1_generated_SecurityCenter_SetIamPolicy_sync", - "title": "Snippet for the set_iam_policy call in the SecurityCenter service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::SecurityCenter::V1::SecurityCenter::Client#set_iam_policy.", - "file": "security_center/set_iam_policy.rb", - "language": "RUBY", - "client_method": { - "short_name": "set_iam_policy", - "full_name": "::Google::Cloud::SecurityCenter::V1::SecurityCenter::Client#set_iam_policy", - "async": false, - "parameters": [ - { - "type": "::Google::Iam::V1::SetIamPolicyRequest", - "name": "request" - } - ], - "result_type": "::Google::Iam::V1::Policy", - "client": { - "short_name": "SecurityCenter::Client", - "full_name": "::Google::Cloud::SecurityCenter::V1::SecurityCenter::Client" - }, - "method": { - "short_name": "SetIamPolicy", - "full_name": "google.cloud.securitycenter.v1.SecurityCenter.SetIamPolicy", - "service": { - "short_name": "SecurityCenter", - "full_name": "google.cloud.securitycenter.v1.SecurityCenter" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 46, - "type": "FULL" - } - ] - }, - { - "region_tag": "securitycenter_v1_generated_SecurityCenter_TestIamPermissions_sync", - "title": "Snippet for the test_iam_permissions call in the SecurityCenter service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::SecurityCenter::V1::SecurityCenter::Client#test_iam_permissions.", - "file": "security_center/test_iam_permissions.rb", - "language": "RUBY", - "client_method": { - "short_name": "test_iam_permissions", - "full_name": "::Google::Cloud::SecurityCenter::V1::SecurityCenter::Client#test_iam_permissions", - "async": false, - "parameters": [ - { - "type": "::Google::Iam::V1::TestIamPermissionsRequest", - "name": "request" - } - ], - "result_type": "::Google::Iam::V1::TestIamPermissionsResponse", - "client": { - "short_name": "SecurityCenter::Client", - "full_name": "::Google::Cloud::SecurityCenter::V1::SecurityCenter::Client" - }, - "method": { - "short_name": "TestIamPermissions", - "full_name": "google.cloud.securitycenter.v1.SecurityCenter.TestIamPermissions", - "service": { - "short_name": "SecurityCenter", - "full_name": "google.cloud.securitycenter.v1.SecurityCenter" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 46, - "type": "FULL" - } - ] - }, - { - "region_tag": "securitycenter_v1_generated_SecurityCenter_SimulateSecurityHealthAnalyticsCustomModule_sync", - "title": "Snippet for the simulate_security_health_analytics_custom_module call in the SecurityCenter service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::SecurityCenter::V1::SecurityCenter::Client#simulate_security_health_analytics_custom_module.", - "file": "security_center/simulate_security_health_analytics_custom_module.rb", - "language": "RUBY", - "client_method": { - "short_name": "simulate_security_health_analytics_custom_module", - "full_name": "::Google::Cloud::SecurityCenter::V1::SecurityCenter::Client#simulate_security_health_analytics_custom_module", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::SecurityCenter::V1::SimulateSecurityHealthAnalyticsCustomModuleRequest", - "name": "request" - } - ], - "result_type": "::Google::Cloud::SecurityCenter::V1::SimulateSecurityHealthAnalyticsCustomModuleResponse", - "client": { - "short_name": "SecurityCenter::Client", - "full_name": "::Google::Cloud::SecurityCenter::V1::SecurityCenter::Client" - }, - "method": { - "short_name": "SimulateSecurityHealthAnalyticsCustomModule", - "full_name": "google.cloud.securitycenter.v1.SecurityCenter.SimulateSecurityHealthAnalyticsCustomModule", - "service": { - "short_name": "SecurityCenter", - "full_name": "google.cloud.securitycenter.v1.SecurityCenter" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 46, - "type": "FULL" - } - ] - }, - { - "region_tag": "securitycenter_v1_generated_SecurityCenter_UpdateExternalSystem_sync", - "title": "Snippet for the update_external_system call in the SecurityCenter service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::SecurityCenter::V1::SecurityCenter::Client#update_external_system.", - "file": "security_center/update_external_system.rb", - "language": "RUBY", - "client_method": { - "short_name": "update_external_system", - "full_name": "::Google::Cloud::SecurityCenter::V1::SecurityCenter::Client#update_external_system", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::SecurityCenter::V1::UpdateExternalSystemRequest", - "name": "request" - } - ], - "result_type": "::Google::Cloud::SecurityCenter::V1::ExternalSystem", - "client": { - "short_name": "SecurityCenter::Client", - "full_name": "::Google::Cloud::SecurityCenter::V1::SecurityCenter::Client" - }, - "method": { - "short_name": "UpdateExternalSystem", - "full_name": "google.cloud.securitycenter.v1.SecurityCenter.UpdateExternalSystem", - "service": { - "short_name": "SecurityCenter", - "full_name": "google.cloud.securitycenter.v1.SecurityCenter" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 46, - "type": "FULL" - } - ] - }, - { - "region_tag": "securitycenter_v1_generated_SecurityCenter_UpdateFinding_sync", - "title": "Snippet for the update_finding call in the SecurityCenter service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::SecurityCenter::V1::SecurityCenter::Client#update_finding.", - "file": "security_center/update_finding.rb", - "language": "RUBY", - "client_method": { - "short_name": "update_finding", - "full_name": "::Google::Cloud::SecurityCenter::V1::SecurityCenter::Client#update_finding", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::SecurityCenter::V1::UpdateFindingRequest", - "name": "request" - } - ], - "result_type": "::Google::Cloud::SecurityCenter::V1::Finding", - "client": { - "short_name": "SecurityCenter::Client", - "full_name": "::Google::Cloud::SecurityCenter::V1::SecurityCenter::Client" - }, - "method": { - "short_name": "UpdateFinding", - "full_name": "google.cloud.securitycenter.v1.SecurityCenter.UpdateFinding", - "service": { - "short_name": "SecurityCenter", - "full_name": "google.cloud.securitycenter.v1.SecurityCenter" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 46, - "type": "FULL" - } - ] - }, - { - "region_tag": "securitycenter_v1_generated_SecurityCenter_UpdateMuteConfig_sync", - "title": "Snippet for the update_mute_config call in the SecurityCenter service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::SecurityCenter::V1::SecurityCenter::Client#update_mute_config.", - "file": "security_center/update_mute_config.rb", - "language": "RUBY", - "client_method": { - "short_name": "update_mute_config", - "full_name": "::Google::Cloud::SecurityCenter::V1::SecurityCenter::Client#update_mute_config", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::SecurityCenter::V1::UpdateMuteConfigRequest", - "name": "request" - } - ], - "result_type": "::Google::Cloud::SecurityCenter::V1::MuteConfig", - "client": { - "short_name": "SecurityCenter::Client", - "full_name": "::Google::Cloud::SecurityCenter::V1::SecurityCenter::Client" - }, - "method": { - "short_name": "UpdateMuteConfig", - "full_name": "google.cloud.securitycenter.v1.SecurityCenter.UpdateMuteConfig", - "service": { - "short_name": "SecurityCenter", - "full_name": "google.cloud.securitycenter.v1.SecurityCenter" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 46, - "type": "FULL" - } - ] - }, - { - "region_tag": "securitycenter_v1_generated_SecurityCenter_UpdateNotificationConfig_sync", - "title": "Snippet for the update_notification_config call in the SecurityCenter service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::SecurityCenter::V1::SecurityCenter::Client#update_notification_config.", - "file": "security_center/update_notification_config.rb", - "language": "RUBY", - "client_method": { - "short_name": "update_notification_config", - "full_name": "::Google::Cloud::SecurityCenter::V1::SecurityCenter::Client#update_notification_config", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::SecurityCenter::V1::UpdateNotificationConfigRequest", - "name": "request" - } - ], - "result_type": "::Google::Cloud::SecurityCenter::V1::NotificationConfig", - "client": { - "short_name": "SecurityCenter::Client", - "full_name": "::Google::Cloud::SecurityCenter::V1::SecurityCenter::Client" - }, - "method": { - "short_name": "UpdateNotificationConfig", - "full_name": "google.cloud.securitycenter.v1.SecurityCenter.UpdateNotificationConfig", - "service": { - "short_name": "SecurityCenter", - "full_name": "google.cloud.securitycenter.v1.SecurityCenter" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 46, - "type": "FULL" - } - ] - }, - { - "region_tag": "securitycenter_v1_generated_SecurityCenter_UpdateOrganizationSettings_sync", - "title": "Snippet for the update_organization_settings call in the SecurityCenter service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::SecurityCenter::V1::SecurityCenter::Client#update_organization_settings.", - "file": "security_center/update_organization_settings.rb", - "language": "RUBY", - "client_method": { - "short_name": "update_organization_settings", - "full_name": "::Google::Cloud::SecurityCenter::V1::SecurityCenter::Client#update_organization_settings", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::SecurityCenter::V1::UpdateOrganizationSettingsRequest", - "name": "request" - } - ], - "result_type": "::Google::Cloud::SecurityCenter::V1::OrganizationSettings", - "client": { - "short_name": "SecurityCenter::Client", - "full_name": "::Google::Cloud::SecurityCenter::V1::SecurityCenter::Client" - }, - "method": { - "short_name": "UpdateOrganizationSettings", - "full_name": "google.cloud.securitycenter.v1.SecurityCenter.UpdateOrganizationSettings", - "service": { - "short_name": "SecurityCenter", - "full_name": "google.cloud.securitycenter.v1.SecurityCenter" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 46, - "type": "FULL" - } - ] - }, - { - "region_tag": "securitycenter_v1_generated_SecurityCenter_UpdateSecurityHealthAnalyticsCustomModule_sync", - "title": "Snippet for the update_security_health_analytics_custom_module call in the SecurityCenter service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::SecurityCenter::V1::SecurityCenter::Client#update_security_health_analytics_custom_module.", - "file": "security_center/update_security_health_analytics_custom_module.rb", - "language": "RUBY", - "client_method": { - "short_name": "update_security_health_analytics_custom_module", - "full_name": "::Google::Cloud::SecurityCenter::V1::SecurityCenter::Client#update_security_health_analytics_custom_module", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::SecurityCenter::V1::UpdateSecurityHealthAnalyticsCustomModuleRequest", - "name": "request" - } - ], - "result_type": "::Google::Cloud::SecurityCenter::V1::SecurityHealthAnalyticsCustomModule", - "client": { - "short_name": "SecurityCenter::Client", - "full_name": "::Google::Cloud::SecurityCenter::V1::SecurityCenter::Client" - }, - "method": { - "short_name": "UpdateSecurityHealthAnalyticsCustomModule", - "full_name": "google.cloud.securitycenter.v1.SecurityCenter.UpdateSecurityHealthAnalyticsCustomModule", - "service": { - "short_name": "SecurityCenter", - "full_name": "google.cloud.securitycenter.v1.SecurityCenter" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 46, - "type": "FULL" - } - ] - }, - { - "region_tag": "securitycenter_v1_generated_SecurityCenter_UpdateSource_sync", - "title": "Snippet for the update_source call in the SecurityCenter service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::SecurityCenter::V1::SecurityCenter::Client#update_source.", - "file": "security_center/update_source.rb", - "language": "RUBY", - "client_method": { - "short_name": "update_source", - "full_name": "::Google::Cloud::SecurityCenter::V1::SecurityCenter::Client#update_source", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::SecurityCenter::V1::UpdateSourceRequest", - "name": "request" - } - ], - "result_type": "::Google::Cloud::SecurityCenter::V1::Source", - "client": { - "short_name": "SecurityCenter::Client", - "full_name": "::Google::Cloud::SecurityCenter::V1::SecurityCenter::Client" - }, - "method": { - "short_name": "UpdateSource", - "full_name": "google.cloud.securitycenter.v1.SecurityCenter.UpdateSource", - "service": { - "short_name": "SecurityCenter", - "full_name": "google.cloud.securitycenter.v1.SecurityCenter" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 46, - "type": "FULL" - } - ] - }, - { - "region_tag": "securitycenter_v1_generated_SecurityCenter_UpdateSecurityMarks_sync", - "title": "Snippet for the update_security_marks call in the SecurityCenter service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::SecurityCenter::V1::SecurityCenter::Client#update_security_marks.", - "file": "security_center/update_security_marks.rb", - "language": "RUBY", - "client_method": { - "short_name": "update_security_marks", - "full_name": "::Google::Cloud::SecurityCenter::V1::SecurityCenter::Client#update_security_marks", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::SecurityCenter::V1::UpdateSecurityMarksRequest", - "name": "request" - } - ], - "result_type": "::Google::Cloud::SecurityCenter::V1::SecurityMarks", - "client": { - "short_name": "SecurityCenter::Client", - "full_name": "::Google::Cloud::SecurityCenter::V1::SecurityCenter::Client" - }, - "method": { - "short_name": "UpdateSecurityMarks", - "full_name": "google.cloud.securitycenter.v1.SecurityCenter.UpdateSecurityMarks", - "service": { - "short_name": "SecurityCenter", - "full_name": "google.cloud.securitycenter.v1.SecurityCenter" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 46, - "type": "FULL" - } - ] - }, - { - "region_tag": "securitycenter_v1_generated_SecurityCenter_CreateBigQueryExport_sync", - "title": "Snippet for the create_big_query_export call in the SecurityCenter service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::SecurityCenter::V1::SecurityCenter::Client#create_big_query_export.", - "file": "security_center/create_big_query_export.rb", - "language": "RUBY", - "client_method": { - "short_name": "create_big_query_export", - "full_name": "::Google::Cloud::SecurityCenter::V1::SecurityCenter::Client#create_big_query_export", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::SecurityCenter::V1::CreateBigQueryExportRequest", - "name": "request" - } - ], - "result_type": "::Google::Cloud::SecurityCenter::V1::BigQueryExport", - "client": { - "short_name": "SecurityCenter::Client", - "full_name": "::Google::Cloud::SecurityCenter::V1::SecurityCenter::Client" - }, - "method": { - "short_name": "CreateBigQueryExport", - "full_name": "google.cloud.securitycenter.v1.SecurityCenter.CreateBigQueryExport", - "service": { - "short_name": "SecurityCenter", - "full_name": "google.cloud.securitycenter.v1.SecurityCenter" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 46, - "type": "FULL" - } - ] - }, - { - "region_tag": "securitycenter_v1_generated_SecurityCenter_DeleteBigQueryExport_sync", - "title": "Snippet for the delete_big_query_export call in the SecurityCenter service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::SecurityCenter::V1::SecurityCenter::Client#delete_big_query_export.", - "file": "security_center/delete_big_query_export.rb", - "language": "RUBY", - "client_method": { - "short_name": "delete_big_query_export", - "full_name": "::Google::Cloud::SecurityCenter::V1::SecurityCenter::Client#delete_big_query_export", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::SecurityCenter::V1::DeleteBigQueryExportRequest", - "name": "request" - } - ], - "result_type": "::Google::Protobuf::Empty", - "client": { - "short_name": "SecurityCenter::Client", - "full_name": "::Google::Cloud::SecurityCenter::V1::SecurityCenter::Client" - }, - "method": { - "short_name": "DeleteBigQueryExport", - "full_name": "google.cloud.securitycenter.v1.SecurityCenter.DeleteBigQueryExport", - "service": { - "short_name": "SecurityCenter", - "full_name": "google.cloud.securitycenter.v1.SecurityCenter" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 46, - "type": "FULL" - } - ] - }, - { - "region_tag": "securitycenter_v1_generated_SecurityCenter_UpdateBigQueryExport_sync", - "title": "Snippet for the update_big_query_export call in the SecurityCenter service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::SecurityCenter::V1::SecurityCenter::Client#update_big_query_export.", - "file": "security_center/update_big_query_export.rb", - "language": "RUBY", - "client_method": { - "short_name": "update_big_query_export", - "full_name": "::Google::Cloud::SecurityCenter::V1::SecurityCenter::Client#update_big_query_export", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::SecurityCenter::V1::UpdateBigQueryExportRequest", - "name": "request" - } - ], - "result_type": "::Google::Cloud::SecurityCenter::V1::BigQueryExport", - "client": { - "short_name": "SecurityCenter::Client", - "full_name": "::Google::Cloud::SecurityCenter::V1::SecurityCenter::Client" - }, - "method": { - "short_name": "UpdateBigQueryExport", - "full_name": "google.cloud.securitycenter.v1.SecurityCenter.UpdateBigQueryExport", - "service": { - "short_name": "SecurityCenter", - "full_name": "google.cloud.securitycenter.v1.SecurityCenter" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 46, - "type": "FULL" - } - ] - }, - { - "region_tag": "securitycenter_v1_generated_SecurityCenter_ListBigQueryExports_sync", - "title": "Snippet for the list_big_query_exports call in the SecurityCenter service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::SecurityCenter::V1::SecurityCenter::Client#list_big_query_exports.", - "file": "security_center/list_big_query_exports.rb", - "language": "RUBY", - "client_method": { - "short_name": "list_big_query_exports", - "full_name": "::Google::Cloud::SecurityCenter::V1::SecurityCenter::Client#list_big_query_exports", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::SecurityCenter::V1::ListBigQueryExportsRequest", - "name": "request" - } - ], - "result_type": "::Google::Cloud::SecurityCenter::V1::ListBigQueryExportsResponse", - "client": { - "short_name": "SecurityCenter::Client", - "full_name": "::Google::Cloud::SecurityCenter::V1::SecurityCenter::Client" - }, - "method": { - "short_name": "ListBigQueryExports", - "full_name": "google.cloud.securitycenter.v1.SecurityCenter.ListBigQueryExports", - "service": { - "short_name": "SecurityCenter", - "full_name": "google.cloud.securitycenter.v1.SecurityCenter" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 50, - "type": "FULL" - } - ] - }, - { - "region_tag": "securitycenter_v1_generated_SecurityCenter_CreateEventThreatDetectionCustomModule_sync", - "title": "Snippet for the create_event_threat_detection_custom_module call in the SecurityCenter service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::SecurityCenter::V1::SecurityCenter::Client#create_event_threat_detection_custom_module.", - "file": "security_center/create_event_threat_detection_custom_module.rb", - "language": "RUBY", - "client_method": { - "short_name": "create_event_threat_detection_custom_module", - "full_name": "::Google::Cloud::SecurityCenter::V1::SecurityCenter::Client#create_event_threat_detection_custom_module", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::SecurityCenter::V1::CreateEventThreatDetectionCustomModuleRequest", - "name": "request" - } - ], - "result_type": "::Google::Cloud::SecurityCenter::V1::EventThreatDetectionCustomModule", - "client": { - "short_name": "SecurityCenter::Client", - "full_name": "::Google::Cloud::SecurityCenter::V1::SecurityCenter::Client" - }, - "method": { - "short_name": "CreateEventThreatDetectionCustomModule", - "full_name": "google.cloud.securitycenter.v1.SecurityCenter.CreateEventThreatDetectionCustomModule", - "service": { - "short_name": "SecurityCenter", - "full_name": "google.cloud.securitycenter.v1.SecurityCenter" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 46, - "type": "FULL" - } - ] - }, - { - "region_tag": "securitycenter_v1_generated_SecurityCenter_DeleteEventThreatDetectionCustomModule_sync", - "title": "Snippet for the delete_event_threat_detection_custom_module call in the SecurityCenter service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::SecurityCenter::V1::SecurityCenter::Client#delete_event_threat_detection_custom_module.", - "file": "security_center/delete_event_threat_detection_custom_module.rb", - "language": "RUBY", - "client_method": { - "short_name": "delete_event_threat_detection_custom_module", - "full_name": "::Google::Cloud::SecurityCenter::V1::SecurityCenter::Client#delete_event_threat_detection_custom_module", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::SecurityCenter::V1::DeleteEventThreatDetectionCustomModuleRequest", - "name": "request" - } - ], - "result_type": "::Google::Protobuf::Empty", - "client": { - "short_name": "SecurityCenter::Client", - "full_name": "::Google::Cloud::SecurityCenter::V1::SecurityCenter::Client" - }, - "method": { - "short_name": "DeleteEventThreatDetectionCustomModule", - "full_name": "google.cloud.securitycenter.v1.SecurityCenter.DeleteEventThreatDetectionCustomModule", - "service": { - "short_name": "SecurityCenter", - "full_name": "google.cloud.securitycenter.v1.SecurityCenter" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 46, - "type": "FULL" - } - ] - }, - { - "region_tag": "securitycenter_v1_generated_SecurityCenter_GetEventThreatDetectionCustomModule_sync", - "title": "Snippet for the get_event_threat_detection_custom_module call in the SecurityCenter service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::SecurityCenter::V1::SecurityCenter::Client#get_event_threat_detection_custom_module.", - "file": "security_center/get_event_threat_detection_custom_module.rb", - "language": "RUBY", - "client_method": { - "short_name": "get_event_threat_detection_custom_module", - "full_name": "::Google::Cloud::SecurityCenter::V1::SecurityCenter::Client#get_event_threat_detection_custom_module", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::SecurityCenter::V1::GetEventThreatDetectionCustomModuleRequest", - "name": "request" - } - ], - "result_type": "::Google::Cloud::SecurityCenter::V1::EventThreatDetectionCustomModule", - "client": { - "short_name": "SecurityCenter::Client", - "full_name": "::Google::Cloud::SecurityCenter::V1::SecurityCenter::Client" - }, - "method": { - "short_name": "GetEventThreatDetectionCustomModule", - "full_name": "google.cloud.securitycenter.v1.SecurityCenter.GetEventThreatDetectionCustomModule", - "service": { - "short_name": "SecurityCenter", - "full_name": "google.cloud.securitycenter.v1.SecurityCenter" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 46, - "type": "FULL" - } - ] - }, - { - "region_tag": "securitycenter_v1_generated_SecurityCenter_ListDescendantEventThreatDetectionCustomModules_sync", - "title": "Snippet for the list_descendant_event_threat_detection_custom_modules call in the SecurityCenter service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::SecurityCenter::V1::SecurityCenter::Client#list_descendant_event_threat_detection_custom_modules.", - "file": "security_center/list_descendant_event_threat_detection_custom_modules.rb", - "language": "RUBY", - "client_method": { - "short_name": "list_descendant_event_threat_detection_custom_modules", - "full_name": "::Google::Cloud::SecurityCenter::V1::SecurityCenter::Client#list_descendant_event_threat_detection_custom_modules", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::SecurityCenter::V1::ListDescendantEventThreatDetectionCustomModulesRequest", - "name": "request" - } - ], - "result_type": "::Google::Cloud::SecurityCenter::V1::ListDescendantEventThreatDetectionCustomModulesResponse", - "client": { - "short_name": "SecurityCenter::Client", - "full_name": "::Google::Cloud::SecurityCenter::V1::SecurityCenter::Client" - }, - "method": { - "short_name": "ListDescendantEventThreatDetectionCustomModules", - "full_name": "google.cloud.securitycenter.v1.SecurityCenter.ListDescendantEventThreatDetectionCustomModules", - "service": { - "short_name": "SecurityCenter", - "full_name": "google.cloud.securitycenter.v1.SecurityCenter" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 50, - "type": "FULL" - } - ] - }, - { - "region_tag": "securitycenter_v1_generated_SecurityCenter_ListEventThreatDetectionCustomModules_sync", - "title": "Snippet for the list_event_threat_detection_custom_modules call in the SecurityCenter service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::SecurityCenter::V1::SecurityCenter::Client#list_event_threat_detection_custom_modules.", - "file": "security_center/list_event_threat_detection_custom_modules.rb", - "language": "RUBY", - "client_method": { - "short_name": "list_event_threat_detection_custom_modules", - "full_name": "::Google::Cloud::SecurityCenter::V1::SecurityCenter::Client#list_event_threat_detection_custom_modules", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::SecurityCenter::V1::ListEventThreatDetectionCustomModulesRequest", - "name": "request" - } - ], - "result_type": "::Google::Cloud::SecurityCenter::V1::ListEventThreatDetectionCustomModulesResponse", - "client": { - "short_name": "SecurityCenter::Client", - "full_name": "::Google::Cloud::SecurityCenter::V1::SecurityCenter::Client" - }, - "method": { - "short_name": "ListEventThreatDetectionCustomModules", - "full_name": "google.cloud.securitycenter.v1.SecurityCenter.ListEventThreatDetectionCustomModules", - "service": { - "short_name": "SecurityCenter", - "full_name": "google.cloud.securitycenter.v1.SecurityCenter" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 50, - "type": "FULL" - } - ] - }, - { - "region_tag": "securitycenter_v1_generated_SecurityCenter_UpdateEventThreatDetectionCustomModule_sync", - "title": "Snippet for the update_event_threat_detection_custom_module call in the SecurityCenter service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::SecurityCenter::V1::SecurityCenter::Client#update_event_threat_detection_custom_module.", - "file": "security_center/update_event_threat_detection_custom_module.rb", - "language": "RUBY", - "client_method": { - "short_name": "update_event_threat_detection_custom_module", - "full_name": "::Google::Cloud::SecurityCenter::V1::SecurityCenter::Client#update_event_threat_detection_custom_module", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::SecurityCenter::V1::UpdateEventThreatDetectionCustomModuleRequest", - "name": "request" - } - ], - "result_type": "::Google::Cloud::SecurityCenter::V1::EventThreatDetectionCustomModule", - "client": { - "short_name": "SecurityCenter::Client", - "full_name": "::Google::Cloud::SecurityCenter::V1::SecurityCenter::Client" - }, - "method": { - "short_name": "UpdateEventThreatDetectionCustomModule", - "full_name": "google.cloud.securitycenter.v1.SecurityCenter.UpdateEventThreatDetectionCustomModule", - "service": { - "short_name": "SecurityCenter", - "full_name": "google.cloud.securitycenter.v1.SecurityCenter" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 46, - "type": "FULL" - } - ] - }, - { - "region_tag": "securitycenter_v1_generated_SecurityCenter_ValidateEventThreatDetectionCustomModule_sync", - "title": "Snippet for the validate_event_threat_detection_custom_module call in the SecurityCenter service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::SecurityCenter::V1::SecurityCenter::Client#validate_event_threat_detection_custom_module.", - "file": "security_center/validate_event_threat_detection_custom_module.rb", - "language": "RUBY", - "client_method": { - "short_name": "validate_event_threat_detection_custom_module", - "full_name": "::Google::Cloud::SecurityCenter::V1::SecurityCenter::Client#validate_event_threat_detection_custom_module", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::SecurityCenter::V1::ValidateEventThreatDetectionCustomModuleRequest", - "name": "request" - } - ], - "result_type": "::Google::Cloud::SecurityCenter::V1::ValidateEventThreatDetectionCustomModuleResponse", - "client": { - "short_name": "SecurityCenter::Client", - "full_name": "::Google::Cloud::SecurityCenter::V1::SecurityCenter::Client" - }, - "method": { - "short_name": "ValidateEventThreatDetectionCustomModule", - "full_name": "google.cloud.securitycenter.v1.SecurityCenter.ValidateEventThreatDetectionCustomModule", - "service": { - "short_name": "SecurityCenter", - "full_name": "google.cloud.securitycenter.v1.SecurityCenter" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 46, - "type": "FULL" - } - ] - }, - { - "region_tag": "securitycenter_v1_generated_SecurityCenter_GetEffectiveEventThreatDetectionCustomModule_sync", - "title": "Snippet for the get_effective_event_threat_detection_custom_module call in the SecurityCenter service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::SecurityCenter::V1::SecurityCenter::Client#get_effective_event_threat_detection_custom_module.", - "file": "security_center/get_effective_event_threat_detection_custom_module.rb", - "language": "RUBY", - "client_method": { - "short_name": "get_effective_event_threat_detection_custom_module", - "full_name": "::Google::Cloud::SecurityCenter::V1::SecurityCenter::Client#get_effective_event_threat_detection_custom_module", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::SecurityCenter::V1::GetEffectiveEventThreatDetectionCustomModuleRequest", - "name": "request" - } - ], - "result_type": "::Google::Cloud::SecurityCenter::V1::EffectiveEventThreatDetectionCustomModule", - "client": { - "short_name": "SecurityCenter::Client", - "full_name": "::Google::Cloud::SecurityCenter::V1::SecurityCenter::Client" - }, - "method": { - "short_name": "GetEffectiveEventThreatDetectionCustomModule", - "full_name": "google.cloud.securitycenter.v1.SecurityCenter.GetEffectiveEventThreatDetectionCustomModule", - "service": { - "short_name": "SecurityCenter", - "full_name": "google.cloud.securitycenter.v1.SecurityCenter" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 46, - "type": "FULL" - } - ] - }, - { - "region_tag": "securitycenter_v1_generated_SecurityCenter_ListEffectiveEventThreatDetectionCustomModules_sync", - "title": "Snippet for the list_effective_event_threat_detection_custom_modules call in the SecurityCenter service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::SecurityCenter::V1::SecurityCenter::Client#list_effective_event_threat_detection_custom_modules.", - "file": "security_center/list_effective_event_threat_detection_custom_modules.rb", - "language": "RUBY", - "client_method": { - "short_name": "list_effective_event_threat_detection_custom_modules", - "full_name": "::Google::Cloud::SecurityCenter::V1::SecurityCenter::Client#list_effective_event_threat_detection_custom_modules", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::SecurityCenter::V1::ListEffectiveEventThreatDetectionCustomModulesRequest", - "name": "request" - } - ], - "result_type": "::Google::Cloud::SecurityCenter::V1::ListEffectiveEventThreatDetectionCustomModulesResponse", - "client": { - "short_name": "SecurityCenter::Client", - "full_name": "::Google::Cloud::SecurityCenter::V1::SecurityCenter::Client" - }, - "method": { - "short_name": "ListEffectiveEventThreatDetectionCustomModules", - "full_name": "google.cloud.securitycenter.v1.SecurityCenter.ListEffectiveEventThreatDetectionCustomModules", - "service": { - "short_name": "SecurityCenter", - "full_name": "google.cloud.securitycenter.v1.SecurityCenter" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 50, - "type": "FULL" - } - ] - }, - { - "region_tag": "securitycenter_v1_generated_SecurityCenter_BatchCreateResourceValueConfigs_sync", - "title": "Snippet for the batch_create_resource_value_configs call in the SecurityCenter service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::SecurityCenter::V1::SecurityCenter::Client#batch_create_resource_value_configs.", - "file": "security_center/batch_create_resource_value_configs.rb", - "language": "RUBY", - "client_method": { - "short_name": "batch_create_resource_value_configs", - "full_name": "::Google::Cloud::SecurityCenter::V1::SecurityCenter::Client#batch_create_resource_value_configs", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::SecurityCenter::V1::BatchCreateResourceValueConfigsRequest", - "name": "request" - } - ], - "result_type": "::Google::Cloud::SecurityCenter::V1::BatchCreateResourceValueConfigsResponse", - "client": { - "short_name": "SecurityCenter::Client", - "full_name": "::Google::Cloud::SecurityCenter::V1::SecurityCenter::Client" - }, - "method": { - "short_name": "BatchCreateResourceValueConfigs", - "full_name": "google.cloud.securitycenter.v1.SecurityCenter.BatchCreateResourceValueConfigs", - "service": { - "short_name": "SecurityCenter", - "full_name": "google.cloud.securitycenter.v1.SecurityCenter" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 46, - "type": "FULL" - } - ] - }, - { - "region_tag": "securitycenter_v1_generated_SecurityCenter_DeleteResourceValueConfig_sync", - "title": "Snippet for the delete_resource_value_config call in the SecurityCenter service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::SecurityCenter::V1::SecurityCenter::Client#delete_resource_value_config.", - "file": "security_center/delete_resource_value_config.rb", - "language": "RUBY", - "client_method": { - "short_name": "delete_resource_value_config", - "full_name": "::Google::Cloud::SecurityCenter::V1::SecurityCenter::Client#delete_resource_value_config", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::SecurityCenter::V1::DeleteResourceValueConfigRequest", - "name": "request" - } - ], - "result_type": "::Google::Protobuf::Empty", - "client": { - "short_name": "SecurityCenter::Client", - "full_name": "::Google::Cloud::SecurityCenter::V1::SecurityCenter::Client" - }, - "method": { - "short_name": "DeleteResourceValueConfig", - "full_name": "google.cloud.securitycenter.v1.SecurityCenter.DeleteResourceValueConfig", - "service": { - "short_name": "SecurityCenter", - "full_name": "google.cloud.securitycenter.v1.SecurityCenter" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 46, - "type": "FULL" - } - ] - }, - { - "region_tag": "securitycenter_v1_generated_SecurityCenter_GetResourceValueConfig_sync", - "title": "Snippet for the get_resource_value_config call in the SecurityCenter service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::SecurityCenter::V1::SecurityCenter::Client#get_resource_value_config.", - "file": "security_center/get_resource_value_config.rb", - "language": "RUBY", - "client_method": { - "short_name": "get_resource_value_config", - "full_name": "::Google::Cloud::SecurityCenter::V1::SecurityCenter::Client#get_resource_value_config", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::SecurityCenter::V1::GetResourceValueConfigRequest", - "name": "request" - } - ], - "result_type": "::Google::Cloud::SecurityCenter::V1::ResourceValueConfig", - "client": { - "short_name": "SecurityCenter::Client", - "full_name": "::Google::Cloud::SecurityCenter::V1::SecurityCenter::Client" - }, - "method": { - "short_name": "GetResourceValueConfig", - "full_name": "google.cloud.securitycenter.v1.SecurityCenter.GetResourceValueConfig", - "service": { - "short_name": "SecurityCenter", - "full_name": "google.cloud.securitycenter.v1.SecurityCenter" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 46, - "type": "FULL" - } - ] - }, - { - "region_tag": "securitycenter_v1_generated_SecurityCenter_ListResourceValueConfigs_sync", - "title": "Snippet for the list_resource_value_configs call in the SecurityCenter service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::SecurityCenter::V1::SecurityCenter::Client#list_resource_value_configs.", - "file": "security_center/list_resource_value_configs.rb", - "language": "RUBY", - "client_method": { - "short_name": "list_resource_value_configs", - "full_name": "::Google::Cloud::SecurityCenter::V1::SecurityCenter::Client#list_resource_value_configs", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::SecurityCenter::V1::ListResourceValueConfigsRequest", - "name": "request" - } - ], - "result_type": "::Google::Cloud::SecurityCenter::V1::ListResourceValueConfigsResponse", - "client": { - "short_name": "SecurityCenter::Client", - "full_name": "::Google::Cloud::SecurityCenter::V1::SecurityCenter::Client" - }, - "method": { - "short_name": "ListResourceValueConfigs", - "full_name": "google.cloud.securitycenter.v1.SecurityCenter.ListResourceValueConfigs", - "service": { - "short_name": "SecurityCenter", - "full_name": "google.cloud.securitycenter.v1.SecurityCenter" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 50, - "type": "FULL" - } - ] - }, - { - "region_tag": "securitycenter_v1_generated_SecurityCenter_UpdateResourceValueConfig_sync", - "title": "Snippet for the update_resource_value_config call in the SecurityCenter service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::SecurityCenter::V1::SecurityCenter::Client#update_resource_value_config.", - "file": "security_center/update_resource_value_config.rb", - "language": "RUBY", - "client_method": { - "short_name": "update_resource_value_config", - "full_name": "::Google::Cloud::SecurityCenter::V1::SecurityCenter::Client#update_resource_value_config", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::SecurityCenter::V1::UpdateResourceValueConfigRequest", - "name": "request" - } - ], - "result_type": "::Google::Cloud::SecurityCenter::V1::ResourceValueConfig", - "client": { - "short_name": "SecurityCenter::Client", - "full_name": "::Google::Cloud::SecurityCenter::V1::SecurityCenter::Client" - }, - "method": { - "short_name": "UpdateResourceValueConfig", - "full_name": "google.cloud.securitycenter.v1.SecurityCenter.UpdateResourceValueConfig", - "service": { - "short_name": "SecurityCenter", - "full_name": "google.cloud.securitycenter.v1.SecurityCenter" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 46, - "type": "FULL" - } - ] - }, - { - "region_tag": "securitycenter_v1_generated_SecurityCenter_ListValuedResources_sync", - "title": "Snippet for the list_valued_resources call in the SecurityCenter service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::SecurityCenter::V1::SecurityCenter::Client#list_valued_resources.", - "file": "security_center/list_valued_resources.rb", - "language": "RUBY", - "client_method": { - "short_name": "list_valued_resources", - "full_name": "::Google::Cloud::SecurityCenter::V1::SecurityCenter::Client#list_valued_resources", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::SecurityCenter::V1::ListValuedResourcesRequest", - "name": "request" - } - ], - "result_type": "::Google::Cloud::SecurityCenter::V1::ListValuedResourcesResponse", - "client": { - "short_name": "SecurityCenter::Client", - "full_name": "::Google::Cloud::SecurityCenter::V1::SecurityCenter::Client" - }, - "method": { - "short_name": "ListValuedResources", - "full_name": "google.cloud.securitycenter.v1.SecurityCenter.ListValuedResources", - "service": { - "short_name": "SecurityCenter", - "full_name": "google.cloud.securitycenter.v1.SecurityCenter" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 50, - "type": "FULL" - } - ] - }, - { - "region_tag": "securitycenter_v1_generated_SecurityCenter_ListAttackPaths_sync", - "title": "Snippet for the list_attack_paths call in the SecurityCenter service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::SecurityCenter::V1::SecurityCenter::Client#list_attack_paths.", - "file": "security_center/list_attack_paths.rb", - "language": "RUBY", - "client_method": { - "short_name": "list_attack_paths", - "full_name": "::Google::Cloud::SecurityCenter::V1::SecurityCenter::Client#list_attack_paths", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::SecurityCenter::V1::ListAttackPathsRequest", - "name": "request" - } - ], - "result_type": "::Google::Cloud::SecurityCenter::V1::ListAttackPathsResponse", - "client": { - "short_name": "SecurityCenter::Client", - "full_name": "::Google::Cloud::SecurityCenter::V1::SecurityCenter::Client" - }, - "method": { - "short_name": "ListAttackPaths", - "full_name": "google.cloud.securitycenter.v1.SecurityCenter.ListAttackPaths", - "service": { - "short_name": "SecurityCenter", - "full_name": "google.cloud.securitycenter.v1.SecurityCenter" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 50, - "type": "FULL" - } - ] - } - ] -} \ No newline at end of file diff --git a/owl-bot-staging/google-cloud-security_center-v1/test/google/cloud/security_center/v1/security_center_operations_test.rb b/owl-bot-staging/google-cloud-security_center-v1/test/google/cloud/security_center/v1/security_center_operations_test.rb deleted file mode 100644 index c3c87a7a15cc..000000000000 --- a/owl-bot-staging/google-cloud-security_center-v1/test/google/cloud/security_center/v1/security_center_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/cloud/securitycenter/v1/securitycenter_service_pb" -require "google/cloud/securitycenter/v1/securitycenter_service_services_pb" -require "google/cloud/security_center/v1/security_center" - -class ::Google::Cloud::SecurityCenter::V1::SecurityCenter::OperationsTest < Minitest::Test - class ClientStub - attr_accessor :call_rpc_count, :requests - - def initialize response, operation, &block - @response = response - @operation = operation - @block = block - @call_rpc_count = 0 - @requests = [] - end - - def call_rpc *args, **kwargs - @call_rpc_count += 1 - - @requests << @block&.call(*args, **kwargs) - - catch :response do - yield @response, @operation if block_given? - @response - end - end - - def endpoint - "endpoint.example.com" - end - - def universe_domain - "example.com" - end - - def stub_logger - nil - end - - def logger - nil - end - end - - def test_list_operations - # Create GRPC objects. - grpc_response = ::Google::Longrunning::ListOperationsResponse.new - grpc_operation = GRPC::ActiveCall::Operation.new nil - grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - grpc_options = {} - - # Create request parameters for a unary method. - name = "hello world" - filter = "hello world" - page_size = 42 - page_token = "hello world" - return_partial_success = true - - list_operations_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :list_operations, name - assert_kind_of ::Google::Longrunning::ListOperationsRequest, request - assert_equal "hello world", request["name"] - assert_equal "hello world", request["filter"] - assert_equal 42, request["page_size"] - assert_equal "hello world", request["page_token"] - assert_equal true, request["return_partial_success"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, list_operations_client_stub do - # Create client - client = ::Google::Cloud::SecurityCenter::V1::SecurityCenter::Operations.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.list_operations({ name: name, filter: filter, page_size: page_size, page_token: page_token, return_partial_success: return_partial_success }) do |response, operation| - assert_kind_of Gapic::PagedEnumerable, response - assert_equal grpc_response, response.response - assert_equal grpc_operation, operation - end - - # Use named arguments - client.list_operations name: name, filter: filter, page_size: page_size, page_token: page_token, return_partial_success: return_partial_success do |response, operation| - assert_kind_of Gapic::PagedEnumerable, response - assert_equal grpc_response, response.response - assert_equal grpc_operation, operation - end - - # Use protobuf object - client.list_operations ::Google::Longrunning::ListOperationsRequest.new(name: name, filter: filter, page_size: page_size, page_token: page_token, return_partial_success: return_partial_success) do |response, operation| - assert_kind_of Gapic::PagedEnumerable, response - assert_equal grpc_response, response.response - assert_equal grpc_operation, operation - end - - # Use hash object with options - client.list_operations({ name: name, filter: filter, page_size: page_size, page_token: page_token, return_partial_success: return_partial_success }, grpc_options) do |response, operation| - assert_kind_of Gapic::PagedEnumerable, response - assert_equal grpc_response, response.response - assert_equal grpc_operation, operation - end - - # Use protobuf object with options - client.list_operations(::Google::Longrunning::ListOperationsRequest.new(name: name, filter: filter, page_size: page_size, page_token: page_token, return_partial_success: return_partial_success), grpc_options) do |response, operation| - assert_kind_of Gapic::PagedEnumerable, response - assert_equal grpc_response, response.response - assert_equal grpc_operation, operation - end - - # Verify method calls - assert_equal 5, list_operations_client_stub.call_rpc_count - end - end - - def test_get_operation - # Create GRPC objects. - grpc_response = ::Google::Longrunning::Operation.new - grpc_operation = GRPC::ActiveCall::Operation.new nil - grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - grpc_options = {} - - # Create request parameters for a unary method. - name = "hello world" - - get_operation_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :get_operation, name - assert_kind_of ::Google::Longrunning::GetOperationRequest, request - assert_equal "hello world", request["name"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, get_operation_client_stub do - # Create client - client = ::Google::Cloud::SecurityCenter::V1::SecurityCenter::Operations.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.get_operation({ name: name }) do |response, operation| - assert_kind_of Gapic::Operation, response - assert_equal grpc_response, response.grpc_op - assert_equal grpc_operation, operation - end - - # Use named arguments - client.get_operation name: name do |response, operation| - assert_kind_of Gapic::Operation, response - assert_equal grpc_response, response.grpc_op - assert_equal grpc_operation, operation - end - - # Use protobuf object - client.get_operation ::Google::Longrunning::GetOperationRequest.new(name: name) do |response, operation| - assert_kind_of Gapic::Operation, response - assert_equal grpc_response, response.grpc_op - assert_equal grpc_operation, operation - end - - # Use hash object with options - client.get_operation({ name: name }, grpc_options) do |response, operation| - assert_kind_of Gapic::Operation, response - assert_equal grpc_response, response.grpc_op - assert_equal grpc_operation, operation - end - - # Use protobuf object with options - client.get_operation(::Google::Longrunning::GetOperationRequest.new(name: name), grpc_options) do |response, operation| - assert_kind_of Gapic::Operation, response - assert_equal grpc_response, response.grpc_op - assert_equal grpc_operation, operation - end - - # Verify method calls - assert_equal 5, get_operation_client_stub.call_rpc_count - end - end - - def test_delete_operation - # Create GRPC objects. - grpc_response = ::Google::Protobuf::Empty.new - grpc_operation = GRPC::ActiveCall::Operation.new nil - grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - grpc_options = {} - - # Create request parameters for a unary method. - name = "hello world" - - delete_operation_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :delete_operation, name - assert_kind_of ::Google::Longrunning::DeleteOperationRequest, request - assert_equal "hello world", request["name"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, delete_operation_client_stub do - # Create client - client = ::Google::Cloud::SecurityCenter::V1::SecurityCenter::Operations.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.delete_operation({ name: name }) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use named arguments - client.delete_operation name: name do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object - client.delete_operation ::Google::Longrunning::DeleteOperationRequest.new(name: name) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use hash object with options - client.delete_operation({ name: name }, grpc_options) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object with options - client.delete_operation(::Google::Longrunning::DeleteOperationRequest.new(name: name), grpc_options) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Verify method calls - assert_equal 5, delete_operation_client_stub.call_rpc_count - end - end - - def test_cancel_operation - # Create GRPC objects. - grpc_response = ::Google::Protobuf::Empty.new - grpc_operation = GRPC::ActiveCall::Operation.new nil - grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - grpc_options = {} - - # Create request parameters for a unary method. - name = "hello world" - - cancel_operation_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :cancel_operation, name - assert_kind_of ::Google::Longrunning::CancelOperationRequest, request - assert_equal "hello world", request["name"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, cancel_operation_client_stub do - # Create client - client = ::Google::Cloud::SecurityCenter::V1::SecurityCenter::Operations.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.cancel_operation({ name: name }) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use named arguments - client.cancel_operation name: name do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object - client.cancel_operation ::Google::Longrunning::CancelOperationRequest.new(name: name) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use hash object with options - client.cancel_operation({ name: name }, grpc_options) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object with options - client.cancel_operation(::Google::Longrunning::CancelOperationRequest.new(name: name), grpc_options) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Verify method calls - assert_equal 5, cancel_operation_client_stub.call_rpc_count - end - end - - def test_wait_operation - # Create GRPC objects. - grpc_response = ::Google::Longrunning::Operation.new - grpc_operation = GRPC::ActiveCall::Operation.new nil - grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - grpc_options = {} - - # Create request parameters for a unary method. - name = "hello world" - timeout = {} - - wait_operation_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :wait_operation, name - assert_kind_of ::Google::Longrunning::WaitOperationRequest, request - assert_equal "hello world", request["name"] - assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Protobuf::Duration), request["timeout"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, wait_operation_client_stub do - # Create client - client = ::Google::Cloud::SecurityCenter::V1::SecurityCenter::Operations.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.wait_operation({ name: name, timeout: timeout }) do |response, operation| - assert_kind_of Gapic::Operation, response - assert_equal grpc_response, response.grpc_op - assert_equal grpc_operation, operation - end - - # Use named arguments - client.wait_operation name: name, timeout: timeout do |response, operation| - assert_kind_of Gapic::Operation, response - assert_equal grpc_response, response.grpc_op - assert_equal grpc_operation, operation - end - - # Use protobuf object - client.wait_operation ::Google::Longrunning::WaitOperationRequest.new(name: name, timeout: timeout) do |response, operation| - assert_kind_of Gapic::Operation, response - assert_equal grpc_response, response.grpc_op - assert_equal grpc_operation, operation - end - - # Use hash object with options - client.wait_operation({ name: name, timeout: timeout }, grpc_options) do |response, operation| - assert_kind_of Gapic::Operation, response - assert_equal grpc_response, response.grpc_op - assert_equal grpc_operation, operation - end - - # Use protobuf object with options - client.wait_operation(::Google::Longrunning::WaitOperationRequest.new(name: name, timeout: timeout), grpc_options) do |response, operation| - assert_kind_of Gapic::Operation, response - assert_equal grpc_response, response.grpc_op - assert_equal grpc_operation, operation - end - - # Verify method calls - assert_equal 5, wait_operation_client_stub.call_rpc_count - end - end - - def test_configure - grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - - client = block_config = config = nil - dummy_stub = ClientStub.new nil, nil - Gapic::ServiceStub.stub :new, dummy_stub do - client = ::Google::Cloud::SecurityCenter::V1::SecurityCenter::Operations.new do |config| - config.credentials = grpc_channel - end - end - - config = client.configure do |c| - block_config = c - end - - assert_same block_config, config - assert_kind_of ::Google::Cloud::SecurityCenter::V1::SecurityCenter::Operations::Configuration, config - end -end diff --git a/owl-bot-staging/google-cloud-security_center-v1/test/google/cloud/security_center/v1/security_center_paths_test.rb b/owl-bot-staging/google-cloud-security_center-v1/test/google/cloud/security_center/v1/security_center_paths_test.rb deleted file mode 100644 index 25ac2a34d4cc..000000000000 --- a/owl-bot-staging/google-cloud-security_center-v1/test/google/cloud/security_center/v1/security_center_paths_test.rb +++ /dev/null @@ -1,487 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -require "helper" - -require "gapic/grpc/service_stub" - -require "google/cloud/security_center/v1/security_center" - -class ::Google::Cloud::SecurityCenter::V1::SecurityCenter::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_big_query_export_path - grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - ::Gapic::ServiceStub.stub :new, DummyStub.new do - client = ::Google::Cloud::SecurityCenter::V1::SecurityCenter::Client.new do |config| - config.credentials = grpc_channel - end - - path = client.big_query_export_path organization: "value0", export: "value1" - assert_equal "organizations/value0/bigQueryExports/value1", path - - path = client.big_query_export_path folder: "value0", export: "value1" - assert_equal "folders/value0/bigQueryExports/value1", path - - path = client.big_query_export_path project: "value0", export: "value1" - assert_equal "projects/value0/bigQueryExports/value1", path - end - end - - def test_dlp_job_path - grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - ::Gapic::ServiceStub.stub :new, DummyStub.new do - client = ::Google::Cloud::SecurityCenter::V1::SecurityCenter::Client.new do |config| - config.credentials = grpc_channel - end - - path = client.dlp_job_path project: "value0", dlp_job: "value1" - assert_equal "projects/value0/dlpJobs/value1", path - - path = client.dlp_job_path project: "value0", location: "value1", dlp_job: "value2" - assert_equal "projects/value0/locations/value1/dlpJobs/value2", path - end - end - - def test_effective_event_threat_detection_custom_module_path - grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - ::Gapic::ServiceStub.stub :new, DummyStub.new do - client = ::Google::Cloud::SecurityCenter::V1::SecurityCenter::Client.new do |config| - config.credentials = grpc_channel - end - - path = client.effective_event_threat_detection_custom_module_path organization: "value0", module: "value1" - assert_equal "organizations/value0/eventThreatDetectionSettings/effectiveCustomModules/value1", path - - path = client.effective_event_threat_detection_custom_module_path folder: "value0", module: "value1" - assert_equal "folders/value0/eventThreatDetectionSettings/effectiveCustomModules/value1", path - - path = client.effective_event_threat_detection_custom_module_path project: "value0", module: "value1" - assert_equal "projects/value0/eventThreatDetectionSettings/effectiveCustomModules/value1", path - end - end - - def test_effective_security_health_analytics_custom_module_path - grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - ::Gapic::ServiceStub.stub :new, DummyStub.new do - client = ::Google::Cloud::SecurityCenter::V1::SecurityCenter::Client.new do |config| - config.credentials = grpc_channel - end - - path = client.effective_security_health_analytics_custom_module_path organization: "value0", effective_custom_module: "value1" - assert_equal "organizations/value0/securityHealthAnalyticsSettings/effectiveCustomModules/value1", path - - path = client.effective_security_health_analytics_custom_module_path folder: "value0", effective_custom_module: "value1" - assert_equal "folders/value0/securityHealthAnalyticsSettings/effectiveCustomModules/value1", path - - path = client.effective_security_health_analytics_custom_module_path project: "value0", effective_custom_module: "value1" - assert_equal "projects/value0/securityHealthAnalyticsSettings/effectiveCustomModules/value1", path - end - end - - def test_event_threat_detection_custom_module_path - grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - ::Gapic::ServiceStub.stub :new, DummyStub.new do - client = ::Google::Cloud::SecurityCenter::V1::SecurityCenter::Client.new do |config| - config.credentials = grpc_channel - end - - path = client.event_threat_detection_custom_module_path organization: "value0", module: "value1" - assert_equal "organizations/value0/eventThreatDetectionSettings/customModules/value1", path - - path = client.event_threat_detection_custom_module_path folder: "value0", module: "value1" - assert_equal "folders/value0/eventThreatDetectionSettings/customModules/value1", path - - path = client.event_threat_detection_custom_module_path project: "value0", module: "value1" - assert_equal "projects/value0/eventThreatDetectionSettings/customModules/value1", path - end - end - - def test_event_threat_detection_settings_path - grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - ::Gapic::ServiceStub.stub :new, DummyStub.new do - client = ::Google::Cloud::SecurityCenter::V1::SecurityCenter::Client.new do |config| - config.credentials = grpc_channel - end - - path = client.event_threat_detection_settings_path organization: "value0" - assert_equal "organizations/value0/eventThreatDetectionSettings", path - - path = client.event_threat_detection_settings_path folder: "value0" - assert_equal "folders/value0/eventThreatDetectionSettings", path - - path = client.event_threat_detection_settings_path project: "value0" - assert_equal "projects/value0/eventThreatDetectionSettings", path - end - end - - def test_external_system_path - grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - ::Gapic::ServiceStub.stub :new, DummyStub.new do - client = ::Google::Cloud::SecurityCenter::V1::SecurityCenter::Client.new do |config| - config.credentials = grpc_channel - end - - path = client.external_system_path organization: "value0", source: "value1", finding: "value2", externalsystem: "value3" - assert_equal "organizations/value0/sources/value1/findings/value2/externalSystems/value3", path - - path = client.external_system_path folder: "value0", source: "value1", finding: "value2", externalsystem: "value3" - assert_equal "folders/value0/sources/value1/findings/value2/externalSystems/value3", path - - path = client.external_system_path project: "value0", source: "value1", finding: "value2", externalsystem: "value3" - assert_equal "projects/value0/sources/value1/findings/value2/externalSystems/value3", path - end - end - - def test_finding_path - grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - ::Gapic::ServiceStub.stub :new, DummyStub.new do - client = ::Google::Cloud::SecurityCenter::V1::SecurityCenter::Client.new do |config| - config.credentials = grpc_channel - end - - path = client.finding_path organization: "value0", source: "value1", finding: "value2" - assert_equal "organizations/value0/sources/value1/findings/value2", path - - path = client.finding_path folder: "value0", source: "value1", finding: "value2" - assert_equal "folders/value0/sources/value1/findings/value2", path - - path = client.finding_path project: "value0", source: "value1", finding: "value2" - assert_equal "projects/value0/sources/value1/findings/value2", path - end - end - - def test_folder_path - grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - ::Gapic::ServiceStub.stub :new, DummyStub.new do - client = ::Google::Cloud::SecurityCenter::V1::SecurityCenter::Client.new do |config| - config.credentials = grpc_channel - end - - path = client.folder_path folder: "value0" - assert_equal "folders/value0", 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::Cloud::SecurityCenter::V1::SecurityCenter::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::Cloud::SecurityCenter::V1::SecurityCenter::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_mute_config_path - grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - ::Gapic::ServiceStub.stub :new, DummyStub.new do - client = ::Google::Cloud::SecurityCenter::V1::SecurityCenter::Client.new do |config| - config.credentials = grpc_channel - end - - path = client.mute_config_path organization: "value0", mute_config: "value1" - assert_equal "organizations/value0/muteConfigs/value1", path - - path = client.mute_config_path folder: "value0", mute_config: "value1" - assert_equal "folders/value0/muteConfigs/value1", path - - path = client.mute_config_path project: "value0", mute_config: "value1" - assert_equal "projects/value0/muteConfigs/value1", path - - path = client.mute_config_path organization: "value0", location: "value1", mute_config: "value2" - assert_equal "organizations/value0/locations/value1/muteConfigs/value2", path - - path = client.mute_config_path folder: "value0", location: "value1", mute_config: "value2" - assert_equal "folders/value0/locations/value1/muteConfigs/value2", path - - path = client.mute_config_path project: "value0", location: "value1", mute_config: "value2" - assert_equal "projects/value0/locations/value1/muteConfigs/value2", path - end - end - - def test_notification_config_path - grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - ::Gapic::ServiceStub.stub :new, DummyStub.new do - client = ::Google::Cloud::SecurityCenter::V1::SecurityCenter::Client.new do |config| - config.credentials = grpc_channel - end - - path = client.notification_config_path organization: "value0", notification_config: "value1" - assert_equal "organizations/value0/notificationConfigs/value1", path - - path = client.notification_config_path folder: "value0", notification_config: "value1" - assert_equal "folders/value0/notificationConfigs/value1", path - - path = client.notification_config_path project: "value0", notification_config: "value1" - assert_equal "projects/value0/notificationConfigs/value1", path - end - end - - def test_organization_path - grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - ::Gapic::ServiceStub.stub :new, DummyStub.new do - client = ::Google::Cloud::SecurityCenter::V1::SecurityCenter::Client.new do |config| - config.credentials = grpc_channel - end - - path = client.organization_path organization: "value0" - assert_equal "organizations/value0", 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::Cloud::SecurityCenter::V1::SecurityCenter::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_organization_settings_path - grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - ::Gapic::ServiceStub.stub :new, DummyStub.new do - client = ::Google::Cloud::SecurityCenter::V1::SecurityCenter::Client.new do |config| - config.credentials = grpc_channel - end - - path = client.organization_settings_path organization: "value0" - assert_equal "organizations/value0/organizationSettings", path - end - end - - def test_organization_simulation_path - grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - ::Gapic::ServiceStub.stub :new, DummyStub.new do - client = ::Google::Cloud::SecurityCenter::V1::SecurityCenter::Client.new do |config| - config.credentials = grpc_channel - end - - path = client.organization_simulation_path organization: "value0", simulation: "value1" - assert_equal "organizations/value0/simulations/value1", path - end - end - - def test_policy_path - grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - ::Gapic::ServiceStub.stub :new, DummyStub.new do - client = ::Google::Cloud::SecurityCenter::V1::SecurityCenter::Client.new do |config| - config.credentials = grpc_channel - end - - path = client.policy_path organization: "value0", constraint_name: "value1" - assert_equal "organizations/value0/policies/value1", path - - path = client.policy_path folder: "value0", constraint_name: "value1" - assert_equal "folders/value0/policies/value1", path - - path = client.policy_path project: "value0", constraint_name: "value1" - assert_equal "projects/value0/policies/value1", path - end - end - - def test_project_path - grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - ::Gapic::ServiceStub.stub :new, DummyStub.new do - client = ::Google::Cloud::SecurityCenter::V1::SecurityCenter::Client.new do |config| - config.credentials = grpc_channel - end - - path = client.project_path project: "value0" - assert_equal "projects/value0", path - end - end - - def test_resource_value_config_path - grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - ::Gapic::ServiceStub.stub :new, DummyStub.new do - client = ::Google::Cloud::SecurityCenter::V1::SecurityCenter::Client.new do |config| - config.credentials = grpc_channel - end - - path = client.resource_value_config_path organization: "value0", resource_value_config: "value1" - assert_equal "organizations/value0/resourceValueConfigs/value1", path - end - end - - def test_security_health_analytics_custom_module_path - grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - ::Gapic::ServiceStub.stub :new, DummyStub.new do - client = ::Google::Cloud::SecurityCenter::V1::SecurityCenter::Client.new do |config| - config.credentials = grpc_channel - end - - path = client.security_health_analytics_custom_module_path organization: "value0", custom_module: "value1" - assert_equal "organizations/value0/securityHealthAnalyticsSettings/customModules/value1", path - - path = client.security_health_analytics_custom_module_path folder: "value0", custom_module: "value1" - assert_equal "folders/value0/securityHealthAnalyticsSettings/customModules/value1", path - - path = client.security_health_analytics_custom_module_path project: "value0", custom_module: "value1" - assert_equal "projects/value0/securityHealthAnalyticsSettings/customModules/value1", path - end - end - - def test_security_health_analytics_settings_path - grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - ::Gapic::ServiceStub.stub :new, DummyStub.new do - client = ::Google::Cloud::SecurityCenter::V1::SecurityCenter::Client.new do |config| - config.credentials = grpc_channel - end - - path = client.security_health_analytics_settings_path organization: "value0" - assert_equal "organizations/value0/securityHealthAnalyticsSettings", path - - path = client.security_health_analytics_settings_path folder: "value0" - assert_equal "folders/value0/securityHealthAnalyticsSettings", path - - path = client.security_health_analytics_settings_path project: "value0" - assert_equal "projects/value0/securityHealthAnalyticsSettings", path - end - end - - def test_security_marks_path - grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - ::Gapic::ServiceStub.stub :new, DummyStub.new do - client = ::Google::Cloud::SecurityCenter::V1::SecurityCenter::Client.new do |config| - config.credentials = grpc_channel - end - - path = client.security_marks_path organization: "value0", asset: "value1" - assert_equal "organizations/value0/assets/value1/securityMarks", path - - path = client.security_marks_path organization: "value0", source: "value1", finding: "value2" - assert_equal "organizations/value0/sources/value1/findings/value2/securityMarks", path - - path = client.security_marks_path folder: "value0", asset: "value1" - assert_equal "folders/value0/assets/value1/securityMarks", path - - path = client.security_marks_path project: "value0", asset: "value1" - assert_equal "projects/value0/assets/value1/securityMarks", path - - path = client.security_marks_path folder: "value0", source: "value1", finding: "value2" - assert_equal "folders/value0/sources/value1/findings/value2/securityMarks", path - - path = client.security_marks_path project: "value0", source: "value1", finding: "value2" - assert_equal "projects/value0/sources/value1/findings/value2/securityMarks", path - end - end - - def test_simulation_path - grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - ::Gapic::ServiceStub.stub :new, DummyStub.new do - client = ::Google::Cloud::SecurityCenter::V1::SecurityCenter::Client.new do |config| - config.credentials = grpc_channel - end - - path = client.simulation_path organization: "value0", simulation: "value1" - assert_equal "organizations/value0/simulations/value1", path - end - end - - def test_source_path - grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - ::Gapic::ServiceStub.stub :new, DummyStub.new do - client = ::Google::Cloud::SecurityCenter::V1::SecurityCenter::Client.new do |config| - config.credentials = grpc_channel - end - - path = client.source_path organization: "value0", source: "value1" - assert_equal "organizations/value0/sources/value1", path - - path = client.source_path folder: "value0", source: "value1" - assert_equal "folders/value0/sources/value1", path - - path = client.source_path project: "value0", source: "value1" - assert_equal "projects/value0/sources/value1", path - end - end - - def test_table_data_profile_path - grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - ::Gapic::ServiceStub.stub :new, DummyStub.new do - client = ::Google::Cloud::SecurityCenter::V1::SecurityCenter::Client.new do |config| - config.credentials = grpc_channel - end - - path = client.table_data_profile_path project: "value0", table_profile: "value1" - assert_equal "projects/value0/tableProfiles/value1", path - - path = client.table_data_profile_path project: "value0", location: "value1", table_profile: "value2" - assert_equal "projects/value0/locations/value1/tableProfiles/value2", path - end - end - - def test_topic_path - grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - ::Gapic::ServiceStub.stub :new, DummyStub.new do - client = ::Google::Cloud::SecurityCenter::V1::SecurityCenter::Client.new do |config| - config.credentials = grpc_channel - end - - path = client.topic_path project: "value0", topic: "value1" - assert_equal "projects/value0/topics/value1", path - end - end - - def test_valued_resource_path - grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - ::Gapic::ServiceStub.stub :new, DummyStub.new do - client = ::Google::Cloud::SecurityCenter::V1::SecurityCenter::Client.new do |config| - config.credentials = grpc_channel - end - - path = client.valued_resource_path organization: "value0", simulation: "value1", valued_resource: "value2" - assert_equal "organizations/value0/simulations/value1/valuedResources/value2", path - end - end -end diff --git a/owl-bot-staging/google-cloud-security_center-v1/test/google/cloud/security_center/v1/security_center_rest_test.rb b/owl-bot-staging/google-cloud-security_center-v1/test/google/cloud/security_center/v1/security_center_rest_test.rb deleted file mode 100644 index 4a2418bd9a8f..000000000000 --- a/owl-bot-staging/google-cloud-security_center-v1/test/google/cloud/security_center/v1/security_center_rest_test.rb +++ /dev/null @@ -1,3594 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -require "helper" -require "gapic/rest" -require "google/cloud/securitycenter/v1/securitycenter_service_pb" -require "google/cloud/security_center/v1/security_center/rest" - - -class ::Google::Cloud::SecurityCenter::V1::SecurityCenter::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_bulk_mute_findings - # 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" - filter = "hello world" - mute_annotation = "hello world" - mute_state = :MUTE_STATE_UNSPECIFIED - - bulk_mute_findings_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| - assert options.metadata.key? :"x-goog-api-client" - assert options.metadata[:"x-goog-api-client"].include? "rest" - refute options.metadata[:"x-goog-api-client"].include? "grpc" - end - - ::Google::Cloud::SecurityCenter::V1::SecurityCenter::Rest::ServiceStub.stub :transcode_bulk_mute_findings_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, bulk_mute_findings_client_stub do - # Create client - client = ::Google::Cloud::SecurityCenter::V1::SecurityCenter::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - client.bulk_mute_findings({ parent: parent, filter: filter, mute_annotation: mute_annotation, mute_state: mute_state }) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use named arguments - client.bulk_mute_findings parent: parent, filter: filter, mute_annotation: mute_annotation, mute_state: mute_state do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object - client.bulk_mute_findings ::Google::Cloud::SecurityCenter::V1::BulkMuteFindingsRequest.new(parent: parent, filter: filter, mute_annotation: mute_annotation, mute_state: mute_state) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use hash object with options - client.bulk_mute_findings({ parent: parent, filter: filter, mute_annotation: mute_annotation, mute_state: mute_state }, call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object with options - client.bulk_mute_findings(::Google::Cloud::SecurityCenter::V1::BulkMuteFindingsRequest.new(parent: parent, filter: filter, mute_annotation: mute_annotation, mute_state: mute_state), call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Verify method calls - assert_equal 5, bulk_mute_findings_client_stub.call_count - end - end - end - - def test_create_security_health_analytics_custom_module - # Create test objects. - client_result = ::Google::Cloud::SecurityCenter::V1::SecurityHealthAnalyticsCustomModule.new - http_response = OpenStruct.new body: client_result.to_json - - call_options = {} - - # Create request parameters for a unary method. - parent = "hello world" - security_health_analytics_custom_module = {} - - create_security_health_analytics_custom_module_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| - assert options.metadata.key? :"x-goog-api-client" - assert options.metadata[:"x-goog-api-client"].include? "rest" - refute options.metadata[:"x-goog-api-client"].include? "grpc" - end - - ::Google::Cloud::SecurityCenter::V1::SecurityCenter::Rest::ServiceStub.stub :transcode_create_security_health_analytics_custom_module_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, create_security_health_analytics_custom_module_client_stub do - # Create client - client = ::Google::Cloud::SecurityCenter::V1::SecurityCenter::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - client.create_security_health_analytics_custom_module({ parent: parent, security_health_analytics_custom_module: security_health_analytics_custom_module }) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use named arguments - client.create_security_health_analytics_custom_module parent: parent, security_health_analytics_custom_module: security_health_analytics_custom_module do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object - client.create_security_health_analytics_custom_module ::Google::Cloud::SecurityCenter::V1::CreateSecurityHealthAnalyticsCustomModuleRequest.new(parent: parent, security_health_analytics_custom_module: security_health_analytics_custom_module) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use hash object with options - client.create_security_health_analytics_custom_module({ parent: parent, security_health_analytics_custom_module: security_health_analytics_custom_module }, call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object with options - client.create_security_health_analytics_custom_module(::Google::Cloud::SecurityCenter::V1::CreateSecurityHealthAnalyticsCustomModuleRequest.new(parent: parent, security_health_analytics_custom_module: security_health_analytics_custom_module), call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Verify method calls - assert_equal 5, create_security_health_analytics_custom_module_client_stub.call_count - end - end - end - - def test_create_source - # Create test objects. - client_result = ::Google::Cloud::SecurityCenter::V1::Source.new - http_response = OpenStruct.new body: client_result.to_json - - call_options = {} - - # Create request parameters for a unary method. - parent = "hello world" - source = {} - - create_source_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| - assert options.metadata.key? :"x-goog-api-client" - assert options.metadata[:"x-goog-api-client"].include? "rest" - refute options.metadata[:"x-goog-api-client"].include? "grpc" - end - - ::Google::Cloud::SecurityCenter::V1::SecurityCenter::Rest::ServiceStub.stub :transcode_create_source_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, create_source_client_stub do - # Create client - client = ::Google::Cloud::SecurityCenter::V1::SecurityCenter::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - client.create_source({ parent: parent, source: source }) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use named arguments - client.create_source parent: parent, source: source do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object - client.create_source ::Google::Cloud::SecurityCenter::V1::CreateSourceRequest.new(parent: parent, source: source) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use hash object with options - client.create_source({ parent: parent, source: source }, call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object with options - client.create_source(::Google::Cloud::SecurityCenter::V1::CreateSourceRequest.new(parent: parent, source: source), call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Verify method calls - assert_equal 5, create_source_client_stub.call_count - end - end - end - - def test_create_finding - # Create test objects. - client_result = ::Google::Cloud::SecurityCenter::V1::Finding.new - http_response = OpenStruct.new body: client_result.to_json - - call_options = {} - - # Create request parameters for a unary method. - parent = "hello world" - finding_id = "hello world" - finding = {} - - create_finding_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| - assert options.metadata.key? :"x-goog-api-client" - assert options.metadata[:"x-goog-api-client"].include? "rest" - refute options.metadata[:"x-goog-api-client"].include? "grpc" - end - - ::Google::Cloud::SecurityCenter::V1::SecurityCenter::Rest::ServiceStub.stub :transcode_create_finding_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, create_finding_client_stub do - # Create client - client = ::Google::Cloud::SecurityCenter::V1::SecurityCenter::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - client.create_finding({ parent: parent, finding_id: finding_id, finding: finding }) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use named arguments - client.create_finding parent: parent, finding_id: finding_id, finding: finding do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object - client.create_finding ::Google::Cloud::SecurityCenter::V1::CreateFindingRequest.new(parent: parent, finding_id: finding_id, finding: finding) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use hash object with options - client.create_finding({ parent: parent, finding_id: finding_id, finding: finding }, call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object with options - client.create_finding(::Google::Cloud::SecurityCenter::V1::CreateFindingRequest.new(parent: parent, finding_id: finding_id, finding: finding), call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Verify method calls - assert_equal 5, create_finding_client_stub.call_count - end - end - end - - def test_create_mute_config - # Create test objects. - client_result = ::Google::Cloud::SecurityCenter::V1::MuteConfig.new - http_response = OpenStruct.new body: client_result.to_json - - call_options = {} - - # Create request parameters for a unary method. - parent = "hello world" - mute_config = {} - mute_config_id = "hello world" - - create_mute_config_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| - assert options.metadata.key? :"x-goog-api-client" - assert options.metadata[:"x-goog-api-client"].include? "rest" - refute options.metadata[:"x-goog-api-client"].include? "grpc" - end - - ::Google::Cloud::SecurityCenter::V1::SecurityCenter::Rest::ServiceStub.stub :transcode_create_mute_config_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, create_mute_config_client_stub do - # Create client - client = ::Google::Cloud::SecurityCenter::V1::SecurityCenter::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - client.create_mute_config({ parent: parent, mute_config: mute_config, mute_config_id: mute_config_id }) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use named arguments - client.create_mute_config parent: parent, mute_config: mute_config, mute_config_id: mute_config_id do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object - client.create_mute_config ::Google::Cloud::SecurityCenter::V1::CreateMuteConfigRequest.new(parent: parent, mute_config: mute_config, mute_config_id: mute_config_id) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use hash object with options - client.create_mute_config({ parent: parent, mute_config: mute_config, mute_config_id: mute_config_id }, call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object with options - client.create_mute_config(::Google::Cloud::SecurityCenter::V1::CreateMuteConfigRequest.new(parent: parent, mute_config: mute_config, mute_config_id: mute_config_id), call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Verify method calls - assert_equal 5, create_mute_config_client_stub.call_count - end - end - end - - def test_create_notification_config - # Create test objects. - client_result = ::Google::Cloud::SecurityCenter::V1::NotificationConfig.new - http_response = OpenStruct.new body: client_result.to_json - - call_options = {} - - # Create request parameters for a unary method. - parent = "hello world" - config_id = "hello world" - notification_config = {} - - create_notification_config_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| - assert options.metadata.key? :"x-goog-api-client" - assert options.metadata[:"x-goog-api-client"].include? "rest" - refute options.metadata[:"x-goog-api-client"].include? "grpc" - end - - ::Google::Cloud::SecurityCenter::V1::SecurityCenter::Rest::ServiceStub.stub :transcode_create_notification_config_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, create_notification_config_client_stub do - # Create client - client = ::Google::Cloud::SecurityCenter::V1::SecurityCenter::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - client.create_notification_config({ parent: parent, config_id: config_id, notification_config: notification_config }) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use named arguments - client.create_notification_config parent: parent, config_id: config_id, notification_config: notification_config do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object - client.create_notification_config ::Google::Cloud::SecurityCenter::V1::CreateNotificationConfigRequest.new(parent: parent, config_id: config_id, notification_config: notification_config) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use hash object with options - client.create_notification_config({ parent: parent, config_id: config_id, notification_config: notification_config }, call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object with options - client.create_notification_config(::Google::Cloud::SecurityCenter::V1::CreateNotificationConfigRequest.new(parent: parent, config_id: config_id, notification_config: notification_config), call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Verify method calls - assert_equal 5, create_notification_config_client_stub.call_count - end - end - end - - def test_delete_mute_config - # Create test objects. - client_result = ::Google::Protobuf::Empty.new - http_response = OpenStruct.new body: client_result.to_json - - call_options = {} - - # Create request parameters for a unary method. - name = "hello world" - - delete_mute_config_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| - assert options.metadata.key? :"x-goog-api-client" - assert options.metadata[:"x-goog-api-client"].include? "rest" - refute options.metadata[:"x-goog-api-client"].include? "grpc" - end - - ::Google::Cloud::SecurityCenter::V1::SecurityCenter::Rest::ServiceStub.stub :transcode_delete_mute_config_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, delete_mute_config_client_stub do - # Create client - client = ::Google::Cloud::SecurityCenter::V1::SecurityCenter::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - client.delete_mute_config({ name: name }) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use named arguments - client.delete_mute_config name: name do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object - client.delete_mute_config ::Google::Cloud::SecurityCenter::V1::DeleteMuteConfigRequest.new(name: name) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use hash object with options - client.delete_mute_config({ name: name }, call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object with options - client.delete_mute_config(::Google::Cloud::SecurityCenter::V1::DeleteMuteConfigRequest.new(name: name), call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Verify method calls - assert_equal 5, delete_mute_config_client_stub.call_count - end - end - end - - def test_delete_notification_config - # Create test objects. - client_result = ::Google::Protobuf::Empty.new - http_response = OpenStruct.new body: client_result.to_json - - call_options = {} - - # Create request parameters for a unary method. - name = "hello world" - - delete_notification_config_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| - assert options.metadata.key? :"x-goog-api-client" - assert options.metadata[:"x-goog-api-client"].include? "rest" - refute options.metadata[:"x-goog-api-client"].include? "grpc" - end - - ::Google::Cloud::SecurityCenter::V1::SecurityCenter::Rest::ServiceStub.stub :transcode_delete_notification_config_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, delete_notification_config_client_stub do - # Create client - client = ::Google::Cloud::SecurityCenter::V1::SecurityCenter::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - client.delete_notification_config({ name: name }) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use named arguments - client.delete_notification_config name: name do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object - client.delete_notification_config ::Google::Cloud::SecurityCenter::V1::DeleteNotificationConfigRequest.new(name: name) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use hash object with options - client.delete_notification_config({ name: name }, call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object with options - client.delete_notification_config(::Google::Cloud::SecurityCenter::V1::DeleteNotificationConfigRequest.new(name: name), call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Verify method calls - assert_equal 5, delete_notification_config_client_stub.call_count - end - end - end - - def test_delete_security_health_analytics_custom_module - # Create test objects. - client_result = ::Google::Protobuf::Empty.new - http_response = OpenStruct.new body: client_result.to_json - - call_options = {} - - # Create request parameters for a unary method. - name = "hello world" - - delete_security_health_analytics_custom_module_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| - assert options.metadata.key? :"x-goog-api-client" - assert options.metadata[:"x-goog-api-client"].include? "rest" - refute options.metadata[:"x-goog-api-client"].include? "grpc" - end - - ::Google::Cloud::SecurityCenter::V1::SecurityCenter::Rest::ServiceStub.stub :transcode_delete_security_health_analytics_custom_module_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, delete_security_health_analytics_custom_module_client_stub do - # Create client - client = ::Google::Cloud::SecurityCenter::V1::SecurityCenter::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - client.delete_security_health_analytics_custom_module({ name: name }) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use named arguments - client.delete_security_health_analytics_custom_module name: name do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object - client.delete_security_health_analytics_custom_module ::Google::Cloud::SecurityCenter::V1::DeleteSecurityHealthAnalyticsCustomModuleRequest.new(name: name) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use hash object with options - client.delete_security_health_analytics_custom_module({ name: name }, call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object with options - client.delete_security_health_analytics_custom_module(::Google::Cloud::SecurityCenter::V1::DeleteSecurityHealthAnalyticsCustomModuleRequest.new(name: name), call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Verify method calls - assert_equal 5, delete_security_health_analytics_custom_module_client_stub.call_count - end - end - end - - def test_get_simulation - # Create test objects. - client_result = ::Google::Cloud::SecurityCenter::V1::Simulation.new - http_response = OpenStruct.new body: client_result.to_json - - call_options = {} - - # Create request parameters for a unary method. - name = "hello world" - - get_simulation_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| - assert options.metadata.key? :"x-goog-api-client" - assert options.metadata[:"x-goog-api-client"].include? "rest" - refute options.metadata[:"x-goog-api-client"].include? "grpc" - end - - ::Google::Cloud::SecurityCenter::V1::SecurityCenter::Rest::ServiceStub.stub :transcode_get_simulation_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, get_simulation_client_stub do - # Create client - client = ::Google::Cloud::SecurityCenter::V1::SecurityCenter::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - client.get_simulation({ name: name }) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use named arguments - client.get_simulation name: name do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object - client.get_simulation ::Google::Cloud::SecurityCenter::V1::GetSimulationRequest.new(name: name) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use hash object with options - client.get_simulation({ name: name }, call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object with options - client.get_simulation(::Google::Cloud::SecurityCenter::V1::GetSimulationRequest.new(name: name), call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Verify method calls - assert_equal 5, get_simulation_client_stub.call_count - end - end - end - - def test_get_valued_resource - # Create test objects. - client_result = ::Google::Cloud::SecurityCenter::V1::ValuedResource.new - http_response = OpenStruct.new body: client_result.to_json - - call_options = {} - - # Create request parameters for a unary method. - name = "hello world" - - get_valued_resource_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| - assert options.metadata.key? :"x-goog-api-client" - assert options.metadata[:"x-goog-api-client"].include? "rest" - refute options.metadata[:"x-goog-api-client"].include? "grpc" - end - - ::Google::Cloud::SecurityCenter::V1::SecurityCenter::Rest::ServiceStub.stub :transcode_get_valued_resource_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, get_valued_resource_client_stub do - # Create client - client = ::Google::Cloud::SecurityCenter::V1::SecurityCenter::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - client.get_valued_resource({ name: name }) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use named arguments - client.get_valued_resource name: name do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object - client.get_valued_resource ::Google::Cloud::SecurityCenter::V1::GetValuedResourceRequest.new(name: name) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use hash object with options - client.get_valued_resource({ name: name }, call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object with options - client.get_valued_resource(::Google::Cloud::SecurityCenter::V1::GetValuedResourceRequest.new(name: name), call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Verify method calls - assert_equal 5, get_valued_resource_client_stub.call_count - end - end - end - - def test_get_big_query_export - # Create test objects. - client_result = ::Google::Cloud::SecurityCenter::V1::BigQueryExport.new - http_response = OpenStruct.new body: client_result.to_json - - call_options = {} - - # Create request parameters for a unary method. - name = "hello world" - - get_big_query_export_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| - assert options.metadata.key? :"x-goog-api-client" - assert options.metadata[:"x-goog-api-client"].include? "rest" - refute options.metadata[:"x-goog-api-client"].include? "grpc" - end - - ::Google::Cloud::SecurityCenter::V1::SecurityCenter::Rest::ServiceStub.stub :transcode_get_big_query_export_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, get_big_query_export_client_stub do - # Create client - client = ::Google::Cloud::SecurityCenter::V1::SecurityCenter::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - client.get_big_query_export({ name: name }) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use named arguments - client.get_big_query_export name: name do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object - client.get_big_query_export ::Google::Cloud::SecurityCenter::V1::GetBigQueryExportRequest.new(name: name) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use hash object with options - client.get_big_query_export({ name: name }, call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object with options - client.get_big_query_export(::Google::Cloud::SecurityCenter::V1::GetBigQueryExportRequest.new(name: name), call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Verify method calls - assert_equal 5, get_big_query_export_client_stub.call_count - end - end - end - - def test_get_iam_policy - # Create test objects. - client_result = ::Google::Iam::V1::Policy.new - http_response = OpenStruct.new body: client_result.to_json - - call_options = {} - - # Create request parameters for a unary method. - resource = "hello world" - options = {} - - get_iam_policy_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| - assert options.metadata.key? :"x-goog-api-client" - assert options.metadata[:"x-goog-api-client"].include? "rest" - refute options.metadata[:"x-goog-api-client"].include? "grpc" - end - - ::Google::Cloud::SecurityCenter::V1::SecurityCenter::Rest::ServiceStub.stub :transcode_get_iam_policy_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, get_iam_policy_client_stub do - # Create client - client = ::Google::Cloud::SecurityCenter::V1::SecurityCenter::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - client.get_iam_policy({ resource: resource, options: options }) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use named arguments - client.get_iam_policy resource: resource, options: options do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object - client.get_iam_policy ::Google::Iam::V1::GetIamPolicyRequest.new(resource: resource, options: options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use hash object with options - client.get_iam_policy({ resource: resource, options: options }, call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object with options - client.get_iam_policy(::Google::Iam::V1::GetIamPolicyRequest.new(resource: resource, options: options), call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Verify method calls - assert_equal 5, get_iam_policy_client_stub.call_count - end - end - end - - def test_get_mute_config - # Create test objects. - client_result = ::Google::Cloud::SecurityCenter::V1::MuteConfig.new - http_response = OpenStruct.new body: client_result.to_json - - call_options = {} - - # Create request parameters for a unary method. - name = "hello world" - - get_mute_config_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| - assert options.metadata.key? :"x-goog-api-client" - assert options.metadata[:"x-goog-api-client"].include? "rest" - refute options.metadata[:"x-goog-api-client"].include? "grpc" - end - - ::Google::Cloud::SecurityCenter::V1::SecurityCenter::Rest::ServiceStub.stub :transcode_get_mute_config_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, get_mute_config_client_stub do - # Create client - client = ::Google::Cloud::SecurityCenter::V1::SecurityCenter::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - client.get_mute_config({ name: name }) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use named arguments - client.get_mute_config name: name do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object - client.get_mute_config ::Google::Cloud::SecurityCenter::V1::GetMuteConfigRequest.new(name: name) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use hash object with options - client.get_mute_config({ name: name }, call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object with options - client.get_mute_config(::Google::Cloud::SecurityCenter::V1::GetMuteConfigRequest.new(name: name), call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Verify method calls - assert_equal 5, get_mute_config_client_stub.call_count - end - end - end - - def test_get_notification_config - # Create test objects. - client_result = ::Google::Cloud::SecurityCenter::V1::NotificationConfig.new - http_response = OpenStruct.new body: client_result.to_json - - call_options = {} - - # Create request parameters for a unary method. - name = "hello world" - - get_notification_config_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| - assert options.metadata.key? :"x-goog-api-client" - assert options.metadata[:"x-goog-api-client"].include? "rest" - refute options.metadata[:"x-goog-api-client"].include? "grpc" - end - - ::Google::Cloud::SecurityCenter::V1::SecurityCenter::Rest::ServiceStub.stub :transcode_get_notification_config_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, get_notification_config_client_stub do - # Create client - client = ::Google::Cloud::SecurityCenter::V1::SecurityCenter::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - client.get_notification_config({ name: name }) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use named arguments - client.get_notification_config name: name do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object - client.get_notification_config ::Google::Cloud::SecurityCenter::V1::GetNotificationConfigRequest.new(name: name) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use hash object with options - client.get_notification_config({ name: name }, call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object with options - client.get_notification_config(::Google::Cloud::SecurityCenter::V1::GetNotificationConfigRequest.new(name: name), call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Verify method calls - assert_equal 5, get_notification_config_client_stub.call_count - end - end - end - - def test_get_organization_settings - # Create test objects. - client_result = ::Google::Cloud::SecurityCenter::V1::OrganizationSettings.new - http_response = OpenStruct.new body: client_result.to_json - - call_options = {} - - # Create request parameters for a unary method. - name = "hello world" - - get_organization_settings_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| - assert options.metadata.key? :"x-goog-api-client" - assert options.metadata[:"x-goog-api-client"].include? "rest" - refute options.metadata[:"x-goog-api-client"].include? "grpc" - end - - ::Google::Cloud::SecurityCenter::V1::SecurityCenter::Rest::ServiceStub.stub :transcode_get_organization_settings_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, get_organization_settings_client_stub do - # Create client - client = ::Google::Cloud::SecurityCenter::V1::SecurityCenter::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - client.get_organization_settings({ name: name }) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use named arguments - client.get_organization_settings name: name do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object - client.get_organization_settings ::Google::Cloud::SecurityCenter::V1::GetOrganizationSettingsRequest.new(name: name) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use hash object with options - client.get_organization_settings({ name: name }, call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object with options - client.get_organization_settings(::Google::Cloud::SecurityCenter::V1::GetOrganizationSettingsRequest.new(name: name), call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Verify method calls - assert_equal 5, get_organization_settings_client_stub.call_count - end - end - end - - def test_get_effective_security_health_analytics_custom_module - # Create test objects. - client_result = ::Google::Cloud::SecurityCenter::V1::EffectiveSecurityHealthAnalyticsCustomModule.new - http_response = OpenStruct.new body: client_result.to_json - - call_options = {} - - # Create request parameters for a unary method. - name = "hello world" - - get_effective_security_health_analytics_custom_module_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| - assert options.metadata.key? :"x-goog-api-client" - assert options.metadata[:"x-goog-api-client"].include? "rest" - refute options.metadata[:"x-goog-api-client"].include? "grpc" - end - - ::Google::Cloud::SecurityCenter::V1::SecurityCenter::Rest::ServiceStub.stub :transcode_get_effective_security_health_analytics_custom_module_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, get_effective_security_health_analytics_custom_module_client_stub do - # Create client - client = ::Google::Cloud::SecurityCenter::V1::SecurityCenter::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - client.get_effective_security_health_analytics_custom_module({ name: name }) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use named arguments - client.get_effective_security_health_analytics_custom_module name: name do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object - client.get_effective_security_health_analytics_custom_module ::Google::Cloud::SecurityCenter::V1::GetEffectiveSecurityHealthAnalyticsCustomModuleRequest.new(name: name) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use hash object with options - client.get_effective_security_health_analytics_custom_module({ name: name }, call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object with options - client.get_effective_security_health_analytics_custom_module(::Google::Cloud::SecurityCenter::V1::GetEffectiveSecurityHealthAnalyticsCustomModuleRequest.new(name: name), call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Verify method calls - assert_equal 5, get_effective_security_health_analytics_custom_module_client_stub.call_count - end - end - end - - def test_get_security_health_analytics_custom_module - # Create test objects. - client_result = ::Google::Cloud::SecurityCenter::V1::SecurityHealthAnalyticsCustomModule.new - http_response = OpenStruct.new body: client_result.to_json - - call_options = {} - - # Create request parameters for a unary method. - name = "hello world" - - get_security_health_analytics_custom_module_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| - assert options.metadata.key? :"x-goog-api-client" - assert options.metadata[:"x-goog-api-client"].include? "rest" - refute options.metadata[:"x-goog-api-client"].include? "grpc" - end - - ::Google::Cloud::SecurityCenter::V1::SecurityCenter::Rest::ServiceStub.stub :transcode_get_security_health_analytics_custom_module_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, get_security_health_analytics_custom_module_client_stub do - # Create client - client = ::Google::Cloud::SecurityCenter::V1::SecurityCenter::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - client.get_security_health_analytics_custom_module({ name: name }) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use named arguments - client.get_security_health_analytics_custom_module name: name do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object - client.get_security_health_analytics_custom_module ::Google::Cloud::SecurityCenter::V1::GetSecurityHealthAnalyticsCustomModuleRequest.new(name: name) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use hash object with options - client.get_security_health_analytics_custom_module({ name: name }, call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object with options - client.get_security_health_analytics_custom_module(::Google::Cloud::SecurityCenter::V1::GetSecurityHealthAnalyticsCustomModuleRequest.new(name: name), call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Verify method calls - assert_equal 5, get_security_health_analytics_custom_module_client_stub.call_count - end - end - end - - def test_get_source - # Create test objects. - client_result = ::Google::Cloud::SecurityCenter::V1::Source.new - http_response = OpenStruct.new body: client_result.to_json - - call_options = {} - - # Create request parameters for a unary method. - name = "hello world" - - get_source_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| - assert options.metadata.key? :"x-goog-api-client" - assert options.metadata[:"x-goog-api-client"].include? "rest" - refute options.metadata[:"x-goog-api-client"].include? "grpc" - end - - ::Google::Cloud::SecurityCenter::V1::SecurityCenter::Rest::ServiceStub.stub :transcode_get_source_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, get_source_client_stub do - # Create client - client = ::Google::Cloud::SecurityCenter::V1::SecurityCenter::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - client.get_source({ name: name }) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use named arguments - client.get_source name: name do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object - client.get_source ::Google::Cloud::SecurityCenter::V1::GetSourceRequest.new(name: name) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use hash object with options - client.get_source({ name: name }, call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object with options - client.get_source(::Google::Cloud::SecurityCenter::V1::GetSourceRequest.new(name: name), call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Verify method calls - assert_equal 5, get_source_client_stub.call_count - end - end - end - - def test_group_assets - # Create test objects. - client_result = ::Google::Cloud::SecurityCenter::V1::GroupAssetsResponse.new - http_response = OpenStruct.new body: client_result.to_json - - call_options = {} - - # Create request parameters for a unary method. - parent = "hello world" - filter = "hello world" - group_by = "hello world" - compare_duration = {} - read_time = {} - page_token = "hello world" - page_size = 42 - - group_assets_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| - assert options.metadata.key? :"x-goog-api-client" - assert options.metadata[:"x-goog-api-client"].include? "rest" - refute options.metadata[:"x-goog-api-client"].include? "grpc" - end - - ::Google::Cloud::SecurityCenter::V1::SecurityCenter::Rest::ServiceStub.stub :transcode_group_assets_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, group_assets_client_stub do - # Create client - client = ::Google::Cloud::SecurityCenter::V1::SecurityCenter::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - client.group_assets({ parent: parent, filter: filter, group_by: group_by, compare_duration: compare_duration, read_time: read_time, page_token: page_token, page_size: page_size }) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use named arguments - client.group_assets parent: parent, filter: filter, group_by: group_by, compare_duration: compare_duration, read_time: read_time, page_token: page_token, page_size: page_size do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object - client.group_assets ::Google::Cloud::SecurityCenter::V1::GroupAssetsRequest.new(parent: parent, filter: filter, group_by: group_by, compare_duration: compare_duration, read_time: read_time, page_token: page_token, page_size: page_size) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use hash object with options - client.group_assets({ parent: parent, filter: filter, group_by: group_by, compare_duration: compare_duration, read_time: read_time, page_token: page_token, page_size: page_size }, call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object with options - client.group_assets(::Google::Cloud::SecurityCenter::V1::GroupAssetsRequest.new(parent: parent, filter: filter, group_by: group_by, compare_duration: compare_duration, read_time: read_time, page_token: page_token, page_size: page_size), call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Verify method calls - assert_equal 5, group_assets_client_stub.call_count - end - end - end - - def test_group_findings - # Create test objects. - client_result = ::Google::Cloud::SecurityCenter::V1::GroupFindingsResponse.new - http_response = OpenStruct.new body: client_result.to_json - - call_options = {} - - # Create request parameters for a unary method. - parent = "hello world" - filter = "hello world" - group_by = "hello world" - read_time = {} - compare_duration = {} - page_token = "hello world" - page_size = 42 - - group_findings_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| - assert options.metadata.key? :"x-goog-api-client" - assert options.metadata[:"x-goog-api-client"].include? "rest" - refute options.metadata[:"x-goog-api-client"].include? "grpc" - end - - ::Google::Cloud::SecurityCenter::V1::SecurityCenter::Rest::ServiceStub.stub :transcode_group_findings_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, group_findings_client_stub do - # Create client - client = ::Google::Cloud::SecurityCenter::V1::SecurityCenter::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - client.group_findings({ parent: parent, filter: filter, group_by: group_by, read_time: read_time, compare_duration: compare_duration, page_token: page_token, page_size: page_size }) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use named arguments - client.group_findings parent: parent, filter: filter, group_by: group_by, read_time: read_time, compare_duration: compare_duration, page_token: page_token, page_size: page_size do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object - client.group_findings ::Google::Cloud::SecurityCenter::V1::GroupFindingsRequest.new(parent: parent, filter: filter, group_by: group_by, read_time: read_time, compare_duration: compare_duration, page_token: page_token, page_size: page_size) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use hash object with options - client.group_findings({ parent: parent, filter: filter, group_by: group_by, read_time: read_time, compare_duration: compare_duration, page_token: page_token, page_size: page_size }, call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object with options - client.group_findings(::Google::Cloud::SecurityCenter::V1::GroupFindingsRequest.new(parent: parent, filter: filter, group_by: group_by, read_time: read_time, compare_duration: compare_duration, page_token: page_token, page_size: page_size), call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Verify method calls - assert_equal 5, group_findings_client_stub.call_count - end - end - end - - def test_list_assets - # Create test objects. - client_result = ::Google::Cloud::SecurityCenter::V1::ListAssetsResponse.new - http_response = OpenStruct.new body: client_result.to_json - - call_options = {} - - # Create request parameters for a unary method. - parent = "hello world" - filter = "hello world" - order_by = "hello world" - read_time = {} - compare_duration = {} - field_mask = {} - page_token = "hello world" - page_size = 42 - - list_assets_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| - assert options.metadata.key? :"x-goog-api-client" - assert options.metadata[:"x-goog-api-client"].include? "rest" - refute options.metadata[:"x-goog-api-client"].include? "grpc" - end - - ::Google::Cloud::SecurityCenter::V1::SecurityCenter::Rest::ServiceStub.stub :transcode_list_assets_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, list_assets_client_stub do - # Create client - client = ::Google::Cloud::SecurityCenter::V1::SecurityCenter::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - client.list_assets({ parent: parent, filter: filter, order_by: order_by, read_time: read_time, compare_duration: compare_duration, field_mask: field_mask, page_token: page_token, page_size: page_size }) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use named arguments - client.list_assets parent: parent, filter: filter, order_by: order_by, read_time: read_time, compare_duration: compare_duration, field_mask: field_mask, page_token: page_token, page_size: page_size do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object - client.list_assets ::Google::Cloud::SecurityCenter::V1::ListAssetsRequest.new(parent: parent, filter: filter, order_by: order_by, read_time: read_time, compare_duration: compare_duration, field_mask: field_mask, page_token: page_token, page_size: page_size) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use hash object with options - client.list_assets({ parent: parent, filter: filter, order_by: order_by, read_time: read_time, compare_duration: compare_duration, field_mask: field_mask, page_token: page_token, page_size: page_size }, call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object with options - client.list_assets(::Google::Cloud::SecurityCenter::V1::ListAssetsRequest.new(parent: parent, filter: filter, order_by: order_by, read_time: read_time, compare_duration: compare_duration, field_mask: field_mask, page_token: page_token, page_size: page_size), call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Verify method calls - assert_equal 5, list_assets_client_stub.call_count - end - end - end - - def test_list_descendant_security_health_analytics_custom_modules - # Create test objects. - client_result = ::Google::Cloud::SecurityCenter::V1::ListDescendantSecurityHealthAnalyticsCustomModulesResponse.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_descendant_security_health_analytics_custom_modules_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| - assert options.metadata.key? :"x-goog-api-client" - assert options.metadata[:"x-goog-api-client"].include? "rest" - refute options.metadata[:"x-goog-api-client"].include? "grpc" - end - - ::Google::Cloud::SecurityCenter::V1::SecurityCenter::Rest::ServiceStub.stub :transcode_list_descendant_security_health_analytics_custom_modules_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, list_descendant_security_health_analytics_custom_modules_client_stub do - # Create client - client = ::Google::Cloud::SecurityCenter::V1::SecurityCenter::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - client.list_descendant_security_health_analytics_custom_modules({ 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_descendant_security_health_analytics_custom_modules 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_descendant_security_health_analytics_custom_modules ::Google::Cloud::SecurityCenter::V1::ListDescendantSecurityHealthAnalyticsCustomModulesRequest.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_descendant_security_health_analytics_custom_modules({ 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_descendant_security_health_analytics_custom_modules(::Google::Cloud::SecurityCenter::V1::ListDescendantSecurityHealthAnalyticsCustomModulesRequest.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_descendant_security_health_analytics_custom_modules_client_stub.call_count - end - end - end - - def test_list_findings - # Create test objects. - client_result = ::Google::Cloud::SecurityCenter::V1::ListFindingsResponse.new - http_response = OpenStruct.new body: client_result.to_json - - call_options = {} - - # Create request parameters for a unary method. - parent = "hello world" - filter = "hello world" - order_by = "hello world" - read_time = {} - compare_duration = {} - field_mask = {} - page_token = "hello world" - page_size = 42 - - list_findings_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| - assert options.metadata.key? :"x-goog-api-client" - assert options.metadata[:"x-goog-api-client"].include? "rest" - refute options.metadata[:"x-goog-api-client"].include? "grpc" - end - - ::Google::Cloud::SecurityCenter::V1::SecurityCenter::Rest::ServiceStub.stub :transcode_list_findings_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, list_findings_client_stub do - # Create client - client = ::Google::Cloud::SecurityCenter::V1::SecurityCenter::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - client.list_findings({ parent: parent, filter: filter, order_by: order_by, read_time: read_time, compare_duration: compare_duration, field_mask: field_mask, page_token: page_token, page_size: page_size }) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use named arguments - client.list_findings parent: parent, filter: filter, order_by: order_by, read_time: read_time, compare_duration: compare_duration, field_mask: field_mask, page_token: page_token, page_size: page_size do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object - client.list_findings ::Google::Cloud::SecurityCenter::V1::ListFindingsRequest.new(parent: parent, filter: filter, order_by: order_by, read_time: read_time, compare_duration: compare_duration, field_mask: field_mask, page_token: page_token, page_size: page_size) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use hash object with options - client.list_findings({ parent: parent, filter: filter, order_by: order_by, read_time: read_time, compare_duration: compare_duration, field_mask: field_mask, page_token: page_token, page_size: page_size }, call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object with options - client.list_findings(::Google::Cloud::SecurityCenter::V1::ListFindingsRequest.new(parent: parent, filter: filter, order_by: order_by, read_time: read_time, compare_duration: compare_duration, field_mask: field_mask, page_token: page_token, page_size: page_size), call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Verify method calls - assert_equal 5, list_findings_client_stub.call_count - end - end - end - - def test_list_mute_configs - # Create test objects. - client_result = ::Google::Cloud::SecurityCenter::V1::ListMuteConfigsResponse.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_mute_configs_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| - assert options.metadata.key? :"x-goog-api-client" - assert options.metadata[:"x-goog-api-client"].include? "rest" - refute options.metadata[:"x-goog-api-client"].include? "grpc" - end - - ::Google::Cloud::SecurityCenter::V1::SecurityCenter::Rest::ServiceStub.stub :transcode_list_mute_configs_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, list_mute_configs_client_stub do - # Create client - client = ::Google::Cloud::SecurityCenter::V1::SecurityCenter::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - client.list_mute_configs({ 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_mute_configs 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_mute_configs ::Google::Cloud::SecurityCenter::V1::ListMuteConfigsRequest.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_mute_configs({ 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_mute_configs(::Google::Cloud::SecurityCenter::V1::ListMuteConfigsRequest.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_mute_configs_client_stub.call_count - end - end - end - - def test_list_notification_configs - # Create test objects. - client_result = ::Google::Cloud::SecurityCenter::V1::ListNotificationConfigsResponse.new - http_response = OpenStruct.new body: client_result.to_json - - call_options = {} - - # Create request parameters for a unary method. - parent = "hello world" - page_token = "hello world" - page_size = 42 - - list_notification_configs_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| - assert options.metadata.key? :"x-goog-api-client" - assert options.metadata[:"x-goog-api-client"].include? "rest" - refute options.metadata[:"x-goog-api-client"].include? "grpc" - end - - ::Google::Cloud::SecurityCenter::V1::SecurityCenter::Rest::ServiceStub.stub :transcode_list_notification_configs_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, list_notification_configs_client_stub do - # Create client - client = ::Google::Cloud::SecurityCenter::V1::SecurityCenter::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - client.list_notification_configs({ parent: parent, page_token: page_token, page_size: page_size }) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use named arguments - client.list_notification_configs parent: parent, page_token: page_token, page_size: page_size do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object - client.list_notification_configs ::Google::Cloud::SecurityCenter::V1::ListNotificationConfigsRequest.new(parent: parent, page_token: page_token, page_size: page_size) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use hash object with options - client.list_notification_configs({ parent: parent, page_token: page_token, page_size: page_size }, call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object with options - client.list_notification_configs(::Google::Cloud::SecurityCenter::V1::ListNotificationConfigsRequest.new(parent: parent, page_token: page_token, page_size: page_size), call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Verify method calls - assert_equal 5, list_notification_configs_client_stub.call_count - end - end - end - - def test_list_effective_security_health_analytics_custom_modules - # Create test objects. - client_result = ::Google::Cloud::SecurityCenter::V1::ListEffectiveSecurityHealthAnalyticsCustomModulesResponse.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_effective_security_health_analytics_custom_modules_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| - assert options.metadata.key? :"x-goog-api-client" - assert options.metadata[:"x-goog-api-client"].include? "rest" - refute options.metadata[:"x-goog-api-client"].include? "grpc" - end - - ::Google::Cloud::SecurityCenter::V1::SecurityCenter::Rest::ServiceStub.stub :transcode_list_effective_security_health_analytics_custom_modules_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, list_effective_security_health_analytics_custom_modules_client_stub do - # Create client - client = ::Google::Cloud::SecurityCenter::V1::SecurityCenter::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - client.list_effective_security_health_analytics_custom_modules({ 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_effective_security_health_analytics_custom_modules 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_effective_security_health_analytics_custom_modules ::Google::Cloud::SecurityCenter::V1::ListEffectiveSecurityHealthAnalyticsCustomModulesRequest.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_effective_security_health_analytics_custom_modules({ 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_effective_security_health_analytics_custom_modules(::Google::Cloud::SecurityCenter::V1::ListEffectiveSecurityHealthAnalyticsCustomModulesRequest.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_effective_security_health_analytics_custom_modules_client_stub.call_count - end - end - end - - def test_list_security_health_analytics_custom_modules - # Create test objects. - client_result = ::Google::Cloud::SecurityCenter::V1::ListSecurityHealthAnalyticsCustomModulesResponse.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_security_health_analytics_custom_modules_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| - assert options.metadata.key? :"x-goog-api-client" - assert options.metadata[:"x-goog-api-client"].include? "rest" - refute options.metadata[:"x-goog-api-client"].include? "grpc" - end - - ::Google::Cloud::SecurityCenter::V1::SecurityCenter::Rest::ServiceStub.stub :transcode_list_security_health_analytics_custom_modules_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, list_security_health_analytics_custom_modules_client_stub do - # Create client - client = ::Google::Cloud::SecurityCenter::V1::SecurityCenter::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - client.list_security_health_analytics_custom_modules({ 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_security_health_analytics_custom_modules 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_security_health_analytics_custom_modules ::Google::Cloud::SecurityCenter::V1::ListSecurityHealthAnalyticsCustomModulesRequest.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_security_health_analytics_custom_modules({ 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_security_health_analytics_custom_modules(::Google::Cloud::SecurityCenter::V1::ListSecurityHealthAnalyticsCustomModulesRequest.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_security_health_analytics_custom_modules_client_stub.call_count - end - end - end - - def test_list_sources - # Create test objects. - client_result = ::Google::Cloud::SecurityCenter::V1::ListSourcesResponse.new - http_response = OpenStruct.new body: client_result.to_json - - call_options = {} - - # Create request parameters for a unary method. - parent = "hello world" - page_token = "hello world" - page_size = 42 - - list_sources_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| - assert options.metadata.key? :"x-goog-api-client" - assert options.metadata[:"x-goog-api-client"].include? "rest" - refute options.metadata[:"x-goog-api-client"].include? "grpc" - end - - ::Google::Cloud::SecurityCenter::V1::SecurityCenter::Rest::ServiceStub.stub :transcode_list_sources_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, list_sources_client_stub do - # Create client - client = ::Google::Cloud::SecurityCenter::V1::SecurityCenter::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - client.list_sources({ parent: parent, page_token: page_token, page_size: page_size }) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use named arguments - client.list_sources parent: parent, page_token: page_token, page_size: page_size do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object - client.list_sources ::Google::Cloud::SecurityCenter::V1::ListSourcesRequest.new(parent: parent, page_token: page_token, page_size: page_size) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use hash object with options - client.list_sources({ parent: parent, page_token: page_token, page_size: page_size }, call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object with options - client.list_sources(::Google::Cloud::SecurityCenter::V1::ListSourcesRequest.new(parent: parent, page_token: page_token, page_size: page_size), call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Verify method calls - assert_equal 5, list_sources_client_stub.call_count - end - end - end - - def test_run_asset_discovery - # 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" - - run_asset_discovery_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| - assert options.metadata.key? :"x-goog-api-client" - assert options.metadata[:"x-goog-api-client"].include? "rest" - refute options.metadata[:"x-goog-api-client"].include? "grpc" - end - - ::Google::Cloud::SecurityCenter::V1::SecurityCenter::Rest::ServiceStub.stub :transcode_run_asset_discovery_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, run_asset_discovery_client_stub do - # Create client - client = ::Google::Cloud::SecurityCenter::V1::SecurityCenter::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - client.run_asset_discovery({ parent: parent }) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use named arguments - client.run_asset_discovery parent: parent do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object - client.run_asset_discovery ::Google::Cloud::SecurityCenter::V1::RunAssetDiscoveryRequest.new(parent: parent) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use hash object with options - client.run_asset_discovery({ parent: parent }, call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object with options - client.run_asset_discovery(::Google::Cloud::SecurityCenter::V1::RunAssetDiscoveryRequest.new(parent: parent), call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Verify method calls - assert_equal 5, run_asset_discovery_client_stub.call_count - end - end - end - - def test_set_finding_state - # Create test objects. - client_result = ::Google::Cloud::SecurityCenter::V1::Finding.new - http_response = OpenStruct.new body: client_result.to_json - - call_options = {} - - # Create request parameters for a unary method. - name = "hello world" - state = :STATE_UNSPECIFIED - start_time = {} - - set_finding_state_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| - assert options.metadata.key? :"x-goog-api-client" - assert options.metadata[:"x-goog-api-client"].include? "rest" - refute options.metadata[:"x-goog-api-client"].include? "grpc" - end - - ::Google::Cloud::SecurityCenter::V1::SecurityCenter::Rest::ServiceStub.stub :transcode_set_finding_state_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, set_finding_state_client_stub do - # Create client - client = ::Google::Cloud::SecurityCenter::V1::SecurityCenter::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - client.set_finding_state({ name: name, state: state, start_time: start_time }) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use named arguments - client.set_finding_state name: name, state: state, start_time: start_time do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object - client.set_finding_state ::Google::Cloud::SecurityCenter::V1::SetFindingStateRequest.new(name: name, state: state, start_time: start_time) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use hash object with options - client.set_finding_state({ name: name, state: state, start_time: start_time }, call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object with options - client.set_finding_state(::Google::Cloud::SecurityCenter::V1::SetFindingStateRequest.new(name: name, state: state, start_time: start_time), call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Verify method calls - assert_equal 5, set_finding_state_client_stub.call_count - end - end - end - - def test_set_mute - # Create test objects. - client_result = ::Google::Cloud::SecurityCenter::V1::Finding.new - http_response = OpenStruct.new body: client_result.to_json - - call_options = {} - - # Create request parameters for a unary method. - name = "hello world" - mute = :MUTE_UNSPECIFIED - - set_mute_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| - assert options.metadata.key? :"x-goog-api-client" - assert options.metadata[:"x-goog-api-client"].include? "rest" - refute options.metadata[:"x-goog-api-client"].include? "grpc" - end - - ::Google::Cloud::SecurityCenter::V1::SecurityCenter::Rest::ServiceStub.stub :transcode_set_mute_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, set_mute_client_stub do - # Create client - client = ::Google::Cloud::SecurityCenter::V1::SecurityCenter::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - client.set_mute({ name: name, mute: mute }) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use named arguments - client.set_mute name: name, mute: mute do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object - client.set_mute ::Google::Cloud::SecurityCenter::V1::SetMuteRequest.new(name: name, mute: mute) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use hash object with options - client.set_mute({ name: name, mute: mute }, call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object with options - client.set_mute(::Google::Cloud::SecurityCenter::V1::SetMuteRequest.new(name: name, mute: mute), call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Verify method calls - assert_equal 5, set_mute_client_stub.call_count - end - end - end - - def test_set_iam_policy - # Create test objects. - client_result = ::Google::Iam::V1::Policy.new - http_response = OpenStruct.new body: client_result.to_json - - call_options = {} - - # Create request parameters for a unary method. - resource = "hello world" - policy = {} - update_mask = {} - - set_iam_policy_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| - assert options.metadata.key? :"x-goog-api-client" - assert options.metadata[:"x-goog-api-client"].include? "rest" - refute options.metadata[:"x-goog-api-client"].include? "grpc" - end - - ::Google::Cloud::SecurityCenter::V1::SecurityCenter::Rest::ServiceStub.stub :transcode_set_iam_policy_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, set_iam_policy_client_stub do - # Create client - client = ::Google::Cloud::SecurityCenter::V1::SecurityCenter::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - client.set_iam_policy({ resource: resource, policy: policy, update_mask: update_mask }) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use named arguments - client.set_iam_policy resource: resource, policy: policy, update_mask: update_mask do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object - client.set_iam_policy ::Google::Iam::V1::SetIamPolicyRequest.new(resource: resource, policy: policy, update_mask: update_mask) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use hash object with options - client.set_iam_policy({ resource: resource, policy: policy, update_mask: update_mask }, call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object with options - client.set_iam_policy(::Google::Iam::V1::SetIamPolicyRequest.new(resource: resource, policy: policy, update_mask: update_mask), call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Verify method calls - assert_equal 5, set_iam_policy_client_stub.call_count - end - end - end - - def test_test_iam_permissions - # Create test objects. - client_result = ::Google::Iam::V1::TestIamPermissionsResponse.new - http_response = OpenStruct.new body: client_result.to_json - - call_options = {} - - # Create request parameters for a unary method. - resource = "hello world" - permissions = ["hello world"] - - test_iam_permissions_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| - assert options.metadata.key? :"x-goog-api-client" - assert options.metadata[:"x-goog-api-client"].include? "rest" - refute options.metadata[:"x-goog-api-client"].include? "grpc" - end - - ::Google::Cloud::SecurityCenter::V1::SecurityCenter::Rest::ServiceStub.stub :transcode_test_iam_permissions_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, test_iam_permissions_client_stub do - # Create client - client = ::Google::Cloud::SecurityCenter::V1::SecurityCenter::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - client.test_iam_permissions({ resource: resource, permissions: permissions }) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use named arguments - client.test_iam_permissions resource: resource, permissions: permissions do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object - client.test_iam_permissions ::Google::Iam::V1::TestIamPermissionsRequest.new(resource: resource, permissions: permissions) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use hash object with options - client.test_iam_permissions({ resource: resource, permissions: permissions }, call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object with options - client.test_iam_permissions(::Google::Iam::V1::TestIamPermissionsRequest.new(resource: resource, permissions: permissions), call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Verify method calls - assert_equal 5, test_iam_permissions_client_stub.call_count - end - end - end - - def test_simulate_security_health_analytics_custom_module - # Create test objects. - client_result = ::Google::Cloud::SecurityCenter::V1::SimulateSecurityHealthAnalyticsCustomModuleResponse.new - http_response = OpenStruct.new body: client_result.to_json - - call_options = {} - - # Create request parameters for a unary method. - parent = "hello world" - custom_config = {} - resource = {} - - simulate_security_health_analytics_custom_module_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| - assert options.metadata.key? :"x-goog-api-client" - assert options.metadata[:"x-goog-api-client"].include? "rest" - refute options.metadata[:"x-goog-api-client"].include? "grpc" - end - - ::Google::Cloud::SecurityCenter::V1::SecurityCenter::Rest::ServiceStub.stub :transcode_simulate_security_health_analytics_custom_module_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, simulate_security_health_analytics_custom_module_client_stub do - # Create client - client = ::Google::Cloud::SecurityCenter::V1::SecurityCenter::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - client.simulate_security_health_analytics_custom_module({ parent: parent, custom_config: custom_config, resource: resource }) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use named arguments - client.simulate_security_health_analytics_custom_module parent: parent, custom_config: custom_config, resource: resource do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object - client.simulate_security_health_analytics_custom_module ::Google::Cloud::SecurityCenter::V1::SimulateSecurityHealthAnalyticsCustomModuleRequest.new(parent: parent, custom_config: custom_config, resource: resource) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use hash object with options - client.simulate_security_health_analytics_custom_module({ parent: parent, custom_config: custom_config, resource: resource }, call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object with options - client.simulate_security_health_analytics_custom_module(::Google::Cloud::SecurityCenter::V1::SimulateSecurityHealthAnalyticsCustomModuleRequest.new(parent: parent, custom_config: custom_config, resource: resource), call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Verify method calls - assert_equal 5, simulate_security_health_analytics_custom_module_client_stub.call_count - end - end - end - - def test_update_external_system - # Create test objects. - client_result = ::Google::Cloud::SecurityCenter::V1::ExternalSystem.new - http_response = OpenStruct.new body: client_result.to_json - - call_options = {} - - # Create request parameters for a unary method. - external_system = {} - update_mask = {} - - update_external_system_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| - assert options.metadata.key? :"x-goog-api-client" - assert options.metadata[:"x-goog-api-client"].include? "rest" - refute options.metadata[:"x-goog-api-client"].include? "grpc" - end - - ::Google::Cloud::SecurityCenter::V1::SecurityCenter::Rest::ServiceStub.stub :transcode_update_external_system_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, update_external_system_client_stub do - # Create client - client = ::Google::Cloud::SecurityCenter::V1::SecurityCenter::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - client.update_external_system({ external_system: external_system, update_mask: update_mask }) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use named arguments - client.update_external_system external_system: external_system, update_mask: update_mask do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object - client.update_external_system ::Google::Cloud::SecurityCenter::V1::UpdateExternalSystemRequest.new(external_system: external_system, update_mask: update_mask) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use hash object with options - client.update_external_system({ external_system: external_system, update_mask: update_mask }, call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object with options - client.update_external_system(::Google::Cloud::SecurityCenter::V1::UpdateExternalSystemRequest.new(external_system: external_system, update_mask: update_mask), call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Verify method calls - assert_equal 5, update_external_system_client_stub.call_count - end - end - end - - def test_update_finding - # Create test objects. - client_result = ::Google::Cloud::SecurityCenter::V1::Finding.new - http_response = OpenStruct.new body: client_result.to_json - - call_options = {} - - # Create request parameters for a unary method. - finding = {} - update_mask = {} - - update_finding_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| - assert options.metadata.key? :"x-goog-api-client" - assert options.metadata[:"x-goog-api-client"].include? "rest" - refute options.metadata[:"x-goog-api-client"].include? "grpc" - end - - ::Google::Cloud::SecurityCenter::V1::SecurityCenter::Rest::ServiceStub.stub :transcode_update_finding_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, update_finding_client_stub do - # Create client - client = ::Google::Cloud::SecurityCenter::V1::SecurityCenter::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - client.update_finding({ finding: finding, update_mask: update_mask }) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use named arguments - client.update_finding finding: finding, update_mask: update_mask do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object - client.update_finding ::Google::Cloud::SecurityCenter::V1::UpdateFindingRequest.new(finding: finding, update_mask: update_mask) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use hash object with options - client.update_finding({ finding: finding, update_mask: update_mask }, call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object with options - client.update_finding(::Google::Cloud::SecurityCenter::V1::UpdateFindingRequest.new(finding: finding, update_mask: update_mask), call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Verify method calls - assert_equal 5, update_finding_client_stub.call_count - end - end - end - - def test_update_mute_config - # Create test objects. - client_result = ::Google::Cloud::SecurityCenter::V1::MuteConfig.new - http_response = OpenStruct.new body: client_result.to_json - - call_options = {} - - # Create request parameters for a unary method. - mute_config = {} - update_mask = {} - - update_mute_config_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| - assert options.metadata.key? :"x-goog-api-client" - assert options.metadata[:"x-goog-api-client"].include? "rest" - refute options.metadata[:"x-goog-api-client"].include? "grpc" - end - - ::Google::Cloud::SecurityCenter::V1::SecurityCenter::Rest::ServiceStub.stub :transcode_update_mute_config_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, update_mute_config_client_stub do - # Create client - client = ::Google::Cloud::SecurityCenter::V1::SecurityCenter::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - client.update_mute_config({ mute_config: mute_config, update_mask: update_mask }) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use named arguments - client.update_mute_config mute_config: mute_config, update_mask: update_mask do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object - client.update_mute_config ::Google::Cloud::SecurityCenter::V1::UpdateMuteConfigRequest.new(mute_config: mute_config, update_mask: update_mask) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use hash object with options - client.update_mute_config({ mute_config: mute_config, update_mask: update_mask }, call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object with options - client.update_mute_config(::Google::Cloud::SecurityCenter::V1::UpdateMuteConfigRequest.new(mute_config: mute_config, update_mask: update_mask), call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Verify method calls - assert_equal 5, update_mute_config_client_stub.call_count - end - end - end - - def test_update_notification_config - # Create test objects. - client_result = ::Google::Cloud::SecurityCenter::V1::NotificationConfig.new - http_response = OpenStruct.new body: client_result.to_json - - call_options = {} - - # Create request parameters for a unary method. - notification_config = {} - update_mask = {} - - update_notification_config_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| - assert options.metadata.key? :"x-goog-api-client" - assert options.metadata[:"x-goog-api-client"].include? "rest" - refute options.metadata[:"x-goog-api-client"].include? "grpc" - end - - ::Google::Cloud::SecurityCenter::V1::SecurityCenter::Rest::ServiceStub.stub :transcode_update_notification_config_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, update_notification_config_client_stub do - # Create client - client = ::Google::Cloud::SecurityCenter::V1::SecurityCenter::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - client.update_notification_config({ notification_config: notification_config, update_mask: update_mask }) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use named arguments - client.update_notification_config notification_config: notification_config, update_mask: update_mask do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object - client.update_notification_config ::Google::Cloud::SecurityCenter::V1::UpdateNotificationConfigRequest.new(notification_config: notification_config, update_mask: update_mask) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use hash object with options - client.update_notification_config({ notification_config: notification_config, update_mask: update_mask }, call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object with options - client.update_notification_config(::Google::Cloud::SecurityCenter::V1::UpdateNotificationConfigRequest.new(notification_config: notification_config, update_mask: update_mask), call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Verify method calls - assert_equal 5, update_notification_config_client_stub.call_count - end - end - end - - def test_update_organization_settings - # Create test objects. - client_result = ::Google::Cloud::SecurityCenter::V1::OrganizationSettings.new - http_response = OpenStruct.new body: client_result.to_json - - call_options = {} - - # Create request parameters for a unary method. - organization_settings = {} - update_mask = {} - - update_organization_settings_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| - assert options.metadata.key? :"x-goog-api-client" - assert options.metadata[:"x-goog-api-client"].include? "rest" - refute options.metadata[:"x-goog-api-client"].include? "grpc" - end - - ::Google::Cloud::SecurityCenter::V1::SecurityCenter::Rest::ServiceStub.stub :transcode_update_organization_settings_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, update_organization_settings_client_stub do - # Create client - client = ::Google::Cloud::SecurityCenter::V1::SecurityCenter::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - client.update_organization_settings({ organization_settings: organization_settings, update_mask: update_mask }) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use named arguments - client.update_organization_settings organization_settings: organization_settings, update_mask: update_mask do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object - client.update_organization_settings ::Google::Cloud::SecurityCenter::V1::UpdateOrganizationSettingsRequest.new(organization_settings: organization_settings, update_mask: update_mask) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use hash object with options - client.update_organization_settings({ organization_settings: organization_settings, update_mask: update_mask }, call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object with options - client.update_organization_settings(::Google::Cloud::SecurityCenter::V1::UpdateOrganizationSettingsRequest.new(organization_settings: organization_settings, update_mask: update_mask), call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Verify method calls - assert_equal 5, update_organization_settings_client_stub.call_count - end - end - end - - def test_update_security_health_analytics_custom_module - # Create test objects. - client_result = ::Google::Cloud::SecurityCenter::V1::SecurityHealthAnalyticsCustomModule.new - http_response = OpenStruct.new body: client_result.to_json - - call_options = {} - - # Create request parameters for a unary method. - security_health_analytics_custom_module = {} - update_mask = {} - - update_security_health_analytics_custom_module_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| - assert options.metadata.key? :"x-goog-api-client" - assert options.metadata[:"x-goog-api-client"].include? "rest" - refute options.metadata[:"x-goog-api-client"].include? "grpc" - end - - ::Google::Cloud::SecurityCenter::V1::SecurityCenter::Rest::ServiceStub.stub :transcode_update_security_health_analytics_custom_module_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, update_security_health_analytics_custom_module_client_stub do - # Create client - client = ::Google::Cloud::SecurityCenter::V1::SecurityCenter::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - client.update_security_health_analytics_custom_module({ security_health_analytics_custom_module: security_health_analytics_custom_module, update_mask: update_mask }) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use named arguments - client.update_security_health_analytics_custom_module security_health_analytics_custom_module: security_health_analytics_custom_module, update_mask: update_mask do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object - client.update_security_health_analytics_custom_module ::Google::Cloud::SecurityCenter::V1::UpdateSecurityHealthAnalyticsCustomModuleRequest.new(security_health_analytics_custom_module: security_health_analytics_custom_module, update_mask: update_mask) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use hash object with options - client.update_security_health_analytics_custom_module({ security_health_analytics_custom_module: security_health_analytics_custom_module, update_mask: update_mask }, call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object with options - client.update_security_health_analytics_custom_module(::Google::Cloud::SecurityCenter::V1::UpdateSecurityHealthAnalyticsCustomModuleRequest.new(security_health_analytics_custom_module: security_health_analytics_custom_module, update_mask: update_mask), call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Verify method calls - assert_equal 5, update_security_health_analytics_custom_module_client_stub.call_count - end - end - end - - def test_update_source - # Create test objects. - client_result = ::Google::Cloud::SecurityCenter::V1::Source.new - http_response = OpenStruct.new body: client_result.to_json - - call_options = {} - - # Create request parameters for a unary method. - source = {} - update_mask = {} - - update_source_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| - assert options.metadata.key? :"x-goog-api-client" - assert options.metadata[:"x-goog-api-client"].include? "rest" - refute options.metadata[:"x-goog-api-client"].include? "grpc" - end - - ::Google::Cloud::SecurityCenter::V1::SecurityCenter::Rest::ServiceStub.stub :transcode_update_source_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, update_source_client_stub do - # Create client - client = ::Google::Cloud::SecurityCenter::V1::SecurityCenter::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - client.update_source({ source: source, update_mask: update_mask }) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use named arguments - client.update_source source: source, update_mask: update_mask do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object - client.update_source ::Google::Cloud::SecurityCenter::V1::UpdateSourceRequest.new(source: source, update_mask: update_mask) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use hash object with options - client.update_source({ source: source, update_mask: update_mask }, call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object with options - client.update_source(::Google::Cloud::SecurityCenter::V1::UpdateSourceRequest.new(source: source, update_mask: update_mask), call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Verify method calls - assert_equal 5, update_source_client_stub.call_count - end - end - end - - def test_update_security_marks - # Create test objects. - client_result = ::Google::Cloud::SecurityCenter::V1::SecurityMarks.new - http_response = OpenStruct.new body: client_result.to_json - - call_options = {} - - # Create request parameters for a unary method. - security_marks = {} - update_mask = {} - start_time = {} - - update_security_marks_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| - assert options.metadata.key? :"x-goog-api-client" - assert options.metadata[:"x-goog-api-client"].include? "rest" - refute options.metadata[:"x-goog-api-client"].include? "grpc" - end - - ::Google::Cloud::SecurityCenter::V1::SecurityCenter::Rest::ServiceStub.stub :transcode_update_security_marks_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, update_security_marks_client_stub do - # Create client - client = ::Google::Cloud::SecurityCenter::V1::SecurityCenter::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - client.update_security_marks({ security_marks: security_marks, update_mask: update_mask, start_time: start_time }) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use named arguments - client.update_security_marks security_marks: security_marks, update_mask: update_mask, start_time: start_time do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object - client.update_security_marks ::Google::Cloud::SecurityCenter::V1::UpdateSecurityMarksRequest.new(security_marks: security_marks, update_mask: update_mask, start_time: start_time) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use hash object with options - client.update_security_marks({ security_marks: security_marks, update_mask: update_mask, start_time: start_time }, call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object with options - client.update_security_marks(::Google::Cloud::SecurityCenter::V1::UpdateSecurityMarksRequest.new(security_marks: security_marks, update_mask: update_mask, start_time: start_time), call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Verify method calls - assert_equal 5, update_security_marks_client_stub.call_count - end - end - end - - def test_create_big_query_export - # Create test objects. - client_result = ::Google::Cloud::SecurityCenter::V1::BigQueryExport.new - http_response = OpenStruct.new body: client_result.to_json - - call_options = {} - - # Create request parameters for a unary method. - parent = "hello world" - big_query_export = {} - big_query_export_id = "hello world" - - create_big_query_export_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| - assert options.metadata.key? :"x-goog-api-client" - assert options.metadata[:"x-goog-api-client"].include? "rest" - refute options.metadata[:"x-goog-api-client"].include? "grpc" - end - - ::Google::Cloud::SecurityCenter::V1::SecurityCenter::Rest::ServiceStub.stub :transcode_create_big_query_export_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, create_big_query_export_client_stub do - # Create client - client = ::Google::Cloud::SecurityCenter::V1::SecurityCenter::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - client.create_big_query_export({ parent: parent, big_query_export: big_query_export, big_query_export_id: big_query_export_id }) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use named arguments - client.create_big_query_export parent: parent, big_query_export: big_query_export, big_query_export_id: big_query_export_id do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object - client.create_big_query_export ::Google::Cloud::SecurityCenter::V1::CreateBigQueryExportRequest.new(parent: parent, big_query_export: big_query_export, big_query_export_id: big_query_export_id) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use hash object with options - client.create_big_query_export({ parent: parent, big_query_export: big_query_export, big_query_export_id: big_query_export_id }, call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object with options - client.create_big_query_export(::Google::Cloud::SecurityCenter::V1::CreateBigQueryExportRequest.new(parent: parent, big_query_export: big_query_export, big_query_export_id: big_query_export_id), call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Verify method calls - assert_equal 5, create_big_query_export_client_stub.call_count - end - end - end - - def test_delete_big_query_export - # Create test objects. - client_result = ::Google::Protobuf::Empty.new - http_response = OpenStruct.new body: client_result.to_json - - call_options = {} - - # Create request parameters for a unary method. - name = "hello world" - - delete_big_query_export_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| - assert options.metadata.key? :"x-goog-api-client" - assert options.metadata[:"x-goog-api-client"].include? "rest" - refute options.metadata[:"x-goog-api-client"].include? "grpc" - end - - ::Google::Cloud::SecurityCenter::V1::SecurityCenter::Rest::ServiceStub.stub :transcode_delete_big_query_export_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, delete_big_query_export_client_stub do - # Create client - client = ::Google::Cloud::SecurityCenter::V1::SecurityCenter::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - client.delete_big_query_export({ name: name }) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use named arguments - client.delete_big_query_export name: name do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object - client.delete_big_query_export ::Google::Cloud::SecurityCenter::V1::DeleteBigQueryExportRequest.new(name: name) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use hash object with options - client.delete_big_query_export({ name: name }, call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object with options - client.delete_big_query_export(::Google::Cloud::SecurityCenter::V1::DeleteBigQueryExportRequest.new(name: name), call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Verify method calls - assert_equal 5, delete_big_query_export_client_stub.call_count - end - end - end - - def test_update_big_query_export - # Create test objects. - client_result = ::Google::Cloud::SecurityCenter::V1::BigQueryExport.new - http_response = OpenStruct.new body: client_result.to_json - - call_options = {} - - # Create request parameters for a unary method. - big_query_export = {} - update_mask = {} - - update_big_query_export_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| - assert options.metadata.key? :"x-goog-api-client" - assert options.metadata[:"x-goog-api-client"].include? "rest" - refute options.metadata[:"x-goog-api-client"].include? "grpc" - end - - ::Google::Cloud::SecurityCenter::V1::SecurityCenter::Rest::ServiceStub.stub :transcode_update_big_query_export_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, update_big_query_export_client_stub do - # Create client - client = ::Google::Cloud::SecurityCenter::V1::SecurityCenter::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - client.update_big_query_export({ big_query_export: big_query_export, update_mask: update_mask }) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use named arguments - client.update_big_query_export big_query_export: big_query_export, update_mask: update_mask do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object - client.update_big_query_export ::Google::Cloud::SecurityCenter::V1::UpdateBigQueryExportRequest.new(big_query_export: big_query_export, update_mask: update_mask) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use hash object with options - client.update_big_query_export({ big_query_export: big_query_export, update_mask: update_mask }, call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object with options - client.update_big_query_export(::Google::Cloud::SecurityCenter::V1::UpdateBigQueryExportRequest.new(big_query_export: big_query_export, update_mask: update_mask), call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Verify method calls - assert_equal 5, update_big_query_export_client_stub.call_count - end - end - end - - def test_list_big_query_exports - # Create test objects. - client_result = ::Google::Cloud::SecurityCenter::V1::ListBigQueryExportsResponse.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_big_query_exports_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| - assert options.metadata.key? :"x-goog-api-client" - assert options.metadata[:"x-goog-api-client"].include? "rest" - refute options.metadata[:"x-goog-api-client"].include? "grpc" - end - - ::Google::Cloud::SecurityCenter::V1::SecurityCenter::Rest::ServiceStub.stub :transcode_list_big_query_exports_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, list_big_query_exports_client_stub do - # Create client - client = ::Google::Cloud::SecurityCenter::V1::SecurityCenter::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - client.list_big_query_exports({ 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_big_query_exports 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_big_query_exports ::Google::Cloud::SecurityCenter::V1::ListBigQueryExportsRequest.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_big_query_exports({ 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_big_query_exports(::Google::Cloud::SecurityCenter::V1::ListBigQueryExportsRequest.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_big_query_exports_client_stub.call_count - end - end - end - - def test_create_event_threat_detection_custom_module - # Create test objects. - client_result = ::Google::Cloud::SecurityCenter::V1::EventThreatDetectionCustomModule.new - http_response = OpenStruct.new body: client_result.to_json - - call_options = {} - - # Create request parameters for a unary method. - parent = "hello world" - event_threat_detection_custom_module = {} - - create_event_threat_detection_custom_module_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| - assert options.metadata.key? :"x-goog-api-client" - assert options.metadata[:"x-goog-api-client"].include? "rest" - refute options.metadata[:"x-goog-api-client"].include? "grpc" - end - - ::Google::Cloud::SecurityCenter::V1::SecurityCenter::Rest::ServiceStub.stub :transcode_create_event_threat_detection_custom_module_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, create_event_threat_detection_custom_module_client_stub do - # Create client - client = ::Google::Cloud::SecurityCenter::V1::SecurityCenter::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - client.create_event_threat_detection_custom_module({ parent: parent, event_threat_detection_custom_module: event_threat_detection_custom_module }) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use named arguments - client.create_event_threat_detection_custom_module parent: parent, event_threat_detection_custom_module: event_threat_detection_custom_module do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object - client.create_event_threat_detection_custom_module ::Google::Cloud::SecurityCenter::V1::CreateEventThreatDetectionCustomModuleRequest.new(parent: parent, event_threat_detection_custom_module: event_threat_detection_custom_module) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use hash object with options - client.create_event_threat_detection_custom_module({ parent: parent, event_threat_detection_custom_module: event_threat_detection_custom_module }, call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object with options - client.create_event_threat_detection_custom_module(::Google::Cloud::SecurityCenter::V1::CreateEventThreatDetectionCustomModuleRequest.new(parent: parent, event_threat_detection_custom_module: event_threat_detection_custom_module), call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Verify method calls - assert_equal 5, create_event_threat_detection_custom_module_client_stub.call_count - end - end - end - - def test_delete_event_threat_detection_custom_module - # Create test objects. - client_result = ::Google::Protobuf::Empty.new - http_response = OpenStruct.new body: client_result.to_json - - call_options = {} - - # Create request parameters for a unary method. - name = "hello world" - - delete_event_threat_detection_custom_module_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| - assert options.metadata.key? :"x-goog-api-client" - assert options.metadata[:"x-goog-api-client"].include? "rest" - refute options.metadata[:"x-goog-api-client"].include? "grpc" - end - - ::Google::Cloud::SecurityCenter::V1::SecurityCenter::Rest::ServiceStub.stub :transcode_delete_event_threat_detection_custom_module_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, delete_event_threat_detection_custom_module_client_stub do - # Create client - client = ::Google::Cloud::SecurityCenter::V1::SecurityCenter::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - client.delete_event_threat_detection_custom_module({ name: name }) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use named arguments - client.delete_event_threat_detection_custom_module name: name do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object - client.delete_event_threat_detection_custom_module ::Google::Cloud::SecurityCenter::V1::DeleteEventThreatDetectionCustomModuleRequest.new(name: name) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use hash object with options - client.delete_event_threat_detection_custom_module({ name: name }, call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object with options - client.delete_event_threat_detection_custom_module(::Google::Cloud::SecurityCenter::V1::DeleteEventThreatDetectionCustomModuleRequest.new(name: name), call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Verify method calls - assert_equal 5, delete_event_threat_detection_custom_module_client_stub.call_count - end - end - end - - def test_get_event_threat_detection_custom_module - # Create test objects. - client_result = ::Google::Cloud::SecurityCenter::V1::EventThreatDetectionCustomModule.new - http_response = OpenStruct.new body: client_result.to_json - - call_options = {} - - # Create request parameters for a unary method. - name = "hello world" - - get_event_threat_detection_custom_module_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| - assert options.metadata.key? :"x-goog-api-client" - assert options.metadata[:"x-goog-api-client"].include? "rest" - refute options.metadata[:"x-goog-api-client"].include? "grpc" - end - - ::Google::Cloud::SecurityCenter::V1::SecurityCenter::Rest::ServiceStub.stub :transcode_get_event_threat_detection_custom_module_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, get_event_threat_detection_custom_module_client_stub do - # Create client - client = ::Google::Cloud::SecurityCenter::V1::SecurityCenter::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - client.get_event_threat_detection_custom_module({ name: name }) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use named arguments - client.get_event_threat_detection_custom_module name: name do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object - client.get_event_threat_detection_custom_module ::Google::Cloud::SecurityCenter::V1::GetEventThreatDetectionCustomModuleRequest.new(name: name) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use hash object with options - client.get_event_threat_detection_custom_module({ name: name }, call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object with options - client.get_event_threat_detection_custom_module(::Google::Cloud::SecurityCenter::V1::GetEventThreatDetectionCustomModuleRequest.new(name: name), call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Verify method calls - assert_equal 5, get_event_threat_detection_custom_module_client_stub.call_count - end - end - end - - def test_list_descendant_event_threat_detection_custom_modules - # Create test objects. - client_result = ::Google::Cloud::SecurityCenter::V1::ListDescendantEventThreatDetectionCustomModulesResponse.new - http_response = OpenStruct.new body: client_result.to_json - - call_options = {} - - # Create request parameters for a unary method. - parent = "hello world" - page_token = "hello world" - page_size = 42 - - list_descendant_event_threat_detection_custom_modules_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| - assert options.metadata.key? :"x-goog-api-client" - assert options.metadata[:"x-goog-api-client"].include? "rest" - refute options.metadata[:"x-goog-api-client"].include? "grpc" - end - - ::Google::Cloud::SecurityCenter::V1::SecurityCenter::Rest::ServiceStub.stub :transcode_list_descendant_event_threat_detection_custom_modules_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, list_descendant_event_threat_detection_custom_modules_client_stub do - # Create client - client = ::Google::Cloud::SecurityCenter::V1::SecurityCenter::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - client.list_descendant_event_threat_detection_custom_modules({ parent: parent, page_token: page_token, page_size: page_size }) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use named arguments - client.list_descendant_event_threat_detection_custom_modules parent: parent, page_token: page_token, page_size: page_size do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object - client.list_descendant_event_threat_detection_custom_modules ::Google::Cloud::SecurityCenter::V1::ListDescendantEventThreatDetectionCustomModulesRequest.new(parent: parent, page_token: page_token, page_size: page_size) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use hash object with options - client.list_descendant_event_threat_detection_custom_modules({ parent: parent, page_token: page_token, page_size: page_size }, call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object with options - client.list_descendant_event_threat_detection_custom_modules(::Google::Cloud::SecurityCenter::V1::ListDescendantEventThreatDetectionCustomModulesRequest.new(parent: parent, page_token: page_token, page_size: page_size), call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Verify method calls - assert_equal 5, list_descendant_event_threat_detection_custom_modules_client_stub.call_count - end - end - end - - def test_list_event_threat_detection_custom_modules - # Create test objects. - client_result = ::Google::Cloud::SecurityCenter::V1::ListEventThreatDetectionCustomModulesResponse.new - http_response = OpenStruct.new body: client_result.to_json - - call_options = {} - - # Create request parameters for a unary method. - parent = "hello world" - page_token = "hello world" - page_size = 42 - - list_event_threat_detection_custom_modules_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| - assert options.metadata.key? :"x-goog-api-client" - assert options.metadata[:"x-goog-api-client"].include? "rest" - refute options.metadata[:"x-goog-api-client"].include? "grpc" - end - - ::Google::Cloud::SecurityCenter::V1::SecurityCenter::Rest::ServiceStub.stub :transcode_list_event_threat_detection_custom_modules_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, list_event_threat_detection_custom_modules_client_stub do - # Create client - client = ::Google::Cloud::SecurityCenter::V1::SecurityCenter::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - client.list_event_threat_detection_custom_modules({ parent: parent, page_token: page_token, page_size: page_size }) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use named arguments - client.list_event_threat_detection_custom_modules parent: parent, page_token: page_token, page_size: page_size do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object - client.list_event_threat_detection_custom_modules ::Google::Cloud::SecurityCenter::V1::ListEventThreatDetectionCustomModulesRequest.new(parent: parent, page_token: page_token, page_size: page_size) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use hash object with options - client.list_event_threat_detection_custom_modules({ parent: parent, page_token: page_token, page_size: page_size }, call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object with options - client.list_event_threat_detection_custom_modules(::Google::Cloud::SecurityCenter::V1::ListEventThreatDetectionCustomModulesRequest.new(parent: parent, page_token: page_token, page_size: page_size), call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Verify method calls - assert_equal 5, list_event_threat_detection_custom_modules_client_stub.call_count - end - end - end - - def test_update_event_threat_detection_custom_module - # Create test objects. - client_result = ::Google::Cloud::SecurityCenter::V1::EventThreatDetectionCustomModule.new - http_response = OpenStruct.new body: client_result.to_json - - call_options = {} - - # Create request parameters for a unary method. - event_threat_detection_custom_module = {} - update_mask = {} - - update_event_threat_detection_custom_module_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| - assert options.metadata.key? :"x-goog-api-client" - assert options.metadata[:"x-goog-api-client"].include? "rest" - refute options.metadata[:"x-goog-api-client"].include? "grpc" - end - - ::Google::Cloud::SecurityCenter::V1::SecurityCenter::Rest::ServiceStub.stub :transcode_update_event_threat_detection_custom_module_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, update_event_threat_detection_custom_module_client_stub do - # Create client - client = ::Google::Cloud::SecurityCenter::V1::SecurityCenter::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - client.update_event_threat_detection_custom_module({ event_threat_detection_custom_module: event_threat_detection_custom_module, update_mask: update_mask }) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use named arguments - client.update_event_threat_detection_custom_module event_threat_detection_custom_module: event_threat_detection_custom_module, update_mask: update_mask do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object - client.update_event_threat_detection_custom_module ::Google::Cloud::SecurityCenter::V1::UpdateEventThreatDetectionCustomModuleRequest.new(event_threat_detection_custom_module: event_threat_detection_custom_module, update_mask: update_mask) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use hash object with options - client.update_event_threat_detection_custom_module({ event_threat_detection_custom_module: event_threat_detection_custom_module, update_mask: update_mask }, call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object with options - client.update_event_threat_detection_custom_module(::Google::Cloud::SecurityCenter::V1::UpdateEventThreatDetectionCustomModuleRequest.new(event_threat_detection_custom_module: event_threat_detection_custom_module, update_mask: update_mask), call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Verify method calls - assert_equal 5, update_event_threat_detection_custom_module_client_stub.call_count - end - end - end - - def test_validate_event_threat_detection_custom_module - # Create test objects. - client_result = ::Google::Cloud::SecurityCenter::V1::ValidateEventThreatDetectionCustomModuleResponse.new - http_response = OpenStruct.new body: client_result.to_json - - call_options = {} - - # Create request parameters for a unary method. - parent = "hello world" - raw_text = "hello world" - type = "hello world" - - validate_event_threat_detection_custom_module_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| - assert options.metadata.key? :"x-goog-api-client" - assert options.metadata[:"x-goog-api-client"].include? "rest" - refute options.metadata[:"x-goog-api-client"].include? "grpc" - end - - ::Google::Cloud::SecurityCenter::V1::SecurityCenter::Rest::ServiceStub.stub :transcode_validate_event_threat_detection_custom_module_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, validate_event_threat_detection_custom_module_client_stub do - # Create client - client = ::Google::Cloud::SecurityCenter::V1::SecurityCenter::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - client.validate_event_threat_detection_custom_module({ parent: parent, raw_text: raw_text, type: type }) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use named arguments - client.validate_event_threat_detection_custom_module parent: parent, raw_text: raw_text, type: type do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object - client.validate_event_threat_detection_custom_module ::Google::Cloud::SecurityCenter::V1::ValidateEventThreatDetectionCustomModuleRequest.new(parent: parent, raw_text: raw_text, type: type) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use hash object with options - client.validate_event_threat_detection_custom_module({ parent: parent, raw_text: raw_text, type: type }, call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object with options - client.validate_event_threat_detection_custom_module(::Google::Cloud::SecurityCenter::V1::ValidateEventThreatDetectionCustomModuleRequest.new(parent: parent, raw_text: raw_text, type: type), call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Verify method calls - assert_equal 5, validate_event_threat_detection_custom_module_client_stub.call_count - end - end - end - - def test_get_effective_event_threat_detection_custom_module - # Create test objects. - client_result = ::Google::Cloud::SecurityCenter::V1::EffectiveEventThreatDetectionCustomModule.new - http_response = OpenStruct.new body: client_result.to_json - - call_options = {} - - # Create request parameters for a unary method. - name = "hello world" - - get_effective_event_threat_detection_custom_module_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| - assert options.metadata.key? :"x-goog-api-client" - assert options.metadata[:"x-goog-api-client"].include? "rest" - refute options.metadata[:"x-goog-api-client"].include? "grpc" - end - - ::Google::Cloud::SecurityCenter::V1::SecurityCenter::Rest::ServiceStub.stub :transcode_get_effective_event_threat_detection_custom_module_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, get_effective_event_threat_detection_custom_module_client_stub do - # Create client - client = ::Google::Cloud::SecurityCenter::V1::SecurityCenter::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - client.get_effective_event_threat_detection_custom_module({ name: name }) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use named arguments - client.get_effective_event_threat_detection_custom_module name: name do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object - client.get_effective_event_threat_detection_custom_module ::Google::Cloud::SecurityCenter::V1::GetEffectiveEventThreatDetectionCustomModuleRequest.new(name: name) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use hash object with options - client.get_effective_event_threat_detection_custom_module({ name: name }, call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object with options - client.get_effective_event_threat_detection_custom_module(::Google::Cloud::SecurityCenter::V1::GetEffectiveEventThreatDetectionCustomModuleRequest.new(name: name), call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Verify method calls - assert_equal 5, get_effective_event_threat_detection_custom_module_client_stub.call_count - end - end - end - - def test_list_effective_event_threat_detection_custom_modules - # Create test objects. - client_result = ::Google::Cloud::SecurityCenter::V1::ListEffectiveEventThreatDetectionCustomModulesResponse.new - http_response = OpenStruct.new body: client_result.to_json - - call_options = {} - - # Create request parameters for a unary method. - parent = "hello world" - page_token = "hello world" - page_size = 42 - - list_effective_event_threat_detection_custom_modules_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| - assert options.metadata.key? :"x-goog-api-client" - assert options.metadata[:"x-goog-api-client"].include? "rest" - refute options.metadata[:"x-goog-api-client"].include? "grpc" - end - - ::Google::Cloud::SecurityCenter::V1::SecurityCenter::Rest::ServiceStub.stub :transcode_list_effective_event_threat_detection_custom_modules_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, list_effective_event_threat_detection_custom_modules_client_stub do - # Create client - client = ::Google::Cloud::SecurityCenter::V1::SecurityCenter::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - client.list_effective_event_threat_detection_custom_modules({ parent: parent, page_token: page_token, page_size: page_size }) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use named arguments - client.list_effective_event_threat_detection_custom_modules parent: parent, page_token: page_token, page_size: page_size do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object - client.list_effective_event_threat_detection_custom_modules ::Google::Cloud::SecurityCenter::V1::ListEffectiveEventThreatDetectionCustomModulesRequest.new(parent: parent, page_token: page_token, page_size: page_size) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use hash object with options - client.list_effective_event_threat_detection_custom_modules({ parent: parent, page_token: page_token, page_size: page_size }, call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object with options - client.list_effective_event_threat_detection_custom_modules(::Google::Cloud::SecurityCenter::V1::ListEffectiveEventThreatDetectionCustomModulesRequest.new(parent: parent, page_token: page_token, page_size: page_size), call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Verify method calls - assert_equal 5, list_effective_event_threat_detection_custom_modules_client_stub.call_count - end - end - end - - def test_batch_create_resource_value_configs - # Create test objects. - client_result = ::Google::Cloud::SecurityCenter::V1::BatchCreateResourceValueConfigsResponse.new - http_response = OpenStruct.new body: client_result.to_json - - call_options = {} - - # Create request parameters for a unary method. - parent = "hello world" - requests = [{}] - - batch_create_resource_value_configs_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| - assert options.metadata.key? :"x-goog-api-client" - assert options.metadata[:"x-goog-api-client"].include? "rest" - refute options.metadata[:"x-goog-api-client"].include? "grpc" - end - - ::Google::Cloud::SecurityCenter::V1::SecurityCenter::Rest::ServiceStub.stub :transcode_batch_create_resource_value_configs_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, batch_create_resource_value_configs_client_stub do - # Create client - client = ::Google::Cloud::SecurityCenter::V1::SecurityCenter::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - client.batch_create_resource_value_configs({ parent: parent, requests: requests }) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use named arguments - client.batch_create_resource_value_configs parent: parent, requests: requests do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object - client.batch_create_resource_value_configs ::Google::Cloud::SecurityCenter::V1::BatchCreateResourceValueConfigsRequest.new(parent: parent, requests: requests) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use hash object with options - client.batch_create_resource_value_configs({ parent: parent, requests: requests }, call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object with options - client.batch_create_resource_value_configs(::Google::Cloud::SecurityCenter::V1::BatchCreateResourceValueConfigsRequest.new(parent: parent, requests: requests), call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Verify method calls - assert_equal 5, batch_create_resource_value_configs_client_stub.call_count - end - end - end - - def test_delete_resource_value_config - # Create test objects. - client_result = ::Google::Protobuf::Empty.new - http_response = OpenStruct.new body: client_result.to_json - - call_options = {} - - # Create request parameters for a unary method. - name = "hello world" - - delete_resource_value_config_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| - assert options.metadata.key? :"x-goog-api-client" - assert options.metadata[:"x-goog-api-client"].include? "rest" - refute options.metadata[:"x-goog-api-client"].include? "grpc" - end - - ::Google::Cloud::SecurityCenter::V1::SecurityCenter::Rest::ServiceStub.stub :transcode_delete_resource_value_config_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, delete_resource_value_config_client_stub do - # Create client - client = ::Google::Cloud::SecurityCenter::V1::SecurityCenter::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - client.delete_resource_value_config({ name: name }) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use named arguments - client.delete_resource_value_config name: name do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object - client.delete_resource_value_config ::Google::Cloud::SecurityCenter::V1::DeleteResourceValueConfigRequest.new(name: name) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use hash object with options - client.delete_resource_value_config({ name: name }, call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object with options - client.delete_resource_value_config(::Google::Cloud::SecurityCenter::V1::DeleteResourceValueConfigRequest.new(name: name), call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Verify method calls - assert_equal 5, delete_resource_value_config_client_stub.call_count - end - end - end - - def test_get_resource_value_config - # Create test objects. - client_result = ::Google::Cloud::SecurityCenter::V1::ResourceValueConfig.new - http_response = OpenStruct.new body: client_result.to_json - - call_options = {} - - # Create request parameters for a unary method. - name = "hello world" - - get_resource_value_config_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| - assert options.metadata.key? :"x-goog-api-client" - assert options.metadata[:"x-goog-api-client"].include? "rest" - refute options.metadata[:"x-goog-api-client"].include? "grpc" - end - - ::Google::Cloud::SecurityCenter::V1::SecurityCenter::Rest::ServiceStub.stub :transcode_get_resource_value_config_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, get_resource_value_config_client_stub do - # Create client - client = ::Google::Cloud::SecurityCenter::V1::SecurityCenter::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - client.get_resource_value_config({ name: name }) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use named arguments - client.get_resource_value_config name: name do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object - client.get_resource_value_config ::Google::Cloud::SecurityCenter::V1::GetResourceValueConfigRequest.new(name: name) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use hash object with options - client.get_resource_value_config({ name: name }, call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object with options - client.get_resource_value_config(::Google::Cloud::SecurityCenter::V1::GetResourceValueConfigRequest.new(name: name), call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Verify method calls - assert_equal 5, get_resource_value_config_client_stub.call_count - end - end - end - - def test_list_resource_value_configs - # Create test objects. - client_result = ::Google::Cloud::SecurityCenter::V1::ListResourceValueConfigsResponse.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_resource_value_configs_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| - assert options.metadata.key? :"x-goog-api-client" - assert options.metadata[:"x-goog-api-client"].include? "rest" - refute options.metadata[:"x-goog-api-client"].include? "grpc" - end - - ::Google::Cloud::SecurityCenter::V1::SecurityCenter::Rest::ServiceStub.stub :transcode_list_resource_value_configs_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, list_resource_value_configs_client_stub do - # Create client - client = ::Google::Cloud::SecurityCenter::V1::SecurityCenter::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - client.list_resource_value_configs({ 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_resource_value_configs 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_resource_value_configs ::Google::Cloud::SecurityCenter::V1::ListResourceValueConfigsRequest.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_resource_value_configs({ 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_resource_value_configs(::Google::Cloud::SecurityCenter::V1::ListResourceValueConfigsRequest.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_resource_value_configs_client_stub.call_count - end - end - end - - def test_update_resource_value_config - # Create test objects. - client_result = ::Google::Cloud::SecurityCenter::V1::ResourceValueConfig.new - http_response = OpenStruct.new body: client_result.to_json - - call_options = {} - - # Create request parameters for a unary method. - resource_value_config = {} - update_mask = {} - - update_resource_value_config_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| - assert options.metadata.key? :"x-goog-api-client" - assert options.metadata[:"x-goog-api-client"].include? "rest" - refute options.metadata[:"x-goog-api-client"].include? "grpc" - end - - ::Google::Cloud::SecurityCenter::V1::SecurityCenter::Rest::ServiceStub.stub :transcode_update_resource_value_config_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, update_resource_value_config_client_stub do - # Create client - client = ::Google::Cloud::SecurityCenter::V1::SecurityCenter::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - client.update_resource_value_config({ resource_value_config: resource_value_config, update_mask: update_mask }) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use named arguments - client.update_resource_value_config resource_value_config: resource_value_config, update_mask: update_mask do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object - client.update_resource_value_config ::Google::Cloud::SecurityCenter::V1::UpdateResourceValueConfigRequest.new(resource_value_config: resource_value_config, update_mask: update_mask) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use hash object with options - client.update_resource_value_config({ resource_value_config: resource_value_config, update_mask: update_mask }, call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object with options - client.update_resource_value_config(::Google::Cloud::SecurityCenter::V1::UpdateResourceValueConfigRequest.new(resource_value_config: resource_value_config, update_mask: update_mask), call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Verify method calls - assert_equal 5, update_resource_value_config_client_stub.call_count - end - end - end - - def test_list_valued_resources - # Create test objects. - client_result = ::Google::Cloud::SecurityCenter::V1::ListValuedResourcesResponse.new - http_response = OpenStruct.new body: client_result.to_json - - call_options = {} - - # Create request parameters for a unary method. - parent = "hello world" - filter = "hello world" - page_token = "hello world" - page_size = 42 - order_by = "hello world" - - list_valued_resources_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| - assert options.metadata.key? :"x-goog-api-client" - assert options.metadata[:"x-goog-api-client"].include? "rest" - refute options.metadata[:"x-goog-api-client"].include? "grpc" - end - - ::Google::Cloud::SecurityCenter::V1::SecurityCenter::Rest::ServiceStub.stub :transcode_list_valued_resources_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, list_valued_resources_client_stub do - # Create client - client = ::Google::Cloud::SecurityCenter::V1::SecurityCenter::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - client.list_valued_resources({ parent: parent, filter: filter, page_token: page_token, page_size: page_size, order_by: order_by }) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use named arguments - client.list_valued_resources parent: parent, filter: filter, page_token: page_token, page_size: page_size, order_by: order_by do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object - client.list_valued_resources ::Google::Cloud::SecurityCenter::V1::ListValuedResourcesRequest.new(parent: parent, filter: filter, page_token: page_token, page_size: page_size, order_by: order_by) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use hash object with options - client.list_valued_resources({ parent: parent, filter: filter, page_token: page_token, page_size: page_size, order_by: order_by }, call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object with options - client.list_valued_resources(::Google::Cloud::SecurityCenter::V1::ListValuedResourcesRequest.new(parent: parent, filter: filter, page_token: page_token, page_size: page_size, order_by: order_by), call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Verify method calls - assert_equal 5, list_valued_resources_client_stub.call_count - end - end - end - - def test_list_attack_paths - # Create test objects. - client_result = ::Google::Cloud::SecurityCenter::V1::ListAttackPathsResponse.new - http_response = OpenStruct.new body: client_result.to_json - - call_options = {} - - # Create request parameters for a unary method. - parent = "hello world" - filter = "hello world" - page_token = "hello world" - page_size = 42 - - list_attack_paths_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| - assert options.metadata.key? :"x-goog-api-client" - assert options.metadata[:"x-goog-api-client"].include? "rest" - refute options.metadata[:"x-goog-api-client"].include? "grpc" - end - - ::Google::Cloud::SecurityCenter::V1::SecurityCenter::Rest::ServiceStub.stub :transcode_list_attack_paths_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, list_attack_paths_client_stub do - # Create client - client = ::Google::Cloud::SecurityCenter::V1::SecurityCenter::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - client.list_attack_paths({ parent: parent, filter: filter, page_token: page_token, page_size: page_size }) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use named arguments - client.list_attack_paths parent: parent, filter: filter, page_token: page_token, page_size: page_size do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object - client.list_attack_paths ::Google::Cloud::SecurityCenter::V1::ListAttackPathsRequest.new(parent: parent, filter: filter, page_token: page_token, page_size: page_size) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use hash object with options - client.list_attack_paths({ parent: parent, filter: filter, page_token: page_token, page_size: page_size }, call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object with options - client.list_attack_paths(::Google::Cloud::SecurityCenter::V1::ListAttackPathsRequest.new(parent: parent, filter: filter, page_token: page_token, page_size: page_size), call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Verify method calls - assert_equal 5, list_attack_paths_client_stub.call_count - end - end - end - - def test_configure - credentials_token = :dummy_value - - client = block_config = config = nil - dummy_stub = ClientStub.new nil - Gapic::Rest::ClientStub.stub :new, dummy_stub do - client = ::Google::Cloud::SecurityCenter::V1::SecurityCenter::Rest::Client.new do |config| - config.credentials = credentials_token - end - end - - config = client.configure do |c| - block_config = c - end - - assert_same block_config, config - assert_kind_of ::Google::Cloud::SecurityCenter::V1::SecurityCenter::Rest::Client::Configuration, config - end -end diff --git a/owl-bot-staging/google-cloud-security_center-v1/test/google/cloud/security_center/v1/security_center_test.rb b/owl-bot-staging/google-cloud-security_center-v1/test/google/cloud/security_center/v1/security_center_test.rb deleted file mode 100644 index d1e2bbb1443a..000000000000 --- a/owl-bot-staging/google-cloud-security_center-v1/test/google/cloud/security_center/v1/security_center_test.rb +++ /dev/null @@ -1,4053 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -require "helper" - -require "gapic/grpc/service_stub" - -require "google/cloud/securitycenter/v1/securitycenter_service_pb" -require "google/cloud/security_center/v1/security_center" - -class ::Google::Cloud::SecurityCenter::V1::SecurityCenter::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_bulk_mute_findings - # 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" - filter = "hello world" - mute_annotation = "hello world" - mute_state = :MUTE_STATE_UNSPECIFIED - - bulk_mute_findings_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :bulk_mute_findings, name - assert_kind_of ::Google::Cloud::SecurityCenter::V1::BulkMuteFindingsRequest, request - assert_equal "hello world", request["parent"] - assert_equal "hello world", request["filter"] - assert_equal "hello world", request["mute_annotation"] - assert_equal :MUTE_STATE_UNSPECIFIED, request["mute_state"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, bulk_mute_findings_client_stub do - # Create client - client = ::Google::Cloud::SecurityCenter::V1::SecurityCenter::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.bulk_mute_findings({ parent: parent, filter: filter, mute_annotation: mute_annotation, mute_state: mute_state }) 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.bulk_mute_findings parent: parent, filter: filter, mute_annotation: mute_annotation, mute_state: mute_state 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.bulk_mute_findings ::Google::Cloud::SecurityCenter::V1::BulkMuteFindingsRequest.new(parent: parent, filter: filter, mute_annotation: mute_annotation, mute_state: mute_state) 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.bulk_mute_findings({ parent: parent, filter: filter, mute_annotation: mute_annotation, mute_state: mute_state }, 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.bulk_mute_findings(::Google::Cloud::SecurityCenter::V1::BulkMuteFindingsRequest.new(parent: parent, filter: filter, mute_annotation: mute_annotation, mute_state: mute_state), 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, bulk_mute_findings_client_stub.call_rpc_count - end - end - - def test_create_security_health_analytics_custom_module - # Create GRPC objects. - grpc_response = ::Google::Cloud::SecurityCenter::V1::SecurityHealthAnalyticsCustomModule.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" - security_health_analytics_custom_module = {} - - create_security_health_analytics_custom_module_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :create_security_health_analytics_custom_module, name - assert_kind_of ::Google::Cloud::SecurityCenter::V1::CreateSecurityHealthAnalyticsCustomModuleRequest, request - assert_equal "hello world", request["parent"] - assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::SecurityCenter::V1::SecurityHealthAnalyticsCustomModule), request["security_health_analytics_custom_module"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, create_security_health_analytics_custom_module_client_stub do - # Create client - client = ::Google::Cloud::SecurityCenter::V1::SecurityCenter::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.create_security_health_analytics_custom_module({ parent: parent, security_health_analytics_custom_module: security_health_analytics_custom_module }) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use named arguments - client.create_security_health_analytics_custom_module parent: parent, security_health_analytics_custom_module: security_health_analytics_custom_module do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object - client.create_security_health_analytics_custom_module ::Google::Cloud::SecurityCenter::V1::CreateSecurityHealthAnalyticsCustomModuleRequest.new(parent: parent, security_health_analytics_custom_module: security_health_analytics_custom_module) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use hash object with options - client.create_security_health_analytics_custom_module({ parent: parent, security_health_analytics_custom_module: security_health_analytics_custom_module }, grpc_options) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object with options - client.create_security_health_analytics_custom_module(::Google::Cloud::SecurityCenter::V1::CreateSecurityHealthAnalyticsCustomModuleRequest.new(parent: parent, security_health_analytics_custom_module: security_health_analytics_custom_module), grpc_options) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Verify method calls - assert_equal 5, create_security_health_analytics_custom_module_client_stub.call_rpc_count - end - end - - def test_create_source - # Create GRPC objects. - grpc_response = ::Google::Cloud::SecurityCenter::V1::Source.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" - source = {} - - create_source_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :create_source, name - assert_kind_of ::Google::Cloud::SecurityCenter::V1::CreateSourceRequest, request - assert_equal "hello world", request["parent"] - assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::SecurityCenter::V1::Source), request["source"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, create_source_client_stub do - # Create client - client = ::Google::Cloud::SecurityCenter::V1::SecurityCenter::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.create_source({ parent: parent, source: source }) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use named arguments - client.create_source parent: parent, source: source do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object - client.create_source ::Google::Cloud::SecurityCenter::V1::CreateSourceRequest.new(parent: parent, source: source) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use hash object with options - client.create_source({ parent: parent, source: source }, grpc_options) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object with options - client.create_source(::Google::Cloud::SecurityCenter::V1::CreateSourceRequest.new(parent: parent, source: source), grpc_options) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Verify method calls - assert_equal 5, create_source_client_stub.call_rpc_count - end - end - - def test_create_finding - # Create GRPC objects. - grpc_response = ::Google::Cloud::SecurityCenter::V1::Finding.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" - finding_id = "hello world" - finding = {} - - create_finding_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :create_finding, name - assert_kind_of ::Google::Cloud::SecurityCenter::V1::CreateFindingRequest, request - assert_equal "hello world", request["parent"] - assert_equal "hello world", request["finding_id"] - assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::SecurityCenter::V1::Finding), request["finding"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, create_finding_client_stub do - # Create client - client = ::Google::Cloud::SecurityCenter::V1::SecurityCenter::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.create_finding({ parent: parent, finding_id: finding_id, finding: finding }) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use named arguments - client.create_finding parent: parent, finding_id: finding_id, finding: finding do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object - client.create_finding ::Google::Cloud::SecurityCenter::V1::CreateFindingRequest.new(parent: parent, finding_id: finding_id, finding: finding) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use hash object with options - client.create_finding({ parent: parent, finding_id: finding_id, finding: finding }, grpc_options) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object with options - client.create_finding(::Google::Cloud::SecurityCenter::V1::CreateFindingRequest.new(parent: parent, finding_id: finding_id, finding: finding), grpc_options) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Verify method calls - assert_equal 5, create_finding_client_stub.call_rpc_count - end - end - - def test_create_mute_config - # Create GRPC objects. - grpc_response = ::Google::Cloud::SecurityCenter::V1::MuteConfig.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" - mute_config = {} - mute_config_id = "hello world" - - create_mute_config_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :create_mute_config, name - assert_kind_of ::Google::Cloud::SecurityCenter::V1::CreateMuteConfigRequest, request - assert_equal "hello world", request["parent"] - assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::SecurityCenter::V1::MuteConfig), request["mute_config"] - assert_equal "hello world", request["mute_config_id"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, create_mute_config_client_stub do - # Create client - client = ::Google::Cloud::SecurityCenter::V1::SecurityCenter::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.create_mute_config({ parent: parent, mute_config: mute_config, mute_config_id: mute_config_id }) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use named arguments - client.create_mute_config parent: parent, mute_config: mute_config, mute_config_id: mute_config_id do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object - client.create_mute_config ::Google::Cloud::SecurityCenter::V1::CreateMuteConfigRequest.new(parent: parent, mute_config: mute_config, mute_config_id: mute_config_id) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use hash object with options - client.create_mute_config({ parent: parent, mute_config: mute_config, mute_config_id: mute_config_id }, grpc_options) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object with options - client.create_mute_config(::Google::Cloud::SecurityCenter::V1::CreateMuteConfigRequest.new(parent: parent, mute_config: mute_config, mute_config_id: mute_config_id), grpc_options) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Verify method calls - assert_equal 5, create_mute_config_client_stub.call_rpc_count - end - end - - def test_create_notification_config - # Create GRPC objects. - grpc_response = ::Google::Cloud::SecurityCenter::V1::NotificationConfig.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" - config_id = "hello world" - notification_config = {} - - create_notification_config_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :create_notification_config, name - assert_kind_of ::Google::Cloud::SecurityCenter::V1::CreateNotificationConfigRequest, request - assert_equal "hello world", request["parent"] - assert_equal "hello world", request["config_id"] - assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::SecurityCenter::V1::NotificationConfig), request["notification_config"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, create_notification_config_client_stub do - # Create client - client = ::Google::Cloud::SecurityCenter::V1::SecurityCenter::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.create_notification_config({ parent: parent, config_id: config_id, notification_config: notification_config }) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use named arguments - client.create_notification_config parent: parent, config_id: config_id, notification_config: notification_config do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object - client.create_notification_config ::Google::Cloud::SecurityCenter::V1::CreateNotificationConfigRequest.new(parent: parent, config_id: config_id, notification_config: notification_config) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use hash object with options - client.create_notification_config({ parent: parent, config_id: config_id, notification_config: notification_config }, grpc_options) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object with options - client.create_notification_config(::Google::Cloud::SecurityCenter::V1::CreateNotificationConfigRequest.new(parent: parent, config_id: config_id, notification_config: notification_config), grpc_options) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Verify method calls - assert_equal 5, create_notification_config_client_stub.call_rpc_count - end - end - - def test_delete_mute_config - # 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_mute_config_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :delete_mute_config, name - assert_kind_of ::Google::Cloud::SecurityCenter::V1::DeleteMuteConfigRequest, request - assert_equal "hello world", request["name"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, delete_mute_config_client_stub do - # Create client - client = ::Google::Cloud::SecurityCenter::V1::SecurityCenter::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.delete_mute_config({ name: name }) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use named arguments - client.delete_mute_config name: name do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object - client.delete_mute_config ::Google::Cloud::SecurityCenter::V1::DeleteMuteConfigRequest.new(name: name) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use hash object with options - client.delete_mute_config({ name: name }, grpc_options) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object with options - client.delete_mute_config(::Google::Cloud::SecurityCenter::V1::DeleteMuteConfigRequest.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_mute_config_client_stub.call_rpc_count - end - end - - def test_delete_notification_config - # 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_notification_config_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :delete_notification_config, name - assert_kind_of ::Google::Cloud::SecurityCenter::V1::DeleteNotificationConfigRequest, request - assert_equal "hello world", request["name"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, delete_notification_config_client_stub do - # Create client - client = ::Google::Cloud::SecurityCenter::V1::SecurityCenter::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.delete_notification_config({ name: name }) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use named arguments - client.delete_notification_config name: name do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object - client.delete_notification_config ::Google::Cloud::SecurityCenter::V1::DeleteNotificationConfigRequest.new(name: name) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use hash object with options - client.delete_notification_config({ name: name }, grpc_options) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object with options - client.delete_notification_config(::Google::Cloud::SecurityCenter::V1::DeleteNotificationConfigRequest.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_notification_config_client_stub.call_rpc_count - end - end - - def test_delete_security_health_analytics_custom_module - # 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_security_health_analytics_custom_module_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :delete_security_health_analytics_custom_module, name - assert_kind_of ::Google::Cloud::SecurityCenter::V1::DeleteSecurityHealthAnalyticsCustomModuleRequest, request - assert_equal "hello world", request["name"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, delete_security_health_analytics_custom_module_client_stub do - # Create client - client = ::Google::Cloud::SecurityCenter::V1::SecurityCenter::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.delete_security_health_analytics_custom_module({ name: name }) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use named arguments - client.delete_security_health_analytics_custom_module name: name do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object - client.delete_security_health_analytics_custom_module ::Google::Cloud::SecurityCenter::V1::DeleteSecurityHealthAnalyticsCustomModuleRequest.new(name: name) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use hash object with options - client.delete_security_health_analytics_custom_module({ 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_security_health_analytics_custom_module(::Google::Cloud::SecurityCenter::V1::DeleteSecurityHealthAnalyticsCustomModuleRequest.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_security_health_analytics_custom_module_client_stub.call_rpc_count - end - end - - def test_get_simulation - # Create GRPC objects. - grpc_response = ::Google::Cloud::SecurityCenter::V1::Simulation.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_simulation_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :get_simulation, name - assert_kind_of ::Google::Cloud::SecurityCenter::V1::GetSimulationRequest, request - assert_equal "hello world", request["name"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, get_simulation_client_stub do - # Create client - client = ::Google::Cloud::SecurityCenter::V1::SecurityCenter::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.get_simulation({ name: name }) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use named arguments - client.get_simulation name: name do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object - client.get_simulation ::Google::Cloud::SecurityCenter::V1::GetSimulationRequest.new(name: name) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use hash object with options - client.get_simulation({ 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_simulation(::Google::Cloud::SecurityCenter::V1::GetSimulationRequest.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_simulation_client_stub.call_rpc_count - end - end - - def test_get_valued_resource - # Create GRPC objects. - grpc_response = ::Google::Cloud::SecurityCenter::V1::ValuedResource.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_valued_resource_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :get_valued_resource, name - assert_kind_of ::Google::Cloud::SecurityCenter::V1::GetValuedResourceRequest, request - assert_equal "hello world", request["name"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, get_valued_resource_client_stub do - # Create client - client = ::Google::Cloud::SecurityCenter::V1::SecurityCenter::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.get_valued_resource({ name: name }) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use named arguments - client.get_valued_resource name: name do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object - client.get_valued_resource ::Google::Cloud::SecurityCenter::V1::GetValuedResourceRequest.new(name: name) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use hash object with options - client.get_valued_resource({ 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_valued_resource(::Google::Cloud::SecurityCenter::V1::GetValuedResourceRequest.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_valued_resource_client_stub.call_rpc_count - end - end - - def test_get_big_query_export - # Create GRPC objects. - grpc_response = ::Google::Cloud::SecurityCenter::V1::BigQueryExport.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_big_query_export_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :get_big_query_export, name - assert_kind_of ::Google::Cloud::SecurityCenter::V1::GetBigQueryExportRequest, request - assert_equal "hello world", request["name"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, get_big_query_export_client_stub do - # Create client - client = ::Google::Cloud::SecurityCenter::V1::SecurityCenter::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.get_big_query_export({ name: name }) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use named arguments - client.get_big_query_export name: name do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object - client.get_big_query_export ::Google::Cloud::SecurityCenter::V1::GetBigQueryExportRequest.new(name: name) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use hash object with options - client.get_big_query_export({ 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_big_query_export(::Google::Cloud::SecurityCenter::V1::GetBigQueryExportRequest.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_big_query_export_client_stub.call_rpc_count - end - end - - def test_get_iam_policy - # Create GRPC objects. - grpc_response = ::Google::Iam::V1::Policy.new - grpc_operation = GRPC::ActiveCall::Operation.new nil - grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - grpc_options = {} - - # Create request parameters for a unary method. - resource = "hello world" - options = {} - - get_iam_policy_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :get_iam_policy, name - assert_kind_of ::Google::Iam::V1::GetIamPolicyRequest, request - assert_equal "hello world", request["resource"] - assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Iam::V1::GetPolicyOptions), request["options"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, get_iam_policy_client_stub do - # Create client - client = ::Google::Cloud::SecurityCenter::V1::SecurityCenter::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.get_iam_policy({ resource: resource, options: options }) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use named arguments - client.get_iam_policy resource: resource, options: options do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object - client.get_iam_policy ::Google::Iam::V1::GetIamPolicyRequest.new(resource: resource, options: options) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use hash object with options - client.get_iam_policy({ resource: resource, options: options }, grpc_options) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object with options - client.get_iam_policy(::Google::Iam::V1::GetIamPolicyRequest.new(resource: resource, options: options), grpc_options) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Verify method calls - assert_equal 5, get_iam_policy_client_stub.call_rpc_count - end - end - - def test_get_mute_config - # Create GRPC objects. - grpc_response = ::Google::Cloud::SecurityCenter::V1::MuteConfig.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_mute_config_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :get_mute_config, name - assert_kind_of ::Google::Cloud::SecurityCenter::V1::GetMuteConfigRequest, request - assert_equal "hello world", request["name"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, get_mute_config_client_stub do - # Create client - client = ::Google::Cloud::SecurityCenter::V1::SecurityCenter::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.get_mute_config({ name: name }) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use named arguments - client.get_mute_config name: name do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object - client.get_mute_config ::Google::Cloud::SecurityCenter::V1::GetMuteConfigRequest.new(name: name) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use hash object with options - client.get_mute_config({ name: name }, grpc_options) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object with options - client.get_mute_config(::Google::Cloud::SecurityCenter::V1::GetMuteConfigRequest.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_mute_config_client_stub.call_rpc_count - end - end - - def test_get_notification_config - # Create GRPC objects. - grpc_response = ::Google::Cloud::SecurityCenter::V1::NotificationConfig.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_notification_config_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :get_notification_config, name - assert_kind_of ::Google::Cloud::SecurityCenter::V1::GetNotificationConfigRequest, request - assert_equal "hello world", request["name"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, get_notification_config_client_stub do - # Create client - client = ::Google::Cloud::SecurityCenter::V1::SecurityCenter::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.get_notification_config({ name: name }) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use named arguments - client.get_notification_config name: name do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object - client.get_notification_config ::Google::Cloud::SecurityCenter::V1::GetNotificationConfigRequest.new(name: name) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use hash object with options - client.get_notification_config({ name: name }, grpc_options) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object with options - client.get_notification_config(::Google::Cloud::SecurityCenter::V1::GetNotificationConfigRequest.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_notification_config_client_stub.call_rpc_count - end - end - - def test_get_organization_settings - # Create GRPC objects. - grpc_response = ::Google::Cloud::SecurityCenter::V1::OrganizationSettings.new - grpc_operation = GRPC::ActiveCall::Operation.new nil - grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - grpc_options = {} - - # Create request parameters for a unary method. - name = "hello world" - - get_organization_settings_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :get_organization_settings, name - assert_kind_of ::Google::Cloud::SecurityCenter::V1::GetOrganizationSettingsRequest, request - assert_equal "hello world", request["name"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, get_organization_settings_client_stub do - # Create client - client = ::Google::Cloud::SecurityCenter::V1::SecurityCenter::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.get_organization_settings({ name: name }) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use named arguments - client.get_organization_settings name: name do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object - client.get_organization_settings ::Google::Cloud::SecurityCenter::V1::GetOrganizationSettingsRequest.new(name: name) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use hash object with options - client.get_organization_settings({ name: name }, grpc_options) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object with options - client.get_organization_settings(::Google::Cloud::SecurityCenter::V1::GetOrganizationSettingsRequest.new(name: name), grpc_options) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Verify method calls - assert_equal 5, get_organization_settings_client_stub.call_rpc_count - end - end - - def test_get_effective_security_health_analytics_custom_module - # Create GRPC objects. - grpc_response = ::Google::Cloud::SecurityCenter::V1::EffectiveSecurityHealthAnalyticsCustomModule.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_effective_security_health_analytics_custom_module_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :get_effective_security_health_analytics_custom_module, name - assert_kind_of ::Google::Cloud::SecurityCenter::V1::GetEffectiveSecurityHealthAnalyticsCustomModuleRequest, request - assert_equal "hello world", request["name"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, get_effective_security_health_analytics_custom_module_client_stub do - # Create client - client = ::Google::Cloud::SecurityCenter::V1::SecurityCenter::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.get_effective_security_health_analytics_custom_module({ name: name }) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use named arguments - client.get_effective_security_health_analytics_custom_module name: name do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object - client.get_effective_security_health_analytics_custom_module ::Google::Cloud::SecurityCenter::V1::GetEffectiveSecurityHealthAnalyticsCustomModuleRequest.new(name: name) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use hash object with options - client.get_effective_security_health_analytics_custom_module({ 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_effective_security_health_analytics_custom_module(::Google::Cloud::SecurityCenter::V1::GetEffectiveSecurityHealthAnalyticsCustomModuleRequest.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_effective_security_health_analytics_custom_module_client_stub.call_rpc_count - end - end - - def test_get_security_health_analytics_custom_module - # Create GRPC objects. - grpc_response = ::Google::Cloud::SecurityCenter::V1::SecurityHealthAnalyticsCustomModule.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_security_health_analytics_custom_module_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :get_security_health_analytics_custom_module, name - assert_kind_of ::Google::Cloud::SecurityCenter::V1::GetSecurityHealthAnalyticsCustomModuleRequest, request - assert_equal "hello world", request["name"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, get_security_health_analytics_custom_module_client_stub do - # Create client - client = ::Google::Cloud::SecurityCenter::V1::SecurityCenter::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.get_security_health_analytics_custom_module({ name: name }) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use named arguments - client.get_security_health_analytics_custom_module name: name do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object - client.get_security_health_analytics_custom_module ::Google::Cloud::SecurityCenter::V1::GetSecurityHealthAnalyticsCustomModuleRequest.new(name: name) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use hash object with options - client.get_security_health_analytics_custom_module({ 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_security_health_analytics_custom_module(::Google::Cloud::SecurityCenter::V1::GetSecurityHealthAnalyticsCustomModuleRequest.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_security_health_analytics_custom_module_client_stub.call_rpc_count - end - end - - def test_get_source - # Create GRPC objects. - grpc_response = ::Google::Cloud::SecurityCenter::V1::Source.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_source_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :get_source, name - assert_kind_of ::Google::Cloud::SecurityCenter::V1::GetSourceRequest, request - assert_equal "hello world", request["name"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, get_source_client_stub do - # Create client - client = ::Google::Cloud::SecurityCenter::V1::SecurityCenter::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.get_source({ name: name }) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use named arguments - client.get_source name: name do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object - client.get_source ::Google::Cloud::SecurityCenter::V1::GetSourceRequest.new(name: name) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use hash object with options - client.get_source({ 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_source(::Google::Cloud::SecurityCenter::V1::GetSourceRequest.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_source_client_stub.call_rpc_count - end - end - - def test_group_assets - # Create GRPC objects. - grpc_response = ::Google::Cloud::SecurityCenter::V1::GroupAssetsResponse.new - grpc_operation = GRPC::ActiveCall::Operation.new nil - grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - grpc_options = {} - - # Create request parameters for a unary method. - parent = "hello world" - filter = "hello world" - group_by = "hello world" - compare_duration = {} - read_time = {} - page_token = "hello world" - page_size = 42 - - group_assets_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :group_assets, name - assert_kind_of ::Google::Cloud::SecurityCenter::V1::GroupAssetsRequest, request - assert_equal "hello world", request["parent"] - assert_equal "hello world", request["filter"] - assert_equal "hello world", request["group_by"] - assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Protobuf::Duration), request["compare_duration"] - assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Protobuf::Timestamp), request["read_time"] - assert_equal "hello world", request["page_token"] - assert_equal 42, request["page_size"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, group_assets_client_stub do - # Create client - client = ::Google::Cloud::SecurityCenter::V1::SecurityCenter::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.group_assets({ parent: parent, filter: filter, group_by: group_by, compare_duration: compare_duration, read_time: read_time, page_token: page_token, page_size: page_size }) 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.group_assets parent: parent, filter: filter, group_by: group_by, compare_duration: compare_duration, read_time: read_time, page_token: page_token, page_size: page_size 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.group_assets ::Google::Cloud::SecurityCenter::V1::GroupAssetsRequest.new(parent: parent, filter: filter, group_by: group_by, compare_duration: compare_duration, read_time: read_time, page_token: page_token, page_size: page_size) 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.group_assets({ parent: parent, filter: filter, group_by: group_by, compare_duration: compare_duration, read_time: read_time, page_token: page_token, page_size: page_size }, 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.group_assets(::Google::Cloud::SecurityCenter::V1::GroupAssetsRequest.new(parent: parent, filter: filter, group_by: group_by, compare_duration: compare_duration, read_time: read_time, page_token: page_token, page_size: page_size), 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, group_assets_client_stub.call_rpc_count - end - end - - def test_group_findings - # Create GRPC objects. - grpc_response = ::Google::Cloud::SecurityCenter::V1::GroupFindingsResponse.new - grpc_operation = GRPC::ActiveCall::Operation.new nil - grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - grpc_options = {} - - # Create request parameters for a unary method. - parent = "hello world" - filter = "hello world" - group_by = "hello world" - read_time = {} - compare_duration = {} - page_token = "hello world" - page_size = 42 - - group_findings_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :group_findings, name - assert_kind_of ::Google::Cloud::SecurityCenter::V1::GroupFindingsRequest, request - assert_equal "hello world", request["parent"] - assert_equal "hello world", request["filter"] - assert_equal "hello world", request["group_by"] - assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Protobuf::Timestamp), request["read_time"] - assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Protobuf::Duration), request["compare_duration"] - assert_equal "hello world", request["page_token"] - assert_equal 42, request["page_size"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, group_findings_client_stub do - # Create client - client = ::Google::Cloud::SecurityCenter::V1::SecurityCenter::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.group_findings({ parent: parent, filter: filter, group_by: group_by, read_time: read_time, compare_duration: compare_duration, page_token: page_token, page_size: page_size }) 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.group_findings parent: parent, filter: filter, group_by: group_by, read_time: read_time, compare_duration: compare_duration, page_token: page_token, page_size: page_size 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.group_findings ::Google::Cloud::SecurityCenter::V1::GroupFindingsRequest.new(parent: parent, filter: filter, group_by: group_by, read_time: read_time, compare_duration: compare_duration, page_token: page_token, page_size: page_size) 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.group_findings({ parent: parent, filter: filter, group_by: group_by, read_time: read_time, compare_duration: compare_duration, page_token: page_token, page_size: page_size }, 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.group_findings(::Google::Cloud::SecurityCenter::V1::GroupFindingsRequest.new(parent: parent, filter: filter, group_by: group_by, read_time: read_time, compare_duration: compare_duration, page_token: page_token, page_size: page_size), 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, group_findings_client_stub.call_rpc_count - end - end - - def test_list_assets - # Create GRPC objects. - grpc_response = ::Google::Cloud::SecurityCenter::V1::ListAssetsResponse.new - grpc_operation = GRPC::ActiveCall::Operation.new nil - grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - grpc_options = {} - - # Create request parameters for a unary method. - parent = "hello world" - filter = "hello world" - order_by = "hello world" - read_time = {} - compare_duration = {} - field_mask = {} - page_token = "hello world" - page_size = 42 - - list_assets_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :list_assets, name - assert_kind_of ::Google::Cloud::SecurityCenter::V1::ListAssetsRequest, request - assert_equal "hello world", request["parent"] - assert_equal "hello world", request["filter"] - assert_equal "hello world", request["order_by"] - assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Protobuf::Timestamp), request["read_time"] - assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Protobuf::Duration), request["compare_duration"] - assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Protobuf::FieldMask), request["field_mask"] - assert_equal "hello world", request["page_token"] - assert_equal 42, request["page_size"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, list_assets_client_stub do - # Create client - client = ::Google::Cloud::SecurityCenter::V1::SecurityCenter::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.list_assets({ parent: parent, filter: filter, order_by: order_by, read_time: read_time, compare_duration: compare_duration, field_mask: field_mask, page_token: page_token, page_size: page_size }) 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_assets parent: parent, filter: filter, order_by: order_by, read_time: read_time, compare_duration: compare_duration, field_mask: field_mask, page_token: page_token, page_size: page_size 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_assets ::Google::Cloud::SecurityCenter::V1::ListAssetsRequest.new(parent: parent, filter: filter, order_by: order_by, read_time: read_time, compare_duration: compare_duration, field_mask: field_mask, page_token: page_token, page_size: page_size) 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_assets({ parent: parent, filter: filter, order_by: order_by, read_time: read_time, compare_duration: compare_duration, field_mask: field_mask, page_token: page_token, page_size: page_size }, 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_assets(::Google::Cloud::SecurityCenter::V1::ListAssetsRequest.new(parent: parent, filter: filter, order_by: order_by, read_time: read_time, compare_duration: compare_duration, field_mask: field_mask, page_token: page_token, page_size: page_size), 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_assets_client_stub.call_rpc_count - end - end - - def test_list_descendant_security_health_analytics_custom_modules - # Create GRPC objects. - grpc_response = ::Google::Cloud::SecurityCenter::V1::ListDescendantSecurityHealthAnalyticsCustomModulesResponse.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_descendant_security_health_analytics_custom_modules_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :list_descendant_security_health_analytics_custom_modules, name - assert_kind_of ::Google::Cloud::SecurityCenter::V1::ListDescendantSecurityHealthAnalyticsCustomModulesRequest, 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_descendant_security_health_analytics_custom_modules_client_stub do - # Create client - client = ::Google::Cloud::SecurityCenter::V1::SecurityCenter::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.list_descendant_security_health_analytics_custom_modules({ 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_descendant_security_health_analytics_custom_modules 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_descendant_security_health_analytics_custom_modules ::Google::Cloud::SecurityCenter::V1::ListDescendantSecurityHealthAnalyticsCustomModulesRequest.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_descendant_security_health_analytics_custom_modules({ 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_descendant_security_health_analytics_custom_modules(::Google::Cloud::SecurityCenter::V1::ListDescendantSecurityHealthAnalyticsCustomModulesRequest.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_descendant_security_health_analytics_custom_modules_client_stub.call_rpc_count - end - end - - def test_list_findings - # Create GRPC objects. - grpc_response = ::Google::Cloud::SecurityCenter::V1::ListFindingsResponse.new - grpc_operation = GRPC::ActiveCall::Operation.new nil - grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - grpc_options = {} - - # Create request parameters for a unary method. - parent = "hello world" - filter = "hello world" - order_by = "hello world" - read_time = {} - compare_duration = {} - field_mask = {} - page_token = "hello world" - page_size = 42 - - list_findings_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :list_findings, name - assert_kind_of ::Google::Cloud::SecurityCenter::V1::ListFindingsRequest, request - assert_equal "hello world", request["parent"] - assert_equal "hello world", request["filter"] - assert_equal "hello world", request["order_by"] - assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Protobuf::Timestamp), request["read_time"] - assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Protobuf::Duration), request["compare_duration"] - assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Protobuf::FieldMask), request["field_mask"] - assert_equal "hello world", request["page_token"] - assert_equal 42, request["page_size"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, list_findings_client_stub do - # Create client - client = ::Google::Cloud::SecurityCenter::V1::SecurityCenter::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.list_findings({ parent: parent, filter: filter, order_by: order_by, read_time: read_time, compare_duration: compare_duration, field_mask: field_mask, page_token: page_token, page_size: page_size }) 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_findings parent: parent, filter: filter, order_by: order_by, read_time: read_time, compare_duration: compare_duration, field_mask: field_mask, page_token: page_token, page_size: page_size 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_findings ::Google::Cloud::SecurityCenter::V1::ListFindingsRequest.new(parent: parent, filter: filter, order_by: order_by, read_time: read_time, compare_duration: compare_duration, field_mask: field_mask, page_token: page_token, page_size: page_size) 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_findings({ parent: parent, filter: filter, order_by: order_by, read_time: read_time, compare_duration: compare_duration, field_mask: field_mask, page_token: page_token, page_size: page_size }, 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_findings(::Google::Cloud::SecurityCenter::V1::ListFindingsRequest.new(parent: parent, filter: filter, order_by: order_by, read_time: read_time, compare_duration: compare_duration, field_mask: field_mask, page_token: page_token, page_size: page_size), 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_findings_client_stub.call_rpc_count - end - end - - def test_list_mute_configs - # Create GRPC objects. - grpc_response = ::Google::Cloud::SecurityCenter::V1::ListMuteConfigsResponse.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_mute_configs_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :list_mute_configs, name - assert_kind_of ::Google::Cloud::SecurityCenter::V1::ListMuteConfigsRequest, 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_mute_configs_client_stub do - # Create client - client = ::Google::Cloud::SecurityCenter::V1::SecurityCenter::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.list_mute_configs({ 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_mute_configs 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_mute_configs ::Google::Cloud::SecurityCenter::V1::ListMuteConfigsRequest.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_mute_configs({ 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_mute_configs(::Google::Cloud::SecurityCenter::V1::ListMuteConfigsRequest.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_mute_configs_client_stub.call_rpc_count - end - end - - def test_list_notification_configs - # Create GRPC objects. - grpc_response = ::Google::Cloud::SecurityCenter::V1::ListNotificationConfigsResponse.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_token = "hello world" - page_size = 42 - - list_notification_configs_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :list_notification_configs, name - assert_kind_of ::Google::Cloud::SecurityCenter::V1::ListNotificationConfigsRequest, request - assert_equal "hello world", request["parent"] - assert_equal "hello world", request["page_token"] - assert_equal 42, request["page_size"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, list_notification_configs_client_stub do - # Create client - client = ::Google::Cloud::SecurityCenter::V1::SecurityCenter::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.list_notification_configs({ parent: parent, page_token: page_token, page_size: page_size }) 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_notification_configs parent: parent, page_token: page_token, page_size: page_size 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_notification_configs ::Google::Cloud::SecurityCenter::V1::ListNotificationConfigsRequest.new(parent: parent, page_token: page_token, page_size: page_size) 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_notification_configs({ parent: parent, page_token: page_token, page_size: page_size }, 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_notification_configs(::Google::Cloud::SecurityCenter::V1::ListNotificationConfigsRequest.new(parent: parent, page_token: page_token, page_size: page_size), 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_notification_configs_client_stub.call_rpc_count - end - end - - def test_list_effective_security_health_analytics_custom_modules - # Create GRPC objects. - grpc_response = ::Google::Cloud::SecurityCenter::V1::ListEffectiveSecurityHealthAnalyticsCustomModulesResponse.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_effective_security_health_analytics_custom_modules_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :list_effective_security_health_analytics_custom_modules, name - assert_kind_of ::Google::Cloud::SecurityCenter::V1::ListEffectiveSecurityHealthAnalyticsCustomModulesRequest, 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_effective_security_health_analytics_custom_modules_client_stub do - # Create client - client = ::Google::Cloud::SecurityCenter::V1::SecurityCenter::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.list_effective_security_health_analytics_custom_modules({ 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_effective_security_health_analytics_custom_modules 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_effective_security_health_analytics_custom_modules ::Google::Cloud::SecurityCenter::V1::ListEffectiveSecurityHealthAnalyticsCustomModulesRequest.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_effective_security_health_analytics_custom_modules({ 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_effective_security_health_analytics_custom_modules(::Google::Cloud::SecurityCenter::V1::ListEffectiveSecurityHealthAnalyticsCustomModulesRequest.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_effective_security_health_analytics_custom_modules_client_stub.call_rpc_count - end - end - - def test_list_security_health_analytics_custom_modules - # Create GRPC objects. - grpc_response = ::Google::Cloud::SecurityCenter::V1::ListSecurityHealthAnalyticsCustomModulesResponse.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_security_health_analytics_custom_modules_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :list_security_health_analytics_custom_modules, name - assert_kind_of ::Google::Cloud::SecurityCenter::V1::ListSecurityHealthAnalyticsCustomModulesRequest, 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_security_health_analytics_custom_modules_client_stub do - # Create client - client = ::Google::Cloud::SecurityCenter::V1::SecurityCenter::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.list_security_health_analytics_custom_modules({ 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_security_health_analytics_custom_modules 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_security_health_analytics_custom_modules ::Google::Cloud::SecurityCenter::V1::ListSecurityHealthAnalyticsCustomModulesRequest.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_security_health_analytics_custom_modules({ 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_security_health_analytics_custom_modules(::Google::Cloud::SecurityCenter::V1::ListSecurityHealthAnalyticsCustomModulesRequest.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_security_health_analytics_custom_modules_client_stub.call_rpc_count - end - end - - def test_list_sources - # Create GRPC objects. - grpc_response = ::Google::Cloud::SecurityCenter::V1::ListSourcesResponse.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_token = "hello world" - page_size = 42 - - list_sources_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :list_sources, name - assert_kind_of ::Google::Cloud::SecurityCenter::V1::ListSourcesRequest, request - assert_equal "hello world", request["parent"] - assert_equal "hello world", request["page_token"] - assert_equal 42, request["page_size"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, list_sources_client_stub do - # Create client - client = ::Google::Cloud::SecurityCenter::V1::SecurityCenter::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.list_sources({ parent: parent, page_token: page_token, page_size: page_size }) 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_sources parent: parent, page_token: page_token, page_size: page_size 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_sources ::Google::Cloud::SecurityCenter::V1::ListSourcesRequest.new(parent: parent, page_token: page_token, page_size: page_size) 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_sources({ parent: parent, page_token: page_token, page_size: page_size }, 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_sources(::Google::Cloud::SecurityCenter::V1::ListSourcesRequest.new(parent: parent, page_token: page_token, page_size: page_size), 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_sources_client_stub.call_rpc_count - end - end - - def test_run_asset_discovery - # 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" - - run_asset_discovery_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :run_asset_discovery, name - assert_kind_of ::Google::Cloud::SecurityCenter::V1::RunAssetDiscoveryRequest, request - assert_equal "hello world", request["parent"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, run_asset_discovery_client_stub do - # Create client - client = ::Google::Cloud::SecurityCenter::V1::SecurityCenter::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.run_asset_discovery({ parent: parent }) 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.run_asset_discovery parent: parent 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.run_asset_discovery ::Google::Cloud::SecurityCenter::V1::RunAssetDiscoveryRequest.new(parent: parent) 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.run_asset_discovery({ parent: parent }, 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.run_asset_discovery(::Google::Cloud::SecurityCenter::V1::RunAssetDiscoveryRequest.new(parent: parent), 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, run_asset_discovery_client_stub.call_rpc_count - end - end - - def test_set_finding_state - # Create GRPC objects. - grpc_response = ::Google::Cloud::SecurityCenter::V1::Finding.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" - state = :STATE_UNSPECIFIED - start_time = {} - - set_finding_state_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :set_finding_state, name - assert_kind_of ::Google::Cloud::SecurityCenter::V1::SetFindingStateRequest, request - assert_equal "hello world", request["name"] - assert_equal :STATE_UNSPECIFIED, request["state"] - assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Protobuf::Timestamp), request["start_time"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, set_finding_state_client_stub do - # Create client - client = ::Google::Cloud::SecurityCenter::V1::SecurityCenter::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.set_finding_state({ name: name, state: state, start_time: start_time }) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use named arguments - client.set_finding_state name: name, state: state, start_time: start_time do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object - client.set_finding_state ::Google::Cloud::SecurityCenter::V1::SetFindingStateRequest.new(name: name, state: state, start_time: start_time) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use hash object with options - client.set_finding_state({ name: name, state: state, start_time: start_time }, grpc_options) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object with options - client.set_finding_state(::Google::Cloud::SecurityCenter::V1::SetFindingStateRequest.new(name: name, state: state, start_time: start_time), grpc_options) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Verify method calls - assert_equal 5, set_finding_state_client_stub.call_rpc_count - end - end - - def test_set_mute - # Create GRPC objects. - grpc_response = ::Google::Cloud::SecurityCenter::V1::Finding.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" - mute = :MUTE_UNSPECIFIED - - set_mute_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :set_mute, name - assert_kind_of ::Google::Cloud::SecurityCenter::V1::SetMuteRequest, request - assert_equal "hello world", request["name"] - assert_equal :MUTE_UNSPECIFIED, request["mute"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, set_mute_client_stub do - # Create client - client = ::Google::Cloud::SecurityCenter::V1::SecurityCenter::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.set_mute({ name: name, mute: mute }) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use named arguments - client.set_mute name: name, mute: mute do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object - client.set_mute ::Google::Cloud::SecurityCenter::V1::SetMuteRequest.new(name: name, mute: mute) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use hash object with options - client.set_mute({ name: name, mute: mute }, grpc_options) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object with options - client.set_mute(::Google::Cloud::SecurityCenter::V1::SetMuteRequest.new(name: name, mute: mute), grpc_options) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Verify method calls - assert_equal 5, set_mute_client_stub.call_rpc_count - end - end - - def test_set_iam_policy - # Create GRPC objects. - grpc_response = ::Google::Iam::V1::Policy.new - grpc_operation = GRPC::ActiveCall::Operation.new nil - grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - grpc_options = {} - - # Create request parameters for a unary method. - resource = "hello world" - policy = {} - update_mask = {} - - set_iam_policy_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :set_iam_policy, name - assert_kind_of ::Google::Iam::V1::SetIamPolicyRequest, request - assert_equal "hello world", request["resource"] - assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Iam::V1::Policy), request["policy"] - assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Protobuf::FieldMask), request["update_mask"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, set_iam_policy_client_stub do - # Create client - client = ::Google::Cloud::SecurityCenter::V1::SecurityCenter::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.set_iam_policy({ resource: resource, policy: policy, update_mask: update_mask }) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use named arguments - client.set_iam_policy resource: resource, policy: policy, update_mask: update_mask do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object - client.set_iam_policy ::Google::Iam::V1::SetIamPolicyRequest.new(resource: resource, policy: policy, update_mask: update_mask) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use hash object with options - client.set_iam_policy({ resource: resource, policy: policy, update_mask: update_mask }, grpc_options) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object with options - client.set_iam_policy(::Google::Iam::V1::SetIamPolicyRequest.new(resource: resource, policy: policy, update_mask: update_mask), grpc_options) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Verify method calls - assert_equal 5, set_iam_policy_client_stub.call_rpc_count - end - end - - def test_test_iam_permissions - # Create GRPC objects. - grpc_response = ::Google::Iam::V1::TestIamPermissionsResponse.new - grpc_operation = GRPC::ActiveCall::Operation.new nil - grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - grpc_options = {} - - # Create request parameters for a unary method. - resource = "hello world" - permissions = ["hello world"] - - test_iam_permissions_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :test_iam_permissions, name - assert_kind_of ::Google::Iam::V1::TestIamPermissionsRequest, request - assert_equal "hello world", request["resource"] - assert_equal ["hello world"], request["permissions"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, test_iam_permissions_client_stub do - # Create client - client = ::Google::Cloud::SecurityCenter::V1::SecurityCenter::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.test_iam_permissions({ resource: resource, permissions: permissions }) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use named arguments - client.test_iam_permissions resource: resource, permissions: permissions do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object - client.test_iam_permissions ::Google::Iam::V1::TestIamPermissionsRequest.new(resource: resource, permissions: permissions) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use hash object with options - client.test_iam_permissions({ resource: resource, permissions: permissions }, grpc_options) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object with options - client.test_iam_permissions(::Google::Iam::V1::TestIamPermissionsRequest.new(resource: resource, permissions: permissions), grpc_options) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Verify method calls - assert_equal 5, test_iam_permissions_client_stub.call_rpc_count - end - end - - def test_simulate_security_health_analytics_custom_module - # Create GRPC objects. - grpc_response = ::Google::Cloud::SecurityCenter::V1::SimulateSecurityHealthAnalyticsCustomModuleResponse.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" - custom_config = {} - resource = {} - - simulate_security_health_analytics_custom_module_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :simulate_security_health_analytics_custom_module, name - assert_kind_of ::Google::Cloud::SecurityCenter::V1::SimulateSecurityHealthAnalyticsCustomModuleRequest, request - assert_equal "hello world", request["parent"] - assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::SecurityCenter::V1::CustomConfig), request["custom_config"] - assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::SecurityCenter::V1::SimulateSecurityHealthAnalyticsCustomModuleRequest::SimulatedResource), request["resource"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, simulate_security_health_analytics_custom_module_client_stub do - # Create client - client = ::Google::Cloud::SecurityCenter::V1::SecurityCenter::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.simulate_security_health_analytics_custom_module({ parent: parent, custom_config: custom_config, resource: resource }) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use named arguments - client.simulate_security_health_analytics_custom_module parent: parent, custom_config: custom_config, resource: resource do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object - client.simulate_security_health_analytics_custom_module ::Google::Cloud::SecurityCenter::V1::SimulateSecurityHealthAnalyticsCustomModuleRequest.new(parent: parent, custom_config: custom_config, resource: resource) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use hash object with options - client.simulate_security_health_analytics_custom_module({ parent: parent, custom_config: custom_config, resource: resource }, grpc_options) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object with options - client.simulate_security_health_analytics_custom_module(::Google::Cloud::SecurityCenter::V1::SimulateSecurityHealthAnalyticsCustomModuleRequest.new(parent: parent, custom_config: custom_config, resource: resource), grpc_options) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Verify method calls - assert_equal 5, simulate_security_health_analytics_custom_module_client_stub.call_rpc_count - end - end - - def test_update_external_system - # Create GRPC objects. - grpc_response = ::Google::Cloud::SecurityCenter::V1::ExternalSystem.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. - external_system = {} - update_mask = {} - - update_external_system_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :update_external_system, name - assert_kind_of ::Google::Cloud::SecurityCenter::V1::UpdateExternalSystemRequest, request - assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::SecurityCenter::V1::ExternalSystem), request["external_system"] - assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Protobuf::FieldMask), request["update_mask"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, update_external_system_client_stub do - # Create client - client = ::Google::Cloud::SecurityCenter::V1::SecurityCenter::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.update_external_system({ external_system: external_system, update_mask: update_mask }) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use named arguments - client.update_external_system external_system: external_system, update_mask: update_mask do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object - client.update_external_system ::Google::Cloud::SecurityCenter::V1::UpdateExternalSystemRequest.new(external_system: external_system, update_mask: update_mask) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use hash object with options - client.update_external_system({ external_system: external_system, update_mask: update_mask }, grpc_options) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object with options - client.update_external_system(::Google::Cloud::SecurityCenter::V1::UpdateExternalSystemRequest.new(external_system: external_system, update_mask: update_mask), grpc_options) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Verify method calls - assert_equal 5, update_external_system_client_stub.call_rpc_count - end - end - - def test_update_finding - # Create GRPC objects. - grpc_response = ::Google::Cloud::SecurityCenter::V1::Finding.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. - finding = {} - update_mask = {} - - update_finding_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :update_finding, name - assert_kind_of ::Google::Cloud::SecurityCenter::V1::UpdateFindingRequest, request - assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::SecurityCenter::V1::Finding), request["finding"] - assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Protobuf::FieldMask), request["update_mask"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, update_finding_client_stub do - # Create client - client = ::Google::Cloud::SecurityCenter::V1::SecurityCenter::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.update_finding({ finding: finding, update_mask: update_mask }) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use named arguments - client.update_finding finding: finding, update_mask: update_mask do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object - client.update_finding ::Google::Cloud::SecurityCenter::V1::UpdateFindingRequest.new(finding: finding, update_mask: update_mask) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use hash object with options - client.update_finding({ finding: finding, update_mask: update_mask }, grpc_options) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object with options - client.update_finding(::Google::Cloud::SecurityCenter::V1::UpdateFindingRequest.new(finding: finding, update_mask: update_mask), grpc_options) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Verify method calls - assert_equal 5, update_finding_client_stub.call_rpc_count - end - end - - def test_update_mute_config - # Create GRPC objects. - grpc_response = ::Google::Cloud::SecurityCenter::V1::MuteConfig.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. - mute_config = {} - update_mask = {} - - update_mute_config_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :update_mute_config, name - assert_kind_of ::Google::Cloud::SecurityCenter::V1::UpdateMuteConfigRequest, request - assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::SecurityCenter::V1::MuteConfig), request["mute_config"] - assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Protobuf::FieldMask), request["update_mask"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, update_mute_config_client_stub do - # Create client - client = ::Google::Cloud::SecurityCenter::V1::SecurityCenter::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.update_mute_config({ mute_config: mute_config, update_mask: update_mask }) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use named arguments - client.update_mute_config mute_config: mute_config, update_mask: update_mask do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object - client.update_mute_config ::Google::Cloud::SecurityCenter::V1::UpdateMuteConfigRequest.new(mute_config: mute_config, update_mask: update_mask) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use hash object with options - client.update_mute_config({ mute_config: mute_config, update_mask: update_mask }, grpc_options) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object with options - client.update_mute_config(::Google::Cloud::SecurityCenter::V1::UpdateMuteConfigRequest.new(mute_config: mute_config, update_mask: update_mask), grpc_options) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Verify method calls - assert_equal 5, update_mute_config_client_stub.call_rpc_count - end - end - - def test_update_notification_config - # Create GRPC objects. - grpc_response = ::Google::Cloud::SecurityCenter::V1::NotificationConfig.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. - notification_config = {} - update_mask = {} - - update_notification_config_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :update_notification_config, name - assert_kind_of ::Google::Cloud::SecurityCenter::V1::UpdateNotificationConfigRequest, request - assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::SecurityCenter::V1::NotificationConfig), request["notification_config"] - assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Protobuf::FieldMask), request["update_mask"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, update_notification_config_client_stub do - # Create client - client = ::Google::Cloud::SecurityCenter::V1::SecurityCenter::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.update_notification_config({ notification_config: notification_config, update_mask: update_mask }) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use named arguments - client.update_notification_config notification_config: notification_config, update_mask: update_mask do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object - client.update_notification_config ::Google::Cloud::SecurityCenter::V1::UpdateNotificationConfigRequest.new(notification_config: notification_config, update_mask: update_mask) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use hash object with options - client.update_notification_config({ notification_config: notification_config, update_mask: update_mask }, grpc_options) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object with options - client.update_notification_config(::Google::Cloud::SecurityCenter::V1::UpdateNotificationConfigRequest.new(notification_config: notification_config, update_mask: update_mask), grpc_options) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Verify method calls - assert_equal 5, update_notification_config_client_stub.call_rpc_count - end - end - - def test_update_organization_settings - # Create GRPC objects. - grpc_response = ::Google::Cloud::SecurityCenter::V1::OrganizationSettings.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. - organization_settings = {} - update_mask = {} - - update_organization_settings_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :update_organization_settings, name - assert_kind_of ::Google::Cloud::SecurityCenter::V1::UpdateOrganizationSettingsRequest, request - assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::SecurityCenter::V1::OrganizationSettings), request["organization_settings"] - assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Protobuf::FieldMask), request["update_mask"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, update_organization_settings_client_stub do - # Create client - client = ::Google::Cloud::SecurityCenter::V1::SecurityCenter::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.update_organization_settings({ organization_settings: organization_settings, update_mask: update_mask }) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use named arguments - client.update_organization_settings organization_settings: organization_settings, update_mask: update_mask do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object - client.update_organization_settings ::Google::Cloud::SecurityCenter::V1::UpdateOrganizationSettingsRequest.new(organization_settings: organization_settings, update_mask: update_mask) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use hash object with options - client.update_organization_settings({ organization_settings: organization_settings, update_mask: update_mask }, grpc_options) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object with options - client.update_organization_settings(::Google::Cloud::SecurityCenter::V1::UpdateOrganizationSettingsRequest.new(organization_settings: organization_settings, update_mask: update_mask), grpc_options) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Verify method calls - assert_equal 5, update_organization_settings_client_stub.call_rpc_count - end - end - - def test_update_security_health_analytics_custom_module - # Create GRPC objects. - grpc_response = ::Google::Cloud::SecurityCenter::V1::SecurityHealthAnalyticsCustomModule.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. - security_health_analytics_custom_module = {} - update_mask = {} - - update_security_health_analytics_custom_module_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :update_security_health_analytics_custom_module, name - assert_kind_of ::Google::Cloud::SecurityCenter::V1::UpdateSecurityHealthAnalyticsCustomModuleRequest, request - assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::SecurityCenter::V1::SecurityHealthAnalyticsCustomModule), request["security_health_analytics_custom_module"] - assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Protobuf::FieldMask), request["update_mask"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, update_security_health_analytics_custom_module_client_stub do - # Create client - client = ::Google::Cloud::SecurityCenter::V1::SecurityCenter::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.update_security_health_analytics_custom_module({ security_health_analytics_custom_module: security_health_analytics_custom_module, update_mask: update_mask }) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use named arguments - client.update_security_health_analytics_custom_module security_health_analytics_custom_module: security_health_analytics_custom_module, update_mask: update_mask do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object - client.update_security_health_analytics_custom_module ::Google::Cloud::SecurityCenter::V1::UpdateSecurityHealthAnalyticsCustomModuleRequest.new(security_health_analytics_custom_module: security_health_analytics_custom_module, update_mask: update_mask) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use hash object with options - client.update_security_health_analytics_custom_module({ security_health_analytics_custom_module: security_health_analytics_custom_module, update_mask: update_mask }, grpc_options) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object with options - client.update_security_health_analytics_custom_module(::Google::Cloud::SecurityCenter::V1::UpdateSecurityHealthAnalyticsCustomModuleRequest.new(security_health_analytics_custom_module: security_health_analytics_custom_module, update_mask: update_mask), grpc_options) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Verify method calls - assert_equal 5, update_security_health_analytics_custom_module_client_stub.call_rpc_count - end - end - - def test_update_source - # Create GRPC objects. - grpc_response = ::Google::Cloud::SecurityCenter::V1::Source.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. - source = {} - update_mask = {} - - update_source_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :update_source, name - assert_kind_of ::Google::Cloud::SecurityCenter::V1::UpdateSourceRequest, request - assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::SecurityCenter::V1::Source), request["source"] - assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Protobuf::FieldMask), request["update_mask"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, update_source_client_stub do - # Create client - client = ::Google::Cloud::SecurityCenter::V1::SecurityCenter::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.update_source({ source: source, update_mask: update_mask }) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use named arguments - client.update_source source: source, update_mask: update_mask do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object - client.update_source ::Google::Cloud::SecurityCenter::V1::UpdateSourceRequest.new(source: source, update_mask: update_mask) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use hash object with options - client.update_source({ source: source, update_mask: update_mask }, grpc_options) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object with options - client.update_source(::Google::Cloud::SecurityCenter::V1::UpdateSourceRequest.new(source: source, update_mask: update_mask), grpc_options) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Verify method calls - assert_equal 5, update_source_client_stub.call_rpc_count - end - end - - def test_update_security_marks - # Create GRPC objects. - grpc_response = ::Google::Cloud::SecurityCenter::V1::SecurityMarks.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. - security_marks = {} - update_mask = {} - start_time = {} - - update_security_marks_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :update_security_marks, name - assert_kind_of ::Google::Cloud::SecurityCenter::V1::UpdateSecurityMarksRequest, request - assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::SecurityCenter::V1::SecurityMarks), request["security_marks"] - assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Protobuf::FieldMask), request["update_mask"] - assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Protobuf::Timestamp), request["start_time"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, update_security_marks_client_stub do - # Create client - client = ::Google::Cloud::SecurityCenter::V1::SecurityCenter::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.update_security_marks({ security_marks: security_marks, update_mask: update_mask, start_time: start_time }) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use named arguments - client.update_security_marks security_marks: security_marks, update_mask: update_mask, start_time: start_time do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object - client.update_security_marks ::Google::Cloud::SecurityCenter::V1::UpdateSecurityMarksRequest.new(security_marks: security_marks, update_mask: update_mask, start_time: start_time) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use hash object with options - client.update_security_marks({ security_marks: security_marks, update_mask: update_mask, start_time: start_time }, grpc_options) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object with options - client.update_security_marks(::Google::Cloud::SecurityCenter::V1::UpdateSecurityMarksRequest.new(security_marks: security_marks, update_mask: update_mask, start_time: start_time), grpc_options) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Verify method calls - assert_equal 5, update_security_marks_client_stub.call_rpc_count - end - end - - def test_create_big_query_export - # Create GRPC objects. - grpc_response = ::Google::Cloud::SecurityCenter::V1::BigQueryExport.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" - big_query_export = {} - big_query_export_id = "hello world" - - create_big_query_export_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :create_big_query_export, name - assert_kind_of ::Google::Cloud::SecurityCenter::V1::CreateBigQueryExportRequest, request - assert_equal "hello world", request["parent"] - assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::SecurityCenter::V1::BigQueryExport), request["big_query_export"] - assert_equal "hello world", request["big_query_export_id"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, create_big_query_export_client_stub do - # Create client - client = ::Google::Cloud::SecurityCenter::V1::SecurityCenter::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.create_big_query_export({ parent: parent, big_query_export: big_query_export, big_query_export_id: big_query_export_id }) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use named arguments - client.create_big_query_export parent: parent, big_query_export: big_query_export, big_query_export_id: big_query_export_id do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object - client.create_big_query_export ::Google::Cloud::SecurityCenter::V1::CreateBigQueryExportRequest.new(parent: parent, big_query_export: big_query_export, big_query_export_id: big_query_export_id) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use hash object with options - client.create_big_query_export({ parent: parent, big_query_export: big_query_export, big_query_export_id: big_query_export_id }, grpc_options) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object with options - client.create_big_query_export(::Google::Cloud::SecurityCenter::V1::CreateBigQueryExportRequest.new(parent: parent, big_query_export: big_query_export, big_query_export_id: big_query_export_id), grpc_options) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Verify method calls - assert_equal 5, create_big_query_export_client_stub.call_rpc_count - end - end - - def test_delete_big_query_export - # 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_big_query_export_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :delete_big_query_export, name - assert_kind_of ::Google::Cloud::SecurityCenter::V1::DeleteBigQueryExportRequest, request - assert_equal "hello world", request["name"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, delete_big_query_export_client_stub do - # Create client - client = ::Google::Cloud::SecurityCenter::V1::SecurityCenter::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.delete_big_query_export({ name: name }) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use named arguments - client.delete_big_query_export name: name do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object - client.delete_big_query_export ::Google::Cloud::SecurityCenter::V1::DeleteBigQueryExportRequest.new(name: name) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use hash object with options - client.delete_big_query_export({ 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_big_query_export(::Google::Cloud::SecurityCenter::V1::DeleteBigQueryExportRequest.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_big_query_export_client_stub.call_rpc_count - end - end - - def test_update_big_query_export - # Create GRPC objects. - grpc_response = ::Google::Cloud::SecurityCenter::V1::BigQueryExport.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. - big_query_export = {} - update_mask = {} - - update_big_query_export_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :update_big_query_export, name - assert_kind_of ::Google::Cloud::SecurityCenter::V1::UpdateBigQueryExportRequest, request - assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::SecurityCenter::V1::BigQueryExport), request["big_query_export"] - assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Protobuf::FieldMask), request["update_mask"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, update_big_query_export_client_stub do - # Create client - client = ::Google::Cloud::SecurityCenter::V1::SecurityCenter::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.update_big_query_export({ big_query_export: big_query_export, update_mask: update_mask }) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use named arguments - client.update_big_query_export big_query_export: big_query_export, update_mask: update_mask do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object - client.update_big_query_export ::Google::Cloud::SecurityCenter::V1::UpdateBigQueryExportRequest.new(big_query_export: big_query_export, update_mask: update_mask) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use hash object with options - client.update_big_query_export({ big_query_export: big_query_export, update_mask: update_mask }, grpc_options) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object with options - client.update_big_query_export(::Google::Cloud::SecurityCenter::V1::UpdateBigQueryExportRequest.new(big_query_export: big_query_export, update_mask: update_mask), grpc_options) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Verify method calls - assert_equal 5, update_big_query_export_client_stub.call_rpc_count - end - end - - def test_list_big_query_exports - # Create GRPC objects. - grpc_response = ::Google::Cloud::SecurityCenter::V1::ListBigQueryExportsResponse.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_big_query_exports_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :list_big_query_exports, name - assert_kind_of ::Google::Cloud::SecurityCenter::V1::ListBigQueryExportsRequest, 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_big_query_exports_client_stub do - # Create client - client = ::Google::Cloud::SecurityCenter::V1::SecurityCenter::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.list_big_query_exports({ 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_big_query_exports 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_big_query_exports ::Google::Cloud::SecurityCenter::V1::ListBigQueryExportsRequest.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_big_query_exports({ 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_big_query_exports(::Google::Cloud::SecurityCenter::V1::ListBigQueryExportsRequest.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_big_query_exports_client_stub.call_rpc_count - end - end - - def test_create_event_threat_detection_custom_module - # Create GRPC objects. - grpc_response = ::Google::Cloud::SecurityCenter::V1::EventThreatDetectionCustomModule.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" - event_threat_detection_custom_module = {} - - create_event_threat_detection_custom_module_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :create_event_threat_detection_custom_module, name - assert_kind_of ::Google::Cloud::SecurityCenter::V1::CreateEventThreatDetectionCustomModuleRequest, request - assert_equal "hello world", request["parent"] - assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::SecurityCenter::V1::EventThreatDetectionCustomModule), request["event_threat_detection_custom_module"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, create_event_threat_detection_custom_module_client_stub do - # Create client - client = ::Google::Cloud::SecurityCenter::V1::SecurityCenter::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.create_event_threat_detection_custom_module({ parent: parent, event_threat_detection_custom_module: event_threat_detection_custom_module }) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use named arguments - client.create_event_threat_detection_custom_module parent: parent, event_threat_detection_custom_module: event_threat_detection_custom_module do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object - client.create_event_threat_detection_custom_module ::Google::Cloud::SecurityCenter::V1::CreateEventThreatDetectionCustomModuleRequest.new(parent: parent, event_threat_detection_custom_module: event_threat_detection_custom_module) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use hash object with options - client.create_event_threat_detection_custom_module({ parent: parent, event_threat_detection_custom_module: event_threat_detection_custom_module }, grpc_options) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object with options - client.create_event_threat_detection_custom_module(::Google::Cloud::SecurityCenter::V1::CreateEventThreatDetectionCustomModuleRequest.new(parent: parent, event_threat_detection_custom_module: event_threat_detection_custom_module), grpc_options) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Verify method calls - assert_equal 5, create_event_threat_detection_custom_module_client_stub.call_rpc_count - end - end - - def test_delete_event_threat_detection_custom_module - # 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_event_threat_detection_custom_module_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :delete_event_threat_detection_custom_module, name - assert_kind_of ::Google::Cloud::SecurityCenter::V1::DeleteEventThreatDetectionCustomModuleRequest, request - assert_equal "hello world", request["name"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, delete_event_threat_detection_custom_module_client_stub do - # Create client - client = ::Google::Cloud::SecurityCenter::V1::SecurityCenter::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.delete_event_threat_detection_custom_module({ name: name }) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use named arguments - client.delete_event_threat_detection_custom_module name: name do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object - client.delete_event_threat_detection_custom_module ::Google::Cloud::SecurityCenter::V1::DeleteEventThreatDetectionCustomModuleRequest.new(name: name) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use hash object with options - client.delete_event_threat_detection_custom_module({ 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_event_threat_detection_custom_module(::Google::Cloud::SecurityCenter::V1::DeleteEventThreatDetectionCustomModuleRequest.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_event_threat_detection_custom_module_client_stub.call_rpc_count - end - end - - def test_get_event_threat_detection_custom_module - # Create GRPC objects. - grpc_response = ::Google::Cloud::SecurityCenter::V1::EventThreatDetectionCustomModule.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_event_threat_detection_custom_module_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :get_event_threat_detection_custom_module, name - assert_kind_of ::Google::Cloud::SecurityCenter::V1::GetEventThreatDetectionCustomModuleRequest, request - assert_equal "hello world", request["name"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, get_event_threat_detection_custom_module_client_stub do - # Create client - client = ::Google::Cloud::SecurityCenter::V1::SecurityCenter::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.get_event_threat_detection_custom_module({ name: name }) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use named arguments - client.get_event_threat_detection_custom_module name: name do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object - client.get_event_threat_detection_custom_module ::Google::Cloud::SecurityCenter::V1::GetEventThreatDetectionCustomModuleRequest.new(name: name) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use hash object with options - client.get_event_threat_detection_custom_module({ 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_event_threat_detection_custom_module(::Google::Cloud::SecurityCenter::V1::GetEventThreatDetectionCustomModuleRequest.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_event_threat_detection_custom_module_client_stub.call_rpc_count - end - end - - def test_list_descendant_event_threat_detection_custom_modules - # Create GRPC objects. - grpc_response = ::Google::Cloud::SecurityCenter::V1::ListDescendantEventThreatDetectionCustomModulesResponse.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_token = "hello world" - page_size = 42 - - list_descendant_event_threat_detection_custom_modules_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :list_descendant_event_threat_detection_custom_modules, name - assert_kind_of ::Google::Cloud::SecurityCenter::V1::ListDescendantEventThreatDetectionCustomModulesRequest, request - assert_equal "hello world", request["parent"] - assert_equal "hello world", request["page_token"] - assert_equal 42, request["page_size"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, list_descendant_event_threat_detection_custom_modules_client_stub do - # Create client - client = ::Google::Cloud::SecurityCenter::V1::SecurityCenter::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.list_descendant_event_threat_detection_custom_modules({ parent: parent, page_token: page_token, page_size: page_size }) 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_descendant_event_threat_detection_custom_modules parent: parent, page_token: page_token, page_size: page_size 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_descendant_event_threat_detection_custom_modules ::Google::Cloud::SecurityCenter::V1::ListDescendantEventThreatDetectionCustomModulesRequest.new(parent: parent, page_token: page_token, page_size: page_size) 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_descendant_event_threat_detection_custom_modules({ parent: parent, page_token: page_token, page_size: page_size }, 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_descendant_event_threat_detection_custom_modules(::Google::Cloud::SecurityCenter::V1::ListDescendantEventThreatDetectionCustomModulesRequest.new(parent: parent, page_token: page_token, page_size: page_size), 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_descendant_event_threat_detection_custom_modules_client_stub.call_rpc_count - end - end - - def test_list_event_threat_detection_custom_modules - # Create GRPC objects. - grpc_response = ::Google::Cloud::SecurityCenter::V1::ListEventThreatDetectionCustomModulesResponse.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_token = "hello world" - page_size = 42 - - list_event_threat_detection_custom_modules_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :list_event_threat_detection_custom_modules, name - assert_kind_of ::Google::Cloud::SecurityCenter::V1::ListEventThreatDetectionCustomModulesRequest, request - assert_equal "hello world", request["parent"] - assert_equal "hello world", request["page_token"] - assert_equal 42, request["page_size"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, list_event_threat_detection_custom_modules_client_stub do - # Create client - client = ::Google::Cloud::SecurityCenter::V1::SecurityCenter::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.list_event_threat_detection_custom_modules({ parent: parent, page_token: page_token, page_size: page_size }) 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_event_threat_detection_custom_modules parent: parent, page_token: page_token, page_size: page_size 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_event_threat_detection_custom_modules ::Google::Cloud::SecurityCenter::V1::ListEventThreatDetectionCustomModulesRequest.new(parent: parent, page_token: page_token, page_size: page_size) 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_event_threat_detection_custom_modules({ parent: parent, page_token: page_token, page_size: page_size }, 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_event_threat_detection_custom_modules(::Google::Cloud::SecurityCenter::V1::ListEventThreatDetectionCustomModulesRequest.new(parent: parent, page_token: page_token, page_size: page_size), 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_event_threat_detection_custom_modules_client_stub.call_rpc_count - end - end - - def test_update_event_threat_detection_custom_module - # Create GRPC objects. - grpc_response = ::Google::Cloud::SecurityCenter::V1::EventThreatDetectionCustomModule.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. - event_threat_detection_custom_module = {} - update_mask = {} - - update_event_threat_detection_custom_module_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :update_event_threat_detection_custom_module, name - assert_kind_of ::Google::Cloud::SecurityCenter::V1::UpdateEventThreatDetectionCustomModuleRequest, request - assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::SecurityCenter::V1::EventThreatDetectionCustomModule), request["event_threat_detection_custom_module"] - assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Protobuf::FieldMask), request["update_mask"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, update_event_threat_detection_custom_module_client_stub do - # Create client - client = ::Google::Cloud::SecurityCenter::V1::SecurityCenter::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.update_event_threat_detection_custom_module({ event_threat_detection_custom_module: event_threat_detection_custom_module, update_mask: update_mask }) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use named arguments - client.update_event_threat_detection_custom_module event_threat_detection_custom_module: event_threat_detection_custom_module, update_mask: update_mask do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object - client.update_event_threat_detection_custom_module ::Google::Cloud::SecurityCenter::V1::UpdateEventThreatDetectionCustomModuleRequest.new(event_threat_detection_custom_module: event_threat_detection_custom_module, update_mask: update_mask) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use hash object with options - client.update_event_threat_detection_custom_module({ event_threat_detection_custom_module: event_threat_detection_custom_module, update_mask: update_mask }, grpc_options) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object with options - client.update_event_threat_detection_custom_module(::Google::Cloud::SecurityCenter::V1::UpdateEventThreatDetectionCustomModuleRequest.new(event_threat_detection_custom_module: event_threat_detection_custom_module, update_mask: update_mask), grpc_options) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Verify method calls - assert_equal 5, update_event_threat_detection_custom_module_client_stub.call_rpc_count - end - end - - def test_validate_event_threat_detection_custom_module - # Create GRPC objects. - grpc_response = ::Google::Cloud::SecurityCenter::V1::ValidateEventThreatDetectionCustomModuleResponse.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" - raw_text = "hello world" - type = "hello world" - - validate_event_threat_detection_custom_module_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :validate_event_threat_detection_custom_module, name - assert_kind_of ::Google::Cloud::SecurityCenter::V1::ValidateEventThreatDetectionCustomModuleRequest, request - assert_equal "hello world", request["parent"] - assert_equal "hello world", request["raw_text"] - assert_equal "hello world", request["type"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, validate_event_threat_detection_custom_module_client_stub do - # Create client - client = ::Google::Cloud::SecurityCenter::V1::SecurityCenter::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.validate_event_threat_detection_custom_module({ parent: parent, raw_text: raw_text, type: type }) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use named arguments - client.validate_event_threat_detection_custom_module parent: parent, raw_text: raw_text, type: type do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object - client.validate_event_threat_detection_custom_module ::Google::Cloud::SecurityCenter::V1::ValidateEventThreatDetectionCustomModuleRequest.new(parent: parent, raw_text: raw_text, type: type) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use hash object with options - client.validate_event_threat_detection_custom_module({ parent: parent, raw_text: raw_text, type: type }, grpc_options) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object with options - client.validate_event_threat_detection_custom_module(::Google::Cloud::SecurityCenter::V1::ValidateEventThreatDetectionCustomModuleRequest.new(parent: parent, raw_text: raw_text, type: type), grpc_options) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Verify method calls - assert_equal 5, validate_event_threat_detection_custom_module_client_stub.call_rpc_count - end - end - - def test_get_effective_event_threat_detection_custom_module - # Create GRPC objects. - grpc_response = ::Google::Cloud::SecurityCenter::V1::EffectiveEventThreatDetectionCustomModule.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_effective_event_threat_detection_custom_module_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :get_effective_event_threat_detection_custom_module, name - assert_kind_of ::Google::Cloud::SecurityCenter::V1::GetEffectiveEventThreatDetectionCustomModuleRequest, request - assert_equal "hello world", request["name"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, get_effective_event_threat_detection_custom_module_client_stub do - # Create client - client = ::Google::Cloud::SecurityCenter::V1::SecurityCenter::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.get_effective_event_threat_detection_custom_module({ name: name }) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use named arguments - client.get_effective_event_threat_detection_custom_module name: name do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object - client.get_effective_event_threat_detection_custom_module ::Google::Cloud::SecurityCenter::V1::GetEffectiveEventThreatDetectionCustomModuleRequest.new(name: name) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use hash object with options - client.get_effective_event_threat_detection_custom_module({ 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_effective_event_threat_detection_custom_module(::Google::Cloud::SecurityCenter::V1::GetEffectiveEventThreatDetectionCustomModuleRequest.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_effective_event_threat_detection_custom_module_client_stub.call_rpc_count - end - end - - def test_list_effective_event_threat_detection_custom_modules - # Create GRPC objects. - grpc_response = ::Google::Cloud::SecurityCenter::V1::ListEffectiveEventThreatDetectionCustomModulesResponse.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_token = "hello world" - page_size = 42 - - list_effective_event_threat_detection_custom_modules_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :list_effective_event_threat_detection_custom_modules, name - assert_kind_of ::Google::Cloud::SecurityCenter::V1::ListEffectiveEventThreatDetectionCustomModulesRequest, request - assert_equal "hello world", request["parent"] - assert_equal "hello world", request["page_token"] - assert_equal 42, request["page_size"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, list_effective_event_threat_detection_custom_modules_client_stub do - # Create client - client = ::Google::Cloud::SecurityCenter::V1::SecurityCenter::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.list_effective_event_threat_detection_custom_modules({ parent: parent, page_token: page_token, page_size: page_size }) 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_effective_event_threat_detection_custom_modules parent: parent, page_token: page_token, page_size: page_size 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_effective_event_threat_detection_custom_modules ::Google::Cloud::SecurityCenter::V1::ListEffectiveEventThreatDetectionCustomModulesRequest.new(parent: parent, page_token: page_token, page_size: page_size) 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_effective_event_threat_detection_custom_modules({ parent: parent, page_token: page_token, page_size: page_size }, 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_effective_event_threat_detection_custom_modules(::Google::Cloud::SecurityCenter::V1::ListEffectiveEventThreatDetectionCustomModulesRequest.new(parent: parent, page_token: page_token, page_size: page_size), 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_effective_event_threat_detection_custom_modules_client_stub.call_rpc_count - end - end - - def test_batch_create_resource_value_configs - # Create GRPC objects. - grpc_response = ::Google::Cloud::SecurityCenter::V1::BatchCreateResourceValueConfigsResponse.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" - requests = [{}] - - batch_create_resource_value_configs_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :batch_create_resource_value_configs, name - assert_kind_of ::Google::Cloud::SecurityCenter::V1::BatchCreateResourceValueConfigsRequest, request - assert_equal "hello world", request["parent"] - assert_kind_of ::Google::Cloud::SecurityCenter::V1::CreateResourceValueConfigRequest, request["requests"].first - refute_nil options - end - - Gapic::ServiceStub.stub :new, batch_create_resource_value_configs_client_stub do - # Create client - client = ::Google::Cloud::SecurityCenter::V1::SecurityCenter::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.batch_create_resource_value_configs({ parent: parent, requests: requests }) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use named arguments - client.batch_create_resource_value_configs parent: parent, requests: requests do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object - client.batch_create_resource_value_configs ::Google::Cloud::SecurityCenter::V1::BatchCreateResourceValueConfigsRequest.new(parent: parent, requests: requests) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use hash object with options - client.batch_create_resource_value_configs({ parent: parent, requests: requests }, grpc_options) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object with options - client.batch_create_resource_value_configs(::Google::Cloud::SecurityCenter::V1::BatchCreateResourceValueConfigsRequest.new(parent: parent, requests: requests), grpc_options) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Verify method calls - assert_equal 5, batch_create_resource_value_configs_client_stub.call_rpc_count - end - end - - def test_delete_resource_value_config - # 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_resource_value_config_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :delete_resource_value_config, name - assert_kind_of ::Google::Cloud::SecurityCenter::V1::DeleteResourceValueConfigRequest, request - assert_equal "hello world", request["name"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, delete_resource_value_config_client_stub do - # Create client - client = ::Google::Cloud::SecurityCenter::V1::SecurityCenter::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.delete_resource_value_config({ name: name }) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use named arguments - client.delete_resource_value_config name: name do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object - client.delete_resource_value_config ::Google::Cloud::SecurityCenter::V1::DeleteResourceValueConfigRequest.new(name: name) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use hash object with options - client.delete_resource_value_config({ name: name }, grpc_options) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object with options - client.delete_resource_value_config(::Google::Cloud::SecurityCenter::V1::DeleteResourceValueConfigRequest.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_resource_value_config_client_stub.call_rpc_count - end - end - - def test_get_resource_value_config - # Create GRPC objects. - grpc_response = ::Google::Cloud::SecurityCenter::V1::ResourceValueConfig.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_resource_value_config_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :get_resource_value_config, name - assert_kind_of ::Google::Cloud::SecurityCenter::V1::GetResourceValueConfigRequest, request - assert_equal "hello world", request["name"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, get_resource_value_config_client_stub do - # Create client - client = ::Google::Cloud::SecurityCenter::V1::SecurityCenter::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.get_resource_value_config({ name: name }) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use named arguments - client.get_resource_value_config name: name do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object - client.get_resource_value_config ::Google::Cloud::SecurityCenter::V1::GetResourceValueConfigRequest.new(name: name) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use hash object with options - client.get_resource_value_config({ name: name }, grpc_options) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object with options - client.get_resource_value_config(::Google::Cloud::SecurityCenter::V1::GetResourceValueConfigRequest.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_resource_value_config_client_stub.call_rpc_count - end - end - - def test_list_resource_value_configs - # Create GRPC objects. - grpc_response = ::Google::Cloud::SecurityCenter::V1::ListResourceValueConfigsResponse.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_resource_value_configs_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :list_resource_value_configs, name - assert_kind_of ::Google::Cloud::SecurityCenter::V1::ListResourceValueConfigsRequest, 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_resource_value_configs_client_stub do - # Create client - client = ::Google::Cloud::SecurityCenter::V1::SecurityCenter::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.list_resource_value_configs({ 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_resource_value_configs 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_resource_value_configs ::Google::Cloud::SecurityCenter::V1::ListResourceValueConfigsRequest.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_resource_value_configs({ 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_resource_value_configs(::Google::Cloud::SecurityCenter::V1::ListResourceValueConfigsRequest.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_resource_value_configs_client_stub.call_rpc_count - end - end - - def test_update_resource_value_config - # Create GRPC objects. - grpc_response = ::Google::Cloud::SecurityCenter::V1::ResourceValueConfig.new - grpc_operation = GRPC::ActiveCall::Operation.new nil - grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - grpc_options = {} - - # Create request parameters for a unary method. - resource_value_config = {} - update_mask = {} - - update_resource_value_config_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :update_resource_value_config, name - assert_kind_of ::Google::Cloud::SecurityCenter::V1::UpdateResourceValueConfigRequest, request - assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::SecurityCenter::V1::ResourceValueConfig), request["resource_value_config"] - assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Protobuf::FieldMask), request["update_mask"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, update_resource_value_config_client_stub do - # Create client - client = ::Google::Cloud::SecurityCenter::V1::SecurityCenter::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.update_resource_value_config({ resource_value_config: resource_value_config, update_mask: update_mask }) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use named arguments - client.update_resource_value_config resource_value_config: resource_value_config, update_mask: update_mask do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object - client.update_resource_value_config ::Google::Cloud::SecurityCenter::V1::UpdateResourceValueConfigRequest.new(resource_value_config: resource_value_config, update_mask: update_mask) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use hash object with options - client.update_resource_value_config({ resource_value_config: resource_value_config, update_mask: update_mask }, grpc_options) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object with options - client.update_resource_value_config(::Google::Cloud::SecurityCenter::V1::UpdateResourceValueConfigRequest.new(resource_value_config: resource_value_config, update_mask: update_mask), grpc_options) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Verify method calls - assert_equal 5, update_resource_value_config_client_stub.call_rpc_count - end - end - - def test_list_valued_resources - # Create GRPC objects. - grpc_response = ::Google::Cloud::SecurityCenter::V1::ListValuedResourcesResponse.new - grpc_operation = GRPC::ActiveCall::Operation.new nil - grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - grpc_options = {} - - # Create request parameters for a unary method. - parent = "hello world" - filter = "hello world" - page_token = "hello world" - page_size = 42 - order_by = "hello world" - - list_valued_resources_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :list_valued_resources, name - assert_kind_of ::Google::Cloud::SecurityCenter::V1::ListValuedResourcesRequest, request - assert_equal "hello world", request["parent"] - assert_equal "hello world", request["filter"] - assert_equal "hello world", request["page_token"] - assert_equal 42, request["page_size"] - assert_equal "hello world", request["order_by"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, list_valued_resources_client_stub do - # Create client - client = ::Google::Cloud::SecurityCenter::V1::SecurityCenter::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.list_valued_resources({ parent: parent, filter: filter, page_token: page_token, page_size: page_size, order_by: order_by }) 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_valued_resources parent: parent, filter: filter, page_token: page_token, page_size: page_size, order_by: order_by 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_valued_resources ::Google::Cloud::SecurityCenter::V1::ListValuedResourcesRequest.new(parent: parent, filter: filter, page_token: page_token, page_size: page_size, order_by: order_by) 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_valued_resources({ parent: parent, filter: filter, page_token: page_token, page_size: page_size, order_by: order_by }, 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_valued_resources(::Google::Cloud::SecurityCenter::V1::ListValuedResourcesRequest.new(parent: parent, filter: filter, page_token: page_token, page_size: page_size, order_by: order_by), 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_valued_resources_client_stub.call_rpc_count - end - end - - def test_list_attack_paths - # Create GRPC objects. - grpc_response = ::Google::Cloud::SecurityCenter::V1::ListAttackPathsResponse.new - grpc_operation = GRPC::ActiveCall::Operation.new nil - grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - grpc_options = {} - - # Create request parameters for a unary method. - parent = "hello world" - filter = "hello world" - page_token = "hello world" - page_size = 42 - - list_attack_paths_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :list_attack_paths, name - assert_kind_of ::Google::Cloud::SecurityCenter::V1::ListAttackPathsRequest, request - assert_equal "hello world", request["parent"] - assert_equal "hello world", request["filter"] - assert_equal "hello world", request["page_token"] - assert_equal 42, request["page_size"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, list_attack_paths_client_stub do - # Create client - client = ::Google::Cloud::SecurityCenter::V1::SecurityCenter::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.list_attack_paths({ parent: parent, filter: filter, page_token: page_token, page_size: page_size }) 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_attack_paths parent: parent, filter: filter, page_token: page_token, page_size: page_size 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_attack_paths ::Google::Cloud::SecurityCenter::V1::ListAttackPathsRequest.new(parent: parent, filter: filter, page_token: page_token, page_size: page_size) 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_attack_paths({ parent: parent, filter: filter, page_token: page_token, page_size: page_size }, 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_attack_paths(::Google::Cloud::SecurityCenter::V1::ListAttackPathsRequest.new(parent: parent, filter: filter, page_token: page_token, page_size: page_size), 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_attack_paths_client_stub.call_rpc_count - end - end - - def test_configure - grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - - client = block_config = config = nil - dummy_stub = ClientStub.new nil, nil - Gapic::ServiceStub.stub :new, dummy_stub do - client = ::Google::Cloud::SecurityCenter::V1::SecurityCenter::Client.new do |config| - config.credentials = grpc_channel - end - end - - config = client.configure do |c| - block_config = c - end - - assert_same block_config, config - assert_kind_of ::Google::Cloud::SecurityCenter::V1::SecurityCenter::Client::Configuration, config - end - - def test_credentials - key = OpenSSL::PKey::RSA.new 2048 - cred_json = { - "private_key" => key.to_pem, - "client_email" => "app@developer.gserviceaccount.com", - "type" => "service_account" - } - key_file = StringIO.new cred_json.to_json - creds = Google::Auth::ServiceAccountCredentials.make_creds({ json_key_io: key_file }) - - dummy_stub = ClientStub.new nil, nil - Gapic::ServiceStub.stub :new, dummy_stub do - client = ::Google::Cloud::SecurityCenter::V1::SecurityCenter::Client.new do |config| - config.credentials = creds - end - assert_kind_of ::Google::Cloud::SecurityCenter::V1::SecurityCenter::Client, client - assert_equal creds, client.configure.credentials - end - end - - def test_operations_client - grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - - client = nil - dummy_stub = ClientStub.new nil, nil - Gapic::ServiceStub.stub :new, dummy_stub do - client = ::Google::Cloud::SecurityCenter::V1::SecurityCenter::Client.new do |config| - config.credentials = grpc_channel - end - end - - assert_kind_of ::Google::Cloud::SecurityCenter::V1::SecurityCenter::Operations, client.operations_client - end -end diff --git a/owl-bot-staging/google-cloud-security_center-v1/test/helper.rb b/owl-bot-staging/google-cloud-security_center-v1/test/helper.rb deleted file mode 100644 index 672b337030e7..000000000000 --- a/owl-bot-staging/google-cloud-security_center-v1/test/helper.rb +++ /dev/null @@ -1,26 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -require "minitest/autorun" -require "minitest/focus" -require "minitest/mock" -require "minitest/rg" - -require "grpc" - -require "ostruct" diff --git a/owl-bot-staging/google-cloud-security_center-v1p1beta1/.gitignore b/owl-bot-staging/google-cloud-security_center-v1p1beta1/.gitignore deleted file mode 100644 index 0135b6bc6cfc..000000000000 --- a/owl-bot-staging/google-cloud-security_center-v1p1beta1/.gitignore +++ /dev/null @@ -1,22 +0,0 @@ -# Ignore bundler lockfiles -Gemfile.lock -gems.locked - -# Ignore documentation output -doc/* -.yardoc/* - -# Ignore test output -coverage/* - -# Ignore build artifacts -pkg/* - -# Ignore files commonly present in certain dev environments -.vagrant -.DS_STORE -.idea -*.iml - -# Ignore synth output -__pycache__ diff --git a/owl-bot-staging/google-cloud-security_center-v1p1beta1/.repo-metadata.json b/owl-bot-staging/google-cloud-security_center-v1p1beta1/.repo-metadata.json deleted file mode 100644 index a20578f7275e..000000000000 --- a/owl-bot-staging/google-cloud-security_center-v1p1beta1/.repo-metadata.json +++ /dev/null @@ -1,18 +0,0 @@ -{ - "api_id": "securitycenter.googleapis.com", - "api_shortname": "securitycenter", - "client_documentation": "https://cloud.google.com/ruby/docs/reference/google-cloud-security_center-v1p1beta1/latest", - "distribution_name": "google-cloud-security_center-v1p1beta1", - "is_cloud": true, - "language": "ruby", - "name": "securitycenter", - "name_pretty": "Cloud Security Command Center V1p1beta1 API", - "product_documentation": "https://cloud.google.com/security-command-center", - "release_level": "unreleased", - "repo": "googleapis/google-cloud-ruby", - "requires_billing": true, - "ruby-cloud-description": "Security Command Center API provides access to temporal views of assets and findings within an organization. Note that google-cloud-security_center-v1p1beta1 is a version-specific client library. For most uses, we recommend installing the main client library google-cloud-security_center instead. See the readme for more details.", - "ruby-cloud-env-prefix": "SECURITY_CENTER", - "ruby-cloud-product-url": "https://cloud.google.com/security-command-center", - "library_type": "GAPIC_AUTO" -} diff --git a/owl-bot-staging/google-cloud-security_center-v1p1beta1/.rubocop.yml b/owl-bot-staging/google-cloud-security_center-v1p1beta1/.rubocop.yml deleted file mode 100644 index 83496958be62..000000000000 --- a/owl-bot-staging/google-cloud-security_center-v1p1beta1/.rubocop.yml +++ /dev/null @@ -1,33 +0,0 @@ -inherit_gem: - google-style: google-style.yml - -AllCops: - Exclude: - - "google-cloud-security_center-v1p1beta1.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-security_center-v1p1beta1.rb" diff --git a/owl-bot-staging/google-cloud-security_center-v1p1beta1/.toys.rb b/owl-bot-staging/google-cloud-security_center-v1p1beta1/.toys.rb deleted file mode 100644 index 177e22456e8a..000000000000 --- a/owl-bot-staging/google-cloud-security_center-v1p1beta1/.toys.rb +++ /dev/null @@ -1,28 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -toys_version! ">= 0.15.3" - -if ENV["RUBY_COMMON_TOOLS"] - common_tools_dir = File.expand_path ENV["RUBY_COMMON_TOOLS"] - load File.join(common_tools_dir, "toys", "gapic") -else - load_git remote: "https://github.com/googleapis/ruby-common-tools.git", - path: "toys/gapic", - update: true -end diff --git a/owl-bot-staging/google-cloud-security_center-v1p1beta1/.yardopts b/owl-bot-staging/google-cloud-security_center-v1p1beta1/.yardopts deleted file mode 100644 index ebd7730f355a..000000000000 --- a/owl-bot-staging/google-cloud-security_center-v1p1beta1/.yardopts +++ /dev/null @@ -1,12 +0,0 @@ ---no-private ---title="Cloud Security Command Center V1p1beta1 API" ---exclude _pb\.rb$ ---markup markdown ---markup-provider redcarpet - -./lib/**/*.rb -./proto_docs/**/*.rb -- -README.md -LICENSE.md -AUTHENTICATION.md diff --git a/owl-bot-staging/google-cloud-security_center-v1p1beta1/AUTHENTICATION.md b/owl-bot-staging/google-cloud-security_center-v1p1beta1/AUTHENTICATION.md deleted file mode 100644 index 3e145a9570e2..000000000000 --- a/owl-bot-staging/google-cloud-security_center-v1p1beta1/AUTHENTICATION.md +++ /dev/null @@ -1,122 +0,0 @@ -# Authentication - -The recommended way to authenticate to the google-cloud-security_center-v1p1beta1 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-security_center-v1p1beta1 library provides several mechanisms to configure your system. -Generally, using Application Default Credentials to facilitate automatic -credentials discovery is the easist method. But if you need to explicitly specify -credentials, there are several methods available to you. - -Credentials are accepted in the following ways, in the following order or precedence: - -1. Credentials specified in method arguments -2. Credentials specified in configuration -3. Credentials pointed to or included in environment variables -4. Credentials found in local ADC file -5. Credentials returned by the metadata server for the attached service account (GCP) - -### Configuration - -You can configure a path to a JSON credentials file, either for an individual client object or -globally, for all client objects. The JSON file can contain credentials created for -[workload identity federation](https://cloud.google.com/iam/docs/workload-identity-federation), -[workforce identity federation](https://cloud.google.com/iam/docs/workforce-identity-federation), or a -[service account key](https://cloud.google.com/docs/authentication/provide-credentials-adc#local-key). - -Note: Service account keys are a security risk if not managed correctly. You should -[choose a more secure alternative to service account keys](https://cloud.google.com/docs/authentication#auth-decision-tree) -whenever possible. - -To configure a credentials file for an individual client initialization: - -```ruby -require "google/cloud/security_center/v1p1beta1" - -client = ::Google::Cloud::SecurityCenter::V1p1beta1::SecurityCenter::Client.new do |config| - config.credentials = "path/to/credentialfile.json" -end -``` - -To configure a credentials file globally for all clients: - -```ruby -require "google/cloud/security_center/v1p1beta1" - -::Google::Cloud::SecurityCenter::V1p1beta1::SecurityCenter::Client.configure do |config| - config.credentials = "path/to/credentialfile.json" -end - -client = ::Google::Cloud::SecurityCenter::V1p1beta1::SecurityCenter::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-security_center-v1p1beta1 -checks for credentials are: - -* `GOOGLE_CLOUD_CREDENTIALS` - Path to JSON file, or JSON contents -* `GOOGLE_APPLICATION_CREDENTIALS` - Path to JSON file - -```ruby -require "google/cloud/security_center/v1p1beta1" - -ENV["GOOGLE_APPLICATION_CREDENTIALS"] = "path/to/credentialfile.json" - -client = ::Google::Cloud::SecurityCenter::V1p1beta1::SecurityCenter::Client.new -``` - -### Local ADC file - -You can set up a local ADC file with your user credentials for authentication during -development. If credentials are not provided in code or in environment variables, -then the local ADC credentials are discovered. - -Follow the steps in [Quickstart](#quickstart) to set up a local ADC file. - -### Google Cloud Platform environments - -When running on Google Cloud Platform (GCP), including Google Compute Engine -(GCE), Google Kubernetes Engine (GKE), Google App Engine (GAE), Google Cloud -Functions (GCF) and Cloud Run, credentials are retrieved from the attached -service account automatically. Code should be written as if already authenticated. - -For more information, see -[Set up ADC for Google Cloud services](https://cloud.google.com/docs/authentication/provide-credentials-adc#attached-sa). diff --git a/owl-bot-staging/google-cloud-security_center-v1p1beta1/CHANGELOG.md b/owl-bot-staging/google-cloud-security_center-v1p1beta1/CHANGELOG.md deleted file mode 100644 index f88957a62ba2..000000000000 --- a/owl-bot-staging/google-cloud-security_center-v1p1beta1/CHANGELOG.md +++ /dev/null @@ -1,2 +0,0 @@ -# Release History - diff --git a/owl-bot-staging/google-cloud-security_center-v1p1beta1/Gemfile b/owl-bot-staging/google-cloud-security_center-v1p1beta1/Gemfile deleted file mode 100644 index 1d08558908d8..000000000000 --- a/owl-bot-staging/google-cloud-security_center-v1p1beta1/Gemfile +++ /dev/null @@ -1,14 +0,0 @@ -source "https://rubygems.org" - -gemspec - -gem "google-style", "~> 1.32.0" -gem "irb", "~> 1.17" -gem "minitest", "~> 6.0.2" -gem "minitest-focus", "~> 1.4" -gem "minitest-mock", "~> 5.27" -gem "minitest-rg", "~> 5.3" -gem "ostruct", "~> 0.5.5" -gem "rake", ">= 13.0" -gem "redcarpet", "~> 3.6" -gem "yard", "~> 0.9" diff --git a/owl-bot-staging/google-cloud-security_center-v1p1beta1/LICENSE.md b/owl-bot-staging/google-cloud-security_center-v1p1beta1/LICENSE.md deleted file mode 100644 index c261857ba6ad..000000000000 --- a/owl-bot-staging/google-cloud-security_center-v1p1beta1/LICENSE.md +++ /dev/null @@ -1,201 +0,0 @@ - Apache License - Version 2.0, January 2004 - http://www.apache.org/licenses/ - - TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION - - 1. Definitions. - - "License" shall mean the terms and conditions for use, reproduction, - and distribution as defined by Sections 1 through 9 of this document. - - "Licensor" shall mean the copyright owner or entity authorized by - the copyright owner that is granting the License. - - "Legal Entity" shall mean the union of the acting entity and all - other entities that control, are controlled by, or are under common - control with that entity. For the purposes of this definition, - "control" means (i) the power, direct or indirect, to cause the - direction or management of such entity, whether by contract or - otherwise, or (ii) ownership of fifty percent (50%) or more of the - outstanding shares, or (iii) beneficial ownership of such entity. - - "You" (or "Your") shall mean an individual or Legal Entity - exercising permissions granted by this License. - - "Source" form shall mean the preferred form for making modifications, - including but not limited to software source code, documentation - source, and configuration files. - - "Object" form shall mean any form resulting from mechanical - transformation or translation of a Source form, including but - not limited to compiled object code, generated documentation, - and conversions to other media types. - - "Work" shall mean the work of authorship, whether in Source or - Object form, made available under the License, as indicated by a - copyright notice that is included in or attached to the work - (an example is provided in the Appendix below). - - "Derivative Works" shall mean any work, whether in Source or Object - form, that is based on (or derived from) the Work and for which the - editorial revisions, annotations, elaborations, or other modifications - represent, as a whole, an original work of authorship. For the purposes - of this License, Derivative Works shall not include works that remain - separable from, or merely link (or bind by name) to the interfaces of, - the Work and Derivative Works thereof. - - "Contribution" shall mean any work of authorship, including - the original version of the Work and any modifications or additions - to that Work or Derivative Works thereof, that is intentionally - submitted to Licensor for inclusion in the Work by the copyright owner - or by an individual or Legal Entity authorized to submit on behalf of - the copyright owner. For the purposes of this definition, "submitted" - means any form of electronic, verbal, or written communication sent - to the Licensor or its representatives, including but not limited to - communication on electronic mailing lists, source code control systems, - and issue tracking systems that are managed by, or on behalf of, the - Licensor for the purpose of discussing and improving the Work, but - excluding communication that is conspicuously marked or otherwise - designated in writing by the copyright owner as "Not a Contribution." - - "Contributor" shall mean Licensor and any individual or Legal Entity - on behalf of whom a Contribution has been received by Licensor and - subsequently incorporated within the Work. - - 2. Grant of Copyright License. Subject to the terms and conditions of - this License, each Contributor hereby grants to You a perpetual, - worldwide, non-exclusive, no-charge, royalty-free, irrevocable - copyright license to reproduce, prepare Derivative Works of, - publicly display, publicly perform, sublicense, and distribute the - Work and such Derivative Works in Source or Object form. - - 3. Grant of Patent License. Subject to the terms and conditions of - this License, each Contributor hereby grants to You a perpetual, - worldwide, non-exclusive, no-charge, royalty-free, irrevocable - (except as stated in this section) patent license to make, have made, - use, offer to sell, sell, import, and otherwise transfer the Work, - where such license applies only to those patent claims licensable - by such Contributor that are necessarily infringed by their - Contribution(s) alone or by combination of their Contribution(s) - with the Work to which such Contribution(s) was submitted. If You - institute patent litigation against any entity (including a - cross-claim or counterclaim in a lawsuit) alleging that the Work - or a Contribution incorporated within the Work constitutes direct - or contributory patent infringement, then any patent licenses - granted to You under this License for that Work shall terminate - as of the date such litigation is filed. - - 4. Redistribution. You may reproduce and distribute copies of the - Work or Derivative Works thereof in any medium, with or without - modifications, and in Source or Object form, provided that You - meet the following conditions: - - (a) You must give any other recipients of the Work or - Derivative Works a copy of this License; and - - (b) You must cause any modified files to carry prominent notices - stating that You changed the files; and - - (c) You must retain, in the Source form of any Derivative Works - that You distribute, all copyright, patent, trademark, and - attribution notices from the Source form of the Work, - excluding those notices that do not pertain to any part of - the Derivative Works; and - - (d) If the Work includes a "NOTICE" text file as part of its - distribution, then any Derivative Works that You distribute must - include a readable copy of the attribution notices contained - within such NOTICE file, excluding those notices that do not - pertain to any part of the Derivative Works, in at least one - of the following places: within a NOTICE text file distributed - as part of the Derivative Works; within the Source form or - documentation, if provided along with the Derivative Works; or, - within a display generated by the Derivative Works, if and - wherever such third-party notices normally appear. The contents - of the NOTICE file are for informational purposes only and - do not modify the License. You may add Your own attribution - notices within Derivative Works that You distribute, alongside - or as an addendum to the NOTICE text from the Work, provided - that such additional attribution notices cannot be construed - as modifying the License. - - You may add Your own copyright statement to Your modifications and - may provide additional or different license terms and conditions - for use, reproduction, or distribution of Your modifications, or - for any such Derivative Works as a whole, provided Your use, - reproduction, and distribution of the Work otherwise complies with - the conditions stated in this License. - - 5. Submission of Contributions. Unless You explicitly state otherwise, - any Contribution intentionally submitted for inclusion in the Work - by You to the Licensor shall be under the terms and conditions of - this License, without any additional terms or conditions. - Notwithstanding the above, nothing herein shall supersede or modify - the terms of any separate license agreement you may have executed - with Licensor regarding such Contributions. - - 6. Trademarks. This License does not grant permission to use the trade - names, trademarks, service marks, or product names of the Licensor, - except as required for reasonable and customary use in describing the - origin of the Work and reproducing the content of the NOTICE file. - - 7. Disclaimer of Warranty. Unless required by applicable law or - agreed to in writing, Licensor provides the Work (and each - Contributor provides its Contributions) on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or - implied, including, without limitation, any warranties or conditions - of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A - PARTICULAR PURPOSE. You are solely responsible for determining the - appropriateness of using or redistributing the Work and assume any - risks associated with Your exercise of permissions under this License. - - 8. Limitation of Liability. In no event and under no legal theory, - whether in tort (including negligence), contract, or otherwise, - unless required by applicable law (such as deliberate and grossly - negligent acts) or agreed to in writing, shall any Contributor be - liable to You for damages, including any direct, indirect, special, - incidental, or consequential damages of any character arising as a - result of this License or out of the use or inability to use the - Work (including but not limited to damages for loss of goodwill, - work stoppage, computer failure or malfunction, or any and all - other commercial damages or losses), even if such Contributor - has been advised of the possibility of such damages. - - 9. Accepting Warranty or Additional Liability. While redistributing - the Work or Derivative Works thereof, You may choose to offer, - and charge a fee for, acceptance of support, warranty, indemnity, - or other liability obligations and/or rights consistent with this - License. However, in accepting such obligations, You may act only - on Your own behalf and on Your sole responsibility, not on behalf - of any other Contributor, and only if You agree to indemnify, - defend, and hold each Contributor harmless for any liability - incurred by, or claims asserted against, such Contributor by reason - of your accepting any such warranty or additional liability. - - END OF TERMS AND CONDITIONS - - APPENDIX: How to apply the Apache License to your work. - - To apply the Apache License to your work, attach the following - boilerplate notice, with the fields enclosed by brackets "[]" - replaced with your own identifying information. (Don't include - the brackets!) The text should be enclosed in the appropriate - comment syntax for the file format. We also recommend that a - file or class name and description of purpose be included on the - same "printed page" as the copyright notice for easier - identification within third-party archives. - - Copyright [yyyy] [name of copyright owner] - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. diff --git a/owl-bot-staging/google-cloud-security_center-v1p1beta1/README.md b/owl-bot-staging/google-cloud-security_center-v1p1beta1/README.md deleted file mode 100644 index dd4f6ca89772..000000000000 --- a/owl-bot-staging/google-cloud-security_center-v1p1beta1/README.md +++ /dev/null @@ -1,153 +0,0 @@ -# Ruby Client for the Cloud Security Command Center V1p1beta1 API - -Security Command Center API provides access to temporal views of assets and findings within an organization. - - -https://github.com/googleapis/google-cloud-ruby - -This gem is a _versioned_ client. It provides basic client classes for a -specific version of the Cloud Security Command Center V1p1beta1 API. Most users should consider using -the main client gem, -[google-cloud-security_center](https://rubygems.org/gems/google-cloud-security_center). -See the section below titled *Which client should I use?* for more information. - -## Installation - -``` -$ gem install google-cloud-security_center-v1p1beta1 -``` - -## 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/securitycenter.googleapis.com) -1. [Set up authentication.](AUTHENTICATION.md) - -## Quick Start - -```ruby -require "google/cloud/security_center/v1p1beta1" - -client = ::Google::Cloud::SecurityCenter::V1p1beta1::SecurityCenter::Client.new -request = ::Google::Cloud::SecurityCenter::V1p1beta1::CreateSourceRequest.new # (request fields as keyword arguments...) -response = client.create_source request -``` - -View the [Client Library Documentation](https://cloud.google.com/ruby/docs/reference/google-cloud-security_center-v1p1beta1/latest) -for class and method documentation. - -See also the [Product Documentation](https://cloud.google.com/security-command-center) -for general usage information. - -## Debug Logging - -This library comes with opt-in Debug Logging that can help you troubleshoot -your application's integration with the API. When logging is activated, key -events such as requests and responses, along with data payloads and metadata -such as headers and client configuration, are logged to the standard error -stream. - -**WARNING:** Client Library Debug Logging includes your data payloads in -plaintext, which could include sensitive data such as PII for yourself or your -customers, private keys, or other security data that could be compromising if -leaked. Always practice good data hygiene with your application logs, and follow -the principle of least access. Google also recommends that Client Library Debug -Logging be enabled only temporarily during active debugging, and not used -permanently in production. - -To enable logging, set the environment variable `GOOGLE_SDK_RUBY_LOGGING_GEMS` -to the value `all`. Alternatively, you can set the value to a comma-delimited -list of client library gem names. This will select the default logging behavior, -which writes logs to the standard error stream. On a local workstation, this may -result in logs appearing on the console. When running on a Google Cloud hosting -service such as [Google Cloud Run](https://cloud.google.com/run), this generally -results in logs appearing alongside your application logs in the -[Google Cloud Logging](https://cloud.google.com/logging/) service. - -You can customize logging by modifying the `logger` configuration when -constructing a client object. For example: - -```ruby -require "google/cloud/security_center/v1p1beta1" -require "logger" - -client = ::Google::Cloud::SecurityCenter::V1p1beta1::SecurityCenter::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-security_center`, -and lower-level _versioned_ client libraries with names such as -`google-cloud-security_center-v1p1beta1`. -_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-security_center`. -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-security_center-v1p1beta1`. - -### What about the google-apis- clients? - -Client library gems with names that begin with `google-apis-` are based on an -older code generation technology. They talk to a REST/JSON backend (whereas -most modern clients talk to a [gRPC](https://grpc.io/) backend) and they may -not offer the same performance, features, and ease of use provided by more -modern clients. - -The `google-apis-` clients have wide coverage across Google services, so you -might need to use one if there is no modern client available for the service. -However, if a modern client is available, we generally recommend it over the -older `google-apis-` clients. diff --git a/owl-bot-staging/google-cloud-security_center-v1p1beta1/Rakefile b/owl-bot-staging/google-cloud-security_center-v1p1beta1/Rakefile deleted file mode 100644 index 4edac3b83170..000000000000 --- a/owl-bot-staging/google-cloud-security_center-v1p1beta1/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-security_center-v1p1beta1 acceptance tests." -task :acceptance, :project, :keyfile do |t, args| - project = args[:project] - project ||= - ENV["SECURITY_CENTER_TEST_PROJECT"] || - ENV["GCLOUD_TEST_PROJECT"] - keyfile = args[:keyfile] - keyfile ||= - ENV["SECURITY_CENTER_TEST_KEYFILE"] || - ENV["GCLOUD_TEST_KEYFILE"] - if keyfile - keyfile = File.read keyfile - else - keyfile ||= - ENV["SECURITY_CENTER_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 SECURITY_CENTER_TEST_PROJECT=test123 SECURITY_CENTER_TEST_KEYFILE=/path/to/keyfile.json rake acceptance" - end - require "google/cloud/security_center/v1p1beta1/security_center/credentials" - ::Google::Cloud::SecurityCenter::V1p1beta1::SecurityCenter::Credentials.env_vars.each do |path| - ENV[path] = nil - end - ENV["SECURITY_CENTER_PROJECT"] = project - ENV["SECURITY_CENTER_TEST_PROJECT"] = project - ENV["SECURITY_CENTER_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-security_center-v1p1beta1 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-security_center-v1p1beta1 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-security_center-v1p1beta1 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-security_center-v1p1beta1 gem does not have doctest tests." -end - -desc "Run the CI build" -task :ci do - header "BUILDING google-cloud-security_center-v1p1beta1" - header "google-cloud-security_center-v1p1beta1 rubocop", "*" - Rake::Task[:rubocop].invoke - header "google-cloud-security_center-v1p1beta1 yard", "*" - Rake::Task[:yard].invoke - header "google-cloud-security_center-v1p1beta1 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-security_center-v1p1beta1 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-security_center-v1p1beta1 acceptance", "*" - Rake::Task[:acceptance].invoke - end - task :a do - # This is a handy shortcut to save typing - Rake::Task["ci:acceptance"].invoke - end -end - -task default: :test - -def header str, token = "#" - line_length = str.length + 8 - puts "" - puts token * line_length - puts "#{token * 3} #{str} #{token * 3}" - puts token * line_length - puts "" -end diff --git a/owl-bot-staging/google-cloud-security_center-v1p1beta1/gapic_metadata.json b/owl-bot-staging/google-cloud-security_center-v1p1beta1/gapic_metadata.json deleted file mode 100644 index 429bc0c97eac..000000000000 --- a/owl-bot-staging/google-cloud-security_center-v1p1beta1/gapic_metadata.json +++ /dev/null @@ -1,133 +0,0 @@ -{ - "schema": "1.0", - "comment": "This file maps proto services/RPCs to the corresponding library clients/methods", - "language": "ruby", - "protoPackage": "google.cloud.securitycenter.v1p1beta1", - "libraryPackage": "::Google::Cloud::SecurityCenter::V1p1beta1", - "services": { - "SecurityCenter": { - "clients": { - "grpc": { - "libraryClient": "::Google::Cloud::SecurityCenter::V1p1beta1::SecurityCenter::Client", - "rpcs": { - "CreateSource": { - "methods": [ - "create_source" - ] - }, - "CreateFinding": { - "methods": [ - "create_finding" - ] - }, - "CreateNotificationConfig": { - "methods": [ - "create_notification_config" - ] - }, - "DeleteNotificationConfig": { - "methods": [ - "delete_notification_config" - ] - }, - "GetIamPolicy": { - "methods": [ - "get_iam_policy" - ] - }, - "GetNotificationConfig": { - "methods": [ - "get_notification_config" - ] - }, - "GetOrganizationSettings": { - "methods": [ - "get_organization_settings" - ] - }, - "GetSource": { - "methods": [ - "get_source" - ] - }, - "GroupAssets": { - "methods": [ - "group_assets" - ] - }, - "GroupFindings": { - "methods": [ - "group_findings" - ] - }, - "ListAssets": { - "methods": [ - "list_assets" - ] - }, - "ListFindings": { - "methods": [ - "list_findings" - ] - }, - "ListNotificationConfigs": { - "methods": [ - "list_notification_configs" - ] - }, - "ListSources": { - "methods": [ - "list_sources" - ] - }, - "RunAssetDiscovery": { - "methods": [ - "run_asset_discovery" - ] - }, - "SetFindingState": { - "methods": [ - "set_finding_state" - ] - }, - "SetIamPolicy": { - "methods": [ - "set_iam_policy" - ] - }, - "TestIamPermissions": { - "methods": [ - "test_iam_permissions" - ] - }, - "UpdateFinding": { - "methods": [ - "update_finding" - ] - }, - "UpdateNotificationConfig": { - "methods": [ - "update_notification_config" - ] - }, - "UpdateOrganizationSettings": { - "methods": [ - "update_organization_settings" - ] - }, - "UpdateSource": { - "methods": [ - "update_source" - ] - }, - "UpdateSecurityMarks": { - "methods": [ - "update_security_marks" - ] - } - } - } - } - } - } -} diff --git a/owl-bot-staging/google-cloud-security_center-v1p1beta1/google-cloud-security_center-v1p1beta1.gemspec b/owl-bot-staging/google-cloud-security_center-v1p1beta1/google-cloud-security_center-v1p1beta1.gemspec deleted file mode 100644 index 25ea2ffaec07..000000000000 --- a/owl-bot-staging/google-cloud-security_center-v1p1beta1/google-cloud-security_center-v1p1beta1.gemspec +++ /dev/null @@ -1,29 +0,0 @@ -# -*- ruby -*- -# encoding: utf-8 - -require File.expand_path("lib/google/cloud/security_center/v1p1beta1/version", __dir__) - -Gem::Specification.new do |gem| - gem.name = "google-cloud-security_center-v1p1beta1" - gem.version = Google::Cloud::SecurityCenter::V1p1beta1::VERSION - - gem.authors = ["Google LLC"] - gem.email = "googleapis-packages@google.com" - gem.description = "Security Command Center API provides access to temporal views of assets and findings within an organization. Note that google-cloud-security_center-v1p1beta1 is a version-specific client library. For most uses, we recommend installing the main client library google-cloud-security_center instead. See the readme for more details." - gem.summary = "Security Command Center API provides access to temporal views of assets and findings within an organization." - 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 "grpc-google-iam-v1", "~> 1.11" -end diff --git a/owl-bot-staging/google-cloud-security_center-v1p1beta1/lib/google-cloud-security_center-v1p1beta1.rb b/owl-bot-staging/google-cloud-security_center-v1p1beta1/lib/google-cloud-security_center-v1p1beta1.rb deleted file mode 100644 index 1e7ec4c542f6..000000000000 --- a/owl-bot-staging/google-cloud-security_center-v1p1beta1/lib/google-cloud-security_center-v1p1beta1.rb +++ /dev/null @@ -1,21 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -# This gem does not autoload during Bundler.require. To load this gem, -# issue explicit require statements for the packages desired, e.g.: -# require "google/cloud/security_center/v1p1beta1" diff --git a/owl-bot-staging/google-cloud-security_center-v1p1beta1/lib/google/cloud/security_center/v1p1beta1.rb b/owl-bot-staging/google-cloud-security_center-v1p1beta1/lib/google/cloud/security_center/v1p1beta1.rb deleted file mode 100644 index 60f6b23b8bbb..000000000000 --- a/owl-bot-staging/google-cloud-security_center-v1p1beta1/lib/google/cloud/security_center/v1p1beta1.rb +++ /dev/null @@ -1,45 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -require "google/cloud/security_center/v1p1beta1/security_center" -require "google/cloud/security_center/v1p1beta1/version" - -module Google - module Cloud - module SecurityCenter - ## - # API client module. - # - # @example Load this package, including all its services, and instantiate a gRPC client - # - # require "google/cloud/security_center/v1p1beta1" - # client = ::Google::Cloud::SecurityCenter::V1p1beta1::SecurityCenter::Client.new - # - # @example Load this package, including all its services, and instantiate a REST client - # - # require "google/cloud/security_center/v1p1beta1" - # client = ::Google::Cloud::SecurityCenter::V1p1beta1::SecurityCenter::Rest::Client.new - # - module V1p1beta1 - end - end - end -end - -helper_path = ::File.join __dir__, "v1p1beta1", "_helpers.rb" -require "google/cloud/security_center/v1p1beta1/_helpers" if ::File.file? helper_path diff --git a/owl-bot-staging/google-cloud-security_center-v1p1beta1/lib/google/cloud/security_center/v1p1beta1/rest.rb b/owl-bot-staging/google-cloud-security_center-v1p1beta1/lib/google/cloud/security_center/v1p1beta1/rest.rb deleted file mode 100644 index 33c18366ecf2..000000000000 --- a/owl-bot-staging/google-cloud-security_center-v1p1beta1/lib/google/cloud/security_center/v1p1beta1/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/cloud/security_center/v1p1beta1/security_center/rest" -require "google/cloud/security_center/v1p1beta1/version" - -module Google - module Cloud - module SecurityCenter - ## - # To load just the REST part of this package, including all its services, and instantiate a REST client: - # - # @example - # - # require "google/cloud/security_center/v1p1beta1/rest" - # client = ::Google::Cloud::SecurityCenter::V1p1beta1::SecurityCenter::Rest::Client.new - # - module V1p1beta1 - end - end - end -end diff --git a/owl-bot-staging/google-cloud-security_center-v1p1beta1/lib/google/cloud/security_center/v1p1beta1/security_center.rb b/owl-bot-staging/google-cloud-security_center-v1p1beta1/lib/google/cloud/security_center/v1p1beta1/security_center.rb deleted file mode 100644 index 77d09feb2118..000000000000 --- a/owl-bot-staging/google-cloud-security_center-v1p1beta1/lib/google/cloud/security_center/v1p1beta1/security_center.rb +++ /dev/null @@ -1,56 +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/security_center/v1p1beta1/version" - -require "google/cloud/security_center/v1p1beta1/security_center/credentials" -require "google/cloud/security_center/v1p1beta1/security_center/paths" -require "google/cloud/security_center/v1p1beta1/security_center/operations" -require "google/cloud/security_center/v1p1beta1/security_center/client" -require "google/cloud/security_center/v1p1beta1/security_center/rest" - -module Google - module Cloud - module SecurityCenter - module V1p1beta1 - ## - # V1p1Beta1 APIs for Security Center service. - # - # @example Load this service and instantiate a gRPC client - # - # require "google/cloud/security_center/v1p1beta1/security_center" - # client = ::Google::Cloud::SecurityCenter::V1p1beta1::SecurityCenter::Client.new - # - # @example Load this service and instantiate a REST client - # - # require "google/cloud/security_center/v1p1beta1/security_center/rest" - # client = ::Google::Cloud::SecurityCenter::V1p1beta1::SecurityCenter::Rest::Client.new - # - module SecurityCenter - end - end - end - end -end - -helper_path = ::File.join __dir__, "security_center", "helpers.rb" -require "google/cloud/security_center/v1p1beta1/security_center/helpers" if ::File.file? helper_path diff --git a/owl-bot-staging/google-cloud-security_center-v1p1beta1/lib/google/cloud/security_center/v1p1beta1/security_center/client.rb b/owl-bot-staging/google-cloud-security_center-v1p1beta1/lib/google/cloud/security_center/v1p1beta1/security_center/client.rb deleted file mode 100644 index 7cda5890ec7b..000000000000 --- a/owl-bot-staging/google-cloud-security_center-v1p1beta1/lib/google/cloud/security_center/v1p1beta1/security_center/client.rb +++ /dev/null @@ -1,3250 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -require "google/cloud/errors" -require "google/cloud/securitycenter/v1p1beta1/securitycenter_service_pb" - -module Google - module Cloud - module SecurityCenter - module V1p1beta1 - module SecurityCenter - ## - # Client for the SecurityCenter service. - # - # V1p1Beta1 APIs for Security Center service. - # - class Client - # @private - API_VERSION = "" - - # @private - DEFAULT_ENDPOINT_TEMPLATE = "securitycenter.$UNIVERSE_DOMAIN$" - - include Paths - - # @private - attr_reader :security_center_stub - - ## - # Configure the SecurityCenter Client class. - # - # See {::Google::Cloud::SecurityCenter::V1p1beta1::SecurityCenter::Client::Configuration} - # for a description of the configuration fields. - # - # @example - # - # # Modify the configuration for all SecurityCenter clients - # ::Google::Cloud::SecurityCenter::V1p1beta1::SecurityCenter::Client.configure do |config| - # config.timeout = 10.0 - # end - # - # @yield [config] Configure the Client client. - # @yieldparam config [Client::Configuration] - # - # @return [Client::Configuration] - # - def self.configure - @configure ||= begin - namespace = ["Google", "Cloud", "SecurityCenter", "V1p1beta1"] - 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_source.timeout = 60.0 - - default_config.rpcs.create_finding.timeout = 60.0 - - default_config.rpcs.create_notification_config.timeout = 60.0 - - default_config.rpcs.delete_notification_config.timeout = 60.0 - - default_config.rpcs.get_iam_policy.timeout = 60.0 - default_config.rpcs.get_iam_policy.retry_policy = { - initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [4, 14] - } - - default_config.rpcs.get_notification_config.timeout = 60.0 - default_config.rpcs.get_notification_config.retry_policy = { - initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [4, 14] - } - - default_config.rpcs.get_organization_settings.timeout = 60.0 - default_config.rpcs.get_organization_settings.retry_policy = { - initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [4, 14] - } - - default_config.rpcs.get_source.timeout = 60.0 - default_config.rpcs.get_source.retry_policy = { - initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [4, 14] - } - - default_config.rpcs.group_assets.timeout = 480.0 - default_config.rpcs.group_assets.retry_policy = { - initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [4, 14] - } - - default_config.rpcs.group_findings.timeout = 480.0 - default_config.rpcs.group_findings.retry_policy = { - initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [4, 14] - } - - default_config.rpcs.list_assets.timeout = 480.0 - default_config.rpcs.list_assets.retry_policy = { - initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [4, 14] - } - - default_config.rpcs.list_findings.timeout = 480.0 - default_config.rpcs.list_findings.retry_policy = { - initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [4, 14] - } - - default_config.rpcs.list_notification_configs.timeout = 60.0 - default_config.rpcs.list_notification_configs.retry_policy = { - initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [4, 14] - } - - default_config.rpcs.list_sources.timeout = 60.0 - default_config.rpcs.list_sources.retry_policy = { - initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [4, 14] - } - - default_config.rpcs.run_asset_discovery.timeout = 60.0 - - default_config.rpcs.set_finding_state.timeout = 60.0 - - default_config.rpcs.set_iam_policy.timeout = 60.0 - - default_config.rpcs.test_iam_permissions.timeout = 60.0 - default_config.rpcs.test_iam_permissions.retry_policy = { - initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [4, 14] - } - - default_config.rpcs.update_finding.timeout = 60.0 - - default_config.rpcs.update_notification_config.timeout = 60.0 - - default_config.rpcs.update_organization_settings.timeout = 60.0 - - default_config.rpcs.update_source.timeout = 60.0 - - default_config.rpcs.update_security_marks.timeout = 480.0 - - default_config - end - yield @configure if block_given? - @configure - end - - ## - # Configure the SecurityCenter Client instance. - # - # The configuration is set to the derived mode, meaning that values can be changed, - # but structural changes (adding new fields, etc.) are not allowed. Structural changes - # should be made on {Client.configure}. - # - # See {::Google::Cloud::SecurityCenter::V1p1beta1::SecurityCenter::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 - @security_center_stub.universe_domain - end - - ## - # Create a new SecurityCenter client object. - # - # @example - # - # # Create a client using the default configuration - # client = ::Google::Cloud::SecurityCenter::V1p1beta1::SecurityCenter::Client.new - # - # # Create a client using a custom configuration - # client = ::Google::Cloud::SecurityCenter::V1p1beta1::SecurityCenter::Client.new do |config| - # config.timeout = 10.0 - # end - # - # @yield [config] Configure the SecurityCenter client. - # @yieldparam config [Client::Configuration] - # - def initialize - # These require statements are intentionally placed here to initialize - # the gRPC module only when it's required. - # See https://github.com/googleapis/toolkit/issues/446 - require "gapic/grpc" - require "google/cloud/securitycenter/v1p1beta1/securitycenter_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 - - @security_center_stub = ::Gapic::ServiceStub.new( - ::Google::Cloud::SecurityCenter::V1p1beta1::SecurityCenter::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 - ) - - @security_center_stub.stub_logger&.info do |entry| - entry.set_system_name - entry.set_service - entry.message = "Created client for #{entry.service}" - entry.set_credentials_fields credentials - entry.set "customEndpoint", @config.endpoint if @config.endpoint - entry.set "defaultTimeout", @config.timeout if @config.timeout - entry.set "quotaProject", @quota_project_id if @quota_project_id - end - end - - ## - # Get the associated client for long-running operations. - # - # @return [::Google::Cloud::SecurityCenter::V1p1beta1::SecurityCenter::Operations] - # - attr_reader :operations_client - - ## - # The logger used for request/response debug logging. - # - # @return [Logger] - # - def logger - @security_center_stub.logger - end - - # Service calls - - ## - # Creates a source. - # - # @overload create_source(request, options = nil) - # Pass arguments to `create_source` via a request object, either of type - # {::Google::Cloud::SecurityCenter::V1p1beta1::CreateSourceRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::SecurityCenter::V1p1beta1::CreateSourceRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_source(parent: nil, source: nil) - # Pass arguments to `create_source` via keyword arguments. Note that at - # least one keyword argument is 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. Resource name of the new source's parent. Its format should be - # "organizations/[organization_id]". - # @param source [::Google::Cloud::SecurityCenter::V1p1beta1::Source, ::Hash] - # Required. The Source being created, only the display_name and description will be - # used. All other fields will be ignored. - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Google::Cloud::SecurityCenter::V1p1beta1::Source] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Google::Cloud::SecurityCenter::V1p1beta1::Source] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/cloud/security_center/v1p1beta1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::SecurityCenter::V1p1beta1::SecurityCenter::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::SecurityCenter::V1p1beta1::CreateSourceRequest.new - # - # # Call the create_source method. - # result = client.create_source request - # - # # The returned object is of type Google::Cloud::SecurityCenter::V1p1beta1::Source. - # p result - # - def create_source request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::SecurityCenter::V1p1beta1::CreateSourceRequest - - # Converts hash 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_source.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::SecurityCenter::V1p1beta1::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_source.timeout, - metadata: metadata, - retry_policy: @config.rpcs.create_source.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @security_center_stub.call_rpc :create_source, request, options: options do |response, operation| - yield response, operation if block_given? - end - rescue ::GRPC::BadStatus => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Creates a finding. The corresponding source must exist for finding - # creation to succeed. - # - # @overload create_finding(request, options = nil) - # Pass arguments to `create_finding` via a request object, either of type - # {::Google::Cloud::SecurityCenter::V1p1beta1::CreateFindingRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::SecurityCenter::V1p1beta1::CreateFindingRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_finding(parent: nil, finding_id: nil, finding: nil) - # Pass arguments to `create_finding` via keyword arguments. Note that at - # least one keyword argument is 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. Resource name of the new finding's parent. Its format should be - # "organizations/[organization_id]/sources/[source_id]". - # @param finding_id [::String] - # Required. Unique identifier provided by the client within the parent scope. - # @param finding [::Google::Cloud::SecurityCenter::V1p1beta1::Finding, ::Hash] - # Required. The Finding being created. The name and security_marks will be ignored as - # they are both output only fields on this resource. - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Google::Cloud::SecurityCenter::V1p1beta1::Finding] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Google::Cloud::SecurityCenter::V1p1beta1::Finding] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/cloud/security_center/v1p1beta1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::SecurityCenter::V1p1beta1::SecurityCenter::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::SecurityCenter::V1p1beta1::CreateFindingRequest.new - # - # # Call the create_finding method. - # result = client.create_finding request - # - # # The returned object is of type Google::Cloud::SecurityCenter::V1p1beta1::Finding. - # p result - # - def create_finding request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::SecurityCenter::V1p1beta1::CreateFindingRequest - - # Converts hash 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_finding.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::SecurityCenter::V1p1beta1::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_finding.timeout, - metadata: metadata, - retry_policy: @config.rpcs.create_finding.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @security_center_stub.call_rpc :create_finding, request, options: options do |response, operation| - yield response, operation if block_given? - end - rescue ::GRPC::BadStatus => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Creates a notification config. - # - # @overload create_notification_config(request, options = nil) - # Pass arguments to `create_notification_config` via a request object, either of type - # {::Google::Cloud::SecurityCenter::V1p1beta1::CreateNotificationConfigRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::SecurityCenter::V1p1beta1::CreateNotificationConfigRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_notification_config(parent: nil, config_id: nil, notification_config: nil) - # Pass arguments to `create_notification_config` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param parent [::String] - # Required. Resource name of the new notification config's parent. Its format is - # "organizations/[organization_id]". - # @param config_id [::String] - # Required. Unique identifier provided by the client within the parent scope. - # It must be between 1 and 128 characters, and contains alphanumeric - # characters, underscores or hyphens only. - # @param notification_config [::Google::Cloud::SecurityCenter::V1p1beta1::NotificationConfig, ::Hash] - # Required. The notification config being created. The name and the service account - # will be ignored as they are both output only fields on this resource. - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Google::Cloud::SecurityCenter::V1p1beta1::NotificationConfig] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Google::Cloud::SecurityCenter::V1p1beta1::NotificationConfig] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/cloud/security_center/v1p1beta1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::SecurityCenter::V1p1beta1::SecurityCenter::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::SecurityCenter::V1p1beta1::CreateNotificationConfigRequest.new - # - # # Call the create_notification_config method. - # result = client.create_notification_config request - # - # # The returned object is of type Google::Cloud::SecurityCenter::V1p1beta1::NotificationConfig. - # p result - # - def create_notification_config request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::SecurityCenter::V1p1beta1::CreateNotificationConfigRequest - - # Converts hash 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_notification_config.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::SecurityCenter::V1p1beta1::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_notification_config.timeout, - metadata: metadata, - retry_policy: @config.rpcs.create_notification_config.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @security_center_stub.call_rpc :create_notification_config, request, options: options do |response, operation| - yield response, operation if block_given? - end - rescue ::GRPC::BadStatus => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Deletes a notification config. - # - # @overload delete_notification_config(request, options = nil) - # Pass arguments to `delete_notification_config` via a request object, either of type - # {::Google::Cloud::SecurityCenter::V1p1beta1::DeleteNotificationConfigRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::SecurityCenter::V1p1beta1::DeleteNotificationConfigRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_notification_config(name: nil) - # Pass arguments to `delete_notification_config` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param name [::String] - # Required. Name of the notification config to delete. Its format is - # "organizations/[organization_id]/notificationConfigs/[config_id]". - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Google::Protobuf::Empty] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Google::Protobuf::Empty] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/cloud/security_center/v1p1beta1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::SecurityCenter::V1p1beta1::SecurityCenter::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::SecurityCenter::V1p1beta1::DeleteNotificationConfigRequest.new - # - # # Call the delete_notification_config method. - # result = client.delete_notification_config request - # - # # The returned object is of type Google::Protobuf::Empty. - # p result - # - def delete_notification_config request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::SecurityCenter::V1p1beta1::DeleteNotificationConfigRequest - - # Converts hash 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_notification_config.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::SecurityCenter::V1p1beta1::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_notification_config.timeout, - metadata: metadata, - retry_policy: @config.rpcs.delete_notification_config.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @security_center_stub.call_rpc :delete_notification_config, request, options: options do |response, operation| - yield response, operation if block_given? - end - rescue ::GRPC::BadStatus => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Gets the access control policy on the specified Source. - # - # @overload get_iam_policy(request, options = nil) - # Pass arguments to `get_iam_policy` via a request object, either of type - # {::Google::Iam::V1::GetIamPolicyRequest} or an equivalent Hash. - # - # @param request [::Google::Iam::V1::GetIamPolicyRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. - # - # @overload get_iam_policy(resource: nil, options: nil) - # Pass arguments to `get_iam_policy` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param resource [::String] - # REQUIRED: The resource for which the policy is being requested. - # See the operation documentation for the appropriate value for this field. - # @param options [::Google::Iam::V1::GetPolicyOptions, ::Hash] - # OPTIONAL: A `GetPolicyOptions` object for specifying options to - # `GetIamPolicy`. - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Google::Iam::V1::Policy] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Google::Iam::V1::Policy] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/cloud/security_center/v1p1beta1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::SecurityCenter::V1p1beta1::SecurityCenter::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Iam::V1::GetIamPolicyRequest.new - # - # # Call the get_iam_policy method. - # result = client.get_iam_policy request - # - # # The returned object is of type Google::Iam::V1::Policy. - # p result - # - def get_iam_policy request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Iam::V1::GetIamPolicyRequest - - # Converts hash and nil to an options object - options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h - - # Customize the options with defaults - metadata = @config.rpcs.get_iam_policy.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::SecurityCenter::V1p1beta1::VERSION - metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - header_params = {} - if request.resource - header_params["resource"] = request.resource - end - - request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") - metadata[:"x-goog-request-params"] ||= request_params_header - - options.apply_defaults timeout: @config.rpcs.get_iam_policy.timeout, - metadata: metadata, - retry_policy: @config.rpcs.get_iam_policy.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @security_center_stub.call_rpc :get_iam_policy, request, options: options do |response, operation| - yield response, operation if block_given? - end - rescue ::GRPC::BadStatus => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Gets a notification config. - # - # @overload get_notification_config(request, options = nil) - # Pass arguments to `get_notification_config` via a request object, either of type - # {::Google::Cloud::SecurityCenter::V1p1beta1::GetNotificationConfigRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::SecurityCenter::V1p1beta1::GetNotificationConfigRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_notification_config(name: nil) - # Pass arguments to `get_notification_config` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param name [::String] - # Required. Name of the notification config to get. Its format is - # "organizations/[organization_id]/notificationConfigs/[config_id]". - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Google::Cloud::SecurityCenter::V1p1beta1::NotificationConfig] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Google::Cloud::SecurityCenter::V1p1beta1::NotificationConfig] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/cloud/security_center/v1p1beta1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::SecurityCenter::V1p1beta1::SecurityCenter::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::SecurityCenter::V1p1beta1::GetNotificationConfigRequest.new - # - # # Call the get_notification_config method. - # result = client.get_notification_config request - # - # # The returned object is of type Google::Cloud::SecurityCenter::V1p1beta1::NotificationConfig. - # p result - # - def get_notification_config request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::SecurityCenter::V1p1beta1::GetNotificationConfigRequest - - # Converts hash 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_notification_config.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::SecurityCenter::V1p1beta1::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_notification_config.timeout, - metadata: metadata, - retry_policy: @config.rpcs.get_notification_config.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @security_center_stub.call_rpc :get_notification_config, request, options: options do |response, operation| - yield response, operation if block_given? - end - rescue ::GRPC::BadStatus => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Gets the settings for an organization. - # - # @overload get_organization_settings(request, options = nil) - # Pass arguments to `get_organization_settings` via a request object, either of type - # {::Google::Cloud::SecurityCenter::V1p1beta1::GetOrganizationSettingsRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::SecurityCenter::V1p1beta1::GetOrganizationSettingsRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. - # - # @overload get_organization_settings(name: nil) - # Pass arguments to `get_organization_settings` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param name [::String] - # Required. Name of the organization to get organization settings for. Its format is - # "organizations/[organization_id]/organizationSettings". - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Google::Cloud::SecurityCenter::V1p1beta1::OrganizationSettings] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Google::Cloud::SecurityCenter::V1p1beta1::OrganizationSettings] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/cloud/security_center/v1p1beta1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::SecurityCenter::V1p1beta1::SecurityCenter::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::SecurityCenter::V1p1beta1::GetOrganizationSettingsRequest.new - # - # # Call the get_organization_settings method. - # result = client.get_organization_settings request - # - # # The returned object is of type Google::Cloud::SecurityCenter::V1p1beta1::OrganizationSettings. - # p result - # - def get_organization_settings request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::SecurityCenter::V1p1beta1::GetOrganizationSettingsRequest - - # Converts hash and nil to an options object - options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h - - # Customize the options with defaults - metadata = @config.rpcs.get_organization_settings.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::SecurityCenter::V1p1beta1::VERSION - metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - header_params = {} - if request.name - header_params["name"] = request.name - end - - request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") - metadata[:"x-goog-request-params"] ||= request_params_header - - options.apply_defaults timeout: @config.rpcs.get_organization_settings.timeout, - metadata: metadata, - retry_policy: @config.rpcs.get_organization_settings.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @security_center_stub.call_rpc :get_organization_settings, request, options: options do |response, operation| - yield response, operation if block_given? - end - rescue ::GRPC::BadStatus => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Gets a source. - # - # @overload get_source(request, options = nil) - # Pass arguments to `get_source` via a request object, either of type - # {::Google::Cloud::SecurityCenter::V1p1beta1::GetSourceRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::SecurityCenter::V1p1beta1::GetSourceRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_source(name: nil) - # Pass arguments to `get_source` via keyword arguments. Note that at - # least one keyword argument is 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. Relative resource name of the source. Its format is - # "organizations/[organization_id]/source/[source_id]". - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Google::Cloud::SecurityCenter::V1p1beta1::Source] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Google::Cloud::SecurityCenter::V1p1beta1::Source] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/cloud/security_center/v1p1beta1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::SecurityCenter::V1p1beta1::SecurityCenter::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::SecurityCenter::V1p1beta1::GetSourceRequest.new - # - # # Call the get_source method. - # result = client.get_source request - # - # # The returned object is of type Google::Cloud::SecurityCenter::V1p1beta1::Source. - # p result - # - def get_source request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::SecurityCenter::V1p1beta1::GetSourceRequest - - # Converts hash 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_source.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::SecurityCenter::V1p1beta1::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_source.timeout, - metadata: metadata, - retry_policy: @config.rpcs.get_source.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @security_center_stub.call_rpc :get_source, 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 - - ## - # Filters an organization's assets and groups them by their specified - # properties. - # - # @overload group_assets(request, options = nil) - # Pass arguments to `group_assets` via a request object, either of type - # {::Google::Cloud::SecurityCenter::V1p1beta1::GroupAssetsRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::SecurityCenter::V1p1beta1::GroupAssetsRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. - # - # @overload group_assets(parent: nil, filter: nil, group_by: nil, compare_duration: nil, read_time: nil, page_token: nil, page_size: nil) - # Pass arguments to `group_assets` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param parent [::String] - # Required. Name of the organization to groupBy. Its format is - # "organizations/[organization_id], folders/[folder_id], or - # projects/[project_id]". - # @param filter [::String] - # Expression that defines the filter to apply across assets. - # The expression is a list of zero or more restrictions combined via logical - # operators `AND` and `OR`. - # Parentheses are supported, and `OR` has higher precedence than `AND`. - # - # Restrictions have the form ` ` and may have a `-` - # character in front of them to indicate negation. The fields map to those - # defined in the Asset resource. Examples include: - # - # * name - # * security_center_properties.resource_name - # * resource_properties.a_property - # * security_marks.marks.marka - # - # The supported operators are: - # - # * `=` for all value types. - # * `>`, `<`, `>=`, `<=` for integer values. - # * `:`, meaning substring matching, for strings. - # - # The supported value types are: - # - # * string literals in quotes. - # * integer literals without quotes. - # * boolean literals `true` and `false` without quotes. - # - # The following field and operator combinations are supported: - # - # * name: `=` - # * update_time: `=`, `>`, `<`, `>=`, `<=` - # - # Usage: This should be milliseconds since epoch or an RFC3339 string. - # Examples: - # `update_time = "2019-06-10T16:07:18-07:00"` - # `update_time = 1560208038000` - # - # * create_time: `=`, `>`, `<`, `>=`, `<=` - # - # Usage: This should be milliseconds since epoch or an RFC3339 string. - # Examples: - # `create_time = "2019-06-10T16:07:18-07:00"` - # `create_time = 1560208038000` - # - # * iam_policy.policy_blob: `=`, `:` - # * resource_properties: `=`, `:`, `>`, `<`, `>=`, `<=` - # * security_marks.marks: `=`, `:` - # * security_center_properties.resource_name: `=`, `:` - # * security_center_properties.resource_name_display_name: `=`, `:` - # * security_center_properties.resource_type: `=`, `:` - # * security_center_properties.resource_parent: `=`, `:` - # * security_center_properties.resource_parent_display_name: `=`, `:` - # * security_center_properties.resource_project: `=`, `:` - # * security_center_properties.resource_project_display_name: `=`, `:` - # * security_center_properties.resource_owners: `=`, `:` - # - # For example, `resource_properties.size = 100` is a valid filter string. - # - # Use a partial match on the empty string to filter based on a property - # existing: `resource_properties.my_property : ""` - # - # Use a negated partial match on the empty string to filter based on a - # property not existing: `-resource_properties.my_property : ""` - # @param group_by [::String] - # Required. Expression that defines what assets fields to use for grouping. The string - # value should follow SQL syntax: comma separated list of fields. For - # example: - # "security_center_properties.resource_project,security_center_properties.project". - # - # The following fields are supported when compare_duration is not set: - # - # * security_center_properties.resource_project - # * security_center_properties.resource_project_display_name - # * security_center_properties.resource_type - # * security_center_properties.resource_parent - # * security_center_properties.resource_parent_display_name - # - # The following fields are supported when compare_duration is set: - # - # * security_center_properties.resource_type - # * security_center_properties.resource_project_display_name - # * security_center_properties.resource_parent_display_name - # @param compare_duration [::Google::Protobuf::Duration, ::Hash] - # When compare_duration is set, the GroupResult's "state_change" property is - # updated to indicate whether the asset was added, removed, or remained - # present during the compare_duration period of time that precedes the - # read_time. This is the time between (read_time - compare_duration) and - # read_time. - # - # The state change value is derived based on the presence of the asset at the - # two points in time. Intermediate state changes between the two times don't - # affect the result. For example, the results aren't affected if the asset is - # removed and re-created again. - # - # Possible "state_change" values when compare_duration is specified: - # - # * "ADDED": indicates that the asset was not present at the start of - # compare_duration, but present at reference_time. - # * "REMOVED": indicates that the asset was present at the start of - # compare_duration, but not present at reference_time. - # * "ACTIVE": indicates that the asset was present at both the - # start and the end of the time period defined by - # compare_duration and reference_time. - # - # If compare_duration is not specified, then the only possible state_change - # is "UNUSED", which will be the state_change set for all assets present at - # read_time. - # - # If this field is set then `state_change` must be a specified field in - # `group_by`. - # @param read_time [::Google::Protobuf::Timestamp, ::Hash] - # Time used as a reference point when filtering assets. The filter is limited - # to assets existing at the supplied time and their values are those at that - # specific time. Absence of this field will default to the API's version of - # NOW. - # @param page_token [::String] - # The value returned by the last `GroupAssetsResponse`; indicates - # that this is a continuation of a prior `GroupAssets` call, and that the - # system should return the next page of data. - # @param page_size [::Integer] - # The maximum number of results to return in a single response. Default is - # 10, minimum is 1, maximum is 1000. - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Gapic::PagedEnumerable<::Google::Cloud::SecurityCenter::V1p1beta1::GroupResult>] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Gapic::PagedEnumerable<::Google::Cloud::SecurityCenter::V1p1beta1::GroupResult>] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/cloud/security_center/v1p1beta1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::SecurityCenter::V1p1beta1::SecurityCenter::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::SecurityCenter::V1p1beta1::GroupAssetsRequest.new - # - # # Call the group_assets method. - # result = client.group_assets request - # - # # The returned object is of type Gapic::PagedEnumerable. You can iterate - # # over elements, and API calls will be issued to fetch pages as needed. - # result.each do |item| - # # Each element is of type ::Google::Cloud::SecurityCenter::V1p1beta1::GroupResult. - # p item - # end - # - def group_assets request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::SecurityCenter::V1p1beta1::GroupAssetsRequest - - # Converts hash 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.group_assets.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::SecurityCenter::V1p1beta1::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.group_assets.timeout, - metadata: metadata, - retry_policy: @config.rpcs.group_assets.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @security_center_stub.call_rpc :group_assets, request, options: options do |response, operation| - response = ::Gapic::PagedEnumerable.new @security_center_stub, :group_assets, 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 - - ## - # Filters an organization or source's findings and groups them by their - # specified properties. - # - # To group across all sources provide a `-` as the source id. - # Example: /v1/organizations/\\{organization_id}/sources/-/findings, - # /v1/folders/\\{folder_id}/sources/-/findings, - # /v1/projects/\\{project_id}/sources/-/findings - # - # @overload group_findings(request, options = nil) - # Pass arguments to `group_findings` via a request object, either of type - # {::Google::Cloud::SecurityCenter::V1p1beta1::GroupFindingsRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::SecurityCenter::V1p1beta1::GroupFindingsRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. - # - # @overload group_findings(parent: nil, filter: nil, group_by: nil, read_time: nil, compare_duration: nil, page_token: nil, page_size: nil) - # Pass arguments to `group_findings` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param parent [::String] - # Required. Name of the source to groupBy. Its format is - # "organizations/[organization_id]/sources/[source_id]", - # folders/[folder_id]/sources/[source_id], or - # projects/[project_id]/sources/[source_id]. To groupBy across all sources - # provide a source_id of `-`. For example: - # organizations/\\{organization_id}/sources/-, folders/\\{folder_id}/sources/-, - # or projects/\\{project_id}/sources/- - # @param filter [::String] - # Expression that defines the filter to apply across findings. - # The expression is a list of one or more restrictions combined via logical - # operators `AND` and `OR`. - # Parentheses are supported, and `OR` has higher precedence than `AND`. - # - # Restrictions have the form ` ` and may have a `-` - # character in front of them to indicate negation. Examples include: - # - # * name - # * source_properties.a_property - # * security_marks.marks.marka - # - # The supported operators are: - # - # * `=` for all value types. - # * `>`, `<`, `>=`, `<=` for integer values. - # * `:`, meaning substring matching, for strings. - # - # The supported value types are: - # - # * string literals in quotes. - # * integer literals without quotes. - # * boolean literals `true` and `false` without quotes. - # - # The following field and operator combinations are supported: - # - # * name: `=` - # * parent: `=`, `:` - # * resource_name: `=`, `:` - # * state: `=`, `:` - # * category: `=`, `:` - # * external_uri: `=`, `:` - # * event_time: `=`, `>`, `<`, `>=`, `<=` - # * severity: `=`, `:` - # - # Usage: This should be milliseconds since epoch or an RFC3339 string. - # Examples: - # `event_time = "2019-06-10T16:07:18-07:00"` - # `event_time = 1560208038000` - # - # * security_marks.marks: `=`, `:` - # * source_properties: `=`, `:`, `>`, `<`, `>=`, `<=` - # - # For example, `source_properties.size = 100` is a valid filter string. - # - # Use a partial match on the empty string to filter based on a property - # existing: `source_properties.my_property : ""` - # - # Use a negated partial match on the empty string to filter based on a - # property not existing: `-source_properties.my_property : ""` - # @param group_by [::String] - # Required. Expression that defines what assets fields to use for grouping (including - # `state_change`). The string value should follow SQL syntax: comma separated - # list of fields. For example: "parent,resource_name". - # - # The following fields are supported: - # - # * resource_name - # * category - # * state - # * parent - # * severity - # - # The following fields are supported when compare_duration is set: - # - # * state_change - # @param read_time [::Google::Protobuf::Timestamp, ::Hash] - # Time used as a reference point when filtering findings. The filter is - # limited to findings existing at the supplied time and their values are - # those at that specific time. Absence of this field will default to the - # API's version of NOW. - # @param compare_duration [::Google::Protobuf::Duration, ::Hash] - # When compare_duration is set, the GroupResult's "state_change" attribute is - # updated to indicate whether the finding had its state changed, the - # finding's state remained unchanged, or if the finding was added during the - # compare_duration period of time that precedes the read_time. This is the - # time between (read_time - compare_duration) and read_time. - # - # The state_change value is derived based on the presence and state of the - # finding at the two points in time. Intermediate state changes between the - # two times don't affect the result. For example, the results aren't affected - # if the finding is made inactive and then active again. - # - # Possible "state_change" values when compare_duration is specified: - # - # * "CHANGED": indicates that the finding was present and matched the given - # filter at the start of compare_duration, but changed its - # state at read_time. - # * "UNCHANGED": indicates that the finding was present and matched the given - # filter at the start of compare_duration and did not change - # state at read_time. - # * "ADDED": indicates that the finding did not match the given filter or - # was not present at the start of compare_duration, but was - # present at read_time. - # * "REMOVED": indicates that the finding was present and matched the - # filter at the start of compare_duration, but did not match - # the filter at read_time. - # - # If compare_duration is not specified, then the only possible state_change - # is "UNUSED", which will be the state_change set for all findings present - # at read_time. - # - # If this field is set then `state_change` must be a specified field in - # `group_by`. - # @param page_token [::String] - # The value returned by the last `GroupFindingsResponse`; indicates - # that this is a continuation of a prior `GroupFindings` call, and - # that the system should return the next page of data. - # @param page_size [::Integer] - # The maximum number of results to return in a single response. Default is - # 10, minimum is 1, maximum is 1000. - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Gapic::PagedEnumerable<::Google::Cloud::SecurityCenter::V1p1beta1::GroupResult>] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Gapic::PagedEnumerable<::Google::Cloud::SecurityCenter::V1p1beta1::GroupResult>] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/cloud/security_center/v1p1beta1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::SecurityCenter::V1p1beta1::SecurityCenter::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::SecurityCenter::V1p1beta1::GroupFindingsRequest.new - # - # # Call the group_findings method. - # result = client.group_findings request - # - # # The returned object is of type Gapic::PagedEnumerable. You can iterate - # # over elements, and API calls will be issued to fetch pages as needed. - # result.each do |item| - # # Each element is of type ::Google::Cloud::SecurityCenter::V1p1beta1::GroupResult. - # p item - # end - # - def group_findings request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::SecurityCenter::V1p1beta1::GroupFindingsRequest - - # Converts hash 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.group_findings.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::SecurityCenter::V1p1beta1::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.group_findings.timeout, - metadata: metadata, - retry_policy: @config.rpcs.group_findings.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @security_center_stub.call_rpc :group_findings, request, options: options do |response, operation| - response = ::Gapic::PagedEnumerable.new @security_center_stub, :group_findings, 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 - - ## - # Lists an organization's assets. - # - # @overload list_assets(request, options = nil) - # Pass arguments to `list_assets` via a request object, either of type - # {::Google::Cloud::SecurityCenter::V1p1beta1::ListAssetsRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::SecurityCenter::V1p1beta1::ListAssetsRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_assets(parent: nil, filter: nil, order_by: nil, read_time: nil, compare_duration: nil, field_mask: nil, page_token: nil, page_size: nil) - # Pass arguments to `list_assets` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param parent [::String] - # Required. Name of the organization assets should belong to. Its format is - # "organizations/[organization_id], folders/[folder_id], or - # projects/[project_id]". - # @param filter [::String] - # Expression that defines the filter to apply across assets. - # The expression is a list of zero or more restrictions combined via logical - # operators `AND` and `OR`. - # Parentheses are supported, and `OR` has higher precedence than `AND`. - # - # Restrictions have the form ` ` and may have a `-` - # character in front of them to indicate negation. The fields map to those - # defined in the Asset resource. Examples include: - # - # * name - # * security_center_properties.resource_name - # * resource_properties.a_property - # * security_marks.marks.marka - # - # The supported operators are: - # - # * `=` for all value types. - # * `>`, `<`, `>=`, `<=` for integer values. - # * `:`, meaning substring matching, for strings. - # - # The supported value types are: - # - # * string literals in quotes. - # * integer literals without quotes. - # * boolean literals `true` and `false` without quotes. - # - # The following are the allowed field and operator combinations: - # - # * name: `=` - # * update_time: `=`, `>`, `<`, `>=`, `<=` - # - # Usage: This should be milliseconds since epoch or an RFC3339 string. - # Examples: - # `update_time = "2019-06-10T16:07:18-07:00"` - # `update_time = 1560208038000` - # - # * create_time: `=`, `>`, `<`, `>=`, `<=` - # - # Usage: This should be milliseconds since epoch or an RFC3339 string. - # Examples: - # `create_time = "2019-06-10T16:07:18-07:00"` - # `create_time = 1560208038000` - # - # * iam_policy.policy_blob: `=`, `:` - # * resource_properties: `=`, `:`, `>`, `<`, `>=`, `<=` - # * security_marks.marks: `=`, `:` - # * security_center_properties.resource_name: `=`, `:` - # * security_center_properties.resource_display_name: `=`, `:` - # * security_center_properties.resource_type: `=`, `:` - # * security_center_properties.resource_parent: `=`, `:` - # * security_center_properties.resource_parent_display_name: `=`, `:` - # * security_center_properties.resource_project: `=`, `:` - # * security_center_properties.resource_project_display_name: `=`, `:` - # * security_center_properties.resource_owners: `=`, `:` - # - # For example, `resource_properties.size = 100` is a valid filter string. - # - # Use a partial match on the empty string to filter based on a property - # existing: `resource_properties.my_property : ""` - # - # Use a negated partial match on the empty string to filter based on a - # property not existing: `-resource_properties.my_property : ""` - # @param order_by [::String] - # Expression that defines what fields and order to use for sorting. The - # string value should follow SQL syntax: comma separated list of fields. For - # example: "name,resource_properties.a_property". The default sorting order - # is ascending. To specify descending order for a field, a suffix " desc" - # should be appended to the field name. For example: "name - # desc,resource_properties.a_property". Redundant space characters in the - # syntax are insignificant. "name desc,resource_properties.a_property" and " - # name desc , resource_properties.a_property " are equivalent. - # - # The following fields are supported: - # name - # update_time - # resource_properties - # security_marks.marks - # security_center_properties.resource_name - # security_center_properties.resource_display_name - # security_center_properties.resource_parent - # security_center_properties.resource_parent_display_name - # security_center_properties.resource_project - # security_center_properties.resource_project_display_name - # security_center_properties.resource_type - # @param read_time [::Google::Protobuf::Timestamp, ::Hash] - # Time used as a reference point when filtering assets. The filter is limited - # to assets existing at the supplied time and their values are those at that - # specific time. Absence of this field will default to the API's version of - # NOW. - # @param compare_duration [::Google::Protobuf::Duration, ::Hash] - # When compare_duration is set, the ListAssetsResult's "state_change" - # attribute is updated to indicate whether the asset was added, removed, or - # remained present during the compare_duration period of time that precedes - # the read_time. This is the time between (read_time - compare_duration) and - # read_time. - # - # The state_change value is derived based on the presence of the asset at the - # two points in time. Intermediate state changes between the two times don't - # affect the result. For example, the results aren't affected if the asset is - # removed and re-created again. - # - # Possible "state_change" values when compare_duration is specified: - # - # * "ADDED": indicates that the asset was not present at the start of - # compare_duration, but present at read_time. - # * "REMOVED": indicates that the asset was present at the start of - # compare_duration, but not present at read_time. - # * "ACTIVE": indicates that the asset was present at both the - # start and the end of the time period defined by - # compare_duration and read_time. - # - # If compare_duration is not specified, then the only possible state_change - # is "UNUSED", which will be the state_change set for all assets present at - # read_time. - # @param field_mask [::Google::Protobuf::FieldMask, ::Hash] - # A field mask to specify the ListAssetsResult fields to be listed in the - # response. - # An empty field mask will list all fields. - # @param page_token [::String] - # The value returned by the last `ListAssetsResponse`; indicates - # that this is a continuation of a prior `ListAssets` call, and - # that the system should return the next page of data. - # @param page_size [::Integer] - # The maximum number of results to return in a single response. Default is - # 10, minimum is 1, maximum is 1000. - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Gapic::PagedEnumerable<::Google::Cloud::SecurityCenter::V1p1beta1::ListAssetsResponse::ListAssetsResult>] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Gapic::PagedEnumerable<::Google::Cloud::SecurityCenter::V1p1beta1::ListAssetsResponse::ListAssetsResult>] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/cloud/security_center/v1p1beta1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::SecurityCenter::V1p1beta1::SecurityCenter::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::SecurityCenter::V1p1beta1::ListAssetsRequest.new - # - # # Call the list_assets method. - # result = client.list_assets request - # - # # The returned object is of type Gapic::PagedEnumerable. You can iterate - # # over elements, and API calls will be issued to fetch pages as needed. - # result.each do |item| - # # Each element is of type ::Google::Cloud::SecurityCenter::V1p1beta1::ListAssetsResponse::ListAssetsResult. - # p item - # end - # - def list_assets request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::SecurityCenter::V1p1beta1::ListAssetsRequest - - # Converts hash 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_assets.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::SecurityCenter::V1p1beta1::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_assets.timeout, - metadata: metadata, - retry_policy: @config.rpcs.list_assets.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @security_center_stub.call_rpc :list_assets, request, options: options do |response, operation| - response = ::Gapic::PagedEnumerable.new @security_center_stub, :list_assets, 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 - - ## - # Lists an organization or source's findings. - # - # To list across all sources provide a `-` as the source id. - # Example: /v1p1beta1/organizations/\\{organization_id}/sources/-/findings - # - # @overload list_findings(request, options = nil) - # Pass arguments to `list_findings` via a request object, either of type - # {::Google::Cloud::SecurityCenter::V1p1beta1::ListFindingsRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::SecurityCenter::V1p1beta1::ListFindingsRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_findings(parent: nil, filter: nil, order_by: nil, read_time: nil, compare_duration: nil, field_mask: nil, page_token: nil, page_size: nil) - # Pass arguments to `list_findings` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param parent [::String] - # Required. Name of the source the findings belong to. Its format is - # "organizations/[organization_id]/sources/[source_id], - # folders/[folder_id]/sources/[source_id], or - # projects/[project_id]/sources/[source_id]". To list across all sources - # provide a source_id of `-`. For example: - # organizations/\\{organization_id}/sources/-, folders/\\{folder_id}/sources/- or - # projects/\\{projects_id}/sources/- - # @param filter [::String] - # Expression that defines the filter to apply across findings. - # The expression is a list of one or more restrictions combined via logical - # operators `AND` and `OR`. - # Parentheses are supported, and `OR` has higher precedence than `AND`. - # - # Restrictions have the form ` ` and may have a `-` - # character in front of them to indicate negation. Examples include: - # - # * name - # * source_properties.a_property - # * security_marks.marks.marka - # - # The supported operators are: - # - # * `=` for all value types. - # * `>`, `<`, `>=`, `<=` for integer values. - # * `:`, meaning substring matching, for strings. - # - # The supported value types are: - # - # * string literals in quotes. - # * integer literals without quotes. - # * boolean literals `true` and `false` without quotes. - # - # The following field and operator combinations are supported: - # - # * name: `=` - # * parent: `=`, `:` - # * resource_name: `=`, `:` - # * state: `=`, `:` - # * category: `=`, `:` - # * external_uri: `=`, `:` - # * event_time: `=`, `>`, `<`, `>=`, `<=` - # * severity: `=`, `:` - # - # Usage: This should be milliseconds since epoch or an RFC3339 string. - # Examples: - # `event_time = "2019-06-10T16:07:18-07:00"` - # `event_time = 1560208038000` - # - # security_marks.marks: `=`, `:` - # source_properties: `=`, `:`, `>`, `<`, `>=`, `<=` - # - # For example, `source_properties.size = 100` is a valid filter string. - # - # Use a partial match on the empty string to filter based on a property - # existing: `source_properties.my_property : ""` - # - # Use a negated partial match on the empty string to filter based on a - # property not existing: `-source_properties.my_property : ""` - # @param order_by [::String] - # Expression that defines what fields and order to use for sorting. The - # string value should follow SQL syntax: comma separated list of fields. For - # example: "name,resource_properties.a_property". The default sorting order - # is ascending. To specify descending order for a field, a suffix " desc" - # should be appended to the field name. For example: "name - # desc,source_properties.a_property". Redundant space characters in the - # syntax are insignificant. "name desc,source_properties.a_property" and " - # name desc , source_properties.a_property " are equivalent. - # - # The following fields are supported: - # name - # parent - # state - # category - # resource_name - # event_time - # source_properties - # security_marks.marks - # @param read_time [::Google::Protobuf::Timestamp, ::Hash] - # Time used as a reference point when filtering findings. The filter is - # limited to findings existing at the supplied time and their values are - # those at that specific time. Absence of this field will default to the - # API's version of NOW. - # @param compare_duration [::Google::Protobuf::Duration, ::Hash] - # When compare_duration is set, the ListFindingsResult's "state_change" - # attribute is updated to indicate whether the finding had its state changed, - # the finding's state remained unchanged, or if the finding was added in any - # state during the compare_duration period of time that precedes the - # read_time. This is the time between (read_time - compare_duration) and - # read_time. - # - # The state_change value is derived based on the presence and state of the - # finding at the two points in time. Intermediate state changes between the - # two times don't affect the result. For example, the results aren't affected - # if the finding is made inactive and then active again. - # - # Possible "state_change" values when compare_duration is specified: - # - # * "CHANGED": indicates that the finding was present and matched the given - # filter at the start of compare_duration, but changed its - # state at read_time. - # * "UNCHANGED": indicates that the finding was present and matched the given - # filter at the start of compare_duration and did not change - # state at read_time. - # * "ADDED": indicates that the finding did not match the given filter or - # was not present at the start of compare_duration, but was - # present at read_time. - # * "REMOVED": indicates that the finding was present and matched the - # filter at the start of compare_duration, but did not match - # the filter at read_time. - # - # If compare_duration is not specified, then the only possible state_change - # is "UNUSED", which will be the state_change set for all findings present at - # read_time. - # @param field_mask [::Google::Protobuf::FieldMask, ::Hash] - # A field mask to specify the Finding fields to be listed in the response. - # An empty field mask will list all fields. - # @param page_token [::String] - # The value returned by the last `ListFindingsResponse`; indicates - # that this is a continuation of a prior `ListFindings` call, and - # that the system should return the next page of data. - # @param page_size [::Integer] - # The maximum number of results to return in a single response. Default is - # 10, minimum is 1, maximum is 1000. - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Gapic::PagedEnumerable<::Google::Cloud::SecurityCenter::V1p1beta1::ListFindingsResponse::ListFindingsResult>] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Gapic::PagedEnumerable<::Google::Cloud::SecurityCenter::V1p1beta1::ListFindingsResponse::ListFindingsResult>] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/cloud/security_center/v1p1beta1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::SecurityCenter::V1p1beta1::SecurityCenter::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::SecurityCenter::V1p1beta1::ListFindingsRequest.new - # - # # Call the list_findings method. - # result = client.list_findings request - # - # # The returned object is of type Gapic::PagedEnumerable. You can iterate - # # over elements, and API calls will be issued to fetch pages as needed. - # result.each do |item| - # # Each element is of type ::Google::Cloud::SecurityCenter::V1p1beta1::ListFindingsResponse::ListFindingsResult. - # p item - # end - # - def list_findings request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::SecurityCenter::V1p1beta1::ListFindingsRequest - - # Converts hash 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_findings.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::SecurityCenter::V1p1beta1::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_findings.timeout, - metadata: metadata, - retry_policy: @config.rpcs.list_findings.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @security_center_stub.call_rpc :list_findings, request, options: options do |response, operation| - response = ::Gapic::PagedEnumerable.new @security_center_stub, :list_findings, 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 - - ## - # Lists notification configs. - # - # @overload list_notification_configs(request, options = nil) - # Pass arguments to `list_notification_configs` via a request object, either of type - # {::Google::Cloud::SecurityCenter::V1p1beta1::ListNotificationConfigsRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::SecurityCenter::V1p1beta1::ListNotificationConfigsRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_notification_configs(parent: nil, page_token: nil, page_size: nil) - # Pass arguments to `list_notification_configs` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param parent [::String] - # Required. Name of the organization to list notification configs. - # Its format is "organizations/[organization_id]". - # @param page_token [::String] - # The value returned by the last `ListNotificationConfigsResponse`; indicates - # that this is a continuation of a prior `ListNotificationConfigs` call, and - # that the system should return the next page of data. - # @param page_size [::Integer] - # The maximum number of results to return in a single response. Default is - # 10, minimum is 1, maximum is 1000. - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Gapic::PagedEnumerable<::Google::Cloud::SecurityCenter::V1p1beta1::NotificationConfig>] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Gapic::PagedEnumerable<::Google::Cloud::SecurityCenter::V1p1beta1::NotificationConfig>] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/cloud/security_center/v1p1beta1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::SecurityCenter::V1p1beta1::SecurityCenter::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::SecurityCenter::V1p1beta1::ListNotificationConfigsRequest.new - # - # # Call the list_notification_configs method. - # result = client.list_notification_configs request - # - # # The returned object is of type Gapic::PagedEnumerable. You can iterate - # # over elements, and API calls will be issued to fetch pages as needed. - # result.each do |item| - # # Each element is of type ::Google::Cloud::SecurityCenter::V1p1beta1::NotificationConfig. - # p item - # end - # - def list_notification_configs request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::SecurityCenter::V1p1beta1::ListNotificationConfigsRequest - - # Converts hash 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_notification_configs.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::SecurityCenter::V1p1beta1::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_notification_configs.timeout, - metadata: metadata, - retry_policy: @config.rpcs.list_notification_configs.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @security_center_stub.call_rpc :list_notification_configs, request, options: options do |response, operation| - response = ::Gapic::PagedEnumerable.new @security_center_stub, :list_notification_configs, 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 - - ## - # Lists all sources belonging to an organization. - # - # @overload list_sources(request, options = nil) - # Pass arguments to `list_sources` via a request object, either of type - # {::Google::Cloud::SecurityCenter::V1p1beta1::ListSourcesRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::SecurityCenter::V1p1beta1::ListSourcesRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_sources(parent: nil, page_token: nil, page_size: nil) - # Pass arguments to `list_sources` via keyword arguments. Note that at - # least one keyword argument is 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. Resource name of the parent of sources to list. Its format should be - # "organizations/[organization_id], folders/[folder_id], or - # projects/[project_id]". - # @param page_token [::String] - # The value returned by the last `ListSourcesResponse`; indicates - # that this is a continuation of a prior `ListSources` call, and - # that the system should return the next page of data. - # @param page_size [::Integer] - # The maximum number of results to return in a single response. Default is - # 10, minimum is 1, maximum is 1000. - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Gapic::PagedEnumerable<::Google::Cloud::SecurityCenter::V1p1beta1::Source>] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Gapic::PagedEnumerable<::Google::Cloud::SecurityCenter::V1p1beta1::Source>] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/cloud/security_center/v1p1beta1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::SecurityCenter::V1p1beta1::SecurityCenter::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::SecurityCenter::V1p1beta1::ListSourcesRequest.new - # - # # Call the list_sources method. - # result = client.list_sources request - # - # # The returned object is of type Gapic::PagedEnumerable. You can iterate - # # over elements, and API calls will be issued to fetch pages as needed. - # result.each do |item| - # # Each element is of type ::Google::Cloud::SecurityCenter::V1p1beta1::Source. - # p item - # end - # - def list_sources request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::SecurityCenter::V1p1beta1::ListSourcesRequest - - # Converts hash 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_sources.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::SecurityCenter::V1p1beta1::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_sources.timeout, - metadata: metadata, - retry_policy: @config.rpcs.list_sources.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @security_center_stub.call_rpc :list_sources, request, options: options do |response, operation| - response = ::Gapic::PagedEnumerable.new @security_center_stub, :list_sources, 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 - - ## - # Runs asset discovery. The discovery is tracked with a long-running - # operation. - # - # This API can only be called with limited frequency for an organization. If - # it is called too frequently the caller will receive a TOO_MANY_REQUESTS - # error. - # - # @overload run_asset_discovery(request, options = nil) - # Pass arguments to `run_asset_discovery` via a request object, either of type - # {::Google::Cloud::SecurityCenter::V1p1beta1::RunAssetDiscoveryRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::SecurityCenter::V1p1beta1::RunAssetDiscoveryRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. - # - # @overload run_asset_discovery(parent: nil) - # Pass arguments to `run_asset_discovery` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param parent [::String] - # Required. Name of the organization to run asset discovery for. Its format is - # "organizations/[organization_id]". - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Gapic::Operation] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Gapic::Operation] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/cloud/security_center/v1p1beta1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::SecurityCenter::V1p1beta1::SecurityCenter::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::SecurityCenter::V1p1beta1::RunAssetDiscoveryRequest.new - # - # # Call the run_asset_discovery method. - # result = client.run_asset_discovery 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 run_asset_discovery request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::SecurityCenter::V1p1beta1::RunAssetDiscoveryRequest - - # Converts hash 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.run_asset_discovery.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::SecurityCenter::V1p1beta1::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.run_asset_discovery.timeout, - metadata: metadata, - retry_policy: @config.rpcs.run_asset_discovery.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @security_center_stub.call_rpc :run_asset_discovery, request, options: options do |response, operation| - response = ::Gapic::Operation.new response, @operations_client, options: options - yield response, operation if block_given? - throw :response, response - end - rescue ::GRPC::BadStatus => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Updates the state of a finding. - # - # @overload set_finding_state(request, options = nil) - # Pass arguments to `set_finding_state` via a request object, either of type - # {::Google::Cloud::SecurityCenter::V1p1beta1::SetFindingStateRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::SecurityCenter::V1p1beta1::SetFindingStateRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. - # - # @overload set_finding_state(name: nil, state: nil, start_time: nil) - # Pass arguments to `set_finding_state` via keyword arguments. Note that at - # least one keyword argument is 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 relative resource name of the finding. See: - # https://cloud.google.com/apis/design/resource_names#relative_resource_name - # Example: - # "organizations/\\{organization_id}/sources/\\{source_id}/finding/\\{finding_id}". - # @param state [::Google::Cloud::SecurityCenter::V1p1beta1::Finding::State] - # Required. The desired State of the finding. - # @param start_time [::Google::Protobuf::Timestamp, ::Hash] - # Required. The time at which the updated state takes effect. - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Google::Cloud::SecurityCenter::V1p1beta1::Finding] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Google::Cloud::SecurityCenter::V1p1beta1::Finding] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/cloud/security_center/v1p1beta1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::SecurityCenter::V1p1beta1::SecurityCenter::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::SecurityCenter::V1p1beta1::SetFindingStateRequest.new - # - # # Call the set_finding_state method. - # result = client.set_finding_state request - # - # # The returned object is of type Google::Cloud::SecurityCenter::V1p1beta1::Finding. - # p result - # - def set_finding_state request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::SecurityCenter::V1p1beta1::SetFindingStateRequest - - # Converts hash and nil to an options object - options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h - - # Customize the options with defaults - metadata = @config.rpcs.set_finding_state.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::SecurityCenter::V1p1beta1::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.set_finding_state.timeout, - metadata: metadata, - retry_policy: @config.rpcs.set_finding_state.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @security_center_stub.call_rpc :set_finding_state, request, options: options do |response, operation| - yield response, operation if block_given? - end - rescue ::GRPC::BadStatus => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Sets the access control policy on the specified Source. - # - # @overload set_iam_policy(request, options = nil) - # Pass arguments to `set_iam_policy` via a request object, either of type - # {::Google::Iam::V1::SetIamPolicyRequest} or an equivalent Hash. - # - # @param request [::Google::Iam::V1::SetIamPolicyRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. - # - # @overload set_iam_policy(resource: nil, policy: nil, update_mask: nil) - # Pass arguments to `set_iam_policy` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param resource [::String] - # REQUIRED: The resource for which the policy is being specified. - # See the operation documentation for the appropriate value for this field. - # @param policy [::Google::Iam::V1::Policy, ::Hash] - # REQUIRED: The complete policy to be applied to the `resource`. The size of - # the policy is limited to a few 10s of KB. An empty policy is a - # valid policy but certain Cloud Platform services (such as Projects) - # might reject them. - # @param update_mask [::Google::Protobuf::FieldMask, ::Hash] - # OPTIONAL: A FieldMask specifying which fields of the policy to modify. Only - # the fields in the mask will be modified. If no mask is provided, the - # following default mask is used: - # - # `paths: "bindings, etag"` - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Google::Iam::V1::Policy] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Google::Iam::V1::Policy] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/cloud/security_center/v1p1beta1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::SecurityCenter::V1p1beta1::SecurityCenter::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Iam::V1::SetIamPolicyRequest.new - # - # # Call the set_iam_policy method. - # result = client.set_iam_policy request - # - # # The returned object is of type Google::Iam::V1::Policy. - # p result - # - def set_iam_policy request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Iam::V1::SetIamPolicyRequest - - # Converts hash and nil to an options object - options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h - - # Customize the options with defaults - metadata = @config.rpcs.set_iam_policy.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::SecurityCenter::V1p1beta1::VERSION - metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - header_params = {} - if request.resource - header_params["resource"] = request.resource - end - - request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") - metadata[:"x-goog-request-params"] ||= request_params_header - - options.apply_defaults timeout: @config.rpcs.set_iam_policy.timeout, - metadata: metadata, - retry_policy: @config.rpcs.set_iam_policy.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @security_center_stub.call_rpc :set_iam_policy, request, options: options do |response, operation| - yield response, operation if block_given? - end - rescue ::GRPC::BadStatus => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Returns the permissions that a caller has on the specified source. - # - # @overload test_iam_permissions(request, options = nil) - # Pass arguments to `test_iam_permissions` via a request object, either of type - # {::Google::Iam::V1::TestIamPermissionsRequest} or an equivalent Hash. - # - # @param request [::Google::Iam::V1::TestIamPermissionsRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. - # - # @overload test_iam_permissions(resource: nil, permissions: nil) - # Pass arguments to `test_iam_permissions` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param resource [::String] - # REQUIRED: The resource for which the policy detail is being requested. - # See the operation documentation for the appropriate value for this field. - # @param permissions [::Array<::String>] - # The set of permissions to check for the `resource`. Permissions with - # wildcards (such as '*' or 'storage.*') are not allowed. For more - # information see - # [IAM Overview](https://cloud.google.com/iam/docs/overview#permissions). - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Google::Iam::V1::TestIamPermissionsResponse] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Google::Iam::V1::TestIamPermissionsResponse] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/cloud/security_center/v1p1beta1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::SecurityCenter::V1p1beta1::SecurityCenter::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Iam::V1::TestIamPermissionsRequest.new - # - # # Call the test_iam_permissions method. - # result = client.test_iam_permissions request - # - # # The returned object is of type Google::Iam::V1::TestIamPermissionsResponse. - # p result - # - def test_iam_permissions request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Iam::V1::TestIamPermissionsRequest - - # Converts hash and nil to an options object - options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h - - # Customize the options with defaults - metadata = @config.rpcs.test_iam_permissions.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::SecurityCenter::V1p1beta1::VERSION - metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - header_params = {} - if request.resource - header_params["resource"] = request.resource - end - - request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") - metadata[:"x-goog-request-params"] ||= request_params_header - - options.apply_defaults timeout: @config.rpcs.test_iam_permissions.timeout, - metadata: metadata, - retry_policy: @config.rpcs.test_iam_permissions.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @security_center_stub.call_rpc :test_iam_permissions, request, options: options do |response, operation| - yield response, operation if block_given? - end - rescue ::GRPC::BadStatus => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Creates or updates a finding. The corresponding source must exist for a - # finding creation to succeed. - # - # @overload update_finding(request, options = nil) - # Pass arguments to `update_finding` via a request object, either of type - # {::Google::Cloud::SecurityCenter::V1p1beta1::UpdateFindingRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::SecurityCenter::V1p1beta1::UpdateFindingRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_finding(finding: nil, update_mask: nil) - # Pass arguments to `update_finding` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param finding [::Google::Cloud::SecurityCenter::V1p1beta1::Finding, ::Hash] - # Required. The finding resource to update or create if it does not already exist. - # parent, security_marks, and update_time will be ignored. - # - # In the case of creation, the finding id portion of the name must be - # alphanumeric and less than or equal to 32 characters and greater than 0 - # characters in length. - # @param update_mask [::Google::Protobuf::FieldMask, ::Hash] - # The FieldMask to use when updating the finding resource. This field should - # not be specified when creating a finding. - # - # When updating a finding, an empty mask is treated as updating all mutable - # fields and replacing source_properties. Individual source_properties can - # be added/updated by using "source_properties." in the field - # mask. - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Google::Cloud::SecurityCenter::V1p1beta1::Finding] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Google::Cloud::SecurityCenter::V1p1beta1::Finding] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/cloud/security_center/v1p1beta1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::SecurityCenter::V1p1beta1::SecurityCenter::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::SecurityCenter::V1p1beta1::UpdateFindingRequest.new - # - # # Call the update_finding method. - # result = client.update_finding request - # - # # The returned object is of type Google::Cloud::SecurityCenter::V1p1beta1::Finding. - # p result - # - def update_finding request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::SecurityCenter::V1p1beta1::UpdateFindingRequest - - # Converts hash 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_finding.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::SecurityCenter::V1p1beta1::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.finding&.name - header_params["finding.name"] = request.finding.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_finding.timeout, - metadata: metadata, - retry_policy: @config.rpcs.update_finding.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @security_center_stub.call_rpc :update_finding, 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 notification config. The following update - # fields are allowed: description, pubsub_topic, streaming_config.filter - # - # @overload update_notification_config(request, options = nil) - # Pass arguments to `update_notification_config` via a request object, either of type - # {::Google::Cloud::SecurityCenter::V1p1beta1::UpdateNotificationConfigRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::SecurityCenter::V1p1beta1::UpdateNotificationConfigRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_notification_config(notification_config: nil, update_mask: nil) - # Pass arguments to `update_notification_config` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param notification_config [::Google::Cloud::SecurityCenter::V1p1beta1::NotificationConfig, ::Hash] - # Required. The notification config to update. - # @param update_mask [::Google::Protobuf::FieldMask, ::Hash] - # The FieldMask to use when updating the notification config. - # - # If empty all mutable fields will be updated. - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Google::Cloud::SecurityCenter::V1p1beta1::NotificationConfig] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Google::Cloud::SecurityCenter::V1p1beta1::NotificationConfig] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/cloud/security_center/v1p1beta1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::SecurityCenter::V1p1beta1::SecurityCenter::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::SecurityCenter::V1p1beta1::UpdateNotificationConfigRequest.new - # - # # Call the update_notification_config method. - # result = client.update_notification_config request - # - # # The returned object is of type Google::Cloud::SecurityCenter::V1p1beta1::NotificationConfig. - # p result - # - def update_notification_config request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::SecurityCenter::V1p1beta1::UpdateNotificationConfigRequest - - # Converts hash 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_notification_config.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::SecurityCenter::V1p1beta1::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.notification_config&.name - header_params["notification_config.name"] = request.notification_config.name - end - - request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") - metadata[:"x-goog-request-params"] ||= request_params_header - - options.apply_defaults timeout: @config.rpcs.update_notification_config.timeout, - metadata: metadata, - retry_policy: @config.rpcs.update_notification_config.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @security_center_stub.call_rpc :update_notification_config, request, options: options do |response, operation| - yield response, operation if block_given? - end - rescue ::GRPC::BadStatus => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Updates an organization's settings. - # - # @overload update_organization_settings(request, options = nil) - # Pass arguments to `update_organization_settings` via a request object, either of type - # {::Google::Cloud::SecurityCenter::V1p1beta1::UpdateOrganizationSettingsRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::SecurityCenter::V1p1beta1::UpdateOrganizationSettingsRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. - # - # @overload update_organization_settings(organization_settings: nil, update_mask: nil) - # Pass arguments to `update_organization_settings` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param organization_settings [::Google::Cloud::SecurityCenter::V1p1beta1::OrganizationSettings, ::Hash] - # Required. The organization settings resource to update. - # @param update_mask [::Google::Protobuf::FieldMask, ::Hash] - # The FieldMask to use when updating the settings resource. - # - # If empty all mutable fields will be updated. - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Google::Cloud::SecurityCenter::V1p1beta1::OrganizationSettings] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Google::Cloud::SecurityCenter::V1p1beta1::OrganizationSettings] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/cloud/security_center/v1p1beta1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::SecurityCenter::V1p1beta1::SecurityCenter::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::SecurityCenter::V1p1beta1::UpdateOrganizationSettingsRequest.new - # - # # Call the update_organization_settings method. - # result = client.update_organization_settings request - # - # # The returned object is of type Google::Cloud::SecurityCenter::V1p1beta1::OrganizationSettings. - # p result - # - def update_organization_settings request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::SecurityCenter::V1p1beta1::UpdateOrganizationSettingsRequest - - # Converts hash and nil to an options object - options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h - - # Customize the options with defaults - metadata = @config.rpcs.update_organization_settings.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::SecurityCenter::V1p1beta1::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.organization_settings&.name - header_params["organization_settings.name"] = request.organization_settings.name - end - - request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") - metadata[:"x-goog-request-params"] ||= request_params_header - - options.apply_defaults timeout: @config.rpcs.update_organization_settings.timeout, - metadata: metadata, - retry_policy: @config.rpcs.update_organization_settings.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @security_center_stub.call_rpc :update_organization_settings, 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 source. - # - # @overload update_source(request, options = nil) - # Pass arguments to `update_source` via a request object, either of type - # {::Google::Cloud::SecurityCenter::V1p1beta1::UpdateSourceRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::SecurityCenter::V1p1beta1::UpdateSourceRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_source(source: nil, update_mask: nil) - # Pass arguments to `update_source` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param source [::Google::Cloud::SecurityCenter::V1p1beta1::Source, ::Hash] - # Required. The source resource to update. - # @param update_mask [::Google::Protobuf::FieldMask, ::Hash] - # The FieldMask to use when updating the source resource. - # - # If empty all mutable fields will be updated. - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Google::Cloud::SecurityCenter::V1p1beta1::Source] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Google::Cloud::SecurityCenter::V1p1beta1::Source] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/cloud/security_center/v1p1beta1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::SecurityCenter::V1p1beta1::SecurityCenter::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::SecurityCenter::V1p1beta1::UpdateSourceRequest.new - # - # # Call the update_source method. - # result = client.update_source request - # - # # The returned object is of type Google::Cloud::SecurityCenter::V1p1beta1::Source. - # p result - # - def update_source request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::SecurityCenter::V1p1beta1::UpdateSourceRequest - - # Converts hash 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_source.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::SecurityCenter::V1p1beta1::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.source&.name - header_params["source.name"] = request.source.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_source.timeout, - metadata: metadata, - retry_policy: @config.rpcs.update_source.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @security_center_stub.call_rpc :update_source, 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 security marks. - # - # @overload update_security_marks(request, options = nil) - # Pass arguments to `update_security_marks` via a request object, either of type - # {::Google::Cloud::SecurityCenter::V1p1beta1::UpdateSecurityMarksRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::SecurityCenter::V1p1beta1::UpdateSecurityMarksRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_security_marks(security_marks: nil, update_mask: nil, start_time: nil) - # Pass arguments to `update_security_marks` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param security_marks [::Google::Cloud::SecurityCenter::V1p1beta1::SecurityMarks, ::Hash] - # Required. The security marks resource to update. - # @param update_mask [::Google::Protobuf::FieldMask, ::Hash] - # The FieldMask to use when updating the security marks resource. - # - # The field mask must not contain duplicate fields. - # If empty or set to "marks", all marks will be replaced. Individual - # marks can be updated using "marks.". - # @param start_time [::Google::Protobuf::Timestamp, ::Hash] - # The time at which the updated SecurityMarks take effect. - # If not set uses current server time. Updates will be applied to the - # SecurityMarks that are active immediately preceding this time. - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Google::Cloud::SecurityCenter::V1p1beta1::SecurityMarks] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Google::Cloud::SecurityCenter::V1p1beta1::SecurityMarks] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/cloud/security_center/v1p1beta1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::SecurityCenter::V1p1beta1::SecurityCenter::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::SecurityCenter::V1p1beta1::UpdateSecurityMarksRequest.new - # - # # Call the update_security_marks method. - # result = client.update_security_marks request - # - # # The returned object is of type Google::Cloud::SecurityCenter::V1p1beta1::SecurityMarks. - # p result - # - def update_security_marks request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::SecurityCenter::V1p1beta1::UpdateSecurityMarksRequest - - # Converts hash 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_security_marks.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::SecurityCenter::V1p1beta1::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.security_marks&.name - header_params["security_marks.name"] = request.security_marks.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_security_marks.timeout, - metadata: metadata, - retry_policy: @config.rpcs.update_security_marks.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @security_center_stub.call_rpc :update_security_marks, request, options: options do |response, operation| - yield response, operation if block_given? - end - rescue ::GRPC::BadStatus => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Configuration class for the SecurityCenter API. - # - # This class represents the configuration for SecurityCenter, - # providing control over timeouts, retry behavior, logging, transport - # parameters, and other low-level controls. Certain parameters can also be - # applied individually to specific RPCs. See - # {::Google::Cloud::SecurityCenter::V1p1beta1::SecurityCenter::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_source to 20 seconds, - # # and all remaining timeouts to 10 seconds. - # ::Google::Cloud::SecurityCenter::V1p1beta1::SecurityCenter::Client.configure do |config| - # config.timeout = 10.0 - # config.rpcs.create_source.timeout = 20.0 - # end - # - # # Apply the above configuration only to a new client. - # client = ::Google::Cloud::SecurityCenter::V1p1beta1::SecurityCenter::Client.new do |config| - # config.timeout = 10.0 - # config.rpcs.create_source.timeout = 20.0 - # end - # - # @!attribute [rw] endpoint - # A custom service endpoint, as a hostname or hostname:port. The default is - # nil, indicating to use the default endpoint in the current universe domain. - # @return [::String,nil] - # @!attribute [rw] credentials - # Credentials to send with calls. You may provide any of the following types: - # * (`Google::Auth::Credentials`) A googleauth credentials object - # (see the [googleauth docs](https://rubydoc.info/gems/googleauth/Google/Auth/Credentials)) - # * (`Signet::OAuth2::Client`) A signet oauth2 client object - # (see the [signet docs](https://rubydoc.info/gems/signet/Signet/OAuth2/Client)) - # * (`GRPC::Core::Channel`) a gRPC channel with included credentials - # * (`GRPC::Core::ChannelCredentials`) a gRPC credentails object - # * (`nil`) indicating no credentials - # - # @note Warning: Passing a `String` to a keyfile path or a `Hash` of credentials - # is deprecated. Providing an unvalidated credential configuration to - # Google APIs can compromise the security of your systems and data. - # - # @example - # - # # The recommended way to provide credentials is to use the `make_creds` method - # # on the appropriate credentials class for your environment. - # - # require "googleauth" - # - # credentials = ::Google::Auth::ServiceAccountCredentials.make_creds( - # json_key_io: ::File.open("/path/to/keyfile.json") - # ) - # - # client = ::Google::Cloud::SecurityCenter::V1p1beta1::SecurityCenter::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 = "securitycenter.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 SecurityCenter 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_source` - # @return [::Gapic::Config::Method] - # - attr_reader :create_source - ## - # RPC-specific configuration for `create_finding` - # @return [::Gapic::Config::Method] - # - attr_reader :create_finding - ## - # RPC-specific configuration for `create_notification_config` - # @return [::Gapic::Config::Method] - # - attr_reader :create_notification_config - ## - # RPC-specific configuration for `delete_notification_config` - # @return [::Gapic::Config::Method] - # - attr_reader :delete_notification_config - ## - # RPC-specific configuration for `get_iam_policy` - # @return [::Gapic::Config::Method] - # - attr_reader :get_iam_policy - ## - # RPC-specific configuration for `get_notification_config` - # @return [::Gapic::Config::Method] - # - attr_reader :get_notification_config - ## - # RPC-specific configuration for `get_organization_settings` - # @return [::Gapic::Config::Method] - # - attr_reader :get_organization_settings - ## - # RPC-specific configuration for `get_source` - # @return [::Gapic::Config::Method] - # - attr_reader :get_source - ## - # RPC-specific configuration for `group_assets` - # @return [::Gapic::Config::Method] - # - attr_reader :group_assets - ## - # RPC-specific configuration for `group_findings` - # @return [::Gapic::Config::Method] - # - attr_reader :group_findings - ## - # RPC-specific configuration for `list_assets` - # @return [::Gapic::Config::Method] - # - attr_reader :list_assets - ## - # RPC-specific configuration for `list_findings` - # @return [::Gapic::Config::Method] - # - attr_reader :list_findings - ## - # RPC-specific configuration for `list_notification_configs` - # @return [::Gapic::Config::Method] - # - attr_reader :list_notification_configs - ## - # RPC-specific configuration for `list_sources` - # @return [::Gapic::Config::Method] - # - attr_reader :list_sources - ## - # RPC-specific configuration for `run_asset_discovery` - # @return [::Gapic::Config::Method] - # - attr_reader :run_asset_discovery - ## - # RPC-specific configuration for `set_finding_state` - # @return [::Gapic::Config::Method] - # - attr_reader :set_finding_state - ## - # RPC-specific configuration for `set_iam_policy` - # @return [::Gapic::Config::Method] - # - attr_reader :set_iam_policy - ## - # RPC-specific configuration for `test_iam_permissions` - # @return [::Gapic::Config::Method] - # - attr_reader :test_iam_permissions - ## - # RPC-specific configuration for `update_finding` - # @return [::Gapic::Config::Method] - # - attr_reader :update_finding - ## - # RPC-specific configuration for `update_notification_config` - # @return [::Gapic::Config::Method] - # - attr_reader :update_notification_config - ## - # RPC-specific configuration for `update_organization_settings` - # @return [::Gapic::Config::Method] - # - attr_reader :update_organization_settings - ## - # RPC-specific configuration for `update_source` - # @return [::Gapic::Config::Method] - # - attr_reader :update_source - ## - # RPC-specific configuration for `update_security_marks` - # @return [::Gapic::Config::Method] - # - attr_reader :update_security_marks - - # @private - def initialize parent_rpcs = nil - create_source_config = parent_rpcs.create_source if parent_rpcs.respond_to? :create_source - @create_source = ::Gapic::Config::Method.new create_source_config - create_finding_config = parent_rpcs.create_finding if parent_rpcs.respond_to? :create_finding - @create_finding = ::Gapic::Config::Method.new create_finding_config - create_notification_config_config = parent_rpcs.create_notification_config if parent_rpcs.respond_to? :create_notification_config - @create_notification_config = ::Gapic::Config::Method.new create_notification_config_config - delete_notification_config_config = parent_rpcs.delete_notification_config if parent_rpcs.respond_to? :delete_notification_config - @delete_notification_config = ::Gapic::Config::Method.new delete_notification_config_config - get_iam_policy_config = parent_rpcs.get_iam_policy if parent_rpcs.respond_to? :get_iam_policy - @get_iam_policy = ::Gapic::Config::Method.new get_iam_policy_config - get_notification_config_config = parent_rpcs.get_notification_config if parent_rpcs.respond_to? :get_notification_config - @get_notification_config = ::Gapic::Config::Method.new get_notification_config_config - get_organization_settings_config = parent_rpcs.get_organization_settings if parent_rpcs.respond_to? :get_organization_settings - @get_organization_settings = ::Gapic::Config::Method.new get_organization_settings_config - get_source_config = parent_rpcs.get_source if parent_rpcs.respond_to? :get_source - @get_source = ::Gapic::Config::Method.new get_source_config - group_assets_config = parent_rpcs.group_assets if parent_rpcs.respond_to? :group_assets - @group_assets = ::Gapic::Config::Method.new group_assets_config - group_findings_config = parent_rpcs.group_findings if parent_rpcs.respond_to? :group_findings - @group_findings = ::Gapic::Config::Method.new group_findings_config - list_assets_config = parent_rpcs.list_assets if parent_rpcs.respond_to? :list_assets - @list_assets = ::Gapic::Config::Method.new list_assets_config - list_findings_config = parent_rpcs.list_findings if parent_rpcs.respond_to? :list_findings - @list_findings = ::Gapic::Config::Method.new list_findings_config - list_notification_configs_config = parent_rpcs.list_notification_configs if parent_rpcs.respond_to? :list_notification_configs - @list_notification_configs = ::Gapic::Config::Method.new list_notification_configs_config - list_sources_config = parent_rpcs.list_sources if parent_rpcs.respond_to? :list_sources - @list_sources = ::Gapic::Config::Method.new list_sources_config - run_asset_discovery_config = parent_rpcs.run_asset_discovery if parent_rpcs.respond_to? :run_asset_discovery - @run_asset_discovery = ::Gapic::Config::Method.new run_asset_discovery_config - set_finding_state_config = parent_rpcs.set_finding_state if parent_rpcs.respond_to? :set_finding_state - @set_finding_state = ::Gapic::Config::Method.new set_finding_state_config - set_iam_policy_config = parent_rpcs.set_iam_policy if parent_rpcs.respond_to? :set_iam_policy - @set_iam_policy = ::Gapic::Config::Method.new set_iam_policy_config - test_iam_permissions_config = parent_rpcs.test_iam_permissions if parent_rpcs.respond_to? :test_iam_permissions - @test_iam_permissions = ::Gapic::Config::Method.new test_iam_permissions_config - update_finding_config = parent_rpcs.update_finding if parent_rpcs.respond_to? :update_finding - @update_finding = ::Gapic::Config::Method.new update_finding_config - update_notification_config_config = parent_rpcs.update_notification_config if parent_rpcs.respond_to? :update_notification_config - @update_notification_config = ::Gapic::Config::Method.new update_notification_config_config - update_organization_settings_config = parent_rpcs.update_organization_settings if parent_rpcs.respond_to? :update_organization_settings - @update_organization_settings = ::Gapic::Config::Method.new update_organization_settings_config - update_source_config = parent_rpcs.update_source if parent_rpcs.respond_to? :update_source - @update_source = ::Gapic::Config::Method.new update_source_config - update_security_marks_config = parent_rpcs.update_security_marks if parent_rpcs.respond_to? :update_security_marks - @update_security_marks = ::Gapic::Config::Method.new update_security_marks_config - - yield self if block_given? - end - end - end - end - end - end - end - end -end diff --git a/owl-bot-staging/google-cloud-security_center-v1p1beta1/lib/google/cloud/security_center/v1p1beta1/security_center/credentials.rb b/owl-bot-staging/google-cloud-security_center-v1p1beta1/lib/google/cloud/security_center/v1p1beta1/security_center/credentials.rb deleted file mode 100644 index cff88a0ffb4f..000000000000 --- a/owl-bot-staging/google-cloud-security_center-v1p1beta1/lib/google/cloud/security_center/v1p1beta1/security_center/credentials.rb +++ /dev/null @@ -1,51 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -require "googleauth" - -module Google - module Cloud - module SecurityCenter - module V1p1beta1 - module SecurityCenter - # Credentials for the SecurityCenter API. - class Credentials < ::Google::Auth::Credentials - self.scope = [ - "https://www.googleapis.com/auth/cloud-platform" - ] - self.env_vars = [ - "SECURITY_CENTER_CREDENTIALS", - "SECURITY_CENTER_KEYFILE", - "GOOGLE_CLOUD_CREDENTIALS", - "GOOGLE_CLOUD_KEYFILE", - "GCLOUD_KEYFILE", - "SECURITY_CENTER_CREDENTIALS_JSON", - "SECURITY_CENTER_KEYFILE_JSON", - "GOOGLE_CLOUD_CREDENTIALS_JSON", - "GOOGLE_CLOUD_KEYFILE_JSON", - "GCLOUD_KEYFILE_JSON" - ] - self.paths = [ - "~/.config/google_cloud/application_default_credentials.json" - ] - end - end - end - end - end -end diff --git a/owl-bot-staging/google-cloud-security_center-v1p1beta1/lib/google/cloud/security_center/v1p1beta1/security_center/operations.rb b/owl-bot-staging/google-cloud-security_center-v1p1beta1/lib/google/cloud/security_center/v1p1beta1/security_center/operations.rb deleted file mode 100644 index 1feff06a9839..000000000000 --- a/owl-bot-staging/google-cloud-security_center-v1p1beta1/lib/google/cloud/security_center/v1p1beta1/security_center/operations.rb +++ /dev/null @@ -1,841 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -require "gapic/operation" -require "google/longrunning/operations_pb" - -module Google - module Cloud - module SecurityCenter - module V1p1beta1 - module SecurityCenter - # Service that implements Longrunning Operations API. - class Operations - # @private - API_VERSION = "" - - # @private - DEFAULT_ENDPOINT_TEMPLATE = "securitycenter.$UNIVERSE_DOMAIN$" - - # @private - attr_reader :operations_stub - - ## - # Configuration for the SecurityCenter 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 SecurityCenter 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::SecurityCenter::V1p1beta1::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::SecurityCenter::V1p1beta1::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::SecurityCenter::V1p1beta1::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::SecurityCenter::V1p1beta1::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::SecurityCenter::V1p1beta1::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 = "securitycenter.googleapis.com" - - config_attr :endpoint, nil, ::String, nil - config_attr :credentials, nil do |value| - allowed = [::String, ::Hash, ::Proc, ::Symbol, ::Google::Auth::Credentials, ::Google::Auth::BaseClient, ::Signet::OAuth2::Client, nil] - allowed += [::GRPC::Core::Channel, ::GRPC::Core::ChannelCredentials] if defined? ::GRPC::Core::Channel - allowed.any? { |klass| klass === value } - end - config_attr :scope, nil, ::String, ::Array, nil - config_attr :lib_name, nil, ::String, nil - config_attr :lib_version, nil, ::String, nil - config_attr(:channel_args, { "grpc.service_config_disable_resolution" => 1 }, ::Hash, nil) - config_attr :interceptors, nil, ::Array, nil - config_attr :timeout, nil, ::Numeric, nil - config_attr :metadata, nil, ::Hash, nil - config_attr :retry_policy, nil, ::Hash, ::Proc, nil - config_attr :quota_project, nil, ::String, nil - config_attr :universe_domain, nil, ::String, nil - config_attr :logger, :default, ::Logger, nil, :default - - # @private - def initialize parent_config = nil - @parent_config = parent_config unless parent_config.nil? - - yield self if block_given? - end - - ## - # Configurations for individual RPCs - # @return [Rpcs] - # - def rpcs - @rpcs ||= begin - parent_rpcs = nil - parent_rpcs = @parent_config.rpcs if defined?(@parent_config) && @parent_config.respond_to?(:rpcs) - Rpcs.new parent_rpcs - end - end - - ## - # Configuration for the channel pool - # @return [::Gapic::ServiceStub::ChannelPool::Configuration] - # - def channel_pool - @channel_pool ||= ::Gapic::ServiceStub::ChannelPool::Configuration.new - end - - ## - # Configuration RPC class for the Operations API. - # - # Includes fields providing the configuration for each RPC in this service. - # Each configuration object is of type `Gapic::Config::Method` and includes - # the following configuration fields: - # - # * `timeout` (*type:* `Numeric`) - The call timeout in seconds - # * `metadata` (*type:* `Hash{Symbol=>String}`) - Additional gRPC headers - # * `retry_policy (*type:* `Hash`) - The retry policy. The policy fields - # include the following keys: - # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds. - # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds. - # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier. - # * `:retry_codes` (*type:* `Array`) - The error codes that should - # trigger a retry. - # - class Rpcs - ## - # RPC-specific configuration for `list_operations` - # @return [::Gapic::Config::Method] - # - attr_reader :list_operations - ## - # RPC-specific configuration for `get_operation` - # @return [::Gapic::Config::Method] - # - attr_reader :get_operation - ## - # RPC-specific configuration for `delete_operation` - # @return [::Gapic::Config::Method] - # - attr_reader :delete_operation - ## - # RPC-specific configuration for `cancel_operation` - # @return [::Gapic::Config::Method] - # - attr_reader :cancel_operation - ## - # RPC-specific configuration for `wait_operation` - # @return [::Gapic::Config::Method] - # - attr_reader :wait_operation - - # @private - def initialize parent_rpcs = nil - list_operations_config = parent_rpcs.list_operations if parent_rpcs.respond_to? :list_operations - @list_operations = ::Gapic::Config::Method.new list_operations_config - get_operation_config = parent_rpcs.get_operation if parent_rpcs.respond_to? :get_operation - @get_operation = ::Gapic::Config::Method.new get_operation_config - delete_operation_config = parent_rpcs.delete_operation if parent_rpcs.respond_to? :delete_operation - @delete_operation = ::Gapic::Config::Method.new delete_operation_config - cancel_operation_config = parent_rpcs.cancel_operation if parent_rpcs.respond_to? :cancel_operation - @cancel_operation = ::Gapic::Config::Method.new cancel_operation_config - wait_operation_config = parent_rpcs.wait_operation if parent_rpcs.respond_to? :wait_operation - @wait_operation = ::Gapic::Config::Method.new wait_operation_config - - yield self if block_given? - end - end - end - end - end - end - end - end -end diff --git a/owl-bot-staging/google-cloud-security_center-v1p1beta1/lib/google/cloud/security_center/v1p1beta1/security_center/paths.rb b/owl-bot-staging/google-cloud-security_center-v1p1beta1/lib/google/cloud/security_center/v1p1beta1/security_center/paths.rb deleted file mode 100644 index 7551d4c8776c..000000000000 --- a/owl-bot-staging/google-cloud-security_center-v1p1beta1/lib/google/cloud/security_center/v1p1beta1/security_center/paths.rb +++ /dev/null @@ -1,330 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - - -module Google - module Cloud - module SecurityCenter - module V1p1beta1 - module SecurityCenter - # Path helper methods for the SecurityCenter API. - module Paths - ## - # Create a fully-qualified Finding resource string. - # - # @overload finding_path(organization:, source:, finding:) - # The resource will be in the following format: - # - # `organizations/{organization}/sources/{source}/findings/{finding}` - # - # @param organization [String] - # @param source [String] - # @param finding [String] - # - # @overload finding_path(folder:, source:, finding:) - # The resource will be in the following format: - # - # `folders/{folder}/sources/{source}/findings/{finding}` - # - # @param folder [String] - # @param source [String] - # @param finding [String] - # - # @overload finding_path(project:, source:, finding:) - # The resource will be in the following format: - # - # `projects/{project}/sources/{source}/findings/{finding}` - # - # @param project [String] - # @param source [String] - # @param finding [String] - # - # @return [::String] - def finding_path **args - resources = { - "finding:organization:source" => (proc do |organization:, source:, finding:| - raise ::ArgumentError, "organization cannot contain /" if organization.to_s.include? "/" - raise ::ArgumentError, "source cannot contain /" if source.to_s.include? "/" - - "organizations/#{organization}/sources/#{source}/findings/#{finding}" - end), - "finding:folder:source" => (proc do |folder:, source:, finding:| - raise ::ArgumentError, "folder cannot contain /" if folder.to_s.include? "/" - raise ::ArgumentError, "source cannot contain /" if source.to_s.include? "/" - - "folders/#{folder}/sources/#{source}/findings/#{finding}" - end), - "finding:project:source" => (proc do |project:, source:, finding:| - raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" - raise ::ArgumentError, "source cannot contain /" if source.to_s.include? "/" - - "projects/#{project}/sources/#{source}/findings/#{finding}" - 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 Folder resource string. - # - # The resource will be in the following format: - # - # `folders/{folder}` - # - # @param folder [String] - # - # @return [::String] - def folder_path folder: - "folders/#{folder}" - end - - ## - # Create a fully-qualified NotificationConfig resource string. - # - # The resource will be in the following format: - # - # `organizations/{organization}/notificationConfigs/{notification_config}` - # - # @param organization [String] - # @param notification_config [String] - # - # @return [::String] - def notification_config_path organization:, notification_config: - raise ::ArgumentError, "organization cannot contain /" if organization.to_s.include? "/" - - "organizations/#{organization}/notificationConfigs/#{notification_config}" - end - - ## - # Create a fully-qualified Organization resource string. - # - # The resource will be in the following format: - # - # `organizations/{organization}` - # - # @param organization [String] - # - # @return [::String] - def organization_path organization: - "organizations/#{organization}" - end - - ## - # Create a fully-qualified OrganizationSettings resource string. - # - # The resource will be in the following format: - # - # `organizations/{organization}/organizationSettings` - # - # @param organization [String] - # - # @return [::String] - def organization_settings_path organization: - "organizations/#{organization}/organizationSettings" - end - - ## - # Create a fully-qualified Project resource string. - # - # The resource will be in the following format: - # - # `projects/{project}` - # - # @param project [String] - # - # @return [::String] - def project_path project: - "projects/#{project}" - end - - ## - # Create a fully-qualified SecurityMarks resource string. - # - # @overload security_marks_path(organization:, asset:) - # The resource will be in the following format: - # - # `organizations/{organization}/assets/{asset}/securityMarks` - # - # @param organization [String] - # @param asset [String] - # - # @overload security_marks_path(organization:, source:, finding:) - # The resource will be in the following format: - # - # `organizations/{organization}/sources/{source}/findings/{finding}/securityMarks` - # - # @param organization [String] - # @param source [String] - # @param finding [String] - # - # @overload security_marks_path(folder:, asset:) - # The resource will be in the following format: - # - # `folders/{folder}/assets/{asset}/securityMarks` - # - # @param folder [String] - # @param asset [String] - # - # @overload security_marks_path(project:, asset:) - # The resource will be in the following format: - # - # `projects/{project}/assets/{asset}/securityMarks` - # - # @param project [String] - # @param asset [String] - # - # @overload security_marks_path(folder:, source:, finding:) - # The resource will be in the following format: - # - # `folders/{folder}/sources/{source}/findings/{finding}/securityMarks` - # - # @param folder [String] - # @param source [String] - # @param finding [String] - # - # @overload security_marks_path(project:, source:, finding:) - # The resource will be in the following format: - # - # `projects/{project}/sources/{source}/findings/{finding}/securityMarks` - # - # @param project [String] - # @param source [String] - # @param finding [String] - # - # @return [::String] - def security_marks_path **args - resources = { - "asset:organization" => (proc do |organization:, asset:| - raise ::ArgumentError, "organization cannot contain /" if organization.to_s.include? "/" - - "organizations/#{organization}/assets/#{asset}/securityMarks" - end), - "finding:organization:source" => (proc do |organization:, source:, finding:| - raise ::ArgumentError, "organization cannot contain /" if organization.to_s.include? "/" - raise ::ArgumentError, "source cannot contain /" if source.to_s.include? "/" - - "organizations/#{organization}/sources/#{source}/findings/#{finding}/securityMarks" - end), - "asset:folder" => (proc do |folder:, asset:| - raise ::ArgumentError, "folder cannot contain /" if folder.to_s.include? "/" - - "folders/#{folder}/assets/#{asset}/securityMarks" - end), - "asset:project" => (proc do |project:, asset:| - raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" - - "projects/#{project}/assets/#{asset}/securityMarks" - end), - "finding:folder:source" => (proc do |folder:, source:, finding:| - raise ::ArgumentError, "folder cannot contain /" if folder.to_s.include? "/" - raise ::ArgumentError, "source cannot contain /" if source.to_s.include? "/" - - "folders/#{folder}/sources/#{source}/findings/#{finding}/securityMarks" - end), - "finding:project:source" => (proc do |project:, source:, finding:| - raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" - raise ::ArgumentError, "source cannot contain /" if source.to_s.include? "/" - - "projects/#{project}/sources/#{source}/findings/#{finding}/securityMarks" - 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 Source resource string. - # - # @overload source_path(organization:, source:) - # The resource will be in the following format: - # - # `organizations/{organization}/sources/{source}` - # - # @param organization [String] - # @param source [String] - # - # @overload source_path(folder:, source:) - # The resource will be in the following format: - # - # `folders/{folder}/sources/{source}` - # - # @param folder [String] - # @param source [String] - # - # @overload source_path(project:, source:) - # The resource will be in the following format: - # - # `projects/{project}/sources/{source}` - # - # @param project [String] - # @param source [String] - # - # @return [::String] - def source_path **args - resources = { - "organization:source" => (proc do |organization:, source:| - raise ::ArgumentError, "organization cannot contain /" if organization.to_s.include? "/" - - "organizations/#{organization}/sources/#{source}" - end), - "folder:source" => (proc do |folder:, source:| - raise ::ArgumentError, "folder cannot contain /" if folder.to_s.include? "/" - - "folders/#{folder}/sources/#{source}" - end), - "project:source" => (proc do |project:, source:| - raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" - - "projects/#{project}/sources/#{source}" - end) - } - - resource = resources[args.keys.sort.join(":")] - raise ::ArgumentError, "no resource found for values #{args.keys}" if resource.nil? - resource.call(**args) - end - - ## - # Create a fully-qualified Topic resource string. - # - # The resource will be in the following format: - # - # `projects/{project}/topics/{topic}` - # - # @param project [String] - # @param topic [String] - # - # @return [::String] - def topic_path project:, topic: - raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" - - "projects/#{project}/topics/#{topic}" - end - - extend self - end - end - end - end - end -end diff --git a/owl-bot-staging/google-cloud-security_center-v1p1beta1/lib/google/cloud/security_center/v1p1beta1/security_center/rest.rb b/owl-bot-staging/google-cloud-security_center-v1p1beta1/lib/google/cloud/security_center/v1p1beta1/security_center/rest.rb deleted file mode 100644 index 942518e93e2c..000000000000 --- a/owl-bot-staging/google-cloud-security_center-v1p1beta1/lib/google/cloud/security_center/v1p1beta1/security_center/rest.rb +++ /dev/null @@ -1,53 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -require "gapic/rest" -require "gapic/config" -require "gapic/config/method" - -require "google/cloud/security_center/v1p1beta1/version" - -require "google/cloud/security_center/v1p1beta1/security_center/credentials" -require "google/cloud/security_center/v1p1beta1/security_center/paths" -require "google/cloud/security_center/v1p1beta1/security_center/rest/operations" -require "google/cloud/security_center/v1p1beta1/security_center/rest/client" - -module Google - module Cloud - module SecurityCenter - module V1p1beta1 - ## - # V1p1Beta1 APIs for Security Center service. - # - # To load this service and instantiate a REST client: - # - # require "google/cloud/security_center/v1p1beta1/security_center/rest" - # client = ::Google::Cloud::SecurityCenter::V1p1beta1::SecurityCenter::Rest::Client.new - # - module SecurityCenter - # Client for the REST transport - module Rest - end - end - end - end - end -end - -helper_path = ::File.join __dir__, "rest", "helpers.rb" -require "google/cloud/security_center/v1p1beta1/security_center/rest/helpers" if ::File.file? helper_path diff --git a/owl-bot-staging/google-cloud-security_center-v1p1beta1/lib/google/cloud/security_center/v1p1beta1/security_center/rest/client.rb b/owl-bot-staging/google-cloud-security_center-v1p1beta1/lib/google/cloud/security_center/v1p1beta1/security_center/rest/client.rb deleted file mode 100644 index 3a2c7c82df87..000000000000 --- a/owl-bot-staging/google-cloud-security_center-v1p1beta1/lib/google/cloud/security_center/v1p1beta1/security_center/rest/client.rb +++ /dev/null @@ -1,3046 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -require "google/cloud/errors" -require "google/cloud/securitycenter/v1p1beta1/securitycenter_service_pb" -require "google/cloud/security_center/v1p1beta1/security_center/rest/service_stub" - -module Google - module Cloud - module SecurityCenter - module V1p1beta1 - module SecurityCenter - module Rest - ## - # REST client for the SecurityCenter service. - # - # V1p1Beta1 APIs for Security Center service. - # - class Client - # @private - API_VERSION = "" - - # @private - DEFAULT_ENDPOINT_TEMPLATE = "securitycenter.$UNIVERSE_DOMAIN$" - - include Paths - - # @private - attr_reader :security_center_stub - - ## - # Configure the SecurityCenter Client class. - # - # See {::Google::Cloud::SecurityCenter::V1p1beta1::SecurityCenter::Rest::Client::Configuration} - # for a description of the configuration fields. - # - # @example - # - # # Modify the configuration for all SecurityCenter clients - # ::Google::Cloud::SecurityCenter::V1p1beta1::SecurityCenter::Rest::Client.configure do |config| - # config.timeout = 10.0 - # end - # - # @yield [config] Configure the Client client. - # @yieldparam config [Client::Configuration] - # - # @return [Client::Configuration] - # - def self.configure - @configure ||= begin - namespace = ["Google", "Cloud", "SecurityCenter", "V1p1beta1"] - 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_source.timeout = 60.0 - - default_config.rpcs.create_finding.timeout = 60.0 - - default_config.rpcs.create_notification_config.timeout = 60.0 - - default_config.rpcs.delete_notification_config.timeout = 60.0 - - default_config.rpcs.get_iam_policy.timeout = 60.0 - default_config.rpcs.get_iam_policy.retry_policy = { - initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [4, 14] - } - - default_config.rpcs.get_notification_config.timeout = 60.0 - default_config.rpcs.get_notification_config.retry_policy = { - initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [4, 14] - } - - default_config.rpcs.get_organization_settings.timeout = 60.0 - default_config.rpcs.get_organization_settings.retry_policy = { - initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [4, 14] - } - - default_config.rpcs.get_source.timeout = 60.0 - default_config.rpcs.get_source.retry_policy = { - initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [4, 14] - } - - default_config.rpcs.group_assets.timeout = 480.0 - default_config.rpcs.group_assets.retry_policy = { - initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [4, 14] - } - - default_config.rpcs.group_findings.timeout = 480.0 - default_config.rpcs.group_findings.retry_policy = { - initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [4, 14] - } - - default_config.rpcs.list_assets.timeout = 480.0 - default_config.rpcs.list_assets.retry_policy = { - initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [4, 14] - } - - default_config.rpcs.list_findings.timeout = 480.0 - default_config.rpcs.list_findings.retry_policy = { - initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [4, 14] - } - - default_config.rpcs.list_notification_configs.timeout = 60.0 - default_config.rpcs.list_notification_configs.retry_policy = { - initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [4, 14] - } - - default_config.rpcs.list_sources.timeout = 60.0 - default_config.rpcs.list_sources.retry_policy = { - initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [4, 14] - } - - default_config.rpcs.run_asset_discovery.timeout = 60.0 - - default_config.rpcs.set_finding_state.timeout = 60.0 - - default_config.rpcs.set_iam_policy.timeout = 60.0 - - default_config.rpcs.test_iam_permissions.timeout = 60.0 - default_config.rpcs.test_iam_permissions.retry_policy = { - initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [4, 14] - } - - default_config.rpcs.update_finding.timeout = 60.0 - - default_config.rpcs.update_notification_config.timeout = 60.0 - - default_config.rpcs.update_organization_settings.timeout = 60.0 - - default_config.rpcs.update_source.timeout = 60.0 - - default_config.rpcs.update_security_marks.timeout = 480.0 - - default_config - end - yield @configure if block_given? - @configure - end - - ## - # Configure the SecurityCenter Client instance. - # - # The configuration is set to the derived mode, meaning that values can be changed, - # but structural changes (adding new fields, etc.) are not allowed. Structural changes - # should be made on {Client.configure}. - # - # See {::Google::Cloud::SecurityCenter::V1p1beta1::SecurityCenter::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 - @security_center_stub.universe_domain - end - - ## - # Create a new SecurityCenter REST client object. - # - # @example - # - # # Create a client using the default configuration - # client = ::Google::Cloud::SecurityCenter::V1p1beta1::SecurityCenter::Rest::Client.new - # - # # Create a client using a custom configuration - # client = ::Google::Cloud::SecurityCenter::V1p1beta1::SecurityCenter::Rest::Client.new do |config| - # config.timeout = 10.0 - # end - # - # @yield [config] Configure the SecurityCenter client. - # @yieldparam config [Client::Configuration] - # - def initialize - # Create the configuration object - @config = Configuration.new Client.configure - - # Yield the configuration if needed - yield @config if block_given? - - # Create credentials - credentials = @config.credentials - # Use self-signed JWT if the endpoint is unchanged from default, - # but only if the default endpoint does not have a region prefix. - enable_self_signed_jwt = @config.endpoint.nil? || - (@config.endpoint == Configuration::DEFAULT_ENDPOINT && - !@config.endpoint.split(".").first.include?("-")) - credentials ||= Credentials.default scope: @config.scope, - enable_self_signed_jwt: enable_self_signed_jwt - if credentials.is_a?(::String) || credentials.is_a?(::Hash) - credentials = Credentials.new credentials, scope: @config.scope - end - - @quota_project_id = @config.quota_project - @quota_project_id ||= credentials.quota_project_id if credentials.respond_to? :quota_project_id - - @operations_client = ::Google::Cloud::SecurityCenter::V1p1beta1::SecurityCenter::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 - - @security_center_stub = ::Google::Cloud::SecurityCenter::V1p1beta1::SecurityCenter::Rest::ServiceStub.new( - endpoint: @config.endpoint, - endpoint_template: DEFAULT_ENDPOINT_TEMPLATE, - universe_domain: @config.universe_domain, - credentials: credentials, - logger: @config.logger - ) - - @security_center_stub.logger(stub: true)&.info do |entry| - entry.set_system_name - entry.set_service - entry.message = "Created client for #{entry.service}" - entry.set_credentials_fields credentials - entry.set "customEndpoint", @config.endpoint if @config.endpoint - entry.set "defaultTimeout", @config.timeout if @config.timeout - entry.set "quotaProject", @quota_project_id if @quota_project_id - end - end - - ## - # Get the associated client for long-running operations. - # - # @return [::Google::Cloud::SecurityCenter::V1p1beta1::SecurityCenter::Rest::Operations] - # - attr_reader :operations_client - - ## - # The logger used for request/response debug logging. - # - # @return [Logger] - # - def logger - @security_center_stub.logger - end - - # Service calls - - ## - # Creates a source. - # - # @overload create_source(request, options = nil) - # Pass arguments to `create_source` via a request object, either of type - # {::Google::Cloud::SecurityCenter::V1p1beta1::CreateSourceRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::SecurityCenter::V1p1beta1::CreateSourceRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_source(parent: nil, source: nil) - # Pass arguments to `create_source` via keyword arguments. Note that at - # least one keyword argument is 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. Resource name of the new source's parent. Its format should be - # "organizations/[organization_id]". - # @param source [::Google::Cloud::SecurityCenter::V1p1beta1::Source, ::Hash] - # Required. The Source being created, only the display_name and description will be - # used. All other fields will be ignored. - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Cloud::SecurityCenter::V1p1beta1::Source] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::SecurityCenter::V1p1beta1::Source] - # - # @raise [::Google::Cloud::Error] if the REST call is aborted. - # - # @example Basic example - # require "google/cloud/security_center/v1p1beta1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::SecurityCenter::V1p1beta1::SecurityCenter::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::SecurityCenter::V1p1beta1::CreateSourceRequest.new - # - # # Call the create_source method. - # result = client.create_source request - # - # # The returned object is of type Google::Cloud::SecurityCenter::V1p1beta1::Source. - # p result - # - def create_source request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::SecurityCenter::V1p1beta1::CreateSourceRequest - - # Converts hash 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_source.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::SecurityCenter::V1p1beta1::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_source.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.create_source.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @security_center_stub.create_source request, options do |result, operation| - yield result, operation if block_given? - end - rescue ::Gapic::Rest::Error => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Creates a finding. The corresponding source must exist for finding - # creation to succeed. - # - # @overload create_finding(request, options = nil) - # Pass arguments to `create_finding` via a request object, either of type - # {::Google::Cloud::SecurityCenter::V1p1beta1::CreateFindingRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::SecurityCenter::V1p1beta1::CreateFindingRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_finding(parent: nil, finding_id: nil, finding: nil) - # Pass arguments to `create_finding` via keyword arguments. Note that at - # least one keyword argument is 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. Resource name of the new finding's parent. Its format should be - # "organizations/[organization_id]/sources/[source_id]". - # @param finding_id [::String] - # Required. Unique identifier provided by the client within the parent scope. - # @param finding [::Google::Cloud::SecurityCenter::V1p1beta1::Finding, ::Hash] - # Required. The Finding being created. The name and security_marks will be ignored as - # they are both output only fields on this resource. - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Cloud::SecurityCenter::V1p1beta1::Finding] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::SecurityCenter::V1p1beta1::Finding] - # - # @raise [::Google::Cloud::Error] if the REST call is aborted. - # - # @example Basic example - # require "google/cloud/security_center/v1p1beta1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::SecurityCenter::V1p1beta1::SecurityCenter::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::SecurityCenter::V1p1beta1::CreateFindingRequest.new - # - # # Call the create_finding method. - # result = client.create_finding request - # - # # The returned object is of type Google::Cloud::SecurityCenter::V1p1beta1::Finding. - # p result - # - def create_finding request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::SecurityCenter::V1p1beta1::CreateFindingRequest - - # Converts hash 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_finding.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::SecurityCenter::V1p1beta1::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_finding.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.create_finding.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @security_center_stub.create_finding request, options do |result, operation| - yield result, operation if block_given? - end - rescue ::Gapic::Rest::Error => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Creates a notification config. - # - # @overload create_notification_config(request, options = nil) - # Pass arguments to `create_notification_config` via a request object, either of type - # {::Google::Cloud::SecurityCenter::V1p1beta1::CreateNotificationConfigRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::SecurityCenter::V1p1beta1::CreateNotificationConfigRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_notification_config(parent: nil, config_id: nil, notification_config: nil) - # Pass arguments to `create_notification_config` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param parent [::String] - # Required. Resource name of the new notification config's parent. Its format is - # "organizations/[organization_id]". - # @param config_id [::String] - # Required. Unique identifier provided by the client within the parent scope. - # It must be between 1 and 128 characters, and contains alphanumeric - # characters, underscores or hyphens only. - # @param notification_config [::Google::Cloud::SecurityCenter::V1p1beta1::NotificationConfig, ::Hash] - # Required. The notification config being created. The name and the service account - # will be ignored as they are both output only fields on this resource. - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Cloud::SecurityCenter::V1p1beta1::NotificationConfig] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::SecurityCenter::V1p1beta1::NotificationConfig] - # - # @raise [::Google::Cloud::Error] if the REST call is aborted. - # - # @example Basic example - # require "google/cloud/security_center/v1p1beta1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::SecurityCenter::V1p1beta1::SecurityCenter::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::SecurityCenter::V1p1beta1::CreateNotificationConfigRequest.new - # - # # Call the create_notification_config method. - # result = client.create_notification_config request - # - # # The returned object is of type Google::Cloud::SecurityCenter::V1p1beta1::NotificationConfig. - # p result - # - def create_notification_config request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::SecurityCenter::V1p1beta1::CreateNotificationConfigRequest - - # Converts hash 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_notification_config.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::SecurityCenter::V1p1beta1::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_notification_config.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.create_notification_config.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @security_center_stub.create_notification_config request, options do |result, operation| - yield result, operation if block_given? - end - rescue ::Gapic::Rest::Error => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Deletes a notification config. - # - # @overload delete_notification_config(request, options = nil) - # Pass arguments to `delete_notification_config` via a request object, either of type - # {::Google::Cloud::SecurityCenter::V1p1beta1::DeleteNotificationConfigRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::SecurityCenter::V1p1beta1::DeleteNotificationConfigRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_notification_config(name: nil) - # Pass arguments to `delete_notification_config` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param name [::String] - # Required. Name of the notification config to delete. Its format is - # "organizations/[organization_id]/notificationConfigs/[config_id]". - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Protobuf::Empty] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Protobuf::Empty] - # - # @raise [::Google::Cloud::Error] if the REST call is aborted. - # - # @example Basic example - # require "google/cloud/security_center/v1p1beta1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::SecurityCenter::V1p1beta1::SecurityCenter::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::SecurityCenter::V1p1beta1::DeleteNotificationConfigRequest.new - # - # # Call the delete_notification_config method. - # result = client.delete_notification_config request - # - # # The returned object is of type Google::Protobuf::Empty. - # p result - # - def delete_notification_config request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::SecurityCenter::V1p1beta1::DeleteNotificationConfigRequest - - # Converts hash 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_notification_config.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::SecurityCenter::V1p1beta1::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_notification_config.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.delete_notification_config.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @security_center_stub.delete_notification_config request, options do |result, operation| - yield result, operation if block_given? - end - rescue ::Gapic::Rest::Error => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Gets the access control policy on the specified Source. - # - # @overload get_iam_policy(request, options = nil) - # Pass arguments to `get_iam_policy` via a request object, either of type - # {::Google::Iam::V1::GetIamPolicyRequest} or an equivalent Hash. - # - # @param request [::Google::Iam::V1::GetIamPolicyRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @overload get_iam_policy(resource: nil, options: nil) - # Pass arguments to `get_iam_policy` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param resource [::String] - # REQUIRED: The resource for which the policy is being requested. - # See the operation documentation for the appropriate value for this field. - # @param options [::Google::Iam::V1::GetPolicyOptions, ::Hash] - # OPTIONAL: A `GetPolicyOptions` object for specifying options to - # `GetIamPolicy`. - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Iam::V1::Policy] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Iam::V1::Policy] - # - # @raise [::Google::Cloud::Error] if the REST call is aborted. - # - # @example Basic example - # require "google/cloud/security_center/v1p1beta1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::SecurityCenter::V1p1beta1::SecurityCenter::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Iam::V1::GetIamPolicyRequest.new - # - # # Call the get_iam_policy method. - # result = client.get_iam_policy request - # - # # The returned object is of type Google::Iam::V1::Policy. - # p result - # - def get_iam_policy request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Iam::V1::GetIamPolicyRequest - - # Converts hash and nil to an options object - options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h - - # Customize the options with defaults - call_metadata = @config.rpcs.get_iam_policy.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::SecurityCenter::V1p1beta1::VERSION, - transports_version_send: [:rest] - - call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - options.apply_defaults timeout: @config.rpcs.get_iam_policy.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.get_iam_policy.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @security_center_stub.get_iam_policy request, options do |result, operation| - yield result, operation if block_given? - end - rescue ::Gapic::Rest::Error => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Gets a notification config. - # - # @overload get_notification_config(request, options = nil) - # Pass arguments to `get_notification_config` via a request object, either of type - # {::Google::Cloud::SecurityCenter::V1p1beta1::GetNotificationConfigRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::SecurityCenter::V1p1beta1::GetNotificationConfigRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_notification_config(name: nil) - # Pass arguments to `get_notification_config` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param name [::String] - # Required. Name of the notification config to get. Its format is - # "organizations/[organization_id]/notificationConfigs/[config_id]". - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Cloud::SecurityCenter::V1p1beta1::NotificationConfig] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::SecurityCenter::V1p1beta1::NotificationConfig] - # - # @raise [::Google::Cloud::Error] if the REST call is aborted. - # - # @example Basic example - # require "google/cloud/security_center/v1p1beta1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::SecurityCenter::V1p1beta1::SecurityCenter::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::SecurityCenter::V1p1beta1::GetNotificationConfigRequest.new - # - # # Call the get_notification_config method. - # result = client.get_notification_config request - # - # # The returned object is of type Google::Cloud::SecurityCenter::V1p1beta1::NotificationConfig. - # p result - # - def get_notification_config request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::SecurityCenter::V1p1beta1::GetNotificationConfigRequest - - # Converts hash 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_notification_config.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::SecurityCenter::V1p1beta1::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_notification_config.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.get_notification_config.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @security_center_stub.get_notification_config request, options do |result, operation| - yield result, operation if block_given? - end - rescue ::Gapic::Rest::Error => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Gets the settings for an organization. - # - # @overload get_organization_settings(request, options = nil) - # Pass arguments to `get_organization_settings` via a request object, either of type - # {::Google::Cloud::SecurityCenter::V1p1beta1::GetOrganizationSettingsRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::SecurityCenter::V1p1beta1::GetOrganizationSettingsRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @overload get_organization_settings(name: nil) - # Pass arguments to `get_organization_settings` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param name [::String] - # Required. Name of the organization to get organization settings for. Its format is - # "organizations/[organization_id]/organizationSettings". - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Cloud::SecurityCenter::V1p1beta1::OrganizationSettings] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::SecurityCenter::V1p1beta1::OrganizationSettings] - # - # @raise [::Google::Cloud::Error] if the REST call is aborted. - # - # @example Basic example - # require "google/cloud/security_center/v1p1beta1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::SecurityCenter::V1p1beta1::SecurityCenter::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::SecurityCenter::V1p1beta1::GetOrganizationSettingsRequest.new - # - # # Call the get_organization_settings method. - # result = client.get_organization_settings request - # - # # The returned object is of type Google::Cloud::SecurityCenter::V1p1beta1::OrganizationSettings. - # p result - # - def get_organization_settings request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::SecurityCenter::V1p1beta1::GetOrganizationSettingsRequest - - # Converts hash and nil to an options object - options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h - - # Customize the options with defaults - call_metadata = @config.rpcs.get_organization_settings.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::SecurityCenter::V1p1beta1::VERSION, - transports_version_send: [:rest] - - call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - options.apply_defaults timeout: @config.rpcs.get_organization_settings.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.get_organization_settings.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @security_center_stub.get_organization_settings request, options do |result, operation| - yield result, operation if block_given? - end - rescue ::Gapic::Rest::Error => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Gets a source. - # - # @overload get_source(request, options = nil) - # Pass arguments to `get_source` via a request object, either of type - # {::Google::Cloud::SecurityCenter::V1p1beta1::GetSourceRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::SecurityCenter::V1p1beta1::GetSourceRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_source(name: nil) - # Pass arguments to `get_source` via keyword arguments. Note that at - # least one keyword argument is 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. Relative resource name of the source. Its format is - # "organizations/[organization_id]/source/[source_id]". - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Cloud::SecurityCenter::V1p1beta1::Source] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::SecurityCenter::V1p1beta1::Source] - # - # @raise [::Google::Cloud::Error] if the REST call is aborted. - # - # @example Basic example - # require "google/cloud/security_center/v1p1beta1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::SecurityCenter::V1p1beta1::SecurityCenter::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::SecurityCenter::V1p1beta1::GetSourceRequest.new - # - # # Call the get_source method. - # result = client.get_source request - # - # # The returned object is of type Google::Cloud::SecurityCenter::V1p1beta1::Source. - # p result - # - def get_source request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::SecurityCenter::V1p1beta1::GetSourceRequest - - # Converts hash 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_source.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::SecurityCenter::V1p1beta1::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_source.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.get_source.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @security_center_stub.get_source 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 - - ## - # Filters an organization's assets and groups them by their specified - # properties. - # - # @overload group_assets(request, options = nil) - # Pass arguments to `group_assets` via a request object, either of type - # {::Google::Cloud::SecurityCenter::V1p1beta1::GroupAssetsRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::SecurityCenter::V1p1beta1::GroupAssetsRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @overload group_assets(parent: nil, filter: nil, group_by: nil, compare_duration: nil, read_time: nil, page_token: nil, page_size: nil) - # Pass arguments to `group_assets` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param parent [::String] - # Required. Name of the organization to groupBy. Its format is - # "organizations/[organization_id], folders/[folder_id], or - # projects/[project_id]". - # @param filter [::String] - # Expression that defines the filter to apply across assets. - # The expression is a list of zero or more restrictions combined via logical - # operators `AND` and `OR`. - # Parentheses are supported, and `OR` has higher precedence than `AND`. - # - # Restrictions have the form ` ` and may have a `-` - # character in front of them to indicate negation. The fields map to those - # defined in the Asset resource. Examples include: - # - # * name - # * security_center_properties.resource_name - # * resource_properties.a_property - # * security_marks.marks.marka - # - # The supported operators are: - # - # * `=` for all value types. - # * `>`, `<`, `>=`, `<=` for integer values. - # * `:`, meaning substring matching, for strings. - # - # The supported value types are: - # - # * string literals in quotes. - # * integer literals without quotes. - # * boolean literals `true` and `false` without quotes. - # - # The following field and operator combinations are supported: - # - # * name: `=` - # * update_time: `=`, `>`, `<`, `>=`, `<=` - # - # Usage: This should be milliseconds since epoch or an RFC3339 string. - # Examples: - # `update_time = "2019-06-10T16:07:18-07:00"` - # `update_time = 1560208038000` - # - # * create_time: `=`, `>`, `<`, `>=`, `<=` - # - # Usage: This should be milliseconds since epoch or an RFC3339 string. - # Examples: - # `create_time = "2019-06-10T16:07:18-07:00"` - # `create_time = 1560208038000` - # - # * iam_policy.policy_blob: `=`, `:` - # * resource_properties: `=`, `:`, `>`, `<`, `>=`, `<=` - # * security_marks.marks: `=`, `:` - # * security_center_properties.resource_name: `=`, `:` - # * security_center_properties.resource_name_display_name: `=`, `:` - # * security_center_properties.resource_type: `=`, `:` - # * security_center_properties.resource_parent: `=`, `:` - # * security_center_properties.resource_parent_display_name: `=`, `:` - # * security_center_properties.resource_project: `=`, `:` - # * security_center_properties.resource_project_display_name: `=`, `:` - # * security_center_properties.resource_owners: `=`, `:` - # - # For example, `resource_properties.size = 100` is a valid filter string. - # - # Use a partial match on the empty string to filter based on a property - # existing: `resource_properties.my_property : ""` - # - # Use a negated partial match on the empty string to filter based on a - # property not existing: `-resource_properties.my_property : ""` - # @param group_by [::String] - # Required. Expression that defines what assets fields to use for grouping. The string - # value should follow SQL syntax: comma separated list of fields. For - # example: - # "security_center_properties.resource_project,security_center_properties.project". - # - # The following fields are supported when compare_duration is not set: - # - # * security_center_properties.resource_project - # * security_center_properties.resource_project_display_name - # * security_center_properties.resource_type - # * security_center_properties.resource_parent - # * security_center_properties.resource_parent_display_name - # - # The following fields are supported when compare_duration is set: - # - # * security_center_properties.resource_type - # * security_center_properties.resource_project_display_name - # * security_center_properties.resource_parent_display_name - # @param compare_duration [::Google::Protobuf::Duration, ::Hash] - # When compare_duration is set, the GroupResult's "state_change" property is - # updated to indicate whether the asset was added, removed, or remained - # present during the compare_duration period of time that precedes the - # read_time. This is the time between (read_time - compare_duration) and - # read_time. - # - # The state change value is derived based on the presence of the asset at the - # two points in time. Intermediate state changes between the two times don't - # affect the result. For example, the results aren't affected if the asset is - # removed and re-created again. - # - # Possible "state_change" values when compare_duration is specified: - # - # * "ADDED": indicates that the asset was not present at the start of - # compare_duration, but present at reference_time. - # * "REMOVED": indicates that the asset was present at the start of - # compare_duration, but not present at reference_time. - # * "ACTIVE": indicates that the asset was present at both the - # start and the end of the time period defined by - # compare_duration and reference_time. - # - # If compare_duration is not specified, then the only possible state_change - # is "UNUSED", which will be the state_change set for all assets present at - # read_time. - # - # If this field is set then `state_change` must be a specified field in - # `group_by`. - # @param read_time [::Google::Protobuf::Timestamp, ::Hash] - # Time used as a reference point when filtering assets. The filter is limited - # to assets existing at the supplied time and their values are those at that - # specific time. Absence of this field will default to the API's version of - # NOW. - # @param page_token [::String] - # The value returned by the last `GroupAssetsResponse`; indicates - # that this is a continuation of a prior `GroupAssets` call, and that the - # system should return the next page of data. - # @param page_size [::Integer] - # The maximum number of results to return in a single response. Default is - # 10, minimum is 1, maximum is 1000. - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Gapic::Rest::PagedEnumerable<::Google::Cloud::SecurityCenter::V1p1beta1::GroupResult>] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Gapic::Rest::PagedEnumerable<::Google::Cloud::SecurityCenter::V1p1beta1::GroupResult>] - # - # @raise [::Google::Cloud::Error] if the REST call is aborted. - # - # @example Basic example - # require "google/cloud/security_center/v1p1beta1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::SecurityCenter::V1p1beta1::SecurityCenter::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::SecurityCenter::V1p1beta1::GroupAssetsRequest.new - # - # # Call the group_assets method. - # result = client.group_assets request - # - # # The returned object is of type Gapic::PagedEnumerable. You can iterate - # # over elements, and API calls will be issued to fetch pages as needed. - # result.each do |item| - # # Each element is of type ::Google::Cloud::SecurityCenter::V1p1beta1::GroupResult. - # p item - # end - # - def group_assets request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::SecurityCenter::V1p1beta1::GroupAssetsRequest - - # Converts hash 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.group_assets.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::SecurityCenter::V1p1beta1::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.group_assets.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.group_assets.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @security_center_stub.group_assets request, options do |result, operation| - result = ::Gapic::Rest::PagedEnumerable.new @security_center_stub, :group_assets, "group_by_results", 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 - - ## - # Filters an organization or source's findings and groups them by their - # specified properties. - # - # To group across all sources provide a `-` as the source id. - # Example: /v1/organizations/\\{organization_id}/sources/-/findings, - # /v1/folders/\\{folder_id}/sources/-/findings, - # /v1/projects/\\{project_id}/sources/-/findings - # - # @overload group_findings(request, options = nil) - # Pass arguments to `group_findings` via a request object, either of type - # {::Google::Cloud::SecurityCenter::V1p1beta1::GroupFindingsRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::SecurityCenter::V1p1beta1::GroupFindingsRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @overload group_findings(parent: nil, filter: nil, group_by: nil, read_time: nil, compare_duration: nil, page_token: nil, page_size: nil) - # Pass arguments to `group_findings` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param parent [::String] - # Required. Name of the source to groupBy. Its format is - # "organizations/[organization_id]/sources/[source_id]", - # folders/[folder_id]/sources/[source_id], or - # projects/[project_id]/sources/[source_id]. To groupBy across all sources - # provide a source_id of `-`. For example: - # organizations/\\{organization_id}/sources/-, folders/\\{folder_id}/sources/-, - # or projects/\\{project_id}/sources/- - # @param filter [::String] - # Expression that defines the filter to apply across findings. - # The expression is a list of one or more restrictions combined via logical - # operators `AND` and `OR`. - # Parentheses are supported, and `OR` has higher precedence than `AND`. - # - # Restrictions have the form ` ` and may have a `-` - # character in front of them to indicate negation. Examples include: - # - # * name - # * source_properties.a_property - # * security_marks.marks.marka - # - # The supported operators are: - # - # * `=` for all value types. - # * `>`, `<`, `>=`, `<=` for integer values. - # * `:`, meaning substring matching, for strings. - # - # The supported value types are: - # - # * string literals in quotes. - # * integer literals without quotes. - # * boolean literals `true` and `false` without quotes. - # - # The following field and operator combinations are supported: - # - # * name: `=` - # * parent: `=`, `:` - # * resource_name: `=`, `:` - # * state: `=`, `:` - # * category: `=`, `:` - # * external_uri: `=`, `:` - # * event_time: `=`, `>`, `<`, `>=`, `<=` - # * severity: `=`, `:` - # - # Usage: This should be milliseconds since epoch or an RFC3339 string. - # Examples: - # `event_time = "2019-06-10T16:07:18-07:00"` - # `event_time = 1560208038000` - # - # * security_marks.marks: `=`, `:` - # * source_properties: `=`, `:`, `>`, `<`, `>=`, `<=` - # - # For example, `source_properties.size = 100` is a valid filter string. - # - # Use a partial match on the empty string to filter based on a property - # existing: `source_properties.my_property : ""` - # - # Use a negated partial match on the empty string to filter based on a - # property not existing: `-source_properties.my_property : ""` - # @param group_by [::String] - # Required. Expression that defines what assets fields to use for grouping (including - # `state_change`). The string value should follow SQL syntax: comma separated - # list of fields. For example: "parent,resource_name". - # - # The following fields are supported: - # - # * resource_name - # * category - # * state - # * parent - # * severity - # - # The following fields are supported when compare_duration is set: - # - # * state_change - # @param read_time [::Google::Protobuf::Timestamp, ::Hash] - # Time used as a reference point when filtering findings. The filter is - # limited to findings existing at the supplied time and their values are - # those at that specific time. Absence of this field will default to the - # API's version of NOW. - # @param compare_duration [::Google::Protobuf::Duration, ::Hash] - # When compare_duration is set, the GroupResult's "state_change" attribute is - # updated to indicate whether the finding had its state changed, the - # finding's state remained unchanged, or if the finding was added during the - # compare_duration period of time that precedes the read_time. This is the - # time between (read_time - compare_duration) and read_time. - # - # The state_change value is derived based on the presence and state of the - # finding at the two points in time. Intermediate state changes between the - # two times don't affect the result. For example, the results aren't affected - # if the finding is made inactive and then active again. - # - # Possible "state_change" values when compare_duration is specified: - # - # * "CHANGED": indicates that the finding was present and matched the given - # filter at the start of compare_duration, but changed its - # state at read_time. - # * "UNCHANGED": indicates that the finding was present and matched the given - # filter at the start of compare_duration and did not change - # state at read_time. - # * "ADDED": indicates that the finding did not match the given filter or - # was not present at the start of compare_duration, but was - # present at read_time. - # * "REMOVED": indicates that the finding was present and matched the - # filter at the start of compare_duration, but did not match - # the filter at read_time. - # - # If compare_duration is not specified, then the only possible state_change - # is "UNUSED", which will be the state_change set for all findings present - # at read_time. - # - # If this field is set then `state_change` must be a specified field in - # `group_by`. - # @param page_token [::String] - # The value returned by the last `GroupFindingsResponse`; indicates - # that this is a continuation of a prior `GroupFindings` call, and - # that the system should return the next page of data. - # @param page_size [::Integer] - # The maximum number of results to return in a single response. Default is - # 10, minimum is 1, maximum is 1000. - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Gapic::Rest::PagedEnumerable<::Google::Cloud::SecurityCenter::V1p1beta1::GroupResult>] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Gapic::Rest::PagedEnumerable<::Google::Cloud::SecurityCenter::V1p1beta1::GroupResult>] - # - # @raise [::Google::Cloud::Error] if the REST call is aborted. - # - # @example Basic example - # require "google/cloud/security_center/v1p1beta1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::SecurityCenter::V1p1beta1::SecurityCenter::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::SecurityCenter::V1p1beta1::GroupFindingsRequest.new - # - # # Call the group_findings method. - # result = client.group_findings request - # - # # The returned object is of type Gapic::PagedEnumerable. You can iterate - # # over elements, and API calls will be issued to fetch pages as needed. - # result.each do |item| - # # Each element is of type ::Google::Cloud::SecurityCenter::V1p1beta1::GroupResult. - # p item - # end - # - def group_findings request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::SecurityCenter::V1p1beta1::GroupFindingsRequest - - # Converts hash 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.group_findings.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::SecurityCenter::V1p1beta1::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.group_findings.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.group_findings.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @security_center_stub.group_findings request, options do |result, operation| - result = ::Gapic::Rest::PagedEnumerable.new @security_center_stub, :group_findings, "group_by_results", 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 - - ## - # Lists an organization's assets. - # - # @overload list_assets(request, options = nil) - # Pass arguments to `list_assets` via a request object, either of type - # {::Google::Cloud::SecurityCenter::V1p1beta1::ListAssetsRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::SecurityCenter::V1p1beta1::ListAssetsRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_assets(parent: nil, filter: nil, order_by: nil, read_time: nil, compare_duration: nil, field_mask: nil, page_token: nil, page_size: nil) - # Pass arguments to `list_assets` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param parent [::String] - # Required. Name of the organization assets should belong to. Its format is - # "organizations/[organization_id], folders/[folder_id], or - # projects/[project_id]". - # @param filter [::String] - # Expression that defines the filter to apply across assets. - # The expression is a list of zero or more restrictions combined via logical - # operators `AND` and `OR`. - # Parentheses are supported, and `OR` has higher precedence than `AND`. - # - # Restrictions have the form ` ` and may have a `-` - # character in front of them to indicate negation. The fields map to those - # defined in the Asset resource. Examples include: - # - # * name - # * security_center_properties.resource_name - # * resource_properties.a_property - # * security_marks.marks.marka - # - # The supported operators are: - # - # * `=` for all value types. - # * `>`, `<`, `>=`, `<=` for integer values. - # * `:`, meaning substring matching, for strings. - # - # The supported value types are: - # - # * string literals in quotes. - # * integer literals without quotes. - # * boolean literals `true` and `false` without quotes. - # - # The following are the allowed field and operator combinations: - # - # * name: `=` - # * update_time: `=`, `>`, `<`, `>=`, `<=` - # - # Usage: This should be milliseconds since epoch or an RFC3339 string. - # Examples: - # `update_time = "2019-06-10T16:07:18-07:00"` - # `update_time = 1560208038000` - # - # * create_time: `=`, `>`, `<`, `>=`, `<=` - # - # Usage: This should be milliseconds since epoch or an RFC3339 string. - # Examples: - # `create_time = "2019-06-10T16:07:18-07:00"` - # `create_time = 1560208038000` - # - # * iam_policy.policy_blob: `=`, `:` - # * resource_properties: `=`, `:`, `>`, `<`, `>=`, `<=` - # * security_marks.marks: `=`, `:` - # * security_center_properties.resource_name: `=`, `:` - # * security_center_properties.resource_display_name: `=`, `:` - # * security_center_properties.resource_type: `=`, `:` - # * security_center_properties.resource_parent: `=`, `:` - # * security_center_properties.resource_parent_display_name: `=`, `:` - # * security_center_properties.resource_project: `=`, `:` - # * security_center_properties.resource_project_display_name: `=`, `:` - # * security_center_properties.resource_owners: `=`, `:` - # - # For example, `resource_properties.size = 100` is a valid filter string. - # - # Use a partial match on the empty string to filter based on a property - # existing: `resource_properties.my_property : ""` - # - # Use a negated partial match on the empty string to filter based on a - # property not existing: `-resource_properties.my_property : ""` - # @param order_by [::String] - # Expression that defines what fields and order to use for sorting. The - # string value should follow SQL syntax: comma separated list of fields. For - # example: "name,resource_properties.a_property". The default sorting order - # is ascending. To specify descending order for a field, a suffix " desc" - # should be appended to the field name. For example: "name - # desc,resource_properties.a_property". Redundant space characters in the - # syntax are insignificant. "name desc,resource_properties.a_property" and " - # name desc , resource_properties.a_property " are equivalent. - # - # The following fields are supported: - # name - # update_time - # resource_properties - # security_marks.marks - # security_center_properties.resource_name - # security_center_properties.resource_display_name - # security_center_properties.resource_parent - # security_center_properties.resource_parent_display_name - # security_center_properties.resource_project - # security_center_properties.resource_project_display_name - # security_center_properties.resource_type - # @param read_time [::Google::Protobuf::Timestamp, ::Hash] - # Time used as a reference point when filtering assets. The filter is limited - # to assets existing at the supplied time and their values are those at that - # specific time. Absence of this field will default to the API's version of - # NOW. - # @param compare_duration [::Google::Protobuf::Duration, ::Hash] - # When compare_duration is set, the ListAssetsResult's "state_change" - # attribute is updated to indicate whether the asset was added, removed, or - # remained present during the compare_duration period of time that precedes - # the read_time. This is the time between (read_time - compare_duration) and - # read_time. - # - # The state_change value is derived based on the presence of the asset at the - # two points in time. Intermediate state changes between the two times don't - # affect the result. For example, the results aren't affected if the asset is - # removed and re-created again. - # - # Possible "state_change" values when compare_duration is specified: - # - # * "ADDED": indicates that the asset was not present at the start of - # compare_duration, but present at read_time. - # * "REMOVED": indicates that the asset was present at the start of - # compare_duration, but not present at read_time. - # * "ACTIVE": indicates that the asset was present at both the - # start and the end of the time period defined by - # compare_duration and read_time. - # - # If compare_duration is not specified, then the only possible state_change - # is "UNUSED", which will be the state_change set for all assets present at - # read_time. - # @param field_mask [::Google::Protobuf::FieldMask, ::Hash] - # A field mask to specify the ListAssetsResult fields to be listed in the - # response. - # An empty field mask will list all fields. - # @param page_token [::String] - # The value returned by the last `ListAssetsResponse`; indicates - # that this is a continuation of a prior `ListAssets` call, and - # that the system should return the next page of data. - # @param page_size [::Integer] - # The maximum number of results to return in a single response. Default is - # 10, minimum is 1, maximum is 1000. - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Gapic::Rest::PagedEnumerable<::Google::Cloud::SecurityCenter::V1p1beta1::ListAssetsResponse::ListAssetsResult>] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Gapic::Rest::PagedEnumerable<::Google::Cloud::SecurityCenter::V1p1beta1::ListAssetsResponse::ListAssetsResult>] - # - # @raise [::Google::Cloud::Error] if the REST call is aborted. - # - # @example Basic example - # require "google/cloud/security_center/v1p1beta1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::SecurityCenter::V1p1beta1::SecurityCenter::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::SecurityCenter::V1p1beta1::ListAssetsRequest.new - # - # # Call the list_assets method. - # result = client.list_assets request - # - # # The returned object is of type Gapic::PagedEnumerable. You can iterate - # # over elements, and API calls will be issued to fetch pages as needed. - # result.each do |item| - # # Each element is of type ::Google::Cloud::SecurityCenter::V1p1beta1::ListAssetsResponse::ListAssetsResult. - # p item - # end - # - def list_assets request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::SecurityCenter::V1p1beta1::ListAssetsRequest - - # Converts hash 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_assets.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::SecurityCenter::V1p1beta1::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_assets.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.list_assets.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @security_center_stub.list_assets request, options do |result, operation| - result = ::Gapic::Rest::PagedEnumerable.new @security_center_stub, :list_assets, "list_assets_results", 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 - - ## - # Lists an organization or source's findings. - # - # To list across all sources provide a `-` as the source id. - # Example: /v1p1beta1/organizations/\\{organization_id}/sources/-/findings - # - # @overload list_findings(request, options = nil) - # Pass arguments to `list_findings` via a request object, either of type - # {::Google::Cloud::SecurityCenter::V1p1beta1::ListFindingsRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::SecurityCenter::V1p1beta1::ListFindingsRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_findings(parent: nil, filter: nil, order_by: nil, read_time: nil, compare_duration: nil, field_mask: nil, page_token: nil, page_size: nil) - # Pass arguments to `list_findings` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param parent [::String] - # Required. Name of the source the findings belong to. Its format is - # "organizations/[organization_id]/sources/[source_id], - # folders/[folder_id]/sources/[source_id], or - # projects/[project_id]/sources/[source_id]". To list across all sources - # provide a source_id of `-`. For example: - # organizations/\\{organization_id}/sources/-, folders/\\{folder_id}/sources/- or - # projects/\\{projects_id}/sources/- - # @param filter [::String] - # Expression that defines the filter to apply across findings. - # The expression is a list of one or more restrictions combined via logical - # operators `AND` and `OR`. - # Parentheses are supported, and `OR` has higher precedence than `AND`. - # - # Restrictions have the form ` ` and may have a `-` - # character in front of them to indicate negation. Examples include: - # - # * name - # * source_properties.a_property - # * security_marks.marks.marka - # - # The supported operators are: - # - # * `=` for all value types. - # * `>`, `<`, `>=`, `<=` for integer values. - # * `:`, meaning substring matching, for strings. - # - # The supported value types are: - # - # * string literals in quotes. - # * integer literals without quotes. - # * boolean literals `true` and `false` without quotes. - # - # The following field and operator combinations are supported: - # - # * name: `=` - # * parent: `=`, `:` - # * resource_name: `=`, `:` - # * state: `=`, `:` - # * category: `=`, `:` - # * external_uri: `=`, `:` - # * event_time: `=`, `>`, `<`, `>=`, `<=` - # * severity: `=`, `:` - # - # Usage: This should be milliseconds since epoch or an RFC3339 string. - # Examples: - # `event_time = "2019-06-10T16:07:18-07:00"` - # `event_time = 1560208038000` - # - # security_marks.marks: `=`, `:` - # source_properties: `=`, `:`, `>`, `<`, `>=`, `<=` - # - # For example, `source_properties.size = 100` is a valid filter string. - # - # Use a partial match on the empty string to filter based on a property - # existing: `source_properties.my_property : ""` - # - # Use a negated partial match on the empty string to filter based on a - # property not existing: `-source_properties.my_property : ""` - # @param order_by [::String] - # Expression that defines what fields and order to use for sorting. The - # string value should follow SQL syntax: comma separated list of fields. For - # example: "name,resource_properties.a_property". The default sorting order - # is ascending. To specify descending order for a field, a suffix " desc" - # should be appended to the field name. For example: "name - # desc,source_properties.a_property". Redundant space characters in the - # syntax are insignificant. "name desc,source_properties.a_property" and " - # name desc , source_properties.a_property " are equivalent. - # - # The following fields are supported: - # name - # parent - # state - # category - # resource_name - # event_time - # source_properties - # security_marks.marks - # @param read_time [::Google::Protobuf::Timestamp, ::Hash] - # Time used as a reference point when filtering findings. The filter is - # limited to findings existing at the supplied time and their values are - # those at that specific time. Absence of this field will default to the - # API's version of NOW. - # @param compare_duration [::Google::Protobuf::Duration, ::Hash] - # When compare_duration is set, the ListFindingsResult's "state_change" - # attribute is updated to indicate whether the finding had its state changed, - # the finding's state remained unchanged, or if the finding was added in any - # state during the compare_duration period of time that precedes the - # read_time. This is the time between (read_time - compare_duration) and - # read_time. - # - # The state_change value is derived based on the presence and state of the - # finding at the two points in time. Intermediate state changes between the - # two times don't affect the result. For example, the results aren't affected - # if the finding is made inactive and then active again. - # - # Possible "state_change" values when compare_duration is specified: - # - # * "CHANGED": indicates that the finding was present and matched the given - # filter at the start of compare_duration, but changed its - # state at read_time. - # * "UNCHANGED": indicates that the finding was present and matched the given - # filter at the start of compare_duration and did not change - # state at read_time. - # * "ADDED": indicates that the finding did not match the given filter or - # was not present at the start of compare_duration, but was - # present at read_time. - # * "REMOVED": indicates that the finding was present and matched the - # filter at the start of compare_duration, but did not match - # the filter at read_time. - # - # If compare_duration is not specified, then the only possible state_change - # is "UNUSED", which will be the state_change set for all findings present at - # read_time. - # @param field_mask [::Google::Protobuf::FieldMask, ::Hash] - # A field mask to specify the Finding fields to be listed in the response. - # An empty field mask will list all fields. - # @param page_token [::String] - # The value returned by the last `ListFindingsResponse`; indicates - # that this is a continuation of a prior `ListFindings` call, and - # that the system should return the next page of data. - # @param page_size [::Integer] - # The maximum number of results to return in a single response. Default is - # 10, minimum is 1, maximum is 1000. - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Gapic::Rest::PagedEnumerable<::Google::Cloud::SecurityCenter::V1p1beta1::ListFindingsResponse::ListFindingsResult>] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Gapic::Rest::PagedEnumerable<::Google::Cloud::SecurityCenter::V1p1beta1::ListFindingsResponse::ListFindingsResult>] - # - # @raise [::Google::Cloud::Error] if the REST call is aborted. - # - # @example Basic example - # require "google/cloud/security_center/v1p1beta1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::SecurityCenter::V1p1beta1::SecurityCenter::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::SecurityCenter::V1p1beta1::ListFindingsRequest.new - # - # # Call the list_findings method. - # result = client.list_findings request - # - # # The returned object is of type Gapic::PagedEnumerable. You can iterate - # # over elements, and API calls will be issued to fetch pages as needed. - # result.each do |item| - # # Each element is of type ::Google::Cloud::SecurityCenter::V1p1beta1::ListFindingsResponse::ListFindingsResult. - # p item - # end - # - def list_findings request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::SecurityCenter::V1p1beta1::ListFindingsRequest - - # Converts hash 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_findings.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::SecurityCenter::V1p1beta1::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_findings.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.list_findings.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @security_center_stub.list_findings request, options do |result, operation| - result = ::Gapic::Rest::PagedEnumerable.new @security_center_stub, :list_findings, "list_findings_results", 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 - - ## - # Lists notification configs. - # - # @overload list_notification_configs(request, options = nil) - # Pass arguments to `list_notification_configs` via a request object, either of type - # {::Google::Cloud::SecurityCenter::V1p1beta1::ListNotificationConfigsRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::SecurityCenter::V1p1beta1::ListNotificationConfigsRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_notification_configs(parent: nil, page_token: nil, page_size: nil) - # Pass arguments to `list_notification_configs` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param parent [::String] - # Required. Name of the organization to list notification configs. - # Its format is "organizations/[organization_id]". - # @param page_token [::String] - # The value returned by the last `ListNotificationConfigsResponse`; indicates - # that this is a continuation of a prior `ListNotificationConfigs` call, and - # that the system should return the next page of data. - # @param page_size [::Integer] - # The maximum number of results to return in a single response. Default is - # 10, minimum is 1, maximum is 1000. - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Gapic::Rest::PagedEnumerable<::Google::Cloud::SecurityCenter::V1p1beta1::NotificationConfig>] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Gapic::Rest::PagedEnumerable<::Google::Cloud::SecurityCenter::V1p1beta1::NotificationConfig>] - # - # @raise [::Google::Cloud::Error] if the REST call is aborted. - # - # @example Basic example - # require "google/cloud/security_center/v1p1beta1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::SecurityCenter::V1p1beta1::SecurityCenter::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::SecurityCenter::V1p1beta1::ListNotificationConfigsRequest.new - # - # # Call the list_notification_configs method. - # result = client.list_notification_configs request - # - # # The returned object is of type Gapic::PagedEnumerable. You can iterate - # # over elements, and API calls will be issued to fetch pages as needed. - # result.each do |item| - # # Each element is of type ::Google::Cloud::SecurityCenter::V1p1beta1::NotificationConfig. - # p item - # end - # - def list_notification_configs request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::SecurityCenter::V1p1beta1::ListNotificationConfigsRequest - - # Converts hash 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_notification_configs.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::SecurityCenter::V1p1beta1::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_notification_configs.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.list_notification_configs.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @security_center_stub.list_notification_configs request, options do |result, operation| - result = ::Gapic::Rest::PagedEnumerable.new @security_center_stub, :list_notification_configs, "notification_configs", 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 - - ## - # Lists all sources belonging to an organization. - # - # @overload list_sources(request, options = nil) - # Pass arguments to `list_sources` via a request object, either of type - # {::Google::Cloud::SecurityCenter::V1p1beta1::ListSourcesRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::SecurityCenter::V1p1beta1::ListSourcesRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_sources(parent: nil, page_token: nil, page_size: nil) - # Pass arguments to `list_sources` via keyword arguments. Note that at - # least one keyword argument is 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. Resource name of the parent of sources to list. Its format should be - # "organizations/[organization_id], folders/[folder_id], or - # projects/[project_id]". - # @param page_token [::String] - # The value returned by the last `ListSourcesResponse`; indicates - # that this is a continuation of a prior `ListSources` call, and - # that the system should return the next page of data. - # @param page_size [::Integer] - # The maximum number of results to return in a single response. Default is - # 10, minimum is 1, maximum is 1000. - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Gapic::Rest::PagedEnumerable<::Google::Cloud::SecurityCenter::V1p1beta1::Source>] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Gapic::Rest::PagedEnumerable<::Google::Cloud::SecurityCenter::V1p1beta1::Source>] - # - # @raise [::Google::Cloud::Error] if the REST call is aborted. - # - # @example Basic example - # require "google/cloud/security_center/v1p1beta1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::SecurityCenter::V1p1beta1::SecurityCenter::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::SecurityCenter::V1p1beta1::ListSourcesRequest.new - # - # # Call the list_sources method. - # result = client.list_sources request - # - # # The returned object is of type Gapic::PagedEnumerable. You can iterate - # # over elements, and API calls will be issued to fetch pages as needed. - # result.each do |item| - # # Each element is of type ::Google::Cloud::SecurityCenter::V1p1beta1::Source. - # p item - # end - # - def list_sources request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::SecurityCenter::V1p1beta1::ListSourcesRequest - - # Converts hash 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_sources.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::SecurityCenter::V1p1beta1::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_sources.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.list_sources.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @security_center_stub.list_sources request, options do |result, operation| - result = ::Gapic::Rest::PagedEnumerable.new @security_center_stub, :list_sources, "sources", 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 - - ## - # Runs asset discovery. The discovery is tracked with a long-running - # operation. - # - # This API can only be called with limited frequency for an organization. If - # it is called too frequently the caller will receive a TOO_MANY_REQUESTS - # error. - # - # @overload run_asset_discovery(request, options = nil) - # Pass arguments to `run_asset_discovery` via a request object, either of type - # {::Google::Cloud::SecurityCenter::V1p1beta1::RunAssetDiscoveryRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::SecurityCenter::V1p1beta1::RunAssetDiscoveryRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @overload run_asset_discovery(parent: nil) - # Pass arguments to `run_asset_discovery` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param parent [::String] - # Required. Name of the organization to run asset discovery for. Its format is - # "organizations/[organization_id]". - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Gapic::Operation] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Gapic::Operation] - # - # @raise [::Google::Cloud::Error] if the REST call is aborted. - # - # @example Basic example - # require "google/cloud/security_center/v1p1beta1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::SecurityCenter::V1p1beta1::SecurityCenter::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::SecurityCenter::V1p1beta1::RunAssetDiscoveryRequest.new - # - # # Call the run_asset_discovery method. - # result = client.run_asset_discovery 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 run_asset_discovery request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::SecurityCenter::V1p1beta1::RunAssetDiscoveryRequest - - # Converts hash 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.run_asset_discovery.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::SecurityCenter::V1p1beta1::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.run_asset_discovery.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.run_asset_discovery.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @security_center_stub.run_asset_discovery 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 - - ## - # Updates the state of a finding. - # - # @overload set_finding_state(request, options = nil) - # Pass arguments to `set_finding_state` via a request object, either of type - # {::Google::Cloud::SecurityCenter::V1p1beta1::SetFindingStateRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::SecurityCenter::V1p1beta1::SetFindingStateRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @overload set_finding_state(name: nil, state: nil, start_time: nil) - # Pass arguments to `set_finding_state` via keyword arguments. Note that at - # least one keyword argument is 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 relative resource name of the finding. See: - # https://cloud.google.com/apis/design/resource_names#relative_resource_name - # Example: - # "organizations/\\{organization_id}/sources/\\{source_id}/finding/\\{finding_id}". - # @param state [::Google::Cloud::SecurityCenter::V1p1beta1::Finding::State] - # Required. The desired State of the finding. - # @param start_time [::Google::Protobuf::Timestamp, ::Hash] - # Required. The time at which the updated state takes effect. - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Cloud::SecurityCenter::V1p1beta1::Finding] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::SecurityCenter::V1p1beta1::Finding] - # - # @raise [::Google::Cloud::Error] if the REST call is aborted. - # - # @example Basic example - # require "google/cloud/security_center/v1p1beta1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::SecurityCenter::V1p1beta1::SecurityCenter::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::SecurityCenter::V1p1beta1::SetFindingStateRequest.new - # - # # Call the set_finding_state method. - # result = client.set_finding_state request - # - # # The returned object is of type Google::Cloud::SecurityCenter::V1p1beta1::Finding. - # p result - # - def set_finding_state request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::SecurityCenter::V1p1beta1::SetFindingStateRequest - - # Converts hash and nil to an options object - options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h - - # Customize the options with defaults - call_metadata = @config.rpcs.set_finding_state.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::SecurityCenter::V1p1beta1::VERSION, - transports_version_send: [:rest] - - call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - options.apply_defaults timeout: @config.rpcs.set_finding_state.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.set_finding_state.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @security_center_stub.set_finding_state request, options do |result, operation| - yield result, operation if block_given? - end - rescue ::Gapic::Rest::Error => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Sets the access control policy on the specified Source. - # - # @overload set_iam_policy(request, options = nil) - # Pass arguments to `set_iam_policy` via a request object, either of type - # {::Google::Iam::V1::SetIamPolicyRequest} or an equivalent Hash. - # - # @param request [::Google::Iam::V1::SetIamPolicyRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @overload set_iam_policy(resource: nil, policy: nil, update_mask: nil) - # Pass arguments to `set_iam_policy` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param resource [::String] - # REQUIRED: The resource for which the policy is being specified. - # See the operation documentation for the appropriate value for this field. - # @param policy [::Google::Iam::V1::Policy, ::Hash] - # REQUIRED: The complete policy to be applied to the `resource`. The size of - # the policy is limited to a few 10s of KB. An empty policy is a - # valid policy but certain Cloud Platform services (such as Projects) - # might reject them. - # @param update_mask [::Google::Protobuf::FieldMask, ::Hash] - # OPTIONAL: A FieldMask specifying which fields of the policy to modify. Only - # the fields in the mask will be modified. If no mask is provided, the - # following default mask is used: - # - # `paths: "bindings, etag"` - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Iam::V1::Policy] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Iam::V1::Policy] - # - # @raise [::Google::Cloud::Error] if the REST call is aborted. - # - # @example Basic example - # require "google/cloud/security_center/v1p1beta1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::SecurityCenter::V1p1beta1::SecurityCenter::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Iam::V1::SetIamPolicyRequest.new - # - # # Call the set_iam_policy method. - # result = client.set_iam_policy request - # - # # The returned object is of type Google::Iam::V1::Policy. - # p result - # - def set_iam_policy request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Iam::V1::SetIamPolicyRequest - - # Converts hash and nil to an options object - options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h - - # Customize the options with defaults - call_metadata = @config.rpcs.set_iam_policy.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::SecurityCenter::V1p1beta1::VERSION, - transports_version_send: [:rest] - - call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - options.apply_defaults timeout: @config.rpcs.set_iam_policy.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.set_iam_policy.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @security_center_stub.set_iam_policy request, options do |result, operation| - yield result, operation if block_given? - end - rescue ::Gapic::Rest::Error => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Returns the permissions that a caller has on the specified source. - # - # @overload test_iam_permissions(request, options = nil) - # Pass arguments to `test_iam_permissions` via a request object, either of type - # {::Google::Iam::V1::TestIamPermissionsRequest} or an equivalent Hash. - # - # @param request [::Google::Iam::V1::TestIamPermissionsRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @overload test_iam_permissions(resource: nil, permissions: nil) - # Pass arguments to `test_iam_permissions` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param resource [::String] - # REQUIRED: The resource for which the policy detail is being requested. - # See the operation documentation for the appropriate value for this field. - # @param permissions [::Array<::String>] - # The set of permissions to check for the `resource`. Permissions with - # wildcards (such as '*' or 'storage.*') are not allowed. For more - # information see - # [IAM Overview](https://cloud.google.com/iam/docs/overview#permissions). - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Iam::V1::TestIamPermissionsResponse] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Iam::V1::TestIamPermissionsResponse] - # - # @raise [::Google::Cloud::Error] if the REST call is aborted. - # - # @example Basic example - # require "google/cloud/security_center/v1p1beta1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::SecurityCenter::V1p1beta1::SecurityCenter::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Iam::V1::TestIamPermissionsRequest.new - # - # # Call the test_iam_permissions method. - # result = client.test_iam_permissions request - # - # # The returned object is of type Google::Iam::V1::TestIamPermissionsResponse. - # p result - # - def test_iam_permissions request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Iam::V1::TestIamPermissionsRequest - - # Converts hash and nil to an options object - options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h - - # Customize the options with defaults - call_metadata = @config.rpcs.test_iam_permissions.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::SecurityCenter::V1p1beta1::VERSION, - transports_version_send: [:rest] - - call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - options.apply_defaults timeout: @config.rpcs.test_iam_permissions.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.test_iam_permissions.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @security_center_stub.test_iam_permissions request, options do |result, operation| - yield result, operation if block_given? - end - rescue ::Gapic::Rest::Error => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Creates or updates a finding. The corresponding source must exist for a - # finding creation to succeed. - # - # @overload update_finding(request, options = nil) - # Pass arguments to `update_finding` via a request object, either of type - # {::Google::Cloud::SecurityCenter::V1p1beta1::UpdateFindingRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::SecurityCenter::V1p1beta1::UpdateFindingRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_finding(finding: nil, update_mask: nil) - # Pass arguments to `update_finding` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param finding [::Google::Cloud::SecurityCenter::V1p1beta1::Finding, ::Hash] - # Required. The finding resource to update or create if it does not already exist. - # parent, security_marks, and update_time will be ignored. - # - # In the case of creation, the finding id portion of the name must be - # alphanumeric and less than or equal to 32 characters and greater than 0 - # characters in length. - # @param update_mask [::Google::Protobuf::FieldMask, ::Hash] - # The FieldMask to use when updating the finding resource. This field should - # not be specified when creating a finding. - # - # When updating a finding, an empty mask is treated as updating all mutable - # fields and replacing source_properties. Individual source_properties can - # be added/updated by using "source_properties." in the field - # mask. - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Cloud::SecurityCenter::V1p1beta1::Finding] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::SecurityCenter::V1p1beta1::Finding] - # - # @raise [::Google::Cloud::Error] if the REST call is aborted. - # - # @example Basic example - # require "google/cloud/security_center/v1p1beta1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::SecurityCenter::V1p1beta1::SecurityCenter::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::SecurityCenter::V1p1beta1::UpdateFindingRequest.new - # - # # Call the update_finding method. - # result = client.update_finding request - # - # # The returned object is of type Google::Cloud::SecurityCenter::V1p1beta1::Finding. - # p result - # - def update_finding request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::SecurityCenter::V1p1beta1::UpdateFindingRequest - - # Converts hash 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_finding.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::SecurityCenter::V1p1beta1::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_finding.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.update_finding.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @security_center_stub.update_finding 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 notification config. The following update - # fields are allowed: description, pubsub_topic, streaming_config.filter - # - # @overload update_notification_config(request, options = nil) - # Pass arguments to `update_notification_config` via a request object, either of type - # {::Google::Cloud::SecurityCenter::V1p1beta1::UpdateNotificationConfigRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::SecurityCenter::V1p1beta1::UpdateNotificationConfigRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_notification_config(notification_config: nil, update_mask: nil) - # Pass arguments to `update_notification_config` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param notification_config [::Google::Cloud::SecurityCenter::V1p1beta1::NotificationConfig, ::Hash] - # Required. The notification config to update. - # @param update_mask [::Google::Protobuf::FieldMask, ::Hash] - # The FieldMask to use when updating the notification config. - # - # If empty all mutable fields will be updated. - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Cloud::SecurityCenter::V1p1beta1::NotificationConfig] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::SecurityCenter::V1p1beta1::NotificationConfig] - # - # @raise [::Google::Cloud::Error] if the REST call is aborted. - # - # @example Basic example - # require "google/cloud/security_center/v1p1beta1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::SecurityCenter::V1p1beta1::SecurityCenter::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::SecurityCenter::V1p1beta1::UpdateNotificationConfigRequest.new - # - # # Call the update_notification_config method. - # result = client.update_notification_config request - # - # # The returned object is of type Google::Cloud::SecurityCenter::V1p1beta1::NotificationConfig. - # p result - # - def update_notification_config request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::SecurityCenter::V1p1beta1::UpdateNotificationConfigRequest - - # Converts hash 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_notification_config.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::SecurityCenter::V1p1beta1::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_notification_config.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.update_notification_config.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @security_center_stub.update_notification_config request, options do |result, operation| - yield result, operation if block_given? - end - rescue ::Gapic::Rest::Error => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Updates an organization's settings. - # - # @overload update_organization_settings(request, options = nil) - # Pass arguments to `update_organization_settings` via a request object, either of type - # {::Google::Cloud::SecurityCenter::V1p1beta1::UpdateOrganizationSettingsRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::SecurityCenter::V1p1beta1::UpdateOrganizationSettingsRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @overload update_organization_settings(organization_settings: nil, update_mask: nil) - # Pass arguments to `update_organization_settings` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param organization_settings [::Google::Cloud::SecurityCenter::V1p1beta1::OrganizationSettings, ::Hash] - # Required. The organization settings resource to update. - # @param update_mask [::Google::Protobuf::FieldMask, ::Hash] - # The FieldMask to use when updating the settings resource. - # - # If empty all mutable fields will be updated. - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Cloud::SecurityCenter::V1p1beta1::OrganizationSettings] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::SecurityCenter::V1p1beta1::OrganizationSettings] - # - # @raise [::Google::Cloud::Error] if the REST call is aborted. - # - # @example Basic example - # require "google/cloud/security_center/v1p1beta1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::SecurityCenter::V1p1beta1::SecurityCenter::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::SecurityCenter::V1p1beta1::UpdateOrganizationSettingsRequest.new - # - # # Call the update_organization_settings method. - # result = client.update_organization_settings request - # - # # The returned object is of type Google::Cloud::SecurityCenter::V1p1beta1::OrganizationSettings. - # p result - # - def update_organization_settings request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::SecurityCenter::V1p1beta1::UpdateOrganizationSettingsRequest - - # Converts hash and nil to an options object - options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h - - # Customize the options with defaults - call_metadata = @config.rpcs.update_organization_settings.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::SecurityCenter::V1p1beta1::VERSION, - transports_version_send: [:rest] - - call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - options.apply_defaults timeout: @config.rpcs.update_organization_settings.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.update_organization_settings.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @security_center_stub.update_organization_settings 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 source. - # - # @overload update_source(request, options = nil) - # Pass arguments to `update_source` via a request object, either of type - # {::Google::Cloud::SecurityCenter::V1p1beta1::UpdateSourceRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::SecurityCenter::V1p1beta1::UpdateSourceRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_source(source: nil, update_mask: nil) - # Pass arguments to `update_source` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param source [::Google::Cloud::SecurityCenter::V1p1beta1::Source, ::Hash] - # Required. The source resource to update. - # @param update_mask [::Google::Protobuf::FieldMask, ::Hash] - # The FieldMask to use when updating the source resource. - # - # If empty all mutable fields will be updated. - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Cloud::SecurityCenter::V1p1beta1::Source] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::SecurityCenter::V1p1beta1::Source] - # - # @raise [::Google::Cloud::Error] if the REST call is aborted. - # - # @example Basic example - # require "google/cloud/security_center/v1p1beta1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::SecurityCenter::V1p1beta1::SecurityCenter::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::SecurityCenter::V1p1beta1::UpdateSourceRequest.new - # - # # Call the update_source method. - # result = client.update_source request - # - # # The returned object is of type Google::Cloud::SecurityCenter::V1p1beta1::Source. - # p result - # - def update_source request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::SecurityCenter::V1p1beta1::UpdateSourceRequest - - # Converts hash 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_source.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::SecurityCenter::V1p1beta1::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_source.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.update_source.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @security_center_stub.update_source 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 security marks. - # - # @overload update_security_marks(request, options = nil) - # Pass arguments to `update_security_marks` via a request object, either of type - # {::Google::Cloud::SecurityCenter::V1p1beta1::UpdateSecurityMarksRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::SecurityCenter::V1p1beta1::UpdateSecurityMarksRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_security_marks(security_marks: nil, update_mask: nil, start_time: nil) - # Pass arguments to `update_security_marks` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param security_marks [::Google::Cloud::SecurityCenter::V1p1beta1::SecurityMarks, ::Hash] - # Required. The security marks resource to update. - # @param update_mask [::Google::Protobuf::FieldMask, ::Hash] - # The FieldMask to use when updating the security marks resource. - # - # The field mask must not contain duplicate fields. - # If empty or set to "marks", all marks will be replaced. Individual - # marks can be updated using "marks.". - # @param start_time [::Google::Protobuf::Timestamp, ::Hash] - # The time at which the updated SecurityMarks take effect. - # If not set uses current server time. Updates will be applied to the - # SecurityMarks that are active immediately preceding this time. - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Cloud::SecurityCenter::V1p1beta1::SecurityMarks] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::SecurityCenter::V1p1beta1::SecurityMarks] - # - # @raise [::Google::Cloud::Error] if the REST call is aborted. - # - # @example Basic example - # require "google/cloud/security_center/v1p1beta1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::SecurityCenter::V1p1beta1::SecurityCenter::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::SecurityCenter::V1p1beta1::UpdateSecurityMarksRequest.new - # - # # Call the update_security_marks method. - # result = client.update_security_marks request - # - # # The returned object is of type Google::Cloud::SecurityCenter::V1p1beta1::SecurityMarks. - # p result - # - def update_security_marks request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::SecurityCenter::V1p1beta1::UpdateSecurityMarksRequest - - # Converts hash 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_security_marks.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::SecurityCenter::V1p1beta1::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_security_marks.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.update_security_marks.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @security_center_stub.update_security_marks 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 SecurityCenter REST API. - # - # This class represents the configuration for SecurityCenter REST, - # providing control over timeouts, retry behavior, logging, transport - # parameters, and other low-level controls. Certain parameters can also be - # applied individually to specific RPCs. See - # {::Google::Cloud::SecurityCenter::V1p1beta1::SecurityCenter::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_source to 20 seconds, - # # and all remaining timeouts to 10 seconds. - # ::Google::Cloud::SecurityCenter::V1p1beta1::SecurityCenter::Rest::Client.configure do |config| - # config.timeout = 10.0 - # config.rpcs.create_source.timeout = 20.0 - # end - # - # # Apply the above configuration only to a new client. - # client = ::Google::Cloud::SecurityCenter::V1p1beta1::SecurityCenter::Rest::Client.new do |config| - # config.timeout = 10.0 - # config.rpcs.create_source.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 = "securitycenter.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 SecurityCenter 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_source` - # @return [::Gapic::Config::Method] - # - attr_reader :create_source - ## - # RPC-specific configuration for `create_finding` - # @return [::Gapic::Config::Method] - # - attr_reader :create_finding - ## - # RPC-specific configuration for `create_notification_config` - # @return [::Gapic::Config::Method] - # - attr_reader :create_notification_config - ## - # RPC-specific configuration for `delete_notification_config` - # @return [::Gapic::Config::Method] - # - attr_reader :delete_notification_config - ## - # RPC-specific configuration for `get_iam_policy` - # @return [::Gapic::Config::Method] - # - attr_reader :get_iam_policy - ## - # RPC-specific configuration for `get_notification_config` - # @return [::Gapic::Config::Method] - # - attr_reader :get_notification_config - ## - # RPC-specific configuration for `get_organization_settings` - # @return [::Gapic::Config::Method] - # - attr_reader :get_organization_settings - ## - # RPC-specific configuration for `get_source` - # @return [::Gapic::Config::Method] - # - attr_reader :get_source - ## - # RPC-specific configuration for `group_assets` - # @return [::Gapic::Config::Method] - # - attr_reader :group_assets - ## - # RPC-specific configuration for `group_findings` - # @return [::Gapic::Config::Method] - # - attr_reader :group_findings - ## - # RPC-specific configuration for `list_assets` - # @return [::Gapic::Config::Method] - # - attr_reader :list_assets - ## - # RPC-specific configuration for `list_findings` - # @return [::Gapic::Config::Method] - # - attr_reader :list_findings - ## - # RPC-specific configuration for `list_notification_configs` - # @return [::Gapic::Config::Method] - # - attr_reader :list_notification_configs - ## - # RPC-specific configuration for `list_sources` - # @return [::Gapic::Config::Method] - # - attr_reader :list_sources - ## - # RPC-specific configuration for `run_asset_discovery` - # @return [::Gapic::Config::Method] - # - attr_reader :run_asset_discovery - ## - # RPC-specific configuration for `set_finding_state` - # @return [::Gapic::Config::Method] - # - attr_reader :set_finding_state - ## - # RPC-specific configuration for `set_iam_policy` - # @return [::Gapic::Config::Method] - # - attr_reader :set_iam_policy - ## - # RPC-specific configuration for `test_iam_permissions` - # @return [::Gapic::Config::Method] - # - attr_reader :test_iam_permissions - ## - # RPC-specific configuration for `update_finding` - # @return [::Gapic::Config::Method] - # - attr_reader :update_finding - ## - # RPC-specific configuration for `update_notification_config` - # @return [::Gapic::Config::Method] - # - attr_reader :update_notification_config - ## - # RPC-specific configuration for `update_organization_settings` - # @return [::Gapic::Config::Method] - # - attr_reader :update_organization_settings - ## - # RPC-specific configuration for `update_source` - # @return [::Gapic::Config::Method] - # - attr_reader :update_source - ## - # RPC-specific configuration for `update_security_marks` - # @return [::Gapic::Config::Method] - # - attr_reader :update_security_marks - - # @private - def initialize parent_rpcs = nil - create_source_config = parent_rpcs.create_source if parent_rpcs.respond_to? :create_source - @create_source = ::Gapic::Config::Method.new create_source_config - create_finding_config = parent_rpcs.create_finding if parent_rpcs.respond_to? :create_finding - @create_finding = ::Gapic::Config::Method.new create_finding_config - create_notification_config_config = parent_rpcs.create_notification_config if parent_rpcs.respond_to? :create_notification_config - @create_notification_config = ::Gapic::Config::Method.new create_notification_config_config - delete_notification_config_config = parent_rpcs.delete_notification_config if parent_rpcs.respond_to? :delete_notification_config - @delete_notification_config = ::Gapic::Config::Method.new delete_notification_config_config - get_iam_policy_config = parent_rpcs.get_iam_policy if parent_rpcs.respond_to? :get_iam_policy - @get_iam_policy = ::Gapic::Config::Method.new get_iam_policy_config - get_notification_config_config = parent_rpcs.get_notification_config if parent_rpcs.respond_to? :get_notification_config - @get_notification_config = ::Gapic::Config::Method.new get_notification_config_config - get_organization_settings_config = parent_rpcs.get_organization_settings if parent_rpcs.respond_to? :get_organization_settings - @get_organization_settings = ::Gapic::Config::Method.new get_organization_settings_config - get_source_config = parent_rpcs.get_source if parent_rpcs.respond_to? :get_source - @get_source = ::Gapic::Config::Method.new get_source_config - group_assets_config = parent_rpcs.group_assets if parent_rpcs.respond_to? :group_assets - @group_assets = ::Gapic::Config::Method.new group_assets_config - group_findings_config = parent_rpcs.group_findings if parent_rpcs.respond_to? :group_findings - @group_findings = ::Gapic::Config::Method.new group_findings_config - list_assets_config = parent_rpcs.list_assets if parent_rpcs.respond_to? :list_assets - @list_assets = ::Gapic::Config::Method.new list_assets_config - list_findings_config = parent_rpcs.list_findings if parent_rpcs.respond_to? :list_findings - @list_findings = ::Gapic::Config::Method.new list_findings_config - list_notification_configs_config = parent_rpcs.list_notification_configs if parent_rpcs.respond_to? :list_notification_configs - @list_notification_configs = ::Gapic::Config::Method.new list_notification_configs_config - list_sources_config = parent_rpcs.list_sources if parent_rpcs.respond_to? :list_sources - @list_sources = ::Gapic::Config::Method.new list_sources_config - run_asset_discovery_config = parent_rpcs.run_asset_discovery if parent_rpcs.respond_to? :run_asset_discovery - @run_asset_discovery = ::Gapic::Config::Method.new run_asset_discovery_config - set_finding_state_config = parent_rpcs.set_finding_state if parent_rpcs.respond_to? :set_finding_state - @set_finding_state = ::Gapic::Config::Method.new set_finding_state_config - set_iam_policy_config = parent_rpcs.set_iam_policy if parent_rpcs.respond_to? :set_iam_policy - @set_iam_policy = ::Gapic::Config::Method.new set_iam_policy_config - test_iam_permissions_config = parent_rpcs.test_iam_permissions if parent_rpcs.respond_to? :test_iam_permissions - @test_iam_permissions = ::Gapic::Config::Method.new test_iam_permissions_config - update_finding_config = parent_rpcs.update_finding if parent_rpcs.respond_to? :update_finding - @update_finding = ::Gapic::Config::Method.new update_finding_config - update_notification_config_config = parent_rpcs.update_notification_config if parent_rpcs.respond_to? :update_notification_config - @update_notification_config = ::Gapic::Config::Method.new update_notification_config_config - update_organization_settings_config = parent_rpcs.update_organization_settings if parent_rpcs.respond_to? :update_organization_settings - @update_organization_settings = ::Gapic::Config::Method.new update_organization_settings_config - update_source_config = parent_rpcs.update_source if parent_rpcs.respond_to? :update_source - @update_source = ::Gapic::Config::Method.new update_source_config - update_security_marks_config = parent_rpcs.update_security_marks if parent_rpcs.respond_to? :update_security_marks - @update_security_marks = ::Gapic::Config::Method.new update_security_marks_config - - yield self if block_given? - end - end - end - end - end - end - end - end - end -end diff --git a/owl-bot-staging/google-cloud-security_center-v1p1beta1/lib/google/cloud/security_center/v1p1beta1/security_center/rest/operations.rb b/owl-bot-staging/google-cloud-security_center-v1p1beta1/lib/google/cloud/security_center/v1p1beta1/security_center/rest/operations.rb deleted file mode 100644 index 6f15a750401a..000000000000 --- a/owl-bot-staging/google-cloud-security_center-v1p1beta1/lib/google/cloud/security_center/v1p1beta1/security_center/rest/operations.rb +++ /dev/null @@ -1,925 +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 Cloud - module SecurityCenter - module V1p1beta1 - module SecurityCenter - module Rest - # Service that implements Longrunning Operations API. - class Operations - # @private - API_VERSION = "" - - # @private - DEFAULT_ENDPOINT_TEMPLATE = "securitycenter.$UNIVERSE_DOMAIN$" - - # @private - attr_reader :operations_stub - - ## - # Configuration for the SecurityCenter 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 SecurityCenter 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::SecurityCenter::V1p1beta1::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::SecurityCenter::V1p1beta1::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::SecurityCenter::V1p1beta1::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::SecurityCenter::V1p1beta1::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 = "securitycenter.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: "/v1p1beta1/{name}", - matches: [ - ["name", %r{^organizations/[^/]+/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: "/v1p1beta1/{name}", - matches: [ - ["name", %r{^organizations/[^/]+/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: "/v1p1beta1/{name}", - matches: [ - ["name", %r{^organizations/[^/]+/operations/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the cancel_operation REST call - # - # @param request_pb [::Google::Longrunning::CancelOperationRequest] - # A request object representing the call parameters. Required. - # @return [Array(String, [String, nil], Hash{String => String})] - # Uri, Body, Query string parameters - def self.transcode_cancel_operation_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :post, - uri_template: "/v1p1beta1/{name}:cancel", - body: "*", - matches: [ - ["name", %r{^organizations/[^/]+/operations/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - end - end - end - end - end - end -end diff --git a/owl-bot-staging/google-cloud-security_center-v1p1beta1/lib/google/cloud/security_center/v1p1beta1/security_center/rest/service_stub.rb b/owl-bot-staging/google-cloud-security_center-v1p1beta1/lib/google/cloud/security_center/v1p1beta1/security_center/rest/service_stub.rb deleted file mode 100644 index 8b4fcab1731e..000000000000 --- a/owl-bot-staging/google-cloud-security_center-v1p1beta1/lib/google/cloud/security_center/v1p1beta1/security_center/rest/service_stub.rb +++ /dev/null @@ -1,1645 +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/securitycenter/v1p1beta1/securitycenter_service_pb" - -module Google - module Cloud - module SecurityCenter - module V1p1beta1 - module SecurityCenter - module Rest - ## - # REST service stub for the SecurityCenter 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_source REST call - # - # @param request_pb [::Google::Cloud::SecurityCenter::V1p1beta1::CreateSourceRequest] - # A request object representing the call parameters. Required. - # @param options [::Gapic::CallOptions] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Cloud::SecurityCenter::V1p1beta1::Source] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::SecurityCenter::V1p1beta1::Source] - # A result object deserialized from the server's reply - def create_source request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_create_source_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_source", - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Cloud::SecurityCenter::V1p1beta1::Source.decode_json response.body, ignore_unknown_fields: true - catch :response do - yield result, operation if block_given? - result - end - end - - ## - # Baseline implementation for the create_finding REST call - # - # @param request_pb [::Google::Cloud::SecurityCenter::V1p1beta1::CreateFindingRequest] - # A request object representing the call parameters. Required. - # @param options [::Gapic::CallOptions] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Cloud::SecurityCenter::V1p1beta1::Finding] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::SecurityCenter::V1p1beta1::Finding] - # A result object deserialized from the server's reply - def create_finding request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_create_finding_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_finding", - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Cloud::SecurityCenter::V1p1beta1::Finding.decode_json response.body, ignore_unknown_fields: true - catch :response do - yield result, operation if block_given? - result - end - end - - ## - # Baseline implementation for the create_notification_config REST call - # - # @param request_pb [::Google::Cloud::SecurityCenter::V1p1beta1::CreateNotificationConfigRequest] - # A request object representing the call parameters. Required. - # @param options [::Gapic::CallOptions] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Cloud::SecurityCenter::V1p1beta1::NotificationConfig] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::SecurityCenter::V1p1beta1::NotificationConfig] - # A result object deserialized from the server's reply - def create_notification_config request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_create_notification_config_request request_pb - query_string_params = if query_string_params.any? - query_string_params.to_h { |p| p.split "=", 2 } - else - {} - end - - response = @client_stub.make_http_request( - verb, - uri: uri, - body: body || "", - params: query_string_params, - method_name: "create_notification_config", - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Cloud::SecurityCenter::V1p1beta1::NotificationConfig.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_notification_config REST call - # - # @param request_pb [::Google::Cloud::SecurityCenter::V1p1beta1::DeleteNotificationConfigRequest] - # 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_notification_config request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_delete_notification_config_request request_pb - query_string_params = if query_string_params.any? - query_string_params.to_h { |p| p.split "=", 2 } - else - {} - end - - response = @client_stub.make_http_request( - verb, - uri: uri, - body: body || "", - params: query_string_params, - method_name: "delete_notification_config", - 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 get_iam_policy REST call - # - # @param request_pb [::Google::Iam::V1::GetIamPolicyRequest] - # A request object representing the call parameters. Required. - # @param options [::Gapic::CallOptions] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Iam::V1::Policy] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Iam::V1::Policy] - # A result object deserialized from the server's reply - def get_iam_policy request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_get_iam_policy_request request_pb - query_string_params = if query_string_params.any? - query_string_params.to_h { |p| p.split "=", 2 } - else - {} - end - - response = @client_stub.make_http_request( - verb, - uri: uri, - body: body || "", - params: query_string_params, - method_name: "get_iam_policy", - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Iam::V1::Policy.decode_json response.body, ignore_unknown_fields: true - catch :response do - yield result, operation if block_given? - result - end - end - - ## - # Baseline implementation for the get_notification_config REST call - # - # @param request_pb [::Google::Cloud::SecurityCenter::V1p1beta1::GetNotificationConfigRequest] - # A request object representing the call parameters. Required. - # @param options [::Gapic::CallOptions] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Cloud::SecurityCenter::V1p1beta1::NotificationConfig] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::SecurityCenter::V1p1beta1::NotificationConfig] - # A result object deserialized from the server's reply - def get_notification_config request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_get_notification_config_request request_pb - query_string_params = if query_string_params.any? - query_string_params.to_h { |p| p.split "=", 2 } - else - {} - end - - response = @client_stub.make_http_request( - verb, - uri: uri, - body: body || "", - params: query_string_params, - method_name: "get_notification_config", - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Cloud::SecurityCenter::V1p1beta1::NotificationConfig.decode_json response.body, ignore_unknown_fields: true - catch :response do - yield result, operation if block_given? - result - end - end - - ## - # Baseline implementation for the get_organization_settings REST call - # - # @param request_pb [::Google::Cloud::SecurityCenter::V1p1beta1::GetOrganizationSettingsRequest] - # A request object representing the call parameters. Required. - # @param options [::Gapic::CallOptions] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Cloud::SecurityCenter::V1p1beta1::OrganizationSettings] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::SecurityCenter::V1p1beta1::OrganizationSettings] - # A result object deserialized from the server's reply - def get_organization_settings request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_get_organization_settings_request request_pb - query_string_params = if query_string_params.any? - query_string_params.to_h { |p| p.split "=", 2 } - else - {} - end - - response = @client_stub.make_http_request( - verb, - uri: uri, - body: body || "", - params: query_string_params, - method_name: "get_organization_settings", - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Cloud::SecurityCenter::V1p1beta1::OrganizationSettings.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_source REST call - # - # @param request_pb [::Google::Cloud::SecurityCenter::V1p1beta1::GetSourceRequest] - # A request object representing the call parameters. Required. - # @param options [::Gapic::CallOptions] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Cloud::SecurityCenter::V1p1beta1::Source] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::SecurityCenter::V1p1beta1::Source] - # A result object deserialized from the server's reply - def get_source request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_get_source_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_source", - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Cloud::SecurityCenter::V1p1beta1::Source.decode_json response.body, ignore_unknown_fields: true - catch :response do - yield result, operation if block_given? - result - end - end - - ## - # Baseline implementation for the group_assets REST call - # - # @param request_pb [::Google::Cloud::SecurityCenter::V1p1beta1::GroupAssetsRequest] - # A request object representing the call parameters. Required. - # @param options [::Gapic::CallOptions] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Cloud::SecurityCenter::V1p1beta1::GroupAssetsResponse] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::SecurityCenter::V1p1beta1::GroupAssetsResponse] - # A result object deserialized from the server's reply - def group_assets request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_group_assets_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: "group_assets", - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Cloud::SecurityCenter::V1p1beta1::GroupAssetsResponse.decode_json response.body, ignore_unknown_fields: true - catch :response do - yield result, operation if block_given? - result - end - end - - ## - # Baseline implementation for the group_findings REST call - # - # @param request_pb [::Google::Cloud::SecurityCenter::V1p1beta1::GroupFindingsRequest] - # A request object representing the call parameters. Required. - # @param options [::Gapic::CallOptions] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Cloud::SecurityCenter::V1p1beta1::GroupFindingsResponse] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::SecurityCenter::V1p1beta1::GroupFindingsResponse] - # A result object deserialized from the server's reply - def group_findings request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_group_findings_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: "group_findings", - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Cloud::SecurityCenter::V1p1beta1::GroupFindingsResponse.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_assets REST call - # - # @param request_pb [::Google::Cloud::SecurityCenter::V1p1beta1::ListAssetsRequest] - # A request object representing the call parameters. Required. - # @param options [::Gapic::CallOptions] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Cloud::SecurityCenter::V1p1beta1::ListAssetsResponse] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::SecurityCenter::V1p1beta1::ListAssetsResponse] - # A result object deserialized from the server's reply - def list_assets request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_list_assets_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_assets", - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Cloud::SecurityCenter::V1p1beta1::ListAssetsResponse.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_findings REST call - # - # @param request_pb [::Google::Cloud::SecurityCenter::V1p1beta1::ListFindingsRequest] - # A request object representing the call parameters. Required. - # @param options [::Gapic::CallOptions] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Cloud::SecurityCenter::V1p1beta1::ListFindingsResponse] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::SecurityCenter::V1p1beta1::ListFindingsResponse] - # A result object deserialized from the server's reply - def list_findings request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_list_findings_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_findings", - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Cloud::SecurityCenter::V1p1beta1::ListFindingsResponse.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_notification_configs REST call - # - # @param request_pb [::Google::Cloud::SecurityCenter::V1p1beta1::ListNotificationConfigsRequest] - # A request object representing the call parameters. Required. - # @param options [::Gapic::CallOptions] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Cloud::SecurityCenter::V1p1beta1::ListNotificationConfigsResponse] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::SecurityCenter::V1p1beta1::ListNotificationConfigsResponse] - # A result object deserialized from the server's reply - def list_notification_configs request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_list_notification_configs_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_notification_configs", - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Cloud::SecurityCenter::V1p1beta1::ListNotificationConfigsResponse.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_sources REST call - # - # @param request_pb [::Google::Cloud::SecurityCenter::V1p1beta1::ListSourcesRequest] - # A request object representing the call parameters. Required. - # @param options [::Gapic::CallOptions] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Cloud::SecurityCenter::V1p1beta1::ListSourcesResponse] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::SecurityCenter::V1p1beta1::ListSourcesResponse] - # A result object deserialized from the server's reply - def list_sources request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_list_sources_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_sources", - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Cloud::SecurityCenter::V1p1beta1::ListSourcesResponse.decode_json response.body, ignore_unknown_fields: true - catch :response do - yield result, operation if block_given? - result - end - end - - ## - # Baseline implementation for the run_asset_discovery REST call - # - # @param request_pb [::Google::Cloud::SecurityCenter::V1p1beta1::RunAssetDiscoveryRequest] - # 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 run_asset_discovery request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_run_asset_discovery_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: "run_asset_discovery", - 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 set_finding_state REST call - # - # @param request_pb [::Google::Cloud::SecurityCenter::V1p1beta1::SetFindingStateRequest] - # A request object representing the call parameters. Required. - # @param options [::Gapic::CallOptions] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Cloud::SecurityCenter::V1p1beta1::Finding] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::SecurityCenter::V1p1beta1::Finding] - # A result object deserialized from the server's reply - def set_finding_state request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_set_finding_state_request request_pb - query_string_params = if query_string_params.any? - query_string_params.to_h { |p| p.split "=", 2 } - else - {} - end - - response = @client_stub.make_http_request( - verb, - uri: uri, - body: body || "", - params: query_string_params, - method_name: "set_finding_state", - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Cloud::SecurityCenter::V1p1beta1::Finding.decode_json response.body, ignore_unknown_fields: true - catch :response do - yield result, operation if block_given? - result - end - end - - ## - # Baseline implementation for the set_iam_policy REST call - # - # @param request_pb [::Google::Iam::V1::SetIamPolicyRequest] - # A request object representing the call parameters. Required. - # @param options [::Gapic::CallOptions] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Iam::V1::Policy] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Iam::V1::Policy] - # A result object deserialized from the server's reply - def set_iam_policy request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_set_iam_policy_request request_pb - query_string_params = if query_string_params.any? - query_string_params.to_h { |p| p.split "=", 2 } - else - {} - end - - response = @client_stub.make_http_request( - verb, - uri: uri, - body: body || "", - params: query_string_params, - method_name: "set_iam_policy", - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Iam::V1::Policy.decode_json response.body, ignore_unknown_fields: true - catch :response do - yield result, operation if block_given? - result - end - end - - ## - # Baseline implementation for the test_iam_permissions REST call - # - # @param request_pb [::Google::Iam::V1::TestIamPermissionsRequest] - # A request object representing the call parameters. Required. - # @param options [::Gapic::CallOptions] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Iam::V1::TestIamPermissionsResponse] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Iam::V1::TestIamPermissionsResponse] - # A result object deserialized from the server's reply - def test_iam_permissions request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_test_iam_permissions_request request_pb - query_string_params = if query_string_params.any? - query_string_params.to_h { |p| p.split "=", 2 } - else - {} - end - - response = @client_stub.make_http_request( - verb, - uri: uri, - body: body || "", - params: query_string_params, - method_name: "test_iam_permissions", - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Iam::V1::TestIamPermissionsResponse.decode_json response.body, ignore_unknown_fields: true - catch :response do - yield result, operation if block_given? - result - end - end - - ## - # Baseline implementation for the update_finding REST call - # - # @param request_pb [::Google::Cloud::SecurityCenter::V1p1beta1::UpdateFindingRequest] - # A request object representing the call parameters. Required. - # @param options [::Gapic::CallOptions] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Cloud::SecurityCenter::V1p1beta1::Finding] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::SecurityCenter::V1p1beta1::Finding] - # A result object deserialized from the server's reply - def update_finding request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_update_finding_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_finding", - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Cloud::SecurityCenter::V1p1beta1::Finding.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_notification_config REST call - # - # @param request_pb [::Google::Cloud::SecurityCenter::V1p1beta1::UpdateNotificationConfigRequest] - # A request object representing the call parameters. Required. - # @param options [::Gapic::CallOptions] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Cloud::SecurityCenter::V1p1beta1::NotificationConfig] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::SecurityCenter::V1p1beta1::NotificationConfig] - # A result object deserialized from the server's reply - def update_notification_config request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_update_notification_config_request request_pb - query_string_params = if query_string_params.any? - query_string_params.to_h { |p| p.split "=", 2 } - else - {} - end - - response = @client_stub.make_http_request( - verb, - uri: uri, - body: body || "", - params: query_string_params, - method_name: "update_notification_config", - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Cloud::SecurityCenter::V1p1beta1::NotificationConfig.decode_json response.body, ignore_unknown_fields: true - catch :response do - yield result, operation if block_given? - result - end - end - - ## - # Baseline implementation for the update_organization_settings REST call - # - # @param request_pb [::Google::Cloud::SecurityCenter::V1p1beta1::UpdateOrganizationSettingsRequest] - # A request object representing the call parameters. Required. - # @param options [::Gapic::CallOptions] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Cloud::SecurityCenter::V1p1beta1::OrganizationSettings] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::SecurityCenter::V1p1beta1::OrganizationSettings] - # A result object deserialized from the server's reply - def update_organization_settings request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_update_organization_settings_request request_pb - query_string_params = if query_string_params.any? - query_string_params.to_h { |p| p.split "=", 2 } - else - {} - end - - response = @client_stub.make_http_request( - verb, - uri: uri, - body: body || "", - params: query_string_params, - method_name: "update_organization_settings", - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Cloud::SecurityCenter::V1p1beta1::OrganizationSettings.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_source REST call - # - # @param request_pb [::Google::Cloud::SecurityCenter::V1p1beta1::UpdateSourceRequest] - # A request object representing the call parameters. Required. - # @param options [::Gapic::CallOptions] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Cloud::SecurityCenter::V1p1beta1::Source] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::SecurityCenter::V1p1beta1::Source] - # A result object deserialized from the server's reply - def update_source request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_update_source_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_source", - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Cloud::SecurityCenter::V1p1beta1::Source.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_security_marks REST call - # - # @param request_pb [::Google::Cloud::SecurityCenter::V1p1beta1::UpdateSecurityMarksRequest] - # A request object representing the call parameters. Required. - # @param options [::Gapic::CallOptions] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Cloud::SecurityCenter::V1p1beta1::SecurityMarks] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::SecurityCenter::V1p1beta1::SecurityMarks] - # A result object deserialized from the server's reply - def update_security_marks request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_update_security_marks_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_security_marks", - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Cloud::SecurityCenter::V1p1beta1::SecurityMarks.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_source REST call - # - # @param request_pb [::Google::Cloud::SecurityCenter::V1p1beta1::CreateSourceRequest] - # 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_source_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :post, - uri_template: "/v1p1beta1/{parent}/sources", - body: "source", - matches: [ - ["parent", %r{^organizations/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the create_finding REST call - # - # @param request_pb [::Google::Cloud::SecurityCenter::V1p1beta1::CreateFindingRequest] - # 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_finding_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :post, - uri_template: "/v1p1beta1/{parent}/findings", - body: "finding", - matches: [ - ["parent", %r{^organizations/[^/]+/sources/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the create_notification_config REST call - # - # @param request_pb [::Google::Cloud::SecurityCenter::V1p1beta1::CreateNotificationConfigRequest] - # 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_notification_config_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :post, - uri_template: "/v1p1beta1/{parent}/notificationConfigs", - body: "notification_config", - matches: [ - ["parent", %r{^organizations/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the delete_notification_config REST call - # - # @param request_pb [::Google::Cloud::SecurityCenter::V1p1beta1::DeleteNotificationConfigRequest] - # 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_notification_config_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :delete, - uri_template: "/v1p1beta1/{name}", - matches: [ - ["name", %r{^organizations/[^/]+/notificationConfigs/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the get_iam_policy REST call - # - # @param request_pb [::Google::Iam::V1::GetIamPolicyRequest] - # A request object representing the call parameters. Required. - # @return [Array(String, [String, nil], Hash{String => String})] - # Uri, Body, Query string parameters - def self.transcode_get_iam_policy_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :post, - uri_template: "/v1p1beta1/{resource}:getIamPolicy", - body: "*", - matches: [ - ["resource", %r{^organizations/[^/]+/sources/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the get_notification_config REST call - # - # @param request_pb [::Google::Cloud::SecurityCenter::V1p1beta1::GetNotificationConfigRequest] - # 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_notification_config_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :get, - uri_template: "/v1p1beta1/{name}", - matches: [ - ["name", %r{^organizations/[^/]+/notificationConfigs/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the get_organization_settings REST call - # - # @param request_pb [::Google::Cloud::SecurityCenter::V1p1beta1::GetOrganizationSettingsRequest] - # A request object representing the call parameters. Required. - # @return [Array(String, [String, nil], Hash{String => String})] - # Uri, Body, Query string parameters - def self.transcode_get_organization_settings_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :get, - uri_template: "/v1p1beta1/{name}", - matches: [ - ["name", %r{^organizations/[^/]+/organizationSettings/?$}, false] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the get_source REST call - # - # @param request_pb [::Google::Cloud::SecurityCenter::V1p1beta1::GetSourceRequest] - # 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_source_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :get, - uri_template: "/v1p1beta1/{name}", - matches: [ - ["name", %r{^organizations/[^/]+/sources/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the group_assets REST call - # - # @param request_pb [::Google::Cloud::SecurityCenter::V1p1beta1::GroupAssetsRequest] - # A request object representing the call parameters. Required. - # @return [Array(String, [String, nil], Hash{String => String})] - # Uri, Body, Query string parameters - def self.transcode_group_assets_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :post, - uri_template: "/v1p1beta1/{parent}/assets:group", - body: "*", - matches: [ - ["parent", %r{^organizations/[^/]+/?$}, false] - ] - ) - .with_bindings( - uri_method: :post, - uri_template: "/v1p1beta1/{parent}/assets:group", - body: "*", - matches: [ - ["parent", %r{^folders/[^/]+/?$}, false] - ] - ) - .with_bindings( - uri_method: :post, - uri_template: "/v1p1beta1/{parent}/assets:group", - body: "*", - matches: [ - ["parent", %r{^projects/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the group_findings REST call - # - # @param request_pb [::Google::Cloud::SecurityCenter::V1p1beta1::GroupFindingsRequest] - # A request object representing the call parameters. Required. - # @return [Array(String, [String, nil], Hash{String => String})] - # Uri, Body, Query string parameters - def self.transcode_group_findings_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :post, - uri_template: "/v1p1beta1/{parent}/findings:group", - body: "*", - matches: [ - ["parent", %r{^organizations/[^/]+/sources/[^/]+/?$}, false] - ] - ) - .with_bindings( - uri_method: :post, - uri_template: "/v1p1beta1/{parent}/findings:group", - body: "*", - matches: [ - ["parent", %r{^folders/[^/]+/sources/[^/]+/?$}, false] - ] - ) - .with_bindings( - uri_method: :post, - uri_template: "/v1p1beta1/{parent}/findings:group", - body: "*", - matches: [ - ["parent", %r{^projects/[^/]+/sources/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the list_assets REST call - # - # @param request_pb [::Google::Cloud::SecurityCenter::V1p1beta1::ListAssetsRequest] - # 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_assets_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :get, - uri_template: "/v1p1beta1/{parent}/assets", - matches: [ - ["parent", %r{^organizations/[^/]+/?$}, false] - ] - ) - .with_bindings( - uri_method: :get, - uri_template: "/v1p1beta1/{parent}/assets", - matches: [ - ["parent", %r{^folders/[^/]+/?$}, false] - ] - ) - .with_bindings( - uri_method: :get, - uri_template: "/v1p1beta1/{parent}/assets", - matches: [ - ["parent", %r{^projects/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the list_findings REST call - # - # @param request_pb [::Google::Cloud::SecurityCenter::V1p1beta1::ListFindingsRequest] - # 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_findings_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :get, - uri_template: "/v1p1beta1/{parent}/findings", - matches: [ - ["parent", %r{^organizations/[^/]+/sources/[^/]+/?$}, false] - ] - ) - .with_bindings( - uri_method: :get, - uri_template: "/v1p1beta1/{parent}/findings", - matches: [ - ["parent", %r{^folders/[^/]+/sources/[^/]+/?$}, false] - ] - ) - .with_bindings( - uri_method: :get, - uri_template: "/v1p1beta1/{parent}/findings", - matches: [ - ["parent", %r{^projects/[^/]+/sources/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the list_notification_configs REST call - # - # @param request_pb [::Google::Cloud::SecurityCenter::V1p1beta1::ListNotificationConfigsRequest] - # 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_notification_configs_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :get, - uri_template: "/v1p1beta1/{parent}/notificationConfigs", - matches: [ - ["parent", %r{^organizations/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the list_sources REST call - # - # @param request_pb [::Google::Cloud::SecurityCenter::V1p1beta1::ListSourcesRequest] - # 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_sources_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :get, - uri_template: "/v1p1beta1/{parent}/sources", - matches: [ - ["parent", %r{^organizations/[^/]+/?$}, false] - ] - ) - .with_bindings( - uri_method: :get, - uri_template: "/v1p1beta1/{parent}/sources", - matches: [ - ["parent", %r{^folders/[^/]+/?$}, false] - ] - ) - .with_bindings( - uri_method: :get, - uri_template: "/v1p1beta1/{parent}/sources", - matches: [ - ["parent", %r{^projects/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the run_asset_discovery REST call - # - # @param request_pb [::Google::Cloud::SecurityCenter::V1p1beta1::RunAssetDiscoveryRequest] - # A request object representing the call parameters. Required. - # @return [Array(String, [String, nil], Hash{String => String})] - # Uri, Body, Query string parameters - def self.transcode_run_asset_discovery_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :post, - uri_template: "/v1p1beta1/{parent}/assets:runDiscovery", - body: "*", - matches: [ - ["parent", %r{^organizations/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the set_finding_state REST call - # - # @param request_pb [::Google::Cloud::SecurityCenter::V1p1beta1::SetFindingStateRequest] - # A request object representing the call parameters. Required. - # @return [Array(String, [String, nil], Hash{String => String})] - # Uri, Body, Query string parameters - def self.transcode_set_finding_state_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :post, - uri_template: "/v1p1beta1/{name}:setState", - body: "*", - matches: [ - ["name", %r{^organizations/[^/]+/sources/[^/]+/findings/[^/]+/?$}, false] - ] - ) - .with_bindings( - uri_method: :post, - uri_template: "/v1p1beta1/{name}:setState", - body: "*", - matches: [ - ["name", %r{^folders/[^/]+/sources/[^/]+/findings/[^/]+/?$}, false] - ] - ) - .with_bindings( - uri_method: :post, - uri_template: "/v1p1beta1/{name}:setState", - body: "*", - matches: [ - ["name", %r{^projects/[^/]+/sources/[^/]+/findings/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the set_iam_policy REST call - # - # @param request_pb [::Google::Iam::V1::SetIamPolicyRequest] - # A request object representing the call parameters. Required. - # @return [Array(String, [String, nil], Hash{String => String})] - # Uri, Body, Query string parameters - def self.transcode_set_iam_policy_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :post, - uri_template: "/v1p1beta1/{resource}:setIamPolicy", - body: "*", - matches: [ - ["resource", %r{^organizations/[^/]+/sources/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the test_iam_permissions REST call - # - # @param request_pb [::Google::Iam::V1::TestIamPermissionsRequest] - # A request object representing the call parameters. Required. - # @return [Array(String, [String, nil], Hash{String => String})] - # Uri, Body, Query string parameters - def self.transcode_test_iam_permissions_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :post, - uri_template: "/v1p1beta1/{resource}:testIamPermissions", - body: "*", - matches: [ - ["resource", %r{^organizations/[^/]+/sources/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the update_finding REST call - # - # @param request_pb [::Google::Cloud::SecurityCenter::V1p1beta1::UpdateFindingRequest] - # 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_finding_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :patch, - uri_template: "/v1p1beta1/{finding.name}", - body: "finding", - matches: [ - ["finding.name", %r{^organizations/[^/]+/sources/[^/]+/findings/[^/]+/?$}, false] - ] - ) - .with_bindings( - uri_method: :patch, - uri_template: "/v1p1beta1/{finding.name}", - body: "finding", - matches: [ - ["finding.name", %r{^folders/[^/]+/sources/[^/]+/findings/[^/]+/?$}, false] - ] - ) - .with_bindings( - uri_method: :patch, - uri_template: "/v1p1beta1/{finding.name}", - body: "finding", - matches: [ - ["finding.name", %r{^projects/[^/]+/sources/[^/]+/findings/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the update_notification_config REST call - # - # @param request_pb [::Google::Cloud::SecurityCenter::V1p1beta1::UpdateNotificationConfigRequest] - # 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_notification_config_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :patch, - uri_template: "/v1p1beta1/{notification_config.name}", - body: "notification_config", - matches: [ - ["notification_config.name", %r{^organizations/[^/]+/notificationConfigs/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the update_organization_settings REST call - # - # @param request_pb [::Google::Cloud::SecurityCenter::V1p1beta1::UpdateOrganizationSettingsRequest] - # A request object representing the call parameters. Required. - # @return [Array(String, [String, nil], Hash{String => String})] - # Uri, Body, Query string parameters - def self.transcode_update_organization_settings_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :patch, - uri_template: "/v1p1beta1/{organization_settings.name}", - body: "organization_settings", - matches: [ - ["organization_settings.name", %r{^organizations/[^/]+/organizationSettings/?$}, false] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the update_source REST call - # - # @param request_pb [::Google::Cloud::SecurityCenter::V1p1beta1::UpdateSourceRequest] - # 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_source_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :patch, - uri_template: "/v1p1beta1/{source.name}", - body: "source", - matches: [ - ["source.name", %r{^organizations/[^/]+/sources/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the update_security_marks REST call - # - # @param request_pb [::Google::Cloud::SecurityCenter::V1p1beta1::UpdateSecurityMarksRequest] - # 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_security_marks_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :patch, - uri_template: "/v1p1beta1/{security_marks.name}", - body: "security_marks", - matches: [ - ["security_marks.name", %r{^organizations/[^/]+/assets/[^/]+/securityMarks/?$}, false] - ] - ) - .with_bindings( - uri_method: :patch, - uri_template: "/v1p1beta1/{security_marks.name}", - body: "security_marks", - matches: [ - ["security_marks.name", %r{^folders/[^/]+/assets/[^/]+/securityMarks/?$}, false] - ] - ) - .with_bindings( - uri_method: :patch, - uri_template: "/v1p1beta1/{security_marks.name}", - body: "security_marks", - matches: [ - ["security_marks.name", %r{^projects/[^/]+/assets/[^/]+/securityMarks/?$}, false] - ] - ) - .with_bindings( - uri_method: :patch, - uri_template: "/v1p1beta1/{security_marks.name}", - body: "security_marks", - matches: [ - ["security_marks.name", %r{^organizations/[^/]+/sources/[^/]+/findings/[^/]+/securityMarks/?$}, false] - ] - ) - .with_bindings( - uri_method: :patch, - uri_template: "/v1p1beta1/{security_marks.name}", - body: "security_marks", - matches: [ - ["security_marks.name", %r{^folders/[^/]+/sources/[^/]+/findings/[^/]+/securityMarks/?$}, false] - ] - ) - .with_bindings( - uri_method: :patch, - uri_template: "/v1p1beta1/{security_marks.name}", - body: "security_marks", - matches: [ - ["security_marks.name", %r{^projects/[^/]+/sources/[^/]+/findings/[^/]+/securityMarks/?$}, false] - ] - ) - transcoder.transcode request_pb - end - end - end - end - end - end - end -end diff --git a/owl-bot-staging/google-cloud-security_center-v1p1beta1/lib/google/cloud/security_center/v1p1beta1/version.rb b/owl-bot-staging/google-cloud-security_center-v1p1beta1/lib/google/cloud/security_center/v1p1beta1/version.rb deleted file mode 100644 index 55106c9006d5..000000000000 --- a/owl-bot-staging/google-cloud-security_center-v1p1beta1/lib/google/cloud/security_center/v1p1beta1/version.rb +++ /dev/null @@ -1,28 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - - -module Google - module Cloud - module SecurityCenter - module V1p1beta1 - VERSION = "0.0.1" - end - end - end -end diff --git a/owl-bot-staging/google-cloud-security_center-v1p1beta1/lib/google/cloud/securitycenter/v1p1beta1/asset_pb.rb b/owl-bot-staging/google-cloud-security_center-v1p1beta1/lib/google/cloud/securitycenter/v1p1beta1/asset_pb.rb deleted file mode 100644 index 9a12931a6f98..000000000000 --- a/owl-bot-staging/google-cloud-security_center-v1p1beta1/lib/google/cloud/securitycenter/v1p1beta1/asset_pb.rb +++ /dev/null @@ -1,29 +0,0 @@ -# frozen_string_literal: true -# Generated by the protocol buffer compiler. DO NOT EDIT! -# source: google/cloud/securitycenter/v1p1beta1/asset.proto - -require 'google/protobuf' - -require 'google/api/resource_pb' -require 'google/cloud/securitycenter/v1p1beta1/folder_pb' -require 'google/cloud/securitycenter/v1p1beta1/security_marks_pb' -require 'google/protobuf/struct_pb' -require 'google/protobuf/timestamp_pb' - - -descriptor_data = "\n1google/cloud/securitycenter/v1p1beta1/asset.proto\x12%google.cloud.securitycenter.v1p1beta1\x1a\x19google/api/resource.proto\x1a\x32google/cloud/securitycenter/v1p1beta1/folder.proto\x1a:google/cloud/securitycenter/v1p1beta1/security_marks.proto\x1a\x1cgoogle/protobuf/struct.proto\x1a\x1fgoogle/protobuf/timestamp.proto\"\xcc\x08\n\x05\x41sset\x12\x0c\n\x04name\x18\x01 \x01(\t\x12i\n\x1asecurity_center_properties\x18\x02 \x01(\x0b\x32\x45.google.cloud.securitycenter.v1p1beta1.Asset.SecurityCenterProperties\x12\x61\n\x13resource_properties\x18\x07 \x03(\x0b\x32\x44.google.cloud.securitycenter.v1p1beta1.Asset.ResourcePropertiesEntry\x12L\n\x0esecurity_marks\x18\x08 \x01(\x0b\x32\x34.google.cloud.securitycenter.v1p1beta1.SecurityMarks\x12/\n\x0b\x63reate_time\x18\t \x01(\x0b\x32\x1a.google.protobuf.Timestamp\x12/\n\x0bupdate_time\x18\n \x01(\x0b\x32\x1a.google.protobuf.Timestamp\x12J\n\niam_policy\x18\x0b \x01(\x0b\x32\x36.google.cloud.securitycenter.v1p1beta1.Asset.IamPolicy\x12\x16\n\x0e\x63\x61nonical_name\x18\r \x01(\t\x1a\xc0\x02\n\x18SecurityCenterProperties\x12\x15\n\rresource_name\x18\x01 \x01(\t\x12\x15\n\rresource_type\x18\x02 \x01(\t\x12\x17\n\x0fresource_parent\x18\x03 \x01(\t\x12\x18\n\x10resource_project\x18\x04 \x01(\t\x12\x17\n\x0fresource_owners\x18\x05 \x03(\t\x12\x1d\n\x15resource_display_name\x18\x06 \x01(\t\x12$\n\x1cresource_parent_display_name\x18\x07 \x01(\t\x12%\n\x1dresource_project_display_name\x18\x08 \x01(\t\x12>\n\x07\x66olders\x18\n \x03(\x0b\x32-.google.cloud.securitycenter.v1p1beta1.Folder\x1a \n\tIamPolicy\x12\x13\n\x0bpolicy_blob\x18\x01 \x01(\t\x1aQ\n\x17ResourcePropertiesEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12%\n\x05value\x18\x02 \x01(\x0b\x32\x16.google.protobuf.Value:\x02\x38\x01:\x9a\x01\xea\x41\x96\x01\n#securitycenter.googleapis.com/Asset\x12+organizations/{organization}/assets/{asset}\x12\x1f\x66olders/{folder}/assets/{asset}\x12!projects/{project}/assets/{asset}B\xfb\x01\n)com.google.cloud.securitycenter.v1p1beta1P\x01ZQcloud.google.com/go/securitycenter/apiv1p1beta1/securitycenterpb;securitycenterpb\xaa\x02%Google.Cloud.SecurityCenter.V1P1Beta1\xca\x02%Google\\Cloud\\SecurityCenter\\V1p1beta1\xea\x02(Google::Cloud::SecurityCenter::V1p1beta1b\x06proto3" - -pool = ::Google::Protobuf::DescriptorPool.generated_pool -pool.add_serialized_file(descriptor_data) - -module Google - module Cloud - module SecurityCenter - module V1p1beta1 - Asset = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.securitycenter.v1p1beta1.Asset").msgclass - Asset::SecurityCenterProperties = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.securitycenter.v1p1beta1.Asset.SecurityCenterProperties").msgclass - Asset::IamPolicy = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.securitycenter.v1p1beta1.Asset.IamPolicy").msgclass - end - end - end -end diff --git a/owl-bot-staging/google-cloud-security_center-v1p1beta1/lib/google/cloud/securitycenter/v1p1beta1/finding_pb.rb b/owl-bot-staging/google-cloud-security_center-v1p1beta1/lib/google/cloud/securitycenter/v1p1beta1/finding_pb.rb deleted file mode 100644 index 050e7b68bfff..000000000000 --- a/owl-bot-staging/google-cloud-security_center-v1p1beta1/lib/google/cloud/securitycenter/v1p1beta1/finding_pb.rb +++ /dev/null @@ -1,29 +0,0 @@ -# frozen_string_literal: true -# Generated by the protocol buffer compiler. DO NOT EDIT! -# source: google/cloud/securitycenter/v1p1beta1/finding.proto - -require 'google/protobuf' - -require 'google/api/field_behavior_pb' -require 'google/api/resource_pb' -require 'google/cloud/securitycenter/v1p1beta1/security_marks_pb' -require 'google/protobuf/struct_pb' -require 'google/protobuf/timestamp_pb' - - -descriptor_data = "\n3google/cloud/securitycenter/v1p1beta1/finding.proto\x12%google.cloud.securitycenter.v1p1beta1\x1a\x1fgoogle/api/field_behavior.proto\x1a\x19google/api/resource.proto\x1a:google/cloud/securitycenter/v1p1beta1/security_marks.proto\x1a\x1cgoogle/protobuf/struct.proto\x1a\x1fgoogle/protobuf/timestamp.proto\"\xdf\x07\n\x07\x46inding\x12\x0c\n\x04name\x18\x01 \x01(\t\x12\x0e\n\x06parent\x18\x02 \x01(\t\x12\x15\n\rresource_name\x18\x03 \x01(\t\x12\x43\n\x05state\x18\x04 \x01(\x0e\x32\x34.google.cloud.securitycenter.v1p1beta1.Finding.State\x12\x10\n\x08\x63\x61tegory\x18\x05 \x01(\t\x12\x14\n\x0c\x65xternal_uri\x18\x06 \x01(\t\x12_\n\x11source_properties\x18\x07 \x03(\x0b\x32\x44.google.cloud.securitycenter.v1p1beta1.Finding.SourcePropertiesEntry\x12Q\n\x0esecurity_marks\x18\x08 \x01(\x0b\x32\x34.google.cloud.securitycenter.v1p1beta1.SecurityMarksB\x03\xe0\x41\x03\x12.\n\nevent_time\x18\t \x01(\x0b\x32\x1a.google.protobuf.Timestamp\x12/\n\x0b\x63reate_time\x18\n \x01(\x0b\x32\x1a.google.protobuf.Timestamp\x12I\n\x08severity\x18\r \x01(\x0e\x32\x37.google.cloud.securitycenter.v1p1beta1.Finding.Severity\x12\x16\n\x0e\x63\x61nonical_name\x18\x0e \x01(\t\x1aO\n\x15SourcePropertiesEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12%\n\x05value\x18\x02 \x01(\x0b\x32\x16.google.protobuf.Value:\x02\x38\x01\"8\n\x05State\x12\x15\n\x11STATE_UNSPECIFIED\x10\x00\x12\n\n\x06\x41\x43TIVE\x10\x01\x12\x0c\n\x08INACTIVE\x10\x02\"Q\n\x08Severity\x12\x18\n\x14SEVERITY_UNSPECIFIED\x10\x00\x12\x0c\n\x08\x43RITICAL\x10\x01\x12\x08\n\x04HIGH\x10\x02\x12\n\n\x06MEDIUM\x10\x03\x12\x07\n\x03LOW\x10\x04:\xdb\x01\xea\x41\xd7\x01\n%securitycenter.googleapis.com/Finding\x12@organizations/{organization}/sources/{source}/findings/{finding}\x12\x34\x66olders/{folder}/sources/{source}/findings/{finding}\x12\x36projects/{project}/sources/{source}/findings/{finding}B\xfb\x01\n)com.google.cloud.securitycenter.v1p1beta1P\x01ZQcloud.google.com/go/securitycenter/apiv1p1beta1/securitycenterpb;securitycenterpb\xaa\x02%Google.Cloud.SecurityCenter.V1P1Beta1\xca\x02%Google\\Cloud\\SecurityCenter\\V1p1beta1\xea\x02(Google::Cloud::SecurityCenter::V1p1beta1b\x06proto3" - -pool = ::Google::Protobuf::DescriptorPool.generated_pool -pool.add_serialized_file(descriptor_data) - -module Google - module Cloud - module SecurityCenter - module V1p1beta1 - Finding = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.securitycenter.v1p1beta1.Finding").msgclass - Finding::State = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.securitycenter.v1p1beta1.Finding.State").enummodule - Finding::Severity = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.securitycenter.v1p1beta1.Finding.Severity").enummodule - end - end - end -end diff --git a/owl-bot-staging/google-cloud-security_center-v1p1beta1/lib/google/cloud/securitycenter/v1p1beta1/folder_pb.rb b/owl-bot-staging/google-cloud-security_center-v1p1beta1/lib/google/cloud/securitycenter/v1p1beta1/folder_pb.rb deleted file mode 100644 index 2a78935f850c..000000000000 --- a/owl-bot-staging/google-cloud-security_center-v1p1beta1/lib/google/cloud/securitycenter/v1p1beta1/folder_pb.rb +++ /dev/null @@ -1,21 +0,0 @@ -# frozen_string_literal: true -# Generated by the protocol buffer compiler. DO NOT EDIT! -# source: google/cloud/securitycenter/v1p1beta1/folder.proto - -require 'google/protobuf' - - -descriptor_data = "\n2google/cloud/securitycenter/v1p1beta1/folder.proto\x12%google.cloud.securitycenter.v1p1beta1\"G\n\x06\x46older\x12\x17\n\x0fresource_folder\x18\x01 \x01(\t\x12$\n\x1cresource_folder_display_name\x18\x02 \x01(\tB\x88\x02\n)com.google.cloud.securitycenter.v1p1beta1B\x0b\x46olderProtoP\x01ZQcloud.google.com/go/securitycenter/apiv1p1beta1/securitycenterpb;securitycenterpb\xaa\x02%Google.Cloud.SecurityCenter.V1P1Beta1\xca\x02%Google\\Cloud\\SecurityCenter\\V1p1beta1\xea\x02(Google::Cloud::SecurityCenter::V1p1Beta1b\x06proto3" - -pool = ::Google::Protobuf::DescriptorPool.generated_pool -pool.add_serialized_file(descriptor_data) - -module Google - module Cloud - module SecurityCenter - module V1p1Beta1 - Folder = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.securitycenter.v1p1beta1.Folder").msgclass - end - end - end -end diff --git a/owl-bot-staging/google-cloud-security_center-v1p1beta1/lib/google/cloud/securitycenter/v1p1beta1/notification_config_pb.rb b/owl-bot-staging/google-cloud-security_center-v1p1beta1/lib/google/cloud/securitycenter/v1p1beta1/notification_config_pb.rb deleted file mode 100644 index f08fde86beee..000000000000 --- a/owl-bot-staging/google-cloud-security_center-v1p1beta1/lib/google/cloud/securitycenter/v1p1beta1/notification_config_pb.rb +++ /dev/null @@ -1,26 +0,0 @@ -# frozen_string_literal: true -# Generated by the protocol buffer compiler. DO NOT EDIT! -# source: google/cloud/securitycenter/v1p1beta1/notification_config.proto - -require 'google/protobuf' - -require 'google/api/field_behavior_pb' -require 'google/api/resource_pb' - - -descriptor_data = "\n?google/cloud/securitycenter/v1p1beta1/notification_config.proto\x12%google.cloud.securitycenter.v1p1beta1\x1a\x1fgoogle/api/field_behavior.proto\x1a\x19google/api/resource.proto\"\xb6\x04\n\x12NotificationConfig\x12\x0c\n\x04name\x18\x01 \x01(\t\x12\x13\n\x0b\x64\x65scription\x18\x02 \x01(\t\x12W\n\nevent_type\x18\x03 \x01(\x0e\x32\x43.google.cloud.securitycenter.v1p1beta1.NotificationConfig.EventType\x12\x36\n\x0cpubsub_topic\x18\x04 \x01(\tB \xfa\x41\x1d\n\x1bpubsub.googleapis.com/Topic\x12\x1c\n\x0fservice_account\x18\x05 \x01(\tB\x03\xe0\x41\x03\x12\x65\n\x10streaming_config\x18\x06 \x01(\x0b\x32I.google.cloud.securitycenter.v1p1beta1.NotificationConfig.StreamingConfigH\x00\x1a!\n\x0fStreamingConfig\x12\x0e\n\x06\x66ilter\x18\x01 \x01(\t\"4\n\tEventType\x12\x1a\n\x16\x45VENT_TYPE_UNSPECIFIED\x10\x00\x12\x0b\n\x07\x46INDING\x10\x01:}\xea\x41z\n0securitycenter.googleapis.com/NotificationConfig\x12\x46organizations/{organization}/notificationConfigs/{notification_config}B\x0f\n\rnotify_configB\xbe\x02\n)com.google.cloud.securitycenter.v1p1beta1P\x01ZQcloud.google.com/go/securitycenter/apiv1p1beta1/securitycenterpb;securitycenterpb\xaa\x02%Google.Cloud.SecurityCenter.V1P1Beta1\xca\x02%Google\\Cloud\\SecurityCenter\\V1p1beta1\xea\x02(Google::Cloud::SecurityCenter::V1p1beta1\xea\x41@\n\x1bpubsub.googleapis.com/Topic\x12!projects/{project}/topics/{topic}b\x06proto3" - -pool = ::Google::Protobuf::DescriptorPool.generated_pool -pool.add_serialized_file(descriptor_data) - -module Google - module Cloud - module SecurityCenter - module V1p1beta1 - NotificationConfig = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.securitycenter.v1p1beta1.NotificationConfig").msgclass - NotificationConfig::StreamingConfig = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.securitycenter.v1p1beta1.NotificationConfig.StreamingConfig").msgclass - NotificationConfig::EventType = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.securitycenter.v1p1beta1.NotificationConfig.EventType").enummodule - end - end - end -end diff --git a/owl-bot-staging/google-cloud-security_center-v1p1beta1/lib/google/cloud/securitycenter/v1p1beta1/notification_message_pb.rb b/owl-bot-staging/google-cloud-security_center-v1p1beta1/lib/google/cloud/securitycenter/v1p1beta1/notification_message_pb.rb deleted file mode 100644 index c696cbc0af35..000000000000 --- a/owl-bot-staging/google-cloud-security_center-v1p1beta1/lib/google/cloud/securitycenter/v1p1beta1/notification_message_pb.rb +++ /dev/null @@ -1,24 +0,0 @@ -# frozen_string_literal: true -# Generated by the protocol buffer compiler. DO NOT EDIT! -# source: google/cloud/securitycenter/v1p1beta1/notification_message.proto - -require 'google/protobuf' - -require 'google/cloud/securitycenter/v1p1beta1/finding_pb' -require 'google/cloud/securitycenter/v1p1beta1/resource_pb' - - -descriptor_data = "\n@google/cloud/securitycenter/v1p1beta1/notification_message.proto\x12%google.cloud.securitycenter.v1p1beta1\x1a\x33google/cloud/securitycenter/v1p1beta1/finding.proto\x1a\x34google/cloud/securitycenter/v1p1beta1/resource.proto\"\xc6\x01\n\x13NotificationMessage\x12 \n\x18notification_config_name\x18\x01 \x01(\t\x12\x41\n\x07\x66inding\x18\x02 \x01(\x0b\x32..google.cloud.securitycenter.v1p1beta1.FindingH\x00\x12\x41\n\x08resource\x18\x03 \x01(\x0b\x32/.google.cloud.securitycenter.v1p1beta1.ResourceB\x07\n\x05\x65ventB\xfb\x01\n)com.google.cloud.securitycenter.v1p1beta1P\x01ZQcloud.google.com/go/securitycenter/apiv1p1beta1/securitycenterpb;securitycenterpb\xaa\x02%Google.Cloud.SecurityCenter.V1P1Beta1\xca\x02%Google\\Cloud\\SecurityCenter\\V1p1beta1\xea\x02(Google::Cloud::SecurityCenter::V1p1beta1b\x06proto3" - -pool = ::Google::Protobuf::DescriptorPool.generated_pool -pool.add_serialized_file(descriptor_data) - -module Google - module Cloud - module SecurityCenter - module V1p1beta1 - NotificationMessage = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.securitycenter.v1p1beta1.NotificationMessage").msgclass - end - end - end -end diff --git a/owl-bot-staging/google-cloud-security_center-v1p1beta1/lib/google/cloud/securitycenter/v1p1beta1/organization_settings_pb.rb b/owl-bot-staging/google-cloud-security_center-v1p1beta1/lib/google/cloud/securitycenter/v1p1beta1/organization_settings_pb.rb deleted file mode 100644 index d97b8888bc15..000000000000 --- a/owl-bot-staging/google-cloud-security_center-v1p1beta1/lib/google/cloud/securitycenter/v1p1beta1/organization_settings_pb.rb +++ /dev/null @@ -1,25 +0,0 @@ -# frozen_string_literal: true -# Generated by the protocol buffer compiler. DO NOT EDIT! -# source: google/cloud/securitycenter/v1p1beta1/organization_settings.proto - -require 'google/protobuf' - -require 'google/api/resource_pb' - - -descriptor_data = "\nAgoogle/cloud/securitycenter/v1p1beta1/organization_settings.proto\x12%google.cloud.securitycenter.v1p1beta1\x1a\x19google/api/resource.proto\"\xac\x04\n\x14OrganizationSettings\x12\x0c\n\x04name\x18\x01 \x01(\t\x12\x1e\n\x16\x65nable_asset_discovery\x18\x02 \x01(\x08\x12p\n\x16\x61sset_discovery_config\x18\x03 \x01(\x0b\x32P.google.cloud.securitycenter.v1p1beta1.OrganizationSettings.AssetDiscoveryConfig\x1a\x87\x02\n\x14\x41ssetDiscoveryConfig\x12\x13\n\x0bproject_ids\x18\x01 \x03(\t\x12v\n\x0einclusion_mode\x18\x02 \x01(\x0e\x32^.google.cloud.securitycenter.v1p1beta1.OrganizationSettings.AssetDiscoveryConfig.InclusionMode\x12\x12\n\nfolder_ids\x18\x03 \x03(\t\"N\n\rInclusionMode\x12\x1e\n\x1aINCLUSION_MODE_UNSPECIFIED\x10\x00\x12\x10\n\x0cINCLUDE_ONLY\x10\x01\x12\x0b\n\x07\x45XCLUDE\x10\x02:j\xea\x41g\n2securitycenter.googleapis.com/OrganizationSettings\x12\x31organizations/{organization}/organizationSettingsB\xfb\x01\n)com.google.cloud.securitycenter.v1p1beta1P\x01ZQcloud.google.com/go/securitycenter/apiv1p1beta1/securitycenterpb;securitycenterpb\xaa\x02%Google.Cloud.SecurityCenter.V1P1Beta1\xca\x02%Google\\Cloud\\SecurityCenter\\V1p1beta1\xea\x02(Google::Cloud::SecurityCenter::V1p1beta1b\x06proto3" - -pool = ::Google::Protobuf::DescriptorPool.generated_pool -pool.add_serialized_file(descriptor_data) - -module Google - module Cloud - module SecurityCenter - module V1p1beta1 - OrganizationSettings = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.securitycenter.v1p1beta1.OrganizationSettings").msgclass - OrganizationSettings::AssetDiscoveryConfig = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.securitycenter.v1p1beta1.OrganizationSettings.AssetDiscoveryConfig").msgclass - OrganizationSettings::AssetDiscoveryConfig::InclusionMode = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.securitycenter.v1p1beta1.OrganizationSettings.AssetDiscoveryConfig.InclusionMode").enummodule - end - end - end -end diff --git a/owl-bot-staging/google-cloud-security_center-v1p1beta1/lib/google/cloud/securitycenter/v1p1beta1/resource_pb.rb b/owl-bot-staging/google-cloud-security_center-v1p1beta1/lib/google/cloud/securitycenter/v1p1beta1/resource_pb.rb deleted file mode 100644 index 74eac8cc1a2c..000000000000 --- a/owl-bot-staging/google-cloud-security_center-v1p1beta1/lib/google/cloud/securitycenter/v1p1beta1/resource_pb.rb +++ /dev/null @@ -1,24 +0,0 @@ -# frozen_string_literal: true -# Generated by the protocol buffer compiler. DO NOT EDIT! -# source: google/cloud/securitycenter/v1p1beta1/resource.proto - -require 'google/protobuf' - -require 'google/api/field_behavior_pb' -require 'google/cloud/securitycenter/v1p1beta1/folder_pb' - - -descriptor_data = "\n4google/cloud/securitycenter/v1p1beta1/resource.proto\x12%google.cloud.securitycenter.v1p1beta1\x1a\x1fgoogle/api/field_behavior.proto\x1a\x32google/cloud/securitycenter/v1p1beta1/folder.proto\"\xb9\x01\n\x08Resource\x12\x0c\n\x04name\x18\x01 \x01(\t\x12\x0f\n\x07project\x18\x02 \x01(\t\x12\x1c\n\x14project_display_name\x18\x03 \x01(\t\x12\x0e\n\x06parent\x18\x04 \x01(\t\x12\x1b\n\x13parent_display_name\x18\x05 \x01(\t\x12\x43\n\x07\x66olders\x18\x07 \x03(\x0b\x32-.google.cloud.securitycenter.v1p1beta1.FolderB\x03\xe0\x41\x03\x42\x8a\x02\n)com.google.cloud.securitycenter.v1p1beta1B\rResourceProtoP\x01ZQcloud.google.com/go/securitycenter/apiv1p1beta1/securitycenterpb;securitycenterpb\xaa\x02%Google.Cloud.SecurityCenter.V1P1Beta1\xca\x02%Google\\Cloud\\SecurityCenter\\V1p1beta1\xea\x02(Google::Cloud::SecurityCenter::V1p1beta1b\x06proto3" - -pool = ::Google::Protobuf::DescriptorPool.generated_pool -pool.add_serialized_file(descriptor_data) - -module Google - module Cloud - module SecurityCenter - module V1p1beta1 - Resource = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.securitycenter.v1p1beta1.Resource").msgclass - end - end - end -end diff --git a/owl-bot-staging/google-cloud-security_center-v1p1beta1/lib/google/cloud/securitycenter/v1p1beta1/run_asset_discovery_response_pb.rb b/owl-bot-staging/google-cloud-security_center-v1p1beta1/lib/google/cloud/securitycenter/v1p1beta1/run_asset_discovery_response_pb.rb deleted file mode 100644 index b8264e7a8867..000000000000 --- a/owl-bot-staging/google-cloud-security_center-v1p1beta1/lib/google/cloud/securitycenter/v1p1beta1/run_asset_discovery_response_pb.rb +++ /dev/null @@ -1,24 +0,0 @@ -# frozen_string_literal: true -# Generated by the protocol buffer compiler. DO NOT EDIT! -# source: google/cloud/securitycenter/v1p1beta1/run_asset_discovery_response.proto - -require 'google/protobuf' - -require 'google/protobuf/duration_pb' - - -descriptor_data = "\nHgoogle/cloud/securitycenter/v1p1beta1/run_asset_discovery_response.proto\x12%google.cloud.securitycenter.v1p1beta1\x1a\x1egoogle/protobuf/duration.proto\"\xee\x01\n\x19RunAssetDiscoveryResponse\x12U\n\x05state\x18\x01 \x01(\x0e\x32\x46.google.cloud.securitycenter.v1p1beta1.RunAssetDiscoveryResponse.State\x12+\n\x08\x64uration\x18\x02 \x01(\x0b\x32\x19.google.protobuf.Duration\"M\n\x05State\x12\x15\n\x11STATE_UNSPECIFIED\x10\x00\x12\r\n\tCOMPLETED\x10\x01\x12\x0e\n\nSUPERSEDED\x10\x02\x12\x0e\n\nTERMINATED\x10\x03\x42\xfb\x01\n)com.google.cloud.securitycenter.v1p1beta1P\x01ZQcloud.google.com/go/securitycenter/apiv1p1beta1/securitycenterpb;securitycenterpb\xaa\x02%Google.Cloud.SecurityCenter.V1P1Beta1\xca\x02%Google\\Cloud\\SecurityCenter\\V1p1beta1\xea\x02(Google::Cloud::SecurityCenter::V1p1beta1b\x06proto3" - -pool = ::Google::Protobuf::DescriptorPool.generated_pool -pool.add_serialized_file(descriptor_data) - -module Google - module Cloud - module SecurityCenter - module V1p1beta1 - RunAssetDiscoveryResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.securitycenter.v1p1beta1.RunAssetDiscoveryResponse").msgclass - RunAssetDiscoveryResponse::State = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.securitycenter.v1p1beta1.RunAssetDiscoveryResponse.State").enummodule - end - end - end -end diff --git a/owl-bot-staging/google-cloud-security_center-v1p1beta1/lib/google/cloud/securitycenter/v1p1beta1/security_marks_pb.rb b/owl-bot-staging/google-cloud-security_center-v1p1beta1/lib/google/cloud/securitycenter/v1p1beta1/security_marks_pb.rb deleted file mode 100644 index e31759178cca..000000000000 --- a/owl-bot-staging/google-cloud-security_center-v1p1beta1/lib/google/cloud/securitycenter/v1p1beta1/security_marks_pb.rb +++ /dev/null @@ -1,23 +0,0 @@ -# frozen_string_literal: true -# Generated by the protocol buffer compiler. DO NOT EDIT! -# source: google/cloud/securitycenter/v1p1beta1/security_marks.proto - -require 'google/protobuf' - -require 'google/api/resource_pb' - - -descriptor_data = "\n:google/cloud/securitycenter/v1p1beta1/security_marks.proto\x12%google.cloud.securitycenter.v1p1beta1\x1a\x19google/api/resource.proto\"\xdc\x04\n\rSecurityMarks\x12\x0c\n\x04name\x18\x01 \x01(\t\x12N\n\x05marks\x18\x02 \x03(\x0b\x32?.google.cloud.securitycenter.v1p1beta1.SecurityMarks.MarksEntry\x12\x16\n\x0e\x63\x61nonical_name\x18\x03 \x01(\t\x1a,\n\nMarksEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12\r\n\x05value\x18\x02 \x01(\t:\x02\x38\x01:\xa6\x03\xea\x41\xa2\x03\n+securitycenter.googleapis.com/SecurityMarks\x12\x39organizations/{organization}/assets/{asset}/securityMarks\x12Norganizations/{organization}/sources/{source}/findings/{finding}/securityMarks\x12-folders/{folder}/assets/{asset}/securityMarks\x12/projects/{project}/assets/{asset}/securityMarks\x12\x42\x66olders/{folder}/sources/{source}/findings/{finding}/securityMarks\x12\x44projects/{project}/sources/{source}/findings/{finding}/securityMarksB\xfb\x01\n)com.google.cloud.securitycenter.v1p1beta1P\x01ZQcloud.google.com/go/securitycenter/apiv1p1beta1/securitycenterpb;securitycenterpb\xaa\x02%Google.Cloud.SecurityCenter.V1P1Beta1\xca\x02%Google\\Cloud\\SecurityCenter\\V1p1beta1\xea\x02(Google::Cloud::SecurityCenter::V1p1beta1b\x06proto3" - -pool = ::Google::Protobuf::DescriptorPool.generated_pool -pool.add_serialized_file(descriptor_data) - -module Google - module Cloud - module SecurityCenter - module V1p1beta1 - SecurityMarks = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.securitycenter.v1p1beta1.SecurityMarks").msgclass - end - end - end -end diff --git a/owl-bot-staging/google-cloud-security_center-v1p1beta1/lib/google/cloud/securitycenter/v1p1beta1/securitycenter_service_pb.rb b/owl-bot-staging/google-cloud-security_center-v1p1beta1/lib/google/cloud/securitycenter/v1p1beta1/securitycenter_service_pb.rb deleted file mode 100644 index fb06f85622aa..000000000000 --- a/owl-bot-staging/google-cloud-security_center-v1p1beta1/lib/google/cloud/securitycenter/v1p1beta1/securitycenter_service_pb.rb +++ /dev/null @@ -1,74 +0,0 @@ -# frozen_string_literal: true -# Generated by the protocol buffer compiler. DO NOT EDIT! -# source: google/cloud/securitycenter/v1p1beta1/securitycenter_service.proto - -require 'google/protobuf' - -require 'google/cloud/securitycenter/v1p1beta1/notification_message_pb' -require 'google/cloud/securitycenter/v1p1beta1/run_asset_discovery_response_pb' -require 'google/api/annotations_pb' -require 'google/api/client_pb' -require 'google/api/field_behavior_pb' -require 'google/api/resource_pb' -require 'google/cloud/securitycenter/v1p1beta1/asset_pb' -require 'google/cloud/securitycenter/v1p1beta1/finding_pb' -require 'google/cloud/securitycenter/v1p1beta1/folder_pb' -require 'google/cloud/securitycenter/v1p1beta1/notification_config_pb' -require 'google/cloud/securitycenter/v1p1beta1/organization_settings_pb' -require 'google/cloud/securitycenter/v1p1beta1/security_marks_pb' -require 'google/cloud/securitycenter/v1p1beta1/source_pb' -require 'google/iam/v1/iam_policy_pb' -require 'google/iam/v1/policy_pb' -require 'google/longrunning/operations_pb' -require 'google/protobuf/duration_pb' -require 'google/protobuf/empty_pb' -require 'google/protobuf/field_mask_pb' -require 'google/protobuf/struct_pb' -require 'google/protobuf/timestamp_pb' - - -descriptor_data = "\nBgoogle/cloud/securitycenter/v1p1beta1/securitycenter_service.proto\x12%google.cloud.securitycenter.v1p1beta1\x1a@google/cloud/securitycenter/v1p1beta1/notification_message.proto\x1aHgoogle/cloud/securitycenter/v1p1beta1/run_asset_discovery_response.proto\x1a\x1cgoogle/api/annotations.proto\x1a\x17google/api/client.proto\x1a\x1fgoogle/api/field_behavior.proto\x1a\x19google/api/resource.proto\x1a\x31google/cloud/securitycenter/v1p1beta1/asset.proto\x1a\x33google/cloud/securitycenter/v1p1beta1/finding.proto\x1a\x32google/cloud/securitycenter/v1p1beta1/folder.proto\x1a?google/cloud/securitycenter/v1p1beta1/notification_config.proto\x1a\x41google/cloud/securitycenter/v1p1beta1/organization_settings.proto\x1a:google/cloud/securitycenter/v1p1beta1/security_marks.proto\x1a\x32google/cloud/securitycenter/v1p1beta1/source.proto\x1a\x1egoogle/iam/v1/iam_policy.proto\x1a\x1agoogle/iam/v1/policy.proto\x1a#google/longrunning/operations.proto\x1a\x1egoogle/protobuf/duration.proto\x1a\x1bgoogle/protobuf/empty.proto\x1a google/protobuf/field_mask.proto\x1a\x1cgoogle/protobuf/struct.proto\x1a\x1fgoogle/protobuf/timestamp.proto\"\xb3\x01\n\x14\x43reateFindingRequest\x12<\n\x06parent\x18\x01 \x01(\tB,\xe0\x41\x02\xfa\x41&\n$securitycenter.googleapis.com/Source\x12\x17\n\nfinding_id\x18\x02 \x01(\tB\x03\xe0\x41\x02\x12\x44\n\x07\x66inding\x18\x03 \x01(\x0b\x32..google.cloud.securitycenter.v1p1beta1.FindingB\x03\xe0\x41\x02\"\xe0\x01\n\x1f\x43reateNotificationConfigRequest\x12H\n\x06parent\x18\x01 \x01(\tB8\xe0\x41\x02\xfa\x41\x32\n0cloudresourcemanager.googleapis.com/Organization\x12\x16\n\tconfig_id\x18\x02 \x01(\tB\x03\xe0\x41\x02\x12[\n\x13notification_config\x18\x03 \x01(\x0b\x32\x39.google.cloud.securitycenter.v1p1beta1.NotificationConfigB\x03\xe0\x41\x02\"\xa3\x01\n\x13\x43reateSourceRequest\x12H\n\x06parent\x18\x01 \x01(\tB8\xe0\x41\x02\xfa\x41\x32\n0cloudresourcemanager.googleapis.com/Organization\x12\x42\n\x06source\x18\x02 \x01(\x0b\x32-.google.cloud.securitycenter.v1p1beta1.SourceB\x03\xe0\x41\x02\"i\n\x1f\x44\x65leteNotificationConfigRequest\x12\x46\n\x04name\x18\x01 \x01(\tB8\xe0\x41\x02\xfa\x41\x32\n0securitycenter.googleapis.com/NotificationConfig\"f\n\x1cGetNotificationConfigRequest\x12\x46\n\x04name\x18\x01 \x01(\tB8\xe0\x41\x02\xfa\x41\x32\n0securitycenter.googleapis.com/NotificationConfig\"j\n\x1eGetOrganizationSettingsRequest\x12H\n\x04name\x18\x01 \x01(\tB:\xe0\x41\x02\xfa\x41\x34\n2securitycenter.googleapis.com/OrganizationSettings\"N\n\x10GetSourceRequest\x12:\n\x04name\x18\x01 \x01(\tB,\xe0\x41\x02\xfa\x41&\n$securitycenter.googleapis.com/Source\"\x83\x02\n\x12GroupAssetsRequest\x12;\n\x06parent\x18\x01 \x01(\tB+\xe0\x41\x02\xfa\x41%\x12#securitycenter.googleapis.com/Asset\x12\x0e\n\x06\x66ilter\x18\x02 \x01(\t\x12\x15\n\x08group_by\x18\x03 \x01(\tB\x03\xe0\x41\x02\x12\x33\n\x10\x63ompare_duration\x18\x04 \x01(\x0b\x32\x19.google.protobuf.Duration\x12-\n\tread_time\x18\x05 \x01(\x0b\x32\x1a.google.protobuf.Timestamp\x12\x12\n\npage_token\x18\x07 \x01(\t\x12\x11\n\tpage_size\x18\x08 \x01(\x05\"\xbf\x01\n\x13GroupAssetsResponse\x12L\n\x10group_by_results\x18\x01 \x03(\x0b\x32\x32.google.cloud.securitycenter.v1p1beta1.GroupResult\x12-\n\tread_time\x18\x02 \x01(\x0b\x32\x1a.google.protobuf.Timestamp\x12\x17\n\x0fnext_page_token\x18\x03 \x01(\t\x12\x12\n\ntotal_size\x18\x04 \x01(\x05\"\x86\x02\n\x14GroupFindingsRequest\x12<\n\x06parent\x18\x01 \x01(\tB,\xe0\x41\x02\xfa\x41&\n$securitycenter.googleapis.com/Source\x12\x0e\n\x06\x66ilter\x18\x02 \x01(\t\x12\x15\n\x08group_by\x18\x03 \x01(\tB\x03\xe0\x41\x02\x12-\n\tread_time\x18\x04 \x01(\x0b\x32\x1a.google.protobuf.Timestamp\x12\x33\n\x10\x63ompare_duration\x18\x05 \x01(\x0b\x32\x19.google.protobuf.Duration\x12\x12\n\npage_token\x18\x07 \x01(\t\x12\x11\n\tpage_size\x18\x08 \x01(\x05\"\xc1\x01\n\x15GroupFindingsResponse\x12L\n\x10group_by_results\x18\x01 \x03(\x0b\x32\x32.google.cloud.securitycenter.v1p1beta1.GroupResult\x12-\n\tread_time\x18\x02 \x01(\x0b\x32\x1a.google.protobuf.Timestamp\x12\x17\n\x0fnext_page_token\x18\x03 \x01(\t\x12\x12\n\ntotal_size\x18\x04 \x01(\x05\"\xbf\x01\n\x0bGroupResult\x12V\n\nproperties\x18\x01 \x03(\x0b\x32\x42.google.cloud.securitycenter.v1p1beta1.GroupResult.PropertiesEntry\x12\r\n\x05\x63ount\x18\x02 \x01(\x03\x1aI\n\x0fPropertiesEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12%\n\x05value\x18\x02 \x01(\x0b\x32\x16.google.protobuf.Value:\x02\x38\x01\"\x91\x01\n\x1eListNotificationConfigsRequest\x12H\n\x06parent\x18\x01 \x01(\tB8\xe0\x41\x02\xfa\x41\x32\n0cloudresourcemanager.googleapis.com/Organization\x12\x12\n\npage_token\x18\x02 \x01(\t\x12\x11\n\tpage_size\x18\x03 \x01(\x05\"\x93\x01\n\x1fListNotificationConfigsResponse\x12W\n\x14notification_configs\x18\x01 \x03(\x0b\x32\x39.google.cloud.securitycenter.v1p1beta1.NotificationConfig\x12\x17\n\x0fnext_page_token\x18\x02 \x01(\t\"y\n\x12ListSourcesRequest\x12<\n\x06parent\x18\x01 \x01(\tB,\xe0\x41\x02\xfa\x41&\x12$securitycenter.googleapis.com/Source\x12\x12\n\npage_token\x18\x02 \x01(\t\x12\x11\n\tpage_size\x18\x07 \x01(\x05\"n\n\x13ListSourcesResponse\x12>\n\x07sources\x18\x01 \x03(\x0b\x32-.google.cloud.securitycenter.v1p1beta1.Source\x12\x17\n\x0fnext_page_token\x18\x02 \x01(\t\"\xad\x02\n\x11ListAssetsRequest\x12;\n\x06parent\x18\x01 \x01(\tB+\xe0\x41\x02\xfa\x41%\x12#securitycenter.googleapis.com/Asset\x12\x0e\n\x06\x66ilter\x18\x02 \x01(\t\x12\x10\n\x08order_by\x18\x03 \x01(\t\x12-\n\tread_time\x18\x04 \x01(\x0b\x32\x1a.google.protobuf.Timestamp\x12\x33\n\x10\x63ompare_duration\x18\x05 \x01(\x0b\x32\x19.google.protobuf.Duration\x12.\n\nfield_mask\x18\x07 \x01(\x0b\x32\x1a.google.protobuf.FieldMask\x12\x12\n\npage_token\x18\x08 \x01(\t\x12\x11\n\tpage_size\x18\t \x01(\x05\"\xd8\x03\n\x12ListAssetsResponse\x12g\n\x13list_assets_results\x18\x01 \x03(\x0b\x32J.google.cloud.securitycenter.v1p1beta1.ListAssetsResponse.ListAssetsResult\x12-\n\tread_time\x18\x02 \x01(\x0b\x32\x1a.google.protobuf.Timestamp\x12\x17\n\x0fnext_page_token\x18\x03 \x01(\t\x12\x12\n\ntotal_size\x18\x04 \x01(\x05\x1a\xfc\x01\n\x10ListAssetsResult\x12;\n\x05\x61sset\x18\x01 \x01(\x0b\x32,.google.cloud.securitycenter.v1p1beta1.Asset\x12l\n\x0cstate_change\x18\x02 \x01(\x0e\x32V.google.cloud.securitycenter.v1p1beta1.ListAssetsResponse.ListAssetsResult.StateChange\"=\n\x0bStateChange\x12\n\n\x06UNUSED\x10\x00\x12\t\n\x05\x41\x44\x44\x45\x44\x10\x01\x12\x0b\n\x07REMOVED\x10\x02\x12\n\n\x06\x41\x43TIVE\x10\x03\"\xb0\x02\n\x13ListFindingsRequest\x12<\n\x06parent\x18\x01 \x01(\tB,\xe0\x41\x02\xfa\x41&\n$securitycenter.googleapis.com/Source\x12\x0e\n\x06\x66ilter\x18\x02 \x01(\t\x12\x10\n\x08order_by\x18\x03 \x01(\t\x12-\n\tread_time\x18\x04 \x01(\x0b\x32\x1a.google.protobuf.Timestamp\x12\x33\n\x10\x63ompare_duration\x18\x05 \x01(\x0b\x32\x19.google.protobuf.Duration\x12.\n\nfield_mask\x18\x07 \x01(\x0b\x32\x1a.google.protobuf.FieldMask\x12\x12\n\npage_token\x18\x08 \x01(\t\x12\x11\n\tpage_size\x18\t \x01(\x05\"\xab\x06\n\x14ListFindingsResponse\x12m\n\x15list_findings_results\x18\x01 \x03(\x0b\x32N.google.cloud.securitycenter.v1p1beta1.ListFindingsResponse.ListFindingsResult\x12-\n\tread_time\x18\x02 \x01(\x0b\x32\x1a.google.protobuf.Timestamp\x12\x17\n\x0fnext_page_token\x18\x03 \x01(\t\x12\x12\n\ntotal_size\x18\x04 \x01(\x05\x1a\xc7\x04\n\x12ListFindingsResult\x12?\n\x07\x66inding\x18\x01 \x01(\x0b\x32..google.cloud.securitycenter.v1p1beta1.Finding\x12p\n\x0cstate_change\x18\x02 \x01(\x0e\x32Z.google.cloud.securitycenter.v1p1beta1.ListFindingsResponse.ListFindingsResult.StateChange\x12n\n\x08resource\x18\x03 \x01(\x0b\x32W.google.cloud.securitycenter.v1p1beta1.ListFindingsResponse.ListFindingsResult.ResourceB\x03\xe0\x41\x03\x1a\xbe\x01\n\x08Resource\x12\x0c\n\x04name\x18\x01 \x01(\t\x12\x14\n\x0cproject_name\x18\x02 \x01(\t\x12\x1c\n\x14project_display_name\x18\x03 \x01(\t\x12\x13\n\x0bparent_name\x18\x04 \x01(\t\x12\x1b\n\x13parent_display_name\x18\x05 \x01(\t\x12>\n\x07\x66olders\x18\n \x03(\x0b\x32-.google.cloud.securitycenter.v1p1beta1.Folder\"M\n\x0bStateChange\x12\n\n\x06UNUSED\x10\x00\x12\x0b\n\x07\x43HANGED\x10\x01\x12\r\n\tUNCHANGED\x10\x02\x12\t\n\x05\x41\x44\x44\x45\x44\x10\x03\x12\x0b\n\x07REMOVED\x10\x04\"\xd4\x01\n\x16SetFindingStateRequest\x12;\n\x04name\x18\x01 \x01(\tB-\xe0\x41\x02\xfa\x41\'\n%securitycenter.googleapis.com/Finding\x12H\n\x05state\x18\x02 \x01(\x0e\x32\x34.google.cloud.securitycenter.v1p1beta1.Finding.StateB\x03\xe0\x41\x02\x12\x33\n\nstart_time\x18\x03 \x01(\x0b\x32\x1a.google.protobuf.TimestampB\x03\xe0\x41\x02\"d\n\x18RunAssetDiscoveryRequest\x12H\n\x06parent\x18\x01 \x01(\tB8\xe0\x41\x02\xfa\x41\x32\n0cloudresourcemanager.googleapis.com/Organization\"\x8d\x01\n\x14UpdateFindingRequest\x12\x44\n\x07\x66inding\x18\x01 \x01(\x0b\x32..google.cloud.securitycenter.v1p1beta1.FindingB\x03\xe0\x41\x02\x12/\n\x0bupdate_mask\x18\x02 \x01(\x0b\x32\x1a.google.protobuf.FieldMask\"\xaf\x01\n\x1fUpdateNotificationConfigRequest\x12[\n\x13notification_config\x18\x01 \x01(\x0b\x32\x39.google.cloud.securitycenter.v1p1beta1.NotificationConfigB\x03\xe0\x41\x02\x12/\n\x0bupdate_mask\x18\x02 \x01(\x0b\x32\x1a.google.protobuf.FieldMask\"\xb5\x01\n!UpdateOrganizationSettingsRequest\x12_\n\x15organization_settings\x18\x01 \x01(\x0b\x32;.google.cloud.securitycenter.v1p1beta1.OrganizationSettingsB\x03\xe0\x41\x02\x12/\n\x0bupdate_mask\x18\x02 \x01(\x0b\x32\x1a.google.protobuf.FieldMask\"\x8a\x01\n\x13UpdateSourceRequest\x12\x42\n\x06source\x18\x01 \x01(\x0b\x32-.google.cloud.securitycenter.v1p1beta1.SourceB\x03\xe0\x41\x02\x12/\n\x0bupdate_mask\x18\x02 \x01(\x0b\x32\x1a.google.protobuf.FieldMask\"\xd0\x01\n\x1aUpdateSecurityMarksRequest\x12Q\n\x0esecurity_marks\x18\x01 \x01(\x0b\x32\x34.google.cloud.securitycenter.v1p1beta1.SecurityMarksB\x03\xe0\x41\x02\x12/\n\x0bupdate_mask\x18\x02 \x01(\x0b\x32\x1a.google.protobuf.FieldMask\x12.\n\nstart_time\x18\x03 \x01(\x0b\x32\x1a.google.protobuf.Timestamp2\xf8\x33\n\x0eSecurityCenter\x12\xc6\x01\n\x0c\x43reateSource\x12:.google.cloud.securitycenter.v1p1beta1.CreateSourceRequest\x1a-.google.cloud.securitycenter.v1p1beta1.Source\"K\xda\x41\rparent,source\x82\xd3\xe4\x93\x02\x35\"+/v1p1beta1/{parent=organizations/*}/sources:\x06source\x12\xfd\x01\n\rCreateFinding\x12;.google.cloud.securitycenter.v1p1beta1.CreateFindingRequest\x1a..google.cloud.securitycenter.v1p1beta1.Finding\"\x7f\xda\x41\x19parent,finding_id,finding\xda\x41\x19parent,finding,finding_id\x82\xd3\xe4\x93\x02\x41\"6/v1p1beta1/{parent=organizations/*/sources/*}/findings:\x07\x66inding\x12\xb8\x02\n\x18\x43reateNotificationConfig\x12\x46.google.cloud.securitycenter.v1p1beta1.CreateNotificationConfigRequest\x1a\x39.google.cloud.securitycenter.v1p1beta1.NotificationConfig\"\x98\x01\xda\x41$parent,config_id,notification_config\xda\x41\x1aparent,notification_config\x82\xd3\xe4\x93\x02N\"7/v1p1beta1/{parent=organizations/*}/notificationConfigs:\x13notification_config\x12\xc2\x01\n\x18\x44\x65leteNotificationConfig\x12\x46.google.cloud.securitycenter.v1p1beta1.DeleteNotificationConfigRequest\x1a\x16.google.protobuf.Empty\"F\xda\x41\x04name\x82\xd3\xe4\x93\x02\x39*7/v1p1beta1/{name=organizations/*/notificationConfigs/*}\x12\x9d\x01\n\x0cGetIamPolicy\x12\".google.iam.v1.GetIamPolicyRequest\x1a\x15.google.iam.v1.Policy\"R\xda\x41\x08resource\x82\xd3\xe4\x93\x02\x41\"\"9/v1p1beta1/{name=folders/*/sources/*/findings/*}:setState:\x01*Z?\":/v1p1beta1/{name=projects/*/sources/*/findings/*}:setState:\x01*\x12\xa4\x01\n\x0cSetIamPolicy\x12\".google.iam.v1.SetIamPolicyRequest\x1a\x15.google.iam.v1.Policy\"Y\xda\x41\x0fresource,policy\x82\xd3\xe4\x93\x02\x41\"/v1p1beta1/{finding.name=organizations/*/sources/*/findings/*}:\x07\x66indingZC28/v1p1beta1/{finding.name=folders/*/sources/*/findings/*}:\x07\x66indingZD29/v1p1beta1/{finding.name=projects/*/sources/*/findings/*}:\x07\x66inding\x12\xc0\x02\n\x18UpdateNotificationConfig\x12\x46.google.cloud.securitycenter.v1p1beta1.UpdateNotificationConfigRequest\x1a\x39.google.cloud.securitycenter.v1p1beta1.NotificationConfig\"\xa0\x01\xda\x41\x13notification_config\xda\x41\x1fnotification_config,update_mask\x82\xd3\xe4\x93\x02\x62\x32K/v1p1beta1/{notification_config.name=organizations/*/notificationConfigs/*}:\x13notification_config\x12\xa9\x02\n\x1aUpdateOrganizationSettings\x12H.google.cloud.securitycenter.v1p1beta1.UpdateOrganizationSettingsRequest\x1a;.google.cloud.securitycenter.v1p1beta1.OrganizationSettings\"\x83\x01\xda\x41\x15organization_settings\x82\xd3\xe4\x93\x02\x65\x32L/v1p1beta1/{organization_settings.name=organizations/*/organizationSettings}:\x15organization_settings\x12\xdb\x01\n\x0cUpdateSource\x12:.google.cloud.securitycenter.v1p1beta1.UpdateSourceRequest\x1a-.google.cloud.securitycenter.v1p1beta1.Source\"`\xda\x41\x06source\xda\x41\x12source,update_mask\x82\xd3\xe4\x93\x02<22/v1p1beta1/{source.name=organizations/*/sources/*}:\x06source\x12\xf4\x05\n\x13UpdateSecurityMarks\x12\x41.google.cloud.securitycenter.v1p1beta1.UpdateSecurityMarksRequest\x1a\x34.google.cloud.securitycenter.v1p1beta1.SecurityMarks\"\xe3\x04\xda\x41\x0esecurity_marks\xda\x41\x1asecurity_marks,update_mask\x82\xd3\xe4\x93\x02\xae\x04\x32G/v1p1beta1/{security_marks.name=organizations/*/assets/*/securityMarks}:\x0esecurity_marksZS2A/v1p1beta1/{security_marks.name=folders/*/assets/*/securityMarks}:\x0esecurity_marksZT2B/v1p1beta1/{security_marks.name=projects/*/assets/*/securityMarks}:\x0esecurity_marksZe2S/v1p1beta1/{security_marks.name=organizations/*/sources/*/findings/*/securityMarks}:\x0esecurity_marksZ_2M/v1p1beta1/{security_marks.name=folders/*/sources/*/findings/*/securityMarks}:\x0esecurity_marksZ`2N/v1p1beta1/{security_marks.name=projects/*/sources/*/findings/*/securityMarks}:\x0esecurity_marks\x1aQ\xca\x41\x1dsecuritycenter.googleapis.com\xd2\x41.https://www.googleapis.com/auth/cloud-platformB\xfb\x01\n)com.google.cloud.securitycenter.v1p1beta1P\x01ZQcloud.google.com/go/securitycenter/apiv1p1beta1/securitycenterpb;securitycenterpb\xaa\x02%Google.Cloud.SecurityCenter.V1P1Beta1\xca\x02%Google\\Cloud\\SecurityCenter\\V1p1beta1\xea\x02(Google::Cloud::SecurityCenter::V1p1beta1P\x00P\x01\x62\x06proto3" - -pool = ::Google::Protobuf::DescriptorPool.generated_pool -pool.add_serialized_file(descriptor_data) - -module Google - module Cloud - module SecurityCenter - module V1p1beta1 - CreateFindingRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.securitycenter.v1p1beta1.CreateFindingRequest").msgclass - CreateNotificationConfigRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.securitycenter.v1p1beta1.CreateNotificationConfigRequest").msgclass - CreateSourceRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.securitycenter.v1p1beta1.CreateSourceRequest").msgclass - DeleteNotificationConfigRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.securitycenter.v1p1beta1.DeleteNotificationConfigRequest").msgclass - GetNotificationConfigRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.securitycenter.v1p1beta1.GetNotificationConfigRequest").msgclass - GetOrganizationSettingsRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.securitycenter.v1p1beta1.GetOrganizationSettingsRequest").msgclass - GetSourceRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.securitycenter.v1p1beta1.GetSourceRequest").msgclass - GroupAssetsRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.securitycenter.v1p1beta1.GroupAssetsRequest").msgclass - GroupAssetsResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.securitycenter.v1p1beta1.GroupAssetsResponse").msgclass - GroupFindingsRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.securitycenter.v1p1beta1.GroupFindingsRequest").msgclass - GroupFindingsResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.securitycenter.v1p1beta1.GroupFindingsResponse").msgclass - GroupResult = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.securitycenter.v1p1beta1.GroupResult").msgclass - ListNotificationConfigsRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.securitycenter.v1p1beta1.ListNotificationConfigsRequest").msgclass - ListNotificationConfigsResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.securitycenter.v1p1beta1.ListNotificationConfigsResponse").msgclass - ListSourcesRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.securitycenter.v1p1beta1.ListSourcesRequest").msgclass - ListSourcesResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.securitycenter.v1p1beta1.ListSourcesResponse").msgclass - ListAssetsRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.securitycenter.v1p1beta1.ListAssetsRequest").msgclass - ListAssetsResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.securitycenter.v1p1beta1.ListAssetsResponse").msgclass - ListAssetsResponse::ListAssetsResult = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.securitycenter.v1p1beta1.ListAssetsResponse.ListAssetsResult").msgclass - ListAssetsResponse::ListAssetsResult::StateChange = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.securitycenter.v1p1beta1.ListAssetsResponse.ListAssetsResult.StateChange").enummodule - ListFindingsRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.securitycenter.v1p1beta1.ListFindingsRequest").msgclass - ListFindingsResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.securitycenter.v1p1beta1.ListFindingsResponse").msgclass - ListFindingsResponse::ListFindingsResult = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.securitycenter.v1p1beta1.ListFindingsResponse.ListFindingsResult").msgclass - ListFindingsResponse::ListFindingsResult::Resource = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.securitycenter.v1p1beta1.ListFindingsResponse.ListFindingsResult.Resource").msgclass - ListFindingsResponse::ListFindingsResult::StateChange = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.securitycenter.v1p1beta1.ListFindingsResponse.ListFindingsResult.StateChange").enummodule - SetFindingStateRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.securitycenter.v1p1beta1.SetFindingStateRequest").msgclass - RunAssetDiscoveryRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.securitycenter.v1p1beta1.RunAssetDiscoveryRequest").msgclass - UpdateFindingRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.securitycenter.v1p1beta1.UpdateFindingRequest").msgclass - UpdateNotificationConfigRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.securitycenter.v1p1beta1.UpdateNotificationConfigRequest").msgclass - UpdateOrganizationSettingsRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.securitycenter.v1p1beta1.UpdateOrganizationSettingsRequest").msgclass - UpdateSourceRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.securitycenter.v1p1beta1.UpdateSourceRequest").msgclass - UpdateSecurityMarksRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.securitycenter.v1p1beta1.UpdateSecurityMarksRequest").msgclass - end - end - end -end diff --git a/owl-bot-staging/google-cloud-security_center-v1p1beta1/lib/google/cloud/securitycenter/v1p1beta1/securitycenter_service_services_pb.rb b/owl-bot-staging/google-cloud-security_center-v1p1beta1/lib/google/cloud/securitycenter/v1p1beta1/securitycenter_service_services_pb.rb deleted file mode 100644 index 76c57914966b..000000000000 --- a/owl-bot-staging/google-cloud-security_center-v1p1beta1/lib/google/cloud/securitycenter/v1p1beta1/securitycenter_service_services_pb.rb +++ /dev/null @@ -1,107 +0,0 @@ -# Generated by the protocol buffer compiler. DO NOT EDIT! -# Source: google/cloud/securitycenter/v1p1beta1/securitycenter_service.proto for package 'Google.Cloud.SecurityCenter.V1p1beta1' -# Original file comments: -# 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 -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. -# - -require 'grpc' -require 'google/cloud/securitycenter/v1p1beta1/securitycenter_service_pb' - -module Google - module Cloud - module SecurityCenter - module V1p1beta1 - module SecurityCenter - # V1p1Beta1 APIs for Security Center service. - class Service - - include ::GRPC::GenericService - - self.marshal_class_method = :encode - self.unmarshal_class_method = :decode - self.service_name = 'google.cloud.securitycenter.v1p1beta1.SecurityCenter' - - # Creates a source. - rpc :CreateSource, ::Google::Cloud::SecurityCenter::V1p1beta1::CreateSourceRequest, ::Google::Cloud::SecurityCenter::V1p1beta1::Source - # Creates a finding. The corresponding source must exist for finding - # creation to succeed. - rpc :CreateFinding, ::Google::Cloud::SecurityCenter::V1p1beta1::CreateFindingRequest, ::Google::Cloud::SecurityCenter::V1p1beta1::Finding - # Creates a notification config. - rpc :CreateNotificationConfig, ::Google::Cloud::SecurityCenter::V1p1beta1::CreateNotificationConfigRequest, ::Google::Cloud::SecurityCenter::V1p1beta1::NotificationConfig - # Deletes a notification config. - rpc :DeleteNotificationConfig, ::Google::Cloud::SecurityCenter::V1p1beta1::DeleteNotificationConfigRequest, ::Google::Protobuf::Empty - # Gets the access control policy on the specified Source. - rpc :GetIamPolicy, ::Google::Iam::V1::GetIamPolicyRequest, ::Google::Iam::V1::Policy - # Gets a notification config. - rpc :GetNotificationConfig, ::Google::Cloud::SecurityCenter::V1p1beta1::GetNotificationConfigRequest, ::Google::Cloud::SecurityCenter::V1p1beta1::NotificationConfig - # Gets the settings for an organization. - rpc :GetOrganizationSettings, ::Google::Cloud::SecurityCenter::V1p1beta1::GetOrganizationSettingsRequest, ::Google::Cloud::SecurityCenter::V1p1beta1::OrganizationSettings - # Gets a source. - rpc :GetSource, ::Google::Cloud::SecurityCenter::V1p1beta1::GetSourceRequest, ::Google::Cloud::SecurityCenter::V1p1beta1::Source - # Filters an organization's assets and groups them by their specified - # properties. - rpc :GroupAssets, ::Google::Cloud::SecurityCenter::V1p1beta1::GroupAssetsRequest, ::Google::Cloud::SecurityCenter::V1p1beta1::GroupAssetsResponse - # Filters an organization or source's findings and groups them by their - # specified properties. - # - # To group across all sources provide a `-` as the source id. - # Example: /v1/organizations/{organization_id}/sources/-/findings, - # /v1/folders/{folder_id}/sources/-/findings, - # /v1/projects/{project_id}/sources/-/findings - rpc :GroupFindings, ::Google::Cloud::SecurityCenter::V1p1beta1::GroupFindingsRequest, ::Google::Cloud::SecurityCenter::V1p1beta1::GroupFindingsResponse - # Lists an organization's assets. - rpc :ListAssets, ::Google::Cloud::SecurityCenter::V1p1beta1::ListAssetsRequest, ::Google::Cloud::SecurityCenter::V1p1beta1::ListAssetsResponse - # Lists an organization or source's findings. - # - # To list across all sources provide a `-` as the source id. - # Example: /v1p1beta1/organizations/{organization_id}/sources/-/findings - rpc :ListFindings, ::Google::Cloud::SecurityCenter::V1p1beta1::ListFindingsRequest, ::Google::Cloud::SecurityCenter::V1p1beta1::ListFindingsResponse - # Lists notification configs. - rpc :ListNotificationConfigs, ::Google::Cloud::SecurityCenter::V1p1beta1::ListNotificationConfigsRequest, ::Google::Cloud::SecurityCenter::V1p1beta1::ListNotificationConfigsResponse - # Lists all sources belonging to an organization. - rpc :ListSources, ::Google::Cloud::SecurityCenter::V1p1beta1::ListSourcesRequest, ::Google::Cloud::SecurityCenter::V1p1beta1::ListSourcesResponse - # Runs asset discovery. The discovery is tracked with a long-running - # operation. - # - # This API can only be called with limited frequency for an organization. If - # it is called too frequently the caller will receive a TOO_MANY_REQUESTS - # error. - rpc :RunAssetDiscovery, ::Google::Cloud::SecurityCenter::V1p1beta1::RunAssetDiscoveryRequest, ::Google::Longrunning::Operation - # Updates the state of a finding. - rpc :SetFindingState, ::Google::Cloud::SecurityCenter::V1p1beta1::SetFindingStateRequest, ::Google::Cloud::SecurityCenter::V1p1beta1::Finding - # Sets the access control policy on the specified Source. - rpc :SetIamPolicy, ::Google::Iam::V1::SetIamPolicyRequest, ::Google::Iam::V1::Policy - # Returns the permissions that a caller has on the specified source. - rpc :TestIamPermissions, ::Google::Iam::V1::TestIamPermissionsRequest, ::Google::Iam::V1::TestIamPermissionsResponse - # Creates or updates a finding. The corresponding source must exist for a - # finding creation to succeed. - rpc :UpdateFinding, ::Google::Cloud::SecurityCenter::V1p1beta1::UpdateFindingRequest, ::Google::Cloud::SecurityCenter::V1p1beta1::Finding - # Updates a notification config. The following update - # fields are allowed: description, pubsub_topic, streaming_config.filter - rpc :UpdateNotificationConfig, ::Google::Cloud::SecurityCenter::V1p1beta1::UpdateNotificationConfigRequest, ::Google::Cloud::SecurityCenter::V1p1beta1::NotificationConfig - # Updates an organization's settings. - rpc :UpdateOrganizationSettings, ::Google::Cloud::SecurityCenter::V1p1beta1::UpdateOrganizationSettingsRequest, ::Google::Cloud::SecurityCenter::V1p1beta1::OrganizationSettings - # Updates a source. - rpc :UpdateSource, ::Google::Cloud::SecurityCenter::V1p1beta1::UpdateSourceRequest, ::Google::Cloud::SecurityCenter::V1p1beta1::Source - # Updates security marks. - rpc :UpdateSecurityMarks, ::Google::Cloud::SecurityCenter::V1p1beta1::UpdateSecurityMarksRequest, ::Google::Cloud::SecurityCenter::V1p1beta1::SecurityMarks - end - - Stub = Service.rpc_stub_class - end - end - end - end -end diff --git a/owl-bot-staging/google-cloud-security_center-v1p1beta1/lib/google/cloud/securitycenter/v1p1beta1/source_pb.rb b/owl-bot-staging/google-cloud-security_center-v1p1beta1/lib/google/cloud/securitycenter/v1p1beta1/source_pb.rb deleted file mode 100644 index 4315dc444ba5..000000000000 --- a/owl-bot-staging/google-cloud-security_center-v1p1beta1/lib/google/cloud/securitycenter/v1p1beta1/source_pb.rb +++ /dev/null @@ -1,23 +0,0 @@ -# frozen_string_literal: true -# Generated by the protocol buffer compiler. DO NOT EDIT! -# source: google/cloud/securitycenter/v1p1beta1/source.proto - -require 'google/protobuf' - -require 'google/api/resource_pb' - - -descriptor_data = "\n2google/cloud/securitycenter/v1p1beta1/source.proto\x12%google.cloud.securitycenter.v1p1beta1\x1a\x19google/api/resource.proto\"\xfd\x01\n\x06Source\x12\x0c\n\x04name\x18\x01 \x01(\t\x12\x14\n\x0c\x64isplay_name\x18\x02 \x01(\t\x12\x13\n\x0b\x64\x65scription\x18\x03 \x01(\t\x12\x16\n\x0e\x63\x61nonical_name\x18\x0e \x01(\t:\xa1\x01\xea\x41\x9d\x01\n$securitycenter.googleapis.com/Source\x12-organizations/{organization}/sources/{source}\x12!folders/{folder}/sources/{source}\x12#projects/{project}/sources/{source}B\xfb\x01\n)com.google.cloud.securitycenter.v1p1beta1P\x01ZQcloud.google.com/go/securitycenter/apiv1p1beta1/securitycenterpb;securitycenterpb\xaa\x02%Google.Cloud.SecurityCenter.V1P1Beta1\xca\x02%Google\\Cloud\\SecurityCenter\\V1p1beta1\xea\x02(Google::Cloud::SecurityCenter::V1p1beta1b\x06proto3" - -pool = ::Google::Protobuf::DescriptorPool.generated_pool -pool.add_serialized_file(descriptor_data) - -module Google - module Cloud - module SecurityCenter - module V1p1beta1 - Source = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.securitycenter.v1p1beta1.Source").msgclass - end - end - end -end diff --git a/owl-bot-staging/google-cloud-security_center-v1p1beta1/proto_docs/README.md b/owl-bot-staging/google-cloud-security_center-v1p1beta1/proto_docs/README.md deleted file mode 100644 index a4968e1aaa4d..000000000000 --- a/owl-bot-staging/google-cloud-security_center-v1p1beta1/proto_docs/README.md +++ /dev/null @@ -1,4 +0,0 @@ -# Cloud Security Command Center V1p1beta1 Protocol Buffer Documentation - -These files are for the YARD documentation of the generated protobuf files. -They are not intended to be required or loaded at runtime. diff --git a/owl-bot-staging/google-cloud-security_center-v1p1beta1/proto_docs/google/api/client.rb b/owl-bot-staging/google-cloud-security_center-v1p1beta1/proto_docs/google/api/client.rb deleted file mode 100644 index 5089551e9ea4..000000000000 --- a/owl-bot-staging/google-cloud-security_center-v1p1beta1/proto_docs/google/api/client.rb +++ /dev/null @@ -1,589 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - - -module Google - module Api - # Required information for every language. - # @!attribute [rw] reference_docs_uri - # @deprecated This field is deprecated and may be removed in the next major version update. - # @return [::String] - # Link to automatically generated reference documentation. Example: - # https://cloud.google.com/nodejs/docs/reference/asset/latest - # @!attribute [rw] destinations - # @return [::Array<::Google::Api::ClientLibraryDestination>] - # The destination where API teams want this client library to be published. - # @!attribute [rw] selective_gapic_generation - # @return [::Google::Api::SelectiveGapicGeneration] - # Configuration for which RPCs should be generated in the GAPIC client. - class CommonLanguageSettings - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Details about how and where to publish client libraries. - # @!attribute [rw] version - # @return [::String] - # Version of the API to apply these settings to. This is the full protobuf - # package for the API, ending in the version element. - # Examples: "google.cloud.speech.v1" and "google.spanner.admin.database.v1". - # @!attribute [rw] launch_stage - # @return [::Google::Api::LaunchStage] - # Launch stage of this version of the API. - # @!attribute [rw] rest_numeric_enums - # @return [::Boolean] - # When using transport=rest, the client request will encode enums as - # numbers rather than strings. - # @!attribute [rw] java_settings - # @return [::Google::Api::JavaSettings] - # Settings for legacy Java features, supported in the Service YAML. - # @!attribute [rw] cpp_settings - # @return [::Google::Api::CppSettings] - # Settings for C++ client libraries. - # @!attribute [rw] php_settings - # @return [::Google::Api::PhpSettings] - # Settings for PHP client libraries. - # @!attribute [rw] python_settings - # @return [::Google::Api::PythonSettings] - # Settings for Python client libraries. - # @!attribute [rw] node_settings - # @return [::Google::Api::NodeSettings] - # Settings for Node client libraries. - # @!attribute [rw] dotnet_settings - # @return [::Google::Api::DotnetSettings] - # Settings for .NET client libraries. - # @!attribute [rw] ruby_settings - # @return [::Google::Api::RubySettings] - # Settings for Ruby client libraries. - # @!attribute [rw] go_settings - # @return [::Google::Api::GoSettings] - # Settings for Go client libraries. - class ClientLibrarySettings - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # This message configures the settings for publishing [Google Cloud Client - # libraries](https://cloud.google.com/apis/docs/cloud-client-libraries) - # generated from the service config. - # @!attribute [rw] method_settings - # @return [::Array<::Google::Api::MethodSettings>] - # A list of API method settings, e.g. the behavior for methods that use the - # long-running operation pattern. - # @!attribute [rw] new_issue_uri - # @return [::String] - # Link to a *public* URI where users can report issues. Example: - # https://issuetracker.google.com/issues/new?component=190865&template=1161103 - # @!attribute [rw] documentation_uri - # @return [::String] - # Link to product home page. Example: - # https://cloud.google.com/asset-inventory/docs/overview - # @!attribute [rw] api_short_name - # @return [::String] - # Used as a tracking tag when collecting data about the APIs developer - # relations artifacts like docs, packages delivered to package managers, - # etc. Example: "speech". - # @!attribute [rw] github_label - # @return [::String] - # GitHub label to apply to issues and pull requests opened for this API. - # @!attribute [rw] codeowner_github_teams - # @return [::Array<::String>] - # GitHub teams to be added to CODEOWNERS in the directory in GitHub - # containing source code for the client libraries for this API. - # @!attribute [rw] doc_tag_prefix - # @return [::String] - # A prefix used in sample code when demarking regions to be included in - # documentation. - # @!attribute [rw] organization - # @return [::Google::Api::ClientLibraryOrganization] - # For whom the client library is being published. - # @!attribute [rw] library_settings - # @return [::Array<::Google::Api::ClientLibrarySettings>] - # Client library settings. If the same version string appears multiple - # times in this list, then the last one wins. Settings from earlier - # settings with the same version string are discarded. - # @!attribute [rw] proto_reference_documentation_uri - # @return [::String] - # Optional link to proto reference documentation. Example: - # https://cloud.google.com/pubsub/lite/docs/reference/rpc - # @!attribute [rw] rest_reference_documentation_uri - # @return [::String] - # Optional link to REST reference documentation. Example: - # https://cloud.google.com/pubsub/lite/docs/reference/rest - class Publishing - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Settings for Java client libraries. - # @!attribute [rw] library_package - # @return [::String] - # The package name to use in Java. Clobbers the java_package option - # set in the protobuf. This should be used **only** by APIs - # who have already set the language_settings.java.package_name" field - # in gapic.yaml. API teams should use the protobuf java_package option - # where possible. - # - # Example of a YAML configuration:: - # - # publishing: - # 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. - # @!attribute [rw] methods - # @return [::Array<::String>] - # An allowlist of the fully qualified names of RPCs that should be included - # on public client surfaces. - # @!attribute [rw] generate_omitted_as_internal - # @return [::Boolean] - # Setting this to true indicates to the client generators that methods - # that would be excluded from the generation should instead be generated - # in a way that indicates these methods should not be consumed by - # end users. How this is expressed is up to individual language - # implementations to decide. Some examples may be: added annotations, - # obfuscated identifiers, or other language idiomatic patterns. - class SelectiveGapicGeneration - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # `BatchingConfigProto` defines the batching configuration for an API method. - # @!attribute [rw] thresholds - # @return [::Google::Api::BatchingSettingsProto] - # The thresholds which trigger a batched request to be sent. - # @!attribute [rw] batch_descriptor - # @return [::Google::Api::BatchingDescriptorProto] - # The request and response fields used in batching. - class BatchingConfigProto - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # `BatchingSettingsProto` specifies a set of batching thresholds, each of - # which acts as a trigger to send a batch of messages as a request. At least - # one threshold must be positive nonzero. - # @!attribute [rw] element_count_threshold - # @return [::Integer] - # The number of elements of a field collected into a batch which, if - # exceeded, causes the batch to be sent. - # @!attribute [rw] request_byte_threshold - # @return [::Integer] - # The aggregated size of the batched field which, if exceeded, causes the - # batch to be sent. This size is computed by aggregating the sizes of the - # request field to be batched, not of the entire request message. - # @!attribute [rw] delay_threshold - # @return [::Google::Protobuf::Duration] - # The duration after which a batch should be sent, starting from the addition - # of the first message to that batch. - # @!attribute [rw] element_count_limit - # @return [::Integer] - # The maximum number of elements collected in a batch that could be accepted - # by server. - # @!attribute [rw] request_byte_limit - # @return [::Integer] - # The maximum size of the request that could be accepted by server. - # @!attribute [rw] flow_control_element_limit - # @return [::Integer] - # The maximum number of elements allowed by flow control. - # @!attribute [rw] flow_control_byte_limit - # @return [::Integer] - # The maximum size of data allowed by flow control. - # @!attribute [rw] flow_control_limit_exceeded_behavior - # @return [::Google::Api::FlowControlLimitExceededBehaviorProto] - # The behavior to take when the flow control limit is exceeded. - class BatchingSettingsProto - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # `BatchingDescriptorProto` specifies the fields of the request message to be - # used for batching, and, optionally, the fields of the response message to be - # used for demultiplexing. - # @!attribute [rw] batched_field - # @return [::String] - # The repeated field in the request message to be aggregated by batching. - # @!attribute [rw] discriminator_fields - # @return [::Array<::String>] - # A list of the fields in the request message. Two requests will be batched - # together only if the values of every field specified in - # `request_discriminator_fields` is equal between the two requests. - # @!attribute [rw] subresponse_field - # @return [::String] - # Optional. When present, indicates the field in the response message to be - # used to demultiplex the response into multiple response messages, in - # correspondence with the multiple request messages originally batched - # together. - class BatchingDescriptorProto - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # The organization for which the client libraries are being published. - # Affects the url where generated docs are published, etc. - module ClientLibraryOrganization - # Not useful. - CLIENT_LIBRARY_ORGANIZATION_UNSPECIFIED = 0 - - # Google Cloud Platform Org. - CLOUD = 1 - - # Ads (Advertising) Org. - ADS = 2 - - # Photos Org. - PHOTOS = 3 - - # Street View Org. - STREET_VIEW = 4 - - # Shopping Org. - SHOPPING = 5 - - # Geo Org. - GEO = 6 - - # Generative AI - https://developers.generativeai.google - GENERATIVE_AI = 7 - end - - # To where should client libraries be published? - module ClientLibraryDestination - # Client libraries will neither be generated nor published to package - # managers. - CLIENT_LIBRARY_DESTINATION_UNSPECIFIED = 0 - - # Generate the client library in a repo under github.com/googleapis, - # but don't publish it to package managers. - GITHUB = 10 - - # Publish the library to package managers like nuget.org and npmjs.com. - PACKAGE_MANAGER = 20 - end - - # The behavior to take when the flow control limit is exceeded. - module FlowControlLimitExceededBehaviorProto - # Default behavior, system-defined. - UNSET_BEHAVIOR = 0 - - # Stop operation, raise error. - THROW_EXCEPTION = 1 - - # Pause operation until limit clears. - BLOCK = 2 - - # Continue operation, disregard limit. - IGNORE = 3 - end - end -end diff --git a/owl-bot-staging/google-cloud-security_center-v1p1beta1/proto_docs/google/api/field_behavior.rb b/owl-bot-staging/google-cloud-security_center-v1p1beta1/proto_docs/google/api/field_behavior.rb deleted file mode 100644 index 582be187d115..000000000000 --- a/owl-bot-staging/google-cloud-security_center-v1p1beta1/proto_docs/google/api/field_behavior.rb +++ /dev/null @@ -1,85 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - - -module Google - module Api - # An indicator of the behavior of a given field (for example, that a field - # is required in requests, or given as output but ignored as input). - # This **does not** change the behavior in protocol buffers itself; it only - # denotes the behavior and may affect how API tooling handles the field. - # - # Note: This enum **may** receive new values in the future. - module FieldBehavior - # Conventional default for enums. Do not use this. - FIELD_BEHAVIOR_UNSPECIFIED = 0 - - # Specifically denotes a field as optional. - # While all fields in protocol buffers are optional, this may be specified - # for emphasis if appropriate. - OPTIONAL = 1 - - # Denotes a field as required. - # This indicates that the field **must** be provided as part of the request, - # and failure to do so will cause an error (usually `INVALID_ARGUMENT`). - REQUIRED = 2 - - # Denotes a field as output only. - # This indicates that the field is provided in responses, but including the - # field in a request does nothing (the server *must* ignore it and - # *must not* throw an error as a result of the field's presence). - OUTPUT_ONLY = 3 - - # Denotes a field as input only. - # This indicates that the field is provided in requests, and the - # corresponding field is not included in output. - INPUT_ONLY = 4 - - # Denotes a field as immutable. - # This indicates that the field may be set once in a request to create a - # resource, but may not be changed thereafter. - IMMUTABLE = 5 - - # Denotes that a (repeated) field is an unordered list. - # This indicates that the service may provide the elements of the list - # in any arbitrary order, rather than the order the user originally - # provided. Additionally, the list's order may or may not be stable. - UNORDERED_LIST = 6 - - # Denotes that this field returns a non-empty default value if not set. - # This indicates that if the user provides the empty value in a request, - # a non-empty value will be returned. The user will not be aware of what - # non-empty value to expect. - NON_EMPTY_DEFAULT = 7 - - # Denotes that the field in a resource (a message annotated with - # google.api.resource) is used in the resource name to uniquely identify the - # resource. For AIP-compliant APIs, this should only be applied to the - # `name` field on the resource. - # - # This behavior should not be applied to references to other resources within - # the message. - # - # The identifier field of resources often have different field behavior - # depending on the request it is embedded in (e.g. for Create methods name - # is optional and unused, while for Update methods it is required). Instead - # of method-specific annotations, only `IDENTIFIER` is required. - IDENTIFIER = 8 - end - end -end diff --git a/owl-bot-staging/google-cloud-security_center-v1p1beta1/proto_docs/google/api/launch_stage.rb b/owl-bot-staging/google-cloud-security_center-v1p1beta1/proto_docs/google/api/launch_stage.rb deleted file mode 100644 index 9392a413fb1b..000000000000 --- a/owl-bot-staging/google-cloud-security_center-v1p1beta1/proto_docs/google/api/launch_stage.rb +++ /dev/null @@ -1,71 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - - -module Google - module Api - # The launch stage as defined by [Google Cloud Platform - # Launch Stages](https://cloud.google.com/terms/launch-stages). - module LaunchStage - # Do not use this default value. - LAUNCH_STAGE_UNSPECIFIED = 0 - - # The feature is not yet implemented. Users can not use it. - UNIMPLEMENTED = 6 - - # Prelaunch features are hidden from users and are only visible internally. - PRELAUNCH = 7 - - # Early Access features are limited to a closed group of testers. To use - # these features, you must sign up in advance and sign a Trusted Tester - # agreement (which includes confidentiality provisions). These features may - # be unstable, changed in backward-incompatible ways, and are not - # guaranteed to be released. - EARLY_ACCESS = 1 - - # Alpha is a limited availability test for releases before they are cleared - # for widespread use. By Alpha, all significant design issues are resolved - # and we are in the process of verifying functionality. Alpha customers - # need to apply for access, agree to applicable terms, and have their - # projects allowlisted. Alpha releases don't have to be feature complete, - # no SLAs are provided, and there are no technical support obligations, but - # they will be far enough along that customers can actually use them in - # test environments or for limited-use tests -- just like they would in - # normal production cases. - ALPHA = 2 - - # Beta is the point at which we are ready to open a release for any - # customer to use. There are no SLA or technical support obligations in a - # Beta release. Products will be complete from a feature perspective, but - # may have some open outstanding issues. Beta releases are suitable for - # limited production use cases. - BETA = 3 - - # GA features are open to all developers and are considered stable and - # fully qualified for production use. - GA = 4 - - # Deprecated features are scheduled to be shut down and removed. For more - # information, see the "Deprecation Policy" section of our [Terms of - # Service](https://cloud.google.com/terms/) - # and the [Google Cloud Platform Subject to the Deprecation - # Policy](https://cloud.google.com/terms/deprecation) documentation. - DEPRECATED = 5 - end - end -end diff --git a/owl-bot-staging/google-cloud-security_center-v1p1beta1/proto_docs/google/api/resource.rb b/owl-bot-staging/google-cloud-security_center-v1p1beta1/proto_docs/google/api/resource.rb deleted file mode 100644 index 25dec4847ac1..000000000000 --- a/owl-bot-staging/google-cloud-security_center-v1p1beta1/proto_docs/google/api/resource.rb +++ /dev/null @@ -1,227 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - - -module Google - module Api - # A simple descriptor of a resource type. - # - # ResourceDescriptor annotates a resource message (either by means of a - # protobuf annotation or use in the service config), and associates the - # resource's schema, the resource type, and the pattern of the resource name. - # - # Example: - # - # message Topic { - # // Indicates this message defines a resource schema. - # // Declares the resource type in the format of {service}/{kind}. - # // For Kubernetes resources, the format is {api group}/{kind}. - # option (google.api.resource) = { - # type: "pubsub.googleapis.com/Topic" - # pattern: "projects/{project}/topics/{topic}" - # }; - # } - # - # The ResourceDescriptor Yaml config will look like: - # - # resources: - # - type: "pubsub.googleapis.com/Topic" - # pattern: "projects/{project}/topics/{topic}" - # - # Sometimes, resources have multiple patterns, typically because they can - # live under multiple parents. - # - # Example: - # - # message LogEntry { - # option (google.api.resource) = { - # type: "logging.googleapis.com/LogEntry" - # pattern: "projects/{project}/logs/{log}" - # pattern: "folders/{folder}/logs/{log}" - # pattern: "organizations/{organization}/logs/{log}" - # pattern: "billingAccounts/{billing_account}/logs/{log}" - # }; - # } - # - # The ResourceDescriptor Yaml config will look like: - # - # resources: - # - type: 'logging.googleapis.com/LogEntry' - # pattern: "projects/{project}/logs/{log}" - # pattern: "folders/{folder}/logs/{log}" - # pattern: "organizations/{organization}/logs/{log}" - # pattern: "billingAccounts/{billing_account}/logs/{log}" - # @!attribute [rw] type - # @return [::String] - # The resource type. It must be in the format of - # \\{service_name}/\\{resource_type_kind}. The `resource_type_kind` must be - # singular and must not include version numbers. - # - # Example: `storage.googleapis.com/Bucket` - # - # The value of the resource_type_kind must follow the regular expression - # /[A-Za-z][a-zA-Z0-9]+/. It should start with an upper case character and - # should use PascalCase (UpperCamelCase). The maximum number of - # characters allowed for the `resource_type_kind` is 100. - # @!attribute [rw] pattern - # @return [::Array<::String>] - # Optional. The relative resource name pattern associated with this resource - # type. The DNS prefix of the full resource name shouldn't be specified here. - # - # The path pattern must follow the syntax, which aligns with HTTP binding - # syntax: - # - # Template = Segment { "/" Segment } ; - # Segment = LITERAL | Variable ; - # Variable = "{" LITERAL "}" ; - # - # Examples: - # - # - "projects/\\{project}/topics/\\{topic}" - # - "projects/\\{project}/knowledgeBases/\\{knowledge_base}" - # - # The components in braces correspond to the IDs for each resource in the - # hierarchy. It is expected that, if multiple patterns are provided, - # the same component name (e.g. "project") refers to IDs of the same - # type of resource. - # @!attribute [rw] name_field - # @return [::String] - # Optional. The field on the resource that designates the resource name - # field. If omitted, this is assumed to be "name". - # @!attribute [rw] history - # @return [::Google::Api::ResourceDescriptor::History] - # Optional. The historical or future-looking state of the resource pattern. - # - # Example: - # - # // The InspectTemplate message originally only supported resource - # // names with organization, and project was added later. - # message InspectTemplate { - # option (google.api.resource) = { - # type: "dlp.googleapis.com/InspectTemplate" - # pattern: - # "organizations/{organization}/inspectTemplates/{inspect_template}" - # pattern: "projects/{project}/inspectTemplates/{inspect_template}" - # history: ORIGINALLY_SINGLE_PATTERN - # }; - # } - # @!attribute [rw] plural - # @return [::String] - # The plural name used in the resource name and permission names, such as - # 'projects' for the resource name of 'projects/\\{project}' and the permission - # name of 'cloudresourcemanager.googleapis.com/projects.get'. One exception - # to this is for Nested Collections that have stuttering names, as defined - # in [AIP-122](https://google.aip.dev/122#nested-collections), where the - # collection ID in the resource name pattern does not necessarily directly - # match the `plural` value. - # - # It is the same concept of the `plural` field in k8s CRD spec - # https://kubernetes.io/docs/tasks/access-kubernetes-api/custom-resources/custom-resource-definitions/ - # - # Note: The plural form is required even for singleton resources. See - # https://aip.dev/156 - # @!attribute [rw] singular - # @return [::String] - # The same concept of the `singular` field in k8s CRD spec - # https://kubernetes.io/docs/tasks/access-kubernetes-api/custom-resources/custom-resource-definitions/ - # Such as "project" for the `resourcemanager.googleapis.com/Project` type. - # @!attribute [rw] style - # @return [::Array<::Google::Api::ResourceDescriptor::Style>] - # Style flag(s) for this resource. - # These indicate that a resource is expected to conform to a given - # style. See the specific style flags for additional information. - class ResourceDescriptor - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - - # A description of the historical or future-looking state of the - # resource pattern. - module History - # The "unset" value. - HISTORY_UNSPECIFIED = 0 - - # The resource originally had one pattern and launched as such, and - # additional patterns were added later. - ORIGINALLY_SINGLE_PATTERN = 1 - - # The resource has one pattern, but the API owner expects to add more - # later. (This is the inverse of ORIGINALLY_SINGLE_PATTERN, and prevents - # that from being necessary once there are multiple patterns.) - FUTURE_MULTI_PATTERN = 2 - end - - # A flag representing a specific style that a resource claims to conform to. - module Style - # The unspecified value. Do not use. - STYLE_UNSPECIFIED = 0 - - # This resource is intended to be "declarative-friendly". - # - # Declarative-friendly resources must be more strictly consistent, and - # setting this to true communicates to tools that this resource should - # adhere to declarative-friendly expectations. - # - # Note: This is used by the API linter (linter.aip.dev) to enable - # additional checks. - DECLARATIVE_FRIENDLY = 1 - end - end - - # Defines a proto annotation that describes a string field that refers to - # an API resource. - # @!attribute [rw] type - # @return [::String] - # The resource type that the annotated field references. - # - # Example: - # - # message Subscription { - # string topic = 2 [(google.api.resource_reference) = { - # type: "pubsub.googleapis.com/Topic" - # }]; - # } - # - # Occasionally, a field may reference an arbitrary resource. In this case, - # APIs use the special value * in their resource reference. - # - # Example: - # - # message GetIamPolicyRequest { - # string resource = 2 [(google.api.resource_reference) = { - # type: "*" - # }]; - # } - # @!attribute [rw] child_type - # @return [::String] - # The resource type of a child collection that the annotated field - # references. This is useful for annotating the `parent` field that - # doesn't have a fixed resource type. - # - # Example: - # - # message ListLogEntriesRequest { - # string parent = 1 [(google.api.resource_reference) = { - # child_type: "logging.googleapis.com/LogEntry" - # }; - # } - class ResourceReference - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - end -end diff --git a/owl-bot-staging/google-cloud-security_center-v1p1beta1/proto_docs/google/cloud/securitycenter/v1p1beta1/asset.rb b/owl-bot-staging/google-cloud-security_center-v1p1beta1/proto_docs/google/cloud/securitycenter/v1p1beta1/asset.rb deleted file mode 100644 index 84c95aa10132..000000000000 --- a/owl-bot-staging/google-cloud-security_center-v1p1beta1/proto_docs/google/cloud/securitycenter/v1p1beta1/asset.rb +++ /dev/null @@ -1,141 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - - -module Google - module Cloud - module SecurityCenter - module V1p1beta1 - # Security Command Center representation of a Google Cloud - # resource. - # - # The Asset is a Security Command Center resource that captures information - # about a single Google Cloud resource. All modifications to an Asset are only - # within the context of Security Command Center and don't affect the referenced - # Google Cloud resource. - # @!attribute [rw] name - # @return [::String] - # The relative resource name of this asset. See: - # https://cloud.google.com/apis/design/resource_names#relative_resource_name - # Example: - # "organizations/\\{organization_id}/assets/\\{asset_id}". - # @!attribute [rw] security_center_properties - # @return [::Google::Cloud::SecurityCenter::V1p1beta1::Asset::SecurityCenterProperties] - # Security Command Center managed properties. These properties are managed by - # Security Command Center and cannot be modified by the user. - # @!attribute [rw] resource_properties - # @return [::Google::Protobuf::Map{::String => ::Google::Protobuf::Value}] - # Resource managed properties. These properties are managed and defined by - # the Google Cloud resource and cannot be modified by the user. - # @!attribute [rw] security_marks - # @return [::Google::Cloud::SecurityCenter::V1p1beta1::SecurityMarks] - # User specified security marks. These marks are entirely managed by the user - # and come from the SecurityMarks resource that belongs to the asset. - # @!attribute [rw] create_time - # @return [::Google::Protobuf::Timestamp] - # The time at which the asset was created in Security Command Center. - # @!attribute [rw] update_time - # @return [::Google::Protobuf::Timestamp] - # The time at which the asset was last updated or added in Cloud SCC. - # @!attribute [rw] iam_policy - # @return [::Google::Cloud::SecurityCenter::V1p1beta1::Asset::IamPolicy] - # Cloud IAM Policy information associated with the Google Cloud resource - # described by the Security Command Center asset. This information is managed - # and defined by the Google Cloud resource and cannot be modified by the - # user. - # @!attribute [rw] canonical_name - # @return [::String] - # The canonical name of the resource. It's either - # "organizations/\\{organization_id}/assets/\\{asset_id}", - # "folders/\\{folder_id}/assets/\\{asset_id}" or - # "projects/\\{project_number}/assets/\\{asset_id}", depending on the closest CRM - # ancestor of the resource. - class Asset - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - - # Security Command Center managed properties. These properties are managed by - # Security Command Center and cannot be modified by the user. - # @!attribute [rw] resource_name - # @return [::String] - # The full resource name of the Google Cloud resource this asset - # represents. This field is immutable after create time. See: - # https://cloud.google.com/apis/design/resource_names#full_resource_name - # @!attribute [rw] resource_type - # @return [::String] - # The type of the Google Cloud resource. Examples include: APPLICATION, - # PROJECT, and ORGANIZATION. This is a case insensitive field defined by - # Security Command Center and/or the producer of the resource and is - # immutable after create time. - # @!attribute [rw] resource_parent - # @return [::String] - # The full resource name of the immediate parent of the resource. See: - # https://cloud.google.com/apis/design/resource_names#full_resource_name - # @!attribute [rw] resource_project - # @return [::String] - # The full resource name of the project the resource belongs to. See: - # https://cloud.google.com/apis/design/resource_names#full_resource_name - # @!attribute [rw] resource_owners - # @return [::Array<::String>] - # Owners of the Google Cloud resource. - # @!attribute [rw] resource_display_name - # @return [::String] - # The user defined display name for this resource. - # @!attribute [rw] resource_parent_display_name - # @return [::String] - # The user defined display name for the parent of this resource. - # @!attribute [rw] resource_project_display_name - # @return [::String] - # The user defined display name for the project of this resource. - # @!attribute [rw] folders - # @return [::Array<::Google::Cloud::SecurityCenter::V1p1Beta1::Folder>] - # Contains a Folder message for each folder in the assets ancestry. - # The first folder is the deepest nested folder, and the last folder is the - # folder directly under the Organization. - class SecurityCenterProperties - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Cloud IAM Policy information associated with the Google Cloud resource - # described by the Security Command Center asset. This information is managed - # and defined by the Google Cloud resource and cannot be modified by the - # user. - # @!attribute [rw] policy_blob - # @return [::String] - # The JSON representation of the Policy associated with the asset. - # See https://cloud.google.com/iam/docs/reference/rest/v1/Policy for - # format details. - class IamPolicy - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # @!attribute [rw] key - # @return [::String] - # @!attribute [rw] value - # @return [::Google::Protobuf::Value] - class ResourcePropertiesEntry - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - end - end - end - end -end diff --git a/owl-bot-staging/google-cloud-security_center-v1p1beta1/proto_docs/google/cloud/securitycenter/v1p1beta1/finding.rb b/owl-bot-staging/google-cloud-security_center-v1p1beta1/proto_docs/google/cloud/securitycenter/v1p1beta1/finding.rb deleted file mode 100644 index 9308757027de..000000000000 --- a/owl-bot-staging/google-cloud-security_center-v1p1beta1/proto_docs/google/cloud/securitycenter/v1p1beta1/finding.rb +++ /dev/null @@ -1,146 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - - -module Google - module Cloud - module SecurityCenter - module V1p1beta1 - # Security Command Center finding. - # - # A finding is a record of assessment data (security, risk, health or privacy) - # ingested into Security Command Center for presentation, notification, - # analysis, policy testing, and enforcement. For example, an XSS vulnerability - # in an App Engine application is a finding. - # @!attribute [rw] name - # @return [::String] - # The relative resource name of this finding. See: - # https://cloud.google.com/apis/design/resource_names#relative_resource_name - # Example: - # "organizations/\\{organization_id}/sources/\\{source_id}/findings/\\{finding_id}" - # @!attribute [rw] parent - # @return [::String] - # The relative resource name of the source the finding belongs to. See: - # https://cloud.google.com/apis/design/resource_names#relative_resource_name - # This field is immutable after creation time. - # For example: - # "organizations/\\{organization_id}/sources/\\{source_id}" - # @!attribute [rw] resource_name - # @return [::String] - # For findings on Google Cloud resources, the full resource - # name of the Google Cloud resource this finding is for. See: - # https://cloud.google.com/apis/design/resource_names#full_resource_name - # When the finding is for a non-Google Cloud resource, the resourceName can - # be a customer or partner defined string. This field is immutable after - # creation time. - # @!attribute [rw] state - # @return [::Google::Cloud::SecurityCenter::V1p1beta1::Finding::State] - # The state of the finding. - # @!attribute [rw] category - # @return [::String] - # The additional taxonomy group within findings from a given source. - # This field is immutable after creation time. - # Example: "XSS_FLASH_INJECTION" - # @!attribute [rw] external_uri - # @return [::String] - # The URI that, if available, points to a web page outside of Security - # Command Center where additional information about the finding can be found. - # This field is guaranteed to be either empty or a well formed URL. - # @!attribute [rw] source_properties - # @return [::Google::Protobuf::Map{::String => ::Google::Protobuf::Value}] - # Source specific properties. These properties are managed by the source - # that writes the finding. The key names in the source_properties map must be - # between 1 and 255 characters, and must start with a letter and contain - # alphanumeric characters or underscores only. - # @!attribute [r] security_marks - # @return [::Google::Cloud::SecurityCenter::V1p1beta1::SecurityMarks] - # Output only. User specified security marks. These marks are entirely - # managed by the user and come from the SecurityMarks resource that belongs - # to the finding. - # @!attribute [rw] event_time - # @return [::Google::Protobuf::Timestamp] - # The time at which the event took place, or when an update to the finding - # occurred. For example, if the finding represents an open firewall it would - # capture the time the detector believes the firewall became open. The - # accuracy is determined by the detector. If the finding were to be resolved - # afterward, this time would reflect when the finding was resolved. Must not - # be set to a value greater than the current timestamp. - # @!attribute [rw] create_time - # @return [::Google::Protobuf::Timestamp] - # The time at which the finding was created in Security Command Center. - # @!attribute [rw] severity - # @return [::Google::Cloud::SecurityCenter::V1p1beta1::Finding::Severity] - # The severity of the finding. This field is managed by the source that - # writes the finding. - # @!attribute [rw] canonical_name - # @return [::String] - # The canonical name of the finding. It's either - # "organizations/\\{organization_id}/sources/\\{source_id}/findings/\\{finding_id}", - # "folders/\\{folder_id}/sources/\\{source_id}/findings/\\{finding_id}" or - # "projects/\\{project_number}/sources/\\{source_id}/findings/\\{finding_id}", - # depending on the closest CRM ancestor of the resource associated with the - # finding. - class Finding - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - - # @!attribute [rw] key - # @return [::String] - # @!attribute [rw] value - # @return [::Google::Protobuf::Value] - class SourcePropertiesEntry - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # The state of the finding. - module State - # Unspecified state. - STATE_UNSPECIFIED = 0 - - # The finding requires attention and has not been addressed yet. - ACTIVE = 1 - - # The finding has been fixed, triaged as a non-issue or otherwise addressed - # and is no longer active. - INACTIVE = 2 - end - - # The severity of the finding. This field is managed by the source that - # writes the finding. - module Severity - # No severity specified. The default value. - SEVERITY_UNSPECIFIED = 0 - - # Critical severity. - CRITICAL = 1 - - # High severity. - HIGH = 2 - - # Medium severity. - MEDIUM = 3 - - # Low severity. - LOW = 4 - end - end - end - end - end -end diff --git a/owl-bot-staging/google-cloud-security_center-v1p1beta1/proto_docs/google/cloud/securitycenter/v1p1beta1/folder.rb b/owl-bot-staging/google-cloud-security_center-v1p1beta1/proto_docs/google/cloud/securitycenter/v1p1beta1/folder.rb deleted file mode 100644 index f816affff89c..000000000000 --- a/owl-bot-staging/google-cloud-security_center-v1p1beta1/proto_docs/google/cloud/securitycenter/v1p1beta1/folder.rb +++ /dev/null @@ -1,40 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - - -module Google - module Cloud - module SecurityCenter - module V1p1Beta1 - # Message that contains the resource name and display name of a folder - # resource. - # @!attribute [rw] resource_folder - # @return [::String] - # Full resource name of this folder. See: - # https://cloud.google.com/apis/design/resource_names#full_resource_name - # @!attribute [rw] resource_folder_display_name - # @return [::String] - # The user defined display name for this folder. - class Folder - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - end - end - end -end diff --git a/owl-bot-staging/google-cloud-security_center-v1p1beta1/proto_docs/google/cloud/securitycenter/v1p1beta1/notification_config.rb b/owl-bot-staging/google-cloud-security_center-v1p1beta1/proto_docs/google/cloud/securitycenter/v1p1beta1/notification_config.rb deleted file mode 100644 index 5062c0b8e520..000000000000 --- a/owl-bot-staging/google-cloud-security_center-v1p1beta1/proto_docs/google/cloud/securitycenter/v1p1beta1/notification_config.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 Cloud - module SecurityCenter - module V1p1beta1 - # Security Command Center notification configs. - # - # A notification config is a Security Command Center resource that contains the - # configuration to send notifications for create/update events of findings, - # assets and etc. - # @!attribute [rw] name - # @return [::String] - # The relative resource name of this notification config. See: - # https://cloud.google.com/apis/design/resource_names#relative_resource_name - # Example: - # "organizations/\\{organization_id}/notificationConfigs/notify_public_bucket". - # @!attribute [rw] description - # @return [::String] - # The description of the notification config (max of 1024 characters). - # @!attribute [rw] event_type - # @return [::Google::Cloud::SecurityCenter::V1p1beta1::NotificationConfig::EventType] - # The type of events the config is for, e.g. FINDING. - # @!attribute [rw] pubsub_topic - # @return [::String] - # The Pub/Sub topic to send notifications to. Its format is - # "projects/[project_id]/topics/[topic]". - # @!attribute [r] service_account - # @return [::String] - # Output only. The service account that needs "pubsub.topics.publish" - # permission to publish to the Pub/Sub topic. - # @!attribute [rw] streaming_config - # @return [::Google::Cloud::SecurityCenter::V1p1beta1::NotificationConfig::StreamingConfig] - # The config for triggering streaming-based notifications. - class NotificationConfig - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - - # The config for streaming-based notifications, which send each event as soon - # as it is detected. - # @!attribute [rw] filter - # @return [::String] - # Expression that defines the filter to apply across create/update events - # of assets or findings as specified by the event type. The expression is a - # list of zero or more restrictions combined via logical operators `AND` - # and `OR`. Parentheses are supported, and `OR` has higher precedence than - # `AND`. - # - # Restrictions have the form ` ` and may have a - # `-` character in front of them to indicate negation. The fields map to - # those defined in the corresponding resource. - # - # The supported operators are: - # - # * `=` for all value types. - # * `>`, `<`, `>=`, `<=` for integer values. - # * `:`, meaning substring matching, for strings. - # - # The supported value types are: - # - # * string literals in quotes. - # * integer literals without quotes. - # * boolean literals `true` and `false` without quotes. - class StreamingConfig - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # The type of events. - module EventType - # Unspecified event type. - EVENT_TYPE_UNSPECIFIED = 0 - - # Events for findings. - FINDING = 1 - end - end - end - end - end -end diff --git a/owl-bot-staging/google-cloud-security_center-v1p1beta1/proto_docs/google/cloud/securitycenter/v1p1beta1/notification_message.rb b/owl-bot-staging/google-cloud-security_center-v1p1beta1/proto_docs/google/cloud/securitycenter/v1p1beta1/notification_message.rb deleted file mode 100644 index 6948b659b221..000000000000 --- a/owl-bot-staging/google-cloud-security_center-v1p1beta1/proto_docs/google/cloud/securitycenter/v1p1beta1/notification_message.rb +++ /dev/null @@ -1,42 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - - -module Google - module Cloud - module SecurityCenter - module V1p1beta1 - # Security Command Center's Notification - # @!attribute [rw] notification_config_name - # @return [::String] - # Name of the notification config that generated current notification. - # @!attribute [rw] finding - # @return [::Google::Cloud::SecurityCenter::V1p1beta1::Finding] - # If it's a Finding based notification config, this field will be - # populated. - # @!attribute [rw] resource - # @return [::Google::Cloud::SecurityCenter::V1p1beta1::Resource] - # The Cloud resource tied to the notification. - class NotificationMessage - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - end - end - end -end diff --git a/owl-bot-staging/google-cloud-security_center-v1p1beta1/proto_docs/google/cloud/securitycenter/v1p1beta1/organization_settings.rb b/owl-bot-staging/google-cloud-security_center-v1p1beta1/proto_docs/google/cloud/securitycenter/v1p1beta1/organization_settings.rb deleted file mode 100644 index c69cb73d05e1..000000000000 --- a/owl-bot-staging/google-cloud-security_center-v1p1beta1/proto_docs/google/cloud/securitycenter/v1p1beta1/organization_settings.rb +++ /dev/null @@ -1,86 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - - -module Google - module Cloud - module SecurityCenter - module V1p1beta1 - # User specified settings that are attached to the Security Command - # Center organization. - # @!attribute [rw] name - # @return [::String] - # The relative resource name of the settings. See: - # https://cloud.google.com/apis/design/resource_names#relative_resource_name - # Example: - # "organizations/\\{organization_id}/organizationSettings". - # @!attribute [rw] enable_asset_discovery - # @return [::Boolean] - # A flag that indicates if Asset Discovery should be enabled. If the flag is - # set to `true`, then discovery of assets will occur. If it is set to `false, - # all historical assets will remain, but discovery of future assets will not - # occur. - # @!attribute [rw] asset_discovery_config - # @return [::Google::Cloud::SecurityCenter::V1p1beta1::OrganizationSettings::AssetDiscoveryConfig] - # The configuration used for Asset Discovery runs. - class OrganizationSettings - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - - # The configuration used for Asset Discovery runs. - # @!attribute [rw] project_ids - # @return [::Array<::String>] - # The project ids to use for filtering asset discovery. - # @!attribute [rw] inclusion_mode - # @return [::Google::Cloud::SecurityCenter::V1p1beta1::OrganizationSettings::AssetDiscoveryConfig::InclusionMode] - # The mode to use for filtering asset discovery. - # @!attribute [rw] folder_ids - # @return [::Array<::String>] - # The folder ids to use for filtering asset discovery. - # It consists of only digits, e.g., 756619654966. - class AssetDiscoveryConfig - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - - # The mode of inclusion when running Asset Discovery. - # Asset discovery can be limited by explicitly identifying projects to be - # included or excluded. If INCLUDE_ONLY is set, then only those projects - # within the organization and their children are discovered during asset - # discovery. If EXCLUDE is set, then projects that don't match those - # projects are discovered during asset discovery. If neither are set, then - # all projects within the organization are discovered during asset - # discovery. - module InclusionMode - # Unspecified. Setting the mode with this value will disable - # inclusion/exclusion filtering for Asset Discovery. - INCLUSION_MODE_UNSPECIFIED = 0 - - # Asset Discovery will capture only the resources within the projects - # specified. All other resources will be ignored. - INCLUDE_ONLY = 1 - - # Asset Discovery will ignore all resources under the projects specified. - # All other resources will be retrieved. - EXCLUDE = 2 - end - end - end - end - end - end -end diff --git a/owl-bot-staging/google-cloud-security_center-v1p1beta1/proto_docs/google/cloud/securitycenter/v1p1beta1/resource.rb b/owl-bot-staging/google-cloud-security_center-v1p1beta1/proto_docs/google/cloud/securitycenter/v1p1beta1/resource.rb deleted file mode 100644 index 0fe81011a51b..000000000000 --- a/owl-bot-staging/google-cloud-security_center-v1p1beta1/proto_docs/google/cloud/securitycenter/v1p1beta1/resource.rb +++ /dev/null @@ -1,53 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - - -module Google - module Cloud - module SecurityCenter - module V1p1beta1 - # Information related to the Google Cloud resource. - # @!attribute [rw] name - # @return [::String] - # The full resource name of the resource. See: - # https://cloud.google.com/apis/design/resource_names#full_resource_name - # @!attribute [rw] project - # @return [::String] - # The full resource name of project that the resource belongs to. - # @!attribute [rw] project_display_name - # @return [::String] - # The human readable name of project that the resource belongs to. - # @!attribute [rw] parent - # @return [::String] - # The full resource name of resource's parent. - # @!attribute [rw] parent_display_name - # @return [::String] - # The human readable name of resource's parent. - # @!attribute [r] folders - # @return [::Array<::Google::Cloud::SecurityCenter::V1p1Beta1::Folder>] - # Output only. Contains a Folder message for each folder in the assets ancestry. - # The first folder is the deepest nested folder, and the last folder is the - # folder directly under the Organization. - class Resource - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - end - end - end -end diff --git a/owl-bot-staging/google-cloud-security_center-v1p1beta1/proto_docs/google/cloud/securitycenter/v1p1beta1/run_asset_discovery_response.rb b/owl-bot-staging/google-cloud-security_center-v1p1beta1/proto_docs/google/cloud/securitycenter/v1p1beta1/run_asset_discovery_response.rb deleted file mode 100644 index ed38b84c1d65..000000000000 --- a/owl-bot-staging/google-cloud-security_center-v1p1beta1/proto_docs/google/cloud/securitycenter/v1p1beta1/run_asset_discovery_response.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! - - -module Google - module Cloud - module SecurityCenter - module V1p1beta1 - # Response of asset discovery run - # @!attribute [rw] state - # @return [::Google::Cloud::SecurityCenter::V1p1beta1::RunAssetDiscoveryResponse::State] - # The state of an asset discovery run. - # @!attribute [rw] duration - # @return [::Google::Protobuf::Duration] - # The duration between asset discovery run start and end - class RunAssetDiscoveryResponse - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - - # The state of an asset discovery run. - module State - # Asset discovery run state was unspecified. - STATE_UNSPECIFIED = 0 - - # Asset discovery run completed successfully. - COMPLETED = 1 - - # Asset discovery run was cancelled with tasks still pending, as another - # run for the same organization was started with a higher priority. - SUPERSEDED = 2 - - # Asset discovery run was killed and terminated. - TERMINATED = 3 - end - end - end - end - end -end diff --git a/owl-bot-staging/google-cloud-security_center-v1p1beta1/proto_docs/google/cloud/securitycenter/v1p1beta1/security_marks.rb b/owl-bot-staging/google-cloud-security_center-v1p1beta1/proto_docs/google/cloud/securitycenter/v1p1beta1/security_marks.rb deleted file mode 100644 index db78ba561912..000000000000 --- a/owl-bot-staging/google-cloud-security_center-v1p1beta1/proto_docs/google/cloud/securitycenter/v1p1beta1/security_marks.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 Cloud - module SecurityCenter - module V1p1beta1 - # User specified security marks that are attached to the parent Security - # Command Center resource. Security marks are scoped within a Security Command - # Center organization -- they can be modified and viewed by all users who have - # proper permissions on the organization. - # @!attribute [rw] name - # @return [::String] - # The relative resource name of the SecurityMarks. See: - # https://cloud.google.com/apis/design/resource_names#relative_resource_name - # Examples: - # "organizations/\\{organization_id}/assets/\\{asset_id}/securityMarks" - # "organizations/\\{organization_id}/sources/\\{source_id}/findings/\\{finding_id}/securityMarks". - # @!attribute [rw] marks - # @return [::Google::Protobuf::Map{::String => ::String}] - # Mutable user specified security marks belonging to the parent resource. - # Constraints are as follows: - # - # * Keys and values are treated as case insensitive - # * Keys must be between 1 - 256 characters (inclusive) - # * Keys must be letters, numbers, underscores, or dashes - # * Values have leading and trailing whitespace trimmed, remaining - # characters must be between 1 - 4096 characters (inclusive) - # @!attribute [rw] canonical_name - # @return [::String] - # The canonical name of the marks. - # Examples: - # "organizations/\\{organization_id}/assets/\\{asset_id}/securityMarks" - # "folders/\\{folder_id}/assets/\\{asset_id}/securityMarks" - # "projects/\\{project_number}/assets/\\{asset_id}/securityMarks" - # "organizations/\\{organization_id}/sources/\\{source_id}/findings/\\{finding_id}/securityMarks" - # "folders/\\{folder_id}/sources/\\{source_id}/findings/\\{finding_id}/securityMarks" - # "projects/\\{project_number}/sources/\\{source_id}/findings/\\{finding_id}/securityMarks" - class SecurityMarks - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - - # @!attribute [rw] key - # @return [::String] - # @!attribute [rw] value - # @return [::String] - class MarksEntry - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - end - end - end - end -end diff --git a/owl-bot-staging/google-cloud-security_center-v1p1beta1/proto_docs/google/cloud/securitycenter/v1p1beta1/securitycenter_service.rb b/owl-bot-staging/google-cloud-security_center-v1p1beta1/proto_docs/google/cloud/securitycenter/v1p1beta1/securitycenter_service.rb deleted file mode 100644 index a2252480add8..000000000000 --- a/owl-bot-staging/google-cloud-security_center-v1p1beta1/proto_docs/google/cloud/securitycenter/v1p1beta1/securitycenter_service.rb +++ /dev/null @@ -1,1053 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - - -module Google - module Cloud - module SecurityCenter - module V1p1beta1 - # Request message for creating a finding. - # @!attribute [rw] parent - # @return [::String] - # Required. Resource name of the new finding's parent. Its format should be - # "organizations/[organization_id]/sources/[source_id]". - # @!attribute [rw] finding_id - # @return [::String] - # Required. Unique identifier provided by the client within the parent scope. - # @!attribute [rw] finding - # @return [::Google::Cloud::SecurityCenter::V1p1beta1::Finding] - # Required. The Finding being created. The name and security_marks will be ignored as - # they are both output only fields on this resource. - class CreateFindingRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Request message for creating a notification config. - # @!attribute [rw] parent - # @return [::String] - # Required. Resource name of the new notification config's parent. Its format is - # "organizations/[organization_id]". - # @!attribute [rw] config_id - # @return [::String] - # Required. Unique identifier provided by the client within the parent scope. - # It must be between 1 and 128 characters, and contains alphanumeric - # characters, underscores or hyphens only. - # @!attribute [rw] notification_config - # @return [::Google::Cloud::SecurityCenter::V1p1beta1::NotificationConfig] - # Required. The notification config being created. The name and the service account - # will be ignored as they are both output only fields on this resource. - class CreateNotificationConfigRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Request message for creating a source. - # @!attribute [rw] parent - # @return [::String] - # Required. Resource name of the new source's parent. Its format should be - # "organizations/[organization_id]". - # @!attribute [rw] source - # @return [::Google::Cloud::SecurityCenter::V1p1beta1::Source] - # Required. The Source being created, only the display_name and description will be - # used. All other fields will be ignored. - class CreateSourceRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Request message for deleting a notification config. - # @!attribute [rw] name - # @return [::String] - # Required. Name of the notification config to delete. Its format is - # "organizations/[organization_id]/notificationConfigs/[config_id]". - class DeleteNotificationConfigRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Request message for getting a notification config. - # @!attribute [rw] name - # @return [::String] - # Required. Name of the notification config to get. Its format is - # "organizations/[organization_id]/notificationConfigs/[config_id]". - class GetNotificationConfigRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Request message for getting organization settings. - # @!attribute [rw] name - # @return [::String] - # Required. Name of the organization to get organization settings for. Its format is - # "organizations/[organization_id]/organizationSettings". - class GetOrganizationSettingsRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Request message for getting a source. - # @!attribute [rw] name - # @return [::String] - # Required. Relative resource name of the source. Its format is - # "organizations/[organization_id]/source/[source_id]". - class GetSourceRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Request message for grouping by assets. - # @!attribute [rw] parent - # @return [::String] - # Required. Name of the organization to groupBy. Its format is - # "organizations/[organization_id], folders/[folder_id], or - # projects/[project_id]". - # @!attribute [rw] filter - # @return [::String] - # Expression that defines the filter to apply across assets. - # The expression is a list of zero or more restrictions combined via logical - # operators `AND` and `OR`. - # Parentheses are supported, and `OR` has higher precedence than `AND`. - # - # Restrictions have the form ` ` and may have a `-` - # character in front of them to indicate negation. The fields map to those - # defined in the Asset resource. Examples include: - # - # * name - # * security_center_properties.resource_name - # * resource_properties.a_property - # * security_marks.marks.marka - # - # The supported operators are: - # - # * `=` for all value types. - # * `>`, `<`, `>=`, `<=` for integer values. - # * `:`, meaning substring matching, for strings. - # - # The supported value types are: - # - # * string literals in quotes. - # * integer literals without quotes. - # * boolean literals `true` and `false` without quotes. - # - # The following field and operator combinations are supported: - # - # * name: `=` - # * update_time: `=`, `>`, `<`, `>=`, `<=` - # - # Usage: This should be milliseconds since epoch or an RFC3339 string. - # Examples: - # `update_time = "2019-06-10T16:07:18-07:00"` - # `update_time = 1560208038000` - # - # * create_time: `=`, `>`, `<`, `>=`, `<=` - # - # Usage: This should be milliseconds since epoch or an RFC3339 string. - # Examples: - # `create_time = "2019-06-10T16:07:18-07:00"` - # `create_time = 1560208038000` - # - # * iam_policy.policy_blob: `=`, `:` - # * resource_properties: `=`, `:`, `>`, `<`, `>=`, `<=` - # * security_marks.marks: `=`, `:` - # * security_center_properties.resource_name: `=`, `:` - # * security_center_properties.resource_name_display_name: `=`, `:` - # * security_center_properties.resource_type: `=`, `:` - # * security_center_properties.resource_parent: `=`, `:` - # * security_center_properties.resource_parent_display_name: `=`, `:` - # * security_center_properties.resource_project: `=`, `:` - # * security_center_properties.resource_project_display_name: `=`, `:` - # * security_center_properties.resource_owners: `=`, `:` - # - # For example, `resource_properties.size = 100` is a valid filter string. - # - # Use a partial match on the empty string to filter based on a property - # existing: `resource_properties.my_property : ""` - # - # Use a negated partial match on the empty string to filter based on a - # property not existing: `-resource_properties.my_property : ""` - # @!attribute [rw] group_by - # @return [::String] - # Required. Expression that defines what assets fields to use for grouping. The string - # value should follow SQL syntax: comma separated list of fields. For - # example: - # "security_center_properties.resource_project,security_center_properties.project". - # - # The following fields are supported when compare_duration is not set: - # - # * security_center_properties.resource_project - # * security_center_properties.resource_project_display_name - # * security_center_properties.resource_type - # * security_center_properties.resource_parent - # * security_center_properties.resource_parent_display_name - # - # The following fields are supported when compare_duration is set: - # - # * security_center_properties.resource_type - # * security_center_properties.resource_project_display_name - # * security_center_properties.resource_parent_display_name - # @!attribute [rw] compare_duration - # @return [::Google::Protobuf::Duration] - # When compare_duration is set, the GroupResult's "state_change" property is - # updated to indicate whether the asset was added, removed, or remained - # present during the compare_duration period of time that precedes the - # read_time. This is the time between (read_time - compare_duration) and - # read_time. - # - # The state change value is derived based on the presence of the asset at the - # two points in time. Intermediate state changes between the two times don't - # affect the result. For example, the results aren't affected if the asset is - # removed and re-created again. - # - # Possible "state_change" values when compare_duration is specified: - # - # * "ADDED": indicates that the asset was not present at the start of - # compare_duration, but present at reference_time. - # * "REMOVED": indicates that the asset was present at the start of - # compare_duration, but not present at reference_time. - # * "ACTIVE": indicates that the asset was present at both the - # start and the end of the time period defined by - # compare_duration and reference_time. - # - # If compare_duration is not specified, then the only possible state_change - # is "UNUSED", which will be the state_change set for all assets present at - # read_time. - # - # If this field is set then `state_change` must be a specified field in - # `group_by`. - # @!attribute [rw] read_time - # @return [::Google::Protobuf::Timestamp] - # Time used as a reference point when filtering assets. The filter is limited - # to assets existing at the supplied time and their values are those at that - # specific time. Absence of this field will default to the API's version of - # NOW. - # @!attribute [rw] page_token - # @return [::String] - # The value returned by the last `GroupAssetsResponse`; indicates - # that this is a continuation of a prior `GroupAssets` call, and that the - # system should return the next page of data. - # @!attribute [rw] page_size - # @return [::Integer] - # The maximum number of results to return in a single response. Default is - # 10, minimum is 1, maximum is 1000. - class GroupAssetsRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Response message for grouping by assets. - # @!attribute [rw] group_by_results - # @return [::Array<::Google::Cloud::SecurityCenter::V1p1beta1::GroupResult>] - # Group results. There exists an element for each existing unique - # combination of property/values. The element contains a count for the number - # of times those specific property/values appear. - # @!attribute [rw] read_time - # @return [::Google::Protobuf::Timestamp] - # Time used for executing the groupBy request. - # @!attribute [rw] next_page_token - # @return [::String] - # Token to retrieve the next page of results, or empty if there are no more - # results. - # @!attribute [rw] total_size - # @return [::Integer] - # The total number of results matching the query. - class GroupAssetsResponse - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Request message for grouping by findings. - # @!attribute [rw] parent - # @return [::String] - # Required. Name of the source to groupBy. Its format is - # "organizations/[organization_id]/sources/[source_id]", - # folders/[folder_id]/sources/[source_id], or - # projects/[project_id]/sources/[source_id]. To groupBy across all sources - # provide a source_id of `-`. For example: - # organizations/\\{organization_id}/sources/-, folders/\\{folder_id}/sources/-, - # or projects/\\{project_id}/sources/- - # @!attribute [rw] filter - # @return [::String] - # Expression that defines the filter to apply across findings. - # The expression is a list of one or more restrictions combined via logical - # operators `AND` and `OR`. - # Parentheses are supported, and `OR` has higher precedence than `AND`. - # - # Restrictions have the form ` ` and may have a `-` - # character in front of them to indicate negation. Examples include: - # - # * name - # * source_properties.a_property - # * security_marks.marks.marka - # - # The supported operators are: - # - # * `=` for all value types. - # * `>`, `<`, `>=`, `<=` for integer values. - # * `:`, meaning substring matching, for strings. - # - # The supported value types are: - # - # * string literals in quotes. - # * integer literals without quotes. - # * boolean literals `true` and `false` without quotes. - # - # The following field and operator combinations are supported: - # - # * name: `=` - # * parent: `=`, `:` - # * resource_name: `=`, `:` - # * state: `=`, `:` - # * category: `=`, `:` - # * external_uri: `=`, `:` - # * event_time: `=`, `>`, `<`, `>=`, `<=` - # * severity: `=`, `:` - # - # Usage: This should be milliseconds since epoch or an RFC3339 string. - # Examples: - # `event_time = "2019-06-10T16:07:18-07:00"` - # `event_time = 1560208038000` - # - # * security_marks.marks: `=`, `:` - # * source_properties: `=`, `:`, `>`, `<`, `>=`, `<=` - # - # For example, `source_properties.size = 100` is a valid filter string. - # - # Use a partial match on the empty string to filter based on a property - # existing: `source_properties.my_property : ""` - # - # Use a negated partial match on the empty string to filter based on a - # property not existing: `-source_properties.my_property : ""` - # @!attribute [rw] group_by - # @return [::String] - # Required. Expression that defines what assets fields to use for grouping (including - # `state_change`). The string value should follow SQL syntax: comma separated - # list of fields. For example: "parent,resource_name". - # - # The following fields are supported: - # - # * resource_name - # * category - # * state - # * parent - # * severity - # - # The following fields are supported when compare_duration is set: - # - # * state_change - # @!attribute [rw] read_time - # @return [::Google::Protobuf::Timestamp] - # Time used as a reference point when filtering findings. The filter is - # limited to findings existing at the supplied time and their values are - # those at that specific time. Absence of this field will default to the - # API's version of NOW. - # @!attribute [rw] compare_duration - # @return [::Google::Protobuf::Duration] - # When compare_duration is set, the GroupResult's "state_change" attribute is - # updated to indicate whether the finding had its state changed, the - # finding's state remained unchanged, or if the finding was added during the - # compare_duration period of time that precedes the read_time. This is the - # time between (read_time - compare_duration) and read_time. - # - # The state_change value is derived based on the presence and state of the - # finding at the two points in time. Intermediate state changes between the - # two times don't affect the result. For example, the results aren't affected - # if the finding is made inactive and then active again. - # - # Possible "state_change" values when compare_duration is specified: - # - # * "CHANGED": indicates that the finding was present and matched the given - # filter at the start of compare_duration, but changed its - # state at read_time. - # * "UNCHANGED": indicates that the finding was present and matched the given - # filter at the start of compare_duration and did not change - # state at read_time. - # * "ADDED": indicates that the finding did not match the given filter or - # was not present at the start of compare_duration, but was - # present at read_time. - # * "REMOVED": indicates that the finding was present and matched the - # filter at the start of compare_duration, but did not match - # the filter at read_time. - # - # If compare_duration is not specified, then the only possible state_change - # is "UNUSED", which will be the state_change set for all findings present - # at read_time. - # - # If this field is set then `state_change` must be a specified field in - # `group_by`. - # @!attribute [rw] page_token - # @return [::String] - # The value returned by the last `GroupFindingsResponse`; indicates - # that this is a continuation of a prior `GroupFindings` call, and - # that the system should return the next page of data. - # @!attribute [rw] page_size - # @return [::Integer] - # The maximum number of results to return in a single response. Default is - # 10, minimum is 1, maximum is 1000. - class GroupFindingsRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Response message for group by findings. - # @!attribute [rw] group_by_results - # @return [::Array<::Google::Cloud::SecurityCenter::V1p1beta1::GroupResult>] - # Group results. There exists an element for each existing unique - # combination of property/values. The element contains a count for the number - # of times those specific property/values appear. - # @!attribute [rw] read_time - # @return [::Google::Protobuf::Timestamp] - # Time used for executing the groupBy request. - # @!attribute [rw] next_page_token - # @return [::String] - # Token to retrieve the next page of results, or empty if there are no more - # results. - # @!attribute [rw] total_size - # @return [::Integer] - # The total number of results matching the query. - class GroupFindingsResponse - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Result containing the properties and count of a groupBy request. - # @!attribute [rw] properties - # @return [::Google::Protobuf::Map{::String => ::Google::Protobuf::Value}] - # Properties matching the groupBy fields in the request. - # @!attribute [rw] count - # @return [::Integer] - # Total count of resources for the given properties. - class GroupResult - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - - # @!attribute [rw] key - # @return [::String] - # @!attribute [rw] value - # @return [::Google::Protobuf::Value] - class PropertiesEntry - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - end - - # Request message for listing notification configs. - # @!attribute [rw] parent - # @return [::String] - # Required. Name of the organization to list notification configs. - # Its format is "organizations/[organization_id]". - # @!attribute [rw] page_token - # @return [::String] - # The value returned by the last `ListNotificationConfigsResponse`; indicates - # that this is a continuation of a prior `ListNotificationConfigs` call, and - # that the system should return the next page of data. - # @!attribute [rw] page_size - # @return [::Integer] - # The maximum number of results to return in a single response. Default is - # 10, minimum is 1, maximum is 1000. - class ListNotificationConfigsRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Response message for listing notification configs. - # @!attribute [rw] notification_configs - # @return [::Array<::Google::Cloud::SecurityCenter::V1p1beta1::NotificationConfig>] - # Notification configs belonging to the requested parent. - # @!attribute [rw] next_page_token - # @return [::String] - # Token to retrieve the next page of results, or empty if there are no more - # results. - class ListNotificationConfigsResponse - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Request message for listing sources. - # @!attribute [rw] parent - # @return [::String] - # Required. Resource name of the parent of sources to list. Its format should be - # "organizations/[organization_id], folders/[folder_id], or - # projects/[project_id]". - # @!attribute [rw] page_token - # @return [::String] - # The value returned by the last `ListSourcesResponse`; indicates - # that this is a continuation of a prior `ListSources` call, and - # that the system should return the next page of data. - # @!attribute [rw] page_size - # @return [::Integer] - # The maximum number of results to return in a single response. Default is - # 10, minimum is 1, maximum is 1000. - class ListSourcesRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Response message for listing sources. - # @!attribute [rw] sources - # @return [::Array<::Google::Cloud::SecurityCenter::V1p1beta1::Source>] - # Sources belonging to the requested parent. - # @!attribute [rw] next_page_token - # @return [::String] - # Token to retrieve the next page of results, or empty if there are no more - # results. - class ListSourcesResponse - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Request message for listing assets. - # @!attribute [rw] parent - # @return [::String] - # Required. Name of the organization assets should belong to. Its format is - # "organizations/[organization_id], folders/[folder_id], or - # projects/[project_id]". - # @!attribute [rw] filter - # @return [::String] - # Expression that defines the filter to apply across assets. - # The expression is a list of zero or more restrictions combined via logical - # operators `AND` and `OR`. - # Parentheses are supported, and `OR` has higher precedence than `AND`. - # - # Restrictions have the form ` ` and may have a `-` - # character in front of them to indicate negation. The fields map to those - # defined in the Asset resource. Examples include: - # - # * name - # * security_center_properties.resource_name - # * resource_properties.a_property - # * security_marks.marks.marka - # - # The supported operators are: - # - # * `=` for all value types. - # * `>`, `<`, `>=`, `<=` for integer values. - # * `:`, meaning substring matching, for strings. - # - # The supported value types are: - # - # * string literals in quotes. - # * integer literals without quotes. - # * boolean literals `true` and `false` without quotes. - # - # The following are the allowed field and operator combinations: - # - # * name: `=` - # * update_time: `=`, `>`, `<`, `>=`, `<=` - # - # Usage: This should be milliseconds since epoch or an RFC3339 string. - # Examples: - # `update_time = "2019-06-10T16:07:18-07:00"` - # `update_time = 1560208038000` - # - # * create_time: `=`, `>`, `<`, `>=`, `<=` - # - # Usage: This should be milliseconds since epoch or an RFC3339 string. - # Examples: - # `create_time = "2019-06-10T16:07:18-07:00"` - # `create_time = 1560208038000` - # - # * iam_policy.policy_blob: `=`, `:` - # * resource_properties: `=`, `:`, `>`, `<`, `>=`, `<=` - # * security_marks.marks: `=`, `:` - # * security_center_properties.resource_name: `=`, `:` - # * security_center_properties.resource_display_name: `=`, `:` - # * security_center_properties.resource_type: `=`, `:` - # * security_center_properties.resource_parent: `=`, `:` - # * security_center_properties.resource_parent_display_name: `=`, `:` - # * security_center_properties.resource_project: `=`, `:` - # * security_center_properties.resource_project_display_name: `=`, `:` - # * security_center_properties.resource_owners: `=`, `:` - # - # For example, `resource_properties.size = 100` is a valid filter string. - # - # Use a partial match on the empty string to filter based on a property - # existing: `resource_properties.my_property : ""` - # - # Use a negated partial match on the empty string to filter based on a - # property not existing: `-resource_properties.my_property : ""` - # @!attribute [rw] order_by - # @return [::String] - # Expression that defines what fields and order to use for sorting. The - # string value should follow SQL syntax: comma separated list of fields. For - # example: "name,resource_properties.a_property". The default sorting order - # is ascending. To specify descending order for a field, a suffix " desc" - # should be appended to the field name. For example: "name - # desc,resource_properties.a_property". Redundant space characters in the - # syntax are insignificant. "name desc,resource_properties.a_property" and " - # name desc , resource_properties.a_property " are equivalent. - # - # The following fields are supported: - # name - # update_time - # resource_properties - # security_marks.marks - # security_center_properties.resource_name - # security_center_properties.resource_display_name - # security_center_properties.resource_parent - # security_center_properties.resource_parent_display_name - # security_center_properties.resource_project - # security_center_properties.resource_project_display_name - # security_center_properties.resource_type - # @!attribute [rw] read_time - # @return [::Google::Protobuf::Timestamp] - # Time used as a reference point when filtering assets. The filter is limited - # to assets existing at the supplied time and their values are those at that - # specific time. Absence of this field will default to the API's version of - # NOW. - # @!attribute [rw] compare_duration - # @return [::Google::Protobuf::Duration] - # When compare_duration is set, the ListAssetsResult's "state_change" - # attribute is updated to indicate whether the asset was added, removed, or - # remained present during the compare_duration period of time that precedes - # the read_time. This is the time between (read_time - compare_duration) and - # read_time. - # - # The state_change value is derived based on the presence of the asset at the - # two points in time. Intermediate state changes between the two times don't - # affect the result. For example, the results aren't affected if the asset is - # removed and re-created again. - # - # Possible "state_change" values when compare_duration is specified: - # - # * "ADDED": indicates that the asset was not present at the start of - # compare_duration, but present at read_time. - # * "REMOVED": indicates that the asset was present at the start of - # compare_duration, but not present at read_time. - # * "ACTIVE": indicates that the asset was present at both the - # start and the end of the time period defined by - # compare_duration and read_time. - # - # If compare_duration is not specified, then the only possible state_change - # is "UNUSED", which will be the state_change set for all assets present at - # read_time. - # @!attribute [rw] field_mask - # @return [::Google::Protobuf::FieldMask] - # A field mask to specify the ListAssetsResult fields to be listed in the - # response. - # An empty field mask will list all fields. - # @!attribute [rw] page_token - # @return [::String] - # The value returned by the last `ListAssetsResponse`; indicates - # that this is a continuation of a prior `ListAssets` call, and - # that the system should return the next page of data. - # @!attribute [rw] page_size - # @return [::Integer] - # The maximum number of results to return in a single response. Default is - # 10, minimum is 1, maximum is 1000. - class ListAssetsRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Response message for listing assets. - # @!attribute [rw] list_assets_results - # @return [::Array<::Google::Cloud::SecurityCenter::V1p1beta1::ListAssetsResponse::ListAssetsResult>] - # Assets matching the list request. - # @!attribute [rw] read_time - # @return [::Google::Protobuf::Timestamp] - # Time used for executing the list request. - # @!attribute [rw] next_page_token - # @return [::String] - # Token to retrieve the next page of results, or empty if there are no more - # results. - # @!attribute [rw] total_size - # @return [::Integer] - # The total number of assets matching the query. - class ListAssetsResponse - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - - # Result containing the Asset and its State. - # @!attribute [rw] asset - # @return [::Google::Cloud::SecurityCenter::V1p1beta1::Asset] - # Asset matching the search request. - # @!attribute [rw] state_change - # @return [::Google::Cloud::SecurityCenter::V1p1beta1::ListAssetsResponse::ListAssetsResult::StateChange] - # State change of the asset between the points in time. - class ListAssetsResult - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - - # The change in state of the asset. - # - # When querying across two points in time this describes - # the change between the two points: ADDED, REMOVED, or ACTIVE. - # If there was no compare_duration supplied in the request the state change - # will be: UNUSED - module StateChange - # State change is unused, this is the canonical default for this enum. - UNUSED = 0 - - # Asset was added between the points in time. - ADDED = 1 - - # Asset was removed between the points in time. - REMOVED = 2 - - # Asset was present at both point(s) in time. - ACTIVE = 3 - end - end - end - - # Request message for listing findings. - # @!attribute [rw] parent - # @return [::String] - # Required. Name of the source the findings belong to. Its format is - # "organizations/[organization_id]/sources/[source_id], - # folders/[folder_id]/sources/[source_id], or - # projects/[project_id]/sources/[source_id]". To list across all sources - # provide a source_id of `-`. For example: - # organizations/\\{organization_id}/sources/-, folders/\\{folder_id}/sources/- or - # projects/\\{projects_id}/sources/- - # @!attribute [rw] filter - # @return [::String] - # Expression that defines the filter to apply across findings. - # The expression is a list of one or more restrictions combined via logical - # operators `AND` and `OR`. - # Parentheses are supported, and `OR` has higher precedence than `AND`. - # - # Restrictions have the form ` ` and may have a `-` - # character in front of them to indicate negation. Examples include: - # - # * name - # * source_properties.a_property - # * security_marks.marks.marka - # - # The supported operators are: - # - # * `=` for all value types. - # * `>`, `<`, `>=`, `<=` for integer values. - # * `:`, meaning substring matching, for strings. - # - # The supported value types are: - # - # * string literals in quotes. - # * integer literals without quotes. - # * boolean literals `true` and `false` without quotes. - # - # The following field and operator combinations are supported: - # - # * name: `=` - # * parent: `=`, `:` - # * resource_name: `=`, `:` - # * state: `=`, `:` - # * category: `=`, `:` - # * external_uri: `=`, `:` - # * event_time: `=`, `>`, `<`, `>=`, `<=` - # * severity: `=`, `:` - # - # Usage: This should be milliseconds since epoch or an RFC3339 string. - # Examples: - # `event_time = "2019-06-10T16:07:18-07:00"` - # `event_time = 1560208038000` - # - # security_marks.marks: `=`, `:` - # source_properties: `=`, `:`, `>`, `<`, `>=`, `<=` - # - # For example, `source_properties.size = 100` is a valid filter string. - # - # Use a partial match on the empty string to filter based on a property - # existing: `source_properties.my_property : ""` - # - # Use a negated partial match on the empty string to filter based on a - # property not existing: `-source_properties.my_property : ""` - # @!attribute [rw] order_by - # @return [::String] - # Expression that defines what fields and order to use for sorting. The - # string value should follow SQL syntax: comma separated list of fields. For - # example: "name,resource_properties.a_property". The default sorting order - # is ascending. To specify descending order for a field, a suffix " desc" - # should be appended to the field name. For example: "name - # desc,source_properties.a_property". Redundant space characters in the - # syntax are insignificant. "name desc,source_properties.a_property" and " - # name desc , source_properties.a_property " are equivalent. - # - # The following fields are supported: - # name - # parent - # state - # category - # resource_name - # event_time - # source_properties - # security_marks.marks - # @!attribute [rw] read_time - # @return [::Google::Protobuf::Timestamp] - # Time used as a reference point when filtering findings. The filter is - # limited to findings existing at the supplied time and their values are - # those at that specific time. Absence of this field will default to the - # API's version of NOW. - # @!attribute [rw] compare_duration - # @return [::Google::Protobuf::Duration] - # When compare_duration is set, the ListFindingsResult's "state_change" - # attribute is updated to indicate whether the finding had its state changed, - # the finding's state remained unchanged, or if the finding was added in any - # state during the compare_duration period of time that precedes the - # read_time. This is the time between (read_time - compare_duration) and - # read_time. - # - # The state_change value is derived based on the presence and state of the - # finding at the two points in time. Intermediate state changes between the - # two times don't affect the result. For example, the results aren't affected - # if the finding is made inactive and then active again. - # - # Possible "state_change" values when compare_duration is specified: - # - # * "CHANGED": indicates that the finding was present and matched the given - # filter at the start of compare_duration, but changed its - # state at read_time. - # * "UNCHANGED": indicates that the finding was present and matched the given - # filter at the start of compare_duration and did not change - # state at read_time. - # * "ADDED": indicates that the finding did not match the given filter or - # was not present at the start of compare_duration, but was - # present at read_time. - # * "REMOVED": indicates that the finding was present and matched the - # filter at the start of compare_duration, but did not match - # the filter at read_time. - # - # If compare_duration is not specified, then the only possible state_change - # is "UNUSED", which will be the state_change set for all findings present at - # read_time. - # @!attribute [rw] field_mask - # @return [::Google::Protobuf::FieldMask] - # A field mask to specify the Finding fields to be listed in the response. - # An empty field mask will list all fields. - # @!attribute [rw] page_token - # @return [::String] - # The value returned by the last `ListFindingsResponse`; indicates - # that this is a continuation of a prior `ListFindings` call, and - # that the system should return the next page of data. - # @!attribute [rw] page_size - # @return [::Integer] - # The maximum number of results to return in a single response. Default is - # 10, minimum is 1, maximum is 1000. - class ListFindingsRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Response message for listing findings. - # @!attribute [rw] list_findings_results - # @return [::Array<::Google::Cloud::SecurityCenter::V1p1beta1::ListFindingsResponse::ListFindingsResult>] - # Findings matching the list request. - # @!attribute [rw] read_time - # @return [::Google::Protobuf::Timestamp] - # Time used for executing the list request. - # @!attribute [rw] next_page_token - # @return [::String] - # Token to retrieve the next page of results, or empty if there are no more - # results. - # @!attribute [rw] total_size - # @return [::Integer] - # The total number of findings matching the query. - class ListFindingsResponse - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - - # Result containing the Finding and its StateChange. - # @!attribute [rw] finding - # @return [::Google::Cloud::SecurityCenter::V1p1beta1::Finding] - # Finding matching the search request. - # @!attribute [rw] state_change - # @return [::Google::Cloud::SecurityCenter::V1p1beta1::ListFindingsResponse::ListFindingsResult::StateChange] - # State change of the finding between the points in time. - # @!attribute [r] resource - # @return [::Google::Cloud::SecurityCenter::V1p1beta1::ListFindingsResponse::ListFindingsResult::Resource] - # Output only. Resource that is associated with this finding. - class ListFindingsResult - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - - # Information related to the Google Cloud resource that is - # associated with this finding. - # @!attribute [rw] name - # @return [::String] - # The full resource name of the resource. See: - # https://cloud.google.com/apis/design/resource_names#full_resource_name - # @!attribute [rw] project_name - # @return [::String] - # The full resource name of project that the resource belongs to. - # @!attribute [rw] project_display_name - # @return [::String] - # The human readable name of project that the resource belongs to. - # @!attribute [rw] parent_name - # @return [::String] - # The full resource name of resource's parent. - # @!attribute [rw] parent_display_name - # @return [::String] - # The human readable name of resource's parent. - # @!attribute [rw] folders - # @return [::Array<::Google::Cloud::SecurityCenter::V1p1Beta1::Folder>] - # Contains a Folder message for each folder in the assets ancestry. - # The first folder is the deepest nested folder, and the last folder is - # the folder directly under the Organization. - class Resource - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # The change in state of the finding. - # - # When querying across two points in time this describes - # the change in the finding between the two points: CHANGED, UNCHANGED, - # ADDED, or REMOVED. Findings can not be deleted, so REMOVED implies that - # the finding at timestamp does not match the filter specified, but it did - # at timestamp - compare_duration. If there was no compare_duration - # supplied in the request the state change will be: UNUSED - module StateChange - # State change is unused, this is the canonical default for this enum. - UNUSED = 0 - - # The finding has changed state in some way between the points in time - # and existed at both points. - CHANGED = 1 - - # The finding has not changed state between the points in time and - # existed at both points. - UNCHANGED = 2 - - # The finding was created between the points in time. - ADDED = 3 - - # The finding at timestamp does not match the filter specified, but it - # did at timestamp - compare_duration. - REMOVED = 4 - end - end - end - - # Request message for updating a finding's state. - # @!attribute [rw] name - # @return [::String] - # Required. The relative resource name of the finding. See: - # https://cloud.google.com/apis/design/resource_names#relative_resource_name - # Example: - # "organizations/\\{organization_id}/sources/\\{source_id}/finding/\\{finding_id}". - # @!attribute [rw] state - # @return [::Google::Cloud::SecurityCenter::V1p1beta1::Finding::State] - # Required. The desired State of the finding. - # @!attribute [rw] start_time - # @return [::Google::Protobuf::Timestamp] - # Required. The time at which the updated state takes effect. - class SetFindingStateRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Request message for running asset discovery for an organization. - # @!attribute [rw] parent - # @return [::String] - # Required. Name of the organization to run asset discovery for. Its format is - # "organizations/[organization_id]". - class RunAssetDiscoveryRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Request message for updating or creating a finding. - # @!attribute [rw] finding - # @return [::Google::Cloud::SecurityCenter::V1p1beta1::Finding] - # Required. The finding resource to update or create if it does not already exist. - # parent, security_marks, and update_time will be ignored. - # - # In the case of creation, the finding id portion of the name must be - # alphanumeric and less than or equal to 32 characters and greater than 0 - # characters in length. - # @!attribute [rw] update_mask - # @return [::Google::Protobuf::FieldMask] - # The FieldMask to use when updating the finding resource. This field should - # not be specified when creating a finding. - # - # When updating a finding, an empty mask is treated as updating all mutable - # fields and replacing source_properties. Individual source_properties can - # be added/updated by using "source_properties." in the field - # mask. - class UpdateFindingRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Request message for updating a notification config. - # @!attribute [rw] notification_config - # @return [::Google::Cloud::SecurityCenter::V1p1beta1::NotificationConfig] - # Required. The notification config to update. - # @!attribute [rw] update_mask - # @return [::Google::Protobuf::FieldMask] - # The FieldMask to use when updating the notification config. - # - # If empty all mutable fields will be updated. - class UpdateNotificationConfigRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Request message for updating an organization's settings. - # @!attribute [rw] organization_settings - # @return [::Google::Cloud::SecurityCenter::V1p1beta1::OrganizationSettings] - # Required. The organization settings resource to update. - # @!attribute [rw] update_mask - # @return [::Google::Protobuf::FieldMask] - # The FieldMask to use when updating the settings resource. - # - # If empty all mutable fields will be updated. - class UpdateOrganizationSettingsRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Request message for updating a source. - # @!attribute [rw] source - # @return [::Google::Cloud::SecurityCenter::V1p1beta1::Source] - # Required. The source resource to update. - # @!attribute [rw] update_mask - # @return [::Google::Protobuf::FieldMask] - # The FieldMask to use when updating the source resource. - # - # If empty all mutable fields will be updated. - class UpdateSourceRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Request message for updating a SecurityMarks resource. - # @!attribute [rw] security_marks - # @return [::Google::Cloud::SecurityCenter::V1p1beta1::SecurityMarks] - # Required. The security marks resource to update. - # @!attribute [rw] update_mask - # @return [::Google::Protobuf::FieldMask] - # The FieldMask to use when updating the security marks resource. - # - # The field mask must not contain duplicate fields. - # If empty or set to "marks", all marks will be replaced. Individual - # marks can be updated using "marks.". - # @!attribute [rw] start_time - # @return [::Google::Protobuf::Timestamp] - # The time at which the updated SecurityMarks take effect. - # If not set uses current server time. Updates will be applied to the - # SecurityMarks that are active immediately preceding this time. - class UpdateSecurityMarksRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - end - end - end -end diff --git a/owl-bot-staging/google-cloud-security_center-v1p1beta1/proto_docs/google/cloud/securitycenter/v1p1beta1/source.rb b/owl-bot-staging/google-cloud-security_center-v1p1beta1/proto_docs/google/cloud/securitycenter/v1p1beta1/source.rb deleted file mode 100644 index 72b49b0fe90a..000000000000 --- a/owl-bot-staging/google-cloud-security_center-v1p1beta1/proto_docs/google/cloud/securitycenter/v1p1beta1/source.rb +++ /dev/null @@ -1,64 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - - -module Google - module Cloud - module SecurityCenter - module V1p1beta1 - # Security Command Center finding source. A finding source - # is an entity or a mechanism that can produce a finding. A source is like a - # container of findings that come from the same scanner, logger, monitor, etc. - # @!attribute [rw] name - # @return [::String] - # The relative resource name of this source. See: - # https://cloud.google.com/apis/design/resource_names#relative_resource_name - # Example: - # "organizations/\\{organization_id}/sources/\\{source_id}" - # @!attribute [rw] display_name - # @return [::String] - # The source's display name. - # A source's display name must be unique amongst its siblings, for example, - # two sources with the same parent can't share the same display name. - # The display name must have a length between 1 and 64 characters - # (inclusive). - # @!attribute [rw] description - # @return [::String] - # The description of the source (max of 1024 characters). - # Example: - # "Web Security Scanner is a web security scanner for common - # vulnerabilities in App Engine applications. It can automatically - # scan and detect four common vulnerabilities, including cross-site-scripting - # (XSS), Flash injection, mixed content (HTTP in HTTPS), and - # outdated/insecure libraries." - # @!attribute [rw] canonical_name - # @return [::String] - # The canonical name of the finding. It's either - # "organizations/\\{organization_id}/sources/\\{source_id}", - # "folders/\\{folder_id}/sources/\\{source_id}" or - # "projects/\\{project_number}/sources/\\{source_id}", - # depending on the closest CRM ancestor of the resource associated with the - # finding. - class Source - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - end - end - end -end diff --git a/owl-bot-staging/google-cloud-security_center-v1p1beta1/proto_docs/google/iam/v1/iam_policy.rb b/owl-bot-staging/google-cloud-security_center-v1p1beta1/proto_docs/google/iam/v1/iam_policy.rb deleted file mode 100644 index 5445c77f8258..000000000000 --- a/owl-bot-staging/google-cloud-security_center-v1p1beta1/proto_docs/google/iam/v1/iam_policy.rb +++ /dev/null @@ -1,87 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - - -module Google - module Iam - module V1 - # Request message for `SetIamPolicy` method. - # @!attribute [rw] resource - # @return [::String] - # REQUIRED: The resource for which the policy is being specified. - # See the operation documentation for the appropriate value for this field. - # @!attribute [rw] policy - # @return [::Google::Iam::V1::Policy] - # REQUIRED: The complete policy to be applied to the `resource`. The size of - # the policy is limited to a few 10s of KB. An empty policy is a - # valid policy but certain Cloud Platform services (such as Projects) - # might reject them. - # @!attribute [rw] update_mask - # @return [::Google::Protobuf::FieldMask] - # OPTIONAL: A FieldMask specifying which fields of the policy to modify. Only - # the fields in the mask will be modified. If no mask is provided, the - # following default mask is used: - # - # `paths: "bindings, etag"` - class SetIamPolicyRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Request message for `GetIamPolicy` method. - # @!attribute [rw] resource - # @return [::String] - # REQUIRED: The resource for which the policy is being requested. - # See the operation documentation for the appropriate value for this field. - # @!attribute [rw] options - # @return [::Google::Iam::V1::GetPolicyOptions] - # OPTIONAL: A `GetPolicyOptions` object for specifying options to - # `GetIamPolicy`. - class GetIamPolicyRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Request message for `TestIamPermissions` method. - # @!attribute [rw] resource - # @return [::String] - # REQUIRED: The resource for which the policy detail is being requested. - # See the operation documentation for the appropriate value for this field. - # @!attribute [rw] permissions - # @return [::Array<::String>] - # The set of permissions to check for the `resource`. Permissions with - # wildcards (such as '*' or 'storage.*') are not allowed. For more - # information see - # [IAM Overview](https://cloud.google.com/iam/docs/overview#permissions). - class TestIamPermissionsRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Response message for `TestIamPermissions` method. - # @!attribute [rw] permissions - # @return [::Array<::String>] - # A subset of `TestPermissionsRequest.permissions` that the caller is - # allowed. - class TestIamPermissionsResponse - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - end - end -end diff --git a/owl-bot-staging/google-cloud-security_center-v1p1beta1/proto_docs/google/iam/v1/options.rb b/owl-bot-staging/google-cloud-security_center-v1p1beta1/proto_docs/google/iam/v1/options.rb deleted file mode 100644 index 60713d995b86..000000000000 --- a/owl-bot-staging/google-cloud-security_center-v1p1beta1/proto_docs/google/iam/v1/options.rb +++ /dev/null @@ -1,50 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - - -module Google - module Iam - module V1 - # Encapsulates settings provided to GetIamPolicy. - # @!attribute [rw] requested_policy_version - # @return [::Integer] - # Optional. The maximum policy version that will be used to format the - # policy. - # - # Valid values are 0, 1, and 3. Requests specifying an invalid value will be - # rejected. - # - # Requests for policies with any conditional role bindings must specify - # version 3. Policies with no conditional role bindings may specify any valid - # value or leave the field unset. - # - # The policy in the response might use the policy version that you specified, - # or it might use a lower policy version. For example, if you specify version - # 3, but the policy has no conditional role bindings, the response uses - # version 1. - # - # To learn which resources support conditions in their IAM policies, see the - # [IAM - # documentation](https://cloud.google.com/iam/help/conditions/resource-policies). - class GetPolicyOptions - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - end - end -end diff --git a/owl-bot-staging/google-cloud-security_center-v1p1beta1/proto_docs/google/iam/v1/policy.rb b/owl-bot-staging/google-cloud-security_center-v1p1beta1/proto_docs/google/iam/v1/policy.rb deleted file mode 100644 index 999575b797df..000000000000 --- a/owl-bot-staging/google-cloud-security_center-v1p1beta1/proto_docs/google/iam/v1/policy.rb +++ /dev/null @@ -1,426 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - - -module Google - module Iam - module V1 - # An Identity and Access Management (IAM) policy, which specifies access - # controls for Google Cloud resources. - # - # - # A `Policy` is a collection of `bindings`. A `binding` binds one or more - # `members`, or principals, to a single `role`. Principals can be user - # accounts, service accounts, Google groups, and domains (such as G Suite). A - # `role` is a named list of permissions; each `role` can be an IAM predefined - # role or a user-created custom role. - # - # For some types of Google Cloud resources, a `binding` can also specify a - # `condition`, which is a logical expression that allows access to a resource - # only if the expression evaluates to `true`. A condition can add constraints - # based on attributes of the request, the resource, or both. To learn which - # resources support conditions in their IAM policies, see the - # [IAM - # documentation](https://cloud.google.com/iam/help/conditions/resource-policies). - # - # **JSON example:** - # - # ``` - # { - # "bindings": [ - # { - # "role": "roles/resourcemanager.organizationAdmin", - # "members": [ - # "user:mike@example.com", - # "group:admins@example.com", - # "domain:google.com", - # "serviceAccount:my-project-id@appspot.gserviceaccount.com" - # ] - # }, - # { - # "role": "roles/resourcemanager.organizationViewer", - # "members": [ - # "user:eve@example.com" - # ], - # "condition": { - # "title": "expirable access", - # "description": "Does not grant access after Sep 2020", - # "expression": "request.time < - # timestamp('2020-10-01T00:00:00.000Z')", - # } - # } - # ], - # "etag": "BwWWja0YfJA=", - # "version": 3 - # } - # ``` - # - # **YAML example:** - # - # ``` - # bindings: - # - members: - # - user:mike@example.com - # - group:admins@example.com - # - domain:google.com - # - serviceAccount:my-project-id@appspot.gserviceaccount.com - # role: roles/resourcemanager.organizationAdmin - # - members: - # - user:eve@example.com - # role: roles/resourcemanager.organizationViewer - # condition: - # title: expirable access - # description: Does not grant access after Sep 2020 - # expression: request.time < timestamp('2020-10-01T00:00:00.000Z') - # etag: BwWWja0YfJA= - # version: 3 - # ``` - # - # For a description of IAM and its features, see the - # [IAM documentation](https://cloud.google.com/iam/docs/). - # @!attribute [rw] version - # @return [::Integer] - # Specifies the format of the policy. - # - # Valid values are `0`, `1`, and `3`. Requests that specify an invalid value - # are rejected. - # - # Any operation that affects conditional role bindings must specify version - # `3`. This requirement applies to the following operations: - # - # * Getting a policy that includes a conditional role binding - # * Adding a conditional role binding to a policy - # * Changing a conditional role binding in a policy - # * Removing any role binding, with or without a condition, from a policy - # that includes conditions - # - # **Important:** If you use IAM Conditions, you must include the `etag` field - # whenever you call `setIamPolicy`. If you omit this field, then IAM allows - # you to overwrite a version `3` policy with a version `1` policy, and all of - # the conditions in the version `3` policy are lost. - # - # If a policy does not include any conditions, operations on that policy may - # specify any valid version or leave the field unset. - # - # To learn which resources support conditions in their IAM policies, see the - # [IAM - # documentation](https://cloud.google.com/iam/help/conditions/resource-policies). - # @!attribute [rw] bindings - # @return [::Array<::Google::Iam::V1::Binding>] - # Associates a list of `members`, or principals, with a `role`. Optionally, - # may specify a `condition` that determines how and when the `bindings` are - # applied. Each of the `bindings` must contain at least one principal. - # - # The `bindings` in a `Policy` can refer to up to 1,500 principals; up to 250 - # of these principals can be Google groups. Each occurrence of a principal - # counts towards these limits. For example, if the `bindings` grant 50 - # different roles to `user:alice@example.com`, and not to any other - # principal, then you can add another 1,450 principals to the `bindings` in - # the `Policy`. - # @!attribute [rw] audit_configs - # @return [::Array<::Google::Iam::V1::AuditConfig>] - # Specifies cloud audit logging configuration for this policy. - # @!attribute [rw] etag - # @return [::String] - # `etag` is used for optimistic concurrency control as a way to help - # prevent simultaneous updates of a policy from overwriting each other. - # It is strongly suggested that systems make use of the `etag` in the - # read-modify-write cycle to perform policy updates in order to avoid race - # conditions: An `etag` is returned in the response to `getIamPolicy`, and - # systems are expected to put that etag in the request to `setIamPolicy` to - # ensure that their change will be applied to the same version of the policy. - # - # **Important:** If you use IAM Conditions, you must include the `etag` field - # whenever you call `setIamPolicy`. If you omit this field, then IAM allows - # you to overwrite a version `3` policy with a version `1` policy, and all of - # the conditions in the version `3` policy are lost. - class Policy - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Associates `members`, or principals, with a `role`. - # @!attribute [rw] role - # @return [::String] - # Role that is assigned to the list of `members`, or principals. - # For example, `roles/viewer`, `roles/editor`, or `roles/owner`. - # @!attribute [rw] members - # @return [::Array<::String>] - # Specifies the principals requesting access for a Google Cloud resource. - # `members` can have the following values: - # - # * `allUsers`: A special identifier that represents anyone who is - # on the internet; with or without a Google account. - # - # * `allAuthenticatedUsers`: A special identifier that represents anyone - # who is authenticated with a Google account or a service account. - # - # * `user:{emailid}`: An email address that represents a specific Google - # account. For example, `alice@example.com` . - # - # - # * `serviceAccount:{emailid}`: An email address that represents a service - # account. For example, `my-other-app@appspot.gserviceaccount.com`. - # - # * `group:{emailid}`: An email address that represents a Google group. - # For example, `admins@example.com`. - # - # * `deleted:user:{emailid}?uid={uniqueid}`: An email address (plus unique - # identifier) representing a user that has been recently deleted. For - # example, `alice@example.com?uid=123456789012345678901`. If the user is - # recovered, this value reverts to `user:{emailid}` and the recovered user - # retains the role in the binding. - # - # * `deleted:serviceAccount:{emailid}?uid={uniqueid}`: An email address (plus - # unique identifier) representing a service account that has been recently - # deleted. For example, - # `my-other-app@appspot.gserviceaccount.com?uid=123456789012345678901`. - # If the service account is undeleted, this value reverts to - # `serviceAccount:{emailid}` and the undeleted service account retains the - # role in the binding. - # - # * `deleted:group:{emailid}?uid={uniqueid}`: An email address (plus unique - # identifier) representing a Google group that has been recently - # deleted. For example, `admins@example.com?uid=123456789012345678901`. If - # the group is recovered, this value reverts to `group:{emailid}` and the - # recovered group retains the role in the binding. - # - # - # * `domain:{domain}`: The G Suite domain (primary) that represents all the - # users of that domain. For example, `google.com` or `example.com`. - # @!attribute [rw] condition - # @return [::Google::Type::Expr] - # The condition that is associated with this binding. - # - # If the condition evaluates to `true`, then this binding applies to the - # current request. - # - # If the condition evaluates to `false`, then this binding does not apply to - # the current request. However, a different role binding might grant the same - # role to one or more of the principals in this binding. - # - # To learn which resources support conditions in their IAM policies, see the - # [IAM - # documentation](https://cloud.google.com/iam/help/conditions/resource-policies). - class Binding - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Specifies the audit configuration for a service. - # The configuration determines which permission types are logged, and what - # identities, if any, are exempted from logging. - # An AuditConfig must have one or more AuditLogConfigs. - # - # If there are AuditConfigs for both `allServices` and a specific service, - # the union of the two AuditConfigs is used for that service: the log_types - # specified in each AuditConfig are enabled, and the exempted_members in each - # AuditLogConfig are exempted. - # - # Example Policy with multiple AuditConfigs: - # - # { - # "audit_configs": [ - # { - # "service": "allServices", - # "audit_log_configs": [ - # { - # "log_type": "DATA_READ", - # "exempted_members": [ - # "user:jose@example.com" - # ] - # }, - # { - # "log_type": "DATA_WRITE" - # }, - # { - # "log_type": "ADMIN_READ" - # } - # ] - # }, - # { - # "service": "sampleservice.googleapis.com", - # "audit_log_configs": [ - # { - # "log_type": "DATA_READ" - # }, - # { - # "log_type": "DATA_WRITE", - # "exempted_members": [ - # "user:aliya@example.com" - # ] - # } - # ] - # } - # ] - # } - # - # For sampleservice, this policy enables DATA_READ, DATA_WRITE and ADMIN_READ - # logging. It also exempts `jose@example.com` from DATA_READ logging, and - # `aliya@example.com` from DATA_WRITE logging. - # @!attribute [rw] service - # @return [::String] - # Specifies a service that will be enabled for audit logging. - # For example, `storage.googleapis.com`, `cloudsql.googleapis.com`. - # `allServices` is a special value that covers all services. - # @!attribute [rw] audit_log_configs - # @return [::Array<::Google::Iam::V1::AuditLogConfig>] - # The configuration for logging of each type of permission. - class AuditConfig - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Provides the configuration for logging a type of permissions. - # Example: - # - # { - # "audit_log_configs": [ - # { - # "log_type": "DATA_READ", - # "exempted_members": [ - # "user:jose@example.com" - # ] - # }, - # { - # "log_type": "DATA_WRITE" - # } - # ] - # } - # - # This enables 'DATA_READ' and 'DATA_WRITE' logging, while exempting - # jose@example.com from DATA_READ logging. - # @!attribute [rw] log_type - # @return [::Google::Iam::V1::AuditLogConfig::LogType] - # The log type that this config enables. - # @!attribute [rw] exempted_members - # @return [::Array<::String>] - # Specifies the identities that do not cause logging for this type of - # permission. - # Follows the same format of - # [Binding.members][google.iam.v1.Binding.members]. - class AuditLogConfig - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - - # The list of valid permission types for which logging can be configured. - # Admin writes are always logged, and are not configurable. - module LogType - # Default case. Should never be this. - LOG_TYPE_UNSPECIFIED = 0 - - # Admin reads. Example: CloudIAM getIamPolicy - ADMIN_READ = 1 - - # Data writes. Example: CloudSQL Users create - DATA_WRITE = 2 - - # Data reads. Example: CloudSQL Users list - DATA_READ = 3 - end - end - - # The difference delta between two policies. - # @!attribute [rw] binding_deltas - # @return [::Array<::Google::Iam::V1::BindingDelta>] - # The delta for Bindings between two policies. - # @!attribute [rw] audit_config_deltas - # @return [::Array<::Google::Iam::V1::AuditConfigDelta>] - # The delta for AuditConfigs between two policies. - class PolicyDelta - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # One delta entry for Binding. Each individual change (only one member in each - # entry) to a binding will be a separate entry. - # @!attribute [rw] action - # @return [::Google::Iam::V1::BindingDelta::Action] - # The action that was performed on a Binding. - # Required - # @!attribute [rw] role - # @return [::String] - # Role that is assigned to `members`. - # For example, `roles/viewer`, `roles/editor`, or `roles/owner`. - # Required - # @!attribute [rw] member - # @return [::String] - # A single identity requesting access for a Google Cloud resource. - # Follows the same format of Binding.members. - # Required - # @!attribute [rw] condition - # @return [::Google::Type::Expr] - # The condition that is associated with this binding. - class BindingDelta - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - - # The type of action performed on a Binding in a policy. - module Action - # Unspecified. - ACTION_UNSPECIFIED = 0 - - # Addition of a Binding. - ADD = 1 - - # Removal of a Binding. - REMOVE = 2 - end - end - - # One delta entry for AuditConfig. Each individual change (only one - # exempted_member in each entry) to a AuditConfig will be a separate entry. - # @!attribute [rw] action - # @return [::Google::Iam::V1::AuditConfigDelta::Action] - # The action that was performed on an audit configuration in a policy. - # Required - # @!attribute [rw] service - # @return [::String] - # Specifies a service that was configured for Cloud Audit Logging. - # For example, `storage.googleapis.com`, `cloudsql.googleapis.com`. - # `allServices` is a special value that covers all services. - # Required - # @!attribute [rw] exempted_member - # @return [::String] - # A single identity that is exempted from "data access" audit - # logging for the `service` specified above. - # Follows the same format of Binding.members. - # @!attribute [rw] log_type - # @return [::String] - # Specifies the log_type that was be enabled. ADMIN_ACTIVITY is always - # enabled, and cannot be configured. - # Required - class AuditConfigDelta - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - - # The type of action performed on an audit configuration in a policy. - module Action - # Unspecified. - ACTION_UNSPECIFIED = 0 - - # Addition of an audit configuration. - ADD = 1 - - # Removal of an audit configuration. - REMOVE = 2 - end - end - end - end -end diff --git a/owl-bot-staging/google-cloud-security_center-v1p1beta1/proto_docs/google/longrunning/operations.rb b/owl-bot-staging/google-cloud-security_center-v1p1beta1/proto_docs/google/longrunning/operations.rb deleted file mode 100644 index 7a757f512165..000000000000 --- a/owl-bot-staging/google-cloud-security_center-v1p1beta1/proto_docs/google/longrunning/operations.rb +++ /dev/null @@ -1,191 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - - -module Google - module Longrunning - # This resource represents a long-running operation that is the result of a - # network API call. - # @!attribute [rw] name - # @return [::String] - # The server-assigned name, which is only unique within the same service that - # originally returns it. If you use the default HTTP mapping, the - # `name` should be a resource name ending with `operations/{unique_id}`. - # @!attribute [rw] metadata - # @return [::Google::Protobuf::Any] - # Service-specific metadata associated with the operation. It typically - # contains progress information and common metadata such as create time. - # Some services might not provide such metadata. Any method that returns a - # long-running operation should document the metadata type, if any. - # @!attribute [rw] done - # @return [::Boolean] - # If the value is `false`, it means the operation is still in progress. - # If `true`, the operation is completed, and either `error` or `response` is - # available. - # @!attribute [rw] error - # @return [::Google::Rpc::Status] - # The error result of the operation in case of failure or cancellation. - # - # Note: The following fields are mutually exclusive: `error`, `response`. If a field in that set is populated, all other fields in the set will automatically be cleared. - # @!attribute [rw] response - # @return [::Google::Protobuf::Any] - # The normal, successful response of the operation. If the original - # method returns no data on success, such as `Delete`, the response is - # `google.protobuf.Empty`. If the original method is standard - # `Get`/`Create`/`Update`, the response should be the resource. For other - # methods, the response should have the type `XxxResponse`, where `Xxx` - # is the original method name. For example, if the original method name - # is `TakeSnapshot()`, the inferred response type is - # `TakeSnapshotResponse`. - # - # Note: The following fields are mutually exclusive: `response`, `error`. If a field in that set is populated, all other fields in the set will automatically be cleared. - class Operation - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # The request message for - # Operations.GetOperation. - # @!attribute [rw] name - # @return [::String] - # The name of the operation resource. - class GetOperationRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # The request message for - # Operations.ListOperations. - # @!attribute [rw] name - # @return [::String] - # The name of the operation's parent resource. - # @!attribute [rw] filter - # @return [::String] - # The standard list filter. - # @!attribute [rw] page_size - # @return [::Integer] - # The standard list page size. - # @!attribute [rw] page_token - # @return [::String] - # The standard list page token. - # @!attribute [rw] return_partial_success - # @return [::Boolean] - # When set to `true`, operations that are reachable are returned as normal, - # and those that are unreachable are returned in the - # [ListOperationsResponse.unreachable] field. - # - # This can only be `true` when reading across collections e.g. when `parent` - # is set to `"projects/example/locations/-"`. - # - # This field is not by default supported and will result in an - # `UNIMPLEMENTED` error if set unless explicitly documented otherwise in - # service or product specific documentation. - class ListOperationsRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # The response message for - # Operations.ListOperations. - # @!attribute [rw] operations - # @return [::Array<::Google::Longrunning::Operation>] - # A list of operations that matches the specified filter in the request. - # @!attribute [rw] next_page_token - # @return [::String] - # The standard List next-page token. - # @!attribute [rw] unreachable - # @return [::Array<::String>] - # Unordered list. Unreachable resources. Populated when the request sets - # `ListOperationsRequest.return_partial_success` and reads across - # collections e.g. when attempting to list all resources across all supported - # locations. - class ListOperationsResponse - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # The request message for - # Operations.CancelOperation. - # @!attribute [rw] name - # @return [::String] - # The name of the operation resource to be cancelled. - class CancelOperationRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # The request message for - # Operations.DeleteOperation. - # @!attribute [rw] name - # @return [::String] - # The name of the operation resource to be deleted. - class DeleteOperationRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # The request message for - # Operations.WaitOperation. - # @!attribute [rw] name - # @return [::String] - # The name of the operation resource to wait on. - # @!attribute [rw] timeout - # @return [::Google::Protobuf::Duration] - # The maximum duration to wait before timing out. If left blank, the wait - # will be at most the time permitted by the underlying HTTP/RPC protocol. - # If RPC context deadline is also specified, the shorter one will be used. - class WaitOperationRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # A message representing the message types used by a long-running operation. - # - # Example: - # - # rpc Export(ExportRequest) returns (google.longrunning.Operation) { - # option (google.longrunning.operation_info) = { - # response_type: "ExportResponse" - # metadata_type: "ExportMetadata" - # }; - # } - # @!attribute [rw] response_type - # @return [::String] - # Required. The message name of the primary return type for this - # long-running operation. - # This type will be used to deserialize the LRO's response. - # - # If the response is in a different package from the rpc, a fully-qualified - # message name must be used (e.g. `google.protobuf.Struct`). - # - # Note: Altering this value constitutes a breaking change. - # @!attribute [rw] metadata_type - # @return [::String] - # Required. The message name of the metadata type for this long-running - # operation. - # - # If the response is in a different package from the rpc, a fully-qualified - # message name must be used (e.g. `google.protobuf.Struct`). - # - # Note: Altering this value constitutes a breaking change. - class OperationInfo - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - end -end diff --git a/owl-bot-staging/google-cloud-security_center-v1p1beta1/proto_docs/google/protobuf/any.rb b/owl-bot-staging/google-cloud-security_center-v1p1beta1/proto_docs/google/protobuf/any.rb deleted file mode 100644 index 58691995f02e..000000000000 --- a/owl-bot-staging/google-cloud-security_center-v1p1beta1/proto_docs/google/protobuf/any.rb +++ /dev/null @@ -1,145 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - - -module Google - module Protobuf - # `Any` contains an arbitrary serialized protocol buffer message along with a - # URL that describes the type of the serialized message. - # - # Protobuf library provides support to pack/unpack Any values in the form - # of utility functions or additional generated methods of the Any type. - # - # Example 1: Pack and unpack a message in C++. - # - # Foo foo = ...; - # Any any; - # any.PackFrom(foo); - # ... - # if (any.UnpackTo(&foo)) { - # ... - # } - # - # Example 2: Pack and unpack a message in Java. - # - # Foo foo = ...; - # Any any = Any.pack(foo); - # ... - # if (any.is(Foo.class)) { - # foo = any.unpack(Foo.class); - # } - # // or ... - # if (any.isSameTypeAs(Foo.getDefaultInstance())) { - # foo = any.unpack(Foo.getDefaultInstance()); - # } - # - # Example 3: Pack and unpack a message in Python. - # - # foo = Foo(...) - # any = Any() - # any.Pack(foo) - # ... - # if any.Is(Foo.DESCRIPTOR): - # any.Unpack(foo) - # ... - # - # Example 4: Pack and unpack a message in Go - # - # foo := &pb.Foo{...} - # any, err := anypb.New(foo) - # if err != nil { - # ... - # } - # ... - # foo := &pb.Foo{} - # if err := any.UnmarshalTo(foo); err != nil { - # ... - # } - # - # The pack methods provided by protobuf library will by default use - # 'type.googleapis.com/full.type.name' as the type URL and the unpack - # methods only use the fully qualified type name after the last '/' - # in the type URL, for example "foo.bar.com/x/y.z" will yield type - # name "y.z". - # - # JSON - # ==== - # The JSON representation of an `Any` value uses the regular - # representation of the deserialized, embedded message, with an - # additional field `@type` which contains the type URL. Example: - # - # package google.profile; - # message Person { - # string first_name = 1; - # string last_name = 2; - # } - # - # { - # "@type": "type.googleapis.com/google.profile.Person", - # "firstName": , - # "lastName": - # } - # - # If the embedded message type is well-known and has a custom JSON - # representation, that representation will be embedded adding a field - # `value` which holds the custom JSON in addition to the `@type` - # field. Example (for message [google.protobuf.Duration][]): - # - # { - # "@type": "type.googleapis.com/google.protobuf.Duration", - # "value": "1.212s" - # } - # @!attribute [rw] type_url - # @return [::String] - # A URL/resource name that uniquely identifies the type of the serialized - # protocol buffer message. This string must contain at least - # one "/" character. The last segment of the URL's path must represent - # the fully qualified name of the type (as in - # `path/google.protobuf.Duration`). The name should be in a canonical form - # (e.g., leading "." is not accepted). - # - # In practice, teams usually precompile into the binary all types that they - # expect it to use in the context of Any. However, for URLs which use the - # scheme `http`, `https`, or no scheme, one can optionally set up a type - # server that maps type URLs to message definitions as follows: - # - # * If no scheme is provided, `https` is assumed. - # * An HTTP GET on the URL must yield a [google.protobuf.Type][] - # value in binary format, or produce an error. - # * Applications are allowed to cache lookup results based on the - # URL, or have them precompiled into a binary to avoid any - # lookup. Therefore, binary compatibility needs to be preserved - # on changes to types. (Use versioned type names to manage - # breaking changes.) - # - # Note: this functionality is not currently available in the official - # protobuf release, and it is not used for type URLs beginning with - # type.googleapis.com. As of May 2023, there are no widely used type server - # implementations and no plans to implement one. - # - # Schemes other than `http`, `https` (or the empty scheme) might be - # used with implementation specific semantics. - # @!attribute [rw] value - # @return [::String] - # Must be a valid serialized protocol buffer of the above specified type. - class Any - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - end -end diff --git a/owl-bot-staging/google-cloud-security_center-v1p1beta1/proto_docs/google/protobuf/duration.rb b/owl-bot-staging/google-cloud-security_center-v1p1beta1/proto_docs/google/protobuf/duration.rb deleted file mode 100644 index ea59f1f91daf..000000000000 --- a/owl-bot-staging/google-cloud-security_center-v1p1beta1/proto_docs/google/protobuf/duration.rb +++ /dev/null @@ -1,98 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - - -module Google - module Protobuf - # A Duration represents a signed, fixed-length span of time represented - # as a count of seconds and fractions of seconds at nanosecond - # resolution. It is independent of any calendar and concepts like "day" - # or "month". It is related to Timestamp in that the difference between - # two Timestamp values is a Duration and it can be added or subtracted - # from a Timestamp. Range is approximately +-10,000 years. - # - # # Examples - # - # Example 1: Compute Duration from two Timestamps in pseudo code. - # - # Timestamp start = ...; - # Timestamp end = ...; - # Duration duration = ...; - # - # duration.seconds = end.seconds - start.seconds; - # duration.nanos = end.nanos - start.nanos; - # - # if (duration.seconds < 0 && duration.nanos > 0) { - # duration.seconds += 1; - # duration.nanos -= 1000000000; - # } else if (duration.seconds > 0 && duration.nanos < 0) { - # duration.seconds -= 1; - # duration.nanos += 1000000000; - # } - # - # Example 2: Compute Timestamp from Timestamp + Duration in pseudo code. - # - # Timestamp start = ...; - # Duration duration = ...; - # Timestamp end = ...; - # - # end.seconds = start.seconds + duration.seconds; - # end.nanos = start.nanos + duration.nanos; - # - # if (end.nanos < 0) { - # end.seconds -= 1; - # end.nanos += 1000000000; - # } else if (end.nanos >= 1000000000) { - # end.seconds += 1; - # end.nanos -= 1000000000; - # } - # - # Example 3: Compute Duration from datetime.timedelta in Python. - # - # td = datetime.timedelta(days=3, minutes=10) - # duration = Duration() - # duration.FromTimedelta(td) - # - # # JSON Mapping - # - # In JSON format, the Duration type is encoded as a string rather than an - # object, where the string ends in the suffix "s" (indicating seconds) and - # is preceded by the number of seconds, with nanoseconds expressed as - # fractional seconds. For example, 3 seconds with 0 nanoseconds should be - # encoded in JSON format as "3s", while 3 seconds and 1 nanosecond should - # be expressed in JSON format as "3.000000001s", and 3 seconds and 1 - # microsecond should be expressed in JSON format as "3.000001s". - # @!attribute [rw] seconds - # @return [::Integer] - # Signed seconds of the span of time. Must be from -315,576,000,000 - # to +315,576,000,000 inclusive. Note: these bounds are computed from: - # 60 sec/min * 60 min/hr * 24 hr/day * 365.25 days/year * 10000 years - # @!attribute [rw] nanos - # @return [::Integer] - # Signed fractions of a second at nanosecond resolution of the span - # of time. Durations less than one second are represented with a 0 - # `seconds` field and a positive or negative `nanos` field. For durations - # of one second or more, a non-zero value for the `nanos` field must be - # of the same sign as the `seconds` field. Must be from -999,999,999 - # to +999,999,999 inclusive. - class Duration - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - end -end diff --git a/owl-bot-staging/google-cloud-security_center-v1p1beta1/proto_docs/google/protobuf/empty.rb b/owl-bot-staging/google-cloud-security_center-v1p1beta1/proto_docs/google/protobuf/empty.rb deleted file mode 100644 index 83e4481834a6..000000000000 --- a/owl-bot-staging/google-cloud-security_center-v1p1beta1/proto_docs/google/protobuf/empty.rb +++ /dev/null @@ -1,34 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - - -module Google - module Protobuf - # A generic empty message that you can re-use to avoid defining duplicated - # empty messages in your APIs. A typical example is to use it as the request - # or the response type of an API method. For instance: - # - # service Foo { - # rpc Bar(google.protobuf.Empty) returns (google.protobuf.Empty); - # } - class Empty - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - end -end diff --git a/owl-bot-staging/google-cloud-security_center-v1p1beta1/proto_docs/google/protobuf/field_mask.rb b/owl-bot-staging/google-cloud-security_center-v1p1beta1/proto_docs/google/protobuf/field_mask.rb deleted file mode 100644 index 7f3ffc78601a..000000000000 --- a/owl-bot-staging/google-cloud-security_center-v1p1beta1/proto_docs/google/protobuf/field_mask.rb +++ /dev/null @@ -1,229 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - - -module Google - module Protobuf - # `FieldMask` represents a set of symbolic field paths, for example: - # - # paths: "f.a" - # paths: "f.b.d" - # - # Here `f` represents a field in some root message, `a` and `b` - # fields in the message found in `f`, and `d` a field found in the - # message in `f.b`. - # - # Field masks are used to specify a subset of fields that should be - # returned by a get operation or modified by an update operation. - # Field masks also have a custom JSON encoding (see below). - # - # # Field Masks in Projections - # - # When used in the context of a projection, a response message or - # sub-message is filtered by the API to only contain those fields as - # specified in the mask. For example, if the mask in the previous - # example is applied to a response message as follows: - # - # f { - # a : 22 - # b { - # d : 1 - # x : 2 - # } - # y : 13 - # } - # z: 8 - # - # The result will not contain specific values for fields x,y and z - # (their value will be set to the default, and omitted in proto text - # output): - # - # - # f { - # a : 22 - # b { - # d : 1 - # } - # } - # - # A repeated field is not allowed except at the last position of a - # paths string. - # - # If a FieldMask object is not present in a get operation, the - # operation applies to all fields (as if a FieldMask of all fields - # had been specified). - # - # Note that a field mask does not necessarily apply to the - # top-level response message. In case of a REST get operation, the - # field mask applies directly to the response, but in case of a REST - # list operation, the mask instead applies to each individual message - # in the returned resource list. In case of a REST custom method, - # other definitions may be used. Where the mask applies will be - # clearly documented together with its declaration in the API. In - # any case, the effect on the returned resource/resources is required - # behavior for APIs. - # - # # Field Masks in Update Operations - # - # A field mask in update operations specifies which fields of the - # targeted resource are going to be updated. The API is required - # to only change the values of the fields as specified in the mask - # and leave the others untouched. If a resource is passed in to - # describe the updated values, the API ignores the values of all - # fields not covered by the mask. - # - # If a repeated field is specified for an update operation, new values will - # be appended to the existing repeated field in the target resource. Note that - # a repeated field is only allowed in the last position of a `paths` string. - # - # If a sub-message is specified in the last position of the field mask for an - # update operation, then new value will be merged into the existing sub-message - # in the target resource. - # - # For example, given the target message: - # - # f { - # b { - # d: 1 - # x: 2 - # } - # c: [1] - # } - # - # And an update message: - # - # f { - # b { - # d: 10 - # } - # c: [2] - # } - # - # then if the field mask is: - # - # paths: ["f.b", "f.c"] - # - # then the result will be: - # - # f { - # b { - # d: 10 - # x: 2 - # } - # c: [1, 2] - # } - # - # An implementation may provide options to override this default behavior for - # repeated and message fields. - # - # In order to reset a field's value to the default, the field must - # be in the mask and set to the default value in the provided resource. - # Hence, in order to reset all fields of a resource, provide a default - # instance of the resource and set all fields in the mask, or do - # not provide a mask as described below. - # - # If a field mask is not present on update, the operation applies to - # all fields (as if a field mask of all fields has been specified). - # Note that in the presence of schema evolution, this may mean that - # fields the client does not know and has therefore not filled into - # the request will be reset to their default. If this is unwanted - # behavior, a specific service may require a client to always specify - # a field mask, producing an error if not. - # - # As with get operations, the location of the resource which - # describes the updated values in the request message depends on the - # operation kind. In any case, the effect of the field mask is - # required to be honored by the API. - # - # ## Considerations for HTTP REST - # - # The HTTP kind of an update operation which uses a field mask must - # be set to PATCH instead of PUT in order to satisfy HTTP semantics - # (PUT must only be used for full updates). - # - # # JSON Encoding of Field Masks - # - # In JSON, a field mask is encoded as a single string where paths are - # separated by a comma. Fields name in each path are converted - # to/from lower-camel naming conventions. - # - # As an example, consider the following message declarations: - # - # message Profile { - # User user = 1; - # Photo photo = 2; - # } - # message User { - # string display_name = 1; - # string address = 2; - # } - # - # In proto a field mask for `Profile` may look as such: - # - # mask { - # paths: "user.display_name" - # paths: "photo" - # } - # - # In JSON, the same mask is represented as below: - # - # { - # mask: "user.displayName,photo" - # } - # - # # Field Masks and Oneof Fields - # - # Field masks treat fields in oneofs just as regular fields. Consider the - # following message: - # - # message SampleMessage { - # oneof test_oneof { - # string name = 4; - # SubMessage sub_message = 9; - # } - # } - # - # The field mask can be: - # - # mask { - # paths: "name" - # } - # - # Or: - # - # mask { - # paths: "sub_message" - # } - # - # Note that oneof type names ("test_oneof" in this case) cannot be used in - # paths. - # - # ## Field Mask Verification - # - # The implementation of any API method which has a FieldMask type field in the - # request should verify the included field paths, and return an - # `INVALID_ARGUMENT` error if any path is unmappable. - # @!attribute [rw] paths - # @return [::Array<::String>] - # The set of field mask paths. - class FieldMask - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - end -end diff --git a/owl-bot-staging/google-cloud-security_center-v1p1beta1/proto_docs/google/protobuf/struct.rb b/owl-bot-staging/google-cloud-security_center-v1p1beta1/proto_docs/google/protobuf/struct.rb deleted file mode 100644 index 39e1aca868d2..000000000000 --- a/owl-bot-staging/google-cloud-security_center-v1p1beta1/proto_docs/google/protobuf/struct.rb +++ /dev/null @@ -1,108 +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 - # `Struct` represents a structured data value, consisting of fields - # which map to dynamically typed values. In some languages, `Struct` - # might be supported by a native representation. For example, in - # scripting languages like JS a struct is represented as an - # object. The details of that representation are described together - # with the proto support for the language. - # - # The JSON representation for `Struct` is JSON object. - # @!attribute [rw] fields - # @return [::Google::Protobuf::Map{::String => ::Google::Protobuf::Value}] - # Unordered map of dynamically typed values. - class Struct - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - - # @!attribute [rw] key - # @return [::String] - # @!attribute [rw] value - # @return [::Google::Protobuf::Value] - class FieldsEntry - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - end - - # `Value` represents a dynamically typed value which can be either - # null, a number, a string, a boolean, a recursive struct value, or a - # list of values. A producer of value is expected to set one of these - # variants. Absence of any variant indicates an error. - # - # The JSON representation for `Value` is JSON value. - # @!attribute [rw] null_value - # @return [::Google::Protobuf::NullValue] - # Represents a null value. - # - # Note: The following fields are mutually exclusive: `null_value`, `number_value`, `string_value`, `bool_value`, `struct_value`, `list_value`. If a field in that set is populated, all other fields in the set will automatically be cleared. - # @!attribute [rw] number_value - # @return [::Float] - # Represents a double value. - # - # Note: The following fields are mutually exclusive: `number_value`, `null_value`, `string_value`, `bool_value`, `struct_value`, `list_value`. If a field in that set is populated, all other fields in the set will automatically be cleared. - # @!attribute [rw] string_value - # @return [::String] - # Represents a string value. - # - # Note: The following fields are mutually exclusive: `string_value`, `null_value`, `number_value`, `bool_value`, `struct_value`, `list_value`. If a field in that set is populated, all other fields in the set will automatically be cleared. - # @!attribute [rw] bool_value - # @return [::Boolean] - # Represents a boolean value. - # - # Note: The following fields are mutually exclusive: `bool_value`, `null_value`, `number_value`, `string_value`, `struct_value`, `list_value`. If a field in that set is populated, all other fields in the set will automatically be cleared. - # @!attribute [rw] struct_value - # @return [::Google::Protobuf::Struct] - # Represents a structured value. - # - # Note: The following fields are mutually exclusive: `struct_value`, `null_value`, `number_value`, `string_value`, `bool_value`, `list_value`. If a field in that set is populated, all other fields in the set will automatically be cleared. - # @!attribute [rw] list_value - # @return [::Google::Protobuf::ListValue] - # Represents a repeated `Value`. - # - # Note: The following fields are mutually exclusive: `list_value`, `null_value`, `number_value`, `string_value`, `bool_value`, `struct_value`. If a field in that set is populated, all other fields in the set will automatically be cleared. - class Value - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # `ListValue` is a wrapper around a repeated field of values. - # - # The JSON representation for `ListValue` is JSON array. - # @!attribute [rw] values - # @return [::Array<::Google::Protobuf::Value>] - # Repeated field of dynamically typed values. - class ListValue - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # `NullValue` is a singleton enumeration to represent the null value for the - # `Value` type union. - # - # The JSON representation for `NullValue` is JSON `null`. - module NullValue - # Null value. - NULL_VALUE = 0 - end - end -end diff --git a/owl-bot-staging/google-cloud-security_center-v1p1beta1/proto_docs/google/protobuf/timestamp.rb b/owl-bot-staging/google-cloud-security_center-v1p1beta1/proto_docs/google/protobuf/timestamp.rb deleted file mode 100644 index 74352be9c58c..000000000000 --- a/owl-bot-staging/google-cloud-security_center-v1p1beta1/proto_docs/google/protobuf/timestamp.rb +++ /dev/null @@ -1,127 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - - -module Google - module Protobuf - # A Timestamp represents a point in time independent of any time zone or local - # calendar, encoded as a count of seconds and fractions of seconds at - # nanosecond resolution. The count is relative to an epoch at UTC midnight on - # January 1, 1970, in the proleptic Gregorian calendar which extends the - # Gregorian calendar backwards to year one. - # - # All minutes are 60 seconds long. Leap seconds are "smeared" so that no leap - # second table is needed for interpretation, using a [24-hour linear - # smear](https://developers.google.com/time/smear). - # - # The range is from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59.999999999Z. By - # restricting to that range, we ensure that we can convert to and from [RFC - # 3339](https://www.ietf.org/rfc/rfc3339.txt) date strings. - # - # # Examples - # - # Example 1: Compute Timestamp from POSIX `time()`. - # - # Timestamp timestamp; - # timestamp.set_seconds(time(NULL)); - # timestamp.set_nanos(0); - # - # Example 2: Compute Timestamp from POSIX `gettimeofday()`. - # - # struct timeval tv; - # gettimeofday(&tv, NULL); - # - # Timestamp timestamp; - # timestamp.set_seconds(tv.tv_sec); - # timestamp.set_nanos(tv.tv_usec * 1000); - # - # Example 3: Compute Timestamp from Win32 `GetSystemTimeAsFileTime()`. - # - # FILETIME ft; - # GetSystemTimeAsFileTime(&ft); - # UINT64 ticks = (((UINT64)ft.dwHighDateTime) << 32) | ft.dwLowDateTime; - # - # // A Windows tick is 100 nanoseconds. Windows epoch 1601-01-01T00:00:00Z - # // is 11644473600 seconds before Unix epoch 1970-01-01T00:00:00Z. - # Timestamp timestamp; - # timestamp.set_seconds((INT64) ((ticks / 10000000) - 11644473600LL)); - # timestamp.set_nanos((INT32) ((ticks % 10000000) * 100)); - # - # Example 4: Compute Timestamp from Java `System.currentTimeMillis()`. - # - # long millis = System.currentTimeMillis(); - # - # Timestamp timestamp = Timestamp.newBuilder().setSeconds(millis / 1000) - # .setNanos((int) ((millis % 1000) * 1000000)).build(); - # - # Example 5: Compute Timestamp from Java `Instant.now()`. - # - # Instant now = Instant.now(); - # - # Timestamp timestamp = - # Timestamp.newBuilder().setSeconds(now.getEpochSecond()) - # .setNanos(now.getNano()).build(); - # - # Example 6: Compute Timestamp from current time in Python. - # - # timestamp = Timestamp() - # timestamp.GetCurrentTime() - # - # # JSON Mapping - # - # In JSON format, the Timestamp type is encoded as a string in the - # [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format. That is, the - # format is "\\{year}-\\{month}-\\{day}T\\{hour}:\\{min}:\\{sec}[.\\{frac_sec}]Z" - # where \\{year} is always expressed using four digits while \\{month}, \\{day}, - # \\{hour}, \\{min}, and \\{sec} are zero-padded to two digits each. The fractional - # seconds, which can go up to 9 digits (i.e. up to 1 nanosecond resolution), - # are optional. The "Z" suffix indicates the timezone ("UTC"); the timezone - # is required. A proto3 JSON serializer should always use UTC (as indicated by - # "Z") when printing the Timestamp type and a proto3 JSON parser should be - # able to accept both UTC and other timezones (as indicated by an offset). - # - # For example, "2017-01-15T01:30:15.01Z" encodes 15.01 seconds past - # 01:30 UTC on January 15, 2017. - # - # In JavaScript, one can convert a Date object to this format using the - # standard - # [toISOString()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toISOString) - # method. In Python, a standard `datetime.datetime` object can be converted - # to this format using - # [`strftime`](https://docs.python.org/2/library/time.html#time.strftime) with - # the time format spec '%Y-%m-%dT%H:%M:%S.%fZ'. Likewise, in Java, one can use - # the Joda Time's [`ISODateTimeFormat.dateTime()`]( - # http://joda-time.sourceforge.net/apidocs/org/joda/time/format/ISODateTimeFormat.html#dateTime() - # ) to obtain a formatter capable of generating timestamps in this format. - # @!attribute [rw] seconds - # @return [::Integer] - # Represents seconds of UTC time since Unix epoch - # 1970-01-01T00:00:00Z. Must be from 0001-01-01T00:00:00Z to - # 9999-12-31T23:59:59Z inclusive. - # @!attribute [rw] nanos - # @return [::Integer] - # Non-negative fractions of a second at nanosecond resolution. Negative - # second values with fractions must still have non-negative nanos values - # that count forward in time. Must be from 0 to 999,999,999 - # inclusive. - class Timestamp - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - end -end diff --git a/owl-bot-staging/google-cloud-security_center-v1p1beta1/proto_docs/google/rpc/status.rb b/owl-bot-staging/google-cloud-security_center-v1p1beta1/proto_docs/google/rpc/status.rb deleted file mode 100644 index c1a1c07eb2db..000000000000 --- a/owl-bot-staging/google-cloud-security_center-v1p1beta1/proto_docs/google/rpc/status.rb +++ /dev/null @@ -1,48 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - - -module Google - module Rpc - # The `Status` type defines a logical error model that is suitable for - # different programming environments, including REST APIs and RPC APIs. It is - # used by [gRPC](https://github.com/grpc). Each `Status` message contains - # three pieces of data: error code, error message, and error details. - # - # You can find out more about this error model and how to work with it in the - # [API Design Guide](https://cloud.google.com/apis/design/errors). - # @!attribute [rw] code - # @return [::Integer] - # The status code, which should be an enum value of - # [google.rpc.Code][google.rpc.Code]. - # @!attribute [rw] message - # @return [::String] - # A developer-facing error message, which should be in English. Any - # user-facing error message should be localized and sent in the - # {::Google::Rpc::Status#details google.rpc.Status.details} field, or localized - # by the client. - # @!attribute [rw] details - # @return [::Array<::Google::Protobuf::Any>] - # A list of messages that carry the error details. There is a common set of - # message types for APIs to use. - class Status - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - end -end diff --git a/owl-bot-staging/google-cloud-security_center-v1p1beta1/proto_docs/google/type/expr.rb b/owl-bot-staging/google-cloud-security_center-v1p1beta1/proto_docs/google/type/expr.rb deleted file mode 100644 index 53e7733b6592..000000000000 --- a/owl-bot-staging/google-cloud-security_center-v1p1beta1/proto_docs/google/type/expr.rb +++ /dev/null @@ -1,75 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - - -module Google - module Type - # Represents a textual expression in the Common Expression Language (CEL) - # syntax. CEL is a C-like expression language. The syntax and semantics of CEL - # are documented at https://github.com/google/cel-spec. - # - # Example (Comparison): - # - # title: "Summary size limit" - # description: "Determines if a summary is less than 100 chars" - # expression: "document.summary.size() < 100" - # - # Example (Equality): - # - # title: "Requestor is owner" - # description: "Determines if requestor is the document owner" - # expression: "document.owner == request.auth.claims.email" - # - # Example (Logic): - # - # title: "Public documents" - # description: "Determine whether the document should be publicly visible" - # expression: "document.type != 'private' && document.type != 'internal'" - # - # Example (Data Manipulation): - # - # title: "Notification string" - # description: "Create a notification string with a timestamp." - # expression: "'New message received at ' + string(document.create_time)" - # - # The exact variables and functions that may be referenced within an expression - # are determined by the service that evaluates it. See the service - # documentation for additional information. - # @!attribute [rw] expression - # @return [::String] - # Textual representation of an expression in Common Expression Language - # syntax. - # @!attribute [rw] title - # @return [::String] - # Optional. Title for the expression, i.e. a short string describing - # its purpose. This can be used e.g. in UIs which allow to enter the - # expression. - # @!attribute [rw] description - # @return [::String] - # Optional. Description of the expression. This is a longer text which - # describes the expression, e.g. when hovered over it in a UI. - # @!attribute [rw] location - # @return [::String] - # Optional. String indicating the location of the expression for error - # reporting, e.g. a file name and a position in the file. - class Expr - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - end -end diff --git a/owl-bot-staging/google-cloud-security_center-v1p1beta1/snippets/Gemfile b/owl-bot-staging/google-cloud-security_center-v1p1beta1/snippets/Gemfile deleted file mode 100644 index a24351ce9260..000000000000 --- a/owl-bot-staging/google-cloud-security_center-v1p1beta1/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-security_center-v1p1beta1", path: "../" -else - gem "google-cloud-security_center-v1p1beta1" -end - -group :test do - gem "google-style", "~> 1.26.1" - gem "minitest", "~> 5.16" - gem "minitest-focus", "~> 1.1" - gem "minitest-hooks", "~> 1.5" -end diff --git a/owl-bot-staging/google-cloud-security_center-v1p1beta1/snippets/security_center/create_finding.rb b/owl-bot-staging/google-cloud-security_center-v1p1beta1/snippets/security_center/create_finding.rb deleted file mode 100644 index c000d93ed341..000000000000 --- a/owl-bot-staging/google-cloud-security_center-v1p1beta1/snippets/security_center/create_finding.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 securitycenter_v1p1beta1_generated_SecurityCenter_CreateFinding_sync] -require "google/cloud/security_center/v1p1beta1" - -## -# Snippet for the create_finding call in the SecurityCenter service -# -# This snippet has been automatically generated and should be regarded as a code -# template only. It will require modifications to work: -# - It may require correct/in-range values for request initialization. -# - It may require specifying regional endpoints when creating the service -# client as shown in https://cloud.google.com/ruby/docs/reference. -# -# This is an auto-generated example demonstrating basic usage of -# Google::Cloud::SecurityCenter::V1p1beta1::SecurityCenter::Client#create_finding. -# -def create_finding - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::SecurityCenter::V1p1beta1::SecurityCenter::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::SecurityCenter::V1p1beta1::CreateFindingRequest.new - - # Call the create_finding method. - result = client.create_finding request - - # The returned object is of type Google::Cloud::SecurityCenter::V1p1beta1::Finding. - p result -end -# [END securitycenter_v1p1beta1_generated_SecurityCenter_CreateFinding_sync] diff --git a/owl-bot-staging/google-cloud-security_center-v1p1beta1/snippets/security_center/create_notification_config.rb b/owl-bot-staging/google-cloud-security_center-v1p1beta1/snippets/security_center/create_notification_config.rb deleted file mode 100644 index acdc0989906e..000000000000 --- a/owl-bot-staging/google-cloud-security_center-v1p1beta1/snippets/security_center/create_notification_config.rb +++ /dev/null @@ -1,47 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -# [START securitycenter_v1p1beta1_generated_SecurityCenter_CreateNotificationConfig_sync] -require "google/cloud/security_center/v1p1beta1" - -## -# Snippet for the create_notification_config call in the SecurityCenter service -# -# This snippet has been automatically generated and should be regarded as a code -# template only. It will require modifications to work: -# - It may require correct/in-range values for request initialization. -# - It may require specifying regional endpoints when creating the service -# client as shown in https://cloud.google.com/ruby/docs/reference. -# -# This is an auto-generated example demonstrating basic usage of -# Google::Cloud::SecurityCenter::V1p1beta1::SecurityCenter::Client#create_notification_config. -# -def create_notification_config - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::SecurityCenter::V1p1beta1::SecurityCenter::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::SecurityCenter::V1p1beta1::CreateNotificationConfigRequest.new - - # Call the create_notification_config method. - result = client.create_notification_config request - - # The returned object is of type Google::Cloud::SecurityCenter::V1p1beta1::NotificationConfig. - p result -end -# [END securitycenter_v1p1beta1_generated_SecurityCenter_CreateNotificationConfig_sync] diff --git a/owl-bot-staging/google-cloud-security_center-v1p1beta1/snippets/security_center/create_source.rb b/owl-bot-staging/google-cloud-security_center-v1p1beta1/snippets/security_center/create_source.rb deleted file mode 100644 index 9bcf68679623..000000000000 --- a/owl-bot-staging/google-cloud-security_center-v1p1beta1/snippets/security_center/create_source.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 securitycenter_v1p1beta1_generated_SecurityCenter_CreateSource_sync] -require "google/cloud/security_center/v1p1beta1" - -## -# Snippet for the create_source call in the SecurityCenter service -# -# This snippet has been automatically generated and should be regarded as a code -# template only. It will require modifications to work: -# - It may require correct/in-range values for request initialization. -# - It may require specifying regional endpoints when creating the service -# client as shown in https://cloud.google.com/ruby/docs/reference. -# -# This is an auto-generated example demonstrating basic usage of -# Google::Cloud::SecurityCenter::V1p1beta1::SecurityCenter::Client#create_source. -# -def create_source - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::SecurityCenter::V1p1beta1::SecurityCenter::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::SecurityCenter::V1p1beta1::CreateSourceRequest.new - - # Call the create_source method. - result = client.create_source request - - # The returned object is of type Google::Cloud::SecurityCenter::V1p1beta1::Source. - p result -end -# [END securitycenter_v1p1beta1_generated_SecurityCenter_CreateSource_sync] diff --git a/owl-bot-staging/google-cloud-security_center-v1p1beta1/snippets/security_center/delete_notification_config.rb b/owl-bot-staging/google-cloud-security_center-v1p1beta1/snippets/security_center/delete_notification_config.rb deleted file mode 100644 index 442fcdf71d1b..000000000000 --- a/owl-bot-staging/google-cloud-security_center-v1p1beta1/snippets/security_center/delete_notification_config.rb +++ /dev/null @@ -1,47 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -# [START securitycenter_v1p1beta1_generated_SecurityCenter_DeleteNotificationConfig_sync] -require "google/cloud/security_center/v1p1beta1" - -## -# Snippet for the delete_notification_config call in the SecurityCenter service -# -# This snippet has been automatically generated and should be regarded as a code -# template only. It will require modifications to work: -# - It may require correct/in-range values for request initialization. -# - It may require specifying regional endpoints when creating the service -# client as shown in https://cloud.google.com/ruby/docs/reference. -# -# This is an auto-generated example demonstrating basic usage of -# Google::Cloud::SecurityCenter::V1p1beta1::SecurityCenter::Client#delete_notification_config. -# -def delete_notification_config - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::SecurityCenter::V1p1beta1::SecurityCenter::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::SecurityCenter::V1p1beta1::DeleteNotificationConfigRequest.new - - # Call the delete_notification_config method. - result = client.delete_notification_config request - - # The returned object is of type Google::Protobuf::Empty. - p result -end -# [END securitycenter_v1p1beta1_generated_SecurityCenter_DeleteNotificationConfig_sync] diff --git a/owl-bot-staging/google-cloud-security_center-v1p1beta1/snippets/security_center/get_iam_policy.rb b/owl-bot-staging/google-cloud-security_center-v1p1beta1/snippets/security_center/get_iam_policy.rb deleted file mode 100644 index 88f1888b1521..000000000000 --- a/owl-bot-staging/google-cloud-security_center-v1p1beta1/snippets/security_center/get_iam_policy.rb +++ /dev/null @@ -1,47 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -# [START securitycenter_v1p1beta1_generated_SecurityCenter_GetIamPolicy_sync] -require "google/cloud/security_center/v1p1beta1" - -## -# Snippet for the get_iam_policy call in the SecurityCenter service -# -# This snippet has been automatically generated and should be regarded as a code -# template only. It will require modifications to work: -# - It may require correct/in-range values for request initialization. -# - It may require specifying regional endpoints when creating the service -# client as shown in https://cloud.google.com/ruby/docs/reference. -# -# This is an auto-generated example demonstrating basic usage of -# Google::Cloud::SecurityCenter::V1p1beta1::SecurityCenter::Client#get_iam_policy. -# -def get_iam_policy - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::SecurityCenter::V1p1beta1::SecurityCenter::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Iam::V1::GetIamPolicyRequest.new - - # Call the get_iam_policy method. - result = client.get_iam_policy request - - # The returned object is of type Google::Iam::V1::Policy. - p result -end -# [END securitycenter_v1p1beta1_generated_SecurityCenter_GetIamPolicy_sync] diff --git a/owl-bot-staging/google-cloud-security_center-v1p1beta1/snippets/security_center/get_notification_config.rb b/owl-bot-staging/google-cloud-security_center-v1p1beta1/snippets/security_center/get_notification_config.rb deleted file mode 100644 index feaf9ce7665a..000000000000 --- a/owl-bot-staging/google-cloud-security_center-v1p1beta1/snippets/security_center/get_notification_config.rb +++ /dev/null @@ -1,47 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -# [START securitycenter_v1p1beta1_generated_SecurityCenter_GetNotificationConfig_sync] -require "google/cloud/security_center/v1p1beta1" - -## -# Snippet for the get_notification_config call in the SecurityCenter service -# -# This snippet has been automatically generated and should be regarded as a code -# template only. It will require modifications to work: -# - It may require correct/in-range values for request initialization. -# - It may require specifying regional endpoints when creating the service -# client as shown in https://cloud.google.com/ruby/docs/reference. -# -# This is an auto-generated example demonstrating basic usage of -# Google::Cloud::SecurityCenter::V1p1beta1::SecurityCenter::Client#get_notification_config. -# -def get_notification_config - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::SecurityCenter::V1p1beta1::SecurityCenter::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::SecurityCenter::V1p1beta1::GetNotificationConfigRequest.new - - # Call the get_notification_config method. - result = client.get_notification_config request - - # The returned object is of type Google::Cloud::SecurityCenter::V1p1beta1::NotificationConfig. - p result -end -# [END securitycenter_v1p1beta1_generated_SecurityCenter_GetNotificationConfig_sync] diff --git a/owl-bot-staging/google-cloud-security_center-v1p1beta1/snippets/security_center/get_organization_settings.rb b/owl-bot-staging/google-cloud-security_center-v1p1beta1/snippets/security_center/get_organization_settings.rb deleted file mode 100644 index 7bed3a6a574a..000000000000 --- a/owl-bot-staging/google-cloud-security_center-v1p1beta1/snippets/security_center/get_organization_settings.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 securitycenter_v1p1beta1_generated_SecurityCenter_GetOrganizationSettings_sync] -require "google/cloud/security_center/v1p1beta1" - -## -# Snippet for the get_organization_settings call in the SecurityCenter service -# -# This snippet has been automatically generated and should be regarded as a code -# template only. It will require modifications to work: -# - It may require correct/in-range values for request initialization. -# - It may require specifying regional endpoints when creating the service -# client as shown in https://cloud.google.com/ruby/docs/reference. -# -# This is an auto-generated example demonstrating basic usage of -# Google::Cloud::SecurityCenter::V1p1beta1::SecurityCenter::Client#get_organization_settings. -# -def get_organization_settings - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::SecurityCenter::V1p1beta1::SecurityCenter::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::SecurityCenter::V1p1beta1::GetOrganizationSettingsRequest.new - - # Call the get_organization_settings method. - result = client.get_organization_settings request - - # The returned object is of type Google::Cloud::SecurityCenter::V1p1beta1::OrganizationSettings. - p result -end -# [END securitycenter_v1p1beta1_generated_SecurityCenter_GetOrganizationSettings_sync] diff --git a/owl-bot-staging/google-cloud-security_center-v1p1beta1/snippets/security_center/get_source.rb b/owl-bot-staging/google-cloud-security_center-v1p1beta1/snippets/security_center/get_source.rb deleted file mode 100644 index 9616dc30e5e4..000000000000 --- a/owl-bot-staging/google-cloud-security_center-v1p1beta1/snippets/security_center/get_source.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 securitycenter_v1p1beta1_generated_SecurityCenter_GetSource_sync] -require "google/cloud/security_center/v1p1beta1" - -## -# Snippet for the get_source call in the SecurityCenter service -# -# This snippet has been automatically generated and should be regarded as a code -# template only. It will require modifications to work: -# - It may require correct/in-range values for request initialization. -# - It may require specifying regional endpoints when creating the service -# client as shown in https://cloud.google.com/ruby/docs/reference. -# -# This is an auto-generated example demonstrating basic usage of -# Google::Cloud::SecurityCenter::V1p1beta1::SecurityCenter::Client#get_source. -# -def get_source - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::SecurityCenter::V1p1beta1::SecurityCenter::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::SecurityCenter::V1p1beta1::GetSourceRequest.new - - # Call the get_source method. - result = client.get_source request - - # The returned object is of type Google::Cloud::SecurityCenter::V1p1beta1::Source. - p result -end -# [END securitycenter_v1p1beta1_generated_SecurityCenter_GetSource_sync] diff --git a/owl-bot-staging/google-cloud-security_center-v1p1beta1/snippets/security_center/group_assets.rb b/owl-bot-staging/google-cloud-security_center-v1p1beta1/snippets/security_center/group_assets.rb deleted file mode 100644 index fba016390793..000000000000 --- a/owl-bot-staging/google-cloud-security_center-v1p1beta1/snippets/security_center/group_assets.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 securitycenter_v1p1beta1_generated_SecurityCenter_GroupAssets_sync] -require "google/cloud/security_center/v1p1beta1" - -## -# Snippet for the group_assets call in the SecurityCenter service -# -# This snippet has been automatically generated and should be regarded as a code -# template only. It will require modifications to work: -# - It may require correct/in-range values for request initialization. -# - It may require specifying regional endpoints when creating the service -# client as shown in https://cloud.google.com/ruby/docs/reference. -# -# This is an auto-generated example demonstrating basic usage of -# Google::Cloud::SecurityCenter::V1p1beta1::SecurityCenter::Client#group_assets. -# -def group_assets - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::SecurityCenter::V1p1beta1::SecurityCenter::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::SecurityCenter::V1p1beta1::GroupAssetsRequest.new - - # Call the group_assets method. - result = client.group_assets request - - # The returned object is of type Gapic::PagedEnumerable. You can iterate - # over elements, and API calls will be issued to fetch pages as needed. - result.each do |item| - # Each element is of type ::Google::Cloud::SecurityCenter::V1p1beta1::GroupResult. - p item - end -end -# [END securitycenter_v1p1beta1_generated_SecurityCenter_GroupAssets_sync] diff --git a/owl-bot-staging/google-cloud-security_center-v1p1beta1/snippets/security_center/group_findings.rb b/owl-bot-staging/google-cloud-security_center-v1p1beta1/snippets/security_center/group_findings.rb deleted file mode 100644 index 6357692d3a5b..000000000000 --- a/owl-bot-staging/google-cloud-security_center-v1p1beta1/snippets/security_center/group_findings.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 securitycenter_v1p1beta1_generated_SecurityCenter_GroupFindings_sync] -require "google/cloud/security_center/v1p1beta1" - -## -# Snippet for the group_findings call in the SecurityCenter service -# -# This snippet has been automatically generated and should be regarded as a code -# template only. It will require modifications to work: -# - It may require correct/in-range values for request initialization. -# - It may require specifying regional endpoints when creating the service -# client as shown in https://cloud.google.com/ruby/docs/reference. -# -# This is an auto-generated example demonstrating basic usage of -# Google::Cloud::SecurityCenter::V1p1beta1::SecurityCenter::Client#group_findings. -# -def group_findings - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::SecurityCenter::V1p1beta1::SecurityCenter::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::SecurityCenter::V1p1beta1::GroupFindingsRequest.new - - # Call the group_findings method. - result = client.group_findings request - - # The returned object is of type Gapic::PagedEnumerable. You can iterate - # over elements, and API calls will be issued to fetch pages as needed. - result.each do |item| - # Each element is of type ::Google::Cloud::SecurityCenter::V1p1beta1::GroupResult. - p item - end -end -# [END securitycenter_v1p1beta1_generated_SecurityCenter_GroupFindings_sync] diff --git a/owl-bot-staging/google-cloud-security_center-v1p1beta1/snippets/security_center/list_assets.rb b/owl-bot-staging/google-cloud-security_center-v1p1beta1/snippets/security_center/list_assets.rb deleted file mode 100644 index 9b4cfc34f62b..000000000000 --- a/owl-bot-staging/google-cloud-security_center-v1p1beta1/snippets/security_center/list_assets.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 securitycenter_v1p1beta1_generated_SecurityCenter_ListAssets_sync] -require "google/cloud/security_center/v1p1beta1" - -## -# Snippet for the list_assets call in the SecurityCenter service -# -# This snippet has been automatically generated and should be regarded as a code -# template only. It will require modifications to work: -# - It may require correct/in-range values for request initialization. -# - It may require specifying regional endpoints when creating the service -# client as shown in https://cloud.google.com/ruby/docs/reference. -# -# This is an auto-generated example demonstrating basic usage of -# Google::Cloud::SecurityCenter::V1p1beta1::SecurityCenter::Client#list_assets. -# -def list_assets - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::SecurityCenter::V1p1beta1::SecurityCenter::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::SecurityCenter::V1p1beta1::ListAssetsRequest.new - - # Call the list_assets method. - result = client.list_assets request - - # The returned object is of type Gapic::PagedEnumerable. You can iterate - # over elements, and API calls will be issued to fetch pages as needed. - result.each do |item| - # Each element is of type ::Google::Cloud::SecurityCenter::V1p1beta1::ListAssetsResponse::ListAssetsResult. - p item - end -end -# [END securitycenter_v1p1beta1_generated_SecurityCenter_ListAssets_sync] diff --git a/owl-bot-staging/google-cloud-security_center-v1p1beta1/snippets/security_center/list_findings.rb b/owl-bot-staging/google-cloud-security_center-v1p1beta1/snippets/security_center/list_findings.rb deleted file mode 100644 index 9c8bc97942e4..000000000000 --- a/owl-bot-staging/google-cloud-security_center-v1p1beta1/snippets/security_center/list_findings.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 securitycenter_v1p1beta1_generated_SecurityCenter_ListFindings_sync] -require "google/cloud/security_center/v1p1beta1" - -## -# Snippet for the list_findings call in the SecurityCenter service -# -# This snippet has been automatically generated and should be regarded as a code -# template only. It will require modifications to work: -# - It may require correct/in-range values for request initialization. -# - It may require specifying regional endpoints when creating the service -# client as shown in https://cloud.google.com/ruby/docs/reference. -# -# This is an auto-generated example demonstrating basic usage of -# Google::Cloud::SecurityCenter::V1p1beta1::SecurityCenter::Client#list_findings. -# -def list_findings - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::SecurityCenter::V1p1beta1::SecurityCenter::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::SecurityCenter::V1p1beta1::ListFindingsRequest.new - - # Call the list_findings method. - result = client.list_findings request - - # The returned object is of type Gapic::PagedEnumerable. You can iterate - # over elements, and API calls will be issued to fetch pages as needed. - result.each do |item| - # Each element is of type ::Google::Cloud::SecurityCenter::V1p1beta1::ListFindingsResponse::ListFindingsResult. - p item - end -end -# [END securitycenter_v1p1beta1_generated_SecurityCenter_ListFindings_sync] diff --git a/owl-bot-staging/google-cloud-security_center-v1p1beta1/snippets/security_center/list_notification_configs.rb b/owl-bot-staging/google-cloud-security_center-v1p1beta1/snippets/security_center/list_notification_configs.rb deleted file mode 100644 index ea961a24d957..000000000000 --- a/owl-bot-staging/google-cloud-security_center-v1p1beta1/snippets/security_center/list_notification_configs.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 securitycenter_v1p1beta1_generated_SecurityCenter_ListNotificationConfigs_sync] -require "google/cloud/security_center/v1p1beta1" - -## -# Snippet for the list_notification_configs call in the SecurityCenter service -# -# This snippet has been automatically generated and should be regarded as a code -# template only. It will require modifications to work: -# - It may require correct/in-range values for request initialization. -# - It may require specifying regional endpoints when creating the service -# client as shown in https://cloud.google.com/ruby/docs/reference. -# -# This is an auto-generated example demonstrating basic usage of -# Google::Cloud::SecurityCenter::V1p1beta1::SecurityCenter::Client#list_notification_configs. -# -def list_notification_configs - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::SecurityCenter::V1p1beta1::SecurityCenter::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::SecurityCenter::V1p1beta1::ListNotificationConfigsRequest.new - - # Call the list_notification_configs method. - result = client.list_notification_configs request - - # The returned object is of type Gapic::PagedEnumerable. You can iterate - # over elements, and API calls will be issued to fetch pages as needed. - result.each do |item| - # Each element is of type ::Google::Cloud::SecurityCenter::V1p1beta1::NotificationConfig. - p item - end -end -# [END securitycenter_v1p1beta1_generated_SecurityCenter_ListNotificationConfigs_sync] diff --git a/owl-bot-staging/google-cloud-security_center-v1p1beta1/snippets/security_center/list_sources.rb b/owl-bot-staging/google-cloud-security_center-v1p1beta1/snippets/security_center/list_sources.rb deleted file mode 100644 index d87dee47b0ed..000000000000 --- a/owl-bot-staging/google-cloud-security_center-v1p1beta1/snippets/security_center/list_sources.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 securitycenter_v1p1beta1_generated_SecurityCenter_ListSources_sync] -require "google/cloud/security_center/v1p1beta1" - -## -# Snippet for the list_sources call in the SecurityCenter service -# -# This snippet has been automatically generated and should be regarded as a code -# template only. It will require modifications to work: -# - It may require correct/in-range values for request initialization. -# - It may require specifying regional endpoints when creating the service -# client as shown in https://cloud.google.com/ruby/docs/reference. -# -# This is an auto-generated example demonstrating basic usage of -# Google::Cloud::SecurityCenter::V1p1beta1::SecurityCenter::Client#list_sources. -# -def list_sources - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::SecurityCenter::V1p1beta1::SecurityCenter::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::SecurityCenter::V1p1beta1::ListSourcesRequest.new - - # Call the list_sources method. - result = client.list_sources request - - # The returned object is of type Gapic::PagedEnumerable. You can iterate - # over elements, and API calls will be issued to fetch pages as needed. - result.each do |item| - # Each element is of type ::Google::Cloud::SecurityCenter::V1p1beta1::Source. - p item - end -end -# [END securitycenter_v1p1beta1_generated_SecurityCenter_ListSources_sync] diff --git a/owl-bot-staging/google-cloud-security_center-v1p1beta1/snippets/security_center/run_asset_discovery.rb b/owl-bot-staging/google-cloud-security_center-v1p1beta1/snippets/security_center/run_asset_discovery.rb deleted file mode 100644 index 2065af062b64..000000000000 --- a/owl-bot-staging/google-cloud-security_center-v1p1beta1/snippets/security_center/run_asset_discovery.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 securitycenter_v1p1beta1_generated_SecurityCenter_RunAssetDiscovery_sync] -require "google/cloud/security_center/v1p1beta1" - -## -# Snippet for the run_asset_discovery call in the SecurityCenter service -# -# This snippet has been automatically generated and should be regarded as a code -# template only. It will require modifications to work: -# - It may require correct/in-range values for request initialization. -# - It may require specifying regional endpoints when creating the service -# client as shown in https://cloud.google.com/ruby/docs/reference. -# -# This is an auto-generated example demonstrating basic usage of -# Google::Cloud::SecurityCenter::V1p1beta1::SecurityCenter::Client#run_asset_discovery. -# -def run_asset_discovery - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::SecurityCenter::V1p1beta1::SecurityCenter::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::SecurityCenter::V1p1beta1::RunAssetDiscoveryRequest.new - - # Call the run_asset_discovery method. - result = client.run_asset_discovery 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 securitycenter_v1p1beta1_generated_SecurityCenter_RunAssetDiscovery_sync] diff --git a/owl-bot-staging/google-cloud-security_center-v1p1beta1/snippets/security_center/set_finding_state.rb b/owl-bot-staging/google-cloud-security_center-v1p1beta1/snippets/security_center/set_finding_state.rb deleted file mode 100644 index 915284737f2e..000000000000 --- a/owl-bot-staging/google-cloud-security_center-v1p1beta1/snippets/security_center/set_finding_state.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 securitycenter_v1p1beta1_generated_SecurityCenter_SetFindingState_sync] -require "google/cloud/security_center/v1p1beta1" - -## -# Snippet for the set_finding_state call in the SecurityCenter service -# -# This snippet has been automatically generated and should be regarded as a code -# template only. It will require modifications to work: -# - It may require correct/in-range values for request initialization. -# - It may require specifying regional endpoints when creating the service -# client as shown in https://cloud.google.com/ruby/docs/reference. -# -# This is an auto-generated example demonstrating basic usage of -# Google::Cloud::SecurityCenter::V1p1beta1::SecurityCenter::Client#set_finding_state. -# -def set_finding_state - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::SecurityCenter::V1p1beta1::SecurityCenter::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::SecurityCenter::V1p1beta1::SetFindingStateRequest.new - - # Call the set_finding_state method. - result = client.set_finding_state request - - # The returned object is of type Google::Cloud::SecurityCenter::V1p1beta1::Finding. - p result -end -# [END securitycenter_v1p1beta1_generated_SecurityCenter_SetFindingState_sync] diff --git a/owl-bot-staging/google-cloud-security_center-v1p1beta1/snippets/security_center/set_iam_policy.rb b/owl-bot-staging/google-cloud-security_center-v1p1beta1/snippets/security_center/set_iam_policy.rb deleted file mode 100644 index 984368e397b1..000000000000 --- a/owl-bot-staging/google-cloud-security_center-v1p1beta1/snippets/security_center/set_iam_policy.rb +++ /dev/null @@ -1,47 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -# [START securitycenter_v1p1beta1_generated_SecurityCenter_SetIamPolicy_sync] -require "google/cloud/security_center/v1p1beta1" - -## -# Snippet for the set_iam_policy call in the SecurityCenter service -# -# This snippet has been automatically generated and should be regarded as a code -# template only. It will require modifications to work: -# - It may require correct/in-range values for request initialization. -# - It may require specifying regional endpoints when creating the service -# client as shown in https://cloud.google.com/ruby/docs/reference. -# -# This is an auto-generated example demonstrating basic usage of -# Google::Cloud::SecurityCenter::V1p1beta1::SecurityCenter::Client#set_iam_policy. -# -def set_iam_policy - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::SecurityCenter::V1p1beta1::SecurityCenter::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Iam::V1::SetIamPolicyRequest.new - - # Call the set_iam_policy method. - result = client.set_iam_policy request - - # The returned object is of type Google::Iam::V1::Policy. - p result -end -# [END securitycenter_v1p1beta1_generated_SecurityCenter_SetIamPolicy_sync] diff --git a/owl-bot-staging/google-cloud-security_center-v1p1beta1/snippets/security_center/test_iam_permissions.rb b/owl-bot-staging/google-cloud-security_center-v1p1beta1/snippets/security_center/test_iam_permissions.rb deleted file mode 100644 index 279ca1f58995..000000000000 --- a/owl-bot-staging/google-cloud-security_center-v1p1beta1/snippets/security_center/test_iam_permissions.rb +++ /dev/null @@ -1,47 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -# [START securitycenter_v1p1beta1_generated_SecurityCenter_TestIamPermissions_sync] -require "google/cloud/security_center/v1p1beta1" - -## -# Snippet for the test_iam_permissions call in the SecurityCenter service -# -# This snippet has been automatically generated and should be regarded as a code -# template only. It will require modifications to work: -# - It may require correct/in-range values for request initialization. -# - It may require specifying regional endpoints when creating the service -# client as shown in https://cloud.google.com/ruby/docs/reference. -# -# This is an auto-generated example demonstrating basic usage of -# Google::Cloud::SecurityCenter::V1p1beta1::SecurityCenter::Client#test_iam_permissions. -# -def test_iam_permissions - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::SecurityCenter::V1p1beta1::SecurityCenter::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Iam::V1::TestIamPermissionsRequest.new - - # Call the test_iam_permissions method. - result = client.test_iam_permissions request - - # The returned object is of type Google::Iam::V1::TestIamPermissionsResponse. - p result -end -# [END securitycenter_v1p1beta1_generated_SecurityCenter_TestIamPermissions_sync] diff --git a/owl-bot-staging/google-cloud-security_center-v1p1beta1/snippets/security_center/update_finding.rb b/owl-bot-staging/google-cloud-security_center-v1p1beta1/snippets/security_center/update_finding.rb deleted file mode 100644 index 7a803d222ecc..000000000000 --- a/owl-bot-staging/google-cloud-security_center-v1p1beta1/snippets/security_center/update_finding.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 securitycenter_v1p1beta1_generated_SecurityCenter_UpdateFinding_sync] -require "google/cloud/security_center/v1p1beta1" - -## -# Snippet for the update_finding call in the SecurityCenter service -# -# This snippet has been automatically generated and should be regarded as a code -# template only. It will require modifications to work: -# - It may require correct/in-range values for request initialization. -# - It may require specifying regional endpoints when creating the service -# client as shown in https://cloud.google.com/ruby/docs/reference. -# -# This is an auto-generated example demonstrating basic usage of -# Google::Cloud::SecurityCenter::V1p1beta1::SecurityCenter::Client#update_finding. -# -def update_finding - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::SecurityCenter::V1p1beta1::SecurityCenter::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::SecurityCenter::V1p1beta1::UpdateFindingRequest.new - - # Call the update_finding method. - result = client.update_finding request - - # The returned object is of type Google::Cloud::SecurityCenter::V1p1beta1::Finding. - p result -end -# [END securitycenter_v1p1beta1_generated_SecurityCenter_UpdateFinding_sync] diff --git a/owl-bot-staging/google-cloud-security_center-v1p1beta1/snippets/security_center/update_notification_config.rb b/owl-bot-staging/google-cloud-security_center-v1p1beta1/snippets/security_center/update_notification_config.rb deleted file mode 100644 index 6b814475d958..000000000000 --- a/owl-bot-staging/google-cloud-security_center-v1p1beta1/snippets/security_center/update_notification_config.rb +++ /dev/null @@ -1,47 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -# [START securitycenter_v1p1beta1_generated_SecurityCenter_UpdateNotificationConfig_sync] -require "google/cloud/security_center/v1p1beta1" - -## -# Snippet for the update_notification_config call in the SecurityCenter service -# -# This snippet has been automatically generated and should be regarded as a code -# template only. It will require modifications to work: -# - It may require correct/in-range values for request initialization. -# - It may require specifying regional endpoints when creating the service -# client as shown in https://cloud.google.com/ruby/docs/reference. -# -# This is an auto-generated example demonstrating basic usage of -# Google::Cloud::SecurityCenter::V1p1beta1::SecurityCenter::Client#update_notification_config. -# -def update_notification_config - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::SecurityCenter::V1p1beta1::SecurityCenter::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::SecurityCenter::V1p1beta1::UpdateNotificationConfigRequest.new - - # Call the update_notification_config method. - result = client.update_notification_config request - - # The returned object is of type Google::Cloud::SecurityCenter::V1p1beta1::NotificationConfig. - p result -end -# [END securitycenter_v1p1beta1_generated_SecurityCenter_UpdateNotificationConfig_sync] diff --git a/owl-bot-staging/google-cloud-security_center-v1p1beta1/snippets/security_center/update_organization_settings.rb b/owl-bot-staging/google-cloud-security_center-v1p1beta1/snippets/security_center/update_organization_settings.rb deleted file mode 100644 index e16bd81a9532..000000000000 --- a/owl-bot-staging/google-cloud-security_center-v1p1beta1/snippets/security_center/update_organization_settings.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 securitycenter_v1p1beta1_generated_SecurityCenter_UpdateOrganizationSettings_sync] -require "google/cloud/security_center/v1p1beta1" - -## -# Snippet for the update_organization_settings call in the SecurityCenter service -# -# This snippet has been automatically generated and should be regarded as a code -# template only. It will require modifications to work: -# - It may require correct/in-range values for request initialization. -# - It may require specifying regional endpoints when creating the service -# client as shown in https://cloud.google.com/ruby/docs/reference. -# -# This is an auto-generated example demonstrating basic usage of -# Google::Cloud::SecurityCenter::V1p1beta1::SecurityCenter::Client#update_organization_settings. -# -def update_organization_settings - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::SecurityCenter::V1p1beta1::SecurityCenter::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::SecurityCenter::V1p1beta1::UpdateOrganizationSettingsRequest.new - - # Call the update_organization_settings method. - result = client.update_organization_settings request - - # The returned object is of type Google::Cloud::SecurityCenter::V1p1beta1::OrganizationSettings. - p result -end -# [END securitycenter_v1p1beta1_generated_SecurityCenter_UpdateOrganizationSettings_sync] diff --git a/owl-bot-staging/google-cloud-security_center-v1p1beta1/snippets/security_center/update_security_marks.rb b/owl-bot-staging/google-cloud-security_center-v1p1beta1/snippets/security_center/update_security_marks.rb deleted file mode 100644 index 1eb75d7733ee..000000000000 --- a/owl-bot-staging/google-cloud-security_center-v1p1beta1/snippets/security_center/update_security_marks.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 securitycenter_v1p1beta1_generated_SecurityCenter_UpdateSecurityMarks_sync] -require "google/cloud/security_center/v1p1beta1" - -## -# Snippet for the update_security_marks call in the SecurityCenter service -# -# This snippet has been automatically generated and should be regarded as a code -# template only. It will require modifications to work: -# - It may require correct/in-range values for request initialization. -# - It may require specifying regional endpoints when creating the service -# client as shown in https://cloud.google.com/ruby/docs/reference. -# -# This is an auto-generated example demonstrating basic usage of -# Google::Cloud::SecurityCenter::V1p1beta1::SecurityCenter::Client#update_security_marks. -# -def update_security_marks - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::SecurityCenter::V1p1beta1::SecurityCenter::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::SecurityCenter::V1p1beta1::UpdateSecurityMarksRequest.new - - # Call the update_security_marks method. - result = client.update_security_marks request - - # The returned object is of type Google::Cloud::SecurityCenter::V1p1beta1::SecurityMarks. - p result -end -# [END securitycenter_v1p1beta1_generated_SecurityCenter_UpdateSecurityMarks_sync] diff --git a/owl-bot-staging/google-cloud-security_center-v1p1beta1/snippets/security_center/update_source.rb b/owl-bot-staging/google-cloud-security_center-v1p1beta1/snippets/security_center/update_source.rb deleted file mode 100644 index 7bc0b249e94c..000000000000 --- a/owl-bot-staging/google-cloud-security_center-v1p1beta1/snippets/security_center/update_source.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 securitycenter_v1p1beta1_generated_SecurityCenter_UpdateSource_sync] -require "google/cloud/security_center/v1p1beta1" - -## -# Snippet for the update_source call in the SecurityCenter service -# -# This snippet has been automatically generated and should be regarded as a code -# template only. It will require modifications to work: -# - It may require correct/in-range values for request initialization. -# - It may require specifying regional endpoints when creating the service -# client as shown in https://cloud.google.com/ruby/docs/reference. -# -# This is an auto-generated example demonstrating basic usage of -# Google::Cloud::SecurityCenter::V1p1beta1::SecurityCenter::Client#update_source. -# -def update_source - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::SecurityCenter::V1p1beta1::SecurityCenter::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::SecurityCenter::V1p1beta1::UpdateSourceRequest.new - - # Call the update_source method. - result = client.update_source request - - # The returned object is of type Google::Cloud::SecurityCenter::V1p1beta1::Source. - p result -end -# [END securitycenter_v1p1beta1_generated_SecurityCenter_UpdateSource_sync] diff --git a/owl-bot-staging/google-cloud-security_center-v1p1beta1/snippets/snippet_metadata_google.cloud.securitycenter.v1p1beta1.json b/owl-bot-staging/google-cloud-security_center-v1p1beta1/snippets/snippet_metadata_google.cloud.securitycenter.v1p1beta1.json deleted file mode 100644 index ea07c1b867ac..000000000000 --- a/owl-bot-staging/google-cloud-security_center-v1p1beta1/snippets/snippet_metadata_google.cloud.securitycenter.v1p1beta1.json +++ /dev/null @@ -1,935 +0,0 @@ -{ - "client_library": { - "name": "google-cloud-security_center-v1p1beta1", - "version": "", - "language": "RUBY", - "apis": [ - { - "id": "google.cloud.securitycenter.v1p1beta1", - "version": "v1p1beta1" - } - ] - }, - "snippets": [ - { - "region_tag": "securitycenter_v1p1beta1_generated_SecurityCenter_CreateSource_sync", - "title": "Snippet for the create_source call in the SecurityCenter service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::SecurityCenter::V1p1beta1::SecurityCenter::Client#create_source.", - "file": "security_center/create_source.rb", - "language": "RUBY", - "client_method": { - "short_name": "create_source", - "full_name": "::Google::Cloud::SecurityCenter::V1p1beta1::SecurityCenter::Client#create_source", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::SecurityCenter::V1p1beta1::CreateSourceRequest", - "name": "request" - } - ], - "result_type": "::Google::Cloud::SecurityCenter::V1p1beta1::Source", - "client": { - "short_name": "SecurityCenter::Client", - "full_name": "::Google::Cloud::SecurityCenter::V1p1beta1::SecurityCenter::Client" - }, - "method": { - "short_name": "CreateSource", - "full_name": "google.cloud.securitycenter.v1p1beta1.SecurityCenter.CreateSource", - "service": { - "short_name": "SecurityCenter", - "full_name": "google.cloud.securitycenter.v1p1beta1.SecurityCenter" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 46, - "type": "FULL" - } - ] - }, - { - "region_tag": "securitycenter_v1p1beta1_generated_SecurityCenter_CreateFinding_sync", - "title": "Snippet for the create_finding call in the SecurityCenter service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::SecurityCenter::V1p1beta1::SecurityCenter::Client#create_finding.", - "file": "security_center/create_finding.rb", - "language": "RUBY", - "client_method": { - "short_name": "create_finding", - "full_name": "::Google::Cloud::SecurityCenter::V1p1beta1::SecurityCenter::Client#create_finding", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::SecurityCenter::V1p1beta1::CreateFindingRequest", - "name": "request" - } - ], - "result_type": "::Google::Cloud::SecurityCenter::V1p1beta1::Finding", - "client": { - "short_name": "SecurityCenter::Client", - "full_name": "::Google::Cloud::SecurityCenter::V1p1beta1::SecurityCenter::Client" - }, - "method": { - "short_name": "CreateFinding", - "full_name": "google.cloud.securitycenter.v1p1beta1.SecurityCenter.CreateFinding", - "service": { - "short_name": "SecurityCenter", - "full_name": "google.cloud.securitycenter.v1p1beta1.SecurityCenter" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 46, - "type": "FULL" - } - ] - }, - { - "region_tag": "securitycenter_v1p1beta1_generated_SecurityCenter_CreateNotificationConfig_sync", - "title": "Snippet for the create_notification_config call in the SecurityCenter service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::SecurityCenter::V1p1beta1::SecurityCenter::Client#create_notification_config.", - "file": "security_center/create_notification_config.rb", - "language": "RUBY", - "client_method": { - "short_name": "create_notification_config", - "full_name": "::Google::Cloud::SecurityCenter::V1p1beta1::SecurityCenter::Client#create_notification_config", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::SecurityCenter::V1p1beta1::CreateNotificationConfigRequest", - "name": "request" - } - ], - "result_type": "::Google::Cloud::SecurityCenter::V1p1beta1::NotificationConfig", - "client": { - "short_name": "SecurityCenter::Client", - "full_name": "::Google::Cloud::SecurityCenter::V1p1beta1::SecurityCenter::Client" - }, - "method": { - "short_name": "CreateNotificationConfig", - "full_name": "google.cloud.securitycenter.v1p1beta1.SecurityCenter.CreateNotificationConfig", - "service": { - "short_name": "SecurityCenter", - "full_name": "google.cloud.securitycenter.v1p1beta1.SecurityCenter" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 46, - "type": "FULL" - } - ] - }, - { - "region_tag": "securitycenter_v1p1beta1_generated_SecurityCenter_DeleteNotificationConfig_sync", - "title": "Snippet for the delete_notification_config call in the SecurityCenter service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::SecurityCenter::V1p1beta1::SecurityCenter::Client#delete_notification_config.", - "file": "security_center/delete_notification_config.rb", - "language": "RUBY", - "client_method": { - "short_name": "delete_notification_config", - "full_name": "::Google::Cloud::SecurityCenter::V1p1beta1::SecurityCenter::Client#delete_notification_config", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::SecurityCenter::V1p1beta1::DeleteNotificationConfigRequest", - "name": "request" - } - ], - "result_type": "::Google::Protobuf::Empty", - "client": { - "short_name": "SecurityCenter::Client", - "full_name": "::Google::Cloud::SecurityCenter::V1p1beta1::SecurityCenter::Client" - }, - "method": { - "short_name": "DeleteNotificationConfig", - "full_name": "google.cloud.securitycenter.v1p1beta1.SecurityCenter.DeleteNotificationConfig", - "service": { - "short_name": "SecurityCenter", - "full_name": "google.cloud.securitycenter.v1p1beta1.SecurityCenter" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 46, - "type": "FULL" - } - ] - }, - { - "region_tag": "securitycenter_v1p1beta1_generated_SecurityCenter_GetIamPolicy_sync", - "title": "Snippet for the get_iam_policy call in the SecurityCenter service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::SecurityCenter::V1p1beta1::SecurityCenter::Client#get_iam_policy.", - "file": "security_center/get_iam_policy.rb", - "language": "RUBY", - "client_method": { - "short_name": "get_iam_policy", - "full_name": "::Google::Cloud::SecurityCenter::V1p1beta1::SecurityCenter::Client#get_iam_policy", - "async": false, - "parameters": [ - { - "type": "::Google::Iam::V1::GetIamPolicyRequest", - "name": "request" - } - ], - "result_type": "::Google::Iam::V1::Policy", - "client": { - "short_name": "SecurityCenter::Client", - "full_name": "::Google::Cloud::SecurityCenter::V1p1beta1::SecurityCenter::Client" - }, - "method": { - "short_name": "GetIamPolicy", - "full_name": "google.cloud.securitycenter.v1p1beta1.SecurityCenter.GetIamPolicy", - "service": { - "short_name": "SecurityCenter", - "full_name": "google.cloud.securitycenter.v1p1beta1.SecurityCenter" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 46, - "type": "FULL" - } - ] - }, - { - "region_tag": "securitycenter_v1p1beta1_generated_SecurityCenter_GetNotificationConfig_sync", - "title": "Snippet for the get_notification_config call in the SecurityCenter service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::SecurityCenter::V1p1beta1::SecurityCenter::Client#get_notification_config.", - "file": "security_center/get_notification_config.rb", - "language": "RUBY", - "client_method": { - "short_name": "get_notification_config", - "full_name": "::Google::Cloud::SecurityCenter::V1p1beta1::SecurityCenter::Client#get_notification_config", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::SecurityCenter::V1p1beta1::GetNotificationConfigRequest", - "name": "request" - } - ], - "result_type": "::Google::Cloud::SecurityCenter::V1p1beta1::NotificationConfig", - "client": { - "short_name": "SecurityCenter::Client", - "full_name": "::Google::Cloud::SecurityCenter::V1p1beta1::SecurityCenter::Client" - }, - "method": { - "short_name": "GetNotificationConfig", - "full_name": "google.cloud.securitycenter.v1p1beta1.SecurityCenter.GetNotificationConfig", - "service": { - "short_name": "SecurityCenter", - "full_name": "google.cloud.securitycenter.v1p1beta1.SecurityCenter" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 46, - "type": "FULL" - } - ] - }, - { - "region_tag": "securitycenter_v1p1beta1_generated_SecurityCenter_GetOrganizationSettings_sync", - "title": "Snippet for the get_organization_settings call in the SecurityCenter service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::SecurityCenter::V1p1beta1::SecurityCenter::Client#get_organization_settings.", - "file": "security_center/get_organization_settings.rb", - "language": "RUBY", - "client_method": { - "short_name": "get_organization_settings", - "full_name": "::Google::Cloud::SecurityCenter::V1p1beta1::SecurityCenter::Client#get_organization_settings", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::SecurityCenter::V1p1beta1::GetOrganizationSettingsRequest", - "name": "request" - } - ], - "result_type": "::Google::Cloud::SecurityCenter::V1p1beta1::OrganizationSettings", - "client": { - "short_name": "SecurityCenter::Client", - "full_name": "::Google::Cloud::SecurityCenter::V1p1beta1::SecurityCenter::Client" - }, - "method": { - "short_name": "GetOrganizationSettings", - "full_name": "google.cloud.securitycenter.v1p1beta1.SecurityCenter.GetOrganizationSettings", - "service": { - "short_name": "SecurityCenter", - "full_name": "google.cloud.securitycenter.v1p1beta1.SecurityCenter" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 46, - "type": "FULL" - } - ] - }, - { - "region_tag": "securitycenter_v1p1beta1_generated_SecurityCenter_GetSource_sync", - "title": "Snippet for the get_source call in the SecurityCenter service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::SecurityCenter::V1p1beta1::SecurityCenter::Client#get_source.", - "file": "security_center/get_source.rb", - "language": "RUBY", - "client_method": { - "short_name": "get_source", - "full_name": "::Google::Cloud::SecurityCenter::V1p1beta1::SecurityCenter::Client#get_source", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::SecurityCenter::V1p1beta1::GetSourceRequest", - "name": "request" - } - ], - "result_type": "::Google::Cloud::SecurityCenter::V1p1beta1::Source", - "client": { - "short_name": "SecurityCenter::Client", - "full_name": "::Google::Cloud::SecurityCenter::V1p1beta1::SecurityCenter::Client" - }, - "method": { - "short_name": "GetSource", - "full_name": "google.cloud.securitycenter.v1p1beta1.SecurityCenter.GetSource", - "service": { - "short_name": "SecurityCenter", - "full_name": "google.cloud.securitycenter.v1p1beta1.SecurityCenter" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 46, - "type": "FULL" - } - ] - }, - { - "region_tag": "securitycenter_v1p1beta1_generated_SecurityCenter_GroupAssets_sync", - "title": "Snippet for the group_assets call in the SecurityCenter service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::SecurityCenter::V1p1beta1::SecurityCenter::Client#group_assets.", - "file": "security_center/group_assets.rb", - "language": "RUBY", - "client_method": { - "short_name": "group_assets", - "full_name": "::Google::Cloud::SecurityCenter::V1p1beta1::SecurityCenter::Client#group_assets", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::SecurityCenter::V1p1beta1::GroupAssetsRequest", - "name": "request" - } - ], - "result_type": "::Google::Cloud::SecurityCenter::V1p1beta1::GroupAssetsResponse", - "client": { - "short_name": "SecurityCenter::Client", - "full_name": "::Google::Cloud::SecurityCenter::V1p1beta1::SecurityCenter::Client" - }, - "method": { - "short_name": "GroupAssets", - "full_name": "google.cloud.securitycenter.v1p1beta1.SecurityCenter.GroupAssets", - "service": { - "short_name": "SecurityCenter", - "full_name": "google.cloud.securitycenter.v1p1beta1.SecurityCenter" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 50, - "type": "FULL" - } - ] - }, - { - "region_tag": "securitycenter_v1p1beta1_generated_SecurityCenter_GroupFindings_sync", - "title": "Snippet for the group_findings call in the SecurityCenter service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::SecurityCenter::V1p1beta1::SecurityCenter::Client#group_findings.", - "file": "security_center/group_findings.rb", - "language": "RUBY", - "client_method": { - "short_name": "group_findings", - "full_name": "::Google::Cloud::SecurityCenter::V1p1beta1::SecurityCenter::Client#group_findings", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::SecurityCenter::V1p1beta1::GroupFindingsRequest", - "name": "request" - } - ], - "result_type": "::Google::Cloud::SecurityCenter::V1p1beta1::GroupFindingsResponse", - "client": { - "short_name": "SecurityCenter::Client", - "full_name": "::Google::Cloud::SecurityCenter::V1p1beta1::SecurityCenter::Client" - }, - "method": { - "short_name": "GroupFindings", - "full_name": "google.cloud.securitycenter.v1p1beta1.SecurityCenter.GroupFindings", - "service": { - "short_name": "SecurityCenter", - "full_name": "google.cloud.securitycenter.v1p1beta1.SecurityCenter" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 50, - "type": "FULL" - } - ] - }, - { - "region_tag": "securitycenter_v1p1beta1_generated_SecurityCenter_ListAssets_sync", - "title": "Snippet for the list_assets call in the SecurityCenter service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::SecurityCenter::V1p1beta1::SecurityCenter::Client#list_assets.", - "file": "security_center/list_assets.rb", - "language": "RUBY", - "client_method": { - "short_name": "list_assets", - "full_name": "::Google::Cloud::SecurityCenter::V1p1beta1::SecurityCenter::Client#list_assets", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::SecurityCenter::V1p1beta1::ListAssetsRequest", - "name": "request" - } - ], - "result_type": "::Google::Cloud::SecurityCenter::V1p1beta1::ListAssetsResponse", - "client": { - "short_name": "SecurityCenter::Client", - "full_name": "::Google::Cloud::SecurityCenter::V1p1beta1::SecurityCenter::Client" - }, - "method": { - "short_name": "ListAssets", - "full_name": "google.cloud.securitycenter.v1p1beta1.SecurityCenter.ListAssets", - "service": { - "short_name": "SecurityCenter", - "full_name": "google.cloud.securitycenter.v1p1beta1.SecurityCenter" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 50, - "type": "FULL" - } - ] - }, - { - "region_tag": "securitycenter_v1p1beta1_generated_SecurityCenter_ListFindings_sync", - "title": "Snippet for the list_findings call in the SecurityCenter service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::SecurityCenter::V1p1beta1::SecurityCenter::Client#list_findings.", - "file": "security_center/list_findings.rb", - "language": "RUBY", - "client_method": { - "short_name": "list_findings", - "full_name": "::Google::Cloud::SecurityCenter::V1p1beta1::SecurityCenter::Client#list_findings", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::SecurityCenter::V1p1beta1::ListFindingsRequest", - "name": "request" - } - ], - "result_type": "::Google::Cloud::SecurityCenter::V1p1beta1::ListFindingsResponse", - "client": { - "short_name": "SecurityCenter::Client", - "full_name": "::Google::Cloud::SecurityCenter::V1p1beta1::SecurityCenter::Client" - }, - "method": { - "short_name": "ListFindings", - "full_name": "google.cloud.securitycenter.v1p1beta1.SecurityCenter.ListFindings", - "service": { - "short_name": "SecurityCenter", - "full_name": "google.cloud.securitycenter.v1p1beta1.SecurityCenter" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 50, - "type": "FULL" - } - ] - }, - { - "region_tag": "securitycenter_v1p1beta1_generated_SecurityCenter_ListNotificationConfigs_sync", - "title": "Snippet for the list_notification_configs call in the SecurityCenter service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::SecurityCenter::V1p1beta1::SecurityCenter::Client#list_notification_configs.", - "file": "security_center/list_notification_configs.rb", - "language": "RUBY", - "client_method": { - "short_name": "list_notification_configs", - "full_name": "::Google::Cloud::SecurityCenter::V1p1beta1::SecurityCenter::Client#list_notification_configs", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::SecurityCenter::V1p1beta1::ListNotificationConfigsRequest", - "name": "request" - } - ], - "result_type": "::Google::Cloud::SecurityCenter::V1p1beta1::ListNotificationConfigsResponse", - "client": { - "short_name": "SecurityCenter::Client", - "full_name": "::Google::Cloud::SecurityCenter::V1p1beta1::SecurityCenter::Client" - }, - "method": { - "short_name": "ListNotificationConfigs", - "full_name": "google.cloud.securitycenter.v1p1beta1.SecurityCenter.ListNotificationConfigs", - "service": { - "short_name": "SecurityCenter", - "full_name": "google.cloud.securitycenter.v1p1beta1.SecurityCenter" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 50, - "type": "FULL" - } - ] - }, - { - "region_tag": "securitycenter_v1p1beta1_generated_SecurityCenter_ListSources_sync", - "title": "Snippet for the list_sources call in the SecurityCenter service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::SecurityCenter::V1p1beta1::SecurityCenter::Client#list_sources.", - "file": "security_center/list_sources.rb", - "language": "RUBY", - "client_method": { - "short_name": "list_sources", - "full_name": "::Google::Cloud::SecurityCenter::V1p1beta1::SecurityCenter::Client#list_sources", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::SecurityCenter::V1p1beta1::ListSourcesRequest", - "name": "request" - } - ], - "result_type": "::Google::Cloud::SecurityCenter::V1p1beta1::ListSourcesResponse", - "client": { - "short_name": "SecurityCenter::Client", - "full_name": "::Google::Cloud::SecurityCenter::V1p1beta1::SecurityCenter::Client" - }, - "method": { - "short_name": "ListSources", - "full_name": "google.cloud.securitycenter.v1p1beta1.SecurityCenter.ListSources", - "service": { - "short_name": "SecurityCenter", - "full_name": "google.cloud.securitycenter.v1p1beta1.SecurityCenter" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 50, - "type": "FULL" - } - ] - }, - { - "region_tag": "securitycenter_v1p1beta1_generated_SecurityCenter_RunAssetDiscovery_sync", - "title": "Snippet for the run_asset_discovery call in the SecurityCenter service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::SecurityCenter::V1p1beta1::SecurityCenter::Client#run_asset_discovery.", - "file": "security_center/run_asset_discovery.rb", - "language": "RUBY", - "client_method": { - "short_name": "run_asset_discovery", - "full_name": "::Google::Cloud::SecurityCenter::V1p1beta1::SecurityCenter::Client#run_asset_discovery", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::SecurityCenter::V1p1beta1::RunAssetDiscoveryRequest", - "name": "request" - } - ], - "result_type": "::Google::Longrunning::Operation", - "client": { - "short_name": "SecurityCenter::Client", - "full_name": "::Google::Cloud::SecurityCenter::V1p1beta1::SecurityCenter::Client" - }, - "method": { - "short_name": "RunAssetDiscovery", - "full_name": "google.cloud.securitycenter.v1p1beta1.SecurityCenter.RunAssetDiscovery", - "service": { - "short_name": "SecurityCenter", - "full_name": "google.cloud.securitycenter.v1p1beta1.SecurityCenter" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 53, - "type": "FULL" - } - ] - }, - { - "region_tag": "securitycenter_v1p1beta1_generated_SecurityCenter_SetFindingState_sync", - "title": "Snippet for the set_finding_state call in the SecurityCenter service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::SecurityCenter::V1p1beta1::SecurityCenter::Client#set_finding_state.", - "file": "security_center/set_finding_state.rb", - "language": "RUBY", - "client_method": { - "short_name": "set_finding_state", - "full_name": "::Google::Cloud::SecurityCenter::V1p1beta1::SecurityCenter::Client#set_finding_state", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::SecurityCenter::V1p1beta1::SetFindingStateRequest", - "name": "request" - } - ], - "result_type": "::Google::Cloud::SecurityCenter::V1p1beta1::Finding", - "client": { - "short_name": "SecurityCenter::Client", - "full_name": "::Google::Cloud::SecurityCenter::V1p1beta1::SecurityCenter::Client" - }, - "method": { - "short_name": "SetFindingState", - "full_name": "google.cloud.securitycenter.v1p1beta1.SecurityCenter.SetFindingState", - "service": { - "short_name": "SecurityCenter", - "full_name": "google.cloud.securitycenter.v1p1beta1.SecurityCenter" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 46, - "type": "FULL" - } - ] - }, - { - "region_tag": "securitycenter_v1p1beta1_generated_SecurityCenter_SetIamPolicy_sync", - "title": "Snippet for the set_iam_policy call in the SecurityCenter service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::SecurityCenter::V1p1beta1::SecurityCenter::Client#set_iam_policy.", - "file": "security_center/set_iam_policy.rb", - "language": "RUBY", - "client_method": { - "short_name": "set_iam_policy", - "full_name": "::Google::Cloud::SecurityCenter::V1p1beta1::SecurityCenter::Client#set_iam_policy", - "async": false, - "parameters": [ - { - "type": "::Google::Iam::V1::SetIamPolicyRequest", - "name": "request" - } - ], - "result_type": "::Google::Iam::V1::Policy", - "client": { - "short_name": "SecurityCenter::Client", - "full_name": "::Google::Cloud::SecurityCenter::V1p1beta1::SecurityCenter::Client" - }, - "method": { - "short_name": "SetIamPolicy", - "full_name": "google.cloud.securitycenter.v1p1beta1.SecurityCenter.SetIamPolicy", - "service": { - "short_name": "SecurityCenter", - "full_name": "google.cloud.securitycenter.v1p1beta1.SecurityCenter" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 46, - "type": "FULL" - } - ] - }, - { - "region_tag": "securitycenter_v1p1beta1_generated_SecurityCenter_TestIamPermissions_sync", - "title": "Snippet for the test_iam_permissions call in the SecurityCenter service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::SecurityCenter::V1p1beta1::SecurityCenter::Client#test_iam_permissions.", - "file": "security_center/test_iam_permissions.rb", - "language": "RUBY", - "client_method": { - "short_name": "test_iam_permissions", - "full_name": "::Google::Cloud::SecurityCenter::V1p1beta1::SecurityCenter::Client#test_iam_permissions", - "async": false, - "parameters": [ - { - "type": "::Google::Iam::V1::TestIamPermissionsRequest", - "name": "request" - } - ], - "result_type": "::Google::Iam::V1::TestIamPermissionsResponse", - "client": { - "short_name": "SecurityCenter::Client", - "full_name": "::Google::Cloud::SecurityCenter::V1p1beta1::SecurityCenter::Client" - }, - "method": { - "short_name": "TestIamPermissions", - "full_name": "google.cloud.securitycenter.v1p1beta1.SecurityCenter.TestIamPermissions", - "service": { - "short_name": "SecurityCenter", - "full_name": "google.cloud.securitycenter.v1p1beta1.SecurityCenter" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 46, - "type": "FULL" - } - ] - }, - { - "region_tag": "securitycenter_v1p1beta1_generated_SecurityCenter_UpdateFinding_sync", - "title": "Snippet for the update_finding call in the SecurityCenter service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::SecurityCenter::V1p1beta1::SecurityCenter::Client#update_finding.", - "file": "security_center/update_finding.rb", - "language": "RUBY", - "client_method": { - "short_name": "update_finding", - "full_name": "::Google::Cloud::SecurityCenter::V1p1beta1::SecurityCenter::Client#update_finding", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::SecurityCenter::V1p1beta1::UpdateFindingRequest", - "name": "request" - } - ], - "result_type": "::Google::Cloud::SecurityCenter::V1p1beta1::Finding", - "client": { - "short_name": "SecurityCenter::Client", - "full_name": "::Google::Cloud::SecurityCenter::V1p1beta1::SecurityCenter::Client" - }, - "method": { - "short_name": "UpdateFinding", - "full_name": "google.cloud.securitycenter.v1p1beta1.SecurityCenter.UpdateFinding", - "service": { - "short_name": "SecurityCenter", - "full_name": "google.cloud.securitycenter.v1p1beta1.SecurityCenter" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 46, - "type": "FULL" - } - ] - }, - { - "region_tag": "securitycenter_v1p1beta1_generated_SecurityCenter_UpdateNotificationConfig_sync", - "title": "Snippet for the update_notification_config call in the SecurityCenter service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::SecurityCenter::V1p1beta1::SecurityCenter::Client#update_notification_config.", - "file": "security_center/update_notification_config.rb", - "language": "RUBY", - "client_method": { - "short_name": "update_notification_config", - "full_name": "::Google::Cloud::SecurityCenter::V1p1beta1::SecurityCenter::Client#update_notification_config", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::SecurityCenter::V1p1beta1::UpdateNotificationConfigRequest", - "name": "request" - } - ], - "result_type": "::Google::Cloud::SecurityCenter::V1p1beta1::NotificationConfig", - "client": { - "short_name": "SecurityCenter::Client", - "full_name": "::Google::Cloud::SecurityCenter::V1p1beta1::SecurityCenter::Client" - }, - "method": { - "short_name": "UpdateNotificationConfig", - "full_name": "google.cloud.securitycenter.v1p1beta1.SecurityCenter.UpdateNotificationConfig", - "service": { - "short_name": "SecurityCenter", - "full_name": "google.cloud.securitycenter.v1p1beta1.SecurityCenter" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 46, - "type": "FULL" - } - ] - }, - { - "region_tag": "securitycenter_v1p1beta1_generated_SecurityCenter_UpdateOrganizationSettings_sync", - "title": "Snippet for the update_organization_settings call in the SecurityCenter service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::SecurityCenter::V1p1beta1::SecurityCenter::Client#update_organization_settings.", - "file": "security_center/update_organization_settings.rb", - "language": "RUBY", - "client_method": { - "short_name": "update_organization_settings", - "full_name": "::Google::Cloud::SecurityCenter::V1p1beta1::SecurityCenter::Client#update_organization_settings", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::SecurityCenter::V1p1beta1::UpdateOrganizationSettingsRequest", - "name": "request" - } - ], - "result_type": "::Google::Cloud::SecurityCenter::V1p1beta1::OrganizationSettings", - "client": { - "short_name": "SecurityCenter::Client", - "full_name": "::Google::Cloud::SecurityCenter::V1p1beta1::SecurityCenter::Client" - }, - "method": { - "short_name": "UpdateOrganizationSettings", - "full_name": "google.cloud.securitycenter.v1p1beta1.SecurityCenter.UpdateOrganizationSettings", - "service": { - "short_name": "SecurityCenter", - "full_name": "google.cloud.securitycenter.v1p1beta1.SecurityCenter" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 46, - "type": "FULL" - } - ] - }, - { - "region_tag": "securitycenter_v1p1beta1_generated_SecurityCenter_UpdateSource_sync", - "title": "Snippet for the update_source call in the SecurityCenter service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::SecurityCenter::V1p1beta1::SecurityCenter::Client#update_source.", - "file": "security_center/update_source.rb", - "language": "RUBY", - "client_method": { - "short_name": "update_source", - "full_name": "::Google::Cloud::SecurityCenter::V1p1beta1::SecurityCenter::Client#update_source", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::SecurityCenter::V1p1beta1::UpdateSourceRequest", - "name": "request" - } - ], - "result_type": "::Google::Cloud::SecurityCenter::V1p1beta1::Source", - "client": { - "short_name": "SecurityCenter::Client", - "full_name": "::Google::Cloud::SecurityCenter::V1p1beta1::SecurityCenter::Client" - }, - "method": { - "short_name": "UpdateSource", - "full_name": "google.cloud.securitycenter.v1p1beta1.SecurityCenter.UpdateSource", - "service": { - "short_name": "SecurityCenter", - "full_name": "google.cloud.securitycenter.v1p1beta1.SecurityCenter" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 46, - "type": "FULL" - } - ] - }, - { - "region_tag": "securitycenter_v1p1beta1_generated_SecurityCenter_UpdateSecurityMarks_sync", - "title": "Snippet for the update_security_marks call in the SecurityCenter service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::SecurityCenter::V1p1beta1::SecurityCenter::Client#update_security_marks.", - "file": "security_center/update_security_marks.rb", - "language": "RUBY", - "client_method": { - "short_name": "update_security_marks", - "full_name": "::Google::Cloud::SecurityCenter::V1p1beta1::SecurityCenter::Client#update_security_marks", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::SecurityCenter::V1p1beta1::UpdateSecurityMarksRequest", - "name": "request" - } - ], - "result_type": "::Google::Cloud::SecurityCenter::V1p1beta1::SecurityMarks", - "client": { - "short_name": "SecurityCenter::Client", - "full_name": "::Google::Cloud::SecurityCenter::V1p1beta1::SecurityCenter::Client" - }, - "method": { - "short_name": "UpdateSecurityMarks", - "full_name": "google.cloud.securitycenter.v1p1beta1.SecurityCenter.UpdateSecurityMarks", - "service": { - "short_name": "SecurityCenter", - "full_name": "google.cloud.securitycenter.v1p1beta1.SecurityCenter" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 46, - "type": "FULL" - } - ] - } - ] -} \ No newline at end of file diff --git a/owl-bot-staging/google-cloud-security_center-v1p1beta1/test/google/cloud/security_center/v1p1beta1/security_center_operations_test.rb b/owl-bot-staging/google-cloud-security_center-v1p1beta1/test/google/cloud/security_center/v1p1beta1/security_center_operations_test.rb deleted file mode 100644 index 610375d6c599..000000000000 --- a/owl-bot-staging/google-cloud-security_center-v1p1beta1/test/google/cloud/security_center/v1p1beta1/security_center_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/cloud/securitycenter/v1p1beta1/securitycenter_service_pb" -require "google/cloud/securitycenter/v1p1beta1/securitycenter_service_services_pb" -require "google/cloud/security_center/v1p1beta1/security_center" - -class ::Google::Cloud::SecurityCenter::V1p1beta1::SecurityCenter::OperationsTest < Minitest::Test - class ClientStub - attr_accessor :call_rpc_count, :requests - - def initialize response, operation, &block - @response = response - @operation = operation - @block = block - @call_rpc_count = 0 - @requests = [] - end - - def call_rpc *args, **kwargs - @call_rpc_count += 1 - - @requests << @block&.call(*args, **kwargs) - - catch :response do - yield @response, @operation if block_given? - @response - end - end - - def endpoint - "endpoint.example.com" - end - - def universe_domain - "example.com" - end - - def stub_logger - nil - end - - def logger - nil - end - end - - def test_list_operations - # Create GRPC objects. - grpc_response = ::Google::Longrunning::ListOperationsResponse.new - grpc_operation = GRPC::ActiveCall::Operation.new nil - grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - grpc_options = {} - - # Create request parameters for a unary method. - name = "hello world" - filter = "hello world" - page_size = 42 - page_token = "hello world" - return_partial_success = true - - list_operations_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :list_operations, name - assert_kind_of ::Google::Longrunning::ListOperationsRequest, request - assert_equal "hello world", request["name"] - assert_equal "hello world", request["filter"] - assert_equal 42, request["page_size"] - assert_equal "hello world", request["page_token"] - assert_equal true, request["return_partial_success"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, list_operations_client_stub do - # Create client - client = ::Google::Cloud::SecurityCenter::V1p1beta1::SecurityCenter::Operations.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.list_operations({ name: name, filter: filter, page_size: page_size, page_token: page_token, return_partial_success: return_partial_success }) do |response, operation| - assert_kind_of Gapic::PagedEnumerable, response - assert_equal grpc_response, response.response - assert_equal grpc_operation, operation - end - - # Use named arguments - client.list_operations name: name, filter: filter, page_size: page_size, page_token: page_token, return_partial_success: return_partial_success do |response, operation| - assert_kind_of Gapic::PagedEnumerable, response - assert_equal grpc_response, response.response - assert_equal grpc_operation, operation - end - - # Use protobuf object - client.list_operations ::Google::Longrunning::ListOperationsRequest.new(name: name, filter: filter, page_size: page_size, page_token: page_token, return_partial_success: return_partial_success) do |response, operation| - assert_kind_of Gapic::PagedEnumerable, response - assert_equal grpc_response, response.response - assert_equal grpc_operation, operation - end - - # Use hash object with options - client.list_operations({ name: name, filter: filter, page_size: page_size, page_token: page_token, return_partial_success: return_partial_success }, grpc_options) do |response, operation| - assert_kind_of Gapic::PagedEnumerable, response - assert_equal grpc_response, response.response - assert_equal grpc_operation, operation - end - - # Use protobuf object with options - client.list_operations(::Google::Longrunning::ListOperationsRequest.new(name: name, filter: filter, page_size: page_size, page_token: page_token, return_partial_success: return_partial_success), grpc_options) do |response, operation| - assert_kind_of Gapic::PagedEnumerable, response - assert_equal grpc_response, response.response - assert_equal grpc_operation, operation - end - - # Verify method calls - assert_equal 5, list_operations_client_stub.call_rpc_count - end - end - - def test_get_operation - # Create GRPC objects. - grpc_response = ::Google::Longrunning::Operation.new - grpc_operation = GRPC::ActiveCall::Operation.new nil - grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - grpc_options = {} - - # Create request parameters for a unary method. - name = "hello world" - - get_operation_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :get_operation, name - assert_kind_of ::Google::Longrunning::GetOperationRequest, request - assert_equal "hello world", request["name"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, get_operation_client_stub do - # Create client - client = ::Google::Cloud::SecurityCenter::V1p1beta1::SecurityCenter::Operations.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.get_operation({ name: name }) do |response, operation| - assert_kind_of Gapic::Operation, response - assert_equal grpc_response, response.grpc_op - assert_equal grpc_operation, operation - end - - # Use named arguments - client.get_operation name: name do |response, operation| - assert_kind_of Gapic::Operation, response - assert_equal grpc_response, response.grpc_op - assert_equal grpc_operation, operation - end - - # Use protobuf object - client.get_operation ::Google::Longrunning::GetOperationRequest.new(name: name) do |response, operation| - assert_kind_of Gapic::Operation, response - assert_equal grpc_response, response.grpc_op - assert_equal grpc_operation, operation - end - - # Use hash object with options - client.get_operation({ name: name }, grpc_options) do |response, operation| - assert_kind_of Gapic::Operation, response - assert_equal grpc_response, response.grpc_op - assert_equal grpc_operation, operation - end - - # Use protobuf object with options - client.get_operation(::Google::Longrunning::GetOperationRequest.new(name: name), grpc_options) do |response, operation| - assert_kind_of Gapic::Operation, response - assert_equal grpc_response, response.grpc_op - assert_equal grpc_operation, operation - end - - # Verify method calls - assert_equal 5, get_operation_client_stub.call_rpc_count - end - end - - def test_delete_operation - # Create GRPC objects. - grpc_response = ::Google::Protobuf::Empty.new - grpc_operation = GRPC::ActiveCall::Operation.new nil - grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - grpc_options = {} - - # Create request parameters for a unary method. - name = "hello world" - - delete_operation_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :delete_operation, name - assert_kind_of ::Google::Longrunning::DeleteOperationRequest, request - assert_equal "hello world", request["name"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, delete_operation_client_stub do - # Create client - client = ::Google::Cloud::SecurityCenter::V1p1beta1::SecurityCenter::Operations.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.delete_operation({ name: name }) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use named arguments - client.delete_operation name: name do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object - client.delete_operation ::Google::Longrunning::DeleteOperationRequest.new(name: name) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use hash object with options - client.delete_operation({ name: name }, grpc_options) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object with options - client.delete_operation(::Google::Longrunning::DeleteOperationRequest.new(name: name), grpc_options) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Verify method calls - assert_equal 5, delete_operation_client_stub.call_rpc_count - end - end - - def test_cancel_operation - # Create GRPC objects. - grpc_response = ::Google::Protobuf::Empty.new - grpc_operation = GRPC::ActiveCall::Operation.new nil - grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - grpc_options = {} - - # Create request parameters for a unary method. - name = "hello world" - - cancel_operation_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :cancel_operation, name - assert_kind_of ::Google::Longrunning::CancelOperationRequest, request - assert_equal "hello world", request["name"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, cancel_operation_client_stub do - # Create client - client = ::Google::Cloud::SecurityCenter::V1p1beta1::SecurityCenter::Operations.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.cancel_operation({ name: name }) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use named arguments - client.cancel_operation name: name do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object - client.cancel_operation ::Google::Longrunning::CancelOperationRequest.new(name: name) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use hash object with options - client.cancel_operation({ name: name }, grpc_options) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object with options - client.cancel_operation(::Google::Longrunning::CancelOperationRequest.new(name: name), grpc_options) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Verify method calls - assert_equal 5, cancel_operation_client_stub.call_rpc_count - end - end - - def test_wait_operation - # Create GRPC objects. - grpc_response = ::Google::Longrunning::Operation.new - grpc_operation = GRPC::ActiveCall::Operation.new nil - grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - grpc_options = {} - - # Create request parameters for a unary method. - name = "hello world" - timeout = {} - - wait_operation_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :wait_operation, name - assert_kind_of ::Google::Longrunning::WaitOperationRequest, request - assert_equal "hello world", request["name"] - assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Protobuf::Duration), request["timeout"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, wait_operation_client_stub do - # Create client - client = ::Google::Cloud::SecurityCenter::V1p1beta1::SecurityCenter::Operations.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.wait_operation({ name: name, timeout: timeout }) do |response, operation| - assert_kind_of Gapic::Operation, response - assert_equal grpc_response, response.grpc_op - assert_equal grpc_operation, operation - end - - # Use named arguments - client.wait_operation name: name, timeout: timeout do |response, operation| - assert_kind_of Gapic::Operation, response - assert_equal grpc_response, response.grpc_op - assert_equal grpc_operation, operation - end - - # Use protobuf object - client.wait_operation ::Google::Longrunning::WaitOperationRequest.new(name: name, timeout: timeout) do |response, operation| - assert_kind_of Gapic::Operation, response - assert_equal grpc_response, response.grpc_op - assert_equal grpc_operation, operation - end - - # Use hash object with options - client.wait_operation({ name: name, timeout: timeout }, grpc_options) do |response, operation| - assert_kind_of Gapic::Operation, response - assert_equal grpc_response, response.grpc_op - assert_equal grpc_operation, operation - end - - # Use protobuf object with options - client.wait_operation(::Google::Longrunning::WaitOperationRequest.new(name: name, timeout: timeout), grpc_options) do |response, operation| - assert_kind_of Gapic::Operation, response - assert_equal grpc_response, response.grpc_op - assert_equal grpc_operation, operation - end - - # Verify method calls - assert_equal 5, wait_operation_client_stub.call_rpc_count - end - end - - def test_configure - grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - - client = block_config = config = nil - dummy_stub = ClientStub.new nil, nil - Gapic::ServiceStub.stub :new, dummy_stub do - client = ::Google::Cloud::SecurityCenter::V1p1beta1::SecurityCenter::Operations.new do |config| - config.credentials = grpc_channel - end - end - - config = client.configure do |c| - block_config = c - end - - assert_same block_config, config - assert_kind_of ::Google::Cloud::SecurityCenter::V1p1beta1::SecurityCenter::Operations::Configuration, config - end -end diff --git a/owl-bot-staging/google-cloud-security_center-v1p1beta1/test/google/cloud/security_center/v1p1beta1/security_center_paths_test.rb b/owl-bot-staging/google-cloud-security_center-v1p1beta1/test/google/cloud/security_center/v1p1beta1/security_center_paths_test.rb deleted file mode 100644 index 346d4e4ee6d3..000000000000 --- a/owl-bot-staging/google-cloud-security_center-v1p1beta1/test/google/cloud/security_center/v1p1beta1/security_center_paths_test.rb +++ /dev/null @@ -1,178 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -require "helper" - -require "gapic/grpc/service_stub" - -require "google/cloud/security_center/v1p1beta1/security_center" - -class ::Google::Cloud::SecurityCenter::V1p1beta1::SecurityCenter::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_finding_path - grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - ::Gapic::ServiceStub.stub :new, DummyStub.new do - client = ::Google::Cloud::SecurityCenter::V1p1beta1::SecurityCenter::Client.new do |config| - config.credentials = grpc_channel - end - - path = client.finding_path organization: "value0", source: "value1", finding: "value2" - assert_equal "organizations/value0/sources/value1/findings/value2", path - - path = client.finding_path folder: "value0", source: "value1", finding: "value2" - assert_equal "folders/value0/sources/value1/findings/value2", path - - path = client.finding_path project: "value0", source: "value1", finding: "value2" - assert_equal "projects/value0/sources/value1/findings/value2", path - end - end - - def test_folder_path - grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - ::Gapic::ServiceStub.stub :new, DummyStub.new do - client = ::Google::Cloud::SecurityCenter::V1p1beta1::SecurityCenter::Client.new do |config| - config.credentials = grpc_channel - end - - path = client.folder_path folder: "value0" - assert_equal "folders/value0", path - end - end - - def test_notification_config_path - grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - ::Gapic::ServiceStub.stub :new, DummyStub.new do - client = ::Google::Cloud::SecurityCenter::V1p1beta1::SecurityCenter::Client.new do |config| - config.credentials = grpc_channel - end - - path = client.notification_config_path organization: "value0", notification_config: "value1" - assert_equal "organizations/value0/notificationConfigs/value1", path - end - end - - def test_organization_path - grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - ::Gapic::ServiceStub.stub :new, DummyStub.new do - client = ::Google::Cloud::SecurityCenter::V1p1beta1::SecurityCenter::Client.new do |config| - config.credentials = grpc_channel - end - - path = client.organization_path organization: "value0" - assert_equal "organizations/value0", path - end - end - - def test_organization_settings_path - grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - ::Gapic::ServiceStub.stub :new, DummyStub.new do - client = ::Google::Cloud::SecurityCenter::V1p1beta1::SecurityCenter::Client.new do |config| - config.credentials = grpc_channel - end - - path = client.organization_settings_path organization: "value0" - assert_equal "organizations/value0/organizationSettings", path - end - end - - def test_project_path - grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - ::Gapic::ServiceStub.stub :new, DummyStub.new do - client = ::Google::Cloud::SecurityCenter::V1p1beta1::SecurityCenter::Client.new do |config| - config.credentials = grpc_channel - end - - path = client.project_path project: "value0" - assert_equal "projects/value0", path - end - end - - def test_security_marks_path - grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - ::Gapic::ServiceStub.stub :new, DummyStub.new do - client = ::Google::Cloud::SecurityCenter::V1p1beta1::SecurityCenter::Client.new do |config| - config.credentials = grpc_channel - end - - path = client.security_marks_path organization: "value0", asset: "value1" - assert_equal "organizations/value0/assets/value1/securityMarks", path - - path = client.security_marks_path organization: "value0", source: "value1", finding: "value2" - assert_equal "organizations/value0/sources/value1/findings/value2/securityMarks", path - - path = client.security_marks_path folder: "value0", asset: "value1" - assert_equal "folders/value0/assets/value1/securityMarks", path - - path = client.security_marks_path project: "value0", asset: "value1" - assert_equal "projects/value0/assets/value1/securityMarks", path - - path = client.security_marks_path folder: "value0", source: "value1", finding: "value2" - assert_equal "folders/value0/sources/value1/findings/value2/securityMarks", path - - path = client.security_marks_path project: "value0", source: "value1", finding: "value2" - assert_equal "projects/value0/sources/value1/findings/value2/securityMarks", path - end - end - - def test_source_path - grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - ::Gapic::ServiceStub.stub :new, DummyStub.new do - client = ::Google::Cloud::SecurityCenter::V1p1beta1::SecurityCenter::Client.new do |config| - config.credentials = grpc_channel - end - - path = client.source_path organization: "value0", source: "value1" - assert_equal "organizations/value0/sources/value1", path - - path = client.source_path folder: "value0", source: "value1" - assert_equal "folders/value0/sources/value1", path - - path = client.source_path project: "value0", source: "value1" - assert_equal "projects/value0/sources/value1", path - end - end - - def test_topic_path - grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - ::Gapic::ServiceStub.stub :new, DummyStub.new do - client = ::Google::Cloud::SecurityCenter::V1p1beta1::SecurityCenter::Client.new do |config| - config.credentials = grpc_channel - end - - path = client.topic_path project: "value0", topic: "value1" - assert_equal "projects/value0/topics/value1", path - end - end -end diff --git a/owl-bot-staging/google-cloud-security_center-v1p1beta1/test/google/cloud/security_center/v1p1beta1/security_center_rest_test.rb b/owl-bot-staging/google-cloud-security_center-v1p1beta1/test/google/cloud/security_center/v1p1beta1/security_center_rest_test.rb deleted file mode 100644 index 31510db961ae..000000000000 --- a/owl-bot-staging/google-cloud-security_center-v1p1beta1/test/google/cloud/security_center/v1p1beta1/security_center_rest_test.rb +++ /dev/null @@ -1,1388 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -require "helper" -require "gapic/rest" -require "google/cloud/securitycenter/v1p1beta1/securitycenter_service_pb" -require "google/cloud/security_center/v1p1beta1/security_center/rest" - - -class ::Google::Cloud::SecurityCenter::V1p1beta1::SecurityCenter::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_source - # Create test objects. - client_result = ::Google::Cloud::SecurityCenter::V1p1beta1::Source.new - http_response = OpenStruct.new body: client_result.to_json - - call_options = {} - - # Create request parameters for a unary method. - parent = "hello world" - source = {} - - create_source_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| - assert options.metadata.key? :"x-goog-api-client" - assert options.metadata[:"x-goog-api-client"].include? "rest" - refute options.metadata[:"x-goog-api-client"].include? "grpc" - end - - ::Google::Cloud::SecurityCenter::V1p1beta1::SecurityCenter::Rest::ServiceStub.stub :transcode_create_source_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, create_source_client_stub do - # Create client - client = ::Google::Cloud::SecurityCenter::V1p1beta1::SecurityCenter::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - client.create_source({ parent: parent, source: source }) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use named arguments - client.create_source parent: parent, source: source do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object - client.create_source ::Google::Cloud::SecurityCenter::V1p1beta1::CreateSourceRequest.new(parent: parent, source: source) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use hash object with options - client.create_source({ parent: parent, source: source }, call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object with options - client.create_source(::Google::Cloud::SecurityCenter::V1p1beta1::CreateSourceRequest.new(parent: parent, source: source), call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Verify method calls - assert_equal 5, create_source_client_stub.call_count - end - end - end - - def test_create_finding - # Create test objects. - client_result = ::Google::Cloud::SecurityCenter::V1p1beta1::Finding.new - http_response = OpenStruct.new body: client_result.to_json - - call_options = {} - - # Create request parameters for a unary method. - parent = "hello world" - finding_id = "hello world" - finding = {} - - create_finding_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| - assert options.metadata.key? :"x-goog-api-client" - assert options.metadata[:"x-goog-api-client"].include? "rest" - refute options.metadata[:"x-goog-api-client"].include? "grpc" - end - - ::Google::Cloud::SecurityCenter::V1p1beta1::SecurityCenter::Rest::ServiceStub.stub :transcode_create_finding_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, create_finding_client_stub do - # Create client - client = ::Google::Cloud::SecurityCenter::V1p1beta1::SecurityCenter::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - client.create_finding({ parent: parent, finding_id: finding_id, finding: finding }) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use named arguments - client.create_finding parent: parent, finding_id: finding_id, finding: finding do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object - client.create_finding ::Google::Cloud::SecurityCenter::V1p1beta1::CreateFindingRequest.new(parent: parent, finding_id: finding_id, finding: finding) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use hash object with options - client.create_finding({ parent: parent, finding_id: finding_id, finding: finding }, call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object with options - client.create_finding(::Google::Cloud::SecurityCenter::V1p1beta1::CreateFindingRequest.new(parent: parent, finding_id: finding_id, finding: finding), call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Verify method calls - assert_equal 5, create_finding_client_stub.call_count - end - end - end - - def test_create_notification_config - # Create test objects. - client_result = ::Google::Cloud::SecurityCenter::V1p1beta1::NotificationConfig.new - http_response = OpenStruct.new body: client_result.to_json - - call_options = {} - - # Create request parameters for a unary method. - parent = "hello world" - config_id = "hello world" - notification_config = {} - - create_notification_config_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| - assert options.metadata.key? :"x-goog-api-client" - assert options.metadata[:"x-goog-api-client"].include? "rest" - refute options.metadata[:"x-goog-api-client"].include? "grpc" - end - - ::Google::Cloud::SecurityCenter::V1p1beta1::SecurityCenter::Rest::ServiceStub.stub :transcode_create_notification_config_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, create_notification_config_client_stub do - # Create client - client = ::Google::Cloud::SecurityCenter::V1p1beta1::SecurityCenter::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - client.create_notification_config({ parent: parent, config_id: config_id, notification_config: notification_config }) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use named arguments - client.create_notification_config parent: parent, config_id: config_id, notification_config: notification_config do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object - client.create_notification_config ::Google::Cloud::SecurityCenter::V1p1beta1::CreateNotificationConfigRequest.new(parent: parent, config_id: config_id, notification_config: notification_config) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use hash object with options - client.create_notification_config({ parent: parent, config_id: config_id, notification_config: notification_config }, call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object with options - client.create_notification_config(::Google::Cloud::SecurityCenter::V1p1beta1::CreateNotificationConfigRequest.new(parent: parent, config_id: config_id, notification_config: notification_config), call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Verify method calls - assert_equal 5, create_notification_config_client_stub.call_count - end - end - end - - def test_delete_notification_config - # Create test objects. - client_result = ::Google::Protobuf::Empty.new - http_response = OpenStruct.new body: client_result.to_json - - call_options = {} - - # Create request parameters for a unary method. - name = "hello world" - - delete_notification_config_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| - assert options.metadata.key? :"x-goog-api-client" - assert options.metadata[:"x-goog-api-client"].include? "rest" - refute options.metadata[:"x-goog-api-client"].include? "grpc" - end - - ::Google::Cloud::SecurityCenter::V1p1beta1::SecurityCenter::Rest::ServiceStub.stub :transcode_delete_notification_config_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, delete_notification_config_client_stub do - # Create client - client = ::Google::Cloud::SecurityCenter::V1p1beta1::SecurityCenter::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - client.delete_notification_config({ name: name }) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use named arguments - client.delete_notification_config name: name do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object - client.delete_notification_config ::Google::Cloud::SecurityCenter::V1p1beta1::DeleteNotificationConfigRequest.new(name: name) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use hash object with options - client.delete_notification_config({ name: name }, call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object with options - client.delete_notification_config(::Google::Cloud::SecurityCenter::V1p1beta1::DeleteNotificationConfigRequest.new(name: name), call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Verify method calls - assert_equal 5, delete_notification_config_client_stub.call_count - end - end - end - - def test_get_iam_policy - # Create test objects. - client_result = ::Google::Iam::V1::Policy.new - http_response = OpenStruct.new body: client_result.to_json - - call_options = {} - - # Create request parameters for a unary method. - resource = "hello world" - options = {} - - get_iam_policy_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| - assert options.metadata.key? :"x-goog-api-client" - assert options.metadata[:"x-goog-api-client"].include? "rest" - refute options.metadata[:"x-goog-api-client"].include? "grpc" - end - - ::Google::Cloud::SecurityCenter::V1p1beta1::SecurityCenter::Rest::ServiceStub.stub :transcode_get_iam_policy_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, get_iam_policy_client_stub do - # Create client - client = ::Google::Cloud::SecurityCenter::V1p1beta1::SecurityCenter::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - client.get_iam_policy({ resource: resource, options: options }) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use named arguments - client.get_iam_policy resource: resource, options: options do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object - client.get_iam_policy ::Google::Iam::V1::GetIamPolicyRequest.new(resource: resource, options: options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use hash object with options - client.get_iam_policy({ resource: resource, options: options }, call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object with options - client.get_iam_policy(::Google::Iam::V1::GetIamPolicyRequest.new(resource: resource, options: options), call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Verify method calls - assert_equal 5, get_iam_policy_client_stub.call_count - end - end - end - - def test_get_notification_config - # Create test objects. - client_result = ::Google::Cloud::SecurityCenter::V1p1beta1::NotificationConfig.new - http_response = OpenStruct.new body: client_result.to_json - - call_options = {} - - # Create request parameters for a unary method. - name = "hello world" - - get_notification_config_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| - assert options.metadata.key? :"x-goog-api-client" - assert options.metadata[:"x-goog-api-client"].include? "rest" - refute options.metadata[:"x-goog-api-client"].include? "grpc" - end - - ::Google::Cloud::SecurityCenter::V1p1beta1::SecurityCenter::Rest::ServiceStub.stub :transcode_get_notification_config_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, get_notification_config_client_stub do - # Create client - client = ::Google::Cloud::SecurityCenter::V1p1beta1::SecurityCenter::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - client.get_notification_config({ name: name }) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use named arguments - client.get_notification_config name: name do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object - client.get_notification_config ::Google::Cloud::SecurityCenter::V1p1beta1::GetNotificationConfigRequest.new(name: name) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use hash object with options - client.get_notification_config({ name: name }, call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object with options - client.get_notification_config(::Google::Cloud::SecurityCenter::V1p1beta1::GetNotificationConfigRequest.new(name: name), call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Verify method calls - assert_equal 5, get_notification_config_client_stub.call_count - end - end - end - - def test_get_organization_settings - # Create test objects. - client_result = ::Google::Cloud::SecurityCenter::V1p1beta1::OrganizationSettings.new - http_response = OpenStruct.new body: client_result.to_json - - call_options = {} - - # Create request parameters for a unary method. - name = "hello world" - - get_organization_settings_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| - assert options.metadata.key? :"x-goog-api-client" - assert options.metadata[:"x-goog-api-client"].include? "rest" - refute options.metadata[:"x-goog-api-client"].include? "grpc" - end - - ::Google::Cloud::SecurityCenter::V1p1beta1::SecurityCenter::Rest::ServiceStub.stub :transcode_get_organization_settings_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, get_organization_settings_client_stub do - # Create client - client = ::Google::Cloud::SecurityCenter::V1p1beta1::SecurityCenter::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - client.get_organization_settings({ name: name }) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use named arguments - client.get_organization_settings name: name do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object - client.get_organization_settings ::Google::Cloud::SecurityCenter::V1p1beta1::GetOrganizationSettingsRequest.new(name: name) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use hash object with options - client.get_organization_settings({ name: name }, call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object with options - client.get_organization_settings(::Google::Cloud::SecurityCenter::V1p1beta1::GetOrganizationSettingsRequest.new(name: name), call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Verify method calls - assert_equal 5, get_organization_settings_client_stub.call_count - end - end - end - - def test_get_source - # Create test objects. - client_result = ::Google::Cloud::SecurityCenter::V1p1beta1::Source.new - http_response = OpenStruct.new body: client_result.to_json - - call_options = {} - - # Create request parameters for a unary method. - name = "hello world" - - get_source_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| - assert options.metadata.key? :"x-goog-api-client" - assert options.metadata[:"x-goog-api-client"].include? "rest" - refute options.metadata[:"x-goog-api-client"].include? "grpc" - end - - ::Google::Cloud::SecurityCenter::V1p1beta1::SecurityCenter::Rest::ServiceStub.stub :transcode_get_source_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, get_source_client_stub do - # Create client - client = ::Google::Cloud::SecurityCenter::V1p1beta1::SecurityCenter::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - client.get_source({ name: name }) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use named arguments - client.get_source name: name do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object - client.get_source ::Google::Cloud::SecurityCenter::V1p1beta1::GetSourceRequest.new(name: name) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use hash object with options - client.get_source({ name: name }, call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object with options - client.get_source(::Google::Cloud::SecurityCenter::V1p1beta1::GetSourceRequest.new(name: name), call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Verify method calls - assert_equal 5, get_source_client_stub.call_count - end - end - end - - def test_group_assets - # Create test objects. - client_result = ::Google::Cloud::SecurityCenter::V1p1beta1::GroupAssetsResponse.new - http_response = OpenStruct.new body: client_result.to_json - - call_options = {} - - # Create request parameters for a unary method. - parent = "hello world" - filter = "hello world" - group_by = "hello world" - compare_duration = {} - read_time = {} - page_token = "hello world" - page_size = 42 - - group_assets_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| - assert options.metadata.key? :"x-goog-api-client" - assert options.metadata[:"x-goog-api-client"].include? "rest" - refute options.metadata[:"x-goog-api-client"].include? "grpc" - end - - ::Google::Cloud::SecurityCenter::V1p1beta1::SecurityCenter::Rest::ServiceStub.stub :transcode_group_assets_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, group_assets_client_stub do - # Create client - client = ::Google::Cloud::SecurityCenter::V1p1beta1::SecurityCenter::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - client.group_assets({ parent: parent, filter: filter, group_by: group_by, compare_duration: compare_duration, read_time: read_time, page_token: page_token, page_size: page_size }) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use named arguments - client.group_assets parent: parent, filter: filter, group_by: group_by, compare_duration: compare_duration, read_time: read_time, page_token: page_token, page_size: page_size do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object - client.group_assets ::Google::Cloud::SecurityCenter::V1p1beta1::GroupAssetsRequest.new(parent: parent, filter: filter, group_by: group_by, compare_duration: compare_duration, read_time: read_time, page_token: page_token, page_size: page_size) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use hash object with options - client.group_assets({ parent: parent, filter: filter, group_by: group_by, compare_duration: compare_duration, read_time: read_time, page_token: page_token, page_size: page_size }, call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object with options - client.group_assets(::Google::Cloud::SecurityCenter::V1p1beta1::GroupAssetsRequest.new(parent: parent, filter: filter, group_by: group_by, compare_duration: compare_duration, read_time: read_time, page_token: page_token, page_size: page_size), call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Verify method calls - assert_equal 5, group_assets_client_stub.call_count - end - end - end - - def test_group_findings - # Create test objects. - client_result = ::Google::Cloud::SecurityCenter::V1p1beta1::GroupFindingsResponse.new - http_response = OpenStruct.new body: client_result.to_json - - call_options = {} - - # Create request parameters for a unary method. - parent = "hello world" - filter = "hello world" - group_by = "hello world" - read_time = {} - compare_duration = {} - page_token = "hello world" - page_size = 42 - - group_findings_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| - assert options.metadata.key? :"x-goog-api-client" - assert options.metadata[:"x-goog-api-client"].include? "rest" - refute options.metadata[:"x-goog-api-client"].include? "grpc" - end - - ::Google::Cloud::SecurityCenter::V1p1beta1::SecurityCenter::Rest::ServiceStub.stub :transcode_group_findings_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, group_findings_client_stub do - # Create client - client = ::Google::Cloud::SecurityCenter::V1p1beta1::SecurityCenter::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - client.group_findings({ parent: parent, filter: filter, group_by: group_by, read_time: read_time, compare_duration: compare_duration, page_token: page_token, page_size: page_size }) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use named arguments - client.group_findings parent: parent, filter: filter, group_by: group_by, read_time: read_time, compare_duration: compare_duration, page_token: page_token, page_size: page_size do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object - client.group_findings ::Google::Cloud::SecurityCenter::V1p1beta1::GroupFindingsRequest.new(parent: parent, filter: filter, group_by: group_by, read_time: read_time, compare_duration: compare_duration, page_token: page_token, page_size: page_size) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use hash object with options - client.group_findings({ parent: parent, filter: filter, group_by: group_by, read_time: read_time, compare_duration: compare_duration, page_token: page_token, page_size: page_size }, call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object with options - client.group_findings(::Google::Cloud::SecurityCenter::V1p1beta1::GroupFindingsRequest.new(parent: parent, filter: filter, group_by: group_by, read_time: read_time, compare_duration: compare_duration, page_token: page_token, page_size: page_size), call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Verify method calls - assert_equal 5, group_findings_client_stub.call_count - end - end - end - - def test_list_assets - # Create test objects. - client_result = ::Google::Cloud::SecurityCenter::V1p1beta1::ListAssetsResponse.new - http_response = OpenStruct.new body: client_result.to_json - - call_options = {} - - # Create request parameters for a unary method. - parent = "hello world" - filter = "hello world" - order_by = "hello world" - read_time = {} - compare_duration = {} - field_mask = {} - page_token = "hello world" - page_size = 42 - - list_assets_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| - assert options.metadata.key? :"x-goog-api-client" - assert options.metadata[:"x-goog-api-client"].include? "rest" - refute options.metadata[:"x-goog-api-client"].include? "grpc" - end - - ::Google::Cloud::SecurityCenter::V1p1beta1::SecurityCenter::Rest::ServiceStub.stub :transcode_list_assets_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, list_assets_client_stub do - # Create client - client = ::Google::Cloud::SecurityCenter::V1p1beta1::SecurityCenter::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - client.list_assets({ parent: parent, filter: filter, order_by: order_by, read_time: read_time, compare_duration: compare_duration, field_mask: field_mask, page_token: page_token, page_size: page_size }) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use named arguments - client.list_assets parent: parent, filter: filter, order_by: order_by, read_time: read_time, compare_duration: compare_duration, field_mask: field_mask, page_token: page_token, page_size: page_size do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object - client.list_assets ::Google::Cloud::SecurityCenter::V1p1beta1::ListAssetsRequest.new(parent: parent, filter: filter, order_by: order_by, read_time: read_time, compare_duration: compare_duration, field_mask: field_mask, page_token: page_token, page_size: page_size) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use hash object with options - client.list_assets({ parent: parent, filter: filter, order_by: order_by, read_time: read_time, compare_duration: compare_duration, field_mask: field_mask, page_token: page_token, page_size: page_size }, call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object with options - client.list_assets(::Google::Cloud::SecurityCenter::V1p1beta1::ListAssetsRequest.new(parent: parent, filter: filter, order_by: order_by, read_time: read_time, compare_duration: compare_duration, field_mask: field_mask, page_token: page_token, page_size: page_size), call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Verify method calls - assert_equal 5, list_assets_client_stub.call_count - end - end - end - - def test_list_findings - # Create test objects. - client_result = ::Google::Cloud::SecurityCenter::V1p1beta1::ListFindingsResponse.new - http_response = OpenStruct.new body: client_result.to_json - - call_options = {} - - # Create request parameters for a unary method. - parent = "hello world" - filter = "hello world" - order_by = "hello world" - read_time = {} - compare_duration = {} - field_mask = {} - page_token = "hello world" - page_size = 42 - - list_findings_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| - assert options.metadata.key? :"x-goog-api-client" - assert options.metadata[:"x-goog-api-client"].include? "rest" - refute options.metadata[:"x-goog-api-client"].include? "grpc" - end - - ::Google::Cloud::SecurityCenter::V1p1beta1::SecurityCenter::Rest::ServiceStub.stub :transcode_list_findings_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, list_findings_client_stub do - # Create client - client = ::Google::Cloud::SecurityCenter::V1p1beta1::SecurityCenter::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - client.list_findings({ parent: parent, filter: filter, order_by: order_by, read_time: read_time, compare_duration: compare_duration, field_mask: field_mask, page_token: page_token, page_size: page_size }) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use named arguments - client.list_findings parent: parent, filter: filter, order_by: order_by, read_time: read_time, compare_duration: compare_duration, field_mask: field_mask, page_token: page_token, page_size: page_size do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object - client.list_findings ::Google::Cloud::SecurityCenter::V1p1beta1::ListFindingsRequest.new(parent: parent, filter: filter, order_by: order_by, read_time: read_time, compare_duration: compare_duration, field_mask: field_mask, page_token: page_token, page_size: page_size) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use hash object with options - client.list_findings({ parent: parent, filter: filter, order_by: order_by, read_time: read_time, compare_duration: compare_duration, field_mask: field_mask, page_token: page_token, page_size: page_size }, call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object with options - client.list_findings(::Google::Cloud::SecurityCenter::V1p1beta1::ListFindingsRequest.new(parent: parent, filter: filter, order_by: order_by, read_time: read_time, compare_duration: compare_duration, field_mask: field_mask, page_token: page_token, page_size: page_size), call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Verify method calls - assert_equal 5, list_findings_client_stub.call_count - end - end - end - - def test_list_notification_configs - # Create test objects. - client_result = ::Google::Cloud::SecurityCenter::V1p1beta1::ListNotificationConfigsResponse.new - http_response = OpenStruct.new body: client_result.to_json - - call_options = {} - - # Create request parameters for a unary method. - parent = "hello world" - page_token = "hello world" - page_size = 42 - - list_notification_configs_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| - assert options.metadata.key? :"x-goog-api-client" - assert options.metadata[:"x-goog-api-client"].include? "rest" - refute options.metadata[:"x-goog-api-client"].include? "grpc" - end - - ::Google::Cloud::SecurityCenter::V1p1beta1::SecurityCenter::Rest::ServiceStub.stub :transcode_list_notification_configs_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, list_notification_configs_client_stub do - # Create client - client = ::Google::Cloud::SecurityCenter::V1p1beta1::SecurityCenter::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - client.list_notification_configs({ parent: parent, page_token: page_token, page_size: page_size }) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use named arguments - client.list_notification_configs parent: parent, page_token: page_token, page_size: page_size do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object - client.list_notification_configs ::Google::Cloud::SecurityCenter::V1p1beta1::ListNotificationConfigsRequest.new(parent: parent, page_token: page_token, page_size: page_size) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use hash object with options - client.list_notification_configs({ parent: parent, page_token: page_token, page_size: page_size }, call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object with options - client.list_notification_configs(::Google::Cloud::SecurityCenter::V1p1beta1::ListNotificationConfigsRequest.new(parent: parent, page_token: page_token, page_size: page_size), call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Verify method calls - assert_equal 5, list_notification_configs_client_stub.call_count - end - end - end - - def test_list_sources - # Create test objects. - client_result = ::Google::Cloud::SecurityCenter::V1p1beta1::ListSourcesResponse.new - http_response = OpenStruct.new body: client_result.to_json - - call_options = {} - - # Create request parameters for a unary method. - parent = "hello world" - page_token = "hello world" - page_size = 42 - - list_sources_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| - assert options.metadata.key? :"x-goog-api-client" - assert options.metadata[:"x-goog-api-client"].include? "rest" - refute options.metadata[:"x-goog-api-client"].include? "grpc" - end - - ::Google::Cloud::SecurityCenter::V1p1beta1::SecurityCenter::Rest::ServiceStub.stub :transcode_list_sources_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, list_sources_client_stub do - # Create client - client = ::Google::Cloud::SecurityCenter::V1p1beta1::SecurityCenter::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - client.list_sources({ parent: parent, page_token: page_token, page_size: page_size }) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use named arguments - client.list_sources parent: parent, page_token: page_token, page_size: page_size do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object - client.list_sources ::Google::Cloud::SecurityCenter::V1p1beta1::ListSourcesRequest.new(parent: parent, page_token: page_token, page_size: page_size) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use hash object with options - client.list_sources({ parent: parent, page_token: page_token, page_size: page_size }, call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object with options - client.list_sources(::Google::Cloud::SecurityCenter::V1p1beta1::ListSourcesRequest.new(parent: parent, page_token: page_token, page_size: page_size), call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Verify method calls - assert_equal 5, list_sources_client_stub.call_count - end - end - end - - def test_run_asset_discovery - # 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" - - run_asset_discovery_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| - assert options.metadata.key? :"x-goog-api-client" - assert options.metadata[:"x-goog-api-client"].include? "rest" - refute options.metadata[:"x-goog-api-client"].include? "grpc" - end - - ::Google::Cloud::SecurityCenter::V1p1beta1::SecurityCenter::Rest::ServiceStub.stub :transcode_run_asset_discovery_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, run_asset_discovery_client_stub do - # Create client - client = ::Google::Cloud::SecurityCenter::V1p1beta1::SecurityCenter::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - client.run_asset_discovery({ parent: parent }) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use named arguments - client.run_asset_discovery parent: parent do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object - client.run_asset_discovery ::Google::Cloud::SecurityCenter::V1p1beta1::RunAssetDiscoveryRequest.new(parent: parent) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use hash object with options - client.run_asset_discovery({ parent: parent }, call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object with options - client.run_asset_discovery(::Google::Cloud::SecurityCenter::V1p1beta1::RunAssetDiscoveryRequest.new(parent: parent), call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Verify method calls - assert_equal 5, run_asset_discovery_client_stub.call_count - end - end - end - - def test_set_finding_state - # Create test objects. - client_result = ::Google::Cloud::SecurityCenter::V1p1beta1::Finding.new - http_response = OpenStruct.new body: client_result.to_json - - call_options = {} - - # Create request parameters for a unary method. - name = "hello world" - state = :STATE_UNSPECIFIED - start_time = {} - - set_finding_state_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| - assert options.metadata.key? :"x-goog-api-client" - assert options.metadata[:"x-goog-api-client"].include? "rest" - refute options.metadata[:"x-goog-api-client"].include? "grpc" - end - - ::Google::Cloud::SecurityCenter::V1p1beta1::SecurityCenter::Rest::ServiceStub.stub :transcode_set_finding_state_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, set_finding_state_client_stub do - # Create client - client = ::Google::Cloud::SecurityCenter::V1p1beta1::SecurityCenter::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - client.set_finding_state({ name: name, state: state, start_time: start_time }) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use named arguments - client.set_finding_state name: name, state: state, start_time: start_time do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object - client.set_finding_state ::Google::Cloud::SecurityCenter::V1p1beta1::SetFindingStateRequest.new(name: name, state: state, start_time: start_time) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use hash object with options - client.set_finding_state({ name: name, state: state, start_time: start_time }, call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object with options - client.set_finding_state(::Google::Cloud::SecurityCenter::V1p1beta1::SetFindingStateRequest.new(name: name, state: state, start_time: start_time), call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Verify method calls - assert_equal 5, set_finding_state_client_stub.call_count - end - end - end - - def test_set_iam_policy - # Create test objects. - client_result = ::Google::Iam::V1::Policy.new - http_response = OpenStruct.new body: client_result.to_json - - call_options = {} - - # Create request parameters for a unary method. - resource = "hello world" - policy = {} - update_mask = {} - - set_iam_policy_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| - assert options.metadata.key? :"x-goog-api-client" - assert options.metadata[:"x-goog-api-client"].include? "rest" - refute options.metadata[:"x-goog-api-client"].include? "grpc" - end - - ::Google::Cloud::SecurityCenter::V1p1beta1::SecurityCenter::Rest::ServiceStub.stub :transcode_set_iam_policy_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, set_iam_policy_client_stub do - # Create client - client = ::Google::Cloud::SecurityCenter::V1p1beta1::SecurityCenter::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - client.set_iam_policy({ resource: resource, policy: policy, update_mask: update_mask }) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use named arguments - client.set_iam_policy resource: resource, policy: policy, update_mask: update_mask do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object - client.set_iam_policy ::Google::Iam::V1::SetIamPolicyRequest.new(resource: resource, policy: policy, update_mask: update_mask) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use hash object with options - client.set_iam_policy({ resource: resource, policy: policy, update_mask: update_mask }, call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object with options - client.set_iam_policy(::Google::Iam::V1::SetIamPolicyRequest.new(resource: resource, policy: policy, update_mask: update_mask), call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Verify method calls - assert_equal 5, set_iam_policy_client_stub.call_count - end - end - end - - def test_test_iam_permissions - # Create test objects. - client_result = ::Google::Iam::V1::TestIamPermissionsResponse.new - http_response = OpenStruct.new body: client_result.to_json - - call_options = {} - - # Create request parameters for a unary method. - resource = "hello world" - permissions = ["hello world"] - - test_iam_permissions_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| - assert options.metadata.key? :"x-goog-api-client" - assert options.metadata[:"x-goog-api-client"].include? "rest" - refute options.metadata[:"x-goog-api-client"].include? "grpc" - end - - ::Google::Cloud::SecurityCenter::V1p1beta1::SecurityCenter::Rest::ServiceStub.stub :transcode_test_iam_permissions_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, test_iam_permissions_client_stub do - # Create client - client = ::Google::Cloud::SecurityCenter::V1p1beta1::SecurityCenter::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - client.test_iam_permissions({ resource: resource, permissions: permissions }) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use named arguments - client.test_iam_permissions resource: resource, permissions: permissions do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object - client.test_iam_permissions ::Google::Iam::V1::TestIamPermissionsRequest.new(resource: resource, permissions: permissions) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use hash object with options - client.test_iam_permissions({ resource: resource, permissions: permissions }, call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object with options - client.test_iam_permissions(::Google::Iam::V1::TestIamPermissionsRequest.new(resource: resource, permissions: permissions), call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Verify method calls - assert_equal 5, test_iam_permissions_client_stub.call_count - end - end - end - - def test_update_finding - # Create test objects. - client_result = ::Google::Cloud::SecurityCenter::V1p1beta1::Finding.new - http_response = OpenStruct.new body: client_result.to_json - - call_options = {} - - # Create request parameters for a unary method. - finding = {} - update_mask = {} - - update_finding_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| - assert options.metadata.key? :"x-goog-api-client" - assert options.metadata[:"x-goog-api-client"].include? "rest" - refute options.metadata[:"x-goog-api-client"].include? "grpc" - end - - ::Google::Cloud::SecurityCenter::V1p1beta1::SecurityCenter::Rest::ServiceStub.stub :transcode_update_finding_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, update_finding_client_stub do - # Create client - client = ::Google::Cloud::SecurityCenter::V1p1beta1::SecurityCenter::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - client.update_finding({ finding: finding, update_mask: update_mask }) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use named arguments - client.update_finding finding: finding, update_mask: update_mask do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object - client.update_finding ::Google::Cloud::SecurityCenter::V1p1beta1::UpdateFindingRequest.new(finding: finding, update_mask: update_mask) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use hash object with options - client.update_finding({ finding: finding, update_mask: update_mask }, call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object with options - client.update_finding(::Google::Cloud::SecurityCenter::V1p1beta1::UpdateFindingRequest.new(finding: finding, update_mask: update_mask), call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Verify method calls - assert_equal 5, update_finding_client_stub.call_count - end - end - end - - def test_update_notification_config - # Create test objects. - client_result = ::Google::Cloud::SecurityCenter::V1p1beta1::NotificationConfig.new - http_response = OpenStruct.new body: client_result.to_json - - call_options = {} - - # Create request parameters for a unary method. - notification_config = {} - update_mask = {} - - update_notification_config_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| - assert options.metadata.key? :"x-goog-api-client" - assert options.metadata[:"x-goog-api-client"].include? "rest" - refute options.metadata[:"x-goog-api-client"].include? "grpc" - end - - ::Google::Cloud::SecurityCenter::V1p1beta1::SecurityCenter::Rest::ServiceStub.stub :transcode_update_notification_config_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, update_notification_config_client_stub do - # Create client - client = ::Google::Cloud::SecurityCenter::V1p1beta1::SecurityCenter::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - client.update_notification_config({ notification_config: notification_config, update_mask: update_mask }) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use named arguments - client.update_notification_config notification_config: notification_config, update_mask: update_mask do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object - client.update_notification_config ::Google::Cloud::SecurityCenter::V1p1beta1::UpdateNotificationConfigRequest.new(notification_config: notification_config, update_mask: update_mask) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use hash object with options - client.update_notification_config({ notification_config: notification_config, update_mask: update_mask }, call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object with options - client.update_notification_config(::Google::Cloud::SecurityCenter::V1p1beta1::UpdateNotificationConfigRequest.new(notification_config: notification_config, update_mask: update_mask), call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Verify method calls - assert_equal 5, update_notification_config_client_stub.call_count - end - end - end - - def test_update_organization_settings - # Create test objects. - client_result = ::Google::Cloud::SecurityCenter::V1p1beta1::OrganizationSettings.new - http_response = OpenStruct.new body: client_result.to_json - - call_options = {} - - # Create request parameters for a unary method. - organization_settings = {} - update_mask = {} - - update_organization_settings_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| - assert options.metadata.key? :"x-goog-api-client" - assert options.metadata[:"x-goog-api-client"].include? "rest" - refute options.metadata[:"x-goog-api-client"].include? "grpc" - end - - ::Google::Cloud::SecurityCenter::V1p1beta1::SecurityCenter::Rest::ServiceStub.stub :transcode_update_organization_settings_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, update_organization_settings_client_stub do - # Create client - client = ::Google::Cloud::SecurityCenter::V1p1beta1::SecurityCenter::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - client.update_organization_settings({ organization_settings: organization_settings, update_mask: update_mask }) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use named arguments - client.update_organization_settings organization_settings: organization_settings, update_mask: update_mask do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object - client.update_organization_settings ::Google::Cloud::SecurityCenter::V1p1beta1::UpdateOrganizationSettingsRequest.new(organization_settings: organization_settings, update_mask: update_mask) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use hash object with options - client.update_organization_settings({ organization_settings: organization_settings, update_mask: update_mask }, call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object with options - client.update_organization_settings(::Google::Cloud::SecurityCenter::V1p1beta1::UpdateOrganizationSettingsRequest.new(organization_settings: organization_settings, update_mask: update_mask), call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Verify method calls - assert_equal 5, update_organization_settings_client_stub.call_count - end - end - end - - def test_update_source - # Create test objects. - client_result = ::Google::Cloud::SecurityCenter::V1p1beta1::Source.new - http_response = OpenStruct.new body: client_result.to_json - - call_options = {} - - # Create request parameters for a unary method. - source = {} - update_mask = {} - - update_source_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| - assert options.metadata.key? :"x-goog-api-client" - assert options.metadata[:"x-goog-api-client"].include? "rest" - refute options.metadata[:"x-goog-api-client"].include? "grpc" - end - - ::Google::Cloud::SecurityCenter::V1p1beta1::SecurityCenter::Rest::ServiceStub.stub :transcode_update_source_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, update_source_client_stub do - # Create client - client = ::Google::Cloud::SecurityCenter::V1p1beta1::SecurityCenter::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - client.update_source({ source: source, update_mask: update_mask }) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use named arguments - client.update_source source: source, update_mask: update_mask do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object - client.update_source ::Google::Cloud::SecurityCenter::V1p1beta1::UpdateSourceRequest.new(source: source, update_mask: update_mask) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use hash object with options - client.update_source({ source: source, update_mask: update_mask }, call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object with options - client.update_source(::Google::Cloud::SecurityCenter::V1p1beta1::UpdateSourceRequest.new(source: source, update_mask: update_mask), call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Verify method calls - assert_equal 5, update_source_client_stub.call_count - end - end - end - - def test_update_security_marks - # Create test objects. - client_result = ::Google::Cloud::SecurityCenter::V1p1beta1::SecurityMarks.new - http_response = OpenStruct.new body: client_result.to_json - - call_options = {} - - # Create request parameters for a unary method. - security_marks = {} - update_mask = {} - start_time = {} - - update_security_marks_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| - assert options.metadata.key? :"x-goog-api-client" - assert options.metadata[:"x-goog-api-client"].include? "rest" - refute options.metadata[:"x-goog-api-client"].include? "grpc" - end - - ::Google::Cloud::SecurityCenter::V1p1beta1::SecurityCenter::Rest::ServiceStub.stub :transcode_update_security_marks_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, update_security_marks_client_stub do - # Create client - client = ::Google::Cloud::SecurityCenter::V1p1beta1::SecurityCenter::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - client.update_security_marks({ security_marks: security_marks, update_mask: update_mask, start_time: start_time }) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use named arguments - client.update_security_marks security_marks: security_marks, update_mask: update_mask, start_time: start_time do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object - client.update_security_marks ::Google::Cloud::SecurityCenter::V1p1beta1::UpdateSecurityMarksRequest.new(security_marks: security_marks, update_mask: update_mask, start_time: start_time) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use hash object with options - client.update_security_marks({ security_marks: security_marks, update_mask: update_mask, start_time: start_time }, call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object with options - client.update_security_marks(::Google::Cloud::SecurityCenter::V1p1beta1::UpdateSecurityMarksRequest.new(security_marks: security_marks, update_mask: update_mask, start_time: start_time), call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Verify method calls - assert_equal 5, update_security_marks_client_stub.call_count - end - end - end - - def test_configure - credentials_token = :dummy_value - - client = block_config = config = nil - dummy_stub = ClientStub.new nil - Gapic::Rest::ClientStub.stub :new, dummy_stub do - client = ::Google::Cloud::SecurityCenter::V1p1beta1::SecurityCenter::Rest::Client.new do |config| - config.credentials = credentials_token - end - end - - config = client.configure do |c| - block_config = c - end - - assert_same block_config, config - assert_kind_of ::Google::Cloud::SecurityCenter::V1p1beta1::SecurityCenter::Rest::Client::Configuration, config - end -end diff --git a/owl-bot-staging/google-cloud-security_center-v1p1beta1/test/google/cloud/security_center/v1p1beta1/security_center_test.rb b/owl-bot-staging/google-cloud-security_center-v1p1beta1/test/google/cloud/security_center/v1p1beta1/security_center_test.rb deleted file mode 100644 index 3de0ff05e98b..000000000000 --- a/owl-bot-staging/google-cloud-security_center-v1p1beta1/test/google/cloud/security_center/v1p1beta1/security_center_test.rb +++ /dev/null @@ -1,1581 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -require "helper" - -require "gapic/grpc/service_stub" - -require "google/cloud/securitycenter/v1p1beta1/securitycenter_service_pb" -require "google/cloud/security_center/v1p1beta1/security_center" - -class ::Google::Cloud::SecurityCenter::V1p1beta1::SecurityCenter::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_source - # Create GRPC objects. - grpc_response = ::Google::Cloud::SecurityCenter::V1p1beta1::Source.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" - source = {} - - create_source_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :create_source, name - assert_kind_of ::Google::Cloud::SecurityCenter::V1p1beta1::CreateSourceRequest, request - assert_equal "hello world", request["parent"] - assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::SecurityCenter::V1p1beta1::Source), request["source"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, create_source_client_stub do - # Create client - client = ::Google::Cloud::SecurityCenter::V1p1beta1::SecurityCenter::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.create_source({ parent: parent, source: source }) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use named arguments - client.create_source parent: parent, source: source do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object - client.create_source ::Google::Cloud::SecurityCenter::V1p1beta1::CreateSourceRequest.new(parent: parent, source: source) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use hash object with options - client.create_source({ parent: parent, source: source }, grpc_options) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object with options - client.create_source(::Google::Cloud::SecurityCenter::V1p1beta1::CreateSourceRequest.new(parent: parent, source: source), grpc_options) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Verify method calls - assert_equal 5, create_source_client_stub.call_rpc_count - end - end - - def test_create_finding - # Create GRPC objects. - grpc_response = ::Google::Cloud::SecurityCenter::V1p1beta1::Finding.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" - finding_id = "hello world" - finding = {} - - create_finding_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :create_finding, name - assert_kind_of ::Google::Cloud::SecurityCenter::V1p1beta1::CreateFindingRequest, request - assert_equal "hello world", request["parent"] - assert_equal "hello world", request["finding_id"] - assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::SecurityCenter::V1p1beta1::Finding), request["finding"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, create_finding_client_stub do - # Create client - client = ::Google::Cloud::SecurityCenter::V1p1beta1::SecurityCenter::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.create_finding({ parent: parent, finding_id: finding_id, finding: finding }) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use named arguments - client.create_finding parent: parent, finding_id: finding_id, finding: finding do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object - client.create_finding ::Google::Cloud::SecurityCenter::V1p1beta1::CreateFindingRequest.new(parent: parent, finding_id: finding_id, finding: finding) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use hash object with options - client.create_finding({ parent: parent, finding_id: finding_id, finding: finding }, grpc_options) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object with options - client.create_finding(::Google::Cloud::SecurityCenter::V1p1beta1::CreateFindingRequest.new(parent: parent, finding_id: finding_id, finding: finding), grpc_options) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Verify method calls - assert_equal 5, create_finding_client_stub.call_rpc_count - end - end - - def test_create_notification_config - # Create GRPC objects. - grpc_response = ::Google::Cloud::SecurityCenter::V1p1beta1::NotificationConfig.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" - config_id = "hello world" - notification_config = {} - - create_notification_config_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :create_notification_config, name - assert_kind_of ::Google::Cloud::SecurityCenter::V1p1beta1::CreateNotificationConfigRequest, request - assert_equal "hello world", request["parent"] - assert_equal "hello world", request["config_id"] - assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::SecurityCenter::V1p1beta1::NotificationConfig), request["notification_config"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, create_notification_config_client_stub do - # Create client - client = ::Google::Cloud::SecurityCenter::V1p1beta1::SecurityCenter::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.create_notification_config({ parent: parent, config_id: config_id, notification_config: notification_config }) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use named arguments - client.create_notification_config parent: parent, config_id: config_id, notification_config: notification_config do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object - client.create_notification_config ::Google::Cloud::SecurityCenter::V1p1beta1::CreateNotificationConfigRequest.new(parent: parent, config_id: config_id, notification_config: notification_config) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use hash object with options - client.create_notification_config({ parent: parent, config_id: config_id, notification_config: notification_config }, grpc_options) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object with options - client.create_notification_config(::Google::Cloud::SecurityCenter::V1p1beta1::CreateNotificationConfigRequest.new(parent: parent, config_id: config_id, notification_config: notification_config), grpc_options) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Verify method calls - assert_equal 5, create_notification_config_client_stub.call_rpc_count - end - end - - def test_delete_notification_config - # 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_notification_config_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :delete_notification_config, name - assert_kind_of ::Google::Cloud::SecurityCenter::V1p1beta1::DeleteNotificationConfigRequest, request - assert_equal "hello world", request["name"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, delete_notification_config_client_stub do - # Create client - client = ::Google::Cloud::SecurityCenter::V1p1beta1::SecurityCenter::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.delete_notification_config({ name: name }) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use named arguments - client.delete_notification_config name: name do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object - client.delete_notification_config ::Google::Cloud::SecurityCenter::V1p1beta1::DeleteNotificationConfigRequest.new(name: name) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use hash object with options - client.delete_notification_config({ name: name }, grpc_options) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object with options - client.delete_notification_config(::Google::Cloud::SecurityCenter::V1p1beta1::DeleteNotificationConfigRequest.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_notification_config_client_stub.call_rpc_count - end - end - - def test_get_iam_policy - # Create GRPC objects. - grpc_response = ::Google::Iam::V1::Policy.new - grpc_operation = GRPC::ActiveCall::Operation.new nil - grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - grpc_options = {} - - # Create request parameters for a unary method. - resource = "hello world" - options = {} - - get_iam_policy_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :get_iam_policy, name - assert_kind_of ::Google::Iam::V1::GetIamPolicyRequest, request - assert_equal "hello world", request["resource"] - assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Iam::V1::GetPolicyOptions), request["options"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, get_iam_policy_client_stub do - # Create client - client = ::Google::Cloud::SecurityCenter::V1p1beta1::SecurityCenter::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.get_iam_policy({ resource: resource, options: options }) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use named arguments - client.get_iam_policy resource: resource, options: options do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object - client.get_iam_policy ::Google::Iam::V1::GetIamPolicyRequest.new(resource: resource, options: options) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use hash object with options - client.get_iam_policy({ resource: resource, options: options }, grpc_options) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object with options - client.get_iam_policy(::Google::Iam::V1::GetIamPolicyRequest.new(resource: resource, options: options), grpc_options) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Verify method calls - assert_equal 5, get_iam_policy_client_stub.call_rpc_count - end - end - - def test_get_notification_config - # Create GRPC objects. - grpc_response = ::Google::Cloud::SecurityCenter::V1p1beta1::NotificationConfig.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_notification_config_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :get_notification_config, name - assert_kind_of ::Google::Cloud::SecurityCenter::V1p1beta1::GetNotificationConfigRequest, request - assert_equal "hello world", request["name"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, get_notification_config_client_stub do - # Create client - client = ::Google::Cloud::SecurityCenter::V1p1beta1::SecurityCenter::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.get_notification_config({ name: name }) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use named arguments - client.get_notification_config name: name do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object - client.get_notification_config ::Google::Cloud::SecurityCenter::V1p1beta1::GetNotificationConfigRequest.new(name: name) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use hash object with options - client.get_notification_config({ name: name }, grpc_options) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object with options - client.get_notification_config(::Google::Cloud::SecurityCenter::V1p1beta1::GetNotificationConfigRequest.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_notification_config_client_stub.call_rpc_count - end - end - - def test_get_organization_settings - # Create GRPC objects. - grpc_response = ::Google::Cloud::SecurityCenter::V1p1beta1::OrganizationSettings.new - grpc_operation = GRPC::ActiveCall::Operation.new nil - grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - grpc_options = {} - - # Create request parameters for a unary method. - name = "hello world" - - get_organization_settings_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :get_organization_settings, name - assert_kind_of ::Google::Cloud::SecurityCenter::V1p1beta1::GetOrganizationSettingsRequest, request - assert_equal "hello world", request["name"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, get_organization_settings_client_stub do - # Create client - client = ::Google::Cloud::SecurityCenter::V1p1beta1::SecurityCenter::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.get_organization_settings({ name: name }) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use named arguments - client.get_organization_settings name: name do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object - client.get_organization_settings ::Google::Cloud::SecurityCenter::V1p1beta1::GetOrganizationSettingsRequest.new(name: name) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use hash object with options - client.get_organization_settings({ name: name }, grpc_options) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object with options - client.get_organization_settings(::Google::Cloud::SecurityCenter::V1p1beta1::GetOrganizationSettingsRequest.new(name: name), grpc_options) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Verify method calls - assert_equal 5, get_organization_settings_client_stub.call_rpc_count - end - end - - def test_get_source - # Create GRPC objects. - grpc_response = ::Google::Cloud::SecurityCenter::V1p1beta1::Source.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_source_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :get_source, name - assert_kind_of ::Google::Cloud::SecurityCenter::V1p1beta1::GetSourceRequest, request - assert_equal "hello world", request["name"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, get_source_client_stub do - # Create client - client = ::Google::Cloud::SecurityCenter::V1p1beta1::SecurityCenter::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.get_source({ name: name }) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use named arguments - client.get_source name: name do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object - client.get_source ::Google::Cloud::SecurityCenter::V1p1beta1::GetSourceRequest.new(name: name) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use hash object with options - client.get_source({ 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_source(::Google::Cloud::SecurityCenter::V1p1beta1::GetSourceRequest.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_source_client_stub.call_rpc_count - end - end - - def test_group_assets - # Create GRPC objects. - grpc_response = ::Google::Cloud::SecurityCenter::V1p1beta1::GroupAssetsResponse.new - grpc_operation = GRPC::ActiveCall::Operation.new nil - grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - grpc_options = {} - - # Create request parameters for a unary method. - parent = "hello world" - filter = "hello world" - group_by = "hello world" - compare_duration = {} - read_time = {} - page_token = "hello world" - page_size = 42 - - group_assets_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :group_assets, name - assert_kind_of ::Google::Cloud::SecurityCenter::V1p1beta1::GroupAssetsRequest, request - assert_equal "hello world", request["parent"] - assert_equal "hello world", request["filter"] - assert_equal "hello world", request["group_by"] - assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Protobuf::Duration), request["compare_duration"] - assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Protobuf::Timestamp), request["read_time"] - assert_equal "hello world", request["page_token"] - assert_equal 42, request["page_size"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, group_assets_client_stub do - # Create client - client = ::Google::Cloud::SecurityCenter::V1p1beta1::SecurityCenter::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.group_assets({ parent: parent, filter: filter, group_by: group_by, compare_duration: compare_duration, read_time: read_time, page_token: page_token, page_size: page_size }) 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.group_assets parent: parent, filter: filter, group_by: group_by, compare_duration: compare_duration, read_time: read_time, page_token: page_token, page_size: page_size 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.group_assets ::Google::Cloud::SecurityCenter::V1p1beta1::GroupAssetsRequest.new(parent: parent, filter: filter, group_by: group_by, compare_duration: compare_duration, read_time: read_time, page_token: page_token, page_size: page_size) 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.group_assets({ parent: parent, filter: filter, group_by: group_by, compare_duration: compare_duration, read_time: read_time, page_token: page_token, page_size: page_size }, 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.group_assets(::Google::Cloud::SecurityCenter::V1p1beta1::GroupAssetsRequest.new(parent: parent, filter: filter, group_by: group_by, compare_duration: compare_duration, read_time: read_time, page_token: page_token, page_size: page_size), 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, group_assets_client_stub.call_rpc_count - end - end - - def test_group_findings - # Create GRPC objects. - grpc_response = ::Google::Cloud::SecurityCenter::V1p1beta1::GroupFindingsResponse.new - grpc_operation = GRPC::ActiveCall::Operation.new nil - grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - grpc_options = {} - - # Create request parameters for a unary method. - parent = "hello world" - filter = "hello world" - group_by = "hello world" - read_time = {} - compare_duration = {} - page_token = "hello world" - page_size = 42 - - group_findings_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :group_findings, name - assert_kind_of ::Google::Cloud::SecurityCenter::V1p1beta1::GroupFindingsRequest, request - assert_equal "hello world", request["parent"] - assert_equal "hello world", request["filter"] - assert_equal "hello world", request["group_by"] - assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Protobuf::Timestamp), request["read_time"] - assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Protobuf::Duration), request["compare_duration"] - assert_equal "hello world", request["page_token"] - assert_equal 42, request["page_size"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, group_findings_client_stub do - # Create client - client = ::Google::Cloud::SecurityCenter::V1p1beta1::SecurityCenter::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.group_findings({ parent: parent, filter: filter, group_by: group_by, read_time: read_time, compare_duration: compare_duration, page_token: page_token, page_size: page_size }) 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.group_findings parent: parent, filter: filter, group_by: group_by, read_time: read_time, compare_duration: compare_duration, page_token: page_token, page_size: page_size 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.group_findings ::Google::Cloud::SecurityCenter::V1p1beta1::GroupFindingsRequest.new(parent: parent, filter: filter, group_by: group_by, read_time: read_time, compare_duration: compare_duration, page_token: page_token, page_size: page_size) 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.group_findings({ parent: parent, filter: filter, group_by: group_by, read_time: read_time, compare_duration: compare_duration, page_token: page_token, page_size: page_size }, 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.group_findings(::Google::Cloud::SecurityCenter::V1p1beta1::GroupFindingsRequest.new(parent: parent, filter: filter, group_by: group_by, read_time: read_time, compare_duration: compare_duration, page_token: page_token, page_size: page_size), 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, group_findings_client_stub.call_rpc_count - end - end - - def test_list_assets - # Create GRPC objects. - grpc_response = ::Google::Cloud::SecurityCenter::V1p1beta1::ListAssetsResponse.new - grpc_operation = GRPC::ActiveCall::Operation.new nil - grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - grpc_options = {} - - # Create request parameters for a unary method. - parent = "hello world" - filter = "hello world" - order_by = "hello world" - read_time = {} - compare_duration = {} - field_mask = {} - page_token = "hello world" - page_size = 42 - - list_assets_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :list_assets, name - assert_kind_of ::Google::Cloud::SecurityCenter::V1p1beta1::ListAssetsRequest, request - assert_equal "hello world", request["parent"] - assert_equal "hello world", request["filter"] - assert_equal "hello world", request["order_by"] - assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Protobuf::Timestamp), request["read_time"] - assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Protobuf::Duration), request["compare_duration"] - assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Protobuf::FieldMask), request["field_mask"] - assert_equal "hello world", request["page_token"] - assert_equal 42, request["page_size"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, list_assets_client_stub do - # Create client - client = ::Google::Cloud::SecurityCenter::V1p1beta1::SecurityCenter::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.list_assets({ parent: parent, filter: filter, order_by: order_by, read_time: read_time, compare_duration: compare_duration, field_mask: field_mask, page_token: page_token, page_size: page_size }) 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_assets parent: parent, filter: filter, order_by: order_by, read_time: read_time, compare_duration: compare_duration, field_mask: field_mask, page_token: page_token, page_size: page_size 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_assets ::Google::Cloud::SecurityCenter::V1p1beta1::ListAssetsRequest.new(parent: parent, filter: filter, order_by: order_by, read_time: read_time, compare_duration: compare_duration, field_mask: field_mask, page_token: page_token, page_size: page_size) 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_assets({ parent: parent, filter: filter, order_by: order_by, read_time: read_time, compare_duration: compare_duration, field_mask: field_mask, page_token: page_token, page_size: page_size }, 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_assets(::Google::Cloud::SecurityCenter::V1p1beta1::ListAssetsRequest.new(parent: parent, filter: filter, order_by: order_by, read_time: read_time, compare_duration: compare_duration, field_mask: field_mask, page_token: page_token, page_size: page_size), 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_assets_client_stub.call_rpc_count - end - end - - def test_list_findings - # Create GRPC objects. - grpc_response = ::Google::Cloud::SecurityCenter::V1p1beta1::ListFindingsResponse.new - grpc_operation = GRPC::ActiveCall::Operation.new nil - grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - grpc_options = {} - - # Create request parameters for a unary method. - parent = "hello world" - filter = "hello world" - order_by = "hello world" - read_time = {} - compare_duration = {} - field_mask = {} - page_token = "hello world" - page_size = 42 - - list_findings_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :list_findings, name - assert_kind_of ::Google::Cloud::SecurityCenter::V1p1beta1::ListFindingsRequest, request - assert_equal "hello world", request["parent"] - assert_equal "hello world", request["filter"] - assert_equal "hello world", request["order_by"] - assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Protobuf::Timestamp), request["read_time"] - assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Protobuf::Duration), request["compare_duration"] - assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Protobuf::FieldMask), request["field_mask"] - assert_equal "hello world", request["page_token"] - assert_equal 42, request["page_size"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, list_findings_client_stub do - # Create client - client = ::Google::Cloud::SecurityCenter::V1p1beta1::SecurityCenter::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.list_findings({ parent: parent, filter: filter, order_by: order_by, read_time: read_time, compare_duration: compare_duration, field_mask: field_mask, page_token: page_token, page_size: page_size }) 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_findings parent: parent, filter: filter, order_by: order_by, read_time: read_time, compare_duration: compare_duration, field_mask: field_mask, page_token: page_token, page_size: page_size 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_findings ::Google::Cloud::SecurityCenter::V1p1beta1::ListFindingsRequest.new(parent: parent, filter: filter, order_by: order_by, read_time: read_time, compare_duration: compare_duration, field_mask: field_mask, page_token: page_token, page_size: page_size) 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_findings({ parent: parent, filter: filter, order_by: order_by, read_time: read_time, compare_duration: compare_duration, field_mask: field_mask, page_token: page_token, page_size: page_size }, 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_findings(::Google::Cloud::SecurityCenter::V1p1beta1::ListFindingsRequest.new(parent: parent, filter: filter, order_by: order_by, read_time: read_time, compare_duration: compare_duration, field_mask: field_mask, page_token: page_token, page_size: page_size), 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_findings_client_stub.call_rpc_count - end - end - - def test_list_notification_configs - # Create GRPC objects. - grpc_response = ::Google::Cloud::SecurityCenter::V1p1beta1::ListNotificationConfigsResponse.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_token = "hello world" - page_size = 42 - - list_notification_configs_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :list_notification_configs, name - assert_kind_of ::Google::Cloud::SecurityCenter::V1p1beta1::ListNotificationConfigsRequest, request - assert_equal "hello world", request["parent"] - assert_equal "hello world", request["page_token"] - assert_equal 42, request["page_size"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, list_notification_configs_client_stub do - # Create client - client = ::Google::Cloud::SecurityCenter::V1p1beta1::SecurityCenter::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.list_notification_configs({ parent: parent, page_token: page_token, page_size: page_size }) 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_notification_configs parent: parent, page_token: page_token, page_size: page_size 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_notification_configs ::Google::Cloud::SecurityCenter::V1p1beta1::ListNotificationConfigsRequest.new(parent: parent, page_token: page_token, page_size: page_size) 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_notification_configs({ parent: parent, page_token: page_token, page_size: page_size }, 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_notification_configs(::Google::Cloud::SecurityCenter::V1p1beta1::ListNotificationConfigsRequest.new(parent: parent, page_token: page_token, page_size: page_size), 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_notification_configs_client_stub.call_rpc_count - end - end - - def test_list_sources - # Create GRPC objects. - grpc_response = ::Google::Cloud::SecurityCenter::V1p1beta1::ListSourcesResponse.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_token = "hello world" - page_size = 42 - - list_sources_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :list_sources, name - assert_kind_of ::Google::Cloud::SecurityCenter::V1p1beta1::ListSourcesRequest, request - assert_equal "hello world", request["parent"] - assert_equal "hello world", request["page_token"] - assert_equal 42, request["page_size"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, list_sources_client_stub do - # Create client - client = ::Google::Cloud::SecurityCenter::V1p1beta1::SecurityCenter::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.list_sources({ parent: parent, page_token: page_token, page_size: page_size }) 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_sources parent: parent, page_token: page_token, page_size: page_size 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_sources ::Google::Cloud::SecurityCenter::V1p1beta1::ListSourcesRequest.new(parent: parent, page_token: page_token, page_size: page_size) 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_sources({ parent: parent, page_token: page_token, page_size: page_size }, 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_sources(::Google::Cloud::SecurityCenter::V1p1beta1::ListSourcesRequest.new(parent: parent, page_token: page_token, page_size: page_size), 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_sources_client_stub.call_rpc_count - end - end - - def test_run_asset_discovery - # 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" - - run_asset_discovery_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :run_asset_discovery, name - assert_kind_of ::Google::Cloud::SecurityCenter::V1p1beta1::RunAssetDiscoveryRequest, request - assert_equal "hello world", request["parent"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, run_asset_discovery_client_stub do - # Create client - client = ::Google::Cloud::SecurityCenter::V1p1beta1::SecurityCenter::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.run_asset_discovery({ parent: parent }) 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.run_asset_discovery parent: parent 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.run_asset_discovery ::Google::Cloud::SecurityCenter::V1p1beta1::RunAssetDiscoveryRequest.new(parent: parent) 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.run_asset_discovery({ parent: parent }, 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.run_asset_discovery(::Google::Cloud::SecurityCenter::V1p1beta1::RunAssetDiscoveryRequest.new(parent: parent), 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, run_asset_discovery_client_stub.call_rpc_count - end - end - - def test_set_finding_state - # Create GRPC objects. - grpc_response = ::Google::Cloud::SecurityCenter::V1p1beta1::Finding.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" - state = :STATE_UNSPECIFIED - start_time = {} - - set_finding_state_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :set_finding_state, name - assert_kind_of ::Google::Cloud::SecurityCenter::V1p1beta1::SetFindingStateRequest, request - assert_equal "hello world", request["name"] - assert_equal :STATE_UNSPECIFIED, request["state"] - assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Protobuf::Timestamp), request["start_time"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, set_finding_state_client_stub do - # Create client - client = ::Google::Cloud::SecurityCenter::V1p1beta1::SecurityCenter::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.set_finding_state({ name: name, state: state, start_time: start_time }) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use named arguments - client.set_finding_state name: name, state: state, start_time: start_time do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object - client.set_finding_state ::Google::Cloud::SecurityCenter::V1p1beta1::SetFindingStateRequest.new(name: name, state: state, start_time: start_time) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use hash object with options - client.set_finding_state({ name: name, state: state, start_time: start_time }, grpc_options) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object with options - client.set_finding_state(::Google::Cloud::SecurityCenter::V1p1beta1::SetFindingStateRequest.new(name: name, state: state, start_time: start_time), grpc_options) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Verify method calls - assert_equal 5, set_finding_state_client_stub.call_rpc_count - end - end - - def test_set_iam_policy - # Create GRPC objects. - grpc_response = ::Google::Iam::V1::Policy.new - grpc_operation = GRPC::ActiveCall::Operation.new nil - grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - grpc_options = {} - - # Create request parameters for a unary method. - resource = "hello world" - policy = {} - update_mask = {} - - set_iam_policy_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :set_iam_policy, name - assert_kind_of ::Google::Iam::V1::SetIamPolicyRequest, request - assert_equal "hello world", request["resource"] - assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Iam::V1::Policy), request["policy"] - assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Protobuf::FieldMask), request["update_mask"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, set_iam_policy_client_stub do - # Create client - client = ::Google::Cloud::SecurityCenter::V1p1beta1::SecurityCenter::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.set_iam_policy({ resource: resource, policy: policy, update_mask: update_mask }) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use named arguments - client.set_iam_policy resource: resource, policy: policy, update_mask: update_mask do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object - client.set_iam_policy ::Google::Iam::V1::SetIamPolicyRequest.new(resource: resource, policy: policy, update_mask: update_mask) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use hash object with options - client.set_iam_policy({ resource: resource, policy: policy, update_mask: update_mask }, grpc_options) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object with options - client.set_iam_policy(::Google::Iam::V1::SetIamPolicyRequest.new(resource: resource, policy: policy, update_mask: update_mask), grpc_options) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Verify method calls - assert_equal 5, set_iam_policy_client_stub.call_rpc_count - end - end - - def test_test_iam_permissions - # Create GRPC objects. - grpc_response = ::Google::Iam::V1::TestIamPermissionsResponse.new - grpc_operation = GRPC::ActiveCall::Operation.new nil - grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - grpc_options = {} - - # Create request parameters for a unary method. - resource = "hello world" - permissions = ["hello world"] - - test_iam_permissions_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :test_iam_permissions, name - assert_kind_of ::Google::Iam::V1::TestIamPermissionsRequest, request - assert_equal "hello world", request["resource"] - assert_equal ["hello world"], request["permissions"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, test_iam_permissions_client_stub do - # Create client - client = ::Google::Cloud::SecurityCenter::V1p1beta1::SecurityCenter::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.test_iam_permissions({ resource: resource, permissions: permissions }) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use named arguments - client.test_iam_permissions resource: resource, permissions: permissions do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object - client.test_iam_permissions ::Google::Iam::V1::TestIamPermissionsRequest.new(resource: resource, permissions: permissions) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use hash object with options - client.test_iam_permissions({ resource: resource, permissions: permissions }, grpc_options) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object with options - client.test_iam_permissions(::Google::Iam::V1::TestIamPermissionsRequest.new(resource: resource, permissions: permissions), grpc_options) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Verify method calls - assert_equal 5, test_iam_permissions_client_stub.call_rpc_count - end - end - - def test_update_finding - # Create GRPC objects. - grpc_response = ::Google::Cloud::SecurityCenter::V1p1beta1::Finding.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. - finding = {} - update_mask = {} - - update_finding_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :update_finding, name - assert_kind_of ::Google::Cloud::SecurityCenter::V1p1beta1::UpdateFindingRequest, request - assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::SecurityCenter::V1p1beta1::Finding), request["finding"] - assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Protobuf::FieldMask), request["update_mask"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, update_finding_client_stub do - # Create client - client = ::Google::Cloud::SecurityCenter::V1p1beta1::SecurityCenter::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.update_finding({ finding: finding, update_mask: update_mask }) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use named arguments - client.update_finding finding: finding, update_mask: update_mask do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object - client.update_finding ::Google::Cloud::SecurityCenter::V1p1beta1::UpdateFindingRequest.new(finding: finding, update_mask: update_mask) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use hash object with options - client.update_finding({ finding: finding, update_mask: update_mask }, grpc_options) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object with options - client.update_finding(::Google::Cloud::SecurityCenter::V1p1beta1::UpdateFindingRequest.new(finding: finding, update_mask: update_mask), grpc_options) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Verify method calls - assert_equal 5, update_finding_client_stub.call_rpc_count - end - end - - def test_update_notification_config - # Create GRPC objects. - grpc_response = ::Google::Cloud::SecurityCenter::V1p1beta1::NotificationConfig.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. - notification_config = {} - update_mask = {} - - update_notification_config_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :update_notification_config, name - assert_kind_of ::Google::Cloud::SecurityCenter::V1p1beta1::UpdateNotificationConfigRequest, request - assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::SecurityCenter::V1p1beta1::NotificationConfig), request["notification_config"] - assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Protobuf::FieldMask), request["update_mask"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, update_notification_config_client_stub do - # Create client - client = ::Google::Cloud::SecurityCenter::V1p1beta1::SecurityCenter::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.update_notification_config({ notification_config: notification_config, update_mask: update_mask }) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use named arguments - client.update_notification_config notification_config: notification_config, update_mask: update_mask do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object - client.update_notification_config ::Google::Cloud::SecurityCenter::V1p1beta1::UpdateNotificationConfigRequest.new(notification_config: notification_config, update_mask: update_mask) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use hash object with options - client.update_notification_config({ notification_config: notification_config, update_mask: update_mask }, grpc_options) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object with options - client.update_notification_config(::Google::Cloud::SecurityCenter::V1p1beta1::UpdateNotificationConfigRequest.new(notification_config: notification_config, update_mask: update_mask), grpc_options) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Verify method calls - assert_equal 5, update_notification_config_client_stub.call_rpc_count - end - end - - def test_update_organization_settings - # Create GRPC objects. - grpc_response = ::Google::Cloud::SecurityCenter::V1p1beta1::OrganizationSettings.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. - organization_settings = {} - update_mask = {} - - update_organization_settings_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :update_organization_settings, name - assert_kind_of ::Google::Cloud::SecurityCenter::V1p1beta1::UpdateOrganizationSettingsRequest, request - assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::SecurityCenter::V1p1beta1::OrganizationSettings), request["organization_settings"] - assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Protobuf::FieldMask), request["update_mask"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, update_organization_settings_client_stub do - # Create client - client = ::Google::Cloud::SecurityCenter::V1p1beta1::SecurityCenter::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.update_organization_settings({ organization_settings: organization_settings, update_mask: update_mask }) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use named arguments - client.update_organization_settings organization_settings: organization_settings, update_mask: update_mask do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object - client.update_organization_settings ::Google::Cloud::SecurityCenter::V1p1beta1::UpdateOrganizationSettingsRequest.new(organization_settings: organization_settings, update_mask: update_mask) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use hash object with options - client.update_organization_settings({ organization_settings: organization_settings, update_mask: update_mask }, grpc_options) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object with options - client.update_organization_settings(::Google::Cloud::SecurityCenter::V1p1beta1::UpdateOrganizationSettingsRequest.new(organization_settings: organization_settings, update_mask: update_mask), grpc_options) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Verify method calls - assert_equal 5, update_organization_settings_client_stub.call_rpc_count - end - end - - def test_update_source - # Create GRPC objects. - grpc_response = ::Google::Cloud::SecurityCenter::V1p1beta1::Source.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. - source = {} - update_mask = {} - - update_source_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :update_source, name - assert_kind_of ::Google::Cloud::SecurityCenter::V1p1beta1::UpdateSourceRequest, request - assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::SecurityCenter::V1p1beta1::Source), request["source"] - assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Protobuf::FieldMask), request["update_mask"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, update_source_client_stub do - # Create client - client = ::Google::Cloud::SecurityCenter::V1p1beta1::SecurityCenter::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.update_source({ source: source, update_mask: update_mask }) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use named arguments - client.update_source source: source, update_mask: update_mask do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object - client.update_source ::Google::Cloud::SecurityCenter::V1p1beta1::UpdateSourceRequest.new(source: source, update_mask: update_mask) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use hash object with options - client.update_source({ source: source, update_mask: update_mask }, grpc_options) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object with options - client.update_source(::Google::Cloud::SecurityCenter::V1p1beta1::UpdateSourceRequest.new(source: source, update_mask: update_mask), grpc_options) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Verify method calls - assert_equal 5, update_source_client_stub.call_rpc_count - end - end - - def test_update_security_marks - # Create GRPC objects. - grpc_response = ::Google::Cloud::SecurityCenter::V1p1beta1::SecurityMarks.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. - security_marks = {} - update_mask = {} - start_time = {} - - update_security_marks_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :update_security_marks, name - assert_kind_of ::Google::Cloud::SecurityCenter::V1p1beta1::UpdateSecurityMarksRequest, request - assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::SecurityCenter::V1p1beta1::SecurityMarks), request["security_marks"] - assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Protobuf::FieldMask), request["update_mask"] - assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Protobuf::Timestamp), request["start_time"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, update_security_marks_client_stub do - # Create client - client = ::Google::Cloud::SecurityCenter::V1p1beta1::SecurityCenter::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.update_security_marks({ security_marks: security_marks, update_mask: update_mask, start_time: start_time }) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use named arguments - client.update_security_marks security_marks: security_marks, update_mask: update_mask, start_time: start_time do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object - client.update_security_marks ::Google::Cloud::SecurityCenter::V1p1beta1::UpdateSecurityMarksRequest.new(security_marks: security_marks, update_mask: update_mask, start_time: start_time) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use hash object with options - client.update_security_marks({ security_marks: security_marks, update_mask: update_mask, start_time: start_time }, grpc_options) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object with options - client.update_security_marks(::Google::Cloud::SecurityCenter::V1p1beta1::UpdateSecurityMarksRequest.new(security_marks: security_marks, update_mask: update_mask, start_time: start_time), grpc_options) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Verify method calls - assert_equal 5, update_security_marks_client_stub.call_rpc_count - end - end - - def test_configure - grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - - client = block_config = config = nil - dummy_stub = ClientStub.new nil, nil - Gapic::ServiceStub.stub :new, dummy_stub do - client = ::Google::Cloud::SecurityCenter::V1p1beta1::SecurityCenter::Client.new do |config| - config.credentials = grpc_channel - end - end - - config = client.configure do |c| - block_config = c - end - - assert_same block_config, config - assert_kind_of ::Google::Cloud::SecurityCenter::V1p1beta1::SecurityCenter::Client::Configuration, config - end - - def test_credentials - key = OpenSSL::PKey::RSA.new 2048 - cred_json = { - "private_key" => key.to_pem, - "client_email" => "app@developer.gserviceaccount.com", - "type" => "service_account" - } - key_file = StringIO.new cred_json.to_json - creds = Google::Auth::ServiceAccountCredentials.make_creds({ json_key_io: key_file }) - - dummy_stub = ClientStub.new nil, nil - Gapic::ServiceStub.stub :new, dummy_stub do - client = ::Google::Cloud::SecurityCenter::V1p1beta1::SecurityCenter::Client.new do |config| - config.credentials = creds - end - assert_kind_of ::Google::Cloud::SecurityCenter::V1p1beta1::SecurityCenter::Client, client - assert_equal creds, client.configure.credentials - end - end - - def test_operations_client - grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - - client = nil - dummy_stub = ClientStub.new nil, nil - Gapic::ServiceStub.stub :new, dummy_stub do - client = ::Google::Cloud::SecurityCenter::V1p1beta1::SecurityCenter::Client.new do |config| - config.credentials = grpc_channel - end - end - - assert_kind_of ::Google::Cloud::SecurityCenter::V1p1beta1::SecurityCenter::Operations, client.operations_client - end -end diff --git a/owl-bot-staging/google-cloud-security_center-v1p1beta1/test/helper.rb b/owl-bot-staging/google-cloud-security_center-v1p1beta1/test/helper.rb deleted file mode 100644 index 672b337030e7..000000000000 --- a/owl-bot-staging/google-cloud-security_center-v1p1beta1/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" diff --git a/owl-bot-staging/google-cloud-security_center-v2/.gitignore b/owl-bot-staging/google-cloud-security_center-v2/.gitignore deleted file mode 100644 index 0135b6bc6cfc..000000000000 --- a/owl-bot-staging/google-cloud-security_center-v2/.gitignore +++ /dev/null @@ -1,22 +0,0 @@ -# Ignore bundler lockfiles -Gemfile.lock -gems.locked - -# Ignore documentation output -doc/* -.yardoc/* - -# Ignore test output -coverage/* - -# Ignore build artifacts -pkg/* - -# Ignore files commonly present in certain dev environments -.vagrant -.DS_STORE -.idea -*.iml - -# Ignore synth output -__pycache__ diff --git a/owl-bot-staging/google-cloud-security_center-v2/.repo-metadata.json b/owl-bot-staging/google-cloud-security_center-v2/.repo-metadata.json deleted file mode 100644 index 0473cc4ee50a..000000000000 --- a/owl-bot-staging/google-cloud-security_center-v2/.repo-metadata.json +++ /dev/null @@ -1,18 +0,0 @@ -{ - "api_id": "securitycenter.googleapis.com", - "api_shortname": "securitycenter", - "client_documentation": "https://cloud.google.com/ruby/docs/reference/google-cloud-security_center-v2/latest", - "distribution_name": "google-cloud-security_center-v2", - "is_cloud": true, - "language": "ruby", - "name": "securitycenter", - "name_pretty": "Security Command Center V2 API", - "product_documentation": "https://cloud.google.com/security-command-center", - "release_level": "unreleased", - "repo": "googleapis/google-cloud-ruby", - "requires_billing": true, - "ruby-cloud-description": "Security Command Center API provides access to temporal views of assets and findings within an organization. Note that google-cloud-security_center-v2 is a version-specific client library. For most uses, we recommend installing the main client library google-cloud-security_center instead. See the readme for more details.", - "ruby-cloud-env-prefix": "SECURITY_CENTER", - "ruby-cloud-product-url": "https://cloud.google.com/security-command-center", - "library_type": "GAPIC_AUTO" -} diff --git a/owl-bot-staging/google-cloud-security_center-v2/.rubocop.yml b/owl-bot-staging/google-cloud-security_center-v2/.rubocop.yml deleted file mode 100644 index ca95d31c752a..000000000000 --- a/owl-bot-staging/google-cloud-security_center-v2/.rubocop.yml +++ /dev/null @@ -1,33 +0,0 @@ -inherit_gem: - google-style: google-style.yml - -AllCops: - Exclude: - - "google-cloud-security_center-v2.gemspec" - - "lib/**/*_pb.rb" - - "proto_docs/**/*" - - "test/**/*" - - "acceptance/**/*" - - "samples/acceptance/**/*" - - "Rakefile" - -Layout/LineLength: - Enabled: false -Metrics/AbcSize: - Enabled: false -Metrics/ClassLength: - Enabled: false -Metrics/CyclomaticComplexity: - Enabled: false -Metrics/MethodLength: - Enabled: false -Metrics/ModuleLength: - Enabled: false -Metrics/PerceivedComplexity: - Enabled: false -Naming/AccessorMethodName: - Exclude: - - "snippets/**/*.rb" -Naming/FileName: - Exclude: - - "lib/google-cloud-security_center-v2.rb" diff --git a/owl-bot-staging/google-cloud-security_center-v2/.toys.rb b/owl-bot-staging/google-cloud-security_center-v2/.toys.rb deleted file mode 100644 index 177e22456e8a..000000000000 --- a/owl-bot-staging/google-cloud-security_center-v2/.toys.rb +++ /dev/null @@ -1,28 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -toys_version! ">= 0.15.3" - -if ENV["RUBY_COMMON_TOOLS"] - common_tools_dir = File.expand_path ENV["RUBY_COMMON_TOOLS"] - load File.join(common_tools_dir, "toys", "gapic") -else - load_git remote: "https://github.com/googleapis/ruby-common-tools.git", - path: "toys/gapic", - update: true -end diff --git a/owl-bot-staging/google-cloud-security_center-v2/.yardopts b/owl-bot-staging/google-cloud-security_center-v2/.yardopts deleted file mode 100644 index ce63c0dd16df..000000000000 --- a/owl-bot-staging/google-cloud-security_center-v2/.yardopts +++ /dev/null @@ -1,12 +0,0 @@ ---no-private ---title="Security Command Center V2 API" ---exclude _pb\.rb$ ---markup markdown ---markup-provider redcarpet - -./lib/**/*.rb -./proto_docs/**/*.rb -- -README.md -LICENSE.md -AUTHENTICATION.md diff --git a/owl-bot-staging/google-cloud-security_center-v2/AUTHENTICATION.md b/owl-bot-staging/google-cloud-security_center-v2/AUTHENTICATION.md deleted file mode 100644 index f1313afe9378..000000000000 --- a/owl-bot-staging/google-cloud-security_center-v2/AUTHENTICATION.md +++ /dev/null @@ -1,122 +0,0 @@ -# Authentication - -The recommended way to authenticate to the google-cloud-security_center-v2 library is to use -[Application Default Credentials (ADC)](https://cloud.google.com/docs/authentication/application-default-credentials). -To review all of your authentication options, see [Credentials lookup](#credential-lookup). - -## Quickstart - -The following example shows how to set up authentication for a local development -environment with your user credentials. - -**NOTE:** This method is _not_ recommended for running in production. User credentials -should be used only during development. - -1. [Download and install the Google Cloud CLI](https://cloud.google.com/sdk). -2. Set up a local ADC file with your user credentials: - -```sh -gcloud auth application-default login -``` - -3. Write code as if already authenticated. - -For more information about setting up authentication for a local development environment, see -[Set up Application Default Credentials](https://cloud.google.com/docs/authentication/provide-credentials-adc#local-dev). - -## Credential Lookup - -The google-cloud-security_center-v2 library provides several mechanisms to configure your system. -Generally, using Application Default Credentials to facilitate automatic -credentials discovery is the easist method. But if you need to explicitly specify -credentials, there are several methods available to you. - -Credentials are accepted in the following ways, in the following order or precedence: - -1. Credentials specified in method arguments -2. Credentials specified in configuration -3. Credentials pointed to or included in environment variables -4. Credentials found in local ADC file -5. Credentials returned by the metadata server for the attached service account (GCP) - -### Configuration - -You can configure a path to a JSON credentials file, either for an individual client object or -globally, for all client objects. The JSON file can contain credentials created for -[workload identity federation](https://cloud.google.com/iam/docs/workload-identity-federation), -[workforce identity federation](https://cloud.google.com/iam/docs/workforce-identity-federation), or a -[service account key](https://cloud.google.com/docs/authentication/provide-credentials-adc#local-key). - -Note: Service account keys are a security risk if not managed correctly. You should -[choose a more secure alternative to service account keys](https://cloud.google.com/docs/authentication#auth-decision-tree) -whenever possible. - -To configure a credentials file for an individual client initialization: - -```ruby -require "google/cloud/security_center/v2" - -client = ::Google::Cloud::SecurityCenter::V2::SecurityCenter::Client.new do |config| - config.credentials = "path/to/credentialfile.json" -end -``` - -To configure a credentials file globally for all clients: - -```ruby -require "google/cloud/security_center/v2" - -::Google::Cloud::SecurityCenter::V2::SecurityCenter::Client.configure do |config| - config.credentials = "path/to/credentialfile.json" -end - -client = ::Google::Cloud::SecurityCenter::V2::SecurityCenter::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-security_center-v2 -checks for credentials are: - -* `GOOGLE_CLOUD_CREDENTIALS` - Path to JSON file, or JSON contents -* `GOOGLE_APPLICATION_CREDENTIALS` - Path to JSON file - -```ruby -require "google/cloud/security_center/v2" - -ENV["GOOGLE_APPLICATION_CREDENTIALS"] = "path/to/credentialfile.json" - -client = ::Google::Cloud::SecurityCenter::V2::SecurityCenter::Client.new -``` - -### Local ADC file - -You can set up a local ADC file with your user credentials for authentication during -development. If credentials are not provided in code or in environment variables, -then the local ADC credentials are discovered. - -Follow the steps in [Quickstart](#quickstart) to set up a local ADC file. - -### Google Cloud Platform environments - -When running on Google Cloud Platform (GCP), including Google Compute Engine -(GCE), Google Kubernetes Engine (GKE), Google App Engine (GAE), Google Cloud -Functions (GCF) and Cloud Run, credentials are retrieved from the attached -service account automatically. Code should be written as if already authenticated. - -For more information, see -[Set up ADC for Google Cloud services](https://cloud.google.com/docs/authentication/provide-credentials-adc#attached-sa). diff --git a/owl-bot-staging/google-cloud-security_center-v2/CHANGELOG.md b/owl-bot-staging/google-cloud-security_center-v2/CHANGELOG.md deleted file mode 100644 index f88957a62ba2..000000000000 --- a/owl-bot-staging/google-cloud-security_center-v2/CHANGELOG.md +++ /dev/null @@ -1,2 +0,0 @@ -# Release History - diff --git a/owl-bot-staging/google-cloud-security_center-v2/Gemfile b/owl-bot-staging/google-cloud-security_center-v2/Gemfile deleted file mode 100644 index 1d08558908d8..000000000000 --- a/owl-bot-staging/google-cloud-security_center-v2/Gemfile +++ /dev/null @@ -1,14 +0,0 @@ -source "https://rubygems.org" - -gemspec - -gem "google-style", "~> 1.32.0" -gem "irb", "~> 1.17" -gem "minitest", "~> 6.0.2" -gem "minitest-focus", "~> 1.4" -gem "minitest-mock", "~> 5.27" -gem "minitest-rg", "~> 5.3" -gem "ostruct", "~> 0.5.5" -gem "rake", ">= 13.0" -gem "redcarpet", "~> 3.6" -gem "yard", "~> 0.9" diff --git a/owl-bot-staging/google-cloud-security_center-v2/LICENSE.md b/owl-bot-staging/google-cloud-security_center-v2/LICENSE.md deleted file mode 100644 index c261857ba6ad..000000000000 --- a/owl-bot-staging/google-cloud-security_center-v2/LICENSE.md +++ /dev/null @@ -1,201 +0,0 @@ - Apache License - Version 2.0, January 2004 - http://www.apache.org/licenses/ - - TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION - - 1. Definitions. - - "License" shall mean the terms and conditions for use, reproduction, - and distribution as defined by Sections 1 through 9 of this document. - - "Licensor" shall mean the copyright owner or entity authorized by - the copyright owner that is granting the License. - - "Legal Entity" shall mean the union of the acting entity and all - other entities that control, are controlled by, or are under common - control with that entity. For the purposes of this definition, - "control" means (i) the power, direct or indirect, to cause the - direction or management of such entity, whether by contract or - otherwise, or (ii) ownership of fifty percent (50%) or more of the - outstanding shares, or (iii) beneficial ownership of such entity. - - "You" (or "Your") shall mean an individual or Legal Entity - exercising permissions granted by this License. - - "Source" form shall mean the preferred form for making modifications, - including but not limited to software source code, documentation - source, and configuration files. - - "Object" form shall mean any form resulting from mechanical - transformation or translation of a Source form, including but - not limited to compiled object code, generated documentation, - and conversions to other media types. - - "Work" shall mean the work of authorship, whether in Source or - Object form, made available under the License, as indicated by a - copyright notice that is included in or attached to the work - (an example is provided in the Appendix below). - - "Derivative Works" shall mean any work, whether in Source or Object - form, that is based on (or derived from) the Work and for which the - editorial revisions, annotations, elaborations, or other modifications - represent, as a whole, an original work of authorship. For the purposes - of this License, Derivative Works shall not include works that remain - separable from, or merely link (or bind by name) to the interfaces of, - the Work and Derivative Works thereof. - - "Contribution" shall mean any work of authorship, including - the original version of the Work and any modifications or additions - to that Work or Derivative Works thereof, that is intentionally - submitted to Licensor for inclusion in the Work by the copyright owner - or by an individual or Legal Entity authorized to submit on behalf of - the copyright owner. For the purposes of this definition, "submitted" - means any form of electronic, verbal, or written communication sent - to the Licensor or its representatives, including but not limited to - communication on electronic mailing lists, source code control systems, - and issue tracking systems that are managed by, or on behalf of, the - Licensor for the purpose of discussing and improving the Work, but - excluding communication that is conspicuously marked or otherwise - designated in writing by the copyright owner as "Not a Contribution." - - "Contributor" shall mean Licensor and any individual or Legal Entity - on behalf of whom a Contribution has been received by Licensor and - subsequently incorporated within the Work. - - 2. Grant of Copyright License. Subject to the terms and conditions of - this License, each Contributor hereby grants to You a perpetual, - worldwide, non-exclusive, no-charge, royalty-free, irrevocable - copyright license to reproduce, prepare Derivative Works of, - publicly display, publicly perform, sublicense, and distribute the - Work and such Derivative Works in Source or Object form. - - 3. Grant of Patent License. Subject to the terms and conditions of - this License, each Contributor hereby grants to You a perpetual, - worldwide, non-exclusive, no-charge, royalty-free, irrevocable - (except as stated in this section) patent license to make, have made, - use, offer to sell, sell, import, and otherwise transfer the Work, - where such license applies only to those patent claims licensable - by such Contributor that are necessarily infringed by their - Contribution(s) alone or by combination of their Contribution(s) - with the Work to which such Contribution(s) was submitted. If You - institute patent litigation against any entity (including a - cross-claim or counterclaim in a lawsuit) alleging that the Work - or a Contribution incorporated within the Work constitutes direct - or contributory patent infringement, then any patent licenses - granted to You under this License for that Work shall terminate - as of the date such litigation is filed. - - 4. Redistribution. You may reproduce and distribute copies of the - Work or Derivative Works thereof in any medium, with or without - modifications, and in Source or Object form, provided that You - meet the following conditions: - - (a) You must give any other recipients of the Work or - Derivative Works a copy of this License; and - - (b) You must cause any modified files to carry prominent notices - stating that You changed the files; and - - (c) You must retain, in the Source form of any Derivative Works - that You distribute, all copyright, patent, trademark, and - attribution notices from the Source form of the Work, - excluding those notices that do not pertain to any part of - the Derivative Works; and - - (d) If the Work includes a "NOTICE" text file as part of its - distribution, then any Derivative Works that You distribute must - include a readable copy of the attribution notices contained - within such NOTICE file, excluding those notices that do not - pertain to any part of the Derivative Works, in at least one - of the following places: within a NOTICE text file distributed - as part of the Derivative Works; within the Source form or - documentation, if provided along with the Derivative Works; or, - within a display generated by the Derivative Works, if and - wherever such third-party notices normally appear. The contents - of the NOTICE file are for informational purposes only and - do not modify the License. You may add Your own attribution - notices within Derivative Works that You distribute, alongside - or as an addendum to the NOTICE text from the Work, provided - that such additional attribution notices cannot be construed - as modifying the License. - - You may add Your own copyright statement to Your modifications and - may provide additional or different license terms and conditions - for use, reproduction, or distribution of Your modifications, or - for any such Derivative Works as a whole, provided Your use, - reproduction, and distribution of the Work otherwise complies with - the conditions stated in this License. - - 5. Submission of Contributions. Unless You explicitly state otherwise, - any Contribution intentionally submitted for inclusion in the Work - by You to the Licensor shall be under the terms and conditions of - this License, without any additional terms or conditions. - Notwithstanding the above, nothing herein shall supersede or modify - the terms of any separate license agreement you may have executed - with Licensor regarding such Contributions. - - 6. Trademarks. This License does not grant permission to use the trade - names, trademarks, service marks, or product names of the Licensor, - except as required for reasonable and customary use in describing the - origin of the Work and reproducing the content of the NOTICE file. - - 7. Disclaimer of Warranty. Unless required by applicable law or - agreed to in writing, Licensor provides the Work (and each - Contributor provides its Contributions) on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or - implied, including, without limitation, any warranties or conditions - of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A - PARTICULAR PURPOSE. You are solely responsible for determining the - appropriateness of using or redistributing the Work and assume any - risks associated with Your exercise of permissions under this License. - - 8. Limitation of Liability. In no event and under no legal theory, - whether in tort (including negligence), contract, or otherwise, - unless required by applicable law (such as deliberate and grossly - negligent acts) or agreed to in writing, shall any Contributor be - liable to You for damages, including any direct, indirect, special, - incidental, or consequential damages of any character arising as a - result of this License or out of the use or inability to use the - Work (including but not limited to damages for loss of goodwill, - work stoppage, computer failure or malfunction, or any and all - other commercial damages or losses), even if such Contributor - has been advised of the possibility of such damages. - - 9. Accepting Warranty or Additional Liability. While redistributing - the Work or Derivative Works thereof, You may choose to offer, - and charge a fee for, acceptance of support, warranty, indemnity, - or other liability obligations and/or rights consistent with this - License. However, in accepting such obligations, You may act only - on Your own behalf and on Your sole responsibility, not on behalf - of any other Contributor, and only if You agree to indemnify, - defend, and hold each Contributor harmless for any liability - incurred by, or claims asserted against, such Contributor by reason - of your accepting any such warranty or additional liability. - - END OF TERMS AND CONDITIONS - - APPENDIX: How to apply the Apache License to your work. - - To apply the Apache License to your work, attach the following - boilerplate notice, with the fields enclosed by brackets "[]" - replaced with your own identifying information. (Don't include - the brackets!) The text should be enclosed in the appropriate - comment syntax for the file format. We also recommend that a - file or class name and description of purpose be included on the - same "printed page" as the copyright notice for easier - identification within third-party archives. - - Copyright [yyyy] [name of copyright owner] - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. diff --git a/owl-bot-staging/google-cloud-security_center-v2/README.md b/owl-bot-staging/google-cloud-security_center-v2/README.md deleted file mode 100644 index b1b40a5b2f90..000000000000 --- a/owl-bot-staging/google-cloud-security_center-v2/README.md +++ /dev/null @@ -1,154 +0,0 @@ -# Ruby Client for the Security Command Center V2 API - -Security Command Center API provides access to temporal views of assets and findings within an organization. - -Security Command Center API provides access to temporal views of assets and findings within an organization. - -https://github.com/googleapis/google-cloud-ruby - -This gem is a _versioned_ client. It provides basic client classes for a -specific version of the Security Command Center V2 API. Most users should consider using -the main client gem, -[google-cloud-security_center](https://rubygems.org/gems/google-cloud-security_center). -See the section below titled *Which client should I use?* for more information. - -## Installation - -``` -$ gem install google-cloud-security_center-v2 -``` - -## Before You Begin - -In order to use this library, you first need to go through the following steps: - -1. [Select or create a Cloud Platform project.](https://console.cloud.google.com/project) -1. [Enable billing for your project.](https://cloud.google.com/billing/docs/how-to/modify-project#enable_billing_for_a_project) -1. [Enable the API.](https://console.cloud.google.com/apis/library/securitycenter.googleapis.com) -1. [Set up authentication.](AUTHENTICATION.md) - -## Quick Start - -```ruby -require "google/cloud/security_center/v2" - -client = ::Google::Cloud::SecurityCenter::V2::SecurityCenter::Client.new -request = ::Google::Cloud::SecurityCenter::V2::BatchCreateResourceValueConfigsRequest.new # (request fields as keyword arguments...) -response = client.batch_create_resource_value_configs request -``` - -View the [Client Library Documentation](https://cloud.google.com/ruby/docs/reference/google-cloud-security_center-v2/latest) -for class and method documentation. - -See also the [Product Documentation](https://cloud.google.com/security-command-center) -for general usage information. - -## Debug Logging - -This library comes with opt-in Debug Logging that can help you troubleshoot -your application's integration with the API. When logging is activated, key -events such as requests and responses, along with data payloads and metadata -such as headers and client configuration, are logged to the standard error -stream. - -**WARNING:** Client Library Debug Logging includes your data payloads in -plaintext, which could include sensitive data such as PII for yourself or your -customers, private keys, or other security data that could be compromising if -leaked. Always practice good data hygiene with your application logs, and follow -the principle of least access. Google also recommends that Client Library Debug -Logging be enabled only temporarily during active debugging, and not used -permanently in production. - -To enable logging, set the environment variable `GOOGLE_SDK_RUBY_LOGGING_GEMS` -to the value `all`. Alternatively, you can set the value to a comma-delimited -list of client library gem names. This will select the default logging behavior, -which writes logs to the standard error stream. On a local workstation, this may -result in logs appearing on the console. When running on a Google Cloud hosting -service such as [Google Cloud Run](https://cloud.google.com/run), this generally -results in logs appearing alongside your application logs in the -[Google Cloud Logging](https://cloud.google.com/logging/) service. - -You can customize logging by modifying the `logger` configuration when -constructing a client object. For example: - -```ruby -require "google/cloud/security_center/v2" -require "logger" - -client = ::Google::Cloud::SecurityCenter::V2::SecurityCenter::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-security_center`, -and lower-level _versioned_ client libraries with names such as -`google-cloud-security_center-v2`. -_In most cases, you should install the main client._ - -### What's the difference between the main client and a versioned client? - -A _versioned client_ provides a basic set of data types and client classes for -a _single version_ of a specific service. (That is, for a service with multiple -versions, there might be a separate versioned client for each service version.) -Most versioned clients are written and maintained by a code generator. - -The _main client_ is designed to provide you with the _recommended_ client -interfaces for the service. There will be only one main client for any given -service, even a service with multiple versions. The main client includes -factory methods for constructing the client objects we recommend for most -users. In some cases, those will be classes provided by an underlying versioned -client; in other cases, they will be handwritten higher-level client objects -with additional capabilities, convenience methods, or best practices built in. -Generally, the main client will default to a recommended service version, -although in some cases you can override this if you need to talk to a specific -service version. - -### Why would I want to use the main client? - -We recommend that most users install the main client gem for a service. You can -identify this gem as the one _without_ a version in its name, e.g. -`google-cloud-security_center`. -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-security_center-v2`. - -### What about the google-apis- clients? - -Client library gems with names that begin with `google-apis-` are based on an -older code generation technology. They talk to a REST/JSON backend (whereas -most modern clients talk to a [gRPC](https://grpc.io/) backend) and they may -not offer the same performance, features, and ease of use provided by more -modern clients. - -The `google-apis-` clients have wide coverage across Google services, so you -might need to use one if there is no modern client available for the service. -However, if a modern client is available, we generally recommend it over the -older `google-apis-` clients. diff --git a/owl-bot-staging/google-cloud-security_center-v2/Rakefile b/owl-bot-staging/google-cloud-security_center-v2/Rakefile deleted file mode 100644 index 3f3dda612226..000000000000 --- a/owl-bot-staging/google-cloud-security_center-v2/Rakefile +++ /dev/null @@ -1,169 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -require "bundler/setup" -require "bundler/gem_tasks" - -require "rubocop/rake_task" -RuboCop::RakeTask.new - -require "rake/testtask" -desc "Run tests." -Rake::TestTask.new do |t| - t.libs << "test" - t.test_files = FileList["test/**/*_test.rb"] - t.warning = false -end - -desc "Runs the smoke tests." -Rake::TestTask.new :smoke_test do |t| - t.test_files = FileList["acceptance/**/*smoke_test.rb"] - t.warning = false -end - -# Acceptance tests -desc "Run the google-cloud-security_center-v2 acceptance tests." -task :acceptance, :project, :keyfile do |t, args| - project = args[:project] - project ||= - ENV["SECURITY_CENTER_TEST_PROJECT"] || - ENV["GCLOUD_TEST_PROJECT"] - keyfile = args[:keyfile] - keyfile ||= - ENV["SECURITY_CENTER_TEST_KEYFILE"] || - ENV["GCLOUD_TEST_KEYFILE"] - if keyfile - keyfile = File.read keyfile - else - keyfile ||= - ENV["SECURITY_CENTER_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 SECURITY_CENTER_TEST_PROJECT=test123 SECURITY_CENTER_TEST_KEYFILE=/path/to/keyfile.json rake acceptance" - end - require "google/cloud/security_center/v2/security_center/credentials" - ::Google::Cloud::SecurityCenter::V2::SecurityCenter::Credentials.env_vars.each do |path| - ENV[path] = nil - end - ENV["SECURITY_CENTER_PROJECT"] = project - ENV["SECURITY_CENTER_TEST_PROJECT"] = project - ENV["SECURITY_CENTER_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-security_center-v2 gem has no acceptance tests." - end - end - - desc "Run acceptance cleanup." - task :cleanup do - end -end - -task :samples do - Rake::Task["samples:latest"].invoke -end - -namespace :samples do - task :latest do - if File.directory? "samples" - Dir.chdir "samples" do - Bundler.with_clean_env do - ENV["GOOGLE_CLOUD_SAMPLES_TEST"] = "not_master" - sh "bundle update" - sh "bundle exec rake test" - end - end - else - puts "The google-cloud-security_center-v2 gem has no samples to test." - end - end - - task :master do - if File.directory? "samples" - Dir.chdir "samples" do - Bundler.with_clean_env do - ENV["GOOGLE_CLOUD_SAMPLES_TEST"] = "master" - sh "bundle update" - sh "bundle exec rake test" - end - end - else - puts "The google-cloud-security_center-v2 gem has no samples to test." - end - end -end - -require "yard" -require "yard/rake/yardoc_task" -YARD::Rake::YardocTask.new do |y| - y.options << "--fail-on-warning" -end - -desc "Run yard-doctest example tests." -task :doctest do - puts "The google-cloud-security_center-v2 gem does not have doctest tests." -end - -desc "Run the CI build" -task :ci do - header "BUILDING google-cloud-security_center-v2" - header "google-cloud-security_center-v2 rubocop", "*" - Rake::Task[:rubocop].invoke - header "google-cloud-security_center-v2 yard", "*" - Rake::Task[:yard].invoke - header "google-cloud-security_center-v2 test", "*" - Rake::Task[:test].invoke -end - -namespace :ci do - desc "Run the CI build, with smoke tests." - task :smoke_test do - Rake::Task[:ci].invoke - header "google-cloud-security_center-v2 smoke_test", "*" - Rake::Task[:smoke_test].invoke - end - desc "Run the CI build, with acceptance tests." - task :acceptance do - Rake::Task[:ci].invoke - header "google-cloud-security_center-v2 acceptance", "*" - Rake::Task[:acceptance].invoke - end - task :a do - # This is a handy shortcut to save typing - Rake::Task["ci:acceptance"].invoke - end -end - -task default: :test - -def header str, token = "#" - line_length = str.length + 8 - puts "" - puts token * line_length - puts "#{token * 3} #{str} #{token * 3}" - puts token * line_length - puts "" -end diff --git a/owl-bot-staging/google-cloud-security_center-v2/gapic_metadata.json b/owl-bot-staging/google-cloud-security_center-v2/gapic_metadata.json deleted file mode 100644 index 8859452b344a..000000000000 --- a/owl-bot-staging/google-cloud-security_center-v2/gapic_metadata.json +++ /dev/null @@ -1,218 +0,0 @@ -{ - "schema": "1.0", - "comment": "This file maps proto services/RPCs to the corresponding library clients/methods", - "language": "ruby", - "protoPackage": "google.cloud.securitycenter.v2", - "libraryPackage": "::Google::Cloud::SecurityCenter::V2", - "services": { - "SecurityCenter": { - "clients": { - "grpc": { - "libraryClient": "::Google::Cloud::SecurityCenter::V2::SecurityCenter::Client", - "rpcs": { - "BatchCreateResourceValueConfigs": { - "methods": [ - "batch_create_resource_value_configs" - ] - }, - "BulkMuteFindings": { - "methods": [ - "bulk_mute_findings" - ] - }, - "CreateBigQueryExport": { - "methods": [ - "create_big_query_export" - ] - }, - "CreateFinding": { - "methods": [ - "create_finding" - ] - }, - "CreateMuteConfig": { - "methods": [ - "create_mute_config" - ] - }, - "CreateNotificationConfig": { - "methods": [ - "create_notification_config" - ] - }, - "CreateSource": { - "methods": [ - "create_source" - ] - }, - "DeleteBigQueryExport": { - "methods": [ - "delete_big_query_export" - ] - }, - "DeleteMuteConfig": { - "methods": [ - "delete_mute_config" - ] - }, - "DeleteNotificationConfig": { - "methods": [ - "delete_notification_config" - ] - }, - "DeleteResourceValueConfig": { - "methods": [ - "delete_resource_value_config" - ] - }, - "GetBigQueryExport": { - "methods": [ - "get_big_query_export" - ] - }, - "GetSimulation": { - "methods": [ - "get_simulation" - ] - }, - "GetValuedResource": { - "methods": [ - "get_valued_resource" - ] - }, - "GetIamPolicy": { - "methods": [ - "get_iam_policy" - ] - }, - "GetMuteConfig": { - "methods": [ - "get_mute_config" - ] - }, - "GetNotificationConfig": { - "methods": [ - "get_notification_config" - ] - }, - "GetResourceValueConfig": { - "methods": [ - "get_resource_value_config" - ] - }, - "GetSource": { - "methods": [ - "get_source" - ] - }, - "GroupFindings": { - "methods": [ - "group_findings" - ] - }, - "ListAttackPaths": { - "methods": [ - "list_attack_paths" - ] - }, - "ListBigQueryExports": { - "methods": [ - "list_big_query_exports" - ] - }, - "ListFindings": { - "methods": [ - "list_findings" - ] - }, - "ListMuteConfigs": { - "methods": [ - "list_mute_configs" - ] - }, - "ListNotificationConfigs": { - "methods": [ - "list_notification_configs" - ] - }, - "ListResourceValueConfigs": { - "methods": [ - "list_resource_value_configs" - ] - }, - "ListSources": { - "methods": [ - "list_sources" - ] - }, - "ListValuedResources": { - "methods": [ - "list_valued_resources" - ] - }, - "SetFindingState": { - "methods": [ - "set_finding_state" - ] - }, - "SetIamPolicy": { - "methods": [ - "set_iam_policy" - ] - }, - "SetMute": { - "methods": [ - "set_mute" - ] - }, - "TestIamPermissions": { - "methods": [ - "test_iam_permissions" - ] - }, - "UpdateBigQueryExport": { - "methods": [ - "update_big_query_export" - ] - }, - "UpdateExternalSystem": { - "methods": [ - "update_external_system" - ] - }, - "UpdateFinding": { - "methods": [ - "update_finding" - ] - }, - "UpdateMuteConfig": { - "methods": [ - "update_mute_config" - ] - }, - "UpdateNotificationConfig": { - "methods": [ - "update_notification_config" - ] - }, - "UpdateResourceValueConfig": { - "methods": [ - "update_resource_value_config" - ] - }, - "UpdateSecurityMarks": { - "methods": [ - "update_security_marks" - ] - }, - "UpdateSource": { - "methods": [ - "update_source" - ] - } - } - } - } - } - } -} diff --git a/owl-bot-staging/google-cloud-security_center-v2/google-cloud-security_center-v2.gemspec b/owl-bot-staging/google-cloud-security_center-v2/google-cloud-security_center-v2.gemspec deleted file mode 100644 index cd37d72545a4..000000000000 --- a/owl-bot-staging/google-cloud-security_center-v2/google-cloud-security_center-v2.gemspec +++ /dev/null @@ -1,29 +0,0 @@ -# -*- ruby -*- -# encoding: utf-8 - -require File.expand_path("lib/google/cloud/security_center/v2/version", __dir__) - -Gem::Specification.new do |gem| - gem.name = "google-cloud-security_center-v2" - gem.version = Google::Cloud::SecurityCenter::V2::VERSION - - gem.authors = ["Google LLC"] - gem.email = "googleapis-packages@google.com" - gem.description = "Security Command Center API provides access to temporal views of assets and findings within an organization. Note that google-cloud-security_center-v2 is a version-specific client library. For most uses, we recommend installing the main client library google-cloud-security_center instead. See the readme for more details." - gem.summary = "Security Command Center API provides access to temporal views of assets and findings within an organization." - 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 "grpc-google-iam-v1", "~> 1.11" -end diff --git a/owl-bot-staging/google-cloud-security_center-v2/lib/google-cloud-security_center-v2.rb b/owl-bot-staging/google-cloud-security_center-v2/lib/google-cloud-security_center-v2.rb deleted file mode 100644 index fbfebf50a08d..000000000000 --- a/owl-bot-staging/google-cloud-security_center-v2/lib/google-cloud-security_center-v2.rb +++ /dev/null @@ -1,21 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -# This gem does not autoload during Bundler.require. To load this gem, -# issue explicit require statements for the packages desired, e.g.: -# require "google/cloud/security_center/v2" diff --git a/owl-bot-staging/google-cloud-security_center-v2/lib/google/cloud/security_center/v2.rb b/owl-bot-staging/google-cloud-security_center-v2/lib/google/cloud/security_center/v2.rb deleted file mode 100644 index cb448baa8c34..000000000000 --- a/owl-bot-staging/google-cloud-security_center-v2/lib/google/cloud/security_center/v2.rb +++ /dev/null @@ -1,45 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -require "google/cloud/security_center/v2/security_center" -require "google/cloud/security_center/v2/version" - -module Google - module Cloud - module SecurityCenter - ## - # API client module. - # - # @example Load this package, including all its services, and instantiate a gRPC client - # - # require "google/cloud/security_center/v2" - # client = ::Google::Cloud::SecurityCenter::V2::SecurityCenter::Client.new - # - # @example Load this package, including all its services, and instantiate a REST client - # - # require "google/cloud/security_center/v2" - # client = ::Google::Cloud::SecurityCenter::V2::SecurityCenter::Rest::Client.new - # - module V2 - end - end - end -end - -helper_path = ::File.join __dir__, "v2", "_helpers.rb" -require "google/cloud/security_center/v2/_helpers" if ::File.file? helper_path diff --git a/owl-bot-staging/google-cloud-security_center-v2/lib/google/cloud/security_center/v2/rest.rb b/owl-bot-staging/google-cloud-security_center-v2/lib/google/cloud/security_center/v2/rest.rb deleted file mode 100644 index 25ca637b14ef..000000000000 --- a/owl-bot-staging/google-cloud-security_center-v2/lib/google/cloud/security_center/v2/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/cloud/security_center/v2/security_center/rest" -require "google/cloud/security_center/v2/version" - -module Google - module Cloud - module SecurityCenter - ## - # To load just the REST part of this package, including all its services, and instantiate a REST client: - # - # @example - # - # require "google/cloud/security_center/v2/rest" - # client = ::Google::Cloud::SecurityCenter::V2::SecurityCenter::Rest::Client.new - # - module V2 - end - end - end -end diff --git a/owl-bot-staging/google-cloud-security_center-v2/lib/google/cloud/security_center/v2/security_center.rb b/owl-bot-staging/google-cloud-security_center-v2/lib/google/cloud/security_center/v2/security_center.rb deleted file mode 100644 index b2e61e4933b2..000000000000 --- a/owl-bot-staging/google-cloud-security_center-v2/lib/google/cloud/security_center/v2/security_center.rb +++ /dev/null @@ -1,56 +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/security_center/v2/version" - -require "google/cloud/security_center/v2/security_center/credentials" -require "google/cloud/security_center/v2/security_center/paths" -require "google/cloud/security_center/v2/security_center/operations" -require "google/cloud/security_center/v2/security_center/client" -require "google/cloud/security_center/v2/security_center/rest" - -module Google - module Cloud - module SecurityCenter - module V2 - ## - # V2 APIs for Security Center service. - # - # @example Load this service and instantiate a gRPC client - # - # require "google/cloud/security_center/v2/security_center" - # client = ::Google::Cloud::SecurityCenter::V2::SecurityCenter::Client.new - # - # @example Load this service and instantiate a REST client - # - # require "google/cloud/security_center/v2/security_center/rest" - # client = ::Google::Cloud::SecurityCenter::V2::SecurityCenter::Rest::Client.new - # - module SecurityCenter - end - end - end - end -end - -helper_path = ::File.join __dir__, "security_center", "helpers.rb" -require "google/cloud/security_center/v2/security_center/helpers" if ::File.file? helper_path diff --git a/owl-bot-staging/google-cloud-security_center-v2/lib/google/cloud/security_center/v2/security_center/client.rb b/owl-bot-staging/google-cloud-security_center-v2/lib/google/cloud/security_center/v2/security_center/client.rb deleted file mode 100644 index 7c8e3827a971..000000000000 --- a/owl-bot-staging/google-cloud-security_center-v2/lib/google/cloud/security_center/v2/security_center/client.rb +++ /dev/null @@ -1,4791 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -require "google/cloud/errors" -require "google/cloud/securitycenter/v2/securitycenter_service_pb" - -module Google - module Cloud - module SecurityCenter - module V2 - module SecurityCenter - ## - # Client for the SecurityCenter service. - # - # V2 APIs for Security Center service. - # - class Client - # @private - API_VERSION = "" - - # @private - DEFAULT_ENDPOINT_TEMPLATE = "securitycenter.$UNIVERSE_DOMAIN$" - - include Paths - - # @private - attr_reader :security_center_stub - - ## - # Configure the SecurityCenter Client class. - # - # See {::Google::Cloud::SecurityCenter::V2::SecurityCenter::Client::Configuration} - # for a description of the configuration fields. - # - # @example - # - # # Modify the configuration for all SecurityCenter clients - # ::Google::Cloud::SecurityCenter::V2::SecurityCenter::Client.configure do |config| - # config.timeout = 10.0 - # end - # - # @yield [config] Configure the Client client. - # @yieldparam config [Client::Configuration] - # - # @return [Client::Configuration] - # - def self.configure - @configure ||= begin - namespace = ["Google", "Cloud", "SecurityCenter", "V2"] - parent_config = while namespace.any? - parent_name = namespace.join "::" - parent_const = const_get parent_name - break parent_const.configure if parent_const.respond_to? :configure - namespace.pop - end - default_config = Client::Configuration.new parent_config - - default_config - end - yield @configure if block_given? - @configure - end - - ## - # Configure the SecurityCenter Client instance. - # - # The configuration is set to the derived mode, meaning that values can be changed, - # but structural changes (adding new fields, etc.) are not allowed. Structural changes - # should be made on {Client.configure}. - # - # See {::Google::Cloud::SecurityCenter::V2::SecurityCenter::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 - @security_center_stub.universe_domain - end - - ## - # Create a new SecurityCenter client object. - # - # @example - # - # # Create a client using the default configuration - # client = ::Google::Cloud::SecurityCenter::V2::SecurityCenter::Client.new - # - # # Create a client using a custom configuration - # client = ::Google::Cloud::SecurityCenter::V2::SecurityCenter::Client.new do |config| - # config.timeout = 10.0 - # end - # - # @yield [config] Configure the SecurityCenter client. - # @yieldparam config [Client::Configuration] - # - def initialize - # These require statements are intentionally placed here to initialize - # the gRPC module only when it's required. - # See https://github.com/googleapis/toolkit/issues/446 - require "gapic/grpc" - require "google/cloud/securitycenter/v2/securitycenter_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 - - @security_center_stub = ::Gapic::ServiceStub.new( - ::Google::Cloud::SecurityCenter::V2::SecurityCenter::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 - ) - - @security_center_stub.stub_logger&.info do |entry| - entry.set_system_name - entry.set_service - entry.message = "Created client for #{entry.service}" - entry.set_credentials_fields credentials - entry.set "customEndpoint", @config.endpoint if @config.endpoint - entry.set "defaultTimeout", @config.timeout if @config.timeout - entry.set "quotaProject", @quota_project_id if @quota_project_id - end - end - - ## - # Get the associated client for long-running operations. - # - # @return [::Google::Cloud::SecurityCenter::V2::SecurityCenter::Operations] - # - attr_reader :operations_client - - ## - # The logger used for request/response debug logging. - # - # @return [Logger] - # - def logger - @security_center_stub.logger - end - - # Service calls - - ## - # Creates a ResourceValueConfig for an organization. Maps user's tags to - # difference resource values for use by the attack path simulation. - # - # @overload batch_create_resource_value_configs(request, options = nil) - # Pass arguments to `batch_create_resource_value_configs` via a request object, either of type - # {::Google::Cloud::SecurityCenter::V2::BatchCreateResourceValueConfigsRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::SecurityCenter::V2::BatchCreateResourceValueConfigsRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. - # - # @overload batch_create_resource_value_configs(parent: nil, requests: nil) - # Pass arguments to `batch_create_resource_value_configs` via keyword arguments. Note that at - # least one keyword argument is 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. Resource name of the new ResourceValueConfig's parent. - # The parent field in the CreateResourceValueConfigRequest - # messages must either be empty or match this field. - # @param requests [::Array<::Google::Cloud::SecurityCenter::V2::CreateResourceValueConfigRequest, ::Hash>] - # Required. The resource value configs to be created. - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Google::Cloud::SecurityCenter::V2::BatchCreateResourceValueConfigsResponse] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Google::Cloud::SecurityCenter::V2::BatchCreateResourceValueConfigsResponse] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/cloud/security_center/v2" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::SecurityCenter::V2::SecurityCenter::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::SecurityCenter::V2::BatchCreateResourceValueConfigsRequest.new - # - # # Call the batch_create_resource_value_configs method. - # result = client.batch_create_resource_value_configs request - # - # # The returned object is of type Google::Cloud::SecurityCenter::V2::BatchCreateResourceValueConfigsResponse. - # p result - # - def batch_create_resource_value_configs request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::SecurityCenter::V2::BatchCreateResourceValueConfigsRequest - - # Converts hash 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.batch_create_resource_value_configs.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::SecurityCenter::V2::VERSION - metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - header_params = {} - if request.parent - 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.batch_create_resource_value_configs.timeout, - metadata: metadata, - retry_policy: @config.rpcs.batch_create_resource_value_configs.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @security_center_stub.call_rpc :batch_create_resource_value_configs, 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 - - ## - # Kicks off an LRO to bulk mute findings for a parent based on a filter. If - # no location is specified, findings are muted in global. The parent - # can be either an organization, folder, or project. The findings matched by - # the filter will be muted after the LRO is done. - # - # @overload bulk_mute_findings(request, options = nil) - # Pass arguments to `bulk_mute_findings` via a request object, either of type - # {::Google::Cloud::SecurityCenter::V2::BulkMuteFindingsRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::SecurityCenter::V2::BulkMuteFindingsRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. - # - # @overload bulk_mute_findings(parent: nil, filter: nil, mute_state: nil) - # Pass arguments to `bulk_mute_findings` via keyword arguments. Note that at - # least one keyword argument is 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, at which bulk action needs to be applied. If no - # location is specified, findings are updated in global. The following list - # shows some examples: - # - # + `organizations/[organization_id]` - # + `organizations/[organization_id]/locations/[location_id]` - # + `folders/[folder_id]` - # + `folders/[folder_id]/locations/[location_id]` - # + `projects/[project_id]` - # + `projects/[project_id]/locations/[location_id]` - # @param filter [::String] - # Expression that identifies findings that should be updated. - # The expression is a list of zero or more restrictions combined - # via logical operators `AND` and `OR`. Parentheses are supported, and `OR` - # has higher precedence than `AND`. - # - # Restrictions have the form ` ` and may have a - # `-` character in front of them to indicate negation. The fields map to - # those defined in the corresponding resource. - # - # The supported operators are: - # - # * `=` for all value types. - # * `>`, `<`, `>=`, `<=` for integer values. - # * `:`, meaning substring matching, for strings. - # - # The supported value types are: - # - # * string literals in quotes. - # * integer literals without quotes. - # * boolean literals `true` and `false` without quotes. - # @param mute_state [::Google::Cloud::SecurityCenter::V2::BulkMuteFindingsRequest::MuteState] - # Optional. All findings matching the given filter will have their mute state - # set to this value. The default value is `MUTED`. Setting this to - # `UNDEFINED` will clear the mute state on all matching findings. - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Gapic::Operation] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Gapic::Operation] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/cloud/security_center/v2" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::SecurityCenter::V2::SecurityCenter::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::SecurityCenter::V2::BulkMuteFindingsRequest.new - # - # # Call the bulk_mute_findings method. - # result = client.bulk_mute_findings 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 bulk_mute_findings request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::SecurityCenter::V2::BulkMuteFindingsRequest - - # Converts hash 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.bulk_mute_findings.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::SecurityCenter::V2::VERSION - metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - header_params = {} - if request.parent - 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.bulk_mute_findings.timeout, - metadata: metadata, - retry_policy: @config.rpcs.bulk_mute_findings.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @security_center_stub.call_rpc :bulk_mute_findings, 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 - - ## - # Creates a BigQuery export. - # - # @overload create_big_query_export(request, options = nil) - # Pass arguments to `create_big_query_export` via a request object, either of type - # {::Google::Cloud::SecurityCenter::V2::CreateBigQueryExportRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::SecurityCenter::V2::CreateBigQueryExportRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_big_query_export(parent: nil, big_query_export: nil, big_query_export_id: nil) - # Pass arguments to `create_big_query_export` via keyword arguments. Note that at - # least one keyword argument is 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 name of the parent resource of the new BigQuery export. Its - # format is `organizations/[organization_id]/locations/[location_id]`, - # `folders/[folder_id]/locations/[location_id]`, or - # `projects/[project_id]/locations/[location_id]`. - # @param big_query_export [::Google::Cloud::SecurityCenter::V2::BigQueryExport, ::Hash] - # Required. The BigQuery export being created. - # @param big_query_export_id [::String] - # Required. Unique identifier provided by the client within the parent scope. - # It must consist of only lowercase letters, numbers, and hyphens, must start - # with a letter, must end with either a letter or a number, and must be 63 - # characters or less. - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Google::Cloud::SecurityCenter::V2::BigQueryExport] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Google::Cloud::SecurityCenter::V2::BigQueryExport] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/cloud/security_center/v2" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::SecurityCenter::V2::SecurityCenter::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::SecurityCenter::V2::CreateBigQueryExportRequest.new - # - # # Call the create_big_query_export method. - # result = client.create_big_query_export request - # - # # The returned object is of type Google::Cloud::SecurityCenter::V2::BigQueryExport. - # p result - # - def create_big_query_export request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::SecurityCenter::V2::CreateBigQueryExportRequest - - # Converts hash 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_big_query_export.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::SecurityCenter::V2::VERSION - metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - header_params = {} - if request.parent - 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_big_query_export.timeout, - metadata: metadata, - retry_policy: @config.rpcs.create_big_query_export.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @security_center_stub.call_rpc :create_big_query_export, request, options: options do |response, operation| - yield response, operation if block_given? - end - rescue ::GRPC::BadStatus => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Creates a finding in a location. The corresponding source must exist for - # finding creation to succeed. - # - # @overload create_finding(request, options = nil) - # Pass arguments to `create_finding` via a request object, either of type - # {::Google::Cloud::SecurityCenter::V2::CreateFindingRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::SecurityCenter::V2::CreateFindingRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_finding(parent: nil, finding_id: nil, finding: nil) - # Pass arguments to `create_finding` via keyword arguments. Note that at - # least one keyword argument is 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. Resource name of the new finding's parent. The following list - # shows some examples of the format: - # + - # `organizations/[organization_id]/sources/[source_id]` - # + - # `organizations/[organization_id]/sources/[source_id]/locations/[location_id]` - # @param finding_id [::String] - # Required. Unique identifier provided by the client within the parent scope. - # It must be alphanumeric and less than or equal to 32 characters and - # greater than 0 characters in length. - # @param finding [::Google::Cloud::SecurityCenter::V2::Finding, ::Hash] - # Required. The Finding being created. The name and security_marks will be - # ignored as they are both output only fields on this resource. - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Google::Cloud::SecurityCenter::V2::Finding] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Google::Cloud::SecurityCenter::V2::Finding] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/cloud/security_center/v2" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::SecurityCenter::V2::SecurityCenter::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::SecurityCenter::V2::CreateFindingRequest.new - # - # # Call the create_finding method. - # result = client.create_finding request - # - # # The returned object is of type Google::Cloud::SecurityCenter::V2::Finding. - # p result - # - def create_finding request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::SecurityCenter::V2::CreateFindingRequest - - # Converts hash 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_finding.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::SecurityCenter::V2::VERSION - metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - header_params = {} - if request.parent - 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_finding.timeout, - metadata: metadata, - retry_policy: @config.rpcs.create_finding.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @security_center_stub.call_rpc :create_finding, request, options: options do |response, operation| - yield response, operation if block_given? - end - rescue ::GRPC::BadStatus => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Creates a mute config. - # - # @overload create_mute_config(request, options = nil) - # Pass arguments to `create_mute_config` via a request object, either of type - # {::Google::Cloud::SecurityCenter::V2::CreateMuteConfigRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::SecurityCenter::V2::CreateMuteConfigRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_mute_config(parent: nil, mute_config: nil, mute_config_id: nil) - # Pass arguments to `create_mute_config` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param parent [::String] - # Required. Resource name of the new mute configs's parent. Its format is - # `organizations/[organization_id]/locations/[location_id]`, - # `folders/[folder_id]/locations/[location_id]`, or - # `projects/[project_id]/locations/[location_id]`. - # @param mute_config [::Google::Cloud::SecurityCenter::V2::MuteConfig, ::Hash] - # Required. The mute config being created. - # @param mute_config_id [::String] - # Required. Unique identifier provided by the client within the parent scope. - # It must consist of only lowercase letters, numbers, and hyphens, must start - # with a letter, must end with either a letter or a number, and must be 63 - # characters or less. - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Google::Cloud::SecurityCenter::V2::MuteConfig] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Google::Cloud::SecurityCenter::V2::MuteConfig] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/cloud/security_center/v2" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::SecurityCenter::V2::SecurityCenter::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::SecurityCenter::V2::CreateMuteConfigRequest.new - # - # # Call the create_mute_config method. - # result = client.create_mute_config request - # - # # The returned object is of type Google::Cloud::SecurityCenter::V2::MuteConfig. - # p result - # - def create_mute_config request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::SecurityCenter::V2::CreateMuteConfigRequest - - # Converts hash 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_mute_config.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::SecurityCenter::V2::VERSION - metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - header_params = {} - if request.parent - regex_match = %r{^projects/[^/]+/locations/(?[^/]+)/?$}.match request.parent - if regex_match - header_params["location"] = regex_match["location".to_s] - end - end - if request.parent - regex_match = %r{^organizations/[^/]+/locations/(?[^/]+)/?$}.match request.parent - if regex_match - header_params["location"] = regex_match["location".to_s] - end - end - if request.parent - regex_match = %r{^folders/[^/]+/locations/(?[^/]+)/?$}.match request.parent - if regex_match - header_params["location"] = regex_match["location".to_s] - end - end - - request_params_header = URI.encode_www_form header_params - metadata[:"x-goog-request-params"] ||= request_params_header - - options.apply_defaults timeout: @config.rpcs.create_mute_config.timeout, - metadata: metadata, - retry_policy: @config.rpcs.create_mute_config.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @security_center_stub.call_rpc :create_mute_config, request, options: options do |response, operation| - yield response, operation if block_given? - end - rescue ::GRPC::BadStatus => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Creates a notification config. - # - # @overload create_notification_config(request, options = nil) - # Pass arguments to `create_notification_config` via a request object, either of type - # {::Google::Cloud::SecurityCenter::V2::CreateNotificationConfigRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::SecurityCenter::V2::CreateNotificationConfigRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_notification_config(parent: nil, config_id: nil, notification_config: nil) - # Pass arguments to `create_notification_config` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param parent [::String] - # Required. Resource name of the new notification config's parent. Its format - # is `organizations/[organization_id]/locations/[location_id]`, - # `folders/[folder_id]/locations/[location_id]`, or - # `projects/[project_id]/locations/[location_id]`. - # @param config_id [::String] - # Required. - # Unique identifier provided by the client within the parent scope. - # It must be between 1 and 128 characters and contain alphanumeric - # characters, underscores, or hyphens only. - # @param notification_config [::Google::Cloud::SecurityCenter::V2::NotificationConfig, ::Hash] - # Required. The notification config being created. The name and the service - # account will be ignored as they are both output only fields on this - # resource. - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Google::Cloud::SecurityCenter::V2::NotificationConfig] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Google::Cloud::SecurityCenter::V2::NotificationConfig] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/cloud/security_center/v2" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::SecurityCenter::V2::SecurityCenter::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::SecurityCenter::V2::CreateNotificationConfigRequest.new - # - # # Call the create_notification_config method. - # result = client.create_notification_config request - # - # # The returned object is of type Google::Cloud::SecurityCenter::V2::NotificationConfig. - # p result - # - def create_notification_config request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::SecurityCenter::V2::CreateNotificationConfigRequest - - # Converts hash 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_notification_config.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::SecurityCenter::V2::VERSION - metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - header_params = {} - if request.parent - 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_notification_config.timeout, - metadata: metadata, - retry_policy: @config.rpcs.create_notification_config.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @security_center_stub.call_rpc :create_notification_config, request, options: options do |response, operation| - yield response, operation if block_given? - end - rescue ::GRPC::BadStatus => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Creates a source. - # - # @overload create_source(request, options = nil) - # Pass arguments to `create_source` via a request object, either of type - # {::Google::Cloud::SecurityCenter::V2::CreateSourceRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::SecurityCenter::V2::CreateSourceRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_source(parent: nil, source: nil) - # Pass arguments to `create_source` via keyword arguments. Note that at - # least one keyword argument is 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. Resource name of the new source's parent. Its format should be - # `organizations/[organization_id]`. - # @param source [::Google::Cloud::SecurityCenter::V2::Source, ::Hash] - # Required. The Source being created, only the display_name and description - # will be used. All other fields will be ignored. - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Google::Cloud::SecurityCenter::V2::Source] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Google::Cloud::SecurityCenter::V2::Source] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/cloud/security_center/v2" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::SecurityCenter::V2::SecurityCenter::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::SecurityCenter::V2::CreateSourceRequest.new - # - # # Call the create_source method. - # result = client.create_source request - # - # # The returned object is of type Google::Cloud::SecurityCenter::V2::Source. - # p result - # - def create_source request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::SecurityCenter::V2::CreateSourceRequest - - # Converts hash 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_source.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::SecurityCenter::V2::VERSION - metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - header_params = {} - if request.parent - 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_source.timeout, - metadata: metadata, - retry_policy: @config.rpcs.create_source.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @security_center_stub.call_rpc :create_source, request, options: options do |response, operation| - yield response, operation if block_given? - end - rescue ::GRPC::BadStatus => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Deletes an existing BigQuery export. - # - # @overload delete_big_query_export(request, options = nil) - # Pass arguments to `delete_big_query_export` via a request object, either of type - # {::Google::Cloud::SecurityCenter::V2::DeleteBigQueryExportRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::SecurityCenter::V2::DeleteBigQueryExportRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_big_query_export(name: nil) - # Pass arguments to `delete_big_query_export` via keyword arguments. Note that at - # least one keyword argument is 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 BigQuery export to delete. The following list - # shows some examples of the format: - # - # + - # `organizations/{organization}/locations/{location}/bigQueryExports/{export_id}` - # + `folders/{folder}/locations/{location}/bigQueryExports/{export_id}` - # + `projects/{project}/locations/{location}/bigQueryExports/{export_id}` - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Google::Protobuf::Empty] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Google::Protobuf::Empty] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/cloud/security_center/v2" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::SecurityCenter::V2::SecurityCenter::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::SecurityCenter::V2::DeleteBigQueryExportRequest.new - # - # # Call the delete_big_query_export method. - # result = client.delete_big_query_export request - # - # # The returned object is of type Google::Protobuf::Empty. - # p result - # - def delete_big_query_export request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::SecurityCenter::V2::DeleteBigQueryExportRequest - - # Converts hash 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_big_query_export.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::SecurityCenter::V2::VERSION - metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - header_params = {} - if request.name - header_params["name"] = request.name - end - - request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") - metadata[:"x-goog-request-params"] ||= request_params_header - - options.apply_defaults timeout: @config.rpcs.delete_big_query_export.timeout, - metadata: metadata, - retry_policy: @config.rpcs.delete_big_query_export.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @security_center_stub.call_rpc :delete_big_query_export, request, options: options do |response, operation| - yield response, operation if block_given? - end - rescue ::GRPC::BadStatus => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Deletes an existing mute config. If no location is specified, default is - # global. - # - # @overload delete_mute_config(request, options = nil) - # Pass arguments to `delete_mute_config` via a request object, either of type - # {::Google::Cloud::SecurityCenter::V2::DeleteMuteConfigRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::SecurityCenter::V2::DeleteMuteConfigRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_mute_config(name: nil) - # Pass arguments to `delete_mute_config` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param name [::String] - # Required. Name of the mute config to delete. The following list shows some - # examples of the format: - # - # + `organizations/{organization}/muteConfigs/{config_id}` - # + - # `organizations/{organization}/locations/{location}/muteConfigs/{config_id}` - # + `folders/{folder}/muteConfigs/{config_id}` - # + `folders/{folder}/locations/{location}/muteConfigs/{config_id}` - # + `projects/{project}/muteConfigs/{config_id}` - # + `projects/{project}/locations/{location}/muteConfigs/{config_id}` - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Google::Protobuf::Empty] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Google::Protobuf::Empty] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/cloud/security_center/v2" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::SecurityCenter::V2::SecurityCenter::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::SecurityCenter::V2::DeleteMuteConfigRequest.new - # - # # Call the delete_mute_config method. - # result = client.delete_mute_config request - # - # # The returned object is of type Google::Protobuf::Empty. - # p result - # - def delete_mute_config request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::SecurityCenter::V2::DeleteMuteConfigRequest - - # Converts hash 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_mute_config.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::SecurityCenter::V2::VERSION - metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - header_params = {} - if request.name - regex_match = %r{^projects/[^/]+/locations/(?[^/]+)/muteConfigs/[^/]+/?$}.match request.name - if regex_match - header_params["location"] = regex_match["location".to_s] - end - end - if request.name - regex_match = %r{^organizations/[^/]+/locations/(?[^/]+)/muteConfigs/[^/]+/?$}.match request.name - if regex_match - header_params["location"] = regex_match["location".to_s] - end - end - if request.name - regex_match = %r{^folders/[^/]+/locations/(?[^/]+)/muteConfigs/[^/]+/?$}.match request.name - if regex_match - header_params["location"] = regex_match["location".to_s] - end - end - - request_params_header = URI.encode_www_form header_params - metadata[:"x-goog-request-params"] ||= request_params_header - - options.apply_defaults timeout: @config.rpcs.delete_mute_config.timeout, - metadata: metadata, - retry_policy: @config.rpcs.delete_mute_config.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @security_center_stub.call_rpc :delete_mute_config, request, options: options do |response, operation| - yield response, operation if block_given? - end - rescue ::GRPC::BadStatus => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Deletes a notification config. - # - # @overload delete_notification_config(request, options = nil) - # Pass arguments to `delete_notification_config` via a request object, either of type - # {::Google::Cloud::SecurityCenter::V2::DeleteNotificationConfigRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::SecurityCenter::V2::DeleteNotificationConfigRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_notification_config(name: nil) - # Pass arguments to `delete_notification_config` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param name [::String] - # Required. Name of the notification config to delete. The following list - # shows some examples of the format: - # - # + - # `organizations/[organization_id]/locations/[location_id]/notificationConfigs/[config_id]` - # + - # `folders/[folder_id]/locations/[location_id]notificationConfigs/[config_id]` - # + - # `projects/[project_id]/locations/[location_id]notificationConfigs/[config_id]` - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Google::Protobuf::Empty] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Google::Protobuf::Empty] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/cloud/security_center/v2" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::SecurityCenter::V2::SecurityCenter::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::SecurityCenter::V2::DeleteNotificationConfigRequest.new - # - # # Call the delete_notification_config method. - # result = client.delete_notification_config request - # - # # The returned object is of type Google::Protobuf::Empty. - # p result - # - def delete_notification_config request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::SecurityCenter::V2::DeleteNotificationConfigRequest - - # Converts hash 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_notification_config.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::SecurityCenter::V2::VERSION - metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - header_params = {} - if request.name - header_params["name"] = request.name - end - - request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") - metadata[:"x-goog-request-params"] ||= request_params_header - - options.apply_defaults timeout: @config.rpcs.delete_notification_config.timeout, - metadata: metadata, - retry_policy: @config.rpcs.delete_notification_config.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @security_center_stub.call_rpc :delete_notification_config, request, options: options do |response, operation| - yield response, operation if block_given? - end - rescue ::GRPC::BadStatus => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Deletes a ResourceValueConfig. - # - # @overload delete_resource_value_config(request, options = nil) - # Pass arguments to `delete_resource_value_config` via a request object, either of type - # {::Google::Cloud::SecurityCenter::V2::DeleteResourceValueConfigRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::SecurityCenter::V2::DeleteResourceValueConfigRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_resource_value_config(name: nil) - # Pass arguments to `delete_resource_value_config` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param name [::String] - # Required. Name of the ResourceValueConfig to delete - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Google::Protobuf::Empty] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Google::Protobuf::Empty] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/cloud/security_center/v2" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::SecurityCenter::V2::SecurityCenter::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::SecurityCenter::V2::DeleteResourceValueConfigRequest.new - # - # # Call the delete_resource_value_config method. - # result = client.delete_resource_value_config request - # - # # The returned object is of type Google::Protobuf::Empty. - # p result - # - def delete_resource_value_config request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::SecurityCenter::V2::DeleteResourceValueConfigRequest - - # Converts hash 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_resource_value_config.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::SecurityCenter::V2::VERSION - metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - header_params = {} - if request.name - header_params["name"] = request.name - end - - request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") - metadata[:"x-goog-request-params"] ||= request_params_header - - options.apply_defaults timeout: @config.rpcs.delete_resource_value_config.timeout, - metadata: metadata, - retry_policy: @config.rpcs.delete_resource_value_config.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @security_center_stub.call_rpc :delete_resource_value_config, request, options: options do |response, operation| - yield response, operation if block_given? - end - rescue ::GRPC::BadStatus => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Gets a BigQuery export. - # - # @overload get_big_query_export(request, options = nil) - # Pass arguments to `get_big_query_export` via a request object, either of type - # {::Google::Cloud::SecurityCenter::V2::GetBigQueryExportRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::SecurityCenter::V2::GetBigQueryExportRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_big_query_export(name: nil) - # Pass arguments to `get_big_query_export` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param name [::String] - # Required. Name of the BigQuery export to retrieve. The following list shows - # some examples of the format: - # - # + - # `organizations/{organization}/locations/{location}/bigQueryExports/{export_id}` - # + `folders/{folder}/locations/{location}/bigQueryExports/{export_id}` - # + `projects/{project}locations/{location}//bigQueryExports/{export_id}` - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Google::Cloud::SecurityCenter::V2::BigQueryExport] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Google::Cloud::SecurityCenter::V2::BigQueryExport] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/cloud/security_center/v2" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::SecurityCenter::V2::SecurityCenter::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::SecurityCenter::V2::GetBigQueryExportRequest.new - # - # # Call the get_big_query_export method. - # result = client.get_big_query_export request - # - # # The returned object is of type Google::Cloud::SecurityCenter::V2::BigQueryExport. - # p result - # - def get_big_query_export request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::SecurityCenter::V2::GetBigQueryExportRequest - - # Converts hash 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_big_query_export.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::SecurityCenter::V2::VERSION - metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - header_params = {} - if request.name - header_params["name"] = request.name - end - - request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") - metadata[:"x-goog-request-params"] ||= request_params_header - - options.apply_defaults timeout: @config.rpcs.get_big_query_export.timeout, - metadata: metadata, - retry_policy: @config.rpcs.get_big_query_export.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @security_center_stub.call_rpc :get_big_query_export, 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 - - ## - # Get the simulation by name or the latest simulation for the given - # organization. - # - # @overload get_simulation(request, options = nil) - # Pass arguments to `get_simulation` via a request object, either of type - # {::Google::Cloud::SecurityCenter::V2::GetSimulationRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::SecurityCenter::V2::GetSimulationRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_simulation(name: nil) - # Pass arguments to `get_simulation` via keyword arguments. Note that at - # least one keyword argument is 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 organization name or simulation name of this simulation - # - # Valid format: - # `organizations/{organization}/simulations/latest` - # `organizations/{organization}/simulations/{simulation}` - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Google::Cloud::SecurityCenter::V2::Simulation] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Google::Cloud::SecurityCenter::V2::Simulation] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/cloud/security_center/v2" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::SecurityCenter::V2::SecurityCenter::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::SecurityCenter::V2::GetSimulationRequest.new - # - # # Call the get_simulation method. - # result = client.get_simulation request - # - # # The returned object is of type Google::Cloud::SecurityCenter::V2::Simulation. - # p result - # - def get_simulation request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::SecurityCenter::V2::GetSimulationRequest - - # Converts hash 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_simulation.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::SecurityCenter::V2::VERSION - metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - header_params = {} - if request.name - header_params["name"] = request.name - end - - request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") - metadata[:"x-goog-request-params"] ||= request_params_header - - options.apply_defaults timeout: @config.rpcs.get_simulation.timeout, - metadata: metadata, - retry_policy: @config.rpcs.get_simulation.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @security_center_stub.call_rpc :get_simulation, 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 - - ## - # Get the valued resource by name - # - # @overload get_valued_resource(request, options = nil) - # Pass arguments to `get_valued_resource` via a request object, either of type - # {::Google::Cloud::SecurityCenter::V2::GetValuedResourceRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::SecurityCenter::V2::GetValuedResourceRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_valued_resource(name: nil) - # Pass arguments to `get_valued_resource` via keyword arguments. Note that at - # least one keyword argument is 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 this valued resource - # - # Valid format: - # `organizations/{organization}/simulations/{simulation}/valuedResources/{valued_resource}` - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Google::Cloud::SecurityCenter::V2::ValuedResource] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Google::Cloud::SecurityCenter::V2::ValuedResource] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/cloud/security_center/v2" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::SecurityCenter::V2::SecurityCenter::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::SecurityCenter::V2::GetValuedResourceRequest.new - # - # # Call the get_valued_resource method. - # result = client.get_valued_resource request - # - # # The returned object is of type Google::Cloud::SecurityCenter::V2::ValuedResource. - # p result - # - def get_valued_resource request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::SecurityCenter::V2::GetValuedResourceRequest - - # Converts hash 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_valued_resource.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::SecurityCenter::V2::VERSION - metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - header_params = {} - if request.name - header_params["name"] = request.name - end - - request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") - metadata[:"x-goog-request-params"] ||= request_params_header - - options.apply_defaults timeout: @config.rpcs.get_valued_resource.timeout, - metadata: metadata, - retry_policy: @config.rpcs.get_valued_resource.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @security_center_stub.call_rpc :get_valued_resource, request, options: options do |response, operation| - yield response, operation if block_given? - end - rescue ::GRPC::BadStatus => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Gets the access control policy on the specified Source. - # - # @overload get_iam_policy(request, options = nil) - # Pass arguments to `get_iam_policy` via a request object, either of type - # {::Google::Iam::V1::GetIamPolicyRequest} or an equivalent Hash. - # - # @param request [::Google::Iam::V1::GetIamPolicyRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. - # - # @overload get_iam_policy(resource: nil, options: nil) - # Pass arguments to `get_iam_policy` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param resource [::String] - # REQUIRED: The resource for which the policy is being requested. - # See the operation documentation for the appropriate value for this field. - # @param options [::Google::Iam::V1::GetPolicyOptions, ::Hash] - # OPTIONAL: A `GetPolicyOptions` object for specifying options to - # `GetIamPolicy`. - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Google::Iam::V1::Policy] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Google::Iam::V1::Policy] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/cloud/security_center/v2" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::SecurityCenter::V2::SecurityCenter::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Iam::V1::GetIamPolicyRequest.new - # - # # Call the get_iam_policy method. - # result = client.get_iam_policy request - # - # # The returned object is of type Google::Iam::V1::Policy. - # p result - # - def get_iam_policy request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Iam::V1::GetIamPolicyRequest - - # Converts hash and nil to an options object - options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h - - # Customize the options with defaults - metadata = @config.rpcs.get_iam_policy.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::SecurityCenter::V2::VERSION - metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - header_params = {} - if request.resource - header_params["resource"] = request.resource - end - - request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") - metadata[:"x-goog-request-params"] ||= request_params_header - - options.apply_defaults timeout: @config.rpcs.get_iam_policy.timeout, - metadata: metadata, - retry_policy: @config.rpcs.get_iam_policy.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @security_center_stub.call_rpc :get_iam_policy, request, options: options do |response, operation| - yield response, operation if block_given? - end - rescue ::GRPC::BadStatus => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Gets a mute config. If no location is specified, default is - # global. - # - # @overload get_mute_config(request, options = nil) - # Pass arguments to `get_mute_config` via a request object, either of type - # {::Google::Cloud::SecurityCenter::V2::GetMuteConfigRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::SecurityCenter::V2::GetMuteConfigRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_mute_config(name: nil) - # Pass arguments to `get_mute_config` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param name [::String] - # Required. Name of the mute config to retrieve. The following list shows - # some examples of the format: - # - # + `organizations/{organization}/muteConfigs/{config_id}` - # + - # `organizations/{organization}/locations/{location}/muteConfigs/{config_id}` - # + `folders/{folder}/muteConfigs/{config_id}` - # + `folders/{folder}/locations/{location}/muteConfigs/{config_id}` - # + `projects/{project}/muteConfigs/{config_id}` - # + `projects/{project}/locations/{location}/muteConfigs/{config_id}` - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Google::Cloud::SecurityCenter::V2::MuteConfig] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Google::Cloud::SecurityCenter::V2::MuteConfig] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/cloud/security_center/v2" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::SecurityCenter::V2::SecurityCenter::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::SecurityCenter::V2::GetMuteConfigRequest.new - # - # # Call the get_mute_config method. - # result = client.get_mute_config request - # - # # The returned object is of type Google::Cloud::SecurityCenter::V2::MuteConfig. - # p result - # - def get_mute_config request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::SecurityCenter::V2::GetMuteConfigRequest - - # Converts hash 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_mute_config.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::SecurityCenter::V2::VERSION - metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - header_params = {} - if request.name - regex_match = %r{^projects/[^/]+/locations/(?[^/]+)/muteConfigs/[^/]+/?$}.match request.name - if regex_match - header_params["location"] = regex_match["location".to_s] - end - end - if request.name - regex_match = %r{^organizations/[^/]+/locations/(?[^/]+)/muteConfigs/[^/]+/?$}.match request.name - if regex_match - header_params["location"] = regex_match["location".to_s] - end - end - if request.name - regex_match = %r{^folders/[^/]+/locations/(?[^/]+)/muteConfigs/[^/]+/?$}.match request.name - if regex_match - header_params["location"] = regex_match["location".to_s] - end - end - - request_params_header = URI.encode_www_form header_params - metadata[:"x-goog-request-params"] ||= request_params_header - - options.apply_defaults timeout: @config.rpcs.get_mute_config.timeout, - metadata: metadata, - retry_policy: @config.rpcs.get_mute_config.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @security_center_stub.call_rpc :get_mute_config, request, options: options do |response, operation| - yield response, operation if block_given? - end - rescue ::GRPC::BadStatus => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Gets a notification config. - # - # @overload get_notification_config(request, options = nil) - # Pass arguments to `get_notification_config` via a request object, either of type - # {::Google::Cloud::SecurityCenter::V2::GetNotificationConfigRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::SecurityCenter::V2::GetNotificationConfigRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_notification_config(name: nil) - # Pass arguments to `get_notification_config` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param name [::String] - # Required. Name of the notification config to get. The following list shows - # some examples of the format: - # - # + - # `organizations/[organization_id]/locations/[location_id]/notificationConfigs/[config_id]` - # + - # `folders/[folder_id]/locations/[location_id]/notificationConfigs/[config_id]` - # + - # `projects/[project_id]/locations/[location_id]/notificationConfigs/[config_id]` - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Google::Cloud::SecurityCenter::V2::NotificationConfig] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Google::Cloud::SecurityCenter::V2::NotificationConfig] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/cloud/security_center/v2" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::SecurityCenter::V2::SecurityCenter::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::SecurityCenter::V2::GetNotificationConfigRequest.new - # - # # Call the get_notification_config method. - # result = client.get_notification_config request - # - # # The returned object is of type Google::Cloud::SecurityCenter::V2::NotificationConfig. - # p result - # - def get_notification_config request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::SecurityCenter::V2::GetNotificationConfigRequest - - # Converts hash 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_notification_config.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::SecurityCenter::V2::VERSION - metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - header_params = {} - if request.name - header_params["name"] = request.name - end - - request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") - metadata[:"x-goog-request-params"] ||= request_params_header - - options.apply_defaults timeout: @config.rpcs.get_notification_config.timeout, - metadata: metadata, - retry_policy: @config.rpcs.get_notification_config.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @security_center_stub.call_rpc :get_notification_config, request, options: options do |response, operation| - yield response, operation if block_given? - end - rescue ::GRPC::BadStatus => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Gets a ResourceValueConfig. - # - # @overload get_resource_value_config(request, options = nil) - # Pass arguments to `get_resource_value_config` via a request object, either of type - # {::Google::Cloud::SecurityCenter::V2::GetResourceValueConfigRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::SecurityCenter::V2::GetResourceValueConfigRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_resource_value_config(name: nil) - # Pass arguments to `get_resource_value_config` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param name [::String] - # Required. Name of the resource value config to retrieve. Its format is - # organizations/\\{organization}/resourceValueConfigs/\\{config_id}. - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Google::Cloud::SecurityCenter::V2::ResourceValueConfig] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Google::Cloud::SecurityCenter::V2::ResourceValueConfig] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/cloud/security_center/v2" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::SecurityCenter::V2::SecurityCenter::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::SecurityCenter::V2::GetResourceValueConfigRequest.new - # - # # Call the get_resource_value_config method. - # result = client.get_resource_value_config request - # - # # The returned object is of type Google::Cloud::SecurityCenter::V2::ResourceValueConfig. - # p result - # - def get_resource_value_config request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::SecurityCenter::V2::GetResourceValueConfigRequest - - # Converts hash 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_resource_value_config.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::SecurityCenter::V2::VERSION - metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - header_params = {} - if request.name - header_params["name"] = request.name - end - - request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") - metadata[:"x-goog-request-params"] ||= request_params_header - - options.apply_defaults timeout: @config.rpcs.get_resource_value_config.timeout, - metadata: metadata, - retry_policy: @config.rpcs.get_resource_value_config.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @security_center_stub.call_rpc :get_resource_value_config, request, options: options do |response, operation| - yield response, operation if block_given? - end - rescue ::GRPC::BadStatus => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Gets a source. - # - # @overload get_source(request, options = nil) - # Pass arguments to `get_source` via a request object, either of type - # {::Google::Cloud::SecurityCenter::V2::GetSourceRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::SecurityCenter::V2::GetSourceRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_source(name: nil) - # Pass arguments to `get_source` via keyword arguments. Note that at - # least one keyword argument is 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. Relative resource name of the source. Its format is - # `organizations/[organization_id]/source/[source_id]`. - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Google::Cloud::SecurityCenter::V2::Source] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Google::Cloud::SecurityCenter::V2::Source] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/cloud/security_center/v2" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::SecurityCenter::V2::SecurityCenter::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::SecurityCenter::V2::GetSourceRequest.new - # - # # Call the get_source method. - # result = client.get_source request - # - # # The returned object is of type Google::Cloud::SecurityCenter::V2::Source. - # p result - # - def get_source request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::SecurityCenter::V2::GetSourceRequest - - # Converts hash 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_source.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::SecurityCenter::V2::VERSION - metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - header_params = {} - if request.name - header_params["name"] = request.name - end - - request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") - metadata[:"x-goog-request-params"] ||= request_params_header - - options.apply_defaults timeout: @config.rpcs.get_source.timeout, - metadata: metadata, - retry_policy: @config.rpcs.get_source.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @security_center_stub.call_rpc :get_source, 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 - - ## - # Filters an organization or source's findings and groups them by their - # specified properties in a location. If no location is specified, findings - # are assumed to be in global - # - # To group across all sources provide a `-` as the source id. - # The following list shows some examples: - # - # + `/v2/organizations/{organization_id}/sources/-/findings` - # + - # `/v2/organizations/{organization_id}/sources/-/locations/{location_id}/findings` - # + `/v2/folders/{folder_id}/sources/-/findings` - # + `/v2/folders/{folder_id}/sources/-/locations/{location_id}/findings` - # + `/v2/projects/{project_id}/sources/-/findings` - # + `/v2/projects/{project_id}/sources/-/locations/{location_id}/findings` - # - # @overload group_findings(request, options = nil) - # Pass arguments to `group_findings` via a request object, either of type - # {::Google::Cloud::SecurityCenter::V2::GroupFindingsRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::SecurityCenter::V2::GroupFindingsRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. - # - # @overload group_findings(parent: nil, filter: nil, group_by: nil, page_token: nil, page_size: nil) - # Pass arguments to `group_findings` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param parent [::String] - # Required. Name of the source to groupBy. If no location is specified, - # finding is assumed to be in global. - # The following list shows some examples: - # - # + `organizations/[organization_id]/sources/[source_id]` - # + - # `organizations/[organization_id]/sources/[source_id]/locations/[location_id]` - # + `folders/[folder_id]/sources/[source_id]` - # + `folders/[folder_id]/sources/[source_id]/locations/[location_id]` - # + `projects/[project_id]/sources/[source_id]` - # + `projects/[project_id]/sources/[source_id]/locations/[location_id]` - # - # To groupBy across all sources provide a source_id of `-`. The following - # list shows some examples: - # - # + `organizations/{organization_id}/sources/-` - # + `organizations/{organization_id}/sources/-/locations/[location_id]` - # + `folders/{folder_id}/sources/-` - # + `folders/{folder_id}/sources/-/locations/[location_id]` - # + `projects/{project_id}/sources/-` - # + `projects/{project_id}/sources/-/locations/[location_id]` - # @param filter [::String] - # Expression that defines the filter to apply across findings. - # The expression is a list of one or more restrictions combined via logical - # operators `AND` and `OR`. - # Parentheses are supported, and `OR` has higher precedence than `AND`. - # - # Restrictions have the form ` ` and may have a `-` - # character in front of them to indicate negation. Examples include: - # - # * name - # * security_marks.marks.marka - # - # The supported operators are: - # - # * `=` for all value types. - # * `>`, `<`, `>=`, `<=` for integer values. - # * `:`, meaning substring matching, for strings. - # - # The supported value types are: - # - # * string literals in quotes. - # * integer literals without quotes. - # * boolean literals `true` and `false` without quotes. - # - # The following field and operator combinations are supported: - # - # * name: `=` - # * parent: `=`, `:` - # * resource_name: `=`, `:` - # * state: `=`, `:` - # * category: `=`, `:` - # * external_uri: `=`, `:` - # * event_time: `=`, `>`, `<`, `>=`, `<=` - # - # Usage: This should be milliseconds since epoch or an RFC3339 string. - # Examples: - # `event_time = "2019-06-10T16:07:18-07:00"` - # `event_time = 1560208038000` - # - # * severity: `=`, `:` - # * security_marks.marks: `=`, `:` - # * resource: - # * resource.name: `=`, `:` - # * resource.parent_name: `=`, `:` - # * resource.parent_display_name: `=`, `:` - # * resource.project_name: `=`, `:` - # * resource.project_display_name: `=`, `:` - # * resource.type: `=`, `:` - # @param group_by [::String] - # Required. Expression that defines what assets fields to use for grouping. - # The string value should follow SQL syntax: comma separated list of fields. - # For example: "parent,resource_name". - # @param page_token [::String] - # The value returned by the last `GroupFindingsResponse`; indicates - # that this is a continuation of a prior `GroupFindings` call, and - # that the system should return the next page of data. - # @param page_size [::Integer] - # The maximum number of results to return in a single response. Default is - # 10, minimum is 1, maximum is 1000. - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Gapic::PagedEnumerable<::Google::Cloud::SecurityCenter::V2::GroupResult>] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Gapic::PagedEnumerable<::Google::Cloud::SecurityCenter::V2::GroupResult>] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/cloud/security_center/v2" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::SecurityCenter::V2::SecurityCenter::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::SecurityCenter::V2::GroupFindingsRequest.new - # - # # Call the group_findings method. - # result = client.group_findings request - # - # # The returned object is of type Gapic::PagedEnumerable. You can iterate - # # over elements, and API calls will be issued to fetch pages as needed. - # result.each do |item| - # # Each element is of type ::Google::Cloud::SecurityCenter::V2::GroupResult. - # p item - # end - # - def group_findings request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::SecurityCenter::V2::GroupFindingsRequest - - # Converts hash 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.group_findings.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::SecurityCenter::V2::VERSION - metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - header_params = {} - if request.parent - 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.group_findings.timeout, - metadata: metadata, - retry_policy: @config.rpcs.group_findings.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @security_center_stub.call_rpc :group_findings, request, options: options do |response, operation| - response = ::Gapic::PagedEnumerable.new @security_center_stub, :group_findings, 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 - - ## - # Lists the attack paths for a set of simulation results or valued resources - # and filter. - # - # @overload list_attack_paths(request, options = nil) - # Pass arguments to `list_attack_paths` via a request object, either of type - # {::Google::Cloud::SecurityCenter::V2::ListAttackPathsRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::SecurityCenter::V2::ListAttackPathsRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_attack_paths(parent: nil, filter: nil, page_token: nil, page_size: nil) - # Pass arguments to `list_attack_paths` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param parent [::String] - # Required. Name of parent to list attack paths. - # - # Valid formats: - # `organizations/{organization}`, - # `organizations/{organization}/simulations/{simulation}` - # `organizations/{organization}/simulations/{simulation}/attackExposureResults/{attack_exposure_result_v2}` - # `organizations/{organization}/simulations/{simulation}/valuedResources/{valued_resource}` - # @param filter [::String] - # The filter expression that filters the attack path in the response. - # Supported fields: - # - # * `valued_resources` supports = - # @param page_token [::String] - # The value returned by the last `ListAttackPathsResponse`; indicates - # that this is a continuation of a prior `ListAttackPaths` call, and - # that the system should return the next page of data. - # @param page_size [::Integer] - # The maximum number of results to return in a single response. Default is - # 10, minimum is 1, maximum is 1000. - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Gapic::PagedEnumerable<::Google::Cloud::SecurityCenter::V2::AttackPath>] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Gapic::PagedEnumerable<::Google::Cloud::SecurityCenter::V2::AttackPath>] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/cloud/security_center/v2" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::SecurityCenter::V2::SecurityCenter::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::SecurityCenter::V2::ListAttackPathsRequest.new - # - # # Call the list_attack_paths method. - # result = client.list_attack_paths request - # - # # The returned object is of type Gapic::PagedEnumerable. You can iterate - # # over elements, and API calls will be issued to fetch pages as needed. - # result.each do |item| - # # Each element is of type ::Google::Cloud::SecurityCenter::V2::AttackPath. - # p item - # end - # - def list_attack_paths request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::SecurityCenter::V2::ListAttackPathsRequest - - # Converts hash 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_attack_paths.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::SecurityCenter::V2::VERSION - metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - header_params = {} - if request.parent - 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_attack_paths.timeout, - metadata: metadata, - retry_policy: @config.rpcs.list_attack_paths.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @security_center_stub.call_rpc :list_attack_paths, request, options: options do |response, operation| - response = ::Gapic::PagedEnumerable.new @security_center_stub, :list_attack_paths, 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 - - ## - # Lists BigQuery exports. Note that when requesting BigQuery exports at a - # given level all exports under that level are also returned e.g. if - # requesting BigQuery exports under a folder, then all BigQuery exports - # immediately under the folder plus the ones created under the projects - # within the folder are returned. - # - # @overload list_big_query_exports(request, options = nil) - # Pass arguments to `list_big_query_exports` via a request object, either of type - # {::Google::Cloud::SecurityCenter::V2::ListBigQueryExportsRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::SecurityCenter::V2::ListBigQueryExportsRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_big_query_exports(parent: nil, page_size: nil, page_token: nil) - # Pass arguments to `list_big_query_exports` via keyword arguments. Note that at - # least one keyword argument is 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, which owns the collection of BigQuery exports. Its - # format is `organizations/[organization_id]/locations/[location_id]`, - # `folders/[folder_id]/locations/[location_id]`, or - # `projects/[project_id]/locations/[location_id]`. - # @param page_size [::Integer] - # The maximum number of configs to return. The service may return fewer than - # this value. - # If unspecified, at most 10 configs will be returned. - # The maximum value is 1000; values above 1000 will be coerced to 1000. - # @param page_token [::String] - # A page token, received from a previous `ListBigQueryExports` call. - # Provide this to retrieve the subsequent page. - # When paginating, all other parameters provided to `ListBigQueryExports` - # 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::Cloud::SecurityCenter::V2::BigQueryExport>] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Gapic::PagedEnumerable<::Google::Cloud::SecurityCenter::V2::BigQueryExport>] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/cloud/security_center/v2" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::SecurityCenter::V2::SecurityCenter::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::SecurityCenter::V2::ListBigQueryExportsRequest.new - # - # # Call the list_big_query_exports method. - # result = client.list_big_query_exports request - # - # # The returned object is of type Gapic::PagedEnumerable. You can iterate - # # over elements, and API calls will be issued to fetch pages as needed. - # result.each do |item| - # # Each element is of type ::Google::Cloud::SecurityCenter::V2::BigQueryExport. - # p item - # end - # - def list_big_query_exports request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::SecurityCenter::V2::ListBigQueryExportsRequest - - # Converts hash 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_big_query_exports.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::SecurityCenter::V2::VERSION - metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - header_params = {} - if request.parent - 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_big_query_exports.timeout, - metadata: metadata, - retry_policy: @config.rpcs.list_big_query_exports.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @security_center_stub.call_rpc :list_big_query_exports, request, options: options do |response, operation| - response = ::Gapic::PagedEnumerable.new @security_center_stub, :list_big_query_exports, 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 - - ## - # Lists an organization or source's findings. - # - # To list across all sources for a given location provide a `-` as the source - # id. If no location is specified, finding are assumed to be in global. - # The following list shows some examples: - # - # + `/v2/organizations/{organization_id}/sources/-/findings` - # + - # `/v2/organizations/{organization_id}/sources/-/locations/{location_id}/findings` - # - # @overload list_findings(request, options = nil) - # Pass arguments to `list_findings` via a request object, either of type - # {::Google::Cloud::SecurityCenter::V2::ListFindingsRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::SecurityCenter::V2::ListFindingsRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_findings(parent: nil, filter: nil, order_by: nil, field_mask: nil, page_token: nil, page_size: nil) - # Pass arguments to `list_findings` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param parent [::String] - # Required. Name of the source the findings belong to. If no location is - # specified, the default is global. The following list shows some examples: - # - # + `organizations/[organization_id]/sources/[source_id]` - # + - # `organizations/[organization_id]/sources/[source_id]/locations/[location_id]` - # + `folders/[folder_id]/sources/[source_id]` - # + `folders/[folder_id]/sources/[source_id]/locations/[location_id]` - # + `projects/[project_id]/sources/[source_id]` - # + `projects/[project_id]/sources/[source_id]/locations/[location_id]` - # - # To list across all sources provide a source_id of `-`. The following - # list shows some examples: - # - # + `organizations/{organization_id}/sources/-` - # + `organizations/{organization_id}/sources/-/locations/{location_id}` - # + `folders/{folder_id}/sources/-` - # + `folders/{folder_id}/sources/-locations/{location_id}` - # + `projects/{projects_id}/sources/-` - # + `projects/{projects_id}/sources/-/locations/{location_id}` - # @param filter [::String] - # Expression that defines the filter to apply across findings. - # The expression is a list of one or more restrictions combined via logical - # operators `AND` and `OR`. - # Parentheses are supported, and `OR` has higher precedence than `AND`. - # - # Restrictions have the form ` ` and may have a `-` - # character in front of them to indicate negation. Examples include: - # - # * name - # * security_marks.marks.marka - # - # The supported operators are: - # - # * `=` for all value types. - # * `>`, `<`, `>=`, `<=` for integer values. - # * `:`, meaning substring matching, for strings. - # - # The supported value types are: - # - # * string literals in quotes. - # * integer literals without quotes. - # * boolean literals `true` and `false` without quotes. - # - # The following field and operator combinations are supported: - # - # * name: `=` - # * parent: `=`, `:` - # * resource_name: `=`, `:` - # * state: `=`, `:` - # * category: `=`, `:` - # * external_uri: `=`, `:` - # * event_time: `=`, `>`, `<`, `>=`, `<=` - # - # Usage: This should be milliseconds since epoch or an RFC3339 string. - # Examples: - # `event_time = "2019-06-10T16:07:18-07:00"` - # `event_time = 1560208038000` - # - # * severity: `=`, `:` - # * security_marks.marks: `=`, `:` - # * resource: - # * resource.name: `=`, `:` - # * resource.parent_name: `=`, `:` - # * resource.parent_display_name: `=`, `:` - # * resource.project_name: `=`, `:` - # * resource.project_display_name: `=`, `:` - # * resource.type: `=`, `:` - # * resource.folders.resource_folder: `=`, `:` - # * resource.display_name: `=`, `:` - # @param order_by [::String] - # Expression that defines what fields and order to use for sorting. The - # string value should follow SQL syntax: comma separated list of fields. For - # example: "name,parent". The default sorting order - # is ascending. To specify descending order for a field, a suffix " desc" - # should be appended to the field name. For example: "name - # desc,parent". Redundant space characters in the - # syntax are insignificant. "name desc,parent" and " - # name desc , parent " are equivalent. - # - # The following fields are supported: - # name - # parent - # state - # category - # resource_name - # event_time - # security_marks.marks - # @param field_mask [::Google::Protobuf::FieldMask, ::Hash] - # A field mask to specify the Finding fields to be listed in the response. - # An empty field mask will list all fields. - # @param page_token [::String] - # The value returned by the last `ListFindingsResponse`; indicates - # that this is a continuation of a prior `ListFindings` call, and - # that the system should return the next page of data. - # @param page_size [::Integer] - # The maximum number of results to return in a single response. Default is - # 10, minimum is 1, maximum is 1000. - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Gapic::PagedEnumerable<::Google::Cloud::SecurityCenter::V2::ListFindingsResponse::ListFindingsResult>] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Gapic::PagedEnumerable<::Google::Cloud::SecurityCenter::V2::ListFindingsResponse::ListFindingsResult>] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/cloud/security_center/v2" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::SecurityCenter::V2::SecurityCenter::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::SecurityCenter::V2::ListFindingsRequest.new - # - # # Call the list_findings method. - # result = client.list_findings request - # - # # The returned object is of type Gapic::PagedEnumerable. You can iterate - # # over elements, and API calls will be issued to fetch pages as needed. - # result.each do |item| - # # Each element is of type ::Google::Cloud::SecurityCenter::V2::ListFindingsResponse::ListFindingsResult. - # p item - # end - # - def list_findings request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::SecurityCenter::V2::ListFindingsRequest - - # Converts hash 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_findings.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::SecurityCenter::V2::VERSION - metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - header_params = {} - if request.parent - 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_findings.timeout, - metadata: metadata, - retry_policy: @config.rpcs.list_findings.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @security_center_stub.call_rpc :list_findings, request, options: options do |response, operation| - response = ::Gapic::PagedEnumerable.new @security_center_stub, :list_findings, 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 - - ## - # Lists mute configs. If no location is specified, default is - # global. - # - # @overload list_mute_configs(request, options = nil) - # Pass arguments to `list_mute_configs` via a request object, either of type - # {::Google::Cloud::SecurityCenter::V2::ListMuteConfigsRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::SecurityCenter::V2::ListMuteConfigsRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_mute_configs(parent: nil, page_size: nil, page_token: nil) - # Pass arguments to `list_mute_configs` via keyword arguments. Note that at - # least one keyword argument is 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, which owns the collection of mute configs. Its format - # is `organizations/[organization_id]", "folders/[folder_id]`, - # `projects/[project_id]`, - # `organizations/[organization_id]/locations/[location_id]`, - # `folders/[folder_id]/locations/[location_id]`, - # `projects/[project_id]/locations/[location_id]`. - # @param page_size [::Integer] - # The maximum number of configs to return. The service may return fewer than - # this value. - # If unspecified, at most 10 configs will be returned. - # The maximum value is 1000; values above 1000 will be coerced to 1000. - # @param page_token [::String] - # A page token, received from a previous `ListMuteConfigs` call. - # Provide this to retrieve the subsequent page. - # - # When paginating, all other parameters provided to `ListMuteConfigs` 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::Cloud::SecurityCenter::V2::MuteConfig>] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Gapic::PagedEnumerable<::Google::Cloud::SecurityCenter::V2::MuteConfig>] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/cloud/security_center/v2" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::SecurityCenter::V2::SecurityCenter::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::SecurityCenter::V2::ListMuteConfigsRequest.new - # - # # Call the list_mute_configs method. - # result = client.list_mute_configs request - # - # # The returned object is of type Gapic::PagedEnumerable. You can iterate - # # over elements, and API calls will be issued to fetch pages as needed. - # result.each do |item| - # # Each element is of type ::Google::Cloud::SecurityCenter::V2::MuteConfig. - # p item - # end - # - def list_mute_configs request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::SecurityCenter::V2::ListMuteConfigsRequest - - # Converts hash 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_mute_configs.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::SecurityCenter::V2::VERSION - metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - header_params = {} - if request.parent - regex_match = %r{^projects/[^/]+/locations/(?[^/]+)/muteConfigs/?$}.match request.parent - if regex_match - header_params["location"] = regex_match["location".to_s] - end - end - if request.parent - regex_match = %r{^organizations/[^/]+/locations/(?[^/]+)/muteConfigs/?$}.match request.parent - if regex_match - header_params["location"] = regex_match["location".to_s] - end - end - if request.parent - regex_match = %r{^folders/[^/]+/locations/(?[^/]+)/muteConfigs/?$}.match request.parent - if regex_match - header_params["location"] = regex_match["location".to_s] - end - end - - request_params_header = URI.encode_www_form header_params - metadata[:"x-goog-request-params"] ||= request_params_header - - options.apply_defaults timeout: @config.rpcs.list_mute_configs.timeout, - metadata: metadata, - retry_policy: @config.rpcs.list_mute_configs.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @security_center_stub.call_rpc :list_mute_configs, request, options: options do |response, operation| - response = ::Gapic::PagedEnumerable.new @security_center_stub, :list_mute_configs, 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 - - ## - # Lists notification configs. - # - # @overload list_notification_configs(request, options = nil) - # Pass arguments to `list_notification_configs` via a request object, either of type - # {::Google::Cloud::SecurityCenter::V2::ListNotificationConfigsRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::SecurityCenter::V2::ListNotificationConfigsRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_notification_configs(parent: nil, page_token: nil, page_size: nil) - # Pass arguments to `list_notification_configs` via keyword arguments. Note that at - # least one keyword argument is 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 name of the parent in which to list the notification - # configurations. Its format is - # "organizations/[organization_id]/locations/[location_id]", - # "folders/[folder_id]/locations/[location_id]", or - # "projects/[project_id]/locations/[location_id]". - # @param page_token [::String] - # The value returned by the last `ListNotificationConfigsResponse`; indicates - # that this is a continuation of a prior `ListNotificationConfigs` call, and - # that the system should return the next page of data. - # @param page_size [::Integer] - # The maximum number of results to return in a single response. Default is - # 10, minimum is 1, maximum is 1000. - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Gapic::PagedEnumerable<::Google::Cloud::SecurityCenter::V2::NotificationConfig>] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Gapic::PagedEnumerable<::Google::Cloud::SecurityCenter::V2::NotificationConfig>] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/cloud/security_center/v2" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::SecurityCenter::V2::SecurityCenter::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::SecurityCenter::V2::ListNotificationConfigsRequest.new - # - # # Call the list_notification_configs method. - # result = client.list_notification_configs request - # - # # The returned object is of type Gapic::PagedEnumerable. You can iterate - # # over elements, and API calls will be issued to fetch pages as needed. - # result.each do |item| - # # Each element is of type ::Google::Cloud::SecurityCenter::V2::NotificationConfig. - # p item - # end - # - def list_notification_configs request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::SecurityCenter::V2::ListNotificationConfigsRequest - - # Converts hash 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_notification_configs.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::SecurityCenter::V2::VERSION - metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - header_params = {} - if request.parent - 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_notification_configs.timeout, - metadata: metadata, - retry_policy: @config.rpcs.list_notification_configs.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @security_center_stub.call_rpc :list_notification_configs, request, options: options do |response, operation| - response = ::Gapic::PagedEnumerable.new @security_center_stub, :list_notification_configs, 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 - - ## - # Lists all ResourceValueConfigs. - # - # @overload list_resource_value_configs(request, options = nil) - # Pass arguments to `list_resource_value_configs` via a request object, either of type - # {::Google::Cloud::SecurityCenter::V2::ListResourceValueConfigsRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::SecurityCenter::V2::ListResourceValueConfigsRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_resource_value_configs(parent: nil, page_size: nil, page_token: nil) - # Pass arguments to `list_resource_value_configs` via keyword arguments. Note that at - # least one keyword argument is 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, which owns the collection of resource value configs. - # Its format is - # `organizations/[organization_id]` - # @param page_size [::Integer] - # The maximum number of configs to return. The service may return fewer than - # this value. - # If unspecified, at most 10 configs will be returned. - # The maximum value is 1000; values above 1000 will be coerced to 1000. - # @param page_token [::String] - # A page token, received from a previous `ListResourceValueConfigs` call. - # Provide this to retrieve the subsequent page. - # - # When paginating, all other parameters provided to - # `ListResourceValueConfigs` must match the call that provided the - # page token. - # - # page_size can be specified, and the new page_size will be used. - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Gapic::PagedEnumerable<::Google::Cloud::SecurityCenter::V2::ResourceValueConfig>] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Gapic::PagedEnumerable<::Google::Cloud::SecurityCenter::V2::ResourceValueConfig>] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/cloud/security_center/v2" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::SecurityCenter::V2::SecurityCenter::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::SecurityCenter::V2::ListResourceValueConfigsRequest.new - # - # # Call the list_resource_value_configs method. - # result = client.list_resource_value_configs request - # - # # The returned object is of type Gapic::PagedEnumerable. You can iterate - # # over elements, and API calls will be issued to fetch pages as needed. - # result.each do |item| - # # Each element is of type ::Google::Cloud::SecurityCenter::V2::ResourceValueConfig. - # p item - # end - # - def list_resource_value_configs request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::SecurityCenter::V2::ListResourceValueConfigsRequest - - # Converts hash 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_resource_value_configs.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::SecurityCenter::V2::VERSION - metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - header_params = {} - if request.parent - 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_resource_value_configs.timeout, - metadata: metadata, - retry_policy: @config.rpcs.list_resource_value_configs.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @security_center_stub.call_rpc :list_resource_value_configs, request, options: options do |response, operation| - response = ::Gapic::PagedEnumerable.new @security_center_stub, :list_resource_value_configs, 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 - - ## - # Lists all sources belonging to an organization. - # - # @overload list_sources(request, options = nil) - # Pass arguments to `list_sources` via a request object, either of type - # {::Google::Cloud::SecurityCenter::V2::ListSourcesRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::SecurityCenter::V2::ListSourcesRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_sources(parent: nil, page_token: nil, page_size: nil) - # Pass arguments to `list_sources` via keyword arguments. Note that at - # least one keyword argument is 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. Resource name of the parent of sources to list. Its format should - # be `organizations/[organization_id]`, `folders/[folder_id]`, or - # `projects/[project_id]`. - # @param page_token [::String] - # The value returned by the last `ListSourcesResponse`; indicates - # that this is a continuation of a prior `ListSources` call, and - # that the system should return the next page of data. - # @param page_size [::Integer] - # The maximum number of results to return in a single response. Default is - # 10, minimum is 1, maximum is 1000. - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Gapic::PagedEnumerable<::Google::Cloud::SecurityCenter::V2::Source>] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Gapic::PagedEnumerable<::Google::Cloud::SecurityCenter::V2::Source>] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/cloud/security_center/v2" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::SecurityCenter::V2::SecurityCenter::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::SecurityCenter::V2::ListSourcesRequest.new - # - # # Call the list_sources method. - # result = client.list_sources request - # - # # The returned object is of type Gapic::PagedEnumerable. You can iterate - # # over elements, and API calls will be issued to fetch pages as needed. - # result.each do |item| - # # Each element is of type ::Google::Cloud::SecurityCenter::V2::Source. - # p item - # end - # - def list_sources request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::SecurityCenter::V2::ListSourcesRequest - - # Converts hash 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_sources.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::SecurityCenter::V2::VERSION - metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - header_params = {} - if request.parent - 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_sources.timeout, - metadata: metadata, - retry_policy: @config.rpcs.list_sources.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @security_center_stub.call_rpc :list_sources, request, options: options do |response, operation| - response = ::Gapic::PagedEnumerable.new @security_center_stub, :list_sources, 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 - - ## - # Lists the valued resources for a set of simulation results and filter. - # - # @overload list_valued_resources(request, options = nil) - # Pass arguments to `list_valued_resources` via a request object, either of type - # {::Google::Cloud::SecurityCenter::V2::ListValuedResourcesRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::SecurityCenter::V2::ListValuedResourcesRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_valued_resources(parent: nil, filter: nil, page_token: nil, page_size: nil, order_by: nil) - # Pass arguments to `list_valued_resources` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param parent [::String] - # Required. Name of parent to list exposed resources. - # - # Valid formats: - # `organizations/{organization}`, - # `organizations/{organization}/simulations/{simulation}` - # `organizations/{organization}/simulations/{simulation}/attackExposureResults/{attack_exposure_result_v2}` - # @param filter [::String] - # The filter expression that filters the valued resources in the response. - # Supported fields: - # - # * `resource_value` supports = - # * `resource_type` supports = - # @param page_token [::String] - # The value returned by the last `ListValuedResourcesResponse`; indicates - # that this is a continuation of a prior `ListValuedResources` call, and - # that the system should return the next page of data. - # @param page_size [::Integer] - # The maximum number of results to return in a single response. Default is - # 10, minimum is 1, maximum is 1000. - # @param order_by [::String] - # Optional. The fields by which to order the valued resources response. - # - # Supported fields: - # - # * `exposed_score` - # - # * `resource_value` - # - # * `resource_type` - # - # Values should be a comma separated list of fields. For example: - # `exposed_score,resource_value`. - # - # The default sorting order is descending. To specify ascending or descending - # order for a field, append a " ASC" or a " DESC" suffix, respectively; for - # example: `exposed_score DESC`. - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Gapic::PagedEnumerable<::Google::Cloud::SecurityCenter::V2::ValuedResource>] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Gapic::PagedEnumerable<::Google::Cloud::SecurityCenter::V2::ValuedResource>] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/cloud/security_center/v2" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::SecurityCenter::V2::SecurityCenter::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::SecurityCenter::V2::ListValuedResourcesRequest.new - # - # # Call the list_valued_resources method. - # result = client.list_valued_resources request - # - # # The returned object is of type Gapic::PagedEnumerable. You can iterate - # # over elements, and API calls will be issued to fetch pages as needed. - # result.each do |item| - # # Each element is of type ::Google::Cloud::SecurityCenter::V2::ValuedResource. - # p item - # end - # - def list_valued_resources request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::SecurityCenter::V2::ListValuedResourcesRequest - - # Converts hash 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_valued_resources.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::SecurityCenter::V2::VERSION - metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - header_params = {} - if request.parent - 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_valued_resources.timeout, - metadata: metadata, - retry_policy: @config.rpcs.list_valued_resources.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @security_center_stub.call_rpc :list_valued_resources, request, options: options do |response, operation| - response = ::Gapic::PagedEnumerable.new @security_center_stub, :list_valued_resources, 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 - - ## - # Updates the state of a finding. If no location is specified, finding is - # assumed to be in global - # - # @overload set_finding_state(request, options = nil) - # Pass arguments to `set_finding_state` via a request object, either of type - # {::Google::Cloud::SecurityCenter::V2::SetFindingStateRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::SecurityCenter::V2::SetFindingStateRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. - # - # @overload set_finding_state(name: nil, state: nil) - # Pass arguments to `set_finding_state` via keyword arguments. Note that at - # least one keyword argument is 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 [relative resource - # name](https://cloud.google.com/apis/design/resource_names#relative_resource_name) - # of the finding. If no location is specified, finding is assumed to be in - # global. The following list shows some examples: - # - # + - # `organizations/{organization_id}/sources/{source_id}/findings/{finding_id}` - # + - # `organizations/{organization_id}/sources/{source_id}/locations/{location_id}/findings/{finding_id}` - # + `folders/{folder_id}/sources/{source_id}/findings/{finding_id}` - # + - # `folders/{folder_id}/sources/{source_id}/locations/{location_id}/findings/{finding_id}` - # + `projects/{project_id}/sources/{source_id}/findings/{finding_id}` - # + - # `projects/{project_id}/sources/{source_id}/locations/{location_id}/findings/{finding_id}` - # @param state [::Google::Cloud::SecurityCenter::V2::Finding::State] - # Required. The desired State of the finding. - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Google::Cloud::SecurityCenter::V2::Finding] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Google::Cloud::SecurityCenter::V2::Finding] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/cloud/security_center/v2" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::SecurityCenter::V2::SecurityCenter::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::SecurityCenter::V2::SetFindingStateRequest.new - # - # # Call the set_finding_state method. - # result = client.set_finding_state request - # - # # The returned object is of type Google::Cloud::SecurityCenter::V2::Finding. - # p result - # - def set_finding_state request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::SecurityCenter::V2::SetFindingStateRequest - - # Converts hash and nil to an options object - options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h - - # Customize the options with defaults - metadata = @config.rpcs.set_finding_state.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::SecurityCenter::V2::VERSION - metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - header_params = {} - if request.name - header_params["name"] = request.name - end - - request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") - metadata[:"x-goog-request-params"] ||= request_params_header - - options.apply_defaults timeout: @config.rpcs.set_finding_state.timeout, - metadata: metadata, - retry_policy: @config.rpcs.set_finding_state.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @security_center_stub.call_rpc :set_finding_state, request, options: options do |response, operation| - yield response, operation if block_given? - end - rescue ::GRPC::BadStatus => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Sets the access control policy on the specified Source. - # - # @overload set_iam_policy(request, options = nil) - # Pass arguments to `set_iam_policy` via a request object, either of type - # {::Google::Iam::V1::SetIamPolicyRequest} or an equivalent Hash. - # - # @param request [::Google::Iam::V1::SetIamPolicyRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. - # - # @overload set_iam_policy(resource: nil, policy: nil, update_mask: nil) - # Pass arguments to `set_iam_policy` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param resource [::String] - # REQUIRED: The resource for which the policy is being specified. - # See the operation documentation for the appropriate value for this field. - # @param policy [::Google::Iam::V1::Policy, ::Hash] - # REQUIRED: The complete policy to be applied to the `resource`. The size of - # the policy is limited to a few 10s of KB. An empty policy is a - # valid policy but certain Cloud Platform services (such as Projects) - # might reject them. - # @param update_mask [::Google::Protobuf::FieldMask, ::Hash] - # OPTIONAL: A FieldMask specifying which fields of the policy to modify. Only - # the fields in the mask will be modified. If no mask is provided, the - # following default mask is used: - # - # `paths: "bindings, etag"` - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Google::Iam::V1::Policy] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Google::Iam::V1::Policy] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/cloud/security_center/v2" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::SecurityCenter::V2::SecurityCenter::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Iam::V1::SetIamPolicyRequest.new - # - # # Call the set_iam_policy method. - # result = client.set_iam_policy request - # - # # The returned object is of type Google::Iam::V1::Policy. - # p result - # - def set_iam_policy request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Iam::V1::SetIamPolicyRequest - - # Converts hash and nil to an options object - options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h - - # Customize the options with defaults - metadata = @config.rpcs.set_iam_policy.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::SecurityCenter::V2::VERSION - metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - header_params = {} - if request.resource - header_params["resource"] = request.resource - end - - request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") - metadata[:"x-goog-request-params"] ||= request_params_header - - options.apply_defaults timeout: @config.rpcs.set_iam_policy.timeout, - metadata: metadata, - retry_policy: @config.rpcs.set_iam_policy.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @security_center_stub.call_rpc :set_iam_policy, request, options: options do |response, operation| - yield response, operation if block_given? - end - rescue ::GRPC::BadStatus => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Updates the mute state of a finding. If no location is specified, finding - # is assumed to be in global - # - # @overload set_mute(request, options = nil) - # Pass arguments to `set_mute` via a request object, either of type - # {::Google::Cloud::SecurityCenter::V2::SetMuteRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::SecurityCenter::V2::SetMuteRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. - # - # @overload set_mute(name: nil, mute: nil) - # Pass arguments to `set_mute` via keyword arguments. Note that at - # least one keyword argument is 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 [relative resource - # name](https://cloud.google.com/apis/design/resource_names#relative_resource_name) - # of the finding. If no location is specified, finding is assumed to be in - # global. The following list shows some examples: - # - # + - # `organizations/{organization_id}/sources/{source_id}/findings/{finding_id}` - # + - # `organizations/{organization_id}/sources/{source_id}/locations/{location_id}/findings/{finding_id}` - # + `folders/{folder_id}/sources/{source_id}/findings/{finding_id}` - # + - # `folders/{folder_id}/sources/{source_id}/locations/{location_id}/findings/{finding_id}` - # + `projects/{project_id}/sources/{source_id}/findings/{finding_id}` - # + - # `projects/{project_id}/sources/{source_id}/locations/{location_id}/findings/{finding_id}` - # @param mute [::Google::Cloud::SecurityCenter::V2::Finding::Mute] - # Required. The desired state of the Mute. - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Google::Cloud::SecurityCenter::V2::Finding] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Google::Cloud::SecurityCenter::V2::Finding] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/cloud/security_center/v2" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::SecurityCenter::V2::SecurityCenter::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::SecurityCenter::V2::SetMuteRequest.new - # - # # Call the set_mute method. - # result = client.set_mute request - # - # # The returned object is of type Google::Cloud::SecurityCenter::V2::Finding. - # p result - # - def set_mute request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::SecurityCenter::V2::SetMuteRequest - - # Converts hash and nil to an options object - options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h - - # Customize the options with defaults - metadata = @config.rpcs.set_mute.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::SecurityCenter::V2::VERSION - metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - header_params = {} - if request.name - header_params["name"] = request.name - end - - request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") - metadata[:"x-goog-request-params"] ||= request_params_header - - options.apply_defaults timeout: @config.rpcs.set_mute.timeout, - metadata: metadata, - retry_policy: @config.rpcs.set_mute.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @security_center_stub.call_rpc :set_mute, request, options: options do |response, operation| - yield response, operation if block_given? - end - rescue ::GRPC::BadStatus => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Returns the permissions that a caller has on the specified source. - # - # @overload test_iam_permissions(request, options = nil) - # Pass arguments to `test_iam_permissions` via a request object, either of type - # {::Google::Iam::V1::TestIamPermissionsRequest} or an equivalent Hash. - # - # @param request [::Google::Iam::V1::TestIamPermissionsRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. - # - # @overload test_iam_permissions(resource: nil, permissions: nil) - # Pass arguments to `test_iam_permissions` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param resource [::String] - # REQUIRED: The resource for which the policy detail is being requested. - # See the operation documentation for the appropriate value for this field. - # @param permissions [::Array<::String>] - # The set of permissions to check for the `resource`. Permissions with - # wildcards (such as '*' or 'storage.*') are not allowed. For more - # information see - # [IAM Overview](https://cloud.google.com/iam/docs/overview#permissions). - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Google::Iam::V1::TestIamPermissionsResponse] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Google::Iam::V1::TestIamPermissionsResponse] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/cloud/security_center/v2" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::SecurityCenter::V2::SecurityCenter::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Iam::V1::TestIamPermissionsRequest.new - # - # # Call the test_iam_permissions method. - # result = client.test_iam_permissions request - # - # # The returned object is of type Google::Iam::V1::TestIamPermissionsResponse. - # p result - # - def test_iam_permissions request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Iam::V1::TestIamPermissionsRequest - - # Converts hash and nil to an options object - options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h - - # Customize the options with defaults - metadata = @config.rpcs.test_iam_permissions.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::SecurityCenter::V2::VERSION - metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - header_params = {} - if request.resource - header_params["resource"] = request.resource - end - - request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") - metadata[:"x-goog-request-params"] ||= request_params_header - - options.apply_defaults timeout: @config.rpcs.test_iam_permissions.timeout, - metadata: metadata, - retry_policy: @config.rpcs.test_iam_permissions.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @security_center_stub.call_rpc :test_iam_permissions, request, options: options do |response, operation| - yield response, operation if block_given? - end - rescue ::GRPC::BadStatus => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Updates a BigQuery export. - # - # @overload update_big_query_export(request, options = nil) - # Pass arguments to `update_big_query_export` via a request object, either of type - # {::Google::Cloud::SecurityCenter::V2::UpdateBigQueryExportRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::SecurityCenter::V2::UpdateBigQueryExportRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_big_query_export(big_query_export: nil, update_mask: nil) - # Pass arguments to `update_big_query_export` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param big_query_export [::Google::Cloud::SecurityCenter::V2::BigQueryExport, ::Hash] - # Required. The BigQuery export being updated. - # @param update_mask [::Google::Protobuf::FieldMask, ::Hash] - # The list of fields to be updated. - # If empty all mutable fields will be updated. - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Google::Cloud::SecurityCenter::V2::BigQueryExport] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Google::Cloud::SecurityCenter::V2::BigQueryExport] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/cloud/security_center/v2" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::SecurityCenter::V2::SecurityCenter::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::SecurityCenter::V2::UpdateBigQueryExportRequest.new - # - # # Call the update_big_query_export method. - # result = client.update_big_query_export request - # - # # The returned object is of type Google::Cloud::SecurityCenter::V2::BigQueryExport. - # p result - # - def update_big_query_export request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::SecurityCenter::V2::UpdateBigQueryExportRequest - - # Converts hash 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_big_query_export.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::SecurityCenter::V2::VERSION - metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - header_params = {} - if request.big_query_export&.name - header_params["big_query_export.name"] = request.big_query_export.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_big_query_export.timeout, - metadata: metadata, - retry_policy: @config.rpcs.update_big_query_export.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @security_center_stub.call_rpc :update_big_query_export, 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 external system. This is for a given finding. If no location is - # specified, finding is assumed to be in global - # - # @overload update_external_system(request, options = nil) - # Pass arguments to `update_external_system` via a request object, either of type - # {::Google::Cloud::SecurityCenter::V2::UpdateExternalSystemRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::SecurityCenter::V2::UpdateExternalSystemRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_external_system(external_system: nil, update_mask: nil) - # Pass arguments to `update_external_system` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param external_system [::Google::Cloud::SecurityCenter::V2::ExternalSystem, ::Hash] - # Required. The external system resource to update. - # @param update_mask [::Google::Protobuf::FieldMask, ::Hash] - # The FieldMask to use when updating the external system resource. - # - # If empty all mutable fields will be updated. - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Google::Cloud::SecurityCenter::V2::ExternalSystem] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Google::Cloud::SecurityCenter::V2::ExternalSystem] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/cloud/security_center/v2" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::SecurityCenter::V2::SecurityCenter::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::SecurityCenter::V2::UpdateExternalSystemRequest.new - # - # # Call the update_external_system method. - # result = client.update_external_system request - # - # # The returned object is of type Google::Cloud::SecurityCenter::V2::ExternalSystem. - # p result - # - def update_external_system request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::SecurityCenter::V2::UpdateExternalSystemRequest - - # Converts hash 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_external_system.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::SecurityCenter::V2::VERSION - metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - header_params = {} - if request.external_system&.name - header_params["external_system.name"] = request.external_system.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_external_system.timeout, - metadata: metadata, - retry_policy: @config.rpcs.update_external_system.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @security_center_stub.call_rpc :update_external_system, request, options: options do |response, operation| - yield response, operation if block_given? - end - rescue ::GRPC::BadStatus => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Creates or updates a finding. If no location is specified, finding is - # assumed to be in global. The corresponding source must exist for a finding - # creation to succeed. - # - # @overload update_finding(request, options = nil) - # Pass arguments to `update_finding` via a request object, either of type - # {::Google::Cloud::SecurityCenter::V2::UpdateFindingRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::SecurityCenter::V2::UpdateFindingRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_finding(finding: nil, update_mask: nil) - # Pass arguments to `update_finding` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param finding [::Google::Cloud::SecurityCenter::V2::Finding, ::Hash] - # Required. The finding resource to update or create if it does not already - # exist. parent, security_marks, and update_time will be ignored. - # - # In the case of creation, the finding id portion of the name must be - # alphanumeric and less than or equal to 32 characters and greater than 0 - # characters in length. - # @param update_mask [::Google::Protobuf::FieldMask, ::Hash] - # The FieldMask to use when updating the finding resource. This field should - # not be specified when creating a finding. - # - # When updating a finding, an empty mask is treated as updating all mutable - # fields and replacing source_properties. Individual source_properties can - # be added/updated by using "source_properties." in the field - # mask. - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Google::Cloud::SecurityCenter::V2::Finding] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Google::Cloud::SecurityCenter::V2::Finding] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/cloud/security_center/v2" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::SecurityCenter::V2::SecurityCenter::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::SecurityCenter::V2::UpdateFindingRequest.new - # - # # Call the update_finding method. - # result = client.update_finding request - # - # # The returned object is of type Google::Cloud::SecurityCenter::V2::Finding. - # p result - # - def update_finding request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::SecurityCenter::V2::UpdateFindingRequest - - # Converts hash 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_finding.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::SecurityCenter::V2::VERSION - metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - header_params = {} - if request.finding&.name - header_params["finding.name"] = request.finding.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_finding.timeout, - metadata: metadata, - retry_policy: @config.rpcs.update_finding.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @security_center_stub.call_rpc :update_finding, 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 mute config. If no location is specified, default is - # global. - # - # @overload update_mute_config(request, options = nil) - # Pass arguments to `update_mute_config` via a request object, either of type - # {::Google::Cloud::SecurityCenter::V2::UpdateMuteConfigRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::SecurityCenter::V2::UpdateMuteConfigRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_mute_config(mute_config: nil, update_mask: nil) - # Pass arguments to `update_mute_config` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param mute_config [::Google::Cloud::SecurityCenter::V2::MuteConfig, ::Hash] - # Required. The mute config being updated. - # @param update_mask [::Google::Protobuf::FieldMask, ::Hash] - # The list of fields to be updated. - # If empty all mutable fields will be updated. - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Google::Cloud::SecurityCenter::V2::MuteConfig] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Google::Cloud::SecurityCenter::V2::MuteConfig] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/cloud/security_center/v2" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::SecurityCenter::V2::SecurityCenter::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::SecurityCenter::V2::UpdateMuteConfigRequest.new - # - # # Call the update_mute_config method. - # result = client.update_mute_config request - # - # # The returned object is of type Google::Cloud::SecurityCenter::V2::MuteConfig. - # p result - # - def update_mute_config request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::SecurityCenter::V2::UpdateMuteConfigRequest - - # Converts hash 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_mute_config.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::SecurityCenter::V2::VERSION - metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - header_params = {} - if request.mute_config&.name - regex_match = %r{^projects/[^/]+/locations/(?[^/]+)/muteConfigs/[^/]+/?$}.match request.mute_config.name - if regex_match - header_params["location"] = regex_match["location".to_s] - end - end - if request.mute_config&.name - regex_match = %r{^organizations/[^/]+/locations/(?[^/]+)/muteConfigs/[^/]+/?$}.match request.mute_config.name - if regex_match - header_params["location"] = regex_match["location".to_s] - end - end - if request.mute_config&.name - regex_match = %r{^folders/[^/]+/locations/(?[^/]+)/muteConfigs/[^/]+/?$}.match request.mute_config.name - if regex_match - header_params["location"] = regex_match["location".to_s] - end - end - - request_params_header = URI.encode_www_form header_params - metadata[:"x-goog-request-params"] ||= request_params_header - - options.apply_defaults timeout: @config.rpcs.update_mute_config.timeout, - metadata: metadata, - retry_policy: @config.rpcs.update_mute_config.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @security_center_stub.call_rpc :update_mute_config, request, options: options do |response, operation| - yield response, operation if block_given? - end - rescue ::GRPC::BadStatus => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Updates a notification config. The following update - # fields are allowed: description, pubsub_topic, streaming_config.filter - # - # @overload update_notification_config(request, options = nil) - # Pass arguments to `update_notification_config` via a request object, either of type - # {::Google::Cloud::SecurityCenter::V2::UpdateNotificationConfigRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::SecurityCenter::V2::UpdateNotificationConfigRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_notification_config(notification_config: nil, update_mask: nil) - # Pass arguments to `update_notification_config` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param notification_config [::Google::Cloud::SecurityCenter::V2::NotificationConfig, ::Hash] - # Required. The notification config to update. - # @param update_mask [::Google::Protobuf::FieldMask, ::Hash] - # The FieldMask to use when updating the notification config. - # - # If empty all mutable fields will be updated. - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Google::Cloud::SecurityCenter::V2::NotificationConfig] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Google::Cloud::SecurityCenter::V2::NotificationConfig] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/cloud/security_center/v2" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::SecurityCenter::V2::SecurityCenter::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::SecurityCenter::V2::UpdateNotificationConfigRequest.new - # - # # Call the update_notification_config method. - # result = client.update_notification_config request - # - # # The returned object is of type Google::Cloud::SecurityCenter::V2::NotificationConfig. - # p result - # - def update_notification_config request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::SecurityCenter::V2::UpdateNotificationConfigRequest - - # Converts hash 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_notification_config.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::SecurityCenter::V2::VERSION - metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - header_params = {} - if request.notification_config&.name - header_params["notification_config.name"] = request.notification_config.name - end - - request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") - metadata[:"x-goog-request-params"] ||= request_params_header - - options.apply_defaults timeout: @config.rpcs.update_notification_config.timeout, - metadata: metadata, - retry_policy: @config.rpcs.update_notification_config.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @security_center_stub.call_rpc :update_notification_config, request, options: options do |response, operation| - yield response, operation if block_given? - end - rescue ::GRPC::BadStatus => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Updates an existing ResourceValueConfigs with new rules. - # - # @overload update_resource_value_config(request, options = nil) - # Pass arguments to `update_resource_value_config` via a request object, either of type - # {::Google::Cloud::SecurityCenter::V2::UpdateResourceValueConfigRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::SecurityCenter::V2::UpdateResourceValueConfigRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_resource_value_config(resource_value_config: nil, update_mask: nil) - # Pass arguments to `update_resource_value_config` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param resource_value_config [::Google::Cloud::SecurityCenter::V2::ResourceValueConfig, ::Hash] - # Required. The resource value config being updated. - # @param update_mask [::Google::Protobuf::FieldMask, ::Hash] - # The list of fields to be updated. - # If empty all mutable fields will be updated. - # - # To update nested fields, include the top level field in the mask - # For example, to update gcp_metadata.resource_type, include the - # "gcp_metadata" field mask - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Google::Cloud::SecurityCenter::V2::ResourceValueConfig] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Google::Cloud::SecurityCenter::V2::ResourceValueConfig] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/cloud/security_center/v2" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::SecurityCenter::V2::SecurityCenter::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::SecurityCenter::V2::UpdateResourceValueConfigRequest.new - # - # # Call the update_resource_value_config method. - # result = client.update_resource_value_config request - # - # # The returned object is of type Google::Cloud::SecurityCenter::V2::ResourceValueConfig. - # p result - # - def update_resource_value_config request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::SecurityCenter::V2::UpdateResourceValueConfigRequest - - # Converts hash 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_resource_value_config.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::SecurityCenter::V2::VERSION - metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - header_params = {} - if request.resource_value_config&.name - header_params["resource_value_config.name"] = request.resource_value_config.name - end - - request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") - metadata[:"x-goog-request-params"] ||= request_params_header - - options.apply_defaults timeout: @config.rpcs.update_resource_value_config.timeout, - metadata: metadata, - retry_policy: @config.rpcs.update_resource_value_config.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @security_center_stub.call_rpc :update_resource_value_config, request, options: options do |response, operation| - yield response, operation if block_given? - end - rescue ::GRPC::BadStatus => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Updates security marks. For Finding Security marks, if no location is - # specified, finding is assumed to be in global. Assets Security Marks can - # only be accessed through global endpoint. - # - # @overload update_security_marks(request, options = nil) - # Pass arguments to `update_security_marks` via a request object, either of type - # {::Google::Cloud::SecurityCenter::V2::UpdateSecurityMarksRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::SecurityCenter::V2::UpdateSecurityMarksRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_security_marks(security_marks: nil, update_mask: nil) - # Pass arguments to `update_security_marks` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param security_marks [::Google::Cloud::SecurityCenter::V2::SecurityMarks, ::Hash] - # Required. The security marks resource to update. - # @param update_mask [::Google::Protobuf::FieldMask, ::Hash] - # The FieldMask to use when updating the security marks resource. - # - # The field mask must not contain duplicate fields. - # If empty or set to "marks", all marks will be replaced. Individual - # marks can be updated using "marks.". - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Google::Cloud::SecurityCenter::V2::SecurityMarks] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Google::Cloud::SecurityCenter::V2::SecurityMarks] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/cloud/security_center/v2" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::SecurityCenter::V2::SecurityCenter::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::SecurityCenter::V2::UpdateSecurityMarksRequest.new - # - # # Call the update_security_marks method. - # result = client.update_security_marks request - # - # # The returned object is of type Google::Cloud::SecurityCenter::V2::SecurityMarks. - # p result - # - def update_security_marks request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::SecurityCenter::V2::UpdateSecurityMarksRequest - - # Converts hash 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_security_marks.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::SecurityCenter::V2::VERSION - metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - header_params = {} - if request.security_marks&.name - header_params["security_marks.name"] = request.security_marks.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_security_marks.timeout, - metadata: metadata, - retry_policy: @config.rpcs.update_security_marks.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @security_center_stub.call_rpc :update_security_marks, 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 source. - # - # @overload update_source(request, options = nil) - # Pass arguments to `update_source` via a request object, either of type - # {::Google::Cloud::SecurityCenter::V2::UpdateSourceRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::SecurityCenter::V2::UpdateSourceRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_source(source: nil, update_mask: nil) - # Pass arguments to `update_source` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param source [::Google::Cloud::SecurityCenter::V2::Source, ::Hash] - # Required. The source resource to update. - # @param update_mask [::Google::Protobuf::FieldMask, ::Hash] - # The FieldMask to use when updating the source resource. - # - # If empty all mutable fields will be updated. - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Google::Cloud::SecurityCenter::V2::Source] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Google::Cloud::SecurityCenter::V2::Source] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/cloud/security_center/v2" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::SecurityCenter::V2::SecurityCenter::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::SecurityCenter::V2::UpdateSourceRequest.new - # - # # Call the update_source method. - # result = client.update_source request - # - # # The returned object is of type Google::Cloud::SecurityCenter::V2::Source. - # p result - # - def update_source request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::SecurityCenter::V2::UpdateSourceRequest - - # Converts hash 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_source.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::SecurityCenter::V2::VERSION - metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - header_params = {} - if request.source&.name - header_params["source.name"] = request.source.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_source.timeout, - metadata: metadata, - retry_policy: @config.rpcs.update_source.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @security_center_stub.call_rpc :update_source, request, options: options do |response, operation| - yield response, operation if block_given? - end - rescue ::GRPC::BadStatus => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Configuration class for the SecurityCenter API. - # - # This class represents the configuration for SecurityCenter, - # providing control over timeouts, retry behavior, logging, transport - # parameters, and other low-level controls. Certain parameters can also be - # applied individually to specific RPCs. See - # {::Google::Cloud::SecurityCenter::V2::SecurityCenter::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 - # # batch_create_resource_value_configs to 20 seconds, - # # and all remaining timeouts to 10 seconds. - # ::Google::Cloud::SecurityCenter::V2::SecurityCenter::Client.configure do |config| - # config.timeout = 10.0 - # config.rpcs.batch_create_resource_value_configs.timeout = 20.0 - # end - # - # # Apply the above configuration only to a new client. - # client = ::Google::Cloud::SecurityCenter::V2::SecurityCenter::Client.new do |config| - # config.timeout = 10.0 - # config.rpcs.batch_create_resource_value_configs.timeout = 20.0 - # end - # - # @!attribute [rw] endpoint - # A custom service endpoint, as a hostname or hostname:port. The default is - # nil, indicating to use the default endpoint in the current universe domain. - # @return [::String,nil] - # @!attribute [rw] credentials - # Credentials to send with calls. You may provide any of the following types: - # * (`Google::Auth::Credentials`) A googleauth credentials object - # (see the [googleauth docs](https://rubydoc.info/gems/googleauth/Google/Auth/Credentials)) - # * (`Signet::OAuth2::Client`) A signet oauth2 client object - # (see the [signet docs](https://rubydoc.info/gems/signet/Signet/OAuth2/Client)) - # * (`GRPC::Core::Channel`) a gRPC channel with included credentials - # * (`GRPC::Core::ChannelCredentials`) a gRPC credentails object - # * (`nil`) indicating no credentials - # - # @note Warning: Passing a `String` to a keyfile path or a `Hash` of credentials - # is deprecated. Providing an unvalidated credential configuration to - # Google APIs can compromise the security of your systems and data. - # - # @example - # - # # The recommended way to provide credentials is to use the `make_creds` method - # # on the appropriate credentials class for your environment. - # - # require "googleauth" - # - # credentials = ::Google::Auth::ServiceAccountCredentials.make_creds( - # json_key_io: ::File.open("/path/to/keyfile.json") - # ) - # - # client = ::Google::Cloud::SecurityCenter::V2::SecurityCenter::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 = "securitycenter.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 SecurityCenter 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 `batch_create_resource_value_configs` - # @return [::Gapic::Config::Method] - # - attr_reader :batch_create_resource_value_configs - ## - # RPC-specific configuration for `bulk_mute_findings` - # @return [::Gapic::Config::Method] - # - attr_reader :bulk_mute_findings - ## - # RPC-specific configuration for `create_big_query_export` - # @return [::Gapic::Config::Method] - # - attr_reader :create_big_query_export - ## - # RPC-specific configuration for `create_finding` - # @return [::Gapic::Config::Method] - # - attr_reader :create_finding - ## - # RPC-specific configuration for `create_mute_config` - # @return [::Gapic::Config::Method] - # - attr_reader :create_mute_config - ## - # RPC-specific configuration for `create_notification_config` - # @return [::Gapic::Config::Method] - # - attr_reader :create_notification_config - ## - # RPC-specific configuration for `create_source` - # @return [::Gapic::Config::Method] - # - attr_reader :create_source - ## - # RPC-specific configuration for `delete_big_query_export` - # @return [::Gapic::Config::Method] - # - attr_reader :delete_big_query_export - ## - # RPC-specific configuration for `delete_mute_config` - # @return [::Gapic::Config::Method] - # - attr_reader :delete_mute_config - ## - # RPC-specific configuration for `delete_notification_config` - # @return [::Gapic::Config::Method] - # - attr_reader :delete_notification_config - ## - # RPC-specific configuration for `delete_resource_value_config` - # @return [::Gapic::Config::Method] - # - attr_reader :delete_resource_value_config - ## - # RPC-specific configuration for `get_big_query_export` - # @return [::Gapic::Config::Method] - # - attr_reader :get_big_query_export - ## - # RPC-specific configuration for `get_simulation` - # @return [::Gapic::Config::Method] - # - attr_reader :get_simulation - ## - # RPC-specific configuration for `get_valued_resource` - # @return [::Gapic::Config::Method] - # - attr_reader :get_valued_resource - ## - # RPC-specific configuration for `get_iam_policy` - # @return [::Gapic::Config::Method] - # - attr_reader :get_iam_policy - ## - # RPC-specific configuration for `get_mute_config` - # @return [::Gapic::Config::Method] - # - attr_reader :get_mute_config - ## - # RPC-specific configuration for `get_notification_config` - # @return [::Gapic::Config::Method] - # - attr_reader :get_notification_config - ## - # RPC-specific configuration for `get_resource_value_config` - # @return [::Gapic::Config::Method] - # - attr_reader :get_resource_value_config - ## - # RPC-specific configuration for `get_source` - # @return [::Gapic::Config::Method] - # - attr_reader :get_source - ## - # RPC-specific configuration for `group_findings` - # @return [::Gapic::Config::Method] - # - attr_reader :group_findings - ## - # RPC-specific configuration for `list_attack_paths` - # @return [::Gapic::Config::Method] - # - attr_reader :list_attack_paths - ## - # RPC-specific configuration for `list_big_query_exports` - # @return [::Gapic::Config::Method] - # - attr_reader :list_big_query_exports - ## - # RPC-specific configuration for `list_findings` - # @return [::Gapic::Config::Method] - # - attr_reader :list_findings - ## - # RPC-specific configuration for `list_mute_configs` - # @return [::Gapic::Config::Method] - # - attr_reader :list_mute_configs - ## - # RPC-specific configuration for `list_notification_configs` - # @return [::Gapic::Config::Method] - # - attr_reader :list_notification_configs - ## - # RPC-specific configuration for `list_resource_value_configs` - # @return [::Gapic::Config::Method] - # - attr_reader :list_resource_value_configs - ## - # RPC-specific configuration for `list_sources` - # @return [::Gapic::Config::Method] - # - attr_reader :list_sources - ## - # RPC-specific configuration for `list_valued_resources` - # @return [::Gapic::Config::Method] - # - attr_reader :list_valued_resources - ## - # RPC-specific configuration for `set_finding_state` - # @return [::Gapic::Config::Method] - # - attr_reader :set_finding_state - ## - # RPC-specific configuration for `set_iam_policy` - # @return [::Gapic::Config::Method] - # - attr_reader :set_iam_policy - ## - # RPC-specific configuration for `set_mute` - # @return [::Gapic::Config::Method] - # - attr_reader :set_mute - ## - # RPC-specific configuration for `test_iam_permissions` - # @return [::Gapic::Config::Method] - # - attr_reader :test_iam_permissions - ## - # RPC-specific configuration for `update_big_query_export` - # @return [::Gapic::Config::Method] - # - attr_reader :update_big_query_export - ## - # RPC-specific configuration for `update_external_system` - # @return [::Gapic::Config::Method] - # - attr_reader :update_external_system - ## - # RPC-specific configuration for `update_finding` - # @return [::Gapic::Config::Method] - # - attr_reader :update_finding - ## - # RPC-specific configuration for `update_mute_config` - # @return [::Gapic::Config::Method] - # - attr_reader :update_mute_config - ## - # RPC-specific configuration for `update_notification_config` - # @return [::Gapic::Config::Method] - # - attr_reader :update_notification_config - ## - # RPC-specific configuration for `update_resource_value_config` - # @return [::Gapic::Config::Method] - # - attr_reader :update_resource_value_config - ## - # RPC-specific configuration for `update_security_marks` - # @return [::Gapic::Config::Method] - # - attr_reader :update_security_marks - ## - # RPC-specific configuration for `update_source` - # @return [::Gapic::Config::Method] - # - attr_reader :update_source - - # @private - def initialize parent_rpcs = nil - batch_create_resource_value_configs_config = parent_rpcs.batch_create_resource_value_configs if parent_rpcs.respond_to? :batch_create_resource_value_configs - @batch_create_resource_value_configs = ::Gapic::Config::Method.new batch_create_resource_value_configs_config - bulk_mute_findings_config = parent_rpcs.bulk_mute_findings if parent_rpcs.respond_to? :bulk_mute_findings - @bulk_mute_findings = ::Gapic::Config::Method.new bulk_mute_findings_config - create_big_query_export_config = parent_rpcs.create_big_query_export if parent_rpcs.respond_to? :create_big_query_export - @create_big_query_export = ::Gapic::Config::Method.new create_big_query_export_config - create_finding_config = parent_rpcs.create_finding if parent_rpcs.respond_to? :create_finding - @create_finding = ::Gapic::Config::Method.new create_finding_config - create_mute_config_config = parent_rpcs.create_mute_config if parent_rpcs.respond_to? :create_mute_config - @create_mute_config = ::Gapic::Config::Method.new create_mute_config_config - create_notification_config_config = parent_rpcs.create_notification_config if parent_rpcs.respond_to? :create_notification_config - @create_notification_config = ::Gapic::Config::Method.new create_notification_config_config - create_source_config = parent_rpcs.create_source if parent_rpcs.respond_to? :create_source - @create_source = ::Gapic::Config::Method.new create_source_config - delete_big_query_export_config = parent_rpcs.delete_big_query_export if parent_rpcs.respond_to? :delete_big_query_export - @delete_big_query_export = ::Gapic::Config::Method.new delete_big_query_export_config - delete_mute_config_config = parent_rpcs.delete_mute_config if parent_rpcs.respond_to? :delete_mute_config - @delete_mute_config = ::Gapic::Config::Method.new delete_mute_config_config - delete_notification_config_config = parent_rpcs.delete_notification_config if parent_rpcs.respond_to? :delete_notification_config - @delete_notification_config = ::Gapic::Config::Method.new delete_notification_config_config - delete_resource_value_config_config = parent_rpcs.delete_resource_value_config if parent_rpcs.respond_to? :delete_resource_value_config - @delete_resource_value_config = ::Gapic::Config::Method.new delete_resource_value_config_config - get_big_query_export_config = parent_rpcs.get_big_query_export if parent_rpcs.respond_to? :get_big_query_export - @get_big_query_export = ::Gapic::Config::Method.new get_big_query_export_config - get_simulation_config = parent_rpcs.get_simulation if parent_rpcs.respond_to? :get_simulation - @get_simulation = ::Gapic::Config::Method.new get_simulation_config - get_valued_resource_config = parent_rpcs.get_valued_resource if parent_rpcs.respond_to? :get_valued_resource - @get_valued_resource = ::Gapic::Config::Method.new get_valued_resource_config - get_iam_policy_config = parent_rpcs.get_iam_policy if parent_rpcs.respond_to? :get_iam_policy - @get_iam_policy = ::Gapic::Config::Method.new get_iam_policy_config - get_mute_config_config = parent_rpcs.get_mute_config if parent_rpcs.respond_to? :get_mute_config - @get_mute_config = ::Gapic::Config::Method.new get_mute_config_config - get_notification_config_config = parent_rpcs.get_notification_config if parent_rpcs.respond_to? :get_notification_config - @get_notification_config = ::Gapic::Config::Method.new get_notification_config_config - get_resource_value_config_config = parent_rpcs.get_resource_value_config if parent_rpcs.respond_to? :get_resource_value_config - @get_resource_value_config = ::Gapic::Config::Method.new get_resource_value_config_config - get_source_config = parent_rpcs.get_source if parent_rpcs.respond_to? :get_source - @get_source = ::Gapic::Config::Method.new get_source_config - group_findings_config = parent_rpcs.group_findings if parent_rpcs.respond_to? :group_findings - @group_findings = ::Gapic::Config::Method.new group_findings_config - list_attack_paths_config = parent_rpcs.list_attack_paths if parent_rpcs.respond_to? :list_attack_paths - @list_attack_paths = ::Gapic::Config::Method.new list_attack_paths_config - list_big_query_exports_config = parent_rpcs.list_big_query_exports if parent_rpcs.respond_to? :list_big_query_exports - @list_big_query_exports = ::Gapic::Config::Method.new list_big_query_exports_config - list_findings_config = parent_rpcs.list_findings if parent_rpcs.respond_to? :list_findings - @list_findings = ::Gapic::Config::Method.new list_findings_config - list_mute_configs_config = parent_rpcs.list_mute_configs if parent_rpcs.respond_to? :list_mute_configs - @list_mute_configs = ::Gapic::Config::Method.new list_mute_configs_config - list_notification_configs_config = parent_rpcs.list_notification_configs if parent_rpcs.respond_to? :list_notification_configs - @list_notification_configs = ::Gapic::Config::Method.new list_notification_configs_config - list_resource_value_configs_config = parent_rpcs.list_resource_value_configs if parent_rpcs.respond_to? :list_resource_value_configs - @list_resource_value_configs = ::Gapic::Config::Method.new list_resource_value_configs_config - list_sources_config = parent_rpcs.list_sources if parent_rpcs.respond_to? :list_sources - @list_sources = ::Gapic::Config::Method.new list_sources_config - list_valued_resources_config = parent_rpcs.list_valued_resources if parent_rpcs.respond_to? :list_valued_resources - @list_valued_resources = ::Gapic::Config::Method.new list_valued_resources_config - set_finding_state_config = parent_rpcs.set_finding_state if parent_rpcs.respond_to? :set_finding_state - @set_finding_state = ::Gapic::Config::Method.new set_finding_state_config - set_iam_policy_config = parent_rpcs.set_iam_policy if parent_rpcs.respond_to? :set_iam_policy - @set_iam_policy = ::Gapic::Config::Method.new set_iam_policy_config - set_mute_config = parent_rpcs.set_mute if parent_rpcs.respond_to? :set_mute - @set_mute = ::Gapic::Config::Method.new set_mute_config - test_iam_permissions_config = parent_rpcs.test_iam_permissions if parent_rpcs.respond_to? :test_iam_permissions - @test_iam_permissions = ::Gapic::Config::Method.new test_iam_permissions_config - update_big_query_export_config = parent_rpcs.update_big_query_export if parent_rpcs.respond_to? :update_big_query_export - @update_big_query_export = ::Gapic::Config::Method.new update_big_query_export_config - update_external_system_config = parent_rpcs.update_external_system if parent_rpcs.respond_to? :update_external_system - @update_external_system = ::Gapic::Config::Method.new update_external_system_config - update_finding_config = parent_rpcs.update_finding if parent_rpcs.respond_to? :update_finding - @update_finding = ::Gapic::Config::Method.new update_finding_config - update_mute_config_config = parent_rpcs.update_mute_config if parent_rpcs.respond_to? :update_mute_config - @update_mute_config = ::Gapic::Config::Method.new update_mute_config_config - update_notification_config_config = parent_rpcs.update_notification_config if parent_rpcs.respond_to? :update_notification_config - @update_notification_config = ::Gapic::Config::Method.new update_notification_config_config - update_resource_value_config_config = parent_rpcs.update_resource_value_config if parent_rpcs.respond_to? :update_resource_value_config - @update_resource_value_config = ::Gapic::Config::Method.new update_resource_value_config_config - update_security_marks_config = parent_rpcs.update_security_marks if parent_rpcs.respond_to? :update_security_marks - @update_security_marks = ::Gapic::Config::Method.new update_security_marks_config - update_source_config = parent_rpcs.update_source if parent_rpcs.respond_to? :update_source - @update_source = ::Gapic::Config::Method.new update_source_config - - yield self if block_given? - end - end - end - end - end - end - end - end -end diff --git a/owl-bot-staging/google-cloud-security_center-v2/lib/google/cloud/security_center/v2/security_center/credentials.rb b/owl-bot-staging/google-cloud-security_center-v2/lib/google/cloud/security_center/v2/security_center/credentials.rb deleted file mode 100644 index a53a263683eb..000000000000 --- a/owl-bot-staging/google-cloud-security_center-v2/lib/google/cloud/security_center/v2/security_center/credentials.rb +++ /dev/null @@ -1,51 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -require "googleauth" - -module Google - module Cloud - module SecurityCenter - module V2 - module SecurityCenter - # Credentials for the SecurityCenter API. - class Credentials < ::Google::Auth::Credentials - self.scope = [ - "https://www.googleapis.com/auth/cloud-platform" - ] - self.env_vars = [ - "SECURITY_CENTER_CREDENTIALS", - "SECURITY_CENTER_KEYFILE", - "GOOGLE_CLOUD_CREDENTIALS", - "GOOGLE_CLOUD_KEYFILE", - "GCLOUD_KEYFILE", - "SECURITY_CENTER_CREDENTIALS_JSON", - "SECURITY_CENTER_KEYFILE_JSON", - "GOOGLE_CLOUD_CREDENTIALS_JSON", - "GOOGLE_CLOUD_KEYFILE_JSON", - "GCLOUD_KEYFILE_JSON" - ] - self.paths = [ - "~/.config/google_cloud/application_default_credentials.json" - ] - end - end - end - end - end -end diff --git a/owl-bot-staging/google-cloud-security_center-v2/lib/google/cloud/security_center/v2/security_center/operations.rb b/owl-bot-staging/google-cloud-security_center-v2/lib/google/cloud/security_center/v2/security_center/operations.rb deleted file mode 100644 index 1e56a46d3e81..000000000000 --- a/owl-bot-staging/google-cloud-security_center-v2/lib/google/cloud/security_center/v2/security_center/operations.rb +++ /dev/null @@ -1,841 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -require "gapic/operation" -require "google/longrunning/operations_pb" - -module Google - module Cloud - module SecurityCenter - module V2 - module SecurityCenter - # Service that implements Longrunning Operations API. - class Operations - # @private - API_VERSION = "" - - # @private - DEFAULT_ENDPOINT_TEMPLATE = "securitycenter.$UNIVERSE_DOMAIN$" - - # @private - attr_reader :operations_stub - - ## - # Configuration for the SecurityCenter 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 SecurityCenter 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::SecurityCenter::V2::VERSION - metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - header_params = {} - if request.name - header_params["name"] = request.name - end - - request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") - metadata[:"x-goog-request-params"] ||= request_params_header - - options.apply_defaults timeout: @config.rpcs.list_operations.timeout, - metadata: metadata, - retry_policy: @config.rpcs.list_operations.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @operations_stub.call_rpc :list_operations, request, options: options do |response, operation| - wrap_lro_operation = ->(op_response) { ::Gapic::Operation.new op_response, @operations_client } - response = ::Gapic::PagedEnumerable.new @operations_stub, :list_operations, request, response, operation, options, format_resource: wrap_lro_operation - yield response, operation if block_given? - throw :response, response - end - rescue ::GRPC::BadStatus => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Gets the latest state of a long-running operation. Clients can use this - # method to poll the operation result at intervals as recommended by the API - # service. - # - # @overload get_operation(request, options = nil) - # Pass arguments to `get_operation` via a request object, either of type - # {::Google::Longrunning::GetOperationRequest} or an equivalent Hash. - # - # @param request [::Google::Longrunning::GetOperationRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. - # - # @overload get_operation(name: nil) - # Pass arguments to `get_operation` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param name [::String] - # The name of the operation resource. - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Gapic::Operation] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Gapic::Operation] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/longrunning" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Longrunning::Operations::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Longrunning::GetOperationRequest.new - # - # # Call the get_operation method. - # result = client.get_operation request - # - # # The returned object is of type Gapic::Operation. You can use it to - # # check the status of an operation, cancel it, or wait for results. - # # Here is how to wait for a response. - # result.wait_until_done! timeout: 60 - # if result.response? - # p result.response - # else - # puts "No response received." - # end - # - def get_operation request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Longrunning::GetOperationRequest - - # Converts hash and nil to an options object - options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h - - # Customize the options with defaults - metadata = @config.rpcs.get_operation.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::SecurityCenter::V2::VERSION - metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - header_params = {} - if request.name - header_params["name"] = request.name - end - - request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") - metadata[:"x-goog-request-params"] ||= request_params_header - - options.apply_defaults timeout: @config.rpcs.get_operation.timeout, - metadata: metadata, - retry_policy: @config.rpcs.get_operation.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @operations_stub.call_rpc :get_operation, request, options: options do |response, operation| - response = ::Gapic::Operation.new response, @operations_client, options: options - yield response, operation if block_given? - throw :response, response - end - rescue ::GRPC::BadStatus => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Deletes a long-running operation. This method indicates that the client is - # no longer interested in the operation result. It does not cancel the - # operation. If the server doesn't support this method, it returns - # `google.rpc.Code.UNIMPLEMENTED`. - # - # @overload delete_operation(request, options = nil) - # Pass arguments to `delete_operation` via a request object, either of type - # {::Google::Longrunning::DeleteOperationRequest} or an equivalent Hash. - # - # @param request [::Google::Longrunning::DeleteOperationRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. - # - # @overload delete_operation(name: nil) - # Pass arguments to `delete_operation` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param name [::String] - # The name of the operation resource to be deleted. - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Google::Protobuf::Empty] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Google::Protobuf::Empty] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/longrunning" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Longrunning::Operations::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Longrunning::DeleteOperationRequest.new - # - # # Call the delete_operation method. - # result = client.delete_operation request - # - # # The returned object is of type Google::Protobuf::Empty. - # p result - # - def delete_operation request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Longrunning::DeleteOperationRequest - - # Converts hash and nil to an options object - options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h - - # Customize the options with defaults - metadata = @config.rpcs.delete_operation.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::SecurityCenter::V2::VERSION - metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - header_params = {} - if request.name - header_params["name"] = request.name - end - - request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") - metadata[:"x-goog-request-params"] ||= request_params_header - - options.apply_defaults timeout: @config.rpcs.delete_operation.timeout, - metadata: metadata, - retry_policy: @config.rpcs.delete_operation.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @operations_stub.call_rpc :delete_operation, request, options: options do |response, operation| - yield response, operation if block_given? - end - rescue ::GRPC::BadStatus => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Starts asynchronous cancellation on a long-running operation. The server - # makes a best effort to cancel the operation, but success is not - # guaranteed. If the server doesn't support this method, it returns - # `google.rpc.Code.UNIMPLEMENTED`. Clients can use - # Operations.GetOperation or - # other methods to check whether the cancellation succeeded or whether the - # operation completed despite cancellation. On successful cancellation, - # the operation is not deleted; instead, it becomes an operation with - # an {::Google::Longrunning::Operation#error Operation.error} value with a - # {::Google::Rpc::Status#code google.rpc.Status.code} of `1`, corresponding to - # `Code.CANCELLED`. - # - # @overload cancel_operation(request, options = nil) - # Pass arguments to `cancel_operation` via a request object, either of type - # {::Google::Longrunning::CancelOperationRequest} or an equivalent Hash. - # - # @param request [::Google::Longrunning::CancelOperationRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. - # - # @overload cancel_operation(name: nil) - # Pass arguments to `cancel_operation` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param name [::String] - # The name of the operation resource to be cancelled. - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Google::Protobuf::Empty] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Google::Protobuf::Empty] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/longrunning" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Longrunning::Operations::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Longrunning::CancelOperationRequest.new - # - # # Call the cancel_operation method. - # result = client.cancel_operation request - # - # # The returned object is of type Google::Protobuf::Empty. - # p result - # - def cancel_operation request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Longrunning::CancelOperationRequest - - # Converts hash and nil to an options object - options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h - - # Customize the options with defaults - metadata = @config.rpcs.cancel_operation.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::SecurityCenter::V2::VERSION - metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - header_params = {} - if request.name - header_params["name"] = request.name - end - - request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") - metadata[:"x-goog-request-params"] ||= request_params_header - - options.apply_defaults timeout: @config.rpcs.cancel_operation.timeout, - metadata: metadata, - retry_policy: @config.rpcs.cancel_operation.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @operations_stub.call_rpc :cancel_operation, request, options: options do |response, operation| - yield response, operation if block_given? - end - rescue ::GRPC::BadStatus => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Waits until the specified long-running operation is done or reaches at most - # a specified timeout, returning the latest state. If the operation is - # already done, the latest state is immediately returned. If the timeout - # specified is greater than the default HTTP/RPC timeout, the HTTP/RPC - # timeout is used. If the server does not support this method, it returns - # `google.rpc.Code.UNIMPLEMENTED`. - # Note that this method is on a best-effort basis. It may return the latest - # state before the specified timeout (including immediately), meaning even an - # immediate response is no guarantee that the operation is done. - # - # @overload wait_operation(request, options = nil) - # Pass arguments to `wait_operation` via a request object, either of type - # {::Google::Longrunning::WaitOperationRequest} or an equivalent Hash. - # - # @param request [::Google::Longrunning::WaitOperationRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. - # - # @overload wait_operation(name: nil, timeout: nil) - # Pass arguments to `wait_operation` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param name [::String] - # The name of the operation resource to wait on. - # @param timeout [::Google::Protobuf::Duration, ::Hash] - # The maximum duration to wait before timing out. If left blank, the wait - # will be at most the time permitted by the underlying HTTP/RPC protocol. - # If RPC context deadline is also specified, the shorter one will be used. - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Gapic::Operation] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Gapic::Operation] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/longrunning" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Longrunning::Operations::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Longrunning::WaitOperationRequest.new - # - # # Call the wait_operation method. - # result = client.wait_operation request - # - # # The returned object is of type Gapic::Operation. You can use it to - # # check the status of an operation, cancel it, or wait for results. - # # Here is how to wait for a response. - # result.wait_until_done! timeout: 60 - # if result.response? - # p result.response - # else - # puts "No response received." - # end - # - def wait_operation request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Longrunning::WaitOperationRequest - - # Converts hash and nil to an options object - options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h - - # Customize the options with defaults - metadata = @config.rpcs.wait_operation.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::SecurityCenter::V2::VERSION - metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - options.apply_defaults timeout: @config.rpcs.wait_operation.timeout, - metadata: metadata, - retry_policy: @config.rpcs.wait_operation.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @operations_stub.call_rpc :wait_operation, request, options: options do |response, operation| - response = ::Gapic::Operation.new response, @operations_client, options: options - yield response, operation if block_given? - throw :response, response - end - rescue ::GRPC::BadStatus => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Configuration class for the Operations API. - # - # This class represents the configuration for Operations, - # providing control over timeouts, retry behavior, logging, transport - # parameters, and other low-level controls. Certain parameters can also be - # applied individually to specific RPCs. See - # {::Google::Longrunning::Operations::Client::Configuration::Rpcs} - # for a list of RPCs that can be configured independently. - # - # Configuration can be applied globally to all clients, or to a single client - # on construction. - # - # @example - # - # # Modify the global config, setting the timeout for - # # list_operations to 20 seconds, - # # and all remaining timeouts to 10 seconds. - # ::Google::Longrunning::Operations::Client.configure do |config| - # config.timeout = 10.0 - # config.rpcs.list_operations.timeout = 20.0 - # end - # - # # Apply the above configuration only to a new client. - # client = ::Google::Longrunning::Operations::Client.new do |config| - # config.timeout = 10.0 - # config.rpcs.list_operations.timeout = 20.0 - # end - # - # @!attribute [rw] endpoint - # A custom service endpoint, as a hostname or hostname:port. The default is - # nil, indicating to use the default endpoint in the current universe domain. - # @return [::String,nil] - # @!attribute [rw] credentials - # Credentials to send with calls. You may provide any of the following types: - # * (`Google::Auth::Credentials`) A googleauth credentials object - # (see the [googleauth docs](https://rubydoc.info/gems/googleauth/Google/Auth/Credentials)) - # * (`Signet::OAuth2::Client`) A signet oauth2 client object - # (see the [signet docs](https://rubydoc.info/gems/signet/Signet/OAuth2/Client)) - # * (`GRPC::Core::Channel`) a gRPC channel with included credentials - # * (`GRPC::Core::ChannelCredentials`) a gRPC credentails object - # * (`nil`) indicating no credentials - # - # @note Warning: Passing a `String` to a keyfile path or a `Hash` of credentials - # is deprecated. Providing an unvalidated credential configuration to - # Google APIs can compromise the security of your systems and data. - # - # @example - # - # # The recommended way to provide credentials is to use the `make_creds` method - # # on the appropriate credentials class for your environment. - # - # require "googleauth" - # - # credentials = ::Google::Auth::ServiceAccountCredentials.make_creds( - # json_key_io: ::File.open("/path/to/keyfile.json") - # ) - # - # client = ::Google::Longrunning::Operations::Client.new do |config| - # config.credentials = credentials - # end - # - # @note Warning: If you accept a credential configuration (JSON file or Hash) from an - # external source for authentication to Google Cloud, you must validate it before - # providing it to a Google API client library. Providing an unvalidated credential - # configuration to Google APIs can compromise the security of your systems and data. - # For more information, refer to [Validate credential configurations from external - # sources](https://cloud.google.com/docs/authentication/external/externally-sourced-credentials). - # @return [::Object] - # @!attribute [rw] scope - # The OAuth scopes - # @return [::Array<::String>] - # @!attribute [rw] lib_name - # The library name as recorded in instrumentation and logging - # @return [::String] - # @!attribute [rw] lib_version - # The library version as recorded in instrumentation and logging - # @return [::String] - # @!attribute [rw] channel_args - # Extra parameters passed to the gRPC channel. Note: this is ignored if a - # `GRPC::Core::Channel` object is provided as the credential. - # @return [::Hash] - # @!attribute [rw] interceptors - # An array of interceptors that are run before calls are executed. - # @return [::Array<::GRPC::ClientInterceptor>] - # @!attribute [rw] timeout - # The call timeout in seconds. - # @return [::Numeric] - # @!attribute [rw] metadata - # Additional gRPC headers to be sent with the call. - # @return [::Hash{::Symbol=>::String}] - # @!attribute [rw] retry_policy - # The retry policy. The value is a hash with the following keys: - # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds. - # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds. - # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier. - # * `:retry_codes` (*type:* `Array`) - The error codes that should - # trigger a retry. - # @return [::Hash] - # @!attribute [rw] quota_project - # A separate project against which to charge quota. - # @return [::String] - # @!attribute [rw] universe_domain - # The universe domain within which to make requests. This determines the - # default endpoint URL. The default value of nil uses the environment - # universe (usually the default "googleapis.com" universe). - # @return [::String,nil] - # @!attribute [rw] logger - # A custom logger to use for request/response debug logging, or the value - # `:default` (the default) to construct a default logger, or `nil` to - # explicitly disable logging. - # @return [::Logger,:default,nil] - # - class Configuration - extend ::Gapic::Config - - # @private - # The endpoint specific to the default "googleapis.com" universe. Deprecated. - DEFAULT_ENDPOINT = "securitycenter.googleapis.com" - - config_attr :endpoint, nil, ::String, nil - config_attr :credentials, nil do |value| - allowed = [::String, ::Hash, ::Proc, ::Symbol, ::Google::Auth::Credentials, ::Google::Auth::BaseClient, ::Signet::OAuth2::Client, nil] - allowed += [::GRPC::Core::Channel, ::GRPC::Core::ChannelCredentials] if defined? ::GRPC::Core::Channel - allowed.any? { |klass| klass === value } - end - config_attr :scope, nil, ::String, ::Array, nil - config_attr :lib_name, nil, ::String, nil - config_attr :lib_version, nil, ::String, nil - config_attr(:channel_args, { "grpc.service_config_disable_resolution" => 1 }, ::Hash, nil) - config_attr :interceptors, nil, ::Array, nil - config_attr :timeout, nil, ::Numeric, nil - config_attr :metadata, nil, ::Hash, nil - config_attr :retry_policy, nil, ::Hash, ::Proc, nil - config_attr :quota_project, nil, ::String, nil - config_attr :universe_domain, nil, ::String, nil - config_attr :logger, :default, ::Logger, nil, :default - - # @private - def initialize parent_config = nil - @parent_config = parent_config unless parent_config.nil? - - yield self if block_given? - end - - ## - # Configurations for individual RPCs - # @return [Rpcs] - # - def rpcs - @rpcs ||= begin - parent_rpcs = nil - parent_rpcs = @parent_config.rpcs if defined?(@parent_config) && @parent_config.respond_to?(:rpcs) - Rpcs.new parent_rpcs - end - end - - ## - # Configuration for the channel pool - # @return [::Gapic::ServiceStub::ChannelPool::Configuration] - # - def channel_pool - @channel_pool ||= ::Gapic::ServiceStub::ChannelPool::Configuration.new - end - - ## - # Configuration RPC class for the Operations API. - # - # Includes fields providing the configuration for each RPC in this service. - # Each configuration object is of type `Gapic::Config::Method` and includes - # the following configuration fields: - # - # * `timeout` (*type:* `Numeric`) - The call timeout in seconds - # * `metadata` (*type:* `Hash{Symbol=>String}`) - Additional gRPC headers - # * `retry_policy (*type:* `Hash`) - The retry policy. The policy fields - # include the following keys: - # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds. - # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds. - # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier. - # * `:retry_codes` (*type:* `Array`) - The error codes that should - # trigger a retry. - # - class Rpcs - ## - # RPC-specific configuration for `list_operations` - # @return [::Gapic::Config::Method] - # - attr_reader :list_operations - ## - # RPC-specific configuration for `get_operation` - # @return [::Gapic::Config::Method] - # - attr_reader :get_operation - ## - # RPC-specific configuration for `delete_operation` - # @return [::Gapic::Config::Method] - # - attr_reader :delete_operation - ## - # RPC-specific configuration for `cancel_operation` - # @return [::Gapic::Config::Method] - # - attr_reader :cancel_operation - ## - # RPC-specific configuration for `wait_operation` - # @return [::Gapic::Config::Method] - # - attr_reader :wait_operation - - # @private - def initialize parent_rpcs = nil - list_operations_config = parent_rpcs.list_operations if parent_rpcs.respond_to? :list_operations - @list_operations = ::Gapic::Config::Method.new list_operations_config - get_operation_config = parent_rpcs.get_operation if parent_rpcs.respond_to? :get_operation - @get_operation = ::Gapic::Config::Method.new get_operation_config - delete_operation_config = parent_rpcs.delete_operation if parent_rpcs.respond_to? :delete_operation - @delete_operation = ::Gapic::Config::Method.new delete_operation_config - cancel_operation_config = parent_rpcs.cancel_operation if parent_rpcs.respond_to? :cancel_operation - @cancel_operation = ::Gapic::Config::Method.new cancel_operation_config - wait_operation_config = parent_rpcs.wait_operation if parent_rpcs.respond_to? :wait_operation - @wait_operation = ::Gapic::Config::Method.new wait_operation_config - - yield self if block_given? - end - end - end - end - end - end - end - end -end diff --git a/owl-bot-staging/google-cloud-security_center-v2/lib/google/cloud/security_center/v2/security_center/paths.rb b/owl-bot-staging/google-cloud-security_center-v2/lib/google/cloud/security_center/v2/security_center/paths.rb deleted file mode 100644 index 680b1675791d..000000000000 --- a/owl-bot-staging/google-cloud-security_center-v2/lib/google/cloud/security_center/v2/security_center/paths.rb +++ /dev/null @@ -1,1068 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - - -module Google - module Cloud - module SecurityCenter - module V2 - module SecurityCenter - # Path helper methods for the SecurityCenter API. - module Paths - ## - # Create a fully-qualified BigQueryExport resource string. - # - # @overload big_query_export_path(organization:, location:, export:) - # The resource will be in the following format: - # - # `organizations/{organization}/locations/{location}/bigQueryExports/{export}` - # - # @param organization [String] - # @param location [String] - # @param export [String] - # - # @overload big_query_export_path(folder:, location:, export:) - # The resource will be in the following format: - # - # `folders/{folder}/locations/{location}/bigQueryExports/{export}` - # - # @param folder [String] - # @param location [String] - # @param export [String] - # - # @overload big_query_export_path(project:, location:, export:) - # The resource will be in the following format: - # - # `projects/{project}/locations/{location}/bigQueryExports/{export}` - # - # @param project [String] - # @param location [String] - # @param export [String] - # - # @return [::String] - def big_query_export_path **args - resources = { - "export:location:organization" => (proc do |organization:, location:, export:| - raise ::ArgumentError, "organization cannot contain /" if organization.to_s.include? "/" - raise ::ArgumentError, "location cannot contain /" if location.to_s.include? "/" - - "organizations/#{organization}/locations/#{location}/bigQueryExports/#{export}" - end), - "export:folder:location" => (proc do |folder:, location:, export:| - raise ::ArgumentError, "folder cannot contain /" if folder.to_s.include? "/" - raise ::ArgumentError, "location cannot contain /" if location.to_s.include? "/" - - "folders/#{folder}/locations/#{location}/bigQueryExports/#{export}" - end), - "export:location:project" => (proc do |project:, location:, export:| - raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" - raise ::ArgumentError, "location cannot contain /" if location.to_s.include? "/" - - "projects/#{project}/locations/#{location}/bigQueryExports/#{export}" - 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 DlpJob resource string. - # - # @overload dlp_job_path(project:, dlp_job:) - # The resource will be in the following format: - # - # `projects/{project}/dlpJobs/{dlp_job}` - # - # @param project [String] - # @param dlp_job [String] - # - # @overload dlp_job_path(project:, location:, dlp_job:) - # The resource will be in the following format: - # - # `projects/{project}/locations/{location}/dlpJobs/{dlp_job}` - # - # @param project [String] - # @param location [String] - # @param dlp_job [String] - # - # @return [::String] - def dlp_job_path **args - resources = { - "dlp_job:project" => (proc do |project:, dlp_job:| - raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" - - "projects/#{project}/dlpJobs/#{dlp_job}" - end), - "dlp_job:location:project" => (proc do |project:, location:, dlp_job:| - raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" - raise ::ArgumentError, "location cannot contain /" if location.to_s.include? "/" - - "projects/#{project}/locations/#{location}/dlpJobs/#{dlp_job}" - 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 ExternalSystem resource string. - # - # @overload external_system_path(organization:, source:, finding:, externalsystem:) - # The resource will be in the following format: - # - # `organizations/{organization}/sources/{source}/findings/{finding}/externalSystems/{externalsystem}` - # - # @param organization [String] - # @param source [String] - # @param finding [String] - # @param externalsystem [String] - # - # @overload external_system_path(organization:, source:, location:, finding:, externalsystem:) - # The resource will be in the following format: - # - # `organizations/{organization}/sources/{source}/locations/{location}/findings/{finding}/externalSystems/{externalsystem}` - # - # @param organization [String] - # @param source [String] - # @param location [String] - # @param finding [String] - # @param externalsystem [String] - # - # @overload external_system_path(folder:, source:, finding:, externalsystem:) - # The resource will be in the following format: - # - # `folders/{folder}/sources/{source}/findings/{finding}/externalSystems/{externalsystem}` - # - # @param folder [String] - # @param source [String] - # @param finding [String] - # @param externalsystem [String] - # - # @overload external_system_path(folder:, source:, location:, finding:, externalsystem:) - # The resource will be in the following format: - # - # `folders/{folder}/sources/{source}/locations/{location}/findings/{finding}/externalSystems/{externalsystem}` - # - # @param folder [String] - # @param source [String] - # @param location [String] - # @param finding [String] - # @param externalsystem [String] - # - # @overload external_system_path(project:, source:, finding:, externalsystem:) - # The resource will be in the following format: - # - # `projects/{project}/sources/{source}/findings/{finding}/externalSystems/{externalsystem}` - # - # @param project [String] - # @param source [String] - # @param finding [String] - # @param externalsystem [String] - # - # @overload external_system_path(project:, source:, location:, finding:, externalsystem:) - # The resource will be in the following format: - # - # `projects/{project}/sources/{source}/locations/{location}/findings/{finding}/externalSystems/{externalsystem}` - # - # @param project [String] - # @param source [String] - # @param location [String] - # @param finding [String] - # @param externalsystem [String] - # - # @return [::String] - def external_system_path **args - resources = { - "externalsystem:finding:organization:source" => (proc do |organization:, source:, finding:, externalsystem:| - raise ::ArgumentError, "organization cannot contain /" if organization.to_s.include? "/" - raise ::ArgumentError, "source cannot contain /" if source.to_s.include? "/" - raise ::ArgumentError, "finding cannot contain /" if finding.to_s.include? "/" - - "organizations/#{organization}/sources/#{source}/findings/#{finding}/externalSystems/#{externalsystem}" - end), - "externalsystem:finding:location:organization:source" => (proc do |organization:, source:, location:, finding:, externalsystem:| - raise ::ArgumentError, "organization cannot contain /" if organization.to_s.include? "/" - raise ::ArgumentError, "source cannot contain /" if source.to_s.include? "/" - raise ::ArgumentError, "location cannot contain /" if location.to_s.include? "/" - raise ::ArgumentError, "finding cannot contain /" if finding.to_s.include? "/" - - "organizations/#{organization}/sources/#{source}/locations/#{location}/findings/#{finding}/externalSystems/#{externalsystem}" - end), - "externalsystem:finding:folder:source" => (proc do |folder:, source:, finding:, externalsystem:| - raise ::ArgumentError, "folder cannot contain /" if folder.to_s.include? "/" - raise ::ArgumentError, "source cannot contain /" if source.to_s.include? "/" - raise ::ArgumentError, "finding cannot contain /" if finding.to_s.include? "/" - - "folders/#{folder}/sources/#{source}/findings/#{finding}/externalSystems/#{externalsystem}" - end), - "externalsystem:finding:folder:location:source" => (proc do |folder:, source:, location:, finding:, externalsystem:| - raise ::ArgumentError, "folder cannot contain /" if folder.to_s.include? "/" - raise ::ArgumentError, "source cannot contain /" if source.to_s.include? "/" - raise ::ArgumentError, "location cannot contain /" if location.to_s.include? "/" - raise ::ArgumentError, "finding cannot contain /" if finding.to_s.include? "/" - - "folders/#{folder}/sources/#{source}/locations/#{location}/findings/#{finding}/externalSystems/#{externalsystem}" - end), - "externalsystem:finding:project:source" => (proc do |project:, source:, finding:, externalsystem:| - raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" - raise ::ArgumentError, "source cannot contain /" if source.to_s.include? "/" - raise ::ArgumentError, "finding cannot contain /" if finding.to_s.include? "/" - - "projects/#{project}/sources/#{source}/findings/#{finding}/externalSystems/#{externalsystem}" - end), - "externalsystem:finding:location:project:source" => (proc do |project:, source:, location:, finding:, externalsystem:| - raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" - raise ::ArgumentError, "source cannot contain /" if source.to_s.include? "/" - raise ::ArgumentError, "location cannot contain /" if location.to_s.include? "/" - raise ::ArgumentError, "finding cannot contain /" if finding.to_s.include? "/" - - "projects/#{project}/sources/#{source}/locations/#{location}/findings/#{finding}/externalSystems/#{externalsystem}" - 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 Finding resource string. - # - # @overload finding_path(organization:, source:, finding:) - # The resource will be in the following format: - # - # `organizations/{organization}/sources/{source}/findings/{finding}` - # - # @param organization [String] - # @param source [String] - # @param finding [String] - # - # @overload finding_path(organization:, source:, location:, finding:) - # The resource will be in the following format: - # - # `organizations/{organization}/sources/{source}/locations/{location}/findings/{finding}` - # - # @param organization [String] - # @param source [String] - # @param location [String] - # @param finding [String] - # - # @overload finding_path(folder:, source:, finding:) - # The resource will be in the following format: - # - # `folders/{folder}/sources/{source}/findings/{finding}` - # - # @param folder [String] - # @param source [String] - # @param finding [String] - # - # @overload finding_path(folder:, source:, location:, finding:) - # The resource will be in the following format: - # - # `folders/{folder}/sources/{source}/locations/{location}/findings/{finding}` - # - # @param folder [String] - # @param source [String] - # @param location [String] - # @param finding [String] - # - # @overload finding_path(project:, source:, finding:) - # The resource will be in the following format: - # - # `projects/{project}/sources/{source}/findings/{finding}` - # - # @param project [String] - # @param source [String] - # @param finding [String] - # - # @overload finding_path(project:, source:, location:, finding:) - # The resource will be in the following format: - # - # `projects/{project}/sources/{source}/locations/{location}/findings/{finding}` - # - # @param project [String] - # @param source [String] - # @param location [String] - # @param finding [String] - # - # @return [::String] - def finding_path **args - resources = { - "finding:organization:source" => (proc do |organization:, source:, finding:| - raise ::ArgumentError, "organization cannot contain /" if organization.to_s.include? "/" - raise ::ArgumentError, "source cannot contain /" if source.to_s.include? "/" - - "organizations/#{organization}/sources/#{source}/findings/#{finding}" - end), - "finding:location:organization:source" => (proc do |organization:, source:, location:, finding:| - raise ::ArgumentError, "organization cannot contain /" if organization.to_s.include? "/" - raise ::ArgumentError, "source cannot contain /" if source.to_s.include? "/" - raise ::ArgumentError, "location cannot contain /" if location.to_s.include? "/" - - "organizations/#{organization}/sources/#{source}/locations/#{location}/findings/#{finding}" - end), - "finding:folder:source" => (proc do |folder:, source:, finding:| - raise ::ArgumentError, "folder cannot contain /" if folder.to_s.include? "/" - raise ::ArgumentError, "source cannot contain /" if source.to_s.include? "/" - - "folders/#{folder}/sources/#{source}/findings/#{finding}" - end), - "finding:folder:location:source" => (proc do |folder:, source:, location:, finding:| - raise ::ArgumentError, "folder cannot contain /" if folder.to_s.include? "/" - raise ::ArgumentError, "source cannot contain /" if source.to_s.include? "/" - raise ::ArgumentError, "location cannot contain /" if location.to_s.include? "/" - - "folders/#{folder}/sources/#{source}/locations/#{location}/findings/#{finding}" - end), - "finding:project:source" => (proc do |project:, source:, finding:| - raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" - raise ::ArgumentError, "source cannot contain /" if source.to_s.include? "/" - - "projects/#{project}/sources/#{source}/findings/#{finding}" - end), - "finding:location:project:source" => (proc do |project:, source:, location:, finding:| - raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" - raise ::ArgumentError, "source cannot contain /" if source.to_s.include? "/" - raise ::ArgumentError, "location cannot contain /" if location.to_s.include? "/" - - "projects/#{project}/sources/#{source}/locations/#{location}/findings/#{finding}" - 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 Folder resource string. - # - # The resource will be in the following format: - # - # `folders/{folder}` - # - # @param folder [String] - # - # @return [::String] - def folder_path folder: - "folders/#{folder}" - 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 MuteConfig resource string. - # - # @overload mute_config_path(organization:, mute_config:) - # The resource will be in the following format: - # - # `organizations/{organization}/muteConfigs/{mute_config}` - # - # @param organization [String] - # @param mute_config [String] - # - # @overload mute_config_path(organization:, location:, mute_config:) - # The resource will be in the following format: - # - # `organizations/{organization}/locations/{location}/muteConfigs/{mute_config}` - # - # @param organization [String] - # @param location [String] - # @param mute_config [String] - # - # @overload mute_config_path(folder:, mute_config:) - # The resource will be in the following format: - # - # `folders/{folder}/muteConfigs/{mute_config}` - # - # @param folder [String] - # @param mute_config [String] - # - # @overload mute_config_path(folder:, location:, mute_config:) - # The resource will be in the following format: - # - # `folders/{folder}/locations/{location}/muteConfigs/{mute_config}` - # - # @param folder [String] - # @param location [String] - # @param mute_config [String] - # - # @overload mute_config_path(project:, mute_config:) - # The resource will be in the following format: - # - # `projects/{project}/muteConfigs/{mute_config}` - # - # @param project [String] - # @param mute_config [String] - # - # @overload mute_config_path(project:, location:, mute_config:) - # The resource will be in the following format: - # - # `projects/{project}/locations/{location}/muteConfigs/{mute_config}` - # - # @param project [String] - # @param location [String] - # @param mute_config [String] - # - # @return [::String] - def mute_config_path **args - resources = { - "mute_config:organization" => (proc do |organization:, mute_config:| - raise ::ArgumentError, "organization cannot contain /" if organization.to_s.include? "/" - - "organizations/#{organization}/muteConfigs/#{mute_config}" - end), - "location:mute_config:organization" => (proc do |organization:, location:, mute_config:| - raise ::ArgumentError, "organization cannot contain /" if organization.to_s.include? "/" - raise ::ArgumentError, "location cannot contain /" if location.to_s.include? "/" - - "organizations/#{organization}/locations/#{location}/muteConfigs/#{mute_config}" - end), - "folder:mute_config" => (proc do |folder:, mute_config:| - raise ::ArgumentError, "folder cannot contain /" if folder.to_s.include? "/" - - "folders/#{folder}/muteConfigs/#{mute_config}" - end), - "folder:location:mute_config" => (proc do |folder:, location:, mute_config:| - raise ::ArgumentError, "folder cannot contain /" if folder.to_s.include? "/" - raise ::ArgumentError, "location cannot contain /" if location.to_s.include? "/" - - "folders/#{folder}/locations/#{location}/muteConfigs/#{mute_config}" - end), - "mute_config:project" => (proc do |project:, mute_config:| - raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" - - "projects/#{project}/muteConfigs/#{mute_config}" - end), - "location:mute_config:project" => (proc do |project:, location:, mute_config:| - raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" - raise ::ArgumentError, "location cannot contain /" if location.to_s.include? "/" - - "projects/#{project}/locations/#{location}/muteConfigs/#{mute_config}" - 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 NotificationConfig resource string. - # - # @overload notification_config_path(organization:, location:, notification_config:) - # The resource will be in the following format: - # - # `organizations/{organization}/locations/{location}/notificationConfigs/{notification_config}` - # - # @param organization [String] - # @param location [String] - # @param notification_config [String] - # - # @overload notification_config_path(folder:, location:, notification_config:) - # The resource will be in the following format: - # - # `folders/{folder}/locations/{location}/notificationConfigs/{notification_config}` - # - # @param folder [String] - # @param location [String] - # @param notification_config [String] - # - # @overload notification_config_path(project:, location:, notification_config:) - # The resource will be in the following format: - # - # `projects/{project}/locations/{location}/notificationConfigs/{notification_config}` - # - # @param project [String] - # @param location [String] - # @param notification_config [String] - # - # @return [::String] - def notification_config_path **args - resources = { - "location:notification_config:organization" => (proc do |organization:, location:, notification_config:| - raise ::ArgumentError, "organization cannot contain /" if organization.to_s.include? "/" - raise ::ArgumentError, "location cannot contain /" if location.to_s.include? "/" - - "organizations/#{organization}/locations/#{location}/notificationConfigs/#{notification_config}" - end), - "folder:location:notification_config" => (proc do |folder:, location:, notification_config:| - raise ::ArgumentError, "folder cannot contain /" if folder.to_s.include? "/" - raise ::ArgumentError, "location cannot contain /" if location.to_s.include? "/" - - "folders/#{folder}/locations/#{location}/notificationConfigs/#{notification_config}" - end), - "location:notification_config:project" => (proc do |project:, location:, notification_config:| - raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" - raise ::ArgumentError, "location cannot contain /" if location.to_s.include? "/" - - "projects/#{project}/locations/#{location}/notificationConfigs/#{notification_config}" - 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 Organization resource string. - # - # The resource will be in the following format: - # - # `organizations/{organization}` - # - # @param organization [String] - # - # @return [::String] - def organization_path organization: - "organizations/#{organization}" - 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 OrganizationValuedResource resource string. - # - # The resource will be in the following format: - # - # `organizations/{organization}/locations/{location}/simulations/{simulation}/valuedResources/{valued_resource}` - # - # @param organization [String] - # @param location [String] - # @param simulation [String] - # @param valued_resource [String] - # - # @return [::String] - def organization_valued_resource_path organization:, location:, simulation:, valued_resource: - raise ::ArgumentError, "organization cannot contain /" if organization.to_s.include? "/" - raise ::ArgumentError, "location cannot contain /" if location.to_s.include? "/" - raise ::ArgumentError, "simulation cannot contain /" if simulation.to_s.include? "/" - - "organizations/#{organization}/locations/#{location}/simulations/#{simulation}/valuedResources/#{valued_resource}" - end - - ## - # Create a fully-qualified Policy resource string. - # - # @overload policy_path(organization:, constraint_name:) - # The resource will be in the following format: - # - # `organizations/{organization}/policies/{constraint_name}` - # - # @param organization [String] - # @param constraint_name [String] - # - # @overload policy_path(folder:, constraint_name:) - # The resource will be in the following format: - # - # `folders/{folder}/policies/{constraint_name}` - # - # @param folder [String] - # @param constraint_name [String] - # - # @overload policy_path(project:, constraint_name:) - # The resource will be in the following format: - # - # `projects/{project}/policies/{constraint_name}` - # - # @param project [String] - # @param constraint_name [String] - # - # @return [::String] - def policy_path **args - resources = { - "constraint_name:organization" => (proc do |organization:, constraint_name:| - raise ::ArgumentError, "organization cannot contain /" if organization.to_s.include? "/" - - "organizations/#{organization}/policies/#{constraint_name}" - end), - "constraint_name:folder" => (proc do |folder:, constraint_name:| - raise ::ArgumentError, "folder cannot contain /" if folder.to_s.include? "/" - - "folders/#{folder}/policies/#{constraint_name}" - end), - "constraint_name:project" => (proc do |project:, constraint_name:| - raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" - - "projects/#{project}/policies/#{constraint_name}" - 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 Project resource string. - # - # The resource will be in the following format: - # - # `projects/{project}` - # - # @param project [String] - # - # @return [::String] - def project_path project: - "projects/#{project}" - end - - ## - # Create a fully-qualified ResourceValueConfig resource string. - # - # @overload resource_value_config_path(organization:, resource_value_config:) - # The resource will be in the following format: - # - # `organizations/{organization}/resourceValueConfigs/{resource_value_config}` - # - # @param organization [String] - # @param resource_value_config [String] - # - # @overload resource_value_config_path(organization:, location:, resource_value_config:) - # The resource will be in the following format: - # - # `organizations/{organization}/locations/{location}/resourceValueConfigs/{resource_value_config}` - # - # @param organization [String] - # @param location [String] - # @param resource_value_config [String] - # - # @return [::String] - def resource_value_config_path **args - resources = { - "organization:resource_value_config" => (proc do |organization:, resource_value_config:| - raise ::ArgumentError, "organization cannot contain /" if organization.to_s.include? "/" - - "organizations/#{organization}/resourceValueConfigs/#{resource_value_config}" - end), - "location:organization:resource_value_config" => (proc do |organization:, location:, resource_value_config:| - raise ::ArgumentError, "organization cannot contain /" if organization.to_s.include? "/" - raise ::ArgumentError, "location cannot contain /" if location.to_s.include? "/" - - "organizations/#{organization}/locations/#{location}/resourceValueConfigs/#{resource_value_config}" - 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 SecurityMarks resource string. - # - # @overload security_marks_path(organization:, asset:) - # The resource will be in the following format: - # - # `organizations/{organization}/assets/{asset}/securityMarks` - # - # @param organization [String] - # @param asset [String] - # - # @overload security_marks_path(organization:, source:, finding:) - # The resource will be in the following format: - # - # `organizations/{organization}/sources/{source}/findings/{finding}/securityMarks` - # - # @param organization [String] - # @param source [String] - # @param finding [String] - # - # @overload security_marks_path(organization:, source:, location:, finding:) - # The resource will be in the following format: - # - # `organizations/{organization}/sources/{source}/locations/{location}/findings/{finding}/securityMarks` - # - # @param organization [String] - # @param source [String] - # @param location [String] - # @param finding [String] - # - # @overload security_marks_path(folder:, asset:) - # The resource will be in the following format: - # - # `folders/{folder}/assets/{asset}/securityMarks` - # - # @param folder [String] - # @param asset [String] - # - # @overload security_marks_path(folder:, source:, finding:) - # The resource will be in the following format: - # - # `folders/{folder}/sources/{source}/findings/{finding}/securityMarks` - # - # @param folder [String] - # @param source [String] - # @param finding [String] - # - # @overload security_marks_path(folder:, source:, location:, finding:) - # The resource will be in the following format: - # - # `folders/{folder}/sources/{source}/locations/{location}/findings/{finding}/securityMarks` - # - # @param folder [String] - # @param source [String] - # @param location [String] - # @param finding [String] - # - # @overload security_marks_path(project:, asset:) - # The resource will be in the following format: - # - # `projects/{project}/assets/{asset}/securityMarks` - # - # @param project [String] - # @param asset [String] - # - # @overload security_marks_path(project:, source:, finding:) - # The resource will be in the following format: - # - # `projects/{project}/sources/{source}/findings/{finding}/securityMarks` - # - # @param project [String] - # @param source [String] - # @param finding [String] - # - # @overload security_marks_path(project:, source:, location:, finding:) - # The resource will be in the following format: - # - # `projects/{project}/sources/{source}/locations/{location}/findings/{finding}/securityMarks` - # - # @param project [String] - # @param source [String] - # @param location [String] - # @param finding [String] - # - # @return [::String] - def security_marks_path **args - resources = { - "asset:organization" => (proc do |organization:, asset:| - raise ::ArgumentError, "organization cannot contain /" if organization.to_s.include? "/" - - "organizations/#{organization}/assets/#{asset}/securityMarks" - end), - "finding:organization:source" => (proc do |organization:, source:, finding:| - raise ::ArgumentError, "organization cannot contain /" if organization.to_s.include? "/" - raise ::ArgumentError, "source cannot contain /" if source.to_s.include? "/" - - "organizations/#{organization}/sources/#{source}/findings/#{finding}/securityMarks" - end), - "finding:location:organization:source" => (proc do |organization:, source:, location:, finding:| - raise ::ArgumentError, "organization cannot contain /" if organization.to_s.include? "/" - raise ::ArgumentError, "source cannot contain /" if source.to_s.include? "/" - raise ::ArgumentError, "location cannot contain /" if location.to_s.include? "/" - - "organizations/#{organization}/sources/#{source}/locations/#{location}/findings/#{finding}/securityMarks" - end), - "asset:folder" => (proc do |folder:, asset:| - raise ::ArgumentError, "folder cannot contain /" if folder.to_s.include? "/" - - "folders/#{folder}/assets/#{asset}/securityMarks" - end), - "finding:folder:source" => (proc do |folder:, source:, finding:| - raise ::ArgumentError, "folder cannot contain /" if folder.to_s.include? "/" - raise ::ArgumentError, "source cannot contain /" if source.to_s.include? "/" - - "folders/#{folder}/sources/#{source}/findings/#{finding}/securityMarks" - end), - "finding:folder:location:source" => (proc do |folder:, source:, location:, finding:| - raise ::ArgumentError, "folder cannot contain /" if folder.to_s.include? "/" - raise ::ArgumentError, "source cannot contain /" if source.to_s.include? "/" - raise ::ArgumentError, "location cannot contain /" if location.to_s.include? "/" - - "folders/#{folder}/sources/#{source}/locations/#{location}/findings/#{finding}/securityMarks" - end), - "asset:project" => (proc do |project:, asset:| - raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" - - "projects/#{project}/assets/#{asset}/securityMarks" - end), - "finding:project:source" => (proc do |project:, source:, finding:| - raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" - raise ::ArgumentError, "source cannot contain /" if source.to_s.include? "/" - - "projects/#{project}/sources/#{source}/findings/#{finding}/securityMarks" - end), - "finding:location:project:source" => (proc do |project:, source:, location:, finding:| - raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" - raise ::ArgumentError, "source cannot contain /" if source.to_s.include? "/" - raise ::ArgumentError, "location cannot contain /" if location.to_s.include? "/" - - "projects/#{project}/sources/#{source}/locations/#{location}/findings/#{finding}/securityMarks" - 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 Simulation resource string. - # - # @overload simulation_path(organization:, simulation:) - # The resource will be in the following format: - # - # `organizations/{organization}/simulations/{simulation}` - # - # @param organization [String] - # @param simulation [String] - # - # @overload simulation_path(organization:, location:, simluation:) - # The resource will be in the following format: - # - # `organizations/{organization}/locations/{location}/simulations/{simluation}` - # - # @param organization [String] - # @param location [String] - # @param simluation [String] - # - # @return [::String] - def simulation_path **args - resources = { - "organization:simulation" => (proc do |organization:, simulation:| - raise ::ArgumentError, "organization cannot contain /" if organization.to_s.include? "/" - - "organizations/#{organization}/simulations/#{simulation}" - end), - "location:organization:simluation" => (proc do |organization:, location:, simluation:| - raise ::ArgumentError, "organization cannot contain /" if organization.to_s.include? "/" - raise ::ArgumentError, "location cannot contain /" if location.to_s.include? "/" - - "organizations/#{organization}/locations/#{location}/simulations/#{simluation}" - 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 Source resource string. - # - # @overload source_path(organization:, source:) - # The resource will be in the following format: - # - # `organizations/{organization}/sources/{source}` - # - # @param organization [String] - # @param source [String] - # - # @overload source_path(folder:, source:) - # The resource will be in the following format: - # - # `folders/{folder}/sources/{source}` - # - # @param folder [String] - # @param source [String] - # - # @overload source_path(project:, source:) - # The resource will be in the following format: - # - # `projects/{project}/sources/{source}` - # - # @param project [String] - # @param source [String] - # - # @return [::String] - def source_path **args - resources = { - "organization:source" => (proc do |organization:, source:| - raise ::ArgumentError, "organization cannot contain /" if organization.to_s.include? "/" - - "organizations/#{organization}/sources/#{source}" - end), - "folder:source" => (proc do |folder:, source:| - raise ::ArgumentError, "folder cannot contain /" if folder.to_s.include? "/" - - "folders/#{folder}/sources/#{source}" - end), - "project:source" => (proc do |project:, source:| - raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" - - "projects/#{project}/sources/#{source}" - 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 TableDataProfile resource string. - # - # @overload table_data_profile_path(project:, table_profile:) - # The resource will be in the following format: - # - # `projects/{project}/tableProfiles/{table_profile}` - # - # @param project [String] - # @param table_profile [String] - # - # @overload table_data_profile_path(project:, location:, table_profile:) - # The resource will be in the following format: - # - # `projects/{project}/locations/{location}/tableProfiles/{table_profile}` - # - # @param project [String] - # @param location [String] - # @param table_profile [String] - # - # @return [::String] - def table_data_profile_path **args - resources = { - "project:table_profile" => (proc do |project:, table_profile:| - raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" - - "projects/#{project}/tableProfiles/#{table_profile}" - end), - "location:project:table_profile" => (proc do |project:, location:, table_profile:| - raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" - raise ::ArgumentError, "location cannot contain /" if location.to_s.include? "/" - - "projects/#{project}/locations/#{location}/tableProfiles/#{table_profile}" - end) - } - - resource = resources[args.keys.sort.join(":")] - raise ::ArgumentError, "no resource found for values #{args.keys}" if resource.nil? - resource.call(**args) - end - - ## - # Create a fully-qualified Topic resource string. - # - # The resource will be in the following format: - # - # `projects/{project}/topics/{topic}` - # - # @param project [String] - # @param topic [String] - # - # @return [::String] - def topic_path project:, topic: - raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" - - "projects/#{project}/topics/#{topic}" - end - - ## - # Create a fully-qualified ValuedResource resource string. - # - # @overload valued_resource_path(organization:, simulation:, valued_resource:) - # The resource will be in the following format: - # - # `organizations/{organization}/simulations/{simulation}/valuedResources/{valued_resource}` - # - # @param organization [String] - # @param simulation [String] - # @param valued_resource [String] - # - # @overload valued_resource_path(organization:, location:, simluation:, valued_resource:) - # The resource will be in the following format: - # - # `organizations/{organization}/locations/{location}/simulations/{simluation}/valuedResources/{valued_resource}` - # - # @param organization [String] - # @param location [String] - # @param simluation [String] - # @param valued_resource [String] - # - # @return [::String] - def valued_resource_path **args - resources = { - "organization:simulation:valued_resource" => (proc do |organization:, simulation:, valued_resource:| - raise ::ArgumentError, "organization cannot contain /" if organization.to_s.include? "/" - raise ::ArgumentError, "simulation cannot contain /" if simulation.to_s.include? "/" - - "organizations/#{organization}/simulations/#{simulation}/valuedResources/#{valued_resource}" - end), - "location:organization:simluation:valued_resource" => (proc do |organization:, location:, simluation:, valued_resource:| - raise ::ArgumentError, "organization cannot contain /" if organization.to_s.include? "/" - raise ::ArgumentError, "location cannot contain /" if location.to_s.include? "/" - raise ::ArgumentError, "simluation cannot contain /" if simluation.to_s.include? "/" - - "organizations/#{organization}/locations/#{location}/simulations/#{simluation}/valuedResources/#{valued_resource}" - 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 -end diff --git a/owl-bot-staging/google-cloud-security_center-v2/lib/google/cloud/security_center/v2/security_center/rest.rb b/owl-bot-staging/google-cloud-security_center-v2/lib/google/cloud/security_center/v2/security_center/rest.rb deleted file mode 100644 index f11c34c53b84..000000000000 --- a/owl-bot-staging/google-cloud-security_center-v2/lib/google/cloud/security_center/v2/security_center/rest.rb +++ /dev/null @@ -1,53 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -require "gapic/rest" -require "gapic/config" -require "gapic/config/method" - -require "google/cloud/security_center/v2/version" - -require "google/cloud/security_center/v2/security_center/credentials" -require "google/cloud/security_center/v2/security_center/paths" -require "google/cloud/security_center/v2/security_center/rest/operations" -require "google/cloud/security_center/v2/security_center/rest/client" - -module Google - module Cloud - module SecurityCenter - module V2 - ## - # V2 APIs for Security Center service. - # - # To load this service and instantiate a REST client: - # - # require "google/cloud/security_center/v2/security_center/rest" - # client = ::Google::Cloud::SecurityCenter::V2::SecurityCenter::Rest::Client.new - # - module SecurityCenter - # Client for the REST transport - module Rest - end - end - end - end - end -end - -helper_path = ::File.join __dir__, "rest", "helpers.rb" -require "google/cloud/security_center/v2/security_center/rest/helpers" if ::File.file? helper_path diff --git a/owl-bot-staging/google-cloud-security_center-v2/lib/google/cloud/security_center/v2/security_center/rest/client.rb b/owl-bot-staging/google-cloud-security_center-v2/lib/google/cloud/security_center/v2/security_center/rest/client.rb deleted file mode 100644 index 061e60497651..000000000000 --- a/owl-bot-staging/google-cloud-security_center-v2/lib/google/cloud/security_center/v2/security_center/rest/client.rb +++ /dev/null @@ -1,4393 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -require "google/cloud/errors" -require "google/cloud/securitycenter/v2/securitycenter_service_pb" -require "google/cloud/security_center/v2/security_center/rest/service_stub" - -module Google - module Cloud - module SecurityCenter - module V2 - module SecurityCenter - module Rest - ## - # REST client for the SecurityCenter service. - # - # V2 APIs for Security Center service. - # - class Client - # @private - API_VERSION = "" - - # @private - DEFAULT_ENDPOINT_TEMPLATE = "securitycenter.$UNIVERSE_DOMAIN$" - - include Paths - - # @private - attr_reader :security_center_stub - - ## - # Configure the SecurityCenter Client class. - # - # See {::Google::Cloud::SecurityCenter::V2::SecurityCenter::Rest::Client::Configuration} - # for a description of the configuration fields. - # - # @example - # - # # Modify the configuration for all SecurityCenter clients - # ::Google::Cloud::SecurityCenter::V2::SecurityCenter::Rest::Client.configure do |config| - # config.timeout = 10.0 - # end - # - # @yield [config] Configure the Client client. - # @yieldparam config [Client::Configuration] - # - # @return [Client::Configuration] - # - def self.configure - @configure ||= begin - namespace = ["Google", "Cloud", "SecurityCenter", "V2"] - parent_config = while namespace.any? - parent_name = namespace.join "::" - parent_const = const_get parent_name - break parent_const.configure if parent_const.respond_to? :configure - namespace.pop - end - default_config = Client::Configuration.new parent_config - - default_config - end - yield @configure if block_given? - @configure - end - - ## - # Configure the SecurityCenter Client instance. - # - # The configuration is set to the derived mode, meaning that values can be changed, - # but structural changes (adding new fields, etc.) are not allowed. Structural changes - # should be made on {Client.configure}. - # - # See {::Google::Cloud::SecurityCenter::V2::SecurityCenter::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 - @security_center_stub.universe_domain - end - - ## - # Create a new SecurityCenter REST client object. - # - # @example - # - # # Create a client using the default configuration - # client = ::Google::Cloud::SecurityCenter::V2::SecurityCenter::Rest::Client.new - # - # # Create a client using a custom configuration - # client = ::Google::Cloud::SecurityCenter::V2::SecurityCenter::Rest::Client.new do |config| - # config.timeout = 10.0 - # end - # - # @yield [config] Configure the SecurityCenter client. - # @yieldparam config [Client::Configuration] - # - def initialize - # Create the configuration object - @config = Configuration.new Client.configure - - # Yield the configuration if needed - yield @config if block_given? - - # Create credentials - credentials = @config.credentials - # Use self-signed JWT if the endpoint is unchanged from default, - # but only if the default endpoint does not have a region prefix. - enable_self_signed_jwt = @config.endpoint.nil? || - (@config.endpoint == Configuration::DEFAULT_ENDPOINT && - !@config.endpoint.split(".").first.include?("-")) - credentials ||= Credentials.default scope: @config.scope, - enable_self_signed_jwt: enable_self_signed_jwt - if credentials.is_a?(::String) || credentials.is_a?(::Hash) - credentials = Credentials.new credentials, scope: @config.scope - end - - @quota_project_id = @config.quota_project - @quota_project_id ||= credentials.quota_project_id if credentials.respond_to? :quota_project_id - - @operations_client = ::Google::Cloud::SecurityCenter::V2::SecurityCenter::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 - - @security_center_stub = ::Google::Cloud::SecurityCenter::V2::SecurityCenter::Rest::ServiceStub.new( - endpoint: @config.endpoint, - endpoint_template: DEFAULT_ENDPOINT_TEMPLATE, - universe_domain: @config.universe_domain, - credentials: credentials, - logger: @config.logger - ) - - @security_center_stub.logger(stub: true)&.info do |entry| - entry.set_system_name - entry.set_service - entry.message = "Created client for #{entry.service}" - entry.set_credentials_fields credentials - entry.set "customEndpoint", @config.endpoint if @config.endpoint - entry.set "defaultTimeout", @config.timeout if @config.timeout - entry.set "quotaProject", @quota_project_id if @quota_project_id - end - end - - ## - # Get the associated client for long-running operations. - # - # @return [::Google::Cloud::SecurityCenter::V2::SecurityCenter::Rest::Operations] - # - attr_reader :operations_client - - ## - # The logger used for request/response debug logging. - # - # @return [Logger] - # - def logger - @security_center_stub.logger - end - - # Service calls - - ## - # Creates a ResourceValueConfig for an organization. Maps user's tags to - # difference resource values for use by the attack path simulation. - # - # @overload batch_create_resource_value_configs(request, options = nil) - # Pass arguments to `batch_create_resource_value_configs` via a request object, either of type - # {::Google::Cloud::SecurityCenter::V2::BatchCreateResourceValueConfigsRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::SecurityCenter::V2::BatchCreateResourceValueConfigsRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @overload batch_create_resource_value_configs(parent: nil, requests: nil) - # Pass arguments to `batch_create_resource_value_configs` via keyword arguments. Note that at - # least one keyword argument is 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. Resource name of the new ResourceValueConfig's parent. - # The parent field in the CreateResourceValueConfigRequest - # messages must either be empty or match this field. - # @param requests [::Array<::Google::Cloud::SecurityCenter::V2::CreateResourceValueConfigRequest, ::Hash>] - # Required. The resource value configs to be created. - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Cloud::SecurityCenter::V2::BatchCreateResourceValueConfigsResponse] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::SecurityCenter::V2::BatchCreateResourceValueConfigsResponse] - # - # @raise [::Google::Cloud::Error] if the REST call is aborted. - # - # @example Basic example - # require "google/cloud/security_center/v2" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::SecurityCenter::V2::SecurityCenter::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::SecurityCenter::V2::BatchCreateResourceValueConfigsRequest.new - # - # # Call the batch_create_resource_value_configs method. - # result = client.batch_create_resource_value_configs request - # - # # The returned object is of type Google::Cloud::SecurityCenter::V2::BatchCreateResourceValueConfigsResponse. - # p result - # - def batch_create_resource_value_configs request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::SecurityCenter::V2::BatchCreateResourceValueConfigsRequest - - # Converts hash 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.batch_create_resource_value_configs.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::SecurityCenter::V2::VERSION, - transports_version_send: [:rest] - - call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - options.apply_defaults timeout: @config.rpcs.batch_create_resource_value_configs.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.batch_create_resource_value_configs.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @security_center_stub.batch_create_resource_value_configs 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 - - ## - # Kicks off an LRO to bulk mute findings for a parent based on a filter. If - # no location is specified, findings are muted in global. The parent - # can be either an organization, folder, or project. The findings matched by - # the filter will be muted after the LRO is done. - # - # @overload bulk_mute_findings(request, options = nil) - # Pass arguments to `bulk_mute_findings` via a request object, either of type - # {::Google::Cloud::SecurityCenter::V2::BulkMuteFindingsRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::SecurityCenter::V2::BulkMuteFindingsRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @overload bulk_mute_findings(parent: nil, filter: nil, mute_state: nil) - # Pass arguments to `bulk_mute_findings` via keyword arguments. Note that at - # least one keyword argument is 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, at which bulk action needs to be applied. If no - # location is specified, findings are updated in global. The following list - # shows some examples: - # - # + `organizations/[organization_id]` - # + `organizations/[organization_id]/locations/[location_id]` - # + `folders/[folder_id]` - # + `folders/[folder_id]/locations/[location_id]` - # + `projects/[project_id]` - # + `projects/[project_id]/locations/[location_id]` - # @param filter [::String] - # Expression that identifies findings that should be updated. - # The expression is a list of zero or more restrictions combined - # via logical operators `AND` and `OR`. Parentheses are supported, and `OR` - # has higher precedence than `AND`. - # - # Restrictions have the form ` ` and may have a - # `-` character in front of them to indicate negation. The fields map to - # those defined in the corresponding resource. - # - # The supported operators are: - # - # * `=` for all value types. - # * `>`, `<`, `>=`, `<=` for integer values. - # * `:`, meaning substring matching, for strings. - # - # The supported value types are: - # - # * string literals in quotes. - # * integer literals without quotes. - # * boolean literals `true` and `false` without quotes. - # @param mute_state [::Google::Cloud::SecurityCenter::V2::BulkMuteFindingsRequest::MuteState] - # Optional. All findings matching the given filter will have their mute state - # set to this value. The default value is `MUTED`. Setting this to - # `UNDEFINED` will clear the mute state on all matching findings. - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Gapic::Operation] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Gapic::Operation] - # - # @raise [::Google::Cloud::Error] if the REST call is aborted. - # - # @example Basic example - # require "google/cloud/security_center/v2" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::SecurityCenter::V2::SecurityCenter::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::SecurityCenter::V2::BulkMuteFindingsRequest.new - # - # # Call the bulk_mute_findings method. - # result = client.bulk_mute_findings 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 bulk_mute_findings request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::SecurityCenter::V2::BulkMuteFindingsRequest - - # Converts hash 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.bulk_mute_findings.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::SecurityCenter::V2::VERSION, - transports_version_send: [:rest] - - call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - options.apply_defaults timeout: @config.rpcs.bulk_mute_findings.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.bulk_mute_findings.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @security_center_stub.bulk_mute_findings 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 - - ## - # Creates a BigQuery export. - # - # @overload create_big_query_export(request, options = nil) - # Pass arguments to `create_big_query_export` via a request object, either of type - # {::Google::Cloud::SecurityCenter::V2::CreateBigQueryExportRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::SecurityCenter::V2::CreateBigQueryExportRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_big_query_export(parent: nil, big_query_export: nil, big_query_export_id: nil) - # Pass arguments to `create_big_query_export` via keyword arguments. Note that at - # least one keyword argument is 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 name of the parent resource of the new BigQuery export. Its - # format is `organizations/[organization_id]/locations/[location_id]`, - # `folders/[folder_id]/locations/[location_id]`, or - # `projects/[project_id]/locations/[location_id]`. - # @param big_query_export [::Google::Cloud::SecurityCenter::V2::BigQueryExport, ::Hash] - # Required. The BigQuery export being created. - # @param big_query_export_id [::String] - # Required. Unique identifier provided by the client within the parent scope. - # It must consist of only lowercase letters, numbers, and hyphens, must start - # with a letter, must end with either a letter or a number, and must be 63 - # characters or less. - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Cloud::SecurityCenter::V2::BigQueryExport] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::SecurityCenter::V2::BigQueryExport] - # - # @raise [::Google::Cloud::Error] if the REST call is aborted. - # - # @example Basic example - # require "google/cloud/security_center/v2" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::SecurityCenter::V2::SecurityCenter::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::SecurityCenter::V2::CreateBigQueryExportRequest.new - # - # # Call the create_big_query_export method. - # result = client.create_big_query_export request - # - # # The returned object is of type Google::Cloud::SecurityCenter::V2::BigQueryExport. - # p result - # - def create_big_query_export request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::SecurityCenter::V2::CreateBigQueryExportRequest - - # Converts hash 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_big_query_export.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::SecurityCenter::V2::VERSION, - transports_version_send: [:rest] - - call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - options.apply_defaults timeout: @config.rpcs.create_big_query_export.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.create_big_query_export.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @security_center_stub.create_big_query_export request, options do |result, operation| - yield result, operation if block_given? - end - rescue ::Gapic::Rest::Error => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Creates a finding in a location. The corresponding source must exist for - # finding creation to succeed. - # - # @overload create_finding(request, options = nil) - # Pass arguments to `create_finding` via a request object, either of type - # {::Google::Cloud::SecurityCenter::V2::CreateFindingRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::SecurityCenter::V2::CreateFindingRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_finding(parent: nil, finding_id: nil, finding: nil) - # Pass arguments to `create_finding` via keyword arguments. Note that at - # least one keyword argument is 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. Resource name of the new finding's parent. The following list - # shows some examples of the format: - # + - # `organizations/[organization_id]/sources/[source_id]` - # + - # `organizations/[organization_id]/sources/[source_id]/locations/[location_id]` - # @param finding_id [::String] - # Required. Unique identifier provided by the client within the parent scope. - # It must be alphanumeric and less than or equal to 32 characters and - # greater than 0 characters in length. - # @param finding [::Google::Cloud::SecurityCenter::V2::Finding, ::Hash] - # Required. The Finding being created. The name and security_marks will be - # ignored as they are both output only fields on this resource. - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Cloud::SecurityCenter::V2::Finding] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::SecurityCenter::V2::Finding] - # - # @raise [::Google::Cloud::Error] if the REST call is aborted. - # - # @example Basic example - # require "google/cloud/security_center/v2" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::SecurityCenter::V2::SecurityCenter::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::SecurityCenter::V2::CreateFindingRequest.new - # - # # Call the create_finding method. - # result = client.create_finding request - # - # # The returned object is of type Google::Cloud::SecurityCenter::V2::Finding. - # p result - # - def create_finding request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::SecurityCenter::V2::CreateFindingRequest - - # Converts hash 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_finding.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::SecurityCenter::V2::VERSION, - transports_version_send: [:rest] - - call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - options.apply_defaults timeout: @config.rpcs.create_finding.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.create_finding.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @security_center_stub.create_finding request, options do |result, operation| - yield result, operation if block_given? - end - rescue ::Gapic::Rest::Error => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Creates a mute config. - # - # @overload create_mute_config(request, options = nil) - # Pass arguments to `create_mute_config` via a request object, either of type - # {::Google::Cloud::SecurityCenter::V2::CreateMuteConfigRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::SecurityCenter::V2::CreateMuteConfigRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_mute_config(parent: nil, mute_config: nil, mute_config_id: nil) - # Pass arguments to `create_mute_config` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param parent [::String] - # Required. Resource name of the new mute configs's parent. Its format is - # `organizations/[organization_id]/locations/[location_id]`, - # `folders/[folder_id]/locations/[location_id]`, or - # `projects/[project_id]/locations/[location_id]`. - # @param mute_config [::Google::Cloud::SecurityCenter::V2::MuteConfig, ::Hash] - # Required. The mute config being created. - # @param mute_config_id [::String] - # Required. Unique identifier provided by the client within the parent scope. - # It must consist of only lowercase letters, numbers, and hyphens, must start - # with a letter, must end with either a letter or a number, and must be 63 - # characters or less. - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Cloud::SecurityCenter::V2::MuteConfig] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::SecurityCenter::V2::MuteConfig] - # - # @raise [::Google::Cloud::Error] if the REST call is aborted. - # - # @example Basic example - # require "google/cloud/security_center/v2" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::SecurityCenter::V2::SecurityCenter::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::SecurityCenter::V2::CreateMuteConfigRequest.new - # - # # Call the create_mute_config method. - # result = client.create_mute_config request - # - # # The returned object is of type Google::Cloud::SecurityCenter::V2::MuteConfig. - # p result - # - def create_mute_config request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::SecurityCenter::V2::CreateMuteConfigRequest - - # Converts hash 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_mute_config.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::SecurityCenter::V2::VERSION, - transports_version_send: [:rest] - - call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - options.apply_defaults timeout: @config.rpcs.create_mute_config.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.create_mute_config.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @security_center_stub.create_mute_config request, options do |result, operation| - yield result, operation if block_given? - end - rescue ::Gapic::Rest::Error => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Creates a notification config. - # - # @overload create_notification_config(request, options = nil) - # Pass arguments to `create_notification_config` via a request object, either of type - # {::Google::Cloud::SecurityCenter::V2::CreateNotificationConfigRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::SecurityCenter::V2::CreateNotificationConfigRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_notification_config(parent: nil, config_id: nil, notification_config: nil) - # Pass arguments to `create_notification_config` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param parent [::String] - # Required. Resource name of the new notification config's parent. Its format - # is `organizations/[organization_id]/locations/[location_id]`, - # `folders/[folder_id]/locations/[location_id]`, or - # `projects/[project_id]/locations/[location_id]`. - # @param config_id [::String] - # Required. - # Unique identifier provided by the client within the parent scope. - # It must be between 1 and 128 characters and contain alphanumeric - # characters, underscores, or hyphens only. - # @param notification_config [::Google::Cloud::SecurityCenter::V2::NotificationConfig, ::Hash] - # Required. The notification config being created. The name and the service - # account will be ignored as they are both output only fields on this - # resource. - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Cloud::SecurityCenter::V2::NotificationConfig] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::SecurityCenter::V2::NotificationConfig] - # - # @raise [::Google::Cloud::Error] if the REST call is aborted. - # - # @example Basic example - # require "google/cloud/security_center/v2" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::SecurityCenter::V2::SecurityCenter::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::SecurityCenter::V2::CreateNotificationConfigRequest.new - # - # # Call the create_notification_config method. - # result = client.create_notification_config request - # - # # The returned object is of type Google::Cloud::SecurityCenter::V2::NotificationConfig. - # p result - # - def create_notification_config request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::SecurityCenter::V2::CreateNotificationConfigRequest - - # Converts hash 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_notification_config.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::SecurityCenter::V2::VERSION, - transports_version_send: [:rest] - - call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - options.apply_defaults timeout: @config.rpcs.create_notification_config.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.create_notification_config.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @security_center_stub.create_notification_config request, options do |result, operation| - yield result, operation if block_given? - end - rescue ::Gapic::Rest::Error => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Creates a source. - # - # @overload create_source(request, options = nil) - # Pass arguments to `create_source` via a request object, either of type - # {::Google::Cloud::SecurityCenter::V2::CreateSourceRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::SecurityCenter::V2::CreateSourceRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_source(parent: nil, source: nil) - # Pass arguments to `create_source` via keyword arguments. Note that at - # least one keyword argument is 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. Resource name of the new source's parent. Its format should be - # `organizations/[organization_id]`. - # @param source [::Google::Cloud::SecurityCenter::V2::Source, ::Hash] - # Required. The Source being created, only the display_name and description - # will be used. All other fields will be ignored. - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Cloud::SecurityCenter::V2::Source] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::SecurityCenter::V2::Source] - # - # @raise [::Google::Cloud::Error] if the REST call is aborted. - # - # @example Basic example - # require "google/cloud/security_center/v2" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::SecurityCenter::V2::SecurityCenter::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::SecurityCenter::V2::CreateSourceRequest.new - # - # # Call the create_source method. - # result = client.create_source request - # - # # The returned object is of type Google::Cloud::SecurityCenter::V2::Source. - # p result - # - def create_source request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::SecurityCenter::V2::CreateSourceRequest - - # Converts hash 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_source.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::SecurityCenter::V2::VERSION, - transports_version_send: [:rest] - - call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - options.apply_defaults timeout: @config.rpcs.create_source.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.create_source.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @security_center_stub.create_source request, options do |result, operation| - yield result, operation if block_given? - end - rescue ::Gapic::Rest::Error => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Deletes an existing BigQuery export. - # - # @overload delete_big_query_export(request, options = nil) - # Pass arguments to `delete_big_query_export` via a request object, either of type - # {::Google::Cloud::SecurityCenter::V2::DeleteBigQueryExportRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::SecurityCenter::V2::DeleteBigQueryExportRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_big_query_export(name: nil) - # Pass arguments to `delete_big_query_export` via keyword arguments. Note that at - # least one keyword argument is 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 BigQuery export to delete. The following list - # shows some examples of the format: - # - # + - # `organizations/{organization}/locations/{location}/bigQueryExports/{export_id}` - # + `folders/{folder}/locations/{location}/bigQueryExports/{export_id}` - # + `projects/{project}/locations/{location}/bigQueryExports/{export_id}` - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Protobuf::Empty] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Protobuf::Empty] - # - # @raise [::Google::Cloud::Error] if the REST call is aborted. - # - # @example Basic example - # require "google/cloud/security_center/v2" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::SecurityCenter::V2::SecurityCenter::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::SecurityCenter::V2::DeleteBigQueryExportRequest.new - # - # # Call the delete_big_query_export method. - # result = client.delete_big_query_export request - # - # # The returned object is of type Google::Protobuf::Empty. - # p result - # - def delete_big_query_export request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::SecurityCenter::V2::DeleteBigQueryExportRequest - - # Converts hash 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_big_query_export.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::SecurityCenter::V2::VERSION, - transports_version_send: [:rest] - - call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - options.apply_defaults timeout: @config.rpcs.delete_big_query_export.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.delete_big_query_export.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @security_center_stub.delete_big_query_export request, options do |result, operation| - yield result, operation if block_given? - end - rescue ::Gapic::Rest::Error => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Deletes an existing mute config. If no location is specified, default is - # global. - # - # @overload delete_mute_config(request, options = nil) - # Pass arguments to `delete_mute_config` via a request object, either of type - # {::Google::Cloud::SecurityCenter::V2::DeleteMuteConfigRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::SecurityCenter::V2::DeleteMuteConfigRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_mute_config(name: nil) - # Pass arguments to `delete_mute_config` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param name [::String] - # Required. Name of the mute config to delete. The following list shows some - # examples of the format: - # - # + `organizations/{organization}/muteConfigs/{config_id}` - # + - # `organizations/{organization}/locations/{location}/muteConfigs/{config_id}` - # + `folders/{folder}/muteConfigs/{config_id}` - # + `folders/{folder}/locations/{location}/muteConfigs/{config_id}` - # + `projects/{project}/muteConfigs/{config_id}` - # + `projects/{project}/locations/{location}/muteConfigs/{config_id}` - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Protobuf::Empty] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Protobuf::Empty] - # - # @raise [::Google::Cloud::Error] if the REST call is aborted. - # - # @example Basic example - # require "google/cloud/security_center/v2" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::SecurityCenter::V2::SecurityCenter::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::SecurityCenter::V2::DeleteMuteConfigRequest.new - # - # # Call the delete_mute_config method. - # result = client.delete_mute_config request - # - # # The returned object is of type Google::Protobuf::Empty. - # p result - # - def delete_mute_config request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::SecurityCenter::V2::DeleteMuteConfigRequest - - # Converts hash 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_mute_config.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::SecurityCenter::V2::VERSION, - transports_version_send: [:rest] - - call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - options.apply_defaults timeout: @config.rpcs.delete_mute_config.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.delete_mute_config.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @security_center_stub.delete_mute_config request, options do |result, operation| - yield result, operation if block_given? - end - rescue ::Gapic::Rest::Error => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Deletes a notification config. - # - # @overload delete_notification_config(request, options = nil) - # Pass arguments to `delete_notification_config` via a request object, either of type - # {::Google::Cloud::SecurityCenter::V2::DeleteNotificationConfigRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::SecurityCenter::V2::DeleteNotificationConfigRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_notification_config(name: nil) - # Pass arguments to `delete_notification_config` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param name [::String] - # Required. Name of the notification config to delete. The following list - # shows some examples of the format: - # - # + - # `organizations/[organization_id]/locations/[location_id]/notificationConfigs/[config_id]` - # + - # `folders/[folder_id]/locations/[location_id]notificationConfigs/[config_id]` - # + - # `projects/[project_id]/locations/[location_id]notificationConfigs/[config_id]` - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Protobuf::Empty] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Protobuf::Empty] - # - # @raise [::Google::Cloud::Error] if the REST call is aborted. - # - # @example Basic example - # require "google/cloud/security_center/v2" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::SecurityCenter::V2::SecurityCenter::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::SecurityCenter::V2::DeleteNotificationConfigRequest.new - # - # # Call the delete_notification_config method. - # result = client.delete_notification_config request - # - # # The returned object is of type Google::Protobuf::Empty. - # p result - # - def delete_notification_config request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::SecurityCenter::V2::DeleteNotificationConfigRequest - - # Converts hash 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_notification_config.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::SecurityCenter::V2::VERSION, - transports_version_send: [:rest] - - call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - options.apply_defaults timeout: @config.rpcs.delete_notification_config.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.delete_notification_config.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @security_center_stub.delete_notification_config request, options do |result, operation| - yield result, operation if block_given? - end - rescue ::Gapic::Rest::Error => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Deletes a ResourceValueConfig. - # - # @overload delete_resource_value_config(request, options = nil) - # Pass arguments to `delete_resource_value_config` via a request object, either of type - # {::Google::Cloud::SecurityCenter::V2::DeleteResourceValueConfigRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::SecurityCenter::V2::DeleteResourceValueConfigRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_resource_value_config(name: nil) - # Pass arguments to `delete_resource_value_config` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param name [::String] - # Required. Name of the ResourceValueConfig to delete - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Protobuf::Empty] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Protobuf::Empty] - # - # @raise [::Google::Cloud::Error] if the REST call is aborted. - # - # @example Basic example - # require "google/cloud/security_center/v2" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::SecurityCenter::V2::SecurityCenter::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::SecurityCenter::V2::DeleteResourceValueConfigRequest.new - # - # # Call the delete_resource_value_config method. - # result = client.delete_resource_value_config request - # - # # The returned object is of type Google::Protobuf::Empty. - # p result - # - def delete_resource_value_config request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::SecurityCenter::V2::DeleteResourceValueConfigRequest - - # Converts hash 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_resource_value_config.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::SecurityCenter::V2::VERSION, - transports_version_send: [:rest] - - call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - options.apply_defaults timeout: @config.rpcs.delete_resource_value_config.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.delete_resource_value_config.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @security_center_stub.delete_resource_value_config request, options do |result, operation| - yield result, operation if block_given? - end - rescue ::Gapic::Rest::Error => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Gets a BigQuery export. - # - # @overload get_big_query_export(request, options = nil) - # Pass arguments to `get_big_query_export` via a request object, either of type - # {::Google::Cloud::SecurityCenter::V2::GetBigQueryExportRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::SecurityCenter::V2::GetBigQueryExportRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_big_query_export(name: nil) - # Pass arguments to `get_big_query_export` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param name [::String] - # Required. Name of the BigQuery export to retrieve. The following list shows - # some examples of the format: - # - # + - # `organizations/{organization}/locations/{location}/bigQueryExports/{export_id}` - # + `folders/{folder}/locations/{location}/bigQueryExports/{export_id}` - # + `projects/{project}locations/{location}//bigQueryExports/{export_id}` - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Cloud::SecurityCenter::V2::BigQueryExport] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::SecurityCenter::V2::BigQueryExport] - # - # @raise [::Google::Cloud::Error] if the REST call is aborted. - # - # @example Basic example - # require "google/cloud/security_center/v2" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::SecurityCenter::V2::SecurityCenter::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::SecurityCenter::V2::GetBigQueryExportRequest.new - # - # # Call the get_big_query_export method. - # result = client.get_big_query_export request - # - # # The returned object is of type Google::Cloud::SecurityCenter::V2::BigQueryExport. - # p result - # - def get_big_query_export request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::SecurityCenter::V2::GetBigQueryExportRequest - - # Converts hash 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_big_query_export.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::SecurityCenter::V2::VERSION, - transports_version_send: [:rest] - - call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - options.apply_defaults timeout: @config.rpcs.get_big_query_export.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.get_big_query_export.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @security_center_stub.get_big_query_export 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 - - ## - # Get the simulation by name or the latest simulation for the given - # organization. - # - # @overload get_simulation(request, options = nil) - # Pass arguments to `get_simulation` via a request object, either of type - # {::Google::Cloud::SecurityCenter::V2::GetSimulationRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::SecurityCenter::V2::GetSimulationRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_simulation(name: nil) - # Pass arguments to `get_simulation` via keyword arguments. Note that at - # least one keyword argument is 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 organization name or simulation name of this simulation - # - # Valid format: - # `organizations/{organization}/simulations/latest` - # `organizations/{organization}/simulations/{simulation}` - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Cloud::SecurityCenter::V2::Simulation] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::SecurityCenter::V2::Simulation] - # - # @raise [::Google::Cloud::Error] if the REST call is aborted. - # - # @example Basic example - # require "google/cloud/security_center/v2" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::SecurityCenter::V2::SecurityCenter::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::SecurityCenter::V2::GetSimulationRequest.new - # - # # Call the get_simulation method. - # result = client.get_simulation request - # - # # The returned object is of type Google::Cloud::SecurityCenter::V2::Simulation. - # p result - # - def get_simulation request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::SecurityCenter::V2::GetSimulationRequest - - # Converts hash 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_simulation.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::SecurityCenter::V2::VERSION, - transports_version_send: [:rest] - - call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - options.apply_defaults timeout: @config.rpcs.get_simulation.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.get_simulation.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @security_center_stub.get_simulation 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 - - ## - # Get the valued resource by name - # - # @overload get_valued_resource(request, options = nil) - # Pass arguments to `get_valued_resource` via a request object, either of type - # {::Google::Cloud::SecurityCenter::V2::GetValuedResourceRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::SecurityCenter::V2::GetValuedResourceRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_valued_resource(name: nil) - # Pass arguments to `get_valued_resource` via keyword arguments. Note that at - # least one keyword argument is 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 this valued resource - # - # Valid format: - # `organizations/{organization}/simulations/{simulation}/valuedResources/{valued_resource}` - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Cloud::SecurityCenter::V2::ValuedResource] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::SecurityCenter::V2::ValuedResource] - # - # @raise [::Google::Cloud::Error] if the REST call is aborted. - # - # @example Basic example - # require "google/cloud/security_center/v2" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::SecurityCenter::V2::SecurityCenter::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::SecurityCenter::V2::GetValuedResourceRequest.new - # - # # Call the get_valued_resource method. - # result = client.get_valued_resource request - # - # # The returned object is of type Google::Cloud::SecurityCenter::V2::ValuedResource. - # p result - # - def get_valued_resource request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::SecurityCenter::V2::GetValuedResourceRequest - - # Converts hash 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_valued_resource.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::SecurityCenter::V2::VERSION, - transports_version_send: [:rest] - - call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - options.apply_defaults timeout: @config.rpcs.get_valued_resource.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.get_valued_resource.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @security_center_stub.get_valued_resource request, options do |result, operation| - yield result, operation if block_given? - end - rescue ::Gapic::Rest::Error => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Gets the access control policy on the specified Source. - # - # @overload get_iam_policy(request, options = nil) - # Pass arguments to `get_iam_policy` via a request object, either of type - # {::Google::Iam::V1::GetIamPolicyRequest} or an equivalent Hash. - # - # @param request [::Google::Iam::V1::GetIamPolicyRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @overload get_iam_policy(resource: nil, options: nil) - # Pass arguments to `get_iam_policy` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param resource [::String] - # REQUIRED: The resource for which the policy is being requested. - # See the operation documentation for the appropriate value for this field. - # @param options [::Google::Iam::V1::GetPolicyOptions, ::Hash] - # OPTIONAL: A `GetPolicyOptions` object for specifying options to - # `GetIamPolicy`. - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Iam::V1::Policy] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Iam::V1::Policy] - # - # @raise [::Google::Cloud::Error] if the REST call is aborted. - # - # @example Basic example - # require "google/cloud/security_center/v2" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::SecurityCenter::V2::SecurityCenter::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Iam::V1::GetIamPolicyRequest.new - # - # # Call the get_iam_policy method. - # result = client.get_iam_policy request - # - # # The returned object is of type Google::Iam::V1::Policy. - # p result - # - def get_iam_policy request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Iam::V1::GetIamPolicyRequest - - # Converts hash and nil to an options object - options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h - - # Customize the options with defaults - call_metadata = @config.rpcs.get_iam_policy.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::SecurityCenter::V2::VERSION, - transports_version_send: [:rest] - - call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - options.apply_defaults timeout: @config.rpcs.get_iam_policy.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.get_iam_policy.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @security_center_stub.get_iam_policy request, options do |result, operation| - yield result, operation if block_given? - end - rescue ::Gapic::Rest::Error => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Gets a mute config. If no location is specified, default is - # global. - # - # @overload get_mute_config(request, options = nil) - # Pass arguments to `get_mute_config` via a request object, either of type - # {::Google::Cloud::SecurityCenter::V2::GetMuteConfigRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::SecurityCenter::V2::GetMuteConfigRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_mute_config(name: nil) - # Pass arguments to `get_mute_config` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param name [::String] - # Required. Name of the mute config to retrieve. The following list shows - # some examples of the format: - # - # + `organizations/{organization}/muteConfigs/{config_id}` - # + - # `organizations/{organization}/locations/{location}/muteConfigs/{config_id}` - # + `folders/{folder}/muteConfigs/{config_id}` - # + `folders/{folder}/locations/{location}/muteConfigs/{config_id}` - # + `projects/{project}/muteConfigs/{config_id}` - # + `projects/{project}/locations/{location}/muteConfigs/{config_id}` - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Cloud::SecurityCenter::V2::MuteConfig] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::SecurityCenter::V2::MuteConfig] - # - # @raise [::Google::Cloud::Error] if the REST call is aborted. - # - # @example Basic example - # require "google/cloud/security_center/v2" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::SecurityCenter::V2::SecurityCenter::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::SecurityCenter::V2::GetMuteConfigRequest.new - # - # # Call the get_mute_config method. - # result = client.get_mute_config request - # - # # The returned object is of type Google::Cloud::SecurityCenter::V2::MuteConfig. - # p result - # - def get_mute_config request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::SecurityCenter::V2::GetMuteConfigRequest - - # Converts hash 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_mute_config.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::SecurityCenter::V2::VERSION, - transports_version_send: [:rest] - - call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - options.apply_defaults timeout: @config.rpcs.get_mute_config.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.get_mute_config.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @security_center_stub.get_mute_config request, options do |result, operation| - yield result, operation if block_given? - end - rescue ::Gapic::Rest::Error => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Gets a notification config. - # - # @overload get_notification_config(request, options = nil) - # Pass arguments to `get_notification_config` via a request object, either of type - # {::Google::Cloud::SecurityCenter::V2::GetNotificationConfigRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::SecurityCenter::V2::GetNotificationConfigRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_notification_config(name: nil) - # Pass arguments to `get_notification_config` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param name [::String] - # Required. Name of the notification config to get. The following list shows - # some examples of the format: - # - # + - # `organizations/[organization_id]/locations/[location_id]/notificationConfigs/[config_id]` - # + - # `folders/[folder_id]/locations/[location_id]/notificationConfigs/[config_id]` - # + - # `projects/[project_id]/locations/[location_id]/notificationConfigs/[config_id]` - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Cloud::SecurityCenter::V2::NotificationConfig] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::SecurityCenter::V2::NotificationConfig] - # - # @raise [::Google::Cloud::Error] if the REST call is aborted. - # - # @example Basic example - # require "google/cloud/security_center/v2" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::SecurityCenter::V2::SecurityCenter::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::SecurityCenter::V2::GetNotificationConfigRequest.new - # - # # Call the get_notification_config method. - # result = client.get_notification_config request - # - # # The returned object is of type Google::Cloud::SecurityCenter::V2::NotificationConfig. - # p result - # - def get_notification_config request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::SecurityCenter::V2::GetNotificationConfigRequest - - # Converts hash 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_notification_config.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::SecurityCenter::V2::VERSION, - transports_version_send: [:rest] - - call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - options.apply_defaults timeout: @config.rpcs.get_notification_config.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.get_notification_config.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @security_center_stub.get_notification_config request, options do |result, operation| - yield result, operation if block_given? - end - rescue ::Gapic::Rest::Error => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Gets a ResourceValueConfig. - # - # @overload get_resource_value_config(request, options = nil) - # Pass arguments to `get_resource_value_config` via a request object, either of type - # {::Google::Cloud::SecurityCenter::V2::GetResourceValueConfigRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::SecurityCenter::V2::GetResourceValueConfigRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_resource_value_config(name: nil) - # Pass arguments to `get_resource_value_config` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param name [::String] - # Required. Name of the resource value config to retrieve. Its format is - # organizations/\\{organization}/resourceValueConfigs/\\{config_id}. - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Cloud::SecurityCenter::V2::ResourceValueConfig] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::SecurityCenter::V2::ResourceValueConfig] - # - # @raise [::Google::Cloud::Error] if the REST call is aborted. - # - # @example Basic example - # require "google/cloud/security_center/v2" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::SecurityCenter::V2::SecurityCenter::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::SecurityCenter::V2::GetResourceValueConfigRequest.new - # - # # Call the get_resource_value_config method. - # result = client.get_resource_value_config request - # - # # The returned object is of type Google::Cloud::SecurityCenter::V2::ResourceValueConfig. - # p result - # - def get_resource_value_config request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::SecurityCenter::V2::GetResourceValueConfigRequest - - # Converts hash 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_resource_value_config.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::SecurityCenter::V2::VERSION, - transports_version_send: [:rest] - - call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - options.apply_defaults timeout: @config.rpcs.get_resource_value_config.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.get_resource_value_config.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @security_center_stub.get_resource_value_config request, options do |result, operation| - yield result, operation if block_given? - end - rescue ::Gapic::Rest::Error => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Gets a source. - # - # @overload get_source(request, options = nil) - # Pass arguments to `get_source` via a request object, either of type - # {::Google::Cloud::SecurityCenter::V2::GetSourceRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::SecurityCenter::V2::GetSourceRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_source(name: nil) - # Pass arguments to `get_source` via keyword arguments. Note that at - # least one keyword argument is 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. Relative resource name of the source. Its format is - # `organizations/[organization_id]/source/[source_id]`. - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Cloud::SecurityCenter::V2::Source] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::SecurityCenter::V2::Source] - # - # @raise [::Google::Cloud::Error] if the REST call is aborted. - # - # @example Basic example - # require "google/cloud/security_center/v2" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::SecurityCenter::V2::SecurityCenter::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::SecurityCenter::V2::GetSourceRequest.new - # - # # Call the get_source method. - # result = client.get_source request - # - # # The returned object is of type Google::Cloud::SecurityCenter::V2::Source. - # p result - # - def get_source request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::SecurityCenter::V2::GetSourceRequest - - # Converts hash 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_source.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::SecurityCenter::V2::VERSION, - transports_version_send: [:rest] - - call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - options.apply_defaults timeout: @config.rpcs.get_source.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.get_source.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @security_center_stub.get_source 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 - - ## - # Filters an organization or source's findings and groups them by their - # specified properties in a location. If no location is specified, findings - # are assumed to be in global - # - # To group across all sources provide a `-` as the source id. - # The following list shows some examples: - # - # + `/v2/organizations/{organization_id}/sources/-/findings` - # + - # `/v2/organizations/{organization_id}/sources/-/locations/{location_id}/findings` - # + `/v2/folders/{folder_id}/sources/-/findings` - # + `/v2/folders/{folder_id}/sources/-/locations/{location_id}/findings` - # + `/v2/projects/{project_id}/sources/-/findings` - # + `/v2/projects/{project_id}/sources/-/locations/{location_id}/findings` - # - # @overload group_findings(request, options = nil) - # Pass arguments to `group_findings` via a request object, either of type - # {::Google::Cloud::SecurityCenter::V2::GroupFindingsRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::SecurityCenter::V2::GroupFindingsRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @overload group_findings(parent: nil, filter: nil, group_by: nil, page_token: nil, page_size: nil) - # Pass arguments to `group_findings` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param parent [::String] - # Required. Name of the source to groupBy. If no location is specified, - # finding is assumed to be in global. - # The following list shows some examples: - # - # + `organizations/[organization_id]/sources/[source_id]` - # + - # `organizations/[organization_id]/sources/[source_id]/locations/[location_id]` - # + `folders/[folder_id]/sources/[source_id]` - # + `folders/[folder_id]/sources/[source_id]/locations/[location_id]` - # + `projects/[project_id]/sources/[source_id]` - # + `projects/[project_id]/sources/[source_id]/locations/[location_id]` - # - # To groupBy across all sources provide a source_id of `-`. The following - # list shows some examples: - # - # + `organizations/{organization_id}/sources/-` - # + `organizations/{organization_id}/sources/-/locations/[location_id]` - # + `folders/{folder_id}/sources/-` - # + `folders/{folder_id}/sources/-/locations/[location_id]` - # + `projects/{project_id}/sources/-` - # + `projects/{project_id}/sources/-/locations/[location_id]` - # @param filter [::String] - # Expression that defines the filter to apply across findings. - # The expression is a list of one or more restrictions combined via logical - # operators `AND` and `OR`. - # Parentheses are supported, and `OR` has higher precedence than `AND`. - # - # Restrictions have the form ` ` and may have a `-` - # character in front of them to indicate negation. Examples include: - # - # * name - # * security_marks.marks.marka - # - # The supported operators are: - # - # * `=` for all value types. - # * `>`, `<`, `>=`, `<=` for integer values. - # * `:`, meaning substring matching, for strings. - # - # The supported value types are: - # - # * string literals in quotes. - # * integer literals without quotes. - # * boolean literals `true` and `false` without quotes. - # - # The following field and operator combinations are supported: - # - # * name: `=` - # * parent: `=`, `:` - # * resource_name: `=`, `:` - # * state: `=`, `:` - # * category: `=`, `:` - # * external_uri: `=`, `:` - # * event_time: `=`, `>`, `<`, `>=`, `<=` - # - # Usage: This should be milliseconds since epoch or an RFC3339 string. - # Examples: - # `event_time = "2019-06-10T16:07:18-07:00"` - # `event_time = 1560208038000` - # - # * severity: `=`, `:` - # * security_marks.marks: `=`, `:` - # * resource: - # * resource.name: `=`, `:` - # * resource.parent_name: `=`, `:` - # * resource.parent_display_name: `=`, `:` - # * resource.project_name: `=`, `:` - # * resource.project_display_name: `=`, `:` - # * resource.type: `=`, `:` - # @param group_by [::String] - # Required. Expression that defines what assets fields to use for grouping. - # The string value should follow SQL syntax: comma separated list of fields. - # For example: "parent,resource_name". - # @param page_token [::String] - # The value returned by the last `GroupFindingsResponse`; indicates - # that this is a continuation of a prior `GroupFindings` call, and - # that the system should return the next page of data. - # @param page_size [::Integer] - # The maximum number of results to return in a single response. Default is - # 10, minimum is 1, maximum is 1000. - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Gapic::Rest::PagedEnumerable<::Google::Cloud::SecurityCenter::V2::GroupResult>] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Gapic::Rest::PagedEnumerable<::Google::Cloud::SecurityCenter::V2::GroupResult>] - # - # @raise [::Google::Cloud::Error] if the REST call is aborted. - # - # @example Basic example - # require "google/cloud/security_center/v2" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::SecurityCenter::V2::SecurityCenter::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::SecurityCenter::V2::GroupFindingsRequest.new - # - # # Call the group_findings method. - # result = client.group_findings request - # - # # The returned object is of type Gapic::PagedEnumerable. You can iterate - # # over elements, and API calls will be issued to fetch pages as needed. - # result.each do |item| - # # Each element is of type ::Google::Cloud::SecurityCenter::V2::GroupResult. - # p item - # end - # - def group_findings request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::SecurityCenter::V2::GroupFindingsRequest - - # Converts hash 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.group_findings.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::SecurityCenter::V2::VERSION, - transports_version_send: [:rest] - - call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - options.apply_defaults timeout: @config.rpcs.group_findings.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.group_findings.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @security_center_stub.group_findings request, options do |result, operation| - result = ::Gapic::Rest::PagedEnumerable.new @security_center_stub, :group_findings, "group_by_results", 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 - - ## - # Lists the attack paths for a set of simulation results or valued resources - # and filter. - # - # @overload list_attack_paths(request, options = nil) - # Pass arguments to `list_attack_paths` via a request object, either of type - # {::Google::Cloud::SecurityCenter::V2::ListAttackPathsRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::SecurityCenter::V2::ListAttackPathsRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_attack_paths(parent: nil, filter: nil, page_token: nil, page_size: nil) - # Pass arguments to `list_attack_paths` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param parent [::String] - # Required. Name of parent to list attack paths. - # - # Valid formats: - # `organizations/{organization}`, - # `organizations/{organization}/simulations/{simulation}` - # `organizations/{organization}/simulations/{simulation}/attackExposureResults/{attack_exposure_result_v2}` - # `organizations/{organization}/simulations/{simulation}/valuedResources/{valued_resource}` - # @param filter [::String] - # The filter expression that filters the attack path in the response. - # Supported fields: - # - # * `valued_resources` supports = - # @param page_token [::String] - # The value returned by the last `ListAttackPathsResponse`; indicates - # that this is a continuation of a prior `ListAttackPaths` call, and - # that the system should return the next page of data. - # @param page_size [::Integer] - # The maximum number of results to return in a single response. Default is - # 10, minimum is 1, maximum is 1000. - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Gapic::Rest::PagedEnumerable<::Google::Cloud::SecurityCenter::V2::AttackPath>] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Gapic::Rest::PagedEnumerable<::Google::Cloud::SecurityCenter::V2::AttackPath>] - # - # @raise [::Google::Cloud::Error] if the REST call is aborted. - # - # @example Basic example - # require "google/cloud/security_center/v2" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::SecurityCenter::V2::SecurityCenter::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::SecurityCenter::V2::ListAttackPathsRequest.new - # - # # Call the list_attack_paths method. - # result = client.list_attack_paths request - # - # # The returned object is of type Gapic::PagedEnumerable. You can iterate - # # over elements, and API calls will be issued to fetch pages as needed. - # result.each do |item| - # # Each element is of type ::Google::Cloud::SecurityCenter::V2::AttackPath. - # p item - # end - # - def list_attack_paths request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::SecurityCenter::V2::ListAttackPathsRequest - - # Converts hash 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_attack_paths.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::SecurityCenter::V2::VERSION, - transports_version_send: [:rest] - - call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - options.apply_defaults timeout: @config.rpcs.list_attack_paths.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.list_attack_paths.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @security_center_stub.list_attack_paths request, options do |result, operation| - result = ::Gapic::Rest::PagedEnumerable.new @security_center_stub, :list_attack_paths, "attack_paths", 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 - - ## - # Lists BigQuery exports. Note that when requesting BigQuery exports at a - # given level all exports under that level are also returned e.g. if - # requesting BigQuery exports under a folder, then all BigQuery exports - # immediately under the folder plus the ones created under the projects - # within the folder are returned. - # - # @overload list_big_query_exports(request, options = nil) - # Pass arguments to `list_big_query_exports` via a request object, either of type - # {::Google::Cloud::SecurityCenter::V2::ListBigQueryExportsRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::SecurityCenter::V2::ListBigQueryExportsRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_big_query_exports(parent: nil, page_size: nil, page_token: nil) - # Pass arguments to `list_big_query_exports` via keyword arguments. Note that at - # least one keyword argument is 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, which owns the collection of BigQuery exports. Its - # format is `organizations/[organization_id]/locations/[location_id]`, - # `folders/[folder_id]/locations/[location_id]`, or - # `projects/[project_id]/locations/[location_id]`. - # @param page_size [::Integer] - # The maximum number of configs to return. The service may return fewer than - # this value. - # If unspecified, at most 10 configs will be returned. - # The maximum value is 1000; values above 1000 will be coerced to 1000. - # @param page_token [::String] - # A page token, received from a previous `ListBigQueryExports` call. - # Provide this to retrieve the subsequent page. - # When paginating, all other parameters provided to `ListBigQueryExports` - # 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::Cloud::SecurityCenter::V2::BigQueryExport>] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Gapic::Rest::PagedEnumerable<::Google::Cloud::SecurityCenter::V2::BigQueryExport>] - # - # @raise [::Google::Cloud::Error] if the REST call is aborted. - # - # @example Basic example - # require "google/cloud/security_center/v2" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::SecurityCenter::V2::SecurityCenter::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::SecurityCenter::V2::ListBigQueryExportsRequest.new - # - # # Call the list_big_query_exports method. - # result = client.list_big_query_exports request - # - # # The returned object is of type Gapic::PagedEnumerable. You can iterate - # # over elements, and API calls will be issued to fetch pages as needed. - # result.each do |item| - # # Each element is of type ::Google::Cloud::SecurityCenter::V2::BigQueryExport. - # p item - # end - # - def list_big_query_exports request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::SecurityCenter::V2::ListBigQueryExportsRequest - - # Converts hash 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_big_query_exports.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::SecurityCenter::V2::VERSION, - transports_version_send: [:rest] - - call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - options.apply_defaults timeout: @config.rpcs.list_big_query_exports.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.list_big_query_exports.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @security_center_stub.list_big_query_exports request, options do |result, operation| - result = ::Gapic::Rest::PagedEnumerable.new @security_center_stub, :list_big_query_exports, "big_query_exports", 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 - - ## - # Lists an organization or source's findings. - # - # To list across all sources for a given location provide a `-` as the source - # id. If no location is specified, finding are assumed to be in global. - # The following list shows some examples: - # - # + `/v2/organizations/{organization_id}/sources/-/findings` - # + - # `/v2/organizations/{organization_id}/sources/-/locations/{location_id}/findings` - # - # @overload list_findings(request, options = nil) - # Pass arguments to `list_findings` via a request object, either of type - # {::Google::Cloud::SecurityCenter::V2::ListFindingsRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::SecurityCenter::V2::ListFindingsRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_findings(parent: nil, filter: nil, order_by: nil, field_mask: nil, page_token: nil, page_size: nil) - # Pass arguments to `list_findings` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param parent [::String] - # Required. Name of the source the findings belong to. If no location is - # specified, the default is global. The following list shows some examples: - # - # + `organizations/[organization_id]/sources/[source_id]` - # + - # `organizations/[organization_id]/sources/[source_id]/locations/[location_id]` - # + `folders/[folder_id]/sources/[source_id]` - # + `folders/[folder_id]/sources/[source_id]/locations/[location_id]` - # + `projects/[project_id]/sources/[source_id]` - # + `projects/[project_id]/sources/[source_id]/locations/[location_id]` - # - # To list across all sources provide a source_id of `-`. The following - # list shows some examples: - # - # + `organizations/{organization_id}/sources/-` - # + `organizations/{organization_id}/sources/-/locations/{location_id}` - # + `folders/{folder_id}/sources/-` - # + `folders/{folder_id}/sources/-locations/{location_id}` - # + `projects/{projects_id}/sources/-` - # + `projects/{projects_id}/sources/-/locations/{location_id}` - # @param filter [::String] - # Expression that defines the filter to apply across findings. - # The expression is a list of one or more restrictions combined via logical - # operators `AND` and `OR`. - # Parentheses are supported, and `OR` has higher precedence than `AND`. - # - # Restrictions have the form ` ` and may have a `-` - # character in front of them to indicate negation. Examples include: - # - # * name - # * security_marks.marks.marka - # - # The supported operators are: - # - # * `=` for all value types. - # * `>`, `<`, `>=`, `<=` for integer values. - # * `:`, meaning substring matching, for strings. - # - # The supported value types are: - # - # * string literals in quotes. - # * integer literals without quotes. - # * boolean literals `true` and `false` without quotes. - # - # The following field and operator combinations are supported: - # - # * name: `=` - # * parent: `=`, `:` - # * resource_name: `=`, `:` - # * state: `=`, `:` - # * category: `=`, `:` - # * external_uri: `=`, `:` - # * event_time: `=`, `>`, `<`, `>=`, `<=` - # - # Usage: This should be milliseconds since epoch or an RFC3339 string. - # Examples: - # `event_time = "2019-06-10T16:07:18-07:00"` - # `event_time = 1560208038000` - # - # * severity: `=`, `:` - # * security_marks.marks: `=`, `:` - # * resource: - # * resource.name: `=`, `:` - # * resource.parent_name: `=`, `:` - # * resource.parent_display_name: `=`, `:` - # * resource.project_name: `=`, `:` - # * resource.project_display_name: `=`, `:` - # * resource.type: `=`, `:` - # * resource.folders.resource_folder: `=`, `:` - # * resource.display_name: `=`, `:` - # @param order_by [::String] - # Expression that defines what fields and order to use for sorting. The - # string value should follow SQL syntax: comma separated list of fields. For - # example: "name,parent". The default sorting order - # is ascending. To specify descending order for a field, a suffix " desc" - # should be appended to the field name. For example: "name - # desc,parent". Redundant space characters in the - # syntax are insignificant. "name desc,parent" and " - # name desc , parent " are equivalent. - # - # The following fields are supported: - # name - # parent - # state - # category - # resource_name - # event_time - # security_marks.marks - # @param field_mask [::Google::Protobuf::FieldMask, ::Hash] - # A field mask to specify the Finding fields to be listed in the response. - # An empty field mask will list all fields. - # @param page_token [::String] - # The value returned by the last `ListFindingsResponse`; indicates - # that this is a continuation of a prior `ListFindings` call, and - # that the system should return the next page of data. - # @param page_size [::Integer] - # The maximum number of results to return in a single response. Default is - # 10, minimum is 1, maximum is 1000. - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Gapic::Rest::PagedEnumerable<::Google::Cloud::SecurityCenter::V2::ListFindingsResponse::ListFindingsResult>] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Gapic::Rest::PagedEnumerable<::Google::Cloud::SecurityCenter::V2::ListFindingsResponse::ListFindingsResult>] - # - # @raise [::Google::Cloud::Error] if the REST call is aborted. - # - # @example Basic example - # require "google/cloud/security_center/v2" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::SecurityCenter::V2::SecurityCenter::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::SecurityCenter::V2::ListFindingsRequest.new - # - # # Call the list_findings method. - # result = client.list_findings request - # - # # The returned object is of type Gapic::PagedEnumerable. You can iterate - # # over elements, and API calls will be issued to fetch pages as needed. - # result.each do |item| - # # Each element is of type ::Google::Cloud::SecurityCenter::V2::ListFindingsResponse::ListFindingsResult. - # p item - # end - # - def list_findings request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::SecurityCenter::V2::ListFindingsRequest - - # Converts hash 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_findings.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::SecurityCenter::V2::VERSION, - transports_version_send: [:rest] - - call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - options.apply_defaults timeout: @config.rpcs.list_findings.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.list_findings.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @security_center_stub.list_findings request, options do |result, operation| - result = ::Gapic::Rest::PagedEnumerable.new @security_center_stub, :list_findings, "list_findings_results", 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 - - ## - # Lists mute configs. If no location is specified, default is - # global. - # - # @overload list_mute_configs(request, options = nil) - # Pass arguments to `list_mute_configs` via a request object, either of type - # {::Google::Cloud::SecurityCenter::V2::ListMuteConfigsRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::SecurityCenter::V2::ListMuteConfigsRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_mute_configs(parent: nil, page_size: nil, page_token: nil) - # Pass arguments to `list_mute_configs` via keyword arguments. Note that at - # least one keyword argument is 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, which owns the collection of mute configs. Its format - # is `organizations/[organization_id]", "folders/[folder_id]`, - # `projects/[project_id]`, - # `organizations/[organization_id]/locations/[location_id]`, - # `folders/[folder_id]/locations/[location_id]`, - # `projects/[project_id]/locations/[location_id]`. - # @param page_size [::Integer] - # The maximum number of configs to return. The service may return fewer than - # this value. - # If unspecified, at most 10 configs will be returned. - # The maximum value is 1000; values above 1000 will be coerced to 1000. - # @param page_token [::String] - # A page token, received from a previous `ListMuteConfigs` call. - # Provide this to retrieve the subsequent page. - # - # When paginating, all other parameters provided to `ListMuteConfigs` 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::Cloud::SecurityCenter::V2::MuteConfig>] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Gapic::Rest::PagedEnumerable<::Google::Cloud::SecurityCenter::V2::MuteConfig>] - # - # @raise [::Google::Cloud::Error] if the REST call is aborted. - # - # @example Basic example - # require "google/cloud/security_center/v2" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::SecurityCenter::V2::SecurityCenter::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::SecurityCenter::V2::ListMuteConfigsRequest.new - # - # # Call the list_mute_configs method. - # result = client.list_mute_configs request - # - # # The returned object is of type Gapic::PagedEnumerable. You can iterate - # # over elements, and API calls will be issued to fetch pages as needed. - # result.each do |item| - # # Each element is of type ::Google::Cloud::SecurityCenter::V2::MuteConfig. - # p item - # end - # - def list_mute_configs request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::SecurityCenter::V2::ListMuteConfigsRequest - - # Converts hash 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_mute_configs.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::SecurityCenter::V2::VERSION, - transports_version_send: [:rest] - - call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - options.apply_defaults timeout: @config.rpcs.list_mute_configs.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.list_mute_configs.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @security_center_stub.list_mute_configs request, options do |result, operation| - result = ::Gapic::Rest::PagedEnumerable.new @security_center_stub, :list_mute_configs, "mute_configs", 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 - - ## - # Lists notification configs. - # - # @overload list_notification_configs(request, options = nil) - # Pass arguments to `list_notification_configs` via a request object, either of type - # {::Google::Cloud::SecurityCenter::V2::ListNotificationConfigsRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::SecurityCenter::V2::ListNotificationConfigsRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_notification_configs(parent: nil, page_token: nil, page_size: nil) - # Pass arguments to `list_notification_configs` via keyword arguments. Note that at - # least one keyword argument is 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 name of the parent in which to list the notification - # configurations. Its format is - # "organizations/[organization_id]/locations/[location_id]", - # "folders/[folder_id]/locations/[location_id]", or - # "projects/[project_id]/locations/[location_id]". - # @param page_token [::String] - # The value returned by the last `ListNotificationConfigsResponse`; indicates - # that this is a continuation of a prior `ListNotificationConfigs` call, and - # that the system should return the next page of data. - # @param page_size [::Integer] - # The maximum number of results to return in a single response. Default is - # 10, minimum is 1, maximum is 1000. - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Gapic::Rest::PagedEnumerable<::Google::Cloud::SecurityCenter::V2::NotificationConfig>] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Gapic::Rest::PagedEnumerable<::Google::Cloud::SecurityCenter::V2::NotificationConfig>] - # - # @raise [::Google::Cloud::Error] if the REST call is aborted. - # - # @example Basic example - # require "google/cloud/security_center/v2" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::SecurityCenter::V2::SecurityCenter::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::SecurityCenter::V2::ListNotificationConfigsRequest.new - # - # # Call the list_notification_configs method. - # result = client.list_notification_configs request - # - # # The returned object is of type Gapic::PagedEnumerable. You can iterate - # # over elements, and API calls will be issued to fetch pages as needed. - # result.each do |item| - # # Each element is of type ::Google::Cloud::SecurityCenter::V2::NotificationConfig. - # p item - # end - # - def list_notification_configs request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::SecurityCenter::V2::ListNotificationConfigsRequest - - # Converts hash 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_notification_configs.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::SecurityCenter::V2::VERSION, - transports_version_send: [:rest] - - call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - options.apply_defaults timeout: @config.rpcs.list_notification_configs.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.list_notification_configs.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @security_center_stub.list_notification_configs request, options do |result, operation| - result = ::Gapic::Rest::PagedEnumerable.new @security_center_stub, :list_notification_configs, "notification_configs", 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 - - ## - # Lists all ResourceValueConfigs. - # - # @overload list_resource_value_configs(request, options = nil) - # Pass arguments to `list_resource_value_configs` via a request object, either of type - # {::Google::Cloud::SecurityCenter::V2::ListResourceValueConfigsRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::SecurityCenter::V2::ListResourceValueConfigsRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_resource_value_configs(parent: nil, page_size: nil, page_token: nil) - # Pass arguments to `list_resource_value_configs` via keyword arguments. Note that at - # least one keyword argument is 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, which owns the collection of resource value configs. - # Its format is - # `organizations/[organization_id]` - # @param page_size [::Integer] - # The maximum number of configs to return. The service may return fewer than - # this value. - # If unspecified, at most 10 configs will be returned. - # The maximum value is 1000; values above 1000 will be coerced to 1000. - # @param page_token [::String] - # A page token, received from a previous `ListResourceValueConfigs` call. - # Provide this to retrieve the subsequent page. - # - # When paginating, all other parameters provided to - # `ListResourceValueConfigs` must match the call that provided the - # page token. - # - # page_size can be specified, and the new page_size will be used. - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Gapic::Rest::PagedEnumerable<::Google::Cloud::SecurityCenter::V2::ResourceValueConfig>] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Gapic::Rest::PagedEnumerable<::Google::Cloud::SecurityCenter::V2::ResourceValueConfig>] - # - # @raise [::Google::Cloud::Error] if the REST call is aborted. - # - # @example Basic example - # require "google/cloud/security_center/v2" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::SecurityCenter::V2::SecurityCenter::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::SecurityCenter::V2::ListResourceValueConfigsRequest.new - # - # # Call the list_resource_value_configs method. - # result = client.list_resource_value_configs request - # - # # The returned object is of type Gapic::PagedEnumerable. You can iterate - # # over elements, and API calls will be issued to fetch pages as needed. - # result.each do |item| - # # Each element is of type ::Google::Cloud::SecurityCenter::V2::ResourceValueConfig. - # p item - # end - # - def list_resource_value_configs request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::SecurityCenter::V2::ListResourceValueConfigsRequest - - # Converts hash 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_resource_value_configs.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::SecurityCenter::V2::VERSION, - transports_version_send: [:rest] - - call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - options.apply_defaults timeout: @config.rpcs.list_resource_value_configs.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.list_resource_value_configs.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @security_center_stub.list_resource_value_configs request, options do |result, operation| - result = ::Gapic::Rest::PagedEnumerable.new @security_center_stub, :list_resource_value_configs, "resource_value_configs", 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 - - ## - # Lists all sources belonging to an organization. - # - # @overload list_sources(request, options = nil) - # Pass arguments to `list_sources` via a request object, either of type - # {::Google::Cloud::SecurityCenter::V2::ListSourcesRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::SecurityCenter::V2::ListSourcesRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_sources(parent: nil, page_token: nil, page_size: nil) - # Pass arguments to `list_sources` via keyword arguments. Note that at - # least one keyword argument is 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. Resource name of the parent of sources to list. Its format should - # be `organizations/[organization_id]`, `folders/[folder_id]`, or - # `projects/[project_id]`. - # @param page_token [::String] - # The value returned by the last `ListSourcesResponse`; indicates - # that this is a continuation of a prior `ListSources` call, and - # that the system should return the next page of data. - # @param page_size [::Integer] - # The maximum number of results to return in a single response. Default is - # 10, minimum is 1, maximum is 1000. - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Gapic::Rest::PagedEnumerable<::Google::Cloud::SecurityCenter::V2::Source>] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Gapic::Rest::PagedEnumerable<::Google::Cloud::SecurityCenter::V2::Source>] - # - # @raise [::Google::Cloud::Error] if the REST call is aborted. - # - # @example Basic example - # require "google/cloud/security_center/v2" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::SecurityCenter::V2::SecurityCenter::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::SecurityCenter::V2::ListSourcesRequest.new - # - # # Call the list_sources method. - # result = client.list_sources request - # - # # The returned object is of type Gapic::PagedEnumerable. You can iterate - # # over elements, and API calls will be issued to fetch pages as needed. - # result.each do |item| - # # Each element is of type ::Google::Cloud::SecurityCenter::V2::Source. - # p item - # end - # - def list_sources request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::SecurityCenter::V2::ListSourcesRequest - - # Converts hash 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_sources.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::SecurityCenter::V2::VERSION, - transports_version_send: [:rest] - - call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - options.apply_defaults timeout: @config.rpcs.list_sources.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.list_sources.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @security_center_stub.list_sources request, options do |result, operation| - result = ::Gapic::Rest::PagedEnumerable.new @security_center_stub, :list_sources, "sources", 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 - - ## - # Lists the valued resources for a set of simulation results and filter. - # - # @overload list_valued_resources(request, options = nil) - # Pass arguments to `list_valued_resources` via a request object, either of type - # {::Google::Cloud::SecurityCenter::V2::ListValuedResourcesRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::SecurityCenter::V2::ListValuedResourcesRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_valued_resources(parent: nil, filter: nil, page_token: nil, page_size: nil, order_by: nil) - # Pass arguments to `list_valued_resources` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param parent [::String] - # Required. Name of parent to list exposed resources. - # - # Valid formats: - # `organizations/{organization}`, - # `organizations/{organization}/simulations/{simulation}` - # `organizations/{organization}/simulations/{simulation}/attackExposureResults/{attack_exposure_result_v2}` - # @param filter [::String] - # The filter expression that filters the valued resources in the response. - # Supported fields: - # - # * `resource_value` supports = - # * `resource_type` supports = - # @param page_token [::String] - # The value returned by the last `ListValuedResourcesResponse`; indicates - # that this is a continuation of a prior `ListValuedResources` call, and - # that the system should return the next page of data. - # @param page_size [::Integer] - # The maximum number of results to return in a single response. Default is - # 10, minimum is 1, maximum is 1000. - # @param order_by [::String] - # Optional. The fields by which to order the valued resources response. - # - # Supported fields: - # - # * `exposed_score` - # - # * `resource_value` - # - # * `resource_type` - # - # Values should be a comma separated list of fields. For example: - # `exposed_score,resource_value`. - # - # The default sorting order is descending. To specify ascending or descending - # order for a field, append a " ASC" or a " DESC" suffix, respectively; for - # example: `exposed_score DESC`. - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Gapic::Rest::PagedEnumerable<::Google::Cloud::SecurityCenter::V2::ValuedResource>] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Gapic::Rest::PagedEnumerable<::Google::Cloud::SecurityCenter::V2::ValuedResource>] - # - # @raise [::Google::Cloud::Error] if the REST call is aborted. - # - # @example Basic example - # require "google/cloud/security_center/v2" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::SecurityCenter::V2::SecurityCenter::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::SecurityCenter::V2::ListValuedResourcesRequest.new - # - # # Call the list_valued_resources method. - # result = client.list_valued_resources request - # - # # The returned object is of type Gapic::PagedEnumerable. You can iterate - # # over elements, and API calls will be issued to fetch pages as needed. - # result.each do |item| - # # Each element is of type ::Google::Cloud::SecurityCenter::V2::ValuedResource. - # p item - # end - # - def list_valued_resources request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::SecurityCenter::V2::ListValuedResourcesRequest - - # Converts hash 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_valued_resources.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::SecurityCenter::V2::VERSION, - transports_version_send: [:rest] - - call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - options.apply_defaults timeout: @config.rpcs.list_valued_resources.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.list_valued_resources.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @security_center_stub.list_valued_resources request, options do |result, operation| - result = ::Gapic::Rest::PagedEnumerable.new @security_center_stub, :list_valued_resources, "valued_resources", 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 - - ## - # Updates the state of a finding. If no location is specified, finding is - # assumed to be in global - # - # @overload set_finding_state(request, options = nil) - # Pass arguments to `set_finding_state` via a request object, either of type - # {::Google::Cloud::SecurityCenter::V2::SetFindingStateRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::SecurityCenter::V2::SetFindingStateRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @overload set_finding_state(name: nil, state: nil) - # Pass arguments to `set_finding_state` via keyword arguments. Note that at - # least one keyword argument is 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 [relative resource - # name](https://cloud.google.com/apis/design/resource_names#relative_resource_name) - # of the finding. If no location is specified, finding is assumed to be in - # global. The following list shows some examples: - # - # + - # `organizations/{organization_id}/sources/{source_id}/findings/{finding_id}` - # + - # `organizations/{organization_id}/sources/{source_id}/locations/{location_id}/findings/{finding_id}` - # + `folders/{folder_id}/sources/{source_id}/findings/{finding_id}` - # + - # `folders/{folder_id}/sources/{source_id}/locations/{location_id}/findings/{finding_id}` - # + `projects/{project_id}/sources/{source_id}/findings/{finding_id}` - # + - # `projects/{project_id}/sources/{source_id}/locations/{location_id}/findings/{finding_id}` - # @param state [::Google::Cloud::SecurityCenter::V2::Finding::State] - # Required. The desired State of the finding. - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Cloud::SecurityCenter::V2::Finding] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::SecurityCenter::V2::Finding] - # - # @raise [::Google::Cloud::Error] if the REST call is aborted. - # - # @example Basic example - # require "google/cloud/security_center/v2" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::SecurityCenter::V2::SecurityCenter::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::SecurityCenter::V2::SetFindingStateRequest.new - # - # # Call the set_finding_state method. - # result = client.set_finding_state request - # - # # The returned object is of type Google::Cloud::SecurityCenter::V2::Finding. - # p result - # - def set_finding_state request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::SecurityCenter::V2::SetFindingStateRequest - - # Converts hash and nil to an options object - options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h - - # Customize the options with defaults - call_metadata = @config.rpcs.set_finding_state.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::SecurityCenter::V2::VERSION, - transports_version_send: [:rest] - - call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - options.apply_defaults timeout: @config.rpcs.set_finding_state.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.set_finding_state.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @security_center_stub.set_finding_state request, options do |result, operation| - yield result, operation if block_given? - end - rescue ::Gapic::Rest::Error => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Sets the access control policy on the specified Source. - # - # @overload set_iam_policy(request, options = nil) - # Pass arguments to `set_iam_policy` via a request object, either of type - # {::Google::Iam::V1::SetIamPolicyRequest} or an equivalent Hash. - # - # @param request [::Google::Iam::V1::SetIamPolicyRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @overload set_iam_policy(resource: nil, policy: nil, update_mask: nil) - # Pass arguments to `set_iam_policy` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param resource [::String] - # REQUIRED: The resource for which the policy is being specified. - # See the operation documentation for the appropriate value for this field. - # @param policy [::Google::Iam::V1::Policy, ::Hash] - # REQUIRED: The complete policy to be applied to the `resource`. The size of - # the policy is limited to a few 10s of KB. An empty policy is a - # valid policy but certain Cloud Platform services (such as Projects) - # might reject them. - # @param update_mask [::Google::Protobuf::FieldMask, ::Hash] - # OPTIONAL: A FieldMask specifying which fields of the policy to modify. Only - # the fields in the mask will be modified. If no mask is provided, the - # following default mask is used: - # - # `paths: "bindings, etag"` - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Iam::V1::Policy] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Iam::V1::Policy] - # - # @raise [::Google::Cloud::Error] if the REST call is aborted. - # - # @example Basic example - # require "google/cloud/security_center/v2" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::SecurityCenter::V2::SecurityCenter::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Iam::V1::SetIamPolicyRequest.new - # - # # Call the set_iam_policy method. - # result = client.set_iam_policy request - # - # # The returned object is of type Google::Iam::V1::Policy. - # p result - # - def set_iam_policy request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Iam::V1::SetIamPolicyRequest - - # Converts hash and nil to an options object - options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h - - # Customize the options with defaults - call_metadata = @config.rpcs.set_iam_policy.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::SecurityCenter::V2::VERSION, - transports_version_send: [:rest] - - call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - options.apply_defaults timeout: @config.rpcs.set_iam_policy.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.set_iam_policy.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @security_center_stub.set_iam_policy request, options do |result, operation| - yield result, operation if block_given? - end - rescue ::Gapic::Rest::Error => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Updates the mute state of a finding. If no location is specified, finding - # is assumed to be in global - # - # @overload set_mute(request, options = nil) - # Pass arguments to `set_mute` via a request object, either of type - # {::Google::Cloud::SecurityCenter::V2::SetMuteRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::SecurityCenter::V2::SetMuteRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @overload set_mute(name: nil, mute: nil) - # Pass arguments to `set_mute` via keyword arguments. Note that at - # least one keyword argument is 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 [relative resource - # name](https://cloud.google.com/apis/design/resource_names#relative_resource_name) - # of the finding. If no location is specified, finding is assumed to be in - # global. The following list shows some examples: - # - # + - # `organizations/{organization_id}/sources/{source_id}/findings/{finding_id}` - # + - # `organizations/{organization_id}/sources/{source_id}/locations/{location_id}/findings/{finding_id}` - # + `folders/{folder_id}/sources/{source_id}/findings/{finding_id}` - # + - # `folders/{folder_id}/sources/{source_id}/locations/{location_id}/findings/{finding_id}` - # + `projects/{project_id}/sources/{source_id}/findings/{finding_id}` - # + - # `projects/{project_id}/sources/{source_id}/locations/{location_id}/findings/{finding_id}` - # @param mute [::Google::Cloud::SecurityCenter::V2::Finding::Mute] - # Required. The desired state of the Mute. - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Cloud::SecurityCenter::V2::Finding] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::SecurityCenter::V2::Finding] - # - # @raise [::Google::Cloud::Error] if the REST call is aborted. - # - # @example Basic example - # require "google/cloud/security_center/v2" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::SecurityCenter::V2::SecurityCenter::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::SecurityCenter::V2::SetMuteRequest.new - # - # # Call the set_mute method. - # result = client.set_mute request - # - # # The returned object is of type Google::Cloud::SecurityCenter::V2::Finding. - # p result - # - def set_mute request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::SecurityCenter::V2::SetMuteRequest - - # Converts hash and nil to an options object - options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h - - # Customize the options with defaults - call_metadata = @config.rpcs.set_mute.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::SecurityCenter::V2::VERSION, - transports_version_send: [:rest] - - call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - options.apply_defaults timeout: @config.rpcs.set_mute.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.set_mute.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @security_center_stub.set_mute request, options do |result, operation| - yield result, operation if block_given? - end - rescue ::Gapic::Rest::Error => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Returns the permissions that a caller has on the specified source. - # - # @overload test_iam_permissions(request, options = nil) - # Pass arguments to `test_iam_permissions` via a request object, either of type - # {::Google::Iam::V1::TestIamPermissionsRequest} or an equivalent Hash. - # - # @param request [::Google::Iam::V1::TestIamPermissionsRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @overload test_iam_permissions(resource: nil, permissions: nil) - # Pass arguments to `test_iam_permissions` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param resource [::String] - # REQUIRED: The resource for which the policy detail is being requested. - # See the operation documentation for the appropriate value for this field. - # @param permissions [::Array<::String>] - # The set of permissions to check for the `resource`. Permissions with - # wildcards (such as '*' or 'storage.*') are not allowed. For more - # information see - # [IAM Overview](https://cloud.google.com/iam/docs/overview#permissions). - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Iam::V1::TestIamPermissionsResponse] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Iam::V1::TestIamPermissionsResponse] - # - # @raise [::Google::Cloud::Error] if the REST call is aborted. - # - # @example Basic example - # require "google/cloud/security_center/v2" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::SecurityCenter::V2::SecurityCenter::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Iam::V1::TestIamPermissionsRequest.new - # - # # Call the test_iam_permissions method. - # result = client.test_iam_permissions request - # - # # The returned object is of type Google::Iam::V1::TestIamPermissionsResponse. - # p result - # - def test_iam_permissions request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Iam::V1::TestIamPermissionsRequest - - # Converts hash and nil to an options object - options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h - - # Customize the options with defaults - call_metadata = @config.rpcs.test_iam_permissions.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::SecurityCenter::V2::VERSION, - transports_version_send: [:rest] - - call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - options.apply_defaults timeout: @config.rpcs.test_iam_permissions.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.test_iam_permissions.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @security_center_stub.test_iam_permissions request, options do |result, operation| - yield result, operation if block_given? - end - rescue ::Gapic::Rest::Error => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Updates a BigQuery export. - # - # @overload update_big_query_export(request, options = nil) - # Pass arguments to `update_big_query_export` via a request object, either of type - # {::Google::Cloud::SecurityCenter::V2::UpdateBigQueryExportRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::SecurityCenter::V2::UpdateBigQueryExportRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_big_query_export(big_query_export: nil, update_mask: nil) - # Pass arguments to `update_big_query_export` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param big_query_export [::Google::Cloud::SecurityCenter::V2::BigQueryExport, ::Hash] - # Required. The BigQuery export being updated. - # @param update_mask [::Google::Protobuf::FieldMask, ::Hash] - # The list of fields to be updated. - # If empty all mutable fields will be updated. - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Cloud::SecurityCenter::V2::BigQueryExport] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::SecurityCenter::V2::BigQueryExport] - # - # @raise [::Google::Cloud::Error] if the REST call is aborted. - # - # @example Basic example - # require "google/cloud/security_center/v2" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::SecurityCenter::V2::SecurityCenter::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::SecurityCenter::V2::UpdateBigQueryExportRequest.new - # - # # Call the update_big_query_export method. - # result = client.update_big_query_export request - # - # # The returned object is of type Google::Cloud::SecurityCenter::V2::BigQueryExport. - # p result - # - def update_big_query_export request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::SecurityCenter::V2::UpdateBigQueryExportRequest - - # Converts hash 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_big_query_export.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::SecurityCenter::V2::VERSION, - transports_version_send: [:rest] - - call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - options.apply_defaults timeout: @config.rpcs.update_big_query_export.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.update_big_query_export.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @security_center_stub.update_big_query_export 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 external system. This is for a given finding. If no location is - # specified, finding is assumed to be in global - # - # @overload update_external_system(request, options = nil) - # Pass arguments to `update_external_system` via a request object, either of type - # {::Google::Cloud::SecurityCenter::V2::UpdateExternalSystemRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::SecurityCenter::V2::UpdateExternalSystemRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_external_system(external_system: nil, update_mask: nil) - # Pass arguments to `update_external_system` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param external_system [::Google::Cloud::SecurityCenter::V2::ExternalSystem, ::Hash] - # Required. The external system resource to update. - # @param update_mask [::Google::Protobuf::FieldMask, ::Hash] - # The FieldMask to use when updating the external system resource. - # - # If empty all mutable fields will be updated. - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Cloud::SecurityCenter::V2::ExternalSystem] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::SecurityCenter::V2::ExternalSystem] - # - # @raise [::Google::Cloud::Error] if the REST call is aborted. - # - # @example Basic example - # require "google/cloud/security_center/v2" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::SecurityCenter::V2::SecurityCenter::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::SecurityCenter::V2::UpdateExternalSystemRequest.new - # - # # Call the update_external_system method. - # result = client.update_external_system request - # - # # The returned object is of type Google::Cloud::SecurityCenter::V2::ExternalSystem. - # p result - # - def update_external_system request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::SecurityCenter::V2::UpdateExternalSystemRequest - - # Converts hash 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_external_system.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::SecurityCenter::V2::VERSION, - transports_version_send: [:rest] - - call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - options.apply_defaults timeout: @config.rpcs.update_external_system.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.update_external_system.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @security_center_stub.update_external_system request, options do |result, operation| - yield result, operation if block_given? - end - rescue ::Gapic::Rest::Error => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Creates or updates a finding. If no location is specified, finding is - # assumed to be in global. The corresponding source must exist for a finding - # creation to succeed. - # - # @overload update_finding(request, options = nil) - # Pass arguments to `update_finding` via a request object, either of type - # {::Google::Cloud::SecurityCenter::V2::UpdateFindingRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::SecurityCenter::V2::UpdateFindingRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_finding(finding: nil, update_mask: nil) - # Pass arguments to `update_finding` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param finding [::Google::Cloud::SecurityCenter::V2::Finding, ::Hash] - # Required. The finding resource to update or create if it does not already - # exist. parent, security_marks, and update_time will be ignored. - # - # In the case of creation, the finding id portion of the name must be - # alphanumeric and less than or equal to 32 characters and greater than 0 - # characters in length. - # @param update_mask [::Google::Protobuf::FieldMask, ::Hash] - # The FieldMask to use when updating the finding resource. This field should - # not be specified when creating a finding. - # - # When updating a finding, an empty mask is treated as updating all mutable - # fields and replacing source_properties. Individual source_properties can - # be added/updated by using "source_properties." in the field - # mask. - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Cloud::SecurityCenter::V2::Finding] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::SecurityCenter::V2::Finding] - # - # @raise [::Google::Cloud::Error] if the REST call is aborted. - # - # @example Basic example - # require "google/cloud/security_center/v2" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::SecurityCenter::V2::SecurityCenter::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::SecurityCenter::V2::UpdateFindingRequest.new - # - # # Call the update_finding method. - # result = client.update_finding request - # - # # The returned object is of type Google::Cloud::SecurityCenter::V2::Finding. - # p result - # - def update_finding request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::SecurityCenter::V2::UpdateFindingRequest - - # Converts hash 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_finding.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::SecurityCenter::V2::VERSION, - transports_version_send: [:rest] - - call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - options.apply_defaults timeout: @config.rpcs.update_finding.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.update_finding.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @security_center_stub.update_finding 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 mute config. If no location is specified, default is - # global. - # - # @overload update_mute_config(request, options = nil) - # Pass arguments to `update_mute_config` via a request object, either of type - # {::Google::Cloud::SecurityCenter::V2::UpdateMuteConfigRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::SecurityCenter::V2::UpdateMuteConfigRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_mute_config(mute_config: nil, update_mask: nil) - # Pass arguments to `update_mute_config` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param mute_config [::Google::Cloud::SecurityCenter::V2::MuteConfig, ::Hash] - # Required. The mute config being updated. - # @param update_mask [::Google::Protobuf::FieldMask, ::Hash] - # The list of fields to be updated. - # If empty all mutable fields will be updated. - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Cloud::SecurityCenter::V2::MuteConfig] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::SecurityCenter::V2::MuteConfig] - # - # @raise [::Google::Cloud::Error] if the REST call is aborted. - # - # @example Basic example - # require "google/cloud/security_center/v2" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::SecurityCenter::V2::SecurityCenter::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::SecurityCenter::V2::UpdateMuteConfigRequest.new - # - # # Call the update_mute_config method. - # result = client.update_mute_config request - # - # # The returned object is of type Google::Cloud::SecurityCenter::V2::MuteConfig. - # p result - # - def update_mute_config request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::SecurityCenter::V2::UpdateMuteConfigRequest - - # Converts hash 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_mute_config.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::SecurityCenter::V2::VERSION, - transports_version_send: [:rest] - - call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - options.apply_defaults timeout: @config.rpcs.update_mute_config.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.update_mute_config.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @security_center_stub.update_mute_config request, options do |result, operation| - yield result, operation if block_given? - end - rescue ::Gapic::Rest::Error => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Updates a notification config. The following update - # fields are allowed: description, pubsub_topic, streaming_config.filter - # - # @overload update_notification_config(request, options = nil) - # Pass arguments to `update_notification_config` via a request object, either of type - # {::Google::Cloud::SecurityCenter::V2::UpdateNotificationConfigRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::SecurityCenter::V2::UpdateNotificationConfigRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_notification_config(notification_config: nil, update_mask: nil) - # Pass arguments to `update_notification_config` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param notification_config [::Google::Cloud::SecurityCenter::V2::NotificationConfig, ::Hash] - # Required. The notification config to update. - # @param update_mask [::Google::Protobuf::FieldMask, ::Hash] - # The FieldMask to use when updating the notification config. - # - # If empty all mutable fields will be updated. - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Cloud::SecurityCenter::V2::NotificationConfig] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::SecurityCenter::V2::NotificationConfig] - # - # @raise [::Google::Cloud::Error] if the REST call is aborted. - # - # @example Basic example - # require "google/cloud/security_center/v2" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::SecurityCenter::V2::SecurityCenter::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::SecurityCenter::V2::UpdateNotificationConfigRequest.new - # - # # Call the update_notification_config method. - # result = client.update_notification_config request - # - # # The returned object is of type Google::Cloud::SecurityCenter::V2::NotificationConfig. - # p result - # - def update_notification_config request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::SecurityCenter::V2::UpdateNotificationConfigRequest - - # Converts hash 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_notification_config.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::SecurityCenter::V2::VERSION, - transports_version_send: [:rest] - - call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - options.apply_defaults timeout: @config.rpcs.update_notification_config.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.update_notification_config.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @security_center_stub.update_notification_config request, options do |result, operation| - yield result, operation if block_given? - end - rescue ::Gapic::Rest::Error => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Updates an existing ResourceValueConfigs with new rules. - # - # @overload update_resource_value_config(request, options = nil) - # Pass arguments to `update_resource_value_config` via a request object, either of type - # {::Google::Cloud::SecurityCenter::V2::UpdateResourceValueConfigRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::SecurityCenter::V2::UpdateResourceValueConfigRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_resource_value_config(resource_value_config: nil, update_mask: nil) - # Pass arguments to `update_resource_value_config` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param resource_value_config [::Google::Cloud::SecurityCenter::V2::ResourceValueConfig, ::Hash] - # Required. The resource value config being updated. - # @param update_mask [::Google::Protobuf::FieldMask, ::Hash] - # The list of fields to be updated. - # If empty all mutable fields will be updated. - # - # To update nested fields, include the top level field in the mask - # For example, to update gcp_metadata.resource_type, include the - # "gcp_metadata" field mask - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Cloud::SecurityCenter::V2::ResourceValueConfig] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::SecurityCenter::V2::ResourceValueConfig] - # - # @raise [::Google::Cloud::Error] if the REST call is aborted. - # - # @example Basic example - # require "google/cloud/security_center/v2" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::SecurityCenter::V2::SecurityCenter::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::SecurityCenter::V2::UpdateResourceValueConfigRequest.new - # - # # Call the update_resource_value_config method. - # result = client.update_resource_value_config request - # - # # The returned object is of type Google::Cloud::SecurityCenter::V2::ResourceValueConfig. - # p result - # - def update_resource_value_config request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::SecurityCenter::V2::UpdateResourceValueConfigRequest - - # Converts hash 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_resource_value_config.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::SecurityCenter::V2::VERSION, - transports_version_send: [:rest] - - call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - options.apply_defaults timeout: @config.rpcs.update_resource_value_config.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.update_resource_value_config.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @security_center_stub.update_resource_value_config request, options do |result, operation| - yield result, operation if block_given? - end - rescue ::Gapic::Rest::Error => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Updates security marks. For Finding Security marks, if no location is - # specified, finding is assumed to be in global. Assets Security Marks can - # only be accessed through global endpoint. - # - # @overload update_security_marks(request, options = nil) - # Pass arguments to `update_security_marks` via a request object, either of type - # {::Google::Cloud::SecurityCenter::V2::UpdateSecurityMarksRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::SecurityCenter::V2::UpdateSecurityMarksRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_security_marks(security_marks: nil, update_mask: nil) - # Pass arguments to `update_security_marks` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param security_marks [::Google::Cloud::SecurityCenter::V2::SecurityMarks, ::Hash] - # Required. The security marks resource to update. - # @param update_mask [::Google::Protobuf::FieldMask, ::Hash] - # The FieldMask to use when updating the security marks resource. - # - # The field mask must not contain duplicate fields. - # If empty or set to "marks", all marks will be replaced. Individual - # marks can be updated using "marks.". - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Cloud::SecurityCenter::V2::SecurityMarks] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::SecurityCenter::V2::SecurityMarks] - # - # @raise [::Google::Cloud::Error] if the REST call is aborted. - # - # @example Basic example - # require "google/cloud/security_center/v2" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::SecurityCenter::V2::SecurityCenter::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::SecurityCenter::V2::UpdateSecurityMarksRequest.new - # - # # Call the update_security_marks method. - # result = client.update_security_marks request - # - # # The returned object is of type Google::Cloud::SecurityCenter::V2::SecurityMarks. - # p result - # - def update_security_marks request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::SecurityCenter::V2::UpdateSecurityMarksRequest - - # Converts hash 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_security_marks.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::SecurityCenter::V2::VERSION, - transports_version_send: [:rest] - - call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - options.apply_defaults timeout: @config.rpcs.update_security_marks.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.update_security_marks.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @security_center_stub.update_security_marks 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 source. - # - # @overload update_source(request, options = nil) - # Pass arguments to `update_source` via a request object, either of type - # {::Google::Cloud::SecurityCenter::V2::UpdateSourceRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::SecurityCenter::V2::UpdateSourceRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_source(source: nil, update_mask: nil) - # Pass arguments to `update_source` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param source [::Google::Cloud::SecurityCenter::V2::Source, ::Hash] - # Required. The source resource to update. - # @param update_mask [::Google::Protobuf::FieldMask, ::Hash] - # The FieldMask to use when updating the source resource. - # - # If empty all mutable fields will be updated. - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Cloud::SecurityCenter::V2::Source] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::SecurityCenter::V2::Source] - # - # @raise [::Google::Cloud::Error] if the REST call is aborted. - # - # @example Basic example - # require "google/cloud/security_center/v2" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::SecurityCenter::V2::SecurityCenter::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::SecurityCenter::V2::UpdateSourceRequest.new - # - # # Call the update_source method. - # result = client.update_source request - # - # # The returned object is of type Google::Cloud::SecurityCenter::V2::Source. - # p result - # - def update_source request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::SecurityCenter::V2::UpdateSourceRequest - - # Converts hash 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_source.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::SecurityCenter::V2::VERSION, - transports_version_send: [:rest] - - call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - options.apply_defaults timeout: @config.rpcs.update_source.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.update_source.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @security_center_stub.update_source 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 SecurityCenter REST API. - # - # This class represents the configuration for SecurityCenter REST, - # providing control over timeouts, retry behavior, logging, transport - # parameters, and other low-level controls. Certain parameters can also be - # applied individually to specific RPCs. See - # {::Google::Cloud::SecurityCenter::V2::SecurityCenter::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 - # # batch_create_resource_value_configs to 20 seconds, - # # and all remaining timeouts to 10 seconds. - # ::Google::Cloud::SecurityCenter::V2::SecurityCenter::Rest::Client.configure do |config| - # config.timeout = 10.0 - # config.rpcs.batch_create_resource_value_configs.timeout = 20.0 - # end - # - # # Apply the above configuration only to a new client. - # client = ::Google::Cloud::SecurityCenter::V2::SecurityCenter::Rest::Client.new do |config| - # config.timeout = 10.0 - # config.rpcs.batch_create_resource_value_configs.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 = "securitycenter.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 SecurityCenter 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 `batch_create_resource_value_configs` - # @return [::Gapic::Config::Method] - # - attr_reader :batch_create_resource_value_configs - ## - # RPC-specific configuration for `bulk_mute_findings` - # @return [::Gapic::Config::Method] - # - attr_reader :bulk_mute_findings - ## - # RPC-specific configuration for `create_big_query_export` - # @return [::Gapic::Config::Method] - # - attr_reader :create_big_query_export - ## - # RPC-specific configuration for `create_finding` - # @return [::Gapic::Config::Method] - # - attr_reader :create_finding - ## - # RPC-specific configuration for `create_mute_config` - # @return [::Gapic::Config::Method] - # - attr_reader :create_mute_config - ## - # RPC-specific configuration for `create_notification_config` - # @return [::Gapic::Config::Method] - # - attr_reader :create_notification_config - ## - # RPC-specific configuration for `create_source` - # @return [::Gapic::Config::Method] - # - attr_reader :create_source - ## - # RPC-specific configuration for `delete_big_query_export` - # @return [::Gapic::Config::Method] - # - attr_reader :delete_big_query_export - ## - # RPC-specific configuration for `delete_mute_config` - # @return [::Gapic::Config::Method] - # - attr_reader :delete_mute_config - ## - # RPC-specific configuration for `delete_notification_config` - # @return [::Gapic::Config::Method] - # - attr_reader :delete_notification_config - ## - # RPC-specific configuration for `delete_resource_value_config` - # @return [::Gapic::Config::Method] - # - attr_reader :delete_resource_value_config - ## - # RPC-specific configuration for `get_big_query_export` - # @return [::Gapic::Config::Method] - # - attr_reader :get_big_query_export - ## - # RPC-specific configuration for `get_simulation` - # @return [::Gapic::Config::Method] - # - attr_reader :get_simulation - ## - # RPC-specific configuration for `get_valued_resource` - # @return [::Gapic::Config::Method] - # - attr_reader :get_valued_resource - ## - # RPC-specific configuration for `get_iam_policy` - # @return [::Gapic::Config::Method] - # - attr_reader :get_iam_policy - ## - # RPC-specific configuration for `get_mute_config` - # @return [::Gapic::Config::Method] - # - attr_reader :get_mute_config - ## - # RPC-specific configuration for `get_notification_config` - # @return [::Gapic::Config::Method] - # - attr_reader :get_notification_config - ## - # RPC-specific configuration for `get_resource_value_config` - # @return [::Gapic::Config::Method] - # - attr_reader :get_resource_value_config - ## - # RPC-specific configuration for `get_source` - # @return [::Gapic::Config::Method] - # - attr_reader :get_source - ## - # RPC-specific configuration for `group_findings` - # @return [::Gapic::Config::Method] - # - attr_reader :group_findings - ## - # RPC-specific configuration for `list_attack_paths` - # @return [::Gapic::Config::Method] - # - attr_reader :list_attack_paths - ## - # RPC-specific configuration for `list_big_query_exports` - # @return [::Gapic::Config::Method] - # - attr_reader :list_big_query_exports - ## - # RPC-specific configuration for `list_findings` - # @return [::Gapic::Config::Method] - # - attr_reader :list_findings - ## - # RPC-specific configuration for `list_mute_configs` - # @return [::Gapic::Config::Method] - # - attr_reader :list_mute_configs - ## - # RPC-specific configuration for `list_notification_configs` - # @return [::Gapic::Config::Method] - # - attr_reader :list_notification_configs - ## - # RPC-specific configuration for `list_resource_value_configs` - # @return [::Gapic::Config::Method] - # - attr_reader :list_resource_value_configs - ## - # RPC-specific configuration for `list_sources` - # @return [::Gapic::Config::Method] - # - attr_reader :list_sources - ## - # RPC-specific configuration for `list_valued_resources` - # @return [::Gapic::Config::Method] - # - attr_reader :list_valued_resources - ## - # RPC-specific configuration for `set_finding_state` - # @return [::Gapic::Config::Method] - # - attr_reader :set_finding_state - ## - # RPC-specific configuration for `set_iam_policy` - # @return [::Gapic::Config::Method] - # - attr_reader :set_iam_policy - ## - # RPC-specific configuration for `set_mute` - # @return [::Gapic::Config::Method] - # - attr_reader :set_mute - ## - # RPC-specific configuration for `test_iam_permissions` - # @return [::Gapic::Config::Method] - # - attr_reader :test_iam_permissions - ## - # RPC-specific configuration for `update_big_query_export` - # @return [::Gapic::Config::Method] - # - attr_reader :update_big_query_export - ## - # RPC-specific configuration for `update_external_system` - # @return [::Gapic::Config::Method] - # - attr_reader :update_external_system - ## - # RPC-specific configuration for `update_finding` - # @return [::Gapic::Config::Method] - # - attr_reader :update_finding - ## - # RPC-specific configuration for `update_mute_config` - # @return [::Gapic::Config::Method] - # - attr_reader :update_mute_config - ## - # RPC-specific configuration for `update_notification_config` - # @return [::Gapic::Config::Method] - # - attr_reader :update_notification_config - ## - # RPC-specific configuration for `update_resource_value_config` - # @return [::Gapic::Config::Method] - # - attr_reader :update_resource_value_config - ## - # RPC-specific configuration for `update_security_marks` - # @return [::Gapic::Config::Method] - # - attr_reader :update_security_marks - ## - # RPC-specific configuration for `update_source` - # @return [::Gapic::Config::Method] - # - attr_reader :update_source - - # @private - def initialize parent_rpcs = nil - batch_create_resource_value_configs_config = parent_rpcs.batch_create_resource_value_configs if parent_rpcs.respond_to? :batch_create_resource_value_configs - @batch_create_resource_value_configs = ::Gapic::Config::Method.new batch_create_resource_value_configs_config - bulk_mute_findings_config = parent_rpcs.bulk_mute_findings if parent_rpcs.respond_to? :bulk_mute_findings - @bulk_mute_findings = ::Gapic::Config::Method.new bulk_mute_findings_config - create_big_query_export_config = parent_rpcs.create_big_query_export if parent_rpcs.respond_to? :create_big_query_export - @create_big_query_export = ::Gapic::Config::Method.new create_big_query_export_config - create_finding_config = parent_rpcs.create_finding if parent_rpcs.respond_to? :create_finding - @create_finding = ::Gapic::Config::Method.new create_finding_config - create_mute_config_config = parent_rpcs.create_mute_config if parent_rpcs.respond_to? :create_mute_config - @create_mute_config = ::Gapic::Config::Method.new create_mute_config_config - create_notification_config_config = parent_rpcs.create_notification_config if parent_rpcs.respond_to? :create_notification_config - @create_notification_config = ::Gapic::Config::Method.new create_notification_config_config - create_source_config = parent_rpcs.create_source if parent_rpcs.respond_to? :create_source - @create_source = ::Gapic::Config::Method.new create_source_config - delete_big_query_export_config = parent_rpcs.delete_big_query_export if parent_rpcs.respond_to? :delete_big_query_export - @delete_big_query_export = ::Gapic::Config::Method.new delete_big_query_export_config - delete_mute_config_config = parent_rpcs.delete_mute_config if parent_rpcs.respond_to? :delete_mute_config - @delete_mute_config = ::Gapic::Config::Method.new delete_mute_config_config - delete_notification_config_config = parent_rpcs.delete_notification_config if parent_rpcs.respond_to? :delete_notification_config - @delete_notification_config = ::Gapic::Config::Method.new delete_notification_config_config - delete_resource_value_config_config = parent_rpcs.delete_resource_value_config if parent_rpcs.respond_to? :delete_resource_value_config - @delete_resource_value_config = ::Gapic::Config::Method.new delete_resource_value_config_config - get_big_query_export_config = parent_rpcs.get_big_query_export if parent_rpcs.respond_to? :get_big_query_export - @get_big_query_export = ::Gapic::Config::Method.new get_big_query_export_config - get_simulation_config = parent_rpcs.get_simulation if parent_rpcs.respond_to? :get_simulation - @get_simulation = ::Gapic::Config::Method.new get_simulation_config - get_valued_resource_config = parent_rpcs.get_valued_resource if parent_rpcs.respond_to? :get_valued_resource - @get_valued_resource = ::Gapic::Config::Method.new get_valued_resource_config - get_iam_policy_config = parent_rpcs.get_iam_policy if parent_rpcs.respond_to? :get_iam_policy - @get_iam_policy = ::Gapic::Config::Method.new get_iam_policy_config - get_mute_config_config = parent_rpcs.get_mute_config if parent_rpcs.respond_to? :get_mute_config - @get_mute_config = ::Gapic::Config::Method.new get_mute_config_config - get_notification_config_config = parent_rpcs.get_notification_config if parent_rpcs.respond_to? :get_notification_config - @get_notification_config = ::Gapic::Config::Method.new get_notification_config_config - get_resource_value_config_config = parent_rpcs.get_resource_value_config if parent_rpcs.respond_to? :get_resource_value_config - @get_resource_value_config = ::Gapic::Config::Method.new get_resource_value_config_config - get_source_config = parent_rpcs.get_source if parent_rpcs.respond_to? :get_source - @get_source = ::Gapic::Config::Method.new get_source_config - group_findings_config = parent_rpcs.group_findings if parent_rpcs.respond_to? :group_findings - @group_findings = ::Gapic::Config::Method.new group_findings_config - list_attack_paths_config = parent_rpcs.list_attack_paths if parent_rpcs.respond_to? :list_attack_paths - @list_attack_paths = ::Gapic::Config::Method.new list_attack_paths_config - list_big_query_exports_config = parent_rpcs.list_big_query_exports if parent_rpcs.respond_to? :list_big_query_exports - @list_big_query_exports = ::Gapic::Config::Method.new list_big_query_exports_config - list_findings_config = parent_rpcs.list_findings if parent_rpcs.respond_to? :list_findings - @list_findings = ::Gapic::Config::Method.new list_findings_config - list_mute_configs_config = parent_rpcs.list_mute_configs if parent_rpcs.respond_to? :list_mute_configs - @list_mute_configs = ::Gapic::Config::Method.new list_mute_configs_config - list_notification_configs_config = parent_rpcs.list_notification_configs if parent_rpcs.respond_to? :list_notification_configs - @list_notification_configs = ::Gapic::Config::Method.new list_notification_configs_config - list_resource_value_configs_config = parent_rpcs.list_resource_value_configs if parent_rpcs.respond_to? :list_resource_value_configs - @list_resource_value_configs = ::Gapic::Config::Method.new list_resource_value_configs_config - list_sources_config = parent_rpcs.list_sources if parent_rpcs.respond_to? :list_sources - @list_sources = ::Gapic::Config::Method.new list_sources_config - list_valued_resources_config = parent_rpcs.list_valued_resources if parent_rpcs.respond_to? :list_valued_resources - @list_valued_resources = ::Gapic::Config::Method.new list_valued_resources_config - set_finding_state_config = parent_rpcs.set_finding_state if parent_rpcs.respond_to? :set_finding_state - @set_finding_state = ::Gapic::Config::Method.new set_finding_state_config - set_iam_policy_config = parent_rpcs.set_iam_policy if parent_rpcs.respond_to? :set_iam_policy - @set_iam_policy = ::Gapic::Config::Method.new set_iam_policy_config - set_mute_config = parent_rpcs.set_mute if parent_rpcs.respond_to? :set_mute - @set_mute = ::Gapic::Config::Method.new set_mute_config - test_iam_permissions_config = parent_rpcs.test_iam_permissions if parent_rpcs.respond_to? :test_iam_permissions - @test_iam_permissions = ::Gapic::Config::Method.new test_iam_permissions_config - update_big_query_export_config = parent_rpcs.update_big_query_export if parent_rpcs.respond_to? :update_big_query_export - @update_big_query_export = ::Gapic::Config::Method.new update_big_query_export_config - update_external_system_config = parent_rpcs.update_external_system if parent_rpcs.respond_to? :update_external_system - @update_external_system = ::Gapic::Config::Method.new update_external_system_config - update_finding_config = parent_rpcs.update_finding if parent_rpcs.respond_to? :update_finding - @update_finding = ::Gapic::Config::Method.new update_finding_config - update_mute_config_config = parent_rpcs.update_mute_config if parent_rpcs.respond_to? :update_mute_config - @update_mute_config = ::Gapic::Config::Method.new update_mute_config_config - update_notification_config_config = parent_rpcs.update_notification_config if parent_rpcs.respond_to? :update_notification_config - @update_notification_config = ::Gapic::Config::Method.new update_notification_config_config - update_resource_value_config_config = parent_rpcs.update_resource_value_config if parent_rpcs.respond_to? :update_resource_value_config - @update_resource_value_config = ::Gapic::Config::Method.new update_resource_value_config_config - update_security_marks_config = parent_rpcs.update_security_marks if parent_rpcs.respond_to? :update_security_marks - @update_security_marks = ::Gapic::Config::Method.new update_security_marks_config - update_source_config = parent_rpcs.update_source if parent_rpcs.respond_to? :update_source - @update_source = ::Gapic::Config::Method.new update_source_config - - yield self if block_given? - end - end - end - end - end - end - end - end - end -end diff --git a/owl-bot-staging/google-cloud-security_center-v2/lib/google/cloud/security_center/v2/security_center/rest/operations.rb b/owl-bot-staging/google-cloud-security_center-v2/lib/google/cloud/security_center/v2/security_center/rest/operations.rb deleted file mode 100644 index e2f7bdbbfacc..000000000000 --- a/owl-bot-staging/google-cloud-security_center-v2/lib/google/cloud/security_center/v2/security_center/rest/operations.rb +++ /dev/null @@ -1,924 +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 Cloud - module SecurityCenter - module V2 - module SecurityCenter - module Rest - # Service that implements Longrunning Operations API. - class Operations - # @private - API_VERSION = "" - - # @private - DEFAULT_ENDPOINT_TEMPLATE = "securitycenter.$UNIVERSE_DOMAIN$" - - # @private - attr_reader :operations_stub - - ## - # Configuration for the SecurityCenter 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 SecurityCenter 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::SecurityCenter::V2::VERSION, - transports_version_send: [:rest] - - call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - options.apply_defaults timeout: @config.rpcs.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::SecurityCenter::V2::VERSION, - transports_version_send: [:rest] - - call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - options.apply_defaults timeout: @config.rpcs.get_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::SecurityCenter::V2::VERSION, - transports_version_send: [:rest] - - call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - options.apply_defaults timeout: @config.rpcs.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::SecurityCenter::V2::VERSION, - transports_version_send: [:rest] - - call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - options.apply_defaults timeout: @config.rpcs.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 = "securitycenter.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: "/v2/{name}", - matches: [ - ["name", %r{^organizations/[^/]+/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: "/v2/{name}", - matches: [ - ["name", %r{^organizations/[^/]+/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: "/v2/{name}", - matches: [ - ["name", %r{^organizations/[^/]+/operations/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the cancel_operation REST call - # - # @param request_pb [::Google::Longrunning::CancelOperationRequest] - # A request object representing the call parameters. Required. - # @return [Array(String, [String, nil], Hash{String => String})] - # Uri, Body, Query string parameters - def self.transcode_cancel_operation_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :post, - uri_template: "/v2/{name}:cancel", - matches: [ - ["name", %r{^organizations/[^/]+/operations/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - end - end - end - end - end - end -end diff --git a/owl-bot-staging/google-cloud-security_center-v2/lib/google/cloud/security_center/v2/security_center/rest/service_stub.rb b/owl-bot-staging/google-cloud-security_center-v2/lib/google/cloud/security_center/v2/security_center/rest/service_stub.rb deleted file mode 100644 index 49be184914d1..000000000000 --- a/owl-bot-staging/google-cloud-security_center-v2/lib/google/cloud/security_center/v2/security_center/rest/service_stub.rb +++ /dev/null @@ -1,3336 +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/securitycenter/v2/securitycenter_service_pb" - -module Google - module Cloud - module SecurityCenter - module V2 - module SecurityCenter - module Rest - ## - # REST service stub for the SecurityCenter 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 batch_create_resource_value_configs REST call - # - # @param request_pb [::Google::Cloud::SecurityCenter::V2::BatchCreateResourceValueConfigsRequest] - # A request object representing the call parameters. Required. - # @param options [::Gapic::CallOptions] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Cloud::SecurityCenter::V2::BatchCreateResourceValueConfigsResponse] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::SecurityCenter::V2::BatchCreateResourceValueConfigsResponse] - # A result object deserialized from the server's reply - def batch_create_resource_value_configs request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_batch_create_resource_value_configs_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: "batch_create_resource_value_configs", - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Cloud::SecurityCenter::V2::BatchCreateResourceValueConfigsResponse.decode_json response.body, ignore_unknown_fields: true - catch :response do - yield result, operation if block_given? - result - end - end - - ## - # Baseline implementation for the bulk_mute_findings REST call - # - # @param request_pb [::Google::Cloud::SecurityCenter::V2::BulkMuteFindingsRequest] - # 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 bulk_mute_findings request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_bulk_mute_findings_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: "bulk_mute_findings", - 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 create_big_query_export REST call - # - # @param request_pb [::Google::Cloud::SecurityCenter::V2::CreateBigQueryExportRequest] - # A request object representing the call parameters. Required. - # @param options [::Gapic::CallOptions] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Cloud::SecurityCenter::V2::BigQueryExport] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::SecurityCenter::V2::BigQueryExport] - # A result object deserialized from the server's reply - def create_big_query_export request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_create_big_query_export_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_big_query_export", - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Cloud::SecurityCenter::V2::BigQueryExport.decode_json response.body, ignore_unknown_fields: true - catch :response do - yield result, operation if block_given? - result - end - end - - ## - # Baseline implementation for the create_finding REST call - # - # @param request_pb [::Google::Cloud::SecurityCenter::V2::CreateFindingRequest] - # A request object representing the call parameters. Required. - # @param options [::Gapic::CallOptions] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Cloud::SecurityCenter::V2::Finding] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::SecurityCenter::V2::Finding] - # A result object deserialized from the server's reply - def create_finding request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_create_finding_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_finding", - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Cloud::SecurityCenter::V2::Finding.decode_json response.body, ignore_unknown_fields: true - catch :response do - yield result, operation if block_given? - result - end - end - - ## - # Baseline implementation for the create_mute_config REST call - # - # @param request_pb [::Google::Cloud::SecurityCenter::V2::CreateMuteConfigRequest] - # A request object representing the call parameters. Required. - # @param options [::Gapic::CallOptions] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Cloud::SecurityCenter::V2::MuteConfig] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::SecurityCenter::V2::MuteConfig] - # A result object deserialized from the server's reply - def create_mute_config request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_create_mute_config_request request_pb - query_string_params = if query_string_params.any? - query_string_params.to_h { |p| p.split "=", 2 } - else - {} - end - - response = @client_stub.make_http_request( - verb, - uri: uri, - body: body || "", - params: query_string_params, - method_name: "create_mute_config", - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Cloud::SecurityCenter::V2::MuteConfig.decode_json response.body, ignore_unknown_fields: true - catch :response do - yield result, operation if block_given? - result - end - end - - ## - # Baseline implementation for the create_notification_config REST call - # - # @param request_pb [::Google::Cloud::SecurityCenter::V2::CreateNotificationConfigRequest] - # A request object representing the call parameters. Required. - # @param options [::Gapic::CallOptions] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Cloud::SecurityCenter::V2::NotificationConfig] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::SecurityCenter::V2::NotificationConfig] - # A result object deserialized from the server's reply - def create_notification_config request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_create_notification_config_request request_pb - query_string_params = if query_string_params.any? - query_string_params.to_h { |p| p.split "=", 2 } - else - {} - end - - response = @client_stub.make_http_request( - verb, - uri: uri, - body: body || "", - params: query_string_params, - method_name: "create_notification_config", - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Cloud::SecurityCenter::V2::NotificationConfig.decode_json response.body, ignore_unknown_fields: true - catch :response do - yield result, operation if block_given? - result - end - end - - ## - # Baseline implementation for the create_source REST call - # - # @param request_pb [::Google::Cloud::SecurityCenter::V2::CreateSourceRequest] - # A request object representing the call parameters. Required. - # @param options [::Gapic::CallOptions] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Cloud::SecurityCenter::V2::Source] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::SecurityCenter::V2::Source] - # A result object deserialized from the server's reply - def create_source request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_create_source_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_source", - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Cloud::SecurityCenter::V2::Source.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_big_query_export REST call - # - # @param request_pb [::Google::Cloud::SecurityCenter::V2::DeleteBigQueryExportRequest] - # 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_big_query_export request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_delete_big_query_export_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_big_query_export", - 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 delete_mute_config REST call - # - # @param request_pb [::Google::Cloud::SecurityCenter::V2::DeleteMuteConfigRequest] - # 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_mute_config request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_delete_mute_config_request request_pb - query_string_params = if query_string_params.any? - query_string_params.to_h { |p| p.split "=", 2 } - else - {} - end - - response = @client_stub.make_http_request( - verb, - uri: uri, - body: body || "", - params: query_string_params, - method_name: "delete_mute_config", - 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 delete_notification_config REST call - # - # @param request_pb [::Google::Cloud::SecurityCenter::V2::DeleteNotificationConfigRequest] - # 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_notification_config request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_delete_notification_config_request request_pb - query_string_params = if query_string_params.any? - query_string_params.to_h { |p| p.split "=", 2 } - else - {} - end - - response = @client_stub.make_http_request( - verb, - uri: uri, - body: body || "", - params: query_string_params, - method_name: "delete_notification_config", - 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 delete_resource_value_config REST call - # - # @param request_pb [::Google::Cloud::SecurityCenter::V2::DeleteResourceValueConfigRequest] - # 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_resource_value_config request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_delete_resource_value_config_request request_pb - query_string_params = if query_string_params.any? - query_string_params.to_h { |p| p.split "=", 2 } - else - {} - end - - response = @client_stub.make_http_request( - verb, - uri: uri, - body: body || "", - params: query_string_params, - method_name: "delete_resource_value_config", - 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 get_big_query_export REST call - # - # @param request_pb [::Google::Cloud::SecurityCenter::V2::GetBigQueryExportRequest] - # A request object representing the call parameters. Required. - # @param options [::Gapic::CallOptions] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Cloud::SecurityCenter::V2::BigQueryExport] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::SecurityCenter::V2::BigQueryExport] - # A result object deserialized from the server's reply - def get_big_query_export request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_get_big_query_export_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_big_query_export", - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Cloud::SecurityCenter::V2::BigQueryExport.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_simulation REST call - # - # @param request_pb [::Google::Cloud::SecurityCenter::V2::GetSimulationRequest] - # A request object representing the call parameters. Required. - # @param options [::Gapic::CallOptions] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Cloud::SecurityCenter::V2::Simulation] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::SecurityCenter::V2::Simulation] - # A result object deserialized from the server's reply - def get_simulation request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_get_simulation_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_simulation", - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Cloud::SecurityCenter::V2::Simulation.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_valued_resource REST call - # - # @param request_pb [::Google::Cloud::SecurityCenter::V2::GetValuedResourceRequest] - # A request object representing the call parameters. Required. - # @param options [::Gapic::CallOptions] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Cloud::SecurityCenter::V2::ValuedResource] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::SecurityCenter::V2::ValuedResource] - # A result object deserialized from the server's reply - def get_valued_resource request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_get_valued_resource_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_valued_resource", - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Cloud::SecurityCenter::V2::ValuedResource.decode_json response.body, ignore_unknown_fields: true - catch :response do - yield result, operation if block_given? - result - end - end - - ## - # Baseline implementation for the get_iam_policy REST call - # - # @param request_pb [::Google::Iam::V1::GetIamPolicyRequest] - # A request object representing the call parameters. Required. - # @param options [::Gapic::CallOptions] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Iam::V1::Policy] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Iam::V1::Policy] - # A result object deserialized from the server's reply - def get_iam_policy request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_get_iam_policy_request request_pb - query_string_params = if query_string_params.any? - query_string_params.to_h { |p| p.split "=", 2 } - else - {} - end - - response = @client_stub.make_http_request( - verb, - uri: uri, - body: body || "", - params: query_string_params, - method_name: "get_iam_policy", - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Iam::V1::Policy.decode_json response.body, ignore_unknown_fields: true - catch :response do - yield result, operation if block_given? - result - end - end - - ## - # Baseline implementation for the get_mute_config REST call - # - # @param request_pb [::Google::Cloud::SecurityCenter::V2::GetMuteConfigRequest] - # A request object representing the call parameters. Required. - # @param options [::Gapic::CallOptions] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Cloud::SecurityCenter::V2::MuteConfig] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::SecurityCenter::V2::MuteConfig] - # A result object deserialized from the server's reply - def get_mute_config request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_get_mute_config_request request_pb - query_string_params = if query_string_params.any? - query_string_params.to_h { |p| p.split "=", 2 } - else - {} - end - - response = @client_stub.make_http_request( - verb, - uri: uri, - body: body || "", - params: query_string_params, - method_name: "get_mute_config", - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Cloud::SecurityCenter::V2::MuteConfig.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_notification_config REST call - # - # @param request_pb [::Google::Cloud::SecurityCenter::V2::GetNotificationConfigRequest] - # A request object representing the call parameters. Required. - # @param options [::Gapic::CallOptions] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Cloud::SecurityCenter::V2::NotificationConfig] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::SecurityCenter::V2::NotificationConfig] - # A result object deserialized from the server's reply - def get_notification_config request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_get_notification_config_request request_pb - query_string_params = if query_string_params.any? - query_string_params.to_h { |p| p.split "=", 2 } - else - {} - end - - response = @client_stub.make_http_request( - verb, - uri: uri, - body: body || "", - params: query_string_params, - method_name: "get_notification_config", - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Cloud::SecurityCenter::V2::NotificationConfig.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_resource_value_config REST call - # - # @param request_pb [::Google::Cloud::SecurityCenter::V2::GetResourceValueConfigRequest] - # A request object representing the call parameters. Required. - # @param options [::Gapic::CallOptions] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Cloud::SecurityCenter::V2::ResourceValueConfig] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::SecurityCenter::V2::ResourceValueConfig] - # A result object deserialized from the server's reply - def get_resource_value_config request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_get_resource_value_config_request request_pb - query_string_params = if query_string_params.any? - query_string_params.to_h { |p| p.split "=", 2 } - else - {} - end - - response = @client_stub.make_http_request( - verb, - uri: uri, - body: body || "", - params: query_string_params, - method_name: "get_resource_value_config", - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Cloud::SecurityCenter::V2::ResourceValueConfig.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_source REST call - # - # @param request_pb [::Google::Cloud::SecurityCenter::V2::GetSourceRequest] - # A request object representing the call parameters. Required. - # @param options [::Gapic::CallOptions] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Cloud::SecurityCenter::V2::Source] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::SecurityCenter::V2::Source] - # A result object deserialized from the server's reply - def get_source request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_get_source_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_source", - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Cloud::SecurityCenter::V2::Source.decode_json response.body, ignore_unknown_fields: true - catch :response do - yield result, operation if block_given? - result - end - end - - ## - # Baseline implementation for the group_findings REST call - # - # @param request_pb [::Google::Cloud::SecurityCenter::V2::GroupFindingsRequest] - # A request object representing the call parameters. Required. - # @param options [::Gapic::CallOptions] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Cloud::SecurityCenter::V2::GroupFindingsResponse] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::SecurityCenter::V2::GroupFindingsResponse] - # A result object deserialized from the server's reply - def group_findings request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_group_findings_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: "group_findings", - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Cloud::SecurityCenter::V2::GroupFindingsResponse.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_attack_paths REST call - # - # @param request_pb [::Google::Cloud::SecurityCenter::V2::ListAttackPathsRequest] - # A request object representing the call parameters. Required. - # @param options [::Gapic::CallOptions] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Cloud::SecurityCenter::V2::ListAttackPathsResponse] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::SecurityCenter::V2::ListAttackPathsResponse] - # A result object deserialized from the server's reply - def list_attack_paths request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_list_attack_paths_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_attack_paths", - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Cloud::SecurityCenter::V2::ListAttackPathsResponse.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_big_query_exports REST call - # - # @param request_pb [::Google::Cloud::SecurityCenter::V2::ListBigQueryExportsRequest] - # A request object representing the call parameters. Required. - # @param options [::Gapic::CallOptions] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Cloud::SecurityCenter::V2::ListBigQueryExportsResponse] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::SecurityCenter::V2::ListBigQueryExportsResponse] - # A result object deserialized from the server's reply - def list_big_query_exports request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_list_big_query_exports_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_big_query_exports", - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Cloud::SecurityCenter::V2::ListBigQueryExportsResponse.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_findings REST call - # - # @param request_pb [::Google::Cloud::SecurityCenter::V2::ListFindingsRequest] - # A request object representing the call parameters. Required. - # @param options [::Gapic::CallOptions] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Cloud::SecurityCenter::V2::ListFindingsResponse] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::SecurityCenter::V2::ListFindingsResponse] - # A result object deserialized from the server's reply - def list_findings request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_list_findings_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_findings", - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Cloud::SecurityCenter::V2::ListFindingsResponse.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_mute_configs REST call - # - # @param request_pb [::Google::Cloud::SecurityCenter::V2::ListMuteConfigsRequest] - # A request object representing the call parameters. Required. - # @param options [::Gapic::CallOptions] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Cloud::SecurityCenter::V2::ListMuteConfigsResponse] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::SecurityCenter::V2::ListMuteConfigsResponse] - # A result object deserialized from the server's reply - def list_mute_configs request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_list_mute_configs_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_mute_configs", - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Cloud::SecurityCenter::V2::ListMuteConfigsResponse.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_notification_configs REST call - # - # @param request_pb [::Google::Cloud::SecurityCenter::V2::ListNotificationConfigsRequest] - # A request object representing the call parameters. Required. - # @param options [::Gapic::CallOptions] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Cloud::SecurityCenter::V2::ListNotificationConfigsResponse] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::SecurityCenter::V2::ListNotificationConfigsResponse] - # A result object deserialized from the server's reply - def list_notification_configs request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_list_notification_configs_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_notification_configs", - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Cloud::SecurityCenter::V2::ListNotificationConfigsResponse.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_resource_value_configs REST call - # - # @param request_pb [::Google::Cloud::SecurityCenter::V2::ListResourceValueConfigsRequest] - # A request object representing the call parameters. Required. - # @param options [::Gapic::CallOptions] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Cloud::SecurityCenter::V2::ListResourceValueConfigsResponse] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::SecurityCenter::V2::ListResourceValueConfigsResponse] - # A result object deserialized from the server's reply - def list_resource_value_configs request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_list_resource_value_configs_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_resource_value_configs", - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Cloud::SecurityCenter::V2::ListResourceValueConfigsResponse.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_sources REST call - # - # @param request_pb [::Google::Cloud::SecurityCenter::V2::ListSourcesRequest] - # A request object representing the call parameters. Required. - # @param options [::Gapic::CallOptions] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Cloud::SecurityCenter::V2::ListSourcesResponse] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::SecurityCenter::V2::ListSourcesResponse] - # A result object deserialized from the server's reply - def list_sources request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_list_sources_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_sources", - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Cloud::SecurityCenter::V2::ListSourcesResponse.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_valued_resources REST call - # - # @param request_pb [::Google::Cloud::SecurityCenter::V2::ListValuedResourcesRequest] - # A request object representing the call parameters. Required. - # @param options [::Gapic::CallOptions] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Cloud::SecurityCenter::V2::ListValuedResourcesResponse] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::SecurityCenter::V2::ListValuedResourcesResponse] - # A result object deserialized from the server's reply - def list_valued_resources request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_list_valued_resources_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_valued_resources", - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Cloud::SecurityCenter::V2::ListValuedResourcesResponse.decode_json response.body, ignore_unknown_fields: true - catch :response do - yield result, operation if block_given? - result - end - end - - ## - # Baseline implementation for the set_finding_state REST call - # - # @param request_pb [::Google::Cloud::SecurityCenter::V2::SetFindingStateRequest] - # A request object representing the call parameters. Required. - # @param options [::Gapic::CallOptions] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Cloud::SecurityCenter::V2::Finding] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::SecurityCenter::V2::Finding] - # A result object deserialized from the server's reply - def set_finding_state request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_set_finding_state_request request_pb - query_string_params = if query_string_params.any? - query_string_params.to_h { |p| p.split "=", 2 } - else - {} - end - - response = @client_stub.make_http_request( - verb, - uri: uri, - body: body || "", - params: query_string_params, - method_name: "set_finding_state", - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Cloud::SecurityCenter::V2::Finding.decode_json response.body, ignore_unknown_fields: true - catch :response do - yield result, operation if block_given? - result - end - end - - ## - # Baseline implementation for the set_iam_policy REST call - # - # @param request_pb [::Google::Iam::V1::SetIamPolicyRequest] - # A request object representing the call parameters. Required. - # @param options [::Gapic::CallOptions] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Iam::V1::Policy] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Iam::V1::Policy] - # A result object deserialized from the server's reply - def set_iam_policy request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_set_iam_policy_request request_pb - query_string_params = if query_string_params.any? - query_string_params.to_h { |p| p.split "=", 2 } - else - {} - end - - response = @client_stub.make_http_request( - verb, - uri: uri, - body: body || "", - params: query_string_params, - method_name: "set_iam_policy", - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Iam::V1::Policy.decode_json response.body, ignore_unknown_fields: true - catch :response do - yield result, operation if block_given? - result - end - end - - ## - # Baseline implementation for the set_mute REST call - # - # @param request_pb [::Google::Cloud::SecurityCenter::V2::SetMuteRequest] - # A request object representing the call parameters. Required. - # @param options [::Gapic::CallOptions] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Cloud::SecurityCenter::V2::Finding] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::SecurityCenter::V2::Finding] - # A result object deserialized from the server's reply - def set_mute request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_set_mute_request request_pb - query_string_params = if query_string_params.any? - query_string_params.to_h { |p| p.split "=", 2 } - else - {} - end - - response = @client_stub.make_http_request( - verb, - uri: uri, - body: body || "", - params: query_string_params, - method_name: "set_mute", - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Cloud::SecurityCenter::V2::Finding.decode_json response.body, ignore_unknown_fields: true - catch :response do - yield result, operation if block_given? - result - end - end - - ## - # Baseline implementation for the test_iam_permissions REST call - # - # @param request_pb [::Google::Iam::V1::TestIamPermissionsRequest] - # A request object representing the call parameters. Required. - # @param options [::Gapic::CallOptions] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Iam::V1::TestIamPermissionsResponse] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Iam::V1::TestIamPermissionsResponse] - # A result object deserialized from the server's reply - def test_iam_permissions request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_test_iam_permissions_request request_pb - query_string_params = if query_string_params.any? - query_string_params.to_h { |p| p.split "=", 2 } - else - {} - end - - response = @client_stub.make_http_request( - verb, - uri: uri, - body: body || "", - params: query_string_params, - method_name: "test_iam_permissions", - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Iam::V1::TestIamPermissionsResponse.decode_json response.body, ignore_unknown_fields: true - catch :response do - yield result, operation if block_given? - result - end - end - - ## - # Baseline implementation for the update_big_query_export REST call - # - # @param request_pb [::Google::Cloud::SecurityCenter::V2::UpdateBigQueryExportRequest] - # A request object representing the call parameters. Required. - # @param options [::Gapic::CallOptions] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Cloud::SecurityCenter::V2::BigQueryExport] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::SecurityCenter::V2::BigQueryExport] - # A result object deserialized from the server's reply - def update_big_query_export request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_update_big_query_export_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_big_query_export", - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Cloud::SecurityCenter::V2::BigQueryExport.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_external_system REST call - # - # @param request_pb [::Google::Cloud::SecurityCenter::V2::UpdateExternalSystemRequest] - # A request object representing the call parameters. Required. - # @param options [::Gapic::CallOptions] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Cloud::SecurityCenter::V2::ExternalSystem] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::SecurityCenter::V2::ExternalSystem] - # A result object deserialized from the server's reply - def update_external_system request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_update_external_system_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_external_system", - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Cloud::SecurityCenter::V2::ExternalSystem.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_finding REST call - # - # @param request_pb [::Google::Cloud::SecurityCenter::V2::UpdateFindingRequest] - # A request object representing the call parameters. Required. - # @param options [::Gapic::CallOptions] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Cloud::SecurityCenter::V2::Finding] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::SecurityCenter::V2::Finding] - # A result object deserialized from the server's reply - def update_finding request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_update_finding_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_finding", - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Cloud::SecurityCenter::V2::Finding.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_mute_config REST call - # - # @param request_pb [::Google::Cloud::SecurityCenter::V2::UpdateMuteConfigRequest] - # A request object representing the call parameters. Required. - # @param options [::Gapic::CallOptions] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Cloud::SecurityCenter::V2::MuteConfig] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::SecurityCenter::V2::MuteConfig] - # A result object deserialized from the server's reply - def update_mute_config request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_update_mute_config_request request_pb - query_string_params = if query_string_params.any? - query_string_params.to_h { |p| p.split "=", 2 } - else - {} - end - - response = @client_stub.make_http_request( - verb, - uri: uri, - body: body || "", - params: query_string_params, - method_name: "update_mute_config", - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Cloud::SecurityCenter::V2::MuteConfig.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_notification_config REST call - # - # @param request_pb [::Google::Cloud::SecurityCenter::V2::UpdateNotificationConfigRequest] - # A request object representing the call parameters. Required. - # @param options [::Gapic::CallOptions] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Cloud::SecurityCenter::V2::NotificationConfig] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::SecurityCenter::V2::NotificationConfig] - # A result object deserialized from the server's reply - def update_notification_config request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_update_notification_config_request request_pb - query_string_params = if query_string_params.any? - query_string_params.to_h { |p| p.split "=", 2 } - else - {} - end - - response = @client_stub.make_http_request( - verb, - uri: uri, - body: body || "", - params: query_string_params, - method_name: "update_notification_config", - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Cloud::SecurityCenter::V2::NotificationConfig.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_resource_value_config REST call - # - # @param request_pb [::Google::Cloud::SecurityCenter::V2::UpdateResourceValueConfigRequest] - # A request object representing the call parameters. Required. - # @param options [::Gapic::CallOptions] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Cloud::SecurityCenter::V2::ResourceValueConfig] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::SecurityCenter::V2::ResourceValueConfig] - # A result object deserialized from the server's reply - def update_resource_value_config request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_update_resource_value_config_request request_pb - query_string_params = if query_string_params.any? - query_string_params.to_h { |p| p.split "=", 2 } - else - {} - end - - response = @client_stub.make_http_request( - verb, - uri: uri, - body: body || "", - params: query_string_params, - method_name: "update_resource_value_config", - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Cloud::SecurityCenter::V2::ResourceValueConfig.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_security_marks REST call - # - # @param request_pb [::Google::Cloud::SecurityCenter::V2::UpdateSecurityMarksRequest] - # A request object representing the call parameters. Required. - # @param options [::Gapic::CallOptions] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Cloud::SecurityCenter::V2::SecurityMarks] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::SecurityCenter::V2::SecurityMarks] - # A result object deserialized from the server's reply - def update_security_marks request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_update_security_marks_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_security_marks", - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Cloud::SecurityCenter::V2::SecurityMarks.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_source REST call - # - # @param request_pb [::Google::Cloud::SecurityCenter::V2::UpdateSourceRequest] - # A request object representing the call parameters. Required. - # @param options [::Gapic::CallOptions] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Cloud::SecurityCenter::V2::Source] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::SecurityCenter::V2::Source] - # A result object deserialized from the server's reply - def update_source request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_update_source_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_source", - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Cloud::SecurityCenter::V2::Source.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 batch_create_resource_value_configs REST call - # - # @param request_pb [::Google::Cloud::SecurityCenter::V2::BatchCreateResourceValueConfigsRequest] - # A request object representing the call parameters. Required. - # @return [Array(String, [String, nil], Hash{String => String})] - # Uri, Body, Query string parameters - def self.transcode_batch_create_resource_value_configs_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :post, - uri_template: "/v2/{parent}/resourceValueConfigs:batchCreate", - body: "*", - matches: [ - ["parent", %r{^organizations/[^/]+/?$}, false] - ] - ) - .with_bindings( - uri_method: :post, - uri_template: "/v2/{parent}/resourceValueConfigs:batchCreate", - body: "*", - matches: [ - ["parent", %r{^organizations/[^/]+/locations/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the bulk_mute_findings REST call - # - # @param request_pb [::Google::Cloud::SecurityCenter::V2::BulkMuteFindingsRequest] - # A request object representing the call parameters. Required. - # @return [Array(String, [String, nil], Hash{String => String})] - # Uri, Body, Query string parameters - def self.transcode_bulk_mute_findings_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :post, - uri_template: "/v2/{parent}/findings:bulkMute", - body: "*", - matches: [ - ["parent", %r{^organizations/[^/]+/?$}, false] - ] - ) - .with_bindings( - uri_method: :post, - uri_template: "/v2/{parent}/findings:bulkMute", - body: "*", - matches: [ - ["parent", %r{^organizations/[^/]+/locations/[^/]+/?$}, false] - ] - ) - .with_bindings( - uri_method: :post, - uri_template: "/v2/{parent}/findings:bulkMute", - body: "*", - matches: [ - ["parent", %r{^folders/[^/]+/?$}, false] - ] - ) - .with_bindings( - uri_method: :post, - uri_template: "/v2/{parent}/findings:bulkMute", - body: "*", - matches: [ - ["parent", %r{^folders/[^/]+/locations/[^/]+/?$}, false] - ] - ) - .with_bindings( - uri_method: :post, - uri_template: "/v2/{parent}/findings:bulkMute", - body: "*", - matches: [ - ["parent", %r{^projects/[^/]+/?$}, false] - ] - ) - .with_bindings( - uri_method: :post, - uri_template: "/v2/{parent}/findings:bulkMute", - body: "*", - matches: [ - ["parent", %r{^projects/[^/]+/locations/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the create_big_query_export REST call - # - # @param request_pb [::Google::Cloud::SecurityCenter::V2::CreateBigQueryExportRequest] - # 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_big_query_export_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :post, - uri_template: "/v2/{parent}/bigQueryExports", - body: "big_query_export", - matches: [ - ["parent", %r{^organizations/[^/]+/locations/[^/]+/?$}, false] - ] - ) - .with_bindings( - uri_method: :post, - uri_template: "/v2/{parent}/bigQueryExports", - body: "big_query_export", - matches: [ - ["parent", %r{^folders/[^/]+/locations/[^/]+/?$}, false] - ] - ) - .with_bindings( - uri_method: :post, - uri_template: "/v2/{parent}/bigQueryExports", - body: "big_query_export", - matches: [ - ["parent", %r{^projects/[^/]+/locations/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the create_finding REST call - # - # @param request_pb [::Google::Cloud::SecurityCenter::V2::CreateFindingRequest] - # 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_finding_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :post, - uri_template: "/v2/{parent}/findings", - body: "finding", - matches: [ - ["parent", %r{^organizations/[^/]+/sources/[^/]+/locations/[^/]+/?$}, false] - ] - ) - .with_bindings( - uri_method: :post, - uri_template: "/v2/{parent}/findings", - body: "finding", - matches: [ - ["parent", %r{^organizations/[^/]+/sources/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the create_mute_config REST call - # - # @param request_pb [::Google::Cloud::SecurityCenter::V2::CreateMuteConfigRequest] - # 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_mute_config_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :post, - uri_template: "/v2/{parent}/muteConfigs", - body: "mute_config", - matches: [ - ["parent", %r{^organizations/[^/]+/locations/[^/]+/?$}, false] - ] - ) - .with_bindings( - uri_method: :post, - uri_template: "/v2/{parent}/muteConfigs", - body: "mute_config", - matches: [ - ["parent", %r{^folders/[^/]+/locations/[^/]+/?$}, false] - ] - ) - .with_bindings( - uri_method: :post, - uri_template: "/v2/{parent}/muteConfigs", - body: "mute_config", - matches: [ - ["parent", %r{^projects/[^/]+/locations/[^/]+/?$}, false] - ] - ) - .with_bindings( - uri_method: :post, - uri_template: "/v2/{parent}/muteConfigs", - body: "mute_config", - matches: [ - ["parent", %r{^organizations/[^/]+/?$}, false] - ] - ) - .with_bindings( - uri_method: :post, - uri_template: "/v2/{parent}/muteConfigs", - body: "mute_config", - matches: [ - ["parent", %r{^folders/[^/]+/?$}, false] - ] - ) - .with_bindings( - uri_method: :post, - uri_template: "/v2/{parent}/muteConfigs", - body: "mute_config", - matches: [ - ["parent", %r{^projects/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the create_notification_config REST call - # - # @param request_pb [::Google::Cloud::SecurityCenter::V2::CreateNotificationConfigRequest] - # 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_notification_config_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :post, - uri_template: "/v2/{parent}/notificationConfigs", - body: "notification_config", - matches: [ - ["parent", %r{^organizations/[^/]+/locations/[^/]+/?$}, false] - ] - ) - .with_bindings( - uri_method: :post, - uri_template: "/v2/{parent}/notificationConfigs", - body: "notification_config", - matches: [ - ["parent", %r{^folders/[^/]+/locations/[^/]+/?$}, false] - ] - ) - .with_bindings( - uri_method: :post, - uri_template: "/v2/{parent}/notificationConfigs", - body: "notification_config", - matches: [ - ["parent", %r{^projects/[^/]+/locations/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the create_source REST call - # - # @param request_pb [::Google::Cloud::SecurityCenter::V2::CreateSourceRequest] - # 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_source_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :post, - uri_template: "/v2/{parent}/sources", - body: "source", - matches: [ - ["parent", %r{^organizations/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the delete_big_query_export REST call - # - # @param request_pb [::Google::Cloud::SecurityCenter::V2::DeleteBigQueryExportRequest] - # 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_big_query_export_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :delete, - uri_template: "/v2/{name}", - matches: [ - ["name", %r{^organizations/[^/]+/locations/[^/]+/bigQueryExports/[^/]+/?$}, false] - ] - ) - .with_bindings( - uri_method: :delete, - uri_template: "/v2/{name}", - matches: [ - ["name", %r{^folders/[^/]+/locations/[^/]+/bigQueryExports/[^/]+/?$}, false] - ] - ) - .with_bindings( - uri_method: :delete, - uri_template: "/v2/{name}", - matches: [ - ["name", %r{^projects/[^/]+/locations/[^/]+/bigQueryExports/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the delete_mute_config REST call - # - # @param request_pb [::Google::Cloud::SecurityCenter::V2::DeleteMuteConfigRequest] - # 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_mute_config_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :delete, - uri_template: "/v2/{name}", - matches: [ - ["name", %r{^organizations/[^/]+/muteConfigs/[^/]+/?$}, false] - ] - ) - .with_bindings( - uri_method: :delete, - uri_template: "/v2/{name}", - matches: [ - ["name", %r{^organizations/[^/]+/locations/[^/]+/muteConfigs/[^/]+/?$}, false] - ] - ) - .with_bindings( - uri_method: :delete, - uri_template: "/v2/{name}", - matches: [ - ["name", %r{^folders/[^/]+/muteConfigs/[^/]+/?$}, false] - ] - ) - .with_bindings( - uri_method: :delete, - uri_template: "/v2/{name}", - matches: [ - ["name", %r{^folders/[^/]+/locations/[^/]+/muteConfigs/[^/]+/?$}, false] - ] - ) - .with_bindings( - uri_method: :delete, - uri_template: "/v2/{name}", - matches: [ - ["name", %r{^projects/[^/]+/muteConfigs/[^/]+/?$}, false] - ] - ) - .with_bindings( - uri_method: :delete, - uri_template: "/v2/{name}", - matches: [ - ["name", %r{^projects/[^/]+/locations/[^/]+/muteConfigs/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the delete_notification_config REST call - # - # @param request_pb [::Google::Cloud::SecurityCenter::V2::DeleteNotificationConfigRequest] - # 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_notification_config_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :delete, - uri_template: "/v2/{name}", - matches: [ - ["name", %r{^organizations/[^/]+/locations/[^/]+/notificationConfigs/[^/]+/?$}, false] - ] - ) - .with_bindings( - uri_method: :delete, - uri_template: "/v2/{name}", - matches: [ - ["name", %r{^folders/[^/]+/locations/[^/]+/notificationConfigs/[^/]+/?$}, false] - ] - ) - .with_bindings( - uri_method: :delete, - uri_template: "/v2/{name}", - matches: [ - ["name", %r{^projects/[^/]+/locations/[^/]+/notificationConfigs/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the delete_resource_value_config REST call - # - # @param request_pb [::Google::Cloud::SecurityCenter::V2::DeleteResourceValueConfigRequest] - # 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_resource_value_config_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :delete, - uri_template: "/v2/{name}", - matches: [ - ["name", %r{^organizations/[^/]+/resourceValueConfigs/[^/]+/?$}, false] - ] - ) - .with_bindings( - uri_method: :delete, - uri_template: "/v2/{name}", - matches: [ - ["name", %r{^organizations/[^/]+/locations/[^/]+/resourceValueConfigs/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the get_big_query_export REST call - # - # @param request_pb [::Google::Cloud::SecurityCenter::V2::GetBigQueryExportRequest] - # 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_big_query_export_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :get, - uri_template: "/v2/{name}", - matches: [ - ["name", %r{^organizations/[^/]+/locations/[^/]+/bigQueryExports/[^/]+/?$}, false] - ] - ) - .with_bindings( - uri_method: :get, - uri_template: "/v2/{name}", - matches: [ - ["name", %r{^folders/[^/]+/locations/[^/]+/bigQueryExports/[^/]+/?$}, false] - ] - ) - .with_bindings( - uri_method: :get, - uri_template: "/v2/{name}", - matches: [ - ["name", %r{^projects/[^/]+/locations/[^/]+/bigQueryExports/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the get_simulation REST call - # - # @param request_pb [::Google::Cloud::SecurityCenter::V2::GetSimulationRequest] - # 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_simulation_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :get, - uri_template: "/v2/{name}", - matches: [ - ["name", %r{^organizations/[^/]+/simulations/[^/]+/?$}, false] - ] - ) - .with_bindings( - uri_method: :get, - uri_template: "/v2/{name}", - matches: [ - ["name", %r{^organizations/[^/]+/locations/[^/]+/simulations/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the get_valued_resource REST call - # - # @param request_pb [::Google::Cloud::SecurityCenter::V2::GetValuedResourceRequest] - # 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_valued_resource_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :get, - uri_template: "/v2/{name}", - matches: [ - ["name", %r{^organizations/[^/]+/simulations/[^/]+/valuedResources/[^/]+/?$}, false] - ] - ) - .with_bindings( - uri_method: :get, - uri_template: "/v2/{name}", - matches: [ - ["name", %r{^organizations/[^/]+/locations/[^/]+/simulations/[^/]+/valuedResources/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the get_iam_policy REST call - # - # @param request_pb [::Google::Iam::V1::GetIamPolicyRequest] - # A request object representing the call parameters. Required. - # @return [Array(String, [String, nil], Hash{String => String})] - # Uri, Body, Query string parameters - def self.transcode_get_iam_policy_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :post, - uri_template: "/v2/{resource}:getIamPolicy", - body: "*", - matches: [ - ["resource", %r{^organizations/[^/]+/sources/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the get_mute_config REST call - # - # @param request_pb [::Google::Cloud::SecurityCenter::V2::GetMuteConfigRequest] - # 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_mute_config_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :get, - uri_template: "/v2/{name}", - matches: [ - ["name", %r{^organizations/[^/]+/muteConfigs/[^/]+/?$}, false] - ] - ) - .with_bindings( - uri_method: :get, - uri_template: "/v2/{name}", - matches: [ - ["name", %r{^organizations/[^/]+/locations/[^/]+/muteConfigs/[^/]+/?$}, false] - ] - ) - .with_bindings( - uri_method: :get, - uri_template: "/v2/{name}", - matches: [ - ["name", %r{^folders/[^/]+/muteConfigs/[^/]+/?$}, false] - ] - ) - .with_bindings( - uri_method: :get, - uri_template: "/v2/{name}", - matches: [ - ["name", %r{^folders/[^/]+/locations/[^/]+/muteConfigs/[^/]+/?$}, false] - ] - ) - .with_bindings( - uri_method: :get, - uri_template: "/v2/{name}", - matches: [ - ["name", %r{^projects/[^/]+/muteConfigs/[^/]+/?$}, false] - ] - ) - .with_bindings( - uri_method: :get, - uri_template: "/v2/{name}", - matches: [ - ["name", %r{^projects/[^/]+/locations/[^/]+/muteConfigs/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the get_notification_config REST call - # - # @param request_pb [::Google::Cloud::SecurityCenter::V2::GetNotificationConfigRequest] - # 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_notification_config_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :get, - uri_template: "/v2/{name}", - matches: [ - ["name", %r{^organizations/[^/]+/locations/[^/]+/notificationConfigs/[^/]+/?$}, false] - ] - ) - .with_bindings( - uri_method: :get, - uri_template: "/v2/{name}", - matches: [ - ["name", %r{^folders/[^/]+/locations/[^/]+/notificationConfigs/[^/]+/?$}, false] - ] - ) - .with_bindings( - uri_method: :get, - uri_template: "/v2/{name}", - matches: [ - ["name", %r{^projects/[^/]+/locations/[^/]+/notificationConfigs/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the get_resource_value_config REST call - # - # @param request_pb [::Google::Cloud::SecurityCenter::V2::GetResourceValueConfigRequest] - # 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_resource_value_config_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :get, - uri_template: "/v2/{name}", - matches: [ - ["name", %r{^organizations/[^/]+/resourceValueConfigs/[^/]+/?$}, false] - ] - ) - .with_bindings( - uri_method: :get, - uri_template: "/v2/{name}", - matches: [ - ["name", %r{^organizations/[^/]+/locations/[^/]+/resourceValueConfigs/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the get_source REST call - # - # @param request_pb [::Google::Cloud::SecurityCenter::V2::GetSourceRequest] - # 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_source_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :get, - uri_template: "/v2/{name}", - matches: [ - ["name", %r{^organizations/[^/]+/sources/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the group_findings REST call - # - # @param request_pb [::Google::Cloud::SecurityCenter::V2::GroupFindingsRequest] - # A request object representing the call parameters. Required. - # @return [Array(String, [String, nil], Hash{String => String})] - # Uri, Body, Query string parameters - def self.transcode_group_findings_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :post, - uri_template: "/v2/{parent}/findings:group", - body: "*", - matches: [ - ["parent", %r{^organizations/[^/]+/sources/[^/]+/?$}, false] - ] - ) - .with_bindings( - uri_method: :post, - uri_template: "/v2/{parent}/findings:group", - body: "*", - matches: [ - ["parent", %r{^organizations/[^/]+/sources/[^/]+/locations/[^/]+/?$}, false] - ] - ) - .with_bindings( - uri_method: :post, - uri_template: "/v2/{parent}/findings:group", - body: "*", - matches: [ - ["parent", %r{^folders/[^/]+/sources/[^/]+/?$}, false] - ] - ) - .with_bindings( - uri_method: :post, - uri_template: "/v2/{parent}/findings:group", - body: "*", - matches: [ - ["parent", %r{^folders/[^/]+/sources/[^/]+/locations/[^/]+/?$}, false] - ] - ) - .with_bindings( - uri_method: :post, - uri_template: "/v2/{parent}/findings:group", - body: "*", - matches: [ - ["parent", %r{^projects/[^/]+/sources/[^/]+/?$}, false] - ] - ) - .with_bindings( - uri_method: :post, - uri_template: "/v2/{parent}/findings:group", - body: "*", - matches: [ - ["parent", %r{^projects/[^/]+/sources/[^/]+/locations/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the list_attack_paths REST call - # - # @param request_pb [::Google::Cloud::SecurityCenter::V2::ListAttackPathsRequest] - # 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_attack_paths_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :get, - uri_template: "/v2/{parent}/attackPaths", - matches: [ - ["parent", %r{^organizations/[^/]+/simulations/[^/]+/?$}, false] - ] - ) - .with_bindings( - uri_method: :get, - uri_template: "/v2/{parent}/attackPaths", - matches: [ - ["parent", %r{^organizations/[^/]+/?$}, false] - ] - ) - .with_bindings( - uri_method: :get, - uri_template: "/v2/{parent}/attackPaths", - matches: [ - ["parent", %r{^organizations/[^/]+/simulations/[^/]+/valuedResources/[^/]+/?$}, false] - ] - ) - .with_bindings( - uri_method: :get, - uri_template: "/v2/{parent}/attackPaths", - matches: [ - ["parent", %r{^organizations/[^/]+/locations/[^/]+/simulations/[^/]+/valuedResources/[^/]+/?$}, false] - ] - ) - .with_bindings( - uri_method: :get, - uri_template: "/v2/{parent}/attackPaths", - matches: [ - ["parent", %r{^organizations/[^/]+/simulations/[^/]+/attackExposureResults/[^/]+/?$}, false] - ] - ) - .with_bindings( - uri_method: :get, - uri_template: "/v2/{parent}/attackPaths", - matches: [ - ["parent", %r{^organizations/[^/]+/locations/[^/]+/simulations/[^/]+/attackExposureResults/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the list_big_query_exports REST call - # - # @param request_pb [::Google::Cloud::SecurityCenter::V2::ListBigQueryExportsRequest] - # 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_big_query_exports_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :get, - uri_template: "/v2/{parent}/bigQueryExports", - matches: [ - ["parent", %r{^organizations/[^/]+/locations/[^/]+/?$}, false] - ] - ) - .with_bindings( - uri_method: :get, - uri_template: "/v2/{parent}/bigQueryExports", - matches: [ - ["parent", %r{^folders/[^/]+/locations/[^/]+/?$}, false] - ] - ) - .with_bindings( - uri_method: :get, - uri_template: "/v2/{parent}/bigQueryExports", - matches: [ - ["parent", %r{^projects/[^/]+/locations/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the list_findings REST call - # - # @param request_pb [::Google::Cloud::SecurityCenter::V2::ListFindingsRequest] - # 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_findings_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :get, - uri_template: "/v2/{parent}/findings", - matches: [ - ["parent", %r{^organizations/[^/]+/sources/[^/]+/?$}, false] - ] - ) - .with_bindings( - uri_method: :get, - uri_template: "/v2/{parent}/findings", - matches: [ - ["parent", %r{^organizations/[^/]+/sources/[^/]+/locations/[^/]+/?$}, false] - ] - ) - .with_bindings( - uri_method: :get, - uri_template: "/v2/{parent}/findings", - matches: [ - ["parent", %r{^folders/[^/]+/sources/[^/]+/?$}, false] - ] - ) - .with_bindings( - uri_method: :get, - uri_template: "/v2/{parent}/findings", - matches: [ - ["parent", %r{^folders/[^/]+/sources/[^/]+/locations/[^/]+/?$}, false] - ] - ) - .with_bindings( - uri_method: :get, - uri_template: "/v2/{parent}/findings", - matches: [ - ["parent", %r{^projects/[^/]+/sources/[^/]+/?$}, false] - ] - ) - .with_bindings( - uri_method: :get, - uri_template: "/v2/{parent}/findings", - matches: [ - ["parent", %r{^projects/[^/]+/sources/[^/]+/locations/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the list_mute_configs REST call - # - # @param request_pb [::Google::Cloud::SecurityCenter::V2::ListMuteConfigsRequest] - # 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_mute_configs_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :get, - uri_template: "/v2/{parent}/muteConfigs", - matches: [ - ["parent", %r{^organizations/[^/]+/?$}, false] - ] - ) - .with_bindings( - uri_method: :get, - uri_template: "/v2/{parent}/muteConfigs", - matches: [ - ["parent", %r{^organizations/[^/]+/locations/[^/]+/?$}, false] - ] - ) - .with_bindings( - uri_method: :get, - uri_template: "/v2/{parent}/muteConfigs", - matches: [ - ["parent", %r{^folders/[^/]+/?$}, false] - ] - ) - .with_bindings( - uri_method: :get, - uri_template: "/v2/{parent}/muteConfigs", - matches: [ - ["parent", %r{^folders/[^/]+/locations/[^/]+/?$}, false] - ] - ) - .with_bindings( - uri_method: :get, - uri_template: "/v2/{parent}/muteConfigs", - matches: [ - ["parent", %r{^projects/[^/]+/?$}, false] - ] - ) - .with_bindings( - uri_method: :get, - uri_template: "/v2/{parent}/muteConfigs", - matches: [ - ["parent", %r{^projects/[^/]+/locations/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the list_notification_configs REST call - # - # @param request_pb [::Google::Cloud::SecurityCenter::V2::ListNotificationConfigsRequest] - # 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_notification_configs_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :get, - uri_template: "/v2/{parent}/notificationConfigs", - matches: [ - ["parent", %r{^organizations/[^/]+/locations/[^/]+/?$}, false] - ] - ) - .with_bindings( - uri_method: :get, - uri_template: "/v2/{parent}/notificationConfigs", - matches: [ - ["parent", %r{^folders/[^/]+/locations/[^/]+/?$}, false] - ] - ) - .with_bindings( - uri_method: :get, - uri_template: "/v2/{parent}/notificationConfigs", - matches: [ - ["parent", %r{^projects/[^/]+/locations/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the list_resource_value_configs REST call - # - # @param request_pb [::Google::Cloud::SecurityCenter::V2::ListResourceValueConfigsRequest] - # 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_resource_value_configs_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :get, - uri_template: "/v2/{parent}/resourceValueConfigs", - matches: [ - ["parent", %r{^organizations/[^/]+/?$}, false] - ] - ) - .with_bindings( - uri_method: :get, - uri_template: "/v2/{parent}/resourceValueConfigs", - matches: [ - ["parent", %r{^organizations/[^/]+/locations/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the list_sources REST call - # - # @param request_pb [::Google::Cloud::SecurityCenter::V2::ListSourcesRequest] - # 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_sources_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :get, - uri_template: "/v2/{parent}/sources", - matches: [ - ["parent", %r{^organizations/[^/]+/?$}, false] - ] - ) - .with_bindings( - uri_method: :get, - uri_template: "/v2/{parent}/sources", - matches: [ - ["parent", %r{^folders/[^/]+/?$}, false] - ] - ) - .with_bindings( - uri_method: :get, - uri_template: "/v2/{parent}/sources", - matches: [ - ["parent", %r{^projects/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the list_valued_resources REST call - # - # @param request_pb [::Google::Cloud::SecurityCenter::V2::ListValuedResourcesRequest] - # 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_valued_resources_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :get, - uri_template: "/v2/{parent}/valuedResources", - matches: [ - ["parent", %r{^organizations/[^/]+/simulations/[^/]+/?$}, false] - ] - ) - .with_bindings( - uri_method: :get, - uri_template: "/v2/{parent}/valuedResources", - matches: [ - ["parent", %r{^organizations/[^/]+/simulations/[^/]+/attackExposureResults/[^/]+/?$}, false] - ] - ) - .with_bindings( - uri_method: :get, - uri_template: "/v2/{parent}/valuedResources", - matches: [ - ["parent", %r{^organizations/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the set_finding_state REST call - # - # @param request_pb [::Google::Cloud::SecurityCenter::V2::SetFindingStateRequest] - # A request object representing the call parameters. Required. - # @return [Array(String, [String, nil], Hash{String => String})] - # Uri, Body, Query string parameters - def self.transcode_set_finding_state_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :post, - uri_template: "/v2/{name}:setState", - body: "*", - matches: [ - ["name", %r{^organizations/[^/]+/sources/[^/]+/findings/[^/]+/?$}, false] - ] - ) - .with_bindings( - uri_method: :post, - uri_template: "/v2/{name}:setState", - body: "*", - matches: [ - ["name", %r{^organizations/[^/]+/sources/[^/]+/locations/[^/]+/findings/[^/]+/?$}, false] - ] - ) - .with_bindings( - uri_method: :post, - uri_template: "/v2/{name}:setState", - body: "*", - matches: [ - ["name", %r{^folders/[^/]+/sources/[^/]+/findings/[^/]+/?$}, false] - ] - ) - .with_bindings( - uri_method: :post, - uri_template: "/v2/{name}:setState", - body: "*", - matches: [ - ["name", %r{^folders/[^/]+/sources/[^/]+/locations/[^/]+/findings/[^/]+/?$}, false] - ] - ) - .with_bindings( - uri_method: :post, - uri_template: "/v2/{name}:setState", - body: "*", - matches: [ - ["name", %r{^projects/[^/]+/sources/[^/]+/findings/[^/]+/?$}, false] - ] - ) - .with_bindings( - uri_method: :post, - uri_template: "/v2/{name}:setState", - body: "*", - matches: [ - ["name", %r{^projects/[^/]+/sources/[^/]+/locations/[^/]+/findings/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the set_iam_policy REST call - # - # @param request_pb [::Google::Iam::V1::SetIamPolicyRequest] - # A request object representing the call parameters. Required. - # @return [Array(String, [String, nil], Hash{String => String})] - # Uri, Body, Query string parameters - def self.transcode_set_iam_policy_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :post, - uri_template: "/v2/{resource}:setIamPolicy", - body: "*", - matches: [ - ["resource", %r{^organizations/[^/]+/sources/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the set_mute REST call - # - # @param request_pb [::Google::Cloud::SecurityCenter::V2::SetMuteRequest] - # A request object representing the call parameters. Required. - # @return [Array(String, [String, nil], Hash{String => String})] - # Uri, Body, Query string parameters - def self.transcode_set_mute_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :post, - uri_template: "/v2/{name}:setMute", - body: "*", - matches: [ - ["name", %r{^organizations/[^/]+/sources/[^/]+/findings/[^/]+/?$}, false] - ] - ) - .with_bindings( - uri_method: :post, - uri_template: "/v2/{name}:setMute", - body: "*", - matches: [ - ["name", %r{^organizations/[^/]+/sources/[^/]+/locations/[^/]+/findings/[^/]+/?$}, false] - ] - ) - .with_bindings( - uri_method: :post, - uri_template: "/v2/{name}:setMute", - body: "*", - matches: [ - ["name", %r{^folders/[^/]+/sources/[^/]+/findings/[^/]+/?$}, false] - ] - ) - .with_bindings( - uri_method: :post, - uri_template: "/v2/{name}:setMute", - body: "*", - matches: [ - ["name", %r{^folders/[^/]+/sources/[^/]+/locations/[^/]+/findings/[^/]+/?$}, false] - ] - ) - .with_bindings( - uri_method: :post, - uri_template: "/v2/{name}:setMute", - body: "*", - matches: [ - ["name", %r{^projects/[^/]+/sources/[^/]+/findings/[^/]+/?$}, false] - ] - ) - .with_bindings( - uri_method: :post, - uri_template: "/v2/{name}:setMute", - body: "*", - matches: [ - ["name", %r{^projects/[^/]+/sources/[^/]+/locations/[^/]+/findings/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the test_iam_permissions REST call - # - # @param request_pb [::Google::Iam::V1::TestIamPermissionsRequest] - # A request object representing the call parameters. Required. - # @return [Array(String, [String, nil], Hash{String => String})] - # Uri, Body, Query string parameters - def self.transcode_test_iam_permissions_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :post, - uri_template: "/v2/{resource}:testIamPermissions", - body: "*", - matches: [ - ["resource", %r{^organizations/[^/]+/sources/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the update_big_query_export REST call - # - # @param request_pb [::Google::Cloud::SecurityCenter::V2::UpdateBigQueryExportRequest] - # 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_big_query_export_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :patch, - uri_template: "/v2/{big_query_export.name}", - body: "big_query_export", - matches: [ - ["big_query_export.name", %r{^organizations/[^/]+/locations/[^/]+/bigQueryExports/[^/]+/?$}, false] - ] - ) - .with_bindings( - uri_method: :patch, - uri_template: "/v2/{big_query_export.name}", - body: "big_query_export", - matches: [ - ["big_query_export.name", %r{^folders/[^/]+/locations/[^/]+/bigQueryExports/[^/]+/?$}, false] - ] - ) - .with_bindings( - uri_method: :patch, - uri_template: "/v2/{big_query_export.name}", - body: "big_query_export", - matches: [ - ["big_query_export.name", %r{^projects/[^/]+/locations/[^/]+/bigQueryExports/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the update_external_system REST call - # - # @param request_pb [::Google::Cloud::SecurityCenter::V2::UpdateExternalSystemRequest] - # 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_external_system_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :patch, - uri_template: "/v2/{external_system.name}", - body: "external_system", - matches: [ - ["external_system.name", %r{^organizations/[^/]+/sources/[^/]+/findings/[^/]+/externalSystems/[^/]+/?$}, false] - ] - ) - .with_bindings( - uri_method: :patch, - uri_template: "/v2/{external_system.name}", - body: "external_system", - matches: [ - ["external_system.name", %r{^organizations/[^/]+/sources/[^/]+/locations/[^/]+/findings/[^/]+/externalSystems/[^/]+/?$}, false] - ] - ) - .with_bindings( - uri_method: :patch, - uri_template: "/v2/{external_system.name}", - body: "external_system", - matches: [ - ["external_system.name", %r{^folders/[^/]+/sources/[^/]+/findings/[^/]+/externalSystems/[^/]+/?$}, false] - ] - ) - .with_bindings( - uri_method: :patch, - uri_template: "/v2/{external_system.name}", - body: "external_system", - matches: [ - ["external_system.name", %r{^folders/[^/]+/sources/[^/]+/locations/[^/]+/findings/[^/]+/externalSystems/[^/]+/?$}, false] - ] - ) - .with_bindings( - uri_method: :patch, - uri_template: "/v2/{external_system.name}", - body: "external_system", - matches: [ - ["external_system.name", %r{^projects/[^/]+/sources/[^/]+/findings/[^/]+/externalSystems/[^/]+/?$}, false] - ] - ) - .with_bindings( - uri_method: :patch, - uri_template: "/v2/{external_system.name}", - body: "external_system", - matches: [ - ["external_system.name", %r{^projects/[^/]+/sources/[^/]+/locations/[^/]+/findings/[^/]+/externalSystems/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the update_finding REST call - # - # @param request_pb [::Google::Cloud::SecurityCenter::V2::UpdateFindingRequest] - # 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_finding_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :patch, - uri_template: "/v2/{finding.name}", - body: "finding", - matches: [ - ["finding.name", %r{^organizations/[^/]+/sources/[^/]+/findings/[^/]+/?$}, false] - ] - ) - .with_bindings( - uri_method: :patch, - uri_template: "/v2/{finding.name}", - body: "finding", - matches: [ - ["finding.name", %r{^organizations/[^/]+/sources/[^/]+/locations/[^/]+/findings/[^/]+/?$}, false] - ] - ) - .with_bindings( - uri_method: :patch, - uri_template: "/v2/{finding.name}", - body: "finding", - matches: [ - ["finding.name", %r{^folders/[^/]+/sources/[^/]+/findings/[^/]+/?$}, false] - ] - ) - .with_bindings( - uri_method: :patch, - uri_template: "/v2/{finding.name}", - body: "finding", - matches: [ - ["finding.name", %r{^folders/[^/]+/sources/[^/]+/locations/[^/]+/findings/[^/]+/?$}, false] - ] - ) - .with_bindings( - uri_method: :patch, - uri_template: "/v2/{finding.name}", - body: "finding", - matches: [ - ["finding.name", %r{^projects/[^/]+/sources/[^/]+/findings/[^/]+/?$}, false] - ] - ) - .with_bindings( - uri_method: :patch, - uri_template: "/v2/{finding.name}", - body: "finding", - matches: [ - ["finding.name", %r{^projects/[^/]+/sources/[^/]+/locations/[^/]+/findings/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the update_mute_config REST call - # - # @param request_pb [::Google::Cloud::SecurityCenter::V2::UpdateMuteConfigRequest] - # 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_mute_config_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :patch, - uri_template: "/v2/{mute_config.name}", - body: "mute_config", - matches: [ - ["mute_config.name", %r{^organizations/[^/]+/muteConfigs/[^/]+/?$}, false] - ] - ) - .with_bindings( - uri_method: :patch, - uri_template: "/v2/{mute_config.name}", - body: "mute_config", - matches: [ - ["mute_config.name", %r{^organizations/[^/]+/locations/[^/]+/muteConfigs/[^/]+/?$}, false] - ] - ) - .with_bindings( - uri_method: :patch, - uri_template: "/v2/{mute_config.name}", - body: "mute_config", - matches: [ - ["mute_config.name", %r{^folders/[^/]+/muteConfigs/[^/]+/?$}, false] - ] - ) - .with_bindings( - uri_method: :patch, - uri_template: "/v2/{mute_config.name}", - body: "mute_config", - matches: [ - ["mute_config.name", %r{^folders/[^/]+/locations/[^/]+/muteConfigs/[^/]+/?$}, false] - ] - ) - .with_bindings( - uri_method: :patch, - uri_template: "/v2/{mute_config.name}", - body: "mute_config", - matches: [ - ["mute_config.name", %r{^projects/[^/]+/muteConfigs/[^/]+/?$}, false] - ] - ) - .with_bindings( - uri_method: :patch, - uri_template: "/v2/{mute_config.name}", - body: "mute_config", - matches: [ - ["mute_config.name", %r{^projects/[^/]+/locations/[^/]+/muteConfigs/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the update_notification_config REST call - # - # @param request_pb [::Google::Cloud::SecurityCenter::V2::UpdateNotificationConfigRequest] - # 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_notification_config_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :patch, - uri_template: "/v2/{notification_config.name}", - body: "notification_config", - matches: [ - ["notification_config.name", %r{^organizations/[^/]+/locations/[^/]+/notificationConfigs/[^/]+/?$}, false] - ] - ) - .with_bindings( - uri_method: :patch, - uri_template: "/v2/{notification_config.name}", - body: "notification_config", - matches: [ - ["notification_config.name", %r{^folders/[^/]+/locations/[^/]+/notificationConfigs/[^/]+/?$}, false] - ] - ) - .with_bindings( - uri_method: :patch, - uri_template: "/v2/{notification_config.name}", - body: "notification_config", - matches: [ - ["notification_config.name", %r{^projects/[^/]+/locations/[^/]+/notificationConfigs/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the update_resource_value_config REST call - # - # @param request_pb [::Google::Cloud::SecurityCenter::V2::UpdateResourceValueConfigRequest] - # 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_resource_value_config_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :patch, - uri_template: "/v2/{resource_value_config.name}", - body: "resource_value_config", - matches: [ - ["resource_value_config.name", %r{^organizations/[^/]+/resourceValueConfigs/[^/]+/?$}, false] - ] - ) - .with_bindings( - uri_method: :patch, - uri_template: "/v2/{resource_value_config.name}", - body: "resource_value_config", - matches: [ - ["resource_value_config.name", %r{^organizations/[^/]+/locations/[^/]+/resourceValueConfigs/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the update_security_marks REST call - # - # @param request_pb [::Google::Cloud::SecurityCenter::V2::UpdateSecurityMarksRequest] - # 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_security_marks_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :patch, - uri_template: "/v2/{security_marks.name}", - body: "security_marks", - matches: [ - ["security_marks.name", %r{^organizations/[^/]+/sources/[^/]+/findings/[^/]+/securityMarks/?$}, false] - ] - ) - .with_bindings( - uri_method: :patch, - uri_template: "/v2/{security_marks.name}", - body: "security_marks", - matches: [ - ["security_marks.name", %r{^organizations/[^/]+/assets/[^/]+/securityMarks/?$}, false] - ] - ) - .with_bindings( - uri_method: :patch, - uri_template: "/v2/{security_marks.name}", - body: "security_marks", - matches: [ - ["security_marks.name", %r{^organizations/[^/]+/sources/[^/]+/locations/[^/]+/findings/[^/]+/securityMarks/?$}, false] - ] - ) - .with_bindings( - uri_method: :patch, - uri_template: "/v2/{security_marks.name}", - body: "security_marks", - matches: [ - ["security_marks.name", %r{^folders/[^/]+/sources/[^/]+/findings/[^/]+/securityMarks/?$}, false] - ] - ) - .with_bindings( - uri_method: :patch, - uri_template: "/v2/{security_marks.name}", - body: "security_marks", - matches: [ - ["security_marks.name", %r{^folders/[^/]+/assets/[^/]+/securityMarks/?$}, false] - ] - ) - .with_bindings( - uri_method: :patch, - uri_template: "/v2/{security_marks.name}", - body: "security_marks", - matches: [ - ["security_marks.name", %r{^folders/[^/]+/sources/[^/]+/locations/[^/]+/findings/[^/]+/securityMarks/?$}, false] - ] - ) - .with_bindings( - uri_method: :patch, - uri_template: "/v2/{security_marks.name}", - body: "security_marks", - matches: [ - ["security_marks.name", %r{^projects/[^/]+/sources/[^/]+/findings/[^/]+/securityMarks/?$}, false] - ] - ) - .with_bindings( - uri_method: :patch, - uri_template: "/v2/{security_marks.name}", - body: "security_marks", - matches: [ - ["security_marks.name", %r{^projects/[^/]+/assets/[^/]+/securityMarks/?$}, false] - ] - ) - .with_bindings( - uri_method: :patch, - uri_template: "/v2/{security_marks.name}", - body: "security_marks", - matches: [ - ["security_marks.name", %r{^projects/[^/]+/sources/[^/]+/locations/[^/]+/findings/[^/]+/securityMarks/?$}, false] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the update_source REST call - # - # @param request_pb [::Google::Cloud::SecurityCenter::V2::UpdateSourceRequest] - # 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_source_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :patch, - uri_template: "/v2/{source.name}", - body: "source", - matches: [ - ["source.name", %r{^organizations/[^/]+/sources/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - end - end - end - end - end - end -end diff --git a/owl-bot-staging/google-cloud-security_center-v2/lib/google/cloud/security_center/v2/version.rb b/owl-bot-staging/google-cloud-security_center-v2/lib/google/cloud/security_center/v2/version.rb deleted file mode 100644 index 543e0946f0de..000000000000 --- a/owl-bot-staging/google-cloud-security_center-v2/lib/google/cloud/security_center/v2/version.rb +++ /dev/null @@ -1,28 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - - -module Google - module Cloud - module SecurityCenter - module V2 - VERSION = "0.0.1" - end - end - end -end diff --git a/owl-bot-staging/google-cloud-security_center-v2/lib/google/cloud/securitycenter/v2/access_pb.rb b/owl-bot-staging/google-cloud-security_center-v2/lib/google/cloud/securitycenter/v2/access_pb.rb deleted file mode 100644 index 626f8a57d25d..000000000000 --- a/owl-bot-staging/google-cloud-security_center-v2/lib/google/cloud/securitycenter/v2/access_pb.rb +++ /dev/null @@ -1,23 +0,0 @@ -# frozen_string_literal: true -# Generated by the protocol buffer compiler. DO NOT EDIT! -# source: google/cloud/securitycenter/v2/access.proto - -require 'google/protobuf' - - -descriptor_data = "\n+google/cloud/securitycenter/v2/access.proto\x12\x1egoogle.cloud.securitycenter.v2\"\x89\x03\n\x06\x41\x63\x63\x65ss\x12\x17\n\x0fprincipal_email\x18\x01 \x01(\t\x12\x11\n\tcaller_ip\x18\x02 \x01(\t\x12\x42\n\rcaller_ip_geo\x18\x03 \x01(\x0b\x32+.google.cloud.securitycenter.v2.Geolocation\x12\x19\n\x11user_agent_family\x18\x04 \x01(\t\x12\x12\n\nuser_agent\x18\x05 \x01(\t\x12\x14\n\x0cservice_name\x18\x06 \x01(\t\x12\x13\n\x0bmethod_name\x18\x07 \x01(\t\x12\x19\n\x11principal_subject\x18\x08 \x01(\t\x12 \n\x18service_account_key_name\x18\t \x01(\t\x12\x65\n\x1fservice_account_delegation_info\x18\n \x03(\x0b\x32<.google.cloud.securitycenter.v2.ServiceAccountDelegationInfo\x12\x11\n\tuser_name\x18\x0b \x01(\t\"R\n\x1cServiceAccountDelegationInfo\x12\x17\n\x0fprincipal_email\x18\x01 \x01(\t\x12\x19\n\x11principal_subject\x18\x02 \x01(\t\"\"\n\x0bGeolocation\x12\x13\n\x0bregion_code\x18\x01 \x01(\tB\xe5\x01\n\"com.google.cloud.securitycenter.v2B\x0b\x41\x63\x63\x65ssProtoP\x01ZJcloud.google.com/go/securitycenter/apiv2/securitycenterpb;securitycenterpb\xaa\x02\x1eGoogle.Cloud.SecurityCenter.V2\xca\x02\x1eGoogle\\Cloud\\SecurityCenter\\V2\xea\x02!Google::Cloud::SecurityCenter::V2b\x06proto3" - -pool = ::Google::Protobuf::DescriptorPool.generated_pool -pool.add_serialized_file(descriptor_data) - -module Google - module Cloud - module SecurityCenter - module V2 - Access = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.securitycenter.v2.Access").msgclass - ServiceAccountDelegationInfo = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.securitycenter.v2.ServiceAccountDelegationInfo").msgclass - Geolocation = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.securitycenter.v2.Geolocation").msgclass - end - end - end -end diff --git a/owl-bot-staging/google-cloud-security_center-v2/lib/google/cloud/securitycenter/v2/affected_resources_pb.rb b/owl-bot-staging/google-cloud-security_center-v2/lib/google/cloud/securitycenter/v2/affected_resources_pb.rb deleted file mode 100644 index b2ded5cca4eb..000000000000 --- a/owl-bot-staging/google-cloud-security_center-v2/lib/google/cloud/securitycenter/v2/affected_resources_pb.rb +++ /dev/null @@ -1,21 +0,0 @@ -# frozen_string_literal: true -# Generated by the protocol buffer compiler. DO NOT EDIT! -# source: google/cloud/securitycenter/v2/affected_resources.proto - -require 'google/protobuf' - - -descriptor_data = "\n7google/cloud/securitycenter/v2/affected_resources.proto\x12\x1egoogle.cloud.securitycenter.v2\"\"\n\x11\x41\x66\x66\x65\x63tedResources\x12\r\n\x05\x63ount\x18\x01 \x01(\x03\x42\xf0\x01\n\"com.google.cloud.securitycenter.v2B\x16\x41\x66\x66\x65\x63tedResourcesProtoP\x01ZJcloud.google.com/go/securitycenter/apiv2/securitycenterpb;securitycenterpb\xaa\x02\x1eGoogle.Cloud.SecurityCenter.V2\xca\x02\x1eGoogle\\Cloud\\SecurityCenter\\V2\xea\x02!Google::Cloud::SecurityCenter::V2b\x06proto3" - -pool = ::Google::Protobuf::DescriptorPool.generated_pool -pool.add_serialized_file(descriptor_data) - -module Google - module Cloud - module SecurityCenter - module V2 - AffectedResources = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.securitycenter.v2.AffectedResources").msgclass - end - end - end -end diff --git a/owl-bot-staging/google-cloud-security_center-v2/lib/google/cloud/securitycenter/v2/ai_model_pb.rb b/owl-bot-staging/google-cloud-security_center-v2/lib/google/cloud/securitycenter/v2/ai_model_pb.rb deleted file mode 100644 index e0d357ddd795..000000000000 --- a/owl-bot-staging/google-cloud-security_center-v2/lib/google/cloud/securitycenter/v2/ai_model_pb.rb +++ /dev/null @@ -1,22 +0,0 @@ -# frozen_string_literal: true -# Generated by the protocol buffer compiler. DO NOT EDIT! -# source: google/cloud/securitycenter/v2/ai_model.proto - -require 'google/protobuf' - - -descriptor_data = "\n-google/cloud/securitycenter/v2/ai_model.proto\x12\x1egoogle.cloud.securitycenter.v2\"\xbe\x02\n\x07\x41iModel\x12\x0c\n\x04name\x18\x01 \x01(\t\x12\x0e\n\x06\x64omain\x18\x02 \x01(\t\x12\x0f\n\x07library\x18\x03 \x01(\t\x12\x10\n\x08location\x18\x04 \x01(\t\x12\x11\n\tpublisher\x18\x05 \x01(\t\x12W\n\x13\x64\x65ployment_platform\x18\x06 \x01(\x0e\x32:.google.cloud.securitycenter.v2.AiModel.DeploymentPlatform\x12\x14\n\x0c\x64isplay_name\x18\x07 \x01(\t\"p\n\x12\x44\x65ploymentPlatform\x12#\n\x1f\x44\x45PLOYMENT_PLATFORM_UNSPECIFIED\x10\x00\x12\r\n\tVERTEX_AI\x10\x01\x12\x07\n\x03GKE\x10\x02\x12\x07\n\x03GCE\x10\x03\x12\x14\n\x10\x46INE_TUNED_MODEL\x10\x04\x42\xe6\x01\n\"com.google.cloud.securitycenter.v2B\x0c\x41iModelProtoP\x01ZJcloud.google.com/go/securitycenter/apiv2/securitycenterpb;securitycenterpb\xaa\x02\x1eGoogle.Cloud.SecurityCenter.V2\xca\x02\x1eGoogle\\Cloud\\SecurityCenter\\V2\xea\x02!Google::Cloud::SecurityCenter::V2b\x06proto3" - -pool = ::Google::Protobuf::DescriptorPool.generated_pool -pool.add_serialized_file(descriptor_data) - -module Google - module Cloud - module SecurityCenter - module V2 - AiModel = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.securitycenter.v2.AiModel").msgclass - AiModel::DeploymentPlatform = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.securitycenter.v2.AiModel.DeploymentPlatform").enummodule - end - end - end -end diff --git a/owl-bot-staging/google-cloud-security_center-v2/lib/google/cloud/securitycenter/v2/application_pb.rb b/owl-bot-staging/google-cloud-security_center-v2/lib/google/cloud/securitycenter/v2/application_pb.rb deleted file mode 100644 index 3adcac6a59b9..000000000000 --- a/owl-bot-staging/google-cloud-security_center-v2/lib/google/cloud/securitycenter/v2/application_pb.rb +++ /dev/null @@ -1,21 +0,0 @@ -# frozen_string_literal: true -# Generated by the protocol buffer compiler. DO NOT EDIT! -# source: google/cloud/securitycenter/v2/application.proto - -require 'google/protobuf' - - -descriptor_data = "\n0google/cloud/securitycenter/v2/application.proto\x12\x1egoogle.cloud.securitycenter.v2\"1\n\x0b\x41pplication\x12\x10\n\x08\x62\x61se_uri\x18\x01 \x01(\t\x12\x10\n\x08\x66ull_uri\x18\x02 \x01(\tB\xea\x01\n\"com.google.cloud.securitycenter.v2B\x10\x41pplicationProtoP\x01ZJcloud.google.com/go/securitycenter/apiv2/securitycenterpb;securitycenterpb\xaa\x02\x1eGoogle.Cloud.SecurityCenter.V2\xca\x02\x1eGoogle\\Cloud\\SecurityCenter\\V2\xea\x02!Google::Cloud::SecurityCenter::V2b\x06proto3" - -pool = ::Google::Protobuf::DescriptorPool.generated_pool -pool.add_serialized_file(descriptor_data) - -module Google - module Cloud - module SecurityCenter - module V2 - Application = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.securitycenter.v2.Application").msgclass - end - end - end -end diff --git a/owl-bot-staging/google-cloud-security_center-v2/lib/google/cloud/securitycenter/v2/attack_exposure_pb.rb b/owl-bot-staging/google-cloud-security_center-v2/lib/google/cloud/securitycenter/v2/attack_exposure_pb.rb deleted file mode 100644 index 2455e60ba1f7..000000000000 --- a/owl-bot-staging/google-cloud-security_center-v2/lib/google/cloud/securitycenter/v2/attack_exposure_pb.rb +++ /dev/null @@ -1,25 +0,0 @@ -# frozen_string_literal: true -# Generated by the protocol buffer compiler. DO NOT EDIT! -# source: google/cloud/securitycenter/v2/attack_exposure.proto - -require 'google/protobuf' - -require 'google/api/field_behavior_pb' -require 'google/protobuf/timestamp_pb' - - -descriptor_data = "\n4google/cloud/securitycenter/v2/attack_exposure.proto\x12\x1egoogle.cloud.securitycenter.v2\x1a\x1fgoogle/api/field_behavior.proto\x1a\x1fgoogle/protobuf/timestamp.proto\"\x8f\x03\n\x0e\x41ttackExposure\x12\r\n\x05score\x18\x01 \x01(\x01\x12;\n\x17latest_calculation_time\x18\x02 \x01(\x0b\x32\x1a.google.protobuf.Timestamp\x12\x1e\n\x16\x61ttack_exposure_result\x18\x03 \x01(\t\x12H\n\x05state\x18\x04 \x01(\x0e\x32\x34.google.cloud.securitycenter.v2.AttackExposure.StateB\x03\xe0\x41\x03\x12*\n\"exposed_high_value_resources_count\x18\x05 \x01(\x05\x12,\n$exposed_medium_value_resources_count\x18\x06 \x01(\x05\x12)\n!exposed_low_value_resources_count\x18\x07 \x01(\x05\"B\n\x05State\x12\x15\n\x11STATE_UNSPECIFIED\x10\x00\x12\x0e\n\nCALCULATED\x10\x01\x12\x12\n\x0eNOT_CALCULATED\x10\x02\x42\xed\x01\n\"com.google.cloud.securitycenter.v2B\x13\x41ttackExposureProtoP\x01ZJcloud.google.com/go/securitycenter/apiv2/securitycenterpb;securitycenterpb\xaa\x02\x1eGoogle.Cloud.SecurityCenter.V2\xca\x02\x1eGoogle\\Cloud\\SecurityCenter\\V2\xea\x02!Google::Cloud::SecurityCenter::V2b\x06proto3" - -pool = ::Google::Protobuf::DescriptorPool.generated_pool -pool.add_serialized_file(descriptor_data) - -module Google - module Cloud - module SecurityCenter - module V2 - AttackExposure = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.securitycenter.v2.AttackExposure").msgclass - AttackExposure::State = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.securitycenter.v2.AttackExposure.State").enummodule - end - end - end -end diff --git a/owl-bot-staging/google-cloud-security_center-v2/lib/google/cloud/securitycenter/v2/attack_path_pb.rb b/owl-bot-staging/google-cloud-security_center-v2/lib/google/cloud/securitycenter/v2/attack_path_pb.rb deleted file mode 100644 index 29d28dc5bf3c..000000000000 --- a/owl-bot-staging/google-cloud-security_center-v2/lib/google/cloud/securitycenter/v2/attack_path_pb.rb +++ /dev/null @@ -1,28 +0,0 @@ -# frozen_string_literal: true -# Generated by the protocol buffer compiler. DO NOT EDIT! -# source: google/cloud/securitycenter/v2/attack_path.proto - -require 'google/protobuf' - -require 'google/api/resource_pb' - - -descriptor_data = "\n0google/cloud/securitycenter/v2/attack_path.proto\x12\x1egoogle.cloud.securitycenter.v2\x1a\x19google/api/resource.proto\"\xf0\n\n\nAttackPath\x12\x0c\n\x04name\x18\x01 \x01(\t\x12M\n\npath_nodes\x18\x02 \x03(\x0b\x32\x39.google.cloud.securitycenter.v2.AttackPath.AttackPathNode\x12H\n\x05\x65\x64ges\x18\x03 \x03(\x0b\x32\x39.google.cloud.securitycenter.v2.AttackPath.AttackPathEdge\x1a\xbd\x06\n\x0e\x41ttackPathNode\x12\x10\n\x08resource\x18\x01 \x01(\t\x12\x15\n\rresource_type\x18\x02 \x01(\t\x12\x14\n\x0c\x64isplay_name\x18\x03 \x01(\t\x12p\n\x13\x61ssociated_findings\x18\x04 \x03(\x0b\x32S.google.cloud.securitycenter.v2.AttackPath.AttackPathNode.PathNodeAssociatedFinding\x12\x0c\n\x04uuid\x18\x05 \x01(\t\x12^\n\x0c\x61ttack_steps\x18\x06 \x03(\x0b\x32H.google.cloud.securitycenter.v2.AttackPath.AttackPathNode.AttackStepNode\x1a^\n\x19PathNodeAssociatedFinding\x12\x19\n\x11\x63\x61nonical_finding\x18\x01 \x01(\t\x12\x18\n\x10\x66inding_category\x18\x02 \x01(\t\x12\x0c\n\x04name\x18\x03 \x01(\t\x1a\xb0\x02\n\x0e\x41ttackStepNode\x12\x0c\n\x04uuid\x18\x01 \x01(\t\x12P\n\x04type\x18\x02 \x01(\x0e\x32\x42.google.cloud.securitycenter.v2.AttackPath.AttackPathNode.NodeType\x12\x14\n\x0c\x64isplay_name\x18\x03 \x01(\t\x12\x64\n\x06labels\x18\x04 \x03(\x0b\x32T.google.cloud.securitycenter.v2.AttackPath.AttackPathNode.AttackStepNode.LabelsEntry\x12\x13\n\x0b\x64\x65scription\x18\x05 \x01(\t\x1a-\n\x0bLabelsEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12\r\n\x05value\x18\x02 \x01(\t:\x02\x38\x01\"y\n\x08NodeType\x12\x19\n\x15NODE_TYPE_UNSPECIFIED\x10\x00\x12\x11\n\rNODE_TYPE_AND\x10\x01\x12\x10\n\x0cNODE_TYPE_OR\x10\x02\x12\x15\n\x11NODE_TYPE_DEFENSE\x10\x03\x12\x16\n\x12NODE_TYPE_ATTACKER\x10\x04\x1a\x35\n\x0e\x41ttackPathEdge\x12\x0e\n\x06source\x18\x01 \x01(\t\x12\x13\n\x0b\x64\x65stination\x18\x02 \x01(\t:\xc3\x02\xea\x41\xbf\x02\n(securitycenter.googleapis.com/AttackPath\x12qorganizations/{organization}/simulations/{simulation}/valuedResources/{valued_resource}/attackPaths/{attack_path}\x12\x86\x01organizations/{organization}/locations/{location}/simulations/{simulation}/valuedResources/{valued_resource}/attackPaths/{attack_path}*\x0b\x61ttackPaths2\nattackPathB\xe9\x01\n\"com.google.cloud.securitycenter.v2B\x0f\x41ttackPathProtoP\x01ZJcloud.google.com/go/securitycenter/apiv2/securitycenterpb;securitycenterpb\xaa\x02\x1eGoogle.Cloud.SecurityCenter.V2\xca\x02\x1eGoogle\\Cloud\\SecurityCenter\\V2\xea\x02!Google::Cloud::SecurityCenter::V2b\x06proto3" - -pool = ::Google::Protobuf::DescriptorPool.generated_pool -pool.add_serialized_file(descriptor_data) - -module Google - module Cloud - module SecurityCenter - module V2 - AttackPath = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.securitycenter.v2.AttackPath").msgclass - AttackPath::AttackPathNode = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.securitycenter.v2.AttackPath.AttackPathNode").msgclass - AttackPath::AttackPathNode::PathNodeAssociatedFinding = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.securitycenter.v2.AttackPath.AttackPathNode.PathNodeAssociatedFinding").msgclass - AttackPath::AttackPathNode::AttackStepNode = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.securitycenter.v2.AttackPath.AttackPathNode.AttackStepNode").msgclass - AttackPath::AttackPathNode::NodeType = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.securitycenter.v2.AttackPath.AttackPathNode.NodeType").enummodule - AttackPath::AttackPathEdge = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.securitycenter.v2.AttackPath.AttackPathEdge").msgclass - end - end - end -end diff --git a/owl-bot-staging/google-cloud-security_center-v2/lib/google/cloud/securitycenter/v2/backup_disaster_recovery_pb.rb b/owl-bot-staging/google-cloud-security_center-v2/lib/google/cloud/securitycenter/v2/backup_disaster_recovery_pb.rb deleted file mode 100644 index 1d0185074970..000000000000 --- a/owl-bot-staging/google-cloud-security_center-v2/lib/google/cloud/securitycenter/v2/backup_disaster_recovery_pb.rb +++ /dev/null @@ -1,23 +0,0 @@ -# frozen_string_literal: true -# Generated by the protocol buffer compiler. DO NOT EDIT! -# source: google/cloud/securitycenter/v2/backup_disaster_recovery.proto - -require 'google/protobuf' - -require 'google/protobuf/timestamp_pb' - - -descriptor_data = "\n=google/cloud/securitycenter/v2/backup_disaster_recovery.proto\x12\x1egoogle.cloud.securitycenter.v2\x1a\x1fgoogle/protobuf/timestamp.proto\"\x86\x02\n\x16\x42\x61\x63kupDisasterRecovery\x12\x17\n\x0f\x62\x61\x63kup_template\x18\x01 \x01(\t\x12\x10\n\x08policies\x18\x02 \x03(\t\x12\x0c\n\x04host\x18\x03 \x01(\t\x12\x14\n\x0c\x61pplications\x18\x04 \x03(\t\x12\x14\n\x0cstorage_pool\x18\x05 \x01(\t\x12\x16\n\x0epolicy_options\x18\x06 \x03(\t\x12\x0f\n\x07profile\x18\x07 \x01(\t\x12\x11\n\tappliance\x18\x08 \x01(\t\x12\x13\n\x0b\x62\x61\x63kup_type\x18\t \x01(\t\x12\x36\n\x12\x62\x61\x63kup_create_time\x18\n \x01(\x0b\x32\x1a.google.protobuf.TimestampB\xf5\x01\n\"com.google.cloud.securitycenter.v2B\x1b\x42\x61\x63kupDisasterRecoveryProtoP\x01ZJcloud.google.com/go/securitycenter/apiv2/securitycenterpb;securitycenterpb\xaa\x02\x1eGoogle.Cloud.SecurityCenter.V2\xca\x02\x1eGoogle\\Cloud\\SecurityCenter\\V2\xea\x02!Google::Cloud::SecurityCenter::V2b\x06proto3" - -pool = ::Google::Protobuf::DescriptorPool.generated_pool -pool.add_serialized_file(descriptor_data) - -module Google - module Cloud - module SecurityCenter - module V2 - BackupDisasterRecovery = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.securitycenter.v2.BackupDisasterRecovery").msgclass - end - end - end -end diff --git a/owl-bot-staging/google-cloud-security_center-v2/lib/google/cloud/securitycenter/v2/bigquery_export_pb.rb b/owl-bot-staging/google-cloud-security_center-v2/lib/google/cloud/securitycenter/v2/bigquery_export_pb.rb deleted file mode 100644 index c0ea27ff0b00..000000000000 --- a/owl-bot-staging/google-cloud-security_center-v2/lib/google/cloud/securitycenter/v2/bigquery_export_pb.rb +++ /dev/null @@ -1,25 +0,0 @@ -# frozen_string_literal: true -# Generated by the protocol buffer compiler. DO NOT EDIT! -# source: google/cloud/securitycenter/v2/bigquery_export.proto - -require 'google/protobuf' - -require 'google/api/field_behavior_pb' -require 'google/api/resource_pb' -require 'google/protobuf/timestamp_pb' - - -descriptor_data = "\n4google/cloud/securitycenter/v2/bigquery_export.proto\x12\x1egoogle.cloud.securitycenter.v2\x1a\x1fgoogle/api/field_behavior.proto\x1a\x19google/api/resource.proto\x1a\x1fgoogle/protobuf/timestamp.proto\"\xa2\x04\n\x0e\x42igQueryExport\x12\x11\n\x04name\x18\x01 \x01(\tB\x03\xe0\x41\x08\x12\x13\n\x0b\x64\x65scription\x18\x02 \x01(\t\x12\x0e\n\x06\x66ilter\x18\x03 \x01(\t\x12\x0f\n\x07\x64\x61taset\x18\x04 \x01(\t\x12\x34\n\x0b\x63reate_time\x18\x05 \x01(\x0b\x32\x1a.google.protobuf.TimestampB\x03\xe0\x41\x03\x12\x34\n\x0bupdate_time\x18\x06 \x01(\x0b\x32\x1a.google.protobuf.TimestampB\x03\xe0\x41\x03\x12\x1f\n\x12most_recent_editor\x18\x07 \x01(\tB\x03\xe0\x41\x03\x12\x16\n\tprincipal\x18\x08 \x01(\tB\x03\xe0\x41\x03:\xa1\x02\xea\x41\x9d\x02\n,securitycenter.googleapis.com/BigQueryExport\x12Jorganizations/{organization}/locations/{location}/bigQueryExports/{export}\x12>folders/{folder}/locations/{location}/bigQueryExports/{export}\x12@projects/{project}/locations/{location}/bigQueryExports/{export}*\x0f\x62igQueryExports2\x0e\x62igQueryExportB\xed\x01\n\"com.google.cloud.securitycenter.v2B\x13\x42igQueryExportProtoP\x01ZJcloud.google.com/go/securitycenter/apiv2/securitycenterpb;securitycenterpb\xaa\x02\x1eGoogle.Cloud.SecurityCenter.V2\xca\x02\x1eGoogle\\Cloud\\SecurityCenter\\V2\xea\x02!Google::Cloud::SecurityCenter::V2b\x06proto3" - -pool = ::Google::Protobuf::DescriptorPool.generated_pool -pool.add_serialized_file(descriptor_data) - -module Google - module Cloud - module SecurityCenter - module V2 - BigQueryExport = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.securitycenter.v2.BigQueryExport").msgclass - end - end - end -end diff --git a/owl-bot-staging/google-cloud-security_center-v2/lib/google/cloud/securitycenter/v2/chokepoint_pb.rb b/owl-bot-staging/google-cloud-security_center-v2/lib/google/cloud/securitycenter/v2/chokepoint_pb.rb deleted file mode 100644 index 077e14997c90..000000000000 --- a/owl-bot-staging/google-cloud-security_center-v2/lib/google/cloud/securitycenter/v2/chokepoint_pb.rb +++ /dev/null @@ -1,21 +0,0 @@ -# frozen_string_literal: true -# Generated by the protocol buffer compiler. DO NOT EDIT! -# source: google/cloud/securitycenter/v2/chokepoint.proto - -require 'google/protobuf' - - -descriptor_data = "\n/google/cloud/securitycenter/v2/chokepoint.proto\x12\x1egoogle.cloud.securitycenter.v2\"&\n\nChokepoint\x12\x18\n\x10related_findings\x18\x01 \x03(\tB\xe9\x01\n\"com.google.cloud.securitycenter.v2B\x0f\x43hokepointProtoP\x01ZJcloud.google.com/go/securitycenter/apiv2/securitycenterpb;securitycenterpb\xaa\x02\x1eGoogle.Cloud.SecurityCenter.V2\xca\x02\x1eGoogle\\Cloud\\SecurityCenter\\V2\xea\x02!Google::Cloud::SecurityCenter::V2b\x06proto3" - -pool = ::Google::Protobuf::DescriptorPool.generated_pool -pool.add_serialized_file(descriptor_data) - -module Google - module Cloud - module SecurityCenter - module V2 - Chokepoint = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.securitycenter.v2.Chokepoint").msgclass - end - end - end -end diff --git a/owl-bot-staging/google-cloud-security_center-v2/lib/google/cloud/securitycenter/v2/cloud_armor_pb.rb b/owl-bot-staging/google-cloud-security_center-v2/lib/google/cloud/securitycenter/v2/cloud_armor_pb.rb deleted file mode 100644 index 6cd7e16d09a3..000000000000 --- a/owl-bot-staging/google-cloud-security_center-v2/lib/google/cloud/securitycenter/v2/cloud_armor_pb.rb +++ /dev/null @@ -1,27 +0,0 @@ -# frozen_string_literal: true -# Generated by the protocol buffer compiler. DO NOT EDIT! -# source: google/cloud/securitycenter/v2/cloud_armor.proto - -require 'google/protobuf' - -require 'google/protobuf/duration_pb' - - -descriptor_data = "\n0google/cloud/securitycenter/v2/cloud_armor.proto\x12\x1egoogle.cloud.securitycenter.v2\x1a\x1egoogle/protobuf/duration.proto\"\xde\x02\n\nCloudArmor\x12G\n\x0fsecurity_policy\x18\x01 \x01(\x0b\x32..google.cloud.securitycenter.v2.SecurityPolicy\x12:\n\x08requests\x18\x02 \x01(\x0b\x32(.google.cloud.securitycenter.v2.Requests\x12O\n\x13\x61\x64\x61ptive_protection\x18\x03 \x01(\x0b\x32\x32.google.cloud.securitycenter.v2.AdaptiveProtection\x12\x36\n\x06\x61ttack\x18\x04 \x01(\x0b\x32&.google.cloud.securitycenter.v2.Attack\x12\x15\n\rthreat_vector\x18\x05 \x01(\t\x12+\n\x08\x64uration\x18\x06 \x01(\x0b\x32\x19.google.protobuf.Duration\"=\n\x0eSecurityPolicy\x12\x0c\n\x04name\x18\x01 \x01(\t\x12\x0c\n\x04type\x18\x02 \x01(\t\x12\x0f\n\x07preview\x18\x03 \x01(\x08\"j\n\x08Requests\x12\r\n\x05ratio\x18\x01 \x01(\x01\x12\x1a\n\x12short_term_allowed\x18\x02 \x01(\x05\x12\x19\n\x11long_term_allowed\x18\x03 \x01(\x05\x12\x18\n\x10long_term_denied\x18\x04 \x01(\x05\"(\n\x12\x41\x64\x61ptiveProtection\x12\x12\n\nconfidence\x18\x01 \x01(\x01\"\x82\x01\n\x06\x41ttack\x12\x17\n\x0fvolume_pps_long\x18\x04 \x01(\x03\x12\x17\n\x0fvolume_bps_long\x18\x05 \x01(\x03\x12\x16\n\x0e\x63lassification\x18\x03 \x01(\t\x12\x16\n\nvolume_pps\x18\x01 \x01(\x05\x42\x02\x18\x01\x12\x16\n\nvolume_bps\x18\x02 \x01(\x05\x42\x02\x18\x01\x42\xe9\x01\n\"com.google.cloud.securitycenter.v2B\x0f\x43loudArmorProtoP\x01ZJcloud.google.com/go/securitycenter/apiv2/securitycenterpb;securitycenterpb\xaa\x02\x1eGoogle.Cloud.SecurityCenter.V2\xca\x02\x1eGoogle\\Cloud\\SecurityCenter\\V2\xea\x02!Google::Cloud::SecurityCenter::V2b\x06proto3" - -pool = ::Google::Protobuf::DescriptorPool.generated_pool -pool.add_serialized_file(descriptor_data) - -module Google - module Cloud - module SecurityCenter - module V2 - CloudArmor = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.securitycenter.v2.CloudArmor").msgclass - SecurityPolicy = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.securitycenter.v2.SecurityPolicy").msgclass - Requests = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.securitycenter.v2.Requests").msgclass - AdaptiveProtection = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.securitycenter.v2.AdaptiveProtection").msgclass - Attack = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.securitycenter.v2.Attack").msgclass - end - end - end -end diff --git a/owl-bot-staging/google-cloud-security_center-v2/lib/google/cloud/securitycenter/v2/cloud_dlp_data_profile_pb.rb b/owl-bot-staging/google-cloud-security_center-v2/lib/google/cloud/securitycenter/v2/cloud_dlp_data_profile_pb.rb deleted file mode 100644 index 388023feb3f9..000000000000 --- a/owl-bot-staging/google-cloud-security_center-v2/lib/google/cloud/securitycenter/v2/cloud_dlp_data_profile_pb.rb +++ /dev/null @@ -1,24 +0,0 @@ -# frozen_string_literal: true -# Generated by the protocol buffer compiler. DO NOT EDIT! -# source: google/cloud/securitycenter/v2/cloud_dlp_data_profile.proto - -require 'google/protobuf' - -require 'google/api/resource_pb' - - -descriptor_data = "\n;google/cloud/securitycenter/v2/cloud_dlp_data_profile.proto\x12\x1egoogle.cloud.securitycenter.v2\x1a\x19google/api/resource.proto\"\xf4\x01\n\x13\x43loudDlpDataProfile\x12>\n\x0c\x64\x61ta_profile\x18\x01 \x01(\tB(\xfa\x41%\n#dlp.googleapis.com/TableDataProfile\x12S\n\x0bparent_type\x18\x02 \x01(\x0e\x32>.google.cloud.securitycenter.v2.CloudDlpDataProfile.ParentType\"H\n\nParentType\x12\x1b\n\x17PARENT_TYPE_UNSPECIFIED\x10\x00\x12\x10\n\x0cORGANIZATION\x10\x01\x12\x0b\n\x07PROJECT\x10\x02\x42\x94\x03\n\"com.google.cloud.securitycenter.v2B\x18\x43loudDlpDataProfileProtoP\x01ZJcloud.google.com/go/securitycenter/apiv2/securitycenterpb;securitycenterpb\xaa\x02\x1eGoogle.Cloud.SecurityCenter.V2\xca\x02\x1eGoogle\\Cloud\\SecurityCenter\\V2\xea\x02!Google::Cloud::SecurityCenter::V2\xea\x41\x9e\x01\n#dlp.googleapis.com/TableDataProfile\x12\x30projects/{project}/tableProfiles/{table_profile}\x12\x45projects/{project}/locations/{location}/tableProfiles/{table_profile}b\x06proto3" - -pool = ::Google::Protobuf::DescriptorPool.generated_pool -pool.add_serialized_file(descriptor_data) - -module Google - module Cloud - module SecurityCenter - module V2 - CloudDlpDataProfile = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.securitycenter.v2.CloudDlpDataProfile").msgclass - CloudDlpDataProfile::ParentType = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.securitycenter.v2.CloudDlpDataProfile.ParentType").enummodule - end - end - end -end diff --git a/owl-bot-staging/google-cloud-security_center-v2/lib/google/cloud/securitycenter/v2/cloud_dlp_inspection_pb.rb b/owl-bot-staging/google-cloud-security_center-v2/lib/google/cloud/securitycenter/v2/cloud_dlp_inspection_pb.rb deleted file mode 100644 index 98b7cb9b4a86..000000000000 --- a/owl-bot-staging/google-cloud-security_center-v2/lib/google/cloud/securitycenter/v2/cloud_dlp_inspection_pb.rb +++ /dev/null @@ -1,23 +0,0 @@ -# frozen_string_literal: true -# Generated by the protocol buffer compiler. DO NOT EDIT! -# source: google/cloud/securitycenter/v2/cloud_dlp_inspection.proto - -require 'google/protobuf' - -require 'google/api/resource_pb' - - -descriptor_data = "\n9google/cloud/securitycenter/v2/cloud_dlp_inspection.proto\x12\x1egoogle.cloud.securitycenter.v2\x1a\x19google/api/resource.proto\"\x88\x01\n\x12\x43loudDlpInspection\x12\x33\n\x0binspect_job\x18\x01 \x01(\tB\x1e\xfa\x41\x1b\n\x19\x64lp.googleapis.com/DlpJob\x12\x11\n\tinfo_type\x18\x02 \x01(\t\x12\x17\n\x0finfo_type_count\x18\x03 \x01(\x03\x12\x11\n\tfull_scan\x18\x04 \x01(\x08\x42\xf0\x02\n\"com.google.cloud.securitycenter.v2B\x17\x43loudDlpInspectionProtoP\x01ZJcloud.google.com/go/securitycenter/apiv2/securitycenterpb;securitycenterpb\xaa\x02\x1eGoogle.Cloud.SecurityCenter.V2\xca\x02\x1eGoogle\\Cloud\\SecurityCenter\\V2\xea\x02!Google::Cloud::SecurityCenter::V2\xea\x41|\n\x19\x64lp.googleapis.com/DlpJob\x12$projects/{project}/dlpJobs/{dlp_job}\x12\x39projects/{project}/locations/{location}/dlpJobs/{dlp_job}b\x06proto3" - -pool = ::Google::Protobuf::DescriptorPool.generated_pool -pool.add_serialized_file(descriptor_data) - -module Google - module Cloud - module SecurityCenter - module V2 - CloudDlpInspection = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.securitycenter.v2.CloudDlpInspection").msgclass - end - end - end -end diff --git a/owl-bot-staging/google-cloud-security_center-v2/lib/google/cloud/securitycenter/v2/compliance_pb.rb b/owl-bot-staging/google-cloud-security_center-v2/lib/google/cloud/securitycenter/v2/compliance_pb.rb deleted file mode 100644 index 547a8fe23d36..000000000000 --- a/owl-bot-staging/google-cloud-security_center-v2/lib/google/cloud/securitycenter/v2/compliance_pb.rb +++ /dev/null @@ -1,21 +0,0 @@ -# frozen_string_literal: true -# Generated by the protocol buffer compiler. DO NOT EDIT! -# source: google/cloud/securitycenter/v2/compliance.proto - -require 'google/protobuf' - - -descriptor_data = "\n/google/cloud/securitycenter/v2/compliance.proto\x12\x1egoogle.cloud.securitycenter.v2\"<\n\nCompliance\x12\x10\n\x08standard\x18\x01 \x01(\t\x12\x0f\n\x07version\x18\x02 \x01(\t\x12\x0b\n\x03ids\x18\x03 \x03(\tB\xe9\x01\n\"com.google.cloud.securitycenter.v2B\x0f\x43omplianceProtoP\x01ZJcloud.google.com/go/securitycenter/apiv2/securitycenterpb;securitycenterpb\xaa\x02\x1eGoogle.Cloud.SecurityCenter.V2\xca\x02\x1eGoogle\\Cloud\\SecurityCenter\\V2\xea\x02!Google::Cloud::SecurityCenter::V2b\x06proto3" - -pool = ::Google::Protobuf::DescriptorPool.generated_pool -pool.add_serialized_file(descriptor_data) - -module Google - module Cloud - module SecurityCenter - module V2 - Compliance = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.securitycenter.v2.Compliance").msgclass - end - end - end -end diff --git a/owl-bot-staging/google-cloud-security_center-v2/lib/google/cloud/securitycenter/v2/connection_pb.rb b/owl-bot-staging/google-cloud-security_center-v2/lib/google/cloud/securitycenter/v2/connection_pb.rb deleted file mode 100644 index b0144d4d939a..000000000000 --- a/owl-bot-staging/google-cloud-security_center-v2/lib/google/cloud/securitycenter/v2/connection_pb.rb +++ /dev/null @@ -1,22 +0,0 @@ -# frozen_string_literal: true -# Generated by the protocol buffer compiler. DO NOT EDIT! -# source: google/cloud/securitycenter/v2/connection.proto - -require 'google/protobuf' - - -descriptor_data = "\n/google/cloud/securitycenter/v2/connection.proto\x12\x1egoogle.cloud.securitycenter.v2\"\x81\x02\n\nConnection\x12\x16\n\x0e\x64\x65stination_ip\x18\x01 \x01(\t\x12\x18\n\x10\x64\x65stination_port\x18\x02 \x01(\x05\x12\x11\n\tsource_ip\x18\x03 \x01(\t\x12\x13\n\x0bsource_port\x18\x04 \x01(\x05\x12\x45\n\x08protocol\x18\x05 \x01(\x0e\x32\x33.google.cloud.securitycenter.v2.Connection.Protocol\"R\n\x08Protocol\x12\x18\n\x14PROTOCOL_UNSPECIFIED\x10\x00\x12\x08\n\x04ICMP\x10\x01\x12\x07\n\x03TCP\x10\x06\x12\x07\n\x03UDP\x10\x11\x12\x07\n\x03GRE\x10/\x12\x07\n\x03\x45SP\x10\x32\x42\xe9\x01\n\"com.google.cloud.securitycenter.v2B\x0f\x43onnectionProtoP\x01ZJcloud.google.com/go/securitycenter/apiv2/securitycenterpb;securitycenterpb\xaa\x02\x1eGoogle.Cloud.SecurityCenter.V2\xca\x02\x1eGoogle\\Cloud\\SecurityCenter\\V2\xea\x02!Google::Cloud::SecurityCenter::V2b\x06proto3" - -pool = ::Google::Protobuf::DescriptorPool.generated_pool -pool.add_serialized_file(descriptor_data) - -module Google - module Cloud - module SecurityCenter - module V2 - Connection = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.securitycenter.v2.Connection").msgclass - Connection::Protocol = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.securitycenter.v2.Connection.Protocol").enummodule - end - end - end -end diff --git a/owl-bot-staging/google-cloud-security_center-v2/lib/google/cloud/securitycenter/v2/contact_details_pb.rb b/owl-bot-staging/google-cloud-security_center-v2/lib/google/cloud/securitycenter/v2/contact_details_pb.rb deleted file mode 100644 index 06a5286cc3de..000000000000 --- a/owl-bot-staging/google-cloud-security_center-v2/lib/google/cloud/securitycenter/v2/contact_details_pb.rb +++ /dev/null @@ -1,22 +0,0 @@ -# frozen_string_literal: true -# Generated by the protocol buffer compiler. DO NOT EDIT! -# source: google/cloud/securitycenter/v2/contact_details.proto - -require 'google/protobuf' - - -descriptor_data = "\n4google/cloud/securitycenter/v2/contact_details.proto\x12\x1egoogle.cloud.securitycenter.v2\"K\n\x0e\x43ontactDetails\x12\x39\n\x08\x63ontacts\x18\x01 \x03(\x0b\x32\'.google.cloud.securitycenter.v2.Contact\"\x18\n\x07\x43ontact\x12\r\n\x05\x65mail\x18\x01 \x01(\tB\xed\x01\n\"com.google.cloud.securitycenter.v2B\x13\x43ontactDetailsProtoP\x01ZJcloud.google.com/go/securitycenter/apiv2/securitycenterpb;securitycenterpb\xaa\x02\x1eGoogle.Cloud.SecurityCenter.V2\xca\x02\x1eGoogle\\Cloud\\SecurityCenter\\V2\xea\x02!Google::Cloud::SecurityCenter::V2b\x06proto3" - -pool = ::Google::Protobuf::DescriptorPool.generated_pool -pool.add_serialized_file(descriptor_data) - -module Google - module Cloud - module SecurityCenter - module V2 - ContactDetails = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.securitycenter.v2.ContactDetails").msgclass - Contact = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.securitycenter.v2.Contact").msgclass - end - end - end -end diff --git a/owl-bot-staging/google-cloud-security_center-v2/lib/google/cloud/securitycenter/v2/container_pb.rb b/owl-bot-staging/google-cloud-security_center-v2/lib/google/cloud/securitycenter/v2/container_pb.rb deleted file mode 100644 index 14bc2a2bab9f..000000000000 --- a/owl-bot-staging/google-cloud-security_center-v2/lib/google/cloud/securitycenter/v2/container_pb.rb +++ /dev/null @@ -1,24 +0,0 @@ -# frozen_string_literal: true -# Generated by the protocol buffer compiler. DO NOT EDIT! -# source: google/cloud/securitycenter/v2/container.proto - -require 'google/protobuf' - -require 'google/cloud/securitycenter/v2/label_pb' -require 'google/protobuf/timestamp_pb' - - -descriptor_data = "\n.google/cloud/securitycenter/v2/container.proto\x12\x1egoogle.cloud.securitycenter.v2\x1a*google/cloud/securitycenter/v2/label.proto\x1a\x1fgoogle/protobuf/timestamp.proto\"\xa0\x01\n\tContainer\x12\x0c\n\x04name\x18\x01 \x01(\t\x12\x0b\n\x03uri\x18\x02 \x01(\t\x12\x10\n\x08image_id\x18\x03 \x01(\t\x12\x35\n\x06labels\x18\x04 \x03(\x0b\x32%.google.cloud.securitycenter.v2.Label\x12/\n\x0b\x63reate_time\x18\x05 \x01(\x0b\x32\x1a.google.protobuf.TimestampB\xe8\x01\n\"com.google.cloud.securitycenter.v2B\x0e\x43ontainerProtoP\x01ZJcloud.google.com/go/securitycenter/apiv2/securitycenterpb;securitycenterpb\xaa\x02\x1eGoogle.Cloud.SecurityCenter.V2\xca\x02\x1eGoogle\\Cloud\\SecurityCenter\\V2\xea\x02!Google::Cloud::SecurityCenter::V2b\x06proto3" - -pool = ::Google::Protobuf::DescriptorPool.generated_pool -pool.add_serialized_file(descriptor_data) - -module Google - module Cloud - module SecurityCenter - module V2 - Container = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.securitycenter.v2.Container").msgclass - end - end - end -end diff --git a/owl-bot-staging/google-cloud-security_center-v2/lib/google/cloud/securitycenter/v2/data_access_event_pb.rb b/owl-bot-staging/google-cloud-security_center-v2/lib/google/cloud/securitycenter/v2/data_access_event_pb.rb deleted file mode 100644 index 77d3859aa987..000000000000 --- a/owl-bot-staging/google-cloud-security_center-v2/lib/google/cloud/securitycenter/v2/data_access_event_pb.rb +++ /dev/null @@ -1,24 +0,0 @@ -# frozen_string_literal: true -# Generated by the protocol buffer compiler. DO NOT EDIT! -# source: google/cloud/securitycenter/v2/data_access_event.proto - -require 'google/protobuf' - -require 'google/protobuf/timestamp_pb' - - -descriptor_data = "\n6google/cloud/securitycenter/v2/data_access_event.proto\x12\x1egoogle.cloud.securitycenter.v2\x1a\x1fgoogle/protobuf/timestamp.proto\"\x80\x02\n\x0f\x44\x61taAccessEvent\x12\x10\n\x08\x65vent_id\x18\x01 \x01(\t\x12\x17\n\x0fprincipal_email\x18\x02 \x01(\t\x12L\n\toperation\x18\x03 \x01(\x0e\x32\x39.google.cloud.securitycenter.v2.DataAccessEvent.Operation\x12.\n\nevent_time\x18\x04 \x01(\x0b\x32\x1a.google.protobuf.Timestamp\"D\n\tOperation\x12\x19\n\x15OPERATION_UNSPECIFIED\x10\x00\x12\x08\n\x04READ\x10\x01\x12\x08\n\x04MOVE\x10\x02\x12\x08\n\x04\x43OPY\x10\x03\x42\xee\x01\n\"com.google.cloud.securitycenter.v2B\x14\x44\x61taAccessEventProtoP\x01ZJcloud.google.com/go/securitycenter/apiv2/securitycenterpb;securitycenterpb\xaa\x02\x1eGoogle.Cloud.SecurityCenter.V2\xca\x02\x1eGoogle\\Cloud\\SecurityCenter\\V2\xea\x02!Google::Cloud::SecurityCenter::V2b\x06proto3" - -pool = ::Google::Protobuf::DescriptorPool.generated_pool -pool.add_serialized_file(descriptor_data) - -module Google - module Cloud - module SecurityCenter - module V2 - DataAccessEvent = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.securitycenter.v2.DataAccessEvent").msgclass - DataAccessEvent::Operation = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.securitycenter.v2.DataAccessEvent.Operation").enummodule - end - end - end -end diff --git a/owl-bot-staging/google-cloud-security_center-v2/lib/google/cloud/securitycenter/v2/data_flow_event_pb.rb b/owl-bot-staging/google-cloud-security_center-v2/lib/google/cloud/securitycenter/v2/data_flow_event_pb.rb deleted file mode 100644 index 418d09d93c4a..000000000000 --- a/owl-bot-staging/google-cloud-security_center-v2/lib/google/cloud/securitycenter/v2/data_flow_event_pb.rb +++ /dev/null @@ -1,24 +0,0 @@ -# frozen_string_literal: true -# Generated by the protocol buffer compiler. DO NOT EDIT! -# source: google/cloud/securitycenter/v2/data_flow_event.proto - -require 'google/protobuf' - -require 'google/protobuf/timestamp_pb' - - -descriptor_data = "\n4google/cloud/securitycenter/v2/data_flow_event.proto\x12\x1egoogle.cloud.securitycenter.v2\x1a\x1fgoogle/protobuf/timestamp.proto\"\x97\x02\n\rDataFlowEvent\x12\x10\n\x08\x65vent_id\x18\x01 \x01(\t\x12\x17\n\x0fprincipal_email\x18\x02 \x01(\t\x12J\n\toperation\x18\x03 \x01(\x0e\x32\x37.google.cloud.securitycenter.v2.DataFlowEvent.Operation\x12\x19\n\x11violated_location\x18\x04 \x01(\t\x12.\n\nevent_time\x18\x05 \x01(\x0b\x32\x1a.google.protobuf.Timestamp\"D\n\tOperation\x12\x19\n\x15OPERATION_UNSPECIFIED\x10\x00\x12\x08\n\x04READ\x10\x01\x12\x08\n\x04MOVE\x10\x02\x12\x08\n\x04\x43OPY\x10\x03\x42\xec\x01\n\"com.google.cloud.securitycenter.v2B\x12\x44\x61taFlowEventProtoP\x01ZJcloud.google.com/go/securitycenter/apiv2/securitycenterpb;securitycenterpb\xaa\x02\x1eGoogle.Cloud.SecurityCenter.V2\xca\x02\x1eGoogle\\Cloud\\SecurityCenter\\V2\xea\x02!Google::Cloud::SecurityCenter::V2b\x06proto3" - -pool = ::Google::Protobuf::DescriptorPool.generated_pool -pool.add_serialized_file(descriptor_data) - -module Google - module Cloud - module SecurityCenter - module V2 - DataFlowEvent = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.securitycenter.v2.DataFlowEvent").msgclass - DataFlowEvent::Operation = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.securitycenter.v2.DataFlowEvent.Operation").enummodule - end - end - end -end diff --git a/owl-bot-staging/google-cloud-security_center-v2/lib/google/cloud/securitycenter/v2/data_retention_deletion_event_pb.rb b/owl-bot-staging/google-cloud-security_center-v2/lib/google/cloud/securitycenter/v2/data_retention_deletion_event_pb.rb deleted file mode 100644 index 17693433fba7..000000000000 --- a/owl-bot-staging/google-cloud-security_center-v2/lib/google/cloud/securitycenter/v2/data_retention_deletion_event_pb.rb +++ /dev/null @@ -1,25 +0,0 @@ -# frozen_string_literal: true -# Generated by the protocol buffer compiler. DO NOT EDIT! -# source: google/cloud/securitycenter/v2/data_retention_deletion_event.proto - -require 'google/protobuf' - -require 'google/protobuf/duration_pb' -require 'google/protobuf/timestamp_pb' - - -descriptor_data = "\nBgoogle/cloud/securitycenter/v2/data_retention_deletion_event.proto\x12\x1egoogle.cloud.securitycenter.v2\x1a\x1egoogle/protobuf/duration.proto\x1a\x1fgoogle/protobuf/timestamp.proto\"\xcf\x02\n\x1a\x44\x61taRetentionDeletionEvent\x12\x38\n\x14\x65vent_detection_time\x18\x02 \x01(\x0b\x32\x1a.google.protobuf.Timestamp\x12\x19\n\x11\x64\x61ta_object_count\x18\x03 \x01(\x03\x12\x38\n\x15max_retention_allowed\x18\x04 \x01(\x0b\x32\x19.google.protobuf.Duration\x12X\n\nevent_type\x18\x05 \x01(\x0e\x32\x44.google.cloud.securitycenter.v2.DataRetentionDeletionEvent.EventType\"H\n\tEventType\x12\x1a\n\x16\x45VENT_TYPE_UNSPECIFIED\x10\x00\x12\x1f\n\x1b\x45VENT_TYPE_MAX_TTL_EXCEEDED\x10\x01\x42\xf9\x01\n\"com.google.cloud.securitycenter.v2B\x1f\x44\x61taRetentionDeletionEventProtoP\x01ZJcloud.google.com/go/securitycenter/apiv2/securitycenterpb;securitycenterpb\xaa\x02\x1eGoogle.Cloud.SecurityCenter.V2\xca\x02\x1eGoogle\\Cloud\\SecurityCenter\\V2\xea\x02!Google::Cloud::SecurityCenter::V2b\x06proto3" - -pool = ::Google::Protobuf::DescriptorPool.generated_pool -pool.add_serialized_file(descriptor_data) - -module Google - module Cloud - module SecurityCenter - module V2 - DataRetentionDeletionEvent = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.securitycenter.v2.DataRetentionDeletionEvent").msgclass - DataRetentionDeletionEvent::EventType = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.securitycenter.v2.DataRetentionDeletionEvent.EventType").enummodule - end - end - end -end diff --git a/owl-bot-staging/google-cloud-security_center-v2/lib/google/cloud/securitycenter/v2/database_pb.rb b/owl-bot-staging/google-cloud-security_center-v2/lib/google/cloud/securitycenter/v2/database_pb.rb deleted file mode 100644 index 32310070d4bc..000000000000 --- a/owl-bot-staging/google-cloud-security_center-v2/lib/google/cloud/securitycenter/v2/database_pb.rb +++ /dev/null @@ -1,21 +0,0 @@ -# frozen_string_literal: true -# Generated by the protocol buffer compiler. DO NOT EDIT! -# source: google/cloud/securitycenter/v2/database.proto - -require 'google/protobuf' - - -descriptor_data = "\n-google/cloud/securitycenter/v2/database.proto\x12\x1egoogle.cloud.securitycenter.v2\"s\n\x08\x44\x61tabase\x12\x0c\n\x04name\x18\x01 \x01(\t\x12\x14\n\x0c\x64isplay_name\x18\x02 \x01(\t\x12\x11\n\tuser_name\x18\x03 \x01(\t\x12\r\n\x05query\x18\x04 \x01(\t\x12\x10\n\x08grantees\x18\x05 \x03(\t\x12\x0f\n\x07version\x18\x06 \x01(\tB\xe7\x01\n\"com.google.cloud.securitycenter.v2B\rDatabaseProtoP\x01ZJcloud.google.com/go/securitycenter/apiv2/securitycenterpb;securitycenterpb\xaa\x02\x1eGoogle.Cloud.SecurityCenter.V2\xca\x02\x1eGoogle\\Cloud\\SecurityCenter\\V2\xea\x02!Google::Cloud::SecurityCenter::V2b\x06proto3" - -pool = ::Google::Protobuf::DescriptorPool.generated_pool -pool.add_serialized_file(descriptor_data) - -module Google - module Cloud - module SecurityCenter - module V2 - Database = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.securitycenter.v2.Database").msgclass - end - end - end -end diff --git a/owl-bot-staging/google-cloud-security_center-v2/lib/google/cloud/securitycenter/v2/disk_pb.rb b/owl-bot-staging/google-cloud-security_center-v2/lib/google/cloud/securitycenter/v2/disk_pb.rb deleted file mode 100644 index a62acf2da0c4..000000000000 --- a/owl-bot-staging/google-cloud-security_center-v2/lib/google/cloud/securitycenter/v2/disk_pb.rb +++ /dev/null @@ -1,21 +0,0 @@ -# frozen_string_literal: true -# Generated by the protocol buffer compiler. DO NOT EDIT! -# source: google/cloud/securitycenter/v2/disk.proto - -require 'google/protobuf' - - -descriptor_data = "\n)google/cloud/securitycenter/v2/disk.proto\x12\x1egoogle.cloud.securitycenter.v2\"\x14\n\x04\x44isk\x12\x0c\n\x04name\x18\x01 \x01(\tB\xe3\x01\n\"com.google.cloud.securitycenter.v2B\tDiskProtoP\x01ZJcloud.google.com/go/securitycenter/apiv2/securitycenterpb;securitycenterpb\xaa\x02\x1eGoogle.Cloud.SecurityCenter.V2\xca\x02\x1eGoogle\\Cloud\\SecurityCenter\\V2\xea\x02!Google::Cloud::SecurityCenter::V2b\x06proto3" - -pool = ::Google::Protobuf::DescriptorPool.generated_pool -pool.add_serialized_file(descriptor_data) - -module Google - module Cloud - module SecurityCenter - module V2 - Disk = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.securitycenter.v2.Disk").msgclass - end - end - end -end diff --git a/owl-bot-staging/google-cloud-security_center-v2/lib/google/cloud/securitycenter/v2/exfiltration_pb.rb b/owl-bot-staging/google-cloud-security_center-v2/lib/google/cloud/securitycenter/v2/exfiltration_pb.rb deleted file mode 100644 index 4e217d9041f6..000000000000 --- a/owl-bot-staging/google-cloud-security_center-v2/lib/google/cloud/securitycenter/v2/exfiltration_pb.rb +++ /dev/null @@ -1,22 +0,0 @@ -# frozen_string_literal: true -# Generated by the protocol buffer compiler. DO NOT EDIT! -# source: google/cloud/securitycenter/v2/exfiltration.proto - -require 'google/protobuf' - - -descriptor_data = "\n1google/cloud/securitycenter/v2/exfiltration.proto\x12\x1egoogle.cloud.securitycenter.v2\"\xaf\x01\n\x0c\x45xfiltration\x12>\n\x07sources\x18\x01 \x03(\x0b\x32-.google.cloud.securitycenter.v2.ExfilResource\x12>\n\x07targets\x18\x02 \x03(\x0b\x32-.google.cloud.securitycenter.v2.ExfilResource\x12\x1f\n\x17total_exfiltrated_bytes\x18\x03 \x01(\x03\"1\n\rExfilResource\x12\x0c\n\x04name\x18\x01 \x01(\t\x12\x12\n\ncomponents\x18\x02 \x03(\tB\xeb\x01\n\"com.google.cloud.securitycenter.v2B\x11\x45xfiltrationProtoP\x01ZJcloud.google.com/go/securitycenter/apiv2/securitycenterpb;securitycenterpb\xaa\x02\x1eGoogle.Cloud.SecurityCenter.V2\xca\x02\x1eGoogle\\Cloud\\SecurityCenter\\V2\xea\x02!Google::Cloud::SecurityCenter::V2b\x06proto3" - -pool = ::Google::Protobuf::DescriptorPool.generated_pool -pool.add_serialized_file(descriptor_data) - -module Google - module Cloud - module SecurityCenter - module V2 - Exfiltration = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.securitycenter.v2.Exfiltration").msgclass - ExfilResource = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.securitycenter.v2.ExfilResource").msgclass - end - end - end -end diff --git a/owl-bot-staging/google-cloud-security_center-v2/lib/google/cloud/securitycenter/v2/external_system_pb.rb b/owl-bot-staging/google-cloud-security_center-v2/lib/google/cloud/securitycenter/v2/external_system_pb.rb deleted file mode 100644 index 684f53455eeb..000000000000 --- a/owl-bot-staging/google-cloud-security_center-v2/lib/google/cloud/securitycenter/v2/external_system_pb.rb +++ /dev/null @@ -1,25 +0,0 @@ -# frozen_string_literal: true -# Generated by the protocol buffer compiler. DO NOT EDIT! -# source: google/cloud/securitycenter/v2/external_system.proto - -require 'google/protobuf' - -require 'google/api/resource_pb' -require 'google/protobuf/timestamp_pb' - - -descriptor_data = "\n4google/cloud/securitycenter/v2/external_system.proto\x12\x1egoogle.cloud.securitycenter.v2\x1a\x19google/api/resource.proto\x1a\x1fgoogle/protobuf/timestamp.proto\"\xd4\t\n\x0e\x45xternalSystem\x12\x0c\n\x04name\x18\x01 \x01(\t\x12\x11\n\tassignees\x18\x02 \x03(\t\x12\x14\n\x0c\x65xternal_uid\x18\x03 \x01(\t\x12\x0e\n\x06status\x18\x04 \x01(\t\x12?\n\x1b\x65xternal_system_update_time\x18\x05 \x01(\x0b\x32\x1a.google.protobuf.Timestamp\x12\x10\n\x08\x63\x61se_uri\x18\x06 \x01(\t\x12\x15\n\rcase_priority\x18\x07 \x01(\t\x12,\n\x08\x63\x61se_sla\x18\t \x01(\x0b\x32\x1a.google.protobuf.Timestamp\x12\x34\n\x10\x63\x61se_create_time\x18\n \x01(\x0b\x32\x1a.google.protobuf.Timestamp\x12\x33\n\x0f\x63\x61se_close_time\x18\x0b \x01(\x0b\x32\x1a.google.protobuf.Timestamp\x12N\n\x0bticket_info\x18\x08 \x01(\x0b\x32\x39.google.cloud.securitycenter.v2.ExternalSystem.TicketInfo\x1a\x8d\x01\n\nTicketInfo\x12\n\n\x02id\x18\x01 \x01(\t\x12\x10\n\x08\x61ssignee\x18\x02 \x01(\t\x12\x13\n\x0b\x64\x65scription\x18\x03 \x01(\t\x12\x0b\n\x03uri\x18\x04 \x01(\t\x12\x0e\n\x06status\x18\x05 \x01(\t\x12/\n\x0bupdate_time\x18\x06 \x01(\x0b\x32\x1a.google.protobuf.Timestamp:\x97\x05\xea\x41\x93\x05\n,securitycenter.googleapis.com/ExternalSystem\x12\x61organizations/{organization}/sources/{source}/findings/{finding}/externalSystems/{externalsystem}\x12vorganizations/{organization}/sources/{source}/locations/{location}/findings/{finding}/externalSystems/{externalsystem}\x12Ufolders/{folder}/sources/{source}/findings/{finding}/externalSystems/{externalsystem}\x12jfolders/{folder}/sources/{source}/locations/{location}/findings/{finding}/externalSystems/{externalsystem}\x12Wprojects/{project}/sources/{source}/findings/{finding}/externalSystems/{externalsystem}\x12lprojects/{project}/sources/{source}/locations/{location}/findings/{finding}/externalSystems/{externalsystem}B\xed\x01\n\"com.google.cloud.securitycenter.v2B\x13\x45xternalSystemProtoP\x01ZJcloud.google.com/go/securitycenter/apiv2/securitycenterpb;securitycenterpb\xaa\x02\x1eGoogle.Cloud.SecurityCenter.V2\xca\x02\x1eGoogle\\Cloud\\SecurityCenter\\V2\xea\x02!Google::Cloud::SecurityCenter::V2b\x06proto3" - -pool = ::Google::Protobuf::DescriptorPool.generated_pool -pool.add_serialized_file(descriptor_data) - -module Google - module Cloud - module SecurityCenter - module V2 - ExternalSystem = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.securitycenter.v2.ExternalSystem").msgclass - ExternalSystem::TicketInfo = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.securitycenter.v2.ExternalSystem.TicketInfo").msgclass - end - end - end -end diff --git a/owl-bot-staging/google-cloud-security_center-v2/lib/google/cloud/securitycenter/v2/file_pb.rb b/owl-bot-staging/google-cloud-security_center-v2/lib/google/cloud/securitycenter/v2/file_pb.rb deleted file mode 100644 index 3004389fa02c..000000000000 --- a/owl-bot-staging/google-cloud-security_center-v2/lib/google/cloud/securitycenter/v2/file_pb.rb +++ /dev/null @@ -1,24 +0,0 @@ -# frozen_string_literal: true -# Generated by the protocol buffer compiler. DO NOT EDIT! -# source: google/cloud/securitycenter/v2/file.proto - -require 'google/protobuf' - - -descriptor_data = "\n)google/cloud/securitycenter/v2/file.proto\x12\x1egoogle.cloud.securitycenter.v2\"\x83\x04\n\x04\x46ile\x12\x0c\n\x04path\x18\x01 \x01(\t\x12\x0c\n\x04size\x18\x02 \x01(\x03\x12\x0e\n\x06sha256\x18\x03 \x01(\t\x12\x13\n\x0bhashed_size\x18\x04 \x01(\x03\x12\x18\n\x10partially_hashed\x18\x05 \x01(\x08\x12\x10\n\x08\x63ontents\x18\x06 \x01(\t\x12@\n\tdisk_path\x18\x07 \x01(\x0b\x32-.google.cloud.securitycenter.v2.File.DiskPath\x12\x46\n\noperations\x18\x08 \x03(\x0b\x32\x32.google.cloud.securitycenter.v2.File.FileOperation\x1a\x39\n\x08\x44iskPath\x12\x16\n\x0epartition_uuid\x18\x01 \x01(\t\x12\x15\n\rrelative_path\x18\x02 \x01(\t\x1a\xc8\x01\n\rFileOperation\x12N\n\x04type\x18\x01 \x01(\x0e\x32@.google.cloud.securitycenter.v2.File.FileOperation.OperationType\"g\n\rOperationType\x12\x1e\n\x1aOPERATION_TYPE_UNSPECIFIED\x10\x00\x12\x08\n\x04OPEN\x10\x01\x12\x08\n\x04READ\x10\x02\x12\n\n\x06RENAME\x10\x03\x12\t\n\x05WRITE\x10\x04\x12\x0b\n\x07\x45XECUTE\x10\x05\x42\xe3\x01\n\"com.google.cloud.securitycenter.v2B\tFileProtoP\x01ZJcloud.google.com/go/securitycenter/apiv2/securitycenterpb;securitycenterpb\xaa\x02\x1eGoogle.Cloud.SecurityCenter.V2\xca\x02\x1eGoogle\\Cloud\\SecurityCenter\\V2\xea\x02!Google::Cloud::SecurityCenter::V2b\x06proto3" - -pool = ::Google::Protobuf::DescriptorPool.generated_pool -pool.add_serialized_file(descriptor_data) - -module Google - module Cloud - module SecurityCenter - module V2 - File = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.securitycenter.v2.File").msgclass - File::DiskPath = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.securitycenter.v2.File.DiskPath").msgclass - File::FileOperation = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.securitycenter.v2.File.FileOperation").msgclass - File::FileOperation::OperationType = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.securitycenter.v2.File.FileOperation.OperationType").enummodule - end - end - end -end diff --git a/owl-bot-staging/google-cloud-security_center-v2/lib/google/cloud/securitycenter/v2/finding_pb.rb b/owl-bot-staging/google-cloud-security_center-v2/lib/google/cloud/securitycenter/v2/finding_pb.rb deleted file mode 100644 index 5f7b5a2bbdb2..000000000000 --- a/owl-bot-staging/google-cloud-security_center-v2/lib/google/cloud/securitycenter/v2/finding_pb.rb +++ /dev/null @@ -1,74 +0,0 @@ -# frozen_string_literal: true -# Generated by the protocol buffer compiler. DO NOT EDIT! -# source: google/cloud/securitycenter/v2/finding.proto - -require 'google/protobuf' - -require 'google/api/field_behavior_pb' -require 'google/api/resource_pb' -require 'google/cloud/securitycenter/v2/access_pb' -require 'google/cloud/securitycenter/v2/affected_resources_pb' -require 'google/cloud/securitycenter/v2/ai_model_pb' -require 'google/cloud/securitycenter/v2/application_pb' -require 'google/cloud/securitycenter/v2/attack_exposure_pb' -require 'google/cloud/securitycenter/v2/backup_disaster_recovery_pb' -require 'google/cloud/securitycenter/v2/chokepoint_pb' -require 'google/cloud/securitycenter/v2/cloud_armor_pb' -require 'google/cloud/securitycenter/v2/cloud_dlp_data_profile_pb' -require 'google/cloud/securitycenter/v2/cloud_dlp_inspection_pb' -require 'google/cloud/securitycenter/v2/compliance_pb' -require 'google/cloud/securitycenter/v2/connection_pb' -require 'google/cloud/securitycenter/v2/contact_details_pb' -require 'google/cloud/securitycenter/v2/container_pb' -require 'google/cloud/securitycenter/v2/data_access_event_pb' -require 'google/cloud/securitycenter/v2/data_flow_event_pb' -require 'google/cloud/securitycenter/v2/data_retention_deletion_event_pb' -require 'google/cloud/securitycenter/v2/database_pb' -require 'google/cloud/securitycenter/v2/disk_pb' -require 'google/cloud/securitycenter/v2/exfiltration_pb' -require 'google/cloud/securitycenter/v2/external_system_pb' -require 'google/cloud/securitycenter/v2/file_pb' -require 'google/cloud/securitycenter/v2/group_membership_pb' -require 'google/cloud/securitycenter/v2/iam_binding_pb' -require 'google/cloud/securitycenter/v2/indicator_pb' -require 'google/cloud/securitycenter/v2/ip_rules_pb' -require 'google/cloud/securitycenter/v2/job_pb' -require 'google/cloud/securitycenter/v2/kernel_rootkit_pb' -require 'google/cloud/securitycenter/v2/kubernetes_pb' -require 'google/cloud/securitycenter/v2/load_balancer_pb' -require 'google/cloud/securitycenter/v2/log_entry_pb' -require 'google/cloud/securitycenter/v2/mitre_attack_pb' -require 'google/cloud/securitycenter/v2/network_pb' -require 'google/cloud/securitycenter/v2/notebook_pb' -require 'google/cloud/securitycenter/v2/org_policy_pb' -require 'google/cloud/securitycenter/v2/process_pb' -require 'google/cloud/securitycenter/v2/security_marks_pb' -require 'google/cloud/securitycenter/v2/security_posture_pb' -require 'google/cloud/securitycenter/v2/toxic_combination_pb' -require 'google/cloud/securitycenter/v2/vertex_ai_pb' -require 'google/cloud/securitycenter/v2/vulnerability_pb' -require 'google/protobuf/struct_pb' -require 'google/protobuf/timestamp_pb' - - -descriptor_data = "\n,google/cloud/securitycenter/v2/finding.proto\x12\x1egoogle.cloud.securitycenter.v2\x1a\x1fgoogle/api/field_behavior.proto\x1a\x19google/api/resource.proto\x1a+google/cloud/securitycenter/v2/access.proto\x1a\x37google/cloud/securitycenter/v2/affected_resources.proto\x1a-google/cloud/securitycenter/v2/ai_model.proto\x1a\x30google/cloud/securitycenter/v2/application.proto\x1a\x34google/cloud/securitycenter/v2/attack_exposure.proto\x1a=google/cloud/securitycenter/v2/backup_disaster_recovery.proto\x1a/google/cloud/securitycenter/v2/chokepoint.proto\x1a\x30google/cloud/securitycenter/v2/cloud_armor.proto\x1a;google/cloud/securitycenter/v2/cloud_dlp_data_profile.proto\x1a\x39google/cloud/securitycenter/v2/cloud_dlp_inspection.proto\x1a/google/cloud/securitycenter/v2/compliance.proto\x1a/google/cloud/securitycenter/v2/connection.proto\x1a\x34google/cloud/securitycenter/v2/contact_details.proto\x1a.google/cloud/securitycenter/v2/container.proto\x1a\x36google/cloud/securitycenter/v2/data_access_event.proto\x1a\x34google/cloud/securitycenter/v2/data_flow_event.proto\x1a\x42google/cloud/securitycenter/v2/data_retention_deletion_event.proto\x1a-google/cloud/securitycenter/v2/database.proto\x1a)google/cloud/securitycenter/v2/disk.proto\x1a\x31google/cloud/securitycenter/v2/exfiltration.proto\x1a\x34google/cloud/securitycenter/v2/external_system.proto\x1a)google/cloud/securitycenter/v2/file.proto\x1a\x35google/cloud/securitycenter/v2/group_membership.proto\x1a\x30google/cloud/securitycenter/v2/iam_binding.proto\x1a.google/cloud/securitycenter/v2/indicator.proto\x1a-google/cloud/securitycenter/v2/ip_rules.proto\x1a(google/cloud/securitycenter/v2/job.proto\x1a\x33google/cloud/securitycenter/v2/kernel_rootkit.proto\x1a/google/cloud/securitycenter/v2/kubernetes.proto\x1a\x32google/cloud/securitycenter/v2/load_balancer.proto\x1a.google/cloud/securitycenter/v2/log_entry.proto\x1a\x31google/cloud/securitycenter/v2/mitre_attack.proto\x1a,google/cloud/securitycenter/v2/network.proto\x1a-google/cloud/securitycenter/v2/notebook.proto\x1a/google/cloud/securitycenter/v2/org_policy.proto\x1a,google/cloud/securitycenter/v2/process.proto\x1a\x33google/cloud/securitycenter/v2/security_marks.proto\x1a\x35google/cloud/securitycenter/v2/security_posture.proto\x1a\x36google/cloud/securitycenter/v2/toxic_combination.proto\x1a.google/cloud/securitycenter/v2/vertex_ai.proto\x1a\x32google/cloud/securitycenter/v2/vulnerability.proto\x1a\x1cgoogle/protobuf/struct.proto\x1a\x1fgoogle/protobuf/timestamp.proto\"\x9e)\n\x07\x46inding\x12\x11\n\x04name\x18\x01 \x01(\tB\x03\xe0\x41\x08\x12\x1b\n\x0e\x63\x61nonical_name\x18\x02 \x01(\tB\x03\xe0\x41\x03\x12\x0e\n\x06parent\x18\x03 \x01(\t\x12\x1a\n\rresource_name\x18\x04 \x01(\tB\x03\xe0\x41\x05\x12\x41\n\x05state\x18\x06 \x01(\x0e\x32-.google.cloud.securitycenter.v2.Finding.StateB\x03\xe0\x41\x03\x12\x15\n\x08\x63\x61tegory\x18\x07 \x01(\tB\x03\xe0\x41\x05\x12\x14\n\x0c\x65xternal_uri\x18\x08 \x01(\t\x12X\n\x11source_properties\x18\t \x03(\x0b\x32=.google.cloud.securitycenter.v2.Finding.SourcePropertiesEntry\x12J\n\x0esecurity_marks\x18\n \x01(\x0b\x32-.google.cloud.securitycenter.v2.SecurityMarksB\x03\xe0\x41\x03\x12.\n\nevent_time\x18\x0b \x01(\x0b\x32\x1a.google.protobuf.Timestamp\x12\x34\n\x0b\x63reate_time\x18\x0c \x01(\x0b\x32\x1a.google.protobuf.TimestampB\x03\xe0\x41\x03\x12\x42\n\x08severity\x18\x0e \x01(\x0e\x32\x30.google.cloud.securitycenter.v2.Finding.Severity\x12:\n\x04mute\x18\x0f \x01(\x0e\x32,.google.cloud.securitycenter.v2.Finding.Mute\x12H\n\tmute_info\x18\x35 \x01(\x0b\x32\x30.google.cloud.securitycenter.v2.Finding.MuteInfoB\x03\xe0\x41\x03\x12K\n\rfinding_class\x18\x10 \x01(\x0e\x32\x34.google.cloud.securitycenter.v2.Finding.FindingClass\x12<\n\tindicator\x18\x11 \x01(\x0b\x32).google.cloud.securitycenter.v2.Indicator\x12\x44\n\rvulnerability\x18\x12 \x01(\x0b\x32-.google.cloud.securitycenter.v2.Vulnerability\x12\x39\n\x10mute_update_time\x18\x13 \x01(\x0b\x32\x1a.google.protobuf.TimestampB\x03\xe0\x41\x03\x12[\n\x10\x65xternal_systems\x18\x14 \x03(\x0b\x32<.google.cloud.securitycenter.v2.Finding.ExternalSystemsEntryB\x03\xe0\x41\x03\x12\x41\n\x0cmitre_attack\x18\x15 \x01(\x0b\x32+.google.cloud.securitycenter.v2.MitreAttack\x12\x36\n\x06\x61\x63\x63\x65ss\x18\x16 \x01(\x0b\x32&.google.cloud.securitycenter.v2.Access\x12?\n\x0b\x63onnections\x18\x17 \x03(\x0b\x32*.google.cloud.securitycenter.v2.Connection\x12\x16\n\x0emute_initiator\x18\x18 \x01(\t\x12:\n\tprocesses\x18\x19 \x03(\x0b\x32\'.google.cloud.securitycenter.v2.Process\x12L\n\x08\x63ontacts\x18\x1a \x03(\x0b\x32\x35.google.cloud.securitycenter.v2.Finding.ContactsEntryB\x03\xe0\x41\x03\x12?\n\x0b\x63ompliances\x18\x1b \x03(\x0b\x32*.google.cloud.securitycenter.v2.Compliance\x12 \n\x13parent_display_name\x18\x1d \x01(\tB\x03\xe0\x41\x03\x12\x13\n\x0b\x64\x65scription\x18\x1e \x01(\t\x12\x42\n\x0c\x65xfiltration\x18\x1f \x01(\x0b\x32,.google.cloud.securitycenter.v2.Exfiltration\x12@\n\x0ciam_bindings\x18 \x03(\x0b\x32*.google.cloud.securitycenter.v2.IamBinding\x12\x12\n\nnext_steps\x18! \x01(\t\x12\x13\n\x0bmodule_name\x18\" \x01(\t\x12=\n\ncontainers\x18# \x03(\x0b\x32).google.cloud.securitycenter.v2.Container\x12>\n\nkubernetes\x18$ \x01(\x0b\x32*.google.cloud.securitycenter.v2.Kubernetes\x12:\n\x08\x64\x61tabase\x18% \x01(\x0b\x32(.google.cloud.securitycenter.v2.Database\x12G\n\x0f\x61ttack_exposure\x18& \x01(\x0b\x32..google.cloud.securitycenter.v2.AttackExposure\x12\x33\n\x05\x66iles\x18\' \x03(\x0b\x32$.google.cloud.securitycenter.v2.File\x12P\n\x14\x63loud_dlp_inspection\x18( \x01(\x0b\x32\x32.google.cloud.securitycenter.v2.CloudDlpInspection\x12S\n\x16\x63loud_dlp_data_profile\x18) \x01(\x0b\x32\x33.google.cloud.securitycenter.v2.CloudDlpDataProfile\x12\x45\n\x0ekernel_rootkit\x18* \x01(\x0b\x32-.google.cloud.securitycenter.v2.KernelRootkit\x12?\n\x0corg_policies\x18+ \x03(\x0b\x32).google.cloud.securitycenter.v2.OrgPolicy\x12\x30\n\x03job\x18, \x01(\x0b\x32#.google.cloud.securitycenter.v2.Job\x12@\n\x0b\x61pplication\x18- \x01(\x0b\x32+.google.cloud.securitycenter.v2.Application\x12\x39\n\x08ip_rules\x18. \x01(\x0b\x32\'.google.cloud.securitycenter.v2.IpRules\x12X\n\x18\x62\x61\x63kup_disaster_recovery\x18/ \x01(\x0b\x32\x36.google.cloud.securitycenter.v2.BackupDisasterRecovery\x12I\n\x10security_posture\x18\x30 \x01(\x0b\x32/.google.cloud.securitycenter.v2.SecurityPosture\x12=\n\x0blog_entries\x18\x31 \x03(\x0b\x32(.google.cloud.securitycenter.v2.LogEntry\x12\x44\n\x0eload_balancers\x18\x32 \x03(\x0b\x32,.google.cloud.securitycenter.v2.LoadBalancer\x12?\n\x0b\x63loud_armor\x18\x33 \x01(\x0b\x32*.google.cloud.securitycenter.v2.CloudArmor\x12:\n\x08notebook\x18\x37 \x01(\x0b\x32(.google.cloud.securitycenter.v2.Notebook\x12K\n\x11toxic_combination\x18\x38 \x01(\x0b\x32\x30.google.cloud.securitycenter.v2.ToxicCombination\x12J\n\x11group_memberships\x18\x39 \x03(\x0b\x32/.google.cloud.securitycenter.v2.GroupMembership\x12\x32\n\x04\x64isk\x18: \x01(\x0b\x32$.google.cloud.securitycenter.v2.Disk\x12K\n\x12\x64\x61ta_access_events\x18= \x03(\x0b\x32/.google.cloud.securitycenter.v2.DataAccessEvent\x12G\n\x10\x64\x61ta_flow_events\x18> \x03(\x0b\x32-.google.cloud.securitycenter.v2.DataFlowEvent\x12\x39\n\x08networks\x18? \x03(\x0b\x32\'.google.cloud.securitycenter.v2.Network\x12\x62\n\x1e\x64\x61ta_retention_deletion_events\x18@ \x03(\x0b\x32:.google.cloud.securitycenter.v2.DataRetentionDeletionEvent\x12M\n\x12\x61\x66\x66\x65\x63ted_resources\x18\x41 \x01(\x0b\x32\x31.google.cloud.securitycenter.v2.AffectedResources\x12\x39\n\x08\x61i_model\x18\x42 \x01(\x0b\x32\'.google.cloud.securitycenter.v2.AiModel\x12>\n\nchokepoint\x18\x45 \x01(\x0b\x32*.google.cloud.securitycenter.v2.Chokepoint\x12;\n\tvertex_ai\x18H \x01(\x0b\x32(.google.cloud.securitycenter.v2.VertexAi\x1a\x93\x03\n\x08MuteInfo\x12P\n\x0bstatic_mute\x18\x01 \x01(\x0b\x32;.google.cloud.securitycenter.v2.Finding.MuteInfo.StaticMute\x12`\n\x14\x64ynamic_mute_records\x18\x02 \x03(\x0b\x32\x42.google.cloud.securitycenter.v2.Finding.MuteInfo.DynamicMuteRecord\x1ay\n\nStaticMute\x12;\n\x05state\x18\x01 \x01(\x0e\x32,.google.cloud.securitycenter.v2.Finding.Mute\x12.\n\napply_time\x18\x02 \x01(\x0b\x32\x1a.google.protobuf.Timestamp\x1aX\n\x11\x44ynamicMuteRecord\x12\x13\n\x0bmute_config\x18\x01 \x01(\t\x12.\n\nmatch_time\x18\x02 \x01(\x0b\x32\x1a.google.protobuf.Timestamp\x1aO\n\x15SourcePropertiesEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12%\n\x05value\x18\x02 \x01(\x0b\x32\x16.google.protobuf.Value:\x02\x38\x01\x1a\x66\n\x14\x45xternalSystemsEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12=\n\x05value\x18\x02 \x01(\x0b\x32..google.cloud.securitycenter.v2.ExternalSystem:\x02\x38\x01\x1a_\n\rContactsEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12=\n\x05value\x18\x02 \x01(\x0b\x32..google.cloud.securitycenter.v2.ContactDetails:\x02\x38\x01\"8\n\x05State\x12\x15\n\x11STATE_UNSPECIFIED\x10\x00\x12\n\n\x06\x41\x43TIVE\x10\x01\x12\x0c\n\x08INACTIVE\x10\x02\"Q\n\x08Severity\x12\x18\n\x14SEVERITY_UNSPECIFIED\x10\x00\x12\x0c\n\x08\x43RITICAL\x10\x01\x12\x08\n\x04HIGH\x10\x02\x12\n\n\x06MEDIUM\x10\x03\x12\x07\n\x03LOW\x10\x04\"C\n\x04Mute\x12\x14\n\x10MUTE_UNSPECIFIED\x10\x00\x12\t\n\x05MUTED\x10\x01\x12\x0b\n\x07UNMUTED\x10\x02\x12\r\n\tUNDEFINED\x10\x03\"\xd9\x01\n\x0c\x46indingClass\x12\x1d\n\x19\x46INDING_CLASS_UNSPECIFIED\x10\x00\x12\n\n\x06THREAT\x10\x01\x12\x11\n\rVULNERABILITY\x10\x02\x12\x14\n\x10MISCONFIGURATION\x10\x03\x12\x0f\n\x0bOBSERVATION\x10\x04\x12\r\n\tSCC_ERROR\x10\x05\x12\x15\n\x11POSTURE_VIOLATION\x10\x06\x12\x15\n\x11TOXIC_COMBINATION\x10\x07\x12\x17\n\x13SENSITIVE_DATA_RISK\x10\x08\x12\x0e\n\nCHOKEPOINT\x10\t:\xdd\x03\xea\x41\xd9\x03\n%securitycenter.googleapis.com/Finding\x12@organizations/{organization}/sources/{source}/findings/{finding}\x12Uorganizations/{organization}/sources/{source}/locations/{location}/findings/{finding}\x12\x34\x66olders/{folder}/sources/{source}/findings/{finding}\x12Ifolders/{folder}/sources/{source}/locations/{location}/findings/{finding}\x12\x36projects/{project}/sources/{source}/findings/{finding}\x12Kprojects/{project}/sources/{source}/locations/{location}/findings/{finding}*\x08\x66indings2\x07\x66indingB\xe6\x01\n\"com.google.cloud.securitycenter.v2B\x0c\x46indingProtoP\x01ZJcloud.google.com/go/securitycenter/apiv2/securitycenterpb;securitycenterpb\xaa\x02\x1eGoogle.Cloud.SecurityCenter.V2\xca\x02\x1eGoogle\\Cloud\\SecurityCenter\\V2\xea\x02!Google::Cloud::SecurityCenter::V2b\x06proto3" - -pool = ::Google::Protobuf::DescriptorPool.generated_pool -pool.add_serialized_file(descriptor_data) - -module Google - module Cloud - module SecurityCenter - module V2 - Finding = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.securitycenter.v2.Finding").msgclass - Finding::MuteInfo = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.securitycenter.v2.Finding.MuteInfo").msgclass - Finding::MuteInfo::StaticMute = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.securitycenter.v2.Finding.MuteInfo.StaticMute").msgclass - Finding::MuteInfo::DynamicMuteRecord = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.securitycenter.v2.Finding.MuteInfo.DynamicMuteRecord").msgclass - Finding::State = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.securitycenter.v2.Finding.State").enummodule - Finding::Severity = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.securitycenter.v2.Finding.Severity").enummodule - Finding::Mute = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.securitycenter.v2.Finding.Mute").enummodule - Finding::FindingClass = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.securitycenter.v2.Finding.FindingClass").enummodule - end - end - end -end diff --git a/owl-bot-staging/google-cloud-security_center-v2/lib/google/cloud/securitycenter/v2/folder_pb.rb b/owl-bot-staging/google-cloud-security_center-v2/lib/google/cloud/securitycenter/v2/folder_pb.rb deleted file mode 100644 index fe84677148ee..000000000000 --- a/owl-bot-staging/google-cloud-security_center-v2/lib/google/cloud/securitycenter/v2/folder_pb.rb +++ /dev/null @@ -1,21 +0,0 @@ -# frozen_string_literal: true -# Generated by the protocol buffer compiler. DO NOT EDIT! -# source: google/cloud/securitycenter/v2/folder.proto - -require 'google/protobuf' - - -descriptor_data = "\n+google/cloud/securitycenter/v2/folder.proto\x12\x1egoogle.cloud.securitycenter.v2\"G\n\x06\x46older\x12\x17\n\x0fresource_folder\x18\x01 \x01(\t\x12$\n\x1cresource_folder_display_name\x18\x02 \x01(\tB\xe5\x01\n\"com.google.cloud.securitycenter.v2B\x0b\x46olderProtoP\x01ZJcloud.google.com/go/securitycenter/apiv2/securitycenterpb;securitycenterpb\xaa\x02\x1eGoogle.Cloud.SecurityCenter.V2\xca\x02\x1eGoogle\\Cloud\\SecurityCenter\\V2\xea\x02!Google::Cloud::SecurityCenter::V2b\x06proto3" - -pool = ::Google::Protobuf::DescriptorPool.generated_pool -pool.add_serialized_file(descriptor_data) - -module Google - module Cloud - module SecurityCenter - module V2 - Folder = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.securitycenter.v2.Folder").msgclass - end - end - end -end diff --git a/owl-bot-staging/google-cloud-security_center-v2/lib/google/cloud/securitycenter/v2/group_membership_pb.rb b/owl-bot-staging/google-cloud-security_center-v2/lib/google/cloud/securitycenter/v2/group_membership_pb.rb deleted file mode 100644 index 9f419b9c2065..000000000000 --- a/owl-bot-staging/google-cloud-security_center-v2/lib/google/cloud/securitycenter/v2/group_membership_pb.rb +++ /dev/null @@ -1,22 +0,0 @@ -# frozen_string_literal: true -# Generated by the protocol buffer compiler. DO NOT EDIT! -# source: google/cloud/securitycenter/v2/group_membership.proto - -require 'google/protobuf' - - -descriptor_data = "\n5google/cloud/securitycenter/v2/group_membership.proto\x12\x1egoogle.cloud.securitycenter.v2\"\xd8\x01\n\x0fGroupMembership\x12M\n\ngroup_type\x18\x01 \x01(\x0e\x32\x39.google.cloud.securitycenter.v2.GroupMembership.GroupType\x12\x10\n\x08group_id\x18\x02 \x01(\t\"d\n\tGroupType\x12\x1a\n\x16GROUP_TYPE_UNSPECIFIED\x10\x00\x12 \n\x1cGROUP_TYPE_TOXIC_COMBINATION\x10\x01\x12\x19\n\x15GROUP_TYPE_CHOKEPOINT\x10\x03\x42\xee\x01\n\"com.google.cloud.securitycenter.v2B\x14GroupMembershipProtoP\x01ZJcloud.google.com/go/securitycenter/apiv2/securitycenterpb;securitycenterpb\xaa\x02\x1eGoogle.Cloud.SecurityCenter.V2\xca\x02\x1eGoogle\\Cloud\\SecurityCenter\\V2\xea\x02!Google::Cloud::SecurityCenter::V2b\x06proto3" - -pool = ::Google::Protobuf::DescriptorPool.generated_pool -pool.add_serialized_file(descriptor_data) - -module Google - module Cloud - module SecurityCenter - module V2 - GroupMembership = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.securitycenter.v2.GroupMembership").msgclass - GroupMembership::GroupType = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.securitycenter.v2.GroupMembership.GroupType").enummodule - end - end - end -end diff --git a/owl-bot-staging/google-cloud-security_center-v2/lib/google/cloud/securitycenter/v2/iam_binding_pb.rb b/owl-bot-staging/google-cloud-security_center-v2/lib/google/cloud/securitycenter/v2/iam_binding_pb.rb deleted file mode 100644 index 16a3bb17f83a..000000000000 --- a/owl-bot-staging/google-cloud-security_center-v2/lib/google/cloud/securitycenter/v2/iam_binding_pb.rb +++ /dev/null @@ -1,22 +0,0 @@ -# frozen_string_literal: true -# Generated by the protocol buffer compiler. DO NOT EDIT! -# source: google/cloud/securitycenter/v2/iam_binding.proto - -require 'google/protobuf' - - -descriptor_data = "\n0google/cloud/securitycenter/v2/iam_binding.proto\x12\x1egoogle.cloud.securitycenter.v2\"\xa4\x01\n\nIamBinding\x12\x41\n\x06\x61\x63tion\x18\x01 \x01(\x0e\x32\x31.google.cloud.securitycenter.v2.IamBinding.Action\x12\x0c\n\x04role\x18\x02 \x01(\t\x12\x0e\n\x06member\x18\x03 \x01(\t\"5\n\x06\x41\x63tion\x12\x16\n\x12\x41\x43TION_UNSPECIFIED\x10\x00\x12\x07\n\x03\x41\x44\x44\x10\x01\x12\n\n\x06REMOVE\x10\x02\x42\xe9\x01\n\"com.google.cloud.securitycenter.v2B\x0fIamBindingProtoP\x01ZJcloud.google.com/go/securitycenter/apiv2/securitycenterpb;securitycenterpb\xaa\x02\x1eGoogle.Cloud.SecurityCenter.V2\xca\x02\x1eGoogle\\Cloud\\SecurityCenter\\V2\xea\x02!Google::Cloud::SecurityCenter::V2b\x06proto3" - -pool = ::Google::Protobuf::DescriptorPool.generated_pool -pool.add_serialized_file(descriptor_data) - -module Google - module Cloud - module SecurityCenter - module V2 - IamBinding = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.securitycenter.v2.IamBinding").msgclass - IamBinding::Action = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.securitycenter.v2.IamBinding.Action").enummodule - end - end - end -end diff --git a/owl-bot-staging/google-cloud-security_center-v2/lib/google/cloud/securitycenter/v2/indicator_pb.rb b/owl-bot-staging/google-cloud-security_center-v2/lib/google/cloud/securitycenter/v2/indicator_pb.rb deleted file mode 100644 index ed506ac1a11d..000000000000 --- a/owl-bot-staging/google-cloud-security_center-v2/lib/google/cloud/securitycenter/v2/indicator_pb.rb +++ /dev/null @@ -1,26 +0,0 @@ -# frozen_string_literal: true -# Generated by the protocol buffer compiler. DO NOT EDIT! -# source: google/cloud/securitycenter/v2/indicator.proto - -require 'google/protobuf' - - -descriptor_data = "\n.google/cloud/securitycenter/v2/indicator.proto\x12\x1egoogle.cloud.securitycenter.v2\"\xd9\x06\n\tIndicator\x12\x14\n\x0cip_addresses\x18\x01 \x03(\t\x12\x0f\n\x07\x64omains\x18\x02 \x03(\t\x12N\n\nsignatures\x18\x03 \x03(\x0b\x32:.google.cloud.securitycenter.v2.Indicator.ProcessSignature\x12\x0c\n\x04uris\x18\x04 \x03(\t\x1a\xc6\x05\n\x10ProcessSignature\x12o\n\x15memory_hash_signature\x18\x06 \x01(\x0b\x32N.google.cloud.securitycenter.v2.Indicator.ProcessSignature.MemoryHashSignatureH\x00\x12k\n\x13yara_rule_signature\x18\x07 \x01(\x0b\x32L.google.cloud.securitycenter.v2.Indicator.ProcessSignature.YaraRuleSignatureH\x00\x12`\n\x0esignature_type\x18\x08 \x01(\x0e\x32H.google.cloud.securitycenter.v2.Indicator.ProcessSignature.SignatureType\x1a\xd6\x01\n\x13MemoryHashSignature\x12\x15\n\rbinary_family\x18\x01 \x01(\t\x12l\n\ndetections\x18\x04 \x03(\x0b\x32X.google.cloud.securitycenter.v2.Indicator.ProcessSignature.MemoryHashSignature.Detection\x1a:\n\tDetection\x12\x0e\n\x06\x62inary\x18\x02 \x01(\t\x12\x1d\n\x15percent_pages_matched\x18\x03 \x01(\x01\x1a&\n\x11YaraRuleSignature\x12\x11\n\tyara_rule\x18\x05 \x01(\t\"d\n\rSignatureType\x12\x1e\n\x1aSIGNATURE_TYPE_UNSPECIFIED\x10\x00\x12\x1a\n\x16SIGNATURE_TYPE_PROCESS\x10\x01\x12\x17\n\x13SIGNATURE_TYPE_FILE\x10\x02\x42\x0b\n\tsignatureB\xe8\x01\n\"com.google.cloud.securitycenter.v2B\x0eIndicatorProtoP\x01ZJcloud.google.com/go/securitycenter/apiv2/securitycenterpb;securitycenterpb\xaa\x02\x1eGoogle.Cloud.SecurityCenter.V2\xca\x02\x1eGoogle\\Cloud\\SecurityCenter\\V2\xea\x02!Google::Cloud::SecurityCenter::V2b\x06proto3" - -pool = ::Google::Protobuf::DescriptorPool.generated_pool -pool.add_serialized_file(descriptor_data) - -module Google - module Cloud - module SecurityCenter - module V2 - Indicator = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.securitycenter.v2.Indicator").msgclass - Indicator::ProcessSignature = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.securitycenter.v2.Indicator.ProcessSignature").msgclass - Indicator::ProcessSignature::MemoryHashSignature = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.securitycenter.v2.Indicator.ProcessSignature.MemoryHashSignature").msgclass - Indicator::ProcessSignature::MemoryHashSignature::Detection = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.securitycenter.v2.Indicator.ProcessSignature.MemoryHashSignature.Detection").msgclass - Indicator::ProcessSignature::YaraRuleSignature = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.securitycenter.v2.Indicator.ProcessSignature.YaraRuleSignature").msgclass - Indicator::ProcessSignature::SignatureType = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.securitycenter.v2.Indicator.ProcessSignature.SignatureType").enummodule - end - end - end -end diff --git a/owl-bot-staging/google-cloud-security_center-v2/lib/google/cloud/securitycenter/v2/ip_rules_pb.rb b/owl-bot-staging/google-cloud-security_center-v2/lib/google/cloud/securitycenter/v2/ip_rules_pb.rb deleted file mode 100644 index b6597fce0c8c..000000000000 --- a/owl-bot-staging/google-cloud-security_center-v2/lib/google/cloud/securitycenter/v2/ip_rules_pb.rb +++ /dev/null @@ -1,28 +0,0 @@ -# frozen_string_literal: true -# Generated by the protocol buffer compiler. DO NOT EDIT! -# source: google/cloud/securitycenter/v2/ip_rules.proto - -require 'google/protobuf' - -require 'google/api/field_behavior_pb' - - -descriptor_data = "\n-google/cloud/securitycenter/v2/ip_rules.proto\x12\x1egoogle.cloud.securitycenter.v2\x1a\x1fgoogle/api/field_behavior.proto\"\xe2\x02\n\x07IpRules\x12\x44\n\tdirection\x18\x01 \x01(\x0e\x32\x31.google.cloud.securitycenter.v2.IpRules.Direction\x12:\n\x07\x61llowed\x18\x02 \x01(\x0b\x32\'.google.cloud.securitycenter.v2.AllowedH\x00\x12\x38\n\x06\x64\x65nied\x18\x03 \x01(\x0b\x32&.google.cloud.securitycenter.v2.DeniedH\x00\x12\x18\n\x10source_ip_ranges\x18\x04 \x03(\t\x12\x1d\n\x15\x64\x65stination_ip_ranges\x18\x05 \x03(\t\x12\x18\n\x10\x65xposed_services\x18\x06 \x03(\t\"?\n\tDirection\x12\x19\n\x15\x44IRECTION_UNSPECIFIED\x10\x00\x12\x0b\n\x07INGRESS\x10\x01\x12\n\n\x06\x45GRESS\x10\x02\x42\x07\n\x05rules\"\x8d\x01\n\x06IpRule\x12\x10\n\x08protocol\x18\x01 \x01(\t\x12J\n\x0bport_ranges\x18\x02 \x03(\x0b\x32\x30.google.cloud.securitycenter.v2.IpRule.PortRangeB\x03\xe0\x41\x01\x1a%\n\tPortRange\x12\x0b\n\x03min\x18\x01 \x01(\x03\x12\x0b\n\x03max\x18\x02 \x01(\x03\"H\n\x07\x41llowed\x12=\n\x08ip_rules\x18\x01 \x03(\x0b\x32&.google.cloud.securitycenter.v2.IpRuleB\x03\xe0\x41\x01\"G\n\x06\x44\x65nied\x12=\n\x08ip_rules\x18\x01 \x03(\x0b\x32&.google.cloud.securitycenter.v2.IpRuleB\x03\xe0\x41\x01\x42\xe6\x01\n\"com.google.cloud.securitycenter.v2B\x0cIpRulesProtoP\x01ZJcloud.google.com/go/securitycenter/apiv2/securitycenterpb;securitycenterpb\xaa\x02\x1eGoogle.Cloud.SecurityCenter.V2\xca\x02\x1eGoogle\\Cloud\\SecurityCenter\\V2\xea\x02!Google::Cloud::SecurityCenter::V2b\x06proto3" - -pool = ::Google::Protobuf::DescriptorPool.generated_pool -pool.add_serialized_file(descriptor_data) - -module Google - module Cloud - module SecurityCenter - module V2 - IpRules = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.securitycenter.v2.IpRules").msgclass - IpRules::Direction = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.securitycenter.v2.IpRules.Direction").enummodule - IpRule = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.securitycenter.v2.IpRule").msgclass - IpRule::PortRange = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.securitycenter.v2.IpRule.PortRange").msgclass - Allowed = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.securitycenter.v2.Allowed").msgclass - Denied = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.securitycenter.v2.Denied").msgclass - end - end - end -end diff --git a/owl-bot-staging/google-cloud-security_center-v2/lib/google/cloud/securitycenter/v2/job_pb.rb b/owl-bot-staging/google-cloud-security_center-v2/lib/google/cloud/securitycenter/v2/job_pb.rb deleted file mode 100644 index c079059f9826..000000000000 --- a/owl-bot-staging/google-cloud-security_center-v2/lib/google/cloud/securitycenter/v2/job_pb.rb +++ /dev/null @@ -1,24 +0,0 @@ -# frozen_string_literal: true -# Generated by the protocol buffer compiler. DO NOT EDIT! -# source: google/cloud/securitycenter/v2/job.proto - -require 'google/protobuf' - -require 'google/api/field_behavior_pb' - - -descriptor_data = "\n(google/cloud/securitycenter/v2/job.proto\x12\x1egoogle.cloud.securitycenter.v2\x1a\x1fgoogle/api/field_behavior.proto\"w\n\x03Job\x12\x0c\n\x04name\x18\x01 \x01(\t\x12<\n\x05state\x18\x02 \x01(\x0e\x32(.google.cloud.securitycenter.v2.JobStateB\x03\xe0\x41\x03\x12\x12\n\nerror_code\x18\x03 \x01(\x05\x12\x10\n\x08location\x18\x04 \x01(\t*Z\n\x08JobState\x12\x19\n\x15JOB_STATE_UNSPECIFIED\x10\x00\x12\x0b\n\x07PENDING\x10\x01\x12\x0b\n\x07RUNNING\x10\x02\x12\r\n\tSUCCEEDED\x10\x03\x12\n\n\x06\x46\x41ILED\x10\x04\x42\xe2\x01\n\"com.google.cloud.securitycenter.v2B\x08JobProtoP\x01ZJcloud.google.com/go/securitycenter/apiv2/securitycenterpb;securitycenterpb\xaa\x02\x1eGoogle.Cloud.SecurityCenter.V2\xca\x02\x1eGoogle\\Cloud\\SecurityCenter\\V2\xea\x02!Google::Cloud::SecurityCenter::V2b\x06proto3" - -pool = ::Google::Protobuf::DescriptorPool.generated_pool -pool.add_serialized_file(descriptor_data) - -module Google - module Cloud - module SecurityCenter - module V2 - Job = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.securitycenter.v2.Job").msgclass - JobState = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.securitycenter.v2.JobState").enummodule - end - end - end -end diff --git a/owl-bot-staging/google-cloud-security_center-v2/lib/google/cloud/securitycenter/v2/kernel_rootkit_pb.rb b/owl-bot-staging/google-cloud-security_center-v2/lib/google/cloud/securitycenter/v2/kernel_rootkit_pb.rb deleted file mode 100644 index eba594bf469d..000000000000 --- a/owl-bot-staging/google-cloud-security_center-v2/lib/google/cloud/securitycenter/v2/kernel_rootkit_pb.rb +++ /dev/null @@ -1,21 +0,0 @@ -# frozen_string_literal: true -# Generated by the protocol buffer compiler. DO NOT EDIT! -# source: google/cloud/securitycenter/v2/kernel_rootkit.proto - -require 'google/protobuf' - - -descriptor_data = "\n3google/cloud/securitycenter/v2/kernel_rootkit.proto\x12\x1egoogle.cloud.securitycenter.v2\"\xd7\x02\n\rKernelRootkit\x12\x0c\n\x04name\x18\x01 \x01(\t\x12$\n\x1cunexpected_code_modification\x18\x02 \x01(\x08\x12.\n&unexpected_read_only_data_modification\x18\x03 \x01(\x08\x12!\n\x19unexpected_ftrace_handler\x18\x04 \x01(\x08\x12!\n\x19unexpected_kprobe_handler\x18\x05 \x01(\x08\x12$\n\x1cunexpected_kernel_code_pages\x18\x06 \x01(\x08\x12&\n\x1eunexpected_system_call_handler\x18\x07 \x01(\x08\x12$\n\x1cunexpected_interrupt_handler\x18\x08 \x01(\x08\x12(\n unexpected_processes_in_runqueue\x18\t \x01(\x08\x42\xec\x01\n\"com.google.cloud.securitycenter.v2B\x12KernelRootkitProtoP\x01ZJcloud.google.com/go/securitycenter/apiv2/securitycenterpb;securitycenterpb\xaa\x02\x1eGoogle.Cloud.SecurityCenter.V2\xca\x02\x1eGoogle\\Cloud\\SecurityCenter\\V2\xea\x02!Google::Cloud::SecurityCenter::V2b\x06proto3" - -pool = ::Google::Protobuf::DescriptorPool.generated_pool -pool.add_serialized_file(descriptor_data) - -module Google - module Cloud - module SecurityCenter - module V2 - KernelRootkit = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.securitycenter.v2.KernelRootkit").msgclass - end - end - end -end diff --git a/owl-bot-staging/google-cloud-security_center-v2/lib/google/cloud/securitycenter/v2/kubernetes_pb.rb b/owl-bot-staging/google-cloud-security_center-v2/lib/google/cloud/securitycenter/v2/kubernetes_pb.rb deleted file mode 100644 index 2f1bf77bd0f6..000000000000 --- a/owl-bot-staging/google-cloud-security_center-v2/lib/google/cloud/securitycenter/v2/kubernetes_pb.rb +++ /dev/null @@ -1,34 +0,0 @@ -# frozen_string_literal: true -# Generated by the protocol buffer compiler. DO NOT EDIT! -# source: google/cloud/securitycenter/v2/kubernetes.proto - -require 'google/protobuf' - -require 'google/cloud/securitycenter/v2/container_pb' -require 'google/cloud/securitycenter/v2/label_pb' - - -descriptor_data = "\n/google/cloud/securitycenter/v2/kubernetes.proto\x12\x1egoogle.cloud.securitycenter.v2\x1a.google/cloud/securitycenter/v2/container.proto\x1a*google/cloud/securitycenter/v2/label.proto\"\x82\x0c\n\nKubernetes\x12<\n\x04pods\x18\x01 \x03(\x0b\x32..google.cloud.securitycenter.v2.Kubernetes.Pod\x12>\n\x05nodes\x18\x02 \x03(\x0b\x32/.google.cloud.securitycenter.v2.Kubernetes.Node\x12G\n\nnode_pools\x18\x03 \x03(\x0b\x32\x33.google.cloud.securitycenter.v2.Kubernetes.NodePool\x12>\n\x05roles\x18\x04 \x03(\x0b\x32/.google.cloud.securitycenter.v2.Kubernetes.Role\x12\x44\n\x08\x62indings\x18\x05 \x03(\x0b\x32\x32.google.cloud.securitycenter.v2.Kubernetes.Binding\x12O\n\x0e\x61\x63\x63\x65ss_reviews\x18\x06 \x03(\x0b\x32\x37.google.cloud.securitycenter.v2.Kubernetes.AccessReview\x12\x42\n\x07objects\x18\x07 \x03(\x0b\x32\x31.google.cloud.securitycenter.v2.Kubernetes.Object\x1a\x95\x01\n\x03Pod\x12\n\n\x02ns\x18\x01 \x01(\t\x12\x0c\n\x04name\x18\x02 \x01(\t\x12\x35\n\x06labels\x18\x03 \x03(\x0b\x32%.google.cloud.securitycenter.v2.Label\x12=\n\ncontainers\x18\x04 \x03(\x0b\x32).google.cloud.securitycenter.v2.Container\x1a\x14\n\x04Node\x12\x0c\n\x04name\x18\x01 \x01(\t\x1aX\n\x08NodePool\x12\x0c\n\x04name\x18\x01 \x01(\t\x12>\n\x05nodes\x18\x02 \x03(\x0b\x32/.google.cloud.securitycenter.v2.Kubernetes.Node\x1a\x9e\x01\n\x04Role\x12\x42\n\x04kind\x18\x01 \x01(\x0e\x32\x34.google.cloud.securitycenter.v2.Kubernetes.Role.Kind\x12\n\n\x02ns\x18\x02 \x01(\t\x12\x0c\n\x04name\x18\x03 \x01(\t\"8\n\x04Kind\x12\x14\n\x10KIND_UNSPECIFIED\x10\x00\x12\x08\n\x04ROLE\x10\x01\x12\x10\n\x0c\x43LUSTER_ROLE\x10\x02\x1a\xa8\x01\n\x07\x42inding\x12\n\n\x02ns\x18\x01 \x01(\t\x12\x0c\n\x04name\x18\x02 \x01(\t\x12=\n\x04role\x18\x03 \x01(\x0b\x32/.google.cloud.securitycenter.v2.Kubernetes.Role\x12\x44\n\x08subjects\x18\x04 \x03(\x0b\x32\x32.google.cloud.securitycenter.v2.Kubernetes.Subject\x1a\xbe\x01\n\x07Subject\x12I\n\x04kind\x18\x01 \x01(\x0e\x32;.google.cloud.securitycenter.v2.Kubernetes.Subject.AuthType\x12\n\n\x02ns\x18\x02 \x01(\t\x12\x0c\n\x04name\x18\x03 \x01(\t\"N\n\x08\x41uthType\x12\x19\n\x15\x41UTH_TYPE_UNSPECIFIED\x10\x00\x12\x08\n\x04USER\x10\x01\x12\x12\n\x0eSERVICEACCOUNT\x10\x02\x12\t\n\x05GROUP\x10\x03\x1a}\n\x0c\x41\x63\x63\x65ssReview\x12\r\n\x05group\x18\x01 \x01(\t\x12\n\n\x02ns\x18\x02 \x01(\t\x12\x0c\n\x04name\x18\x03 \x01(\t\x12\x10\n\x08resource\x18\x04 \x01(\t\x12\x13\n\x0bsubresource\x18\x05 \x01(\t\x12\x0c\n\x04verb\x18\x06 \x01(\t\x12\x0f\n\x07version\x18\x07 \x01(\t\x1a~\n\x06Object\x12\r\n\x05group\x18\x01 \x01(\t\x12\x0c\n\x04kind\x18\x02 \x01(\t\x12\n\n\x02ns\x18\x03 \x01(\t\x12\x0c\n\x04name\x18\x04 \x01(\t\x12=\n\ncontainers\x18\x05 \x03(\x0b\x32).google.cloud.securitycenter.v2.ContainerB\xe9\x01\n\"com.google.cloud.securitycenter.v2B\x0fKubernetesProtoP\x01ZJcloud.google.com/go/securitycenter/apiv2/securitycenterpb;securitycenterpb\xaa\x02\x1eGoogle.Cloud.SecurityCenter.V2\xca\x02\x1eGoogle\\Cloud\\SecurityCenter\\V2\xea\x02!Google::Cloud::SecurityCenter::V2b\x06proto3" - -pool = ::Google::Protobuf::DescriptorPool.generated_pool -pool.add_serialized_file(descriptor_data) - -module Google - module Cloud - module SecurityCenter - module V2 - Kubernetes = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.securitycenter.v2.Kubernetes").msgclass - Kubernetes::Pod = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.securitycenter.v2.Kubernetes.Pod").msgclass - Kubernetes::Node = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.securitycenter.v2.Kubernetes.Node").msgclass - Kubernetes::NodePool = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.securitycenter.v2.Kubernetes.NodePool").msgclass - Kubernetes::Role = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.securitycenter.v2.Kubernetes.Role").msgclass - Kubernetes::Role::Kind = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.securitycenter.v2.Kubernetes.Role.Kind").enummodule - Kubernetes::Binding = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.securitycenter.v2.Kubernetes.Binding").msgclass - Kubernetes::Subject = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.securitycenter.v2.Kubernetes.Subject").msgclass - Kubernetes::Subject::AuthType = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.securitycenter.v2.Kubernetes.Subject.AuthType").enummodule - Kubernetes::AccessReview = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.securitycenter.v2.Kubernetes.AccessReview").msgclass - Kubernetes::Object = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.securitycenter.v2.Kubernetes.Object").msgclass - end - end - end -end diff --git a/owl-bot-staging/google-cloud-security_center-v2/lib/google/cloud/securitycenter/v2/label_pb.rb b/owl-bot-staging/google-cloud-security_center-v2/lib/google/cloud/securitycenter/v2/label_pb.rb deleted file mode 100644 index 3cdb278899ec..000000000000 --- a/owl-bot-staging/google-cloud-security_center-v2/lib/google/cloud/securitycenter/v2/label_pb.rb +++ /dev/null @@ -1,21 +0,0 @@ -# frozen_string_literal: true -# Generated by the protocol buffer compiler. DO NOT EDIT! -# source: google/cloud/securitycenter/v2/label.proto - -require 'google/protobuf' - - -descriptor_data = "\n*google/cloud/securitycenter/v2/label.proto\x12\x1egoogle.cloud.securitycenter.v2\"$\n\x05Label\x12\x0c\n\x04name\x18\x01 \x01(\t\x12\r\n\x05value\x18\x02 \x01(\tB\xe4\x01\n\"com.google.cloud.securitycenter.v2B\nLabelProtoP\x01ZJcloud.google.com/go/securitycenter/apiv2/securitycenterpb;securitycenterpb\xaa\x02\x1eGoogle.Cloud.SecurityCenter.V2\xca\x02\x1eGoogle\\Cloud\\SecurityCenter\\V2\xea\x02!Google::Cloud::SecurityCenter::V2b\x06proto3" - -pool = ::Google::Protobuf::DescriptorPool.generated_pool -pool.add_serialized_file(descriptor_data) - -module Google - module Cloud - module SecurityCenter - module V2 - Label = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.securitycenter.v2.Label").msgclass - end - end - end -end diff --git a/owl-bot-staging/google-cloud-security_center-v2/lib/google/cloud/securitycenter/v2/load_balancer_pb.rb b/owl-bot-staging/google-cloud-security_center-v2/lib/google/cloud/securitycenter/v2/load_balancer_pb.rb deleted file mode 100644 index b23d3a4cfd9f..000000000000 --- a/owl-bot-staging/google-cloud-security_center-v2/lib/google/cloud/securitycenter/v2/load_balancer_pb.rb +++ /dev/null @@ -1,21 +0,0 @@ -# frozen_string_literal: true -# Generated by the protocol buffer compiler. DO NOT EDIT! -# source: google/cloud/securitycenter/v2/load_balancer.proto - -require 'google/protobuf' - - -descriptor_data = "\n2google/cloud/securitycenter/v2/load_balancer.proto\x12\x1egoogle.cloud.securitycenter.v2\"\x1c\n\x0cLoadBalancer\x12\x0c\n\x04name\x18\x01 \x01(\tB\xeb\x01\n\"com.google.cloud.securitycenter.v2B\x11LoadBalancerProtoP\x01ZJcloud.google.com/go/securitycenter/apiv2/securitycenterpb;securitycenterpb\xaa\x02\x1eGoogle.Cloud.SecurityCenter.V2\xca\x02\x1eGoogle\\Cloud\\SecurityCenter\\V2\xea\x02!Google::Cloud::SecurityCenter::V2b\x06proto3" - -pool = ::Google::Protobuf::DescriptorPool.generated_pool -pool.add_serialized_file(descriptor_data) - -module Google - module Cloud - module SecurityCenter - module V2 - LoadBalancer = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.securitycenter.v2.LoadBalancer").msgclass - end - end - end -end diff --git a/owl-bot-staging/google-cloud-security_center-v2/lib/google/cloud/securitycenter/v2/log_entry_pb.rb b/owl-bot-staging/google-cloud-security_center-v2/lib/google/cloud/securitycenter/v2/log_entry_pb.rb deleted file mode 100644 index b3704ddc1826..000000000000 --- a/owl-bot-staging/google-cloud-security_center-v2/lib/google/cloud/securitycenter/v2/log_entry_pb.rb +++ /dev/null @@ -1,24 +0,0 @@ -# frozen_string_literal: true -# Generated by the protocol buffer compiler. DO NOT EDIT! -# source: google/cloud/securitycenter/v2/log_entry.proto - -require 'google/protobuf' - -require 'google/protobuf/timestamp_pb' - - -descriptor_data = "\n.google/cloud/securitycenter/v2/log_entry.proto\x12\x1egoogle.cloud.securitycenter.v2\x1a\x1fgoogle/protobuf/timestamp.proto\"i\n\x08LogEntry\x12P\n\x13\x63loud_logging_entry\x18\x01 \x01(\x0b\x32\x31.google.cloud.securitycenter.v2.CloudLoggingEntryH\x00\x42\x0b\n\tlog_entry\"\x81\x01\n\x11\x43loudLoggingEntry\x12\x11\n\tinsert_id\x18\x01 \x01(\t\x12\x0e\n\x06log_id\x18\x02 \x01(\t\x12\x1a\n\x12resource_container\x18\x03 \x01(\t\x12-\n\ttimestamp\x18\x04 \x01(\x0b\x32\x1a.google.protobuf.TimestampB\xe7\x01\n\"com.google.cloud.securitycenter.v2B\rLogEntryProtoP\x01ZJcloud.google.com/go/securitycenter/apiv2/securitycenterpb;securitycenterpb\xaa\x02\x1eGoogle.Cloud.SecurityCenter.V2\xca\x02\x1eGoogle\\Cloud\\SecurityCenter\\V2\xea\x02!Google::Cloud::SecurityCenter::V2b\x06proto3" - -pool = ::Google::Protobuf::DescriptorPool.generated_pool -pool.add_serialized_file(descriptor_data) - -module Google - module Cloud - module SecurityCenter - module V2 - LogEntry = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.securitycenter.v2.LogEntry").msgclass - CloudLoggingEntry = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.securitycenter.v2.CloudLoggingEntry").msgclass - end - end - end -end diff --git a/owl-bot-staging/google-cloud-security_center-v2/lib/google/cloud/securitycenter/v2/mitre_attack_pb.rb b/owl-bot-staging/google-cloud-security_center-v2/lib/google/cloud/securitycenter/v2/mitre_attack_pb.rb deleted file mode 100644 index 08d45bd18d1a..000000000000 --- a/owl-bot-staging/google-cloud-security_center-v2/lib/google/cloud/securitycenter/v2/mitre_attack_pb.rb +++ /dev/null @@ -1,23 +0,0 @@ -# frozen_string_literal: true -# Generated by the protocol buffer compiler. DO NOT EDIT! -# source: google/cloud/securitycenter/v2/mitre_attack.proto - -require 'google/protobuf' - - -descriptor_data = "\n1google/cloud/securitycenter/v2/mitre_attack.proto\x12\x1egoogle.cloud.securitycenter.v2\"\xca%\n\x0bMitreAttack\x12J\n\x0eprimary_tactic\x18\x01 \x01(\x0e\x32\x32.google.cloud.securitycenter.v2.MitreAttack.Tactic\x12Q\n\x12primary_techniques\x18\x02 \x03(\x0e\x32\x35.google.cloud.securitycenter.v2.MitreAttack.Technique\x12N\n\x12\x61\x64\x64itional_tactics\x18\x03 \x03(\x0e\x32\x32.google.cloud.securitycenter.v2.MitreAttack.Tactic\x12T\n\x15\x61\x64\x64itional_techniques\x18\x04 \x03(\x0e\x32\x35.google.cloud.securitycenter.v2.MitreAttack.Technique\x12\x0f\n\x07version\x18\x05 \x01(\t\"\xb4\x02\n\x06Tactic\x12\x16\n\x12TACTIC_UNSPECIFIED\x10\x00\x12\x12\n\x0eRECONNAISSANCE\x10\x01\x12\x18\n\x14RESOURCE_DEVELOPMENT\x10\x02\x12\x12\n\x0eINITIAL_ACCESS\x10\x05\x12\r\n\tEXECUTION\x10\x03\x12\x0f\n\x0bPERSISTENCE\x10\x06\x12\x18\n\x14PRIVILEGE_ESCALATION\x10\x08\x12\x13\n\x0f\x44\x45\x46\x45NSE_EVASION\x10\x07\x12\x15\n\x11\x43REDENTIAL_ACCESS\x10\t\x12\r\n\tDISCOVERY\x10\n\x12\x14\n\x10LATERAL_MOVEMENT\x10\x0b\x12\x0e\n\nCOLLECTION\x10\x0c\x12\x17\n\x13\x43OMMAND_AND_CONTROL\x10\x04\x12\x10\n\x0c\x45XFILTRATION\x10\r\x12\n\n\x06IMPACT\x10\x0e\"\xad \n\tTechnique\x12\x19\n\x15TECHNIQUE_UNSPECIFIED\x10\x00\x12\x14\n\x10\x44\x41TA_OBFUSCATION\x10\x46\x12\"\n\x1e\x44\x41TA_OBFUSCATION_STEGANOGRAPHY\x10G\x12\x19\n\x15OS_CREDENTIAL_DUMPING\x10r\x12)\n%OS_CREDENTIAL_DUMPING_PROC_FILESYSTEM\x10s\x12\x35\n1OS_CREDENTIAL_DUMPING_ETC_PASSWORD_AND_ETC_SHADOW\x10z\x12\x1a\n\x16\x44\x41TA_FROM_LOCAL_SYSTEM\x10u\x12\x1a\n\x16\x41UTOMATED_EXFILTRATION\x10\x44\x12\x1c\n\x18OBFUSCATED_FILES_OR_INFO\x10H\x12\x11\n\rSTEGANOGRAPHY\x10I\x12\x1a\n\x16\x43OMPILE_AFTER_DELIVERY\x10J\x12\x17\n\x13\x43OMMAND_OBFUSCATION\x10K\x12\x16\n\x12SCHEDULED_TRANSFER\x10x\x12\x1f\n\x1bSYSTEM_OWNER_USER_DISCOVERY\x10v\x12\x10\n\x0cMASQUERADING\x10\x31\x12%\n!MATCH_LEGITIMATE_NAME_OR_LOCATION\x10\x32\x12(\n$BOOT_OR_LOGON_INITIALIZATION_SCRIPTS\x10%\x12\x11\n\rSTARTUP_ITEMS\x10&\x12\x1d\n\x19NETWORK_SERVICE_DISCOVERY\x10 \x12\x16\n\x12SCHEDULED_TASK_JOB\x10Y\x12\x1b\n\x17SCHEDULED_TASK_JOB_CRON\x10w\x12\x1f\n\x1b\x43ONTAINER_ORCHESTRATION_JOB\x10Z\x12\x15\n\x11PROCESS_INJECTION\x10]\x12\x11\n\rINPUT_CAPTURE\x10g\x12\x1c\n\x18INPUT_CAPTURE_KEYLOGGING\x10h\x12\x15\n\x11PROCESS_DISCOVERY\x10\x38\x12%\n!COMMAND_AND_SCRIPTING_INTERPRETER\x10\x06\x12\x0e\n\nUNIX_SHELL\x10\x07\x12\n\n\x06PYTHON\x10;\x12)\n%EXPLOITATION_FOR_PRIVILEGE_ESCALATION\x10?\x12\x1f\n\x1bPERMISSION_GROUPS_DISCOVERY\x10\x12\x12\x10\n\x0c\x43LOUD_GROUPS\x10\x13\x12\x15\n\x11INDICATOR_REMOVAL\x10{\x12\x34\n0INDICATOR_REMOVAL_CLEAR_LINUX_OR_MAC_SYSTEM_LOGS\x10|\x12+\n\'INDICATOR_REMOVAL_CLEAR_COMMAND_HISTORY\x10}\x12#\n\x1fINDICATOR_REMOVAL_FILE_DELETION\x10@\x12 \n\x1bINDICATOR_REMOVAL_TIMESTOMP\x10\x80\x01\x12(\n$INDICATOR_REMOVAL_CLEAR_MAILBOX_DATA\x10~\x12\x1e\n\x1a\x41PPLICATION_LAYER_PROTOCOL\x10-\x12\x07\n\x03\x44NS\x10.\x12\x1d\n\x19SOFTWARE_DEPLOYMENT_TOOLS\x10/\x12\x12\n\x0eVALID_ACCOUNTS\x10\x0e\x12\x14\n\x10\x44\x45\x46\x41ULT_ACCOUNTS\x10#\x12\x12\n\x0eLOCAL_ACCOUNTS\x10\x0f\x12\x12\n\x0e\x43LOUD_ACCOUNTS\x10\x10\x12 \n\x1c\x46ILE_AND_DIRECTORY_DISCOVERY\x10y\x12#\n\x1f\x41\x43\x43OUNT_DISCOVERY_LOCAL_ACCOUNT\x10t\x12\t\n\x05PROXY\x10\t\x12\x12\n\x0e\x45XTERNAL_PROXY\x10\n\x12\x13\n\x0fMULTI_HOP_PROXY\x10\x0b\x12\x18\n\x14\x41\x43\x43OUNT_MANIPULATION\x10\x16\x12 \n\x1c\x41\x44\x44ITIONAL_CLOUD_CREDENTIALS\x10(\x12\x1a\n\x16\x41\x44\x44ITIONAL_CLOUD_ROLES\x10\x43\x12\x17\n\x13SSH_AUTHORIZED_KEYS\x10\x17\x12&\n\"ADDITIONAL_CONTAINER_CLUSTER_ROLES\x10:\x12\x18\n\x14MULTI_STAGE_CHANNELS\x10L\x12\x19\n\x15INGRESS_TOOL_TRANSFER\x10\x03\x12\x0e\n\nNATIVE_API\x10\x04\x12\x0f\n\x0b\x42RUTE_FORCE\x10,\x12\x18\n\x14\x41UTOMATED_COLLECTION\x10^\x12\x12\n\x0eSHARED_MODULES\x10\x05\x12\x11\n\rDATA_ENCODING\x10M\x12\x15\n\x11STANDARD_ENCODING\x10N\x12\x1d\n\x19\x41\x43\x43\x45SS_TOKEN_MANIPULATION\x10!\x12 \n\x1cTOKEN_IMPERSONATION_OR_THEFT\x10\'\x12\x12\n\x0e\x43REATE_ACCOUNT\x10O\x12\x11\n\rLOCAL_ACCOUNT\x10P\x12$\n DEOBFUSCATE_DECODE_FILES_OR_INFO\x10_\x12%\n!EXPLOIT_PUBLIC_FACING_APPLICATION\x10\x1b\x12\x1c\n\x17SUPPLY_CHAIN_COMPROMISE\x10\x81\x01\x12;\n6COMPROMISE_SOFTWARE_DEPENDENCIES_AND_DEVELOPMENT_TOOLS\x10\x82\x01\x12&\n!EXPLOITATION_FOR_CLIENT_EXECUTION\x10\x86\x01\x12\x12\n\x0eUSER_EXECUTION\x10\x45\x12>\n9LINUX_AND_MAC_FILE_AND_DIRECTORY_PERMISSIONS_MODIFICATION\x10\x87\x01\x12\x1e\n\x1a\x44OMAIN_POLICY_MODIFICATION\x10\x1e\x12\x14\n\x10\x44\x41TA_DESTRUCTION\x10\x1d\x12\x1e\n\x19\x44\x41TA_ENCRYPTED_FOR_IMPACT\x10\x84\x01\x12\x10\n\x0cSERVICE_STOP\x10\x34\x12\x1b\n\x17INHIBIT_SYSTEM_RECOVERY\x10$\x12\x17\n\x13\x46IRMWARE_CORRUPTION\x10Q\x12\x16\n\x12RESOURCE_HIJACKING\x10\x08\x12\x1d\n\x19NETWORK_DENIAL_OF_SERVICE\x10\x11\x12\x1b\n\x17\x43LOUD_SERVICE_DISCOVERY\x10\x30\x12\"\n\x1eSTEAL_APPLICATION_ACCESS_TOKEN\x10*\x12\x1a\n\x16\x41\x43\x43OUNT_ACCESS_REMOVAL\x10\x33\x12\"\n\x1eTRANSFER_DATA_TO_CLOUD_ACCOUNT\x10[\x12\x1c\n\x18STEAL_WEB_SESSION_COOKIE\x10\x19\x12#\n\x1f\x43REATE_OR_MODIFY_SYSTEM_PROCESS\x10\x18\x12\x1d\n\x19\x45VENT_TRIGGERED_EXECUTION\x10\x41\x12%\n!BOOT_OR_LOGON_AUTOSTART_EXECUTION\x10R\x12!\n\x1dKERNEL_MODULES_AND_EXTENSIONS\x10S\x12\x19\n\x15SHORTCUT_MODIFICATION\x10\x7f\x12%\n!ABUSE_ELEVATION_CONTROL_MECHANISM\x10\"\x12\x38\n3ABUSE_ELEVATION_CONTROL_MECHANISM_SETUID_AND_SETGID\x10\x88\x01\x12;\n7ABUSE_ELEVATION_CONTROL_MECHANISM_SUDO_AND_SUDO_CACHING\x10m\x12\x19\n\x15UNSECURED_CREDENTIALS\x10\r\x12\x18\n\x14\x43REDENTIALS_IN_FILES\x10i\x12\x10\n\x0c\x42\x41SH_HISTORY\x10`\x12\x10\n\x0cPRIVATE_KEYS\x10\x61\x12\x19\n\x15SUBVERT_TRUST_CONTROL\x10j\x12\x1c\n\x18INSTALL_ROOT_CERTIFICATE\x10k\x12#\n\x1f\x43OMPROMISE_HOST_SOFTWARE_BINARY\x10T\x12$\n CREDENTIALS_FROM_PASSWORD_STORES\x10\x62\x12!\n\x1dMODIFY_AUTHENTICATION_PROCESS\x10\x1c\x12$\n PLUGGABLE_AUTHENTICATION_MODULES\x10l\x12 \n\x1bMULTI_FACTOR_AUTHENTICATION\x10\x89\x01\x12\x13\n\x0fIMPAIR_DEFENSES\x10\x1f\x12\x1b\n\x17\x44ISABLE_OR_MODIFY_TOOLS\x10\x37\x12\x16\n\x12INDICATOR_BLOCKING\x10n\x12(\n$DISABLE_OR_MODIFY_LINUX_AUDIT_SYSTEM\x10o\x12\x12\n\x0eHIDE_ARTIFACTS\x10U\x12 \n\x1cHIDDEN_FILES_AND_DIRECTORIES\x10V\x12\x10\n\x0cHIDDEN_USERS\x10W\x12!\n\x1d\x45XFILTRATION_OVER_WEB_SERVICE\x10\x14\x12!\n\x1d\x45XFILTRATION_TO_CLOUD_STORAGE\x10\x15\x12\x16\n\x12\x44YNAMIC_RESOLUTION\x10\x0c\x12\x19\n\x15LATERAL_TOOL_TRANSFER\x10)\x12\x19\n\x15HIJACK_EXECUTION_FLOW\x10p\x12\x32\n.HIJACK_EXECUTION_FLOW_DYNAMIC_LINKER_HIJACKING\x10q\x12\'\n#MODIFY_CLOUD_COMPUTE_INFRASTRUCTURE\x10\x1a\x12\x13\n\x0f\x43REATE_SNAPSHOT\x10\x36\x12\"\n\x1e\x43LOUD_INFRASTRUCTURE_DISCOVERY\x10\x35\x12\x18\n\x14\x44\x45VELOP_CAPABILITIES\x10\x63\x12 \n\x1c\x44\x45VELOP_CAPABILITIES_MALWARE\x10\x64\x12\x17\n\x13OBTAIN_CAPABILITIES\x10+\x12\x1f\n\x1bOBTAIN_CAPABILITIES_MALWARE\x10\x65\x12(\n#OBTAIN_CAPABILITIES_VULNERABILITIES\x10\x85\x01\x12\x13\n\x0f\x41\x43TIVE_SCANNING\x10\x01\x12\x16\n\x12SCANNING_IP_BLOCKS\x10\x02\x12\x16\n\x12STAGE_CAPABILITIES\x10X\x12\x12\n\x0eUPLOAD_MALWARE\x10\x66\x12$\n CONTAINER_ADMINISTRATION_COMMAND\x10<\x12\x14\n\x10\x44\x45PLOY_CONTAINER\x10\x42\x12\x12\n\x0e\x45SCAPE_TO_HOST\x10=\x12$\n CONTAINER_AND_RESOURCE_DISCOVERY\x10\x39\x12\x1b\n\x17REFLECTIVE_CODE_LOADING\x10\\\x12.\n*STEAL_OR_FORGE_AUTHENTICATION_CERTIFICATES\x10>\x12\x14\n\x0f\x46INANCIAL_THEFT\x10\x83\x01\x42\xea\x01\n\"com.google.cloud.securitycenter.v2B\x10MitreAttackProtoP\x01ZJcloud.google.com/go/securitycenter/apiv2/securitycenterpb;securitycenterpb\xaa\x02\x1eGoogle.Cloud.SecurityCenter.V2\xca\x02\x1eGoogle\\Cloud\\SecurityCenter\\V2\xea\x02!Google::Cloud::SecurityCenter::V2b\x06proto3" - -pool = ::Google::Protobuf::DescriptorPool.generated_pool -pool.add_serialized_file(descriptor_data) - -module Google - module Cloud - module SecurityCenter - module V2 - MitreAttack = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.securitycenter.v2.MitreAttack").msgclass - MitreAttack::Tactic = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.securitycenter.v2.MitreAttack.Tactic").enummodule - MitreAttack::Technique = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.securitycenter.v2.MitreAttack.Technique").enummodule - end - end - end -end diff --git a/owl-bot-staging/google-cloud-security_center-v2/lib/google/cloud/securitycenter/v2/mute_config_pb.rb b/owl-bot-staging/google-cloud-security_center-v2/lib/google/cloud/securitycenter/v2/mute_config_pb.rb deleted file mode 100644 index 1fa427767438..000000000000 --- a/owl-bot-staging/google-cloud-security_center-v2/lib/google/cloud/securitycenter/v2/mute_config_pb.rb +++ /dev/null @@ -1,26 +0,0 @@ -# frozen_string_literal: true -# Generated by the protocol buffer compiler. DO NOT EDIT! -# source: google/cloud/securitycenter/v2/mute_config.proto - -require 'google/protobuf' - -require 'google/api/field_behavior_pb' -require 'google/api/resource_pb' -require 'google/protobuf/timestamp_pb' - - -descriptor_data = "\n0google/cloud/securitycenter/v2/mute_config.proto\x12\x1egoogle.cloud.securitycenter.v2\x1a\x1fgoogle/api/field_behavior.proto\x1a\x19google/api/resource.proto\x1a\x1fgoogle/protobuf/timestamp.proto\"\xd4\x06\n\nMuteConfig\x12\x11\n\x04name\x18\x01 \x01(\tB\x03\xe0\x41\x08\x12\x13\n\x0b\x64\x65scription\x18\x02 \x01(\t\x12\x13\n\x06\x66ilter\x18\x03 \x01(\tB\x03\xe0\x41\x02\x12\x34\n\x0b\x63reate_time\x18\x04 \x01(\x0b\x32\x1a.google.protobuf.TimestampB\x03\xe0\x41\x03\x12\x34\n\x0bupdate_time\x18\x05 \x01(\x0b\x32\x1a.google.protobuf.TimestampB\x03\xe0\x41\x03\x12\x1f\n\x12most_recent_editor\x18\x06 \x01(\tB\x03\xe0\x41\x03\x12L\n\x04type\x18\x08 \x01(\x0e\x32\x39.google.cloud.securitycenter.v2.MuteConfig.MuteConfigTypeB\x03\xe0\x41\x02\x12\x34\n\x0b\x65xpiry_time\x18\t \x01(\x0b\x32\x1a.google.protobuf.TimestampB\x03\xe0\x41\x01\"K\n\x0eMuteConfigType\x12 \n\x1cMUTE_CONFIG_TYPE_UNSPECIFIED\x10\x00\x12\n\n\x06STATIC\x10\x01\x12\x0b\n\x07\x44YNAMIC\x10\x02:\xaa\x03\xea\x41\xa6\x03\n(securitycenter.googleapis.com/MuteConfig\x12\x36organizations/{organization}/muteConfigs/{mute_config}\x12Korganizations/{organization}/locations/{location}/muteConfigs/{mute_config}\x12*folders/{folder}/muteConfigs/{mute_config}\x12?folders/{folder}/locations/{location}/muteConfigs/{mute_config}\x12,projects/{project}/muteConfigs/{mute_config}\x12\x41projects/{project}/locations/{location}/muteConfigs/{mute_config}*\x0bmuteConfigs2\nmuteConfigB\xe9\x01\n\"com.google.cloud.securitycenter.v2B\x0fMuteConfigProtoP\x01ZJcloud.google.com/go/securitycenter/apiv2/securitycenterpb;securitycenterpb\xaa\x02\x1eGoogle.Cloud.SecurityCenter.V2\xca\x02\x1eGoogle\\Cloud\\SecurityCenter\\V2\xea\x02!Google::Cloud::SecurityCenter::V2b\x06proto3" - -pool = ::Google::Protobuf::DescriptorPool.generated_pool -pool.add_serialized_file(descriptor_data) - -module Google - module Cloud - module SecurityCenter - module V2 - MuteConfig = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.securitycenter.v2.MuteConfig").msgclass - MuteConfig::MuteConfigType = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.securitycenter.v2.MuteConfig.MuteConfigType").enummodule - end - end - end -end diff --git a/owl-bot-staging/google-cloud-security_center-v2/lib/google/cloud/securitycenter/v2/network_pb.rb b/owl-bot-staging/google-cloud-security_center-v2/lib/google/cloud/securitycenter/v2/network_pb.rb deleted file mode 100644 index b3adfa3e0d12..000000000000 --- a/owl-bot-staging/google-cloud-security_center-v2/lib/google/cloud/securitycenter/v2/network_pb.rb +++ /dev/null @@ -1,21 +0,0 @@ -# frozen_string_literal: true -# Generated by the protocol buffer compiler. DO NOT EDIT! -# source: google/cloud/securitycenter/v2/network.proto - -require 'google/protobuf' - - -descriptor_data = "\n,google/cloud/securitycenter/v2/network.proto\x12\x1egoogle.cloud.securitycenter.v2\"\x17\n\x07Network\x12\x0c\n\x04name\x18\x01 \x01(\tB\xe6\x01\n\"com.google.cloud.securitycenter.v2B\x0cNetworkProtoP\x01ZJcloud.google.com/go/securitycenter/apiv2/securitycenterpb;securitycenterpb\xaa\x02\x1eGoogle.Cloud.SecurityCenter.V2\xca\x02\x1eGoogle\\Cloud\\SecurityCenter\\V2\xea\x02!Google::Cloud::SecurityCenter::V2b\x06proto3" - -pool = ::Google::Protobuf::DescriptorPool.generated_pool -pool.add_serialized_file(descriptor_data) - -module Google - module Cloud - module SecurityCenter - module V2 - Network = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.securitycenter.v2.Network").msgclass - end - end - end -end diff --git a/owl-bot-staging/google-cloud-security_center-v2/lib/google/cloud/securitycenter/v2/notebook_pb.rb b/owl-bot-staging/google-cloud-security_center-v2/lib/google/cloud/securitycenter/v2/notebook_pb.rb deleted file mode 100644 index 648e79e5aff6..000000000000 --- a/owl-bot-staging/google-cloud-security_center-v2/lib/google/cloud/securitycenter/v2/notebook_pb.rb +++ /dev/null @@ -1,23 +0,0 @@ -# frozen_string_literal: true -# Generated by the protocol buffer compiler. DO NOT EDIT! -# source: google/cloud/securitycenter/v2/notebook.proto - -require 'google/protobuf' - -require 'google/protobuf/timestamp_pb' - - -descriptor_data = "\n-google/cloud/securitycenter/v2/notebook.proto\x12\x1egoogle.cloud.securitycenter.v2\x1a\x1fgoogle/protobuf/timestamp.proto\"x\n\x08Notebook\x12\x0c\n\x04name\x18\x01 \x01(\t\x12\x0f\n\x07service\x18\x02 \x01(\t\x12\x13\n\x0blast_author\x18\x03 \x01(\t\x12\x38\n\x14notebook_update_time\x18\x04 \x01(\x0b\x32\x1a.google.protobuf.TimestampB\xe7\x01\n\"com.google.cloud.securitycenter.v2B\rNotebookProtoP\x01ZJcloud.google.com/go/securitycenter/apiv2/securitycenterpb;securitycenterpb\xaa\x02\x1eGoogle.Cloud.SecurityCenter.V2\xca\x02\x1eGoogle\\Cloud\\SecurityCenter\\V2\xea\x02!Google::Cloud::SecurityCenter::V2b\x06proto3" - -pool = ::Google::Protobuf::DescriptorPool.generated_pool -pool.add_serialized_file(descriptor_data) - -module Google - module Cloud - module SecurityCenter - module V2 - Notebook = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.securitycenter.v2.Notebook").msgclass - end - end - end -end diff --git a/owl-bot-staging/google-cloud-security_center-v2/lib/google/cloud/securitycenter/v2/notification_config_pb.rb b/owl-bot-staging/google-cloud-security_center-v2/lib/google/cloud/securitycenter/v2/notification_config_pb.rb deleted file mode 100644 index 36db41862bbd..000000000000 --- a/owl-bot-staging/google-cloud-security_center-v2/lib/google/cloud/securitycenter/v2/notification_config_pb.rb +++ /dev/null @@ -1,26 +0,0 @@ -# frozen_string_literal: true -# Generated by the protocol buffer compiler. DO NOT EDIT! -# source: google/cloud/securitycenter/v2/notification_config.proto - -require 'google/protobuf' - -require 'google/api/field_behavior_pb' -require 'google/api/resource_pb' -require 'google/protobuf/timestamp_pb' - - -descriptor_data = "\n8google/cloud/securitycenter/v2/notification_config.proto\x12\x1egoogle.cloud.securitycenter.v2\x1a\x1fgoogle/api/field_behavior.proto\x1a\x19google/api/resource.proto\x1a\x1fgoogle/protobuf/timestamp.proto\"\xbf\x05\n\x12NotificationConfig\x12\x11\n\x04name\x18\x01 \x01(\tB\x03\xe0\x41\x08\x12\x13\n\x0b\x64\x65scription\x18\x02 \x01(\t\x12\x36\n\x0cpubsub_topic\x18\x03 \x01(\tB \xfa\x41\x1d\n\x1bpubsub.googleapis.com/Topic\x12\x1c\n\x0fservice_account\x18\x04 \x01(\tB\x03\xe0\x41\x03\x12^\n\x10streaming_config\x18\x05 \x01(\x0b\x32\x42.google.cloud.securitycenter.v2.NotificationConfig.StreamingConfigH\x00\x12\x34\n\x0bupdate_time\x18\x07 \x01(\x0b\x32\x1a.google.protobuf.TimestampB\x03\xe0\x41\x03\x1a!\n\x0fStreamingConfig\x12\x0e\n\x06\x66ilter\x18\x01 \x01(\t:\xe0\x02\xea\x41\xdc\x02\n0securitycenter.googleapis.com/NotificationConfig\x12[organizations/{organization}/locations/{location}/notificationConfigs/{notification_config}\x12Ofolders/{folder}/locations/{location}/notificationConfigs/{notification_config}\x12Qprojects/{project}/locations/{location}/notificationConfigs/{notification_config}*\x13notificationConfigs2\x12notificationConfigB\x0f\n\rnotify_configB\xb4\x02\n\"com.google.cloud.securitycenter.v2B\x17NotificationConfigProtoP\x01ZJcloud.google.com/go/securitycenter/apiv2/securitycenterpb;securitycenterpb\xaa\x02\x1eGoogle.Cloud.SecurityCenter.V2\xca\x02\x1eGoogle\\Cloud\\SecurityCenter\\V2\xea\x02!Google::Cloud::SecurityCenter::V2\xea\x41@\n\x1bpubsub.googleapis.com/Topic\x12!projects/{project}/topics/{topic}b\x06proto3" - -pool = ::Google::Protobuf::DescriptorPool.generated_pool -pool.add_serialized_file(descriptor_data) - -module Google - module Cloud - module SecurityCenter - module V2 - NotificationConfig = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.securitycenter.v2.NotificationConfig").msgclass - NotificationConfig::StreamingConfig = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.securitycenter.v2.NotificationConfig.StreamingConfig").msgclass - end - end - end -end diff --git a/owl-bot-staging/google-cloud-security_center-v2/lib/google/cloud/securitycenter/v2/notification_message_pb.rb b/owl-bot-staging/google-cloud-security_center-v2/lib/google/cloud/securitycenter/v2/notification_message_pb.rb deleted file mode 100644 index 77017de51eeb..000000000000 --- a/owl-bot-staging/google-cloud-security_center-v2/lib/google/cloud/securitycenter/v2/notification_message_pb.rb +++ /dev/null @@ -1,24 +0,0 @@ -# frozen_string_literal: true -# Generated by the protocol buffer compiler. DO NOT EDIT! -# source: google/cloud/securitycenter/v2/notification_message.proto - -require 'google/protobuf' - -require 'google/cloud/securitycenter/v2/finding_pb' -require 'google/cloud/securitycenter/v2/resource_pb' - - -descriptor_data = "\n9google/cloud/securitycenter/v2/notification_message.proto\x12\x1egoogle.cloud.securitycenter.v2\x1a,google/cloud/securitycenter/v2/finding.proto\x1a-google/cloud/securitycenter/v2/resource.proto\"\xb8\x01\n\x13NotificationMessage\x12 \n\x18notification_config_name\x18\x01 \x01(\t\x12:\n\x07\x66inding\x18\x02 \x01(\x0b\x32\'.google.cloud.securitycenter.v2.FindingH\x00\x12:\n\x08resource\x18\x03 \x01(\x0b\x32(.google.cloud.securitycenter.v2.ResourceB\x07\n\x05\x65ventB\xf2\x01\n\"com.google.cloud.securitycenter.v2B\x18NotificationMessageProtoP\x01ZJcloud.google.com/go/securitycenter/apiv2/securitycenterpb;securitycenterpb\xaa\x02\x1eGoogle.Cloud.SecurityCenter.V2\xca\x02\x1eGoogle\\Cloud\\SecurityCenter\\V2\xea\x02!Google::Cloud::SecurityCenter::V2b\x06proto3" - -pool = ::Google::Protobuf::DescriptorPool.generated_pool -pool.add_serialized_file(descriptor_data) - -module Google - module Cloud - module SecurityCenter - module V2 - NotificationMessage = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.securitycenter.v2.NotificationMessage").msgclass - end - end - end -end diff --git a/owl-bot-staging/google-cloud-security_center-v2/lib/google/cloud/securitycenter/v2/org_policy_pb.rb b/owl-bot-staging/google-cloud-security_center-v2/lib/google/cloud/securitycenter/v2/org_policy_pb.rb deleted file mode 100644 index 9668bef4e937..000000000000 --- a/owl-bot-staging/google-cloud-security_center-v2/lib/google/cloud/securitycenter/v2/org_policy_pb.rb +++ /dev/null @@ -1,24 +0,0 @@ -# frozen_string_literal: true -# Generated by the protocol buffer compiler. DO NOT EDIT! -# source: google/cloud/securitycenter/v2/org_policy.proto - -require 'google/protobuf' - -require 'google/api/field_behavior_pb' -require 'google/api/resource_pb' - - -descriptor_data = "\n/google/cloud/securitycenter/v2/org_policy.proto\x12\x1egoogle.cloud.securitycenter.v2\x1a\x1fgoogle/api/field_behavior.proto\x1a\x19google/api/resource.proto\"\xdb\x01\n\tOrgPolicy\x12\x11\n\x04name\x18\x01 \x01(\tB\x03\xe0\x41\x08:\xba\x01\xea\x41\xb6\x01\n\x1forgpolicy.googleapis.com/Policy\x12\x37organizations/{organization}/policies/{constraint_name}\x12+folders/{folder}/policies/{constraint_name}\x12-projects/{project}/policies/{constraint_name}B\xe8\x01\n\"com.google.cloud.securitycenter.v2B\x0eOrgPolicyProtoP\x01ZJcloud.google.com/go/securitycenter/apiv2/securitycenterpb;securitycenterpb\xaa\x02\x1eGoogle.Cloud.SecurityCenter.V2\xca\x02\x1eGoogle\\Cloud\\SecurityCenter\\V2\xea\x02!Google::Cloud::SecurityCenter::V2b\x06proto3" - -pool = ::Google::Protobuf::DescriptorPool.generated_pool -pool.add_serialized_file(descriptor_data) - -module Google - module Cloud - module SecurityCenter - module V2 - OrgPolicy = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.securitycenter.v2.OrgPolicy").msgclass - end - end - end -end diff --git a/owl-bot-staging/google-cloud-security_center-v2/lib/google/cloud/securitycenter/v2/process_pb.rb b/owl-bot-staging/google-cloud-security_center-v2/lib/google/cloud/securitycenter/v2/process_pb.rb deleted file mode 100644 index d7368f3889e2..000000000000 --- a/owl-bot-staging/google-cloud-security_center-v2/lib/google/cloud/securitycenter/v2/process_pb.rb +++ /dev/null @@ -1,24 +0,0 @@ -# frozen_string_literal: true -# Generated by the protocol buffer compiler. DO NOT EDIT! -# source: google/cloud/securitycenter/v2/process.proto - -require 'google/protobuf' - -require 'google/cloud/securitycenter/v2/file_pb' - - -descriptor_data = "\n,google/cloud/securitycenter/v2/process.proto\x12\x1egoogle.cloud.securitycenter.v2\x1a)google/cloud/securitycenter/v2/file.proto\"\x86\x03\n\x07Process\x12\x0c\n\x04name\x18\x01 \x01(\t\x12\x34\n\x06\x62inary\x18\x02 \x01(\x0b\x32$.google.cloud.securitycenter.v2.File\x12\x37\n\tlibraries\x18\x03 \x03(\x0b\x32$.google.cloud.securitycenter.v2.File\x12\x34\n\x06script\x18\x04 \x01(\x0b\x32$.google.cloud.securitycenter.v2.File\x12\x0c\n\x04\x61rgs\x18\x05 \x03(\t\x12\x1b\n\x13\x61rguments_truncated\x18\x06 \x01(\x08\x12J\n\renv_variables\x18\x07 \x03(\x0b\x32\x33.google.cloud.securitycenter.v2.EnvironmentVariable\x12\x1f\n\x17\x65nv_variables_truncated\x18\x08 \x01(\x08\x12\x0b\n\x03pid\x18\t \x01(\x03\x12\x12\n\nparent_pid\x18\n \x01(\x03\x12\x0f\n\x07user_id\x18\x0b \x01(\x03\"0\n\x13\x45nvironmentVariable\x12\x0c\n\x04name\x18\x01 \x01(\t\x12\x0b\n\x03val\x18\x02 \x01(\tB\xe6\x01\n\"com.google.cloud.securitycenter.v2B\x0cProcessProtoP\x01ZJcloud.google.com/go/securitycenter/apiv2/securitycenterpb;securitycenterpb\xaa\x02\x1eGoogle.Cloud.SecurityCenter.V2\xca\x02\x1eGoogle\\Cloud\\SecurityCenter\\V2\xea\x02!Google::Cloud::SecurityCenter::V2b\x06proto3" - -pool = ::Google::Protobuf::DescriptorPool.generated_pool -pool.add_serialized_file(descriptor_data) - -module Google - module Cloud - module SecurityCenter - module V2 - Process = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.securitycenter.v2.Process").msgclass - EnvironmentVariable = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.securitycenter.v2.EnvironmentVariable").msgclass - end - end - end -end diff --git a/owl-bot-staging/google-cloud-security_center-v2/lib/google/cloud/securitycenter/v2/resource_pb.rb b/owl-bot-staging/google-cloud-security_center-v2/lib/google/cloud/securitycenter/v2/resource_pb.rb deleted file mode 100644 index 2537d399e0df..000000000000 --- a/owl-bot-staging/google-cloud-security_center-v2/lib/google/cloud/securitycenter/v2/resource_pb.rb +++ /dev/null @@ -1,39 +0,0 @@ -# frozen_string_literal: true -# Generated by the protocol buffer compiler. DO NOT EDIT! -# source: google/cloud/securitycenter/v2/resource.proto - -require 'google/protobuf' - -require 'google/api/field_behavior_pb' -require 'google/api/resource_pb' -require 'google/cloud/securitycenter/v2/folder_pb' - - -descriptor_data = "\n-google/cloud/securitycenter/v2/resource.proto\x12\x1egoogle.cloud.securitycenter.v2\x1a\x1fgoogle/api/field_behavior.proto\x1a\x19google/api/resource.proto\x1a+google/cloud/securitycenter/v2/folder.proto\"\xf7\x03\n\x08Resource\x12\x0c\n\x04name\x18\x01 \x01(\t\x12\x14\n\x0c\x64isplay_name\x18\x02 \x01(\t\x12\x0c\n\x04type\x18\x03 \x01(\t\x12\x45\n\x0e\x63loud_provider\x18\x04 \x01(\x0e\x32-.google.cloud.securitycenter.v2.CloudProvider\x12\x0f\n\x07service\x18\x05 \x01(\t\x12\x10\n\x08location\x18\x06 \x01(\t\x12\x43\n\x0cgcp_metadata\x18\x07 \x01(\x0b\x32+.google.cloud.securitycenter.v2.GcpMetadataH\x00\x12\x43\n\x0c\x61ws_metadata\x18\x08 \x01(\x0b\x32+.google.cloud.securitycenter.v2.AwsMetadataH\x00\x12G\n\x0e\x61zure_metadata\x18\t \x01(\x0b\x32-.google.cloud.securitycenter.v2.AzureMetadataH\x00\x12\x43\n\rresource_path\x18\n \x01(\x0b\x32,.google.cloud.securitycenter.v2.ResourcePath\x12\x1c\n\x14resource_path_string\x18\x0b \x01(\tB\x19\n\x17\x63loud_provider_metadata\"\xbd\x01\n\x0bGcpMetadata\x12\x0f\n\x07project\x18\x01 \x01(\t\x12\x1c\n\x14project_display_name\x18\x02 \x01(\t\x12\x0e\n\x06parent\x18\x03 \x01(\t\x12\x1b\n\x13parent_display_name\x18\x04 \x01(\t\x12<\n\x07\x66olders\x18\x05 \x03(\x0b\x32&.google.cloud.securitycenter.v2.FolderB\x03\xe0\x41\x03\x12\x14\n\x0corganization\x18\x06 \x01(\t\"\x84\x03\n\x0b\x41wsMetadata\x12Q\n\x0corganization\x18\x01 \x01(\x0b\x32;.google.cloud.securitycenter.v2.AwsMetadata.AwsOrganization\x12_\n\x14organizational_units\x18\x02 \x03(\x0b\x32\x41.google.cloud.securitycenter.v2.AwsMetadata.AwsOrganizationalUnit\x12G\n\x07\x61\x63\x63ount\x18\x03 \x01(\x0b\x32\x36.google.cloud.securitycenter.v2.AwsMetadata.AwsAccount\x1a\x1d\n\x0f\x41wsOrganization\x12\n\n\x02id\x18\x01 \x01(\t\x1a\x31\n\x15\x41wsOrganizationalUnit\x12\n\n\x02id\x18\x01 \x01(\t\x12\x0c\n\x04name\x18\x02 \x01(\t\x1a&\n\nAwsAccount\x12\n\n\x02id\x18\x01 \x01(\t\x12\x0c\n\x04name\x18\x02 \x01(\t\"\xbc\x04\n\rAzureMetadata\x12]\n\x11management_groups\x18\x01 \x03(\x0b\x32\x42.google.cloud.securitycenter.v2.AzureMetadata.AzureManagementGroup\x12U\n\x0csubscription\x18\x02 \x01(\x0b\x32?.google.cloud.securitycenter.v2.AzureMetadata.AzureSubscription\x12X\n\x0eresource_group\x18\x03 \x01(\x0b\x32@.google.cloud.securitycenter.v2.AzureMetadata.AzureResourceGroup\x12I\n\x06tenant\x18\x07 \x01(\x0b\x32\x39.google.cloud.securitycenter.v2.AzureMetadata.AzureTenant\x1a\x38\n\x14\x41zureManagementGroup\x12\n\n\x02id\x18\x01 \x01(\t\x12\x14\n\x0c\x64isplay_name\x18\x02 \x01(\t\x1a\x35\n\x11\x41zureSubscription\x12\n\n\x02id\x18\x01 \x01(\t\x12\x14\n\x0c\x64isplay_name\x18\x02 \x01(\t\x1a.\n\x12\x41zureResourceGroup\x12\n\n\x02id\x18\x02 \x01(\t\x12\x0c\n\x04name\x18\x01 \x01(\t\x1a/\n\x0b\x41zureTenant\x12\n\n\x02id\x18\x01 \x01(\t\x12\x14\n\x0c\x64isplay_name\x18\x02 \x01(\t\"\xf4\x03\n\x0cResourcePath\x12L\n\x05nodes\x18\x01 \x03(\x0b\x32=.google.cloud.securitycenter.v2.ResourcePath.ResourcePathNode\x1a\x8a\x01\n\x10ResourcePathNode\x12T\n\tnode_type\x18\x01 \x01(\x0e\x32\x41.google.cloud.securitycenter.v2.ResourcePath.ResourcePathNodeType\x12\n\n\x02id\x18\x02 \x01(\t\x12\x14\n\x0c\x64isplay_name\x18\x03 \x01(\t\"\x88\x02\n\x14ResourcePathNodeType\x12\'\n#RESOURCE_PATH_NODE_TYPE_UNSPECIFIED\x10\x00\x12\x14\n\x10GCP_ORGANIZATION\x10\x01\x12\x0e\n\nGCP_FOLDER\x10\x02\x12\x0f\n\x0bGCP_PROJECT\x10\x03\x12\x14\n\x10\x41WS_ORGANIZATION\x10\x04\x12\x1b\n\x17\x41WS_ORGANIZATIONAL_UNIT\x10\x05\x12\x0f\n\x0b\x41WS_ACCOUNT\x10\x06\x12\x1a\n\x16\x41ZURE_MANAGEMENT_GROUP\x10\x07\x12\x16\n\x12\x41ZURE_SUBSCRIPTION\x10\x08\x12\x18\n\x14\x41ZURE_RESOURCE_GROUP\x10\t*x\n\rCloudProvider\x12\x1e\n\x1a\x43LOUD_PROVIDER_UNSPECIFIED\x10\x00\x12\x19\n\x15GOOGLE_CLOUD_PLATFORM\x10\x01\x12\x17\n\x13\x41MAZON_WEB_SERVICES\x10\x02\x12\x13\n\x0fMICROSOFT_AZURE\x10\x03\x42\xe7\x01\n\"com.google.cloud.securitycenter.v2B\rResourceProtoP\x01ZJcloud.google.com/go/securitycenter/apiv2/securitycenterpb;securitycenterpb\xaa\x02\x1eGoogle.Cloud.SecurityCenter.V2\xca\x02\x1eGoogle\\Cloud\\SecurityCenter\\V2\xea\x02!Google::Cloud::SecurityCenter::V2b\x06proto3" - -pool = ::Google::Protobuf::DescriptorPool.generated_pool -pool.add_serialized_file(descriptor_data) - -module Google - module Cloud - module SecurityCenter - module V2 - Resource = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.securitycenter.v2.Resource").msgclass - GcpMetadata = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.securitycenter.v2.GcpMetadata").msgclass - AwsMetadata = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.securitycenter.v2.AwsMetadata").msgclass - AwsMetadata::AwsOrganization = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.securitycenter.v2.AwsMetadata.AwsOrganization").msgclass - AwsMetadata::AwsOrganizationalUnit = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.securitycenter.v2.AwsMetadata.AwsOrganizationalUnit").msgclass - AwsMetadata::AwsAccount = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.securitycenter.v2.AwsMetadata.AwsAccount").msgclass - AzureMetadata = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.securitycenter.v2.AzureMetadata").msgclass - AzureMetadata::AzureManagementGroup = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.securitycenter.v2.AzureMetadata.AzureManagementGroup").msgclass - AzureMetadata::AzureSubscription = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.securitycenter.v2.AzureMetadata.AzureSubscription").msgclass - AzureMetadata::AzureResourceGroup = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.securitycenter.v2.AzureMetadata.AzureResourceGroup").msgclass - AzureMetadata::AzureTenant = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.securitycenter.v2.AzureMetadata.AzureTenant").msgclass - ResourcePath = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.securitycenter.v2.ResourcePath").msgclass - ResourcePath::ResourcePathNode = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.securitycenter.v2.ResourcePath.ResourcePathNode").msgclass - ResourcePath::ResourcePathNodeType = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.securitycenter.v2.ResourcePath.ResourcePathNodeType").enummodule - CloudProvider = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.securitycenter.v2.CloudProvider").enummodule - end - end - end -end diff --git a/owl-bot-staging/google-cloud-security_center-v2/lib/google/cloud/securitycenter/v2/resource_value_config_pb.rb b/owl-bot-staging/google-cloud-security_center-v2/lib/google/cloud/securitycenter/v2/resource_value_config_pb.rb deleted file mode 100644 index a620481d431c..000000000000 --- a/owl-bot-staging/google-cloud-security_center-v2/lib/google/cloud/securitycenter/v2/resource_value_config_pb.rb +++ /dev/null @@ -1,28 +0,0 @@ -# frozen_string_literal: true -# Generated by the protocol buffer compiler. DO NOT EDIT! -# source: google/cloud/securitycenter/v2/resource_value_config.proto - -require 'google/protobuf' - -require 'google/api/field_behavior_pb' -require 'google/api/resource_pb' -require 'google/cloud/securitycenter/v2/resource_pb' -require 'google/protobuf/timestamp_pb' - - -descriptor_data = "\n:google/cloud/securitycenter/v2/resource_value_config.proto\x12\x1egoogle.cloud.securitycenter.v2\x1a\x1fgoogle/api/field_behavior.proto\x1a\x19google/api/resource.proto\x1a-google/cloud/securitycenter/v2/resource.proto\x1a\x1fgoogle/protobuf/timestamp.proto\"\xf9\x08\n\x13ResourceValueConfig\x12\x11\n\x04name\x18\x01 \x01(\tB\x03\xe0\x41\x08\x12\x45\n\x0eresource_value\x18\x02 \x01(\x0e\x32-.google.cloud.securitycenter.v2.ResourceValue\x12\x12\n\ntag_values\x18\x03 \x03(\t\x12\x15\n\rresource_type\x18\x04 \x01(\t\x12\r\n\x05scope\x18\x05 \x01(\t\x12q\n\x18resource_labels_selector\x18\x06 \x03(\x0b\x32O.google.cloud.securitycenter.v2.ResourceValueConfig.ResourceLabelsSelectorEntry\x12\x13\n\x0b\x64\x65scription\x18\x07 \x01(\t\x12\x34\n\x0b\x63reate_time\x18\x08 \x01(\x0b\x32\x1a.google.protobuf.TimestampB\x03\xe0\x41\x03\x12\x34\n\x0bupdate_time\x18\t \x01(\x0b\x32\x1a.google.protobuf.TimestampB\x03\xe0\x41\x03\x12\x45\n\x0e\x63loud_provider\x18\n \x01(\x0e\x32-.google.cloud.securitycenter.v2.CloudProvider\x12}\n!sensitive_data_protection_mapping\x18\x0b \x01(\x0b\x32R.google.cloud.securitycenter.v2.ResourceValueConfig.SensitiveDataProtectionMapping\x1a\xc4\x01\n\x1eSensitiveDataProtectionMapping\x12O\n\x18high_sensitivity_mapping\x18\x01 \x01(\x0e\x32-.google.cloud.securitycenter.v2.ResourceValue\x12Q\n\x1amedium_sensitivity_mapping\x18\x02 \x01(\x0e\x32-.google.cloud.securitycenter.v2.ResourceValue\x1a=\n\x1bResourceLabelsSelectorEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12\r\n\x05value\x18\x02 \x01(\t:\x02\x38\x01:\x8d\x02\xea\x41\x89\x02\n1securitycenter.googleapis.com/ResourceValueConfig\x12Iorganizations/{organization}/resourceValueConfigs/{resource_value_config}\x12^organizations/{organization}/locations/{location}/resourceValueConfigs/{resource_value_config}*\x14resourceValueConfigs2\x13resourceValueConfig*X\n\rResourceValue\x12\x1e\n\x1aRESOURCE_VALUE_UNSPECIFIED\x10\x00\x12\x08\n\x04HIGH\x10\x01\x12\n\n\x06MEDIUM\x10\x02\x12\x07\n\x03LOW\x10\x03\x12\x08\n\x04NONE\x10\x04\x42\xf2\x01\n\"com.google.cloud.securitycenter.v2B\x18ResourceValueConfigProtoP\x01ZJcloud.google.com/go/securitycenter/apiv2/securitycenterpb;securitycenterpb\xaa\x02\x1eGoogle.Cloud.SecurityCenter.V2\xca\x02\x1eGoogle\\Cloud\\SecurityCenter\\V2\xea\x02!Google::Cloud::SecurityCenter::V2b\x06proto3" - -pool = ::Google::Protobuf::DescriptorPool.generated_pool -pool.add_serialized_file(descriptor_data) - -module Google - module Cloud - module SecurityCenter - module V2 - ResourceValueConfig = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.securitycenter.v2.ResourceValueConfig").msgclass - ResourceValueConfig::SensitiveDataProtectionMapping = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.securitycenter.v2.ResourceValueConfig.SensitiveDataProtectionMapping").msgclass - ResourceValue = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.securitycenter.v2.ResourceValue").enummodule - end - end - end -end diff --git a/owl-bot-staging/google-cloud-security_center-v2/lib/google/cloud/securitycenter/v2/security_marks_pb.rb b/owl-bot-staging/google-cloud-security_center-v2/lib/google/cloud/securitycenter/v2/security_marks_pb.rb deleted file mode 100644 index 8f9fb7fdc255..000000000000 --- a/owl-bot-staging/google-cloud-security_center-v2/lib/google/cloud/securitycenter/v2/security_marks_pb.rb +++ /dev/null @@ -1,23 +0,0 @@ -# frozen_string_literal: true -# Generated by the protocol buffer compiler. DO NOT EDIT! -# source: google/cloud/securitycenter/v2/security_marks.proto - -require 'google/protobuf' - -require 'google/api/resource_pb' - - -descriptor_data = "\n3google/cloud/securitycenter/v2/security_marks.proto\x12\x1egoogle.cloud.securitycenter.v2\x1a\x19google/api/resource.proto\"\xee\x06\n\rSecurityMarks\x12\x0c\n\x04name\x18\x01 \x01(\t\x12G\n\x05marks\x18\x02 \x03(\x0b\x32\x38.google.cloud.securitycenter.v2.SecurityMarks.MarksEntry\x12\x16\n\x0e\x63\x61nonical_name\x18\x03 \x01(\t\x1a,\n\nMarksEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12\r\n\x05value\x18\x02 \x01(\t:\x02\x38\x01:\xbf\x05\xea\x41\xbb\x05\n+securitycenter.googleapis.com/SecurityMarks\x12\x39organizations/{organization}/assets/{asset}/securityMarks\x12Norganizations/{organization}/sources/{source}/findings/{finding}/securityMarks\x12\x63organizations/{organization}/sources/{source}/locations/{location}/findings/{finding}/securityMarks\x12-folders/{folder}/assets/{asset}/securityMarks\x12\x42\x66olders/{folder}/sources/{source}/findings/{finding}/securityMarks\x12Wfolders/{folder}/sources/{source}/locations/{location}/findings/{finding}/securityMarks\x12/projects/{project}/assets/{asset}/securityMarks\x12\x44projects/{project}/sources/{source}/findings/{finding}/securityMarks\x12Yprojects/{project}/sources/{source}/locations/{location}/findings/{finding}/securityMarksB\xec\x01\n\"com.google.cloud.securitycenter.v2B\x12SecurityMarksProtoP\x01ZJcloud.google.com/go/securitycenter/apiv2/securitycenterpb;securitycenterpb\xaa\x02\x1eGoogle.Cloud.SecurityCenter.V2\xca\x02\x1eGoogle\\Cloud\\SecurityCenter\\V2\xea\x02!Google::Cloud::SecurityCenter::V2b\x06proto3" - -pool = ::Google::Protobuf::DescriptorPool.generated_pool -pool.add_serialized_file(descriptor_data) - -module Google - module Cloud - module SecurityCenter - module V2 - SecurityMarks = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.securitycenter.v2.SecurityMarks").msgclass - end - end - end -end diff --git a/owl-bot-staging/google-cloud-security_center-v2/lib/google/cloud/securitycenter/v2/security_posture_pb.rb b/owl-bot-staging/google-cloud-security_center-v2/lib/google/cloud/securitycenter/v2/security_posture_pb.rb deleted file mode 100644 index 0f13af8fe998..000000000000 --- a/owl-bot-staging/google-cloud-security_center-v2/lib/google/cloud/securitycenter/v2/security_posture_pb.rb +++ /dev/null @@ -1,22 +0,0 @@ -# frozen_string_literal: true -# Generated by the protocol buffer compiler. DO NOT EDIT! -# source: google/cloud/securitycenter/v2/security_posture.proto - -require 'google/protobuf' - - -descriptor_data = "\n5google/cloud/securitycenter/v2/security_posture.proto\x12\x1egoogle.cloud.securitycenter.v2\"\xe8\x02\n\x0fSecurityPosture\x12\x0c\n\x04name\x18\x01 \x01(\t\x12\x13\n\x0brevision_id\x18\x02 \x01(\t\x12#\n\x1bposture_deployment_resource\x18\x03 \x01(\t\x12\x1a\n\x12posture_deployment\x18\x04 \x01(\t\x12\x16\n\x0e\x63hanged_policy\x18\x05 \x01(\t\x12\x12\n\npolicy_set\x18\x06 \x01(\t\x12\x0e\n\x06policy\x18\x07 \x01(\t\x12`\n\x14policy_drift_details\x18\x08 \x03(\x0b\x32\x42.google.cloud.securitycenter.v2.SecurityPosture.PolicyDriftDetails\x1aS\n\x12PolicyDriftDetails\x12\r\n\x05\x66ield\x18\x01 \x01(\t\x12\x16\n\x0e\x65xpected_value\x18\x02 \x01(\t\x12\x16\n\x0e\x64\x65tected_value\x18\x03 \x01(\tB\xee\x01\n\"com.google.cloud.securitycenter.v2B\x14SecurityPostureProtoP\x01ZJcloud.google.com/go/securitycenter/apiv2/securitycenterpb;securitycenterpb\xaa\x02\x1eGoogle.Cloud.SecurityCenter.V2\xca\x02\x1eGoogle\\Cloud\\SecurityCenter\\V2\xea\x02!Google::Cloud::SecurityCenter::V2b\x06proto3" - -pool = ::Google::Protobuf::DescriptorPool.generated_pool -pool.add_serialized_file(descriptor_data) - -module Google - module Cloud - module SecurityCenter - module V2 - SecurityPosture = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.securitycenter.v2.SecurityPosture").msgclass - SecurityPosture::PolicyDriftDetails = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.securitycenter.v2.SecurityPosture.PolicyDriftDetails").msgclass - end - end - end -end diff --git a/owl-bot-staging/google-cloud-security_center-v2/lib/google/cloud/securitycenter/v2/securitycenter_service_pb.rb b/owl-bot-staging/google-cloud-security_center-v2/lib/google/cloud/securitycenter/v2/securitycenter_service_pb.rb deleted file mode 100644 index 438d7aa19da5..000000000000 --- a/owl-bot-staging/google-cloud-security_center-v2/lib/google/cloud/securitycenter/v2/securitycenter_service_pb.rb +++ /dev/null @@ -1,101 +0,0 @@ -# frozen_string_literal: true -# Generated by the protocol buffer compiler. DO NOT EDIT! -# source: google/cloud/securitycenter/v2/securitycenter_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/api/routing_pb' -require 'google/cloud/securitycenter/v2/attack_path_pb' -require 'google/cloud/securitycenter/v2/bigquery_export_pb' -require 'google/cloud/securitycenter/v2/external_system_pb' -require 'google/cloud/securitycenter/v2/finding_pb' -require 'google/cloud/securitycenter/v2/mute_config_pb' -require 'google/cloud/securitycenter/v2/notification_config_pb' -require 'google/cloud/securitycenter/v2/resource_pb' -require 'google/cloud/securitycenter/v2/resource_value_config_pb' -require 'google/cloud/securitycenter/v2/security_marks_pb' -require 'google/cloud/securitycenter/v2/simulation_pb' -require 'google/cloud/securitycenter/v2/source_pb' -require 'google/cloud/securitycenter/v2/valued_resource_pb' -require 'google/iam/v1/iam_policy_pb' -require 'google/iam/v1/policy_pb' -require 'google/longrunning/operations_pb' -require 'google/protobuf/empty_pb' -require 'google/protobuf/field_mask_pb' -require 'google/protobuf/struct_pb' -require 'google/protobuf/timestamp_pb' - - -descriptor_data = "\n;google/cloud/securitycenter/v2/securitycenter_service.proto\x12\x1egoogle.cloud.securitycenter.v2\x1a\x1cgoogle/api/annotations.proto\x1a\x17google/api/client.proto\x1a\x1fgoogle/api/field_behavior.proto\x1a\x19google/api/resource.proto\x1a\x18google/api/routing.proto\x1a\x30google/cloud/securitycenter/v2/attack_path.proto\x1a\x34google/cloud/securitycenter/v2/bigquery_export.proto\x1a\x34google/cloud/securitycenter/v2/external_system.proto\x1a,google/cloud/securitycenter/v2/finding.proto\x1a\x30google/cloud/securitycenter/v2/mute_config.proto\x1a\x38google/cloud/securitycenter/v2/notification_config.proto\x1a-google/cloud/securitycenter/v2/resource.proto\x1a:google/cloud/securitycenter/v2/resource_value_config.proto\x1a\x33google/cloud/securitycenter/v2/security_marks.proto\x1a/google/cloud/securitycenter/v2/simulation.proto\x1a+google/cloud/securitycenter/v2/source.proto\x1a\x34google/cloud/securitycenter/v2/valued_resource.proto\x1a\x1egoogle/iam/v1/iam_policy.proto\x1a\x1agoogle/iam/v1/policy.proto\x1a#google/longrunning/operations.proto\x1a\x1bgoogle/protobuf/empty.proto\x1a google/protobuf/field_mask.proto\x1a\x1cgoogle/protobuf/struct.proto\x1a\x1fgoogle/protobuf/timestamp.proto\"\xcc\x01\n&BatchCreateResourceValueConfigsRequest\x12I\n\x06parent\x18\x01 \x01(\tB9\xe0\x41\x02\xfa\x41\x33\x12\x31securitycenter.googleapis.com/ResourceValueConfig\x12W\n\x08requests\x18\x02 \x03(\x0b\x32@.google.cloud.securitycenter.v2.CreateResourceValueConfigRequestB\x03\xe0\x41\x02\"~\n\'BatchCreateResourceValueConfigsResponse\x12S\n\x16resource_value_configs\x18\x01 \x03(\x0b\x32\x33.google.cloud.securitycenter.v2.ResourceValueConfig\"\xe3\x01\n\x17\x42ulkMuteFindingsRequest\x12\x19\n\x06parent\x18\x01 \x01(\tB\t\xe0\x41\x02\xfa\x41\x03\n\x01*\x12\x0e\n\x06\x66ilter\x18\x02 \x01(\t\x12Z\n\nmute_state\x18\x03 \x01(\x0e\x32\x41.google.cloud.securitycenter.v2.BulkMuteFindingsRequest.MuteStateB\x03\xe0\x41\x01\"A\n\tMuteState\x12\x1a\n\x16MUTE_STATE_UNSPECIFIED\x10\x00\x12\t\n\x05MUTED\x10\x01\x12\r\n\tUNDEFINED\x10\x02\"\x1a\n\x18\x42ulkMuteFindingsResponse\"\xd4\x01\n\x1b\x43reateBigQueryExportRequest\x12\x44\n\x06parent\x18\x01 \x01(\tB4\xe0\x41\x02\xfa\x41.\x12,securitycenter.googleapis.com/BigQueryExport\x12M\n\x10\x62ig_query_export\x18\x02 \x01(\x0b\x32..google.cloud.securitycenter.v2.BigQueryExportB\x03\xe0\x41\x02\x12 \n\x13\x62ig_query_export_id\x18\x03 \x01(\tB\x03\xe0\x41\x02\"\xac\x01\n\x14\x43reateFindingRequest\x12<\n\x06parent\x18\x01 \x01(\tB,\xe0\x41\x02\xfa\x41&\n$securitycenter.googleapis.com/Source\x12\x17\n\nfinding_id\x18\x02 \x01(\tB\x03\xe0\x41\x02\x12=\n\x07\x66inding\x18\x03 \x01(\x0b\x32\'.google.cloud.securitycenter.v2.FindingB\x03\xe0\x41\x02\"\xbe\x01\n\x17\x43reateMuteConfigRequest\x12@\n\x06parent\x18\x01 \x01(\tB0\xe0\x41\x02\xfa\x41*\x12(securitycenter.googleapis.com/MuteConfig\x12\x44\n\x0bmute_config\x18\x02 \x01(\x0b\x32*.google.cloud.securitycenter.v2.MuteConfigB\x03\xe0\x41\x02\x12\x1b\n\x0emute_config_id\x18\x03 \x01(\tB\x03\xe0\x41\x02\"\xd9\x01\n\x1f\x43reateNotificationConfigRequest\x12H\n\x06parent\x18\x01 \x01(\tB8\xe0\x41\x02\xfa\x41\x32\x12\x30securitycenter.googleapis.com/NotificationConfig\x12\x16\n\tconfig_id\x18\x02 \x01(\tB\x03\xe0\x41\x02\x12T\n\x13notification_config\x18\x03 \x01(\x0b\x32\x32.google.cloud.securitycenter.v2.NotificationConfigB\x03\xe0\x41\x02\"\xc6\x01\n CreateResourceValueConfigRequest\x12I\n\x06parent\x18\x01 \x01(\tB9\xe0\x41\x02\xfa\x41\x33\x12\x31securitycenter.googleapis.com/ResourceValueConfig\x12W\n\x15resource_value_config\x18\x02 \x01(\x0b\x32\x33.google.cloud.securitycenter.v2.ResourceValueConfigB\x03\xe0\x41\x02\"\x9c\x01\n\x13\x43reateSourceRequest\x12H\n\x06parent\x18\x01 \x01(\tB8\xe0\x41\x02\xfa\x41\x32\n0cloudresourcemanager.googleapis.com/Organization\x12;\n\x06source\x18\x02 \x01(\x0b\x32&.google.cloud.securitycenter.v2.SourceB\x03\xe0\x41\x02\"a\n\x1b\x44\x65leteBigQueryExportRequest\x12\x42\n\x04name\x18\x01 \x01(\tB4\xe0\x41\x02\xfa\x41.\n,securitycenter.googleapis.com/BigQueryExport\"Y\n\x17\x44\x65leteMuteConfigRequest\x12>\n\x04name\x18\x01 \x01(\tB0\xe0\x41\x02\xfa\x41*\n(securitycenter.googleapis.com/MuteConfig\"i\n\x1f\x44\x65leteNotificationConfigRequest\x12\x46\n\x04name\x18\x01 \x01(\tB8\xe0\x41\x02\xfa\x41\x32\n0securitycenter.googleapis.com/NotificationConfig\"k\n DeleteResourceValueConfigRequest\x12G\n\x04name\x18\x01 \x01(\tB9\xe0\x41\x02\xfa\x41\x33\n1securitycenter.googleapis.com/ResourceValueConfig\"+\n\x13\x42igQueryDestination\x12\x14\n\x07\x64\x61taset\x18\x01 \x01(\tB\x03\xe0\x41\x02\"\xbe\x01\n\x16\x45xportFindingsMetadata\x12:\n\x11\x65xport_start_time\x18\x01 \x01(\x0b\x32\x1a.google.protobuf.TimestampB\x03\xe0\x41\x01\x12Y\n\x15\x62ig_query_destination\x18\x02 \x01(\x0b\x32\x33.google.cloud.securitycenter.v2.BigQueryDestinationB\x03\xe0\x41\x02H\x00\x42\r\n\x0b\x64\x65stination\"\x18\n\x16\x45xportFindingsResponse\"^\n\x18GetBigQueryExportRequest\x12\x42\n\x04name\x18\x01 \x01(\tB4\xe0\x41\x02\xfa\x41.\n,securitycenter.googleapis.com/BigQueryExport\"V\n\x14GetMuteConfigRequest\x12>\n\x04name\x18\x01 \x01(\tB0\xe0\x41\x02\xfa\x41*\n(securitycenter.googleapis.com/MuteConfig\"f\n\x1cGetNotificationConfigRequest\x12\x46\n\x04name\x18\x01 \x01(\tB8\xe0\x41\x02\xfa\x41\x32\n0securitycenter.googleapis.com/NotificationConfig\"h\n\x1dGetResourceValueConfigRequest\x12G\n\x04name\x18\x01 \x01(\tB9\xe0\x41\x02\xfa\x41\x33\n1securitycenter.googleapis.com/ResourceValueConfig\"N\n\x10GetSourceRequest\x12:\n\x04name\x18\x01 \x01(\tB,\xe0\x41\x02\xfa\x41&\n$securitycenter.googleapis.com/Source\"\xa2\x01\n\x14GroupFindingsRequest\x12<\n\x06parent\x18\x01 \x01(\tB,\xe0\x41\x02\xfa\x41&\n$securitycenter.googleapis.com/Source\x12\x0e\n\x06\x66ilter\x18\x02 \x01(\t\x12\x15\n\x08group_by\x18\x03 \x01(\tB\x03\xe0\x41\x02\x12\x12\n\npage_token\x18\x07 \x01(\t\x12\x11\n\tpage_size\x18\x08 \x01(\x05\"\x8b\x01\n\x15GroupFindingsResponse\x12\x45\n\x10group_by_results\x18\x01 \x03(\x0b\x32+.google.cloud.securitycenter.v2.GroupResult\x12\x17\n\x0fnext_page_token\x18\x03 \x01(\t\x12\x12\n\ntotal_size\x18\x04 \x01(\x05\"\xb8\x01\n\x0bGroupResult\x12O\n\nproperties\x18\x01 \x03(\x0b\x32;.google.cloud.securitycenter.v2.GroupResult.PropertiesEntry\x12\r\n\x05\x63ount\x18\x02 \x01(\x03\x1aI\n\x0fPropertiesEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12%\n\x05value\x18\x02 \x01(\x0b\x32\x16.google.protobuf.Value:\x02\x38\x01\"\x91\x01\n\x16ListAttackPathsRequest\x12@\n\x06parent\x18\x01 \x01(\tB0\xe0\x41\x02\xfa\x41*\x12(securitycenter.googleapis.com/AttackPath\x12\x0e\n\x06\x66ilter\x18\x02 \x01(\t\x12\x12\n\npage_token\x18\x03 \x01(\t\x12\x11\n\tpage_size\x18\x04 \x01(\x05\"t\n\x17ListAttackPathsResponse\x12@\n\x0c\x61ttack_paths\x18\x01 \x03(\x0b\x32*.google.cloud.securitycenter.v2.AttackPath\x12\x17\n\x0fnext_page_token\x18\x02 \x01(\t\"V\n\x14GetSimulationRequest\x12>\n\x04name\x18\x01 \x01(\tB0\xe0\x41\x02\xfa\x41*\n(securitycenter.googleapis.com/Simulation\"^\n\x18GetValuedResourceRequest\x12\x42\n\x04name\x18\x01 \x01(\tB4\xe0\x41\x02\xfa\x41.\n,securitycenter.googleapis.com/ValuedResource\"\x89\x01\n\x1aListBigQueryExportsRequest\x12\x44\n\x06parent\x18\x01 \x01(\tB4\xe0\x41\x02\xfa\x41.\x12,securitycenter.googleapis.com/BigQueryExport\x12\x11\n\tpage_size\x18\x02 \x01(\x05\x12\x12\n\npage_token\x18\x03 \x01(\t\"\x81\x01\n\x1bListBigQueryExportsResponse\x12I\n\x11\x62ig_query_exports\x18\x01 \x03(\x0b\x32..google.cloud.securitycenter.v2.BigQueryExport\x12\x17\n\x0fnext_page_token\x18\x02 \x01(\t\"\xcc\x01\n\x13ListFindingsRequest\x12<\n\x06parent\x18\x01 \x01(\tB,\xe0\x41\x02\xfa\x41&\n$securitycenter.googleapis.com/Source\x12\x0e\n\x06\x66ilter\x18\x02 \x01(\t\x12\x10\n\x08order_by\x18\x03 \x01(\t\x12.\n\nfield_mask\x18\x07 \x01(\x0b\x32\x1a.google.protobuf.FieldMask\x12\x12\n\npage_token\x18\x08 \x01(\t\x12\x11\n\tpage_size\x18\t \x01(\x05\"\xdf\x06\n\x14ListFindingsResponse\x12\x66\n\x15list_findings_results\x18\x01 \x03(\x0b\x32G.google.cloud.securitycenter.v2.ListFindingsResponse.ListFindingsResult\x12\x17\n\x0fnext_page_token\x18\x03 \x01(\t\x12\x12\n\ntotal_size\x18\x04 \x01(\x05\x1a\xb1\x05\n\x12ListFindingsResult\x12\x38\n\x07\x66inding\x18\x01 \x01(\x0b\x32\'.google.cloud.securitycenter.v2.Finding\x12g\n\x08resource\x18\x03 \x01(\x0b\x32P.google.cloud.securitycenter.v2.ListFindingsResponse.ListFindingsResult.ResourceB\x03\xe0\x41\x03\x1a\xf7\x03\n\x08Resource\x12\x0c\n\x04name\x18\x01 \x01(\t\x12\x14\n\x0c\x64isplay_name\x18\x02 \x01(\t\x12\x0c\n\x04type\x18\x03 \x01(\t\x12\x45\n\x0e\x63loud_provider\x18\x04 \x01(\x0e\x32-.google.cloud.securitycenter.v2.CloudProvider\x12\x0f\n\x07service\x18\x05 \x01(\t\x12\x10\n\x08location\x18\x06 \x01(\t\x12\x43\n\x0cgcp_metadata\x18\x07 \x01(\x0b\x32+.google.cloud.securitycenter.v2.GcpMetadataH\x00\x12\x43\n\x0c\x61ws_metadata\x18\x08 \x01(\x0b\x32+.google.cloud.securitycenter.v2.AwsMetadataH\x00\x12G\n\x0e\x61zure_metadata\x18\t \x01(\x0b\x32-.google.cloud.securitycenter.v2.AzureMetadataH\x00\x12\x43\n\rresource_path\x18\n \x01(\x0b\x32,.google.cloud.securitycenter.v2.ResourcePath\x12\x1c\n\x14resource_path_string\x18\x0b \x01(\tB\x19\n\x17\x63loud_provider_metadata\"\x81\x01\n\x16ListMuteConfigsRequest\x12@\n\x06parent\x18\x01 \x01(\tB0\xe0\x41\x02\xfa\x41*\x12(securitycenter.googleapis.com/MuteConfig\x12\x11\n\tpage_size\x18\x02 \x01(\x05\x12\x12\n\npage_token\x18\x03 \x01(\t\"t\n\x17ListMuteConfigsResponse\x12@\n\x0cmute_configs\x18\x01 \x03(\x0b\x32*.google.cloud.securitycenter.v2.MuteConfig\x12\x17\n\x0fnext_page_token\x18\x02 \x01(\t\"\x91\x01\n\x1eListNotificationConfigsRequest\x12H\n\x06parent\x18\x01 \x01(\tB8\xe0\x41\x02\xfa\x41\x32\x12\x30securitycenter.googleapis.com/NotificationConfig\x12\x12\n\npage_token\x18\x02 \x01(\t\x12\x11\n\tpage_size\x18\x03 \x01(\x05\"\x8c\x01\n\x1fListNotificationConfigsResponse\x12P\n\x14notification_configs\x18\x01 \x03(\x0b\x32\x32.google.cloud.securitycenter.v2.NotificationConfig\x12\x17\n\x0fnext_page_token\x18\x02 \x01(\t\"\x93\x01\n\x1fListResourceValueConfigsRequest\x12I\n\x06parent\x18\x01 \x01(\tB9\xe0\x41\x02\xfa\x41\x33\x12\x31securitycenter.googleapis.com/ResourceValueConfig\x12\x11\n\tpage_size\x18\x02 \x01(\x05\x12\x12\n\npage_token\x18\x03 \x01(\t\"\x90\x01\n ListResourceValueConfigsResponse\x12S\n\x16resource_value_configs\x18\x01 \x03(\x0b\x32\x33.google.cloud.securitycenter.v2.ResourceValueConfig\x12\x17\n\x0fnext_page_token\x18\x02 \x01(\t\"y\n\x12ListSourcesRequest\x12<\n\x06parent\x18\x01 \x01(\tB,\xe0\x41\x02\xfa\x41&\x12$securitycenter.googleapis.com/Source\x12\x12\n\npage_token\x18\x02 \x01(\t\x12\x11\n\tpage_size\x18\x07 \x01(\x05\"g\n\x13ListSourcesResponse\x12\x37\n\x07sources\x18\x01 \x03(\x0b\x32&.google.cloud.securitycenter.v2.Source\x12\x17\n\x0fnext_page_token\x18\x02 \x01(\t\"\xb0\x01\n\x1aListValuedResourcesRequest\x12\x44\n\x06parent\x18\x01 \x01(\tB4\xe0\x41\x02\xfa\x41.\x12,securitycenter.googleapis.com/ValuedResource\x12\x0e\n\x06\x66ilter\x18\x02 \x01(\t\x12\x12\n\npage_token\x18\x03 \x01(\t\x12\x11\n\tpage_size\x18\x04 \x01(\x05\x12\x15\n\x08order_by\x18\x05 \x01(\tB\x03\xe0\x41\x01\"\x94\x01\n\x1bListValuedResourcesResponse\x12H\n\x10valued_resources\x18\x01 \x03(\x0b\x32..google.cloud.securitycenter.v2.ValuedResource\x12\x17\n\x0fnext_page_token\x18\x02 \x01(\t\x12\x12\n\ntotal_size\x18\x03 \x01(\x05\"\x98\x01\n\x16SetFindingStateRequest\x12;\n\x04name\x18\x01 \x01(\tB-\xe0\x41\x02\xfa\x41\'\n%securitycenter.googleapis.com/Finding\x12\x41\n\x05state\x18\x02 \x01(\x0e\x32-.google.cloud.securitycenter.v2.Finding.StateB\x03\xe0\x41\x02\"\x8e\x01\n\x0eSetMuteRequest\x12;\n\x04name\x18\x01 \x01(\tB-\xe0\x41\x02\xfa\x41\'\n%securitycenter.googleapis.com/Finding\x12?\n\x04mute\x18\x02 \x01(\x0e\x32,.google.cloud.securitycenter.v2.Finding.MuteB\x03\xe0\x41\x02\"\x9d\x01\n\x1bUpdateBigQueryExportRequest\x12M\n\x10\x62ig_query_export\x18\x01 \x01(\x0b\x32..google.cloud.securitycenter.v2.BigQueryExportB\x03\xe0\x41\x02\x12/\n\x0bupdate_mask\x18\x02 \x01(\x0b\x32\x1a.google.protobuf.FieldMask\"\x9c\x01\n\x1bUpdateExternalSystemRequest\x12L\n\x0f\x65xternal_system\x18\x01 \x01(\x0b\x32..google.cloud.securitycenter.v2.ExternalSystemB\x03\xe0\x41\x02\x12/\n\x0bupdate_mask\x18\x02 \x01(\x0b\x32\x1a.google.protobuf.FieldMask\"\x86\x01\n\x14UpdateFindingRequest\x12=\n\x07\x66inding\x18\x01 \x01(\x0b\x32\'.google.cloud.securitycenter.v2.FindingB\x03\xe0\x41\x02\x12/\n\x0bupdate_mask\x18\x02 \x01(\x0b\x32\x1a.google.protobuf.FieldMask\"\x90\x01\n\x17UpdateMuteConfigRequest\x12\x44\n\x0bmute_config\x18\x01 \x01(\x0b\x32*.google.cloud.securitycenter.v2.MuteConfigB\x03\xe0\x41\x02\x12/\n\x0bupdate_mask\x18\x02 \x01(\x0b\x32\x1a.google.protobuf.FieldMask\"\xa8\x01\n\x1fUpdateNotificationConfigRequest\x12T\n\x13notification_config\x18\x01 \x01(\x0b\x32\x32.google.cloud.securitycenter.v2.NotificationConfigB\x03\xe0\x41\x02\x12/\n\x0bupdate_mask\x18\x02 \x01(\x0b\x32\x1a.google.protobuf.FieldMask\"\xac\x01\n UpdateResourceValueConfigRequest\x12W\n\x15resource_value_config\x18\x01 \x01(\x0b\x32\x33.google.cloud.securitycenter.v2.ResourceValueConfigB\x03\xe0\x41\x02\x12/\n\x0bupdate_mask\x18\x02 \x01(\x0b\x32\x1a.google.protobuf.FieldMask\"\x99\x01\n\x1aUpdateSecurityMarksRequest\x12J\n\x0esecurity_marks\x18\x01 \x01(\x0b\x32-.google.cloud.securitycenter.v2.SecurityMarksB\x03\xe0\x41\x02\x12/\n\x0bupdate_mask\x18\x02 \x01(\x0b\x32\x1a.google.protobuf.FieldMask\"\x83\x01\n\x13UpdateSourceRequest\x12;\n\x06source\x18\x01 \x01(\x0b\x32&.google.cloud.securitycenter.v2.SourceB\x03\xe0\x41\x02\x12/\n\x0bupdate_mask\x18\x02 \x01(\x0b\x32\x1a.google.protobuf.FieldMask2\xe2\x81\x01\n\x0eSecurityCenter\x12\xe0\x02\n\x1f\x42\x61tchCreateResourceValueConfigs\x12\x46.google.cloud.securitycenter.v2.BatchCreateResourceValueConfigsRequest\x1aG.google.cloud.securitycenter.v2.BatchCreateResourceValueConfigsResponse\"\xab\x01\xda\x41\x0fparent,requests\x82\xd3\xe4\x93\x02\x92\x01\"=/v2/{parent=organizations/*}/resourceValueConfigs:batchCreate:\x01*ZN\"I/v2/{parent=organizations/*/locations/*}/resourceValueConfigs:batchCreate:\x01*\x12\x9a\x04\n\x10\x42ulkMuteFindings\x12\x37.google.cloud.securitycenter.v2.BulkMuteFindingsRequest\x1a\x1d.google.longrunning.Operation\"\xad\x03\xca\x41P\n7google.cloud.securitycenter.v2.BulkMuteFindingsResponse\x12\x15google.protobuf.Empty\xda\x41\x06parent\x82\xd3\xe4\x93\x02\xca\x02\"./v2/{parent=organizations/*}/findings:bulkMute:\x01*Z?\":/v2/{parent=organizations/*/locations/*}/findings:bulkMute:\x01*Z-\"(/v2/{parent=folders/*}/findings:bulkMute:\x01*Z9\"4/v2/{parent=folders/*/locations/*}/findings:bulkMute:\x01*Z.\")/v2/{parent=projects/*}/findings:bulkMute:\x01*Z:\"5/v2/{parent=projects/*/locations/*}/findings:bulkMute:\x01*\x12\x98\x03\n\x14\x43reateBigQueryExport\x12;.google.cloud.securitycenter.v2.CreateBigQueryExportRequest\x1a..google.cloud.securitycenter.v2.BigQueryExport\"\x92\x02\xda\x41+parent,big_query_export,big_query_export_id\x82\xd3\xe4\x93\x02\xdd\x01\"8/v2/{parent=organizations/*/locations/*}/bigQueryExports:\x10\x62ig_query_exportZF\"2/v2/{parent=folders/*/locations/*}/bigQueryExports:\x10\x62ig_query_exportZG\"3/v2/{parent=projects/*/locations/*}/bigQueryExports:\x10\x62ig_query_export\x12\x96\x02\n\rCreateFinding\x12\x34.google.cloud.securitycenter.v2.CreateFindingRequest\x1a\'.google.cloud.securitycenter.v2.Finding\"\xa5\x01\xda\x41\x19parent,finding,finding_id\x82\xd3\xe4\x93\x02\x82\x01\";/v2/{parent=organizations/*/sources/*/locations/*}/findings:\x07\x66indingZ:\"//v2/{parent=organizations/*/sources/*}/findings:\x07\x66inding\x12\x99\x05\n\x10\x43reateMuteConfig\x12\x37.google.cloud.securitycenter.v2.CreateMuteConfigRequest\x1a*.google.cloud.securitycenter.v2.MuteConfig\"\x9f\x04\xda\x41!parent,mute_config,mute_config_id\x82\xd3\xe4\x93\x02\xe2\x02\"4/v2/{parent=organizations/*/locations/*}/muteConfigs:\x0bmute_configZ=\"./v2/{parent=folders/*/locations/*}/muteConfigs:\x0bmute_configZ>\"//v2/{parent=projects/*/locations/*}/muteConfigs:\x0bmute_configZ7\"(/v2/{parent=organizations/*}/muteConfigs:\x0bmute_configZ1\"\"/v2/{parent=folders/*}/muteConfigs:\x0bmute_configZ2\"#/v2/{parent=projects/*}/muteConfigs:\x0bmute_config\x8a\xd3\xe4\x93\x02\x8b\x01\x12+\n\x06parent\x12!projects/*/locations/{location=*}\x12\x30\n\x06parent\x12&organizations/*/locations/{location=*}\x12*\n\x06parent\x12 folders/*/locations/{location=*}\x12\xb2\x03\n\x18\x43reateNotificationConfig\x12?.google.cloud.securitycenter.v2.CreateNotificationConfigRequest\x1a\x32.google.cloud.securitycenter.v2.NotificationConfig\"\xa0\x02\xda\x41$parent,notification_config,config_id\x82\xd3\xe4\x93\x02\xf2\x01\".google.cloud.securitycenter.v2.ListNotificationConfigsRequest\x1a?.google.cloud.securitycenter.v2.ListNotificationConfigsResponse\"\xc3\x01\xda\x41\x06parent\x82\xd3\xe4\x93\x02\xb3\x01\x12/v2/{name=folders/*/sources/*/locations/*/findings/*}:setState:\x01*Z8\"3/v2/{name=projects/*/sources/*/findings/*}:setState:\x01*ZD\"?/v2/{name=projects/*/sources/*/locations/*/findings/*}:setState:\x01*\x12\x9d\x01\n\x0cSetIamPolicy\x12\".google.iam.v1.SetIamPolicyRequest\x1a\x15.google.iam.v1.Policy\"R\xda\x41\x0fresource,policy\x82\xd3\xe4\x93\x02:\"5/v2/{resource=organizations/*/sources/*}:setIamPolicy:\x01*\x12\xf8\x03\n\x07SetMute\x12..google.cloud.securitycenter.v2.SetMuteRequest\x1a\'.google.cloud.securitycenter.v2.Finding\"\x93\x03\xda\x41\tname,mute\x82\xd3\xe4\x93\x02\x80\x03\"7/v2/{name=organizations/*/sources/*/findings/*}:setMute:\x01*ZH\"C/v2/{name=organizations/*/sources/*/locations/*/findings/*}:setMute:\x01*Z6\"1/v2/{name=folders/*/sources/*/findings/*}:setMute:\x01*ZB\"=/v2/{name=folders/*/sources/*/locations/*/findings/*}:setMute:\x01*Z7\"2/v2/{name=projects/*/sources/*/findings/*}:setMute:\x01*ZC\">/v2/{name=projects/*/sources/*/locations/*/findings/*}:setMute:\x01*\x12\xc8\x01\n\x12TestIamPermissions\x12(.google.iam.v1.TestIamPermissionsRequest\x1a).google.iam.v1.TestIamPermissionsResponse\"]\xda\x41\x14resource,permissions\x82\xd3\xe4\x93\x02@\";/v2/{resource=organizations/*/sources/*}:testIamPermissions:\x01*\x12\xbc\x03\n\x14UpdateBigQueryExport\x12;.google.cloud.securitycenter.v2.UpdateBigQueryExportRequest\x1a..google.cloud.securitycenter.v2.BigQueryExport\"\xb6\x02\xda\x41\x1c\x62ig_query_export,update_mask\x82\xd3\xe4\x93\x02\x90\x02\x32I/v2/{big_query_export.name=organizations/*/locations/*/bigQueryExports/*}:\x10\x62ig_query_exportZW2C/v2/{big_query_export.name=folders/*/locations/*/bigQueryExports/*}:\x10\x62ig_query_exportZX2D/v2/{big_query_export.name=projects/*/locations/*/bigQueryExports/*}:\x10\x62ig_query_export\x12\x9b\x06\n\x14UpdateExternalSystem\x12;.google.cloud.securitycenter.v2.UpdateExternalSystemRequest\x1a..google.cloud.securitycenter.v2.ExternalSystem\"\x95\x05\xda\x41\x1b\x65xternal_system,update_mask\x82\xd3\xe4\x93\x02\xf0\x04\x32Q/v2/{external_system.name=organizations/*/sources/*/findings/*/externalSystems/*}:\x0f\x65xternal_systemZp2]/v2/{external_system.name=organizations/*/sources/*/locations/*/findings/*/externalSystems/*}:\x0f\x65xternal_systemZ^2K/v2/{external_system.name=folders/*/sources/*/findings/*/externalSystems/*}:\x0f\x65xternal_systemZj2W/v2/{external_system.name=folders/*/sources/*/locations/*/findings/*/externalSystems/*}:\x0f\x65xternal_systemZ_2L/v2/{external_system.name=projects/*/sources/*/findings/*/externalSystems/*}:\x0f\x65xternal_systemZk2X/v2/{external_system.name=projects/*/sources/*/locations/*/findings/*/externalSystems/*}:\x0f\x65xternal_system\x12\xb2\x04\n\rUpdateFinding\x12\x34.google.cloud.securitycenter.v2.UpdateFindingRequest\x1a\'.google.cloud.securitycenter.v2.Finding\"\xc1\x03\xda\x41\x13\x66inding,update_mask\x82\xd3\xe4\x93\x02\xa4\x03\x32\x37/v2/{finding.name=organizations/*/sources/*/findings/*}:\x07\x66indingZN2C/v2/{finding.name=organizations/*/sources/*/locations/*/findings/*}:\x07\x66indingZ<21/v2/{finding.name=folders/*/sources/*/findings/*}:\x07\x66indingZH2=/v2/{finding.name=folders/*/sources/*/locations/*/findings/*}:\x07\x66indingZ=22/v2/{finding.name=projects/*/sources/*/findings/*}:\x07\x66indingZI2>/v2/{finding.name=projects/*/sources/*/locations/*/findings/*}:\x07\x66inding\x12\x9f\x06\n\x10UpdateMuteConfig\x12\x37.google.cloud.securitycenter.v2.UpdateMuteConfigRequest\x1a*.google.cloud.securitycenter.v2.MuteConfig\"\xa5\x05\xda\x41\x17mute_config,update_mask\x82\xd3\xe4\x93\x02\xaa\x03\x32\x34/v2/{mute_config.name=organizations/*/muteConfigs/*}:\x0bmute_configZO2@/v2/{mute_config.name=organizations/*/locations/*/muteConfigs/*}:\x0bmute_configZ=2./v2/{mute_config.name=folders/*/muteConfigs/*}:\x0bmute_configZI2:/v2/{mute_config.name=folders/*/locations/*/muteConfigs/*}:\x0bmute_configZ>2//v2/{mute_config.name=projects/*/muteConfigs/*}:\x0bmute_configZJ2;/v2/{mute_config.name=projects/*/locations/*/muteConfigs/*}:\x0bmute_config\x8a\xd3\xe4\x93\x02\xd3\x01\x12\x43\n\x10mute_config.name\x12/projects/*/locations/{location=*}/muteConfigs/*\x12H\n\x10mute_config.name\x12\x34organizations/*/locations/{location=*}/muteConfigs/*\x12\x42\n\x10mute_config.name\x12.folders/*/locations/{location=*}/muteConfigs/*\x12\xe9\x03\n\x18UpdateNotificationConfig\x12?.google.cloud.securitycenter.v2.UpdateNotificationConfigRequest\x1a\x32.google.cloud.securitycenter.v2.NotificationConfig\"\xd7\x02\xda\x41\x1fnotification_config,update_mask\x82\xd3\xe4\x93\x02\xae\x02\x32P/v2/{notification_config.name=organizations/*/locations/*/notificationConfigs/*}:\x13notification_configZa2J/v2/{notification_config.name=folders/*/locations/*/notificationConfigs/*}:\x13notification_configZb2K/v2/{notification_config.name=projects/*/locations/*/notificationConfigs/*}:\x13notification_config\x12\x8e\x03\n\x19UpdateResourceValueConfig\x12@.google.cloud.securitycenter.v2.UpdateResourceValueConfigRequest\x1a\x33.google.cloud.securitycenter.v2.ResourceValueConfig\"\xf9\x01\xda\x41!resource_value_config,update_mask\x82\xd3\xe4\x93\x02\xce\x01\x32G/v2/{resource_value_config.name=organizations/*/resourceValueConfigs/*}:\x15resource_value_configZl2S/v2/{resource_value_config.name=organizations/*/locations/*/resourceValueConfigs/*}:\x15resource_value_config\x12\xe4\x07\n\x13UpdateSecurityMarks\x12:.google.cloud.securitycenter.v2.UpdateSecurityMarksRequest\x1a-.google.cloud.securitycenter.v2.SecurityMarks\"\xe1\x06\xda\x41\x1asecurity_marks,update_mask\x82\xd3\xe4\x93\x02\xbd\x06\x32L/v2/{security_marks.name=organizations/*/sources/*/findings/*/securityMarks}:\x0esecurity_marksZR2@/v2/{security_marks.name=organizations/*/assets/*/securityMarks}:\x0esecurity_marksZj2X/v2/{security_marks.name=organizations/*/sources/*/locations/*/findings/*/securityMarks}:\x0esecurity_marksZX2F/v2/{security_marks.name=folders/*/sources/*/findings/*/securityMarks}:\x0esecurity_marksZL2:/v2/{security_marks.name=folders/*/assets/*/securityMarks}:\x0esecurity_marksZd2R/v2/{security_marks.name=folders/*/sources/*/locations/*/findings/*/securityMarks}:\x0esecurity_marksZY2G/v2/{security_marks.name=projects/*/sources/*/findings/*/securityMarks}:\x0esecurity_marksZM2;/v2/{security_marks.name=projects/*/assets/*/securityMarks}:\x0esecurity_marksZe2S/v2/{security_marks.name=projects/*/sources/*/locations/*/findings/*/securityMarks}:\x0esecurity_marks\x12\xbd\x01\n\x0cUpdateSource\x12\x33.google.cloud.securitycenter.v2.UpdateSourceRequest\x1a&.google.cloud.securitycenter.v2.Source\"P\xda\x41\x12source,update_mask\x82\xd3\xe4\x93\x02\x35\x32+/v2/{source.name=organizations/*/sources/*}:\x06source\x1aQ\xca\x41\x1dsecuritycenter.googleapis.com\xd2\x41.https://www.googleapis.com/auth/cloud-platformB\xe2\x04\n\"com.google.cloud.securitycenter.v2B\x1aSecuritycenterServiceProtoP\x01ZJcloud.google.com/go/securitycenter/apiv2/securitycenterpb;securitycenterpb\xaa\x02\x1eGoogle.Cloud.SecurityCenter.V2\xca\x02\x1eGoogle\\Cloud\\SecurityCenter\\V2\xea\x02!Google::Cloud::SecurityCenter::V2\xea\x41g\n2securitycenter.googleapis.com/OrganizationLocation\x12\x31organizations/{organization}/locations/{location}\xea\x41U\n,securitycenter.googleapis.com/FolderLocation\x12%folders/{folder}/locations/{location}\xea\x41\xa8\x01\n8securitycenter.googleapis.com/OrganizationValuedResource\x12lorganizations/{organization}/locations/{location}/simulations/{simulation}/valuedResources/{valued_resource}b\x06proto3" - -pool = ::Google::Protobuf::DescriptorPool.generated_pool -pool.add_serialized_file(descriptor_data) - -module Google - module Cloud - module SecurityCenter - module V2 - BatchCreateResourceValueConfigsRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.securitycenter.v2.BatchCreateResourceValueConfigsRequest").msgclass - BatchCreateResourceValueConfigsResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.securitycenter.v2.BatchCreateResourceValueConfigsResponse").msgclass - BulkMuteFindingsRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.securitycenter.v2.BulkMuteFindingsRequest").msgclass - BulkMuteFindingsRequest::MuteState = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.securitycenter.v2.BulkMuteFindingsRequest.MuteState").enummodule - BulkMuteFindingsResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.securitycenter.v2.BulkMuteFindingsResponse").msgclass - CreateBigQueryExportRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.securitycenter.v2.CreateBigQueryExportRequest").msgclass - CreateFindingRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.securitycenter.v2.CreateFindingRequest").msgclass - CreateMuteConfigRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.securitycenter.v2.CreateMuteConfigRequest").msgclass - CreateNotificationConfigRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.securitycenter.v2.CreateNotificationConfigRequest").msgclass - CreateResourceValueConfigRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.securitycenter.v2.CreateResourceValueConfigRequest").msgclass - CreateSourceRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.securitycenter.v2.CreateSourceRequest").msgclass - DeleteBigQueryExportRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.securitycenter.v2.DeleteBigQueryExportRequest").msgclass - DeleteMuteConfigRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.securitycenter.v2.DeleteMuteConfigRequest").msgclass - DeleteNotificationConfigRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.securitycenter.v2.DeleteNotificationConfigRequest").msgclass - DeleteResourceValueConfigRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.securitycenter.v2.DeleteResourceValueConfigRequest").msgclass - BigQueryDestination = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.securitycenter.v2.BigQueryDestination").msgclass - ExportFindingsMetadata = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.securitycenter.v2.ExportFindingsMetadata").msgclass - ExportFindingsResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.securitycenter.v2.ExportFindingsResponse").msgclass - GetBigQueryExportRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.securitycenter.v2.GetBigQueryExportRequest").msgclass - GetMuteConfigRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.securitycenter.v2.GetMuteConfigRequest").msgclass - GetNotificationConfigRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.securitycenter.v2.GetNotificationConfigRequest").msgclass - GetResourceValueConfigRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.securitycenter.v2.GetResourceValueConfigRequest").msgclass - GetSourceRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.securitycenter.v2.GetSourceRequest").msgclass - GroupFindingsRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.securitycenter.v2.GroupFindingsRequest").msgclass - GroupFindingsResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.securitycenter.v2.GroupFindingsResponse").msgclass - GroupResult = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.securitycenter.v2.GroupResult").msgclass - ListAttackPathsRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.securitycenter.v2.ListAttackPathsRequest").msgclass - ListAttackPathsResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.securitycenter.v2.ListAttackPathsResponse").msgclass - GetSimulationRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.securitycenter.v2.GetSimulationRequest").msgclass - GetValuedResourceRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.securitycenter.v2.GetValuedResourceRequest").msgclass - ListBigQueryExportsRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.securitycenter.v2.ListBigQueryExportsRequest").msgclass - ListBigQueryExportsResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.securitycenter.v2.ListBigQueryExportsResponse").msgclass - ListFindingsRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.securitycenter.v2.ListFindingsRequest").msgclass - ListFindingsResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.securitycenter.v2.ListFindingsResponse").msgclass - ListFindingsResponse::ListFindingsResult = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.securitycenter.v2.ListFindingsResponse.ListFindingsResult").msgclass - ListFindingsResponse::ListFindingsResult::Resource = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.securitycenter.v2.ListFindingsResponse.ListFindingsResult.Resource").msgclass - ListMuteConfigsRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.securitycenter.v2.ListMuteConfigsRequest").msgclass - ListMuteConfigsResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.securitycenter.v2.ListMuteConfigsResponse").msgclass - ListNotificationConfigsRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.securitycenter.v2.ListNotificationConfigsRequest").msgclass - ListNotificationConfigsResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.securitycenter.v2.ListNotificationConfigsResponse").msgclass - ListResourceValueConfigsRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.securitycenter.v2.ListResourceValueConfigsRequest").msgclass - ListResourceValueConfigsResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.securitycenter.v2.ListResourceValueConfigsResponse").msgclass - ListSourcesRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.securitycenter.v2.ListSourcesRequest").msgclass - ListSourcesResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.securitycenter.v2.ListSourcesResponse").msgclass - ListValuedResourcesRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.securitycenter.v2.ListValuedResourcesRequest").msgclass - ListValuedResourcesResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.securitycenter.v2.ListValuedResourcesResponse").msgclass - SetFindingStateRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.securitycenter.v2.SetFindingStateRequest").msgclass - SetMuteRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.securitycenter.v2.SetMuteRequest").msgclass - UpdateBigQueryExportRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.securitycenter.v2.UpdateBigQueryExportRequest").msgclass - UpdateExternalSystemRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.securitycenter.v2.UpdateExternalSystemRequest").msgclass - UpdateFindingRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.securitycenter.v2.UpdateFindingRequest").msgclass - UpdateMuteConfigRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.securitycenter.v2.UpdateMuteConfigRequest").msgclass - UpdateNotificationConfigRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.securitycenter.v2.UpdateNotificationConfigRequest").msgclass - UpdateResourceValueConfigRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.securitycenter.v2.UpdateResourceValueConfigRequest").msgclass - UpdateSecurityMarksRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.securitycenter.v2.UpdateSecurityMarksRequest").msgclass - UpdateSourceRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.securitycenter.v2.UpdateSourceRequest").msgclass - end - end - end -end diff --git a/owl-bot-staging/google-cloud-security_center-v2/lib/google/cloud/securitycenter/v2/securitycenter_service_services_pb.rb b/owl-bot-staging/google-cloud-security_center-v2/lib/google/cloud/securitycenter/v2/securitycenter_service_services_pb.rb deleted file mode 100644 index 36c3f5bae249..000000000000 --- a/owl-bot-staging/google-cloud-security_center-v2/lib/google/cloud/securitycenter/v2/securitycenter_service_services_pb.rb +++ /dev/null @@ -1,167 +0,0 @@ -# Generated by the protocol buffer compiler. DO NOT EDIT! -# Source: google/cloud/securitycenter/v2/securitycenter_service.proto for package 'Google.Cloud.SecurityCenter.V2' -# Original file comments: -# 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 -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. -# - -require 'grpc' -require 'google/cloud/securitycenter/v2/securitycenter_service_pb' - -module Google - module Cloud - module SecurityCenter - module V2 - module SecurityCenter - # V2 APIs for Security Center service. - class Service - - include ::GRPC::GenericService - - self.marshal_class_method = :encode - self.unmarshal_class_method = :decode - self.service_name = 'google.cloud.securitycenter.v2.SecurityCenter' - - # Creates a ResourceValueConfig for an organization. Maps user's tags to - # difference resource values for use by the attack path simulation. - rpc :BatchCreateResourceValueConfigs, ::Google::Cloud::SecurityCenter::V2::BatchCreateResourceValueConfigsRequest, ::Google::Cloud::SecurityCenter::V2::BatchCreateResourceValueConfigsResponse - # Kicks off an LRO to bulk mute findings for a parent based on a filter. If - # no location is specified, findings are muted in global. The parent - # can be either an organization, folder, or project. The findings matched by - # the filter will be muted after the LRO is done. - rpc :BulkMuteFindings, ::Google::Cloud::SecurityCenter::V2::BulkMuteFindingsRequest, ::Google::Longrunning::Operation - # Creates a BigQuery export. - rpc :CreateBigQueryExport, ::Google::Cloud::SecurityCenter::V2::CreateBigQueryExportRequest, ::Google::Cloud::SecurityCenter::V2::BigQueryExport - # Creates a finding in a location. The corresponding source must exist for - # finding creation to succeed. - rpc :CreateFinding, ::Google::Cloud::SecurityCenter::V2::CreateFindingRequest, ::Google::Cloud::SecurityCenter::V2::Finding - # Creates a mute config. - rpc :CreateMuteConfig, ::Google::Cloud::SecurityCenter::V2::CreateMuteConfigRequest, ::Google::Cloud::SecurityCenter::V2::MuteConfig - # Creates a notification config. - rpc :CreateNotificationConfig, ::Google::Cloud::SecurityCenter::V2::CreateNotificationConfigRequest, ::Google::Cloud::SecurityCenter::V2::NotificationConfig - # Creates a source. - rpc :CreateSource, ::Google::Cloud::SecurityCenter::V2::CreateSourceRequest, ::Google::Cloud::SecurityCenter::V2::Source - # Deletes an existing BigQuery export. - rpc :DeleteBigQueryExport, ::Google::Cloud::SecurityCenter::V2::DeleteBigQueryExportRequest, ::Google::Protobuf::Empty - # Deletes an existing mute config. If no location is specified, default is - # global. - rpc :DeleteMuteConfig, ::Google::Cloud::SecurityCenter::V2::DeleteMuteConfigRequest, ::Google::Protobuf::Empty - # Deletes a notification config. - rpc :DeleteNotificationConfig, ::Google::Cloud::SecurityCenter::V2::DeleteNotificationConfigRequest, ::Google::Protobuf::Empty - # Deletes a ResourceValueConfig. - rpc :DeleteResourceValueConfig, ::Google::Cloud::SecurityCenter::V2::DeleteResourceValueConfigRequest, ::Google::Protobuf::Empty - # Gets a BigQuery export. - rpc :GetBigQueryExport, ::Google::Cloud::SecurityCenter::V2::GetBigQueryExportRequest, ::Google::Cloud::SecurityCenter::V2::BigQueryExport - # Get the simulation by name or the latest simulation for the given - # organization. - rpc :GetSimulation, ::Google::Cloud::SecurityCenter::V2::GetSimulationRequest, ::Google::Cloud::SecurityCenter::V2::Simulation - # Get the valued resource by name - rpc :GetValuedResource, ::Google::Cloud::SecurityCenter::V2::GetValuedResourceRequest, ::Google::Cloud::SecurityCenter::V2::ValuedResource - # Gets the access control policy on the specified Source. - rpc :GetIamPolicy, ::Google::Iam::V1::GetIamPolicyRequest, ::Google::Iam::V1::Policy - # Gets a mute config. If no location is specified, default is - # global. - rpc :GetMuteConfig, ::Google::Cloud::SecurityCenter::V2::GetMuteConfigRequest, ::Google::Cloud::SecurityCenter::V2::MuteConfig - # Gets a notification config. - rpc :GetNotificationConfig, ::Google::Cloud::SecurityCenter::V2::GetNotificationConfigRequest, ::Google::Cloud::SecurityCenter::V2::NotificationConfig - # Gets a ResourceValueConfig. - rpc :GetResourceValueConfig, ::Google::Cloud::SecurityCenter::V2::GetResourceValueConfigRequest, ::Google::Cloud::SecurityCenter::V2::ResourceValueConfig - # Gets a source. - rpc :GetSource, ::Google::Cloud::SecurityCenter::V2::GetSourceRequest, ::Google::Cloud::SecurityCenter::V2::Source - # Filters an organization or source's findings and groups them by their - # specified properties in a location. If no location is specified, findings - # are assumed to be in global - # - # To group across all sources provide a `-` as the source id. - # The following list shows some examples: - # - # + `/v2/organizations/{organization_id}/sources/-/findings` - # + - # `/v2/organizations/{organization_id}/sources/-/locations/{location_id}/findings` - # + `/v2/folders/{folder_id}/sources/-/findings` - # + `/v2/folders/{folder_id}/sources/-/locations/{location_id}/findings` - # + `/v2/projects/{project_id}/sources/-/findings` - # + `/v2/projects/{project_id}/sources/-/locations/{location_id}/findings` - rpc :GroupFindings, ::Google::Cloud::SecurityCenter::V2::GroupFindingsRequest, ::Google::Cloud::SecurityCenter::V2::GroupFindingsResponse - # Lists the attack paths for a set of simulation results or valued resources - # and filter. - rpc :ListAttackPaths, ::Google::Cloud::SecurityCenter::V2::ListAttackPathsRequest, ::Google::Cloud::SecurityCenter::V2::ListAttackPathsResponse - # Lists BigQuery exports. Note that when requesting BigQuery exports at a - # given level all exports under that level are also returned e.g. if - # requesting BigQuery exports under a folder, then all BigQuery exports - # immediately under the folder plus the ones created under the projects - # within the folder are returned. - rpc :ListBigQueryExports, ::Google::Cloud::SecurityCenter::V2::ListBigQueryExportsRequest, ::Google::Cloud::SecurityCenter::V2::ListBigQueryExportsResponse - # Lists an organization or source's findings. - # - # To list across all sources for a given location provide a `-` as the source - # id. If no location is specified, finding are assumed to be in global. - # The following list shows some examples: - # - # + `/v2/organizations/{organization_id}/sources/-/findings` - # + - # `/v2/organizations/{organization_id}/sources/-/locations/{location_id}/findings` - rpc :ListFindings, ::Google::Cloud::SecurityCenter::V2::ListFindingsRequest, ::Google::Cloud::SecurityCenter::V2::ListFindingsResponse - # Lists mute configs. If no location is specified, default is - # global. - rpc :ListMuteConfigs, ::Google::Cloud::SecurityCenter::V2::ListMuteConfigsRequest, ::Google::Cloud::SecurityCenter::V2::ListMuteConfigsResponse - # Lists notification configs. - rpc :ListNotificationConfigs, ::Google::Cloud::SecurityCenter::V2::ListNotificationConfigsRequest, ::Google::Cloud::SecurityCenter::V2::ListNotificationConfigsResponse - # Lists all ResourceValueConfigs. - rpc :ListResourceValueConfigs, ::Google::Cloud::SecurityCenter::V2::ListResourceValueConfigsRequest, ::Google::Cloud::SecurityCenter::V2::ListResourceValueConfigsResponse - # Lists all sources belonging to an organization. - rpc :ListSources, ::Google::Cloud::SecurityCenter::V2::ListSourcesRequest, ::Google::Cloud::SecurityCenter::V2::ListSourcesResponse - # Lists the valued resources for a set of simulation results and filter. - rpc :ListValuedResources, ::Google::Cloud::SecurityCenter::V2::ListValuedResourcesRequest, ::Google::Cloud::SecurityCenter::V2::ListValuedResourcesResponse - # Updates the state of a finding. If no location is specified, finding is - # assumed to be in global - rpc :SetFindingState, ::Google::Cloud::SecurityCenter::V2::SetFindingStateRequest, ::Google::Cloud::SecurityCenter::V2::Finding - # Sets the access control policy on the specified Source. - rpc :SetIamPolicy, ::Google::Iam::V1::SetIamPolicyRequest, ::Google::Iam::V1::Policy - # Updates the mute state of a finding. If no location is specified, finding - # is assumed to be in global - rpc :SetMute, ::Google::Cloud::SecurityCenter::V2::SetMuteRequest, ::Google::Cloud::SecurityCenter::V2::Finding - # Returns the permissions that a caller has on the specified source. - rpc :TestIamPermissions, ::Google::Iam::V1::TestIamPermissionsRequest, ::Google::Iam::V1::TestIamPermissionsResponse - # Updates a BigQuery export. - rpc :UpdateBigQueryExport, ::Google::Cloud::SecurityCenter::V2::UpdateBigQueryExportRequest, ::Google::Cloud::SecurityCenter::V2::BigQueryExport - # Updates external system. This is for a given finding. If no location is - # specified, finding is assumed to be in global - rpc :UpdateExternalSystem, ::Google::Cloud::SecurityCenter::V2::UpdateExternalSystemRequest, ::Google::Cloud::SecurityCenter::V2::ExternalSystem - # Creates or updates a finding. If no location is specified, finding is - # assumed to be in global. The corresponding source must exist for a finding - # creation to succeed. - rpc :UpdateFinding, ::Google::Cloud::SecurityCenter::V2::UpdateFindingRequest, ::Google::Cloud::SecurityCenter::V2::Finding - # Updates a mute config. If no location is specified, default is - # global. - rpc :UpdateMuteConfig, ::Google::Cloud::SecurityCenter::V2::UpdateMuteConfigRequest, ::Google::Cloud::SecurityCenter::V2::MuteConfig - # Updates a notification config. The following update - # fields are allowed: description, pubsub_topic, streaming_config.filter - rpc :UpdateNotificationConfig, ::Google::Cloud::SecurityCenter::V2::UpdateNotificationConfigRequest, ::Google::Cloud::SecurityCenter::V2::NotificationConfig - # Updates an existing ResourceValueConfigs with new rules. - rpc :UpdateResourceValueConfig, ::Google::Cloud::SecurityCenter::V2::UpdateResourceValueConfigRequest, ::Google::Cloud::SecurityCenter::V2::ResourceValueConfig - # Updates security marks. For Finding Security marks, if no location is - # specified, finding is assumed to be in global. Assets Security Marks can - # only be accessed through global endpoint. - rpc :UpdateSecurityMarks, ::Google::Cloud::SecurityCenter::V2::UpdateSecurityMarksRequest, ::Google::Cloud::SecurityCenter::V2::SecurityMarks - # Updates a source. - rpc :UpdateSource, ::Google::Cloud::SecurityCenter::V2::UpdateSourceRequest, ::Google::Cloud::SecurityCenter::V2::Source - end - - Stub = Service.rpc_stub_class - end - end - end - end -end diff --git a/owl-bot-staging/google-cloud-security_center-v2/lib/google/cloud/securitycenter/v2/simulation_pb.rb b/owl-bot-staging/google-cloud-security_center-v2/lib/google/cloud/securitycenter/v2/simulation_pb.rb deleted file mode 100644 index 7ffa40f95f0a..000000000000 --- a/owl-bot-staging/google-cloud-security_center-v2/lib/google/cloud/securitycenter/v2/simulation_pb.rb +++ /dev/null @@ -1,27 +0,0 @@ -# frozen_string_literal: true -# Generated by the protocol buffer compiler. DO NOT EDIT! -# source: google/cloud/securitycenter/v2/simulation.proto - -require 'google/protobuf' - -require 'google/api/field_behavior_pb' -require 'google/api/resource_pb' -require 'google/cloud/securitycenter/v2/resource_pb' -require 'google/cloud/securitycenter/v2/valued_resource_pb' -require 'google/protobuf/timestamp_pb' - - -descriptor_data = "\n/google/cloud/securitycenter/v2/simulation.proto\x12\x1egoogle.cloud.securitycenter.v2\x1a\x1fgoogle/api/field_behavior.proto\x1a\x19google/api/resource.proto\x1a-google/cloud/securitycenter/v2/resource.proto\x1a\x34google/cloud/securitycenter/v2/valued_resource.proto\x1a\x1fgoogle/protobuf/timestamp.proto\"\xca\x03\n\nSimulation\x12\x0c\n\x04name\x18\x01 \x01(\t\x12\x34\n\x0b\x63reate_time\x18\x02 \x01(\x0b\x32\x1a.google.protobuf.TimestampB\x03\xe0\x41\x03\x12\x64\n\x1fresource_value_configs_metadata\x18\x03 \x03(\x0b\x32;.google.cloud.securitycenter.v2.ResourceValueConfigMetadata\x12\x45\n\x0e\x63loud_provider\x18\x04 \x01(\x0e\x32-.google.cloud.securitycenter.v2.CloudProvider:\xca\x01\xea\x41\xc6\x01\n(securitycenter.googleapis.com/Simulation\x12\x35organizations/{organization}/simulations/{simulation}\x12Jorganizations/{organization}/locations/{location}/simulations/{simluation}*\x0bsimulations2\nsimulationB\xe9\x01\n\"com.google.cloud.securitycenter.v2B\x0fSimulationProtoP\x01ZJcloud.google.com/go/securitycenter/apiv2/securitycenterpb;securitycenterpb\xaa\x02\x1eGoogle.Cloud.SecurityCenter.V2\xca\x02\x1eGoogle\\Cloud\\SecurityCenter\\V2\xea\x02!Google::Cloud::SecurityCenter::V2b\x06proto3" - -pool = ::Google::Protobuf::DescriptorPool.generated_pool -pool.add_serialized_file(descriptor_data) - -module Google - module Cloud - module SecurityCenter - module V2 - Simulation = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.securitycenter.v2.Simulation").msgclass - end - end - end -end diff --git a/owl-bot-staging/google-cloud-security_center-v2/lib/google/cloud/securitycenter/v2/source_pb.rb b/owl-bot-staging/google-cloud-security_center-v2/lib/google/cloud/securitycenter/v2/source_pb.rb deleted file mode 100644 index 073204318455..000000000000 --- a/owl-bot-staging/google-cloud-security_center-v2/lib/google/cloud/securitycenter/v2/source_pb.rb +++ /dev/null @@ -1,23 +0,0 @@ -# frozen_string_literal: true -# Generated by the protocol buffer compiler. DO NOT EDIT! -# source: google/cloud/securitycenter/v2/source.proto - -require 'google/protobuf' - -require 'google/api/resource_pb' - - -descriptor_data = "\n+google/cloud/securitycenter/v2/source.proto\x12\x1egoogle.cloud.securitycenter.v2\x1a\x19google/api/resource.proto\"\xfd\x01\n\x06Source\x12\x0c\n\x04name\x18\x01 \x01(\t\x12\x14\n\x0c\x64isplay_name\x18\x02 \x01(\t\x12\x13\n\x0b\x64\x65scription\x18\x03 \x01(\t\x12\x16\n\x0e\x63\x61nonical_name\x18\x04 \x01(\t:\xa1\x01\xea\x41\x9d\x01\n$securitycenter.googleapis.com/Source\x12-organizations/{organization}/sources/{source}\x12!folders/{folder}/sources/{source}\x12#projects/{project}/sources/{source}B\xe5\x01\n\"com.google.cloud.securitycenter.v2B\x0bSourceProtoP\x01ZJcloud.google.com/go/securitycenter/apiv2/securitycenterpb;securitycenterpb\xaa\x02\x1eGoogle.Cloud.SecurityCenter.V2\xca\x02\x1eGoogle\\Cloud\\SecurityCenter\\V2\xea\x02!Google::Cloud::SecurityCenter::V2b\x06proto3" - -pool = ::Google::Protobuf::DescriptorPool.generated_pool -pool.add_serialized_file(descriptor_data) - -module Google - module Cloud - module SecurityCenter - module V2 - Source = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.securitycenter.v2.Source").msgclass - end - end - end -end diff --git a/owl-bot-staging/google-cloud-security_center-v2/lib/google/cloud/securitycenter/v2/toxic_combination_pb.rb b/owl-bot-staging/google-cloud-security_center-v2/lib/google/cloud/securitycenter/v2/toxic_combination_pb.rb deleted file mode 100644 index 7096e7b98ac2..000000000000 --- a/owl-bot-staging/google-cloud-security_center-v2/lib/google/cloud/securitycenter/v2/toxic_combination_pb.rb +++ /dev/null @@ -1,21 +0,0 @@ -# frozen_string_literal: true -# Generated by the protocol buffer compiler. DO NOT EDIT! -# source: google/cloud/securitycenter/v2/toxic_combination.proto - -require 'google/protobuf' - - -descriptor_data = "\n6google/cloud/securitycenter/v2/toxic_combination.proto\x12\x1egoogle.cloud.securitycenter.v2\"K\n\x10ToxicCombination\x12\x1d\n\x15\x61ttack_exposure_score\x18\x01 \x01(\x01\x12\x18\n\x10related_findings\x18\x02 \x03(\tB\xef\x01\n\"com.google.cloud.securitycenter.v2B\x15ToxicCombinationProtoP\x01ZJcloud.google.com/go/securitycenter/apiv2/securitycenterpb;securitycenterpb\xaa\x02\x1eGoogle.Cloud.SecurityCenter.V2\xca\x02\x1eGoogle\\Cloud\\SecurityCenter\\V2\xea\x02!Google::Cloud::SecurityCenter::V2b\x06proto3" - -pool = ::Google::Protobuf::DescriptorPool.generated_pool -pool.add_serialized_file(descriptor_data) - -module Google - module Cloud - module SecurityCenter - module V2 - ToxicCombination = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.securitycenter.v2.ToxicCombination").msgclass - end - end - end -end diff --git a/owl-bot-staging/google-cloud-security_center-v2/lib/google/cloud/securitycenter/v2/valued_resource_pb.rb b/owl-bot-staging/google-cloud-security_center-v2/lib/google/cloud/securitycenter/v2/valued_resource_pb.rb deleted file mode 100644 index b7df23211efc..000000000000 --- a/owl-bot-staging/google-cloud-security_center-v2/lib/google/cloud/securitycenter/v2/valued_resource_pb.rb +++ /dev/null @@ -1,25 +0,0 @@ -# frozen_string_literal: true -# Generated by the protocol buffer compiler. DO NOT EDIT! -# source: google/cloud/securitycenter/v2/valued_resource.proto - -require 'google/protobuf' - -require 'google/api/resource_pb' - - -descriptor_data = "\n4google/cloud/securitycenter/v2/valued_resource.proto\x12\x1egoogle.cloud.securitycenter.v2\x1a\x19google/api/resource.proto\"\xc6\x05\n\x0eValuedResource\x12\x0c\n\x04name\x18\x01 \x01(\t\x12\x10\n\x08resource\x18\x02 \x01(\t\x12\x15\n\rresource_type\x18\x03 \x01(\t\x12\x14\n\x0c\x64isplay_name\x18\x04 \x01(\t\x12T\n\x0eresource_value\x18\x05 \x01(\x0e\x32<.google.cloud.securitycenter.v2.ValuedResource.ResourceValue\x12\x15\n\rexposed_score\x18\x06 \x01(\x01\x12`\n\x1bresource_value_configs_used\x18\x07 \x03(\x0b\x32;.google.cloud.securitycenter.v2.ResourceValueConfigMetadata\"{\n\rResourceValue\x12\x1e\n\x1aRESOURCE_VALUE_UNSPECIFIED\x10\x00\x12\x16\n\x12RESOURCE_VALUE_LOW\x10\x01\x12\x19\n\x15RESOURCE_VALUE_MEDIUM\x10\x02\x12\x17\n\x13RESOURCE_VALUE_HIGH\x10\x03:\x9a\x02\xea\x41\x96\x02\n,securitycenter.googleapis.com/ValuedResource\x12Worganizations/{organization}/simulations/{simulation}/valuedResources/{valued_resource}\x12lorganizations/{organization}/locations/{location}/simulations/{simluation}/valuedResources/{valued_resource}*\x0fvaluedResources2\x0evaluedResource\"+\n\x1bResourceValueConfigMetadata\x12\x0c\n\x04name\x18\x01 \x01(\tB\xed\x01\n\"com.google.cloud.securitycenter.v2B\x13ValuedResourceProtoP\x01ZJcloud.google.com/go/securitycenter/apiv2/securitycenterpb;securitycenterpb\xaa\x02\x1eGoogle.Cloud.SecurityCenter.V2\xca\x02\x1eGoogle\\Cloud\\SecurityCenter\\V2\xea\x02!Google::Cloud::SecurityCenter::V2b\x06proto3" - -pool = ::Google::Protobuf::DescriptorPool.generated_pool -pool.add_serialized_file(descriptor_data) - -module Google - module Cloud - module SecurityCenter - module V2 - ValuedResource = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.securitycenter.v2.ValuedResource").msgclass - ValuedResource::ResourceValue = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.securitycenter.v2.ValuedResource.ResourceValue").enummodule - ResourceValueConfigMetadata = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.securitycenter.v2.ResourceValueConfigMetadata").msgclass - end - end - end -end diff --git a/owl-bot-staging/google-cloud-security_center-v2/lib/google/cloud/securitycenter/v2/vertex_ai_pb.rb b/owl-bot-staging/google-cloud-security_center-v2/lib/google/cloud/securitycenter/v2/vertex_ai_pb.rb deleted file mode 100644 index 00ccbb3b5a21..000000000000 --- a/owl-bot-staging/google-cloud-security_center-v2/lib/google/cloud/securitycenter/v2/vertex_ai_pb.rb +++ /dev/null @@ -1,23 +0,0 @@ -# frozen_string_literal: true -# Generated by the protocol buffer compiler. DO NOT EDIT! -# source: google/cloud/securitycenter/v2/vertex_ai.proto - -require 'google/protobuf' - - -descriptor_data = "\n.google/cloud/securitycenter/v2/vertex_ai.proto\x12\x1egoogle.cloud.securitycenter.v2\"\x83\x02\n\x08VertexAi\x12\x42\n\x08\x64\x61tasets\x18\x01 \x03(\x0b\x32\x30.google.cloud.securitycenter.v2.VertexAi.Dataset\x12\x44\n\tpipelines\x18\x02 \x03(\x0b\x32\x31.google.cloud.securitycenter.v2.VertexAi.Pipeline\x1a=\n\x07\x44\x61taset\x12\x0c\n\x04name\x18\x01 \x01(\t\x12\x14\n\x0c\x64isplay_name\x18\x02 \x01(\t\x12\x0e\n\x06source\x18\x03 \x01(\t\x1a.\n\x08Pipeline\x12\x0c\n\x04name\x18\x01 \x01(\t\x12\x14\n\x0c\x64isplay_name\x18\x02 \x01(\tB\xe7\x01\n\"com.google.cloud.securitycenter.v2B\rVertexAiProtoP\x01ZJcloud.google.com/go/securitycenter/apiv2/securitycenterpb;securitycenterpb\xaa\x02\x1eGoogle.Cloud.SecurityCenter.V2\xca\x02\x1eGoogle\\Cloud\\SecurityCenter\\V2\xea\x02!Google::Cloud::SecurityCenter::V2b\x06proto3" - -pool = ::Google::Protobuf::DescriptorPool.generated_pool -pool.add_serialized_file(descriptor_data) - -module Google - module Cloud - module SecurityCenter - module V2 - VertexAi = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.securitycenter.v2.VertexAi").msgclass - VertexAi::Dataset = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.securitycenter.v2.VertexAi.Dataset").msgclass - VertexAi::Pipeline = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.securitycenter.v2.VertexAi.Pipeline").msgclass - end - end - end -end diff --git a/owl-bot-staging/google-cloud-security_center-v2/lib/google/cloud/securitycenter/v2/vulnerability_pb.rb b/owl-bot-staging/google-cloud-security_center-v2/lib/google/cloud/securitycenter/v2/vulnerability_pb.rb deleted file mode 100644 index deb4b635f6df..000000000000 --- a/owl-bot-staging/google-cloud-security_center-v2/lib/google/cloud/securitycenter/v2/vulnerability_pb.rb +++ /dev/null @@ -1,37 +0,0 @@ -# frozen_string_literal: true -# Generated by the protocol buffer compiler. DO NOT EDIT! -# source: google/cloud/securitycenter/v2/vulnerability.proto - -require 'google/protobuf' - -require 'google/protobuf/timestamp_pb' - - -descriptor_data = "\n2google/cloud/securitycenter/v2/vulnerability.proto\x12\x1egoogle.cloud.securitycenter.v2\x1a\x1fgoogle/protobuf/timestamp.proto\"\xf5\x02\n\rVulnerability\x12\x30\n\x03\x63ve\x18\x01 \x01(\x0b\x32#.google.cloud.securitycenter.v2.Cve\x12\x42\n\x11offending_package\x18\x02 \x01(\x0b\x32\'.google.cloud.securitycenter.v2.Package\x12>\n\rfixed_package\x18\x03 \x01(\x0b\x32\'.google.cloud.securitycenter.v2.Package\x12K\n\x11security_bulletin\x18\x04 \x01(\x0b\x32\x30.google.cloud.securitycenter.v2.SecurityBulletin\x12\x1b\n\x13provider_risk_score\x18\x05 \x01(\x03\x12\x11\n\treachable\x18\x06 \x01(\x08\x12\x31\n\x04\x63wes\x18\x07 \x03(\x0b\x32#.google.cloud.securitycenter.v2.Cwe\"\xc7\x05\n\x03\x43ve\x12\n\n\x02id\x18\x01 \x01(\t\x12=\n\nreferences\x18\x02 \x03(\x0b\x32).google.cloud.securitycenter.v2.Reference\x12\x36\n\x06\x63vssv3\x18\x03 \x01(\x0b\x32&.google.cloud.securitycenter.v2.Cvssv3\x12\x1e\n\x16upstream_fix_available\x18\x04 \x01(\x08\x12>\n\x06impact\x18\x05 \x01(\x0e\x32..google.cloud.securitycenter.v2.Cve.RiskRating\x12W\n\x15\x65xploitation_activity\x18\x06 \x01(\x0e\x32\x38.google.cloud.securitycenter.v2.Cve.ExploitationActivity\x12\x1c\n\x14observed_in_the_wild\x18\x07 \x01(\x08\x12\x10\n\x08zero_day\x18\x08 \x01(\x08\x12\x38\n\x14\x65xploit_release_date\x18\t \x01(\x0b\x32\x1a.google.protobuf.Timestamp\x12;\n\x17\x66irst_exploitation_date\x18\n \x01(\x0b\x32\x1a.google.protobuf.Timestamp\"V\n\nRiskRating\x12\x1b\n\x17RISK_RATING_UNSPECIFIED\x10\x00\x12\x07\n\x03LOW\x10\x01\x12\n\n\x06MEDIUM\x10\x02\x12\x08\n\x04HIGH\x10\x03\x12\x0c\n\x08\x43RITICAL\x10\x04\"\x84\x01\n\x14\x45xploitationActivity\x12%\n!EXPLOITATION_ACTIVITY_UNSPECIFIED\x10\x00\x12\x08\n\x04WIDE\x10\x01\x12\r\n\tCONFIRMED\x10\x02\x12\r\n\tAVAILABLE\x10\x03\x12\x0f\n\x0b\x41NTICIPATED\x10\x04\x12\x0c\n\x08NO_KNOWN\x10\x05\"(\n\tReference\x12\x0e\n\x06source\x18\x01 \x01(\t\x12\x0b\n\x03uri\x18\x02 \x01(\t\"\xb1\n\n\x06\x43vssv3\x12\x12\n\nbase_score\x18\x01 \x01(\x01\x12J\n\rattack_vector\x18\x02 \x01(\x0e\x32\x33.google.cloud.securitycenter.v2.Cvssv3.AttackVector\x12R\n\x11\x61ttack_complexity\x18\x03 \x01(\x0e\x32\x37.google.cloud.securitycenter.v2.Cvssv3.AttackComplexity\x12V\n\x13privileges_required\x18\x04 \x01(\x0e\x32\x39.google.cloud.securitycenter.v2.Cvssv3.PrivilegesRequired\x12P\n\x10user_interaction\x18\x05 \x01(\x0e\x32\x36.google.cloud.securitycenter.v2.Cvssv3.UserInteraction\x12;\n\x05scope\x18\x06 \x01(\x0e\x32,.google.cloud.securitycenter.v2.Cvssv3.Scope\x12M\n\x16\x63onfidentiality_impact\x18\x07 \x01(\x0e\x32-.google.cloud.securitycenter.v2.Cvssv3.Impact\x12G\n\x10integrity_impact\x18\x08 \x01(\x0e\x32-.google.cloud.securitycenter.v2.Cvssv3.Impact\x12J\n\x13\x61vailability_impact\x18\t \x01(\x0e\x32-.google.cloud.securitycenter.v2.Cvssv3.Impact\"\x99\x01\n\x0c\x41ttackVector\x12\x1d\n\x19\x41TTACK_VECTOR_UNSPECIFIED\x10\x00\x12\x19\n\x15\x41TTACK_VECTOR_NETWORK\x10\x01\x12\x1a\n\x16\x41TTACK_VECTOR_ADJACENT\x10\x02\x12\x17\n\x13\x41TTACK_VECTOR_LOCAL\x10\x03\x12\x1a\n\x16\x41TTACK_VECTOR_PHYSICAL\x10\x04\"l\n\x10\x41ttackComplexity\x12!\n\x1d\x41TTACK_COMPLEXITY_UNSPECIFIED\x10\x00\x12\x19\n\x15\x41TTACK_COMPLEXITY_LOW\x10\x01\x12\x1a\n\x16\x41TTACK_COMPLEXITY_HIGH\x10\x02\"\x92\x01\n\x12PrivilegesRequired\x12#\n\x1fPRIVILEGES_REQUIRED_UNSPECIFIED\x10\x00\x12\x1c\n\x18PRIVILEGES_REQUIRED_NONE\x10\x01\x12\x1b\n\x17PRIVILEGES_REQUIRED_LOW\x10\x02\x12\x1c\n\x18PRIVILEGES_REQUIRED_HIGH\x10\x03\"m\n\x0fUserInteraction\x12 \n\x1cUSER_INTERACTION_UNSPECIFIED\x10\x00\x12\x19\n\x15USER_INTERACTION_NONE\x10\x01\x12\x1d\n\x19USER_INTERACTION_REQUIRED\x10\x02\"F\n\x05Scope\x12\x15\n\x11SCOPE_UNSPECIFIED\x10\x00\x12\x13\n\x0fSCOPE_UNCHANGED\x10\x01\x12\x11\n\rSCOPE_CHANGED\x10\x02\"R\n\x06Impact\x12\x16\n\x12IMPACT_UNSPECIFIED\x10\x00\x12\x0f\n\x0bIMPACT_HIGH\x10\x01\x12\x0e\n\nIMPACT_LOW\x10\x02\x12\x0f\n\x0bIMPACT_NONE\x10\x03\"_\n\x07Package\x12\x14\n\x0cpackage_name\x18\x01 \x01(\t\x12\x0f\n\x07\x63pe_uri\x18\x02 \x01(\t\x12\x14\n\x0cpackage_type\x18\x03 \x01(\t\x12\x17\n\x0fpackage_version\x18\x04 \x01(\t\"\x7f\n\x10SecurityBulletin\x12\x13\n\x0b\x62ulletin_id\x18\x01 \x01(\t\x12\x33\n\x0fsubmission_time\x18\x02 \x01(\x0b\x32\x1a.google.protobuf.Timestamp\x12!\n\x19suggested_upgrade_version\x18\x03 \x01(\t\"P\n\x03\x43we\x12\n\n\x02id\x18\x01 \x01(\t\x12=\n\nreferences\x18\x02 \x03(\x0b\x32).google.cloud.securitycenter.v2.ReferenceB\xec\x01\n\"com.google.cloud.securitycenter.v2B\x12VulnerabilityProtoP\x01ZJcloud.google.com/go/securitycenter/apiv2/securitycenterpb;securitycenterpb\xaa\x02\x1eGoogle.Cloud.SecurityCenter.V2\xca\x02\x1eGoogle\\Cloud\\SecurityCenter\\V2\xea\x02!Google::Cloud::SecurityCenter::V2b\x06proto3" - -pool = ::Google::Protobuf::DescriptorPool.generated_pool -pool.add_serialized_file(descriptor_data) - -module Google - module Cloud - module SecurityCenter - module V2 - Vulnerability = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.securitycenter.v2.Vulnerability").msgclass - Cve = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.securitycenter.v2.Cve").msgclass - Cve::RiskRating = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.securitycenter.v2.Cve.RiskRating").enummodule - Cve::ExploitationActivity = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.securitycenter.v2.Cve.ExploitationActivity").enummodule - Reference = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.securitycenter.v2.Reference").msgclass - Cvssv3 = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.securitycenter.v2.Cvssv3").msgclass - Cvssv3::AttackVector = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.securitycenter.v2.Cvssv3.AttackVector").enummodule - Cvssv3::AttackComplexity = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.securitycenter.v2.Cvssv3.AttackComplexity").enummodule - Cvssv3::PrivilegesRequired = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.securitycenter.v2.Cvssv3.PrivilegesRequired").enummodule - Cvssv3::UserInteraction = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.securitycenter.v2.Cvssv3.UserInteraction").enummodule - Cvssv3::Scope = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.securitycenter.v2.Cvssv3.Scope").enummodule - Cvssv3::Impact = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.securitycenter.v2.Cvssv3.Impact").enummodule - Package = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.securitycenter.v2.Package").msgclass - SecurityBulletin = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.securitycenter.v2.SecurityBulletin").msgclass - Cwe = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.securitycenter.v2.Cwe").msgclass - end - end - end -end diff --git a/owl-bot-staging/google-cloud-security_center-v2/proto_docs/README.md b/owl-bot-staging/google-cloud-security_center-v2/proto_docs/README.md deleted file mode 100644 index c8ec50fdacaa..000000000000 --- a/owl-bot-staging/google-cloud-security_center-v2/proto_docs/README.md +++ /dev/null @@ -1,4 +0,0 @@ -# Security Command Center V2 Protocol Buffer Documentation - -These files are for the YARD documentation of the generated protobuf files. -They are not intended to be required or loaded at runtime. diff --git a/owl-bot-staging/google-cloud-security_center-v2/proto_docs/google/api/client.rb b/owl-bot-staging/google-cloud-security_center-v2/proto_docs/google/api/client.rb deleted file mode 100644 index 5089551e9ea4..000000000000 --- a/owl-bot-staging/google-cloud-security_center-v2/proto_docs/google/api/client.rb +++ /dev/null @@ -1,589 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - - -module Google - module Api - # Required information for every language. - # @!attribute [rw] reference_docs_uri - # @deprecated This field is deprecated and may be removed in the next major version update. - # @return [::String] - # Link to automatically generated reference documentation. Example: - # https://cloud.google.com/nodejs/docs/reference/asset/latest - # @!attribute [rw] destinations - # @return [::Array<::Google::Api::ClientLibraryDestination>] - # The destination where API teams want this client library to be published. - # @!attribute [rw] selective_gapic_generation - # @return [::Google::Api::SelectiveGapicGeneration] - # Configuration for which RPCs should be generated in the GAPIC client. - class CommonLanguageSettings - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Details about how and where to publish client libraries. - # @!attribute [rw] version - # @return [::String] - # Version of the API to apply these settings to. This is the full protobuf - # package for the API, ending in the version element. - # Examples: "google.cloud.speech.v1" and "google.spanner.admin.database.v1". - # @!attribute [rw] launch_stage - # @return [::Google::Api::LaunchStage] - # Launch stage of this version of the API. - # @!attribute [rw] rest_numeric_enums - # @return [::Boolean] - # When using transport=rest, the client request will encode enums as - # numbers rather than strings. - # @!attribute [rw] java_settings - # @return [::Google::Api::JavaSettings] - # Settings for legacy Java features, supported in the Service YAML. - # @!attribute [rw] cpp_settings - # @return [::Google::Api::CppSettings] - # Settings for C++ client libraries. - # @!attribute [rw] php_settings - # @return [::Google::Api::PhpSettings] - # Settings for PHP client libraries. - # @!attribute [rw] python_settings - # @return [::Google::Api::PythonSettings] - # Settings for Python client libraries. - # @!attribute [rw] node_settings - # @return [::Google::Api::NodeSettings] - # Settings for Node client libraries. - # @!attribute [rw] dotnet_settings - # @return [::Google::Api::DotnetSettings] - # Settings for .NET client libraries. - # @!attribute [rw] ruby_settings - # @return [::Google::Api::RubySettings] - # Settings for Ruby client libraries. - # @!attribute [rw] go_settings - # @return [::Google::Api::GoSettings] - # Settings for Go client libraries. - class ClientLibrarySettings - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # This message configures the settings for publishing [Google Cloud Client - # libraries](https://cloud.google.com/apis/docs/cloud-client-libraries) - # generated from the service config. - # @!attribute [rw] method_settings - # @return [::Array<::Google::Api::MethodSettings>] - # A list of API method settings, e.g. the behavior for methods that use the - # long-running operation pattern. - # @!attribute [rw] new_issue_uri - # @return [::String] - # Link to a *public* URI where users can report issues. Example: - # https://issuetracker.google.com/issues/new?component=190865&template=1161103 - # @!attribute [rw] documentation_uri - # @return [::String] - # Link to product home page. Example: - # https://cloud.google.com/asset-inventory/docs/overview - # @!attribute [rw] api_short_name - # @return [::String] - # Used as a tracking tag when collecting data about the APIs developer - # relations artifacts like docs, packages delivered to package managers, - # etc. Example: "speech". - # @!attribute [rw] github_label - # @return [::String] - # GitHub label to apply to issues and pull requests opened for this API. - # @!attribute [rw] codeowner_github_teams - # @return [::Array<::String>] - # GitHub teams to be added to CODEOWNERS in the directory in GitHub - # containing source code for the client libraries for this API. - # @!attribute [rw] doc_tag_prefix - # @return [::String] - # A prefix used in sample code when demarking regions to be included in - # documentation. - # @!attribute [rw] organization - # @return [::Google::Api::ClientLibraryOrganization] - # For whom the client library is being published. - # @!attribute [rw] library_settings - # @return [::Array<::Google::Api::ClientLibrarySettings>] - # Client library settings. If the same version string appears multiple - # times in this list, then the last one wins. Settings from earlier - # settings with the same version string are discarded. - # @!attribute [rw] proto_reference_documentation_uri - # @return [::String] - # Optional link to proto reference documentation. Example: - # https://cloud.google.com/pubsub/lite/docs/reference/rpc - # @!attribute [rw] rest_reference_documentation_uri - # @return [::String] - # Optional link to REST reference documentation. Example: - # https://cloud.google.com/pubsub/lite/docs/reference/rest - class Publishing - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Settings for Java client libraries. - # @!attribute [rw] library_package - # @return [::String] - # The package name to use in Java. Clobbers the java_package option - # set in the protobuf. This should be used **only** by APIs - # who have already set the language_settings.java.package_name" field - # in gapic.yaml. API teams should use the protobuf java_package option - # where possible. - # - # Example of a YAML configuration:: - # - # publishing: - # 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. - # @!attribute [rw] methods - # @return [::Array<::String>] - # An allowlist of the fully qualified names of RPCs that should be included - # on public client surfaces. - # @!attribute [rw] generate_omitted_as_internal - # @return [::Boolean] - # Setting this to true indicates to the client generators that methods - # that would be excluded from the generation should instead be generated - # in a way that indicates these methods should not be consumed by - # end users. How this is expressed is up to individual language - # implementations to decide. Some examples may be: added annotations, - # obfuscated identifiers, or other language idiomatic patterns. - class SelectiveGapicGeneration - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # `BatchingConfigProto` defines the batching configuration for an API method. - # @!attribute [rw] thresholds - # @return [::Google::Api::BatchingSettingsProto] - # The thresholds which trigger a batched request to be sent. - # @!attribute [rw] batch_descriptor - # @return [::Google::Api::BatchingDescriptorProto] - # The request and response fields used in batching. - class BatchingConfigProto - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # `BatchingSettingsProto` specifies a set of batching thresholds, each of - # which acts as a trigger to send a batch of messages as a request. At least - # one threshold must be positive nonzero. - # @!attribute [rw] element_count_threshold - # @return [::Integer] - # The number of elements of a field collected into a batch which, if - # exceeded, causes the batch to be sent. - # @!attribute [rw] request_byte_threshold - # @return [::Integer] - # The aggregated size of the batched field which, if exceeded, causes the - # batch to be sent. This size is computed by aggregating the sizes of the - # request field to be batched, not of the entire request message. - # @!attribute [rw] delay_threshold - # @return [::Google::Protobuf::Duration] - # The duration after which a batch should be sent, starting from the addition - # of the first message to that batch. - # @!attribute [rw] element_count_limit - # @return [::Integer] - # The maximum number of elements collected in a batch that could be accepted - # by server. - # @!attribute [rw] request_byte_limit - # @return [::Integer] - # The maximum size of the request that could be accepted by server. - # @!attribute [rw] flow_control_element_limit - # @return [::Integer] - # The maximum number of elements allowed by flow control. - # @!attribute [rw] flow_control_byte_limit - # @return [::Integer] - # The maximum size of data allowed by flow control. - # @!attribute [rw] flow_control_limit_exceeded_behavior - # @return [::Google::Api::FlowControlLimitExceededBehaviorProto] - # The behavior to take when the flow control limit is exceeded. - class BatchingSettingsProto - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # `BatchingDescriptorProto` specifies the fields of the request message to be - # used for batching, and, optionally, the fields of the response message to be - # used for demultiplexing. - # @!attribute [rw] batched_field - # @return [::String] - # The repeated field in the request message to be aggregated by batching. - # @!attribute [rw] discriminator_fields - # @return [::Array<::String>] - # A list of the fields in the request message. Two requests will be batched - # together only if the values of every field specified in - # `request_discriminator_fields` is equal between the two requests. - # @!attribute [rw] subresponse_field - # @return [::String] - # Optional. When present, indicates the field in the response message to be - # used to demultiplex the response into multiple response messages, in - # correspondence with the multiple request messages originally batched - # together. - class BatchingDescriptorProto - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # The organization for which the client libraries are being published. - # Affects the url where generated docs are published, etc. - module ClientLibraryOrganization - # Not useful. - CLIENT_LIBRARY_ORGANIZATION_UNSPECIFIED = 0 - - # Google Cloud Platform Org. - CLOUD = 1 - - # Ads (Advertising) Org. - ADS = 2 - - # Photos Org. - PHOTOS = 3 - - # Street View Org. - STREET_VIEW = 4 - - # Shopping Org. - SHOPPING = 5 - - # Geo Org. - GEO = 6 - - # Generative AI - https://developers.generativeai.google - GENERATIVE_AI = 7 - end - - # To where should client libraries be published? - module ClientLibraryDestination - # Client libraries will neither be generated nor published to package - # managers. - CLIENT_LIBRARY_DESTINATION_UNSPECIFIED = 0 - - # Generate the client library in a repo under github.com/googleapis, - # but don't publish it to package managers. - GITHUB = 10 - - # Publish the library to package managers like nuget.org and npmjs.com. - PACKAGE_MANAGER = 20 - end - - # The behavior to take when the flow control limit is exceeded. - module FlowControlLimitExceededBehaviorProto - # Default behavior, system-defined. - UNSET_BEHAVIOR = 0 - - # Stop operation, raise error. - THROW_EXCEPTION = 1 - - # Pause operation until limit clears. - BLOCK = 2 - - # Continue operation, disregard limit. - IGNORE = 3 - end - end -end diff --git a/owl-bot-staging/google-cloud-security_center-v2/proto_docs/google/api/field_behavior.rb b/owl-bot-staging/google-cloud-security_center-v2/proto_docs/google/api/field_behavior.rb deleted file mode 100644 index 582be187d115..000000000000 --- a/owl-bot-staging/google-cloud-security_center-v2/proto_docs/google/api/field_behavior.rb +++ /dev/null @@ -1,85 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - - -module Google - module Api - # An indicator of the behavior of a given field (for example, that a field - # is required in requests, or given as output but ignored as input). - # This **does not** change the behavior in protocol buffers itself; it only - # denotes the behavior and may affect how API tooling handles the field. - # - # Note: This enum **may** receive new values in the future. - module FieldBehavior - # Conventional default for enums. Do not use this. - FIELD_BEHAVIOR_UNSPECIFIED = 0 - - # Specifically denotes a field as optional. - # While all fields in protocol buffers are optional, this may be specified - # for emphasis if appropriate. - OPTIONAL = 1 - - # Denotes a field as required. - # This indicates that the field **must** be provided as part of the request, - # and failure to do so will cause an error (usually `INVALID_ARGUMENT`). - REQUIRED = 2 - - # Denotes a field as output only. - # This indicates that the field is provided in responses, but including the - # field in a request does nothing (the server *must* ignore it and - # *must not* throw an error as a result of the field's presence). - OUTPUT_ONLY = 3 - - # Denotes a field as input only. - # This indicates that the field is provided in requests, and the - # corresponding field is not included in output. - INPUT_ONLY = 4 - - # Denotes a field as immutable. - # This indicates that the field may be set once in a request to create a - # resource, but may not be changed thereafter. - IMMUTABLE = 5 - - # Denotes that a (repeated) field is an unordered list. - # This indicates that the service may provide the elements of the list - # in any arbitrary order, rather than the order the user originally - # provided. Additionally, the list's order may or may not be stable. - UNORDERED_LIST = 6 - - # Denotes that this field returns a non-empty default value if not set. - # This indicates that if the user provides the empty value in a request, - # a non-empty value will be returned. The user will not be aware of what - # non-empty value to expect. - NON_EMPTY_DEFAULT = 7 - - # Denotes that the field in a resource (a message annotated with - # google.api.resource) is used in the resource name to uniquely identify the - # resource. For AIP-compliant APIs, this should only be applied to the - # `name` field on the resource. - # - # This behavior should not be applied to references to other resources within - # the message. - # - # The identifier field of resources often have different field behavior - # depending on the request it is embedded in (e.g. for Create methods name - # is optional and unused, while for Update methods it is required). Instead - # of method-specific annotations, only `IDENTIFIER` is required. - IDENTIFIER = 8 - end - end -end diff --git a/owl-bot-staging/google-cloud-security_center-v2/proto_docs/google/api/launch_stage.rb b/owl-bot-staging/google-cloud-security_center-v2/proto_docs/google/api/launch_stage.rb deleted file mode 100644 index 9392a413fb1b..000000000000 --- a/owl-bot-staging/google-cloud-security_center-v2/proto_docs/google/api/launch_stage.rb +++ /dev/null @@ -1,71 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - - -module Google - module Api - # The launch stage as defined by [Google Cloud Platform - # Launch Stages](https://cloud.google.com/terms/launch-stages). - module LaunchStage - # Do not use this default value. - LAUNCH_STAGE_UNSPECIFIED = 0 - - # The feature is not yet implemented. Users can not use it. - UNIMPLEMENTED = 6 - - # Prelaunch features are hidden from users and are only visible internally. - PRELAUNCH = 7 - - # Early Access features are limited to a closed group of testers. To use - # these features, you must sign up in advance and sign a Trusted Tester - # agreement (which includes confidentiality provisions). These features may - # be unstable, changed in backward-incompatible ways, and are not - # guaranteed to be released. - EARLY_ACCESS = 1 - - # Alpha is a limited availability test for releases before they are cleared - # for widespread use. By Alpha, all significant design issues are resolved - # and we are in the process of verifying functionality. Alpha customers - # need to apply for access, agree to applicable terms, and have their - # projects allowlisted. Alpha releases don't have to be feature complete, - # no SLAs are provided, and there are no technical support obligations, but - # they will be far enough along that customers can actually use them in - # test environments or for limited-use tests -- just like they would in - # normal production cases. - ALPHA = 2 - - # Beta is the point at which we are ready to open a release for any - # customer to use. There are no SLA or technical support obligations in a - # Beta release. Products will be complete from a feature perspective, but - # may have some open outstanding issues. Beta releases are suitable for - # limited production use cases. - BETA = 3 - - # GA features are open to all developers and are considered stable and - # fully qualified for production use. - GA = 4 - - # Deprecated features are scheduled to be shut down and removed. For more - # information, see the "Deprecation Policy" section of our [Terms of - # Service](https://cloud.google.com/terms/) - # and the [Google Cloud Platform Subject to the Deprecation - # Policy](https://cloud.google.com/terms/deprecation) documentation. - DEPRECATED = 5 - end - end -end diff --git a/owl-bot-staging/google-cloud-security_center-v2/proto_docs/google/api/resource.rb b/owl-bot-staging/google-cloud-security_center-v2/proto_docs/google/api/resource.rb deleted file mode 100644 index 25dec4847ac1..000000000000 --- a/owl-bot-staging/google-cloud-security_center-v2/proto_docs/google/api/resource.rb +++ /dev/null @@ -1,227 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - - -module Google - module Api - # A simple descriptor of a resource type. - # - # ResourceDescriptor annotates a resource message (either by means of a - # protobuf annotation or use in the service config), and associates the - # resource's schema, the resource type, and the pattern of the resource name. - # - # Example: - # - # message Topic { - # // Indicates this message defines a resource schema. - # // Declares the resource type in the format of {service}/{kind}. - # // For Kubernetes resources, the format is {api group}/{kind}. - # option (google.api.resource) = { - # type: "pubsub.googleapis.com/Topic" - # pattern: "projects/{project}/topics/{topic}" - # }; - # } - # - # The ResourceDescriptor Yaml config will look like: - # - # resources: - # - type: "pubsub.googleapis.com/Topic" - # pattern: "projects/{project}/topics/{topic}" - # - # Sometimes, resources have multiple patterns, typically because they can - # live under multiple parents. - # - # Example: - # - # message LogEntry { - # option (google.api.resource) = { - # type: "logging.googleapis.com/LogEntry" - # pattern: "projects/{project}/logs/{log}" - # pattern: "folders/{folder}/logs/{log}" - # pattern: "organizations/{organization}/logs/{log}" - # pattern: "billingAccounts/{billing_account}/logs/{log}" - # }; - # } - # - # The ResourceDescriptor Yaml config will look like: - # - # resources: - # - type: 'logging.googleapis.com/LogEntry' - # pattern: "projects/{project}/logs/{log}" - # pattern: "folders/{folder}/logs/{log}" - # pattern: "organizations/{organization}/logs/{log}" - # pattern: "billingAccounts/{billing_account}/logs/{log}" - # @!attribute [rw] type - # @return [::String] - # The resource type. It must be in the format of - # \\{service_name}/\\{resource_type_kind}. The `resource_type_kind` must be - # singular and must not include version numbers. - # - # Example: `storage.googleapis.com/Bucket` - # - # The value of the resource_type_kind must follow the regular expression - # /[A-Za-z][a-zA-Z0-9]+/. It should start with an upper case character and - # should use PascalCase (UpperCamelCase). The maximum number of - # characters allowed for the `resource_type_kind` is 100. - # @!attribute [rw] pattern - # @return [::Array<::String>] - # Optional. The relative resource name pattern associated with this resource - # type. The DNS prefix of the full resource name shouldn't be specified here. - # - # The path pattern must follow the syntax, which aligns with HTTP binding - # syntax: - # - # Template = Segment { "/" Segment } ; - # Segment = LITERAL | Variable ; - # Variable = "{" LITERAL "}" ; - # - # Examples: - # - # - "projects/\\{project}/topics/\\{topic}" - # - "projects/\\{project}/knowledgeBases/\\{knowledge_base}" - # - # The components in braces correspond to the IDs for each resource in the - # hierarchy. It is expected that, if multiple patterns are provided, - # the same component name (e.g. "project") refers to IDs of the same - # type of resource. - # @!attribute [rw] name_field - # @return [::String] - # Optional. The field on the resource that designates the resource name - # field. If omitted, this is assumed to be "name". - # @!attribute [rw] history - # @return [::Google::Api::ResourceDescriptor::History] - # Optional. The historical or future-looking state of the resource pattern. - # - # Example: - # - # // The InspectTemplate message originally only supported resource - # // names with organization, and project was added later. - # message InspectTemplate { - # option (google.api.resource) = { - # type: "dlp.googleapis.com/InspectTemplate" - # pattern: - # "organizations/{organization}/inspectTemplates/{inspect_template}" - # pattern: "projects/{project}/inspectTemplates/{inspect_template}" - # history: ORIGINALLY_SINGLE_PATTERN - # }; - # } - # @!attribute [rw] plural - # @return [::String] - # The plural name used in the resource name and permission names, such as - # 'projects' for the resource name of 'projects/\\{project}' and the permission - # name of 'cloudresourcemanager.googleapis.com/projects.get'. One exception - # to this is for Nested Collections that have stuttering names, as defined - # in [AIP-122](https://google.aip.dev/122#nested-collections), where the - # collection ID in the resource name pattern does not necessarily directly - # match the `plural` value. - # - # It is the same concept of the `plural` field in k8s CRD spec - # https://kubernetes.io/docs/tasks/access-kubernetes-api/custom-resources/custom-resource-definitions/ - # - # Note: The plural form is required even for singleton resources. See - # https://aip.dev/156 - # @!attribute [rw] singular - # @return [::String] - # The same concept of the `singular` field in k8s CRD spec - # https://kubernetes.io/docs/tasks/access-kubernetes-api/custom-resources/custom-resource-definitions/ - # Such as "project" for the `resourcemanager.googleapis.com/Project` type. - # @!attribute [rw] style - # @return [::Array<::Google::Api::ResourceDescriptor::Style>] - # Style flag(s) for this resource. - # These indicate that a resource is expected to conform to a given - # style. See the specific style flags for additional information. - class ResourceDescriptor - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - - # A description of the historical or future-looking state of the - # resource pattern. - module History - # The "unset" value. - HISTORY_UNSPECIFIED = 0 - - # The resource originally had one pattern and launched as such, and - # additional patterns were added later. - ORIGINALLY_SINGLE_PATTERN = 1 - - # The resource has one pattern, but the API owner expects to add more - # later. (This is the inverse of ORIGINALLY_SINGLE_PATTERN, and prevents - # that from being necessary once there are multiple patterns.) - FUTURE_MULTI_PATTERN = 2 - end - - # A flag representing a specific style that a resource claims to conform to. - module Style - # The unspecified value. Do not use. - STYLE_UNSPECIFIED = 0 - - # This resource is intended to be "declarative-friendly". - # - # Declarative-friendly resources must be more strictly consistent, and - # setting this to true communicates to tools that this resource should - # adhere to declarative-friendly expectations. - # - # Note: This is used by the API linter (linter.aip.dev) to enable - # additional checks. - DECLARATIVE_FRIENDLY = 1 - end - end - - # Defines a proto annotation that describes a string field that refers to - # an API resource. - # @!attribute [rw] type - # @return [::String] - # The resource type that the annotated field references. - # - # Example: - # - # message Subscription { - # string topic = 2 [(google.api.resource_reference) = { - # type: "pubsub.googleapis.com/Topic" - # }]; - # } - # - # Occasionally, a field may reference an arbitrary resource. In this case, - # APIs use the special value * in their resource reference. - # - # Example: - # - # message GetIamPolicyRequest { - # string resource = 2 [(google.api.resource_reference) = { - # type: "*" - # }]; - # } - # @!attribute [rw] child_type - # @return [::String] - # The resource type of a child collection that the annotated field - # references. This is useful for annotating the `parent` field that - # doesn't have a fixed resource type. - # - # Example: - # - # message ListLogEntriesRequest { - # string parent = 1 [(google.api.resource_reference) = { - # child_type: "logging.googleapis.com/LogEntry" - # }; - # } - class ResourceReference - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - end -end diff --git a/owl-bot-staging/google-cloud-security_center-v2/proto_docs/google/api/routing.rb b/owl-bot-staging/google-cloud-security_center-v2/proto_docs/google/api/routing.rb deleted file mode 100644 index 6d71a9430253..000000000000 --- a/owl-bot-staging/google-cloud-security_center-v2/proto_docs/google/api/routing.rb +++ /dev/null @@ -1,463 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - - -module Google - module Api - # Specifies the routing information that should be sent along with the request - # in the form of routing header. - # **NOTE:** All service configuration rules follow the "last one wins" order. - # - # The examples below will apply to an RPC which has the following request type: - # - # Message Definition: - # - # message Request { - # // The name of the Table - # // Values can be of the following formats: - # // - `projects//tables/
` - # // - `projects//instances//tables/
` - # // - `region//zones//tables/
` - # string table_name = 1; - # - # // This value specifies routing for replication. - # // It can be in the following formats: - # // - `profiles/` - # // - a legacy `profile_id` that can be any string - # string app_profile_id = 2; - # } - # - # Example message: - # - # { - # table_name: projects/proj_foo/instances/instance_bar/table/table_baz, - # app_profile_id: profiles/prof_qux - # } - # - # The routing header consists of one or multiple key-value pairs. The order of - # the key-value pairs is undefined, the order of the `routing_parameters` in - # the `RoutingRule` only matters for the evaluation order of the path - # templates when `field` is the same. See the examples below for more details. - # - # Every key and value in the routing header must be percent-encoded, - # and joined together in the following format: `key1=value1&key2=value2`. - # The examples below skip the percent-encoding for readability. - # - # Example 1 - # - # Extracting a field from the request to put into the routing header - # unchanged, with the key equal to the field name. - # - # annotation: - # - # option (google.api.routing) = { - # // Take the `app_profile_id`. - # routing_parameters { - # field: "app_profile_id" - # } - # }; - # - # result: - # - # x-goog-request-params: app_profile_id=profiles/prof_qux - # - # Example 2 - # - # Extracting a field from the request to put into the routing header - # unchanged, with the key different from the field name. - # - # annotation: - # - # option (google.api.routing) = { - # // Take the `app_profile_id`, but name it `routing_id` in the header. - # routing_parameters { - # field: "app_profile_id" - # path_template: "{routing_id=**}" - # } - # }; - # - # result: - # - # x-goog-request-params: routing_id=profiles/prof_qux - # - # Example 3 - # - # Extracting a field from the request to put into the routing - # header, while matching a path template syntax on the field's value. - # - # NB: it is more useful to send nothing than to send garbage for the purpose - # of dynamic routing, since garbage pollutes cache. Thus the matching. - # - # Sub-example 3a - # - # The field matches the template. - # - # annotation: - # - # option (google.api.routing) = { - # // Take the `table_name`, if it's well-formed (with project-based - # // syntax). - # routing_parameters { - # field: "table_name" - # path_template: "{table_name=projects/*/instances/*/**}" - # } - # }; - # - # result: - # - # x-goog-request-params: - # table_name=projects/proj_foo/instances/instance_bar/table/table_baz - # - # Sub-example 3b - # - # The field does not match the template. - # - # annotation: - # - # option (google.api.routing) = { - # // Take the `table_name`, if it's well-formed (with region-based - # // syntax). - # routing_parameters { - # field: "table_name" - # path_template: "{table_name=regions/*/zones/*/**}" - # } - # }; - # - # result: - # - # - # - # Sub-example 3c - # - # Multiple alternative conflictingly named path templates are - # specified. The one that matches is used to construct the header. - # - # annotation: - # - # option (google.api.routing) = { - # // Take the `table_name`, if it's well-formed, whether - # // using the region- or projects-based syntax. - # - # routing_parameters { - # field: "table_name" - # path_template: "{table_name=regions/*/zones/*/**}" - # } - # routing_parameters { - # field: "table_name" - # path_template: "{table_name=projects/*/instances/*/**}" - # } - # }; - # - # result: - # - # x-goog-request-params: - # table_name=projects/proj_foo/instances/instance_bar/table/table_baz - # - # Example 4 - # - # Extracting a single routing header key-value pair by matching a - # template syntax on (a part of) a single request field. - # - # annotation: - # - # option (google.api.routing) = { - # // Take just the project id from the `table_name` field. - # routing_parameters { - # field: "table_name" - # path_template: "{routing_id=projects/*}/**" - # } - # }; - # - # result: - # - # x-goog-request-params: routing_id=projects/proj_foo - # - # Example 5 - # - # Extracting a single routing header key-value pair by matching - # several conflictingly named path templates on (parts of) a single request - # field. The last template to match "wins" the conflict. - # - # annotation: - # - # option (google.api.routing) = { - # // If the `table_name` does not have instances information, - # // take just the project id for routing. - # // Otherwise take project + instance. - # - # routing_parameters { - # field: "table_name" - # path_template: "{routing_id=projects/*}/**" - # } - # routing_parameters { - # field: "table_name" - # path_template: "{routing_id=projects/*/instances/*}/**" - # } - # }; - # - # result: - # - # x-goog-request-params: - # routing_id=projects/proj_foo/instances/instance_bar - # - # Example 6 - # - # Extracting multiple routing header key-value pairs by matching - # several non-conflicting path templates on (parts of) a single request field. - # - # Sub-example 6a - # - # Make the templates strict, so that if the `table_name` does not - # have an instance information, nothing is sent. - # - # annotation: - # - # option (google.api.routing) = { - # // The routing code needs two keys instead of one composite - # // but works only for the tables with the "project-instance" name - # // syntax. - # - # routing_parameters { - # field: "table_name" - # path_template: "{project_id=projects/*}/instances/*/**" - # } - # routing_parameters { - # field: "table_name" - # path_template: "projects/*/{instance_id=instances/*}/**" - # } - # }; - # - # result: - # - # x-goog-request-params: - # project_id=projects/proj_foo&instance_id=instances/instance_bar - # - # Sub-example 6b - # - # Make the templates loose, so that if the `table_name` does not - # have an instance information, just the project id part is sent. - # - # annotation: - # - # option (google.api.routing) = { - # // The routing code wants two keys instead of one composite - # // but will work with just the `project_id` for tables without - # // an instance in the `table_name`. - # - # routing_parameters { - # field: "table_name" - # path_template: "{project_id=projects/*}/**" - # } - # routing_parameters { - # field: "table_name" - # path_template: "projects/*/{instance_id=instances/*}/**" - # } - # }; - # - # result (is the same as 6a for our example message because it has the instance - # information): - # - # x-goog-request-params: - # project_id=projects/proj_foo&instance_id=instances/instance_bar - # - # Example 7 - # - # Extracting multiple routing header key-value pairs by matching - # several path templates on multiple request fields. - # - # NB: note that here there is no way to specify sending nothing if one of the - # fields does not match its template. E.g. if the `table_name` is in the wrong - # format, the `project_id` will not be sent, but the `routing_id` will be. - # The backend routing code has to be aware of that and be prepared to not - # receive a full complement of keys if it expects multiple. - # - # annotation: - # - # option (google.api.routing) = { - # // The routing needs both `project_id` and `routing_id` - # // (from the `app_profile_id` field) for routing. - # - # routing_parameters { - # field: "table_name" - # path_template: "{project_id=projects/*}/**" - # } - # routing_parameters { - # field: "app_profile_id" - # path_template: "{routing_id=**}" - # } - # }; - # - # result: - # - # x-goog-request-params: - # project_id=projects/proj_foo&routing_id=profiles/prof_qux - # - # Example 8 - # - # Extracting a single routing header key-value pair by matching - # several conflictingly named path templates on several request fields. The - # last template to match "wins" the conflict. - # - # annotation: - # - # option (google.api.routing) = { - # // The `routing_id` can be a project id or a region id depending on - # // the table name format, but only if the `app_profile_id` is not set. - # // If `app_profile_id` is set it should be used instead. - # - # routing_parameters { - # field: "table_name" - # path_template: "{routing_id=projects/*}/**" - # } - # routing_parameters { - # field: "table_name" - # path_template: "{routing_id=regions/*}/**" - # } - # routing_parameters { - # field: "app_profile_id" - # path_template: "{routing_id=**}" - # } - # }; - # - # result: - # - # x-goog-request-params: routing_id=profiles/prof_qux - # - # Example 9 - # - # Bringing it all together. - # - # annotation: - # - # option (google.api.routing) = { - # // For routing both `table_location` and a `routing_id` are needed. - # // - # // table_location can be either an instance id or a region+zone id. - # // - # // For `routing_id`, take the value of `app_profile_id` - # // - If it's in the format `profiles/`, send - # // just the `` part. - # // - If it's any other literal, send it as is. - # // If the `app_profile_id` is empty, and the `table_name` starts with - # // the project_id, send that instead. - # - # routing_parameters { - # field: "table_name" - # path_template: "projects/*/{table_location=instances/*}/tables/*" - # } - # routing_parameters { - # field: "table_name" - # path_template: "{table_location=regions/*/zones/*}/tables/*" - # } - # routing_parameters { - # field: "table_name" - # path_template: "{routing_id=projects/*}/**" - # } - # routing_parameters { - # field: "app_profile_id" - # path_template: "{routing_id=**}" - # } - # routing_parameters { - # field: "app_profile_id" - # path_template: "profiles/{routing_id=*}" - # } - # }; - # - # result: - # - # x-goog-request-params: - # table_location=instances/instance_bar&routing_id=prof_qux - # @!attribute [rw] routing_parameters - # @return [::Array<::Google::Api::RoutingParameter>] - # A collection of Routing Parameter specifications. - # **NOTE:** If multiple Routing Parameters describe the same key - # (via the `path_template` field or via the `field` field when - # `path_template` is not provided), "last one wins" rule - # determines which Parameter gets used. - # See the examples for more details. - class RoutingRule - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # A projection from an input message to the GRPC or REST header. - # @!attribute [rw] field - # @return [::String] - # A request field to extract the header key-value pair from. - # @!attribute [rw] path_template - # @return [::String] - # A pattern matching the key-value field. Optional. - # If not specified, the whole field specified in the `field` field will be - # taken as value, and its name used as key. If specified, it MUST contain - # exactly one named segment (along with any number of unnamed segments) The - # pattern will be matched over the field specified in the `field` field, then - # if the match is successful: - # - the name of the single named segment will be used as a header name, - # - the match value of the segment will be used as a header value; - # if the match is NOT successful, nothing will be sent. - # - # Example: - # - # -- This is a field in the request message - # | that the header value will be extracted from. - # | - # | -- This is the key name in the - # | | routing header. - # V | - # field: "table_name" v - # path_template: "projects/*/{table_location=instances/*}/tables/*" - # ^ ^ - # | | - # In the {} brackets is the pattern that -- | - # specifies what to extract from the | - # field as a value to be sent. | - # | - # The string in the field must match the whole pattern -- - # before brackets, inside brackets, after brackets. - # - # When looking at this specific example, we can see that: - # - A key-value pair with the key `table_location` - # and the value matching `instances/*` should be added - # to the x-goog-request-params routing header. - # - The value is extracted from the request message's `table_name` field - # if it matches the full pattern specified: - # `projects/*/instances/*/tables/*`. - # - # **NB:** If the `path_template` field is not provided, the key name is - # equal to the field name, and the whole field should be sent as a value. - # This makes the pattern for the field and the value functionally equivalent - # to `**`, and the configuration - # - # { - # field: "table_name" - # } - # - # is a functionally equivalent shorthand to: - # - # { - # field: "table_name" - # path_template: "{table_name=**}" - # } - # - # See Example 1 for more details. - class RoutingParameter - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - end -end diff --git a/owl-bot-staging/google-cloud-security_center-v2/proto_docs/google/cloud/securitycenter/v2/access.rb b/owl-bot-staging/google-cloud-security_center-v2/proto_docs/google/cloud/securitycenter/v2/access.rb deleted file mode 100644 index 4b452fd07cb2..000000000000 --- a/owl-bot-staging/google-cloud-security_center-v2/proto_docs/google/cloud/securitycenter/v2/access.rb +++ /dev/null @@ -1,120 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - - -module Google - module Cloud - module SecurityCenter - module V2 - # Represents an access event. - # @!attribute [rw] principal_email - # @return [::String] - # Associated email, such as "foo@google.com". - # - # The email address of the authenticated user or a service account acting on - # behalf of a third party principal making the request. For third party - # identity callers, the `principal_subject` field is populated instead of - # this field. For privacy reasons, the principal email address is sometimes - # redacted. For more information, see [Caller identities in audit - # logs](https://cloud.google.com/logging/docs/audit#user-id). - # @!attribute [rw] caller_ip - # @return [::String] - # Caller's IP address, such as "1.1.1.1". - # @!attribute [rw] caller_ip_geo - # @return [::Google::Cloud::SecurityCenter::V2::Geolocation] - # The caller IP's geolocation, which identifies where the call came from. - # @!attribute [rw] user_agent_family - # @return [::String] - # Type of user agent associated with the finding. For example, an operating - # system shell or an embedded or standalone application. - # @!attribute [rw] user_agent - # @return [::String] - # The caller's user agent string associated with the finding. - # @!attribute [rw] service_name - # @return [::String] - # This is the API service that the service account made a call to, e.g. - # "iam.googleapis.com" - # @!attribute [rw] method_name - # @return [::String] - # The method that the service account called, e.g. "SetIamPolicy". - # @!attribute [rw] principal_subject - # @return [::String] - # A string that represents the principal_subject that is associated with the - # identity. Unlike `principal_email`, `principal_subject` supports principals - # that aren't associated with email addresses, such as third party - # principals. For most identities, the format is - # `principal://iam.googleapis.com/{identity pool name}/subject/{subject}`. - # Some GKE identities, such as GKE_WORKLOAD, FREEFORM, and GKE_HUB_WORKLOAD, - # still use the legacy format `serviceAccount:{identity pool - # name}[\\{subject}]`. - # @!attribute [rw] service_account_key_name - # @return [::String] - # The name of the service account key that was used to create or exchange - # credentials when authenticating the service account that made the request. - # This is a scheme-less URI full resource name. For example: - # - # "//iam.googleapis.com/projects/\\{PROJECT_ID}/serviceAccounts/\\{ACCOUNT}/keys/\\{key}". - # @!attribute [rw] service_account_delegation_info - # @return [::Array<::Google::Cloud::SecurityCenter::V2::ServiceAccountDelegationInfo>] - # The identity delegation history of an authenticated service account that - # made the request. The `serviceAccountDelegationInfo[]` object contains - # information about the real authorities that try to access Google Cloud - # resources by delegating on a service account. When multiple authorities are - # present, they are guaranteed to be sorted based on the original ordering of - # the identity delegation events. - # @!attribute [rw] user_name - # @return [::String] - # A string that represents a username. The username provided depends on the - # type of the finding and is likely not an IAM principal. For example, this - # can be a system username if the finding is related to a virtual machine, or - # it can be an application login username. - class Access - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Identity delegation history of an authenticated service account. - # @!attribute [rw] principal_email - # @return [::String] - # The email address of a Google account. - # @!attribute [rw] principal_subject - # @return [::String] - # A string representing the principal_subject associated with the identity. - # As compared to `principal_email`, supports principals that aren't - # associated with email addresses, such as third party principals. For most - # identities, the format will be `principal://iam.googleapis.com/{identity - # pool name}/subjects/\\{subject}` except for some GKE identities - # (GKE_WORKLOAD, FREEFORM, GKE_HUB_WORKLOAD) that are still in the legacy - # format `serviceAccount:{identity pool name}[{subject}]` - class ServiceAccountDelegationInfo - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Represents a geographical location for a given access. - # @!attribute [rw] region_code - # @return [::String] - # A CLDR. - class Geolocation - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - end - end - end -end diff --git a/owl-bot-staging/google-cloud-security_center-v2/proto_docs/google/cloud/securitycenter/v2/affected_resources.rb b/owl-bot-staging/google-cloud-security_center-v2/proto_docs/google/cloud/securitycenter/v2/affected_resources.rb deleted file mode 100644 index 22a4e9fe9934..000000000000 --- a/owl-bot-staging/google-cloud-security_center-v2/proto_docs/google/cloud/securitycenter/v2/affected_resources.rb +++ /dev/null @@ -1,35 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - - -module Google - module Cloud - module SecurityCenter - module V2 - # Details about resources affected by this finding. - # @!attribute [rw] count - # @return [::Integer] - # The count of resources affected by the finding. - class AffectedResources - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - end - end - end -end diff --git a/owl-bot-staging/google-cloud-security_center-v2/proto_docs/google/cloud/securitycenter/v2/ai_model.rb b/owl-bot-staging/google-cloud-security_center-v2/proto_docs/google/cloud/securitycenter/v2/ai_model.rb deleted file mode 100644 index fe0106b68b6d..000000000000 --- a/owl-bot-staging/google-cloud-security_center-v2/proto_docs/google/cloud/securitycenter/v2/ai_model.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 Cloud - module SecurityCenter - module V2 - # Contains information about the AI model associated with the finding. - # @!attribute [rw] name - # @return [::String] - # The name of the AI model, for example, "gemini:1.0.0". - # @!attribute [rw] domain - # @return [::String] - # The domain of the model, for example, “image-classification”. - # @!attribute [rw] library - # @return [::String] - # The name of the model library, for example, “transformers”. - # @!attribute [rw] location - # @return [::String] - # The region in which the model is used, for example, “us-central1”. - # @!attribute [rw] publisher - # @return [::String] - # The publisher of the model, for example, “google” or “nvidia”. - # @!attribute [rw] deployment_platform - # @return [::Google::Cloud::SecurityCenter::V2::AiModel::DeploymentPlatform] - # The platform on which the model is deployed. - # @!attribute [rw] display_name - # @return [::String] - # The user defined display name of model. Ex. baseline-classification-model - class AiModel - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - - # The platform on which the model is deployed. - module DeploymentPlatform - # Unspecified deployment platform. - DEPLOYMENT_PLATFORM_UNSPECIFIED = 0 - - # Vertex AI. - VERTEX_AI = 1 - - # Google Kubernetes Engine. - GKE = 2 - - # Google Compute Engine. - GCE = 3 - - # Fine tuned model. - FINE_TUNED_MODEL = 4 - end - end - end - end - end -end diff --git a/owl-bot-staging/google-cloud-security_center-v2/proto_docs/google/cloud/securitycenter/v2/application.rb b/owl-bot-staging/google-cloud-security_center-v2/proto_docs/google/cloud/securitycenter/v2/application.rb deleted file mode 100644 index 4c1fa3fef09b..000000000000 --- a/owl-bot-staging/google-cloud-security_center-v2/proto_docs/google/cloud/securitycenter/v2/application.rb +++ /dev/null @@ -1,40 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - - -module Google - module Cloud - module SecurityCenter - module V2 - # Represents an application associated with a finding. - # @!attribute [rw] base_uri - # @return [::String] - # The base URI that identifies the network location of the application in - # which the vulnerability was detected. For example, `http://example.com`. - # @!attribute [rw] full_uri - # @return [::String] - # The full URI with payload that could be used to reproduce the - # vulnerability. For example, `http://example.com?p=aMmYgI6H`. - class Application - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - end - end - end -end diff --git a/owl-bot-staging/google-cloud-security_center-v2/proto_docs/google/cloud/securitycenter/v2/attack_exposure.rb b/owl-bot-staging/google-cloud-security_center-v2/proto_docs/google/cloud/securitycenter/v2/attack_exposure.rb deleted file mode 100644 index d3543aea2fa0..000000000000 --- a/owl-bot-staging/google-cloud-security_center-v2/proto_docs/google/cloud/securitycenter/v2/attack_exposure.rb +++ /dev/null @@ -1,73 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - - -module Google - module Cloud - module SecurityCenter - module V2 - # An attack exposure contains the results of an attack path simulation run. - # @!attribute [rw] score - # @return [::Float] - # A number between 0 (inclusive) and infinity that represents how important - # this finding is to remediate. The higher the score, the more important it - # is to remediate. - # @!attribute [rw] latest_calculation_time - # @return [::Google::Protobuf::Timestamp] - # The most recent time the attack exposure was updated on this finding. - # @!attribute [rw] attack_exposure_result - # @return [::String] - # The resource name of the attack path simulation result that contains the - # details regarding this attack exposure score. - # Example: `organizations/123/simulations/456/attackExposureResults/789` - # @!attribute [r] state - # @return [::Google::Cloud::SecurityCenter::V2::AttackExposure::State] - # Output only. What state this AttackExposure is in. This captures whether or - # not an attack exposure has been calculated or not. - # @!attribute [rw] exposed_high_value_resources_count - # @return [::Integer] - # The number of high value resources that are exposed as a result of this - # finding. - # @!attribute [rw] exposed_medium_value_resources_count - # @return [::Integer] - # The number of medium value resources that are exposed as a result of this - # finding. - # @!attribute [rw] exposed_low_value_resources_count - # @return [::Integer] - # The number of high value resources that are exposed as a result of this - # finding. - class AttackExposure - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - - # This enum defines the various states an AttackExposure can be in. - module State - # The state is not specified. - STATE_UNSPECIFIED = 0 - - # The attack exposure has been calculated. - CALCULATED = 1 - - # The attack exposure has not been calculated. - NOT_CALCULATED = 2 - end - end - end - end - end -end diff --git a/owl-bot-staging/google-cloud-security_center-v2/proto_docs/google/cloud/securitycenter/v2/attack_path.rb b/owl-bot-staging/google-cloud-security_center-v2/proto_docs/google/cloud/securitycenter/v2/attack_path.rb deleted file mode 100644 index 395034b6cbf5..000000000000 --- a/owl-bot-staging/google-cloud-security_center-v2/proto_docs/google/cloud/securitycenter/v2/attack_path.rb +++ /dev/null @@ -1,147 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - - -module Google - module Cloud - module SecurityCenter - module V2 - # A path that an attacker could take to reach an exposed resource. - # @!attribute [rw] name - # @return [::String] - # The attack path name, for example, - # `organizations/12/simulations/34/valuedResources/56/attackPaths/78` - # @!attribute [rw] path_nodes - # @return [::Array<::Google::Cloud::SecurityCenter::V2::AttackPath::AttackPathNode>] - # A list of nodes that exist in this attack path. - # @!attribute [rw] edges - # @return [::Array<::Google::Cloud::SecurityCenter::V2::AttackPath::AttackPathEdge>] - # A list of the edges between nodes in this attack path. - class AttackPath - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - - # Represents one point that an attacker passes through in this attack path. - # @!attribute [rw] resource - # @return [::String] - # The name of the resource at this point in the attack path. - # The format of the name follows the Cloud Asset Inventory [resource - # name - # format](https://cloud.google.com/asset-inventory/docs/resource-name-format) - # @!attribute [rw] resource_type - # @return [::String] - # The [supported resource - # type](https://cloud.google.com/asset-inventory/docs/supported-asset-types) - # @!attribute [rw] display_name - # @return [::String] - # Human-readable name of this resource. - # @!attribute [rw] associated_findings - # @return [::Array<::Google::Cloud::SecurityCenter::V2::AttackPath::AttackPathNode::PathNodeAssociatedFinding>] - # The findings associated with this node in the attack path. - # @!attribute [rw] uuid - # @return [::String] - # Unique id of the attack path node. - # @!attribute [rw] attack_steps - # @return [::Array<::Google::Cloud::SecurityCenter::V2::AttackPath::AttackPathNode::AttackStepNode>] - # A list of attack step nodes that exist in this attack path node. - class AttackPathNode - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - - # A finding that is associated with this node in the attack path. - # @!attribute [rw] canonical_finding - # @return [::String] - # Canonical name of the associated findings. Example: - # `organizations/123/sources/456/findings/789` - # @!attribute [rw] finding_category - # @return [::String] - # The additional taxonomy group within findings from a given source. - # @!attribute [rw] name - # @return [::String] - # Full resource name of the finding. - class PathNodeAssociatedFinding - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Detailed steps the attack can take between path nodes. - # @!attribute [rw] uuid - # @return [::String] - # Unique ID for one Node - # @!attribute [rw] type - # @return [::Google::Cloud::SecurityCenter::V2::AttackPath::AttackPathNode::NodeType] - # Attack step type. Can be either AND, OR or DEFENSE - # @!attribute [rw] display_name - # @return [::String] - # User friendly name of the attack step - # @!attribute [rw] labels - # @return [::Google::Protobuf::Map{::String => ::String}] - # Attack step labels for metadata - # @!attribute [rw] description - # @return [::String] - # Attack step description - class AttackStepNode - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - - # @!attribute [rw] key - # @return [::String] - # @!attribute [rw] value - # @return [::String] - class LabelsEntry - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - end - - # The type of the incoming attack step node. - module NodeType - # Type not specified - NODE_TYPE_UNSPECIFIED = 0 - - # Incoming edge joined with AND - NODE_TYPE_AND = 1 - - # Incoming edge joined with OR - NODE_TYPE_OR = 2 - - # Incoming edge is defense - NODE_TYPE_DEFENSE = 3 - - # Incoming edge is attacker - NODE_TYPE_ATTACKER = 4 - end - end - - # Represents a connection between a source node and a destination node in - # this attack path. - # @!attribute [rw] source - # @return [::String] - # The attack node uuid of the source node. - # @!attribute [rw] destination - # @return [::String] - # The attack node uuid of the destination node. - class AttackPathEdge - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - end - end - end - end -end diff --git a/owl-bot-staging/google-cloud-security_center-v2/proto_docs/google/cloud/securitycenter/v2/backup_disaster_recovery.rb b/owl-bot-staging/google-cloud-security_center-v2/proto_docs/google/cloud/securitycenter/v2/backup_disaster_recovery.rb deleted file mode 100644 index b49d6ad06453..000000000000 --- a/owl-bot-staging/google-cloud-security_center-v2/proto_docs/google/cloud/securitycenter/v2/backup_disaster_recovery.rb +++ /dev/null @@ -1,90 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - - -module Google - module Cloud - module SecurityCenter - module V2 - # Information related to Google Cloud Backup and DR Service findings. - # @!attribute [rw] backup_template - # @return [::String] - # The name of a Backup and DR template which comprises one or more backup - # policies. See the [Backup and DR - # documentation](https://cloud.google.com/backup-disaster-recovery/docs/concepts/backup-plan#temp) - # for more information. For example, `snap-ov`. - # @!attribute [rw] policies - # @return [::Array<::String>] - # The names of Backup and DR policies that are associated with a template - # and that define when to run a backup, how frequently to run a backup, and - # how long to retain the backup image. For example, `onvaults`. - # @!attribute [rw] host - # @return [::String] - # The name of a Backup and DR host, which is managed by the backup and - # recovery appliance and known to the management console. The host can be of - # type Generic (for example, Compute Engine, SQL Server, Oracle DB, SMB file - # system, etc.), vCenter, or an ESX server. See the [Backup and DR - # documentation on - # hosts](https://cloud.google.com/backup-disaster-recovery/docs/configuration/manage-hosts-and-their-applications) - # for more information. For example, `centos7-01`. - # @!attribute [rw] applications - # @return [::Array<::String>] - # The names of Backup and DR applications. An application is a VM, database, - # or file system on a managed host monitored by a backup and recovery - # appliance. For example, `centos7-01-vol00`, `centos7-01-vol01`, - # `centos7-01-vol02`. - # @!attribute [rw] storage_pool - # @return [::String] - # The name of the Backup and DR storage pool that the backup and recovery - # appliance is storing data in. The storage pool could be of type Cloud, - # Primary, Snapshot, or OnVault. See the [Backup and DR documentation on - # storage - # pools](https://cloud.google.com/backup-disaster-recovery/docs/concepts/storage-pools). - # For example, `DiskPoolOne`. - # @!attribute [rw] policy_options - # @return [::Array<::String>] - # The names of Backup and DR advanced policy options of a policy applying to - # an application. See the [Backup and DR documentation on policy - # options](https://cloud.google.com/backup-disaster-recovery/docs/create-plan/policy-settings). - # For example, `skipofflineappsincongrp, nounmap`. - # @!attribute [rw] profile - # @return [::String] - # The name of the Backup and DR resource profile that specifies the storage - # media for backups of application and VM data. See the [Backup and DR - # documentation on - # profiles](https://cloud.google.com/backup-disaster-recovery/docs/concepts/backup-plan#profile). - # For example, `GCP`. - # @!attribute [rw] appliance - # @return [::String] - # The name of the Backup and DR appliance that captures, moves, and manages - # the lifecycle of backup data. For example, `backup-server-57137`. - # @!attribute [rw] backup_type - # @return [::String] - # The backup type of the Backup and DR image. - # For example, `Snapshot`, `Remote Snapshot`, `OnVault`. - # @!attribute [rw] backup_create_time - # @return [::Google::Protobuf::Timestamp] - # The timestamp at which the Backup and DR backup was created. - class BackupDisasterRecovery - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - end - end - end -end diff --git a/owl-bot-staging/google-cloud-security_center-v2/proto_docs/google/cloud/securitycenter/v2/bigquery_export.rb b/owl-bot-staging/google-cloud-security_center-v2/proto_docs/google/cloud/securitycenter/v2/bigquery_export.rb deleted file mode 100644 index 09155c2a96e1..000000000000 --- a/owl-bot-staging/google-cloud-security_center-v2/proto_docs/google/cloud/securitycenter/v2/bigquery_export.rb +++ /dev/null @@ -1,96 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - - -module Google - module Cloud - module SecurityCenter - module V2 - # Configures how to deliver Findings to BigQuery Instance. - # @!attribute [rw] name - # @return [::String] - # Identifier. The relative resource name of this export. See: - # https://cloud.google.com/apis/design/resource_names#relative_resource_name. - # The following list shows some examples: - # - # + - # `organizations/{organization_id}/locations/{location_id}/bigQueryExports/{export_id}` - # + `folders/{folder_id}/locations/{location_id}/bigQueryExports/{export_id}` - # + - # `projects/{project_id}/locations/{location_id}/bigQueryExports/{export_id}` - # - # This field is provided in responses, and is ignored when provided in create - # requests. - # @!attribute [rw] description - # @return [::String] - # The description of the export (max of 1024 characters). - # @!attribute [rw] filter - # @return [::String] - # Expression that defines the filter to apply across create/update events - # of findings. The expression is a list of zero or more restrictions combined - # via logical operators `AND` and `OR`. Parentheses are supported, and `OR` - # has higher precedence than `AND`. - # - # Restrictions have the form ` ` and may have a - # `-` character in front of them to indicate negation. The fields map to - # those defined in the corresponding resource. - # - # The supported operators are: - # - # * `=` for all value types. - # * `>`, `<`, `>=`, `<=` for integer values. - # * `:`, meaning substring matching, for strings. - # - # The supported value types are: - # - # * string literals in quotes. - # * integer literals without quotes. - # * boolean literals `true` and `false` without quotes. - # @!attribute [rw] dataset - # @return [::String] - # The dataset to write findings' updates to. Its format is - # "projects/[project_id]/datasets/[bigquery_dataset_id]". - # BigQuery dataset unique ID must contain only letters (a-z, A-Z), numbers - # (0-9), or underscores (_). - # @!attribute [r] create_time - # @return [::Google::Protobuf::Timestamp] - # Output only. The time at which the BigQuery export was created. - # This field is set by the server and will be ignored if provided on export - # on creation. - # @!attribute [r] update_time - # @return [::Google::Protobuf::Timestamp] - # Output only. The most recent time at which the BigQuery export was updated. - # This field is set by the server and will be ignored if provided on export - # creation or update. - # @!attribute [r] most_recent_editor - # @return [::String] - # Output only. Email address of the user who last edited the BigQuery export. - # This field is set by the server and will be ignored if provided on export - # creation or update. - # @!attribute [r] principal - # @return [::String] - # Output only. The service account that needs permission to create table and - # upload data to the BigQuery dataset. - class BigQueryExport - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - end - end - end -end diff --git a/owl-bot-staging/google-cloud-security_center-v2/proto_docs/google/cloud/securitycenter/v2/chokepoint.rb b/owl-bot-staging/google-cloud-security_center-v2/proto_docs/google/cloud/securitycenter/v2/chokepoint.rb deleted file mode 100644 index 4ac87a98cfbd..000000000000 --- a/owl-bot-staging/google-cloud-security_center-v2/proto_docs/google/cloud/securitycenter/v2/chokepoint.rb +++ /dev/null @@ -1,39 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - - -module Google - module Cloud - module SecurityCenter - module V2 - # Contains details about a chokepoint, which is a resource or resource group - # where high-risk attack paths converge, based on [attack path simulations] - # (https://cloud.google.com/security-command-center/docs/attack-exposure-learn#attack_path_simulations). - # @!attribute [rw] related_findings - # @return [::Array<::String>] - # List of resource names of findings associated with this chokepoint. - # For example, organizations/123/sources/456/findings/789. - # This list will have at most 100 findings. - class Chokepoint - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - end - end - end -end diff --git a/owl-bot-staging/google-cloud-security_center-v2/proto_docs/google/cloud/securitycenter/v2/cloud_armor.rb b/owl-bot-staging/google-cloud-security_center-v2/proto_docs/google/cloud/securitycenter/v2/cloud_armor.rb deleted file mode 100644 index de5568f900ac..000000000000 --- a/owl-bot-staging/google-cloud-security_center-v2/proto_docs/google/cloud/securitycenter/v2/cloud_armor.rb +++ /dev/null @@ -1,138 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - - -module Google - module Cloud - module SecurityCenter - module V2 - # Fields related to Google Cloud Armor findings. - # @!attribute [rw] security_policy - # @return [::Google::Cloud::SecurityCenter::V2::SecurityPolicy] - # Information about the [Google Cloud Armor security - # policy](https://cloud.google.com/armor/docs/security-policy-overview) - # relevant to the finding. - # @!attribute [rw] requests - # @return [::Google::Cloud::SecurityCenter::V2::Requests] - # Information about incoming requests evaluated by [Google Cloud Armor - # security - # policies](https://cloud.google.com/armor/docs/security-policy-overview). - # @!attribute [rw] adaptive_protection - # @return [::Google::Cloud::SecurityCenter::V2::AdaptiveProtection] - # Information about potential Layer 7 DDoS attacks identified by [Google - # Cloud Armor Adaptive - # Protection](https://cloud.google.com/armor/docs/adaptive-protection-overview). - # @!attribute [rw] attack - # @return [::Google::Cloud::SecurityCenter::V2::Attack] - # Information about DDoS attack volume and classification. - # @!attribute [rw] threat_vector - # @return [::String] - # Distinguish between volumetric & protocol DDoS attack and - # application layer attacks. For example, "L3_4" for Layer 3 and Layer 4 DDoS - # attacks, or "L_7" for Layer 7 DDoS attacks. - # @!attribute [rw] duration - # @return [::Google::Protobuf::Duration] - # Duration of attack from the start until the current moment (updated every 5 - # minutes). - class CloudArmor - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Information about the [Google Cloud Armor security - # policy](https://cloud.google.com/armor/docs/security-policy-overview) - # relevant to the finding. - # @!attribute [rw] name - # @return [::String] - # The name of the Google Cloud Armor security policy, for example, - # "my-security-policy". - # @!attribute [rw] type - # @return [::String] - # The type of Google Cloud Armor security policy for example, 'backend - # security policy', 'edge security policy', 'network edge security policy', - # or 'always-on DDoS protection'. - # @!attribute [rw] preview - # @return [::Boolean] - # Whether or not the associated rule or policy is in preview mode. - class SecurityPolicy - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Information about the requests relevant to the finding. - # @!attribute [rw] ratio - # @return [::Float] - # For 'Increasing deny ratio', the ratio is the denied traffic divided by the - # allowed traffic. For 'Allowed traffic spike', the ratio is the allowed - # traffic in the short term divided by allowed traffic in the long term. - # @!attribute [rw] short_term_allowed - # @return [::Integer] - # Allowed RPS (requests per second) in the short term. - # @!attribute [rw] long_term_allowed - # @return [::Integer] - # Allowed RPS (requests per second) over the long term. - # @!attribute [rw] long_term_denied - # @return [::Integer] - # Denied RPS (requests per second) over the long term. - class Requests - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Information about [Google Cloud Armor Adaptive - # Protection](https://cloud.google.com/armor/docs/cloud-armor-overview#google-cloud-armor-adaptive-protection). - # @!attribute [rw] confidence - # @return [::Float] - # A score of 0 means that there is low confidence that the detected event is - # an actual attack. A score of 1 means that there is high confidence that the - # detected event is an attack. See the [Adaptive Protection - # documentation](https://cloud.google.com/armor/docs/adaptive-protection-overview#configure-alert-tuning) - # for further explanation. - class AdaptiveProtection - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Information about DDoS attack volume and classification. - # @!attribute [rw] volume_pps_long - # @return [::Integer] - # Total PPS (packets per second) volume of attack. - # @!attribute [rw] volume_bps_long - # @return [::Integer] - # Total BPS (bytes per second) volume of attack. - # @!attribute [rw] classification - # @return [::String] - # Type of attack, for example, 'SYN-flood', 'NTP-udp', or 'CHARGEN-udp'. - # @!attribute [rw] volume_pps - # @deprecated This field is deprecated and may be removed in the next major version update. - # @return [::Integer] - # Total PPS (packets per second) volume of attack. Deprecated - refer to - # volume_pps_long instead. - # @!attribute [rw] volume_bps - # @deprecated This field is deprecated and may be removed in the next major version update. - # @return [::Integer] - # Total BPS (bytes per second) volume of attack. Deprecated - refer to - # volume_bps_long instead. - class Attack - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - end - end - end -end diff --git a/owl-bot-staging/google-cloud-security_center-v2/proto_docs/google/cloud/securitycenter/v2/cloud_dlp_data_profile.rb b/owl-bot-staging/google-cloud-security_center-v2/proto_docs/google/cloud/securitycenter/v2/cloud_dlp_data_profile.rb deleted file mode 100644 index 346e66b5e35d..000000000000 --- a/owl-bot-staging/google-cloud-security_center-v2/proto_docs/google/cloud/securitycenter/v2/cloud_dlp_data_profile.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! - - -module Google - module Cloud - module SecurityCenter - module V2 - # The [data profile](https://cloud.google.com/dlp/docs/data-profiles) - # associated with the finding. - # @!attribute [rw] data_profile - # @return [::String] - # Name of the data profile, for example, - # `projects/123/locations/europe/tableProfiles/8383929`. - # @!attribute [rw] parent_type - # @return [::Google::Cloud::SecurityCenter::V2::CloudDlpDataProfile::ParentType] - # The resource hierarchy level at which the data profile was generated. - class CloudDlpDataProfile - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - - # Parents for configurations that produce data profile findings. - module ParentType - # Unspecified parent type. - PARENT_TYPE_UNSPECIFIED = 0 - - # Organization-level configurations. - ORGANIZATION = 1 - - # Project-level configurations. - PROJECT = 2 - end - end - end - end - end -end diff --git a/owl-bot-staging/google-cloud-security_center-v2/proto_docs/google/cloud/securitycenter/v2/cloud_dlp_inspection.rb b/owl-bot-staging/google-cloud-security_center-v2/proto_docs/google/cloud/securitycenter/v2/cloud_dlp_inspection.rb deleted file mode 100644 index 123bea548585..000000000000 --- a/owl-bot-staging/google-cloud-security_center-v2/proto_docs/google/cloud/securitycenter/v2/cloud_dlp_inspection.rb +++ /dev/null @@ -1,50 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - - -module Google - module Cloud - module SecurityCenter - module V2 - # Details about the Cloud Data Loss Prevention (Cloud DLP) [inspection - # job](https://cloud.google.com/dlp/docs/concepts-job-triggers) that produced - # the finding. - # @!attribute [rw] inspect_job - # @return [::String] - # Name of the inspection job, for example, - # `projects/123/locations/europe/dlpJobs/i-8383929`. - # @!attribute [rw] info_type - # @return [::String] - # The type of information (or - # *[infoType](https://cloud.google.com/dlp/docs/infotypes-reference)*) found, - # for example, `EMAIL_ADDRESS` or `STREET_ADDRESS`. - # @!attribute [rw] info_type_count - # @return [::Integer] - # The number of times Cloud DLP found this infoType within this job - # and resource. - # @!attribute [rw] full_scan - # @return [::Boolean] - # Whether Cloud DLP scanned the complete resource or a sampled subset. - class CloudDlpInspection - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - end - end - end -end diff --git a/owl-bot-staging/google-cloud-security_center-v2/proto_docs/google/cloud/securitycenter/v2/compliance.rb b/owl-bot-staging/google-cloud-security_center-v2/proto_docs/google/cloud/securitycenter/v2/compliance.rb deleted file mode 100644 index 01a4fe458c2d..000000000000 --- a/owl-bot-staging/google-cloud-security_center-v2/proto_docs/google/cloud/securitycenter/v2/compliance.rb +++ /dev/null @@ -1,43 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - - -module Google - module Cloud - module SecurityCenter - module V2 - # Contains compliance information about a security standard indicating unmet - # recommendations. - # @!attribute [rw] standard - # @return [::String] - # Industry-wide compliance standards or benchmarks, such as CIS, PCI, and - # OWASP. - # @!attribute [rw] version - # @return [::String] - # Version of the standard or benchmark, for example, 1.1 - # @!attribute [rw] ids - # @return [::Array<::String>] - # Policies within the standard or benchmark, for example, A.12.4.1 - class Compliance - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - end - end - end -end diff --git a/owl-bot-staging/google-cloud-security_center-v2/proto_docs/google/cloud/securitycenter/v2/connection.rb b/owl-bot-staging/google-cloud-security_center-v2/proto_docs/google/cloud/securitycenter/v2/connection.rb deleted file mode 100644 index 6e6ae87bd5c1..000000000000 --- a/owl-bot-staging/google-cloud-security_center-v2/proto_docs/google/cloud/securitycenter/v2/connection.rb +++ /dev/null @@ -1,70 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - - -module Google - module Cloud - module SecurityCenter - module V2 - # Contains information about the IP connection associated with the finding. - # @!attribute [rw] destination_ip - # @return [::String] - # Destination IP address. Not present for sockets that are listening and not - # connected. - # @!attribute [rw] destination_port - # @return [::Integer] - # Destination port. Not present for sockets that are listening and not - # connected. - # @!attribute [rw] source_ip - # @return [::String] - # Source IP address. - # @!attribute [rw] source_port - # @return [::Integer] - # Source port. - # @!attribute [rw] protocol - # @return [::Google::Cloud::SecurityCenter::V2::Connection::Protocol] - # IANA Internet Protocol Number such as TCP(6) and UDP(17). - class Connection - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - - # IANA Internet Protocol Number such as TCP(6) and UDP(17). - module Protocol - # Unspecified protocol (not HOPOPT). - PROTOCOL_UNSPECIFIED = 0 - - # Internet Control Message Protocol. - ICMP = 1 - - # Transmission Control Protocol. - TCP = 6 - - # User Datagram Protocol. - UDP = 17 - - # Generic Routing Encapsulation. - GRE = 47 - - # Encap Security Payload. - ESP = 50 - end - end - end - end - end -end diff --git a/owl-bot-staging/google-cloud-security_center-v2/proto_docs/google/cloud/securitycenter/v2/contact_details.rb b/owl-bot-staging/google-cloud-security_center-v2/proto_docs/google/cloud/securitycenter/v2/contact_details.rb deleted file mode 100644 index 70a23d045d97..000000000000 --- a/owl-bot-staging/google-cloud-security_center-v2/proto_docs/google/cloud/securitycenter/v2/contact_details.rb +++ /dev/null @@ -1,44 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - - -module Google - module Cloud - module SecurityCenter - module V2 - # Details about specific contacts - # @!attribute [rw] contacts - # @return [::Array<::Google::Cloud::SecurityCenter::V2::Contact>] - # A list of contacts - class ContactDetails - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # The email address of a contact. - # @!attribute [rw] email - # @return [::String] - # An email address. For example, "`person123@company.com`". - class Contact - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - end - end - end -end diff --git a/owl-bot-staging/google-cloud-security_center-v2/proto_docs/google/cloud/securitycenter/v2/container.rb b/owl-bot-staging/google-cloud-security_center-v2/proto_docs/google/cloud/securitycenter/v2/container.rb deleted file mode 100644 index 5fd4972d8657..000000000000 --- a/owl-bot-staging/google-cloud-security_center-v2/proto_docs/google/cloud/securitycenter/v2/container.rb +++ /dev/null @@ -1,49 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - - -module Google - module Cloud - module SecurityCenter - module V2 - # Container associated with the finding. - # @!attribute [rw] name - # @return [::String] - # Name of the container. - # @!attribute [rw] uri - # @return [::String] - # Container image URI provided when configuring a pod or container. This - # string can identify a container image version using mutable tags. - # @!attribute [rw] image_id - # @return [::String] - # Optional container image ID, if provided by the container runtime. Uniquely - # identifies the container image launched using a container image digest. - # @!attribute [rw] labels - # @return [::Array<::Google::Cloud::SecurityCenter::V2::Label>] - # Container labels, as provided by the container runtime. - # @!attribute [rw] create_time - # @return [::Google::Protobuf::Timestamp] - # The time that the container was created. - class Container - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - end - end - end -end diff --git a/owl-bot-staging/google-cloud-security_center-v2/proto_docs/google/cloud/securitycenter/v2/data_access_event.rb b/owl-bot-staging/google-cloud-security_center-v2/proto_docs/google/cloud/securitycenter/v2/data_access_event.rb deleted file mode 100644 index 35c543064430..000000000000 --- a/owl-bot-staging/google-cloud-security_center-v2/proto_docs/google/cloud/securitycenter/v2/data_access_event.rb +++ /dev/null @@ -1,61 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - - -module Google - module Cloud - module SecurityCenter - module V2 - # Details about a data access attempt made by a principal not authorized under - # applicable data security policy. - # @!attribute [rw] event_id - # @return [::String] - # Unique identifier for data access event. - # @!attribute [rw] principal_email - # @return [::String] - # The email address of the principal that accessed the data. The principal - # could be a user account, service account, Google group, or other. - # @!attribute [rw] operation - # @return [::Google::Cloud::SecurityCenter::V2::DataAccessEvent::Operation] - # The operation performed by the principal to access the data. - # @!attribute [rw] event_time - # @return [::Google::Protobuf::Timestamp] - # Timestamp of data access event. - class DataAccessEvent - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - - # The operation of a data access event. - module Operation - # The operation is unspecified. - OPERATION_UNSPECIFIED = 0 - - # Represents a read operation. - READ = 1 - - # Represents a move operation. - MOVE = 2 - - # Represents a copy operation. - COPY = 3 - end - end - end - end - end -end diff --git a/owl-bot-staging/google-cloud-security_center-v2/proto_docs/google/cloud/securitycenter/v2/data_flow_event.rb b/owl-bot-staging/google-cloud-security_center-v2/proto_docs/google/cloud/securitycenter/v2/data_flow_event.rb deleted file mode 100644 index ae25f8a2cff3..000000000000 --- a/owl-bot-staging/google-cloud-security_center-v2/proto_docs/google/cloud/securitycenter/v2/data_flow_event.rb +++ /dev/null @@ -1,65 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - - -module Google - module Cloud - module SecurityCenter - module V2 - # Details about a data flow event, in which either the data is moved to or is - # accessed from a non-compliant geo-location, as defined in the applicable data - # security policy. - # @!attribute [rw] event_id - # @return [::String] - # Unique identifier for data flow event. - # @!attribute [rw] principal_email - # @return [::String] - # The email address of the principal that initiated the data flow event. The - # principal could be a user account, service account, Google group, or other. - # @!attribute [rw] operation - # @return [::Google::Cloud::SecurityCenter::V2::DataFlowEvent::Operation] - # The operation performed by the principal for the data flow event. - # @!attribute [rw] violated_location - # @return [::String] - # Non-compliant location of the principal or the data destination. - # @!attribute [rw] event_time - # @return [::Google::Protobuf::Timestamp] - # Timestamp of data flow event. - class DataFlowEvent - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - - # The operation of a data flow event. - module Operation - # The operation is unspecified. - OPERATION_UNSPECIFIED = 0 - - # Represents a read operation. - READ = 1 - - # Represents a move operation. - MOVE = 2 - - # Represents a copy operation. - COPY = 3 - end - end - end - end - end -end diff --git a/owl-bot-staging/google-cloud-security_center-v2/proto_docs/google/cloud/securitycenter/v2/data_retention_deletion_event.rb b/owl-bot-staging/google-cloud-security_center-v2/proto_docs/google/cloud/securitycenter/v2/data_retention_deletion_event.rb deleted file mode 100644 index 978743068cc9..000000000000 --- a/owl-bot-staging/google-cloud-security_center-v2/proto_docs/google/cloud/securitycenter/v2/data_retention_deletion_event.rb +++ /dev/null @@ -1,69 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - - -module Google - module Cloud - module SecurityCenter - module V2 - # Details about data retention deletion violations, in which the data is - # non-compliant based on their retention or deletion time, as defined in the - # applicable data security policy. The Data Retention Deletion (DRD) control is - # a control of the DSPM (Data Security Posture Management) suite that enables - # organizations to manage data retention and deletion policies in compliance - # with regulations, such as GDPR and CRPA. DRD supports two primary policy - # types: maximum storage length (max TTL) and minimum storage length (min TTL). - # Both are aimed at helping organizations meet regulatory and data management - # commitments. - # @!attribute [rw] event_detection_time - # @return [::Google::Protobuf::Timestamp] - # Timestamp indicating when the event was detected. - # @!attribute [rw] data_object_count - # @return [::Integer] - # Number of objects that violated the policy for this resource. If the number - # is less than 1,000, then the value of this field is the exact number. If - # the number of objects that violated the policy is greater than or equal to - # 1,000, then the value of this field is 1000. - # @!attribute [rw] max_retention_allowed - # @return [::Google::Protobuf::Duration] - # Maximum duration of retention allowed from the DRD control. This comes - # from the DRD control where users set a max TTL for their data. For example, - # suppose that a user sets the max TTL for a Cloud Storage bucket to 90 days. - # However, an object in that bucket is 100 days old. In this case, a - # DataRetentionDeletionEvent will be generated for that Cloud Storage bucket, - # and the max_retention_allowed is 90 days. - # @!attribute [rw] event_type - # @return [::Google::Cloud::SecurityCenter::V2::DataRetentionDeletionEvent::EventType] - # Type of the DRD event. - class DataRetentionDeletionEvent - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - - # Type of the DRD event. - module EventType - # Unspecified event type. - EVENT_TYPE_UNSPECIFIED = 0 - - # The maximum retention time has been exceeded. - EVENT_TYPE_MAX_TTL_EXCEEDED = 1 - end - end - end - end - end -end diff --git a/owl-bot-staging/google-cloud-security_center-v2/proto_docs/google/cloud/securitycenter/v2/database.rb b/owl-bot-staging/google-cloud-security_center-v2/proto_docs/google/cloud/securitycenter/v2/database.rb deleted file mode 100644 index 39782b12e5ae..000000000000 --- a/owl-bot-staging/google-cloud-security_center-v2/proto_docs/google/cloud/securitycenter/v2/database.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 Cloud - module SecurityCenter - module V2 - # Represents database access information, such as queries. A database may be a - # sub-resource of an instance (as in the case of Cloud SQL instances or Cloud - # Spanner instances), or the database instance itself. Some database resources - # might not have the [full resource - # name](https://google.aip.dev/122#full-resource-names) populated because these - # resource types, such as Cloud SQL databases, are not yet supported by Cloud - # Asset Inventory. In these cases only the display name is provided. - # @!attribute [rw] name - # @return [::String] - # Some database resources may not have the [full resource - # name](https://google.aip.dev/122#full-resource-names) populated because - # these resource types are not yet supported by Cloud Asset Inventory (e.g. - # Cloud SQL databases). In these cases only the display name will be - # provided. - # The [full resource name](https://google.aip.dev/122#full-resource-names) of - # the database that the user connected to, if it is supported by Cloud Asset - # Inventory. - # @!attribute [rw] display_name - # @return [::String] - # The human-readable name of the database that the user connected to. - # @!attribute [rw] user_name - # @return [::String] - # The username used to connect to the database. The username might not be an - # IAM principal and does not have a set format. - # @!attribute [rw] query - # @return [::String] - # The SQL statement that is associated with the database access. - # @!attribute [rw] grantees - # @return [::Array<::String>] - # The target usernames, roles, or groups of an SQL privilege grant, which is - # not an IAM policy change. - # @!attribute [rw] version - # @return [::String] - # The version of the database, for example, POSTGRES_14. - # See [the complete - # list](https://cloud.google.com/sql/docs/mysql/admin-api/rest/v1/SqlDatabaseVersion). - class Database - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - end - end - end -end diff --git a/owl-bot-staging/google-cloud-security_center-v2/proto_docs/google/cloud/securitycenter/v2/disk.rb b/owl-bot-staging/google-cloud-security_center-v2/proto_docs/google/cloud/securitycenter/v2/disk.rb deleted file mode 100644 index 0f63d09304ea..000000000000 --- a/owl-bot-staging/google-cloud-security_center-v2/proto_docs/google/cloud/securitycenter/v2/disk.rb +++ /dev/null @@ -1,36 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - - -module Google - module Cloud - module SecurityCenter - module V2 - # Contains information about the disk associated with the finding. - # @!attribute [rw] name - # @return [::String] - # The name of the disk, for example, - # "https://www.googleapis.com/compute/v1/projects/\\{project-id}/zones/\\{zone-id}/disks/\\{disk-id}". - class Disk - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - end - end - end -end diff --git a/owl-bot-staging/google-cloud-security_center-v2/proto_docs/google/cloud/securitycenter/v2/exfiltration.rb b/owl-bot-staging/google-cloud-security_center-v2/proto_docs/google/cloud/securitycenter/v2/exfiltration.rb deleted file mode 100644 index e982b02dfc10..000000000000 --- a/owl-bot-staging/google-cloud-security_center-v2/proto_docs/google/cloud/securitycenter/v2/exfiltration.rb +++ /dev/null @@ -1,64 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - - -module Google - module Cloud - module SecurityCenter - module V2 - # Exfiltration represents a data exfiltration attempt from one or more sources - # to one or more targets. The `sources` attribute lists the sources of the - # exfiltrated data. The `targets` attribute lists the destinations the data was - # copied to. - # @!attribute [rw] sources - # @return [::Array<::Google::Cloud::SecurityCenter::V2::ExfilResource>] - # If there are multiple sources, then the data is considered "joined" between - # them. For instance, BigQuery can join multiple tables, and each - # table would be considered a source. - # @!attribute [rw] targets - # @return [::Array<::Google::Cloud::SecurityCenter::V2::ExfilResource>] - # If there are multiple targets, each target would get a complete copy of the - # "joined" source data. - # @!attribute [rw] total_exfiltrated_bytes - # @return [::Integer] - # Total exfiltrated bytes processed for the entire job. - class Exfiltration - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Resource where data was exfiltrated from or exfiltrated to. - # @!attribute [rw] name - # @return [::String] - # The resource's [full resource - # name](https://cloud.google.com/apis/design/resource_names#full_resource_name). - # @!attribute [rw] components - # @return [::Array<::String>] - # Subcomponents of the asset that was exfiltrated, like URIs used during - # exfiltration, table names, databases, and filenames. For example, multiple - # tables might have been exfiltrated from the same Cloud SQL instance, or - # multiple files might have been exfiltrated from the same Cloud Storage - # bucket. - class ExfilResource - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - end - end - end -end diff --git a/owl-bot-staging/google-cloud-security_center-v2/proto_docs/google/cloud/securitycenter/v2/external_system.rb b/owl-bot-staging/google-cloud-security_center-v2/proto_docs/google/cloud/securitycenter/v2/external_system.rb deleted file mode 100644 index d13da6e40e27..000000000000 --- a/owl-bot-staging/google-cloud-security_center-v2/proto_docs/google/cloud/securitycenter/v2/external_system.rb +++ /dev/null @@ -1,106 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - - -module Google - module Cloud - module SecurityCenter - module V2 - # Representation of third party SIEM/SOAR fields within SCC. - # @!attribute [rw] name - # @return [::String] - # Full resource name of the external system. The following list - # shows some examples: - # - # + `organizations/1234/sources/5678/findings/123456/externalSystems/jira` - # + - # `organizations/1234/sources/5678/locations/us/findings/123456/externalSystems/jira` - # + `folders/1234/sources/5678/findings/123456/externalSystems/jira` - # + - # `folders/1234/sources/5678/locations/us/findings/123456/externalSystems/jira` - # + `projects/1234/sources/5678/findings/123456/externalSystems/jira` - # + - # `projects/1234/sources/5678/locations/us/findings/123456/externalSystems/jira` - # @!attribute [rw] assignees - # @return [::Array<::String>] - # References primary/secondary etc assignees in the external system. - # @!attribute [rw] external_uid - # @return [::String] - # The identifier that's used to track the finding's corresponding case in the - # external system. - # @!attribute [rw] status - # @return [::String] - # The most recent status of the finding's corresponding case, as reported by - # the external system. - # @!attribute [rw] external_system_update_time - # @return [::Google::Protobuf::Timestamp] - # The time when the case was last updated, as reported by the external - # system. - # @!attribute [rw] case_uri - # @return [::String] - # The link to the finding's corresponding case in the external system. - # @!attribute [rw] case_priority - # @return [::String] - # The priority of the finding's corresponding case in the external system. - # @!attribute [rw] case_sla - # @return [::Google::Protobuf::Timestamp] - # The SLA of the finding's corresponding case in the external system. - # @!attribute [rw] case_create_time - # @return [::Google::Protobuf::Timestamp] - # The time when the case was created, as reported by the external system. - # @!attribute [rw] case_close_time - # @return [::Google::Protobuf::Timestamp] - # The time when the case was closed, as reported by the external system. - # @!attribute [rw] ticket_info - # @return [::Google::Cloud::SecurityCenter::V2::ExternalSystem::TicketInfo] - # Information about the ticket, if any, that is being used to track the - # resolution of the issue that is identified by this finding. - class ExternalSystem - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - - # Information about the ticket, if any, that is being used to track the - # resolution of the issue that is identified by this finding. - # @!attribute [rw] id - # @return [::String] - # The identifier of the ticket in the ticket system. - # @!attribute [rw] assignee - # @return [::String] - # The assignee of the ticket in the ticket system. - # @!attribute [rw] description - # @return [::String] - # The description of the ticket in the ticket system. - # @!attribute [rw] uri - # @return [::String] - # The link to the ticket in the ticket system. - # @!attribute [rw] status - # @return [::String] - # The latest status of the ticket, as reported by the ticket system. - # @!attribute [rw] update_time - # @return [::Google::Protobuf::Timestamp] - # The time when the ticket was last updated, as reported by the ticket - # system. - class TicketInfo - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - end - end - end - end -end diff --git a/owl-bot-staging/google-cloud-security_center-v2/proto_docs/google/cloud/securitycenter/v2/file.rb b/owl-bot-staging/google-cloud-security_center-v2/proto_docs/google/cloud/securitycenter/v2/file.rb deleted file mode 100644 index fcea377226df..000000000000 --- a/owl-bot-staging/google-cloud-security_center-v2/proto_docs/google/cloud/securitycenter/v2/file.rb +++ /dev/null @@ -1,105 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - - -module Google - module Cloud - module SecurityCenter - module V2 - # File information about the related binary/library used by an executable, or - # the script used by a script interpreter - # @!attribute [rw] path - # @return [::String] - # Absolute path of the file as a JSON encoded string. - # @!attribute [rw] size - # @return [::Integer] - # Size of the file in bytes. - # @!attribute [rw] sha256 - # @return [::String] - # SHA256 hash of the first hashed_size bytes of the file encoded as a - # hex string. If hashed_size == size, sha256 represents the SHA256 hash - # of the entire file. - # @!attribute [rw] hashed_size - # @return [::Integer] - # The length in bytes of the file prefix that was hashed. If - # hashed_size == size, any hashes reported represent the entire - # file. - # @!attribute [rw] partially_hashed - # @return [::Boolean] - # True when the hash covers only a prefix of the file. - # @!attribute [rw] contents - # @return [::String] - # Prefix of the file contents as a JSON-encoded string. - # @!attribute [rw] disk_path - # @return [::Google::Cloud::SecurityCenter::V2::File::DiskPath] - # Path of the file in terms of underlying disk/partition identifiers. - # @!attribute [rw] operations - # @return [::Array<::Google::Cloud::SecurityCenter::V2::File::FileOperation>] - # Operation(s) performed on a file. - class File - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - - # Path of the file in terms of underlying disk/partition identifiers. - # @!attribute [rw] partition_uuid - # @return [::String] - # UUID of the partition (format - # https://wiki.archlinux.org/title/persistent_block_device_naming#by-uuid) - # @!attribute [rw] relative_path - # @return [::String] - # Relative path of the file in the partition as a JSON encoded string. - # Example: /home/user1/executable_file.sh - class DiskPath - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Operation(s) performed on a file. - # @!attribute [rw] type - # @return [::Google::Cloud::SecurityCenter::V2::File::FileOperation::OperationType] - # The type of the operation - class FileOperation - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - - # The type of the operation - module OperationType - # The operation is unspecified. - OPERATION_TYPE_UNSPECIFIED = 0 - - # Represents an open operation. - OPEN = 1 - - # Represents a read operation. - READ = 2 - - # Represents a rename operation. - RENAME = 3 - - # Represents a write operation. - WRITE = 4 - - # Represents an execute operation. - EXECUTE = 5 - end - end - end - end - end - end -end diff --git a/owl-bot-staging/google-cloud-security_center-v2/proto_docs/google/cloud/securitycenter/v2/finding.rb b/owl-bot-staging/google-cloud-security_center-v2/proto_docs/google/cloud/securitycenter/v2/finding.rb deleted file mode 100644 index b9a79e5e7650..000000000000 --- a/owl-bot-staging/google-cloud-security_center-v2/proto_docs/google/cloud/securitycenter/v2/finding.rb +++ /dev/null @@ -1,524 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - - -module Google - module Cloud - module SecurityCenter - module V2 - # Security Command Center finding. - # - # A finding is a record of assessment data like security, risk, health, or - # privacy, that is ingested into Security Command Center for presentation, - # notification, analysis, policy testing, and enforcement. For example, a - # cross-site scripting (XSS) vulnerability in an App Engine application is a - # finding. - # @!attribute [rw] name - # @return [::String] - # Identifier. The [relative resource - # name](https://cloud.google.com/apis/design/resource_names#relative_resource_name) - # of the finding. The following list shows some examples: - # - # + - # `organizations/{organization_id}/sources/{source_id}/findings/{finding_id}` - # + - # `organizations/{organization_id}/sources/{source_id}/locations/{location_id}/findings/{finding_id}` - # + `folders/{folder_id}/sources/{source_id}/findings/{finding_id}` - # + - # `folders/{folder_id}/sources/{source_id}/locations/{location_id}/findings/{finding_id}` - # + `projects/{project_id}/sources/{source_id}/findings/{finding_id}` - # + - # `projects/{project_id}/sources/{source_id}/locations/{location_id}/findings/{finding_id}` - # @!attribute [r] canonical_name - # @return [::String] - # Output only. The canonical name of the finding. The following list shows - # some examples: - # - # + - # `organizations/{organization_id}/sources/{source_id}/findings/{finding_id}` - # + - # `organizations/{organization_id}/sources/{source_id}/locations/{location_id}/findings/{finding_id}` - # + `folders/{folder_id}/sources/{source_id}/findings/{finding_id}` - # + - # `folders/{folder_id}/sources/{source_id}/locations/{location_id}/findings/{finding_id}` - # + `projects/{project_id}/sources/{source_id}/findings/{finding_id}` - # + - # `projects/{project_id}/sources/{source_id}/locations/{location_id}/findings/{finding_id}` - # - # The prefix is the closest CRM ancestor of the resource associated with the - # finding. - # @!attribute [rw] parent - # @return [::String] - # The relative resource name of the source and location the finding belongs - # to. See: - # https://cloud.google.com/apis/design/resource_names#relative_resource_name - # This field is immutable after creation time. The following list shows some - # examples: - # - # + `organizations/{organization_id}/sources/{source_id}` - # + `folders/{folders_id}/sources/{source_id}` - # + `projects/{projects_id}/sources/{source_id}` - # + - # `organizations/{organization_id}/sources/{source_id}/locations/{location_id}` - # + `folders/{folders_id}/sources/{source_id}/locations/{location_id}` - # + `projects/{projects_id}/sources/{source_id}/locations/{location_id}` - # @!attribute [rw] resource_name - # @return [::String] - # Immutable. For findings on Google Cloud resources, the full resource - # name of the Google Cloud resource this finding is for. See: - # https://cloud.google.com/apis/design/resource_names#full_resource_name - # When the finding is for a non-Google Cloud resource, the resourceName can - # be a customer or partner defined string. - # @!attribute [r] state - # @return [::Google::Cloud::SecurityCenter::V2::Finding::State] - # Output only. The state of the finding. - # @!attribute [rw] category - # @return [::String] - # Immutable. The additional taxonomy group within findings from a given - # source. Example: "XSS_FLASH_INJECTION" - # @!attribute [rw] external_uri - # @return [::String] - # The URI that, if available, points to a web page outside of Security - # Command Center where additional information about the finding can be found. - # This field is guaranteed to be either empty or a well formed URL. - # @!attribute [rw] source_properties - # @return [::Google::Protobuf::Map{::String => ::Google::Protobuf::Value}] - # Source specific properties. These properties are managed by the source - # that writes the finding. The key names in the source_properties map must be - # between 1 and 255 characters, and must start with a letter and contain - # alphanumeric characters or underscores only. - # @!attribute [r] security_marks - # @return [::Google::Cloud::SecurityCenter::V2::SecurityMarks] - # Output only. User specified security marks. These marks are entirely - # managed by the user and come from the SecurityMarks resource that belongs - # to the finding. - # @!attribute [rw] event_time - # @return [::Google::Protobuf::Timestamp] - # The time the finding was first detected. If an existing finding is updated, - # then this is the time the update occurred. - # For example, if the finding represents an open firewall, this property - # captures the time the detector believes the firewall became open. The - # accuracy is determined by the detector. If the finding is later resolved, - # then this time reflects when the finding was resolved. This must not - # be set to a value greater than the current timestamp. - # @!attribute [r] create_time - # @return [::Google::Protobuf::Timestamp] - # Output only. The time at which the finding was created in Security Command - # Center. - # @!attribute [rw] severity - # @return [::Google::Cloud::SecurityCenter::V2::Finding::Severity] - # The severity of the finding. This field is managed by the source that - # writes the finding. - # @!attribute [rw] mute - # @return [::Google::Cloud::SecurityCenter::V2::Finding::Mute] - # Indicates the mute state of a finding (either muted, unmuted - # or undefined). Unlike other attributes of a finding, a finding provider - # shouldn't set the value of mute. - # @!attribute [r] mute_info - # @return [::Google::Cloud::SecurityCenter::V2::Finding::MuteInfo] - # Output only. The mute information regarding this finding. - # @!attribute [rw] finding_class - # @return [::Google::Cloud::SecurityCenter::V2::Finding::FindingClass] - # The class of the finding. - # @!attribute [rw] indicator - # @return [::Google::Cloud::SecurityCenter::V2::Indicator] - # Represents what's commonly known as an *indicator of compromise* (IoC) in - # computer forensics. This is an artifact observed on a network or in an - # operating system that, with high confidence, indicates a computer - # intrusion. For more information, see [Indicator of - # compromise](https://en.wikipedia.org/wiki/Indicator_of_compromise). - # @!attribute [rw] vulnerability - # @return [::Google::Cloud::SecurityCenter::V2::Vulnerability] - # Represents vulnerability-specific fields like CVE and CVSS scores. - # CVE stands for Common Vulnerabilities and Exposures - # (https://cve.mitre.org/about/) - # @!attribute [r] mute_update_time - # @return [::Google::Protobuf::Timestamp] - # Output only. The most recent time this finding was muted or unmuted. - # @!attribute [r] external_systems - # @return [::Google::Protobuf::Map{::String => ::Google::Cloud::SecurityCenter::V2::ExternalSystem}] - # Output only. Third party SIEM/SOAR fields within SCC, contains external - # system information and external system finding fields. - # @!attribute [rw] mitre_attack - # @return [::Google::Cloud::SecurityCenter::V2::MitreAttack] - # MITRE ATT&CK tactics and techniques related to this finding. - # See: https://attack.mitre.org - # @!attribute [rw] access - # @return [::Google::Cloud::SecurityCenter::V2::Access] - # Access details associated with the finding, such as more information on the - # caller, which method was accessed, and from where. - # @!attribute [rw] connections - # @return [::Array<::Google::Cloud::SecurityCenter::V2::Connection>] - # Contains information about the IP connection associated with the finding. - # @!attribute [rw] mute_initiator - # @return [::String] - # Records additional information about the mute operation, for example, the - # [mute - # configuration](https://cloud.google.com/security-command-center/docs/how-to-mute-findings) - # that muted the finding and the user who muted the finding. - # @!attribute [rw] processes - # @return [::Array<::Google::Cloud::SecurityCenter::V2::Process>] - # Represents operating system processes associated with the Finding. - # @!attribute [r] contacts - # @return [::Google::Protobuf::Map{::String => ::Google::Cloud::SecurityCenter::V2::ContactDetails}] - # Output only. Map containing the points of contact for the given finding. - # The key represents the type of contact, while the value contains a list of - # all the contacts that pertain. Please refer to: - # https://cloud.google.com/resource-manager/docs/managing-notification-contacts#notification-categories - # - # { - # "security": { - # "contacts": [ - # { - # "email": "person1@company.com" - # }, - # { - # "email": "person2@company.com" - # } - # ] - # } - # } - # @!attribute [rw] compliances - # @return [::Array<::Google::Cloud::SecurityCenter::V2::Compliance>] - # Contains compliance information for security standards associated to the - # finding. - # @!attribute [r] parent_display_name - # @return [::String] - # Output only. The human readable display name of the finding source such as - # "Event Threat Detection" or "Security Health Analytics". - # @!attribute [rw] description - # @return [::String] - # Contains more details about the finding. - # @!attribute [rw] exfiltration - # @return [::Google::Cloud::SecurityCenter::V2::Exfiltration] - # Represents exfiltrations associated with the finding. - # @!attribute [rw] iam_bindings - # @return [::Array<::Google::Cloud::SecurityCenter::V2::IamBinding>] - # Represents IAM bindings associated with the finding. - # @!attribute [rw] next_steps - # @return [::String] - # Steps to address the finding. - # @!attribute [rw] module_name - # @return [::String] - # Unique identifier of the module which generated the finding. - # Example: - # folders/598186756061/securityHealthAnalyticsSettings/customModules/56799441161885 - # @!attribute [rw] containers - # @return [::Array<::Google::Cloud::SecurityCenter::V2::Container>] - # Containers associated with the finding. This field provides information for - # both Kubernetes and non-Kubernetes containers. - # @!attribute [rw] kubernetes - # @return [::Google::Cloud::SecurityCenter::V2::Kubernetes] - # Kubernetes resources associated with the finding. - # @!attribute [rw] database - # @return [::Google::Cloud::SecurityCenter::V2::Database] - # Database associated with the finding. - # @!attribute [rw] attack_exposure - # @return [::Google::Cloud::SecurityCenter::V2::AttackExposure] - # The results of an attack path simulation relevant to this finding. - # @!attribute [rw] files - # @return [::Array<::Google::Cloud::SecurityCenter::V2::File>] - # File associated with the finding. - # @!attribute [rw] cloud_dlp_inspection - # @return [::Google::Cloud::SecurityCenter::V2::CloudDlpInspection] - # Cloud Data Loss Prevention (Cloud DLP) inspection results that are - # associated with the finding. - # @!attribute [rw] cloud_dlp_data_profile - # @return [::Google::Cloud::SecurityCenter::V2::CloudDlpDataProfile] - # Cloud DLP data profile that is associated with the finding. - # @!attribute [rw] kernel_rootkit - # @return [::Google::Cloud::SecurityCenter::V2::KernelRootkit] - # Signature of the kernel rootkit. - # @!attribute [rw] org_policies - # @return [::Array<::Google::Cloud::SecurityCenter::V2::OrgPolicy>] - # Contains information about the org policies associated with the finding. - # @!attribute [rw] job - # @return [::Google::Cloud::SecurityCenter::V2::Job] - # Job associated with the finding. - # @!attribute [rw] application - # @return [::Google::Cloud::SecurityCenter::V2::Application] - # Represents an application associated with the finding. - # @!attribute [rw] ip_rules - # @return [::Google::Cloud::SecurityCenter::V2::IpRules] - # IP rules associated with the finding. - # @!attribute [rw] backup_disaster_recovery - # @return [::Google::Cloud::SecurityCenter::V2::BackupDisasterRecovery] - # Fields related to Backup and DR findings. - # @!attribute [rw] security_posture - # @return [::Google::Cloud::SecurityCenter::V2::SecurityPosture] - # The security posture associated with the finding. - # @!attribute [rw] log_entries - # @return [::Array<::Google::Cloud::SecurityCenter::V2::LogEntry>] - # Log entries that are relevant to the finding. - # @!attribute [rw] load_balancers - # @return [::Array<::Google::Cloud::SecurityCenter::V2::LoadBalancer>] - # The load balancers associated with the finding. - # @!attribute [rw] cloud_armor - # @return [::Google::Cloud::SecurityCenter::V2::CloudArmor] - # Fields related to Cloud Armor findings. - # @!attribute [rw] notebook - # @return [::Google::Cloud::SecurityCenter::V2::Notebook] - # Notebook associated with the finding. - # @!attribute [rw] toxic_combination - # @return [::Google::Cloud::SecurityCenter::V2::ToxicCombination] - # Contains details about a group of security issues that, when the issues - # occur together, represent a greater risk than when the issues occur - # independently. A group of such issues is referred to as a toxic - # combination. - # This field cannot be updated. Its value is ignored in all update requests. - # @!attribute [rw] group_memberships - # @return [::Array<::Google::Cloud::SecurityCenter::V2::GroupMembership>] - # Contains details about groups of which this finding is a member. A group is - # a collection of findings that are related in some way. - # This field cannot be updated. Its value is ignored in all update requests. - # @!attribute [rw] disk - # @return [::Google::Cloud::SecurityCenter::V2::Disk] - # Disk associated with the finding. - # @!attribute [rw] data_access_events - # @return [::Array<::Google::Cloud::SecurityCenter::V2::DataAccessEvent>] - # Data access events associated with the finding. - # @!attribute [rw] data_flow_events - # @return [::Array<::Google::Cloud::SecurityCenter::V2::DataFlowEvent>] - # Data flow events associated with the finding. - # @!attribute [rw] networks - # @return [::Array<::Google::Cloud::SecurityCenter::V2::Network>] - # Represents the VPC networks that the resource is attached to. - # @!attribute [rw] data_retention_deletion_events - # @return [::Array<::Google::Cloud::SecurityCenter::V2::DataRetentionDeletionEvent>] - # Data retention deletion events associated with the finding. - # @!attribute [rw] affected_resources - # @return [::Google::Cloud::SecurityCenter::V2::AffectedResources] - # AffectedResources associated with the finding. - # @!attribute [rw] ai_model - # @return [::Google::Cloud::SecurityCenter::V2::AiModel] - # The AI model associated with the finding. - # @!attribute [rw] chokepoint - # @return [::Google::Cloud::SecurityCenter::V2::Chokepoint] - # Contains details about a chokepoint, which is a resource or resource group - # where high-risk attack paths converge, based on [attack path simulations] - # (https://cloud.google.com/security-command-center/docs/attack-exposure-learn#attack_path_simulations). - # This field cannot be updated. Its value is ignored in all update requests. - # @!attribute [rw] vertex_ai - # @return [::Google::Cloud::SecurityCenter::V2::VertexAi] - # VertexAi associated with the finding. - class Finding - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - - # Mute information about the finding, including whether the finding has a - # static mute or any matching dynamic mute rules. - # @!attribute [rw] static_mute - # @return [::Google::Cloud::SecurityCenter::V2::Finding::MuteInfo::StaticMute] - # If set, the static mute applied to this finding. Static mutes override - # dynamic mutes. If unset, there is no static mute. - # @!attribute [rw] dynamic_mute_records - # @return [::Array<::Google::Cloud::SecurityCenter::V2::Finding::MuteInfo::DynamicMuteRecord>] - # The list of dynamic mute rules that currently match the finding. - class MuteInfo - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - - # Information about the static mute state. A static mute state overrides - # any dynamic mute rules that apply to this finding. The static mute state - # can be set by a static mute rule or by muting the finding directly. - # @!attribute [rw] state - # @return [::Google::Cloud::SecurityCenter::V2::Finding::Mute] - # The static mute state. If the value is `MUTED` or `UNMUTED`, then the - # finding's overall mute state will have the same value. - # @!attribute [rw] apply_time - # @return [::Google::Protobuf::Timestamp] - # When the static mute was applied. - class StaticMute - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # The record of a dynamic mute rule that matches the finding. - # @!attribute [rw] mute_config - # @return [::String] - # The relative resource name of the mute rule, represented by a mute - # config, that created this record, for example - # `organizations/123/muteConfigs/mymuteconfig` or - # `organizations/123/locations/global/muteConfigs/mymuteconfig`. - # @!attribute [rw] match_time - # @return [::Google::Protobuf::Timestamp] - # When the dynamic mute rule first matched the finding. - class DynamicMuteRecord - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - end - - # @!attribute [rw] key - # @return [::String] - # @!attribute [rw] value - # @return [::Google::Protobuf::Value] - class SourcePropertiesEntry - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # @!attribute [rw] key - # @return [::String] - # @!attribute [rw] value - # @return [::Google::Cloud::SecurityCenter::V2::ExternalSystem] - class ExternalSystemsEntry - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # @!attribute [rw] key - # @return [::String] - # @!attribute [rw] value - # @return [::Google::Cloud::SecurityCenter::V2::ContactDetails] - class ContactsEntry - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # The state of the finding. - module State - # Unspecified state. - STATE_UNSPECIFIED = 0 - - # The finding requires attention and has not been addressed yet. - ACTIVE = 1 - - # The finding has been fixed, triaged as a non-issue or otherwise addressed - # and is no longer active. - INACTIVE = 2 - end - - # The severity of the finding. - module Severity - # This value is used for findings when a source doesn't write a severity - # value. - SEVERITY_UNSPECIFIED = 0 - - # Vulnerability: - # A critical vulnerability is easily discoverable by an external actor, - # exploitable, and results in the direct ability to execute arbitrary code, - # exfiltrate data, and otherwise gain additional access and privileges to - # cloud resources and workloads. Examples include publicly accessible - # unprotected user data and public SSH access with weak or no - # passwords. - # - # Threat: - # Indicates a threat that is able to access, modify, or delete data or - # execute unauthorized code within existing resources. - CRITICAL = 1 - - # Vulnerability: - # A high risk vulnerability can be easily discovered and exploited in - # combination with other vulnerabilities in order to gain direct access and - # the ability to execute arbitrary code, exfiltrate data, and otherwise - # gain additional access and privileges to cloud resources and workloads. - # An example is a database with weak or no passwords that is only - # accessible internally. This database could easily be compromised by an - # actor that had access to the internal network. - # - # Threat: - # Indicates a threat that is able to create new computational resources in - # an environment but not able to access data or execute code in existing - # resources. - HIGH = 2 - - # Vulnerability: - # A medium risk vulnerability could be used by an actor to gain access to - # resources or privileges that enable them to eventually (through multiple - # steps or a complex exploit) gain access and the ability to execute - # arbitrary code or exfiltrate data. An example is a service account with - # access to more projects than it should have. If an actor gains access to - # the service account, they could potentially use that access to manipulate - # a project the service account was not intended to. - # - # Threat: - # Indicates a threat that is able to cause operational impact but may not - # access data or execute unauthorized code. - MEDIUM = 3 - - # Vulnerability: - # A low risk vulnerability hampers a security organization's ability to - # detect vulnerabilities or active threats in their deployment, or prevents - # the root cause investigation of security issues. An example is monitoring - # and logs being disabled for resource configurations and access. - # - # Threat: - # Indicates a threat that has obtained minimal access to an environment but - # is not able to access data, execute code, or create resources. - LOW = 4 - end - - # Mute state a finding can be in. - module Mute - # Unspecified. - MUTE_UNSPECIFIED = 0 - - # Finding has been muted. - MUTED = 1 - - # Finding has been unmuted. - UNMUTED = 2 - - # Finding has never been muted/unmuted. - UNDEFINED = 3 - end - - # Represents what kind of Finding it is. - module FindingClass - # Unspecified finding class. - FINDING_CLASS_UNSPECIFIED = 0 - - # Describes unwanted or malicious activity. - THREAT = 1 - - # Describes a potential weakness in software that increases risk to - # Confidentiality & Integrity & Availability. - VULNERABILITY = 2 - - # Describes a potential weakness in cloud resource/asset configuration that - # increases risk. - MISCONFIGURATION = 3 - - # Describes a security observation that is for informational purposes. - OBSERVATION = 4 - - # Describes an error that prevents some SCC functionality. - SCC_ERROR = 5 - - # Describes a potential security risk due to a change in the security - # posture. - POSTURE_VIOLATION = 6 - - # Describes a combination of security issues that represent a more severe - # security problem when taken together. - TOXIC_COMBINATION = 7 - - # Describes a potential security risk to data assets that contain sensitive - # data. - SENSITIVE_DATA_RISK = 8 - - # Describes a resource or resource group where high risk attack paths - # converge, based on attack path simulations (APS). - CHOKEPOINT = 9 - end - end - end - end - end -end diff --git a/owl-bot-staging/google-cloud-security_center-v2/proto_docs/google/cloud/securitycenter/v2/folder.rb b/owl-bot-staging/google-cloud-security_center-v2/proto_docs/google/cloud/securitycenter/v2/folder.rb deleted file mode 100644 index a56cbebc0318..000000000000 --- a/owl-bot-staging/google-cloud-security_center-v2/proto_docs/google/cloud/securitycenter/v2/folder.rb +++ /dev/null @@ -1,40 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - - -module Google - module Cloud - module SecurityCenter - module V2 - # Message that contains the resource name and display name of a folder - # resource. - # @!attribute [rw] resource_folder - # @return [::String] - # Full resource name of this folder. See: - # https://cloud.google.com/apis/design/resource_names#full_resource_name - # @!attribute [rw] resource_folder_display_name - # @return [::String] - # The user defined display name for this folder. - class Folder - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - end - end - end -end diff --git a/owl-bot-staging/google-cloud-security_center-v2/proto_docs/google/cloud/securitycenter/v2/group_membership.rb b/owl-bot-staging/google-cloud-security_center-v2/proto_docs/google/cloud/securitycenter/v2/group_membership.rb deleted file mode 100644 index 4b2f90a8e17c..000000000000 --- a/owl-bot-staging/google-cloud-security_center-v2/proto_docs/google/cloud/securitycenter/v2/group_membership.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! - - -module Google - module Cloud - module SecurityCenter - module V2 - # Contains details about groups of which this finding is a member. A group is a - # collection of findings that are related in some way. - # @!attribute [rw] group_type - # @return [::Google::Cloud::SecurityCenter::V2::GroupMembership::GroupType] - # Type of group. - # @!attribute [rw] group_id - # @return [::String] - # ID of the group. - class GroupMembership - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - - # Possible types of groups. - module GroupType - # Default value. - GROUP_TYPE_UNSPECIFIED = 0 - - # Group represents a toxic combination. - GROUP_TYPE_TOXIC_COMBINATION = 1 - - # Group represents a chokepoint. - GROUP_TYPE_CHOKEPOINT = 3 - end - end - end - end - end -end diff --git a/owl-bot-staging/google-cloud-security_center-v2/proto_docs/google/cloud/securitycenter/v2/iam_binding.rb b/owl-bot-staging/google-cloud-security_center-v2/proto_docs/google/cloud/securitycenter/v2/iam_binding.rb deleted file mode 100644 index 879809624b27..000000000000 --- a/owl-bot-staging/google-cloud-security_center-v2/proto_docs/google/cloud/securitycenter/v2/iam_binding.rb +++ /dev/null @@ -1,56 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - - -module Google - module Cloud - module SecurityCenter - module V2 - # Represents a particular IAM binding, which captures a member's role addition, - # removal, or state. - # @!attribute [rw] action - # @return [::Google::Cloud::SecurityCenter::V2::IamBinding::Action] - # The action that was performed on a Binding. - # @!attribute [rw] role - # @return [::String] - # Role that is assigned to "members". - # For example, "roles/viewer", "roles/editor", or "roles/owner". - # @!attribute [rw] member - # @return [::String] - # A single identity requesting access for a Cloud Platform resource, for - # example, "foo@google.com". - class IamBinding - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - - # The type of action performed on a Binding in a policy. - module Action - # Unspecified. - ACTION_UNSPECIFIED = 0 - - # Addition of a Binding. - ADD = 1 - - # Removal of a Binding. - REMOVE = 2 - end - end - end - end - end -end diff --git a/owl-bot-staging/google-cloud-security_center-v2/proto_docs/google/cloud/securitycenter/v2/indicator.rb b/owl-bot-staging/google-cloud-security_center-v2/proto_docs/google/cloud/securitycenter/v2/indicator.rb deleted file mode 100644 index 85acfa00a4c5..000000000000 --- a/owl-bot-staging/google-cloud-security_center-v2/proto_docs/google/cloud/securitycenter/v2/indicator.rb +++ /dev/null @@ -1,116 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - - -module Google - module Cloud - module SecurityCenter - module V2 - # Represents what's commonly known as an _indicator of compromise_ (IoC) in - # computer forensics. This is an artifact observed on a network or in an - # operating system that, with high confidence, indicates a computer intrusion. - # For more information, see [Indicator of - # compromise](https://en.wikipedia.org/wiki/Indicator_of_compromise). - # @!attribute [rw] ip_addresses - # @return [::Array<::String>] - # The list of IP addresses that are associated with the finding. - # @!attribute [rw] domains - # @return [::Array<::String>] - # List of domains associated to the Finding. - # @!attribute [rw] signatures - # @return [::Array<::Google::Cloud::SecurityCenter::V2::Indicator::ProcessSignature>] - # The list of matched signatures indicating that the given - # process is present in the environment. - # @!attribute [rw] uris - # @return [::Array<::String>] - # The list of URIs associated to the Findings. - class Indicator - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - - # Indicates what signature matched this process. - # @!attribute [rw] memory_hash_signature - # @return [::Google::Cloud::SecurityCenter::V2::Indicator::ProcessSignature::MemoryHashSignature] - # Signature indicating that a binary family was matched. - # - # Note: The following fields are mutually exclusive: `memory_hash_signature`, `yara_rule_signature`. If a field in that set is populated, all other fields in the set will automatically be cleared. - # @!attribute [rw] yara_rule_signature - # @return [::Google::Cloud::SecurityCenter::V2::Indicator::ProcessSignature::YaraRuleSignature] - # Signature indicating that a YARA rule was matched. - # - # Note: The following fields are mutually exclusive: `yara_rule_signature`, `memory_hash_signature`. If a field in that set is populated, all other fields in the set will automatically be cleared. - # @!attribute [rw] signature_type - # @return [::Google::Cloud::SecurityCenter::V2::Indicator::ProcessSignature::SignatureType] - # Describes the type of resource associated with the signature. - class ProcessSignature - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - - # A signature corresponding to memory page hashes. - # @!attribute [rw] binary_family - # @return [::String] - # The binary family. - # @!attribute [rw] detections - # @return [::Array<::Google::Cloud::SecurityCenter::V2::Indicator::ProcessSignature::MemoryHashSignature::Detection>] - # The list of memory hash detections contributing to the binary family - # match. - class MemoryHashSignature - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - - # Memory hash detection contributing to the binary family match. - # @!attribute [rw] binary - # @return [::String] - # The name of the binary associated with the memory hash - # signature detection. - # @!attribute [rw] percent_pages_matched - # @return [::Float] - # The percentage of memory page hashes in the signature - # that were matched. - class Detection - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - end - - # A signature corresponding to a YARA rule. - # @!attribute [rw] yara_rule - # @return [::String] - # The name of the YARA rule. - class YaraRuleSignature - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Possible resource types to be associated with a signature. - module SignatureType - # The default signature type. - SIGNATURE_TYPE_UNSPECIFIED = 0 - - # Used for signatures concerning processes. - SIGNATURE_TYPE_PROCESS = 1 - - # Used for signatures concerning disks. - SIGNATURE_TYPE_FILE = 2 - end - end - end - end - end - end -end diff --git a/owl-bot-staging/google-cloud-security_center-v2/proto_docs/google/cloud/securitycenter/v2/ip_rules.rb b/owl-bot-staging/google-cloud-security_center-v2/proto_docs/google/cloud/securitycenter/v2/ip_rules.rb deleted file mode 100644 index ce71b3883188..000000000000 --- a/owl-bot-staging/google-cloud-security_center-v2/proto_docs/google/cloud/securitycenter/v2/ip_rules.rb +++ /dev/null @@ -1,122 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - - -module Google - module Cloud - module SecurityCenter - module V2 - # IP rules associated with the finding. - # @!attribute [rw] direction - # @return [::Google::Cloud::SecurityCenter::V2::IpRules::Direction] - # The direction that the rule is applicable to, one of ingress or egress. - # @!attribute [rw] allowed - # @return [::Google::Cloud::SecurityCenter::V2::Allowed] - # Tuple with allowed rules. - # - # Note: The following fields are mutually exclusive: `allowed`, `denied`. If a field in that set is populated, all other fields in the set will automatically be cleared. - # @!attribute [rw] denied - # @return [::Google::Cloud::SecurityCenter::V2::Denied] - # Tuple with denied rules. - # - # Note: The following fields are mutually exclusive: `denied`, `allowed`. If a field in that set is populated, all other fields in the set will automatically be cleared. - # @!attribute [rw] source_ip_ranges - # @return [::Array<::String>] - # If source IP ranges are specified, the firewall rule applies only to - # traffic that has a source IP address in these ranges. These ranges must be - # expressed in CIDR format. Only supports IPv4. - # @!attribute [rw] destination_ip_ranges - # @return [::Array<::String>] - # If destination IP ranges are specified, the firewall rule applies only to - # traffic that has a destination IP address in these ranges. These ranges - # must be expressed in CIDR format. Only supports IPv4. - # @!attribute [rw] exposed_services - # @return [::Array<::String>] - # Name of the network protocol service, such as FTP, that is exposed by the - # open port. Follows the naming convention available at: - # https://www.iana.org/assignments/service-names-port-numbers/service-names-port-numbers.xhtml. - class IpRules - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - - # The type of direction that the rule is applicable to, one of ingress or - # egress. Not applicable to OPEN_X_PORT findings. - module Direction - # Unspecified direction value. - DIRECTION_UNSPECIFIED = 0 - - # Ingress direction value. - INGRESS = 1 - - # Egress direction value. - EGRESS = 2 - end - end - - # IP rule information. - # @!attribute [rw] protocol - # @return [::String] - # The IP protocol this rule applies to. This value can either be one of the - # following well known protocol strings (TCP, UDP, ICMP, ESP, AH, IPIP, - # SCTP) or a string representation of the integer value. - # @!attribute [rw] port_ranges - # @return [::Array<::Google::Cloud::SecurityCenter::V2::IpRule::PortRange>] - # Optional. An optional list of ports to which this rule applies. This field - # is only applicable for the UDP or (S)TCP protocols. Each entry must be - # either an integer or a range including a min and max port number. - class IpRule - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - - # A port range which is inclusive of the min and max values. - # Values are between 0 and 2^16-1. The max can be equal / must be not smaller - # than the min value. If min and max are equal this indicates that it is a - # single port. - # @!attribute [rw] min - # @return [::Integer] - # Minimum port value. - # @!attribute [rw] max - # @return [::Integer] - # Maximum port value. - class PortRange - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - end - - # Allowed IP rule. - # @!attribute [rw] ip_rules - # @return [::Array<::Google::Cloud::SecurityCenter::V2::IpRule>] - # Optional. Optional list of allowed IP rules. - class Allowed - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Denied IP rule. - # @!attribute [rw] ip_rules - # @return [::Array<::Google::Cloud::SecurityCenter::V2::IpRule>] - # Optional. Optional list of denied IP rules. - class Denied - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - end - end - end -end diff --git a/owl-bot-staging/google-cloud-security_center-v2/proto_docs/google/cloud/securitycenter/v2/job.rb b/owl-bot-staging/google-cloud-security_center-v2/proto_docs/google/cloud/securitycenter/v2/job.rb deleted file mode 100644 index e8f38e48dc1b..000000000000 --- a/owl-bot-staging/google-cloud-security_center-v2/proto_docs/google/cloud/securitycenter/v2/job.rb +++ /dev/null @@ -1,65 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - - -module Google - module Cloud - module SecurityCenter - module V2 - # Describes a job - # @!attribute [rw] name - # @return [::String] - # The fully-qualified name for a job. - # e.g. `projects//jobs/` - # @!attribute [r] state - # @return [::Google::Cloud::SecurityCenter::V2::JobState] - # Output only. State of the job, such as `RUNNING` or `PENDING`. - # @!attribute [rw] error_code - # @return [::Integer] - # Optional. If the job did not complete successfully, this field describes - # why. - # @!attribute [rw] location - # @return [::String] - # Optional. Gives the location where the job ran, such as `US` or - # `europe-west1` - class Job - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # JobState represents the state of the job. - module JobState - # Unspecified represents an unknown state and should not be used. - JOB_STATE_UNSPECIFIED = 0 - - # Job is scheduled and pending for run - PENDING = 1 - - # Job in progress - RUNNING = 2 - - # Job has completed with success - SUCCEEDED = 3 - - # Job has completed but with failure - FAILED = 4 - end - end - end - end -end diff --git a/owl-bot-staging/google-cloud-security_center-v2/proto_docs/google/cloud/securitycenter/v2/kernel_rootkit.rb b/owl-bot-staging/google-cloud-security_center-v2/proto_docs/google/cloud/securitycenter/v2/kernel_rootkit.rb deleted file mode 100644 index 0e324f832355..000000000000 --- a/owl-bot-staging/google-cloud-security_center-v2/proto_docs/google/cloud/securitycenter/v2/kernel_rootkit.rb +++ /dev/null @@ -1,66 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - - -module Google - module Cloud - module SecurityCenter - module V2 - # Kernel mode rootkit signatures. - # @!attribute [rw] name - # @return [::String] - # Rootkit name, when available. - # @!attribute [rw] unexpected_code_modification - # @return [::Boolean] - # True if unexpected modifications of kernel code memory are present. - # @!attribute [rw] unexpected_read_only_data_modification - # @return [::Boolean] - # True if unexpected modifications of kernel read-only data memory are - # present. - # @!attribute [rw] unexpected_ftrace_handler - # @return [::Boolean] - # True if `ftrace` points are present with callbacks pointing to regions - # that are not in the expected kernel or module code range. - # @!attribute [rw] unexpected_kprobe_handler - # @return [::Boolean] - # True if `kprobe` points are present with callbacks pointing to regions - # that are not in the expected kernel or module code range. - # @!attribute [rw] unexpected_kernel_code_pages - # @return [::Boolean] - # True if kernel code pages that are not in the expected kernel or module - # code regions are present. - # @!attribute [rw] unexpected_system_call_handler - # @return [::Boolean] - # True if system call handlers that are are not in the expected kernel or - # module code regions are present. - # @!attribute [rw] unexpected_interrupt_handler - # @return [::Boolean] - # True if interrupt handlers that are are not in the expected kernel or - # module code regions are present. - # @!attribute [rw] unexpected_processes_in_runqueue - # @return [::Boolean] - # True if unexpected processes in the scheduler run queue are present. Such - # processes are in the run queue, but not in the process task list. - class KernelRootkit - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - end - end - end -end diff --git a/owl-bot-staging/google-cloud-security_center-v2/proto_docs/google/cloud/securitycenter/v2/kubernetes.rb b/owl-bot-staging/google-cloud-security_center-v2/proto_docs/google/cloud/securitycenter/v2/kubernetes.rb deleted file mode 100644 index 444ecd5eec70..000000000000 --- a/owl-bot-staging/google-cloud-security_center-v2/proto_docs/google/cloud/securitycenter/v2/kubernetes.rb +++ /dev/null @@ -1,241 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - - -module Google - module Cloud - module SecurityCenter - module V2 - # Kubernetes-related attributes. - # @!attribute [rw] pods - # @return [::Array<::Google::Cloud::SecurityCenter::V2::Kubernetes::Pod>] - # Kubernetes - # [Pods](https://cloud.google.com/kubernetes-engine/docs/concepts/pod) - # associated with the finding. This field contains Pod records for each - # container that is owned by a Pod. - # @!attribute [rw] nodes - # @return [::Array<::Google::Cloud::SecurityCenter::V2::Kubernetes::Node>] - # Provides Kubernetes - # [node](https://cloud.google.com/kubernetes-engine/docs/concepts/cluster-architecture#nodes) - # information. - # @!attribute [rw] node_pools - # @return [::Array<::Google::Cloud::SecurityCenter::V2::Kubernetes::NodePool>] - # GKE [node - # pools](https://cloud.google.com/kubernetes-engine/docs/concepts/node-pools) - # associated with the finding. This field contains node pool information for - # each node, when it is available. - # @!attribute [rw] roles - # @return [::Array<::Google::Cloud::SecurityCenter::V2::Kubernetes::Role>] - # Provides Kubernetes role information for findings that involve [Roles or - # ClusterRoles](https://cloud.google.com/kubernetes-engine/docs/how-to/role-based-access-control). - # @!attribute [rw] bindings - # @return [::Array<::Google::Cloud::SecurityCenter::V2::Kubernetes::Binding>] - # Provides Kubernetes role binding information for findings that involve - # [RoleBindings or - # ClusterRoleBindings](https://cloud.google.com/kubernetes-engine/docs/how-to/role-based-access-control). - # @!attribute [rw] access_reviews - # @return [::Array<::Google::Cloud::SecurityCenter::V2::Kubernetes::AccessReview>] - # Provides information on any Kubernetes access reviews (privilege checks) - # relevant to the finding. - # @!attribute [rw] objects - # @return [::Array<::Google::Cloud::SecurityCenter::V2::Kubernetes::Object>] - # Kubernetes objects related to the finding. - class Kubernetes - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - - # A Kubernetes Pod. - # @!attribute [rw] ns - # @return [::String] - # Kubernetes Pod namespace. - # @!attribute [rw] name - # @return [::String] - # Kubernetes Pod name. - # @!attribute [rw] labels - # @return [::Array<::Google::Cloud::SecurityCenter::V2::Label>] - # Pod labels. For Kubernetes containers, these are applied to the - # container. - # @!attribute [rw] containers - # @return [::Array<::Google::Cloud::SecurityCenter::V2::Container>] - # Pod containers associated with this finding, if any. - class Pod - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Kubernetes nodes associated with the finding. - # @!attribute [rw] name - # @return [::String] - # [Full resource name](https://google.aip.dev/122#full-resource-names) of - # the Compute Engine VM running the cluster node. - class Node - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Provides GKE node pool information. - # @!attribute [rw] name - # @return [::String] - # Kubernetes node pool name. - # @!attribute [rw] nodes - # @return [::Array<::Google::Cloud::SecurityCenter::V2::Kubernetes::Node>] - # Nodes associated with the finding. - class NodePool - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Kubernetes Role or ClusterRole. - # @!attribute [rw] kind - # @return [::Google::Cloud::SecurityCenter::V2::Kubernetes::Role::Kind] - # Role type. - # @!attribute [rw] ns - # @return [::String] - # Role namespace. - # @!attribute [rw] name - # @return [::String] - # Role name. - class Role - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - - # Types of Kubernetes roles. - module Kind - # Role type is not specified. - KIND_UNSPECIFIED = 0 - - # Kubernetes Role. - ROLE = 1 - - # Kubernetes ClusterRole. - CLUSTER_ROLE = 2 - end - end - - # Represents a Kubernetes RoleBinding or ClusterRoleBinding. - # @!attribute [rw] ns - # @return [::String] - # Namespace for the binding. - # @!attribute [rw] name - # @return [::String] - # Name for the binding. - # @!attribute [rw] role - # @return [::Google::Cloud::SecurityCenter::V2::Kubernetes::Role] - # The Role or ClusterRole referenced by the binding. - # @!attribute [rw] subjects - # @return [::Array<::Google::Cloud::SecurityCenter::V2::Kubernetes::Subject>] - # Represents one or more subjects that are bound to the role. Not always - # available for PATCH requests. - class Binding - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Represents a Kubernetes subject. - # @!attribute [rw] kind - # @return [::Google::Cloud::SecurityCenter::V2::Kubernetes::Subject::AuthType] - # Authentication type for the subject. - # @!attribute [rw] ns - # @return [::String] - # Namespace for the subject. - # @!attribute [rw] name - # @return [::String] - # Name for the subject. - class Subject - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - - # Auth types that can be used for the subject's kind field. - module AuthType - # Authentication is not specified. - AUTH_TYPE_UNSPECIFIED = 0 - - # User with valid certificate. - USER = 1 - - # Users managed by Kubernetes API with credentials stored as secrets. - SERVICEACCOUNT = 2 - - # Collection of users. - GROUP = 3 - end - end - - # Conveys information about a Kubernetes access review (such as one returned - # by a [`kubectl auth - # can-i`](https://kubernetes.io/docs/reference/access-authn-authz/authorization/#checking-api-access) - # command) that was involved in a finding. - # @!attribute [rw] group - # @return [::String] - # The API group of the resource. "*" means all. - # @!attribute [rw] ns - # @return [::String] - # Namespace of the action being requested. Currently, there is no - # distinction between no namespace and all namespaces. Both - # are represented by "" (empty). - # @!attribute [rw] name - # @return [::String] - # The name of the resource being requested. Empty means all. - # @!attribute [rw] resource - # @return [::String] - # The optional resource type requested. "*" means all. - # @!attribute [rw] subresource - # @return [::String] - # The optional subresource type. - # @!attribute [rw] verb - # @return [::String] - # A Kubernetes resource API verb, like get, list, watch, create, update, - # delete, proxy. "*" means all. - # @!attribute [rw] version - # @return [::String] - # The API version of the resource. "*" means all. - class AccessReview - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Kubernetes object related to the finding, uniquely identified by GKNN. - # Used if the object Kind is not one of Pod, Node, NodePool, Binding, or - # AccessReview. - # @!attribute [rw] group - # @return [::String] - # Kubernetes object group, such as "policy.k8s.io/v1". - # @!attribute [rw] kind - # @return [::String] - # Kubernetes object kind, such as "Namespace". - # @!attribute [rw] ns - # @return [::String] - # Kubernetes object namespace. Must be a valid DNS label. Named - # "ns" to avoid collision with C++ namespace keyword. For details see - # https://kubernetes.io/docs/tasks/administer-cluster/namespaces/. - # @!attribute [rw] name - # @return [::String] - # Kubernetes object name. For details see - # https://kubernetes.io/docs/concepts/overview/working-with-objects/names/. - # @!attribute [rw] containers - # @return [::Array<::Google::Cloud::SecurityCenter::V2::Container>] - # Pod containers associated with this finding, if any. - class Object - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - end - end - end - end -end diff --git a/owl-bot-staging/google-cloud-security_center-v2/proto_docs/google/cloud/securitycenter/v2/label.rb b/owl-bot-staging/google-cloud-security_center-v2/proto_docs/google/cloud/securitycenter/v2/label.rb deleted file mode 100644 index 609c1859cbe1..000000000000 --- a/owl-bot-staging/google-cloud-security_center-v2/proto_docs/google/cloud/securitycenter/v2/label.rb +++ /dev/null @@ -1,41 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - - -module Google - module Cloud - module SecurityCenter - module V2 - # Represents a generic name-value label. A label has separate name and value - # fields to support filtering with the `contains()` function. For more - # information, see [Filtering on array-type - # fields](https://cloud.google.com/security-command-center/docs/how-to-api-list-findings#array-contains-filtering). - # @!attribute [rw] name - # @return [::String] - # Name of the label. - # @!attribute [rw] value - # @return [::String] - # Value that corresponds to the label's name. - class Label - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - end - end - end -end diff --git a/owl-bot-staging/google-cloud-security_center-v2/proto_docs/google/cloud/securitycenter/v2/load_balancer.rb b/owl-bot-staging/google-cloud-security_center-v2/proto_docs/google/cloud/securitycenter/v2/load_balancer.rb deleted file mode 100644 index a9d466c92655..000000000000 --- a/owl-bot-staging/google-cloud-security_center-v2/proto_docs/google/cloud/securitycenter/v2/load_balancer.rb +++ /dev/null @@ -1,36 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - - -module Google - module Cloud - module SecurityCenter - module V2 - # Contains information related to the load balancer associated with the - # finding. - # @!attribute [rw] name - # @return [::String] - # The name of the load balancer associated with the finding. - class LoadBalancer - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - end - end - end -end diff --git a/owl-bot-staging/google-cloud-security_center-v2/proto_docs/google/cloud/securitycenter/v2/log_entry.rb b/owl-bot-staging/google-cloud-security_center-v2/proto_docs/google/cloud/securitycenter/v2/log_entry.rb deleted file mode 100644 index f3ea1bf4b29d..000000000000 --- a/owl-bot-staging/google-cloud-security_center-v2/proto_docs/google/cloud/securitycenter/v2/log_entry.rb +++ /dev/null @@ -1,58 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - - -module Google - module Cloud - module SecurityCenter - module V2 - # An individual entry in a log. - # @!attribute [rw] cloud_logging_entry - # @return [::Google::Cloud::SecurityCenter::V2::CloudLoggingEntry] - # An individual entry in a log stored in Cloud Logging. - class LogEntry - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Metadata taken from a [Cloud Logging - # LogEntry](https://cloud.google.com/logging/docs/reference/v2/rest/v2/LogEntry) - # @!attribute [rw] insert_id - # @return [::String] - # A unique identifier for the log entry. - # @!attribute [rw] log_id - # @return [::String] - # The type of the log (part of `log_name`. `log_name` is the resource name of - # the log to which this log entry belongs). For example: - # `cloudresourcemanager.googleapis.com/activity` Note that this field is not - # URL-encoded, unlike in `LogEntry`. - # @!attribute [rw] resource_container - # @return [::String] - # The organization, folder, or project of the monitored resource that - # produced this log entry. - # @!attribute [rw] timestamp - # @return [::Google::Protobuf::Timestamp] - # The time the event described by the log entry occurred. - class CloudLoggingEntry - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - end - end - end -end diff --git a/owl-bot-staging/google-cloud-security_center-v2/proto_docs/google/cloud/securitycenter/v2/mitre_attack.rb b/owl-bot-staging/google-cloud-security_center-v2/proto_docs/google/cloud/securitycenter/v2/mitre_attack.rb deleted file mode 100644 index a1f6f5b169c8..000000000000 --- a/owl-bot-staging/google-cloud-security_center-v2/proto_docs/google/cloud/securitycenter/v2/mitre_attack.rb +++ /dev/null @@ -1,521 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - - -module Google - module Cloud - module SecurityCenter - module V2 - # MITRE ATT&CK tactics and techniques related to this finding. - # See: https://attack.mitre.org - # @!attribute [rw] primary_tactic - # @return [::Google::Cloud::SecurityCenter::V2::MitreAttack::Tactic] - # The MITRE ATT&CK tactic most closely represented by this finding, if any. - # @!attribute [rw] primary_techniques - # @return [::Array<::Google::Cloud::SecurityCenter::V2::MitreAttack::Technique>] - # The MITRE ATT&CK technique most closely represented by this finding, if - # any. primary_techniques is a repeated field because there are multiple - # levels of MITRE ATT&CK techniques. If the technique most closely - # represented by this finding is a sub-technique (e.g. `SCANNING_IP_BLOCKS`), - # both the sub-technique and its parent technique(s) will be listed (e.g. - # `SCANNING_IP_BLOCKS`, `ACTIVE_SCANNING`). - # @!attribute [rw] additional_tactics - # @return [::Array<::Google::Cloud::SecurityCenter::V2::MitreAttack::Tactic>] - # Additional MITRE ATT&CK tactics related to this finding, if any. - # @!attribute [rw] additional_techniques - # @return [::Array<::Google::Cloud::SecurityCenter::V2::MitreAttack::Technique>] - # Additional MITRE ATT&CK techniques related to this finding, if any, along - # with any of their respective parent techniques. - # @!attribute [rw] version - # @return [::String] - # The MITRE ATT&CK version referenced by the above fields. E.g. "8". - class MitreAttack - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - - # MITRE ATT&CK tactics that can be referenced by SCC findings. - # See: https://attack.mitre.org/tactics/enterprise/ - module Tactic - # Unspecified value. - TACTIC_UNSPECIFIED = 0 - - # TA0043 - RECONNAISSANCE = 1 - - # TA0042 - RESOURCE_DEVELOPMENT = 2 - - # TA0001 - INITIAL_ACCESS = 5 - - # TA0002 - EXECUTION = 3 - - # TA0003 - PERSISTENCE = 6 - - # TA0004 - PRIVILEGE_ESCALATION = 8 - - # TA0005 - DEFENSE_EVASION = 7 - - # TA0006 - CREDENTIAL_ACCESS = 9 - - # TA0007 - DISCOVERY = 10 - - # TA0008 - LATERAL_MOVEMENT = 11 - - # TA0009 - COLLECTION = 12 - - # TA0011 - COMMAND_AND_CONTROL = 4 - - # TA0010 - EXFILTRATION = 13 - - # TA0040 - IMPACT = 14 - end - - # MITRE ATT&CK techniques that can be referenced by Security Command Center - # findings. See: https://attack.mitre.org/techniques/enterprise/ - module Technique - # Unspecified value. - TECHNIQUE_UNSPECIFIED = 0 - - # T1001 - DATA_OBFUSCATION = 70 - - # T1001.002 - DATA_OBFUSCATION_STEGANOGRAPHY = 71 - - # T1003 - OS_CREDENTIAL_DUMPING = 114 - - # T1003.007 - OS_CREDENTIAL_DUMPING_PROC_FILESYSTEM = 115 - - # T1003.008 - OS_CREDENTIAL_DUMPING_ETC_PASSWORD_AND_ETC_SHADOW = 122 - - # T1005 - DATA_FROM_LOCAL_SYSTEM = 117 - - # T1020 - AUTOMATED_EXFILTRATION = 68 - - # T1027 - OBFUSCATED_FILES_OR_INFO = 72 - - # T1027.003 - STEGANOGRAPHY = 73 - - # T1027.004 - COMPILE_AFTER_DELIVERY = 74 - - # T1027.010 - COMMAND_OBFUSCATION = 75 - - # T1029 - SCHEDULED_TRANSFER = 120 - - # T1033 - SYSTEM_OWNER_USER_DISCOVERY = 118 - - # T1036 - MASQUERADING = 49 - - # T1036.005 - MATCH_LEGITIMATE_NAME_OR_LOCATION = 50 - - # T1037 - BOOT_OR_LOGON_INITIALIZATION_SCRIPTS = 37 - - # T1037.005 - STARTUP_ITEMS = 38 - - # T1046 - NETWORK_SERVICE_DISCOVERY = 32 - - # T1053 - SCHEDULED_TASK_JOB = 89 - - # T1053.003 - SCHEDULED_TASK_JOB_CRON = 119 - - # T1053.007 - CONTAINER_ORCHESTRATION_JOB = 90 - - # T1055 - PROCESS_INJECTION = 93 - - # T1056 - INPUT_CAPTURE = 103 - - # T1056.001 - INPUT_CAPTURE_KEYLOGGING = 104 - - # T1057 - PROCESS_DISCOVERY = 56 - - # T1059 - COMMAND_AND_SCRIPTING_INTERPRETER = 6 - - # T1059.004 - UNIX_SHELL = 7 - - # T1059.006 - PYTHON = 59 - - # T1068 - EXPLOITATION_FOR_PRIVILEGE_ESCALATION = 63 - - # T1069 - PERMISSION_GROUPS_DISCOVERY = 18 - - # T1069.003 - CLOUD_GROUPS = 19 - - # T1070 - INDICATOR_REMOVAL = 123 - - # T1070.002 - INDICATOR_REMOVAL_CLEAR_LINUX_OR_MAC_SYSTEM_LOGS = 124 - - # T1070.003 - INDICATOR_REMOVAL_CLEAR_COMMAND_HISTORY = 125 - - # T1070.004 - INDICATOR_REMOVAL_FILE_DELETION = 64 - - # T1070.006 - INDICATOR_REMOVAL_TIMESTOMP = 128 - - # T1070.008 - INDICATOR_REMOVAL_CLEAR_MAILBOX_DATA = 126 - - # T1071 - APPLICATION_LAYER_PROTOCOL = 45 - - # T1071.004 - DNS = 46 - - # T1072 - SOFTWARE_DEPLOYMENT_TOOLS = 47 - - # T1078 - VALID_ACCOUNTS = 14 - - # T1078.001 - DEFAULT_ACCOUNTS = 35 - - # T1078.003 - LOCAL_ACCOUNTS = 15 - - # T1078.004 - CLOUD_ACCOUNTS = 16 - - # T1083 - FILE_AND_DIRECTORY_DISCOVERY = 121 - - # T1087.001 - ACCOUNT_DISCOVERY_LOCAL_ACCOUNT = 116 - - # T1090 - PROXY = 9 - - # T1090.002 - EXTERNAL_PROXY = 10 - - # T1090.003 - MULTI_HOP_PROXY = 11 - - # T1098 - ACCOUNT_MANIPULATION = 22 - - # T1098.001 - ADDITIONAL_CLOUD_CREDENTIALS = 40 - - # T1098.003 - ADDITIONAL_CLOUD_ROLES = 67 - - # T1098.004 - SSH_AUTHORIZED_KEYS = 23 - - # T1098.006 - ADDITIONAL_CONTAINER_CLUSTER_ROLES = 58 - - # T1104 - MULTI_STAGE_CHANNELS = 76 - - # T1105 - INGRESS_TOOL_TRANSFER = 3 - - # T1106 - NATIVE_API = 4 - - # T1110 - BRUTE_FORCE = 44 - - # T1119 - AUTOMATED_COLLECTION = 94 - - # T1129 - SHARED_MODULES = 5 - - # T1132 - DATA_ENCODING = 77 - - # T1132.001 - STANDARD_ENCODING = 78 - - # T1134 - ACCESS_TOKEN_MANIPULATION = 33 - - # T1134.001 - TOKEN_IMPERSONATION_OR_THEFT = 39 - - # T1136 - CREATE_ACCOUNT = 79 - - # T1136.001 - LOCAL_ACCOUNT = 80 - - # T1140 - DEOBFUSCATE_DECODE_FILES_OR_INFO = 95 - - # T1190 - EXPLOIT_PUBLIC_FACING_APPLICATION = 27 - - # T1195 - SUPPLY_CHAIN_COMPROMISE = 129 - - # T1195.001 - COMPROMISE_SOFTWARE_DEPENDENCIES_AND_DEVELOPMENT_TOOLS = 130 - - # T1203 - EXPLOITATION_FOR_CLIENT_EXECUTION = 134 - - # T1204 - USER_EXECUTION = 69 - - # T1222.002 - LINUX_AND_MAC_FILE_AND_DIRECTORY_PERMISSIONS_MODIFICATION = 135 - - # T1484 - DOMAIN_POLICY_MODIFICATION = 30 - - # T1485 - DATA_DESTRUCTION = 29 - - # T1486 - DATA_ENCRYPTED_FOR_IMPACT = 132 - - # T1489 - SERVICE_STOP = 52 - - # T1490 - INHIBIT_SYSTEM_RECOVERY = 36 - - # T1495 - FIRMWARE_CORRUPTION = 81 - - # T1496 - RESOURCE_HIJACKING = 8 - - # T1498 - NETWORK_DENIAL_OF_SERVICE = 17 - - # T1526 - CLOUD_SERVICE_DISCOVERY = 48 - - # T1528 - STEAL_APPLICATION_ACCESS_TOKEN = 42 - - # T1531 - ACCOUNT_ACCESS_REMOVAL = 51 - - # T1537 - TRANSFER_DATA_TO_CLOUD_ACCOUNT = 91 - - # T1539 - STEAL_WEB_SESSION_COOKIE = 25 - - # T1543 - CREATE_OR_MODIFY_SYSTEM_PROCESS = 24 - - # T1546 - EVENT_TRIGGERED_EXECUTION = 65 - - # T1547 - BOOT_OR_LOGON_AUTOSTART_EXECUTION = 82 - - # T1547.006 - KERNEL_MODULES_AND_EXTENSIONS = 83 - - # T1547.009 - SHORTCUT_MODIFICATION = 127 - - # T1548 - ABUSE_ELEVATION_CONTROL_MECHANISM = 34 - - # T1548.001 - ABUSE_ELEVATION_CONTROL_MECHANISM_SETUID_AND_SETGID = 136 - - # T1548.003 - ABUSE_ELEVATION_CONTROL_MECHANISM_SUDO_AND_SUDO_CACHING = 109 - - # T1552 - UNSECURED_CREDENTIALS = 13 - - # T1552.001 - CREDENTIALS_IN_FILES = 105 - - # T1552.003 - BASH_HISTORY = 96 - - # T1552.004 - PRIVATE_KEYS = 97 - - # T1553 - SUBVERT_TRUST_CONTROL = 106 - - # T1553.004 - INSTALL_ROOT_CERTIFICATE = 107 - - # T1554 - COMPROMISE_HOST_SOFTWARE_BINARY = 84 - - # T1555 - CREDENTIALS_FROM_PASSWORD_STORES = 98 - - # T1556 - MODIFY_AUTHENTICATION_PROCESS = 28 - - # T1556.003 - PLUGGABLE_AUTHENTICATION_MODULES = 108 - - # T1556.006 - MULTI_FACTOR_AUTHENTICATION = 137 - - # T1562 - IMPAIR_DEFENSES = 31 - - # T1562.001 - DISABLE_OR_MODIFY_TOOLS = 55 - - # T1562.006 - INDICATOR_BLOCKING = 110 - - # T1562.012 - DISABLE_OR_MODIFY_LINUX_AUDIT_SYSTEM = 111 - - # T1564 - HIDE_ARTIFACTS = 85 - - # T1564.001 - HIDDEN_FILES_AND_DIRECTORIES = 86 - - # T1564.002 - HIDDEN_USERS = 87 - - # T1567 - EXFILTRATION_OVER_WEB_SERVICE = 20 - - # T1567.002 - EXFILTRATION_TO_CLOUD_STORAGE = 21 - - # T1568 - DYNAMIC_RESOLUTION = 12 - - # T1570 - LATERAL_TOOL_TRANSFER = 41 - - # T1574 - HIJACK_EXECUTION_FLOW = 112 - - # T1574.006 - HIJACK_EXECUTION_FLOW_DYNAMIC_LINKER_HIJACKING = 113 - - # T1578 - MODIFY_CLOUD_COMPUTE_INFRASTRUCTURE = 26 - - # T1578.001 - CREATE_SNAPSHOT = 54 - - # T1580 - CLOUD_INFRASTRUCTURE_DISCOVERY = 53 - - # T1587 - DEVELOP_CAPABILITIES = 99 - - # T1587.001 - DEVELOP_CAPABILITIES_MALWARE = 100 - - # T1588 - OBTAIN_CAPABILITIES = 43 - - # T1588.001 - OBTAIN_CAPABILITIES_MALWARE = 101 - - # T1588.006 - OBTAIN_CAPABILITIES_VULNERABILITIES = 133 - - # T1595 - ACTIVE_SCANNING = 1 - - # T1595.001 - SCANNING_IP_BLOCKS = 2 - - # T1608 - STAGE_CAPABILITIES = 88 - - # T1608.001 - UPLOAD_MALWARE = 102 - - # T1609 - CONTAINER_ADMINISTRATION_COMMAND = 60 - - # T1610 - DEPLOY_CONTAINER = 66 - - # T1611 - ESCAPE_TO_HOST = 61 - - # T1613 - CONTAINER_AND_RESOURCE_DISCOVERY = 57 - - # T1620 - REFLECTIVE_CODE_LOADING = 92 - - # T1649 - STEAL_OR_FORGE_AUTHENTICATION_CERTIFICATES = 62 - - # T1657 - FINANCIAL_THEFT = 131 - end - end - end - end - end -end diff --git a/owl-bot-staging/google-cloud-security_center-v2/proto_docs/google/cloud/securitycenter/v2/mute_config.rb b/owl-bot-staging/google-cloud-security_center-v2/proto_docs/google/cloud/securitycenter/v2/mute_config.rb deleted file mode 100644 index db9977d397e7..000000000000 --- a/owl-bot-staging/google-cloud-security_center-v2/proto_docs/google/cloud/securitycenter/v2/mute_config.rb +++ /dev/null @@ -1,113 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - - -module Google - module Cloud - module SecurityCenter - module V2 - # A mute config is a Cloud SCC resource that contains the configuration - # to mute create/update events of findings. - # @!attribute [rw] name - # @return [::String] - # Identifier. This field will be ignored if provided on config creation. The - # following list shows some examples of the format: - # - # + `organizations/{organization}/muteConfigs/{mute_config}` - # + - # `organizations/{organization}locations/{location}//muteConfigs/{mute_config}` - # + `folders/{folder}/muteConfigs/{mute_config}` - # + `folders/{folder}/locations/{location}/muteConfigs/{mute_config}` - # + `projects/{project}/muteConfigs/{mute_config}` - # + `projects/{project}/locations/{location}/muteConfigs/{mute_config}` - # @!attribute [rw] description - # @return [::String] - # A description of the mute config. - # @!attribute [rw] filter - # @return [::String] - # Required. An expression that defines the filter to apply across - # create/update events of findings. While creating a filter string, be - # mindful of the scope in which the mute configuration is being created. - # E.g., If a filter contains project = X but is created under the project = Y - # scope, it might not match any findings. - # - # The following field and operator combinations are supported: - # - # * severity: `=`, `:` - # * category: `=`, `:` - # * resource.name: `=`, `:` - # * resource.project_name: `=`, `:` - # * resource.project_display_name: `=`, `:` - # * resource.folders.resource_folder: `=`, `:` - # * resource.parent_name: `=`, `:` - # * resource.parent_display_name: `=`, `:` - # * resource.type: `=`, `:` - # * finding_class: `=`, `:` - # * indicator.ip_addresses: `=`, `:` - # * indicator.domains: `=`, `:` - # @!attribute [r] create_time - # @return [::Google::Protobuf::Timestamp] - # Output only. The time at which the mute config was created. - # This field is set by the server and will be ignored if provided on config - # creation. - # @!attribute [r] update_time - # @return [::Google::Protobuf::Timestamp] - # Output only. The most recent time at which the mute config was updated. - # This field is set by the server and will be ignored if provided on config - # creation or update. - # @!attribute [r] most_recent_editor - # @return [::String] - # Output only. Email address of the user who last edited the mute config. - # This field is set by the server and will be ignored if provided on config - # creation or update. - # @!attribute [rw] type - # @return [::Google::Cloud::SecurityCenter::V2::MuteConfig::MuteConfigType] - # Required. The type of the mute config, which determines what type of mute - # state the config affects. Immutable after creation. - # @!attribute [rw] expiry_time - # @return [::Google::Protobuf::Timestamp] - # Optional. The expiry of the mute config. Only applicable for dynamic - # configs. If the expiry is set, when the config expires, it is removed from - # all findings. - class MuteConfig - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - - # The type of MuteConfig. - module MuteConfigType - # Unused. - MUTE_CONFIG_TYPE_UNSPECIFIED = 0 - - # A static mute config, which sets the static mute state of future matching - # findings to muted. Once the static mute state has been set, finding or - # config modifications will not affect the state. - STATIC = 1 - - # A dynamic mute config, which is applied to existing and future matching - # findings, setting their dynamic mute state to "muted". If the config is - # updated or deleted, or a matching finding is updated, such that the - # finding doesn't match the config, the config will be removed from the - # finding, and the finding's dynamic mute state may become "unmuted" - # (unless other configs still match). - DYNAMIC = 2 - end - end - end - end - end -end diff --git a/owl-bot-staging/google-cloud-security_center-v2/proto_docs/google/cloud/securitycenter/v2/network.rb b/owl-bot-staging/google-cloud-security_center-v2/proto_docs/google/cloud/securitycenter/v2/network.rb deleted file mode 100644 index 7fb133f55dc2..000000000000 --- a/owl-bot-staging/google-cloud-security_center-v2/proto_docs/google/cloud/securitycenter/v2/network.rb +++ /dev/null @@ -1,36 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - - -module Google - module Cloud - module SecurityCenter - module V2 - # Contains information about a VPC network associated with the finding. - # @!attribute [rw] name - # @return [::String] - # The name of the VPC network resource, for example, - # `//compute.googleapis.com/projects/my-project/global/networks/my-network`. - class Network - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - end - end - end -end diff --git a/owl-bot-staging/google-cloud-security_center-v2/proto_docs/google/cloud/securitycenter/v2/notebook.rb b/owl-bot-staging/google-cloud-security_center-v2/proto_docs/google/cloud/securitycenter/v2/notebook.rb deleted file mode 100644 index 0d1e37a099ef..000000000000 --- a/owl-bot-staging/google-cloud-security_center-v2/proto_docs/google/cloud/securitycenter/v2/notebook.rb +++ /dev/null @@ -1,46 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - - -module Google - module Cloud - module SecurityCenter - module V2 - # Represents a Jupyter notebook IPYNB file, such as a [Colab Enterprise - # notebook](https://cloud.google.com/colab/docs/introduction) file, that is - # associated with a finding. - # @!attribute [rw] name - # @return [::String] - # The name of the notebook. - # @!attribute [rw] service - # @return [::String] - # The source notebook service, for example, "Colab Enterprise". - # @!attribute [rw] last_author - # @return [::String] - # The user ID of the latest author to modify the notebook. - # @!attribute [rw] notebook_update_time - # @return [::Google::Protobuf::Timestamp] - # The most recent time the notebook was updated. - class Notebook - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - end - end - end -end diff --git a/owl-bot-staging/google-cloud-security_center-v2/proto_docs/google/cloud/securitycenter/v2/notification_config.rb b/owl-bot-staging/google-cloud-security_center-v2/proto_docs/google/cloud/securitycenter/v2/notification_config.rb deleted file mode 100644 index b5de722177ff..000000000000 --- a/owl-bot-staging/google-cloud-security_center-v2/proto_docs/google/cloud/securitycenter/v2/notification_config.rb +++ /dev/null @@ -1,94 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - - -module Google - module Cloud - module SecurityCenter - module V2 - # Cloud Security Command Center (Cloud SCC) notification configs. - # - # A notification config is a Cloud SCC resource that contains the configuration - # to send notifications for create/update events of findings, assets and etc. - # @!attribute [rw] name - # @return [::String] - # Identifier. The relative resource name of this notification config. See: - # https://cloud.google.com/apis/design/resource_names#relative_resource_name - # The following list shows some examples: - # + - # `organizations/{organization_id}/locations/{location_id}/notificationConfigs/notify_public_bucket` - # + - # `folders/{folder_id}/locations/{location_id}/notificationConfigs/notify_public_bucket` - # + - # `projects/{project_id}/locations/{location_id}/notificationConfigs/notify_public_bucket` - # @!attribute [rw] description - # @return [::String] - # The description of the notification config (max of 1024 characters). - # @!attribute [rw] pubsub_topic - # @return [::String] - # The Pub/Sub topic to send notifications to. Its format is - # "projects/[project_id]/topics/[topic]". - # @!attribute [r] service_account - # @return [::String] - # Output only. The service account that needs "pubsub.topics.publish" - # permission to publish to the Pub/Sub topic. - # @!attribute [rw] streaming_config - # @return [::Google::Cloud::SecurityCenter::V2::NotificationConfig::StreamingConfig] - # The config for triggering streaming-based notifications. - # @!attribute [r] update_time - # @return [::Google::Protobuf::Timestamp] - # Output only. The timestamp of when the notification config was last - # updated. - class NotificationConfig - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - - # The config for streaming-based notifications, which send each event as soon - # as it is detected. - # @!attribute [rw] filter - # @return [::String] - # Expression that defines the filter to apply across create/update events - # of assets or findings as specified by the event type. The expression is a - # list of zero or more restrictions combined via logical operators `AND` - # and `OR`. Parentheses are supported, and `OR` has higher precedence than - # `AND`. - # - # Restrictions have the form ` ` and may have a - # `-` character in front of them to indicate negation. The fields map to - # those defined in the corresponding resource. - # - # The supported operators are: - # - # * `=` for all value types. - # * `>`, `<`, `>=`, `<=` for integer values. - # * `:`, meaning substring matching, for strings. - # - # The supported value types are: - # - # * string literals in quotes. - # * integer literals without quotes. - # * boolean literals `true` and `false` without quotes. - class StreamingConfig - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - end - end - end - end -end diff --git a/owl-bot-staging/google-cloud-security_center-v2/proto_docs/google/cloud/securitycenter/v2/notification_message.rb b/owl-bot-staging/google-cloud-security_center-v2/proto_docs/google/cloud/securitycenter/v2/notification_message.rb deleted file mode 100644 index bd3046afd7de..000000000000 --- a/owl-bot-staging/google-cloud-security_center-v2/proto_docs/google/cloud/securitycenter/v2/notification_message.rb +++ /dev/null @@ -1,42 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - - -module Google - module Cloud - module SecurityCenter - module V2 - # Cloud SCC's Notification - # @!attribute [rw] notification_config_name - # @return [::String] - # Name of the notification config that generated current notification. - # @!attribute [rw] finding - # @return [::Google::Cloud::SecurityCenter::V2::Finding] - # If it's a Finding based notification config, this field will be - # populated. - # @!attribute [rw] resource - # @return [::Google::Cloud::SecurityCenter::V2::Resource] - # The Cloud resource tied to this notification's Finding. - class NotificationMessage - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - end - end - end -end diff --git a/owl-bot-staging/google-cloud-security_center-v2/proto_docs/google/cloud/securitycenter/v2/org_policy.rb b/owl-bot-staging/google-cloud-security_center-v2/proto_docs/google/cloud/securitycenter/v2/org_policy.rb deleted file mode 100644 index b90cb7b8d034..000000000000 --- a/owl-bot-staging/google-cloud-security_center-v2/proto_docs/google/cloud/securitycenter/v2/org_policy.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! - - -module Google - module Cloud - module SecurityCenter - module V2 - # Contains information about the org policies associated with the finding. - # @!attribute [rw] name - # @return [::String] - # Identifier. The resource name of the org policy. - # Example: - # "organizations/\\{organization_id}/policies/\\{constraint_name}" - class OrgPolicy - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - end - end - end -end diff --git a/owl-bot-staging/google-cloud-security_center-v2/proto_docs/google/cloud/securitycenter/v2/process.rb b/owl-bot-staging/google-cloud-security_center-v2/proto_docs/google/cloud/securitycenter/v2/process.rb deleted file mode 100644 index e127710a40a5..000000000000 --- a/owl-bot-staging/google-cloud-security_center-v2/proto_docs/google/cloud/securitycenter/v2/process.rb +++ /dev/null @@ -1,83 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - - -module Google - module Cloud - module SecurityCenter - module V2 - # Represents an operating system process. - # @!attribute [rw] name - # @return [::String] - # The process name, as displayed in utilities like `top` and `ps`. This name - # can be accessed through `/proc/[pid]/comm` and changed with - # `prctl(PR_SET_NAME)`. - # @!attribute [rw] binary - # @return [::Google::Cloud::SecurityCenter::V2::File] - # File information for the process executable. - # @!attribute [rw] libraries - # @return [::Array<::Google::Cloud::SecurityCenter::V2::File>] - # File information for libraries loaded by the process. - # @!attribute [rw] script - # @return [::Google::Cloud::SecurityCenter::V2::File] - # When the process represents the invocation of a script, `binary` provides - # information about the interpreter, while `script` provides information - # about the script file provided to the interpreter. - # @!attribute [rw] args - # @return [::Array<::String>] - # Process arguments as JSON encoded strings. - # @!attribute [rw] arguments_truncated - # @return [::Boolean] - # True if `args` is incomplete. - # @!attribute [rw] env_variables - # @return [::Array<::Google::Cloud::SecurityCenter::V2::EnvironmentVariable>] - # Process environment variables. - # @!attribute [rw] env_variables_truncated - # @return [::Boolean] - # True if `env_variables` is incomplete. - # @!attribute [rw] pid - # @return [::Integer] - # The process ID. - # @!attribute [rw] parent_pid - # @return [::Integer] - # The parent process ID. - # @!attribute [rw] user_id - # @return [::Integer] - # The ID of the user that executed the process. E.g. If this is the root user - # this will always be 0. - class Process - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # A name-value pair representing an environment variable used in an operating - # system process. - # @!attribute [rw] name - # @return [::String] - # Environment variable name as a JSON encoded string. - # @!attribute [rw] val - # @return [::String] - # Environment variable value as a JSON encoded string. - class EnvironmentVariable - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - end - end - end -end diff --git a/owl-bot-staging/google-cloud-security_center-v2/proto_docs/google/cloud/securitycenter/v2/resource.rb b/owl-bot-staging/google-cloud-security_center-v2/proto_docs/google/cloud/securitycenter/v2/resource.rb deleted file mode 100644 index aaa75073c739..000000000000 --- a/owl-bot-staging/google-cloud-security_center-v2/proto_docs/google/cloud/securitycenter/v2/resource.rb +++ /dev/null @@ -1,314 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - - -module Google - module Cloud - module SecurityCenter - module V2 - # Information related to the Google Cloud resource. - # @!attribute [rw] name - # @return [::String] - # The full resource name of the resource. See: - # https://cloud.google.com/apis/design/resource_names#full_resource_name - # @!attribute [rw] display_name - # @return [::String] - # The human readable name of the resource. - # @!attribute [rw] type - # @return [::String] - # The full resource type of the resource. - # @!attribute [rw] cloud_provider - # @return [::Google::Cloud::SecurityCenter::V2::CloudProvider] - # Indicates which cloud provider the finding is from. - # @!attribute [rw] service - # @return [::String] - # The service or resource provider associated with the resource. - # @!attribute [rw] location - # @return [::String] - # The region or location of the service (if applicable). - # @!attribute [rw] gcp_metadata - # @return [::Google::Cloud::SecurityCenter::V2::GcpMetadata] - # The GCP metadata associated with the finding. - # - # Note: The following fields are mutually exclusive: `gcp_metadata`, `aws_metadata`, `azure_metadata`. If a field in that set is populated, all other fields in the set will automatically be cleared. - # @!attribute [rw] aws_metadata - # @return [::Google::Cloud::SecurityCenter::V2::AwsMetadata] - # The AWS metadata associated with the finding. - # - # Note: The following fields are mutually exclusive: `aws_metadata`, `gcp_metadata`, `azure_metadata`. If a field in that set is populated, all other fields in the set will automatically be cleared. - # @!attribute [rw] azure_metadata - # @return [::Google::Cloud::SecurityCenter::V2::AzureMetadata] - # The Azure metadata associated with the finding. - # - # Note: The following fields are mutually exclusive: `azure_metadata`, `gcp_metadata`, `aws_metadata`. If a field in that set is populated, all other fields in the set will automatically be cleared. - # @!attribute [rw] resource_path - # @return [::Google::Cloud::SecurityCenter::V2::ResourcePath] - # Provides the path to the resource within the resource hierarchy. - # @!attribute [rw] resource_path_string - # @return [::String] - # A string representation of the resource path. - # For Google Cloud, it has the format of - # `organizations/{organization_id}/folders/{folder_id}/folders/{folder_id}/projects/{project_id}` - # where there can be any number of folders. - # For AWS, it has the format of - # `org/{organization_id}/ou/{organizational_unit_id}/ou/{organizational_unit_id}/account/{account_id}` - # where there can be any number of organizational units. - # For Azure, it has the format of - # `mg/{management_group_id}/mg/{management_group_id}/subscription/{subscription_id}/rg/{resource_group_name}` - # where there can be any number of management groups. - class Resource - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Google Cloud metadata associated with the resource. Only applicable if the - # finding's cloud provider is Google Cloud. - # @!attribute [rw] project - # @return [::String] - # The full resource name of project that the resource belongs to. - # @!attribute [rw] project_display_name - # @return [::String] - # The project ID that the resource belongs to. - # @!attribute [rw] parent - # @return [::String] - # The full resource name of resource's parent. - # @!attribute [rw] parent_display_name - # @return [::String] - # The human readable name of resource's parent. - # @!attribute [r] folders - # @return [::Array<::Google::Cloud::SecurityCenter::V2::Folder>] - # Output only. Contains a Folder message for each folder in the assets - # ancestry. The first folder is the deepest nested folder, and the last - # folder is the folder directly under the Organization. - # @!attribute [rw] organization - # @return [::String] - # The name of the organization that the resource belongs to. - class GcpMetadata - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # AWS metadata associated with the resource, only applicable if the finding's - # cloud provider is Amazon Web Services. - # @!attribute [rw] organization - # @return [::Google::Cloud::SecurityCenter::V2::AwsMetadata::AwsOrganization] - # The AWS organization associated with the resource. - # @!attribute [rw] organizational_units - # @return [::Array<::Google::Cloud::SecurityCenter::V2::AwsMetadata::AwsOrganizationalUnit>] - # A list of AWS organizational units associated with the resource, ordered - # from lowest level (closest to the account) to highest level. - # @!attribute [rw] account - # @return [::Google::Cloud::SecurityCenter::V2::AwsMetadata::AwsAccount] - # The AWS account associated with the resource. - class AwsMetadata - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - - # An organization is a collection of accounts that are centrally managed - # together using consolidated billing, organized hierarchically with - # organizational units (OUs), and controlled with policies. - # @!attribute [rw] id - # @return [::String] - # The unique identifier (ID) for the organization. The regex pattern for an - # organization ID string requires "o-" followed by from 10 to 32 lowercase - # letters or digits. - class AwsOrganization - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # An Organizational Unit (OU) is a container of AWS accounts within a root of - # an organization. Policies that are attached to an OU apply to all accounts - # contained in that OU and in any child OUs. - # @!attribute [rw] id - # @return [::String] - # The unique identifier (ID) associated with this OU. The regex pattern for - # an organizational unit ID string requires "ou-" followed by from 4 to 32 - # lowercase letters or digits (the ID of the root that contains the OU). - # This string is followed by a second "-" dash and from 8 to 32 additional - # lowercase letters or digits. For example, "ou-ab12-cd34ef56". - # @!attribute [rw] name - # @return [::String] - # The friendly name of the OU. - class AwsOrganizationalUnit - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # An AWS account that is a member of an organization. - # @!attribute [rw] id - # @return [::String] - # The unique identifier (ID) of the account, containing exactly 12 digits. - # @!attribute [rw] name - # @return [::String] - # The friendly name of this account. - class AwsAccount - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - end - - # Azure metadata associated with the resource, only applicable if the finding's - # cloud provider is Microsoft Azure. - # @!attribute [rw] management_groups - # @return [::Array<::Google::Cloud::SecurityCenter::V2::AzureMetadata::AzureManagementGroup>] - # A list of Azure management groups associated with the resource, ordered - # from lowest level (closest to the subscription) to highest level. - # @!attribute [rw] subscription - # @return [::Google::Cloud::SecurityCenter::V2::AzureMetadata::AzureSubscription] - # The Azure subscription associated with the resource. - # @!attribute [rw] resource_group - # @return [::Google::Cloud::SecurityCenter::V2::AzureMetadata::AzureResourceGroup] - # The Azure resource group associated with the resource. - # @!attribute [rw] tenant - # @return [::Google::Cloud::SecurityCenter::V2::AzureMetadata::AzureTenant] - # The Azure Entra tenant associated with the resource. - class AzureMetadata - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - - # Represents an Azure management group. - # @!attribute [rw] id - # @return [::String] - # The UUID of the Azure management group, for example, - # `20000000-0001-0000-0000-000000000000`. - # @!attribute [rw] display_name - # @return [::String] - # The display name of the Azure management group. - class AzureManagementGroup - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Represents an Azure subscription. - # @!attribute [rw] id - # @return [::String] - # The UUID of the Azure subscription, for example, - # `291bba3f-e0a5-47bc-a099-3bdcb2a50a05`. - # @!attribute [rw] display_name - # @return [::String] - # The display name of the Azure subscription. - class AzureSubscription - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Represents an Azure resource group. - # @!attribute [rw] id - # @return [::String] - # The ID of the Azure resource group. - # @!attribute [rw] name - # @return [::String] - # The name of the Azure resource group. This is not a UUID. - class AzureResourceGroup - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Represents a Microsoft Entra tenant. - # @!attribute [rw] id - # @return [::String] - # The ID of the Microsoft Entra tenant, for example, - # "a11aaa11-aa11-1aa1-11aa-1aaa11a". - # @!attribute [rw] display_name - # @return [::String] - # The display name of the Azure tenant. - class AzureTenant - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - end - - # Represents the path of resources leading up to the resource this finding is - # about. - # @!attribute [rw] nodes - # @return [::Array<::Google::Cloud::SecurityCenter::V2::ResourcePath::ResourcePathNode>] - # The list of nodes that make the up resource path, ordered from lowest - # level to highest level. - class ResourcePath - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - - # A node within the resource path. Each node represents a resource within the - # resource hierarchy. - # @!attribute [rw] node_type - # @return [::Google::Cloud::SecurityCenter::V2::ResourcePath::ResourcePathNodeType] - # The type of resource this node represents. - # @!attribute [rw] id - # @return [::String] - # The ID of the resource this node represents. - # @!attribute [rw] display_name - # @return [::String] - # The display name of the resource this node represents. - class ResourcePathNode - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # The type of resource the node represents. - module ResourcePathNodeType - # Node type is unspecified. - RESOURCE_PATH_NODE_TYPE_UNSPECIFIED = 0 - - # The node represents a Google Cloud organization. - GCP_ORGANIZATION = 1 - - # The node represents a Google Cloud folder. - GCP_FOLDER = 2 - - # The node represents a Google Cloud project. - GCP_PROJECT = 3 - - # The node represents an AWS organization. - AWS_ORGANIZATION = 4 - - # The node represents an AWS organizational unit. - AWS_ORGANIZATIONAL_UNIT = 5 - - # The node represents an AWS account. - AWS_ACCOUNT = 6 - - # The node represents an Azure management group. - AZURE_MANAGEMENT_GROUP = 7 - - # The node represents an Azure subscription. - AZURE_SUBSCRIPTION = 8 - - # The node represents an Azure resource group. - AZURE_RESOURCE_GROUP = 9 - end - end - - # The cloud provider the finding pertains to. - module CloudProvider - # The cloud provider is unspecified. - CLOUD_PROVIDER_UNSPECIFIED = 0 - - # The cloud provider is Google Cloud. - GOOGLE_CLOUD_PLATFORM = 1 - - # The cloud provider is Amazon Web Services. - AMAZON_WEB_SERVICES = 2 - - # The cloud provider is Microsoft Azure. - MICROSOFT_AZURE = 3 - end - end - end - end -end diff --git a/owl-bot-staging/google-cloud-security_center-v2/proto_docs/google/cloud/securitycenter/v2/resource_value_config.rb b/owl-bot-staging/google-cloud-security_center-v2/proto_docs/google/cloud/securitycenter/v2/resource_value_config.rb deleted file mode 100644 index 450e83f704b5..000000000000 --- a/owl-bot-staging/google-cloud-security_center-v2/proto_docs/google/cloud/securitycenter/v2/resource_value_config.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 Cloud - module SecurityCenter - module V2 - # A resource value configuration (RVC) is a mapping configuration of user's - # resources to resource values. Used in Attack path simulations. - # @!attribute [rw] name - # @return [::String] - # Identifier. Name for the resource value configuration - # @!attribute [rw] resource_value - # @return [::Google::Cloud::SecurityCenter::V2::ResourceValue] - # Resource value level this expression represents - # Only required when there is no Sensitive Data Protection mapping in the - # request - # @!attribute [rw] tag_values - # @return [::Array<::String>] - # Tag values combined with `AND` to check against. - # For Google Cloud resources, they are tag value IDs in the form of - # "tagValues/123". Example: `[ "tagValues/123", "tagValues/456", - # "tagValues/789" ]` - # https://cloud.google.com/resource-manager/docs/tags/tags-creating-and-managing - # @!attribute [rw] resource_type - # @return [::String] - # Apply resource_value only to resources that match resource_type. - # resource_type will be checked with `AND` of other resources. - # For example, "storage.googleapis.com/Bucket" with resource_value "HIGH" - # will apply "HIGH" value only to "storage.googleapis.com/Bucket" resources. - # @!attribute [rw] scope - # @return [::String] - # Project or folder to scope this configuration to. - # For example, "project/456" would apply this configuration only to resources - # in "project/456" scope and will be checked with `AND` of other resources. - # @!attribute [rw] resource_labels_selector - # @return [::Google::Protobuf::Map{::String => ::String}] - # List of resource labels to search for, evaluated with `AND`. - # For example, "resource_labels_selector": \\{"key": "value", "env": "prod"} - # will match resources with labels "key": "value" `AND` "env": - # "prod" - # https://cloud.google.com/resource-manager/docs/creating-managing-labels - # @!attribute [rw] description - # @return [::String] - # Description of the resource value configuration. - # @!attribute [r] create_time - # @return [::Google::Protobuf::Timestamp] - # Output only. Timestamp this resource value configuration was created. - # @!attribute [r] update_time - # @return [::Google::Protobuf::Timestamp] - # Output only. Timestamp this resource value configuration was last updated. - # @!attribute [rw] cloud_provider - # @return [::Google::Cloud::SecurityCenter::V2::CloudProvider] - # Cloud provider this configuration applies to - # @!attribute [rw] sensitive_data_protection_mapping - # @return [::Google::Cloud::SecurityCenter::V2::ResourceValueConfig::SensitiveDataProtectionMapping] - # A mapping of the sensitivity on Sensitive Data Protection finding to - # resource values. This mapping can only be used in combination with a - # resource_type that is related to BigQuery, e.g. - # "bigquery.googleapis.com/Dataset". - class ResourceValueConfig - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - - # Resource value mapping for Sensitive Data Protection findings - # If any of these mappings have a resource value that is not unspecified, - # the resource_value field will be ignored when reading this configuration. - # @!attribute [rw] high_sensitivity_mapping - # @return [::Google::Cloud::SecurityCenter::V2::ResourceValue] - # Resource value mapping for high-sensitivity Sensitive Data Protection - # findings - # @!attribute [rw] medium_sensitivity_mapping - # @return [::Google::Cloud::SecurityCenter::V2::ResourceValue] - # Resource value mapping for medium-sensitivity Sensitive Data Protection - # findings - class SensitiveDataProtectionMapping - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # @!attribute [rw] key - # @return [::String] - # @!attribute [rw] value - # @return [::String] - class ResourceLabelsSelectorEntry - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - end - - # Value enum to map to a resource - module ResourceValue - # Unspecific value - RESOURCE_VALUE_UNSPECIFIED = 0 - - # High resource value - HIGH = 1 - - # Medium resource value - MEDIUM = 2 - - # Low resource value - LOW = 3 - - # No resource value, e.g. ignore these resources - NONE = 4 - end - end - end - end -end diff --git a/owl-bot-staging/google-cloud-security_center-v2/proto_docs/google/cloud/securitycenter/v2/security_marks.rb b/owl-bot-staging/google-cloud-security_center-v2/proto_docs/google/cloud/securitycenter/v2/security_marks.rb deleted file mode 100644 index 1e3bcc93a58a..000000000000 --- a/owl-bot-staging/google-cloud-security_center-v2/proto_docs/google/cloud/securitycenter/v2/security_marks.rb +++ /dev/null @@ -1,84 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - - -module Google - module Cloud - module SecurityCenter - module V2 - # User specified security marks that are attached to the parent Security - # Command Center resource. Security marks are scoped within a Security Command - # Center organization -- they can be modified and viewed by all users who have - # proper permissions on the organization. - # @!attribute [rw] name - # @return [::String] - # The relative resource name of the SecurityMarks. See: - # https://cloud.google.com/apis/design/resource_names#relative_resource_name - # The following list shows some examples: - # - # + `organizations/{organization_id}/assets/{asset_id}/securityMarks` - # + - # `organizations/{organization_id}/sources/{source_id}/findings/{finding_id}/securityMarks` - # + - # `organizations/{organization_id}/sources/{source_id}/locations/{location}/findings/{finding_id}/securityMarks` - # @!attribute [rw] marks - # @return [::Google::Protobuf::Map{::String => ::String}] - # Mutable user specified security marks belonging to the parent resource. - # Constraints are as follows: - # - # * Keys and values are treated as case insensitive - # * Keys must be between 1 - 256 characters (inclusive) - # * Keys must be letters, numbers, underscores, or dashes - # * Values have leading and trailing whitespace trimmed, remaining - # characters must be between 1 - 4096 characters (inclusive) - # @!attribute [rw] canonical_name - # @return [::String] - # The canonical name of the marks. The following list shows some examples: - # - # + `organizations/{organization_id}/assets/{asset_id}/securityMarks` - # + - # `organizations/{organization_id}/sources/{source_id}/findings/{finding_id}/securityMarks` - # + - # `organizations/{organization_id}/sources/{source_id}/locations/{location}/findings/{finding_id}/securityMarks` - # + `folders/{folder_id}/assets/{asset_id}/securityMarks` - # + - # `folders/{folder_id}/sources/{source_id}/findings/{finding_id}/securityMarks` - # + - # `folders/{folder_id}/sources/{source_id}/locations/{location}/findings/{finding_id}/securityMarks` - # + `projects/{project_number}/assets/{asset_id}/securityMarks` - # + - # `projects/{project_number}/sources/{source_id}/findings/{finding_id}/securityMarks` - # + - # `projects/{project_number}/sources/{source_id}/locations/{location}/findings/{finding_id}/securityMarks` - class SecurityMarks - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - - # @!attribute [rw] key - # @return [::String] - # @!attribute [rw] value - # @return [::String] - class MarksEntry - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - end - end - end - end -end diff --git a/owl-bot-staging/google-cloud-security_center-v2/proto_docs/google/cloud/securitycenter/v2/security_posture.rb b/owl-bot-staging/google-cloud-security_center-v2/proto_docs/google/cloud/securitycenter/v2/security_posture.rb deleted file mode 100644 index 3c2c9899fac1..000000000000 --- a/owl-bot-staging/google-cloud-security_center-v2/proto_docs/google/cloud/securitycenter/v2/security_posture.rb +++ /dev/null @@ -1,83 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - - -module Google - module Cloud - module SecurityCenter - module V2 - # Represents a posture that is deployed on Google Cloud by the - # Security Command Center Posture Management service. - # A posture contains one or more policy sets. A policy set is a - # group of policies that enforce a set of security rules on Google - # Cloud. - # @!attribute [rw] name - # @return [::String] - # Name of the posture, for example, `CIS-Posture`. - # @!attribute [rw] revision_id - # @return [::String] - # The version of the posture, for example, `c7cfa2a8`. - # @!attribute [rw] posture_deployment_resource - # @return [::String] - # The project, folder, or organization on which the posture is deployed, - # for example, `projects/{project_number}`. - # @!attribute [rw] posture_deployment - # @return [::String] - # The name of the posture deployment, for example, - # `organizations/{org_id}/posturedeployments/{posture_deployment_id}`. - # @!attribute [rw] changed_policy - # @return [::String] - # The name of the updated policy, for example, - # `projects/{project_id}/policies/{constraint_name}`. - # @!attribute [rw] policy_set - # @return [::String] - # The name of the updated policy set, for example, `cis-policyset`. - # @!attribute [rw] policy - # @return [::String] - # The ID of the updated policy, for example, `compute-policy-1`. - # @!attribute [rw] policy_drift_details - # @return [::Array<::Google::Cloud::SecurityCenter::V2::SecurityPosture::PolicyDriftDetails>] - # The details about a change in an updated policy that violates the deployed - # posture. - class SecurityPosture - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - - # The policy field that violates the deployed posture and its expected and - # detected values. - # @!attribute [rw] field - # @return [::String] - # The name of the updated field, for example - # constraint.implementation.policy_rules[0].enforce - # @!attribute [rw] expected_value - # @return [::String] - # The value of this field that was configured in a posture, for example, - # `true` or `allowed_values={"projects/29831892"}`. - # @!attribute [rw] detected_value - # @return [::String] - # The detected value that violates the deployed posture, for example, - # `false` or `allowed_values={"projects/22831892"}`. - class PolicyDriftDetails - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - end - end - end - end -end diff --git a/owl-bot-staging/google-cloud-security_center-v2/proto_docs/google/cloud/securitycenter/v2/securitycenter_service.rb b/owl-bot-staging/google-cloud-security_center-v2/proto_docs/google/cloud/securitycenter/v2/securitycenter_service.rb deleted file mode 100644 index 5aa1b2607e39..000000000000 --- a/owl-bot-staging/google-cloud-security_center-v2/proto_docs/google/cloud/securitycenter/v2/securitycenter_service.rb +++ /dev/null @@ -1,1216 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - - -module Google - module Cloud - module SecurityCenter - module V2 - # Request message to create multiple resource value configs - # @!attribute [rw] parent - # @return [::String] - # Required. Resource name of the new ResourceValueConfig's parent. - # The parent field in the CreateResourceValueConfigRequest - # messages must either be empty or match this field. - # @!attribute [rw] requests - # @return [::Array<::Google::Cloud::SecurityCenter::V2::CreateResourceValueConfigRequest>] - # Required. The resource value configs to be created. - class BatchCreateResourceValueConfigsRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Response message for BatchCreateResourceValueConfigs - # @!attribute [rw] resource_value_configs - # @return [::Array<::Google::Cloud::SecurityCenter::V2::ResourceValueConfig>] - # The resource value configs created - class BatchCreateResourceValueConfigsResponse - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Request message for bulk findings update. - # - # Note: - # 1. If multiple bulk update requests match the same resource, the order in - # which they get executed is not defined. - # 2. Once a bulk operation is started, there is no way to stop it. - # @!attribute [rw] parent - # @return [::String] - # Required. The parent, at which bulk action needs to be applied. If no - # location is specified, findings are updated in global. The following list - # shows some examples: - # - # + `organizations/[organization_id]` - # + `organizations/[organization_id]/locations/[location_id]` - # + `folders/[folder_id]` - # + `folders/[folder_id]/locations/[location_id]` - # + `projects/[project_id]` - # + `projects/[project_id]/locations/[location_id]` - # @!attribute [rw] filter - # @return [::String] - # Expression that identifies findings that should be updated. - # The expression is a list of zero or more restrictions combined - # via logical operators `AND` and `OR`. Parentheses are supported, and `OR` - # has higher precedence than `AND`. - # - # Restrictions have the form ` ` and may have a - # `-` character in front of them to indicate negation. The fields map to - # those defined in the corresponding resource. - # - # The supported operators are: - # - # * `=` for all value types. - # * `>`, `<`, `>=`, `<=` for integer values. - # * `:`, meaning substring matching, for strings. - # - # The supported value types are: - # - # * string literals in quotes. - # * integer literals without quotes. - # * boolean literals `true` and `false` without quotes. - # @!attribute [rw] mute_state - # @return [::Google::Cloud::SecurityCenter::V2::BulkMuteFindingsRequest::MuteState] - # Optional. All findings matching the given filter will have their mute state - # set to this value. The default value is `MUTED`. Setting this to - # `UNDEFINED` will clear the mute state on all matching findings. - class BulkMuteFindingsRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - - # The mute state. - module MuteState - # Unused. - MUTE_STATE_UNSPECIFIED = 0 - - # Matching findings will be muted (default). - MUTED = 1 - - # Matching findings will have their mute state cleared. - UNDEFINED = 2 - end - end - - # The response to a BulkMute request. Contains the LRO information. - class BulkMuteFindingsResponse - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Request message for creating a BigQuery export. - # @!attribute [rw] parent - # @return [::String] - # Required. The name of the parent resource of the new BigQuery export. Its - # format is `organizations/[organization_id]/locations/[location_id]`, - # `folders/[folder_id]/locations/[location_id]`, or - # `projects/[project_id]/locations/[location_id]`. - # @!attribute [rw] big_query_export - # @return [::Google::Cloud::SecurityCenter::V2::BigQueryExport] - # Required. The BigQuery export being created. - # @!attribute [rw] big_query_export_id - # @return [::String] - # Required. Unique identifier provided by the client within the parent scope. - # It must consist of only lowercase letters, numbers, and hyphens, must start - # with a letter, must end with either a letter or a number, and must be 63 - # characters or less. - class CreateBigQueryExportRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Request message for creating a finding. - # @!attribute [rw] parent - # @return [::String] - # Required. Resource name of the new finding's parent. The following list - # shows some examples of the format: - # + - # `organizations/[organization_id]/sources/[source_id]` - # + - # `organizations/[organization_id]/sources/[source_id]/locations/[location_id]` - # @!attribute [rw] finding_id - # @return [::String] - # Required. Unique identifier provided by the client within the parent scope. - # It must be alphanumeric and less than or equal to 32 characters and - # greater than 0 characters in length. - # @!attribute [rw] finding - # @return [::Google::Cloud::SecurityCenter::V2::Finding] - # Required. The Finding being created. The name and security_marks will be - # ignored as they are both output only fields on this resource. - class CreateFindingRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Request message for creating a mute config. - # @!attribute [rw] parent - # @return [::String] - # Required. Resource name of the new mute configs's parent. Its format is - # `organizations/[organization_id]/locations/[location_id]`, - # `folders/[folder_id]/locations/[location_id]`, or - # `projects/[project_id]/locations/[location_id]`. - # @!attribute [rw] mute_config - # @return [::Google::Cloud::SecurityCenter::V2::MuteConfig] - # Required. The mute config being created. - # @!attribute [rw] mute_config_id - # @return [::String] - # Required. Unique identifier provided by the client within the parent scope. - # It must consist of only lowercase letters, numbers, and hyphens, must start - # with a letter, must end with either a letter or a number, and must be 63 - # characters or less. - class CreateMuteConfigRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Request message for creating a notification config. - # @!attribute [rw] parent - # @return [::String] - # Required. Resource name of the new notification config's parent. Its format - # is `organizations/[organization_id]/locations/[location_id]`, - # `folders/[folder_id]/locations/[location_id]`, or - # `projects/[project_id]/locations/[location_id]`. - # @!attribute [rw] config_id - # @return [::String] - # Required. - # Unique identifier provided by the client within the parent scope. - # It must be between 1 and 128 characters and contain alphanumeric - # characters, underscores, or hyphens only. - # @!attribute [rw] notification_config - # @return [::Google::Cloud::SecurityCenter::V2::NotificationConfig] - # Required. The notification config being created. The name and the service - # account will be ignored as they are both output only fields on this - # resource. - class CreateNotificationConfigRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Request message to create single resource value config - # @!attribute [rw] parent - # @return [::String] - # Required. Resource name of the new ResourceValueConfig's parent. - # @!attribute [rw] resource_value_config - # @return [::Google::Cloud::SecurityCenter::V2::ResourceValueConfig] - # Required. The resource value config being created. - class CreateResourceValueConfigRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Request message for creating a source. - # @!attribute [rw] parent - # @return [::String] - # Required. Resource name of the new source's parent. Its format should be - # `organizations/[organization_id]`. - # @!attribute [rw] source - # @return [::Google::Cloud::SecurityCenter::V2::Source] - # Required. The Source being created, only the display_name and description - # will be used. All other fields will be ignored. - class CreateSourceRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Request message for deleting a BigQuery export. - # @!attribute [rw] name - # @return [::String] - # Required. The name of the BigQuery export to delete. The following list - # shows some examples of the format: - # - # + - # `organizations/{organization}/locations/{location}/bigQueryExports/{export_id}` - # + `folders/{folder}/locations/{location}/bigQueryExports/{export_id}` - # + `projects/{project}/locations/{location}/bigQueryExports/{export_id}` - class DeleteBigQueryExportRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Request message for deleting a mute config. If no location is specified, - # default is global. - # @!attribute [rw] name - # @return [::String] - # Required. Name of the mute config to delete. The following list shows some - # examples of the format: - # - # + `organizations/{organization}/muteConfigs/{config_id}` - # + - # `organizations/{organization}/locations/{location}/muteConfigs/{config_id}` - # + `folders/{folder}/muteConfigs/{config_id}` - # + `folders/{folder}/locations/{location}/muteConfigs/{config_id}` - # + `projects/{project}/muteConfigs/{config_id}` - # + `projects/{project}/locations/{location}/muteConfigs/{config_id}` - class DeleteMuteConfigRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Request message for deleting a notification config. - # @!attribute [rw] name - # @return [::String] - # Required. Name of the notification config to delete. The following list - # shows some examples of the format: - # - # + - # `organizations/[organization_id]/locations/[location_id]/notificationConfigs/[config_id]` - # + - # `folders/[folder_id]/locations/[location_id]notificationConfigs/[config_id]` - # + - # `projects/[project_id]/locations/[location_id]notificationConfigs/[config_id]` - class DeleteNotificationConfigRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Request message to delete resource value config - # @!attribute [rw] name - # @return [::String] - # Required. Name of the ResourceValueConfig to delete - class DeleteResourceValueConfigRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # The destination big query dataset to export findings to. - # @!attribute [rw] dataset - # @return [::String] - # Required. The relative resource name of the destination dataset, in the - # form projects/\\{projectId}/datasets/\\{datasetId}. - class BigQueryDestination - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # The LRO metadata for a ExportFindings request. - # @!attribute [rw] export_start_time - # @return [::Google::Protobuf::Timestamp] - # Optional. Timestamp at which export was started - # @!attribute [rw] big_query_destination - # @return [::Google::Cloud::SecurityCenter::V2::BigQueryDestination] - # Required. The destination big query dataset to export findings to. - class ExportFindingsMetadata - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # The response to a ExportFindings request. Contains the LRO information. - class ExportFindingsResponse - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Request message for retrieving a BigQuery export. - # @!attribute [rw] name - # @return [::String] - # Required. Name of the BigQuery export to retrieve. The following list shows - # some examples of the format: - # - # + - # `organizations/{organization}/locations/{location}/bigQueryExports/{export_id}` - # + `folders/{folder}/locations/{location}/bigQueryExports/{export_id}` - # + `projects/{project}locations/{location}//bigQueryExports/{export_id}` - class GetBigQueryExportRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Request message for retrieving a mute config. If no location is specified, - # default is global. - # @!attribute [rw] name - # @return [::String] - # Required. Name of the mute config to retrieve. The following list shows - # some examples of the format: - # - # + `organizations/{organization}/muteConfigs/{config_id}` - # + - # `organizations/{organization}/locations/{location}/muteConfigs/{config_id}` - # + `folders/{folder}/muteConfigs/{config_id}` - # + `folders/{folder}/locations/{location}/muteConfigs/{config_id}` - # + `projects/{project}/muteConfigs/{config_id}` - # + `projects/{project}/locations/{location}/muteConfigs/{config_id}` - class GetMuteConfigRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Request message for getting a notification config. - # @!attribute [rw] name - # @return [::String] - # Required. Name of the notification config to get. The following list shows - # some examples of the format: - # - # + - # `organizations/[organization_id]/locations/[location_id]/notificationConfigs/[config_id]` - # + - # `folders/[folder_id]/locations/[location_id]/notificationConfigs/[config_id]` - # + - # `projects/[project_id]/locations/[location_id]/notificationConfigs/[config_id]` - class GetNotificationConfigRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Request message to get resource value config - # @!attribute [rw] name - # @return [::String] - # Required. Name of the resource value config to retrieve. Its format is - # organizations/\\{organization}/resourceValueConfigs/\\{config_id}. - class GetResourceValueConfigRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Request message for getting a source. - # @!attribute [rw] name - # @return [::String] - # Required. Relative resource name of the source. Its format is - # `organizations/[organization_id]/source/[source_id]`. - class GetSourceRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Request message for grouping by findings. - # @!attribute [rw] parent - # @return [::String] - # Required. Name of the source to groupBy. If no location is specified, - # finding is assumed to be in global. - # The following list shows some examples: - # - # + `organizations/[organization_id]/sources/[source_id]` - # + - # `organizations/[organization_id]/sources/[source_id]/locations/[location_id]` - # + `folders/[folder_id]/sources/[source_id]` - # + `folders/[folder_id]/sources/[source_id]/locations/[location_id]` - # + `projects/[project_id]/sources/[source_id]` - # + `projects/[project_id]/sources/[source_id]/locations/[location_id]` - # - # To groupBy across all sources provide a source_id of `-`. The following - # list shows some examples: - # - # + `organizations/{organization_id}/sources/-` - # + `organizations/{organization_id}/sources/-/locations/[location_id]` - # + `folders/{folder_id}/sources/-` - # + `folders/{folder_id}/sources/-/locations/[location_id]` - # + `projects/{project_id}/sources/-` - # + `projects/{project_id}/sources/-/locations/[location_id]` - # @!attribute [rw] filter - # @return [::String] - # Expression that defines the filter to apply across findings. - # The expression is a list of one or more restrictions combined via logical - # operators `AND` and `OR`. - # Parentheses are supported, and `OR` has higher precedence than `AND`. - # - # Restrictions have the form ` ` and may have a `-` - # character in front of them to indicate negation. Examples include: - # - # * name - # * security_marks.marks.marka - # - # The supported operators are: - # - # * `=` for all value types. - # * `>`, `<`, `>=`, `<=` for integer values. - # * `:`, meaning substring matching, for strings. - # - # The supported value types are: - # - # * string literals in quotes. - # * integer literals without quotes. - # * boolean literals `true` and `false` without quotes. - # - # The following field and operator combinations are supported: - # - # * name: `=` - # * parent: `=`, `:` - # * resource_name: `=`, `:` - # * state: `=`, `:` - # * category: `=`, `:` - # * external_uri: `=`, `:` - # * event_time: `=`, `>`, `<`, `>=`, `<=` - # - # Usage: This should be milliseconds since epoch or an RFC3339 string. - # Examples: - # `event_time = "2019-06-10T16:07:18-07:00"` - # `event_time = 1560208038000` - # - # * severity: `=`, `:` - # * security_marks.marks: `=`, `:` - # * resource: - # * resource.name: `=`, `:` - # * resource.parent_name: `=`, `:` - # * resource.parent_display_name: `=`, `:` - # * resource.project_name: `=`, `:` - # * resource.project_display_name: `=`, `:` - # * resource.type: `=`, `:` - # @!attribute [rw] group_by - # @return [::String] - # Required. Expression that defines what assets fields to use for grouping. - # The string value should follow SQL syntax: comma separated list of fields. - # For example: "parent,resource_name". - # @!attribute [rw] page_token - # @return [::String] - # The value returned by the last `GroupFindingsResponse`; indicates - # that this is a continuation of a prior `GroupFindings` call, and - # that the system should return the next page of data. - # @!attribute [rw] page_size - # @return [::Integer] - # The maximum number of results to return in a single response. Default is - # 10, minimum is 1, maximum is 1000. - class GroupFindingsRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Response message for group by findings. - # @!attribute [rw] group_by_results - # @return [::Array<::Google::Cloud::SecurityCenter::V2::GroupResult>] - # Group results. There exists an element for each existing unique - # combination of property/values. The element contains a count for the number - # of times those specific property/values appear. - # @!attribute [rw] next_page_token - # @return [::String] - # Token to retrieve the next page of results, or empty if there are no more - # results. - # @!attribute [rw] total_size - # @return [::Integer] - # The total number of results matching the query. - class GroupFindingsResponse - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Result containing the properties and count of a groupBy request. - # @!attribute [rw] properties - # @return [::Google::Protobuf::Map{::String => ::Google::Protobuf::Value}] - # Properties matching the groupBy fields in the request. - # @!attribute [rw] count - # @return [::Integer] - # Total count of resources for the given properties. - class GroupResult - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - - # @!attribute [rw] key - # @return [::String] - # @!attribute [rw] value - # @return [::Google::Protobuf::Value] - class PropertiesEntry - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - end - - # Request message for listing the attack paths for a given simulation or valued - # resource. - # @!attribute [rw] parent - # @return [::String] - # Required. Name of parent to list attack paths. - # - # Valid formats: - # `organizations/{organization}`, - # `organizations/{organization}/simulations/{simulation}` - # `organizations/{organization}/simulations/{simulation}/attackExposureResults/{attack_exposure_result_v2}` - # `organizations/{organization}/simulations/{simulation}/valuedResources/{valued_resource}` - # @!attribute [rw] filter - # @return [::String] - # The filter expression that filters the attack path in the response. - # Supported fields: - # - # * `valued_resources` supports = - # @!attribute [rw] page_token - # @return [::String] - # The value returned by the last `ListAttackPathsResponse`; indicates - # that this is a continuation of a prior `ListAttackPaths` call, and - # that the system should return the next page of data. - # @!attribute [rw] page_size - # @return [::Integer] - # The maximum number of results to return in a single response. Default is - # 10, minimum is 1, maximum is 1000. - class ListAttackPathsRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Response message for listing the attack paths for a given simulation or - # valued resource. - # @!attribute [rw] attack_paths - # @return [::Array<::Google::Cloud::SecurityCenter::V2::AttackPath>] - # The attack paths that the attack path simulation identified. - # @!attribute [rw] next_page_token - # @return [::String] - # Token to retrieve the next page of results, or empty if there are no more - # results. - class ListAttackPathsResponse - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Request message for getting simulation. - # Simulation name can include "latest" to retrieve the latest simulation - # For example, "organizations/123/simulations/latest" - # @!attribute [rw] name - # @return [::String] - # Required. The organization name or simulation name of this simulation - # - # Valid format: - # `organizations/{organization}/simulations/latest` - # `organizations/{organization}/simulations/{simulation}` - class GetSimulationRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Request message for getting a valued resource. - # @!attribute [rw] name - # @return [::String] - # Required. The name of this valued resource - # - # Valid format: - # `organizations/{organization}/simulations/{simulation}/valuedResources/{valued_resource}` - class GetValuedResourceRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Request message for listing BigQuery exports at a given scope e.g. - # organization, folder or project. - # @!attribute [rw] parent - # @return [::String] - # Required. The parent, which owns the collection of BigQuery exports. Its - # format is `organizations/[organization_id]/locations/[location_id]`, - # `folders/[folder_id]/locations/[location_id]`, or - # `projects/[project_id]/locations/[location_id]`. - # @!attribute [rw] page_size - # @return [::Integer] - # The maximum number of configs to return. The service may return fewer than - # this value. - # If unspecified, at most 10 configs will be returned. - # The maximum value is 1000; values above 1000 will be coerced to 1000. - # @!attribute [rw] page_token - # @return [::String] - # A page token, received from a previous `ListBigQueryExports` call. - # Provide this to retrieve the subsequent page. - # When paginating, all other parameters provided to `ListBigQueryExports` - # must match the call that provided the page token. - class ListBigQueryExportsRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Response message for listing BigQuery exports. - # @!attribute [rw] big_query_exports - # @return [::Array<::Google::Cloud::SecurityCenter::V2::BigQueryExport>] - # The BigQuery exports from the specified parent. - # @!attribute [rw] next_page_token - # @return [::String] - # A token, which can be sent as `page_token` to retrieve the next page. - # If this field is omitted, there are no subsequent pages. - class ListBigQueryExportsResponse - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Request message for listing findings. - # @!attribute [rw] parent - # @return [::String] - # Required. Name of the source the findings belong to. If no location is - # specified, the default is global. The following list shows some examples: - # - # + `organizations/[organization_id]/sources/[source_id]` - # + - # `organizations/[organization_id]/sources/[source_id]/locations/[location_id]` - # + `folders/[folder_id]/sources/[source_id]` - # + `folders/[folder_id]/sources/[source_id]/locations/[location_id]` - # + `projects/[project_id]/sources/[source_id]` - # + `projects/[project_id]/sources/[source_id]/locations/[location_id]` - # - # To list across all sources provide a source_id of `-`. The following - # list shows some examples: - # - # + `organizations/{organization_id}/sources/-` - # + `organizations/{organization_id}/sources/-/locations/{location_id}` - # + `folders/{folder_id}/sources/-` - # + `folders/{folder_id}/sources/-locations/{location_id}` - # + `projects/{projects_id}/sources/-` - # + `projects/{projects_id}/sources/-/locations/{location_id}` - # @!attribute [rw] filter - # @return [::String] - # Expression that defines the filter to apply across findings. - # The expression is a list of one or more restrictions combined via logical - # operators `AND` and `OR`. - # Parentheses are supported, and `OR` has higher precedence than `AND`. - # - # Restrictions have the form ` ` and may have a `-` - # character in front of them to indicate negation. Examples include: - # - # * name - # * security_marks.marks.marka - # - # The supported operators are: - # - # * `=` for all value types. - # * `>`, `<`, `>=`, `<=` for integer values. - # * `:`, meaning substring matching, for strings. - # - # The supported value types are: - # - # * string literals in quotes. - # * integer literals without quotes. - # * boolean literals `true` and `false` without quotes. - # - # The following field and operator combinations are supported: - # - # * name: `=` - # * parent: `=`, `:` - # * resource_name: `=`, `:` - # * state: `=`, `:` - # * category: `=`, `:` - # * external_uri: `=`, `:` - # * event_time: `=`, `>`, `<`, `>=`, `<=` - # - # Usage: This should be milliseconds since epoch or an RFC3339 string. - # Examples: - # `event_time = "2019-06-10T16:07:18-07:00"` - # `event_time = 1560208038000` - # - # * severity: `=`, `:` - # * security_marks.marks: `=`, `:` - # * resource: - # * resource.name: `=`, `:` - # * resource.parent_name: `=`, `:` - # * resource.parent_display_name: `=`, `:` - # * resource.project_name: `=`, `:` - # * resource.project_display_name: `=`, `:` - # * resource.type: `=`, `:` - # * resource.folders.resource_folder: `=`, `:` - # * resource.display_name: `=`, `:` - # @!attribute [rw] order_by - # @return [::String] - # Expression that defines what fields and order to use for sorting. The - # string value should follow SQL syntax: comma separated list of fields. For - # example: "name,parent". The default sorting order - # is ascending. To specify descending order for a field, a suffix " desc" - # should be appended to the field name. For example: "name - # desc,parent". Redundant space characters in the - # syntax are insignificant. "name desc,parent" and " - # name desc , parent " are equivalent. - # - # The following fields are supported: - # name - # parent - # state - # category - # resource_name - # event_time - # security_marks.marks - # @!attribute [rw] field_mask - # @return [::Google::Protobuf::FieldMask] - # A field mask to specify the Finding fields to be listed in the response. - # An empty field mask will list all fields. - # @!attribute [rw] page_token - # @return [::String] - # The value returned by the last `ListFindingsResponse`; indicates - # that this is a continuation of a prior `ListFindings` call, and - # that the system should return the next page of data. - # @!attribute [rw] page_size - # @return [::Integer] - # The maximum number of results to return in a single response. Default is - # 10, minimum is 1, maximum is 1000. - class ListFindingsRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Response message for listing findings. - # @!attribute [rw] list_findings_results - # @return [::Array<::Google::Cloud::SecurityCenter::V2::ListFindingsResponse::ListFindingsResult>] - # Findings matching the list request. - # @!attribute [rw] next_page_token - # @return [::String] - # Token to retrieve the next page of results, or empty if there are no more - # results. - # @!attribute [rw] total_size - # @return [::Integer] - # The total number of findings matching the query. - class ListFindingsResponse - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - - # Result containing the Finding. - # @!attribute [rw] finding - # @return [::Google::Cloud::SecurityCenter::V2::Finding] - # Finding matching the search request. - # @!attribute [r] resource - # @return [::Google::Cloud::SecurityCenter::V2::ListFindingsResponse::ListFindingsResult::Resource] - # Output only. Resource that is associated with this finding. - class ListFindingsResult - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - - # Information related to the Google Cloud resource that is - # associated with this finding. - # @!attribute [rw] name - # @return [::String] - # The full resource name of the resource. See: - # https://cloud.google.com/apis/design/resource_names#full_resource_name - # @!attribute [rw] display_name - # @return [::String] - # The human readable name of the resource. - # @!attribute [rw] type - # @return [::String] - # The full resource type of the resource. - # @!attribute [rw] cloud_provider - # @return [::Google::Cloud::SecurityCenter::V2::CloudProvider] - # Indicates which cloud provider the finding is from. - # @!attribute [rw] service - # @return [::String] - # The service or resource provider associated with the resource. - # @!attribute [rw] location - # @return [::String] - # The region or location of the service (if applicable). - # @!attribute [rw] gcp_metadata - # @return [::Google::Cloud::SecurityCenter::V2::GcpMetadata] - # The GCP metadata associated with the finding. - # - # Note: The following fields are mutually exclusive: `gcp_metadata`, `aws_metadata`, `azure_metadata`. If a field in that set is populated, all other fields in the set will automatically be cleared. - # @!attribute [rw] aws_metadata - # @return [::Google::Cloud::SecurityCenter::V2::AwsMetadata] - # The AWS metadata associated with the finding. - # - # Note: The following fields are mutually exclusive: `aws_metadata`, `gcp_metadata`, `azure_metadata`. If a field in that set is populated, all other fields in the set will automatically be cleared. - # @!attribute [rw] azure_metadata - # @return [::Google::Cloud::SecurityCenter::V2::AzureMetadata] - # The Azure metadata associated with the finding. - # - # Note: The following fields are mutually exclusive: `azure_metadata`, `gcp_metadata`, `aws_metadata`. If a field in that set is populated, all other fields in the set will automatically be cleared. - # @!attribute [rw] resource_path - # @return [::Google::Cloud::SecurityCenter::V2::ResourcePath] - # Provides the path to the resource within the resource hierarchy. - # @!attribute [rw] resource_path_string - # @return [::String] - # A string representation of the resource path. - # For Google Cloud, it has the format of - # `organizations/{organization_id}/folders/{folder_id}/folders/{folder_id}/projects/{project_id}` - # where there can be any number of folders. - # For AWS, it has the format of - # `org/{organization_id}/ou/{organizational_unit_id}/ou/{organizational_unit_id}/account/{account_id}` - # where there can be any number of organizational units. - # For Azure, it has the format of - # `mg/{management_group_id}/mg/{management_group_id}/subscription/{subscription_id}/rg/{resource_group_name}` - # where there can be any number of management groups. - class Resource - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - end - end - - # Request message for listing mute configs at a given scope e.g. organization, - # folder or project. If no location is specified, default is - # global. - # @!attribute [rw] parent - # @return [::String] - # Required. The parent, which owns the collection of mute configs. Its format - # is `organizations/[organization_id]", "folders/[folder_id]`, - # `projects/[project_id]`, - # `organizations/[organization_id]/locations/[location_id]`, - # `folders/[folder_id]/locations/[location_id]`, - # `projects/[project_id]/locations/[location_id]`. - # @!attribute [rw] page_size - # @return [::Integer] - # The maximum number of configs to return. The service may return fewer than - # this value. - # If unspecified, at most 10 configs will be returned. - # The maximum value is 1000; values above 1000 will be coerced to 1000. - # @!attribute [rw] page_token - # @return [::String] - # A page token, received from a previous `ListMuteConfigs` call. - # Provide this to retrieve the subsequent page. - # - # When paginating, all other parameters provided to `ListMuteConfigs` must - # match the call that provided the page token. - class ListMuteConfigsRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Response message for listing mute configs. - # @!attribute [rw] mute_configs - # @return [::Array<::Google::Cloud::SecurityCenter::V2::MuteConfig>] - # The mute configs from the specified parent. - # @!attribute [rw] next_page_token - # @return [::String] - # A token, which can be sent as `page_token` to retrieve the next page. - # If this field is omitted, there are no subsequent pages. - class ListMuteConfigsResponse - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Request message for listing notification configs. - # @!attribute [rw] parent - # @return [::String] - # Required. The name of the parent in which to list the notification - # configurations. Its format is - # "organizations/[organization_id]/locations/[location_id]", - # "folders/[folder_id]/locations/[location_id]", or - # "projects/[project_id]/locations/[location_id]". - # @!attribute [rw] page_token - # @return [::String] - # The value returned by the last `ListNotificationConfigsResponse`; indicates - # that this is a continuation of a prior `ListNotificationConfigs` call, and - # that the system should return the next page of data. - # @!attribute [rw] page_size - # @return [::Integer] - # The maximum number of results to return in a single response. Default is - # 10, minimum is 1, maximum is 1000. - class ListNotificationConfigsRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Response message for listing notification configs. - # @!attribute [rw] notification_configs - # @return [::Array<::Google::Cloud::SecurityCenter::V2::NotificationConfig>] - # Notification configs belonging to the requested parent. - # @!attribute [rw] next_page_token - # @return [::String] - # Token to retrieve the next page of results, or empty if there are no more - # results. - class ListNotificationConfigsResponse - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Request message to list resource value configs of a parent - # @!attribute [rw] parent - # @return [::String] - # Required. The parent, which owns the collection of resource value configs. - # Its format is - # `organizations/[organization_id]` - # @!attribute [rw] page_size - # @return [::Integer] - # The maximum number of configs to return. The service may return fewer than - # this value. - # If unspecified, at most 10 configs will be returned. - # The maximum value is 1000; values above 1000 will be coerced to 1000. - # @!attribute [rw] page_token - # @return [::String] - # A page token, received from a previous `ListResourceValueConfigs` call. - # Provide this to retrieve the subsequent page. - # - # When paginating, all other parameters provided to - # `ListResourceValueConfigs` must match the call that provided the - # page token. - # - # page_size can be specified, and the new page_size will be used. - class ListResourceValueConfigsRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Response message to list resource value configs - # @!attribute [rw] resource_value_configs - # @return [::Array<::Google::Cloud::SecurityCenter::V2::ResourceValueConfig>] - # The resource value configs from the specified parent. - # @!attribute [rw] next_page_token - # @return [::String] - # A token, which can be sent as `page_token` to retrieve the next page. - # If this field is empty, there are no subsequent pages. - class ListResourceValueConfigsResponse - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Request message for listing sources. - # @!attribute [rw] parent - # @return [::String] - # Required. Resource name of the parent of sources to list. Its format should - # be `organizations/[organization_id]`, `folders/[folder_id]`, or - # `projects/[project_id]`. - # @!attribute [rw] page_token - # @return [::String] - # The value returned by the last `ListSourcesResponse`; indicates - # that this is a continuation of a prior `ListSources` call, and - # that the system should return the next page of data. - # @!attribute [rw] page_size - # @return [::Integer] - # The maximum number of results to return in a single response. Default is - # 10, minimum is 1, maximum is 1000. - class ListSourcesRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Response message for listing sources. - # @!attribute [rw] sources - # @return [::Array<::Google::Cloud::SecurityCenter::V2::Source>] - # Sources belonging to the requested parent. - # @!attribute [rw] next_page_token - # @return [::String] - # Token to retrieve the next page of results, or empty if there are no more - # results. - class ListSourcesResponse - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Request message for listing the valued resources for a given simulation. - # @!attribute [rw] parent - # @return [::String] - # Required. Name of parent to list exposed resources. - # - # Valid formats: - # `organizations/{organization}`, - # `organizations/{organization}/simulations/{simulation}` - # `organizations/{organization}/simulations/{simulation}/attackExposureResults/{attack_exposure_result_v2}` - # @!attribute [rw] filter - # @return [::String] - # The filter expression that filters the valued resources in the response. - # Supported fields: - # - # * `resource_value` supports = - # * `resource_type` supports = - # @!attribute [rw] page_token - # @return [::String] - # The value returned by the last `ListValuedResourcesResponse`; indicates - # that this is a continuation of a prior `ListValuedResources` call, and - # that the system should return the next page of data. - # @!attribute [rw] page_size - # @return [::Integer] - # The maximum number of results to return in a single response. Default is - # 10, minimum is 1, maximum is 1000. - # @!attribute [rw] order_by - # @return [::String] - # Optional. The fields by which to order the valued resources response. - # - # Supported fields: - # - # * `exposed_score` - # - # * `resource_value` - # - # * `resource_type` - # - # Values should be a comma separated list of fields. For example: - # `exposed_score,resource_value`. - # - # The default sorting order is descending. To specify ascending or descending - # order for a field, append a " ASC" or a " DESC" suffix, respectively; for - # example: `exposed_score DESC`. - class ListValuedResourcesRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Response message for listing the valued resources for a given simulation. - # @!attribute [rw] valued_resources - # @return [::Array<::Google::Cloud::SecurityCenter::V2::ValuedResource>] - # The valued resources that the attack path simulation identified. - # @!attribute [rw] next_page_token - # @return [::String] - # Token to retrieve the next page of results, or empty if there are no more - # results. - # @!attribute [rw] total_size - # @return [::Integer] - # The estimated total number of results matching the query. - class ListValuedResourcesResponse - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Request message for updating a finding's state. - # @!attribute [rw] name - # @return [::String] - # Required. The [relative resource - # name](https://cloud.google.com/apis/design/resource_names#relative_resource_name) - # of the finding. If no location is specified, finding is assumed to be in - # global. The following list shows some examples: - # - # + - # `organizations/{organization_id}/sources/{source_id}/findings/{finding_id}` - # + - # `organizations/{organization_id}/sources/{source_id}/locations/{location_id}/findings/{finding_id}` - # + `folders/{folder_id}/sources/{source_id}/findings/{finding_id}` - # + - # `folders/{folder_id}/sources/{source_id}/locations/{location_id}/findings/{finding_id}` - # + `projects/{project_id}/sources/{source_id}/findings/{finding_id}` - # + - # `projects/{project_id}/sources/{source_id}/locations/{location_id}/findings/{finding_id}` - # @!attribute [rw] state - # @return [::Google::Cloud::SecurityCenter::V2::Finding::State] - # Required. The desired State of the finding. - class SetFindingStateRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Request message for updating a finding's mute status. - # @!attribute [rw] name - # @return [::String] - # Required. The [relative resource - # name](https://cloud.google.com/apis/design/resource_names#relative_resource_name) - # of the finding. If no location is specified, finding is assumed to be in - # global. The following list shows some examples: - # - # + - # `organizations/{organization_id}/sources/{source_id}/findings/{finding_id}` - # + - # `organizations/{organization_id}/sources/{source_id}/locations/{location_id}/findings/{finding_id}` - # + `folders/{folder_id}/sources/{source_id}/findings/{finding_id}` - # + - # `folders/{folder_id}/sources/{source_id}/locations/{location_id}/findings/{finding_id}` - # + `projects/{project_id}/sources/{source_id}/findings/{finding_id}` - # + - # `projects/{project_id}/sources/{source_id}/locations/{location_id}/findings/{finding_id}` - # @!attribute [rw] mute - # @return [::Google::Cloud::SecurityCenter::V2::Finding::Mute] - # Required. The desired state of the Mute. - class SetMuteRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Request message for updating a BigQuery export. - # @!attribute [rw] big_query_export - # @return [::Google::Cloud::SecurityCenter::V2::BigQueryExport] - # Required. The BigQuery export being updated. - # @!attribute [rw] update_mask - # @return [::Google::Protobuf::FieldMask] - # The list of fields to be updated. - # If empty all mutable fields will be updated. - class UpdateBigQueryExportRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Request message for updating a ExternalSystem resource. - # @!attribute [rw] external_system - # @return [::Google::Cloud::SecurityCenter::V2::ExternalSystem] - # Required. The external system resource to update. - # @!attribute [rw] update_mask - # @return [::Google::Protobuf::FieldMask] - # The FieldMask to use when updating the external system resource. - # - # If empty all mutable fields will be updated. - class UpdateExternalSystemRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Request message for updating or creating a finding. - # @!attribute [rw] finding - # @return [::Google::Cloud::SecurityCenter::V2::Finding] - # Required. The finding resource to update or create if it does not already - # exist. parent, security_marks, and update_time will be ignored. - # - # In the case of creation, the finding id portion of the name must be - # alphanumeric and less than or equal to 32 characters and greater than 0 - # characters in length. - # @!attribute [rw] update_mask - # @return [::Google::Protobuf::FieldMask] - # The FieldMask to use when updating the finding resource. This field should - # not be specified when creating a finding. - # - # When updating a finding, an empty mask is treated as updating all mutable - # fields and replacing source_properties. Individual source_properties can - # be added/updated by using "source_properties." in the field - # mask. - class UpdateFindingRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Request message for updating a mute config. - # @!attribute [rw] mute_config - # @return [::Google::Cloud::SecurityCenter::V2::MuteConfig] - # Required. The mute config being updated. - # @!attribute [rw] update_mask - # @return [::Google::Protobuf::FieldMask] - # The list of fields to be updated. - # If empty all mutable fields will be updated. - class UpdateMuteConfigRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Request message for updating a notification config. - # @!attribute [rw] notification_config - # @return [::Google::Cloud::SecurityCenter::V2::NotificationConfig] - # Required. The notification config to update. - # @!attribute [rw] update_mask - # @return [::Google::Protobuf::FieldMask] - # The FieldMask to use when updating the notification config. - # - # If empty all mutable fields will be updated. - class UpdateNotificationConfigRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Request message to update resource value config - # @!attribute [rw] resource_value_config - # @return [::Google::Cloud::SecurityCenter::V2::ResourceValueConfig] - # Required. The resource value config being updated. - # @!attribute [rw] update_mask - # @return [::Google::Protobuf::FieldMask] - # The list of fields to be updated. - # If empty all mutable fields will be updated. - # - # To update nested fields, include the top level field in the mask - # For example, to update gcp_metadata.resource_type, include the - # "gcp_metadata" field mask - class UpdateResourceValueConfigRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Request message for updating a SecurityMarks resource. - # @!attribute [rw] security_marks - # @return [::Google::Cloud::SecurityCenter::V2::SecurityMarks] - # Required. The security marks resource to update. - # @!attribute [rw] update_mask - # @return [::Google::Protobuf::FieldMask] - # The FieldMask to use when updating the security marks resource. - # - # The field mask must not contain duplicate fields. - # If empty or set to "marks", all marks will be replaced. Individual - # marks can be updated using "marks.". - class UpdateSecurityMarksRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Request message for updating a source. - # @!attribute [rw] source - # @return [::Google::Cloud::SecurityCenter::V2::Source] - # Required. The source resource to update. - # @!attribute [rw] update_mask - # @return [::Google::Protobuf::FieldMask] - # The FieldMask to use when updating the source resource. - # - # If empty all mutable fields will be updated. - class UpdateSourceRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - end - end - end -end diff --git a/owl-bot-staging/google-cloud-security_center-v2/proto_docs/google/cloud/securitycenter/v2/simulation.rb b/owl-bot-staging/google-cloud-security_center-v2/proto_docs/google/cloud/securitycenter/v2/simulation.rb deleted file mode 100644 index 05bb5af8f001..000000000000 --- a/owl-bot-staging/google-cloud-security_center-v2/proto_docs/google/cloud/securitycenter/v2/simulation.rb +++ /dev/null @@ -1,46 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - - -module Google - module Cloud - module SecurityCenter - module V2 - # Attack path simulation - # @!attribute [rw] name - # @return [::String] - # Full resource name of the Simulation: - # `organizations/123/simulations/456` - # @!attribute [r] create_time - # @return [::Google::Protobuf::Timestamp] - # Output only. Time simulation was created - # @!attribute [rw] resource_value_configs_metadata - # @return [::Array<::Google::Cloud::SecurityCenter::V2::ResourceValueConfigMetadata>] - # Resource value configurations' metadata used in this simulation. Maximum of - # 100. - # @!attribute [rw] cloud_provider - # @return [::Google::Cloud::SecurityCenter::V2::CloudProvider] - # Indicates which cloud provider was used in this simulation. - class Simulation - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - end - end - end -end diff --git a/owl-bot-staging/google-cloud-security_center-v2/proto_docs/google/cloud/securitycenter/v2/source.rb b/owl-bot-staging/google-cloud-security_center-v2/proto_docs/google/cloud/securitycenter/v2/source.rb deleted file mode 100644 index 27dd5626b0cf..000000000000 --- a/owl-bot-staging/google-cloud-security_center-v2/proto_docs/google/cloud/securitycenter/v2/source.rb +++ /dev/null @@ -1,65 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - - -module Google - module Cloud - module SecurityCenter - module V2 - # Security Command Center finding source. A finding source - # is an entity or a mechanism that can produce a finding. A source is like a - # container of findings that come from the same scanner, logger, monitor, and - # other tools. - # @!attribute [rw] name - # @return [::String] - # The relative resource name of this source. See: - # https://cloud.google.com/apis/design/resource_names#relative_resource_name - # Example: - # "organizations/\\{organization_id}/sources/\\{source_id}" - # @!attribute [rw] display_name - # @return [::String] - # The source's display name. - # A source's display name must be unique amongst its siblings, for example, - # two sources with the same parent can't share the same display name. - # The display name must have a length between 1 and 64 characters - # (inclusive). - # @!attribute [rw] description - # @return [::String] - # The description of the source (max of 1024 characters). - # Example: - # "Web Security Scanner is a web security scanner for common - # vulnerabilities in App Engine applications. It can automatically - # scan and detect four common vulnerabilities, including cross-site-scripting - # (XSS), Flash injection, mixed content (HTTP in HTTPS), and - # outdated or insecure libraries." - # @!attribute [rw] canonical_name - # @return [::String] - # The canonical name of the finding source. It's either - # "organizations/\\{organization_id}/sources/\\{source_id}", - # "folders/\\{folder_id}/sources/\\{source_id}", or - # "projects/\\{project_number}/sources/\\{source_id}", - # depending on the closest CRM ancestor of the resource associated with the - # finding. - class Source - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - end - end - end -end diff --git a/owl-bot-staging/google-cloud-security_center-v2/proto_docs/google/cloud/securitycenter/v2/toxic_combination.rb b/owl-bot-staging/google-cloud-security_center-v2/proto_docs/google/cloud/securitycenter/v2/toxic_combination.rb deleted file mode 100644 index dff76d98c704..000000000000 --- a/owl-bot-staging/google-cloud-security_center-v2/proto_docs/google/cloud/securitycenter/v2/toxic_combination.rb +++ /dev/null @@ -1,46 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - - -module Google - module Cloud - module SecurityCenter - module V2 - # Contains details about a group of security issues that, when the issues - # occur together, represent a greater risk than when the issues occur - # independently. A group of such issues is referred to as a toxic - # combination. - # @!attribute [rw] attack_exposure_score - # @return [::Float] - # The - # [Attack exposure - # score](https://cloud.google.com/security-command-center/docs/attack-exposure-learn#attack_exposure_scores) - # of this toxic combination. The score is a measure of how much this toxic - # combination exposes one or more high-value resources to potential attack. - # @!attribute [rw] related_findings - # @return [::Array<::String>] - # List of resource names of findings associated with this toxic combination. - # For example, `organizations/123/sources/456/findings/789`. - class ToxicCombination - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - end - end - end -end diff --git a/owl-bot-staging/google-cloud-security_center-v2/proto_docs/google/cloud/securitycenter/v2/valued_resource.rb b/owl-bot-staging/google-cloud-security_center-v2/proto_docs/google/cloud/securitycenter/v2/valued_resource.rb deleted file mode 100644 index e97a21960308..000000000000 --- a/owl-bot-staging/google-cloud-security_center-v2/proto_docs/google/cloud/securitycenter/v2/valued_resource.rb +++ /dev/null @@ -1,86 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - - -module Google - module Cloud - module SecurityCenter - module V2 - # A resource that is determined to have value to a user's system - # @!attribute [rw] name - # @return [::String] - # Valued resource name, for example, - # e.g.: - # `organizations/123/simulations/456/valuedResources/789` - # @!attribute [rw] resource - # @return [::String] - # The - # [full resource - # name](https://cloud.google.com/apis/design/resource_names#full_resource_name) - # of the valued resource. - # @!attribute [rw] resource_type - # @return [::String] - # The [resource - # type](https://cloud.google.com/asset-inventory/docs/supported-asset-types) - # of the valued resource. - # @!attribute [rw] display_name - # @return [::String] - # Human-readable name of the valued resource. - # @!attribute [rw] resource_value - # @return [::Google::Cloud::SecurityCenter::V2::ValuedResource::ResourceValue] - # How valuable this resource is. - # @!attribute [rw] exposed_score - # @return [::Float] - # Exposed score for this valued resource. A value of 0 means no exposure was - # detected exposure. - # @!attribute [rw] resource_value_configs_used - # @return [::Array<::Google::Cloud::SecurityCenter::V2::ResourceValueConfigMetadata>] - # List of resource value configurations' metadata used to determine the value - # of this resource. Maximum of 100. - class ValuedResource - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - - # How valuable the resource is. - module ResourceValue - # The resource value isn't specified. - RESOURCE_VALUE_UNSPECIFIED = 0 - - # This is a low-value resource. - RESOURCE_VALUE_LOW = 1 - - # This is a medium-value resource. - RESOURCE_VALUE_MEDIUM = 2 - - # This is a high-value resource. - RESOURCE_VALUE_HIGH = 3 - end - end - - # Metadata about a ResourceValueConfig. For example, id and name. - # @!attribute [rw] name - # @return [::String] - # Resource value config name - class ResourceValueConfigMetadata - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - end - end - end -end diff --git a/owl-bot-staging/google-cloud-security_center-v2/proto_docs/google/cloud/securitycenter/v2/vertex_ai.rb b/owl-bot-staging/google-cloud-security_center-v2/proto_docs/google/cloud/securitycenter/v2/vertex_ai.rb deleted file mode 100644 index f11b0348de0a..000000000000 --- a/owl-bot-staging/google-cloud-security_center-v2/proto_docs/google/cloud/securitycenter/v2/vertex_ai.rb +++ /dev/null @@ -1,68 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - - -module Google - module Cloud - module SecurityCenter - module V2 - # Vertex AI-related information associated with the finding. - # @!attribute [rw] datasets - # @return [::Array<::Google::Cloud::SecurityCenter::V2::VertexAi::Dataset>] - # Datasets associated with the finding. - # @!attribute [rw] pipelines - # @return [::Array<::Google::Cloud::SecurityCenter::V2::VertexAi::Pipeline>] - # Pipelines associated with the finding. - class VertexAi - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - - # Vertex AI dataset associated with the finding. - # @!attribute [rw] name - # @return [::String] - # Resource name of the dataset, e.g. - # projects/\\{project}/locations/\\{location}/datasets/2094040236064505856 - # @!attribute [rw] display_name - # @return [::String] - # The user defined display name of dataset, e.g. plants-dataset - # @!attribute [rw] source - # @return [::String] - # Data source, such as a BigQuery source URI, e.g. - # bq://scc-nexus-test.AIPPtest.gsod - class Dataset - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Vertex AI training pipeline associated with the finding. - # @!attribute [rw] name - # @return [::String] - # Resource name of the pipeline, e.g. - # projects/\\{project}/locations/\\{location}/trainingPipelines/5253428229225578496 - # @!attribute [rw] display_name - # @return [::String] - # The user-defined display name of pipeline, e.g. plants-classification - class Pipeline - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - end - end - end - end -end diff --git a/owl-bot-staging/google-cloud-security_center-v2/proto_docs/google/cloud/securitycenter/v2/vulnerability.rb b/owl-bot-staging/google-cloud-security_center-v2/proto_docs/google/cloud/securitycenter/v2/vulnerability.rb deleted file mode 100644 index 41c3a3589f1d..000000000000 --- a/owl-bot-staging/google-cloud-security_center-v2/proto_docs/google/cloud/securitycenter/v2/vulnerability.rb +++ /dev/null @@ -1,365 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - - -module Google - module Cloud - module SecurityCenter - module V2 - # Refers to common vulnerability fields e.g. cve, cvss, cwe etc. - # @!attribute [rw] cve - # @return [::Google::Cloud::SecurityCenter::V2::Cve] - # CVE stands for Common Vulnerabilities and Exposures - # (https://cve.mitre.org/about/) - # @!attribute [rw] offending_package - # @return [::Google::Cloud::SecurityCenter::V2::Package] - # The offending package is relevant to the finding. - # @!attribute [rw] fixed_package - # @return [::Google::Cloud::SecurityCenter::V2::Package] - # The fixed package is relevant to the finding. - # @!attribute [rw] security_bulletin - # @return [::Google::Cloud::SecurityCenter::V2::SecurityBulletin] - # The security bulletin is relevant to this finding. - # @!attribute [rw] provider_risk_score - # @return [::Integer] - # Provider provided risk_score based on multiple factors. The higher the risk - # score, the more risky the vulnerability is. - # @!attribute [rw] reachable - # @return [::Boolean] - # Represents whether the vulnerability is reachable (detected via static - # analysis) - # @!attribute [rw] cwes - # @return [::Array<::Google::Cloud::SecurityCenter::V2::Cwe>] - # Represents one or more Common Weakness Enumeration (CWE) information on - # this vulnerability. - class Vulnerability - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # CVE stands for Common Vulnerabilities and Exposures. - # Information from the [CVE - # record](https://www.cve.org/ResourcesSupport/Glossary) that describes this - # vulnerability. - # @!attribute [rw] id - # @return [::String] - # The unique identifier for the vulnerability. e.g. CVE-2021-34527 - # @!attribute [rw] references - # @return [::Array<::Google::Cloud::SecurityCenter::V2::Reference>] - # Additional information about the CVE. - # e.g. https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2021-34527 - # @!attribute [rw] cvssv3 - # @return [::Google::Cloud::SecurityCenter::V2::Cvssv3] - # Describe Common Vulnerability Scoring System specified at - # https://www.first.org/cvss/v3.1/specification-document - # @!attribute [rw] upstream_fix_available - # @return [::Boolean] - # Whether upstream fix is available for the CVE. - # @!attribute [rw] impact - # @return [::Google::Cloud::SecurityCenter::V2::Cve::RiskRating] - # The potential impact of the vulnerability if it was to be exploited. - # @!attribute [rw] exploitation_activity - # @return [::Google::Cloud::SecurityCenter::V2::Cve::ExploitationActivity] - # The exploitation activity of the vulnerability in the wild. - # @!attribute [rw] observed_in_the_wild - # @return [::Boolean] - # Whether or not the vulnerability has been observed in the wild. - # @!attribute [rw] zero_day - # @return [::Boolean] - # Whether or not the vulnerability was zero day when the finding was - # published. - # @!attribute [rw] exploit_release_date - # @return [::Google::Protobuf::Timestamp] - # Date the first publicly available exploit or PoC was released. - # @!attribute [rw] first_exploitation_date - # @return [::Google::Protobuf::Timestamp] - # Date of the earliest known exploitation. - class Cve - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - - # The possible values of impact of the vulnerability if it was to be - # exploited. - module RiskRating - # Invalid or empty value. - RISK_RATING_UNSPECIFIED = 0 - - # Exploitation would have little to no security impact. - LOW = 1 - - # Exploitation would enable attackers to perform activities, or could allow - # attackers to have a direct impact, but would require additional steps. - MEDIUM = 2 - - # Exploitation would enable attackers to have a notable direct impact - # without needing to overcome any major mitigating factors. - HIGH = 3 - - # Exploitation would fundamentally undermine the security of affected - # systems, enable actors to perform significant attacks with minimal - # effort, with little to no mitigating factors to overcome. - CRITICAL = 4 - end - - # The possible values of exploitation activity of the vulnerability in the - # wild. - module ExploitationActivity - # Invalid or empty value. - EXPLOITATION_ACTIVITY_UNSPECIFIED = 0 - - # Exploitation has been reported or confirmed to widely occur. - WIDE = 1 - - # Limited reported or confirmed exploitation activities. - CONFIRMED = 2 - - # Exploit is publicly available. - AVAILABLE = 3 - - # No known exploitation activity, but has a high potential for - # exploitation. - ANTICIPATED = 4 - - # No known exploitation activity. - NO_KNOWN = 5 - end - end - - # Additional Links - # @!attribute [rw] source - # @return [::String] - # Source of the reference e.g. NVD - # @!attribute [rw] uri - # @return [::String] - # Uri for the mentioned source e.g. - # https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2021-34527. - class Reference - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Common Vulnerability Scoring System version 3. - # @!attribute [rw] base_score - # @return [::Float] - # The base score is a function of the base metric scores. - # @!attribute [rw] attack_vector - # @return [::Google::Cloud::SecurityCenter::V2::Cvssv3::AttackVector] - # Base Metrics - # Represents the intrinsic characteristics of a vulnerability that are - # constant over time and across user environments. - # This metric reflects the context by which vulnerability exploitation is - # possible. - # @!attribute [rw] attack_complexity - # @return [::Google::Cloud::SecurityCenter::V2::Cvssv3::AttackComplexity] - # This metric describes the conditions beyond the attacker's control that - # must exist in order to exploit the vulnerability. - # @!attribute [rw] privileges_required - # @return [::Google::Cloud::SecurityCenter::V2::Cvssv3::PrivilegesRequired] - # This metric describes the level of privileges an attacker must possess - # before successfully exploiting the vulnerability. - # @!attribute [rw] user_interaction - # @return [::Google::Cloud::SecurityCenter::V2::Cvssv3::UserInteraction] - # This metric captures the requirement for a human user, other than the - # attacker, to participate in the successful compromise of the vulnerable - # component. - # @!attribute [rw] scope - # @return [::Google::Cloud::SecurityCenter::V2::Cvssv3::Scope] - # The Scope metric captures whether a vulnerability in one vulnerable - # component impacts resources in components beyond its security scope. - # @!attribute [rw] confidentiality_impact - # @return [::Google::Cloud::SecurityCenter::V2::Cvssv3::Impact] - # This metric measures the impact to the confidentiality of the information - # resources managed by a software component due to a successfully exploited - # vulnerability. - # @!attribute [rw] integrity_impact - # @return [::Google::Cloud::SecurityCenter::V2::Cvssv3::Impact] - # This metric measures the impact to integrity of a successfully exploited - # vulnerability. - # @!attribute [rw] availability_impact - # @return [::Google::Cloud::SecurityCenter::V2::Cvssv3::Impact] - # This metric measures the impact to the availability of the impacted - # component resulting from a successfully exploited vulnerability. - class Cvssv3 - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - - # This metric reflects the context by which vulnerability exploitation is - # possible. - module AttackVector - # Invalid value. - ATTACK_VECTOR_UNSPECIFIED = 0 - - # The vulnerable component is bound to the network stack and the set of - # possible attackers extends beyond the other options listed below, up to - # and including the entire Internet. - ATTACK_VECTOR_NETWORK = 1 - - # The vulnerable component is bound to the network stack, but the attack is - # limited at the protocol level to a logically adjacent topology. - ATTACK_VECTOR_ADJACENT = 2 - - # The vulnerable component is not bound to the network stack and the - # attacker's path is via read/write/execute capabilities. - ATTACK_VECTOR_LOCAL = 3 - - # The attack requires the attacker to physically touch or manipulate the - # vulnerable component. - ATTACK_VECTOR_PHYSICAL = 4 - end - - # This metric describes the conditions beyond the attacker's control that - # must exist in order to exploit the vulnerability. - module AttackComplexity - # Invalid value. - ATTACK_COMPLEXITY_UNSPECIFIED = 0 - - # Specialized access conditions or extenuating circumstances do not exist. - # An attacker can expect repeatable success when attacking the vulnerable - # component. - ATTACK_COMPLEXITY_LOW = 1 - - # A successful attack depends on conditions beyond the attacker's control. - # That is, a successful attack cannot be accomplished at will, but requires - # the attacker to invest in some measurable amount of effort in preparation - # or execution against the vulnerable component before a successful attack - # can be expected. - ATTACK_COMPLEXITY_HIGH = 2 - end - - # This metric describes the level of privileges an attacker must possess - # before successfully exploiting the vulnerability. - module PrivilegesRequired - # Invalid value. - PRIVILEGES_REQUIRED_UNSPECIFIED = 0 - - # The attacker is unauthorized prior to attack, and therefore does not - # require any access to settings or files of the vulnerable system to - # carry out an attack. - PRIVILEGES_REQUIRED_NONE = 1 - - # The attacker requires privileges that provide basic user capabilities - # that could normally affect only settings and files owned by a user. - # Alternatively, an attacker with Low privileges has the ability to access - # only non-sensitive resources. - PRIVILEGES_REQUIRED_LOW = 2 - - # The attacker requires privileges that provide significant (e.g., - # administrative) control over the vulnerable component allowing access to - # component-wide settings and files. - PRIVILEGES_REQUIRED_HIGH = 3 - end - - # This metric captures the requirement for a human user, other than the - # attacker, to participate in the successful compromise of the vulnerable - # component. - module UserInteraction - # Invalid value. - USER_INTERACTION_UNSPECIFIED = 0 - - # The vulnerable system can be exploited without interaction from any user. - USER_INTERACTION_NONE = 1 - - # Successful exploitation of this vulnerability requires a user to take - # some action before the vulnerability can be exploited. - USER_INTERACTION_REQUIRED = 2 - end - - # The Scope metric captures whether a vulnerability in one vulnerable - # component impacts resources in components beyond its security scope. - module Scope - # Invalid value. - SCOPE_UNSPECIFIED = 0 - - # An exploited vulnerability can only affect resources managed by the same - # security authority. - SCOPE_UNCHANGED = 1 - - # An exploited vulnerability can affect resources beyond the security scope - # managed by the security authority of the vulnerable component. - SCOPE_CHANGED = 2 - end - - # The Impact metrics capture the effects of a successfully exploited - # vulnerability on the component that suffers the worst outcome that is most - # directly and predictably associated with the attack. - module Impact - # Invalid value. - IMPACT_UNSPECIFIED = 0 - - # High impact. - IMPACT_HIGH = 1 - - # Low impact. - IMPACT_LOW = 2 - - # No impact. - IMPACT_NONE = 3 - end - end - - # Package is a generic definition of a package. - # @!attribute [rw] package_name - # @return [::String] - # The name of the package where the vulnerability was detected. - # @!attribute [rw] cpe_uri - # @return [::String] - # The CPE URI where the vulnerability was detected. - # @!attribute [rw] package_type - # @return [::String] - # Type of package, for example, os, maven, or go. - # @!attribute [rw] package_version - # @return [::String] - # The version of the package. - class Package - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # SecurityBulletin are notifications of vulnerabilities of Google products. - # @!attribute [rw] bulletin_id - # @return [::String] - # ID of the bulletin corresponding to the vulnerability. - # @!attribute [rw] submission_time - # @return [::Google::Protobuf::Timestamp] - # Submission time of this Security Bulletin. - # @!attribute [rw] suggested_upgrade_version - # @return [::String] - # This represents a version that the cluster receiving this notification - # should be upgraded to, based on its current version. For example, 1.15.0 - class SecurityBulletin - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # CWE stands for Common Weakness Enumeration. Information about this weakness, - # as described by [CWE](https://cwe.mitre.org/). - # @!attribute [rw] id - # @return [::String] - # The CWE identifier, e.g. CWE-94 - # @!attribute [rw] references - # @return [::Array<::Google::Cloud::SecurityCenter::V2::Reference>] - # Any reference to the details on the CWE, for example, - # https://cwe.mitre.org/data/definitions/94.html - class Cwe - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - end - end - end -end diff --git a/owl-bot-staging/google-cloud-security_center-v2/proto_docs/google/iam/v1/iam_policy.rb b/owl-bot-staging/google-cloud-security_center-v2/proto_docs/google/iam/v1/iam_policy.rb deleted file mode 100644 index 5445c77f8258..000000000000 --- a/owl-bot-staging/google-cloud-security_center-v2/proto_docs/google/iam/v1/iam_policy.rb +++ /dev/null @@ -1,87 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - - -module Google - module Iam - module V1 - # Request message for `SetIamPolicy` method. - # @!attribute [rw] resource - # @return [::String] - # REQUIRED: The resource for which the policy is being specified. - # See the operation documentation for the appropriate value for this field. - # @!attribute [rw] policy - # @return [::Google::Iam::V1::Policy] - # REQUIRED: The complete policy to be applied to the `resource`. The size of - # the policy is limited to a few 10s of KB. An empty policy is a - # valid policy but certain Cloud Platform services (such as Projects) - # might reject them. - # @!attribute [rw] update_mask - # @return [::Google::Protobuf::FieldMask] - # OPTIONAL: A FieldMask specifying which fields of the policy to modify. Only - # the fields in the mask will be modified. If no mask is provided, the - # following default mask is used: - # - # `paths: "bindings, etag"` - class SetIamPolicyRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Request message for `GetIamPolicy` method. - # @!attribute [rw] resource - # @return [::String] - # REQUIRED: The resource for which the policy is being requested. - # See the operation documentation for the appropriate value for this field. - # @!attribute [rw] options - # @return [::Google::Iam::V1::GetPolicyOptions] - # OPTIONAL: A `GetPolicyOptions` object for specifying options to - # `GetIamPolicy`. - class GetIamPolicyRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Request message for `TestIamPermissions` method. - # @!attribute [rw] resource - # @return [::String] - # REQUIRED: The resource for which the policy detail is being requested. - # See the operation documentation for the appropriate value for this field. - # @!attribute [rw] permissions - # @return [::Array<::String>] - # The set of permissions to check for the `resource`. Permissions with - # wildcards (such as '*' or 'storage.*') are not allowed. For more - # information see - # [IAM Overview](https://cloud.google.com/iam/docs/overview#permissions). - class TestIamPermissionsRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Response message for `TestIamPermissions` method. - # @!attribute [rw] permissions - # @return [::Array<::String>] - # A subset of `TestPermissionsRequest.permissions` that the caller is - # allowed. - class TestIamPermissionsResponse - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - end - end -end diff --git a/owl-bot-staging/google-cloud-security_center-v2/proto_docs/google/iam/v1/options.rb b/owl-bot-staging/google-cloud-security_center-v2/proto_docs/google/iam/v1/options.rb deleted file mode 100644 index 60713d995b86..000000000000 --- a/owl-bot-staging/google-cloud-security_center-v2/proto_docs/google/iam/v1/options.rb +++ /dev/null @@ -1,50 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - - -module Google - module Iam - module V1 - # Encapsulates settings provided to GetIamPolicy. - # @!attribute [rw] requested_policy_version - # @return [::Integer] - # Optional. The maximum policy version that will be used to format the - # policy. - # - # Valid values are 0, 1, and 3. Requests specifying an invalid value will be - # rejected. - # - # Requests for policies with any conditional role bindings must specify - # version 3. Policies with no conditional role bindings may specify any valid - # value or leave the field unset. - # - # The policy in the response might use the policy version that you specified, - # or it might use a lower policy version. For example, if you specify version - # 3, but the policy has no conditional role bindings, the response uses - # version 1. - # - # To learn which resources support conditions in their IAM policies, see the - # [IAM - # documentation](https://cloud.google.com/iam/help/conditions/resource-policies). - class GetPolicyOptions - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - end - end -end diff --git a/owl-bot-staging/google-cloud-security_center-v2/proto_docs/google/iam/v1/policy.rb b/owl-bot-staging/google-cloud-security_center-v2/proto_docs/google/iam/v1/policy.rb deleted file mode 100644 index 999575b797df..000000000000 --- a/owl-bot-staging/google-cloud-security_center-v2/proto_docs/google/iam/v1/policy.rb +++ /dev/null @@ -1,426 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - - -module Google - module Iam - module V1 - # An Identity and Access Management (IAM) policy, which specifies access - # controls for Google Cloud resources. - # - # - # A `Policy` is a collection of `bindings`. A `binding` binds one or more - # `members`, or principals, to a single `role`. Principals can be user - # accounts, service accounts, Google groups, and domains (such as G Suite). A - # `role` is a named list of permissions; each `role` can be an IAM predefined - # role or a user-created custom role. - # - # For some types of Google Cloud resources, a `binding` can also specify a - # `condition`, which is a logical expression that allows access to a resource - # only if the expression evaluates to `true`. A condition can add constraints - # based on attributes of the request, the resource, or both. To learn which - # resources support conditions in their IAM policies, see the - # [IAM - # documentation](https://cloud.google.com/iam/help/conditions/resource-policies). - # - # **JSON example:** - # - # ``` - # { - # "bindings": [ - # { - # "role": "roles/resourcemanager.organizationAdmin", - # "members": [ - # "user:mike@example.com", - # "group:admins@example.com", - # "domain:google.com", - # "serviceAccount:my-project-id@appspot.gserviceaccount.com" - # ] - # }, - # { - # "role": "roles/resourcemanager.organizationViewer", - # "members": [ - # "user:eve@example.com" - # ], - # "condition": { - # "title": "expirable access", - # "description": "Does not grant access after Sep 2020", - # "expression": "request.time < - # timestamp('2020-10-01T00:00:00.000Z')", - # } - # } - # ], - # "etag": "BwWWja0YfJA=", - # "version": 3 - # } - # ``` - # - # **YAML example:** - # - # ``` - # bindings: - # - members: - # - user:mike@example.com - # - group:admins@example.com - # - domain:google.com - # - serviceAccount:my-project-id@appspot.gserviceaccount.com - # role: roles/resourcemanager.organizationAdmin - # - members: - # - user:eve@example.com - # role: roles/resourcemanager.organizationViewer - # condition: - # title: expirable access - # description: Does not grant access after Sep 2020 - # expression: request.time < timestamp('2020-10-01T00:00:00.000Z') - # etag: BwWWja0YfJA= - # version: 3 - # ``` - # - # For a description of IAM and its features, see the - # [IAM documentation](https://cloud.google.com/iam/docs/). - # @!attribute [rw] version - # @return [::Integer] - # Specifies the format of the policy. - # - # Valid values are `0`, `1`, and `3`. Requests that specify an invalid value - # are rejected. - # - # Any operation that affects conditional role bindings must specify version - # `3`. This requirement applies to the following operations: - # - # * Getting a policy that includes a conditional role binding - # * Adding a conditional role binding to a policy - # * Changing a conditional role binding in a policy - # * Removing any role binding, with or without a condition, from a policy - # that includes conditions - # - # **Important:** If you use IAM Conditions, you must include the `etag` field - # whenever you call `setIamPolicy`. If you omit this field, then IAM allows - # you to overwrite a version `3` policy with a version `1` policy, and all of - # the conditions in the version `3` policy are lost. - # - # If a policy does not include any conditions, operations on that policy may - # specify any valid version or leave the field unset. - # - # To learn which resources support conditions in their IAM policies, see the - # [IAM - # documentation](https://cloud.google.com/iam/help/conditions/resource-policies). - # @!attribute [rw] bindings - # @return [::Array<::Google::Iam::V1::Binding>] - # Associates a list of `members`, or principals, with a `role`. Optionally, - # may specify a `condition` that determines how and when the `bindings` are - # applied. Each of the `bindings` must contain at least one principal. - # - # The `bindings` in a `Policy` can refer to up to 1,500 principals; up to 250 - # of these principals can be Google groups. Each occurrence of a principal - # counts towards these limits. For example, if the `bindings` grant 50 - # different roles to `user:alice@example.com`, and not to any other - # principal, then you can add another 1,450 principals to the `bindings` in - # the `Policy`. - # @!attribute [rw] audit_configs - # @return [::Array<::Google::Iam::V1::AuditConfig>] - # Specifies cloud audit logging configuration for this policy. - # @!attribute [rw] etag - # @return [::String] - # `etag` is used for optimistic concurrency control as a way to help - # prevent simultaneous updates of a policy from overwriting each other. - # It is strongly suggested that systems make use of the `etag` in the - # read-modify-write cycle to perform policy updates in order to avoid race - # conditions: An `etag` is returned in the response to `getIamPolicy`, and - # systems are expected to put that etag in the request to `setIamPolicy` to - # ensure that their change will be applied to the same version of the policy. - # - # **Important:** If you use IAM Conditions, you must include the `etag` field - # whenever you call `setIamPolicy`. If you omit this field, then IAM allows - # you to overwrite a version `3` policy with a version `1` policy, and all of - # the conditions in the version `3` policy are lost. - class Policy - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Associates `members`, or principals, with a `role`. - # @!attribute [rw] role - # @return [::String] - # Role that is assigned to the list of `members`, or principals. - # For example, `roles/viewer`, `roles/editor`, or `roles/owner`. - # @!attribute [rw] members - # @return [::Array<::String>] - # Specifies the principals requesting access for a Google Cloud resource. - # `members` can have the following values: - # - # * `allUsers`: A special identifier that represents anyone who is - # on the internet; with or without a Google account. - # - # * `allAuthenticatedUsers`: A special identifier that represents anyone - # who is authenticated with a Google account or a service account. - # - # * `user:{emailid}`: An email address that represents a specific Google - # account. For example, `alice@example.com` . - # - # - # * `serviceAccount:{emailid}`: An email address that represents a service - # account. For example, `my-other-app@appspot.gserviceaccount.com`. - # - # * `group:{emailid}`: An email address that represents a Google group. - # For example, `admins@example.com`. - # - # * `deleted:user:{emailid}?uid={uniqueid}`: An email address (plus unique - # identifier) representing a user that has been recently deleted. For - # example, `alice@example.com?uid=123456789012345678901`. If the user is - # recovered, this value reverts to `user:{emailid}` and the recovered user - # retains the role in the binding. - # - # * `deleted:serviceAccount:{emailid}?uid={uniqueid}`: An email address (plus - # unique identifier) representing a service account that has been recently - # deleted. For example, - # `my-other-app@appspot.gserviceaccount.com?uid=123456789012345678901`. - # If the service account is undeleted, this value reverts to - # `serviceAccount:{emailid}` and the undeleted service account retains the - # role in the binding. - # - # * `deleted:group:{emailid}?uid={uniqueid}`: An email address (plus unique - # identifier) representing a Google group that has been recently - # deleted. For example, `admins@example.com?uid=123456789012345678901`. If - # the group is recovered, this value reverts to `group:{emailid}` and the - # recovered group retains the role in the binding. - # - # - # * `domain:{domain}`: The G Suite domain (primary) that represents all the - # users of that domain. For example, `google.com` or `example.com`. - # @!attribute [rw] condition - # @return [::Google::Type::Expr] - # The condition that is associated with this binding. - # - # If the condition evaluates to `true`, then this binding applies to the - # current request. - # - # If the condition evaluates to `false`, then this binding does not apply to - # the current request. However, a different role binding might grant the same - # role to one or more of the principals in this binding. - # - # To learn which resources support conditions in their IAM policies, see the - # [IAM - # documentation](https://cloud.google.com/iam/help/conditions/resource-policies). - class Binding - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Specifies the audit configuration for a service. - # The configuration determines which permission types are logged, and what - # identities, if any, are exempted from logging. - # An AuditConfig must have one or more AuditLogConfigs. - # - # If there are AuditConfigs for both `allServices` and a specific service, - # the union of the two AuditConfigs is used for that service: the log_types - # specified in each AuditConfig are enabled, and the exempted_members in each - # AuditLogConfig are exempted. - # - # Example Policy with multiple AuditConfigs: - # - # { - # "audit_configs": [ - # { - # "service": "allServices", - # "audit_log_configs": [ - # { - # "log_type": "DATA_READ", - # "exempted_members": [ - # "user:jose@example.com" - # ] - # }, - # { - # "log_type": "DATA_WRITE" - # }, - # { - # "log_type": "ADMIN_READ" - # } - # ] - # }, - # { - # "service": "sampleservice.googleapis.com", - # "audit_log_configs": [ - # { - # "log_type": "DATA_READ" - # }, - # { - # "log_type": "DATA_WRITE", - # "exempted_members": [ - # "user:aliya@example.com" - # ] - # } - # ] - # } - # ] - # } - # - # For sampleservice, this policy enables DATA_READ, DATA_WRITE and ADMIN_READ - # logging. It also exempts `jose@example.com` from DATA_READ logging, and - # `aliya@example.com` from DATA_WRITE logging. - # @!attribute [rw] service - # @return [::String] - # Specifies a service that will be enabled for audit logging. - # For example, `storage.googleapis.com`, `cloudsql.googleapis.com`. - # `allServices` is a special value that covers all services. - # @!attribute [rw] audit_log_configs - # @return [::Array<::Google::Iam::V1::AuditLogConfig>] - # The configuration for logging of each type of permission. - class AuditConfig - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Provides the configuration for logging a type of permissions. - # Example: - # - # { - # "audit_log_configs": [ - # { - # "log_type": "DATA_READ", - # "exempted_members": [ - # "user:jose@example.com" - # ] - # }, - # { - # "log_type": "DATA_WRITE" - # } - # ] - # } - # - # This enables 'DATA_READ' and 'DATA_WRITE' logging, while exempting - # jose@example.com from DATA_READ logging. - # @!attribute [rw] log_type - # @return [::Google::Iam::V1::AuditLogConfig::LogType] - # The log type that this config enables. - # @!attribute [rw] exempted_members - # @return [::Array<::String>] - # Specifies the identities that do not cause logging for this type of - # permission. - # Follows the same format of - # [Binding.members][google.iam.v1.Binding.members]. - class AuditLogConfig - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - - # The list of valid permission types for which logging can be configured. - # Admin writes are always logged, and are not configurable. - module LogType - # Default case. Should never be this. - LOG_TYPE_UNSPECIFIED = 0 - - # Admin reads. Example: CloudIAM getIamPolicy - ADMIN_READ = 1 - - # Data writes. Example: CloudSQL Users create - DATA_WRITE = 2 - - # Data reads. Example: CloudSQL Users list - DATA_READ = 3 - end - end - - # The difference delta between two policies. - # @!attribute [rw] binding_deltas - # @return [::Array<::Google::Iam::V1::BindingDelta>] - # The delta for Bindings between two policies. - # @!attribute [rw] audit_config_deltas - # @return [::Array<::Google::Iam::V1::AuditConfigDelta>] - # The delta for AuditConfigs between two policies. - class PolicyDelta - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # One delta entry for Binding. Each individual change (only one member in each - # entry) to a binding will be a separate entry. - # @!attribute [rw] action - # @return [::Google::Iam::V1::BindingDelta::Action] - # The action that was performed on a Binding. - # Required - # @!attribute [rw] role - # @return [::String] - # Role that is assigned to `members`. - # For example, `roles/viewer`, `roles/editor`, or `roles/owner`. - # Required - # @!attribute [rw] member - # @return [::String] - # A single identity requesting access for a Google Cloud resource. - # Follows the same format of Binding.members. - # Required - # @!attribute [rw] condition - # @return [::Google::Type::Expr] - # The condition that is associated with this binding. - class BindingDelta - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - - # The type of action performed on a Binding in a policy. - module Action - # Unspecified. - ACTION_UNSPECIFIED = 0 - - # Addition of a Binding. - ADD = 1 - - # Removal of a Binding. - REMOVE = 2 - end - end - - # One delta entry for AuditConfig. Each individual change (only one - # exempted_member in each entry) to a AuditConfig will be a separate entry. - # @!attribute [rw] action - # @return [::Google::Iam::V1::AuditConfigDelta::Action] - # The action that was performed on an audit configuration in a policy. - # Required - # @!attribute [rw] service - # @return [::String] - # Specifies a service that was configured for Cloud Audit Logging. - # For example, `storage.googleapis.com`, `cloudsql.googleapis.com`. - # `allServices` is a special value that covers all services. - # Required - # @!attribute [rw] exempted_member - # @return [::String] - # A single identity that is exempted from "data access" audit - # logging for the `service` specified above. - # Follows the same format of Binding.members. - # @!attribute [rw] log_type - # @return [::String] - # Specifies the log_type that was be enabled. ADMIN_ACTIVITY is always - # enabled, and cannot be configured. - # Required - class AuditConfigDelta - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - - # The type of action performed on an audit configuration in a policy. - module Action - # Unspecified. - ACTION_UNSPECIFIED = 0 - - # Addition of an audit configuration. - ADD = 1 - - # Removal of an audit configuration. - REMOVE = 2 - end - end - end - end -end diff --git a/owl-bot-staging/google-cloud-security_center-v2/proto_docs/google/longrunning/operations.rb b/owl-bot-staging/google-cloud-security_center-v2/proto_docs/google/longrunning/operations.rb deleted file mode 100644 index 7a757f512165..000000000000 --- a/owl-bot-staging/google-cloud-security_center-v2/proto_docs/google/longrunning/operations.rb +++ /dev/null @@ -1,191 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - - -module Google - module Longrunning - # This resource represents a long-running operation that is the result of a - # network API call. - # @!attribute [rw] name - # @return [::String] - # The server-assigned name, which is only unique within the same service that - # originally returns it. If you use the default HTTP mapping, the - # `name` should be a resource name ending with `operations/{unique_id}`. - # @!attribute [rw] metadata - # @return [::Google::Protobuf::Any] - # Service-specific metadata associated with the operation. It typically - # contains progress information and common metadata such as create time. - # Some services might not provide such metadata. Any method that returns a - # long-running operation should document the metadata type, if any. - # @!attribute [rw] done - # @return [::Boolean] - # If the value is `false`, it means the operation is still in progress. - # If `true`, the operation is completed, and either `error` or `response` is - # available. - # @!attribute [rw] error - # @return [::Google::Rpc::Status] - # The error result of the operation in case of failure or cancellation. - # - # Note: The following fields are mutually exclusive: `error`, `response`. If a field in that set is populated, all other fields in the set will automatically be cleared. - # @!attribute [rw] response - # @return [::Google::Protobuf::Any] - # The normal, successful response of the operation. If the original - # method returns no data on success, such as `Delete`, the response is - # `google.protobuf.Empty`. If the original method is standard - # `Get`/`Create`/`Update`, the response should be the resource. For other - # methods, the response should have the type `XxxResponse`, where `Xxx` - # is the original method name. For example, if the original method name - # is `TakeSnapshot()`, the inferred response type is - # `TakeSnapshotResponse`. - # - # Note: The following fields are mutually exclusive: `response`, `error`. If a field in that set is populated, all other fields in the set will automatically be cleared. - class Operation - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # The request message for - # Operations.GetOperation. - # @!attribute [rw] name - # @return [::String] - # The name of the operation resource. - class GetOperationRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # The request message for - # Operations.ListOperations. - # @!attribute [rw] name - # @return [::String] - # The name of the operation's parent resource. - # @!attribute [rw] filter - # @return [::String] - # The standard list filter. - # @!attribute [rw] page_size - # @return [::Integer] - # The standard list page size. - # @!attribute [rw] page_token - # @return [::String] - # The standard list page token. - # @!attribute [rw] return_partial_success - # @return [::Boolean] - # When set to `true`, operations that are reachable are returned as normal, - # and those that are unreachable are returned in the - # [ListOperationsResponse.unreachable] field. - # - # This can only be `true` when reading across collections e.g. when `parent` - # is set to `"projects/example/locations/-"`. - # - # This field is not by default supported and will result in an - # `UNIMPLEMENTED` error if set unless explicitly documented otherwise in - # service or product specific documentation. - class ListOperationsRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # The response message for - # Operations.ListOperations. - # @!attribute [rw] operations - # @return [::Array<::Google::Longrunning::Operation>] - # A list of operations that matches the specified filter in the request. - # @!attribute [rw] next_page_token - # @return [::String] - # The standard List next-page token. - # @!attribute [rw] unreachable - # @return [::Array<::String>] - # Unordered list. Unreachable resources. Populated when the request sets - # `ListOperationsRequest.return_partial_success` and reads across - # collections e.g. when attempting to list all resources across all supported - # locations. - class ListOperationsResponse - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # The request message for - # Operations.CancelOperation. - # @!attribute [rw] name - # @return [::String] - # The name of the operation resource to be cancelled. - class CancelOperationRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # The request message for - # Operations.DeleteOperation. - # @!attribute [rw] name - # @return [::String] - # The name of the operation resource to be deleted. - class DeleteOperationRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # The request message for - # Operations.WaitOperation. - # @!attribute [rw] name - # @return [::String] - # The name of the operation resource to wait on. - # @!attribute [rw] timeout - # @return [::Google::Protobuf::Duration] - # The maximum duration to wait before timing out. If left blank, the wait - # will be at most the time permitted by the underlying HTTP/RPC protocol. - # If RPC context deadline is also specified, the shorter one will be used. - class WaitOperationRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # A message representing the message types used by a long-running operation. - # - # Example: - # - # rpc Export(ExportRequest) returns (google.longrunning.Operation) { - # option (google.longrunning.operation_info) = { - # response_type: "ExportResponse" - # metadata_type: "ExportMetadata" - # }; - # } - # @!attribute [rw] response_type - # @return [::String] - # Required. The message name of the primary return type for this - # long-running operation. - # This type will be used to deserialize the LRO's response. - # - # If the response is in a different package from the rpc, a fully-qualified - # message name must be used (e.g. `google.protobuf.Struct`). - # - # Note: Altering this value constitutes a breaking change. - # @!attribute [rw] metadata_type - # @return [::String] - # Required. The message name of the metadata type for this long-running - # operation. - # - # If the response is in a different package from the rpc, a fully-qualified - # message name must be used (e.g. `google.protobuf.Struct`). - # - # Note: Altering this value constitutes a breaking change. - class OperationInfo - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - end -end diff --git a/owl-bot-staging/google-cloud-security_center-v2/proto_docs/google/protobuf/any.rb b/owl-bot-staging/google-cloud-security_center-v2/proto_docs/google/protobuf/any.rb deleted file mode 100644 index 58691995f02e..000000000000 --- a/owl-bot-staging/google-cloud-security_center-v2/proto_docs/google/protobuf/any.rb +++ /dev/null @@ -1,145 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - - -module Google - module Protobuf - # `Any` contains an arbitrary serialized protocol buffer message along with a - # URL that describes the type of the serialized message. - # - # Protobuf library provides support to pack/unpack Any values in the form - # of utility functions or additional generated methods of the Any type. - # - # Example 1: Pack and unpack a message in C++. - # - # Foo foo = ...; - # Any any; - # any.PackFrom(foo); - # ... - # if (any.UnpackTo(&foo)) { - # ... - # } - # - # Example 2: Pack and unpack a message in Java. - # - # Foo foo = ...; - # Any any = Any.pack(foo); - # ... - # if (any.is(Foo.class)) { - # foo = any.unpack(Foo.class); - # } - # // or ... - # if (any.isSameTypeAs(Foo.getDefaultInstance())) { - # foo = any.unpack(Foo.getDefaultInstance()); - # } - # - # Example 3: Pack and unpack a message in Python. - # - # foo = Foo(...) - # any = Any() - # any.Pack(foo) - # ... - # if any.Is(Foo.DESCRIPTOR): - # any.Unpack(foo) - # ... - # - # Example 4: Pack and unpack a message in Go - # - # foo := &pb.Foo{...} - # any, err := anypb.New(foo) - # if err != nil { - # ... - # } - # ... - # foo := &pb.Foo{} - # if err := any.UnmarshalTo(foo); err != nil { - # ... - # } - # - # The pack methods provided by protobuf library will by default use - # 'type.googleapis.com/full.type.name' as the type URL and the unpack - # methods only use the fully qualified type name after the last '/' - # in the type URL, for example "foo.bar.com/x/y.z" will yield type - # name "y.z". - # - # JSON - # ==== - # The JSON representation of an `Any` value uses the regular - # representation of the deserialized, embedded message, with an - # additional field `@type` which contains the type URL. Example: - # - # package google.profile; - # message Person { - # string first_name = 1; - # string last_name = 2; - # } - # - # { - # "@type": "type.googleapis.com/google.profile.Person", - # "firstName": , - # "lastName": - # } - # - # If the embedded message type is well-known and has a custom JSON - # representation, that representation will be embedded adding a field - # `value` which holds the custom JSON in addition to the `@type` - # field. Example (for message [google.protobuf.Duration][]): - # - # { - # "@type": "type.googleapis.com/google.protobuf.Duration", - # "value": "1.212s" - # } - # @!attribute [rw] type_url - # @return [::String] - # A URL/resource name that uniquely identifies the type of the serialized - # protocol buffer message. This string must contain at least - # one "/" character. The last segment of the URL's path must represent - # the fully qualified name of the type (as in - # `path/google.protobuf.Duration`). The name should be in a canonical form - # (e.g., leading "." is not accepted). - # - # In practice, teams usually precompile into the binary all types that they - # expect it to use in the context of Any. However, for URLs which use the - # scheme `http`, `https`, or no scheme, one can optionally set up a type - # server that maps type URLs to message definitions as follows: - # - # * If no scheme is provided, `https` is assumed. - # * An HTTP GET on the URL must yield a [google.protobuf.Type][] - # value in binary format, or produce an error. - # * Applications are allowed to cache lookup results based on the - # URL, or have them precompiled into a binary to avoid any - # lookup. Therefore, binary compatibility needs to be preserved - # on changes to types. (Use versioned type names to manage - # breaking changes.) - # - # Note: this functionality is not currently available in the official - # protobuf release, and it is not used for type URLs beginning with - # type.googleapis.com. As of May 2023, there are no widely used type server - # implementations and no plans to implement one. - # - # Schemes other than `http`, `https` (or the empty scheme) might be - # used with implementation specific semantics. - # @!attribute [rw] value - # @return [::String] - # Must be a valid serialized protocol buffer of the above specified type. - class Any - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - end -end diff --git a/owl-bot-staging/google-cloud-security_center-v2/proto_docs/google/protobuf/duration.rb b/owl-bot-staging/google-cloud-security_center-v2/proto_docs/google/protobuf/duration.rb deleted file mode 100644 index ea59f1f91daf..000000000000 --- a/owl-bot-staging/google-cloud-security_center-v2/proto_docs/google/protobuf/duration.rb +++ /dev/null @@ -1,98 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - - -module Google - module Protobuf - # A Duration represents a signed, fixed-length span of time represented - # as a count of seconds and fractions of seconds at nanosecond - # resolution. It is independent of any calendar and concepts like "day" - # or "month". It is related to Timestamp in that the difference between - # two Timestamp values is a Duration and it can be added or subtracted - # from a Timestamp. Range is approximately +-10,000 years. - # - # # Examples - # - # Example 1: Compute Duration from two Timestamps in pseudo code. - # - # Timestamp start = ...; - # Timestamp end = ...; - # Duration duration = ...; - # - # duration.seconds = end.seconds - start.seconds; - # duration.nanos = end.nanos - start.nanos; - # - # if (duration.seconds < 0 && duration.nanos > 0) { - # duration.seconds += 1; - # duration.nanos -= 1000000000; - # } else if (duration.seconds > 0 && duration.nanos < 0) { - # duration.seconds -= 1; - # duration.nanos += 1000000000; - # } - # - # Example 2: Compute Timestamp from Timestamp + Duration in pseudo code. - # - # Timestamp start = ...; - # Duration duration = ...; - # Timestamp end = ...; - # - # end.seconds = start.seconds + duration.seconds; - # end.nanos = start.nanos + duration.nanos; - # - # if (end.nanos < 0) { - # end.seconds -= 1; - # end.nanos += 1000000000; - # } else if (end.nanos >= 1000000000) { - # end.seconds += 1; - # end.nanos -= 1000000000; - # } - # - # Example 3: Compute Duration from datetime.timedelta in Python. - # - # td = datetime.timedelta(days=3, minutes=10) - # duration = Duration() - # duration.FromTimedelta(td) - # - # # JSON Mapping - # - # In JSON format, the Duration type is encoded as a string rather than an - # object, where the string ends in the suffix "s" (indicating seconds) and - # is preceded by the number of seconds, with nanoseconds expressed as - # fractional seconds. For example, 3 seconds with 0 nanoseconds should be - # encoded in JSON format as "3s", while 3 seconds and 1 nanosecond should - # be expressed in JSON format as "3.000000001s", and 3 seconds and 1 - # microsecond should be expressed in JSON format as "3.000001s". - # @!attribute [rw] seconds - # @return [::Integer] - # Signed seconds of the span of time. Must be from -315,576,000,000 - # to +315,576,000,000 inclusive. Note: these bounds are computed from: - # 60 sec/min * 60 min/hr * 24 hr/day * 365.25 days/year * 10000 years - # @!attribute [rw] nanos - # @return [::Integer] - # Signed fractions of a second at nanosecond resolution of the span - # of time. Durations less than one second are represented with a 0 - # `seconds` field and a positive or negative `nanos` field. For durations - # of one second or more, a non-zero value for the `nanos` field must be - # of the same sign as the `seconds` field. Must be from -999,999,999 - # to +999,999,999 inclusive. - class Duration - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - end -end diff --git a/owl-bot-staging/google-cloud-security_center-v2/proto_docs/google/protobuf/empty.rb b/owl-bot-staging/google-cloud-security_center-v2/proto_docs/google/protobuf/empty.rb deleted file mode 100644 index 83e4481834a6..000000000000 --- a/owl-bot-staging/google-cloud-security_center-v2/proto_docs/google/protobuf/empty.rb +++ /dev/null @@ -1,34 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - - -module Google - module Protobuf - # A generic empty message that you can re-use to avoid defining duplicated - # empty messages in your APIs. A typical example is to use it as the request - # or the response type of an API method. For instance: - # - # service Foo { - # rpc Bar(google.protobuf.Empty) returns (google.protobuf.Empty); - # } - class Empty - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - end -end diff --git a/owl-bot-staging/google-cloud-security_center-v2/proto_docs/google/protobuf/field_mask.rb b/owl-bot-staging/google-cloud-security_center-v2/proto_docs/google/protobuf/field_mask.rb deleted file mode 100644 index 7f3ffc78601a..000000000000 --- a/owl-bot-staging/google-cloud-security_center-v2/proto_docs/google/protobuf/field_mask.rb +++ /dev/null @@ -1,229 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - - -module Google - module Protobuf - # `FieldMask` represents a set of symbolic field paths, for example: - # - # paths: "f.a" - # paths: "f.b.d" - # - # Here `f` represents a field in some root message, `a` and `b` - # fields in the message found in `f`, and `d` a field found in the - # message in `f.b`. - # - # Field masks are used to specify a subset of fields that should be - # returned by a get operation or modified by an update operation. - # Field masks also have a custom JSON encoding (see below). - # - # # Field Masks in Projections - # - # When used in the context of a projection, a response message or - # sub-message is filtered by the API to only contain those fields as - # specified in the mask. For example, if the mask in the previous - # example is applied to a response message as follows: - # - # f { - # a : 22 - # b { - # d : 1 - # x : 2 - # } - # y : 13 - # } - # z: 8 - # - # The result will not contain specific values for fields x,y and z - # (their value will be set to the default, and omitted in proto text - # output): - # - # - # f { - # a : 22 - # b { - # d : 1 - # } - # } - # - # A repeated field is not allowed except at the last position of a - # paths string. - # - # If a FieldMask object is not present in a get operation, the - # operation applies to all fields (as if a FieldMask of all fields - # had been specified). - # - # Note that a field mask does not necessarily apply to the - # top-level response message. In case of a REST get operation, the - # field mask applies directly to the response, but in case of a REST - # list operation, the mask instead applies to each individual message - # in the returned resource list. In case of a REST custom method, - # other definitions may be used. Where the mask applies will be - # clearly documented together with its declaration in the API. In - # any case, the effect on the returned resource/resources is required - # behavior for APIs. - # - # # Field Masks in Update Operations - # - # A field mask in update operations specifies which fields of the - # targeted resource are going to be updated. The API is required - # to only change the values of the fields as specified in the mask - # and leave the others untouched. If a resource is passed in to - # describe the updated values, the API ignores the values of all - # fields not covered by the mask. - # - # If a repeated field is specified for an update operation, new values will - # be appended to the existing repeated field in the target resource. Note that - # a repeated field is only allowed in the last position of a `paths` string. - # - # If a sub-message is specified in the last position of the field mask for an - # update operation, then new value will be merged into the existing sub-message - # in the target resource. - # - # For example, given the target message: - # - # f { - # b { - # d: 1 - # x: 2 - # } - # c: [1] - # } - # - # And an update message: - # - # f { - # b { - # d: 10 - # } - # c: [2] - # } - # - # then if the field mask is: - # - # paths: ["f.b", "f.c"] - # - # then the result will be: - # - # f { - # b { - # d: 10 - # x: 2 - # } - # c: [1, 2] - # } - # - # An implementation may provide options to override this default behavior for - # repeated and message fields. - # - # In order to reset a field's value to the default, the field must - # be in the mask and set to the default value in the provided resource. - # Hence, in order to reset all fields of a resource, provide a default - # instance of the resource and set all fields in the mask, or do - # not provide a mask as described below. - # - # If a field mask is not present on update, the operation applies to - # all fields (as if a field mask of all fields has been specified). - # Note that in the presence of schema evolution, this may mean that - # fields the client does not know and has therefore not filled into - # the request will be reset to their default. If this is unwanted - # behavior, a specific service may require a client to always specify - # a field mask, producing an error if not. - # - # As with get operations, the location of the resource which - # describes the updated values in the request message depends on the - # operation kind. In any case, the effect of the field mask is - # required to be honored by the API. - # - # ## Considerations for HTTP REST - # - # The HTTP kind of an update operation which uses a field mask must - # be set to PATCH instead of PUT in order to satisfy HTTP semantics - # (PUT must only be used for full updates). - # - # # JSON Encoding of Field Masks - # - # In JSON, a field mask is encoded as a single string where paths are - # separated by a comma. Fields name in each path are converted - # to/from lower-camel naming conventions. - # - # As an example, consider the following message declarations: - # - # message Profile { - # User user = 1; - # Photo photo = 2; - # } - # message User { - # string display_name = 1; - # string address = 2; - # } - # - # In proto a field mask for `Profile` may look as such: - # - # mask { - # paths: "user.display_name" - # paths: "photo" - # } - # - # In JSON, the same mask is represented as below: - # - # { - # mask: "user.displayName,photo" - # } - # - # # Field Masks and Oneof Fields - # - # Field masks treat fields in oneofs just as regular fields. Consider the - # following message: - # - # message SampleMessage { - # oneof test_oneof { - # string name = 4; - # SubMessage sub_message = 9; - # } - # } - # - # The field mask can be: - # - # mask { - # paths: "name" - # } - # - # Or: - # - # mask { - # paths: "sub_message" - # } - # - # Note that oneof type names ("test_oneof" in this case) cannot be used in - # paths. - # - # ## Field Mask Verification - # - # The implementation of any API method which has a FieldMask type field in the - # request should verify the included field paths, and return an - # `INVALID_ARGUMENT` error if any path is unmappable. - # @!attribute [rw] paths - # @return [::Array<::String>] - # The set of field mask paths. - class FieldMask - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - end -end diff --git a/owl-bot-staging/google-cloud-security_center-v2/proto_docs/google/protobuf/struct.rb b/owl-bot-staging/google-cloud-security_center-v2/proto_docs/google/protobuf/struct.rb deleted file mode 100644 index 39e1aca868d2..000000000000 --- a/owl-bot-staging/google-cloud-security_center-v2/proto_docs/google/protobuf/struct.rb +++ /dev/null @@ -1,108 +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 - # `Struct` represents a structured data value, consisting of fields - # which map to dynamically typed values. In some languages, `Struct` - # might be supported by a native representation. For example, in - # scripting languages like JS a struct is represented as an - # object. The details of that representation are described together - # with the proto support for the language. - # - # The JSON representation for `Struct` is JSON object. - # @!attribute [rw] fields - # @return [::Google::Protobuf::Map{::String => ::Google::Protobuf::Value}] - # Unordered map of dynamically typed values. - class Struct - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - - # @!attribute [rw] key - # @return [::String] - # @!attribute [rw] value - # @return [::Google::Protobuf::Value] - class FieldsEntry - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - end - - # `Value` represents a dynamically typed value which can be either - # null, a number, a string, a boolean, a recursive struct value, or a - # list of values. A producer of value is expected to set one of these - # variants. Absence of any variant indicates an error. - # - # The JSON representation for `Value` is JSON value. - # @!attribute [rw] null_value - # @return [::Google::Protobuf::NullValue] - # Represents a null value. - # - # Note: The following fields are mutually exclusive: `null_value`, `number_value`, `string_value`, `bool_value`, `struct_value`, `list_value`. If a field in that set is populated, all other fields in the set will automatically be cleared. - # @!attribute [rw] number_value - # @return [::Float] - # Represents a double value. - # - # Note: The following fields are mutually exclusive: `number_value`, `null_value`, `string_value`, `bool_value`, `struct_value`, `list_value`. If a field in that set is populated, all other fields in the set will automatically be cleared. - # @!attribute [rw] string_value - # @return [::String] - # Represents a string value. - # - # Note: The following fields are mutually exclusive: `string_value`, `null_value`, `number_value`, `bool_value`, `struct_value`, `list_value`. If a field in that set is populated, all other fields in the set will automatically be cleared. - # @!attribute [rw] bool_value - # @return [::Boolean] - # Represents a boolean value. - # - # Note: The following fields are mutually exclusive: `bool_value`, `null_value`, `number_value`, `string_value`, `struct_value`, `list_value`. If a field in that set is populated, all other fields in the set will automatically be cleared. - # @!attribute [rw] struct_value - # @return [::Google::Protobuf::Struct] - # Represents a structured value. - # - # Note: The following fields are mutually exclusive: `struct_value`, `null_value`, `number_value`, `string_value`, `bool_value`, `list_value`. If a field in that set is populated, all other fields in the set will automatically be cleared. - # @!attribute [rw] list_value - # @return [::Google::Protobuf::ListValue] - # Represents a repeated `Value`. - # - # Note: The following fields are mutually exclusive: `list_value`, `null_value`, `number_value`, `string_value`, `bool_value`, `struct_value`. If a field in that set is populated, all other fields in the set will automatically be cleared. - class Value - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # `ListValue` is a wrapper around a repeated field of values. - # - # The JSON representation for `ListValue` is JSON array. - # @!attribute [rw] values - # @return [::Array<::Google::Protobuf::Value>] - # Repeated field of dynamically typed values. - class ListValue - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # `NullValue` is a singleton enumeration to represent the null value for the - # `Value` type union. - # - # The JSON representation for `NullValue` is JSON `null`. - module NullValue - # Null value. - NULL_VALUE = 0 - end - end -end diff --git a/owl-bot-staging/google-cloud-security_center-v2/proto_docs/google/protobuf/timestamp.rb b/owl-bot-staging/google-cloud-security_center-v2/proto_docs/google/protobuf/timestamp.rb deleted file mode 100644 index 74352be9c58c..000000000000 --- a/owl-bot-staging/google-cloud-security_center-v2/proto_docs/google/protobuf/timestamp.rb +++ /dev/null @@ -1,127 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - - -module Google - module Protobuf - # A Timestamp represents a point in time independent of any time zone or local - # calendar, encoded as a count of seconds and fractions of seconds at - # nanosecond resolution. The count is relative to an epoch at UTC midnight on - # January 1, 1970, in the proleptic Gregorian calendar which extends the - # Gregorian calendar backwards to year one. - # - # All minutes are 60 seconds long. Leap seconds are "smeared" so that no leap - # second table is needed for interpretation, using a [24-hour linear - # smear](https://developers.google.com/time/smear). - # - # The range is from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59.999999999Z. By - # restricting to that range, we ensure that we can convert to and from [RFC - # 3339](https://www.ietf.org/rfc/rfc3339.txt) date strings. - # - # # Examples - # - # Example 1: Compute Timestamp from POSIX `time()`. - # - # Timestamp timestamp; - # timestamp.set_seconds(time(NULL)); - # timestamp.set_nanos(0); - # - # Example 2: Compute Timestamp from POSIX `gettimeofday()`. - # - # struct timeval tv; - # gettimeofday(&tv, NULL); - # - # Timestamp timestamp; - # timestamp.set_seconds(tv.tv_sec); - # timestamp.set_nanos(tv.tv_usec * 1000); - # - # Example 3: Compute Timestamp from Win32 `GetSystemTimeAsFileTime()`. - # - # FILETIME ft; - # GetSystemTimeAsFileTime(&ft); - # UINT64 ticks = (((UINT64)ft.dwHighDateTime) << 32) | ft.dwLowDateTime; - # - # // A Windows tick is 100 nanoseconds. Windows epoch 1601-01-01T00:00:00Z - # // is 11644473600 seconds before Unix epoch 1970-01-01T00:00:00Z. - # Timestamp timestamp; - # timestamp.set_seconds((INT64) ((ticks / 10000000) - 11644473600LL)); - # timestamp.set_nanos((INT32) ((ticks % 10000000) * 100)); - # - # Example 4: Compute Timestamp from Java `System.currentTimeMillis()`. - # - # long millis = System.currentTimeMillis(); - # - # Timestamp timestamp = Timestamp.newBuilder().setSeconds(millis / 1000) - # .setNanos((int) ((millis % 1000) * 1000000)).build(); - # - # Example 5: Compute Timestamp from Java `Instant.now()`. - # - # Instant now = Instant.now(); - # - # Timestamp timestamp = - # Timestamp.newBuilder().setSeconds(now.getEpochSecond()) - # .setNanos(now.getNano()).build(); - # - # Example 6: Compute Timestamp from current time in Python. - # - # timestamp = Timestamp() - # timestamp.GetCurrentTime() - # - # # JSON Mapping - # - # In JSON format, the Timestamp type is encoded as a string in the - # [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format. That is, the - # format is "\\{year}-\\{month}-\\{day}T\\{hour}:\\{min}:\\{sec}[.\\{frac_sec}]Z" - # where \\{year} is always expressed using four digits while \\{month}, \\{day}, - # \\{hour}, \\{min}, and \\{sec} are zero-padded to two digits each. The fractional - # seconds, which can go up to 9 digits (i.e. up to 1 nanosecond resolution), - # are optional. The "Z" suffix indicates the timezone ("UTC"); the timezone - # is required. A proto3 JSON serializer should always use UTC (as indicated by - # "Z") when printing the Timestamp type and a proto3 JSON parser should be - # able to accept both UTC and other timezones (as indicated by an offset). - # - # For example, "2017-01-15T01:30:15.01Z" encodes 15.01 seconds past - # 01:30 UTC on January 15, 2017. - # - # In JavaScript, one can convert a Date object to this format using the - # standard - # [toISOString()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toISOString) - # method. In Python, a standard `datetime.datetime` object can be converted - # to this format using - # [`strftime`](https://docs.python.org/2/library/time.html#time.strftime) with - # the time format spec '%Y-%m-%dT%H:%M:%S.%fZ'. Likewise, in Java, one can use - # the Joda Time's [`ISODateTimeFormat.dateTime()`]( - # http://joda-time.sourceforge.net/apidocs/org/joda/time/format/ISODateTimeFormat.html#dateTime() - # ) to obtain a formatter capable of generating timestamps in this format. - # @!attribute [rw] seconds - # @return [::Integer] - # Represents seconds of UTC time since Unix epoch - # 1970-01-01T00:00:00Z. Must be from 0001-01-01T00:00:00Z to - # 9999-12-31T23:59:59Z inclusive. - # @!attribute [rw] nanos - # @return [::Integer] - # Non-negative fractions of a second at nanosecond resolution. Negative - # second values with fractions must still have non-negative nanos values - # that count forward in time. Must be from 0 to 999,999,999 - # inclusive. - class Timestamp - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - end -end diff --git a/owl-bot-staging/google-cloud-security_center-v2/proto_docs/google/rpc/status.rb b/owl-bot-staging/google-cloud-security_center-v2/proto_docs/google/rpc/status.rb deleted file mode 100644 index c1a1c07eb2db..000000000000 --- a/owl-bot-staging/google-cloud-security_center-v2/proto_docs/google/rpc/status.rb +++ /dev/null @@ -1,48 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - - -module Google - module Rpc - # The `Status` type defines a logical error model that is suitable for - # different programming environments, including REST APIs and RPC APIs. It is - # used by [gRPC](https://github.com/grpc). Each `Status` message contains - # three pieces of data: error code, error message, and error details. - # - # You can find out more about this error model and how to work with it in the - # [API Design Guide](https://cloud.google.com/apis/design/errors). - # @!attribute [rw] code - # @return [::Integer] - # The status code, which should be an enum value of - # [google.rpc.Code][google.rpc.Code]. - # @!attribute [rw] message - # @return [::String] - # A developer-facing error message, which should be in English. Any - # user-facing error message should be localized and sent in the - # {::Google::Rpc::Status#details google.rpc.Status.details} field, or localized - # by the client. - # @!attribute [rw] details - # @return [::Array<::Google::Protobuf::Any>] - # A list of messages that carry the error details. There is a common set of - # message types for APIs to use. - class Status - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - end -end diff --git a/owl-bot-staging/google-cloud-security_center-v2/proto_docs/google/type/expr.rb b/owl-bot-staging/google-cloud-security_center-v2/proto_docs/google/type/expr.rb deleted file mode 100644 index 53e7733b6592..000000000000 --- a/owl-bot-staging/google-cloud-security_center-v2/proto_docs/google/type/expr.rb +++ /dev/null @@ -1,75 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - - -module Google - module Type - # Represents a textual expression in the Common Expression Language (CEL) - # syntax. CEL is a C-like expression language. The syntax and semantics of CEL - # are documented at https://github.com/google/cel-spec. - # - # Example (Comparison): - # - # title: "Summary size limit" - # description: "Determines if a summary is less than 100 chars" - # expression: "document.summary.size() < 100" - # - # Example (Equality): - # - # title: "Requestor is owner" - # description: "Determines if requestor is the document owner" - # expression: "document.owner == request.auth.claims.email" - # - # Example (Logic): - # - # title: "Public documents" - # description: "Determine whether the document should be publicly visible" - # expression: "document.type != 'private' && document.type != 'internal'" - # - # Example (Data Manipulation): - # - # title: "Notification string" - # description: "Create a notification string with a timestamp." - # expression: "'New message received at ' + string(document.create_time)" - # - # The exact variables and functions that may be referenced within an expression - # are determined by the service that evaluates it. See the service - # documentation for additional information. - # @!attribute [rw] expression - # @return [::String] - # Textual representation of an expression in Common Expression Language - # syntax. - # @!attribute [rw] title - # @return [::String] - # Optional. Title for the expression, i.e. a short string describing - # its purpose. This can be used e.g. in UIs which allow to enter the - # expression. - # @!attribute [rw] description - # @return [::String] - # Optional. Description of the expression. This is a longer text which - # describes the expression, e.g. when hovered over it in a UI. - # @!attribute [rw] location - # @return [::String] - # Optional. String indicating the location of the expression for error - # reporting, e.g. a file name and a position in the file. - class Expr - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - end -end diff --git a/owl-bot-staging/google-cloud-security_center-v2/snippets/Gemfile b/owl-bot-staging/google-cloud-security_center-v2/snippets/Gemfile deleted file mode 100644 index 99432c66bb92..000000000000 --- a/owl-bot-staging/google-cloud-security_center-v2/snippets/Gemfile +++ /dev/null @@ -1,32 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -source "https://rubygems.org" - -if ENV["GOOGLE_CLOUD_SAMPLES_TEST"] == "master" - gem "google-cloud-security_center-v2", path: "../" -else - gem "google-cloud-security_center-v2" -end - -group :test do - gem "google-style", "~> 1.26.1" - gem "minitest", "~> 5.16" - gem "minitest-focus", "~> 1.1" - gem "minitest-hooks", "~> 1.5" -end diff --git a/owl-bot-staging/google-cloud-security_center-v2/snippets/security_center/batch_create_resource_value_configs.rb b/owl-bot-staging/google-cloud-security_center-v2/snippets/security_center/batch_create_resource_value_configs.rb deleted file mode 100644 index 35868ebf184f..000000000000 --- a/owl-bot-staging/google-cloud-security_center-v2/snippets/security_center/batch_create_resource_value_configs.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 securitycenter_v2_generated_SecurityCenter_BatchCreateResourceValueConfigs_sync] -require "google/cloud/security_center/v2" - -## -# Snippet for the batch_create_resource_value_configs call in the SecurityCenter service -# -# This snippet has been automatically generated and should be regarded as a code -# template only. It will require modifications to work: -# - It may require correct/in-range values for request initialization. -# - It may require specifying regional endpoints when creating the service -# client as shown in https://cloud.google.com/ruby/docs/reference. -# -# This is an auto-generated example demonstrating basic usage of -# Google::Cloud::SecurityCenter::V2::SecurityCenter::Client#batch_create_resource_value_configs. -# -def batch_create_resource_value_configs - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::SecurityCenter::V2::SecurityCenter::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::SecurityCenter::V2::BatchCreateResourceValueConfigsRequest.new - - # Call the batch_create_resource_value_configs method. - result = client.batch_create_resource_value_configs request - - # The returned object is of type Google::Cloud::SecurityCenter::V2::BatchCreateResourceValueConfigsResponse. - p result -end -# [END securitycenter_v2_generated_SecurityCenter_BatchCreateResourceValueConfigs_sync] diff --git a/owl-bot-staging/google-cloud-security_center-v2/snippets/security_center/bulk_mute_findings.rb b/owl-bot-staging/google-cloud-security_center-v2/snippets/security_center/bulk_mute_findings.rb deleted file mode 100644 index 937f173f1687..000000000000 --- a/owl-bot-staging/google-cloud-security_center-v2/snippets/security_center/bulk_mute_findings.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 securitycenter_v2_generated_SecurityCenter_BulkMuteFindings_sync] -require "google/cloud/security_center/v2" - -## -# Snippet for the bulk_mute_findings call in the SecurityCenter service -# -# This snippet has been automatically generated and should be regarded as a code -# template only. It will require modifications to work: -# - It may require correct/in-range values for request initialization. -# - It may require specifying regional endpoints when creating the service -# client as shown in https://cloud.google.com/ruby/docs/reference. -# -# This is an auto-generated example demonstrating basic usage of -# Google::Cloud::SecurityCenter::V2::SecurityCenter::Client#bulk_mute_findings. -# -def bulk_mute_findings - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::SecurityCenter::V2::SecurityCenter::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::SecurityCenter::V2::BulkMuteFindingsRequest.new - - # Call the bulk_mute_findings method. - result = client.bulk_mute_findings 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 securitycenter_v2_generated_SecurityCenter_BulkMuteFindings_sync] diff --git a/owl-bot-staging/google-cloud-security_center-v2/snippets/security_center/create_big_query_export.rb b/owl-bot-staging/google-cloud-security_center-v2/snippets/security_center/create_big_query_export.rb deleted file mode 100644 index 34909f562782..000000000000 --- a/owl-bot-staging/google-cloud-security_center-v2/snippets/security_center/create_big_query_export.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 securitycenter_v2_generated_SecurityCenter_CreateBigQueryExport_sync] -require "google/cloud/security_center/v2" - -## -# Snippet for the create_big_query_export call in the SecurityCenter service -# -# This snippet has been automatically generated and should be regarded as a code -# template only. It will require modifications to work: -# - It may require correct/in-range values for request initialization. -# - It may require specifying regional endpoints when creating the service -# client as shown in https://cloud.google.com/ruby/docs/reference. -# -# This is an auto-generated example demonstrating basic usage of -# Google::Cloud::SecurityCenter::V2::SecurityCenter::Client#create_big_query_export. -# -def create_big_query_export - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::SecurityCenter::V2::SecurityCenter::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::SecurityCenter::V2::CreateBigQueryExportRequest.new - - # Call the create_big_query_export method. - result = client.create_big_query_export request - - # The returned object is of type Google::Cloud::SecurityCenter::V2::BigQueryExport. - p result -end -# [END securitycenter_v2_generated_SecurityCenter_CreateBigQueryExport_sync] diff --git a/owl-bot-staging/google-cloud-security_center-v2/snippets/security_center/create_finding.rb b/owl-bot-staging/google-cloud-security_center-v2/snippets/security_center/create_finding.rb deleted file mode 100644 index b2dbeb349717..000000000000 --- a/owl-bot-staging/google-cloud-security_center-v2/snippets/security_center/create_finding.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 securitycenter_v2_generated_SecurityCenter_CreateFinding_sync] -require "google/cloud/security_center/v2" - -## -# Snippet for the create_finding call in the SecurityCenter service -# -# This snippet has been automatically generated and should be regarded as a code -# template only. It will require modifications to work: -# - It may require correct/in-range values for request initialization. -# - It may require specifying regional endpoints when creating the service -# client as shown in https://cloud.google.com/ruby/docs/reference. -# -# This is an auto-generated example demonstrating basic usage of -# Google::Cloud::SecurityCenter::V2::SecurityCenter::Client#create_finding. -# -def create_finding - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::SecurityCenter::V2::SecurityCenter::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::SecurityCenter::V2::CreateFindingRequest.new - - # Call the create_finding method. - result = client.create_finding request - - # The returned object is of type Google::Cloud::SecurityCenter::V2::Finding. - p result -end -# [END securitycenter_v2_generated_SecurityCenter_CreateFinding_sync] diff --git a/owl-bot-staging/google-cloud-security_center-v2/snippets/security_center/create_mute_config.rb b/owl-bot-staging/google-cloud-security_center-v2/snippets/security_center/create_mute_config.rb deleted file mode 100644 index 5ac853e23ca6..000000000000 --- a/owl-bot-staging/google-cloud-security_center-v2/snippets/security_center/create_mute_config.rb +++ /dev/null @@ -1,47 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -# [START securitycenter_v2_generated_SecurityCenter_CreateMuteConfig_sync] -require "google/cloud/security_center/v2" - -## -# Snippet for the create_mute_config call in the SecurityCenter service -# -# This snippet has been automatically generated and should be regarded as a code -# template only. It will require modifications to work: -# - It may require correct/in-range values for request initialization. -# - It may require specifying regional endpoints when creating the service -# client as shown in https://cloud.google.com/ruby/docs/reference. -# -# This is an auto-generated example demonstrating basic usage of -# Google::Cloud::SecurityCenter::V2::SecurityCenter::Client#create_mute_config. -# -def create_mute_config - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::SecurityCenter::V2::SecurityCenter::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::SecurityCenter::V2::CreateMuteConfigRequest.new - - # Call the create_mute_config method. - result = client.create_mute_config request - - # The returned object is of type Google::Cloud::SecurityCenter::V2::MuteConfig. - p result -end -# [END securitycenter_v2_generated_SecurityCenter_CreateMuteConfig_sync] diff --git a/owl-bot-staging/google-cloud-security_center-v2/snippets/security_center/create_notification_config.rb b/owl-bot-staging/google-cloud-security_center-v2/snippets/security_center/create_notification_config.rb deleted file mode 100644 index 8d63ccdb2cc6..000000000000 --- a/owl-bot-staging/google-cloud-security_center-v2/snippets/security_center/create_notification_config.rb +++ /dev/null @@ -1,47 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -# [START securitycenter_v2_generated_SecurityCenter_CreateNotificationConfig_sync] -require "google/cloud/security_center/v2" - -## -# Snippet for the create_notification_config call in the SecurityCenter service -# -# This snippet has been automatically generated and should be regarded as a code -# template only. It will require modifications to work: -# - It may require correct/in-range values for request initialization. -# - It may require specifying regional endpoints when creating the service -# client as shown in https://cloud.google.com/ruby/docs/reference. -# -# This is an auto-generated example demonstrating basic usage of -# Google::Cloud::SecurityCenter::V2::SecurityCenter::Client#create_notification_config. -# -def create_notification_config - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::SecurityCenter::V2::SecurityCenter::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::SecurityCenter::V2::CreateNotificationConfigRequest.new - - # Call the create_notification_config method. - result = client.create_notification_config request - - # The returned object is of type Google::Cloud::SecurityCenter::V2::NotificationConfig. - p result -end -# [END securitycenter_v2_generated_SecurityCenter_CreateNotificationConfig_sync] diff --git a/owl-bot-staging/google-cloud-security_center-v2/snippets/security_center/create_source.rb b/owl-bot-staging/google-cloud-security_center-v2/snippets/security_center/create_source.rb deleted file mode 100644 index 042a0de0ff05..000000000000 --- a/owl-bot-staging/google-cloud-security_center-v2/snippets/security_center/create_source.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 securitycenter_v2_generated_SecurityCenter_CreateSource_sync] -require "google/cloud/security_center/v2" - -## -# Snippet for the create_source call in the SecurityCenter service -# -# This snippet has been automatically generated and should be regarded as a code -# template only. It will require modifications to work: -# - It may require correct/in-range values for request initialization. -# - It may require specifying regional endpoints when creating the service -# client as shown in https://cloud.google.com/ruby/docs/reference. -# -# This is an auto-generated example demonstrating basic usage of -# Google::Cloud::SecurityCenter::V2::SecurityCenter::Client#create_source. -# -def create_source - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::SecurityCenter::V2::SecurityCenter::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::SecurityCenter::V2::CreateSourceRequest.new - - # Call the create_source method. - result = client.create_source request - - # The returned object is of type Google::Cloud::SecurityCenter::V2::Source. - p result -end -# [END securitycenter_v2_generated_SecurityCenter_CreateSource_sync] diff --git a/owl-bot-staging/google-cloud-security_center-v2/snippets/security_center/delete_big_query_export.rb b/owl-bot-staging/google-cloud-security_center-v2/snippets/security_center/delete_big_query_export.rb deleted file mode 100644 index c5b9ec740f3f..000000000000 --- a/owl-bot-staging/google-cloud-security_center-v2/snippets/security_center/delete_big_query_export.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 securitycenter_v2_generated_SecurityCenter_DeleteBigQueryExport_sync] -require "google/cloud/security_center/v2" - -## -# Snippet for the delete_big_query_export call in the SecurityCenter service -# -# This snippet has been automatically generated and should be regarded as a code -# template only. It will require modifications to work: -# - It may require correct/in-range values for request initialization. -# - It may require specifying regional endpoints when creating the service -# client as shown in https://cloud.google.com/ruby/docs/reference. -# -# This is an auto-generated example demonstrating basic usage of -# Google::Cloud::SecurityCenter::V2::SecurityCenter::Client#delete_big_query_export. -# -def delete_big_query_export - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::SecurityCenter::V2::SecurityCenter::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::SecurityCenter::V2::DeleteBigQueryExportRequest.new - - # Call the delete_big_query_export method. - result = client.delete_big_query_export request - - # The returned object is of type Google::Protobuf::Empty. - p result -end -# [END securitycenter_v2_generated_SecurityCenter_DeleteBigQueryExport_sync] diff --git a/owl-bot-staging/google-cloud-security_center-v2/snippets/security_center/delete_mute_config.rb b/owl-bot-staging/google-cloud-security_center-v2/snippets/security_center/delete_mute_config.rb deleted file mode 100644 index f6d9fe6232b5..000000000000 --- a/owl-bot-staging/google-cloud-security_center-v2/snippets/security_center/delete_mute_config.rb +++ /dev/null @@ -1,47 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -# [START securitycenter_v2_generated_SecurityCenter_DeleteMuteConfig_sync] -require "google/cloud/security_center/v2" - -## -# Snippet for the delete_mute_config call in the SecurityCenter service -# -# This snippet has been automatically generated and should be regarded as a code -# template only. It will require modifications to work: -# - It may require correct/in-range values for request initialization. -# - It may require specifying regional endpoints when creating the service -# client as shown in https://cloud.google.com/ruby/docs/reference. -# -# This is an auto-generated example demonstrating basic usage of -# Google::Cloud::SecurityCenter::V2::SecurityCenter::Client#delete_mute_config. -# -def delete_mute_config - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::SecurityCenter::V2::SecurityCenter::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::SecurityCenter::V2::DeleteMuteConfigRequest.new - - # Call the delete_mute_config method. - result = client.delete_mute_config request - - # The returned object is of type Google::Protobuf::Empty. - p result -end -# [END securitycenter_v2_generated_SecurityCenter_DeleteMuteConfig_sync] diff --git a/owl-bot-staging/google-cloud-security_center-v2/snippets/security_center/delete_notification_config.rb b/owl-bot-staging/google-cloud-security_center-v2/snippets/security_center/delete_notification_config.rb deleted file mode 100644 index e7084636df2d..000000000000 --- a/owl-bot-staging/google-cloud-security_center-v2/snippets/security_center/delete_notification_config.rb +++ /dev/null @@ -1,47 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -# [START securitycenter_v2_generated_SecurityCenter_DeleteNotificationConfig_sync] -require "google/cloud/security_center/v2" - -## -# Snippet for the delete_notification_config call in the SecurityCenter service -# -# This snippet has been automatically generated and should be regarded as a code -# template only. It will require modifications to work: -# - It may require correct/in-range values for request initialization. -# - It may require specifying regional endpoints when creating the service -# client as shown in https://cloud.google.com/ruby/docs/reference. -# -# This is an auto-generated example demonstrating basic usage of -# Google::Cloud::SecurityCenter::V2::SecurityCenter::Client#delete_notification_config. -# -def delete_notification_config - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::SecurityCenter::V2::SecurityCenter::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::SecurityCenter::V2::DeleteNotificationConfigRequest.new - - # Call the delete_notification_config method. - result = client.delete_notification_config request - - # The returned object is of type Google::Protobuf::Empty. - p result -end -# [END securitycenter_v2_generated_SecurityCenter_DeleteNotificationConfig_sync] diff --git a/owl-bot-staging/google-cloud-security_center-v2/snippets/security_center/delete_resource_value_config.rb b/owl-bot-staging/google-cloud-security_center-v2/snippets/security_center/delete_resource_value_config.rb deleted file mode 100644 index f369d1ca9754..000000000000 --- a/owl-bot-staging/google-cloud-security_center-v2/snippets/security_center/delete_resource_value_config.rb +++ /dev/null @@ -1,47 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -# [START securitycenter_v2_generated_SecurityCenter_DeleteResourceValueConfig_sync] -require "google/cloud/security_center/v2" - -## -# Snippet for the delete_resource_value_config call in the SecurityCenter service -# -# This snippet has been automatically generated and should be regarded as a code -# template only. It will require modifications to work: -# - It may require correct/in-range values for request initialization. -# - It may require specifying regional endpoints when creating the service -# client as shown in https://cloud.google.com/ruby/docs/reference. -# -# This is an auto-generated example demonstrating basic usage of -# Google::Cloud::SecurityCenter::V2::SecurityCenter::Client#delete_resource_value_config. -# -def delete_resource_value_config - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::SecurityCenter::V2::SecurityCenter::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::SecurityCenter::V2::DeleteResourceValueConfigRequest.new - - # Call the delete_resource_value_config method. - result = client.delete_resource_value_config request - - # The returned object is of type Google::Protobuf::Empty. - p result -end -# [END securitycenter_v2_generated_SecurityCenter_DeleteResourceValueConfig_sync] diff --git a/owl-bot-staging/google-cloud-security_center-v2/snippets/security_center/get_big_query_export.rb b/owl-bot-staging/google-cloud-security_center-v2/snippets/security_center/get_big_query_export.rb deleted file mode 100644 index 167844fa3f97..000000000000 --- a/owl-bot-staging/google-cloud-security_center-v2/snippets/security_center/get_big_query_export.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 securitycenter_v2_generated_SecurityCenter_GetBigQueryExport_sync] -require "google/cloud/security_center/v2" - -## -# Snippet for the get_big_query_export call in the SecurityCenter service -# -# This snippet has been automatically generated and should be regarded as a code -# template only. It will require modifications to work: -# - It may require correct/in-range values for request initialization. -# - It may require specifying regional endpoints when creating the service -# client as shown in https://cloud.google.com/ruby/docs/reference. -# -# This is an auto-generated example demonstrating basic usage of -# Google::Cloud::SecurityCenter::V2::SecurityCenter::Client#get_big_query_export. -# -def get_big_query_export - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::SecurityCenter::V2::SecurityCenter::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::SecurityCenter::V2::GetBigQueryExportRequest.new - - # Call the get_big_query_export method. - result = client.get_big_query_export request - - # The returned object is of type Google::Cloud::SecurityCenter::V2::BigQueryExport. - p result -end -# [END securitycenter_v2_generated_SecurityCenter_GetBigQueryExport_sync] diff --git a/owl-bot-staging/google-cloud-security_center-v2/snippets/security_center/get_iam_policy.rb b/owl-bot-staging/google-cloud-security_center-v2/snippets/security_center/get_iam_policy.rb deleted file mode 100644 index e260df274f67..000000000000 --- a/owl-bot-staging/google-cloud-security_center-v2/snippets/security_center/get_iam_policy.rb +++ /dev/null @@ -1,47 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -# [START securitycenter_v2_generated_SecurityCenter_GetIamPolicy_sync] -require "google/cloud/security_center/v2" - -## -# Snippet for the get_iam_policy call in the SecurityCenter service -# -# This snippet has been automatically generated and should be regarded as a code -# template only. It will require modifications to work: -# - It may require correct/in-range values for request initialization. -# - It may require specifying regional endpoints when creating the service -# client as shown in https://cloud.google.com/ruby/docs/reference. -# -# This is an auto-generated example demonstrating basic usage of -# Google::Cloud::SecurityCenter::V2::SecurityCenter::Client#get_iam_policy. -# -def get_iam_policy - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::SecurityCenter::V2::SecurityCenter::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Iam::V1::GetIamPolicyRequest.new - - # Call the get_iam_policy method. - result = client.get_iam_policy request - - # The returned object is of type Google::Iam::V1::Policy. - p result -end -# [END securitycenter_v2_generated_SecurityCenter_GetIamPolicy_sync] diff --git a/owl-bot-staging/google-cloud-security_center-v2/snippets/security_center/get_mute_config.rb b/owl-bot-staging/google-cloud-security_center-v2/snippets/security_center/get_mute_config.rb deleted file mode 100644 index 737f0b9b778a..000000000000 --- a/owl-bot-staging/google-cloud-security_center-v2/snippets/security_center/get_mute_config.rb +++ /dev/null @@ -1,47 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -# [START securitycenter_v2_generated_SecurityCenter_GetMuteConfig_sync] -require "google/cloud/security_center/v2" - -## -# Snippet for the get_mute_config call in the SecurityCenter service -# -# This snippet has been automatically generated and should be regarded as a code -# template only. It will require modifications to work: -# - It may require correct/in-range values for request initialization. -# - It may require specifying regional endpoints when creating the service -# client as shown in https://cloud.google.com/ruby/docs/reference. -# -# This is an auto-generated example demonstrating basic usage of -# Google::Cloud::SecurityCenter::V2::SecurityCenter::Client#get_mute_config. -# -def get_mute_config - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::SecurityCenter::V2::SecurityCenter::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::SecurityCenter::V2::GetMuteConfigRequest.new - - # Call the get_mute_config method. - result = client.get_mute_config request - - # The returned object is of type Google::Cloud::SecurityCenter::V2::MuteConfig. - p result -end -# [END securitycenter_v2_generated_SecurityCenter_GetMuteConfig_sync] diff --git a/owl-bot-staging/google-cloud-security_center-v2/snippets/security_center/get_notification_config.rb b/owl-bot-staging/google-cloud-security_center-v2/snippets/security_center/get_notification_config.rb deleted file mode 100644 index a6e6fe0bf43d..000000000000 --- a/owl-bot-staging/google-cloud-security_center-v2/snippets/security_center/get_notification_config.rb +++ /dev/null @@ -1,47 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -# [START securitycenter_v2_generated_SecurityCenter_GetNotificationConfig_sync] -require "google/cloud/security_center/v2" - -## -# Snippet for the get_notification_config call in the SecurityCenter service -# -# This snippet has been automatically generated and should be regarded as a code -# template only. It will require modifications to work: -# - It may require correct/in-range values for request initialization. -# - It may require specifying regional endpoints when creating the service -# client as shown in https://cloud.google.com/ruby/docs/reference. -# -# This is an auto-generated example demonstrating basic usage of -# Google::Cloud::SecurityCenter::V2::SecurityCenter::Client#get_notification_config. -# -def get_notification_config - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::SecurityCenter::V2::SecurityCenter::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::SecurityCenter::V2::GetNotificationConfigRequest.new - - # Call the get_notification_config method. - result = client.get_notification_config request - - # The returned object is of type Google::Cloud::SecurityCenter::V2::NotificationConfig. - p result -end -# [END securitycenter_v2_generated_SecurityCenter_GetNotificationConfig_sync] diff --git a/owl-bot-staging/google-cloud-security_center-v2/snippets/security_center/get_resource_value_config.rb b/owl-bot-staging/google-cloud-security_center-v2/snippets/security_center/get_resource_value_config.rb deleted file mode 100644 index dca8397631b9..000000000000 --- a/owl-bot-staging/google-cloud-security_center-v2/snippets/security_center/get_resource_value_config.rb +++ /dev/null @@ -1,47 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -# [START securitycenter_v2_generated_SecurityCenter_GetResourceValueConfig_sync] -require "google/cloud/security_center/v2" - -## -# Snippet for the get_resource_value_config call in the SecurityCenter service -# -# This snippet has been automatically generated and should be regarded as a code -# template only. It will require modifications to work: -# - It may require correct/in-range values for request initialization. -# - It may require specifying regional endpoints when creating the service -# client as shown in https://cloud.google.com/ruby/docs/reference. -# -# This is an auto-generated example demonstrating basic usage of -# Google::Cloud::SecurityCenter::V2::SecurityCenter::Client#get_resource_value_config. -# -def get_resource_value_config - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::SecurityCenter::V2::SecurityCenter::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::SecurityCenter::V2::GetResourceValueConfigRequest.new - - # Call the get_resource_value_config method. - result = client.get_resource_value_config request - - # The returned object is of type Google::Cloud::SecurityCenter::V2::ResourceValueConfig. - p result -end -# [END securitycenter_v2_generated_SecurityCenter_GetResourceValueConfig_sync] diff --git a/owl-bot-staging/google-cloud-security_center-v2/snippets/security_center/get_simulation.rb b/owl-bot-staging/google-cloud-security_center-v2/snippets/security_center/get_simulation.rb deleted file mode 100644 index 97887b9c87b5..000000000000 --- a/owl-bot-staging/google-cloud-security_center-v2/snippets/security_center/get_simulation.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 securitycenter_v2_generated_SecurityCenter_GetSimulation_sync] -require "google/cloud/security_center/v2" - -## -# Snippet for the get_simulation call in the SecurityCenter service -# -# This snippet has been automatically generated and should be regarded as a code -# template only. It will require modifications to work: -# - It may require correct/in-range values for request initialization. -# - It may require specifying regional endpoints when creating the service -# client as shown in https://cloud.google.com/ruby/docs/reference. -# -# This is an auto-generated example demonstrating basic usage of -# Google::Cloud::SecurityCenter::V2::SecurityCenter::Client#get_simulation. -# -def get_simulation - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::SecurityCenter::V2::SecurityCenter::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::SecurityCenter::V2::GetSimulationRequest.new - - # Call the get_simulation method. - result = client.get_simulation request - - # The returned object is of type Google::Cloud::SecurityCenter::V2::Simulation. - p result -end -# [END securitycenter_v2_generated_SecurityCenter_GetSimulation_sync] diff --git a/owl-bot-staging/google-cloud-security_center-v2/snippets/security_center/get_source.rb b/owl-bot-staging/google-cloud-security_center-v2/snippets/security_center/get_source.rb deleted file mode 100644 index 9e23b772526e..000000000000 --- a/owl-bot-staging/google-cloud-security_center-v2/snippets/security_center/get_source.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 securitycenter_v2_generated_SecurityCenter_GetSource_sync] -require "google/cloud/security_center/v2" - -## -# Snippet for the get_source call in the SecurityCenter service -# -# This snippet has been automatically generated and should be regarded as a code -# template only. It will require modifications to work: -# - It may require correct/in-range values for request initialization. -# - It may require specifying regional endpoints when creating the service -# client as shown in https://cloud.google.com/ruby/docs/reference. -# -# This is an auto-generated example demonstrating basic usage of -# Google::Cloud::SecurityCenter::V2::SecurityCenter::Client#get_source. -# -def get_source - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::SecurityCenter::V2::SecurityCenter::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::SecurityCenter::V2::GetSourceRequest.new - - # Call the get_source method. - result = client.get_source request - - # The returned object is of type Google::Cloud::SecurityCenter::V2::Source. - p result -end -# [END securitycenter_v2_generated_SecurityCenter_GetSource_sync] diff --git a/owl-bot-staging/google-cloud-security_center-v2/snippets/security_center/get_valued_resource.rb b/owl-bot-staging/google-cloud-security_center-v2/snippets/security_center/get_valued_resource.rb deleted file mode 100644 index 1d27e0e2a2bd..000000000000 --- a/owl-bot-staging/google-cloud-security_center-v2/snippets/security_center/get_valued_resource.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 securitycenter_v2_generated_SecurityCenter_GetValuedResource_sync] -require "google/cloud/security_center/v2" - -## -# Snippet for the get_valued_resource call in the SecurityCenter service -# -# This snippet has been automatically generated and should be regarded as a code -# template only. It will require modifications to work: -# - It may require correct/in-range values for request initialization. -# - It may require specifying regional endpoints when creating the service -# client as shown in https://cloud.google.com/ruby/docs/reference. -# -# This is an auto-generated example demonstrating basic usage of -# Google::Cloud::SecurityCenter::V2::SecurityCenter::Client#get_valued_resource. -# -def get_valued_resource - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::SecurityCenter::V2::SecurityCenter::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::SecurityCenter::V2::GetValuedResourceRequest.new - - # Call the get_valued_resource method. - result = client.get_valued_resource request - - # The returned object is of type Google::Cloud::SecurityCenter::V2::ValuedResource. - p result -end -# [END securitycenter_v2_generated_SecurityCenter_GetValuedResource_sync] diff --git a/owl-bot-staging/google-cloud-security_center-v2/snippets/security_center/group_findings.rb b/owl-bot-staging/google-cloud-security_center-v2/snippets/security_center/group_findings.rb deleted file mode 100644 index 1c83d2e734fb..000000000000 --- a/owl-bot-staging/google-cloud-security_center-v2/snippets/security_center/group_findings.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 securitycenter_v2_generated_SecurityCenter_GroupFindings_sync] -require "google/cloud/security_center/v2" - -## -# Snippet for the group_findings call in the SecurityCenter service -# -# This snippet has been automatically generated and should be regarded as a code -# template only. It will require modifications to work: -# - It may require correct/in-range values for request initialization. -# - It may require specifying regional endpoints when creating the service -# client as shown in https://cloud.google.com/ruby/docs/reference. -# -# This is an auto-generated example demonstrating basic usage of -# Google::Cloud::SecurityCenter::V2::SecurityCenter::Client#group_findings. -# -def group_findings - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::SecurityCenter::V2::SecurityCenter::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::SecurityCenter::V2::GroupFindingsRequest.new - - # Call the group_findings method. - result = client.group_findings request - - # The returned object is of type Gapic::PagedEnumerable. You can iterate - # over elements, and API calls will be issued to fetch pages as needed. - result.each do |item| - # Each element is of type ::Google::Cloud::SecurityCenter::V2::GroupResult. - p item - end -end -# [END securitycenter_v2_generated_SecurityCenter_GroupFindings_sync] diff --git a/owl-bot-staging/google-cloud-security_center-v2/snippets/security_center/list_attack_paths.rb b/owl-bot-staging/google-cloud-security_center-v2/snippets/security_center/list_attack_paths.rb deleted file mode 100644 index efd9cc9a111e..000000000000 --- a/owl-bot-staging/google-cloud-security_center-v2/snippets/security_center/list_attack_paths.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 securitycenter_v2_generated_SecurityCenter_ListAttackPaths_sync] -require "google/cloud/security_center/v2" - -## -# Snippet for the list_attack_paths call in the SecurityCenter service -# -# This snippet has been automatically generated and should be regarded as a code -# template only. It will require modifications to work: -# - It may require correct/in-range values for request initialization. -# - It may require specifying regional endpoints when creating the service -# client as shown in https://cloud.google.com/ruby/docs/reference. -# -# This is an auto-generated example demonstrating basic usage of -# Google::Cloud::SecurityCenter::V2::SecurityCenter::Client#list_attack_paths. -# -def list_attack_paths - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::SecurityCenter::V2::SecurityCenter::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::SecurityCenter::V2::ListAttackPathsRequest.new - - # Call the list_attack_paths method. - result = client.list_attack_paths request - - # The returned object is of type Gapic::PagedEnumerable. You can iterate - # over elements, and API calls will be issued to fetch pages as needed. - result.each do |item| - # Each element is of type ::Google::Cloud::SecurityCenter::V2::AttackPath. - p item - end -end -# [END securitycenter_v2_generated_SecurityCenter_ListAttackPaths_sync] diff --git a/owl-bot-staging/google-cloud-security_center-v2/snippets/security_center/list_big_query_exports.rb b/owl-bot-staging/google-cloud-security_center-v2/snippets/security_center/list_big_query_exports.rb deleted file mode 100644 index b499ded4d8b6..000000000000 --- a/owl-bot-staging/google-cloud-security_center-v2/snippets/security_center/list_big_query_exports.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 securitycenter_v2_generated_SecurityCenter_ListBigQueryExports_sync] -require "google/cloud/security_center/v2" - -## -# Snippet for the list_big_query_exports call in the SecurityCenter service -# -# This snippet has been automatically generated and should be regarded as a code -# template only. It will require modifications to work: -# - It may require correct/in-range values for request initialization. -# - It may require specifying regional endpoints when creating the service -# client as shown in https://cloud.google.com/ruby/docs/reference. -# -# This is an auto-generated example demonstrating basic usage of -# Google::Cloud::SecurityCenter::V2::SecurityCenter::Client#list_big_query_exports. -# -def list_big_query_exports - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::SecurityCenter::V2::SecurityCenter::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::SecurityCenter::V2::ListBigQueryExportsRequest.new - - # Call the list_big_query_exports method. - result = client.list_big_query_exports request - - # The returned object is of type Gapic::PagedEnumerable. You can iterate - # over elements, and API calls will be issued to fetch pages as needed. - result.each do |item| - # Each element is of type ::Google::Cloud::SecurityCenter::V2::BigQueryExport. - p item - end -end -# [END securitycenter_v2_generated_SecurityCenter_ListBigQueryExports_sync] diff --git a/owl-bot-staging/google-cloud-security_center-v2/snippets/security_center/list_findings.rb b/owl-bot-staging/google-cloud-security_center-v2/snippets/security_center/list_findings.rb deleted file mode 100644 index f8f726312d73..000000000000 --- a/owl-bot-staging/google-cloud-security_center-v2/snippets/security_center/list_findings.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 securitycenter_v2_generated_SecurityCenter_ListFindings_sync] -require "google/cloud/security_center/v2" - -## -# Snippet for the list_findings call in the SecurityCenter service -# -# This snippet has been automatically generated and should be regarded as a code -# template only. It will require modifications to work: -# - It may require correct/in-range values for request initialization. -# - It may require specifying regional endpoints when creating the service -# client as shown in https://cloud.google.com/ruby/docs/reference. -# -# This is an auto-generated example demonstrating basic usage of -# Google::Cloud::SecurityCenter::V2::SecurityCenter::Client#list_findings. -# -def list_findings - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::SecurityCenter::V2::SecurityCenter::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::SecurityCenter::V2::ListFindingsRequest.new - - # Call the list_findings method. - result = client.list_findings request - - # The returned object is of type Gapic::PagedEnumerable. You can iterate - # over elements, and API calls will be issued to fetch pages as needed. - result.each do |item| - # Each element is of type ::Google::Cloud::SecurityCenter::V2::ListFindingsResponse::ListFindingsResult. - p item - end -end -# [END securitycenter_v2_generated_SecurityCenter_ListFindings_sync] diff --git a/owl-bot-staging/google-cloud-security_center-v2/snippets/security_center/list_mute_configs.rb b/owl-bot-staging/google-cloud-security_center-v2/snippets/security_center/list_mute_configs.rb deleted file mode 100644 index aa028407968b..000000000000 --- a/owl-bot-staging/google-cloud-security_center-v2/snippets/security_center/list_mute_configs.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 securitycenter_v2_generated_SecurityCenter_ListMuteConfigs_sync] -require "google/cloud/security_center/v2" - -## -# Snippet for the list_mute_configs call in the SecurityCenter service -# -# This snippet has been automatically generated and should be regarded as a code -# template only. It will require modifications to work: -# - It may require correct/in-range values for request initialization. -# - It may require specifying regional endpoints when creating the service -# client as shown in https://cloud.google.com/ruby/docs/reference. -# -# This is an auto-generated example demonstrating basic usage of -# Google::Cloud::SecurityCenter::V2::SecurityCenter::Client#list_mute_configs. -# -def list_mute_configs - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::SecurityCenter::V2::SecurityCenter::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::SecurityCenter::V2::ListMuteConfigsRequest.new - - # Call the list_mute_configs method. - result = client.list_mute_configs request - - # The returned object is of type Gapic::PagedEnumerable. You can iterate - # over elements, and API calls will be issued to fetch pages as needed. - result.each do |item| - # Each element is of type ::Google::Cloud::SecurityCenter::V2::MuteConfig. - p item - end -end -# [END securitycenter_v2_generated_SecurityCenter_ListMuteConfigs_sync] diff --git a/owl-bot-staging/google-cloud-security_center-v2/snippets/security_center/list_notification_configs.rb b/owl-bot-staging/google-cloud-security_center-v2/snippets/security_center/list_notification_configs.rb deleted file mode 100644 index 421f44da22ce..000000000000 --- a/owl-bot-staging/google-cloud-security_center-v2/snippets/security_center/list_notification_configs.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 securitycenter_v2_generated_SecurityCenter_ListNotificationConfigs_sync] -require "google/cloud/security_center/v2" - -## -# Snippet for the list_notification_configs call in the SecurityCenter service -# -# This snippet has been automatically generated and should be regarded as a code -# template only. It will require modifications to work: -# - It may require correct/in-range values for request initialization. -# - It may require specifying regional endpoints when creating the service -# client as shown in https://cloud.google.com/ruby/docs/reference. -# -# This is an auto-generated example demonstrating basic usage of -# Google::Cloud::SecurityCenter::V2::SecurityCenter::Client#list_notification_configs. -# -def list_notification_configs - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::SecurityCenter::V2::SecurityCenter::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::SecurityCenter::V2::ListNotificationConfigsRequest.new - - # Call the list_notification_configs method. - result = client.list_notification_configs request - - # The returned object is of type Gapic::PagedEnumerable. You can iterate - # over elements, and API calls will be issued to fetch pages as needed. - result.each do |item| - # Each element is of type ::Google::Cloud::SecurityCenter::V2::NotificationConfig. - p item - end -end -# [END securitycenter_v2_generated_SecurityCenter_ListNotificationConfigs_sync] diff --git a/owl-bot-staging/google-cloud-security_center-v2/snippets/security_center/list_resource_value_configs.rb b/owl-bot-staging/google-cloud-security_center-v2/snippets/security_center/list_resource_value_configs.rb deleted file mode 100644 index ebd23f97037d..000000000000 --- a/owl-bot-staging/google-cloud-security_center-v2/snippets/security_center/list_resource_value_configs.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 securitycenter_v2_generated_SecurityCenter_ListResourceValueConfigs_sync] -require "google/cloud/security_center/v2" - -## -# Snippet for the list_resource_value_configs call in the SecurityCenter service -# -# This snippet has been automatically generated and should be regarded as a code -# template only. It will require modifications to work: -# - It may require correct/in-range values for request initialization. -# - It may require specifying regional endpoints when creating the service -# client as shown in https://cloud.google.com/ruby/docs/reference. -# -# This is an auto-generated example demonstrating basic usage of -# Google::Cloud::SecurityCenter::V2::SecurityCenter::Client#list_resource_value_configs. -# -def list_resource_value_configs - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::SecurityCenter::V2::SecurityCenter::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::SecurityCenter::V2::ListResourceValueConfigsRequest.new - - # Call the list_resource_value_configs method. - result = client.list_resource_value_configs request - - # The returned object is of type Gapic::PagedEnumerable. You can iterate - # over elements, and API calls will be issued to fetch pages as needed. - result.each do |item| - # Each element is of type ::Google::Cloud::SecurityCenter::V2::ResourceValueConfig. - p item - end -end -# [END securitycenter_v2_generated_SecurityCenter_ListResourceValueConfigs_sync] diff --git a/owl-bot-staging/google-cloud-security_center-v2/snippets/security_center/list_sources.rb b/owl-bot-staging/google-cloud-security_center-v2/snippets/security_center/list_sources.rb deleted file mode 100644 index 0d014e61ce97..000000000000 --- a/owl-bot-staging/google-cloud-security_center-v2/snippets/security_center/list_sources.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 securitycenter_v2_generated_SecurityCenter_ListSources_sync] -require "google/cloud/security_center/v2" - -## -# Snippet for the list_sources call in the SecurityCenter service -# -# This snippet has been automatically generated and should be regarded as a code -# template only. It will require modifications to work: -# - It may require correct/in-range values for request initialization. -# - It may require specifying regional endpoints when creating the service -# client as shown in https://cloud.google.com/ruby/docs/reference. -# -# This is an auto-generated example demonstrating basic usage of -# Google::Cloud::SecurityCenter::V2::SecurityCenter::Client#list_sources. -# -def list_sources - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::SecurityCenter::V2::SecurityCenter::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::SecurityCenter::V2::ListSourcesRequest.new - - # Call the list_sources method. - result = client.list_sources request - - # The returned object is of type Gapic::PagedEnumerable. You can iterate - # over elements, and API calls will be issued to fetch pages as needed. - result.each do |item| - # Each element is of type ::Google::Cloud::SecurityCenter::V2::Source. - p item - end -end -# [END securitycenter_v2_generated_SecurityCenter_ListSources_sync] diff --git a/owl-bot-staging/google-cloud-security_center-v2/snippets/security_center/list_valued_resources.rb b/owl-bot-staging/google-cloud-security_center-v2/snippets/security_center/list_valued_resources.rb deleted file mode 100644 index ff34383c5836..000000000000 --- a/owl-bot-staging/google-cloud-security_center-v2/snippets/security_center/list_valued_resources.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 securitycenter_v2_generated_SecurityCenter_ListValuedResources_sync] -require "google/cloud/security_center/v2" - -## -# Snippet for the list_valued_resources call in the SecurityCenter service -# -# This snippet has been automatically generated and should be regarded as a code -# template only. It will require modifications to work: -# - It may require correct/in-range values for request initialization. -# - It may require specifying regional endpoints when creating the service -# client as shown in https://cloud.google.com/ruby/docs/reference. -# -# This is an auto-generated example demonstrating basic usage of -# Google::Cloud::SecurityCenter::V2::SecurityCenter::Client#list_valued_resources. -# -def list_valued_resources - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::SecurityCenter::V2::SecurityCenter::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::SecurityCenter::V2::ListValuedResourcesRequest.new - - # Call the list_valued_resources method. - result = client.list_valued_resources request - - # The returned object is of type Gapic::PagedEnumerable. You can iterate - # over elements, and API calls will be issued to fetch pages as needed. - result.each do |item| - # Each element is of type ::Google::Cloud::SecurityCenter::V2::ValuedResource. - p item - end -end -# [END securitycenter_v2_generated_SecurityCenter_ListValuedResources_sync] diff --git a/owl-bot-staging/google-cloud-security_center-v2/snippets/security_center/set_finding_state.rb b/owl-bot-staging/google-cloud-security_center-v2/snippets/security_center/set_finding_state.rb deleted file mode 100644 index 948f27b578d9..000000000000 --- a/owl-bot-staging/google-cloud-security_center-v2/snippets/security_center/set_finding_state.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 securitycenter_v2_generated_SecurityCenter_SetFindingState_sync] -require "google/cloud/security_center/v2" - -## -# Snippet for the set_finding_state call in the SecurityCenter service -# -# This snippet has been automatically generated and should be regarded as a code -# template only. It will require modifications to work: -# - It may require correct/in-range values for request initialization. -# - It may require specifying regional endpoints when creating the service -# client as shown in https://cloud.google.com/ruby/docs/reference. -# -# This is an auto-generated example demonstrating basic usage of -# Google::Cloud::SecurityCenter::V2::SecurityCenter::Client#set_finding_state. -# -def set_finding_state - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::SecurityCenter::V2::SecurityCenter::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::SecurityCenter::V2::SetFindingStateRequest.new - - # Call the set_finding_state method. - result = client.set_finding_state request - - # The returned object is of type Google::Cloud::SecurityCenter::V2::Finding. - p result -end -# [END securitycenter_v2_generated_SecurityCenter_SetFindingState_sync] diff --git a/owl-bot-staging/google-cloud-security_center-v2/snippets/security_center/set_iam_policy.rb b/owl-bot-staging/google-cloud-security_center-v2/snippets/security_center/set_iam_policy.rb deleted file mode 100644 index 357443d72dfc..000000000000 --- a/owl-bot-staging/google-cloud-security_center-v2/snippets/security_center/set_iam_policy.rb +++ /dev/null @@ -1,47 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -# [START securitycenter_v2_generated_SecurityCenter_SetIamPolicy_sync] -require "google/cloud/security_center/v2" - -## -# Snippet for the set_iam_policy call in the SecurityCenter service -# -# This snippet has been automatically generated and should be regarded as a code -# template only. It will require modifications to work: -# - It may require correct/in-range values for request initialization. -# - It may require specifying regional endpoints when creating the service -# client as shown in https://cloud.google.com/ruby/docs/reference. -# -# This is an auto-generated example demonstrating basic usage of -# Google::Cloud::SecurityCenter::V2::SecurityCenter::Client#set_iam_policy. -# -def set_iam_policy - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::SecurityCenter::V2::SecurityCenter::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Iam::V1::SetIamPolicyRequest.new - - # Call the set_iam_policy method. - result = client.set_iam_policy request - - # The returned object is of type Google::Iam::V1::Policy. - p result -end -# [END securitycenter_v2_generated_SecurityCenter_SetIamPolicy_sync] diff --git a/owl-bot-staging/google-cloud-security_center-v2/snippets/security_center/set_mute.rb b/owl-bot-staging/google-cloud-security_center-v2/snippets/security_center/set_mute.rb deleted file mode 100644 index 7928a7e3a85b..000000000000 --- a/owl-bot-staging/google-cloud-security_center-v2/snippets/security_center/set_mute.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 securitycenter_v2_generated_SecurityCenter_SetMute_sync] -require "google/cloud/security_center/v2" - -## -# Snippet for the set_mute call in the SecurityCenter service -# -# This snippet has been automatically generated and should be regarded as a code -# template only. It will require modifications to work: -# - It may require correct/in-range values for request initialization. -# - It may require specifying regional endpoints when creating the service -# client as shown in https://cloud.google.com/ruby/docs/reference. -# -# This is an auto-generated example demonstrating basic usage of -# Google::Cloud::SecurityCenter::V2::SecurityCenter::Client#set_mute. -# -def set_mute - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::SecurityCenter::V2::SecurityCenter::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::SecurityCenter::V2::SetMuteRequest.new - - # Call the set_mute method. - result = client.set_mute request - - # The returned object is of type Google::Cloud::SecurityCenter::V2::Finding. - p result -end -# [END securitycenter_v2_generated_SecurityCenter_SetMute_sync] diff --git a/owl-bot-staging/google-cloud-security_center-v2/snippets/security_center/test_iam_permissions.rb b/owl-bot-staging/google-cloud-security_center-v2/snippets/security_center/test_iam_permissions.rb deleted file mode 100644 index 7a22e129a409..000000000000 --- a/owl-bot-staging/google-cloud-security_center-v2/snippets/security_center/test_iam_permissions.rb +++ /dev/null @@ -1,47 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -# [START securitycenter_v2_generated_SecurityCenter_TestIamPermissions_sync] -require "google/cloud/security_center/v2" - -## -# Snippet for the test_iam_permissions call in the SecurityCenter service -# -# This snippet has been automatically generated and should be regarded as a code -# template only. It will require modifications to work: -# - It may require correct/in-range values for request initialization. -# - It may require specifying regional endpoints when creating the service -# client as shown in https://cloud.google.com/ruby/docs/reference. -# -# This is an auto-generated example demonstrating basic usage of -# Google::Cloud::SecurityCenter::V2::SecurityCenter::Client#test_iam_permissions. -# -def test_iam_permissions - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::SecurityCenter::V2::SecurityCenter::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Iam::V1::TestIamPermissionsRequest.new - - # Call the test_iam_permissions method. - result = client.test_iam_permissions request - - # The returned object is of type Google::Iam::V1::TestIamPermissionsResponse. - p result -end -# [END securitycenter_v2_generated_SecurityCenter_TestIamPermissions_sync] diff --git a/owl-bot-staging/google-cloud-security_center-v2/snippets/security_center/update_big_query_export.rb b/owl-bot-staging/google-cloud-security_center-v2/snippets/security_center/update_big_query_export.rb deleted file mode 100644 index c3357e841268..000000000000 --- a/owl-bot-staging/google-cloud-security_center-v2/snippets/security_center/update_big_query_export.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 securitycenter_v2_generated_SecurityCenter_UpdateBigQueryExport_sync] -require "google/cloud/security_center/v2" - -## -# Snippet for the update_big_query_export call in the SecurityCenter service -# -# This snippet has been automatically generated and should be regarded as a code -# template only. It will require modifications to work: -# - It may require correct/in-range values for request initialization. -# - It may require specifying regional endpoints when creating the service -# client as shown in https://cloud.google.com/ruby/docs/reference. -# -# This is an auto-generated example demonstrating basic usage of -# Google::Cloud::SecurityCenter::V2::SecurityCenter::Client#update_big_query_export. -# -def update_big_query_export - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::SecurityCenter::V2::SecurityCenter::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::SecurityCenter::V2::UpdateBigQueryExportRequest.new - - # Call the update_big_query_export method. - result = client.update_big_query_export request - - # The returned object is of type Google::Cloud::SecurityCenter::V2::BigQueryExport. - p result -end -# [END securitycenter_v2_generated_SecurityCenter_UpdateBigQueryExport_sync] diff --git a/owl-bot-staging/google-cloud-security_center-v2/snippets/security_center/update_external_system.rb b/owl-bot-staging/google-cloud-security_center-v2/snippets/security_center/update_external_system.rb deleted file mode 100644 index 58bb7f1196d7..000000000000 --- a/owl-bot-staging/google-cloud-security_center-v2/snippets/security_center/update_external_system.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 securitycenter_v2_generated_SecurityCenter_UpdateExternalSystem_sync] -require "google/cloud/security_center/v2" - -## -# Snippet for the update_external_system call in the SecurityCenter service -# -# This snippet has been automatically generated and should be regarded as a code -# template only. It will require modifications to work: -# - It may require correct/in-range values for request initialization. -# - It may require specifying regional endpoints when creating the service -# client as shown in https://cloud.google.com/ruby/docs/reference. -# -# This is an auto-generated example demonstrating basic usage of -# Google::Cloud::SecurityCenter::V2::SecurityCenter::Client#update_external_system. -# -def update_external_system - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::SecurityCenter::V2::SecurityCenter::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::SecurityCenter::V2::UpdateExternalSystemRequest.new - - # Call the update_external_system method. - result = client.update_external_system request - - # The returned object is of type Google::Cloud::SecurityCenter::V2::ExternalSystem. - p result -end -# [END securitycenter_v2_generated_SecurityCenter_UpdateExternalSystem_sync] diff --git a/owl-bot-staging/google-cloud-security_center-v2/snippets/security_center/update_finding.rb b/owl-bot-staging/google-cloud-security_center-v2/snippets/security_center/update_finding.rb deleted file mode 100644 index 3d8d7bc0e599..000000000000 --- a/owl-bot-staging/google-cloud-security_center-v2/snippets/security_center/update_finding.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 securitycenter_v2_generated_SecurityCenter_UpdateFinding_sync] -require "google/cloud/security_center/v2" - -## -# Snippet for the update_finding call in the SecurityCenter service -# -# This snippet has been automatically generated and should be regarded as a code -# template only. It will require modifications to work: -# - It may require correct/in-range values for request initialization. -# - It may require specifying regional endpoints when creating the service -# client as shown in https://cloud.google.com/ruby/docs/reference. -# -# This is an auto-generated example demonstrating basic usage of -# Google::Cloud::SecurityCenter::V2::SecurityCenter::Client#update_finding. -# -def update_finding - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::SecurityCenter::V2::SecurityCenter::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::SecurityCenter::V2::UpdateFindingRequest.new - - # Call the update_finding method. - result = client.update_finding request - - # The returned object is of type Google::Cloud::SecurityCenter::V2::Finding. - p result -end -# [END securitycenter_v2_generated_SecurityCenter_UpdateFinding_sync] diff --git a/owl-bot-staging/google-cloud-security_center-v2/snippets/security_center/update_mute_config.rb b/owl-bot-staging/google-cloud-security_center-v2/snippets/security_center/update_mute_config.rb deleted file mode 100644 index efa2c28e01be..000000000000 --- a/owl-bot-staging/google-cloud-security_center-v2/snippets/security_center/update_mute_config.rb +++ /dev/null @@ -1,47 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -# [START securitycenter_v2_generated_SecurityCenter_UpdateMuteConfig_sync] -require "google/cloud/security_center/v2" - -## -# Snippet for the update_mute_config call in the SecurityCenter service -# -# This snippet has been automatically generated and should be regarded as a code -# template only. It will require modifications to work: -# - It may require correct/in-range values for request initialization. -# - It may require specifying regional endpoints when creating the service -# client as shown in https://cloud.google.com/ruby/docs/reference. -# -# This is an auto-generated example demonstrating basic usage of -# Google::Cloud::SecurityCenter::V2::SecurityCenter::Client#update_mute_config. -# -def update_mute_config - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::SecurityCenter::V2::SecurityCenter::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::SecurityCenter::V2::UpdateMuteConfigRequest.new - - # Call the update_mute_config method. - result = client.update_mute_config request - - # The returned object is of type Google::Cloud::SecurityCenter::V2::MuteConfig. - p result -end -# [END securitycenter_v2_generated_SecurityCenter_UpdateMuteConfig_sync] diff --git a/owl-bot-staging/google-cloud-security_center-v2/snippets/security_center/update_notification_config.rb b/owl-bot-staging/google-cloud-security_center-v2/snippets/security_center/update_notification_config.rb deleted file mode 100644 index 50e827404937..000000000000 --- a/owl-bot-staging/google-cloud-security_center-v2/snippets/security_center/update_notification_config.rb +++ /dev/null @@ -1,47 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -# [START securitycenter_v2_generated_SecurityCenter_UpdateNotificationConfig_sync] -require "google/cloud/security_center/v2" - -## -# Snippet for the update_notification_config call in the SecurityCenter service -# -# This snippet has been automatically generated and should be regarded as a code -# template only. It will require modifications to work: -# - It may require correct/in-range values for request initialization. -# - It may require specifying regional endpoints when creating the service -# client as shown in https://cloud.google.com/ruby/docs/reference. -# -# This is an auto-generated example demonstrating basic usage of -# Google::Cloud::SecurityCenter::V2::SecurityCenter::Client#update_notification_config. -# -def update_notification_config - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::SecurityCenter::V2::SecurityCenter::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::SecurityCenter::V2::UpdateNotificationConfigRequest.new - - # Call the update_notification_config method. - result = client.update_notification_config request - - # The returned object is of type Google::Cloud::SecurityCenter::V2::NotificationConfig. - p result -end -# [END securitycenter_v2_generated_SecurityCenter_UpdateNotificationConfig_sync] diff --git a/owl-bot-staging/google-cloud-security_center-v2/snippets/security_center/update_resource_value_config.rb b/owl-bot-staging/google-cloud-security_center-v2/snippets/security_center/update_resource_value_config.rb deleted file mode 100644 index fb28fc12506d..000000000000 --- a/owl-bot-staging/google-cloud-security_center-v2/snippets/security_center/update_resource_value_config.rb +++ /dev/null @@ -1,47 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -# [START securitycenter_v2_generated_SecurityCenter_UpdateResourceValueConfig_sync] -require "google/cloud/security_center/v2" - -## -# Snippet for the update_resource_value_config call in the SecurityCenter service -# -# This snippet has been automatically generated and should be regarded as a code -# template only. It will require modifications to work: -# - It may require correct/in-range values for request initialization. -# - It may require specifying regional endpoints when creating the service -# client as shown in https://cloud.google.com/ruby/docs/reference. -# -# This is an auto-generated example demonstrating basic usage of -# Google::Cloud::SecurityCenter::V2::SecurityCenter::Client#update_resource_value_config. -# -def update_resource_value_config - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::SecurityCenter::V2::SecurityCenter::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::SecurityCenter::V2::UpdateResourceValueConfigRequest.new - - # Call the update_resource_value_config method. - result = client.update_resource_value_config request - - # The returned object is of type Google::Cloud::SecurityCenter::V2::ResourceValueConfig. - p result -end -# [END securitycenter_v2_generated_SecurityCenter_UpdateResourceValueConfig_sync] diff --git a/owl-bot-staging/google-cloud-security_center-v2/snippets/security_center/update_security_marks.rb b/owl-bot-staging/google-cloud-security_center-v2/snippets/security_center/update_security_marks.rb deleted file mode 100644 index 828f608dee92..000000000000 --- a/owl-bot-staging/google-cloud-security_center-v2/snippets/security_center/update_security_marks.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 securitycenter_v2_generated_SecurityCenter_UpdateSecurityMarks_sync] -require "google/cloud/security_center/v2" - -## -# Snippet for the update_security_marks call in the SecurityCenter service -# -# This snippet has been automatically generated and should be regarded as a code -# template only. It will require modifications to work: -# - It may require correct/in-range values for request initialization. -# - It may require specifying regional endpoints when creating the service -# client as shown in https://cloud.google.com/ruby/docs/reference. -# -# This is an auto-generated example demonstrating basic usage of -# Google::Cloud::SecurityCenter::V2::SecurityCenter::Client#update_security_marks. -# -def update_security_marks - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::SecurityCenter::V2::SecurityCenter::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::SecurityCenter::V2::UpdateSecurityMarksRequest.new - - # Call the update_security_marks method. - result = client.update_security_marks request - - # The returned object is of type Google::Cloud::SecurityCenter::V2::SecurityMarks. - p result -end -# [END securitycenter_v2_generated_SecurityCenter_UpdateSecurityMarks_sync] diff --git a/owl-bot-staging/google-cloud-security_center-v2/snippets/security_center/update_source.rb b/owl-bot-staging/google-cloud-security_center-v2/snippets/security_center/update_source.rb deleted file mode 100644 index 7dad0281409d..000000000000 --- a/owl-bot-staging/google-cloud-security_center-v2/snippets/security_center/update_source.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 securitycenter_v2_generated_SecurityCenter_UpdateSource_sync] -require "google/cloud/security_center/v2" - -## -# Snippet for the update_source call in the SecurityCenter service -# -# This snippet has been automatically generated and should be regarded as a code -# template only. It will require modifications to work: -# - It may require correct/in-range values for request initialization. -# - It may require specifying regional endpoints when creating the service -# client as shown in https://cloud.google.com/ruby/docs/reference. -# -# This is an auto-generated example demonstrating basic usage of -# Google::Cloud::SecurityCenter::V2::SecurityCenter::Client#update_source. -# -def update_source - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::SecurityCenter::V2::SecurityCenter::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::SecurityCenter::V2::UpdateSourceRequest.new - - # Call the update_source method. - result = client.update_source request - - # The returned object is of type Google::Cloud::SecurityCenter::V2::Source. - p result -end -# [END securitycenter_v2_generated_SecurityCenter_UpdateSource_sync] diff --git a/owl-bot-staging/google-cloud-security_center-v2/snippets/snippet_metadata_google.cloud.securitycenter.v2.json b/owl-bot-staging/google-cloud-security_center-v2/snippets/snippet_metadata_google.cloud.securitycenter.v2.json deleted file mode 100644 index 8b78714ab7d9..000000000000 --- a/owl-bot-staging/google-cloud-security_center-v2/snippets/snippet_metadata_google.cloud.securitycenter.v2.json +++ /dev/null @@ -1,1615 +0,0 @@ -{ - "client_library": { - "name": "google-cloud-security_center-v2", - "version": "", - "language": "RUBY", - "apis": [ - { - "id": "google.cloud.securitycenter.v2", - "version": "v2" - } - ] - }, - "snippets": [ - { - "region_tag": "securitycenter_v2_generated_SecurityCenter_BatchCreateResourceValueConfigs_sync", - "title": "Snippet for the batch_create_resource_value_configs call in the SecurityCenter service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::SecurityCenter::V2::SecurityCenter::Client#batch_create_resource_value_configs.", - "file": "security_center/batch_create_resource_value_configs.rb", - "language": "RUBY", - "client_method": { - "short_name": "batch_create_resource_value_configs", - "full_name": "::Google::Cloud::SecurityCenter::V2::SecurityCenter::Client#batch_create_resource_value_configs", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::SecurityCenter::V2::BatchCreateResourceValueConfigsRequest", - "name": "request" - } - ], - "result_type": "::Google::Cloud::SecurityCenter::V2::BatchCreateResourceValueConfigsResponse", - "client": { - "short_name": "SecurityCenter::Client", - "full_name": "::Google::Cloud::SecurityCenter::V2::SecurityCenter::Client" - }, - "method": { - "short_name": "BatchCreateResourceValueConfigs", - "full_name": "google.cloud.securitycenter.v2.SecurityCenter.BatchCreateResourceValueConfigs", - "service": { - "short_name": "SecurityCenter", - "full_name": "google.cloud.securitycenter.v2.SecurityCenter" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 46, - "type": "FULL" - } - ] - }, - { - "region_tag": "securitycenter_v2_generated_SecurityCenter_BulkMuteFindings_sync", - "title": "Snippet for the bulk_mute_findings call in the SecurityCenter service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::SecurityCenter::V2::SecurityCenter::Client#bulk_mute_findings.", - "file": "security_center/bulk_mute_findings.rb", - "language": "RUBY", - "client_method": { - "short_name": "bulk_mute_findings", - "full_name": "::Google::Cloud::SecurityCenter::V2::SecurityCenter::Client#bulk_mute_findings", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::SecurityCenter::V2::BulkMuteFindingsRequest", - "name": "request" - } - ], - "result_type": "::Google::Longrunning::Operation", - "client": { - "short_name": "SecurityCenter::Client", - "full_name": "::Google::Cloud::SecurityCenter::V2::SecurityCenter::Client" - }, - "method": { - "short_name": "BulkMuteFindings", - "full_name": "google.cloud.securitycenter.v2.SecurityCenter.BulkMuteFindings", - "service": { - "short_name": "SecurityCenter", - "full_name": "google.cloud.securitycenter.v2.SecurityCenter" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 53, - "type": "FULL" - } - ] - }, - { - "region_tag": "securitycenter_v2_generated_SecurityCenter_CreateBigQueryExport_sync", - "title": "Snippet for the create_big_query_export call in the SecurityCenter service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::SecurityCenter::V2::SecurityCenter::Client#create_big_query_export.", - "file": "security_center/create_big_query_export.rb", - "language": "RUBY", - "client_method": { - "short_name": "create_big_query_export", - "full_name": "::Google::Cloud::SecurityCenter::V2::SecurityCenter::Client#create_big_query_export", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::SecurityCenter::V2::CreateBigQueryExportRequest", - "name": "request" - } - ], - "result_type": "::Google::Cloud::SecurityCenter::V2::BigQueryExport", - "client": { - "short_name": "SecurityCenter::Client", - "full_name": "::Google::Cloud::SecurityCenter::V2::SecurityCenter::Client" - }, - "method": { - "short_name": "CreateBigQueryExport", - "full_name": "google.cloud.securitycenter.v2.SecurityCenter.CreateBigQueryExport", - "service": { - "short_name": "SecurityCenter", - "full_name": "google.cloud.securitycenter.v2.SecurityCenter" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 46, - "type": "FULL" - } - ] - }, - { - "region_tag": "securitycenter_v2_generated_SecurityCenter_CreateFinding_sync", - "title": "Snippet for the create_finding call in the SecurityCenter service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::SecurityCenter::V2::SecurityCenter::Client#create_finding.", - "file": "security_center/create_finding.rb", - "language": "RUBY", - "client_method": { - "short_name": "create_finding", - "full_name": "::Google::Cloud::SecurityCenter::V2::SecurityCenter::Client#create_finding", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::SecurityCenter::V2::CreateFindingRequest", - "name": "request" - } - ], - "result_type": "::Google::Cloud::SecurityCenter::V2::Finding", - "client": { - "short_name": "SecurityCenter::Client", - "full_name": "::Google::Cloud::SecurityCenter::V2::SecurityCenter::Client" - }, - "method": { - "short_name": "CreateFinding", - "full_name": "google.cloud.securitycenter.v2.SecurityCenter.CreateFinding", - "service": { - "short_name": "SecurityCenter", - "full_name": "google.cloud.securitycenter.v2.SecurityCenter" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 46, - "type": "FULL" - } - ] - }, - { - "region_tag": "securitycenter_v2_generated_SecurityCenter_CreateMuteConfig_sync", - "title": "Snippet for the create_mute_config call in the SecurityCenter service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::SecurityCenter::V2::SecurityCenter::Client#create_mute_config.", - "file": "security_center/create_mute_config.rb", - "language": "RUBY", - "client_method": { - "short_name": "create_mute_config", - "full_name": "::Google::Cloud::SecurityCenter::V2::SecurityCenter::Client#create_mute_config", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::SecurityCenter::V2::CreateMuteConfigRequest", - "name": "request" - } - ], - "result_type": "::Google::Cloud::SecurityCenter::V2::MuteConfig", - "client": { - "short_name": "SecurityCenter::Client", - "full_name": "::Google::Cloud::SecurityCenter::V2::SecurityCenter::Client" - }, - "method": { - "short_name": "CreateMuteConfig", - "full_name": "google.cloud.securitycenter.v2.SecurityCenter.CreateMuteConfig", - "service": { - "short_name": "SecurityCenter", - "full_name": "google.cloud.securitycenter.v2.SecurityCenter" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 46, - "type": "FULL" - } - ] - }, - { - "region_tag": "securitycenter_v2_generated_SecurityCenter_CreateNotificationConfig_sync", - "title": "Snippet for the create_notification_config call in the SecurityCenter service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::SecurityCenter::V2::SecurityCenter::Client#create_notification_config.", - "file": "security_center/create_notification_config.rb", - "language": "RUBY", - "client_method": { - "short_name": "create_notification_config", - "full_name": "::Google::Cloud::SecurityCenter::V2::SecurityCenter::Client#create_notification_config", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::SecurityCenter::V2::CreateNotificationConfigRequest", - "name": "request" - } - ], - "result_type": "::Google::Cloud::SecurityCenter::V2::NotificationConfig", - "client": { - "short_name": "SecurityCenter::Client", - "full_name": "::Google::Cloud::SecurityCenter::V2::SecurityCenter::Client" - }, - "method": { - "short_name": "CreateNotificationConfig", - "full_name": "google.cloud.securitycenter.v2.SecurityCenter.CreateNotificationConfig", - "service": { - "short_name": "SecurityCenter", - "full_name": "google.cloud.securitycenter.v2.SecurityCenter" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 46, - "type": "FULL" - } - ] - }, - { - "region_tag": "securitycenter_v2_generated_SecurityCenter_CreateSource_sync", - "title": "Snippet for the create_source call in the SecurityCenter service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::SecurityCenter::V2::SecurityCenter::Client#create_source.", - "file": "security_center/create_source.rb", - "language": "RUBY", - "client_method": { - "short_name": "create_source", - "full_name": "::Google::Cloud::SecurityCenter::V2::SecurityCenter::Client#create_source", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::SecurityCenter::V2::CreateSourceRequest", - "name": "request" - } - ], - "result_type": "::Google::Cloud::SecurityCenter::V2::Source", - "client": { - "short_name": "SecurityCenter::Client", - "full_name": "::Google::Cloud::SecurityCenter::V2::SecurityCenter::Client" - }, - "method": { - "short_name": "CreateSource", - "full_name": "google.cloud.securitycenter.v2.SecurityCenter.CreateSource", - "service": { - "short_name": "SecurityCenter", - "full_name": "google.cloud.securitycenter.v2.SecurityCenter" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 46, - "type": "FULL" - } - ] - }, - { - "region_tag": "securitycenter_v2_generated_SecurityCenter_DeleteBigQueryExport_sync", - "title": "Snippet for the delete_big_query_export call in the SecurityCenter service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::SecurityCenter::V2::SecurityCenter::Client#delete_big_query_export.", - "file": "security_center/delete_big_query_export.rb", - "language": "RUBY", - "client_method": { - "short_name": "delete_big_query_export", - "full_name": "::Google::Cloud::SecurityCenter::V2::SecurityCenter::Client#delete_big_query_export", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::SecurityCenter::V2::DeleteBigQueryExportRequest", - "name": "request" - } - ], - "result_type": "::Google::Protobuf::Empty", - "client": { - "short_name": "SecurityCenter::Client", - "full_name": "::Google::Cloud::SecurityCenter::V2::SecurityCenter::Client" - }, - "method": { - "short_name": "DeleteBigQueryExport", - "full_name": "google.cloud.securitycenter.v2.SecurityCenter.DeleteBigQueryExport", - "service": { - "short_name": "SecurityCenter", - "full_name": "google.cloud.securitycenter.v2.SecurityCenter" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 46, - "type": "FULL" - } - ] - }, - { - "region_tag": "securitycenter_v2_generated_SecurityCenter_DeleteMuteConfig_sync", - "title": "Snippet for the delete_mute_config call in the SecurityCenter service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::SecurityCenter::V2::SecurityCenter::Client#delete_mute_config.", - "file": "security_center/delete_mute_config.rb", - "language": "RUBY", - "client_method": { - "short_name": "delete_mute_config", - "full_name": "::Google::Cloud::SecurityCenter::V2::SecurityCenter::Client#delete_mute_config", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::SecurityCenter::V2::DeleteMuteConfigRequest", - "name": "request" - } - ], - "result_type": "::Google::Protobuf::Empty", - "client": { - "short_name": "SecurityCenter::Client", - "full_name": "::Google::Cloud::SecurityCenter::V2::SecurityCenter::Client" - }, - "method": { - "short_name": "DeleteMuteConfig", - "full_name": "google.cloud.securitycenter.v2.SecurityCenter.DeleteMuteConfig", - "service": { - "short_name": "SecurityCenter", - "full_name": "google.cloud.securitycenter.v2.SecurityCenter" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 46, - "type": "FULL" - } - ] - }, - { - "region_tag": "securitycenter_v2_generated_SecurityCenter_DeleteNotificationConfig_sync", - "title": "Snippet for the delete_notification_config call in the SecurityCenter service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::SecurityCenter::V2::SecurityCenter::Client#delete_notification_config.", - "file": "security_center/delete_notification_config.rb", - "language": "RUBY", - "client_method": { - "short_name": "delete_notification_config", - "full_name": "::Google::Cloud::SecurityCenter::V2::SecurityCenter::Client#delete_notification_config", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::SecurityCenter::V2::DeleteNotificationConfigRequest", - "name": "request" - } - ], - "result_type": "::Google::Protobuf::Empty", - "client": { - "short_name": "SecurityCenter::Client", - "full_name": "::Google::Cloud::SecurityCenter::V2::SecurityCenter::Client" - }, - "method": { - "short_name": "DeleteNotificationConfig", - "full_name": "google.cloud.securitycenter.v2.SecurityCenter.DeleteNotificationConfig", - "service": { - "short_name": "SecurityCenter", - "full_name": "google.cloud.securitycenter.v2.SecurityCenter" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 46, - "type": "FULL" - } - ] - }, - { - "region_tag": "securitycenter_v2_generated_SecurityCenter_DeleteResourceValueConfig_sync", - "title": "Snippet for the delete_resource_value_config call in the SecurityCenter service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::SecurityCenter::V2::SecurityCenter::Client#delete_resource_value_config.", - "file": "security_center/delete_resource_value_config.rb", - "language": "RUBY", - "client_method": { - "short_name": "delete_resource_value_config", - "full_name": "::Google::Cloud::SecurityCenter::V2::SecurityCenter::Client#delete_resource_value_config", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::SecurityCenter::V2::DeleteResourceValueConfigRequest", - "name": "request" - } - ], - "result_type": "::Google::Protobuf::Empty", - "client": { - "short_name": "SecurityCenter::Client", - "full_name": "::Google::Cloud::SecurityCenter::V2::SecurityCenter::Client" - }, - "method": { - "short_name": "DeleteResourceValueConfig", - "full_name": "google.cloud.securitycenter.v2.SecurityCenter.DeleteResourceValueConfig", - "service": { - "short_name": "SecurityCenter", - "full_name": "google.cloud.securitycenter.v2.SecurityCenter" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 46, - "type": "FULL" - } - ] - }, - { - "region_tag": "securitycenter_v2_generated_SecurityCenter_GetBigQueryExport_sync", - "title": "Snippet for the get_big_query_export call in the SecurityCenter service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::SecurityCenter::V2::SecurityCenter::Client#get_big_query_export.", - "file": "security_center/get_big_query_export.rb", - "language": "RUBY", - "client_method": { - "short_name": "get_big_query_export", - "full_name": "::Google::Cloud::SecurityCenter::V2::SecurityCenter::Client#get_big_query_export", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::SecurityCenter::V2::GetBigQueryExportRequest", - "name": "request" - } - ], - "result_type": "::Google::Cloud::SecurityCenter::V2::BigQueryExport", - "client": { - "short_name": "SecurityCenter::Client", - "full_name": "::Google::Cloud::SecurityCenter::V2::SecurityCenter::Client" - }, - "method": { - "short_name": "GetBigQueryExport", - "full_name": "google.cloud.securitycenter.v2.SecurityCenter.GetBigQueryExport", - "service": { - "short_name": "SecurityCenter", - "full_name": "google.cloud.securitycenter.v2.SecurityCenter" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 46, - "type": "FULL" - } - ] - }, - { - "region_tag": "securitycenter_v2_generated_SecurityCenter_GetSimulation_sync", - "title": "Snippet for the get_simulation call in the SecurityCenter service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::SecurityCenter::V2::SecurityCenter::Client#get_simulation.", - "file": "security_center/get_simulation.rb", - "language": "RUBY", - "client_method": { - "short_name": "get_simulation", - "full_name": "::Google::Cloud::SecurityCenter::V2::SecurityCenter::Client#get_simulation", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::SecurityCenter::V2::GetSimulationRequest", - "name": "request" - } - ], - "result_type": "::Google::Cloud::SecurityCenter::V2::Simulation", - "client": { - "short_name": "SecurityCenter::Client", - "full_name": "::Google::Cloud::SecurityCenter::V2::SecurityCenter::Client" - }, - "method": { - "short_name": "GetSimulation", - "full_name": "google.cloud.securitycenter.v2.SecurityCenter.GetSimulation", - "service": { - "short_name": "SecurityCenter", - "full_name": "google.cloud.securitycenter.v2.SecurityCenter" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 46, - "type": "FULL" - } - ] - }, - { - "region_tag": "securitycenter_v2_generated_SecurityCenter_GetValuedResource_sync", - "title": "Snippet for the get_valued_resource call in the SecurityCenter service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::SecurityCenter::V2::SecurityCenter::Client#get_valued_resource.", - "file": "security_center/get_valued_resource.rb", - "language": "RUBY", - "client_method": { - "short_name": "get_valued_resource", - "full_name": "::Google::Cloud::SecurityCenter::V2::SecurityCenter::Client#get_valued_resource", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::SecurityCenter::V2::GetValuedResourceRequest", - "name": "request" - } - ], - "result_type": "::Google::Cloud::SecurityCenter::V2::ValuedResource", - "client": { - "short_name": "SecurityCenter::Client", - "full_name": "::Google::Cloud::SecurityCenter::V2::SecurityCenter::Client" - }, - "method": { - "short_name": "GetValuedResource", - "full_name": "google.cloud.securitycenter.v2.SecurityCenter.GetValuedResource", - "service": { - "short_name": "SecurityCenter", - "full_name": "google.cloud.securitycenter.v2.SecurityCenter" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 46, - "type": "FULL" - } - ] - }, - { - "region_tag": "securitycenter_v2_generated_SecurityCenter_GetIamPolicy_sync", - "title": "Snippet for the get_iam_policy call in the SecurityCenter service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::SecurityCenter::V2::SecurityCenter::Client#get_iam_policy.", - "file": "security_center/get_iam_policy.rb", - "language": "RUBY", - "client_method": { - "short_name": "get_iam_policy", - "full_name": "::Google::Cloud::SecurityCenter::V2::SecurityCenter::Client#get_iam_policy", - "async": false, - "parameters": [ - { - "type": "::Google::Iam::V1::GetIamPolicyRequest", - "name": "request" - } - ], - "result_type": "::Google::Iam::V1::Policy", - "client": { - "short_name": "SecurityCenter::Client", - "full_name": "::Google::Cloud::SecurityCenter::V2::SecurityCenter::Client" - }, - "method": { - "short_name": "GetIamPolicy", - "full_name": "google.cloud.securitycenter.v2.SecurityCenter.GetIamPolicy", - "service": { - "short_name": "SecurityCenter", - "full_name": "google.cloud.securitycenter.v2.SecurityCenter" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 46, - "type": "FULL" - } - ] - }, - { - "region_tag": "securitycenter_v2_generated_SecurityCenter_GetMuteConfig_sync", - "title": "Snippet for the get_mute_config call in the SecurityCenter service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::SecurityCenter::V2::SecurityCenter::Client#get_mute_config.", - "file": "security_center/get_mute_config.rb", - "language": "RUBY", - "client_method": { - "short_name": "get_mute_config", - "full_name": "::Google::Cloud::SecurityCenter::V2::SecurityCenter::Client#get_mute_config", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::SecurityCenter::V2::GetMuteConfigRequest", - "name": "request" - } - ], - "result_type": "::Google::Cloud::SecurityCenter::V2::MuteConfig", - "client": { - "short_name": "SecurityCenter::Client", - "full_name": "::Google::Cloud::SecurityCenter::V2::SecurityCenter::Client" - }, - "method": { - "short_name": "GetMuteConfig", - "full_name": "google.cloud.securitycenter.v2.SecurityCenter.GetMuteConfig", - "service": { - "short_name": "SecurityCenter", - "full_name": "google.cloud.securitycenter.v2.SecurityCenter" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 46, - "type": "FULL" - } - ] - }, - { - "region_tag": "securitycenter_v2_generated_SecurityCenter_GetNotificationConfig_sync", - "title": "Snippet for the get_notification_config call in the SecurityCenter service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::SecurityCenter::V2::SecurityCenter::Client#get_notification_config.", - "file": "security_center/get_notification_config.rb", - "language": "RUBY", - "client_method": { - "short_name": "get_notification_config", - "full_name": "::Google::Cloud::SecurityCenter::V2::SecurityCenter::Client#get_notification_config", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::SecurityCenter::V2::GetNotificationConfigRequest", - "name": "request" - } - ], - "result_type": "::Google::Cloud::SecurityCenter::V2::NotificationConfig", - "client": { - "short_name": "SecurityCenter::Client", - "full_name": "::Google::Cloud::SecurityCenter::V2::SecurityCenter::Client" - }, - "method": { - "short_name": "GetNotificationConfig", - "full_name": "google.cloud.securitycenter.v2.SecurityCenter.GetNotificationConfig", - "service": { - "short_name": "SecurityCenter", - "full_name": "google.cloud.securitycenter.v2.SecurityCenter" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 46, - "type": "FULL" - } - ] - }, - { - "region_tag": "securitycenter_v2_generated_SecurityCenter_GetResourceValueConfig_sync", - "title": "Snippet for the get_resource_value_config call in the SecurityCenter service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::SecurityCenter::V2::SecurityCenter::Client#get_resource_value_config.", - "file": "security_center/get_resource_value_config.rb", - "language": "RUBY", - "client_method": { - "short_name": "get_resource_value_config", - "full_name": "::Google::Cloud::SecurityCenter::V2::SecurityCenter::Client#get_resource_value_config", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::SecurityCenter::V2::GetResourceValueConfigRequest", - "name": "request" - } - ], - "result_type": "::Google::Cloud::SecurityCenter::V2::ResourceValueConfig", - "client": { - "short_name": "SecurityCenter::Client", - "full_name": "::Google::Cloud::SecurityCenter::V2::SecurityCenter::Client" - }, - "method": { - "short_name": "GetResourceValueConfig", - "full_name": "google.cloud.securitycenter.v2.SecurityCenter.GetResourceValueConfig", - "service": { - "short_name": "SecurityCenter", - "full_name": "google.cloud.securitycenter.v2.SecurityCenter" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 46, - "type": "FULL" - } - ] - }, - { - "region_tag": "securitycenter_v2_generated_SecurityCenter_GetSource_sync", - "title": "Snippet for the get_source call in the SecurityCenter service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::SecurityCenter::V2::SecurityCenter::Client#get_source.", - "file": "security_center/get_source.rb", - "language": "RUBY", - "client_method": { - "short_name": "get_source", - "full_name": "::Google::Cloud::SecurityCenter::V2::SecurityCenter::Client#get_source", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::SecurityCenter::V2::GetSourceRequest", - "name": "request" - } - ], - "result_type": "::Google::Cloud::SecurityCenter::V2::Source", - "client": { - "short_name": "SecurityCenter::Client", - "full_name": "::Google::Cloud::SecurityCenter::V2::SecurityCenter::Client" - }, - "method": { - "short_name": "GetSource", - "full_name": "google.cloud.securitycenter.v2.SecurityCenter.GetSource", - "service": { - "short_name": "SecurityCenter", - "full_name": "google.cloud.securitycenter.v2.SecurityCenter" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 46, - "type": "FULL" - } - ] - }, - { - "region_tag": "securitycenter_v2_generated_SecurityCenter_GroupFindings_sync", - "title": "Snippet for the group_findings call in the SecurityCenter service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::SecurityCenter::V2::SecurityCenter::Client#group_findings.", - "file": "security_center/group_findings.rb", - "language": "RUBY", - "client_method": { - "short_name": "group_findings", - "full_name": "::Google::Cloud::SecurityCenter::V2::SecurityCenter::Client#group_findings", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::SecurityCenter::V2::GroupFindingsRequest", - "name": "request" - } - ], - "result_type": "::Google::Cloud::SecurityCenter::V2::GroupFindingsResponse", - "client": { - "short_name": "SecurityCenter::Client", - "full_name": "::Google::Cloud::SecurityCenter::V2::SecurityCenter::Client" - }, - "method": { - "short_name": "GroupFindings", - "full_name": "google.cloud.securitycenter.v2.SecurityCenter.GroupFindings", - "service": { - "short_name": "SecurityCenter", - "full_name": "google.cloud.securitycenter.v2.SecurityCenter" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 50, - "type": "FULL" - } - ] - }, - { - "region_tag": "securitycenter_v2_generated_SecurityCenter_ListAttackPaths_sync", - "title": "Snippet for the list_attack_paths call in the SecurityCenter service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::SecurityCenter::V2::SecurityCenter::Client#list_attack_paths.", - "file": "security_center/list_attack_paths.rb", - "language": "RUBY", - "client_method": { - "short_name": "list_attack_paths", - "full_name": "::Google::Cloud::SecurityCenter::V2::SecurityCenter::Client#list_attack_paths", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::SecurityCenter::V2::ListAttackPathsRequest", - "name": "request" - } - ], - "result_type": "::Google::Cloud::SecurityCenter::V2::ListAttackPathsResponse", - "client": { - "short_name": "SecurityCenter::Client", - "full_name": "::Google::Cloud::SecurityCenter::V2::SecurityCenter::Client" - }, - "method": { - "short_name": "ListAttackPaths", - "full_name": "google.cloud.securitycenter.v2.SecurityCenter.ListAttackPaths", - "service": { - "short_name": "SecurityCenter", - "full_name": "google.cloud.securitycenter.v2.SecurityCenter" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 50, - "type": "FULL" - } - ] - }, - { - "region_tag": "securitycenter_v2_generated_SecurityCenter_ListBigQueryExports_sync", - "title": "Snippet for the list_big_query_exports call in the SecurityCenter service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::SecurityCenter::V2::SecurityCenter::Client#list_big_query_exports.", - "file": "security_center/list_big_query_exports.rb", - "language": "RUBY", - "client_method": { - "short_name": "list_big_query_exports", - "full_name": "::Google::Cloud::SecurityCenter::V2::SecurityCenter::Client#list_big_query_exports", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::SecurityCenter::V2::ListBigQueryExportsRequest", - "name": "request" - } - ], - "result_type": "::Google::Cloud::SecurityCenter::V2::ListBigQueryExportsResponse", - "client": { - "short_name": "SecurityCenter::Client", - "full_name": "::Google::Cloud::SecurityCenter::V2::SecurityCenter::Client" - }, - "method": { - "short_name": "ListBigQueryExports", - "full_name": "google.cloud.securitycenter.v2.SecurityCenter.ListBigQueryExports", - "service": { - "short_name": "SecurityCenter", - "full_name": "google.cloud.securitycenter.v2.SecurityCenter" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 50, - "type": "FULL" - } - ] - }, - { - "region_tag": "securitycenter_v2_generated_SecurityCenter_ListFindings_sync", - "title": "Snippet for the list_findings call in the SecurityCenter service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::SecurityCenter::V2::SecurityCenter::Client#list_findings.", - "file": "security_center/list_findings.rb", - "language": "RUBY", - "client_method": { - "short_name": "list_findings", - "full_name": "::Google::Cloud::SecurityCenter::V2::SecurityCenter::Client#list_findings", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::SecurityCenter::V2::ListFindingsRequest", - "name": "request" - } - ], - "result_type": "::Google::Cloud::SecurityCenter::V2::ListFindingsResponse", - "client": { - "short_name": "SecurityCenter::Client", - "full_name": "::Google::Cloud::SecurityCenter::V2::SecurityCenter::Client" - }, - "method": { - "short_name": "ListFindings", - "full_name": "google.cloud.securitycenter.v2.SecurityCenter.ListFindings", - "service": { - "short_name": "SecurityCenter", - "full_name": "google.cloud.securitycenter.v2.SecurityCenter" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 50, - "type": "FULL" - } - ] - }, - { - "region_tag": "securitycenter_v2_generated_SecurityCenter_ListMuteConfigs_sync", - "title": "Snippet for the list_mute_configs call in the SecurityCenter service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::SecurityCenter::V2::SecurityCenter::Client#list_mute_configs.", - "file": "security_center/list_mute_configs.rb", - "language": "RUBY", - "client_method": { - "short_name": "list_mute_configs", - "full_name": "::Google::Cloud::SecurityCenter::V2::SecurityCenter::Client#list_mute_configs", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::SecurityCenter::V2::ListMuteConfigsRequest", - "name": "request" - } - ], - "result_type": "::Google::Cloud::SecurityCenter::V2::ListMuteConfigsResponse", - "client": { - "short_name": "SecurityCenter::Client", - "full_name": "::Google::Cloud::SecurityCenter::V2::SecurityCenter::Client" - }, - "method": { - "short_name": "ListMuteConfigs", - "full_name": "google.cloud.securitycenter.v2.SecurityCenter.ListMuteConfigs", - "service": { - "short_name": "SecurityCenter", - "full_name": "google.cloud.securitycenter.v2.SecurityCenter" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 50, - "type": "FULL" - } - ] - }, - { - "region_tag": "securitycenter_v2_generated_SecurityCenter_ListNotificationConfigs_sync", - "title": "Snippet for the list_notification_configs call in the SecurityCenter service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::SecurityCenter::V2::SecurityCenter::Client#list_notification_configs.", - "file": "security_center/list_notification_configs.rb", - "language": "RUBY", - "client_method": { - "short_name": "list_notification_configs", - "full_name": "::Google::Cloud::SecurityCenter::V2::SecurityCenter::Client#list_notification_configs", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::SecurityCenter::V2::ListNotificationConfigsRequest", - "name": "request" - } - ], - "result_type": "::Google::Cloud::SecurityCenter::V2::ListNotificationConfigsResponse", - "client": { - "short_name": "SecurityCenter::Client", - "full_name": "::Google::Cloud::SecurityCenter::V2::SecurityCenter::Client" - }, - "method": { - "short_name": "ListNotificationConfigs", - "full_name": "google.cloud.securitycenter.v2.SecurityCenter.ListNotificationConfigs", - "service": { - "short_name": "SecurityCenter", - "full_name": "google.cloud.securitycenter.v2.SecurityCenter" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 50, - "type": "FULL" - } - ] - }, - { - "region_tag": "securitycenter_v2_generated_SecurityCenter_ListResourceValueConfigs_sync", - "title": "Snippet for the list_resource_value_configs call in the SecurityCenter service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::SecurityCenter::V2::SecurityCenter::Client#list_resource_value_configs.", - "file": "security_center/list_resource_value_configs.rb", - "language": "RUBY", - "client_method": { - "short_name": "list_resource_value_configs", - "full_name": "::Google::Cloud::SecurityCenter::V2::SecurityCenter::Client#list_resource_value_configs", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::SecurityCenter::V2::ListResourceValueConfigsRequest", - "name": "request" - } - ], - "result_type": "::Google::Cloud::SecurityCenter::V2::ListResourceValueConfigsResponse", - "client": { - "short_name": "SecurityCenter::Client", - "full_name": "::Google::Cloud::SecurityCenter::V2::SecurityCenter::Client" - }, - "method": { - "short_name": "ListResourceValueConfigs", - "full_name": "google.cloud.securitycenter.v2.SecurityCenter.ListResourceValueConfigs", - "service": { - "short_name": "SecurityCenter", - "full_name": "google.cloud.securitycenter.v2.SecurityCenter" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 50, - "type": "FULL" - } - ] - }, - { - "region_tag": "securitycenter_v2_generated_SecurityCenter_ListSources_sync", - "title": "Snippet for the list_sources call in the SecurityCenter service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::SecurityCenter::V2::SecurityCenter::Client#list_sources.", - "file": "security_center/list_sources.rb", - "language": "RUBY", - "client_method": { - "short_name": "list_sources", - "full_name": "::Google::Cloud::SecurityCenter::V2::SecurityCenter::Client#list_sources", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::SecurityCenter::V2::ListSourcesRequest", - "name": "request" - } - ], - "result_type": "::Google::Cloud::SecurityCenter::V2::ListSourcesResponse", - "client": { - "short_name": "SecurityCenter::Client", - "full_name": "::Google::Cloud::SecurityCenter::V2::SecurityCenter::Client" - }, - "method": { - "short_name": "ListSources", - "full_name": "google.cloud.securitycenter.v2.SecurityCenter.ListSources", - "service": { - "short_name": "SecurityCenter", - "full_name": "google.cloud.securitycenter.v2.SecurityCenter" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 50, - "type": "FULL" - } - ] - }, - { - "region_tag": "securitycenter_v2_generated_SecurityCenter_ListValuedResources_sync", - "title": "Snippet for the list_valued_resources call in the SecurityCenter service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::SecurityCenter::V2::SecurityCenter::Client#list_valued_resources.", - "file": "security_center/list_valued_resources.rb", - "language": "RUBY", - "client_method": { - "short_name": "list_valued_resources", - "full_name": "::Google::Cloud::SecurityCenter::V2::SecurityCenter::Client#list_valued_resources", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::SecurityCenter::V2::ListValuedResourcesRequest", - "name": "request" - } - ], - "result_type": "::Google::Cloud::SecurityCenter::V2::ListValuedResourcesResponse", - "client": { - "short_name": "SecurityCenter::Client", - "full_name": "::Google::Cloud::SecurityCenter::V2::SecurityCenter::Client" - }, - "method": { - "short_name": "ListValuedResources", - "full_name": "google.cloud.securitycenter.v2.SecurityCenter.ListValuedResources", - "service": { - "short_name": "SecurityCenter", - "full_name": "google.cloud.securitycenter.v2.SecurityCenter" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 50, - "type": "FULL" - } - ] - }, - { - "region_tag": "securitycenter_v2_generated_SecurityCenter_SetFindingState_sync", - "title": "Snippet for the set_finding_state call in the SecurityCenter service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::SecurityCenter::V2::SecurityCenter::Client#set_finding_state.", - "file": "security_center/set_finding_state.rb", - "language": "RUBY", - "client_method": { - "short_name": "set_finding_state", - "full_name": "::Google::Cloud::SecurityCenter::V2::SecurityCenter::Client#set_finding_state", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::SecurityCenter::V2::SetFindingStateRequest", - "name": "request" - } - ], - "result_type": "::Google::Cloud::SecurityCenter::V2::Finding", - "client": { - "short_name": "SecurityCenter::Client", - "full_name": "::Google::Cloud::SecurityCenter::V2::SecurityCenter::Client" - }, - "method": { - "short_name": "SetFindingState", - "full_name": "google.cloud.securitycenter.v2.SecurityCenter.SetFindingState", - "service": { - "short_name": "SecurityCenter", - "full_name": "google.cloud.securitycenter.v2.SecurityCenter" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 46, - "type": "FULL" - } - ] - }, - { - "region_tag": "securitycenter_v2_generated_SecurityCenter_SetIamPolicy_sync", - "title": "Snippet for the set_iam_policy call in the SecurityCenter service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::SecurityCenter::V2::SecurityCenter::Client#set_iam_policy.", - "file": "security_center/set_iam_policy.rb", - "language": "RUBY", - "client_method": { - "short_name": "set_iam_policy", - "full_name": "::Google::Cloud::SecurityCenter::V2::SecurityCenter::Client#set_iam_policy", - "async": false, - "parameters": [ - { - "type": "::Google::Iam::V1::SetIamPolicyRequest", - "name": "request" - } - ], - "result_type": "::Google::Iam::V1::Policy", - "client": { - "short_name": "SecurityCenter::Client", - "full_name": "::Google::Cloud::SecurityCenter::V2::SecurityCenter::Client" - }, - "method": { - "short_name": "SetIamPolicy", - "full_name": "google.cloud.securitycenter.v2.SecurityCenter.SetIamPolicy", - "service": { - "short_name": "SecurityCenter", - "full_name": "google.cloud.securitycenter.v2.SecurityCenter" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 46, - "type": "FULL" - } - ] - }, - { - "region_tag": "securitycenter_v2_generated_SecurityCenter_SetMute_sync", - "title": "Snippet for the set_mute call in the SecurityCenter service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::SecurityCenter::V2::SecurityCenter::Client#set_mute.", - "file": "security_center/set_mute.rb", - "language": "RUBY", - "client_method": { - "short_name": "set_mute", - "full_name": "::Google::Cloud::SecurityCenter::V2::SecurityCenter::Client#set_mute", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::SecurityCenter::V2::SetMuteRequest", - "name": "request" - } - ], - "result_type": "::Google::Cloud::SecurityCenter::V2::Finding", - "client": { - "short_name": "SecurityCenter::Client", - "full_name": "::Google::Cloud::SecurityCenter::V2::SecurityCenter::Client" - }, - "method": { - "short_name": "SetMute", - "full_name": "google.cloud.securitycenter.v2.SecurityCenter.SetMute", - "service": { - "short_name": "SecurityCenter", - "full_name": "google.cloud.securitycenter.v2.SecurityCenter" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 46, - "type": "FULL" - } - ] - }, - { - "region_tag": "securitycenter_v2_generated_SecurityCenter_TestIamPermissions_sync", - "title": "Snippet for the test_iam_permissions call in the SecurityCenter service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::SecurityCenter::V2::SecurityCenter::Client#test_iam_permissions.", - "file": "security_center/test_iam_permissions.rb", - "language": "RUBY", - "client_method": { - "short_name": "test_iam_permissions", - "full_name": "::Google::Cloud::SecurityCenter::V2::SecurityCenter::Client#test_iam_permissions", - "async": false, - "parameters": [ - { - "type": "::Google::Iam::V1::TestIamPermissionsRequest", - "name": "request" - } - ], - "result_type": "::Google::Iam::V1::TestIamPermissionsResponse", - "client": { - "short_name": "SecurityCenter::Client", - "full_name": "::Google::Cloud::SecurityCenter::V2::SecurityCenter::Client" - }, - "method": { - "short_name": "TestIamPermissions", - "full_name": "google.cloud.securitycenter.v2.SecurityCenter.TestIamPermissions", - "service": { - "short_name": "SecurityCenter", - "full_name": "google.cloud.securitycenter.v2.SecurityCenter" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 46, - "type": "FULL" - } - ] - }, - { - "region_tag": "securitycenter_v2_generated_SecurityCenter_UpdateBigQueryExport_sync", - "title": "Snippet for the update_big_query_export call in the SecurityCenter service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::SecurityCenter::V2::SecurityCenter::Client#update_big_query_export.", - "file": "security_center/update_big_query_export.rb", - "language": "RUBY", - "client_method": { - "short_name": "update_big_query_export", - "full_name": "::Google::Cloud::SecurityCenter::V2::SecurityCenter::Client#update_big_query_export", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::SecurityCenter::V2::UpdateBigQueryExportRequest", - "name": "request" - } - ], - "result_type": "::Google::Cloud::SecurityCenter::V2::BigQueryExport", - "client": { - "short_name": "SecurityCenter::Client", - "full_name": "::Google::Cloud::SecurityCenter::V2::SecurityCenter::Client" - }, - "method": { - "short_name": "UpdateBigQueryExport", - "full_name": "google.cloud.securitycenter.v2.SecurityCenter.UpdateBigQueryExport", - "service": { - "short_name": "SecurityCenter", - "full_name": "google.cloud.securitycenter.v2.SecurityCenter" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 46, - "type": "FULL" - } - ] - }, - { - "region_tag": "securitycenter_v2_generated_SecurityCenter_UpdateExternalSystem_sync", - "title": "Snippet for the update_external_system call in the SecurityCenter service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::SecurityCenter::V2::SecurityCenter::Client#update_external_system.", - "file": "security_center/update_external_system.rb", - "language": "RUBY", - "client_method": { - "short_name": "update_external_system", - "full_name": "::Google::Cloud::SecurityCenter::V2::SecurityCenter::Client#update_external_system", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::SecurityCenter::V2::UpdateExternalSystemRequest", - "name": "request" - } - ], - "result_type": "::Google::Cloud::SecurityCenter::V2::ExternalSystem", - "client": { - "short_name": "SecurityCenter::Client", - "full_name": "::Google::Cloud::SecurityCenter::V2::SecurityCenter::Client" - }, - "method": { - "short_name": "UpdateExternalSystem", - "full_name": "google.cloud.securitycenter.v2.SecurityCenter.UpdateExternalSystem", - "service": { - "short_name": "SecurityCenter", - "full_name": "google.cloud.securitycenter.v2.SecurityCenter" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 46, - "type": "FULL" - } - ] - }, - { - "region_tag": "securitycenter_v2_generated_SecurityCenter_UpdateFinding_sync", - "title": "Snippet for the update_finding call in the SecurityCenter service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::SecurityCenter::V2::SecurityCenter::Client#update_finding.", - "file": "security_center/update_finding.rb", - "language": "RUBY", - "client_method": { - "short_name": "update_finding", - "full_name": "::Google::Cloud::SecurityCenter::V2::SecurityCenter::Client#update_finding", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::SecurityCenter::V2::UpdateFindingRequest", - "name": "request" - } - ], - "result_type": "::Google::Cloud::SecurityCenter::V2::Finding", - "client": { - "short_name": "SecurityCenter::Client", - "full_name": "::Google::Cloud::SecurityCenter::V2::SecurityCenter::Client" - }, - "method": { - "short_name": "UpdateFinding", - "full_name": "google.cloud.securitycenter.v2.SecurityCenter.UpdateFinding", - "service": { - "short_name": "SecurityCenter", - "full_name": "google.cloud.securitycenter.v2.SecurityCenter" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 46, - "type": "FULL" - } - ] - }, - { - "region_tag": "securitycenter_v2_generated_SecurityCenter_UpdateMuteConfig_sync", - "title": "Snippet for the update_mute_config call in the SecurityCenter service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::SecurityCenter::V2::SecurityCenter::Client#update_mute_config.", - "file": "security_center/update_mute_config.rb", - "language": "RUBY", - "client_method": { - "short_name": "update_mute_config", - "full_name": "::Google::Cloud::SecurityCenter::V2::SecurityCenter::Client#update_mute_config", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::SecurityCenter::V2::UpdateMuteConfigRequest", - "name": "request" - } - ], - "result_type": "::Google::Cloud::SecurityCenter::V2::MuteConfig", - "client": { - "short_name": "SecurityCenter::Client", - "full_name": "::Google::Cloud::SecurityCenter::V2::SecurityCenter::Client" - }, - "method": { - "short_name": "UpdateMuteConfig", - "full_name": "google.cloud.securitycenter.v2.SecurityCenter.UpdateMuteConfig", - "service": { - "short_name": "SecurityCenter", - "full_name": "google.cloud.securitycenter.v2.SecurityCenter" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 46, - "type": "FULL" - } - ] - }, - { - "region_tag": "securitycenter_v2_generated_SecurityCenter_UpdateNotificationConfig_sync", - "title": "Snippet for the update_notification_config call in the SecurityCenter service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::SecurityCenter::V2::SecurityCenter::Client#update_notification_config.", - "file": "security_center/update_notification_config.rb", - "language": "RUBY", - "client_method": { - "short_name": "update_notification_config", - "full_name": "::Google::Cloud::SecurityCenter::V2::SecurityCenter::Client#update_notification_config", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::SecurityCenter::V2::UpdateNotificationConfigRequest", - "name": "request" - } - ], - "result_type": "::Google::Cloud::SecurityCenter::V2::NotificationConfig", - "client": { - "short_name": "SecurityCenter::Client", - "full_name": "::Google::Cloud::SecurityCenter::V2::SecurityCenter::Client" - }, - "method": { - "short_name": "UpdateNotificationConfig", - "full_name": "google.cloud.securitycenter.v2.SecurityCenter.UpdateNotificationConfig", - "service": { - "short_name": "SecurityCenter", - "full_name": "google.cloud.securitycenter.v2.SecurityCenter" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 46, - "type": "FULL" - } - ] - }, - { - "region_tag": "securitycenter_v2_generated_SecurityCenter_UpdateResourceValueConfig_sync", - "title": "Snippet for the update_resource_value_config call in the SecurityCenter service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::SecurityCenter::V2::SecurityCenter::Client#update_resource_value_config.", - "file": "security_center/update_resource_value_config.rb", - "language": "RUBY", - "client_method": { - "short_name": "update_resource_value_config", - "full_name": "::Google::Cloud::SecurityCenter::V2::SecurityCenter::Client#update_resource_value_config", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::SecurityCenter::V2::UpdateResourceValueConfigRequest", - "name": "request" - } - ], - "result_type": "::Google::Cloud::SecurityCenter::V2::ResourceValueConfig", - "client": { - "short_name": "SecurityCenter::Client", - "full_name": "::Google::Cloud::SecurityCenter::V2::SecurityCenter::Client" - }, - "method": { - "short_name": "UpdateResourceValueConfig", - "full_name": "google.cloud.securitycenter.v2.SecurityCenter.UpdateResourceValueConfig", - "service": { - "short_name": "SecurityCenter", - "full_name": "google.cloud.securitycenter.v2.SecurityCenter" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 46, - "type": "FULL" - } - ] - }, - { - "region_tag": "securitycenter_v2_generated_SecurityCenter_UpdateSecurityMarks_sync", - "title": "Snippet for the update_security_marks call in the SecurityCenter service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::SecurityCenter::V2::SecurityCenter::Client#update_security_marks.", - "file": "security_center/update_security_marks.rb", - "language": "RUBY", - "client_method": { - "short_name": "update_security_marks", - "full_name": "::Google::Cloud::SecurityCenter::V2::SecurityCenter::Client#update_security_marks", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::SecurityCenter::V2::UpdateSecurityMarksRequest", - "name": "request" - } - ], - "result_type": "::Google::Cloud::SecurityCenter::V2::SecurityMarks", - "client": { - "short_name": "SecurityCenter::Client", - "full_name": "::Google::Cloud::SecurityCenter::V2::SecurityCenter::Client" - }, - "method": { - "short_name": "UpdateSecurityMarks", - "full_name": "google.cloud.securitycenter.v2.SecurityCenter.UpdateSecurityMarks", - "service": { - "short_name": "SecurityCenter", - "full_name": "google.cloud.securitycenter.v2.SecurityCenter" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 46, - "type": "FULL" - } - ] - }, - { - "region_tag": "securitycenter_v2_generated_SecurityCenter_UpdateSource_sync", - "title": "Snippet for the update_source call in the SecurityCenter service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::SecurityCenter::V2::SecurityCenter::Client#update_source.", - "file": "security_center/update_source.rb", - "language": "RUBY", - "client_method": { - "short_name": "update_source", - "full_name": "::Google::Cloud::SecurityCenter::V2::SecurityCenter::Client#update_source", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::SecurityCenter::V2::UpdateSourceRequest", - "name": "request" - } - ], - "result_type": "::Google::Cloud::SecurityCenter::V2::Source", - "client": { - "short_name": "SecurityCenter::Client", - "full_name": "::Google::Cloud::SecurityCenter::V2::SecurityCenter::Client" - }, - "method": { - "short_name": "UpdateSource", - "full_name": "google.cloud.securitycenter.v2.SecurityCenter.UpdateSource", - "service": { - "short_name": "SecurityCenter", - "full_name": "google.cloud.securitycenter.v2.SecurityCenter" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 46, - "type": "FULL" - } - ] - } - ] -} \ No newline at end of file diff --git a/owl-bot-staging/google-cloud-security_center-v2/test/google/cloud/security_center/v2/security_center_operations_test.rb b/owl-bot-staging/google-cloud-security_center-v2/test/google/cloud/security_center/v2/security_center_operations_test.rb deleted file mode 100644 index 3e695306bd6f..000000000000 --- a/owl-bot-staging/google-cloud-security_center-v2/test/google/cloud/security_center/v2/security_center_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/cloud/securitycenter/v2/securitycenter_service_pb" -require "google/cloud/securitycenter/v2/securitycenter_service_services_pb" -require "google/cloud/security_center/v2/security_center" - -class ::Google::Cloud::SecurityCenter::V2::SecurityCenter::OperationsTest < Minitest::Test - class ClientStub - attr_accessor :call_rpc_count, :requests - - def initialize response, operation, &block - @response = response - @operation = operation - @block = block - @call_rpc_count = 0 - @requests = [] - end - - def call_rpc *args, **kwargs - @call_rpc_count += 1 - - @requests << @block&.call(*args, **kwargs) - - catch :response do - yield @response, @operation if block_given? - @response - end - end - - def endpoint - "endpoint.example.com" - end - - def universe_domain - "example.com" - end - - def stub_logger - nil - end - - def logger - nil - end - end - - def test_list_operations - # Create GRPC objects. - grpc_response = ::Google::Longrunning::ListOperationsResponse.new - grpc_operation = GRPC::ActiveCall::Operation.new nil - grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - grpc_options = {} - - # Create request parameters for a unary method. - name = "hello world" - filter = "hello world" - page_size = 42 - page_token = "hello world" - return_partial_success = true - - list_operations_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :list_operations, name - assert_kind_of ::Google::Longrunning::ListOperationsRequest, request - assert_equal "hello world", request["name"] - assert_equal "hello world", request["filter"] - assert_equal 42, request["page_size"] - assert_equal "hello world", request["page_token"] - assert_equal true, request["return_partial_success"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, list_operations_client_stub do - # Create client - client = ::Google::Cloud::SecurityCenter::V2::SecurityCenter::Operations.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.list_operations({ name: name, filter: filter, page_size: page_size, page_token: page_token, return_partial_success: return_partial_success }) do |response, operation| - assert_kind_of Gapic::PagedEnumerable, response - assert_equal grpc_response, response.response - assert_equal grpc_operation, operation - end - - # Use named arguments - client.list_operations name: name, filter: filter, page_size: page_size, page_token: page_token, return_partial_success: return_partial_success do |response, operation| - assert_kind_of Gapic::PagedEnumerable, response - assert_equal grpc_response, response.response - assert_equal grpc_operation, operation - end - - # Use protobuf object - client.list_operations ::Google::Longrunning::ListOperationsRequest.new(name: name, filter: filter, page_size: page_size, page_token: page_token, return_partial_success: return_partial_success) do |response, operation| - assert_kind_of Gapic::PagedEnumerable, response - assert_equal grpc_response, response.response - assert_equal grpc_operation, operation - end - - # Use hash object with options - client.list_operations({ name: name, filter: filter, page_size: page_size, page_token: page_token, return_partial_success: return_partial_success }, grpc_options) do |response, operation| - assert_kind_of Gapic::PagedEnumerable, response - assert_equal grpc_response, response.response - assert_equal grpc_operation, operation - end - - # Use protobuf object with options - client.list_operations(::Google::Longrunning::ListOperationsRequest.new(name: name, filter: filter, page_size: page_size, page_token: page_token, return_partial_success: return_partial_success), grpc_options) do |response, operation| - assert_kind_of Gapic::PagedEnumerable, response - assert_equal grpc_response, response.response - assert_equal grpc_operation, operation - end - - # Verify method calls - assert_equal 5, list_operations_client_stub.call_rpc_count - end - end - - def test_get_operation - # Create GRPC objects. - grpc_response = ::Google::Longrunning::Operation.new - grpc_operation = GRPC::ActiveCall::Operation.new nil - grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - grpc_options = {} - - # Create request parameters for a unary method. - name = "hello world" - - get_operation_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :get_operation, name - assert_kind_of ::Google::Longrunning::GetOperationRequest, request - assert_equal "hello world", request["name"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, get_operation_client_stub do - # Create client - client = ::Google::Cloud::SecurityCenter::V2::SecurityCenter::Operations.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.get_operation({ name: name }) do |response, operation| - assert_kind_of Gapic::Operation, response - assert_equal grpc_response, response.grpc_op - assert_equal grpc_operation, operation - end - - # Use named arguments - client.get_operation name: name do |response, operation| - assert_kind_of Gapic::Operation, response - assert_equal grpc_response, response.grpc_op - assert_equal grpc_operation, operation - end - - # Use protobuf object - client.get_operation ::Google::Longrunning::GetOperationRequest.new(name: name) do |response, operation| - assert_kind_of Gapic::Operation, response - assert_equal grpc_response, response.grpc_op - assert_equal grpc_operation, operation - end - - # Use hash object with options - client.get_operation({ name: name }, grpc_options) do |response, operation| - assert_kind_of Gapic::Operation, response - assert_equal grpc_response, response.grpc_op - assert_equal grpc_operation, operation - end - - # Use protobuf object with options - client.get_operation(::Google::Longrunning::GetOperationRequest.new(name: name), grpc_options) do |response, operation| - assert_kind_of Gapic::Operation, response - assert_equal grpc_response, response.grpc_op - assert_equal grpc_operation, operation - end - - # Verify method calls - assert_equal 5, get_operation_client_stub.call_rpc_count - end - end - - def test_delete_operation - # Create GRPC objects. - grpc_response = ::Google::Protobuf::Empty.new - grpc_operation = GRPC::ActiveCall::Operation.new nil - grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - grpc_options = {} - - # Create request parameters for a unary method. - name = "hello world" - - delete_operation_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :delete_operation, name - assert_kind_of ::Google::Longrunning::DeleteOperationRequest, request - assert_equal "hello world", request["name"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, delete_operation_client_stub do - # Create client - client = ::Google::Cloud::SecurityCenter::V2::SecurityCenter::Operations.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.delete_operation({ name: name }) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use named arguments - client.delete_operation name: name do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object - client.delete_operation ::Google::Longrunning::DeleteOperationRequest.new(name: name) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use hash object with options - client.delete_operation({ name: name }, grpc_options) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object with options - client.delete_operation(::Google::Longrunning::DeleteOperationRequest.new(name: name), grpc_options) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Verify method calls - assert_equal 5, delete_operation_client_stub.call_rpc_count - end - end - - def test_cancel_operation - # Create GRPC objects. - grpc_response = ::Google::Protobuf::Empty.new - grpc_operation = GRPC::ActiveCall::Operation.new nil - grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - grpc_options = {} - - # Create request parameters for a unary method. - name = "hello world" - - cancel_operation_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :cancel_operation, name - assert_kind_of ::Google::Longrunning::CancelOperationRequest, request - assert_equal "hello world", request["name"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, cancel_operation_client_stub do - # Create client - client = ::Google::Cloud::SecurityCenter::V2::SecurityCenter::Operations.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.cancel_operation({ name: name }) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use named arguments - client.cancel_operation name: name do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object - client.cancel_operation ::Google::Longrunning::CancelOperationRequest.new(name: name) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use hash object with options - client.cancel_operation({ name: name }, grpc_options) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object with options - client.cancel_operation(::Google::Longrunning::CancelOperationRequest.new(name: name), grpc_options) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Verify method calls - assert_equal 5, cancel_operation_client_stub.call_rpc_count - end - end - - def test_wait_operation - # Create GRPC objects. - grpc_response = ::Google::Longrunning::Operation.new - grpc_operation = GRPC::ActiveCall::Operation.new nil - grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - grpc_options = {} - - # Create request parameters for a unary method. - name = "hello world" - timeout = {} - - wait_operation_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :wait_operation, name - assert_kind_of ::Google::Longrunning::WaitOperationRequest, request - assert_equal "hello world", request["name"] - assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Protobuf::Duration), request["timeout"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, wait_operation_client_stub do - # Create client - client = ::Google::Cloud::SecurityCenter::V2::SecurityCenter::Operations.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.wait_operation({ name: name, timeout: timeout }) do |response, operation| - assert_kind_of Gapic::Operation, response - assert_equal grpc_response, response.grpc_op - assert_equal grpc_operation, operation - end - - # Use named arguments - client.wait_operation name: name, timeout: timeout do |response, operation| - assert_kind_of Gapic::Operation, response - assert_equal grpc_response, response.grpc_op - assert_equal grpc_operation, operation - end - - # Use protobuf object - client.wait_operation ::Google::Longrunning::WaitOperationRequest.new(name: name, timeout: timeout) do |response, operation| - assert_kind_of Gapic::Operation, response - assert_equal grpc_response, response.grpc_op - assert_equal grpc_operation, operation - end - - # Use hash object with options - client.wait_operation({ name: name, timeout: timeout }, grpc_options) do |response, operation| - assert_kind_of Gapic::Operation, response - assert_equal grpc_response, response.grpc_op - assert_equal grpc_operation, operation - end - - # Use protobuf object with options - client.wait_operation(::Google::Longrunning::WaitOperationRequest.new(name: name, timeout: timeout), grpc_options) do |response, operation| - assert_kind_of Gapic::Operation, response - assert_equal grpc_response, response.grpc_op - assert_equal grpc_operation, operation - end - - # Verify method calls - assert_equal 5, wait_operation_client_stub.call_rpc_count - end - end - - def test_configure - grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - - client = block_config = config = nil - dummy_stub = ClientStub.new nil, nil - Gapic::ServiceStub.stub :new, dummy_stub do - client = ::Google::Cloud::SecurityCenter::V2::SecurityCenter::Operations.new do |config| - config.credentials = grpc_channel - end - end - - config = client.configure do |c| - block_config = c - end - - assert_same block_config, config - assert_kind_of ::Google::Cloud::SecurityCenter::V2::SecurityCenter::Operations::Configuration, config - end -end diff --git a/owl-bot-staging/google-cloud-security_center-v2/test/google/cloud/security_center/v2/security_center_paths_test.rb b/owl-bot-staging/google-cloud-security_center-v2/test/google/cloud/security_center/v2/security_center_paths_test.rb deleted file mode 100644 index 88ac82de925a..000000000000 --- a/owl-bot-staging/google-cloud-security_center-v2/test/google/cloud/security_center/v2/security_center_paths_test.rb +++ /dev/null @@ -1,403 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -require "helper" - -require "gapic/grpc/service_stub" - -require "google/cloud/security_center/v2/security_center" - -class ::Google::Cloud::SecurityCenter::V2::SecurityCenter::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_big_query_export_path - grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - ::Gapic::ServiceStub.stub :new, DummyStub.new do - client = ::Google::Cloud::SecurityCenter::V2::SecurityCenter::Client.new do |config| - config.credentials = grpc_channel - end - - path = client.big_query_export_path organization: "value0", location: "value1", export: "value2" - assert_equal "organizations/value0/locations/value1/bigQueryExports/value2", path - - path = client.big_query_export_path folder: "value0", location: "value1", export: "value2" - assert_equal "folders/value0/locations/value1/bigQueryExports/value2", path - - path = client.big_query_export_path project: "value0", location: "value1", export: "value2" - assert_equal "projects/value0/locations/value1/bigQueryExports/value2", path - end - end - - def test_dlp_job_path - grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - ::Gapic::ServiceStub.stub :new, DummyStub.new do - client = ::Google::Cloud::SecurityCenter::V2::SecurityCenter::Client.new do |config| - config.credentials = grpc_channel - end - - path = client.dlp_job_path project: "value0", dlp_job: "value1" - assert_equal "projects/value0/dlpJobs/value1", path - - path = client.dlp_job_path project: "value0", location: "value1", dlp_job: "value2" - assert_equal "projects/value0/locations/value1/dlpJobs/value2", path - end - end - - def test_external_system_path - grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - ::Gapic::ServiceStub.stub :new, DummyStub.new do - client = ::Google::Cloud::SecurityCenter::V2::SecurityCenter::Client.new do |config| - config.credentials = grpc_channel - end - - path = client.external_system_path organization: "value0", source: "value1", finding: "value2", externalsystem: "value3" - assert_equal "organizations/value0/sources/value1/findings/value2/externalSystems/value3", path - - path = client.external_system_path organization: "value0", source: "value1", location: "value2", finding: "value3", externalsystem: "value4" - assert_equal "organizations/value0/sources/value1/locations/value2/findings/value3/externalSystems/value4", path - - path = client.external_system_path folder: "value0", source: "value1", finding: "value2", externalsystem: "value3" - assert_equal "folders/value0/sources/value1/findings/value2/externalSystems/value3", path - - path = client.external_system_path folder: "value0", source: "value1", location: "value2", finding: "value3", externalsystem: "value4" - assert_equal "folders/value0/sources/value1/locations/value2/findings/value3/externalSystems/value4", path - - path = client.external_system_path project: "value0", source: "value1", finding: "value2", externalsystem: "value3" - assert_equal "projects/value0/sources/value1/findings/value2/externalSystems/value3", path - - path = client.external_system_path project: "value0", source: "value1", location: "value2", finding: "value3", externalsystem: "value4" - assert_equal "projects/value0/sources/value1/locations/value2/findings/value3/externalSystems/value4", path - end - end - - def test_finding_path - grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - ::Gapic::ServiceStub.stub :new, DummyStub.new do - client = ::Google::Cloud::SecurityCenter::V2::SecurityCenter::Client.new do |config| - config.credentials = grpc_channel - end - - path = client.finding_path organization: "value0", source: "value1", finding: "value2" - assert_equal "organizations/value0/sources/value1/findings/value2", path - - path = client.finding_path organization: "value0", source: "value1", location: "value2", finding: "value3" - assert_equal "organizations/value0/sources/value1/locations/value2/findings/value3", path - - path = client.finding_path folder: "value0", source: "value1", finding: "value2" - assert_equal "folders/value0/sources/value1/findings/value2", path - - path = client.finding_path folder: "value0", source: "value1", location: "value2", finding: "value3" - assert_equal "folders/value0/sources/value1/locations/value2/findings/value3", path - - path = client.finding_path project: "value0", source: "value1", finding: "value2" - assert_equal "projects/value0/sources/value1/findings/value2", path - - path = client.finding_path project: "value0", source: "value1", location: "value2", finding: "value3" - assert_equal "projects/value0/sources/value1/locations/value2/findings/value3", path - end - end - - def test_folder_path - grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - ::Gapic::ServiceStub.stub :new, DummyStub.new do - client = ::Google::Cloud::SecurityCenter::V2::SecurityCenter::Client.new do |config| - config.credentials = grpc_channel - end - - path = client.folder_path folder: "value0" - assert_equal "folders/value0", 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::Cloud::SecurityCenter::V2::SecurityCenter::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::Cloud::SecurityCenter::V2::SecurityCenter::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_mute_config_path - grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - ::Gapic::ServiceStub.stub :new, DummyStub.new do - client = ::Google::Cloud::SecurityCenter::V2::SecurityCenter::Client.new do |config| - config.credentials = grpc_channel - end - - path = client.mute_config_path organization: "value0", mute_config: "value1" - assert_equal "organizations/value0/muteConfigs/value1", path - - path = client.mute_config_path organization: "value0", location: "value1", mute_config: "value2" - assert_equal "organizations/value0/locations/value1/muteConfigs/value2", path - - path = client.mute_config_path folder: "value0", mute_config: "value1" - assert_equal "folders/value0/muteConfigs/value1", path - - path = client.mute_config_path folder: "value0", location: "value1", mute_config: "value2" - assert_equal "folders/value0/locations/value1/muteConfigs/value2", path - - path = client.mute_config_path project: "value0", mute_config: "value1" - assert_equal "projects/value0/muteConfigs/value1", path - - path = client.mute_config_path project: "value0", location: "value1", mute_config: "value2" - assert_equal "projects/value0/locations/value1/muteConfigs/value2", path - end - end - - def test_notification_config_path - grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - ::Gapic::ServiceStub.stub :new, DummyStub.new do - client = ::Google::Cloud::SecurityCenter::V2::SecurityCenter::Client.new do |config| - config.credentials = grpc_channel - end - - path = client.notification_config_path organization: "value0", location: "value1", notification_config: "value2" - assert_equal "organizations/value0/locations/value1/notificationConfigs/value2", path - - path = client.notification_config_path folder: "value0", location: "value1", notification_config: "value2" - assert_equal "folders/value0/locations/value1/notificationConfigs/value2", path - - path = client.notification_config_path project: "value0", location: "value1", notification_config: "value2" - assert_equal "projects/value0/locations/value1/notificationConfigs/value2", path - end - end - - def test_organization_path - grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - ::Gapic::ServiceStub.stub :new, DummyStub.new do - client = ::Google::Cloud::SecurityCenter::V2::SecurityCenter::Client.new do |config| - config.credentials = grpc_channel - end - - path = client.organization_path organization: "value0" - assert_equal "organizations/value0", 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::Cloud::SecurityCenter::V2::SecurityCenter::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_organization_valued_resource_path - grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - ::Gapic::ServiceStub.stub :new, DummyStub.new do - client = ::Google::Cloud::SecurityCenter::V2::SecurityCenter::Client.new do |config| - config.credentials = grpc_channel - end - - path = client.organization_valued_resource_path organization: "value0", location: "value1", simulation: "value2", valued_resource: "value3" - assert_equal "organizations/value0/locations/value1/simulations/value2/valuedResources/value3", path - end - end - - def test_policy_path - grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - ::Gapic::ServiceStub.stub :new, DummyStub.new do - client = ::Google::Cloud::SecurityCenter::V2::SecurityCenter::Client.new do |config| - config.credentials = grpc_channel - end - - path = client.policy_path organization: "value0", constraint_name: "value1" - assert_equal "organizations/value0/policies/value1", path - - path = client.policy_path folder: "value0", constraint_name: "value1" - assert_equal "folders/value0/policies/value1", path - - path = client.policy_path project: "value0", constraint_name: "value1" - assert_equal "projects/value0/policies/value1", path - end - end - - def test_project_path - grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - ::Gapic::ServiceStub.stub :new, DummyStub.new do - client = ::Google::Cloud::SecurityCenter::V2::SecurityCenter::Client.new do |config| - config.credentials = grpc_channel - end - - path = client.project_path project: "value0" - assert_equal "projects/value0", path - end - end - - def test_resource_value_config_path - grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - ::Gapic::ServiceStub.stub :new, DummyStub.new do - client = ::Google::Cloud::SecurityCenter::V2::SecurityCenter::Client.new do |config| - config.credentials = grpc_channel - end - - path = client.resource_value_config_path organization: "value0", resource_value_config: "value1" - assert_equal "organizations/value0/resourceValueConfigs/value1", path - - path = client.resource_value_config_path organization: "value0", location: "value1", resource_value_config: "value2" - assert_equal "organizations/value0/locations/value1/resourceValueConfigs/value2", path - end - end - - def test_security_marks_path - grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - ::Gapic::ServiceStub.stub :new, DummyStub.new do - client = ::Google::Cloud::SecurityCenter::V2::SecurityCenter::Client.new do |config| - config.credentials = grpc_channel - end - - path = client.security_marks_path organization: "value0", asset: "value1" - assert_equal "organizations/value0/assets/value1/securityMarks", path - - path = client.security_marks_path organization: "value0", source: "value1", finding: "value2" - assert_equal "organizations/value0/sources/value1/findings/value2/securityMarks", path - - path = client.security_marks_path organization: "value0", source: "value1", location: "value2", finding: "value3" - assert_equal "organizations/value0/sources/value1/locations/value2/findings/value3/securityMarks", path - - path = client.security_marks_path folder: "value0", asset: "value1" - assert_equal "folders/value0/assets/value1/securityMarks", path - - path = client.security_marks_path folder: "value0", source: "value1", finding: "value2" - assert_equal "folders/value0/sources/value1/findings/value2/securityMarks", path - - path = client.security_marks_path folder: "value0", source: "value1", location: "value2", finding: "value3" - assert_equal "folders/value0/sources/value1/locations/value2/findings/value3/securityMarks", path - - path = client.security_marks_path project: "value0", asset: "value1" - assert_equal "projects/value0/assets/value1/securityMarks", path - - path = client.security_marks_path project: "value0", source: "value1", finding: "value2" - assert_equal "projects/value0/sources/value1/findings/value2/securityMarks", path - - path = client.security_marks_path project: "value0", source: "value1", location: "value2", finding: "value3" - assert_equal "projects/value0/sources/value1/locations/value2/findings/value3/securityMarks", path - end - end - - def test_simulation_path - grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - ::Gapic::ServiceStub.stub :new, DummyStub.new do - client = ::Google::Cloud::SecurityCenter::V2::SecurityCenter::Client.new do |config| - config.credentials = grpc_channel - end - - path = client.simulation_path organization: "value0", simulation: "value1" - assert_equal "organizations/value0/simulations/value1", path - - path = client.simulation_path organization: "value0", location: "value1", simluation: "value2" - assert_equal "organizations/value0/locations/value1/simulations/value2", path - end - end - - def test_source_path - grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - ::Gapic::ServiceStub.stub :new, DummyStub.new do - client = ::Google::Cloud::SecurityCenter::V2::SecurityCenter::Client.new do |config| - config.credentials = grpc_channel - end - - path = client.source_path organization: "value0", source: "value1" - assert_equal "organizations/value0/sources/value1", path - - path = client.source_path folder: "value0", source: "value1" - assert_equal "folders/value0/sources/value1", path - - path = client.source_path project: "value0", source: "value1" - assert_equal "projects/value0/sources/value1", path - end - end - - def test_table_data_profile_path - grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - ::Gapic::ServiceStub.stub :new, DummyStub.new do - client = ::Google::Cloud::SecurityCenter::V2::SecurityCenter::Client.new do |config| - config.credentials = grpc_channel - end - - path = client.table_data_profile_path project: "value0", table_profile: "value1" - assert_equal "projects/value0/tableProfiles/value1", path - - path = client.table_data_profile_path project: "value0", location: "value1", table_profile: "value2" - assert_equal "projects/value0/locations/value1/tableProfiles/value2", path - end - end - - def test_topic_path - grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - ::Gapic::ServiceStub.stub :new, DummyStub.new do - client = ::Google::Cloud::SecurityCenter::V2::SecurityCenter::Client.new do |config| - config.credentials = grpc_channel - end - - path = client.topic_path project: "value0", topic: "value1" - assert_equal "projects/value0/topics/value1", path - end - end - - def test_valued_resource_path - grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - ::Gapic::ServiceStub.stub :new, DummyStub.new do - client = ::Google::Cloud::SecurityCenter::V2::SecurityCenter::Client.new do |config| - config.credentials = grpc_channel - end - - path = client.valued_resource_path organization: "value0", simulation: "value1", valued_resource: "value2" - assert_equal "organizations/value0/simulations/value1/valuedResources/value2", path - - path = client.valued_resource_path organization: "value0", location: "value1", simluation: "value2", valued_resource: "value3" - assert_equal "organizations/value0/locations/value1/simulations/value2/valuedResources/value3", path - end - end -end diff --git a/owl-bot-staging/google-cloud-security_center-v2/test/google/cloud/security_center/v2/security_center_rest_test.rb b/owl-bot-staging/google-cloud-security_center-v2/test/google/cloud/security_center/v2/security_center_rest_test.rb deleted file mode 100644 index 8a9d020645be..000000000000 --- a/owl-bot-staging/google-cloud-security_center-v2/test/google/cloud/security_center/v2/security_center_rest_test.rb +++ /dev/null @@ -1,2311 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -require "helper" -require "gapic/rest" -require "google/cloud/securitycenter/v2/securitycenter_service_pb" -require "google/cloud/security_center/v2/security_center/rest" - - -class ::Google::Cloud::SecurityCenter::V2::SecurityCenter::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_batch_create_resource_value_configs - # Create test objects. - client_result = ::Google::Cloud::SecurityCenter::V2::BatchCreateResourceValueConfigsResponse.new - http_response = OpenStruct.new body: client_result.to_json - - call_options = {} - - # Create request parameters for a unary method. - parent = "hello world" - requests = [{}] - - batch_create_resource_value_configs_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| - assert options.metadata.key? :"x-goog-api-client" - assert options.metadata[:"x-goog-api-client"].include? "rest" - refute options.metadata[:"x-goog-api-client"].include? "grpc" - end - - ::Google::Cloud::SecurityCenter::V2::SecurityCenter::Rest::ServiceStub.stub :transcode_batch_create_resource_value_configs_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, batch_create_resource_value_configs_client_stub do - # Create client - client = ::Google::Cloud::SecurityCenter::V2::SecurityCenter::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - client.batch_create_resource_value_configs({ parent: parent, requests: requests }) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use named arguments - client.batch_create_resource_value_configs parent: parent, requests: requests do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object - client.batch_create_resource_value_configs ::Google::Cloud::SecurityCenter::V2::BatchCreateResourceValueConfigsRequest.new(parent: parent, requests: requests) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use hash object with options - client.batch_create_resource_value_configs({ parent: parent, requests: requests }, call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object with options - client.batch_create_resource_value_configs(::Google::Cloud::SecurityCenter::V2::BatchCreateResourceValueConfigsRequest.new(parent: parent, requests: requests), call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Verify method calls - assert_equal 5, batch_create_resource_value_configs_client_stub.call_count - end - end - end - - def test_bulk_mute_findings - # 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" - filter = "hello world" - mute_state = :MUTE_STATE_UNSPECIFIED - - bulk_mute_findings_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| - assert options.metadata.key? :"x-goog-api-client" - assert options.metadata[:"x-goog-api-client"].include? "rest" - refute options.metadata[:"x-goog-api-client"].include? "grpc" - end - - ::Google::Cloud::SecurityCenter::V2::SecurityCenter::Rest::ServiceStub.stub :transcode_bulk_mute_findings_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, bulk_mute_findings_client_stub do - # Create client - client = ::Google::Cloud::SecurityCenter::V2::SecurityCenter::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - client.bulk_mute_findings({ parent: parent, filter: filter, mute_state: mute_state }) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use named arguments - client.bulk_mute_findings parent: parent, filter: filter, mute_state: mute_state do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object - client.bulk_mute_findings ::Google::Cloud::SecurityCenter::V2::BulkMuteFindingsRequest.new(parent: parent, filter: filter, mute_state: mute_state) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use hash object with options - client.bulk_mute_findings({ parent: parent, filter: filter, mute_state: mute_state }, call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object with options - client.bulk_mute_findings(::Google::Cloud::SecurityCenter::V2::BulkMuteFindingsRequest.new(parent: parent, filter: filter, mute_state: mute_state), call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Verify method calls - assert_equal 5, bulk_mute_findings_client_stub.call_count - end - end - end - - def test_create_big_query_export - # Create test objects. - client_result = ::Google::Cloud::SecurityCenter::V2::BigQueryExport.new - http_response = OpenStruct.new body: client_result.to_json - - call_options = {} - - # Create request parameters for a unary method. - parent = "hello world" - big_query_export = {} - big_query_export_id = "hello world" - - create_big_query_export_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| - assert options.metadata.key? :"x-goog-api-client" - assert options.metadata[:"x-goog-api-client"].include? "rest" - refute options.metadata[:"x-goog-api-client"].include? "grpc" - end - - ::Google::Cloud::SecurityCenter::V2::SecurityCenter::Rest::ServiceStub.stub :transcode_create_big_query_export_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, create_big_query_export_client_stub do - # Create client - client = ::Google::Cloud::SecurityCenter::V2::SecurityCenter::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - client.create_big_query_export({ parent: parent, big_query_export: big_query_export, big_query_export_id: big_query_export_id }) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use named arguments - client.create_big_query_export parent: parent, big_query_export: big_query_export, big_query_export_id: big_query_export_id do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object - client.create_big_query_export ::Google::Cloud::SecurityCenter::V2::CreateBigQueryExportRequest.new(parent: parent, big_query_export: big_query_export, big_query_export_id: big_query_export_id) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use hash object with options - client.create_big_query_export({ parent: parent, big_query_export: big_query_export, big_query_export_id: big_query_export_id }, call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object with options - client.create_big_query_export(::Google::Cloud::SecurityCenter::V2::CreateBigQueryExportRequest.new(parent: parent, big_query_export: big_query_export, big_query_export_id: big_query_export_id), call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Verify method calls - assert_equal 5, create_big_query_export_client_stub.call_count - end - end - end - - def test_create_finding - # Create test objects. - client_result = ::Google::Cloud::SecurityCenter::V2::Finding.new - http_response = OpenStruct.new body: client_result.to_json - - call_options = {} - - # Create request parameters for a unary method. - parent = "hello world" - finding_id = "hello world" - finding = {} - - create_finding_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| - assert options.metadata.key? :"x-goog-api-client" - assert options.metadata[:"x-goog-api-client"].include? "rest" - refute options.metadata[:"x-goog-api-client"].include? "grpc" - end - - ::Google::Cloud::SecurityCenter::V2::SecurityCenter::Rest::ServiceStub.stub :transcode_create_finding_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, create_finding_client_stub do - # Create client - client = ::Google::Cloud::SecurityCenter::V2::SecurityCenter::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - client.create_finding({ parent: parent, finding_id: finding_id, finding: finding }) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use named arguments - client.create_finding parent: parent, finding_id: finding_id, finding: finding do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object - client.create_finding ::Google::Cloud::SecurityCenter::V2::CreateFindingRequest.new(parent: parent, finding_id: finding_id, finding: finding) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use hash object with options - client.create_finding({ parent: parent, finding_id: finding_id, finding: finding }, call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object with options - client.create_finding(::Google::Cloud::SecurityCenter::V2::CreateFindingRequest.new(parent: parent, finding_id: finding_id, finding: finding), call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Verify method calls - assert_equal 5, create_finding_client_stub.call_count - end - end - end - - def test_create_mute_config - # Create test objects. - client_result = ::Google::Cloud::SecurityCenter::V2::MuteConfig.new - http_response = OpenStruct.new body: client_result.to_json - - call_options = {} - - # Create request parameters for a unary method. - parent = "hello world" - mute_config = {} - mute_config_id = "hello world" - - create_mute_config_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| - assert options.metadata.key? :"x-goog-api-client" - assert options.metadata[:"x-goog-api-client"].include? "rest" - refute options.metadata[:"x-goog-api-client"].include? "grpc" - end - - ::Google::Cloud::SecurityCenter::V2::SecurityCenter::Rest::ServiceStub.stub :transcode_create_mute_config_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, create_mute_config_client_stub do - # Create client - client = ::Google::Cloud::SecurityCenter::V2::SecurityCenter::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - client.create_mute_config({ parent: parent, mute_config: mute_config, mute_config_id: mute_config_id }) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use named arguments - client.create_mute_config parent: parent, mute_config: mute_config, mute_config_id: mute_config_id do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object - client.create_mute_config ::Google::Cloud::SecurityCenter::V2::CreateMuteConfigRequest.new(parent: parent, mute_config: mute_config, mute_config_id: mute_config_id) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use hash object with options - client.create_mute_config({ parent: parent, mute_config: mute_config, mute_config_id: mute_config_id }, call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object with options - client.create_mute_config(::Google::Cloud::SecurityCenter::V2::CreateMuteConfigRequest.new(parent: parent, mute_config: mute_config, mute_config_id: mute_config_id), call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Verify method calls - assert_equal 5, create_mute_config_client_stub.call_count - end - end - end - - def test_create_notification_config - # Create test objects. - client_result = ::Google::Cloud::SecurityCenter::V2::NotificationConfig.new - http_response = OpenStruct.new body: client_result.to_json - - call_options = {} - - # Create request parameters for a unary method. - parent = "hello world" - config_id = "hello world" - notification_config = {} - - create_notification_config_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| - assert options.metadata.key? :"x-goog-api-client" - assert options.metadata[:"x-goog-api-client"].include? "rest" - refute options.metadata[:"x-goog-api-client"].include? "grpc" - end - - ::Google::Cloud::SecurityCenter::V2::SecurityCenter::Rest::ServiceStub.stub :transcode_create_notification_config_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, create_notification_config_client_stub do - # Create client - client = ::Google::Cloud::SecurityCenter::V2::SecurityCenter::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - client.create_notification_config({ parent: parent, config_id: config_id, notification_config: notification_config }) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use named arguments - client.create_notification_config parent: parent, config_id: config_id, notification_config: notification_config do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object - client.create_notification_config ::Google::Cloud::SecurityCenter::V2::CreateNotificationConfigRequest.new(parent: parent, config_id: config_id, notification_config: notification_config) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use hash object with options - client.create_notification_config({ parent: parent, config_id: config_id, notification_config: notification_config }, call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object with options - client.create_notification_config(::Google::Cloud::SecurityCenter::V2::CreateNotificationConfigRequest.new(parent: parent, config_id: config_id, notification_config: notification_config), call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Verify method calls - assert_equal 5, create_notification_config_client_stub.call_count - end - end - end - - def test_create_source - # Create test objects. - client_result = ::Google::Cloud::SecurityCenter::V2::Source.new - http_response = OpenStruct.new body: client_result.to_json - - call_options = {} - - # Create request parameters for a unary method. - parent = "hello world" - source = {} - - create_source_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| - assert options.metadata.key? :"x-goog-api-client" - assert options.metadata[:"x-goog-api-client"].include? "rest" - refute options.metadata[:"x-goog-api-client"].include? "grpc" - end - - ::Google::Cloud::SecurityCenter::V2::SecurityCenter::Rest::ServiceStub.stub :transcode_create_source_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, create_source_client_stub do - # Create client - client = ::Google::Cloud::SecurityCenter::V2::SecurityCenter::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - client.create_source({ parent: parent, source: source }) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use named arguments - client.create_source parent: parent, source: source do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object - client.create_source ::Google::Cloud::SecurityCenter::V2::CreateSourceRequest.new(parent: parent, source: source) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use hash object with options - client.create_source({ parent: parent, source: source }, call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object with options - client.create_source(::Google::Cloud::SecurityCenter::V2::CreateSourceRequest.new(parent: parent, source: source), call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Verify method calls - assert_equal 5, create_source_client_stub.call_count - end - end - end - - def test_delete_big_query_export - # Create test objects. - client_result = ::Google::Protobuf::Empty.new - http_response = OpenStruct.new body: client_result.to_json - - call_options = {} - - # Create request parameters for a unary method. - name = "hello world" - - delete_big_query_export_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| - assert options.metadata.key? :"x-goog-api-client" - assert options.metadata[:"x-goog-api-client"].include? "rest" - refute options.metadata[:"x-goog-api-client"].include? "grpc" - end - - ::Google::Cloud::SecurityCenter::V2::SecurityCenter::Rest::ServiceStub.stub :transcode_delete_big_query_export_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, delete_big_query_export_client_stub do - # Create client - client = ::Google::Cloud::SecurityCenter::V2::SecurityCenter::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - client.delete_big_query_export({ name: name }) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use named arguments - client.delete_big_query_export name: name do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object - client.delete_big_query_export ::Google::Cloud::SecurityCenter::V2::DeleteBigQueryExportRequest.new(name: name) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use hash object with options - client.delete_big_query_export({ name: name }, call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object with options - client.delete_big_query_export(::Google::Cloud::SecurityCenter::V2::DeleteBigQueryExportRequest.new(name: name), call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Verify method calls - assert_equal 5, delete_big_query_export_client_stub.call_count - end - end - end - - def test_delete_mute_config - # Create test objects. - client_result = ::Google::Protobuf::Empty.new - http_response = OpenStruct.new body: client_result.to_json - - call_options = {} - - # Create request parameters for a unary method. - name = "hello world" - - delete_mute_config_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| - assert options.metadata.key? :"x-goog-api-client" - assert options.metadata[:"x-goog-api-client"].include? "rest" - refute options.metadata[:"x-goog-api-client"].include? "grpc" - end - - ::Google::Cloud::SecurityCenter::V2::SecurityCenter::Rest::ServiceStub.stub :transcode_delete_mute_config_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, delete_mute_config_client_stub do - # Create client - client = ::Google::Cloud::SecurityCenter::V2::SecurityCenter::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - client.delete_mute_config({ name: name }) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use named arguments - client.delete_mute_config name: name do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object - client.delete_mute_config ::Google::Cloud::SecurityCenter::V2::DeleteMuteConfigRequest.new(name: name) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use hash object with options - client.delete_mute_config({ name: name }, call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object with options - client.delete_mute_config(::Google::Cloud::SecurityCenter::V2::DeleteMuteConfigRequest.new(name: name), call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Verify method calls - assert_equal 5, delete_mute_config_client_stub.call_count - end - end - end - - def test_delete_notification_config - # Create test objects. - client_result = ::Google::Protobuf::Empty.new - http_response = OpenStruct.new body: client_result.to_json - - call_options = {} - - # Create request parameters for a unary method. - name = "hello world" - - delete_notification_config_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| - assert options.metadata.key? :"x-goog-api-client" - assert options.metadata[:"x-goog-api-client"].include? "rest" - refute options.metadata[:"x-goog-api-client"].include? "grpc" - end - - ::Google::Cloud::SecurityCenter::V2::SecurityCenter::Rest::ServiceStub.stub :transcode_delete_notification_config_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, delete_notification_config_client_stub do - # Create client - client = ::Google::Cloud::SecurityCenter::V2::SecurityCenter::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - client.delete_notification_config({ name: name }) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use named arguments - client.delete_notification_config name: name do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object - client.delete_notification_config ::Google::Cloud::SecurityCenter::V2::DeleteNotificationConfigRequest.new(name: name) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use hash object with options - client.delete_notification_config({ name: name }, call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object with options - client.delete_notification_config(::Google::Cloud::SecurityCenter::V2::DeleteNotificationConfigRequest.new(name: name), call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Verify method calls - assert_equal 5, delete_notification_config_client_stub.call_count - end - end - end - - def test_delete_resource_value_config - # Create test objects. - client_result = ::Google::Protobuf::Empty.new - http_response = OpenStruct.new body: client_result.to_json - - call_options = {} - - # Create request parameters for a unary method. - name = "hello world" - - delete_resource_value_config_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| - assert options.metadata.key? :"x-goog-api-client" - assert options.metadata[:"x-goog-api-client"].include? "rest" - refute options.metadata[:"x-goog-api-client"].include? "grpc" - end - - ::Google::Cloud::SecurityCenter::V2::SecurityCenter::Rest::ServiceStub.stub :transcode_delete_resource_value_config_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, delete_resource_value_config_client_stub do - # Create client - client = ::Google::Cloud::SecurityCenter::V2::SecurityCenter::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - client.delete_resource_value_config({ name: name }) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use named arguments - client.delete_resource_value_config name: name do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object - client.delete_resource_value_config ::Google::Cloud::SecurityCenter::V2::DeleteResourceValueConfigRequest.new(name: name) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use hash object with options - client.delete_resource_value_config({ name: name }, call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object with options - client.delete_resource_value_config(::Google::Cloud::SecurityCenter::V2::DeleteResourceValueConfigRequest.new(name: name), call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Verify method calls - assert_equal 5, delete_resource_value_config_client_stub.call_count - end - end - end - - def test_get_big_query_export - # Create test objects. - client_result = ::Google::Cloud::SecurityCenter::V2::BigQueryExport.new - http_response = OpenStruct.new body: client_result.to_json - - call_options = {} - - # Create request parameters for a unary method. - name = "hello world" - - get_big_query_export_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| - assert options.metadata.key? :"x-goog-api-client" - assert options.metadata[:"x-goog-api-client"].include? "rest" - refute options.metadata[:"x-goog-api-client"].include? "grpc" - end - - ::Google::Cloud::SecurityCenter::V2::SecurityCenter::Rest::ServiceStub.stub :transcode_get_big_query_export_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, get_big_query_export_client_stub do - # Create client - client = ::Google::Cloud::SecurityCenter::V2::SecurityCenter::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - client.get_big_query_export({ name: name }) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use named arguments - client.get_big_query_export name: name do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object - client.get_big_query_export ::Google::Cloud::SecurityCenter::V2::GetBigQueryExportRequest.new(name: name) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use hash object with options - client.get_big_query_export({ name: name }, call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object with options - client.get_big_query_export(::Google::Cloud::SecurityCenter::V2::GetBigQueryExportRequest.new(name: name), call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Verify method calls - assert_equal 5, get_big_query_export_client_stub.call_count - end - end - end - - def test_get_simulation - # Create test objects. - client_result = ::Google::Cloud::SecurityCenter::V2::Simulation.new - http_response = OpenStruct.new body: client_result.to_json - - call_options = {} - - # Create request parameters for a unary method. - name = "hello world" - - get_simulation_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| - assert options.metadata.key? :"x-goog-api-client" - assert options.metadata[:"x-goog-api-client"].include? "rest" - refute options.metadata[:"x-goog-api-client"].include? "grpc" - end - - ::Google::Cloud::SecurityCenter::V2::SecurityCenter::Rest::ServiceStub.stub :transcode_get_simulation_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, get_simulation_client_stub do - # Create client - client = ::Google::Cloud::SecurityCenter::V2::SecurityCenter::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - client.get_simulation({ name: name }) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use named arguments - client.get_simulation name: name do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object - client.get_simulation ::Google::Cloud::SecurityCenter::V2::GetSimulationRequest.new(name: name) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use hash object with options - client.get_simulation({ name: name }, call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object with options - client.get_simulation(::Google::Cloud::SecurityCenter::V2::GetSimulationRequest.new(name: name), call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Verify method calls - assert_equal 5, get_simulation_client_stub.call_count - end - end - end - - def test_get_valued_resource - # Create test objects. - client_result = ::Google::Cloud::SecurityCenter::V2::ValuedResource.new - http_response = OpenStruct.new body: client_result.to_json - - call_options = {} - - # Create request parameters for a unary method. - name = "hello world" - - get_valued_resource_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| - assert options.metadata.key? :"x-goog-api-client" - assert options.metadata[:"x-goog-api-client"].include? "rest" - refute options.metadata[:"x-goog-api-client"].include? "grpc" - end - - ::Google::Cloud::SecurityCenter::V2::SecurityCenter::Rest::ServiceStub.stub :transcode_get_valued_resource_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, get_valued_resource_client_stub do - # Create client - client = ::Google::Cloud::SecurityCenter::V2::SecurityCenter::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - client.get_valued_resource({ name: name }) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use named arguments - client.get_valued_resource name: name do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object - client.get_valued_resource ::Google::Cloud::SecurityCenter::V2::GetValuedResourceRequest.new(name: name) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use hash object with options - client.get_valued_resource({ name: name }, call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object with options - client.get_valued_resource(::Google::Cloud::SecurityCenter::V2::GetValuedResourceRequest.new(name: name), call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Verify method calls - assert_equal 5, get_valued_resource_client_stub.call_count - end - end - end - - def test_get_iam_policy - # Create test objects. - client_result = ::Google::Iam::V1::Policy.new - http_response = OpenStruct.new body: client_result.to_json - - call_options = {} - - # Create request parameters for a unary method. - resource = "hello world" - options = {} - - get_iam_policy_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| - assert options.metadata.key? :"x-goog-api-client" - assert options.metadata[:"x-goog-api-client"].include? "rest" - refute options.metadata[:"x-goog-api-client"].include? "grpc" - end - - ::Google::Cloud::SecurityCenter::V2::SecurityCenter::Rest::ServiceStub.stub :transcode_get_iam_policy_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, get_iam_policy_client_stub do - # Create client - client = ::Google::Cloud::SecurityCenter::V2::SecurityCenter::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - client.get_iam_policy({ resource: resource, options: options }) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use named arguments - client.get_iam_policy resource: resource, options: options do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object - client.get_iam_policy ::Google::Iam::V1::GetIamPolicyRequest.new(resource: resource, options: options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use hash object with options - client.get_iam_policy({ resource: resource, options: options }, call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object with options - client.get_iam_policy(::Google::Iam::V1::GetIamPolicyRequest.new(resource: resource, options: options), call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Verify method calls - assert_equal 5, get_iam_policy_client_stub.call_count - end - end - end - - def test_get_mute_config - # Create test objects. - client_result = ::Google::Cloud::SecurityCenter::V2::MuteConfig.new - http_response = OpenStruct.new body: client_result.to_json - - call_options = {} - - # Create request parameters for a unary method. - name = "hello world" - - get_mute_config_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| - assert options.metadata.key? :"x-goog-api-client" - assert options.metadata[:"x-goog-api-client"].include? "rest" - refute options.metadata[:"x-goog-api-client"].include? "grpc" - end - - ::Google::Cloud::SecurityCenter::V2::SecurityCenter::Rest::ServiceStub.stub :transcode_get_mute_config_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, get_mute_config_client_stub do - # Create client - client = ::Google::Cloud::SecurityCenter::V2::SecurityCenter::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - client.get_mute_config({ name: name }) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use named arguments - client.get_mute_config name: name do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object - client.get_mute_config ::Google::Cloud::SecurityCenter::V2::GetMuteConfigRequest.new(name: name) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use hash object with options - client.get_mute_config({ name: name }, call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object with options - client.get_mute_config(::Google::Cloud::SecurityCenter::V2::GetMuteConfigRequest.new(name: name), call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Verify method calls - assert_equal 5, get_mute_config_client_stub.call_count - end - end - end - - def test_get_notification_config - # Create test objects. - client_result = ::Google::Cloud::SecurityCenter::V2::NotificationConfig.new - http_response = OpenStruct.new body: client_result.to_json - - call_options = {} - - # Create request parameters for a unary method. - name = "hello world" - - get_notification_config_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| - assert options.metadata.key? :"x-goog-api-client" - assert options.metadata[:"x-goog-api-client"].include? "rest" - refute options.metadata[:"x-goog-api-client"].include? "grpc" - end - - ::Google::Cloud::SecurityCenter::V2::SecurityCenter::Rest::ServiceStub.stub :transcode_get_notification_config_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, get_notification_config_client_stub do - # Create client - client = ::Google::Cloud::SecurityCenter::V2::SecurityCenter::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - client.get_notification_config({ name: name }) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use named arguments - client.get_notification_config name: name do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object - client.get_notification_config ::Google::Cloud::SecurityCenter::V2::GetNotificationConfigRequest.new(name: name) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use hash object with options - client.get_notification_config({ name: name }, call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object with options - client.get_notification_config(::Google::Cloud::SecurityCenter::V2::GetNotificationConfigRequest.new(name: name), call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Verify method calls - assert_equal 5, get_notification_config_client_stub.call_count - end - end - end - - def test_get_resource_value_config - # Create test objects. - client_result = ::Google::Cloud::SecurityCenter::V2::ResourceValueConfig.new - http_response = OpenStruct.new body: client_result.to_json - - call_options = {} - - # Create request parameters for a unary method. - name = "hello world" - - get_resource_value_config_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| - assert options.metadata.key? :"x-goog-api-client" - assert options.metadata[:"x-goog-api-client"].include? "rest" - refute options.metadata[:"x-goog-api-client"].include? "grpc" - end - - ::Google::Cloud::SecurityCenter::V2::SecurityCenter::Rest::ServiceStub.stub :transcode_get_resource_value_config_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, get_resource_value_config_client_stub do - # Create client - client = ::Google::Cloud::SecurityCenter::V2::SecurityCenter::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - client.get_resource_value_config({ name: name }) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use named arguments - client.get_resource_value_config name: name do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object - client.get_resource_value_config ::Google::Cloud::SecurityCenter::V2::GetResourceValueConfigRequest.new(name: name) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use hash object with options - client.get_resource_value_config({ name: name }, call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object with options - client.get_resource_value_config(::Google::Cloud::SecurityCenter::V2::GetResourceValueConfigRequest.new(name: name), call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Verify method calls - assert_equal 5, get_resource_value_config_client_stub.call_count - end - end - end - - def test_get_source - # Create test objects. - client_result = ::Google::Cloud::SecurityCenter::V2::Source.new - http_response = OpenStruct.new body: client_result.to_json - - call_options = {} - - # Create request parameters for a unary method. - name = "hello world" - - get_source_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| - assert options.metadata.key? :"x-goog-api-client" - assert options.metadata[:"x-goog-api-client"].include? "rest" - refute options.metadata[:"x-goog-api-client"].include? "grpc" - end - - ::Google::Cloud::SecurityCenter::V2::SecurityCenter::Rest::ServiceStub.stub :transcode_get_source_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, get_source_client_stub do - # Create client - client = ::Google::Cloud::SecurityCenter::V2::SecurityCenter::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - client.get_source({ name: name }) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use named arguments - client.get_source name: name do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object - client.get_source ::Google::Cloud::SecurityCenter::V2::GetSourceRequest.new(name: name) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use hash object with options - client.get_source({ name: name }, call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object with options - client.get_source(::Google::Cloud::SecurityCenter::V2::GetSourceRequest.new(name: name), call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Verify method calls - assert_equal 5, get_source_client_stub.call_count - end - end - end - - def test_group_findings - # Create test objects. - client_result = ::Google::Cloud::SecurityCenter::V2::GroupFindingsResponse.new - http_response = OpenStruct.new body: client_result.to_json - - call_options = {} - - # Create request parameters for a unary method. - parent = "hello world" - filter = "hello world" - group_by = "hello world" - page_token = "hello world" - page_size = 42 - - group_findings_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| - assert options.metadata.key? :"x-goog-api-client" - assert options.metadata[:"x-goog-api-client"].include? "rest" - refute options.metadata[:"x-goog-api-client"].include? "grpc" - end - - ::Google::Cloud::SecurityCenter::V2::SecurityCenter::Rest::ServiceStub.stub :transcode_group_findings_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, group_findings_client_stub do - # Create client - client = ::Google::Cloud::SecurityCenter::V2::SecurityCenter::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - client.group_findings({ parent: parent, filter: filter, group_by: group_by, page_token: page_token, page_size: page_size }) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use named arguments - client.group_findings parent: parent, filter: filter, group_by: group_by, page_token: page_token, page_size: page_size do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object - client.group_findings ::Google::Cloud::SecurityCenter::V2::GroupFindingsRequest.new(parent: parent, filter: filter, group_by: group_by, page_token: page_token, page_size: page_size) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use hash object with options - client.group_findings({ parent: parent, filter: filter, group_by: group_by, page_token: page_token, page_size: page_size }, call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object with options - client.group_findings(::Google::Cloud::SecurityCenter::V2::GroupFindingsRequest.new(parent: parent, filter: filter, group_by: group_by, page_token: page_token, page_size: page_size), call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Verify method calls - assert_equal 5, group_findings_client_stub.call_count - end - end - end - - def test_list_attack_paths - # Create test objects. - client_result = ::Google::Cloud::SecurityCenter::V2::ListAttackPathsResponse.new - http_response = OpenStruct.new body: client_result.to_json - - call_options = {} - - # Create request parameters for a unary method. - parent = "hello world" - filter = "hello world" - page_token = "hello world" - page_size = 42 - - list_attack_paths_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| - assert options.metadata.key? :"x-goog-api-client" - assert options.metadata[:"x-goog-api-client"].include? "rest" - refute options.metadata[:"x-goog-api-client"].include? "grpc" - end - - ::Google::Cloud::SecurityCenter::V2::SecurityCenter::Rest::ServiceStub.stub :transcode_list_attack_paths_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, list_attack_paths_client_stub do - # Create client - client = ::Google::Cloud::SecurityCenter::V2::SecurityCenter::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - client.list_attack_paths({ parent: parent, filter: filter, page_token: page_token, page_size: page_size }) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use named arguments - client.list_attack_paths parent: parent, filter: filter, page_token: page_token, page_size: page_size do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object - client.list_attack_paths ::Google::Cloud::SecurityCenter::V2::ListAttackPathsRequest.new(parent: parent, filter: filter, page_token: page_token, page_size: page_size) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use hash object with options - client.list_attack_paths({ parent: parent, filter: filter, page_token: page_token, page_size: page_size }, call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object with options - client.list_attack_paths(::Google::Cloud::SecurityCenter::V2::ListAttackPathsRequest.new(parent: parent, filter: filter, page_token: page_token, page_size: page_size), call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Verify method calls - assert_equal 5, list_attack_paths_client_stub.call_count - end - end - end - - def test_list_big_query_exports - # Create test objects. - client_result = ::Google::Cloud::SecurityCenter::V2::ListBigQueryExportsResponse.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_big_query_exports_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| - assert options.metadata.key? :"x-goog-api-client" - assert options.metadata[:"x-goog-api-client"].include? "rest" - refute options.metadata[:"x-goog-api-client"].include? "grpc" - end - - ::Google::Cloud::SecurityCenter::V2::SecurityCenter::Rest::ServiceStub.stub :transcode_list_big_query_exports_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, list_big_query_exports_client_stub do - # Create client - client = ::Google::Cloud::SecurityCenter::V2::SecurityCenter::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - client.list_big_query_exports({ 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_big_query_exports 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_big_query_exports ::Google::Cloud::SecurityCenter::V2::ListBigQueryExportsRequest.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_big_query_exports({ 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_big_query_exports(::Google::Cloud::SecurityCenter::V2::ListBigQueryExportsRequest.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_big_query_exports_client_stub.call_count - end - end - end - - def test_list_findings - # Create test objects. - client_result = ::Google::Cloud::SecurityCenter::V2::ListFindingsResponse.new - http_response = OpenStruct.new body: client_result.to_json - - call_options = {} - - # Create request parameters for a unary method. - parent = "hello world" - filter = "hello world" - order_by = "hello world" - field_mask = {} - page_token = "hello world" - page_size = 42 - - list_findings_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| - assert options.metadata.key? :"x-goog-api-client" - assert options.metadata[:"x-goog-api-client"].include? "rest" - refute options.metadata[:"x-goog-api-client"].include? "grpc" - end - - ::Google::Cloud::SecurityCenter::V2::SecurityCenter::Rest::ServiceStub.stub :transcode_list_findings_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, list_findings_client_stub do - # Create client - client = ::Google::Cloud::SecurityCenter::V2::SecurityCenter::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - client.list_findings({ parent: parent, filter: filter, order_by: order_by, field_mask: field_mask, page_token: page_token, page_size: page_size }) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use named arguments - client.list_findings parent: parent, filter: filter, order_by: order_by, field_mask: field_mask, page_token: page_token, page_size: page_size do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object - client.list_findings ::Google::Cloud::SecurityCenter::V2::ListFindingsRequest.new(parent: parent, filter: filter, order_by: order_by, field_mask: field_mask, page_token: page_token, page_size: page_size) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use hash object with options - client.list_findings({ parent: parent, filter: filter, order_by: order_by, field_mask: field_mask, page_token: page_token, page_size: page_size }, call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object with options - client.list_findings(::Google::Cloud::SecurityCenter::V2::ListFindingsRequest.new(parent: parent, filter: filter, order_by: order_by, field_mask: field_mask, page_token: page_token, page_size: page_size), call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Verify method calls - assert_equal 5, list_findings_client_stub.call_count - end - end - end - - def test_list_mute_configs - # Create test objects. - client_result = ::Google::Cloud::SecurityCenter::V2::ListMuteConfigsResponse.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_mute_configs_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| - assert options.metadata.key? :"x-goog-api-client" - assert options.metadata[:"x-goog-api-client"].include? "rest" - refute options.metadata[:"x-goog-api-client"].include? "grpc" - end - - ::Google::Cloud::SecurityCenter::V2::SecurityCenter::Rest::ServiceStub.stub :transcode_list_mute_configs_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, list_mute_configs_client_stub do - # Create client - client = ::Google::Cloud::SecurityCenter::V2::SecurityCenter::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - client.list_mute_configs({ 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_mute_configs 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_mute_configs ::Google::Cloud::SecurityCenter::V2::ListMuteConfigsRequest.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_mute_configs({ 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_mute_configs(::Google::Cloud::SecurityCenter::V2::ListMuteConfigsRequest.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_mute_configs_client_stub.call_count - end - end - end - - def test_list_notification_configs - # Create test objects. - client_result = ::Google::Cloud::SecurityCenter::V2::ListNotificationConfigsResponse.new - http_response = OpenStruct.new body: client_result.to_json - - call_options = {} - - # Create request parameters for a unary method. - parent = "hello world" - page_token = "hello world" - page_size = 42 - - list_notification_configs_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| - assert options.metadata.key? :"x-goog-api-client" - assert options.metadata[:"x-goog-api-client"].include? "rest" - refute options.metadata[:"x-goog-api-client"].include? "grpc" - end - - ::Google::Cloud::SecurityCenter::V2::SecurityCenter::Rest::ServiceStub.stub :transcode_list_notification_configs_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, list_notification_configs_client_stub do - # Create client - client = ::Google::Cloud::SecurityCenter::V2::SecurityCenter::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - client.list_notification_configs({ parent: parent, page_token: page_token, page_size: page_size }) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use named arguments - client.list_notification_configs parent: parent, page_token: page_token, page_size: page_size do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object - client.list_notification_configs ::Google::Cloud::SecurityCenter::V2::ListNotificationConfigsRequest.new(parent: parent, page_token: page_token, page_size: page_size) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use hash object with options - client.list_notification_configs({ parent: parent, page_token: page_token, page_size: page_size }, call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object with options - client.list_notification_configs(::Google::Cloud::SecurityCenter::V2::ListNotificationConfigsRequest.new(parent: parent, page_token: page_token, page_size: page_size), call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Verify method calls - assert_equal 5, list_notification_configs_client_stub.call_count - end - end - end - - def test_list_resource_value_configs - # Create test objects. - client_result = ::Google::Cloud::SecurityCenter::V2::ListResourceValueConfigsResponse.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_resource_value_configs_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| - assert options.metadata.key? :"x-goog-api-client" - assert options.metadata[:"x-goog-api-client"].include? "rest" - refute options.metadata[:"x-goog-api-client"].include? "grpc" - end - - ::Google::Cloud::SecurityCenter::V2::SecurityCenter::Rest::ServiceStub.stub :transcode_list_resource_value_configs_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, list_resource_value_configs_client_stub do - # Create client - client = ::Google::Cloud::SecurityCenter::V2::SecurityCenter::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - client.list_resource_value_configs({ 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_resource_value_configs 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_resource_value_configs ::Google::Cloud::SecurityCenter::V2::ListResourceValueConfigsRequest.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_resource_value_configs({ 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_resource_value_configs(::Google::Cloud::SecurityCenter::V2::ListResourceValueConfigsRequest.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_resource_value_configs_client_stub.call_count - end - end - end - - def test_list_sources - # Create test objects. - client_result = ::Google::Cloud::SecurityCenter::V2::ListSourcesResponse.new - http_response = OpenStruct.new body: client_result.to_json - - call_options = {} - - # Create request parameters for a unary method. - parent = "hello world" - page_token = "hello world" - page_size = 42 - - list_sources_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| - assert options.metadata.key? :"x-goog-api-client" - assert options.metadata[:"x-goog-api-client"].include? "rest" - refute options.metadata[:"x-goog-api-client"].include? "grpc" - end - - ::Google::Cloud::SecurityCenter::V2::SecurityCenter::Rest::ServiceStub.stub :transcode_list_sources_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, list_sources_client_stub do - # Create client - client = ::Google::Cloud::SecurityCenter::V2::SecurityCenter::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - client.list_sources({ parent: parent, page_token: page_token, page_size: page_size }) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use named arguments - client.list_sources parent: parent, page_token: page_token, page_size: page_size do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object - client.list_sources ::Google::Cloud::SecurityCenter::V2::ListSourcesRequest.new(parent: parent, page_token: page_token, page_size: page_size) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use hash object with options - client.list_sources({ parent: parent, page_token: page_token, page_size: page_size }, call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object with options - client.list_sources(::Google::Cloud::SecurityCenter::V2::ListSourcesRequest.new(parent: parent, page_token: page_token, page_size: page_size), call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Verify method calls - assert_equal 5, list_sources_client_stub.call_count - end - end - end - - def test_list_valued_resources - # Create test objects. - client_result = ::Google::Cloud::SecurityCenter::V2::ListValuedResourcesResponse.new - http_response = OpenStruct.new body: client_result.to_json - - call_options = {} - - # Create request parameters for a unary method. - parent = "hello world" - filter = "hello world" - page_token = "hello world" - page_size = 42 - order_by = "hello world" - - list_valued_resources_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| - assert options.metadata.key? :"x-goog-api-client" - assert options.metadata[:"x-goog-api-client"].include? "rest" - refute options.metadata[:"x-goog-api-client"].include? "grpc" - end - - ::Google::Cloud::SecurityCenter::V2::SecurityCenter::Rest::ServiceStub.stub :transcode_list_valued_resources_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, list_valued_resources_client_stub do - # Create client - client = ::Google::Cloud::SecurityCenter::V2::SecurityCenter::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - client.list_valued_resources({ parent: parent, filter: filter, page_token: page_token, page_size: page_size, order_by: order_by }) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use named arguments - client.list_valued_resources parent: parent, filter: filter, page_token: page_token, page_size: page_size, order_by: order_by do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object - client.list_valued_resources ::Google::Cloud::SecurityCenter::V2::ListValuedResourcesRequest.new(parent: parent, filter: filter, page_token: page_token, page_size: page_size, order_by: order_by) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use hash object with options - client.list_valued_resources({ parent: parent, filter: filter, page_token: page_token, page_size: page_size, order_by: order_by }, call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object with options - client.list_valued_resources(::Google::Cloud::SecurityCenter::V2::ListValuedResourcesRequest.new(parent: parent, filter: filter, page_token: page_token, page_size: page_size, order_by: order_by), call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Verify method calls - assert_equal 5, list_valued_resources_client_stub.call_count - end - end - end - - def test_set_finding_state - # Create test objects. - client_result = ::Google::Cloud::SecurityCenter::V2::Finding.new - http_response = OpenStruct.new body: client_result.to_json - - call_options = {} - - # Create request parameters for a unary method. - name = "hello world" - state = :STATE_UNSPECIFIED - - set_finding_state_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| - assert options.metadata.key? :"x-goog-api-client" - assert options.metadata[:"x-goog-api-client"].include? "rest" - refute options.metadata[:"x-goog-api-client"].include? "grpc" - end - - ::Google::Cloud::SecurityCenter::V2::SecurityCenter::Rest::ServiceStub.stub :transcode_set_finding_state_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, set_finding_state_client_stub do - # Create client - client = ::Google::Cloud::SecurityCenter::V2::SecurityCenter::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - client.set_finding_state({ name: name, state: state }) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use named arguments - client.set_finding_state name: name, state: state do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object - client.set_finding_state ::Google::Cloud::SecurityCenter::V2::SetFindingStateRequest.new(name: name, state: state) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use hash object with options - client.set_finding_state({ name: name, state: state }, call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object with options - client.set_finding_state(::Google::Cloud::SecurityCenter::V2::SetFindingStateRequest.new(name: name, state: state), call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Verify method calls - assert_equal 5, set_finding_state_client_stub.call_count - end - end - end - - def test_set_iam_policy - # Create test objects. - client_result = ::Google::Iam::V1::Policy.new - http_response = OpenStruct.new body: client_result.to_json - - call_options = {} - - # Create request parameters for a unary method. - resource = "hello world" - policy = {} - update_mask = {} - - set_iam_policy_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| - assert options.metadata.key? :"x-goog-api-client" - assert options.metadata[:"x-goog-api-client"].include? "rest" - refute options.metadata[:"x-goog-api-client"].include? "grpc" - end - - ::Google::Cloud::SecurityCenter::V2::SecurityCenter::Rest::ServiceStub.stub :transcode_set_iam_policy_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, set_iam_policy_client_stub do - # Create client - client = ::Google::Cloud::SecurityCenter::V2::SecurityCenter::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - client.set_iam_policy({ resource: resource, policy: policy, update_mask: update_mask }) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use named arguments - client.set_iam_policy resource: resource, policy: policy, update_mask: update_mask do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object - client.set_iam_policy ::Google::Iam::V1::SetIamPolicyRequest.new(resource: resource, policy: policy, update_mask: update_mask) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use hash object with options - client.set_iam_policy({ resource: resource, policy: policy, update_mask: update_mask }, call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object with options - client.set_iam_policy(::Google::Iam::V1::SetIamPolicyRequest.new(resource: resource, policy: policy, update_mask: update_mask), call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Verify method calls - assert_equal 5, set_iam_policy_client_stub.call_count - end - end - end - - def test_set_mute - # Create test objects. - client_result = ::Google::Cloud::SecurityCenter::V2::Finding.new - http_response = OpenStruct.new body: client_result.to_json - - call_options = {} - - # Create request parameters for a unary method. - name = "hello world" - mute = :MUTE_UNSPECIFIED - - set_mute_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| - assert options.metadata.key? :"x-goog-api-client" - assert options.metadata[:"x-goog-api-client"].include? "rest" - refute options.metadata[:"x-goog-api-client"].include? "grpc" - end - - ::Google::Cloud::SecurityCenter::V2::SecurityCenter::Rest::ServiceStub.stub :transcode_set_mute_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, set_mute_client_stub do - # Create client - client = ::Google::Cloud::SecurityCenter::V2::SecurityCenter::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - client.set_mute({ name: name, mute: mute }) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use named arguments - client.set_mute name: name, mute: mute do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object - client.set_mute ::Google::Cloud::SecurityCenter::V2::SetMuteRequest.new(name: name, mute: mute) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use hash object with options - client.set_mute({ name: name, mute: mute }, call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object with options - client.set_mute(::Google::Cloud::SecurityCenter::V2::SetMuteRequest.new(name: name, mute: mute), call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Verify method calls - assert_equal 5, set_mute_client_stub.call_count - end - end - end - - def test_test_iam_permissions - # Create test objects. - client_result = ::Google::Iam::V1::TestIamPermissionsResponse.new - http_response = OpenStruct.new body: client_result.to_json - - call_options = {} - - # Create request parameters for a unary method. - resource = "hello world" - permissions = ["hello world"] - - test_iam_permissions_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| - assert options.metadata.key? :"x-goog-api-client" - assert options.metadata[:"x-goog-api-client"].include? "rest" - refute options.metadata[:"x-goog-api-client"].include? "grpc" - end - - ::Google::Cloud::SecurityCenter::V2::SecurityCenter::Rest::ServiceStub.stub :transcode_test_iam_permissions_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, test_iam_permissions_client_stub do - # Create client - client = ::Google::Cloud::SecurityCenter::V2::SecurityCenter::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - client.test_iam_permissions({ resource: resource, permissions: permissions }) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use named arguments - client.test_iam_permissions resource: resource, permissions: permissions do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object - client.test_iam_permissions ::Google::Iam::V1::TestIamPermissionsRequest.new(resource: resource, permissions: permissions) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use hash object with options - client.test_iam_permissions({ resource: resource, permissions: permissions }, call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object with options - client.test_iam_permissions(::Google::Iam::V1::TestIamPermissionsRequest.new(resource: resource, permissions: permissions), call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Verify method calls - assert_equal 5, test_iam_permissions_client_stub.call_count - end - end - end - - def test_update_big_query_export - # Create test objects. - client_result = ::Google::Cloud::SecurityCenter::V2::BigQueryExport.new - http_response = OpenStruct.new body: client_result.to_json - - call_options = {} - - # Create request parameters for a unary method. - big_query_export = {} - update_mask = {} - - update_big_query_export_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| - assert options.metadata.key? :"x-goog-api-client" - assert options.metadata[:"x-goog-api-client"].include? "rest" - refute options.metadata[:"x-goog-api-client"].include? "grpc" - end - - ::Google::Cloud::SecurityCenter::V2::SecurityCenter::Rest::ServiceStub.stub :transcode_update_big_query_export_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, update_big_query_export_client_stub do - # Create client - client = ::Google::Cloud::SecurityCenter::V2::SecurityCenter::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - client.update_big_query_export({ big_query_export: big_query_export, update_mask: update_mask }) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use named arguments - client.update_big_query_export big_query_export: big_query_export, update_mask: update_mask do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object - client.update_big_query_export ::Google::Cloud::SecurityCenter::V2::UpdateBigQueryExportRequest.new(big_query_export: big_query_export, update_mask: update_mask) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use hash object with options - client.update_big_query_export({ big_query_export: big_query_export, update_mask: update_mask }, call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object with options - client.update_big_query_export(::Google::Cloud::SecurityCenter::V2::UpdateBigQueryExportRequest.new(big_query_export: big_query_export, update_mask: update_mask), call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Verify method calls - assert_equal 5, update_big_query_export_client_stub.call_count - end - end - end - - def test_update_external_system - # Create test objects. - client_result = ::Google::Cloud::SecurityCenter::V2::ExternalSystem.new - http_response = OpenStruct.new body: client_result.to_json - - call_options = {} - - # Create request parameters for a unary method. - external_system = {} - update_mask = {} - - update_external_system_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| - assert options.metadata.key? :"x-goog-api-client" - assert options.metadata[:"x-goog-api-client"].include? "rest" - refute options.metadata[:"x-goog-api-client"].include? "grpc" - end - - ::Google::Cloud::SecurityCenter::V2::SecurityCenter::Rest::ServiceStub.stub :transcode_update_external_system_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, update_external_system_client_stub do - # Create client - client = ::Google::Cloud::SecurityCenter::V2::SecurityCenter::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - client.update_external_system({ external_system: external_system, update_mask: update_mask }) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use named arguments - client.update_external_system external_system: external_system, update_mask: update_mask do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object - client.update_external_system ::Google::Cloud::SecurityCenter::V2::UpdateExternalSystemRequest.new(external_system: external_system, update_mask: update_mask) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use hash object with options - client.update_external_system({ external_system: external_system, update_mask: update_mask }, call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object with options - client.update_external_system(::Google::Cloud::SecurityCenter::V2::UpdateExternalSystemRequest.new(external_system: external_system, update_mask: update_mask), call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Verify method calls - assert_equal 5, update_external_system_client_stub.call_count - end - end - end - - def test_update_finding - # Create test objects. - client_result = ::Google::Cloud::SecurityCenter::V2::Finding.new - http_response = OpenStruct.new body: client_result.to_json - - call_options = {} - - # Create request parameters for a unary method. - finding = {} - update_mask = {} - - update_finding_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| - assert options.metadata.key? :"x-goog-api-client" - assert options.metadata[:"x-goog-api-client"].include? "rest" - refute options.metadata[:"x-goog-api-client"].include? "grpc" - end - - ::Google::Cloud::SecurityCenter::V2::SecurityCenter::Rest::ServiceStub.stub :transcode_update_finding_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, update_finding_client_stub do - # Create client - client = ::Google::Cloud::SecurityCenter::V2::SecurityCenter::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - client.update_finding({ finding: finding, update_mask: update_mask }) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use named arguments - client.update_finding finding: finding, update_mask: update_mask do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object - client.update_finding ::Google::Cloud::SecurityCenter::V2::UpdateFindingRequest.new(finding: finding, update_mask: update_mask) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use hash object with options - client.update_finding({ finding: finding, update_mask: update_mask }, call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object with options - client.update_finding(::Google::Cloud::SecurityCenter::V2::UpdateFindingRequest.new(finding: finding, update_mask: update_mask), call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Verify method calls - assert_equal 5, update_finding_client_stub.call_count - end - end - end - - def test_update_mute_config - # Create test objects. - client_result = ::Google::Cloud::SecurityCenter::V2::MuteConfig.new - http_response = OpenStruct.new body: client_result.to_json - - call_options = {} - - # Create request parameters for a unary method. - mute_config = {} - update_mask = {} - - update_mute_config_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| - assert options.metadata.key? :"x-goog-api-client" - assert options.metadata[:"x-goog-api-client"].include? "rest" - refute options.metadata[:"x-goog-api-client"].include? "grpc" - end - - ::Google::Cloud::SecurityCenter::V2::SecurityCenter::Rest::ServiceStub.stub :transcode_update_mute_config_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, update_mute_config_client_stub do - # Create client - client = ::Google::Cloud::SecurityCenter::V2::SecurityCenter::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - client.update_mute_config({ mute_config: mute_config, update_mask: update_mask }) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use named arguments - client.update_mute_config mute_config: mute_config, update_mask: update_mask do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object - client.update_mute_config ::Google::Cloud::SecurityCenter::V2::UpdateMuteConfigRequest.new(mute_config: mute_config, update_mask: update_mask) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use hash object with options - client.update_mute_config({ mute_config: mute_config, update_mask: update_mask }, call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object with options - client.update_mute_config(::Google::Cloud::SecurityCenter::V2::UpdateMuteConfigRequest.new(mute_config: mute_config, update_mask: update_mask), call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Verify method calls - assert_equal 5, update_mute_config_client_stub.call_count - end - end - end - - def test_update_notification_config - # Create test objects. - client_result = ::Google::Cloud::SecurityCenter::V2::NotificationConfig.new - http_response = OpenStruct.new body: client_result.to_json - - call_options = {} - - # Create request parameters for a unary method. - notification_config = {} - update_mask = {} - - update_notification_config_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| - assert options.metadata.key? :"x-goog-api-client" - assert options.metadata[:"x-goog-api-client"].include? "rest" - refute options.metadata[:"x-goog-api-client"].include? "grpc" - end - - ::Google::Cloud::SecurityCenter::V2::SecurityCenter::Rest::ServiceStub.stub :transcode_update_notification_config_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, update_notification_config_client_stub do - # Create client - client = ::Google::Cloud::SecurityCenter::V2::SecurityCenter::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - client.update_notification_config({ notification_config: notification_config, update_mask: update_mask }) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use named arguments - client.update_notification_config notification_config: notification_config, update_mask: update_mask do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object - client.update_notification_config ::Google::Cloud::SecurityCenter::V2::UpdateNotificationConfigRequest.new(notification_config: notification_config, update_mask: update_mask) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use hash object with options - client.update_notification_config({ notification_config: notification_config, update_mask: update_mask }, call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object with options - client.update_notification_config(::Google::Cloud::SecurityCenter::V2::UpdateNotificationConfigRequest.new(notification_config: notification_config, update_mask: update_mask), call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Verify method calls - assert_equal 5, update_notification_config_client_stub.call_count - end - end - end - - def test_update_resource_value_config - # Create test objects. - client_result = ::Google::Cloud::SecurityCenter::V2::ResourceValueConfig.new - http_response = OpenStruct.new body: client_result.to_json - - call_options = {} - - # Create request parameters for a unary method. - resource_value_config = {} - update_mask = {} - - update_resource_value_config_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| - assert options.metadata.key? :"x-goog-api-client" - assert options.metadata[:"x-goog-api-client"].include? "rest" - refute options.metadata[:"x-goog-api-client"].include? "grpc" - end - - ::Google::Cloud::SecurityCenter::V2::SecurityCenter::Rest::ServiceStub.stub :transcode_update_resource_value_config_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, update_resource_value_config_client_stub do - # Create client - client = ::Google::Cloud::SecurityCenter::V2::SecurityCenter::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - client.update_resource_value_config({ resource_value_config: resource_value_config, update_mask: update_mask }) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use named arguments - client.update_resource_value_config resource_value_config: resource_value_config, update_mask: update_mask do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object - client.update_resource_value_config ::Google::Cloud::SecurityCenter::V2::UpdateResourceValueConfigRequest.new(resource_value_config: resource_value_config, update_mask: update_mask) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use hash object with options - client.update_resource_value_config({ resource_value_config: resource_value_config, update_mask: update_mask }, call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object with options - client.update_resource_value_config(::Google::Cloud::SecurityCenter::V2::UpdateResourceValueConfigRequest.new(resource_value_config: resource_value_config, update_mask: update_mask), call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Verify method calls - assert_equal 5, update_resource_value_config_client_stub.call_count - end - end - end - - def test_update_security_marks - # Create test objects. - client_result = ::Google::Cloud::SecurityCenter::V2::SecurityMarks.new - http_response = OpenStruct.new body: client_result.to_json - - call_options = {} - - # Create request parameters for a unary method. - security_marks = {} - update_mask = {} - - update_security_marks_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| - assert options.metadata.key? :"x-goog-api-client" - assert options.metadata[:"x-goog-api-client"].include? "rest" - refute options.metadata[:"x-goog-api-client"].include? "grpc" - end - - ::Google::Cloud::SecurityCenter::V2::SecurityCenter::Rest::ServiceStub.stub :transcode_update_security_marks_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, update_security_marks_client_stub do - # Create client - client = ::Google::Cloud::SecurityCenter::V2::SecurityCenter::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - client.update_security_marks({ security_marks: security_marks, update_mask: update_mask }) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use named arguments - client.update_security_marks security_marks: security_marks, update_mask: update_mask do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object - client.update_security_marks ::Google::Cloud::SecurityCenter::V2::UpdateSecurityMarksRequest.new(security_marks: security_marks, update_mask: update_mask) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use hash object with options - client.update_security_marks({ security_marks: security_marks, update_mask: update_mask }, call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object with options - client.update_security_marks(::Google::Cloud::SecurityCenter::V2::UpdateSecurityMarksRequest.new(security_marks: security_marks, update_mask: update_mask), call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Verify method calls - assert_equal 5, update_security_marks_client_stub.call_count - end - end - end - - def test_update_source - # Create test objects. - client_result = ::Google::Cloud::SecurityCenter::V2::Source.new - http_response = OpenStruct.new body: client_result.to_json - - call_options = {} - - # Create request parameters for a unary method. - source = {} - update_mask = {} - - update_source_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| - assert options.metadata.key? :"x-goog-api-client" - assert options.metadata[:"x-goog-api-client"].include? "rest" - refute options.metadata[:"x-goog-api-client"].include? "grpc" - end - - ::Google::Cloud::SecurityCenter::V2::SecurityCenter::Rest::ServiceStub.stub :transcode_update_source_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, update_source_client_stub do - # Create client - client = ::Google::Cloud::SecurityCenter::V2::SecurityCenter::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - client.update_source({ source: source, update_mask: update_mask }) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use named arguments - client.update_source source: source, update_mask: update_mask do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object - client.update_source ::Google::Cloud::SecurityCenter::V2::UpdateSourceRequest.new(source: source, update_mask: update_mask) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use hash object with options - client.update_source({ source: source, update_mask: update_mask }, call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object with options - client.update_source(::Google::Cloud::SecurityCenter::V2::UpdateSourceRequest.new(source: source, update_mask: update_mask), call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Verify method calls - assert_equal 5, update_source_client_stub.call_count - end - end - end - - def test_configure - credentials_token = :dummy_value - - client = block_config = config = nil - dummy_stub = ClientStub.new nil - Gapic::Rest::ClientStub.stub :new, dummy_stub do - client = ::Google::Cloud::SecurityCenter::V2::SecurityCenter::Rest::Client.new do |config| - config.credentials = credentials_token - end - end - - config = client.configure do |c| - block_config = c - end - - assert_same block_config, config - assert_kind_of ::Google::Cloud::SecurityCenter::V2::SecurityCenter::Rest::Client::Configuration, config - end -end diff --git a/owl-bot-staging/google-cloud-security_center-v2/test/google/cloud/security_center/v2/security_center_test.rb b/owl-bot-staging/google-cloud-security_center-v2/test/google/cloud/security_center/v2/security_center_test.rb deleted file mode 100644 index 2dcc90bc8f45..000000000000 --- a/owl-bot-staging/google-cloud-security_center-v2/test/google/cloud/security_center/v2/security_center_test.rb +++ /dev/null @@ -1,2592 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -require "helper" - -require "gapic/grpc/service_stub" - -require "google/cloud/securitycenter/v2/securitycenter_service_pb" -require "google/cloud/security_center/v2/security_center" - -class ::Google::Cloud::SecurityCenter::V2::SecurityCenter::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_batch_create_resource_value_configs - # Create GRPC objects. - grpc_response = ::Google::Cloud::SecurityCenter::V2::BatchCreateResourceValueConfigsResponse.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" - requests = [{}] - - batch_create_resource_value_configs_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :batch_create_resource_value_configs, name - assert_kind_of ::Google::Cloud::SecurityCenter::V2::BatchCreateResourceValueConfigsRequest, request - assert_equal "hello world", request["parent"] - assert_kind_of ::Google::Cloud::SecurityCenter::V2::CreateResourceValueConfigRequest, request["requests"].first - refute_nil options - end - - Gapic::ServiceStub.stub :new, batch_create_resource_value_configs_client_stub do - # Create client - client = ::Google::Cloud::SecurityCenter::V2::SecurityCenter::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.batch_create_resource_value_configs({ parent: parent, requests: requests }) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use named arguments - client.batch_create_resource_value_configs parent: parent, requests: requests do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object - client.batch_create_resource_value_configs ::Google::Cloud::SecurityCenter::V2::BatchCreateResourceValueConfigsRequest.new(parent: parent, requests: requests) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use hash object with options - client.batch_create_resource_value_configs({ parent: parent, requests: requests }, grpc_options) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object with options - client.batch_create_resource_value_configs(::Google::Cloud::SecurityCenter::V2::BatchCreateResourceValueConfigsRequest.new(parent: parent, requests: requests), grpc_options) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Verify method calls - assert_equal 5, batch_create_resource_value_configs_client_stub.call_rpc_count - end - end - - def test_bulk_mute_findings - # 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" - filter = "hello world" - mute_state = :MUTE_STATE_UNSPECIFIED - - bulk_mute_findings_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :bulk_mute_findings, name - assert_kind_of ::Google::Cloud::SecurityCenter::V2::BulkMuteFindingsRequest, request - assert_equal "hello world", request["parent"] - assert_equal "hello world", request["filter"] - assert_equal :MUTE_STATE_UNSPECIFIED, request["mute_state"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, bulk_mute_findings_client_stub do - # Create client - client = ::Google::Cloud::SecurityCenter::V2::SecurityCenter::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.bulk_mute_findings({ parent: parent, filter: filter, mute_state: mute_state }) 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.bulk_mute_findings parent: parent, filter: filter, mute_state: mute_state 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.bulk_mute_findings ::Google::Cloud::SecurityCenter::V2::BulkMuteFindingsRequest.new(parent: parent, filter: filter, mute_state: mute_state) 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.bulk_mute_findings({ parent: parent, filter: filter, mute_state: mute_state }, 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.bulk_mute_findings(::Google::Cloud::SecurityCenter::V2::BulkMuteFindingsRequest.new(parent: parent, filter: filter, mute_state: mute_state), 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, bulk_mute_findings_client_stub.call_rpc_count - end - end - - def test_create_big_query_export - # Create GRPC objects. - grpc_response = ::Google::Cloud::SecurityCenter::V2::BigQueryExport.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" - big_query_export = {} - big_query_export_id = "hello world" - - create_big_query_export_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :create_big_query_export, name - assert_kind_of ::Google::Cloud::SecurityCenter::V2::CreateBigQueryExportRequest, request - assert_equal "hello world", request["parent"] - assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::SecurityCenter::V2::BigQueryExport), request["big_query_export"] - assert_equal "hello world", request["big_query_export_id"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, create_big_query_export_client_stub do - # Create client - client = ::Google::Cloud::SecurityCenter::V2::SecurityCenter::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.create_big_query_export({ parent: parent, big_query_export: big_query_export, big_query_export_id: big_query_export_id }) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use named arguments - client.create_big_query_export parent: parent, big_query_export: big_query_export, big_query_export_id: big_query_export_id do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object - client.create_big_query_export ::Google::Cloud::SecurityCenter::V2::CreateBigQueryExportRequest.new(parent: parent, big_query_export: big_query_export, big_query_export_id: big_query_export_id) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use hash object with options - client.create_big_query_export({ parent: parent, big_query_export: big_query_export, big_query_export_id: big_query_export_id }, grpc_options) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object with options - client.create_big_query_export(::Google::Cloud::SecurityCenter::V2::CreateBigQueryExportRequest.new(parent: parent, big_query_export: big_query_export, big_query_export_id: big_query_export_id), grpc_options) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Verify method calls - assert_equal 5, create_big_query_export_client_stub.call_rpc_count - end - end - - def test_create_finding - # Create GRPC objects. - grpc_response = ::Google::Cloud::SecurityCenter::V2::Finding.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" - finding_id = "hello world" - finding = {} - - create_finding_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :create_finding, name - assert_kind_of ::Google::Cloud::SecurityCenter::V2::CreateFindingRequest, request - assert_equal "hello world", request["parent"] - assert_equal "hello world", request["finding_id"] - assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::SecurityCenter::V2::Finding), request["finding"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, create_finding_client_stub do - # Create client - client = ::Google::Cloud::SecurityCenter::V2::SecurityCenter::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.create_finding({ parent: parent, finding_id: finding_id, finding: finding }) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use named arguments - client.create_finding parent: parent, finding_id: finding_id, finding: finding do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object - client.create_finding ::Google::Cloud::SecurityCenter::V2::CreateFindingRequest.new(parent: parent, finding_id: finding_id, finding: finding) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use hash object with options - client.create_finding({ parent: parent, finding_id: finding_id, finding: finding }, grpc_options) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object with options - client.create_finding(::Google::Cloud::SecurityCenter::V2::CreateFindingRequest.new(parent: parent, finding_id: finding_id, finding: finding), grpc_options) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Verify method calls - assert_equal 5, create_finding_client_stub.call_rpc_count - end - end - - def test_create_mute_config - # Create GRPC objects. - grpc_response = ::Google::Cloud::SecurityCenter::V2::MuteConfig.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" - mute_config = {} - mute_config_id = "hello world" - - create_mute_config_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :create_mute_config, name - assert_kind_of ::Google::Cloud::SecurityCenter::V2::CreateMuteConfigRequest, request - assert_equal "hello world", request["parent"] - assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::SecurityCenter::V2::MuteConfig), request["mute_config"] - assert_equal "hello world", request["mute_config_id"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, create_mute_config_client_stub do - # Create client - client = ::Google::Cloud::SecurityCenter::V2::SecurityCenter::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.create_mute_config({ parent: parent, mute_config: mute_config, mute_config_id: mute_config_id }) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use named arguments - client.create_mute_config parent: parent, mute_config: mute_config, mute_config_id: mute_config_id do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object - client.create_mute_config ::Google::Cloud::SecurityCenter::V2::CreateMuteConfigRequest.new(parent: parent, mute_config: mute_config, mute_config_id: mute_config_id) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use hash object with options - client.create_mute_config({ parent: parent, mute_config: mute_config, mute_config_id: mute_config_id }, grpc_options) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object with options - client.create_mute_config(::Google::Cloud::SecurityCenter::V2::CreateMuteConfigRequest.new(parent: parent, mute_config: mute_config, mute_config_id: mute_config_id), grpc_options) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Verify method calls - assert_equal 5, create_mute_config_client_stub.call_rpc_count - end - end - - def test_create_notification_config - # Create GRPC objects. - grpc_response = ::Google::Cloud::SecurityCenter::V2::NotificationConfig.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" - config_id = "hello world" - notification_config = {} - - create_notification_config_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :create_notification_config, name - assert_kind_of ::Google::Cloud::SecurityCenter::V2::CreateNotificationConfigRequest, request - assert_equal "hello world", request["parent"] - assert_equal "hello world", request["config_id"] - assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::SecurityCenter::V2::NotificationConfig), request["notification_config"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, create_notification_config_client_stub do - # Create client - client = ::Google::Cloud::SecurityCenter::V2::SecurityCenter::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.create_notification_config({ parent: parent, config_id: config_id, notification_config: notification_config }) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use named arguments - client.create_notification_config parent: parent, config_id: config_id, notification_config: notification_config do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object - client.create_notification_config ::Google::Cloud::SecurityCenter::V2::CreateNotificationConfigRequest.new(parent: parent, config_id: config_id, notification_config: notification_config) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use hash object with options - client.create_notification_config({ parent: parent, config_id: config_id, notification_config: notification_config }, grpc_options) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object with options - client.create_notification_config(::Google::Cloud::SecurityCenter::V2::CreateNotificationConfigRequest.new(parent: parent, config_id: config_id, notification_config: notification_config), grpc_options) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Verify method calls - assert_equal 5, create_notification_config_client_stub.call_rpc_count - end - end - - def test_create_source - # Create GRPC objects. - grpc_response = ::Google::Cloud::SecurityCenter::V2::Source.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" - source = {} - - create_source_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :create_source, name - assert_kind_of ::Google::Cloud::SecurityCenter::V2::CreateSourceRequest, request - assert_equal "hello world", request["parent"] - assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::SecurityCenter::V2::Source), request["source"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, create_source_client_stub do - # Create client - client = ::Google::Cloud::SecurityCenter::V2::SecurityCenter::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.create_source({ parent: parent, source: source }) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use named arguments - client.create_source parent: parent, source: source do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object - client.create_source ::Google::Cloud::SecurityCenter::V2::CreateSourceRequest.new(parent: parent, source: source) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use hash object with options - client.create_source({ parent: parent, source: source }, grpc_options) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object with options - client.create_source(::Google::Cloud::SecurityCenter::V2::CreateSourceRequest.new(parent: parent, source: source), grpc_options) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Verify method calls - assert_equal 5, create_source_client_stub.call_rpc_count - end - end - - def test_delete_big_query_export - # 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_big_query_export_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :delete_big_query_export, name - assert_kind_of ::Google::Cloud::SecurityCenter::V2::DeleteBigQueryExportRequest, request - assert_equal "hello world", request["name"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, delete_big_query_export_client_stub do - # Create client - client = ::Google::Cloud::SecurityCenter::V2::SecurityCenter::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.delete_big_query_export({ name: name }) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use named arguments - client.delete_big_query_export name: name do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object - client.delete_big_query_export ::Google::Cloud::SecurityCenter::V2::DeleteBigQueryExportRequest.new(name: name) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use hash object with options - client.delete_big_query_export({ 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_big_query_export(::Google::Cloud::SecurityCenter::V2::DeleteBigQueryExportRequest.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_big_query_export_client_stub.call_rpc_count - end - end - - def test_delete_mute_config - # 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_mute_config_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :delete_mute_config, name - assert_kind_of ::Google::Cloud::SecurityCenter::V2::DeleteMuteConfigRequest, request - assert_equal "hello world", request["name"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, delete_mute_config_client_stub do - # Create client - client = ::Google::Cloud::SecurityCenter::V2::SecurityCenter::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.delete_mute_config({ name: name }) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use named arguments - client.delete_mute_config name: name do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object - client.delete_mute_config ::Google::Cloud::SecurityCenter::V2::DeleteMuteConfigRequest.new(name: name) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use hash object with options - client.delete_mute_config({ name: name }, grpc_options) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object with options - client.delete_mute_config(::Google::Cloud::SecurityCenter::V2::DeleteMuteConfigRequest.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_mute_config_client_stub.call_rpc_count - end - end - - def test_delete_notification_config - # 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_notification_config_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :delete_notification_config, name - assert_kind_of ::Google::Cloud::SecurityCenter::V2::DeleteNotificationConfigRequest, request - assert_equal "hello world", request["name"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, delete_notification_config_client_stub do - # Create client - client = ::Google::Cloud::SecurityCenter::V2::SecurityCenter::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.delete_notification_config({ name: name }) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use named arguments - client.delete_notification_config name: name do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object - client.delete_notification_config ::Google::Cloud::SecurityCenter::V2::DeleteNotificationConfigRequest.new(name: name) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use hash object with options - client.delete_notification_config({ name: name }, grpc_options) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object with options - client.delete_notification_config(::Google::Cloud::SecurityCenter::V2::DeleteNotificationConfigRequest.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_notification_config_client_stub.call_rpc_count - end - end - - def test_delete_resource_value_config - # 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_resource_value_config_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :delete_resource_value_config, name - assert_kind_of ::Google::Cloud::SecurityCenter::V2::DeleteResourceValueConfigRequest, request - assert_equal "hello world", request["name"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, delete_resource_value_config_client_stub do - # Create client - client = ::Google::Cloud::SecurityCenter::V2::SecurityCenter::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.delete_resource_value_config({ name: name }) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use named arguments - client.delete_resource_value_config name: name do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object - client.delete_resource_value_config ::Google::Cloud::SecurityCenter::V2::DeleteResourceValueConfigRequest.new(name: name) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use hash object with options - client.delete_resource_value_config({ name: name }, grpc_options) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object with options - client.delete_resource_value_config(::Google::Cloud::SecurityCenter::V2::DeleteResourceValueConfigRequest.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_resource_value_config_client_stub.call_rpc_count - end - end - - def test_get_big_query_export - # Create GRPC objects. - grpc_response = ::Google::Cloud::SecurityCenter::V2::BigQueryExport.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_big_query_export_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :get_big_query_export, name - assert_kind_of ::Google::Cloud::SecurityCenter::V2::GetBigQueryExportRequest, request - assert_equal "hello world", request["name"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, get_big_query_export_client_stub do - # Create client - client = ::Google::Cloud::SecurityCenter::V2::SecurityCenter::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.get_big_query_export({ name: name }) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use named arguments - client.get_big_query_export name: name do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object - client.get_big_query_export ::Google::Cloud::SecurityCenter::V2::GetBigQueryExportRequest.new(name: name) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use hash object with options - client.get_big_query_export({ 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_big_query_export(::Google::Cloud::SecurityCenter::V2::GetBigQueryExportRequest.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_big_query_export_client_stub.call_rpc_count - end - end - - def test_get_simulation - # Create GRPC objects. - grpc_response = ::Google::Cloud::SecurityCenter::V2::Simulation.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_simulation_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :get_simulation, name - assert_kind_of ::Google::Cloud::SecurityCenter::V2::GetSimulationRequest, request - assert_equal "hello world", request["name"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, get_simulation_client_stub do - # Create client - client = ::Google::Cloud::SecurityCenter::V2::SecurityCenter::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.get_simulation({ name: name }) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use named arguments - client.get_simulation name: name do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object - client.get_simulation ::Google::Cloud::SecurityCenter::V2::GetSimulationRequest.new(name: name) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use hash object with options - client.get_simulation({ 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_simulation(::Google::Cloud::SecurityCenter::V2::GetSimulationRequest.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_simulation_client_stub.call_rpc_count - end - end - - def test_get_valued_resource - # Create GRPC objects. - grpc_response = ::Google::Cloud::SecurityCenter::V2::ValuedResource.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_valued_resource_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :get_valued_resource, name - assert_kind_of ::Google::Cloud::SecurityCenter::V2::GetValuedResourceRequest, request - assert_equal "hello world", request["name"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, get_valued_resource_client_stub do - # Create client - client = ::Google::Cloud::SecurityCenter::V2::SecurityCenter::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.get_valued_resource({ name: name }) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use named arguments - client.get_valued_resource name: name do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object - client.get_valued_resource ::Google::Cloud::SecurityCenter::V2::GetValuedResourceRequest.new(name: name) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use hash object with options - client.get_valued_resource({ 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_valued_resource(::Google::Cloud::SecurityCenter::V2::GetValuedResourceRequest.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_valued_resource_client_stub.call_rpc_count - end - end - - def test_get_iam_policy - # Create GRPC objects. - grpc_response = ::Google::Iam::V1::Policy.new - grpc_operation = GRPC::ActiveCall::Operation.new nil - grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - grpc_options = {} - - # Create request parameters for a unary method. - resource = "hello world" - options = {} - - get_iam_policy_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :get_iam_policy, name - assert_kind_of ::Google::Iam::V1::GetIamPolicyRequest, request - assert_equal "hello world", request["resource"] - assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Iam::V1::GetPolicyOptions), request["options"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, get_iam_policy_client_stub do - # Create client - client = ::Google::Cloud::SecurityCenter::V2::SecurityCenter::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.get_iam_policy({ resource: resource, options: options }) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use named arguments - client.get_iam_policy resource: resource, options: options do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object - client.get_iam_policy ::Google::Iam::V1::GetIamPolicyRequest.new(resource: resource, options: options) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use hash object with options - client.get_iam_policy({ resource: resource, options: options }, grpc_options) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object with options - client.get_iam_policy(::Google::Iam::V1::GetIamPolicyRequest.new(resource: resource, options: options), grpc_options) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Verify method calls - assert_equal 5, get_iam_policy_client_stub.call_rpc_count - end - end - - def test_get_mute_config - # Create GRPC objects. - grpc_response = ::Google::Cloud::SecurityCenter::V2::MuteConfig.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_mute_config_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :get_mute_config, name - assert_kind_of ::Google::Cloud::SecurityCenter::V2::GetMuteConfigRequest, request - assert_equal "hello world", request["name"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, get_mute_config_client_stub do - # Create client - client = ::Google::Cloud::SecurityCenter::V2::SecurityCenter::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.get_mute_config({ name: name }) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use named arguments - client.get_mute_config name: name do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object - client.get_mute_config ::Google::Cloud::SecurityCenter::V2::GetMuteConfigRequest.new(name: name) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use hash object with options - client.get_mute_config({ name: name }, grpc_options) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object with options - client.get_mute_config(::Google::Cloud::SecurityCenter::V2::GetMuteConfigRequest.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_mute_config_client_stub.call_rpc_count - end - end - - def test_get_notification_config - # Create GRPC objects. - grpc_response = ::Google::Cloud::SecurityCenter::V2::NotificationConfig.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_notification_config_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :get_notification_config, name - assert_kind_of ::Google::Cloud::SecurityCenter::V2::GetNotificationConfigRequest, request - assert_equal "hello world", request["name"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, get_notification_config_client_stub do - # Create client - client = ::Google::Cloud::SecurityCenter::V2::SecurityCenter::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.get_notification_config({ name: name }) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use named arguments - client.get_notification_config name: name do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object - client.get_notification_config ::Google::Cloud::SecurityCenter::V2::GetNotificationConfigRequest.new(name: name) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use hash object with options - client.get_notification_config({ name: name }, grpc_options) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object with options - client.get_notification_config(::Google::Cloud::SecurityCenter::V2::GetNotificationConfigRequest.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_notification_config_client_stub.call_rpc_count - end - end - - def test_get_resource_value_config - # Create GRPC objects. - grpc_response = ::Google::Cloud::SecurityCenter::V2::ResourceValueConfig.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_resource_value_config_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :get_resource_value_config, name - assert_kind_of ::Google::Cloud::SecurityCenter::V2::GetResourceValueConfigRequest, request - assert_equal "hello world", request["name"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, get_resource_value_config_client_stub do - # Create client - client = ::Google::Cloud::SecurityCenter::V2::SecurityCenter::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.get_resource_value_config({ name: name }) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use named arguments - client.get_resource_value_config name: name do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object - client.get_resource_value_config ::Google::Cloud::SecurityCenter::V2::GetResourceValueConfigRequest.new(name: name) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use hash object with options - client.get_resource_value_config({ name: name }, grpc_options) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object with options - client.get_resource_value_config(::Google::Cloud::SecurityCenter::V2::GetResourceValueConfigRequest.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_resource_value_config_client_stub.call_rpc_count - end - end - - def test_get_source - # Create GRPC objects. - grpc_response = ::Google::Cloud::SecurityCenter::V2::Source.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_source_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :get_source, name - assert_kind_of ::Google::Cloud::SecurityCenter::V2::GetSourceRequest, request - assert_equal "hello world", request["name"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, get_source_client_stub do - # Create client - client = ::Google::Cloud::SecurityCenter::V2::SecurityCenter::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.get_source({ name: name }) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use named arguments - client.get_source name: name do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object - client.get_source ::Google::Cloud::SecurityCenter::V2::GetSourceRequest.new(name: name) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use hash object with options - client.get_source({ 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_source(::Google::Cloud::SecurityCenter::V2::GetSourceRequest.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_source_client_stub.call_rpc_count - end - end - - def test_group_findings - # Create GRPC objects. - grpc_response = ::Google::Cloud::SecurityCenter::V2::GroupFindingsResponse.new - grpc_operation = GRPC::ActiveCall::Operation.new nil - grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - grpc_options = {} - - # Create request parameters for a unary method. - parent = "hello world" - filter = "hello world" - group_by = "hello world" - page_token = "hello world" - page_size = 42 - - group_findings_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :group_findings, name - assert_kind_of ::Google::Cloud::SecurityCenter::V2::GroupFindingsRequest, request - assert_equal "hello world", request["parent"] - assert_equal "hello world", request["filter"] - assert_equal "hello world", request["group_by"] - assert_equal "hello world", request["page_token"] - assert_equal 42, request["page_size"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, group_findings_client_stub do - # Create client - client = ::Google::Cloud::SecurityCenter::V2::SecurityCenter::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.group_findings({ parent: parent, filter: filter, group_by: group_by, page_token: page_token, page_size: page_size }) 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.group_findings parent: parent, filter: filter, group_by: group_by, page_token: page_token, page_size: page_size 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.group_findings ::Google::Cloud::SecurityCenter::V2::GroupFindingsRequest.new(parent: parent, filter: filter, group_by: group_by, page_token: page_token, page_size: page_size) 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.group_findings({ parent: parent, filter: filter, group_by: group_by, page_token: page_token, page_size: page_size }, 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.group_findings(::Google::Cloud::SecurityCenter::V2::GroupFindingsRequest.new(parent: parent, filter: filter, group_by: group_by, page_token: page_token, page_size: page_size), 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, group_findings_client_stub.call_rpc_count - end - end - - def test_list_attack_paths - # Create GRPC objects. - grpc_response = ::Google::Cloud::SecurityCenter::V2::ListAttackPathsResponse.new - grpc_operation = GRPC::ActiveCall::Operation.new nil - grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - grpc_options = {} - - # Create request parameters for a unary method. - parent = "hello world" - filter = "hello world" - page_token = "hello world" - page_size = 42 - - list_attack_paths_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :list_attack_paths, name - assert_kind_of ::Google::Cloud::SecurityCenter::V2::ListAttackPathsRequest, request - assert_equal "hello world", request["parent"] - assert_equal "hello world", request["filter"] - assert_equal "hello world", request["page_token"] - assert_equal 42, request["page_size"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, list_attack_paths_client_stub do - # Create client - client = ::Google::Cloud::SecurityCenter::V2::SecurityCenter::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.list_attack_paths({ parent: parent, filter: filter, page_token: page_token, page_size: page_size }) 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_attack_paths parent: parent, filter: filter, page_token: page_token, page_size: page_size 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_attack_paths ::Google::Cloud::SecurityCenter::V2::ListAttackPathsRequest.new(parent: parent, filter: filter, page_token: page_token, page_size: page_size) 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_attack_paths({ parent: parent, filter: filter, page_token: page_token, page_size: page_size }, 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_attack_paths(::Google::Cloud::SecurityCenter::V2::ListAttackPathsRequest.new(parent: parent, filter: filter, page_token: page_token, page_size: page_size), 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_attack_paths_client_stub.call_rpc_count - end - end - - def test_list_big_query_exports - # Create GRPC objects. - grpc_response = ::Google::Cloud::SecurityCenter::V2::ListBigQueryExportsResponse.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_big_query_exports_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :list_big_query_exports, name - assert_kind_of ::Google::Cloud::SecurityCenter::V2::ListBigQueryExportsRequest, 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_big_query_exports_client_stub do - # Create client - client = ::Google::Cloud::SecurityCenter::V2::SecurityCenter::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.list_big_query_exports({ 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_big_query_exports 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_big_query_exports ::Google::Cloud::SecurityCenter::V2::ListBigQueryExportsRequest.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_big_query_exports({ 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_big_query_exports(::Google::Cloud::SecurityCenter::V2::ListBigQueryExportsRequest.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_big_query_exports_client_stub.call_rpc_count - end - end - - def test_list_findings - # Create GRPC objects. - grpc_response = ::Google::Cloud::SecurityCenter::V2::ListFindingsResponse.new - grpc_operation = GRPC::ActiveCall::Operation.new nil - grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - grpc_options = {} - - # Create request parameters for a unary method. - parent = "hello world" - filter = "hello world" - order_by = "hello world" - field_mask = {} - page_token = "hello world" - page_size = 42 - - list_findings_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :list_findings, name - assert_kind_of ::Google::Cloud::SecurityCenter::V2::ListFindingsRequest, request - assert_equal "hello world", request["parent"] - assert_equal "hello world", request["filter"] - assert_equal "hello world", request["order_by"] - assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Protobuf::FieldMask), request["field_mask"] - assert_equal "hello world", request["page_token"] - assert_equal 42, request["page_size"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, list_findings_client_stub do - # Create client - client = ::Google::Cloud::SecurityCenter::V2::SecurityCenter::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.list_findings({ parent: parent, filter: filter, order_by: order_by, field_mask: field_mask, page_token: page_token, page_size: page_size }) 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_findings parent: parent, filter: filter, order_by: order_by, field_mask: field_mask, page_token: page_token, page_size: page_size 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_findings ::Google::Cloud::SecurityCenter::V2::ListFindingsRequest.new(parent: parent, filter: filter, order_by: order_by, field_mask: field_mask, page_token: page_token, page_size: page_size) 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_findings({ parent: parent, filter: filter, order_by: order_by, field_mask: field_mask, page_token: page_token, page_size: page_size }, 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_findings(::Google::Cloud::SecurityCenter::V2::ListFindingsRequest.new(parent: parent, filter: filter, order_by: order_by, field_mask: field_mask, page_token: page_token, page_size: page_size), 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_findings_client_stub.call_rpc_count - end - end - - def test_list_mute_configs - # Create GRPC objects. - grpc_response = ::Google::Cloud::SecurityCenter::V2::ListMuteConfigsResponse.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_mute_configs_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :list_mute_configs, name - assert_kind_of ::Google::Cloud::SecurityCenter::V2::ListMuteConfigsRequest, 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_mute_configs_client_stub do - # Create client - client = ::Google::Cloud::SecurityCenter::V2::SecurityCenter::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.list_mute_configs({ 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_mute_configs 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_mute_configs ::Google::Cloud::SecurityCenter::V2::ListMuteConfigsRequest.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_mute_configs({ 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_mute_configs(::Google::Cloud::SecurityCenter::V2::ListMuteConfigsRequest.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_mute_configs_client_stub.call_rpc_count - end - end - - def test_list_notification_configs - # Create GRPC objects. - grpc_response = ::Google::Cloud::SecurityCenter::V2::ListNotificationConfigsResponse.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_token = "hello world" - page_size = 42 - - list_notification_configs_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :list_notification_configs, name - assert_kind_of ::Google::Cloud::SecurityCenter::V2::ListNotificationConfigsRequest, request - assert_equal "hello world", request["parent"] - assert_equal "hello world", request["page_token"] - assert_equal 42, request["page_size"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, list_notification_configs_client_stub do - # Create client - client = ::Google::Cloud::SecurityCenter::V2::SecurityCenter::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.list_notification_configs({ parent: parent, page_token: page_token, page_size: page_size }) 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_notification_configs parent: parent, page_token: page_token, page_size: page_size 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_notification_configs ::Google::Cloud::SecurityCenter::V2::ListNotificationConfigsRequest.new(parent: parent, page_token: page_token, page_size: page_size) 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_notification_configs({ parent: parent, page_token: page_token, page_size: page_size }, 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_notification_configs(::Google::Cloud::SecurityCenter::V2::ListNotificationConfigsRequest.new(parent: parent, page_token: page_token, page_size: page_size), 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_notification_configs_client_stub.call_rpc_count - end - end - - def test_list_resource_value_configs - # Create GRPC objects. - grpc_response = ::Google::Cloud::SecurityCenter::V2::ListResourceValueConfigsResponse.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_resource_value_configs_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :list_resource_value_configs, name - assert_kind_of ::Google::Cloud::SecurityCenter::V2::ListResourceValueConfigsRequest, 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_resource_value_configs_client_stub do - # Create client - client = ::Google::Cloud::SecurityCenter::V2::SecurityCenter::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.list_resource_value_configs({ 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_resource_value_configs 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_resource_value_configs ::Google::Cloud::SecurityCenter::V2::ListResourceValueConfigsRequest.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_resource_value_configs({ 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_resource_value_configs(::Google::Cloud::SecurityCenter::V2::ListResourceValueConfigsRequest.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_resource_value_configs_client_stub.call_rpc_count - end - end - - def test_list_sources - # Create GRPC objects. - grpc_response = ::Google::Cloud::SecurityCenter::V2::ListSourcesResponse.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_token = "hello world" - page_size = 42 - - list_sources_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :list_sources, name - assert_kind_of ::Google::Cloud::SecurityCenter::V2::ListSourcesRequest, request - assert_equal "hello world", request["parent"] - assert_equal "hello world", request["page_token"] - assert_equal 42, request["page_size"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, list_sources_client_stub do - # Create client - client = ::Google::Cloud::SecurityCenter::V2::SecurityCenter::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.list_sources({ parent: parent, page_token: page_token, page_size: page_size }) 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_sources parent: parent, page_token: page_token, page_size: page_size 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_sources ::Google::Cloud::SecurityCenter::V2::ListSourcesRequest.new(parent: parent, page_token: page_token, page_size: page_size) 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_sources({ parent: parent, page_token: page_token, page_size: page_size }, 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_sources(::Google::Cloud::SecurityCenter::V2::ListSourcesRequest.new(parent: parent, page_token: page_token, page_size: page_size), 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_sources_client_stub.call_rpc_count - end - end - - def test_list_valued_resources - # Create GRPC objects. - grpc_response = ::Google::Cloud::SecurityCenter::V2::ListValuedResourcesResponse.new - grpc_operation = GRPC::ActiveCall::Operation.new nil - grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - grpc_options = {} - - # Create request parameters for a unary method. - parent = "hello world" - filter = "hello world" - page_token = "hello world" - page_size = 42 - order_by = "hello world" - - list_valued_resources_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :list_valued_resources, name - assert_kind_of ::Google::Cloud::SecurityCenter::V2::ListValuedResourcesRequest, request - assert_equal "hello world", request["parent"] - assert_equal "hello world", request["filter"] - assert_equal "hello world", request["page_token"] - assert_equal 42, request["page_size"] - assert_equal "hello world", request["order_by"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, list_valued_resources_client_stub do - # Create client - client = ::Google::Cloud::SecurityCenter::V2::SecurityCenter::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.list_valued_resources({ parent: parent, filter: filter, page_token: page_token, page_size: page_size, order_by: order_by }) 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_valued_resources parent: parent, filter: filter, page_token: page_token, page_size: page_size, order_by: order_by 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_valued_resources ::Google::Cloud::SecurityCenter::V2::ListValuedResourcesRequest.new(parent: parent, filter: filter, page_token: page_token, page_size: page_size, order_by: order_by) 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_valued_resources({ parent: parent, filter: filter, page_token: page_token, page_size: page_size, order_by: order_by }, 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_valued_resources(::Google::Cloud::SecurityCenter::V2::ListValuedResourcesRequest.new(parent: parent, filter: filter, page_token: page_token, page_size: page_size, order_by: order_by), 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_valued_resources_client_stub.call_rpc_count - end - end - - def test_set_finding_state - # Create GRPC objects. - grpc_response = ::Google::Cloud::SecurityCenter::V2::Finding.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" - state = :STATE_UNSPECIFIED - - set_finding_state_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :set_finding_state, name - assert_kind_of ::Google::Cloud::SecurityCenter::V2::SetFindingStateRequest, request - assert_equal "hello world", request["name"] - assert_equal :STATE_UNSPECIFIED, request["state"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, set_finding_state_client_stub do - # Create client - client = ::Google::Cloud::SecurityCenter::V2::SecurityCenter::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.set_finding_state({ name: name, state: state }) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use named arguments - client.set_finding_state name: name, state: state do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object - client.set_finding_state ::Google::Cloud::SecurityCenter::V2::SetFindingStateRequest.new(name: name, state: state) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use hash object with options - client.set_finding_state({ name: name, state: state }, grpc_options) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object with options - client.set_finding_state(::Google::Cloud::SecurityCenter::V2::SetFindingStateRequest.new(name: name, state: state), grpc_options) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Verify method calls - assert_equal 5, set_finding_state_client_stub.call_rpc_count - end - end - - def test_set_iam_policy - # Create GRPC objects. - grpc_response = ::Google::Iam::V1::Policy.new - grpc_operation = GRPC::ActiveCall::Operation.new nil - grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - grpc_options = {} - - # Create request parameters for a unary method. - resource = "hello world" - policy = {} - update_mask = {} - - set_iam_policy_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :set_iam_policy, name - assert_kind_of ::Google::Iam::V1::SetIamPolicyRequest, request - assert_equal "hello world", request["resource"] - assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Iam::V1::Policy), request["policy"] - assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Protobuf::FieldMask), request["update_mask"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, set_iam_policy_client_stub do - # Create client - client = ::Google::Cloud::SecurityCenter::V2::SecurityCenter::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.set_iam_policy({ resource: resource, policy: policy, update_mask: update_mask }) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use named arguments - client.set_iam_policy resource: resource, policy: policy, update_mask: update_mask do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object - client.set_iam_policy ::Google::Iam::V1::SetIamPolicyRequest.new(resource: resource, policy: policy, update_mask: update_mask) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use hash object with options - client.set_iam_policy({ resource: resource, policy: policy, update_mask: update_mask }, grpc_options) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object with options - client.set_iam_policy(::Google::Iam::V1::SetIamPolicyRequest.new(resource: resource, policy: policy, update_mask: update_mask), grpc_options) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Verify method calls - assert_equal 5, set_iam_policy_client_stub.call_rpc_count - end - end - - def test_set_mute - # Create GRPC objects. - grpc_response = ::Google::Cloud::SecurityCenter::V2::Finding.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" - mute = :MUTE_UNSPECIFIED - - set_mute_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :set_mute, name - assert_kind_of ::Google::Cloud::SecurityCenter::V2::SetMuteRequest, request - assert_equal "hello world", request["name"] - assert_equal :MUTE_UNSPECIFIED, request["mute"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, set_mute_client_stub do - # Create client - client = ::Google::Cloud::SecurityCenter::V2::SecurityCenter::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.set_mute({ name: name, mute: mute }) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use named arguments - client.set_mute name: name, mute: mute do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object - client.set_mute ::Google::Cloud::SecurityCenter::V2::SetMuteRequest.new(name: name, mute: mute) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use hash object with options - client.set_mute({ name: name, mute: mute }, grpc_options) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object with options - client.set_mute(::Google::Cloud::SecurityCenter::V2::SetMuteRequest.new(name: name, mute: mute), grpc_options) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Verify method calls - assert_equal 5, set_mute_client_stub.call_rpc_count - end - end - - def test_test_iam_permissions - # Create GRPC objects. - grpc_response = ::Google::Iam::V1::TestIamPermissionsResponse.new - grpc_operation = GRPC::ActiveCall::Operation.new nil - grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - grpc_options = {} - - # Create request parameters for a unary method. - resource = "hello world" - permissions = ["hello world"] - - test_iam_permissions_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :test_iam_permissions, name - assert_kind_of ::Google::Iam::V1::TestIamPermissionsRequest, request - assert_equal "hello world", request["resource"] - assert_equal ["hello world"], request["permissions"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, test_iam_permissions_client_stub do - # Create client - client = ::Google::Cloud::SecurityCenter::V2::SecurityCenter::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.test_iam_permissions({ resource: resource, permissions: permissions }) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use named arguments - client.test_iam_permissions resource: resource, permissions: permissions do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object - client.test_iam_permissions ::Google::Iam::V1::TestIamPermissionsRequest.new(resource: resource, permissions: permissions) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use hash object with options - client.test_iam_permissions({ resource: resource, permissions: permissions }, grpc_options) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object with options - client.test_iam_permissions(::Google::Iam::V1::TestIamPermissionsRequest.new(resource: resource, permissions: permissions), grpc_options) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Verify method calls - assert_equal 5, test_iam_permissions_client_stub.call_rpc_count - end - end - - def test_update_big_query_export - # Create GRPC objects. - grpc_response = ::Google::Cloud::SecurityCenter::V2::BigQueryExport.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. - big_query_export = {} - update_mask = {} - - update_big_query_export_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :update_big_query_export, name - assert_kind_of ::Google::Cloud::SecurityCenter::V2::UpdateBigQueryExportRequest, request - assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::SecurityCenter::V2::BigQueryExport), request["big_query_export"] - assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Protobuf::FieldMask), request["update_mask"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, update_big_query_export_client_stub do - # Create client - client = ::Google::Cloud::SecurityCenter::V2::SecurityCenter::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.update_big_query_export({ big_query_export: big_query_export, update_mask: update_mask }) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use named arguments - client.update_big_query_export big_query_export: big_query_export, update_mask: update_mask do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object - client.update_big_query_export ::Google::Cloud::SecurityCenter::V2::UpdateBigQueryExportRequest.new(big_query_export: big_query_export, update_mask: update_mask) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use hash object with options - client.update_big_query_export({ big_query_export: big_query_export, update_mask: update_mask }, grpc_options) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object with options - client.update_big_query_export(::Google::Cloud::SecurityCenter::V2::UpdateBigQueryExportRequest.new(big_query_export: big_query_export, update_mask: update_mask), grpc_options) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Verify method calls - assert_equal 5, update_big_query_export_client_stub.call_rpc_count - end - end - - def test_update_external_system - # Create GRPC objects. - grpc_response = ::Google::Cloud::SecurityCenter::V2::ExternalSystem.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. - external_system = {} - update_mask = {} - - update_external_system_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :update_external_system, name - assert_kind_of ::Google::Cloud::SecurityCenter::V2::UpdateExternalSystemRequest, request - assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::SecurityCenter::V2::ExternalSystem), request["external_system"] - assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Protobuf::FieldMask), request["update_mask"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, update_external_system_client_stub do - # Create client - client = ::Google::Cloud::SecurityCenter::V2::SecurityCenter::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.update_external_system({ external_system: external_system, update_mask: update_mask }) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use named arguments - client.update_external_system external_system: external_system, update_mask: update_mask do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object - client.update_external_system ::Google::Cloud::SecurityCenter::V2::UpdateExternalSystemRequest.new(external_system: external_system, update_mask: update_mask) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use hash object with options - client.update_external_system({ external_system: external_system, update_mask: update_mask }, grpc_options) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object with options - client.update_external_system(::Google::Cloud::SecurityCenter::V2::UpdateExternalSystemRequest.new(external_system: external_system, update_mask: update_mask), grpc_options) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Verify method calls - assert_equal 5, update_external_system_client_stub.call_rpc_count - end - end - - def test_update_finding - # Create GRPC objects. - grpc_response = ::Google::Cloud::SecurityCenter::V2::Finding.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. - finding = {} - update_mask = {} - - update_finding_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :update_finding, name - assert_kind_of ::Google::Cloud::SecurityCenter::V2::UpdateFindingRequest, request - assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::SecurityCenter::V2::Finding), request["finding"] - assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Protobuf::FieldMask), request["update_mask"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, update_finding_client_stub do - # Create client - client = ::Google::Cloud::SecurityCenter::V2::SecurityCenter::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.update_finding({ finding: finding, update_mask: update_mask }) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use named arguments - client.update_finding finding: finding, update_mask: update_mask do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object - client.update_finding ::Google::Cloud::SecurityCenter::V2::UpdateFindingRequest.new(finding: finding, update_mask: update_mask) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use hash object with options - client.update_finding({ finding: finding, update_mask: update_mask }, grpc_options) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object with options - client.update_finding(::Google::Cloud::SecurityCenter::V2::UpdateFindingRequest.new(finding: finding, update_mask: update_mask), grpc_options) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Verify method calls - assert_equal 5, update_finding_client_stub.call_rpc_count - end - end - - def test_update_mute_config - # Create GRPC objects. - grpc_response = ::Google::Cloud::SecurityCenter::V2::MuteConfig.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. - mute_config = {} - update_mask = {} - - update_mute_config_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :update_mute_config, name - assert_kind_of ::Google::Cloud::SecurityCenter::V2::UpdateMuteConfigRequest, request - assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::SecurityCenter::V2::MuteConfig), request["mute_config"] - assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Protobuf::FieldMask), request["update_mask"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, update_mute_config_client_stub do - # Create client - client = ::Google::Cloud::SecurityCenter::V2::SecurityCenter::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.update_mute_config({ mute_config: mute_config, update_mask: update_mask }) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use named arguments - client.update_mute_config mute_config: mute_config, update_mask: update_mask do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object - client.update_mute_config ::Google::Cloud::SecurityCenter::V2::UpdateMuteConfigRequest.new(mute_config: mute_config, update_mask: update_mask) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use hash object with options - client.update_mute_config({ mute_config: mute_config, update_mask: update_mask }, grpc_options) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object with options - client.update_mute_config(::Google::Cloud::SecurityCenter::V2::UpdateMuteConfigRequest.new(mute_config: mute_config, update_mask: update_mask), grpc_options) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Verify method calls - assert_equal 5, update_mute_config_client_stub.call_rpc_count - end - end - - def test_update_notification_config - # Create GRPC objects. - grpc_response = ::Google::Cloud::SecurityCenter::V2::NotificationConfig.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. - notification_config = {} - update_mask = {} - - update_notification_config_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :update_notification_config, name - assert_kind_of ::Google::Cloud::SecurityCenter::V2::UpdateNotificationConfigRequest, request - assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::SecurityCenter::V2::NotificationConfig), request["notification_config"] - assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Protobuf::FieldMask), request["update_mask"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, update_notification_config_client_stub do - # Create client - client = ::Google::Cloud::SecurityCenter::V2::SecurityCenter::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.update_notification_config({ notification_config: notification_config, update_mask: update_mask }) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use named arguments - client.update_notification_config notification_config: notification_config, update_mask: update_mask do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object - client.update_notification_config ::Google::Cloud::SecurityCenter::V2::UpdateNotificationConfigRequest.new(notification_config: notification_config, update_mask: update_mask) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use hash object with options - client.update_notification_config({ notification_config: notification_config, update_mask: update_mask }, grpc_options) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object with options - client.update_notification_config(::Google::Cloud::SecurityCenter::V2::UpdateNotificationConfigRequest.new(notification_config: notification_config, update_mask: update_mask), grpc_options) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Verify method calls - assert_equal 5, update_notification_config_client_stub.call_rpc_count - end - end - - def test_update_resource_value_config - # Create GRPC objects. - grpc_response = ::Google::Cloud::SecurityCenter::V2::ResourceValueConfig.new - grpc_operation = GRPC::ActiveCall::Operation.new nil - grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - grpc_options = {} - - # Create request parameters for a unary method. - resource_value_config = {} - update_mask = {} - - update_resource_value_config_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :update_resource_value_config, name - assert_kind_of ::Google::Cloud::SecurityCenter::V2::UpdateResourceValueConfigRequest, request - assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::SecurityCenter::V2::ResourceValueConfig), request["resource_value_config"] - assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Protobuf::FieldMask), request["update_mask"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, update_resource_value_config_client_stub do - # Create client - client = ::Google::Cloud::SecurityCenter::V2::SecurityCenter::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.update_resource_value_config({ resource_value_config: resource_value_config, update_mask: update_mask }) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use named arguments - client.update_resource_value_config resource_value_config: resource_value_config, update_mask: update_mask do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object - client.update_resource_value_config ::Google::Cloud::SecurityCenter::V2::UpdateResourceValueConfigRequest.new(resource_value_config: resource_value_config, update_mask: update_mask) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use hash object with options - client.update_resource_value_config({ resource_value_config: resource_value_config, update_mask: update_mask }, grpc_options) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object with options - client.update_resource_value_config(::Google::Cloud::SecurityCenter::V2::UpdateResourceValueConfigRequest.new(resource_value_config: resource_value_config, update_mask: update_mask), grpc_options) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Verify method calls - assert_equal 5, update_resource_value_config_client_stub.call_rpc_count - end - end - - def test_update_security_marks - # Create GRPC objects. - grpc_response = ::Google::Cloud::SecurityCenter::V2::SecurityMarks.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. - security_marks = {} - update_mask = {} - - update_security_marks_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :update_security_marks, name - assert_kind_of ::Google::Cloud::SecurityCenter::V2::UpdateSecurityMarksRequest, request - assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::SecurityCenter::V2::SecurityMarks), request["security_marks"] - assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Protobuf::FieldMask), request["update_mask"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, update_security_marks_client_stub do - # Create client - client = ::Google::Cloud::SecurityCenter::V2::SecurityCenter::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.update_security_marks({ security_marks: security_marks, update_mask: update_mask }) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use named arguments - client.update_security_marks security_marks: security_marks, update_mask: update_mask do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object - client.update_security_marks ::Google::Cloud::SecurityCenter::V2::UpdateSecurityMarksRequest.new(security_marks: security_marks, update_mask: update_mask) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use hash object with options - client.update_security_marks({ security_marks: security_marks, update_mask: update_mask }, grpc_options) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object with options - client.update_security_marks(::Google::Cloud::SecurityCenter::V2::UpdateSecurityMarksRequest.new(security_marks: security_marks, update_mask: update_mask), grpc_options) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Verify method calls - assert_equal 5, update_security_marks_client_stub.call_rpc_count - end - end - - def test_update_source - # Create GRPC objects. - grpc_response = ::Google::Cloud::SecurityCenter::V2::Source.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. - source = {} - update_mask = {} - - update_source_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :update_source, name - assert_kind_of ::Google::Cloud::SecurityCenter::V2::UpdateSourceRequest, request - assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::SecurityCenter::V2::Source), request["source"] - assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Protobuf::FieldMask), request["update_mask"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, update_source_client_stub do - # Create client - client = ::Google::Cloud::SecurityCenter::V2::SecurityCenter::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.update_source({ source: source, update_mask: update_mask }) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use named arguments - client.update_source source: source, update_mask: update_mask do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object - client.update_source ::Google::Cloud::SecurityCenter::V2::UpdateSourceRequest.new(source: source, update_mask: update_mask) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use hash object with options - client.update_source({ source: source, update_mask: update_mask }, grpc_options) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object with options - client.update_source(::Google::Cloud::SecurityCenter::V2::UpdateSourceRequest.new(source: source, update_mask: update_mask), grpc_options) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Verify method calls - assert_equal 5, update_source_client_stub.call_rpc_count - end - end - - def test_configure - grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - - client = block_config = config = nil - dummy_stub = ClientStub.new nil, nil - Gapic::ServiceStub.stub :new, dummy_stub do - client = ::Google::Cloud::SecurityCenter::V2::SecurityCenter::Client.new do |config| - config.credentials = grpc_channel - end - end - - config = client.configure do |c| - block_config = c - end - - assert_same block_config, config - assert_kind_of ::Google::Cloud::SecurityCenter::V2::SecurityCenter::Client::Configuration, config - end - - def test_credentials - key = OpenSSL::PKey::RSA.new 2048 - cred_json = { - "private_key" => key.to_pem, - "client_email" => "app@developer.gserviceaccount.com", - "type" => "service_account" - } - key_file = StringIO.new cred_json.to_json - creds = Google::Auth::ServiceAccountCredentials.make_creds({ json_key_io: key_file }) - - dummy_stub = ClientStub.new nil, nil - Gapic::ServiceStub.stub :new, dummy_stub do - client = ::Google::Cloud::SecurityCenter::V2::SecurityCenter::Client.new do |config| - config.credentials = creds - end - assert_kind_of ::Google::Cloud::SecurityCenter::V2::SecurityCenter::Client, client - assert_equal creds, client.configure.credentials - end - end - - def test_operations_client - grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - - client = nil - dummy_stub = ClientStub.new nil, nil - Gapic::ServiceStub.stub :new, dummy_stub do - client = ::Google::Cloud::SecurityCenter::V2::SecurityCenter::Client.new do |config| - config.credentials = grpc_channel - end - end - - assert_kind_of ::Google::Cloud::SecurityCenter::V2::SecurityCenter::Operations, client.operations_client - end -end diff --git a/owl-bot-staging/google-cloud-security_center-v2/test/helper.rb b/owl-bot-staging/google-cloud-security_center-v2/test/helper.rb deleted file mode 100644 index 672b337030e7..000000000000 --- a/owl-bot-staging/google-cloud-security_center-v2/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" diff --git a/owl-bot-staging/google-cloud-security_center_management-v1/.gitignore b/owl-bot-staging/google-cloud-security_center_management-v1/.gitignore deleted file mode 100644 index 0135b6bc6cfc..000000000000 --- a/owl-bot-staging/google-cloud-security_center_management-v1/.gitignore +++ /dev/null @@ -1,22 +0,0 @@ -# Ignore bundler lockfiles -Gemfile.lock -gems.locked - -# Ignore documentation output -doc/* -.yardoc/* - -# Ignore test output -coverage/* - -# Ignore build artifacts -pkg/* - -# Ignore files commonly present in certain dev environments -.vagrant -.DS_STORE -.idea -*.iml - -# Ignore synth output -__pycache__ diff --git a/owl-bot-staging/google-cloud-security_center_management-v1/.repo-metadata.json b/owl-bot-staging/google-cloud-security_center_management-v1/.repo-metadata.json deleted file mode 100644 index 1d992fcf1320..000000000000 --- a/owl-bot-staging/google-cloud-security_center_management-v1/.repo-metadata.json +++ /dev/null @@ -1,17 +0,0 @@ -{ - "api_id": "securitycentermanagement.googleapis.com", - "api_shortname": "securitycentermanagement", - "client_documentation": "https://cloud.google.com/ruby/docs/reference/google-cloud-security_center_management-v1/latest", - "distribution_name": "google-cloud-security_center_management-v1", - "is_cloud": true, - "language": "ruby", - "name": "securitycentermanagement", - "name_pretty": "Security Command Center Management V1 API", - "product_documentation": "https://cloud.google.com/security-command-center/docs/reference/security-center-management/rest", - "release_level": "unreleased", - "repo": "googleapis/google-cloud-ruby", - "requires_billing": true, - "ruby-cloud-description": "Management API for Security Command Center, a built-in security and risk management solution for Google Cloud. Use this API to programmatically update the settings and configuration of Security Command Center. Note that google-cloud-security_center_management-v1 is a version-specific client library. For most uses, we recommend installing the main client library google-cloud-security_center_management instead. See the readme for more details.", - "ruby-cloud-product-url": "https://cloud.google.com/security-command-center/docs/reference/security-center-management/rest", - "library_type": "GAPIC_AUTO" -} diff --git a/owl-bot-staging/google-cloud-security_center_management-v1/.rubocop.yml b/owl-bot-staging/google-cloud-security_center_management-v1/.rubocop.yml deleted file mode 100644 index a9f2a1f499a0..000000000000 --- a/owl-bot-staging/google-cloud-security_center_management-v1/.rubocop.yml +++ /dev/null @@ -1,33 +0,0 @@ -inherit_gem: - google-style: google-style.yml - -AllCops: - Exclude: - - "google-cloud-security_center_management-v1.gemspec" - - "lib/**/*_pb.rb" - - "proto_docs/**/*" - - "test/**/*" - - "acceptance/**/*" - - "samples/acceptance/**/*" - - "Rakefile" - -Layout/LineLength: - Enabled: false -Metrics/AbcSize: - Enabled: false -Metrics/ClassLength: - Enabled: false -Metrics/CyclomaticComplexity: - Enabled: false -Metrics/MethodLength: - Enabled: false -Metrics/ModuleLength: - Enabled: false -Metrics/PerceivedComplexity: - Enabled: false -Naming/AccessorMethodName: - Exclude: - - "snippets/**/*.rb" -Naming/FileName: - Exclude: - - "lib/google-cloud-security_center_management-v1.rb" diff --git a/owl-bot-staging/google-cloud-security_center_management-v1/.toys.rb b/owl-bot-staging/google-cloud-security_center_management-v1/.toys.rb deleted file mode 100644 index 177e22456e8a..000000000000 --- a/owl-bot-staging/google-cloud-security_center_management-v1/.toys.rb +++ /dev/null @@ -1,28 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -toys_version! ">= 0.15.3" - -if ENV["RUBY_COMMON_TOOLS"] - common_tools_dir = File.expand_path ENV["RUBY_COMMON_TOOLS"] - load File.join(common_tools_dir, "toys", "gapic") -else - load_git remote: "https://github.com/googleapis/ruby-common-tools.git", - path: "toys/gapic", - update: true -end diff --git a/owl-bot-staging/google-cloud-security_center_management-v1/.yardopts b/owl-bot-staging/google-cloud-security_center_management-v1/.yardopts deleted file mode 100644 index e42b7f692e9a..000000000000 --- a/owl-bot-staging/google-cloud-security_center_management-v1/.yardopts +++ /dev/null @@ -1,12 +0,0 @@ ---no-private ---title="Security Command Center Management V1 API" ---exclude _pb\.rb$ ---markup markdown ---markup-provider redcarpet - -./lib/**/*.rb -./proto_docs/**/*.rb -- -README.md -LICENSE.md -AUTHENTICATION.md diff --git a/owl-bot-staging/google-cloud-security_center_management-v1/AUTHENTICATION.md b/owl-bot-staging/google-cloud-security_center_management-v1/AUTHENTICATION.md deleted file mode 100644 index 2e810e8e608e..000000000000 --- a/owl-bot-staging/google-cloud-security_center_management-v1/AUTHENTICATION.md +++ /dev/null @@ -1,122 +0,0 @@ -# Authentication - -The recommended way to authenticate to the google-cloud-security_center_management-v1 library is to use -[Application Default Credentials (ADC)](https://cloud.google.com/docs/authentication/application-default-credentials). -To review all of your authentication options, see [Credentials lookup](#credential-lookup). - -## Quickstart - -The following example shows how to set up authentication for a local development -environment with your user credentials. - -**NOTE:** This method is _not_ recommended for running in production. User credentials -should be used only during development. - -1. [Download and install the Google Cloud CLI](https://cloud.google.com/sdk). -2. Set up a local ADC file with your user credentials: - -```sh -gcloud auth application-default login -``` - -3. Write code as if already authenticated. - -For more information about setting up authentication for a local development environment, see -[Set up Application Default Credentials](https://cloud.google.com/docs/authentication/provide-credentials-adc#local-dev). - -## Credential Lookup - -The google-cloud-security_center_management-v1 library provides several mechanisms to configure your system. -Generally, using Application Default Credentials to facilitate automatic -credentials discovery is the easist method. But if you need to explicitly specify -credentials, there are several methods available to you. - -Credentials are accepted in the following ways, in the following order or precedence: - -1. Credentials specified in method arguments -2. Credentials specified in configuration -3. Credentials pointed to or included in environment variables -4. Credentials found in local ADC file -5. Credentials returned by the metadata server for the attached service account (GCP) - -### Configuration - -You can configure a path to a JSON credentials file, either for an individual client object or -globally, for all client objects. The JSON file can contain credentials created for -[workload identity federation](https://cloud.google.com/iam/docs/workload-identity-federation), -[workforce identity federation](https://cloud.google.com/iam/docs/workforce-identity-federation), or a -[service account key](https://cloud.google.com/docs/authentication/provide-credentials-adc#local-key). - -Note: Service account keys are a security risk if not managed correctly. You should -[choose a more secure alternative to service account keys](https://cloud.google.com/docs/authentication#auth-decision-tree) -whenever possible. - -To configure a credentials file for an individual client initialization: - -```ruby -require "google/cloud/security_center_management/v1" - -client = ::Google::Cloud::SecurityCenterManagement::V1::SecurityCenterManagement::Client.new do |config| - config.credentials = "path/to/credentialfile.json" -end -``` - -To configure a credentials file globally for all clients: - -```ruby -require "google/cloud/security_center_management/v1" - -::Google::Cloud::SecurityCenterManagement::V1::SecurityCenterManagement::Client.configure do |config| - config.credentials = "path/to/credentialfile.json" -end - -client = ::Google::Cloud::SecurityCenterManagement::V1::SecurityCenterManagement::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-security_center_management-v1 -checks for credentials are: - -* `GOOGLE_CLOUD_CREDENTIALS` - Path to JSON file, or JSON contents -* `GOOGLE_APPLICATION_CREDENTIALS` - Path to JSON file - -```ruby -require "google/cloud/security_center_management/v1" - -ENV["GOOGLE_APPLICATION_CREDENTIALS"] = "path/to/credentialfile.json" - -client = ::Google::Cloud::SecurityCenterManagement::V1::SecurityCenterManagement::Client.new -``` - -### Local ADC file - -You can set up a local ADC file with your user credentials for authentication during -development. If credentials are not provided in code or in environment variables, -then the local ADC credentials are discovered. - -Follow the steps in [Quickstart](#quickstart) to set up a local ADC file. - -### Google Cloud Platform environments - -When running on Google Cloud Platform (GCP), including Google Compute Engine -(GCE), Google Kubernetes Engine (GKE), Google App Engine (GAE), Google Cloud -Functions (GCF) and Cloud Run, credentials are retrieved from the attached -service account automatically. Code should be written as if already authenticated. - -For more information, see -[Set up ADC for Google Cloud services](https://cloud.google.com/docs/authentication/provide-credentials-adc#attached-sa). diff --git a/owl-bot-staging/google-cloud-security_center_management-v1/CHANGELOG.md b/owl-bot-staging/google-cloud-security_center_management-v1/CHANGELOG.md deleted file mode 100644 index f88957a62ba2..000000000000 --- a/owl-bot-staging/google-cloud-security_center_management-v1/CHANGELOG.md +++ /dev/null @@ -1,2 +0,0 @@ -# Release History - diff --git a/owl-bot-staging/google-cloud-security_center_management-v1/Gemfile b/owl-bot-staging/google-cloud-security_center_management-v1/Gemfile deleted file mode 100644 index 1d08558908d8..000000000000 --- a/owl-bot-staging/google-cloud-security_center_management-v1/Gemfile +++ /dev/null @@ -1,14 +0,0 @@ -source "https://rubygems.org" - -gemspec - -gem "google-style", "~> 1.32.0" -gem "irb", "~> 1.17" -gem "minitest", "~> 6.0.2" -gem "minitest-focus", "~> 1.4" -gem "minitest-mock", "~> 5.27" -gem "minitest-rg", "~> 5.3" -gem "ostruct", "~> 0.5.5" -gem "rake", ">= 13.0" -gem "redcarpet", "~> 3.6" -gem "yard", "~> 0.9" diff --git a/owl-bot-staging/google-cloud-security_center_management-v1/LICENSE.md b/owl-bot-staging/google-cloud-security_center_management-v1/LICENSE.md deleted file mode 100644 index c261857ba6ad..000000000000 --- a/owl-bot-staging/google-cloud-security_center_management-v1/LICENSE.md +++ /dev/null @@ -1,201 +0,0 @@ - Apache License - Version 2.0, January 2004 - http://www.apache.org/licenses/ - - TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION - - 1. Definitions. - - "License" shall mean the terms and conditions for use, reproduction, - and distribution as defined by Sections 1 through 9 of this document. - - "Licensor" shall mean the copyright owner or entity authorized by - the copyright owner that is granting the License. - - "Legal Entity" shall mean the union of the acting entity and all - other entities that control, are controlled by, or are under common - control with that entity. For the purposes of this definition, - "control" means (i) the power, direct or indirect, to cause the - direction or management of such entity, whether by contract or - otherwise, or (ii) ownership of fifty percent (50%) or more of the - outstanding shares, or (iii) beneficial ownership of such entity. - - "You" (or "Your") shall mean an individual or Legal Entity - exercising permissions granted by this License. - - "Source" form shall mean the preferred form for making modifications, - including but not limited to software source code, documentation - source, and configuration files. - - "Object" form shall mean any form resulting from mechanical - transformation or translation of a Source form, including but - not limited to compiled object code, generated documentation, - and conversions to other media types. - - "Work" shall mean the work of authorship, whether in Source or - Object form, made available under the License, as indicated by a - copyright notice that is included in or attached to the work - (an example is provided in the Appendix below). - - "Derivative Works" shall mean any work, whether in Source or Object - form, that is based on (or derived from) the Work and for which the - editorial revisions, annotations, elaborations, or other modifications - represent, as a whole, an original work of authorship. For the purposes - of this License, Derivative Works shall not include works that remain - separable from, or merely link (or bind by name) to the interfaces of, - the Work and Derivative Works thereof. - - "Contribution" shall mean any work of authorship, including - the original version of the Work and any modifications or additions - to that Work or Derivative Works thereof, that is intentionally - submitted to Licensor for inclusion in the Work by the copyright owner - or by an individual or Legal Entity authorized to submit on behalf of - the copyright owner. For the purposes of this definition, "submitted" - means any form of electronic, verbal, or written communication sent - to the Licensor or its representatives, including but not limited to - communication on electronic mailing lists, source code control systems, - and issue tracking systems that are managed by, or on behalf of, the - Licensor for the purpose of discussing and improving the Work, but - excluding communication that is conspicuously marked or otherwise - designated in writing by the copyright owner as "Not a Contribution." - - "Contributor" shall mean Licensor and any individual or Legal Entity - on behalf of whom a Contribution has been received by Licensor and - subsequently incorporated within the Work. - - 2. Grant of Copyright License. Subject to the terms and conditions of - this License, each Contributor hereby grants to You a perpetual, - worldwide, non-exclusive, no-charge, royalty-free, irrevocable - copyright license to reproduce, prepare Derivative Works of, - publicly display, publicly perform, sublicense, and distribute the - Work and such Derivative Works in Source or Object form. - - 3. Grant of Patent License. Subject to the terms and conditions of - this License, each Contributor hereby grants to You a perpetual, - worldwide, non-exclusive, no-charge, royalty-free, irrevocable - (except as stated in this section) patent license to make, have made, - use, offer to sell, sell, import, and otherwise transfer the Work, - where such license applies only to those patent claims licensable - by such Contributor that are necessarily infringed by their - Contribution(s) alone or by combination of their Contribution(s) - with the Work to which such Contribution(s) was submitted. If You - institute patent litigation against any entity (including a - cross-claim or counterclaim in a lawsuit) alleging that the Work - or a Contribution incorporated within the Work constitutes direct - or contributory patent infringement, then any patent licenses - granted to You under this License for that Work shall terminate - as of the date such litigation is filed. - - 4. Redistribution. You may reproduce and distribute copies of the - Work or Derivative Works thereof in any medium, with or without - modifications, and in Source or Object form, provided that You - meet the following conditions: - - (a) You must give any other recipients of the Work or - Derivative Works a copy of this License; and - - (b) You must cause any modified files to carry prominent notices - stating that You changed the files; and - - (c) You must retain, in the Source form of any Derivative Works - that You distribute, all copyright, patent, trademark, and - attribution notices from the Source form of the Work, - excluding those notices that do not pertain to any part of - the Derivative Works; and - - (d) If the Work includes a "NOTICE" text file as part of its - distribution, then any Derivative Works that You distribute must - include a readable copy of the attribution notices contained - within such NOTICE file, excluding those notices that do not - pertain to any part of the Derivative Works, in at least one - of the following places: within a NOTICE text file distributed - as part of the Derivative Works; within the Source form or - documentation, if provided along with the Derivative Works; or, - within a display generated by the Derivative Works, if and - wherever such third-party notices normally appear. The contents - of the NOTICE file are for informational purposes only and - do not modify the License. You may add Your own attribution - notices within Derivative Works that You distribute, alongside - or as an addendum to the NOTICE text from the Work, provided - that such additional attribution notices cannot be construed - as modifying the License. - - You may add Your own copyright statement to Your modifications and - may provide additional or different license terms and conditions - for use, reproduction, or distribution of Your modifications, or - for any such Derivative Works as a whole, provided Your use, - reproduction, and distribution of the Work otherwise complies with - the conditions stated in this License. - - 5. Submission of Contributions. Unless You explicitly state otherwise, - any Contribution intentionally submitted for inclusion in the Work - by You to the Licensor shall be under the terms and conditions of - this License, without any additional terms or conditions. - Notwithstanding the above, nothing herein shall supersede or modify - the terms of any separate license agreement you may have executed - with Licensor regarding such Contributions. - - 6. Trademarks. This License does not grant permission to use the trade - names, trademarks, service marks, or product names of the Licensor, - except as required for reasonable and customary use in describing the - origin of the Work and reproducing the content of the NOTICE file. - - 7. Disclaimer of Warranty. Unless required by applicable law or - agreed to in writing, Licensor provides the Work (and each - Contributor provides its Contributions) on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or - implied, including, without limitation, any warranties or conditions - of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A - PARTICULAR PURPOSE. You are solely responsible for determining the - appropriateness of using or redistributing the Work and assume any - risks associated with Your exercise of permissions under this License. - - 8. Limitation of Liability. In no event and under no legal theory, - whether in tort (including negligence), contract, or otherwise, - unless required by applicable law (such as deliberate and grossly - negligent acts) or agreed to in writing, shall any Contributor be - liable to You for damages, including any direct, indirect, special, - incidental, or consequential damages of any character arising as a - result of this License or out of the use or inability to use the - Work (including but not limited to damages for loss of goodwill, - work stoppage, computer failure or malfunction, or any and all - other commercial damages or losses), even if such Contributor - has been advised of the possibility of such damages. - - 9. Accepting Warranty or Additional Liability. While redistributing - the Work or Derivative Works thereof, You may choose to offer, - and charge a fee for, acceptance of support, warranty, indemnity, - or other liability obligations and/or rights consistent with this - License. However, in accepting such obligations, You may act only - on Your own behalf and on Your sole responsibility, not on behalf - of any other Contributor, and only if You agree to indemnify, - defend, and hold each Contributor harmless for any liability - incurred by, or claims asserted against, such Contributor by reason - of your accepting any such warranty or additional liability. - - END OF TERMS AND CONDITIONS - - APPENDIX: How to apply the Apache License to your work. - - To apply the Apache License to your work, attach the following - boilerplate notice, with the fields enclosed by brackets "[]" - replaced with your own identifying information. (Don't include - the brackets!) The text should be enclosed in the appropriate - comment syntax for the file format. We also recommend that a - file or class name and description of purpose be included on the - same "printed page" as the copyright notice for easier - identification within third-party archives. - - Copyright [yyyy] [name of copyright owner] - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. diff --git a/owl-bot-staging/google-cloud-security_center_management-v1/README.md b/owl-bot-staging/google-cloud-security_center_management-v1/README.md deleted file mode 100644 index 521869e5f030..000000000000 --- a/owl-bot-staging/google-cloud-security_center_management-v1/README.md +++ /dev/null @@ -1,154 +0,0 @@ -# Ruby Client for the Security Command Center Management V1 API - -Management API for Security Command Center, a built-in security and risk management solution for Google Cloud. Use this API to programmatically update the settings and configuration of Security Command Center. - -Management API for Security Command Center, a built-in security and risk management solution for Google Cloud. Use this API to programmatically update the settings and configuration of Security Command Center. - -https://github.com/googleapis/google-cloud-ruby - -This gem is a _versioned_ client. It provides basic client classes for a -specific version of the Security Command Center Management V1 API. Most users should consider using -the main client gem, -[google-cloud-security_center_management](https://rubygems.org/gems/google-cloud-security_center_management). -See the section below titled *Which client should I use?* for more information. - -## Installation - -``` -$ gem install google-cloud-security_center_management-v1 -``` - -## Before You Begin - -In order to use this library, you first need to go through the following steps: - -1. [Select or create a Cloud Platform project.](https://console.cloud.google.com/project) -1. [Enable billing for your project.](https://cloud.google.com/billing/docs/how-to/modify-project#enable_billing_for_a_project) -1. [Enable the API.](https://console.cloud.google.com/apis/library/securitycentermanagement.googleapis.com) -1. [Set up authentication.](AUTHENTICATION.md) - -## Quick Start - -```ruby -require "google/cloud/security_center_management/v1" - -client = ::Google::Cloud::SecurityCenterManagement::V1::SecurityCenterManagement::Client.new -request = ::Google::Cloud::SecurityCenterManagement::V1::ListEffectiveSecurityHealthAnalyticsCustomModulesRequest.new # (request fields as keyword arguments...) -response = client.list_effective_security_health_analytics_custom_modules request -``` - -View the [Client Library Documentation](https://cloud.google.com/ruby/docs/reference/google-cloud-security_center_management-v1/latest) -for class and method documentation. - -See also the [Product Documentation](https://cloud.google.com/security-command-center/docs/reference/security-center-management/rest) -for general usage information. - -## Debug Logging - -This library comes with opt-in Debug Logging that can help you troubleshoot -your application's integration with the API. When logging is activated, key -events such as requests and responses, along with data payloads and metadata -such as headers and client configuration, are logged to the standard error -stream. - -**WARNING:** Client Library Debug Logging includes your data payloads in -plaintext, which could include sensitive data such as PII for yourself or your -customers, private keys, or other security data that could be compromising if -leaked. Always practice good data hygiene with your application logs, and follow -the principle of least access. Google also recommends that Client Library Debug -Logging be enabled only temporarily during active debugging, and not used -permanently in production. - -To enable logging, set the environment variable `GOOGLE_SDK_RUBY_LOGGING_GEMS` -to the value `all`. Alternatively, you can set the value to a comma-delimited -list of client library gem names. This will select the default logging behavior, -which writes logs to the standard error stream. On a local workstation, this may -result in logs appearing on the console. When running on a Google Cloud hosting -service such as [Google Cloud Run](https://cloud.google.com/run), this generally -results in logs appearing alongside your application logs in the -[Google Cloud Logging](https://cloud.google.com/logging/) service. - -You can customize logging by modifying the `logger` configuration when -constructing a client object. For example: - -```ruby -require "google/cloud/security_center_management/v1" -require "logger" - -client = ::Google::Cloud::SecurityCenterManagement::V1::SecurityCenterManagement::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-security_center_management`, -and lower-level _versioned_ client libraries with names such as -`google-cloud-security_center_management-v1`. -_In most cases, you should install the main client._ - -### What's the difference between the main client and a versioned client? - -A _versioned client_ provides a basic set of data types and client classes for -a _single version_ of a specific service. (That is, for a service with multiple -versions, there might be a separate versioned client for each service version.) -Most versioned clients are written and maintained by a code generator. - -The _main client_ is designed to provide you with the _recommended_ client -interfaces for the service. There will be only one main client for any given -service, even a service with multiple versions. The main client includes -factory methods for constructing the client objects we recommend for most -users. In some cases, those will be classes provided by an underlying versioned -client; in other cases, they will be handwritten higher-level client objects -with additional capabilities, convenience methods, or best practices built in. -Generally, the main client will default to a recommended service version, -although in some cases you can override this if you need to talk to a specific -service version. - -### Why would I want to use the main client? - -We recommend that most users install the main client gem for a service. You can -identify this gem as the one _without_ a version in its name, e.g. -`google-cloud-security_center_management`. -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-security_center_management-v1`. - -### What about the google-apis- clients? - -Client library gems with names that begin with `google-apis-` are based on an -older code generation technology. They talk to a REST/JSON backend (whereas -most modern clients talk to a [gRPC](https://grpc.io/) backend) and they may -not offer the same performance, features, and ease of use provided by more -modern clients. - -The `google-apis-` clients have wide coverage across Google services, so you -might need to use one if there is no modern client available for the service. -However, if a modern client is available, we generally recommend it over the -older `google-apis-` clients. diff --git a/owl-bot-staging/google-cloud-security_center_management-v1/Rakefile b/owl-bot-staging/google-cloud-security_center_management-v1/Rakefile deleted file mode 100644 index 48a25ec27530..000000000000 --- a/owl-bot-staging/google-cloud-security_center_management-v1/Rakefile +++ /dev/null @@ -1,169 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -require "bundler/setup" -require "bundler/gem_tasks" - -require "rubocop/rake_task" -RuboCop::RakeTask.new - -require "rake/testtask" -desc "Run tests." -Rake::TestTask.new do |t| - t.libs << "test" - t.test_files = FileList["test/**/*_test.rb"] - t.warning = false -end - -desc "Runs the smoke tests." -Rake::TestTask.new :smoke_test do |t| - t.test_files = FileList["acceptance/**/*smoke_test.rb"] - t.warning = false -end - -# Acceptance tests -desc "Run the google-cloud-security_center_management-v1 acceptance tests." -task :acceptance, :project, :keyfile do |t, args| - project = args[:project] - project ||= - ENV["GOOGLE_CLOUD_TEST_PROJECT"] || - ENV["GCLOUD_TEST_PROJECT"] - keyfile = args[:keyfile] - keyfile ||= - ENV["GOOGLE_CLOUD_TEST_KEYFILE"] || - ENV["GCLOUD_TEST_KEYFILE"] - if keyfile - keyfile = File.read keyfile - else - keyfile ||= - ENV["GOOGLE_CLOUD_TEST_KEYFILE_JSON"] || - ENV["GCLOUD_TEST_KEYFILE_JSON"] - end - if project.nil? || keyfile.nil? - fail "You must provide a project and keyfile. e.g. rake acceptance[test123, /path/to/keyfile.json] or GOOGLE_CLOUD_TEST_PROJECT=test123 GOOGLE_CLOUD_TEST_KEYFILE=/path/to/keyfile.json rake acceptance" - end - require "google/cloud/security_center_management/v1/security_center_management/credentials" - ::Google::Cloud::SecurityCenterManagement::V1::SecurityCenterManagement::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-security_center_management-v1 gem has no acceptance tests." - end - end - - desc "Run acceptance cleanup." - task :cleanup do - end -end - -task :samples do - Rake::Task["samples:latest"].invoke -end - -namespace :samples do - task :latest do - if File.directory? "samples" - Dir.chdir "samples" do - Bundler.with_clean_env do - ENV["GOOGLE_CLOUD_SAMPLES_TEST"] = "not_master" - sh "bundle update" - sh "bundle exec rake test" - end - end - else - puts "The google-cloud-security_center_management-v1 gem has no samples to test." - end - end - - task :master do - if File.directory? "samples" - Dir.chdir "samples" do - Bundler.with_clean_env do - ENV["GOOGLE_CLOUD_SAMPLES_TEST"] = "master" - sh "bundle update" - sh "bundle exec rake test" - end - end - else - puts "The google-cloud-security_center_management-v1 gem has no samples to test." - end - end -end - -require "yard" -require "yard/rake/yardoc_task" -YARD::Rake::YardocTask.new do |y| - y.options << "--fail-on-warning" -end - -desc "Run yard-doctest example tests." -task :doctest do - puts "The google-cloud-security_center_management-v1 gem does not have doctest tests." -end - -desc "Run the CI build" -task :ci do - header "BUILDING google-cloud-security_center_management-v1" - header "google-cloud-security_center_management-v1 rubocop", "*" - Rake::Task[:rubocop].invoke - header "google-cloud-security_center_management-v1 yard", "*" - Rake::Task[:yard].invoke - header "google-cloud-security_center_management-v1 test", "*" - Rake::Task[:test].invoke -end - -namespace :ci do - desc "Run the CI build, with smoke tests." - task :smoke_test do - Rake::Task[:ci].invoke - header "google-cloud-security_center_management-v1 smoke_test", "*" - Rake::Task[:smoke_test].invoke - end - desc "Run the CI build, with acceptance tests." - task :acceptance do - Rake::Task[:ci].invoke - header "google-cloud-security_center_management-v1 acceptance", "*" - Rake::Task[:acceptance].invoke - end - task :a do - # This is a handy shortcut to save typing - Rake::Task["ci:acceptance"].invoke - end -end - -task default: :test - -def header str, token = "#" - line_length = str.length + 8 - puts "" - puts token * line_length - puts "#{token * 3} #{str} #{token * 3}" - puts token * line_length - puts "" -end diff --git a/owl-bot-staging/google-cloud-security_center_management-v1/gapic_metadata.json b/owl-bot-staging/google-cloud-security_center_management-v1/gapic_metadata.json deleted file mode 100644 index a1ebc19f46fd..000000000000 --- a/owl-bot-staging/google-cloud-security_center_management-v1/gapic_metadata.json +++ /dev/null @@ -1,123 +0,0 @@ -{ - "schema": "1.0", - "comment": "This file maps proto services/RPCs to the corresponding library clients/methods", - "language": "ruby", - "protoPackage": "google.cloud.securitycentermanagement.v1", - "libraryPackage": "::Google::Cloud::SecurityCenterManagement::V1", - "services": { - "SecurityCenterManagement": { - "clients": { - "grpc": { - "libraryClient": "::Google::Cloud::SecurityCenterManagement::V1::SecurityCenterManagement::Client", - "rpcs": { - "ListEffectiveSecurityHealthAnalyticsCustomModules": { - "methods": [ - "list_effective_security_health_analytics_custom_modules" - ] - }, - "GetEffectiveSecurityHealthAnalyticsCustomModule": { - "methods": [ - "get_effective_security_health_analytics_custom_module" - ] - }, - "ListSecurityHealthAnalyticsCustomModules": { - "methods": [ - "list_security_health_analytics_custom_modules" - ] - }, - "ListDescendantSecurityHealthAnalyticsCustomModules": { - "methods": [ - "list_descendant_security_health_analytics_custom_modules" - ] - }, - "GetSecurityHealthAnalyticsCustomModule": { - "methods": [ - "get_security_health_analytics_custom_module" - ] - }, - "CreateSecurityHealthAnalyticsCustomModule": { - "methods": [ - "create_security_health_analytics_custom_module" - ] - }, - "UpdateSecurityHealthAnalyticsCustomModule": { - "methods": [ - "update_security_health_analytics_custom_module" - ] - }, - "DeleteSecurityHealthAnalyticsCustomModule": { - "methods": [ - "delete_security_health_analytics_custom_module" - ] - }, - "SimulateSecurityHealthAnalyticsCustomModule": { - "methods": [ - "simulate_security_health_analytics_custom_module" - ] - }, - "ListEffectiveEventThreatDetectionCustomModules": { - "methods": [ - "list_effective_event_threat_detection_custom_modules" - ] - }, - "GetEffectiveEventThreatDetectionCustomModule": { - "methods": [ - "get_effective_event_threat_detection_custom_module" - ] - }, - "ListEventThreatDetectionCustomModules": { - "methods": [ - "list_event_threat_detection_custom_modules" - ] - }, - "ListDescendantEventThreatDetectionCustomModules": { - "methods": [ - "list_descendant_event_threat_detection_custom_modules" - ] - }, - "GetEventThreatDetectionCustomModule": { - "methods": [ - "get_event_threat_detection_custom_module" - ] - }, - "CreateEventThreatDetectionCustomModule": { - "methods": [ - "create_event_threat_detection_custom_module" - ] - }, - "UpdateEventThreatDetectionCustomModule": { - "methods": [ - "update_event_threat_detection_custom_module" - ] - }, - "DeleteEventThreatDetectionCustomModule": { - "methods": [ - "delete_event_threat_detection_custom_module" - ] - }, - "ValidateEventThreatDetectionCustomModule": { - "methods": [ - "validate_event_threat_detection_custom_module" - ] - }, - "GetSecurityCenterService": { - "methods": [ - "get_security_center_service" - ] - }, - "ListSecurityCenterServices": { - "methods": [ - "list_security_center_services" - ] - }, - "UpdateSecurityCenterService": { - "methods": [ - "update_security_center_service" - ] - } - } - } - } - } - } -} diff --git a/owl-bot-staging/google-cloud-security_center_management-v1/google-cloud-security_center_management-v1.gemspec b/owl-bot-staging/google-cloud-security_center_management-v1/google-cloud-security_center_management-v1.gemspec deleted file mode 100644 index 3ce9ab398fcd..000000000000 --- a/owl-bot-staging/google-cloud-security_center_management-v1/google-cloud-security_center_management-v1.gemspec +++ /dev/null @@ -1,30 +0,0 @@ -# -*- ruby -*- -# encoding: utf-8 - -require File.expand_path("lib/google/cloud/security_center_management/v1/version", __dir__) - -Gem::Specification.new do |gem| - gem.name = "google-cloud-security_center_management-v1" - gem.version = Google::Cloud::SecurityCenterManagement::V1::VERSION - - gem.authors = ["Google LLC"] - gem.email = "googleapis-packages@google.com" - gem.description = "Management API for Security Command Center, a built-in security and risk management solution for Google Cloud. Use this API to programmatically update the settings and configuration of Security Command Center. Note that google-cloud-security_center_management-v1 is a version-specific client library. For most uses, we recommend installing the main client library google-cloud-security_center_management instead. See the readme for more details." - gem.summary = "Management API for Security Command Center, a built-in security and risk management solution for Google Cloud. Use this API to programmatically update the settings and configuration of Security Command Center." - 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" - gem.add_dependency "grpc-google-iam-v1", "~> 1.11" -end diff --git a/owl-bot-staging/google-cloud-security_center_management-v1/lib/google-cloud-security_center_management-v1.rb b/owl-bot-staging/google-cloud-security_center_management-v1/lib/google-cloud-security_center_management-v1.rb deleted file mode 100644 index 64c9d0aec5c2..000000000000 --- a/owl-bot-staging/google-cloud-security_center_management-v1/lib/google-cloud-security_center_management-v1.rb +++ /dev/null @@ -1,21 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -# This gem does not autoload during Bundler.require. To load this gem, -# issue explicit require statements for the packages desired, e.g.: -# require "google/cloud/security_center_management/v1" diff --git a/owl-bot-staging/google-cloud-security_center_management-v1/lib/google/cloud/security_center_management/v1.rb b/owl-bot-staging/google-cloud-security_center_management-v1/lib/google/cloud/security_center_management/v1.rb deleted file mode 100644 index a6774f1f6c46..000000000000 --- a/owl-bot-staging/google-cloud-security_center_management-v1/lib/google/cloud/security_center_management/v1.rb +++ /dev/null @@ -1,45 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -require "google/cloud/security_center_management/v1/security_center_management" -require "google/cloud/security_center_management/v1/version" - -module Google - module Cloud - module SecurityCenterManagement - ## - # API client module. - # - # @example Load this package, including all its services, and instantiate a gRPC client - # - # require "google/cloud/security_center_management/v1" - # client = ::Google::Cloud::SecurityCenterManagement::V1::SecurityCenterManagement::Client.new - # - # @example Load this package, including all its services, and instantiate a REST client - # - # require "google/cloud/security_center_management/v1" - # client = ::Google::Cloud::SecurityCenterManagement::V1::SecurityCenterManagement::Rest::Client.new - # - module V1 - end - end - end -end - -helper_path = ::File.join __dir__, "v1", "_helpers.rb" -require "google/cloud/security_center_management/v1/_helpers" if ::File.file? helper_path diff --git a/owl-bot-staging/google-cloud-security_center_management-v1/lib/google/cloud/security_center_management/v1/bindings_override.rb b/owl-bot-staging/google-cloud-security_center_management-v1/lib/google/cloud/security_center_management/v1/bindings_override.rb deleted file mode 100644 index a6a097cc314f..000000000000 --- a/owl-bot-staging/google-cloud-security_center_management-v1/lib/google/cloud/security_center_management/v1/bindings_override.rb +++ /dev/null @@ -1,75 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -require "gapic/rest" - -module Google - module Cloud - module SecurityCenterManagement - ## - # @example Loading just the REST part of this package, including all its services, and instantiating a REST client - # - # require "google/cloud/security_center_management/v1/rest" - # client = ::Google::Cloud::SecurityCenterManagement::V1::SecurityCenterManagement::Rest::Client.new - # - module V1 - ## - # @private - # Initialize the mixin bindings configuration - # - def self.configure - @configure ||= begin - namespace = ["Google", "Cloud", "SecurityCenterManagement"] - parent_config = while namespace.any? - parent_name = namespace.join "::" - parent_const = const_get parent_name - break parent_const.configure if parent_const.respond_to? :configure - namespace.pop - end - - default_config = ::Gapic::Rest::HttpBindingOverrideConfiguration.new parent_config - default_config.bindings_override["google.cloud.location.Locations.GetLocation"] = [ - Gapic::Rest::GrpcTranscoder::HttpBinding.create_with_validation( - uri_method: :get, - uri_template: "/v1/{name}", - matches: [ - ["name", %r{^projects/[^/]+/locations/[^/]+/?$}, false] - ], - body: nil - ) - ] - default_config.bindings_override["google.cloud.location.Locations.ListLocations"] = [ - - Gapic::Rest::GrpcTranscoder::HttpBinding.create_with_validation( - uri_method: :get, - uri_template: "/v1/{name}/locations", - matches: [ - ["name", %r{^projects/[^/]+/?$}, false] - ], - body: nil - ) - ] - default_config - end - yield @configure if block_given? - @configure - end - end - end - end -end diff --git a/owl-bot-staging/google-cloud-security_center_management-v1/lib/google/cloud/security_center_management/v1/rest.rb b/owl-bot-staging/google-cloud-security_center_management-v1/lib/google/cloud/security_center_management/v1/rest.rb deleted file mode 100644 index 26d917a7bf92..000000000000 --- a/owl-bot-staging/google-cloud-security_center_management-v1/lib/google/cloud/security_center_management/v1/rest.rb +++ /dev/null @@ -1,38 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -require "google/cloud/security_center_management/v1/security_center_management/rest" -require "google/cloud/security_center_management/v1/bindings_override" -require "google/cloud/security_center_management/v1/version" - -module Google - module Cloud - module SecurityCenterManagement - ## - # To load just the REST part of this package, including all its services, and instantiate a REST client: - # - # @example - # - # require "google/cloud/security_center_management/v1/rest" - # client = ::Google::Cloud::SecurityCenterManagement::V1::SecurityCenterManagement::Rest::Client.new - # - module V1 - end - end - end -end diff --git a/owl-bot-staging/google-cloud-security_center_management-v1/lib/google/cloud/security_center_management/v1/security_center_management.rb b/owl-bot-staging/google-cloud-security_center_management-v1/lib/google/cloud/security_center_management/v1/security_center_management.rb deleted file mode 100644 index f906e0bc11fd..000000000000 --- a/owl-bot-staging/google-cloud-security_center_management-v1/lib/google/cloud/security_center_management/v1/security_center_management.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/security_center_management/v1/version" - -require "google/cloud/security_center_management/v1/security_center_management/credentials" -require "google/cloud/security_center_management/v1/security_center_management/paths" -require "google/cloud/security_center_management/v1/security_center_management/client" -require "google/cloud/security_center_management/v1/security_center_management/rest" - -module Google - module Cloud - module SecurityCenterManagement - module V1 - ## - # Service describing handlers for resources - # - # @example Load this service and instantiate a gRPC client - # - # require "google/cloud/security_center_management/v1/security_center_management" - # client = ::Google::Cloud::SecurityCenterManagement::V1::SecurityCenterManagement::Client.new - # - # @example Load this service and instantiate a REST client - # - # require "google/cloud/security_center_management/v1/security_center_management/rest" - # client = ::Google::Cloud::SecurityCenterManagement::V1::SecurityCenterManagement::Rest::Client.new - # - module SecurityCenterManagement - end - end - end - end -end - -helper_path = ::File.join __dir__, "security_center_management", "helpers.rb" -require "google/cloud/security_center_management/v1/security_center_management/helpers" if ::File.file? helper_path diff --git a/owl-bot-staging/google-cloud-security_center_management-v1/lib/google/cloud/security_center_management/v1/security_center_management/client.rb b/owl-bot-staging/google-cloud-security_center_management-v1/lib/google/cloud/security_center_management/v1/security_center_management/client.rb deleted file mode 100644 index 99a43500f3e0..000000000000 --- a/owl-bot-staging/google-cloud-security_center_management-v1/lib/google/cloud/security_center_management/v1/security_center_management/client.rb +++ /dev/null @@ -1,2790 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -require "google/cloud/errors" -require "google/cloud/securitycentermanagement/v1/security_center_management_pb" -require "google/cloud/location" - -module Google - module Cloud - module SecurityCenterManagement - module V1 - module SecurityCenterManagement - ## - # Client for the SecurityCenterManagement service. - # - # Service describing handlers for resources - # - class Client - # @private - API_VERSION = "" - - # @private - DEFAULT_ENDPOINT_TEMPLATE = "securitycentermanagement.$UNIVERSE_DOMAIN$" - - include Paths - - # @private - attr_reader :security_center_management_stub - - ## - # Configure the SecurityCenterManagement Client class. - # - # See {::Google::Cloud::SecurityCenterManagement::V1::SecurityCenterManagement::Client::Configuration} - # for a description of the configuration fields. - # - # @example - # - # # Modify the configuration for all SecurityCenterManagement clients - # ::Google::Cloud::SecurityCenterManagement::V1::SecurityCenterManagement::Client.configure do |config| - # config.timeout = 10.0 - # end - # - # @yield [config] Configure the Client client. - # @yieldparam config [Client::Configuration] - # - # @return [Client::Configuration] - # - def self.configure - @configure ||= begin - namespace = ["Google", "Cloud", "SecurityCenterManagement", "V1"] - parent_config = while namespace.any? - parent_name = namespace.join "::" - parent_const = const_get parent_name - break parent_const.configure if parent_const.respond_to? :configure - namespace.pop - end - default_config = Client::Configuration.new parent_config - - default_config.rpcs.list_effective_security_health_analytics_custom_modules.timeout = 60.0 - default_config.rpcs.list_effective_security_health_analytics_custom_modules.retry_policy = { - initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [14, 4] - } - - default_config.rpcs.get_effective_security_health_analytics_custom_module.timeout = 60.0 - default_config.rpcs.get_effective_security_health_analytics_custom_module.retry_policy = { - initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [14, 4] - } - - default_config.rpcs.list_security_health_analytics_custom_modules.timeout = 60.0 - default_config.rpcs.list_security_health_analytics_custom_modules.retry_policy = { - initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [14, 4] - } - - default_config.rpcs.list_descendant_security_health_analytics_custom_modules.timeout = 60.0 - default_config.rpcs.list_descendant_security_health_analytics_custom_modules.retry_policy = { - initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [14, 4] - } - - default_config.rpcs.get_security_health_analytics_custom_module.timeout = 60.0 - default_config.rpcs.get_security_health_analytics_custom_module.retry_policy = { - initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [14, 4] - } - - default_config.rpcs.create_security_health_analytics_custom_module.timeout = 60.0 - - default_config.rpcs.update_security_health_analytics_custom_module.timeout = 60.0 - - default_config.rpcs.delete_security_health_analytics_custom_module.timeout = 60.0 - - default_config.rpcs.simulate_security_health_analytics_custom_module.timeout = 60.0 - default_config.rpcs.simulate_security_health_analytics_custom_module.retry_policy = { - initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [14, 4] - } - - default_config.rpcs.list_effective_event_threat_detection_custom_modules.timeout = 60.0 - default_config.rpcs.list_effective_event_threat_detection_custom_modules.retry_policy = { - initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [14, 4] - } - - default_config.rpcs.get_effective_event_threat_detection_custom_module.timeout = 60.0 - default_config.rpcs.get_effective_event_threat_detection_custom_module.retry_policy = { - initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [14, 4] - } - - default_config.rpcs.list_event_threat_detection_custom_modules.timeout = 60.0 - default_config.rpcs.list_event_threat_detection_custom_modules.retry_policy = { - initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [14, 4] - } - - default_config.rpcs.list_descendant_event_threat_detection_custom_modules.timeout = 60.0 - default_config.rpcs.list_descendant_event_threat_detection_custom_modules.retry_policy = { - initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [14, 4] - } - - default_config.rpcs.get_event_threat_detection_custom_module.timeout = 60.0 - default_config.rpcs.get_event_threat_detection_custom_module.retry_policy = { - initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [14, 4] - } - - default_config.rpcs.create_event_threat_detection_custom_module.timeout = 60.0 - - default_config.rpcs.update_event_threat_detection_custom_module.timeout = 60.0 - - default_config.rpcs.delete_event_threat_detection_custom_module.timeout = 60.0 - - default_config.rpcs.validate_event_threat_detection_custom_module.timeout = 60.0 - default_config.rpcs.validate_event_threat_detection_custom_module.retry_policy = { - initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [14, 4] - } - - default_config - end - yield @configure if block_given? - @configure - end - - ## - # Configure the SecurityCenterManagement Client instance. - # - # The configuration is set to the derived mode, meaning that values can be changed, - # but structural changes (adding new fields, etc.) are not allowed. Structural changes - # should be made on {Client.configure}. - # - # See {::Google::Cloud::SecurityCenterManagement::V1::SecurityCenterManagement::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 - @security_center_management_stub.universe_domain - end - - ## - # Create a new SecurityCenterManagement client object. - # - # @example - # - # # Create a client using the default configuration - # client = ::Google::Cloud::SecurityCenterManagement::V1::SecurityCenterManagement::Client.new - # - # # Create a client using a custom configuration - # client = ::Google::Cloud::SecurityCenterManagement::V1::SecurityCenterManagement::Client.new do |config| - # config.timeout = 10.0 - # end - # - # @yield [config] Configure the SecurityCenterManagement client. - # @yieldparam config [Client::Configuration] - # - def initialize - # These require statements are intentionally placed here to initialize - # the gRPC module only when it's required. - # See https://github.com/googleapis/toolkit/issues/446 - require "gapic/grpc" - require "google/cloud/securitycentermanagement/v1/security_center_management_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 - - @security_center_management_stub = ::Gapic::ServiceStub.new( - ::Google::Cloud::SecurityCenterManagement::V1::SecurityCenterManagement::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 - ) - - @security_center_management_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 = @security_center_management_stub.endpoint - config.universe_domain = @security_center_management_stub.universe_domain - config.logger = @security_center_management_stub.logger if config.respond_to? :logger= - end - end - - ## - # Get the associated client for mix-in of the Locations. - # - # @return [Google::Cloud::Location::Locations::Client] - # - attr_reader :location_client - - ## - # The logger used for request/response debug logging. - # - # @return [Logger] - # - def logger - @security_center_management_stub.logger - end - - # Service calls - - ## - # Returns a list of all - # {::Google::Cloud::SecurityCenterManagement::V1::EffectiveSecurityHealthAnalyticsCustomModule EffectiveSecurityHealthAnalyticsCustomModule} - # resources for the given parent. This includes resident modules defined at - # the scope of the parent, and inherited modules, inherited from ancestor - # organizations, folders, and projects (no descendants). - # - # @overload list_effective_security_health_analytics_custom_modules(request, options = nil) - # Pass arguments to `list_effective_security_health_analytics_custom_modules` via a request object, either of type - # {::Google::Cloud::SecurityCenterManagement::V1::ListEffectiveSecurityHealthAnalyticsCustomModulesRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::SecurityCenterManagement::V1::ListEffectiveSecurityHealthAnalyticsCustomModulesRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_effective_security_health_analytics_custom_modules(parent: nil, page_size: nil, page_token: nil) - # Pass arguments to `list_effective_security_health_analytics_custom_modules` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param parent [::String] - # Required. Name of parent to list effective custom modules, in one of the - # following formats: - # - # * `organizations/{organization}/locations/{location}` - # * `folders/{folder}/locations/{location}` - # * `projects/{project}/locations/{location}` - # @param page_size [::Integer] - # Optional. The maximum number of results to return in a single response. - # Default is 10, minimum is 1, maximum is 1000. - # @param page_token [::String] - # Optional. A pagination token returned from a previous request. Provide this - # token to retrieve the next page of results. - # - # When paginating, the rest of the request must match the request that - # generated the page token. - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Gapic::PagedEnumerable<::Google::Cloud::SecurityCenterManagement::V1::EffectiveSecurityHealthAnalyticsCustomModule>] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Gapic::PagedEnumerable<::Google::Cloud::SecurityCenterManagement::V1::EffectiveSecurityHealthAnalyticsCustomModule>] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/cloud/security_center_management/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::SecurityCenterManagement::V1::SecurityCenterManagement::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::SecurityCenterManagement::V1::ListEffectiveSecurityHealthAnalyticsCustomModulesRequest.new - # - # # Call the list_effective_security_health_analytics_custom_modules method. - # result = client.list_effective_security_health_analytics_custom_modules request - # - # # The returned object is of type Gapic::PagedEnumerable. You can iterate - # # over elements, and API calls will be issued to fetch pages as needed. - # result.each do |item| - # # Each element is of type ::Google::Cloud::SecurityCenterManagement::V1::EffectiveSecurityHealthAnalyticsCustomModule. - # p item - # end - # - def list_effective_security_health_analytics_custom_modules request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::SecurityCenterManagement::V1::ListEffectiveSecurityHealthAnalyticsCustomModulesRequest - - # Converts hash 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_effective_security_health_analytics_custom_modules.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::SecurityCenterManagement::V1::VERSION - metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - header_params = {} - if request.parent - header_params["parent"] = request.parent - end - - request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") - metadata[:"x-goog-request-params"] ||= request_params_header - - options.apply_defaults timeout: @config.rpcs.list_effective_security_health_analytics_custom_modules.timeout, - metadata: metadata, - retry_policy: @config.rpcs.list_effective_security_health_analytics_custom_modules.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @security_center_management_stub.call_rpc :list_effective_security_health_analytics_custom_modules, request, options: options do |response, operation| - response = ::Gapic::PagedEnumerable.new @security_center_management_stub, :list_effective_security_health_analytics_custom_modules, request, response, operation, options - yield response, operation if block_given? - throw :response, response - end - rescue ::GRPC::BadStatus => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Gets details of a single - # {::Google::Cloud::SecurityCenterManagement::V1::EffectiveSecurityHealthAnalyticsCustomModule EffectiveSecurityHealthAnalyticsCustomModule}. - # - # @overload get_effective_security_health_analytics_custom_module(request, options = nil) - # Pass arguments to `get_effective_security_health_analytics_custom_module` via a request object, either of type - # {::Google::Cloud::SecurityCenterManagement::V1::GetEffectiveSecurityHealthAnalyticsCustomModuleRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::SecurityCenterManagement::V1::GetEffectiveSecurityHealthAnalyticsCustomModuleRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_effective_security_health_analytics_custom_module(name: nil) - # Pass arguments to `get_effective_security_health_analytics_custom_module` via keyword arguments. Note that at - # least one keyword argument is 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 full resource name of the custom module, specified in one of - # the following formats: - # - # * `organizations/organization/{location}/effectiveSecurityHealthAnalyticsCustomModules/{custom_module}` - # * `folders/folder/{location}/effectiveSecurityHealthAnalyticsCustomModules/{custom_module}` - # * `projects/project/{location}/effectiveSecurityHealthAnalyticsCustomModules/{custom_module}` - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Google::Cloud::SecurityCenterManagement::V1::EffectiveSecurityHealthAnalyticsCustomModule] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Google::Cloud::SecurityCenterManagement::V1::EffectiveSecurityHealthAnalyticsCustomModule] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/cloud/security_center_management/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::SecurityCenterManagement::V1::SecurityCenterManagement::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::SecurityCenterManagement::V1::GetEffectiveSecurityHealthAnalyticsCustomModuleRequest.new - # - # # Call the get_effective_security_health_analytics_custom_module method. - # result = client.get_effective_security_health_analytics_custom_module request - # - # # The returned object is of type Google::Cloud::SecurityCenterManagement::V1::EffectiveSecurityHealthAnalyticsCustomModule. - # p result - # - def get_effective_security_health_analytics_custom_module request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::SecurityCenterManagement::V1::GetEffectiveSecurityHealthAnalyticsCustomModuleRequest - - # Converts hash 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_effective_security_health_analytics_custom_module.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::SecurityCenterManagement::V1::VERSION - metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - header_params = {} - if request.name - header_params["name"] = request.name - end - - request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") - metadata[:"x-goog-request-params"] ||= request_params_header - - options.apply_defaults timeout: @config.rpcs.get_effective_security_health_analytics_custom_module.timeout, - metadata: metadata, - retry_policy: @config.rpcs.get_effective_security_health_analytics_custom_module.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @security_center_management_stub.call_rpc :get_effective_security_health_analytics_custom_module, request, options: options do |response, operation| - yield response, operation if block_given? - end - rescue ::GRPC::BadStatus => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Returns a list of all - # {::Google::Cloud::SecurityCenterManagement::V1::SecurityHealthAnalyticsCustomModule SecurityHealthAnalyticsCustomModule} - # resources for the given parent. This includes resident modules defined at - # the scope of the parent, and inherited modules, inherited from ancestor - # organizations, folders, and projects (no descendants). - # - # @overload list_security_health_analytics_custom_modules(request, options = nil) - # Pass arguments to `list_security_health_analytics_custom_modules` via a request object, either of type - # {::Google::Cloud::SecurityCenterManagement::V1::ListSecurityHealthAnalyticsCustomModulesRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::SecurityCenterManagement::V1::ListSecurityHealthAnalyticsCustomModulesRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_security_health_analytics_custom_modules(parent: nil, page_size: nil, page_token: nil) - # Pass arguments to `list_security_health_analytics_custom_modules` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param parent [::String] - # Required. Name of the parent organization, folder, or project in which to - # list custom modules, in one of the following formats: - # - # * `organizations/{organization}/locations/{location}` - # * `folders/{folder}/locations/{location}` - # * `projects/{project}/locations/{location}` - # @param page_size [::Integer] - # Optional. The maximum number of results to return in a single response. - # Default is 10, minimum is 1, maximum is 1000. - # @param page_token [::String] - # Optional. A pagination token returned from a previous request. Provide this - # token to retrieve the next page of results. - # - # When paginating, the rest of the request must match the request that - # generated the page token. - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Gapic::PagedEnumerable<::Google::Cloud::SecurityCenterManagement::V1::SecurityHealthAnalyticsCustomModule>] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Gapic::PagedEnumerable<::Google::Cloud::SecurityCenterManagement::V1::SecurityHealthAnalyticsCustomModule>] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/cloud/security_center_management/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::SecurityCenterManagement::V1::SecurityCenterManagement::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::SecurityCenterManagement::V1::ListSecurityHealthAnalyticsCustomModulesRequest.new - # - # # Call the list_security_health_analytics_custom_modules method. - # result = client.list_security_health_analytics_custom_modules request - # - # # The returned object is of type Gapic::PagedEnumerable. You can iterate - # # over elements, and API calls will be issued to fetch pages as needed. - # result.each do |item| - # # Each element is of type ::Google::Cloud::SecurityCenterManagement::V1::SecurityHealthAnalyticsCustomModule. - # p item - # end - # - def list_security_health_analytics_custom_modules request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::SecurityCenterManagement::V1::ListSecurityHealthAnalyticsCustomModulesRequest - - # Converts hash 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_security_health_analytics_custom_modules.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::SecurityCenterManagement::V1::VERSION - metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - header_params = {} - if request.parent - header_params["parent"] = request.parent - end - - request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") - metadata[:"x-goog-request-params"] ||= request_params_header - - options.apply_defaults timeout: @config.rpcs.list_security_health_analytics_custom_modules.timeout, - metadata: metadata, - retry_policy: @config.rpcs.list_security_health_analytics_custom_modules.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @security_center_management_stub.call_rpc :list_security_health_analytics_custom_modules, request, options: options do |response, operation| - response = ::Gapic::PagedEnumerable.new @security_center_management_stub, :list_security_health_analytics_custom_modules, 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 a list of all resident - # {::Google::Cloud::SecurityCenterManagement::V1::SecurityHealthAnalyticsCustomModule SecurityHealthAnalyticsCustomModule} - # resources under the given organization, folder, or project and all of its - # descendants. - # - # @overload list_descendant_security_health_analytics_custom_modules(request, options = nil) - # Pass arguments to `list_descendant_security_health_analytics_custom_modules` via a request object, either of type - # {::Google::Cloud::SecurityCenterManagement::V1::ListDescendantSecurityHealthAnalyticsCustomModulesRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::SecurityCenterManagement::V1::ListDescendantSecurityHealthAnalyticsCustomModulesRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_descendant_security_health_analytics_custom_modules(parent: nil, page_size: nil, page_token: nil) - # Pass arguments to `list_descendant_security_health_analytics_custom_modules` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param parent [::String] - # Required. Name of the parent organization, folder, or project in which to - # list custom modules, in one of the following formats: - # - # * `organizations/{organization}/locations/{location}` - # * `folders/{folder}/locations/{location}` - # * `projects/{project}/locations/{location}` - # @param page_size [::Integer] - # Optional. The maximum number of results to return in a single response. - # Default is 10, minimum is 1, maximum is 1000. - # @param page_token [::String] - # Optional. A pagination token returned from a previous request. Provide this - # token to retrieve the next page of results. - # - # When paginating, the rest of the request must match the request that - # generated the page token. - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Gapic::PagedEnumerable<::Google::Cloud::SecurityCenterManagement::V1::SecurityHealthAnalyticsCustomModule>] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Gapic::PagedEnumerable<::Google::Cloud::SecurityCenterManagement::V1::SecurityHealthAnalyticsCustomModule>] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/cloud/security_center_management/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::SecurityCenterManagement::V1::SecurityCenterManagement::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::SecurityCenterManagement::V1::ListDescendantSecurityHealthAnalyticsCustomModulesRequest.new - # - # # Call the list_descendant_security_health_analytics_custom_modules method. - # result = client.list_descendant_security_health_analytics_custom_modules request - # - # # The returned object is of type Gapic::PagedEnumerable. You can iterate - # # over elements, and API calls will be issued to fetch pages as needed. - # result.each do |item| - # # Each element is of type ::Google::Cloud::SecurityCenterManagement::V1::SecurityHealthAnalyticsCustomModule. - # p item - # end - # - def list_descendant_security_health_analytics_custom_modules request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::SecurityCenterManagement::V1::ListDescendantSecurityHealthAnalyticsCustomModulesRequest - - # Converts hash 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_descendant_security_health_analytics_custom_modules.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::SecurityCenterManagement::V1::VERSION - metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - header_params = {} - if request.parent - header_params["parent"] = request.parent - end - - request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") - metadata[:"x-goog-request-params"] ||= request_params_header - - options.apply_defaults timeout: @config.rpcs.list_descendant_security_health_analytics_custom_modules.timeout, - metadata: metadata, - retry_policy: @config.rpcs.list_descendant_security_health_analytics_custom_modules.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @security_center_management_stub.call_rpc :list_descendant_security_health_analytics_custom_modules, request, options: options do |response, operation| - response = ::Gapic::PagedEnumerable.new @security_center_management_stub, :list_descendant_security_health_analytics_custom_modules, 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 - - ## - # Retrieves a - # {::Google::Cloud::SecurityCenterManagement::V1::SecurityHealthAnalyticsCustomModule SecurityHealthAnalyticsCustomModule}. - # - # @overload get_security_health_analytics_custom_module(request, options = nil) - # Pass arguments to `get_security_health_analytics_custom_module` via a request object, either of type - # {::Google::Cloud::SecurityCenterManagement::V1::GetSecurityHealthAnalyticsCustomModuleRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::SecurityCenterManagement::V1::GetSecurityHealthAnalyticsCustomModuleRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_security_health_analytics_custom_module(name: nil) - # Pass arguments to `get_security_health_analytics_custom_module` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param name [::String] - # Required. Name of the resource, in the format - # `projects/{project}/locations/{location}/securityHealthAnalyticsCustomModules/{custom_module}`. - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Google::Cloud::SecurityCenterManagement::V1::SecurityHealthAnalyticsCustomModule] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Google::Cloud::SecurityCenterManagement::V1::SecurityHealthAnalyticsCustomModule] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/cloud/security_center_management/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::SecurityCenterManagement::V1::SecurityCenterManagement::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::SecurityCenterManagement::V1::GetSecurityHealthAnalyticsCustomModuleRequest.new - # - # # Call the get_security_health_analytics_custom_module method. - # result = client.get_security_health_analytics_custom_module request - # - # # The returned object is of type Google::Cloud::SecurityCenterManagement::V1::SecurityHealthAnalyticsCustomModule. - # p result - # - def get_security_health_analytics_custom_module request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::SecurityCenterManagement::V1::GetSecurityHealthAnalyticsCustomModuleRequest - - # Converts hash 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_security_health_analytics_custom_module.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::SecurityCenterManagement::V1::VERSION - metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - header_params = {} - if request.name - header_params["name"] = request.name - end - - request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") - metadata[:"x-goog-request-params"] ||= request_params_header - - options.apply_defaults timeout: @config.rpcs.get_security_health_analytics_custom_module.timeout, - metadata: metadata, - retry_policy: @config.rpcs.get_security_health_analytics_custom_module.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @security_center_management_stub.call_rpc :get_security_health_analytics_custom_module, request, options: options do |response, operation| - yield response, operation if block_given? - end - rescue ::GRPC::BadStatus => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Creates a resident - # {::Google::Cloud::SecurityCenterManagement::V1::SecurityHealthAnalyticsCustomModule SecurityHealthAnalyticsCustomModule} - # at the scope of the given organization, folder, or project, and also - # creates inherited `SecurityHealthAnalyticsCustomModule` resources for all - # folders and projects that are descendants of the given parent. These - # modules are enabled by default. - # - # @overload create_security_health_analytics_custom_module(request, options = nil) - # Pass arguments to `create_security_health_analytics_custom_module` via a request object, either of type - # {::Google::Cloud::SecurityCenterManagement::V1::CreateSecurityHealthAnalyticsCustomModuleRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::SecurityCenterManagement::V1::CreateSecurityHealthAnalyticsCustomModuleRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_security_health_analytics_custom_module(parent: nil, security_health_analytics_custom_module: nil, validate_only: nil) - # Pass arguments to `create_security_health_analytics_custom_module` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param parent [::String] - # Required. Name of the parent organization, folder, or project of the - # module, in one of the following formats: - # - # * `organizations/{organization}/locations/{location}` - # * `folders/{folder}/locations/{location}` - # * `projects/{project}/locations/{location}` - # @param security_health_analytics_custom_module [::Google::Cloud::SecurityCenterManagement::V1::SecurityHealthAnalyticsCustomModule, ::Hash] - # Required. The resource being created. - # @param validate_only [::Boolean] - # Optional. When set to `true`, the request will be validated (including IAM - # checks), but no module will be created. An `OK` response indicates that the - # request is valid, while an error response indicates that the request is - # invalid. - # - # If the request is valid, a subsequent request to create the module could - # still fail for one of the following reasons: - # - # * The state of your cloud resources changed; for example, you lost a - # required IAM permission - # * An error occurred during creation of the module - # - # Defaults to `false`. - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Google::Cloud::SecurityCenterManagement::V1::SecurityHealthAnalyticsCustomModule] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Google::Cloud::SecurityCenterManagement::V1::SecurityHealthAnalyticsCustomModule] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/cloud/security_center_management/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::SecurityCenterManagement::V1::SecurityCenterManagement::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::SecurityCenterManagement::V1::CreateSecurityHealthAnalyticsCustomModuleRequest.new - # - # # Call the create_security_health_analytics_custom_module method. - # result = client.create_security_health_analytics_custom_module request - # - # # The returned object is of type Google::Cloud::SecurityCenterManagement::V1::SecurityHealthAnalyticsCustomModule. - # p result - # - def create_security_health_analytics_custom_module request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::SecurityCenterManagement::V1::CreateSecurityHealthAnalyticsCustomModuleRequest - - # Converts hash 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_security_health_analytics_custom_module.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::SecurityCenterManagement::V1::VERSION - metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - header_params = {} - if request.parent - header_params["parent"] = request.parent - end - - request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") - metadata[:"x-goog-request-params"] ||= request_params_header - - options.apply_defaults timeout: @config.rpcs.create_security_health_analytics_custom_module.timeout, - metadata: metadata, - retry_policy: @config.rpcs.create_security_health_analytics_custom_module.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @security_center_management_stub.call_rpc :create_security_health_analytics_custom_module, request, options: options do |response, operation| - yield response, operation if block_given? - end - rescue ::GRPC::BadStatus => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Updates the - # {::Google::Cloud::SecurityCenterManagement::V1::SecurityHealthAnalyticsCustomModule SecurityHealthAnalyticsCustomModule} - # under the given name based on the given update mask. Updating the - # enablement state is supported on both resident and inherited modules - # (though resident modules cannot have an enablement state of "inherited"). - # Updating the display name and custom configuration of a module is supported - # on resident modules only. - # - # @overload update_security_health_analytics_custom_module(request, options = nil) - # Pass arguments to `update_security_health_analytics_custom_module` via a request object, either of type - # {::Google::Cloud::SecurityCenterManagement::V1::UpdateSecurityHealthAnalyticsCustomModuleRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::SecurityCenterManagement::V1::UpdateSecurityHealthAnalyticsCustomModuleRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_security_health_analytics_custom_module(update_mask: nil, security_health_analytics_custom_module: nil, validate_only: nil) - # Pass arguments to `update_security_health_analytics_custom_module` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param update_mask [::Google::Protobuf::FieldMask, ::Hash] - # Required. The fields to update. The following values are valid: - # - # * `custom_config` - # * `enablement_state` - # - # If you omit this field or set it to the wildcard value `*`, then all - # eligible fields are updated. - # @param security_health_analytics_custom_module [::Google::Cloud::SecurityCenterManagement::V1::SecurityHealthAnalyticsCustomModule, ::Hash] - # Required. The resource being updated. - # @param validate_only [::Boolean] - # Optional. When set to `true`, the request will be validated (including IAM - # checks), but no module will be updated. An `OK` response indicates that the - # request is valid, while an error response indicates that the request is - # invalid. - # - # If the request is valid, a subsequent request to update the module could - # still fail for one of the following reasons: - # - # * The state of your cloud resources changed; for example, you lost a - # required IAM permission - # * An error occurred during creation of the module - # - # Defaults to `false`. - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Google::Cloud::SecurityCenterManagement::V1::SecurityHealthAnalyticsCustomModule] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Google::Cloud::SecurityCenterManagement::V1::SecurityHealthAnalyticsCustomModule] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/cloud/security_center_management/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::SecurityCenterManagement::V1::SecurityCenterManagement::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::SecurityCenterManagement::V1::UpdateSecurityHealthAnalyticsCustomModuleRequest.new - # - # # Call the update_security_health_analytics_custom_module method. - # result = client.update_security_health_analytics_custom_module request - # - # # The returned object is of type Google::Cloud::SecurityCenterManagement::V1::SecurityHealthAnalyticsCustomModule. - # p result - # - def update_security_health_analytics_custom_module request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::SecurityCenterManagement::V1::UpdateSecurityHealthAnalyticsCustomModuleRequest - - # Converts hash 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_security_health_analytics_custom_module.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::SecurityCenterManagement::V1::VERSION - metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - header_params = {} - if request.security_health_analytics_custom_module&.name - header_params["security_health_analytics_custom_module.name"] = request.security_health_analytics_custom_module.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_security_health_analytics_custom_module.timeout, - metadata: metadata, - retry_policy: @config.rpcs.update_security_health_analytics_custom_module.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @security_center_management_stub.call_rpc :update_security_health_analytics_custom_module, request, options: options do |response, operation| - yield response, operation if block_given? - end - rescue ::GRPC::BadStatus => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Deletes the specified - # {::Google::Cloud::SecurityCenterManagement::V1::SecurityHealthAnalyticsCustomModule SecurityHealthAnalyticsCustomModule} - # and all of its descendants in the resource hierarchy. This method is only - # supported for resident custom modules. - # - # @overload delete_security_health_analytics_custom_module(request, options = nil) - # Pass arguments to `delete_security_health_analytics_custom_module` via a request object, either of type - # {::Google::Cloud::SecurityCenterManagement::V1::DeleteSecurityHealthAnalyticsCustomModuleRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::SecurityCenterManagement::V1::DeleteSecurityHealthAnalyticsCustomModuleRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_security_health_analytics_custom_module(name: nil, validate_only: nil) - # Pass arguments to `delete_security_health_analytics_custom_module` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param name [::String] - # Required. The resource name of the SHA custom module, in one of the - # following formats: - # - # * `organizations/{organization}/locations/{location}/securityHealthAnalyticsCustomModules/{custom_module}` - # * `folders/{folder}/locations/{location}/securityHealthAnalyticsCustomModules/{custom_module}` - # * `projects/{project}/locations/{location}/securityHealthAnalyticsCustomModules/{custom_module}` - # @param validate_only [::Boolean] - # Optional. When set to `true`, the request will be validated (including IAM - # checks), but no module will be deleted. An `OK` response indicates that the - # request is valid, while an error response indicates that the request is - # invalid. - # - # If the request is valid, a subsequent request to delete the module could - # still fail for one of the following reasons: - # - # * The state of your cloud resources changed; for example, you lost a - # required IAM permission - # * An error occurred during deletion of the module - # - # Defaults to `false`. - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Google::Protobuf::Empty] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Google::Protobuf::Empty] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/cloud/security_center_management/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::SecurityCenterManagement::V1::SecurityCenterManagement::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::SecurityCenterManagement::V1::DeleteSecurityHealthAnalyticsCustomModuleRequest.new - # - # # Call the delete_security_health_analytics_custom_module method. - # result = client.delete_security_health_analytics_custom_module request - # - # # The returned object is of type Google::Protobuf::Empty. - # p result - # - def delete_security_health_analytics_custom_module request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::SecurityCenterManagement::V1::DeleteSecurityHealthAnalyticsCustomModuleRequest - - # Converts hash 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_security_health_analytics_custom_module.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::SecurityCenterManagement::V1::VERSION - metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - header_params = {} - if request.name - header_params["name"] = request.name - end - - request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") - metadata[:"x-goog-request-params"] ||= request_params_header - - options.apply_defaults timeout: @config.rpcs.delete_security_health_analytics_custom_module.timeout, - metadata: metadata, - retry_policy: @config.rpcs.delete_security_health_analytics_custom_module.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @security_center_management_stub.call_rpc :delete_security_health_analytics_custom_module, 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 - - ## - # Simulates the result of using a - # {::Google::Cloud::SecurityCenterManagement::V1::SecurityHealthAnalyticsCustomModule SecurityHealthAnalyticsCustomModule} - # to check a resource. - # - # @overload simulate_security_health_analytics_custom_module(request, options = nil) - # Pass arguments to `simulate_security_health_analytics_custom_module` via a request object, either of type - # {::Google::Cloud::SecurityCenterManagement::V1::SimulateSecurityHealthAnalyticsCustomModuleRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::SecurityCenterManagement::V1::SimulateSecurityHealthAnalyticsCustomModuleRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. - # - # @overload simulate_security_health_analytics_custom_module(parent: nil, custom_config: nil, resource: nil) - # Pass arguments to `simulate_security_health_analytics_custom_module` via keyword arguments. Note that at - # least one keyword argument is 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 relative resource name of the organization, project, or - # folder. For more information about relative resource names, see [AIP-122: - # Resource names](https://google.aip.dev/122). Example: - # `organizations/{organization_id}`. - # @param custom_config [::Google::Cloud::SecurityCenterManagement::V1::CustomConfig, ::Hash] - # Required. The custom configuration that you need to test. - # @param resource [::Google::Cloud::SecurityCenterManagement::V1::SimulateSecurityHealthAnalyticsCustomModuleRequest::SimulatedResource, ::Hash] - # Required. Resource data to simulate custom module against. - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Google::Cloud::SecurityCenterManagement::V1::SimulateSecurityHealthAnalyticsCustomModuleResponse] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Google::Cloud::SecurityCenterManagement::V1::SimulateSecurityHealthAnalyticsCustomModuleResponse] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/cloud/security_center_management/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::SecurityCenterManagement::V1::SecurityCenterManagement::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::SecurityCenterManagement::V1::SimulateSecurityHealthAnalyticsCustomModuleRequest.new - # - # # Call the simulate_security_health_analytics_custom_module method. - # result = client.simulate_security_health_analytics_custom_module request - # - # # The returned object is of type Google::Cloud::SecurityCenterManagement::V1::SimulateSecurityHealthAnalyticsCustomModuleResponse. - # p result - # - def simulate_security_health_analytics_custom_module request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::SecurityCenterManagement::V1::SimulateSecurityHealthAnalyticsCustomModuleRequest - - # Converts hash 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.simulate_security_health_analytics_custom_module.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::SecurityCenterManagement::V1::VERSION - metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - header_params = {} - if request.parent - header_params["parent"] = request.parent - end - - request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") - metadata[:"x-goog-request-params"] ||= request_params_header - - options.apply_defaults timeout: @config.rpcs.simulate_security_health_analytics_custom_module.timeout, - metadata: metadata, - retry_policy: @config.rpcs.simulate_security_health_analytics_custom_module.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @security_center_management_stub.call_rpc :simulate_security_health_analytics_custom_module, request, options: options do |response, operation| - yield response, operation if block_given? - end - rescue ::GRPC::BadStatus => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Lists all effective Event Threat Detection custom modules for the - # given parent. This includes resident modules defined at the scope of the - # parent along with modules inherited from its ancestors. - # - # @overload list_effective_event_threat_detection_custom_modules(request, options = nil) - # Pass arguments to `list_effective_event_threat_detection_custom_modules` via a request object, either of type - # {::Google::Cloud::SecurityCenterManagement::V1::ListEffectiveEventThreatDetectionCustomModulesRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::SecurityCenterManagement::V1::ListEffectiveEventThreatDetectionCustomModulesRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_effective_event_threat_detection_custom_modules(parent: nil, page_size: nil, page_token: nil) - # Pass arguments to `list_effective_event_threat_detection_custom_modules` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param parent [::String] - # Required. Name of parent to list effective custom modules, in one of the - # following formats: - # - # * `organizations/{organization}/locations/{location}` - # * `folders/{folder}/locations/{location}` - # * `projects/{project}/locations/{location}` - # @param page_size [::Integer] - # Optional. The maximum number of results to return in a single response. - # Default is 10, minimum is 1, maximum is 1000. - # @param page_token [::String] - # Optional. A pagination token returned from a previous request. Provide this - # token to retrieve the next page of results. - # - # When paginating, the rest of the request must match the request that - # generated the page token. - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Gapic::PagedEnumerable<::Google::Cloud::SecurityCenterManagement::V1::EffectiveEventThreatDetectionCustomModule>] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Gapic::PagedEnumerable<::Google::Cloud::SecurityCenterManagement::V1::EffectiveEventThreatDetectionCustomModule>] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/cloud/security_center_management/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::SecurityCenterManagement::V1::SecurityCenterManagement::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::SecurityCenterManagement::V1::ListEffectiveEventThreatDetectionCustomModulesRequest.new - # - # # Call the list_effective_event_threat_detection_custom_modules method. - # result = client.list_effective_event_threat_detection_custom_modules request - # - # # The returned object is of type Gapic::PagedEnumerable. You can iterate - # # over elements, and API calls will be issued to fetch pages as needed. - # result.each do |item| - # # Each element is of type ::Google::Cloud::SecurityCenterManagement::V1::EffectiveEventThreatDetectionCustomModule. - # p item - # end - # - def list_effective_event_threat_detection_custom_modules request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::SecurityCenterManagement::V1::ListEffectiveEventThreatDetectionCustomModulesRequest - - # Converts hash 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_effective_event_threat_detection_custom_modules.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::SecurityCenterManagement::V1::VERSION - metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - header_params = {} - if request.parent - header_params["parent"] = request.parent - end - - request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") - metadata[:"x-goog-request-params"] ||= request_params_header - - options.apply_defaults timeout: @config.rpcs.list_effective_event_threat_detection_custom_modules.timeout, - metadata: metadata, - retry_policy: @config.rpcs.list_effective_event_threat_detection_custom_modules.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @security_center_management_stub.call_rpc :list_effective_event_threat_detection_custom_modules, request, options: options do |response, operation| - response = ::Gapic::PagedEnumerable.new @security_center_management_stub, :list_effective_event_threat_detection_custom_modules, request, response, operation, options - yield response, operation if block_given? - throw :response, response - end - rescue ::GRPC::BadStatus => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Gets the effective Event Threat Detection custom module at the given level. - # - # The difference between an - # {::Google::Cloud::SecurityCenterManagement::V1::EffectiveEventThreatDetectionCustomModule EffectiveEventThreatDetectionCustomModule} - # and an - # {::Google::Cloud::SecurityCenterManagement::V1::EventThreatDetectionCustomModule EventThreatDetectionCustomModule} - # is that the fields for an `EffectiveEventThreatDetectionCustomModule` are - # computed from ancestors if needed. For example, the enablement state for an - # `EventThreatDetectionCustomModule` can be `ENABLED`, `DISABLED`, or - # `INHERITED`. In contrast, the enablement state for an - # `EffectiveEventThreatDetectionCustomModule` is always computed as `ENABLED` - # or `DISABLED`. - # - # @overload get_effective_event_threat_detection_custom_module(request, options = nil) - # Pass arguments to `get_effective_event_threat_detection_custom_module` via a request object, either of type - # {::Google::Cloud::SecurityCenterManagement::V1::GetEffectiveEventThreatDetectionCustomModuleRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::SecurityCenterManagement::V1::GetEffectiveEventThreatDetectionCustomModuleRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_effective_event_threat_detection_custom_module(name: nil) - # Pass arguments to `get_effective_event_threat_detection_custom_module` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param name [::String] - # Required. The resource name of the Event Threat Detection custom module, in - # one of the following formats: - # - # * `organizations/{organization}/locations/{location}/effectiveEventThreatDetectionCustomModules/{custom_module}` - # * `folders/{folder}/locations/{location}/effectiveEventThreatDetectionCustomModules/{custom_module}` - # * `projects/{project}/locations/{location}/effectiveEventThreatDetectionCustomModules/{custom_module}` - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Google::Cloud::SecurityCenterManagement::V1::EffectiveEventThreatDetectionCustomModule] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Google::Cloud::SecurityCenterManagement::V1::EffectiveEventThreatDetectionCustomModule] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/cloud/security_center_management/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::SecurityCenterManagement::V1::SecurityCenterManagement::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::SecurityCenterManagement::V1::GetEffectiveEventThreatDetectionCustomModuleRequest.new - # - # # Call the get_effective_event_threat_detection_custom_module method. - # result = client.get_effective_event_threat_detection_custom_module request - # - # # The returned object is of type Google::Cloud::SecurityCenterManagement::V1::EffectiveEventThreatDetectionCustomModule. - # p result - # - def get_effective_event_threat_detection_custom_module request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::SecurityCenterManagement::V1::GetEffectiveEventThreatDetectionCustomModuleRequest - - # Converts hash 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_effective_event_threat_detection_custom_module.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::SecurityCenterManagement::V1::VERSION - metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - header_params = {} - if request.name - header_params["name"] = request.name - end - - request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") - metadata[:"x-goog-request-params"] ||= request_params_header - - options.apply_defaults timeout: @config.rpcs.get_effective_event_threat_detection_custom_module.timeout, - metadata: metadata, - retry_policy: @config.rpcs.get_effective_event_threat_detection_custom_module.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @security_center_management_stub.call_rpc :get_effective_event_threat_detection_custom_module, request, options: options do |response, operation| - yield response, operation if block_given? - end - rescue ::GRPC::BadStatus => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Lists all Event Threat Detection custom modules for the given organization, - # folder, or project. This includes resident modules defined at the scope of - # the parent along with modules inherited from ancestors. - # - # @overload list_event_threat_detection_custom_modules(request, options = nil) - # Pass arguments to `list_event_threat_detection_custom_modules` via a request object, either of type - # {::Google::Cloud::SecurityCenterManagement::V1::ListEventThreatDetectionCustomModulesRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::SecurityCenterManagement::V1::ListEventThreatDetectionCustomModulesRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_event_threat_detection_custom_modules(parent: nil, page_size: nil, page_token: nil) - # Pass arguments to `list_event_threat_detection_custom_modules` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param parent [::String] - # Required. Name of parent to list custom modules, in one of the following - # formats: - # - # * `organizations/{organization}/locations/{location}` - # * `folders/{folder}/locations/{location}` - # * `projects/{project}/locations/{location}` - # @param page_size [::Integer] - # Optional. The maximum number of modules to return. The service may return - # fewer than this value. If unspecified, at most 10 modules will be returned. - # The maximum value is 1000; values above 1000 will be coerced to 1000. - # @param page_token [::String] - # Optional. A pagination token returned from a previous request. Provide this - # token to retrieve the next page of results. - # - # When paginating, the rest of the request must match the request that - # generated the page token. - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Gapic::PagedEnumerable<::Google::Cloud::SecurityCenterManagement::V1::EventThreatDetectionCustomModule>] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Gapic::PagedEnumerable<::Google::Cloud::SecurityCenterManagement::V1::EventThreatDetectionCustomModule>] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/cloud/security_center_management/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::SecurityCenterManagement::V1::SecurityCenterManagement::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::SecurityCenterManagement::V1::ListEventThreatDetectionCustomModulesRequest.new - # - # # Call the list_event_threat_detection_custom_modules method. - # result = client.list_event_threat_detection_custom_modules request - # - # # The returned object is of type Gapic::PagedEnumerable. You can iterate - # # over elements, and API calls will be issued to fetch pages as needed. - # result.each do |item| - # # Each element is of type ::Google::Cloud::SecurityCenterManagement::V1::EventThreatDetectionCustomModule. - # p item - # end - # - def list_event_threat_detection_custom_modules request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::SecurityCenterManagement::V1::ListEventThreatDetectionCustomModulesRequest - - # Converts hash 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_event_threat_detection_custom_modules.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::SecurityCenterManagement::V1::VERSION - metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - header_params = {} - if request.parent - header_params["parent"] = request.parent - end - - request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") - metadata[:"x-goog-request-params"] ||= request_params_header - - options.apply_defaults timeout: @config.rpcs.list_event_threat_detection_custom_modules.timeout, - metadata: metadata, - retry_policy: @config.rpcs.list_event_threat_detection_custom_modules.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @security_center_management_stub.call_rpc :list_event_threat_detection_custom_modules, request, options: options do |response, operation| - response = ::Gapic::PagedEnumerable.new @security_center_management_stub, :list_event_threat_detection_custom_modules, 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 - - ## - # Lists all resident Event Threat Detection custom modules for the given - # organization, folder, or project and its descendants. - # - # @overload list_descendant_event_threat_detection_custom_modules(request, options = nil) - # Pass arguments to `list_descendant_event_threat_detection_custom_modules` via a request object, either of type - # {::Google::Cloud::SecurityCenterManagement::V1::ListDescendantEventThreatDetectionCustomModulesRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::SecurityCenterManagement::V1::ListDescendantEventThreatDetectionCustomModulesRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_descendant_event_threat_detection_custom_modules(parent: nil, page_size: nil, page_token: nil) - # Pass arguments to `list_descendant_event_threat_detection_custom_modules` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param parent [::String] - # Required. Name of parent to list custom modules, in one of the following - # formats: - # - # * `organizations/{organization}/locations/{location}` - # * `folders/{folder}/locations/{location}` - # * `projects/{project}/locations/{location}` - # @param page_size [::Integer] - # Optional. The maximum number of modules to return. The service may return - # fewer than this value. If unspecified, at most 10 configs will be returned. - # The maximum value is 1000; values above 1000 will be coerced to 1000. - # @param page_token [::String] - # Optional. A pagination token returned from a previous request. Provide this - # token to retrieve the next page of results. - # - # When paginating, the rest of the request must match the request that - # generated the page token. - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Gapic::PagedEnumerable<::Google::Cloud::SecurityCenterManagement::V1::EventThreatDetectionCustomModule>] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Gapic::PagedEnumerable<::Google::Cloud::SecurityCenterManagement::V1::EventThreatDetectionCustomModule>] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/cloud/security_center_management/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::SecurityCenterManagement::V1::SecurityCenterManagement::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::SecurityCenterManagement::V1::ListDescendantEventThreatDetectionCustomModulesRequest.new - # - # # Call the list_descendant_event_threat_detection_custom_modules method. - # result = client.list_descendant_event_threat_detection_custom_modules request - # - # # The returned object is of type Gapic::PagedEnumerable. You can iterate - # # over elements, and API calls will be issued to fetch pages as needed. - # result.each do |item| - # # Each element is of type ::Google::Cloud::SecurityCenterManagement::V1::EventThreatDetectionCustomModule. - # p item - # end - # - def list_descendant_event_threat_detection_custom_modules request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::SecurityCenterManagement::V1::ListDescendantEventThreatDetectionCustomModulesRequest - - # Converts hash 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_descendant_event_threat_detection_custom_modules.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::SecurityCenterManagement::V1::VERSION - metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - header_params = {} - if request.parent - header_params["parent"] = request.parent - end - - request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") - metadata[:"x-goog-request-params"] ||= request_params_header - - options.apply_defaults timeout: @config.rpcs.list_descendant_event_threat_detection_custom_modules.timeout, - metadata: metadata, - retry_policy: @config.rpcs.list_descendant_event_threat_detection_custom_modules.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @security_center_management_stub.call_rpc :list_descendant_event_threat_detection_custom_modules, request, options: options do |response, operation| - response = ::Gapic::PagedEnumerable.new @security_center_management_stub, :list_descendant_event_threat_detection_custom_modules, request, response, operation, options - yield response, operation if block_given? - throw :response, response - end - rescue ::GRPC::BadStatus => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Gets an Event Threat Detection custom module. - # - # @overload get_event_threat_detection_custom_module(request, options = nil) - # Pass arguments to `get_event_threat_detection_custom_module` via a request object, either of type - # {::Google::Cloud::SecurityCenterManagement::V1::GetEventThreatDetectionCustomModuleRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::SecurityCenterManagement::V1::GetEventThreatDetectionCustomModuleRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_event_threat_detection_custom_module(name: nil) - # Pass arguments to `get_event_threat_detection_custom_module` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param name [::String] - # Required. The resource name of the Event Threat Detection custom module, in - # one of the following formats: - # - # * `organizations/{organization}/locations/{location}/eventThreatDetectionCustomModules/{custom_module}` - # * `folders/{folder}/locations/{location}/eventThreatDetectionCustomModules/{custom_module}` - # * `projects/{project}/locations/{location}/eventThreatDetectionCustomModules/{custom_module}` - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Google::Cloud::SecurityCenterManagement::V1::EventThreatDetectionCustomModule] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Google::Cloud::SecurityCenterManagement::V1::EventThreatDetectionCustomModule] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/cloud/security_center_management/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::SecurityCenterManagement::V1::SecurityCenterManagement::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::SecurityCenterManagement::V1::GetEventThreatDetectionCustomModuleRequest.new - # - # # Call the get_event_threat_detection_custom_module method. - # result = client.get_event_threat_detection_custom_module request - # - # # The returned object is of type Google::Cloud::SecurityCenterManagement::V1::EventThreatDetectionCustomModule. - # p result - # - def get_event_threat_detection_custom_module request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::SecurityCenterManagement::V1::GetEventThreatDetectionCustomModuleRequest - - # Converts hash 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_event_threat_detection_custom_module.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::SecurityCenterManagement::V1::VERSION - metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - header_params = {} - if request.name - header_params["name"] = request.name - end - - request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") - metadata[:"x-goog-request-params"] ||= request_params_header - - options.apply_defaults timeout: @config.rpcs.get_event_threat_detection_custom_module.timeout, - metadata: metadata, - retry_policy: @config.rpcs.get_event_threat_detection_custom_module.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @security_center_management_stub.call_rpc :get_event_threat_detection_custom_module, request, options: options do |response, operation| - yield response, operation if block_given? - end - rescue ::GRPC::BadStatus => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Creates a resident Event Threat Detection custom module at the scope of the - # given organization, folder, or project, and creates inherited custom - # modules for all descendants of the given parent. These modules are enabled - # by default. - # - # @overload create_event_threat_detection_custom_module(request, options = nil) - # Pass arguments to `create_event_threat_detection_custom_module` via a request object, either of type - # {::Google::Cloud::SecurityCenterManagement::V1::CreateEventThreatDetectionCustomModuleRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::SecurityCenterManagement::V1::CreateEventThreatDetectionCustomModuleRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_event_threat_detection_custom_module(parent: nil, event_threat_detection_custom_module: nil, validate_only: nil) - # Pass arguments to `create_event_threat_detection_custom_module` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param parent [::String] - # Required. Name of parent for the module, in one of the following formats: - # - # * `organizations/{organization}/locations/{location}` - # * `folders/{folder}/locations/{location}` - # * `projects/{project}/locations/{location}` - # @param event_threat_detection_custom_module [::Google::Cloud::SecurityCenterManagement::V1::EventThreatDetectionCustomModule, ::Hash] - # Required. The module to create. The - # {::Google::Cloud::SecurityCenterManagement::V1::EventThreatDetectionCustomModule#name EventThreatDetectionCustomModule.name} - # field is ignored; Security Command Center generates the name. - # @param validate_only [::Boolean] - # Optional. When set to `true`, the request will be validated (including IAM - # checks), but no module will be created. An `OK` response indicates that the - # request is valid, while an error response indicates that the request is - # invalid. - # - # If the request is valid, a subsequent request to create the module could - # still fail for one of the following reasons: - # - # * The state of your cloud resources changed; for example, you lost a - # required IAM permission - # * An error occurred during creation of the module - # - # Defaults to `false`. - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Google::Cloud::SecurityCenterManagement::V1::EventThreatDetectionCustomModule] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Google::Cloud::SecurityCenterManagement::V1::EventThreatDetectionCustomModule] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/cloud/security_center_management/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::SecurityCenterManagement::V1::SecurityCenterManagement::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::SecurityCenterManagement::V1::CreateEventThreatDetectionCustomModuleRequest.new - # - # # Call the create_event_threat_detection_custom_module method. - # result = client.create_event_threat_detection_custom_module request - # - # # The returned object is of type Google::Cloud::SecurityCenterManagement::V1::EventThreatDetectionCustomModule. - # p result - # - def create_event_threat_detection_custom_module request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::SecurityCenterManagement::V1::CreateEventThreatDetectionCustomModuleRequest - - # Converts hash 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_event_threat_detection_custom_module.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::SecurityCenterManagement::V1::VERSION - metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - header_params = {} - if request.parent - header_params["parent"] = request.parent - end - - request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") - metadata[:"x-goog-request-params"] ||= request_params_header - - options.apply_defaults timeout: @config.rpcs.create_event_threat_detection_custom_module.timeout, - metadata: metadata, - retry_policy: @config.rpcs.create_event_threat_detection_custom_module.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @security_center_management_stub.call_rpc :create_event_threat_detection_custom_module, request, options: options do |response, operation| - yield response, operation if block_given? - end - rescue ::GRPC::BadStatus => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Updates the Event Threat Detection custom module with the given name based - # on the given update mask. Updating the enablement state is supported for - # both resident and inherited modules (though resident modules cannot have an - # enablement state of "inherited"). Updating the display name or - # configuration of a module is supported for resident modules only. The type - # of a module cannot be changed. - # - # @overload update_event_threat_detection_custom_module(request, options = nil) - # Pass arguments to `update_event_threat_detection_custom_module` via a request object, either of type - # {::Google::Cloud::SecurityCenterManagement::V1::UpdateEventThreatDetectionCustomModuleRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::SecurityCenterManagement::V1::UpdateEventThreatDetectionCustomModuleRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_event_threat_detection_custom_module(update_mask: nil, event_threat_detection_custom_module: nil, validate_only: nil) - # Pass arguments to `update_event_threat_detection_custom_module` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param update_mask [::Google::Protobuf::FieldMask, ::Hash] - # Required. The fields to update. If omitted, then all fields are updated. - # @param event_threat_detection_custom_module [::Google::Cloud::SecurityCenterManagement::V1::EventThreatDetectionCustomModule, ::Hash] - # Required. The module being updated. - # @param validate_only [::Boolean] - # Optional. When set to `true`, the request will be validated (including IAM - # checks), but no module will be updated. An `OK` response indicates that the - # request is valid, while an error response indicates that the request is - # invalid. - # - # If the request is valid, a subsequent request to update the module could - # still fail for one of the following reasons: - # - # * The state of your cloud resources changed; for example, you lost a - # required IAM permission - # * An error occurred during creation of the module - # - # Defaults to `false`. - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Google::Cloud::SecurityCenterManagement::V1::EventThreatDetectionCustomModule] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Google::Cloud::SecurityCenterManagement::V1::EventThreatDetectionCustomModule] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/cloud/security_center_management/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::SecurityCenterManagement::V1::SecurityCenterManagement::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::SecurityCenterManagement::V1::UpdateEventThreatDetectionCustomModuleRequest.new - # - # # Call the update_event_threat_detection_custom_module method. - # result = client.update_event_threat_detection_custom_module request - # - # # The returned object is of type Google::Cloud::SecurityCenterManagement::V1::EventThreatDetectionCustomModule. - # p result - # - def update_event_threat_detection_custom_module request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::SecurityCenterManagement::V1::UpdateEventThreatDetectionCustomModuleRequest - - # Converts hash 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_event_threat_detection_custom_module.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::SecurityCenterManagement::V1::VERSION - metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - header_params = {} - if request.event_threat_detection_custom_module&.name - header_params["event_threat_detection_custom_module.name"] = request.event_threat_detection_custom_module.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_event_threat_detection_custom_module.timeout, - metadata: metadata, - retry_policy: @config.rpcs.update_event_threat_detection_custom_module.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @security_center_management_stub.call_rpc :update_event_threat_detection_custom_module, request, options: options do |response, operation| - yield response, operation if block_given? - end - rescue ::GRPC::BadStatus => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Deletes the specified Event Threat Detection custom module and all of its - # descendants in the resource hierarchy. This method is only supported for - # resident custom modules. - # - # @overload delete_event_threat_detection_custom_module(request, options = nil) - # Pass arguments to `delete_event_threat_detection_custom_module` via a request object, either of type - # {::Google::Cloud::SecurityCenterManagement::V1::DeleteEventThreatDetectionCustomModuleRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::SecurityCenterManagement::V1::DeleteEventThreatDetectionCustomModuleRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_event_threat_detection_custom_module(name: nil, validate_only: nil) - # Pass arguments to `delete_event_threat_detection_custom_module` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param name [::String] - # Required. The resource name of the Event Threat Detection custom module, in - # one of the following formats: - # - # * `organizations/{organization}/locations/{location}/eventThreatDetectionCustomModules/{custom_module}` - # * `folders/{folder}/locations/{location}/eventThreatDetectionCustomModules/{custom_module}` - # * `projects/{project}/locations/{location}/eventThreatDetectionCustomModules/{custom_module}` - # @param validate_only [::Boolean] - # Optional. When set to `true`, the request will be validated (including IAM - # checks), but no module will be deleted. An `OK` response indicates that the - # request is valid, while an error response indicates that the request is - # invalid. - # - # If the request is valid, a subsequent request to delete the module could - # still fail for one of the following reasons: - # - # * The state of your cloud resources changed; for example, you lost a - # required IAM permission - # * An error occurred during creation of the module - # - # Defaults to `false`. - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Google::Protobuf::Empty] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Google::Protobuf::Empty] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/cloud/security_center_management/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::SecurityCenterManagement::V1::SecurityCenterManagement::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::SecurityCenterManagement::V1::DeleteEventThreatDetectionCustomModuleRequest.new - # - # # Call the delete_event_threat_detection_custom_module method. - # result = client.delete_event_threat_detection_custom_module request - # - # # The returned object is of type Google::Protobuf::Empty. - # p result - # - def delete_event_threat_detection_custom_module request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::SecurityCenterManagement::V1::DeleteEventThreatDetectionCustomModuleRequest - - # Converts hash 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_event_threat_detection_custom_module.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::SecurityCenterManagement::V1::VERSION - metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - header_params = {} - if request.name - header_params["name"] = request.name - end - - request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") - metadata[:"x-goog-request-params"] ||= request_params_header - - options.apply_defaults timeout: @config.rpcs.delete_event_threat_detection_custom_module.timeout, - metadata: metadata, - retry_policy: @config.rpcs.delete_event_threat_detection_custom_module.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @security_center_management_stub.call_rpc :delete_event_threat_detection_custom_module, 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 - - ## - # Validates the given Event Threat Detection custom module. - # - # @overload validate_event_threat_detection_custom_module(request, options = nil) - # Pass arguments to `validate_event_threat_detection_custom_module` via a request object, either of type - # {::Google::Cloud::SecurityCenterManagement::V1::ValidateEventThreatDetectionCustomModuleRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::SecurityCenterManagement::V1::ValidateEventThreatDetectionCustomModuleRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. - # - # @overload validate_event_threat_detection_custom_module(parent: nil, raw_text: nil, type: nil) - # Pass arguments to `validate_event_threat_detection_custom_module` via keyword arguments. Note that at - # least one keyword argument is 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. Resource name of the parent to validate the custom modules under, - # in one of the following formats: - # - # * `organizations/{organization}/locations/{location}` - # @param raw_text [::String] - # Required. The raw text of the module's contents. Used to generate error - # messages. - # @param type [::String] - # Required. The type of the module. For example, `CONFIGURABLE_BAD_IP`. - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Google::Cloud::SecurityCenterManagement::V1::ValidateEventThreatDetectionCustomModuleResponse] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Google::Cloud::SecurityCenterManagement::V1::ValidateEventThreatDetectionCustomModuleResponse] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/cloud/security_center_management/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::SecurityCenterManagement::V1::SecurityCenterManagement::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::SecurityCenterManagement::V1::ValidateEventThreatDetectionCustomModuleRequest.new - # - # # Call the validate_event_threat_detection_custom_module method. - # result = client.validate_event_threat_detection_custom_module request - # - # # The returned object is of type Google::Cloud::SecurityCenterManagement::V1::ValidateEventThreatDetectionCustomModuleResponse. - # p result - # - def validate_event_threat_detection_custom_module request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::SecurityCenterManagement::V1::ValidateEventThreatDetectionCustomModuleRequest - - # Converts hash 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.validate_event_threat_detection_custom_module.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::SecurityCenterManagement::V1::VERSION - metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - header_params = {} - if request.parent - header_params["parent"] = request.parent - end - - request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") - metadata[:"x-goog-request-params"] ||= request_params_header - - options.apply_defaults timeout: @config.rpcs.validate_event_threat_detection_custom_module.timeout, - metadata: metadata, - retry_policy: @config.rpcs.validate_event_threat_detection_custom_module.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @security_center_management_stub.call_rpc :validate_event_threat_detection_custom_module, request, options: options do |response, operation| - yield response, operation if block_given? - end - rescue ::GRPC::BadStatus => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Gets service settings for the specified Security Command Center service. - # - # @overload get_security_center_service(request, options = nil) - # Pass arguments to `get_security_center_service` via a request object, either of type - # {::Google::Cloud::SecurityCenterManagement::V1::GetSecurityCenterServiceRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::SecurityCenterManagement::V1::GetSecurityCenterServiceRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_security_center_service(name: nil, show_eligible_modules_only: nil) - # Pass arguments to `get_security_center_service` via keyword arguments. Note that at - # least one keyword argument is 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 Security Command Center service to retrieve, in one of the - # following formats: - # - # * organizations/\\{organization}/locations/\\{location}/securityCenterServices/\\{service} - # * folders/\\{folder}/locations/\\{location}/securityCenterServices/\\{service} - # * projects/\\{project}/locations/\\{location}/securityCenterServices/\\{service} - # - # The following values are valid for `{service}`: - # - # * `container-threat-detection` - # * `event-threat-detection` - # * `security-health-analytics` - # * `vm-threat-detection` - # * `web-security-scanner` - # @param show_eligible_modules_only [::Boolean] - # Set to `true` to show only modules that are in scope. By default, all - # modules are shown. - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Google::Cloud::SecurityCenterManagement::V1::SecurityCenterService] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Google::Cloud::SecurityCenterManagement::V1::SecurityCenterService] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/cloud/security_center_management/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::SecurityCenterManagement::V1::SecurityCenterManagement::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::SecurityCenterManagement::V1::GetSecurityCenterServiceRequest.new - # - # # Call the get_security_center_service method. - # result = client.get_security_center_service request - # - # # The returned object is of type Google::Cloud::SecurityCenterManagement::V1::SecurityCenterService. - # p result - # - def get_security_center_service request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::SecurityCenterManagement::V1::GetSecurityCenterServiceRequest - - # Converts hash 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_security_center_service.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::SecurityCenterManagement::V1::VERSION - metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - header_params = {} - if request.name - header_params["name"] = request.name - end - - request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") - metadata[:"x-goog-request-params"] ||= request_params_header - - options.apply_defaults timeout: @config.rpcs.get_security_center_service.timeout, - metadata: metadata, - retry_policy: @config.rpcs.get_security_center_service.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @security_center_management_stub.call_rpc :get_security_center_service, request, options: options do |response, operation| - yield response, operation if block_given? - end - rescue ::GRPC::BadStatus => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Returns a list of all Security Command Center services for the given - # parent. - # - # @overload list_security_center_services(request, options = nil) - # Pass arguments to `list_security_center_services` via a request object, either of type - # {::Google::Cloud::SecurityCenterManagement::V1::ListSecurityCenterServicesRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::SecurityCenterManagement::V1::ListSecurityCenterServicesRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_security_center_services(parent: nil, page_size: nil, page_token: nil, show_eligible_modules_only: nil) - # Pass arguments to `list_security_center_services` via keyword arguments. Note that at - # least one keyword argument is 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 name of the parent to list Security Command Center services, - # in one of the following formats: - # - # * `organizations/{organization}/locations/{location}` - # * `folders/{folder}/locations/{location}` - # * `projects/{project}/locations/{location}` - # @param page_size [::Integer] - # Optional. The maximum number of results to return in a single response. - # Default is 10, minimum is 1, maximum is 1000. - # @param page_token [::String] - # Optional. A pagination token returned from a previous request. Provide this - # token to retrieve the next page of results. - # - # When paginating, the rest of the request must match the request that - # generated the page token. - # @param show_eligible_modules_only [::Boolean] - # Flag that, when set, is used to filter the module settings that are shown. - # The default setting is that all modules are shown. - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Gapic::PagedEnumerable<::Google::Cloud::SecurityCenterManagement::V1::SecurityCenterService>] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Gapic::PagedEnumerable<::Google::Cloud::SecurityCenterManagement::V1::SecurityCenterService>] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/cloud/security_center_management/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::SecurityCenterManagement::V1::SecurityCenterManagement::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::SecurityCenterManagement::V1::ListSecurityCenterServicesRequest.new - # - # # Call the list_security_center_services method. - # result = client.list_security_center_services request - # - # # The returned object is of type Gapic::PagedEnumerable. You can iterate - # # over elements, and API calls will be issued to fetch pages as needed. - # result.each do |item| - # # Each element is of type ::Google::Cloud::SecurityCenterManagement::V1::SecurityCenterService. - # p item - # end - # - def list_security_center_services request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::SecurityCenterManagement::V1::ListSecurityCenterServicesRequest - - # Converts hash 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_security_center_services.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::SecurityCenterManagement::V1::VERSION - metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - header_params = {} - if request.parent - header_params["parent"] = request.parent - end - - request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") - metadata[:"x-goog-request-params"] ||= request_params_header - - options.apply_defaults timeout: @config.rpcs.list_security_center_services.timeout, - metadata: metadata, - retry_policy: @config.rpcs.list_security_center_services.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @security_center_management_stub.call_rpc :list_security_center_services, request, options: options do |response, operation| - response = ::Gapic::PagedEnumerable.new @security_center_management_stub, :list_security_center_services, 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 - - ## - # Updates a Security Command Center service using the given update mask. - # - # @overload update_security_center_service(request, options = nil) - # Pass arguments to `update_security_center_service` via a request object, either of type - # {::Google::Cloud::SecurityCenterManagement::V1::UpdateSecurityCenterServiceRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::SecurityCenterManagement::V1::UpdateSecurityCenterServiceRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_security_center_service(security_center_service: nil, update_mask: nil, validate_only: nil) - # Pass arguments to `update_security_center_service` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param security_center_service [::Google::Cloud::SecurityCenterManagement::V1::SecurityCenterService, ::Hash] - # Required. The updated service. - # @param update_mask [::Google::Protobuf::FieldMask, ::Hash] - # Required. The fields to update. Accepts the following values: - # - # * `intended_enablement_state` - # * `modules` - # - # If omitted, then all eligible fields are updated. - # @param validate_only [::Boolean] - # Optional. When set to `true`, the request will be validated (including IAM - # checks), but no service will be updated. An `OK` response indicates that - # the request is valid, while an error response indicates that the request is - # invalid. - # - # If the request is valid, a subsequent request to update the service could - # still fail for one of the following reasons: - # - # * The state of your cloud resources changed; for example, you lost a - # required IAM permission - # * An error occurred during update of the service - # - # Defaults to `false`. - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Google::Cloud::SecurityCenterManagement::V1::SecurityCenterService] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Google::Cloud::SecurityCenterManagement::V1::SecurityCenterService] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/cloud/security_center_management/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::SecurityCenterManagement::V1::SecurityCenterManagement::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::SecurityCenterManagement::V1::UpdateSecurityCenterServiceRequest.new - # - # # Call the update_security_center_service method. - # result = client.update_security_center_service request - # - # # The returned object is of type Google::Cloud::SecurityCenterManagement::V1::SecurityCenterService. - # p result - # - def update_security_center_service request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::SecurityCenterManagement::V1::UpdateSecurityCenterServiceRequest - - # Converts hash 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_security_center_service.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::SecurityCenterManagement::V1::VERSION - metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - header_params = {} - if request.security_center_service&.name - header_params["security_center_service.name"] = request.security_center_service.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_security_center_service.timeout, - metadata: metadata, - retry_policy: @config.rpcs.update_security_center_service.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @security_center_management_stub.call_rpc :update_security_center_service, request, options: options do |response, operation| - yield response, operation if block_given? - end - rescue ::GRPC::BadStatus => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Configuration class for the SecurityCenterManagement API. - # - # This class represents the configuration for SecurityCenterManagement, - # providing control over timeouts, retry behavior, logging, transport - # parameters, and other low-level controls. Certain parameters can also be - # applied individually to specific RPCs. See - # {::Google::Cloud::SecurityCenterManagement::V1::SecurityCenterManagement::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_effective_security_health_analytics_custom_modules to 20 seconds, - # # and all remaining timeouts to 10 seconds. - # ::Google::Cloud::SecurityCenterManagement::V1::SecurityCenterManagement::Client.configure do |config| - # config.timeout = 10.0 - # config.rpcs.list_effective_security_health_analytics_custom_modules.timeout = 20.0 - # end - # - # # Apply the above configuration only to a new client. - # client = ::Google::Cloud::SecurityCenterManagement::V1::SecurityCenterManagement::Client.new do |config| - # config.timeout = 10.0 - # config.rpcs.list_effective_security_health_analytics_custom_modules.timeout = 20.0 - # end - # - # @!attribute [rw] endpoint - # A custom service endpoint, as a hostname or hostname:port. The default is - # nil, indicating to use the default endpoint in the current universe domain. - # @return [::String,nil] - # @!attribute [rw] credentials - # Credentials to send with calls. You may provide any of the following types: - # * (`Google::Auth::Credentials`) A googleauth credentials object - # (see the [googleauth docs](https://rubydoc.info/gems/googleauth/Google/Auth/Credentials)) - # * (`Signet::OAuth2::Client`) A signet oauth2 client object - # (see the [signet docs](https://rubydoc.info/gems/signet/Signet/OAuth2/Client)) - # * (`GRPC::Core::Channel`) a gRPC channel with included credentials - # * (`GRPC::Core::ChannelCredentials`) a gRPC credentails object - # * (`nil`) indicating no credentials - # - # @note Warning: Passing a `String` to a keyfile path or a `Hash` of credentials - # is deprecated. Providing an unvalidated credential configuration to - # Google APIs can compromise the security of your systems and data. - # - # @example - # - # # The recommended way to provide credentials is to use the `make_creds` method - # # on the appropriate credentials class for your environment. - # - # require "googleauth" - # - # credentials = ::Google::Auth::ServiceAccountCredentials.make_creds( - # json_key_io: ::File.open("/path/to/keyfile.json") - # ) - # - # client = ::Google::Cloud::SecurityCenterManagement::V1::SecurityCenterManagement::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 = "securitycentermanagement.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 SecurityCenterManagement 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_effective_security_health_analytics_custom_modules` - # @return [::Gapic::Config::Method] - # - attr_reader :list_effective_security_health_analytics_custom_modules - ## - # RPC-specific configuration for `get_effective_security_health_analytics_custom_module` - # @return [::Gapic::Config::Method] - # - attr_reader :get_effective_security_health_analytics_custom_module - ## - # RPC-specific configuration for `list_security_health_analytics_custom_modules` - # @return [::Gapic::Config::Method] - # - attr_reader :list_security_health_analytics_custom_modules - ## - # RPC-specific configuration for `list_descendant_security_health_analytics_custom_modules` - # @return [::Gapic::Config::Method] - # - attr_reader :list_descendant_security_health_analytics_custom_modules - ## - # RPC-specific configuration for `get_security_health_analytics_custom_module` - # @return [::Gapic::Config::Method] - # - attr_reader :get_security_health_analytics_custom_module - ## - # RPC-specific configuration for `create_security_health_analytics_custom_module` - # @return [::Gapic::Config::Method] - # - attr_reader :create_security_health_analytics_custom_module - ## - # RPC-specific configuration for `update_security_health_analytics_custom_module` - # @return [::Gapic::Config::Method] - # - attr_reader :update_security_health_analytics_custom_module - ## - # RPC-specific configuration for `delete_security_health_analytics_custom_module` - # @return [::Gapic::Config::Method] - # - attr_reader :delete_security_health_analytics_custom_module - ## - # RPC-specific configuration for `simulate_security_health_analytics_custom_module` - # @return [::Gapic::Config::Method] - # - attr_reader :simulate_security_health_analytics_custom_module - ## - # RPC-specific configuration for `list_effective_event_threat_detection_custom_modules` - # @return [::Gapic::Config::Method] - # - attr_reader :list_effective_event_threat_detection_custom_modules - ## - # RPC-specific configuration for `get_effective_event_threat_detection_custom_module` - # @return [::Gapic::Config::Method] - # - attr_reader :get_effective_event_threat_detection_custom_module - ## - # RPC-specific configuration for `list_event_threat_detection_custom_modules` - # @return [::Gapic::Config::Method] - # - attr_reader :list_event_threat_detection_custom_modules - ## - # RPC-specific configuration for `list_descendant_event_threat_detection_custom_modules` - # @return [::Gapic::Config::Method] - # - attr_reader :list_descendant_event_threat_detection_custom_modules - ## - # RPC-specific configuration for `get_event_threat_detection_custom_module` - # @return [::Gapic::Config::Method] - # - attr_reader :get_event_threat_detection_custom_module - ## - # RPC-specific configuration for `create_event_threat_detection_custom_module` - # @return [::Gapic::Config::Method] - # - attr_reader :create_event_threat_detection_custom_module - ## - # RPC-specific configuration for `update_event_threat_detection_custom_module` - # @return [::Gapic::Config::Method] - # - attr_reader :update_event_threat_detection_custom_module - ## - # RPC-specific configuration for `delete_event_threat_detection_custom_module` - # @return [::Gapic::Config::Method] - # - attr_reader :delete_event_threat_detection_custom_module - ## - # RPC-specific configuration for `validate_event_threat_detection_custom_module` - # @return [::Gapic::Config::Method] - # - attr_reader :validate_event_threat_detection_custom_module - ## - # RPC-specific configuration for `get_security_center_service` - # @return [::Gapic::Config::Method] - # - attr_reader :get_security_center_service - ## - # RPC-specific configuration for `list_security_center_services` - # @return [::Gapic::Config::Method] - # - attr_reader :list_security_center_services - ## - # RPC-specific configuration for `update_security_center_service` - # @return [::Gapic::Config::Method] - # - attr_reader :update_security_center_service - - # @private - def initialize parent_rpcs = nil - list_effective_security_health_analytics_custom_modules_config = parent_rpcs.list_effective_security_health_analytics_custom_modules if parent_rpcs.respond_to? :list_effective_security_health_analytics_custom_modules - @list_effective_security_health_analytics_custom_modules = ::Gapic::Config::Method.new list_effective_security_health_analytics_custom_modules_config - get_effective_security_health_analytics_custom_module_config = parent_rpcs.get_effective_security_health_analytics_custom_module if parent_rpcs.respond_to? :get_effective_security_health_analytics_custom_module - @get_effective_security_health_analytics_custom_module = ::Gapic::Config::Method.new get_effective_security_health_analytics_custom_module_config - list_security_health_analytics_custom_modules_config = parent_rpcs.list_security_health_analytics_custom_modules if parent_rpcs.respond_to? :list_security_health_analytics_custom_modules - @list_security_health_analytics_custom_modules = ::Gapic::Config::Method.new list_security_health_analytics_custom_modules_config - list_descendant_security_health_analytics_custom_modules_config = parent_rpcs.list_descendant_security_health_analytics_custom_modules if parent_rpcs.respond_to? :list_descendant_security_health_analytics_custom_modules - @list_descendant_security_health_analytics_custom_modules = ::Gapic::Config::Method.new list_descendant_security_health_analytics_custom_modules_config - get_security_health_analytics_custom_module_config = parent_rpcs.get_security_health_analytics_custom_module if parent_rpcs.respond_to? :get_security_health_analytics_custom_module - @get_security_health_analytics_custom_module = ::Gapic::Config::Method.new get_security_health_analytics_custom_module_config - create_security_health_analytics_custom_module_config = parent_rpcs.create_security_health_analytics_custom_module if parent_rpcs.respond_to? :create_security_health_analytics_custom_module - @create_security_health_analytics_custom_module = ::Gapic::Config::Method.new create_security_health_analytics_custom_module_config - update_security_health_analytics_custom_module_config = parent_rpcs.update_security_health_analytics_custom_module if parent_rpcs.respond_to? :update_security_health_analytics_custom_module - @update_security_health_analytics_custom_module = ::Gapic::Config::Method.new update_security_health_analytics_custom_module_config - delete_security_health_analytics_custom_module_config = parent_rpcs.delete_security_health_analytics_custom_module if parent_rpcs.respond_to? :delete_security_health_analytics_custom_module - @delete_security_health_analytics_custom_module = ::Gapic::Config::Method.new delete_security_health_analytics_custom_module_config - simulate_security_health_analytics_custom_module_config = parent_rpcs.simulate_security_health_analytics_custom_module if parent_rpcs.respond_to? :simulate_security_health_analytics_custom_module - @simulate_security_health_analytics_custom_module = ::Gapic::Config::Method.new simulate_security_health_analytics_custom_module_config - list_effective_event_threat_detection_custom_modules_config = parent_rpcs.list_effective_event_threat_detection_custom_modules if parent_rpcs.respond_to? :list_effective_event_threat_detection_custom_modules - @list_effective_event_threat_detection_custom_modules = ::Gapic::Config::Method.new list_effective_event_threat_detection_custom_modules_config - get_effective_event_threat_detection_custom_module_config = parent_rpcs.get_effective_event_threat_detection_custom_module if parent_rpcs.respond_to? :get_effective_event_threat_detection_custom_module - @get_effective_event_threat_detection_custom_module = ::Gapic::Config::Method.new get_effective_event_threat_detection_custom_module_config - list_event_threat_detection_custom_modules_config = parent_rpcs.list_event_threat_detection_custom_modules if parent_rpcs.respond_to? :list_event_threat_detection_custom_modules - @list_event_threat_detection_custom_modules = ::Gapic::Config::Method.new list_event_threat_detection_custom_modules_config - list_descendant_event_threat_detection_custom_modules_config = parent_rpcs.list_descendant_event_threat_detection_custom_modules if parent_rpcs.respond_to? :list_descendant_event_threat_detection_custom_modules - @list_descendant_event_threat_detection_custom_modules = ::Gapic::Config::Method.new list_descendant_event_threat_detection_custom_modules_config - get_event_threat_detection_custom_module_config = parent_rpcs.get_event_threat_detection_custom_module if parent_rpcs.respond_to? :get_event_threat_detection_custom_module - @get_event_threat_detection_custom_module = ::Gapic::Config::Method.new get_event_threat_detection_custom_module_config - create_event_threat_detection_custom_module_config = parent_rpcs.create_event_threat_detection_custom_module if parent_rpcs.respond_to? :create_event_threat_detection_custom_module - @create_event_threat_detection_custom_module = ::Gapic::Config::Method.new create_event_threat_detection_custom_module_config - update_event_threat_detection_custom_module_config = parent_rpcs.update_event_threat_detection_custom_module if parent_rpcs.respond_to? :update_event_threat_detection_custom_module - @update_event_threat_detection_custom_module = ::Gapic::Config::Method.new update_event_threat_detection_custom_module_config - delete_event_threat_detection_custom_module_config = parent_rpcs.delete_event_threat_detection_custom_module if parent_rpcs.respond_to? :delete_event_threat_detection_custom_module - @delete_event_threat_detection_custom_module = ::Gapic::Config::Method.new delete_event_threat_detection_custom_module_config - validate_event_threat_detection_custom_module_config = parent_rpcs.validate_event_threat_detection_custom_module if parent_rpcs.respond_to? :validate_event_threat_detection_custom_module - @validate_event_threat_detection_custom_module = ::Gapic::Config::Method.new validate_event_threat_detection_custom_module_config - get_security_center_service_config = parent_rpcs.get_security_center_service if parent_rpcs.respond_to? :get_security_center_service - @get_security_center_service = ::Gapic::Config::Method.new get_security_center_service_config - list_security_center_services_config = parent_rpcs.list_security_center_services if parent_rpcs.respond_to? :list_security_center_services - @list_security_center_services = ::Gapic::Config::Method.new list_security_center_services_config - update_security_center_service_config = parent_rpcs.update_security_center_service if parent_rpcs.respond_to? :update_security_center_service - @update_security_center_service = ::Gapic::Config::Method.new update_security_center_service_config - - yield self if block_given? - end - end - end - end - end - end - end - end -end diff --git a/owl-bot-staging/google-cloud-security_center_management-v1/lib/google/cloud/security_center_management/v1/security_center_management/credentials.rb b/owl-bot-staging/google-cloud-security_center_management-v1/lib/google/cloud/security_center_management/v1/security_center_management/credentials.rb deleted file mode 100644 index d03792871b08..000000000000 --- a/owl-bot-staging/google-cloud-security_center_management-v1/lib/google/cloud/security_center_management/v1/security_center_management/credentials.rb +++ /dev/null @@ -1,47 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -require "googleauth" - -module Google - module Cloud - module SecurityCenterManagement - module V1 - module SecurityCenterManagement - # Credentials for the SecurityCenterManagement API. - class Credentials < ::Google::Auth::Credentials - self.scope = [ - "https://www.googleapis.com/auth/cloud-platform" - ] - self.env_vars = [ - "GOOGLE_CLOUD_CREDENTIALS", - "GOOGLE_CLOUD_KEYFILE", - "GCLOUD_KEYFILE", - "GOOGLE_CLOUD_CREDENTIALS_JSON", - "GOOGLE_CLOUD_KEYFILE_JSON", - "GCLOUD_KEYFILE_JSON" - ] - self.paths = [ - "~/.config/google_cloud/application_default_credentials.json" - ] - end - end - end - end - end -end diff --git a/owl-bot-staging/google-cloud-security_center_management-v1/lib/google/cloud/security_center_management/v1/security_center_management/paths.rb b/owl-bot-staging/google-cloud-security_center_management-v1/lib/google/cloud/security_center_management/v1/security_center_management/paths.rb deleted file mode 100644 index 614cfad55b62..000000000000 --- a/owl-bot-staging/google-cloud-security_center_management-v1/lib/google/cloud/security_center_management/v1/security_center_management/paths.rb +++ /dev/null @@ -1,374 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - - -module Google - module Cloud - module SecurityCenterManagement - module V1 - module SecurityCenterManagement - # Path helper methods for the SecurityCenterManagement API. - module Paths - ## - # Create a fully-qualified EffectiveEventThreatDetectionCustomModule resource string. - # - # @overload effective_event_threat_detection_custom_module_path(organization:, location:, effective_event_threat_detection_custom_module:) - # The resource will be in the following format: - # - # `organizations/{organization}/locations/{location}/effectiveEventThreatDetectionCustomModules/{effective_event_threat_detection_custom_module}` - # - # @param organization [String] - # @param location [String] - # @param effective_event_threat_detection_custom_module [String] - # - # @overload effective_event_threat_detection_custom_module_path(project:, location:, effective_event_threat_detection_custom_module:) - # The resource will be in the following format: - # - # `projects/{project}/locations/{location}/effectiveEventThreatDetectionCustomModules/{effective_event_threat_detection_custom_module}` - # - # @param project [String] - # @param location [String] - # @param effective_event_threat_detection_custom_module [String] - # - # @overload effective_event_threat_detection_custom_module_path(folder:, location:, effective_event_threat_detection_custom_module:) - # The resource will be in the following format: - # - # `folders/{folder}/locations/{location}/effectiveEventThreatDetectionCustomModules/{effective_event_threat_detection_custom_module}` - # - # @param folder [String] - # @param location [String] - # @param effective_event_threat_detection_custom_module [String] - # - # @return [::String] - def effective_event_threat_detection_custom_module_path **args - resources = { - "effective_event_threat_detection_custom_module:location:organization" => (proc do |organization:, location:, effective_event_threat_detection_custom_module:| - raise ::ArgumentError, "organization cannot contain /" if organization.to_s.include? "/" - raise ::ArgumentError, "location cannot contain /" if location.to_s.include? "/" - - "organizations/#{organization}/locations/#{location}/effectiveEventThreatDetectionCustomModules/#{effective_event_threat_detection_custom_module}" - end), - "effective_event_threat_detection_custom_module:location:project" => (proc do |project:, location:, effective_event_threat_detection_custom_module:| - raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" - raise ::ArgumentError, "location cannot contain /" if location.to_s.include? "/" - - "projects/#{project}/locations/#{location}/effectiveEventThreatDetectionCustomModules/#{effective_event_threat_detection_custom_module}" - end), - "effective_event_threat_detection_custom_module:folder:location" => (proc do |folder:, location:, effective_event_threat_detection_custom_module:| - raise ::ArgumentError, "folder cannot contain /" if folder.to_s.include? "/" - raise ::ArgumentError, "location cannot contain /" if location.to_s.include? "/" - - "folders/#{folder}/locations/#{location}/effectiveEventThreatDetectionCustomModules/#{effective_event_threat_detection_custom_module}" - 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 EffectiveSecurityHealthAnalyticsCustomModule resource string. - # - # @overload effective_security_health_analytics_custom_module_path(organization:, location:, effective_security_health_analytics_custom_module:) - # The resource will be in the following format: - # - # `organizations/{organization}/locations/{location}/effectiveSecurityHealthAnalyticsCustomModules/{effective_security_health_analytics_custom_module}` - # - # @param organization [String] - # @param location [String] - # @param effective_security_health_analytics_custom_module [String] - # - # @overload effective_security_health_analytics_custom_module_path(project:, location:, effective_security_health_analytics_custom_module:) - # The resource will be in the following format: - # - # `projects/{project}/locations/{location}/effectiveSecurityHealthAnalyticsCustomModules/{effective_security_health_analytics_custom_module}` - # - # @param project [String] - # @param location [String] - # @param effective_security_health_analytics_custom_module [String] - # - # @overload effective_security_health_analytics_custom_module_path(folder:, location:, effective_security_health_analytics_custom_module:) - # The resource will be in the following format: - # - # `folders/{folder}/locations/{location}/effectiveSecurityHealthAnalyticsCustomModules/{effective_security_health_analytics_custom_module}` - # - # @param folder [String] - # @param location [String] - # @param effective_security_health_analytics_custom_module [String] - # - # @return [::String] - def effective_security_health_analytics_custom_module_path **args - resources = { - "effective_security_health_analytics_custom_module:location:organization" => (proc do |organization:, location:, effective_security_health_analytics_custom_module:| - raise ::ArgumentError, "organization cannot contain /" if organization.to_s.include? "/" - raise ::ArgumentError, "location cannot contain /" if location.to_s.include? "/" - - "organizations/#{organization}/locations/#{location}/effectiveSecurityHealthAnalyticsCustomModules/#{effective_security_health_analytics_custom_module}" - end), - "effective_security_health_analytics_custom_module:location:project" => (proc do |project:, location:, effective_security_health_analytics_custom_module:| - raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" - raise ::ArgumentError, "location cannot contain /" if location.to_s.include? "/" - - "projects/#{project}/locations/#{location}/effectiveSecurityHealthAnalyticsCustomModules/#{effective_security_health_analytics_custom_module}" - end), - "effective_security_health_analytics_custom_module:folder:location" => (proc do |folder:, location:, effective_security_health_analytics_custom_module:| - raise ::ArgumentError, "folder cannot contain /" if folder.to_s.include? "/" - raise ::ArgumentError, "location cannot contain /" if location.to_s.include? "/" - - "folders/#{folder}/locations/#{location}/effectiveSecurityHealthAnalyticsCustomModules/#{effective_security_health_analytics_custom_module}" - 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 EventThreatDetectionCustomModule resource string. - # - # @overload event_threat_detection_custom_module_path(organization:, location:, event_threat_detection_custom_module:) - # The resource will be in the following format: - # - # `organizations/{organization}/locations/{location}/eventThreatDetectionCustomModules/{event_threat_detection_custom_module}` - # - # @param organization [String] - # @param location [String] - # @param event_threat_detection_custom_module [String] - # - # @overload event_threat_detection_custom_module_path(project:, location:, event_threat_detection_custom_module:) - # The resource will be in the following format: - # - # `projects/{project}/locations/{location}/eventThreatDetectionCustomModules/{event_threat_detection_custom_module}` - # - # @param project [String] - # @param location [String] - # @param event_threat_detection_custom_module [String] - # - # @overload event_threat_detection_custom_module_path(folder:, location:, event_threat_detection_custom_module:) - # The resource will be in the following format: - # - # `folders/{folder}/locations/{location}/eventThreatDetectionCustomModules/{event_threat_detection_custom_module}` - # - # @param folder [String] - # @param location [String] - # @param event_threat_detection_custom_module [String] - # - # @return [::String] - def event_threat_detection_custom_module_path **args - resources = { - "event_threat_detection_custom_module:location:organization" => (proc do |organization:, location:, event_threat_detection_custom_module:| - raise ::ArgumentError, "organization cannot contain /" if organization.to_s.include? "/" - raise ::ArgumentError, "location cannot contain /" if location.to_s.include? "/" - - "organizations/#{organization}/locations/#{location}/eventThreatDetectionCustomModules/#{event_threat_detection_custom_module}" - end), - "event_threat_detection_custom_module:location:project" => (proc do |project:, location:, event_threat_detection_custom_module:| - raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" - raise ::ArgumentError, "location cannot contain /" if location.to_s.include? "/" - - "projects/#{project}/locations/#{location}/eventThreatDetectionCustomModules/#{event_threat_detection_custom_module}" - end), - "event_threat_detection_custom_module:folder:location" => (proc do |folder:, location:, event_threat_detection_custom_module:| - raise ::ArgumentError, "folder cannot contain /" if folder.to_s.include? "/" - raise ::ArgumentError, "location cannot contain /" if location.to_s.include? "/" - - "folders/#{folder}/locations/#{location}/eventThreatDetectionCustomModules/#{event_threat_detection_custom_module}" - 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 - - ## - # Create a fully-qualified SecurityCenterService resource string. - # - # @overload security_center_service_path(project:, location:, service:) - # The resource will be in the following format: - # - # `projects/{project}/locations/{location}/securityCenterServices/{service}` - # - # @param project [String] - # @param location [String] - # @param service [String] - # - # @overload security_center_service_path(folder:, location:, service:) - # The resource will be in the following format: - # - # `folders/{folder}/locations/{location}/securityCenterServices/{service}` - # - # @param folder [String] - # @param location [String] - # @param service [String] - # - # @overload security_center_service_path(organization:, location:, service:) - # The resource will be in the following format: - # - # `organizations/{organization}/locations/{location}/securityCenterServices/{service}` - # - # @param organization [String] - # @param location [String] - # @param service [String] - # - # @return [::String] - def security_center_service_path **args - resources = { - "location:project:service" => (proc do |project:, location:, service:| - raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" - raise ::ArgumentError, "location cannot contain /" if location.to_s.include? "/" - - "projects/#{project}/locations/#{location}/securityCenterServices/#{service}" - end), - "folder:location:service" => (proc do |folder:, location:, service:| - raise ::ArgumentError, "folder cannot contain /" if folder.to_s.include? "/" - raise ::ArgumentError, "location cannot contain /" if location.to_s.include? "/" - - "folders/#{folder}/locations/#{location}/securityCenterServices/#{service}" - end), - "location:organization:service" => (proc do |organization:, location:, service:| - raise ::ArgumentError, "organization cannot contain /" if organization.to_s.include? "/" - raise ::ArgumentError, "location cannot contain /" if location.to_s.include? "/" - - "organizations/#{organization}/locations/#{location}/securityCenterServices/#{service}" - 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 SecurityHealthAnalyticsCustomModule resource string. - # - # @overload security_health_analytics_custom_module_path(organization:, location:, security_health_analytics_custom_module:) - # The resource will be in the following format: - # - # `organizations/{organization}/locations/{location}/securityHealthAnalyticsCustomModules/{security_health_analytics_custom_module}` - # - # @param organization [String] - # @param location [String] - # @param security_health_analytics_custom_module [String] - # - # @overload security_health_analytics_custom_module_path(project:, location:, security_health_analytics_custom_module:) - # The resource will be in the following format: - # - # `projects/{project}/locations/{location}/securityHealthAnalyticsCustomModules/{security_health_analytics_custom_module}` - # - # @param project [String] - # @param location [String] - # @param security_health_analytics_custom_module [String] - # - # @overload security_health_analytics_custom_module_path(folder:, location:, security_health_analytics_custom_module:) - # The resource will be in the following format: - # - # `folders/{folder}/locations/{location}/securityHealthAnalyticsCustomModules/{security_health_analytics_custom_module}` - # - # @param folder [String] - # @param location [String] - # @param security_health_analytics_custom_module [String] - # - # @return [::String] - def security_health_analytics_custom_module_path **args - resources = { - "location:organization:security_health_analytics_custom_module" => (proc do |organization:, location:, security_health_analytics_custom_module:| - raise ::ArgumentError, "organization cannot contain /" if organization.to_s.include? "/" - raise ::ArgumentError, "location cannot contain /" if location.to_s.include? "/" - - "organizations/#{organization}/locations/#{location}/securityHealthAnalyticsCustomModules/#{security_health_analytics_custom_module}" - end), - "location:project:security_health_analytics_custom_module" => (proc do |project:, location:, security_health_analytics_custom_module:| - raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" - raise ::ArgumentError, "location cannot contain /" if location.to_s.include? "/" - - "projects/#{project}/locations/#{location}/securityHealthAnalyticsCustomModules/#{security_health_analytics_custom_module}" - end), - "folder:location:security_health_analytics_custom_module" => (proc do |folder:, location:, security_health_analytics_custom_module:| - raise ::ArgumentError, "folder cannot contain /" if folder.to_s.include? "/" - raise ::ArgumentError, "location cannot contain /" if location.to_s.include? "/" - - "folders/#{folder}/locations/#{location}/securityHealthAnalyticsCustomModules/#{security_health_analytics_custom_module}" - 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 -end diff --git a/owl-bot-staging/google-cloud-security_center_management-v1/lib/google/cloud/security_center_management/v1/security_center_management/rest.rb b/owl-bot-staging/google-cloud-security_center_management-v1/lib/google/cloud/security_center_management/v1/security_center_management/rest.rb deleted file mode 100644 index 2451529ae88b..000000000000 --- a/owl-bot-staging/google-cloud-security_center_management-v1/lib/google/cloud/security_center_management/v1/security_center_management/rest.rb +++ /dev/null @@ -1,53 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -require "gapic/rest" -require "gapic/config" -require "gapic/config/method" - -require "google/cloud/security_center_management/v1/version" -require "google/cloud/security_center_management/v1/bindings_override" - -require "google/cloud/security_center_management/v1/security_center_management/credentials" -require "google/cloud/security_center_management/v1/security_center_management/paths" -require "google/cloud/security_center_management/v1/security_center_management/rest/client" - -module Google - module Cloud - module SecurityCenterManagement - module V1 - ## - # Service describing handlers for resources - # - # To load this service and instantiate a REST client: - # - # require "google/cloud/security_center_management/v1/security_center_management/rest" - # client = ::Google::Cloud::SecurityCenterManagement::V1::SecurityCenterManagement::Rest::Client.new - # - module SecurityCenterManagement - # Client for the REST transport - module Rest - end - end - end - end - end -end - -helper_path = ::File.join __dir__, "rest", "helpers.rb" -require "google/cloud/security_center_management/v1/security_center_management/rest/helpers" if ::File.file? helper_path diff --git a/owl-bot-staging/google-cloud-security_center_management-v1/lib/google/cloud/security_center_management/v1/security_center_management/rest/client.rb b/owl-bot-staging/google-cloud-security_center_management-v1/lib/google/cloud/security_center_management/v1/security_center_management/rest/client.rb deleted file mode 100644 index 6dd8e13223c3..000000000000 --- a/owl-bot-staging/google-cloud-security_center_management-v1/lib/google/cloud/security_center_management/v1/security_center_management/rest/client.rb +++ /dev/null @@ -1,2608 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -require "google/cloud/errors" -require "google/cloud/securitycentermanagement/v1/security_center_management_pb" -require "google/cloud/security_center_management/v1/security_center_management/rest/service_stub" -require "google/cloud/location/rest" - -module Google - module Cloud - module SecurityCenterManagement - module V1 - module SecurityCenterManagement - module Rest - ## - # REST client for the SecurityCenterManagement service. - # - # Service describing handlers for resources - # - class Client - # @private - API_VERSION = "" - - # @private - DEFAULT_ENDPOINT_TEMPLATE = "securitycentermanagement.$UNIVERSE_DOMAIN$" - - include Paths - - # @private - attr_reader :security_center_management_stub - - ## - # Configure the SecurityCenterManagement Client class. - # - # See {::Google::Cloud::SecurityCenterManagement::V1::SecurityCenterManagement::Rest::Client::Configuration} - # for a description of the configuration fields. - # - # @example - # - # # Modify the configuration for all SecurityCenterManagement clients - # ::Google::Cloud::SecurityCenterManagement::V1::SecurityCenterManagement::Rest::Client.configure do |config| - # config.timeout = 10.0 - # end - # - # @yield [config] Configure the Client client. - # @yieldparam config [Client::Configuration] - # - # @return [Client::Configuration] - # - def self.configure - @configure ||= begin - namespace = ["Google", "Cloud", "SecurityCenterManagement", "V1"] - parent_config = while namespace.any? - parent_name = namespace.join "::" - parent_const = const_get parent_name - break parent_const.configure if parent_const.respond_to? :configure - namespace.pop - end - default_config = Client::Configuration.new parent_config - - default_config.rpcs.list_effective_security_health_analytics_custom_modules.timeout = 60.0 - default_config.rpcs.list_effective_security_health_analytics_custom_modules.retry_policy = { - initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [14, 4] - } - - default_config.rpcs.get_effective_security_health_analytics_custom_module.timeout = 60.0 - default_config.rpcs.get_effective_security_health_analytics_custom_module.retry_policy = { - initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [14, 4] - } - - default_config.rpcs.list_security_health_analytics_custom_modules.timeout = 60.0 - default_config.rpcs.list_security_health_analytics_custom_modules.retry_policy = { - initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [14, 4] - } - - default_config.rpcs.list_descendant_security_health_analytics_custom_modules.timeout = 60.0 - default_config.rpcs.list_descendant_security_health_analytics_custom_modules.retry_policy = { - initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [14, 4] - } - - default_config.rpcs.get_security_health_analytics_custom_module.timeout = 60.0 - default_config.rpcs.get_security_health_analytics_custom_module.retry_policy = { - initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [14, 4] - } - - default_config.rpcs.create_security_health_analytics_custom_module.timeout = 60.0 - - default_config.rpcs.update_security_health_analytics_custom_module.timeout = 60.0 - - default_config.rpcs.delete_security_health_analytics_custom_module.timeout = 60.0 - - default_config.rpcs.simulate_security_health_analytics_custom_module.timeout = 60.0 - default_config.rpcs.simulate_security_health_analytics_custom_module.retry_policy = { - initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [14, 4] - } - - default_config.rpcs.list_effective_event_threat_detection_custom_modules.timeout = 60.0 - default_config.rpcs.list_effective_event_threat_detection_custom_modules.retry_policy = { - initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [14, 4] - } - - default_config.rpcs.get_effective_event_threat_detection_custom_module.timeout = 60.0 - default_config.rpcs.get_effective_event_threat_detection_custom_module.retry_policy = { - initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [14, 4] - } - - default_config.rpcs.list_event_threat_detection_custom_modules.timeout = 60.0 - default_config.rpcs.list_event_threat_detection_custom_modules.retry_policy = { - initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [14, 4] - } - - default_config.rpcs.list_descendant_event_threat_detection_custom_modules.timeout = 60.0 - default_config.rpcs.list_descendant_event_threat_detection_custom_modules.retry_policy = { - initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [14, 4] - } - - default_config.rpcs.get_event_threat_detection_custom_module.timeout = 60.0 - default_config.rpcs.get_event_threat_detection_custom_module.retry_policy = { - initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [14, 4] - } - - default_config.rpcs.create_event_threat_detection_custom_module.timeout = 60.0 - - default_config.rpcs.update_event_threat_detection_custom_module.timeout = 60.0 - - default_config.rpcs.delete_event_threat_detection_custom_module.timeout = 60.0 - - default_config.rpcs.validate_event_threat_detection_custom_module.timeout = 60.0 - default_config.rpcs.validate_event_threat_detection_custom_module.retry_policy = { - initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [14, 4] - } - - default_config - end - yield @configure if block_given? - @configure - end - - ## - # Configure the SecurityCenterManagement Client instance. - # - # The configuration is set to the derived mode, meaning that values can be changed, - # but structural changes (adding new fields, etc.) are not allowed. Structural changes - # should be made on {Client.configure}. - # - # See {::Google::Cloud::SecurityCenterManagement::V1::SecurityCenterManagement::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 - @security_center_management_stub.universe_domain - end - - ## - # Create a new SecurityCenterManagement REST client object. - # - # @example - # - # # Create a client using the default configuration - # client = ::Google::Cloud::SecurityCenterManagement::V1::SecurityCenterManagement::Rest::Client.new - # - # # Create a client using a custom configuration - # client = ::Google::Cloud::SecurityCenterManagement::V1::SecurityCenterManagement::Rest::Client.new do |config| - # config.timeout = 10.0 - # end - # - # @yield [config] Configure the SecurityCenterManagement 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 - - @security_center_management_stub = ::Google::Cloud::SecurityCenterManagement::V1::SecurityCenterManagement::Rest::ServiceStub.new( - endpoint: @config.endpoint, - endpoint_template: DEFAULT_ENDPOINT_TEMPLATE, - universe_domain: @config.universe_domain, - credentials: credentials, - logger: @config.logger - ) - - @security_center_management_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 = @security_center_management_stub.endpoint - config.universe_domain = @security_center_management_stub.universe_domain - config.bindings_override = @config.bindings_override - config.logger = @security_center_management_stub.logger if config.respond_to? :logger= - end - end - - ## - # Get the associated client for mix-in of the Locations. - # - # @return [Google::Cloud::Location::Locations::Rest::Client] - # - attr_reader :location_client - - ## - # The logger used for request/response debug logging. - # - # @return [Logger] - # - def logger - @security_center_management_stub.logger - end - - # Service calls - - ## - # Returns a list of all - # {::Google::Cloud::SecurityCenterManagement::V1::EffectiveSecurityHealthAnalyticsCustomModule EffectiveSecurityHealthAnalyticsCustomModule} - # resources for the given parent. This includes resident modules defined at - # the scope of the parent, and inherited modules, inherited from ancestor - # organizations, folders, and projects (no descendants). - # - # @overload list_effective_security_health_analytics_custom_modules(request, options = nil) - # Pass arguments to `list_effective_security_health_analytics_custom_modules` via a request object, either of type - # {::Google::Cloud::SecurityCenterManagement::V1::ListEffectiveSecurityHealthAnalyticsCustomModulesRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::SecurityCenterManagement::V1::ListEffectiveSecurityHealthAnalyticsCustomModulesRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_effective_security_health_analytics_custom_modules(parent: nil, page_size: nil, page_token: nil) - # Pass arguments to `list_effective_security_health_analytics_custom_modules` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param parent [::String] - # Required. Name of parent to list effective custom modules, in one of the - # following formats: - # - # * `organizations/{organization}/locations/{location}` - # * `folders/{folder}/locations/{location}` - # * `projects/{project}/locations/{location}` - # @param page_size [::Integer] - # Optional. The maximum number of results to return in a single response. - # Default is 10, minimum is 1, maximum is 1000. - # @param page_token [::String] - # Optional. A pagination token returned from a previous request. Provide this - # token to retrieve the next page of results. - # - # When paginating, the rest of the request must match the request that - # generated the page token. - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Gapic::Rest::PagedEnumerable<::Google::Cloud::SecurityCenterManagement::V1::EffectiveSecurityHealthAnalyticsCustomModule>] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Gapic::Rest::PagedEnumerable<::Google::Cloud::SecurityCenterManagement::V1::EffectiveSecurityHealthAnalyticsCustomModule>] - # - # @raise [::Google::Cloud::Error] if the REST call is aborted. - # - # @example Basic example - # require "google/cloud/security_center_management/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::SecurityCenterManagement::V1::SecurityCenterManagement::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::SecurityCenterManagement::V1::ListEffectiveSecurityHealthAnalyticsCustomModulesRequest.new - # - # # Call the list_effective_security_health_analytics_custom_modules method. - # result = client.list_effective_security_health_analytics_custom_modules request - # - # # The returned object is of type Gapic::PagedEnumerable. You can iterate - # # over elements, and API calls will be issued to fetch pages as needed. - # result.each do |item| - # # Each element is of type ::Google::Cloud::SecurityCenterManagement::V1::EffectiveSecurityHealthAnalyticsCustomModule. - # p item - # end - # - def list_effective_security_health_analytics_custom_modules request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::SecurityCenterManagement::V1::ListEffectiveSecurityHealthAnalyticsCustomModulesRequest - - # Converts hash 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_effective_security_health_analytics_custom_modules.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::SecurityCenterManagement::V1::VERSION, - transports_version_send: [:rest] - - call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - options.apply_defaults timeout: @config.rpcs.list_effective_security_health_analytics_custom_modules.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.list_effective_security_health_analytics_custom_modules.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @security_center_management_stub.list_effective_security_health_analytics_custom_modules request, options do |result, operation| - result = ::Gapic::Rest::PagedEnumerable.new @security_center_management_stub, :list_effective_security_health_analytics_custom_modules, "effective_security_health_analytics_custom_modules", 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 details of a single - # {::Google::Cloud::SecurityCenterManagement::V1::EffectiveSecurityHealthAnalyticsCustomModule EffectiveSecurityHealthAnalyticsCustomModule}. - # - # @overload get_effective_security_health_analytics_custom_module(request, options = nil) - # Pass arguments to `get_effective_security_health_analytics_custom_module` via a request object, either of type - # {::Google::Cloud::SecurityCenterManagement::V1::GetEffectiveSecurityHealthAnalyticsCustomModuleRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::SecurityCenterManagement::V1::GetEffectiveSecurityHealthAnalyticsCustomModuleRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_effective_security_health_analytics_custom_module(name: nil) - # Pass arguments to `get_effective_security_health_analytics_custom_module` via keyword arguments. Note that at - # least one keyword argument is 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 full resource name of the custom module, specified in one of - # the following formats: - # - # * `organizations/organization/{location}/effectiveSecurityHealthAnalyticsCustomModules/{custom_module}` - # * `folders/folder/{location}/effectiveSecurityHealthAnalyticsCustomModules/{custom_module}` - # * `projects/project/{location}/effectiveSecurityHealthAnalyticsCustomModules/{custom_module}` - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Cloud::SecurityCenterManagement::V1::EffectiveSecurityHealthAnalyticsCustomModule] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::SecurityCenterManagement::V1::EffectiveSecurityHealthAnalyticsCustomModule] - # - # @raise [::Google::Cloud::Error] if the REST call is aborted. - # - # @example Basic example - # require "google/cloud/security_center_management/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::SecurityCenterManagement::V1::SecurityCenterManagement::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::SecurityCenterManagement::V1::GetEffectiveSecurityHealthAnalyticsCustomModuleRequest.new - # - # # Call the get_effective_security_health_analytics_custom_module method. - # result = client.get_effective_security_health_analytics_custom_module request - # - # # The returned object is of type Google::Cloud::SecurityCenterManagement::V1::EffectiveSecurityHealthAnalyticsCustomModule. - # p result - # - def get_effective_security_health_analytics_custom_module request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::SecurityCenterManagement::V1::GetEffectiveSecurityHealthAnalyticsCustomModuleRequest - - # Converts hash 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_effective_security_health_analytics_custom_module.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::SecurityCenterManagement::V1::VERSION, - transports_version_send: [:rest] - - call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - options.apply_defaults timeout: @config.rpcs.get_effective_security_health_analytics_custom_module.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.get_effective_security_health_analytics_custom_module.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @security_center_management_stub.get_effective_security_health_analytics_custom_module request, options do |result, operation| - yield result, operation if block_given? - end - rescue ::Gapic::Rest::Error => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Returns a list of all - # {::Google::Cloud::SecurityCenterManagement::V1::SecurityHealthAnalyticsCustomModule SecurityHealthAnalyticsCustomModule} - # resources for the given parent. This includes resident modules defined at - # the scope of the parent, and inherited modules, inherited from ancestor - # organizations, folders, and projects (no descendants). - # - # @overload list_security_health_analytics_custom_modules(request, options = nil) - # Pass arguments to `list_security_health_analytics_custom_modules` via a request object, either of type - # {::Google::Cloud::SecurityCenterManagement::V1::ListSecurityHealthAnalyticsCustomModulesRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::SecurityCenterManagement::V1::ListSecurityHealthAnalyticsCustomModulesRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_security_health_analytics_custom_modules(parent: nil, page_size: nil, page_token: nil) - # Pass arguments to `list_security_health_analytics_custom_modules` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param parent [::String] - # Required. Name of the parent organization, folder, or project in which to - # list custom modules, in one of the following formats: - # - # * `organizations/{organization}/locations/{location}` - # * `folders/{folder}/locations/{location}` - # * `projects/{project}/locations/{location}` - # @param page_size [::Integer] - # Optional. The maximum number of results to return in a single response. - # Default is 10, minimum is 1, maximum is 1000. - # @param page_token [::String] - # Optional. A pagination token returned from a previous request. Provide this - # token to retrieve the next page of results. - # - # When paginating, the rest of the request must match the request that - # generated the page token. - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Gapic::Rest::PagedEnumerable<::Google::Cloud::SecurityCenterManagement::V1::SecurityHealthAnalyticsCustomModule>] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Gapic::Rest::PagedEnumerable<::Google::Cloud::SecurityCenterManagement::V1::SecurityHealthAnalyticsCustomModule>] - # - # @raise [::Google::Cloud::Error] if the REST call is aborted. - # - # @example Basic example - # require "google/cloud/security_center_management/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::SecurityCenterManagement::V1::SecurityCenterManagement::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::SecurityCenterManagement::V1::ListSecurityHealthAnalyticsCustomModulesRequest.new - # - # # Call the list_security_health_analytics_custom_modules method. - # result = client.list_security_health_analytics_custom_modules request - # - # # The returned object is of type Gapic::PagedEnumerable. You can iterate - # # over elements, and API calls will be issued to fetch pages as needed. - # result.each do |item| - # # Each element is of type ::Google::Cloud::SecurityCenterManagement::V1::SecurityHealthAnalyticsCustomModule. - # p item - # end - # - def list_security_health_analytics_custom_modules request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::SecurityCenterManagement::V1::ListSecurityHealthAnalyticsCustomModulesRequest - - # Converts hash 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_security_health_analytics_custom_modules.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::SecurityCenterManagement::V1::VERSION, - transports_version_send: [:rest] - - call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - options.apply_defaults timeout: @config.rpcs.list_security_health_analytics_custom_modules.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.list_security_health_analytics_custom_modules.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @security_center_management_stub.list_security_health_analytics_custom_modules request, options do |result, operation| - result = ::Gapic::Rest::PagedEnumerable.new @security_center_management_stub, :list_security_health_analytics_custom_modules, "security_health_analytics_custom_modules", 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 a list of all resident - # {::Google::Cloud::SecurityCenterManagement::V1::SecurityHealthAnalyticsCustomModule SecurityHealthAnalyticsCustomModule} - # resources under the given organization, folder, or project and all of its - # descendants. - # - # @overload list_descendant_security_health_analytics_custom_modules(request, options = nil) - # Pass arguments to `list_descendant_security_health_analytics_custom_modules` via a request object, either of type - # {::Google::Cloud::SecurityCenterManagement::V1::ListDescendantSecurityHealthAnalyticsCustomModulesRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::SecurityCenterManagement::V1::ListDescendantSecurityHealthAnalyticsCustomModulesRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_descendant_security_health_analytics_custom_modules(parent: nil, page_size: nil, page_token: nil) - # Pass arguments to `list_descendant_security_health_analytics_custom_modules` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param parent [::String] - # Required. Name of the parent organization, folder, or project in which to - # list custom modules, in one of the following formats: - # - # * `organizations/{organization}/locations/{location}` - # * `folders/{folder}/locations/{location}` - # * `projects/{project}/locations/{location}` - # @param page_size [::Integer] - # Optional. The maximum number of results to return in a single response. - # Default is 10, minimum is 1, maximum is 1000. - # @param page_token [::String] - # Optional. A pagination token returned from a previous request. Provide this - # token to retrieve the next page of results. - # - # When paginating, the rest of the request must match the request that - # generated the page token. - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Gapic::Rest::PagedEnumerable<::Google::Cloud::SecurityCenterManagement::V1::SecurityHealthAnalyticsCustomModule>] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Gapic::Rest::PagedEnumerable<::Google::Cloud::SecurityCenterManagement::V1::SecurityHealthAnalyticsCustomModule>] - # - # @raise [::Google::Cloud::Error] if the REST call is aborted. - # - # @example Basic example - # require "google/cloud/security_center_management/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::SecurityCenterManagement::V1::SecurityCenterManagement::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::SecurityCenterManagement::V1::ListDescendantSecurityHealthAnalyticsCustomModulesRequest.new - # - # # Call the list_descendant_security_health_analytics_custom_modules method. - # result = client.list_descendant_security_health_analytics_custom_modules request - # - # # The returned object is of type Gapic::PagedEnumerable. You can iterate - # # over elements, and API calls will be issued to fetch pages as needed. - # result.each do |item| - # # Each element is of type ::Google::Cloud::SecurityCenterManagement::V1::SecurityHealthAnalyticsCustomModule. - # p item - # end - # - def list_descendant_security_health_analytics_custom_modules request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::SecurityCenterManagement::V1::ListDescendantSecurityHealthAnalyticsCustomModulesRequest - - # Converts hash 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_descendant_security_health_analytics_custom_modules.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::SecurityCenterManagement::V1::VERSION, - transports_version_send: [:rest] - - call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - options.apply_defaults timeout: @config.rpcs.list_descendant_security_health_analytics_custom_modules.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.list_descendant_security_health_analytics_custom_modules.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @security_center_management_stub.list_descendant_security_health_analytics_custom_modules request, options do |result, operation| - result = ::Gapic::Rest::PagedEnumerable.new @security_center_management_stub, :list_descendant_security_health_analytics_custom_modules, "security_health_analytics_custom_modules", 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 - - ## - # Retrieves a - # {::Google::Cloud::SecurityCenterManagement::V1::SecurityHealthAnalyticsCustomModule SecurityHealthAnalyticsCustomModule}. - # - # @overload get_security_health_analytics_custom_module(request, options = nil) - # Pass arguments to `get_security_health_analytics_custom_module` via a request object, either of type - # {::Google::Cloud::SecurityCenterManagement::V1::GetSecurityHealthAnalyticsCustomModuleRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::SecurityCenterManagement::V1::GetSecurityHealthAnalyticsCustomModuleRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_security_health_analytics_custom_module(name: nil) - # Pass arguments to `get_security_health_analytics_custom_module` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param name [::String] - # Required. Name of the resource, in the format - # `projects/{project}/locations/{location}/securityHealthAnalyticsCustomModules/{custom_module}`. - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Cloud::SecurityCenterManagement::V1::SecurityHealthAnalyticsCustomModule] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::SecurityCenterManagement::V1::SecurityHealthAnalyticsCustomModule] - # - # @raise [::Google::Cloud::Error] if the REST call is aborted. - # - # @example Basic example - # require "google/cloud/security_center_management/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::SecurityCenterManagement::V1::SecurityCenterManagement::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::SecurityCenterManagement::V1::GetSecurityHealthAnalyticsCustomModuleRequest.new - # - # # Call the get_security_health_analytics_custom_module method. - # result = client.get_security_health_analytics_custom_module request - # - # # The returned object is of type Google::Cloud::SecurityCenterManagement::V1::SecurityHealthAnalyticsCustomModule. - # p result - # - def get_security_health_analytics_custom_module request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::SecurityCenterManagement::V1::GetSecurityHealthAnalyticsCustomModuleRequest - - # Converts hash 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_security_health_analytics_custom_module.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::SecurityCenterManagement::V1::VERSION, - transports_version_send: [:rest] - - call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - options.apply_defaults timeout: @config.rpcs.get_security_health_analytics_custom_module.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.get_security_health_analytics_custom_module.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @security_center_management_stub.get_security_health_analytics_custom_module request, options do |result, operation| - yield result, operation if block_given? - end - rescue ::Gapic::Rest::Error => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Creates a resident - # {::Google::Cloud::SecurityCenterManagement::V1::SecurityHealthAnalyticsCustomModule SecurityHealthAnalyticsCustomModule} - # at the scope of the given organization, folder, or project, and also - # creates inherited `SecurityHealthAnalyticsCustomModule` resources for all - # folders and projects that are descendants of the given parent. These - # modules are enabled by default. - # - # @overload create_security_health_analytics_custom_module(request, options = nil) - # Pass arguments to `create_security_health_analytics_custom_module` via a request object, either of type - # {::Google::Cloud::SecurityCenterManagement::V1::CreateSecurityHealthAnalyticsCustomModuleRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::SecurityCenterManagement::V1::CreateSecurityHealthAnalyticsCustomModuleRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_security_health_analytics_custom_module(parent: nil, security_health_analytics_custom_module: nil, validate_only: nil) - # Pass arguments to `create_security_health_analytics_custom_module` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param parent [::String] - # Required. Name of the parent organization, folder, or project of the - # module, in one of the following formats: - # - # * `organizations/{organization}/locations/{location}` - # * `folders/{folder}/locations/{location}` - # * `projects/{project}/locations/{location}` - # @param security_health_analytics_custom_module [::Google::Cloud::SecurityCenterManagement::V1::SecurityHealthAnalyticsCustomModule, ::Hash] - # Required. The resource being created. - # @param validate_only [::Boolean] - # Optional. When set to `true`, the request will be validated (including IAM - # checks), but no module will be created. An `OK` response indicates that the - # request is valid, while an error response indicates that the request is - # invalid. - # - # If the request is valid, a subsequent request to create the module could - # still fail for one of the following reasons: - # - # * The state of your cloud resources changed; for example, you lost a - # required IAM permission - # * An error occurred during creation of the module - # - # Defaults to `false`. - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Cloud::SecurityCenterManagement::V1::SecurityHealthAnalyticsCustomModule] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::SecurityCenterManagement::V1::SecurityHealthAnalyticsCustomModule] - # - # @raise [::Google::Cloud::Error] if the REST call is aborted. - # - # @example Basic example - # require "google/cloud/security_center_management/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::SecurityCenterManagement::V1::SecurityCenterManagement::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::SecurityCenterManagement::V1::CreateSecurityHealthAnalyticsCustomModuleRequest.new - # - # # Call the create_security_health_analytics_custom_module method. - # result = client.create_security_health_analytics_custom_module request - # - # # The returned object is of type Google::Cloud::SecurityCenterManagement::V1::SecurityHealthAnalyticsCustomModule. - # p result - # - def create_security_health_analytics_custom_module request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::SecurityCenterManagement::V1::CreateSecurityHealthAnalyticsCustomModuleRequest - - # Converts hash 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_security_health_analytics_custom_module.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::SecurityCenterManagement::V1::VERSION, - transports_version_send: [:rest] - - call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - options.apply_defaults timeout: @config.rpcs.create_security_health_analytics_custom_module.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.create_security_health_analytics_custom_module.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @security_center_management_stub.create_security_health_analytics_custom_module request, options do |result, operation| - yield result, operation if block_given? - end - rescue ::Gapic::Rest::Error => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Updates the - # {::Google::Cloud::SecurityCenterManagement::V1::SecurityHealthAnalyticsCustomModule SecurityHealthAnalyticsCustomModule} - # under the given name based on the given update mask. Updating the - # enablement state is supported on both resident and inherited modules - # (though resident modules cannot have an enablement state of "inherited"). - # Updating the display name and custom configuration of a module is supported - # on resident modules only. - # - # @overload update_security_health_analytics_custom_module(request, options = nil) - # Pass arguments to `update_security_health_analytics_custom_module` via a request object, either of type - # {::Google::Cloud::SecurityCenterManagement::V1::UpdateSecurityHealthAnalyticsCustomModuleRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::SecurityCenterManagement::V1::UpdateSecurityHealthAnalyticsCustomModuleRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_security_health_analytics_custom_module(update_mask: nil, security_health_analytics_custom_module: nil, validate_only: nil) - # Pass arguments to `update_security_health_analytics_custom_module` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param update_mask [::Google::Protobuf::FieldMask, ::Hash] - # Required. The fields to update. The following values are valid: - # - # * `custom_config` - # * `enablement_state` - # - # If you omit this field or set it to the wildcard value `*`, then all - # eligible fields are updated. - # @param security_health_analytics_custom_module [::Google::Cloud::SecurityCenterManagement::V1::SecurityHealthAnalyticsCustomModule, ::Hash] - # Required. The resource being updated. - # @param validate_only [::Boolean] - # Optional. When set to `true`, the request will be validated (including IAM - # checks), but no module will be updated. An `OK` response indicates that the - # request is valid, while an error response indicates that the request is - # invalid. - # - # If the request is valid, a subsequent request to update the module could - # still fail for one of the following reasons: - # - # * The state of your cloud resources changed; for example, you lost a - # required IAM permission - # * An error occurred during creation of the module - # - # Defaults to `false`. - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Cloud::SecurityCenterManagement::V1::SecurityHealthAnalyticsCustomModule] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::SecurityCenterManagement::V1::SecurityHealthAnalyticsCustomModule] - # - # @raise [::Google::Cloud::Error] if the REST call is aborted. - # - # @example Basic example - # require "google/cloud/security_center_management/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::SecurityCenterManagement::V1::SecurityCenterManagement::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::SecurityCenterManagement::V1::UpdateSecurityHealthAnalyticsCustomModuleRequest.new - # - # # Call the update_security_health_analytics_custom_module method. - # result = client.update_security_health_analytics_custom_module request - # - # # The returned object is of type Google::Cloud::SecurityCenterManagement::V1::SecurityHealthAnalyticsCustomModule. - # p result - # - def update_security_health_analytics_custom_module request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::SecurityCenterManagement::V1::UpdateSecurityHealthAnalyticsCustomModuleRequest - - # Converts hash 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_security_health_analytics_custom_module.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::SecurityCenterManagement::V1::VERSION, - transports_version_send: [:rest] - - call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - options.apply_defaults timeout: @config.rpcs.update_security_health_analytics_custom_module.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.update_security_health_analytics_custom_module.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @security_center_management_stub.update_security_health_analytics_custom_module request, options do |result, operation| - yield result, operation if block_given? - end - rescue ::Gapic::Rest::Error => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Deletes the specified - # {::Google::Cloud::SecurityCenterManagement::V1::SecurityHealthAnalyticsCustomModule SecurityHealthAnalyticsCustomModule} - # and all of its descendants in the resource hierarchy. This method is only - # supported for resident custom modules. - # - # @overload delete_security_health_analytics_custom_module(request, options = nil) - # Pass arguments to `delete_security_health_analytics_custom_module` via a request object, either of type - # {::Google::Cloud::SecurityCenterManagement::V1::DeleteSecurityHealthAnalyticsCustomModuleRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::SecurityCenterManagement::V1::DeleteSecurityHealthAnalyticsCustomModuleRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_security_health_analytics_custom_module(name: nil, validate_only: nil) - # Pass arguments to `delete_security_health_analytics_custom_module` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param name [::String] - # Required. The resource name of the SHA custom module, in one of the - # following formats: - # - # * `organizations/{organization}/locations/{location}/securityHealthAnalyticsCustomModules/{custom_module}` - # * `folders/{folder}/locations/{location}/securityHealthAnalyticsCustomModules/{custom_module}` - # * `projects/{project}/locations/{location}/securityHealthAnalyticsCustomModules/{custom_module}` - # @param validate_only [::Boolean] - # Optional. When set to `true`, the request will be validated (including IAM - # checks), but no module will be deleted. An `OK` response indicates that the - # request is valid, while an error response indicates that the request is - # invalid. - # - # If the request is valid, a subsequent request to delete the module could - # still fail for one of the following reasons: - # - # * The state of your cloud resources changed; for example, you lost a - # required IAM permission - # * An error occurred during deletion of the module - # - # Defaults to `false`. - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Protobuf::Empty] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Protobuf::Empty] - # - # @raise [::Google::Cloud::Error] if the REST call is aborted. - # - # @example Basic example - # require "google/cloud/security_center_management/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::SecurityCenterManagement::V1::SecurityCenterManagement::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::SecurityCenterManagement::V1::DeleteSecurityHealthAnalyticsCustomModuleRequest.new - # - # # Call the delete_security_health_analytics_custom_module method. - # result = client.delete_security_health_analytics_custom_module request - # - # # The returned object is of type Google::Protobuf::Empty. - # p result - # - def delete_security_health_analytics_custom_module request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::SecurityCenterManagement::V1::DeleteSecurityHealthAnalyticsCustomModuleRequest - - # Converts hash 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_security_health_analytics_custom_module.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::SecurityCenterManagement::V1::VERSION, - transports_version_send: [:rest] - - call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - options.apply_defaults timeout: @config.rpcs.delete_security_health_analytics_custom_module.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.delete_security_health_analytics_custom_module.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @security_center_management_stub.delete_security_health_analytics_custom_module 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 - - ## - # Simulates the result of using a - # {::Google::Cloud::SecurityCenterManagement::V1::SecurityHealthAnalyticsCustomModule SecurityHealthAnalyticsCustomModule} - # to check a resource. - # - # @overload simulate_security_health_analytics_custom_module(request, options = nil) - # Pass arguments to `simulate_security_health_analytics_custom_module` via a request object, either of type - # {::Google::Cloud::SecurityCenterManagement::V1::SimulateSecurityHealthAnalyticsCustomModuleRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::SecurityCenterManagement::V1::SimulateSecurityHealthAnalyticsCustomModuleRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @overload simulate_security_health_analytics_custom_module(parent: nil, custom_config: nil, resource: nil) - # Pass arguments to `simulate_security_health_analytics_custom_module` via keyword arguments. Note that at - # least one keyword argument is 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 relative resource name of the organization, project, or - # folder. For more information about relative resource names, see [AIP-122: - # Resource names](https://google.aip.dev/122). Example: - # `organizations/{organization_id}`. - # @param custom_config [::Google::Cloud::SecurityCenterManagement::V1::CustomConfig, ::Hash] - # Required. The custom configuration that you need to test. - # @param resource [::Google::Cloud::SecurityCenterManagement::V1::SimulateSecurityHealthAnalyticsCustomModuleRequest::SimulatedResource, ::Hash] - # Required. Resource data to simulate custom module against. - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Cloud::SecurityCenterManagement::V1::SimulateSecurityHealthAnalyticsCustomModuleResponse] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::SecurityCenterManagement::V1::SimulateSecurityHealthAnalyticsCustomModuleResponse] - # - # @raise [::Google::Cloud::Error] if the REST call is aborted. - # - # @example Basic example - # require "google/cloud/security_center_management/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::SecurityCenterManagement::V1::SecurityCenterManagement::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::SecurityCenterManagement::V1::SimulateSecurityHealthAnalyticsCustomModuleRequest.new - # - # # Call the simulate_security_health_analytics_custom_module method. - # result = client.simulate_security_health_analytics_custom_module request - # - # # The returned object is of type Google::Cloud::SecurityCenterManagement::V1::SimulateSecurityHealthAnalyticsCustomModuleResponse. - # p result - # - def simulate_security_health_analytics_custom_module request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::SecurityCenterManagement::V1::SimulateSecurityHealthAnalyticsCustomModuleRequest - - # Converts hash 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.simulate_security_health_analytics_custom_module.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::SecurityCenterManagement::V1::VERSION, - transports_version_send: [:rest] - - call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - options.apply_defaults timeout: @config.rpcs.simulate_security_health_analytics_custom_module.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.simulate_security_health_analytics_custom_module.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @security_center_management_stub.simulate_security_health_analytics_custom_module request, options do |result, operation| - yield result, operation if block_given? - end - rescue ::Gapic::Rest::Error => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Lists all effective Event Threat Detection custom modules for the - # given parent. This includes resident modules defined at the scope of the - # parent along with modules inherited from its ancestors. - # - # @overload list_effective_event_threat_detection_custom_modules(request, options = nil) - # Pass arguments to `list_effective_event_threat_detection_custom_modules` via a request object, either of type - # {::Google::Cloud::SecurityCenterManagement::V1::ListEffectiveEventThreatDetectionCustomModulesRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::SecurityCenterManagement::V1::ListEffectiveEventThreatDetectionCustomModulesRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_effective_event_threat_detection_custom_modules(parent: nil, page_size: nil, page_token: nil) - # Pass arguments to `list_effective_event_threat_detection_custom_modules` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param parent [::String] - # Required. Name of parent to list effective custom modules, in one of the - # following formats: - # - # * `organizations/{organization}/locations/{location}` - # * `folders/{folder}/locations/{location}` - # * `projects/{project}/locations/{location}` - # @param page_size [::Integer] - # Optional. The maximum number of results to return in a single response. - # Default is 10, minimum is 1, maximum is 1000. - # @param page_token [::String] - # Optional. A pagination token returned from a previous request. Provide this - # token to retrieve the next page of results. - # - # When paginating, the rest of the request must match the request that - # generated the page token. - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Gapic::Rest::PagedEnumerable<::Google::Cloud::SecurityCenterManagement::V1::EffectiveEventThreatDetectionCustomModule>] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Gapic::Rest::PagedEnumerable<::Google::Cloud::SecurityCenterManagement::V1::EffectiveEventThreatDetectionCustomModule>] - # - # @raise [::Google::Cloud::Error] if the REST call is aborted. - # - # @example Basic example - # require "google/cloud/security_center_management/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::SecurityCenterManagement::V1::SecurityCenterManagement::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::SecurityCenterManagement::V1::ListEffectiveEventThreatDetectionCustomModulesRequest.new - # - # # Call the list_effective_event_threat_detection_custom_modules method. - # result = client.list_effective_event_threat_detection_custom_modules request - # - # # The returned object is of type Gapic::PagedEnumerable. You can iterate - # # over elements, and API calls will be issued to fetch pages as needed. - # result.each do |item| - # # Each element is of type ::Google::Cloud::SecurityCenterManagement::V1::EffectiveEventThreatDetectionCustomModule. - # p item - # end - # - def list_effective_event_threat_detection_custom_modules request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::SecurityCenterManagement::V1::ListEffectiveEventThreatDetectionCustomModulesRequest - - # Converts hash 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_effective_event_threat_detection_custom_modules.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::SecurityCenterManagement::V1::VERSION, - transports_version_send: [:rest] - - call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - options.apply_defaults timeout: @config.rpcs.list_effective_event_threat_detection_custom_modules.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.list_effective_event_threat_detection_custom_modules.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @security_center_management_stub.list_effective_event_threat_detection_custom_modules request, options do |result, operation| - result = ::Gapic::Rest::PagedEnumerable.new @security_center_management_stub, :list_effective_event_threat_detection_custom_modules, "effective_event_threat_detection_custom_modules", 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 effective Event Threat Detection custom module at the given level. - # - # The difference between an - # {::Google::Cloud::SecurityCenterManagement::V1::EffectiveEventThreatDetectionCustomModule EffectiveEventThreatDetectionCustomModule} - # and an - # {::Google::Cloud::SecurityCenterManagement::V1::EventThreatDetectionCustomModule EventThreatDetectionCustomModule} - # is that the fields for an `EffectiveEventThreatDetectionCustomModule` are - # computed from ancestors if needed. For example, the enablement state for an - # `EventThreatDetectionCustomModule` can be `ENABLED`, `DISABLED`, or - # `INHERITED`. In contrast, the enablement state for an - # `EffectiveEventThreatDetectionCustomModule` is always computed as `ENABLED` - # or `DISABLED`. - # - # @overload get_effective_event_threat_detection_custom_module(request, options = nil) - # Pass arguments to `get_effective_event_threat_detection_custom_module` via a request object, either of type - # {::Google::Cloud::SecurityCenterManagement::V1::GetEffectiveEventThreatDetectionCustomModuleRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::SecurityCenterManagement::V1::GetEffectiveEventThreatDetectionCustomModuleRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_effective_event_threat_detection_custom_module(name: nil) - # Pass arguments to `get_effective_event_threat_detection_custom_module` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param name [::String] - # Required. The resource name of the Event Threat Detection custom module, in - # one of the following formats: - # - # * `organizations/{organization}/locations/{location}/effectiveEventThreatDetectionCustomModules/{custom_module}` - # * `folders/{folder}/locations/{location}/effectiveEventThreatDetectionCustomModules/{custom_module}` - # * `projects/{project}/locations/{location}/effectiveEventThreatDetectionCustomModules/{custom_module}` - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Cloud::SecurityCenterManagement::V1::EffectiveEventThreatDetectionCustomModule] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::SecurityCenterManagement::V1::EffectiveEventThreatDetectionCustomModule] - # - # @raise [::Google::Cloud::Error] if the REST call is aborted. - # - # @example Basic example - # require "google/cloud/security_center_management/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::SecurityCenterManagement::V1::SecurityCenterManagement::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::SecurityCenterManagement::V1::GetEffectiveEventThreatDetectionCustomModuleRequest.new - # - # # Call the get_effective_event_threat_detection_custom_module method. - # result = client.get_effective_event_threat_detection_custom_module request - # - # # The returned object is of type Google::Cloud::SecurityCenterManagement::V1::EffectiveEventThreatDetectionCustomModule. - # p result - # - def get_effective_event_threat_detection_custom_module request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::SecurityCenterManagement::V1::GetEffectiveEventThreatDetectionCustomModuleRequest - - # Converts hash 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_effective_event_threat_detection_custom_module.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::SecurityCenterManagement::V1::VERSION, - transports_version_send: [:rest] - - call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - options.apply_defaults timeout: @config.rpcs.get_effective_event_threat_detection_custom_module.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.get_effective_event_threat_detection_custom_module.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @security_center_management_stub.get_effective_event_threat_detection_custom_module request, options do |result, operation| - yield result, operation if block_given? - end - rescue ::Gapic::Rest::Error => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Lists all Event Threat Detection custom modules for the given organization, - # folder, or project. This includes resident modules defined at the scope of - # the parent along with modules inherited from ancestors. - # - # @overload list_event_threat_detection_custom_modules(request, options = nil) - # Pass arguments to `list_event_threat_detection_custom_modules` via a request object, either of type - # {::Google::Cloud::SecurityCenterManagement::V1::ListEventThreatDetectionCustomModulesRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::SecurityCenterManagement::V1::ListEventThreatDetectionCustomModulesRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_event_threat_detection_custom_modules(parent: nil, page_size: nil, page_token: nil) - # Pass arguments to `list_event_threat_detection_custom_modules` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param parent [::String] - # Required. Name of parent to list custom modules, in one of the following - # formats: - # - # * `organizations/{organization}/locations/{location}` - # * `folders/{folder}/locations/{location}` - # * `projects/{project}/locations/{location}` - # @param page_size [::Integer] - # Optional. The maximum number of modules to return. The service may return - # fewer than this value. If unspecified, at most 10 modules will be returned. - # The maximum value is 1000; values above 1000 will be coerced to 1000. - # @param page_token [::String] - # Optional. A pagination token returned from a previous request. Provide this - # token to retrieve the next page of results. - # - # When paginating, the rest of the request must match the request that - # generated the page token. - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Gapic::Rest::PagedEnumerable<::Google::Cloud::SecurityCenterManagement::V1::EventThreatDetectionCustomModule>] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Gapic::Rest::PagedEnumerable<::Google::Cloud::SecurityCenterManagement::V1::EventThreatDetectionCustomModule>] - # - # @raise [::Google::Cloud::Error] if the REST call is aborted. - # - # @example Basic example - # require "google/cloud/security_center_management/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::SecurityCenterManagement::V1::SecurityCenterManagement::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::SecurityCenterManagement::V1::ListEventThreatDetectionCustomModulesRequest.new - # - # # Call the list_event_threat_detection_custom_modules method. - # result = client.list_event_threat_detection_custom_modules request - # - # # The returned object is of type Gapic::PagedEnumerable. You can iterate - # # over elements, and API calls will be issued to fetch pages as needed. - # result.each do |item| - # # Each element is of type ::Google::Cloud::SecurityCenterManagement::V1::EventThreatDetectionCustomModule. - # p item - # end - # - def list_event_threat_detection_custom_modules request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::SecurityCenterManagement::V1::ListEventThreatDetectionCustomModulesRequest - - # Converts hash 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_event_threat_detection_custom_modules.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::SecurityCenterManagement::V1::VERSION, - transports_version_send: [:rest] - - call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - options.apply_defaults timeout: @config.rpcs.list_event_threat_detection_custom_modules.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.list_event_threat_detection_custom_modules.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @security_center_management_stub.list_event_threat_detection_custom_modules request, options do |result, operation| - result = ::Gapic::Rest::PagedEnumerable.new @security_center_management_stub, :list_event_threat_detection_custom_modules, "event_threat_detection_custom_modules", 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 - - ## - # Lists all resident Event Threat Detection custom modules for the given - # organization, folder, or project and its descendants. - # - # @overload list_descendant_event_threat_detection_custom_modules(request, options = nil) - # Pass arguments to `list_descendant_event_threat_detection_custom_modules` via a request object, either of type - # {::Google::Cloud::SecurityCenterManagement::V1::ListDescendantEventThreatDetectionCustomModulesRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::SecurityCenterManagement::V1::ListDescendantEventThreatDetectionCustomModulesRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_descendant_event_threat_detection_custom_modules(parent: nil, page_size: nil, page_token: nil) - # Pass arguments to `list_descendant_event_threat_detection_custom_modules` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param parent [::String] - # Required. Name of parent to list custom modules, in one of the following - # formats: - # - # * `organizations/{organization}/locations/{location}` - # * `folders/{folder}/locations/{location}` - # * `projects/{project}/locations/{location}` - # @param page_size [::Integer] - # Optional. The maximum number of modules to return. The service may return - # fewer than this value. If unspecified, at most 10 configs will be returned. - # The maximum value is 1000; values above 1000 will be coerced to 1000. - # @param page_token [::String] - # Optional. A pagination token returned from a previous request. Provide this - # token to retrieve the next page of results. - # - # When paginating, the rest of the request must match the request that - # generated the page token. - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Gapic::Rest::PagedEnumerable<::Google::Cloud::SecurityCenterManagement::V1::EventThreatDetectionCustomModule>] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Gapic::Rest::PagedEnumerable<::Google::Cloud::SecurityCenterManagement::V1::EventThreatDetectionCustomModule>] - # - # @raise [::Google::Cloud::Error] if the REST call is aborted. - # - # @example Basic example - # require "google/cloud/security_center_management/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::SecurityCenterManagement::V1::SecurityCenterManagement::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::SecurityCenterManagement::V1::ListDescendantEventThreatDetectionCustomModulesRequest.new - # - # # Call the list_descendant_event_threat_detection_custom_modules method. - # result = client.list_descendant_event_threat_detection_custom_modules request - # - # # The returned object is of type Gapic::PagedEnumerable. You can iterate - # # over elements, and API calls will be issued to fetch pages as needed. - # result.each do |item| - # # Each element is of type ::Google::Cloud::SecurityCenterManagement::V1::EventThreatDetectionCustomModule. - # p item - # end - # - def list_descendant_event_threat_detection_custom_modules request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::SecurityCenterManagement::V1::ListDescendantEventThreatDetectionCustomModulesRequest - - # Converts hash 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_descendant_event_threat_detection_custom_modules.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::SecurityCenterManagement::V1::VERSION, - transports_version_send: [:rest] - - call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - options.apply_defaults timeout: @config.rpcs.list_descendant_event_threat_detection_custom_modules.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.list_descendant_event_threat_detection_custom_modules.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @security_center_management_stub.list_descendant_event_threat_detection_custom_modules request, options do |result, operation| - result = ::Gapic::Rest::PagedEnumerable.new @security_center_management_stub, :list_descendant_event_threat_detection_custom_modules, "event_threat_detection_custom_modules", 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 an Event Threat Detection custom module. - # - # @overload get_event_threat_detection_custom_module(request, options = nil) - # Pass arguments to `get_event_threat_detection_custom_module` via a request object, either of type - # {::Google::Cloud::SecurityCenterManagement::V1::GetEventThreatDetectionCustomModuleRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::SecurityCenterManagement::V1::GetEventThreatDetectionCustomModuleRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_event_threat_detection_custom_module(name: nil) - # Pass arguments to `get_event_threat_detection_custom_module` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param name [::String] - # Required. The resource name of the Event Threat Detection custom module, in - # one of the following formats: - # - # * `organizations/{organization}/locations/{location}/eventThreatDetectionCustomModules/{custom_module}` - # * `folders/{folder}/locations/{location}/eventThreatDetectionCustomModules/{custom_module}` - # * `projects/{project}/locations/{location}/eventThreatDetectionCustomModules/{custom_module}` - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Cloud::SecurityCenterManagement::V1::EventThreatDetectionCustomModule] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::SecurityCenterManagement::V1::EventThreatDetectionCustomModule] - # - # @raise [::Google::Cloud::Error] if the REST call is aborted. - # - # @example Basic example - # require "google/cloud/security_center_management/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::SecurityCenterManagement::V1::SecurityCenterManagement::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::SecurityCenterManagement::V1::GetEventThreatDetectionCustomModuleRequest.new - # - # # Call the get_event_threat_detection_custom_module method. - # result = client.get_event_threat_detection_custom_module request - # - # # The returned object is of type Google::Cloud::SecurityCenterManagement::V1::EventThreatDetectionCustomModule. - # p result - # - def get_event_threat_detection_custom_module request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::SecurityCenterManagement::V1::GetEventThreatDetectionCustomModuleRequest - - # Converts hash 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_event_threat_detection_custom_module.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::SecurityCenterManagement::V1::VERSION, - transports_version_send: [:rest] - - call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - options.apply_defaults timeout: @config.rpcs.get_event_threat_detection_custom_module.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.get_event_threat_detection_custom_module.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @security_center_management_stub.get_event_threat_detection_custom_module request, options do |result, operation| - yield result, operation if block_given? - end - rescue ::Gapic::Rest::Error => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Creates a resident Event Threat Detection custom module at the scope of the - # given organization, folder, or project, and creates inherited custom - # modules for all descendants of the given parent. These modules are enabled - # by default. - # - # @overload create_event_threat_detection_custom_module(request, options = nil) - # Pass arguments to `create_event_threat_detection_custom_module` via a request object, either of type - # {::Google::Cloud::SecurityCenterManagement::V1::CreateEventThreatDetectionCustomModuleRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::SecurityCenterManagement::V1::CreateEventThreatDetectionCustomModuleRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_event_threat_detection_custom_module(parent: nil, event_threat_detection_custom_module: nil, validate_only: nil) - # Pass arguments to `create_event_threat_detection_custom_module` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param parent [::String] - # Required. Name of parent for the module, in one of the following formats: - # - # * `organizations/{organization}/locations/{location}` - # * `folders/{folder}/locations/{location}` - # * `projects/{project}/locations/{location}` - # @param event_threat_detection_custom_module [::Google::Cloud::SecurityCenterManagement::V1::EventThreatDetectionCustomModule, ::Hash] - # Required. The module to create. The - # {::Google::Cloud::SecurityCenterManagement::V1::EventThreatDetectionCustomModule#name EventThreatDetectionCustomModule.name} - # field is ignored; Security Command Center generates the name. - # @param validate_only [::Boolean] - # Optional. When set to `true`, the request will be validated (including IAM - # checks), but no module will be created. An `OK` response indicates that the - # request is valid, while an error response indicates that the request is - # invalid. - # - # If the request is valid, a subsequent request to create the module could - # still fail for one of the following reasons: - # - # * The state of your cloud resources changed; for example, you lost a - # required IAM permission - # * An error occurred during creation of the module - # - # Defaults to `false`. - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Cloud::SecurityCenterManagement::V1::EventThreatDetectionCustomModule] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::SecurityCenterManagement::V1::EventThreatDetectionCustomModule] - # - # @raise [::Google::Cloud::Error] if the REST call is aborted. - # - # @example Basic example - # require "google/cloud/security_center_management/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::SecurityCenterManagement::V1::SecurityCenterManagement::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::SecurityCenterManagement::V1::CreateEventThreatDetectionCustomModuleRequest.new - # - # # Call the create_event_threat_detection_custom_module method. - # result = client.create_event_threat_detection_custom_module request - # - # # The returned object is of type Google::Cloud::SecurityCenterManagement::V1::EventThreatDetectionCustomModule. - # p result - # - def create_event_threat_detection_custom_module request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::SecurityCenterManagement::V1::CreateEventThreatDetectionCustomModuleRequest - - # Converts hash 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_event_threat_detection_custom_module.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::SecurityCenterManagement::V1::VERSION, - transports_version_send: [:rest] - - call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - options.apply_defaults timeout: @config.rpcs.create_event_threat_detection_custom_module.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.create_event_threat_detection_custom_module.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @security_center_management_stub.create_event_threat_detection_custom_module request, options do |result, operation| - yield result, operation if block_given? - end - rescue ::Gapic::Rest::Error => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Updates the Event Threat Detection custom module with the given name based - # on the given update mask. Updating the enablement state is supported for - # both resident and inherited modules (though resident modules cannot have an - # enablement state of "inherited"). Updating the display name or - # configuration of a module is supported for resident modules only. The type - # of a module cannot be changed. - # - # @overload update_event_threat_detection_custom_module(request, options = nil) - # Pass arguments to `update_event_threat_detection_custom_module` via a request object, either of type - # {::Google::Cloud::SecurityCenterManagement::V1::UpdateEventThreatDetectionCustomModuleRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::SecurityCenterManagement::V1::UpdateEventThreatDetectionCustomModuleRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_event_threat_detection_custom_module(update_mask: nil, event_threat_detection_custom_module: nil, validate_only: nil) - # Pass arguments to `update_event_threat_detection_custom_module` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param update_mask [::Google::Protobuf::FieldMask, ::Hash] - # Required. The fields to update. If omitted, then all fields are updated. - # @param event_threat_detection_custom_module [::Google::Cloud::SecurityCenterManagement::V1::EventThreatDetectionCustomModule, ::Hash] - # Required. The module being updated. - # @param validate_only [::Boolean] - # Optional. When set to `true`, the request will be validated (including IAM - # checks), but no module will be updated. An `OK` response indicates that the - # request is valid, while an error response indicates that the request is - # invalid. - # - # If the request is valid, a subsequent request to update the module could - # still fail for one of the following reasons: - # - # * The state of your cloud resources changed; for example, you lost a - # required IAM permission - # * An error occurred during creation of the module - # - # Defaults to `false`. - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Cloud::SecurityCenterManagement::V1::EventThreatDetectionCustomModule] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::SecurityCenterManagement::V1::EventThreatDetectionCustomModule] - # - # @raise [::Google::Cloud::Error] if the REST call is aborted. - # - # @example Basic example - # require "google/cloud/security_center_management/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::SecurityCenterManagement::V1::SecurityCenterManagement::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::SecurityCenterManagement::V1::UpdateEventThreatDetectionCustomModuleRequest.new - # - # # Call the update_event_threat_detection_custom_module method. - # result = client.update_event_threat_detection_custom_module request - # - # # The returned object is of type Google::Cloud::SecurityCenterManagement::V1::EventThreatDetectionCustomModule. - # p result - # - def update_event_threat_detection_custom_module request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::SecurityCenterManagement::V1::UpdateEventThreatDetectionCustomModuleRequest - - # Converts hash 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_event_threat_detection_custom_module.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::SecurityCenterManagement::V1::VERSION, - transports_version_send: [:rest] - - call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - options.apply_defaults timeout: @config.rpcs.update_event_threat_detection_custom_module.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.update_event_threat_detection_custom_module.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @security_center_management_stub.update_event_threat_detection_custom_module request, options do |result, operation| - yield result, operation if block_given? - end - rescue ::Gapic::Rest::Error => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Deletes the specified Event Threat Detection custom module and all of its - # descendants in the resource hierarchy. This method is only supported for - # resident custom modules. - # - # @overload delete_event_threat_detection_custom_module(request, options = nil) - # Pass arguments to `delete_event_threat_detection_custom_module` via a request object, either of type - # {::Google::Cloud::SecurityCenterManagement::V1::DeleteEventThreatDetectionCustomModuleRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::SecurityCenterManagement::V1::DeleteEventThreatDetectionCustomModuleRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_event_threat_detection_custom_module(name: nil, validate_only: nil) - # Pass arguments to `delete_event_threat_detection_custom_module` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param name [::String] - # Required. The resource name of the Event Threat Detection custom module, in - # one of the following formats: - # - # * `organizations/{organization}/locations/{location}/eventThreatDetectionCustomModules/{custom_module}` - # * `folders/{folder}/locations/{location}/eventThreatDetectionCustomModules/{custom_module}` - # * `projects/{project}/locations/{location}/eventThreatDetectionCustomModules/{custom_module}` - # @param validate_only [::Boolean] - # Optional. When set to `true`, the request will be validated (including IAM - # checks), but no module will be deleted. An `OK` response indicates that the - # request is valid, while an error response indicates that the request is - # invalid. - # - # If the request is valid, a subsequent request to delete the module could - # still fail for one of the following reasons: - # - # * The state of your cloud resources changed; for example, you lost a - # required IAM permission - # * An error occurred during creation of the module - # - # Defaults to `false`. - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Protobuf::Empty] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Protobuf::Empty] - # - # @raise [::Google::Cloud::Error] if the REST call is aborted. - # - # @example Basic example - # require "google/cloud/security_center_management/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::SecurityCenterManagement::V1::SecurityCenterManagement::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::SecurityCenterManagement::V1::DeleteEventThreatDetectionCustomModuleRequest.new - # - # # Call the delete_event_threat_detection_custom_module method. - # result = client.delete_event_threat_detection_custom_module request - # - # # The returned object is of type Google::Protobuf::Empty. - # p result - # - def delete_event_threat_detection_custom_module request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::SecurityCenterManagement::V1::DeleteEventThreatDetectionCustomModuleRequest - - # Converts hash 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_event_threat_detection_custom_module.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::SecurityCenterManagement::V1::VERSION, - transports_version_send: [:rest] - - call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - options.apply_defaults timeout: @config.rpcs.delete_event_threat_detection_custom_module.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.delete_event_threat_detection_custom_module.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @security_center_management_stub.delete_event_threat_detection_custom_module 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 - - ## - # Validates the given Event Threat Detection custom module. - # - # @overload validate_event_threat_detection_custom_module(request, options = nil) - # Pass arguments to `validate_event_threat_detection_custom_module` via a request object, either of type - # {::Google::Cloud::SecurityCenterManagement::V1::ValidateEventThreatDetectionCustomModuleRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::SecurityCenterManagement::V1::ValidateEventThreatDetectionCustomModuleRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @overload validate_event_threat_detection_custom_module(parent: nil, raw_text: nil, type: nil) - # Pass arguments to `validate_event_threat_detection_custom_module` via keyword arguments. Note that at - # least one keyword argument is 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. Resource name of the parent to validate the custom modules under, - # in one of the following formats: - # - # * `organizations/{organization}/locations/{location}` - # @param raw_text [::String] - # Required. The raw text of the module's contents. Used to generate error - # messages. - # @param type [::String] - # Required. The type of the module. For example, `CONFIGURABLE_BAD_IP`. - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Cloud::SecurityCenterManagement::V1::ValidateEventThreatDetectionCustomModuleResponse] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::SecurityCenterManagement::V1::ValidateEventThreatDetectionCustomModuleResponse] - # - # @raise [::Google::Cloud::Error] if the REST call is aborted. - # - # @example Basic example - # require "google/cloud/security_center_management/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::SecurityCenterManagement::V1::SecurityCenterManagement::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::SecurityCenterManagement::V1::ValidateEventThreatDetectionCustomModuleRequest.new - # - # # Call the validate_event_threat_detection_custom_module method. - # result = client.validate_event_threat_detection_custom_module request - # - # # The returned object is of type Google::Cloud::SecurityCenterManagement::V1::ValidateEventThreatDetectionCustomModuleResponse. - # p result - # - def validate_event_threat_detection_custom_module request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::SecurityCenterManagement::V1::ValidateEventThreatDetectionCustomModuleRequest - - # Converts hash 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.validate_event_threat_detection_custom_module.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::SecurityCenterManagement::V1::VERSION, - transports_version_send: [:rest] - - call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - options.apply_defaults timeout: @config.rpcs.validate_event_threat_detection_custom_module.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.validate_event_threat_detection_custom_module.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @security_center_management_stub.validate_event_threat_detection_custom_module request, options do |result, operation| - yield result, operation if block_given? - end - rescue ::Gapic::Rest::Error => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Gets service settings for the specified Security Command Center service. - # - # @overload get_security_center_service(request, options = nil) - # Pass arguments to `get_security_center_service` via a request object, either of type - # {::Google::Cloud::SecurityCenterManagement::V1::GetSecurityCenterServiceRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::SecurityCenterManagement::V1::GetSecurityCenterServiceRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_security_center_service(name: nil, show_eligible_modules_only: nil) - # Pass arguments to `get_security_center_service` via keyword arguments. Note that at - # least one keyword argument is 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 Security Command Center service to retrieve, in one of the - # following formats: - # - # * organizations/\\{organization}/locations/\\{location}/securityCenterServices/\\{service} - # * folders/\\{folder}/locations/\\{location}/securityCenterServices/\\{service} - # * projects/\\{project}/locations/\\{location}/securityCenterServices/\\{service} - # - # The following values are valid for `{service}`: - # - # * `container-threat-detection` - # * `event-threat-detection` - # * `security-health-analytics` - # * `vm-threat-detection` - # * `web-security-scanner` - # @param show_eligible_modules_only [::Boolean] - # Set to `true` to show only modules that are in scope. By default, all - # modules are shown. - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Cloud::SecurityCenterManagement::V1::SecurityCenterService] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::SecurityCenterManagement::V1::SecurityCenterService] - # - # @raise [::Google::Cloud::Error] if the REST call is aborted. - # - # @example Basic example - # require "google/cloud/security_center_management/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::SecurityCenterManagement::V1::SecurityCenterManagement::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::SecurityCenterManagement::V1::GetSecurityCenterServiceRequest.new - # - # # Call the get_security_center_service method. - # result = client.get_security_center_service request - # - # # The returned object is of type Google::Cloud::SecurityCenterManagement::V1::SecurityCenterService. - # p result - # - def get_security_center_service request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::SecurityCenterManagement::V1::GetSecurityCenterServiceRequest - - # Converts hash 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_security_center_service.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::SecurityCenterManagement::V1::VERSION, - transports_version_send: [:rest] - - call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - options.apply_defaults timeout: @config.rpcs.get_security_center_service.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.get_security_center_service.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @security_center_management_stub.get_security_center_service request, options do |result, operation| - yield result, operation if block_given? - end - rescue ::Gapic::Rest::Error => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Returns a list of all Security Command Center services for the given - # parent. - # - # @overload list_security_center_services(request, options = nil) - # Pass arguments to `list_security_center_services` via a request object, either of type - # {::Google::Cloud::SecurityCenterManagement::V1::ListSecurityCenterServicesRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::SecurityCenterManagement::V1::ListSecurityCenterServicesRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_security_center_services(parent: nil, page_size: nil, page_token: nil, show_eligible_modules_only: nil) - # Pass arguments to `list_security_center_services` via keyword arguments. Note that at - # least one keyword argument is 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 name of the parent to list Security Command Center services, - # in one of the following formats: - # - # * `organizations/{organization}/locations/{location}` - # * `folders/{folder}/locations/{location}` - # * `projects/{project}/locations/{location}` - # @param page_size [::Integer] - # Optional. The maximum number of results to return in a single response. - # Default is 10, minimum is 1, maximum is 1000. - # @param page_token [::String] - # Optional. A pagination token returned from a previous request. Provide this - # token to retrieve the next page of results. - # - # When paginating, the rest of the request must match the request that - # generated the page token. - # @param show_eligible_modules_only [::Boolean] - # Flag that, when set, is used to filter the module settings that are shown. - # The default setting is that all modules are shown. - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Gapic::Rest::PagedEnumerable<::Google::Cloud::SecurityCenterManagement::V1::SecurityCenterService>] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Gapic::Rest::PagedEnumerable<::Google::Cloud::SecurityCenterManagement::V1::SecurityCenterService>] - # - # @raise [::Google::Cloud::Error] if the REST call is aborted. - # - # @example Basic example - # require "google/cloud/security_center_management/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::SecurityCenterManagement::V1::SecurityCenterManagement::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::SecurityCenterManagement::V1::ListSecurityCenterServicesRequest.new - # - # # Call the list_security_center_services method. - # result = client.list_security_center_services request - # - # # The returned object is of type Gapic::PagedEnumerable. You can iterate - # # over elements, and API calls will be issued to fetch pages as needed. - # result.each do |item| - # # Each element is of type ::Google::Cloud::SecurityCenterManagement::V1::SecurityCenterService. - # p item - # end - # - def list_security_center_services request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::SecurityCenterManagement::V1::ListSecurityCenterServicesRequest - - # Converts hash 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_security_center_services.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::SecurityCenterManagement::V1::VERSION, - transports_version_send: [:rest] - - call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - options.apply_defaults timeout: @config.rpcs.list_security_center_services.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.list_security_center_services.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @security_center_management_stub.list_security_center_services request, options do |result, operation| - result = ::Gapic::Rest::PagedEnumerable.new @security_center_management_stub, :list_security_center_services, "security_center_services", 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 - - ## - # Updates a Security Command Center service using the given update mask. - # - # @overload update_security_center_service(request, options = nil) - # Pass arguments to `update_security_center_service` via a request object, either of type - # {::Google::Cloud::SecurityCenterManagement::V1::UpdateSecurityCenterServiceRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::SecurityCenterManagement::V1::UpdateSecurityCenterServiceRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_security_center_service(security_center_service: nil, update_mask: nil, validate_only: nil) - # Pass arguments to `update_security_center_service` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param security_center_service [::Google::Cloud::SecurityCenterManagement::V1::SecurityCenterService, ::Hash] - # Required. The updated service. - # @param update_mask [::Google::Protobuf::FieldMask, ::Hash] - # Required. The fields to update. Accepts the following values: - # - # * `intended_enablement_state` - # * `modules` - # - # If omitted, then all eligible fields are updated. - # @param validate_only [::Boolean] - # Optional. When set to `true`, the request will be validated (including IAM - # checks), but no service will be updated. An `OK` response indicates that - # the request is valid, while an error response indicates that the request is - # invalid. - # - # If the request is valid, a subsequent request to update the service could - # still fail for one of the following reasons: - # - # * The state of your cloud resources changed; for example, you lost a - # required IAM permission - # * An error occurred during update of the service - # - # Defaults to `false`. - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Cloud::SecurityCenterManagement::V1::SecurityCenterService] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::SecurityCenterManagement::V1::SecurityCenterService] - # - # @raise [::Google::Cloud::Error] if the REST call is aborted. - # - # @example Basic example - # require "google/cloud/security_center_management/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::SecurityCenterManagement::V1::SecurityCenterManagement::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::SecurityCenterManagement::V1::UpdateSecurityCenterServiceRequest.new - # - # # Call the update_security_center_service method. - # result = client.update_security_center_service request - # - # # The returned object is of type Google::Cloud::SecurityCenterManagement::V1::SecurityCenterService. - # p result - # - def update_security_center_service request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::SecurityCenterManagement::V1::UpdateSecurityCenterServiceRequest - - # Converts hash 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_security_center_service.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::SecurityCenterManagement::V1::VERSION, - transports_version_send: [:rest] - - call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - options.apply_defaults timeout: @config.rpcs.update_security_center_service.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.update_security_center_service.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @security_center_management_stub.update_security_center_service 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 SecurityCenterManagement REST API. - # - # This class represents the configuration for SecurityCenterManagement REST, - # providing control over timeouts, retry behavior, logging, transport - # parameters, and other low-level controls. Certain parameters can also be - # applied individually to specific RPCs. See - # {::Google::Cloud::SecurityCenterManagement::V1::SecurityCenterManagement::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_effective_security_health_analytics_custom_modules to 20 seconds, - # # and all remaining timeouts to 10 seconds. - # ::Google::Cloud::SecurityCenterManagement::V1::SecurityCenterManagement::Rest::Client.configure do |config| - # config.timeout = 10.0 - # config.rpcs.list_effective_security_health_analytics_custom_modules.timeout = 20.0 - # end - # - # # Apply the above configuration only to a new client. - # client = ::Google::Cloud::SecurityCenterManagement::V1::SecurityCenterManagement::Rest::Client.new do |config| - # config.timeout = 10.0 - # config.rpcs.list_effective_security_health_analytics_custom_modules.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 = "securitycentermanagement.googleapis.com" - - config_attr :endpoint, nil, ::String, nil - config_attr :credentials, nil do |value| - allowed = [::String, ::Hash, ::Proc, ::Symbol, ::Google::Auth::Credentials, ::Google::Auth::BaseClient, ::Signet::OAuth2::Client, nil] - allowed.any? { |klass| klass === value } - end - config_attr :scope, nil, ::String, ::Array, nil - config_attr :lib_name, nil, ::String, nil - config_attr :lib_version, nil, ::String, nil - config_attr :timeout, nil, ::Numeric, nil - config_attr :metadata, nil, ::Hash, nil - config_attr :retry_policy, nil, ::Hash, ::Proc, nil - config_attr :quota_project, nil, ::String, nil - config_attr :universe_domain, nil, ::String, nil - - # @private - # Overrides for http bindings for the RPCs of this service - # are only used when this service is used as mixin, and only - # by the host service. - # @return [::Hash{::Symbol=>::Array<::Gapic::Rest::GrpcTranscoder::HttpBinding>}] - config_attr :bindings_override, {}, ::Hash, nil - config_attr :logger, :default, ::Logger, nil, :default - - # @private - def initialize parent_config = nil - @parent_config = parent_config unless parent_config.nil? - - yield self if block_given? - end - - ## - # Configurations for individual RPCs - # @return [Rpcs] - # - def rpcs - @rpcs ||= begin - parent_rpcs = nil - parent_rpcs = @parent_config.rpcs if defined?(@parent_config) && @parent_config.respond_to?(:rpcs) - Rpcs.new parent_rpcs - end - end - - ## - # Configuration RPC class for the SecurityCenterManagement 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_effective_security_health_analytics_custom_modules` - # @return [::Gapic::Config::Method] - # - attr_reader :list_effective_security_health_analytics_custom_modules - ## - # RPC-specific configuration for `get_effective_security_health_analytics_custom_module` - # @return [::Gapic::Config::Method] - # - attr_reader :get_effective_security_health_analytics_custom_module - ## - # RPC-specific configuration for `list_security_health_analytics_custom_modules` - # @return [::Gapic::Config::Method] - # - attr_reader :list_security_health_analytics_custom_modules - ## - # RPC-specific configuration for `list_descendant_security_health_analytics_custom_modules` - # @return [::Gapic::Config::Method] - # - attr_reader :list_descendant_security_health_analytics_custom_modules - ## - # RPC-specific configuration for `get_security_health_analytics_custom_module` - # @return [::Gapic::Config::Method] - # - attr_reader :get_security_health_analytics_custom_module - ## - # RPC-specific configuration for `create_security_health_analytics_custom_module` - # @return [::Gapic::Config::Method] - # - attr_reader :create_security_health_analytics_custom_module - ## - # RPC-specific configuration for `update_security_health_analytics_custom_module` - # @return [::Gapic::Config::Method] - # - attr_reader :update_security_health_analytics_custom_module - ## - # RPC-specific configuration for `delete_security_health_analytics_custom_module` - # @return [::Gapic::Config::Method] - # - attr_reader :delete_security_health_analytics_custom_module - ## - # RPC-specific configuration for `simulate_security_health_analytics_custom_module` - # @return [::Gapic::Config::Method] - # - attr_reader :simulate_security_health_analytics_custom_module - ## - # RPC-specific configuration for `list_effective_event_threat_detection_custom_modules` - # @return [::Gapic::Config::Method] - # - attr_reader :list_effective_event_threat_detection_custom_modules - ## - # RPC-specific configuration for `get_effective_event_threat_detection_custom_module` - # @return [::Gapic::Config::Method] - # - attr_reader :get_effective_event_threat_detection_custom_module - ## - # RPC-specific configuration for `list_event_threat_detection_custom_modules` - # @return [::Gapic::Config::Method] - # - attr_reader :list_event_threat_detection_custom_modules - ## - # RPC-specific configuration for `list_descendant_event_threat_detection_custom_modules` - # @return [::Gapic::Config::Method] - # - attr_reader :list_descendant_event_threat_detection_custom_modules - ## - # RPC-specific configuration for `get_event_threat_detection_custom_module` - # @return [::Gapic::Config::Method] - # - attr_reader :get_event_threat_detection_custom_module - ## - # RPC-specific configuration for `create_event_threat_detection_custom_module` - # @return [::Gapic::Config::Method] - # - attr_reader :create_event_threat_detection_custom_module - ## - # RPC-specific configuration for `update_event_threat_detection_custom_module` - # @return [::Gapic::Config::Method] - # - attr_reader :update_event_threat_detection_custom_module - ## - # RPC-specific configuration for `delete_event_threat_detection_custom_module` - # @return [::Gapic::Config::Method] - # - attr_reader :delete_event_threat_detection_custom_module - ## - # RPC-specific configuration for `validate_event_threat_detection_custom_module` - # @return [::Gapic::Config::Method] - # - attr_reader :validate_event_threat_detection_custom_module - ## - # RPC-specific configuration for `get_security_center_service` - # @return [::Gapic::Config::Method] - # - attr_reader :get_security_center_service - ## - # RPC-specific configuration for `list_security_center_services` - # @return [::Gapic::Config::Method] - # - attr_reader :list_security_center_services - ## - # RPC-specific configuration for `update_security_center_service` - # @return [::Gapic::Config::Method] - # - attr_reader :update_security_center_service - - # @private - def initialize parent_rpcs = nil - list_effective_security_health_analytics_custom_modules_config = parent_rpcs.list_effective_security_health_analytics_custom_modules if parent_rpcs.respond_to? :list_effective_security_health_analytics_custom_modules - @list_effective_security_health_analytics_custom_modules = ::Gapic::Config::Method.new list_effective_security_health_analytics_custom_modules_config - get_effective_security_health_analytics_custom_module_config = parent_rpcs.get_effective_security_health_analytics_custom_module if parent_rpcs.respond_to? :get_effective_security_health_analytics_custom_module - @get_effective_security_health_analytics_custom_module = ::Gapic::Config::Method.new get_effective_security_health_analytics_custom_module_config - list_security_health_analytics_custom_modules_config = parent_rpcs.list_security_health_analytics_custom_modules if parent_rpcs.respond_to? :list_security_health_analytics_custom_modules - @list_security_health_analytics_custom_modules = ::Gapic::Config::Method.new list_security_health_analytics_custom_modules_config - list_descendant_security_health_analytics_custom_modules_config = parent_rpcs.list_descendant_security_health_analytics_custom_modules if parent_rpcs.respond_to? :list_descendant_security_health_analytics_custom_modules - @list_descendant_security_health_analytics_custom_modules = ::Gapic::Config::Method.new list_descendant_security_health_analytics_custom_modules_config - get_security_health_analytics_custom_module_config = parent_rpcs.get_security_health_analytics_custom_module if parent_rpcs.respond_to? :get_security_health_analytics_custom_module - @get_security_health_analytics_custom_module = ::Gapic::Config::Method.new get_security_health_analytics_custom_module_config - create_security_health_analytics_custom_module_config = parent_rpcs.create_security_health_analytics_custom_module if parent_rpcs.respond_to? :create_security_health_analytics_custom_module - @create_security_health_analytics_custom_module = ::Gapic::Config::Method.new create_security_health_analytics_custom_module_config - update_security_health_analytics_custom_module_config = parent_rpcs.update_security_health_analytics_custom_module if parent_rpcs.respond_to? :update_security_health_analytics_custom_module - @update_security_health_analytics_custom_module = ::Gapic::Config::Method.new update_security_health_analytics_custom_module_config - delete_security_health_analytics_custom_module_config = parent_rpcs.delete_security_health_analytics_custom_module if parent_rpcs.respond_to? :delete_security_health_analytics_custom_module - @delete_security_health_analytics_custom_module = ::Gapic::Config::Method.new delete_security_health_analytics_custom_module_config - simulate_security_health_analytics_custom_module_config = parent_rpcs.simulate_security_health_analytics_custom_module if parent_rpcs.respond_to? :simulate_security_health_analytics_custom_module - @simulate_security_health_analytics_custom_module = ::Gapic::Config::Method.new simulate_security_health_analytics_custom_module_config - list_effective_event_threat_detection_custom_modules_config = parent_rpcs.list_effective_event_threat_detection_custom_modules if parent_rpcs.respond_to? :list_effective_event_threat_detection_custom_modules - @list_effective_event_threat_detection_custom_modules = ::Gapic::Config::Method.new list_effective_event_threat_detection_custom_modules_config - get_effective_event_threat_detection_custom_module_config = parent_rpcs.get_effective_event_threat_detection_custom_module if parent_rpcs.respond_to? :get_effective_event_threat_detection_custom_module - @get_effective_event_threat_detection_custom_module = ::Gapic::Config::Method.new get_effective_event_threat_detection_custom_module_config - list_event_threat_detection_custom_modules_config = parent_rpcs.list_event_threat_detection_custom_modules if parent_rpcs.respond_to? :list_event_threat_detection_custom_modules - @list_event_threat_detection_custom_modules = ::Gapic::Config::Method.new list_event_threat_detection_custom_modules_config - list_descendant_event_threat_detection_custom_modules_config = parent_rpcs.list_descendant_event_threat_detection_custom_modules if parent_rpcs.respond_to? :list_descendant_event_threat_detection_custom_modules - @list_descendant_event_threat_detection_custom_modules = ::Gapic::Config::Method.new list_descendant_event_threat_detection_custom_modules_config - get_event_threat_detection_custom_module_config = parent_rpcs.get_event_threat_detection_custom_module if parent_rpcs.respond_to? :get_event_threat_detection_custom_module - @get_event_threat_detection_custom_module = ::Gapic::Config::Method.new get_event_threat_detection_custom_module_config - create_event_threat_detection_custom_module_config = parent_rpcs.create_event_threat_detection_custom_module if parent_rpcs.respond_to? :create_event_threat_detection_custom_module - @create_event_threat_detection_custom_module = ::Gapic::Config::Method.new create_event_threat_detection_custom_module_config - update_event_threat_detection_custom_module_config = parent_rpcs.update_event_threat_detection_custom_module if parent_rpcs.respond_to? :update_event_threat_detection_custom_module - @update_event_threat_detection_custom_module = ::Gapic::Config::Method.new update_event_threat_detection_custom_module_config - delete_event_threat_detection_custom_module_config = parent_rpcs.delete_event_threat_detection_custom_module if parent_rpcs.respond_to? :delete_event_threat_detection_custom_module - @delete_event_threat_detection_custom_module = ::Gapic::Config::Method.new delete_event_threat_detection_custom_module_config - validate_event_threat_detection_custom_module_config = parent_rpcs.validate_event_threat_detection_custom_module if parent_rpcs.respond_to? :validate_event_threat_detection_custom_module - @validate_event_threat_detection_custom_module = ::Gapic::Config::Method.new validate_event_threat_detection_custom_module_config - get_security_center_service_config = parent_rpcs.get_security_center_service if parent_rpcs.respond_to? :get_security_center_service - @get_security_center_service = ::Gapic::Config::Method.new get_security_center_service_config - list_security_center_services_config = parent_rpcs.list_security_center_services if parent_rpcs.respond_to? :list_security_center_services - @list_security_center_services = ::Gapic::Config::Method.new list_security_center_services_config - update_security_center_service_config = parent_rpcs.update_security_center_service if parent_rpcs.respond_to? :update_security_center_service - @update_security_center_service = ::Gapic::Config::Method.new update_security_center_service_config - - yield self if block_given? - end - end - end - end - end - end - end - end - end -end diff --git a/owl-bot-staging/google-cloud-security_center_management-v1/lib/google/cloud/security_center_management/v1/security_center_management/rest/service_stub.rb b/owl-bot-staging/google-cloud-security_center_management-v1/lib/google/cloud/security_center_management/v1/security_center_management/rest/service_stub.rb deleted file mode 100644 index 4bd0edd3626c..000000000000 --- a/owl-bot-staging/google-cloud-security_center_management-v1/lib/google/cloud/security_center_management/v1/security_center_management/rest/service_stub.rb +++ /dev/null @@ -1,1677 +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/securitycentermanagement/v1/security_center_management_pb" - -module Google - module Cloud - module SecurityCenterManagement - module V1 - module SecurityCenterManagement - module Rest - ## - # REST service stub for the SecurityCenterManagement service. - # Service stub contains baseline method implementations - # including transcoding, making the REST call, and deserialing the response. - # - class ServiceStub - # @private - def initialize endpoint:, endpoint_template:, universe_domain:, credentials:, logger: - # These require statements are intentionally placed here to initialize - # the REST modules only when it's required. - require "gapic/rest" - - @client_stub = ::Gapic::Rest::ClientStub.new endpoint: endpoint, - endpoint_template: endpoint_template, - universe_domain: universe_domain, - credentials: credentials, - numeric_enums: true, - service_name: self.class, - raise_faraday_errors: false, - logger: logger - end - - ## - # The effective universe domain - # - # @return [String] - # - def universe_domain - @client_stub.universe_domain - end - - ## - # The effective endpoint - # - # @return [String] - # - def endpoint - @client_stub.endpoint - end - - ## - # The logger used for request/response debug logging. - # - # @return [Logger] - # - def logger stub: false - stub ? @client_stub.stub_logger : @client_stub.logger - end - - ## - # Baseline implementation for the list_effective_security_health_analytics_custom_modules REST call - # - # @param request_pb [::Google::Cloud::SecurityCenterManagement::V1::ListEffectiveSecurityHealthAnalyticsCustomModulesRequest] - # A request object representing the call parameters. Required. - # @param options [::Gapic::CallOptions] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Cloud::SecurityCenterManagement::V1::ListEffectiveSecurityHealthAnalyticsCustomModulesResponse] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::SecurityCenterManagement::V1::ListEffectiveSecurityHealthAnalyticsCustomModulesResponse] - # A result object deserialized from the server's reply - def list_effective_security_health_analytics_custom_modules request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_list_effective_security_health_analytics_custom_modules_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_effective_security_health_analytics_custom_modules", - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Cloud::SecurityCenterManagement::V1::ListEffectiveSecurityHealthAnalyticsCustomModulesResponse.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_effective_security_health_analytics_custom_module REST call - # - # @param request_pb [::Google::Cloud::SecurityCenterManagement::V1::GetEffectiveSecurityHealthAnalyticsCustomModuleRequest] - # A request object representing the call parameters. Required. - # @param options [::Gapic::CallOptions] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Cloud::SecurityCenterManagement::V1::EffectiveSecurityHealthAnalyticsCustomModule] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::SecurityCenterManagement::V1::EffectiveSecurityHealthAnalyticsCustomModule] - # A result object deserialized from the server's reply - def get_effective_security_health_analytics_custom_module request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_get_effective_security_health_analytics_custom_module_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_effective_security_health_analytics_custom_module", - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Cloud::SecurityCenterManagement::V1::EffectiveSecurityHealthAnalyticsCustomModule.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_security_health_analytics_custom_modules REST call - # - # @param request_pb [::Google::Cloud::SecurityCenterManagement::V1::ListSecurityHealthAnalyticsCustomModulesRequest] - # A request object representing the call parameters. Required. - # @param options [::Gapic::CallOptions] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Cloud::SecurityCenterManagement::V1::ListSecurityHealthAnalyticsCustomModulesResponse] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::SecurityCenterManagement::V1::ListSecurityHealthAnalyticsCustomModulesResponse] - # A result object deserialized from the server's reply - def list_security_health_analytics_custom_modules request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_list_security_health_analytics_custom_modules_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_security_health_analytics_custom_modules", - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Cloud::SecurityCenterManagement::V1::ListSecurityHealthAnalyticsCustomModulesResponse.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_descendant_security_health_analytics_custom_modules REST call - # - # @param request_pb [::Google::Cloud::SecurityCenterManagement::V1::ListDescendantSecurityHealthAnalyticsCustomModulesRequest] - # A request object representing the call parameters. Required. - # @param options [::Gapic::CallOptions] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Cloud::SecurityCenterManagement::V1::ListDescendantSecurityHealthAnalyticsCustomModulesResponse] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::SecurityCenterManagement::V1::ListDescendantSecurityHealthAnalyticsCustomModulesResponse] - # A result object deserialized from the server's reply - def list_descendant_security_health_analytics_custom_modules request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_list_descendant_security_health_analytics_custom_modules_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_descendant_security_health_analytics_custom_modules", - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Cloud::SecurityCenterManagement::V1::ListDescendantSecurityHealthAnalyticsCustomModulesResponse.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_security_health_analytics_custom_module REST call - # - # @param request_pb [::Google::Cloud::SecurityCenterManagement::V1::GetSecurityHealthAnalyticsCustomModuleRequest] - # A request object representing the call parameters. Required. - # @param options [::Gapic::CallOptions] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Cloud::SecurityCenterManagement::V1::SecurityHealthAnalyticsCustomModule] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::SecurityCenterManagement::V1::SecurityHealthAnalyticsCustomModule] - # A result object deserialized from the server's reply - def get_security_health_analytics_custom_module request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_get_security_health_analytics_custom_module_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_security_health_analytics_custom_module", - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Cloud::SecurityCenterManagement::V1::SecurityHealthAnalyticsCustomModule.decode_json response.body, ignore_unknown_fields: true - catch :response do - yield result, operation if block_given? - result - end - end - - ## - # Baseline implementation for the create_security_health_analytics_custom_module REST call - # - # @param request_pb [::Google::Cloud::SecurityCenterManagement::V1::CreateSecurityHealthAnalyticsCustomModuleRequest] - # A request object representing the call parameters. Required. - # @param options [::Gapic::CallOptions] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Cloud::SecurityCenterManagement::V1::SecurityHealthAnalyticsCustomModule] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::SecurityCenterManagement::V1::SecurityHealthAnalyticsCustomModule] - # A result object deserialized from the server's reply - def create_security_health_analytics_custom_module request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_create_security_health_analytics_custom_module_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_security_health_analytics_custom_module", - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Cloud::SecurityCenterManagement::V1::SecurityHealthAnalyticsCustomModule.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_security_health_analytics_custom_module REST call - # - # @param request_pb [::Google::Cloud::SecurityCenterManagement::V1::UpdateSecurityHealthAnalyticsCustomModuleRequest] - # A request object representing the call parameters. Required. - # @param options [::Gapic::CallOptions] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Cloud::SecurityCenterManagement::V1::SecurityHealthAnalyticsCustomModule] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::SecurityCenterManagement::V1::SecurityHealthAnalyticsCustomModule] - # A result object deserialized from the server's reply - def update_security_health_analytics_custom_module request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_update_security_health_analytics_custom_module_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_security_health_analytics_custom_module", - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Cloud::SecurityCenterManagement::V1::SecurityHealthAnalyticsCustomModule.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_security_health_analytics_custom_module REST call - # - # @param request_pb [::Google::Cloud::SecurityCenterManagement::V1::DeleteSecurityHealthAnalyticsCustomModuleRequest] - # 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_security_health_analytics_custom_module request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_delete_security_health_analytics_custom_module_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_security_health_analytics_custom_module", - 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 simulate_security_health_analytics_custom_module REST call - # - # @param request_pb [::Google::Cloud::SecurityCenterManagement::V1::SimulateSecurityHealthAnalyticsCustomModuleRequest] - # A request object representing the call parameters. Required. - # @param options [::Gapic::CallOptions] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Cloud::SecurityCenterManagement::V1::SimulateSecurityHealthAnalyticsCustomModuleResponse] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::SecurityCenterManagement::V1::SimulateSecurityHealthAnalyticsCustomModuleResponse] - # A result object deserialized from the server's reply - def simulate_security_health_analytics_custom_module request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_simulate_security_health_analytics_custom_module_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: "simulate_security_health_analytics_custom_module", - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Cloud::SecurityCenterManagement::V1::SimulateSecurityHealthAnalyticsCustomModuleResponse.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_effective_event_threat_detection_custom_modules REST call - # - # @param request_pb [::Google::Cloud::SecurityCenterManagement::V1::ListEffectiveEventThreatDetectionCustomModulesRequest] - # A request object representing the call parameters. Required. - # @param options [::Gapic::CallOptions] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Cloud::SecurityCenterManagement::V1::ListEffectiveEventThreatDetectionCustomModulesResponse] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::SecurityCenterManagement::V1::ListEffectiveEventThreatDetectionCustomModulesResponse] - # A result object deserialized from the server's reply - def list_effective_event_threat_detection_custom_modules request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_list_effective_event_threat_detection_custom_modules_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_effective_event_threat_detection_custom_modules", - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Cloud::SecurityCenterManagement::V1::ListEffectiveEventThreatDetectionCustomModulesResponse.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_effective_event_threat_detection_custom_module REST call - # - # @param request_pb [::Google::Cloud::SecurityCenterManagement::V1::GetEffectiveEventThreatDetectionCustomModuleRequest] - # A request object representing the call parameters. Required. - # @param options [::Gapic::CallOptions] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Cloud::SecurityCenterManagement::V1::EffectiveEventThreatDetectionCustomModule] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::SecurityCenterManagement::V1::EffectiveEventThreatDetectionCustomModule] - # A result object deserialized from the server's reply - def get_effective_event_threat_detection_custom_module request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_get_effective_event_threat_detection_custom_module_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_effective_event_threat_detection_custom_module", - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Cloud::SecurityCenterManagement::V1::EffectiveEventThreatDetectionCustomModule.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_event_threat_detection_custom_modules REST call - # - # @param request_pb [::Google::Cloud::SecurityCenterManagement::V1::ListEventThreatDetectionCustomModulesRequest] - # A request object representing the call parameters. Required. - # @param options [::Gapic::CallOptions] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Cloud::SecurityCenterManagement::V1::ListEventThreatDetectionCustomModulesResponse] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::SecurityCenterManagement::V1::ListEventThreatDetectionCustomModulesResponse] - # A result object deserialized from the server's reply - def list_event_threat_detection_custom_modules request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_list_event_threat_detection_custom_modules_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_event_threat_detection_custom_modules", - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Cloud::SecurityCenterManagement::V1::ListEventThreatDetectionCustomModulesResponse.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_descendant_event_threat_detection_custom_modules REST call - # - # @param request_pb [::Google::Cloud::SecurityCenterManagement::V1::ListDescendantEventThreatDetectionCustomModulesRequest] - # A request object representing the call parameters. Required. - # @param options [::Gapic::CallOptions] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Cloud::SecurityCenterManagement::V1::ListDescendantEventThreatDetectionCustomModulesResponse] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::SecurityCenterManagement::V1::ListDescendantEventThreatDetectionCustomModulesResponse] - # A result object deserialized from the server's reply - def list_descendant_event_threat_detection_custom_modules request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_list_descendant_event_threat_detection_custom_modules_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_descendant_event_threat_detection_custom_modules", - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Cloud::SecurityCenterManagement::V1::ListDescendantEventThreatDetectionCustomModulesResponse.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_event_threat_detection_custom_module REST call - # - # @param request_pb [::Google::Cloud::SecurityCenterManagement::V1::GetEventThreatDetectionCustomModuleRequest] - # A request object representing the call parameters. Required. - # @param options [::Gapic::CallOptions] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Cloud::SecurityCenterManagement::V1::EventThreatDetectionCustomModule] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::SecurityCenterManagement::V1::EventThreatDetectionCustomModule] - # A result object deserialized from the server's reply - def get_event_threat_detection_custom_module request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_get_event_threat_detection_custom_module_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_event_threat_detection_custom_module", - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Cloud::SecurityCenterManagement::V1::EventThreatDetectionCustomModule.decode_json response.body, ignore_unknown_fields: true - catch :response do - yield result, operation if block_given? - result - end - end - - ## - # Baseline implementation for the create_event_threat_detection_custom_module REST call - # - # @param request_pb [::Google::Cloud::SecurityCenterManagement::V1::CreateEventThreatDetectionCustomModuleRequest] - # A request object representing the call parameters. Required. - # @param options [::Gapic::CallOptions] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Cloud::SecurityCenterManagement::V1::EventThreatDetectionCustomModule] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::SecurityCenterManagement::V1::EventThreatDetectionCustomModule] - # A result object deserialized from the server's reply - def create_event_threat_detection_custom_module request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_create_event_threat_detection_custom_module_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_event_threat_detection_custom_module", - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Cloud::SecurityCenterManagement::V1::EventThreatDetectionCustomModule.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_event_threat_detection_custom_module REST call - # - # @param request_pb [::Google::Cloud::SecurityCenterManagement::V1::UpdateEventThreatDetectionCustomModuleRequest] - # A request object representing the call parameters. Required. - # @param options [::Gapic::CallOptions] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Cloud::SecurityCenterManagement::V1::EventThreatDetectionCustomModule] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::SecurityCenterManagement::V1::EventThreatDetectionCustomModule] - # A result object deserialized from the server's reply - def update_event_threat_detection_custom_module request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_update_event_threat_detection_custom_module_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_event_threat_detection_custom_module", - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Cloud::SecurityCenterManagement::V1::EventThreatDetectionCustomModule.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_event_threat_detection_custom_module REST call - # - # @param request_pb [::Google::Cloud::SecurityCenterManagement::V1::DeleteEventThreatDetectionCustomModuleRequest] - # 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_event_threat_detection_custom_module request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_delete_event_threat_detection_custom_module_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_event_threat_detection_custom_module", - 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 validate_event_threat_detection_custom_module REST call - # - # @param request_pb [::Google::Cloud::SecurityCenterManagement::V1::ValidateEventThreatDetectionCustomModuleRequest] - # A request object representing the call parameters. Required. - # @param options [::Gapic::CallOptions] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Cloud::SecurityCenterManagement::V1::ValidateEventThreatDetectionCustomModuleResponse] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::SecurityCenterManagement::V1::ValidateEventThreatDetectionCustomModuleResponse] - # A result object deserialized from the server's reply - def validate_event_threat_detection_custom_module request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_validate_event_threat_detection_custom_module_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: "validate_event_threat_detection_custom_module", - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Cloud::SecurityCenterManagement::V1::ValidateEventThreatDetectionCustomModuleResponse.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_security_center_service REST call - # - # @param request_pb [::Google::Cloud::SecurityCenterManagement::V1::GetSecurityCenterServiceRequest] - # A request object representing the call parameters. Required. - # @param options [::Gapic::CallOptions] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Cloud::SecurityCenterManagement::V1::SecurityCenterService] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::SecurityCenterManagement::V1::SecurityCenterService] - # A result object deserialized from the server's reply - def get_security_center_service request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_get_security_center_service_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_security_center_service", - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Cloud::SecurityCenterManagement::V1::SecurityCenterService.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_security_center_services REST call - # - # @param request_pb [::Google::Cloud::SecurityCenterManagement::V1::ListSecurityCenterServicesRequest] - # A request object representing the call parameters. Required. - # @param options [::Gapic::CallOptions] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Cloud::SecurityCenterManagement::V1::ListSecurityCenterServicesResponse] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::SecurityCenterManagement::V1::ListSecurityCenterServicesResponse] - # A result object deserialized from the server's reply - def list_security_center_services request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_list_security_center_services_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_security_center_services", - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Cloud::SecurityCenterManagement::V1::ListSecurityCenterServicesResponse.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_security_center_service REST call - # - # @param request_pb [::Google::Cloud::SecurityCenterManagement::V1::UpdateSecurityCenterServiceRequest] - # A request object representing the call parameters. Required. - # @param options [::Gapic::CallOptions] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Cloud::SecurityCenterManagement::V1::SecurityCenterService] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::SecurityCenterManagement::V1::SecurityCenterService] - # A result object deserialized from the server's reply - def update_security_center_service request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_update_security_center_service_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_security_center_service", - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Cloud::SecurityCenterManagement::V1::SecurityCenterService.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_effective_security_health_analytics_custom_modules REST call - # - # @param request_pb [::Google::Cloud::SecurityCenterManagement::V1::ListEffectiveSecurityHealthAnalyticsCustomModulesRequest] - # 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_effective_security_health_analytics_custom_modules_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :get, - uri_template: "/v1/{parent}/effectiveSecurityHealthAnalyticsCustomModules", - matches: [ - ["parent", %r{^projects/[^/]+/locations/[^/]+/?$}, false] - ] - ) - .with_bindings( - uri_method: :get, - uri_template: "/v1/{parent}/effectiveSecurityHealthAnalyticsCustomModules", - matches: [ - ["parent", %r{^folders/[^/]+/locations/[^/]+/?$}, false] - ] - ) - .with_bindings( - uri_method: :get, - uri_template: "/v1/{parent}/effectiveSecurityHealthAnalyticsCustomModules", - matches: [ - ["parent", %r{^organizations/[^/]+/locations/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the get_effective_security_health_analytics_custom_module REST call - # - # @param request_pb [::Google::Cloud::SecurityCenterManagement::V1::GetEffectiveSecurityHealthAnalyticsCustomModuleRequest] - # 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_effective_security_health_analytics_custom_module_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :get, - uri_template: "/v1/{name}", - matches: [ - ["name", %r{^projects/[^/]+/locations/[^/]+/effectiveSecurityHealthAnalyticsCustomModules/[^/]+/?$}, false] - ] - ) - .with_bindings( - uri_method: :get, - uri_template: "/v1/{name}", - matches: [ - ["name", %r{^folders/[^/]+/locations/[^/]+/effectiveSecurityHealthAnalyticsCustomModules/[^/]+/?$}, false] - ] - ) - .with_bindings( - uri_method: :get, - uri_template: "/v1/{name}", - matches: [ - ["name", %r{^organizations/[^/]+/locations/[^/]+/effectiveSecurityHealthAnalyticsCustomModules/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the list_security_health_analytics_custom_modules REST call - # - # @param request_pb [::Google::Cloud::SecurityCenterManagement::V1::ListSecurityHealthAnalyticsCustomModulesRequest] - # 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_security_health_analytics_custom_modules_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :get, - uri_template: "/v1/{parent}/securityHealthAnalyticsCustomModules", - matches: [ - ["parent", %r{^projects/[^/]+/locations/[^/]+/?$}, false] - ] - ) - .with_bindings( - uri_method: :get, - uri_template: "/v1/{parent}/securityHealthAnalyticsCustomModules", - matches: [ - ["parent", %r{^folders/[^/]+/locations/[^/]+/?$}, false] - ] - ) - .with_bindings( - uri_method: :get, - uri_template: "/v1/{parent}/securityHealthAnalyticsCustomModules", - matches: [ - ["parent", %r{^organizations/[^/]+/locations/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the list_descendant_security_health_analytics_custom_modules REST call - # - # @param request_pb [::Google::Cloud::SecurityCenterManagement::V1::ListDescendantSecurityHealthAnalyticsCustomModulesRequest] - # 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_descendant_security_health_analytics_custom_modules_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :get, - uri_template: "/v1/{parent}/securityHealthAnalyticsCustomModules:listDescendant", - matches: [ - ["parent", %r{^projects/[^/]+/locations/[^/]+/?$}, false] - ] - ) - .with_bindings( - uri_method: :get, - uri_template: "/v1/{parent}/securityHealthAnalyticsCustomModules:listDescendant", - matches: [ - ["parent", %r{^folders/[^/]+/locations/[^/]+/?$}, false] - ] - ) - .with_bindings( - uri_method: :get, - uri_template: "/v1/{parent}/securityHealthAnalyticsCustomModules:listDescendant", - matches: [ - ["parent", %r{^organizations/[^/]+/locations/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the get_security_health_analytics_custom_module REST call - # - # @param request_pb [::Google::Cloud::SecurityCenterManagement::V1::GetSecurityHealthAnalyticsCustomModuleRequest] - # 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_security_health_analytics_custom_module_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :get, - uri_template: "/v1/{name}", - matches: [ - ["name", %r{^projects/[^/]+/locations/[^/]+/securityHealthAnalyticsCustomModules/[^/]+/?$}, false] - ] - ) - .with_bindings( - uri_method: :get, - uri_template: "/v1/{name}", - matches: [ - ["name", %r{^folders/[^/]+/locations/[^/]+/securityHealthAnalyticsCustomModules/[^/]+/?$}, false] - ] - ) - .with_bindings( - uri_method: :get, - uri_template: "/v1/{name}", - matches: [ - ["name", %r{^organizations/[^/]+/locations/[^/]+/securityHealthAnalyticsCustomModules/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the create_security_health_analytics_custom_module REST call - # - # @param request_pb [::Google::Cloud::SecurityCenterManagement::V1::CreateSecurityHealthAnalyticsCustomModuleRequest] - # 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_security_health_analytics_custom_module_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :post, - uri_template: "/v1/{parent}/securityHealthAnalyticsCustomModules", - body: "security_health_analytics_custom_module", - matches: [ - ["parent", %r{^projects/[^/]+/locations/[^/]+/?$}, false] - ] - ) - .with_bindings( - uri_method: :post, - uri_template: "/v1/{parent}/securityHealthAnalyticsCustomModules", - body: "security_health_analytics_custom_module", - matches: [ - ["parent", %r{^folders/[^/]+/locations/[^/]+/?$}, false] - ] - ) - .with_bindings( - uri_method: :post, - uri_template: "/v1/{parent}/securityHealthAnalyticsCustomModules", - body: "security_health_analytics_custom_module", - matches: [ - ["parent", %r{^organizations/[^/]+/locations/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the update_security_health_analytics_custom_module REST call - # - # @param request_pb [::Google::Cloud::SecurityCenterManagement::V1::UpdateSecurityHealthAnalyticsCustomModuleRequest] - # 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_security_health_analytics_custom_module_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :patch, - uri_template: "/v1/{security_health_analytics_custom_module.name}", - body: "security_health_analytics_custom_module", - matches: [ - ["security_health_analytics_custom_module.name", %r{^projects/[^/]+/locations/[^/]+/securityHealthAnalyticsCustomModules/[^/]+/?$}, false] - ] - ) - .with_bindings( - uri_method: :patch, - uri_template: "/v1/{security_health_analytics_custom_module.name}", - body: "security_health_analytics_custom_module", - matches: [ - ["security_health_analytics_custom_module.name", %r{^folders/[^/]+/locations/[^/]+/securityHealthAnalyticsCustomModules/[^/]+/?$}, false] - ] - ) - .with_bindings( - uri_method: :patch, - uri_template: "/v1/{security_health_analytics_custom_module.name}", - body: "security_health_analytics_custom_module", - matches: [ - ["security_health_analytics_custom_module.name", %r{^organizations/[^/]+/locations/[^/]+/securityHealthAnalyticsCustomModules/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the delete_security_health_analytics_custom_module REST call - # - # @param request_pb [::Google::Cloud::SecurityCenterManagement::V1::DeleteSecurityHealthAnalyticsCustomModuleRequest] - # 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_security_health_analytics_custom_module_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :delete, - uri_template: "/v1/{name}", - matches: [ - ["name", %r{^projects/[^/]+/locations/[^/]+/securityHealthAnalyticsCustomModules/[^/]+/?$}, false] - ] - ) - .with_bindings( - uri_method: :delete, - uri_template: "/v1/{name}", - matches: [ - ["name", %r{^folders/[^/]+/locations/[^/]+/securityHealthAnalyticsCustomModules/[^/]+/?$}, false] - ] - ) - .with_bindings( - uri_method: :delete, - uri_template: "/v1/{name}", - matches: [ - ["name", %r{^organizations/[^/]+/locations/[^/]+/securityHealthAnalyticsCustomModules/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the simulate_security_health_analytics_custom_module REST call - # - # @param request_pb [::Google::Cloud::SecurityCenterManagement::V1::SimulateSecurityHealthAnalyticsCustomModuleRequest] - # A request object representing the call parameters. Required. - # @return [Array(String, [String, nil], Hash{String => String})] - # Uri, Body, Query string parameters - def self.transcode_simulate_security_health_analytics_custom_module_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :post, - uri_template: "/v1/{parent}/securityHealthAnalyticsCustomModules:simulate", - body: "*", - matches: [ - ["parent", %r{^projects/[^/]+/locations/[^/]+/?$}, false] - ] - ) - .with_bindings( - uri_method: :post, - uri_template: "/v1/{parent}/securityHealthAnalyticsCustomModules:simulate", - body: "*", - matches: [ - ["parent", %r{^folders/[^/]+/locations/[^/]+/?$}, false] - ] - ) - .with_bindings( - uri_method: :post, - uri_template: "/v1/{parent}/securityHealthAnalyticsCustomModules:simulate", - body: "*", - matches: [ - ["parent", %r{^organizations/[^/]+/locations/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the list_effective_event_threat_detection_custom_modules REST call - # - # @param request_pb [::Google::Cloud::SecurityCenterManagement::V1::ListEffectiveEventThreatDetectionCustomModulesRequest] - # 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_effective_event_threat_detection_custom_modules_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :get, - uri_template: "/v1/{parent}/effectiveEventThreatDetectionCustomModules", - matches: [ - ["parent", %r{^projects/[^/]+/locations/[^/]+/?$}, false] - ] - ) - .with_bindings( - uri_method: :get, - uri_template: "/v1/{parent}/effectiveEventThreatDetectionCustomModules", - matches: [ - ["parent", %r{^folders/[^/]+/locations/[^/]+/?$}, false] - ] - ) - .with_bindings( - uri_method: :get, - uri_template: "/v1/{parent}/effectiveEventThreatDetectionCustomModules", - matches: [ - ["parent", %r{^organizations/[^/]+/locations/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the get_effective_event_threat_detection_custom_module REST call - # - # @param request_pb [::Google::Cloud::SecurityCenterManagement::V1::GetEffectiveEventThreatDetectionCustomModuleRequest] - # 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_effective_event_threat_detection_custom_module_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :get, - uri_template: "/v1/{name}", - matches: [ - ["name", %r{^projects/[^/]+/locations/[^/]+/effectiveEventThreatDetectionCustomModules/[^/]+/?$}, false] - ] - ) - .with_bindings( - uri_method: :get, - uri_template: "/v1/{name}", - matches: [ - ["name", %r{^folders/[^/]+/locations/[^/]+/effectiveEventThreatDetectionCustomModules/[^/]+/?$}, false] - ] - ) - .with_bindings( - uri_method: :get, - uri_template: "/v1/{name}", - matches: [ - ["name", %r{^organizations/[^/]+/locations/[^/]+/effectiveEventThreatDetectionCustomModules/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the list_event_threat_detection_custom_modules REST call - # - # @param request_pb [::Google::Cloud::SecurityCenterManagement::V1::ListEventThreatDetectionCustomModulesRequest] - # 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_event_threat_detection_custom_modules_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :get, - uri_template: "/v1/{parent}/eventThreatDetectionCustomModules", - matches: [ - ["parent", %r{^projects/[^/]+/locations/[^/]+/?$}, false] - ] - ) - .with_bindings( - uri_method: :get, - uri_template: "/v1/{parent}/eventThreatDetectionCustomModules", - matches: [ - ["parent", %r{^folders/[^/]+/locations/[^/]+/?$}, false] - ] - ) - .with_bindings( - uri_method: :get, - uri_template: "/v1/{parent}/eventThreatDetectionCustomModules", - matches: [ - ["parent", %r{^organizations/[^/]+/locations/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the list_descendant_event_threat_detection_custom_modules REST call - # - # @param request_pb [::Google::Cloud::SecurityCenterManagement::V1::ListDescendantEventThreatDetectionCustomModulesRequest] - # 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_descendant_event_threat_detection_custom_modules_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :get, - uri_template: "/v1/{parent}/eventThreatDetectionCustomModules:listDescendant", - matches: [ - ["parent", %r{^projects/[^/]+/locations/[^/]+/?$}, false] - ] - ) - .with_bindings( - uri_method: :get, - uri_template: "/v1/{parent}/eventThreatDetectionCustomModules:listDescendant", - matches: [ - ["parent", %r{^folders/[^/]+/locations/[^/]+/?$}, false] - ] - ) - .with_bindings( - uri_method: :get, - uri_template: "/v1/{parent}/eventThreatDetectionCustomModules:listDescendant", - matches: [ - ["parent", %r{^organizations/[^/]+/locations/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the get_event_threat_detection_custom_module REST call - # - # @param request_pb [::Google::Cloud::SecurityCenterManagement::V1::GetEventThreatDetectionCustomModuleRequest] - # 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_event_threat_detection_custom_module_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :get, - uri_template: "/v1/{name}", - matches: [ - ["name", %r{^projects/[^/]+/locations/[^/]+/eventThreatDetectionCustomModules/[^/]+/?$}, false] - ] - ) - .with_bindings( - uri_method: :get, - uri_template: "/v1/{name}", - matches: [ - ["name", %r{^folders/[^/]+/locations/[^/]+/eventThreatDetectionCustomModules/[^/]+/?$}, false] - ] - ) - .with_bindings( - uri_method: :get, - uri_template: "/v1/{name}", - matches: [ - ["name", %r{^organizations/[^/]+/locations/[^/]+/eventThreatDetectionCustomModules/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the create_event_threat_detection_custom_module REST call - # - # @param request_pb [::Google::Cloud::SecurityCenterManagement::V1::CreateEventThreatDetectionCustomModuleRequest] - # 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_event_threat_detection_custom_module_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :post, - uri_template: "/v1/{parent}/eventThreatDetectionCustomModules", - body: "event_threat_detection_custom_module", - matches: [ - ["parent", %r{^projects/[^/]+/locations/[^/]+/?$}, false] - ] - ) - .with_bindings( - uri_method: :post, - uri_template: "/v1/{parent}/eventThreatDetectionCustomModules", - body: "event_threat_detection_custom_module", - matches: [ - ["parent", %r{^folders/[^/]+/locations/[^/]+/?$}, false] - ] - ) - .with_bindings( - uri_method: :post, - uri_template: "/v1/{parent}/eventThreatDetectionCustomModules", - body: "event_threat_detection_custom_module", - matches: [ - ["parent", %r{^organizations/[^/]+/locations/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the update_event_threat_detection_custom_module REST call - # - # @param request_pb [::Google::Cloud::SecurityCenterManagement::V1::UpdateEventThreatDetectionCustomModuleRequest] - # 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_event_threat_detection_custom_module_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :patch, - uri_template: "/v1/{event_threat_detection_custom_module.name}", - body: "event_threat_detection_custom_module", - matches: [ - ["event_threat_detection_custom_module.name", %r{^projects/[^/]+/locations/[^/]+/eventThreatDetectionCustomModules/[^/]+/?$}, false] - ] - ) - .with_bindings( - uri_method: :patch, - uri_template: "/v1/{event_threat_detection_custom_module.name}", - body: "event_threat_detection_custom_module", - matches: [ - ["event_threat_detection_custom_module.name", %r{^folders/[^/]+/locations/[^/]+/eventThreatDetectionCustomModules/[^/]+/?$}, false] - ] - ) - .with_bindings( - uri_method: :patch, - uri_template: "/v1/{event_threat_detection_custom_module.name}", - body: "event_threat_detection_custom_module", - matches: [ - ["event_threat_detection_custom_module.name", %r{^organizations/[^/]+/locations/[^/]+/eventThreatDetectionCustomModules/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the delete_event_threat_detection_custom_module REST call - # - # @param request_pb [::Google::Cloud::SecurityCenterManagement::V1::DeleteEventThreatDetectionCustomModuleRequest] - # 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_event_threat_detection_custom_module_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :delete, - uri_template: "/v1/{name}", - matches: [ - ["name", %r{^projects/[^/]+/locations/[^/]+/eventThreatDetectionCustomModules/[^/]+/?$}, false] - ] - ) - .with_bindings( - uri_method: :delete, - uri_template: "/v1/{name}", - matches: [ - ["name", %r{^folders/[^/]+/locations/[^/]+/eventThreatDetectionCustomModules/[^/]+/?$}, false] - ] - ) - .with_bindings( - uri_method: :delete, - uri_template: "/v1/{name}", - matches: [ - ["name", %r{^organizations/[^/]+/locations/[^/]+/eventThreatDetectionCustomModules/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the validate_event_threat_detection_custom_module REST call - # - # @param request_pb [::Google::Cloud::SecurityCenterManagement::V1::ValidateEventThreatDetectionCustomModuleRequest] - # A request object representing the call parameters. Required. - # @return [Array(String, [String, nil], Hash{String => String})] - # Uri, Body, Query string parameters - def self.transcode_validate_event_threat_detection_custom_module_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :post, - uri_template: "/v1/{parent}/eventThreatDetectionCustomModules:validate", - body: "*", - matches: [ - ["parent", %r{^projects/[^/]+/locations/[^/]+/?$}, false] - ] - ) - .with_bindings( - uri_method: :post, - uri_template: "/v1/{parent}/eventThreatDetectionCustomModules:validate", - body: "*", - matches: [ - ["parent", %r{^folders/[^/]+/locations/[^/]+/?$}, false] - ] - ) - .with_bindings( - uri_method: :post, - uri_template: "/v1/{parent}/eventThreatDetectionCustomModules:validate", - body: "*", - matches: [ - ["parent", %r{^organizations/[^/]+/locations/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the get_security_center_service REST call - # - # @param request_pb [::Google::Cloud::SecurityCenterManagement::V1::GetSecurityCenterServiceRequest] - # 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_security_center_service_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :get, - uri_template: "/v1/{name}", - matches: [ - ["name", %r{^projects/[^/]+/locations/[^/]+/securityCenterServices/[^/]+/?$}, false] - ] - ) - .with_bindings( - uri_method: :get, - uri_template: "/v1/{name}", - matches: [ - ["name", %r{^folders/[^/]+/locations/[^/]+/securityCenterServices/[^/]+/?$}, false] - ] - ) - .with_bindings( - uri_method: :get, - uri_template: "/v1/{name}", - matches: [ - ["name", %r{^organizations/[^/]+/locations/[^/]+/securityCenterServices/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the list_security_center_services REST call - # - # @param request_pb [::Google::Cloud::SecurityCenterManagement::V1::ListSecurityCenterServicesRequest] - # 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_security_center_services_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :get, - uri_template: "/v1/{parent}/securityCenterServices", - matches: [ - ["parent", %r{^projects/[^/]+/locations/[^/]+/?$}, false] - ] - ) - .with_bindings( - uri_method: :get, - uri_template: "/v1/{parent}/securityCenterServices", - matches: [ - ["parent", %r{^folders/[^/]+/locations/[^/]+/?$}, false] - ] - ) - .with_bindings( - uri_method: :get, - uri_template: "/v1/{parent}/securityCenterServices", - matches: [ - ["parent", %r{^organizations/[^/]+/locations/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the update_security_center_service REST call - # - # @param request_pb [::Google::Cloud::SecurityCenterManagement::V1::UpdateSecurityCenterServiceRequest] - # 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_security_center_service_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :patch, - uri_template: "/v1/{security_center_service.name}", - body: "security_center_service", - matches: [ - ["security_center_service.name", %r{^projects/[^/]+/locations/[^/]+/securityCenterServices/[^/]+/?$}, false] - ] - ) - .with_bindings( - uri_method: :patch, - uri_template: "/v1/{security_center_service.name}", - body: "security_center_service", - matches: [ - ["security_center_service.name", %r{^folders/[^/]+/locations/[^/]+/securityCenterServices/[^/]+/?$}, false] - ] - ) - .with_bindings( - uri_method: :patch, - uri_template: "/v1/{security_center_service.name}", - body: "security_center_service", - matches: [ - ["security_center_service.name", %r{^organizations/[^/]+/locations/[^/]+/securityCenterServices/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - end - end - end - end - end - end -end diff --git a/owl-bot-staging/google-cloud-security_center_management-v1/lib/google/cloud/security_center_management/v1/version.rb b/owl-bot-staging/google-cloud-security_center_management-v1/lib/google/cloud/security_center_management/v1/version.rb deleted file mode 100644 index 5a44413e0a99..000000000000 --- a/owl-bot-staging/google-cloud-security_center_management-v1/lib/google/cloud/security_center_management/v1/version.rb +++ /dev/null @@ -1,28 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - - -module Google - module Cloud - module SecurityCenterManagement - module V1 - VERSION = "0.0.1" - end - end - end -end diff --git a/owl-bot-staging/google-cloud-security_center_management-v1/lib/google/cloud/securitycentermanagement/v1/security_center_management_pb.rb b/owl-bot-staging/google-cloud-security_center_management-v1/lib/google/cloud/securitycentermanagement/v1/security_center_management_pb.rb deleted file mode 100644 index 9dc6c4a10fff..000000000000 --- a/owl-bot-staging/google-cloud-security_center_management-v1/lib/google/cloud/securitycentermanagement/v1/security_center_management_pb.rb +++ /dev/null @@ -1,86 +0,0 @@ -# frozen_string_literal: true -# Generated by the protocol buffer compiler. DO NOT EDIT! -# source: google/cloud/securitycentermanagement/v1/security_center_management.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/v1/policy_pb' -require 'google/protobuf/empty_pb' -require 'google/protobuf/field_mask_pb' -require 'google/protobuf/struct_pb' -require 'google/protobuf/timestamp_pb' -require 'google/rpc/status_pb' -require 'google/type/expr_pb' - - -descriptor_data = "\nIgoogle/cloud/securitycentermanagement/v1/security_center_management.proto\x12(google.cloud.securitycentermanagement.v1\x1a\x1cgoogle/api/annotations.proto\x1a\x17google/api/client.proto\x1a\x1fgoogle/api/field_behavior.proto\x1a\x19google/api/resource.proto\x1a\x1agoogle/iam/v1/policy.proto\x1a\x1bgoogle/protobuf/empty.proto\x1a google/protobuf/field_mask.proto\x1a\x1cgoogle/protobuf/struct.proto\x1a\x1fgoogle/protobuf/timestamp.proto\x1a\x17google/rpc/status.proto\x1a\x16google/type/expr.proto\"\xbe\n\n\x15SecurityCenterService\x12\x11\n\x04name\x18\x01 \x01(\tB\x03\xe0\x41\x08\x12w\n\x19intended_enablement_state\x18\x02 \x01(\x0e\x32O.google.cloud.securitycentermanagement.v1.SecurityCenterService.EnablementStateB\x03\xe0\x41\x01\x12x\n\x1a\x65\x66\x66\x65\x63tive_enablement_state\x18\x03 \x01(\x0e\x32O.google.cloud.securitycentermanagement.v1.SecurityCenterService.EnablementStateB\x03\xe0\x41\x03\x12\x62\n\x07modules\x18\x04 \x03(\x0b\x32L.google.cloud.securitycentermanagement.v1.SecurityCenterService.ModulesEntryB\x03\xe0\x41\x01\x12\x34\n\x0bupdate_time\x18\x05 \x01(\x0b\x32\x1a.google.protobuf.TimestampB\x03\xe0\x41\x03\x12\x34\n\x0eservice_config\x18\x06 \x01(\x0b\x32\x17.google.protobuf.StructB\x03\xe0\x41\x01\x1a\x83\x02\n\x0eModuleSettings\x12w\n\x19intended_enablement_state\x18\x01 \x01(\x0e\x32O.google.cloud.securitycentermanagement.v1.SecurityCenterService.EnablementStateB\x03\xe0\x41\x01\x12x\n\x1a\x65\x66\x66\x65\x63tive_enablement_state\x18\x02 \x01(\x0e\x32O.google.cloud.securitycentermanagement.v1.SecurityCenterService.EnablementStateB\x03\xe0\x41\x03\x1a~\n\x0cModulesEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12]\n\x05value\x18\x02 \x01(\x0b\x32N.google.cloud.securitycentermanagement.v1.SecurityCenterService.ModuleSettings:\x02\x38\x01\"n\n\x0f\x45nablementState\x12 \n\x1c\x45NABLEMENT_STATE_UNSPECIFIED\x10\x00\x12\r\n\tINHERITED\x10\x01\x12\x0b\n\x07\x45NABLED\x10\x02\x12\x0c\n\x08\x44ISABLED\x10\x03\x12\x0f\n\x0bINGEST_ONLY\x10\x04:\xd8\x02\xea\x41\xd4\x02\n=securitycentermanagement.googleapis.com/SecurityCenterService\x12Hprojects/{project}/locations/{location}/securityCenterServices/{service}\x12\x46\x66olders/{folder}/locations/{location}/securityCenterServices/{service}\x12Rorganizations/{organization}/locations/{location}/securityCenterServices/{service}*\x16securityCenterServices2\x15securityCenterService\"\xee\x07\n,EffectiveSecurityHealthAnalyticsCustomModule\x12\x11\n\x04name\x18\x01 \x01(\tB\x03\xe0\x41\x08\x12R\n\rcustom_config\x18\x02 \x01(\x0b\x32\x36.google.cloud.securitycentermanagement.v1.CustomConfigB\x03\xe0\x41\x03\x12\x85\x01\n\x10\x65nablement_state\x18\x03 \x01(\x0e\x32\x66.google.cloud.securitycentermanagement.v1.EffectiveSecurityHealthAnalyticsCustomModule.EnablementStateB\x03\xe0\x41\x03\x12\x19\n\x0c\x64isplay_name\x18\x04 \x01(\tB\x03\xe0\x41\x03\"N\n\x0f\x45nablementState\x12 \n\x1c\x45NABLEMENT_STATE_UNSPECIFIED\x10\x00\x12\x0b\n\x07\x45NABLED\x10\x01\x12\x0c\n\x08\x44ISABLED\x10\x02:\xe3\x04\xea\x41\xdf\x04\nTsecuritycentermanagement.googleapis.com/EffectiveSecurityHealthAnalyticsCustomModule\x12\x93\x01organizations/{organization}/locations/{location}/effectiveSecurityHealthAnalyticsCustomModules/{effective_security_health_analytics_custom_module}\x12\x89\x01projects/{project}/locations/{location}/effectiveSecurityHealthAnalyticsCustomModules/{effective_security_health_analytics_custom_module}\x12\x87\x01\x66olders/{folder}/locations/{location}/effectiveSecurityHealthAnalyticsCustomModules/{effective_security_health_analytics_custom_module}*-effectiveSecurityHealthAnalyticsCustomModules2,effectiveSecurityHealthAnalyticsCustomModule\"\xd9\x01\n8ListEffectiveSecurityHealthAnalyticsCustomModulesRequest\x12l\n\x06parent\x18\x01 \x01(\tB\\\xe0\x41\x02\xfa\x41V\x12Tsecuritycentermanagement.googleapis.com/EffectiveSecurityHealthAnalyticsCustomModule\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\"\xe9\x01\n9ListEffectiveSecurityHealthAnalyticsCustomModulesResponse\x12\x92\x01\n2effective_security_health_analytics_custom_modules\x18\x01 \x03(\x0b\x32V.google.cloud.securitycentermanagement.v1.EffectiveSecurityHealthAnalyticsCustomModule\x12\x17\n\x0fnext_page_token\x18\x02 \x01(\t\"\xa4\x01\n6GetEffectiveSecurityHealthAnalyticsCustomModuleRequest\x12j\n\x04name\x18\x01 \x01(\tB\\\xe0\x41\x02\xfa\x41V\nTsecuritycentermanagement.googleapis.com/EffectiveSecurityHealthAnalyticsCustomModule\"\xd2\x08\n#SecurityHealthAnalyticsCustomModule\x12\x11\n\x04name\x18\x01 \x01(\tB\x03\xe0\x41\x08\x12\x19\n\x0c\x64isplay_name\x18\x02 \x01(\tB\x03\xe0\x41\x01\x12|\n\x10\x65nablement_state\x18\x03 \x01(\x0e\x32].google.cloud.securitycentermanagement.v1.SecurityHealthAnalyticsCustomModule.EnablementStateB\x03\xe0\x41\x01\x12\x34\n\x0bupdate_time\x18\x04 \x01(\x0b\x32\x1a.google.protobuf.TimestampB\x03\xe0\x41\x03\x12\x18\n\x0blast_editor\x18\x05 \x01(\tB\x03\xe0\x41\x03\x12l\n\x0f\x61ncestor_module\x18\x06 \x01(\tBS\xe0\x41\x03\xfa\x41M\nKsecuritycentermanagement.googleapis.com/SecurityHealthAnalyticsCustomModule\x12R\n\rcustom_config\x18\x07 \x01(\x0b\x32\x36.google.cloud.securitycentermanagement.v1.CustomConfigB\x03\xe0\x41\x01\"]\n\x0f\x45nablementState\x12 \n\x1c\x45NABLEMENT_STATE_UNSPECIFIED\x10\x00\x12\x0b\n\x07\x45NABLED\x10\x01\x12\x0c\n\x08\x44ISABLED\x10\x02\x12\r\n\tINHERITED\x10\x03:\x8d\x04\xea\x41\x89\x04\nKsecuritycentermanagement.googleapis.com/SecurityHealthAnalyticsCustomModule\x12\x80\x01organizations/{organization}/locations/{location}/securityHealthAnalyticsCustomModules/{security_health_analytics_custom_module}\x12vprojects/{project}/locations/{location}/securityHealthAnalyticsCustomModules/{security_health_analytics_custom_module}\x12tfolders/{folder}/locations/{location}/securityHealthAnalyticsCustomModules/{security_health_analytics_custom_module}*$securityHealthAnalyticsCustomModules2#securityHealthAnalyticsCustomModule\"\xeb\x05\n\x0c\x43ustomConfig\x12)\n\tpredicate\x18\x01 \x01(\x0b\x32\x11.google.type.ExprB\x03\xe0\x41\x01\x12\x63\n\rcustom_output\x18\x02 \x01(\x0b\x32G.google.cloud.securitycentermanagement.v1.CustomConfig.CustomOutputSpecB\x03\xe0\x41\x01\x12g\n\x11resource_selector\x18\x03 \x01(\x0b\x32G.google.cloud.securitycentermanagement.v1.CustomConfig.ResourceSelectorB\x03\xe0\x41\x01\x12V\n\x08severity\x18\x04 \x01(\x0e\x32?.google.cloud.securitycentermanagement.v1.CustomConfig.SeverityB\x03\xe0\x41\x01\x12\x18\n\x0b\x64\x65scription\x18\x05 \x01(\tB\x03\xe0\x41\x01\x12\x1b\n\x0erecommendation\x18\x06 \x01(\tB\x03\xe0\x41\x01\x1a\xce\x01\n\x10\x43ustomOutputSpec\x12i\n\nproperties\x18\x01 \x03(\x0b\x32P.google.cloud.securitycentermanagement.v1.CustomConfig.CustomOutputSpec.PropertyB\x03\xe0\x41\x01\x1aO\n\x08Property\x12\x11\n\x04name\x18\x01 \x01(\tB\x03\xe0\x41\x01\x12\x30\n\x10value_expression\x18\x02 \x01(\x0b\x32\x11.google.type.ExprB\x03\xe0\x41\x01\x1a/\n\x10ResourceSelector\x12\x1b\n\x0eresource_types\x18\x01 \x03(\tB\x03\xe0\x41\x01\"Q\n\x08Severity\x12\x18\n\x14SEVERITY_UNSPECIFIED\x10\x00\x12\x0c\n\x08\x43RITICAL\x10\x01\x12\x08\n\x04HIGH\x10\x02\x12\n\n\x06MEDIUM\x10\x03\x12\x07\n\x03LOW\x10\x04\"\xc7\x01\n/ListSecurityHealthAnalyticsCustomModulesRequest\x12\x63\n\x06parent\x18\x01 \x01(\tBS\xe0\x41\x02\xfa\x41M\x12Ksecuritycentermanagement.googleapis.com/SecurityHealthAnalyticsCustomModule\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\"\xcc\x01\n0ListSecurityHealthAnalyticsCustomModulesResponse\x12\x7f\n(security_health_analytics_custom_modules\x18\x01 \x03(\x0b\x32M.google.cloud.securitycentermanagement.v1.SecurityHealthAnalyticsCustomModule\x12\x17\n\x0fnext_page_token\x18\x02 \x01(\t\"\xd1\x01\n9ListDescendantSecurityHealthAnalyticsCustomModulesRequest\x12\x63\n\x06parent\x18\x01 \x01(\tBS\xe0\x41\x02\xfa\x41M\x12Ksecuritycentermanagement.googleapis.com/SecurityHealthAnalyticsCustomModule\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\"\xd6\x01\n:ListDescendantSecurityHealthAnalyticsCustomModulesResponse\x12\x7f\n(security_health_analytics_custom_modules\x18\x01 \x03(\x0b\x32M.google.cloud.securitycentermanagement.v1.SecurityHealthAnalyticsCustomModule\x12\x17\n\x0fnext_page_token\x18\x02 \x01(\t\"\x92\x01\n-GetSecurityHealthAnalyticsCustomModuleRequest\x12\x61\n\x04name\x18\x01 \x01(\tBS\xe0\x41\x02\xfa\x41M\nKsecuritycentermanagement.googleapis.com/SecurityHealthAnalyticsCustomModule\"\xb9\x02\n0CreateSecurityHealthAnalyticsCustomModuleRequest\x12\x63\n\x06parent\x18\x01 \x01(\tBS\xe0\x41\x02\xfa\x41M\x12Ksecuritycentermanagement.googleapis.com/SecurityHealthAnalyticsCustomModule\x12\x83\x01\n\'security_health_analytics_custom_module\x18\x02 \x01(\x0b\x32M.google.cloud.securitycentermanagement.v1.SecurityHealthAnalyticsCustomModuleB\x03\xe0\x41\x02\x12\x1a\n\rvalidate_only\x18\x03 \x01(\x08\x42\x03\xe0\x41\x01\"\x8a\x02\n0UpdateSecurityHealthAnalyticsCustomModuleRequest\x12\x34\n\x0bupdate_mask\x18\x01 \x01(\x0b\x32\x1a.google.protobuf.FieldMaskB\x03\xe0\x41\x02\x12\x83\x01\n\'security_health_analytics_custom_module\x18\x02 \x01(\x0b\x32M.google.cloud.securitycentermanagement.v1.SecurityHealthAnalyticsCustomModuleB\x03\xe0\x41\x02\x12\x1a\n\rvalidate_only\x18\x03 \x01(\x08\x42\x03\xe0\x41\x01\"\xb1\x01\n0DeleteSecurityHealthAnalyticsCustomModuleRequest\x12\x61\n\x04name\x18\x01 \x01(\tBS\xe0\x41\x02\xfa\x41M\nKsecuritycentermanagement.googleapis.com/SecurityHealthAnalyticsCustomModule\x12\x1a\n\rvalidate_only\x18\x02 \x01(\x08\x42\x03\xe0\x41\x01\"\xc1\x03\n2SimulateSecurityHealthAnalyticsCustomModuleRequest\x12\x13\n\x06parent\x18\x01 \x01(\tB\x03\xe0\x41\x02\x12R\n\rcustom_config\x18\x02 \x01(\x0b\x32\x36.google.cloud.securitycentermanagement.v1.CustomConfigB\x03\xe0\x41\x02\x12\x85\x01\n\x08resource\x18\x03 \x01(\x0b\x32n.google.cloud.securitycentermanagement.v1.SimulateSecurityHealthAnalyticsCustomModuleRequest.SimulatedResourceB\x03\xe0\x41\x02\x1a\x99\x01\n\x11SimulatedResource\x12\x1a\n\rresource_type\x18\x01 \x01(\tB\x03\xe0\x41\x02\x12\x33\n\rresource_data\x18\x02 \x01(\x0b\x32\x17.google.protobuf.StructB\x03\xe0\x41\x01\x12\x33\n\x0fiam_policy_data\x18\x03 \x01(\x0b\x32\x15.google.iam.v1.PolicyB\x03\xe0\x41\x01\"\x8a\t\n\x10SimulatedFinding\x12\x11\n\x04name\x18\x01 \x01(\tB\x03\xe0\x41\x08\x12\x0e\n\x06parent\x18\x02 \x01(\t\x12\x15\n\rresource_name\x18\x03 \x01(\t\x12\x10\n\x08\x63\x61tegory\x18\x04 \x01(\t\x12T\n\x05state\x18\x05 \x01(\x0e\x32@.google.cloud.securitycentermanagement.v1.SimulatedFinding.StateB\x03\xe0\x41\x03\x12k\n\x11source_properties\x18\x06 \x03(\x0b\x32P.google.cloud.securitycentermanagement.v1.SimulatedFinding.SourcePropertiesEntry\x12.\n\nevent_time\x18\x07 \x01(\x0b\x32\x1a.google.protobuf.Timestamp\x12U\n\x08severity\x18\x08 \x01(\x0e\x32\x43.google.cloud.securitycentermanagement.v1.SimulatedFinding.Severity\x12^\n\rfinding_class\x18\t \x01(\x0e\x32G.google.cloud.securitycentermanagement.v1.SimulatedFinding.FindingClass\x1aO\n\x15SourcePropertiesEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12%\n\x05value\x18\x02 \x01(\x0b\x32\x16.google.protobuf.Value:\x02\x38\x01\"8\n\x05State\x12\x15\n\x11STATE_UNSPECIFIED\x10\x00\x12\n\n\x06\x41\x43TIVE\x10\x01\x12\x0c\n\x08INACTIVE\x10\x02\"Q\n\x08Severity\x12\x18\n\x14SEVERITY_UNSPECIFIED\x10\x00\x12\x0c\n\x08\x43RITICAL\x10\x01\x12\x08\n\x04HIGH\x10\x02\x12\n\n\x06MEDIUM\x10\x03\x12\x07\n\x03LOW\x10\x04\"\xb0\x01\n\x0c\x46indingClass\x12\x1d\n\x19\x46INDING_CLASS_UNSPECIFIED\x10\x00\x12\n\n\x06THREAT\x10\x01\x12\x11\n\rVULNERABILITY\x10\x02\x12\x14\n\x10MISCONFIGURATION\x10\x03\x12\x0f\n\x0bOBSERVATION\x10\x04\x12\r\n\tSCC_ERROR\x10\x05\x12\x15\n\x11POSTURE_VIOLATION\x10\x06\x12\x15\n\x11TOXIC_COMBINATION\x10\x07:\xee\x01\xea\x41\xea\x01\n%securitycenter.googleapis.com/Finding\x12@organizations/{organization}/sources/{source}/findings/{finding}\x12\x34\x66olders/{folder}/sources/{source}/findings/{finding}\x12\x36projects/{project}/sources/{source}/findings/{finding}*\x08\x66indings2\x07\x66inding\"\xf6\x02\n3SimulateSecurityHealthAnalyticsCustomModuleResponse\x12}\n\x06result\x18\x01 \x01(\x0b\x32m.google.cloud.securitycentermanagement.v1.SimulateSecurityHealthAnalyticsCustomModuleResponse.SimulatedResult\x1a\xbf\x01\n\x0fSimulatedResult\x12M\n\x07\x66inding\x18\x01 \x01(\x0b\x32:.google.cloud.securitycentermanagement.v1.SimulatedFindingH\x00\x12.\n\x0cno_violation\x18\x02 \x01(\x0b\x32\x16.google.protobuf.EmptyH\x00\x12#\n\x05\x65rror\x18\x03 \x01(\x0b\x32\x12.google.rpc.StatusH\x00\x42\x08\n\x06result\"\xd4\x07\n)EffectiveEventThreatDetectionCustomModule\x12\x11\n\x04name\x18\x01 \x01(\tB\x03\xe0\x41\x08\x12,\n\x06\x63onfig\x18\x02 \x01(\x0b\x32\x17.google.protobuf.StructB\x03\xe0\x41\x03\x12\x82\x01\n\x10\x65nablement_state\x18\x03 \x01(\x0e\x32\x63.google.cloud.securitycentermanagement.v1.EffectiveEventThreatDetectionCustomModule.EnablementStateB\x03\xe0\x41\x03\x12\x11\n\x04type\x18\x04 \x01(\tB\x03\xe0\x41\x03\x12\x19\n\x0c\x64isplay_name\x18\x05 \x01(\tB\x03\xe0\x41\x03\x12\x18\n\x0b\x64\x65scription\x18\x06 \x01(\tB\x03\xe0\x41\x03\"N\n\x0f\x45nablementState\x12 \n\x1c\x45NABLEMENT_STATE_UNSPECIFIED\x10\x00\x12\x0b\n\x07\x45NABLED\x10\x01\x12\x0c\n\x08\x44ISABLED\x10\x02:\xc8\x04\xea\x41\xc4\x04\nQsecuritycentermanagement.googleapis.com/EffectiveEventThreatDetectionCustomModule\x12\x8d\x01organizations/{organization}/locations/{location}/effectiveEventThreatDetectionCustomModules/{effective_event_threat_detection_custom_module}\x12\x83\x01projects/{project}/locations/{location}/effectiveEventThreatDetectionCustomModules/{effective_event_threat_detection_custom_module}\x12\x81\x01\x66olders/{folder}/locations/{location}/effectiveEventThreatDetectionCustomModules/{effective_event_threat_detection_custom_module}**effectiveEventThreatDetectionCustomModules2)effectiveEventThreatDetectionCustomModule\"\xd3\x01\n5ListEffectiveEventThreatDetectionCustomModulesRequest\x12i\n\x06parent\x18\x01 \x01(\tBY\xe0\x41\x02\xfa\x41S\x12Qsecuritycentermanagement.googleapis.com/EffectiveEventThreatDetectionCustomModule\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\"\xe0\x01\n6ListEffectiveEventThreatDetectionCustomModulesResponse\x12\x8c\x01\n/effective_event_threat_detection_custom_modules\x18\x01 \x03(\x0b\x32S.google.cloud.securitycentermanagement.v1.EffectiveEventThreatDetectionCustomModule\x12\x17\n\x0fnext_page_token\x18\x02 \x01(\t\"\x9e\x01\n3GetEffectiveEventThreatDetectionCustomModuleRequest\x12g\n\x04name\x18\x01 \x01(\tBY\xe0\x41\x02\xfa\x41S\nQsecuritycentermanagement.googleapis.com/EffectiveEventThreatDetectionCustomModule\"\xb4\x08\n EventThreatDetectionCustomModule\x12\x11\n\x04name\x18\x01 \x01(\tB\x03\xe0\x41\x08\x12,\n\x06\x63onfig\x18\x02 \x01(\x0b\x32\x17.google.protobuf.StructB\x03\xe0\x41\x01\x12i\n\x0f\x61ncestor_module\x18\x03 \x01(\tBP\xe0\x41\x03\xfa\x41J\nHsecuritycentermanagement.googleapis.com/EventThreatDetectionCustomModule\x12y\n\x10\x65nablement_state\x18\x04 \x01(\x0e\x32Z.google.cloud.securitycentermanagement.v1.EventThreatDetectionCustomModule.EnablementStateB\x03\xe0\x41\x01\x12\x11\n\x04type\x18\x05 \x01(\tB\x03\xe0\x41\x01\x12\x19\n\x0c\x64isplay_name\x18\x06 \x01(\tB\x03\xe0\x41\x01\x12\x18\n\x0b\x64\x65scription\x18\x07 \x01(\tB\x03\xe0\x41\x01\x12\x34\n\x0bupdate_time\x18\x08 \x01(\x0b\x32\x1a.google.protobuf.TimestampB\x03\xe0\x41\x03\x12\x18\n\x0blast_editor\x18\t \x01(\tB\x03\xe0\x41\x03\"]\n\x0f\x45nablementState\x12 \n\x1c\x45NABLEMENT_STATE_UNSPECIFIED\x10\x00\x12\x0b\n\x07\x45NABLED\x10\x01\x12\x0c\n\x08\x44ISABLED\x10\x02\x12\r\n\tINHERITED\x10\x03:\xf1\x03\xea\x41\xed\x03\nHsecuritycentermanagement.googleapis.com/EventThreatDetectionCustomModule\x12zorganizations/{organization}/locations/{location}/eventThreatDetectionCustomModules/{event_threat_detection_custom_module}\x12pprojects/{project}/locations/{location}/eventThreatDetectionCustomModules/{event_threat_detection_custom_module}\x12nfolders/{folder}/locations/{location}/eventThreatDetectionCustomModules/{event_threat_detection_custom_module}*!eventThreatDetectionCustomModules2 eventThreatDetectionCustomModule\"\xc1\x01\n,ListEventThreatDetectionCustomModulesRequest\x12`\n\x06parent\x18\x01 \x01(\tBP\xe0\x41\x02\xfa\x41J\x12Hsecuritycentermanagement.googleapis.com/EventThreatDetectionCustomModule\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\"\xc3\x01\n-ListEventThreatDetectionCustomModulesResponse\x12y\n%event_threat_detection_custom_modules\x18\x01 \x03(\x0b\x32J.google.cloud.securitycentermanagement.v1.EventThreatDetectionCustomModule\x12\x17\n\x0fnext_page_token\x18\x02 \x01(\t\"\xcb\x01\n6ListDescendantEventThreatDetectionCustomModulesRequest\x12`\n\x06parent\x18\x01 \x01(\tBP\xe0\x41\x02\xfa\x41J\x12Hsecuritycentermanagement.googleapis.com/EventThreatDetectionCustomModule\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\"\xcd\x01\n7ListDescendantEventThreatDetectionCustomModulesResponse\x12y\n%event_threat_detection_custom_modules\x18\x01 \x03(\x0b\x32J.google.cloud.securitycentermanagement.v1.EventThreatDetectionCustomModule\x12\x17\n\x0fnext_page_token\x18\x02 \x01(\t\"\x8c\x01\n*GetEventThreatDetectionCustomModuleRequest\x12^\n\x04name\x18\x01 \x01(\tBP\xe0\x41\x02\xfa\x41J\nHsecuritycentermanagement.googleapis.com/EventThreatDetectionCustomModule\"\xac\x02\n-CreateEventThreatDetectionCustomModuleRequest\x12`\n\x06parent\x18\x01 \x01(\tBP\xe0\x41\x02\xfa\x41J\x12Hsecuritycentermanagement.googleapis.com/EventThreatDetectionCustomModule\x12}\n$event_threat_detection_custom_module\x18\x03 \x01(\x0b\x32J.google.cloud.securitycentermanagement.v1.EventThreatDetectionCustomModuleB\x03\xe0\x41\x02\x12\x1a\n\rvalidate_only\x18\x04 \x01(\x08\x42\x03\xe0\x41\x01\"\x80\x02\n-UpdateEventThreatDetectionCustomModuleRequest\x12\x34\n\x0bupdate_mask\x18\x01 \x01(\x0b\x32\x1a.google.protobuf.FieldMaskB\x03\xe0\x41\x02\x12}\n$event_threat_detection_custom_module\x18\x02 \x01(\x0b\x32J.google.cloud.securitycentermanagement.v1.EventThreatDetectionCustomModuleB\x03\xe0\x41\x02\x12\x1a\n\rvalidate_only\x18\x03 \x01(\x08\x42\x03\xe0\x41\x01\"\xab\x01\n-DeleteEventThreatDetectionCustomModuleRequest\x12^\n\x04name\x18\x01 \x01(\tBP\xe0\x41\x02\xfa\x41J\nHsecuritycentermanagement.googleapis.com/EventThreatDetectionCustomModule\x12\x1a\n\rvalidate_only\x18\x02 \x01(\x08\x42\x03\xe0\x41\x01\"\xbd\x01\n/ValidateEventThreatDetectionCustomModuleRequest\x12`\n\x06parent\x18\x01 \x01(\tBP\xe0\x41\x02\xfa\x41J\x12Hsecuritycentermanagement.googleapis.com/EventThreatDetectionCustomModule\x12\x15\n\x08raw_text\x18\x02 \x01(\tB\x03\xe0\x41\x02\x12\x11\n\x04type\x18\x03 \x01(\tB\x03\xe0\x41\x02\"\xbe\x04\n0ValidateEventThreatDetectionCustomModuleResponse\x12\x86\x01\n\x06\x65rrors\x18\x02 \x03(\x0b\x32v.google.cloud.securitycentermanagement.v1.ValidateEventThreatDetectionCustomModuleResponse.CustomModuleValidationError\x1a\xc8\x02\n\x1b\x43ustomModuleValidationError\x12\x13\n\x0b\x64\x65scription\x18\x01 \x01(\t\x12\x12\n\nfield_path\x18\x02 \x01(\t\x12w\n\x05start\x18\x03 \x01(\x0b\x32\x63.google.cloud.securitycentermanagement.v1.ValidateEventThreatDetectionCustomModuleResponse.PositionH\x00\x88\x01\x01\x12u\n\x03\x65nd\x18\x04 \x01(\x0b\x32\x63.google.cloud.securitycentermanagement.v1.ValidateEventThreatDetectionCustomModuleResponse.PositionH\x01\x88\x01\x01\x42\x08\n\x06_startB\x06\n\x04_end\x1a\x36\n\x08Position\x12\x13\n\x0bline_number\x18\x01 \x01(\x05\x12\x15\n\rcolumn_number\x18\x02 \x01(\x05\"\x9a\x01\n\x1fGetSecurityCenterServiceRequest\x12S\n\x04name\x18\x01 \x01(\tBE\xe0\x41\x02\xfa\x41?\n=securitycentermanagement.googleapis.com/SecurityCenterService\x12\"\n\x1ashow_eligible_modules_only\x18\x02 \x01(\x08\"\xcf\x01\n!ListSecurityCenterServicesRequest\x12U\n\x06parent\x18\x01 \x01(\tBE\xe0\x41\x02\xfa\x41?\x12=securitycentermanagement.googleapis.com/SecurityCenterService\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\"\n\x1ashow_eligible_modules_only\x18\x04 \x01(\x08\"\xa0\x01\n\"ListSecurityCenterServicesResponse\x12\x61\n\x18security_center_services\x18\x01 \x03(\x0b\x32?.google.cloud.securitycentermanagement.v1.SecurityCenterService\x12\x17\n\x0fnext_page_token\x18\x02 \x01(\t\"\xdd\x01\n\"UpdateSecurityCenterServiceRequest\x12\x65\n\x17security_center_service\x18\x01 \x01(\x0b\x32?.google.cloud.securitycentermanagement.v1.SecurityCenterServiceB\x03\xe0\x41\x02\x12\x34\n\x0bupdate_mask\x18\x02 \x01(\x0b\x32\x1a.google.protobuf.FieldMaskB\x03\xe0\x41\x02\x12\x1a\n\rvalidate_only\x18\x03 \x01(\x08\x42\x03\xe0\x41\x01\x32\xceU\n\x18SecurityCenterManagement\x12\x90\x04\n1ListEffectiveSecurityHealthAnalyticsCustomModules\x12\x62.google.cloud.securitycentermanagement.v1.ListEffectiveSecurityHealthAnalyticsCustomModulesRequest\x1a\x63.google.cloud.securitycentermanagement.v1.ListEffectiveSecurityHealthAnalyticsCustomModulesResponse\"\x91\x02\xda\x41\x06parent\x82\xd3\xe4\x93\x02\x81\x02\x12Q/v1/{parent=projects/*/locations/*}/effectiveSecurityHealthAnalyticsCustomModulesZR\x12P/v1/{parent=folders/*/locations/*}/effectiveSecurityHealthAnalyticsCustomModulesZX\x12V/v1/{parent=organizations/*/locations/*}/effectiveSecurityHealthAnalyticsCustomModules\x12\xfd\x03\n/GetEffectiveSecurityHealthAnalyticsCustomModule\x12`.google.cloud.securitycentermanagement.v1.GetEffectiveSecurityHealthAnalyticsCustomModuleRequest\x1aV.google.cloud.securitycentermanagement.v1.EffectiveSecurityHealthAnalyticsCustomModule\"\x8f\x02\xda\x41\x04name\x82\xd3\xe4\x93\x02\x81\x02\x12Q/v1/{name=projects/*/locations/*/effectiveSecurityHealthAnalyticsCustomModules/*}ZR\x12P/v1/{name=folders/*/locations/*/effectiveSecurityHealthAnalyticsCustomModules/*}ZX\x12V/v1/{name=organizations/*/locations/*/effectiveSecurityHealthAnalyticsCustomModules/*}\x12\xda\x03\n(ListSecurityHealthAnalyticsCustomModules\x12Y.google.cloud.securitycentermanagement.v1.ListSecurityHealthAnalyticsCustomModulesRequest\x1aZ.google.cloud.securitycentermanagement.v1.ListSecurityHealthAnalyticsCustomModulesResponse\"\xf6\x01\xda\x41\x06parent\x82\xd3\xe4\x93\x02\xe6\x01\x12H/v1/{parent=projects/*/locations/*}/securityHealthAnalyticsCustomModulesZI\x12G/v1/{parent=folders/*/locations/*}/securityHealthAnalyticsCustomModulesZO\x12M/v1/{parent=organizations/*/locations/*}/securityHealthAnalyticsCustomModules\x12\xa5\x04\n2ListDescendantSecurityHealthAnalyticsCustomModules\x12\x63.google.cloud.securitycentermanagement.v1.ListDescendantSecurityHealthAnalyticsCustomModulesRequest\x1a\x64.google.cloud.securitycentermanagement.v1.ListDescendantSecurityHealthAnalyticsCustomModulesResponse\"\xa3\x02\xda\x41\x06parent\x82\xd3\xe4\x93\x02\x93\x02\x12W/v1/{parent=projects/*/locations/*}/securityHealthAnalyticsCustomModules:listDescendantZX\x12V/v1/{parent=folders/*/locations/*}/securityHealthAnalyticsCustomModules:listDescendantZ^\x12\\/v1/{parent=organizations/*/locations/*}/securityHealthAnalyticsCustomModules:listDescendant\x12\xc7\x03\n&GetSecurityHealthAnalyticsCustomModule\x12W.google.cloud.securitycentermanagement.v1.GetSecurityHealthAnalyticsCustomModuleRequest\x1aM.google.cloud.securitycentermanagement.v1.SecurityHealthAnalyticsCustomModule\"\xf4\x01\xda\x41\x04name\x82\xd3\xe4\x93\x02\xe6\x01\x12H/v1/{name=projects/*/locations/*/securityHealthAnalyticsCustomModules/*}ZI\x12G/v1/{name=folders/*/locations/*/securityHealthAnalyticsCustomModules/*}ZO\x12M/v1/{name=organizations/*/locations/*/securityHealthAnalyticsCustomModules/*}\x12\xf2\x04\n)CreateSecurityHealthAnalyticsCustomModule\x12Z.google.cloud.securitycentermanagement.v1.CreateSecurityHealthAnalyticsCustomModuleRequest\x1aM.google.cloud.securitycentermanagement.v1.SecurityHealthAnalyticsCustomModule\"\x99\x03\xda\x41.parent,security_health_analytics_custom_module\x82\xd3\xe4\x93\x02\xe1\x02\"H/v1/{parent=projects/*/locations/*}/securityHealthAnalyticsCustomModules:\'security_health_analytics_custom_moduleZr\"G/v1/{parent=folders/*/locations/*}/securityHealthAnalyticsCustomModules:\'security_health_analytics_custom_moduleZx\"M/v1/{parent=organizations/*/locations/*}/securityHealthAnalyticsCustomModules:\'security_health_analytics_custom_module\x12\xf1\x05\n)UpdateSecurityHealthAnalyticsCustomModule\x12Z.google.cloud.securitycentermanagement.v1.UpdateSecurityHealthAnalyticsCustomModuleRequest\x1aM.google.cloud.securitycentermanagement.v1.SecurityHealthAnalyticsCustomModule\"\x98\x04\xda\x41\x33security_health_analytics_custom_module,update_mask\x82\xd3\xe4\x93\x02\xdb\x03\x32p/v1/{security_health_analytics_custom_module.name=projects/*/locations/*/securityHealthAnalyticsCustomModules/*}:\'security_health_analytics_custom_moduleZ\x9a\x01\x32o/v1/{security_health_analytics_custom_module.name=folders/*/locations/*/securityHealthAnalyticsCustomModules/*}:\'security_health_analytics_custom_moduleZ\xa0\x01\x32u/v1/{security_health_analytics_custom_module.name=organizations/*/locations/*/securityHealthAnalyticsCustomModules/*}:\'security_health_analytics_custom_module\x12\x96\x03\n)DeleteSecurityHealthAnalyticsCustomModule\x12Z.google.cloud.securitycentermanagement.v1.DeleteSecurityHealthAnalyticsCustomModuleRequest\x1a\x16.google.protobuf.Empty\"\xf4\x01\xda\x41\x04name\x82\xd3\xe4\x93\x02\xe6\x01*H/v1/{name=projects/*/locations/*/securityHealthAnalyticsCustomModules/*}ZI*G/v1/{name=folders/*/locations/*/securityHealthAnalyticsCustomModules/*}ZO*M/v1/{name=organizations/*/locations/*/securityHealthAnalyticsCustomModules/*}\x12\x9e\x04\n+SimulateSecurityHealthAnalyticsCustomModule\x12\\.google.cloud.securitycentermanagement.v1.SimulateSecurityHealthAnalyticsCustomModuleRequest\x1a].google.cloud.securitycentermanagement.v1.SimulateSecurityHealthAnalyticsCustomModuleResponse\"\xb1\x02\xda\x41\x1dparent,custom_config,resource\x82\xd3\xe4\x93\x02\x8a\x02\"Q/v1/{parent=projects/*/locations/*}/securityHealthAnalyticsCustomModules:simulate:\x01*ZU\"P/v1/{parent=folders/*/locations/*}/securityHealthAnalyticsCustomModules:simulate:\x01*Z[\"V/v1/{parent=organizations/*/locations/*}/securityHealthAnalyticsCustomModules:simulate:\x01*\x12\xfe\x03\n.ListEffectiveEventThreatDetectionCustomModules\x12_.google.cloud.securitycentermanagement.v1.ListEffectiveEventThreatDetectionCustomModulesRequest\x1a`.google.cloud.securitycentermanagement.v1.ListEffectiveEventThreatDetectionCustomModulesResponse\"\x88\x02\xda\x41\x06parent\x82\xd3\xe4\x93\x02\xf8\x01\x12N/v1/{parent=projects/*/locations/*}/effectiveEventThreatDetectionCustomModulesZO\x12M/v1/{parent=folders/*/locations/*}/effectiveEventThreatDetectionCustomModulesZU\x12S/v1/{parent=organizations/*/locations/*}/effectiveEventThreatDetectionCustomModules\x12\xeb\x03\n,GetEffectiveEventThreatDetectionCustomModule\x12].google.cloud.securitycentermanagement.v1.GetEffectiveEventThreatDetectionCustomModuleRequest\x1aS.google.cloud.securitycentermanagement.v1.EffectiveEventThreatDetectionCustomModule\"\x86\x02\xda\x41\x04name\x82\xd3\xe4\x93\x02\xf8\x01\x12N/v1/{name=projects/*/locations/*/effectiveEventThreatDetectionCustomModules/*}ZO\x12M/v1/{name=folders/*/locations/*/effectiveEventThreatDetectionCustomModules/*}ZU\x12S/v1/{name=organizations/*/locations/*/effectiveEventThreatDetectionCustomModules/*}\x12\xc8\x03\n%ListEventThreatDetectionCustomModules\x12V.google.cloud.securitycentermanagement.v1.ListEventThreatDetectionCustomModulesRequest\x1aW.google.cloud.securitycentermanagement.v1.ListEventThreatDetectionCustomModulesResponse\"\xed\x01\xda\x41\x06parent\x82\xd3\xe4\x93\x02\xdd\x01\x12\x45/v1/{parent=projects/*/locations/*}/eventThreatDetectionCustomModulesZF\x12\x44/v1/{parent=folders/*/locations/*}/eventThreatDetectionCustomModulesZL\x12J/v1/{parent=organizations/*/locations/*}/eventThreatDetectionCustomModules\x12\x93\x04\n/ListDescendantEventThreatDetectionCustomModules\x12`.google.cloud.securitycentermanagement.v1.ListDescendantEventThreatDetectionCustomModulesRequest\x1a\x61.google.cloud.securitycentermanagement.v1.ListDescendantEventThreatDetectionCustomModulesResponse\"\x9a\x02\xda\x41\x06parent\x82\xd3\xe4\x93\x02\x8a\x02\x12T/v1/{parent=projects/*/locations/*}/eventThreatDetectionCustomModules:listDescendantZU\x12S/v1/{parent=folders/*/locations/*}/eventThreatDetectionCustomModules:listDescendantZ[\x12Y/v1/{parent=organizations/*/locations/*}/eventThreatDetectionCustomModules:listDescendant\x12\xb5\x03\n#GetEventThreatDetectionCustomModule\x12T.google.cloud.securitycentermanagement.v1.GetEventThreatDetectionCustomModuleRequest\x1aJ.google.cloud.securitycentermanagement.v1.EventThreatDetectionCustomModule\"\xeb\x01\xda\x41\x04name\x82\xd3\xe4\x93\x02\xdd\x01\x12\x45/v1/{name=projects/*/locations/*/eventThreatDetectionCustomModules/*}ZF\x12\x44/v1/{name=folders/*/locations/*/eventThreatDetectionCustomModules/*}ZL\x12J/v1/{name=organizations/*/locations/*/eventThreatDetectionCustomModules/*}\x12\xd4\x04\n&CreateEventThreatDetectionCustomModule\x12W.google.cloud.securitycentermanagement.v1.CreateEventThreatDetectionCustomModuleRequest\x1aJ.google.cloud.securitycentermanagement.v1.EventThreatDetectionCustomModule\"\x84\x03\xda\x41+parent,event_threat_detection_custom_module\x82\xd3\xe4\x93\x02\xcf\x02\"E/v1/{parent=projects/*/locations/*}/eventThreatDetectionCustomModules:$event_threat_detection_custom_moduleZl\"D/v1/{parent=folders/*/locations/*}/eventThreatDetectionCustomModules:$event_threat_detection_custom_moduleZr\"J/v1/{parent=organizations/*/locations/*}/eventThreatDetectionCustomModules:$event_threat_detection_custom_module\x12\xca\x05\n&UpdateEventThreatDetectionCustomModule\x12W.google.cloud.securitycentermanagement.v1.UpdateEventThreatDetectionCustomModuleRequest\x1aJ.google.cloud.securitycentermanagement.v1.EventThreatDetectionCustomModule\"\xfa\x03\xda\x41\x30\x65vent_threat_detection_custom_module,update_mask\x82\xd3\xe4\x93\x02\xc0\x03\x32j/v1/{event_threat_detection_custom_module.name=projects/*/locations/*/eventThreatDetectionCustomModules/*}:$event_threat_detection_custom_moduleZ\x91\x01\x32i/v1/{event_threat_detection_custom_module.name=folders/*/locations/*/eventThreatDetectionCustomModules/*}:$event_threat_detection_custom_moduleZ\x97\x01\x32o/v1/{event_threat_detection_custom_module.name=organizations/*/locations/*/eventThreatDetectionCustomModules/*}:$event_threat_detection_custom_module\x12\x87\x03\n&DeleteEventThreatDetectionCustomModule\x12W.google.cloud.securitycentermanagement.v1.DeleteEventThreatDetectionCustomModuleRequest\x1a\x16.google.protobuf.Empty\"\xeb\x01\xda\x41\x04name\x82\xd3\xe4\x93\x02\xdd\x01*E/v1/{name=projects/*/locations/*/eventThreatDetectionCustomModules/*}ZF*D/v1/{name=folders/*/locations/*/eventThreatDetectionCustomModules/*}ZL*J/v1/{name=organizations/*/locations/*/eventThreatDetectionCustomModules/*}\x12\xec\x03\n(ValidateEventThreatDetectionCustomModule\x12Y.google.cloud.securitycentermanagement.v1.ValidateEventThreatDetectionCustomModuleRequest\x1aZ.google.cloud.securitycentermanagement.v1.ValidateEventThreatDetectionCustomModuleResponse\"\x88\x02\x82\xd3\xe4\x93\x02\x81\x02\"N/v1/{parent=projects/*/locations/*}/eventThreatDetectionCustomModules:validate:\x01*ZR\"M/v1/{parent=folders/*/locations/*}/eventThreatDetectionCustomModules:validate:\x01*ZX\"S/v1/{parent=organizations/*/locations/*}/eventThreatDetectionCustomModules:validate:\x01*\x12\xf3\x02\n\x18GetSecurityCenterService\x12I.google.cloud.securitycentermanagement.v1.GetSecurityCenterServiceRequest\x1a?.google.cloud.securitycentermanagement.v1.SecurityCenterService\"\xca\x01\xda\x41\x04name\x82\xd3\xe4\x93\x02\xbc\x01\x12:/v1/{name=projects/*/locations/*/securityCenterServices/*}Z;\x12\x39/v1/{name=folders/*/locations/*/securityCenterServices/*}ZA\x12?/v1/{name=organizations/*/locations/*/securityCenterServices/*}\x12\x86\x03\n\x1aListSecurityCenterServices\x12K.google.cloud.securitycentermanagement.v1.ListSecurityCenterServicesRequest\x1aL.google.cloud.securitycentermanagement.v1.ListSecurityCenterServicesResponse\"\xcc\x01\xda\x41\x06parent\x82\xd3\xe4\x93\x02\xbc\x01\x12:/v1/{parent=projects/*/locations/*}/securityCenterServicesZ;\x12\x39/v1/{parent=folders/*/locations/*}/securityCenterServicesZA\x12?/v1/{parent=organizations/*/locations/*}/securityCenterServices\x12\xab\x04\n\x1bUpdateSecurityCenterService\x12L.google.cloud.securitycentermanagement.v1.UpdateSecurityCenterServiceRequest\x1a?.google.cloud.securitycentermanagement.v1.SecurityCenterService\"\xfc\x02\xda\x41#security_center_service,update_mask\x82\xd3\xe4\x93\x02\xcf\x02\x32R/v1/{security_center_service.name=projects/*/locations/*/securityCenterServices/*}:\x17security_center_serviceZl2Q/v1/{security_center_service.name=folders/*/locations/*/securityCenterServices/*}:\x17security_center_serviceZr2W/v1/{security_center_service.name=organizations/*/locations/*/securityCenterServices/*}:\x17security_center_service\x1a[\xca\x41\'securitycentermanagement.googleapis.com\xd2\x41.https://www.googleapis.com/auth/cloud-platformB\x93\x04\n,com.google.cloud.securitycentermanagement.v1B\x1dSecurityCenterManagementProtoP\x01Zhcloud.google.com/go/securitycentermanagement/apiv1/securitycentermanagementpb;securitycentermanagementpb\xaa\x02(Google.Cloud.SecurityCenterManagement.V1\xca\x02(Google\\Cloud\\SecurityCenterManagement\\V1\xea\x02+Google::Cloud::SecurityCenterManagement::V1\xea\x41q\n] - # The destination where API teams want this client library to be published. - # @!attribute [rw] selective_gapic_generation - # @return [::Google::Api::SelectiveGapicGeneration] - # Configuration for which RPCs should be generated in the GAPIC client. - class CommonLanguageSettings - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Details about how and where to publish client libraries. - # @!attribute [rw] version - # @return [::String] - # Version of the API to apply these settings to. This is the full protobuf - # package for the API, ending in the version element. - # Examples: "google.cloud.speech.v1" and "google.spanner.admin.database.v1". - # @!attribute [rw] launch_stage - # @return [::Google::Api::LaunchStage] - # Launch stage of this version of the API. - # @!attribute [rw] rest_numeric_enums - # @return [::Boolean] - # When using transport=rest, the client request will encode enums as - # numbers rather than strings. - # @!attribute [rw] java_settings - # @return [::Google::Api::JavaSettings] - # Settings for legacy Java features, supported in the Service YAML. - # @!attribute [rw] cpp_settings - # @return [::Google::Api::CppSettings] - # Settings for C++ client libraries. - # @!attribute [rw] php_settings - # @return [::Google::Api::PhpSettings] - # Settings for PHP client libraries. - # @!attribute [rw] python_settings - # @return [::Google::Api::PythonSettings] - # Settings for Python client libraries. - # @!attribute [rw] node_settings - # @return [::Google::Api::NodeSettings] - # Settings for Node client libraries. - # @!attribute [rw] dotnet_settings - # @return [::Google::Api::DotnetSettings] - # Settings for .NET client libraries. - # @!attribute [rw] ruby_settings - # @return [::Google::Api::RubySettings] - # Settings for Ruby client libraries. - # @!attribute [rw] go_settings - # @return [::Google::Api::GoSettings] - # Settings for Go client libraries. - class ClientLibrarySettings - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # This message configures the settings for publishing [Google Cloud Client - # libraries](https://cloud.google.com/apis/docs/cloud-client-libraries) - # generated from the service config. - # @!attribute [rw] method_settings - # @return [::Array<::Google::Api::MethodSettings>] - # A list of API method settings, e.g. the behavior for methods that use the - # long-running operation pattern. - # @!attribute [rw] new_issue_uri - # @return [::String] - # Link to a *public* URI where users can report issues. Example: - # https://issuetracker.google.com/issues/new?component=190865&template=1161103 - # @!attribute [rw] documentation_uri - # @return [::String] - # Link to product home page. Example: - # https://cloud.google.com/asset-inventory/docs/overview - # @!attribute [rw] api_short_name - # @return [::String] - # Used as a tracking tag when collecting data about the APIs developer - # relations artifacts like docs, packages delivered to package managers, - # etc. Example: "speech". - # @!attribute [rw] github_label - # @return [::String] - # GitHub label to apply to issues and pull requests opened for this API. - # @!attribute [rw] codeowner_github_teams - # @return [::Array<::String>] - # GitHub teams to be added to CODEOWNERS in the directory in GitHub - # containing source code for the client libraries for this API. - # @!attribute [rw] doc_tag_prefix - # @return [::String] - # A prefix used in sample code when demarking regions to be included in - # documentation. - # @!attribute [rw] organization - # @return [::Google::Api::ClientLibraryOrganization] - # For whom the client library is being published. - # @!attribute [rw] library_settings - # @return [::Array<::Google::Api::ClientLibrarySettings>] - # Client library settings. If the same version string appears multiple - # times in this list, then the last one wins. Settings from earlier - # settings with the same version string are discarded. - # @!attribute [rw] proto_reference_documentation_uri - # @return [::String] - # Optional link to proto reference documentation. Example: - # https://cloud.google.com/pubsub/lite/docs/reference/rpc - # @!attribute [rw] rest_reference_documentation_uri - # @return [::String] - # Optional link to REST reference documentation. Example: - # https://cloud.google.com/pubsub/lite/docs/reference/rest - class Publishing - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Settings for Java client libraries. - # @!attribute [rw] library_package - # @return [::String] - # The package name to use in Java. Clobbers the java_package option - # set in the protobuf. This should be used **only** by APIs - # who have already set the language_settings.java.package_name" field - # in gapic.yaml. API teams should use the protobuf java_package option - # where possible. - # - # Example of a YAML configuration:: - # - # publishing: - # 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. - # @!attribute [rw] methods - # @return [::Array<::String>] - # An allowlist of the fully qualified names of RPCs that should be included - # on public client surfaces. - # @!attribute [rw] generate_omitted_as_internal - # @return [::Boolean] - # Setting this to true indicates to the client generators that methods - # that would be excluded from the generation should instead be generated - # in a way that indicates these methods should not be consumed by - # end users. How this is expressed is up to individual language - # implementations to decide. Some examples may be: added annotations, - # obfuscated identifiers, or other language idiomatic patterns. - class SelectiveGapicGeneration - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # `BatchingConfigProto` defines the batching configuration for an API method. - # @!attribute [rw] thresholds - # @return [::Google::Api::BatchingSettingsProto] - # The thresholds which trigger a batched request to be sent. - # @!attribute [rw] batch_descriptor - # @return [::Google::Api::BatchingDescriptorProto] - # The request and response fields used in batching. - class BatchingConfigProto - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # `BatchingSettingsProto` specifies a set of batching thresholds, each of - # which acts as a trigger to send a batch of messages as a request. At least - # one threshold must be positive nonzero. - # @!attribute [rw] element_count_threshold - # @return [::Integer] - # The number of elements of a field collected into a batch which, if - # exceeded, causes the batch to be sent. - # @!attribute [rw] request_byte_threshold - # @return [::Integer] - # The aggregated size of the batched field which, if exceeded, causes the - # batch to be sent. This size is computed by aggregating the sizes of the - # request field to be batched, not of the entire request message. - # @!attribute [rw] delay_threshold - # @return [::Google::Protobuf::Duration] - # The duration after which a batch should be sent, starting from the addition - # of the first message to that batch. - # @!attribute [rw] element_count_limit - # @return [::Integer] - # The maximum number of elements collected in a batch that could be accepted - # by server. - # @!attribute [rw] request_byte_limit - # @return [::Integer] - # The maximum size of the request that could be accepted by server. - # @!attribute [rw] flow_control_element_limit - # @return [::Integer] - # The maximum number of elements allowed by flow control. - # @!attribute [rw] flow_control_byte_limit - # @return [::Integer] - # The maximum size of data allowed by flow control. - # @!attribute [rw] flow_control_limit_exceeded_behavior - # @return [::Google::Api::FlowControlLimitExceededBehaviorProto] - # The behavior to take when the flow control limit is exceeded. - class BatchingSettingsProto - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # `BatchingDescriptorProto` specifies the fields of the request message to be - # used for batching, and, optionally, the fields of the response message to be - # used for demultiplexing. - # @!attribute [rw] batched_field - # @return [::String] - # The repeated field in the request message to be aggregated by batching. - # @!attribute [rw] discriminator_fields - # @return [::Array<::String>] - # A list of the fields in the request message. Two requests will be batched - # together only if the values of every field specified in - # `request_discriminator_fields` is equal between the two requests. - # @!attribute [rw] subresponse_field - # @return [::String] - # Optional. When present, indicates the field in the response message to be - # used to demultiplex the response into multiple response messages, in - # correspondence with the multiple request messages originally batched - # together. - class BatchingDescriptorProto - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # The organization for which the client libraries are being published. - # Affects the url where generated docs are published, etc. - module ClientLibraryOrganization - # Not useful. - CLIENT_LIBRARY_ORGANIZATION_UNSPECIFIED = 0 - - # Google Cloud Platform Org. - CLOUD = 1 - - # Ads (Advertising) Org. - ADS = 2 - - # Photos Org. - PHOTOS = 3 - - # Street View Org. - STREET_VIEW = 4 - - # Shopping Org. - SHOPPING = 5 - - # Geo Org. - GEO = 6 - - # Generative AI - https://developers.generativeai.google - GENERATIVE_AI = 7 - end - - # To where should client libraries be published? - module ClientLibraryDestination - # Client libraries will neither be generated nor published to package - # managers. - CLIENT_LIBRARY_DESTINATION_UNSPECIFIED = 0 - - # Generate the client library in a repo under github.com/googleapis, - # but don't publish it to package managers. - GITHUB = 10 - - # Publish the library to package managers like nuget.org and npmjs.com. - PACKAGE_MANAGER = 20 - end - - # The behavior to take when the flow control limit is exceeded. - module FlowControlLimitExceededBehaviorProto - # Default behavior, system-defined. - UNSET_BEHAVIOR = 0 - - # Stop operation, raise error. - THROW_EXCEPTION = 1 - - # Pause operation until limit clears. - BLOCK = 2 - - # Continue operation, disregard limit. - IGNORE = 3 - end - end -end diff --git a/owl-bot-staging/google-cloud-security_center_management-v1/proto_docs/google/api/field_behavior.rb b/owl-bot-staging/google-cloud-security_center_management-v1/proto_docs/google/api/field_behavior.rb deleted file mode 100644 index 582be187d115..000000000000 --- a/owl-bot-staging/google-cloud-security_center_management-v1/proto_docs/google/api/field_behavior.rb +++ /dev/null @@ -1,85 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - - -module Google - module Api - # An indicator of the behavior of a given field (for example, that a field - # is required in requests, or given as output but ignored as input). - # This **does not** change the behavior in protocol buffers itself; it only - # denotes the behavior and may affect how API tooling handles the field. - # - # Note: This enum **may** receive new values in the future. - module FieldBehavior - # Conventional default for enums. Do not use this. - FIELD_BEHAVIOR_UNSPECIFIED = 0 - - # Specifically denotes a field as optional. - # While all fields in protocol buffers are optional, this may be specified - # for emphasis if appropriate. - OPTIONAL = 1 - - # Denotes a field as required. - # This indicates that the field **must** be provided as part of the request, - # and failure to do so will cause an error (usually `INVALID_ARGUMENT`). - REQUIRED = 2 - - # Denotes a field as output only. - # This indicates that the field is provided in responses, but including the - # field in a request does nothing (the server *must* ignore it and - # *must not* throw an error as a result of the field's presence). - OUTPUT_ONLY = 3 - - # Denotes a field as input only. - # This indicates that the field is provided in requests, and the - # corresponding field is not included in output. - INPUT_ONLY = 4 - - # Denotes a field as immutable. - # This indicates that the field may be set once in a request to create a - # resource, but may not be changed thereafter. - IMMUTABLE = 5 - - # Denotes that a (repeated) field is an unordered list. - # This indicates that the service may provide the elements of the list - # in any arbitrary order, rather than the order the user originally - # provided. Additionally, the list's order may or may not be stable. - UNORDERED_LIST = 6 - - # Denotes that this field returns a non-empty default value if not set. - # This indicates that if the user provides the empty value in a request, - # a non-empty value will be returned. The user will not be aware of what - # non-empty value to expect. - NON_EMPTY_DEFAULT = 7 - - # Denotes that the field in a resource (a message annotated with - # google.api.resource) is used in the resource name to uniquely identify the - # resource. For AIP-compliant APIs, this should only be applied to the - # `name` field on the resource. - # - # This behavior should not be applied to references to other resources within - # the message. - # - # The identifier field of resources often have different field behavior - # depending on the request it is embedded in (e.g. for Create methods name - # is optional and unused, while for Update methods it is required). Instead - # of method-specific annotations, only `IDENTIFIER` is required. - IDENTIFIER = 8 - end - end -end diff --git a/owl-bot-staging/google-cloud-security_center_management-v1/proto_docs/google/api/launch_stage.rb b/owl-bot-staging/google-cloud-security_center_management-v1/proto_docs/google/api/launch_stage.rb deleted file mode 100644 index 9392a413fb1b..000000000000 --- a/owl-bot-staging/google-cloud-security_center_management-v1/proto_docs/google/api/launch_stage.rb +++ /dev/null @@ -1,71 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - - -module Google - module Api - # The launch stage as defined by [Google Cloud Platform - # Launch Stages](https://cloud.google.com/terms/launch-stages). - module LaunchStage - # Do not use this default value. - LAUNCH_STAGE_UNSPECIFIED = 0 - - # The feature is not yet implemented. Users can not use it. - UNIMPLEMENTED = 6 - - # Prelaunch features are hidden from users and are only visible internally. - PRELAUNCH = 7 - - # Early Access features are limited to a closed group of testers. To use - # these features, you must sign up in advance and sign a Trusted Tester - # agreement (which includes confidentiality provisions). These features may - # be unstable, changed in backward-incompatible ways, and are not - # guaranteed to be released. - EARLY_ACCESS = 1 - - # Alpha is a limited availability test for releases before they are cleared - # for widespread use. By Alpha, all significant design issues are resolved - # and we are in the process of verifying functionality. Alpha customers - # need to apply for access, agree to applicable terms, and have their - # projects allowlisted. Alpha releases don't have to be feature complete, - # no SLAs are provided, and there are no technical support obligations, but - # they will be far enough along that customers can actually use them in - # test environments or for limited-use tests -- just like they would in - # normal production cases. - ALPHA = 2 - - # Beta is the point at which we are ready to open a release for any - # customer to use. There are no SLA or technical support obligations in a - # Beta release. Products will be complete from a feature perspective, but - # may have some open outstanding issues. Beta releases are suitable for - # limited production use cases. - BETA = 3 - - # GA features are open to all developers and are considered stable and - # fully qualified for production use. - GA = 4 - - # Deprecated features are scheduled to be shut down and removed. For more - # information, see the "Deprecation Policy" section of our [Terms of - # Service](https://cloud.google.com/terms/) - # and the [Google Cloud Platform Subject to the Deprecation - # Policy](https://cloud.google.com/terms/deprecation) documentation. - DEPRECATED = 5 - end - end -end diff --git a/owl-bot-staging/google-cloud-security_center_management-v1/proto_docs/google/api/resource.rb b/owl-bot-staging/google-cloud-security_center_management-v1/proto_docs/google/api/resource.rb deleted file mode 100644 index 25dec4847ac1..000000000000 --- a/owl-bot-staging/google-cloud-security_center_management-v1/proto_docs/google/api/resource.rb +++ /dev/null @@ -1,227 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - - -module Google - module Api - # A simple descriptor of a resource type. - # - # ResourceDescriptor annotates a resource message (either by means of a - # protobuf annotation or use in the service config), and associates the - # resource's schema, the resource type, and the pattern of the resource name. - # - # Example: - # - # message Topic { - # // Indicates this message defines a resource schema. - # // Declares the resource type in the format of {service}/{kind}. - # // For Kubernetes resources, the format is {api group}/{kind}. - # option (google.api.resource) = { - # type: "pubsub.googleapis.com/Topic" - # pattern: "projects/{project}/topics/{topic}" - # }; - # } - # - # The ResourceDescriptor Yaml config will look like: - # - # resources: - # - type: "pubsub.googleapis.com/Topic" - # pattern: "projects/{project}/topics/{topic}" - # - # Sometimes, resources have multiple patterns, typically because they can - # live under multiple parents. - # - # Example: - # - # message LogEntry { - # option (google.api.resource) = { - # type: "logging.googleapis.com/LogEntry" - # pattern: "projects/{project}/logs/{log}" - # pattern: "folders/{folder}/logs/{log}" - # pattern: "organizations/{organization}/logs/{log}" - # pattern: "billingAccounts/{billing_account}/logs/{log}" - # }; - # } - # - # The ResourceDescriptor Yaml config will look like: - # - # resources: - # - type: 'logging.googleapis.com/LogEntry' - # pattern: "projects/{project}/logs/{log}" - # pattern: "folders/{folder}/logs/{log}" - # pattern: "organizations/{organization}/logs/{log}" - # pattern: "billingAccounts/{billing_account}/logs/{log}" - # @!attribute [rw] type - # @return [::String] - # The resource type. It must be in the format of - # \\{service_name}/\\{resource_type_kind}. The `resource_type_kind` must be - # singular and must not include version numbers. - # - # Example: `storage.googleapis.com/Bucket` - # - # The value of the resource_type_kind must follow the regular expression - # /[A-Za-z][a-zA-Z0-9]+/. It should start with an upper case character and - # should use PascalCase (UpperCamelCase). The maximum number of - # characters allowed for the `resource_type_kind` is 100. - # @!attribute [rw] pattern - # @return [::Array<::String>] - # Optional. The relative resource name pattern associated with this resource - # type. The DNS prefix of the full resource name shouldn't be specified here. - # - # The path pattern must follow the syntax, which aligns with HTTP binding - # syntax: - # - # Template = Segment { "/" Segment } ; - # Segment = LITERAL | Variable ; - # Variable = "{" LITERAL "}" ; - # - # Examples: - # - # - "projects/\\{project}/topics/\\{topic}" - # - "projects/\\{project}/knowledgeBases/\\{knowledge_base}" - # - # The components in braces correspond to the IDs for each resource in the - # hierarchy. It is expected that, if multiple patterns are provided, - # the same component name (e.g. "project") refers to IDs of the same - # type of resource. - # @!attribute [rw] name_field - # @return [::String] - # Optional. The field on the resource that designates the resource name - # field. If omitted, this is assumed to be "name". - # @!attribute [rw] history - # @return [::Google::Api::ResourceDescriptor::History] - # Optional. The historical or future-looking state of the resource pattern. - # - # Example: - # - # // The InspectTemplate message originally only supported resource - # // names with organization, and project was added later. - # message InspectTemplate { - # option (google.api.resource) = { - # type: "dlp.googleapis.com/InspectTemplate" - # pattern: - # "organizations/{organization}/inspectTemplates/{inspect_template}" - # pattern: "projects/{project}/inspectTemplates/{inspect_template}" - # history: ORIGINALLY_SINGLE_PATTERN - # }; - # } - # @!attribute [rw] plural - # @return [::String] - # The plural name used in the resource name and permission names, such as - # 'projects' for the resource name of 'projects/\\{project}' and the permission - # name of 'cloudresourcemanager.googleapis.com/projects.get'. One exception - # to this is for Nested Collections that have stuttering names, as defined - # in [AIP-122](https://google.aip.dev/122#nested-collections), where the - # collection ID in the resource name pattern does not necessarily directly - # match the `plural` value. - # - # It is the same concept of the `plural` field in k8s CRD spec - # https://kubernetes.io/docs/tasks/access-kubernetes-api/custom-resources/custom-resource-definitions/ - # - # Note: The plural form is required even for singleton resources. See - # https://aip.dev/156 - # @!attribute [rw] singular - # @return [::String] - # The same concept of the `singular` field in k8s CRD spec - # https://kubernetes.io/docs/tasks/access-kubernetes-api/custom-resources/custom-resource-definitions/ - # Such as "project" for the `resourcemanager.googleapis.com/Project` type. - # @!attribute [rw] style - # @return [::Array<::Google::Api::ResourceDescriptor::Style>] - # Style flag(s) for this resource. - # These indicate that a resource is expected to conform to a given - # style. See the specific style flags for additional information. - class ResourceDescriptor - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - - # A description of the historical or future-looking state of the - # resource pattern. - module History - # The "unset" value. - HISTORY_UNSPECIFIED = 0 - - # The resource originally had one pattern and launched as such, and - # additional patterns were added later. - ORIGINALLY_SINGLE_PATTERN = 1 - - # The resource has one pattern, but the API owner expects to add more - # later. (This is the inverse of ORIGINALLY_SINGLE_PATTERN, and prevents - # that from being necessary once there are multiple patterns.) - FUTURE_MULTI_PATTERN = 2 - end - - # A flag representing a specific style that a resource claims to conform to. - module Style - # The unspecified value. Do not use. - STYLE_UNSPECIFIED = 0 - - # This resource is intended to be "declarative-friendly". - # - # Declarative-friendly resources must be more strictly consistent, and - # setting this to true communicates to tools that this resource should - # adhere to declarative-friendly expectations. - # - # Note: This is used by the API linter (linter.aip.dev) to enable - # additional checks. - DECLARATIVE_FRIENDLY = 1 - end - end - - # Defines a proto annotation that describes a string field that refers to - # an API resource. - # @!attribute [rw] type - # @return [::String] - # The resource type that the annotated field references. - # - # Example: - # - # message Subscription { - # string topic = 2 [(google.api.resource_reference) = { - # type: "pubsub.googleapis.com/Topic" - # }]; - # } - # - # Occasionally, a field may reference an arbitrary resource. In this case, - # APIs use the special value * in their resource reference. - # - # Example: - # - # message GetIamPolicyRequest { - # string resource = 2 [(google.api.resource_reference) = { - # type: "*" - # }]; - # } - # @!attribute [rw] child_type - # @return [::String] - # The resource type of a child collection that the annotated field - # references. This is useful for annotating the `parent` field that - # doesn't have a fixed resource type. - # - # Example: - # - # message ListLogEntriesRequest { - # string parent = 1 [(google.api.resource_reference) = { - # child_type: "logging.googleapis.com/LogEntry" - # }; - # } - class ResourceReference - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - end -end diff --git a/owl-bot-staging/google-cloud-security_center_management-v1/proto_docs/google/cloud/securitycentermanagement/v1/security_center_management.rb b/owl-bot-staging/google-cloud-security_center_management-v1/proto_docs/google/cloud/securitycentermanagement/v1/security_center_management.rb deleted file mode 100644 index b9f8a419f0dc..000000000000 --- a/owl-bot-staging/google-cloud-security_center_management-v1/proto_docs/google/cloud/securitycentermanagement/v1/security_center_management.rb +++ /dev/null @@ -1,1334 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - - -module Google - module Cloud - module SecurityCenterManagement - module V1 - # Represents a particular Security Command Center service. This includes - # settings information such as top-level enablement in addition to individual - # module settings. Service settings can be configured at the organization, - # folder, or project level. Service settings at the organization or folder - # level are inherited by those in descendant folders and projects. - # @!attribute [rw] name - # @return [::String] - # Identifier. The name of the service, in one of the following formats: - # - # * `organizations/{organization}/locations/{location}/securityCenterServices/{service}` - # * `folders/{folder}/locations/{location}/securityCenterServices/{service}` - # * `projects/{project}/locations/{location}/securityCenterServices/{service}` - # - # The following values are valid for `{service}`: - # - # * `container-threat-detection` - # * `event-threat-detection` - # * `security-health-analytics` - # * `vm-threat-detection` - # * `web-security-scanner` - # @!attribute [rw] intended_enablement_state - # @return [::Google::Cloud::SecurityCenterManagement::V1::SecurityCenterService::EnablementState] - # Optional. The intended enablement state for the service at its level of the - # resource hierarchy. A `DISABLED` state will override all module enablement - # states to `DISABLED`. - # @!attribute [r] effective_enablement_state - # @return [::Google::Cloud::SecurityCenterManagement::V1::SecurityCenterService::EnablementState] - # Output only. The effective enablement state for the service at its level of - # the resource hierarchy. If the intended state is set to `INHERITED`, the - # effective state will be inherited from the enablement state of an ancestor. - # This state may differ from the intended enablement state due to billing - # eligibility or onboarding status. - # @!attribute [rw] modules - # @return [::Google::Protobuf::Map{::String => ::Google::Cloud::SecurityCenterManagement::V1::SecurityCenterService::ModuleSettings}] - # Optional. The module configurations, including the enablement state for the - # service's modules. The absence of a module in the map implies that its - # configuration is inherited from its parents. - # @!attribute [r] update_time - # @return [::Google::Protobuf::Timestamp] - # Output only. The time the service was last updated. This could be due to an - # explicit user update or due to a side effect of another system change, such - # as billing subscription expiry. - # @!attribute [rw] service_config - # @return [::Google::Protobuf::Struct] - # Optional. Additional service-specific configuration. Not all services will - # utilize this field. - class SecurityCenterService - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - - # The settings for individual modules. - # @!attribute [rw] intended_enablement_state - # @return [::Google::Cloud::SecurityCenterManagement::V1::SecurityCenterService::EnablementState] - # Optional. The intended enablement state for the module at its level of - # the resource hierarchy. - # @!attribute [r] effective_enablement_state - # @return [::Google::Cloud::SecurityCenterManagement::V1::SecurityCenterService::EnablementState] - # Output only. The effective enablement state for the module at its level - # of the resource hierarchy. If the intended state is set to `INHERITED`, - # the effective state will be inherited from the enablement state of an - # ancestor. This state may differ from the intended enablement state due to - # billing eligibility or onboarding status. - class ModuleSettings - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # @!attribute [rw] key - # @return [::String] - # @!attribute [rw] value - # @return [::Google::Cloud::SecurityCenterManagement::V1::SecurityCenterService::ModuleSettings] - class ModulesEntry - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Represents the possible enablement states for a service or module. - module EnablementState - # Default value. This value is unused. - ENABLEMENT_STATE_UNSPECIFIED = 0 - - # State is inherited from the parent resource. Valid as an intended - # enablement state, but not as an effective enablement state. - INHERITED = 1 - - # State is enabled. - ENABLED = 2 - - # State is disabled. - DISABLED = 3 - - # Security Command Center is configured to ingest findings from this - # service, but not to enable this service. This state indicates that - # Security Command Center is misconfigured. You can't set this state - # yourself. - INGEST_ONLY = 4 - end - end - - # The representation of a Security Health Analytics custom module at a - # specified level of the resource hierarchy: organization, folder, or project. - # If a custom module is inherited from an ancestor organization or folder, then - # the enablement state is set to the value that is effective in the parent, not - # to `INHERITED`. For example, if the module is enabled in an organization or - # folder, then the effective enablement state for the module is `ENABLED` in - # all descendant folders or projects. - # @!attribute [rw] name - # @return [::String] - # Identifier. The full resource name of the custom module, in one of the - # following formats: - # - # * `organizations/organization/{location}/effectiveSecurityHealthAnalyticsCustomModules/{custom_module}` - # * `folders/folder/{location}/effectiveSecurityHealthAnalyticsCustomModules/{custom_module}` - # * `projects/project/{location}/effectiveSecurityHealthAnalyticsCustomModules/{custom_module}` - # @!attribute [r] custom_config - # @return [::Google::Cloud::SecurityCenterManagement::V1::CustomConfig] - # Output only. The user-specified configuration for the module. - # @!attribute [r] enablement_state - # @return [::Google::Cloud::SecurityCenterManagement::V1::EffectiveSecurityHealthAnalyticsCustomModule::EnablementState] - # Output only. The effective enablement state for the module at the given - # level of the hierarchy. - # @!attribute [r] display_name - # @return [::String] - # Output only. The display name for the custom module. The name must be - # between 1 and 128 characters, start with a lowercase letter, and contain - # alphanumeric characters or underscores only. - class EffectiveSecurityHealthAnalyticsCustomModule - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - - # The enablement state of the module. - module EnablementState - # Default value. This value is unused. - ENABLEMENT_STATE_UNSPECIFIED = 0 - - # The module is enabled at the given level. - ENABLED = 1 - - # The module is disabled at the given level. - DISABLED = 2 - end - end - - # Request message for - # {::Google::Cloud::SecurityCenterManagement::V1::SecurityCenterManagement::Client#list_effective_security_health_analytics_custom_modules SecurityCenterManagement.ListEffectiveSecurityHealthAnalyticsCustomModules}. - # @!attribute [rw] parent - # @return [::String] - # Required. Name of parent to list effective custom modules, in one of the - # following formats: - # - # * `organizations/{organization}/locations/{location}` - # * `folders/{folder}/locations/{location}` - # * `projects/{project}/locations/{location}` - # @!attribute [rw] page_size - # @return [::Integer] - # Optional. The maximum number of results to return in a single response. - # Default is 10, minimum is 1, maximum is 1000. - # @!attribute [rw] page_token - # @return [::String] - # Optional. A pagination token returned from a previous request. Provide this - # token to retrieve the next page of results. - # - # When paginating, the rest of the request must match the request that - # generated the page token. - class ListEffectiveSecurityHealthAnalyticsCustomModulesRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Response message for - # {::Google::Cloud::SecurityCenterManagement::V1::SecurityCenterManagement::Client#list_effective_security_health_analytics_custom_modules SecurityCenterManagement.ListEffectiveSecurityHealthAnalyticsCustomModules}. - # @!attribute [rw] effective_security_health_analytics_custom_modules - # @return [::Array<::Google::Cloud::SecurityCenterManagement::V1::EffectiveSecurityHealthAnalyticsCustomModule>] - # The list of effective Security Health Analytics custom modules. - # @!attribute [rw] next_page_token - # @return [::String] - # A pagination token. To retrieve the next page of results, call the method - # again with this token. - class ListEffectiveSecurityHealthAnalyticsCustomModulesResponse - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Request message for - # {::Google::Cloud::SecurityCenterManagement::V1::SecurityCenterManagement::Client#get_effective_security_health_analytics_custom_module SecurityCenterManagement.GetEffectiveSecurityHealthAnalyticsCustomModule}. - # @!attribute [rw] name - # @return [::String] - # Required. The full resource name of the custom module, specified in one of - # the following formats: - # - # * `organizations/organization/{location}/effectiveSecurityHealthAnalyticsCustomModules/{custom_module}` - # * `folders/folder/{location}/effectiveSecurityHealthAnalyticsCustomModules/{custom_module}` - # * `projects/project/{location}/effectiveSecurityHealthAnalyticsCustomModules/{custom_module}` - class GetEffectiveSecurityHealthAnalyticsCustomModuleRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Represents an instance of a Security Health Analytics custom module, - # including its full module name, display name, enablement state, and last - # updated time. You can create a custom module at the organization, folder, or - # project level. Custom modules that you create at the organization or folder - # level are inherited by the descendant folders and projects. - # @!attribute [rw] name - # @return [::String] - # Identifier. The full resource name of the custom module, in one of the - # following formats: - # - # * `organizations/{organization}/locations/{location}/securityHealthAnalyticsCustomModules/{custom_module}` - # * `folders/{folder}/locations/{location}/securityHealthAnalyticsCustomModules/{custom_module}` - # * `projects/{project}/locations/{location}/securityHealthAnalyticsCustomModules/{custom_module}` - # @!attribute [rw] display_name - # @return [::String] - # Optional. The display name of the Security Health Analytics custom module. - # This display name becomes the finding category for all findings that are - # returned by this custom module. The display name must be between 1 and 128 - # characters, start with a lowercase letter, and contain alphanumeric - # characters or underscores only. - # @!attribute [rw] enablement_state - # @return [::Google::Cloud::SecurityCenterManagement::V1::SecurityHealthAnalyticsCustomModule::EnablementState] - # Optional. The enablement state of the custom module. - # @!attribute [r] update_time - # @return [::Google::Protobuf::Timestamp] - # Output only. The time at which the custom module was last updated. - # @!attribute [r] last_editor - # @return [::String] - # Output only. The editor that last updated the custom module. - # @!attribute [r] ancestor_module - # @return [::String] - # Output only. Specifies the organization or folder from which the custom - # module is inherited. If empty, indicates that the custom module was created - # in the organization, folder, or project in which you are viewing the custom - # module. - # @!attribute [rw] custom_config - # @return [::Google::Cloud::SecurityCenterManagement::V1::CustomConfig] - # Optional. The user-specified custom configuration for the module. - class SecurityHealthAnalyticsCustomModule - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - - # Possible enablement states of a custom module. - module EnablementState - # Default value. This value is unused. - ENABLEMENT_STATE_UNSPECIFIED = 0 - - # The module is enabled at the given organization, folder, or project. - ENABLED = 1 - - # The module is disabled at the given organization, folder, or project. - DISABLED = 2 - - # State is inherited from an ancestor module. The module will either - # be effectively `ENABLED` or `DISABLED` based on its closest non-inherited - # ancestor module in the resource hierarchy. If you try to set a top-level - # module (a module with no parent) to the `INHERITED` state, you receive an - # `INVALID_ARGUMENT` error. - INHERITED = 3 - end - end - - # Defines the properties in a custom module configuration for Security - # Health Analytics. Use the custom module configuration to create custom - # detectors that generate custom findings for resources that you specify. - # @!attribute [rw] predicate - # @return [::Google::Type::Expr] - # Optional. The Common Expression Language (CEL) expression to evaluate to - # produce findings. When the expression evaluates to `true` against a - # resource, a finding is generated. - # @!attribute [rw] custom_output - # @return [::Google::Cloud::SecurityCenterManagement::V1::CustomConfig::CustomOutputSpec] - # Optional. Custom output properties. - # @!attribute [rw] resource_selector - # @return [::Google::Cloud::SecurityCenterManagement::V1::CustomConfig::ResourceSelector] - # Optional. The Cloud Asset Inventory resource types that the custom module - # operates on. For information about resource types, see [Supported asset - # types](https://cloud.google.com/asset-inventory/docs/supported-asset-types). - # Each custom module can specify up to 5 resource types. - # @!attribute [rw] severity - # @return [::Google::Cloud::SecurityCenterManagement::V1::CustomConfig::Severity] - # Optional. The severity to assign to findings generated by the module. - # @!attribute [rw] description - # @return [::String] - # Optional. Text that describes the vulnerability or misconfiguration that - # the custom module detects. This explanation is returned with each finding - # instance to help investigators understand the detected issue. The text must - # be enclosed in quotation marks. - # @!attribute [rw] recommendation - # @return [::String] - # Optional. An explanation of the recommended steps that security teams can - # take to resolve the detected issue. This explanation is returned with each - # finding generated by this module. - class CustomConfig - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - - # A set of optional name-value pairs that define custom source properties to - # return with each finding that is generated by the custom module. The custom - # source properties that are defined here are included in the finding. - # @!attribute [rw] properties - # @return [::Array<::Google::Cloud::SecurityCenterManagement::V1::CustomConfig::CustomOutputSpec::Property>] - # Optional. A list of custom output properties to add to the finding. - class CustomOutputSpec - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - - # An individual name-value pair that defines a custom source property. - # @!attribute [rw] name - # @return [::String] - # Optional. Name of the property for the custom output. - # @!attribute [rw] value_expression - # @return [::Google::Type::Expr] - # Optional. The CEL expression for the custom output. A resource property - # can be specified to return the value of the property or a text string - # enclosed in quotation marks. - class Property - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - end - - # Resource for selecting resource type. - # @!attribute [rw] resource_types - # @return [::Array<::String>] - # Optional. The resource types to run the detector on. - class ResourceSelector - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Defines the valid value options for the severity of a finding. - module Severity - # Default value. This value is unused. - SEVERITY_UNSPECIFIED = 0 - - # Critical severity. - CRITICAL = 1 - - # High severity. - HIGH = 2 - - # Medium severity. - MEDIUM = 3 - - # Low severity. - LOW = 4 - end - end - - # Request message for - # {::Google::Cloud::SecurityCenterManagement::V1::SecurityCenterManagement::Client#list_security_health_analytics_custom_modules SecurityCenterManagement.ListSecurityHealthAnalyticsCustomModules}. - # @!attribute [rw] parent - # @return [::String] - # Required. Name of the parent organization, folder, or project in which to - # list custom modules, in one of the following formats: - # - # * `organizations/{organization}/locations/{location}` - # * `folders/{folder}/locations/{location}` - # * `projects/{project}/locations/{location}` - # @!attribute [rw] page_size - # @return [::Integer] - # Optional. The maximum number of results to return in a single response. - # Default is 10, minimum is 1, maximum is 1000. - # @!attribute [rw] page_token - # @return [::String] - # Optional. A pagination token returned from a previous request. Provide this - # token to retrieve the next page of results. - # - # When paginating, the rest of the request must match the request that - # generated the page token. - class ListSecurityHealthAnalyticsCustomModulesRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Response message for - # {::Google::Cloud::SecurityCenterManagement::V1::SecurityCenterManagement::Client#list_security_health_analytics_custom_modules SecurityCenterManagement.ListSecurityHealthAnalyticsCustomModules}. - # @!attribute [rw] security_health_analytics_custom_modules - # @return [::Array<::Google::Cloud::SecurityCenterManagement::V1::SecurityHealthAnalyticsCustomModule>] - # The list of Security Health Analytics custom modules. - # @!attribute [rw] next_page_token - # @return [::String] - # A pagination token. To retrieve the next page of results, call the method - # again with this token. - class ListSecurityHealthAnalyticsCustomModulesResponse - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Request message for - # {::Google::Cloud::SecurityCenterManagement::V1::SecurityCenterManagement::Client#list_descendant_security_health_analytics_custom_modules SecurityCenterManagement.ListDescendantSecurityHealthAnalyticsCustomModules}. - # @!attribute [rw] parent - # @return [::String] - # Required. Name of the parent organization, folder, or project in which to - # list custom modules, in one of the following formats: - # - # * `organizations/{organization}/locations/{location}` - # * `folders/{folder}/locations/{location}` - # * `projects/{project}/locations/{location}` - # @!attribute [rw] page_size - # @return [::Integer] - # Optional. The maximum number of results to return in a single response. - # Default is 10, minimum is 1, maximum is 1000. - # @!attribute [rw] page_token - # @return [::String] - # Optional. A pagination token returned from a previous request. Provide this - # token to retrieve the next page of results. - # - # When paginating, the rest of the request must match the request that - # generated the page token. - class ListDescendantSecurityHealthAnalyticsCustomModulesRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Response message for - # {::Google::Cloud::SecurityCenterManagement::V1::SecurityCenterManagement::Client#list_descendant_security_health_analytics_custom_modules SecurityCenterManagement.ListDescendantSecurityHealthAnalyticsCustomModules}. - # @!attribute [rw] security_health_analytics_custom_modules - # @return [::Array<::Google::Cloud::SecurityCenterManagement::V1::SecurityHealthAnalyticsCustomModule>] - # The list of SecurityHealthAnalyticsCustomModules - # @!attribute [rw] next_page_token - # @return [::String] - # A pagination token. To retrieve the next page of results, call the method - # again with this token. - class ListDescendantSecurityHealthAnalyticsCustomModulesResponse - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Request message for - # {::Google::Cloud::SecurityCenterManagement::V1::SecurityCenterManagement::Client#get_security_health_analytics_custom_module SecurityCenterManagement.GetSecurityHealthAnalyticsCustomModule}. - # @!attribute [rw] name - # @return [::String] - # Required. Name of the resource, in the format - # `projects/{project}/locations/{location}/securityHealthAnalyticsCustomModules/{custom_module}`. - class GetSecurityHealthAnalyticsCustomModuleRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Request message for - # {::Google::Cloud::SecurityCenterManagement::V1::SecurityCenterManagement::Client#create_security_health_analytics_custom_module SecurityCenterManagement.CreateSecurityHealthAnalyticsCustomModule}. - # @!attribute [rw] parent - # @return [::String] - # Required. Name of the parent organization, folder, or project of the - # module, in one of the following formats: - # - # * `organizations/{organization}/locations/{location}` - # * `folders/{folder}/locations/{location}` - # * `projects/{project}/locations/{location}` - # @!attribute [rw] security_health_analytics_custom_module - # @return [::Google::Cloud::SecurityCenterManagement::V1::SecurityHealthAnalyticsCustomModule] - # Required. The resource being created. - # @!attribute [rw] validate_only - # @return [::Boolean] - # Optional. When set to `true`, the request will be validated (including IAM - # checks), but no module will be created. An `OK` response indicates that the - # request is valid, while an error response indicates that the request is - # invalid. - # - # If the request is valid, a subsequent request to create the module could - # still fail for one of the following reasons: - # - # * The state of your cloud resources changed; for example, you lost a - # required IAM permission - # * An error occurred during creation of the module - # - # Defaults to `false`. - class CreateSecurityHealthAnalyticsCustomModuleRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Request message for - # {::Google::Cloud::SecurityCenterManagement::V1::SecurityCenterManagement::Client#update_security_health_analytics_custom_module SecurityCenterManagement.UpdateSecurityHealthAnalyticsCustomModule}. - # @!attribute [rw] update_mask - # @return [::Google::Protobuf::FieldMask] - # Required. The fields to update. The following values are valid: - # - # * `custom_config` - # * `enablement_state` - # - # If you omit this field or set it to the wildcard value `*`, then all - # eligible fields are updated. - # @!attribute [rw] security_health_analytics_custom_module - # @return [::Google::Cloud::SecurityCenterManagement::V1::SecurityHealthAnalyticsCustomModule] - # Required. The resource being updated. - # @!attribute [rw] validate_only - # @return [::Boolean] - # Optional. When set to `true`, the request will be validated (including IAM - # checks), but no module will be updated. An `OK` response indicates that the - # request is valid, while an error response indicates that the request is - # invalid. - # - # If the request is valid, a subsequent request to update the module could - # still fail for one of the following reasons: - # - # * The state of your cloud resources changed; for example, you lost a - # required IAM permission - # * An error occurred during creation of the module - # - # Defaults to `false`. - class UpdateSecurityHealthAnalyticsCustomModuleRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Request message for - # {::Google::Cloud::SecurityCenterManagement::V1::SecurityCenterManagement::Client#delete_security_health_analytics_custom_module SecurityCenterManagement.DeleteSecurityHealthAnalyticsCustomModule}. - # @!attribute [rw] name - # @return [::String] - # Required. The resource name of the SHA custom module, in one of the - # following formats: - # - # * `organizations/{organization}/locations/{location}/securityHealthAnalyticsCustomModules/{custom_module}` - # * `folders/{folder}/locations/{location}/securityHealthAnalyticsCustomModules/{custom_module}` - # * `projects/{project}/locations/{location}/securityHealthAnalyticsCustomModules/{custom_module}` - # @!attribute [rw] validate_only - # @return [::Boolean] - # Optional. When set to `true`, the request will be validated (including IAM - # checks), but no module will be deleted. An `OK` response indicates that the - # request is valid, while an error response indicates that the request is - # invalid. - # - # If the request is valid, a subsequent request to delete the module could - # still fail for one of the following reasons: - # - # * The state of your cloud resources changed; for example, you lost a - # required IAM permission - # * An error occurred during deletion of the module - # - # Defaults to `false`. - class DeleteSecurityHealthAnalyticsCustomModuleRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Request message for - # {::Google::Cloud::SecurityCenterManagement::V1::SecurityCenterManagement::Client#simulate_security_health_analytics_custom_module SecurityCenterManagement.SimulateSecurityHealthAnalyticsCustomModule}. - # The maximum size of the request is 4 MiB. - # @!attribute [rw] parent - # @return [::String] - # Required. The relative resource name of the organization, project, or - # folder. For more information about relative resource names, see [AIP-122: - # Resource names](https://google.aip.dev/122). Example: - # `organizations/{organization_id}`. - # @!attribute [rw] custom_config - # @return [::Google::Cloud::SecurityCenterManagement::V1::CustomConfig] - # Required. The custom configuration that you need to test. - # @!attribute [rw] resource - # @return [::Google::Cloud::SecurityCenterManagement::V1::SimulateSecurityHealthAnalyticsCustomModuleRequest::SimulatedResource] - # Required. Resource data to simulate custom module against. - class SimulateSecurityHealthAnalyticsCustomModuleRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - - # Manually constructed information about a resource. - # @!attribute [rw] resource_type - # @return [::String] - # Required. The type of the resource. For example, - # `compute.googleapis.com/Disk`. - # @!attribute [rw] resource_data - # @return [::Google::Protobuf::Struct] - # Optional. A representation of the Google Cloud resource. Should match the - # Google Cloud resource JSON format. - # - # If the custom module evaluates only the IAM allow policy, then you can - # omit this field. - # @!attribute [rw] iam_policy_data - # @return [::Google::Iam::V1::Policy] - # Optional. A representation of the IAM allow policy. - # - # If the custom module evaluates only the resource data, then you can omit - # this field. - class SimulatedResource - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - end - - # The minimum set of fields needed to represent a simulated finding from a - # Security Health Analytics custom module. - # @!attribute [rw] name - # @return [::String] - # Identifier. The [relative resource name](https://google.aip.dev/122) of the - # finding, in one of the following formats: - # - # * `organizations/{organization_id}/sources/{source_id}/findings/{finding_id}` - # * `folders/{folder_id}/sources/{source_id}/findings/{finding_id}` - # * `projects/{project_id}/sources/{source_id}/findings/{finding_id}` - # @!attribute [rw] parent - # @return [::String] - # The [relative resource name](https://google.aip.dev/122) of the source the - # finding belongs to. For example, - # `organizations/{organization_id}/sources/{source_id}`. This field is - # immutable after creation time. - # @!attribute [rw] resource_name - # @return [::String] - # For findings on Google Cloud resources, the - # [full resource name](https://google.aip.dev/122#full-resource-names) of the - # Google Cloud resource this finding is for. When the finding is for a - # non-Google Cloud resource, the value can be a customer or partner defined - # string. This field is immutable after creation time. - # @!attribute [rw] category - # @return [::String] - # The additional taxonomy group within findings from a given source. For - # example, `XSS_FLASH_INJECTION`. This field is immutable after creation - # time. - # @!attribute [r] state - # @return [::Google::Cloud::SecurityCenterManagement::V1::SimulatedFinding::State] - # Output only. The state of the finding. - # @!attribute [rw] source_properties - # @return [::Google::Protobuf::Map{::String => ::Google::Protobuf::Value}] - # Source-specific properties. These properties are managed by the source - # that writes the finding. The key names must be between 1 and 255 - # characters; they must start with a letter and contain alphanumeric - # characters or underscores only. - # @!attribute [rw] event_time - # @return [::Google::Protobuf::Timestamp] - # The time the finding was first detected. If an existing finding is updated, - # then this is the time the update occurred. If the finding is later - # resolved, then this time reflects when the finding was resolved. - # - # For example, if the finding represents an open firewall, this property - # captures the time the detector believes the firewall became open. The - # accuracy is determined by the detector. - # - # The event time must not be set to a value greater than the current - # timestamp. - # @!attribute [rw] severity - # @return [::Google::Cloud::SecurityCenterManagement::V1::SimulatedFinding::Severity] - # The severity of the finding. This field is managed by the source that - # writes the finding. - # @!attribute [rw] finding_class - # @return [::Google::Cloud::SecurityCenterManagement::V1::SimulatedFinding::FindingClass] - # The class of the finding. - class SimulatedFinding - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - - # @!attribute [rw] key - # @return [::String] - # @!attribute [rw] value - # @return [::Google::Protobuf::Value] - class SourcePropertiesEntry - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # The state of the finding. - module State - # Default value. This value is unused. - STATE_UNSPECIFIED = 0 - - # The finding requires attention and has not been addressed yet. - ACTIVE = 1 - - # The finding has been fixed, triaged as a non-issue, or otherwise - # addressed and is no longer active. - INACTIVE = 2 - end - - # The severity of the finding. - module Severity - # Default value. This value is unused. - SEVERITY_UNSPECIFIED = 0 - - # For vulnerabilities: A critical vulnerability is easily discoverable by - # an external actor, exploitable, and results in the direct ability to - # execute arbitrary code, exfiltrate data, and otherwise gain additional - # access and privileges to cloud resources and workloads. Examples include - # publicly accessible unprotected user data and public SSH access with weak - # or no passwords. - # - # For threats: Indicates a threat that is able to access, modify, or delete - # data or execute unauthorized code within existing resources. - CRITICAL = 1 - - # For vulnerabilities: A high-risk vulnerability can be easily discovered - # and exploited in combination with other vulnerabilities in order to gain - # direct access and the ability to execute arbitrary code, exfiltrate data, - # and otherwise gain additional access and privileges to cloud resources - # and workloads. An example is a database with weak or no passwords that is - # only accessible internally. This database could easily be compromised by - # an actor that had access to the internal network. - # - # For threats: Indicates a threat that is able to create new computational - # resources in an environment but not able to access data or execute code - # in existing resources. - HIGH = 2 - - # For vulnerabilities: A medium-risk vulnerability could be used by an - # actor to gain access to resources or privileges that enable them to - # eventually (through multiple steps or a complex exploit) gain access and - # the ability to execute arbitrary code or exfiltrate data. An example is a - # service account with access to more projects than it should have. If an - # actor gains access to the service account, they could potentially use - # that access to manipulate a project the service account was not intended - # to. - # - # For threats: Indicates a threat that is able to cause operational impact - # but may not access data or execute unauthorized code. - MEDIUM = 3 - - # For vulnerabilities: A low-risk vulnerability hampers a security - # organization's ability to detect vulnerabilities or active threats in - # their deployment, or prevents the root cause investigation of security - # issues. An example is monitoring and logs being disabled for resource - # configurations and access. - # - # For threats: Indicates a threat that has obtained minimal access to an - # environment but is not able to access data, execute code, or create - # resources. - LOW = 4 - end - - # Represents what kind of finding it is. - module FindingClass - # Default value. This value is unused. - FINDING_CLASS_UNSPECIFIED = 0 - - # Describes unwanted or malicious activity. - THREAT = 1 - - # Describes a potential weakness in software that increases risk to - # confidentiality, integrity, and availability. - VULNERABILITY = 2 - - # Describes a potential weakness in cloud resource or asset configuration - # that increases risk. - MISCONFIGURATION = 3 - - # Describes a security observation that is for informational purposes. - OBSERVATION = 4 - - # Describes an error that prevents Security Command Center from working - # correctly. - SCC_ERROR = 5 - - # Describes a potential security risk due to a change in the security - # posture. - POSTURE_VIOLATION = 6 - - # Describes a combination of security issues that represent a more severe - # security problem when taken together. - TOXIC_COMBINATION = 7 - end - end - - # Response message for - # {::Google::Cloud::SecurityCenterManagement::V1::SecurityCenterManagement::Client#simulate_security_health_analytics_custom_module SecurityCenterManagement.SimulateSecurityHealthAnalyticsCustomModule}. - # @!attribute [rw] result - # @return [::Google::Cloud::SecurityCenterManagement::V1::SimulateSecurityHealthAnalyticsCustomModuleResponse::SimulatedResult] - # Result for test case in the corresponding request. - class SimulateSecurityHealthAnalyticsCustomModuleResponse - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - - # Possible test result. - # @!attribute [rw] finding - # @return [::Google::Cloud::SecurityCenterManagement::V1::SimulatedFinding] - # Finding that would be published for the test case if a violation is - # detected. - # - # Note: The following fields are mutually exclusive: `finding`, `no_violation`, `error`. If a field in that set is populated, all other fields in the set will automatically be cleared. - # @!attribute [rw] no_violation - # @return [::Google::Protobuf::Empty] - # Indicates that the test case does not trigger any violation. - # - # Note: The following fields are mutually exclusive: `no_violation`, `finding`, `error`. If a field in that set is populated, all other fields in the set will automatically be cleared. - # @!attribute [rw] error - # @return [::Google::Rpc::Status] - # Error encountered during the test. - # - # Note: The following fields are mutually exclusive: `error`, `finding`, `no_violation`. If a field in that set is populated, all other fields in the set will automatically be cleared. - class SimulatedResult - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - end - - # The representation of an - # {::Google::Cloud::SecurityCenterManagement::V1::EventThreatDetectionCustomModule EventThreatDetectionCustomModule} - # at a given level, taking hierarchy into account and resolving various fields - # accordingly. For example, if the module is enabled at the ancestor level, - # then effective modules at all descendant levels will have their enablement - # state set to `ENABLED`. Similarly, if `module.inherited` is set, then the - # effective module's configuration will reflect the ancestor's configuration. - # @!attribute [rw] name - # @return [::String] - # Identifier. The resource name of the Event Threat Detection custom module, - # in one of the following formats: - # - # * `organizations/{organization}/locations/{location}/effectiveEventThreatDetectionCustomModules/{custom_module}` - # * `folders/{folder}/locations/{location}/effectiveEventThreatDetectionCustomModules/{custom_module}` - # * `projects/{project}/locations/{location}/effectiveEventThreatDetectionCustomModules/{custom_module}` - # @!attribute [r] config - # @return [::Google::Protobuf::Struct] - # Output only. Configuration for the effective module. - # @!attribute [r] enablement_state - # @return [::Google::Cloud::SecurityCenterManagement::V1::EffectiveEventThreatDetectionCustomModule::EnablementState] - # Output only. The effective state of enablement for the module at the given - # level of the hierarchy. - # @!attribute [r] type - # @return [::String] - # Output only. Type for the module (for example, `CONFIGURABLE_BAD_IP`). - # @!attribute [r] display_name - # @return [::String] - # Output only. The human-readable name of the module. - # @!attribute [r] description - # @return [::String] - # Output only. A description of the module. - class EffectiveEventThreatDetectionCustomModule - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - - # The enablement state of the module. - module EnablementState - # Default value. This value is unused. - ENABLEMENT_STATE_UNSPECIFIED = 0 - - # The module is enabled at the given level. - ENABLED = 1 - - # The module is disabled at the given level. - DISABLED = 2 - end - end - - # Request message for - # {::Google::Cloud::SecurityCenterManagement::V1::SecurityCenterManagement::Client#list_effective_event_threat_detection_custom_modules SecurityCenterManagement.ListEffectiveEventThreatDetectionCustomModules}. - # @!attribute [rw] parent - # @return [::String] - # Required. Name of parent to list effective custom modules, in one of the - # following formats: - # - # * `organizations/{organization}/locations/{location}` - # * `folders/{folder}/locations/{location}` - # * `projects/{project}/locations/{location}` - # @!attribute [rw] page_size - # @return [::Integer] - # Optional. The maximum number of results to return in a single response. - # Default is 10, minimum is 1, maximum is 1000. - # @!attribute [rw] page_token - # @return [::String] - # Optional. A pagination token returned from a previous request. Provide this - # token to retrieve the next page of results. - # - # When paginating, the rest of the request must match the request that - # generated the page token. - class ListEffectiveEventThreatDetectionCustomModulesRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Response message for - # {::Google::Cloud::SecurityCenterManagement::V1::SecurityCenterManagement::Client#list_effective_event_threat_detection_custom_modules SecurityCenterManagement.ListEffectiveEventThreatDetectionCustomModules}. - # @!attribute [rw] effective_event_threat_detection_custom_modules - # @return [::Array<::Google::Cloud::SecurityCenterManagement::V1::EffectiveEventThreatDetectionCustomModule>] - # The list of effective Event Threat Detection custom modules. - # @!attribute [rw] next_page_token - # @return [::String] - # A pagination token. To retrieve the next page of results, call the method - # again with this token. - class ListEffectiveEventThreatDetectionCustomModulesResponse - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Request message for - # {::Google::Cloud::SecurityCenterManagement::V1::SecurityCenterManagement::Client#get_effective_event_threat_detection_custom_module SecurityCenterManagement.GetEffectiveEventThreatDetectionCustomModule}. - # @!attribute [rw] name - # @return [::String] - # Required. The resource name of the Event Threat Detection custom module, in - # one of the following formats: - # - # * `organizations/{organization}/locations/{location}/effectiveEventThreatDetectionCustomModules/{custom_module}` - # * `folders/{folder}/locations/{location}/effectiveEventThreatDetectionCustomModules/{custom_module}` - # * `projects/{project}/locations/{location}/effectiveEventThreatDetectionCustomModules/{custom_module}` - class GetEffectiveEventThreatDetectionCustomModuleRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # A Security Command Center resource that contains the configuration and - # enablement state of a custom module, which enables Event Threat Detection to - # write certain findings to Security Command Center. - # @!attribute [rw] name - # @return [::String] - # Identifier. The resource name of the Event Threat Detection custom module, - # in one of the following formats: - # - # * `organizations/{organization}/locations/{location}/eventThreatDetectionCustomModules/{custom_module}` - # * `folders/{folder}/locations/{location}/eventThreatDetectionCustomModules/{custom_module}` - # * `projects/{project}/locations/{location}/eventThreatDetectionCustomModules/{custom_module}` - # @!attribute [rw] config - # @return [::Google::Protobuf::Struct] - # Optional. Configuration for the module. For the resident module, its - # configuration value is defined at this level. For the inherited module, its - # configuration value is inherited from the ancestor module. - # @!attribute [r] ancestor_module - # @return [::String] - # Output only. The closest ancestor module that this module inherits the - # enablement state from. If empty, indicates that the custom module was - # created in the requesting parent organization, folder, or project. The - # format is the same as the custom module's resource name. - # @!attribute [rw] enablement_state - # @return [::Google::Cloud::SecurityCenterManagement::V1::EventThreatDetectionCustomModule::EnablementState] - # Optional. The state of enablement for the module at the given level of the - # hierarchy. - # @!attribute [rw] type - # @return [::String] - # Optional. Type for the module. For example, `CONFIGURABLE_BAD_IP`. - # @!attribute [rw] display_name - # @return [::String] - # Optional. The human-readable name of the module. - # @!attribute [rw] description - # @return [::String] - # Optional. A description of the module. - # @!attribute [r] update_time - # @return [::Google::Protobuf::Timestamp] - # Output only. The time the module was last updated. - # @!attribute [r] last_editor - # @return [::String] - # Output only. The editor the module was last updated by. - class EventThreatDetectionCustomModule - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - - # The enablement state of the module. - module EnablementState - # Unspecified enablement state. - ENABLEMENT_STATE_UNSPECIFIED = 0 - - # The module is enabled at the given level. - ENABLED = 1 - - # The module is disabled at the given level. - DISABLED = 2 - - # State is inherited from an ancestor module. The module will either be - # effectively `ENABLED` or `DISABLED` based on its closest non-inherited - # ancestor module in the CRM hierarchy. If you try to set a top-level - # module (a module with no parent) to the `INHERITED` state, you receive an - # `INVALID_ARGUMENT` error. - INHERITED = 3 - end - end - - # Request message for - # {::Google::Cloud::SecurityCenterManagement::V1::SecurityCenterManagement::Client#list_event_threat_detection_custom_modules SecurityCenterManagement.ListEventThreatDetectionCustomModules}. - # @!attribute [rw] parent - # @return [::String] - # Required. Name of parent to list custom modules, in one of the following - # formats: - # - # * `organizations/{organization}/locations/{location}` - # * `folders/{folder}/locations/{location}` - # * `projects/{project}/locations/{location}` - # @!attribute [rw] page_size - # @return [::Integer] - # Optional. The maximum number of modules to return. The service may return - # fewer than this value. If unspecified, at most 10 modules will be returned. - # The maximum value is 1000; values above 1000 will be coerced to 1000. - # @!attribute [rw] page_token - # @return [::String] - # Optional. A pagination token returned from a previous request. Provide this - # token to retrieve the next page of results. - # - # When paginating, the rest of the request must match the request that - # generated the page token. - class ListEventThreatDetectionCustomModulesRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Response message for - # {::Google::Cloud::SecurityCenterManagement::V1::SecurityCenterManagement::Client#list_event_threat_detection_custom_modules SecurityCenterManagement.ListEventThreatDetectionCustomModules}. - # @!attribute [rw] event_threat_detection_custom_modules - # @return [::Array<::Google::Cloud::SecurityCenterManagement::V1::EventThreatDetectionCustomModule>] - # The list of custom modules. - # @!attribute [rw] next_page_token - # @return [::String] - # A pagination token. To retrieve the next page of results, call the method - # again with this token. - class ListEventThreatDetectionCustomModulesResponse - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Request message for - # {::Google::Cloud::SecurityCenterManagement::V1::SecurityCenterManagement::Client#list_descendant_event_threat_detection_custom_modules SecurityCenterManagement.ListDescendantEventThreatDetectionCustomModules}. - # @!attribute [rw] parent - # @return [::String] - # Required. Name of parent to list custom modules, in one of the following - # formats: - # - # * `organizations/{organization}/locations/{location}` - # * `folders/{folder}/locations/{location}` - # * `projects/{project}/locations/{location}` - # @!attribute [rw] page_size - # @return [::Integer] - # Optional. The maximum number of modules to return. The service may return - # fewer than this value. If unspecified, at most 10 configs will be returned. - # The maximum value is 1000; values above 1000 will be coerced to 1000. - # @!attribute [rw] page_token - # @return [::String] - # Optional. A pagination token returned from a previous request. Provide this - # token to retrieve the next page of results. - # - # When paginating, the rest of the request must match the request that - # generated the page token. - class ListDescendantEventThreatDetectionCustomModulesRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Response message for - # {::Google::Cloud::SecurityCenterManagement::V1::SecurityCenterManagement::Client#list_descendant_event_threat_detection_custom_modules SecurityCenterManagement.ListDescendantEventThreatDetectionCustomModules}. - # @!attribute [rw] event_threat_detection_custom_modules - # @return [::Array<::Google::Cloud::SecurityCenterManagement::V1::EventThreatDetectionCustomModule>] - # The list of custom modules. - # @!attribute [rw] next_page_token - # @return [::String] - # A pagination token. To retrieve the next page of results, call the method - # again with this token. - class ListDescendantEventThreatDetectionCustomModulesResponse - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Request message for - # {::Google::Cloud::SecurityCenterManagement::V1::SecurityCenterManagement::Client#get_event_threat_detection_custom_module SecurityCenterManagement.GetEventThreatDetectionCustomModule}. - # @!attribute [rw] name - # @return [::String] - # Required. The resource name of the Event Threat Detection custom module, in - # one of the following formats: - # - # * `organizations/{organization}/locations/{location}/eventThreatDetectionCustomModules/{custom_module}` - # * `folders/{folder}/locations/{location}/eventThreatDetectionCustomModules/{custom_module}` - # * `projects/{project}/locations/{location}/eventThreatDetectionCustomModules/{custom_module}` - class GetEventThreatDetectionCustomModuleRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Request message for - # {::Google::Cloud::SecurityCenterManagement::V1::SecurityCenterManagement::Client#create_event_threat_detection_custom_module SecurityCenterManagement.CreateEventThreatDetectionCustomModule}. - # @!attribute [rw] parent - # @return [::String] - # Required. Name of parent for the module, in one of the following formats: - # - # * `organizations/{organization}/locations/{location}` - # * `folders/{folder}/locations/{location}` - # * `projects/{project}/locations/{location}` - # @!attribute [rw] event_threat_detection_custom_module - # @return [::Google::Cloud::SecurityCenterManagement::V1::EventThreatDetectionCustomModule] - # Required. The module to create. The - # {::Google::Cloud::SecurityCenterManagement::V1::EventThreatDetectionCustomModule#name EventThreatDetectionCustomModule.name} - # field is ignored; Security Command Center generates the name. - # @!attribute [rw] validate_only - # @return [::Boolean] - # Optional. When set to `true`, the request will be validated (including IAM - # checks), but no module will be created. An `OK` response indicates that the - # request is valid, while an error response indicates that the request is - # invalid. - # - # If the request is valid, a subsequent request to create the module could - # still fail for one of the following reasons: - # - # * The state of your cloud resources changed; for example, you lost a - # required IAM permission - # * An error occurred during creation of the module - # - # Defaults to `false`. - class CreateEventThreatDetectionCustomModuleRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Message for updating a EventThreatDetectionCustomModule - # @!attribute [rw] update_mask - # @return [::Google::Protobuf::FieldMask] - # Required. The fields to update. If omitted, then all fields are updated. - # @!attribute [rw] event_threat_detection_custom_module - # @return [::Google::Cloud::SecurityCenterManagement::V1::EventThreatDetectionCustomModule] - # Required. The module being updated. - # @!attribute [rw] validate_only - # @return [::Boolean] - # Optional. When set to `true`, the request will be validated (including IAM - # checks), but no module will be updated. An `OK` response indicates that the - # request is valid, while an error response indicates that the request is - # invalid. - # - # If the request is valid, a subsequent request to update the module could - # still fail for one of the following reasons: - # - # * The state of your cloud resources changed; for example, you lost a - # required IAM permission - # * An error occurred during creation of the module - # - # Defaults to `false`. - class UpdateEventThreatDetectionCustomModuleRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Request message for - # {::Google::Cloud::SecurityCenterManagement::V1::SecurityCenterManagement::Client#delete_event_threat_detection_custom_module SecurityCenterManagement.DeleteEventThreatDetectionCustomModule}. - # @!attribute [rw] name - # @return [::String] - # Required. The resource name of the Event Threat Detection custom module, in - # one of the following formats: - # - # * `organizations/{organization}/locations/{location}/eventThreatDetectionCustomModules/{custom_module}` - # * `folders/{folder}/locations/{location}/eventThreatDetectionCustomModules/{custom_module}` - # * `projects/{project}/locations/{location}/eventThreatDetectionCustomModules/{custom_module}` - # @!attribute [rw] validate_only - # @return [::Boolean] - # Optional. When set to `true`, the request will be validated (including IAM - # checks), but no module will be deleted. An `OK` response indicates that the - # request is valid, while an error response indicates that the request is - # invalid. - # - # If the request is valid, a subsequent request to delete the module could - # still fail for one of the following reasons: - # - # * The state of your cloud resources changed; for example, you lost a - # required IAM permission - # * An error occurred during creation of the module - # - # Defaults to `false`. - class DeleteEventThreatDetectionCustomModuleRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Request message for - # {::Google::Cloud::SecurityCenterManagement::V1::SecurityCenterManagement::Client#validate_event_threat_detection_custom_module SecurityCenterManagement.ValidateEventThreatDetectionCustomModule}. - # @!attribute [rw] parent - # @return [::String] - # Required. Resource name of the parent to validate the custom modules under, - # in one of the following formats: - # - # * `organizations/{organization}/locations/{location}` - # @!attribute [rw] raw_text - # @return [::String] - # Required. The raw text of the module's contents. Used to generate error - # messages. - # @!attribute [rw] type - # @return [::String] - # Required. The type of the module. For example, `CONFIGURABLE_BAD_IP`. - class ValidateEventThreatDetectionCustomModuleRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Response message for - # {::Google::Cloud::SecurityCenterManagement::V1::SecurityCenterManagement::Client#validate_event_threat_detection_custom_module SecurityCenterManagement.ValidateEventThreatDetectionCustomModule}. - # @!attribute [rw] errors - # @return [::Array<::Google::Cloud::SecurityCenterManagement::V1::ValidateEventThreatDetectionCustomModuleResponse::CustomModuleValidationError>] - # A list of errors returned by the validator. If the list is empty, there - # were no errors. - class ValidateEventThreatDetectionCustomModuleResponse - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - - # An error encountered while validating the uploaded configuration of an - # Event Threat Detection custom module. - # @!attribute [rw] description - # @return [::String] - # A human-readable description of the error. - # @!attribute [rw] field_path - # @return [::String] - # The path, in [RFC 6901: JSON - # Pointer](https://datatracker.ietf.org/doc/html/rfc6901) format, to the - # field that failed validation. Omitted if no specific field is affected. - # @!attribute [rw] start - # @return [::Google::Cloud::SecurityCenterManagement::V1::ValidateEventThreatDetectionCustomModuleResponse::Position] - # The initial position of the error in the uploaded text version of the - # module. Omitted if no specific position applies, or if the position could - # not be computed. - # @!attribute [rw] end - # @return [::Google::Cloud::SecurityCenterManagement::V1::ValidateEventThreatDetectionCustomModuleResponse::Position] - # The end position of the error in the uploaded text version of the module. - # Omitted if no specific position applies, or if the position could not be - # computed. - class CustomModuleValidationError - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # A position in the uploaded text version of a module. - # @!attribute [rw] line_number - # @return [::Integer] - # The line position in the text. - # @!attribute [rw] column_number - # @return [::Integer] - # The column position in the line. - class Position - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - end - - # Request message for - # {::Google::Cloud::SecurityCenterManagement::V1::SecurityCenterManagement::Client#get_security_center_service SecurityCenterManagement.GetSecurityCenterService}. - # @!attribute [rw] name - # @return [::String] - # Required. The Security Command Center service to retrieve, in one of the - # following formats: - # - # * organizations/\\{organization}/locations/\\{location}/securityCenterServices/\\{service} - # * folders/\\{folder}/locations/\\{location}/securityCenterServices/\\{service} - # * projects/\\{project}/locations/\\{location}/securityCenterServices/\\{service} - # - # The following values are valid for `{service}`: - # - # * `container-threat-detection` - # * `event-threat-detection` - # * `security-health-analytics` - # * `vm-threat-detection` - # * `web-security-scanner` - # @!attribute [rw] show_eligible_modules_only - # @return [::Boolean] - # Set to `true` to show only modules that are in scope. By default, all - # modules are shown. - class GetSecurityCenterServiceRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Request message for - # {::Google::Cloud::SecurityCenterManagement::V1::SecurityCenterManagement::Client#list_security_center_services SecurityCenterManagement.ListSecurityCenterServices}. - # @!attribute [rw] parent - # @return [::String] - # Required. The name of the parent to list Security Command Center services, - # in one of the following formats: - # - # * `organizations/{organization}/locations/{location}` - # * `folders/{folder}/locations/{location}` - # * `projects/{project}/locations/{location}` - # @!attribute [rw] page_size - # @return [::Integer] - # Optional. The maximum number of results to return in a single response. - # Default is 10, minimum is 1, maximum is 1000. - # @!attribute [rw] page_token - # @return [::String] - # Optional. A pagination token returned from a previous request. Provide this - # token to retrieve the next page of results. - # - # When paginating, the rest of the request must match the request that - # generated the page token. - # @!attribute [rw] show_eligible_modules_only - # @return [::Boolean] - # Flag that, when set, is used to filter the module settings that are shown. - # The default setting is that all modules are shown. - class ListSecurityCenterServicesRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Response message for - # {::Google::Cloud::SecurityCenterManagement::V1::SecurityCenterManagement::Client#list_security_center_services SecurityCenterManagement.ListSecurityCenterServices}. - # @!attribute [rw] security_center_services - # @return [::Array<::Google::Cloud::SecurityCenterManagement::V1::SecurityCenterService>] - # The list of services. - # @!attribute [rw] next_page_token - # @return [::String] - # A pagination token. To retrieve the next page of results, call the method - # again with this token. - class ListSecurityCenterServicesResponse - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Request message for - # {::Google::Cloud::SecurityCenterManagement::V1::SecurityCenterManagement::Client#update_security_center_service SecurityCenterManagement.UpdateSecurityCenterService}. - # @!attribute [rw] security_center_service - # @return [::Google::Cloud::SecurityCenterManagement::V1::SecurityCenterService] - # Required. The updated service. - # @!attribute [rw] update_mask - # @return [::Google::Protobuf::FieldMask] - # Required. The fields to update. Accepts the following values: - # - # * `intended_enablement_state` - # * `modules` - # - # If omitted, then all eligible fields are updated. - # @!attribute [rw] validate_only - # @return [::Boolean] - # Optional. When set to `true`, the request will be validated (including IAM - # checks), but no service will be updated. An `OK` response indicates that - # the request is valid, while an error response indicates that the request is - # invalid. - # - # If the request is valid, a subsequent request to update the service could - # still fail for one of the following reasons: - # - # * The state of your cloud resources changed; for example, you lost a - # required IAM permission - # * An error occurred during update of the service - # - # Defaults to `false`. - class UpdateSecurityCenterServiceRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - end - end - end -end diff --git a/owl-bot-staging/google-cloud-security_center_management-v1/proto_docs/google/iam/v1/policy.rb b/owl-bot-staging/google-cloud-security_center_management-v1/proto_docs/google/iam/v1/policy.rb deleted file mode 100644 index 999575b797df..000000000000 --- a/owl-bot-staging/google-cloud-security_center_management-v1/proto_docs/google/iam/v1/policy.rb +++ /dev/null @@ -1,426 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - - -module Google - module Iam - module V1 - # An Identity and Access Management (IAM) policy, which specifies access - # controls for Google Cloud resources. - # - # - # A `Policy` is a collection of `bindings`. A `binding` binds one or more - # `members`, or principals, to a single `role`. Principals can be user - # accounts, service accounts, Google groups, and domains (such as G Suite). A - # `role` is a named list of permissions; each `role` can be an IAM predefined - # role or a user-created custom role. - # - # For some types of Google Cloud resources, a `binding` can also specify a - # `condition`, which is a logical expression that allows access to a resource - # only if the expression evaluates to `true`. A condition can add constraints - # based on attributes of the request, the resource, or both. To learn which - # resources support conditions in their IAM policies, see the - # [IAM - # documentation](https://cloud.google.com/iam/help/conditions/resource-policies). - # - # **JSON example:** - # - # ``` - # { - # "bindings": [ - # { - # "role": "roles/resourcemanager.organizationAdmin", - # "members": [ - # "user:mike@example.com", - # "group:admins@example.com", - # "domain:google.com", - # "serviceAccount:my-project-id@appspot.gserviceaccount.com" - # ] - # }, - # { - # "role": "roles/resourcemanager.organizationViewer", - # "members": [ - # "user:eve@example.com" - # ], - # "condition": { - # "title": "expirable access", - # "description": "Does not grant access after Sep 2020", - # "expression": "request.time < - # timestamp('2020-10-01T00:00:00.000Z')", - # } - # } - # ], - # "etag": "BwWWja0YfJA=", - # "version": 3 - # } - # ``` - # - # **YAML example:** - # - # ``` - # bindings: - # - members: - # - user:mike@example.com - # - group:admins@example.com - # - domain:google.com - # - serviceAccount:my-project-id@appspot.gserviceaccount.com - # role: roles/resourcemanager.organizationAdmin - # - members: - # - user:eve@example.com - # role: roles/resourcemanager.organizationViewer - # condition: - # title: expirable access - # description: Does not grant access after Sep 2020 - # expression: request.time < timestamp('2020-10-01T00:00:00.000Z') - # etag: BwWWja0YfJA= - # version: 3 - # ``` - # - # For a description of IAM and its features, see the - # [IAM documentation](https://cloud.google.com/iam/docs/). - # @!attribute [rw] version - # @return [::Integer] - # Specifies the format of the policy. - # - # Valid values are `0`, `1`, and `3`. Requests that specify an invalid value - # are rejected. - # - # Any operation that affects conditional role bindings must specify version - # `3`. This requirement applies to the following operations: - # - # * Getting a policy that includes a conditional role binding - # * Adding a conditional role binding to a policy - # * Changing a conditional role binding in a policy - # * Removing any role binding, with or without a condition, from a policy - # that includes conditions - # - # **Important:** If you use IAM Conditions, you must include the `etag` field - # whenever you call `setIamPolicy`. If you omit this field, then IAM allows - # you to overwrite a version `3` policy with a version `1` policy, and all of - # the conditions in the version `3` policy are lost. - # - # If a policy does not include any conditions, operations on that policy may - # specify any valid version or leave the field unset. - # - # To learn which resources support conditions in their IAM policies, see the - # [IAM - # documentation](https://cloud.google.com/iam/help/conditions/resource-policies). - # @!attribute [rw] bindings - # @return [::Array<::Google::Iam::V1::Binding>] - # Associates a list of `members`, or principals, with a `role`. Optionally, - # may specify a `condition` that determines how and when the `bindings` are - # applied. Each of the `bindings` must contain at least one principal. - # - # The `bindings` in a `Policy` can refer to up to 1,500 principals; up to 250 - # of these principals can be Google groups. Each occurrence of a principal - # counts towards these limits. For example, if the `bindings` grant 50 - # different roles to `user:alice@example.com`, and not to any other - # principal, then you can add another 1,450 principals to the `bindings` in - # the `Policy`. - # @!attribute [rw] audit_configs - # @return [::Array<::Google::Iam::V1::AuditConfig>] - # Specifies cloud audit logging configuration for this policy. - # @!attribute [rw] etag - # @return [::String] - # `etag` is used for optimistic concurrency control as a way to help - # prevent simultaneous updates of a policy from overwriting each other. - # It is strongly suggested that systems make use of the `etag` in the - # read-modify-write cycle to perform policy updates in order to avoid race - # conditions: An `etag` is returned in the response to `getIamPolicy`, and - # systems are expected to put that etag in the request to `setIamPolicy` to - # ensure that their change will be applied to the same version of the policy. - # - # **Important:** If you use IAM Conditions, you must include the `etag` field - # whenever you call `setIamPolicy`. If you omit this field, then IAM allows - # you to overwrite a version `3` policy with a version `1` policy, and all of - # the conditions in the version `3` policy are lost. - class Policy - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Associates `members`, or principals, with a `role`. - # @!attribute [rw] role - # @return [::String] - # Role that is assigned to the list of `members`, or principals. - # For example, `roles/viewer`, `roles/editor`, or `roles/owner`. - # @!attribute [rw] members - # @return [::Array<::String>] - # Specifies the principals requesting access for a Google Cloud resource. - # `members` can have the following values: - # - # * `allUsers`: A special identifier that represents anyone who is - # on the internet; with or without a Google account. - # - # * `allAuthenticatedUsers`: A special identifier that represents anyone - # who is authenticated with a Google account or a service account. - # - # * `user:{emailid}`: An email address that represents a specific Google - # account. For example, `alice@example.com` . - # - # - # * `serviceAccount:{emailid}`: An email address that represents a service - # account. For example, `my-other-app@appspot.gserviceaccount.com`. - # - # * `group:{emailid}`: An email address that represents a Google group. - # For example, `admins@example.com`. - # - # * `deleted:user:{emailid}?uid={uniqueid}`: An email address (plus unique - # identifier) representing a user that has been recently deleted. For - # example, `alice@example.com?uid=123456789012345678901`. If the user is - # recovered, this value reverts to `user:{emailid}` and the recovered user - # retains the role in the binding. - # - # * `deleted:serviceAccount:{emailid}?uid={uniqueid}`: An email address (plus - # unique identifier) representing a service account that has been recently - # deleted. For example, - # `my-other-app@appspot.gserviceaccount.com?uid=123456789012345678901`. - # If the service account is undeleted, this value reverts to - # `serviceAccount:{emailid}` and the undeleted service account retains the - # role in the binding. - # - # * `deleted:group:{emailid}?uid={uniqueid}`: An email address (plus unique - # identifier) representing a Google group that has been recently - # deleted. For example, `admins@example.com?uid=123456789012345678901`. If - # the group is recovered, this value reverts to `group:{emailid}` and the - # recovered group retains the role in the binding. - # - # - # * `domain:{domain}`: The G Suite domain (primary) that represents all the - # users of that domain. For example, `google.com` or `example.com`. - # @!attribute [rw] condition - # @return [::Google::Type::Expr] - # The condition that is associated with this binding. - # - # If the condition evaluates to `true`, then this binding applies to the - # current request. - # - # If the condition evaluates to `false`, then this binding does not apply to - # the current request. However, a different role binding might grant the same - # role to one or more of the principals in this binding. - # - # To learn which resources support conditions in their IAM policies, see the - # [IAM - # documentation](https://cloud.google.com/iam/help/conditions/resource-policies). - class Binding - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Specifies the audit configuration for a service. - # The configuration determines which permission types are logged, and what - # identities, if any, are exempted from logging. - # An AuditConfig must have one or more AuditLogConfigs. - # - # If there are AuditConfigs for both `allServices` and a specific service, - # the union of the two AuditConfigs is used for that service: the log_types - # specified in each AuditConfig are enabled, and the exempted_members in each - # AuditLogConfig are exempted. - # - # Example Policy with multiple AuditConfigs: - # - # { - # "audit_configs": [ - # { - # "service": "allServices", - # "audit_log_configs": [ - # { - # "log_type": "DATA_READ", - # "exempted_members": [ - # "user:jose@example.com" - # ] - # }, - # { - # "log_type": "DATA_WRITE" - # }, - # { - # "log_type": "ADMIN_READ" - # } - # ] - # }, - # { - # "service": "sampleservice.googleapis.com", - # "audit_log_configs": [ - # { - # "log_type": "DATA_READ" - # }, - # { - # "log_type": "DATA_WRITE", - # "exempted_members": [ - # "user:aliya@example.com" - # ] - # } - # ] - # } - # ] - # } - # - # For sampleservice, this policy enables DATA_READ, DATA_WRITE and ADMIN_READ - # logging. It also exempts `jose@example.com` from DATA_READ logging, and - # `aliya@example.com` from DATA_WRITE logging. - # @!attribute [rw] service - # @return [::String] - # Specifies a service that will be enabled for audit logging. - # For example, `storage.googleapis.com`, `cloudsql.googleapis.com`. - # `allServices` is a special value that covers all services. - # @!attribute [rw] audit_log_configs - # @return [::Array<::Google::Iam::V1::AuditLogConfig>] - # The configuration for logging of each type of permission. - class AuditConfig - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Provides the configuration for logging a type of permissions. - # Example: - # - # { - # "audit_log_configs": [ - # { - # "log_type": "DATA_READ", - # "exempted_members": [ - # "user:jose@example.com" - # ] - # }, - # { - # "log_type": "DATA_WRITE" - # } - # ] - # } - # - # This enables 'DATA_READ' and 'DATA_WRITE' logging, while exempting - # jose@example.com from DATA_READ logging. - # @!attribute [rw] log_type - # @return [::Google::Iam::V1::AuditLogConfig::LogType] - # The log type that this config enables. - # @!attribute [rw] exempted_members - # @return [::Array<::String>] - # Specifies the identities that do not cause logging for this type of - # permission. - # Follows the same format of - # [Binding.members][google.iam.v1.Binding.members]. - class AuditLogConfig - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - - # The list of valid permission types for which logging can be configured. - # Admin writes are always logged, and are not configurable. - module LogType - # Default case. Should never be this. - LOG_TYPE_UNSPECIFIED = 0 - - # Admin reads. Example: CloudIAM getIamPolicy - ADMIN_READ = 1 - - # Data writes. Example: CloudSQL Users create - DATA_WRITE = 2 - - # Data reads. Example: CloudSQL Users list - DATA_READ = 3 - end - end - - # The difference delta between two policies. - # @!attribute [rw] binding_deltas - # @return [::Array<::Google::Iam::V1::BindingDelta>] - # The delta for Bindings between two policies. - # @!attribute [rw] audit_config_deltas - # @return [::Array<::Google::Iam::V1::AuditConfigDelta>] - # The delta for AuditConfigs between two policies. - class PolicyDelta - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # One delta entry for Binding. Each individual change (only one member in each - # entry) to a binding will be a separate entry. - # @!attribute [rw] action - # @return [::Google::Iam::V1::BindingDelta::Action] - # The action that was performed on a Binding. - # Required - # @!attribute [rw] role - # @return [::String] - # Role that is assigned to `members`. - # For example, `roles/viewer`, `roles/editor`, or `roles/owner`. - # Required - # @!attribute [rw] member - # @return [::String] - # A single identity requesting access for a Google Cloud resource. - # Follows the same format of Binding.members. - # Required - # @!attribute [rw] condition - # @return [::Google::Type::Expr] - # The condition that is associated with this binding. - class BindingDelta - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - - # The type of action performed on a Binding in a policy. - module Action - # Unspecified. - ACTION_UNSPECIFIED = 0 - - # Addition of a Binding. - ADD = 1 - - # Removal of a Binding. - REMOVE = 2 - end - end - - # One delta entry for AuditConfig. Each individual change (only one - # exempted_member in each entry) to a AuditConfig will be a separate entry. - # @!attribute [rw] action - # @return [::Google::Iam::V1::AuditConfigDelta::Action] - # The action that was performed on an audit configuration in a policy. - # Required - # @!attribute [rw] service - # @return [::String] - # Specifies a service that was configured for Cloud Audit Logging. - # For example, `storage.googleapis.com`, `cloudsql.googleapis.com`. - # `allServices` is a special value that covers all services. - # Required - # @!attribute [rw] exempted_member - # @return [::String] - # A single identity that is exempted from "data access" audit - # logging for the `service` specified above. - # Follows the same format of Binding.members. - # @!attribute [rw] log_type - # @return [::String] - # Specifies the log_type that was be enabled. ADMIN_ACTIVITY is always - # enabled, and cannot be configured. - # Required - class AuditConfigDelta - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - - # The type of action performed on an audit configuration in a policy. - module Action - # Unspecified. - ACTION_UNSPECIFIED = 0 - - # Addition of an audit configuration. - ADD = 1 - - # Removal of an audit configuration. - REMOVE = 2 - end - end - end - end -end diff --git a/owl-bot-staging/google-cloud-security_center_management-v1/proto_docs/google/protobuf/any.rb b/owl-bot-staging/google-cloud-security_center_management-v1/proto_docs/google/protobuf/any.rb deleted file mode 100644 index 58691995f02e..000000000000 --- a/owl-bot-staging/google-cloud-security_center_management-v1/proto_docs/google/protobuf/any.rb +++ /dev/null @@ -1,145 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - - -module Google - module Protobuf - # `Any` contains an arbitrary serialized protocol buffer message along with a - # URL that describes the type of the serialized message. - # - # Protobuf library provides support to pack/unpack Any values in the form - # of utility functions or additional generated methods of the Any type. - # - # Example 1: Pack and unpack a message in C++. - # - # Foo foo = ...; - # Any any; - # any.PackFrom(foo); - # ... - # if (any.UnpackTo(&foo)) { - # ... - # } - # - # Example 2: Pack and unpack a message in Java. - # - # Foo foo = ...; - # Any any = Any.pack(foo); - # ... - # if (any.is(Foo.class)) { - # foo = any.unpack(Foo.class); - # } - # // or ... - # if (any.isSameTypeAs(Foo.getDefaultInstance())) { - # foo = any.unpack(Foo.getDefaultInstance()); - # } - # - # Example 3: Pack and unpack a message in Python. - # - # foo = Foo(...) - # any = Any() - # any.Pack(foo) - # ... - # if any.Is(Foo.DESCRIPTOR): - # any.Unpack(foo) - # ... - # - # Example 4: Pack and unpack a message in Go - # - # foo := &pb.Foo{...} - # any, err := anypb.New(foo) - # if err != nil { - # ... - # } - # ... - # foo := &pb.Foo{} - # if err := any.UnmarshalTo(foo); err != nil { - # ... - # } - # - # The pack methods provided by protobuf library will by default use - # 'type.googleapis.com/full.type.name' as the type URL and the unpack - # methods only use the fully qualified type name after the last '/' - # in the type URL, for example "foo.bar.com/x/y.z" will yield type - # name "y.z". - # - # JSON - # ==== - # The JSON representation of an `Any` value uses the regular - # representation of the deserialized, embedded message, with an - # additional field `@type` which contains the type URL. Example: - # - # package google.profile; - # message Person { - # string first_name = 1; - # string last_name = 2; - # } - # - # { - # "@type": "type.googleapis.com/google.profile.Person", - # "firstName": , - # "lastName": - # } - # - # If the embedded message type is well-known and has a custom JSON - # representation, that representation will be embedded adding a field - # `value` which holds the custom JSON in addition to the `@type` - # field. Example (for message [google.protobuf.Duration][]): - # - # { - # "@type": "type.googleapis.com/google.protobuf.Duration", - # "value": "1.212s" - # } - # @!attribute [rw] type_url - # @return [::String] - # A URL/resource name that uniquely identifies the type of the serialized - # protocol buffer message. This string must contain at least - # one "/" character. The last segment of the URL's path must represent - # the fully qualified name of the type (as in - # `path/google.protobuf.Duration`). The name should be in a canonical form - # (e.g., leading "." is not accepted). - # - # In practice, teams usually precompile into the binary all types that they - # expect it to use in the context of Any. However, for URLs which use the - # scheme `http`, `https`, or no scheme, one can optionally set up a type - # server that maps type URLs to message definitions as follows: - # - # * If no scheme is provided, `https` is assumed. - # * An HTTP GET on the URL must yield a [google.protobuf.Type][] - # value in binary format, or produce an error. - # * Applications are allowed to cache lookup results based on the - # URL, or have them precompiled into a binary to avoid any - # lookup. Therefore, binary compatibility needs to be preserved - # on changes to types. (Use versioned type names to manage - # breaking changes.) - # - # Note: this functionality is not currently available in the official - # protobuf release, and it is not used for type URLs beginning with - # type.googleapis.com. As of May 2023, there are no widely used type server - # implementations and no plans to implement one. - # - # Schemes other than `http`, `https` (or the empty scheme) might be - # used with implementation specific semantics. - # @!attribute [rw] value - # @return [::String] - # Must be a valid serialized protocol buffer of the above specified type. - class Any - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - end -end diff --git a/owl-bot-staging/google-cloud-security_center_management-v1/proto_docs/google/protobuf/duration.rb b/owl-bot-staging/google-cloud-security_center_management-v1/proto_docs/google/protobuf/duration.rb deleted file mode 100644 index ea59f1f91daf..000000000000 --- a/owl-bot-staging/google-cloud-security_center_management-v1/proto_docs/google/protobuf/duration.rb +++ /dev/null @@ -1,98 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - - -module Google - module Protobuf - # A Duration represents a signed, fixed-length span of time represented - # as a count of seconds and fractions of seconds at nanosecond - # resolution. It is independent of any calendar and concepts like "day" - # or "month". It is related to Timestamp in that the difference between - # two Timestamp values is a Duration and it can be added or subtracted - # from a Timestamp. Range is approximately +-10,000 years. - # - # # Examples - # - # Example 1: Compute Duration from two Timestamps in pseudo code. - # - # Timestamp start = ...; - # Timestamp end = ...; - # Duration duration = ...; - # - # duration.seconds = end.seconds - start.seconds; - # duration.nanos = end.nanos - start.nanos; - # - # if (duration.seconds < 0 && duration.nanos > 0) { - # duration.seconds += 1; - # duration.nanos -= 1000000000; - # } else if (duration.seconds > 0 && duration.nanos < 0) { - # duration.seconds -= 1; - # duration.nanos += 1000000000; - # } - # - # Example 2: Compute Timestamp from Timestamp + Duration in pseudo code. - # - # Timestamp start = ...; - # Duration duration = ...; - # Timestamp end = ...; - # - # end.seconds = start.seconds + duration.seconds; - # end.nanos = start.nanos + duration.nanos; - # - # if (end.nanos < 0) { - # end.seconds -= 1; - # end.nanos += 1000000000; - # } else if (end.nanos >= 1000000000) { - # end.seconds += 1; - # end.nanos -= 1000000000; - # } - # - # Example 3: Compute Duration from datetime.timedelta in Python. - # - # td = datetime.timedelta(days=3, minutes=10) - # duration = Duration() - # duration.FromTimedelta(td) - # - # # JSON Mapping - # - # In JSON format, the Duration type is encoded as a string rather than an - # object, where the string ends in the suffix "s" (indicating seconds) and - # is preceded by the number of seconds, with nanoseconds expressed as - # fractional seconds. For example, 3 seconds with 0 nanoseconds should be - # encoded in JSON format as "3s", while 3 seconds and 1 nanosecond should - # be expressed in JSON format as "3.000000001s", and 3 seconds and 1 - # microsecond should be expressed in JSON format as "3.000001s". - # @!attribute [rw] seconds - # @return [::Integer] - # Signed seconds of the span of time. Must be from -315,576,000,000 - # to +315,576,000,000 inclusive. Note: these bounds are computed from: - # 60 sec/min * 60 min/hr * 24 hr/day * 365.25 days/year * 10000 years - # @!attribute [rw] nanos - # @return [::Integer] - # Signed fractions of a second at nanosecond resolution of the span - # of time. Durations less than one second are represented with a 0 - # `seconds` field and a positive or negative `nanos` field. For durations - # of one second or more, a non-zero value for the `nanos` field must be - # of the same sign as the `seconds` field. Must be from -999,999,999 - # to +999,999,999 inclusive. - class Duration - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - end -end diff --git a/owl-bot-staging/google-cloud-security_center_management-v1/proto_docs/google/protobuf/empty.rb b/owl-bot-staging/google-cloud-security_center_management-v1/proto_docs/google/protobuf/empty.rb deleted file mode 100644 index 83e4481834a6..000000000000 --- a/owl-bot-staging/google-cloud-security_center_management-v1/proto_docs/google/protobuf/empty.rb +++ /dev/null @@ -1,34 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - - -module Google - module Protobuf - # A generic empty message that you can re-use to avoid defining duplicated - # empty messages in your APIs. A typical example is to use it as the request - # or the response type of an API method. For instance: - # - # service Foo { - # rpc Bar(google.protobuf.Empty) returns (google.protobuf.Empty); - # } - class Empty - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - end -end diff --git a/owl-bot-staging/google-cloud-security_center_management-v1/proto_docs/google/protobuf/field_mask.rb b/owl-bot-staging/google-cloud-security_center_management-v1/proto_docs/google/protobuf/field_mask.rb deleted file mode 100644 index 7f3ffc78601a..000000000000 --- a/owl-bot-staging/google-cloud-security_center_management-v1/proto_docs/google/protobuf/field_mask.rb +++ /dev/null @@ -1,229 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - - -module Google - module Protobuf - # `FieldMask` represents a set of symbolic field paths, for example: - # - # paths: "f.a" - # paths: "f.b.d" - # - # Here `f` represents a field in some root message, `a` and `b` - # fields in the message found in `f`, and `d` a field found in the - # message in `f.b`. - # - # Field masks are used to specify a subset of fields that should be - # returned by a get operation or modified by an update operation. - # Field masks also have a custom JSON encoding (see below). - # - # # Field Masks in Projections - # - # When used in the context of a projection, a response message or - # sub-message is filtered by the API to only contain those fields as - # specified in the mask. For example, if the mask in the previous - # example is applied to a response message as follows: - # - # f { - # a : 22 - # b { - # d : 1 - # x : 2 - # } - # y : 13 - # } - # z: 8 - # - # The result will not contain specific values for fields x,y and z - # (their value will be set to the default, and omitted in proto text - # output): - # - # - # f { - # a : 22 - # b { - # d : 1 - # } - # } - # - # A repeated field is not allowed except at the last position of a - # paths string. - # - # If a FieldMask object is not present in a get operation, the - # operation applies to all fields (as if a FieldMask of all fields - # had been specified). - # - # Note that a field mask does not necessarily apply to the - # top-level response message. In case of a REST get operation, the - # field mask applies directly to the response, but in case of a REST - # list operation, the mask instead applies to each individual message - # in the returned resource list. In case of a REST custom method, - # other definitions may be used. Where the mask applies will be - # clearly documented together with its declaration in the API. In - # any case, the effect on the returned resource/resources is required - # behavior for APIs. - # - # # Field Masks in Update Operations - # - # A field mask in update operations specifies which fields of the - # targeted resource are going to be updated. The API is required - # to only change the values of the fields as specified in the mask - # and leave the others untouched. If a resource is passed in to - # describe the updated values, the API ignores the values of all - # fields not covered by the mask. - # - # If a repeated field is specified for an update operation, new values will - # be appended to the existing repeated field in the target resource. Note that - # a repeated field is only allowed in the last position of a `paths` string. - # - # If a sub-message is specified in the last position of the field mask for an - # update operation, then new value will be merged into the existing sub-message - # in the target resource. - # - # For example, given the target message: - # - # f { - # b { - # d: 1 - # x: 2 - # } - # c: [1] - # } - # - # And an update message: - # - # f { - # b { - # d: 10 - # } - # c: [2] - # } - # - # then if the field mask is: - # - # paths: ["f.b", "f.c"] - # - # then the result will be: - # - # f { - # b { - # d: 10 - # x: 2 - # } - # c: [1, 2] - # } - # - # An implementation may provide options to override this default behavior for - # repeated and message fields. - # - # In order to reset a field's value to the default, the field must - # be in the mask and set to the default value in the provided resource. - # Hence, in order to reset all fields of a resource, provide a default - # instance of the resource and set all fields in the mask, or do - # not provide a mask as described below. - # - # If a field mask is not present on update, the operation applies to - # all fields (as if a field mask of all fields has been specified). - # Note that in the presence of schema evolution, this may mean that - # fields the client does not know and has therefore not filled into - # the request will be reset to their default. If this is unwanted - # behavior, a specific service may require a client to always specify - # a field mask, producing an error if not. - # - # As with get operations, the location of the resource which - # describes the updated values in the request message depends on the - # operation kind. In any case, the effect of the field mask is - # required to be honored by the API. - # - # ## Considerations for HTTP REST - # - # The HTTP kind of an update operation which uses a field mask must - # be set to PATCH instead of PUT in order to satisfy HTTP semantics - # (PUT must only be used for full updates). - # - # # JSON Encoding of Field Masks - # - # In JSON, a field mask is encoded as a single string where paths are - # separated by a comma. Fields name in each path are converted - # to/from lower-camel naming conventions. - # - # As an example, consider the following message declarations: - # - # message Profile { - # User user = 1; - # Photo photo = 2; - # } - # message User { - # string display_name = 1; - # string address = 2; - # } - # - # In proto a field mask for `Profile` may look as such: - # - # mask { - # paths: "user.display_name" - # paths: "photo" - # } - # - # In JSON, the same mask is represented as below: - # - # { - # mask: "user.displayName,photo" - # } - # - # # Field Masks and Oneof Fields - # - # Field masks treat fields in oneofs just as regular fields. Consider the - # following message: - # - # message SampleMessage { - # oneof test_oneof { - # string name = 4; - # SubMessage sub_message = 9; - # } - # } - # - # The field mask can be: - # - # mask { - # paths: "name" - # } - # - # Or: - # - # mask { - # paths: "sub_message" - # } - # - # Note that oneof type names ("test_oneof" in this case) cannot be used in - # paths. - # - # ## Field Mask Verification - # - # The implementation of any API method which has a FieldMask type field in the - # request should verify the included field paths, and return an - # `INVALID_ARGUMENT` error if any path is unmappable. - # @!attribute [rw] paths - # @return [::Array<::String>] - # The set of field mask paths. - class FieldMask - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - end -end diff --git a/owl-bot-staging/google-cloud-security_center_management-v1/proto_docs/google/protobuf/struct.rb b/owl-bot-staging/google-cloud-security_center_management-v1/proto_docs/google/protobuf/struct.rb deleted file mode 100644 index 39e1aca868d2..000000000000 --- a/owl-bot-staging/google-cloud-security_center_management-v1/proto_docs/google/protobuf/struct.rb +++ /dev/null @@ -1,108 +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 - # `Struct` represents a structured data value, consisting of fields - # which map to dynamically typed values. In some languages, `Struct` - # might be supported by a native representation. For example, in - # scripting languages like JS a struct is represented as an - # object. The details of that representation are described together - # with the proto support for the language. - # - # The JSON representation for `Struct` is JSON object. - # @!attribute [rw] fields - # @return [::Google::Protobuf::Map{::String => ::Google::Protobuf::Value}] - # Unordered map of dynamically typed values. - class Struct - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - - # @!attribute [rw] key - # @return [::String] - # @!attribute [rw] value - # @return [::Google::Protobuf::Value] - class FieldsEntry - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - end - - # `Value` represents a dynamically typed value which can be either - # null, a number, a string, a boolean, a recursive struct value, or a - # list of values. A producer of value is expected to set one of these - # variants. Absence of any variant indicates an error. - # - # The JSON representation for `Value` is JSON value. - # @!attribute [rw] null_value - # @return [::Google::Protobuf::NullValue] - # Represents a null value. - # - # Note: The following fields are mutually exclusive: `null_value`, `number_value`, `string_value`, `bool_value`, `struct_value`, `list_value`. If a field in that set is populated, all other fields in the set will automatically be cleared. - # @!attribute [rw] number_value - # @return [::Float] - # Represents a double value. - # - # Note: The following fields are mutually exclusive: `number_value`, `null_value`, `string_value`, `bool_value`, `struct_value`, `list_value`. If a field in that set is populated, all other fields in the set will automatically be cleared. - # @!attribute [rw] string_value - # @return [::String] - # Represents a string value. - # - # Note: The following fields are mutually exclusive: `string_value`, `null_value`, `number_value`, `bool_value`, `struct_value`, `list_value`. If a field in that set is populated, all other fields in the set will automatically be cleared. - # @!attribute [rw] bool_value - # @return [::Boolean] - # Represents a boolean value. - # - # Note: The following fields are mutually exclusive: `bool_value`, `null_value`, `number_value`, `string_value`, `struct_value`, `list_value`. If a field in that set is populated, all other fields in the set will automatically be cleared. - # @!attribute [rw] struct_value - # @return [::Google::Protobuf::Struct] - # Represents a structured value. - # - # Note: The following fields are mutually exclusive: `struct_value`, `null_value`, `number_value`, `string_value`, `bool_value`, `list_value`. If a field in that set is populated, all other fields in the set will automatically be cleared. - # @!attribute [rw] list_value - # @return [::Google::Protobuf::ListValue] - # Represents a repeated `Value`. - # - # Note: The following fields are mutually exclusive: `list_value`, `null_value`, `number_value`, `string_value`, `bool_value`, `struct_value`. If a field in that set is populated, all other fields in the set will automatically be cleared. - class Value - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # `ListValue` is a wrapper around a repeated field of values. - # - # The JSON representation for `ListValue` is JSON array. - # @!attribute [rw] values - # @return [::Array<::Google::Protobuf::Value>] - # Repeated field of dynamically typed values. - class ListValue - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # `NullValue` is a singleton enumeration to represent the null value for the - # `Value` type union. - # - # The JSON representation for `NullValue` is JSON `null`. - module NullValue - # Null value. - NULL_VALUE = 0 - end - end -end diff --git a/owl-bot-staging/google-cloud-security_center_management-v1/proto_docs/google/protobuf/timestamp.rb b/owl-bot-staging/google-cloud-security_center_management-v1/proto_docs/google/protobuf/timestamp.rb deleted file mode 100644 index 74352be9c58c..000000000000 --- a/owl-bot-staging/google-cloud-security_center_management-v1/proto_docs/google/protobuf/timestamp.rb +++ /dev/null @@ -1,127 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - - -module Google - module Protobuf - # A Timestamp represents a point in time independent of any time zone or local - # calendar, encoded as a count of seconds and fractions of seconds at - # nanosecond resolution. The count is relative to an epoch at UTC midnight on - # January 1, 1970, in the proleptic Gregorian calendar which extends the - # Gregorian calendar backwards to year one. - # - # All minutes are 60 seconds long. Leap seconds are "smeared" so that no leap - # second table is needed for interpretation, using a [24-hour linear - # smear](https://developers.google.com/time/smear). - # - # The range is from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59.999999999Z. By - # restricting to that range, we ensure that we can convert to and from [RFC - # 3339](https://www.ietf.org/rfc/rfc3339.txt) date strings. - # - # # Examples - # - # Example 1: Compute Timestamp from POSIX `time()`. - # - # Timestamp timestamp; - # timestamp.set_seconds(time(NULL)); - # timestamp.set_nanos(0); - # - # Example 2: Compute Timestamp from POSIX `gettimeofday()`. - # - # struct timeval tv; - # gettimeofday(&tv, NULL); - # - # Timestamp timestamp; - # timestamp.set_seconds(tv.tv_sec); - # timestamp.set_nanos(tv.tv_usec * 1000); - # - # Example 3: Compute Timestamp from Win32 `GetSystemTimeAsFileTime()`. - # - # FILETIME ft; - # GetSystemTimeAsFileTime(&ft); - # UINT64 ticks = (((UINT64)ft.dwHighDateTime) << 32) | ft.dwLowDateTime; - # - # // A Windows tick is 100 nanoseconds. Windows epoch 1601-01-01T00:00:00Z - # // is 11644473600 seconds before Unix epoch 1970-01-01T00:00:00Z. - # Timestamp timestamp; - # timestamp.set_seconds((INT64) ((ticks / 10000000) - 11644473600LL)); - # timestamp.set_nanos((INT32) ((ticks % 10000000) * 100)); - # - # Example 4: Compute Timestamp from Java `System.currentTimeMillis()`. - # - # long millis = System.currentTimeMillis(); - # - # Timestamp timestamp = Timestamp.newBuilder().setSeconds(millis / 1000) - # .setNanos((int) ((millis % 1000) * 1000000)).build(); - # - # Example 5: Compute Timestamp from Java `Instant.now()`. - # - # Instant now = Instant.now(); - # - # Timestamp timestamp = - # Timestamp.newBuilder().setSeconds(now.getEpochSecond()) - # .setNanos(now.getNano()).build(); - # - # Example 6: Compute Timestamp from current time in Python. - # - # timestamp = Timestamp() - # timestamp.GetCurrentTime() - # - # # JSON Mapping - # - # In JSON format, the Timestamp type is encoded as a string in the - # [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format. That is, the - # format is "\\{year}-\\{month}-\\{day}T\\{hour}:\\{min}:\\{sec}[.\\{frac_sec}]Z" - # where \\{year} is always expressed using four digits while \\{month}, \\{day}, - # \\{hour}, \\{min}, and \\{sec} are zero-padded to two digits each. The fractional - # seconds, which can go up to 9 digits (i.e. up to 1 nanosecond resolution), - # are optional. The "Z" suffix indicates the timezone ("UTC"); the timezone - # is required. A proto3 JSON serializer should always use UTC (as indicated by - # "Z") when printing the Timestamp type and a proto3 JSON parser should be - # able to accept both UTC and other timezones (as indicated by an offset). - # - # For example, "2017-01-15T01:30:15.01Z" encodes 15.01 seconds past - # 01:30 UTC on January 15, 2017. - # - # In JavaScript, one can convert a Date object to this format using the - # standard - # [toISOString()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toISOString) - # method. In Python, a standard `datetime.datetime` object can be converted - # to this format using - # [`strftime`](https://docs.python.org/2/library/time.html#time.strftime) with - # the time format spec '%Y-%m-%dT%H:%M:%S.%fZ'. Likewise, in Java, one can use - # the Joda Time's [`ISODateTimeFormat.dateTime()`]( - # http://joda-time.sourceforge.net/apidocs/org/joda/time/format/ISODateTimeFormat.html#dateTime() - # ) to obtain a formatter capable of generating timestamps in this format. - # @!attribute [rw] seconds - # @return [::Integer] - # Represents seconds of UTC time since Unix epoch - # 1970-01-01T00:00:00Z. Must be from 0001-01-01T00:00:00Z to - # 9999-12-31T23:59:59Z inclusive. - # @!attribute [rw] nanos - # @return [::Integer] - # Non-negative fractions of a second at nanosecond resolution. Negative - # second values with fractions must still have non-negative nanos values - # that count forward in time. Must be from 0 to 999,999,999 - # inclusive. - class Timestamp - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - end -end diff --git a/owl-bot-staging/google-cloud-security_center_management-v1/proto_docs/google/rpc/status.rb b/owl-bot-staging/google-cloud-security_center_management-v1/proto_docs/google/rpc/status.rb deleted file mode 100644 index c1a1c07eb2db..000000000000 --- a/owl-bot-staging/google-cloud-security_center_management-v1/proto_docs/google/rpc/status.rb +++ /dev/null @@ -1,48 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - - -module Google - module Rpc - # The `Status` type defines a logical error model that is suitable for - # different programming environments, including REST APIs and RPC APIs. It is - # used by [gRPC](https://github.com/grpc). Each `Status` message contains - # three pieces of data: error code, error message, and error details. - # - # You can find out more about this error model and how to work with it in the - # [API Design Guide](https://cloud.google.com/apis/design/errors). - # @!attribute [rw] code - # @return [::Integer] - # The status code, which should be an enum value of - # [google.rpc.Code][google.rpc.Code]. - # @!attribute [rw] message - # @return [::String] - # A developer-facing error message, which should be in English. Any - # user-facing error message should be localized and sent in the - # {::Google::Rpc::Status#details google.rpc.Status.details} field, or localized - # by the client. - # @!attribute [rw] details - # @return [::Array<::Google::Protobuf::Any>] - # A list of messages that carry the error details. There is a common set of - # message types for APIs to use. - class Status - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - end -end diff --git a/owl-bot-staging/google-cloud-security_center_management-v1/proto_docs/google/type/expr.rb b/owl-bot-staging/google-cloud-security_center_management-v1/proto_docs/google/type/expr.rb deleted file mode 100644 index 53e7733b6592..000000000000 --- a/owl-bot-staging/google-cloud-security_center_management-v1/proto_docs/google/type/expr.rb +++ /dev/null @@ -1,75 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - - -module Google - module Type - # Represents a textual expression in the Common Expression Language (CEL) - # syntax. CEL is a C-like expression language. The syntax and semantics of CEL - # are documented at https://github.com/google/cel-spec. - # - # Example (Comparison): - # - # title: "Summary size limit" - # description: "Determines if a summary is less than 100 chars" - # expression: "document.summary.size() < 100" - # - # Example (Equality): - # - # title: "Requestor is owner" - # description: "Determines if requestor is the document owner" - # expression: "document.owner == request.auth.claims.email" - # - # Example (Logic): - # - # title: "Public documents" - # description: "Determine whether the document should be publicly visible" - # expression: "document.type != 'private' && document.type != 'internal'" - # - # Example (Data Manipulation): - # - # title: "Notification string" - # description: "Create a notification string with a timestamp." - # expression: "'New message received at ' + string(document.create_time)" - # - # The exact variables and functions that may be referenced within an expression - # are determined by the service that evaluates it. See the service - # documentation for additional information. - # @!attribute [rw] expression - # @return [::String] - # Textual representation of an expression in Common Expression Language - # syntax. - # @!attribute [rw] title - # @return [::String] - # Optional. Title for the expression, i.e. a short string describing - # its purpose. This can be used e.g. in UIs which allow to enter the - # expression. - # @!attribute [rw] description - # @return [::String] - # Optional. Description of the expression. This is a longer text which - # describes the expression, e.g. when hovered over it in a UI. - # @!attribute [rw] location - # @return [::String] - # Optional. String indicating the location of the expression for error - # reporting, e.g. a file name and a position in the file. - class Expr - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - end -end diff --git a/owl-bot-staging/google-cloud-security_center_management-v1/snippets/Gemfile b/owl-bot-staging/google-cloud-security_center_management-v1/snippets/Gemfile deleted file mode 100644 index 48ea53e31c30..000000000000 --- a/owl-bot-staging/google-cloud-security_center_management-v1/snippets/Gemfile +++ /dev/null @@ -1,32 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -source "https://rubygems.org" - -if ENV["GOOGLE_CLOUD_SAMPLES_TEST"] == "master" - gem "google-cloud-security_center_management-v1", path: "../" -else - gem "google-cloud-security_center_management-v1" -end - -group :test do - gem "google-style", "~> 1.26.1" - gem "minitest", "~> 5.16" - gem "minitest-focus", "~> 1.1" - gem "minitest-hooks", "~> 1.5" -end diff --git a/owl-bot-staging/google-cloud-security_center_management-v1/snippets/security_center_management/create_event_threat_detection_custom_module.rb b/owl-bot-staging/google-cloud-security_center_management-v1/snippets/security_center_management/create_event_threat_detection_custom_module.rb deleted file mode 100644 index 1af62ea87528..000000000000 --- a/owl-bot-staging/google-cloud-security_center_management-v1/snippets/security_center_management/create_event_threat_detection_custom_module.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 securitycentermanagement_v1_generated_SecurityCenterManagement_CreateEventThreatDetectionCustomModule_sync] -require "google/cloud/security_center_management/v1" - -## -# Snippet for the create_event_threat_detection_custom_module call in the SecurityCenterManagement service -# -# This snippet has been automatically generated and should be regarded as a code -# template only. It will require modifications to work: -# - It may require correct/in-range values for request initialization. -# - It may require specifying regional endpoints when creating the service -# client as shown in https://cloud.google.com/ruby/docs/reference. -# -# This is an auto-generated example demonstrating basic usage of -# Google::Cloud::SecurityCenterManagement::V1::SecurityCenterManagement::Client#create_event_threat_detection_custom_module. -# -def create_event_threat_detection_custom_module - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::SecurityCenterManagement::V1::SecurityCenterManagement::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::SecurityCenterManagement::V1::CreateEventThreatDetectionCustomModuleRequest.new - - # Call the create_event_threat_detection_custom_module method. - result = client.create_event_threat_detection_custom_module request - - # The returned object is of type Google::Cloud::SecurityCenterManagement::V1::EventThreatDetectionCustomModule. - p result -end -# [END securitycentermanagement_v1_generated_SecurityCenterManagement_CreateEventThreatDetectionCustomModule_sync] diff --git a/owl-bot-staging/google-cloud-security_center_management-v1/snippets/security_center_management/create_security_health_analytics_custom_module.rb b/owl-bot-staging/google-cloud-security_center_management-v1/snippets/security_center_management/create_security_health_analytics_custom_module.rb deleted file mode 100644 index 345362f5da41..000000000000 --- a/owl-bot-staging/google-cloud-security_center_management-v1/snippets/security_center_management/create_security_health_analytics_custom_module.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 securitycentermanagement_v1_generated_SecurityCenterManagement_CreateSecurityHealthAnalyticsCustomModule_sync] -require "google/cloud/security_center_management/v1" - -## -# Snippet for the create_security_health_analytics_custom_module call in the SecurityCenterManagement service -# -# This snippet has been automatically generated and should be regarded as a code -# template only. It will require modifications to work: -# - It may require correct/in-range values for request initialization. -# - It may require specifying regional endpoints when creating the service -# client as shown in https://cloud.google.com/ruby/docs/reference. -# -# This is an auto-generated example demonstrating basic usage of -# Google::Cloud::SecurityCenterManagement::V1::SecurityCenterManagement::Client#create_security_health_analytics_custom_module. -# -def create_security_health_analytics_custom_module - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::SecurityCenterManagement::V1::SecurityCenterManagement::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::SecurityCenterManagement::V1::CreateSecurityHealthAnalyticsCustomModuleRequest.new - - # Call the create_security_health_analytics_custom_module method. - result = client.create_security_health_analytics_custom_module request - - # The returned object is of type Google::Cloud::SecurityCenterManagement::V1::SecurityHealthAnalyticsCustomModule. - p result -end -# [END securitycentermanagement_v1_generated_SecurityCenterManagement_CreateSecurityHealthAnalyticsCustomModule_sync] diff --git a/owl-bot-staging/google-cloud-security_center_management-v1/snippets/security_center_management/delete_event_threat_detection_custom_module.rb b/owl-bot-staging/google-cloud-security_center_management-v1/snippets/security_center_management/delete_event_threat_detection_custom_module.rb deleted file mode 100644 index 1a1782aec5de..000000000000 --- a/owl-bot-staging/google-cloud-security_center_management-v1/snippets/security_center_management/delete_event_threat_detection_custom_module.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 securitycentermanagement_v1_generated_SecurityCenterManagement_DeleteEventThreatDetectionCustomModule_sync] -require "google/cloud/security_center_management/v1" - -## -# Snippet for the delete_event_threat_detection_custom_module call in the SecurityCenterManagement service -# -# This snippet has been automatically generated and should be regarded as a code -# template only. It will require modifications to work: -# - It may require correct/in-range values for request initialization. -# - It may require specifying regional endpoints when creating the service -# client as shown in https://cloud.google.com/ruby/docs/reference. -# -# This is an auto-generated example demonstrating basic usage of -# Google::Cloud::SecurityCenterManagement::V1::SecurityCenterManagement::Client#delete_event_threat_detection_custom_module. -# -def delete_event_threat_detection_custom_module - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::SecurityCenterManagement::V1::SecurityCenterManagement::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::SecurityCenterManagement::V1::DeleteEventThreatDetectionCustomModuleRequest.new - - # Call the delete_event_threat_detection_custom_module method. - result = client.delete_event_threat_detection_custom_module request - - # The returned object is of type Google::Protobuf::Empty. - p result -end -# [END securitycentermanagement_v1_generated_SecurityCenterManagement_DeleteEventThreatDetectionCustomModule_sync] diff --git a/owl-bot-staging/google-cloud-security_center_management-v1/snippets/security_center_management/delete_security_health_analytics_custom_module.rb b/owl-bot-staging/google-cloud-security_center_management-v1/snippets/security_center_management/delete_security_health_analytics_custom_module.rb deleted file mode 100644 index 7c265ee8e5ba..000000000000 --- a/owl-bot-staging/google-cloud-security_center_management-v1/snippets/security_center_management/delete_security_health_analytics_custom_module.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 securitycentermanagement_v1_generated_SecurityCenterManagement_DeleteSecurityHealthAnalyticsCustomModule_sync] -require "google/cloud/security_center_management/v1" - -## -# Snippet for the delete_security_health_analytics_custom_module call in the SecurityCenterManagement service -# -# This snippet has been automatically generated and should be regarded as a code -# template only. It will require modifications to work: -# - It may require correct/in-range values for request initialization. -# - It may require specifying regional endpoints when creating the service -# client as shown in https://cloud.google.com/ruby/docs/reference. -# -# This is an auto-generated example demonstrating basic usage of -# Google::Cloud::SecurityCenterManagement::V1::SecurityCenterManagement::Client#delete_security_health_analytics_custom_module. -# -def delete_security_health_analytics_custom_module - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::SecurityCenterManagement::V1::SecurityCenterManagement::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::SecurityCenterManagement::V1::DeleteSecurityHealthAnalyticsCustomModuleRequest.new - - # Call the delete_security_health_analytics_custom_module method. - result = client.delete_security_health_analytics_custom_module request - - # The returned object is of type Google::Protobuf::Empty. - p result -end -# [END securitycentermanagement_v1_generated_SecurityCenterManagement_DeleteSecurityHealthAnalyticsCustomModule_sync] diff --git a/owl-bot-staging/google-cloud-security_center_management-v1/snippets/security_center_management/get_effective_event_threat_detection_custom_module.rb b/owl-bot-staging/google-cloud-security_center_management-v1/snippets/security_center_management/get_effective_event_threat_detection_custom_module.rb deleted file mode 100644 index 9dfd40d071fc..000000000000 --- a/owl-bot-staging/google-cloud-security_center_management-v1/snippets/security_center_management/get_effective_event_threat_detection_custom_module.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 securitycentermanagement_v1_generated_SecurityCenterManagement_GetEffectiveEventThreatDetectionCustomModule_sync] -require "google/cloud/security_center_management/v1" - -## -# Snippet for the get_effective_event_threat_detection_custom_module call in the SecurityCenterManagement service -# -# This snippet has been automatically generated and should be regarded as a code -# template only. It will require modifications to work: -# - It may require correct/in-range values for request initialization. -# - It may require specifying regional endpoints when creating the service -# client as shown in https://cloud.google.com/ruby/docs/reference. -# -# This is an auto-generated example demonstrating basic usage of -# Google::Cloud::SecurityCenterManagement::V1::SecurityCenterManagement::Client#get_effective_event_threat_detection_custom_module. -# -def get_effective_event_threat_detection_custom_module - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::SecurityCenterManagement::V1::SecurityCenterManagement::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::SecurityCenterManagement::V1::GetEffectiveEventThreatDetectionCustomModuleRequest.new - - # Call the get_effective_event_threat_detection_custom_module method. - result = client.get_effective_event_threat_detection_custom_module request - - # The returned object is of type Google::Cloud::SecurityCenterManagement::V1::EffectiveEventThreatDetectionCustomModule. - p result -end -# [END securitycentermanagement_v1_generated_SecurityCenterManagement_GetEffectiveEventThreatDetectionCustomModule_sync] diff --git a/owl-bot-staging/google-cloud-security_center_management-v1/snippets/security_center_management/get_effective_security_health_analytics_custom_module.rb b/owl-bot-staging/google-cloud-security_center_management-v1/snippets/security_center_management/get_effective_security_health_analytics_custom_module.rb deleted file mode 100644 index 6fe48aa1f67b..000000000000 --- a/owl-bot-staging/google-cloud-security_center_management-v1/snippets/security_center_management/get_effective_security_health_analytics_custom_module.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 securitycentermanagement_v1_generated_SecurityCenterManagement_GetEffectiveSecurityHealthAnalyticsCustomModule_sync] -require "google/cloud/security_center_management/v1" - -## -# Snippet for the get_effective_security_health_analytics_custom_module call in the SecurityCenterManagement service -# -# This snippet has been automatically generated and should be regarded as a code -# template only. It will require modifications to work: -# - It may require correct/in-range values for request initialization. -# - It may require specifying regional endpoints when creating the service -# client as shown in https://cloud.google.com/ruby/docs/reference. -# -# This is an auto-generated example demonstrating basic usage of -# Google::Cloud::SecurityCenterManagement::V1::SecurityCenterManagement::Client#get_effective_security_health_analytics_custom_module. -# -def get_effective_security_health_analytics_custom_module - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::SecurityCenterManagement::V1::SecurityCenterManagement::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::SecurityCenterManagement::V1::GetEffectiveSecurityHealthAnalyticsCustomModuleRequest.new - - # Call the get_effective_security_health_analytics_custom_module method. - result = client.get_effective_security_health_analytics_custom_module request - - # The returned object is of type Google::Cloud::SecurityCenterManagement::V1::EffectiveSecurityHealthAnalyticsCustomModule. - p result -end -# [END securitycentermanagement_v1_generated_SecurityCenterManagement_GetEffectiveSecurityHealthAnalyticsCustomModule_sync] diff --git a/owl-bot-staging/google-cloud-security_center_management-v1/snippets/security_center_management/get_event_threat_detection_custom_module.rb b/owl-bot-staging/google-cloud-security_center_management-v1/snippets/security_center_management/get_event_threat_detection_custom_module.rb deleted file mode 100644 index e772e63bd4e2..000000000000 --- a/owl-bot-staging/google-cloud-security_center_management-v1/snippets/security_center_management/get_event_threat_detection_custom_module.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 securitycentermanagement_v1_generated_SecurityCenterManagement_GetEventThreatDetectionCustomModule_sync] -require "google/cloud/security_center_management/v1" - -## -# Snippet for the get_event_threat_detection_custom_module call in the SecurityCenterManagement service -# -# This snippet has been automatically generated and should be regarded as a code -# template only. It will require modifications to work: -# - It may require correct/in-range values for request initialization. -# - It may require specifying regional endpoints when creating the service -# client as shown in https://cloud.google.com/ruby/docs/reference. -# -# This is an auto-generated example demonstrating basic usage of -# Google::Cloud::SecurityCenterManagement::V1::SecurityCenterManagement::Client#get_event_threat_detection_custom_module. -# -def get_event_threat_detection_custom_module - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::SecurityCenterManagement::V1::SecurityCenterManagement::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::SecurityCenterManagement::V1::GetEventThreatDetectionCustomModuleRequest.new - - # Call the get_event_threat_detection_custom_module method. - result = client.get_event_threat_detection_custom_module request - - # The returned object is of type Google::Cloud::SecurityCenterManagement::V1::EventThreatDetectionCustomModule. - p result -end -# [END securitycentermanagement_v1_generated_SecurityCenterManagement_GetEventThreatDetectionCustomModule_sync] diff --git a/owl-bot-staging/google-cloud-security_center_management-v1/snippets/security_center_management/get_security_center_service.rb b/owl-bot-staging/google-cloud-security_center_management-v1/snippets/security_center_management/get_security_center_service.rb deleted file mode 100644 index 6034fcfea4db..000000000000 --- a/owl-bot-staging/google-cloud-security_center_management-v1/snippets/security_center_management/get_security_center_service.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 securitycentermanagement_v1_generated_SecurityCenterManagement_GetSecurityCenterService_sync] -require "google/cloud/security_center_management/v1" - -## -# Snippet for the get_security_center_service call in the SecurityCenterManagement service -# -# This snippet has been automatically generated and should be regarded as a code -# template only. It will require modifications to work: -# - It may require correct/in-range values for request initialization. -# - It may require specifying regional endpoints when creating the service -# client as shown in https://cloud.google.com/ruby/docs/reference. -# -# This is an auto-generated example demonstrating basic usage of -# Google::Cloud::SecurityCenterManagement::V1::SecurityCenterManagement::Client#get_security_center_service. -# -def get_security_center_service - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::SecurityCenterManagement::V1::SecurityCenterManagement::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::SecurityCenterManagement::V1::GetSecurityCenterServiceRequest.new - - # Call the get_security_center_service method. - result = client.get_security_center_service request - - # The returned object is of type Google::Cloud::SecurityCenterManagement::V1::SecurityCenterService. - p result -end -# [END securitycentermanagement_v1_generated_SecurityCenterManagement_GetSecurityCenterService_sync] diff --git a/owl-bot-staging/google-cloud-security_center_management-v1/snippets/security_center_management/get_security_health_analytics_custom_module.rb b/owl-bot-staging/google-cloud-security_center_management-v1/snippets/security_center_management/get_security_health_analytics_custom_module.rb deleted file mode 100644 index bb916a20de63..000000000000 --- a/owl-bot-staging/google-cloud-security_center_management-v1/snippets/security_center_management/get_security_health_analytics_custom_module.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 securitycentermanagement_v1_generated_SecurityCenterManagement_GetSecurityHealthAnalyticsCustomModule_sync] -require "google/cloud/security_center_management/v1" - -## -# Snippet for the get_security_health_analytics_custom_module call in the SecurityCenterManagement service -# -# This snippet has been automatically generated and should be regarded as a code -# template only. It will require modifications to work: -# - It may require correct/in-range values for request initialization. -# - It may require specifying regional endpoints when creating the service -# client as shown in https://cloud.google.com/ruby/docs/reference. -# -# This is an auto-generated example demonstrating basic usage of -# Google::Cloud::SecurityCenterManagement::V1::SecurityCenterManagement::Client#get_security_health_analytics_custom_module. -# -def get_security_health_analytics_custom_module - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::SecurityCenterManagement::V1::SecurityCenterManagement::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::SecurityCenterManagement::V1::GetSecurityHealthAnalyticsCustomModuleRequest.new - - # Call the get_security_health_analytics_custom_module method. - result = client.get_security_health_analytics_custom_module request - - # The returned object is of type Google::Cloud::SecurityCenterManagement::V1::SecurityHealthAnalyticsCustomModule. - p result -end -# [END securitycentermanagement_v1_generated_SecurityCenterManagement_GetSecurityHealthAnalyticsCustomModule_sync] diff --git a/owl-bot-staging/google-cloud-security_center_management-v1/snippets/security_center_management/list_descendant_event_threat_detection_custom_modules.rb b/owl-bot-staging/google-cloud-security_center_management-v1/snippets/security_center_management/list_descendant_event_threat_detection_custom_modules.rb deleted file mode 100644 index f36375df2816..000000000000 --- a/owl-bot-staging/google-cloud-security_center_management-v1/snippets/security_center_management/list_descendant_event_threat_detection_custom_modules.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 securitycentermanagement_v1_generated_SecurityCenterManagement_ListDescendantEventThreatDetectionCustomModules_sync] -require "google/cloud/security_center_management/v1" - -## -# Snippet for the list_descendant_event_threat_detection_custom_modules call in the SecurityCenterManagement service -# -# This snippet has been automatically generated and should be regarded as a code -# template only. It will require modifications to work: -# - It may require correct/in-range values for request initialization. -# - It may require specifying regional endpoints when creating the service -# client as shown in https://cloud.google.com/ruby/docs/reference. -# -# This is an auto-generated example demonstrating basic usage of -# Google::Cloud::SecurityCenterManagement::V1::SecurityCenterManagement::Client#list_descendant_event_threat_detection_custom_modules. -# -def list_descendant_event_threat_detection_custom_modules - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::SecurityCenterManagement::V1::SecurityCenterManagement::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::SecurityCenterManagement::V1::ListDescendantEventThreatDetectionCustomModulesRequest.new - - # Call the list_descendant_event_threat_detection_custom_modules method. - result = client.list_descendant_event_threat_detection_custom_modules request - - # The returned object is of type Gapic::PagedEnumerable. You can iterate - # over elements, and API calls will be issued to fetch pages as needed. - result.each do |item| - # Each element is of type ::Google::Cloud::SecurityCenterManagement::V1::EventThreatDetectionCustomModule. - p item - end -end -# [END securitycentermanagement_v1_generated_SecurityCenterManagement_ListDescendantEventThreatDetectionCustomModules_sync] diff --git a/owl-bot-staging/google-cloud-security_center_management-v1/snippets/security_center_management/list_descendant_security_health_analytics_custom_modules.rb b/owl-bot-staging/google-cloud-security_center_management-v1/snippets/security_center_management/list_descendant_security_health_analytics_custom_modules.rb deleted file mode 100644 index 7cfa0c972603..000000000000 --- a/owl-bot-staging/google-cloud-security_center_management-v1/snippets/security_center_management/list_descendant_security_health_analytics_custom_modules.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 securitycentermanagement_v1_generated_SecurityCenterManagement_ListDescendantSecurityHealthAnalyticsCustomModules_sync] -require "google/cloud/security_center_management/v1" - -## -# Snippet for the list_descendant_security_health_analytics_custom_modules call in the SecurityCenterManagement service -# -# This snippet has been automatically generated and should be regarded as a code -# template only. It will require modifications to work: -# - It may require correct/in-range values for request initialization. -# - It may require specifying regional endpoints when creating the service -# client as shown in https://cloud.google.com/ruby/docs/reference. -# -# This is an auto-generated example demonstrating basic usage of -# Google::Cloud::SecurityCenterManagement::V1::SecurityCenterManagement::Client#list_descendant_security_health_analytics_custom_modules. -# -def list_descendant_security_health_analytics_custom_modules - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::SecurityCenterManagement::V1::SecurityCenterManagement::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::SecurityCenterManagement::V1::ListDescendantSecurityHealthAnalyticsCustomModulesRequest.new - - # Call the list_descendant_security_health_analytics_custom_modules method. - result = client.list_descendant_security_health_analytics_custom_modules request - - # The returned object is of type Gapic::PagedEnumerable. You can iterate - # over elements, and API calls will be issued to fetch pages as needed. - result.each do |item| - # Each element is of type ::Google::Cloud::SecurityCenterManagement::V1::SecurityHealthAnalyticsCustomModule. - p item - end -end -# [END securitycentermanagement_v1_generated_SecurityCenterManagement_ListDescendantSecurityHealthAnalyticsCustomModules_sync] diff --git a/owl-bot-staging/google-cloud-security_center_management-v1/snippets/security_center_management/list_effective_event_threat_detection_custom_modules.rb b/owl-bot-staging/google-cloud-security_center_management-v1/snippets/security_center_management/list_effective_event_threat_detection_custom_modules.rb deleted file mode 100644 index 4c7f69640d8a..000000000000 --- a/owl-bot-staging/google-cloud-security_center_management-v1/snippets/security_center_management/list_effective_event_threat_detection_custom_modules.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 securitycentermanagement_v1_generated_SecurityCenterManagement_ListEffectiveEventThreatDetectionCustomModules_sync] -require "google/cloud/security_center_management/v1" - -## -# Snippet for the list_effective_event_threat_detection_custom_modules call in the SecurityCenterManagement service -# -# This snippet has been automatically generated and should be regarded as a code -# template only. It will require modifications to work: -# - It may require correct/in-range values for request initialization. -# - It may require specifying regional endpoints when creating the service -# client as shown in https://cloud.google.com/ruby/docs/reference. -# -# This is an auto-generated example demonstrating basic usage of -# Google::Cloud::SecurityCenterManagement::V1::SecurityCenterManagement::Client#list_effective_event_threat_detection_custom_modules. -# -def list_effective_event_threat_detection_custom_modules - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::SecurityCenterManagement::V1::SecurityCenterManagement::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::SecurityCenterManagement::V1::ListEffectiveEventThreatDetectionCustomModulesRequest.new - - # Call the list_effective_event_threat_detection_custom_modules method. - result = client.list_effective_event_threat_detection_custom_modules request - - # The returned object is of type Gapic::PagedEnumerable. You can iterate - # over elements, and API calls will be issued to fetch pages as needed. - result.each do |item| - # Each element is of type ::Google::Cloud::SecurityCenterManagement::V1::EffectiveEventThreatDetectionCustomModule. - p item - end -end -# [END securitycentermanagement_v1_generated_SecurityCenterManagement_ListEffectiveEventThreatDetectionCustomModules_sync] diff --git a/owl-bot-staging/google-cloud-security_center_management-v1/snippets/security_center_management/list_effective_security_health_analytics_custom_modules.rb b/owl-bot-staging/google-cloud-security_center_management-v1/snippets/security_center_management/list_effective_security_health_analytics_custom_modules.rb deleted file mode 100644 index 28d70b7bc51f..000000000000 --- a/owl-bot-staging/google-cloud-security_center_management-v1/snippets/security_center_management/list_effective_security_health_analytics_custom_modules.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 securitycentermanagement_v1_generated_SecurityCenterManagement_ListEffectiveSecurityHealthAnalyticsCustomModules_sync] -require "google/cloud/security_center_management/v1" - -## -# Snippet for the list_effective_security_health_analytics_custom_modules call in the SecurityCenterManagement service -# -# This snippet has been automatically generated and should be regarded as a code -# template only. It will require modifications to work: -# - It may require correct/in-range values for request initialization. -# - It may require specifying regional endpoints when creating the service -# client as shown in https://cloud.google.com/ruby/docs/reference. -# -# This is an auto-generated example demonstrating basic usage of -# Google::Cloud::SecurityCenterManagement::V1::SecurityCenterManagement::Client#list_effective_security_health_analytics_custom_modules. -# -def list_effective_security_health_analytics_custom_modules - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::SecurityCenterManagement::V1::SecurityCenterManagement::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::SecurityCenterManagement::V1::ListEffectiveSecurityHealthAnalyticsCustomModulesRequest.new - - # Call the list_effective_security_health_analytics_custom_modules method. - result = client.list_effective_security_health_analytics_custom_modules request - - # The returned object is of type Gapic::PagedEnumerable. You can iterate - # over elements, and API calls will be issued to fetch pages as needed. - result.each do |item| - # Each element is of type ::Google::Cloud::SecurityCenterManagement::V1::EffectiveSecurityHealthAnalyticsCustomModule. - p item - end -end -# [END securitycentermanagement_v1_generated_SecurityCenterManagement_ListEffectiveSecurityHealthAnalyticsCustomModules_sync] diff --git a/owl-bot-staging/google-cloud-security_center_management-v1/snippets/security_center_management/list_event_threat_detection_custom_modules.rb b/owl-bot-staging/google-cloud-security_center_management-v1/snippets/security_center_management/list_event_threat_detection_custom_modules.rb deleted file mode 100644 index fc62f7c99e51..000000000000 --- a/owl-bot-staging/google-cloud-security_center_management-v1/snippets/security_center_management/list_event_threat_detection_custom_modules.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 securitycentermanagement_v1_generated_SecurityCenterManagement_ListEventThreatDetectionCustomModules_sync] -require "google/cloud/security_center_management/v1" - -## -# Snippet for the list_event_threat_detection_custom_modules call in the SecurityCenterManagement service -# -# This snippet has been automatically generated and should be regarded as a code -# template only. It will require modifications to work: -# - It may require correct/in-range values for request initialization. -# - It may require specifying regional endpoints when creating the service -# client as shown in https://cloud.google.com/ruby/docs/reference. -# -# This is an auto-generated example demonstrating basic usage of -# Google::Cloud::SecurityCenterManagement::V1::SecurityCenterManagement::Client#list_event_threat_detection_custom_modules. -# -def list_event_threat_detection_custom_modules - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::SecurityCenterManagement::V1::SecurityCenterManagement::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::SecurityCenterManagement::V1::ListEventThreatDetectionCustomModulesRequest.new - - # Call the list_event_threat_detection_custom_modules method. - result = client.list_event_threat_detection_custom_modules request - - # The returned object is of type Gapic::PagedEnumerable. You can iterate - # over elements, and API calls will be issued to fetch pages as needed. - result.each do |item| - # Each element is of type ::Google::Cloud::SecurityCenterManagement::V1::EventThreatDetectionCustomModule. - p item - end -end -# [END securitycentermanagement_v1_generated_SecurityCenterManagement_ListEventThreatDetectionCustomModules_sync] diff --git a/owl-bot-staging/google-cloud-security_center_management-v1/snippets/security_center_management/list_security_center_services.rb b/owl-bot-staging/google-cloud-security_center_management-v1/snippets/security_center_management/list_security_center_services.rb deleted file mode 100644 index 3c2cc1f945c6..000000000000 --- a/owl-bot-staging/google-cloud-security_center_management-v1/snippets/security_center_management/list_security_center_services.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 securitycentermanagement_v1_generated_SecurityCenterManagement_ListSecurityCenterServices_sync] -require "google/cloud/security_center_management/v1" - -## -# Snippet for the list_security_center_services call in the SecurityCenterManagement service -# -# This snippet has been automatically generated and should be regarded as a code -# template only. It will require modifications to work: -# - It may require correct/in-range values for request initialization. -# - It may require specifying regional endpoints when creating the service -# client as shown in https://cloud.google.com/ruby/docs/reference. -# -# This is an auto-generated example demonstrating basic usage of -# Google::Cloud::SecurityCenterManagement::V1::SecurityCenterManagement::Client#list_security_center_services. -# -def list_security_center_services - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::SecurityCenterManagement::V1::SecurityCenterManagement::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::SecurityCenterManagement::V1::ListSecurityCenterServicesRequest.new - - # Call the list_security_center_services method. - result = client.list_security_center_services request - - # The returned object is of type Gapic::PagedEnumerable. You can iterate - # over elements, and API calls will be issued to fetch pages as needed. - result.each do |item| - # Each element is of type ::Google::Cloud::SecurityCenterManagement::V1::SecurityCenterService. - p item - end -end -# [END securitycentermanagement_v1_generated_SecurityCenterManagement_ListSecurityCenterServices_sync] diff --git a/owl-bot-staging/google-cloud-security_center_management-v1/snippets/security_center_management/list_security_health_analytics_custom_modules.rb b/owl-bot-staging/google-cloud-security_center_management-v1/snippets/security_center_management/list_security_health_analytics_custom_modules.rb deleted file mode 100644 index 38701f9cc760..000000000000 --- a/owl-bot-staging/google-cloud-security_center_management-v1/snippets/security_center_management/list_security_health_analytics_custom_modules.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 securitycentermanagement_v1_generated_SecurityCenterManagement_ListSecurityHealthAnalyticsCustomModules_sync] -require "google/cloud/security_center_management/v1" - -## -# Snippet for the list_security_health_analytics_custom_modules call in the SecurityCenterManagement service -# -# This snippet has been automatically generated and should be regarded as a code -# template only. It will require modifications to work: -# - It may require correct/in-range values for request initialization. -# - It may require specifying regional endpoints when creating the service -# client as shown in https://cloud.google.com/ruby/docs/reference. -# -# This is an auto-generated example demonstrating basic usage of -# Google::Cloud::SecurityCenterManagement::V1::SecurityCenterManagement::Client#list_security_health_analytics_custom_modules. -# -def list_security_health_analytics_custom_modules - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::SecurityCenterManagement::V1::SecurityCenterManagement::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::SecurityCenterManagement::V1::ListSecurityHealthAnalyticsCustomModulesRequest.new - - # Call the list_security_health_analytics_custom_modules method. - result = client.list_security_health_analytics_custom_modules request - - # The returned object is of type Gapic::PagedEnumerable. You can iterate - # over elements, and API calls will be issued to fetch pages as needed. - result.each do |item| - # Each element is of type ::Google::Cloud::SecurityCenterManagement::V1::SecurityHealthAnalyticsCustomModule. - p item - end -end -# [END securitycentermanagement_v1_generated_SecurityCenterManagement_ListSecurityHealthAnalyticsCustomModules_sync] diff --git a/owl-bot-staging/google-cloud-security_center_management-v1/snippets/security_center_management/simulate_security_health_analytics_custom_module.rb b/owl-bot-staging/google-cloud-security_center_management-v1/snippets/security_center_management/simulate_security_health_analytics_custom_module.rb deleted file mode 100644 index a87f00cd27b9..000000000000 --- a/owl-bot-staging/google-cloud-security_center_management-v1/snippets/security_center_management/simulate_security_health_analytics_custom_module.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 securitycentermanagement_v1_generated_SecurityCenterManagement_SimulateSecurityHealthAnalyticsCustomModule_sync] -require "google/cloud/security_center_management/v1" - -## -# Snippet for the simulate_security_health_analytics_custom_module call in the SecurityCenterManagement service -# -# This snippet has been automatically generated and should be regarded as a code -# template only. It will require modifications to work: -# - It may require correct/in-range values for request initialization. -# - It may require specifying regional endpoints when creating the service -# client as shown in https://cloud.google.com/ruby/docs/reference. -# -# This is an auto-generated example demonstrating basic usage of -# Google::Cloud::SecurityCenterManagement::V1::SecurityCenterManagement::Client#simulate_security_health_analytics_custom_module. -# -def simulate_security_health_analytics_custom_module - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::SecurityCenterManagement::V1::SecurityCenterManagement::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::SecurityCenterManagement::V1::SimulateSecurityHealthAnalyticsCustomModuleRequest.new - - # Call the simulate_security_health_analytics_custom_module method. - result = client.simulate_security_health_analytics_custom_module request - - # The returned object is of type Google::Cloud::SecurityCenterManagement::V1::SimulateSecurityHealthAnalyticsCustomModuleResponse. - p result -end -# [END securitycentermanagement_v1_generated_SecurityCenterManagement_SimulateSecurityHealthAnalyticsCustomModule_sync] diff --git a/owl-bot-staging/google-cloud-security_center_management-v1/snippets/security_center_management/update_event_threat_detection_custom_module.rb b/owl-bot-staging/google-cloud-security_center_management-v1/snippets/security_center_management/update_event_threat_detection_custom_module.rb deleted file mode 100644 index 3551bb287965..000000000000 --- a/owl-bot-staging/google-cloud-security_center_management-v1/snippets/security_center_management/update_event_threat_detection_custom_module.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 securitycentermanagement_v1_generated_SecurityCenterManagement_UpdateEventThreatDetectionCustomModule_sync] -require "google/cloud/security_center_management/v1" - -## -# Snippet for the update_event_threat_detection_custom_module call in the SecurityCenterManagement service -# -# This snippet has been automatically generated and should be regarded as a code -# template only. It will require modifications to work: -# - It may require correct/in-range values for request initialization. -# - It may require specifying regional endpoints when creating the service -# client as shown in https://cloud.google.com/ruby/docs/reference. -# -# This is an auto-generated example demonstrating basic usage of -# Google::Cloud::SecurityCenterManagement::V1::SecurityCenterManagement::Client#update_event_threat_detection_custom_module. -# -def update_event_threat_detection_custom_module - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::SecurityCenterManagement::V1::SecurityCenterManagement::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::SecurityCenterManagement::V1::UpdateEventThreatDetectionCustomModuleRequest.new - - # Call the update_event_threat_detection_custom_module method. - result = client.update_event_threat_detection_custom_module request - - # The returned object is of type Google::Cloud::SecurityCenterManagement::V1::EventThreatDetectionCustomModule. - p result -end -# [END securitycentermanagement_v1_generated_SecurityCenterManagement_UpdateEventThreatDetectionCustomModule_sync] diff --git a/owl-bot-staging/google-cloud-security_center_management-v1/snippets/security_center_management/update_security_center_service.rb b/owl-bot-staging/google-cloud-security_center_management-v1/snippets/security_center_management/update_security_center_service.rb deleted file mode 100644 index 4abb4dcae4a3..000000000000 --- a/owl-bot-staging/google-cloud-security_center_management-v1/snippets/security_center_management/update_security_center_service.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 securitycentermanagement_v1_generated_SecurityCenterManagement_UpdateSecurityCenterService_sync] -require "google/cloud/security_center_management/v1" - -## -# Snippet for the update_security_center_service call in the SecurityCenterManagement service -# -# This snippet has been automatically generated and should be regarded as a code -# template only. It will require modifications to work: -# - It may require correct/in-range values for request initialization. -# - It may require specifying regional endpoints when creating the service -# client as shown in https://cloud.google.com/ruby/docs/reference. -# -# This is an auto-generated example demonstrating basic usage of -# Google::Cloud::SecurityCenterManagement::V1::SecurityCenterManagement::Client#update_security_center_service. -# -def update_security_center_service - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::SecurityCenterManagement::V1::SecurityCenterManagement::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::SecurityCenterManagement::V1::UpdateSecurityCenterServiceRequest.new - - # Call the update_security_center_service method. - result = client.update_security_center_service request - - # The returned object is of type Google::Cloud::SecurityCenterManagement::V1::SecurityCenterService. - p result -end -# [END securitycentermanagement_v1_generated_SecurityCenterManagement_UpdateSecurityCenterService_sync] diff --git a/owl-bot-staging/google-cloud-security_center_management-v1/snippets/security_center_management/update_security_health_analytics_custom_module.rb b/owl-bot-staging/google-cloud-security_center_management-v1/snippets/security_center_management/update_security_health_analytics_custom_module.rb deleted file mode 100644 index 7aef0a715144..000000000000 --- a/owl-bot-staging/google-cloud-security_center_management-v1/snippets/security_center_management/update_security_health_analytics_custom_module.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 securitycentermanagement_v1_generated_SecurityCenterManagement_UpdateSecurityHealthAnalyticsCustomModule_sync] -require "google/cloud/security_center_management/v1" - -## -# Snippet for the update_security_health_analytics_custom_module call in the SecurityCenterManagement service -# -# This snippet has been automatically generated and should be regarded as a code -# template only. It will require modifications to work: -# - It may require correct/in-range values for request initialization. -# - It may require specifying regional endpoints when creating the service -# client as shown in https://cloud.google.com/ruby/docs/reference. -# -# This is an auto-generated example demonstrating basic usage of -# Google::Cloud::SecurityCenterManagement::V1::SecurityCenterManagement::Client#update_security_health_analytics_custom_module. -# -def update_security_health_analytics_custom_module - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::SecurityCenterManagement::V1::SecurityCenterManagement::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::SecurityCenterManagement::V1::UpdateSecurityHealthAnalyticsCustomModuleRequest.new - - # Call the update_security_health_analytics_custom_module method. - result = client.update_security_health_analytics_custom_module request - - # The returned object is of type Google::Cloud::SecurityCenterManagement::V1::SecurityHealthAnalyticsCustomModule. - p result -end -# [END securitycentermanagement_v1_generated_SecurityCenterManagement_UpdateSecurityHealthAnalyticsCustomModule_sync] diff --git a/owl-bot-staging/google-cloud-security_center_management-v1/snippets/security_center_management/validate_event_threat_detection_custom_module.rb b/owl-bot-staging/google-cloud-security_center_management-v1/snippets/security_center_management/validate_event_threat_detection_custom_module.rb deleted file mode 100644 index 4fd089b6c7d4..000000000000 --- a/owl-bot-staging/google-cloud-security_center_management-v1/snippets/security_center_management/validate_event_threat_detection_custom_module.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 securitycentermanagement_v1_generated_SecurityCenterManagement_ValidateEventThreatDetectionCustomModule_sync] -require "google/cloud/security_center_management/v1" - -## -# Snippet for the validate_event_threat_detection_custom_module call in the SecurityCenterManagement service -# -# This snippet has been automatically generated and should be regarded as a code -# template only. It will require modifications to work: -# - It may require correct/in-range values for request initialization. -# - It may require specifying regional endpoints when creating the service -# client as shown in https://cloud.google.com/ruby/docs/reference. -# -# This is an auto-generated example demonstrating basic usage of -# Google::Cloud::SecurityCenterManagement::V1::SecurityCenterManagement::Client#validate_event_threat_detection_custom_module. -# -def validate_event_threat_detection_custom_module - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::SecurityCenterManagement::V1::SecurityCenterManagement::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::SecurityCenterManagement::V1::ValidateEventThreatDetectionCustomModuleRequest.new - - # Call the validate_event_threat_detection_custom_module method. - result = client.validate_event_threat_detection_custom_module request - - # The returned object is of type Google::Cloud::SecurityCenterManagement::V1::ValidateEventThreatDetectionCustomModuleResponse. - p result -end -# [END securitycentermanagement_v1_generated_SecurityCenterManagement_ValidateEventThreatDetectionCustomModule_sync] diff --git a/owl-bot-staging/google-cloud-security_center_management-v1/snippets/snippet_metadata_google.cloud.securitycentermanagement.v1.json b/owl-bot-staging/google-cloud-security_center_management-v1/snippets/snippet_metadata_google.cloud.securitycentermanagement.v1.json deleted file mode 100644 index 1f027b6d1787..000000000000 --- a/owl-bot-staging/google-cloud-security_center_management-v1/snippets/snippet_metadata_google.cloud.securitycentermanagement.v1.json +++ /dev/null @@ -1,855 +0,0 @@ -{ - "client_library": { - "name": "google-cloud-security_center_management-v1", - "version": "", - "language": "RUBY", - "apis": [ - { - "id": "google.cloud.securitycentermanagement.v1", - "version": "v1" - } - ] - }, - "snippets": [ - { - "region_tag": "securitycentermanagement_v1_generated_SecurityCenterManagement_ListEffectiveSecurityHealthAnalyticsCustomModules_sync", - "title": "Snippet for the list_effective_security_health_analytics_custom_modules call in the SecurityCenterManagement service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::SecurityCenterManagement::V1::SecurityCenterManagement::Client#list_effective_security_health_analytics_custom_modules.", - "file": "security_center_management/list_effective_security_health_analytics_custom_modules.rb", - "language": "RUBY", - "client_method": { - "short_name": "list_effective_security_health_analytics_custom_modules", - "full_name": "::Google::Cloud::SecurityCenterManagement::V1::SecurityCenterManagement::Client#list_effective_security_health_analytics_custom_modules", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::SecurityCenterManagement::V1::ListEffectiveSecurityHealthAnalyticsCustomModulesRequest", - "name": "request" - } - ], - "result_type": "::Google::Cloud::SecurityCenterManagement::V1::ListEffectiveSecurityHealthAnalyticsCustomModulesResponse", - "client": { - "short_name": "SecurityCenterManagement::Client", - "full_name": "::Google::Cloud::SecurityCenterManagement::V1::SecurityCenterManagement::Client" - }, - "method": { - "short_name": "ListEffectiveSecurityHealthAnalyticsCustomModules", - "full_name": "google.cloud.securitycentermanagement.v1.SecurityCenterManagement.ListEffectiveSecurityHealthAnalyticsCustomModules", - "service": { - "short_name": "SecurityCenterManagement", - "full_name": "google.cloud.securitycentermanagement.v1.SecurityCenterManagement" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 50, - "type": "FULL" - } - ] - }, - { - "region_tag": "securitycentermanagement_v1_generated_SecurityCenterManagement_GetEffectiveSecurityHealthAnalyticsCustomModule_sync", - "title": "Snippet for the get_effective_security_health_analytics_custom_module call in the SecurityCenterManagement service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::SecurityCenterManagement::V1::SecurityCenterManagement::Client#get_effective_security_health_analytics_custom_module.", - "file": "security_center_management/get_effective_security_health_analytics_custom_module.rb", - "language": "RUBY", - "client_method": { - "short_name": "get_effective_security_health_analytics_custom_module", - "full_name": "::Google::Cloud::SecurityCenterManagement::V1::SecurityCenterManagement::Client#get_effective_security_health_analytics_custom_module", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::SecurityCenterManagement::V1::GetEffectiveSecurityHealthAnalyticsCustomModuleRequest", - "name": "request" - } - ], - "result_type": "::Google::Cloud::SecurityCenterManagement::V1::EffectiveSecurityHealthAnalyticsCustomModule", - "client": { - "short_name": "SecurityCenterManagement::Client", - "full_name": "::Google::Cloud::SecurityCenterManagement::V1::SecurityCenterManagement::Client" - }, - "method": { - "short_name": "GetEffectiveSecurityHealthAnalyticsCustomModule", - "full_name": "google.cloud.securitycentermanagement.v1.SecurityCenterManagement.GetEffectiveSecurityHealthAnalyticsCustomModule", - "service": { - "short_name": "SecurityCenterManagement", - "full_name": "google.cloud.securitycentermanagement.v1.SecurityCenterManagement" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 46, - "type": "FULL" - } - ] - }, - { - "region_tag": "securitycentermanagement_v1_generated_SecurityCenterManagement_ListSecurityHealthAnalyticsCustomModules_sync", - "title": "Snippet for the list_security_health_analytics_custom_modules call in the SecurityCenterManagement service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::SecurityCenterManagement::V1::SecurityCenterManagement::Client#list_security_health_analytics_custom_modules.", - "file": "security_center_management/list_security_health_analytics_custom_modules.rb", - "language": "RUBY", - "client_method": { - "short_name": "list_security_health_analytics_custom_modules", - "full_name": "::Google::Cloud::SecurityCenterManagement::V1::SecurityCenterManagement::Client#list_security_health_analytics_custom_modules", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::SecurityCenterManagement::V1::ListSecurityHealthAnalyticsCustomModulesRequest", - "name": "request" - } - ], - "result_type": "::Google::Cloud::SecurityCenterManagement::V1::ListSecurityHealthAnalyticsCustomModulesResponse", - "client": { - "short_name": "SecurityCenterManagement::Client", - "full_name": "::Google::Cloud::SecurityCenterManagement::V1::SecurityCenterManagement::Client" - }, - "method": { - "short_name": "ListSecurityHealthAnalyticsCustomModules", - "full_name": "google.cloud.securitycentermanagement.v1.SecurityCenterManagement.ListSecurityHealthAnalyticsCustomModules", - "service": { - "short_name": "SecurityCenterManagement", - "full_name": "google.cloud.securitycentermanagement.v1.SecurityCenterManagement" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 50, - "type": "FULL" - } - ] - }, - { - "region_tag": "securitycentermanagement_v1_generated_SecurityCenterManagement_ListDescendantSecurityHealthAnalyticsCustomModules_sync", - "title": "Snippet for the list_descendant_security_health_analytics_custom_modules call in the SecurityCenterManagement service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::SecurityCenterManagement::V1::SecurityCenterManagement::Client#list_descendant_security_health_analytics_custom_modules.", - "file": "security_center_management/list_descendant_security_health_analytics_custom_modules.rb", - "language": "RUBY", - "client_method": { - "short_name": "list_descendant_security_health_analytics_custom_modules", - "full_name": "::Google::Cloud::SecurityCenterManagement::V1::SecurityCenterManagement::Client#list_descendant_security_health_analytics_custom_modules", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::SecurityCenterManagement::V1::ListDescendantSecurityHealthAnalyticsCustomModulesRequest", - "name": "request" - } - ], - "result_type": "::Google::Cloud::SecurityCenterManagement::V1::ListDescendantSecurityHealthAnalyticsCustomModulesResponse", - "client": { - "short_name": "SecurityCenterManagement::Client", - "full_name": "::Google::Cloud::SecurityCenterManagement::V1::SecurityCenterManagement::Client" - }, - "method": { - "short_name": "ListDescendantSecurityHealthAnalyticsCustomModules", - "full_name": "google.cloud.securitycentermanagement.v1.SecurityCenterManagement.ListDescendantSecurityHealthAnalyticsCustomModules", - "service": { - "short_name": "SecurityCenterManagement", - "full_name": "google.cloud.securitycentermanagement.v1.SecurityCenterManagement" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 50, - "type": "FULL" - } - ] - }, - { - "region_tag": "securitycentermanagement_v1_generated_SecurityCenterManagement_GetSecurityHealthAnalyticsCustomModule_sync", - "title": "Snippet for the get_security_health_analytics_custom_module call in the SecurityCenterManagement service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::SecurityCenterManagement::V1::SecurityCenterManagement::Client#get_security_health_analytics_custom_module.", - "file": "security_center_management/get_security_health_analytics_custom_module.rb", - "language": "RUBY", - "client_method": { - "short_name": "get_security_health_analytics_custom_module", - "full_name": "::Google::Cloud::SecurityCenterManagement::V1::SecurityCenterManagement::Client#get_security_health_analytics_custom_module", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::SecurityCenterManagement::V1::GetSecurityHealthAnalyticsCustomModuleRequest", - "name": "request" - } - ], - "result_type": "::Google::Cloud::SecurityCenterManagement::V1::SecurityHealthAnalyticsCustomModule", - "client": { - "short_name": "SecurityCenterManagement::Client", - "full_name": "::Google::Cloud::SecurityCenterManagement::V1::SecurityCenterManagement::Client" - }, - "method": { - "short_name": "GetSecurityHealthAnalyticsCustomModule", - "full_name": "google.cloud.securitycentermanagement.v1.SecurityCenterManagement.GetSecurityHealthAnalyticsCustomModule", - "service": { - "short_name": "SecurityCenterManagement", - "full_name": "google.cloud.securitycentermanagement.v1.SecurityCenterManagement" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 46, - "type": "FULL" - } - ] - }, - { - "region_tag": "securitycentermanagement_v1_generated_SecurityCenterManagement_CreateSecurityHealthAnalyticsCustomModule_sync", - "title": "Snippet for the create_security_health_analytics_custom_module call in the SecurityCenterManagement service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::SecurityCenterManagement::V1::SecurityCenterManagement::Client#create_security_health_analytics_custom_module.", - "file": "security_center_management/create_security_health_analytics_custom_module.rb", - "language": "RUBY", - "client_method": { - "short_name": "create_security_health_analytics_custom_module", - "full_name": "::Google::Cloud::SecurityCenterManagement::V1::SecurityCenterManagement::Client#create_security_health_analytics_custom_module", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::SecurityCenterManagement::V1::CreateSecurityHealthAnalyticsCustomModuleRequest", - "name": "request" - } - ], - "result_type": "::Google::Cloud::SecurityCenterManagement::V1::SecurityHealthAnalyticsCustomModule", - "client": { - "short_name": "SecurityCenterManagement::Client", - "full_name": "::Google::Cloud::SecurityCenterManagement::V1::SecurityCenterManagement::Client" - }, - "method": { - "short_name": "CreateSecurityHealthAnalyticsCustomModule", - "full_name": "google.cloud.securitycentermanagement.v1.SecurityCenterManagement.CreateSecurityHealthAnalyticsCustomModule", - "service": { - "short_name": "SecurityCenterManagement", - "full_name": "google.cloud.securitycentermanagement.v1.SecurityCenterManagement" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 46, - "type": "FULL" - } - ] - }, - { - "region_tag": "securitycentermanagement_v1_generated_SecurityCenterManagement_UpdateSecurityHealthAnalyticsCustomModule_sync", - "title": "Snippet for the update_security_health_analytics_custom_module call in the SecurityCenterManagement service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::SecurityCenterManagement::V1::SecurityCenterManagement::Client#update_security_health_analytics_custom_module.", - "file": "security_center_management/update_security_health_analytics_custom_module.rb", - "language": "RUBY", - "client_method": { - "short_name": "update_security_health_analytics_custom_module", - "full_name": "::Google::Cloud::SecurityCenterManagement::V1::SecurityCenterManagement::Client#update_security_health_analytics_custom_module", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::SecurityCenterManagement::V1::UpdateSecurityHealthAnalyticsCustomModuleRequest", - "name": "request" - } - ], - "result_type": "::Google::Cloud::SecurityCenterManagement::V1::SecurityHealthAnalyticsCustomModule", - "client": { - "short_name": "SecurityCenterManagement::Client", - "full_name": "::Google::Cloud::SecurityCenterManagement::V1::SecurityCenterManagement::Client" - }, - "method": { - "short_name": "UpdateSecurityHealthAnalyticsCustomModule", - "full_name": "google.cloud.securitycentermanagement.v1.SecurityCenterManagement.UpdateSecurityHealthAnalyticsCustomModule", - "service": { - "short_name": "SecurityCenterManagement", - "full_name": "google.cloud.securitycentermanagement.v1.SecurityCenterManagement" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 46, - "type": "FULL" - } - ] - }, - { - "region_tag": "securitycentermanagement_v1_generated_SecurityCenterManagement_DeleteSecurityHealthAnalyticsCustomModule_sync", - "title": "Snippet for the delete_security_health_analytics_custom_module call in the SecurityCenterManagement service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::SecurityCenterManagement::V1::SecurityCenterManagement::Client#delete_security_health_analytics_custom_module.", - "file": "security_center_management/delete_security_health_analytics_custom_module.rb", - "language": "RUBY", - "client_method": { - "short_name": "delete_security_health_analytics_custom_module", - "full_name": "::Google::Cloud::SecurityCenterManagement::V1::SecurityCenterManagement::Client#delete_security_health_analytics_custom_module", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::SecurityCenterManagement::V1::DeleteSecurityHealthAnalyticsCustomModuleRequest", - "name": "request" - } - ], - "result_type": "::Google::Protobuf::Empty", - "client": { - "short_name": "SecurityCenterManagement::Client", - "full_name": "::Google::Cloud::SecurityCenterManagement::V1::SecurityCenterManagement::Client" - }, - "method": { - "short_name": "DeleteSecurityHealthAnalyticsCustomModule", - "full_name": "google.cloud.securitycentermanagement.v1.SecurityCenterManagement.DeleteSecurityHealthAnalyticsCustomModule", - "service": { - "short_name": "SecurityCenterManagement", - "full_name": "google.cloud.securitycentermanagement.v1.SecurityCenterManagement" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 46, - "type": "FULL" - } - ] - }, - { - "region_tag": "securitycentermanagement_v1_generated_SecurityCenterManagement_SimulateSecurityHealthAnalyticsCustomModule_sync", - "title": "Snippet for the simulate_security_health_analytics_custom_module call in the SecurityCenterManagement service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::SecurityCenterManagement::V1::SecurityCenterManagement::Client#simulate_security_health_analytics_custom_module.", - "file": "security_center_management/simulate_security_health_analytics_custom_module.rb", - "language": "RUBY", - "client_method": { - "short_name": "simulate_security_health_analytics_custom_module", - "full_name": "::Google::Cloud::SecurityCenterManagement::V1::SecurityCenterManagement::Client#simulate_security_health_analytics_custom_module", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::SecurityCenterManagement::V1::SimulateSecurityHealthAnalyticsCustomModuleRequest", - "name": "request" - } - ], - "result_type": "::Google::Cloud::SecurityCenterManagement::V1::SimulateSecurityHealthAnalyticsCustomModuleResponse", - "client": { - "short_name": "SecurityCenterManagement::Client", - "full_name": "::Google::Cloud::SecurityCenterManagement::V1::SecurityCenterManagement::Client" - }, - "method": { - "short_name": "SimulateSecurityHealthAnalyticsCustomModule", - "full_name": "google.cloud.securitycentermanagement.v1.SecurityCenterManagement.SimulateSecurityHealthAnalyticsCustomModule", - "service": { - "short_name": "SecurityCenterManagement", - "full_name": "google.cloud.securitycentermanagement.v1.SecurityCenterManagement" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 46, - "type": "FULL" - } - ] - }, - { - "region_tag": "securitycentermanagement_v1_generated_SecurityCenterManagement_ListEffectiveEventThreatDetectionCustomModules_sync", - "title": "Snippet for the list_effective_event_threat_detection_custom_modules call in the SecurityCenterManagement service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::SecurityCenterManagement::V1::SecurityCenterManagement::Client#list_effective_event_threat_detection_custom_modules.", - "file": "security_center_management/list_effective_event_threat_detection_custom_modules.rb", - "language": "RUBY", - "client_method": { - "short_name": "list_effective_event_threat_detection_custom_modules", - "full_name": "::Google::Cloud::SecurityCenterManagement::V1::SecurityCenterManagement::Client#list_effective_event_threat_detection_custom_modules", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::SecurityCenterManagement::V1::ListEffectiveEventThreatDetectionCustomModulesRequest", - "name": "request" - } - ], - "result_type": "::Google::Cloud::SecurityCenterManagement::V1::ListEffectiveEventThreatDetectionCustomModulesResponse", - "client": { - "short_name": "SecurityCenterManagement::Client", - "full_name": "::Google::Cloud::SecurityCenterManagement::V1::SecurityCenterManagement::Client" - }, - "method": { - "short_name": "ListEffectiveEventThreatDetectionCustomModules", - "full_name": "google.cloud.securitycentermanagement.v1.SecurityCenterManagement.ListEffectiveEventThreatDetectionCustomModules", - "service": { - "short_name": "SecurityCenterManagement", - "full_name": "google.cloud.securitycentermanagement.v1.SecurityCenterManagement" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 50, - "type": "FULL" - } - ] - }, - { - "region_tag": "securitycentermanagement_v1_generated_SecurityCenterManagement_GetEffectiveEventThreatDetectionCustomModule_sync", - "title": "Snippet for the get_effective_event_threat_detection_custom_module call in the SecurityCenterManagement service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::SecurityCenterManagement::V1::SecurityCenterManagement::Client#get_effective_event_threat_detection_custom_module.", - "file": "security_center_management/get_effective_event_threat_detection_custom_module.rb", - "language": "RUBY", - "client_method": { - "short_name": "get_effective_event_threat_detection_custom_module", - "full_name": "::Google::Cloud::SecurityCenterManagement::V1::SecurityCenterManagement::Client#get_effective_event_threat_detection_custom_module", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::SecurityCenterManagement::V1::GetEffectiveEventThreatDetectionCustomModuleRequest", - "name": "request" - } - ], - "result_type": "::Google::Cloud::SecurityCenterManagement::V1::EffectiveEventThreatDetectionCustomModule", - "client": { - "short_name": "SecurityCenterManagement::Client", - "full_name": "::Google::Cloud::SecurityCenterManagement::V1::SecurityCenterManagement::Client" - }, - "method": { - "short_name": "GetEffectiveEventThreatDetectionCustomModule", - "full_name": "google.cloud.securitycentermanagement.v1.SecurityCenterManagement.GetEffectiveEventThreatDetectionCustomModule", - "service": { - "short_name": "SecurityCenterManagement", - "full_name": "google.cloud.securitycentermanagement.v1.SecurityCenterManagement" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 46, - "type": "FULL" - } - ] - }, - { - "region_tag": "securitycentermanagement_v1_generated_SecurityCenterManagement_ListEventThreatDetectionCustomModules_sync", - "title": "Snippet for the list_event_threat_detection_custom_modules call in the SecurityCenterManagement service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::SecurityCenterManagement::V1::SecurityCenterManagement::Client#list_event_threat_detection_custom_modules.", - "file": "security_center_management/list_event_threat_detection_custom_modules.rb", - "language": "RUBY", - "client_method": { - "short_name": "list_event_threat_detection_custom_modules", - "full_name": "::Google::Cloud::SecurityCenterManagement::V1::SecurityCenterManagement::Client#list_event_threat_detection_custom_modules", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::SecurityCenterManagement::V1::ListEventThreatDetectionCustomModulesRequest", - "name": "request" - } - ], - "result_type": "::Google::Cloud::SecurityCenterManagement::V1::ListEventThreatDetectionCustomModulesResponse", - "client": { - "short_name": "SecurityCenterManagement::Client", - "full_name": "::Google::Cloud::SecurityCenterManagement::V1::SecurityCenterManagement::Client" - }, - "method": { - "short_name": "ListEventThreatDetectionCustomModules", - "full_name": "google.cloud.securitycentermanagement.v1.SecurityCenterManagement.ListEventThreatDetectionCustomModules", - "service": { - "short_name": "SecurityCenterManagement", - "full_name": "google.cloud.securitycentermanagement.v1.SecurityCenterManagement" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 50, - "type": "FULL" - } - ] - }, - { - "region_tag": "securitycentermanagement_v1_generated_SecurityCenterManagement_ListDescendantEventThreatDetectionCustomModules_sync", - "title": "Snippet for the list_descendant_event_threat_detection_custom_modules call in the SecurityCenterManagement service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::SecurityCenterManagement::V1::SecurityCenterManagement::Client#list_descendant_event_threat_detection_custom_modules.", - "file": "security_center_management/list_descendant_event_threat_detection_custom_modules.rb", - "language": "RUBY", - "client_method": { - "short_name": "list_descendant_event_threat_detection_custom_modules", - "full_name": "::Google::Cloud::SecurityCenterManagement::V1::SecurityCenterManagement::Client#list_descendant_event_threat_detection_custom_modules", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::SecurityCenterManagement::V1::ListDescendantEventThreatDetectionCustomModulesRequest", - "name": "request" - } - ], - "result_type": "::Google::Cloud::SecurityCenterManagement::V1::ListDescendantEventThreatDetectionCustomModulesResponse", - "client": { - "short_name": "SecurityCenterManagement::Client", - "full_name": "::Google::Cloud::SecurityCenterManagement::V1::SecurityCenterManagement::Client" - }, - "method": { - "short_name": "ListDescendantEventThreatDetectionCustomModules", - "full_name": "google.cloud.securitycentermanagement.v1.SecurityCenterManagement.ListDescendantEventThreatDetectionCustomModules", - "service": { - "short_name": "SecurityCenterManagement", - "full_name": "google.cloud.securitycentermanagement.v1.SecurityCenterManagement" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 50, - "type": "FULL" - } - ] - }, - { - "region_tag": "securitycentermanagement_v1_generated_SecurityCenterManagement_GetEventThreatDetectionCustomModule_sync", - "title": "Snippet for the get_event_threat_detection_custom_module call in the SecurityCenterManagement service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::SecurityCenterManagement::V1::SecurityCenterManagement::Client#get_event_threat_detection_custom_module.", - "file": "security_center_management/get_event_threat_detection_custom_module.rb", - "language": "RUBY", - "client_method": { - "short_name": "get_event_threat_detection_custom_module", - "full_name": "::Google::Cloud::SecurityCenterManagement::V1::SecurityCenterManagement::Client#get_event_threat_detection_custom_module", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::SecurityCenterManagement::V1::GetEventThreatDetectionCustomModuleRequest", - "name": "request" - } - ], - "result_type": "::Google::Cloud::SecurityCenterManagement::V1::EventThreatDetectionCustomModule", - "client": { - "short_name": "SecurityCenterManagement::Client", - "full_name": "::Google::Cloud::SecurityCenterManagement::V1::SecurityCenterManagement::Client" - }, - "method": { - "short_name": "GetEventThreatDetectionCustomModule", - "full_name": "google.cloud.securitycentermanagement.v1.SecurityCenterManagement.GetEventThreatDetectionCustomModule", - "service": { - "short_name": "SecurityCenterManagement", - "full_name": "google.cloud.securitycentermanagement.v1.SecurityCenterManagement" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 46, - "type": "FULL" - } - ] - }, - { - "region_tag": "securitycentermanagement_v1_generated_SecurityCenterManagement_CreateEventThreatDetectionCustomModule_sync", - "title": "Snippet for the create_event_threat_detection_custom_module call in the SecurityCenterManagement service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::SecurityCenterManagement::V1::SecurityCenterManagement::Client#create_event_threat_detection_custom_module.", - "file": "security_center_management/create_event_threat_detection_custom_module.rb", - "language": "RUBY", - "client_method": { - "short_name": "create_event_threat_detection_custom_module", - "full_name": "::Google::Cloud::SecurityCenterManagement::V1::SecurityCenterManagement::Client#create_event_threat_detection_custom_module", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::SecurityCenterManagement::V1::CreateEventThreatDetectionCustomModuleRequest", - "name": "request" - } - ], - "result_type": "::Google::Cloud::SecurityCenterManagement::V1::EventThreatDetectionCustomModule", - "client": { - "short_name": "SecurityCenterManagement::Client", - "full_name": "::Google::Cloud::SecurityCenterManagement::V1::SecurityCenterManagement::Client" - }, - "method": { - "short_name": "CreateEventThreatDetectionCustomModule", - "full_name": "google.cloud.securitycentermanagement.v1.SecurityCenterManagement.CreateEventThreatDetectionCustomModule", - "service": { - "short_name": "SecurityCenterManagement", - "full_name": "google.cloud.securitycentermanagement.v1.SecurityCenterManagement" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 46, - "type": "FULL" - } - ] - }, - { - "region_tag": "securitycentermanagement_v1_generated_SecurityCenterManagement_UpdateEventThreatDetectionCustomModule_sync", - "title": "Snippet for the update_event_threat_detection_custom_module call in the SecurityCenterManagement service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::SecurityCenterManagement::V1::SecurityCenterManagement::Client#update_event_threat_detection_custom_module.", - "file": "security_center_management/update_event_threat_detection_custom_module.rb", - "language": "RUBY", - "client_method": { - "short_name": "update_event_threat_detection_custom_module", - "full_name": "::Google::Cloud::SecurityCenterManagement::V1::SecurityCenterManagement::Client#update_event_threat_detection_custom_module", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::SecurityCenterManagement::V1::UpdateEventThreatDetectionCustomModuleRequest", - "name": "request" - } - ], - "result_type": "::Google::Cloud::SecurityCenterManagement::V1::EventThreatDetectionCustomModule", - "client": { - "short_name": "SecurityCenterManagement::Client", - "full_name": "::Google::Cloud::SecurityCenterManagement::V1::SecurityCenterManagement::Client" - }, - "method": { - "short_name": "UpdateEventThreatDetectionCustomModule", - "full_name": "google.cloud.securitycentermanagement.v1.SecurityCenterManagement.UpdateEventThreatDetectionCustomModule", - "service": { - "short_name": "SecurityCenterManagement", - "full_name": "google.cloud.securitycentermanagement.v1.SecurityCenterManagement" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 46, - "type": "FULL" - } - ] - }, - { - "region_tag": "securitycentermanagement_v1_generated_SecurityCenterManagement_DeleteEventThreatDetectionCustomModule_sync", - "title": "Snippet for the delete_event_threat_detection_custom_module call in the SecurityCenterManagement service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::SecurityCenterManagement::V1::SecurityCenterManagement::Client#delete_event_threat_detection_custom_module.", - "file": "security_center_management/delete_event_threat_detection_custom_module.rb", - "language": "RUBY", - "client_method": { - "short_name": "delete_event_threat_detection_custom_module", - "full_name": "::Google::Cloud::SecurityCenterManagement::V1::SecurityCenterManagement::Client#delete_event_threat_detection_custom_module", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::SecurityCenterManagement::V1::DeleteEventThreatDetectionCustomModuleRequest", - "name": "request" - } - ], - "result_type": "::Google::Protobuf::Empty", - "client": { - "short_name": "SecurityCenterManagement::Client", - "full_name": "::Google::Cloud::SecurityCenterManagement::V1::SecurityCenterManagement::Client" - }, - "method": { - "short_name": "DeleteEventThreatDetectionCustomModule", - "full_name": "google.cloud.securitycentermanagement.v1.SecurityCenterManagement.DeleteEventThreatDetectionCustomModule", - "service": { - "short_name": "SecurityCenterManagement", - "full_name": "google.cloud.securitycentermanagement.v1.SecurityCenterManagement" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 46, - "type": "FULL" - } - ] - }, - { - "region_tag": "securitycentermanagement_v1_generated_SecurityCenterManagement_ValidateEventThreatDetectionCustomModule_sync", - "title": "Snippet for the validate_event_threat_detection_custom_module call in the SecurityCenterManagement service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::SecurityCenterManagement::V1::SecurityCenterManagement::Client#validate_event_threat_detection_custom_module.", - "file": "security_center_management/validate_event_threat_detection_custom_module.rb", - "language": "RUBY", - "client_method": { - "short_name": "validate_event_threat_detection_custom_module", - "full_name": "::Google::Cloud::SecurityCenterManagement::V1::SecurityCenterManagement::Client#validate_event_threat_detection_custom_module", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::SecurityCenterManagement::V1::ValidateEventThreatDetectionCustomModuleRequest", - "name": "request" - } - ], - "result_type": "::Google::Cloud::SecurityCenterManagement::V1::ValidateEventThreatDetectionCustomModuleResponse", - "client": { - "short_name": "SecurityCenterManagement::Client", - "full_name": "::Google::Cloud::SecurityCenterManagement::V1::SecurityCenterManagement::Client" - }, - "method": { - "short_name": "ValidateEventThreatDetectionCustomModule", - "full_name": "google.cloud.securitycentermanagement.v1.SecurityCenterManagement.ValidateEventThreatDetectionCustomModule", - "service": { - "short_name": "SecurityCenterManagement", - "full_name": "google.cloud.securitycentermanagement.v1.SecurityCenterManagement" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 46, - "type": "FULL" - } - ] - }, - { - "region_tag": "securitycentermanagement_v1_generated_SecurityCenterManagement_GetSecurityCenterService_sync", - "title": "Snippet for the get_security_center_service call in the SecurityCenterManagement service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::SecurityCenterManagement::V1::SecurityCenterManagement::Client#get_security_center_service.", - "file": "security_center_management/get_security_center_service.rb", - "language": "RUBY", - "client_method": { - "short_name": "get_security_center_service", - "full_name": "::Google::Cloud::SecurityCenterManagement::V1::SecurityCenterManagement::Client#get_security_center_service", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::SecurityCenterManagement::V1::GetSecurityCenterServiceRequest", - "name": "request" - } - ], - "result_type": "::Google::Cloud::SecurityCenterManagement::V1::SecurityCenterService", - "client": { - "short_name": "SecurityCenterManagement::Client", - "full_name": "::Google::Cloud::SecurityCenterManagement::V1::SecurityCenterManagement::Client" - }, - "method": { - "short_name": "GetSecurityCenterService", - "full_name": "google.cloud.securitycentermanagement.v1.SecurityCenterManagement.GetSecurityCenterService", - "service": { - "short_name": "SecurityCenterManagement", - "full_name": "google.cloud.securitycentermanagement.v1.SecurityCenterManagement" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 46, - "type": "FULL" - } - ] - }, - { - "region_tag": "securitycentermanagement_v1_generated_SecurityCenterManagement_ListSecurityCenterServices_sync", - "title": "Snippet for the list_security_center_services call in the SecurityCenterManagement service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::SecurityCenterManagement::V1::SecurityCenterManagement::Client#list_security_center_services.", - "file": "security_center_management/list_security_center_services.rb", - "language": "RUBY", - "client_method": { - "short_name": "list_security_center_services", - "full_name": "::Google::Cloud::SecurityCenterManagement::V1::SecurityCenterManagement::Client#list_security_center_services", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::SecurityCenterManagement::V1::ListSecurityCenterServicesRequest", - "name": "request" - } - ], - "result_type": "::Google::Cloud::SecurityCenterManagement::V1::ListSecurityCenterServicesResponse", - "client": { - "short_name": "SecurityCenterManagement::Client", - "full_name": "::Google::Cloud::SecurityCenterManagement::V1::SecurityCenterManagement::Client" - }, - "method": { - "short_name": "ListSecurityCenterServices", - "full_name": "google.cloud.securitycentermanagement.v1.SecurityCenterManagement.ListSecurityCenterServices", - "service": { - "short_name": "SecurityCenterManagement", - "full_name": "google.cloud.securitycentermanagement.v1.SecurityCenterManagement" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 50, - "type": "FULL" - } - ] - }, - { - "region_tag": "securitycentermanagement_v1_generated_SecurityCenterManagement_UpdateSecurityCenterService_sync", - "title": "Snippet for the update_security_center_service call in the SecurityCenterManagement service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::SecurityCenterManagement::V1::SecurityCenterManagement::Client#update_security_center_service.", - "file": "security_center_management/update_security_center_service.rb", - "language": "RUBY", - "client_method": { - "short_name": "update_security_center_service", - "full_name": "::Google::Cloud::SecurityCenterManagement::V1::SecurityCenterManagement::Client#update_security_center_service", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::SecurityCenterManagement::V1::UpdateSecurityCenterServiceRequest", - "name": "request" - } - ], - "result_type": "::Google::Cloud::SecurityCenterManagement::V1::SecurityCenterService", - "client": { - "short_name": "SecurityCenterManagement::Client", - "full_name": "::Google::Cloud::SecurityCenterManagement::V1::SecurityCenterManagement::Client" - }, - "method": { - "short_name": "UpdateSecurityCenterService", - "full_name": "google.cloud.securitycentermanagement.v1.SecurityCenterManagement.UpdateSecurityCenterService", - "service": { - "short_name": "SecurityCenterManagement", - "full_name": "google.cloud.securitycentermanagement.v1.SecurityCenterManagement" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 46, - "type": "FULL" - } - ] - } - ] -} \ No newline at end of file diff --git a/owl-bot-staging/google-cloud-security_center_management-v1/test/google/cloud/security_center_management/v1/security_center_management_paths_test.rb b/owl-bot-staging/google-cloud-security_center_management-v1/test/google/cloud/security_center_management/v1/security_center_management_paths_test.rb deleted file mode 100644 index 57be2bde861c..000000000000 --- a/owl-bot-staging/google-cloud-security_center_management-v1/test/google/cloud/security_center_management/v1/security_center_management_paths_test.rb +++ /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 "helper" - -require "gapic/grpc/service_stub" - -require "google/cloud/security_center_management/v1/security_center_management" - -class ::Google::Cloud::SecurityCenterManagement::V1::SecurityCenterManagement::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_effective_event_threat_detection_custom_module_path - grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - ::Gapic::ServiceStub.stub :new, DummyStub.new do - client = ::Google::Cloud::SecurityCenterManagement::V1::SecurityCenterManagement::Client.new do |config| - config.credentials = grpc_channel - end - - path = client.effective_event_threat_detection_custom_module_path organization: "value0", location: "value1", effective_event_threat_detection_custom_module: "value2" - assert_equal "organizations/value0/locations/value1/effectiveEventThreatDetectionCustomModules/value2", path - - path = client.effective_event_threat_detection_custom_module_path project: "value0", location: "value1", effective_event_threat_detection_custom_module: "value2" - assert_equal "projects/value0/locations/value1/effectiveEventThreatDetectionCustomModules/value2", path - - path = client.effective_event_threat_detection_custom_module_path folder: "value0", location: "value1", effective_event_threat_detection_custom_module: "value2" - assert_equal "folders/value0/locations/value1/effectiveEventThreatDetectionCustomModules/value2", path - end - end - - def test_effective_security_health_analytics_custom_module_path - grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - ::Gapic::ServiceStub.stub :new, DummyStub.new do - client = ::Google::Cloud::SecurityCenterManagement::V1::SecurityCenterManagement::Client.new do |config| - config.credentials = grpc_channel - end - - path = client.effective_security_health_analytics_custom_module_path organization: "value0", location: "value1", effective_security_health_analytics_custom_module: "value2" - assert_equal "organizations/value0/locations/value1/effectiveSecurityHealthAnalyticsCustomModules/value2", path - - path = client.effective_security_health_analytics_custom_module_path project: "value0", location: "value1", effective_security_health_analytics_custom_module: "value2" - assert_equal "projects/value0/locations/value1/effectiveSecurityHealthAnalyticsCustomModules/value2", path - - path = client.effective_security_health_analytics_custom_module_path folder: "value0", location: "value1", effective_security_health_analytics_custom_module: "value2" - assert_equal "folders/value0/locations/value1/effectiveSecurityHealthAnalyticsCustomModules/value2", path - end - end - - def test_event_threat_detection_custom_module_path - grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - ::Gapic::ServiceStub.stub :new, DummyStub.new do - client = ::Google::Cloud::SecurityCenterManagement::V1::SecurityCenterManagement::Client.new do |config| - config.credentials = grpc_channel - end - - path = client.event_threat_detection_custom_module_path organization: "value0", location: "value1", event_threat_detection_custom_module: "value2" - assert_equal "organizations/value0/locations/value1/eventThreatDetectionCustomModules/value2", path - - path = client.event_threat_detection_custom_module_path project: "value0", location: "value1", event_threat_detection_custom_module: "value2" - assert_equal "projects/value0/locations/value1/eventThreatDetectionCustomModules/value2", path - - path = client.event_threat_detection_custom_module_path folder: "value0", location: "value1", event_threat_detection_custom_module: "value2" - assert_equal "folders/value0/locations/value1/eventThreatDetectionCustomModules/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::Cloud::SecurityCenterManagement::V1::SecurityCenterManagement::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::Cloud::SecurityCenterManagement::V1::SecurityCenterManagement::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::Cloud::SecurityCenterManagement::V1::SecurityCenterManagement::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_security_center_service_path - grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - ::Gapic::ServiceStub.stub :new, DummyStub.new do - client = ::Google::Cloud::SecurityCenterManagement::V1::SecurityCenterManagement::Client.new do |config| - config.credentials = grpc_channel - end - - path = client.security_center_service_path project: "value0", location: "value1", service: "value2" - assert_equal "projects/value0/locations/value1/securityCenterServices/value2", path - - path = client.security_center_service_path folder: "value0", location: "value1", service: "value2" - assert_equal "folders/value0/locations/value1/securityCenterServices/value2", path - - path = client.security_center_service_path organization: "value0", location: "value1", service: "value2" - assert_equal "organizations/value0/locations/value1/securityCenterServices/value2", path - end - end - - def test_security_health_analytics_custom_module_path - grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - ::Gapic::ServiceStub.stub :new, DummyStub.new do - client = ::Google::Cloud::SecurityCenterManagement::V1::SecurityCenterManagement::Client.new do |config| - config.credentials = grpc_channel - end - - path = client.security_health_analytics_custom_module_path organization: "value0", location: "value1", security_health_analytics_custom_module: "value2" - assert_equal "organizations/value0/locations/value1/securityHealthAnalyticsCustomModules/value2", path - - path = client.security_health_analytics_custom_module_path project: "value0", location: "value1", security_health_analytics_custom_module: "value2" - assert_equal "projects/value0/locations/value1/securityHealthAnalyticsCustomModules/value2", path - - path = client.security_health_analytics_custom_module_path folder: "value0", location: "value1", security_health_analytics_custom_module: "value2" - assert_equal "folders/value0/locations/value1/securityHealthAnalyticsCustomModules/value2", path - end - end -end diff --git a/owl-bot-staging/google-cloud-security_center_management-v1/test/google/cloud/security_center_management/v1/security_center_management_rest_test.rb b/owl-bot-staging/google-cloud-security_center_management-v1/test/google/cloud/security_center_management/v1/security_center_management_rest_test.rb deleted file mode 100644 index c5f5a663a657..000000000000 --- a/owl-bot-staging/google-cloud-security_center_management-v1/test/google/cloud/security_center_management/v1/security_center_management_rest_test.rb +++ /dev/null @@ -1,1265 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -require "helper" -require "gapic/rest" -require "google/cloud/securitycentermanagement/v1/security_center_management_pb" -require "google/cloud/security_center_management/v1/security_center_management/rest" - - -class ::Google::Cloud::SecurityCenterManagement::V1::SecurityCenterManagement::Rest::ClientTest < Minitest::Test - class ClientStub - attr_accessor :call_count, :requests - - def initialize response, &block - @response = response - @block = block - @call_count = 0 - @requests = [] - end - - def make_get_request uri:, params: {}, options: {}, method_name: nil - make_http_request :get, uri: uri, body: nil, params: params, options: options, method_name: method_name - end - - def make_delete_request uri:, params: {}, options: {}, method_name: nil - make_http_request :delete, uri: uri, body: nil, params: params, options: options, method_name: method_name - end - - def make_post_request uri:, body: nil, params: {}, options: {}, method_name: nil - make_http_request :post, uri: uri, body: body, params: params, options: options, method_name: method_name - end - - def make_patch_request uri:, body:, params: {}, options: {}, method_name: nil - make_http_request :patch, uri: uri, body: body, params: params, options: options, method_name: method_name - end - - def make_put_request uri:, body:, params: {}, options: {}, method_name: nil - make_http_request :put, uri: uri, body: body, params: params, options: options, method_name: method_name - end - - def make_http_request *args, **kwargs - @call_count += 1 - - @requests << @block&.call(*args, **kwargs) - - @response - end - - def endpoint - "endpoint.example.com" - end - - def universe_domain - "example.com" - end - - def stub_logger - nil - end - - def logger - nil - end - end - - def test_list_effective_security_health_analytics_custom_modules - # Create test objects. - client_result = ::Google::Cloud::SecurityCenterManagement::V1::ListEffectiveSecurityHealthAnalyticsCustomModulesResponse.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_effective_security_health_analytics_custom_modules_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| - assert options.metadata.key? :"x-goog-api-client" - assert options.metadata[:"x-goog-api-client"].include? "rest" - refute options.metadata[:"x-goog-api-client"].include? "grpc" - end - - ::Google::Cloud::SecurityCenterManagement::V1::SecurityCenterManagement::Rest::ServiceStub.stub :transcode_list_effective_security_health_analytics_custom_modules_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, list_effective_security_health_analytics_custom_modules_client_stub do - # Create client - client = ::Google::Cloud::SecurityCenterManagement::V1::SecurityCenterManagement::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - client.list_effective_security_health_analytics_custom_modules({ 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_effective_security_health_analytics_custom_modules 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_effective_security_health_analytics_custom_modules ::Google::Cloud::SecurityCenterManagement::V1::ListEffectiveSecurityHealthAnalyticsCustomModulesRequest.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_effective_security_health_analytics_custom_modules({ 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_effective_security_health_analytics_custom_modules(::Google::Cloud::SecurityCenterManagement::V1::ListEffectiveSecurityHealthAnalyticsCustomModulesRequest.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_effective_security_health_analytics_custom_modules_client_stub.call_count - end - end - end - - def test_get_effective_security_health_analytics_custom_module - # Create test objects. - client_result = ::Google::Cloud::SecurityCenterManagement::V1::EffectiveSecurityHealthAnalyticsCustomModule.new - http_response = OpenStruct.new body: client_result.to_json - - call_options = {} - - # Create request parameters for a unary method. - name = "hello world" - - get_effective_security_health_analytics_custom_module_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| - assert options.metadata.key? :"x-goog-api-client" - assert options.metadata[:"x-goog-api-client"].include? "rest" - refute options.metadata[:"x-goog-api-client"].include? "grpc" - end - - ::Google::Cloud::SecurityCenterManagement::V1::SecurityCenterManagement::Rest::ServiceStub.stub :transcode_get_effective_security_health_analytics_custom_module_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, get_effective_security_health_analytics_custom_module_client_stub do - # Create client - client = ::Google::Cloud::SecurityCenterManagement::V1::SecurityCenterManagement::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - client.get_effective_security_health_analytics_custom_module({ name: name }) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use named arguments - client.get_effective_security_health_analytics_custom_module name: name do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object - client.get_effective_security_health_analytics_custom_module ::Google::Cloud::SecurityCenterManagement::V1::GetEffectiveSecurityHealthAnalyticsCustomModuleRequest.new(name: name) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use hash object with options - client.get_effective_security_health_analytics_custom_module({ name: name }, call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object with options - client.get_effective_security_health_analytics_custom_module(::Google::Cloud::SecurityCenterManagement::V1::GetEffectiveSecurityHealthAnalyticsCustomModuleRequest.new(name: name), call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Verify method calls - assert_equal 5, get_effective_security_health_analytics_custom_module_client_stub.call_count - end - end - end - - def test_list_security_health_analytics_custom_modules - # Create test objects. - client_result = ::Google::Cloud::SecurityCenterManagement::V1::ListSecurityHealthAnalyticsCustomModulesResponse.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_security_health_analytics_custom_modules_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| - assert options.metadata.key? :"x-goog-api-client" - assert options.metadata[:"x-goog-api-client"].include? "rest" - refute options.metadata[:"x-goog-api-client"].include? "grpc" - end - - ::Google::Cloud::SecurityCenterManagement::V1::SecurityCenterManagement::Rest::ServiceStub.stub :transcode_list_security_health_analytics_custom_modules_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, list_security_health_analytics_custom_modules_client_stub do - # Create client - client = ::Google::Cloud::SecurityCenterManagement::V1::SecurityCenterManagement::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - client.list_security_health_analytics_custom_modules({ 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_security_health_analytics_custom_modules 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_security_health_analytics_custom_modules ::Google::Cloud::SecurityCenterManagement::V1::ListSecurityHealthAnalyticsCustomModulesRequest.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_security_health_analytics_custom_modules({ 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_security_health_analytics_custom_modules(::Google::Cloud::SecurityCenterManagement::V1::ListSecurityHealthAnalyticsCustomModulesRequest.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_security_health_analytics_custom_modules_client_stub.call_count - end - end - end - - def test_list_descendant_security_health_analytics_custom_modules - # Create test objects. - client_result = ::Google::Cloud::SecurityCenterManagement::V1::ListDescendantSecurityHealthAnalyticsCustomModulesResponse.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_descendant_security_health_analytics_custom_modules_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| - assert options.metadata.key? :"x-goog-api-client" - assert options.metadata[:"x-goog-api-client"].include? "rest" - refute options.metadata[:"x-goog-api-client"].include? "grpc" - end - - ::Google::Cloud::SecurityCenterManagement::V1::SecurityCenterManagement::Rest::ServiceStub.stub :transcode_list_descendant_security_health_analytics_custom_modules_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, list_descendant_security_health_analytics_custom_modules_client_stub do - # Create client - client = ::Google::Cloud::SecurityCenterManagement::V1::SecurityCenterManagement::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - client.list_descendant_security_health_analytics_custom_modules({ 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_descendant_security_health_analytics_custom_modules 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_descendant_security_health_analytics_custom_modules ::Google::Cloud::SecurityCenterManagement::V1::ListDescendantSecurityHealthAnalyticsCustomModulesRequest.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_descendant_security_health_analytics_custom_modules({ 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_descendant_security_health_analytics_custom_modules(::Google::Cloud::SecurityCenterManagement::V1::ListDescendantSecurityHealthAnalyticsCustomModulesRequest.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_descendant_security_health_analytics_custom_modules_client_stub.call_count - end - end - end - - def test_get_security_health_analytics_custom_module - # Create test objects. - client_result = ::Google::Cloud::SecurityCenterManagement::V1::SecurityHealthAnalyticsCustomModule.new - http_response = OpenStruct.new body: client_result.to_json - - call_options = {} - - # Create request parameters for a unary method. - name = "hello world" - - get_security_health_analytics_custom_module_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| - assert options.metadata.key? :"x-goog-api-client" - assert options.metadata[:"x-goog-api-client"].include? "rest" - refute options.metadata[:"x-goog-api-client"].include? "grpc" - end - - ::Google::Cloud::SecurityCenterManagement::V1::SecurityCenterManagement::Rest::ServiceStub.stub :transcode_get_security_health_analytics_custom_module_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, get_security_health_analytics_custom_module_client_stub do - # Create client - client = ::Google::Cloud::SecurityCenterManagement::V1::SecurityCenterManagement::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - client.get_security_health_analytics_custom_module({ name: name }) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use named arguments - client.get_security_health_analytics_custom_module name: name do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object - client.get_security_health_analytics_custom_module ::Google::Cloud::SecurityCenterManagement::V1::GetSecurityHealthAnalyticsCustomModuleRequest.new(name: name) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use hash object with options - client.get_security_health_analytics_custom_module({ name: name }, call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object with options - client.get_security_health_analytics_custom_module(::Google::Cloud::SecurityCenterManagement::V1::GetSecurityHealthAnalyticsCustomModuleRequest.new(name: name), call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Verify method calls - assert_equal 5, get_security_health_analytics_custom_module_client_stub.call_count - end - end - end - - def test_create_security_health_analytics_custom_module - # Create test objects. - client_result = ::Google::Cloud::SecurityCenterManagement::V1::SecurityHealthAnalyticsCustomModule.new - http_response = OpenStruct.new body: client_result.to_json - - call_options = {} - - # Create request parameters for a unary method. - parent = "hello world" - security_health_analytics_custom_module = {} - validate_only = true - - create_security_health_analytics_custom_module_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| - assert options.metadata.key? :"x-goog-api-client" - assert options.metadata[:"x-goog-api-client"].include? "rest" - refute options.metadata[:"x-goog-api-client"].include? "grpc" - end - - ::Google::Cloud::SecurityCenterManagement::V1::SecurityCenterManagement::Rest::ServiceStub.stub :transcode_create_security_health_analytics_custom_module_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, create_security_health_analytics_custom_module_client_stub do - # Create client - client = ::Google::Cloud::SecurityCenterManagement::V1::SecurityCenterManagement::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - client.create_security_health_analytics_custom_module({ parent: parent, security_health_analytics_custom_module: security_health_analytics_custom_module, validate_only: validate_only }) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use named arguments - client.create_security_health_analytics_custom_module parent: parent, security_health_analytics_custom_module: security_health_analytics_custom_module, validate_only: validate_only do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object - client.create_security_health_analytics_custom_module ::Google::Cloud::SecurityCenterManagement::V1::CreateSecurityHealthAnalyticsCustomModuleRequest.new(parent: parent, security_health_analytics_custom_module: security_health_analytics_custom_module, validate_only: validate_only) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use hash object with options - client.create_security_health_analytics_custom_module({ parent: parent, security_health_analytics_custom_module: security_health_analytics_custom_module, validate_only: validate_only }, call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object with options - client.create_security_health_analytics_custom_module(::Google::Cloud::SecurityCenterManagement::V1::CreateSecurityHealthAnalyticsCustomModuleRequest.new(parent: parent, security_health_analytics_custom_module: security_health_analytics_custom_module, validate_only: validate_only), call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Verify method calls - assert_equal 5, create_security_health_analytics_custom_module_client_stub.call_count - end - end - end - - def test_update_security_health_analytics_custom_module - # Create test objects. - client_result = ::Google::Cloud::SecurityCenterManagement::V1::SecurityHealthAnalyticsCustomModule.new - http_response = OpenStruct.new body: client_result.to_json - - call_options = {} - - # Create request parameters for a unary method. - update_mask = {} - security_health_analytics_custom_module = {} - validate_only = true - - update_security_health_analytics_custom_module_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| - assert options.metadata.key? :"x-goog-api-client" - assert options.metadata[:"x-goog-api-client"].include? "rest" - refute options.metadata[:"x-goog-api-client"].include? "grpc" - end - - ::Google::Cloud::SecurityCenterManagement::V1::SecurityCenterManagement::Rest::ServiceStub.stub :transcode_update_security_health_analytics_custom_module_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, update_security_health_analytics_custom_module_client_stub do - # Create client - client = ::Google::Cloud::SecurityCenterManagement::V1::SecurityCenterManagement::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - client.update_security_health_analytics_custom_module({ update_mask: update_mask, security_health_analytics_custom_module: security_health_analytics_custom_module, validate_only: validate_only }) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use named arguments - client.update_security_health_analytics_custom_module update_mask: update_mask, security_health_analytics_custom_module: security_health_analytics_custom_module, validate_only: validate_only do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object - client.update_security_health_analytics_custom_module ::Google::Cloud::SecurityCenterManagement::V1::UpdateSecurityHealthAnalyticsCustomModuleRequest.new(update_mask: update_mask, security_health_analytics_custom_module: security_health_analytics_custom_module, validate_only: validate_only) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use hash object with options - client.update_security_health_analytics_custom_module({ update_mask: update_mask, security_health_analytics_custom_module: security_health_analytics_custom_module, validate_only: validate_only }, call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object with options - client.update_security_health_analytics_custom_module(::Google::Cloud::SecurityCenterManagement::V1::UpdateSecurityHealthAnalyticsCustomModuleRequest.new(update_mask: update_mask, security_health_analytics_custom_module: security_health_analytics_custom_module, validate_only: validate_only), call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Verify method calls - assert_equal 5, update_security_health_analytics_custom_module_client_stub.call_count - end - end - end - - def test_delete_security_health_analytics_custom_module - # Create test objects. - client_result = ::Google::Protobuf::Empty.new - http_response = OpenStruct.new body: client_result.to_json - - call_options = {} - - # Create request parameters for a unary method. - name = "hello world" - validate_only = true - - delete_security_health_analytics_custom_module_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| - assert options.metadata.key? :"x-goog-api-client" - assert options.metadata[:"x-goog-api-client"].include? "rest" - refute options.metadata[:"x-goog-api-client"].include? "grpc" - end - - ::Google::Cloud::SecurityCenterManagement::V1::SecurityCenterManagement::Rest::ServiceStub.stub :transcode_delete_security_health_analytics_custom_module_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, delete_security_health_analytics_custom_module_client_stub do - # Create client - client = ::Google::Cloud::SecurityCenterManagement::V1::SecurityCenterManagement::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - client.delete_security_health_analytics_custom_module({ name: name, validate_only: validate_only }) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use named arguments - client.delete_security_health_analytics_custom_module name: name, validate_only: validate_only do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object - client.delete_security_health_analytics_custom_module ::Google::Cloud::SecurityCenterManagement::V1::DeleteSecurityHealthAnalyticsCustomModuleRequest.new(name: name, validate_only: validate_only) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use hash object with options - client.delete_security_health_analytics_custom_module({ name: name, validate_only: validate_only }, call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object with options - client.delete_security_health_analytics_custom_module(::Google::Cloud::SecurityCenterManagement::V1::DeleteSecurityHealthAnalyticsCustomModuleRequest.new(name: name, validate_only: validate_only), call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Verify method calls - assert_equal 5, delete_security_health_analytics_custom_module_client_stub.call_count - end - end - end - - def test_simulate_security_health_analytics_custom_module - # Create test objects. - client_result = ::Google::Cloud::SecurityCenterManagement::V1::SimulateSecurityHealthAnalyticsCustomModuleResponse.new - http_response = OpenStruct.new body: client_result.to_json - - call_options = {} - - # Create request parameters for a unary method. - parent = "hello world" - custom_config = {} - resource = {} - - simulate_security_health_analytics_custom_module_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| - assert options.metadata.key? :"x-goog-api-client" - assert options.metadata[:"x-goog-api-client"].include? "rest" - refute options.metadata[:"x-goog-api-client"].include? "grpc" - end - - ::Google::Cloud::SecurityCenterManagement::V1::SecurityCenterManagement::Rest::ServiceStub.stub :transcode_simulate_security_health_analytics_custom_module_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, simulate_security_health_analytics_custom_module_client_stub do - # Create client - client = ::Google::Cloud::SecurityCenterManagement::V1::SecurityCenterManagement::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - client.simulate_security_health_analytics_custom_module({ parent: parent, custom_config: custom_config, resource: resource }) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use named arguments - client.simulate_security_health_analytics_custom_module parent: parent, custom_config: custom_config, resource: resource do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object - client.simulate_security_health_analytics_custom_module ::Google::Cloud::SecurityCenterManagement::V1::SimulateSecurityHealthAnalyticsCustomModuleRequest.new(parent: parent, custom_config: custom_config, resource: resource) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use hash object with options - client.simulate_security_health_analytics_custom_module({ parent: parent, custom_config: custom_config, resource: resource }, call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object with options - client.simulate_security_health_analytics_custom_module(::Google::Cloud::SecurityCenterManagement::V1::SimulateSecurityHealthAnalyticsCustomModuleRequest.new(parent: parent, custom_config: custom_config, resource: resource), call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Verify method calls - assert_equal 5, simulate_security_health_analytics_custom_module_client_stub.call_count - end - end - end - - def test_list_effective_event_threat_detection_custom_modules - # Create test objects. - client_result = ::Google::Cloud::SecurityCenterManagement::V1::ListEffectiveEventThreatDetectionCustomModulesResponse.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_effective_event_threat_detection_custom_modules_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| - assert options.metadata.key? :"x-goog-api-client" - assert options.metadata[:"x-goog-api-client"].include? "rest" - refute options.metadata[:"x-goog-api-client"].include? "grpc" - end - - ::Google::Cloud::SecurityCenterManagement::V1::SecurityCenterManagement::Rest::ServiceStub.stub :transcode_list_effective_event_threat_detection_custom_modules_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, list_effective_event_threat_detection_custom_modules_client_stub do - # Create client - client = ::Google::Cloud::SecurityCenterManagement::V1::SecurityCenterManagement::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - client.list_effective_event_threat_detection_custom_modules({ 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_effective_event_threat_detection_custom_modules 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_effective_event_threat_detection_custom_modules ::Google::Cloud::SecurityCenterManagement::V1::ListEffectiveEventThreatDetectionCustomModulesRequest.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_effective_event_threat_detection_custom_modules({ 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_effective_event_threat_detection_custom_modules(::Google::Cloud::SecurityCenterManagement::V1::ListEffectiveEventThreatDetectionCustomModulesRequest.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_effective_event_threat_detection_custom_modules_client_stub.call_count - end - end - end - - def test_get_effective_event_threat_detection_custom_module - # Create test objects. - client_result = ::Google::Cloud::SecurityCenterManagement::V1::EffectiveEventThreatDetectionCustomModule.new - http_response = OpenStruct.new body: client_result.to_json - - call_options = {} - - # Create request parameters for a unary method. - name = "hello world" - - get_effective_event_threat_detection_custom_module_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| - assert options.metadata.key? :"x-goog-api-client" - assert options.metadata[:"x-goog-api-client"].include? "rest" - refute options.metadata[:"x-goog-api-client"].include? "grpc" - end - - ::Google::Cloud::SecurityCenterManagement::V1::SecurityCenterManagement::Rest::ServiceStub.stub :transcode_get_effective_event_threat_detection_custom_module_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, get_effective_event_threat_detection_custom_module_client_stub do - # Create client - client = ::Google::Cloud::SecurityCenterManagement::V1::SecurityCenterManagement::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - client.get_effective_event_threat_detection_custom_module({ name: name }) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use named arguments - client.get_effective_event_threat_detection_custom_module name: name do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object - client.get_effective_event_threat_detection_custom_module ::Google::Cloud::SecurityCenterManagement::V1::GetEffectiveEventThreatDetectionCustomModuleRequest.new(name: name) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use hash object with options - client.get_effective_event_threat_detection_custom_module({ name: name }, call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object with options - client.get_effective_event_threat_detection_custom_module(::Google::Cloud::SecurityCenterManagement::V1::GetEffectiveEventThreatDetectionCustomModuleRequest.new(name: name), call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Verify method calls - assert_equal 5, get_effective_event_threat_detection_custom_module_client_stub.call_count - end - end - end - - def test_list_event_threat_detection_custom_modules - # Create test objects. - client_result = ::Google::Cloud::SecurityCenterManagement::V1::ListEventThreatDetectionCustomModulesResponse.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_event_threat_detection_custom_modules_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| - assert options.metadata.key? :"x-goog-api-client" - assert options.metadata[:"x-goog-api-client"].include? "rest" - refute options.metadata[:"x-goog-api-client"].include? "grpc" - end - - ::Google::Cloud::SecurityCenterManagement::V1::SecurityCenterManagement::Rest::ServiceStub.stub :transcode_list_event_threat_detection_custom_modules_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, list_event_threat_detection_custom_modules_client_stub do - # Create client - client = ::Google::Cloud::SecurityCenterManagement::V1::SecurityCenterManagement::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - client.list_event_threat_detection_custom_modules({ 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_event_threat_detection_custom_modules 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_event_threat_detection_custom_modules ::Google::Cloud::SecurityCenterManagement::V1::ListEventThreatDetectionCustomModulesRequest.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_event_threat_detection_custom_modules({ 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_event_threat_detection_custom_modules(::Google::Cloud::SecurityCenterManagement::V1::ListEventThreatDetectionCustomModulesRequest.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_event_threat_detection_custom_modules_client_stub.call_count - end - end - end - - def test_list_descendant_event_threat_detection_custom_modules - # Create test objects. - client_result = ::Google::Cloud::SecurityCenterManagement::V1::ListDescendantEventThreatDetectionCustomModulesResponse.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_descendant_event_threat_detection_custom_modules_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| - assert options.metadata.key? :"x-goog-api-client" - assert options.metadata[:"x-goog-api-client"].include? "rest" - refute options.metadata[:"x-goog-api-client"].include? "grpc" - end - - ::Google::Cloud::SecurityCenterManagement::V1::SecurityCenterManagement::Rest::ServiceStub.stub :transcode_list_descendant_event_threat_detection_custom_modules_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, list_descendant_event_threat_detection_custom_modules_client_stub do - # Create client - client = ::Google::Cloud::SecurityCenterManagement::V1::SecurityCenterManagement::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - client.list_descendant_event_threat_detection_custom_modules({ 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_descendant_event_threat_detection_custom_modules 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_descendant_event_threat_detection_custom_modules ::Google::Cloud::SecurityCenterManagement::V1::ListDescendantEventThreatDetectionCustomModulesRequest.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_descendant_event_threat_detection_custom_modules({ 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_descendant_event_threat_detection_custom_modules(::Google::Cloud::SecurityCenterManagement::V1::ListDescendantEventThreatDetectionCustomModulesRequest.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_descendant_event_threat_detection_custom_modules_client_stub.call_count - end - end - end - - def test_get_event_threat_detection_custom_module - # Create test objects. - client_result = ::Google::Cloud::SecurityCenterManagement::V1::EventThreatDetectionCustomModule.new - http_response = OpenStruct.new body: client_result.to_json - - call_options = {} - - # Create request parameters for a unary method. - name = "hello world" - - get_event_threat_detection_custom_module_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| - assert options.metadata.key? :"x-goog-api-client" - assert options.metadata[:"x-goog-api-client"].include? "rest" - refute options.metadata[:"x-goog-api-client"].include? "grpc" - end - - ::Google::Cloud::SecurityCenterManagement::V1::SecurityCenterManagement::Rest::ServiceStub.stub :transcode_get_event_threat_detection_custom_module_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, get_event_threat_detection_custom_module_client_stub do - # Create client - client = ::Google::Cloud::SecurityCenterManagement::V1::SecurityCenterManagement::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - client.get_event_threat_detection_custom_module({ name: name }) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use named arguments - client.get_event_threat_detection_custom_module name: name do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object - client.get_event_threat_detection_custom_module ::Google::Cloud::SecurityCenterManagement::V1::GetEventThreatDetectionCustomModuleRequest.new(name: name) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use hash object with options - client.get_event_threat_detection_custom_module({ name: name }, call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object with options - client.get_event_threat_detection_custom_module(::Google::Cloud::SecurityCenterManagement::V1::GetEventThreatDetectionCustomModuleRequest.new(name: name), call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Verify method calls - assert_equal 5, get_event_threat_detection_custom_module_client_stub.call_count - end - end - end - - def test_create_event_threat_detection_custom_module - # Create test objects. - client_result = ::Google::Cloud::SecurityCenterManagement::V1::EventThreatDetectionCustomModule.new - http_response = OpenStruct.new body: client_result.to_json - - call_options = {} - - # Create request parameters for a unary method. - parent = "hello world" - event_threat_detection_custom_module = {} - validate_only = true - - create_event_threat_detection_custom_module_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| - assert options.metadata.key? :"x-goog-api-client" - assert options.metadata[:"x-goog-api-client"].include? "rest" - refute options.metadata[:"x-goog-api-client"].include? "grpc" - end - - ::Google::Cloud::SecurityCenterManagement::V1::SecurityCenterManagement::Rest::ServiceStub.stub :transcode_create_event_threat_detection_custom_module_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, create_event_threat_detection_custom_module_client_stub do - # Create client - client = ::Google::Cloud::SecurityCenterManagement::V1::SecurityCenterManagement::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - client.create_event_threat_detection_custom_module({ parent: parent, event_threat_detection_custom_module: event_threat_detection_custom_module, validate_only: validate_only }) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use named arguments - client.create_event_threat_detection_custom_module parent: parent, event_threat_detection_custom_module: event_threat_detection_custom_module, validate_only: validate_only do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object - client.create_event_threat_detection_custom_module ::Google::Cloud::SecurityCenterManagement::V1::CreateEventThreatDetectionCustomModuleRequest.new(parent: parent, event_threat_detection_custom_module: event_threat_detection_custom_module, validate_only: validate_only) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use hash object with options - client.create_event_threat_detection_custom_module({ parent: parent, event_threat_detection_custom_module: event_threat_detection_custom_module, validate_only: validate_only }, call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object with options - client.create_event_threat_detection_custom_module(::Google::Cloud::SecurityCenterManagement::V1::CreateEventThreatDetectionCustomModuleRequest.new(parent: parent, event_threat_detection_custom_module: event_threat_detection_custom_module, validate_only: validate_only), call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Verify method calls - assert_equal 5, create_event_threat_detection_custom_module_client_stub.call_count - end - end - end - - def test_update_event_threat_detection_custom_module - # Create test objects. - client_result = ::Google::Cloud::SecurityCenterManagement::V1::EventThreatDetectionCustomModule.new - http_response = OpenStruct.new body: client_result.to_json - - call_options = {} - - # Create request parameters for a unary method. - update_mask = {} - event_threat_detection_custom_module = {} - validate_only = true - - update_event_threat_detection_custom_module_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| - assert options.metadata.key? :"x-goog-api-client" - assert options.metadata[:"x-goog-api-client"].include? "rest" - refute options.metadata[:"x-goog-api-client"].include? "grpc" - end - - ::Google::Cloud::SecurityCenterManagement::V1::SecurityCenterManagement::Rest::ServiceStub.stub :transcode_update_event_threat_detection_custom_module_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, update_event_threat_detection_custom_module_client_stub do - # Create client - client = ::Google::Cloud::SecurityCenterManagement::V1::SecurityCenterManagement::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - client.update_event_threat_detection_custom_module({ update_mask: update_mask, event_threat_detection_custom_module: event_threat_detection_custom_module, validate_only: validate_only }) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use named arguments - client.update_event_threat_detection_custom_module update_mask: update_mask, event_threat_detection_custom_module: event_threat_detection_custom_module, validate_only: validate_only do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object - client.update_event_threat_detection_custom_module ::Google::Cloud::SecurityCenterManagement::V1::UpdateEventThreatDetectionCustomModuleRequest.new(update_mask: update_mask, event_threat_detection_custom_module: event_threat_detection_custom_module, validate_only: validate_only) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use hash object with options - client.update_event_threat_detection_custom_module({ update_mask: update_mask, event_threat_detection_custom_module: event_threat_detection_custom_module, validate_only: validate_only }, call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object with options - client.update_event_threat_detection_custom_module(::Google::Cloud::SecurityCenterManagement::V1::UpdateEventThreatDetectionCustomModuleRequest.new(update_mask: update_mask, event_threat_detection_custom_module: event_threat_detection_custom_module, validate_only: validate_only), call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Verify method calls - assert_equal 5, update_event_threat_detection_custom_module_client_stub.call_count - end - end - end - - def test_delete_event_threat_detection_custom_module - # Create test objects. - client_result = ::Google::Protobuf::Empty.new - http_response = OpenStruct.new body: client_result.to_json - - call_options = {} - - # Create request parameters for a unary method. - name = "hello world" - validate_only = true - - delete_event_threat_detection_custom_module_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| - assert options.metadata.key? :"x-goog-api-client" - assert options.metadata[:"x-goog-api-client"].include? "rest" - refute options.metadata[:"x-goog-api-client"].include? "grpc" - end - - ::Google::Cloud::SecurityCenterManagement::V1::SecurityCenterManagement::Rest::ServiceStub.stub :transcode_delete_event_threat_detection_custom_module_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, delete_event_threat_detection_custom_module_client_stub do - # Create client - client = ::Google::Cloud::SecurityCenterManagement::V1::SecurityCenterManagement::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - client.delete_event_threat_detection_custom_module({ name: name, validate_only: validate_only }) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use named arguments - client.delete_event_threat_detection_custom_module name: name, validate_only: validate_only do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object - client.delete_event_threat_detection_custom_module ::Google::Cloud::SecurityCenterManagement::V1::DeleteEventThreatDetectionCustomModuleRequest.new(name: name, validate_only: validate_only) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use hash object with options - client.delete_event_threat_detection_custom_module({ name: name, validate_only: validate_only }, call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object with options - client.delete_event_threat_detection_custom_module(::Google::Cloud::SecurityCenterManagement::V1::DeleteEventThreatDetectionCustomModuleRequest.new(name: name, validate_only: validate_only), call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Verify method calls - assert_equal 5, delete_event_threat_detection_custom_module_client_stub.call_count - end - end - end - - def test_validate_event_threat_detection_custom_module - # Create test objects. - client_result = ::Google::Cloud::SecurityCenterManagement::V1::ValidateEventThreatDetectionCustomModuleResponse.new - http_response = OpenStruct.new body: client_result.to_json - - call_options = {} - - # Create request parameters for a unary method. - parent = "hello world" - raw_text = "hello world" - type = "hello world" - - validate_event_threat_detection_custom_module_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| - assert options.metadata.key? :"x-goog-api-client" - assert options.metadata[:"x-goog-api-client"].include? "rest" - refute options.metadata[:"x-goog-api-client"].include? "grpc" - end - - ::Google::Cloud::SecurityCenterManagement::V1::SecurityCenterManagement::Rest::ServiceStub.stub :transcode_validate_event_threat_detection_custom_module_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, validate_event_threat_detection_custom_module_client_stub do - # Create client - client = ::Google::Cloud::SecurityCenterManagement::V1::SecurityCenterManagement::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - client.validate_event_threat_detection_custom_module({ parent: parent, raw_text: raw_text, type: type }) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use named arguments - client.validate_event_threat_detection_custom_module parent: parent, raw_text: raw_text, type: type do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object - client.validate_event_threat_detection_custom_module ::Google::Cloud::SecurityCenterManagement::V1::ValidateEventThreatDetectionCustomModuleRequest.new(parent: parent, raw_text: raw_text, type: type) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use hash object with options - client.validate_event_threat_detection_custom_module({ parent: parent, raw_text: raw_text, type: type }, call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object with options - client.validate_event_threat_detection_custom_module(::Google::Cloud::SecurityCenterManagement::V1::ValidateEventThreatDetectionCustomModuleRequest.new(parent: parent, raw_text: raw_text, type: type), call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Verify method calls - assert_equal 5, validate_event_threat_detection_custom_module_client_stub.call_count - end - end - end - - def test_get_security_center_service - # Create test objects. - client_result = ::Google::Cloud::SecurityCenterManagement::V1::SecurityCenterService.new - http_response = OpenStruct.new body: client_result.to_json - - call_options = {} - - # Create request parameters for a unary method. - name = "hello world" - show_eligible_modules_only = true - - get_security_center_service_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| - assert options.metadata.key? :"x-goog-api-client" - assert options.metadata[:"x-goog-api-client"].include? "rest" - refute options.metadata[:"x-goog-api-client"].include? "grpc" - end - - ::Google::Cloud::SecurityCenterManagement::V1::SecurityCenterManagement::Rest::ServiceStub.stub :transcode_get_security_center_service_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, get_security_center_service_client_stub do - # Create client - client = ::Google::Cloud::SecurityCenterManagement::V1::SecurityCenterManagement::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - client.get_security_center_service({ name: name, show_eligible_modules_only: show_eligible_modules_only }) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use named arguments - client.get_security_center_service name: name, show_eligible_modules_only: show_eligible_modules_only do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object - client.get_security_center_service ::Google::Cloud::SecurityCenterManagement::V1::GetSecurityCenterServiceRequest.new(name: name, show_eligible_modules_only: show_eligible_modules_only) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use hash object with options - client.get_security_center_service({ name: name, show_eligible_modules_only: show_eligible_modules_only }, call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object with options - client.get_security_center_service(::Google::Cloud::SecurityCenterManagement::V1::GetSecurityCenterServiceRequest.new(name: name, show_eligible_modules_only: show_eligible_modules_only), call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Verify method calls - assert_equal 5, get_security_center_service_client_stub.call_count - end - end - end - - def test_list_security_center_services - # Create test objects. - client_result = ::Google::Cloud::SecurityCenterManagement::V1::ListSecurityCenterServicesResponse.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" - show_eligible_modules_only = true - - list_security_center_services_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| - assert options.metadata.key? :"x-goog-api-client" - assert options.metadata[:"x-goog-api-client"].include? "rest" - refute options.metadata[:"x-goog-api-client"].include? "grpc" - end - - ::Google::Cloud::SecurityCenterManagement::V1::SecurityCenterManagement::Rest::ServiceStub.stub :transcode_list_security_center_services_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, list_security_center_services_client_stub do - # Create client - client = ::Google::Cloud::SecurityCenterManagement::V1::SecurityCenterManagement::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - client.list_security_center_services({ parent: parent, page_size: page_size, page_token: page_token, show_eligible_modules_only: show_eligible_modules_only }) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use named arguments - client.list_security_center_services parent: parent, page_size: page_size, page_token: page_token, show_eligible_modules_only: show_eligible_modules_only do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object - client.list_security_center_services ::Google::Cloud::SecurityCenterManagement::V1::ListSecurityCenterServicesRequest.new(parent: parent, page_size: page_size, page_token: page_token, show_eligible_modules_only: show_eligible_modules_only) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use hash object with options - client.list_security_center_services({ parent: parent, page_size: page_size, page_token: page_token, show_eligible_modules_only: show_eligible_modules_only }, call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object with options - client.list_security_center_services(::Google::Cloud::SecurityCenterManagement::V1::ListSecurityCenterServicesRequest.new(parent: parent, page_size: page_size, page_token: page_token, show_eligible_modules_only: show_eligible_modules_only), call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Verify method calls - assert_equal 5, list_security_center_services_client_stub.call_count - end - end - end - - def test_update_security_center_service - # Create test objects. - client_result = ::Google::Cloud::SecurityCenterManagement::V1::SecurityCenterService.new - http_response = OpenStruct.new body: client_result.to_json - - call_options = {} - - # Create request parameters for a unary method. - security_center_service = {} - update_mask = {} - validate_only = true - - update_security_center_service_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| - assert options.metadata.key? :"x-goog-api-client" - assert options.metadata[:"x-goog-api-client"].include? "rest" - refute options.metadata[:"x-goog-api-client"].include? "grpc" - end - - ::Google::Cloud::SecurityCenterManagement::V1::SecurityCenterManagement::Rest::ServiceStub.stub :transcode_update_security_center_service_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, update_security_center_service_client_stub do - # Create client - client = ::Google::Cloud::SecurityCenterManagement::V1::SecurityCenterManagement::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - client.update_security_center_service({ security_center_service: security_center_service, update_mask: update_mask, validate_only: validate_only }) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use named arguments - client.update_security_center_service security_center_service: security_center_service, update_mask: update_mask, validate_only: validate_only do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object - client.update_security_center_service ::Google::Cloud::SecurityCenterManagement::V1::UpdateSecurityCenterServiceRequest.new(security_center_service: security_center_service, update_mask: update_mask, validate_only: validate_only) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use hash object with options - client.update_security_center_service({ security_center_service: security_center_service, update_mask: update_mask, validate_only: validate_only }, call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object with options - client.update_security_center_service(::Google::Cloud::SecurityCenterManagement::V1::UpdateSecurityCenterServiceRequest.new(security_center_service: security_center_service, update_mask: update_mask, validate_only: validate_only), call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Verify method calls - assert_equal 5, update_security_center_service_client_stub.call_count - end - end - end - - def test_configure - credentials_token = :dummy_value - - client = block_config = config = nil - dummy_stub = ClientStub.new nil - Gapic::Rest::ClientStub.stub :new, dummy_stub do - client = ::Google::Cloud::SecurityCenterManagement::V1::SecurityCenterManagement::Rest::Client.new do |config| - config.credentials = credentials_token - end - end - - config = client.configure do |c| - block_config = c - end - - assert_same block_config, config - assert_kind_of ::Google::Cloud::SecurityCenterManagement::V1::SecurityCenterManagement::Rest::Client::Configuration, config - end -end diff --git a/owl-bot-staging/google-cloud-security_center_management-v1/test/google/cloud/security_center_management/v1/security_center_management_test.rb b/owl-bot-staging/google-cloud-security_center_management-v1/test/google/cloud/security_center_management/v1/security_center_management_test.rb deleted file mode 100644 index 5e0d83eb3215..000000000000 --- a/owl-bot-staging/google-cloud-security_center_management-v1/test/google/cloud/security_center_management/v1/security_center_management_test.rb +++ /dev/null @@ -1,1421 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -require "helper" - -require "gapic/grpc/service_stub" - -require "google/cloud/securitycentermanagement/v1/security_center_management_pb" -require "google/cloud/security_center_management/v1/security_center_management" - -class ::Google::Cloud::SecurityCenterManagement::V1::SecurityCenterManagement::ClientTest < Minitest::Test - class ClientStub - attr_accessor :call_rpc_count, :requests - - def initialize response, operation, &block - @response = response - @operation = operation - @block = block - @call_rpc_count = 0 - @requests = [] - end - - def call_rpc *args, **kwargs - @call_rpc_count += 1 - - @requests << @block&.call(*args, **kwargs) - - catch :response do - yield @response, @operation if block_given? - @response - end - end - - def endpoint - "endpoint.example.com" - end - - def universe_domain - "example.com" - end - - def stub_logger - nil - end - - def logger - nil - end - end - - def test_list_effective_security_health_analytics_custom_modules - # Create GRPC objects. - grpc_response = ::Google::Cloud::SecurityCenterManagement::V1::ListEffectiveSecurityHealthAnalyticsCustomModulesResponse.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_effective_security_health_analytics_custom_modules_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :list_effective_security_health_analytics_custom_modules, name - assert_kind_of ::Google::Cloud::SecurityCenterManagement::V1::ListEffectiveSecurityHealthAnalyticsCustomModulesRequest, 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_effective_security_health_analytics_custom_modules_client_stub do - # Create client - client = ::Google::Cloud::SecurityCenterManagement::V1::SecurityCenterManagement::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.list_effective_security_health_analytics_custom_modules({ 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_effective_security_health_analytics_custom_modules 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_effective_security_health_analytics_custom_modules ::Google::Cloud::SecurityCenterManagement::V1::ListEffectiveSecurityHealthAnalyticsCustomModulesRequest.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_effective_security_health_analytics_custom_modules({ 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_effective_security_health_analytics_custom_modules(::Google::Cloud::SecurityCenterManagement::V1::ListEffectiveSecurityHealthAnalyticsCustomModulesRequest.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_effective_security_health_analytics_custom_modules_client_stub.call_rpc_count - end - end - - def test_get_effective_security_health_analytics_custom_module - # Create GRPC objects. - grpc_response = ::Google::Cloud::SecurityCenterManagement::V1::EffectiveSecurityHealthAnalyticsCustomModule.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_effective_security_health_analytics_custom_module_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :get_effective_security_health_analytics_custom_module, name - assert_kind_of ::Google::Cloud::SecurityCenterManagement::V1::GetEffectiveSecurityHealthAnalyticsCustomModuleRequest, request - assert_equal "hello world", request["name"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, get_effective_security_health_analytics_custom_module_client_stub do - # Create client - client = ::Google::Cloud::SecurityCenterManagement::V1::SecurityCenterManagement::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.get_effective_security_health_analytics_custom_module({ name: name }) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use named arguments - client.get_effective_security_health_analytics_custom_module name: name do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object - client.get_effective_security_health_analytics_custom_module ::Google::Cloud::SecurityCenterManagement::V1::GetEffectiveSecurityHealthAnalyticsCustomModuleRequest.new(name: name) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use hash object with options - client.get_effective_security_health_analytics_custom_module({ 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_effective_security_health_analytics_custom_module(::Google::Cloud::SecurityCenterManagement::V1::GetEffectiveSecurityHealthAnalyticsCustomModuleRequest.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_effective_security_health_analytics_custom_module_client_stub.call_rpc_count - end - end - - def test_list_security_health_analytics_custom_modules - # Create GRPC objects. - grpc_response = ::Google::Cloud::SecurityCenterManagement::V1::ListSecurityHealthAnalyticsCustomModulesResponse.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_security_health_analytics_custom_modules_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :list_security_health_analytics_custom_modules, name - assert_kind_of ::Google::Cloud::SecurityCenterManagement::V1::ListSecurityHealthAnalyticsCustomModulesRequest, 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_security_health_analytics_custom_modules_client_stub do - # Create client - client = ::Google::Cloud::SecurityCenterManagement::V1::SecurityCenterManagement::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.list_security_health_analytics_custom_modules({ 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_security_health_analytics_custom_modules 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_security_health_analytics_custom_modules ::Google::Cloud::SecurityCenterManagement::V1::ListSecurityHealthAnalyticsCustomModulesRequest.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_security_health_analytics_custom_modules({ 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_security_health_analytics_custom_modules(::Google::Cloud::SecurityCenterManagement::V1::ListSecurityHealthAnalyticsCustomModulesRequest.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_security_health_analytics_custom_modules_client_stub.call_rpc_count - end - end - - def test_list_descendant_security_health_analytics_custom_modules - # Create GRPC objects. - grpc_response = ::Google::Cloud::SecurityCenterManagement::V1::ListDescendantSecurityHealthAnalyticsCustomModulesResponse.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_descendant_security_health_analytics_custom_modules_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :list_descendant_security_health_analytics_custom_modules, name - assert_kind_of ::Google::Cloud::SecurityCenterManagement::V1::ListDescendantSecurityHealthAnalyticsCustomModulesRequest, 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_descendant_security_health_analytics_custom_modules_client_stub do - # Create client - client = ::Google::Cloud::SecurityCenterManagement::V1::SecurityCenterManagement::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.list_descendant_security_health_analytics_custom_modules({ 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_descendant_security_health_analytics_custom_modules 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_descendant_security_health_analytics_custom_modules ::Google::Cloud::SecurityCenterManagement::V1::ListDescendantSecurityHealthAnalyticsCustomModulesRequest.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_descendant_security_health_analytics_custom_modules({ 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_descendant_security_health_analytics_custom_modules(::Google::Cloud::SecurityCenterManagement::V1::ListDescendantSecurityHealthAnalyticsCustomModulesRequest.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_descendant_security_health_analytics_custom_modules_client_stub.call_rpc_count - end - end - - def test_get_security_health_analytics_custom_module - # Create GRPC objects. - grpc_response = ::Google::Cloud::SecurityCenterManagement::V1::SecurityHealthAnalyticsCustomModule.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_security_health_analytics_custom_module_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :get_security_health_analytics_custom_module, name - assert_kind_of ::Google::Cloud::SecurityCenterManagement::V1::GetSecurityHealthAnalyticsCustomModuleRequest, request - assert_equal "hello world", request["name"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, get_security_health_analytics_custom_module_client_stub do - # Create client - client = ::Google::Cloud::SecurityCenterManagement::V1::SecurityCenterManagement::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.get_security_health_analytics_custom_module({ name: name }) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use named arguments - client.get_security_health_analytics_custom_module name: name do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object - client.get_security_health_analytics_custom_module ::Google::Cloud::SecurityCenterManagement::V1::GetSecurityHealthAnalyticsCustomModuleRequest.new(name: name) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use hash object with options - client.get_security_health_analytics_custom_module({ 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_security_health_analytics_custom_module(::Google::Cloud::SecurityCenterManagement::V1::GetSecurityHealthAnalyticsCustomModuleRequest.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_security_health_analytics_custom_module_client_stub.call_rpc_count - end - end - - def test_create_security_health_analytics_custom_module - # Create GRPC objects. - grpc_response = ::Google::Cloud::SecurityCenterManagement::V1::SecurityHealthAnalyticsCustomModule.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" - security_health_analytics_custom_module = {} - validate_only = true - - create_security_health_analytics_custom_module_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :create_security_health_analytics_custom_module, name - assert_kind_of ::Google::Cloud::SecurityCenterManagement::V1::CreateSecurityHealthAnalyticsCustomModuleRequest, request - assert_equal "hello world", request["parent"] - assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::SecurityCenterManagement::V1::SecurityHealthAnalyticsCustomModule), request["security_health_analytics_custom_module"] - assert_equal true, request["validate_only"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, create_security_health_analytics_custom_module_client_stub do - # Create client - client = ::Google::Cloud::SecurityCenterManagement::V1::SecurityCenterManagement::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.create_security_health_analytics_custom_module({ parent: parent, security_health_analytics_custom_module: security_health_analytics_custom_module, validate_only: validate_only }) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use named arguments - client.create_security_health_analytics_custom_module parent: parent, security_health_analytics_custom_module: security_health_analytics_custom_module, validate_only: validate_only do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object - client.create_security_health_analytics_custom_module ::Google::Cloud::SecurityCenterManagement::V1::CreateSecurityHealthAnalyticsCustomModuleRequest.new(parent: parent, security_health_analytics_custom_module: security_health_analytics_custom_module, validate_only: validate_only) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use hash object with options - client.create_security_health_analytics_custom_module({ parent: parent, security_health_analytics_custom_module: security_health_analytics_custom_module, validate_only: validate_only }, grpc_options) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object with options - client.create_security_health_analytics_custom_module(::Google::Cloud::SecurityCenterManagement::V1::CreateSecurityHealthAnalyticsCustomModuleRequest.new(parent: parent, security_health_analytics_custom_module: security_health_analytics_custom_module, validate_only: validate_only), grpc_options) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Verify method calls - assert_equal 5, create_security_health_analytics_custom_module_client_stub.call_rpc_count - end - end - - def test_update_security_health_analytics_custom_module - # Create GRPC objects. - grpc_response = ::Google::Cloud::SecurityCenterManagement::V1::SecurityHealthAnalyticsCustomModule.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. - update_mask = {} - security_health_analytics_custom_module = {} - validate_only = true - - update_security_health_analytics_custom_module_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :update_security_health_analytics_custom_module, name - assert_kind_of ::Google::Cloud::SecurityCenterManagement::V1::UpdateSecurityHealthAnalyticsCustomModuleRequest, request - assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Protobuf::FieldMask), request["update_mask"] - assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::SecurityCenterManagement::V1::SecurityHealthAnalyticsCustomModule), request["security_health_analytics_custom_module"] - assert_equal true, request["validate_only"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, update_security_health_analytics_custom_module_client_stub do - # Create client - client = ::Google::Cloud::SecurityCenterManagement::V1::SecurityCenterManagement::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.update_security_health_analytics_custom_module({ update_mask: update_mask, security_health_analytics_custom_module: security_health_analytics_custom_module, validate_only: validate_only }) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use named arguments - client.update_security_health_analytics_custom_module update_mask: update_mask, security_health_analytics_custom_module: security_health_analytics_custom_module, validate_only: validate_only do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object - client.update_security_health_analytics_custom_module ::Google::Cloud::SecurityCenterManagement::V1::UpdateSecurityHealthAnalyticsCustomModuleRequest.new(update_mask: update_mask, security_health_analytics_custom_module: security_health_analytics_custom_module, validate_only: validate_only) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use hash object with options - client.update_security_health_analytics_custom_module({ update_mask: update_mask, security_health_analytics_custom_module: security_health_analytics_custom_module, validate_only: validate_only }, grpc_options) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object with options - client.update_security_health_analytics_custom_module(::Google::Cloud::SecurityCenterManagement::V1::UpdateSecurityHealthAnalyticsCustomModuleRequest.new(update_mask: update_mask, security_health_analytics_custom_module: security_health_analytics_custom_module, validate_only: validate_only), grpc_options) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Verify method calls - assert_equal 5, update_security_health_analytics_custom_module_client_stub.call_rpc_count - end - end - - def test_delete_security_health_analytics_custom_module - # 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" - validate_only = true - - delete_security_health_analytics_custom_module_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :delete_security_health_analytics_custom_module, name - assert_kind_of ::Google::Cloud::SecurityCenterManagement::V1::DeleteSecurityHealthAnalyticsCustomModuleRequest, request - assert_equal "hello world", request["name"] - assert_equal true, request["validate_only"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, delete_security_health_analytics_custom_module_client_stub do - # Create client - client = ::Google::Cloud::SecurityCenterManagement::V1::SecurityCenterManagement::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.delete_security_health_analytics_custom_module({ name: name, validate_only: validate_only }) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use named arguments - client.delete_security_health_analytics_custom_module name: name, validate_only: validate_only do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object - client.delete_security_health_analytics_custom_module ::Google::Cloud::SecurityCenterManagement::V1::DeleteSecurityHealthAnalyticsCustomModuleRequest.new(name: name, validate_only: validate_only) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use hash object with options - client.delete_security_health_analytics_custom_module({ name: name, validate_only: validate_only }, grpc_options) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object with options - client.delete_security_health_analytics_custom_module(::Google::Cloud::SecurityCenterManagement::V1::DeleteSecurityHealthAnalyticsCustomModuleRequest.new(name: name, validate_only: validate_only), grpc_options) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Verify method calls - assert_equal 5, delete_security_health_analytics_custom_module_client_stub.call_rpc_count - end - end - - def test_simulate_security_health_analytics_custom_module - # Create GRPC objects. - grpc_response = ::Google::Cloud::SecurityCenterManagement::V1::SimulateSecurityHealthAnalyticsCustomModuleResponse.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" - custom_config = {} - resource = {} - - simulate_security_health_analytics_custom_module_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :simulate_security_health_analytics_custom_module, name - assert_kind_of ::Google::Cloud::SecurityCenterManagement::V1::SimulateSecurityHealthAnalyticsCustomModuleRequest, request - assert_equal "hello world", request["parent"] - assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::SecurityCenterManagement::V1::CustomConfig), request["custom_config"] - assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::SecurityCenterManagement::V1::SimulateSecurityHealthAnalyticsCustomModuleRequest::SimulatedResource), request["resource"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, simulate_security_health_analytics_custom_module_client_stub do - # Create client - client = ::Google::Cloud::SecurityCenterManagement::V1::SecurityCenterManagement::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.simulate_security_health_analytics_custom_module({ parent: parent, custom_config: custom_config, resource: resource }) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use named arguments - client.simulate_security_health_analytics_custom_module parent: parent, custom_config: custom_config, resource: resource do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object - client.simulate_security_health_analytics_custom_module ::Google::Cloud::SecurityCenterManagement::V1::SimulateSecurityHealthAnalyticsCustomModuleRequest.new(parent: parent, custom_config: custom_config, resource: resource) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use hash object with options - client.simulate_security_health_analytics_custom_module({ parent: parent, custom_config: custom_config, resource: resource }, grpc_options) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object with options - client.simulate_security_health_analytics_custom_module(::Google::Cloud::SecurityCenterManagement::V1::SimulateSecurityHealthAnalyticsCustomModuleRequest.new(parent: parent, custom_config: custom_config, resource: resource), grpc_options) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Verify method calls - assert_equal 5, simulate_security_health_analytics_custom_module_client_stub.call_rpc_count - end - end - - def test_list_effective_event_threat_detection_custom_modules - # Create GRPC objects. - grpc_response = ::Google::Cloud::SecurityCenterManagement::V1::ListEffectiveEventThreatDetectionCustomModulesResponse.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_effective_event_threat_detection_custom_modules_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :list_effective_event_threat_detection_custom_modules, name - assert_kind_of ::Google::Cloud::SecurityCenterManagement::V1::ListEffectiveEventThreatDetectionCustomModulesRequest, 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_effective_event_threat_detection_custom_modules_client_stub do - # Create client - client = ::Google::Cloud::SecurityCenterManagement::V1::SecurityCenterManagement::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.list_effective_event_threat_detection_custom_modules({ 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_effective_event_threat_detection_custom_modules 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_effective_event_threat_detection_custom_modules ::Google::Cloud::SecurityCenterManagement::V1::ListEffectiveEventThreatDetectionCustomModulesRequest.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_effective_event_threat_detection_custom_modules({ 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_effective_event_threat_detection_custom_modules(::Google::Cloud::SecurityCenterManagement::V1::ListEffectiveEventThreatDetectionCustomModulesRequest.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_effective_event_threat_detection_custom_modules_client_stub.call_rpc_count - end - end - - def test_get_effective_event_threat_detection_custom_module - # Create GRPC objects. - grpc_response = ::Google::Cloud::SecurityCenterManagement::V1::EffectiveEventThreatDetectionCustomModule.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_effective_event_threat_detection_custom_module_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :get_effective_event_threat_detection_custom_module, name - assert_kind_of ::Google::Cloud::SecurityCenterManagement::V1::GetEffectiveEventThreatDetectionCustomModuleRequest, request - assert_equal "hello world", request["name"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, get_effective_event_threat_detection_custom_module_client_stub do - # Create client - client = ::Google::Cloud::SecurityCenterManagement::V1::SecurityCenterManagement::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.get_effective_event_threat_detection_custom_module({ name: name }) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use named arguments - client.get_effective_event_threat_detection_custom_module name: name do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object - client.get_effective_event_threat_detection_custom_module ::Google::Cloud::SecurityCenterManagement::V1::GetEffectiveEventThreatDetectionCustomModuleRequest.new(name: name) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use hash object with options - client.get_effective_event_threat_detection_custom_module({ 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_effective_event_threat_detection_custom_module(::Google::Cloud::SecurityCenterManagement::V1::GetEffectiveEventThreatDetectionCustomModuleRequest.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_effective_event_threat_detection_custom_module_client_stub.call_rpc_count - end - end - - def test_list_event_threat_detection_custom_modules - # Create GRPC objects. - grpc_response = ::Google::Cloud::SecurityCenterManagement::V1::ListEventThreatDetectionCustomModulesResponse.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_event_threat_detection_custom_modules_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :list_event_threat_detection_custom_modules, name - assert_kind_of ::Google::Cloud::SecurityCenterManagement::V1::ListEventThreatDetectionCustomModulesRequest, 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_event_threat_detection_custom_modules_client_stub do - # Create client - client = ::Google::Cloud::SecurityCenterManagement::V1::SecurityCenterManagement::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.list_event_threat_detection_custom_modules({ 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_event_threat_detection_custom_modules 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_event_threat_detection_custom_modules ::Google::Cloud::SecurityCenterManagement::V1::ListEventThreatDetectionCustomModulesRequest.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_event_threat_detection_custom_modules({ 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_event_threat_detection_custom_modules(::Google::Cloud::SecurityCenterManagement::V1::ListEventThreatDetectionCustomModulesRequest.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_event_threat_detection_custom_modules_client_stub.call_rpc_count - end - end - - def test_list_descendant_event_threat_detection_custom_modules - # Create GRPC objects. - grpc_response = ::Google::Cloud::SecurityCenterManagement::V1::ListDescendantEventThreatDetectionCustomModulesResponse.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_descendant_event_threat_detection_custom_modules_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :list_descendant_event_threat_detection_custom_modules, name - assert_kind_of ::Google::Cloud::SecurityCenterManagement::V1::ListDescendantEventThreatDetectionCustomModulesRequest, 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_descendant_event_threat_detection_custom_modules_client_stub do - # Create client - client = ::Google::Cloud::SecurityCenterManagement::V1::SecurityCenterManagement::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.list_descendant_event_threat_detection_custom_modules({ 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_descendant_event_threat_detection_custom_modules 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_descendant_event_threat_detection_custom_modules ::Google::Cloud::SecurityCenterManagement::V1::ListDescendantEventThreatDetectionCustomModulesRequest.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_descendant_event_threat_detection_custom_modules({ 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_descendant_event_threat_detection_custom_modules(::Google::Cloud::SecurityCenterManagement::V1::ListDescendantEventThreatDetectionCustomModulesRequest.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_descendant_event_threat_detection_custom_modules_client_stub.call_rpc_count - end - end - - def test_get_event_threat_detection_custom_module - # Create GRPC objects. - grpc_response = ::Google::Cloud::SecurityCenterManagement::V1::EventThreatDetectionCustomModule.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_event_threat_detection_custom_module_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :get_event_threat_detection_custom_module, name - assert_kind_of ::Google::Cloud::SecurityCenterManagement::V1::GetEventThreatDetectionCustomModuleRequest, request - assert_equal "hello world", request["name"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, get_event_threat_detection_custom_module_client_stub do - # Create client - client = ::Google::Cloud::SecurityCenterManagement::V1::SecurityCenterManagement::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.get_event_threat_detection_custom_module({ name: name }) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use named arguments - client.get_event_threat_detection_custom_module name: name do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object - client.get_event_threat_detection_custom_module ::Google::Cloud::SecurityCenterManagement::V1::GetEventThreatDetectionCustomModuleRequest.new(name: name) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use hash object with options - client.get_event_threat_detection_custom_module({ 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_event_threat_detection_custom_module(::Google::Cloud::SecurityCenterManagement::V1::GetEventThreatDetectionCustomModuleRequest.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_event_threat_detection_custom_module_client_stub.call_rpc_count - end - end - - def test_create_event_threat_detection_custom_module - # Create GRPC objects. - grpc_response = ::Google::Cloud::SecurityCenterManagement::V1::EventThreatDetectionCustomModule.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" - event_threat_detection_custom_module = {} - validate_only = true - - create_event_threat_detection_custom_module_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :create_event_threat_detection_custom_module, name - assert_kind_of ::Google::Cloud::SecurityCenterManagement::V1::CreateEventThreatDetectionCustomModuleRequest, request - assert_equal "hello world", request["parent"] - assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::SecurityCenterManagement::V1::EventThreatDetectionCustomModule), request["event_threat_detection_custom_module"] - assert_equal true, request["validate_only"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, create_event_threat_detection_custom_module_client_stub do - # Create client - client = ::Google::Cloud::SecurityCenterManagement::V1::SecurityCenterManagement::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.create_event_threat_detection_custom_module({ parent: parent, event_threat_detection_custom_module: event_threat_detection_custom_module, validate_only: validate_only }) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use named arguments - client.create_event_threat_detection_custom_module parent: parent, event_threat_detection_custom_module: event_threat_detection_custom_module, validate_only: validate_only do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object - client.create_event_threat_detection_custom_module ::Google::Cloud::SecurityCenterManagement::V1::CreateEventThreatDetectionCustomModuleRequest.new(parent: parent, event_threat_detection_custom_module: event_threat_detection_custom_module, validate_only: validate_only) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use hash object with options - client.create_event_threat_detection_custom_module({ parent: parent, event_threat_detection_custom_module: event_threat_detection_custom_module, validate_only: validate_only }, grpc_options) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object with options - client.create_event_threat_detection_custom_module(::Google::Cloud::SecurityCenterManagement::V1::CreateEventThreatDetectionCustomModuleRequest.new(parent: parent, event_threat_detection_custom_module: event_threat_detection_custom_module, validate_only: validate_only), grpc_options) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Verify method calls - assert_equal 5, create_event_threat_detection_custom_module_client_stub.call_rpc_count - end - end - - def test_update_event_threat_detection_custom_module - # Create GRPC objects. - grpc_response = ::Google::Cloud::SecurityCenterManagement::V1::EventThreatDetectionCustomModule.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. - update_mask = {} - event_threat_detection_custom_module = {} - validate_only = true - - update_event_threat_detection_custom_module_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :update_event_threat_detection_custom_module, name - assert_kind_of ::Google::Cloud::SecurityCenterManagement::V1::UpdateEventThreatDetectionCustomModuleRequest, request - assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Protobuf::FieldMask), request["update_mask"] - assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::SecurityCenterManagement::V1::EventThreatDetectionCustomModule), request["event_threat_detection_custom_module"] - assert_equal true, request["validate_only"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, update_event_threat_detection_custom_module_client_stub do - # Create client - client = ::Google::Cloud::SecurityCenterManagement::V1::SecurityCenterManagement::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.update_event_threat_detection_custom_module({ update_mask: update_mask, event_threat_detection_custom_module: event_threat_detection_custom_module, validate_only: validate_only }) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use named arguments - client.update_event_threat_detection_custom_module update_mask: update_mask, event_threat_detection_custom_module: event_threat_detection_custom_module, validate_only: validate_only do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object - client.update_event_threat_detection_custom_module ::Google::Cloud::SecurityCenterManagement::V1::UpdateEventThreatDetectionCustomModuleRequest.new(update_mask: update_mask, event_threat_detection_custom_module: event_threat_detection_custom_module, validate_only: validate_only) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use hash object with options - client.update_event_threat_detection_custom_module({ update_mask: update_mask, event_threat_detection_custom_module: event_threat_detection_custom_module, validate_only: validate_only }, grpc_options) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object with options - client.update_event_threat_detection_custom_module(::Google::Cloud::SecurityCenterManagement::V1::UpdateEventThreatDetectionCustomModuleRequest.new(update_mask: update_mask, event_threat_detection_custom_module: event_threat_detection_custom_module, validate_only: validate_only), grpc_options) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Verify method calls - assert_equal 5, update_event_threat_detection_custom_module_client_stub.call_rpc_count - end - end - - def test_delete_event_threat_detection_custom_module - # 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" - validate_only = true - - delete_event_threat_detection_custom_module_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :delete_event_threat_detection_custom_module, name - assert_kind_of ::Google::Cloud::SecurityCenterManagement::V1::DeleteEventThreatDetectionCustomModuleRequest, request - assert_equal "hello world", request["name"] - assert_equal true, request["validate_only"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, delete_event_threat_detection_custom_module_client_stub do - # Create client - client = ::Google::Cloud::SecurityCenterManagement::V1::SecurityCenterManagement::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.delete_event_threat_detection_custom_module({ name: name, validate_only: validate_only }) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use named arguments - client.delete_event_threat_detection_custom_module name: name, validate_only: validate_only do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object - client.delete_event_threat_detection_custom_module ::Google::Cloud::SecurityCenterManagement::V1::DeleteEventThreatDetectionCustomModuleRequest.new(name: name, validate_only: validate_only) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use hash object with options - client.delete_event_threat_detection_custom_module({ name: name, validate_only: validate_only }, grpc_options) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object with options - client.delete_event_threat_detection_custom_module(::Google::Cloud::SecurityCenterManagement::V1::DeleteEventThreatDetectionCustomModuleRequest.new(name: name, validate_only: validate_only), grpc_options) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Verify method calls - assert_equal 5, delete_event_threat_detection_custom_module_client_stub.call_rpc_count - end - end - - def test_validate_event_threat_detection_custom_module - # Create GRPC objects. - grpc_response = ::Google::Cloud::SecurityCenterManagement::V1::ValidateEventThreatDetectionCustomModuleResponse.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" - raw_text = "hello world" - type = "hello world" - - validate_event_threat_detection_custom_module_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :validate_event_threat_detection_custom_module, name - assert_kind_of ::Google::Cloud::SecurityCenterManagement::V1::ValidateEventThreatDetectionCustomModuleRequest, request - assert_equal "hello world", request["parent"] - assert_equal "hello world", request["raw_text"] - assert_equal "hello world", request["type"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, validate_event_threat_detection_custom_module_client_stub do - # Create client - client = ::Google::Cloud::SecurityCenterManagement::V1::SecurityCenterManagement::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.validate_event_threat_detection_custom_module({ parent: parent, raw_text: raw_text, type: type }) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use named arguments - client.validate_event_threat_detection_custom_module parent: parent, raw_text: raw_text, type: type do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object - client.validate_event_threat_detection_custom_module ::Google::Cloud::SecurityCenterManagement::V1::ValidateEventThreatDetectionCustomModuleRequest.new(parent: parent, raw_text: raw_text, type: type) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use hash object with options - client.validate_event_threat_detection_custom_module({ parent: parent, raw_text: raw_text, type: type }, grpc_options) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object with options - client.validate_event_threat_detection_custom_module(::Google::Cloud::SecurityCenterManagement::V1::ValidateEventThreatDetectionCustomModuleRequest.new(parent: parent, raw_text: raw_text, type: type), grpc_options) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Verify method calls - assert_equal 5, validate_event_threat_detection_custom_module_client_stub.call_rpc_count - end - end - - def test_get_security_center_service - # Create GRPC objects. - grpc_response = ::Google::Cloud::SecurityCenterManagement::V1::SecurityCenterService.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" - show_eligible_modules_only = true - - get_security_center_service_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :get_security_center_service, name - assert_kind_of ::Google::Cloud::SecurityCenterManagement::V1::GetSecurityCenterServiceRequest, request - assert_equal "hello world", request["name"] - assert_equal true, request["show_eligible_modules_only"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, get_security_center_service_client_stub do - # Create client - client = ::Google::Cloud::SecurityCenterManagement::V1::SecurityCenterManagement::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.get_security_center_service({ name: name, show_eligible_modules_only: show_eligible_modules_only }) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use named arguments - client.get_security_center_service name: name, show_eligible_modules_only: show_eligible_modules_only do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object - client.get_security_center_service ::Google::Cloud::SecurityCenterManagement::V1::GetSecurityCenterServiceRequest.new(name: name, show_eligible_modules_only: show_eligible_modules_only) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use hash object with options - client.get_security_center_service({ name: name, show_eligible_modules_only: show_eligible_modules_only }, grpc_options) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object with options - client.get_security_center_service(::Google::Cloud::SecurityCenterManagement::V1::GetSecurityCenterServiceRequest.new(name: name, show_eligible_modules_only: show_eligible_modules_only), grpc_options) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Verify method calls - assert_equal 5, get_security_center_service_client_stub.call_rpc_count - end - end - - def test_list_security_center_services - # Create GRPC objects. - grpc_response = ::Google::Cloud::SecurityCenterManagement::V1::ListSecurityCenterServicesResponse.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" - show_eligible_modules_only = true - - list_security_center_services_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :list_security_center_services, name - assert_kind_of ::Google::Cloud::SecurityCenterManagement::V1::ListSecurityCenterServicesRequest, request - assert_equal "hello world", request["parent"] - assert_equal 42, request["page_size"] - assert_equal "hello world", request["page_token"] - assert_equal true, request["show_eligible_modules_only"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, list_security_center_services_client_stub do - # Create client - client = ::Google::Cloud::SecurityCenterManagement::V1::SecurityCenterManagement::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.list_security_center_services({ parent: parent, page_size: page_size, page_token: page_token, show_eligible_modules_only: show_eligible_modules_only }) 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_security_center_services parent: parent, page_size: page_size, page_token: page_token, show_eligible_modules_only: show_eligible_modules_only 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_security_center_services ::Google::Cloud::SecurityCenterManagement::V1::ListSecurityCenterServicesRequest.new(parent: parent, page_size: page_size, page_token: page_token, show_eligible_modules_only: show_eligible_modules_only) 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_security_center_services({ parent: parent, page_size: page_size, page_token: page_token, show_eligible_modules_only: show_eligible_modules_only }, 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_security_center_services(::Google::Cloud::SecurityCenterManagement::V1::ListSecurityCenterServicesRequest.new(parent: parent, page_size: page_size, page_token: page_token, show_eligible_modules_only: show_eligible_modules_only), 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_security_center_services_client_stub.call_rpc_count - end - end - - def test_update_security_center_service - # Create GRPC objects. - grpc_response = ::Google::Cloud::SecurityCenterManagement::V1::SecurityCenterService.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. - security_center_service = {} - update_mask = {} - validate_only = true - - update_security_center_service_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :update_security_center_service, name - assert_kind_of ::Google::Cloud::SecurityCenterManagement::V1::UpdateSecurityCenterServiceRequest, request - assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::SecurityCenterManagement::V1::SecurityCenterService), request["security_center_service"] - assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Protobuf::FieldMask), request["update_mask"] - assert_equal true, request["validate_only"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, update_security_center_service_client_stub do - # Create client - client = ::Google::Cloud::SecurityCenterManagement::V1::SecurityCenterManagement::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.update_security_center_service({ security_center_service: security_center_service, update_mask: update_mask, validate_only: validate_only }) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use named arguments - client.update_security_center_service security_center_service: security_center_service, update_mask: update_mask, validate_only: validate_only do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object - client.update_security_center_service ::Google::Cloud::SecurityCenterManagement::V1::UpdateSecurityCenterServiceRequest.new(security_center_service: security_center_service, update_mask: update_mask, validate_only: validate_only) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use hash object with options - client.update_security_center_service({ security_center_service: security_center_service, update_mask: update_mask, validate_only: validate_only }, grpc_options) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object with options - client.update_security_center_service(::Google::Cloud::SecurityCenterManagement::V1::UpdateSecurityCenterServiceRequest.new(security_center_service: security_center_service, update_mask: update_mask, validate_only: validate_only), grpc_options) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Verify method calls - assert_equal 5, update_security_center_service_client_stub.call_rpc_count - end - end - - def test_configure - grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - - client = block_config = config = nil - dummy_stub = ClientStub.new nil, nil - Gapic::ServiceStub.stub :new, dummy_stub do - client = ::Google::Cloud::SecurityCenterManagement::V1::SecurityCenterManagement::Client.new do |config| - config.credentials = grpc_channel - end - end - - config = client.configure do |c| - block_config = c - end - - assert_same block_config, config - assert_kind_of ::Google::Cloud::SecurityCenterManagement::V1::SecurityCenterManagement::Client::Configuration, config - end - - def test_credentials - key = OpenSSL::PKey::RSA.new 2048 - cred_json = { - "private_key" => key.to_pem, - "client_email" => "app@developer.gserviceaccount.com", - "type" => "service_account" - } - key_file = StringIO.new cred_json.to_json - creds = Google::Auth::ServiceAccountCredentials.make_creds({ json_key_io: key_file }) - - dummy_stub = ClientStub.new nil, nil - Gapic::ServiceStub.stub :new, dummy_stub do - client = ::Google::Cloud::SecurityCenterManagement::V1::SecurityCenterManagement::Client.new do |config| - config.credentials = creds - end - assert_kind_of ::Google::Cloud::SecurityCenterManagement::V1::SecurityCenterManagement::Client, client - assert_equal creds, client.configure.credentials - end - end -end diff --git a/owl-bot-staging/google-cloud-security_center_management-v1/test/helper.rb b/owl-bot-staging/google-cloud-security_center_management-v1/test/helper.rb deleted file mode 100644 index 672b337030e7..000000000000 --- a/owl-bot-staging/google-cloud-security_center_management-v1/test/helper.rb +++ /dev/null @@ -1,26 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -require "minitest/autorun" -require "minitest/focus" -require "minitest/mock" -require "minitest/rg" - -require "grpc" - -require "ostruct"